[
  {
    "path": ".gitattributes",
    "content": "src/clientversion.cpp export-subst\n"
  },
  {
    "path": ".gitignore",
    "content": "*.tar.gz\n\n*.exe\nsrc/sugarchain\nsrc/sugarchaind\nsrc/sugarchain-cli\nsrc/sugarchain-tx\nsrc/test/test_sugarchain\nsrc/test/test_sugarchain_fuzzy\nsrc/qt/test/test_sugarchain-qt\n\n# autoreconf\nMakefile.in\naclocal.m4\nautom4te.cache/\nbuild-aux/config.guess\nbuild-aux/config.sub\nbuild-aux/depcomp\nbuild-aux/install-sh\nbuild-aux/ltmain.sh\nbuild-aux/m4/libtool.m4\nbuild-aux/m4/lt~obsolete.m4\nbuild-aux/m4/ltoptions.m4\nbuild-aux/m4/ltsugar.m4\nbuild-aux/m4/ltversion.m4\nbuild-aux/missing\nbuild-aux/compile\nbuild-aux/test-driver\nconfig.log\nconfig.status\nconfigure\nlibtool\nsrc/config/bitcoin-config.h\nsrc/config/bitcoin-config.h.in\nsrc/config/stamp-h1\nshare/setup.nsi\nshare/qt/Info.plist\n\nsrc/univalue/gen\n\nsrc/qt/*.moc\nsrc/qt/moc_*.cpp\nsrc/qt/forms/ui_*.h\n\nsrc/qt/test/moc*.cpp\n\nsrc/qt/bitcoin-qt.config\nsrc/qt/bitcoin-qt.creator\nsrc/qt/bitcoin-qt.creator.user\nsrc/qt/bitcoin-qt.files\nsrc/qt/bitcoin-qt.includes\n\n.deps\n.dirstamp\n.libs\n.*.swp\n*.*~*\n*.bak\n*.rej\n*.orig\n*.pyc\n*.o\n*.o-*\n*.patch\n*.a\n*.pb.cc\n*.pb.h\n\n*.log\n*.trs\n*.dmg\n\n*.json.h\n*.raw.h\n\n#libtool object files\n*.lo\n*.la\n\n# Compilation and Qt preprocessor part\n*.qm\nMakefile\nsugarchain-qt\nSugarchain-Qt.app\nbackground.tiff*\n\n# Unit-tests\nMakefile.test\nsugarchain-qt_test\n\n# Resources cpp\nqrc_*.cpp\n\n# Mac specific\n.DS_Store\nbuild\n\n#lcov\n*.gcno\n*.gcda\n/*.info\ntest_sugarchain.coverage/\ntotal.coverage/\ncoverage_percent.txt\n\n#build tests\nlinux-coverage-build\nlinux-build\nwin32-build\ntest/config.ini\ntest/cache/*\n\n!src/leveldb*/Makefile\n\n/doc/doxygen/\n\nlibbitcoinconsensus.pc\ncontrib/devtools/split-debug.sh\n\n# cryptozeny tools\ninit.sh\n\n# linearlize (bootstrap)\ncontrib/linearize/hashlist.txt\n\n# Berkeley DB (./contrib/install_db4.sh `pwd`)\ndb-4.8.30.NC.tar.gz\n/db4/\n"
  },
  {
    "path": ".travis.yml",
    "content": "sudo: required\ndist: trusty\nos: linux\nlanguage: minimal\ncache:\n  directories:\n  - depends/built\n  - depends/sdk-sources\n  - $HOME/.ccache\ngit:\n  depth: false  # full clone for git subtree check, this works around issue #12388\nenv:\n  global:\n    - MAKEJOBS=-j3\n    - RUN_TESTS=false\n    - RUN_FUNCTIONAL=false # disabled - test/functional/test_runner.py\n    - CHECK_DOC=0\n    - BOOST_TEST_RANDOM=1$TRAVIS_BUILD_ID\n    - CCACHE_SIZE=100M\n    - CCACHE_TEMPDIR=/tmp/.ccache-temp\n    - CCACHE_COMPRESS=1\n    - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out\n    - SDK_URL=https://bitcoincore.org/depends-sources/sdks\n    - WINEDEBUG=fixme-all\n    - YESPOWER_PATH=$TRAVIS_BUILD_DIR/src/crypto/yespower-1.0.1\n    - YESPOWER_OPTION=\"-fPIE -Wall -O2 -fomit-frame-pointer\"\n    - YESPOWER_MSSE2_32BIT=\"-msse2\"\n    - WIN_BITCOIN_CONFIG=\"--disable-shared\"\n  matrix:\n# ARM\n    - >\n      HOST=arm-linux-gnueabihf\n      PACKAGES=\"g++-arm-linux-gnueabihf python3-pip\"\n      DEP_OPTS=\"NO_QT=1\"\n      CHECK_DOC=1\n      GOAL=\"install\"\n      BITCOIN_CONFIG=\"--enable-glibc-back-compat --enable-reduce-exports\"\n# Win32\n    - >\n      HOST=i686-w64-mingw32\n      DPKG_ADD_ARCH=\"i386\"\n      DEP_OPTS=\"NO_QT=1\"\n      PACKAGES=\"python3 nsis g++-mingw-w64-i686 wine1.6\"\n      RUN_TESTS=true\n      GOAL=\"install\"\n      BITCOIN_CONFIG=\"--enable-reduce-exports $WIN_BITCOIN_CONFIG\"\n    # disabled (slow \"make check\") # YESPOWER_OPTION=\"$YESPOWER_OPTION $YESPOWER_MSSE2_32BIT\"\n# Qt4 & system libs\n    - >\n      HOST=x86_64-unknown-linux-gnu\n      PACKAGES=\"python3-zmq qt4-dev-tools libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libdb5.1++-dev libminiupnpc-dev libzmq3-dev libprotobuf-dev protobuf-compiler libqrencode-dev xvfb\"\n      NO_DEPENDS=1\n      NEED_XVFB=1\n      RUN_TESTS=true\n      GOAL=\"install\"\n      BITCOIN_CONFIG=\"--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt4 CPPFLAGS=-DDEBUG_LOCKORDER\"\n# 32-bit + dash\n    - >\n      HOST=i686-pc-linux-gnu\n      PACKAGES=\"g++-multilib python3-zmq\"\n      DEP_OPTS=\"NO_QT=1\"\n      RUN_TESTS=true\n      GOAL=\"install\"\n      BITCOIN_CONFIG=\"--enable-zmq --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++\"\n      USE_SHELL=\"/bin/dash\"\n    # disabled (slow \"make check\") # YESPOWER_OPTION=\"$YESPOWER_OPTION $YESPOWER_MSSE2_32BIT\"\n# Win64\n    - >\n      HOST=x86_64-w64-mingw32\n      DPKG_ADD_ARCH=\"i386\"\n      DEP_OPTS=\"NO_QT=1\"\n      PACKAGES=\"python3 nsis g++-mingw-w64-x86-64 wine1.6\"\n      RUN_TESTS=true\n      GOAL=\"install\"\n      BITCOIN_CONFIG=\"--enable-reduce-exports $WIN_BITCOIN_CONFIG\"\n# x86_64 Linux (uses qt5 dev package instead of depends Qt to speed up build and avoid timeout)\n    - >\n      HOST=x86_64-unknown-linux-gnu\n      PACKAGES=\"python3-zmq qtbase5-dev qttools5-dev-tools protobuf-compiler libdbus-1-dev libharfbuzz-dev\"\n      DEP_OPTS=\"NO_QT=1 NO_UPNP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1\"\n      RUN_TESTS=true\n      GOAL=\"install\"\n      BITCOIN_CONFIG=\"--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports CPPFLAGS=-DDEBUG_LOCKORDER\"\n# x86_64 Linux, No wallet\n    - >\n      HOST=x86_64-unknown-linux-gnu\n      PACKAGES=\"python3\"\n      DEP_OPTS=\"NO_WALLET=1\"\n      RUN_TESTS=true\n      GOAL=\"install\"\n      BITCOIN_CONFIG=\"--enable-glibc-back-compat --enable-reduce-exports\"\n# Cross-Mac\n    - >\n      HOST=x86_64-apple-darwin11\n      PACKAGES=\"cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev\"\n      BITCOIN_CONFIG=\"--enable-gui --enable-reduce-exports --enable-werror\"\n      OSX_SDK=10.11\n      GOAL=\"deploy\"\n\nbefore_install:\n    - export PATH=$(echo $PATH | tr ':' \"\\n\" | sed '/\\/opt\\/python/d' | tr \"\\n\" \":\" | sed \"s|::|:|g\")\ninstall:\n    - if [ -n \"$DPKG_ADD_ARCH\" ]; then sudo dpkg --add-architecture \"$DPKG_ADD_ARCH\" ; fi\n    - if [ -n \"$PACKAGES\" ]; then travis_retry sudo apt-get update; fi\n    - if [ -n \"$PACKAGES\" ]; then travis_retry sudo apt-get install --no-install-recommends --no-upgrade -qq $PACKAGES; fi\n    - if [ \"$CHECK_DOC\" = 1 -a \"$TRAVIS_EVENT_TYPE\" = \"pull_request\" ]; then travis_retry pip3 install pathlib2 flake8 --user; fi\nbefore_script:\n    - if [ \"$CHECK_DOC\" = 1 -a \"$TRAVIS_EVENT_TYPE\" = \"pull_request\" ]; then contrib/devtools/commit-script-check.sh $TRAVIS_COMMIT_RANGE; fi\n    - if [ \"$CHECK_DOC\" = 1 ]; then contrib/devtools/git-subtree-check.sh src/crypto/ctaes; fi\n    - if [ \"$CHECK_DOC\" = 1 ]; then contrib/devtools/git-subtree-check.sh src/secp256k1; fi\n    - if [ \"$CHECK_DOC\" = 1 ]; then contrib/devtools/git-subtree-check.sh src/univalue; fi\n    - if [ \"$CHECK_DOC\" = 1 ]; then contrib/devtools/git-subtree-check.sh src/leveldb; fi\n    - if [ \"$CHECK_DOC\" = 1 ]; then contrib/devtools/check-doc.py; fi\n    - if [ \"$CHECK_DOC\" = 1 ]; then contrib/devtools/check-rpc-mappings.py .; fi\n    - if [ \"$CHECK_DOC\" = 1 -a \"$TRAVIS_EVENT_TYPE\" = \"pull_request\" ]; then contrib/devtools/lint-all.sh; fi\n    - unset CC; unset CXX\n    - mkdir -p depends/SDKs depends/sdk-sources\n    - if [ -n \"$OSX_SDK\" -a ! -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then curl --location --fail $SDK_URL/MacOSX${OSX_SDK}.sdk.tar.gz -o depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi\n    - if [ -n \"$OSX_SDK\" -a -f depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz ]; then tar -C depends/SDKs -xf depends/sdk-sources/MacOSX${OSX_SDK}.sdk.tar.gz; fi\n    - if [ -z \"$NO_DEPENDS\" ]; then make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS; fi\n    # Start xvfb if needed, as documented at https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI\n    - if [ \"$NEED_XVFB\" = 1 ]; then export DISPLAY=:99.0; /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac; fi\nscript:\n    - if [ \"$CHECK_DOC\" = 1 -a \"$TRAVIS_REPO_SLUG\" = \"bitcoin/bitcoin\" -a \"$TRAVIS_PULL_REQUEST\" = \"false\" ]; then while read LINE; do travis_retry gpg --keyserver hkp://subset.pool.sks-keyservers.net --recv-keys $LINE; done < contrib/verify-commits/trusted-keys; fi\n    - if [ \"$CHECK_DOC\" = 1 -a \"$TRAVIS_REPO_SLUG\" = \"bitcoin/bitcoin\" -a \"$TRAVIS_PULL_REQUEST\" = \"false\" ]; then contrib/verify-commits/verify-commits.sh; fi\n    - export TRAVIS_COMMIT_LOG=`git log --format=fuller -1`\n    - if [ -n \"$USE_SHELL\" ]; then export CONFIG_SHELL=\"$USE_SHELL\"; fi\n    - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST\n    - BITCOIN_CONFIG_ALL=\"--disable-dependency-tracking --prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib\"\n    - if [ -z \"$NO_DEPENDS\" ]; then depends/$HOST/native/bin/ccache --max-size=$CCACHE_SIZE; fi\n    - test -n \"$USE_SHELL\" && eval '\"$USE_SHELL\" -c \"./autogen.sh\"' || ./autogen.sh\n    - mkdir build && cd build\n    - ../configure CFLAGS=\"-I$YESPOWER_PATH $YESPOWER_OPTION\" --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false)\n    - make distdir VERSION=$HOST\n    - cd sugarchain-$HOST\n    - ./configure CFLAGS=\"-I$YESPOWER_PATH $YESPOWER_OPTION\" --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( cat config.log && false)\n    - make $MAKEJOBS $GOAL || ( echo \"Build failure. Verbose build follows.\" && make $GOAL V=1 ; false )\n    - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib\n    - if [ \"$RUN_TESTS\" = \"true\" ]; then travis_wait 60 make $MAKEJOBS check VERBOSE=1; fi\n    - if [ \"$TRAVIS_EVENT_TYPE\" = \"cron\" ]; then extended=\"--extended --exclude feature_pruning,feature_dbcrash\"; fi\n    - if [ \"$RUN_FUNCTIONAL\" = \"true\" ]; then test/functional/test_runner.py --combinedlogslen=4000 --coverage --quiet ${extended}; fi\nafter_script:\n    - echo $TRAVIS_COMMIT_RANGE\n    - echo $TRAVIS_COMMIT_LOG\n"
  },
  {
    "path": ".tx/config",
    "content": "[main]\nhost = https://www.transifex.com\n\n[bitcoin.qt-translation-016x]\nfile_filter = src/qt/locale/bitcoin_<lang>.ts\nsource_file = src/qt/locale/bitcoin_en.ts\nsource_lang = en\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "Contributing to Bitcoin Core\n============================\n\nThe Bitcoin Core project operates an open contributor model where anyone is\nwelcome to contribute towards development in the form of peer review, testing\nand patches. This document explains the practical process and guidelines for\ncontributing.\n\nFirstly in terms of structure, there is no particular concept of \"Core\ndevelopers\" in the sense of privileged people. Open source often naturally\nrevolves around meritocracy where longer term contributors gain more trust from\nthe developer community. However, some hierarchy is necessary for practical\npurposes. As such there are repository \"maintainers\" who are responsible for\nmerging pull requests as well as a \"lead maintainer\" who is responsible for the\nrelease cycle, overall merging, moderation and appointment of maintainers.\n\n\nContributor Workflow\n--------------------\n\nThe codebase is maintained using the \"contributor workflow\" where everyone\nwithout exception contributes patch proposals using \"pull requests\". This\nfacilitates social contribution, easy testing and peer review.\n\nTo contribute a patch, the workflow is as follows:\n\n  1. Fork repository\n  1. Create topic branch\n  1. Commit patches\n\nThe project coding conventions in the [developer notes](doc/developer-notes.md)\nmust be adhered to.\n\nIn general [commits should be atomic](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention)\nand diffs should be easy to read. For this reason do not mix any formatting\nfixes or code moves with actual code changes.\n\nCommit messages should be verbose by default consisting of a short subject line\n(50 chars max), a blank line and detailed explanatory text as separate\nparagraph(s), unless the title alone is self-explanatory (like \"Corrected typo\nin init.cpp\") in which case a single title line is sufficient. Commit messages should be\nhelpful to people reading your code in the future, so explain the reasoning for\nyour decisions. Further explanation [here](http://chris.beams.io/posts/git-commit/).\n\nIf a particular commit references another issue, please add the reference. For\nexample: `refs #1234` or `fixes #4321`. Using the `fixes` or `closes` keywords\nwill cause the corresponding issue to be closed when the pull request is merged.\n\nPlease refer to the [Git manual](https://git-scm.com/doc) for more information\nabout Git.\n\n  - Push changes to your fork\n  - Create pull request\n\nThe title of the pull request should be prefixed by the component or area that\nthe pull request affects. Valid areas as:\n\n  - *Consensus* for changes to consensus critical code\n  - *Docs* for changes to the documentation\n  - *Qt* for changes to bitcoin-qt\n  - *Mining* for changes to the mining code\n  - *Net* or *P2P* for changes to the peer-to-peer network code\n  - *RPC/REST/ZMQ* for changes to the RPC, REST or ZMQ APIs\n  - *Scripts and tools* for changes to the scripts and tools\n  - *Tests* for changes to the bitcoin unit tests or QA tests\n  - *Trivial* should **only** be used for PRs that do not change generated\n    executable code. Notably, refactors (change of function arguments and code\n    reorganization) and changes in behavior should **not** be marked as trivial.\n    Examples of trivial PRs are changes to:\n    - comments\n    - whitespace\n    - variable names\n    - logging and messages\n  - *Utils and libraries* for changes to the utils and libraries\n  - *Wallet* for changes to the wallet code\n\nExamples:\n\n    Consensus: Add new opcode for BIP-XXXX OP_CHECKAWESOMESIG\n    Net: Automatically create hidden service, listen on Tor\n    Qt: Add feed bump button\n    Trivial: Fix typo in init.cpp\n\nNote that translations should not be submitted as pull requests, please see\n[Translation Process](https://github.com/bitcoin/bitcoin/blob/master/doc/translation_process.md) \nfor more information on helping with translations.\n\nIf a pull request is not to be considered for merging (yet), please\nprefix the title with [WIP] or use [Tasks Lists](https://help.github.com/articles/basic-writing-and-formatting-syntax/#task-lists)\nin the body of the pull request to indicate tasks are pending.\n\nThe body of the pull request should contain enough description about what the\npatch does together with any justification/reasoning. You should include\nreferences to any discussions (for example other tickets or mailing list\ndiscussions).\n\nAt this stage one should expect comments and review from other contributors. You\ncan add more commits to your pull request by committing them locally and pushing\nto your fork until you have satisfied all feedback.\n\nSquashing Commits\n---------------------------\nIf your pull request is accepted for merging, you may be asked by a maintainer\nto squash and or [rebase](https://git-scm.com/docs/git-rebase) your commits\nbefore it will be merged. The basic squashing workflow is shown below.\n\n    git checkout your_branch_name\n    git rebase -i HEAD~n\n    # n is normally the number of commits in the pull\n    # set commits from 'pick' to 'squash', save and quit\n    # on the next screen, edit/refine commit messages\n    # save and quit\n    git push -f # (force push to GitHub)\n\nIf you have problems with squashing (or other workflows with `git`), you can\nalternatively enable \"Allow edits from maintainers\" in the right GitHub\nsidebar and ask for help in the pull request.\n\nPlease refrain from creating several pull requests for the same change.\nUse the pull request that is already open (or was created earlier) to amend\nchanges. This preserves the discussion and review that happened earlier for\nthe respective change set.\n\nThe length of time required for peer review is unpredictable and will vary from\npull request to pull request.\n\n\nPull Request Philosophy\n-----------------------\n\nPatchsets should always be focused. For example, a pull request could add a\nfeature, fix a bug, or refactor code; but not a mixture. Please also avoid super\npull requests which attempt to do too much, are overly large, or overly complex\nas this makes review difficult.\n\n\n### Features\n\nWhen adding a new feature, thought must be given to the long term technical debt\nand maintenance that feature may require after inclusion. Before proposing a new\nfeature that will require maintenance, please consider if you are willing to\nmaintain it (including bug fixing). If features get orphaned with no maintainer\nin the future, they may be removed by the Repository Maintainer.\n\n\n### Refactoring\n\nRefactoring is a necessary part of any software project's evolution. The\nfollowing guidelines cover refactoring pull requests for the project.\n\nThere are three categories of refactoring, code only moves, code style fixes,\ncode refactoring. In general refactoring pull requests should not mix these\nthree kinds of activity in order to make refactoring pull requests easy to\nreview and uncontroversial. In all cases, refactoring PRs must not change the\nbehaviour of code within the pull request (bugs must be preserved as is).\n\nProject maintainers aim for a quick turnaround on refactoring pull requests, so\nwhere possible keep them short, uncomplex and easy to verify.\n\nPull requests that refactor the code should not be made by new contributors. It\nrequires a certain level of experience to know where the code belongs to and to\nunderstand the full ramification (including rebase effort of open pull requests).\n\nTrivial pull requests or pull requests that refactor the code with no clear\nbenefits may be immediately closed by the maintainers to reduce unnecessary\nworkload on reviewing.\n\n\n\"Decision Making\" Process\n-------------------------\n\nThe following applies to code changes to the Bitcoin Core project (and related\nprojects such as libsecp256k1), and is not to be confused with overall Bitcoin\nNetwork Protocol consensus changes.\n\nWhether a pull request is merged into Bitcoin Core rests with the project merge\nmaintainers and ultimately the project lead.\n\nMaintainers will take into consideration if a patch is in line with the general\nprinciples of the project; meets the minimum standards for inclusion; and will\njudge the general consensus of contributors.\n\nIn general, all pull requests must:\n\n  - Have a clear use case, fix a demonstrable bug or serve the greater good of\n    the project (for example refactoring for modularisation);\n  - Be well peer reviewed;\n  - Have unit tests and functional tests where appropriate;\n  - Follow code style guidelines ([C++](doc/developer-notes.md), [functional tests](test/functional/README.md));\n  - Not break the existing test suite;\n  - Where bugs are fixed, where possible, there should be unit tests\n    demonstrating the bug and also proving the fix. This helps prevent regression.\n\nPatches that change Bitcoin consensus rules are considerably more involved than\nnormal because they affect the entire ecosystem and so must be preceded by\nextensive mailing list discussions and have a numbered BIP. While each case will\nbe different, one should be prepared to expend more time and effort than for\nother kinds of patches because of increased peer review and consensus building\nrequirements.\n\n\n### Peer Review\n\nAnyone may participate in peer review which is expressed by comments in the pull\nrequest. Typically reviewers will review the code for obvious errors, as well as\ntest out the patch set and opine on the technical merits of the patch. Project\nmaintainers take into account the peer review when determining if there is\nconsensus to merge a pull request (remember that discussions may have been\nspread out over GitHub, mailing list and IRC discussions). The following\nlanguage is used within pull-request comments:\n\n  - ACK means \"I have tested the code and I agree it should be merged\";\n  - NACK means \"I disagree this should be merged\", and must be accompanied by\n    sound technical justification (or in certain cases of copyright/patent/licensing\n    issues, legal justification). NACKs without accompanying reasoning may be\n    disregarded;\n  - utACK means \"I have not tested the code, but I have reviewed it and it looks\n    OK, I agree it can be merged\";\n  - Concept ACK means \"I agree in the general principle of this pull request\";\n  - Nit refers to trivial, often non-blocking issues.\n\nReviewers should include the commit hash which they reviewed in their comments.\n\nProject maintainers reserve the right to weigh the opinions of peer reviewers\nusing common sense judgement and also may weight based on meritocracy: Those\nthat have demonstrated a deeper commitment and understanding towards the project\n(over time) or have clear domain expertise may naturally have more weight, as\none would expect in all walks of life.\n\nWhere a patch set affects consensus critical code, the bar will be set much\nhigher in terms of discussion and peer review requirements, keeping in mind that\nmistakes could be very costly to the wider community. This includes refactoring\nof consensus critical code.\n\nWhere a patch set proposes to change the Bitcoin consensus, it must have been\ndiscussed extensively on the mailing list and IRC, be accompanied by a widely\ndiscussed BIP and have a generally widely perceived technical consensus of being\na worthwhile change based on the judgement of the maintainers.\n\n### Finding Reviewers\n\nAs most reviewers are themselves developers with their own projects, the review\nprocess can be quite lengthy, and some amount of patience is required. If you find\nthat you've been waiting for a pull request to be given attention for several\nmonths, there may be a number of reasons for this, some of which you can do something\nabout:\n\n  - It may be because of a feature freeze due to an upcoming release. During this time,\n    only bug fixes are taken into consideration. If your pull request is a new feature,\n    it will not be prioritized until the release is over. Wait for release.\n  - It may be because the changes you are suggesting do not appeal to people. Rather than\n    nits and critique, which require effort and means they care enough to spend time on your\n    contribution, thundering silence is a good sign of widespread (mild) dislike of a given change\n    (because people don't assume *others* won't actually like the proposal). Don't take\n    that personally, though! Instead, take another critical look at what you are suggesting\n    and see if it: changes too much, is too broad, doesn't adhere to the\n    [developer notes](doc/developer-notes.md), is dangerous or insecure, is messily written, etc.\n    Identify and address any of the issues you find. Then ask e.g. on IRC if someone could give\n    their opinion on the concept itself.\n  - It may be because your code is too complex for all but a few people. And those people\n    may not have realized your pull request even exists. A great way to find people who\n    are qualified and care about the code you are touching is the\n    [Git Blame feature](https://help.github.com/articles/tracing-changes-in-a-file/). Simply\n    find the person touching the code you are touching before you and see if you can find\n    them and give them a nudge. Don't be incessant about the nudging though.\n  - Finally, if all else fails, ask on IRC or elsewhere for someone to give your pull request\n    a look. If you think you've been waiting an unreasonably long amount of time (month+) for\n    no particular reason (few lines changed, etc), this is totally fine. Try to return the favor\n    when someone else is asking for feedback on their code, and universe balances out.\n\n\nRelease Policy\n--------------\n\nThe project leader is the release manager for each Bitcoin Core release.\n\nCopyright\n---------\n\nBy contributing to this repository, you agree to license your work under the \nMIT license unless specified otherwise in `contrib/debian/copyright` or at \nthe top of the file itself. Any work contributed where you are not the original \nauthor must contain its license header with the original author(s) and source.\n"
  },
  {
    "path": "COPYING",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2009-2010 Satoshi Nakamoto\nCopyright (c) 2009-2018 The Bitcoin Core developers\nCopyright (c) 2013-2019 Alexander Peslyak - Yespower 1.0.1\nCopyright (c) 2016-2018 The Zcash developers - DigiShieldZEC\nCopyright (c) 2018-2020 The Sugarchain Yumekawa developers\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "INSTALL.md",
    "content": "Building Bitcoin\n================\n\nSee doc/build-*.md for instructions on building the various\nelements of the Bitcoin Core reference implementation of Bitcoin.\n"
  },
  {
    "path": "Makefile.am",
    "content": "# Copyright (c) 2013-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nACLOCAL_AMFLAGS = -I build-aux/m4\nSUBDIRS = src\nif ENABLE_MAN\nSUBDIRS += doc/man\nendif\n.PHONY: deploy FORCE\n\nexport PYTHONPATH\n\nif BUILD_BITCOIN_LIBS\npkgconfigdir = $(libdir)/pkgconfig\npkgconfig_DATA = libbitcoinconsensus.pc\nendif\n\nBITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)\nBITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT)\nBITCOIN_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT)\nBITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)\n\nempty :=\nspace := $(empty) $(empty)\n\nOSX_APP=Sugarchain-Qt.app\nOSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))\nOSX_DMG = $(OSX_VOLNAME).dmg\nOSX_BACKGROUND_SVG=background.svg\nOSX_BACKGROUND_IMAGE=background.tiff\nOSX_BACKGROUND_IMAGE_DPIS=36 72\nOSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py\nOSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus\nOSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist\nOSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns\nOSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed\nOSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW\n\nDIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)\nDIST_CONTRIB = $(top_srcdir)/contrib/bitcoin-cli.bash-completion \\\n\t       $(top_srcdir)/contrib/bitcoin-tx.bash-completion \\\n\t       $(top_srcdir)/contrib/bitcoind.bash-completion \\\n\t       $(top_srcdir)/contrib/init \\\n\t       $(top_srcdir)/contrib/install_db4.sh \\\n\t       $(top_srcdir)/contrib/rpm\nDIST_SHARE = \\\n  $(top_srcdir)/share/genbuild.sh \\\n  $(top_srcdir)/share/rpcauth\n\nBIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \\\n           $(top_srcdir)/contrib/devtools/security-check.py\n\nWINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \\\n  $(top_srcdir)/share/pixmaps/nsis-header.bmp \\\n  $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \\\n  $(top_srcdir)/doc/README_windows.txt\n\nOSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \\\n  $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \\\n  $(OSX_DSSTORE_GEN) \\\n  $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \\\n  $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh\n\nCOVERAGE_INFO = baseline.info \\\n  test_bitcoin_filtered.info total_coverage.info \\\n  baseline_filtered.info functional_test.info functional_test_filtered.info \\\n  test_bitcoin_coverage.info test_bitcoin.info\n\ndist-hook:\n\t-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -\n\n$(BITCOIN_WIN_INSTALLER): all-recursive\n\t$(MKDIR_P) $(top_builddir)/release\n\tSTRIPPROG=\"$(STRIP)\" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release\n\tSTRIPPROG=\"$(STRIP)\" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release\n\tSTRIPPROG=\"$(STRIP)\" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release\n\t@test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \\\n\t  echo error: could not build $@\n\t@echo built $@\n\n$(OSX_APP)/Contents/PkgInfo:\n\t$(MKDIR_P) $(@D)\n\t@echo \"APPL????\" > $@\n\n$(OSX_APP)/Contents/Resources/empty.lproj:\n\t$(MKDIR_P) $(@D)\n\t@touch $@ \n\n$(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)\n\t$(MKDIR_P) $(@D)\n\t$(INSTALL_DATA) $< $@\n\n$(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)\n\t$(MKDIR_P) $(@D)\n\t$(INSTALL_DATA) $< $@\n\n$(OSX_APP)/Contents/MacOS/Sugarchain-Qt: $(BITCOIN_QT_BIN)\n\t$(MKDIR_P) $(@D)\n\tSTRIPPROG=\"$(STRIP)\" $(INSTALL_STRIP_PROGRAM)  $< $@\n\n$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:\n\t$(MKDIR_P) $(@D)\n\techo '{\tCFBundleDisplayName = \"$(PACKAGE_NAME)\"; CFBundleName = \"$(PACKAGE_NAME)\"; }' > $@\n\nOSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \\\n  $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \\\n  $(OSX_APP)/Contents/MacOS/Sugarchain-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings\n\nosx_volname:\n\techo $(OSX_VOLNAME) >$@\n\nif BUILD_DARWIN\n$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE)\n\t$(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 -volname $(OSX_VOLNAME)\n\n$(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)\n\tsed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < \"$<\" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@\n$(OSX_BACKGROUND_IMAGE)@2x.png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)\n\tsed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < \"$<\" | $(RSVG_CONVERT) -f png -d 72 -p 72 -o $@\n$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE).png $(OSX_BACKGROUND_IMAGE)@2x.png\n\ttiffutil -cathidpicheck $^ -out $@\n\ndeploydir: $(OSX_DMG)\nelse\nAPP_DIST_DIR=$(top_builddir)/dist\nAPP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications\n\n$(APP_DIST_DIR)/Applications:\n\t@rm -f $@\n\t@cd $(@D); $(LN_S) /Applications $(@F)\n\n$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Sugarchain-Qt\n\n$(OSX_DMG): $(APP_DIST_EXTRAS)\n\t$(GENISOIMAGE) -no-cache-inodes -D -l -probe -V \"$(OSX_VOLNAME)\" -no-pad -r -dir-mode 0755 -apple -o $@ dist\n\ndpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)\n\tsed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < \"$<\" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@\nOSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))\n$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)\n\t$(MKDIR_P) $(@D)\n\t$(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@\n\n$(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)\n\t$(PYTHON) $< \"$@\" \"$(OSX_VOLNAME)\"\n\n$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Sugarchain-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)\n\tINSTALLNAMETOOL=$(INSTALLNAMETOOL)  OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2\n\ndeploydir: $(APP_DIST_EXTRAS)\nendif\n\nif TARGET_DARWIN\nappbundle: $(OSX_APP_BUILT)\ndeploy: $(OSX_DMG)\nendif\nif TARGET_WINDOWS\ndeploy: $(BITCOIN_WIN_INSTALLER)\nendif\n\n$(BITCOIN_QT_BIN): FORCE\n\t$(MAKE) -C src qt/$(@F)\n\n$(BITCOIND_BIN): FORCE\n\t$(MAKE) -C src $(@F)\n\n$(BITCOIN_CLI_BIN): FORCE\n\t$(MAKE) -C src $(@F)\n\nif USE_LCOV\nLCOV_FILTER_PATTERN=-p \"/usr/include/\" -p \"src/leveldb/\" -p \"src/bench/\" -p \"src/univalue\" -p \"src/crypto/ctaes\" -p \"src/secp256k1\"\n\nbaseline.info:\n\t$(LCOV) -c -i -d $(abs_builddir)/src -o $@\n\nbaseline_filtered.info: baseline.info\n\t$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@\n\t$(LCOV) -a $@ $(LCOV_OPTS) -o $@\n\ntest_bitcoin.info: baseline_filtered.info\n\t$(MAKE) -C src/ check\n\t$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src -t test_bitcoin -o $@\n\t$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src\n\ntest_bitcoin_filtered.info: test_bitcoin.info\n\t$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@\n\t$(LCOV) -a $@ $(LCOV_OPTS) -o $@\n\nfunctional_test.info: test_bitcoin_filtered.info\n\t-@TIMEOUT=15 test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)\n\t$(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t functional-tests -o $@\n\t$(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src\n\nfunctional_test_filtered.info: functional_test.info\n\t$(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@\n\t$(LCOV) -a $@ $(LCOV_OPTS) -o $@\n\ntest_bitcoin_coverage.info: baseline_filtered.info test_bitcoin_filtered.info\n\t$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_bitcoin_filtered.info -o $@\n\ntotal_coverage.info: test_bitcoin_filtered.info functional_test_filtered.info\n\t$(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_bitcoin_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) \"\\%\" | $(AWK) '{ print substr($$3,2,50) \"/\" $$5 }' > coverage_percent.txt\n\ntest_bitcoin.coverage/.dirstamp:  test_bitcoin_coverage.info\n\t$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)\n\t@touch $@\n\ntotal.coverage/.dirstamp: total_coverage.info\n\t$(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)\n\t@touch $@\n\ncov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp\n\nendif\n\ndist_noinst_SCRIPTS = autogen.sh\n\nEXTRA_DIST = $(DIST_SHARE) test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)\n\nEXTRA_DIST += \\\n    test/util/bitcoin-util-test.py \\\n    test/util/data/bitcoin-util-test.json \\\n    test/util/data/blanktxv1.hex \\\n    test/util/data/blanktxv1.json \\\n    test/util/data/blanktxv2.hex \\\n    test/util/data/blanktxv2.json \\\n    test/util/data/tt-delin1-out.hex \\\n    test/util/data/tt-delin1-out.json \\\n    test/util/data/tt-delout1-out.hex \\\n    test/util/data/tt-delout1-out.json \\\n    test/util/data/tt-locktime317000-out.hex \\\n    test/util/data/tt-locktime317000-out.json \\\n    test/util/data/tx394b54bb.hex \\\n    test/util/data/txcreate1.hex \\\n    test/util/data/txcreate1.json \\\n    test/util/data/txcreate2.hex \\\n    test/util/data/txcreate2.json \\\n    test/util/data/txcreatedata1.hex \\\n    test/util/data/txcreatedata1.json \\\n    test/util/data/txcreatedata2.hex \\\n    test/util/data/txcreatedata2.json \\\n    test/util/data/txcreatedata_seq0.hex \\\n    test/util/data/txcreatedata_seq0.json \\\n    test/util/data/txcreatedata_seq1.hex \\\n    test/util/data/txcreatedata_seq1.json \\\n    test/util/data/txcreatemultisig1.hex \\\n    test/util/data/txcreatemultisig1.json \\\n    test/util/data/txcreatemultisig2.hex \\\n    test/util/data/txcreatemultisig2.json \\\n    test/util/data/txcreatemultisig3.hex \\\n    test/util/data/txcreatemultisig3.json \\\n    test/util/data/txcreatemultisig4.hex \\\n    test/util/data/txcreatemultisig4.json \\\n    test/util/data/txcreatemultisig5.json \\\n    test/util/data/txcreateoutpubkey1.hex \\\n    test/util/data/txcreateoutpubkey1.json \\\n    test/util/data/txcreateoutpubkey2.hex \\\n    test/util/data/txcreateoutpubkey2.json \\\n    test/util/data/txcreateoutpubkey3.hex \\\n    test/util/data/txcreateoutpubkey3.json \\\n    test/util/data/txcreatescript1.hex \\\n    test/util/data/txcreatescript1.json \\\n    test/util/data/txcreatescript2.hex \\\n    test/util/data/txcreatescript2.json \\\n    test/util/data/txcreatescript3.hex \\\n    test/util/data/txcreatescript3.json \\\n    test/util/data/txcreatescript4.hex \\\n    test/util/data/txcreatescript4.json \\\n    test/util/data/txcreatesignv1.hex \\\n    test/util/data/txcreatesignv1.json \\\n    test/util/data/txcreatesignv2.hex\n\nCLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)\n\n.INTERMEDIATE: $(COVERAGE_INFO)\n\nDISTCHECK_CONFIGURE_FLAGS = --enable-man\n\nclean-local:\n\trm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)\n\trm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache\n"
  },
  {
    "path": "README.md",
    "content": "Sugarchain Yumekawa\n===================\n[![Build Status](https://travis-ci.org/sugarchain-project/sugarchain.svg?branch=master-v0.16.3)](https://travis-ci.org/sugarchain-project/sugarchain)\n![GitHub All Releases](https://img.shields.io/github/downloads/sugarchain-project/sugarchain/total)\n\nhttps://sugarchain.org\n\n\nThe Meaning of Yumekawa\n-----------------------\nSugarchain's first node software is called `Yumekawa (夢川)`. It can be translated in some ways.\n- \"Yume (夢)\" means dream and \"Kawa (川)\" means river. So its `Dream River` in japanese.\n- The second letter \"Kawa\" stands for \"Kawaii (可愛い)\". In this case the meaning is `Dreamy Cute`.\n- Also Yumekawa is replaces the word `Core` (ie: Bitcoin Core). We think it sounds a bit centralized.\n\n\nLicense\n-------\nSugarchain Yumekawa is released under the terms of the MIT license. See [COPYING](COPYING) for more\ninformation or see https://opensource.org/licenses/MIT.\n- Copyright (c) 2009-2010 Satoshi Nakamoto\n- Copyright (c) 2009-2018 The Bitcoin Core developers\n- Copyright (c) 2013-2019 Alexander Peslyak - Yespower 1.0.1\n- Copyright (c) 2016-2018 The Zcash developers - DigiShieldZEC\n- Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n\n\nMinimum Requirement\n-------------------\n- CPU: 1 Core\n- RAM: 2048 MB (at least 3 GB [swap](https://github.com/sugarchain-project/doc/blob/master/swap.md))\n- DISK: HDD 5 GB\n\n\nDepends on Bitcoin Core\n-----------------------\nExactly the same as dependencies of [Bitcoin Core v0.16.3](https://github.com/bitcoin/bitcoin/tree/49e34e288005a5b144a642e197b628396f5a0765).\n\n- Debian 10 (Recommended, No PPA)\n```bash\nsudo apt-get install -y \\\nsoftware-properties-common build-essential libtool autotools-dev automake pkg-config \\\nlibssl-dev libevent-dev bsdmainutils libboost-all-dev \\\nlibminiupnpc-dev libzmq3-dev libqt5gui5 libqt5core5a \\\nlibqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev \\\nprotobuf-compiler libqrencode-dev help2man\n```\n\n- PPA is *only* for Ubuntu. No `libdb4.8-dev` and `libdb4.8++-dev` packages on Debian.\n\n- <details><summary>Old Ubuntu</summary>\n\n  * Ubuntu 16.04\n  ```bash\n  sudo add-apt-repository -y ppa:bitcoin/bitcoin && \\\n  sudo apt-get update && \\\n  sudo apt-get install -y \\\n  libdb4.8-dev libdb4.8++-dev \\\n  software-properties-common build-essential libtool autotools-dev automake pkg-config \\\n  libssl-dev libevent-dev bsdmainutils libboost-all-dev \\\n  libminiupnpc-dev libzmq3-dev libqt5gui5 libqt5core5a \\\n  libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev \\\n  protobuf-compiler libqrencode-dev help2man\n  ```\n\n  * Ubuntu 18.04+\n  ```bash\n  sudo add-apt-repository -y ppa:luke-jr/bitcoincore && \\\n  sudo apt-get update && \\\n  sudo apt-get install -y \\\n  libdb4.8-dev libdb4.8++-dev \\\n  software-properties-common build-essential libtool autotools-dev automake pkg-config \\\n  libssl-dev libevent-dev bsdmainutils libboost-all-dev \\\n  libminiupnpc-dev libzmq3-dev libqt5gui5 libqt5core5a \\\n  libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev \\\n  protobuf-compiler libqrencode-dev help2man\n  ```\n</details>\n\n\nBuild\n-----\n- Debian 10+ (Recommended, No PPA)\n```bash\n./autogen.sh && \\\n./contrib/install_db4.sh `pwd` && \\\nexport BDB_PREFIX=$PWD/db4 && \\\n./configure BDB_LIBS=\"-L${BDB_PREFIX}/lib -ldb_cxx-4.8\" BDB_CFLAGS=\"-I${BDB_PREFIX}/include\" && \\\nmake -j$(nproc) && \\\nmake check -j$(nproc)\n```\n\n- (optional) Following can be deleted `rm -rf db4/ && rm -f db-4.8.30.NC.tar.gz`\n\n- <details><summary>Old Ubuntu</summary>\n\n  * Ubuntu 16.04+\n  ```bash\n  ./autogen.sh && \\\n  ./configure && \\\n  make -j$(nproc) && \\\n  make check -j$(nproc)\n  ```\n</details>\n\n\nOptions after Build\n-------------------\n- (optional) Reduce binary size using strip (about 90% file size reduction)\n```bash\nstrip ./src/sugarchain-cli && \\\nstrip ./src/sugarchaind && \\\nstrip ./src/qt/sugarchain-qt && \\\nstrip ./src/sugarchain-tx && \\\nstrip ./src/test/test_sugarchain\n```\n\n- (optional) After bump version on `configure.ac`, update binary docs (manpages) using help2man `.1` files\n```bash\nmake -j$(nproc) && ./contrib/devtools/gen-manpages.sh\n```\n\n- (optional) build for Windows and OSX you may need `--disable-shared` option with make.\n\n- (optional) Add seeds/nodes from [DNSSEED](https://github.com/sugarchain-project/sugarchain-seeder)  \n  https://github.com/sugarchain-project/sugarchain/tree/master-v0.16.3/contrib/seeds\n\n\nUnit Test\n---------\nAll Sugarchain Yumekawa developers should execute this unit test. Some updates may break these tests in some occasions.\n\n- Test All\n```bash\n./src/test/test_sugarchain test_bitcoin --log_level=test_suite\n```\n\n- (optional) Test Partially: ie `blockencodings_tests`\n```bash\n./src/test/test_sugarchain test_bitcoin --log_level=test_suite --run_test=blockencodings_tests\n```\n\n- (optional) Test QT (GUI)\n```bash\n./src/qt/test/test_sugarchain-qt\n```\n\n\nRun\n---\nThe options `-rpcuser`, `-rpcpassword`, and `-printtoconsole` are optional. `server=1` needed by RPC servers or cpuminer when solo-mining.\n\n- Mainnet: debug mode: `net` for Network\n  > ./src/qt/sugarchain-qt -server=1 -rpcuser=rpcuser -rpcpassword=rpcpassword **-debug=net** -printtoconsole\n\n- Testnet\n  > ./src/qt/sugarchain-qt **-testnet**\n\n- Regtest\n  > ./src/qt/sugarchain-qt **-regtest**\n\n- Reference  \n  https://en.bitcoin.it/w/index.php?title=Running_Bitcoin&oldid=66644\n\n\nCLI\n---\n- `-prunedebuglogfile`: Prune (limit) filesize of debug.log\n  > ./src/qt/sugarchain-qt -prunedebuglogfile\n\n  > 2020-09-15 19:41:34 DEBUG.LOG PRUNED at 10000063\n\n\nKnown Issues\n------------\n- Transaction too large:\n  * This is a part of BTC, and hopefully will be fixed in next *Taproot* Softfork.\n- Slow update balance on wallet:\n  * This slow is a part of BTC.\n  * Update total balance *every minute (12 blocks)* interval.\n  * A workaround at this moment. [source](https://github.com/sugarchain-project/sugarchain/commit/72436c90b29844cf507895df053103f9b6840776#diff-2e3836af182cfb375329c3463ffd91f8)\n- Poor performance on ARM CPUs (32/64-Bit):\n  * No ARM optimization for Yespower yet.\n- Poor performance on 32-Bit OS:\n  * No SSE2 optimization for Yespower yet. [source](https://github.com/sugarchain-project/sugarchain/blob/d977987a83aba115d50a9130f0d7914330d1bc75/src/crypto/yespower-1.0.1/yespower-opt.c#L59)\n- Slow startup on low memory machines:\n  * Startup can take up to some hours on 1cpu 1024ram (+swap 3GB) VPS.\n  * Workaround is just increase RAM at least 2 GB.\n\n\nRelease Process using GITIAN\n----------------------------\n- All Sugarchain Yumekawa developers should do following GITIAN release process. It's the safest way to distribute binaries to people.\n- Please use GITIAN release with checking PGP signature, or compile it yourself on your own machine.\n\nhttps://gist.github.com/cryptozeny/3501c77750541208b9dd1a9e9719fc53\n"
  },
  {
    "path": "autogen.sh",
    "content": "#!/bin/sh\n# Copyright (c) 2013-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nset -e\nsrcdir=\"$(dirname $0)\"\ncd \"$srcdir\"\nif [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE=\"`which glibtoolize 2>/dev/null`\"; then\n  LIBTOOLIZE=\"${GLIBTOOLIZE}\"\n  export LIBTOOLIZE\nfi\nwhich autoreconf >/dev/null || \\\n  (echo \"configuration failed, please install autoconf first\" && exit 1)\nautoreconf --install --force --warnings=all\n"
  },
  {
    "path": "build-aux/m4/ax_boost_base.m4",
    "content": "# ===========================================================================\n#       http://www.gnu.org/software/autoconf-archive/ax_boost_base.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])\n#\n# DESCRIPTION\n#\n#   Test for the Boost C++ libraries of a particular version (or newer)\n#\n#   If no path to the installed boost library is given the macro searchs\n#   under /usr, /usr/local, /opt and /opt/local and evaluates the\n#   $BOOST_ROOT environment variable. Further documentation is available at\n#   <http://randspringer.de/boost/index.html>.\n#\n#   This macro calls:\n#\n#     AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)\n#\n#   And sets:\n#\n#     HAVE_BOOST\n#\n# LICENSE\n#\n#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>\n#   Copyright (c) 2009 Peter Adolphs\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved. This file is offered as-is, without any\n#   warranty.\n\n#serial 27\n\nAC_DEFUN([AX_BOOST_BASE],\n[\nAC_ARG_WITH([boost],\n  [AS_HELP_STRING([--with-boost@<:@=ARG@:>@],\n    [use Boost library from a standard location (ARG=yes),\n     from the specified location (ARG=<path>),\n     or disable it (ARG=no)\n     @<:@ARG=yes@:>@ ])],\n    [\n    if test \"$withval\" = \"no\"; then\n        want_boost=\"no\"\n    elif test \"$withval\" = \"yes\"; then\n        want_boost=\"yes\"\n        ac_boost_path=\"\"\n    else\n        want_boost=\"yes\"\n        ac_boost_path=\"$withval\"\n    fi\n    ],\n    [want_boost=\"yes\"])\n\n\nAC_ARG_WITH([boost-libdir],\n        AS_HELP_STRING([--with-boost-libdir=LIB_DIR],\n        [Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),\n        [\n        if test -d \"$withval\"\n        then\n                ac_boost_lib_path=\"$withval\"\n        else\n                AC_MSG_ERROR(--with-boost-libdir expected directory name)\n        fi\n        ],\n        [ac_boost_lib_path=\"\"]\n)\n\nif test \"x$want_boost\" = \"xyes\"; then\n    boost_lib_version_req=ifelse([$1], ,1.20.0,$1)\n    boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\\([[0-9]]*\\.[[0-9]]*\\)'`\n    boost_lib_version_req_major=`expr $boost_lib_version_req : '\\([[0-9]]*\\)'`\n    boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\\.\\([[0-9]]*\\)'`\n    boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\\.[[0-9]]*\\.\\([[0-9]]*\\)'`\n    if test \"x$boost_lib_version_req_sub_minor\" = \"x\" ; then\n        boost_lib_version_req_sub_minor=\"0\"\n        fi\n    WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \\* 100000 \\+  $boost_lib_version_req_minor \\* 100 \\+ $boost_lib_version_req_sub_minor`\n    AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)\n    succeeded=no\n\n    dnl On 64-bit systems check for system libraries in both lib64 and lib.\n    dnl The former is specified by FHS, but e.g. Debian does not adhere to\n    dnl this (as it rises problems for generic multi-arch support).\n    dnl The last entry in the list is chosen by default when no libraries\n    dnl are found, e.g. when only header-only libraries are installed!\n    libsubdirs=\"lib\"\n    ax_arch=`uname -m`\n    case $ax_arch in\n      x86_64)\n        libsubdirs=\"lib64 libx32 lib lib64\"\n        ;;\n      ppc64|s390x|sparc64|aarch64|ppc64le)\n        libsubdirs=\"lib64 lib lib64\"\n        ;;\n    esac\n\n    dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give\n    dnl them priority over the other paths since, if libs are found there, they\n    dnl are almost assuredly the ones desired.\n    AC_REQUIRE([AC_CANONICAL_HOST])\n    libsubdirs=\"lib/${host_cpu}-${host_os} $libsubdirs\"\n\n    case ${host_cpu} in\n      i?86)\n        libsubdirs=\"lib/i386-${host_os} $libsubdirs\"\n        ;;\n    esac\n\n    dnl some arches may advertise a cpu type that doesn't line up with their\n    dnl prefix's cpu type. For example, uname may report armv7l while libs are\n    dnl installed to /usr/lib/arm-linux-gnueabihf. Try getting the compiler's\n    dnl value for an extra chance of finding the correct path.\n    libsubdirs=\"lib/`$CXX -dumpmachine 2>/dev/null` $libsubdirs\"\n\n    dnl first we check the system location for boost libraries\n    dnl this location ist chosen if boost libraries are installed with the --layout=system option\n    dnl or if you install boost with RPM\n    if test \"$ac_boost_path\" != \"\"; then\n        BOOST_CPPFLAGS=\"-I$ac_boost_path/include\"\n        for ac_boost_path_tmp in $libsubdirs; do\n                if test -d \"$ac_boost_path\"/\"$ac_boost_path_tmp\" ; then\n                        BOOST_LDFLAGS=\"-L$ac_boost_path/$ac_boost_path_tmp\"\n                        break\n                fi\n        done\n    elif test \"$cross_compiling\" != yes; then\n        for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do\n            if test -d \"$ac_boost_path_tmp/include/boost\" && test -r \"$ac_boost_path_tmp/include/boost\"; then\n                for libsubdir in $libsubdirs ; do\n                    if ls \"$ac_boost_path_tmp/$libsubdir/libboost_\"* >/dev/null 2>&1 ; then break; fi\n                done\n                BOOST_LDFLAGS=\"-L$ac_boost_path_tmp/$libsubdir\"\n                BOOST_CPPFLAGS=\"-I$ac_boost_path_tmp/include\"\n                break;\n            fi\n        done\n    fi\n\n    dnl overwrite ld flags if we have required special directory with\n    dnl --with-boost-libdir parameter\n    if test \"$ac_boost_lib_path\" != \"\"; then\n       BOOST_LDFLAGS=\"-L$ac_boost_lib_path\"\n    fi\n\n    CPPFLAGS_SAVED=\"$CPPFLAGS\"\n    CPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\n    export CPPFLAGS\n\n    LDFLAGS_SAVED=\"$LDFLAGS\"\n    LDFLAGS=\"$LDFLAGS $BOOST_LDFLAGS\"\n    export LDFLAGS\n\n    AC_REQUIRE([AC_PROG_CXX])\n    AC_LANG_PUSH(C++)\n        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n    @%:@include <boost/version.hpp>\n    ]], [[\n    #if BOOST_VERSION >= $WANT_BOOST_VERSION\n    // Everything is okay\n    #else\n    #  error Boost version is too old\n    #endif\n    ]])],[\n        AC_MSG_RESULT(yes)\n    succeeded=yes\n    found_system=yes\n        ],[\n        ])\n    AC_LANG_POP([C++])\n\n\n\n    dnl if we found no boost with system layout we search for boost libraries\n    dnl built and installed without the --layout=system option or for a staged(not installed) version\n    if test \"x$succeeded\" != \"xyes\"; then\n        CPPFLAGS=\"$CPPFLAGS_SAVED\"\n        LDFLAGS=\"$LDFLAGS_SAVED\"\n        BOOST_CPPFLAGS=\n        BOOST_LDFLAGS=\n        _version=0\n        if test \"$ac_boost_path\" != \"\"; then\n            if test -d \"$ac_boost_path\" && test -r \"$ac_boost_path\"; then\n                for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do\n                    _version_tmp=`echo $i | sed \"s#$ac_boost_path##\" | sed 's/\\/include\\/boost-//' | sed 's/_/./'`\n                    V_CHECK=`expr $_version_tmp \\> $_version`\n                    if test \"$V_CHECK\" = \"1\" ; then\n                        _version=$_version_tmp\n                    fi\n                    VERSION_UNDERSCORE=`echo $_version | sed 's/\\./_/'`\n                    BOOST_CPPFLAGS=\"-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE\"\n                done\n                dnl if nothing found search for layout used in Windows distributions\n                if test -z \"$BOOST_CPPFLAGS\"; then\n                    if test -d \"$ac_boost_path/boost\" && test -r \"$ac_boost_path/boost\"; then\n                        BOOST_CPPFLAGS=\"-I$ac_boost_path\"\n                    fi\n                fi\n            fi\n        else\n            if test \"$cross_compiling\" != yes; then\n                for ac_boost_path in /usr /usr/local /opt /opt/local ; do\n                    if test -d \"$ac_boost_path\" && test -r \"$ac_boost_path\"; then\n                        for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do\n                            _version_tmp=`echo $i | sed \"s#$ac_boost_path##\" | sed 's/\\/include\\/boost-//' | sed 's/_/./'`\n                            V_CHECK=`expr $_version_tmp \\> $_version`\n                            if test \"$V_CHECK\" = \"1\" ; then\n                                _version=$_version_tmp\n                                best_path=$ac_boost_path\n                            fi\n                        done\n                    fi\n                done\n\n                VERSION_UNDERSCORE=`echo $_version | sed 's/\\./_/'`\n                BOOST_CPPFLAGS=\"-I$best_path/include/boost-$VERSION_UNDERSCORE\"\n                if test \"$ac_boost_lib_path\" = \"\"; then\n                    for libsubdir in $libsubdirs ; do\n                        if ls \"$best_path/$libsubdir/libboost_\"* >/dev/null 2>&1 ; then break; fi\n                    done\n                    BOOST_LDFLAGS=\"-L$best_path/$libsubdir\"\n                fi\n            fi\n\n            if test \"x$BOOST_ROOT\" != \"x\"; then\n                for libsubdir in $libsubdirs ; do\n                    if ls \"$BOOST_ROOT/stage/$libsubdir/libboost_\"* >/dev/null 2>&1 ; then break; fi\n                done\n                if test -d \"$BOOST_ROOT\" && test -r \"$BOOST_ROOT\" && test -d \"$BOOST_ROOT/stage/$libsubdir\" && test -r \"$BOOST_ROOT/stage/$libsubdir\"; then\n                    version_dir=`expr //$BOOST_ROOT : '.*/\\(.*\\)'`\n                    stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`\n                        stage_version_shorten=`expr $stage_version : '\\([[0-9]]*\\.[[0-9]]*\\)'`\n                    V_CHECK=`expr $stage_version_shorten \\>\\= $_version`\n                    if test \"$V_CHECK\" = \"1\" -a \"$ac_boost_lib_path\" = \"\" ; then\n                        AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)\n                        BOOST_CPPFLAGS=\"-I$BOOST_ROOT\"\n                        BOOST_LDFLAGS=\"-L$BOOST_ROOT/stage/$libsubdir\"\n                    fi\n                fi\n            fi\n        fi\n\n        CPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\n        export CPPFLAGS\n        LDFLAGS=\"$LDFLAGS $BOOST_LDFLAGS\"\n        export LDFLAGS\n\n        AC_LANG_PUSH(C++)\n            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n        @%:@include <boost/version.hpp>\n        ]], [[\n        #if BOOST_VERSION >= $WANT_BOOST_VERSION\n        // Everything is okay\n        #else\n        #  error Boost version is too old\n        #endif\n        ]])],[\n            AC_MSG_RESULT(yes)\n        succeeded=yes\n        found_system=yes\n            ],[\n            ])\n        AC_LANG_POP([C++])\n    fi\n\n    if test \"$succeeded\" != \"yes\" ; then\n        if test \"$_version\" = \"0\" ; then\n            AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \\$BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])\n        else\n            AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])\n        fi\n        # execute ACTION-IF-NOT-FOUND (if present):\n        ifelse([$3], , :, [$3])\n    else\n        AC_SUBST(BOOST_CPPFLAGS)\n        AC_SUBST(BOOST_LDFLAGS)\n        AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])\n        # execute ACTION-IF-FOUND (if present):\n        ifelse([$2], , :, [$2])\n    fi\n\n    CPPFLAGS=\"$CPPFLAGS_SAVED\"\n    LDFLAGS=\"$LDFLAGS_SAVED\"\nfi\n\n])\n"
  },
  {
    "path": "build-aux/m4/ax_boost_chrono.m4",
    "content": "# ===========================================================================\n#      http://www.gnu.org/software/autoconf-archive/ax_boost_chrono.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_BOOST_CHRONO\n#\n# DESCRIPTION\n#\n#   Test for System library from the Boost C++ libraries. The macro requires\n#   a preceding call to AX_BOOST_BASE. Further documentation is available at\n#   <http://randspringer.de/boost/index.html>.\n#\n#   This macro calls:\n#\n#     AC_SUBST(BOOST_CHRONO_LIB)\n#\n#   And sets:\n#\n#     HAVE_BOOST_CHRONO\n#\n# LICENSE\n#\n#   Copyright (c) 2012 Xiyue Deng <manphiz@gmail.com>\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved. This file is offered as-is, without any\n#   warranty.\n\n#serial 1\n\nAC_DEFUN([AX_BOOST_CHRONO],\n[\n\tAC_ARG_WITH([boost-chrono],\n\tAS_HELP_STRING([--with-boost-chrono@<:@=special-lib@:>@],\n                   [use the Chrono library from boost - it is possible to specify a certain library for the linker\n                        e.g. --with-boost-chrono=boost_chrono-gcc-mt ]),\n        [\n        if test \"$withval\" = \"no\"; then\n\t\t\twant_boost=\"no\"\n        elif test \"$withval\" = \"yes\"; then\n            want_boost=\"yes\"\n            ax_boost_user_chrono_lib=\"\"\n        else\n\t\t    want_boost=\"yes\"\n\t\tax_boost_user_chrono_lib=\"$withval\"\n\t\tfi\n        ],\n        [want_boost=\"yes\"]\n\t)\n\n\tif test \"x$want_boost\" = \"xyes\"; then\n        AC_REQUIRE([AC_PROG_CC])\n        AC_REQUIRE([AC_CANONICAL_BUILD])\n\t\tCPPFLAGS_SAVED=\"$CPPFLAGS\"\n\t\tCPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\n\t\texport CPPFLAGS\n\n\t\tLDFLAGS_SAVED=\"$LDFLAGS\"\n\t\tLDFLAGS=\"$LDFLAGS $BOOST_LDFLAGS\"\n\t\texport LDFLAGS\n\n        AC_CACHE_CHECK(whether the Boost::Chrono library is available,\n\t\t\t\t\t   ax_cv_boost_chrono,\n        [AC_LANG_PUSH([C++])\n\t\t\t CXXFLAGS_SAVE=$CXXFLAGS\n\n\t\t\t AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/chrono.hpp>]],\n                                   [[boost::chrono::system_clock::time_point time;]])],\n                   ax_cv_boost_chrono=yes, ax_cv_boost_chrono=no)\n\t\t\t CXXFLAGS=$CXXFLAGS_SAVE\n             AC_LANG_POP([C++])\n\t\t])\n\t\tif test \"x$ax_cv_boost_chrono\" = \"xyes\"; then\n\t\t\tAC_SUBST(BOOST_CPPFLAGS)\n\n\t\t\tAC_DEFINE(HAVE_BOOST_CHRONO,,[define if the Boost::Chrono library is available])\n            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\\/@:>@*//'`\n\n\t\t\tLDFLAGS_SAVE=$LDFLAGS\n            if test \"x$ax_boost_user_chrono_lib\" = \"x\"; then\n                ax_lib=\n                for libextension in `ls $BOOSTLIBDIR/libboost_chrono*.so* $BOOSTLIBDIR/libboost_chrono*.dylib* $BOOSTLIBDIR/libboost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\\(boost_chrono.*\\)\\.so.*$;\\1;' -e 's;^lib\\(boost_chrono.*\\)\\.dylib.*$;\\1;' -e 's;^lib\\(boost_chrono.*\\)\\.a.*$;\\1;'` ; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_CHRONO_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono=\"yes\"; break],\n                                 [link_chrono=\"no\"])\n\t\t\t\tdone\n                if test \"x$link_chrono\" != \"xyes\"; then\n                for libextension in `ls $BOOSTLIBDIR/boost_chrono*.dll* $BOOSTLIBDIR/boost_chrono*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\\(boost_chrono.*\\)\\.dll.*$;\\1;' -e 's;^\\(boost_chrono.*\\)\\.a.*$;\\1;'` ; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_CHRONO_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono=\"yes\"; break],\n                                 [link_chrono=\"no\"])\n\t\t\t\tdone\n                fi\n\n            else\n               for ax_lib in $ax_boost_user_chrono_lib boost_chrono-$ax_boost_user_chrono_lib; do\n\t\t\t\t      AC_CHECK_LIB($ax_lib, exit,\n                                   [BOOST_CHRONO_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_CHRONO_LIB) link_chrono=\"yes\"; break],\n                                   [link_chrono=\"no\"])\n                  done\n\n            fi\n            if test \"x$ax_lib\" = \"x\"; then\n                AC_MSG_ERROR(Could not find a version of the boost_chrono library!)\n            fi\n\t\t\tif test \"x$link_chrono\" = \"xno\"; then\n\t\t\t\tAC_MSG_ERROR(Could not link against $ax_lib !)\n\t\t\tfi\n\t\tfi\n\n\t\tCPPFLAGS=\"$CPPFLAGS_SAVED\"\n\tLDFLAGS=\"$LDFLAGS_SAVED\"\n\tfi\n])\n"
  },
  {
    "path": "build-aux/m4/ax_boost_filesystem.m4",
    "content": "# ===========================================================================\n#    http://www.gnu.org/software/autoconf-archive/ax_boost_filesystem.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_BOOST_FILESYSTEM\n#\n# DESCRIPTION\n#\n#   Test for Filesystem library from the Boost C++ libraries. The macro\n#   requires a preceding call to AX_BOOST_BASE. Further documentation is\n#   available at <http://randspringer.de/boost/index.html>.\n#\n#   This macro calls:\n#\n#     AC_SUBST(BOOST_FILESYSTEM_LIB)\n#\n#   And sets:\n#\n#     HAVE_BOOST_FILESYSTEM\n#\n# LICENSE\n#\n#   Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>\n#   Copyright (c) 2009 Michael Tindal\n#   Copyright (c) 2009 Roman Rybalko <libtorrent@romanr.info>\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved. This file is offered as-is, without any\n#   warranty.\n\n#serial 26\n\nAC_DEFUN([AX_BOOST_FILESYSTEM],\n[\n\tAC_ARG_WITH([boost-filesystem],\n\tAS_HELP_STRING([--with-boost-filesystem@<:@=special-lib@:>@],\n                   [use the Filesystem library from boost - it is possible to specify a certain library for the linker\n                        e.g. --with-boost-filesystem=boost_filesystem-gcc-mt ]),\n        [\n        if test \"$withval\" = \"no\"; then\n\t\t\twant_boost=\"no\"\n        elif test \"$withval\" = \"yes\"; then\n            want_boost=\"yes\"\n            ax_boost_user_filesystem_lib=\"\"\n        else\n\t\t    want_boost=\"yes\"\n\t\tax_boost_user_filesystem_lib=\"$withval\"\n\t\tfi\n        ],\n        [want_boost=\"yes\"]\n\t)\n\n\tif test \"x$want_boost\" = \"xyes\"; then\n        AC_REQUIRE([AC_PROG_CC])\n\t\tCPPFLAGS_SAVED=\"$CPPFLAGS\"\n\t\tCPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\n\t\texport CPPFLAGS\n\n\t\tLDFLAGS_SAVED=\"$LDFLAGS\"\n\t\tLDFLAGS=\"$LDFLAGS $BOOST_LDFLAGS\"\n\t\texport LDFLAGS\n\n\t\tLIBS_SAVED=$LIBS\n\t\tLIBS=\"$LIBS $BOOST_SYSTEM_LIB\"\n\t\texport LIBS\n\n        AC_CACHE_CHECK(whether the Boost::Filesystem library is available,\n\t\t\t\t\t   ax_cv_boost_filesystem,\n        [AC_LANG_PUSH([C++])\n         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/filesystem/path.hpp>]],\n                                   [[using namespace boost::filesystem;\n                                   path my_path( \"foo/bar/data.txt\" );\n                                   return 0;]])],\n\t\t\t\t\t       ax_cv_boost_filesystem=yes, ax_cv_boost_filesystem=no)\n         AC_LANG_POP([C++])\n\t\t])\n\t\tif test \"x$ax_cv_boost_filesystem\" = \"xyes\"; then\n\t\t\tAC_DEFINE(HAVE_BOOST_FILESYSTEM,,[define if the Boost::Filesystem library is available])\n            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\\/@:>@*//'`\n            ax_lib=\n            if test \"x$ax_boost_user_filesystem_lib\" = \"x\"; then\n                for libextension in `ls -r $BOOSTLIBDIR/libboost_filesystem* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\\..*,,'` ; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_FILESYSTEM_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem=\"yes\"; break],\n                                 [link_filesystem=\"no\"])\n\t\t\t\tdone\n                if test \"x$link_filesystem\" != \"xyes\"; then\n                for libextension in `ls -r $BOOSTLIBDIR/boost_filesystem* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\\..*,,'` ; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_FILESYSTEM_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem=\"yes\"; break],\n                                 [link_filesystem=\"no\"])\n\t\t\t\tdone\n\t\t    fi\n            else\n               for ax_lib in $ax_boost_user_filesystem_lib boost_filesystem-$ax_boost_user_filesystem_lib; do\n\t\t\t\t      AC_CHECK_LIB($ax_lib, exit,\n                                   [BOOST_FILESYSTEM_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_FILESYSTEM_LIB) link_filesystem=\"yes\"; break],\n                                   [link_filesystem=\"no\"])\n                  done\n\n            fi\n            if test \"x$ax_lib\" = \"x\"; then\n                AC_MSG_ERROR(Could not find a version of the boost_filesystem library!)\n            fi\n\t\t\tif test \"x$link_filesystem\" != \"xyes\"; then\n\t\t\t\tAC_MSG_ERROR(Could not link against $ax_lib !)\n\t\t\tfi\n\t\tfi\n\n\t\tCPPFLAGS=\"$CPPFLAGS_SAVED\"\n\t\tLDFLAGS=\"$LDFLAGS_SAVED\"\n\t\tLIBS=\"$LIBS_SAVED\"\n\tfi\n])\n"
  },
  {
    "path": "build-aux/m4/ax_boost_program_options.m4",
    "content": "# ============================================================================\n#  http://www.gnu.org/software/autoconf-archive/ax_boost_program_options.html\n# ============================================================================\n#\n# SYNOPSIS\n#\n#   AX_BOOST_PROGRAM_OPTIONS\n#\n# DESCRIPTION\n#\n#   Test for program options library from the Boost C++ libraries. The macro\n#   requires a preceding call to AX_BOOST_BASE. Further documentation is\n#   available at <http://randspringer.de/boost/index.html>.\n#\n#   This macro calls:\n#\n#     AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB)\n#\n#   And sets:\n#\n#     HAVE_BOOST_PROGRAM_OPTIONS\n#\n# LICENSE\n#\n#   Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved. This file is offered as-is, without any\n#   warranty.\n\n#serial 24\n\nAC_DEFUN([AX_BOOST_PROGRAM_OPTIONS],\n[\n\tAC_ARG_WITH([boost-program-options],\n\t\tAS_HELP_STRING([--with-boost-program-options@<:@=special-lib@:>@],\n                       [use the program options library from boost - it is possible to specify a certain library for the linker\n                        e.g. --with-boost-program-options=boost_program_options-gcc-mt-1_33_1 ]),\n        [\n        if test \"$withval\" = \"no\"; then\n\t\t\twant_boost=\"no\"\n        elif test \"$withval\" = \"yes\"; then\n            want_boost=\"yes\"\n            ax_boost_user_program_options_lib=\"\"\n        else\n\t\t    want_boost=\"yes\"\n\t\tax_boost_user_program_options_lib=\"$withval\"\n\t\tfi\n        ],\n        [want_boost=\"yes\"]\n\t)\n\n\tif test \"x$want_boost\" = \"xyes\"; then\n        AC_REQUIRE([AC_PROG_CC])\n\t    export want_boost\n\t\tCPPFLAGS_SAVED=\"$CPPFLAGS\"\n\t\tCPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\n\t\texport CPPFLAGS\n\t\tLDFLAGS_SAVED=\"$LDFLAGS\"\n\t\tLDFLAGS=\"$LDFLAGS $BOOST_LDFLAGS\"\n\t\texport LDFLAGS\n\t\tAC_CACHE_CHECK([whether the Boost::Program_Options library is available],\n\t\t\t\t\t   ax_cv_boost_program_options,\n\t\t\t\t\t   [AC_LANG_PUSH(C++)\n\t\t\t\tAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/program_options/errors.hpp>\n                                                          ]],\n                                  [[boost::program_options::error err(\"Error message\");\n                                   return 0;]])],\n                           ax_cv_boost_program_options=yes, ax_cv_boost_program_options=no)\n\t\t\t\t\tAC_LANG_POP([C++])\n\t\t])\n\t\tif test \"$ax_cv_boost_program_options\" = yes; then\n\t\t\t\tAC_DEFINE(HAVE_BOOST_PROGRAM_OPTIONS,,[define if the Boost::PROGRAM_OPTIONS library is available])\n                  BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\\/@:>@*//'`\n                if test \"x$ax_boost_user_program_options_lib\" = \"x\"; then\n                for libextension in `ls $BOOSTLIBDIR/libboost_program_options*.so* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\\(boost_program_options.*\\)\\.so.*$;\\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.dylib* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\\(boost_program_options.*\\)\\.dylib.*$;\\1;'` `ls $BOOSTLIBDIR/libboost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\\(boost_program_options.*\\)\\.a.*$;\\1;'` ; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_PROGRAM_OPTIONS_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options=\"yes\"; break],\n                                 [link_program_options=\"no\"])\n\t\t\t\tdone\n                if test \"x$link_program_options\" != \"xyes\"; then\n                for libextension in `ls $BOOSTLIBDIR/boost_program_options*.dll* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\\(boost_program_options.*\\)\\.dll.*$;\\1;'` `ls $BOOSTLIBDIR/boost_program_options*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\\(boost_program_options.*\\)\\.a.*$;\\1;'` ; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_PROGRAM_OPTIONS_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options=\"yes\"; break],\n                                 [link_program_options=\"no\"])\n\t\t\t\tdone\n                fi\n                else\n                  for ax_lib in $ax_boost_user_program_options_lib boost_program_options-$ax_boost_user_program_options_lib; do\n\t\t\t\t      AC_CHECK_LIB($ax_lib, main,\n                                   [BOOST_PROGRAM_OPTIONS_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) link_program_options=\"yes\"; break],\n                                   [link_program_options=\"no\"])\n                  done\n                fi\n            if test \"x$ax_lib\" = \"x\"; then\n                AC_MSG_ERROR(Could not find a version of the boost_program_options library!)\n            fi\n\t\t\t\tif test \"x$link_program_options\" != \"xyes\"; then\n\t\t\t\t\tAC_MSG_ERROR([Could not link against [$ax_lib] !])\n\t\t\t\tfi\n\t\tfi\n\t\tCPPFLAGS=\"$CPPFLAGS_SAVED\"\n\tLDFLAGS=\"$LDFLAGS_SAVED\"\n\tfi\n])\n"
  },
  {
    "path": "build-aux/m4/ax_boost_system.m4",
    "content": "# ===========================================================================\n#      http://www.gnu.org/software/autoconf-archive/ax_boost_system.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_BOOST_SYSTEM\n#\n# DESCRIPTION\n#\n#   Test for System library from the Boost C++ libraries. The macro requires\n#   a preceding call to AX_BOOST_BASE. Further documentation is available at\n#   <http://randspringer.de/boost/index.html>.\n#\n#   This macro calls:\n#\n#     AC_SUBST(BOOST_SYSTEM_LIB)\n#\n#   And sets:\n#\n#     HAVE_BOOST_SYSTEM\n#\n# LICENSE\n#\n#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>\n#   Copyright (c) 2008 Michael Tindal\n#   Copyright (c) 2008 Daniel Casimiro <dan.casimiro@gmail.com>\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved. This file is offered as-is, without any\n#   warranty.\n\n#serial 18\n\nAC_DEFUN([AX_BOOST_SYSTEM],\n[\n\tAC_ARG_WITH([boost-system],\n\tAS_HELP_STRING([--with-boost-system@<:@=special-lib@:>@],\n                   [use the System library from boost - it is possible to specify a certain library for the linker\n                        e.g. --with-boost-system=boost_system-gcc-mt ]),\n        [\n        if test \"$withval\" = \"no\"; then\n\t\t\twant_boost=\"no\"\n        elif test \"$withval\" = \"yes\"; then\n            want_boost=\"yes\"\n            ax_boost_user_system_lib=\"\"\n        else\n\t\t    want_boost=\"yes\"\n\t\tax_boost_user_system_lib=\"$withval\"\n\t\tfi\n        ],\n        [want_boost=\"yes\"]\n\t)\n\n\tif test \"x$want_boost\" = \"xyes\"; then\n        AC_REQUIRE([AC_PROG_CC])\n        AC_REQUIRE([AC_CANONICAL_BUILD])\n\t\tCPPFLAGS_SAVED=\"$CPPFLAGS\"\n\t\tCPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\n\t\texport CPPFLAGS\n\n\t\tLDFLAGS_SAVED=\"$LDFLAGS\"\n\t\tLDFLAGS=\"$LDFLAGS $BOOST_LDFLAGS\"\n\t\texport LDFLAGS\n\n        AC_CACHE_CHECK(whether the Boost::System library is available,\n\t\t\t\t\t   ax_cv_boost_system,\n        [AC_LANG_PUSH([C++])\n\t\t\t CXXFLAGS_SAVE=$CXXFLAGS\n\t\t\t CXXFLAGS=\n\n\t\t\t AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/system/error_code.hpp>]],\n\t\t\t\t    [[boost::system::error_category *a = 0;]])],\n                   ax_cv_boost_system=yes, ax_cv_boost_system=no)\n\t\t\t CXXFLAGS=$CXXFLAGS_SAVE\n             AC_LANG_POP([C++])\n\t\t])\n\t\tif test \"x$ax_cv_boost_system\" = \"xyes\"; then\n\t\t\tAC_SUBST(BOOST_CPPFLAGS)\n\n\t\t\tAC_DEFINE(HAVE_BOOST_SYSTEM,,[define if the Boost::System library is available])\n            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\\/@:>@*//'`\n\n\t\t\tLDFLAGS_SAVE=$LDFLAGS\n            if test \"x$ax_boost_user_system_lib\" = \"x\"; then\n                ax_lib=\n                for libextension in `ls -r $BOOSTLIBDIR/libboost_system* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\\..*,,'` ; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_SYSTEM_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_SYSTEM_LIB) link_system=\"yes\"; break],\n                                 [link_system=\"no\"])\n\t\t\t\tdone\n                if test \"x$link_system\" != \"xyes\"; then\n                for libextension in `ls -r $BOOSTLIBDIR/boost_system* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\\..*,,'` ; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_SYSTEM_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_SYSTEM_LIB) link_system=\"yes\"; break],\n                                 [link_system=\"no\"])\n\t\t\t\tdone\n                fi\n\n            else\n               for ax_lib in $ax_boost_user_system_lib boost_system-$ax_boost_user_system_lib; do\n\t\t\t\t      AC_CHECK_LIB($ax_lib, exit,\n                                   [BOOST_SYSTEM_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_SYSTEM_LIB) link_system=\"yes\"; break],\n                                   [link_system=\"no\"])\n                  done\n\n            fi\n            if test \"x$ax_lib\" = \"x\"; then\n                AC_MSG_ERROR(Could not find a version of the boost_system library!)\n            fi\n\t\t\tif test \"x$link_system\" = \"xno\"; then\n\t\t\t\tAC_MSG_ERROR(Could not link against $ax_lib !)\n\t\t\tfi\n\t\tfi\n\n\t\tCPPFLAGS=\"$CPPFLAGS_SAVED\"\n\tLDFLAGS=\"$LDFLAGS_SAVED\"\n\tfi\n])\n"
  },
  {
    "path": "build-aux/m4/ax_boost_thread.m4",
    "content": "# ===========================================================================\n#      http://www.gnu.org/software/autoconf-archive/ax_boost_thread.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_BOOST_THREAD\n#\n# DESCRIPTION\n#\n#   Test for Thread library from the Boost C++ libraries. The macro requires\n#   a preceding call to AX_BOOST_BASE. Further documentation is available at\n#   <http://randspringer.de/boost/index.html>.\n#\n#   This macro calls:\n#\n#     AC_SUBST(BOOST_THREAD_LIB)\n#\n#   And sets:\n#\n#     HAVE_BOOST_THREAD\n#\n# LICENSE\n#\n#   Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>\n#   Copyright (c) 2009 Michael Tindal\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved. This file is offered as-is, without any\n#   warranty.\n\n#serial 27\n\nAC_DEFUN([AX_BOOST_THREAD],\n[\n\tAC_ARG_WITH([boost-thread],\n\tAS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],\n                   [use the Thread library from boost - it is possible to specify a certain library for the linker\n                        e.g. --with-boost-thread=boost_thread-gcc-mt ]),\n        [\n        if test \"$withval\" = \"no\"; then\n\t\t\twant_boost=\"no\"\n        elif test \"$withval\" = \"yes\"; then\n            want_boost=\"yes\"\n            ax_boost_user_thread_lib=\"\"\n        else\n\t\t    want_boost=\"yes\"\n\t\tax_boost_user_thread_lib=\"$withval\"\n\t\tfi\n        ],\n        [want_boost=\"yes\"]\n\t)\n\n\tif test \"x$want_boost\" = \"xyes\"; then\n        AC_REQUIRE([AC_PROG_CC])\n        AC_REQUIRE([AC_CANONICAL_BUILD])\n\t\tCPPFLAGS_SAVED=\"$CPPFLAGS\"\n\t\tCPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\n\t\texport CPPFLAGS\n\n\t\tLDFLAGS_SAVED=\"$LDFLAGS\"\n\t\tLDFLAGS=\"$LDFLAGS $BOOST_LDFLAGS\"\n\t\texport LDFLAGS\n\n        AC_CACHE_CHECK(whether the Boost::Thread library is available,\n\t\t\t\t\t   ax_cv_boost_thread,\n        [AC_LANG_PUSH([C++])\n\t\t\t CXXFLAGS_SAVE=$CXXFLAGS\n\n\t\t\t if test \"x$host_os\" = \"xsolaris\" ; then\n\t\t\t\t CXXFLAGS=\"-pthreads $CXXFLAGS\"\n\t\t\t elif test \"x$host_os\" = \"xmingw32\" ; then\n\t\t\t\t CXXFLAGS=\"-mthreads $CXXFLAGS\"\n\t\t\t else\n\t\t\t\tCXXFLAGS=\"-pthread $CXXFLAGS\"\n\t\t\t fi\n\t\t\t AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]],\n                                   [[boost::thread_group thrds;\n                                   return 0;]])],\n                   ax_cv_boost_thread=yes, ax_cv_boost_thread=no)\n\t\t\t CXXFLAGS=$CXXFLAGS_SAVE\n             AC_LANG_POP([C++])\n\t\t])\n\t\tif test \"x$ax_cv_boost_thread\" = \"xyes\"; then\n           if test \"x$host_os\" = \"xsolaris\" ; then\n\t\t\t  BOOST_CPPFLAGS=\"-pthreads $BOOST_CPPFLAGS\"\n\t\t   elif test \"x$host_os\" = \"xmingw32\" ; then\n\t\t\t  BOOST_CPPFLAGS=\"-mthreads $BOOST_CPPFLAGS\"\n\t\t   else\n\t\t\t  BOOST_CPPFLAGS=\"-pthread $BOOST_CPPFLAGS\"\n\t\t   fi\n\n\t\t\tAC_SUBST(BOOST_CPPFLAGS)\n\n\t\t\tAC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available])\n            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\\/@:>@*//'`\n\n\t\t\tLDFLAGS_SAVE=$LDFLAGS\n                        case \"x$host_os\" in\n                          *bsd* )\n                               LDFLAGS=\"-pthread $LDFLAGS\"\n                          break;\n                          ;;\n                        esac\n            if test \"x$ax_boost_user_thread_lib\" = \"x\"; then\n                ax_lib=\n                for libextension in `ls -r $BOOSTLIBDIR/libboost_thread* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\\..*,,'`; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_THREAD_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_THREAD_LIB) link_thread=\"yes\"; break],\n                                 [link_thread=\"no\"])\n\t\t\t\tdone\n                if test \"x$link_thread\" != \"xyes\"; then\n                for libextension in `ls -r $BOOSTLIBDIR/boost_thread* 2>/dev/null | sed 's,.*/,,' | sed 's,\\..*,,'`; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_THREAD_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_THREAD_LIB) link_thread=\"yes\"; break],\n                                 [link_thread=\"no\"])\n\t\t\t\tdone\n                fi\n\n            else\n               for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do\n\t\t\t\t      AC_CHECK_LIB($ax_lib, exit,\n                                   [BOOST_THREAD_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_THREAD_LIB) link_thread=\"yes\"; break],\n                                   [link_thread=\"no\"])\n                  done\n\n            fi\n            if test \"x$ax_lib\" = \"x\"; then\n                AC_MSG_ERROR(Could not find a version of the boost_thread library!)\n            fi\n\t\t\tif test \"x$link_thread\" = \"xno\"; then\n\t\t\t\tAC_MSG_ERROR(Could not link against $ax_lib !)\n                        else\n                           case \"x$host_os\" in\n                              *bsd* )\n\t\t\t\tBOOST_LDFLAGS=\"-pthread $BOOST_LDFLAGS\"\n                              break;\n                              ;;\n                           esac\n\n\t\t\tfi\n\t\tfi\n\n\t\tCPPFLAGS=\"$CPPFLAGS_SAVED\"\n\tLDFLAGS=\"$LDFLAGS_SAVED\"\n\tfi\n])\n"
  },
  {
    "path": "build-aux/m4/ax_boost_unit_test_framework.m4",
    "content": "# ================================================================================\n#  http://www.gnu.org/software/autoconf-archive/ax_boost_unit_test_framework.html\n# ================================================================================\n#\n# SYNOPSIS\n#\n#   AX_BOOST_UNIT_TEST_FRAMEWORK\n#\n# DESCRIPTION\n#\n#   Test for Unit_Test_Framework library from the Boost C++ libraries. The\n#   macro requires a preceding call to AX_BOOST_BASE. Further documentation\n#   is available at <http://randspringer.de/boost/index.html>.\n#\n#   This macro calls:\n#\n#     AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB)\n#\n#   And sets:\n#\n#     HAVE_BOOST_UNIT_TEST_FRAMEWORK\n#\n# LICENSE\n#\n#   Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved. This file is offered as-is, without any\n#   warranty.\n\n#serial 19\n\nAC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK],\n[\n\tAC_ARG_WITH([boost-unit-test-framework],\n\tAS_HELP_STRING([--with-boost-unit-test-framework@<:@=special-lib@:>@],\n                   [use the Unit_Test_Framework library from boost - it is possible to specify a certain library for the linker\n                        e.g. --with-boost-unit-test-framework=boost_unit_test_framework-gcc ]),\n        [\n        if test \"$withval\" = \"no\"; then\n\t\t\twant_boost=\"no\"\n        elif test \"$withval\" = \"yes\"; then\n            want_boost=\"yes\"\n            ax_boost_user_unit_test_framework_lib=\"\"\n        else\n\t\t    want_boost=\"yes\"\n\t\tax_boost_user_unit_test_framework_lib=\"$withval\"\n\t\tfi\n        ],\n        [want_boost=\"yes\"]\n\t)\n\n\tif test \"x$want_boost\" = \"xyes\"; then\n        AC_REQUIRE([AC_PROG_CC])\n\t\tCPPFLAGS_SAVED=\"$CPPFLAGS\"\n\t\tCPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\n\t\texport CPPFLAGS\n\n\t\tLDFLAGS_SAVED=\"$LDFLAGS\"\n\t\tLDFLAGS=\"$LDFLAGS $BOOST_LDFLAGS\"\n\t\texport LDFLAGS\n\n        AC_CACHE_CHECK(whether the Boost::Unit_Test_Framework library is available,\n\t\t\t\t\t   ax_cv_boost_unit_test_framework,\n        [AC_LANG_PUSH([C++])\n\t\t\t AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/test/unit_test.hpp>]],\n                                    [[using boost::unit_test::test_suite;\n\t\t\t\t\t\t\t test_suite* test= BOOST_TEST_SUITE( \"Unit test example 1\" ); return 0;]])],\n                   ax_cv_boost_unit_test_framework=yes, ax_cv_boost_unit_test_framework=no)\n         AC_LANG_POP([C++])\n\t\t])\n\t\tif test \"x$ax_cv_boost_unit_test_framework\" = \"xyes\"; then\n\t\t\tAC_DEFINE(HAVE_BOOST_UNIT_TEST_FRAMEWORK,,[define if the Boost::Unit_Test_Framework library is available])\n            BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\\/@:>@*//'`\n\n            if test \"x$ax_boost_user_unit_test_framework_lib\" = \"x\"; then\n\t\t\tsaved_ldflags=\"${LDFLAGS}\"\n                ax_lib=\n                for monitor_library in `ls $BOOSTLIBDIR/libboost_unit_test_framework*.so* $BOOSTLIBDIR/libboost_unit_test_framework*.dylib* $BOOSTLIBDIR/libboost_unit_test_framework*.a* 2>/dev/null` ; do\n                    if test -r $monitor_library ; then\n                       libextension=`echo $monitor_library | sed 's,.*/,,' | sed -e 's;^lib\\(boost_unit_test_framework.*\\)\\.so.*$;\\1;' -e 's;^lib\\(boost_unit_test_framework.*\\)\\.dylib.*$;\\1;' -e 's;^lib\\(boost_unit_test_framework.*\\)\\.a.*$;\\1;'`\n                       ax_lib=${libextension}\n                       link_unit_test_framework=\"yes\"\n                    else\n                       link_unit_test_framework=\"no\"\n                    fi\n\n\t\t\t    if test \"x$link_unit_test_framework\" = \"xyes\"; then\n                      BOOST_UNIT_TEST_FRAMEWORK_LIB=\"-l$ax_lib\"\n                      AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB)\n\t\t\t\t\t  break\n\t\t\t\t    fi\n                done\n                if test \"x$link_unit_test_framework\" != \"xyes\"; then\n                for libextension in `ls $BOOSTLIBDIR/boost_unit_test_framework*.dll* $BOOSTLIBDIR/boost_unit_test_framework*.a* 2>/dev/null  | sed 's,.*/,,' | sed -e 's;^\\(boost_unit_test_framework.*\\)\\.dll.*$;\\1;' -e 's;^\\(boost_unit_test_framework.*\\)\\.a.*$;\\1;'` ; do\n                     ax_lib=${libextension}\n\t\t\t\t    AC_CHECK_LIB($ax_lib, exit,\n                                 [BOOST_UNIT_TEST_FRAMEWORK_LIB=\"-l$ax_lib\"; AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) link_unit_test_framework=\"yes\"; break],\n                                 [link_unit_test_framework=\"no\"])\n\t\t\t\tdone\n                fi\n            else\n                link_unit_test_framework=\"no\"\n\t\t\tsaved_ldflags=\"${LDFLAGS}\"\n                for ax_lib in boost_unit_test_framework-$ax_boost_user_unit_test_framework_lib $ax_boost_user_unit_test_framework_lib ; do\n                   if test \"x$link_unit_test_framework\" = \"xyes\"; then\n                      break;\n                   fi\n                   for unittest_library in `ls $BOOSTLIBDIR/lib${ax_lib}.so* $BOOSTLIBDIR/lib${ax_lib}.a* 2>/dev/null` ; do\n                   if test -r $unittest_library ; then\n                       libextension=`echo $unittest_library | sed 's,.*/,,' | sed -e 's;^lib\\(boost_unit_test_framework.*\\)\\.so.*$;\\1;' -e 's;^lib\\(boost_unit_test_framework.*\\)\\.a*$;\\1;'`\n                       ax_lib=${libextension}\n                       link_unit_test_framework=\"yes\"\n                    else\n                       link_unit_test_framework=\"no\"\n                    fi\n\n\t\t\t\tif test \"x$link_unit_test_framework\" = \"xyes\"; then\n                        BOOST_UNIT_TEST_FRAMEWORK_LIB=\"-l$ax_lib\"\n                        AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB)\n\t\t\t\t\t    break\n\t\t\t\t    fi\n                  done\n               done\n            fi\n            if test \"x$ax_lib\" = \"x\"; then\n                AC_MSG_ERROR(Could not find a version of the boost_unit_test_framework library!)\n            fi\n\t\t\tif test \"x$link_unit_test_framework\" != \"xyes\"; then\n\t\t\t\tAC_MSG_ERROR(Could not link against $ax_lib !)\n\t\t\tfi\n\t\tfi\n\n\t\tCPPFLAGS=\"$CPPFLAGS_SAVED\"\n\tLDFLAGS=\"$LDFLAGS_SAVED\"\n\tfi\n])\n"
  },
  {
    "path": "build-aux/m4/ax_check_compile_flag.m4",
    "content": "# ===========================================================================\n#   http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])\n#\n# DESCRIPTION\n#\n#   Check whether the given FLAG works with the current language's compiler\n#   or gives an error.  (Warnings, however, are ignored)\n#\n#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on\n#   success/failure.\n#\n#   If EXTRA-FLAGS is defined, it is added to the current language's default\n#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with\n#   the flags: \"CFLAGS EXTRA-FLAGS FLAG\".  This can for example be used to\n#   force the compiler to issue an error when a bad flag is given.\n#\n#   INPUT gives an alternative input source to AC_COMPILE_IFELSE.\n#\n#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this\n#   macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.\n#\n# LICENSE\n#\n#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>\n#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>\n#\n#   This program is free software: you can redistribute it and/or modify it\n#   under the terms of the GNU General Public License as published by the\n#   Free Software Foundation, either version 3 of the License, or (at your\n#   option) any later version.\n#\n#   This program is distributed in the hope that it will be useful, but\n#   WITHOUT ANY WARRANTY; without even the implied warranty of\n#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\n#   Public License for more details.\n#\n#   You should have received a copy of the GNU General Public License along\n#   with this program. If not, see <http://www.gnu.org/licenses/>.\n#\n#   As a special exception, the respective Autoconf Macro's copyright owner\n#   gives unlimited permission to copy, distribute and modify the configure\n#   scripts that are the output of Autoconf when processing the Macro. You\n#   need not follow the terms of the GNU General Public License when using\n#   or distributing such scripts, even though portions of the text of the\n#   Macro appear in them. The GNU General Public License (GPL) does govern\n#   all other use of the material that constitutes the Autoconf Macro.\n#\n#   This special exception to the GPL applies to versions of the Autoconf\n#   Macro released by the Autoconf Archive. When you make and distribute a\n#   modified version of the Autoconf Macro, you may extend this special\n#   exception to the GPL to apply to your modified version as well.\n\n#serial 4\n\nAC_DEFUN([AX_CHECK_COMPILE_FLAG],\n[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF\nAS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl\nAC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [\n  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS\n  _AC_LANG_PREFIX[]FLAGS=\"$[]_AC_LANG_PREFIX[]FLAGS $4 $1\"\n  AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],\n    [AS_VAR_SET(CACHEVAR,[yes])],\n    [AS_VAR_SET(CACHEVAR,[no])])\n  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])\nAS_VAR_IF(CACHEVAR,yes,\n  [m4_default([$2], :)],\n  [m4_default([$3], :)])\nAS_VAR_POPDEF([CACHEVAR])dnl\n])dnl AX_CHECK_COMPILE_FLAGS\n"
  },
  {
    "path": "build-aux/m4/ax_check_link_flag.m4",
    "content": "# ===========================================================================\n#    http://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])\n#\n# DESCRIPTION\n#\n#   Check whether the given FLAG works with the linker or gives an error.\n#   (Warnings, however, are ignored)\n#\n#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on\n#   success/failure.\n#\n#   If EXTRA-FLAGS is defined, it is added to the linker's default flags\n#   when the check is done.  The check is thus made with the flags: \"LDFLAGS\n#   EXTRA-FLAGS FLAG\".  This can for example be used to force the linker to\n#   issue an error when a bad flag is given.\n#\n#   INPUT gives an alternative input source to AC_LINK_IFELSE.\n#\n#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this\n#   macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.\n#\n# LICENSE\n#\n#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>\n#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>\n#\n#   This program is free software: you can redistribute it and/or modify it\n#   under the terms of the GNU General Public License as published by the\n#   Free Software Foundation, either version 3 of the License, or (at your\n#   option) any later version.\n#\n#   This program is distributed in the hope that it will be useful, but\n#   WITHOUT ANY WARRANTY; without even the implied warranty of\n#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\n#   Public License for more details.\n#\n#   You should have received a copy of the GNU General Public License along\n#   with this program. If not, see <http://www.gnu.org/licenses/>.\n#\n#   As a special exception, the respective Autoconf Macro's copyright owner\n#   gives unlimited permission to copy, distribute and modify the configure\n#   scripts that are the output of Autoconf when processing the Macro. You\n#   need not follow the terms of the GNU General Public License when using\n#   or distributing such scripts, even though portions of the text of the\n#   Macro appear in them. The GNU General Public License (GPL) does govern\n#   all other use of the material that constitutes the Autoconf Macro.\n#\n#   This special exception to the GPL applies to versions of the Autoconf\n#   Macro released by the Autoconf Archive. When you make and distribute a\n#   modified version of the Autoconf Macro, you may extend this special\n#   exception to the GPL to apply to your modified version as well.\n\n#serial 4\n\nAC_DEFUN([AX_CHECK_LINK_FLAG],\n[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF\nAS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl\nAC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [\n  ax_check_save_flags=$LDFLAGS\n  LDFLAGS=\"$LDFLAGS $4 $1\"\n  AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],\n    [AS_VAR_SET(CACHEVAR,[yes])],\n    [AS_VAR_SET(CACHEVAR,[no])])\n  LDFLAGS=$ax_check_save_flags])\nAS_VAR_IF(CACHEVAR,yes,\n  [m4_default([$2], :)],\n  [m4_default([$3], :)])\nAS_VAR_POPDEF([CACHEVAR])dnl\n])dnl AX_CHECK_LINK_FLAGS\n"
  },
  {
    "path": "build-aux/m4/ax_check_preproc_flag.m4",
    "content": "# ===========================================================================\n#   http://www.gnu.org/software/autoconf-archive/ax_check_preproc_flag.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])\n#\n# DESCRIPTION\n#\n#   Check whether the given FLAG works with the current language's\n#   preprocessor or gives an error.  (Warnings, however, are ignored)\n#\n#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on\n#   success/failure.\n#\n#   If EXTRA-FLAGS is defined, it is added to the preprocessor's default\n#   flags when the check is done.  The check is thus made with the flags:\n#   \"CPPFLAGS EXTRA-FLAGS FLAG\".  This can for example be used to force the\n#   preprocessor to issue an error when a bad flag is given.\n#\n#   INPUT gives an alternative input source to AC_PREPROC_IFELSE.\n#\n#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this\n#   macro in sync with AX_CHECK_{COMPILE,LINK}_FLAG.\n#\n# LICENSE\n#\n#   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>\n#   Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>\n#\n#   This program is free software: you can redistribute it and/or modify it\n#   under the terms of the GNU General Public License as published by the\n#   Free Software Foundation, either version 3 of the License, or (at your\n#   option) any later version.\n#\n#   This program is distributed in the hope that it will be useful, but\n#   WITHOUT ANY WARRANTY; without even the implied warranty of\n#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\n#   Public License for more details.\n#\n#   You should have received a copy of the GNU General Public License along\n#   with this program. If not, see <http://www.gnu.org/licenses/>.\n#\n#   As a special exception, the respective Autoconf Macro's copyright owner\n#   gives unlimited permission to copy, distribute and modify the configure\n#   scripts that are the output of Autoconf when processing the Macro. You\n#   need not follow the terms of the GNU General Public License when using\n#   or distributing such scripts, even though portions of the text of the\n#   Macro appear in them. The GNU General Public License (GPL) does govern\n#   all other use of the material that constitutes the Autoconf Macro.\n#\n#   This special exception to the GPL applies to versions of the Autoconf\n#   Macro released by the Autoconf Archive. When you make and distribute a\n#   modified version of the Autoconf Macro, you may extend this special\n#   exception to the GPL to apply to your modified version as well.\n\n#serial 4\n\nAC_DEFUN([AX_CHECK_PREPROC_FLAG],\n[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF\nAS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]cppflags_$4_$1])dnl\nAC_CACHE_CHECK([whether _AC_LANG preprocessor accepts $1], CACHEVAR, [\n  ax_check_save_flags=$CPPFLAGS\n  CPPFLAGS=\"$CPPFLAGS $4 $1\"\n  AC_PREPROC_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],\n    [AS_VAR_SET(CACHEVAR,[yes])],\n    [AS_VAR_SET(CACHEVAR,[no])])\n  CPPFLAGS=$ax_check_save_flags])\nAS_VAR_IF(CACHEVAR,yes,\n  [m4_default([$2], :)],\n  [m4_default([$3], :)])\nAS_VAR_POPDEF([CACHEVAR])dnl\n])dnl AX_CHECK_PREPROC_FLAGS\n"
  },
  {
    "path": "build-aux/m4/ax_cxx_compile_stdcxx.m4",
    "content": "# ===========================================================================\n#   http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])\n#\n# DESCRIPTION\n#\n#   Check for baseline language coverage in the compiler for the specified\n#   version of the C++ standard.  If necessary, add switches to CXX and\n#   CXXCPP to enable support.  VERSION may be '11' (for the C++11 standard)\n#   or '14' (for the C++14 standard).\n#\n#   The second argument, if specified, indicates whether you insist on an\n#   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.\n#   -std=c++11).  If neither is specified, you get whatever works, with\n#   preference for an extended mode.\n#\n#   The third argument, if specified 'mandatory' or if left unspecified,\n#   indicates that baseline support for the specified C++ standard is\n#   required and that the macro should error out if no mode with that\n#   support is found.  If specified 'optional', then configuration proceeds\n#   regardless, after defining HAVE_CXX${VERSION} if and only if a\n#   supporting mode is found.\n#\n# LICENSE\n#\n#   Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>\n#   Copyright (c) 2012 Zack Weinberg <zackw@panix.com>\n#   Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>\n#   Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>\n#   Copyright (c) 2015 Paul Norman <penorman@mac.com>\n#   Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved.  This file is offered as-is, without any\n#   warranty.\n\n#serial 4\n\ndnl  This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro\ndnl  (serial version number 13).\n\nAC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl\n  m4_if([$1], [11], [],\n        [$1], [14], [],\n        [$1], [17], [m4_fatal([support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX])],\n        [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl\n  m4_if([$2], [], [],\n        [$2], [ext], [],\n        [$2], [noext], [],\n        [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl\n  m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],\n        [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],\n        [$3], [optional], [ax_cxx_compile_cxx$1_required=false],\n        [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])\n  m4_if([$4], [], [ax_cxx_compile_cxx$1_try_default=true],\n        [$4], [default], [ax_cxx_compile_cxx$1_try_default=true],\n        [$4], [nodefault], [ax_cxx_compile_cxx$1_try_default=false],\n        [m4_fatal([invalid fourth argument `$4' to AX_CXX_COMPILE_STDCXX])])\n  AC_LANG_PUSH([C++])dnl\n  ac_success=no\n\n  m4_if([$4], [nodefault], [], [dnl\n  AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,\n  ax_cv_cxx_compile_cxx$1,\n  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],\n    [ax_cv_cxx_compile_cxx$1=yes],\n    [ax_cv_cxx_compile_cxx$1=no])])\n  if test x$ax_cv_cxx_compile_cxx$1 = xyes; then\n    ac_success=yes\n  fi])\n\n  m4_if([$2], [noext], [], [dnl\n  if test x$ac_success = xno; then\n    for switch in -std=gnu++$1 -std=gnu++0x; do\n      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])\n      AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,\n                     $cachevar,\n        [ac_save_CXX=\"$CXX\"\n         CXX=\"$CXX $switch\"\n         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],\n          [eval $cachevar=yes],\n          [eval $cachevar=no])\n         CXX=\"$ac_save_CXX\"])\n      if eval test x\\$$cachevar = xyes; then\n        CXX=\"$CXX $switch\"\n        if test -n \"$CXXCPP\" ; then\n          CXXCPP=\"$CXXCPP $switch\"\n        fi\n        ac_success=yes\n        break\n      fi\n    done\n  fi])\n\n  m4_if([$2], [ext], [], [dnl\n  if test x$ac_success = xno; then\n    dnl HP's aCC needs +std=c++11 according to:\n    dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf\n    dnl Cray's crayCC needs \"-h std=c++11\"\n    for switch in -std=c++$1 -std=c++0x +std=c++$1 \"-h std=c++$1\"; do\n      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])\n      AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,\n                     $cachevar,\n        [ac_save_CXX=\"$CXX\"\n         CXX=\"$CXX $switch\"\n         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],\n          [eval $cachevar=yes],\n          [eval $cachevar=no])\n         CXX=\"$ac_save_CXX\"])\n      if eval test x\\$$cachevar = xyes; then\n        CXX=\"$CXX $switch\"\n        if test -n \"$CXXCPP\" ; then\n          CXXCPP=\"$CXXCPP $switch\"\n        fi\n        ac_success=yes\n        break\n      fi\n    done\n  fi])\n  AC_LANG_POP([C++])\n  if test x$ax_cxx_compile_cxx$1_required = xtrue; then\n    if test x$ac_success = xno; then\n      AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])\n    fi\n  fi\n  if test x$ac_success = xno; then\n    HAVE_CXX$1=0\n    AC_MSG_NOTICE([No compiler with C++$1 support was found])\n  else\n    HAVE_CXX$1=1\n    AC_DEFINE(HAVE_CXX$1,1,\n              [define if the compiler supports basic C++$1 syntax])\n  fi\n  AC_SUBST(HAVE_CXX$1)\n])\n\n\ndnl  Test body for checking C++11 support\n\nm4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],\n  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11\n)\n\n\ndnl  Test body for checking C++14 support\n\nm4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],\n  _AX_CXX_COMPILE_STDCXX_testbody_new_in_11\n  _AX_CXX_COMPILE_STDCXX_testbody_new_in_14\n)\n\n\ndnl  Tests for new features in C++11\n\nm4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[\n\n// If the compiler admits that it is not ready for C++11, why torture it?\n// Hopefully, this will speed up the test.\n\n#ifndef __cplusplus\n\n#error \"This is not a C++ compiler\"\n\n#elif __cplusplus < 201103L\n\n#error \"This is not a C++11 compiler\"\n\n#else\n\nnamespace cxx11\n{\n\n  namespace test_static_assert\n  {\n\n    template <typename T>\n    struct check\n    {\n      static_assert(sizeof(int) <= sizeof(T), \"not big enough\");\n    };\n\n  }\n\n  namespace test_final_override\n  {\n\n    struct Base\n    {\n      virtual void f() {}\n    };\n\n    struct Derived : public Base\n    {\n      virtual void f() override {}\n    };\n\n  }\n\n  namespace test_double_right_angle_brackets\n  {\n\n    template < typename T >\n    struct check {};\n\n    typedef check<void> single_type;\n    typedef check<check<void>> double_type;\n    typedef check<check<check<void>>> triple_type;\n    typedef check<check<check<check<void>>>> quadruple_type;\n\n  }\n\n  namespace test_decltype\n  {\n\n    int\n    f()\n    {\n      int a = 1;\n      decltype(a) b = 2;\n      return a + b;\n    }\n\n  }\n\n  namespace test_type_deduction\n  {\n\n    template < typename T1, typename T2 >\n    struct is_same\n    {\n      static const bool value = false;\n    };\n\n    template < typename T >\n    struct is_same<T, T>\n    {\n      static const bool value = true;\n    };\n\n    template < typename T1, typename T2 >\n    auto\n    add(T1 a1, T2 a2) -> decltype(a1 + a2)\n    {\n      return a1 + a2;\n    }\n\n    int\n    test(const int c, volatile int v)\n    {\n      static_assert(is_same<int, decltype(0)>::value == true, \"\");\n      static_assert(is_same<int, decltype(c)>::value == false, \"\");\n      static_assert(is_same<int, decltype(v)>::value == false, \"\");\n      auto ac = c;\n      auto av = v;\n      auto sumi = ac + av + 'x';\n      auto sumf = ac + av + 1.0;\n      static_assert(is_same<int, decltype(ac)>::value == true, \"\");\n      static_assert(is_same<int, decltype(av)>::value == true, \"\");\n      static_assert(is_same<int, decltype(sumi)>::value == true, \"\");\n      static_assert(is_same<int, decltype(sumf)>::value == false, \"\");\n      static_assert(is_same<int, decltype(add(c, v))>::value == true, \"\");\n      return (sumf > 0.0) ? sumi : add(c, v);\n    }\n\n  }\n\n  namespace test_noexcept\n  {\n\n    int f() { return 0; }\n    int g() noexcept { return 0; }\n\n    static_assert(noexcept(f()) == false, \"\");\n    static_assert(noexcept(g()) == true, \"\");\n\n  }\n\n  namespace test_constexpr\n  {\n\n    template < typename CharT >\n    unsigned long constexpr\n    strlen_c_r(const CharT *const s, const unsigned long acc) noexcept\n    {\n      return *s ? strlen_c_r(s + 1, acc + 1) : acc;\n    }\n\n    template < typename CharT >\n    unsigned long constexpr\n    strlen_c(const CharT *const s) noexcept\n    {\n      return strlen_c_r(s, 0UL);\n    }\n\n    static_assert(strlen_c(\"\") == 0UL, \"\");\n    static_assert(strlen_c(\"1\") == 1UL, \"\");\n    static_assert(strlen_c(\"example\") == 7UL, \"\");\n    static_assert(strlen_c(\"another\\0example\") == 7UL, \"\");\n\n  }\n\n  namespace test_rvalue_references\n  {\n\n    template < int N >\n    struct answer\n    {\n      static constexpr int value = N;\n    };\n\n    answer<1> f(int&)       { return answer<1>(); }\n    answer<2> f(const int&) { return answer<2>(); }\n    answer<3> f(int&&)      { return answer<3>(); }\n\n    void\n    test()\n    {\n      int i = 0;\n      const int c = 0;\n      static_assert(decltype(f(i))::value == 1, \"\");\n      static_assert(decltype(f(c))::value == 2, \"\");\n      static_assert(decltype(f(0))::value == 3, \"\");\n    }\n\n  }\n\n  namespace test_uniform_initialization\n  {\n\n    struct test\n    {\n      static const int zero {};\n      static const int one {1};\n    };\n\n    static_assert(test::zero == 0, \"\");\n    static_assert(test::one == 1, \"\");\n\n  }\n\n  namespace test_lambdas\n  {\n\n    void\n    test1()\n    {\n      auto lambda1 = [](){};\n      auto lambda2 = lambda1;\n      lambda1();\n      lambda2();\n    }\n\n    int\n    test2()\n    {\n      auto a = [](int i, int j){ return i + j; }(1, 2);\n      auto b = []() -> int { return '0'; }();\n      auto c = [=](){ return a + b; }();\n      auto d = [&](){ return c; }();\n      auto e = [a, &b](int x) mutable {\n        const auto identity = [](int y){ return y; };\n        for (auto i = 0; i < a; ++i)\n          a += b--;\n        return x + identity(a + b);\n      }(0);\n      return a + b + c + d + e;\n    }\n\n    int\n    test3()\n    {\n      const auto nullary = [](){ return 0; };\n      const auto unary = [](int x){ return x; };\n      using nullary_t = decltype(nullary);\n      using unary_t = decltype(unary);\n      const auto higher1st = [](nullary_t f){ return f(); };\n      const auto higher2nd = [unary](nullary_t f1){\n        return [unary, f1](unary_t f2){ return f2(unary(f1())); };\n      };\n      return higher1st(nullary) + higher2nd(nullary)(unary);\n    }\n\n  }\n\n  namespace test_variadic_templates\n  {\n\n    template <int...>\n    struct sum;\n\n    template <int N0, int... N1toN>\n    struct sum<N0, N1toN...>\n    {\n      static constexpr auto value = N0 + sum<N1toN...>::value;\n    };\n\n    template <>\n    struct sum<>\n    {\n      static constexpr auto value = 0;\n    };\n\n    static_assert(sum<>::value == 0, \"\");\n    static_assert(sum<1>::value == 1, \"\");\n    static_assert(sum<23>::value == 23, \"\");\n    static_assert(sum<1, 2>::value == 3, \"\");\n    static_assert(sum<5, 5, 11>::value == 21, \"\");\n    static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, \"\");\n\n  }\n\n  // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae\n  // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function\n  // because of this.\n  namespace test_template_alias_sfinae\n  {\n\n    struct foo {};\n\n    template<typename T>\n    using member = typename T::member_type;\n\n    template<typename T>\n    void func(...) {}\n\n    template<typename T>\n    void func(member<T>*) {}\n\n    void test();\n\n    void test() { func<foo>(0); }\n\n  }\n\n}  // namespace cxx11\n\n#endif  // __cplusplus >= 201103L\n\n]])\n\n\ndnl  Tests for new features in C++14\n\nm4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[\n\n// If the compiler admits that it is not ready for C++14, why torture it?\n// Hopefully, this will speed up the test.\n\n#ifndef __cplusplus\n\n#error \"This is not a C++ compiler\"\n\n#elif __cplusplus < 201402L\n\n#error \"This is not a C++14 compiler\"\n\n#else\n\nnamespace cxx14\n{\n\n  namespace test_polymorphic_lambdas\n  {\n\n    int\n    test()\n    {\n      const auto lambda = [](auto&&... args){\n        const auto istiny = [](auto x){\n          return (sizeof(x) == 1UL) ? 1 : 0;\n        };\n        const int aretiny[] = { istiny(args)... };\n        return aretiny[0];\n      };\n      return lambda(1, 1L, 1.0f, '1');\n    }\n\n  }\n\n  namespace test_binary_literals\n  {\n\n    constexpr auto ivii = 0b0000000000101010;\n    static_assert(ivii == 42, \"wrong value\");\n\n  }\n\n  namespace test_generalized_constexpr\n  {\n\n    template < typename CharT >\n    constexpr unsigned long\n    strlen_c(const CharT *const s) noexcept\n    {\n      auto length = 0UL;\n      for (auto p = s; *p; ++p)\n        ++length;\n      return length;\n    }\n\n    static_assert(strlen_c(\"\") == 0UL, \"\");\n    static_assert(strlen_c(\"x\") == 1UL, \"\");\n    static_assert(strlen_c(\"test\") == 4UL, \"\");\n    static_assert(strlen_c(\"another\\0test\") == 7UL, \"\");\n\n  }\n\n  namespace test_lambda_init_capture\n  {\n\n    int\n    test()\n    {\n      auto x = 0;\n      const auto lambda1 = [a = x](int b){ return a + b; };\n      const auto lambda2 = [a = lambda1(x)](){ return a; };\n      return lambda2();\n    }\n\n  }\n\n  namespace test_digit_seperators\n  {\n\n    constexpr auto ten_million = 100'000'000;\n    static_assert(ten_million == 100000000, \"\");\n\n  }\n\n  namespace test_return_type_deduction\n  {\n\n    auto f(int& x) { return x; }\n    decltype(auto) g(int& x) { return x; }\n\n    template < typename T1, typename T2 >\n    struct is_same\n    {\n      static constexpr auto value = false;\n    };\n\n    template < typename T >\n    struct is_same<T, T>\n    {\n      static constexpr auto value = true;\n    };\n\n    int\n    test()\n    {\n      auto x = 0;\n      static_assert(is_same<int, decltype(f(x))>::value, \"\");\n      static_assert(is_same<int&, decltype(g(x))>::value, \"\");\n      return x;\n    }\n\n  }\n\n}  // namespace cxx14\n\n#endif  // __cplusplus >= 201402L\n\n]])\n"
  },
  {
    "path": "build-aux/m4/ax_gcc_func_attribute.m4",
    "content": "# ===========================================================================\n#   http://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE)\n#\n# DESCRIPTION\n#\n#   This macro checks if the compiler supports one of GCC's function\n#   attributes; many other compilers also provide function attributes with\n#   the same syntax. Compiler warnings are used to detect supported\n#   attributes as unsupported ones are ignored by default so quieting\n#   warnings when using this macro will yield false positives.\n#\n#   The ATTRIBUTE parameter holds the name of the attribute to be checked.\n#\n#   If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_<ATTRIBUTE>.\n#\n#   The macro caches its result in the ax_cv_have_func_attribute_<attribute>\n#   variable.\n#\n#   The macro currently supports the following function attributes:\n#\n#    alias\n#    aligned\n#    alloc_size\n#    always_inline\n#    artificial\n#    cold\n#    const\n#    constructor\n#    constructor_priority for constructor attribute with priority\n#    deprecated\n#    destructor\n#    dllexport\n#    dllimport\n#    error\n#    externally_visible\n#    flatten\n#    format\n#    format_arg\n#    gnu_inline\n#    hot\n#    ifunc\n#    leaf\n#    malloc\n#    noclone\n#    noinline\n#    nonnull\n#    noreturn\n#    nothrow\n#    optimize\n#    pure\n#    unused\n#    used\n#    visibility\n#    warning\n#    warn_unused_result\n#    weak\n#    weakref\n#\n#   Unsuppored function attributes will be tested with a prototype returning\n#   an int and not accepting any arguments and the result of the check might\n#   be wrong or meaningless so use with care.\n#\n# LICENSE\n#\n#   Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved.  This file is offered as-is, without any\n#   warranty.\n\n#serial 3\n\nAC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [\n    AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])\n\n    AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [\n        AC_LINK_IFELSE([AC_LANG_PROGRAM([\n            m4_case([$1],\n                [alias], [\n                    int foo( void ) { return 0; }\n                    int bar( void ) __attribute__(($1(\"foo\")));\n                ],\n                [aligned], [\n                    int foo( void ) __attribute__(($1(32)));\n                ],\n                [alloc_size], [\n                    void *foo(int a) __attribute__(($1(1)));\n                ],\n                [always_inline], [\n                    inline __attribute__(($1)) int foo( void ) { return 0; }\n                ],\n                [artificial], [\n                    inline __attribute__(($1)) int foo( void ) { return 0; }\n                ],\n                [cold], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [const], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [constructor_priority], [\n                    int foo( void ) __attribute__((__constructor__(65535/2)));\n                ],\n                [constructor], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [deprecated], [\n                    int foo( void ) __attribute__(($1(\"\")));\n                ],\n                [destructor], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [dllexport], [\n                    __attribute__(($1)) int foo( void ) { return 0; }\n                ],\n                [dllimport], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [error], [\n                    int foo( void ) __attribute__(($1(\"\")));\n                ],\n                [externally_visible], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [flatten], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [format], [\n                    int foo(const char *p, ...) __attribute__(($1(printf, 1, 2)));\n                ],\n                [format_arg], [\n                    char *foo(const char *p) __attribute__(($1(1)));\n                ],\n                [gnu_inline], [\n                    inline __attribute__(($1)) int foo( void ) { return 0; }\n                ],\n                [hot], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [ifunc], [\n                    int my_foo( void ) { return 0; }\n                    static int (*resolve_foo(void))(void) { return my_foo; }\n                    int foo( void ) __attribute__(($1(\"resolve_foo\")));\n                ],\n                [leaf], [\n                    __attribute__(($1)) int foo( void ) { return 0; }\n                ],\n                [malloc], [\n                    void *foo( void ) __attribute__(($1));\n                ],\n                [noclone], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [noinline], [\n                    __attribute__(($1)) int foo( void ) { return 0; }\n                ],\n                [nonnull], [\n                    int foo(char *p) __attribute__(($1(1)));\n                ],\n                [noreturn], [\n                    void foo( void ) __attribute__(($1));\n                ],\n                [nothrow], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [optimize], [\n                    __attribute__(($1(3))) int foo( void ) { return 0; }\n                ],\n                [pure], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [unused], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [used], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [visibility], [\n                    int foo_def( void ) __attribute__(($1(\"default\")));\n                    int foo_hid( void ) __attribute__(($1(\"hidden\")));\n                    int foo_int( void ) __attribute__(($1(\"internal\")));\n                    int foo_pro( void ) __attribute__(($1(\"protected\")));\n                ],\n                [warning], [\n                    int foo( void ) __attribute__(($1(\"\")));\n                ],\n                [warn_unused_result], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [weak], [\n                    int foo( void ) __attribute__(($1));\n                ],\n                [weakref], [\n                    static int foo( void ) { return 0; }\n                    static int bar( void ) __attribute__(($1(\"foo\")));\n                ],\n                [\n                 m4_warn([syntax], [Unsupported attribute $1, the test may fail])\n                 int foo( void ) __attribute__(($1));\n                ]\n            )], [])\n            ],\n            dnl GCC doesn't exit with an error if an unknown attribute is\n            dnl provided but only outputs a warning, so accept the attribute\n            dnl only if no warning were issued.\n            [AS_IF([test -s conftest.err],\n                [AS_VAR_SET([ac_var], [no])],\n                [AS_VAR_SET([ac_var], [yes])])],\n            [AS_VAR_SET([ac_var], [no])])\n    ])\n\n    AS_IF([test yes = AS_VAR_GET([ac_var])],\n        [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1,\n            [Define to 1 if the system has the `$1' function attribute])], [])\n\n    AS_VAR_POPDEF([ac_var])\n])\n"
  },
  {
    "path": "build-aux/m4/ax_pthread.m4",
    "content": "# ===========================================================================\n#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])\n#\n# DESCRIPTION\n#\n#   This macro figures out how to build C programs using POSIX threads. It\n#   sets the PTHREAD_LIBS output variable to the threads library and linker\n#   flags, and the PTHREAD_CFLAGS output variable to any special C compiler\n#   flags that are needed. (The user can also force certain compiler\n#   flags/libs to be tested by setting these environment variables.)\n#\n#   Also sets PTHREAD_CC to any special C compiler that is needed for\n#   multi-threaded programs (defaults to the value of CC otherwise). (This\n#   is necessary on AIX to use the special cc_r compiler alias.)\n#\n#   NOTE: You are assumed to not only compile your program with these flags,\n#   but also to link with them as well. For example, you might link with\n#   $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS\n#\n#   If you are only building threaded programs, you may wish to use these\n#   variables in your default LIBS, CFLAGS, and CC:\n#\n#     LIBS=\"$PTHREAD_LIBS $LIBS\"\n#     CFLAGS=\"$CFLAGS $PTHREAD_CFLAGS\"\n#     CC=\"$PTHREAD_CC\"\n#\n#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant\n#   has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to\n#   that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).\n#\n#   Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the\n#   PTHREAD_PRIO_INHERIT symbol is defined when compiling with\n#   PTHREAD_CFLAGS.\n#\n#   ACTION-IF-FOUND is a list of shell commands to run if a threads library\n#   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it\n#   is not found. If ACTION-IF-FOUND is not specified, the default action\n#   will define HAVE_PTHREAD.\n#\n#   Please let the authors know if this macro fails on any platform, or if\n#   you have any other suggestions or comments. This macro was based on work\n#   by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help\n#   from M. Frigo), as well as ac_pthread and hb_pthread macros posted by\n#   Alejandro Forero Cuervo to the autoconf macro repository. We are also\n#   grateful for the helpful feedback of numerous users.\n#\n#   Updated for Autoconf 2.68 by Daniel Richard G.\n#\n# LICENSE\n#\n#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>\n#   Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>\n#\n#   This program is free software: you can redistribute it and/or modify it\n#   under the terms of the GNU General Public License as published by the\n#   Free Software Foundation, either version 3 of the License, or (at your\n#   option) any later version.\n#\n#   This program is distributed in the hope that it will be useful, but\n#   WITHOUT ANY WARRANTY; without even the implied warranty of\n#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General\n#   Public License for more details.\n#\n#   You should have received a copy of the GNU General Public License along\n#   with this program. If not, see <http://www.gnu.org/licenses/>.\n#\n#   As a special exception, the respective Autoconf Macro's copyright owner\n#   gives unlimited permission to copy, distribute and modify the configure\n#   scripts that are the output of Autoconf when processing the Macro. You\n#   need not follow the terms of the GNU General Public License when using\n#   or distributing such scripts, even though portions of the text of the\n#   Macro appear in them. The GNU General Public License (GPL) does govern\n#   all other use of the material that constitutes the Autoconf Macro.\n#\n#   This special exception to the GPL applies to versions of the Autoconf\n#   Macro released by the Autoconf Archive. When you make and distribute a\n#   modified version of the Autoconf Macro, you may extend this special\n#   exception to the GPL to apply to your modified version as well.\n\n#serial 23\n\nAU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])\nAC_DEFUN([AX_PTHREAD], [\nAC_REQUIRE([AC_CANONICAL_HOST])\nAC_REQUIRE([AC_PROG_CC])\nAC_REQUIRE([AC_PROG_SED])\nAC_LANG_PUSH([C])\nax_pthread_ok=no\n\n# We used to check for pthread.h first, but this fails if pthread.h\n# requires special compiler flags (e.g. on Tru64 or Sequent).\n# It gets checked for in the link test anyway.\n\n# First of all, check if the user has set any of the PTHREAD_LIBS,\n# etcetera environment variables, and if threads linking works using\n# them:\nif test \"x$PTHREAD_CFLAGS$PTHREAD_LIBS\" != \"x\"; then\n        ax_pthread_save_CC=\"$CC\"\n        ax_pthread_save_CFLAGS=\"$CFLAGS\"\n        ax_pthread_save_LIBS=\"$LIBS\"\n        AS_IF([test \"x$PTHREAD_CC\" != \"x\"], [CC=\"$PTHREAD_CC\"])\n        CFLAGS=\"$CFLAGS $PTHREAD_CFLAGS\"\n        LIBS=\"$PTHREAD_LIBS $LIBS\"\n        AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])\n        AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])\n        AC_MSG_RESULT([$ax_pthread_ok])\n        if test \"x$ax_pthread_ok\" = \"xno\"; then\n                PTHREAD_LIBS=\"\"\n                PTHREAD_CFLAGS=\"\"\n        fi\n        CC=\"$ax_pthread_save_CC\"\n        CFLAGS=\"$ax_pthread_save_CFLAGS\"\n        LIBS=\"$ax_pthread_save_LIBS\"\nfi\n\n# We must check for the threads library under a number of different\n# names; the ordering is very important because some systems\n# (e.g. DEC) have both -lpthread and -lpthreads, where one of the\n# libraries is broken (non-POSIX).\n\n# Create a list of thread flags to try.  Items starting with a \"-\" are\n# C compiler flags, and other items are library names, except for \"none\"\n# which indicates that we try without any flags at all, and \"pthread-config\"\n# which is a program returning the flags for the Pth emulation library.\n\nax_pthread_flags=\"pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config\"\n\n# The ordering *is* (sometimes) important.  Some notes on the\n# individual items follow:\n\n# pthreads: AIX (must check this before -lpthread)\n# none: in case threads are in libc; should be tried before -Kthread and\n#       other compiler flags to prevent continual compiler warnings\n# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)\n# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64\n#           (Note: HP C rejects this with \"bad form for `-t' option\")\n# -pthreads: Solaris/gcc (Note: HP C also rejects)\n# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it\n#      doesn't hurt to check since this sometimes defines pthreads and\n#      -D_REENTRANT too), HP C (must be checked before -lpthread, which\n#      is present but should not be used directly; and before -mthreads,\n#      because the compiler interprets this as \"-mt\" + \"-hreads\")\n# -mthreads: Mingw32/gcc, Lynx/gcc\n# pthread: Linux, etcetera\n# --thread-safe: KAI C++\n# pthread-config: use pthread-config program (for GNU Pth library)\n\ncase $host_os in\n\n        freebsd*)\n\n        # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)\n        # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)\n\n        ax_pthread_flags=\"-kthread lthread $ax_pthread_flags\"\n        ;;\n\n        hpux*)\n\n        # From the cc(1) man page: \"[-mt] Sets various -D flags to enable\n        # multi-threading and also sets -lpthread.\"\n\n        ax_pthread_flags=\"-mt -pthread pthread $ax_pthread_flags\"\n        ;;\n\n        openedition*)\n\n        # IBM z/OS requires a feature-test macro to be defined in order to\n        # enable POSIX threads at all, so give the user a hint if this is\n        # not set. (We don't define these ourselves, as they can affect\n        # other portions of the system API in unpredictable ways.)\n\n        AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],\n            [\n#            if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)\n             AX_PTHREAD_ZOS_MISSING\n#            endif\n            ],\n            [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])\n        ;;\n\n        solaris*)\n\n        # On Solaris (at least, for some versions), libc contains stubbed\n        # (non-functional) versions of the pthreads routines, so link-based\n        # tests will erroneously succeed. (N.B.: The stubs are missing\n        # pthread_cleanup_push, or rather a function called by this macro,\n        # so we could check for that, but who knows whether they'll stub\n        # that too in a future libc.)  So we'll check first for the\n        # standard Solaris way of linking pthreads (-mt -lpthread).\n\n        ax_pthread_flags=\"-mt,pthread pthread $ax_pthread_flags\"\n        ;;\nesac\n\n# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)\n\nAS_IF([test \"x$GCC\" = \"xyes\"],\n      [ax_pthread_flags=\"-pthread -pthreads $ax_pthread_flags\"])\n\n# The presence of a feature test macro requesting re-entrant function\n# definitions is, on some systems, a strong hint that pthreads support is\n# correctly enabled\n\ncase $host_os in\n        darwin* | hpux* | linux* | osf* | solaris*)\n        ax_pthread_check_macro=\"_REENTRANT\"\n        ;;\n\n        aix*)\n        ax_pthread_check_macro=\"_THREAD_SAFE\"\n        ;;\n\n        *)\n        ax_pthread_check_macro=\"--\"\n        ;;\nesac\nAS_IF([test \"x$ax_pthread_check_macro\" = \"x--\"],\n      [ax_pthread_check_cond=0],\n      [ax_pthread_check_cond=\"!defined($ax_pthread_check_macro)\"])\n\n# Are we compiling with Clang?\n\nAC_CACHE_CHECK([whether $CC is Clang],\n    [ax_cv_PTHREAD_CLANG],\n    [ax_cv_PTHREAD_CLANG=no\n     # Note that Autoconf sets GCC=yes for Clang as well as GCC\n     if test \"x$GCC\" = \"xyes\"; then\n        AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],\n            [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */\n#            if defined(__clang__) && defined(__llvm__)\n             AX_PTHREAD_CC_IS_CLANG\n#            endif\n            ],\n            [ax_cv_PTHREAD_CLANG=yes])\n     fi\n    ])\nax_pthread_clang=\"$ax_cv_PTHREAD_CLANG\"\n\nax_pthread_clang_warning=no\n\n# Clang needs special handling, because older versions handle the -pthread\n# option in a rather... idiosyncratic way\n\nif test \"x$ax_pthread_clang\" = \"xyes\"; then\n\n        # Clang takes -pthread; it has never supported any other flag\n\n        # (Note 1: This will need to be revisited if a system that Clang\n        # supports has POSIX threads in a separate library.  This tends not\n        # to be the way of modern systems, but it's conceivable.)\n\n        # (Note 2: On some systems, notably Darwin, -pthread is not needed\n        # to get POSIX threads support; the API is always present and\n        # active.  We could reasonably leave PTHREAD_CFLAGS empty.  But\n        # -pthread does define _REENTRANT, and while the Darwin headers\n        # ignore this macro, third-party headers might not.)\n\n        PTHREAD_CFLAGS=\"-pthread\"\n        PTHREAD_LIBS=\n\n        ax_pthread_ok=yes\n\n        # However, older versions of Clang make a point of warning the user\n        # that, in an invocation where only linking and no compilation is\n        # taking place, the -pthread option has no effect (\"argument unused\n        # during compilation\").  They expect -pthread to be passed in only\n        # when source code is being compiled.\n        #\n        # Problem is, this is at odds with the way Automake and most other\n        # C build frameworks function, which is that the same flags used in\n        # compilation (CFLAGS) are also used in linking.  Many systems\n        # supported by AX_PTHREAD require exactly this for POSIX threads\n        # support, and in fact it is often not straightforward to specify a\n        # flag that is used only in the compilation phase and not in\n        # linking.  Such a scenario is extremely rare in practice.\n        #\n        # Even though use of the -pthread flag in linking would only print\n        # a warning, this can be a nuisance for well-run software projects\n        # that build with -Werror.  So if the active version of Clang has\n        # this misfeature, we search for an option to squash it.\n\n        AC_CACHE_CHECK([whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread],\n            [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],\n            [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown\n             # Create an alternate version of $ac_link that compiles and\n             # links in two steps (.c -> .o, .o -> exe) instead of one\n             # (.c -> exe), because the warning occurs only in the second\n             # step\n             ax_pthread_save_ac_link=\"$ac_link\"\n             ax_pthread_sed='s/conftest\\.\\$ac_ext/conftest.$ac_objext/g'\n             ax_pthread_link_step=`$as_echo \"$ac_link\" | sed \"$ax_pthread_sed\"`\n             ax_pthread_2step_ac_link=\"($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)\"\n             ax_pthread_save_CFLAGS=\"$CFLAGS\"\n             for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do\n                AS_IF([test \"x$ax_pthread_try\" = \"xunknown\"], [break])\n                CFLAGS=\"-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS\"\n                ac_link=\"$ax_pthread_save_ac_link\"\n                AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],\n                    [ac_link=\"$ax_pthread_2step_ac_link\"\n                     AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],\n                         [break])\n                    ])\n             done\n             ac_link=\"$ax_pthread_save_ac_link\"\n             CFLAGS=\"$ax_pthread_save_CFLAGS\"\n             AS_IF([test \"x$ax_pthread_try\" = \"x\"], [ax_pthread_try=no])\n             ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=\"$ax_pthread_try\"\n            ])\n\n        case \"$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG\" in\n                no | unknown) ;;\n                *) PTHREAD_CFLAGS=\"$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS\" ;;\n        esac\n\nfi # $ax_pthread_clang = yes\n\nif test \"x$ax_pthread_ok\" = \"xno\"; then\nfor ax_pthread_try_flag in $ax_pthread_flags; do\n\n        case $ax_pthread_try_flag in\n                none)\n                AC_MSG_CHECKING([whether pthreads work without any flags])\n                ;;\n\n                -mt,pthread)\n                AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])\n                PTHREAD_CFLAGS=\"-mt\"\n                PTHREAD_LIBS=\"-lpthread\"\n                ;;\n\n                -*)\n                AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])\n                PTHREAD_CFLAGS=\"$ax_pthread_try_flag\"\n                ;;\n\n                pthread-config)\n                AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])\n                AS_IF([test \"x$ax_pthread_config\" = \"xno\"], [continue])\n                PTHREAD_CFLAGS=\"`pthread-config --cflags`\"\n                PTHREAD_LIBS=\"`pthread-config --ldflags` `pthread-config --libs`\"\n                ;;\n\n                *)\n                AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])\n                PTHREAD_LIBS=\"-l$ax_pthread_try_flag\"\n                ;;\n        esac\n\n        ax_pthread_save_CFLAGS=\"$CFLAGS\"\n        ax_pthread_save_LIBS=\"$LIBS\"\n        CFLAGS=\"$CFLAGS $PTHREAD_CFLAGS\"\n        LIBS=\"$PTHREAD_LIBS $LIBS\"\n\n        # Check for various functions.  We must include pthread.h,\n        # since some functions may be macros.  (On the Sequent, we\n        # need a special flag -Kthread to make this header compile.)\n        # We check for pthread_join because it is in -lpthread on IRIX\n        # while pthread_create is in libc.  We check for pthread_attr_init\n        # due to DEC craziness with -lpthreads.  We check for\n        # pthread_cleanup_push because it is one of the few pthread\n        # functions on Solaris that doesn't have a non-functional libc stub.\n        # We try pthread_create on general principles.\n\n        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>\n#                       if $ax_pthread_check_cond\n#                        error \"$ax_pthread_check_macro must be defined\"\n#                       endif\n                        static void routine(void *a) { a = 0; }\n                        static void *start_routine(void *a) { return a; }],\n                       [pthread_t th; pthread_attr_t attr;\n                        pthread_create(&th, 0, start_routine, 0);\n                        pthread_join(th, 0);\n                        pthread_attr_init(&attr);\n                        pthread_cleanup_push(routine, 0);\n                        pthread_cleanup_pop(0) /* ; */])],\n            [ax_pthread_ok=yes],\n            [])\n\n        CFLAGS=\"$ax_pthread_save_CFLAGS\"\n        LIBS=\"$ax_pthread_save_LIBS\"\n\n        AC_MSG_RESULT([$ax_pthread_ok])\n        AS_IF([test \"x$ax_pthread_ok\" = \"xyes\"], [break])\n\n        PTHREAD_LIBS=\"\"\n        PTHREAD_CFLAGS=\"\"\ndone\nfi\n\n# Various other checks:\nif test \"x$ax_pthread_ok\" = \"xyes\"; then\n        ax_pthread_save_CFLAGS=\"$CFLAGS\"\n        ax_pthread_save_LIBS=\"$LIBS\"\n        CFLAGS=\"$CFLAGS $PTHREAD_CFLAGS\"\n        LIBS=\"$PTHREAD_LIBS $LIBS\"\n\n        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.\n        AC_CACHE_CHECK([for joinable pthread attribute],\n            [ax_cv_PTHREAD_JOINABLE_ATTR],\n            [ax_cv_PTHREAD_JOINABLE_ATTR=unknown\n             for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do\n                 AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],\n                                                 [int attr = $ax_pthread_attr; return attr /* ; */])],\n                                [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],\n                                [])\n             done\n            ])\n        AS_IF([test \"x$ax_cv_PTHREAD_JOINABLE_ATTR\" != \"xunknown\" && \\\n               test \"x$ax_cv_PTHREAD_JOINABLE_ATTR\" != \"xPTHREAD_CREATE_JOINABLE\" && \\\n               test \"x$ax_pthread_joinable_attr_defined\" != \"xyes\"],\n              [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],\n                                  [$ax_cv_PTHREAD_JOINABLE_ATTR],\n                                  [Define to necessary symbol if this constant\n                                   uses a non-standard name on your system.])\n               ax_pthread_joinable_attr_defined=yes\n              ])\n\n        AC_CACHE_CHECK([whether more special flags are required for pthreads],\n            [ax_cv_PTHREAD_SPECIAL_FLAGS],\n            [ax_cv_PTHREAD_SPECIAL_FLAGS=no\n             case $host_os in\n             solaris*)\n             ax_cv_PTHREAD_SPECIAL_FLAGS=\"-D_POSIX_PTHREAD_SEMANTICS\"\n             ;;\n             esac\n            ])\n        AS_IF([test \"x$ax_cv_PTHREAD_SPECIAL_FLAGS\" != \"xno\" && \\\n               test \"x$ax_pthread_special_flags_added\" != \"xyes\"],\n              [PTHREAD_CFLAGS=\"$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS\"\n               ax_pthread_special_flags_added=yes])\n\n        AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],\n            [ax_cv_PTHREAD_PRIO_INHERIT],\n            [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],\n                                             [[int i = PTHREAD_PRIO_INHERIT;]])],\n                            [ax_cv_PTHREAD_PRIO_INHERIT=yes],\n                            [ax_cv_PTHREAD_PRIO_INHERIT=no])\n            ])\n        AS_IF([test \"x$ax_cv_PTHREAD_PRIO_INHERIT\" = \"xyes\" && \\\n               test \"x$ax_pthread_prio_inherit_defined\" != \"xyes\"],\n              [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])\n               ax_pthread_prio_inherit_defined=yes\n              ])\n\n        CFLAGS=\"$ax_pthread_save_CFLAGS\"\n        LIBS=\"$ax_pthread_save_LIBS\"\n\n        # More AIX lossage: compile with *_r variant\n        if test \"x$GCC\" != \"xyes\"; then\n            case $host_os in\n                aix*)\n                AS_CASE([\"x/$CC\"],\n                    [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],\n                    [#handle absolute path differently from PATH based program lookup\n                     AS_CASE([\"x$CC\"],\n                         [x/*],\n                         [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC=\"${CC}_r\"])],\n                         [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])\n                ;;\n            esac\n        fi\nfi\n\ntest -n \"$PTHREAD_CC\" || PTHREAD_CC=\"$CC\"\n\nAC_SUBST([PTHREAD_LIBS])\nAC_SUBST([PTHREAD_CFLAGS])\nAC_SUBST([PTHREAD_CC])\n\n# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:\nif test \"x$ax_pthread_ok\" = \"xyes\"; then\n        ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])\n        :\nelse\n        ax_pthread_ok=no\n        $2\nfi\nAC_LANG_POP\n])dnl AX_PTHREAD\n"
  },
  {
    "path": "build-aux/m4/bitcoin_find_bdb48.m4",
    "content": "dnl Copyright (c) 2013-2015 The Bitcoin Core developers\ndnl Distributed under the MIT software license, see the accompanying\ndnl file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nAC_DEFUN([BITCOIN_FIND_BDB48],[\n  AC_ARG_VAR(BDB_CFLAGS, [C compiler flags for BerkeleyDB, bypasses autodetection])\n  AC_ARG_VAR(BDB_LIBS, [Linker flags for BerkeleyDB, bypasses autodetection])\n\n  if test \"x$BDB_CFLAGS\" = \"x\"; then\n    AC_MSG_CHECKING([for Berkeley DB C++ headers])\n    BDB_CPPFLAGS=\n    bdbpath=X\n    bdb48path=X\n    bdbdirlist=\n    for _vn in 4.8 48 4 5 5.3 ''; do\n      for _pfx in b lib ''; do\n        bdbdirlist=\"$bdbdirlist ${_pfx}db${_vn}\"\n      done\n    done\n    for searchpath in $bdbdirlist ''; do\n      test -n \"${searchpath}\" && searchpath=\"${searchpath}/\"\n      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n        #include <${searchpath}db_cxx.h>\n      ]],[[\n        #if !((DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) || DB_VERSION_MAJOR > 4)\n          #error \"failed to find bdb 4.8+\"\n        #endif\n      ]])],[\n        if test \"x$bdbpath\" = \"xX\"; then\n          bdbpath=\"${searchpath}\"\n        fi\n      ],[\n        continue\n      ])\n      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n        #include <${searchpath}db_cxx.h>\n      ]],[[\n        #if !(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 8)\n          #error \"failed to find bdb 4.8\"\n        #endif\n      ]])],[\n        bdb48path=\"${searchpath}\"\n        break\n      ],[])\n    done\n    if test \"x$bdbpath\" = \"xX\"; then\n      AC_MSG_RESULT([no])\n      AC_MSG_ERROR([libdb_cxx headers missing, ]AC_PACKAGE_NAME[ requires this library for wallet functionality (--disable-wallet to disable wallet functionality)])\n    elif test \"x$bdb48path\" = \"xX\"; then\n      BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdbpath}],db_cxx)\n      AC_ARG_WITH([incompatible-bdb],[AS_HELP_STRING([--with-incompatible-bdb], [allow using a bdb version other than 4.8])],[\n        AC_MSG_WARN([Found Berkeley DB other than 4.8; wallets opened by this build will not be portable!])\n      ],[\n        AC_MSG_ERROR([Found Berkeley DB other than 4.8, required for portable wallets (--with-incompatible-bdb to ignore or --disable-wallet to disable wallet functionality)])\n      ])\n    else\n      BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb48path}],db_cxx)\n      bdbpath=\"${bdb48path}\"\n    fi\n  else\n    BDB_CPPFLAGS=${BDB_CFLAGS}\n  fi\n  AC_SUBST(BDB_CPPFLAGS)\n  \n  if test \"x$BDB_LIBS\" = \"x\"; then\n    # TODO: Ideally this could find the library version and make sure it matches the headers being used\n    for searchlib in db_cxx-4.8 db_cxx db4_cxx; do\n      AC_CHECK_LIB([$searchlib],[main],[\n        BDB_LIBS=\"-l${searchlib}\"\n        break\n      ])\n    done\n    if test \"x$BDB_LIBS\" = \"x\"; then\n        AC_MSG_ERROR([libdb_cxx missing, ]AC_PACKAGE_NAME[ requires this library for wallet functionality (--disable-wallet to disable wallet functionality)])\n    fi\n  fi\n  AC_SUBST(BDB_LIBS)\n])\n"
  },
  {
    "path": "build-aux/m4/bitcoin_qt.m4",
    "content": "dnl Copyright (c) 2013-2016 The Bitcoin Core developers\ndnl Distributed under the MIT software license, see the accompanying\ndnl file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\ndnl Helper for cases where a qt dependency is not met.\ndnl Output: If qt version is auto, set bitcoin_enable_qt to false. Else, exit.\nAC_DEFUN([BITCOIN_QT_FAIL],[\n  if test \"x$bitcoin_qt_want_version\" = xauto && test \"x$bitcoin_qt_force\" != xyes; then\n    if test \"x$bitcoin_enable_qt\" != xno; then\n      AC_MSG_WARN([$1; sugarchain-qt frontend will not be built])\n    fi\n    bitcoin_enable_qt=no\n    bitcoin_enable_qt_test=no\n  else\n    AC_MSG_ERROR([$1])\n  fi\n])\n\nAC_DEFUN([BITCOIN_QT_CHECK],[\n  if test \"x$bitcoin_enable_qt\" != xno && test \"x$bitcoin_qt_want_version\" != xno; then\n    true\n    $1\n  else\n    true\n    $2\n  fi\n])\n\ndnl BITCOIN_QT_PATH_PROGS([FOO], [foo foo2], [/path/to/search/first], [continue if missing])\ndnl Helper for finding the path of programs needed for Qt.\ndnl Inputs: $1: Variable to be set\ndnl Inputs: $2: List of programs to search for\ndnl Inputs: $3: Look for $2 here before $PATH\ndnl Inputs: $4: If \"yes\", don't fail if $2 is not found.\ndnl Output: $1 is set to the path of $2 if found. $2 are searched in order.\nAC_DEFUN([BITCOIN_QT_PATH_PROGS],[\n  BITCOIN_QT_CHECK([\n    if test \"x$3\" != x; then\n      AC_PATH_PROGS($1,$2,,$3)\n    else\n      AC_PATH_PROGS($1,$2)\n    fi\n    if test \"x$$1\" = x && test \"x$4\" != xyes; then\n      BITCOIN_QT_FAIL([$1 not found])\n    fi\n  ])\n])\n\ndnl Initialize qt input.\ndnl This must be called before any other BITCOIN_QT* macros to ensure that\ndnl input variables are set correctly.\ndnl CAUTION: Do not use this inside of a conditional.\nAC_DEFUN([BITCOIN_QT_INIT],[\n  dnl enable qt support\n  AC_ARG_WITH([gui],\n    [AS_HELP_STRING([--with-gui@<:@=no|qt4|qt5|auto@:>@],\n    [build sugarchain-qt GUI (default=auto, qt5 tried first)])],\n    [\n     bitcoin_qt_want_version=$withval\n     if test \"x$bitcoin_qt_want_version\" = xyes; then\n       bitcoin_qt_force=yes\n       bitcoin_qt_want_version=auto\n     fi\n    ],\n    [bitcoin_qt_want_version=auto])\n\n  AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], [])\n  AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], [])\n  AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], [])\n  AC_ARG_WITH([qt-translationdir],[AS_HELP_STRING([--with-qt-translationdir=PLUGIN_DIR],[specify qt translation path (overridden by pkgconfig)])], [qt_translation_path=$withval], [])\n  AC_ARG_WITH([qt-bindir],[AS_HELP_STRING([--with-qt-bindir=BIN_DIR],[specify qt bin path])], [qt_bin_path=$withval], [])\n\n  AC_ARG_WITH([qtdbus],\n    [AS_HELP_STRING([--with-qtdbus],\n    [enable DBus support (default is yes if qt is enabled and QtDBus is found)])],\n    [use_dbus=$withval],\n    [use_dbus=auto])\n\n  AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path)\n])\n\ndnl Find the appropriate version of Qt libraries and includes.\ndnl Inputs: $1: Whether or not pkg-config should be used. yes|no. Default: yes.\ndnl Inputs: $2: If $1 is \"yes\" and --with-gui=auto, which qt version should be\ndnl         tried first.\ndnl Outputs: See _BITCOIN_QT_FIND_LIBS_*\ndnl Outputs: Sets variables for all qt-related tools.\ndnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test\nAC_DEFUN([BITCOIN_QT_CONFIGURE],[\n  use_pkgconfig=$1\n\n  if test \"x$use_pkgconfig\" = x; then\n    use_pkgconfig=yes\n  fi\n\n  if test \"x$use_pkgconfig\" = xyes; then\n    BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG([$2])])\n  else\n    BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG])\n  fi\n\n  dnl This is ugly and complicated. Yuck. Works as follows:\n  dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can\n  dnl check a header to find out. When Qt is built statically, some plugins must\n  dnl be linked into the final binary as well. These plugins have changed between\n  dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration\n  dnl plugin was added. Since we can't tell if Qt4 is static or not, it is\n  dnl assumed for windows builds.\n  dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the\n  dnl results to QT_LIBS.\n  BITCOIN_QT_CHECK([\n  TEMP_CPPFLAGS=$CPPFLAGS\n  TEMP_CXXFLAGS=$CXXFLAGS\n  CPPFLAGS=\"$QT_INCLUDES $CPPFLAGS\"\n  CXXFLAGS=\"$PIC_FLAGS $CXXFLAGS\"\n  if test \"x$bitcoin_qt_got_major_vers\" = x5; then\n    _BITCOIN_QT_IS_STATIC\n    if test \"x$bitcoin_cv_static_qt\" = xyes; then\n      _BITCOIN_QT_FIND_STATIC_PLUGINS\n      AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])\n      AC_CACHE_CHECK(for Qt < 5.4, bitcoin_cv_need_acc_widget,[\n        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n            #include <QtCore/qconfig.h>\n            #ifndef QT_VERSION\n            #  include <QtCore/qglobal.h>\n            #endif\n          ]],\n          [[\n            #if QT_VERSION >= 0x050400\n            choke\n            #endif\n          ]])],\n        [bitcoin_cv_need_acc_widget=yes],\n        [bitcoin_cv_need_acc_widget=no])\n      ])\n      if test \"x$bitcoin_cv_need_acc_widget\" = xyes; then\n        _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets])\n      fi\n      _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)],[-lqminimal])\n      AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists])\n      if test \"x$TARGET_OS\" = xwindows; then\n        _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows])\n        AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows])\n      elif test \"x$TARGET_OS\" = xlinux; then\n        _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static])\n        AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb])\n      elif test \"x$TARGET_OS\" = xdarwin; then\n        AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS=\"$QT_LIBS -framework IOKit\"],[AC_MSG_ERROR(could not iokit framework)])\n        _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa])\n        AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa])\n      fi\n    fi\n  else\n    if test \"x$TARGET_OS\" = xwindows; then\n      AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])\n      _BITCOIN_QT_CHECK_STATIC_PLUGINS([\n         Q_IMPORT_PLUGIN(qcncodecs)\n         Q_IMPORT_PLUGIN(qjpcodecs)\n         Q_IMPORT_PLUGIN(qtwcodecs)\n         Q_IMPORT_PLUGIN(qkrcodecs)\n         Q_IMPORT_PLUGIN(AccessibleFactory)],\n         [-lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets])\n    fi\n  fi\n  CPPFLAGS=$TEMP_CPPFLAGS\n  CXXFLAGS=$TEMP_CXXFLAGS\n  ])\n\n  if test \"x$use_pkgconfig$qt_bin_path\" = xyes; then\n    if test \"x$bitcoin_qt_got_major_vers\" = x5; then\n      qt_bin_path=\"`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`\"\n    fi\n  fi\n\n  if test \"x$use_hardening\" != xno; then\n    BITCOIN_QT_CHECK([\n    AC_MSG_CHECKING(whether -fPIE can be used with this Qt config)\n    TEMP_CPPFLAGS=$CPPFLAGS\n    TEMP_CXXFLAGS=$CXXFLAGS\n    CPPFLAGS=\"$QT_INCLUDES $CPPFLAGS\"\n    CXXFLAGS=\"$PIE_FLAGS $CXXFLAGS\"\n    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n        #include <QtCore/qconfig.h>\n        #ifndef QT_VERSION\n        #  include <QtCore/qglobal.h>\n        #endif\n      ]],\n      [[\n        #if defined(QT_REDUCE_RELOCATIONS)\n        choke\n        #endif\n      ]])],\n      [ AC_MSG_RESULT(yes); QT_PIE_FLAGS=$PIE_FLAGS ],\n      [ AC_MSG_RESULT(no); QT_PIE_FLAGS=$PIC_FLAGS]\n    )\n    CPPFLAGS=$TEMP_CPPFLAGS\n    CXXFLAGS=$TEMP_CXXFLAGS\n    ])\n  else\n    BITCOIN_QT_CHECK([\n    AC_MSG_CHECKING(whether -fPIC is needed with this Qt config)\n    TEMP_CPPFLAGS=$CPPFLAGS\n    CPPFLAGS=\"$QT_INCLUDES $CPPFLAGS\"\n    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n        #include <QtCore/qconfig.h>\n        #ifndef QT_VERSION\n        #  include <QtCore/qglobal.h>\n        #endif\n      ]],\n      [[\n        #if defined(QT_REDUCE_RELOCATIONS)\n        choke\n        #endif\n      ]])],\n      [ AC_MSG_RESULT(no)],\n      [ AC_MSG_RESULT(yes); QT_PIE_FLAGS=$PIC_FLAGS]\n    )\n    CPPFLAGS=$TEMP_CPPFLAGS\n    ])\n  fi\n\n  BITCOIN_QT_PATH_PROGS([MOC], [moc-qt${bitcoin_qt_got_major_vers} moc${bitcoin_qt_got_major_vers} moc], $qt_bin_path)\n  BITCOIN_QT_PATH_PROGS([UIC], [uic-qt${bitcoin_qt_got_major_vers} uic${bitcoin_qt_got_major_vers} uic], $qt_bin_path)\n  BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt${bitcoin_qt_got_major_vers} rcc${bitcoin_qt_got_major_vers} rcc], $qt_bin_path)\n  BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt${bitcoin_qt_got_major_vers} lrelease${bitcoin_qt_got_major_vers} lrelease], $qt_bin_path)\n  BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt${bitcoin_qt_got_major_vers} lupdate${bitcoin_qt_got_major_vers} lupdate],$qt_bin_path, yes)\n\n  MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)'\n  case $host in\n    *darwin*)\n     BITCOIN_QT_CHECK([\n       MOC_DEFS=\"${MOC_DEFS} -DQ_OS_MAC\"\n       base_frameworks=\"-framework Foundation -framework ApplicationServices -framework AppKit\"\n       AX_CHECK_LINK_FLAG([[$base_frameworks]],[QT_LIBS=\"$QT_LIBS $base_frameworks\"],[AC_MSG_ERROR(could not find base frameworks)])\n     ])\n    ;;\n    *mingw*)\n       BITCOIN_QT_CHECK([\n         AX_CHECK_LINK_FLAG([[-mwindows]],[QT_LDFLAGS=\"$QT_LDFLAGS -mwindows\"],[AC_MSG_WARN(-mwindows linker support not detected)])\n       ])\n  esac\n\n\n  dnl enable qt support\n  AC_MSG_CHECKING(whether to build ]AC_PACKAGE_NAME[ GUI)\n  BITCOIN_QT_CHECK([\n    bitcoin_enable_qt=yes\n    bitcoin_enable_qt_test=yes\n    if test \"x$have_qt_test\" = xno; then\n      bitcoin_enable_qt_test=no\n    fi\n    bitcoin_enable_qt_dbus=no\n    if test \"x$use_dbus\" != xno && test \"x$have_qt_dbus\" = xyes; then\n      bitcoin_enable_qt_dbus=yes\n    fi\n    if test \"x$use_dbus\" = xyes && test \"x$have_qt_dbus\" = xno; then\n      AC_MSG_ERROR([libQtDBus not found. Install libQtDBus or remove --with-qtdbus.])\n    fi\n    if test \"x$LUPDATE\" = x; then\n      AC_MSG_WARN([lupdate is required to update qt translations])\n    fi\n  ],[\n    bitcoin_enable_qt=no\n  ])\n  AC_MSG_RESULT([$bitcoin_enable_qt (Qt${bitcoin_qt_got_major_vers})])\n\n  AC_SUBST(QT_PIE_FLAGS)\n  AC_SUBST(QT_INCLUDES)\n  AC_SUBST(QT_LIBS)\n  AC_SUBST(QT_LDFLAGS)\n  AC_SUBST(QT_DBUS_INCLUDES)\n  AC_SUBST(QT_DBUS_LIBS)\n  AC_SUBST(QT_TEST_INCLUDES)\n  AC_SUBST(QT_TEST_LIBS)\n  AC_SUBST(QT_SELECT, qt${bitcoin_qt_got_major_vers})\n  AC_SUBST(MOC_DEFS)\n])\n\ndnl All macros below are internal and should _not_ be used from the main\ndnl configure.ac.\ndnl ----\n\ndnl Internal. Check if the included version of Qt is Qt5.\ndnl Requires: INCLUDES must be populated as necessary.\ndnl Output: bitcoin_cv_qt5=yes|no\nAC_DEFUN([_BITCOIN_QT_CHECK_QT5],[\n  AC_CACHE_CHECK(for Qt 5, bitcoin_cv_qt5,[\n  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n      #include <QtCore/qconfig.h>\n      #ifndef QT_VERSION\n      #  include <QtCore/qglobal.h>\n      #endif\n    ]],\n    [[\n      #if QT_VERSION < 0x050000\n      choke\n      #endif\n    ]])],\n    [bitcoin_cv_qt5=yes],\n    [bitcoin_cv_qt5=no])\n])])\n\ndnl Internal. Check if the linked version of Qt was built as static libs.\ndnl Requires: Qt5. This check cannot determine if Qt4 is static.\ndnl Requires: INCLUDES and LIBS must be populated as necessary.\ndnl Output: bitcoin_cv_static_qt=yes|no\ndnl Output: Defines QT_STATICPLUGIN if plugins are static.\nAC_DEFUN([_BITCOIN_QT_IS_STATIC],[\n  AC_CACHE_CHECK(for static Qt, bitcoin_cv_static_qt,[\n  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n      #include <QtCore/qconfig.h>\n      #ifndef QT_VERSION\n      #  include <QtCore/qglobal.h>\n      #endif\n    ]],\n    [[\n      #if !defined(QT_STATIC)\n      choke\n      #endif\n    ]])],\n    [bitcoin_cv_static_qt=yes],\n    [bitcoin_cv_static_qt=no])\n  ])\n  if test \"x$bitcoin_cv_static_qt\" = xyes; then\n    AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol for static Qt plugins])\n  fi\n])\n\ndnl Internal. Check if the link-requirements for static plugins are met.\ndnl Requires: INCLUDES and LIBS must be populated as necessary.\ndnl Inputs: $1: A series of Q_IMPORT_PLUGIN().\ndnl Inputs: $2: The libraries that resolve $1.\ndnl Output: QT_LIBS is prepended or configure exits.\nAC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[\n  AC_MSG_CHECKING(for static Qt plugins: $2)\n  CHECK_STATIC_PLUGINS_TEMP_LIBS=\"$LIBS\"\n  LIBS=\"$2 $QT_LIBS $LIBS\"\n  AC_LINK_IFELSE([AC_LANG_PROGRAM([[\n    #define QT_STATICPLUGIN\n    #include <QtPlugin>\n    $1]],\n    [[return 0;]])],\n    [AC_MSG_RESULT(yes); QT_LIBS=\"$2 $QT_LIBS\"],\n    [AC_MSG_RESULT(no); BITCOIN_QT_FAIL(Could not resolve: $2)])\n  LIBS=\"$CHECK_STATIC_PLUGINS_TEMP_LIBS\"\n])\n\ndnl Internal. Find paths necessary for linking qt static plugins\ndnl Inputs: bitcoin_qt_got_major_vers. 4 or 5.\ndnl Inputs: qt_plugin_path. optional.\ndnl Outputs: QT_LIBS is appended\nAC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[\n  if test \"x$bitcoin_qt_got_major_vers\" = x5; then\n      if test \"x$qt_plugin_path\" != x; then\n        QT_LIBS=\"$QT_LIBS -L$qt_plugin_path/platforms\"\n        if test -d \"$qt_plugin_path/accessible\"; then\n          QT_LIBS=\"$QT_LIBS -L$qt_plugin_path/accessible\"\n        fi\n      fi\n     if test \"x$use_pkgconfig\" = xyes; then\n     : dnl\n     m4_ifdef([PKG_CHECK_MODULES],[\n       PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS=\"$QTPLATFORM_LIBS $QT_LIBS\"])\n       if test \"x$TARGET_OS\" = xlinux; then\n         PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS=\"$X11XCB_LIBS $QT_LIBS\"])\n         if ${PKG_CONFIG} --exists \"Qt5Core >= 5.5\" 2>/dev/null; then\n           PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS=\"$QTXCBQPA_LIBS $QT_LIBS\"])\n         fi\n       elif test \"x$TARGET_OS\" = xdarwin; then\n         PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS=\"$QTPRINT_LIBS $QT_LIBS\"])\n       fi\n     ])\n     else\n       if test \"x$TARGET_OS\" = xwindows; then\n         AC_CACHE_CHECK(for Qt >= 5.6, bitcoin_cv_need_platformsupport,[\n           AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n               #include <QtCore/qconfig.h>\n               #ifndef QT_VERSION\n               #  include <QtCore/qglobal.h>\n               #endif\n             ]],\n             [[\n               #if QT_VERSION < 0x050600\n               choke\n               #endif\n             ]])],\n           [bitcoin_cv_need_platformsupport=yes],\n           [bitcoin_cv_need_platformsupport=no])\n         ])\n         if test \"x$bitcoin_cv_need_platformsupport\" = xyes; then\n           BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}PlatformSupport],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}PlatformSupport not found)))\n         fi\n       fi\n     fi\n  else\n    if test \"x$qt_plugin_path\" != x; then\n      QT_LIBS=\"$QT_LIBS -L$qt_plugin_path/accessible\"\n      QT_LIBS=\"$QT_LIBS -L$qt_plugin_path/codecs\"\n    fi\n  fi\n])\n\ndnl Internal. Find Qt libraries using pkg-config.\ndnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to check\ndnl         first.\ndnl Inputs: $1: If bitcoin_qt_want_version is \"auto\", check for this version\ndnl         first.\ndnl Outputs: All necessary QT_* variables are set.\ndnl Outputs: bitcoin_qt_got_major_vers is set to \"4\" or \"5\".\ndnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.\nAC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[\n  m4_ifdef([PKG_CHECK_MODULES],[\n  auto_priority_version=$1\n  if test \"x$auto_priority_version\" = x; then\n    auto_priority_version=qt5\n  fi\n    if test \"x$bitcoin_qt_want_version\" = xqt5 ||  ( test \"x$bitcoin_qt_want_version\" = xauto && test \"x$auto_priority_version\" = xqt5 ); then\n      QT_LIB_PREFIX=Qt5\n      bitcoin_qt_got_major_vers=5\n    else\n      QT_LIB_PREFIX=Qt\n      bitcoin_qt_got_major_vers=4\n    fi\n    qt5_modules=\"Qt5Core Qt5Gui Qt5Network Qt5Widgets\"\n    qt4_modules=\"QtCore QtGui QtNetwork\"\n    BITCOIN_QT_CHECK([\n      if test \"x$bitcoin_qt_want_version\" = xqt5 || ( test \"x$bitcoin_qt_want_version\" = xauto && test \"x$auto_priority_version\" = xqt5 ); then\n        PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES=\"$QT5_CFLAGS\"; QT_LIBS=\"$QT5_LIBS\" have_qt=yes],[have_qt=no])\n      elif test \"x$bitcoin_qt_want_version\" = xqt4 || ( test \"x$bitcoin_qt_want_version\" = xauto && test \"x$auto_priority_version\" = xqt4 ); then\n        PKG_CHECK_MODULES([QT4], [$qt4_modules], [QT_INCLUDES=\"$QT4_CFLAGS\"; QT_LIBS=\"$QT4_LIBS\" ; have_qt=yes], [have_qt=no])\n      fi\n\n      dnl qt version is set to 'auto' and the preferred version wasn't found. Now try the other.\n      if test \"x$have_qt\" = xno && test \"x$bitcoin_qt_want_version\" = xauto; then\n        if test \"x$auto_priority_version\" = xqt5; then\n          PKG_CHECK_MODULES([QT4], [$qt4_modules], [QT_INCLUDES=\"$QT4_CFLAGS\"; QT_LIBS=\"$QT4_LIBS\" ; have_qt=yes; QT_LIB_PREFIX=Qt; bitcoin_qt_got_major_vers=4], [have_qt=no])\n        else\n          PKG_CHECK_MODULES([QT5], [$qt5_modules], [QT_INCLUDES=\"$QT5_CFLAGS\"; QT_LIBS=\"$QT5_LIBS\" ; have_qt=yes; QT_LIB_PREFIX=Qt5; bitcoin_qt_got_major_vers=5], [have_qt=no])\n        fi\n      fi\n      if test \"x$have_qt\" != xyes; then\n        have_qt=no\n        BITCOIN_QT_FAIL([Qt dependencies not found])\n      fi\n    ])\n    BITCOIN_QT_CHECK([\n      PKG_CHECK_MODULES([QT_TEST], [${QT_LIB_PREFIX}Test], [QT_TEST_INCLUDES=\"$QT_TEST_CFLAGS\"; have_qt_test=yes], [have_qt_test=no])\n      if test \"x$use_dbus\" != xno; then\n        PKG_CHECK_MODULES([QT_DBUS], [${QT_LIB_PREFIX}DBus], [QT_DBUS_INCLUDES=\"$QT_DBUS_CFLAGS\"; have_qt_dbus=yes], [have_qt_dbus=no])\n      fi\n    ])\n  ])\n  true; dnl\n])\n\ndnl Internal. Find Qt libraries without using pkg-config. Version is deduced\ndnl from the discovered headers.\ndnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to use.\ndnl         If \"auto\", the version will be discovered by _BITCOIN_QT_CHECK_QT5.\ndnl Outputs: All necessary QT_* variables are set.\ndnl Outputs: bitcoin_qt_got_major_vers is set to \"4\" or \"5\".\ndnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.\nAC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[\n  TEMP_CPPFLAGS=\"$CPPFLAGS\"\n  TEMP_CXXFLAGS=\"$CXXFLAGS\"\n  CXXFLAGS=\"$PIC_FLAGS $CXXFLAGS\"\n  TEMP_LIBS=\"$LIBS\"\n  BITCOIN_QT_CHECK([\n    if test \"x$qt_include_path\" != x; then\n      QT_INCLUDES=\"-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtWidgets -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus\"\n      CPPFLAGS=\"$QT_INCLUDES $CPPFLAGS\"\n    fi\n  ])\n\n  BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtPlugin],,BITCOIN_QT_FAIL(QtCore headers missing))])\n  BITCOIN_QT_CHECK([AC_CHECK_HEADER([QApplication],, BITCOIN_QT_FAIL(QtGui headers missing))])\n  BITCOIN_QT_CHECK([AC_CHECK_HEADER([QLocalSocket],, BITCOIN_QT_FAIL(QtNetwork headers missing))])\n\n  BITCOIN_QT_CHECK([\n    if test \"x$bitcoin_qt_want_version\" = xauto; then\n      _BITCOIN_QT_CHECK_QT5\n    fi\n    if test \"x$bitcoin_cv_qt5\" = xyes || test \"x$bitcoin_qt_want_version\" = xqt5; then\n      QT_LIB_PREFIX=Qt5\n      bitcoin_qt_got_major_vers=5\n    else\n      QT_LIB_PREFIX=Qt\n      bitcoin_qt_got_major_vers=4\n    fi\n  ])\n\n  BITCOIN_QT_CHECK([\n    LIBS=\n    if test \"x$qt_lib_path\" != x; then\n      LIBS=\"$LIBS -L$qt_lib_path\"\n    fi\n\n    if test \"x$TARGET_OS\" = xwindows; then\n      AC_CHECK_LIB([imm32],      [main],, BITCOIN_QT_FAIL(libimm32 not found))\n    fi\n  ])\n\n  BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,AC_MSG_WARN([zlib not found. Assuming qt has it built-in])))\n  BITCOIN_QT_CHECK(AC_SEARCH_LIBS([png_error] ,[qtpng png],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in])))\n  BITCOIN_QT_CHECK(AC_SEARCH_LIBS([jpeg_create_decompress] ,[qtjpeg jpeg],,AC_MSG_WARN([libjpeg not found. Assuming qt has it built-in])))\n  BITCOIN_QT_CHECK(AC_SEARCH_LIBS([pcre16_exec], [qtpcre pcre16],,AC_MSG_WARN([libpcre16 not found. Assuming qt has it built-in])))\n  BITCOIN_QT_CHECK(AC_SEARCH_LIBS([hb_ot_tags_from_script] ,[qtharfbuzzng harfbuzz],,AC_MSG_WARN([libharfbuzz not found. Assuming qt has it built-in or support is disabled])))\n  BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core]   ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Core not found)))\n  BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui]    ,[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Gui not found)))\n  BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Network not found)))\n  if test \"x$bitcoin_qt_got_major_vers\" = x5; then\n    BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib${QT_LIB_PREFIX}Widgets not found)))\n  fi\n  QT_LIBS=\"$LIBS\"\n  LIBS=\"$TEMP_LIBS\"\n\n  BITCOIN_QT_CHECK([\n    LIBS=\n    if test \"x$qt_lib_path\" != x; then\n      LIBS=\"-L$qt_lib_path\"\n    fi\n    AC_CHECK_LIB([${QT_LIB_PREFIX}Test],      [main],, have_qt_test=no)\n    AC_CHECK_HEADER([QTest],, have_qt_test=no)\n    QT_TEST_LIBS=\"$LIBS\"\n    if test \"x$use_dbus\" != xno; then\n      LIBS=\n      if test \"x$qt_lib_path\" != x; then\n        LIBS=\"-L$qt_lib_path\"\n      fi\n      AC_CHECK_LIB([${QT_LIB_PREFIX}DBus],      [main],, have_qt_dbus=no)\n      AC_CHECK_HEADER([QtDBus],, have_qt_dbus=no)\n      QT_DBUS_LIBS=\"$LIBS\"\n    fi\n  ])\n  CPPFLAGS=\"$TEMP_CPPFLAGS\"\n  CXXFLAGS=\"$TEMP_CXXFLAGS\"\n  LIBS=\"$TEMP_LIBS\"\n])\n\n"
  },
  {
    "path": "build-aux/m4/bitcoin_subdir_to_include.m4",
    "content": "dnl Copyright (c) 2013-2014 The Bitcoin Core developers\ndnl Distributed under the MIT software license, see the accompanying\ndnl file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\ndnl BITCOIN_SUBDIR_TO_INCLUDE([CPPFLAGS-VARIABLE-NAME],[SUBDIRECTORY-NAME],[HEADER-FILE])\ndnl SUBDIRECTORY-NAME must end with a path separator\nAC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[\n  if test \"x$2\" = \"x\"; then\n    AC_MSG_RESULT([default])\n  else\n    echo \"#include <$2$3.h>\" >conftest.cpp\n    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`]\n    AC_MSG_RESULT([${newinclpath}])\n    if test \"x${newinclpath}\" != \"x\"; then\n      eval \"$1=\\\"\\$$1\\\"' -I${newinclpath}'\"\n    fi\n  fi\n])\n"
  },
  {
    "path": "build-aux/m4/l_atomic.m4",
    "content": "dnl Copyright (c) 2015 Tim Kosse <tim.kosse@filezilla-project.org>\ndnl Copying and distribution of this file, with or without modification, are\ndnl permitted in any medium without royalty provided the copyright notice\ndnl and this notice are preserved. This file is offered as-is, without any\ndnl warranty.\n\n# Some versions of gcc/libstdc++ require linking with -latomic if\n# using the C++ atomic library.\n#\n# Sourced from http://bugs.debian.org/797228\n\nm4_define([_CHECK_ATOMIC_testbody], [[\n  #include <atomic>\n  #include <cstdint>\n\n  int main() {\n    std::atomic<int64_t> a{};\n\n    int64_t v = 5;\n    int64_t r = a.fetch_add(v);\n    return static_cast<int>(r);\n  }\n]])\n\nAC_DEFUN([CHECK_ATOMIC], [\n\n  AC_LANG_PUSH(C++)\n\n  AC_MSG_CHECKING([whether std::atomic can be used without link library])\n\n  AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[\n      AC_MSG_RESULT([yes])\n    ],[\n      AC_MSG_RESULT([no])\n      LIBS=\"$LIBS -latomic\"\n      AC_MSG_CHECKING([whether std::atomic needs -latomic])\n      AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[\n          AC_MSG_RESULT([yes])\n        ],[\n          AC_MSG_RESULT([no])\n          AC_MSG_FAILURE([cannot figure out how to use std::atomic])\n        ])\n    ])\n\n  AC_LANG_POP\n])\n"
  },
  {
    "path": "configure.ac",
    "content": "dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)\nAC_PREREQ([2.60])\ndefine(_CLIENT_VERSION_MAJOR, 0)\ndefine(_CLIENT_VERSION_MINOR, 16)\ndefine(_CLIENT_VERSION_REVISION, 3)\ndefine(_CLIENT_VERSION_BUILD, 36)\ndefine(_CLIENT_VERSION_IS_RELEASE, true)\ndefine(_COPYRIGHT_YEAR, 2020)\ndefine(_COPYRIGHT_HOLDERS,[The %s developers])\ndefine(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Sugarchain Yumekawa]])\nAC_INIT([Sugarchain Yumekawa],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/sugarchain-project/sugarchain/issues],[sugarchain],[https://sugarchain.org/])\nAC_CONFIG_SRCDIR([src/validation.cpp])\nAC_CONFIG_HEADERS([src/config/bitcoin-config.h])\nAC_CONFIG_AUX_DIR([build-aux])\nAC_CONFIG_MACRO_DIR([build-aux/m4])\n\nBITCOIN_DAEMON_NAME=sugarchaind\nBITCOIN_GUI_NAME=sugarchain-qt\nBITCOIN_CLI_NAME=sugarchain-cli\nBITCOIN_TX_NAME=sugarchain-tx\n\ndnl Unless the user specified ARFLAGS, force it to be cr\nAC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to <cr> if not set])\nif test \"x${ARFLAGS+set}\" != \"xset\"; then\n  ARFLAGS=\"cr\"\nfi\n\nAC_CANONICAL_HOST\n\nAH_TOP([#ifndef BITCOIN_CONFIG_H])\nAH_TOP([#define BITCOIN_CONFIG_H])\nAH_BOTTOM([#endif //BITCOIN_CONFIG_H])\n\ndnl faketime breaks configure and is only needed for make. Disable it here.\nunset FAKETIME\n\ndnl Automake init set-up and checks\nAM_INIT_AUTOMAKE([no-define subdir-objects foreign])\n\ndnl faketime messes with timestamps and causes configure to be re-run.\ndnl --disable-maintainer-mode can be used to bypass this.\nAM_MAINTAINER_MODE([enable])\n\ndnl make the compilation flags quiet unless V=1 is used\nm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])\n\ndnl Compiler checks (here before libtool).\nif test \"x${CXXFLAGS+set}\" = \"xset\"; then\n  CXXFLAGS_overridden=yes\nelse\n  CXXFLAGS_overridden=no\nfi\nAC_PROG_CXX\n\ndnl By default, libtool for mingw refuses to link static libs into a dll for\ndnl fear of mixing pic/non-pic objects, and import/export complications. Since\ndnl we have those under control, re-enable that functionality.\ncase $host in\n  *mingw*)\n     lt_cv_deplibs_check_method=\"pass_all\"\n  ;;\nesac\ndnl Require C++11 compiler (no GNU extensions)\nAX_CXX_COMPILE_STDCXX([11], [noext], [mandatory], [nodefault])\ndnl Check if -latomic is required for <std::atomic>\nCHECK_ATOMIC\n\ndnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures\ndnl that we get the same -std flags for both.\nm4_ifdef([AC_PROG_OBJCXX],[\nif test \"x${OBJCXX+set}\" = \"x\"; then\n  OBJCXX=\"${CXX}\"\nfi\nAC_PROG_OBJCXX\n])\n\ndnl Libtool init checks.\nLT_INIT([pic-only])\n\ndnl Check/return PATH for base programs.\nAC_PATH_TOOL(AR, ar)\nAC_PATH_TOOL(RANLIB, ranlib)\nAC_PATH_TOOL(STRIP, strip)\nAC_PATH_TOOL(GCOV, gcov)\nAC_PATH_PROG(LCOV, lcov)\ndnl Python 3.x is supported from 3.4 on (see https://github.com/bitcoin/bitcoin/issues/7893)\nAC_PATH_PROGS([PYTHON], [python3.6 python3.5 python3.4 python3 python2.7 python2 python])\nAC_PATH_PROG(GENHTML, genhtml)\nAC_PATH_PROG([GIT], [git])\nAC_PATH_PROG(CCACHE,ccache)\nAC_PATH_PROG(XGETTEXT,xgettext)\nAC_PATH_PROG(HEXDUMP,hexdump)\nAC_PATH_TOOL(READELF, readelf)\nAC_PATH_TOOL(CPPFILT, c++filt)\nAC_PATH_TOOL(OBJCOPY, objcopy)\n\nAC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files)\n\n# Enable wallet\nAC_ARG_ENABLE([wallet],\n  [AS_HELP_STRING([--disable-wallet],\n  [disable wallet (enabled by default)])],\n  [enable_wallet=$enableval],\n  [enable_wallet=yes])\n\nAC_ARG_WITH([miniupnpc],\n  [AS_HELP_STRING([--with-miniupnpc],\n  [enable UPNP (default is yes if libminiupnpc is found)])],\n  [use_upnp=$withval],\n  [use_upnp=auto])\n\nAC_ARG_ENABLE([upnp-default],\n  [AS_HELP_STRING([--enable-upnp-default],\n  [if UPNP is enabled, turn it on at startup (default is no)])],\n  [use_upnp_default=$enableval],\n  [use_upnp_default=no])\n\nAC_ARG_ENABLE(tests,\n    AS_HELP_STRING([--disable-tests],[do not compile tests (default is to compile)]),\n    [use_tests=$enableval],\n    [use_tests=yes])\n\nAC_ARG_ENABLE(gui-tests,\n    AS_HELP_STRING([--disable-gui-tests],[do not compile GUI tests (default is to compile if GUI and tests enabled)]),\n    [use_gui_tests=$enableval],\n    [use_gui_tests=$use_tests])\n\nAC_ARG_ENABLE(bench,\n    AS_HELP_STRING([--disable-bench],[do not compile benchmarks (default is to compile)]),\n    [use_bench=$enableval],\n    [use_bench=yes])\n\nAC_ARG_ENABLE([extended-functional-tests],\n    AS_HELP_STRING([--enable-extended-functional-tests],[enable expensive functional tests when using lcov (default no)]),\n    [use_extended_functional_tests=$enableval],\n    [use_extended_functional_tests=no])\n\nAC_ARG_WITH([qrencode],\n  [AS_HELP_STRING([--with-qrencode],\n  [enable QR code support (default is yes if qt is enabled and libqrencode is found)])],\n  [use_qr=$withval],\n  [use_qr=auto])\n\nAC_ARG_ENABLE([hardening],\n  [AS_HELP_STRING([--disable-hardening],\n  [do not attempt to harden the resulting executables (default is to harden)])],\n  [use_hardening=$enableval],\n  [use_hardening=yes])\n\nAC_ARG_ENABLE([reduce-exports],\n  [AS_HELP_STRING([--enable-reduce-exports],\n  [attempt to reduce exported symbols in the resulting executables (default is no)])],\n  [use_reduce_exports=$enableval],\n  [use_reduce_exports=no])\n\nAC_ARG_ENABLE([ccache],\n  [AS_HELP_STRING([--disable-ccache],\n  [do not use ccache for building (default is to use if found)])],\n  [use_ccache=$enableval],\n  [use_ccache=auto])\n\nAC_ARG_ENABLE([lcov],\n  [AS_HELP_STRING([--enable-lcov],\n  [enable lcov testing (default is no)])],\n  [use_lcov=$enableval],\n  [use_lcov=no])\n\nAC_ARG_ENABLE([lcov-branch-coverage],\n  [AS_HELP_STRING([--enable-lcov-branch-coverage],\n  [enable lcov testing branch coverage (default is no)])],\n  [use_lcov_branch=yes],\n  [use_lcov_branch=no])\n\nAC_ARG_ENABLE([glibc-back-compat],\n  [AS_HELP_STRING([--enable-glibc-back-compat],\n  [enable backwards compatibility with glibc])],\n  [use_glibc_compat=$enableval],\n  [use_glibc_compat=no])\n\nAC_ARG_ENABLE([asm],\n  [AS_HELP_STRING([--enable-asm],\n  [Enable assembly routines (default is yes)])],\n  [use_asm=$enableval],\n  [use_asm=yes])\n\nif test \"x$use_asm\" = xyes; then\n  AC_DEFINE(USE_ASM, 1, [Define this symbol to build in assembly routines])\nfi\n\nAC_ARG_WITH([system-univalue],\n  [AS_HELP_STRING([--with-system-univalue],\n  [Build with system UniValue (default is no)])],\n  [system_univalue=$withval],\n  [system_univalue=no]\n)\nAC_ARG_ENABLE([zmq],\n  [AS_HELP_STRING([--disable-zmq],\n  [disable ZMQ notifications])],\n  [use_zmq=$enableval],\n  [use_zmq=yes])\n\nAC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], [])\n\nAC_ARG_ENABLE(man,\n    [AS_HELP_STRING([--disable-man],\n                    [do not install man pages (default is to install)])],,\n    enable_man=yes)\nAM_CONDITIONAL(ENABLE_MAN, test \"$enable_man\" != no)\n\n# Enable debug\nAC_ARG_ENABLE([debug],\n    [AS_HELP_STRING([--enable-debug],\n                    [use debug compiler flags and macros (default is no)])],\n    [enable_debug=$enableval],\n    [enable_debug=no])\n\n# Turn warnings into errors\nAC_ARG_ENABLE([werror],\n    [AS_HELP_STRING([--enable-werror],\n                    [Treat certain compiler warnings as errors (default is no)])],\n    [enable_werror=$enableval],\n    [enable_werror=no])\n\nAC_LANG_PUSH([C++])\nAX_CHECK_COMPILE_FLAG([-Werror],[CXXFLAG_WERROR=\"-Werror\"],[CXXFLAG_WERROR=\"\"])\n\nif test \"x$enable_debug\" = xyes; then\n    CPPFLAGS=\"$CPPFLAGS -DDEBUG -DDEBUG_LOCKORDER\"\n    if test \"x$GCC\" = xyes; then\n        CFLAGS=\"$CFLAGS -g3 -O0\"\n    fi\n\n    if test \"x$GXX\" = xyes; then\n        CXXFLAGS=\"$CXXFLAGS -g3 -O0\"\n    fi\nfi\n\nERROR_CXXFLAGS=\nif test \"x$enable_werror\" = \"xyes\"; then\n  if test \"x$CXXFLAG_WERROR\" = \"x\"; then\n    AC_MSG_ERROR(\"enable-werror set but -Werror is not usable\")\n  fi\n  AX_CHECK_COMPILE_FLAG([-Werror=vla],[ERROR_CXXFLAGS=\"$ERROR_CXXFLAGS -Werror=vla\"],,[[$CXXFLAG_WERROR]])\n  AX_CHECK_COMPILE_FLAG([-Werror=thread-safety-analysis],[ERROR_CXXFLAGS=\"$ERROR_CXXFLAGS -Werror=thread-safety-analysis\"],,[[$CXXFLAG_WERROR]])\nfi\n\nif test \"x$CXXFLAGS_overridden\" = \"xno\"; then\n  AX_CHECK_COMPILE_FLAG([-Wall],[CXXFLAGS=\"$CXXFLAGS -Wall\"],,[[$CXXFLAG_WERROR]])\n  AX_CHECK_COMPILE_FLAG([-Wextra],[CXXFLAGS=\"$CXXFLAGS -Wextra\"],,[[$CXXFLAG_WERROR]])\n  AX_CHECK_COMPILE_FLAG([-Wformat],[CXXFLAGS=\"$CXXFLAGS -Wformat\"],,[[$CXXFLAG_WERROR]])\n  AX_CHECK_COMPILE_FLAG([-Wvla],[CXXFLAGS=\"$CXXFLAGS -Wvla\"],,[[$CXXFLAG_WERROR]])\n  AX_CHECK_COMPILE_FLAG([-Wformat-security],[CXXFLAGS=\"$CXXFLAGS -Wformat-security\"],,[[$CXXFLAG_WERROR]])\n  AX_CHECK_COMPILE_FLAG([-Wthread-safety-analysis],[CXXFLAGS=\"$CXXFLAGS -Wthread-safety-analysis\"],,[[$CXXFLAG_WERROR]])\n\n  ## Some compilers (gcc) ignore unknown -Wno-* options, but warn about all\n  ## unknown options if any other warning is produced. Test the -Wfoo case, and\n  ## set the -Wno-foo case if it works.\n  AX_CHECK_COMPILE_FLAG([-Wunused-parameter],[CXXFLAGS=\"$CXXFLAGS -Wno-unused-parameter\"],,[[$CXXFLAG_WERROR]])\n  AX_CHECK_COMPILE_FLAG([-Wself-assign],[CXXFLAGS=\"$CXXFLAGS -Wno-self-assign\"],,[[$CXXFLAG_WERROR]])\n  AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[CXXFLAGS=\"$CXXFLAGS -Wno-unused-local-typedef\"],,[[$CXXFLAG_WERROR]])\n  AX_CHECK_COMPILE_FLAG([-Wdeprecated-register],[CXXFLAGS=\"$CXXFLAGS -Wno-deprecated-register\"],,[[$CXXFLAG_WERROR]])\n  AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough],[CXXFLAGS=\"$CXXFLAGS -Wno-implicit-fallthrough\"],,[[$CXXFLAG_WERROR]])\nfi\n\n# Check for optional instruction set support. Enabling these does _not_ imply that all code will\n# be compiled with them, rather that specific objects/libs may use them after checking for runtime\n# compatibility.\nAX_CHECK_COMPILE_FLAG([-msse4.2],[[SSE42_CXXFLAGS=\"-msse4.2\"]],,[[$CXXFLAG_WERROR]])\n\nTEMP_CXXFLAGS=\"$CXXFLAGS\"\nCXXFLAGS=\"$CXXFLAGS $SSE42_CXXFLAGS\"\nAC_MSG_CHECKING(for assembler crc32 support)\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n    #include <stdint.h>\n    #if defined(_MSC_VER)\n    #include <intrin.h>\n    #elif defined(__GNUC__) && defined(__SSE4_2__)\n    #include <nmmintrin.h>\n    #endif\n  ]],[[\n    uint64_t l = 0;\n    l = _mm_crc32_u8(l, 0);\n    l = _mm_crc32_u32(l, 0);\n    l = _mm_crc32_u64(l, 0);\n    return l;\n  ]])],\n [ AC_MSG_RESULT(yes); enable_hwcrc32=yes],\n [ AC_MSG_RESULT(no)]\n)\nCXXFLAGS=\"$TEMP_CXXFLAGS\"\n\nCPPFLAGS=\"$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS\"\n\nAC_ARG_WITH([utils],\n  [AS_HELP_STRING([--with-utils],\n  [build sugarchain-cli bitcoin-tx (default=yes)])],\n  [build_bitcoin_utils=$withval],\n  [build_bitcoin_utils=yes])\n\nAC_ARG_WITH([libs],\n  [AS_HELP_STRING([--with-libs],\n  [build libraries (default=yes)])],\n  [build_bitcoin_libs=$withval],\n  [build_bitcoin_libs=yes])\n\nAC_ARG_WITH([daemon],\n  [AS_HELP_STRING([--with-daemon],\n  [build sugarchaind daemon (default=yes)])],\n  [build_bitcoind=$withval],\n  [build_bitcoind=yes])\n\nuse_pkgconfig=yes\ncase $host in\n  *mingw*)\n\n     #pkgconfig does more harm than good with MinGW\n     use_pkgconfig=no\n\n     TARGET_OS=windows\n     AC_CHECK_LIB([mingwthrd],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([kernel32],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([user32],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([gdi32],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([comdlg32],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([winspool],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([winmm],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([shell32],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([comctl32],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([ole32],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([oleaut32],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([uuid],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([rpcrt4],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([advapi32],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([ws2_32],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([mswsock],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([shlwapi],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([iphlpapi],      [main],, AC_MSG_ERROR(lib missing))\n     AC_CHECK_LIB([crypt32],      [main],, AC_MSG_ERROR(lib missing))\n\n     # -static is interpreted by libtool, where it has a different meaning.\n     # In libtool-speak, it's -all-static.\n     AX_CHECK_LINK_FLAG([[-static]],[LIBTOOL_APP_LDFLAGS=\"$LIBTOOL_APP_LDFLAGS -all-static\"])\n\n     AC_PATH_PROG([MAKENSIS], [makensis], none)\n     if test x$MAKENSIS = xnone; then\n       AC_MSG_WARN(\"makensis not found. Cannot create installer.\")\n     fi\n\n     AC_PATH_TOOL(WINDRES, windres, none)\n     if test x$WINDRES = xnone; then\n       AC_MSG_ERROR(\"windres not found\")\n     fi\n\n     CPPFLAGS=\"$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB\"\n     LEVELDB_TARGET_FLAGS=\"-DOS_WINDOWS\"\n     if test \"x$CXXFLAGS_overridden\" = \"xno\"; then\n       CXXFLAGS=\"$CXXFLAGS -w\"\n     fi\n     case $host in\n       i?86-*) WINDOWS_BITS=32 ;;\n       x86_64-*) WINDOWS_BITS=64 ;;\n       *) AC_MSG_ERROR(\"Could not determine win32/win64 for installer\") ;;\n     esac\n     AC_SUBST(WINDOWS_BITS)\n\n     dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against.\n     dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override\n     dnl its command here, with the predeps/postdeps removed, and -static inserted. Postdeps are\n     dnl also overridden to prevent their insertion later.\n     dnl This should only affect dll's.\n     archive_cmds_CXX=\"\\$CC -shared \\$libobjs \\$deplibs \\$compiler_flags -static -o \\$output_objdir/\\$soname \\${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \\$lib\"\n     postdeps_CXX=\n\n     ;;\n  *darwin*)\n     TARGET_OS=darwin\n     LEVELDB_TARGET_FLAGS=\"-DOS_MACOSX\"\n     if  test x$cross_compiling != xyes; then\n       BUILD_OS=darwin\n       AC_CHECK_PROG([PORT],port, port)\n       if test x$PORT = xport; then\n         dnl add default macports paths\n         CPPFLAGS=\"$CPPFLAGS -isystem /opt/local/include\"\n         LIBS=\"$LIBS -L/opt/local/lib\"\n         if test -d /opt/local/include/db48; then\n           CPPFLAGS=\"$CPPFLAGS -I/opt/local/include/db48\"\n           LIBS=\"$LIBS -L/opt/local/lib/db48\"\n         fi\n       fi\n\n       AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)\n       AC_CHECK_PROG([BREW],brew, brew)\n       if test x$BREW = xbrew; then\n         dnl These Homebrew packages may be keg-only, meaning that they won't be found\n         dnl in expected paths because they may conflict with system files. Ask\n         dnl Homebrew where each one is located, then adjust paths accordingly.\n         dnl It's safe to add these paths even if the functionality is disabled by\n         dnl the user (--without-wallet or --without-gui for example).\n\n         openssl_prefix=`$BREW --prefix openssl 2>/dev/null`\n         bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null`\n         qt5_prefix=`$BREW --prefix qt5 2>/dev/null`\n         if test x$openssl_prefix != x; then\n           PKG_CONFIG_PATH=\"$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH\"\n           export PKG_CONFIG_PATH\n         fi\n         if test x$bdb_prefix != x; then\n           CPPFLAGS=\"$CPPFLAGS -I$bdb_prefix/include\"\n           LIBS=\"$LIBS -L$bdb_prefix/lib\"\n         fi\n         if test x$qt5_prefix != x; then\n           PKG_CONFIG_PATH=\"$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH\"\n           export PKG_CONFIG_PATH\n         fi\n       fi\n     else\n       case $build_os in\n         *darwin*)\n           BUILD_OS=darwin\n           ;;\n         *)\n           AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool)\n           AC_PATH_TOOL([OTOOL], [otool], otool)\n           AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage)\n           AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)\n           AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert)\n           AC_PATH_PROGS([TIFFCP], [tiffcp],tiffcp)\n\n           dnl libtool will try to strip the static lib, which is a problem for\n           dnl cross-builds because strip attempts to call a hard-coded ld,\n           dnl which may not exist in the path. Stripping the .a is not\n           dnl necessary, so just disable it.\n           old_striplib=\n           ;;\n       esac\n     fi\n\n     AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS=\"$LDFLAGS -Wl,-headerpad_max_install_names\"])\n     CPPFLAGS=\"$CPPFLAGS -DMAC_OSX\"\n     OBJCXXFLAGS=\"$CXXFLAGS\"\n     ;;\n   *linux*)\n     TARGET_OS=linux\n     LEVELDB_TARGET_FLAGS=\"-DOS_LINUX\"\n     ;;\n   *freebsd*)\n     LEVELDB_TARGET_FLAGS=\"-DOS_FREEBSD\"\n     ;;\n   *openbsd*)\n     LEVELDB_TARGET_FLAGS=\"-DOS_OPENBSD\"\n     ;;\n   *netbsd*)\n     LEVELDB_TARGET_FLAGS=\"-DOS_NETBSD\"\n     ;;\n   *)\n     OTHER_OS=`echo ${host_os} | awk '{print toupper($0)}'`\n     AC_MSG_WARN([Guessing LevelDB OS as OS_${OTHER_OS}, please check whether this is correct, if not add an entry to configure.ac.])\n     LEVELDB_TARGET_FLAGS=\"-DOS_${OTHER_OS}\"\n     ;;\nesac\n\nif test x$use_pkgconfig = xyes; then\n  m4_ifndef([PKG_PROG_PKG_CONFIG], [AC_MSG_ERROR(PKG_PROG_PKG_CONFIG macro not found. Please install pkg-config and re-run autogen.sh.)])\n  m4_ifdef([PKG_PROG_PKG_CONFIG], [\n  PKG_PROG_PKG_CONFIG\n  if test x\"$PKG_CONFIG\" = \"x\"; then\n    AC_MSG_ERROR(pkg-config not found.)\n  fi\n  ])\nfi\n\nif test x$use_extended_functional_tests != xno; then\n  AC_SUBST(EXTENDED_FUNCTIONAL_TESTS, --extended)\nfi\n\nif test x$use_lcov = xyes; then\n  if test x$LCOV = x; then\n    AC_MSG_ERROR(\"lcov testing requested but lcov not found\")\n  fi\n  if test x$GCOV = x; then\n    AC_MSG_ERROR(\"lcov testing requested but gcov not found\")\n  fi\n  if test x$PYTHON = x; then\n    AC_MSG_ERROR(\"lcov testing requested but python not found\")\n  fi\n  if test x$GENHTML = x; then\n    AC_MSG_ERROR(\"lcov testing requested but genhtml not found\")\n  fi\n  LCOV=\"$LCOV --gcov-tool=$GCOV\"\n  AX_CHECK_LINK_FLAG([[--coverage]], [LDFLAGS=\"$LDFLAGS --coverage\"],\n    [AC_MSG_ERROR(\"lcov testing requested but --coverage linker flag does not work\")])\n  AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS=\"$CXXFLAGS --coverage\"],\n    [AC_MSG_ERROR(\"lcov testing requested but --coverage flag does not work\")])\n  AC_DEFINE(USE_COVERAGE, 1, [Define this symbol if coverage is enabled])\n  CXXFLAGS=\"$CXXFLAGS -Og\"\nfi\n\nif test x$use_lcov_branch != xno; then\n  AC_SUBST(LCOV_OPTS, \"$LCOV_OPTS --rc lcov_branch_coverage=1\")\nfi\n\ndnl Check for endianness\nAC_C_BIGENDIAN\n\ndnl Check for pthread compile/link requirements\nAX_PTHREAD\n\n# The following macro will add the necessary defines to bitcoin-config.h, but\n# they also need to be passed down to any subprojects. Pull the results out of\n# the cache and add them to CPPFLAGS.\nAC_SYS_LARGEFILE\n# detect POSIX or GNU variant of strerror_r\nAC_FUNC_STRERROR_R\n\nif test x$ac_cv_sys_file_offset_bits != x &&\n   test x$ac_cv_sys_file_offset_bits != xno &&\n   test x$ac_cv_sys_file_offset_bits != xunknown; then\n  CPPFLAGS=\"$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits\"\nfi\n\nif test x$ac_cv_sys_large_files != x &&\n   test x$ac_cv_sys_large_files != xno &&\n   test x$ac_cv_sys_large_files != xunknown; then\n  CPPFLAGS=\"$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files\"\nfi\n\nAX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS=\"$LDFLAGS -Wl,--large-address-aware\"])\n\nAX_GCC_FUNC_ATTRIBUTE([visibility])\nAX_GCC_FUNC_ATTRIBUTE([dllexport])\nAX_GCC_FUNC_ATTRIBUTE([dllimport])\n\nif test x$use_glibc_compat != xno; then\n\n  #glibc absorbed clock_gettime in 2.17. librt (its previous location) is safe to link\n  #in anyway for back-compat.\n  AC_CHECK_LIB([rt],[clock_gettime],, AC_MSG_ERROR(lib missing))\n\n  #__fdelt_chk's params and return type have changed from long unsigned int to long int.\n  # See which one is present here.\n  AC_MSG_CHECKING(__fdelt_chk type)\n  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE\n                    #undef _FORTIFY_SOURCE\n                  #endif\n                  #define _FORTIFY_SOURCE 2\n                  #include <sys/select.h>\n     extern \"C\" long unsigned int __fdelt_warn(long unsigned int);]],[[]])],\n    [ fdelt_type=\"long unsigned int\"],\n    [ fdelt_type=\"long int\"])\n  AC_MSG_RESULT($fdelt_type)\n  AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk])\nelse\n  AC_SEARCH_LIBS([clock_gettime],[rt])\nfi\n\nif test x$TARGET_OS != xwindows; then\n  # All windows code is PIC, forcing it on just adds useless compile warnings\n  AX_CHECK_COMPILE_FLAG([-fPIC],[PIC_FLAGS=\"-fPIC\"])\nfi\n\nif test x$use_hardening != xno; then\n  AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS=\"$HARDENED_CXXFLAGS -Wstack-protector\"])\n  AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS=\"$HARDENED_CXXFLAGS -fstack-protector-all\"])\n\n  AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[\n    AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[\n      HARDENED_CPPFLAGS=\"$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE\"\n    ])\n    HARDENED_CPPFLAGS=\"$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2\"\n  ])\n\n  AX_CHECK_LINK_FLAG([[-Wl,--dynamicbase]], [HARDENED_LDFLAGS=\"$HARDENED_LDFLAGS -Wl,--dynamicbase\"])\n  AX_CHECK_LINK_FLAG([[-Wl,--nxcompat]], [HARDENED_LDFLAGS=\"$HARDENED_LDFLAGS -Wl,--nxcompat\"])\n  AX_CHECK_LINK_FLAG([[-Wl,--high-entropy-va]], [HARDENED_LDFLAGS=\"$HARDENED_LDFLAGS -Wl,--high-entropy-va\"])\n  AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS=\"$HARDENED_LDFLAGS -Wl,-z,relro\"])\n  AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS=\"$HARDENED_LDFLAGS -Wl,-z,now\"])\n\n  if test x$TARGET_OS != xwindows; then\n    AX_CHECK_COMPILE_FLAG([-fPIE],[PIE_FLAGS=\"-fPIE\"])\n    AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS=\"$HARDENED_LDFLAGS -pie\"])\n  fi\n\n  case $host in\n    *mingw*)\n       AC_CHECK_LIB([ssp],      [main],, AC_MSG_ERROR(lib missing))\n    ;;\n  esac\nfi\n\ndnl this flag screws up non-darwin gcc even when the check fails. special-case it.\nif test x$TARGET_OS = xdarwin; then\n  AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS=\"$LDFLAGS -Wl,-dead_strip\"])\nfi\n\nAC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h])\n\nAC_CHECK_DECLS([strnlen])\n\n# Check for daemon(3), unrelated to --with-daemon (although used by it)\nAC_CHECK_DECLS([daemon])\n\nAC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,\n\t\t[#if HAVE_ENDIAN_H\n                 #include <endian.h>\n                 #elif HAVE_SYS_ENDIAN_H\n                 #include <sys/endian.h>\n                 #endif])\n\nAC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,,\n\t\t[#if HAVE_BYTESWAP_H\n                 #include <byteswap.h>\n                 #endif])\n\nAC_CHECK_DECLS([__builtin_clz, __builtin_clzl, __builtin_clzll])\n\ndnl Check for MSG_NOSIGNAL\nAC_MSG_CHECKING(for MSG_NOSIGNAL)\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],\n [[ int f = MSG_NOSIGNAL; ]])],\n [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,[Define this symbol if you have MSG_NOSIGNAL]) ],\n [ AC_MSG_RESULT(no)]\n)\n\ndnl Check for MSG_DONTWAIT\nAC_MSG_CHECKING(for MSG_DONTWAIT)\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],\n [[ int f = MSG_DONTWAIT; ]])],\n [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_DONTWAIT, 1,[Define this symbol if you have MSG_DONTWAIT]) ],\n [ AC_MSG_RESULT(no)]\n)\n\ndnl Check for malloc_info (for memory statistics information in getmemoryinfo)\nAC_MSG_CHECKING(for getmemoryinfo)\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],\n [[ int f = malloc_info(0, NULL); ]])],\n [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MALLOC_INFO, 1,[Define this symbol if you have malloc_info]) ],\n [ AC_MSG_RESULT(no)]\n)\n\ndnl Check for mallopt(M_ARENA_MAX) (to set glibc arenas)\nAC_MSG_CHECKING(for mallopt M_ARENA_MAX)\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],\n [[ mallopt(M_ARENA_MAX, 1); ]])],\n [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MALLOPT_ARENA_MAX, 1,[Define this symbol if you have mallopt with M_ARENA_MAX]) ],\n [ AC_MSG_RESULT(no)]\n)\n\nAC_MSG_CHECKING([for visibility attribute])\nAC_LINK_IFELSE([AC_LANG_SOURCE([\n  int foo_def( void ) __attribute__((visibility(\"default\")));\n  int main(){}\n  ])],\n  [\n    AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE,1,[Define if the visibility attribute is supported.])\n    AC_MSG_RESULT(yes)\n  ],\n  [\n    AC_MSG_RESULT(no)\n    if test x$use_reduce_exports = xyes; then\n      AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.])\n    fi\n  ]\n)\n\nTEMP_LDFLAGS=\"$LDFLAGS\"\nLDFLAGS=\"$TEMP_LDFLAGS $PTHREAD_CFLAGS\"\nAC_MSG_CHECKING([for thread_local support])\nAC_LINK_IFELSE([AC_LANG_SOURCE([\n  #include <thread>\n  static thread_local int foo = 0;\n  static void run_thread() { foo++;}\n  int main(){\n  for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();}\n  return foo;\n  }\n  ])],\n  [\n    AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.])\n    AC_MSG_RESULT(yes)\n  ],\n  [\n    AC_MSG_RESULT(no)\n  ]\n)\nLDFLAGS=\"$TEMP_LDFLAGS\"\n\n# Check for different ways of gathering OS randomness\nAC_MSG_CHECKING(for Linux getrandom syscall)\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>\n  #include <sys/syscall.h>\n  #include <linux/random.h>]],\n [[ syscall(SYS_getrandom, nullptr, 32, 0); ]])],\n [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_GETRANDOM, 1,[Define this symbol if the Linux getrandom system call is available]) ],\n [ AC_MSG_RESULT(no)]\n)\n\nAC_MSG_CHECKING(for getentropy)\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],\n [[ getentropy(nullptr, 32) ]])],\n [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_GETENTROPY, 1,[Define this symbol if the BSD getentropy system call is available]) ],\n [ AC_MSG_RESULT(no)]\n)\n\nAC_MSG_CHECKING(for getentropy via random.h)\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>\n #include <sys/random.h>]],\n [[ getentropy(nullptr, 32) ]])],\n [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_GETENTROPY_RAND, 1,[Define this symbol if the BSD getentropy system call is available with sys/random.h]) ],\n [ AC_MSG_RESULT(no)]\n)\n\nAC_MSG_CHECKING(for sysctl KERN_ARND)\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>\n  #include <sys/sysctl.h>]],\n [[ static const int name[2] = {CTL_KERN, KERN_ARND};\n    sysctl(name, 2, nullptr, nullptr, nullptr, 0); ]])],\n [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL_ARND, 1,[Define this symbol if the BSD sysctl(KERN_ARND) is available]) ],\n [ AC_MSG_RESULT(no)]\n)\n\n# Check for reduced exports\nif test x$use_reduce_exports = xyes; then\n  AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS=\"-fvisibility=hidden\"],\n  [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])\nfi\n\nLEVELDB_CPPFLAGS=\nLIBLEVELDB=\nLIBMEMENV=\nAM_CONDITIONAL([EMBEDDED_LEVELDB],[true])\nAC_SUBST(LEVELDB_CPPFLAGS)\nAC_SUBST(LIBLEVELDB)\nAC_SUBST(LIBMEMENV)\n\nif test x$enable_wallet != xno; then\n    dnl Check for libdb_cxx only if wallet enabled\n    BITCOIN_FIND_BDB48\nfi\n\ndnl Check for libminiupnpc (optional)\nif test x$use_upnp != xno; then\n  AC_CHECK_HEADERS(\n    [miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],\n    [AC_CHECK_LIB([miniupnpc], [main],[MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])],\n    [have_miniupnpc=no]\n  )\nfi\n\nBITCOIN_QT_INIT\n\ndnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus\nBITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt5])\n\nif test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononono; then\n    use_boost=no\nelse\n    use_boost=yes\nfi\n\nif test x$use_boost = xyes; then\n\ndnl Minimum required Boost version\ndefine(MINIMUM_REQUIRED_BOOST, 1.47.0)\n\ndnl Check for boost libs\nAX_BOOST_BASE([MINIMUM_REQUIRED_BOOST])\nif test x$want_boost = xno; then\n    AC_MSG_ERROR([[only libbitcoinconsensus can be built without boost]])\nfi\nAX_BOOST_SYSTEM\nAX_BOOST_FILESYSTEM\nAX_BOOST_PROGRAM_OPTIONS\nAX_BOOST_THREAD\nAX_BOOST_CHRONO\n\ndnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic\ndnl counter implementations. In 1.63 and later the std::atomic approach is default.\nm4_pattern_allow(DBOOST_AC_USE_STD_ATOMIC) dnl otherwise it's treated like a macro\nBOOST_CPPFLAGS=\"-DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC $BOOST_CPPFLAGS\"\n\nif test x$use_reduce_exports = xyes; then\n  AC_MSG_CHECKING([for working boost reduced exports])\n  TEMP_CPPFLAGS=\"$CPPFLAGS\"\n  CPPFLAGS=\"$BOOST_CPPFLAGS $CPPFLAGS\"\n  AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[\n      @%:@include <boost/version.hpp>\n    ]], [[\n      #if BOOST_VERSION >= 104900\n      // Everything is okay\n      #else\n      #  error Boost version is too old\n      #endif\n    ]])],[\n      AC_MSG_RESULT(yes)\n    ],[\n    AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.])\n  ])\n  CPPFLAGS=\"$TEMP_CPPFLAGS\"\nfi\nfi\n\nif test x$use_reduce_exports = xyes; then\n    CXXFLAGS=\"$CXXFLAGS $RE_CXXFLAGS\"\n    AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS=\"-Wl,--exclude-libs,ALL\"])\nfi\n\nif test x$use_tests = xyes; then\n\n  if test x$HEXDUMP = x; then\n    AC_MSG_ERROR(hexdump is required for tests)\n  fi\n\n\n  if test x$use_boost = xyes; then\n\n  AX_BOOST_UNIT_TEST_FRAMEWORK\n\n  dnl Determine if -DBOOST_TEST_DYN_LINK is needed\n  AC_MSG_CHECKING([for dynamic linked boost test])\n  TEMP_LIBS=\"$LIBS\"\n  LIBS=\"$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB\"\n  TEMP_CPPFLAGS=\"$CPPFLAGS\"\n  CPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\n  AC_LINK_IFELSE([AC_LANG_SOURCE([\n       #define BOOST_TEST_DYN_LINK\n       #define BOOST_TEST_MAIN\n        #include <boost/test/unit_test.hpp>\n\n       ])],\n    [AC_MSG_RESULT(yes)]\n    [TESTDEFS=\"$TESTDEFS -DBOOST_TEST_DYN_LINK\"],\n    [AC_MSG_RESULT(no)])\n  LIBS=\"$TEMP_LIBS\"\n  CPPFLAGS=\"$TEMP_CPPFLAGS\"\n\n  fi\nfi\n\nif test x$use_boost = xyes; then\n\nBOOST_LIBS=\"$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB\"\n\n\ndnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums\ndnl using c++98 constructs. Unfortunately, this implementation detail leaked into\ndnl the abi. This was fixed in 1.57.\n\ndnl When building against that installed version using c++11, the headers pick up\ndnl on the native c++11 scoped enum support and enable it, however it will fail to\ndnl link. This can be worked around by disabling c++11 scoped enums if linking will\ndnl fail.\ndnl BOOST_NO_SCOPED_ENUMS was changed to BOOST_NO_CXX11_SCOPED_ENUMS in 1.51.\n\nTEMP_LIBS=\"$LIBS\"\nLIBS=\"$BOOST_LIBS $LIBS\"\nTEMP_CPPFLAGS=\"$CPPFLAGS\"\nCPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\nAC_MSG_CHECKING([for mismatched boost c++11 scoped enums])\nAC_LINK_IFELSE([AC_LANG_PROGRAM([[\n  #include <boost/config.hpp>\n  #include <boost/version.hpp>\n  #if !defined(BOOST_NO_SCOPED_ENUMS) && !defined(BOOST_NO_CXX11_SCOPED_ENUMS) && BOOST_VERSION < 105700\n  #define BOOST_NO_SCOPED_ENUMS\n  #define BOOST_NO_CXX11_SCOPED_ENUMS\n  #define CHECK\n  #endif\n  #include <boost/filesystem.hpp>\n  ]],[[\n  #if defined(CHECK)\n    boost::filesystem::copy_file(\"foo\", \"bar\");\n  #else\n    choke;\n  #endif\n  ]])],\n  [AC_MSG_RESULT(mismatched); BOOST_CPPFLAGS=\"$BOOST_CPPFLAGS -DBOOST_NO_SCOPED_ENUMS -DBOOST_NO_CXX11_SCOPED_ENUMS\"], [AC_MSG_RESULT(ok)])\nLIBS=\"$TEMP_LIBS\"\nCPPFLAGS=\"$TEMP_CPPFLAGS\"\n\ndnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however\ndnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if\ndnl a working version is available, else fall back to sleep. sleep was removed\ndnl after 1.56.\ndnl If neither is available, abort.\nTEMP_LIBS=\"$LIBS\"\nLIBS=\"$BOOST_LIBS $LIBS\"\nTEMP_CPPFLAGS=\"$CPPFLAGS\"\nCPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\nAC_LINK_IFELSE([AC_LANG_PROGRAM([[\n  #include <boost/thread/thread.hpp>\n  #include <boost/version.hpp>\n  ]],[[\n  #if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200)\n      boost::this_thread::sleep_for(boost::chrono::milliseconds(0));\n  #else\n   choke me\n  #endif\n  ]])],\n  [boost_sleep=yes;\n     AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])],\n  [boost_sleep=no])\nLIBS=\"$TEMP_LIBS\"\nCPPFLAGS=\"$TEMP_CPPFLAGS\"\n\nif test x$boost_sleep != xyes; then\nTEMP_LIBS=\"$LIBS\"\nLIBS=\"$BOOST_LIBS $LIBS\"\nTEMP_CPPFLAGS=\"$CPPFLAGS\"\nCPPFLAGS=\"$CPPFLAGS $BOOST_CPPFLAGS\"\nAC_LINK_IFELSE([AC_LANG_PROGRAM([[\n  #include <boost/version.hpp>\n  #include <boost/thread.hpp>\n  #include <boost/date_time/posix_time/posix_time_types.hpp>\n  ]],[[\n  #if BOOST_VERSION <= 105600\n      boost::this_thread::sleep(boost::posix_time::milliseconds(0));\n  #else\n   choke me\n  #endif\n  ]])],\n  [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])],\n  [boost_sleep=no])\nLIBS=\"$TEMP_LIBS\"\nCPPFLAGS=\"$TEMP_CPPFLAGS\"\nfi\n\nif test x$boost_sleep != xyes; then\n  AC_MSG_ERROR(No working boost sleep implementation found.)\nfi\n\nfi\n\nif test x$use_pkgconfig = xyes; then\n  : dnl\n  m4_ifdef(\n    [PKG_CHECK_MODULES],\n    [\n      PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl  not found.)])\n      PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto  not found.)])\n      BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])])\n      if test x$use_qr != xno; then\n        BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])\n      fi\n      if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then\n        PKG_CHECK_MODULES([EVENT], [libevent],, [AC_MSG_ERROR(libevent not found.)])\n        if test x$TARGET_OS != xwindows; then\n          PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads],, [AC_MSG_ERROR(libevent_pthreads not found.)])\n        fi\n      fi\n\n      if test \"x$use_zmq\" = \"xyes\"; then\n        PKG_CHECK_MODULES([ZMQ],[libzmq >= 4],\n          [AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])],\n          [AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])\n           AC_MSG_WARN([libzmq version 4.x or greater not found, disabling])\n           use_zmq=no])\n      else\n          AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])\n      fi\n    ]\n  )\nelse\n  AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))\n  AC_CHECK_LIB([crypto],      [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))\n\n  AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)\n  AC_CHECK_LIB([ssl],         [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing))\n\n  if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests != xnononono; then\n    AC_CHECK_HEADER([event2/event.h],, AC_MSG_ERROR(libevent headers missing),)\n    AC_CHECK_LIB([event],[main],EVENT_LIBS=-levent,AC_MSG_ERROR(libevent missing))\n    if test x$TARGET_OS != xwindows; then\n      AC_CHECK_LIB([event_pthreads],[main],EVENT_PTHREADS_LIBS=-levent_pthreads,AC_MSG_ERROR(libevent_pthreads missing))\n    fi\n  fi\n\n  if test \"x$use_zmq\" = \"xyes\"; then\n     AC_CHECK_HEADER([zmq.h],\n       [AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])],\n       [AC_MSG_WARN([zmq.h not found, disabling zmq support])\n        use_zmq=no\n        AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])])\n     AC_CHECK_LIB([zmq],[zmq_ctx_shutdown],ZMQ_LIBS=-lzmq,\n       [AC_MSG_WARN([libzmq >= 4.0 not found, disabling zmq support])\n        use_zmq=no\n        AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])])\n  else\n    AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])\n  fi\n\n  if test \"x$use_zmq\" = \"xyes\"; then\n    dnl Assume libzmq was built for static linking\n    case $host in\n      *mingw*)\n        ZMQ_CFLAGS=\"$ZMQ_CFLAGS -DZMQ_STATIC\"\n      ;;\n    esac\n  fi\n\n  BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found)))\n  if test x$use_qr != xno; then\n    BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])])\n    BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)])\n  fi\nfi\n\nsave_CXXFLAGS=\"${CXXFLAGS}\"\nCXXFLAGS=\"${CXXFLAGS} ${CRYPTO_CFLAGS} ${SSL_CFLAGS}\"\nAC_CHECK_DECLS([EVP_MD_CTX_new],,,[AC_INCLUDES_DEFAULT\n#include <openssl/x509_vfy.h>\n])\nCXXFLAGS=\"${save_CXXFLAGS}\"\n\ndnl univalue check\n\nneed_bundled_univalue=yes\n\nif test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench = xnonononono; then\n  need_bundled_univalue=no\nelse\n\nif test x$system_univalue != xno ; then\n  found_univalue=no\n  if test x$use_pkgconfig = xyes; then\n    : #NOP\n    m4_ifdef(\n      [PKG_CHECK_MODULES],\n      [\n        PKG_CHECK_MODULES([UNIVALUE],[libunivalue],[found_univalue=yes],[true])\n      ]\n    )\n  else\n    AC_CHECK_HEADER([univalue.h],[\n      AC_CHECK_LIB([univalue],  [main],[\n        UNIVALUE_LIBS=-lunivalue\n        found_univalue=yes\n      ],[true])\n    ],[true])\n  fi\n\n  if test x$found_univalue = xyes ; then\n    system_univalue=yes\n    need_bundled_univalue=no\n  elif test x$system_univalue = xyes ; then\n    AC_MSG_ERROR([univalue not found])\n  else\n    system_univalue=no\n  fi\nfi\n\nif test x$need_bundled_univalue = xyes ; then\n  UNIVALUE_CFLAGS='-I$(srcdir)/univalue/include'\n  UNIVALUE_LIBS='univalue/libunivalue.la'\nfi\n\nfi\n\nAM_CONDITIONAL([EMBEDDED_UNIVALUE],[test x$need_bundled_univalue = xyes])\nAC_SUBST(UNIVALUE_CFLAGS)\nAC_SUBST(UNIVALUE_LIBS)\n\nBITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path)\n\nAC_MSG_CHECKING([whether to build sugarchaind])\nAM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])\nAC_MSG_RESULT($build_bitcoind)\n\nAC_MSG_CHECKING([whether to build utils (sugarchain-cli sugarchain-tx)])\nAM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])\nAC_MSG_RESULT($build_bitcoin_utils)\n\nAC_MSG_CHECKING([whether to build libraries])\nAM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])\nif test x$build_bitcoin_libs = xyes; then\n  AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built])\n  AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in])\nfi\nAC_MSG_RESULT($build_bitcoin_libs)\n\nAC_LANG_POP\n\nif test \"x$use_ccache\" != \"xno\"; then\n  AC_MSG_CHECKING(if ccache should be used)\n  if test x$CCACHE = x; then\n    if test \"x$use_ccache\" = \"xyes\"; then\n      AC_MSG_ERROR([ccache not found.]);\n    else\n      use_ccache=no\n    fi\n  else\n    use_ccache=yes\n    CC=\"$ac_cv_path_CCACHE $CC\"\n    CXX=\"$ac_cv_path_CCACHE $CXX\"\n  fi\n  AC_MSG_RESULT($use_ccache)\nfi\nif test \"x$use_ccache\" = \"xyes\"; then\n    AX_CHECK_PREPROC_FLAG([-Qunused-arguments],[CPPFLAGS=\"-Qunused-arguments $CPPFLAGS\"])\nfi\n\ndnl enable wallet\nAC_MSG_CHECKING([if wallet should be enabled])\nif test x$enable_wallet != xno; then\n  AC_MSG_RESULT(yes)\n  AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions])\n\nelse\n  AC_MSG_RESULT(no)\nfi\n\ndnl enable upnp support\nAC_MSG_CHECKING([whether to build with support for UPnP])\nif test x$have_miniupnpc = xno; then\n  if test x$use_upnp = xyes; then\n     AC_MSG_ERROR(\"UPnP requested but cannot be built. use --without-miniupnpc\")\n  fi\n  AC_MSG_RESULT(no)\nelse\n  if test x$use_upnp != xno; then\n    AC_MSG_RESULT(yes)\n    AC_MSG_CHECKING([whether to build with UPnP enabled by default])\n    use_upnp=yes\n    upnp_setting=0\n    if test x$use_upnp_default != xno; then\n      use_upnp_default=yes\n      upnp_setting=1\n    fi\n    AC_MSG_RESULT($use_upnp_default)\n    AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state])\n    if test x$TARGET_OS = xwindows; then\n      MINIUPNPC_CPPFLAGS=\"-DSTATICLIB -DMINIUPNP_STATICLIB\"\n    fi\n  else\n    AC_MSG_RESULT(no)\n  fi\nfi\n\ndnl these are only used when qt is enabled\nBUILD_TEST_QT=\"\"\nif test x$bitcoin_enable_qt != xno; then\n  dnl enable dbus support\n  AC_MSG_CHECKING([whether to build GUI with support for D-Bus])\n  if test x$bitcoin_enable_qt_dbus != xno; then\n    AC_DEFINE([USE_DBUS],[1],[Define if dbus support should be compiled in])\n  fi\n  AC_MSG_RESULT($bitcoin_enable_qt_dbus)\n\n  dnl enable qr support\n  AC_MSG_CHECKING([whether to build GUI with support for QR codes])\n  if test x$have_qrencode = xno; then\n    if test x$use_qr = xyes; then\n     AC_MSG_ERROR(\"QR support requested but cannot be built. use --without-qrencode\")\n    fi\n    AC_MSG_RESULT(no)\n  else\n    if test x$use_qr != xno; then\n      AC_MSG_RESULT(yes)\n      AC_DEFINE([USE_QRCODE],[1],[Define if QR support should be compiled in])\n      use_qr=yes\n    else\n      AC_MSG_RESULT(no)\n    fi\n  fi\n\n  if test x$XGETTEXT = x; then\n    AC_MSG_WARN(\"xgettext is required to update qt translations\")\n  fi\n\n  AC_MSG_CHECKING([whether to build test_sugarchain-qt])\n  if test x$use_gui_tests$bitcoin_enable_qt_test = xyesyes; then\n    AC_MSG_RESULT([yes])\n    BUILD_TEST_QT=\"yes\"\n  else\n    AC_MSG_RESULT([no])\n  fi\nfi\n\nAM_CONDITIONAL([ENABLE_ZMQ], [test \"x$use_zmq\" = \"xyes\"])\n\nAC_MSG_CHECKING([whether to build test_sugarchain])\nif test x$use_tests = xyes; then\n  AC_MSG_RESULT([yes])\n  BUILD_TEST=\"yes\"\nelse\n  AC_MSG_RESULT([no])\n  BUILD_TEST=\"\"\nfi\n\nAC_MSG_CHECKING([whether to reduce exports])\nif test x$use_reduce_exports = xyes; then\n  AC_MSG_RESULT([yes])\nelse\n  AC_MSG_RESULT([no])\nfi\n\nif test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_bench$use_tests = xnononononono; then\n  AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-bench or --enable-tests])\nfi\n\nAM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])\nAM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])\nAM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])\nAM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])\nAM_CONDITIONAL([ENABLE_TESTS],[test x$BUILD_TEST = xyes])\nAM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])\nAM_CONDITIONAL([ENABLE_QT_TESTS],[test x$BUILD_TEST_QT = xyes])\nAM_CONDITIONAL([ENABLE_BENCH],[test x$use_bench = xyes])\nAM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])\nAM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])\nAM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])\nAM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])\nAM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])\nAM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes])\n\nAC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])\nAC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])\nAC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision])\nAC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build])\nAC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release])\nAC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Copyright year])\nAC_DEFINE(COPYRIGHT_HOLDERS, \"_COPYRIGHT_HOLDERS\", [Copyright holder(s) before %s replacement])\nAC_DEFINE(COPYRIGHT_HOLDERS_SUBSTITUTION, \"_COPYRIGHT_HOLDERS_SUBSTITUTION\", [Replacement for %s in copyright holders string])\ndefine(_COPYRIGHT_HOLDERS_FINAL, [patsubst(_COPYRIGHT_HOLDERS, [%s], [_COPYRIGHT_HOLDERS_SUBSTITUTION])])\nAC_DEFINE(COPYRIGHT_HOLDERS_FINAL, \"_COPYRIGHT_HOLDERS_FINAL\", [Copyright holder(s)])\nAC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR)\nAC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR)\nAC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION)\nAC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD)\nAC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE)\nAC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)\nAC_SUBST(COPYRIGHT_HOLDERS, \"_COPYRIGHT_HOLDERS\")\nAC_SUBST(COPYRIGHT_HOLDERS_SUBSTITUTION, \"_COPYRIGHT_HOLDERS_SUBSTITUTION\")\nAC_SUBST(COPYRIGHT_HOLDERS_FINAL, \"_COPYRIGHT_HOLDERS_FINAL\")\nAC_SUBST(BITCOIN_DAEMON_NAME)\nAC_SUBST(BITCOIN_GUI_NAME)\nAC_SUBST(BITCOIN_CLI_NAME)\nAC_SUBST(BITCOIN_TX_NAME)\n\nAC_SUBST(RELDFLAGS)\nAC_SUBST(ERROR_CXXFLAGS)\nAC_SUBST(HARDENED_CXXFLAGS)\nAC_SUBST(HARDENED_CPPFLAGS)\nAC_SUBST(HARDENED_LDFLAGS)\nAC_SUBST(PIC_FLAGS)\nAC_SUBST(PIE_FLAGS)\nAC_SUBST(SSE42_CXXFLAGS)\nAC_SUBST(LIBTOOL_APP_LDFLAGS)\nAC_SUBST(USE_UPNP)\nAC_SUBST(USE_QRCODE)\nAC_SUBST(BOOST_LIBS)\nAC_SUBST(TESTDEFS)\nAC_SUBST(LEVELDB_TARGET_FLAGS)\nAC_SUBST(MINIUPNPC_CPPFLAGS)\nAC_SUBST(MINIUPNPC_LIBS)\nAC_SUBST(CRYPTO_LIBS)\nAC_SUBST(SSL_LIBS)\nAC_SUBST(EVENT_LIBS)\nAC_SUBST(EVENT_PTHREADS_LIBS)\nAC_SUBST(ZMQ_LIBS)\nAC_SUBST(PROTOBUF_LIBS)\nAC_SUBST(QR_LIBS)\nAC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])\nAC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])\nAC_CONFIG_FILES([doc/Doxyfile])\nAC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])\nAC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])\nAC_CONFIG_LINKS([test/util/bitcoin-util-test.py:test/util/bitcoin-util-test.py])\n\ndnl boost's m4 checks do something really nasty: they export these vars. As a\ndnl result, they leak into secp256k1's configure and crazy things happen.\ndnl Until this is fixed upstream and we've synced, we'll just un-export them.\nCPPFLAGS_TEMP=\"$CPPFLAGS\"\nunset CPPFLAGS\nCPPFLAGS=\"$CPPFLAGS_TEMP\"\n\nLDFLAGS_TEMP=\"$LDFLAGS\"\nunset LDFLAGS\nLDFLAGS=\"$LDFLAGS_TEMP\"\n\nLIBS_TEMP=\"$LIBS\"\nunset LIBS\nLIBS=\"$LIBS_TEMP\"\n\nPKGCONFIG_PATH_TEMP=\"$PKG_CONFIG_PATH\"\nunset PKG_CONFIG_PATH\nPKG_CONFIG_PATH=\"$PKGCONFIG_PATH_TEMP\"\n\nPKGCONFIG_LIBDIR_TEMP=\"$PKG_CONFIG_LIBDIR\"\nunset PKG_CONFIG_LIBDIR\nPKG_CONFIG_LIBDIR=\"$PKGCONFIG_LIBDIR_TEMP\"\n\nif test x$need_bundled_univalue = xyes; then\n  AC_CONFIG_SUBDIRS([src/univalue])\nfi\n\nac_configure_args=\"${ac_configure_args} --disable-shared --with-pic --with-bignum=no --enable-module-recovery --disable-jni\"\nAC_CONFIG_SUBDIRS([src/secp256k1])\n\nAC_OUTPUT\n\ndnl Taken from https://wiki.debian.org/RpathIssue\ncase $host in\n   *-*-linux-gnu)\n     AC_MSG_RESULT([Fixing libtool for -rpath problems.])\n     sed < libtool > libtool-2 \\\n     's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=\" -D__LIBTOOL_IS_A_FOOL__ \"/'\n     mv libtool-2 libtool\n     chmod 755 libtool\n   ;;\nesac\n\ndnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows\ncase ${OS} in\n   *Windows*)\n     sed  's/BUILDDIR=\"\\/\\([[a-z]]\\)/BUILDDIR=\"\\1:/'  test/config.ini > test/config-2.ini\n     mv test/config-2.ini test/config.ini\n   ;;\nesac\n\necho\necho \"Options used to compile and link:\"\necho \"  with wallet   = $enable_wallet\"\necho \"  with gui / qt = $bitcoin_enable_qt\"\nif test x$bitcoin_enable_qt != xno; then\n    echo \"    qt version  = $bitcoin_qt_got_major_vers\"\n    echo \"    with qr     = $use_qr\"\nfi\necho \"  with zmq      = $use_zmq\"\necho \"  with test     = $use_tests\"\necho \"  with bench    = $use_bench\"\necho \"  with upnp     = $use_upnp\"\necho \"  use asm       = $use_asm\"\necho \"  debug enabled = $enable_debug\"\necho \"  werror        = $enable_werror\"\necho\necho \"  target os     = $TARGET_OS\"\necho \"  build os      = $BUILD_OS\"\necho\necho \"  CC            = $CC\"\necho \"  CFLAGS        = $CFLAGS\"\necho \"  CPPFLAGS      = $CPPFLAGS\"\necho \"  CXX           = $CXX\"\necho \"  CXXFLAGS      = $CXXFLAGS\"\necho \"  LDFLAGS       = $LDFLAGS\"\necho \"  ARFLAGS       = $ARFLAGS\"\necho\n"
  },
  {
    "path": "contrib/README.md",
    "content": "Repository Tools\n---------------------\n\n### [Developer tools](/contrib/devtools) ###\nSpecific tools for developers working on this repository.\nContains the script `github-merge.py` for merging GitHub pull requests securely and signing them using GPG.\n\n### [Verify-Commits](/contrib/verify-commits) ###\nTool to verify that every merge commit was signed by a developer using the above `github-merge.py` script.\n\n### [Linearize](/contrib/linearize) ###\nConstruct a linear, no-fork, best version of the blockchain.\n\n### [Qos](/contrib/qos) ###\n\nA Linux bash script that will set up traffic control (tc) to limit the outgoing bandwidth for connections to the Bitcoin network. 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.\n\n### [Seeds](/contrib/seeds) ###\nUtility to generate the pnSeed[] array that is compiled into the client.\n\nBuild Tools and Keys\n---------------------\n\n### [Debian](/contrib/debian) ###\nContains files used to package bitcoind/bitcoin-qt\nfor Debian-based Linux systems. If you compile bitcoind/bitcoin-qt yourself, there are some useful files here.\n\n### [Gitian-descriptors](/contrib/gitian-descriptors) ###\nFiles used during the gitian build process. For more information about gitian, see the [the Bitcoin Core documentation repository](https://github.com/bitcoin-core/docs).\n\n### [Gitian-keys](/contrib/gitian-keys)\nPGP keys used for signing Bitcoin Core [Gitian release](/doc/release-process.md) results.\n\n### [MacDeploy](/contrib/macdeploy) ###\nScripts and notes for Mac builds. \n\n### [RPM](/contrib/rpm) ###\nRPM spec file for building bitcoin-core on RPM based distributions.\n\n### [Gitian-build](/contrib/gitian-build.sh) ###\nScript for running full Gitian builds.\n\nTest and Verify Tools \n---------------------\n\n### [TestGen](/contrib/testgen) ###\nUtilities to generate test vectors for the data-driven Bitcoin tests.\n\n### [Verify Binaries](/contrib/verifybinaries) ###\nThis script attempts to download and verify the signature file SHA256SUMS.asc from bitcoin.org.\n"
  },
  {
    "path": "contrib/bitcoin-cli.bash-completion",
    "content": "# bash programmable completion for bitcoin-cli(1)\n# Copyright (c) 2012-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n# call $bitcoin-cli for RPC\n_bitcoin_rpc() {\n    # determine already specified args necessary for RPC\n    local rpcargs=()\n    for i in ${COMP_LINE}; do\n        case \"$i\" in\n            -conf=*|-datadir=*|-regtest|-rpc*|-testnet)\n                rpcargs=( \"${rpcargs[@]}\" \"$i\" )\n                ;;\n        esac\n    done\n    $bitcoin_cli \"${rpcargs[@]}\" \"$@\"\n}\n\n# Add wallet accounts to COMPREPLY\n_bitcoin_accounts() {\n    local accounts\n    accounts=$(_bitcoin_rpc listaccounts | awk -F '\"' '{ print $2 }')\n    COMPREPLY=( \"${COMPREPLY[@]}\" $( compgen -W \"$accounts\" -- \"$cur\" ) )\n}\n\n_bitcoin_cli() {\n    local cur prev words=() cword\n    local bitcoin_cli\n\n    # save and use original argument to invoke bitcoin-cli for -help, help and RPC\n    # as bitcoin-cli might not be in $PATH\n    bitcoin_cli=\"$1\"\n\n    COMPREPLY=()\n    _get_comp_words_by_ref -n = cur prev words cword\n\n    if ((cword > 5)); then\n        case ${words[cword-5]} in\n            sendtoaddress)\n                COMPREPLY=( $( compgen -W \"true false\" -- \"$cur\" ) )\n                return 0\n                ;;\n        esac\n    fi\n\n    if ((cword > 4)); then\n        case ${words[cword-4]} in\n            importaddress|listtransactions|setban)\n                COMPREPLY=( $( compgen -W \"true false\" -- \"$cur\" ) )\n                return 0\n                ;;\n            signrawtransaction)\n                COMPREPLY=( $( compgen -W \"ALL NONE SINGLE ALL|ANYONECANPAY NONE|ANYONECANPAY SINGLE|ANYONECANPAY\" -- \"$cur\" ) )\n                return 0\n                ;;\n        esac\n    fi\n\n    if ((cword > 3)); then\n        case ${words[cword-3]} in\n            addmultisigaddress)\n                _bitcoin_accounts\n                return 0\n                ;;\n            getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaccount|listreceivedbyaddress|listsinceblock)\n                COMPREPLY=( $( compgen -W \"true false\" -- \"$cur\" ) )\n                return 0\n                ;;\n        esac\n    fi\n\n    if ((cword > 2)); then\n        case ${words[cword-2]} in\n            addnode)\n                COMPREPLY=( $( compgen -W \"add remove onetry\" -- \"$cur\" ) )\n                return 0\n                ;;\n            setban)\n                COMPREPLY=( $( compgen -W \"add remove\" -- \"$cur\" ) )\n                return 0\n                ;;\n            fundrawtransaction|getblock|getblockheader|getmempoolancestors|getmempooldescendants|getrawtransaction|gettransaction|listaccounts|listreceivedbyaccount|listreceivedbyaddress|sendrawtransaction)\n                COMPREPLY=( $( compgen -W \"true false\" -- \"$cur\" ) )\n                return 0\n                ;;\n            move|setaccount)\n                _bitcoin_accounts\n                return 0\n                ;;\n        esac\n    fi\n\n    case \"$prev\" in\n        backupwallet|dumpwallet|importwallet)\n            _filedir\n            return 0\n            ;;\n        getaddednodeinfo|getrawmempool|lockunspent|setgenerate)\n            COMPREPLY=( $( compgen -W \"true false\" -- \"$cur\" ) )\n            return 0\n            ;;\n        getaccountaddress|getaddressesbyaccount|getbalance|getnewaddress|getreceivedbyaccount|listtransactions|move|sendfrom|sendmany)\n            _bitcoin_accounts\n            return 0\n            ;;\n    esac\n\n    case \"$cur\" in\n        -conf=*)\n            cur=\"${cur#*=}\"\n            _filedir\n            return 0\n            ;;\n        -datadir=*)\n            cur=\"${cur#*=}\"\n            _filedir -d\n            return 0\n            ;;\n        -*=*)\t# prevent nonsense completions\n            return 0\n            ;;\n        *)\n            local helpopts commands\n\n            # only parse -help if senseful\n            if [[ -z \"$cur\" || \"$cur\" =~ ^- ]]; then\n                helpopts=$($bitcoin_cli -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, \"=\"); print $1 }' )\n            fi\n\n            # only parse help if senseful\n            if [[ -z \"$cur\" || \"$cur\" =~ ^[a-z] ]]; then\n                commands=$(_bitcoin_rpc help 2>/dev/null | awk '$1 ~ /^[a-z]/ { print $1; }')\n            fi\n\n            COMPREPLY=( $( compgen -W \"$helpopts $commands\" -- \"$cur\" ) )\n\n            # Prevent space if an argument is desired\n            if [[ $COMPREPLY == *= ]]; then\n                compopt -o nospace\n            fi\n            return 0\n            ;;\n    esac\n} &&\ncomplete -F _bitcoin_cli bitcoin-cli\n\n# Local variables:\n# mode: shell-script\n# sh-basic-offset: 4\n# sh-indent-comment: t\n# indent-tabs-mode: nil\n# End:\n# ex: ts=4 sw=4 et filetype=sh\n"
  },
  {
    "path": "contrib/bitcoin-qt.pro",
    "content": "FORMS += \\\n    ../src/qt/forms/aboutdialog.ui \\\n    ../src/qt/forms/addressbookpage.ui \\\n    ../src/qt/forms/askpassphrasedialog.ui \\\n    ../src/qt/forms/coincontroldialog.ui \\\n    ../src/qt/forms/editaddressdialog.ui \\\n    ../src/qt/forms/helpmessagedialog.ui \\\n    ../src/qt/forms/intro.ui \\\n    ../src/qt/forms/openuridialog.ui \\\n    ../src/qt/forms/optionsdialog.ui \\\n    ../src/qt/forms/overviewpage.ui \\\n    ../src/qt/forms/receivecoinsdialog.ui \\\n    ../src/qt/forms/receiverequestdialog.ui \\\n    ../src/qt/forms/debugwindow.ui \\\n    ../src/qt/forms/sendcoinsdialog.ui \\\n    ../src/qt/forms/sendcoinsentry.ui \\\n    ../src/qt/forms/signverifymessagedialog.ui \\\n    ../src/qt/forms/transactiondescdialog.ui \\\n\nRESOURCES += \\\n    ../src/qt/bitcoin.qrc\n"
  },
  {
    "path": "contrib/bitcoin-tx.bash-completion",
    "content": "# bash programmable completion for bitcoin-tx(1)\n# Copyright (c) 2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n_bitcoin_tx() {\n    local cur prev words=() cword\n    local bitcoin_tx\n\n    # save and use original argument to invoke bitcoin-tx for -help\n    # it might not be in $PATH\n    bitcoin_tx=\"$1\"\n\n    COMPREPLY=()\n    _get_comp_words_by_ref -n =: cur prev words cword\n\n    case \"$cur\" in\n        load=*:*)\n            cur=\"${cur#load=*:}\"\n            _filedir\n            return 0\n            ;;\n        *=*)\t# prevent attempts to complete other arguments\n            return 0\n            ;;\n    esac\n\n    if [[ \"$cword\" == 1 || ( \"$prev\" != \"-create\" && \"$prev\" == -* ) ]]; then\n        # only options (or an uncompletable hex-string) allowed\n        # parse bitcoin-tx -help for options\n        local helpopts\n        helpopts=$($bitcoin_tx -help | sed -e '/^  -/ p' -e d )\n        COMPREPLY=( $( compgen -W \"$helpopts\" -- \"$cur\" ) )\n    else\n        # only commands are allowed\n        # parse -help for commands\n        local helpcmds\n        helpcmds=$($bitcoin_tx -help | sed -e '1,/Commands:/d' -e 's/=.*/=/' -e '/^  [a-z]/ p' -e d )\n        COMPREPLY=( $( compgen -W \"$helpcmds\" -- \"$cur\" ) )\n    fi\n\n    # Prevent space if an argument is desired\n    if [[ $COMPREPLY == *= ]]; then\n        compopt -o nospace\n    fi\n\n    return 0\n} &&\ncomplete -F _bitcoin_tx bitcoin-tx\n\n# Local variables:\n# mode: shell-script\n# sh-basic-offset: 4\n# sh-indent-comment: t\n# indent-tabs-mode: nil\n# End:\n# ex: ts=4 sw=4 et filetype=sh\n"
  },
  {
    "path": "contrib/bitcoind.bash-completion",
    "content": "# bash programmable completion for bitcoind(1) and bitcoin-qt(1)\n# Copyright (c) 2012-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n_bitcoind() {\n    local cur prev words=() cword\n    local bitcoind\n\n    # save and use original argument to invoke bitcoind for -help\n    # it might not be in $PATH\n    bitcoind=\"$1\"\n\n    COMPREPLY=()\n    _get_comp_words_by_ref -n = cur prev words cword\n\n    case \"$cur\" in\n        -conf=*|-pid=*|-loadblock=*|-rootcertificates=*|-rpccookiefile=*|-wallet=*)\n            cur=\"${cur#*=}\"\n            _filedir\n            return 0\n            ;;\n        -datadir=*)\n            cur=\"${cur#*=}\"\n            _filedir -d\n            return 0\n            ;;\n        -*=*)\t# prevent nonsense completions\n            return 0\n            ;;\n        *)\n\n            # only parse -help if sensible\n            if [[ -z \"$cur\" || \"$cur\" =~ ^- ]]; then\n                local helpopts\n                helpopts=$($bitcoind -help 2>&1 | awk '$1 ~ /^-/ { sub(/=.*/, \"=\"); print $1 }' )\n                COMPREPLY=( $( compgen -W \"$helpopts\" -- \"$cur\" ) )\n            fi\n\n            # Prevent space if an argument is desired\n            if [[ $COMPREPLY == *= ]]; then\n                compopt -o nospace\n            fi\n            return 0\n            ;;\n    esac\n} &&\ncomplete -F _bitcoind bitcoind bitcoin-qt\n\n# Local variables:\n# mode: shell-script\n# sh-basic-offset: 4\n# sh-indent-comment: t\n# indent-tabs-mode: nil\n# End:\n# ex: ts=4 sw=4 et filetype=sh\n"
  },
  {
    "path": "contrib/debian/README.md",
    "content": "\nDebian\n====================\nThis directory contains files used to package bitcoind/bitcoin-qt\nfor Debian-based Linux systems. If you compile bitcoind/bitcoin-qt yourself, there are some useful files here.\n\n## bitcoin: URI support ##\n\n\nbitcoin-qt.desktop  (Gnome / Open Desktop)\nTo install:\n\n\tsudo desktop-file-install bitcoin-qt.desktop\n\tsudo update-desktop-database\n\nIf you build yourself, you will either need to modify the paths in\nthe .desktop file or copy or symlink your bitcoin-qt binary to `/usr/bin`\nand the `../../share/pixmaps/bitcoin128.png` to `/usr/share/pixmaps`\n\nbitcoin-qt.protocol (KDE)\n\n"
  },
  {
    "path": "contrib/debian/bitcoin-qt.desktop",
    "content": "[Desktop Entry]\nVersion=1.0\nName=Bitcoin Core\nComment=Connect to the Bitcoin P2P Network\nComment[de]=Verbinde mit dem Bitcoin peer-to-peer Netzwerk\nComment[fr]=Bitcoin, monnaie virtuelle cryptographique pair à pair\nComment[tr]=Bitcoin, eşten eşe kriptografik sanal para birimi\nExec=bitcoin-qt %u\nTerminal=false\nType=Application\nIcon=bitcoin128\nMimeType=x-scheme-handler/bitcoin;\nCategories=Office;Finance;\nStartupWMClass=Bitcoin-qt\n"
  },
  {
    "path": "contrib/debian/bitcoin-qt.install",
    "content": "usr/local/bin/bitcoin-qt usr/bin\nshare/pixmaps/bitcoin32.xpm usr/share/pixmaps\nshare/pixmaps/bitcoin16.xpm usr/share/pixmaps\nshare/pixmaps/bitcoin128.png usr/share/pixmaps\ndebian/bitcoin-qt.desktop usr/share/applications\ndebian/bitcoin-qt.protocol usr/share/kde4/services/\n"
  },
  {
    "path": "contrib/debian/bitcoin-qt.lintian-overrides",
    "content": "# Linked code is Expat - only Debian packaging is GPL-2+\nbitcoin-qt: possible-gpl-code-linked-with-openssl\n"
  },
  {
    "path": "contrib/debian/bitcoin-qt.manpages",
    "content": "doc/man/bitcoin-qt.1\n"
  },
  {
    "path": "contrib/debian/bitcoin-qt.protocol",
    "content": "[Protocol]\nexec=bitcoin-qt '%u'\nprotocol=bitcoin\ninput=none\noutput=none\nhelper=true\nlisting=\nreading=false\nwriting=false\nmakedir=false\ndeleting=false\n"
  },
  {
    "path": "contrib/debian/bitcoin-tx.bash-completion",
    "content": "contrib/bitcoin-tx.bash-completion\tbitcoin-tx\n"
  },
  {
    "path": "contrib/debian/bitcoin-tx.install",
    "content": "usr/local/bin/bitcoin-tx usr/bin\n"
  },
  {
    "path": "contrib/debian/bitcoin-tx.manpages",
    "content": "doc/man/bitcoin-tx.1\n"
  },
  {
    "path": "contrib/debian/bitcoind.bash-completion",
    "content": "contrib/bitcoind.bash-completion\tbitcoind\ncontrib/bitcoin-cli.bash-completion\tbitcoin-cli\n"
  },
  {
    "path": "contrib/debian/bitcoind.examples",
    "content": "debian/examples/bitcoin.conf\n"
  },
  {
    "path": "contrib/debian/bitcoind.install",
    "content": "usr/local/bin/bitcoind usr/bin\nusr/local/bin/bitcoin-cli usr/bin\n"
  },
  {
    "path": "contrib/debian/bitcoind.lintian-overrides",
    "content": "# Linked code is Expat - only Debian packaging is GPL-2+\nbitcoind: possible-gpl-code-linked-with-openssl\n"
  },
  {
    "path": "contrib/debian/bitcoind.manpages",
    "content": "doc/man/bitcoind.1\ndoc/man/bitcoin-cli.1\n"
  },
  {
    "path": "contrib/debian/changelog",
    "content": "bitcoin (0.14.1-trusty4) trusty; urgency=medium\n\n  * Re-enable UPnP support.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Fri, 05 May 2017 13:28:00 -0400\n\nbitcoin (0.14.1-trusty3) trusty; urgency=medium\n\n  * Build with qt5 if we are on a non-Ubuntu (ie non-Unity) distro.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Thu, 04 May 2017 17:13:00 -0400\n\nbitcoin (0.14.1-trusty2) trusty; urgency=medium\n\n  * Bump minimum boost version in deps.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Thu, 04 May 2017 17:12:00 -0400\n\nbitcoin (0.14.1-trusty1) trusty; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Sat, 22 Apr 2017 17:10:00 -0400\n\nbitcoin (0.14.0-trusty1) trusty; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Wed, 08 Mar 2017 10:30:00 -0500\n\nbitcoin (0.13.2-trusty1) trusty; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Thu, 05 Jan 2017 09:59:00 -0500\n\nbitcoin (0.13.1-trusty2) trusty; urgency=medium\n\n  * Revert to Qt4, due to https://github.com/bitcoin/bitcoin/issues/9038\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Mon, 31 Oct 2016 11:16:00 -0400\n\nbitcoin (0.13.1-trusty1) trusty; urgency=medium\n\n  * New upstream release.\n  * Backport updated bitcoin-qt.desktop from upstream master\n  * Add zmq dependency\n  * Switch to Qt5 (breaks precise, but that was already broken by C++11)\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Thu, 27 Oct 2016 17:32:00 -0400\n\nbitcoin (0.13.0-trusty1) trusty; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Sun, 04 Sep 2016 22:09:00 -0400\n\nbitcoin (0.12.1-trusty1) trusty; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Mon, 18 Apr 2016 14:26:00 -0700\n\nbitcoin (0.12.0-trusty6) trusty; urgency=medium\n\n  * Fix program-options dep.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Fri, 25 Mar 2016 21:41:00 -0700\n\nbitcoin (0.12.0-trusty5) trusty; urgency=medium\n\n  * Test explicit --with-gui\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Tue, 23 Feb 2015 23:25:00 -0800\n\nbitcoin (0.12.0-trusty4) trusty; urgency=medium\n\n  * Fix libevent-dev dep.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Tue, 23 Feb 2015 23:25:00 -0800\n\nbitcoin (0.12.0-trusty3) trusty; urgency=medium\n\n  * Fix precise boost dep.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Tue, 23 Feb 2015 19:55:00 -0800\n\nbitcoin (0.12.0-trusty2) trusty; urgency=medium\n\n  * Fix libevent dep.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Tue, 23 Feb 2015 19:53:00 -0800\n\nbitcoin (0.12.0-trusty1) trusty; urgency=medium\n\n  * New upstream release\n  * Various updates to contrib/debian were merged, a few were not\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Tue, 23 Feb 2015 19:29:00 -0800\n\nbitcoin (0.11.2-trusty1) trusty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Fri, 13 Nov 2015 18:39:00 -0800\n\nbitcoin (0.11.1-trusty2) trusty; urgency=low\n\n  * Remove minupnpc builddep.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Wed, 14 Oct 2015 23:06:00 -1000\n\nbitcoin (0.11.1-trusty1) trusty; urgency=high\n\n  * New upstream release.\n  * Disable all UPnP support.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Wed, 14 Oct 2015 13:57:00 -1000\n\nbitcoin (0.11.0-precise1) precise; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Tue, 14 Jul 2015 14:39:00 -1000\n\nbitcoin (0.10.2-precise1) precise; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Mon, 29 Jun 2015 17:33:00 -1000\n\nbitcoin (0.10.1-precise3) precise; urgency=medium\n\n  * Fix build dep (include python).\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Tue, 5 May 2015 09:28:00 -1000\n\nbitcoin (0.10.1-precise2) precise; urgency=medium\n\n  * Fix miniupnpc dep.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Tue, 5 May 2015 00:33:00 -1000\n\nbitcoin (0.10.1-precise1) precise; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Tue, 5 May 2015 00:07:00 -1000\n\nbitcoin (0.10.0-precise1) precise; urgency=medium\n\n  * New upstream releases.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Wed, 18 Feb 2015 13:22:00 -1000\n\nbitcoin (0.9.4-precise1) precise; urgency=high\n\n  * New upstream releases.\n\n -- Matt Corallo (laptop - only while traveling) <matt@mattcorallo.com>  Mon, 12 Jan 2015 23:30:00 -1000\n\nbitcoin (0.9.3-precise1) precise; urgency=medium\n\n  * New upstream releases.\n\n -- Matt Corallo (BlueMatt) <matt@mattcorallo.com>  Fri, 26 Sep 2014 12:01:00 -0700\n\nbitcoin (0.9.1-precise1) precise; urgency=medium\n\n  * New upstream release.\n  * Backport pull #4019\n\n -- Matt Corallo <matt@bluematt.me>  Sat, 19 Apr 2014 17:29:00 -0400\n\nbitcoin (0.9.0-precise1) precise; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Thu, 20 Mar 2014 13:10:00 -0400\n\nbitcoin (0.8.6-precise1) precise; urgency=medium\n\n  * New upstream release.\n  * Make .desktop paths non-fixed (suggested by prusnak@github)\n\n -- Matt Corallo <matt@bluematt.me>  Fri, 13 Dec 2013 13:31:00 -0400\n\nbitcoin (0.8.5-precise1) precise; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Sun, 15 Sep 2013 14:02:00 -0400\n\nbitcoin (0.8.4-precise1) precise; urgency=medium\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Wed, 4 Sep 2013 10:25:00 -0400\n\nbitcoin (0.8.3-natty1) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Wed, 26 Jun 2013 00:18:00 +0100\n\nbitcoin (0.8.2-natty1) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Wed, 29 Mar 2013 23:23:00 +0100\n\nbitcoin (0.8.1-natty3) natty; urgency=low\n\n  * New pixmaps\n\n -- Jonas Schnelli <jonas.schnelli@include7.ch>  Mon, 13 May 2013 16:14:00 +0100\n\nbitcoin (0.8.1-natty2) natty; urgency=low\n\n  * Remove dumb broken launcher script\n\n -- Matt Corallo <matt@bluematt.me>  Sun, 24 Mar 2013 20:01:00 -0400\n\nbitcoin (0.8.1-natty1) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Tue, 19 Mar 2013 13:03:00 -0400\n\nbitcoin (0.8.0-natty1) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Sat, 23 Feb 2013 16:01:00 -0500\n\nbitcoin (0.7.2-natty1) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Sat, 15 Dec 2012 10:59:00 -0400\n\nbitcoin (0.7.1-natty1) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Wed, 24 Oct 2012 15:06:00 -0400\n\nbitcoin (0.7.0-natty1) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Mon, 17 Sep 2012 13:45:00 +0200\n\nbitcoin (0.6.3-natty1) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Mon, 25 Jun 2012 23:47:00 +0200\n\nbitcoin (0.6.2-natty1) natty; urgency=low\n\n  * Update package description and launch scripts.\n\n -- Matt Corallo <matt@bluematt.me>  Sat, 2 Jun 2012 16:41:00 +0200\n\nbitcoin (0.6.2-natty0) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Tue, 8 May 2012 16:27:00 -0500\n\nbitcoin (0.6.1-natty0) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Sun, 6 May 2012 20:09:00 -0500\n\nbitcoin (0.6.0-natty0) natty; urgency=low\n\n  * New upstream release.\n  * Add GNOME/KDE support for bitcoin-qt's bitcoin: URI support.\n    Thanks to luke-jr for the KDE .protocol file.\n\n -- Matt Corallo <matt@bluematt.me>  Sat, 31 Mar 2012 15:35:00 -0500\n\nbitcoin (0.5.3-natty1) natty; urgency=low\n\n  * Mark for upload to PPA.\n\n -- Matt Corallo <matt@bluematt.me>  Wed, 14 Mar 2012 23:06:00 -0400\n\nbitcoin (0.5.3-natty0) natty; urgency=low\n\n  * New upstream release.\n\n -- Luke Dashjr <luke+bitcoin+deb@dashjr.org>  Tue, 10 Jan 2012 15:57:00 -0500\n\nbitcoin (0.5.2-natty1) natty; urgency=low\n\n  * Remove mentions on anonymity in package descriptions and manpage.\n    These should never have been there, bitcoin isnt anonymous without\n    a ton of work that virtually no users will ever be willing and\n    capable of doing\n\n -- Matt Corallo <matt@bluematt.me>  Sat, 7 Jan 2012 13:37:00 -0500\n\nbitcoin (0.5.2-natty0) natty; urgency=low\n\n  * New upstream release.\n\n -- Luke Dashjr <luke+bitcoin+deb@dashjr.org>  Fri, 16 Dec 2011 17:57:00 -0500\n\nbitcoin (0.5.1-natty0) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Fri, 16 Dec 2011 13:27:00 -0500\n\nbitcoin (0.5.0-natty0) natty; urgency=low\n\n  * New upstream release.\n\n -- Matt Corallo <matt@bluematt.me>  Mon, 21 Nov 2011 11:32:00 -0500\n\nbitcoin (0.5.0~rc7-natty0) natty; urgency=low\n\n  * New upstream release candidate.\n\n -- Matt Corallo <matt@bluematt.me>  Sun, 20 Nov 2011 17:08:00 -0500\n\nbitcoin (0.5.0~rc3-natty0) natty; urgency=low\n\n  * New upstream release candidate.\n  * Don't set rpcpassword for bitcoin-qt.\n\n -- Matt Corallo <matt@bluematt.me>  Tue, 8 Nov 2011 11:56:00 -0400\n\nbitcoin (0.5.0~rc1-natty1) natty; urgency=low\n\n  * Add test_bitcoin to build test\n  * Fix clean\n  * Remove uneccessary build-dependancies\n\n -- Matt Corallo <matt@bluematt.me>  Wed, 26 Oct 2011 14:37:18 -0400\n\nbitcoin (0.5.0~rc1-natty0) natty; urgency=low\n\n  * Mark for natty\n  * Fix broken build\n  * Fix copyright listing\n  * Remove bitcoin: URL handler until bitcoin actually has support for it (Oops)\n\n -- Matt Corallo <matt@bluematt.me>  Wed, 26 Oct 2011 14:37:18 -0400\n\nbitcoin (0.5.0~rc1-2) experimental; urgency=low\n\n  * Add bitcoin-qt\n\n -- Matt Corallo <matt@bluematt.me>  Tue, 25 Oct 2011 15:24:18 -0400\n\nbitcoin (0.5.0~rc1-1) experimental; urgency=low\n\n  * New upstream prerelease.\n  * Add Github as alternate upstream source in watch file.\n  * Stop build-depending on libcrypto++-dev, and drop patch 1000:\n    Upstream no longer use crypto++.\n  * Drop patch 1003: Upstream builds dynamic by default now.\n  * Update copyright file: Drop notes on longer included sources.\n\n -- Jonas Smedegaard <dr@jones.dk>  Fri, 14 Oct 2011 00:16:18 +0200\n\nbitcoin (0.4.0-1) unstable; urgency=low\n\n  * New upstream release.\n  * Stop repackaging source tarballs: No DFSG-violating stripping left.\n  * Update copyright file:\n    + Add Github URL to Source.\n  * Drop dpkg-source local-options hint: Declared options are default\n    since dpkg-source 1.16.1.\n    + Add irc URL to Upstream-Contact.\n    + Add comment on Bitcoin Developers to catch-all Files section.\n    + Add Files sections for newly readded src/cryptopp/* (new custom\n      BSD-like license), and newly added doc/build-osx.txt and\n      src/makefile.osx (Expat).\n  * Bump debhelper compatibility level to 7.\n  * Suppress binary icns and gpg files.\n  * Enable regression tests:\n    + Build-depend on libboost-test-dev.\n    + Extend patch 1003 to also dynamically link test binary.\n    + Build and invoke test binary unless tests are disabled.\n  * Tighten build-dependency on cdbs: Recent version needed to support\n    debhelper 7.\n  * Relax build-depend unversioned on debhelper: needed version\n    satisfied even in oldstable.\n  * Stop suppress optional build-dependencies: Satisfied in stable.\n    Build-depend on devscripts (enabling copyright-check).\n\n -- Jonas Smedegaard <dr@jones.dk>  Wed, 05 Oct 2011 01:48:53 +0200\n\nbitcoin (0.3.24~dfsg-1) unstable; urgency=low\n\n  * New upstream release.\n\n  [ Jonas Smedegaard ]\n  * Improve various usage hints:\n    + Explicitly mention in long description that bitcoind contains\n      daemon and command-line interface.\n    + Extend README.Debian with section on lack of GUI, and add primary\n      headline.\n    + Avoid installing upstream README: contains no parts relevant for\n      Debian usage.\n    Thanks to richard for suggestions (see bug#629443).\n  * Favor final releases over prereleases in rules and watch file.\n    Thanks to Jan Dittberner.\n  * Track -src (not -linux) tarballs in rules and watch file.\n    Thanks to Jan Dittberner.\n  * Drop patches 1004 and 1005 (integrated upstream) and simplify\n    CXXFLAGS in rules file.\n  * Stop stripping no longer included source-less binaries from upstream\n    tarballs.\n\n  [ Jan Dittberner ]\n  * refresh debian/patches/1000_use_system_crypto++.patch\n\n -- Jonas Smedegaard <dr@jones.dk>  Tue, 19 Jul 2011 15:08:54 +0200\n\nbitcoin (0.3.21~dfsg-2) unstable; urgency=low\n\n  * Enable UPNP support:\n    + Drop patch 1006.\n    + Build-depend on libminiupnpc-dev.\n    Thanks to Matt Corallo.\n\n -- Jonas Smedegaard <dr@jones.dk>  Sat, 28 May 2011 15:52:44 +0200\n\nbitcoin (0.3.21~dfsg-1) unstable; urgency=low\n\n  * New upstream release.\n  * Refresh patches.\n  * Drop patch 1002: no longer needed, as upstream use pkgconfig now.\n  * Add patch 1006 to really unset USE_UPNP as aparently intended.\n  * Adjust cleanup rule to preserve .gitignore files.\n  * Update copyright file:\n    + Bump format to draft 174 of DEP-5.\n    + Shorten comments.\n  * Bump policy compliance to standards-version 3.9.2.\n  * Shorten Vcs-Browser paragraph in control file.\n  * Fix mention daemon (not CLI tools) in short description.\n  * Stop conflicting with or replace bitcoin-cli: Only transitional, no\n    longer needed.\n  * Link against unversioned berkeleydb. Update NEWS and README.Debian\n    accordingly (and improve wording while at it).\n    Closes: Bug#621425. Thanks to Ondřej Surý.\n  * This release also implicitly updates linkage against libcrypto++,\n    which closes: bug#626953, #627024.\n  * Disable linkage against not yet Debian packaged MiniUPnP.\n  * Silence seemingly harmless noise about unused variables.\n\n -- Jonas Smedegaard <dr@jones.dk>  Tue, 17 May 2011 15:31:24 +0200\n\nbitcoin (0.3.20.2~dfsg-2) unstable; urgency=medium\n\n  * Fix have wrapper script execute real binary (not loop executing\n    itself).\n    Closes: bug#617290. Thanks to Philippe Gauthier and Etienne Laurin.\n  * Set urgency=medium as the only (user-exposed) binary is useless\n    without this fix and has been for some time.\n\n -- Jonas Smedegaard <dr@jones.dk>  Wed, 16 Mar 2011 09:11:06 +0100\n\nbitcoin (0.3.20.2~dfsg-1) unstable; urgency=low\n\n  * New upstream release.\n  * Fix provide and replace former package name bitcoin-cli.\n    Closes: bug#618439. Thanks to Shane Wegner.\n\n -- Jonas Smedegaard <dr@jones.dk>  Tue, 15 Mar 2011 11:41:43 +0100\n\nbitcoin (0.3.20.01~dfsg-1) unstable; urgency=low\n\n  * New upstream release.\n\n  [ Micah Anderson ]\n  * Add myself as uploader.\n\n  [ Jonas Smedegaard ]\n  * Add wrapper for bitcoind to ease initial startup.\n  * Update patches:\n    + Drop patch 2002: Applied upstream.\n    + Add patch 1005 to add phtread linker option.\n      Closes: bug#615619. Thanks to Shane Wegner.\n    + Refresh patches.\n  * Extend copyright years in rules file header.\n  * Rewrite copyright file using draft svn166 of DEP5 format.\n  * Rename binary package to bitcoind (from bincoin-cli).\n    Closes: bug#614025. Thanks to Luke-Jr.\n\n -- Jonas Smedegaard <dr@jones.dk>  Tue, 01 Mar 2011 15:55:04 +0100\n\nbitcoin (0.3.19~dfsg-6) unstable; urgency=low\n\n  * Fix override agressive optimizations.\n  * Fix tighten build-dependencies to really fit backporting to Lenny:\n    + Add fallback build-dependency on libdb4.6++-dev.\n    + Tighten unversioned Boost build-dependencies to recent versions,\n      To force use of versioned Boost when backporting to Lenny.\n    ...needs more love, though: actual build fails.\n\n -- Jonas Smedegaard <dr@jones.dk>  Mon, 17 Jan 2011 19:48:35 +0100\n\nbitcoin (0.3.19~dfsg-5) unstable; urgency=low\n\n  * Fix lower Boost fallback-build-dependencies to 1.35, really\n    available in Lenny.\n  * Correct comment in rules file regarding reason for versioned Boost\n    fallback-build-dependency.\n  * Add patch 2002 adding -mt decoration to Boost flags, to ease\n    backporting to Lenny.\n  * Respect DEB_BUILD_OPTIONS, and suppress arch-specific optimizations:\n    + Add patch 1004 to allow overriding optimization flags.\n    + Set optimization flags conditionally at build time.\n    + Drop patch 2002 unconditionally suppressing arch-optimizations.\n\n -- Jonas Smedegaard <dr@jones.dk>  Mon, 17 Jan 2011 16:04:48 +0100\n\nbitcoin (0.3.19~dfsg-4) unstable; urgency=low\n\n  [ Micah Anderson ]\n  * Provide example bitcoin.conf.\n  * Add bitcoind(1) and bitcoin.conf(5) man pages.\n\n  [ Jonas Smedegaard ]\n  * Ease backporting:\n    + Suppress optional build-dependencies.\n    + Add fallback build-dependencies on the most recent Boost libs\n    available in Lenny (where unversioned Boost libs are missing).\n  * Add Micah as copyright holder for manpages, licensed as GPL-3+.\n  * Bump copyright format to Subversion candidate draft 162 of DEP5.\n\n -- Jonas Smedegaard <dr@jones.dk>  Mon, 17 Jan 2011 14:00:48 +0100\n\nbitcoin (0.3.19~dfsg-3) unstable; urgency=low\n\n  * Document in copyright file files excluded from repackaged source.\n  * Update copyright file:\n    + Bump DEP5 format hint to Subversion draft rev. 153.\n    + Consistently wrap at 72 chars.\n    + Refer to GPL-2 file (not GPL symlink).\n  * Link against Berkeley DB 4.8 (not 4.7):\n    + Build-depend on libdb4.8++-dev (and on on libdb4.7++-dev).\n    + Suggest libdb4.8-util and db4.7-util.\n    + Add README.Debian note on (untested) upgrade routine.\n    + Add NEWS entry on changed db version, referring to README.Debian.\n\n -- Jonas Smedegaard <dr@jones.dk>  Fri, 07 Jan 2011 22:50:57 +0100\n\nbitcoin (0.3.19~dfsg-2) unstable; urgency=low\n\n  * Adjust build options to use optimized miner only for amd64. Fixes\n    FTBFS on i386 (and other archs, if compiling anywhere else at all).\n  * Avoid static linking.\n  * Adjust patch 2001 to avoid only arch-specific optimizations (keep\n    -O3).\n  * Extend long description to mention disk consumption and initial use\n    of IRC.\n  All of above changes thanks to Helmuth Grohne.\n  * Add lintian override regarding OpenSSL and GPL: Linked code is Expat\n    - only Debian packaging is GPL-2+.\n\n -- Jonas Smedegaard <dr@jones.dk>  Wed, 29 Dec 2010 00:27:54 +0100\n\nbitcoin (0.3.19~dfsg-1) unstable; urgency=low\n\n  [ Jonas Smedegaard ]\n  * Initial release.\n    Closes: bug#578157.\n\n -- Jonas Smedegaard <dr@jones.dk>  Tue, 28 Dec 2010 15:49:22 +0100\n"
  },
  {
    "path": "contrib/debian/compat",
    "content": "7\n"
  },
  {
    "path": "contrib/debian/control",
    "content": "Source: bitcoin\nSection: utils\nPriority: optional\nMaintainer: Matt Corallo <matt@mattcorallo.com>\nUploaders: Matt Corallo <matt@mattcorallo.com>\nBuild-Depends: debhelper,\n devscripts,\n automake,\n libtool,\n bash-completion,\n libdb4.8++-dev,\n libssl-dev,\n pkg-config,\n libevent-dev,\n libboost-system1.48-dev | libboost-system-dev (>> 1.47),\n libboost-filesystem1.48-dev | libboost-filesystem-dev (>> 1.47),\n libboost-program-options1.48-dev | libboost-program-options-dev (>> 1.47),\n libboost-thread1.48-dev | libboost-thread-dev (>> 1.47),\n libboost-test1.48-dev | libboost-test-dev (>> 1.47),\n libboost-chrono1.48-dev | libboost-chrono-dev (>> 1.47),\n libminiupnpc8-dev | libminiupnpc-dev,\n qt4-qmake, libqt4-dev,\n qttools5-dev-tools, qttools5-dev,\n libqrencode-dev,\n libprotobuf-dev, protobuf-compiler,\n python,\n libzmq3-dev\nStandards-Version: 3.9.2\nHomepage: https://bitcoincore.org/\nVcs-Git: git://github.com/bitcoin/bitcoin.git\nVcs-Browser: https://github.com/bitcoin/bitcoin\n\nPackage: bitcoind\nArchitecture: any\nDepends: ${shlibs:Depends}, ${misc:Depends}\nDescription: peer-to-peer network based digital currency - daemon\n Bitcoin is a free open source peer-to-peer electronic cash system that\n is completely decentralized, without the need for a central server or\n trusted parties.  Users hold the crypto keys to their own money and\n transact directly with each other, with the help of a P2P network to\n check for double-spending.\n .\n This package provides the daemon, bitcoind, and the CLI tool\n bitcoin-cli to interact with the daemon.\n\nPackage: bitcoin-qt\nArchitecture: any\nDepends: ${shlibs:Depends}, ${misc:Depends}\nDescription: peer-to-peer network based digital currency - Qt GUI\n Bitcoin is a free open source peer-to-peer electronic cash system that\n is completely decentralized, without the need for a central server or\n trusted parties.  Users hold the crypto keys to their own money and\n transact directly with each other, with the help of a P2P network to\n check for double-spending.\n .\n This package provides Bitcoin-Qt, a GUI for Bitcoin based on Qt.\n\nPackage: bitcoin-tx\nArchitecture: any\nDepends: ${shlibs:Depends}, ${misc:Depends}\nDescription: peer-to-peer digital currency - standalone transaction tool\n Bitcoin is a free open source peer-to-peer electronic cash system that\n is completely decentralized, without the need for a central server or\n trusted parties.  Users hold the crypto keys to their own money and\n transact directly with each other, with the help of a P2P network to\n check for double-spending.\n .\n This package provides bitcoin-tx, a command-line transaction creation\n tool which can be used without a bitcoin daemon.  Some means of\n exchanging minimal transaction data with peers is still required.\n"
  },
  {
    "path": "contrib/debian/copyright",
    "content": "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\nUpstream-Name: Bitcoin\nUpstream-Contact: Satoshi Nakamoto <satoshin@gmx.com>\n irc://#bitcoin@freenode.net\nSource: https://github.com/bitcoin/bitcoin\n\nFiles: *\nCopyright: 2009-2018, Bitcoin Core Developers\nLicense: Expat\nComment: The Bitcoin Core Developers encompasses the current developers listed on bitcoin.org,\n         as well as the numerous contributors to the project.\n\nFiles: debian/*\nCopyright: 2010-2011, Jonas Smedegaard <dr@jones.dk>\n           2011, Matt Corallo <matt@bluematt.me>\nLicense: GPL-2+\n\nFiles: src/secp256k1/build-aux/m4/ax_jni_include_dir.m4\nCopyright: 2008 Don Anderson <dda@sleepycat.com>\nLicense: GNU-All-permissive-License\n\nFiles: src/secp256k1/build-aux/m4/ax_prog_cc_for_build.m4\nCopyright: 2008 Paolo Bonzini <bonzini@gnu.org>\nLicense: GNU-All-permissive-License\n\nFiles: src/qt/res/icons/add.png\n       src/qt/res/icons/address-book.png\n       src/qt/res/icons/chevron.png\n       src/qt/res/icons/configure.png\n       src/qt/res/icons/debugwindow.png\n       src/qt/res/icons/edit.png\n       src/qt/res/icons/editcopy.png\n       src/qt/res/icons/editpaste.png\n       src/qt/res/icons/export.png\n       src/qt/res/icons/eye.png\n       src/qt/res/icons/filesave.png\n       src/qt/res/icons/history.png\n       src/qt/res/icons/info.png\n       src/qt/res/icons/key.png\n       src/qt/res/icons/lock_*.png\n       src/qt/res/icons/open.png\n       src/qt/res/icons/overview.png\n       src/qt/res/icons/quit.png\n       src/qt/res/icons/receive.png\n       src/qt/res/icons/remove.png\n       src/qt/res/icons/send.png\n       src/qt/res/icons/synced.png\n       src/qt/res/icons/transaction*.png\n       src/qt/res/icons/tx_output.png\n       src/qt/res/icons/warning.png\nCopyright: Stephen Hutchings (and more)\n           http://typicons.com\nLicense: Expat\nComment: Site: https://github.com/stephenhutchings/typicons.font\n\nFiles: src/qt/res/icons/connect*.png\n       src/qt/res/src/connect-*.svg\n       src/qt/res/icons/network_disabled.png\n       src/qt/res/src/network_disabled.svg\nCopyright: Marco Falke\n           Luke Dashjr\nLicense: Expat\nComment: Inspired by Stephan Hutchings Typicons\n\nFiles: src/qt/res/icons/tx_mined.png\n       src/qt/res/src/mine.svg\n       src/qt/res/icons/fontbigger.png\n       src/qt/res/icons/fontsmaller.png\n       src/qt/res/icons/hd_disabled.png\n       src/qt/res/src/hd_disabled.svg\n       src/qt/res/icons/hd_enabled.png\n       src/qt/res/src/hd_enabled.svg\nCopyright: Jonas Schnelli\nLicense: Expat\nComment:\n\nFiles: src/qt/res/icons/clock*.png\n       src/qt/res/icons/eye_*.png\n       src/qt/res/icons/verify.png\n       src/qt/res/icons/tx_in*.png\n       src/qt/res/src/clock_*.svg\n       src/qt/res/src/tx_*.svg\n       src/qt/res/src/verify.svg\nCopyright: Stephan Hutching, Jonas Schnelli\nLicense: Expat\nComment: Modifications of Stephan Hutchings Typicons\n\nFiles: src/qt/res/icons/about.png\n       src/qt/res/icons/bitcoin.*\n       share/pixmaps/bitcoin*\n       src/qt/res/src/bitcoin.svg\nCopyright: Bitboy, Jonas Schnelli\nLicense: public-domain\nComment: Site: https://bitcointalk.org/?topic=1756.0\n\n\nLicense: Expat\n Permission is hereby granted, free of charge, to any person obtaining a\n copy of this software and associated documentation files (the\n \"Software\"), to deal in the Software without restriction, including\n without limitation the rights to use, copy, modify, merge, publish,\n distribute, sublicense, and/or sell copies of the Software, and to\n permit persons to whom the Software is furnished to do so, subject to\n the following conditions:\n .\n The above copyright notice and this permission notice shall be included\n in all copies or substantial portions of the Software.\n .\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nLicense: GNU-All-permissive-License\n Copying and distribution of this file, with or without modification, are\n permitted in any medium without royalty provided the copyright notice\n and this notice are preserved. This file is offered as-is, without any\n warranty.\n\nLicense: GPL-2+\n This program is free software; you can redistribute it and/or modify it\n under the terms of the GNU General Public License as published by the\n Free Software Foundation; either version 2, or (at your option) any\n later version.\n .\n This program is distributed in the hope that it will be useful, but\n WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n General Public License for more details.\nComment:\n On Debian systems the GNU General Public License (GPL) version 2 is\n located in '/usr/share/common-licenses/GPL-2'.\n .\n You should have received a copy of the GNU General Public License along\n with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nLicense: GPL-3+\n Permission is granted to copy, distribute and/or modify this document\n under the terms of the GNU General Public License, Version 3 or any\n later version published by the Free Software Foundation.\nComment:\n On Debian systems the GNU General Public License (GPL) version 3 is\n located in '/usr/share/common-licenses/GPL-3'.\n .\n You should have received a copy of the GNU General Public License along\n with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nLicense: public-domain\n This work is in the public domain.\n"
  },
  {
    "path": "contrib/debian/examples/bitcoin.conf",
    "content": "##\n## bitcoin.conf configuration file. Lines beginning with # are comments.\n##\n \n# Network-related settings:\n\n# Run on the test network instead of the real bitcoin network.\n#testnet=0\n\n# Run a regression test network\n#regtest=0\n\n# Connect via a SOCKS5 proxy\n#proxy=127.0.0.1:9050\n\n# Bind to given address and always listen on it. Use [host]:port notation for IPv6\n#bind=<addr>\n\n# Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6\n#whitebind=<addr>\n\n##############################################################\n##            Quick Primer on addnode vs connect            ##\n##  Let's say for instance you use addnode=4.2.2.4          ##\n##  addnode will connect you to and tell you about the      ##\n##    nodes connected to 4.2.2.4.  In addition it will tell ##\n##    the other nodes connected to it that you exist so     ##\n##    they can connect to you.                              ##\n##  connect will not do the above when you 'connect' to it. ##\n##    It will *only* connect you to 4.2.2.4 and no one else.##\n##                                                          ##\n##  So if you're behind a firewall, or have other problems  ##\n##  finding nodes, add some using 'addnode'.                ##\n##                                                          ##\n##  If you want to stay private, use 'connect' to only      ##\n##  connect to \"trusted\" nodes.                             ##\n##                                                          ##\n##  If you run multiple nodes on a LAN, there's no need for ##\n##  all of them to open lots of connections.  Instead       ##\n##  'connect' them all to one node that is port forwarded   ##\n##  and has lots of connections.                            ##\n##       Thanks goes to [Noodle] on Freenode.               ##\n##############################################################\n\n# Use as many addnode= settings as you like to connect to specific peers\n#addnode=69.164.218.197\n#addnode=10.0.0.2:34230\n\n# Alternatively use as many connect= settings as you like to connect ONLY to specific peers\n#connect=69.164.218.197\n#connect=10.0.0.1:34230\n\n# Listening mode, enabled by default except when 'connect' is being used\n#listen=1\n\n# Maximum number of inbound+outbound connections.\n#maxconnections=\n\n#\n# JSON-RPC options (for controlling a running Bitcoin/bitcoind process)\n#\n\n# server=1 tells Bitcoin-Qt and bitcoind to accept JSON-RPC commands\n#server=0\n\n# Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6.\n# This option can be specified multiple times (default: bind to all interfaces)\n#rpcbind=<addr>\n\n# If no rpcpassword is set, rpc cookie auth is sought. The default `-rpccookiefile` name\n# is .cookie and found in the `-datadir` being used for bitcoind. This option is typically used\n# when the server and client are run as the same user.\n#\n# If not, you must set rpcuser and rpcpassword to secure the JSON-RPC api. The first\n# method(DEPRECATED) is to set this pair for the server and client:\n#rpcuser=Ulysseys\n#rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593\n#\n# The second method `rpcauth` can be added to server startup argument. It is set at initialization time\n# using the output from the script in share/rpcauth/rpcauth.py after providing a username:\n#\n# ./share/rpcauth/rpcauth.py alice\n# String to be appended to bitcoin.conf:\n# rpcauth=alice:f7efda5c189b999524f151318c0c86$d5b51b3beffbc02b724e5d095828e0bc8b2456e9ac8757ae3211a5d9b16a22ae\n# Your password:\n# DONT_USE_THIS_YOU_WILL_GET_ROBBED_8ak1gI25KFTvjovL3gAM967mies3E=\n#\n# On client-side, you add the normal user/password pair to send commands:\n#rpcuser=alice\n#rpcpassword=DONT_USE_THIS_YOU_WILL_GET_ROBBED_8ak1gI25KFTvjovL3gAM967mies3E=\n#\n# You can even add multiple entries of these to the server conf file, and client can use any of them:\n# rpcauth=bob:b2dd077cb54591a2f3139e69a897ac$4e71f08d48b4347cf8eff3815c0e25ae2e9a4340474079f55705f40574f4ec99\n\n# How many seconds bitcoin will wait for a complete RPC HTTP request.\n# after the HTTP connection is established. \n#rpcclienttimeout=30\n\n# By default, only RPC connections from localhost are allowed.\n# Specify as many rpcallowip= settings as you like to allow connections from other hosts,\n# either as a single IPv4/IPv6 or with a subnet specification.\n\n# NOTE: opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED,\n# because the rpcpassword is transmitted over the network unencrypted.\n\n# server=1 tells Bitcoin-Qt to accept JSON-RPC commands.\n# it is also read by bitcoind to determine if RPC should be enabled \n#rpcallowip=10.1.1.34/255.255.255.0\n#rpcallowip=1.2.3.4/24\n#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96\n\n# Listen for RPC connections on this TCP port:\n#rpcport=34229\n\n# You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind\n# running on another host using this option:\n#rpcconnect=127.0.0.1\n\n# Create transactions that have enough fees so they are likely to begin confirmation within n blocks (default: 6).\n# This setting is over-ridden by the -paytxfee option.\n#txconfirmtarget=n\n\n# Miscellaneous options\n\n# Pre-generate this many public/private key pairs, so wallet backups will be valid for\n# both prior transactions and several dozen future transactions.\n#keypool=100\n\n# Pay an optional transaction fee every time you send bitcoins.  Transactions with fees\n# are more likely than free transactions to be included in generated blocks, so may\n# be validated sooner.\n#paytxfee=0.00\n\n# Enable pruning to reduce storage requirements by deleting old blocks. \n# This mode is incompatible with -txindex and -rescan.\n# 0 = default (no pruning).\n# 1 = allows manual pruning via RPC.\n# >=550 = target to stay under in MiB. \n#prune=550\n\n# User interface options\n\n# Start Bitcoin minimized\n#min=1\n\n# Minimize to the system tray\n#minimizetotray=1\n"
  },
  {
    "path": "contrib/debian/gbp.conf",
    "content": "# Configuration file for git-buildpackage and friends\n\n[DEFAULT]\npristine-tar = True\nsign-tags = True\n"
  },
  {
    "path": "contrib/debian/patches/README",
    "content": "0xxx: Grabbed from upstream development.\n1xxx: Possibly relevant for upstream adoption.\n2xxx: Only relevant for official Debian release.\n"
  },
  {
    "path": "contrib/debian/patches/series",
    "content": "\n"
  },
  {
    "path": "contrib/debian/rules",
    "content": "#!/usr/bin/make -f\n# -*- mode: makefile; coding: utf-8 -*-\n\n#DEB_MAKE_CHECK_TARGET = test_bitcoin\n#build/bitcoind::\n#\t$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,src/test_bitcoin)\n\n%:\n\tdh --with bash-completion $@\n\noverride_dh_auto_clean:\n\tif [ -f Makefile ]; then $(MAKE) distclean; fi\n\trm -rf Makefile.in aclocal.m4 configure src/Makefile.in src/bitcoin-config.h.in src/build-aux src/qt/Makefile.in src/qt/test/Makefile.in src/test/Makefile.in\n\nQT=$(shell dpkg-vendor --derives-from Ubuntu && echo qt4 || echo qt5)\n\n# Yea, autogen should be run on the source archive, but I like doing git archive\noverride_dh_auto_configure:\n\t./autogen.sh\n\t./configure --with-gui=$(QT)\n\noverride_dh_auto_test:\n\tmake check\n"
  },
  {
    "path": "contrib/debian/source/format",
    "content": "3.0 (quilt)\n"
  },
  {
    "path": "contrib/debian/watch",
    "content": "# Run the \"uscan\" command to check for upstream updates and more.\nversion=3\n# use qa.debian.org redirector; see man uscan\nopts=uversionmangle=s/(\\d)(alpha|beta|rc)/$1~$2/,dversionmangle=s/~dfsg\\d*// \\\n http://githubredir.debian.net/github/bitcoin/bitcoin v(.*).tar.gz\n"
  },
  {
    "path": "contrib/devtools/README.md",
    "content": "Contents\n========\nThis directory contains tools for developers working on this repository.\n\ncheck-doc.py\n============\n\nCheck if all command line args are documented. The return value indicates the\nnumber of undocumented args.\n\nclang-format-diff.py\n===================\n\nA script to format unified git diffs according to [.clang-format](../../src/.clang-format).\n\nFor instance, to format the last commit with 0 lines of context,\nthe script should be called from the git root folder as follows.\n\n```\ngit diff -U0 HEAD~1.. | ./contrib/devtools/clang-format-diff.py -p1 -i -v\n```\n\ncopyright\\_header.py\n====================\n\nProvides utilities for managing copyright headers of `The Bitcoin Core\ndevelopers` in repository source files. It has three subcommands:\n\n```\n$ ./copyright_header.py report <base_directory> [verbose]\n$ ./copyright_header.py update <base_directory>\n$ ./copyright_header.py insert <file>\n```\nRunning these subcommands without arguments displays a usage string.\n\ncopyright\\_header.py report \\<base\\_directory\\> [verbose]\n---------------------------------------------------------\n\nProduces a report of all copyright header notices found inside the source files\nof a repository. Useful to quickly visualize the state of the headers.\nSpecifying `verbose` will list the full filenames of files of each category.\n\ncopyright\\_header.py update \\<base\\_directory\\> [verbose]\n---------------------------------------------------------\nUpdates all the copyright headers of `The Bitcoin Core developers` which were\nchanged in a year more recent than is listed. For example:\n```\n// Copyright (c) <firstYear>-<lastYear> The Bitcoin Core developers\n```\nwill be updated to:\n```\n// Copyright (c) <firstYear>-<lastModifiedYear> The Bitcoin Core developers\n```\nwhere `<lastModifiedYear>` is obtained from the `git log` history.\n\nThis subcommand also handles copyright headers that have only a single year. In\nthose cases:\n```\n// Copyright (c) <year> The Bitcoin Core developers\n```\nwill be updated to:\n```\n// Copyright (c) <year>-<lastModifiedYear> The Bitcoin Core developers\n```\nwhere the update is appropriate.\n\ncopyright\\_header.py insert \\<file\\>\n------------------------------------\nInserts a copyright header for `The Bitcoin Core developers` at the top of the\nfile in either Python or C++ style as determined by the file extension. If the\nfile is a Python file and it has  `#!` starting the first line, the header is\ninserted in the line below it.\n\nThe copyright dates will be set to be `<year_introduced>-<current_year>` where\n`<year_introduced>` is according to the `git log` history. If\n`<year_introduced>` is equal to `<current_year>`, it will be set as a single\nyear rather than two hyphenated years.\n\nIf the file already has a copyright for `The Bitcoin Core developers`, the\nscript will exit.\n\ngen-manpages.sh\n===============\n\nA small script to automatically create manpages in ../../doc/man by running the release binaries with the -help option.\nThis requires help2man which can be found at: https://www.gnu.org/software/help2man/\n\ngit-subtree-check.sh\n====================\n\nRun this script from the root of the repository to verify that a subtree matches the contents of\nthe commit it claims to have been updated to.\n\nTo use, make sure that you have fetched the upstream repository branch in which the subtree is\nmaintained:\n* for `src/secp256k1`: https://github.com/bitcoin-core/secp256k1.git (branch master)\n* for `src/leveldb`: https://github.com/bitcoin-core/leveldb.git (branch bitcoin-fork)\n* for `src/univalue`: https://github.com/bitcoin-core/univalue.git (branch master)\n* for `src/crypto/ctaes`: https://github.com/bitcoin-core/ctaes.git (branch master)\n\nUsage: `git-subtree-check.sh DIR (COMMIT)`\n\n`COMMIT` may be omitted, in which case `HEAD` is used.\n\ngithub-merge.py\n===============\n\nA small script to automate merging pull-requests securely and sign them with GPG.\n\nFor example:\n\n  ./github-merge.py 3077\n\n(in any git repository) will help you merge pull request #3077 for the\nbitcoin/bitcoin repository.\n\nWhat it does:\n* Fetch master and the pull request.\n* Locally construct a merge commit.\n* Show the diff that merge results in.\n* Ask you to verify the resulting source tree (so you can do a make\ncheck or whatever).\n* Ask you whether to GPG sign the merge commit.\n* Ask you whether to push the result upstream.\n\nThis means that there are no potential race conditions (where a\npullreq gets updated while you're reviewing it, but before you click\nmerge), and when using GPG signatures, that even a compromised GitHub\ncouldn't mess with the sources.\n\nSetup\n---------\nConfiguring the github-merge tool for the bitcoin repository is done in the following way:\n\n    git config githubmerge.repository bitcoin/bitcoin\n    git config githubmerge.testcmd \"make -j4 check\" (adapt to whatever you want to use for testing)\n    git config --global user.signingkey mykeyid (if you want to GPG sign)\n\noptimize-pngs.py\n================\n\nA script to optimize png files in the bitcoin\nrepository (requires pngcrush).\n\nsecurity-check.py and test-security-check.py\n============================================\n\nPerform basic ELF security checks on a series of executables.\n\nsymbol-check.py\n===============\n\nA script to check that the (Linux) executables produced by gitian only contain\nallowed gcc, glibc and libstdc++ version symbols. This makes sure they are\nstill compatible with the minimum supported Linux distribution versions.\n\nExample usage after a gitian build:\n\n    find ../gitian-builder/build -type f -executable | xargs python contrib/devtools/symbol-check.py \n\nIf only supported symbols are used the return value will be 0 and the output will be empty.\n\nIf there are 'unsupported' symbols, the return value will be 1 a list like this will be printed:\n\n    .../64/test_bitcoin: symbol memcpy from unsupported version GLIBC_2.14\n    .../64/test_bitcoin: symbol __fdelt_chk from unsupported version GLIBC_2.15\n    .../64/test_bitcoin: symbol std::out_of_range::~out_of_range() from unsupported version GLIBCXX_3.4.15\n    .../64/test_bitcoin: symbol _ZNSt8__detail15_List_nod from unsupported version GLIBCXX_3.4.15\n\nupdate-translations.py\n======================\n\nRun this script from the root of the repository to update all translations from transifex.\nIt will do the following automatically:\n\n- fetch all translations\n- post-process them into valid and committable format\n- add missing translations to the build system (TODO)\n\nSee doc/translation-process.md for more information.\n"
  },
  {
    "path": "contrib/devtools/check-doc.py",
    "content": "#!/usr/bin/env python\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n'''\nThis checks if all command line args are documented.\nReturn value is 0 to indicate no error.\n\nAuthor: @MarcoFalke\n'''\n\nfrom subprocess import check_output\nimport re\nimport sys\n\nFOLDER_GREP = 'src'\nFOLDER_TEST = 'src/test/'\nCMD_ROOT_DIR = '`git rev-parse --show-toplevel`/%s' % FOLDER_GREP\nCMD_GREP_ARGS = r\"egrep -r -I '(map(Multi)?Args(\\.count\\(|\\[)|Get(Bool)?Arg\\()\\\"\\-[^\\\"]+?\\\"' %s | grep -v '%s'\" % (CMD_ROOT_DIR, FOLDER_TEST)\nCMD_GREP_DOCS = r\"egrep -r -I 'HelpMessageOpt\\(\\\"\\-[^\\\"=]+?(=|\\\")' %s\" % (CMD_ROOT_DIR)\nREGEX_ARG = re.compile(r'(?:map(?:Multi)?Args(?:\\.count\\(|\\[)|Get(?:Bool)?Arg\\()\\\"(\\-[^\\\"]+?)\\\"')\nREGEX_DOC = re.compile(r'HelpMessageOpt\\(\\\"(\\-[^\\\"=]+?)(?:=|\\\")')\n# list unsupported, deprecated and duplicate args as they need no documentation\nSET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay', '-prematurewitness', '-walletprematurewitness', '-promiscuousmempoolflags', '-blockminsize', '-dbcrashratio', '-forcecompactdb', '-usehd'])\n\ndef main():\n  used = check_output(CMD_GREP_ARGS, shell=True)\n  docd = check_output(CMD_GREP_DOCS, shell=True)\n\n  args_used = set(re.findall(REGEX_ARG,used))\n  args_docd = set(re.findall(REGEX_DOC,docd)).union(SET_DOC_OPTIONAL)\n  args_need_doc = args_used.difference(args_docd)\n  args_unknown = args_docd.difference(args_used)\n\n  print \"Args used        : %s\" % len(args_used)\n  print \"Args documented  : %s\" % len(args_docd)\n  print \"Args undocumented: %s\" % len(args_need_doc)\n  print args_need_doc\n  print \"Args unknown     : %s\" % len(args_unknown)\n  print args_unknown\n\n  sys.exit(len(args_need_doc))\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "contrib/devtools/check-rpc-mappings.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Check RPC argument consistency.\"\"\"\n\nfrom collections import defaultdict\nimport os\nimport re\nimport sys\n\n# Source files (relative to root) to scan for dispatch tables\nSOURCES = [\n    \"src/rpc/server.cpp\",\n    \"src/rpc/blockchain.cpp\",\n    \"src/rpc/mining.cpp\",\n    \"src/rpc/misc.cpp\",\n    \"src/rpc/net.cpp\",\n    \"src/rpc/rawtransaction.cpp\",\n    \"src/wallet/rpcwallet.cpp\",\n]\n# Source file (relative to root) containing conversion mapping\nSOURCE_CLIENT = 'src/rpc/client.cpp'\n# Argument names that should be ignored in consistency checks\nIGNORE_DUMMY_ARGS = {'dummy', 'arg0', 'arg1', 'arg2', 'arg3', 'arg4', 'arg5', 'arg6', 'arg7', 'arg8', 'arg9'}\n\nclass RPCCommand:\n    def __init__(self, name, args):\n        self.name = name\n        self.args = args\n\nclass RPCArgument:\n    def __init__(self, names, idx):\n        self.names = names\n        self.idx = idx\n        self.convert = False\n\ndef parse_string(s):\n    assert s[0] == '\"'\n    assert s[-1] == '\"'\n    return s[1:-1]\n\ndef process_commands(fname):\n    \"\"\"Find and parse dispatch table in implementation file `fname`.\"\"\"\n    cmds = []\n    in_rpcs = False\n    with open(fname, \"r\") as f:\n        for line in f:\n            line = line.rstrip()\n            if not in_rpcs:\n                if re.match(\"static const CRPCCommand .*\\[\\] =\", line):\n                    in_rpcs = True\n            else:\n                if line.startswith('};'):\n                    in_rpcs = False\n                elif '{' in line and '\"' in line:\n                    m = re.search('{ *(\"[^\"]*\"), *(\"[^\"]*\"), *&([^,]*), *{([^}]*)} *},', line)\n                    assert m, 'No match to table expression: %s' % line\n                    name = parse_string(m.group(2))\n                    args_str = m.group(4).strip()\n                    if args_str:\n                        args = [RPCArgument(parse_string(x.strip()).split('|'), idx) for idx, x in enumerate(args_str.split(','))]\n                    else:\n                        args = []\n                    cmds.append(RPCCommand(name, args))\n    assert not in_rpcs and cmds, \"Something went wrong with parsing the C++ file: update the regexps\"\n    return cmds\n\ndef process_mapping(fname):\n    \"\"\"Find and parse conversion table in implementation file `fname`.\"\"\"\n    cmds = []\n    in_rpcs = False\n    with open(fname, \"r\") as f:\n        for line in f:\n            line = line.rstrip()\n            if not in_rpcs:\n                if line == 'static const CRPCConvertParam vRPCConvertParams[] =':\n                    in_rpcs = True\n            else:\n                if line.startswith('};'):\n                    in_rpcs = False\n                elif '{' in line and '\"' in line:\n                    m = re.search('{ *(\"[^\"]*\"), *([0-9]+) *, *(\"[^\"]*\") *},', line)\n                    assert m, 'No match to table expression: %s' % line\n                    name = parse_string(m.group(1))\n                    idx = int(m.group(2))\n                    argname = parse_string(m.group(3))\n                    cmds.append((name, idx, argname))\n    assert not in_rpcs and cmds\n    return cmds\n\ndef main():\n    root = sys.argv[1]\n\n    # Get all commands from dispatch tables\n    cmds = []\n    for fname in SOURCES:\n        cmds += process_commands(os.path.join(root, fname))\n\n    cmds_by_name = {}\n    for cmd in cmds:\n        cmds_by_name[cmd.name] = cmd\n\n    # Get current convert mapping for client\n    client = SOURCE_CLIENT\n    mapping = set(process_mapping(os.path.join(root, client)))\n\n    print('* Checking consistency between dispatch tables and vRPCConvertParams')\n\n    # Check mapping consistency\n    errors = 0\n    for (cmdname, argidx, argname) in mapping:\n        try:\n            rargnames = cmds_by_name[cmdname].args[argidx].names\n        except IndexError:\n            print('ERROR: %s argument %i (named %s in vRPCConvertParams) is not defined in dispatch table' % (cmdname, argidx, argname))\n            errors += 1\n            continue\n        if argname not in rargnames:\n            print('ERROR: %s argument %i is named %s in vRPCConvertParams but %s in dispatch table' % (cmdname, argidx, argname, rargnames), file=sys.stderr)\n            errors += 1\n\n    # Check for conflicts in vRPCConvertParams conversion\n    # All aliases for an argument must either be present in the\n    # conversion table, or not. Anything in between means an oversight\n    # and some aliases won't work.\n    for cmd in cmds:\n        for arg in cmd.args:\n            convert = [((cmd.name, arg.idx, argname) in mapping) for argname in arg.names]\n            if any(convert) != all(convert):\n                print('ERROR: %s argument %s has conflicts in vRPCConvertParams conversion specifier %s' % (cmd.name, arg.names, convert))\n                errors += 1\n            arg.convert = all(convert)\n\n    # Check for conversion difference by argument name.\n    # It is preferable for API consistency that arguments with the same name\n    # have the same conversion, so bin by argument name.\n    all_methods_by_argname = defaultdict(list)\n    converts_by_argname = defaultdict(list)\n    for cmd in cmds:\n        for arg in cmd.args:\n            for argname in arg.names:\n                all_methods_by_argname[argname].append(cmd.name)\n                converts_by_argname[argname].append(arg.convert)\n\n    for argname, convert in converts_by_argname.items():\n        if all(convert) != any(convert):\n            if argname in IGNORE_DUMMY_ARGS:\n                # these are testing or dummy, don't warn for them\n                continue\n            print('WARNING: conversion mismatch for argument named %s (%s)' %\n                  (argname, list(zip(all_methods_by_argname[argname], converts_by_argname[argname]))))\n\n    sys.exit(errors > 0)\n\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "contrib/devtools/clang-format-diff.py",
    "content": "#!/usr/bin/env python\n#\n#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#\n#\n#                     The LLVM Compiler Infrastructure\n#\n# This file is distributed under the University of Illinois Open Source\n# License.\n#\n#           ============================================================\n#\n# University of Illinois/NCSA\n# Open Source License\n#\n# Copyright (c) 2007-2015 University of Illinois at Urbana-Champaign.\n# All rights reserved.\n#\n# Developed by:\n#\n#     LLVM Team\n#\n#     University of Illinois at Urbana-Champaign\n#\n#     http://llvm.org\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal with\n# the Software without restriction, including without limitation the rights to\n# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n# of the Software, and to permit persons to whom the Software is furnished to do\n# so, subject to the following conditions:\n#\n#     * Redistributions of source code must retain the above copyright notice,\n#       this list of conditions and the following disclaimers.\n#\n#     * Redistributions in binary form must reproduce the above copyright notice,\n#       this list of conditions and the following disclaimers in the\n#       documentation and/or other materials provided with the distribution.\n#\n#     * Neither the names of the LLVM Team, University of Illinois at\n#       Urbana-Champaign, nor the names of its contributors may be used to\n#       endorse or promote products derived from this Software without specific\n#       prior written permission.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n# CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE\n# SOFTWARE.\n#\n#           ============================================================\n#\n#===------------------------------------------------------------------------===#\n\nr\"\"\"\nClangFormat Diff Reformatter\n============================\n\nThis script reads input from a unified diff and reformats all the changed\nlines. This is useful to reformat all the lines touched by a specific patch.\nExample usage for git/svn users:\n\n  git diff -U0 HEAD^ | clang-format-diff.py -p1 -i\n  svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i\n\n\"\"\"\n\nimport argparse\nimport difflib\nimport re\nimport string\nimport subprocess\nimport StringIO\nimport sys\n\n\n# Change this to the full path if clang-format is not on the path.\nbinary = 'clang-format'\n\n\ndef main():\n  parser = argparse.ArgumentParser(description=\n                                   'Reformat changed lines in diff. Without -i '\n                                   'option just output the diff that would be '\n                                   'introduced.')\n  parser.add_argument('-i', action='store_true', default=False,\n                      help='apply edits to files instead of displaying a diff')\n  parser.add_argument('-p', metavar='NUM', default=0,\n                      help='strip the smallest prefix containing P slashes')\n  parser.add_argument('-regex', metavar='PATTERN', default=None,\n                      help='custom pattern selecting file paths to reformat '\n                      '(case sensitive, overrides -iregex)')\n  parser.add_argument('-iregex', metavar='PATTERN', default=\n                      r'.*\\.(cpp|cc|c\\+\\+|cxx|c|cl|h|hpp|m|mm|inc|js|ts|proto'\n                      r'|protodevel|java)',\n                      help='custom pattern selecting file paths to reformat '\n                      '(case insensitive, overridden by -regex)')\n  parser.add_argument('-sort-includes', action='store_true', default=False,\n                      help='let clang-format sort include blocks')\n  parser.add_argument('-v', '--verbose', action='store_true',\n                      help='be more verbose, ineffective without -i')\n  args = parser.parse_args()\n\n  # Extract changed lines for each file.\n  filename = None\n  lines_by_file = {}\n  for line in sys.stdin:\n    match = re.search('^\\+\\+\\+\\ (.*?/){%s}(\\S*)' % args.p, line)\n    if match:\n      filename = match.group(2)\n    if filename == None:\n      continue\n\n    if args.regex is not None:\n      if not re.match('^%s$' % args.regex, filename):\n        continue\n    else:\n      if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):\n        continue\n\n    match = re.search('^@@.*\\+(\\d+)(,(\\d+))?', line)\n    if match:\n      start_line = int(match.group(1))\n      line_count = 1\n      if match.group(3):\n        line_count = int(match.group(3))\n      if line_count == 0:\n        continue\n      end_line = start_line + line_count - 1\n      lines_by_file.setdefault(filename, []).extend(\n          ['-lines', str(start_line) + ':' + str(end_line)])\n\n  # Reformat files containing changes in place.\n  for filename, lines in lines_by_file.iteritems():\n    if args.i and args.verbose:\n      print 'Formatting', filename\n    command = [binary, filename]\n    if args.i:\n      command.append('-i')\n    if args.sort_includes:\n      command.append('-sort-includes')\n    command.extend(lines)\n    command.extend(['-style=file', '-fallback-style=none'])\n    p = subprocess.Popen(command, stdout=subprocess.PIPE,\n                         stderr=None, stdin=subprocess.PIPE)\n    stdout, stderr = p.communicate()\n    if p.returncode != 0:\n      sys.exit(p.returncode)\n\n    if not args.i:\n      with open(filename) as f:\n        code = f.readlines()\n      formatted_code = StringIO.StringIO(stdout).readlines()\n      diff = difflib.unified_diff(code, formatted_code,\n                                  filename, filename,\n                                  '(before formatting)', '(after formatting)')\n      diff_string = string.join(diff, '')\n      if len(diff_string) > 0:\n        sys.stdout.write(diff_string)\n\nif __name__ == '__main__':\n  main()\n"
  },
  {
    "path": "contrib/devtools/commit-script-check.sh",
    "content": "#!/bin/sh\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n# This simple script checks for commits beginning with: scripted-diff:\n# If found, looks for a script between the lines -BEGIN VERIFY SCRIPT- and\n# -END VERIFY SCRIPT-. If no ending is found, it reads until the end of the\n# commit message.\n\n# The resulting script should exactly transform the previous commit into the current\n# one. Any remaining diff signals an error.\n\nif test \"x$1\" = \"x\"; then\n    echo \"Usage: $0 <commit>...\"\n    exit 1\nfi\n\nRET=0\nPREV_BRANCH=`git name-rev --name-only HEAD`\nPREV_HEAD=`git rev-parse HEAD`\nfor i in `git rev-list --reverse $1`; do\n    if git rev-list -n 1 --pretty=\"%s\" $i | grep -q \"^scripted-diff:\"; then\n        git checkout --quiet $i^ || exit\n        SCRIPT=\"`git rev-list --format=%b -n1 $i | sed '/^-BEGIN VERIFY SCRIPT-$/,/^-END VERIFY SCRIPT-$/{//!b};d'`\"\n        if test \"x$SCRIPT\" = \"x\"; then\n            echo \"Error: missing script for: $i\"\n            echo \"Failed\"\n            RET=1\n        else\n            echo \"Running script for: $i\"\n            echo \"$SCRIPT\"\n            eval \"$SCRIPT\"\n            git --no-pager diff --exit-code $i && echo \"OK\" || (echo \"Failed\"; false) || RET=1\n        fi\n        git reset --quiet --hard HEAD\n     else\n        if git rev-list \"--format=%b\" -n1 $i | grep -q '^-\\(BEGIN\\|END\\)[ a-zA-Z]*-$'; then\n            echo \"Error: script block marker but no scripted-diff in title\"\n            echo \"Failed\"\n            RET=1\n        fi\n    fi\ndone\ngit checkout --quiet $PREV_BRANCH 2>/dev/null || git checkout --quiet $PREV_HEAD\nexit $RET\n"
  },
  {
    "path": "contrib/devtools/copyright_header.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nimport re\nimport fnmatch\nimport sys\nimport subprocess\nimport datetime\nimport os\n\n################################################################################\n# file filtering\n################################################################################\n\nEXCLUDE = [\n    # libsecp256k1:\n    'src/secp256k1/include/secp256k1.h',\n    'src/secp256k1/include/secp256k1_ecdh.h',\n    'src/secp256k1/include/secp256k1_recovery.h',\n    'src/secp256k1/include/secp256k1_schnorr.h',\n    'src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c',\n    'src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h',\n    'src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c',\n    'src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h',\n    # univalue:\n    'src/univalue/test/object.cpp',\n    'src/univalue/lib/univalue_escapes.h',\n    # auto generated:\n    'src/qt/bitcoinstrings.cpp',\n    'src/chainparamsseeds.h',\n    # other external copyrights:\n    'src/tinyformat.h',\n    'src/leveldb/util/env_win.cc',\n    'src/crypto/ctaes/bench.c',\n    'test/functional/test_framework/bignum.py',\n    # python init:\n    '*__init__.py',\n]\nEXCLUDE_COMPILED = re.compile('|'.join([fnmatch.translate(m) for m in EXCLUDE]))\n\nINCLUDE = ['*.h', '*.cpp', '*.cc', '*.c', '*.py']\nINCLUDE_COMPILED = re.compile('|'.join([fnmatch.translate(m) for m in INCLUDE]))\n\ndef applies_to_file(filename):\n    return ((EXCLUDE_COMPILED.match(filename) is None) and\n            (INCLUDE_COMPILED.match(filename) is not None))\n\n################################################################################\n# obtain list of files in repo according to INCLUDE and EXCLUDE\n################################################################################\n\nGIT_LS_CMD = 'git ls-files'\n\ndef call_git_ls():\n    out = subprocess.check_output(GIT_LS_CMD.split(' '))\n    return [f for f in out.decode(\"utf-8\").split('\\n') if f != '']\n\ndef get_filenames_to_examine():\n    filenames = call_git_ls()\n    return sorted([filename for filename in filenames if\n                   applies_to_file(filename)])\n\n################################################################################\n# define and compile regexes for the patterns we are looking for\n################################################################################\n\n\nCOPYRIGHT_WITH_C = 'Copyright \\(c\\)'\nCOPYRIGHT_WITHOUT_C = 'Copyright'\nANY_COPYRIGHT_STYLE = '(%s|%s)' % (COPYRIGHT_WITH_C, COPYRIGHT_WITHOUT_C)\n\nYEAR = \"20[0-9][0-9]\"\nYEAR_RANGE = '(%s)(-%s)?' % (YEAR, YEAR)\nYEAR_LIST = '(%s)(, %s)+' % (YEAR, YEAR)\nANY_YEAR_STYLE = '(%s|%s)' % (YEAR_RANGE, YEAR_LIST)\nANY_COPYRIGHT_STYLE_OR_YEAR_STYLE = (\"%s %s\" % (ANY_COPYRIGHT_STYLE,\n                                                ANY_YEAR_STYLE))\n\nANY_COPYRIGHT_COMPILED = re.compile(ANY_COPYRIGHT_STYLE_OR_YEAR_STYLE)\n\ndef compile_copyright_regex(copyright_style, year_style, name):\n    return re.compile('%s %s %s' % (copyright_style, year_style, name))\n\nEXPECTED_HOLDER_NAMES = [\n    \"Satoshi Nakamoto\\n\",\n    \"The Bitcoin Core developers\\n\",\n    \"The Bitcoin Core developers \\n\",\n    \"Bitcoin Core Developers\\n\",\n    \"the Bitcoin Core developers\\n\",\n    \"The Bitcoin developers\\n\",\n    \"The LevelDB Authors\\. All rights reserved\\.\\n\",\n    \"BitPay Inc\\.\\n\",\n    \"BitPay, Inc\\.\\n\",\n    \"University of Illinois at Urbana-Champaign\\.\\n\",\n    \"MarcoFalke\\n\",\n    \"Pieter Wuille\\n\",\n    \"Pieter Wuille +\\*\\n\",\n    \"Pieter Wuille, Gregory Maxwell +\\*\\n\",\n    \"Pieter Wuille, Andrew Poelstra +\\*\\n\",\n    \"Andrew Poelstra +\\*\\n\",\n    \"Wladimir J. van der Laan\\n\",\n    \"Jeff Garzik\\n\",\n    \"Diederik Huys, Pieter Wuille +\\*\\n\",\n    \"Thomas Daede, Cory Fields +\\*\\n\",\n    \"Jan-Klaas Kollhof\\n\",\n    \"Sam Rushing\\n\",\n    \"ArtForz -- public domain half-a-node\\n\",\n]\n\nDOMINANT_STYLE_COMPILED = {}\nYEAR_LIST_STYLE_COMPILED = {}\nWITHOUT_C_STYLE_COMPILED = {}\n\nfor holder_name in EXPECTED_HOLDER_NAMES:\n    DOMINANT_STYLE_COMPILED[holder_name] = (\n        compile_copyright_regex(COPYRIGHT_WITH_C, YEAR_RANGE, holder_name))\n    YEAR_LIST_STYLE_COMPILED[holder_name] = (\n        compile_copyright_regex(COPYRIGHT_WITH_C, YEAR_LIST, holder_name))\n    WITHOUT_C_STYLE_COMPILED[holder_name] = (\n        compile_copyright_regex(COPYRIGHT_WITHOUT_C, ANY_YEAR_STYLE,\n                                holder_name))\n\n################################################################################\n# search file contents for copyright message of particular category\n################################################################################\n\ndef get_count_of_copyrights_of_any_style_any_holder(contents):\n    return len(ANY_COPYRIGHT_COMPILED.findall(contents))\n\ndef file_has_dominant_style_copyright_for_holder(contents, holder_name):\n    match = DOMINANT_STYLE_COMPILED[holder_name].search(contents)\n    return match is not None\n\ndef file_has_year_list_style_copyright_for_holder(contents, holder_name):\n    match = YEAR_LIST_STYLE_COMPILED[holder_name].search(contents)\n    return match is not None\n\ndef file_has_without_c_style_copyright_for_holder(contents, holder_name):\n    match = WITHOUT_C_STYLE_COMPILED[holder_name].search(contents)\n    return match is not None\n\n################################################################################\n# get file info\n################################################################################\n\ndef read_file(filename):\n    return open(os.path.abspath(filename), 'r').read()\n\ndef gather_file_info(filename):\n    info = {}\n    info['filename'] = filename\n    c = read_file(filename)\n    info['contents'] = c\n\n    info['all_copyrights'] = get_count_of_copyrights_of_any_style_any_holder(c)\n\n    info['classified_copyrights'] = 0\n    info['dominant_style'] = {}\n    info['year_list_style'] = {}\n    info['without_c_style'] = {}\n    for holder_name in EXPECTED_HOLDER_NAMES:\n        has_dominant_style = (\n            file_has_dominant_style_copyright_for_holder(c, holder_name))\n        has_year_list_style = (\n            file_has_year_list_style_copyright_for_holder(c, holder_name))\n        has_without_c_style = (\n            file_has_without_c_style_copyright_for_holder(c, holder_name))\n        info['dominant_style'][holder_name] = has_dominant_style\n        info['year_list_style'][holder_name] = has_year_list_style\n        info['without_c_style'][holder_name] = has_without_c_style\n        if has_dominant_style or has_year_list_style or has_without_c_style:\n            info['classified_copyrights'] = info['classified_copyrights'] + 1\n    return info\n\n################################################################################\n# report execution\n################################################################################\n\nSEPARATOR = '-'.join(['' for _ in range(80)])\n\ndef print_filenames(filenames, verbose):\n    if not verbose:\n        return\n    for filename in filenames:\n        print(\"\\t%s\" % filename)\n\ndef print_report(file_infos, verbose):\n    print(SEPARATOR)\n    examined = [i['filename'] for i in file_infos]\n    print(\"%d files examined according to INCLUDE and EXCLUDE fnmatch rules\" %\n          len(examined))\n    print_filenames(examined, verbose)\n\n    print(SEPARATOR)\n    print('')\n    zero_copyrights = [i['filename'] for i in file_infos if\n                       i['all_copyrights'] == 0]\n    print(\"%4d with zero copyrights\" % len(zero_copyrights))\n    print_filenames(zero_copyrights, verbose)\n    one_copyright = [i['filename'] for i in file_infos if\n                     i['all_copyrights'] == 1]\n    print(\"%4d with one copyright\" % len(one_copyright))\n    print_filenames(one_copyright, verbose)\n    two_copyrights = [i['filename'] for i in file_infos if\n                      i['all_copyrights'] == 2]\n    print(\"%4d with two copyrights\" % len(two_copyrights))\n    print_filenames(two_copyrights, verbose)\n    three_copyrights = [i['filename'] for i in file_infos if\n                        i['all_copyrights'] == 3]\n    print(\"%4d with three copyrights\" % len(three_copyrights))\n    print_filenames(three_copyrights, verbose)\n    four_or_more_copyrights = [i['filename'] for i in file_infos if\n                               i['all_copyrights'] >= 4]\n    print(\"%4d with four or more copyrights\" % len(four_or_more_copyrights))\n    print_filenames(four_or_more_copyrights, verbose)\n    print('')\n    print(SEPARATOR)\n    print('Copyrights with dominant style:\\ne.g. \"Copyright (c)\" and '\n          '\"<year>\" or \"<startYear>-<endYear>\":\\n')\n    for holder_name in EXPECTED_HOLDER_NAMES:\n        dominant_style = [i['filename'] for i in file_infos if\n                          i['dominant_style'][holder_name]]\n        if len(dominant_style) > 0:\n            print(\"%4d with '%s'\" % (len(dominant_style),\n                                     holder_name.replace('\\n', '\\\\n')))\n            print_filenames(dominant_style, verbose)\n    print('')\n    print(SEPARATOR)\n    print('Copyrights with year list style:\\ne.g. \"Copyright (c)\" and '\n          '\"<year1>, <year2>, ...\":\\n')\n    for holder_name in EXPECTED_HOLDER_NAMES:\n        year_list_style = [i['filename'] for i in file_infos if\n                           i['year_list_style'][holder_name]]\n        if len(year_list_style) > 0:\n            print(\"%4d with '%s'\" % (len(year_list_style),\n                                     holder_name.replace('\\n', '\\\\n')))\n            print_filenames(year_list_style, verbose)\n    print('')\n    print(SEPARATOR)\n    print('Copyrights with no \"(c)\" style:\\ne.g. \"Copyright\" and \"<year>\" or '\n          '\"<startYear>-<endYear>\":\\n')\n    for holder_name in EXPECTED_HOLDER_NAMES:\n        without_c_style = [i['filename'] for i in file_infos if\n                           i['without_c_style'][holder_name]]\n        if len(without_c_style) > 0:\n            print(\"%4d with '%s'\" % (len(without_c_style),\n                                     holder_name.replace('\\n', '\\\\n')))\n            print_filenames(without_c_style, verbose)\n\n    print('')\n    print(SEPARATOR)\n\n    unclassified_copyrights = [i['filename'] for i in file_infos if\n                               i['classified_copyrights'] < i['all_copyrights']]\n    print(\"%d with unexpected copyright holder names\" %\n          len(unclassified_copyrights))\n    print_filenames(unclassified_copyrights, verbose)\n    print(SEPARATOR)\n\ndef exec_report(base_directory, verbose):\n    original_cwd = os.getcwd()\n    os.chdir(base_directory)\n    filenames = get_filenames_to_examine()\n    file_infos = [gather_file_info(f) for f in filenames]\n    print_report(file_infos, verbose)\n    os.chdir(original_cwd)\n\n################################################################################\n# report cmd\n################################################################################\n\nREPORT_USAGE = \"\"\"\nProduces a report of all copyright header notices found inside the source files\nof a repository.\n\nUsage:\n    $ ./copyright_header.py report <base_directory> [verbose]\n\nArguments:\n    <base_directory> - The base directory of a bitcoin source code repository.\n    [verbose] - Includes a list of every file of each subcategory in the report.\n\"\"\"\n\ndef report_cmd(argv):\n    if len(argv) == 2:\n        sys.exit(REPORT_USAGE)\n        \n    base_directory = argv[2]\n    if not os.path.exists(base_directory):\n        sys.exit(\"*** bad <base_directory>: %s\" % base_directory)\n\n    if len(argv) == 3:\n        verbose = False\n    elif argv[3] == 'verbose':\n        verbose = True\n    else:\n        sys.exit(\"*** unknown argument: %s\" % argv[2])\n\n    exec_report(base_directory, verbose)\n\n################################################################################\n# query git for year of last change\n################################################################################\n\nGIT_LOG_CMD = \"git log --pretty=format:%%ai %s\"\n\ndef call_git_log(filename):\n    out = subprocess.check_output((GIT_LOG_CMD % filename).split(' '))\n    return out.decode(\"utf-8\").split('\\n')\n\ndef get_git_change_years(filename):\n    git_log_lines = call_git_log(filename)\n    if len(git_log_lines) == 0:\n        return [datetime.date.today().year]\n    # timestamp is in ISO 8601 format. e.g. \"2016-09-05 14:25:32 -0600\"\n    return [line.split(' ')[0].split('-')[0] for line in git_log_lines]\n\ndef get_most_recent_git_change_year(filename):\n    return max(get_git_change_years(filename))\n\n################################################################################\n# read and write to file\n################################################################################\n\ndef read_file_lines(filename):\n    f = open(os.path.abspath(filename), 'r')\n    file_lines = f.readlines()\n    f.close()\n    return file_lines\n\ndef write_file_lines(filename, file_lines):\n    f = open(os.path.abspath(filename), 'w')\n    f.write(''.join(file_lines))\n    f.close()\n\n################################################################################\n# update header years execution\n################################################################################\n\nCOPYRIGHT = 'Copyright \\(c\\)'\nYEAR = \"20[0-9][0-9]\"\nYEAR_RANGE = '(%s)(-%s)?' % (YEAR, YEAR)\nHOLDER = 'The Bitcoin Core developers'\nUPDATEABLE_LINE_COMPILED = re.compile(' '.join([COPYRIGHT, YEAR_RANGE, HOLDER]))\n\ndef get_updatable_copyright_line(file_lines):\n    index = 0\n    for line in file_lines:\n        if UPDATEABLE_LINE_COMPILED.search(line) is not None:\n            return index, line\n        index = index + 1\n    return None, None\n\ndef parse_year_range(year_range):\n    year_split = year_range.split('-')\n    start_year = year_split[0]\n    if len(year_split) == 1:\n        return start_year, start_year\n    return start_year, year_split[1]\n\ndef year_range_to_str(start_year, end_year):\n    if start_year == end_year:\n        return start_year\n    return \"%s-%s\" % (start_year, end_year)\n\ndef create_updated_copyright_line(line, last_git_change_year):\n    copyright_splitter = 'Copyright (c) '\n    copyright_split = line.split(copyright_splitter)\n    # Preserve characters on line that are ahead of the start of the copyright\n    # notice - they are part of the comment block and vary from file-to-file.\n    before_copyright = copyright_split[0]\n    after_copyright = copyright_split[1]\n\n    space_split = after_copyright.split(' ')\n    year_range = space_split[0]\n    start_year, end_year = parse_year_range(year_range)\n    if end_year == last_git_change_year:\n        return line\n    return (before_copyright + copyright_splitter +\n            year_range_to_str(start_year, last_git_change_year) + ' ' +\n            ' '.join(space_split[1:]))\n\ndef update_updatable_copyright(filename):\n    file_lines = read_file_lines(filename)\n    index, line = get_updatable_copyright_line(file_lines)\n    if not line:\n        print_file_action_message(filename, \"No updatable copyright.\")\n        return\n    last_git_change_year = get_most_recent_git_change_year(filename)\n    new_line = create_updated_copyright_line(line, last_git_change_year)\n    if line == new_line:\n        print_file_action_message(filename, \"Copyright up-to-date.\")\n        return\n    file_lines[index] = new_line\n    write_file_lines(filename, file_lines)\n    print_file_action_message(filename,\n                              \"Copyright updated! -> %s\" % last_git_change_year)\n\ndef exec_update_header_year(base_directory):\n    original_cwd = os.getcwd()\n    os.chdir(base_directory)\n    for filename in get_filenames_to_examine():\n        update_updatable_copyright(filename)\n    os.chdir(original_cwd)\n\n################################################################################\n# update cmd\n################################################################################\n\nUPDATE_USAGE = \"\"\"\nUpdates all the copyright headers of \"The Bitcoin Core developers\" which were\nchanged in a year more recent than is listed. For example:\n\n// Copyright (c) <firstYear>-<lastYear> The Bitcoin Core developers\n\nwill be updated to:\n\n// Copyright (c) <firstYear>-<lastModifiedYear> The Bitcoin Core developers\n\nwhere <lastModifiedYear> is obtained from the 'git log' history.\n\nThis subcommand also handles copyright headers that have only a single year. In those cases:\n\n// Copyright (c) <year> The Bitcoin Core developers\n\nwill be updated to:\n\n// Copyright (c) <year>-<lastModifiedYear> The Bitcoin Core developers\n\nwhere the update is appropriate.\n\nUsage:\n    $ ./copyright_header.py update <base_directory>\n\nArguments:\n    <base_directory> - The base directory of a bitcoin source code repository.\n\"\"\"\n\ndef print_file_action_message(filename, action):\n    print(\"%-52s %s\" % (filename, action))\n\ndef update_cmd(argv):\n    if len(argv) != 3:\n        sys.exit(UPDATE_USAGE)\n    \n    base_directory = argv[2]\n    if not os.path.exists(base_directory):\n        sys.exit(\"*** bad base_directory: %s\" % base_directory)\n    exec_update_header_year(base_directory)\n\n################################################################################\n# inserted copyright header format\n################################################################################\n\ndef get_header_lines(header, start_year, end_year):\n    lines = header.split('\\n')[1:-1]\n    lines[0] = lines[0] % year_range_to_str(start_year, end_year)\n    return [line + '\\n' for line in lines]\n\nCPP_HEADER = '''\n// Copyright (c) %s The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\n\ndef get_cpp_header_lines_to_insert(start_year, end_year):\n    return reversed(get_header_lines(CPP_HEADER, start_year, end_year))\n\nPYTHON_HEADER = '''\n# Copyright (c) %s The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\n\ndef get_python_header_lines_to_insert(start_year, end_year):\n    return reversed(get_header_lines(PYTHON_HEADER, start_year, end_year))\n\n################################################################################\n# query git for year of last change\n################################################################################\n\ndef get_git_change_year_range(filename):\n    years = get_git_change_years(filename)\n    return min(years), max(years)\n\n################################################################################\n# check for existing core copyright\n################################################################################\n\ndef file_already_has_core_copyright(file_lines):\n    index, _ = get_updatable_copyright_line(file_lines)\n    return index != None\n\n################################################################################\n# insert header execution\n################################################################################\n\ndef file_has_hashbang(file_lines):\n    if len(file_lines) < 1:\n        return False\n    if len(file_lines[0]) <= 2:\n        return False\n    return file_lines[0][:2] == '#!'\n\ndef insert_python_header(filename, file_lines, start_year, end_year):\n    if file_has_hashbang(file_lines):\n        insert_idx = 1 \n    else:\n        insert_idx = 0\n    header_lines = get_python_header_lines_to_insert(start_year, end_year)\n    for line in header_lines:\n        file_lines.insert(insert_idx, line)\n    write_file_lines(filename, file_lines)\n\ndef insert_cpp_header(filename, file_lines, start_year, end_year):\n    header_lines = get_cpp_header_lines_to_insert(start_year, end_year)\n    for line in header_lines:\n        file_lines.insert(0, line)\n    write_file_lines(filename, file_lines)\n\ndef exec_insert_header(filename, style):\n    file_lines = read_file_lines(filename)\n    if file_already_has_core_copyright(file_lines):\n        sys.exit('*** %s already has a copyright by The Bitcoin Core developers'\n                 % (filename))\n    start_year, end_year = get_git_change_year_range(filename)\n    if style == 'python':\n        insert_python_header(filename, file_lines, start_year, end_year)\n    else:\n        insert_cpp_header(filename, file_lines, start_year, end_year)\n\n################################################################################\n# insert cmd\n################################################################################\n\nINSERT_USAGE = \"\"\"\nInserts a copyright header for \"The Bitcoin Core developers\" at the top of the\nfile in either Python or C++ style as determined by the file extension. If the\nfile is a Python file and it has a '#!' starting the first line, the header is\ninserted in the line below it.\n\nThe copyright dates will be set to be:\n\n\"<year_introduced>-<current_year>\"\n\nwhere <year_introduced> is according to the 'git log' history. If\n<year_introduced> is equal to <current_year>, the date will be set to be:\n\n\"<current_year>\"\n\nIf the file already has a copyright for \"The Bitcoin Core developers\", the\nscript will exit.\n\nUsage:\n    $ ./copyright_header.py insert <file>\n\nArguments:\n    <file> - A source file in the bitcoin repository.\n\"\"\"\n\ndef insert_cmd(argv):\n    if len(argv) != 3:\n        sys.exit(INSERT_USAGE)\n\n    filename = argv[2]\n    if not os.path.isfile(filename):\n        sys.exit(\"*** bad filename: %s\" % filename)\n    _, extension = os.path.splitext(filename)\n    if extension not in ['.h', '.cpp', '.cc', '.c', '.py']:\n        sys.exit(\"*** cannot insert for file extension %s\" % extension)\n   \n    if extension == '.py': \n        style = 'python'\n    else:\n        style = 'cpp'\n    exec_insert_header(filename, style)\n         \n################################################################################\n# UI\n################################################################################\n\nUSAGE = \"\"\"\ncopyright_header.py - utilities for managing copyright headers of 'The Bitcoin\nCore developers' in repository source files.\n\nUsage:\n    $ ./copyright_header <subcommand>\n\nSubcommands:\n    report\n    update\n    insert\n\nTo see subcommand usage, run them without arguments.\n\"\"\"\n\nSUBCOMMANDS = ['report', 'update', 'insert']\n\nif __name__ == \"__main__\":\n    if len(sys.argv) == 1:\n        sys.exit(USAGE)\n    subcommand = sys.argv[1]\n    if subcommand not in SUBCOMMANDS:\n        sys.exit(USAGE)\n    if subcommand == 'report':\n        report_cmd(sys.argv)\n    elif subcommand == 'update':\n        update_cmd(sys.argv)\n    elif subcommand == 'insert':\n        insert_cmd(sys.argv)\n"
  },
  {
    "path": "contrib/devtools/gen-manpages.sh",
    "content": "#!/bin/bash\n\nTOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)}\nSRCDIR=${SRCDIR:-$TOPDIR/src}\nMANDIR=${MANDIR:-$TOPDIR/doc/man}\n\nSUGARCHAIND=${SUGARCHAIND:-$SRCDIR/sugarchaind}\nSUGARCHAINCLI=${SUGARCHAINCLI:-$SRCDIR/sugarchain-cli}\nSUGARCHAINTX=${SUGARCHAINTX:-$SRCDIR/sugarchain-tx}\nSUGARCHAINQT=${SUGARCHAINQT:-$SRCDIR/qt/sugarchain-qt}\n\n[ ! -x $SUGARCHAIND ] && echo \"$SUGARCHAIND not found or not executable.\" && exit 1\n\n# The autodetected version git tag can screw up manpage output a little bit\nSUGARVER=($($SUGARCHAINCLI --version | head -n1 | awk -F'[ -]' '{ print $6, $7 }'))\n\n# Create a footer file with copyright content.\n# This gets autodetected fine for bitcoind if --version-string is not set,\n# but has different outcomes for bitcoin-qt and bitcoin-cli.\necho \"[COPYRIGHT]\" > footer.h2m\n$SUGARCHAIND --version | sed -n '1!p' >> footer.h2m\n\nfor cmd in $SUGARCHAIND $SUGARCHAINCLI $SUGARCHAINTX $SUGARCHAINQT; do\n  cmdname=\"${cmd##*/}\"\n  help2man -N --version-string=${SUGARVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd}\n  sed -i \"s/\\\\\\-${SUGARVER[1]}//g\" ${MANDIR}/${cmdname}.1\ndone\n\nrm -f footer.h2m\n"
  },
  {
    "path": "contrib/devtools/git-subtree-check.sh",
    "content": "#!/bin/sh\n# Copyright (c) 2015 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nDIR=\"$1\"\nCOMMIT=\"$2\"\nif [ -z \"$COMMIT\" ]; then\n    COMMIT=HEAD\nfi\n\n# Taken from git-subtree (Copyright (C) 2009 Avery Pennarun <apenwarr@gmail.com>)\nfind_latest_squash()\n{\n\tdir=\"$1\"\n\tsq=\n\tmain=\n\tsub=\n\tgit log --grep=\"^git-subtree-dir: $dir/*\\$\" \\\n\t\t--pretty=format:'START %H%n%s%n%n%b%nEND%n' \"$COMMIT\" |\n\twhile read a b _; do\n\t\tcase \"$a\" in\n\t\t\tSTART) sq=\"$b\" ;;\n\t\t\tgit-subtree-mainline:) main=\"$b\" ;;\n\t\t\tgit-subtree-split:) sub=\"$b\" ;;\n\t\t\tEND)\n\t\t\t\tif [ -n \"$sub\" ]; then\n\t\t\t\t\tif [ -n \"$main\" ]; then\n\t\t\t\t\t\t# a rejoin commit?\n\t\t\t\t\t\t# Pretend its sub was a squash.\n\t\t\t\t\t\tsq=\"$sub\"\n\t\t\t\t\tfi\n\t\t\t\t\techo \"$sq\" \"$sub\"\n\t\t\t\t\tbreak\n\t\t\t\tfi\n\t\t\t\tsq=\n\t\t\t\tmain=\n\t\t\t\tsub=\n\t\t\t\t;;\n\t\tesac\n\tdone\n}\n\n# find latest subtree update\nlatest_squash=\"$(find_latest_squash \"$DIR\")\"\nif [ -z \"$latest_squash\" ]; then\n    echo \"ERROR: $DIR is not a subtree\" >&2\n    exit 2\nfi\nset $latest_squash\nold=$1\nrev=$2\n\n# get the tree in the current commit\ntree_actual=$(git ls-tree -d \"$COMMIT\" \"$DIR\" | head -n 1)\nif [ -z \"$tree_actual\" ]; then\n    echo \"FAIL: subtree directory $DIR not found in $COMMIT\" >&2\n    exit 1\nfi\nset $tree_actual\ntree_actual_type=$2\ntree_actual_tree=$3\necho \"$DIR in $COMMIT currently refers to $tree_actual_type $tree_actual_tree\"\nif [ \"d$tree_actual_type\" != \"dtree\" ]; then\n    echo \"FAIL: subtree directory $DIR is not a tree in $COMMIT\" >&2\n    exit 1\nfi\n\n# get the tree at the time of the last subtree update\ntree_commit=$(git show -s --format=\"%T\" $old)\necho \"$DIR in $COMMIT was last updated in commit $old (tree $tree_commit)\"\n\n# ... and compare the actual tree with it\nif [ \"$tree_actual_tree\" != \"$tree_commit\" ]; then\n    git diff $tree_commit $tree_actual_tree >&2\n    echo \"FAIL: subtree directory was touched without subtree merge\" >&2\n    exit 1\nfi\n\n# get the tree in the subtree commit referred to\nif [ \"d$(git cat-file -t $rev 2>/dev/null)\" != dcommit ]; then\n    echo \"subtree commit $rev unavailable: cannot compare\" >&2\n    exit\nfi\ntree_subtree=$(git show -s --format=\"%T\" $rev)\necho \"$DIR in $COMMIT was last updated to upstream commit $rev (tree $tree_subtree)\"\n\n# ... and compare the actual tree with it\nif [ \"$tree_actual_tree\" != \"$tree_subtree\" ]; then\n    echo \"FAIL: subtree update commit differs from upstream tree!\" >&2\n    exit 1\nfi\n\necho \"GOOD\"\n"
  },
  {
    "path": "contrib/devtools/github-merge.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 Bitcoin Core Developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n# This script will locally construct a merge commit for a pull request on a\n# github repository, inspect it, sign it and optionally push it.\n\n# The following temporary branches are created/overwritten and deleted:\n# * pull/$PULL/base (the current master we're merging onto)\n# * pull/$PULL/head (the current state of the remote pull request)\n# * pull/$PULL/merge (github's merge)\n# * pull/$PULL/local-merge (our merge)\n\n# In case of a clean merge that is accepted by the user, the local branch with\n# name $BRANCH is overwritten with the merged result, and optionally pushed.\nfrom __future__ import division,print_function,unicode_literals\nimport os\nfrom sys import stdin,stdout,stderr\nimport argparse\nimport hashlib\nimport subprocess\nimport sys\nimport json,codecs\ntry:\n    from urllib.request import Request,urlopen\nexcept:\n    from urllib2 import Request,urlopen\n\n# External tools (can be overridden using environment)\nGIT = os.getenv('GIT','git')\nBASH = os.getenv('BASH','bash')\n\n# OS specific configuration for terminal attributes\nATTR_RESET = ''\nATTR_PR = ''\nCOMMIT_FORMAT = '%h %s (%an)%d'\nif os.name == 'posix': # if posix, assume we can use basic terminal escapes\n    ATTR_RESET = '\\033[0m'\n    ATTR_PR = '\\033[1;36m'\n    COMMIT_FORMAT = '%C(bold blue)%h%Creset %s %C(cyan)(%an)%Creset%C(green)%d%Creset'\n\ndef git_config_get(option, default=None):\n    '''\n    Get named configuration option from git repository.\n    '''\n    try:\n        return subprocess.check_output([GIT,'config','--get',option]).rstrip().decode('utf-8')\n    except subprocess.CalledProcessError as e:\n        return default\n\ndef retrieve_pr_info(repo,pull):\n    '''\n    Retrieve pull request information from github.\n    Return None if no title can be found, or an error happens.\n    '''\n    try:\n        req = Request(\"https://api.github.com/repos/\"+repo+\"/pulls/\"+pull)\n        result = urlopen(req)\n        reader = codecs.getreader('utf-8')\n        obj = json.load(reader(result))\n        return obj\n    except Exception as e:\n        print('Warning: unable to retrieve pull information from github: %s' % e)\n        return None\n\ndef ask_prompt(text):\n    print(text,end=\" \",file=stderr)\n    stderr.flush()\n    reply = stdin.readline().rstrip()\n    print(\"\",file=stderr)\n    return reply\n\ndef get_symlink_files():\n    files = sorted(subprocess.check_output([GIT, 'ls-tree', '--full-tree', '-r', 'HEAD']).splitlines())\n    ret = []\n    for f in files:\n        if (int(f.decode('utf-8').split(\" \")[0], 8) & 0o170000) == 0o120000:\n            ret.append(f.decode('utf-8').split(\"\\t\")[1])\n    return ret\n\ndef tree_sha512sum(commit='HEAD'):\n    # request metadata for entire tree, recursively\n    files = []\n    blob_by_name = {}\n    for line in subprocess.check_output([GIT, 'ls-tree', '--full-tree', '-r', commit]).splitlines():\n        name_sep = line.index(b'\\t')\n        metadata = line[:name_sep].split() # perms, 'blob', blobid\n        assert(metadata[1] == b'blob')\n        name = line[name_sep+1:]\n        files.append(name)\n        blob_by_name[name] = metadata[2]\n\n    files.sort()\n    # open connection to git-cat-file in batch mode to request data for all blobs\n    # this is much faster than launching it per file\n    p = subprocess.Popen([GIT, 'cat-file', '--batch'], stdout=subprocess.PIPE, stdin=subprocess.PIPE)\n    overall = hashlib.sha512()\n    for f in files:\n        blob = blob_by_name[f]\n        # request blob\n        p.stdin.write(blob + b'\\n')\n        p.stdin.flush()\n        # read header: blob, \"blob\", size\n        reply = p.stdout.readline().split()\n        assert(reply[0] == blob and reply[1] == b'blob')\n        size = int(reply[2])\n        # hash the blob data\n        intern = hashlib.sha512()\n        ptr = 0\n        while ptr < size:\n            bs = min(65536, size - ptr)\n            piece = p.stdout.read(bs)\n            if len(piece) == bs:\n                intern.update(piece)\n            else:\n                raise IOError('Premature EOF reading git cat-file output')\n            ptr += bs\n        dig = intern.hexdigest()\n        assert(p.stdout.read(1) == b'\\n') # ignore LF that follows blob data\n        # update overall hash with file hash\n        overall.update(dig.encode(\"utf-8\"))\n        overall.update(\"  \".encode(\"utf-8\"))\n        overall.update(f)\n        overall.update(\"\\n\".encode(\"utf-8\"))\n    p.stdin.close()\n    if p.wait():\n        raise IOError('Non-zero return value executing git cat-file')\n    return overall.hexdigest()\n\ndef print_merge_details(pull, title, branch, base_branch, head_branch):\n    print('%s#%s%s %s %sinto %s%s' % (ATTR_RESET+ATTR_PR,pull,ATTR_RESET,title,ATTR_RESET+ATTR_PR,branch,ATTR_RESET))\n    subprocess.check_call([GIT,'log','--graph','--topo-order','--pretty=format:'+COMMIT_FORMAT,base_branch+'..'+head_branch])\n\ndef parse_arguments():\n    epilog = '''\n        In addition, you can set the following git configuration variables:\n        githubmerge.repository (mandatory),\n        user.signingkey (mandatory),\n        githubmerge.host (default: git@github.com),\n        githubmerge.branch (no default),\n        githubmerge.testcmd (default: none).\n    '''\n    parser = argparse.ArgumentParser(description='Utility to merge, sign and push github pull requests',\n            epilog=epilog)\n    parser.add_argument('pull', metavar='PULL', type=int, nargs=1,\n        help='Pull request ID to merge')\n    parser.add_argument('branch', metavar='BRANCH', type=str, nargs='?',\n        default=None, help='Branch to merge against (default: githubmerge.branch setting, or base branch for pull, or \\'master\\')')\n    return parser.parse_args()\n\ndef main():\n    # Extract settings from git repo\n    repo = git_config_get('githubmerge.repository')\n    host = git_config_get('githubmerge.host','git@github.com')\n    opt_branch = git_config_get('githubmerge.branch',None)\n    testcmd = git_config_get('githubmerge.testcmd')\n    signingkey = git_config_get('user.signingkey')\n    if repo is None:\n        print(\"ERROR: No repository configured. Use this command to set:\", file=stderr)\n        print(\"git config githubmerge.repository <owner>/<repo>\", file=stderr)\n        sys.exit(1)\n    if signingkey is None:\n        print(\"ERROR: No GPG signing key set. Set one using:\",file=stderr)\n        print(\"git config --global user.signingkey <key>\",file=stderr)\n        sys.exit(1)\n\n    host_repo = host+\":\"+repo # shortcut for push/pull target\n\n    # Extract settings from command line\n    args = parse_arguments()\n    pull = str(args.pull[0])\n\n    # Receive pull information from github\n    info = retrieve_pr_info(repo,pull)\n    if info is None:\n        sys.exit(1)\n    title = info['title'].strip()\n    body = info['body'].strip()\n    # precedence order for destination branch argument:\n    #   - command line argument\n    #   - githubmerge.branch setting\n    #   - base branch for pull (as retrieved from github)\n    #   - 'master'\n    branch = args.branch or opt_branch or info['base']['ref'] or 'master'\n\n    # Initialize source branches\n    head_branch = 'pull/'+pull+'/head'\n    base_branch = 'pull/'+pull+'/base'\n    merge_branch = 'pull/'+pull+'/merge'\n    local_merge_branch = 'pull/'+pull+'/local-merge'\n\n    devnull = open(os.devnull,'w')\n    try:\n        subprocess.check_call([GIT,'checkout','-q',branch])\n    except subprocess.CalledProcessError as e:\n        print(\"ERROR: Cannot check out branch %s.\" % (branch), file=stderr)\n        sys.exit(3)\n    try:\n        subprocess.check_call([GIT,'fetch','-q',host_repo,'+refs/pull/'+pull+'/*:refs/heads/pull/'+pull+'/*',\n                                                          '+refs/heads/'+branch+':refs/heads/'+base_branch])\n    except subprocess.CalledProcessError as e:\n        print(\"ERROR: Cannot find pull request #%s or branch %s on %s.\" % (pull,branch,host_repo), file=stderr)\n        sys.exit(3)\n    try:\n        subprocess.check_call([GIT,'log','-q','-1','refs/heads/'+head_branch], stdout=devnull, stderr=stdout)\n    except subprocess.CalledProcessError as e:\n        print(\"ERROR: Cannot find head of pull request #%s on %s.\" % (pull,host_repo), file=stderr)\n        sys.exit(3)\n    try:\n        subprocess.check_call([GIT,'log','-q','-1','refs/heads/'+merge_branch], stdout=devnull, stderr=stdout)\n    except subprocess.CalledProcessError as e:\n        print(\"ERROR: Cannot find merge of pull request #%s on %s.\" % (pull,host_repo), file=stderr)\n        sys.exit(3)\n    subprocess.check_call([GIT,'checkout','-q',base_branch])\n    subprocess.call([GIT,'branch','-q','-D',local_merge_branch], stderr=devnull)\n    subprocess.check_call([GIT,'checkout','-q','-b',local_merge_branch])\n\n    try:\n        # Go up to the repository's root.\n        toplevel = subprocess.check_output([GIT,'rev-parse','--show-toplevel']).strip()\n        os.chdir(toplevel)\n        # Create unsigned merge commit.\n        if title:\n            firstline = 'Merge #%s: %s' % (pull,title)\n        else:\n            firstline = 'Merge #%s' % (pull,)\n        message = firstline + '\\n\\n'\n        message += subprocess.check_output([GIT,'log','--no-merges','--topo-order','--pretty=format:%h %s (%an)',base_branch+'..'+head_branch]).decode('utf-8')\n        message += '\\n\\nPull request description:\\n\\n  ' + body.replace('\\n', '\\n  ') + '\\n'\n        try:\n            subprocess.check_call([GIT,'merge','-q','--commit','--no-edit','--no-ff','-m',message.encode('utf-8'),head_branch])\n        except subprocess.CalledProcessError as e:\n            print(\"ERROR: Cannot be merged cleanly.\",file=stderr)\n            subprocess.check_call([GIT,'merge','--abort'])\n            sys.exit(4)\n        logmsg = subprocess.check_output([GIT,'log','--pretty=format:%s','-n','1']).decode('utf-8')\n        if logmsg.rstrip() != firstline.rstrip():\n            print(\"ERROR: Creating merge failed (already merged?).\",file=stderr)\n            sys.exit(4)\n\n        symlink_files = get_symlink_files()\n        for f in symlink_files:\n            print(\"ERROR: File %s was a symlink\" % f)\n        if len(symlink_files) > 0:\n            sys.exit(4)\n\n        # Put tree SHA512 into the message\n        try:\n            first_sha512 = tree_sha512sum()\n            message += '\\n\\nTree-SHA512: ' + first_sha512\n        except subprocess.CalledProcessError as e:\n            print(\"ERROR: Unable to compute tree hash\")\n            sys.exit(4)\n        try:\n            subprocess.check_call([GIT,'commit','--amend','-m',message.encode('utf-8')])\n        except subprocess.CalledProcessError as e:\n            print(\"ERROR: Cannot update message.\", file=stderr)\n            sys.exit(4)\n\n        print_merge_details(pull, title, branch, base_branch, head_branch)\n        print()\n\n        # Run test command if configured.\n        if testcmd:\n            if subprocess.call(testcmd,shell=True):\n                print(\"ERROR: Running %s failed.\" % testcmd,file=stderr)\n                sys.exit(5)\n\n            # Show the created merge.\n            diff = subprocess.check_output([GIT,'diff',merge_branch+'..'+local_merge_branch])\n            subprocess.check_call([GIT,'diff',base_branch+'..'+local_merge_branch])\n            if diff:\n                print(\"WARNING: merge differs from github!\",file=stderr)\n                reply = ask_prompt(\"Type 'ignore' to continue.\")\n                if reply.lower() == 'ignore':\n                    print(\"Difference with github ignored.\",file=stderr)\n                else:\n                    sys.exit(6)\n        else:\n            # Verify the result manually.\n            print(\"Dropping you on a shell so you can try building/testing the merged source.\",file=stderr)\n            print(\"Run 'git diff HEAD~' to show the changes being merged.\",file=stderr)\n            print(\"Type 'exit' when done.\",file=stderr)\n            if os.path.isfile('/etc/debian_version'): # Show pull number on Debian default prompt\n                os.putenv('debian_chroot',pull)\n            subprocess.call([BASH,'-i'])\n\n        second_sha512 = tree_sha512sum()\n        if first_sha512 != second_sha512:\n            print(\"ERROR: Tree hash changed unexpectedly\",file=stderr)\n            sys.exit(8)\n\n        # Sign the merge commit.\n        print_merge_details(pull, title, branch, base_branch, head_branch)\n        while True:\n            reply = ask_prompt(\"Type 's' to sign off on the above merge, or 'x' to reject and exit.\").lower()\n            if reply == 's':\n                try:\n                    subprocess.check_call([GIT,'commit','-q','--gpg-sign','--amend','--no-edit'])\n                    break\n                except subprocess.CalledProcessError as e:\n                    print(\"Error while signing, asking again.\",file=stderr)\n            elif reply == 'x':\n                print(\"Not signing off on merge, exiting.\",file=stderr)\n                sys.exit(1)\n\n        # Put the result in branch.\n        subprocess.check_call([GIT,'checkout','-q',branch])\n        subprocess.check_call([GIT,'reset','-q','--hard',local_merge_branch])\n    finally:\n        # Clean up temporary branches.\n        subprocess.call([GIT,'checkout','-q',branch])\n        subprocess.call([GIT,'branch','-q','-D',head_branch],stderr=devnull)\n        subprocess.call([GIT,'branch','-q','-D',base_branch],stderr=devnull)\n        subprocess.call([GIT,'branch','-q','-D',merge_branch],stderr=devnull)\n        subprocess.call([GIT,'branch','-q','-D',local_merge_branch],stderr=devnull)\n\n    # Push the result.\n    while True:\n        reply = ask_prompt(\"Type 'push' to push the result to %s, branch %s, or 'x' to exit without pushing.\" % (host_repo,branch)).lower()\n        if reply == 'push':\n            subprocess.check_call([GIT,'push',host_repo,'refs/heads/'+branch])\n            break\n        elif reply == 'x':\n            sys.exit(1)\n\nif __name__ == '__main__':\n    main()\n\n"
  },
  {
    "path": "contrib/devtools/lint-all.sh",
    "content": "#!/bin/bash\n#\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#\n# This script runs all contrib/devtools/lint-*.sh files, and fails if any exit\n# with a non-zero status code.\n\nset -u\n\nSCRIPTDIR=$(dirname \"${BASH_SOURCE[0]}\")\nLINTALL=$(basename \"${BASH_SOURCE[0]}\")\n\nfor f in \"${SCRIPTDIR}\"/lint-*.sh; do\n  if [ \"$(basename \"$f\")\" != \"$LINTALL\" ]; then\n    if ! \"$f\"; then\n      echo \"^---- failure generated from $f\"\n      exit 1\n    fi\n  fi\ndone\n"
  },
  {
    "path": "contrib/devtools/lint-python.sh",
    "content": "#!/bin/sh\n#\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#\n# Check for specified flake8 warnings in python files.\n\n# F401: module imported but unused\nflake8 --ignore=B,C,E,F,I,N,W --select=F401 .\n"
  },
  {
    "path": "contrib/devtools/lint-whitespace.sh",
    "content": "#!/bin/bash\n#\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#\n# Check for new lines in diff that introduce trailing whitespace.\n\n# We can't run this check unless we know the commit range for the PR.\nif [ -z \"${TRAVIS_COMMIT_RANGE}\" ]; then\n  echo \"Cannot run lint-whitespace.sh without commit range. To run locally, use:\"\n  echo \"TRAVIS_COMMIT_RANGE='<commit range>' .lint-whitespace.sh\"\n  echo \"For example:\"\n  echo \"TRAVIS_COMMIT_RANGE='47ba2c3...ee50c9e' .lint-whitespace.sh\"\n  exit 1\nfi\n\nshowdiff() {\n  if ! git diff -U0 \"${TRAVIS_COMMIT_RANGE}\" -- \".\" \":(exclude)depends/patches/\" \":(exclude)src/leveldb/\" \":(exclude)src/secp256k1/\" \":(exclude)src/univalue/\" \":(exclude)doc/release-notes/\"; then\n    echo \"Failed to get a diff\"\n    exit 1\n  fi\n}\n\nshowcodediff() {\n  if ! git diff -U0 \"${TRAVIS_COMMIT_RANGE}\" -- *.cpp *.h *.md *.py *.sh \":(exclude)src/leveldb/\" \":(exclude)src/secp256k1/\" \":(exclude)src/univalue/\" \":(exclude)doc/release-notes/\"; then\n    echo \"Failed to get a diff\"\n    exit 1\n  fi\n}\n\nRET=0\n\n# Check if trailing whitespace was found in the diff.\nif showdiff | grep -E -q '^\\+.*\\s+$'; then\n  echo \"This diff appears to have added new lines with trailing whitespace.\"\n  echo \"The following changes were suspected:\"\n  FILENAME=\"\"\n  SEEN=0\n  while read -r line; do\n    if [[ \"$line\" =~ ^diff ]]; then\n      FILENAME=\"$line\"\n      SEEN=0\n    elif [[ \"$line\" =~ ^@@ ]]; then\n      LINENUMBER=\"$line\"\n    else\n      if [ \"$SEEN\" -eq 0 ]; then\n        # The first time a file is seen with trailing whitespace, we print the\n        # filename (preceded by a newline).\n        echo\n        echo \"$FILENAME\"\n        echo \"$LINENUMBER\"\n        SEEN=1\n      fi\n      echo \"$line\"\n    fi\n  done < <(showdiff | grep -E '^(diff --git |@@|\\+.*\\s+$)')\n  RET=1\nfi\n\n# Check if tab characters were found in the diff.\nif showcodediff | grep -P -q '^\\+.*\\t'; then\n  echo \"This diff appears to have added new lines with tab characters instead of spaces.\"\n  echo \"The following changes were suspected:\"\n  FILENAME=\"\"\n  SEEN=0\n  while read -r line; do\n    if [[ \"$line\" =~ ^diff ]]; then\n      FILENAME=\"$line\"\n      SEEN=0\n    elif [[ \"$line\" =~ ^@@ ]]; then\n      LINENUMBER=\"$line\"\n    else\n      if [ \"$SEEN\" -eq 0 ]; then\n        # The first time a file is seen with a tab character, we print the\n        # filename (preceded by a newline).\n        echo\n        echo \"$FILENAME\"\n        echo \"$LINENUMBER\"\n        SEEN=1\n      fi\n      echo \"$line\"\n    fi\n  done < <(showcodediff | grep -P '^(diff --git |@@|\\+.*\\t)')\n  RET=1\nfi\n\nexit $RET\n"
  },
  {
    "path": "contrib/devtools/optimize-pngs.py",
    "content": "#!/usr/bin/env python\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\nRun this script every time you change one of the png files. Using pngcrush, it will optimize the png files, remove various color profiles, remove ancillary chunks (alla) and text chunks (text).\n#pngcrush -brute -ow -rem gAMA -rem cHRM -rem iCCP -rem sRGB -rem alla -rem text\n'''\nimport os\nimport sys\nimport subprocess\nimport hashlib\nfrom PIL import Image\n\ndef file_hash(filename):\n    '''Return hash of raw file contents'''\n    with open(filename, 'rb') as f:\n        return hashlib.sha256(f.read()).hexdigest()\n\ndef content_hash(filename):\n    '''Return hash of RGBA contents of image'''\n    i = Image.open(filename)\n    i = i.convert('RGBA')\n    data = i.tobytes()\n    return hashlib.sha256(data).hexdigest()\n\npngcrush = 'pngcrush'\ngit = 'git'\nfolders = [\"src/qt/res/movies\", \"src/qt/res/icons\", \"share/pixmaps\"]\nbasePath = subprocess.check_output([git, 'rev-parse', '--show-toplevel']).rstrip('\\n')\ntotalSaveBytes = 0\nnoHashChange = True\n\noutputArray = []\nfor folder in folders:\n    absFolder=os.path.join(basePath, folder)\n    for file in os.listdir(absFolder):\n        extension = os.path.splitext(file)[1]\n        if extension.lower() == '.png':\n            print(\"optimizing \"+file+\"...\"),\n            file_path = os.path.join(absFolder, file)\n            fileMetaMap = {'file' : file, 'osize': os.path.getsize(file_path), 'sha256Old' : file_hash(file_path)}\n            fileMetaMap['contentHashPre'] = content_hash(file_path)\n        \n            pngCrushOutput = \"\"\n            try:\n                pngCrushOutput = subprocess.check_output(\n                        [pngcrush, \"-brute\", \"-ow\", \"-rem\", \"gAMA\", \"-rem\", \"cHRM\", \"-rem\", \"iCCP\", \"-rem\", \"sRGB\", \"-rem\", \"alla\", \"-rem\", \"text\", file_path],\n                        stderr=subprocess.STDOUT).rstrip('\\n')\n            except:\n                print \"pngcrush is not installed, aborting...\"\n                sys.exit(0)\n        \n            #verify\n            if \"Not a PNG file\" in subprocess.check_output([pngcrush, \"-n\", \"-v\", file_path], stderr=subprocess.STDOUT):\n                print \"PNG file \"+file+\" is corrupted after crushing, check out pngcursh version\"\n                sys.exit(1)\n            \n            fileMetaMap['sha256New'] = file_hash(file_path)\n            fileMetaMap['contentHashPost'] = content_hash(file_path)\n\n            if fileMetaMap['contentHashPre'] != fileMetaMap['contentHashPost']:\n                print \"Image contents of PNG file \"+file+\" before and after crushing don't match\"\n                sys.exit(1)\n\n            fileMetaMap['psize'] = os.path.getsize(file_path)\n            outputArray.append(fileMetaMap)\n            print(\"done\\n\"),\n\nprint \"summary:\\n+++++++++++++++++\"\nfor fileDict in outputArray:\n    oldHash = fileDict['sha256Old']\n    newHash = fileDict['sha256New']\n    totalSaveBytes += fileDict['osize'] - fileDict['psize']\n    noHashChange = noHashChange and (oldHash == newHash)\n    print fileDict['file']+\"\\n  size diff from: \"+str(fileDict['osize'])+\" to: \"+str(fileDict['psize'])+\"\\n  old sha256: \"+oldHash+\"\\n  new sha256: \"+newHash+\"\\n\"\n    \nprint \"completed. Checksum stable: \"+str(noHashChange)+\". Total reduction: \"+str(totalSaveBytes)+\" bytes\"\n"
  },
  {
    "path": "contrib/devtools/security-check.py",
    "content": "#!/usr/bin/env python\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\nPerform basic ELF security checks on a series of executables.\nExit status will be 0 if successful, and the program will be silent.\nOtherwise the exit status will be 1 and it will log which executables failed which checks.\nNeeds `readelf` (for ELF) and `objdump` (for PE).\n'''\nfrom __future__ import division,print_function,unicode_literals\nimport subprocess\nimport sys\nimport os\n\nREADELF_CMD = os.getenv('READELF', '/usr/bin/readelf')\nOBJDUMP_CMD = os.getenv('OBJDUMP', '/usr/bin/objdump')\nNONFATAL = {'HIGH_ENTROPY_VA'} # checks which are non-fatal for now but only generate a warning\n\ndef check_ELF_PIE(executable):\n    '''\n    Check for position independent executable (PIE), allowing for address space randomization.\n    '''\n    p = subprocess.Popen([READELF_CMD, '-h', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\n    (stdout, stderr) = p.communicate()\n    if p.returncode:\n        raise IOError('Error opening file')\n\n    ok = False\n    for line in stdout.split(b'\\n'):\n        line = line.split()\n        if len(line)>=2 and line[0] == b'Type:' and line[1] == b'DYN':\n            ok = True\n    return ok\n\ndef get_ELF_program_headers(executable):\n    '''Return type and flags for ELF program headers'''\n    p = subprocess.Popen([READELF_CMD, '-l', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\n    (stdout, stderr) = p.communicate()\n    if p.returncode:\n        raise IOError('Error opening file')\n    in_headers = False\n    count = 0\n    headers = []\n    for line in stdout.split(b'\\n'):\n        if line.startswith(b'Program Headers:'):\n            in_headers = True\n        if line == b'':\n            in_headers = False\n        if in_headers:\n            if count == 1: # header line\n                ofs_typ = line.find(b'Type')\n                ofs_offset = line.find(b'Offset')\n                ofs_flags = line.find(b'Flg')\n                ofs_align = line.find(b'Align')\n                if ofs_typ == -1 or ofs_offset == -1 or ofs_flags == -1 or ofs_align  == -1:\n                    raise ValueError('Cannot parse elfread -lW output')\n            elif count > 1:\n                typ = line[ofs_typ:ofs_offset].rstrip()\n                flags = line[ofs_flags:ofs_align].rstrip()\n                headers.append((typ, flags))\n            count += 1\n    return headers\n\ndef check_ELF_NX(executable):\n    '''\n    Check that no sections are writable and executable (including the stack)\n    '''\n    have_wx = False\n    have_gnu_stack = False\n    for (typ, flags) in get_ELF_program_headers(executable):\n        if typ == b'GNU_STACK':\n            have_gnu_stack = True\n        if b'W' in flags and b'E' in flags: # section is both writable and executable\n            have_wx = True\n    return have_gnu_stack and not have_wx\n\ndef check_ELF_RELRO(executable):\n    '''\n    Check for read-only relocations.\n    GNU_RELRO program header must exist\n    Dynamic section must have BIND_NOW flag\n    '''\n    have_gnu_relro = False\n    for (typ, flags) in get_ELF_program_headers(executable):\n        # Note: not checking flags == 'R': here as linkers set the permission differently\n        # This does not affect security: the permission flags of the GNU_RELRO program header are ignored, the PT_LOAD header determines the effective permissions.\n        # However, the dynamic linker need to write to this area so these are RW.\n        # Glibc itself takes care of mprotecting this area R after relocations are finished.\n        # See also http://permalink.gmane.org/gmane.comp.gnu.binutils/71347\n        if typ == b'GNU_RELRO':\n            have_gnu_relro = True\n\n    have_bindnow = False\n    p = subprocess.Popen([READELF_CMD, '-d', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\n    (stdout, stderr) = p.communicate()\n    if p.returncode:\n        raise IOError('Error opening file')\n    for line in stdout.split(b'\\n'):\n        tokens = line.split()\n        if len(tokens)>1 and tokens[1] == b'(BIND_NOW)' or (len(tokens)>2 and tokens[1] == b'(FLAGS)' and b'BIND_NOW' in tokens[2]):\n            have_bindnow = True\n    return have_gnu_relro and have_bindnow\n\ndef check_ELF_Canary(executable):\n    '''\n    Check for use of stack canary\n    '''\n    p = subprocess.Popen([READELF_CMD, '--dyn-syms', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\n    (stdout, stderr) = p.communicate()\n    if p.returncode:\n        raise IOError('Error opening file')\n    ok = False\n    for line in stdout.split(b'\\n'):\n        if b'__stack_chk_fail' in line:\n            ok = True\n    return ok\n\ndef get_PE_dll_characteristics(executable):\n    '''\n    Get PE DllCharacteristics bits.\n    Returns a tuple (arch,bits) where arch is 'i386:x86-64' or 'i386'\n    and bits is the DllCharacteristics value.\n    '''\n    p = subprocess.Popen([OBJDUMP_CMD, '-x',  executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\n    (stdout, stderr) = p.communicate()\n    if p.returncode:\n        raise IOError('Error opening file')\n    arch = ''\n    bits = 0\n    for line in stdout.split('\\n'):\n        tokens = line.split()\n        if len(tokens)>=2 and tokens[0] == 'architecture:':\n            arch = tokens[1].rstrip(',')\n        if len(tokens)>=2 and tokens[0] == 'DllCharacteristics':\n            bits = int(tokens[1],16)\n    return (arch,bits)\n\nIMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA = 0x0020\nIMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE    = 0x0040\nIMAGE_DLL_CHARACTERISTICS_NX_COMPAT       = 0x0100\n\ndef check_PE_DYNAMIC_BASE(executable):\n    '''PIE: DllCharacteristics bit 0x40 signifies dynamicbase (ASLR)'''\n    (arch,bits) = get_PE_dll_characteristics(executable)\n    reqbits = IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE\n    return (bits & reqbits) == reqbits\n\n# On 64 bit, must support high-entropy 64-bit address space layout randomization in addition to DYNAMIC_BASE\n# to have secure ASLR.\ndef check_PE_HIGH_ENTROPY_VA(executable):\n    '''PIE: DllCharacteristics bit 0x20 signifies high-entropy ASLR'''\n    (arch,bits) = get_PE_dll_characteristics(executable)\n    if arch == 'i386:x86-64': \n        reqbits = IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA\n    else: # Unnecessary on 32-bit\n        assert(arch == 'i386')\n        reqbits = 0\n    return (bits & reqbits) == reqbits\n\ndef check_PE_NX(executable):\n    '''NX: DllCharacteristics bit 0x100 signifies nxcompat (DEP)'''\n    (arch,bits) = get_PE_dll_characteristics(executable)\n    return (bits & IMAGE_DLL_CHARACTERISTICS_NX_COMPAT) == IMAGE_DLL_CHARACTERISTICS_NX_COMPAT\n\nCHECKS = {\n'ELF': [\n    ('PIE', check_ELF_PIE),\n    ('NX', check_ELF_NX),\n    ('RELRO', check_ELF_RELRO),\n    ('Canary', check_ELF_Canary)\n],\n'PE': [\n    ('DYNAMIC_BASE', check_PE_DYNAMIC_BASE),\n    ('HIGH_ENTROPY_VA', check_PE_HIGH_ENTROPY_VA),\n    ('NX', check_PE_NX)\n]\n}\n\ndef identify_executable(executable):\n    with open(filename, 'rb') as f:\n        magic = f.read(4)\n    if magic.startswith(b'MZ'):\n        return 'PE'\n    elif magic.startswith(b'\\x7fELF'):\n        return 'ELF'\n    return None\n\nif __name__ == '__main__':\n    retval = 0\n    for filename in sys.argv[1:]:\n        try:\n            etype = identify_executable(filename)\n            if etype is None:\n                print('%s: unknown format' % filename)\n                retval = 1\n                continue\n\n            failed = []\n            warning = []\n            for (name, func) in CHECKS[etype]:\n                if not func(filename):\n                    if name in NONFATAL:\n                        warning.append(name)\n                    else:\n                        failed.append(name)\n            if failed:\n                print('%s: failed %s' % (filename, ' '.join(failed)))\n                retval = 1\n            if warning:\n                print('%s: warning %s' % (filename, ' '.join(warning)))\n        except IOError:\n            print('%s: cannot open' % filename)\n            retval = 1\n    sys.exit(retval)\n\n"
  },
  {
    "path": "contrib/devtools/split-debug.sh.in",
    "content": "#!/bin/sh\n\nif [ $# -ne 3 ];\n    then echo \"usage: $0 <input> <stripped-binary> <debug-binary>\"\nfi\n\n@OBJCOPY@ --enable-deterministic-archives -p --only-keep-debug $1 $3\n@OBJCOPY@ --enable-deterministic-archives -p --strip-debug $1 $2\n@STRIP@ --enable-deterministic-archives -p -s $2\n@OBJCOPY@ --enable-deterministic-archives -p --add-gnu-debuglink=$3 $2\n"
  },
  {
    "path": "contrib/devtools/symbol-check.py",
    "content": "#!/usr/bin/env python\n# Copyright (c) 2014 Wladimir J. van der Laan\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\nA script to check that the (Linux) executables produced by gitian only contain\nallowed gcc, glibc and libstdc++ version symbols.  This makes sure they are\nstill compatible with the minimum supported Linux distribution versions.\n\nExample usage:\n\n    find ../gitian-builder/build -type f -executable | xargs python contrib/devtools/symbol-check.py\n'''\nfrom __future__ import division, print_function, unicode_literals\nimport subprocess\nimport re\nimport sys\nimport os\n\n# Debian 6.0.9 (Squeeze) has:\n#\n# - g++ version 4.4.5 (https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=g%2B%2B)\n# - libc version 2.11.3 (https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=libc6)\n# - libstdc++ version 4.4.5 (https://packages.debian.org/search?suite=default&section=all&arch=any&searchon=names&keywords=libstdc%2B%2B6)\n#\n# Ubuntu 10.04.4 (Lucid Lynx) has:\n#\n# - g++ version 4.4.3 (http://packages.ubuntu.com/search?keywords=g%2B%2B&searchon=names&suite=lucid&section=all)\n# - libc version 2.11.1 (http://packages.ubuntu.com/search?keywords=libc6&searchon=names&suite=lucid&section=all)\n# - libstdc++ version 4.4.3 (http://packages.ubuntu.com/search?suite=lucid&section=all&arch=any&keywords=libstdc%2B%2B&searchon=names)\n#\n# Taking the minimum of these as our target.\n#\n# According to GNU ABI document (http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) this corresponds to:\n#   GCC 4.4.0: GCC_4.4.0\n#   GCC 4.4.2: GLIBCXX_3.4.13, CXXABI_1.3.3\n#   (glibc)    GLIBC_2_11\n#\nMAX_VERSIONS = {\n'GCC':     (4,4,0),\n'CXXABI':  (1,3,3),\n'GLIBCXX': (3,4,13),\n'GLIBC':   (2,11)\n}\n# See here for a description of _IO_stdin_used:\n# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#109\n\n# Ignore symbols that are exported as part of every executable\nIGNORE_EXPORTS = {\nb'_edata', b'_end', b'_init', b'__bss_start', b'_fini', b'_IO_stdin_used'\n}\nREADELF_CMD = os.getenv('READELF', '/usr/bin/readelf')\nCPPFILT_CMD = os.getenv('CPPFILT', '/usr/bin/c++filt')\n# Allowed NEEDED libraries\nALLOWED_LIBRARIES = {\n# bitcoind and bitcoin-qt\nb'libgcc_s.so.1', # GCC base support\nb'libc.so.6', # C library\nb'libpthread.so.0', # threading\nb'libanl.so.1', # DNS resolve\nb'libm.so.6', # math library\nb'librt.so.1', # real-time (clock)\nb'ld-linux-x86-64.so.2', # 64-bit dynamic linker\nb'ld-linux.so.2', # 32-bit dynamic linker\n# bitcoin-qt only\nb'libX11-xcb.so.1', # part of X11\nb'libX11.so.6', # part of X11\nb'libxcb.so.1', # part of X11\nb'libfontconfig.so.1', # font support\nb'libfreetype.so.6', # font parsing\nb'libdl.so.2' # programming interface to dynamic linker\n}\n\nclass CPPFilt(object):\n    '''\n    Demangle C++ symbol names.\n\n    Use a pipe to the 'c++filt' command.\n    '''\n    def __init__(self):\n        self.proc = subprocess.Popen(CPPFILT_CMD, stdin=subprocess.PIPE, stdout=subprocess.PIPE)\n\n    def __call__(self, mangled):\n        self.proc.stdin.write(mangled + b'\\n')\n        self.proc.stdin.flush()\n        return self.proc.stdout.readline().rstrip()\n\n    def close(self):\n        self.proc.stdin.close()\n        self.proc.stdout.close()\n        self.proc.wait()\n\ndef read_symbols(executable, imports=True):\n    '''\n    Parse an ELF executable and return a list of (symbol,version) tuples\n    for dynamic, imported symbols.\n    '''\n    p = subprocess.Popen([READELF_CMD, '--dyn-syms', '-W', executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\n    (stdout, stderr) = p.communicate()\n    if p.returncode:\n        raise IOError('Could not read symbols for %s: %s' % (executable, stderr.strip()))\n    syms = []\n    for line in stdout.split(b'\\n'):\n        line = line.split()\n        if len(line)>7 and re.match(b'[0-9]+:$', line[0]):\n            (sym, _, version) = line[7].partition(b'@')\n            is_import = line[6] == b'UND'\n            if version.startswith(b'@'):\n                version = version[1:]\n            if is_import == imports:\n                syms.append((sym, version))\n    return syms\n\ndef check_version(max_versions, version):\n    if b'_' in version:\n        (lib, _, ver) = version.rpartition(b'_')\n    else:\n        lib = version\n        ver = '0'\n    ver = tuple([int(x) for x in ver.split(b'.')])\n    if not lib in max_versions:\n        return False\n    return ver <= max_versions[lib]\n\ndef read_libraries(filename):\n    p = subprocess.Popen([READELF_CMD, '-d', '-W', filename], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\n    (stdout, stderr) = p.communicate()\n    if p.returncode:\n        raise IOError('Error opening file')\n    libraries = []\n    for line in stdout.split(b'\\n'):\n        tokens = line.split()\n        if len(tokens)>2 and tokens[1] == b'(NEEDED)':\n            match = re.match(b'^Shared library: \\[(.*)\\]$', b' '.join(tokens[2:]))\n            if match:\n                libraries.append(match.group(1))\n            else:\n                raise ValueError('Unparseable (NEEDED) specification')\n    return libraries\n\nif __name__ == '__main__':\n    cppfilt = CPPFilt()\n    retval = 0\n    for filename in sys.argv[1:]:\n        # Check imported symbols\n        for sym,version in read_symbols(filename, True):\n            if version and not check_version(MAX_VERSIONS, version):\n                print('%s: symbol %s from unsupported version %s' % (filename, cppfilt(sym).decode('utf-8'), version.decode('utf-8')))\n                retval = 1\n        # Check exported symbols\n        for sym,version in read_symbols(filename, False):\n            if sym in IGNORE_EXPORTS:\n                continue\n            print('%s: export of symbol %s not allowed' % (filename, cppfilt(sym).decode('utf-8')))\n            retval = 1\n        # Check dependency libraries\n        for library_name in read_libraries(filename):\n            if library_name not in ALLOWED_LIBRARIES:\n                print('%s: NEEDED library %s is not allowed' % (filename, library_name.decode('utf-8')))\n                retval = 1\n\n    sys.exit(retval)\n\n\n"
  },
  {
    "path": "contrib/devtools/test-security-check.py",
    "content": "#!/usr/bin/env python2\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\nTest script for security-check.py\n'''\nfrom __future__ import division,print_function\nimport subprocess\nimport unittest\n\ndef write_testcode(filename):\n    with open(filename, 'w') as f:\n        f.write('''\n    #include <stdio.h>\n    int main()\n    {\n        printf(\"the quick brown fox jumps over the lazy god\\\\n\");\n        return 0;\n    }\n    ''')\n\ndef call_security_check(cc, source, executable, options):\n    subprocess.check_call([cc,source,'-o',executable] + options)\n    p = subprocess.Popen(['./security-check.py',executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)\n    (stdout, stderr) = p.communicate()\n    return (p.returncode, stdout.rstrip())\n\nclass TestSecurityChecks(unittest.TestCase):\n    def test_ELF(self):\n        source = 'test1.c'\n        executable = 'test1'\n        cc = 'gcc'\n        write_testcode(source)\n\n        self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-zexecstack','-fno-stack-protector','-Wl,-znorelro']), \n                (1, executable+': failed PIE NX RELRO Canary'))\n        self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fno-stack-protector','-Wl,-znorelro']), \n                (1, executable+': failed PIE RELRO Canary'))\n        self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro']), \n                (1, executable+': failed PIE RELRO'))\n        self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-pie','-fPIE']), \n                (1, executable+': failed RELRO'))\n        self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE']), \n                (0, ''))\n\n    def test_PE(self):\n        source = 'test1.c'\n        executable = 'test1.exe'\n        cc = 'i686-w64-mingw32-gcc'\n        write_testcode(source)\n\n        self.assertEqual(call_security_check(cc, source, executable, []), \n                (1, executable+': failed PIE NX'))\n        self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat']), \n                (1, executable+': failed PIE'))\n        self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--dynamicbase']), \n                (0, ''))\n\nif __name__ == '__main__':\n    unittest.main()\n\n"
  },
  {
    "path": "contrib/devtools/update-translations.py",
    "content": "#!/usr/bin/env python\n# Copyright (c) 2014 Wladimir J. van der Laan\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\nRun this script from the root of the repository to update all translations from\ntransifex.\nIt will do the following automatically:\n\n- fetch all translations using the tx tool\n- post-process them into valid and committable format\n  - remove invalid control characters\n  - remove location tags (makes diffs less noisy)\n\nTODO:\n- auto-add new translations to the build system according to the translation process\n'''\nfrom __future__ import division, print_function\nimport subprocess\nimport re\nimport sys\nimport os\nimport io\nimport xml.etree.ElementTree as ET\n\n# Name of transifex tool\nTX = 'tx'\n# Name of source language file\nSOURCE_LANG = 'bitcoin_en.ts'\n# Directory with locale files\nLOCALE_DIR = 'src/qt/locale'\n# Minimum number of messages for translation to be considered at all\nMIN_NUM_MESSAGES = 10\n\ndef check_at_repository_root():\n    if not os.path.exists('.git'):\n        print('No .git directory found')\n        print('Execute this script at the root of the repository', file=sys.stderr)\n        sys.exit(1)\n\ndef fetch_all_translations():\n    if subprocess.call([TX, 'pull', '-f', '-a']):\n        print('Error while fetching translations', file=sys.stderr)\n        sys.exit(1)\n\ndef find_format_specifiers(s):\n    '''Find all format specifiers in a string.'''\n    pos = 0\n    specifiers = []\n    while True:\n        percent = s.find('%', pos)\n        if percent < 0:\n            break\n        specifiers.append(s[percent+1])\n        pos = percent+2\n    return specifiers\n\ndef split_format_specifiers(specifiers):\n    '''Split format specifiers between numeric (Qt) and others (strprintf)'''\n    numeric = []\n    other = []\n    for s in specifiers:\n        if s in {'1','2','3','4','5','6','7','8','9'}:\n            numeric.append(s)\n        else:\n            other.append(s)\n\n    # If both numeric format specifiers and \"others\" are used, assume we're dealing\n    # with a Qt-formatted message. In the case of Qt formatting (see https://doc.qt.io/qt-5/qstring.html#arg)\n    # only numeric formats are replaced at all. This means \"(percentage: %1%)\" is valid, without needing\n    # any kind of escaping that would be necessary for strprintf. Without this, this function\n    # would wrongly detect '%)' as a printf format specifier.\n    if numeric:\n        other = []\n\n    # numeric (Qt) can be present in any order, others (strprintf) must be in specified order\n    return set(numeric),other\n\ndef sanitize_string(s):\n    '''Sanitize string for printing'''\n    return s.replace('\\n',' ')\n\ndef check_format_specifiers(source, translation, errors, numerus):\n    source_f = split_format_specifiers(find_format_specifiers(source))\n    # assert that no source messages contain both Qt and strprintf format specifiers\n    # if this fails, go change the source as this is hacky and confusing!\n    assert(not(source_f[0] and source_f[1]))\n    try:\n        translation_f = split_format_specifiers(find_format_specifiers(translation))\n    except IndexError:\n        errors.append(\"Parse error in translation for '%s': '%s'\" % (sanitize_string(source), sanitize_string(translation)))\n        return False\n    else:\n        if source_f != translation_f:\n            if numerus and source_f == (set(), ['n']) and translation_f == (set(), []) and translation.find('%') == -1:\n                # Allow numerus translations to omit %n specifier (usually when it only has one possible value)\n                return True\n            errors.append(\"Mismatch between '%s' and '%s'\" % (sanitize_string(source), sanitize_string(translation)))\n            return False\n    return True\n\ndef all_ts_files(suffix=''):\n    for filename in os.listdir(LOCALE_DIR):\n        # process only language files, and do not process source language\n        if not filename.endswith('.ts'+suffix) or filename == SOURCE_LANG+suffix:\n            continue\n        if suffix: # remove provided suffix\n            filename = filename[0:-len(suffix)]\n        filepath = os.path.join(LOCALE_DIR, filename)\n        yield(filename, filepath)\n\nFIX_RE = re.compile(b'[\\x00-\\x09\\x0b\\x0c\\x0e-\\x1f]')\ndef remove_invalid_characters(s):\n    '''Remove invalid characters from translation string'''\n    return FIX_RE.sub(b'', s)\n\n# Override cdata escape function to make our output match Qt's (optional, just for cleaner diffs for\n# comparison, disable by default)\n_orig_escape_cdata = None\ndef escape_cdata(text):\n    text = _orig_escape_cdata(text)\n    text = text.replace(\"'\", '&apos;')\n    text = text.replace('\"', '&quot;')\n    return text\n\ndef postprocess_translations(reduce_diff_hacks=False):\n    print('Checking and postprocessing...')\n\n    if reduce_diff_hacks:\n        global _orig_escape_cdata\n        _orig_escape_cdata = ET._escape_cdata\n        ET._escape_cdata = escape_cdata\n\n    for (filename,filepath) in all_ts_files():\n        os.rename(filepath, filepath+'.orig')\n\n    have_errors = False\n    for (filename,filepath) in all_ts_files('.orig'):\n        # pre-fixups to cope with transifex output\n        parser = ET.XMLParser(encoding='utf-8') # need to override encoding because 'utf8' is not understood only 'utf-8'\n        with open(filepath + '.orig', 'rb') as f:\n            data = f.read()\n        # remove control characters; this must be done over the entire file otherwise the XML parser will fail\n        data = remove_invalid_characters(data)\n        tree = ET.parse(io.BytesIO(data), parser=parser)\n\n        # iterate over all messages in file\n        root = tree.getroot()\n        for context in root.findall('context'):\n            for message in context.findall('message'):\n                numerus = message.get('numerus') == 'yes'\n                source = message.find('source').text\n                translation_node = message.find('translation')\n                # pick all numerusforms\n                if numerus:\n                    translations = [i.text for i in translation_node.findall('numerusform')]\n                else:\n                    translations = [translation_node.text]\n\n                for translation in translations:\n                    if translation is None:\n                        continue\n                    errors = []\n                    valid = check_format_specifiers(source, translation, errors, numerus)\n\n                    for error in errors:\n                        print('%s: %s' % (filename, error))\n\n                    if not valid: # set type to unfinished and clear string if invalid\n                        translation_node.clear()\n                        translation_node.set('type', 'unfinished')\n                        have_errors = True\n\n                # Remove location tags\n                for location in message.findall('location'):\n                    message.remove(location)\n\n                # Remove entire message if it is an unfinished translation\n                if translation_node.get('type') == 'unfinished':\n                    context.remove(message)\n\n        # check if document is (virtually) empty, and remove it if so\n        num_messages = 0\n        for context in root.findall('context'):\n            for message in context.findall('message'):\n                num_messages += 1\n        if num_messages < MIN_NUM_MESSAGES:\n            print('Removing %s, as it contains only %i messages' % (filepath, num_messages))\n            continue\n\n        # write fixed-up tree\n        # if diff reduction requested, replace some XML to 'sanitize' to qt formatting\n        if reduce_diff_hacks:\n            out = io.BytesIO()\n            tree.write(out, encoding='utf-8')\n            out = out.getvalue()\n            out = out.replace(b' />', b'/>')\n            with open(filepath, 'wb') as f:\n                f.write(out)\n        else:\n            tree.write(filepath, encoding='utf-8')\n    return have_errors\n\nif __name__ == '__main__':\n    check_at_repository_root()\n    fetch_all_translations()\n    postprocess_translations()\n\n"
  },
  {
    "path": "contrib/filter-lcov.py",
    "content": "#!/usr/bin/env python3\n\nimport argparse\n\nparser = argparse.ArgumentParser(description='Remove the coverage data from a tracefile for all files matching the pattern.')\nparser.add_argument('--pattern', '-p', action='append', help='the pattern of files to remove', required=True)\nparser.add_argument('tracefile', help='the tracefile to remove the coverage data from')\nparser.add_argument('outfile', help='filename for the output to be written to')\n\nargs = parser.parse_args()\ntracefile = args.tracefile\npattern = args.pattern\noutfile = args.outfile\n\nin_remove = False\nwith open(tracefile, 'r') as f:\n    with open(outfile, 'w') as wf:\n        for line in f:\n            for p in pattern:\n                if line.startswith(\"SF:\") and p in line:\n                    in_remove = True\n            if not in_remove:\n                wf.write(line)\n            if line == 'end_of_record\\n':\n                in_remove = False\n"
  },
  {
    "path": "contrib/gitian-build.sh",
    "content": "# Copyright (c) 2016 The Bitcoin Core developers\n# Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n# What to do\nsign=false\nverify=false\nbuild=false\n\n# Systems to build\nlinux=true\nwindows=true\nosx=true\n\n# Other Basic variables\nSIGNER=\nVERSION=\ncommit=false\n\n# GITHUB repo select\nurl=https://github.com/sugarchain-project/sugarchain\n\nproc=2\nmem=2000\nlxc=true\nosslTarUrl=http://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz\nosslPatchUrl=https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch\nscriptName=$(basename -- \"$0\")\nsignProg=\"gpg --detach-sign\"\ncommitFiles=true\n\n# Help Message\nread -d '' usage <<- EOF\nUsage: $scriptName [-c|u|v|b|s|B|o|h|j|m|] signer version\n\nRun this script from the directory containing the sugarchain, gitian-builder, gitian.sigs.sugar, and sugarchain-detached-sigs.\n\nArguments:\nsigner          GPG signer to sign each build assert file\nversion\t\tVersion number, commit, or branch to build. If building a commit or branch, the -c option must be specified\n\nOptions:\n-c|--commit\tIndicate that the version argument is for a commit or branch\n-u|--url\tSpecify the URL of the repository. Default is https://github.com/sugarchain-project/sugarchain\n-v|--verify \tVerify the Gitian build\n-b|--build\tDo a Gitian build\n-s|--sign\tMake signed binaries for Windows and Mac OSX\n-B|--buildsign\tBuild both signed and unsigned binaries\n-o|--os\t\tSpecify which Operating Systems the build is for. Default is lwx. l for linux, w for windows, x for osx\n-j\t\tNumber of processes to use. Default 2\n-m\t\tMemory to allocate in MiB. Default 2000\n--kvm           Use KVM instead of LXC\n--setup         Set up the Gitian building environment. Uses KVM. If you want to use lxc, use the --lxc option. Only works on Debian-based systems (Ubuntu, Debian)\n--detach-sign   Create the assert file for detached signing. Will not commit anything.\n--no-commit     Do not commit anything to git\n-h|--help\tPrint this help message\nEOF\n\n# Get options and arguments\nwhile :; do\n    case $1 in\n        # Verify\n        -v|--verify)\n\t    verify=true\n            ;;\n        # Build\n        -b|--build)\n\t    build=true\n            ;;\n        # Sign binaries\n        -s|--sign)\n\t    sign=true\n            ;;\n        # Build then Sign\n        -B|--buildsign)\n\t    sign=true\n\t    build=true\n            ;;\n        # PGP Signer\n        -S|--signer)\n\t    if [ -n \"$2\" ]\n\t    then\n\t\tSIGNER=$2\n\t\tshift\n\t    else\n\t\techo 'Error: \"--signer\" requires a non-empty argument.'\n\t\texit 1\n\t    fi\n           ;;\n        # Operating Systems\n        -o|--os)\n\t    if [ -n \"$2\" ]\n\t    then\n\t\tlinux=false\n\t\twindows=false\n\t\tosx=false\n\t\tif [[ \"$2\" = *\"l\"* ]]\n\t\tthen\n\t\t    linux=true\n\t\tfi\n\t\tif [[ \"$2\" = *\"w\"* ]]\n\t\tthen\n\t\t    windows=true\n\t\tfi\n\t\tif [[ \"$2\" = *\"x\"* ]]\n\t\tthen\n\t\t    osx=true\n\t\tfi\n\t\tshift\n\t    else\n\t\techo 'Error: \"--os\" requires an argument containing an l (for linux), w (for windows), or x (for Mac OSX)'\n\t\texit 1\n\t    fi\n\t    ;;\n\t# Help message\n\t-h|--help)\n\t    echo \"$usage\"\n\t    exit 0\n\t    ;;\n\t# Commit or branch\n\t-c|--commit)\n\t    commit=true\n\t    ;;\n\t# Number of Processes\n\t-j)\n\t    if [ -n \"$2\" ]\n\t    then\n\t\tproc=$2\n\t\tshift\n\t    else\n\t\techo 'Error: \"-j\" requires an argument'\n\t\texit 1\n\t    fi\n\t    ;;\n\t# Memory to allocate\n\t-m)\n\t    if [ -n \"$2\" ]\n\t    then\n\t\tmem=$2\n\t\tshift\n\t    else\n\t\techo 'Error: \"-m\" requires an argument'\n\t\texit 1\n\t    fi\n\t    ;;\n\t# URL\n\t-u)\n\t    if [ -n \"$2\" ]\n\t    then\n\t\turl=$2\n\t\tshift\n\t    else\n\t\techo 'Error: \"-u\" requires an argument'\n\t\texit 1\n\t    fi\n\t    ;;\n        # kvm\n        --kvm)\n            lxc=false\n            ;;\n        # Detach sign\n        --detach-sign)\n            signProg=\"true\"\n            commitFiles=false\n            ;;\n        # Commit files\n        --no-commit)\n            commitFiles=false\n            ;;\n        # Setup\n        --setup)\n            setup=true\n            ;;\n\t*)               # Default case: If no more options then break out of the loop.\n             break\n    esac\n    shift\ndone\n\n# Set up LXC\nif [[ $lxc = true ]]\nthen\n    export USE_LXC=1\nfi\n\n# Check for OSX SDK\nif [[ ! -e \"gitian-builder/inputs/MacOSX10.11.sdk.tar.gz\" && $osx == true ]]\nthen\n    echo \"Cannot build for OSX, SDK does not exist. Will build for other OSes\"\n    osx=false\nfi\n\n# Get signer\nif [[ -n \"$1\" ]]\nthen\n    SIGNER=$1\n    shift\nfi\n\n# Get version\nif [[ -n \"$1\" ]]\nthen\n    VERSION=$1\n    COMMIT=$VERSION\n    shift\nfi\n\n# Check that a signer is specified\nif [[ $SIGNER == \"\" ]]\nthen\n    echo \"$scriptName: Missing signer.\"\n    echo \"Try $scriptName --help for more information\"\n    exit 1\nfi\n\n# Check that a version is specified\nif [[ $VERSION == \"\" ]]\nthen\n    echo \"$scriptName: Missing version.\"\n    echo \"Try $scriptName --help for more information\"\n    exit 1\nfi\n\n# Add a \"v\" if no -c\nif [[ $commit = false ]]\nthen\n\tCOMMIT=\"v${VERSION}\"\nfi\necho ${COMMIT}\n\n# Setup build environment\nif [[ $setup = true ]]\nthen\n    sudo apt-get install ruby apache2 git apt-cacher-ng python-vm-builder qemu-kvm qemu-utils\n    git clone https://github.com/sugarchain-project/gitian.sigs.sugar.git\n    git clone https://github.com/sugarchain-project/sugarchain-detached-sigs.git\n    git clone https://github.com/devrandom/gitian-builder.git\n    pushd ./gitian-builder\n    if [[ -n \"$USE_LXC\" ]]\n    then\n        sudo apt-get install lxc\n        bin/make-base-vm --suite trusty --arch amd64 --lxc\n    else\n        bin/make-base-vm --suite trusty --arch amd64\n    fi\n    popd\nfi\n\n# Set up build\npushd ./sugarchain\ngit fetch\ngit checkout ${COMMIT}\npopd\n\n# Build\nif [[ $build = true ]]\nthen\n\t# Make output folder\n\tmkdir -p ./sugarchain-binaries/${VERSION}\n\t\n\t# Build Dependencies\n\techo \"\"\n\techo \"Building Dependencies\"\n\techo \"\"\n\tpushd ./gitian-builder\t\n\tmkdir -p inputs\n\n  # FIXME.SUGAR\n  # wget is too slow so files pre-fixed - osslsigncode and XcodeSDK\n  # wget -N -P inputs $osslPatchUrl\n  echo 'a8c4e9cafba922f89de0df1f2152e7be286aba73f78505169bc351a7938dd911 inputs/osslsigncode-Backports-to-1.7.1.patch' | sha256sum -c\n  # wget -N -P inputs $osslTarUrl\n  echo 'f9a8cdb38b9c309326764ebc937cba1523a3a751a7ab05df3ecc99d18ae466c9 inputs/osslsigncode-1.7.1.tar.gz' | sha256sum -c\n  # Xcode SDK for macOS build\n  echo 'fc65dd34a3665a549cf2dc005c1d13fcead9ba17cadac6dfd0ebc46435729898 inputs/MacOSX10.11.sdk.tar.gz' | sha256sum -c\n\n\tmake -C ../sugarchain/depends download SOURCES_PATH=`pwd`/cache/common\n\n\t# Linux\n\tif [[ $linux = true ]]\n\tthen\n            echo \"\"\n\t    echo \"Compiling ${VERSION} Linux\"\n\t    echo \"\"\n\t    ./bin/gbuild -j ${proc} -m ${mem} --commit sugarchain=${COMMIT} --url sugarchain=${url} ../sugarchain/contrib/gitian-descriptors/gitian-linux.yml\n\t    ./bin/gsign -p $signProg --signer $SIGNER --release ${VERSION}-linux --destination ../gitian.sigs.sugar/ ../sugarchain/contrib/gitian-descriptors/gitian-linux.yml\n\t    mv build/out/sugarchain-*.tar.gz build/out/src/sugarchain-*.tar.gz ../sugarchain-binaries/${VERSION}\n\tfi\n\t# Windows\n\tif [[ $windows = true ]]\n\tthen\n\t    echo \"\"\n\t    echo \"Compiling ${VERSION} Windows\"\n\t    echo \"\"\n\t    ./bin/gbuild -j ${proc} -m ${mem} --commit sugarchain=${COMMIT} --url sugarchain=${url} ../sugarchain/contrib/gitian-descriptors/gitian-win.yml\n\t    ./bin/gsign -p $signProg --signer $SIGNER --release ${VERSION}-win-unsigned --destination ../gitian.sigs.sugar/ ../sugarchain/contrib/gitian-descriptors/gitian-win.yml\n\t    mv build/out/sugarchain-*-win-unsigned.tar.gz inputs/sugarchain-win-unsigned.tar.gz\n\t    mv build/out/sugarchain-*.zip build/out/sugarchain-*.exe ../sugarchain-binaries/${VERSION}\n\tfi\n\t# Mac OSX\n\tif [[ $osx = true ]]\n\tthen\n\t    echo \"\"\n\t    echo \"Compiling ${VERSION} Mac OSX\"\n\t    echo \"\"\n\t    ./bin/gbuild -j ${proc} -m ${mem} --commit sugarchain=${COMMIT} --url sugarchain=${url} ../sugarchain/contrib/gitian-descriptors/gitian-osx.yml\n\t    ./bin/gsign -p $signProg --signer $SIGNER --release ${VERSION}-osx-unsigned --destination ../gitian.sigs.sugar/ ../sugarchain/contrib/gitian-descriptors/gitian-osx.yml\n\t    mv build/out/sugarchain-*-osx-unsigned.tar.gz inputs/sugarchain-osx-unsigned.tar.gz\n\t    mv build/out/sugarchain-*.tar.gz build/out/sugarchain-*.dmg ../sugarchain-binaries/${VERSION}\n\tfi\n\tpopd\n\n        if [[ $commitFiles = true ]]\n        then\n\t    # Commit to gitian.sigs repo\n            echo \"\"\n            echo \"Committing ${VERSION} Unsigned Sigs\"\n            echo \"\"\n            pushd gitian.sigs\n            git add ${VERSION}-linux/${SIGNER}\n            git add ${VERSION}-win-unsigned/${SIGNER}\n            git add ${VERSION}-osx-unsigned/${SIGNER}\n            git commit -a -m \"Add ${VERSION} unsigned sigs for ${SIGNER}\"\n            popd\n        fi\nfi\n\n# Verify the build\nif [[ $verify = true ]]\nthen\n\t# Linux\n\tpushd ./gitian-builder\n\techo \"\"\n\techo \"Verifying v${VERSION} Linux\"\n\techo \"\"\n\t./bin/gverify -v -d ../gitian.sigs.sugar/ -r ${VERSION}-linux ../sugarchain/contrib/gitian-descriptors/gitian-linux.yml\n\t# Windows\n\techo \"\"\n\techo \"Verifying v${VERSION} Windows\"\n\techo \"\"\n\t./bin/gverify -v -d ../gitian.sigs.sugar/ -r ${VERSION}-win-unsigned ../sugarchain/contrib/gitian-descriptors/gitian-win.yml\n\t# Mac OSX\t\n\techo \"\"\n\techo \"Verifying v${VERSION} Mac OSX\"\n\techo \"\"\t\n\t./bin/gverify -v -d ../gitian.sigs.sugar/ -r ${VERSION}-osx-unsigned ../sugarchain/contrib/gitian-descriptors/gitian-osx.yml\n\t# Signed Windows\n\techo \"\"\n\techo \"Verifying v${VERSION} Signed Windows\"\n\techo \"\"\n\t./bin/gverify -v -d ../gitian.sigs.sugar/ -r ${VERSION}-osx-signed ../sugarchain/contrib/gitian-descriptors/gitian-osx-signer.yml\n\t# Signed Mac OSX\n\techo \"\"\n\techo \"Verifying v${VERSION} Signed Mac OSX\"\n\techo \"\"\n\t./bin/gverify -v -d ../gitian.sigs.sugar/ -r ${VERSION}-osx-signed ../sugarchain/contrib/gitian-descriptors/gitian-osx-signer.yml\t\n\tpopd\nfi\n\n# Sign binaries\nif [[ $sign = true ]]\nthen\n\t\n        pushd ./gitian-builder\n\t# Sign Windows\n\tif [[ $windows = true ]]\n\tthen\n\t    echo \"\"\n\t    echo \"Signing ${VERSION} Windows\"\n\t    echo \"\"\n\t    ./bin/gbuild -i --commit signature=${COMMIT} ../sugarchain/contrib/gitian-descriptors/gitian-win-signer.yml\n\t    ./bin/gsign -p $signProg --signer $SIGNER --release ${VERSION}-win-signed --destination ../gitian.sigs.sugar/ ../sugarchain/contrib/gitian-descriptors/gitian-win-signer.yml\n\t    mv build/out/sugarchain-*win64-setup.exe ../sugarchain-binaries/${VERSION}\n\t    mv build/out/sugarchain-*win32-setup.exe ../sugarchain-binaries/${VERSION}\n\tfi\n\t# Sign Mac OSX\n\tif [[ $osx = true ]]\n\tthen\n\t    echo \"\"\n\t    echo \"Signing ${VERSION} Mac OSX\"\n\t    echo \"\"\n\t    ./bin/gbuild -i --commit signature=${COMMIT} ../sugarchain/contrib/gitian-descriptors/gitian-osx-signer.yml\n\t    ./bin/gsign -p $signProg --signer $SIGNER --release ${VERSION}-osx-signed --destination ../gitian.sigs.sugar/ ../sugarchain/contrib/gitian-descriptors/gitian-osx-signer.yml\n\t    mv build/out/sugarchain-osx-signed.dmg ../sugarchain-binaries/${VERSION}/sugarchain-${VERSION}-osx.dmg\n\tfi\n\tpopd\n\n        if [[ $commitFiles = true ]]\n        then\n            # Commit Sigs\n            pushd gitian.sigs\n            echo \"\"\n            echo \"Committing ${VERSION} Signed Sigs\"\n            echo \"\"\n            git add ${VERSION}-win-signed/${SIGNER}\n            git add ${VERSION}-osx-signed/${SIGNER}\n            git commit -a -m \"Add ${VERSION} signed binary sigs for ${SIGNER}\"\n            popd\n        fi\nfi\n"
  },
  {
    "path": "contrib/gitian-descriptors/gitian-linux.yml",
    "content": "---\nname: \"sugarchain-linux-0.16\"\nenable_cache: true\nsuites:\n- \"trusty\"\narchitectures:\n- \"amd64\"\npackages:\n- \"curl\"\n- \"g++-aarch64-linux-gnu\"\n- \"g++-4.8-aarch64-linux-gnu\"\n- \"gcc-4.8-aarch64-linux-gnu\"\n- \"binutils-aarch64-linux-gnu\"\n- \"g++-arm-linux-gnueabihf\"\n- \"g++-4.8-arm-linux-gnueabihf\"\n- \"gcc-4.8-arm-linux-gnueabihf\"\n- \"binutils-arm-linux-gnueabihf\"\n- \"g++-4.8-multilib\"\n- \"gcc-4.8-multilib\"\n- \"binutils-gold\"\n- \"git-core\"\n- \"pkg-config\"\n- \"autoconf\"\n- \"libtool\"\n- \"automake\"\n- \"faketime\"\n- \"bsdmainutils\"\n- \"ca-certificates\"\n- \"python\"\n\n# GITHUB repo select\nremotes:\n- \"url\": \"https://github.com/sugarchain-project/sugarchain.git\"\n  \"dir\": \"sugarchain\"\n\nfiles: []\nscript: |\n\n  WRAP_DIR=$HOME/wrapped\n  HOSTS=\"i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu\"\n  CONFIGFLAGS=\"--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests\"\n  FAKETIME_HOST_PROGS=\"\"\n  FAKETIME_PROGS=\"date ar ranlib nm\"\n  YESPOWER_PATH=\"/home/ubuntu/build/sugarchain/src/crypto/yespower-1.0.1\"\n  YESPOWER_OPTION=\"-fPIE -Wall -O2 -fomit-frame-pointer\"\n  HOST_CFLAGS=\"-O2 -g -I${YESPOWER_PATH} ${YESPOWER_OPTION}\"\n  HOST_CXXFLAGS=\"-O2 -g\"\n  HOST_LDFLAGS=-static-libstdc++\n\n  export QT_RCC_TEST=1\n  export GZIP=\"-9n\"\n  export TAR_OPTIONS=\"--mtime=\"$REFERENCE_DATE\\\\\\ $REFERENCE_TIME\"\"\n  export TZ=\"UTC\"\n  export BUILD_DIR=`pwd`\n  mkdir -p ${WRAP_DIR}\n  if test -n \"$GBUILD_CACHE_ENABLED\"; then\n    export SOURCES_PATH=${GBUILD_COMMON_CACHE}\n    export BASE_CACHE=${GBUILD_PACKAGE_CACHE}\n    mkdir -p ${BASE_CACHE} ${SOURCES_PATH}\n  fi\n\n  function create_global_faketime_wrappers {\n  for prog in ${FAKETIME_PROGS}; do\n    echo '#!/bin/bash' > ${WRAP_DIR}/${prog}\n    echo \"REAL=\\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\\`\" >> ${WRAP_DIR}/${prog}\n    echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}\n    echo \"export FAKETIME=\\\"$1\\\"\" >> ${WRAP_DIR}/${prog}\n    echo \"\\$REAL \\$@\" >> $WRAP_DIR/${prog}\n    chmod +x ${WRAP_DIR}/${prog}\n  done\n  }\n\n  function create_per-host_faketime_wrappers {\n  for i in $HOSTS; do\n    for prog in ${FAKETIME_HOST_PROGS}; do\n        echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}\n        echo \"REAL=\\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\\`\" >> ${WRAP_DIR}/${i}-${prog}\n        echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}\n        echo \"export FAKETIME=\\\"$1\\\"\" >> ${WRAP_DIR}/${i}-${prog}\n        echo \"\\$REAL \\$@\" >> $WRAP_DIR/${i}-${prog}\n        chmod +x ${WRAP_DIR}/${i}-${prog}\n    done\n  done\n  }\n\n  # Faketime for depends so intermediate results are comparable\n  export PATH_orig=${PATH}\n  create_global_faketime_wrappers \"2000-01-01 12:00:00\"\n  create_per-host_faketime_wrappers \"2000-01-01 12:00:00\"\n  export PATH=${WRAP_DIR}:${PATH}\n\n  EXTRA_INCLUDES_BASE=$WRAP_DIR/extra_includes\n  mkdir -p $EXTRA_INCLUDES_BASE\n\n  # x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm,\n  # but we can't write there. Instead, create a link here and force it to be included in the\n  # search paths by wrapping gcc/g++.\n\n  mkdir -p $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu\n  rm -f $WRAP_DIR/extra_includes/i686-pc-linux-gnu/asm\n  ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu/asm\n\n  for prog in gcc g++; do\n  rm -f ${WRAP_DIR}/${prog}\n  cat << EOF > ${WRAP_DIR}/${prog}\n  #!/bin/bash\n  REAL=\"`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1`\"\n  for var in \"\\$@\"\n  do\n    if [ \"\\$var\" = \"-m32\" ]; then\n      export C_INCLUDE_PATH=\"$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu\"\n      export CPLUS_INCLUDE_PATH=\"$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu\"\n      break\n    fi\n  done\n  \\$REAL \\$@\n  EOF\n  chmod +x ${WRAP_DIR}/${prog}\n  done\n\n  cd sugarchain\n  BASEPREFIX=`pwd`/depends\n  # Build dependencies for each host\n  for i in $HOSTS; do\n    EXTRA_INCLUDES=\"$EXTRA_INCLUDES_BASE/$i\"\n    if [ -d \"$EXTRA_INCLUDES\" ]; then\n      export HOST_ID_SALT=\"$EXTRA_INCLUDES\"\n    fi\n    make ${MAKEOPTS} -C ${BASEPREFIX} HOST=\"${i}\"\n    unset HOST_ID_SALT\n  done\n\n  # Faketime for binaries\n  export PATH=${PATH_orig}\n  create_global_faketime_wrappers \"${REFERENCE_DATETIME}\"\n  create_per-host_faketime_wrappers \"${REFERENCE_DATETIME}\"\n  export PATH=${WRAP_DIR}:${PATH}\n\n  # Create the release tarball using (arbitrarily) the first host\n  ./autogen.sh\n  CONFIG_SITE=${BASEPREFIX}/`echo \"${HOSTS}\" | awk '{print $1;}'`/share/config.site ./configure --prefix=/\n  make dist\n  SOURCEDIST=`echo sugarchain-*.tar.gz`\n  DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`\n  # Correct tar file order\n  mkdir -p temp\n  pushd temp\n  tar xf ../$SOURCEDIST\n  find sugarchain-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST\n  popd\n\n  # Workaround for tarball not building with the bare tag version (prep)\n  make -C src obj/build.h\n\n  ORIGPATH=\"$PATH\"\n  # Extract the release tarball into a dir for each host and build\n  for i in ${HOSTS}; do\n    export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}\n    mkdir -p distsrc-${i}\n    cd distsrc-${i}\n    INSTALLPATH=`pwd`/installed/${DISTNAME}\n    mkdir -p ${INSTALLPATH}\n    tar --strip-components=1 -xf ../$SOURCEDIST\n\n    # Workaround for tarball not building with the bare tag version\n    echo '#!/bin/true' >share/genbuild.sh\n    mkdir src/obj\n    cp ../src/obj/build.h src/obj/\n\n    CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS=\"${HOST_CFLAGS}\" CXXFLAGS=\"${HOST_CXXFLAGS}\" LDFLAGS=\"${HOST_LDFLAGS}\"\n    make ${MAKEOPTS}\n    make ${MAKEOPTS} -C src check-security\n\n    #TODO: This is a quick hack that disables symbol checking for arm.\n    #      Instead, we should investigate why these are popping up.\n    #      For aarch64, we'll need to bump up the min GLIBC version, as the abi\n    #      support wasn't introduced until 2.17.\n    case $i in\n       aarch64-*) : ;;\n       arm-*) : ;;\n       *) make ${MAKEOPTS} -C src check-symbols ;;\n    esac\n\n    make install DESTDIR=${INSTALLPATH}\n    cd installed\n    find . -name \"lib*.la\" -delete\n    find . -name \"lib*.a\" -delete\n    rm -rf ${DISTNAME}/lib/pkgconfig\n    find ${DISTNAME}/bin -type f -executable -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \\;\n    find ${DISTNAME}/lib -type f -exec ../contrib/devtools/split-debug.sh {} {} {}.dbg \\;\n    find ${DISTNAME} -not -name \"*.dbg\" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz\n    find ${DISTNAME} -name \"*.dbg\" | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}-debug.tar.gz\n    cd ../../\n    rm -rf distsrc-${i}\n  done\n  mkdir -p $OUTDIR/src\n  mv $SOURCEDIST $OUTDIR/src\n"
  },
  {
    "path": "contrib/gitian-descriptors/gitian-osx-signer.yml",
    "content": "---\nname: \"sugarchain-dmg-signer\"\nsuites:\n- \"trusty\"\narchitectures:\n- \"amd64\"\npackages:\n- \"faketime\"\nremotes:\n- \"url\": \"https://github.com/sugarchain-project/sugarchain-detached-sigs.git\"\n  \"dir\": \"signature\"\nfiles:\n- \"sugarchain-osx-unsigned.tar.gz\"\nscript: |\n  WRAP_DIR=$HOME/wrapped\n  mkdir -p ${WRAP_DIR}\n  export PATH=`pwd`:$PATH\n  FAKETIME_PROGS=\"dmg genisoimage\"\n\n  # Create global faketime wrappers\n  for prog in ${FAKETIME_PROGS}; do\n    echo '#!/bin/bash' > ${WRAP_DIR}/${prog}\n    echo \"REAL=\\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\\`\" >> ${WRAP_DIR}/${prog}\n    echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}\n    echo \"export FAKETIME=\\\"${REFERENCE_DATETIME}\\\"\" >> ${WRAP_DIR}/${prog}\n    echo \"\\$REAL \\$@\" >> $WRAP_DIR/${prog}\n    chmod +x ${WRAP_DIR}/${prog}\n  done\n\n  UNSIGNED=sugarchain-osx-unsigned.tar.gz\n  SIGNED=sugarchain-osx-signed.dmg\n\n  tar -xf ${UNSIGNED}\n  OSX_VOLNAME=\"$(cat osx_volname)\"\n  ./detached-sig-apply.sh ${UNSIGNED} signature/osx\n  ${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V \"${OSX_VOLNAME}\" -no-pad -r -dir-mode 0755 -apple -o uncompressed.dmg signed-app\n  ${WRAP_DIR}/dmg dmg uncompressed.dmg ${OUTDIR}/${SIGNED}\n"
  },
  {
    "path": "contrib/gitian-descriptors/gitian-osx.yml",
    "content": "---\nname: \"sugarchain-osx-0.16\"\nenable_cache: true\nsuites:\n- \"trusty\"\narchitectures:\n- \"amd64\"\npackages:\n- \"ca-certificates\"\n- \"curl\"\n- \"g++\"\n- \"git-core\"\n- \"pkg-config\"\n- \"autoconf\"\n- \"librsvg2-bin\"\n- \"libtiff-tools\"\n- \"libtool\"\n- \"automake\"\n- \"faketime\"\n- \"bsdmainutils\"\n- \"cmake\"\n- \"imagemagick\"\n- \"libcap-dev\"\n- \"libz-dev\"\n- \"libbz2-dev\"\n- \"python\"\n- \"python-dev\"\n- \"python-setuptools\"\n- \"fonts-tuffy\"\n\n# GITHUB repo select\nremotes:\n- \"url\": \"https://github.com/sugarchain-project/sugarchain.git\"\n  \"dir\": \"sugarchain\"\n\nfiles:\n- \"MacOSX10.11.sdk.tar.gz\"\nscript: |\n  WRAP_DIR=$HOME/wrapped\n  HOSTS=\"x86_64-apple-darwin11\"\n  CONFIGFLAGS=\"--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage\"\n  FAKETIME_HOST_PROGS=\"\"\n  FAKETIME_PROGS=\"ar ranlib date dmg genisoimage\"\n  YESPOWER_PATH=\"/home/ubuntu/build/sugarchain/src/crypto/yespower-1.0.1\"\n  YESPOWER_OPTION=\"-fPIE -Wall -O2 -fomit-frame-pointer\"\n  HOST_CFLAGS=\"-I${YESPOWER_PATH} ${YESPOWER_OPTION}\"\n\n  export QT_RCC_TEST=1\n  export GZIP=\"-9n\"\n  export TAR_OPTIONS=\"--mtime=\"$REFERENCE_DATE\\\\\\ $REFERENCE_TIME\"\"\n  export TZ=\"UTC\"\n  export BUILD_DIR=`pwd`\n  mkdir -p ${WRAP_DIR}\n  if test -n \"$GBUILD_CACHE_ENABLED\"; then\n    export SOURCES_PATH=${GBUILD_COMMON_CACHE}\n    export BASE_CACHE=${GBUILD_PACKAGE_CACHE}\n    mkdir -p ${BASE_CACHE} ${SOURCES_PATH}\n  fi\n\n  export ZERO_AR_DATE=1\n\n  function create_global_faketime_wrappers {\n  for prog in ${FAKETIME_PROGS}; do\n    echo '#!/bin/bash' > ${WRAP_DIR}/${prog}\n    echo \"REAL=\\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\\`\" >> ${WRAP_DIR}/${prog}\n    echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}\n    echo \"export FAKETIME=\\\"$1\\\"\" >> ${WRAP_DIR}/${prog}\n    echo \"\\$REAL \\$@\" >> $WRAP_DIR/${prog}\n    chmod +x ${WRAP_DIR}/${prog}\n  done\n  }\n\n  function create_per-host_faketime_wrappers {\n  for i in $HOSTS; do\n    for prog in ${FAKETIME_HOST_PROGS}; do\n        echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}\n        echo \"REAL=\\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\\`\" >> ${WRAP_DIR}/${i}-${prog}\n        echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}\n        echo \"export FAKETIME=\\\"$1\\\"\" >> ${WRAP_DIR}/${i}-${prog}\n        echo \"\\$REAL \\$@\" >> $WRAP_DIR/${i}-${prog}\n        chmod +x ${WRAP_DIR}/${i}-${prog}\n    done\n  done\n  }\n\n  # Faketime for depends so intermediate results are comparable\n  export PATH_orig=${PATH}\n  create_global_faketime_wrappers \"2000-01-01 12:00:00\"\n  create_per-host_faketime_wrappers \"2000-01-01 12:00:00\"\n  export PATH=${WRAP_DIR}:${PATH}\n\n  cd sugarchain\n  BASEPREFIX=`pwd`/depends\n\n  mkdir -p ${BASEPREFIX}/SDKs\n  tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.11.sdk.tar.gz\n\n  # Build dependencies for each host\n  for i in $HOSTS; do\n    make ${MAKEOPTS} -C ${BASEPREFIX} HOST=\"${i}\"\n  done\n\n  # Faketime for binaries\n  export PATH=${PATH_orig}\n  create_global_faketime_wrappers \"${REFERENCE_DATETIME}\"\n  create_per-host_faketime_wrappers \"${REFERENCE_DATETIME}\"\n  export PATH=${WRAP_DIR}:${PATH}\n\n  # Create the release tarball using (arbitrarily) the first host\n  ./autogen.sh\n  CONFIG_SITE=${BASEPREFIX}/`echo \"${HOSTS}\" | awk '{print $1;}'`/share/config.site ./configure --prefix=/\n  make dist\n  SOURCEDIST=`echo sugarchain-*.tar.gz`\n  DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`\n\n  # Correct tar file order\n  mkdir -p temp\n  pushd temp\n  tar xf ../$SOURCEDIST\n  find sugarchain-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST\n  popd\n\n  # Workaround for tarball not building with the bare tag version (prep)\n  make -C src obj/build.h\n\n  ORIGPATH=\"$PATH\"\n  # Extract the release tarball into a dir for each host and build\n  for i in ${HOSTS}; do\n    export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}\n    mkdir -p distsrc-${i}\n    cd distsrc-${i}\n    INSTALLPATH=`pwd`/installed/${DISTNAME}\n    mkdir -p ${INSTALLPATH}\n    tar --strip-components=1 -xf ../$SOURCEDIST\n\n    # Workaround for tarball not building with the bare tag version\n    echo '#!/bin/true' >share/genbuild.sh\n    mkdir src/obj\n    cp ../src/obj/build.h src/obj/\n\n    CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS=\"${HOST_CFLAGS}\"\n    make ${MAKEOPTS}\n    make install-strip DESTDIR=${INSTALLPATH}\n\n    make osx_volname\n    make deploydir\n    OSX_VOLNAME=\"$(cat osx_volname)\"\n    mkdir -p unsigned-app-${i}\n    cp osx_volname unsigned-app-${i}/\n    cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i}\n    cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i}\n    cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i}\n    cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate\n    cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff\n    mv dist unsigned-app-${i}\n    pushd unsigned-app-${i}\n    find . | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-osx-unsigned.tar.gz\n    popd\n\n    make deploy\n    ${WRAP_DIR}/dmg dmg \"${OSX_VOLNAME}.dmg\" ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg\n\n    cd installed\n    find . -name \"lib*.la\" -delete\n    find . -name \"lib*.a\" -delete\n    rm -rf ${DISTNAME}/lib/pkgconfig\n    find ${DISTNAME} | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz\n    cd ../../\n  done\n  mkdir -p $OUTDIR/src\n  mv $SOURCEDIST $OUTDIR/src\n  mv ${OUTDIR}/${DISTNAME}-x86_64-*.tar.gz ${OUTDIR}/${DISTNAME}-osx64.tar.gz\n"
  },
  {
    "path": "contrib/gitian-descriptors/gitian-win-signer.yml",
    "content": "---\nname: \"sugarchain-win-signer\"\nsuites:\n- \"trusty\"\narchitectures:\n- \"amd64\"\npackages:\n- \"libssl-dev\"\n- \"autoconf\"\nremotes:\n- \"url\": \"https://github.com/sugarchain-project/sugarchain-detached-sigs.git\"\n  \"dir\": \"signature\"\nfiles:\n- \"osslsigncode-1.7.1.tar.gz\"\n- \"osslsigncode-Backports-to-1.7.1.patch\"\n- \"sugarchain-win-unsigned.tar.gz\"\nscript: |\n  BUILD_DIR=`pwd`\n  SIGDIR=${BUILD_DIR}/signature/win\n  UNSIGNED_DIR=${BUILD_DIR}/unsigned\n\n  echo \"f9a8cdb38b9c309326764ebc937cba1523a3a751a7ab05df3ecc99d18ae466c9  osslsigncode-1.7.1.tar.gz\" | sha256sum -c\n  echo \"a8c4e9cafba922f89de0df1f2152e7be286aba73f78505169bc351a7938dd911  osslsigncode-Backports-to-1.7.1.patch\" | sha256sum -c\n\n  mkdir -p ${UNSIGNED_DIR}\n  tar -C ${UNSIGNED_DIR} -xf sugarchain-win-unsigned.tar.gz\n\n  tar xf osslsigncode-1.7.1.tar.gz\n  cd osslsigncode-1.7.1\n  patch -p1 < ${BUILD_DIR}/osslsigncode-Backports-to-1.7.1.patch\n\n  ./configure --without-gsf --without-curl --disable-dependency-tracking\n  make\n  find ${UNSIGNED_DIR} -name \"*-unsigned.exe\" | while read i; do\n    INFILE=\"`basename \"${i}\"`\"\n    OUTFILE=\"`echo \"${INFILE}\" | sed s/-unsigned//`\"\n    ./osslsigncode attach-signature -in \"${i}\" -out \"${OUTDIR}/${OUTFILE}\" -sigin \"${SIGDIR}/${INFILE}.pem\"\n  done\n"
  },
  {
    "path": "contrib/gitian-descriptors/gitian-win.yml",
    "content": "---\nname: \"sugarchain-win-0.16\"\nenable_cache: true\nsuites:\n- \"trusty\"\narchitectures:\n- \"amd64\"\npackages:\n- \"curl\"\n- \"g++\"\n- \"git-core\"\n- \"pkg-config\"\n- \"autoconf\"\n- \"libtool\"\n- \"automake\"\n- \"faketime\"\n- \"bsdmainutils\"\n- \"mingw-w64\"\n- \"g++-mingw-w64\"\n- \"nsis\"\n- \"zip\"\n- \"ca-certificates\"\n- \"python\"\n\n# GITHUB repo select\nremotes:\n- \"url\": \"https://github.com/sugarchain-project/sugarchain.git\"\n  \"dir\": \"sugarchain\"\n\nfiles: []\nscript: |\n  WRAP_DIR=$HOME/wrapped\n  HOSTS=\"i686-w64-mingw32 x86_64-w64-mingw32\"\n  WIN_BITCOIN_CONFIG=\"--disable-shared\"\n  CONFIGFLAGS=\"--enable-reduce-exports --disable-bench --disable-gui-tests ${WIN_BITCOIN_CONFIG}\"\n  FAKETIME_HOST_PROGS=\"g++ ar ranlib nm windres strip objcopy\"\n  FAKETIME_PROGS=\"date makensis zip\"\n  YESPOWER_PATH=\"/home/ubuntu/build/sugarchain/src/crypto/yespower-1.0.1\"\n  YESPOWER_OPTION=\"-fPIE -Wall -O2 -fomit-frame-pointer\"\n  HOST_CFLAGS=\"-O2 -g -I${YESPOWER_PATH} ${YESPOWER_OPTION}\"\n  HOST_CXXFLAGS=\"-O2 -g\"\n\n  export QT_RCC_TEST=1\n  export GZIP=\"-9n\"\n  export TAR_OPTIONS=\"--mtime=\"$REFERENCE_DATE\\\\\\ $REFERENCE_TIME\"\"\n  export TZ=\"UTC\"\n  export BUILD_DIR=`pwd`\n  mkdir -p ${WRAP_DIR}\n  if test -n \"$GBUILD_CACHE_ENABLED\"; then\n    export SOURCES_PATH=${GBUILD_COMMON_CACHE}\n    export BASE_CACHE=${GBUILD_PACKAGE_CACHE}\n    mkdir -p ${BASE_CACHE} ${SOURCES_PATH}\n  fi\n\n  function create_global_faketime_wrappers {\n  for prog in ${FAKETIME_PROGS}; do\n    echo '#!/bin/bash' > ${WRAP_DIR}/${prog}\n    echo \"REAL=\\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\\`\" >> ${WRAP_DIR}/${prog}\n    echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}\n    echo \"export FAKETIME=\\\"$1\\\"\" >> ${WRAP_DIR}/${prog}\n    echo \"\\$REAL \\$@\" >> $WRAP_DIR/${prog}\n    chmod +x ${WRAP_DIR}/${prog}\n  done\n  }\n\n  function create_per-host_faketime_wrappers {\n  for i in $HOSTS; do\n    for prog in ${FAKETIME_HOST_PROGS}; do\n        echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}\n        echo \"REAL=\\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\\`\" >> ${WRAP_DIR}/${i}-${prog}\n        echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}\n        echo \"export FAKETIME=\\\"$1\\\"\" >> ${WRAP_DIR}/${i}-${prog}\n        echo \"\\$REAL \\$@\" >> $WRAP_DIR/${i}-${prog}\n        chmod +x ${WRAP_DIR}/${i}-${prog}\n    done\n  done\n  }\n\n  function create_per-host_linker_wrapper {\n  # This is only needed for trusty, as the mingw linker leaks a few bytes of\n  # heap, causing non-determinism. See discussion in https://github.com/bitcoin/bitcoin/pull/6900\n  for i in $HOSTS; do\n    mkdir -p ${WRAP_DIR}/${i}\n    for prog in collect2; do\n        echo '#!/bin/bash' > ${WRAP_DIR}/${i}/${prog}\n        REAL=$(${i}-gcc -print-prog-name=${prog})\n        echo \"export MALLOC_PERTURB_=255\" >> ${WRAP_DIR}/${i}/${prog}\n        echo \"${REAL} \\$@\" >> $WRAP_DIR/${i}/${prog}\n        chmod +x ${WRAP_DIR}/${i}/${prog}\n    done\n    for prog in gcc g++; do\n        echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}\n        echo \"REAL=\\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\\`\" >> ${WRAP_DIR}/${i}-${prog}\n        echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}\n        echo \"export FAKETIME=\\\"$1\\\"\" >> ${WRAP_DIR}/${i}-${prog}\n        echo \"export COMPILER_PATH=${WRAP_DIR}/${i}\" >> ${WRAP_DIR}/${i}-${prog}\n        echo \"\\$REAL \\$@\" >> $WRAP_DIR/${i}-${prog}\n        chmod +x ${WRAP_DIR}/${i}-${prog}\n    done\n  done\n  }\n\n  # Faketime for depends so intermediate results are comparable\n  export PATH_orig=${PATH}\n  create_global_faketime_wrappers \"2000-01-01 12:00:00\"\n  create_per-host_faketime_wrappers \"2000-01-01 12:00:00\"\n  create_per-host_linker_wrapper \"2000-01-01 12:00:00\"\n  export PATH=${WRAP_DIR}:${PATH}\n\n  cd sugarchain\n  BASEPREFIX=`pwd`/depends\n  # Build dependencies for each host\n  for i in $HOSTS; do\n    make ${MAKEOPTS} -C ${BASEPREFIX} HOST=\"${i}\"\n  done\n\n  # Faketime for binaries\n  export PATH=${PATH_orig}\n  create_global_faketime_wrappers \"${REFERENCE_DATETIME}\"\n  create_per-host_faketime_wrappers \"${REFERENCE_DATETIME}\"\n  create_per-host_linker_wrapper \"${REFERENCE_DATETIME}\"\n  export PATH=${WRAP_DIR}:${PATH}\n\n  # Create the release tarball using (arbitrarily) the first host\n  ./autogen.sh\n  CONFIG_SITE=${BASEPREFIX}/`echo \"${HOSTS}\" | awk '{print $1;}'`/share/config.site ./configure --prefix=/\n  make dist\n  SOURCEDIST=`echo sugarchain-*.tar.gz`\n  DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`\n\n  # Correct tar file order\n  mkdir -p temp\n  pushd temp\n  tar xf ../$SOURCEDIST\n  find sugarchain-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST\n  mkdir -p $OUTDIR/src\n  cp ../$SOURCEDIST $OUTDIR/src\n  popd\n\n  # Workaround for tarball not building with the bare tag version (prep)\n  make -C src obj/build.h\n\n  ORIGPATH=\"$PATH\"\n  # Extract the release tarball into a dir for each host and build\n  for i in ${HOSTS}; do\n    export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}\n    mkdir -p distsrc-${i}\n    cd distsrc-${i}\n    INSTALLPATH=`pwd`/installed/${DISTNAME}\n    mkdir -p ${INSTALLPATH}\n    tar --strip-components=1 -xf ../$SOURCEDIST\n\n    # Workaround for tarball not building with the bare tag version\n    echo '#!/bin/true' >share/genbuild.sh\n    mkdir src/obj\n    cp ../src/obj/build.h src/obj/\n\n    CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CFLAGS=\"${HOST_CFLAGS}\" CXXFLAGS=\"${HOST_CXXFLAGS}\"\n    make ${MAKEOPTS}\n    make ${MAKEOPTS} -C src check-security\n    make deploy\n    make install DESTDIR=${INSTALLPATH}\n    rename 's/-setup\\.exe$/-setup-unsigned.exe/' *-setup.exe\n    cp -f sugarchain-*setup*.exe $OUTDIR/\n    cd installed\n\n    # BEGIN - DISABLE SHARED\n    # WIN_BITCOIN_CONFIG=\"--disable-shared\"\n    # mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/\n    if [ -f ${DISTNAME}/bin/*.dll ]; then\n      mv ${DISTNAME}/bin/*.dll ${DISTNAME}/lib/\n    fi\n    # END - DISABLE SHARED\n\n    find . -name \"lib*.la\" -delete\n    find . -name \"lib*.a\" -delete\n    rm -rf ${DISTNAME}/lib/pkgconfig\n    find ${DISTNAME}/bin -type f -executable -exec ${i}-objcopy --only-keep-debug {} {}.dbg \\; -exec ${i}-strip -s {} \\; -exec ${i}-objcopy --add-gnu-debuglink={}.dbg {} \\;\n    find ${DISTNAME}/lib -type f -exec ${i}-objcopy --only-keep-debug {} {}.dbg \\; -exec ${i}-strip -s {} \\; -exec ${i}-objcopy --add-gnu-debuglink={}.dbg {} \\;\n    find ${DISTNAME} -not -name \"*.dbg\"  -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}.zip\n    find ${DISTNAME} -name \"*.dbg\"  -type f | sort | zip -X@ ${OUTDIR}/${DISTNAME}-${i}-debug.zip\n    cd ../../\n    rm -rf distsrc-${i}\n  done\n  cp -rf contrib/windeploy $BUILD_DIR\n  cd $BUILD_DIR/windeploy\n  mkdir unsigned\n  cp $OUTDIR/sugarchain-*setup-unsigned.exe unsigned/\n  find . | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-win-unsigned.tar.gz\n  mv ${OUTDIR}/${DISTNAME}-x86_64-*-debug.zip ${OUTDIR}/${DISTNAME}-win64-debug.zip\n  mv ${OUTDIR}/${DISTNAME}-i686-*-debug.zip ${OUTDIR}/${DISTNAME}-win32-debug.zip\n  mv ${OUTDIR}/${DISTNAME}-x86_64-*.zip ${OUTDIR}/${DISTNAME}-win64.zip\n  mv ${OUTDIR}/${DISTNAME}-i686-*.zip ${OUTDIR}/${DISTNAME}-win32.zip\n"
  },
  {
    "path": "contrib/gitian-keys/Ghrog-pubkey.asc",
    "content": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBFx+iC8BEADBJfauZ0OKbWPhqmSt/4MyYJCyQjVLAXAp5eCdafHZ4Kf+v5y0\nGM2CW5DKw4EGwo9PhreKtV0o6T3T6oqofWB1iH2KsjJdl4supjfMP5aazsP8JAvi\nKIxCANeEQWvf/W915aPFK9Toq7zHGc/AujdZFn7AqvjEOJgsIMYYlsWWBMqgsZKw\npYF6tfFvHbTnkrvUx5npx7+x7j1Z0mofRUsvcH9r5fB67/ZkJMHccuHjf5UJZTsI\ngjsYC8/omwJkkXkMYLW7fS5xRWlQXuE9Yg4Rrwa8NEiFSY8SHMe2/bxzN0hJplQJ\nqjp4lagn/JE37zHh2WCq5zMbyjmHzy+IW8oz8samVNqkmRbzEqtXTuWP46nx9kLP\nPMDW2W7rCxfPFSWhrx/ejJByjbwz8QAmDszGwd9wWYoeytmWnBPtdljvzwt9yNZw\nxe07vNgjuk7cHu+OqV4OlrL34vt6VL0rw+UJGkGRds9+739kyAwvGbt5x+QRXJQk\no8Bs3gh+cQgebyZ+jgoDWB95/xjY1jUsVuaEK8Ae7QXRjW5LnIha0tqj/LfM2hEQ\nOONRRzaFEIu/ttxPYMNtp5TrwECU+2/ssWLXQXtaxMF4yewMIkV4B6ulsCwD0CKU\nbRHe+Vef83+8bpbmNOw6hJf83E6mk4/wEiAmpnJdo02Dt2mwVdeTOetCLQARAQAB\ntC9HaHJvZyAoc3VnYXJjaGFpbiBkZXZlbG9wZXIpIDxnaHJvZ3lAZ21haWwuY29t\nPokCVAQTAQoAPhYhBDPI3OP4JeL4umO64DJwOKii+ylFBQJcfogvAhsDBQkHhM4A\nBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEDJwOKii+ylFkZcP+gO875IR34mr\nlmF9x7LYgx61jwBOmWDF1xVbRZiV8OZ3CyucZcZf8l3XKAZJfcR8VXZJZ6gHpQ5o\notl5PPBGTJAOygQtjOcwkVwRuP0xGkWrxgD4KTAR/UjvWTDkd71hjqOwZVhKir6b\nn4hS+yT/gQ8gCPEPZy+02VLjrgePfWSYgU6sALaxC1kY1KJhRcsQUQ7ETBzAi+Q6\nO8LkXrCdIU3TrLLBwPtXHqQt1P4Lm22MEdWV9R0Du8IeKiY+bWw7l0Wak2t59SmR\n1jgIBl47CNrY+GfKpogiX1BSiBBIp9o8JMKifKQObY1R9LaBDx1ocSlKUc55Uxdf\n4JYaf8wB6nJ5ohR4+pWEHJ40qNdUTw3JykZ9HqW7ksAJygBj5URVz+hjYPHPGx+P\n7X2VVYzjqva4Dk/b4tbl7M9MNltDI5sa2bGXgfHtq7TLHKfETFGTgqDkgN6mP8Vk\nDWu0W/mHhALHGF8R9CeL6ck2JfvRMFXdF1KCwZ/s4PxogfFBrq3cFhXCtlswFBh/\nLKVNKOzGEGkLdPy+BvppNIHVdX33jfEsPt4u4bfb8V81pLVxMqzjQDUM9dUG1rPk\n+g/QoX9pIF2WW4agAFEo3yEyS1OR3WdCcM3NCCQbGjXdeCn10rpdghz3bkScdOtQ\nyg2yNgJ/a20hdikARzP5apRT79K5K+bkuQINBFx+iC8BEADaTpEAZ+5gAPl7WPDS\nluUBzL/S6EJQl94ywq0BXHJNZ7v6AGdGmV+0QSn63/ysnnw83BEXHgiVO6rYz71h\nYSnfaSbOrgdo3xxCOIcGvapLzXN3xeykiJgzaZ2gBA0N++9MrrWQTiB2821b6ROt\nyFu6yvUPMA3roZShZRBzDDYzCGYVVJE8YG6TlLWKXOGxPz103sJqcYzb/1wCdFLm\ntle8SefL0FGsEUA/ndOUhAKx7vpyczwEauXS4SYINEOJFpatZaqC/vvFu6Psp+j+\nA1FJOXr/rtMOwgvXkyceC0qnq/+fFKbRhGqcf6fqrGseNk6P9/Z1KaptspRflN79\novLAwlkLxg1NA+SIDIVHQWLbJEO55+LhzSs+gRgAi4PYec4mMsoyer8zcpImvrdp\nEc6OxQiO5MJLiX1gdZwjvnZd/bj1P7OEZa3ielQZYihAuVEvY/K5N4voYYLGg6Hf\nNJkIN8riS0E0IF3fwS5EcuaqKkAnI1OGLXoTMmr9+h5z9ACuRvFTsaobu378IO20\nCC2jAq2xEpGZYEIx3Wy5drErs0i45bVpLZ7ntyLxcPrA/+oPkd8IejVAni4K9yL3\n4s710S+G6cjnLiYR81kb/q49kXHEIANkwWNPTjG1vRYZHFztp/p/KE0jVcegKCHB\nm3sSciQ35zqwGuAP9b2yZL/TGwARAQABiQI8BBgBCgAmFiEEM8jc4/gl4vi6Y7rg\nMnA4qKL7KUUFAlx+iC8CGwwFCQeEzgAACgkQMnA4qKL7KUWeSg//edIqqxiAqBay\nUCkDqKD2KYiGW7tY+EcFp7wadFonxw2eodQnGn8hS2yCXBixyTqSsMhCdjArZQSN\np62z6KkYF94WS7xzpLXc/ajU8ZIqeiv7QmUoHO8JxvvuoyLpAPolpT7UeVE7btQG\nNXzyXgGX4qlmqNFfxpOzkWEmArVdm4FZW5LKhO/UmA20STKrWdTvq99SC6qxGSEn\nRXdTVhXM/LwZVzTmxf3LkWpkmKASBJgq2/+AKi+WmpzEKYkT98crSmz/G2QkuXT1\nr5xqrPP42zsiwgBiQq84OL81etTG4JxJwNR3pNedjqTxKD5dk29a0Or7GTQqpxQP\nC25e94TUDFsmumWJhJYGO6E8uuHVLDH/E5fbPOtClTlN1M8T/dI7aPa8ILO8VmEj\nifkd/OuH/vJVA56m3wtzwDsDWNLmTm41QhRUGUkBabEpJ74gZAqL7lPW0tEn6cZ2\ngyX3iPhn/TSLFiwqWpt6CA3th/R2ovmtP3KHKDmRA6FKZIUlc6Vqqnq2gDGhE/Qt\nMNHisT54DX7kpm/UJBNGUG9gWne0VAMoTtJRsrzH+Pe9c36LsalkTQ4WpLfyRGoI\nQG6l67xWVz1rkdSRY+tZ8AatH3x2qgxPVIhLWjhnQf5b5bPyvsF7A8v15FatScgY\nn3apjGDcf6MJ9D+gdjlMRl6VAu2dFKE=\n=w8t1\n-----END PGP PUBLIC KEY BLOCK-----\n"
  },
  {
    "path": "contrib/gitian-keys/README.md",
    "content": "PGP keys\n========\n\nThis folder contains the public keys of developers and active contributors.\n\nThe keys are mainly used to sign git commits or the build results of Gitian\nbuilds.\n\nYou can import the keys into gpg as follows. Also, make sure to fetch the\nlatest version from the key server to see if any key was revoked in the\nmeantime.\n\n```sh\ngpg --import ./*.pgp\ngpg --refresh-keys --keyserver keyserver.ubuntu.com\n```\n\nIf your pgp is not found, please submit your key as text format.\nhttps://keyserver.ubuntu.com/\n"
  },
  {
    "path": "contrib/gitian-keys/cryptozeny-pubkey.asc",
    "content": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBFx5oUYBEADofZle3HTX9LX0e0+zr2z2AwJI5My6Mc/58sJSZBJbeZlGi6Pv\nRxCYRcoaTrK6rXRhroX55Qv8IpipL+brAvreGjFWcsCkO/FXZBO6zQ0EBCGkYKYy\n1KeLMAQu0w2ghwkrwFFVArFjKCZV/fFBgnRsEmGK2b9d4dVxxF3z30XVosSabaSW\nsJxzMMQVfUG6wHDSzwIKgB85aGh1yrZLcMsTjKLiFz08ivJW+f86YQEyz6B+fBWE\nG0WwFShv9mAQuH5NWBXswmLZaVoJC8W9GpZQX9bLzWDCD6Fw/kGA5akzPB/R5ZOk\n0JjbydcTLD+JVPLIi3Lpvap7oMhzca1z37ylgC/cqOLLdCY6JCs95DDNhCFLWnac\nfE48lp7XfcKJ7L0SejsMiQCM8e8wJLdU/LR5aq4nOl9xhaBTcKBP0MvbDyPWWQTu\nh/mTsHYdT9pPr9WTXkVcnV1YVqWM5JQpNz0OVx2tf0ylBU4ccS2dHXcUIEMDznao\nxSGDvIxzZAtbbEiJvRAjImfDgQ6J2u2AdSEsOIgSJiw729YjRxlsJByNFQEwftVV\nMC6nnnox2R4cyZdh/Q97KrS5b7eT6OwpB4lyFcKv8cp+IKZoVzLwJ7y60fMmi000\nH7H7D734Gp8Wh0CBZl1PrAElhqRW0QmT7FMOoFe6GP14r+JtP6kxj6FqUQARAQAB\ntDhjcnlwdG96ZW55IChzdWdhcmNoYWluIGRldmVsb3BlcikgPGNyeXB0b3plbnlA\nZ21haWwuY29tPokCTgQTAQoAOBYhBLsnn+FZoOQO0CszZbndveKqrcQhBQJceaFG\nAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJELndveKqrcQhzJEP/A6MEzxh\nptV9GnBlYGoACbO8qm4aqDtxXq+NXtWhgGiDSdD9PBozMGqFN5BQ8FlqvwtckBXN\nQ7qdYETaUB7ADxoDgu7CIxesbh29Vaj8GJdrhbDgJPlJWbh34KjSBciDy62QbpCK\nzPgNy9zsQ6M+pSL9PgL3GV9epcmyPP5EQ+3jWv/vRwJrX1Yl49KI4Zola0/smW8O\nE5gwRoS2bmuy6MxpO/YUUg/y/ojiPmuxkmbWMYaBkwAq3hDhe4+FlEiCdll/xWbq\nJH8IAmkNZG4Tp/0vvIOgpQR5bLdY7FP7VOrn7FHrFrVIlD3zzDz9mNGhC29sU2qv\nem2SktCBlJxWCPMQTc5/tl4Y/uUVrSD6LSzbeYSO/fUDBeqdYFszjbVDxBV2a2n3\nPiPU6pEDZGxQnpqH1sgUne3MBGWfeGbraacaz4hMdKLCRwPkgRTDLCkRg9fOhoLA\nWoKSX8aVidti8Xgml9JdGbRKAFySBOk6stHWr+SN3YXVdgzcfd3YY64tzCqBg2ga\nIRkXh63Liq6CRKPGUHaHiLNxDn5VuJs0HO6IBjc1KfEITGzHcp6ZGZSYvV4ivrJ4\nPt54+n2cYC4pJFzjGM4OhFPvzApBBkc3VCrHgJi4k71+eQPU0++P0KaFXkt4oOn/\nje4i8l87TwITNiaRWac8gIq0yq3kdU6X1EixuQINBFx5oUYBEADVsy8LA/iKtD6t\njfY1KlBOHOFeuFZm2SpZoNVMT/UanXAeWG984D+UVM06DkyxCrNSI2AwxHp8qVHK\nxnH1cezPOEDwLm2tDUQREZNU0Jl6ZG9tnXzL7wGeV+hOL3iqmnmP4n5T+krbSrW7\naYLHBRt4+cq0PEFu4qgKg44D1dtZ7nlBrqG7n4ra5ZTIK7jjNkK59oYESXF0EvVf\n2FTBmmJ6sutmf4RtI1LqIkKnJuRXxlX5FtX7qQEbID0YZWKHFzj876oHBiwjQJ1Z\nDl0+oPcaG/h9+23T0Ya2bUodGCt4bWmdgYxy7rW+dYFZ/02dWDgy8MJl+EzLBpZJ\nxYmvOgwd9Y8sxFr6kmUOnPTJ1MlVykYj1qX/iX04FMMkCSBx7WICTyZFs/fP1uyp\nNqk/kCwTr0ulQRAlniJMoT61BmApcTElKP/qthdZpziJYh68/mNgG+YW4yUnALKw\n9yDmuFtihk6jQHTaL72B0anFubUpyQ0Rde1LjlxOu6QhtLRdrkoLYCzx4WdzD1Gu\n8J7NZpGDfbuXPv+ZRkIM8dWIHOZ1xvdedqzQb3YXgYLp14Bq+5KwBDMz8De+RnwZ\nhQBtdscnFraeToi0vkDi/hIyaKHPRpfPNn2zhTQH3C5dc0Q4+fpmvlM8wNLOaTYO\nw25hNYKl938ztLntiG0APC73JCg0QwARAQABiQI2BBgBCgAgFiEEuyef4Vmg5A7Q\nKzNlud294qqtxCEFAlx5oUYCGwwACgkQud294qqtxCEl3RAAjcHp30+jxMn+K5dh\naHS1aq+h5Y9/i5/UPNPJ+RAujMu/XB3OPRWwl6006Dj+finRNoALYCyBycRJGJvm\nJ6+gTlaAIOtFEL4y6rUd+WEr4W2jaPk5g8l9otOvOh6rPHfckFO64Yq3239L0/za\nl8tJTW9+Jl9lm1AbxZFGBQBhI7G26h8Jf/FMv5dcyFzzng/W9LPcoyiYlUasi899\ng+ZKyUrYw1u/Lc+gNb1avmu8WCThRyZhvWIrjbrlHb61apljmlk4lKWERewjZBJt\n8SqiMjLFUSct2M9byYYYc4EwdfRaVbw7w1v5gENxdZhtjv64f1+leJrQ8WA4DpKk\nM/EnIC1S6wEmZFIU7ZOf3H0RChXxYFmkRXgH2pU9yZVB6mnT1ItKVQ5xMyPzHOyJ\n//SV3AbKxvA346gcLH7kud9UJzrMgkq8wGP3EQklvDrbKGuJRLBsfqkerQTreAcU\nwa9aSTT1hLrVfdZkVHGX8s7Xrlwb/MPpGbt/8CfOdiUtVLr3VG8ceJPpXMBu9gRC\n7ZvUQWZkqxseaQMJHHdB0Hgu2r2qCL6ZJ5Alb7F4g/jpfFln3Y0fTFCQ50GU/FNn\n2gzL5ZH9CfFP4vf48XsC3RWwUHFH40zGspyxjQEcbuJoGj3bkzNVthuzOLlxIfoU\nQNZACZjiwLP/eSw6k/1TXJj6yYw=\n=JNjJ\n-----END PGP PUBLIC KEY BLOCK-----\n"
  },
  {
    "path": "contrib/gitian-keys/decryp2kanon-pubkey.asc",
    "content": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBF4pIToBEADg6TzaVMjlYEm6wSgE5Zmu59Tga6VJxhtSko0TZJvtE0540N/3\n24wojrodZhxclvee1E54BiLA2fYrzvgFAzqXx2i+ad3Jl/v2FZV8/+/hjI7FGR/J\nsarIhYJZF1hc4PLSz6wAupwWoekIXvkSHU6/KMzMVZTdf3yyCBuhPRORRRpcneBe\nQPI63/ej56x9Ex2CykKCwJO3N2oDIervFrLcvSNb8hZYJPj0NrRLi2r6amvppmP6\npEp0rc07kWXk1yCuX2+FckpepxSZrjrYGiQtOhUaFwvs73VP4/Iw9oCEbHoF7RS0\nR6h6xM9i6oFGpS5K2qE33h/P45IicOZhIDAeWvWxXZ2kfXK3IISL3LvhsVn1B1GG\n0LdzWJZuLeFhceVJ8G86/0L+jehhBHSwrSSqnLmiqrr9sDNrQ986yzZX8Pm66yPC\n8h/wiKkDZxOlSJ+tn+0xnXHMohwey23/JaluzuWSqNKqxKQH1OAUDzSXaKGWCbKB\nS8N7lk/X//TFeps+9osx4/cd1AJ6MfxZ6kKDHNMKsbLYc3+il+mrWpIIK7wBL/OS\nnEnjkAUppaJ4JBOGOCfiagF4TbNUk5qHnuqsSgEkinpk/A5Az81vRxmmndcDpywG\npGNsfXdZdpan3qqg5sNMHBG/fm18UDnIzDzBRcIcKgNfiHeOnUZM+xBeLwARAQAB\ntDxkZWNyeXAya2Fub24gKHN1Z2FyY2hhaW4gZGV2ZWxvcGVyKSA8ZGVjcnlwMmth\nbm9uQGdtYWlsLmNvbT6JAlQEEwEKAD4WIQSlGxlX6C5UBP/ojLmweuuAP7no6QUC\nXikhOgIbAwUJA8JnAAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRCweuuAP7no\n6UOsD/91FcQtHfGtdSIPgvwqcbqQdTdZiJzdb7Qf61xjHV7t/7rXmlo0tatIqtER\nRlCEJJ8Sfmjp1QiOcKQw6VkQW7nT7LX7JnDda0RPrrlmxaeA7yJv9pSvXsAznyYd\nfFnwRxkUWpPUfDxlyKNGbrGtSykx4lbhBsyD6HnHOQMV6vasX68dQ8lgREZfvr8K\nDLvgO5bIa9SAcRZ5xt2fIK8QqCtaQrlXCnLonqA+aPKyB3mUt/qb3Fk0GLb5pJSY\nV9yXFhdMLM0sLb+n0Lch9gChhEwtAxcfG/JRXcO9KBosbCmFuFZWzrZ0xqi9iMrE\nd+FWK2JjsFaFo/mdB6KZ0a+WY5oQj050/4KWKPXKvinHhD83jkS6uSiVYer+ZTBb\nOHmoZOjix75QpUYY9VnBFwPrVnsXA+h3doLQK+Fb56Ek6CtbdkdqDb4PucZX1idM\nUWSqZuOgoijkiRPGIIwHysPR9hgJvHAHcjaDRfQ6SIPAAORxq7OGpngMQZHrlrCM\nqME+d6nMr9+AtxXoR4S/UaviBaEAWxIjqb2o5MNPawJgYoHOIhpI1eTRH/vyRpQE\nPudDy19WfXZBKU1qNtbSfSn2Aji57ClfyI2a5sqVsKyC6merEELEx7AG3uYNz7DH\nGfcGr9iuQ5NobpJCkc25vBX17RdHh2dJKPN7L+anVjRrMvEqjLkCDQReKSE6ARAA\n1+Zeyu3QiU/dLHPLUWgSJZNKf0KZ2u5nTRnGE2Hfk741Cuyzw3L+lRONOJXogto6\nbZpeJJG1l8QMBe+TqyJ56JxW+L03ufBDaqIy4uEZ15c+/7XHIRxJlq07srzmsRRo\nFbPoprmmLhy+2UjMmWtySI3Aa7FeL0iAzdHnHY0VHBIQ5Mk/deFCr+P0o1TVccK5\nxu9ZRa4DYBoNutE6cS3nWiMiCAYkwS48yns8Qyy7LClq8ONs8vPNHP6wDIcqYnqQ\ndLqazGQnhGANjEao157sG32D2fV66uFrQuMXW/O0N/FqKtfhI1yqrbPmhOQOiwSX\nbQDdvZR69qSaO7GVv9zqBVBTqDWi4C+WKomujsCUeSbO+4klHTbHm6lly+bjisBl\n8W3plbaYxpP433ss2u1Y1h3zLxEOHp4XWs3h1aKG4bFNWUvGCHQ5K2+WPWavdk37\ndwXfJ57SWmgJSwMcdJgCPz+tvh+GeCKzQnibjGZa8SFdUCdqLXQSkgbKLddlpUrD\n5EloAPC7EWGpS4ZDPoyUqzuUdjylCKULT8HAEQQ2Xu+xblGu0czdVBRzbBTmaL8i\nb/atZTgEELXQ7jo7naifeGo8vaCMaN6ZBhRl8LcSfpGHJwuxSC5PY/bVA8Ssbi8e\ndICZXIDV1SBpK2S731WB15w6Dd05uGxfd780Icy9rH8AEQEAAYkCPAQYAQoAJhYh\nBKUbGVfoLlQE/+iMubB664A/uejpBQJeKSE6AhsMBQkDwmcAAAoJELB664A/uejp\nCacP/Auk8jSA9m3Z4vEeHWSl8QDWWqpFxX5cJKE+G4TfSIulDKym3Z+WqTwN8nxX\n0eWyws0lEJsPIMdKFXC0wPtYvazuOXxgxpN2bh7ESIVlGnus0lv1uL581w4RRRDc\nI7aZQPz/bUCvBJEi70wETBJ7cVWNmw4sQLnoIiF7I2NE3e5Tdp5zpUrykWeBVb2E\n7U9cSZ3itFERHOEZ+BbsecODxofCokeuffw4alYwDnFMlxzss3Sv+N71FPWZF/kW\n3eIkEqJ+b25jc3j6lDTMl9nInVJ3kvkL1BffJNiRoYVEXddSWD9cB4CqMbs/iF5X\nyCSUX2VI1J6/ebRENs0JTlKSzLu+fiz13v9vXeVCTCY8ZcuRDr0xSwPWpIOXRx94\nehA3VJT0yO26GVzYvSx90ceT8b00auLf6UZM0jQM4GLQgHq6YNWBw8f7ip30FMiA\nYssnAKE4VO83VOzz7pS2CKdHh6NIRXnjCm7IKpqqk0Rl0wYO+Ptc3DZnpQuaayPw\nujN5Y2ChOWDhtYbdrMEJ1ctmQpJP7XkjgO6ZokQJQJqM1Jnhdavdw/khKfbEvwA3\niOiLZQ97bOCb++42qXiLXEXu7VWMy9bO+337W1AtIePtw0jQgDv6jVajEoXI/NOZ\nK0dfJ1l/ZTiTXlYtM9818iV0noleTwR8vyfXv6DJiyAqkBNe\n=usT0\n-----END PGP PUBLIC KEY BLOCK-----\n"
  },
  {
    "path": "contrib/gitian-keys/ilmango-pubkey.asc",
    "content": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBF2bP6QBEADEJ3CeMqXgSHUsD+kMUtC8lsz7NDtWt5MO40LGO2aulYd7ox2b\nBE9fEXQnwhfknmluzzpeBSD6wR+AnOWKtrO63LjBHGvIJVRP1UkVY2WDAYf4OGIB\nbVPIONt7YR+gYkQ8hcOgxRMEZhwz8zRAvwf/TsIIFWOLWCgzPl9xI7C9ValTFS92\nXPPE4ueBd4AzvDkvluLo+B1X+0TeLEvkSo3W8L2Gh6YUIeNDjTd1K93S5lvUZ08E\nBtLLJVndphzCWxOGPi1OfmCgMVPh/aacf+cUjzKrT8rojkOF91j8RygXKYCfh596\n0ufGH+fUhiDe8eHUPNOkaWd4mvlgBB1HOCgXcxpUlyso1JzY5XgCvFVl3VMAQtlM\n7DkMWryOi6dreLeTYrLZs4Az7Q4dz6BiFeVENBTlmm17HtsNjRP6Bj/wMFuFRpnV\nHkJ5KD9mApI6/sl3UMs/VtmQWvAf5jKvMo5dtAu6pMnEpCf9H81MJhunLKHEi14u\nrh6qfANBfLvNtWk+PsHABZ5cQGXi9u5b6EwJSkIqHFaCpSvj7Iz7w+IlUFSi8w+/\nqd7hO/Jt2TZAwSYXwyXecp2+YrHZXTdXx2AfQtKSpp3suoSfEqC8HYeHbyFud7n0\n5Vq1hh3929AmHXwmnTRyviJKduSkA2G5IXpM5/pNkUecUmaMB85Bb/4qvwARAQAB\ntCBpbG1hbmdvIDxpbG1hbmdvLmRvZ2VAZ21haWwuY29tPokCTgQTAQgAOBYhBINs\ng0J6xowT/y5IlOzI7rZSdkBEBQJdmz+kAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4B\nAheAAAoJEOzI7rZSdkBEE3AP/18NkdP5pYl76M+Qxh1O1SqTGMW/O6b9NAViMCqf\nIAMgZ0aWOrpZ9xhiXZJKs8O3gCGDyZX3EpD5CefKneYcuQGSQrZEDmsbfmnTUTfK\nq+z3A62QxvWSXpVyrwQ0Kl3SPx+LxuLJ2jIg5bq90lx8+79FySzovv2YjajAbeGm\nMPs40/45PCDWs6ERKlqPsMCBRKrSaKPRIF88l2OEqeZlIom44HP/1ja/GPv8Ca0Y\nnhKyeiKbjwg2GmRjiI3/yasZfmvCf9mtG1B8NhlqdN+RV1p7kA80vBiCQbuZLege\nOStgDvsV3WQMOsI0wnKtOZ7mvXcLqsixV8pfH2Qpvxc7VUuwAbdcX4xiL1B1ad/x\n2yFADI61psgpAaAbbcokbKDv9DSujqDW4PF7Z6HkgWHpX6D9ChmCGHXE9/6ucV4L\nM1iltJ9oMrxMoSu/YedZDUXs4h6liVoI4sobLkyTnb1w8JlDyVIJ9siEMDb0O9PB\nswXVyp2yxYBqokWjoJ2QraY1e4eX0AJbGKhrRBj8C1IS+ELf4SqE4W0OOJlyGGaH\n1wXG84YHHYndh3VQyvXCdWyQPiZUS3xZZPBIeD0WIBsxPJunFdAdkLhyZO1aYIhv\ntttgKvdLD5jQh2kot258OyAj2xrolbaFdZ707RF/kRfO6QUU1qFa316dgGc8OX3X\nAtRduQINBF2bP6QBEAC4lnIcp2+je+orOoP53hXQKuvOe0E1e6D2o3EIc67O8bvd\nxZEgoGgJnMTHxnJtS5wo31caA99R7+pP41tJGrAcGsHLAJ3Ey3opRx+M16uZ4CI6\nDNg/Q8cHH2UXr4MI8x1yXSzH0NNwspi/joTVUYLEqaBUzO2QgN4QfFl9c/Y3qr1O\nEfnH7mONsOEFW5OG29IjAbKaGvyID1a08AtSAnl37Y5Vmg7T8qfOiKAFx1EQ570P\nAfwAKghz6eYRhoPRD+xYeFZ9srg8dlmAAAnEiZfoPWPFw6Z6/LDkzXq1NMCqLwKr\nyfKvMmTfU39UJngqkVuC24I4975Sz3HwlYx3bxs/YR2oGX3IEY7+0aWxJDbaxxLK\nIYPs1szwAFJgGK7SjNiOgkbFMe/276F7Lsh0e0xzVplsM0ko0CEhFM66dJT5nxn/\nN72wvXyJSURJBv5FNzCUI/RovYxaSkqOuRxLJDhTTMEks9lCzBIOgrivLoonN6tD\nlv6RCdcqt90J2ZKrrA1bcIhEfihUa2QplXHGhLHeSItiF254BO5JbQg9Ke4CGxoL\nrTIJy9gNk7pxkWPM/GNf2TW/0A4xQVtFRDlQPu0VOlrBHsqRy59kRJlbqiZwxUTy\n9nebDuLrHZnxpo8tmhoqTsD0VmbvG8MEFBD28xZ7lP2JNgPy7uI6zA6bSjbcHQAR\nAQABiQI2BBgBCAAgFiEEg2yDQnrGjBP/LkiU7MjutlJ2QEQFAl2bP6QCGwwACgkQ\n7MjutlJ2QEQuzQ/+N41s57va2YD2bQ1/IE2qQvyMVzW9r1Va19o7XR+3nnaiCGmn\n2AZgTrQq1rSjv4yIWiTvHgggaMcU3Nng6T3gwh3yGid+567Rh0DRVdUS94LjA/We\n6/L1cRCCDJsI6r9bHbfDhLoJ/NVCZpHAal7fkcfjGIMGGzTQd24D5vy+/SeZJlMb\n5r/Xjjy62SLQjwwMmPHQig3Jx4VZV475JUHczyvXDxc4HH+cUgt0/yWALdHGQKQz\nMkwuCRT1C/SnHEP3pBRxCUEfyT2Aw4gBD68L4AJP9zz7ysmfXJclKj9FIoMIg2Fo\n9NFjYquCLjCrjPCK8lHzHVmDBZQRSsP2F+Yf2Z+NXG7jcqQFov5TdZvC5P2pFL3O\np07RCWx3pgG7rBQ8GxjdsKYB7m1frXAzPzVGr1IP6FmQAaQlgZ6+Ju7K9J2MnrW8\nUvWLgn+qE3QKjvW1sBGT3oFIa4q9REesNFc6K6Y6gNJlyGHIclDsXniJJhc7cF/o\nxxuQw6jVVfXi8Apd5wzXp8DVSeILpP9xcbyibBanWbo9qaf7Rca8nswnsEgKjtVk\n+XFH6l8e+pVeCz3v6FZVhHpVa8qIJU0iuEmPBg0y0eFoENA+IC7x8YTZ9LAkNNke\n9m+IWJ6+Ib8LCFw8wO3EoWI8Bh7G4sPgERDlRu2CttJoQed9kNEpJeet2J8=\n=/n2X\n-----END PGP PUBLIC KEY BLOCK-----\n"
  },
  {
    "path": "contrib/init/README.md",
    "content": "Sample configuration files for:\n```\nSystemD: bitcoind.service\nUpstart: bitcoind.conf\nOpenRC:  bitcoind.openrc\n         bitcoind.openrcconf\nCentOS:  bitcoind.init\nOS X:    org.bitcoin.bitcoind.plist\n```\nhave been made available to assist packagers in creating node packages here.\n\nSee doc/init.md for more information.\n"
  },
  {
    "path": "contrib/init/bitcoind.conf",
    "content": "description \"Bitcoin Core Daemon\"\n\nstart on runlevel [2345]\nstop on starting rc RUNLEVEL=[016]\n\nenv BITCOIND_BIN=\"/usr/bin/bitcoind\"\nenv BITCOIND_USER=\"bitcoin\"\nenv BITCOIND_GROUP=\"bitcoin\"\nenv BITCOIND_PIDDIR=\"/var/run/bitcoind\"\n# upstart can't handle variables constructed with other variables\nenv BITCOIND_PIDFILE=\"/var/run/bitcoind/bitcoind.pid\"\nenv BITCOIND_CONFIGFILE=\"/etc/bitcoin/bitcoin.conf\"\nenv BITCOIND_DATADIR=\"/var/lib/bitcoind\"\n\nexpect fork\n\nrespawn\nrespawn limit 5 120\nkill timeout 60\n\npre-start script\n    # this will catch non-existent config files\n    # bitcoind will check and exit with this very warning, but it can do so\n    # long after forking, leaving upstart to think everything started fine.\n    # since this is a commonly encountered case on install, just check and\n    # warn here.\n    if ! grep -qs '^rpcpassword=' \"$BITCOIND_CONFIGFILE\" ; then\n        echo \"ERROR: You must set a secure rpcpassword to run bitcoind.\"\n        echo \"The setting must appear in $BITCOIND_CONFIGFILE\"\n        echo\n        echo \"This password is security critical to securing wallets \"\n        echo \"and must not be the same as the rpcuser setting.\"\n        echo \"You can generate a suitable random password using the following \"\n        echo \"command from the shell:\"\n        echo\n        echo \"bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'\"\n        echo\n        echo \"It is recommended that you also set alertnotify so you are \"\n        echo \"notified of problems:\"\n        echo\n        echo \"ie: alertnotify=echo %%s | mail -s \\\"Bitcoin Alert\\\"\" \\\n            \"admin@foo.com\"\n        echo\n        exit 1\n    fi\n\n    mkdir -p \"$BITCOIND_PIDDIR\"\n    chmod 0755 \"$BITCOIND_PIDDIR\"\n    chown $BITCOIND_USER:$BITCOIND_GROUP \"$BITCOIND_PIDDIR\"\n    chown $BITCOIND_USER:$BITCOIND_GROUP \"$BITCOIND_CONFIGFILE\"\n    chmod 0660 \"$BITCOIND_CONFIGFILE\"\nend script\n\nexec start-stop-daemon \\\n    --start \\\n    --pidfile \"$BITCOIND_PIDFILE\" \\\n    --chuid $BITCOIND_USER:$BITCOIND_GROUP \\\n    --exec \"$BITCOIND_BIN\" \\\n    -- \\\n    -pid=\"$BITCOIND_PIDFILE\" \\\n    -conf=\"$BITCOIND_CONFIGFILE\" \\\n    -datadir=\"$BITCOIND_DATADIR\" \\\n    -disablewallet \\\n    -daemon\n\n"
  },
  {
    "path": "contrib/init/bitcoind.init",
    "content": "#!/bin/bash\n#\n#  bitcoind The bitcoin core server.\n#\n#\n# chkconfig: 345 80 20\n# description: bitcoind\n# processname: bitcoind\n#\n\n# Source function library.\n. /etc/init.d/functions\n\n# you can override defaults in /etc/sysconfig/bitcoind, see below\nif [ -f /etc/sysconfig/bitcoind ]; then\n        . /etc/sysconfig/bitcoind\nfi\n\nRETVAL=0\n\nprog=bitcoind\n# you can override the lockfile via BITCOIND_LOCKFILE in /etc/sysconfig/bitcoind\nlockfile=${BITCOIND_LOCKFILE-/var/lock/subsys/bitcoind}\n\n# bitcoind defaults to /usr/bin/bitcoind, override with BITCOIND_BIN\nbitcoind=${BITCOIND_BIN-/usr/bin/bitcoind}\n\n# bitcoind opts default to -disablewallet, override with BITCOIND_OPTS\nbitcoind_opts=${BITCOIND_OPTS--disablewallet}\n\nstart() {\n    echo -n $\"Starting $prog: \"\n    daemon $DAEMONOPTS $bitcoind $bitcoind_opts\n    RETVAL=$?\n    echo\n    [ $RETVAL -eq 0 ] && touch $lockfile\n    return $RETVAL\n}\n\nstop() {\n    echo -n $\"Stopping $prog: \"\n    killproc $prog\n    RETVAL=$?\n    echo\n    [ $RETVAL -eq 0 ] && rm -f $lockfile\n    return $RETVAL\n}\n\ncase \"$1\" in\n    start)\n        start\n        ;;\n    stop)\n        stop\n        ;;\n    status)\n        status $prog\n        ;;\n    restart)\n        stop\n        start\n        ;;\n    *)\n        echo \"Usage: service $prog {start|stop|status|restart}\"\n        exit 1\n        ;;\nesac\n"
  },
  {
    "path": "contrib/init/bitcoind.openrc",
    "content": "#!/sbin/openrc-run\n\n# backward compatibility for existing gentoo layout \n#\nif [ -d \"/var/lib/bitcoin/.bitcoin\" ]; then\n\tBITCOIND_DEFAULT_DATADIR=\"/var/lib/bitcoin/.bitcoin\"\nelse\n\tBITCOIND_DEFAULT_DATADIR=\"/var/lib/bitcoind\"\nfi\n\nBITCOIND_CONFIGFILE=${BITCOIND_CONFIGFILE:-/etc/bitcoin/bitcoin.conf}\nBITCOIND_PIDDIR=${BITCOIND_PIDDIR:-/var/run/bitcoind}\nBITCOIND_PIDFILE=${BITCOIND_PIDFILE:-${BITCOIND_PIDDIR}/bitcoind.pid}\nBITCOIND_DATADIR=${BITCOIND_DATADIR:-${BITCOIND_DEFAULT_DATADIR}}\nBITCOIND_USER=${BITCOIND_USER:-${BITCOIN_USER:-bitcoin}}\nBITCOIND_GROUP=${BITCOIND_GROUP:-bitcoin}\nBITCOIND_BIN=${BITCOIND_BIN:-/usr/bin/bitcoind}\nBITCOIND_NICE=${BITCOIND_NICE:-${NICELEVEL:-0}}\nBITCOIND_OPTS=\"${BITCOIND_OPTS:-${BITCOIN_OPTS}}\"\n\nname=\"Bitcoin Core Daemon\"\ndescription=\"Bitcoin cryptocurrency P2P network daemon\"\n\ncommand=\"/usr/bin/bitcoind\"\ncommand_args=\"-pid=\\\"${BITCOIND_PIDFILE}\\\" \\\n\t\t-conf=\\\"${BITCOIND_CONFIGFILE}\\\" \\\n\t\t-datadir=\\\"${BITCOIND_DATADIR}\\\" \\\n\t\t-daemon \\\n\t\t${BITCOIND_OPTS}\"\n\nrequired_files=\"${BITCOIND_CONFIGFILE}\"\nstart_stop_daemon_args=\"-u ${BITCOIND_USER} \\\n\t\t\t-N ${BITCOIND_NICE} -w 2000\"\npidfile=\"${BITCOIND_PIDFILE}\"\n\n# The retry schedule to use when stopping the daemon. Could be either\n# a timeout in seconds or multiple signal/timeout pairs (like\n# \"SIGKILL/180 SIGTERM/300\")\nretry=\"${BITCOIND_SIGTERM_TIMEOUT}\"\n\ndepend() {\n\tneed localmount net\n}\n\n# verify\n# 1) that the datadir exists and is writable (or create it)\n# 2) that a directory for the pid exists and is writable\n# 3) ownership and permissions on the config file\nstart_pre() {\n\tcheckpath \\\n\t-d \\\n\t--mode 0750 \\\n\t--owner \"${BITCOIND_USER}:${BITCOIND_GROUP}\" \\\n\t\"${BITCOIND_DATADIR}\"\n\n\tcheckpath \\\n\t-d \\\n\t--mode 0755 \\\n\t--owner \"${BITCOIND_USER}:${BITCOIND_GROUP}\" \\\n\t\"${BITCOIND_PIDDIR}\"\n\n\tcheckpath -f \\\n\t-o ${BITCOIND_USER}:${BITCOIND_GROUP} \\\n\t-m 0660 \\\n\t${BITCOIND_CONFIGFILE}\n\n\tcheckconfig || return 1\n}\n\ncheckconfig()\n{\n\tif ! grep -qs '^rpcpassword=' \"${BITCOIND_CONFIGFILE}\" ; then\n\t\teerror \"\"\n\t\teerror \"ERROR: You must set a secure rpcpassword to run bitcoind.\"\n\t\teerror \"The setting must appear in ${BITCOIND_CONFIGFILE}\"\n\t\teerror \"\"\n\t\teerror \"This password is security critical to securing wallets \"\n\t\teerror \"and must not be the same as the rpcuser setting.\"\n\t\teerror \"You can generate a suitable random password using the following \"\n\t\teerror \"command from the shell:\"\n\t\teerror \"\"\n\t\teerror \"bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'\"\n\t\teerror \"\"\n\t\teerror \"It is recommended that you also set alertnotify so you are \"\n\t\teerror \"notified of problems:\"\n\t\teerror \"\"\n\t\teerror \"ie: alertnotify=echo %%s | mail -s \\\"Bitcoin Alert\\\"\" \\\n\t\t\t\"admin@foo.com\"\n\t\teerror \"\"\n\t\treturn 1\n\tfi\n}\n"
  },
  {
    "path": "contrib/init/bitcoind.openrcconf",
    "content": "# /etc/conf.d/bitcoind: config file for /etc/init.d/bitcoind\n\n# Config file location\n#BITCOIND_CONFIGFILE=\"/etc/bitcoin/bitcoin.conf\"\n\n# What directory to write pidfile to?  (created and owned by $BITCOIND_USER)\n#BITCOIND_PIDDIR=\"/var/run/bitcoind\"\n\n# What filename to give the pidfile\n#BITCOIND_PIDFILE=\"${BITCOIND_PIDDIR}/bitcoind.pid\"\n\n# Where to write bitcoind data (be mindful that the blockchain is large)\n#BITCOIND_DATADIR=\"/var/lib/bitcoind\"\n\n# User and group to own bitcoind process\n#BITCOIND_USER=\"bitcoin\"\n#BITCOIND_GROUP=\"bitcoin\"\n\n# Path to bitcoind executable\n#BITCOIND_BIN=\"/usr/bin/bitcoind\"\n\n# Nice value to run bitcoind under\n#BITCOIND_NICE=0\n\n# Additional options (avoid -conf and -datadir, use flags above)\n#BITCOIND_OPTS=\"\"\n\n# The timeout in seconds OpenRC will wait for bitcoind to terminate\n# after a SIGTERM has been raised.\n# Note that this will be mapped as argument to start-stop-daemon's\n# '--retry' option, which means you can specify a retry schedule\n# here. For more information see man 8 start-stop-daemon.\nBITCOIND_SIGTERM_TIMEOUT=60\n"
  },
  {
    "path": "contrib/init/bitcoind.service",
    "content": "# It is not recommended to modify this file in-place, because it will\n# be overwritten during package upgrades. If you want to add further\n# options or overwrite existing ones then use\n# $ systemctl edit bitcoind.service\n# See \"man systemd.service\" for details.\n\n# Note that almost all daemon options could be specified in\n# /etc/bitcoin/bitcoin.conf\n\n[Unit]\nDescription=Bitcoin daemon\nAfter=network.target\n\n[Service]\nExecStart=/usr/bin/bitcoind -daemon -conf=/etc/bitcoin/bitcoin.conf -pid=/run/bitcoind/bitcoind.pid\n# Creates /run/bitcoind owned by bitcoin\nRuntimeDirectory=bitcoind\nUser=bitcoin\nType=forking\nPIDFile=/run/bitcoind/bitcoind.pid\nRestart=on-failure\nPrivateTmp=true\n\n[Install]\nWantedBy=multi-user.target\n"
  },
  {
    "path": "contrib/init/org.bitcoin.bitcoind.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>Label</key>\n\t<string>org.bitcoin.bitcoind</string>\n\t<key>ProgramArguments</key>\n\t<array>\n\t\t<string>/usr/local/bin/bitcoind</string>\n\t</array>\n\t<key>RunAtLoad</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "contrib/install_db4.sh",
    "content": "#!/bin/sh\n\n# Install libdb4.8 (Berkeley DB).\n\nset -e\n\nif [ -z \"${1}\" ]; then\n  echo \"Usage: ./install_db4.sh <base-dir> [<extra-bdb-configure-flag> ...]\"\n  echo\n  echo \"Must specify a single argument: the directory in which db4 will be built.\"\n  echo \"This is probably \\`pwd\\` if you're at the root of the bitcoin repository.\"\n  exit 1\nfi\n\nexpand_path() {\n  echo \"$(cd \"${1}\" && pwd -P)\"\n}\n\nBDB_PREFIX=\"$(expand_path ${1})/db4\"; shift;\nBDB_VERSION='db-4.8.30.NC'\nBDB_HASH='12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef'\nBDB_URL=\"https://download.oracle.com/berkeley-db/${BDB_VERSION}.tar.gz\"\n\ncheck_exists() {\n  which \"$1\" >/dev/null 2>&1\n}\n\nsha256_check() {\n  # Args: <sha256_hash> <filename>\n  #\n  if check_exists sha256sum; then\n    echo \"${1}  ${2}\" | sha256sum -c\n  elif check_exists sha256; then\n    if [ \"$(uname)\" = \"FreeBSD\" ]; then\n      sha256 -c \"${1}\" \"${2}\"\n    else\n      echo \"${1}  ${2}\" | sha256 -c\n    fi\n  else\n    echo \"${1}  ${2}\" | shasum -a 256 -c\n  fi\n}\n\nhttp_get() {\n  # Args: <url> <filename> <sha256_hash>\n  #\n  # It's acceptable that we don't require SSL here because we manually verify\n  # content hashes below.\n  #\n  if [ -f \"${2}\" ]; then\n    echo \"File ${2} already exists; not downloading again\"\n  elif check_exists curl; then\n    curl --insecure \"${1}\" -o \"${2}\"\n  else\n    wget --no-check-certificate \"${1}\" -O \"${2}\"\n  fi\n\n  sha256_check \"${3}\" \"${2}\"\n}\n\nmkdir -p \"${BDB_PREFIX}\"\nhttp_get \"${BDB_URL}\" \"${BDB_VERSION}.tar.gz\" \"${BDB_HASH}\"\ntar -xzvf ${BDB_VERSION}.tar.gz -C \"$BDB_PREFIX\"\ncd \"${BDB_PREFIX}/${BDB_VERSION}/\"\n\n# Apply a patch necessary when building with clang and c++11 (see https://community.oracle.com/thread/3952592)\nCLANG_CXX11_PATCH_URL='https://gist.githubusercontent.com/LnL7/5153b251fd525fe15de69b67e63a6075/raw/7778e9364679093a32dec2908656738e16b6bdcb/clang.patch'\nCLANG_CXX11_PATCH_HASH='7a9a47b03fd5fb93a16ef42235fa9512db9b0829cfc3bdf90edd3ec1f44d637c'\nhttp_get \"${CLANG_CXX11_PATCH_URL}\" clang.patch \"${CLANG_CXX11_PATCH_HASH}\"\npatch -p2 < clang.patch\n\ncd build_unix/\n\n\"${BDB_PREFIX}/${BDB_VERSION}/dist/configure\" \\\n  --enable-cxx --disable-shared --disable-replication --with-pic --prefix=\"${BDB_PREFIX}\" \\\n  \"${@}\"\n\nmake install\n\necho\necho \"db4 build complete.\"\necho\necho 'When compiling bitcoind, run `./configure` in the following way:'\necho\necho \"  export BDB_PREFIX='${BDB_PREFIX}'\"\necho '  ./configure BDB_LIBS=\"-L${BDB_PREFIX}/lib -ldb_cxx-4.8\" BDB_CFLAGS=\"-I${BDB_PREFIX}/include\" ...'\n"
  },
  {
    "path": "contrib/linearize/README.md",
    "content": "# Linearize\nConstruct a linear, no-fork, best version of the Bitcoin blockchain. The scripts\nrun using Python 3 but are compatible with Python 2.\n\n## Warning\nDo not use `-txindex=1` in this script.\n\n## Step 1:\nFix `max_height` in `linearize.cfg`\n\n## Step 1.1: Download hash list\n\n    $ ./linearize-hashes.py linearize.cfg > hashlist.txt\n\nRequired configuration file `linearize.cfg` settings for linearize-hashes:\n* RPC: `datadir` (Required if `rpcuser` and `rpcpassword` are not specified)\n* RPC: `rpcuser`, `rpcpassword` (Required if `datadir` is not specified)\n\nOptional config file `linearize.cfg` setting for linearize-hashes:\n* RPC: `host`  (Default: `127.0.0.1`)\n* RPC: `port`  (Default: `34229`)\n* Blockchain: `min_height`, `max_height`\n* `rev_hash_bytes`: If true, the written block hash list will be\nbyte-reversed. (In other words, the hash returned by getblockhash will have its\nbytes reversed.) False by default. Intended for generation of\nstandalone hash lists but safe to use with linearize-data.py, which will output\nthe same data no matter which byte format is chosen.\n\nThe `linearize-hashes` script requires a connection, local or remote, to a\nJSON-RPC server. Running `bitcoind` or `bitcoin-qt -server` will be sufficient.\n\n## Step 1.2:\nChange absolute location in `linearize.cfg`\n\n    input=/home/{USERNAME}/.sugarchain/blocks\n    output_file=/home/{USERNAME}/Desktop/bootstrap.dat\n\n## Step 1.3: Check outputs\n\n    $ head -1 hashlist.txt # genesis\n      7d5eaec2dbb75f99feadfa524c78b7cabc1d8c8204f79d4f3a83381b811b0adc\n    $ wc -l hashlist.txt # 6500000+1 (add genesis)\n      6500001 hashlist.txt\n    $ tail -n 1 hashlist.txt\n      0ced7787d86e613c2e0aa02a297cde45a6626a53f4217f5d30af4357eeed3429\n\n## Step 2: Copy local block data\n\n    $ ./linearize-data.py linearize.cfg\n\nRequired configuration file settings:\n* `output_file`: The file that will contain the final blockchain.\n      or\n* `output`: Output directory for linearized `blocks/blkNNNNN.dat` output.\n\nOptional config file setting for linearize-data:\n* `debug_output`: Some printouts may not always be desired. If true, such output\nwill be printed.\n* `file_timestamp`: Set each file's last-accessed and last-modified times,\nrespectively, to the current time and to the timestamp of the most recent block\nwritten to the script's blockchain.\n* `genesis`: The hash of the genesis block in the blockchain.\n* `input`: bitcoind blocks/ directory containing blkNNNNN.dat\n* `hashlist`: text file containing list of block hashes created by\nlinearize-hashes.py.\n* `max_out_sz`: Maximum size for files created by the `output_file` option.\n(Default: `1000*1000*1000 bytes`)\n* `netmagic`: Network magic number.\n* `out_of_order_cache_sz`: If out-of-order blocks are being read, the block can\nbe written to a cache so that the blockchain doesn't have to be sought again.\nThis option specifies the cache size. (Default: `100*1000*1000 bytes`)\n* `rev_hash_bytes`: If true, the block hash list written by linearize-hashes.py\nwill be byte-reversed when read by linearize-data.py. See the linearize-hashes\nentry for more information.\n* `split_timestamp`: Split blockchain files when a new month is first seen, in\naddition to reaching a maximum file size (`max_out_sz`).\n\n## Step 3: PGP signing on bootstrap release\n\n    $ cd ~/Desktop # move to output directory\n    $ zip -X bootstrap.dat.zip bootstrap.dat # zip into bootstrap.dat.zip\n    $ sha256sum bootstrap.dat.zip > SHA256SUMS\n    $ gpg --digest-algo sha256 --clearsign SHA256SUMS # PGP signing\n    $ rm SHA256SUMS && cat SHA256SUMS.asc # rename to asc\n    ... # release\n\n* Release following files at https://github.com/sugarchain-project/bootstrap/releases\n  - bootstrap.dat.zip\n  - SHA256SUMS.asc\n"
  },
  {
    "path": "contrib/linearize/example-linearize.cfg",
    "content": "# sugarchaind RPC settings (linearize-hashes)\nrpcuser=rpcuser\nrpcpassword=rpcpassword\n#datadir=~/.sugarchain\nhost=127.0.0.1\n\n#mainnet default\nport=34229\n\n#testnet default\n#port=44229\n\n#regtest default\n#port=45339\n\n# bootstrap.dat hashlist settings (linearize-hashes)\n# at this moment, the height is approx. 1043388\nmax_height=1043000\n\n# bootstrap.dat input/output settings (linearize-data)\n\n# mainnet\nnetmagic=9feb4b9d\ngenesis=7d5eaec2dbb75f99feadfa524c78b7cabc1d8c8204f79d4f3a83381b811b0adc\n# path should be an absolute path\n# input=/home/example/.sugarchain/blocks\ninput=/home/{USERNAME}/.sugarchain/blocks\n\n# testnet\n#netmagic=0b110907\n#genesis=000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943\n#input=/home/example/.sugarchain/testnet5/blocks\n\n# \"output\" option causes blockchain files to be written to the given location,\n# with \"output_file\" ignored. If not used, \"output_file\" is used instead.\n# output=/home/example/blockchain_directory\n# path should be an absolute path\n# output_file=/home/example/Downloads/bootstrap.dat\noutput_file=/home/{USERNAME}/Desktop/bootstrap.dat\nhashlist=hashlist.txt\n\n# Maximum size in bytes of out-of-order blocks cache in memory\nout_of_order_cache_sz = 100000000\n\n# Do we want the reverse the hash bytes coming from getblockhash?\nrev_hash_bytes = False\n\n# On a new month, do we want to set the access and modify times of the new\n# blockchain file?\nfile_timestamp = 0\n# Do we want to split the blockchain files given a new month or specific height?\nsplit_timestamp = 0\n\n# Do we want debug printouts?\ndebug_output = False\n"
  },
  {
    "path": "contrib/linearize/linearize-data.py",
    "content": "#!/usr/bin/env python3\n#\n# linearize-data.py: Construct a linear, no-fork version of the chain.\n#\n# Copyright (c) 2013-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#\n\nfrom __future__ import print_function, division\nimport struct\nimport re\nimport os\nimport os.path\nimport sys\nimport hashlib\nimport datetime\nimport time\nfrom collections import namedtuple\nfrom binascii import hexlify, unhexlify\n\nsettings = {}\n\n##### Switch endian-ness #####\ndef hex_switchEndian(s):\n\t\"\"\" Switches the endianness of a hex string (in pairs of hex chars) \"\"\"\n\tpairList = [s[i:i+2].encode() for i in range(0, len(s), 2)]\n\treturn b''.join(pairList[::-1]).decode()\n\ndef uint32(x):\n\treturn x & 0xffffffff\n\ndef bytereverse(x):\n\treturn uint32(( ((x) << 24) | (((x) << 8) & 0x00ff0000) |\n\t\t       (((x) >> 8) & 0x0000ff00) | ((x) >> 24) ))\n\ndef bufreverse(in_buf):\n\tout_words = []\n\tfor i in range(0, len(in_buf), 4):\n\t\tword = struct.unpack('@I', in_buf[i:i+4])[0]\n\t\tout_words.append(struct.pack('@I', bytereverse(word)))\n\treturn b''.join(out_words)\n\ndef wordreverse(in_buf):\n\tout_words = []\n\tfor i in range(0, len(in_buf), 4):\n\t\tout_words.append(in_buf[i:i+4])\n\tout_words.reverse()\n\treturn b''.join(out_words)\n\ndef calc_hdr_hash(blk_hdr):\n\thash1 = hashlib.sha256()\n\thash1.update(blk_hdr)\n\thash1_o = hash1.digest()\n\n\thash2 = hashlib.sha256()\n\thash2.update(hash1_o)\n\thash2_o = hash2.digest()\n\n\treturn hash2_o\n\ndef calc_hash_str(blk_hdr):\n\thash = calc_hdr_hash(blk_hdr)\n\thash = bufreverse(hash)\n\thash = wordreverse(hash)\n\thash_str = hexlify(hash).decode('utf-8')\n\treturn hash_str\n\ndef get_blk_dt(blk_hdr):\n\tmembers = struct.unpack(\"<I\", blk_hdr[68:68+4])\n\tnTime = members[0]\n\tdt = datetime.datetime.fromtimestamp(nTime)\n\tdt_ym = datetime.datetime(dt.year, dt.month, 1)\n\treturn (dt_ym, nTime)\n\n# When getting the list of block hashes, undo any byte reversals.\ndef get_block_hashes(settings):\n\tblkindex = []\n\tf = open(settings['hashlist'], \"r\")\n\tfor line in f:\n\t\tline = line.rstrip()\n\t\tif settings['rev_hash_bytes'] == 'true':\n\t\t\tline = hex_switchEndian(line)\n\t\tblkindex.append(line)\n\n\tprint(\"Read \" + str(len(blkindex)) + \" hashes\")\n\n\treturn blkindex\n\n# The block map shouldn't give or receive byte-reversed hashes.\ndef mkblockmap(blkindex):\n\tblkmap = {}\n\tfor height,hash in enumerate(blkindex):\n\t\tblkmap[hash] = height\n\treturn blkmap\n\n# Block header and extent on disk\nBlockExtent = namedtuple('BlockExtent', ['fn', 'offset', 'inhdr', 'blkhdr', 'size'])\n\nclass BlockDataCopier:\n\tdef __init__(self, settings, blkindex, blkmap):\n\t\tself.settings = settings\n\t\tself.blkindex = blkindex\n\t\tself.blkmap = blkmap\n\n\t\tself.inFn = 0\n\t\tself.inF = None\n\t\tself.outFn = 0\n\t\tself.outsz = 0\n\t\tself.outF = None\n\t\tself.outFname = None\n\t\tself.blkCountIn = 0\n\t\tself.blkCountOut = 0\n\n\t\tself.lastDate = datetime.datetime(2000, 1, 1)\n\t\tself.highTS = 1408893517 - 315360000\n\t\tself.timestampSplit = False\n\t\tself.fileOutput = True\n\t\tself.setFileTime = False\n\t\tself.maxOutSz = settings['max_out_sz']\n\t\tif 'output' in settings:\n\t\t\tself.fileOutput = False\n\t\tif settings['file_timestamp'] != 0:\n\t\t\tself.setFileTime = True\n\t\tif settings['split_timestamp'] != 0:\n\t\t\tself.timestampSplit = True\n\t\t# Extents and cache for out-of-order blocks\n\t\tself.blockExtents = {}\n\t\tself.outOfOrderData = {}\n\t\tself.outOfOrderSize = 0 # running total size for items in outOfOrderData\n\n\tdef writeBlock(self, inhdr, blk_hdr, rawblock):\n\t\tblockSizeOnDisk = len(inhdr) + len(blk_hdr) + len(rawblock)\n\t\tif not self.fileOutput and ((self.outsz + blockSizeOnDisk) > self.maxOutSz):\n\t\t\tself.outF.close()\n\t\t\tif self.setFileTime:\n\t\t\t\tos.utime(self.outFname, (int(time.time()), self.highTS))\n\t\t\tself.outF = None\n\t\t\tself.outFname = None\n\t\t\tself.outFn = self.outFn + 1\n\t\t\tself.outsz = 0\n\n\t\t(blkDate, blkTS) = get_blk_dt(blk_hdr)\n\t\tif self.timestampSplit and (blkDate > self.lastDate):\n\t\t\tprint(\"New month \" + blkDate.strftime(\"%Y-%m\") + \" @ \" + self.hash_str)\n\t\t\tself.lastDate = blkDate\n\t\t\tif self.outF:\n\t\t\t\tself.outF.close()\n\t\t\t\tif self.setFileTime:\n\t\t\t\t\tos.utime(self.outFname, (int(time.time()), self.highTS))\n\t\t\t\tself.outF = None\n\t\t\t\tself.outFname = None\n\t\t\t\tself.outFn = self.outFn + 1\n\t\t\t\tself.outsz = 0\n\n\t\tif not self.outF:\n\t\t\tif self.fileOutput:\n\t\t\t\tself.outFname = self.settings['output_file']\n\t\t\telse:\n\t\t\t\tself.outFname = os.path.join(self.settings['output'], \"blk%05d.dat\" % self.outFn)\n\t\t\tprint(\"Output file \" + self.outFname)\n\t\t\tself.outF = open(self.outFname, \"wb\")\n\n\t\tself.outF.write(inhdr)\n\t\tself.outF.write(blk_hdr)\n\t\tself.outF.write(rawblock)\n\t\tself.outsz = self.outsz + len(inhdr) + len(blk_hdr) + len(rawblock)\n\n\t\tself.blkCountOut = self.blkCountOut + 1\n\t\tif blkTS > self.highTS:\n\t\t\tself.highTS = blkTS\n\n\t\tif (self.blkCountOut % 1000) == 0:\n\t\t\tprint('%i blocks scanned, %i blocks written (of %i, %.1f%% complete)' % \n\t\t\t\t\t(self.blkCountIn, self.blkCountOut, len(self.blkindex), 100.0 * self.blkCountOut / len(self.blkindex)))\n\n\tdef inFileName(self, fn):\n\t\treturn os.path.join(self.settings['input'], \"blk%05d.dat\" % fn)\n\n\tdef fetchBlock(self, extent):\n\t\t'''Fetch block contents from disk given extents'''\n\t\twith open(self.inFileName(extent.fn), \"rb\") as f:\n\t\t\tf.seek(extent.offset)\n\t\t\treturn f.read(extent.size)\n\n\tdef copyOneBlock(self):\n\t\t'''Find the next block to be written in the input, and copy it to the output.'''\n\t\textent = self.blockExtents.pop(self.blkCountOut)\n\t\tif self.blkCountOut in self.outOfOrderData:\n\t\t\t# If the data is cached, use it from memory and remove from the cache\n\t\t\trawblock = self.outOfOrderData.pop(self.blkCountOut)\n\t\t\tself.outOfOrderSize -= len(rawblock)\n\t\telse: # Otherwise look up data on disk\n\t\t\trawblock = self.fetchBlock(extent)\n\n\t\tself.writeBlock(extent.inhdr, extent.blkhdr, rawblock)\n\n\tdef run(self):\n\t\twhile self.blkCountOut < len(self.blkindex):\n\t\t\tif not self.inF:\n\t\t\t\tfname = self.inFileName(self.inFn)\n\t\t\t\tprint(\"Input file \" + fname)\n\t\t\t\ttry:\n\t\t\t\t\tself.inF = open(fname, \"rb\")\n\t\t\t\texcept IOError:\n\t\t\t\t\tprint(\"Premature end of block data\")\n\t\t\t\t\treturn\n\n\t\t\tinhdr = self.inF.read(8)\n\t\t\tif (not inhdr or (inhdr[0] == \"\\0\")):\n\t\t\t\tself.inF.close()\n\t\t\t\tself.inF = None\n\t\t\t\tself.inFn = self.inFn + 1\n\t\t\t\tcontinue\n\n\t\t\tinMagic = inhdr[:4]\n\t\t\tif (inMagic != self.settings['netmagic']):\n\t\t\t\t# Seek backwards 7 bytes (skipping the first byte in the previous search)\n\t\t\t\t# and continue searching from the new position if the magic bytes are not\n\t\t\t\t# found.\n\t\t\t\tself.inF.seek(-7, os.SEEK_CUR)\n\t\t\t\tcontinue\n\t\t\tinLenLE = inhdr[4:]\n\t\t\tsu = struct.unpack(\"<I\", inLenLE)\n\t\t\tinLen = su[0] - 80 # length without header\n\t\t\tblk_hdr = self.inF.read(80)\n\t\t\tinExtent = BlockExtent(self.inFn, self.inF.tell(), inhdr, blk_hdr, inLen)\n\n\t\t\tself.hash_str = calc_hash_str(blk_hdr)\n\t\t\tif not self.hash_str in blkmap:\n\t\t\t\t# Because blocks can be written to files out-of-order as of 0.10, the script\n\t\t\t\t# may encounter blocks it doesn't know about. Treat as debug output.\n\t\t\t\tif settings['debug_output'] == 'true':\n\t\t\t\t\tprint(\"Skipping unknown block \" + self.hash_str)\n\t\t\t\tself.inF.seek(inLen, os.SEEK_CUR)\n\t\t\t\tcontinue\n\n\t\t\tblkHeight = self.blkmap[self.hash_str]\n\t\t\tself.blkCountIn += 1\n\n\t\t\tif self.blkCountOut == blkHeight:\n\t\t\t\t# If in-order block, just copy\n\t\t\t\trawblock = self.inF.read(inLen)\n\t\t\t\tself.writeBlock(inhdr, blk_hdr, rawblock)\n\n\t\t\t\t# See if we can catch up to prior out-of-order blocks\n\t\t\t\twhile self.blkCountOut in self.blockExtents:\n\t\t\t\t\tself.copyOneBlock()\n\n\t\t\telse: # If out-of-order, skip over block data for now\n\t\t\t\tself.blockExtents[blkHeight] = inExtent\n\t\t\t\tif self.outOfOrderSize < self.settings['out_of_order_cache_sz']:\n\t\t\t\t\t# If there is space in the cache, read the data\n\t\t\t\t\t# Reading the data in file sequence instead of seeking and fetching it later is preferred,\n\t\t\t\t\t# but we don't want to fill up memory\n\t\t\t\t\tself.outOfOrderData[blkHeight] = self.inF.read(inLen)\n\t\t\t\t\tself.outOfOrderSize += inLen\n\t\t\t\telse: # If no space in cache, seek forward\n\t\t\t\t\tself.inF.seek(inLen, os.SEEK_CUR)\n\n\t\tprint(\"Done (%i blocks written)\" % (self.blkCountOut))\n\nif __name__ == '__main__':\n\tif len(sys.argv) != 2:\n\t\tprint(\"Usage: linearize-data.py CONFIG-FILE\")\n\t\tsys.exit(1)\n\n\tf = open(sys.argv[1])\n\tfor line in f:\n\t\t# skip comment lines\n\t\tm = re.search('^\\s*#', line)\n\t\tif m:\n\t\t\tcontinue\n\n\t\t# parse key=value lines\n\t\tm = re.search('^(\\w+)\\s*=\\s*(\\S.*)$', line)\n\t\tif m is None:\n\t\t\tcontinue\n\t\tsettings[m.group(1)] = m.group(2)\n\tf.close()\n\n\t# Force hash byte format setting to be lowercase to make comparisons easier.\n\t# Also place upfront in case any settings need to know about it.\n\tif 'rev_hash_bytes' not in settings:\n\t\tsettings['rev_hash_bytes'] = 'false'\n\tsettings['rev_hash_bytes'] = settings['rev_hash_bytes'].lower()\n\n\tif 'netmagic' not in settings:\n\t\tsettings['netmagic'] = '9feb4b9d'\n\tif 'genesis' not in settings:\n\t\tsettings['genesis'] = '7d5eaec2dbb75f99feadfa524c78b7cabc1d8c8204f79d4f3a83381b811b0adc'\n\tif 'input' not in settings:\n\t\tsettings['input'] = 'input'\n\tif 'hashlist' not in settings:\n\t\tsettings['hashlist'] = 'hashlist.txt'\n\tif 'file_timestamp' not in settings:\n\t\tsettings['file_timestamp'] = 0\n\tif 'split_timestamp' not in settings:\n\t\tsettings['split_timestamp'] = 0\n\tif 'max_out_sz' not in settings:\n\t\tsettings['max_out_sz'] = 1000 * 1000 * 1000\n\tif 'out_of_order_cache_sz' not in settings:\n\t\tsettings['out_of_order_cache_sz'] = 100 * 1000 * 1000\n\tif 'debug_output' not in settings:\n\t\tsettings['debug_output'] = 'false'\n\n\tsettings['max_out_sz'] = int(settings['max_out_sz'])\n\tsettings['split_timestamp'] = int(settings['split_timestamp'])\n\tsettings['file_timestamp'] = int(settings['file_timestamp'])\n\tsettings['netmagic'] = unhexlify(settings['netmagic'].encode('utf-8'))\n\tsettings['out_of_order_cache_sz'] = int(settings['out_of_order_cache_sz'])\n\tsettings['debug_output'] = settings['debug_output'].lower()\n\n\tif 'output_file' not in settings and 'output' not in settings:\n\t\tprint(\"Missing output file / directory\")\n\t\tsys.exit(1)\n\n\tblkindex = get_block_hashes(settings)\n\tblkmap = mkblockmap(blkindex)\n\n\t# Block hash map won't be byte-reversed. Neither should the genesis hash.\n\tif not settings['genesis'] in blkmap:\n\t\tprint(\"Genesis block not found in hashlist\")\n\telse:\n\t\tBlockDataCopier(settings, blkindex, blkmap).run()\n"
  },
  {
    "path": "contrib/linearize/linearize-hashes.py",
    "content": "#!/usr/bin/env python3\n#\n# linearize-hashes.py:  List blocks in a linear, no-fork version of the chain.\n#\n# Copyright (c) 2013-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#\n\nfrom __future__ import print_function\ntry: # Python 3\n    import http.client as httplib\nexcept ImportError: # Python 2\n    import httplib\nimport json\nimport re\nimport base64\nimport sys\nimport os\nimport os.path\n\nsettings = {}\n\n##### Switch endian-ness #####\ndef hex_switchEndian(s):\n\t\"\"\" Switches the endianness of a hex string (in pairs of hex chars) \"\"\"\n\tpairList = [s[i:i+2].encode() for i in range(0, len(s), 2)]\n\treturn b''.join(pairList[::-1]).decode()\n\nclass BitcoinRPC:\n\tdef __init__(self, host, port, username, password):\n\t\tauthpair = \"%s:%s\" % (username, password)\n\t\tauthpair = authpair.encode('utf-8')\n\t\tself.authhdr = b\"Basic \" + base64.b64encode(authpair)\n\t\tself.conn = httplib.HTTPConnection(host, port=port, timeout=30)\n\n\tdef execute(self, obj):\n\t\ttry:\n\t\t\tself.conn.request('POST', '/', json.dumps(obj),\n\t\t\t\t{ 'Authorization' : self.authhdr,\n\t\t\t\t  'Content-type' : 'application/json' })\n\t\texcept ConnectionRefusedError:\n\t\t\tprint('RPC connection refused. Check RPC settings and the server status.',\n\t\t\t      file=sys.stderr)\n\t\t\treturn None\n\n\t\tresp = self.conn.getresponse()\n\t\tif resp is None:\n\t\t\tprint(\"JSON-RPC: no response\", file=sys.stderr)\n\t\t\treturn None\n\n\t\tbody = resp.read().decode('utf-8')\n\t\tresp_obj = json.loads(body)\n\t\treturn resp_obj\n\n\t@staticmethod\n\tdef build_request(idx, method, params):\n\t\tobj = { 'version' : '1.1',\n\t\t\t'method' : method,\n\t\t\t'id' : idx }\n\t\tif params is None:\n\t\t\tobj['params'] = []\n\t\telse:\n\t\t\tobj['params'] = params\n\t\treturn obj\n\n\t@staticmethod\n\tdef response_is_error(resp_obj):\n\t\treturn 'error' in resp_obj and resp_obj['error'] is not None\n\ndef get_block_hashes(settings, max_blocks_per_call=10000):\n\trpc = BitcoinRPC(settings['host'], settings['port'],\n\t\t\t settings['rpcuser'], settings['rpcpassword'])\n\n\theight = settings['min_height']\n\twhile height < settings['max_height']+1:\n\t\tnum_blocks = min(settings['max_height']+1-height, max_blocks_per_call)\n\t\tbatch = []\n\t\tfor x in range(num_blocks):\n\t\t\tbatch.append(rpc.build_request(x, 'getblockhash', [height + x]))\n\n\t\treply = rpc.execute(batch)\n\t\tif reply is None:\n\t\t\tprint('Cannot continue. Program will halt.')\n\t\t\treturn None\n\n\t\tfor x,resp_obj in enumerate(reply):\n\t\t\tif rpc.response_is_error(resp_obj):\n\t\t\t\tprint('JSON-RPC: error at height', height+x, ': ', resp_obj['error'], file=sys.stderr)\n\t\t\t\tsys.exit(1)\n\t\t\tassert(resp_obj['id'] == x) # assume replies are in-sequence\n\t\t\tif settings['rev_hash_bytes'] == 'true':\n\t\t\t\tresp_obj['result'] = hex_switchEndian(resp_obj['result'])\n\t\t\tprint(resp_obj['result'])\n\n\t\theight += num_blocks\n\ndef get_rpc_cookie():\n\t# Open the cookie file\n\twith open(os.path.join(os.path.expanduser(settings['datadir']), '.cookie'), 'r') as f:\n\t\tcombined = f.readline()\n\t\tcombined_split = combined.split(\":\")\n\t\tsettings['rpcuser'] = combined_split[0]\n\t\tsettings['rpcpassword'] = combined_split[1]\n\nif __name__ == '__main__':\n\tif len(sys.argv) != 2:\n\t\tprint(\"Usage: linearize-hashes.py CONFIG-FILE\")\n\t\tsys.exit(1)\n\n\tf = open(sys.argv[1])\n\tfor line in f:\n\t\t# skip comment lines\n\t\tm = re.search('^\\s*#', line)\n\t\tif m:\n\t\t\tcontinue\n\n\t\t# parse key=value lines\n\t\tm = re.search('^(\\w+)\\s*=\\s*(\\S.*)$', line)\n\t\tif m is None:\n\t\t\tcontinue\n\t\tsettings[m.group(1)] = m.group(2)\n\tf.close()\n\n\tif 'host' not in settings:\n\t\tsettings['host'] = '127.0.0.1'\n\tif 'port' not in settings:\n\t\tsettings['port'] = 34229\n\tif 'min_height' not in settings:\n\t\tsettings['min_height'] = 0\n\tif 'max_height' not in settings:\n\t\tsettings['max_height'] = 313000\n\tif 'rev_hash_bytes' not in settings:\n\t\tsettings['rev_hash_bytes'] = 'false'\n\n\tuse_userpass = True\n\tuse_datadir = False\n\tif 'rpcuser' not in settings or 'rpcpassword' not in settings:\n\t\tuse_userpass = False\n\tif 'datadir' in settings and not use_userpass:\n\t\tuse_datadir = True\n\tif not use_userpass and not use_datadir:\n\t\tprint(\"Missing datadir or username and/or password in cfg file\", file=sys.stderr)\n\t\tsys.exit(1)\n\n\tsettings['port'] = int(settings['port'])\n\tsettings['min_height'] = int(settings['min_height'])\n\tsettings['max_height'] = int(settings['max_height'])\n\n\t# Force hash byte format setting to be lowercase to make comparisons easier.\n\tsettings['rev_hash_bytes'] = settings['rev_hash_bytes'].lower()\n\n\t# Get the rpc user and pass from the cookie if the datadir is set\n\tif use_datadir:\n\t\tget_rpc_cookie()\n\n\tget_block_hashes(settings)\n"
  },
  {
    "path": "contrib/linearize/linearize.cfg",
    "content": "# sugarchaind RPC settings (linearize-hashes)\nrpcuser=rpcuser\nrpcpassword=rpcpassword\n#datadir=~/.sugarchain\nhost=127.0.0.1\n\n#mainnet default\nport=34229\n\n#testnet default\n#port=44229\n\n#regtest default\n#port=45339\n\n# bootstrap.dat hashlist settings (linearize-hashes)\n# 6500000 (2020-09-03)\nmax_height=6500000\n\n# bootstrap.dat input/output settings (linearize-data)\n\n# mainnet\nnetmagic=9feb4b9d\ngenesis=7d5eaec2dbb75f99feadfa524c78b7cabc1d8c8204f79d4f3a83381b811b0adc\n# path should be an absolute path\n# input=/home/example/.sugarchain/blocks\ninput=/home/{USERNAME}/.sugarchain/blocks\n\n# testnet\n#netmagic=0b110907\n#genesis=000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943\n#input=/home/example/.sugarchain/testnet5/blocks\n\n# \"output\" option causes blockchain files to be written to the given location,\n# with \"output_file\" ignored. If not used, \"output_file\" is used instead.\n# output=/home/example/blockchain_directory\n# path should be an absolute path\n# output_file=/home/example/Downloads/bootstrap.dat\noutput_file=/home/{USERNAME}/Desktop/bootstrap.dat\nhashlist=hashlist.txt\n\n# Maximum size in bytes of out-of-order blocks cache in memory\nout_of_order_cache_sz = 100000000\n\n# Do we want the reverse the hash bytes coming from getblockhash?\nrev_hash_bytes = False\n\n# On a new month, do we want to set the access and modify times of the new\n# blockchain file?\nfile_timestamp = 0\n# Do we want to split the blockchain files given a new month or specific height?\nsplit_timestamp = 0\n\n# Do we want debug printouts?\ndebug_output = False\n"
  },
  {
    "path": "contrib/macdeploy/LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "contrib/macdeploy/README.md",
    "content": "### MacDeploy ###\n\nFor Snow Leopard (which uses [Python 2.6](http://www.python.org/download/releases/2.6/)), you will need the param_parser package:\n\t\n\tsudo easy_install argparse\n\nThis script should not be run manually, instead, after building as usual:\n\n\tmake deploy\n\nDuring the process, the disk image window will pop up briefly where the fancy\nsettings are applied. This is normal, please do not interfere.\n\nWhen finished, it will produce `Bitcoin-Core.dmg`.\n\n"
  },
  {
    "path": "contrib/macdeploy/custom_dsstore.py",
    "content": "#!/usr/bin/env python\n# Copyright (c) 2013-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\nfrom __future__ import division,print_function,unicode_literals\nimport biplist\nfrom ds_store import DSStore\nfrom mac_alias import Alias\nimport sys\n\noutput_file = sys.argv[1]\npackage_name_ns = sys.argv[2]\n\nds = DSStore.open(output_file, 'w+')\nds['.']['bwsp'] = {\n    'ShowStatusBar': False,\n    'WindowBounds': b'{{300, 280}, {500, 343}}',\n    'ContainerShowSidebar': False,\n    'SidebarWidth': 0,\n    'ShowTabView': False,\n    'PreviewPaneVisibility': False,\n    'ShowToolbar': False,\n    'ShowSidebar': False,\n    'ShowPathbar': True\n}\n\nicvp = {\n    'gridOffsetX': 0.0,\n    'textSize': 12.0,\n    'viewOptionsVersion': 1,\n    'backgroundImageAlias': b'\\x00\\x00\\x00\\x00\\x02\\x1e\\x00\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xd1\\x94\\\\\\xb0H+\\x00\\x05\\x00\\x00\\x00\\x98\\x0fbackground.tiff\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x99\\xd19\\xb0\\xf8\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xff\\xff\\xff\\xff\\x00\\x00\\r\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0b.background\\x00\\x00\\x10\\x00\\x08\\x00\\x00\\xd1\\x94\\\\\\xb0\\x00\\x00\\x00\\x11\\x00\\x08\\x00\\x00\\xd19\\xb0\\xf8\\x00\\x00\\x00\\x01\\x00\\x04\\x00\\x00\\x00\\x98\\x00\\x0e\\x00 \\x00\\x0f\\x00b\\x00a\\x00c\\x00k\\x00g\\x00r\\x00o\\x00u\\x00n\\x00d\\x00.\\x00t\\x00i\\x00f\\x00f\\x00\\x0f\\x00\\x02\\x00\\x00\\x00\\x12\\x00\\x1c/.background/background.tiff\\x00\\x14\\x01\\x06\\x00\\x00\\x00\\x00\\x01\\x06\\x00\\x02\\x00\\x00\\x0cMacintosh HD\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\xce\\x97\\xab\\xc3H+\\x00\\x00\\x01\\x88[\\x88\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02u\\xab\\x8d\\xd1\\x94\\\\\\xb0devrddsk\\xff\\xff\\xff\\xff\\x00\\x00\\t \\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x07bitcoin\\x00\\x00\\x10\\x00\\x08\\x00\\x00\\xce\\x97\\xab\\xc3\\x00\\x00\\x00\\x11\\x00\\x08\\x00\\x00\\xd1\\x94\\\\\\xb0\\x00\\x00\\x00\\x01\\x00\\x14\\x01\\x88[\\x88\\x00\\x16\\xa9\\t\\x00\\x08\\xfaR\\x00\\x08\\xfaQ\\x00\\x02d\\x8e\\x00\\x0e\\x00\\x02\\x00\\x00\\x00\\x0f\\x00\\x1a\\x00\\x0c\\x00M\\x00a\\x00c\\x00i\\x00n\\x00t\\x00o\\x00s\\x00h\\x00 \\x00H\\x00D\\x00\\x13\\x00\\x01/\\x00\\x00\\x15\\x00\\x02\\x00\\x14\\xff\\xff\\x00\\x00\\xff\\xff\\x00\\x00',\n    'backgroundColorBlue': 1.0,\n    'iconSize': 96.0,\n    'backgroundColorGreen': 1.0,\n    'arrangeBy': 'none',\n    'showIconPreview': True,\n    'gridSpacing': 100.0,\n    'gridOffsetY': 0.0,\n    'showItemInfo': False,\n    'labelOnBottom': True,\n    'backgroundType': 2,\n    'backgroundColorRed': 1.0\n}\nalias = Alias.from_bytes(icvp['backgroundImageAlias'])\nalias.volume.name = package_name_ns\nalias.volume.posix_path = '/Volumes/' + package_name_ns\nalias.volume.disk_image_alias.target.filename = package_name_ns + '.temp.dmg'\nalias.volume.disk_image_alias.target.carbon_path = 'Macintosh HD:Users:\\x00bitcoinuser:\\x00Documents:\\x00bitcoin:\\x00bitcoin:\\x00' + package_name_ns + '.temp.dmg'\nalias.volume.disk_image_alias.target.posix_path = 'Users/bitcoinuser/Documents/bitcoin/bitcoin/' + package_name_ns + '.temp.dmg'\nalias.target.carbon_path = package_name_ns + ':.background:\\x00background.tiff'\nicvp['backgroundImageAlias'] = biplist.Data(alias.to_bytes())\nds['.']['icvp'] = icvp\n\nds['.']['vSrn'] = ('long', 1)\n\nds['Applications']['Iloc'] = (370, 156)\nds['Sugarchain-Qt.app']['Iloc'] = (128, 156)\n\nds.flush()\nds.close()\n"
  },
  {
    "path": "contrib/macdeploy/detached-sig-apply.sh",
    "content": "#!/bin/sh\n# Copyright (c) 2014-2015 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nset -e\n\nUNSIGNED=\"$1\"\nSIGNATURE=\"$2\"\nARCH=x86_64\nROOTDIR=dist\nTEMPDIR=signed.temp\nOUTDIR=signed-app\n\nif [ -z \"$UNSIGNED\" ]; then\n  echo \"usage: $0 <unsigned app> <signature>\"\n  exit 1\nfi\n\nif [ -z \"$SIGNATURE\" ]; then\n  echo \"usage: $0 <unsigned app> <signature>\"\n  exit 1\nfi\n\nrm -rf ${TEMPDIR} && mkdir -p ${TEMPDIR}\ntar -C ${TEMPDIR} -xf ${UNSIGNED}\ncp -rf \"${SIGNATURE}\"/* ${TEMPDIR}\n\nif [ -z \"${PAGESTUFF}\" ]; then\n  PAGESTUFF=${TEMPDIR}/pagestuff\nfi\n\nif [ -z \"${CODESIGN_ALLOCATE}\" ]; then\n  CODESIGN_ALLOCATE=${TEMPDIR}/codesign_allocate\nfi\n\nfind ${TEMPDIR} -name \"*.sign\" | while read i; do\n  SIZE=`stat -c %s \"${i}\"`\n  TARGET_FILE=\"`echo \"${i}\" | sed 's/\\.sign$//'`\"\n\n  echo \"Allocating space for the signature of size ${SIZE} in ${TARGET_FILE}\"\n  ${CODESIGN_ALLOCATE} -i \"${TARGET_FILE}\" -a ${ARCH} ${SIZE} -o \"${i}.tmp\"\n\n  OFFSET=`${PAGESTUFF} \"${i}.tmp\" -p | tail -2 | grep offset | sed 's/[^0-9]*//g'`\n  if [ -z ${QUIET} ]; then\n    echo \"Attaching signature at offset ${OFFSET}\"\n  fi\n\n  dd if=\"$i\" of=\"${i}.tmp\" bs=1 seek=${OFFSET} count=${SIZE} 2>/dev/null\n  mv \"${i}.tmp\" \"${TARGET_FILE}\"\n  rm \"${i}\"\n  echo \"Success.\"\ndone\nmv ${TEMPDIR}/${ROOTDIR} ${OUTDIR}\nrm -rf ${TEMPDIR}\necho \"Signed: ${OUTDIR}\"\n"
  },
  {
    "path": "contrib/macdeploy/detached-sig-create.sh",
    "content": "#!/bin/sh\n# Copyright (c) 2014-2015 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nset -e\n\nROOTDIR=dist\nBUNDLE=\"${ROOTDIR}/Sugarchain-Qt.app\"\nCODESIGN=codesign\nTEMPDIR=sign.temp\nTEMPLIST=${TEMPDIR}/signatures.txt\nOUT=signature-osx.tar.gz\nOUTROOT=osx\n\nif [ ! -n \"$1\" ]; then\n  echo \"usage: $0 <codesign args>\"\n  echo \"example: $0 -s MyIdentity\"\n  exit 1\nfi\n\nrm -rf ${TEMPDIR} ${TEMPLIST}\nmkdir -p ${TEMPDIR}\n\n${CODESIGN} -f --file-list ${TEMPLIST} \"$@\" \"${BUNDLE}\"\n\ngrep -v CodeResources < \"${TEMPLIST}\" | while read i; do\n  TARGETFILE=\"${BUNDLE}/`echo \"${i}\" | sed \"s|.*${BUNDLE}/||\"`\"\n  SIZE=`pagestuff \"$i\" -p | tail -2 | grep size | sed 's/[^0-9]*//g'`\n  OFFSET=`pagestuff \"$i\" -p | tail -2 | grep offset | sed 's/[^0-9]*//g'`\n  SIGNFILE=\"${TEMPDIR}/${OUTROOT}/${TARGETFILE}.sign\"\n  DIRNAME=\"`dirname \"${SIGNFILE}\"`\"\n  mkdir -p \"${DIRNAME}\"\n  echo \"Adding detached signature for: ${TARGETFILE}. Size: ${SIZE}. Offset: ${OFFSET}\"\n  dd if=\"$i\" of=\"${SIGNFILE}\" bs=1 skip=${OFFSET} count=${SIZE} 2>/dev/null\ndone\n\ngrep CodeResources < \"${TEMPLIST}\" | while read i; do\n  TARGETFILE=\"${BUNDLE}/`echo \"${i}\" | sed \"s|.*${BUNDLE}/||\"`\"\n  RESOURCE=\"${TEMPDIR}/${OUTROOT}/${TARGETFILE}\"\n  DIRNAME=\"`dirname \"${RESOURCE}\"`\"\n  mkdir -p \"${DIRNAME}\"\n  echo \"Adding resource for: \\\"${TARGETFILE}\\\"\"\n  cp \"${i}\" \"${RESOURCE}\"\ndone\n\nrm ${TEMPLIST}\n\ntar -C \"${TEMPDIR}\" -czf \"${OUT}\" .\nrm -rf \"${TEMPDIR}\"\necho \"Created ${OUT}\"\n"
  },
  {
    "path": "contrib/macdeploy/extract-osx-sdk.sh",
    "content": "#!/bin/bash\n# Copyright (c) 2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nset -e\n\nINPUTFILE=\"Xcode_7.3.1.dmg\"\nHFSFILENAME=\"5.hfs\"\nSDKDIR=\"Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk\"\n\n7z x \"${INPUTFILE}\" \"${HFSFILENAME}\"\nSDKNAME=\"$(basename \"${SDKDIR}\")\"\nSDKDIRINODE=$(ifind -n \"${SDKDIR}\" \"${HFSFILENAME}\")\nfls \"${HFSFILENAME}\" -rpF ${SDKDIRINODE} |\n while read type inode filename; do\n\tinode=\"${inode::-1}\"\n\tif [ \"${filename:0:14}\" = \"usr/share/man/\" ]; then\n\t\tcontinue\n\tfi\n\tfilename=\"${SDKNAME}/$filename\"\n\techo \"Extracting $filename ...\"\n\tmkdir -p \"$(dirname \"$filename\")\"\n\tif [ \"$type\" = \"l/l\" ]; then\n\t\tln -s \"$(icat \"${HFSFILENAME}\" $inode)\" \"$filename\"\n\telse\n\t\ticat \"${HFSFILENAME}\" $inode >\"$filename\"\n\tfi\ndone\necho \"Building ${SDKNAME}.tar.gz ...\"\nMTIME=\"$(istat \"${HFSFILENAME}\" \"${SDKDIRINODE}\" | perl -nle 'm/Content Modified:\\s+(.*?)\\s\\(/ && print $1')\"\nfind \"${SDKNAME}\" | sort | tar --no-recursion --mtime=\"${MTIME}\" --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > \"${SDKNAME}.tar.gz\"\necho 'All done!'\n"
  },
  {
    "path": "contrib/macdeploy/fancy.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>window_bounds</key>\n\t<array>\n\t\t<integer>300</integer>\n\t\t<integer>300</integer>\n\t\t<integer>800</integer>\n\t\t<integer>620</integer>\n\t</array>\n\t<key>background_picture</key>\n\t<string>background.tiff</string>\n\t<key>icon_size</key>\n\t<integer>96</integer>\n\t<key>applications_symlink</key>\n\t<true/>\n\t<key>items_position</key>\n\t<dict>\n\t\t<key>Applications</key>\n\t\t<array>\n\t\t\t<integer>370</integer>\n\t\t\t<integer>156</integer>\n\t\t</array>\n\t\t<key>Sugarchain-Qt.app</key>\n\t\t<array>\n\t\t\t<integer>128</integer>\n\t\t\t<integer>156</integer>\n\t\t</array>\n\t</dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "contrib/macdeploy/macdeployqtplus",
    "content": "#!/usr/bin/env python\nfrom __future__ import division, print_function, unicode_literals\n#\n# Copyright (C) 2011  Patrick \"p2k\" Schneider <me@p2k-network.org>\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n#\n\nimport subprocess, sys, re, os, shutil, stat, os.path, time\nfrom string import Template\nfrom argparse import ArgumentParser\n\n# This is ported from the original macdeployqt with modifications\n\nclass FrameworkInfo(object):\n    def __init__(self):\n        self.frameworkDirectory = \"\"\n        self.frameworkName = \"\"\n        self.frameworkPath = \"\"\n        self.binaryDirectory = \"\"\n        self.binaryName = \"\"\n        self.binaryPath = \"\"\n        self.version = \"\"\n        self.installName = \"\"\n        self.deployedInstallName = \"\"\n        self.sourceFilePath = \"\"\n        self.destinationDirectory = \"\"\n        self.sourceResourcesDirectory = \"\"\n        self.sourceVersionContentsDirectory = \"\"\n        self.sourceContentsDirectory = \"\"\n        self.destinationResourcesDirectory = \"\"\n        self.destinationVersionContentsDirectory = \"\"\n    \n    def __eq__(self, other):\n        if self.__class__ == other.__class__:\n            return self.__dict__ == other.__dict__\n        else:\n            return False\n    \n    def __str__(self):\n        return \"\"\" Framework name: %s\n Framework directory: %s\n Framework path: %s\n Binary name: %s\n Binary directory: %s\n Binary path: %s\n Version: %s\n Install name: %s\n Deployed install name: %s\n Source file Path: %s\n Deployed Directory (relative to bundle): %s\n\"\"\" % (self.frameworkName,\n       self.frameworkDirectory,\n       self.frameworkPath,\n       self.binaryName,\n       self.binaryDirectory,\n       self.binaryPath,\n       self.version,\n       self.installName,\n       self.deployedInstallName,\n       self.sourceFilePath,\n       self.destinationDirectory)\n    \n    def isDylib(self):\n        return self.frameworkName.endswith(\".dylib\")\n    \n    def isQtFramework(self):\n        if self.isDylib():\n            return self.frameworkName.startswith(\"libQt\")\n        else:\n            return self.frameworkName.startswith(\"Qt\")\n    \n    reOLine = re.compile(r'^(.+) \\(compatibility version [0-9.]+, current version [0-9.]+\\)$')\n    bundleFrameworkDirectory = \"Contents/Frameworks\"\n    bundleBinaryDirectory = \"Contents/MacOS\"\n    \n    @classmethod\n    def fromOtoolLibraryLine(cls, line):\n        # Note: line must be trimmed\n        if line == \"\":\n            return None\n        \n        # Don't deploy system libraries (exception for libQtuitools and libQtlucene).\n        if line.startswith(\"/System/Library/\") or line.startswith(\"@executable_path\") or (line.startswith(\"/usr/lib/\") and \"libQt\" not in line):\n            return None\n        \n        m = cls.reOLine.match(line)\n        if m is None:\n            raise RuntimeError(\"otool line could not be parsed: \" + line)\n        \n        path = m.group(1)\n        \n        info = cls()\n        info.sourceFilePath = path\n        info.installName = path\n        \n        if path.endswith(\".dylib\"):\n            dirname, filename = os.path.split(path)\n            info.frameworkName = filename\n            info.frameworkDirectory = dirname\n            info.frameworkPath = path\n            \n            info.binaryDirectory = dirname\n            info.binaryName = filename\n            info.binaryPath = path\n            info.version = \"-\"\n            \n            info.installName = path\n            info.deployedInstallName = \"@executable_path/../Frameworks/\" + info.binaryName\n            info.sourceFilePath = path\n            info.destinationDirectory = cls.bundleFrameworkDirectory\n        else:\n            parts = path.split(\"/\")\n            i = 0\n            # Search for the .framework directory\n            for part in parts:\n                if part.endswith(\".framework\"):\n                    break\n                i += 1\n            if i == len(parts):\n                raise RuntimeError(\"Could not find .framework or .dylib in otool line: \" + line)\n            \n            info.frameworkName = parts[i]\n            info.frameworkDirectory = \"/\".join(parts[:i])\n            info.frameworkPath = os.path.join(info.frameworkDirectory, info.frameworkName)\n            \n            info.binaryName = parts[i+3]\n            info.binaryDirectory = \"/\".join(parts[i+1:i+3])\n            info.binaryPath = os.path.join(info.binaryDirectory, info.binaryName)\n            info.version = parts[i+2]\n            \n            info.deployedInstallName = \"@executable_path/../Frameworks/\" + os.path.join(info.frameworkName, info.binaryPath)\n            info.destinationDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, info.binaryDirectory)\n            \n            info.sourceResourcesDirectory = os.path.join(info.frameworkPath, \"Resources\")\n            info.sourceContentsDirectory = os.path.join(info.frameworkPath, \"Contents\")\n            info.sourceVersionContentsDirectory = os.path.join(info.frameworkPath, \"Versions\", info.version, \"Contents\")\n            info.destinationResourcesDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, \"Resources\")\n            info.destinationContentsDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, \"Contents\")\n            info.destinationVersionContentsDirectory = os.path.join(cls.bundleFrameworkDirectory, info.frameworkName, \"Versions\", info.version, \"Contents\")\n        \n        return info\n\nclass ApplicationBundleInfo(object):\n    def __init__(self, path):\n        self.path = path\n        appName = \"Sugarchain-Qt\"\n        self.binaryPath = os.path.join(path, \"Contents\", \"MacOS\", appName)\n        if not os.path.exists(self.binaryPath):\n            raise RuntimeError(\"Could not find bundle binary for \" + path)\n        self.resourcesPath = os.path.join(path, \"Contents\", \"Resources\")\n        self.pluginPath = os.path.join(path, \"Contents\", \"PlugIns\")\n\nclass DeploymentInfo(object):\n    def __init__(self):\n        self.qtPath = None\n        self.pluginPath = None\n        self.deployedFrameworks = []\n    \n    def detectQtPath(self, frameworkDirectory):\n        parentDir = os.path.dirname(frameworkDirectory)\n        if os.path.exists(os.path.join(parentDir, \"translations\")):\n            # Classic layout, e.g. \"/usr/local/Trolltech/Qt-4.x.x\"\n            self.qtPath = parentDir\n        elif os.path.exists(os.path.join(parentDir, \"share\", \"qt4\", \"translations\")):\n            # MacPorts layout, e.g. \"/opt/local/share/qt4\"\n            self.qtPath = os.path.join(parentDir, \"share\", \"qt4\")\n        elif os.path.exists(os.path.join(os.path.dirname(parentDir), \"share\", \"qt4\", \"translations\")):\n            # Newer Macports layout\n            self.qtPath = os.path.join(os.path.dirname(parentDir), \"share\", \"qt4\")\n        else:\n            self.qtPath = os.getenv(\"QTDIR\", None)\n\n        if self.qtPath is not None:\n            pluginPath = os.path.join(self.qtPath, \"plugins\")\n            if os.path.exists(pluginPath):\n                self.pluginPath = pluginPath\n    \n    def usesFramework(self, name):\n        nameDot = \"%s.\" % name\n        libNameDot = \"lib%s.\" % name\n        for framework in self.deployedFrameworks:\n            if framework.endswith(\".framework\"):\n                if framework.startswith(nameDot):\n                    return True\n            elif framework.endswith(\".dylib\"):\n                if framework.startswith(libNameDot):\n                    return True\n        return False\n\ndef getFrameworks(binaryPath, verbose):\n    if verbose >= 3:\n        print(\"Inspecting with otool: \" + binaryPath)\n    otoolbin=os.getenv(\"OTOOL\", \"otool\")\n    otool = subprocess.Popen([otoolbin, \"-L\", binaryPath], stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n    o_stdout, o_stderr = otool.communicate()\n    if otool.returncode != 0:\n        if verbose >= 1:\n            sys.stderr.write(o_stderr)\n            sys.stderr.flush()\n            raise RuntimeError(\"otool failed with return code %d\" % otool.returncode)\n\n    otoolLines = o_stdout.decode().split(\"\\n\")\n    otoolLines.pop(0) # First line is the inspected binary\n    if \".framework\" in binaryPath or binaryPath.endswith(\".dylib\"):\n        otoolLines.pop(0) # Frameworks and dylibs list themselves as a dependency.\n    \n    libraries = []\n    for line in otoolLines:\n        line = line.replace(\"@loader_path\", os.path.dirname(binaryPath))\n        info = FrameworkInfo.fromOtoolLibraryLine(line.strip())\n        if info is not None:\n            if verbose >= 3:\n                print(\"Found framework:\")\n                print(info)\n            libraries.append(info)\n    \n    return libraries\n\ndef runInstallNameTool(action, *args):\n    installnametoolbin=os.getenv(\"INSTALLNAMETOOL\", \"install_name_tool\")\n    subprocess.check_call([installnametoolbin, \"-\"+action] + list(args))\n\ndef changeInstallName(oldName, newName, binaryPath, verbose):\n    if verbose >= 3:\n        print(\"Using install_name_tool:\")\n        print(\" in\", binaryPath)\n        print(\" change reference\", oldName)\n        print(\" to\", newName)\n    runInstallNameTool(\"change\", oldName, newName, binaryPath)\n\ndef changeIdentification(id, binaryPath, verbose):\n    if verbose >= 3:\n        print(\"Using install_name_tool:\")\n        print(\" change identification in\", binaryPath)\n        print(\" to\", id)\n    runInstallNameTool(\"id\", id, binaryPath)\n\ndef runStrip(binaryPath, verbose):\n    stripbin=os.getenv(\"STRIP\", \"strip\")\n    if verbose >= 3:\n        print(\"Using strip:\")\n        print(\" stripped\", binaryPath)\n    subprocess.check_call([stripbin, \"-x\", binaryPath])\n\ndef copyFramework(framework, path, verbose):\n    if framework.sourceFilePath.startswith(\"Qt\"):\n        #standard place for Nokia Qt installer's frameworks\n        fromPath = \"/Library/Frameworks/\" + framework.sourceFilePath\n    else:\n        fromPath = framework.sourceFilePath\n    toDir = os.path.join(path, framework.destinationDirectory)\n    toPath = os.path.join(toDir, framework.binaryName)\n    \n    if not os.path.exists(fromPath):\n        raise RuntimeError(\"No file at \" + fromPath)\n    \n    if os.path.exists(toPath):\n        return None # Already there\n    \n    if not os.path.exists(toDir):\n        os.makedirs(toDir)\n    \n    shutil.copy2(fromPath, toPath)\n    if verbose >= 3:\n        print(\"Copied:\", fromPath)\n        print(\" to:\", toPath)\n\n    permissions = os.stat(toPath)\n    if not permissions.st_mode & stat.S_IWRITE:\n      os.chmod(toPath, permissions.st_mode | stat.S_IWRITE)\n\n    if not framework.isDylib(): # Copy resources for real frameworks\n\n        linkfrom = os.path.join(path, \"Contents\",\"Frameworks\", framework.frameworkName, \"Versions\", \"Current\")\n        linkto = framework.version\n        if not os.path.exists(linkfrom):\n            os.symlink(linkto, linkfrom)\n            if verbose >= 2:\n                print(\"Linked:\", linkfrom, \"->\", linkto)\n        fromResourcesDir = framework.sourceResourcesDirectory\n        if os.path.exists(fromResourcesDir):\n            toResourcesDir = os.path.join(path, framework.destinationResourcesDirectory)\n            shutil.copytree(fromResourcesDir, toResourcesDir, symlinks=True)\n            if verbose >= 3:\n                print(\"Copied resources:\", fromResourcesDir)\n                print(\" to:\", toResourcesDir)\n        fromContentsDir = framework.sourceVersionContentsDirectory\n        if not os.path.exists(fromContentsDir):\n            fromContentsDir = framework.sourceContentsDirectory\n        if os.path.exists(fromContentsDir):\n            toContentsDir = os.path.join(path, framework.destinationVersionContentsDirectory)\n            shutil.copytree(fromContentsDir, toContentsDir, symlinks=True)\n            if verbose >= 3:\n                print(\"Copied Contents:\", fromContentsDir)\n                print(\" to:\", toContentsDir)\n    elif framework.frameworkName.startswith(\"libQtGui\"): # Copy qt_menu.nib (applies to non-framework layout)\n        qtMenuNibSourcePath = os.path.join(framework.frameworkDirectory, \"Resources\", \"qt_menu.nib\")\n        qtMenuNibDestinationPath = os.path.join(path, \"Contents\", \"Resources\", \"qt_menu.nib\")\n        if os.path.exists(qtMenuNibSourcePath) and not os.path.exists(qtMenuNibDestinationPath):\n            shutil.copytree(qtMenuNibSourcePath, qtMenuNibDestinationPath, symlinks=True)\n            if verbose >= 3:\n                print(\"Copied for libQtGui:\", qtMenuNibSourcePath)\n                print(\" to:\", qtMenuNibDestinationPath)\n    \n    return toPath\n\ndef deployFrameworks(frameworks, bundlePath, binaryPath, strip, verbose, deploymentInfo=None):\n    if deploymentInfo is None:\n        deploymentInfo = DeploymentInfo()\n    \n    while len(frameworks) > 0:\n        framework = frameworks.pop(0)\n        deploymentInfo.deployedFrameworks.append(framework.frameworkName)\n        \n        if verbose >= 2:\n            print(\"Processing\", framework.frameworkName, \"...\")\n        \n        # Get the Qt path from one of the Qt frameworks\n        if deploymentInfo.qtPath is None and framework.isQtFramework():\n            deploymentInfo.detectQtPath(framework.frameworkDirectory)\n        \n        if framework.installName.startswith(\"@executable_path\") or framework.installName.startswith(bundlePath):\n            if verbose >= 2:\n                print(framework.frameworkName, \"already deployed, skipping.\")\n            continue\n        \n        # install_name_tool the new id into the binary\n        changeInstallName(framework.installName, framework.deployedInstallName, binaryPath, verbose)\n        \n        # Copy framework to app bundle.\n        deployedBinaryPath = copyFramework(framework, bundlePath, verbose)\n        # Skip the rest if already was deployed.\n        if deployedBinaryPath is None:\n            continue\n        \n        if strip:\n            runStrip(deployedBinaryPath, verbose)\n        \n        # install_name_tool it a new id.\n        changeIdentification(framework.deployedInstallName, deployedBinaryPath, verbose)\n        # Check for framework dependencies\n        dependencies = getFrameworks(deployedBinaryPath, verbose)\n        \n        for dependency in dependencies:\n            changeInstallName(dependency.installName, dependency.deployedInstallName, deployedBinaryPath, verbose)\n            \n            # Deploy framework if necessary.\n            if dependency.frameworkName not in deploymentInfo.deployedFrameworks and dependency not in frameworks:\n                frameworks.append(dependency)\n    \n    return deploymentInfo\n\ndef deployFrameworksForAppBundle(applicationBundle, strip, verbose):\n    frameworks = getFrameworks(applicationBundle.binaryPath, verbose)\n    if len(frameworks) == 0 and verbose >= 1:\n        print(\"Warning: Could not find any external frameworks to deploy in %s.\" % (applicationBundle.path))\n        return DeploymentInfo()\n    else:\n        return deployFrameworks(frameworks, applicationBundle.path, applicationBundle.binaryPath, strip, verbose)\n\ndef deployPlugins(appBundleInfo, deploymentInfo, strip, verbose):\n    # Lookup available plugins, exclude unneeded\n    plugins = []\n    if deploymentInfo.pluginPath is None:\n        return\n    for dirpath, dirnames, filenames in os.walk(deploymentInfo.pluginPath):\n        pluginDirectory = os.path.relpath(dirpath, deploymentInfo.pluginPath)\n        if pluginDirectory == \"designer\":\n            # Skip designer plugins\n            continue\n        elif pluginDirectory == \"phonon\" or pluginDirectory == \"phonon_backend\":\n            # Deploy the phonon plugins only if phonon is in use\n            if not deploymentInfo.usesFramework(\"phonon\"):\n                continue\n        elif pluginDirectory == \"sqldrivers\":\n            # Deploy the sql plugins only if QtSql is in use\n            if not deploymentInfo.usesFramework(\"QtSql\"):\n                continue\n        elif pluginDirectory == \"script\":\n            # Deploy the script plugins only if QtScript is in use\n            if not deploymentInfo.usesFramework(\"QtScript\"):\n                continue\n        elif pluginDirectory == \"qmltooling\" or pluginDirectory == \"qml1tooling\":\n            # Deploy the qml plugins only if QtDeclarative is in use\n            if not deploymentInfo.usesFramework(\"QtDeclarative\"):\n                continue\n        elif pluginDirectory == \"bearer\":\n            # Deploy the bearer plugins only if QtNetwork is in use\n            if not deploymentInfo.usesFramework(\"QtNetwork\"):\n                continue\n        elif pluginDirectory == \"position\":\n            # Deploy the position plugins only if QtPositioning is in use\n            if not deploymentInfo.usesFramework(\"QtPositioning\"):\n                continue\n        elif pluginDirectory == \"sensors\" or pluginDirectory == \"sensorgestures\":\n            # Deploy the sensor plugins only if QtSensors is in use\n            if not deploymentInfo.usesFramework(\"QtSensors\"):\n                continue\n        elif pluginDirectory == \"audio\" or pluginDirectory == \"playlistformats\":\n            # Deploy the audio plugins only if QtMultimedia is in use\n            if not deploymentInfo.usesFramework(\"QtMultimedia\"):\n                continue\n        elif pluginDirectory == \"mediaservice\":\n            # Deploy the mediaservice plugins only if QtMultimediaWidgets is in use\n            if not deploymentInfo.usesFramework(\"QtMultimediaWidgets\"):\n                continue\n\n        for pluginName in filenames:\n            pluginPath = os.path.join(pluginDirectory, pluginName)\n            if pluginName.endswith(\"_debug.dylib\"):\n                # Skip debug plugins\n                continue\n            elif pluginPath == \"imageformats/libqsvg.dylib\" or pluginPath == \"iconengines/libqsvgicon.dylib\":\n                # Deploy the svg plugins only if QtSvg is in use\n                if not deploymentInfo.usesFramework(\"QtSvg\"):\n                    continue\n            elif pluginPath == \"accessible/libqtaccessiblecompatwidgets.dylib\":\n                # Deploy accessibility for Qt3Support only if the Qt3Support is in use\n                if not deploymentInfo.usesFramework(\"Qt3Support\"):\n                    continue\n            elif pluginPath == \"graphicssystems/libqglgraphicssystem.dylib\":\n                # Deploy the opengl graphicssystem plugin only if QtOpenGL is in use\n                if not deploymentInfo.usesFramework(\"QtOpenGL\"):\n                    continue\n            elif pluginPath == \"accessible/libqtaccessiblequick.dylib\":\n                # Deploy the accessible qtquick plugin only if QtQuick is in use\n                if not deploymentInfo.usesFramework(\"QtQuick\"):\n                    continue\n\n            plugins.append((pluginDirectory, pluginName))\n    \n    for pluginDirectory, pluginName in plugins:\n        if verbose >= 2:\n            print(\"Processing plugin\", os.path.join(pluginDirectory, pluginName), \"...\")\n        \n        sourcePath = os.path.join(deploymentInfo.pluginPath, pluginDirectory, pluginName)\n        destinationDirectory = os.path.join(appBundleInfo.pluginPath, pluginDirectory)\n        if not os.path.exists(destinationDirectory):\n            os.makedirs(destinationDirectory)\n        \n        destinationPath = os.path.join(destinationDirectory, pluginName)\n        shutil.copy2(sourcePath, destinationPath)\n        if verbose >= 3:\n            print(\"Copied:\", sourcePath)\n            print(\" to:\", destinationPath)\n        \n        if strip:\n            runStrip(destinationPath, verbose)\n        \n        dependencies = getFrameworks(destinationPath, verbose)\n        \n        for dependency in dependencies:\n            changeInstallName(dependency.installName, dependency.deployedInstallName, destinationPath, verbose)\n            \n            # Deploy framework if necessary.\n            if dependency.frameworkName not in deploymentInfo.deployedFrameworks:\n                deployFrameworks([dependency], appBundleInfo.path, destinationPath, strip, verbose, deploymentInfo)\n\nqt_conf=\"\"\"[Paths]\nTranslations=Resources\nPlugins=PlugIns\n\"\"\"\n\nap = ArgumentParser(description=\"\"\"Improved version of macdeployqt.\n\nOutputs a ready-to-deploy app in a folder \"dist\" and optionally wraps it in a .dmg file.\nNote, that the \"dist\" folder will be deleted before deploying on each run.\n\nOptionally, Qt translation files (.qm) and additional resources can be added to the bundle.\n\nAlso optionally signs the .app bundle; set the CODESIGNARGS environment variable to pass arguments\nto the codesign tool.\nE.g. CODESIGNARGS='--sign \"Developer ID Application: ...\" --keychain /encrypted/foo.keychain'\"\"\")\n\nap.add_argument(\"app_bundle\", nargs=1, metavar=\"app-bundle\", help=\"application bundle to be deployed\")\nap.add_argument(\"-verbose\", type=int, nargs=1, default=[1], metavar=\"<0-3>\", help=\"0 = no output, 1 = error/warning (default), 2 = normal, 3 = debug\")\nap.add_argument(\"-no-plugins\", dest=\"plugins\", action=\"store_false\", default=True, help=\"skip plugin deployment\")\nap.add_argument(\"-no-strip\", dest=\"strip\", action=\"store_false\", default=True, help=\"don't run 'strip' on the binaries\")\nap.add_argument(\"-sign\", dest=\"sign\", action=\"store_true\", default=False, help=\"sign .app bundle with codesign tool\")\nap.add_argument(\"-dmg\", nargs=\"?\", const=\"\", metavar=\"basename\", help=\"create a .dmg disk image; if basename is not specified, a camel-cased version of the app name is used\")\nap.add_argument(\"-fancy\", nargs=1, metavar=\"plist\", default=[], help=\"make a fancy looking disk image using the given plist file with instructions; requires -dmg to work\")\nap.add_argument(\"-add-qt-tr\", nargs=1, metavar=\"languages\", default=[], help=\"add Qt translation files to the bundle's resources; the language list must be separated with commas, not with whitespace\")\nap.add_argument(\"-translations-dir\", nargs=1, metavar=\"path\", default=None, help=\"Path to Qt's translation files\")\nap.add_argument(\"-add-resources\", nargs=\"+\", metavar=\"path\", default=[], help=\"list of additional files or folders to be copied into the bundle's resources; must be the last argument\")\nap.add_argument(\"-volname\", nargs=1, metavar=\"volname\", default=[], help=\"custom volume name for dmg\")\n\nconfig = ap.parse_args()\n\nverbose = config.verbose[0]\n\n# ------------------------------------------------\n\napp_bundle = config.app_bundle[0]\n\nif not os.path.exists(app_bundle):\n    if verbose >= 1:\n        sys.stderr.write(\"Error: Could not find app bundle \\\"%s\\\"\\n\" % (app_bundle))\n    sys.exit(1)\n\napp_bundle_name = os.path.splitext(os.path.basename(app_bundle))[0]\n\n# ------------------------------------------------\ntranslations_dir = None\nif config.translations_dir and config.translations_dir[0]:\n    if os.path.exists(config.translations_dir[0]):\n        translations_dir = config.translations_dir[0]\n    else:\n        if verbose >= 1:\n            sys.stderr.write(\"Error: Could not find translation dir \\\"%s\\\"\\n\" % (translations_dir))\n        sys.exit(1)\n# ------------------------------------------------\n\nfor p in config.add_resources:\n    if verbose >= 3:\n        print(\"Checking for \\\"%s\\\"...\" % p)\n    if not os.path.exists(p):\n        if verbose >= 1:\n            sys.stderr.write(\"Error: Could not find additional resource file \\\"%s\\\"\\n\" % (p))\n        sys.exit(1)\n\n# ------------------------------------------------\n\nif len(config.fancy) == 1:\n    if verbose >= 3:\n        print(\"Fancy: Importing plistlib...\")\n    try:\n        import plistlib\n    except ImportError:\n        if verbose >= 1:\n            sys.stderr.write(\"Error: Could not import plistlib which is required for fancy disk images.\\n\")\n        sys.exit(1)\n    \n    p = config.fancy[0]\n    if verbose >= 3:\n        print(\"Fancy: Loading \\\"%s\\\"...\" % p)\n    if not os.path.exists(p):\n        if verbose >= 1:\n            sys.stderr.write(\"Error: Could not find fancy disk image plist at \\\"%s\\\"\\n\" % (p))\n        sys.exit(1)\n    \n    try:\n        fancy = plistlib.readPlist(p)\n    except:\n        if verbose >= 1:\n            sys.stderr.write(\"Error: Could not parse fancy disk image plist at \\\"%s\\\"\\n\" % (p))\n        sys.exit(1)\n    \n    try:\n        assert \"window_bounds\" not in fancy or (isinstance(fancy[\"window_bounds\"], list) and len(fancy[\"window_bounds\"]) == 4)\n        assert \"background_picture\" not in fancy or isinstance(fancy[\"background_picture\"], str)\n        assert \"icon_size\" not in fancy or isinstance(fancy[\"icon_size\"], int)\n        assert \"applications_symlink\" not in fancy or isinstance(fancy[\"applications_symlink\"], bool)\n        if \"items_position\" in fancy:\n            assert isinstance(fancy[\"items_position\"], dict)\n            for key, value in fancy[\"items_position\"].items():\n                assert isinstance(value, list) and len(value) == 2 and isinstance(value[0], int) and isinstance(value[1], int)\n    except:\n        if verbose >= 1:\n            sys.stderr.write(\"Error: Bad format of fancy disk image plist at \\\"%s\\\"\\n\" % (p))\n        sys.exit(1)\n    \n    if \"background_picture\" in fancy:\n        bp = fancy[\"background_picture\"]\n        if verbose >= 3:\n            print(\"Fancy: Resolving background picture \\\"%s\\\"...\" % bp)\n        if not os.path.exists(bp):\n            bp = os.path.join(os.path.dirname(p), bp)\n            if not os.path.exists(bp):\n                if verbose >= 1:\n                    sys.stderr.write(\"Error: Could not find background picture at \\\"%s\\\" or \\\"%s\\\"\\n\" % (fancy[\"background_picture\"], bp))\n                sys.exit(1)\n            else:\n                fancy[\"background_picture\"] = bp\nelse:\n    fancy = None\n\n# ------------------------------------------------\n\nif os.path.exists(\"dist\"):\n    if verbose >= 2:\n        print(\"+ Removing old dist folder +\")\n    \n    shutil.rmtree(\"dist\")\n\n# ------------------------------------------------\n\nif len(config.volname) == 1:\n    volname = config.volname[0]\nelse:\n    volname = app_bundle_name\n\n# ------------------------------------------------\n\ntarget = os.path.join(\"dist\", \"Sugarchain-Qt.app\")\n\nif verbose >= 2:\n    print(\"+ Copying source bundle +\")\nif verbose >= 3:\n    print(app_bundle, \"->\", target)\n\nos.mkdir(\"dist\")\nshutil.copytree(app_bundle, target, symlinks=True)\n\napplicationBundle = ApplicationBundleInfo(target)\n\n# ------------------------------------------------\n\nif verbose >= 2:\n    print(\"+ Deploying frameworks +\")\n\ntry:\n    deploymentInfo = deployFrameworksForAppBundle(applicationBundle, config.strip, verbose)\n    if deploymentInfo.qtPath is None:\n        deploymentInfo.qtPath = os.getenv(\"QTDIR\", None)\n        if deploymentInfo.qtPath is None:\n            if verbose >= 1:\n                sys.stderr.write(\"Warning: Could not detect Qt's path, skipping plugin deployment!\\n\")\n            config.plugins = False\nexcept RuntimeError as e:\n    if verbose >= 1:\n        sys.stderr.write(\"Error: %s\\n\" % str(e))\n    sys.exit(1)\n\n# ------------------------------------------------\n\nif config.plugins:\n    if verbose >= 2:\n        print(\"+ Deploying plugins +\")\n    \n    try:\n        deployPlugins(applicationBundle, deploymentInfo, config.strip, verbose)\n    except RuntimeError as e:\n        if verbose >= 1:\n            sys.stderr.write(\"Error: %s\\n\" % str(e))\n        sys.exit(1)\n\n# ------------------------------------------------\n\nif len(config.add_qt_tr) == 0:\n    add_qt_tr = []\nelse:\n    if translations_dir is not None:\n        qt_tr_dir = translations_dir\n    else:\n        if deploymentInfo.qtPath is not None:\n            qt_tr_dir = os.path.join(deploymentInfo.qtPath, \"translations\")\n        else:\n            sys.stderr.write(\"Error: Could not find Qt translation path\\n\")\n            sys.exit(1)\n    add_qt_tr = [\"qt_%s.qm\" % lng for lng in config.add_qt_tr[0].split(\",\")]\n    for lng_file in add_qt_tr:\n        p = os.path.join(qt_tr_dir, lng_file)\n        if verbose >= 3:\n            print(\"Checking for \\\"%s\\\"...\" % p)\n        if not os.path.exists(p):\n            if verbose >= 1:\n                sys.stderr.write(\"Error: Could not find Qt translation file \\\"%s\\\"\\n\" % (lng_file))\n                sys.exit(1)\n\n# ------------------------------------------------\n\nif verbose >= 2:\n    print(\"+ Installing qt.conf +\")\n\nwith open(os.path.join(applicationBundle.resourcesPath, \"qt.conf\"), \"wb\") as f:\n    f.write(qt_conf.encode())\n\n# ------------------------------------------------\n\nif len(add_qt_tr) > 0 and verbose >= 2:\n    print(\"+ Adding Qt translations +\")\n\nfor lng_file in add_qt_tr:\n    if verbose >= 3:\n        print(os.path.join(qt_tr_dir, lng_file), \"->\", os.path.join(applicationBundle.resourcesPath, lng_file))\n    shutil.copy2(os.path.join(qt_tr_dir, lng_file), os.path.join(applicationBundle.resourcesPath, lng_file))\n\n# ------------------------------------------------\n\nif len(config.add_resources) > 0 and verbose >= 2:\n    print(\"+ Adding additional resources +\")\n\nfor p in config.add_resources:\n    t = os.path.join(applicationBundle.resourcesPath, os.path.basename(p))\n    if verbose >= 3:\n        print(p, \"->\", t)\n    if os.path.isdir(p):\n        shutil.copytree(p, t, symlinks=True)\n    else:\n        shutil.copy2(p, t)\n\n# ------------------------------------------------\n\nif config.sign and 'CODESIGNARGS' not in os.environ:\n    print(\"You must set the CODESIGNARGS environment variable. Skipping signing.\")\nelif config.sign:\n    if verbose >= 1:\n        print(\"Code-signing app bundle %s\"%(target,))\n    subprocess.check_call(\"codesign --force %s %s\"%(os.environ['CODESIGNARGS'], target), shell=True)\n\n# ------------------------------------------------\n\nif config.dmg is not None:\n\n    #Patch in check_output for Python 2.6\n    if \"check_output\" not in dir( subprocess ):\n        def f(*popenargs, **kwargs):\n            if 'stdout' in kwargs:\n                raise ValueError('stdout argument not allowed, it will be overridden.')\n            process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)\n            output, unused_err = process.communicate()\n            retcode = process.poll()\n            if retcode:\n                cmd = kwargs.get(\"args\")\n                if cmd is None:\n                    cmd = popenargs[0]\n                raise CalledProcessError(retcode, cmd)\n            return output\n        subprocess.check_output = f\n\n    def runHDIUtil(verb, image_basename, **kwargs):\n        hdiutil_args = [\"hdiutil\", verb, image_basename + \".dmg\"]\n        if \"capture_stdout\" in kwargs:\n            del kwargs[\"capture_stdout\"]\n            run = subprocess.check_output\n        else:\n            if verbose < 2:\n                hdiutil_args.append(\"-quiet\")\n            elif verbose >= 3:\n                hdiutil_args.append(\"-verbose\")\n            run = subprocess.check_call\n        \n        for key, value in kwargs.items():\n            hdiutil_args.append(\"-\" + key)\n            if not value is True:\n                hdiutil_args.append(str(value))\n        \n        return run(hdiutil_args)\n    \n    if verbose >= 2:\n        if fancy is None:\n            print(\"+ Creating .dmg disk image +\")\n        else:\n            print(\"+ Preparing .dmg disk image +\")\n    \n    if config.dmg != \"\":\n        dmg_name = config.dmg\n    else:\n        spl = app_bundle_name.split(\" \")\n        dmg_name = spl[0] + \"\".join(p.capitalize() for p in spl[1:])\n    \n    if fancy is None:\n        try:\n            runHDIUtil(\"create\", dmg_name, srcfolder=\"dist\", format=\"UDBZ\", volname=volname, ov=True)\n        except subprocess.CalledProcessError as e:\n            sys.exit(e.returncode)\n    else:\n        if verbose >= 3:\n            print(\"Determining size of \\\"dist\\\"...\")\n        size = 0\n        for path, dirs, files in os.walk(\"dist\"):\n            for file in files:\n                size += os.path.getsize(os.path.join(path, file))\n        size += int(size * 0.15)\n        \n        if verbose >= 3:\n            print(\"Creating temp image for modification...\")\n        try:\n            runHDIUtil(\"create\", dmg_name + \".temp\", srcfolder=\"dist\", format=\"UDRW\", size=size, volname=volname, ov=True)\n        except subprocess.CalledProcessError as e:\n            sys.exit(e.returncode)\n        \n        if verbose >= 3:\n            print(\"Attaching temp image...\")\n        try:\n            output = runHDIUtil(\"attach\", dmg_name + \".temp\", readwrite=True, noverify=True, noautoopen=True, capture_stdout=True)\n        except subprocess.CalledProcessError as e:\n            sys.exit(e.returncode)\n        \n        m = re.search(\"/Volumes/(.+$)\", output.decode())\n        disk_root = m.group(0)\n        disk_name = m.group(1)\n        \n        if verbose >= 2:\n            print(\"+ Applying fancy settings +\")\n        \n        if \"background_picture\" in fancy:\n            bg_path = os.path.join(disk_root, \".background\", os.path.basename(fancy[\"background_picture\"]))\n            os.mkdir(os.path.dirname(bg_path))\n            if verbose >= 3:\n                print(fancy[\"background_picture\"], \"->\", bg_path)\n            shutil.copy2(fancy[\"background_picture\"], bg_path)\n        else:\n            bg_path = None\n        \n        if fancy.get(\"applications_symlink\", False):\n            os.symlink(\"/Applications\", os.path.join(disk_root, \"Applications\"))\n        \n        # The Python appscript package broke with OSX 10.8 and isn't being fixed.\n        # So we now build up an AppleScript string and use the osascript command\n        # to make the .dmg file pretty:\n        appscript = Template( \"\"\"\n        on run argv\n           tell application \"Finder\"\n             tell disk \"$disk\"\n                   open\n                   set current view of container window to icon view\n                   set toolbar visible of container window to false\n                   set statusbar visible of container window to false\n                   set the bounds of container window to {$window_bounds}\n                   set theViewOptions to the icon view options of container window\n                   set arrangement of theViewOptions to not arranged\n                   set icon size of theViewOptions to $icon_size\n                   $background_commands\n                   $items_positions\n                   close -- close/reopen works around a bug...\n                   open\n                   update without registering applications\n                   delay 5\n                   eject\n             end tell\n           end tell\n        end run\n        \"\"\")\n\n        itemscript = Template('set position of item \"${item}\" of container window to {${position}}')\n        items_positions = []\n        if \"items_position\" in fancy:\n            for name, position in fancy[\"items_position\"].items():\n                params = { \"item\" : name, \"position\" : \",\".join([str(p) for p in position]) }\n                items_positions.append(itemscript.substitute(params))\n\n        params = {\n            \"disk\" : volname,\n            \"window_bounds\" : \"300,300,800,620\",\n            \"icon_size\" : \"96\",\n            \"background_commands\" : \"\",\n            \"items_positions\" : \"\\n                   \".join(items_positions)\n            }\n        if \"window_bounds\" in fancy:\n            params[\"window_bounds\"] = \",\".join([str(p) for p in fancy[\"window_bounds\"]])\n        if \"icon_size\" in fancy:\n            params[\"icon_size\"] = str(fancy[\"icon_size\"])\n        if bg_path is not None:\n            # Set background file, then call SetFile to make it invisible.\n            # (note: making it invisible first makes set background picture fail)\n            bgscript = Template(\"\"\"set background picture of theViewOptions to file \".background:$bgpic\"\n                   do shell script \"SetFile -a V /Volumes/$disk/.background/$bgpic\" \"\"\")\n            params[\"background_commands\"] = bgscript.substitute({\"bgpic\" : os.path.basename(bg_path), \"disk\" : params[\"disk\"]})\n\n        s = appscript.substitute(params)\n        if verbose >= 2:\n            print(\"Running AppleScript:\")\n            print(s)\n\n        p = subprocess.Popen(['osascript', '-'], stdin=subprocess.PIPE)\n        p.communicate(input=s.encode('utf-8'))\n        if p.returncode:\n            print(\"Error running osascript.\")\n\n        if verbose >= 2:\n            print(\"+ Finalizing .dmg disk image +\")\n            time.sleep(5)\n        \n        try:\n            runHDIUtil(\"convert\", dmg_name + \".temp\", format=\"UDBZ\", o=dmg_name + \".dmg\", ov=True)\n        except subprocess.CalledProcessError as e:\n            sys.exit(e.returncode)\n        \n        os.unlink(dmg_name + \".temp.dmg\")\n\n# ------------------------------------------------\n\nif verbose >= 2:\n    print(\"+ Done +\")\n\nsys.exit(0)\n"
  },
  {
    "path": "contrib/qos/README.md",
    "content": "### QoS (Quality of service) ###\n\nThis 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 34230, but not if the destination IP is within a LAN.\n\nThis 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.\n"
  },
  {
    "path": "contrib/qos/tc.sh",
    "content": "# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#network interface on which to limit traffic\nIF=\"eth0\"\n#limit of the network interface in question\nLINKCEIL=\"1gbit\"\n#limit outbound Bitcoin protocol traffic to this rate\nLIMIT=\"160kbit\"\n#defines the IPv4 address space for which you wish to disable rate limiting\nLOCALNET_V4=\"192.168.0.0/16\"\n#defines the IPv6 address space for which you wish to disable rate limiting\nLOCALNET_V6=\"fe80::/10\"\n\n#delete existing rules\ntc qdisc del dev ${IF} root\n\n#add root class\ntc qdisc add dev ${IF} root handle 1: htb default 10\n\n#add parent class\ntc class add dev ${IF} parent 1: classid 1:1 htb rate ${LINKCEIL} ceil ${LINKCEIL}\n\n#add our two classes. one unlimited, another limited\ntc class add dev ${IF} parent 1:1 classid 1:10 htb rate ${LINKCEIL} ceil ${LINKCEIL} prio 0\ntc class add dev ${IF} parent 1:1 classid 1:11 htb rate ${LIMIT} ceil ${LIMIT} prio 1\n\n#add handles to our classes so packets marked with <x> go into the class with \"... handle <x> fw ...\"\ntc filter add dev ${IF} parent 1: protocol ip prio 1 handle 1 fw classid 1:10\ntc filter add dev ${IF} parent 1: protocol ip prio 2 handle 2 fw classid 1:11\n\nif [ ! -z \"${LOCALNET_V6}\" ] ; then\n\t# v6 cannot have the same priority value as v4\n\ttc filter add dev ${IF} parent 1: protocol ipv6 prio 3 handle 1 fw classid 1:10\n\ttc filter add dev ${IF} parent 1: protocol ipv6 prio 4 handle 2 fw classid 1:11\nfi\n\n#delete any existing rules\n#disable for now\n#ret=0\n#while [ $ret -eq 0 ]; do\n#\tiptables -t mangle -D OUTPUT 1\n#\tret=$?\n#done\n\n#limit outgoing traffic to and from port 34230. but not when dealing with a host on the local network\n#\t(defined by $LOCALNET_V4 and $LOCALNET_V6)\n#\t--set-mark marks packages matching these criteria with the number \"2\" (v4)\n#\t--set-mark marks packages matching these criteria with the number \"4\" (v6)\n#\tthese packets are filtered by the tc filter with \"handle 2\"\n#\tthis filter sends the packages into the 1:11 class, and this class is limited to ${LIMIT}\niptables -t mangle -A OUTPUT -p tcp -m tcp --dport 34230 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2\niptables -t mangle -A OUTPUT -p tcp -m tcp --sport 34230 ! -d ${LOCALNET_V4} -j MARK --set-mark 0x2\n\nif [ ! -z \"${LOCALNET_V6}\" ] ; then\n\tip6tables -t mangle -A OUTPUT -p tcp -m tcp --dport 34230 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4\n\tip6tables -t mangle -A OUTPUT -p tcp -m tcp --sport 34230 ! -d ${LOCALNET_V6} -j MARK --set-mark 0x4\nfi\n"
  },
  {
    "path": "contrib/rpm/README.md",
    "content": "RPM Spec File Notes\n-------------------\n\nThe RPM spec file provided here is for Bitcoin-Core 0.12.0 and builds on CentOS\n7 with either the CentOS provided OpenSSL library or with LibreSSL as packaged\nat [LibreLAMP.com](https://librelamp.com/). It should hopefully not be too\ndifficult to port the RPM spec file to most RPM based Linux distributions.\n\nWhen porting the spec file to build for a particular distribution, there are\nsome important notes.\n\n## Sources\n\nIt is considered good form for all sources to reference a URL where the source\ncan be downloaded.\n\nSources 0-9 should be reserved for source code tarballs. `Source0` should\nreference the release tarball available from https://bitcoin.org/bin/ and\n`Source1` should reference the BerkeleyDB source.\n\nSources 10-99 are for source files that are maintained in the\n[Bitcoin git repository](https://github.com/bitcoin/bitcoin) but are not part of\nthe release tarball. Most of these will reside in the `contrib` sub-directory.\n\nSources 10-19 should be reserved for miscellaneous configuration files.\nCurrently only `Source10` is used, for the example `bitcoin.conf` file.\n\nSources 20-29 should be reserved for man pages. Currently only `Source20`\nthrough `Source23` are used.\n\nSources 30-39 should be reserved for SELinux related files. Currently only\n`Source30` through `Source32` are used. Until those files are in a tagged\nrelease, the full URL specified in the RPM spec file will not work. You can get\nthem from the git repository where you retrieved this file.\n\nSources 100+ are for files that are not source tarballs and are not maintained\nin the bitcoin git repository. At present only an SVG version of the Bitcoin\nicon is used.\n\n## Patches\n\nIn general, patches should be avoided. When a packager feels a patch is\nnecessary, the packager should bring the problem to the attention of the bitcoin\ndevelopers so that an official fix to the issue can make it into the next\nrelease.\n\n### Patch0 bitcoin-0.12.0-libressl.patch\n\nThis patch is only needed if building against LibreSSL. LibreSSL is not the\nstandard TLS library on most Linux distributions. The patch will likely not be\nneeded when 0.12.1 is released, a proper fix is already in the Bitcoin git\nmaster branch.\n\n## BuildRequires\n\nThe packages specified in the `BuildRequires` are specified according to the\npackage naming convention currently used in CentOS 7 and EPEL for CentOS 7. You\nmay need to change some of the package names for other distributions. This is\nmost likely to be the case with the Qt packages.\n\n## BerkeleyDB\n\nThe `build-unix.md` file recommends building against BerkeleyDB 4.8.30. Even if\nthat is the version your Linux distribution ships with, it probably is a good\nidea to build Bitcoin Core against a static version of that library compiled\naccording to the instructions in the `build-unix.md` file so that any changes\nthe distribution may make in the future will not result in a problem for users.\n\nThe problem that can exist, clients built against different versions of\nBerkeleyDB may not be able read each other's `wallet.dat` file which can make it\ndifficult for a user to recover from backup in the event of a system failure.\n\n## Graphical User Interface and Qt Version\n\nThe RPM spec file will by default build the GUI client linked against the Qt5\nlibraries. If you wish instead to link against the Qt4 libraries you need to\npass the switch `-D '_use_qt4 1'` at build time to the `rpmbuild` or `mock`\ncommand used to build the packages.\n\nIf you would prefer not to build the GUI at all, you can pass the switch\n`-D '_no_gui 1'` to the `rpmbuild` or `mock` build command.\n\n## Desktop and KDE Files\n\nThe desktop and KDE meta files are created in the spec file itself with the\n`cat` command. This is done to allow easy distribution specific changes without\nneeding to use any patches. A specific timestamp is given to the files so that\nit does not they do not appear to have been updated every time the package is\nbuilt. If you do make changes to them, you probably should update timestamp\nassigned to them in the `touch` command that specifies the timestamp.\n\n## SVG, PNG, and XPM Icons\n\nThe `bitcoin.svg` file is from the source listed as `Source100`. It is used as\nthe source for the PNG and XPM files. The generated PNG and XPM files are given\nthe same timestamp as the source SVG file as a means of indicating they are\nderived from it.\n\n## Systemd\n\nThis spec file assumes the target distribution uses systemd. That really only\nmatters for the `bitcoin-server` package. At this point, most RPM based\ndistributions that still receive vendor updates do in fact use systemd.\n\nThe files to control the service are created in the RPM spec file itself using\nthe `cat` command. This is done to make it easy to modify for other\ndistributions that may implement things differently without needing to patch\nsource. A specific timestamp is given to the files so that they do not appear\nto have been updated every time the package is built. If you do make changes to\nthem, you probably should update the timestamp assigned to them in the `touch`\ncommand that specifies the timestamp.\n\n## SELinux\n\nThe `bitcoin-server` package should have SELinux support. How to properly do\nthat *may* vary by distribution and version of distribution.\n\nThe SELinux stuff in this RPM spec file *should* be correct for CentOS, RHEL,\nand Fedora but it would be a good idea to review it before building the package\non other distributions.\n\n## Tests\n\nThe `%check` section takes a very long time to run. If your build system has a\ntime limit for package build, you may need to make an exception for this\npackage. On CentOS 7 the `%check` section completes successfully with both\nOpenSSL and LibreSSL, a failure really does mean something is wrong.\n\n## LibreSSL Build Notes\n\nTo build against LibreSSL you will need to pass the switch\n`-D '_use_libressl 1'` to the `rpmbuild` or `mock` command or the spec file will\nwant the OpenSSL development files.\n\n### LibreSSL and Boost\n\nLibreSSL (and some newer builds of OpenSSL) do not have support for SSLv3. This\ncan cause issues with the Boost package if the Boost package has not been\npatched accordingly. On those distributions, you will either need to build\nBitcoin-Core against OpenSSL or use a patched version of Boost in the build\nsystem.\n\nAs SSLv3 is no longer safe, distributions that have not patched Boost to work\nwith TLS libraries that do not support SSLv3 should have bug reports filed\nagainst the Boost package. This bug report has already been filed for RHEL 7 but\nit may need to be filed for other distributions.\n\nA patch for Boost: https://github.com/boostorg/asio/pull/23/files\n\n## ZeroMQ\n\nAt this time, this RPM spec file does not support the ZeroMQ build options. A\nsuitable version of ZeroMQ is not available for the platform this spec file was\ndeveloped on (CentOS 7).\n\n## Legacy Credit\n\nThis RPM spec file is largely based upon the work of Michael Hampton at\n[Ringing Liberty](https://www.ringingliberty.com/bitcoin/). He has been\npackaging Bitcoin for Fedora at least since 2012.\n\nMost of the differences between his packaging and this package are stylistic in\nnature. The major differences:\n\n1. He builds from a github tagged release rather than a release tarball. This\nshould not result in different source code.\n\n2. He does not build BerkeleyDB but instead uses the BerkeleyDB provided by the\nLinux distribution. For the distributions he packages for, they currently all\nuse the same version of BerkeleyDB so that difference is *probably* just\nacademic.\n\n3. As of his 10.11.2 package he did not allow for building against LibreSSL,\nspecifying a build without the Qt GUI, or specifying which version of the Qt\nlibraries to use.\n\n4. I renamed the `bitcoin` package that contains the Qt GUI to `bitcoin-core` as\nthat appears to be how the general population refers to it, in contrast to\n`bitcoin-xt` or `bitcoin-classic`. I wanted to make sure the general population\nknows what they are getting when installing the GUI package.\n\nAs far as minor differences, I generally prefer to assign the file permissions\nin the `%files` portion of an RPM spec file rather than specifying the\npermissions of a file during `%install` and other minor things like that\nare largely just cosmetic.\n"
  },
  {
    "path": "contrib/rpm/bitcoin.fc",
    "content": "/usr/bin/bitcoin-cli\t\t--\tgen_context(system_u:object_r:bitcoin_exec_t,s0)\n/usr/sbin/bitcoind\t\t--\tgen_context(system_u:object_r:bitcoin_exec_t,s0)\n/usr/lib(64)?/bitcoin/bitcoind\t\t--\tgen_context(system_u:object_r:bitcoin_exec_t,s0)\n\n/etc/bitcoin(/.*)?\t\tgen_context(system_u:object_r:bitcoin_conf_t,s0)\n/var/lib/bitcoin(/.*)?\t\tgen_context(system_u:object_r:bitcoin_var_lib_t,s0)\n\n(/var)?/run/bitcoind(/.*)?   gen_context(system_u:object_r:bitcoin_var_run_t,s0)\n"
  },
  {
    "path": "contrib/rpm/bitcoin.if",
    "content": "\n## <summary>policy for bitcoin</summary>\n\n\n########################################\n## <summary>\n##\tTransition to bitcoin.\n## </summary>\n## <param name=\"domain\">\n## <summary>\n##\tDomain allowed to transition.\n## </summary>\n## </param>\n#\ninterface(`bitcoin_domtrans',`\n\tgen_require(`\n\t\ttype bitcoin_t, bitcoin_exec_t;\n\t')\n\n\tcorecmd_search_bin($1)\n\tdomtrans_pattern($1, bitcoin_exec_t, bitcoin_t)\n')\n\n\n########################################\n## <summary>\n##\tExecute bitcoin server in the bitcoin domain.\n## </summary>\n## <param name=\"domain\">\n##\t<summary>\n##\tDomain allowed access.\n##\t</summary>\n## </param>\n#\ninterface(`bitcoin_initrc_domtrans',`\n\tgen_require(`\n\t\ttype bitcoin_initrc_exec_t;\n\t')\n\n\tinit_labeled_script_domtrans($1, bitcoin_initrc_exec_t)\n')\n\n\n########################################\n## <summary>\n##\tSearch bitcoin lib directories.\n## </summary>\n## <param name=\"domain\">\n##\t<summary>\n##\tDomain allowed access.\n##\t</summary>\n## </param>\n#\ninterface(`bitcoin_search_lib',`\n\tgen_require(`\n\t\ttype bitcoin_var_lib_t;\n\t')\n\n\tallow $1 bitcoin_var_lib_t:dir search_dir_perms;\n\tfiles_search_var_lib($1)\n')\n\n########################################\n## <summary>\n##\tRead bitcoin lib files.\n## </summary>\n## <param name=\"domain\">\n##\t<summary>\n##\tDomain allowed access.\n##\t</summary>\n## </param>\n#\ninterface(`bitcoin_read_lib_files',`\n\tgen_require(`\n\t\ttype bitcoin_var_lib_t;\n\t')\n\n\tfiles_search_var_lib($1)\n\tread_files_pattern($1, bitcoin_var_lib_t, bitcoin_var_lib_t)\n')\n\n########################################\n## <summary>\n##\tManage bitcoin lib files.\n## </summary>\n## <param name=\"domain\">\n##\t<summary>\n##\tDomain allowed access.\n##\t</summary>\n## </param>\n#\ninterface(`bitcoin_manage_lib_files',`\n\tgen_require(`\n\t\ttype bitcoin_var_lib_t;\n\t')\n\n\tfiles_search_var_lib($1)\n\tmanage_files_pattern($1, bitcoin_var_lib_t, bitcoin_var_lib_t)\n')\n\n########################################\n## <summary>\n##\tManage bitcoin lib directories.\n## </summary>\n## <param name=\"domain\">\n##\t<summary>\n##\tDomain allowed access.\n##\t</summary>\n## </param>\n#\ninterface(`bitcoin_manage_lib_dirs',`\n\tgen_require(`\n\t\ttype bitcoin_var_lib_t;\n\t')\n\n\tfiles_search_var_lib($1)\n\tmanage_dirs_pattern($1, bitcoin_var_lib_t, bitcoin_var_lib_t)\n')\n\n\n########################################\n## <summary>\n##\tAll of the rules required to administrate\n##\ta bitcoin environment\n## </summary>\n## <param name=\"domain\">\n##\t<summary>\n##\tDomain allowed access.\n##\t</summary>\n## </param>\n## <param name=\"role\">\n##\t<summary>\n##\tRole allowed access.\n##\t</summary>\n## </param>\n## <rolecap/>\n#\ninterface(`bitcoin_admin',`\n\tgen_require(`\n\t\ttype bitcoin_t;\n\t\ttype bitcoin_initrc_exec_t;\n\t\ttype bitcoin_var_lib_t;\n\t')\n\n\tallow $1 bitcoin_t:process { ptrace signal_perms };\n\tps_process_pattern($1, bitcoin_t)\n\n\tbitcoin_initrc_domtrans($1)\n\tdomain_system_change_exemption($1)\n\trole_transition $2 bitcoin_initrc_exec_t system_r;\n\tallow $2 system_r;\n\n\tfiles_search_var_lib($1)\n\tadmin_pattern($1, bitcoin_var_lib_t)\n\n')\n\n"
  },
  {
    "path": "contrib/rpm/bitcoin.spec",
    "content": "%define bdbv 4.8.30\n%global selinux_variants mls strict targeted\n\n%if 0%{?_no_gui:1}\n%define _buildqt 0\n%define buildargs --with-gui=no\n%else\n%define _buildqt 1\n%if 0%{?_use_qt4}\n%define buildargs --with-qrencode --with-gui=qt4\n%else\n%define buildargs --with-qrencode --with-gui=qt5\n%endif\n%endif\n\nName:\t\tbitcoin\nVersion:\t0.12.0\nRelease:\t2%{?dist}\nSummary:\tPeer to Peer Cryptographic Currency\n\nGroup:\t\tApplications/System\nLicense:\tMIT\nURL:\t\thttps://bitcoin.org/\nSource0:\thttps://bitcoin.org/bin/bitcoin-core-%{version}/bitcoin-%{version}.tar.gz\nSource1:\thttp://download.oracle.com/berkeley-db/db-%{bdbv}.NC.tar.gz\n\nSource10:\thttps://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/contrib/debian/examples/bitcoin.conf\n\n#man pages\nSource20:\thttps://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/doc/man/bitcoind.1\nSource21:\thttps://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/doc/man/bitcoin-cli.1\nSource22:\thttps://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/doc/man/bitcoin-qt.1\n\n#selinux\nSource30:\thttps://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/contrib/rpm/bitcoin.te\n# Source31 - what about bitcoin-tx and bench_bitcoin ???\nSource31:\thttps://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/contrib/rpm/bitcoin.fc\nSource32:\thttps://raw.githubusercontent.com/bitcoin/bitcoin/v%{version}/contrib/rpm/bitcoin.if\n\nSource100:\thttps://upload.wikimedia.org/wikipedia/commons/4/46/Bitcoin.svg\n\n%if 0%{?_use_libressl:1}\nBuildRequires:\tlibressl-devel\n%else\nBuildRequires:\topenssl-devel\n%endif\nBuildRequires:\tboost-devel\nBuildRequires:\tminiupnpc-devel\nBuildRequires:\tautoconf automake libtool\nBuildRequires:\tlibevent-devel\n\n\nPatch0:\t\tbitcoin-0.12.0-libressl.patch\n\n\n%description\nBitcoin is a digital cryptographic currency that uses peer-to-peer technology to\noperate with no central authority or banks; managing transactions and the\nissuing of bitcoins is carried out collectively by the network.\n\n%if %{_buildqt}\n%package core\nSummary:\tPeer to Peer Cryptographic Currency\nGroup:\t\tApplications/System\nObsoletes:\t%{name} < %{version}-%{release}\nProvides:\t%{name} = %{version}-%{release}\n%if 0%{?_use_qt4}\nBuildRequires:\tqt-devel\n%else\nBuildRequires:\tqt5-qtbase-devel\n# for /usr/bin/lrelease-qt5\nBuildRequires:\tqt5-linguist\n%endif\nBuildRequires:\tprotobuf-devel\nBuildRequires:\tqrencode-devel\nBuildRequires:\t%{_bindir}/desktop-file-validate\n# for icon generation from SVG\nBuildRequires:\t%{_bindir}/inkscape\nBuildRequires:\t%{_bindir}/convert\n\n%description core\nBitcoin is a digital cryptographic currency that uses peer-to-peer technology to\noperate with no central authority or banks; managing transactions and the\nissuing of bitcoins is carried out collectively by the network.\n\nThis package contains the Qt based graphical client and node. If you are looking\nto run a Bitcoin wallet, this is probably the package you want.\n%endif\n\n\n%package libs\nSummary:\tBitcoin shared libraries\nGroup:\t\tSystem Environment/Libraries\n\n%description libs\nThis package provides the bitcoinconsensus shared libraries. These libraries\nmay be used by third party software to provide consensus verification\nfunctionality.\n\nUnless you know need this package, you probably do not.\n\n%package devel\nSummary:\tDevelopment files for bitcoin\nGroup:\t\tDevelopment/Libraries\nRequires:\t%{name}-libs = %{version}-%{release}\n\n%description devel\nThis package contains the header files and static library for the\nbitcoinconsensus shared library. If you are developing or compiling software\nthat wants to link against that library, then you need this package installed.\n\nMost people do not need this package installed.\n\n%package server\nSummary:\tThe bitcoin daemon\nGroup:\t\tSystem Environment/Daemons\nRequires:\tbitcoin-utils = %{version}-%{release}\nRequires:\tselinux-policy policycoreutils-python\nRequires(pre):\tshadow-utils\nRequires(post):\t%{_sbindir}/semodule %{_sbindir}/restorecon %{_sbindir}/fixfiles %{_sbindir}/sestatus\nRequires(postun):\t%{_sbindir}/semodule %{_sbindir}/restorecon %{_sbindir}/fixfiles %{_sbindir}/sestatus\nBuildRequires:\tsystemd\nBuildRequires:\tcheckpolicy\nBuildRequires:\t%{_datadir}/selinux/devel/Makefile\n\n%description server\nThis package provides a stand-alone bitcoin-core daemon. For most users, this\npackage is only needed if they need a full-node without the graphical client.\n\nSome third party wallet software will want this package to provide the actual\nbitcoin-core node they use to connect to the network.\n\nIf you use the graphical bitcoin-core client then you almost certainly do not\nneed this package.\n\n%package utils\nSummary:\tBitcoin utilities\nGroup:\t\tApplications/System\n\n%description utils\nThis package provides several command line utilities for interacting with a\nbitcoin-core daemon.\n\nThe bitcoin-cli utility allows you to communicate and control a bitcoin daemon\nover RPC, the bitcoin-tx utility allows you to create a custom transaction, and\nthe bench_bitcoin utility can be used to perform some benchmarks.\n\nThis package contains utilities needed by the bitcoin-server package.\n\n\n%prep\n%setup -q\n%patch0 -p1 -b .libressl\ncp -p %{SOURCE10} ./bitcoin.conf.example\ntar -zxf %{SOURCE1}\ncp -p db-%{bdbv}.NC/LICENSE ./db-%{bdbv}.NC-LICENSE\nmkdir db4 SELinux\ncp -p %{SOURCE30} %{SOURCE31} %{SOURCE32} SELinux/\n\n\n%build\nCWD=`pwd`\ncd db-%{bdbv}.NC/build_unix/\n../dist/configure --enable-cxx --disable-shared --with-pic --prefix=${CWD}/db4\nmake install\ncd ../..\n\n./autogen.sh\n%configure LDFLAGS=\"-L${CWD}/db4/lib/\" CPPFLAGS=\"-I${CWD}/db4/include/\" --with-miniupnpc --enable-glibc-back-compat %{buildargs}\nmake %{?_smp_mflags}\n\npushd SELinux\nfor selinuxvariant in %{selinux_variants}; do\n\tmake NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile\n\tmv bitcoin.pp bitcoin.pp.${selinuxvariant}\n\tmake NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile clean\ndone\npopd\n\n\n%install\nmake install DESTDIR=%{buildroot}\n\nmkdir -p -m755 %{buildroot}%{_sbindir}\nmv %{buildroot}%{_bindir}/bitcoind %{buildroot}%{_sbindir}/bitcoind\n\n# systemd stuff\nmkdir -p %{buildroot}%{_tmpfilesdir}\ncat <<EOF > %{buildroot}%{_tmpfilesdir}/bitcoin.conf\nd /run/bitcoind 0750 bitcoin bitcoin -\nEOF\ntouch -a -m -t 201504280000 %{buildroot}%{_tmpfilesdir}/bitcoin.conf\n\nmkdir -p %{buildroot}%{_sysconfdir}/sysconfig\ncat <<EOF > %{buildroot}%{_sysconfdir}/sysconfig/bitcoin\n# Provide options to the bitcoin daemon here, for example\n# OPTIONS=\"-testnet -disable-wallet\"\n\nOPTIONS=\"\"\n\n# System service defaults.\n# Don't change these unless you know what you're doing.\nCONFIG_FILE=\"%{_sysconfdir}/bitcoin/bitcoin.conf\"\nDATA_DIR=\"%{_localstatedir}/lib/bitcoin\"\nPID_FILE=\"/run/bitcoind/bitcoind.pid\"\nEOF\ntouch -a -m -t 201504280000 %{buildroot}%{_sysconfdir}/sysconfig/bitcoin\n\nmkdir -p %{buildroot}%{_unitdir}\ncat <<EOF > %{buildroot}%{_unitdir}/bitcoin.service\n[Unit]\nDescription=Bitcoin daemon\nAfter=syslog.target network.target\n\n[Service]\nType=forking\nExecStart=%{_sbindir}/bitcoind -daemon -conf=\\${CONFIG_FILE} -datadir=\\${DATA_DIR} -pid=\\${PID_FILE} \\$OPTIONS\nEnvironmentFile=%{_sysconfdir}/sysconfig/bitcoin\nUser=bitcoin\nGroup=bitcoin\n\nRestart=on-failure\nPrivateTmp=true\nTimeoutStopSec=120\nTimeoutStartSec=60\nStartLimitInterval=240\nStartLimitBurst=5\n\n[Install]\nWantedBy=multi-user.target\nEOF\ntouch -a -m -t 201504280000 %{buildroot}%{_unitdir}/bitcoin.service\n#end systemd stuff\n\nmkdir %{buildroot}%{_sysconfdir}/bitcoin\nmkdir -p %{buildroot}%{_localstatedir}/lib/bitcoin\n\n#SELinux\nfor selinuxvariant in %{selinux_variants}; do\n\tinstall -d %{buildroot}%{_datadir}/selinux/${selinuxvariant}\n\tinstall -p -m 644 SELinux/bitcoin.pp.${selinuxvariant} %{buildroot}%{_datadir}/selinux/${selinuxvariant}/bitcoin.pp\ndone\n\n%if %{_buildqt}\n# qt icons\ninstall -D -p share/pixmaps/bitcoin.ico %{buildroot}%{_datadir}/pixmaps/bitcoin.ico\ninstall -p share/pixmaps/nsis-header.bmp %{buildroot}%{_datadir}/pixmaps/\ninstall -p share/pixmaps/nsis-wizard.bmp %{buildroot}%{_datadir}/pixmaps/\ninstall -p %{SOURCE100} %{buildroot}%{_datadir}/pixmaps/bitcoin.svg\n%{_bindir}/inkscape %{SOURCE100} --export-png=%{buildroot}%{_datadir}/pixmaps/bitcoin16.png -w16 -h16\n%{_bindir}/inkscape %{SOURCE100} --export-png=%{buildroot}%{_datadir}/pixmaps/bitcoin32.png -w32 -h32\n%{_bindir}/inkscape %{SOURCE100} --export-png=%{buildroot}%{_datadir}/pixmaps/bitcoin64.png -w64 -h64\n%{_bindir}/inkscape %{SOURCE100} --export-png=%{buildroot}%{_datadir}/pixmaps/bitcoin128.png -w128 -h128\n%{_bindir}/inkscape %{SOURCE100} --export-png=%{buildroot}%{_datadir}/pixmaps/bitcoin256.png -w256 -h256\n%{_bindir}/convert -resize 16x16 %{buildroot}%{_datadir}/pixmaps/bitcoin256.png %{buildroot}%{_datadir}/pixmaps/bitcoin16.xpm\n%{_bindir}/convert -resize 32x32 %{buildroot}%{_datadir}/pixmaps/bitcoin256.png %{buildroot}%{_datadir}/pixmaps/bitcoin32.xpm\n%{_bindir}/convert -resize 64x64 %{buildroot}%{_datadir}/pixmaps/bitcoin256.png %{buildroot}%{_datadir}/pixmaps/bitcoin64.xpm\n%{_bindir}/convert -resize 128x128 %{buildroot}%{_datadir}/pixmaps/bitcoin256.png %{buildroot}%{_datadir}/pixmaps/bitcoin128.xpm\n%{_bindir}/convert %{buildroot}%{_datadir}/pixmaps/bitcoin256.png %{buildroot}%{_datadir}/pixmaps/bitcoin256.xpm\ntouch %{buildroot}%{_datadir}/pixmaps/*.png -r %{SOURCE100}\ntouch %{buildroot}%{_datadir}/pixmaps/*.xpm -r %{SOURCE100}\n\n# Desktop File - change the touch timestamp if modifying\nmkdir -p %{buildroot}%{_datadir}/applications\ncat <<EOF > %{buildroot}%{_datadir}/applications/bitcoin-core.desktop\n[Desktop Entry]\nEncoding=UTF-8\nName=Bitcoin\nComment=Bitcoin P2P Cryptocurrency\nComment[fr]=Bitcoin, monnaie virtuelle cryptographique pair à pair\nComment[tr]=Bitcoin, eşten eşe kriptografik sanal para birimi\nExec=bitcoin-qt %u\nTerminal=false\nType=Application\nIcon=bitcoin128\nMimeType=x-scheme-handler/bitcoin;\nCategories=Office;Finance;\nEOF\n# change touch date when modifying desktop\ntouch -a -m -t 201511100546 %{buildroot}%{_datadir}/applications/bitcoin-core.desktop\n%{_bindir}/desktop-file-validate %{buildroot}%{_datadir}/applications/bitcoin-core.desktop\n\n# KDE protocol - change the touch timestamp if modifying\nmkdir -p %{buildroot}%{_datadir}/kde4/services\ncat <<EOF > %{buildroot}%{_datadir}/kde4/services/bitcoin-core.protocol\n[Protocol]\nexec=bitcoin-qt '%u'\nprotocol=bitcoin\ninput=none\noutput=none\nhelper=true\nlisting=\nreading=false\nwriting=false\nmakedir=false\ndeleting=false\nEOF\n# change touch date when modifying protocol\ntouch -a -m -t 201511100546 %{buildroot}%{_datadir}/kde4/services/bitcoin-core.protocol\n%endif\n\n# man pages\ninstall -D -p %{SOURCE20} %{buildroot}%{_mandir}/man1/bitcoind.1\ninstall -p %{SOURCE21} %{buildroot}%{_mandir}/man1/bitcoin-cli.1\n%if %{_buildqt}\ninstall -p %{SOURCE22} %{buildroot}%{_mandir}/man1/bitcoin-qt.1\n%endif\n\n# nuke these, we do extensive testing of binaries in %%check before packaging\nrm -f %{buildroot}%{_bindir}/test_*\n\n%check\nmake check\nsrcdir=src test/bitcoin-util-test.py\ntest/functional/test_runner.py --extended\n\n%post libs -p /sbin/ldconfig\n\n%postun libs -p /sbin/ldconfig\n\n%pre server\ngetent group bitcoin >/dev/null || groupadd -r bitcoin\ngetent passwd bitcoin >/dev/null ||\n\tuseradd -r -g bitcoin -d /var/lib/bitcoin -s /sbin/nologin \\\n\t-c \"Bitcoin wallet server\" bitcoin\nexit 0\n\n%post server\n%systemd_post bitcoin.service\n# SELinux\nif [ `%{_sbindir}/sestatus |grep -c \"disabled\"` -eq 0 ]; then\nfor selinuxvariant in %{selinux_variants}; do\n\t%{_sbindir}/semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/bitcoin.pp &> /dev/null || :\ndone\n%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 34229\n%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 34230\n%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 44229\n%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 44230\n%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 45339\n%{_sbindir}/semanage port -a -t bitcoin_port_t -p tcp 45340\n%{_sbindir}/fixfiles -R bitcoin-server restore &> /dev/null || :\n%{_sbindir}/restorecon -R %{_localstatedir}/lib/bitcoin || :\nfi\n\n%posttrans server\n%{_bindir}/systemd-tmpfiles --create\n\n%preun server\n%systemd_preun bitcoin.service\n\n%postun server\n%systemd_postun bitcoin.service\n# SELinux\nif [ $1 -eq 0 ]; then\n\tif [ `%{_sbindir}/sestatus |grep -c \"disabled\"` -eq 0 ]; then\n\t%{_sbindir}/semanage port -d -p tcp 34229\n\t%{_sbindir}/semanage port -d -p tcp 34230\n\t%{_sbindir}/semanage port -d -p tcp 44229\n\t%{_sbindir}/semanage port -d -p tcp 44230\n\t%{_sbindir}/semanage port -d -p tcp 45339\n\t%{_sbindir}/semanage port -d -p tcp 45340\n\tfor selinuxvariant in %{selinux_variants}; do\n\t\t%{_sbindir}/semodule -s ${selinuxvariant} -r bitcoin &> /dev/null || :\n\tdone\n\t%{_sbindir}/fixfiles -R bitcoin-server restore &> /dev/null || :\n\t[ -d %{_localstatedir}/lib/bitcoin ] && \\\n\t\t%{_sbindir}/restorecon -R %{_localstatedir}/lib/bitcoin &> /dev/null || :\n\tfi\nfi\n\n%clean\nrm -rf %{buildroot}\n\n%if %{_buildqt}\n%files core\n%defattr(-,root,root,-)\n%license COPYING db-%{bdbv}.NC-LICENSE\n%doc COPYING bitcoin.conf.example doc/README.md doc/bips.md doc/files.md doc/multiwallet-qt.md doc/reduce-traffic.md doc/release-notes.md doc/tor.md\n%attr(0755,root,root) %{_bindir}/bitcoin-qt\n%attr(0644,root,root) %{_datadir}/applications/bitcoin-core.desktop\n%attr(0644,root,root) %{_datadir}/kde4/services/bitcoin-core.protocol\n%attr(0644,root,root) %{_datadir}/pixmaps/*.ico\n%attr(0644,root,root) %{_datadir}/pixmaps/*.bmp\n%attr(0644,root,root) %{_datadir}/pixmaps/*.svg\n%attr(0644,root,root) %{_datadir}/pixmaps/*.png\n%attr(0644,root,root) %{_datadir}/pixmaps/*.xpm\n%attr(0644,root,root) %{_mandir}/man1/bitcoin-qt.1*\n%endif\n\n%files libs\n%defattr(-,root,root,-)\n%license COPYING\n%doc COPYING doc/README.md doc/shared-libraries.md\n%{_libdir}/lib*.so.*\n\n%files devel\n%defattr(-,root,root,-)\n%license COPYING\n%doc COPYING doc/README.md doc/developer-notes.md doc/shared-libraries.md\n%attr(0644,root,root) %{_includedir}/*.h\n%{_libdir}/*.so\n%{_libdir}/*.a\n%{_libdir}/*.la\n%attr(0644,root,root) %{_libdir}/pkgconfig/*.pc\n\n%files server\n%defattr(-,root,root,-)\n%license COPYING db-%{bdbv}.NC-LICENSE\n%doc COPYING bitcoin.conf.example doc/README.md doc/REST-interface.md doc/bips.md doc/dnsseed-policy.md doc/files.md doc/reduce-traffic.md doc/release-notes.md doc/tor.md\n%attr(0755,root,root) %{_sbindir}/bitcoind\n%attr(0644,root,root) %{_tmpfilesdir}/bitcoin.conf\n%attr(0644,root,root) %{_unitdir}/bitcoin.service\n%dir %attr(0750,bitcoin,bitcoin) %{_sysconfdir}/bitcoin\n%dir %attr(0750,bitcoin,bitcoin) %{_localstatedir}/lib/bitcoin\n%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/sysconfig/bitcoin\n%attr(0644,root,root) %{_datadir}/selinux/*/*.pp\n%attr(0644,root,root) %{_mandir}/man1/bitcoind.1*\n\n%files utils\n%defattr(-,root,root,-)\n%license COPYING\n%doc COPYING bitcoin.conf.example doc/README.md\n%attr(0755,root,root) %{_bindir}/bitcoin-cli\n%attr(0755,root,root) %{_bindir}/bitcoin-tx\n%attr(0755,root,root) %{_bindir}/bench_bitcoin\n%attr(0644,root,root) %{_mandir}/man1/bitcoin-cli.1*\n\n\n\n%changelog\n* Fri Feb 26 2016 Alice Wonder <buildmaster@librelamp.com> - 0.12.0-2\n- Rename Qt package from bitcoin to bitcoin-core\n- Make building of the Qt package optional\n- When building the Qt package, default to Qt5 but allow building\n-  against Qt4\n- Only run SELinux stuff in post scripts if it is not set to disabled\n\n* Wed Feb 24 2016 Alice Wonder <buildmaster@librelamp.com> - 0.12.0-1\n- Initial spec file for 0.12.0 release\n\n# This spec file is written from scratch but a lot of the packaging decisions are directly\n# based upon the 0.11.2 package spec file from https://www.ringingliberty.com/bitcoin/\n"
  },
  {
    "path": "contrib/rpm/bitcoin.te",
    "content": "policy_module(bitcoin, 1.100.1)\n\n########################################\n#\n# Declarations\n#\n\ntype bitcoin_t;\ntype bitcoin_exec_t;\ninit_daemon_domain(bitcoin_t, bitcoin_exec_t)\n\npermissive bitcoin_t;\n\ntype bitcoin_initrc_exec_t;\ninit_script_file(bitcoin_initrc_exec_t)\n\ntype bitcoin_conf_t;\nfiles_type(bitcoin_conf_t)\n\ntype bitcoin_var_lib_t;\nfiles_type(bitcoin_var_lib_t)\n\ntype bitcoin_var_run_t;\nfiles_type(bitcoin_var_run_t)\n\ntype bitcoin_port_t;\ncorenet_port(bitcoin_port_t)\n\n########################################\n#\n# bitcoin local policy\n#\nallow bitcoin_t self:process { fork };\n\nallow bitcoin_t self:fifo_file rw_fifo_file_perms;\nallow bitcoin_t self:unix_stream_socket create_stream_socket_perms;\n\nmanage_dirs_pattern(bitcoin_t, bitcoin_conf_t, bitcoin_conf_t)\nmanage_files_pattern(bitcoin_t, bitcoin_conf_t, bitcoin_conf_t)\n\nmanage_dirs_pattern(bitcoin_t, bitcoin_var_lib_t, bitcoin_var_lib_t)\nmanage_files_pattern(bitcoin_t, bitcoin_var_lib_t, bitcoin_var_lib_t)\nfiles_var_lib_filetrans(bitcoin_t, bitcoin_var_lib_t, { dir file })\n\nmanage_dirs_pattern(bitcoin_t, bitcoin_var_run_t, bitcoin_var_run_t)\nmanage_files_pattern(bitcoin_t, bitcoin_var_run_t, bitcoin_var_run_t)\n\nsysnet_dns_name_resolve(bitcoin_t)\ncorenet_all_recvfrom_unlabeled(bitcoin_t)\n\nallow bitcoin_t self:tcp_socket create_stream_socket_perms;\ncorenet_tcp_sendrecv_generic_if(bitcoin_t)\ncorenet_tcp_sendrecv_generic_node(bitcoin_t)\ncorenet_tcp_sendrecv_all_ports(bitcoin_t)\ncorenet_tcp_bind_generic_node(bitcoin_t)\n\ngen_require(`\n    type bitcoin_port_t;\n')\nallow bitcoin_t bitcoin_port_t:tcp_socket name_bind;\n\ngen_require(`\n    type bitcoin_port_t;\n')\nallow bitcoin_t bitcoin_port_t:tcp_socket name_connect;\n\ndomain_use_interactive_fds(bitcoin_t)\n\nfiles_read_etc_files(bitcoin_t)\n\nmiscfiles_read_localization(bitcoin_t)\n\nsysnet_dns_name_resolve(bitcoin_t)\n\nallow bitcoin_t bitcoin_exec_t:file execute_no_trans;\nallow bitcoin_t self:process setsched;\ncorecmd_exec_ls(bitcoin_t)\ncorenet_tcp_connect_http_port(bitcoin_t)\ndev_read_urand(bitcoin_t)\nfs_getattr_xattr_fs(bitcoin_t)\nkernel_read_system_state(bitcoin_t)\n"
  },
  {
    "path": "contrib/seeds/README.md",
    "content": "# Seeds\n\nUtility to generate the seeds.txt list that is compiled into the client\n(see [src/chainparamsseeds.h](/src/chainparamsseeds.h) and other utilities in [contrib/seeds](/contrib/seeds)).\n\nBe sure to update `PATTERN_AGENT` in `makeseeds.py` to include the current version,\nand remove old versions as necessary (at a minimum when GetDesireableServiceFlags\nchanges its default return value, as those are the services which seeds are added\nto addrman with).\n\nThe seeds compiled into the release are created from sipa's DNS seed data, like this:\n\n    curl -s http://bitcoin.sipa.be/seeds.txt.gz | gzip -dc > seeds_main.txt\n    python3 makeseeds.py < seeds_main.txt > nodes_main.txt\n    python3 generate-seeds.py . > ../../src/chainparamsseeds.h\n\n## Dependencies\n\nUbuntu:\n\n    sudo apt-get install python3-dnspython\n"
  },
  {
    "path": "contrib/seeds/generate-seeds.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 Wladimir J. van der Laan\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\nScript to generate list of seed nodes for chainparams.cpp.\n\nThis script expects two text files in the directory that is passed as an\nargument:\n\n    nodes_main.txt\n    nodes_test.txt\n\nThese files must consist of lines in the format \n\n    <ip>\n    <ip>:<port>\n    [<ipv6>]\n    [<ipv6>]:<port>\n    <onion>.onion\n    0xDDBBCCAA (IPv4 little-endian old pnSeeds format)\n\nThe output will be two data structures with the peers in binary format:\n\n   static SeedSpec6 pnSeed6_main[]={\n   ...\n   }\n   static SeedSpec6 pnSeed6_test[]={\n   ...\n   }\n\nThese should be pasted into `src/chainparamsseeds.h`.\n'''\n\nfrom base64 import b32decode\nfrom binascii import a2b_hex\nimport sys, os\nimport re\n\n# ipv4 in ipv6 prefix\npchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])\n# tor-specific ipv6 prefix\npchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])\n\ndef name_to_ipv6(addr):\n    if len(addr)>6 and addr.endswith('.onion'):\n        vchAddr = b32decode(addr[0:-6], True)\n        if len(vchAddr) != 16-len(pchOnionCat):\n            raise ValueError('Invalid onion %s' % s)\n        return pchOnionCat + vchAddr\n    elif '.' in addr: # IPv4\n        return pchIPv4 + bytearray((int(x) for x in addr.split('.')))\n    elif ':' in addr: # IPv6\n        sub = [[], []] # prefix, suffix\n        x = 0\n        addr = addr.split(':')\n        for i,comp in enumerate(addr):\n            if comp == '':\n                if i == 0 or i == (len(addr)-1): # skip empty component at beginning or end\n                    continue\n                x += 1 # :: skips to suffix\n                assert(x < 2)\n            else: # two bytes per component\n                val = int(comp, 16)\n                sub[x].append(val >> 8)\n                sub[x].append(val & 0xff)\n        nullbytes = 16 - len(sub[0]) - len(sub[1])\n        assert((x == 0 and nullbytes == 0) or (x == 1 and nullbytes > 0))\n        return bytearray(sub[0] + ([0] * nullbytes) + sub[1])\n    elif addr.startswith('0x'): # IPv4-in-little-endian\n        return pchIPv4 + bytearray(reversed(a2b_hex(addr[2:])))\n    else:\n        raise ValueError('Could not parse address %s' % addr)\n\ndef parse_spec(s, defaultport):\n    match = re.match('\\[([0-9a-fA-F:]+)\\](?::([0-9]+))?$', s)\n    if match: # ipv6\n        host = match.group(1)\n        port = match.group(2)\n    elif s.count(':') > 1: # ipv6, no port\n        host = s\n        port = ''\n    else:\n        (host,_,port) = s.partition(':')\n\n    if not port:\n        port = defaultport\n    else:\n        port = int(port)\n\n    host = name_to_ipv6(host)\n\n    return (host,port)\n\ndef process_nodes(g, f, structname, defaultport):\n    g.write('static SeedSpec6 %s[] = {\\n' % structname)\n    first = True\n    for line in f:\n        comment = line.find('#')\n        if comment != -1:\n            line = line[0:comment]\n        line = line.strip()\n        if not line:\n            continue\n        if not first:\n            g.write(',\\n')\n        first = False\n\n        (host,port) = parse_spec(line, defaultport)\n        hoststr = ','.join(('0x%02x' % b) for b in host)\n        g.write('    {{%s}, %i}' % (hoststr, port))\n    g.write('\\n};\\n')\n\ndef main():\n    if len(sys.argv)<2:\n        print(('Usage: %s <path_to_nodes_txt>' % sys.argv[0]), file=sys.stderr)\n        sys.exit(1)\n    g = sys.stdout\n    indir = sys.argv[1]\n    g.write('#ifndef BITCOIN_CHAINPARAMSSEEDS_H\\n')\n    g.write('#define BITCOIN_CHAINPARAMSSEEDS_H\\n')\n    g.write('/**\\n')\n    g.write(' * List of fixed seed nodes for the bitcoin network\\n')\n    g.write(' * AUTOGENERATED by contrib/seeds/generate-seeds.py\\n')\n    g.write(' *\\n')\n    g.write(' * Each line contains a 16-byte IPv6 address and a port.\\n')\n    g.write(' * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.\\n')\n    g.write(' */\\n')\n    with open(os.path.join(indir,'nodes_main.txt'),'r') as f:\n        process_nodes(g, f, 'pnSeed6_main', 34230)\n    g.write('\\n')\n    with open(os.path.join(indir,'nodes_test.txt'),'r') as f:\n        process_nodes(g, f, 'pnSeed6_test', 44230)\n    g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\\n')\n            \nif __name__ == '__main__':\n    main()\n\n"
  },
  {
    "path": "contrib/seeds/makeseeds.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2013-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#\n# Generate seeds.txt from Pieter's DNS seeder\n#\n\nNSEEDS=512\n\nMAX_SEEDS_PER_ASN=2\n\nMIN_BLOCKS = 337600\n\n# These are hosts that have been observed to be behaving strangely (e.g.\n# aggressively connecting to every node).\nSUSPICIOUS_HOSTS = {\n}\n\nimport re\nimport sys\nimport dns.resolver\nimport collections\n\nPATTERN_IPV4 = re.compile(r\"^((\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})):(\\d+)$\")\nPATTERN_IPV6 = re.compile(r\"^\\[([0-9a-z:]+)\\]:(\\d+)$\")\nPATTERN_ONION = re.compile(r\"^([abcdefghijklmnopqrstuvwxyz234567]{16}\\.onion):(\\d+)$\")\nPATTERN_AGENT = re.compile(\n    r\"^/Yumekawa:(\"\n    r\"0.16.(3).(21|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37)|\"\n    r\"0.19.99\"\n    r\")\")\n\ndef parseline(line):\n    sline = line.split()\n    if len(sline) < 11:\n       return None\n    m = PATTERN_IPV4.match(sline[0])\n    sortkey = None\n    ip = None\n    if m is None:\n        m = PATTERN_IPV6.match(sline[0])\n        if m is None:\n            m = PATTERN_ONION.match(sline[0])\n            if m is None:\n                return None\n            else:\n                net = 'onion'\n                ipstr = sortkey = m.group(1)\n                port = int(m.group(2))\n        else:\n            net = 'ipv6'\n            if m.group(1) in ['::']: # Not interested in localhost\n                return None\n            ipstr = m.group(1)\n            sortkey = ipstr # XXX parse IPv6 into number, could use name_to_ipv6 from generate-seeds\n            port = int(m.group(2))\n    else:\n        # Do IPv4 sanity check\n        ip = 0\n        for i in range(0,4):\n            if int(m.group(i+2)) < 0 or int(m.group(i+2)) > 255:\n                return None\n            ip = ip + (int(m.group(i+2)) << (8*(3-i)))\n        if ip == 0:\n            return None\n        net = 'ipv4'\n        sortkey = ip\n        ipstr = m.group(1)\n        port = int(m.group(6))\n    # Skip bad results.\n    if sline[1] == 0:\n        return None\n    # Extract uptime %.\n    uptime30 = float(sline[7][:-1])\n    # Extract Unix timestamp of last success.\n    lastsuccess = int(sline[2])\n    # Extract protocol version.\n    version = int(sline[10])\n    # Extract user agent.\n    agent = sline[11][1:-1]\n    # Extract service flags.\n    service = int(sline[9], 16)\n    # Extract blocks.\n    blocks = int(sline[8])\n    # Construct result.\n    return {\n        'net': net,\n        'ip': ipstr,\n        'port': port,\n        'ipnum': ip,\n        'uptime': uptime30,\n        'lastsuccess': lastsuccess,\n        'version': version,\n        'agent': agent,\n        'service': service,\n        'blocks': blocks,\n        'sortkey': sortkey,\n    }\n\ndef filtermultiport(ips):\n    '''Filter out hosts with more nodes per IP'''\n    hist = collections.defaultdict(list)\n    for ip in ips:\n        hist[ip['sortkey']].append(ip)\n    return [value[0] for (key,value) in list(hist.items()) if len(value)==1]\n\n# Based on Greg Maxwell's seed_filter.py\ndef filterbyasn(ips, max_per_asn, max_total):\n    # Sift out ips by type\n    ips_ipv4 = [ip for ip in ips if ip['net'] == 'ipv4']\n    ips_ipv6 = [ip for ip in ips if ip['net'] == 'ipv6']\n    ips_onion = [ip for ip in ips if ip['net'] == 'onion']\n\n    # Filter IPv4 by ASN\n    result = []\n    asn_count = {}\n    for ip in ips_ipv4:\n        if len(result) == max_total:\n            break\n        try:\n            asn = int([x.to_text() for x in dns.resolver.query('.'.join(reversed(ip['ip'].split('.'))) + '.origin.asn.cymru.com', 'TXT').response.answer][0].split('\\\"')[1].split(' ')[0])\n            if asn not in asn_count:\n                asn_count[asn] = 0\n            if asn_count[asn] == max_per_asn:\n                continue\n            asn_count[asn] += 1\n            result.append(ip)\n        except:\n            sys.stderr.write('ERR: Could not resolve ASN for \"' + ip['ip'] + '\"\\n')\n\n    # TODO: filter IPv6 by ASN\n\n    # Add back non-IPv4\n    result.extend(ips_ipv6)\n    result.extend(ips_onion)\n    return result\n\ndef main():\n    lines = sys.stdin.readlines()\n    ips = [parseline(line) for line in lines]\n\n    # Skip entries with valid address.\n    ips = [ip for ip in ips if ip is not None]\n    # Skip entries from suspicious hosts.\n    ips = [ip for ip in ips if ip['ip'] not in SUSPICIOUS_HOSTS]\n    # Enforce minimal number of blocks.\n    ips = [ip for ip in ips if ip['blocks'] >= MIN_BLOCKS]\n    # Require service bit 1.\n    ips = [ip for ip in ips if (ip['service'] & 1) == 1]\n    # Require at least 50% 30-day uptime.\n    ips = [ip for ip in ips if ip['uptime'] > 50]\n    # Require a known and recent user agent.\n    ips = [ip for ip in ips if PATTERN_AGENT.match(ip['agent'])]\n    # Sort by availability (and use last success as tie breaker)\n    ips.sort(key=lambda x: (x['uptime'], x['lastsuccess'], x['ip']), reverse=True)\n    # Filter out hosts with multiple bitcoin ports, these are likely abusive\n    ips = filtermultiport(ips)\n    # Look up ASNs and limit results, both per ASN and globally.\n    ips = filterbyasn(ips, MAX_SEEDS_PER_ASN, NSEEDS)\n    # Sort the results by IP address (for deterministic output).\n    ips.sort(key=lambda x: (x['net'], x['sortkey']))\n\n    for ip in ips:\n        if ip['net'] == 'ipv6':\n            print('[%s]:%i' % (ip['ip'], ip['port']))\n        else:\n            print('%s:%i' % (ip['ip'], ip['port']))\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "contrib/seeds/nodes_main.txt",
    "content": "51.89.173.178:34230\n62.141.69.219:34230\n89.175.21.60:34230\n139.99.68.221:34230\n150.95.139.225:34230\n155.138.139.97:34230\n157.245.69.15:34230\n160.119.101.219:34230\n163.44.174.184:34230\n207.148.84.128:34230\n211.144.120.164:34230\n"
  },
  {
    "path": "contrib/seeds/nodes_test.txt",
    "content": "45.76.194.172:44230\n150.95.146.185:44230\n150.95.154.24:44230\n"
  },
  {
    "path": "contrib/seeds/seeds_main.txt",
    "content": "# 1seed.sugarchain.info\n# address                                        good  lastSuccess    %(2h)   %(8h)   %(1d)   %(7d)  %(30d)  blocks      svcs  version\n163.44.174.184:34230                                1   1589817423  100.00% 100.00% 100.00% 100.00%  96.81%  4640337  0000040d  70015 \"/Yumekawa:0.16.3.24/\"\n150.95.139.225:34230                                1   1589817423  100.00% 100.00% 100.00%  99.94%  96.77%  4640336  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n157.245.69.15:34230                                 1   1589817423  100.00% 100.00% 100.00%  99.81%  96.30%  4640342  0000040d  70015 \"/Yumekawa:0.16.3.21/\"\n211.144.120.164:34230                               1   1589817423   99.86%  98.06%  98.17%  98.49%  93.98%  4640339  0000040d  70015 \"/Yumekawa:0.16.3.28/\"\n51.89.173.178:34230                                 1   1589816688  100.00% 100.00%  99.99%  99.76%  91.21%  4640186  0000040d  70015 \"/Yumekawa:0.16.3.24/\"\n155.138.139.97:34230                                1   1589817423  100.00% 100.00%  99.96%  98.55%  89.12%  4640335  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n207.148.84.128:34230                                1   1589817423  100.00% 100.00%  99.98%  98.64%  88.91%  4640335  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n104.207.149.177:34230                               1   1589817423  100.00%  97.30%  94.25%  97.27%  88.86%  4640343  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n95.179.246.196:34230                                1   1589816688  100.00% 100.00%  99.90%  98.64%  88.76%  4640186  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n45.77.192.211:34230                                 1   1589817423  100.00% 100.00%  99.60%  97.82%  88.66%  4640335  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n45.76.194.172:34230                                 1   1589817423   99.67%  90.13%  90.25%  96.67%  88.61%  4640336  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n139.99.68.221:34230                                 1   1589817423  100.00% 100.00% 100.00%  99.96%  83.97%  4640335  0000040d  70015 \"/Yumekawa:0.16.3.24/\"\n216.155.157.233:34230                               1   1589817423  100.00% 100.00%  99.99%  99.87%  83.92%  4640337  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n89.175.21.60:34230                                  1   1589817423  100.00% 100.00%  99.98%  99.85%  83.86%  4640339  0000040d  70015 \"/Yumekawa:0.16.3.24/\"\n62.141.69.219:34230                                 1   1589817423  100.00% 100.00% 100.00%  99.83%  83.75%  4640337  0000040d  70015 \"/Yumekawa:0.16.3.24/\"\n160.119.101.219:34230                               1   1589131603    0.00%   0.00%   0.03%  31.71%  71.22%  4503284  0000040d  70015 \"/Yumekawa:0.16.3.25/\"\n108.160.134.47:34230                                1   1588805064    0.00%   0.00%   0.00%  18.73%  64.34%  4438196  0000040d  70015 \"/Yumekawa:0.16.3.24/\"\n79.225.228.87:34230                                 0   1585332161   52.07%  21.24%  27.87%  17.57%   5.11%  3742953  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n103.45.116.22:34230                                 0   1581139974    5.16%  18.45%  11.34%   2.11%   0.51%  2905112  0000040d  70015 \"/Yumekawa:0.16.3.24/\"\n80.211.201.59:34230                                 0   1583912050   68.78%  25.31%   9.55%   1.52%   0.36%  3458987  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n92.255.165.216:34230                                0   1585246252   17.14%   8.69%   3.40%   0.52%   0.12%  3642214  0000040d  70015 \"/Yumekawa:0.16.3.24/\"\n46.85.135.82:34230                                  0   1583829855    6.55%   3.47%   1.76%   0.33%   0.08%  3442601  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n"
  },
  {
    "path": "contrib/seeds/seeds_test.txt",
    "content": "# 1seed-testnet.cryptozeny.com\n# address                                        good  lastSuccess    %(2h)   %(8h)   %(1d)   %(7d)  %(30d)  blocks      svcs  version\n133.130.127.189:44230                               1   1589817582  100.00% 100.00% 100.00%  99.99%  96.81%  2452765  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n150.95.154.24:44230                                 1   1589817582  100.00% 100.00% 100.00%  99.92%  96.13%  2452765  0000040d  70015 \"/Yumekawa:0.16.3.29/\"\n150.95.146.185:44230                                1   1589817582  100.00% 100.00% 100.00%  99.11%  66.76%  2452765  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n45.76.194.172:44230                                 1   1589817582   99.95%  97.04%  96.73%  98.09%  66.40%  2452764  0000040d  70015 \"/Yumekawa:0.16.3.30/\"\n"
  },
  {
    "path": "contrib/testgen/README.md",
    "content": "### TestGen ###\n\nUtilities to generate test vectors for the data-driven Bitcoin tests.\n\nUsage: \n\n    gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json\n    gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json"
  },
  {
    "path": "contrib/testgen/base58.py",
    "content": "# Copyright (c) 2012-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\nBitcoin base58 encoding and decoding.\n\nBased on https://bitcointalk.org/index.php?topic=1026.0 (public domain)\n'''\nimport hashlib\n\n# for compatibility with following code...\nclass SHA256:\n    new = hashlib.sha256\n\nif str != bytes:\n    # Python 3.x\n    def ord(c):\n        return c\n    def chr(n):\n        return bytes( (n,) )\n\n__b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n__b58base = len(__b58chars)\nb58chars = __b58chars\n\ndef b58encode(v):\n    \"\"\" encode v, which is a string of bytes, to base58.\n    \"\"\"\n    long_value = 0\n    for (i, c) in enumerate(v[::-1]):\n        long_value += (256**i) * ord(c)\n\n    result = ''\n    while long_value >= __b58base:\n        div, mod = divmod(long_value, __b58base)\n        result = __b58chars[mod] + result\n        long_value = div\n    result = __b58chars[long_value] + result\n\n    # Bitcoin does a little leading-zero-compression:\n    # leading 0-bytes in the input become leading-1s\n    nPad = 0\n    for c in v:\n        if c == '\\0': nPad += 1\n        else: break\n\n    return (__b58chars[0]*nPad) + result\n\ndef b58decode(v, length = None):\n    \"\"\" decode v into a string of len bytes\n    \"\"\"\n    long_value = 0\n    for (i, c) in enumerate(v[::-1]):\n        long_value += __b58chars.find(c) * (__b58base**i)\n\n    result = bytes()\n    while long_value >= 256:\n        div, mod = divmod(long_value, 256)\n        result = chr(mod) + result\n        long_value = div\n    result = chr(long_value) + result\n\n    nPad = 0\n    for c in v:\n        if c == __b58chars[0]: nPad += 1\n        else: break\n\n    result = chr(0)*nPad + result\n    if length is not None and len(result) != length:\n        return None\n\n    return result\n\ndef checksum(v):\n    \"\"\"Return 32-bit checksum based on SHA256\"\"\"\n    return SHA256.new(SHA256.new(v).digest()).digest()[0:4]\n\ndef b58encode_chk(v):\n    \"\"\"b58encode a string, with 32-bit checksum\"\"\"\n    return b58encode(v + checksum(v))\n\ndef b58decode_chk(v):\n    \"\"\"decode a base58 string, check and remove checksum\"\"\"\n    result = b58decode(v)\n    if result is None:\n        return None\n    if result[-4:] == checksum(result[:-4]):\n        return result[:-4]\n    else:\n        return None\n\ndef get_bcaddress_version(strAddress):\n    \"\"\" Returns None if strAddress is invalid.  Otherwise returns integer version of address. \"\"\"\n    addr = b58decode_chk(strAddress)\n    if addr is None or len(addr)!=21: return None\n    version = addr[0]\n    return ord(version)\n\nif __name__ == '__main__':\n    # Test case (from http://gitorious.org/bitcoin/python-base58.git)\n    assert get_bcaddress_version('15VjRaDX9zpbA8LVnbrCAFzrVzN7ixHNsC') is 0\n    _ohai = 'o hai'.encode('ascii')\n    _tmp = b58encode(_ohai)\n    assert _tmp == 'DYB3oMS'\n    assert b58decode(_tmp, 5) == _ohai\n    print(\"Tests passed\")\n"
  },
  {
    "path": "contrib/testgen/gen_base58_test_vectors.py",
    "content": "#!/usr/bin/env python\n# Copyright (c) 2012-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\nGenerate valid and invalid base58 address and private key test vectors.\n\nUsage: \n    gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json\n    gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json\n'''\n# 2012 Wladimir J. van der Laan\n# Released under MIT License\nimport os\nfrom itertools import islice\nfrom base58 import b58encode_chk, b58decode_chk, b58chars\nimport random\nfrom binascii import b2a_hex\n\n# key types\nPUBKEY_ADDRESS = 63\nSCRIPT_ADDRESS = 125\nPUBKEY_ADDRESS_TEST = 66\nSCRIPT_ADDRESS_TEST = 128\nPRIVKEY = 128\nPRIVKEY_TEST = 239\n\nmetadata_keys = ['isPrivkey', 'isTestnet', 'addrType', 'isCompressed']\n# templates for valid sequences\ntemplates = [\n  # prefix, payload_size, suffix, metadata\n  #                                  None = N/A\n  ((PUBKEY_ADDRESS,),      20, (),   (False, False, 'pubkey', None)),\n  ((SCRIPT_ADDRESS,),      20, (),   (False, False, 'script',  None)),\n  ((PUBKEY_ADDRESS_TEST,), 20, (),   (False, True,  'pubkey', None)),\n  ((SCRIPT_ADDRESS_TEST,), 20, (),   (False, True,  'script',  None)),\n  ((PRIVKEY,),             32, (),   (True,  False, None,  False)),\n  ((PRIVKEY,),             32, (1,), (True,  False, None,  True)),\n  ((PRIVKEY_TEST,),        32, (),   (True,  True,  None,  False)),\n  ((PRIVKEY_TEST,),        32, (1,), (True,  True,  None,  True))\n]\n\ndef is_valid(v):\n    '''Check vector v for validity'''\n    result = b58decode_chk(v)\n    if result is None:\n        return False\n    for template in templates:\n        prefix = str(bytearray(template[0]))\n        suffix = str(bytearray(template[2]))\n        if result.startswith(prefix) and result.endswith(suffix):\n            if (len(result) - len(prefix) - len(suffix)) == template[1]:\n                return True\n    return False\n\ndef gen_valid_vectors():\n    '''Generate valid test vectors'''\n    while True:\n        for template in templates:\n            prefix = str(bytearray(template[0]))\n            payload = os.urandom(template[1]) \n            suffix = str(bytearray(template[2]))\n            rv = b58encode_chk(prefix + payload + suffix)\n            assert is_valid(rv)\n            metadata = dict([(x,y) for (x,y) in zip(metadata_keys,template[3]) if y is not None])\n            yield (rv, b2a_hex(payload), metadata)\n\ndef gen_invalid_vector(template, corrupt_prefix, randomize_payload_size, corrupt_suffix):\n    '''Generate possibly invalid vector'''\n    if corrupt_prefix:\n        prefix = os.urandom(1)\n    else:\n        prefix = str(bytearray(template[0]))\n    \n    if randomize_payload_size:\n        payload = os.urandom(max(int(random.expovariate(0.5)), 50))\n    else:\n        payload = os.urandom(template[1])\n    \n    if corrupt_suffix:\n        suffix = os.urandom(len(template[2]))\n    else:\n        suffix = str(bytearray(template[2]))\n\n    return b58encode_chk(prefix + payload + suffix)\n\ndef randbool(p = 0.5):\n    '''Return True with P(p)'''\n    return random.random() < p\n\ndef gen_invalid_vectors():\n    '''Generate invalid test vectors'''\n    # start with some manual edge-cases\n    yield \"\",\n    yield \"x\",\n    while True:\n        # kinds of invalid vectors:\n        #   invalid prefix\n        #   invalid payload length\n        #   invalid (randomized) suffix (add random data)\n        #   corrupt checksum\n        for template in templates:\n            val = gen_invalid_vector(template, randbool(0.2), randbool(0.2), randbool(0.2))\n            if random.randint(0,10)<1: # line corruption\n                if randbool(): # add random character to end\n                    val += random.choice(b58chars)\n                else: # replace random character in the middle\n                    n = random.randint(0, len(val))\n                    val = val[0:n] + random.choice(b58chars) + val[n+1:]\n            if not is_valid(val):\n                yield val,\n\nif __name__ == '__main__':\n    import sys, json\n    iters = {'valid':gen_valid_vectors, 'invalid':gen_invalid_vectors}\n    try:\n        uiter = iters[sys.argv[1]]\n    except IndexError:\n        uiter = gen_valid_vectors\n    try:\n        count = int(sys.argv[2])\n    except IndexError:\n        count = 0\n   \n    data = list(islice(uiter(), count))\n    json.dump(data, sys.stdout, sort_keys=True, indent=4)\n    sys.stdout.write('\\n')\n\n"
  },
  {
    "path": "contrib/tidy_datadir.sh",
    "content": "#!/bin/bash\n# Copyright (c) 2013 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nif [ -d \"$1\" ]; then\n  cd \"$1\" || exit 1\nelse\n  echo \"Usage: $0 <datadir>\" >&2\n  echo \"Removes obsolete Sugarchain database files\" >&2\n  exit 1\nfi\n\nLEVEL=0\nif [ -f wallet.dat -a -f addr.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=1; fi\nif [ -f wallet.dat -a -f peers.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=2; fi\nif [ -f wallet.dat -a -f peers.dat -a -f coins/CURRENT -a -f blktree/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=3; fi\nif [ -f wallet.dat -a -f peers.dat -a -f chainstate/CURRENT -a -f blocks/index/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=4; fi\n\ncase $LEVEL in\n  0)\n    echo \"Error: no Sugarchain datadir detected.\"\n    exit 1\n    ;;\n  1)\n    echo \"Detected old Sugarchain datadir (before 0.7).\"\n    echo \"Nothing to do.\"\n    exit 0\n    ;;\n  2)\n    echo \"Detected Sugarchain 0.7 datadir.\"\n    ;;\n  3)\n    echo \"Detected Sugarchain pre-0.8 datadir.\"\n    ;;\n  4)\n    echo \"Detected Sugarchain 0.8 datadir.\"\n    ;;\nesac\n\nFILES=\"\"\nDIRS=\"\"\n\nif [ $LEVEL -ge 3 ]; then FILES=$(echo $FILES blk????.dat blkindex.dat); fi\nif [ $LEVEL -ge 2 ]; then FILES=$(echo $FILES addr.dat); fi\nif [ $LEVEL -ge 4 ]; then DIRS=$(echo $DIRS coins blktree); fi\n\nfor FILE in $FILES; do\n  if [ -f $FILE ]; then\n    echo \"Deleting: $FILE\"\n    rm -f $FILE\n  fi\ndone\n\nfor DIR in $DIRS; do\n  if [ -d $DIR ]; then\n    echo \"Deleting: $DIR/\"\n    rm -rf $DIR\n  fi\ndone\n\necho \"Done.\"\n"
  },
  {
    "path": "contrib/valgrind.supp",
    "content": "# Valgrind suppressions file for Bitcoin.\n#\n# Includes known Valgrind warnings in our dependencies that cannot be fixed\n# in-tree.\n#\n# Example use:\n# $ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin\n# $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \\\n#       --show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite\n{\n   Suppress libstdc++ warning - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65434\n   Memcheck:Leak\n   match-leak-kinds: reachable\n   fun:malloc\n   obj:*/libstdc++.*\n   fun:call_init.part.0\n   fun:call_init\n   fun:_dl_init\n   obj:*/ld-*.so\n}\n{\n   Suppress libdb warning - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662917\n   Memcheck:Cond\n   obj:*/libdb_cxx-*.so\n   fun:__log_put\n   obj:*/libdb_cxx-*.so\n   fun:__log_put_record\n}\n{\n   Suppress leveldb warning (leveldb::InitModule()) - https://github.com/google/leveldb/issues/113\n   Memcheck:Leak\n   match-leak-kinds: reachable\n   fun:_Znwm\n   fun:_ZN7leveldbL10InitModuleEv\n}\n{\n   Suppress leveldb warning (leveldb::Env::Default()) - https://github.com/google/leveldb/issues/113\n   Memcheck:Leak\n   match-leak-kinds: reachable\n   fun:_Znwm\n   ...\n   fun:_ZN7leveldbL14InitDefaultEnvEv\n}\n"
  },
  {
    "path": "contrib/verify-commits/README.md",
    "content": "Tooling for verification of PGP signed commits\n----------------------------------------------\n\nThis is an incomplete work in progress, but currently includes a pre-push hook\nscript (`pre-push-hook.sh`) for maintainers to ensure that their own commits\nare PGP signed (nearly always merge commits), as well as a script to verify\ncommits against a trusted keys list.\n\n\nUsing verify-commits.sh safely\n------------------------------\n\nRemember that you can't use an untrusted script to verify itself. This means\nthat checking out code, then running `verify-commits.sh` against `HEAD` is\n_not_ safe, because the version of `verify-commits.sh` that you just ran could\nbe backdoored. Instead, you need to use a trusted version of verify-commits\nprior to checkout to make sure you're checking out only code signed by trusted\nkeys:\n\n    git fetch origin && \\\n      ./contrib/verify-commits/verify-commits.sh origin/master && \\\n      git checkout origin/master\n\nNote that the above isn't a good UI/UX yet, and needs significant improvements\nto make it more convenient and reduce the chance of errors; pull-reqs\nimproving this process would be much appreciated.\n"
  },
  {
    "path": "contrib/verify-commits/allow-revsig-commits",
    "content": ""
  },
  {
    "path": "contrib/verify-commits/gpg.sh",
    "content": "#!/bin/sh\n# Copyright (c) 2014-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nINPUT=$(cat /dev/stdin)\nVALID=false\nREVSIG=false\nIFS='\n'\nif [ \"$BITCOIN_VERIFY_COMMITS_ALLOW_SHA1\" = 1 ]; then\n\tGPG_RES=\"$(printf '%s\\n' \"$INPUT\" | gpg --trust-model always \"$@\" 2>/dev/null)\"\nelse\n\t# Note how we've disabled SHA1 with the --weak-digest option, disabling\n\t# signatures - including selfsigs - that use SHA1. While you might think that\n\t# collision attacks shouldn't be an issue as they'd be an attack on yourself,\n\t# in fact because what's being signed is a commit object that's\n\t# semi-deterministically generated by untrusted input (the pull-req) in theory\n\t# an attacker could construct a pull-req that results in a commit object that\n\t# they've created a collision for. Not the most likely attack, but preventing\n\t# it is pretty easy so we do so as a \"belt-and-suspenders\" measure.\n\tGPG_RES=\"\"\n\tfor LINE in \"$(gpg --version)\"; do\n\t\tcase \"$LINE\" in\n\t\t\t\"gpg (GnuPG) 1.4.1\"*|\"gpg (GnuPG) 2.0.\"*)\n\t\t\t\techo \"Please upgrade to at least gpg 2.1.10 to check for weak signatures\" > /dev/stderr\n\t\t\t\tGPG_RES=\"$(printf '%s\\n' \"$INPUT\" | gpg --trust-model always \"$@\" 2>/dev/null)\"\n\t\t\t\t;;\n\t\t\t# We assume if you're running 2.1+, you're probably running 2.1.10+\n\t\t\t# gpg will fail otherwise\n\t\t\t# We assume if you're running 1.X, it is either 1.4.1X or 1.4.20+\n\t\t\t# gpg will fail otherwise\n\t\tesac\n\tdone\n\t[ \"$GPG_RES\" = \"\" ] && GPG_RES=\"$(printf '%s\\n' \"$INPUT\" | gpg --trust-model always --weak-digest sha1 \"$@\" 2>/dev/null)\"\nfi\nfor LINE in $(echo \"$GPG_RES\"); do\n\tcase \"$LINE\" in\n\t\"[GNUPG:] VALIDSIG \"*)\n\t\twhile read KEY; do\n\t\t\t[ \"${LINE#?GNUPG:? VALIDSIG * * * * * * * * * }\" = \"$KEY\" ] && VALID=true\n\t\tdone < ./contrib/verify-commits/trusted-keys\n\t\t;;\n\t\"[GNUPG:] REVKEYSIG \"*)\n\t\t[ \"$BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG\" != 1 ] && exit 1\n\t\tREVSIG=true\n\t\tGOODREVSIG=\"[GNUPG:] GOODSIG ${LINE#* * *}\"\n\t\t;;\n\t\"[GNUPG:] EXPKEYSIG \"*)\n\t\t[ \"$BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG\" != 1 ] && exit 1\n\t\tREVSIG=true\n\t\tGOODREVSIG=\"[GNUPG:] GOODSIG ${LINE#* * *}\"\n\t\t;;\n\tesac\ndone\nif ! $VALID; then\n\texit 1\nfi\nif $VALID && $REVSIG; then\n\tprintf '%s\\n' \"$INPUT\" | gpg --trust-model always \"$@\" 2>/dev/null | grep \"\\[GNUPG:\\] \\(NEWSIG\\|SIG_ID\\|VALIDSIG\\)\"\n\techo \"$GOODREVSIG\"\nelse\n\tprintf '%s\\n' \"$INPUT\" | gpg --trust-model always \"$@\" 2>/dev/null\nfi\n"
  },
  {
    "path": "contrib/verify-commits/pre-push-hook.sh",
    "content": "#!/bin/bash\n# Copyright (c) 2014-2015 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nif ! [[ \"$2\" =~ ^(git@)?(www.)?github.com(:|/)bitcoin/bitcoin(.git)?$ ]]; then\n    exit 0\nfi\n\nwhile read LINE; do\n    set -- A $LINE\n    if [ \"$4\" != \"refs/heads/master\" ]; then\n        continue\n    fi\n    if ! ./contrib/verify-commits/verify-commits.sh $3 > /dev/null 2>&1; then\n        echo \"ERROR: A commit is not signed, can't push\"\n        ./contrib/verify-commits/verify-commits.sh\n        exit 1\n    fi\ndone < /dev/stdin\n"
  },
  {
    "path": "contrib/verify-commits/trusted-git-root",
    "content": ""
  },
  {
    "path": "contrib/verify-commits/trusted-keys",
    "content": ""
  },
  {
    "path": "contrib/verify-commits/trusted-sha512-root-commit",
    "content": ""
  },
  {
    "path": "contrib/verify-commits/verify-commits.sh",
    "content": "#!/bin/sh\n# Copyright (c) 2014-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nDIR=$(dirname \"$0\")\n[ \"/${DIR#/}\" != \"$DIR\" ] && DIR=$(dirname \"$(pwd)/$0\")\n\necho \"Using verify-commits data from ${DIR}\"\n\nVERIFIED_ROOT=$(cat \"${DIR}/trusted-git-root\")\nVERIFIED_SHA512_ROOT=$(cat \"${DIR}/trusted-sha512-root-commit\")\nREVSIG_ALLOWED=$(cat \"${DIR}/allow-revsig-commits\")\n\nHAVE_GNU_SHA512=1\n[ ! -x \"$(which sha512sum)\" ] && HAVE_GNU_SHA512=0\n\nif [ x\"$1\" = \"x\" ]; then\n\tCURRENT_COMMIT=\"HEAD\"\nelse\n\tCURRENT_COMMIT=\"$1\"\nfi\n\nif [ \"${CURRENT_COMMIT#* }\" != \"$CURRENT_COMMIT\" ]; then\n\techo \"Commit must not contain spaces?\" > /dev/stderr\n\texit 1\nfi\n\nVERIFY_TREE=0\nif [ x\"$2\" = \"x--tree-checks\" ]; then\n\tVERIFY_TREE=1\nfi\n\nNO_SHA1=1\nPREV_COMMIT=\"\"\nINITIAL_COMMIT=\"${CURRENT_COMMIT}\"\n\nwhile true; do\n\tif [ \"$CURRENT_COMMIT\" = $VERIFIED_ROOT ]; then\n\t\techo \"There is a valid path from \\\"$INITIAL_COMMIT\\\" to $VERIFIED_ROOT where all commits are signed!\"\n\t\texit 0\n\tfi\n\n\tif [ \"$CURRENT_COMMIT\" = $VERIFIED_SHA512_ROOT ]; then\n\t\tif [ \"$VERIFY_TREE\" = \"1\" ]; then\n\t\t\techo \"All Tree-SHA512s matched up to $VERIFIED_SHA512_ROOT\" > /dev/stderr\n\t\tfi\n\t\tVERIFY_TREE=0\n\t\tNO_SHA1=0\n\tfi\n\n\tif [ \"$NO_SHA1\" = \"1\" ]; then\n\t\texport BITCOIN_VERIFY_COMMITS_ALLOW_SHA1=0\n\telse\n\t\texport BITCOIN_VERIFY_COMMITS_ALLOW_SHA1=1\n\tfi\n\n\tif [ \"${REVSIG_ALLOWED#*$CURRENT_COMMIT}\" != \"$REVSIG_ALLOWED\" ]; then\n\t\texport BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG=1\n\telse\n\t\texport BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG=0\n\tfi\n\n\tif ! git -c \"gpg.program=${DIR}/gpg.sh\" verify-commit \"$CURRENT_COMMIT\" > /dev/null; then\n\t\tif [ \"$PREV_COMMIT\" != \"\" ]; then\n\t\t\techo \"No parent of $PREV_COMMIT was signed with a trusted key!\" > /dev/stderr\n\t\t\techo \"Parents are:\" > /dev/stderr\n\t\t\tPARENTS=$(git show -s --format=format:%P $PREV_COMMIT)\n\t\t\tfor PARENT in $PARENTS; do\n\t\t\t\tgit show -s $PARENT > /dev/stderr\n\t\t\tdone\n\t\telse\n\t\t\techo \"$CURRENT_COMMIT was not signed with a trusted key!\" > /dev/stderr\n\t\tfi\n\t\texit 1\n\tfi\n\n\t# We always verify the top of the tree\n\tif [ \"$VERIFY_TREE\" = 1 -o \"$PREV_COMMIT\" = \"\" ]; then\n\t\tIFS_CACHE=\"$IFS\"\n\t\tIFS='\n'\n\t\tfor LINE in $(git ls-tree --full-tree -r \"$CURRENT_COMMIT\"); do\n\t\t\tcase \"$LINE\" in\n\t\t\t\t\"12\"*)\n\t\t\t\t\techo \"Repo contains symlinks\" > /dev/stderr\n\t\t\t\t\tIFS=\"$IFS_CACHE\"\n\t\t\t\t\texit 1\n\t\t\t\t\t;;\n\t\t\tesac\n\t\tdone\n\t\tIFS=\"$IFS_CACHE\"\n\n\t\tFILE_HASHES=\"\"\n\t\tfor FILE in $(git ls-tree --full-tree -r --name-only \"$CURRENT_COMMIT\" | LC_ALL=C sort); do\n\t\t\tif [ \"$HAVE_GNU_SHA512\" = 1 ]; then\n\t\t\t\tHASH=$(git cat-file blob \"$CURRENT_COMMIT\":\"$FILE\" | sha512sum | { read FIRST _; echo $FIRST; } )\n\t\t\telse\n\t\t\t\tHASH=$(git cat-file blob \"$CURRENT_COMMIT\":\"$FILE\" | shasum -a 512 | { read FIRST _; echo $FIRST; } )\n\t\t\tfi\n\t\t\t[ \"$FILE_HASHES\" != \"\" ] && FILE_HASHES=\"$FILE_HASHES\"'\n'\n\t\t\tFILE_HASHES=\"$FILE_HASHES$HASH  $FILE\"\n\t\tdone\n\n\t\tif [ \"$HAVE_GNU_SHA512\" = 1 ]; then\n\t\t\tTREE_HASH=\"$(echo \"$FILE_HASHES\" | sha512sum)\"\n\t\telse\n\t\t\tTREE_HASH=\"$(echo \"$FILE_HASHES\" | shasum -a 512)\"\n\t\tfi\n\t\tHASH_MATCHES=0\n\t\tMSG=\"$(git show -s --format=format:%B \"$CURRENT_COMMIT\" | tail -n1)\"\n\n\t\tcase \"$MSG  -\" in\n\t\t\t\"Tree-SHA512: $TREE_HASH\")\n\t\t\t\tHASH_MATCHES=1;;\n\t\tesac\n\n\t\tif [ \"$HASH_MATCHES\" = \"0\" ]; then\n\t\t\techo \"Tree-SHA512 did not match for commit $CURRENT_COMMIT\" > /dev/stderr\n\t\t\texit 1\n\t\tfi\n\tfi\n\n\tPARENTS=$(git show -s --format=format:%P \"$CURRENT_COMMIT\")\n\tfor PARENT in $PARENTS; do\n\t\tPREV_COMMIT=\"$CURRENT_COMMIT\"\n\t\tCURRENT_COMMIT=\"$PARENT\"\n\t\tbreak\n\tdone\ndone\n"
  },
  {
    "path": "contrib/verifybinaries/README.md",
    "content": "### Verify Binaries\n\n#### Preparation:\n\nMake sure you obtain the proper release signing key and verify the fingerprint with several independent sources.\n\n```sh\n$ gpg --fingerprint \"Bitcoin Core binary release signing key\"\npub   4096R/36C2E964 2015-06-24 [expires: 2017-02-13]\n      Key fingerprint = 01EA 5486 DE18 A882 D4C2  6845 90C8 019E 36C2 E964\nuid                  Wladimir J. van der Laan (Bitcoin Core binary release signing key) <laanwj@gmail.com>\n```\n\n#### Usage:\n\nThis script attempts to download the signature file `SHA256SUMS.asc` from https://bitcoin.org.\n\nIt 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.\n\nThe 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.\n\n\n```sh\n./verify.sh bitcoin-core-0.11.2\n./verify.sh bitcoin-core-0.12.0\n./verify.sh bitcoin-core-0.13.0-rc3\n```\n\nIf you only want to download the binaries of certain platform, add the corresponding suffix, e.g.:\n\n```sh\n./verify.sh bitcoin-core-0.11.2-osx\n./verify.sh 0.12.0-linux\n./verify.sh bitcoin-core-0.13.0-rc3-win64\n```\n\nIf you do not want to keep the downloaded binaries, specify anything as the second parameter.\n\n```sh\n./verify.sh bitcoin-core-0.13.0 delete\n```\n"
  },
  {
    "path": "contrib/verifybinaries/verify.sh",
    "content": "#!/bin/bash\n# Copyright (c) 2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n###   This script attempts to download the signature file SHA256SUMS.asc from\n###   bitcoincore.org and bitcoin.org and compares them.\n###   It first checks if the signature passes, and then downloads the files specified in\n###   the file, and checks if the hashes of these files match those that are specified\n###   in the signature file.\n###   The script returns 0 if everything passes the checks. It returns 1 if either the\n###   signature check or the hash check doesn't pass. If an error occurs the return value is 2\n\nfunction clean_up {\n   for file in $*\n   do\n      rm \"$file\" 2> /dev/null\n   done\n}\n\nWORKINGDIR=\"/tmp/bitcoin_verify_binaries\"\nTMPFILE=\"hashes.tmp\"\n\nSIGNATUREFILENAME=\"SHA256SUMS.asc\"\nRCSUBDIR=\"test\"\nHOST1=\"https://bitcoincore.org\"\nHOST2=\"https://bitcoin.org\"\nBASEDIR=\"/bin/\"\nVERSIONPREFIX=\"bitcoin-core-\"\nRCVERSIONSTRING=\"rc\"\n\nif [ ! -d \"$WORKINGDIR\" ]; then\n   mkdir \"$WORKINGDIR\"\nfi\n\ncd \"$WORKINGDIR\" || exit 1\n\n#test if a version number has been passed as an argument\nif [ -n \"$1\" ]; then\n   #let's also check if the version number includes the prefix 'bitcoin-',\n   #  and add this prefix if it doesn't\n   if [[ $1 == \"$VERSIONPREFIX\"* ]]; then\n      VERSION=\"$1\"\n   else\n      VERSION=\"$VERSIONPREFIX$1\"\n   fi\n\n   STRIPPEDLAST=\"${VERSION%-*}\"\n\n   #now let's see if the version string contains \"rc\" or a platform name (e.g. \"osx\")\n   if [[ \"$STRIPPEDLAST-\" == \"$VERSIONPREFIX\" ]]; then\n      BASEDIR=\"$BASEDIR$VERSION/\"\n   else\n      # let's examine the last part to see if it's rc and/or platform name\n      STRIPPEDNEXTTOLAST=\"${STRIPPEDLAST%-*}\"\n      if [[ \"$STRIPPEDNEXTTOLAST-\" == \"$VERSIONPREFIX\" ]]; then\n\n         LASTSUFFIX=\"${VERSION##*-}\"\n         VERSION=\"$STRIPPEDLAST\"\n\n         if [[ $LASTSUFFIX == *\"$RCVERSIONSTRING\"* ]]; then\n            RCVERSION=\"$LASTSUFFIX\"\n         else\n            PLATFORM=\"$LASTSUFFIX\"\n         fi\n\n      else\n         RCVERSION=\"${STRIPPEDLAST##*-}\"\n         PLATFORM=\"${VERSION##*-}\"\n\n         VERSION=\"$STRIPPEDNEXTTOLAST\"\n      fi\n\n      BASEDIR=\"$BASEDIR$VERSION/\"\n      if [[ $RCVERSION == *\"$RCVERSIONSTRING\"* ]]; then\n         BASEDIR=\"$BASEDIR$RCSUBDIR.$RCVERSION/\"\n      fi\n   fi\nelse\n   echo \"Error: need to specify a version on the command line\"\n   exit 2\nfi\n\n#first we fetch the file containing the signature\nWGETOUT=$(wget -N \"$HOST1$BASEDIR$SIGNATUREFILENAME\" 2>&1)\n\n#and then see if wget completed successfully\nif [ $? -ne 0 ]; then\n   echo \"Error: couldn't fetch signature file. Have you specified the version number in the following format?\"\n   echo \"[$VERSIONPREFIX]<version>-[$RCVERSIONSTRING[0-9]] (example: ${VERSIONPREFIX}0.10.4-${RCVERSIONSTRING}1)\"\n   echo \"wget output:\"\n   echo \"$WGETOUT\"|sed 's/^/\\t/g'\n   exit 2\nfi\n\nWGETOUT=$(wget -N -O \"$SIGNATUREFILENAME.2\" \"$HOST2$BASEDIR$SIGNATUREFILENAME\" 2>&1)\nif [ $? -ne 0 ]; then\n   echo \"bitcoin.org failed to provide signature file, but bitcoincore.org did?\"\n   echo \"wget output:\"\n   echo \"$WGETOUT\"|sed 's/^/\\t/g'\n   clean_up $SIGNATUREFILENAME\n   exit 3\nfi\n\nSIGFILEDIFFS=\"$(diff $SIGNATUREFILENAME $SIGNATUREFILENAME.2)\"\nif [ \"$SIGFILEDIFFS\" != \"\" ]; then\n   echo \"bitcoin.org and bitcoincore.org signature files were not equal?\"\n   clean_up $SIGNATUREFILENAME $SIGNATUREFILENAME.2\n   exit 4\nfi\n\n#then we check it\nGPGOUT=$(gpg --yes --decrypt --output \"$TMPFILE\" \"$SIGNATUREFILENAME\" 2>&1)\n\n#return value 0: good signature\n#return value 1: bad signature\n#return value 2: gpg error\n\nRET=\"$?\"\nif [ $RET -ne 0 ]; then\n   if [ $RET -eq 1 ]; then\n      #and notify the user if it's bad\n      echo \"Bad signature.\"\n   elif [ $RET -eq 2 ]; then\n      #or if a gpg error has occurred\n      echo \"gpg error. Do you have the Bitcoin Core binary release signing key installed?\"\n   fi\n\n   echo \"gpg output:\"\n   echo \"$GPGOUT\"|sed 's/^/\\t/g'\n   clean_up $SIGNATUREFILENAME $SIGNATUREFILENAME.2 $TMPFILE\n   exit \"$RET\"\nfi\n\nif [ -n \"$PLATFORM\" ]; then\n   grep $PLATFORM $TMPFILE > \"$TMPFILE-plat\"\n   TMPFILESIZE=$(stat -c%s \"$TMPFILE-plat\")\n   if [ $TMPFILESIZE -eq 0 ]; then\n      echo \"error: no files matched the platform specified\" && exit 3\n   fi\n   mv \"$TMPFILE-plat\" $TMPFILE\nfi\n\n#here we extract the filenames from the signature file\nFILES=$(awk '{print $2}' \"$TMPFILE\")\n\n#and download these one by one\nfor file in $FILES\ndo\n   echo \"Downloading $file\"\n   wget --quiet -N \"$HOST1$BASEDIR$file\"\ndone\n\n#check hashes\nDIFF=$(diff <(sha256sum $FILES) \"$TMPFILE\")\n\nif [ $? -eq 1 ]; then\n   echo \"Hashes don't match.\"\n   echo \"Offending files:\"\n   echo \"$DIFF\"|grep \"^<\"|awk '{print \"\\t\"$3}'\n   exit 1\nelif [ $? -gt 1 ]; then\n   echo \"Error executing 'diff'\"\n   exit 2\nfi\n\nif [ -n \"$2\" ]; then\n   echo \"Clean up the binaries\"\n   clean_up $FILES $SIGNATUREFILENAME $SIGNATUREFILENAME.2 $TMPFILE\nelse\n   echo \"Keep the binaries in $WORKINGDIR\"\n   clean_up $TMPFILE\nfi\n\necho -e \"Verified hashes of \\n$FILES\"\n\nexit 0\n"
  },
  {
    "path": "contrib/windeploy/detached-sig-create.sh",
    "content": "#!/bin/sh\n# Copyright (c) 2014-2015 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nif [ -z \"$OSSLSIGNCODE\" ]; then\n  OSSLSIGNCODE=osslsigncode\nfi\n\nif [ ! -n \"$1\" ]; then\n  echo \"usage: $0 <osslcodesign args>\"\n  echo \"example: $0 -key codesign.key\"\n  exit 1\nfi\n\nOUT=signature-win.tar.gz\nSRCDIR=unsigned\nWORKDIR=./.tmp\nOUTDIR=\"${WORKDIR}/out\"\nOUTSUBDIR=\"${OUTDIR}/win\"\nTIMESERVER=http://timestamp.comodoca.com\nCERTFILE=\"win-codesign.cert\"\n\nmkdir -p \"${OUTSUBDIR}\"\nbasename -a `ls -1 \"${SRCDIR}\"/*-unsigned.exe` | while read UNSIGNED; do\n  echo Signing \"${UNSIGNED}\"\n  \"${OSSLSIGNCODE}\" sign -certs \"${CERTFILE}\" -t \"${TIMESERVER}\" -in \"${SRCDIR}/${UNSIGNED}\" -out \"${WORKDIR}/${UNSIGNED}\" \"$@\"\n  \"${OSSLSIGNCODE}\" extract-signature -pem -in \"${WORKDIR}/${UNSIGNED}\" -out \"${OUTSUBDIR}/${UNSIGNED}.pem\" && rm \"${WORKDIR}/${UNSIGNED}\"\ndone\n\nrm -f \"${OUT}\"\ntar -C \"${OUTDIR}\" -czf \"${OUT}\" .\nrm -rf \"${WORKDIR}\"\necho \"Created ${OUT}\"\n"
  },
  {
    "path": "contrib/windeploy/win-codesign.cert",
    "content": "-----BEGIN CERTIFICATE-----\nMIIFTTCCBDWgAwIBAgIRALlW05RLwG2hMQMX5d/o5J8wDQYJKoZIhvcNAQELBQAw\nfTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\nA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxIzAhBgNV\nBAMTGkNPTU9ETyBSU0EgQ29kZSBTaWduaW5nIENBMB4XDTE2MDIwMzAwMDAwMFoX\nDTE5MDMwNTIzNTk1OVowgbUxCzAJBgNVBAYTAlVTMQ4wDAYDVQQRDAU5ODEwNDEL\nMAkGA1UECAwCV0ExEDAOBgNVBAcMB1NlYXR0bGUxEDAOBgNVBAkMB1N0ZSAzMDAx\nFzAVBgNVBAkMDjcxIENvbHVtYmlhIFN0MSUwIwYDVQQKDBxUaGUgQml0Y29pbiBG\nb3VuZGF0aW9uLCBJbmMuMSUwIwYDVQQDDBxUaGUgQml0Y29pbiBGb3VuZGF0aW9u\nLCBJbmMuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAw37Vrv9Gbku0\n+kuV0t89TuyxtAcmT7QE4GcwESKKjmkxfzD9a0qlhqk8GfQ+fw4DHNN+nLKNv7xB\nbk6aS7J2v2DcXkOjrP99P9jqgTkp7MC04VtG3OqVRGB+gum0pptRovYZUQXIdkY7\nGJOok/NDagwKiiUe2V2meZ7UctsZNvYeilQdTgKIIhrMB9NowCOhT8ocVL4Ki55/\nl7hukJn3fueCM3fHTwY2/1gaGsOHoCkFRsD7vokjAVpiY+8rUgvHjb0gxgojiVGd\n6a6/F5XJwKJacvUyN4Hfc2K5lRMQjTTmo4aWNWIa0iJ3TK9BHpdSLJBqerMPvmnM\nkkapS+ZTNQIDAQABo4IBjTCCAYkwHwYDVR0jBBgwFoAUKZFg/4pN+uv5pmq4z/nm\nS71JzhIwHQYDVR0OBBYEFONpQ+cV82URVe+V8G57377KxxexMA4GA1UdDwEB/wQE\nAwIHgDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMBEGCWCGSAGG\n+EIBAQQEAwIEEDBGBgNVHSAEPzA9MDsGDCsGAQQBsjEBAgEDAjArMCkGCCsGAQUF\nBwIBFh1odHRwczovL3NlY3VyZS5jb21vZG8ubmV0L0NQUzBDBgNVHR8EPDA6MDig\nNqA0hjJodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9SU0FDb2RlU2lnbmlu\nZ0NBLmNybDB0BggrBgEFBQcBAQRoMGYwPgYIKwYBBQUHMAKGMmh0dHA6Ly9jcnQu\nY29tb2RvY2EuY29tL0NPTU9ET1JTQUNvZGVTaWduaW5nQ0EuY3J0MCQGCCsGAQUF\nBzABhhhodHRwOi8vb2NzcC5jb21vZG9jYS5jb20wDQYJKoZIhvcNAQELBQADggEB\nAGnBSi9K/9rgTAyKFKrfGWSfNOwAghmsnsvpZSQ7QyoGWBFKSgCs/70kErl18oHA\ng7Y8loQB1yukZmJaCa3OvGud7smn45TCh0TMf4EpP20Wxf4rMQTxwAatasHL3+vi\nI+Nl5bsRZ09kWjvayqLII5upjS/yq0JfpmyGl5k2C/fIpztq0iOLvqWlXcL4+51r\ncMUAfX6E6EaZQm//ikp+w2+7MEXTKguOuV3gwsrTy0DsvkZl4YDgx/FA4ImzXopv\nd+3KJPLvO+OSBqUD3JPwXHnuJqGAbLBFyyCa/feGUjLlR8cxcNWLWdp4qxtoIUPG\n3wTsC9YgrglS0F7FKMXlNRY=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIF4DCCA8igAwIBAgIQLnyHzA6TSlL+lP0ct800rzANBgkqhkiG9w0BAQwFADCB\nhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\nA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV\nBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTMwNTA5\nMDAwMDAwWhcNMjgwNTA4MjM1OTU5WjB9MQswCQYDVQQGEwJHQjEbMBkGA1UECBMS\nR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD\nT01PRE8gQ0EgTGltaXRlZDEjMCEGA1UEAxMaQ09NT0RPIFJTQSBDb2RlIFNpZ25p\nbmcgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCmmJBjd5E0f4rR\n3elnMRHrzB79MR2zuWJXP5O8W+OfHiQyESdrvFGRp8+eniWzX4GoGA8dHiAwDvth\ne4YJs+P9omidHCydv3Lj5HWg5TUjjsmK7hoMZMfYQqF7tVIDSzqwjiNLS2PgIpQ3\ne9V5kAoUGFEs5v7BEvAcP2FhCoyi3PbDMKrNKBh1SMF5WgjNu4xVjPfUdpA6M0ZQ\nc5hc9IVKaw+A3V7Wvf2pL8Al9fl4141fEMJEVTyQPDFGy3CuB6kK46/BAW+QGiPi\nXzjbxghdR7ODQfAuADcUuRKqeZJSzYcPe9hiKaR+ML0btYxytEjy4+gh+V5MYnmL\nAgaff9ULAgMBAAGjggFRMIIBTTAfBgNVHSMEGDAWgBS7r34CPfqm8TyEjq3uOJjs\n2TIy1DAdBgNVHQ4EFgQUKZFg/4pN+uv5pmq4z/nmS71JzhIwDgYDVR0PAQH/BAQD\nAgGGMBIGA1UdEwEB/wQIMAYBAf8CAQAwEwYDVR0lBAwwCgYIKwYBBQUHAwMwEQYD\nVR0gBAowCDAGBgRVHSAAMEwGA1UdHwRFMEMwQaA/oD2GO2h0dHA6Ly9jcmwuY29t\nb2RvY2EuY29tL0NPTU9ET1JTQUNlcnRpZmljYXRpb25BdXRob3JpdHkuY3JsMHEG\nCCsGAQUFBwEBBGUwYzA7BggrBgEFBQcwAoYvaHR0cDovL2NydC5jb21vZG9jYS5j\nb20vQ09NT0RPUlNBQWRkVHJ1c3RDQS5jcnQwJAYIKwYBBQUHMAGGGGh0dHA6Ly9v\nY3NwLmNvbW9kb2NhLmNvbTANBgkqhkiG9w0BAQwFAAOCAgEAAj8COcPu+Mo7id4M\nbU2x8U6ST6/COCwEzMVjEasJY6+rotcCP8xvGcM91hoIlP8l2KmIpysQGuCbsQci\nGlEcOtTh6Qm/5iR0rx57FjFuI+9UUS1SAuJ1CAVM8bdR4VEAxof2bO4QRHZXavHf\nWGshqknUfDdOvf+2dVRAGDZXZxHNTwLk/vPa/HUX2+y392UJI0kfQ1eD6n4gd2HI\nTfK7ZU2o94VFB696aSdlkClAi997OlE5jKgfcHmtbUIgos8MbAOMTM1zB5TnWo46\nBLqioXwfy2M6FafUFRunUkcyqfS/ZEfRqh9TTjIwc8Jvt3iCnVz/RrtrIh2IC/gb\nqjSm/Iz13X9ljIwxVzHQNuxHoc/Li6jvHBhYxQZ3ykubUa9MCEp6j+KjUuKOjswm\n5LLY5TjCqO3GgZw1a6lYYUoKl7RLQrZVnb6Z53BtWfhtKgx/GWBfDJqIbDCsUgmQ\nFhv/K53b0CDKieoofjKOGd97SDMe12X4rsn4gxSTdn1k0I7OvjV9/3IxTZ+evR5s\nL6iPDAZQ+4wns3bJ9ObXwzTijIchhmH+v1V04SF3AwpobLvkyanmz1kl63zsRQ55\nZmjoIs2475iFTZYRPAmK0H+8KCgT+2rKVI2SXM3CZZgGns5IW9S1N5NGQXwH3c/6\nQ++6Z2H/fUnguzB9XIDj5hY5S6c=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB\nhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\nA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV\nBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5\nMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT\nEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR\nQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh\ndGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR\n6FSS0gpWsawNJN3Fz0RndJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8X\npz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZFGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC\n9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+5eNu/Nio5JIk2kNrYrhV\n/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pGx8cgoLEf\nZd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z\n+pUX2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7w\nqP/0uK3pN/u6uPQLOvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZah\nSL0896+1DSJMwBGB7FY79tOi4lu3sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVIC\nu9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+CGCe01a60y1Dma/RMhnEw6abf\nFobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5WdYgGq/yapiq\ncrxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E\nFgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB\n/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvl\nwFTPoCWOAvn9sKIN9SCYPBMtrFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM\n4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+nq6PK7o9mfjYcwlYRm6mnPTXJ9OV\n2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSgtZx8jb8uk2Intzna\nFxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ\nCuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK\nboHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke\njkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL\nS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb\nQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl\n0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB\nNVOFBkpdn627G190\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "contrib/zmq/zmq_sub.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n\"\"\"\n    ZMQ example using python3's asyncio\n\n    Bitcoin should be started with the command line arguments:\n        bitcoind -testnet -daemon \\\n                -zmqpubrawtx=tcp://127.0.0.1:28332 \\\n                -zmqpubrawblock=tcp://127.0.0.1:28332 \\\n                -zmqpubhashtx=tcp://127.0.0.1:28332 \\\n                -zmqpubhashblock=tcp://127.0.0.1:28332\n\n    We use the asyncio library here.  `self.handle()` installs itself as a\n    future at the end of the function.  Since it never returns with the event\n    loop having an empty stack of futures, this creates an infinite loop.  An\n    alternative is to wrap the contents of `handle` inside `while True`.\n\n    A blocking example using python 2.7 can be obtained from the git history:\n    https://github.com/bitcoin/bitcoin/blob/37a7fe9e440b83e2364d5498931253937abe9294/contrib/zmq/zmq_sub.py\n\"\"\"\n\nimport binascii\nimport asyncio\nimport zmq\nimport zmq.asyncio\nimport signal\nimport struct\nimport sys\n\nif not (sys.version_info.major >= 3 and sys.version_info.minor >= 5):\n    print(\"This example only works with Python 3.5 and greater\")\n    sys.exit(1)\n\nport = 28332\n\nclass ZMQHandler():\n    def __init__(self):\n        self.loop = zmq.asyncio.install()\n        self.zmqContext = zmq.asyncio.Context()\n\n        self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)\n        self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, \"hashblock\")\n        self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, \"hashtx\")\n        self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, \"rawblock\")\n        self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, \"rawtx\")\n        self.zmqSubSocket.connect(\"tcp://127.0.0.1:%i\" % port)\n\n    async def handle(self) :\n        msg = await self.zmqSubSocket.recv_multipart()\n        topic = msg[0]\n        body = msg[1]\n        sequence = \"Unknown\"\n        if len(msg[-1]) == 4:\n          msgSequence = struct.unpack('<I', msg[-1])[-1]\n          sequence = str(msgSequence)\n        if topic == b\"hashblock\":\n            print('- HASH BLOCK ('+sequence+') -')\n            print(binascii.hexlify(body))\n        elif topic == b\"hashtx\":\n            print('- HASH TX  ('+sequence+') -')\n            print(binascii.hexlify(body))\n        elif topic == b\"rawblock\":\n            print('- RAW BLOCK HEADER ('+sequence+') -')\n            print(binascii.hexlify(body[:80]))\n        elif topic == b\"rawtx\":\n            print('- RAW TX ('+sequence+') -')\n            print(binascii.hexlify(body))\n        # schedule ourselves to receive the next message\n        asyncio.ensure_future(self.handle())\n\n    def start(self):\n        self.loop.add_signal_handler(signal.SIGINT, self.stop)\n        self.loop.create_task(self.handle())\n        self.loop.run_forever()\n\n    def stop(self):\n        self.loop.stop()\n        self.zmqContext.destroy()\n\ndaemon = ZMQHandler()\ndaemon.start()\n"
  },
  {
    "path": "contrib/zmq/zmq_sub3.4.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n\"\"\"\n    ZMQ example using python3's asyncio\n\n    Bitcoin should be started with the command line arguments:\n        bitcoind -testnet -daemon \\\n                -zmqpubrawtx=tcp://127.0.0.1:28332 \\\n                -zmqpubrawblock=tcp://127.0.0.1:28332 \\\n                -zmqpubhashtx=tcp://127.0.0.1:28332 \\\n                -zmqpubhashblock=tcp://127.0.0.1:28332\n\n    We use the asyncio library here.  `self.handle()` installs itself as a\n    future at the end of the function.  Since it never returns with the event\n    loop having an empty stack of futures, this creates an infinite loop.  An\n    alternative is to wrap the contents of `handle` inside `while True`.\n\n    The `@asyncio.coroutine` decorator and the `yield from` syntax found here\n    was introduced in python 3.4 and has been deprecated in favor of the `async`\n    and `await` keywords respectively.\n\n    A blocking example using python 2.7 can be obtained from the git history:\n    https://github.com/bitcoin/bitcoin/blob/37a7fe9e440b83e2364d5498931253937abe9294/contrib/zmq/zmq_sub.py\n\"\"\"\n\nimport binascii\nimport asyncio\nimport zmq\nimport zmq.asyncio\nimport signal\nimport struct\nimport sys\n\nif not (sys.version_info.major >= 3 and sys.version_info.minor >= 4):\n    print(\"This example only works with Python 3.4 and greater\")\n    sys.exit(1)\n\nport = 28332\n\nclass ZMQHandler():\n    def __init__(self):\n        self.loop = zmq.asyncio.install()\n        self.zmqContext = zmq.asyncio.Context()\n\n        self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)\n        self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, \"hashblock\")\n        self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, \"hashtx\")\n        self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, \"rawblock\")\n        self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, \"rawtx\")\n        self.zmqSubSocket.connect(\"tcp://127.0.0.1:%i\" % port)\n\n    @asyncio.coroutine\n    def handle(self) :\n        msg = yield from self.zmqSubSocket.recv_multipart()\n        topic = msg[0]\n        body = msg[1]\n        sequence = \"Unknown\"\n        if len(msg[-1]) == 4:\n          msgSequence = struct.unpack('<I', msg[-1])[-1]\n          sequence = str(msgSequence)\n        if topic == b\"hashblock\":\n            print('- HASH BLOCK ('+sequence+') -')\n            print(binascii.hexlify(body))\n        elif topic == b\"hashtx\":\n            print('- HASH TX  ('+sequence+') -')\n            print(binascii.hexlify(body))\n        elif topic == b\"rawblock\":\n            print('- RAW BLOCK HEADER ('+sequence+') -')\n            print(binascii.hexlify(body[:80]))\n        elif topic == b\"rawtx\":\n            print('- RAW TX ('+sequence+') -')\n            print(binascii.hexlify(body))\n        # schedule ourselves to receive the next message\n        asyncio.ensure_future(self.handle())\n\n    def start(self):\n        self.loop.add_signal_handler(signal.SIGINT, self.stop)\n        self.loop.create_task(self.handle())\n        self.loop.run_forever()\n\n    def stop(self):\n        self.loop.stop()\n        self.zmqContext.destroy()\n\ndaemon = ZMQHandler()\ndaemon.start()\n"
  },
  {
    "path": "depends/.gitignore",
    "content": "SDKs/\nwork/\nbuilt/\nsources/\nconfig.site\nx86_64*\ni686*\nmips*\narm*\naarch64*\n"
  },
  {
    "path": "depends/README.md",
    "content": "### Usage\n\nTo build dependencies for the current arch+OS:\n\n    make\n\nTo build for another arch/OS:\n\n    make HOST=host-platform-triplet\n\nFor example:\n\n    make HOST=x86_64-w64-mingw32 -j4\n\nA prefix will be generated that's suitable for plugging into Bitcoin's\nconfigure. In the above example, a dir named x86_64-w64-mingw32 will be\ncreated. To use it for Bitcoin:\n\n    ./configure --prefix=`pwd`/depends/x86_64-w64-mingw32\n\nCommon `host-platform-triplets` for cross compilation are:\n\n- `i686-w64-mingw32` for Win32\n- `x86_64-w64-mingw32` for Win64\n- `x86_64-apple-darwin11` for MacOSX\n- `arm-linux-gnueabihf` for Linux ARM 32 bit\n- `aarch64-linux-gnu` for Linux ARM 64 bit\n\nNo other options are needed, the paths are automatically configured.\n\nInstall the required dependencies: Ubuntu & Debian\n--------------------------------------------------\n\nFor macOS cross compilation:\n\n    sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libcap-dev libz-dev libbz2-dev python-setuptools\n\nFor Win32/Win64 cross compilation:\n\n- see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux)\n\nFor linux (including i386, ARM) cross compilation:\n\n    sudo apt-get install curl g++-aarch64-linux-gnu g++-4.8-aarch64-linux-gnu gcc-4.8-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-arm-linux-gnueabihf g++-4.8-arm-linux-gnueabihf gcc-4.8-arm-linux-gnueabihf binutils-arm-linux-gnueabihf g++-4.8-multilib gcc-4.8-multilib binutils-gold bsdmainutils\n\n\nDependency Options:\nThe following can be set when running make: make FOO=bar\n\n    SOURCES_PATH: downloaded sources will be placed here\n    BASE_CACHE: built packages will be placed here\n    SDK_PATH: Path where sdk's can be found (used by OSX)\n    FALLBACK_DOWNLOAD_PATH: If a source file can't be fetched, try here before giving up\n    NO_QT: Don't download/build/cache qt and its dependencies\n    NO_WALLET: Don't download/build/cache libs needed to enable the wallet\n    NO_UPNP: Don't download/build/cache packages needed for enabling upnp\n    DEBUG: disable some optimizations and enable more runtime checking\n    HOST_ID_SALT: Optional salt to use when generating host package ids\n    BUILD_ID_SALT: Optional salt to use when generating build package ids\n\nIf some packages are not built, for example `make NO_WALLET=1`, the appropriate\noptions will be passed to bitcoin's configure. In this case, `--disable-wallet`.\n\nAdditional targets:\n\n    download: run 'make download' to fetch all sources without building them\n    download-osx: run 'make download-osx' to fetch all sources needed for osx builds\n    download-win: run 'make download-win' to fetch all sources needed for win builds\n    download-linux: run 'make download-linux' to fetch all sources needed for linux builds\n\n### Other documentation\n\n- [description.md](description.md): General description of the depends system\n- [packages.md](packages.md): Steps for adding packages\n\n"
  },
  {
    "path": "depends/builders/darwin.mk",
    "content": "build_darwin_CC: = $(shell xcrun -f clang)\nbuild_darwin_CXX: = $(shell xcrun -f clang++)\nbuild_darwin_AR: = $(shell xcrun -f ar)\nbuild_darwin_RANLIB: = $(shell xcrun -f ranlib)\nbuild_darwin_STRIP: = $(shell xcrun -f strip)\nbuild_darwin_OTOOL: = $(shell xcrun -f otool)\nbuild_darwin_NM: = $(shell xcrun -f nm)\nbuild_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)\nbuild_darwin_SHA256SUM = shasum -a 256\nbuild_darwin_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o\n\n#darwin host on darwin builder. overrides darwin host preferences.\ndarwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION)\ndarwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++\ndarwin_AR:=$(shell xcrun -f ar)\ndarwin_RANLIB:=$(shell xcrun -f ranlib)\ndarwin_STRIP:=$(shell xcrun -f strip)\ndarwin_LIBTOOL:=$(shell xcrun -f libtool)\ndarwin_OTOOL:=$(shell xcrun -f otool)\ndarwin_NM:=$(shell xcrun -f nm)\ndarwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool)\ndarwin_native_toolchain=\n"
  },
  {
    "path": "depends/builders/default.mk",
    "content": "default_build_CC = gcc\ndefault_build_CXX = g++\ndefault_build_AR = ar\ndefault_build_RANLIB = ranlib\ndefault_build_STRIP = strip\ndefault_build_NM = nm\ndefault_build_OTOOL = otool\ndefault_build_INSTALL_NAME_TOOL = install_name_tool\n\ndefine add_build_tool_func\nbuild_$(build_os)_$1 ?= $$(default_build_$1)\nbuild_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1)\nbuild_$1=$$(build_$(build_arch)_$(build_os)_$1)\nendef\n$(foreach var,CC CXX AR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var))))\ndefine add_build_flags_func\nbuild_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1)\nbuild_$1=$$(build_$(build_arch)_$(build_os)_$1)\nendef\n$(foreach flags, CFLAGS CXXFLAGS LDFLAGS, $(eval $(call add_build_flags_func,$(flags))))\n"
  },
  {
    "path": "depends/builders/linux.mk",
    "content": "build_linux_SHA256SUM = sha256sum\nbuild_linux_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o\n"
  },
  {
    "path": "depends/config.guess",
    "content": "#! /bin/sh\n# Attempt to guess a canonical system name.\n#   Copyright 1992-2017 Free Software Foundation, Inc.\n\ntimestamp='2017-03-05'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, see <http://www.gnu.org/licenses/>.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that\n# program.  This Exception is an additional permission under section 7\n# of the GNU General Public License, version 3 (\"GPLv3\").\n#\n# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.\n#\n# You can get the latest version of this script from:\n# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess\n#\n# Please send patches to <config-patches@gnu.org>.\n\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION]\n\nOutput the configuration name of the system \\`$me' is run on.\n\nOperation modes:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.guess ($timestamp)\n\nOriginally written by Per Bothner.\nCopyright 1992-2017 Free Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit ;;\n    --version | -v )\n       echo \"$version\" ; exit ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\" >&2\n       exit 1 ;;\n    * )\n       break ;;\n  esac\ndone\n\nif test $# != 0; then\n  echo \"$me: too many arguments$help\" >&2\n  exit 1\nfi\n\ntrap 'exit 1' 1 2 15\n\n# CC_FOR_BUILD -- compiler used by this script. Note that the use of a\n# compiler to aid in system detection is discouraged as it requires\n# temporary files to be created and, as you can see below, it is a\n# headache to deal with in a portable fashion.\n\n# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still\n# use `HOST_CC' if defined, but it is deprecated.\n\n# Portable tmp directory creation inspired by the Autoconf team.\n\nset_cc_for_build='\ntrap \"exitcode=\\$?; (rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null) && exit \\$exitcode\" 0 ;\ntrap \"rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null; exit 1\" 1 2 13 15 ;\n: ${TMPDIR=/tmp} ;\n { tmp=`(umask 077 && mktemp -d \"$TMPDIR/cgXXXXXX\") 2>/dev/null` && test -n \"$tmp\" && test -d \"$tmp\" ; } ||\n { test -n \"$RANDOM\" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||\n { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo \"Warning: creating insecure temp directory\" >&2 ; } ||\n { echo \"$me: cannot create a temporary directory in $TMPDIR\" >&2 ; exit 1 ; } ;\ndummy=$tmp/dummy ;\ntmpfiles=\"$dummy.c $dummy.o $dummy.rel $dummy\" ;\ncase $CC_FOR_BUILD,$HOST_CC,$CC in\n ,,)    echo \"int x;\" > $dummy.c ;\n\tfor c in cc gcc c89 c99 ; do\n\t  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then\n\t     CC_FOR_BUILD=\"$c\"; break ;\n\t  fi ;\n\tdone ;\n\tif test x\"$CC_FOR_BUILD\" = x ; then\n\t  CC_FOR_BUILD=no_compiler_found ;\n\tfi\n\t;;\n ,,*)   CC_FOR_BUILD=$CC ;;\n ,*,*)  CC_FOR_BUILD=$HOST_CC ;;\nesac ; set_cc_for_build= ;'\n\n# This is needed to find uname on a Pyramid OSx when run in the BSD universe.\n# (ghazi@noc.rutgers.edu 1994-08-24)\nif (test -f /.attbin/uname) >/dev/null 2>&1 ; then\n\tPATH=$PATH:/.attbin ; export PATH\nfi\n\nUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown\nUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown\nUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown\nUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown\n\ncase \"${UNAME_SYSTEM}\" in\nLinux|GNU|GNU/*)\n\t# If the system lacks a compiler, then just pick glibc.\n\t# We could probably try harder.\n\tLIBC=gnu\n\n\teval $set_cc_for_build\n\tcat <<-EOF > $dummy.c\n\t#include <features.h>\n\t#if defined(__UCLIBC__)\n\tLIBC=uclibc\n\t#elif defined(__dietlibc__)\n\tLIBC=dietlibc\n\t#else\n\tLIBC=gnu\n\t#endif\n\tEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`\n\t;;\nesac\n\n# Note: order is significant - the case branches are not exclusive.\n\ncase \"${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}\" in\n    *:NetBSD:*:*)\n\t# NetBSD (nbsd) targets should (where applicable) match one or\n\t# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,\n\t# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently\n\t# switched to ELF, *-*-netbsd* would select the old\n\t# object file format.  This provides both forward\n\t# compatibility and a consistent mechanism for selecting the\n\t# object file format.\n\t#\n\t# Note: NetBSD doesn't particularly care about the vendor\n\t# portion of the name.  We always set it to \"unknown\".\n\tsysctl=\"sysctl -n hw.machine_arch\"\n\tUNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \\\n\t    /sbin/$sysctl 2>/dev/null || \\\n\t    /usr/sbin/$sysctl 2>/dev/null || \\\n\t    echo unknown)`\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    armeb) machine=armeb-unknown ;;\n\t    arm*) machine=arm-unknown ;;\n\t    sh3el) machine=shl-unknown ;;\n\t    sh3eb) machine=sh-unknown ;;\n\t    sh5el) machine=sh5le-unknown ;;\n\t    earmv*)\n\t\tarch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\\(armv[0-9]\\).*$,\\1,'`\n\t\tendian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\\(eb\\)$,\\1,p'`\n\t\tmachine=${arch}${endian}-unknown\n\t\t;;\n\t    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;\n\tesac\n\t# The Operating System including object format, if it has switched\n\t# to ELF recently (or will in the future) and ABI.\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    earm*)\n\t\tos=netbsdelf\n\t\t;;\n\t    arm*|i386|m68k|ns32k|sh3*|sparc|vax)\n\t\teval $set_cc_for_build\n\t\tif echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t\t| grep -q __ELF__\n\t\tthen\n\t\t    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).\n\t\t    # Return netbsd for either.  FIX?\n\t\t    os=netbsd\n\t\telse\n\t\t    os=netbsdelf\n\t\tfi\n\t\t;;\n\t    *)\n\t\tos=netbsd\n\t\t;;\n\tesac\n\t# Determine ABI tags.\n\tcase \"${UNAME_MACHINE_ARCH}\" in\n\t    earm*)\n\t\texpr='s/^earmv[0-9]/-eabi/;s/eb$//'\n\t\tabi=`echo ${UNAME_MACHINE_ARCH} | sed -e \"$expr\"`\n\t\t;;\n\tesac\n\t# The OS release\n\t# Debian GNU/NetBSD machines have a different userland, and\n\t# thus, need a distinct triplet. However, they do not need\n\t# kernel version information, so it can be replaced with a\n\t# suitable tag, in the style of linux-gnu.\n\tcase \"${UNAME_VERSION}\" in\n\t    Debian*)\n\t\trelease='-gnu'\n\t\t;;\n\t    *)\n\t\trelease=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`\n\t\t;;\n\tesac\n\t# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:\n\t# contains redundant information, the shorter form:\n\t# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.\n\techo \"${machine}-${os}${release}${abi}\"\n\texit ;;\n    *:Bitrig:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}\n\texit ;;\n    *:OpenBSD:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}\n\texit ;;\n    *:LibertyBSD:*:*)\n\tUNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\\.//'`\n\techo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}\n\texit ;;\n    *:ekkoBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}\n\texit ;;\n    *:SolidBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}\n\texit ;;\n    macppc:MirBSD:*:*)\n\techo powerpc-unknown-mirbsd${UNAME_RELEASE}\n\texit ;;\n    *:MirBSD:*:*)\n\techo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}\n\texit ;;\n    *:Sortix:*:*)\n\techo ${UNAME_MACHINE}-unknown-sortix\n\texit ;;\n    alpha:OSF1:*:*)\n\tcase $UNAME_RELEASE in\n\t*4.0)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`\n\t\t;;\n\t*5.*)\n\t\tUNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`\n\t\t;;\n\tesac\n\t# According to Compaq, /usr/sbin/psrinfo has been available on\n\t# OSF/1 and Tru64 systems produced since 1995.  I hope that\n\t# covers most systems running today.  This code pipes the CPU\n\t# types through head -n 1, so we only detect the type of CPU 0.\n\tALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \\(.*\\) processor.*$/\\1/p' | head -n 1`\n\tcase \"$ALPHA_CPU_TYPE\" in\n\t    \"EV4 (21064)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"EV4.5 (21064)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"LCA4 (21066/21068)\")\n\t\tUNAME_MACHINE=alpha ;;\n\t    \"EV5 (21164)\")\n\t\tUNAME_MACHINE=alphaev5 ;;\n\t    \"EV5.6 (21164A)\")\n\t\tUNAME_MACHINE=alphaev56 ;;\n\t    \"EV5.6 (21164PC)\")\n\t\tUNAME_MACHINE=alphapca56 ;;\n\t    \"EV5.7 (21164PC)\")\n\t\tUNAME_MACHINE=alphapca57 ;;\n\t    \"EV6 (21264)\")\n\t\tUNAME_MACHINE=alphaev6 ;;\n\t    \"EV6.7 (21264A)\")\n\t\tUNAME_MACHINE=alphaev67 ;;\n\t    \"EV6.8CB (21264C)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.8AL (21264B)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.8CX (21264D)\")\n\t\tUNAME_MACHINE=alphaev68 ;;\n\t    \"EV6.9A (21264/EV69A)\")\n\t\tUNAME_MACHINE=alphaev69 ;;\n\t    \"EV7 (21364)\")\n\t\tUNAME_MACHINE=alphaev7 ;;\n\t    \"EV7.9 (21364A)\")\n\t\tUNAME_MACHINE=alphaev79 ;;\n\tesac\n\t# A Pn.n version is a patched version.\n\t# A Vn.n version is a released version.\n\t# A Tn.n version is a released field test version.\n\t# A Xn.n version is an unreleased experimental baselevel.\n\t# 1.2 uses \"1.2\" for uname -r.\n\techo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`\n\t# Reset EXIT trap before exiting to avoid spurious non-zero exit code.\n\texitcode=$?\n\ttrap '' 0\n\texit $exitcode ;;\n    Alpha\\ *:Windows_NT*:*)\n\t# How do we know it's Interix rather than the generic POSIX subsystem?\n\t# Should we change UNAME_MACHINE based on the output of uname instead\n\t# of the specific Alpha model?\n\techo alpha-pc-interix\n\texit ;;\n    21064:Windows_NT:50:3)\n\techo alpha-dec-winnt3.5\n\texit ;;\n    Amiga*:UNIX_System_V:4.0:*)\n\techo m68k-unknown-sysv4\n\texit ;;\n    *:[Aa]miga[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-amigaos\n\texit ;;\n    *:[Mm]orph[Oo][Ss]:*:*)\n\techo ${UNAME_MACHINE}-unknown-morphos\n\texit ;;\n    *:OS/390:*:*)\n\techo i370-ibm-openedition\n\texit ;;\n    *:z/VM:*:*)\n\techo s390-ibm-zvmoe\n\texit ;;\n    *:OS400:*:*)\n\techo powerpc-ibm-os400\n\texit ;;\n    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)\n\techo arm-acorn-riscix${UNAME_RELEASE}\n\texit ;;\n    arm*:riscos:*:*|arm*:RISCOS:*:*)\n\techo arm-unknown-riscos\n\texit ;;\n    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)\n\techo hppa1.1-hitachi-hiuxmpp\n\texit ;;\n    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)\n\t# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.\n\tif test \"`(/bin/universe) 2>/dev/null`\" = att ; then\n\t\techo pyramid-pyramid-sysv3\n\telse\n\t\techo pyramid-pyramid-bsd\n\tfi\n\texit ;;\n    NILE*:*:*:dcosx)\n\techo pyramid-pyramid-svr4\n\texit ;;\n    DRS?6000:unix:4.0:6*)\n\techo sparc-icl-nx6\n\texit ;;\n    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)\n\tcase `/usr/bin/uname -p` in\n\t    sparc) echo sparc-icl-nx7; exit ;;\n\tesac ;;\n    s390x:SunOS:*:*)\n\techo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4H:SunOS:5.*:*)\n\techo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)\n\techo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)\n\techo i386-pc-auroraux${UNAME_RELEASE}\n\texit ;;\n    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)\n\teval $set_cc_for_build\n\tSUN_ARCH=i386\n\t# If there is a compiler, see if it is configured for 64-bit objects.\n\t# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.\n\t# This test works for both compilers.\n\tif [ \"$CC_FOR_BUILD\" != no_compiler_found ]; then\n\t    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \\\n\t\t(CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\tgrep IS_64BIT_ARCH >/dev/null\n\t    then\n\t\tSUN_ARCH=x86_64\n\t    fi\n\tfi\n\techo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:6*:*)\n\t# According to config.sub, this is the proper way to canonicalize\n\t# SunOS6.  Hard to guess exactly what SunOS6 will be like, but\n\t# it's likely to be more like Solaris than SunOS4.\n\techo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    sun4*:SunOS:*:*)\n\tcase \"`/usr/bin/arch -k`\" in\n\t    Series*|S4*)\n\t\tUNAME_RELEASE=`uname -v`\n\t\t;;\n\tesac\n\t# Japanese Language versions have a version number like `4.1.3-JL'.\n\techo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`\n\texit ;;\n    sun3*:SunOS:*:*)\n\techo m68k-sun-sunos${UNAME_RELEASE}\n\texit ;;\n    sun*:*:4.2BSD:*)\n\tUNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`\n\ttest \"x${UNAME_RELEASE}\" = x && UNAME_RELEASE=3\n\tcase \"`/bin/arch`\" in\n\t    sun3)\n\t\techo m68k-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\t    sun4)\n\t\techo sparc-sun-sunos${UNAME_RELEASE}\n\t\t;;\n\tesac\n\texit ;;\n    aushp:SunOS:*:*)\n\techo sparc-auspex-sunos${UNAME_RELEASE}\n\texit ;;\n    # The situation for MiNT is a little confusing.  The machine name\n    # can be virtually everything (everything which is not\n    # \"atarist\" or \"atariste\" at least should have a processor\n    # > m68000).  The system name ranges from \"MiNT\" over \"FreeMiNT\"\n    # to the lowercase version \"mint\" (or \"freemint\").  Finally\n    # the system name \"TOS\" denotes a system which is actually not\n    # MiNT.  But MiNT is downward compatible to TOS, so this should\n    # be no problem.\n    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)\n\techo m68k-atari-mint${UNAME_RELEASE}\n\texit ;;\n    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)\n\techo m68k-milan-mint${UNAME_RELEASE}\n\texit ;;\n    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)\n\techo m68k-hades-mint${UNAME_RELEASE}\n\texit ;;\n    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)\n\techo m68k-unknown-mint${UNAME_RELEASE}\n\texit ;;\n    m68k:machten:*:*)\n\techo m68k-apple-machten${UNAME_RELEASE}\n\texit ;;\n    powerpc:machten:*:*)\n\techo powerpc-apple-machten${UNAME_RELEASE}\n\texit ;;\n    RISC*:Mach:*:*)\n\techo mips-dec-mach_bsd4.3\n\texit ;;\n    RISC*:ULTRIX:*:*)\n\techo mips-dec-ultrix${UNAME_RELEASE}\n\texit ;;\n    VAX*:ULTRIX*:*:*)\n\techo vax-dec-ultrix${UNAME_RELEASE}\n\texit ;;\n    2020:CLIX:*:* | 2430:CLIX:*:*)\n\techo clipper-intergraph-clix${UNAME_RELEASE}\n\texit ;;\n    mips:*:*:UMIPS | mips:*:*:RISCos)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n#ifdef __cplusplus\n#include <stdio.h>  /* for printf() prototype */\n\tint main (int argc, char *argv[]) {\n#else\n\tint main (argc, argv) int argc; char *argv[]; {\n#endif\n\t#if defined (host_mips) && defined (MIPSEB)\n\t#if defined (SYSTYPE_SYSV)\n\t  printf (\"mips-mips-riscos%ssysv\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_SVR4)\n\t  printf (\"mips-mips-riscos%ssvr4\\n\", argv[1]); exit (0);\n\t#endif\n\t#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)\n\t  printf (\"mips-mips-riscos%sbsd\\n\", argv[1]); exit (0);\n\t#endif\n\t#endif\n\t  exit (-1);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c &&\n\t  dummyarg=`echo \"${UNAME_RELEASE}\" | sed -n 's/\\([0-9]*\\).*/\\1/p'` &&\n\t  SYSTEM_NAME=`$dummy $dummyarg` &&\n\t    { echo \"$SYSTEM_NAME\"; exit; }\n\techo mips-mips-riscos${UNAME_RELEASE}\n\texit ;;\n    Motorola:PowerMAX_OS:*:*)\n\techo powerpc-motorola-powermax\n\texit ;;\n    Motorola:*:4.3:PL8-*)\n\techo powerpc-harris-powermax\n\texit ;;\n    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)\n\techo powerpc-harris-powermax\n\texit ;;\n    Night_Hawk:Power_UNIX:*:*)\n\techo powerpc-harris-powerunix\n\texit ;;\n    m88k:CX/UX:7*:*)\n\techo m88k-harris-cxux7\n\texit ;;\n    m88k:*:4*:R4*)\n\techo m88k-motorola-sysv4\n\texit ;;\n    m88k:*:3*:R3*)\n\techo m88k-motorola-sysv3\n\texit ;;\n    AViiON:dgux:*:*)\n\t# DG/UX returns AViiON for all architectures\n\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n\tif [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]\n\tthen\n\t    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \\\n\t       [ ${TARGET_BINARY_INTERFACE}x = x ]\n\t    then\n\t\techo m88k-dg-dgux${UNAME_RELEASE}\n\t    else\n\t\techo m88k-dg-dguxbcs${UNAME_RELEASE}\n\t    fi\n\telse\n\t    echo i586-dg-dgux${UNAME_RELEASE}\n\tfi\n\texit ;;\n    M88*:DolphinOS:*:*)\t# DolphinOS (SVR3)\n\techo m88k-dolphin-sysv3\n\texit ;;\n    M88*:*:R3*:*)\n\t# Delta 88k system running SVR3\n\techo m88k-motorola-sysv3\n\texit ;;\n    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)\n\techo m88k-tektronix-sysv3\n\texit ;;\n    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)\n\techo m68k-tektronix-bsd\n\texit ;;\n    *:IRIX*:*:*)\n\techo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`\n\texit ;;\n    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.\n\techo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id\n\texit ;;               # Note that: echo \"'`uname -s`'\" gives 'AIX '\n    i*86:AIX:*:*)\n\techo i386-ibm-aix\n\texit ;;\n    ia64:AIX:*:*)\n\tif [ -x /usr/bin/oslevel ] ; then\n\t\tIBM_REV=`/usr/bin/oslevel`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${UNAME_MACHINE}-ibm-aix${IBM_REV}\n\texit ;;\n    *:AIX:2:3)\n\tif grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\teval $set_cc_for_build\n\t\tsed 's/^\t\t//' << EOF >$dummy.c\n\t\t#include <sys/systemcfg.h>\n\n\t\tmain()\n\t\t\t{\n\t\t\tif (!__power_pc())\n\t\t\t\texit(1);\n\t\t\tputs(\"powerpc-ibm-aix3.2.5\");\n\t\t\texit(0);\n\t\t\t}\nEOF\n\t\tif $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`\n\t\tthen\n\t\t\techo \"$SYSTEM_NAME\"\n\t\telse\n\t\t\techo rs6000-ibm-aix3.2.5\n\t\tfi\n\telif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then\n\t\techo rs6000-ibm-aix3.2.4\n\telse\n\t\techo rs6000-ibm-aix3.2\n\tfi\n\texit ;;\n    *:AIX:*:[4567])\n\tIBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`\n\tif /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then\n\t\tIBM_ARCH=rs6000\n\telse\n\t\tIBM_ARCH=powerpc\n\tfi\n\tif [ -x /usr/bin/lslpp ] ; then\n\t\tIBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |\n\t\t\t   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`\n\telse\n\t\tIBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}\n\tfi\n\techo ${IBM_ARCH}-ibm-aix${IBM_REV}\n\texit ;;\n    *:AIX:*:*)\n\techo rs6000-ibm-aix\n\texit ;;\n    ibmrt:4.4BSD:*|romp-ibm:BSD:*)\n\techo romp-ibm-bsd4.4\n\texit ;;\n    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and\n\techo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to\n\texit ;;                             # report: romp-ibm BSD 4.3\n    *:BOSX:*:*)\n\techo rs6000-bull-bosx\n\texit ;;\n    DPX/2?00:B.O.S.:*:*)\n\techo m68k-bull-sysv3\n\texit ;;\n    9000/[34]??:4.3bsd:1.*:*)\n\techo m68k-hp-bsd\n\texit ;;\n    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)\n\techo m68k-hp-bsd4.4\n\texit ;;\n    9000/[34678]??:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\tcase \"${UNAME_MACHINE}\" in\n\t    9000/31? )            HP_ARCH=m68000 ;;\n\t    9000/[34]?? )         HP_ARCH=m68k ;;\n\t    9000/[678][0-9][0-9])\n\t\tif [ -x /usr/bin/getconf ]; then\n\t\t    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`\n\t\t    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`\n\t\t    case \"${sc_cpu_version}\" in\n\t\t      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0\n\t\t      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1\n\t\t      532)                      # CPU_PA_RISC2_0\n\t\t\tcase \"${sc_kernel_bits}\" in\n\t\t\t  32) HP_ARCH=hppa2.0n ;;\n\t\t\t  64) HP_ARCH=hppa2.0w ;;\n\t\t\t  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20\n\t\t\tesac ;;\n\t\t    esac\n\t\tfi\n\t\tif [ \"${HP_ARCH}\" = \"\" ]; then\n\t\t    eval $set_cc_for_build\n\t\t    sed 's/^\t\t//' << EOF >$dummy.c\n\n\t\t#define _HPUX_SOURCE\n\t\t#include <stdlib.h>\n\t\t#include <unistd.h>\n\n\t\tint main ()\n\t\t{\n\t\t#if defined(_SC_KERNEL_BITS)\n\t\t    long bits = sysconf(_SC_KERNEL_BITS);\n\t\t#endif\n\t\t    long cpu  = sysconf (_SC_CPU_VERSION);\n\n\t\t    switch (cpu)\n\t\t\t{\n\t\t\tcase CPU_PA_RISC1_0: puts (\"hppa1.0\"); break;\n\t\t\tcase CPU_PA_RISC1_1: puts (\"hppa1.1\"); break;\n\t\t\tcase CPU_PA_RISC2_0:\n\t\t#if defined(_SC_KERNEL_BITS)\n\t\t\t    switch (bits)\n\t\t\t\t{\n\t\t\t\tcase 64: puts (\"hppa2.0w\"); break;\n\t\t\t\tcase 32: puts (\"hppa2.0n\"); break;\n\t\t\t\tdefault: puts (\"hppa2.0\"); break;\n\t\t\t\t} break;\n\t\t#else  /* !defined(_SC_KERNEL_BITS) */\n\t\t\t    puts (\"hppa2.0\"); break;\n\t\t#endif\n\t\t\tdefault: puts (\"hppa1.0\"); break;\n\t\t\t}\n\t\t    exit (0);\n\t\t}\nEOF\n\t\t    (CCOPTS=\"\" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`\n\t\t    test -z \"$HP_ARCH\" && HP_ARCH=hppa\n\t\tfi ;;\n\tesac\n\tif [ ${HP_ARCH} = hppa2.0w ]\n\tthen\n\t    eval $set_cc_for_build\n\n\t    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating\n\t    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler\n\t    # generating 64-bit code.  GNU and HP use different nomenclature:\n\t    #\n\t    # $ CC_FOR_BUILD=cc ./config.guess\n\t    # => hppa2.0w-hp-hpux11.23\n\t    # $ CC_FOR_BUILD=\"cc +DA2.0w\" ./config.guess\n\t    # => hppa64-hp-hpux11.23\n\n\t    if echo __LP64__ | (CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) |\n\t\tgrep -q __LP64__\n\t    then\n\t\tHP_ARCH=hppa2.0w\n\t    else\n\t\tHP_ARCH=hppa64\n\t    fi\n\tfi\n\techo ${HP_ARCH}-hp-hpux${HPUX_REV}\n\texit ;;\n    ia64:HP-UX:*:*)\n\tHPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`\n\techo ia64-hp-hpux${HPUX_REV}\n\texit ;;\n    3050*:HI-UX:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#include <unistd.h>\n\tint\n\tmain ()\n\t{\n\t  long cpu = sysconf (_SC_CPU_VERSION);\n\t  /* The order matters, because CPU_IS_HP_MC68K erroneously returns\n\t     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct\n\t     results, however.  */\n\t  if (CPU_IS_PA_RISC (cpu))\n\t    {\n\t      switch (cpu)\n\t\t{\n\t\t  case CPU_PA_RISC1_0: puts (\"hppa1.0-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC1_1: puts (\"hppa1.1-hitachi-hiuxwe2\"); break;\n\t\t  case CPU_PA_RISC2_0: puts (\"hppa2.0-hitachi-hiuxwe2\"); break;\n\t\t  default: puts (\"hppa-hitachi-hiuxwe2\"); break;\n\t\t}\n\t    }\n\t  else if (CPU_IS_HP_MC68K (cpu))\n\t    puts (\"m68k-hitachi-hiuxwe2\");\n\t  else puts (\"unknown-hitachi-hiuxwe2\");\n\t  exit (0);\n\t}\nEOF\n\t$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&\n\t\t{ echo \"$SYSTEM_NAME\"; exit; }\n\techo unknown-hitachi-hiuxwe2\n\texit ;;\n    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )\n\techo hppa1.1-hp-bsd\n\texit ;;\n    9000/8??:4.3bsd:*:*)\n\techo hppa1.0-hp-bsd\n\texit ;;\n    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)\n\techo hppa1.0-hp-mpeix\n\texit ;;\n    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )\n\techo hppa1.1-hp-osf\n\texit ;;\n    hp8??:OSF1:*:*)\n\techo hppa1.0-hp-osf\n\texit ;;\n    i*86:OSF1:*:*)\n\tif [ -x /usr/sbin/sysversion ] ; then\n\t    echo ${UNAME_MACHINE}-unknown-osf1mk\n\telse\n\t    echo ${UNAME_MACHINE}-unknown-osf1\n\tfi\n\texit ;;\n    parisc*:Lites*:*:*)\n\techo hppa1.1-hp-lites\n\texit ;;\n    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)\n\techo c1-convex-bsd\n\texit ;;\n    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)\n\tif getsysinfo -f scalar_acc\n\tthen echo c32-convex-bsd\n\telse echo c2-convex-bsd\n\tfi\n\texit ;;\n    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)\n\techo c34-convex-bsd\n\texit ;;\n    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)\n\techo c38-convex-bsd\n\texit ;;\n    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)\n\techo c4-convex-bsd\n\texit ;;\n    CRAY*Y-MP:*:*:*)\n\techo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*[A-Z]90:*:*:*)\n\techo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \\\n\t| sed -e 's/CRAY.*\\([A-Z]90\\)/\\1/' \\\n\t      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \\\n\t      -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*TS:*:*:*)\n\techo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*T3E:*:*:*)\n\techo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    CRAY*SV1:*:*:*)\n\techo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    *:UNICOS/mp:*:*)\n\techo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\\.[^.]*$/.X/'\n\texit ;;\n    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)\n\tFUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`\n\tFUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\\///'`\n\tFUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`\n\techo \"${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit ;;\n    5000:UNIX_System_V:4.*:*)\n\tFUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\\///'`\n\tFUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`\n\techo \"sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}\"\n\texit ;;\n    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\\ Embedded/OS:*:*)\n\techo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}\n\texit ;;\n    sparc*:BSD/OS:*:*)\n\techo sparc-unknown-bsdi${UNAME_RELEASE}\n\texit ;;\n    *:BSD/OS:*:*)\n\techo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}\n\texit ;;\n    *:FreeBSD:*:*)\n\tUNAME_PROCESSOR=`/usr/bin/uname -p`\n\tcase ${UNAME_PROCESSOR} in\n\t    amd64)\n\t\tUNAME_PROCESSOR=x86_64 ;;\n\t    i386)\n\t\tUNAME_PROCESSOR=i586 ;;\n\tesac\n\techo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`\n\texit ;;\n    i*:CYGWIN*:*)\n\techo ${UNAME_MACHINE}-pc-cygwin\n\texit ;;\n    *:MINGW64*:*)\n\techo ${UNAME_MACHINE}-pc-mingw64\n\texit ;;\n    *:MINGW*:*)\n\techo ${UNAME_MACHINE}-pc-mingw32\n\texit ;;\n    *:MSYS*:*)\n\techo ${UNAME_MACHINE}-pc-msys\n\texit ;;\n    i*:windows32*:*)\n\t# uname -m includes \"-pc\" on this system.\n\techo ${UNAME_MACHINE}-mingw32\n\texit ;;\n    i*:PW*:*)\n\techo ${UNAME_MACHINE}-pc-pw32\n\texit ;;\n    *:Interix*:*)\n\tcase ${UNAME_MACHINE} in\n\t    x86)\n\t\techo i586-pc-interix${UNAME_RELEASE}\n\t\texit ;;\n\t    authenticamd | genuineintel | EM64T)\n\t\techo x86_64-unknown-interix${UNAME_RELEASE}\n\t\texit ;;\n\t    IA64)\n\t\techo ia64-unknown-interix${UNAME_RELEASE}\n\t\texit ;;\n\tesac ;;\n    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)\n\techo i${UNAME_MACHINE}-pc-mks\n\texit ;;\n    8664:Windows_NT:*)\n\techo x86_64-pc-mks\n\texit ;;\n    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)\n\t# How do we know it's Interix rather than the generic POSIX subsystem?\n\t# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we\n\t# UNAME_MACHINE based on the output of uname instead of i386?\n\techo i586-pc-interix\n\texit ;;\n    i*:UWIN*:*)\n\techo ${UNAME_MACHINE}-pc-uwin\n\texit ;;\n    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)\n\techo x86_64-unknown-cygwin\n\texit ;;\n    p*:CYGWIN*:*)\n\techo powerpcle-unknown-cygwin\n\texit ;;\n    prep*:SunOS:5.*:*)\n\techo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`\n\texit ;;\n    *:GNU:*:*)\n\t# the GNU system\n\techo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`\n\texit ;;\n    *:GNU/*:*:*)\n\t# other systems with GNU libc and userland\n\techo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr \"[:upper:]\" \"[:lower:]\"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}\n\texit ;;\n    i*86:Minix:*:*)\n\techo ${UNAME_MACHINE}-pc-minix\n\texit ;;\n    aarch64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    aarch64_be:Linux:*:*)\n\tUNAME_MACHINE=aarch64_be\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    alpha:Linux:*:*)\n\tcase `sed -n '/^cpu model/s/^.*: \\(.*\\)/\\1/p' < /proc/cpuinfo` in\n\t  EV5)   UNAME_MACHINE=alphaev5 ;;\n\t  EV56)  UNAME_MACHINE=alphaev56 ;;\n\t  PCA56) UNAME_MACHINE=alphapca56 ;;\n\t  PCA57) UNAME_MACHINE=alphapca56 ;;\n\t  EV6)   UNAME_MACHINE=alphaev6 ;;\n\t  EV67)  UNAME_MACHINE=alphaev67 ;;\n\t  EV68*) UNAME_MACHINE=alphaev68 ;;\n\tesac\n\tobjdump --private-headers /bin/sh | grep -q ld.so.1\n\tif test \"$?\" = 0 ; then LIBC=gnulibc1 ; fi\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    arc:Linux:*:* | arceb:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    arm*:Linux:*:*)\n\teval $set_cc_for_build\n\tif echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t    | grep -q __ARM_EABI__\n\tthen\n\t    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\telse\n\t    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \\\n\t\t| grep -q __ARM_PCS_VFP\n\t    then\n\t\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi\n\t    else\n\t\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf\n\t    fi\n\tfi\n\texit ;;\n    avr32*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    cris:Linux:*:*)\n\techo ${UNAME_MACHINE}-axis-linux-${LIBC}\n\texit ;;\n    crisv32:Linux:*:*)\n\techo ${UNAME_MACHINE}-axis-linux-${LIBC}\n\texit ;;\n    e2k:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    frv:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    hexagon:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    i*86:Linux:*:*)\n\techo ${UNAME_MACHINE}-pc-linux-${LIBC}\n\texit ;;\n    ia64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    k1om:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    m32r*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    m68*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    mips:Linux:*:* | mips64:Linux:*:*)\n\teval $set_cc_for_build\n\tsed 's/^\t//' << EOF >$dummy.c\n\t#undef CPU\n\t#undef ${UNAME_MACHINE}\n\t#undef ${UNAME_MACHINE}el\n\t#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)\n\tCPU=${UNAME_MACHINE}el\n\t#else\n\t#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)\n\tCPU=${UNAME_MACHINE}\n\t#else\n\tCPU=\n\t#endif\n\t#endif\nEOF\n\teval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`\n\ttest x\"${CPU}\" != x && { echo \"${CPU}-unknown-linux-${LIBC}\"; exit; }\n\t;;\n    mips64el:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    openrisc*:Linux:*:*)\n\techo or1k-unknown-linux-${LIBC}\n\texit ;;\n    or32:Linux:*:* | or1k*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    padre:Linux:*:*)\n\techo sparc-unknown-linux-${LIBC}\n\texit ;;\n    parisc64:Linux:*:* | hppa64:Linux:*:*)\n\techo hppa64-unknown-linux-${LIBC}\n\texit ;;\n    parisc:Linux:*:* | hppa:Linux:*:*)\n\t# Look for CPU level\n\tcase `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in\n\t  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;\n\t  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;\n\t  *)    echo hppa-unknown-linux-${LIBC} ;;\n\tesac\n\texit ;;\n    ppc64:Linux:*:*)\n\techo powerpc64-unknown-linux-${LIBC}\n\texit ;;\n    ppc:Linux:*:*)\n\techo powerpc-unknown-linux-${LIBC}\n\texit ;;\n    ppc64le:Linux:*:*)\n\techo powerpc64le-unknown-linux-${LIBC}\n\texit ;;\n    ppcle:Linux:*:*)\n\techo powerpcle-unknown-linux-${LIBC}\n\texit ;;\n    riscv32:Linux:*:* | riscv64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    s390:Linux:*:* | s390x:Linux:*:*)\n\techo ${UNAME_MACHINE}-ibm-linux-${LIBC}\n\texit ;;\n    sh64*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    sh*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    sparc:Linux:*:* | sparc64:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    tile*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    vax:Linux:*:*)\n\techo ${UNAME_MACHINE}-dec-linux-${LIBC}\n\texit ;;\n    x86_64:Linux:*:*)\n\techo ${UNAME_MACHINE}-pc-linux-${LIBC}\n\texit ;;\n    xtensa*:Linux:*:*)\n\techo ${UNAME_MACHINE}-unknown-linux-${LIBC}\n\texit ;;\n    i*86:DYNIX/ptx:4*:*)\n\t# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.\n\t# earlier versions are messed up and put the nodename in both\n\t# sysname and nodename.\n\techo i386-sequent-sysv4\n\texit ;;\n    i*86:UNIX_SV:4.2MP:2.*)\n\t# Unixware is an offshoot of SVR4, but it has its own version\n\t# number series starting with 2...\n\t# I am not positive that other SVR4 systems won't match this,\n\t# I just have to hope.  -- rms.\n\t# Use sysv4.2uw... so that sysv4* matches it.\n\techo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}\n\texit ;;\n    i*86:OS/2:*:*)\n\t# If we were able to find `uname', then EMX Unix compatibility\n\t# is probably installed.\n\techo ${UNAME_MACHINE}-pc-os2-emx\n\texit ;;\n    i*86:XTS-300:*:STOP)\n\techo ${UNAME_MACHINE}-unknown-stop\n\texit ;;\n    i*86:atheos:*:*)\n\techo ${UNAME_MACHINE}-unknown-atheos\n\texit ;;\n    i*86:syllable:*:*)\n\techo ${UNAME_MACHINE}-pc-syllable\n\texit ;;\n    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)\n\techo i386-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    i*86:*DOS:*:*)\n\techo ${UNAME_MACHINE}-pc-msdosdjgpp\n\texit ;;\n    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)\n\tUNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\\/MP$//'`\n\tif grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then\n\t\techo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}\n\tfi\n\texit ;;\n    i*86:*:5:[678]*)\n\t# UnixWare 7.x, OpenUNIX and OpenServer 6.\n\tcase `/bin/uname -X | grep \"^Machine\"` in\n\t    *486*)\t     UNAME_MACHINE=i486 ;;\n\t    *Pentium)\t     UNAME_MACHINE=i586 ;;\n\t    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;\n\tesac\n\techo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}\n\texit ;;\n    i*86:*:3.2:*)\n\tif test -f /usr/options/cb.name; then\n\t\tUNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`\n\t\techo ${UNAME_MACHINE}-pc-isc$UNAME_REL\n\telif /bin/uname -X 2>/dev/null >/dev/null ; then\n\t\tUNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`\n\t\t(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486\n\t\t(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i586\n\t\t(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\t(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \\\n\t\t\t&& UNAME_MACHINE=i686\n\t\techo ${UNAME_MACHINE}-pc-sco$UNAME_REL\n\telse\n\t\techo ${UNAME_MACHINE}-pc-sysv32\n\tfi\n\texit ;;\n    pc:*:*:*)\n\t# Left here for compatibility:\n\t# uname -m prints for DJGPP always 'pc', but it prints nothing about\n\t# the processor, so we play safe by assuming i586.\n\t# Note: whatever this is, it MUST be the same as what config.sub\n\t# prints for the \"djgpp\" host, or else GDB configure will decide that\n\t# this is a cross-build.\n\techo i586-pc-msdosdjgpp\n\texit ;;\n    Intel:Mach:3*:*)\n\techo i386-pc-mach3\n\texit ;;\n    paragon:*:*:*)\n\techo i860-intel-osf1\n\texit ;;\n    i860:*:4.*:*) # i860-SVR4\n\tif grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then\n\t  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4\n\telse # Add other i860-SVR4 vendors below as they are discovered.\n\t  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4\n\tfi\n\texit ;;\n    mini*:CTIX:SYS*5:*)\n\t# \"miniframe\"\n\techo m68010-convergent-sysv\n\texit ;;\n    mc68k:UNIX:SYSTEM5:3.51m)\n\techo m68k-convergent-sysv\n\texit ;;\n    M680?0:D-NIX:5.3:*)\n\techo m68k-diab-dnix\n\texit ;;\n    M68*:*:R3V[5678]*:*)\n\ttest -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;\n    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)\n\tOS_REL=''\n\ttest -r /etc/.relid \\\n\t&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t  && { echo i486-ncr-sysv4; exit; } ;;\n    NCR*:*:4.2:* | MPRAS*:*:4.2:*)\n\tOS_REL='.3'\n\ttest -r /etc/.relid \\\n\t    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \\([0-9][0-9]\\).*/\\1/p' < /etc/.relid`\n\t/bin/uname -p 2>/dev/null | grep 86 >/dev/null \\\n\t    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \\\n\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }\n\t/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \\\n\t    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;\n    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)\n\techo m68k-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    mc68030:UNIX_System_V:4.*:*)\n\techo m68k-atari-sysv4\n\texit ;;\n    TSUNAMI:LynxOS:2.*:*)\n\techo sparc-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    rs6000:LynxOS:2.*:*)\n\techo rs6000-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)\n\techo powerpc-unknown-lynxos${UNAME_RELEASE}\n\texit ;;\n    SM[BE]S:UNIX_SV:*:*)\n\techo mips-dde-sysv${UNAME_RELEASE}\n\texit ;;\n    RM*:ReliantUNIX-*:*:*)\n\techo mips-sni-sysv4\n\texit ;;\n    RM*:SINIX-*:*:*)\n\techo mips-sni-sysv4\n\texit ;;\n    *:SINIX-*:*:*)\n\tif uname -p 2>/dev/null >/dev/null ; then\n\t\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\t\techo ${UNAME_MACHINE}-sni-sysv4\n\telse\n\t\techo ns32k-sni-sysv\n\tfi\n\texit ;;\n    PENTIUM:*:4.0*:*)\t# Unisys `ClearPath HMP IX 4000' SVR4/MP effort\n\t\t\t# says <Richard.M.Bartel@ccMail.Census.GOV>\n\techo i586-unisys-sysv4\n\texit ;;\n    *:UNIX_System_V:4*:FTX*)\n\t# From Gerald Hewes <hewes@openmarket.com>.\n\t# How about differentiating between stratus architectures? -djm\n\techo hppa1.1-stratus-sysv4\n\texit ;;\n    *:*:*:FTX*)\n\t# From seanf@swdc.stratus.com.\n\techo i860-stratus-sysv4\n\texit ;;\n    i*86:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo ${UNAME_MACHINE}-stratus-vos\n\texit ;;\n    *:VOS:*:*)\n\t# From Paul.Green@stratus.com.\n\techo hppa1.1-stratus-vos\n\texit ;;\n    mc68*:A/UX:*:*)\n\techo m68k-apple-aux${UNAME_RELEASE}\n\texit ;;\n    news*:NEWS-OS:6*:*)\n\techo mips-sony-newsos6\n\texit ;;\n    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)\n\tif [ -d /usr/nec ]; then\n\t\techo mips-nec-sysv${UNAME_RELEASE}\n\telse\n\t\techo mips-unknown-sysv${UNAME_RELEASE}\n\tfi\n\texit ;;\n    BeBox:BeOS:*:*)\t# BeOS running on hardware made by Be, PPC only.\n\techo powerpc-be-beos\n\texit ;;\n    BeMac:BeOS:*:*)\t# BeOS running on Mac or Mac clone, PPC only.\n\techo powerpc-apple-beos\n\texit ;;\n    BePC:BeOS:*:*)\t# BeOS running on Intel PC compatible.\n\techo i586-pc-beos\n\texit ;;\n    BePC:Haiku:*:*)\t# Haiku running on Intel PC compatible.\n\techo i586-pc-haiku\n\texit ;;\n    x86_64:Haiku:*:*)\n\techo x86_64-unknown-haiku\n\texit ;;\n    SX-4:SUPER-UX:*:*)\n\techo sx4-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-5:SUPER-UX:*:*)\n\techo sx5-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-6:SUPER-UX:*:*)\n\techo sx6-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-7:SUPER-UX:*:*)\n\techo sx7-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-8:SUPER-UX:*:*)\n\techo sx8-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-8R:SUPER-UX:*:*)\n\techo sx8r-nec-superux${UNAME_RELEASE}\n\texit ;;\n    SX-ACE:SUPER-UX:*:*)\n\techo sxace-nec-superux${UNAME_RELEASE}\n\texit ;;\n    Power*:Rhapsody:*:*)\n\techo powerpc-apple-rhapsody${UNAME_RELEASE}\n\texit ;;\n    *:Rhapsody:*:*)\n\techo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}\n\texit ;;\n    *:Darwin:*:*)\n\tUNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown\n\teval $set_cc_for_build\n\tif test \"$UNAME_PROCESSOR\" = unknown ; then\n\t    UNAME_PROCESSOR=powerpc\n\tfi\n\tif test `echo \"$UNAME_RELEASE\" | sed -e 's/\\..*//'` -le 10 ; then\n\t    if [ \"$CC_FOR_BUILD\" != no_compiler_found ]; then\n\t\tif (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \\\n\t\t    (CCOPTS=\"\" $CC_FOR_BUILD -E - 2>/dev/null) | \\\n\t\t    grep IS_64BIT_ARCH >/dev/null\n\t\tthen\n\t\t    case $UNAME_PROCESSOR in\n\t\t\ti386) UNAME_PROCESSOR=x86_64 ;;\n\t\t\tpowerpc) UNAME_PROCESSOR=powerpc64 ;;\n\t\t    esac\n\t\tfi\n\t    fi\n\telif test \"$UNAME_PROCESSOR\" = i386 ; then\n\t    # Avoid executing cc on OS X 10.9, as it ships with a stub\n\t    # that puts up a graphical alert prompting to install\n\t    # developer tools.  Any system running Mac OS X 10.7 or\n\t    # later (Darwin 11 and later) is required to have a 64-bit\n\t    # processor. This is not true of the ARM version of Darwin\n\t    # that Apple uses in portable devices.\n\t    UNAME_PROCESSOR=x86_64\n\tfi\n\techo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}\n\texit ;;\n    *:procnto*:*:* | *:QNX:[0123456789]*:*)\n\tUNAME_PROCESSOR=`uname -p`\n\tif test \"$UNAME_PROCESSOR\" = x86; then\n\t\tUNAME_PROCESSOR=i386\n\t\tUNAME_MACHINE=pc\n\tfi\n\techo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}\n\texit ;;\n    *:QNX:*:4*)\n\techo i386-pc-qnx\n\texit ;;\n    NEO-?:NONSTOP_KERNEL:*:*)\n\techo neo-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSE-*:NONSTOP_KERNEL:*:*)\n\techo nse-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSR-?:NONSTOP_KERNEL:*:*)\n\techo nsr-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    NSX-?:NONSTOP_KERNEL:*:*)\n\techo nsx-tandem-nsk${UNAME_RELEASE}\n\texit ;;\n    *:NonStop-UX:*:*)\n\techo mips-compaq-nonstopux\n\texit ;;\n    BS2000:POSIX*:*:*)\n\techo bs2000-siemens-sysv\n\texit ;;\n    DS/*:UNIX_System_V:*:*)\n\techo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}\n\texit ;;\n    *:Plan9:*:*)\n\t# \"uname -m\" is not consistent, so use $cputype instead. 386\n\t# is converted to i386 for consistency with other x86\n\t# operating systems.\n\tif test \"$cputype\" = 386; then\n\t    UNAME_MACHINE=i386\n\telse\n\t    UNAME_MACHINE=\"$cputype\"\n\tfi\n\techo ${UNAME_MACHINE}-unknown-plan9\n\texit ;;\n    *:TOPS-10:*:*)\n\techo pdp10-unknown-tops10\n\texit ;;\n    *:TENEX:*:*)\n\techo pdp10-unknown-tenex\n\texit ;;\n    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)\n\techo pdp10-dec-tops20\n\texit ;;\n    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)\n\techo pdp10-xkl-tops20\n\texit ;;\n    *:TOPS-20:*:*)\n\techo pdp10-unknown-tops20\n\texit ;;\n    *:ITS:*:*)\n\techo pdp10-unknown-its\n\texit ;;\n    SEI:*:*:SEIUX)\n\techo mips-sei-seiux${UNAME_RELEASE}\n\texit ;;\n    *:DragonFly:*:*)\n\techo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`\n\texit ;;\n    *:*VMS:*:*)\n\tUNAME_MACHINE=`(uname -p) 2>/dev/null`\n\tcase \"${UNAME_MACHINE}\" in\n\t    A*) echo alpha-dec-vms ; exit ;;\n\t    I*) echo ia64-dec-vms ; exit ;;\n\t    V*) echo vax-dec-vms ; exit ;;\n\tesac ;;\n    *:XENIX:*:SysV)\n\techo i386-pc-xenix\n\texit ;;\n    i*86:skyos:*:*)\n\techo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`\n\texit ;;\n    i*86:rdos:*:*)\n\techo ${UNAME_MACHINE}-pc-rdos\n\texit ;;\n    i*86:AROS:*:*)\n\techo ${UNAME_MACHINE}-pc-aros\n\texit ;;\n    x86_64:VMkernel:*:*)\n\techo ${UNAME_MACHINE}-unknown-esx\n\texit ;;\n    amd64:Isilon\\ OneFS:*:*)\n\techo x86_64-unknown-onefs\n\texit ;;\nesac\n\ncat >&2 <<EOF\n$0: unable to guess system type\n\nThis script (version $timestamp), has failed to recognize the\noperating system you are using. If your script is old, overwrite\nconfig.guess and config.sub with the latest versions from:\n\n  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess\nand\n  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub\n\nIf $0 has already been updated, send the following data and any\ninformation you think might be pertinent to config-patches@gnu.org to\nprovide the necessary information to handle your system.\n\nconfig.guess timestamp = $timestamp\n\nuname -m = `(uname -m) 2>/dev/null || echo unknown`\nuname -r = `(uname -r) 2>/dev/null || echo unknown`\nuname -s = `(uname -s) 2>/dev/null || echo unknown`\nuname -v = `(uname -v) 2>/dev/null || echo unknown`\n\n/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`\n/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`\n\nhostinfo               = `(hostinfo) 2>/dev/null`\n/bin/universe          = `(/bin/universe) 2>/dev/null`\n/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`\n/bin/arch              = `(/bin/arch) 2>/dev/null`\n/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`\n/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`\n\nUNAME_MACHINE = ${UNAME_MACHINE}\nUNAME_RELEASE = ${UNAME_RELEASE}\nUNAME_SYSTEM  = ${UNAME_SYSTEM}\nUNAME_VERSION = ${UNAME_VERSION}\nEOF\n\nexit 1\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "depends/config.site.in",
    "content": "depends_prefix=\"`dirname ${ac_site_file}`/..\"\n\ncross_compiling=maybe\nhost_alias=@HOST@\nac_tool_prefix=${host_alias}-\n\nif test -z $with_boost; then\n  with_boost=$depends_prefix\nfi\nif test -z $with_qt_plugindir; then\n  with_qt_plugindir=$depends_prefix/plugins\nfi\nif test -z $with_qt_translationdir; then\n  with_qt_translationdir=$depends_prefix/translations\nfi\nif test -z $with_qt_bindir && test -z \"@no_qt@\"; then\n  with_qt_bindir=$depends_prefix/native/bin\nfi\nif test -z $with_protoc_bindir && test -z \"@no_qt@\"; then\n  with_protoc_bindir=$depends_prefix/native/bin\nfi\n\n\nif test -z $enable_wallet && test -n \"@no_wallet@\"; then\n  enable_wallet=no\nfi\n\nif test -z $with_miniupnpc && test -n \"@no_upnp@\"; then\n  with_miniupnpc=no\nfi\n\nif test -z $with_gui && test -n \"@no_qt@\"; then\n  with_gui=no\nfi\n\nif test x@host_os@ = xdarwin; then\n  BREW=no\n  PORT=no\nfi\n\nif test x@host_os@ = xmingw32; then\n  if test -z $with_qt_incdir; then\n    with_qt_incdir=$depends_prefix/include\n  fi\n  if test -z $with_qt_libdir; then\n    with_qt_libdir=$depends_prefix/lib\n  fi\nfi\n\nPATH=$depends_prefix/native/bin:$PATH\nPKG_CONFIG=\"`which pkg-config` --static\"\n\n# These two need to remain exported because pkg-config does not see them\n# otherwise. That means they must be unexported at the end of configure.ac to\n# avoid ruining the cache. Sigh.\nexport PKG_CONFIG_PATH=$depends_prefix/share/pkgconfig:$depends_prefix/lib/pkgconfig\nif test -z \"@allow_host_packages@\"; then\n  export PKGCONFIG_LIBDIR=\nfi\n\nCPPFLAGS=\"-I$depends_prefix/include/ $CPPFLAGS\"\nLDFLAGS=\"-L$depends_prefix/lib $LDFLAGS\"\n\nCC=\"@CC@\"\nCXX=\"@CXX@\"\nOBJC=\"${CC}\"\nCCACHE=$depends_prefix/native/bin/ccache\nPYTHONPATH=$depends_prefix/native/lib/python/dist-packages:$PYTHONPATH\n\nif test -n \"@AR@\"; then\n  AR=@AR@\n  ac_cv_path_ac_pt_AR=${AR}\nfi\n\nif test -n \"@RANLIB@\"; then\n  RANLIB=@RANLIB@\n  ac_cv_path_ac_pt_RANLIB=${RANLIB}\nfi\n\nif test -n \"@NM@\"; then\n  NM=@NM@\n  ac_cv_path_ac_pt_NM=${NM}\nfi\n\nif test -n \"@debug@\"; then\n  enable_reduce_exports=no\nfi\n\nif test -n \"@CFLAGS@\"; then\n  CFLAGS=\"@CFLAGS@ $CFLAGS\"\nfi\nif test -n \"@CXXFLAGS@\"; then\n  CXXFLAGS=\"@CXXFLAGS@ $CXXFLAGS\"\nfi\nif test -n \"@CPPFLAGS@\"; then\n  CPPFLAGS=\"@CPPFLAGS@ $CPPFLAGS\"\nfi\nif test -n \"@LDFLAGS@\"; then\n  LDFLAGS=\"@LDFLAGS@ $LDFLAGS\"\nfi\n"
  },
  {
    "path": "depends/config.sub",
    "content": "#! /bin/sh\n# Configuration validation subroutine script.\n#   Copyright 1992-2017 Free Software Foundation, Inc.\n\ntimestamp='2017-04-02'\n\n# This file is free software; you can redistribute it and/or modify it\n# under the terms of the GNU General Public License as published by\n# the Free Software Foundation; either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful, but\n# WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program; if not, see <http://www.gnu.org/licenses/>.\n#\n# As a special exception to the GNU General Public License, if you\n# distribute this file as part of a program that contains a\n# configuration script generated by Autoconf, you may include it under\n# the same distribution terms that you use for the rest of that\n# program.  This Exception is an additional permission under section 7\n# of the GNU General Public License, version 3 (\"GPLv3\").\n\n\n# Please send patches to <config-patches@gnu.org>.\n#\n# Configuration subroutine to validate and canonicalize a configuration type.\n# Supply the specified configuration type as an argument.\n# If it is invalid, we print an error message on stderr and exit with code 1.\n# Otherwise, we print the canonical config type on stdout and succeed.\n\n# You can get the latest version of this script from:\n# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub\n\n# This file is supposed to be the same for all GNU packages\n# and recognize all the CPU types, system types and aliases\n# that are meaningful with *any* GNU software.\n# Each package is responsible for reporting which valid configurations\n# it does not support.  The user should be able to distinguish\n# a failure to support a valid configuration from a meaningless\n# configuration.\n\n# The goal of this file is to map all the various variations of a given\n# machine specification into a single specification in the form:\n#\tCPU_TYPE-MANUFACTURER-OPERATING_SYSTEM\n# or in some cases, the newer four-part form:\n#\tCPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM\n# It is wrong to echo any other type of specification.\n\nme=`echo \"$0\" | sed -e 's,.*/,,'`\n\nusage=\"\\\nUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS\n\nCanonicalize a configuration name.\n\nOperation modes:\n  -h, --help         print this help, then exit\n  -t, --time-stamp   print date of last modification, then exit\n  -v, --version      print version number, then exit\n\nReport bugs and patches to <config-patches@gnu.org>.\"\n\nversion=\"\\\nGNU config.sub ($timestamp)\n\nCopyright 1992-2017 Free Software Foundation, Inc.\n\nThis is free software; see the source for copying conditions.  There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\"\n\nhelp=\"\nTry \\`$me --help' for more information.\"\n\n# Parse command line\nwhile test $# -gt 0 ; do\n  case $1 in\n    --time-stamp | --time* | -t )\n       echo \"$timestamp\" ; exit ;;\n    --version | -v )\n       echo \"$version\" ; exit ;;\n    --help | --h* | -h )\n       echo \"$usage\"; exit ;;\n    -- )     # Stop option processing\n       shift; break ;;\n    - )\t# Use stdin as input.\n       break ;;\n    -* )\n       echo \"$me: invalid option $1$help\"\n       exit 1 ;;\n\n    *local*)\n       # First pass through any local machine types.\n       echo $1\n       exit ;;\n\n    * )\n       break ;;\n  esac\ndone\n\ncase $# in\n 0) echo \"$me: missing argument$help\" >&2\n    exit 1;;\n 1) ;;\n *) echo \"$me: too many arguments$help\" >&2\n    exit 1;;\nesac\n\n# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).\n# Here we must recognize all the valid KERNEL-OS combinations.\nmaybe_os=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\2/'`\ncase $maybe_os in\n  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \\\n  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \\\n  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \\\n  kopensolaris*-gnu* | cloudabi*-eabi* | \\\n  storm-chaos* | os2-emx* | rtmk-nova*)\n    os=-$maybe_os\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`\n    ;;\n  android-linux)\n    os=-linux-android\n    basic_machine=`echo $1 | sed 's/^\\(.*\\)-\\([^-]*-[^-]*\\)$/\\1/'`-unknown\n    ;;\n  *)\n    basic_machine=`echo $1 | sed 's/-[^-]*$//'`\n    if [ $basic_machine != $1 ]\n    then os=`echo $1 | sed 's/.*-/-/'`\n    else os=; fi\n    ;;\nesac\n\n### Let's recognize common machines as not being operating systems so\n### that things like config.sub decstation-3100 work.  We also\n### recognize some manufacturers as not being operating systems, so we\n### can provide default operating systems below.\ncase $os in\n\t-sun*os*)\n\t\t# Prevent following clause from handling this invalid input.\n\t\t;;\n\t-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \\\n\t-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \\\n\t-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \\\n\t-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\\\n\t-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \\\n\t-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \\\n\t-apple | -axis | -knuth | -cray | -microblaze*)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-bluegene*)\n\t\tos=-cnk\n\t\t;;\n\t-sim | -cisco | -oki | -wec | -winbond)\n\t\tos=\n\t\tbasic_machine=$1\n\t\t;;\n\t-scout)\n\t\t;;\n\t-wrs)\n\t\tos=-vxworks\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusos*)\n\t\tos=-chorusos\n\t\tbasic_machine=$1\n\t\t;;\n\t-chorusrdb)\n\t\tos=-chorusrdb\n\t\tbasic_machine=$1\n\t\t;;\n\t-hiux*)\n\t\tos=-hiuxwe2\n\t\t;;\n\t-sco6)\n\t\tos=-sco5v6\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco5)\n\t\tos=-sco3.2v5\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco4)\n\t\tos=-sco3.2v4\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2.[4-9]*)\n\t\tos=`echo $os | sed -e 's/sco3.2./sco3.2v/'`\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco3.2v[4-9]*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco5v6*)\n\t\t# Don't forget version if it is 3.2v4 or newer.\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-sco*)\n\t\tos=-sco3.2v2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-udk*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-isc)\n\t\tos=-isc2.2\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-clix*)\n\t\tbasic_machine=clipper-intergraph\n\t\t;;\n\t-isc*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`\n\t\t;;\n\t-lynx*178)\n\t\tos=-lynxos178\n\t\t;;\n\t-lynx*5)\n\t\tos=-lynxos5\n\t\t;;\n\t-lynx*)\n\t\tos=-lynxos\n\t\t;;\n\t-ptx*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`\n\t\t;;\n\t-windowsnt*)\n\t\tos=`echo $os | sed -e 's/windowsnt/winnt/'`\n\t\t;;\n\t-psos*)\n\t\tos=-psos\n\t\t;;\n\t-mint | -mint[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\nesac\n\n# Decode aliases for certain CPU-COMPANY combinations.\ncase $basic_machine in\n\t# Recognize the basic CPU types without company name.\n\t# Some are omitted here because they have special meanings below.\n\t1750a | 580 \\\n\t| a29k \\\n\t| aarch64 | aarch64_be \\\n\t| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \\\n\t| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \\\n\t| am33_2.0 \\\n\t| arc | arceb \\\n\t| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \\\n\t| avr | avr32 \\\n\t| ba \\\n\t| be32 | be64 \\\n\t| bfin \\\n\t| c4x | c8051 | clipper \\\n\t| d10v | d30v | dlx | dsp16xx \\\n\t| e2k | epiphany \\\n\t| fido | fr30 | frv | ft32 \\\n\t| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \\\n\t| hexagon \\\n\t| i370 | i860 | i960 | ia16 | ia64 \\\n\t| ip2k | iq2000 \\\n\t| k1om \\\n\t| le32 | le64 \\\n\t| lm32 \\\n\t| m32c | m32r | m32rle | m68000 | m68k | m88k \\\n\t| maxq | mb | microblaze | microblazeel | mcore | mep | metag \\\n\t| mips | mipsbe | mipseb | mipsel | mipsle \\\n\t| mips16 \\\n\t| mips64 | mips64el \\\n\t| mips64octeon | mips64octeonel \\\n\t| mips64orion | mips64orionel \\\n\t| mips64r5900 | mips64r5900el \\\n\t| mips64vr | mips64vrel \\\n\t| mips64vr4100 | mips64vr4100el \\\n\t| mips64vr4300 | mips64vr4300el \\\n\t| mips64vr5000 | mips64vr5000el \\\n\t| mips64vr5900 | mips64vr5900el \\\n\t| mipsisa32 | mipsisa32el \\\n\t| mipsisa32r2 | mipsisa32r2el \\\n\t| mipsisa32r6 | mipsisa32r6el \\\n\t| mipsisa64 | mipsisa64el \\\n\t| mipsisa64r2 | mipsisa64r2el \\\n\t| mipsisa64r6 | mipsisa64r6el \\\n\t| mipsisa64sb1 | mipsisa64sb1el \\\n\t| mipsisa64sr71k | mipsisa64sr71kel \\\n\t| mipsr5900 | mipsr5900el \\\n\t| mipstx39 | mipstx39el \\\n\t| mn10200 | mn10300 \\\n\t| moxie \\\n\t| mt \\\n\t| msp430 \\\n\t| nds32 | nds32le | nds32be \\\n\t| nios | nios2 | nios2eb | nios2el \\\n\t| ns16k | ns32k \\\n\t| open8 | or1k | or1knd | or32 \\\n\t| pdp10 | pdp11 | pj | pjl \\\n\t| powerpc | powerpc64 | powerpc64le | powerpcle \\\n\t| pru \\\n\t| pyramid \\\n\t| riscv32 | riscv64 \\\n\t| rl78 | rx \\\n\t| score \\\n\t| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \\\n\t| sh64 | sh64le \\\n\t| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \\\n\t| sparcv8 | sparcv9 | sparcv9b | sparcv9v \\\n\t| spu \\\n\t| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \\\n\t| ubicom32 \\\n\t| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \\\n\t| visium \\\n\t| wasm32 \\\n\t| we32k \\\n\t| x86 | xc16x | xstormy16 | xtensa \\\n\t| z8k | z80)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\tc54x)\n\t\tbasic_machine=tic54x-unknown\n\t\t;;\n\tc55x)\n\t\tbasic_machine=tic55x-unknown\n\t\t;;\n\tc6x)\n\t\tbasic_machine=tic6x-unknown\n\t\t;;\n\tleon|leon[3-9])\n\t\tbasic_machine=sparc-$basic_machine\n\t\t;;\n\tm6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\tm88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)\n\t\t;;\n\tms1)\n\t\tbasic_machine=mt-unknown\n\t\t;;\n\n\tstrongarm | thumb | xscale)\n\t\tbasic_machine=arm-unknown\n\t\t;;\n\txgate)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-none\n\t\t;;\n\txscaleeb)\n\t\tbasic_machine=armeb-unknown\n\t\t;;\n\n\txscaleel)\n\t\tbasic_machine=armel-unknown\n\t\t;;\n\n\t# We use `pc' rather than `unknown'\n\t# because (1) that's what they normally are, and\n\t# (2) the word \"unknown\" tends to confuse beginning users.\n\ti*86 | x86_64)\n\t  basic_machine=$basic_machine-pc\n\t  ;;\n\t# Object if more than one company name word.\n\t*-*-*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\n\t# Recognize the basic CPU types with company name.\n\t580-* \\\n\t| a29k-* \\\n\t| aarch64-* | aarch64_be-* \\\n\t| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \\\n\t| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \\\n\t| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \\\n\t| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \\\n\t| avr-* | avr32-* \\\n\t| ba-* \\\n\t| be32-* | be64-* \\\n\t| bfin-* | bs2000-* \\\n\t| c[123]* | c30-* | [cjt]90-* | c4x-* \\\n\t| c8051-* | clipper-* | craynv-* | cydra-* \\\n\t| d10v-* | d30v-* | dlx-* \\\n\t| e2k-* | elxsi-* \\\n\t| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \\\n\t| h8300-* | h8500-* \\\n\t| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \\\n\t| hexagon-* \\\n\t| i*86-* | i860-* | i960-* | ia16-* | ia64-* \\\n\t| ip2k-* | iq2000-* \\\n\t| k1om-* \\\n\t| le32-* | le64-* \\\n\t| lm32-* \\\n\t| m32c-* | m32r-* | m32rle-* \\\n\t| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \\\n\t| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \\\n\t| microblaze-* | microblazeel-* \\\n\t| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \\\n\t| mips16-* \\\n\t| mips64-* | mips64el-* \\\n\t| mips64octeon-* | mips64octeonel-* \\\n\t| mips64orion-* | mips64orionel-* \\\n\t| mips64r5900-* | mips64r5900el-* \\\n\t| mips64vr-* | mips64vrel-* \\\n\t| mips64vr4100-* | mips64vr4100el-* \\\n\t| mips64vr4300-* | mips64vr4300el-* \\\n\t| mips64vr5000-* | mips64vr5000el-* \\\n\t| mips64vr5900-* | mips64vr5900el-* \\\n\t| mipsisa32-* | mipsisa32el-* \\\n\t| mipsisa32r2-* | mipsisa32r2el-* \\\n\t| mipsisa32r6-* | mipsisa32r6el-* \\\n\t| mipsisa64-* | mipsisa64el-* \\\n\t| mipsisa64r2-* | mipsisa64r2el-* \\\n\t| mipsisa64r6-* | mipsisa64r6el-* \\\n\t| mipsisa64sb1-* | mipsisa64sb1el-* \\\n\t| mipsisa64sr71k-* | mipsisa64sr71kel-* \\\n\t| mipsr5900-* | mipsr5900el-* \\\n\t| mipstx39-* | mipstx39el-* \\\n\t| mmix-* \\\n\t| mt-* \\\n\t| msp430-* \\\n\t| nds32-* | nds32le-* | nds32be-* \\\n\t| nios-* | nios2-* | nios2eb-* | nios2el-* \\\n\t| none-* | np1-* | ns16k-* | ns32k-* \\\n\t| open8-* \\\n\t| or1k*-* \\\n\t| orion-* \\\n\t| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \\\n\t| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \\\n\t| pru-* \\\n\t| pyramid-* \\\n\t| riscv32-* | riscv64-* \\\n\t| rl78-* | romp-* | rs6000-* | rx-* \\\n\t| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \\\n\t| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \\\n\t| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \\\n\t| sparclite-* \\\n\t| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \\\n\t| tahoe-* \\\n\t| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \\\n\t| tile*-* \\\n\t| tron-* \\\n\t| ubicom32-* \\\n\t| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \\\n\t| vax-* \\\n\t| visium-* \\\n\t| wasm32-* \\\n\t| we32k-* \\\n\t| x86-* | x86_64-* | xc16x-* | xps100-* \\\n\t| xstormy16-* | xtensa*-* \\\n\t| ymp-* \\\n\t| z8k-* | z80-*)\n\t\t;;\n\t# Recognize the basic CPU types without company name, with glob match.\n\txtensa*)\n\t\tbasic_machine=$basic_machine-unknown\n\t\t;;\n\t# Recognize the various machine names and aliases which stand\n\t# for a CPU type and a company and sometimes even an OS.\n\t386bsd)\n\t\tbasic_machine=i386-unknown\n\t\tos=-bsd\n\t\t;;\n\t3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)\n\t\tbasic_machine=m68000-att\n\t\t;;\n\t3b*)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\ta29khif)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tabacus)\n\t\tbasic_machine=abacus-unknown\n\t\t;;\n\tadobe68k)\n\t\tbasic_machine=m68010-adobe\n\t\tos=-scout\n\t\t;;\n\talliant | fx80)\n\t\tbasic_machine=fx80-alliant\n\t\t;;\n\taltos | altos3068)\n\t\tbasic_machine=m68k-altos\n\t\t;;\n\tam29k)\n\t\tbasic_machine=a29k-none\n\t\tos=-bsd\n\t\t;;\n\tamd64)\n\t\tbasic_machine=x86_64-pc\n\t\t;;\n\tamd64-*)\n\t\tbasic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tamdahl)\n\t\tbasic_machine=580-amdahl\n\t\tos=-sysv\n\t\t;;\n\tamiga | amiga-*)\n\t\tbasic_machine=m68k-unknown\n\t\t;;\n\tamigaos | amigados)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-amigaos\n\t\t;;\n\tamigaunix | amix)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-sysv4\n\t\t;;\n\tapollo68)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-sysv\n\t\t;;\n\tapollo68bsd)\n\t\tbasic_machine=m68k-apollo\n\t\tos=-bsd\n\t\t;;\n\taros)\n\t\tbasic_machine=i386-pc\n\t\tos=-aros\n\t\t;;\n\tasmjs)\n\t\tbasic_machine=asmjs-unknown\n\t\t;;\n\taux)\n\t\tbasic_machine=m68k-apple\n\t\tos=-aux\n\t\t;;\n\tbalance)\n\t\tbasic_machine=ns32k-sequent\n\t\tos=-dynix\n\t\t;;\n\tblackfin)\n\t\tbasic_machine=bfin-unknown\n\t\tos=-linux\n\t\t;;\n\tblackfin-*)\n\t\tbasic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tbluegene*)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-cnk\n\t\t;;\n\tc54x-*)\n\t\tbasic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc55x-*)\n\t\tbasic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc6x-*)\n\t\tbasic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tc90)\n\t\tbasic_machine=c90-cray\n\t\tos=-unicos\n\t\t;;\n\tcegcc)\n\t\tbasic_machine=arm-unknown\n\t\tos=-cegcc\n\t\t;;\n\tconvex-c1)\n\t\tbasic_machine=c1-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c2)\n\t\tbasic_machine=c2-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c32)\n\t\tbasic_machine=c32-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c34)\n\t\tbasic_machine=c34-convex\n\t\tos=-bsd\n\t\t;;\n\tconvex-c38)\n\t\tbasic_machine=c38-convex\n\t\tos=-bsd\n\t\t;;\n\tcray | j90)\n\t\tbasic_machine=j90-cray\n\t\tos=-unicos\n\t\t;;\n\tcraynv)\n\t\tbasic_machine=craynv-cray\n\t\tos=-unicosmp\n\t\t;;\n\tcr16 | cr16-*)\n\t\tbasic_machine=cr16-unknown\n\t\tos=-elf\n\t\t;;\n\tcrds | unos)\n\t\tbasic_machine=m68k-crds\n\t\t;;\n\tcrisv32 | crisv32-* | etraxfs*)\n\t\tbasic_machine=crisv32-axis\n\t\t;;\n\tcris | cris-* | etrax*)\n\t\tbasic_machine=cris-axis\n\t\t;;\n\tcrx)\n\t\tbasic_machine=crx-unknown\n\t\tos=-elf\n\t\t;;\n\tda30 | da30-*)\n\t\tbasic_machine=m68k-da30\n\t\t;;\n\tdecstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)\n\t\tbasic_machine=mips-dec\n\t\t;;\n\tdecsystem10* | dec10*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops10\n\t\t;;\n\tdecsystem20* | dec20*)\n\t\tbasic_machine=pdp10-dec\n\t\tos=-tops20\n\t\t;;\n\tdelta | 3300 | motorola-3300 | motorola-delta \\\n\t      | 3300-motorola | delta-motorola)\n\t\tbasic_machine=m68k-motorola\n\t\t;;\n\tdelta88)\n\t\tbasic_machine=m88k-motorola\n\t\tos=-sysv3\n\t\t;;\n\tdicos)\n\t\tbasic_machine=i686-pc\n\t\tos=-dicos\n\t\t;;\n\tdjgpp)\n\t\tbasic_machine=i586-pc\n\t\tos=-msdosdjgpp\n\t\t;;\n\tdpx20 | dpx20-*)\n\t\tbasic_machine=rs6000-bull\n\t\tos=-bosx\n\t\t;;\n\tdpx2* | dpx2*-bull)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv3\n\t\t;;\n\te500v[12])\n\t\tbasic_machine=powerpc-unknown\n\t\tos=$os\"spe\"\n\t\t;;\n\te500v[12]-*)\n\t\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=$os\"spe\"\n\t\t;;\n\tebmon29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-ebmon\n\t\t;;\n\telxsi)\n\t\tbasic_machine=elxsi-elxsi\n\t\tos=-bsd\n\t\t;;\n\tencore | umax | mmax)\n\t\tbasic_machine=ns32k-encore\n\t\t;;\n\tes1800 | OSE68k | ose68k | ose | OSE)\n\t\tbasic_machine=m68k-ericsson\n\t\tos=-ose\n\t\t;;\n\tfx2800)\n\t\tbasic_machine=i860-alliant\n\t\t;;\n\tgenix)\n\t\tbasic_machine=ns32k-ns\n\t\t;;\n\tgmicro)\n\t\tbasic_machine=tron-gmicro\n\t\tos=-sysv\n\t\t;;\n\tgo32)\n\t\tbasic_machine=i386-pc\n\t\tos=-go32\n\t\t;;\n\th3050r* | hiux*)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\th8300hms)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-hms\n\t\t;;\n\th8300xray)\n\t\tbasic_machine=h8300-hitachi\n\t\tos=-xray\n\t\t;;\n\th8500hms)\n\t\tbasic_machine=h8500-hitachi\n\t\tos=-hms\n\t\t;;\n\tharris)\n\t\tbasic_machine=m88k-harris\n\t\tos=-sysv3\n\t\t;;\n\thp300-*)\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp300bsd)\n\t\tbasic_machine=m68k-hp\n\t\tos=-bsd\n\t\t;;\n\thp300hpux)\n\t\tbasic_machine=m68k-hp\n\t\tos=-hpux\n\t\t;;\n\thp3k9[0-9][0-9] | hp9[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k2[0-9][0-9] | hp9k31[0-9])\n\t\tbasic_machine=m68000-hp\n\t\t;;\n\thp9k3[2-9][0-9])\n\t\tbasic_machine=m68k-hp\n\t\t;;\n\thp9k6[0-9][0-9] | hp6[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thp9k7[0-79][0-9] | hp7[0-79][0-9])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k78[0-9] | hp78[0-9])\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)\n\t\t# FIXME: really hppa2.0-hp\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][13679] | hp8[0-9][13679])\n\t\tbasic_machine=hppa1.1-hp\n\t\t;;\n\thp9k8[0-9][0-9] | hp8[0-9][0-9])\n\t\tbasic_machine=hppa1.0-hp\n\t\t;;\n\thppa-next)\n\t\tos=-nextstep3\n\t\t;;\n\thppaosf)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-osf\n\t\t;;\n\thppro)\n\t\tbasic_machine=hppa1.1-hp\n\t\tos=-proelf\n\t\t;;\n\ti370-ibm* | ibm*)\n\t\tbasic_machine=i370-ibm\n\t\t;;\n\ti*86v32)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv32\n\t\t;;\n\ti*86v4*)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv4\n\t\t;;\n\ti*86v)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-sysv\n\t\t;;\n\ti*86sol2)\n\t\tbasic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`\n\t\tos=-solaris2\n\t\t;;\n\ti386mach)\n\t\tbasic_machine=i386-mach\n\t\tos=-mach\n\t\t;;\n\ti386-vsta | vsta)\n\t\tbasic_machine=i386-unknown\n\t\tos=-vsta\n\t\t;;\n\tiris | iris4d)\n\t\tbasic_machine=mips-sgi\n\t\tcase $os in\n\t\t    -irix*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-irix4\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tisi68 | isi)\n\t\tbasic_machine=m68k-isi\n\t\tos=-sysv\n\t\t;;\n\tleon-*|leon[3-9]-*)\n\t\tbasic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`\n\t\t;;\n\tm68knommu)\n\t\tbasic_machine=m68k-unknown\n\t\tos=-linux\n\t\t;;\n\tm68knommu-*)\n\t\tbasic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tm88k-omron*)\n\t\tbasic_machine=m88k-omron\n\t\t;;\n\tmagnum | m3230)\n\t\tbasic_machine=mips-mips\n\t\tos=-sysv\n\t\t;;\n\tmerlin)\n\t\tbasic_machine=ns32k-utek\n\t\tos=-sysv\n\t\t;;\n\tmicroblaze*)\n\t\tbasic_machine=microblaze-xilinx\n\t\t;;\n\tmingw64)\n\t\tbasic_machine=x86_64-pc\n\t\tos=-mingw64\n\t\t;;\n\tmingw32)\n\t\tbasic_machine=i686-pc\n\t\tos=-mingw32\n\t\t;;\n\tmingw32ce)\n\t\tbasic_machine=arm-unknown\n\t\tos=-mingw32ce\n\t\t;;\n\tminiframe)\n\t\tbasic_machine=m68000-convergent\n\t\t;;\n\t*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)\n\t\tbasic_machine=m68k-atari\n\t\tos=-mint\n\t\t;;\n\tmips3*-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`\n\t\t;;\n\tmips3*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown\n\t\t;;\n\tmonitor)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\tmorphos)\n\t\tbasic_machine=powerpc-unknown\n\t\tos=-morphos\n\t\t;;\n\tmoxiebox)\n\t\tbasic_machine=moxie-unknown\n\t\tos=-moxiebox\n\t\t;;\n\tmsdos)\n\t\tbasic_machine=i386-pc\n\t\tos=-msdos\n\t\t;;\n\tms1-*)\n\t\tbasic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`\n\t\t;;\n\tmsys)\n\t\tbasic_machine=i686-pc\n\t\tos=-msys\n\t\t;;\n\tmvs)\n\t\tbasic_machine=i370-ibm\n\t\tos=-mvs\n\t\t;;\n\tnacl)\n\t\tbasic_machine=le32-unknown\n\t\tos=-nacl\n\t\t;;\n\tncr3000)\n\t\tbasic_machine=i486-ncr\n\t\tos=-sysv4\n\t\t;;\n\tnetbsd386)\n\t\tbasic_machine=i386-unknown\n\t\tos=-netbsd\n\t\t;;\n\tnetwinder)\n\t\tbasic_machine=armv4l-rebel\n\t\tos=-linux\n\t\t;;\n\tnews | news700 | news800 | news900)\n\t\tbasic_machine=m68k-sony\n\t\tos=-newsos\n\t\t;;\n\tnews1000)\n\t\tbasic_machine=m68030-sony\n\t\tos=-newsos\n\t\t;;\n\tnews-3600 | risc-news)\n\t\tbasic_machine=mips-sony\n\t\tos=-newsos\n\t\t;;\n\tnecv70)\n\t\tbasic_machine=v70-nec\n\t\tos=-sysv\n\t\t;;\n\tnext | m*-next )\n\t\tbasic_machine=m68k-next\n\t\tcase $os in\n\t\t    -nextstep* )\n\t\t\t;;\n\t\t    -ns2*)\n\t\t      os=-nextstep2\n\t\t\t;;\n\t\t    *)\n\t\t      os=-nextstep3\n\t\t\t;;\n\t\tesac\n\t\t;;\n\tnh3000)\n\t\tbasic_machine=m68k-harris\n\t\tos=-cxux\n\t\t;;\n\tnh[45]000)\n\t\tbasic_machine=m88k-harris\n\t\tos=-cxux\n\t\t;;\n\tnindy960)\n\t\tbasic_machine=i960-intel\n\t\tos=-nindy\n\t\t;;\n\tmon960)\n\t\tbasic_machine=i960-intel\n\t\tos=-mon960\n\t\t;;\n\tnonstopux)\n\t\tbasic_machine=mips-compaq\n\t\tos=-nonstopux\n\t\t;;\n\tnp1)\n\t\tbasic_machine=np1-gould\n\t\t;;\n\tneo-tandem)\n\t\tbasic_machine=neo-tandem\n\t\t;;\n\tnse-tandem)\n\t\tbasic_machine=nse-tandem\n\t\t;;\n\tnsr-tandem)\n\t\tbasic_machine=nsr-tandem\n\t\t;;\n\tnsx-tandem)\n\t\tbasic_machine=nsx-tandem\n\t\t;;\n\top50n-* | op60c-*)\n\t\tbasic_machine=hppa1.1-oki\n\t\tos=-proelf\n\t\t;;\n\topenrisc | openrisc-*)\n\t\tbasic_machine=or32-unknown\n\t\t;;\n\tos400)\n\t\tbasic_machine=powerpc-ibm\n\t\tos=-os400\n\t\t;;\n\tOSE68000 | ose68000)\n\t\tbasic_machine=m68000-ericsson\n\t\tos=-ose\n\t\t;;\n\tos68k)\n\t\tbasic_machine=m68k-none\n\t\tos=-os68k\n\t\t;;\n\tpa-hitachi)\n\t\tbasic_machine=hppa1.1-hitachi\n\t\tos=-hiuxwe2\n\t\t;;\n\tparagon)\n\t\tbasic_machine=i860-intel\n\t\tos=-osf\n\t\t;;\n\tparisc)\n\t\tbasic_machine=hppa-unknown\n\t\tos=-linux\n\t\t;;\n\tparisc-*)\n\t\tbasic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\tos=-linux\n\t\t;;\n\tpbd)\n\t\tbasic_machine=sparc-tti\n\t\t;;\n\tpbb)\n\t\tbasic_machine=m68k-tti\n\t\t;;\n\tpc532 | pc532-*)\n\t\tbasic_machine=ns32k-pc532\n\t\t;;\n\tpc98)\n\t\tbasic_machine=i386-pc\n\t\t;;\n\tpc98-*)\n\t\tbasic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium | p5 | k5 | k6 | nexgen | viac3)\n\t\tbasic_machine=i586-pc\n\t\t;;\n\tpentiumpro | p6 | 6x86 | athlon | athlon_*)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentiumii | pentium2 | pentiumiii | pentium3)\n\t\tbasic_machine=i686-pc\n\t\t;;\n\tpentium4)\n\t\tbasic_machine=i786-pc\n\t\t;;\n\tpentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)\n\t\tbasic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumpro-* | p6-* | 6x86-* | athlon-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)\n\t\tbasic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpentium4-*)\n\t\tbasic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tpn)\n\t\tbasic_machine=pn-gould\n\t\t;;\n\tpower)\tbasic_machine=power-ibm\n\t\t;;\n\tppc | ppcbe)\tbasic_machine=powerpc-unknown\n\t\t;;\n\tppc-* | ppcbe-*)\n\t\tbasic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppcle | powerpclittle)\n\t\tbasic_machine=powerpcle-unknown\n\t\t;;\n\tppcle-* | powerpclittle-*)\n\t\tbasic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64)\tbasic_machine=powerpc64-unknown\n\t\t;;\n\tppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tppc64le | powerpc64little)\n\t\tbasic_machine=powerpc64le-unknown\n\t\t;;\n\tppc64le-* | powerpc64little-*)\n\t\tbasic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tps2)\n\t\tbasic_machine=i386-ibm\n\t\t;;\n\tpw32)\n\t\tbasic_machine=i586-unknown\n\t\tos=-pw32\n\t\t;;\n\trdos | rdos64)\n\t\tbasic_machine=x86_64-pc\n\t\tos=-rdos\n\t\t;;\n\trdos32)\n\t\tbasic_machine=i386-pc\n\t\tos=-rdos\n\t\t;;\n\trom68k)\n\t\tbasic_machine=m68k-rom68k\n\t\tos=-coff\n\t\t;;\n\trm[46]00)\n\t\tbasic_machine=mips-siemens\n\t\t;;\n\trtpc | rtpc-*)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\ts390 | s390-*)\n\t\tbasic_machine=s390-ibm\n\t\t;;\n\ts390x | s390x-*)\n\t\tbasic_machine=s390x-ibm\n\t\t;;\n\tsa29200)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tsb1)\n\t\tbasic_machine=mipsisa64sb1-unknown\n\t\t;;\n\tsb1el)\n\t\tbasic_machine=mipsisa64sb1el-unknown\n\t\t;;\n\tsde)\n\t\tbasic_machine=mipsisa32-sde\n\t\tos=-elf\n\t\t;;\n\tsei)\n\t\tbasic_machine=mips-sei\n\t\tos=-seiux\n\t\t;;\n\tsequent)\n\t\tbasic_machine=i386-sequent\n\t\t;;\n\tsh)\n\t\tbasic_machine=sh-hitachi\n\t\tos=-hms\n\t\t;;\n\tsh5el)\n\t\tbasic_machine=sh5le-unknown\n\t\t;;\n\tsh64)\n\t\tbasic_machine=sh64-unknown\n\t\t;;\n\tsparclite-wrs | simso-wrs)\n\t\tbasic_machine=sparclite-wrs\n\t\tos=-vxworks\n\t\t;;\n\tsps7)\n\t\tbasic_machine=m68k-bull\n\t\tos=-sysv2\n\t\t;;\n\tspur)\n\t\tbasic_machine=spur-unknown\n\t\t;;\n\tst2000)\n\t\tbasic_machine=m68k-tandem\n\t\t;;\n\tstratus)\n\t\tbasic_machine=i860-stratus\n\t\tos=-sysv4\n\t\t;;\n\tstrongarm-* | thumb-*)\n\t\tbasic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`\n\t\t;;\n\tsun2)\n\t\tbasic_machine=m68000-sun\n\t\t;;\n\tsun2os3)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun2os4)\n\t\tbasic_machine=m68000-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun3os3)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun3os4)\n\t\tbasic_machine=m68k-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4os3)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos3\n\t\t;;\n\tsun4os4)\n\t\tbasic_machine=sparc-sun\n\t\tos=-sunos4\n\t\t;;\n\tsun4sol2)\n\t\tbasic_machine=sparc-sun\n\t\tos=-solaris2\n\t\t;;\n\tsun3 | sun3-*)\n\t\tbasic_machine=m68k-sun\n\t\t;;\n\tsun4)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tsun386 | sun386i | roadrunner)\n\t\tbasic_machine=i386-sun\n\t\t;;\n\tsv1)\n\t\tbasic_machine=sv1-cray\n\t\tos=-unicos\n\t\t;;\n\tsymmetry)\n\t\tbasic_machine=i386-sequent\n\t\tos=-dynix\n\t\t;;\n\tt3e)\n\t\tbasic_machine=alphaev5-cray\n\t\tos=-unicos\n\t\t;;\n\tt90)\n\t\tbasic_machine=t90-cray\n\t\tos=-unicos\n\t\t;;\n\ttile*)\n\t\tbasic_machine=$basic_machine-unknown\n\t\tos=-linux-gnu\n\t\t;;\n\ttx39)\n\t\tbasic_machine=mipstx39-unknown\n\t\t;;\n\ttx39el)\n\t\tbasic_machine=mipstx39el-unknown\n\t\t;;\n\ttoad1)\n\t\tbasic_machine=pdp10-xkl\n\t\tos=-tops20\n\t\t;;\n\ttower | tower-32)\n\t\tbasic_machine=m68k-ncr\n\t\t;;\n\ttpf)\n\t\tbasic_machine=s390x-ibm\n\t\tos=-tpf\n\t\t;;\n\tudi29k)\n\t\tbasic_machine=a29k-amd\n\t\tos=-udi\n\t\t;;\n\tultra3)\n\t\tbasic_machine=a29k-nyu\n\t\tos=-sym1\n\t\t;;\n\tv810 | necv810)\n\t\tbasic_machine=v810-nec\n\t\tos=-none\n\t\t;;\n\tvaxv)\n\t\tbasic_machine=vax-dec\n\t\tos=-sysv\n\t\t;;\n\tvms)\n\t\tbasic_machine=vax-dec\n\t\tos=-vms\n\t\t;;\n\tvpp*|vx|vx-*)\n\t\tbasic_machine=f301-fujitsu\n\t\t;;\n\tvxworks960)\n\t\tbasic_machine=i960-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks68)\n\t\tbasic_machine=m68k-wrs\n\t\tos=-vxworks\n\t\t;;\n\tvxworks29k)\n\t\tbasic_machine=a29k-wrs\n\t\tos=-vxworks\n\t\t;;\n\twasm32)\n\t\tbasic_machine=wasm32-unknown\n\t\t;;\n\tw65*)\n\t\tbasic_machine=w65-wdc\n\t\tos=-none\n\t\t;;\n\tw89k-*)\n\t\tbasic_machine=hppa1.1-winbond\n\t\tos=-proelf\n\t\t;;\n\txbox)\n\t\tbasic_machine=i686-pc\n\t\tos=-mingw32\n\t\t;;\n\txps | xps100)\n\t\tbasic_machine=xps100-honeywell\n\t\t;;\n\txscale-* | xscalee[bl]-*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`\n\t\t;;\n\tymp)\n\t\tbasic_machine=ymp-cray\n\t\tos=-unicos\n\t\t;;\n\tz8k-*-coff)\n\t\tbasic_machine=z8k-unknown\n\t\tos=-sim\n\t\t;;\n\tz80-*-coff)\n\t\tbasic_machine=z80-unknown\n\t\tos=-sim\n\t\t;;\n\tnone)\n\t\tbasic_machine=none-none\n\t\tos=-none\n\t\t;;\n\n# Here we handle the default manufacturer of certain CPU types.  It is in\n# some cases the only manufacturer, in others, it is the most popular.\n\tw89k)\n\t\tbasic_machine=hppa1.1-winbond\n\t\t;;\n\top50n)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\top60c)\n\t\tbasic_machine=hppa1.1-oki\n\t\t;;\n\tromp)\n\t\tbasic_machine=romp-ibm\n\t\t;;\n\tmmix)\n\t\tbasic_machine=mmix-knuth\n\t\t;;\n\trs6000)\n\t\tbasic_machine=rs6000-ibm\n\t\t;;\n\tvax)\n\t\tbasic_machine=vax-dec\n\t\t;;\n\tpdp10)\n\t\t# there are many clones, so DEC is not a safe bet\n\t\tbasic_machine=pdp10-unknown\n\t\t;;\n\tpdp11)\n\t\tbasic_machine=pdp11-dec\n\t\t;;\n\twe32k)\n\t\tbasic_machine=we32k-att\n\t\t;;\n\tsh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)\n\t\tbasic_machine=sh-unknown\n\t\t;;\n\tsparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)\n\t\tbasic_machine=sparc-sun\n\t\t;;\n\tcydra)\n\t\tbasic_machine=cydra-cydrome\n\t\t;;\n\torion)\n\t\tbasic_machine=orion-highlevel\n\t\t;;\n\torion105)\n\t\tbasic_machine=clipper-highlevel\n\t\t;;\n\tmac | mpw | mac-mpw)\n\t\tbasic_machine=m68k-apple\n\t\t;;\n\tpmac | pmac-mpw)\n\t\tbasic_machine=powerpc-apple\n\t\t;;\n\t*-unknown)\n\t\t# Make sure to match an already-canonicalized machine name.\n\t\t;;\n\t*)\n\t\techo Invalid configuration \\`$1\\': machine \\`$basic_machine\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\n\n# Here we canonicalize certain aliases for manufacturers.\ncase $basic_machine in\n\t*-digital*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`\n\t\t;;\n\t*-commodore*)\n\t\tbasic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`\n\t\t;;\n\t*)\n\t\t;;\nesac\n\n# Decode manufacturer-specific aliases for certain operating systems.\n\nif [ x\"$os\" != x\"\" ]\nthen\ncase $os in\n\t# First match some system type aliases\n\t# that might get confused with valid system types.\n\t# -solaris* is a basic system type, with this one exception.\n\t-auroraux)\n\t\tos=-auroraux\n\t\t;;\n\t-solaris1 | -solaris1.*)\n\t\tos=`echo $os | sed -e 's|solaris1|sunos4|'`\n\t\t;;\n\t-solaris)\n\t\tos=-solaris2\n\t\t;;\n\t-svr4*)\n\t\tos=-sysv4\n\t\t;;\n\t-unixware*)\n\t\tos=-sysv4.2uw\n\t\t;;\n\t-gnu/linux*)\n\t\tos=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`\n\t\t;;\n\t# First accept the basic system types.\n\t# The portable systems comes first.\n\t# Each alternative MUST END IN A *, to match a version number.\n\t# -sysv* is not here because it comes later, after sysvr4.\n\t-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \\\n\t      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\\\n\t      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \\\n\t      | -sym* | -kopensolaris* | -plan9* \\\n\t      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \\\n\t      | -aos* | -aros* | -cloudabi* | -sortix* \\\n\t      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \\\n\t      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \\\n\t      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \\\n\t      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \\\n\t      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \\\n\t      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \\\n\t      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \\\n\t      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \\\n\t      | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \\\n\t      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \\\n\t      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \\\n\t      | -linux-newlib* | -linux-musl* | -linux-uclibc* \\\n\t      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \\\n\t      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \\\n\t      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \\\n\t      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \\\n\t      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \\\n\t      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \\\n\t      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \\\n\t      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \\\n\t      | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)\n\t# Remember, each alternative MUST END IN *, to match a version number.\n\t\t;;\n\t-qnx*)\n\t\tcase $basic_machine in\n\t\t    x86-* | i*86-*)\n\t\t\t;;\n\t\t    *)\n\t\t\tos=-nto$os\n\t\t\t;;\n\t\tesac\n\t\t;;\n\t-nto-qnx*)\n\t\t;;\n\t-nto*)\n\t\tos=`echo $os | sed -e 's|nto|nto-qnx|'`\n\t\t;;\n\t-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \\\n\t      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \\\n\t      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)\n\t\t;;\n\t-mac*)\n\t\tos=`echo $os | sed -e 's|mac|macos|'`\n\t\t;;\n\t-linux-dietlibc)\n\t\tos=-linux-dietlibc\n\t\t;;\n\t-linux*)\n\t\tos=`echo $os | sed -e 's|linux|linux-gnu|'`\n\t\t;;\n\t-sunos5*)\n\t\tos=`echo $os | sed -e 's|sunos5|solaris2|'`\n\t\t;;\n\t-sunos6*)\n\t\tos=`echo $os | sed -e 's|sunos6|solaris3|'`\n\t\t;;\n\t-opened*)\n\t\tos=-openedition\n\t\t;;\n\t-os400*)\n\t\tos=-os400\n\t\t;;\n\t-wince*)\n\t\tos=-wince\n\t\t;;\n\t-osfrose*)\n\t\tos=-osfrose\n\t\t;;\n\t-osf*)\n\t\tos=-osf\n\t\t;;\n\t-utek*)\n\t\tos=-bsd\n\t\t;;\n\t-dynix*)\n\t\tos=-bsd\n\t\t;;\n\t-acis*)\n\t\tos=-aos\n\t\t;;\n\t-atheos*)\n\t\tos=-atheos\n\t\t;;\n\t-syllable*)\n\t\tos=-syllable\n\t\t;;\n\t-386bsd)\n\t\tos=-bsd\n\t\t;;\n\t-ctix* | -uts*)\n\t\tos=-sysv\n\t\t;;\n\t-nova*)\n\t\tos=-rtmk-nova\n\t\t;;\n\t-ns2 )\n\t\tos=-nextstep2\n\t\t;;\n\t-nsk*)\n\t\tos=-nsk\n\t\t;;\n\t# Preserve the version number of sinix5.\n\t-sinix5.*)\n\t\tos=`echo $os | sed -e 's|sinix|sysv|'`\n\t\t;;\n\t-sinix*)\n\t\tos=-sysv4\n\t\t;;\n\t-tpf*)\n\t\tos=-tpf\n\t\t;;\n\t-triton*)\n\t\tos=-sysv3\n\t\t;;\n\t-oss*)\n\t\tos=-sysv3\n\t\t;;\n\t-svr4)\n\t\tos=-sysv4\n\t\t;;\n\t-svr3)\n\t\tos=-sysv3\n\t\t;;\n\t-sysvr4)\n\t\tos=-sysv4\n\t\t;;\n\t# This must come after -sysvr4.\n\t-sysv*)\n\t\t;;\n\t-ose*)\n\t\tos=-ose\n\t\t;;\n\t-es1800*)\n\t\tos=-ose\n\t\t;;\n\t-xenix)\n\t\tos=-xenix\n\t\t;;\n\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\tos=-mint\n\t\t;;\n\t-aros*)\n\t\tos=-aros\n\t\t;;\n\t-zvmoe)\n\t\tos=-zvmoe\n\t\t;;\n\t-dicos*)\n\t\tos=-dicos\n\t\t;;\n\t-nacl*)\n\t\t;;\n\t-ios)\n\t\t;;\n\t-none)\n\t\t;;\n\t*)\n\t\t# Get rid of the `-' at the beginning of $os.\n\t\tos=`echo $os | sed 's/[^-]*-//'`\n\t\techo Invalid configuration \\`$1\\': system \\`$os\\' not recognized 1>&2\n\t\texit 1\n\t\t;;\nesac\nelse\n\n# Here we handle the default operating systems that come with various machines.\n# The value should be what the vendor currently ships out the door with their\n# machine or put another way, the most popular os provided with the machine.\n\n# Note that if you're going to try to match \"-MANUFACTURER\" here (say,\n# \"-sun\"), then you have to tell the case statement up towards the top\n# that MANUFACTURER isn't an operating system.  Otherwise, code above\n# will signal an error saying that MANUFACTURER isn't an operating\n# system, and we'll never get to this point.\n\ncase $basic_machine in\n\tscore-*)\n\t\tos=-elf\n\t\t;;\n\tspu-*)\n\t\tos=-elf\n\t\t;;\n\t*-acorn)\n\t\tos=-riscix1.2\n\t\t;;\n\tarm*-rebel)\n\t\tos=-linux\n\t\t;;\n\tarm*-semi)\n\t\tos=-aout\n\t\t;;\n\tc4x-* | tic4x-*)\n\t\tos=-coff\n\t\t;;\n\tc8051-*)\n\t\tos=-elf\n\t\t;;\n\thexagon-*)\n\t\tos=-elf\n\t\t;;\n\ttic54x-*)\n\t\tos=-coff\n\t\t;;\n\ttic55x-*)\n\t\tos=-coff\n\t\t;;\n\ttic6x-*)\n\t\tos=-coff\n\t\t;;\n\t# This must come before the *-dec entry.\n\tpdp10-*)\n\t\tos=-tops20\n\t\t;;\n\tpdp11-*)\n\t\tos=-none\n\t\t;;\n\t*-dec | vax-*)\n\t\tos=-ultrix4.2\n\t\t;;\n\tm68*-apollo)\n\t\tos=-domain\n\t\t;;\n\ti386-sun)\n\t\tos=-sunos4.0.2\n\t\t;;\n\tm68000-sun)\n\t\tos=-sunos3\n\t\t;;\n\tm68*-cisco)\n\t\tos=-aout\n\t\t;;\n\tmep-*)\n\t\tos=-elf\n\t\t;;\n\tmips*-cisco)\n\t\tos=-elf\n\t\t;;\n\tmips*-*)\n\t\tos=-elf\n\t\t;;\n\tor32-*)\n\t\tos=-coff\n\t\t;;\n\t*-tti)\t# must be before sparc entry or we get the wrong os.\n\t\tos=-sysv3\n\t\t;;\n\tsparc-* | *-sun)\n\t\tos=-sunos4.1.1\n\t\t;;\n\tpru-*)\n\t\tos=-elf\n\t\t;;\n\t*-be)\n\t\tos=-beos\n\t\t;;\n\t*-haiku)\n\t\tos=-haiku\n\t\t;;\n\t*-ibm)\n\t\tos=-aix\n\t\t;;\n\t*-knuth)\n\t\tos=-mmixware\n\t\t;;\n\t*-wec)\n\t\tos=-proelf\n\t\t;;\n\t*-winbond)\n\t\tos=-proelf\n\t\t;;\n\t*-oki)\n\t\tos=-proelf\n\t\t;;\n\t*-hp)\n\t\tos=-hpux\n\t\t;;\n\t*-hitachi)\n\t\tos=-hiux\n\t\t;;\n\ti860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)\n\t\tos=-sysv\n\t\t;;\n\t*-cbm)\n\t\tos=-amigaos\n\t\t;;\n\t*-dg)\n\t\tos=-dgux\n\t\t;;\n\t*-dolphin)\n\t\tos=-sysv3\n\t\t;;\n\tm68k-ccur)\n\t\tos=-rtu\n\t\t;;\n\tm88k-omron*)\n\t\tos=-luna\n\t\t;;\n\t*-next )\n\t\tos=-nextstep\n\t\t;;\n\t*-sequent)\n\t\tos=-ptx\n\t\t;;\n\t*-crds)\n\t\tos=-unos\n\t\t;;\n\t*-ns)\n\t\tos=-genix\n\t\t;;\n\ti370-*)\n\t\tos=-mvs\n\t\t;;\n\t*-next)\n\t\tos=-nextstep3\n\t\t;;\n\t*-gould)\n\t\tos=-sysv\n\t\t;;\n\t*-highlevel)\n\t\tos=-bsd\n\t\t;;\n\t*-encore)\n\t\tos=-bsd\n\t\t;;\n\t*-sgi)\n\t\tos=-irix\n\t\t;;\n\t*-siemens)\n\t\tos=-sysv4\n\t\t;;\n\t*-masscomp)\n\t\tos=-rtu\n\t\t;;\n\tf30[01]-fujitsu | f700-fujitsu)\n\t\tos=-uxpv\n\t\t;;\n\t*-rom68k)\n\t\tos=-coff\n\t\t;;\n\t*-*bug)\n\t\tos=-coff\n\t\t;;\n\t*-apple)\n\t\tos=-macos\n\t\t;;\n\t*-atari*)\n\t\tos=-mint\n\t\t;;\n\t*)\n\t\tos=-none\n\t\t;;\nesac\nfi\n\n# Here we handle the case where we know the os, and the CPU type, but not the\n# manufacturer.  We pick the logical manufacturer.\nvendor=unknown\ncase $basic_machine in\n\t*-unknown)\n\t\tcase $os in\n\t\t\t-riscix*)\n\t\t\t\tvendor=acorn\n\t\t\t\t;;\n\t\t\t-sunos*)\n\t\t\t\tvendor=sun\n\t\t\t\t;;\n\t\t\t-cnk*|-aix*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-beos*)\n\t\t\t\tvendor=be\n\t\t\t\t;;\n\t\t\t-hpux*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-mpeix*)\n\t\t\t\tvendor=hp\n\t\t\t\t;;\n\t\t\t-hiux*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-unos*)\n\t\t\t\tvendor=crds\n\t\t\t\t;;\n\t\t\t-dgux*)\n\t\t\t\tvendor=dg\n\t\t\t\t;;\n\t\t\t-luna*)\n\t\t\t\tvendor=omron\n\t\t\t\t;;\n\t\t\t-genix*)\n\t\t\t\tvendor=ns\n\t\t\t\t;;\n\t\t\t-mvs* | -opened*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-os400*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-ptx*)\n\t\t\t\tvendor=sequent\n\t\t\t\t;;\n\t\t\t-tpf*)\n\t\t\t\tvendor=ibm\n\t\t\t\t;;\n\t\t\t-vxsim* | -vxworks* | -windiss*)\n\t\t\t\tvendor=wrs\n\t\t\t\t;;\n\t\t\t-aux*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-hms*)\n\t\t\t\tvendor=hitachi\n\t\t\t\t;;\n\t\t\t-mpw* | -macos*)\n\t\t\t\tvendor=apple\n\t\t\t\t;;\n\t\t\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n\t\t\t\tvendor=atari\n\t\t\t\t;;\n\t\t\t-vos*)\n\t\t\t\tvendor=stratus\n\t\t\t\t;;\n\t\tesac\n\t\tbasic_machine=`echo $basic_machine | sed \"s/unknown/$vendor/\"`\n\t\t;;\nesac\n\necho $basic_machine$os\nexit\n\n# Local variables:\n# eval: (add-hook 'write-file-hooks 'time-stamp)\n# time-stamp-start: \"timestamp='\"\n# time-stamp-format: \"%:y-%02m-%02d\"\n# time-stamp-end: \"'\"\n# End:\n"
  },
  {
    "path": "depends/description.md",
    "content": "This is a system of building and caching dependencies necessary for building Bitcoin. \nThere are several features that make it different from most similar systems:\n\n### It is designed to be builder and host agnostic\n\nIn theory, binaries for any target OS/architecture can be created, from a\nbuilder running any OS/architecture. In practice, build-side tools must be\nspecified when the defaults don't fit, and packages must be amended to work\non new hosts. For now, a build architecture of x86_64 is assumed, either on\nLinux or OSX.\n\n### No reliance on timestamps\n\nFile presence is used to determine what needs to be built. This makes the\nresults distributable and easily digestable by automated builders.\n\n### Each build only has its specified dependencies available at build-time.\n\nFor each build, the sysroot is wiped and the (recursive) dependencies are\ninstalled. This makes each build deterministic, since there will never be any\nunknown files available to cause side-effects.\n\n### Each package is cached and only rebuilt as needed.\n\nBefore building, a unique build-id is generated for each package. This id\nconsists of a hash of all files used to build the package (Makefiles, packages,\netc), and as well as a hash of the same data for each recursive dependency. If\nany portion of a package's build recipe changes, it will be rebuilt as well as\nany other package that depends on it. If any of the main makefiles (Makefile, \nfuncs.mk, etc) are changed, all packages will be rebuilt. After building, the\nresults are cached into a tarball that can be re-used and distributed.\n\n### Package build results are (relatively) deterministic.\n\nEach package is configured and patched so that it will yield the same\nbuild-results with each consequent build, within a reasonable set of\nconstraints. Some things like timestamp insertion are unavoidable, and are\nbeyond the scope of this system. Additionally, the toolchain itself must be\ncapable of deterministic results. When revisions are properly bumped, a cached\nbuild should represent an exact single payload.\n\n### Sources are fetched and verified automatically\n\nEach package must define its source location and checksum. The build will fail\nif the fetched source does not match. Sources may be pre-seeded and/or cached\nas desired.\n\n### Self-cleaning\n\nBuild and staging dirs are wiped after use, and any previous version of a\ncached result is removed following a successful build. Automated builders\nshould be able to build each revision and store the results with no further\nintervention.\n"
  },
  {
    "path": "depends/funcs.mk",
    "content": "define int_vars\n#Set defaults for vars which may be overridden per-package\n$(1)_cc=$($($(1)_type)_CC)\n$(1)_cxx=$($($(1)_type)_CXX)\n$(1)_objc=$($($(1)_type)_OBJC)\n$(1)_objcxx=$($($(1)_type)_OBJCXX)\n$(1)_ar=$($($(1)_type)_AR)\n$(1)_ranlib=$($($(1)_type)_RANLIB)\n$(1)_libtool=$($($(1)_type)_LIBTOOL)\n$(1)_nm=$($($(1)_type)_NM)\n$(1)_cflags=$($($(1)_type)_CFLAGS) $($($(1)_type)_$(release_type)_CFLAGS)\n$(1)_cxxflags=$($($(1)_type)_CXXFLAGS) $($($(1)_type)_$(release_type)_CXXFLAGS)\n$(1)_ldflags=$($($(1)_type)_LDFLAGS) $($($(1)_type)_$(release_type)_LDFLAGS) -L$($($(1)_type)_prefix)/lib\n$(1)_cppflags=$($($(1)_type)_CPPFLAGS) $($($(1)_type)_$(release_type)_CPPFLAGS) -I$($($(1)_type)_prefix)/include\n$(1)_recipe_hash:=\nendef\n\ndefine int_get_all_dependencies\n$(sort $(foreach dep,$(2),$(2) $(call int_get_all_dependencies,$(1),$($(dep)_dependencies))))\nendef\n\ndefine fetch_file_inner\n    ( mkdir -p $$($(1)_download_dir) && echo Fetching $(3) from $(2) && \\\n    $(build_DOWNLOAD) \"$$($(1)_download_dir)/$(4).temp\" \"$(2)/$(3)\" && \\\n    echo \"$(5)  $$($(1)_download_dir)/$(4).temp\" > $$($(1)_download_dir)/.$(4).hash && \\\n    $(build_SHA256SUM) -c $$($(1)_download_dir)/.$(4).hash && \\\n    mv $$($(1)_download_dir)/$(4).temp $$($(1)_source_dir)/$(4) && \\\n    rm -rf $$($(1)_download_dir) )\nendef\n\ndefine fetch_file\n    ( test -f $$($(1)_source_dir)/$(4) || \\\n    ( $(call fetch_file_inner,$(1),$(2),$(3),$(4),$(5)) || \\\n      $(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(3),$(4),$(5))))\nendef\n\ndefine int_get_build_recipe_hash\n$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)) | cut -d\" \" -f1))\n$(eval $(1)_recipe_hash:=$(shell echo -n \"$($(1)_all_file_checksums)\" | $(build_SHA256SUM) | cut -d\" \" -f1))\nendef\n\ndefine int_get_build_id\n$(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_$(host_os)_dependencies))\n$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($(1)_dependencies)))\n$(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash)))\n$(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type) $($(1)_build_id_deps) $($($(1)_type)_id_string))\n$(eval $(1)_build_id:=$(shell echo -n \"$($(1)_build_id_long)\" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH)))\nfinal_build_id_long+=$($(package)_build_id_long)\n\n#compute package-specific paths\n$(1)_build_subdir?=.\n$(1)_download_file?=$($(1)_file_name)\n$(1)_source_dir:=$(SOURCES_PATH)\n$(1)_source:=$$($(1)_source_dir)/$($(1)_file_name)\n$(1)_staging_dir=$(base_staging_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id)\n$(1)_staging_prefix_dir:=$$($(1)_staging_dir)$($($(1)_type)_prefix)\n$(1)_extract_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id)\n$(1)_download_dir:=$(base_download_dir)/$(1)-$($(1)_version)\n$(1)_build_dir:=$$($(1)_extract_dir)/$$($(1)_build_subdir)\n$(1)_cached_checksum:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz.hash\n$(1)_patch_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id)/.patches-$($(1)_build_id)\n$(1)_prefixbin:=$($($(1)_type)_prefix)/bin/\n$(1)_cached:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz\n$(1)_all_sources=$($(1)_file_name) $($(1)_extra_sources)\n\n#stamps\n$(1)_fetched=$(SOURCES_PATH)/download-stamps/.stamp_fetched-$(1)-$($(1)_file_name).hash\n$(1)_extracted=$$($(1)_extract_dir)/.stamp_extracted\n$(1)_preprocessed=$$($(1)_extract_dir)/.stamp_preprocessed\n$(1)_cleaned=$$($(1)_extract_dir)/.stamp_cleaned\n$(1)_built=$$($(1)_build_dir)/.stamp_built\n$(1)_configured=$$($(1)_build_dir)/.stamp_configured\n$(1)_staged=$$($(1)_staging_dir)/.stamp_staged\n$(1)_postprocessed=$$($(1)_staging_prefix_dir)/.stamp_postprocessed\n$(1)_download_path_fixed=$(subst :,\\:,$$($(1)_download_path))\n\n\n#default commands\n$(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \\:,:,$$($(1)_download_path_fixed)),$$($(1)_download_file),$($(1)_file_name),$($(1)_sha256_hash))\n$(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo \"$$($(1)_sha256_hash)  $$($(1)_source)\" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash &&  $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && tar --strip-components=1 -xf $$($(1)_source)\n$(1)_preprocess_cmds ?=\n$(1)_build_cmds ?=\n$(1)_config_cmds ?=\n$(1)_stage_cmds ?=\n$(1)_set_vars ?=\n\n\nall_sources+=$$($(1)_fetched)\nendef\n#$(foreach dep_target,$($(1)_all_dependencies),$(eval $(1)_dependency_targets=$($(dep_target)_cached)))\n\n\ndefine int_config_attach_build_config\n$(eval $(call $(1)_set_vars,$(1)))\n$(1)_cflags+=$($(1)_cflags_$(release_type))\n$(1)_cflags+=$($(1)_cflags_$(host_arch)) $($(1)_cflags_$(host_arch)_$(release_type))\n$(1)_cflags+=$($(1)_cflags_$(host_os)) $($(1)_cflags_$(host_os)_$(release_type))\n$(1)_cflags+=$($(1)_cflags_$(host_arch)_$(host_os)) $($(1)_cflags_$(host_arch)_$(host_os)_$(release_type))\n\n$(1)_cxxflags+=$($(1)_cxxflags_$(release_type))\n$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)) $($(1)_cxxflags_$(host_arch)_$(release_type))\n$(1)_cxxflags+=$($(1)_cxxflags_$(host_os)) $($(1)_cxxflags_$(host_os)_$(release_type))\n$(1)_cxxflags+=$($(1)_cxxflags_$(host_arch)_$(host_os)) $($(1)_cxxflags_$(host_arch)_$(host_os)_$(release_type))\n\n$(1)_cppflags+=$($(1)_cppflags_$(release_type))\n$(1)_cppflags+=$($(1)_cppflags_$(host_arch)) $($(1)_cppflags_$(host_arch)_$(release_type))\n$(1)_cppflags+=$($(1)_cppflags_$(host_os)) $($(1)_cppflags_$(host_os)_$(release_type))\n$(1)_cppflags+=$($(1)_cppflags_$(host_arch)_$(host_os)) $($(1)_cppflags_$(host_arch)_$(host_os)_$(release_type))\n\n$(1)_ldflags+=$($(1)_ldflags_$(release_type))\n$(1)_ldflags+=$($(1)_ldflags_$(host_arch)) $($(1)_ldflags_$(host_arch)_$(release_type))\n$(1)_ldflags+=$($(1)_ldflags_$(host_os)) $($(1)_ldflags_$(host_os)_$(release_type))\n$(1)_ldflags+=$($(1)_ldflags_$(host_arch)_$(host_os)) $($(1)_ldflags_$(host_arch)_$(host_os)_$(release_type))\n\n$(1)_build_opts+=$$($(1)_build_opts_$(release_type))\n$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)) $$($(1)_build_opts_$(host_arch)_$(release_type))\n$(1)_build_opts+=$$($(1)_build_opts_$(host_os)) $$($(1)_build_opts_$(host_os)_$(release_type))\n$(1)_build_opts+=$$($(1)_build_opts_$(host_arch)_$(host_os)) $$($(1)_build_opts_$(host_arch)_$(host_os)_$(release_type))\n\n$(1)_config_opts+=$$($(1)_config_opts_$(release_type))\n$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)) $$($(1)_config_opts_$(host_arch)_$(release_type))\n$(1)_config_opts+=$$($(1)_config_opts_$(host_os)) $$($(1)_config_opts_$(host_os)_$(release_type))\n$(1)_config_opts+=$$($(1)_config_opts_$(host_arch)_$(host_os)) $$($(1)_config_opts_$(host_arch)_$(host_os)_$(release_type))\n\n$(1)_config_env+=$$($(1)_config_env_$(release_type))\n$(1)_config_env+=$($(1)_config_env_$(host_arch)) $($(1)_config_env_$(host_arch)_$(release_type))\n$(1)_config_env+=$($(1)_config_env_$(host_os)) $($(1)_config_env_$(host_os)_$(release_type))\n$(1)_config_env+=$($(1)_config_env_$(host_arch)_$(host_os)) $($(1)_config_env_$(host_arch)_$(host_os)_$(release_type))\n\n$(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig\n$(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig\n$(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH)\n$(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH)\n$(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH)\n$(1)_autoconf=./configure --host=$($($(1)_type)_host) --disable-dependency-tracking --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC=\"$$($(1)_cc)\" CXX=\"$$($(1)_cxx)\"\n\nifneq ($($(1)_nm),)\n$(1)_autoconf += NM=\"$$($(1)_nm)\"\nendif\nifneq ($($(1)_ranlib),)\n$(1)_autoconf += RANLIB=\"$$($(1)_ranlib)\"\nendif\nifneq ($($(1)_ar),)\n$(1)_autoconf += AR=\"$$($(1)_ar)\"\nendif\nifneq ($($(1)_cflags),)\n$(1)_autoconf += CFLAGS=\"$$($(1)_cflags)\"\nendif\nifneq ($($(1)_cxxflags),)\n$(1)_autoconf += CXXFLAGS=\"$$($(1)_cxxflags)\"\nendif\nifneq ($($(1)_cppflags),)\n$(1)_autoconf += CPPFLAGS=\"$$($(1)_cppflags)\"\nendif\nifneq ($($(1)_ldflags),)\n$(1)_autoconf += LDFLAGS=\"$$($(1)_ldflags)\"\nendif\nendef\n\ndefine int_add_cmds\n$($(1)_fetched):\n\t$(AT)mkdir -p $$(@D) $(SOURCES_PATH)\n\t$(AT)rm -f $$@\n\t$(AT)touch $$@\n\t$(AT)cd $$(@D); $(call $(1)_fetch_cmds,$(1))\n\t$(AT)cd $($(1)_source_dir); $(foreach source,$($(1)_all_sources),$(build_SHA256SUM) $(source) >> $$(@);)\n\t$(AT)touch $$@\n$($(1)_extracted): | $($(1)_fetched)\n\t$(AT)echo Extracting $(1)...\n\t$(AT)mkdir -p $$(@D)\n\t$(AT)cd $$(@D); $(call $(1)_extract_cmds,$(1))\n\t$(AT)touch $$@\n$($(1)_preprocessed): | $($(1)_dependencies) $($(1)_extracted)\n\t$(AT)echo Preprocessing $(1)...\n\t$(AT)mkdir -p $$(@D) $($(1)_patch_dir)\n\t$(AT)$(foreach patch,$($(1)_patches),cd $(PATCHES_PATH)/$(1); cp $(patch) $($(1)_patch_dir) ;)\n\t$(AT)cd $$(@D); $(call $(1)_preprocess_cmds, $(1))\n\t$(AT)touch $$@\n$($(1)_configured): | $($(1)_preprocessed)\n\t$(AT)echo Configuring $(1)...\n\t$(AT)rm -rf $(host_prefix); mkdir -p $(host_prefix)/lib; cd $(host_prefix); $(foreach package,$($(1)_all_dependencies), tar xf $($(package)_cached); )\n\t$(AT)mkdir -p $$(@D)\n\t$(AT)+cd $$(@D); $($(1)_config_env) $(call $(1)_config_cmds, $(1))\n\t$(AT)touch $$@\n$($(1)_built): | $($(1)_configured)\n\t$(AT)echo Building $(1)...\n\t$(AT)mkdir -p $$(@D)\n\t$(AT)+cd $$(@D); $($(1)_build_env) $(call $(1)_build_cmds, $(1))\n\t$(AT)touch $$@\n$($(1)_staged): | $($(1)_built)\n\t$(AT)echo Staging $(1)...\n\t$(AT)mkdir -p $($(1)_staging_dir)/$(host_prefix)\n\t$(AT)cd $($(1)_build_dir); $($(1)_stage_env) $(call $(1)_stage_cmds, $(1))\n\t$(AT)rm -rf $($(1)_extract_dir)\n\t$(AT)touch $$@\n$($(1)_postprocessed): | $($(1)_staged)\n\t$(AT)echo Postprocessing $(1)...\n\t$(AT)cd $($(1)_staging_prefix_dir); $(call $(1)_postprocess_cmds)\n\t$(AT)touch $$@\n$($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed)\n\t$(AT)echo Caching $(1)...\n\t$(AT)cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | tar --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T -\n\t$(AT)mkdir -p $$(@D)\n\t$(AT)rm -rf $$(@D) && mkdir -p $$(@D)\n\t$(AT)mv $$($(1)_staging_dir)/$$(@F) $$(@)\n\t$(AT)rm -rf $($(1)_staging_dir)\n$($(1)_cached_checksum): $($(1)_cached)\n\t$(AT)cd $$(@D); $(build_SHA256SUM) $$(<F) > $$(@)\n\n.PHONY: $(1)\n$(1): | $($(1)_cached_checksum)\n.SECONDARY: $($(1)_cached) $($(1)_postprocessed) $($(1)_staged) $($(1)_built) $($(1)_configured) $($(1)_preprocessed) $($(1)_extracted) $($(1)_fetched)\n\nendef\n\n# These functions create the build targets for each package. They must be\n# broken down into small steps so that each part is done for all packages\n# before moving on to the next step. Otherwise, a package's info\n# (build-id for example) would only be available to another package if it\n# happened to be computed already.\n\n#set the type for host/build packages.\n$(foreach native_package,$(native_packages),$(eval $(native_package)_type=build))\n$(foreach package,$(packages),$(eval $(package)_type=$(host_arch)_$(host_os)))\n\n#set overridable defaults\n$(foreach package,$(all_packages),$(eval $(call int_vars,$(package))))\n\n#include package files\n$(foreach package,$(all_packages),$(eval include packages/$(package).mk))\n\n#compute a hash of all files that comprise this package's build recipe\n$(foreach package,$(all_packages),$(eval $(call int_get_build_recipe_hash,$(package))))\n\n#generate a unique id for this package, incorporating its dependencies as well\n$(foreach package,$(all_packages),$(eval $(call int_get_build_id,$(package))))\n\n#compute final vars after reading package vars\n$(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$(package))))\n\n#create build targets\n$(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package))))\n\n#special exception: if a toolchain package exists, all non-native packages depend on it\n$(foreach package,$(packages),$(eval $($(package)_unpacked): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) ))\n"
  },
  {
    "path": "depends/hosts/darwin.mk",
    "content": "OSX_MIN_VERSION=10.8\nOSX_SDK_VERSION=10.11\nOSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk\nLD64_VERSION=253.9\ndarwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION)\ndarwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) -stdlib=libc++\n\ndarwin_CFLAGS=-pipe\ndarwin_CXXFLAGS=$(darwin_CFLAGS)\n\ndarwin_release_CFLAGS=-O2\ndarwin_release_CXXFLAGS=$(darwin_release_CFLAGS)\n\ndarwin_debug_CFLAGS=-O1\ndarwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS)\n\ndarwin_native_toolchain=native_cctools\n"
  },
  {
    "path": "depends/hosts/default.mk",
    "content": "ifneq ($(host),$(build))\nhost_toolchain:=$(host)-\nendif\n\ndefault_host_CC = $(host_toolchain)gcc\ndefault_host_CXX = $(host_toolchain)g++\ndefault_host_AR = $(host_toolchain)ar\ndefault_host_RANLIB = $(host_toolchain)ranlib\ndefault_host_STRIP = $(host_toolchain)strip\ndefault_host_LIBTOOL = $(host_toolchain)libtool\ndefault_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool\ndefault_host_OTOOL = $(host_toolchain)otool\ndefault_host_NM = $(host_toolchain)nm\n\ndefine add_host_tool_func\n$(host_os)_$1?=$$(default_host_$1)\n$(host_arch)_$(host_os)_$1?=$$($(host_os)_$1)\n$(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1)\nhost_$1=$$($(host_arch)_$(host_os)_$1)\nendef\n\ndefine add_host_flags_func\n$(host_arch)_$(host_os)_$1 += $($(host_os)_$1)\n$(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1)\nhost_$1 = $$($(host_arch)_$(host_os)_$1)\nhost_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1)\nendef\n\n$(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool))))\n$(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags))))\n"
  },
  {
    "path": "depends/hosts/linux.mk",
    "content": "linux_CFLAGS=-pipe\nlinux_CXXFLAGS=$(linux_CFLAGS)\n\nlinux_release_CFLAGS=-O2\nlinux_release_CXXFLAGS=$(linux_release_CFLAGS)\n\nlinux_debug_CFLAGS=-O1\nlinux_debug_CXXFLAGS=$(linux_debug_CFLAGS)\n\nlinux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC\n\nifeq (86,$(findstring 86,$(build_arch)))\ni686_linux_CC=gcc -m32\ni686_linux_CXX=g++ -m32\ni686_linux_AR=ar\ni686_linux_RANLIB=ranlib\ni686_linux_NM=nm\ni686_linux_STRIP=strip\n\nx86_64_linux_CC=gcc -m64\nx86_64_linux_CXX=g++ -m64\nx86_64_linux_AR=ar\nx86_64_linux_RANLIB=ranlib\nx86_64_linux_NM=nm\nx86_64_linux_STRIP=strip\nelse\ni686_linux_CC=$(default_host_CC) -m32\ni686_linux_CXX=$(default_host_CXX) -m32\nx86_64_linux_CC=$(default_host_CC) -m64\nx86_64_linux_CXX=$(default_host_CXX) -m64\nendif\n"
  },
  {
    "path": "depends/hosts/mingw32.mk",
    "content": "mingw32_CFLAGS=-pipe\nmingw32_CXXFLAGS=$(mingw32_CFLAGS)\n\nmingw32_release_CFLAGS=-O2\nmingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS)\n\nmingw32_debug_CFLAGS=-O1\nmingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS)\n\nmingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC\n"
  },
  {
    "path": "depends/packages/bdb.mk",
    "content": "package=bdb\n$(package)_version=4.8.30\n$(package)_download_path=http://download.oracle.com/berkeley-db\n$(package)_file_name=db-$($(package)_version).NC.tar.gz\n$(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef\n$(package)_build_subdir=build_unix\n\ndefine $(package)_set_vars\n$(package)_config_opts=--disable-shared --enable-cxx --disable-replication\n$(package)_config_opts_mingw32=--enable-mingw\n$(package)_config_opts_linux=--with-pic\n$(package)_cxxflags=-std=c++11\nendef\n\ndefine $(package)_preprocess_cmds\n  sed -i.old 's/__atomic_compare_exchange/__atomic_compare_exchange_db/' dbinc/atomic.h && \\\n  sed -i.old 's/atomic_init/atomic_init_db/' dbinc/atomic.h mp/mp_region.c mp/mp_mvcc.c mp/mp_fget.c mutex/mut_method.c mutex/mut_tas.c && \\\n  cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub dist\nendef\n\ndefine $(package)_config_cmds\n  ../dist/$($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE) libdb_cxx-4.8.a libdb-4.8.a\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include\nendef\n"
  },
  {
    "path": "depends/packages/boost.mk",
    "content": "package=boost\n$(package)_version=1_64_0\n$(package)_download_path=https://dl.bintray.com/boostorg/release/1.64.0/source/\n$(package)_file_name=$(package)_$($(package)_version).tar.bz2\n$(package)_sha256_hash=7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332\n\ndefine $(package)_set_vars\n$(package)_config_opts_release=variant=release\n$(package)_config_opts_debug=variant=debug\n$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam\n$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1\n$(package)_config_opts_linux=threadapi=pthread runtime-link=shared\n$(package)_config_opts_darwin=--toolset=darwin-4.2.1 runtime-link=shared\n$(package)_config_opts_mingw32=binary-format=pe target-os=windows threadapi=win32 runtime-link=static\n$(package)_config_opts_x86_64_mingw32=address-model=64\n$(package)_config_opts_i686_mingw32=address-model=32\n$(package)_config_opts_i686_linux=address-model=32 architecture=x86\n$(package)_toolset_$(host_os)=gcc\n$(package)_archiver_$(host_os)=$($(package)_ar)\n$(package)_toolset_darwin=darwin\n$(package)_archiver_darwin=$($(package)_libtool)\n$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test\n$(package)_cxxflags=-std=c++11 -fvisibility=hidden\n$(package)_cxxflags_linux=-fPIC\nendef\n\ndefine $(package)_preprocess_cmds\n  echo \"using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\\\"$($(package)_cxxflags) $($(package)_cppflags)\\\" <linkflags>\\\"$($(package)_ldflags)\\\" <archiver>\\\"$(boost_archiver_$(host_os))\\\" <striper>\\\"$(host_STRIP)\\\"  <ranlib>\\\"$(host_RANLIB)\\\" <rc>\\\"$(host_WINDRES)\\\" : ;\" > user-config.jam\nendef\n\ndefine $(package)_config_cmds\n  ./bootstrap.sh --without-icu --with-libraries=$(boost_config_libraries)\nendef\n\ndefine $(package)_build_cmds\n  ./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage\nendef\n\ndefine $(package)_stage_cmds\n  ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install\nendef\n"
  },
  {
    "path": "depends/packages/dbus.mk",
    "content": "package=dbus\n$(package)_version=1.10.18\n$(package)_download_path=https://dbus.freedesktop.org/releases/dbus\n$(package)_file_name=$(package)-$($(package)_version).tar.gz\n$(package)_sha256_hash=6049ddd5f3f3e2618f615f1faeda0a115104423a7996b7aa73e2f36e38cc514a\n$(package)_dependencies=expat\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--disable-tests --disable-doxygen-docs --disable-xml-docs --disable-static --without-x\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE) -C dbus libdbus-1.la\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) -C dbus DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-dbusincludeHEADERS install-nodist_dbusarchincludeHEADERS && \\\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA\nendef\n"
  },
  {
    "path": "depends/packages/expat.mk",
    "content": "package=expat\n$(package)_version=2.2.1\n$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_2_2_1/\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=1868cadae4c82a018e361e2b2091de103cd820aaacb0d6cfa49bd2cd83978885\n\ndefine $(package)_set_vars\n$(package)_config_opts=--disable-static\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/fontconfig.mk",
    "content": "package=fontconfig\n$(package)_version=2.12.1\n$(package)_download_path=http://www.freedesktop.org/software/fontconfig/release/\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=b449a3e10c47e1d1c7a6ec6e2016cca73d3bd68fbbd4f0ae5cc6b573f7d6c7f3\n$(package)_dependencies=freetype expat\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--disable-docs --disable-static\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\n# 2.12.1 uses CHAR_WIDTH which is reserved and clashes with some glibc versions, but newer versions of fontconfig\n# have broken makefiles which needlessly attempt to re-generate headers with gperf.\n# Instead, change all uses of CHAR_WIDTH, and disable the rule that forces header re-generation.\n# This can be removed once the upstream build is fixed.\ndefine $(package)_build_cmds\n  sed -i 's/CHAR_WIDTH/CHARWIDTH/g' fontconfig/fontconfig.h src/fcobjshash.gperf src/fcobjs.h src/fcobjshash.h && \\\n  sed -i 's/fcobjshash.h: fcobjshash.gperf/fcobjshash.h:/' src/Makefile && \\\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/freetype.mk",
    "content": "package=freetype\n$(package)_version=2.7.1\n$(package)_download_path=http://download.savannah.gnu.org/releases/$(package)\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=3a3bb2c4e15ffb433f2032f50a5b5a92558206822e22bfe8cbe339af4aa82f88\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--without-zlib --without-png --disable-static\n  $(package)_config_opts_linux=--with-pic\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/libICE.mk",
    "content": "package=libICE\n$(package)_version=1.0.9\n$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=8f7032f2c1c64352b5423f6b48a8ebdc339cc63064af34d66a6c9aa79759e202\n$(package)_dependencies=xtrans xproto\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--disable-static --disable-docs --disable-specs --without-xsltproc\n  $(package)_config_opts_linux=--with-pic\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/libSM.mk",
    "content": "package=libSM\n$(package)_version=1.2.2\n$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=0baca8c9f5d934450a70896c4ad38d06475521255ca63b717a6510fdb6e287bd\n$(package)_dependencies=xtrans xproto libICE\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--without-libuuid  --without-xsltproc  --disable-docs --disable-static\n  $(package)_config_opts_linux=--with-pic\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/libX11.mk",
    "content": "package=libX11\n$(package)_version=1.6.2\n$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=2aa027e837231d2eeea90f3a4afe19948a6eb4c8b2bec0241eba7dbc8106bd16\n$(package)_dependencies=libxcb xtrans xextproto xproto\n\ndefine $(package)_set_vars\n$(package)_config_opts=--disable-xkb --disable-static\n$(package)_config_opts_linux=--with-pic\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/libXau.mk",
    "content": "package=libXau\n$(package)_version=1.0.8\n$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=fdd477320aeb5cdd67272838722d6b7d544887dfe7de46e1e7cc0c27c2bea4f2\n$(package)_dependencies=xproto\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--disable-shared\n  $(package)_config_opts_linux=--with-pic\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/libXext.mk",
    "content": "package=libXext\n$(package)_version=1.3.2\n$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=f829075bc646cdc085fa25d98d5885d83b1759ceb355933127c257e8e50432e0\n$(package)_dependencies=xproto xextproto libX11 libXau\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--disable-static\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/libevent.mk",
    "content": "package=libevent\n$(package)_version=2.1.8-stable\n$(package)_download_path=https://github.com/libevent/libevent/archive/\n$(package)_file_name=release-$($(package)_version).tar.gz\n$(package)_sha256_hash=316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d\n\ndefine $(package)_preprocess_cmds\n  ./autogen.sh\nendef\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples\n  $(package)_config_opts_release=--disable-debug-mode\n  $(package)_config_opts_linux=--with-pic\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n\ndefine $(package)_postprocess_cmds\nendef\n"
  },
  {
    "path": "depends/packages/libxcb.mk",
    "content": "package=libxcb\n$(package)_version=1.10\n$(package)_download_path=http://xcb.freedesktop.org/dist\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=98d9ab05b636dd088603b64229dd1ab2d2cc02ab807892e107d674f9c3f2d5b5\n$(package)_dependencies=xcb_proto libXau xproto\n\ndefine $(package)_set_vars\n$(package)_config_opts=--disable-static\nendef\n\ndefine $(package)_preprocess_cmds\n  sed \"s/pthread-stubs//\" -i configure\nendef\n\n# Don't install xcb headers to the default path in order to work around a qt\n# build issue: https://bugreports.qt.io/browse/QTBUG-34748\n# When using qt's internal libxcb, it may end up finding the real headers in\n# depends staging. Use a non-default path to avoid that.\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf) --includedir=$(host_prefix)/include/xcb-shared\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n\ndefine $(package)_postprocess_cmds\n  rm -rf share/man share/doc\nendef\n"
  },
  {
    "path": "depends/packages/miniupnpc.mk",
    "content": "package=miniupnpc\n$(package)_version=2.0.20170509\n$(package)_download_path=http://miniupnp.free.fr/files\n$(package)_file_name=$(package)-$($(package)_version).tar.gz\n$(package)_sha256_hash=d3c368627f5cdfb66d3ebd64ca39ba54d6ff14a61966dbecb8dd296b7039f16a\n\ndefine $(package)_set_vars\n$(package)_build_opts=CC=\"$($(package)_cc)\"\n$(package)_build_opts_darwin=OS=Darwin LIBTOOL=\"$($(package)_libtool)\"\n$(package)_build_opts_mingw32=-f Makefile.mingw\n$(package)_build_env+=CFLAGS=\"$($(package)_cflags) $($(package)_cppflags)\" AR=\"$($(package)_ar)\"\nendef\n\ndefine $(package)_preprocess_cmds\n  mkdir dll && \\\n  sed -e 's|MINIUPNPC_VERSION_STRING \\\"version\\\"|MINIUPNPC_VERSION_STRING \\\"$($(package)_version)\\\"|' -e 's|OS/version|$(host)|' miniupnpcstrings.h.in > miniupnpcstrings.h && \\\n  sed -i.old \"s|miniupnpcstrings.h: miniupnpcstrings.h.in wingenminiupnpcstrings|miniupnpcstrings.h: miniupnpcstrings.h.in|\" Makefile.mingw\nendef\n\ndefine $(package)_build_cmds\n\t$(MAKE) libminiupnpc.a $($(package)_build_opts)\nendef\n\ndefine $(package)_stage_cmds\n\tmkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\\\n\tinstall *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\\\n\tinstall libminiupnpc.a $($(package)_staging_prefix_dir)/lib\nendef\n"
  },
  {
    "path": "depends/packages/native_biplist.mk",
    "content": "package=native_biplist\n$(package)_version=0.9\n$(package)_download_path=https://pypi.python.org/packages/source/b/biplist\n$(package)_file_name=biplist-$($(package)_version).tar.gz\n$(package)_sha256_hash=b57cadfd26e4754efdf89e9e37de87885f9b5c847b2615688ca04adfaf6ca604\n$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages\n$(package)_patches=sorted_list.patch\n\ndefine $(package)_preprocess_cmds\n  patch -p1 < $($(package)_patch_dir)/sorted_list.patch\nendef\n\ndefine $(package)_build_cmds\n    python setup.py build\nendef\n\ndefine $(package)_stage_cmds\n    mkdir -p $($(package)_install_libdir) && \\\n    python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir)\nendef\n"
  },
  {
    "path": "depends/packages/native_ccache.mk",
    "content": "package=native_ccache\n$(package)_version=3.3.4\n$(package)_download_path=https://samba.org/ftp/ccache\n$(package)_file_name=ccache-$($(package)_version).tar.bz2\n$(package)_sha256_hash=fa9d7f38367431bc86b19ad107d709ca7ecf1574fdacca01698bdf0a47cd8567\n\ndefine $(package)_set_vars\n$(package)_config_opts=\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n\ndefine $(package)_postprocess_cmds\n  rm -rf lib include\nendef\n"
  },
  {
    "path": "depends/packages/native_cctools.mk",
    "content": "package=native_cctools\n$(package)_version=807d6fd1be5d2224872e381870c0a75387fe05e6\n$(package)_download_path=https://github.com/theuni/cctools-port/archive\n$(package)_file_name=$($(package)_version).tar.gz\n$(package)_sha256_hash=a09c9ba4684670a0375e42d9d67e7f12c1f62581a27f28f7c825d6d7032ccc6a\n$(package)_build_subdir=cctools\n$(package)_clang_version=3.7.1\n$(package)_clang_download_path=http://llvm.org/releases/$($(package)_clang_version)\n$(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz\n$(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz\n$(package)_clang_sha256_hash=99b28a6b48e793705228a390471991386daa33a9717cd9ca007fcdde69608fd9\n$(package)_extra_sources=$($(package)_clang_file_name)\n\ndefine $(package)_fetch_cmds\n$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \\\n$(call fetch_file,$(package),$($(package)_clang_download_path),$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash))\nendef\n\ndefine $(package)_extract_cmds\n  mkdir -p $($(package)_extract_dir) && \\\n  echo \"$($(package)_sha256_hash)  $($(package)_source)\" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \\\n  echo \"$($(package)_clang_sha256_hash)  $($(package)_source_dir)/$($(package)_clang_file_name)\" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \\\n  $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \\\n  mkdir -p toolchain/bin toolchain/lib/clang/3.5/include && \\\n  tar --strip-components=1 -C toolchain -xf $($(package)_source_dir)/$($(package)_clang_file_name) && \\\n  rm -f toolchain/lib/libc++abi.so* && \\\n  echo \"#!/bin/sh\" > toolchain/bin/$(host)-dsymutil && \\\n  echo \"exit 0\" >> toolchain/bin/$(host)-dsymutil && \\\n  chmod +x toolchain/bin/$(host)-dsymutil && \\\n  tar --strip-components=1 -xf $($(package)_source)\nendef\n\ndefine $(package)_set_vars\n$(package)_config_opts=--target=$(host) --disable-lto-support\n$(package)_ldflags+=-Wl,-rpath=\\\\$$$$$$$$\\$$$$$$$$ORIGIN/../lib\n$(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang\n$(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++\nendef\n\ndefine $(package)_preprocess_cmds\n  cd $($(package)_build_subdir); ./autogen.sh && \\\n  sed -i.old \"/define HAVE_PTHREADS/d\" ld64/src/ld/InputFiles.h\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install && \\\n  cd $($(package)_extract_dir)/toolchain && \\\n  mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include && \\\n  mkdir -p $($(package)_staging_prefix_dir)/bin $($(package)_staging_prefix_dir)/include && \\\n  cp bin/clang $($(package)_staging_prefix_dir)/bin/ &&\\\n  cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\\\n  cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \\\n  cp -rf lib/clang/$($(package)_clang_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include/ && \\\n  cp bin/llvm-dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \\\n  if `test -d include/c++/`; then cp -rf include/c++/ $($(package)_staging_prefix_dir)/include/; fi && \\\n  if `test -d lib/c++/`; then cp -rf lib/c++/ $($(package)_staging_prefix_dir)/lib/; fi\nendef\n"
  },
  {
    "path": "depends/packages/native_cdrkit.mk",
    "content": "package=native_cdrkit\n$(package)_version=1.1.11\n$(package)_download_path=http://distro.ibiblio.org/fatdog/source/600/c\n$(package)_file_name=cdrkit-$($(package)_version).tar.bz2\n$(package)_sha256_hash=b50d64c214a65b1a79afe3a964c691931a4233e2ba605d793eb85d0ac3652564\n$(package)_patches=cdrkit-deterministic.patch\n\ndefine $(package)_preprocess_cmds\n  patch -p1 < $($(package)_patch_dir)/cdrkit-deterministic.patch\nendef\n\ndefine $(package)_config_cmds\n  cmake -DCMAKE_INSTALL_PREFIX=$(build_prefix)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE) genisoimage\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) -C genisoimage install\nendef\n\ndefine $(package)_postprocess_cmds\n  rm bin/isovfy bin/isoinfo bin/isodump bin/isodebug bin/devdump\nendef\n"
  },
  {
    "path": "depends/packages/native_ds_store.mk",
    "content": "package=native_ds_store\n$(package)_version=1.1.2\n$(package)_download_path=https://github.com/al45tair/ds_store/archive/\n$(package)_file_name=v$($(package)_version).tar.gz\n$(package)_sha256_hash=3b3ecb7bf0a5157f5b6010bc3af7c141fb0ad3527084e63336220d22744bc20c\n$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages\n$(package)_dependencies=native_biplist\n\ndefine $(package)_build_cmds\n    python setup.py build\nendef\n\ndefine $(package)_stage_cmds\n    mkdir -p $($(package)_install_libdir) && \\\n    python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir)\nendef\n"
  },
  {
    "path": "depends/packages/native_libdmg-hfsplus.mk",
    "content": "package=native_libdmg-hfsplus\n$(package)_version=0.1\n$(package)_download_path=https://github.com/theuni/libdmg-hfsplus/archive\n$(package)_file_name=libdmg-hfsplus-v$($(package)_version).tar.gz\n$(package)_sha256_hash=6569a02eb31c2827080d7d59001869ea14484c281efab0ae7f2b86af5c3120b3\n$(package)_build_subdir=build\n\ndefine $(package)_preprocess_cmds\n  mkdir build\nendef\n\ndefine $(package)_config_cmds\n  cmake -DCMAKE_INSTALL_PREFIX:PATH=$(build_prefix)/bin ..\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE) -C dmg\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) -C dmg install\nendef\n"
  },
  {
    "path": "depends/packages/native_mac_alias.mk",
    "content": "package=native_mac_alias\n$(package)_version=2.0.6\n$(package)_download_path=https://github.com/al45tair/mac_alias/archive/\n$(package)_file_name=v$($(package)_version).tar.gz\n$(package)_sha256_hash=78a3332d9a597eebf09ae652d38ad1e263b28db5c2e6dd725fad357b03b77371\n$(package)_install_libdir=$(build_prefix)/lib/python/dist-packages\n$(package)_patches=python3.patch\n\ndefine $(package)_preprocess_cmds\n    patch -p1 < $($(package)_patch_dir)/python3.patch\nendef\n\ndefine $(package)_build_cmds\n    python setup.py build\nendef\n\ndefine $(package)_stage_cmds\n    mkdir -p $($(package)_install_libdir) && \\\n    python setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir)\nendef\n"
  },
  {
    "path": "depends/packages/native_protobuf.mk",
    "content": "package=native_protobuf\n$(package)_version=2.6.1\n$(package)_download_path=https://github.com/google/protobuf/releases/download/v$($(package)_version)\n$(package)_file_name=protobuf-$($(package)_version).tar.bz2\n$(package)_sha256_hash=ee445612d544d885ae240ffbcbf9267faa9f593b7b101f21d58beceb92661910\n\ndefine $(package)_set_vars\n$(package)_config_opts=--disable-shared\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE) -C src protoc\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) -C src DESTDIR=$($(package)_staging_dir) install-strip\nendef\n\ndefine $(package)_postprocess_cmds\n  rm -rf lib include\nendef\n"
  },
  {
    "path": "depends/packages/openssl.mk",
    "content": "package=openssl\n$(package)_version=1.0.1k\n$(package)_download_path=https://www.openssl.org/source\n$(package)_file_name=$(package)-$($(package)_version).tar.gz\n$(package)_sha256_hash=8f9faeaebad088e772f4ef5e38252d472be4d878c6b3a2718c10a4fcebe7a41c\n\ndefine $(package)_set_vars\n$(package)_config_env=AR=\"$($(package)_ar)\" RANLIB=\"$($(package)_ranlib)\" CC=\"$($(package)_cc)\"\n$(package)_config_opts=--prefix=$(host_prefix) --openssldir=$(host_prefix)/etc/openssl\n$(package)_config_opts+=no-camellia\n$(package)_config_opts+=no-capieng\n$(package)_config_opts+=no-cast\n$(package)_config_opts+=no-comp\n$(package)_config_opts+=no-dso\n$(package)_config_opts+=no-dtls1\n$(package)_config_opts+=no-ec_nistp_64_gcc_128\n$(package)_config_opts+=no-gost\n$(package)_config_opts+=no-gmp\n$(package)_config_opts+=no-heartbeats\n$(package)_config_opts+=no-idea\n$(package)_config_opts+=no-jpake\n$(package)_config_opts+=no-krb5\n$(package)_config_opts+=no-libunbound\n$(package)_config_opts+=no-md2\n$(package)_config_opts+=no-mdc2\n$(package)_config_opts+=no-rc4\n$(package)_config_opts+=no-rc5\n$(package)_config_opts+=no-rdrand\n$(package)_config_opts+=no-rfc3779\n$(package)_config_opts+=no-rsax\n$(package)_config_opts+=no-sctp\n$(package)_config_opts+=no-seed\n$(package)_config_opts+=no-sha0\n$(package)_config_opts+=no-shared\n$(package)_config_opts+=no-ssl-trace\n$(package)_config_opts+=no-ssl2\n$(package)_config_opts+=no-ssl3\n$(package)_config_opts+=no-static_engine\n$(package)_config_opts+=no-store\n$(package)_config_opts+=no-unit-test\n$(package)_config_opts+=no-weak-ssl-ciphers\n$(package)_config_opts+=no-whirlpool\n$(package)_config_opts+=no-zlib\n$(package)_config_opts+=no-zlib-dynamic\n$(package)_config_opts+=$($(package)_cflags) $($(package)_cppflags)\n$(package)_config_opts_linux=-fPIC -Wa,--noexecstack\n$(package)_config_opts_x86_64_linux=linux-x86_64\n$(package)_config_opts_i686_linux=linux-generic32\n$(package)_config_opts_arm_linux=linux-generic32\n$(package)_config_opts_armv7l_linux=linux-generic32\n$(package)_config_opts_aarch64_linux=linux-generic64\n$(package)_config_opts_mipsel_linux=linux-generic32\n$(package)_config_opts_mips_linux=linux-generic32\n$(package)_config_opts_powerpc_linux=linux-generic32\n$(package)_config_opts_x86_64_darwin=darwin64-x86_64-cc\n$(package)_config_opts_x86_64_mingw32=mingw64\n$(package)_config_opts_i686_mingw32=mingw\nendef\n\ndefine $(package)_preprocess_cmds\n  sed -i.old \"/define DATE/d\" util/mkbuildinf.pl && \\\n  sed -i.old \"s|engines apps test|engines|\" Makefile.org\nendef\n\ndefine $(package)_config_cmds\n  ./Configure $($(package)_config_opts)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE) -j1 build_libs libcrypto.pc libssl.pc openssl.pc\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) INSTALL_PREFIX=$($(package)_staging_dir) -j1 install_sw\nendef\n\ndefine $(package)_postprocess_cmds\n  rm -rf share bin etc\nendef\n"
  },
  {
    "path": "depends/packages/packages.mk",
    "content": "packages:=boost openssl libevent zeromq\nnative_packages := native_ccache\n\nqt_native_packages = native_protobuf\nqt_packages = qrencode protobuf zlib\n\nqt_x86_64_linux_packages:=qt expat dbus libxcb xcb_proto libXau xproto freetype fontconfig libX11 xextproto libXext xtrans\nqt_i686_linux_packages:=$(qt_x86_64_linux_packages)\n\nqt_darwin_packages=qt\nqt_mingw32_packages=qt\n\nwallet_packages=bdb\n\nupnp_packages=miniupnpc\n\ndarwin_native_packages = native_biplist native_ds_store native_mac_alias\n\nifneq ($(build_os),darwin)\ndarwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus\nendif\n"
  },
  {
    "path": "depends/packages/protobuf.mk",
    "content": "package=protobuf\n$(package)_version=$(native_$(package)_version)\n$(package)_download_path=$(native_$(package)_download_path)\n$(package)_file_name=$(native_$(package)_file_name)\n$(package)_sha256_hash=$(native_$(package)_sha256_hash)\n$(package)_dependencies=native_$(package)\n$(package)_cxxflags=-std=c++11\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--disable-shared --with-protoc=$(build_prefix)/bin/protoc\n  $(package)_config_opts_linux=--with-pic\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE) -C src libprotobuf.la\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) -C src install-libLTLIBRARIES install-nobase_includeHEADERS &&\\\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install-pkgconfigDATA\nendef\n\ndefine $(package)_postprocess_cmds\n  rm lib/libprotoc.a\nendef\n"
  },
  {
    "path": "depends/packages/qrencode.mk",
    "content": "package=qrencode\n$(package)_version=3.4.4\n$(package)_download_path=https://fukuchi.org/works/qrencode/\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=efe5188b1ddbcbf98763b819b146be6a90481aac30cfc8d858ab78a19cde1fa5\n\ndefine $(package)_set_vars\n$(package)_config_opts=--disable-shared -without-tools --disable-sdltest\n$(package)_config_opts_linux=--with-pic\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/qt.mk",
    "content": "PACKAGE=qt\n$(package)_version=5.7.1\n$(package)_download_path=https://download.qt.io/archive/qt/5.7/$($(package)_version)/submodules\n$(package)_suffix=opensource-src-$($(package)_version).tar.gz\n$(package)_file_name=qtbase-$($(package)_suffix)\n$(package)_sha256_hash=95f83e532d23b3ddbde7973f380ecae1bac13230340557276f75f2e37984e410\n$(package)_dependencies=openssl zlib\n$(package)_linux_dependencies=freetype fontconfig libxcb libX11 xproto libXext\n$(package)_build_subdir=qtbase\n$(package)_qt_libs=corelib network widgets gui plugins testlib\n$(package)_patches=mac-qmake.conf mingw-uuidof.patch pidlist_absolute.patch fix-xcb-include-order.patch\n$(package)_patches+=fix_qt_pkgconfig.patch fix-cocoahelpers-macos.patch qfixed-coretext.patch\n\n$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)\n$(package)_qttranslations_sha256_hash=3a15aebd523c6d89fb97b2d3df866c94149653a26d27a00aac9b6d3020bc5a1d\n\n\n$(package)_qttools_file_name=qttools-$($(package)_suffix)\n$(package)_qttools_sha256_hash=22d67de915cb8cd93e16fdd38fa006224ad9170bd217c2be1e53045a8dd02f0f\n\n$(package)_extra_sources  = $($(package)_qttranslations_file_name)\n$(package)_extra_sources += $($(package)_qttools_file_name)\n\ndefine $(package)_set_vars\n$(package)_config_opts_release = -release\n$(package)_config_opts_debug = -debug\n$(package)_config_opts += -bindir $(build_prefix)/bin\n$(package)_config_opts += -c++std c++11\n$(package)_config_opts += -confirm-license\n$(package)_config_opts += -dbus-runtime\n$(package)_config_opts += -hostprefix $(build_prefix)\n$(package)_config_opts += -no-alsa\n$(package)_config_opts += -no-audio-backend\n$(package)_config_opts += -no-cups\n$(package)_config_opts += -no-egl\n$(package)_config_opts += -no-eglfs\n$(package)_config_opts += -no-feature-style-windowsmobile\n$(package)_config_opts += -no-feature-style-windowsce\n$(package)_config_opts += -no-freetype\n$(package)_config_opts += -no-gif\n$(package)_config_opts += -no-glib\n$(package)_config_opts += -no-gstreamer\n$(package)_config_opts += -no-icu\n$(package)_config_opts += -no-iconv\n$(package)_config_opts += -no-kms\n$(package)_config_opts += -no-linuxfb\n$(package)_config_opts += -no-libudev\n$(package)_config_opts += -no-mitshm\n$(package)_config_opts += -no-mtdev\n$(package)_config_opts += -no-pulseaudio\n$(package)_config_opts += -no-openvg\n$(package)_config_opts += -no-reduce-relocations\n$(package)_config_opts += -no-qml-debug\n$(package)_config_opts += -no-sql-db2\n$(package)_config_opts += -no-sql-ibase\n$(package)_config_opts += -no-sql-oci\n$(package)_config_opts += -no-sql-tds\n$(package)_config_opts += -no-sql-mysql\n$(package)_config_opts += -no-sql-odbc\n$(package)_config_opts += -no-sql-psql\n$(package)_config_opts += -no-sql-sqlite\n$(package)_config_opts += -no-sql-sqlite2\n$(package)_config_opts += -no-use-gold-linker\n$(package)_config_opts += -no-xinput2\n$(package)_config_opts += -no-xrender\n$(package)_config_opts += -nomake examples\n$(package)_config_opts += -nomake tests\n$(package)_config_opts += -opensource\n$(package)_config_opts += -openssl-linked\n$(package)_config_opts += -optimized-qmake\n$(package)_config_opts += -pch\n$(package)_config_opts += -pkg-config\n$(package)_config_opts += -prefix $(host_prefix)\n$(package)_config_opts += -qt-libpng\n$(package)_config_opts += -qt-libjpeg\n$(package)_config_opts += -qt-pcre\n$(package)_config_opts += -system-zlib\n$(package)_config_opts += -reduce-exports\n$(package)_config_opts += -static\n$(package)_config_opts += -silent\n$(package)_config_opts += -v\n$(package)_config_opts += -no-feature-printer\n$(package)_config_opts += -no-feature-printdialog\n\nifneq ($(build_os),darwin)\n$(package)_config_opts_darwin = -xplatform macx-clang-linux\n$(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK)\n$(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION)\n$(package)_config_opts_darwin += -device-option CROSS_COMPILE=\"$(host)-\"\n$(package)_config_opts_darwin += -device-option MAC_MIN_VERSION=$(OSX_MIN_VERSION)\n$(package)_config_opts_darwin += -device-option MAC_TARGET=$(host)\n$(package)_config_opts_darwin += -device-option MAC_LD64_VERSION=$(LD64_VERSION)\nendif\n\n$(package)_config_opts_linux  = -qt-xkbcommon\n$(package)_config_opts_linux += -qt-xcb\n$(package)_config_opts_linux += -system-freetype\n$(package)_config_opts_linux += -no-sm\n$(package)_config_opts_linux += -fontconfig\n$(package)_config_opts_linux += -no-opengl\n$(package)_config_opts_arm_linux  = -platform linux-g++ -xplatform $(host)\n$(package)_config_opts_i686_linux  = -xplatform linux-g++-32\n$(package)_config_opts_mingw32  = -no-opengl -xplatform win32-g++ -device-option CROSS_COMPILE=\"$(host)-\"\n$(package)_build_env  = QT_RCC_TEST=1\nendef\n\ndefine $(package)_fetch_cmds\n$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \\\n$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \\\n$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash))\nendef\n\ndefine $(package)_extract_cmds\n  mkdir -p $($(package)_extract_dir) && \\\n  echo \"$($(package)_sha256_hash)  $($(package)_source)\" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \\\n  echo \"$($(package)_qttranslations_sha256_hash)  $($(package)_source_dir)/$($(package)_qttranslations_file_name)\" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \\\n  echo \"$($(package)_qttools_sha256_hash)  $($(package)_source_dir)/$($(package)_qttools_file_name)\" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \\\n  $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \\\n  mkdir qtbase && \\\n  tar --strip-components=1 -xf $($(package)_source) -C qtbase && \\\n  mkdir qttranslations && \\\n  tar --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \\\n  mkdir qttools && \\\n  tar --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools\nendef\n\n\ndefine $(package)_preprocess_cmds\n  sed -i.old \"s|updateqm.commands = \\$$$$\\$$$$LRELEASE|updateqm.commands = $($(package)_extract_dir)/qttools/bin/lrelease|\" qttranslations/translations/translations.pro && \\\n  sed -i.old \"/updateqm.depends =/d\" qttranslations/translations/translations.pro && \\\n  sed -i.old \"s/src_plugins.depends = src_sql src_xml src_network/src_plugins.depends = src_xml src_network/\" qtbase/src/src.pro && \\\n  sed -i.old \"s|X11/extensions/XIproto.h|X11/X.h|\" qtbase/src/plugins/platforms/xcb/qxcbxsettings.cpp && \\\n  sed -i.old 's/if \\[ \"$$$$XPLATFORM_MAC\" = \"yes\" \\]; then xspecvals=$$$$(macSDKify/if \\[ \"$$$$BUILD_ON_MAC\" = \"yes\" \\]; then xspecvals=$$$$(macSDKify/' qtbase/configure && \\\n  sed -i.old 's/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0)/CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft)/' qtbase/src/plugins/platforms/cocoa/qcocoacursor.mm && \\\n  mkdir -p qtbase/mkspecs/macx-clang-linux &&\\\n  cp -f qtbase/mkspecs/macx-clang/Info.plist.lib qtbase/mkspecs/macx-clang-linux/ &&\\\n  cp -f qtbase/mkspecs/macx-clang/Info.plist.app qtbase/mkspecs/macx-clang-linux/ &&\\\n  cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\\\n  cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \\\n  patch -p1 < $($(package)_patch_dir)/mingw-uuidof.patch && \\\n  patch -p1 < $($(package)_patch_dir)/pidlist_absolute.patch && \\\n  patch -p1 < $($(package)_patch_dir)/fix-xcb-include-order.patch && \\\n  patch -p1 < $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \\\n  patch -p1 < $($(package)_patch_dir)/fix-cocoahelpers-macos.patch && \\\n  patch -p1 < $($(package)_patch_dir)/qfixed-coretext.patch && \\\n  echo \"!host_build: QMAKE_CFLAGS     += $($(package)_cflags) $($(package)_cppflags)\" >> qtbase/mkspecs/common/gcc-base.conf && \\\n  echo \"!host_build: QMAKE_CXXFLAGS   += $($(package)_cxxflags) $($(package)_cppflags)\" >> qtbase/mkspecs/common/gcc-base.conf && \\\n  echo \"!host_build: QMAKE_LFLAGS     += $($(package)_ldflags)\" >> qtbase/mkspecs/common/gcc-base.conf && \\\n  sed -i.old \"s|QMAKE_CFLAGS            = |!host_build: QMAKE_CFLAGS            = $($(package)_cflags) $($(package)_cppflags) |\" qtbase/mkspecs/win32-g++/qmake.conf && \\\n  sed -i.old \"s|QMAKE_LFLAGS            = |!host_build: QMAKE_LFLAGS            = $($(package)_ldflags) |\" qtbase/mkspecs/win32-g++/qmake.conf && \\\n  sed -i.old \"s|QMAKE_CXXFLAGS          = |!host_build: QMAKE_CXXFLAGS            = $($(package)_cxxflags) $($(package)_cppflags) |\" qtbase/mkspecs/win32-g++/qmake.conf\n\nendef\n\ndefine $(package)_config_cmds\n  export PKG_CONFIG_SYSROOT_DIR=/ && \\\n  export PKG_CONFIG_LIBDIR=$(host_prefix)/lib/pkgconfig && \\\n  export PKG_CONFIG_PATH=$(host_prefix)/share/pkgconfig  && \\\n  ./configure $($(package)_config_opts) && \\\n  echo \"host_build: QT_CONFIG ~= s/system-zlib/zlib\" >> mkspecs/qconfig.pri && \\\n  echo \"CONFIG += force_bootstrap\" >> mkspecs/qconfig.pri && \\\n  $(MAKE) sub-src-clean && \\\n  cd ../qttranslations && ../qtbase/bin/qmake qttranslations.pro -o Makefile && \\\n  cd translations && ../../qtbase/bin/qmake translations.pro -o Makefile && cd ../.. &&\\\n  cd qttools/src/linguist/lrelease/ && ../../../../qtbase/bin/qmake lrelease.pro -o Makefile\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE) -C src $(addprefix sub-,$($(package)_qt_libs)) && \\\n  $(MAKE) -C ../qttools/src/linguist/lrelease && \\\n  $(MAKE) -C ../qttranslations\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) -C src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && cd .. &&\\\n  $(MAKE) -C qttools/src/linguist/lrelease INSTALL_ROOT=$($(package)_staging_dir) install_target && \\\n  $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets && \\\n  if `test -f qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a`; then \\\n    cp qtbase/src/plugins/platforms/xcb/xcb-static/libxcb-static.a $($(package)_staging_prefix_dir)/lib; \\\n  fi\nendef\n\ndefine $(package)_postprocess_cmds\n  rm -rf native/mkspecs/ native/lib/ lib/cmake/ && \\\n  rm -f lib/lib*.la lib/*.prl plugins/*/*.prl\nendef\n"
  },
  {
    "path": "depends/packages/xcb_proto.mk",
    "content": "package=xcb_proto\n$(package)_version=1.10\n$(package)_download_path=http://xcb.freedesktop.org/dist\n$(package)_file_name=xcb-proto-$($(package)_version).tar.bz2\n$(package)_sha256_hash=7ef40ddd855b750bc597d2a435da21e55e502a0fefa85b274f2c922800baaf05\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--disable-shared\n  $(package)_config_opts_linux=--with-pic\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n\ndefine $(package)_postprocess_cmds\n  find -name \"*.pyc\" -delete && \\\n  find -name \"*.pyo\" -delete\nendef\n"
  },
  {
    "path": "depends/packages/xextproto.mk",
    "content": "package=xextproto\n$(package)_version=7.3.0\n$(package)_download_path=http://xorg.freedesktop.org/releases/individual/proto\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0\n\ndefine $(package)_set_vars\n$(package)_config_opts=--disable-shared\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/xproto.mk",
    "content": "package=xproto\n$(package)_version=7.0.26\n$(package)_download_path=http://xorg.freedesktop.org/releases/individual/proto\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=636162c1759805a5a0114a369dffdeccb8af8c859ef6e1445f26a4e6e046514f\n\ndefine $(package)_set_vars\n$(package)_config_opts=--disable-shared\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/xtrans.mk",
    "content": "package=xtrans\n$(package)_version=1.3.4\n$(package)_download_path=http://xorg.freedesktop.org/releases/individual/lib/\n$(package)_file_name=$(package)-$($(package)_version).tar.bz2\n$(package)_sha256_hash=054d4ee3efd52508c753e9f7bc655ef185a29bd2850dd9e2fc2ccc33544f583a\n$(package)_dependencies=\n\ndefine $(package)_set_vars\n$(package)_config_opts_linux=--with-pic --disable-static\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE)\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install\nendef\n"
  },
  {
    "path": "depends/packages/zeromq.mk",
    "content": "package=zeromq\n$(package)_version=4.2.2\n$(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/\n$(package)_file_name=$(package)-$($(package)_version).tar.gz\n$(package)_sha256_hash=5b23f4ca9ef545d5bd3af55d305765e3ee06b986263b31967435d285a3e6df6b\n$(package)_patches=0001-fix-build-with-older-mingw64.patch\n\ndefine $(package)_set_vars\n  $(package)_config_opts=--without-docs --disable-shared --without-libsodium --disable-curve --disable-curve-keygen --disable-perf\n  $(package)_config_opts_linux=--with-pic\n  $(package)_cxxflags=-std=c++11\nendef\n\ndefine $(package)_preprocess_cmds\n   patch -p1 < $($(package)_patch_dir)/0001-fix-build-with-older-mingw64.patch && \\\n  ./autogen.sh\nendef\n\ndefine $(package)_config_cmds\n  $($(package)_autoconf)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE) src/libzmq.la\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA\nendef\n\ndefine $(package)_postprocess_cmds\n  sed -i.old \"s/ -lstdc++//\" lib/pkgconfig/libzmq.pc && \\\n  rm -rf bin share\nendef\n"
  },
  {
    "path": "depends/packages/zlib.mk",
    "content": "package=zlib\n$(package)_version=1.2.11\n$(package)_download_path=http://www.zlib.net\n$(package)_file_name=$(package)-$($(package)_version).tar.gz\n$(package)_sha256_hash=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1\n\ndefine $(package)_set_vars\n$(package)_build_opts= CC=\"$($(package)_cc)\"\n$(package)_build_opts+=CFLAGS=\"$($(package)_cflags) $($(package)_cppflags) -fPIC\"\n$(package)_build_opts+=RANLIB=\"$($(package)_ranlib)\"\n$(package)_build_opts+=AR=\"$($(package)_ar)\"\n$(package)_build_opts_darwin+=AR=\"$($(package)_libtool)\"\n$(package)_build_opts_darwin+=ARFLAGS=\"-o\"\nendef\n\ndefine $(package)_config_cmds\n  ./configure --static --prefix=$(host_prefix)\nendef\n\ndefine $(package)_build_cmds\n  $(MAKE) $($(package)_build_opts) libz.a\nendef\n\ndefine $(package)_stage_cmds\n  $(MAKE) DESTDIR=$($(package)_staging_dir) install $($(package)_build_opts)\nendef\n\n"
  },
  {
    "path": "depends/packages.md",
    "content": "Each recipe consists of 3 main parts: defining identifiers, setting build\nvariables, and defining build commands.\n\nThe package \"mylib\" will be used here as an example\n\nGeneral tips:\n- mylib_foo is written as $(package)_foo in order to make recipes more similar.\n\n## Identifiers\nEach package is required to define at least these variables:\n\n    $(package)_version:\n    Version of the upstream library or program. If there is no version, a\n    placeholder such as 1.0 can be used.\n\n    $(package)_download_path:\n    Location of the upstream source, without the file-name. Usually http or\n    ftp.\n\n    $(package)_file_name:\n    The upstream source filename available at the download path.\n\n    $(package)_sha256_hash:\n    The sha256 hash of the upstream file\n\nThese variables are optional:\n\n    $(package)_build_subdir:\n    cd to this dir before running configure/build/stage commands.\n    \n    $(package)_download_file:\n    The file-name of the upstream source if it differs from how it should be\n    stored locally. This can be used to avoid storing file-names with strange\n    characters.\n    \n    $(package)_dependencies:\n    Names of any other packages that this one depends on.\n    \n    $(package)_patches:\n    Filenames of any patches needed to build the package\n\n    $(package)_extra_sources:\n    Any extra files that will be fetched via $(package)_fetch_cmds. These are\n    specified so that they can be fetched and verified via 'make download'.\n\n\n## Build Variables:\nAfter defining the main identifiers, build variables may be added or customized\nbefore running the build commands. They should be added to a function called\n$(package)_set_vars. For example:\n\n    define $(package)_set_vars\n    ...\n    endef\n\nMost variables can be prefixed with the host, architecture, or both, to make\nthe modifications specific to that case. For example:\n\n    Universal:     $(package)_cc=gcc\n    Linux only:    $(package)_linux_cc=gcc\n    x86_64 only:       $(package)_x86_64_cc = gcc\n    x86_64 linux only: $(package)_x86_64_linux_cc = gcc\n\nThese variables may be set to override or append their default values.\n\n    $(package)_cc\n    $(package)_cxx\n    $(package)_objc\n    $(package)_objcxx\n    $(package)_ar\n    $(package)_ranlib\n    $(package)_libtool\n    $(package)_nm\n    $(package)_cflags\n    $(package)_cxxflags\n    $(package)_ldflags\n    $(package)_cppflags\n    $(package)_config_env\n    $(package)_build_env\n    $(package)_stage_env\n    $(package)_build_opts\n    $(package)_config_opts\n\nThe *_env variables are used to add environment variables to the respective\ncommands.\n\nMany variables respect a debug/release suffix as well, in order to use them for\nonly the appropriate build config. For example:\n\n    $(package)_cflags_release = -O3\n    $(package)_cflags_i686_debug = -g\n    $(package)_config_opts_release = --disable-debug\n\nThese will be used in addition to the options that do not specify\ndebug/release. All builds are considered to be release unless DEBUG=1 is set by\nthe user. Other variables may be defined as needed.\n\n## Build commands:\n\n  For each build, a unique build dir and staging dir are created. For example,\n  `work/build/mylib/1.0-1adac830f6e` and `work/staging/mylib/1.0-1adac830f6e`.\n\n  The following build commands are available for each recipe:\n\n    $(package)_fetch_cmds:\n    Runs from: build dir\n    Fetch the source file. If undefined, it will be fetched and verified\n    against its hash.\n\n    $(package)_extract_cmds:\n    Runs from: build dir\n    Verify the source file against its hash and extract it. If undefined, the\n    source is assumed to be a tarball.\n\n    $(package)_preprocess_cmds:\n    Runs from: build dir/$(package)_build_subdir\n    Preprocess the source as necessary. If undefined, does nothing.\n\n    $(package)_config_cmds:\n    Runs from: build dir/$(package)_build_subdir\n    Configure the source. If undefined, does nothing.\n\n    $(package)_build_cmds:\n    Runs from: build dir/$(package)_build_subdir\n    Build the source. If undefined, does nothing.\n\n    $(package)_stage_cmds:\n    Runs from: build dir/$(package)_build_subdir\n    Stage the build results. If undefined, does nothing.\n\n  The following variables are available for each recipe:\n    \n    $(1)_staging_dir: package's destination sysroot path\n    $(1)_staging_prefix_dir: prefix path inside of the package's staging dir\n    $(1)_extract_dir: path to the package's extracted sources\n    $(1)_build_dir: path where configure/build/stage commands will be run\n    $(1)_patch_dir: path where the package's patches (if any) are found\n\nNotes on build commands:\n\nFor packages built with autotools, $($(package)_autoconf) can be used in the\nconfigure step to (usually) correctly configure automatically. Any\n$($(package)_config_opts) will be appended.\n\nMost autotools projects can be properly staged using:\n\n    $(MAKE) DESTDIR=$($(package)_staging_dir) install\n"
  },
  {
    "path": "depends/patches/qt/mac-qmake.conf",
    "content": "MAKEFILE_GENERATOR = UNIX\nCONFIG += app_bundle incremental global_init_link_order lib_version_first plugin_no_soname absolute_library_soname\nQMAKE_INCREMENTAL_STYLE = sublib\ninclude(../common/macx.conf)\ninclude(../common/gcc-base-mac.conf)\ninclude(../common/clang.conf)\ninclude(../common/clang-mac.conf)\nQMAKE_MAC_SDK_PATH=$${MAC_SDK_PATH}\nQMAKE_XCODE_VERSION=4.3\nQMAKE_XCODE_DEVELOPER_PATH=/Developer\nQMAKE_MACOSX_DEPLOYMENT_TARGET = $${MAC_MIN_VERSION}\nQMAKE_MAC_SDK=macosx\nQMAKE_MAC_SDK.macosx.Path = $${MAC_SDK_PATH}\nQMAKE_MAC_SDK.macosx.platform_name = macosx\nQMAKE_MAC_SDK.macosx.SDKVersion = $${MAC_SDK_VERSION}\nQMAKE_MAC_SDK.macosx.PlatformPath = /phony\n!host_build: QMAKE_CFLAGS += -target $${MAC_TARGET}\n!host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS\n!host_build: QMAKE_CXXFLAGS += $$QMAKE_CFLAGS\n!host_build: QMAKE_LFLAGS += -target $${MAC_TARGET} -mlinker-version=$${MAC_LD64_VERSION}\nQMAKE_AR = $${CROSS_COMPILE}ar cq\nQMAKE_RANLIB=$${CROSS_COMPILE}ranlib\nQMAKE_LIBTOOL=$${CROSS_COMPILE}libtool\nQMAKE_INSTALL_NAME_TOOL=$${CROSS_COMPILE}install_name_tool\nload(qt_config)\n"
  },
  {
    "path": "doc/.gitignore",
    "content": "Doxyfile\n"
  },
  {
    "path": "doc/Doxyfile.in",
    "content": "# Doxyfile 1.8.12\n\n# This file describes the settings to be used by the documentation system\n# doxygen (www.doxygen.org) for a project.\n#\n# All text after a double hash (##) is considered a comment and is placed in\n# front of the TAG it is preceding.\n#\n# All text after a single hash (#) is considered a comment and will be ignored.\n# The format is:\n# TAG = value [value, ...]\n# For lists, items can also be appended using:\n# TAG += value [value, ...]\n# Values that contain spaces should be placed between quotes (\\\" \\\").\n\n#---------------------------------------------------------------------------\n# Project related configuration options\n#---------------------------------------------------------------------------\n\n# This tag specifies the encoding used for all characters in the config file\n# that follow. The default is UTF-8 which is also the encoding used for all text\n# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv\n# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv\n# for the list of possible encodings.\n# The default value is: UTF-8.\n\nDOXYFILE_ENCODING      = UTF-8\n\n# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by\n# double-quotes, unless you are using Doxywizard) that should identify the\n# project for which the documentation is generated. This name is used in the\n# title of most generated pages and in a few other places.\n# The default value is: My Project.\n\nPROJECT_NAME           = \"Bitcoin Core\"\n\n# The PROJECT_NUMBER tag can be used to enter a project or revision number. This\n# could be handy for archiving the generated documentation or if some version\n# control system is used.\n\nPROJECT_NUMBER         = @PACKAGE_VERSION@\n\n# Using the PROJECT_BRIEF tag one can provide an optional one line description\n# for a project that appears at the top of each page and should give viewer a\n# quick idea about the purpose of the project. Keep the description short.\n\nPROJECT_BRIEF          = \"P2P Digital Currency\"\n\n# With the PROJECT_LOGO tag one can specify a logo or an icon that is included\n# in the documentation. The maximum height of the logo should not exceed 55\n# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy\n# the logo to the output directory.\n\nPROJECT_LOGO           = doc/bitcoin_logo_doxygen.png\n\n# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path\n# into which the generated documentation will be written. If a relative path is\n# entered, it will be relative to the location where doxygen was started. If\n# left blank the current directory will be used.\n\nOUTPUT_DIRECTORY       = doc/doxygen\n\n# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-\n# directories (in 2 levels) under the output directory of each output format and\n# will distribute the generated files over these directories. Enabling this\n# option can be useful when feeding doxygen a huge amount of source files, where\n# putting all generated files in the same directory would otherwise causes\n# performance problems for the file system.\n# The default value is: NO.\n\nCREATE_SUBDIRS         = NO\n\n# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII\n# characters to appear in the names of generated files. If set to NO, non-ASCII\n# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode\n# U+3044.\n# The default value is: NO.\n\nALLOW_UNICODE_NAMES    = NO\n\n# The OUTPUT_LANGUAGE tag is used to specify the language in which all\n# documentation generated by doxygen is written. Doxygen will use this\n# information to generate all constant output in the proper language.\n# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,\n# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),\n# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,\n# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),\n# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,\n# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,\n# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,\n# Ukrainian and Vietnamese.\n# The default value is: English.\n\nOUTPUT_LANGUAGE        = English\n\n# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member\n# descriptions after the members that are listed in the file and class\n# documentation (similar to Javadoc). Set to NO to disable this.\n# The default value is: YES.\n\nBRIEF_MEMBER_DESC      = YES\n\n# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief\n# description of a member or function before the detailed description\n#\n# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the\n# brief descriptions will be completely suppressed.\n# The default value is: YES.\n\nREPEAT_BRIEF           = YES\n\n# This tag implements a quasi-intelligent brief description abbreviator that is\n# used to form the text in various listings. Each string in this list, if found\n# as the leading text of the brief description, will be stripped from the text\n# and the result, after processing the whole list, is used as the annotated\n# text. Otherwise, the brief description is used as-is. If left blank, the\n# following values are used ($name is automatically replaced with the name of\n# the entity):The $name class, The $name widget, The $name file, is, provides,\n# specifies, contains, represents, a, an and the.\n\nABBREVIATE_BRIEF       = \"The $name class\" \\\n                         \"The $name widget\" \\\n                         \"The $name file\" \\\n                         is \\\n                         provides \\\n                         specifies \\\n                         contains \\\n                         represents \\\n                         a \\\n                         an \\\n                         the\n\n# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then\n# doxygen will generate a detailed section even if there is only a brief\n# description.\n# The default value is: NO.\n\nALWAYS_DETAILED_SEC    = NO\n\n# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all\n# inherited members of a class in the documentation of that class as if those\n# members were ordinary class members. Constructors, destructors and assignment\n# operators of the base classes will not be shown.\n# The default value is: NO.\n\nINLINE_INHERITED_MEMB  = NO\n\n# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path\n# before files name in the file list and in the header files. If set to NO the\n# shortest path that makes the file name unique will be used\n# The default value is: YES.\n\nFULL_PATH_NAMES        = YES\n\n# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.\n# Stripping is only done if one of the specified strings matches the left-hand\n# part of the path. The tag can be used to show relative paths in the file list.\n# If left blank the directory from which doxygen is run is used as the path to\n# strip.\n#\n# Note that you can specify absolute paths here, but also relative paths, which\n# will be relative from the directory where doxygen is started.\n# This tag requires that the tag FULL_PATH_NAMES is set to YES.\n\nSTRIP_FROM_PATH        =\n\n# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the\n# path mentioned in the documentation of a class, which tells the reader which\n# header file to include in order to use a class. If left blank only the name of\n# the header file containing the class definition is used. Otherwise one should\n# specify the list of include paths that are normally passed to the compiler\n# using the -I flag.\n\nSTRIP_FROM_INC_PATH    =\n\n# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but\n# less readable) file names. This can be useful is your file systems doesn't\n# support long names like on DOS, Mac, or CD-ROM.\n# The default value is: NO.\n\nSHORT_NAMES            = NO\n\n# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the\n# first line (until the first dot) of a Javadoc-style comment as the brief\n# description. If set to NO, the Javadoc-style will behave just like regular Qt-\n# style comments (thus requiring an explicit @brief command for a brief\n# description.)\n# The default value is: NO.\n\nJAVADOC_AUTOBRIEF      = YES\n\n# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first\n# line (until the first dot) of a Qt-style comment as the brief description. If\n# set to NO, the Qt-style will behave just like regular Qt-style comments (thus\n# requiring an explicit \\brief command for a brief description.)\n# The default value is: NO.\n\nQT_AUTOBRIEF           = NO\n\n# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a\n# multi-line C++ special comment block (i.e. a block of //! or /// comments) as\n# a brief description. This used to be the default behavior. The new default is\n# to treat a multi-line C++ comment block as a detailed description. Set this\n# tag to YES if you prefer the old behavior instead.\n#\n# Note that setting this tag to YES also means that rational rose comments are\n# not recognized any more.\n# The default value is: NO.\n\nMULTILINE_CPP_IS_BRIEF = NO\n\n# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the\n# documentation from any documented member that it re-implements.\n# The default value is: YES.\n\nINHERIT_DOCS           = YES\n\n# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new\n# page for each member. If set to NO, the documentation of a member will be part\n# of the file/class/namespace that contains it.\n# The default value is: NO.\n\nSEPARATE_MEMBER_PAGES  = NO\n\n# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen\n# uses this value to replace tabs by spaces in code fragments.\n# Minimum value: 1, maximum value: 16, default value: 4.\n\nTAB_SIZE               = 8\n\n# This tag can be used to specify a number of aliases that act as commands in\n# the documentation. An alias has the form:\n# name=value\n# For example adding\n# \"sideeffect=@par Side Effects:\\n\"\n# will allow you to put the command \\sideeffect (or @sideeffect) in the\n# documentation, which will result in a user-defined paragraph with heading\n# \"Side Effects:\". You can put \\n's in the value part of an alias to insert\n# newlines.\n\nALIASES                =\n\n# This tag can be used to specify a number of word-keyword mappings (TCL only).\n# A mapping has the form \"name=value\". For example adding \"class=itcl::class\"\n# will allow you to use the command class in the itcl::class meaning.\n\nTCL_SUBST              =\n\n# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources\n# only. Doxygen will then generate output that is more tailored for C. For\n# instance, some of the names that are used will be different. The list of all\n# members will be omitted, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_FOR_C  = NO\n\n# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or\n# Python sources only. Doxygen will then generate output that is more tailored\n# for that language. For instance, namespaces will be presented as packages,\n# qualified scopes will look different, etc.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_JAVA   = NO\n\n# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran\n# sources. Doxygen will then generate output that is tailored for Fortran.\n# The default value is: NO.\n\nOPTIMIZE_FOR_FORTRAN   = NO\n\n# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL\n# sources. Doxygen will then generate output that is tailored for VHDL.\n# The default value is: NO.\n\nOPTIMIZE_OUTPUT_VHDL   = NO\n\n# Doxygen selects the parser to use depending on the extension of the files it\n# parses. With this tag you can assign which parser to use for a given\n# extension. Doxygen has a built-in mapping, but you can override or extend it\n# using this tag. The format is ext=language, where ext is a file extension, and\n# language is one of the parsers supported by doxygen: IDL, Java, Javascript,\n# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:\n# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:\n# Fortran. In the later case the parser tries to guess whether the code is fixed\n# or free formatted code, this is the default for Fortran type files), VHDL. For\n# instance to make doxygen treat .inc files as Fortran files (default is PHP),\n# and .f files as C (default is Fortran), use: inc=Fortran f=C.\n#\n# Note: For files without extension you can use no_extension as a placeholder.\n#\n# Note that for custom extensions you also need to set FILE_PATTERNS otherwise\n# the files are not read by doxygen.\n\nEXTENSION_MAPPING      =\n\n# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments\n# according to the Markdown format, which allows for more readable\n# documentation. See http://daringfireball.net/projects/markdown/ for details.\n# The output of markdown processing is further processed by doxygen, so you can\n# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in\n# case of backward compatibilities issues.\n# The default value is: YES.\n\nMARKDOWN_SUPPORT       = YES\n\n# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up\n# to that level are automatically included in the table of contents, even if\n# they do not have an id attribute.\n# Note: This feature currently applies only to Markdown headings.\n# Minimum value: 0, maximum value: 99, default value: 0.\n# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.\n\nTOC_INCLUDE_HEADINGS   = 0\n\n# When enabled doxygen tries to link words that correspond to documented\n# classes, or namespaces to their corresponding documentation. Such a link can\n# be prevented in individual cases by putting a % sign in front of the word or\n# globally by setting AUTOLINK_SUPPORT to NO.\n# The default value is: YES.\n\nAUTOLINK_SUPPORT       = YES\n\n# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want\n# to include (a tag file for) the STL sources as input, then you should set this\n# tag to YES in order to let doxygen match functions declarations and\n# definitions whose arguments contain STL classes (e.g. func(std::string);\n# versus func(std::string) {}). This also make the inheritance and collaboration\n# diagrams that involve STL classes more complete and accurate.\n# The default value is: NO.\n\nBUILTIN_STL_SUPPORT    = NO\n\n# If you use Microsoft's C++/CLI language, you should set this option to YES to\n# enable parsing support.\n# The default value is: NO.\n\nCPP_CLI_SUPPORT        = NO\n\n# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:\n# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen\n# will parse them like normal C++ but will assume all classes use public instead\n# of private inheritance when no explicit protection keyword is present.\n# The default value is: NO.\n\nSIP_SUPPORT            = NO\n\n# For Microsoft's IDL there are propget and propput attributes to indicate\n# getter and setter methods for a property. Setting this option to YES will make\n# doxygen to replace the get and set methods by a property in the documentation.\n# This will only work if the methods are indeed getting or setting a simple\n# type. If this is not the case, or you want to show the methods anyway, you\n# should set this option to NO.\n# The default value is: YES.\n\nIDL_PROPERTY_SUPPORT   = YES\n\n# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC\n# tag is set to YES then doxygen will reuse the documentation of the first\n# member in the group (if any) for the other members of the group. By default\n# all members of a group must be documented explicitly.\n# The default value is: NO.\n\nDISTRIBUTE_GROUP_DOC   = NO\n\n# If one adds a struct or class to a group and this option is enabled, then also\n# any nested class or struct is added to the same group. By default this option\n# is disabled and one has to add nested compounds explicitly via \\ingroup.\n# The default value is: NO.\n\nGROUP_NESTED_COMPOUNDS = NO\n\n# Set the SUBGROUPING tag to YES to allow class member groups of the same type\n# (for instance a group of public functions) to be put as a subgroup of that\n# type (e.g. under the Public Functions section). Set it to NO to prevent\n# subgrouping. Alternatively, this can be done per class using the\n# \\nosubgrouping command.\n# The default value is: YES.\n\nSUBGROUPING            = YES\n\n# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions\n# are shown inside the group in which they are included (e.g. using \\ingroup)\n# instead of on a separate page (for HTML and Man pages) or section (for LaTeX\n# and RTF).\n#\n# Note that this feature does not work in combination with\n# SEPARATE_MEMBER_PAGES.\n# The default value is: NO.\n\nINLINE_GROUPED_CLASSES = NO\n\n# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions\n# with only public data fields or simple typedef fields will be shown inline in\n# the documentation of the scope in which they are defined (i.e. file,\n# namespace, or group documentation), provided this scope is documented. If set\n# to NO, structs, classes, and unions are shown on a separate page (for HTML and\n# Man pages) or section (for LaTeX and RTF).\n# The default value is: NO.\n\nINLINE_SIMPLE_STRUCTS  = NO\n\n# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or\n# enum is documented as struct, union, or enum with the name of the typedef. So\n# typedef struct TypeS {} TypeT, will appear in the documentation as a struct\n# with name TypeT. When disabled the typedef will appear as a member of a file,\n# namespace, or class. And the struct will be named TypeS. This can typically be\n# useful for C code in case the coding convention dictates that all compound\n# types are typedef'ed and only the typedef is referenced, never the tag name.\n# The default value is: NO.\n\nTYPEDEF_HIDES_STRUCT   = NO\n\n# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This\n# cache is used to resolve symbols given their name and scope. Since this can be\n# an expensive process and often the same symbol appears multiple times in the\n# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small\n# doxygen will become slower. If the cache is too large, memory is wasted. The\n# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range\n# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536\n# symbols. At the end of a run doxygen will report the cache usage and suggest\n# the optimal cache size from a speed point of view.\n# Minimum value: 0, maximum value: 9, default value: 0.\n\nLOOKUP_CACHE_SIZE      = 0\n\n#---------------------------------------------------------------------------\n# Build related configuration options\n#---------------------------------------------------------------------------\n\n# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in\n# documentation are documented, even if no documentation was available. Private\n# class members and static file members will be hidden unless the\n# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.\n# Note: This will also disable the warnings about undocumented members that are\n# normally produced when WARNINGS is set to YES.\n# The default value is: NO.\n\nEXTRACT_ALL            = YES\n\n# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will\n# be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PRIVATE        = YES\n\n# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal\n# scope will be included in the documentation.\n# The default value is: NO.\n\nEXTRACT_PACKAGE        = NO\n\n# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be\n# included in the documentation.\n# The default value is: NO.\n\nEXTRACT_STATIC         = NO\n\n# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined\n# locally in source files will be included in the documentation. If set to NO,\n# only classes defined in header files are included. Does not have any effect\n# for Java sources.\n# The default value is: YES.\n\nEXTRACT_LOCAL_CLASSES  = YES\n\n# This flag is only useful for Objective-C code. If set to YES, local methods,\n# which are defined in the implementation section but not in the interface are\n# included in the documentation. If set to NO, only methods in the interface are\n# included.\n# The default value is: NO.\n\nEXTRACT_LOCAL_METHODS  = NO\n\n# If this flag is set to YES, the members of anonymous namespaces will be\n# extracted and appear in the documentation as a namespace called\n# 'anonymous_namespace{file}', where file will be replaced with the base name of\n# the file that contains the anonymous namespace. By default anonymous namespace\n# are hidden.\n# The default value is: NO.\n\nEXTRACT_ANON_NSPACES   = NO\n\n# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all\n# undocumented members inside documented classes or files. If set to NO these\n# members will be included in the various overviews, but no documentation\n# section is generated. This option has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_MEMBERS     = NO\n\n# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all\n# undocumented classes that are normally visible in the class hierarchy. If set\n# to NO, these classes will be included in the various overviews. This option\n# has no effect if EXTRACT_ALL is enabled.\n# The default value is: NO.\n\nHIDE_UNDOC_CLASSES     = NO\n\n# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend\n# (class|struct|union) declarations. If set to NO, these declarations will be\n# included in the documentation.\n# The default value is: NO.\n\nHIDE_FRIEND_COMPOUNDS  = NO\n\n# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any\n# documentation blocks found inside the body of a function. If set to NO, these\n# blocks will be appended to the function's detailed documentation block.\n# The default value is: NO.\n\nHIDE_IN_BODY_DOCS      = NO\n\n# The INTERNAL_DOCS tag determines if documentation that is typed after a\n# \\internal command is included. If the tag is set to NO then the documentation\n# will be excluded. Set it to YES to include the internal documentation.\n# The default value is: NO.\n\nINTERNAL_DOCS          = NO\n\n# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file\n# names in lower-case letters. If set to YES, upper-case letters are also\n# allowed. This is useful if you have classes or files whose names only differ\n# in case and if your file system supports case sensitive file names. Windows\n# and Mac users are advised to set this option to NO.\n# The default value is: system dependent.\n\nCASE_SENSE_NAMES       = NO\n\n# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with\n# their full class and namespace scopes in the documentation. If set to YES, the\n# scope will be hidden.\n# The default value is: NO.\n\nHIDE_SCOPE_NAMES       = NO\n\n# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will\n# append additional text to a page's title, such as Class Reference. If set to\n# YES the compound reference will be hidden.\n# The default value is: NO.\n\nHIDE_COMPOUND_REFERENCE= NO\n\n# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of\n# the files that are included by a file in the documentation of that file.\n# The default value is: YES.\n\nSHOW_INCLUDE_FILES     = YES\n\n# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each\n# grouped member an include statement to the documentation, telling the reader\n# which file to include in order to use the member.\n# The default value is: NO.\n\nSHOW_GROUPED_MEMB_INC  = NO\n\n# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include\n# files with double quotes in the documentation rather than with sharp brackets.\n# The default value is: NO.\n\nFORCE_LOCAL_INCLUDES   = NO\n\n# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the\n# documentation for inline members.\n# The default value is: YES.\n\nINLINE_INFO            = YES\n\n# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the\n# (detailed) documentation of file and class members alphabetically by member\n# name. If set to NO, the members will appear in declaration order.\n# The default value is: YES.\n\nSORT_MEMBER_DOCS       = YES\n\n# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief\n# descriptions of file, namespace and class members alphabetically by member\n# name. If set to NO, the members will appear in declaration order. Note that\n# this will also influence the order of the classes in the class list.\n# The default value is: NO.\n\nSORT_BRIEF_DOCS        = NO\n\n# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the\n# (brief and detailed) documentation of class members so that constructors and\n# destructors are listed first. If set to NO the constructors will appear in the\n# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.\n# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief\n# member documentation.\n# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting\n# detailed member documentation.\n# The default value is: NO.\n\nSORT_MEMBERS_CTORS_1ST = NO\n\n# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy\n# of group names into alphabetical order. If set to NO the group names will\n# appear in their defined order.\n# The default value is: NO.\n\nSORT_GROUP_NAMES       = NO\n\n# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by\n# fully-qualified names, including namespaces. If set to NO, the class list will\n# be sorted only by class name, not including the namespace part.\n# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\n# Note: This option applies only to the class list, not to the alphabetical\n# list.\n# The default value is: NO.\n\nSORT_BY_SCOPE_NAME     = NO\n\n# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper\n# type resolution of all parameters of a function it will reject a match between\n# the prototype and the implementation of a member function even if there is\n# only one candidate or it is obvious which candidate to choose by doing a\n# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still\n# accept a match between prototype and implementation in such cases.\n# The default value is: NO.\n\nSTRICT_PROTO_MATCHING  = NO\n\n# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo\n# list. This list is created by putting \\todo commands in the documentation.\n# The default value is: YES.\n\nGENERATE_TODOLIST      = YES\n\n# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test\n# list. This list is created by putting \\test commands in the documentation.\n# The default value is: YES.\n\nGENERATE_TESTLIST      = YES\n\n# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug\n# list. This list is created by putting \\bug commands in the documentation.\n# The default value is: YES.\n\nGENERATE_BUGLIST       = YES\n\n# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)\n# the deprecated list. This list is created by putting \\deprecated commands in\n# the documentation.\n# The default value is: YES.\n\nGENERATE_DEPRECATEDLIST= YES\n\n# The ENABLED_SECTIONS tag can be used to enable conditional documentation\n# sections, marked by \\if <section_label> ... \\endif and \\cond <section_label>\n# ... \\endcond blocks.\n\nENABLED_SECTIONS       =\n\n# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the\n# initial value of a variable or macro / define can have for it to appear in the\n# documentation. If the initializer consists of more lines than specified here\n# it will be hidden. Use a value of 0 to hide initializers completely. The\n# appearance of the value of individual variables and macros / defines can be\n# controlled using \\showinitializer or \\hideinitializer command in the\n# documentation regardless of this setting.\n# Minimum value: 0, maximum value: 10000, default value: 30.\n\nMAX_INITIALIZER_LINES  = 30\n\n# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at\n# the bottom of the documentation of classes and structs. If set to YES, the\n# list will mention the files that were used to generate the documentation.\n# The default value is: YES.\n\nSHOW_USED_FILES        = YES\n\n# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This\n# will remove the Files entry from the Quick Index and from the Folder Tree View\n# (if specified).\n# The default value is: YES.\n\nSHOW_FILES             = YES\n\n# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces\n# page. This will remove the Namespaces entry from the Quick Index and from the\n# Folder Tree View (if specified).\n# The default value is: YES.\n\nSHOW_NAMESPACES        = YES\n\n# The FILE_VERSION_FILTER tag can be used to specify a program or script that\n# doxygen should invoke to get the current version for each file (typically from\n# the version control system). Doxygen will invoke the program by executing (via\n# popen()) the command command input-file, where command is the value of the\n# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided\n# by doxygen. Whatever the program writes to standard output is used as the file\n# version. For an example see the documentation.\n\nFILE_VERSION_FILTER    =\n\n# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed\n# by doxygen. The layout file controls the global structure of the generated\n# output files in an output format independent way. To create the layout file\n# that represents doxygen's defaults, run doxygen with the -l option. You can\n# optionally specify a file name after the option, if omitted DoxygenLayout.xml\n# will be used as the name of the layout file.\n#\n# Note that if you run doxygen from a directory containing a file called\n# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE\n# tag is left empty.\n\nLAYOUT_FILE            =\n\n# The CITE_BIB_FILES tag can be used to specify one or more bib files containing\n# the reference definitions. This must be a list of .bib files. The .bib\n# extension is automatically appended if omitted. This requires the bibtex tool\n# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.\n# For LaTeX the style of the bibliography can be controlled using\n# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the\n# search path. See also \\cite for info how to create references.\n\nCITE_BIB_FILES         =\n\n#---------------------------------------------------------------------------\n# Configuration options related to warning and progress messages\n#---------------------------------------------------------------------------\n\n# The QUIET tag can be used to turn on/off the messages that are generated to\n# standard output by doxygen. If QUIET is set to YES this implies that the\n# messages are off.\n# The default value is: NO.\n\nQUIET                  = NO\n\n# The WARNINGS tag can be used to turn on/off the warning messages that are\n# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES\n# this implies that the warnings are on.\n#\n# Tip: Turn warnings on while writing the documentation.\n# The default value is: YES.\n\nWARNINGS               = YES\n\n# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate\n# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag\n# will automatically be disabled.\n# The default value is: YES.\n\nWARN_IF_UNDOCUMENTED   = YES\n\n# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for\n# potential errors in the documentation, such as not documenting some parameters\n# in a documented function, or documenting parameters that don't exist or using\n# markup commands wrongly.\n# The default value is: YES.\n\nWARN_IF_DOC_ERROR      = YES\n\n# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that\n# are documented, but have no documentation for their parameters or return\n# value. If set to NO, doxygen will only warn about wrong or incomplete\n# parameter documentation, but not about the absence of documentation.\n# The default value is: NO.\n\nWARN_NO_PARAMDOC       = NO\n\n# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when\n# a warning is encountered.\n# The default value is: NO.\n\nWARN_AS_ERROR          = NO\n\n# The WARN_FORMAT tag determines the format of the warning messages that doxygen\n# can produce. The string should contain the $file, $line, and $text tags, which\n# will be replaced by the file and line number from which the warning originated\n# and the warning text. Optionally the format may contain $version, which will\n# be replaced by the version of the file (if it could be obtained via\n# FILE_VERSION_FILTER)\n# The default value is: $file:$line: $text.\n\nWARN_FORMAT            = \"$file:$line: $text\"\n\n# The WARN_LOGFILE tag can be used to specify a file to which warning and error\n# messages should be written. If left blank the output is written to standard\n# error (stderr).\n\nWARN_LOGFILE           =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the input files\n#---------------------------------------------------------------------------\n\n# The INPUT tag is used to specify the files and/or directories that contain\n# documented source files. You may enter file names like myfile.cpp or\n# directories like /usr/src/myproject. Separate the files or directories with\n# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING\n# Note: If this tag is empty the current directory is searched.\n\nINPUT                  = src\n\n# This tag can be used to specify the character encoding of the source files\n# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses\n# libiconv (or the iconv built into libc) for the transcoding. See the libiconv\n# documentation (see: http://www.gnu.org/software/libiconv) for the list of\n# possible encodings.\n# The default value is: UTF-8.\n\nINPUT_ENCODING         = UTF-8\n\n# If the value of the INPUT tag contains directories, you can use the\n# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and\n# *.h) to filter out the source-files in the directories.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# read by doxygen.\n#\n# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,\n# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,\n# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,\n# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,\n# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.\n\nFILE_PATTERNS          = *.c \\\n                         *.cc \\\n                         *.cxx \\\n                         *.cpp \\\n                         *.c++ \\\n                         *.d \\\n                         *.java \\\n                         *.ii \\\n                         *.ixx \\\n                         *.ipp \\\n                         *.i++ \\\n                         *.inl \\\n                         *.h \\\n                         *.hh \\\n                         *.hxx \\\n                         *.hpp \\\n                         *.h++ \\\n                         *.idl \\\n                         *.odl \\\n                         *.cs \\\n                         *.php \\\n                         *.php3 \\\n                         *.inc \\\n                         *.m \\\n                         *.mm \\\n                         *.dox \\\n                         *.py \\\n                         *.f90 \\\n                         *.f \\\n                         *.for \\\n                         *.vhd \\\n                         *.vhdl\n\n# The RECURSIVE tag can be used to specify whether or not subdirectories should\n# be searched for input files as well.\n# The default value is: NO.\n\nRECURSIVE              = YES\n\n# The EXCLUDE tag can be used to specify files and/or directories that should be\n# excluded from the INPUT source files. This way you can easily exclude a\n# subdirectory from a directory tree whose root is specified with the INPUT tag.\n#\n# Note that relative paths are relative to the directory from which doxygen is\n# run.\n\nEXCLUDE                = src/leveldb \\\n                         src/json \\\n                         src/test \\\n                         src/qt/test\n\n# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or\n# directories that are symbolic links (a Unix file system feature) are excluded\n# from the input.\n# The default value is: NO.\n\nEXCLUDE_SYMLINKS       = NO\n\n# If the value of the INPUT tag contains directories, you can use the\n# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude\n# certain files from those directories.\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories for example use the pattern */test/*\n\nEXCLUDE_PATTERNS       =\n\n# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names\n# (namespaces, classes, functions, etc.) that should be excluded from the\n# output. The symbol name can be a fully qualified name, a word, or if the\n# wildcard * is used, a substring. Examples: ANamespace, AClass,\n# AClass::ANamespace, ANamespace::*Test\n#\n# Note that the wildcards are matched against the file with absolute path, so to\n# exclude all test directories use the pattern */test/*\n\nEXCLUDE_SYMBOLS        = boost \\\n                         google\n\n# The EXAMPLE_PATH tag can be used to specify one or more files or directories\n# that contain example code fragments that are included (see the \\include\n# command).\n\nEXAMPLE_PATH           =\n\n# If the value of the EXAMPLE_PATH tag contains directories, you can use the\n# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and\n# *.h) to filter out the source-files in the directories. If left blank all\n# files are included.\n\nEXAMPLE_PATTERNS       = *\n\n# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be\n# searched for input files to be used with the \\include or \\dontinclude commands\n# irrespective of the value of the RECURSIVE tag.\n# The default value is: NO.\n\nEXAMPLE_RECURSIVE      = NO\n\n# The IMAGE_PATH tag can be used to specify one or more files or directories\n# that contain images that are to be included in the documentation (see the\n# \\image command).\n\nIMAGE_PATH             =\n\n# The INPUT_FILTER tag can be used to specify a program that doxygen should\n# invoke to filter for each input file. Doxygen will invoke the filter program\n# by executing (via popen()) the command:\n#\n# <filter> <input-file>\n#\n# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the\n# name of an input file. Doxygen will then use the output that the filter\n# program writes to standard output. If FILTER_PATTERNS is specified, this tag\n# will be ignored.\n#\n# Note that the filter must not add or remove lines; it is applied before the\n# code is scanned, but not when the output code is generated. If lines are added\n# or removed, the anchors will not be placed correctly.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# properly processed by doxygen.\n\nINPUT_FILTER           =\n\n# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern\n# basis. Doxygen will compare the file name with each pattern and apply the\n# filter if there is a match. The filters are a list of the form: pattern=filter\n# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how\n# filters are used. If the FILTER_PATTERNS tag is empty or if none of the\n# patterns match the file name, INPUT_FILTER is applied.\n#\n# Note that for custom extensions or not directly supported extensions you also\n# need to set EXTENSION_MAPPING for the extension otherwise the files are not\n# properly processed by doxygen.\n\nFILTER_PATTERNS        =\n\n# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using\n# INPUT_FILTER) will also be used to filter the input files that are used for\n# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).\n# The default value is: NO.\n\nFILTER_SOURCE_FILES    = NO\n\n# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file\n# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and\n# it is also possible to disable source filtering for a specific pattern using\n# *.ext= (so without naming a filter).\n# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.\n\nFILTER_SOURCE_PATTERNS =\n\n# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that\n# is part of the input, its contents will be placed on the main page\n# (index.html). This can be useful if you have a project on for instance GitHub\n# and want to reuse the introduction page also for the doxygen output.\n\nUSE_MDFILE_AS_MAINPAGE =\n\n#---------------------------------------------------------------------------\n# Configuration options related to source browsing\n#---------------------------------------------------------------------------\n\n# If the SOURCE_BROWSER tag is set to YES then a list of source files will be\n# generated. Documented entities will be cross-referenced with these sources.\n#\n# Note: To get rid of all source code in the generated output, make sure that\n# also VERBATIM_HEADERS is set to NO.\n# The default value is: NO.\n\nSOURCE_BROWSER         = YES\n\n# Setting the INLINE_SOURCES tag to YES will include the body of functions,\n# classes and enums directly into the documentation.\n# The default value is: NO.\n\nINLINE_SOURCES         = NO\n\n# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any\n# special comment blocks from generated source code fragments. Normal C, C++ and\n# Fortran comments will always remain visible.\n# The default value is: YES.\n\nSTRIP_CODE_COMMENTS    = YES\n\n# If the REFERENCED_BY_RELATION tag is set to YES then for each documented\n# function all documented functions referencing it will be listed.\n# The default value is: NO.\n\nREFERENCED_BY_RELATION = NO\n\n# If the REFERENCES_RELATION tag is set to YES then for each documented function\n# all documented entities called/used by that function will be listed.\n# The default value is: NO.\n\nREFERENCES_RELATION    = NO\n\n# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set\n# to YES then the hyperlinks from functions in REFERENCES_RELATION and\n# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will\n# link to the documentation.\n# The default value is: YES.\n\nREFERENCES_LINK_SOURCE = YES\n\n# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the\n# source code will show a tooltip with additional information such as prototype,\n# brief description and links to the definition and documentation. Since this\n# will make the HTML file larger and loading of large files a bit slower, you\n# can opt to disable this feature.\n# The default value is: YES.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nSOURCE_TOOLTIPS        = YES\n\n# If the USE_HTAGS tag is set to YES then the references to source code will\n# point to the HTML generated by the htags(1) tool instead of doxygen built-in\n# source browser. The htags tool is part of GNU's global source tagging system\n# (see http://www.gnu.org/software/global/global.html). You will need version\n# 4.8.6 or higher.\n#\n# To use it do the following:\n# - Install the latest version of global\n# - Enable SOURCE_BROWSER and USE_HTAGS in the config file\n# - Make sure the INPUT points to the root of the source tree\n# - Run doxygen as normal\n#\n# Doxygen will invoke htags (and that will in turn invoke gtags), so these\n# tools must be available from the command line (i.e. in the search path).\n#\n# The result: instead of the source browser generated by doxygen, the links to\n# source code will now point to the output of htags.\n# The default value is: NO.\n# This tag requires that the tag SOURCE_BROWSER is set to YES.\n\nUSE_HTAGS              = NO\n\n# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a\n# verbatim copy of the header file for each class for which an include is\n# specified. Set to NO to disable this.\n# See also: Section \\class.\n# The default value is: YES.\n\nVERBATIM_HEADERS       = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to the alphabetical class index\n#---------------------------------------------------------------------------\n\n# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all\n# compounds will be generated. Enable this if the project contains a lot of\n# classes, structs, unions or interfaces.\n# The default value is: YES.\n\nALPHABETICAL_INDEX     = YES\n\n# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in\n# which the alphabetical index list will be split.\n# Minimum value: 1, maximum value: 20, default value: 5.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nCOLS_IN_ALPHA_INDEX    = 5\n\n# In case all classes in a project start with a common prefix, all classes will\n# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag\n# can be used to specify a prefix (or a list of prefixes) that should be ignored\n# while generating the index headers.\n# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\n\nIGNORE_PREFIX          =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the HTML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output\n# The default value is: YES.\n\nGENERATE_HTML          = YES\n\n# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_OUTPUT            = html\n\n# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each\n# generated HTML page (for example: .htm, .php, .asp).\n# The default value is: .html.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FILE_EXTENSION    = .html\n\n# The HTML_HEADER tag can be used to specify a user-defined HTML header file for\n# each generated HTML page. If the tag is left blank doxygen will generate a\n# standard header.\n#\n# To get valid HTML the header file that includes any scripts and style sheets\n# that doxygen needs, which is dependent on the configuration options used (e.g.\n# the setting GENERATE_TREEVIEW). It is highly recommended to start with a\n# default header using\n# doxygen -w html new_header.html new_footer.html new_stylesheet.css\n# YourConfigFile\n# and then modify the file new_header.html. See also section \"Doxygen usage\"\n# for information on how to generate the default header that doxygen normally\n# uses.\n# Note: The header is subject to change so you typically have to regenerate the\n# default header when upgrading to a newer version of doxygen. For a description\n# of the possible markers and block names see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_HEADER            =\n\n# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each\n# generated HTML page. If the tag is left blank doxygen will generate a standard\n# footer. See HTML_HEADER for more information on how to generate a default\n# footer and what special commands can be used inside the footer. See also\n# section \"Doxygen usage\" for information on how to generate the default footer\n# that doxygen normally uses.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_FOOTER            =\n\n# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style\n# sheet that is used by each HTML page. It can be used to fine-tune the look of\n# the HTML output. If left blank doxygen will generate a default style sheet.\n# See also section \"Doxygen usage\" for information on how to generate the style\n# sheet that doxygen normally uses.\n# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as\n# it is more robust and this tag (HTML_STYLESHEET) will in the future become\n# obsolete.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_STYLESHEET        =\n\n# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined\n# cascading style sheets that are included after the standard style sheets\n# created by doxygen. Using this option one can overrule certain style aspects.\n# This is preferred over using HTML_STYLESHEET since it does not replace the\n# standard style sheet and is therefore more robust against future updates.\n# Doxygen will copy the style sheet files to the output directory.\n# Note: The order of the extra style sheet files is of importance (e.g. the last\n# style sheet in the list overrules the setting of the previous ones in the\n# list). For an example see the documentation.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_STYLESHEET  =\n\n# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the HTML output directory. Note\n# that these files will be copied to the base HTML output directory. Use the\n# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these\n# files. In the HTML_STYLESHEET file, use the file name only. Also note that the\n# files will be copied as-is; there are no commands or markers available.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_EXTRA_FILES       =\n\n# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen\n# will adjust the colors in the style sheet and background images according to\n# this color. Hue is specified as an angle on a colorwheel, see\n# http://en.wikipedia.org/wiki/Hue for more information. For instance the value\n# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300\n# purple, and 360 is red again.\n# Minimum value: 0, maximum value: 359, default value: 220.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_HUE    = 220\n\n# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors\n# in the HTML output. For a value of 0 the output will use grayscales only. A\n# value of 255 will produce the most vivid colors.\n# Minimum value: 0, maximum value: 255, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_SAT    = 100\n\n# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the\n# luminance component of the colors in the HTML output. Values below 100\n# gradually make the output lighter, whereas values above 100 make the output\n# darker. The value divided by 100 is the actual gamma applied, so 80 represents\n# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not\n# change the gamma.\n# Minimum value: 40, maximum value: 240, default value: 80.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_COLORSTYLE_GAMMA  = 80\n\n# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML\n# page will contain the date and time when the page was generated. Setting this\n# to YES can help to show when doxygen was last run and thus if the\n# documentation is up to date.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_TIMESTAMP         = YES\n\n# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML\n# documentation will contain sections that can be hidden and shown after the\n# page has loaded.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_DYNAMIC_SECTIONS  = NO\n\n# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries\n# shown in the various tree structured indices initially; the user can expand\n# and collapse entries dynamically later on. Doxygen will expand the tree to\n# such a level that at most the specified number of entries are visible (unless\n# a fully collapsed tree already exceeds this amount). So setting the number of\n# entries 1 will produce a full collapsed tree by default. 0 is a special value\n# representing an infinite number of entries and will result in a full expanded\n# tree by default.\n# Minimum value: 0, maximum value: 9999, default value: 100.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nHTML_INDEX_NUM_ENTRIES = 100\n\n# If the GENERATE_DOCSET tag is set to YES, additional index files will be\n# generated that can be used as input for Apple's Xcode 3 integrated development\n# environment (see: http://developer.apple.com/tools/xcode/), introduced with\n# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a\n# Makefile in the HTML output directory. Running make will produce the docset in\n# that directory and running make install will install the docset in\n# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at\n# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html\n# for more information.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_DOCSET        = NO\n\n# This tag determines the name of the docset feed. A documentation feed provides\n# an umbrella under which multiple documentation sets from a single provider\n# (such as a company or product suite) can be grouped.\n# The default value is: Doxygen generated docs.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_FEEDNAME        = \"Doxygen generated docs\"\n\n# This tag specifies a string that should uniquely identify the documentation\n# set bundle. This should be a reverse domain-name style string, e.g.\n# com.mycompany.MyDocSet. Doxygen will append .docset to the name.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_BUNDLE_ID       = org.bitcoin.Bitcoin-Core\n\n# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify\n# the documentation publisher. This should be a reverse domain-name style\n# string, e.g. com.mycompany.MyDocSet.documentation.\n# The default value is: org.doxygen.Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_ID    = org.bitcoin.Bitcoin-Core\n\n# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.\n# The default value is: Publisher.\n# This tag requires that the tag GENERATE_DOCSET is set to YES.\n\nDOCSET_PUBLISHER_NAME  = Publisher\n\n# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three\n# additional HTML index files: index.hhp, index.hhc, and index.hhk. The\n# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop\n# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on\n# Windows.\n#\n# The HTML Help Workshop contains a compiler that can convert all HTML output\n# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML\n# files are now used as the Windows 98 help format, and will replace the old\n# Windows help format (.hlp) on all Windows platforms in the future. Compressed\n# HTML files also contain an index, a table of contents, and you can search for\n# words in the documentation. The HTML workshop also contains a viewer for\n# compressed HTML files.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_HTMLHELP      = NO\n\n# The CHM_FILE tag can be used to specify the file name of the resulting .chm\n# file. You can add a path in front of the file if the result should not be\n# written to the html output directory.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_FILE               =\n\n# The HHC_LOCATION tag can be used to specify the location (absolute path\n# including file name) of the HTML help compiler (hhc.exe). If non-empty,\n# doxygen will try to run the HTML help compiler on the generated index.hhp.\n# The file has to be specified with full path.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nHHC_LOCATION           =\n\n# The GENERATE_CHI flag controls if a separate .chi index file is generated\n# (YES) or that it should be included in the master .chm file (NO).\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nGENERATE_CHI           = NO\n\n# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)\n# and project file content.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nCHM_INDEX_ENCODING     =\n\n# The BINARY_TOC flag controls whether a binary table of contents is generated\n# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it\n# enables the Previous and Next buttons.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nBINARY_TOC             = NO\n\n# The TOC_EXPAND flag can be set to YES to add extra items for group members to\n# the table of contents of the HTML help documentation and to the tree view.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\n\nTOC_EXPAND             = NO\n\n# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and\n# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that\n# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help\n# (.qch) of the generated HTML documentation.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_QHP           = NO\n\n# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify\n# the file name of the resulting .qch file. The path specified is relative to\n# the HTML output folder.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQCH_FILE               =\n\n# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help\n# Project output. For more information please see Qt Help Project / Namespace\n# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_NAMESPACE          = org.doxygen.Project\n\n# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt\n# Help Project output. For more information please see Qt Help Project / Virtual\n# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-\n# folders).\n# The default value is: doc.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_VIRTUAL_FOLDER     = doc\n\n# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom\n# filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_NAME   =\n\n# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the\n# custom filter to add. For more information please see Qt Help Project / Custom\n# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\n# filters).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_CUST_FILTER_ATTRS  =\n\n# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this\n# project's filter section matches. Qt Help Project / Filter Attributes (see:\n# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHP_SECT_FILTER_ATTRS  =\n\n# The QHG_LOCATION tag can be used to specify the location of Qt's\n# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the\n# generated .qhp file.\n# This tag requires that the tag GENERATE_QHP is set to YES.\n\nQHG_LOCATION           =\n\n# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be\n# generated, together with the HTML files, they form an Eclipse help plugin. To\n# install this plugin and make it available under the help contents menu in\n# Eclipse, the contents of the directory containing the HTML and XML files needs\n# to be copied into the plugins directory of eclipse. The name of the directory\n# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.\n# After copying Eclipse needs to be restarted before the help appears.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_ECLIPSEHELP   = NO\n\n# A unique identifier for the Eclipse help plugin. When installing the plugin\n# the directory name containing the HTML and XML files should also have this\n# name. Each documentation set should have its own identifier.\n# The default value is: org.doxygen.Project.\n# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.\n\nECLIPSE_DOC_ID         = org.doxygen.Project\n\n# If you want full control over the layout of the generated HTML pages it might\n# be necessary to disable the index and replace it with your own. The\n# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top\n# of each HTML page. A value of NO enables the index and the value YES disables\n# it. Since the tabs in the index contain the same information as the navigation\n# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nDISABLE_INDEX          = NO\n\n# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n# structure should be generated to display hierarchical information. If the tag\n# value is set to YES, a side panel will be generated containing a tree-like\n# index structure (just like the one that is generated for HTML Help). For this\n# to work a browser that supports JavaScript, DHTML, CSS and frames is required\n# (i.e. any modern browser). Windows users are probably better off using the\n# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can\n# further fine-tune the look of the index. As an example, the default style\n# sheet generated by doxygen has an example that shows how to put an image at\n# the root of the tree instead of the PROJECT_NAME. Since the tree basically has\n# the same information as the tab index, you could consider setting\n# DISABLE_INDEX to YES when enabling this option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nGENERATE_TREEVIEW      = NO\n\n# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that\n# doxygen will group on one line in the generated HTML documentation.\n#\n# Note that a value of 0 will completely suppress the enum values from appearing\n# in the overview section.\n# Minimum value: 0, maximum value: 20, default value: 4.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nENUM_VALUES_PER_LINE   = 4\n\n# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used\n# to set the initial width (in pixels) of the frame in which the tree is shown.\n# Minimum value: 0, maximum value: 1500, default value: 250.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nTREEVIEW_WIDTH         = 250\n\n# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to\n# external symbols imported via tag files in a separate window.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nEXT_LINKS_IN_WINDOW    = NO\n\n# Use this tag to change the font size of LaTeX formulas included as images in\n# the HTML documentation. When you change the font size after a successful\n# doxygen run you need to manually remove any form_*.png images from the HTML\n# output directory to force them to be regenerated.\n# Minimum value: 8, maximum value: 50, default value: 10.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_FONTSIZE       = 10\n\n# Use the FORMULA_TRANPARENT tag to determine whether or not the images\n# generated for formulas are transparent PNGs. Transparent PNGs are not\n# supported properly for IE 6.0, but are supported on all modern browsers.\n#\n# Note that when changing this option you need to delete any form_*.png files in\n# the HTML output directory before the changes have effect.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nFORMULA_TRANSPARENT    = YES\n\n# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see\n# http://www.mathjax.org) which uses client side Javascript for the rendering\n# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX\n# installed or if you want to formulas look prettier in the HTML output. When\n# enabled you may also need to install MathJax separately and configure the path\n# to it using the MATHJAX_RELPATH option.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nUSE_MATHJAX            = NO\n\n# When MathJax is enabled you can set the default output format to be used for\n# the MathJax output. See the MathJax site (see:\n# http://docs.mathjax.org/en/latest/output.html) for more details.\n# Possible values are: HTML-CSS (which is slower, but has the best\n# compatibility), NativeMML (i.e. MathML) and SVG.\n# The default value is: HTML-CSS.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_FORMAT         = HTML-CSS\n\n# When MathJax is enabled you need to specify the location relative to the HTML\n# output directory using the MATHJAX_RELPATH option. The destination directory\n# should contain the MathJax.js script. For instance, if the mathjax directory\n# is located at the same level as the HTML output directory, then\n# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax\n# Content Delivery Network so you can quickly see the result without installing\n# MathJax. However, it is strongly recommended to install a local copy of\n# MathJax from http://www.mathjax.org before deployment.\n# The default value is: http://cdn.mathjax.org/mathjax/latest.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_RELPATH        = http://www.mathjax.org/mathjax\n\n# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax\n# extension names that should be enabled during MathJax rendering. For example\n# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_EXTENSIONS     =\n\n# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces\n# of code that will be used on startup of the MathJax code. See the MathJax site\n# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an\n# example see the documentation.\n# This tag requires that the tag USE_MATHJAX is set to YES.\n\nMATHJAX_CODEFILE       =\n\n# When the SEARCHENGINE tag is enabled doxygen will generate a search box for\n# the HTML output. The underlying search engine uses javascript and DHTML and\n# should work on any modern browser. Note that when using HTML help\n# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)\n# there is already a search function so this one should typically be disabled.\n# For large projects the javascript based search engine can be slow, then\n# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to\n# search using the keyboard; to jump to the search box use <access key> + S\n# (what the <access key> is depends on the OS and browser, but it is typically\n# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down\n# key> to jump into the search results window, the results can be navigated\n# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel\n# the search. The filter options can be selected when the cursor is inside the\n# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>\n# to select a filter and <Enter> or <escape> to activate or cancel the filter\n# option.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_HTML is set to YES.\n\nSEARCHENGINE           = YES\n\n# When the SERVER_BASED_SEARCH tag is enabled the search engine will be\n# implemented using a web server instead of a web client using Javascript. There\n# are two flavors of web server based searching depending on the EXTERNAL_SEARCH\n# setting. When disabled, doxygen will generate a PHP script for searching and\n# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing\n# and searching needs to be provided by external tools. See the section\n# \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSERVER_BASED_SEARCH    = NO\n\n# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP\n# script for searching. Instead the search results are written to an XML file\n# which needs to be processed by an external indexer. Doxygen will invoke an\n# external search engine pointed to by the SEARCHENGINE_URL option to obtain the\n# search results.\n#\n# Doxygen ships with an example indexer (doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: http://xapian.org/).\n#\n# See the section \"External Indexing and Searching\" for details.\n# The default value is: NO.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH        = NO\n\n# The SEARCHENGINE_URL should point to a search engine hosted by a web server\n# which will return the search results when EXTERNAL_SEARCH is enabled.\n#\n# Doxygen ships with an example indexer (doxyindexer) and search engine\n# (doxysearch.cgi) which are based on the open source search engine library\n# Xapian (see: http://xapian.org/). See the section \"External Indexing and\n# Searching\" for details.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHENGINE_URL       =\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed\n# search data is written to a file for indexing by an external tool. With the\n# SEARCHDATA_FILE tag the name of this file can be specified.\n# The default file is: searchdata.xml.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nSEARCHDATA_FILE        = searchdata.xml\n\n# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the\n# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is\n# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple\n# projects and redirect the results back to the right project.\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTERNAL_SEARCH_ID     =\n\n# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen\n# projects other than the one defined by this configuration file, but that are\n# all added to the same external search index. Each project needs to have a\n# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of\n# to a relative location where the documentation can be found. The format is:\n# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...\n# This tag requires that the tag SEARCHENGINE is set to YES.\n\nEXTRA_SEARCH_MAPPINGS  =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the LaTeX output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.\n# The default value is: YES.\n\nGENERATE_LATEX         = NO\n\n# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_OUTPUT           = latex\n\n# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be\n# invoked.\n#\n# Note that when enabling USE_PDFLATEX this option is only used for generating\n# bitmaps for formulas in the HTML output, but not in the Makefile that is\n# written to the output directory.\n# The default file is: latex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_CMD_NAME         = latex\n\n# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate\n# index for LaTeX.\n# The default file is: makeindex.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nMAKEINDEX_CMD_NAME     = makeindex\n\n# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nCOMPACT_LATEX          = NO\n\n# The PAPER_TYPE tag can be used to set the paper type that is used by the\n# printer.\n# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x\n# 14 inches) and executive (7.25 x 10.5 inches).\n# The default value is: a4.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPAPER_TYPE             = a4\n\n# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names\n# that should be included in the LaTeX output. The package can be specified just\n# by its name or with the correct syntax as to be used with the LaTeX\n# \\usepackage command. To get the times font for instance you can specify :\n# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}\n# To use the option intlimits with the amsmath package you can specify:\n# EXTRA_PACKAGES=[intlimits]{amsmath}\n# If left blank no extra packages will be included.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nEXTRA_PACKAGES         =\n\n# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the\n# generated LaTeX document. The header should contain everything until the first\n# chapter. If it is left blank doxygen will generate a standard header. See\n# section \"Doxygen usage\" for information on how to let doxygen write the\n# default header to a separate file.\n#\n# Note: Only use a user-defined header if you know what you are doing! The\n# following commands have a special meaning inside the header: $title,\n# $datetime, $date, $doxygenversion, $projectname, $projectnumber,\n# $projectbrief, $projectlogo. Doxygen will replace $title with the empty\n# string, for the replacement values of the other commands the user is referred\n# to HTML_HEADER.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HEADER           =\n\n# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the\n# generated LaTeX document. The footer should contain everything after the last\n# chapter. If it is left blank doxygen will generate a standard footer. See\n# LATEX_HEADER for more information on how to generate a default footer and what\n# special commands can be used inside the footer.\n#\n# Note: Only use a user-defined footer if you know what you are doing!\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_FOOTER           =\n\n# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined\n# LaTeX style sheets that are included after the standard style sheets created\n# by doxygen. Using this option one can overrule certain style aspects. Doxygen\n# will copy the style sheet files to the output directory.\n# Note: The order of the extra style sheet files is of importance (e.g. the last\n# style sheet in the list overrules the setting of the previous ones in the\n# list).\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_STYLESHEET =\n\n# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or\n# other source files which should be copied to the LATEX_OUTPUT output\n# directory. Note that the files will be copied as-is; there are no commands or\n# markers available.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_EXTRA_FILES      =\n\n# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is\n# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will\n# contain links (just like the HTML output) instead of page references. This\n# makes the output suitable for online browsing using a PDF viewer.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nPDF_HYPERLINKS         = YES\n\n# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate\n# the PDF file directly from the LaTeX files. Set this option to YES, to get a\n# higher quality PDF documentation.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nUSE_PDFLATEX           = YES\n\n# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode\n# command to the generated LaTeX files. This will instruct LaTeX to keep running\n# if errors occur, instead of asking the user for help. This option is also used\n# when generating formulas in HTML.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BATCHMODE        = NO\n\n# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the\n# index chapters (such as File Index, Compound Index, etc.) in the output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_HIDE_INDICES     = NO\n\n# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source\n# code with syntax highlighting in the LaTeX output.\n#\n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_SOURCE_CODE      = NO\n\n# The LATEX_BIB_STYLE tag can be used to specify the style to use for the\n# bibliography, e.g. plainnat, or ieeetr. See\n# http://en.wikipedia.org/wiki/BibTeX and \\cite for more info.\n# The default value is: plain.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_BIB_STYLE        = plain\n\n# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated\n# page will contain the date and time when the page was generated. Setting this\n# to NO can help when comparing the output of multiple runs.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_LATEX is set to YES.\n\nLATEX_TIMESTAMP        = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the RTF output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The\n# RTF output is optimized for Word 97 and may not look too pretty with other RTF\n# readers/editors.\n# The default value is: NO.\n\nGENERATE_RTF           = NO\n\n# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: rtf.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_OUTPUT             = rtf\n\n# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF\n# documents. This may be useful for small projects and may help to save some\n# trees in general.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nCOMPACT_RTF            = NO\n\n# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will\n# contain hyperlink fields. The RTF file will contain links (just like the HTML\n# output) instead of page references. This makes the output suitable for online\n# browsing using Word or some other Word compatible readers that support those\n# fields.\n#\n# Note: WordPad (write) and others do not support links.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_HYPERLINKS         = NO\n\n# Load stylesheet definitions from file. Syntax is similar to doxygen's config\n# file, i.e. a series of assignments. You only have to provide replacements,\n# missing definitions are set to their default value.\n#\n# See also section \"Doxygen usage\" for information on how to generate the\n# default style sheet that doxygen normally uses.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_STYLESHEET_FILE    =\n\n# Set optional variables used in the generation of an RTF document. Syntax is\n# similar to doxygen's config file. A template extensions file can be generated\n# using doxygen -e rtf extensionFile.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_EXTENSIONS_FILE    =\n\n# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code\n# with syntax highlighting in the RTF output.\n#\n# Note that which sources are shown also depends on other settings such as\n# SOURCE_BROWSER.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_RTF is set to YES.\n\nRTF_SOURCE_CODE        = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the man page output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for\n# classes and files.\n# The default value is: NO.\n\nGENERATE_MAN           = NO\n\n# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it. A directory man3 will be created inside the directory specified by\n# MAN_OUTPUT.\n# The default directory is: man.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_OUTPUT             = man\n\n# The MAN_EXTENSION tag determines the extension that is added to the generated\n# man pages. In case the manual section does not start with a number, the number\n# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is\n# optional.\n# The default value is: .3.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_EXTENSION          = .3\n\n# The MAN_SUBDIR tag determines the name of the directory created within\n# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by\n# MAN_EXTENSION with the initial . removed.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_SUBDIR             =\n\n# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it\n# will generate one additional man file for each entity documented in the real\n# man page(s). These additional files only source the real man page, but without\n# them the man command would be unable to find the correct page.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_MAN is set to YES.\n\nMAN_LINKS              = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the XML output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that\n# captures the structure of the code including all documentation.\n# The default value is: NO.\n\nGENERATE_XML           = NO\n\n# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a\n# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\n# it.\n# The default directory is: xml.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_OUTPUT             = xml\n\n# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program\n# listings (including syntax highlighting and cross-referencing information) to\n# the XML output. Note that enabling this will significantly increase the size\n# of the XML output.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_XML is set to YES.\n\nXML_PROGRAMLISTING     = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to the DOCBOOK output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files\n# that can be used to generate PDF.\n# The default value is: NO.\n\nGENERATE_DOCBOOK       = NO\n\n# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.\n# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in\n# front of it.\n# The default directory is: docbook.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_OUTPUT         = docbook\n\n# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the\n# program listings (including syntax highlighting and cross-referencing\n# information) to the DOCBOOK output. Note that enabling this will significantly\n# increase the size of the DOCBOOK output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\n\nDOCBOOK_PROGRAMLISTING = NO\n\n#---------------------------------------------------------------------------\n# Configuration options for the AutoGen Definitions output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an\n# AutoGen Definitions (see http://autogen.sf.net) file that captures the\n# structure of the code including all documentation. Note that this feature is\n# still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_AUTOGEN_DEF   = NO\n\n#---------------------------------------------------------------------------\n# Configuration options related to the Perl module output\n#---------------------------------------------------------------------------\n\n# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module\n# file that captures the structure of the code including all documentation.\n#\n# Note that this feature is still experimental and incomplete at the moment.\n# The default value is: NO.\n\nGENERATE_PERLMOD       = NO\n\n# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary\n# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI\n# output from the Perl module output.\n# The default value is: NO.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_LATEX          = NO\n\n# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely\n# formatted so it can be parsed by a human reader. This is useful if you want to\n# understand what is going on. On the other hand, if this tag is set to NO, the\n# size of the Perl module output will be much smaller and Perl will parse it\n# just the same.\n# The default value is: YES.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_PRETTY         = YES\n\n# The names of the make variables in the generated doxyrules.make file are\n# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful\n# so different doxyrules.make files included by the same Makefile don't\n# overwrite each other's variables.\n# This tag requires that the tag GENERATE_PERLMOD is set to YES.\n\nPERLMOD_MAKEVAR_PREFIX =\n\n#---------------------------------------------------------------------------\n# Configuration options related to the preprocessor\n#---------------------------------------------------------------------------\n\n# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all\n# C-preprocessor directives found in the sources and include files.\n# The default value is: YES.\n\nENABLE_PREPROCESSING   = YES\n\n# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names\n# in the source code. If set to NO, only conditional compilation will be\n# performed. Macro expansion can be done in a controlled way by setting\n# EXPAND_ONLY_PREDEF to YES.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nMACRO_EXPANSION        = NO\n\n# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then\n# the macro expansion is limited to the macros specified with the PREDEFINED and\n# EXPAND_AS_DEFINED tags.\n# The default value is: NO.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_ONLY_PREDEF     = NO\n\n# If the SEARCH_INCLUDES tag is set to YES, the include files in the\n# INCLUDE_PATH will be searched if a #include is found.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSEARCH_INCLUDES        = YES\n\n# The INCLUDE_PATH tag can be used to specify one or more directories that\n# contain include files that are not input files but should be processed by the\n# preprocessor.\n# This tag requires that the tag SEARCH_INCLUDES is set to YES.\n\nINCLUDE_PATH           =\n\n# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard\n# patterns (like *.h and *.hpp) to filter out the header-files in the\n# directories. If left blank, the patterns specified with FILE_PATTERNS will be\n# used.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nINCLUDE_FILE_PATTERNS  =\n\n# The PREDEFINED tag can be used to specify one or more macro names that are\n# defined before the preprocessor is started (similar to the -D option of e.g.\n# gcc). The argument of the tag is a list of macros of the form: name or\n# name=definition (no spaces). If the definition and the \"=\" are omitted, \"=1\"\n# is assumed. To prevent a macro definition from being undefined via #undef or\n# recursively expanded use the := operator instead of the = operator.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nPREDEFINED             =\n\n# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this\n# tag can be used to specify a list of macro names that should be expanded. The\n# macro definition that is found in the sources will be used. Use the PREDEFINED\n# tag if you want to use a different macro definition that overrules the\n# definition found in the source code.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nEXPAND_AS_DEFINED      =\n\n# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will\n# remove all references to function-like macros that are alone on a line, have\n# an all uppercase name, and do not end with a semicolon. Such function macros\n# are typically used for boiler-plate code, and will confuse the parser if not\n# removed.\n# The default value is: YES.\n# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\n\nSKIP_FUNCTION_MACROS   = YES\n\n#---------------------------------------------------------------------------\n# Configuration options related to external references\n#---------------------------------------------------------------------------\n\n# The TAGFILES tag can be used to specify one or more tag files. For each tag\n# file the location of the external documentation should be added. The format of\n# a tag file without this location is as follows:\n# TAGFILES = file1 file2 ...\n# Adding location for the tag files is done as follows:\n# TAGFILES = file1=loc1 \"file2 = loc2\" ...\n# where loc1 and loc2 can be relative or absolute paths or URLs. See the\n# section \"Linking to external documentation\" for more information about the use\n# of tag files.\n# Note: Each tag file must have a unique name (where the name does NOT include\n# the path). If a tag file is not located in the directory in which doxygen is\n# run, you must also specify the path to the tagfile here.\n\nTAGFILES               =\n\n# When a file name is specified after GENERATE_TAGFILE, doxygen will create a\n# tag file that is based on the input files it reads. See section \"Linking to\n# external documentation\" for more information about the usage of tag files.\n\nGENERATE_TAGFILE       =\n\n# If the ALLEXTERNALS tag is set to YES, all external class will be listed in\n# the class index. If set to NO, only the inherited external classes will be\n# listed.\n# The default value is: NO.\n\nALLEXTERNALS           = NO\n\n# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed\n# in the modules index. If set to NO, only the current project's groups will be\n# listed.\n# The default value is: YES.\n\nEXTERNAL_GROUPS        = YES\n\n# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in\n# the related pages index. If set to NO, only the current project's pages will\n# be listed.\n# The default value is: YES.\n\nEXTERNAL_PAGES         = YES\n\n# The PERL_PATH should be the absolute path and name of the perl script\n# interpreter (i.e. the result of 'which perl').\n# The default file (with absolute path) is: /usr/bin/perl.\n\nPERL_PATH              = /usr/bin/perl\n\n#---------------------------------------------------------------------------\n# Configuration options related to the dot tool\n#---------------------------------------------------------------------------\n\n# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram\n# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to\n# NO turns the diagrams off. Note that this option also works with HAVE_DOT\n# disabled, but it is recommended to install and use dot, since it yields more\n# powerful graphs.\n# The default value is: YES.\n\nCLASS_DIAGRAMS         = YES\n\n# You can define message sequence charts within doxygen comments using the \\msc\n# command. Doxygen will then run the mscgen tool (see:\n# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the\n# documentation. The MSCGEN_PATH tag allows you to specify the directory where\n# the mscgen tool resides. If left empty the tool is assumed to be found in the\n# default search path.\n\nMSCGEN_PATH            =\n\n# You can include diagrams made with dia in doxygen documentation. Doxygen will\n# then run dia to produce the diagram and insert it in the documentation. The\n# DIA_PATH tag allows you to specify the directory where the dia binary resides.\n# If left empty dia is assumed to be found in the default search path.\n\nDIA_PATH               =\n\n# If set to YES the inheritance and collaboration graphs will hide inheritance\n# and usage relations if the target is undocumented or is not a class.\n# The default value is: YES.\n\nHIDE_UNDOC_RELATIONS   = YES\n\n# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is\n# available from the path. This tool is part of Graphviz (see:\n# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent\n# Bell Labs. The other options in this section have no effect if this option is\n# set to NO\n# The default value is: NO.\n\nHAVE_DOT               = YES\n\n# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed\n# to run in parallel. When set to 0 doxygen will base this on the number of\n# processors available in the system. You can set it explicitly to a value\n# larger than 0 to get control over the balance between CPU load and processing\n# speed.\n# Minimum value: 0, maximum value: 32, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_NUM_THREADS        = 0\n\n# When you want a differently looking font in the dot files that doxygen\n# generates you can specify the font name using DOT_FONTNAME. You need to make\n# sure dot is able to find the font, which can be done by putting it in a\n# standard location or by setting the DOTFONTPATH environment variable or by\n# setting DOT_FONTPATH to the directory containing the font.\n# The default value is: Helvetica.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTNAME           = Helvetica\n\n# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of\n# dot graphs.\n# Minimum value: 4, maximum value: 24, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTSIZE           = 10\n\n# By default doxygen will tell dot to use the default font as specified with\n# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set\n# the path where dot can find it using this tag.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_FONTPATH           =\n\n# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for\n# each documented class showing the direct and indirect inheritance relations.\n# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCLASS_GRAPH            = YES\n\n# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a\n# graph for each documented class showing the direct and indirect implementation\n# dependencies (inheritance, containment, and class references variables) of the\n# class with other documented classes.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCOLLABORATION_GRAPH    = YES\n\n# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for\n# groups, showing the direct groups dependencies.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGROUP_GRAPHS           = YES\n\n# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and\n# collaboration diagrams in a style similar to the OMG's Unified Modeling\n# Language.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LOOK               = NO\n\n# If the UML_LOOK tag is enabled, the fields and methods are shown inside the\n# class node. If there are many fields or methods and many nodes the graph may\n# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the\n# number of items for each type to make the size more manageable. Set this to 0\n# for no limit. Note that the threshold may be exceeded by 50% before the limit\n# is enforced. So when you set the threshold to 10, up to 15 fields may appear,\n# but if the number exceeds 15, the total amount of fields shown is limited to\n# 10.\n# Minimum value: 0, maximum value: 100, default value: 10.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nUML_LIMIT_NUM_FIELDS   = 10\n\n# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and\n# collaboration graphs will show the relations between templates and their\n# instances.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nTEMPLATE_RELATIONS     = NO\n\n# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to\n# YES then doxygen will generate a graph for each documented file showing the\n# direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDE_GRAPH          = YES\n\n# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are\n# set to YES then doxygen will generate a graph for each documented file showing\n# the direct and indirect include dependencies of the file with other documented\n# files.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINCLUDED_BY_GRAPH      = YES\n\n# If the CALL_GRAPH tag is set to YES then doxygen will generate a call\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable call graphs for selected\n# functions only using the \\callgraph command. Disabling a call graph can be\n# accomplished by means of the command \\hidecallgraph.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALL_GRAPH             = YES\n\n# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller\n# dependency graph for every global function or class method.\n#\n# Note that enabling this option will significantly increase the time of a run.\n# So in most cases it will be better to enable caller graphs for selected\n# functions only using the \\callergraph command. Disabling a caller graph can be\n# accomplished by means of the command \\hidecallergraph.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nCALLER_GRAPH           = YES\n\n# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical\n# hierarchy of all classes instead of a textual one.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGRAPHICAL_HIERARCHY    = YES\n\n# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the\n# dependencies a directory has on other directories in a graphical way. The\n# dependency relations are determined by the #include relations between the\n# files in the directories.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDIRECTORY_GRAPH        = YES\n\n# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images\n# generated by dot. For an explanation of the image formats see the section\n# output formats in the documentation of the dot tool (Graphviz (see:\n# http://www.graphviz.org/)).\n# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order\n# to make the SVG files visible in IE 9+ (other browsers do not have this\n# requirement).\n# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,\n# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and\n# png:gdiplus:gdiplus.\n# The default value is: png.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_IMAGE_FORMAT       = svg\n\n# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to\n# enable generation of interactive SVG images that allow zooming and panning.\n#\n# Note that this requires a modern browser other than Internet Explorer. Tested\n# and working are Firefox, Chrome, Safari, and Opera.\n# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make\n# the SVG files visible. Older versions of IE do not have SVG support.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nINTERACTIVE_SVG        = NO\n\n# The DOT_PATH tag can be used to specify the path where the dot tool can be\n# found. If left blank, it is assumed the dot tool can be found in the path.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_PATH               =\n\n# The DOTFILE_DIRS tag can be used to specify one or more directories that\n# contain dot files that are included in the documentation (see the \\dotfile\n# command).\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOTFILE_DIRS           =\n\n# The MSCFILE_DIRS tag can be used to specify one or more directories that\n# contain msc files that are included in the documentation (see the \\mscfile\n# command).\n\nMSCFILE_DIRS           =\n\n# The DIAFILE_DIRS tag can be used to specify one or more directories that\n# contain dia files that are included in the documentation (see the \\diafile\n# command).\n\nDIAFILE_DIRS           =\n\n# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the\n# path where java can find the plantuml.jar file. If left blank, it is assumed\n# PlantUML is not used or called during a preprocessing step. Doxygen will\n# generate a warning when it encounters a \\startuml command in this case and\n# will not generate output for the diagram.\n\nPLANTUML_JAR_PATH      =\n\n# When using plantuml, the specified paths are searched for files specified by\n# the !include statement in a plantuml block.\n\nPLANTUML_INCLUDE_PATH  =\n\n# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes\n# that will be shown in the graph. If the number of nodes in a graph becomes\n# larger than this value, doxygen will truncate the graph, which is visualized\n# by representing a node as a red box. Note that doxygen if the number of direct\n# children of the root node in a graph is already larger than\n# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that\n# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n# Minimum value: 0, maximum value: 10000, default value: 50.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_GRAPH_MAX_NODES    = 50\n\n# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs\n# generated by dot. A depth value of 3 means that only nodes reachable from the\n# root by following a path via at most 3 edges will be shown. Nodes that lay\n# further from the root node will be omitted. Note that setting this option to 1\n# or 2 may greatly reduce the computation time needed for large code bases. Also\n# note that the size of a graph can be further restricted by\n# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n# Minimum value: 0, maximum value: 1000, default value: 0.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nMAX_DOT_GRAPH_DEPTH    = 0\n\n# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent\n# background. This is disabled by default, because dot on Windows does not seem\n# to support this out of the box.\n#\n# Warning: Depending on the platform used, enabling this option may lead to\n# badly anti-aliased labels on the edges of a graph (i.e. they become hard to\n# read).\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_TRANSPARENT        = NO\n\n# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output\n# files in one run (i.e. multiple -o and -T options on the command line). This\n# makes dot run faster, but since only newer versions of dot (>1.8.10) support\n# this, this feature is disabled by default.\n# The default value is: NO.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_MULTI_TARGETS      = NO\n\n# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page\n# explaining the meaning of the various boxes and arrows in the dot generated\n# graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nGENERATE_LEGEND        = YES\n\n# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot\n# files that are used to generate the various graphs.\n# The default value is: YES.\n# This tag requires that the tag HAVE_DOT is set to YES.\n\nDOT_CLEANUP            = YES\n"
  },
  {
    "path": "doc/README.md",
    "content": "Bitcoin Core\n=============\n\nSetup\n---------------------\nBitcoin Core is the original Bitcoin client and it builds the backbone of the network. It downloads and, by default, stores the entire history of Bitcoin transactions (which is currently more than 100 GBs); depending on the speed of your computer and network connection, the synchronization process can take anywhere from a few hours to a day or more.\n\nTo download Bitcoin Core, visit [bitcoincore.org](https://bitcoincore.org/en/releases/).\n\nRunning\n---------------------\nThe following are some helpful notes on how to run Bitcoin on your native platform.\n\n### Unix\n\nUnpack the files into a directory and run:\n\n- `bin/bitcoin-qt` (GUI) or\n- `bin/bitcoind` (headless)\n\n### Windows\n\nUnpack the files into a directory, and then run bitcoin-qt.exe.\n\n### OS X\n\nDrag Bitcoin-Core to your applications folder, and then run Bitcoin-Core.\n\n### Need Help?\n\n* See the documentation at the [Bitcoin Wiki](https://en.bitcoin.it/wiki/Main_Page)\nfor help and more information.\n* Ask for help on [#bitcoin](http://webchat.freenode.net?channels=bitcoin) on Freenode. If you don't have an IRC client use [webchat here](http://webchat.freenode.net?channels=bitcoin).\n* Ask for help on the [BitcoinTalk](https://bitcointalk.org/) forums, in the [Technical Support board](https://bitcointalk.org/index.php?board=4.0).\n\nBuilding\n---------------------\nThe following are developer notes on how to build Bitcoin on your native platform. They are not complete guides, but include notes on the necessary libraries, compile flags, etc.\n\n- [Dependencies](dependencies.md)\n- [OS X Build Notes](build-osx.md)\n- [Unix Build Notes](build-unix.md)\n- [Windows Build Notes](build-windows.md)\n- [OpenBSD Build Notes](build-openbsd.md)\n- [Gitian Building Guide](gitian-building.md)\n\nDevelopment\n---------------------\nThe Bitcoin repo's [root README](/README.md) contains relevant information on the development process and automated testing.\n\n- [Developer Notes](developer-notes.md)\n- [Release Notes](release-notes.md)\n- [Release Process](release-process.md)\n- [Source Code Documentation (External Link)](https://dev.visucore.com/bitcoin/doxygen/)\n- [Translation Process](translation_process.md)\n- [Translation Strings Policy](translation_strings_policy.md)\n- [Travis CI](travis-ci.md)\n- [Unauthenticated REST Interface](REST-interface.md)\n- [Shared Libraries](shared-libraries.md)\n- [BIPS](bips.md)\n- [Dnsseed Policy](dnsseed-policy.md)\n- [Benchmarking](benchmarking.md)\n\n### Resources\n* Discuss on the [BitcoinTalk](https://bitcointalk.org/) forums, in the [Development & Technical Discussion board](https://bitcointalk.org/index.php?board=6.0).\n* Discuss project-specific development on #bitcoin-core-dev on Freenode. If you don't have an IRC client use [webchat here](http://webchat.freenode.net/?channels=bitcoin-core-dev).\n* Discuss general Bitcoin development on #bitcoin-dev on Freenode. If you don't have an IRC client use [webchat here](http://webchat.freenode.net/?channels=bitcoin-dev).\n\n### Miscellaneous\n- [Assets Attribution](assets-attribution.md)\n- [Files](files.md)\n- [Fuzz-testing](fuzzing.md)\n- [Reduce Traffic](reduce-traffic.md)\n- [Tor Support](tor.md)\n- [Init Scripts (systemd/upstart/openrc)](init.md)\n- [ZMQ](zmq.md)\n\nLicense\n---------------------\nDistributed under the [MIT software license](/COPYING).\nThis product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](https://www.openssl.org/). This product includes\ncryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard.\n"
  },
  {
    "path": "doc/README_osx.md",
    "content": "Deterministic OS X Dmg Notes.\n\nWorking OS X DMGs are created in Linux by combining a recent clang,\nthe Apple binutils (ld, ar, etc) and DMG authoring tools.\n\nApple uses clang extensively for development and has upstreamed the necessary\nfunctionality so that a vanilla clang can take advantage. It supports the use\nof -F, -target, -mmacosx-version-min, and --sysroot, which are all necessary\nwhen building for OS X.\n\nApple's version of binutils (called cctools) contains lots of functionality\nmissing in the FSF's binutils. In addition to extra linker options for\nframeworks and sysroots, several other tools are needed as well such as\ninstall_name_tool, lipo, and nmedit. These do not build under linux, so they\nhave been patched to do so. The work here was used as a starting point:\n[mingwandroid/toolchain4](https://github.com/mingwandroid/toolchain4).\n\nIn order to build a working toolchain, the following source packages are needed\nfrom Apple: cctools, dyld, and ld64.\n\nThese tools inject timestamps by default, which produce non-deterministic\nbinaries. The ZERO_AR_DATE environment variable is used to disable that.\n\nThis version of cctools has been patched to use the current version of clang's\nheaders and its libLTO.so rather than those from llvmgcc, as it was\noriginally done in toolchain4.\n\nTo complicate things further, all builds must target an Apple SDK. These SDKs\nare free to download, but not redistributable.\nTo obtain it, register for a developer account, then download the [Xcode 7.3.1 dmg](https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg).\n\nThis file is several gigabytes in size, but only a single directory inside is\nneeded:\n```\nXcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk\n```\n\nUnfortunately, the usual linux tools (7zip, hpmount, loopback mount) are incapable of opening this file.\nTo create a tarball suitable for Gitian input, there are two options:\n\nUsing Mac OS X, you can mount the dmg, and then create it with:\n```\n  $ hdiutil attach Xcode_7.3.1.dmg\n  $ tar -C /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.11.sdk.tar.gz MacOSX10.11.sdk\n```\n\nAlternatively, you can use 7zip and SleuthKit to extract the files one by one.\nThe script contrib/macdeploy/extract-osx-sdk.sh automates this. First ensure\nthe dmg file is in the current directory, and then run the script. You may wish\nto delete the intermediate 5.hfs file and MacOSX10.11.sdk (the directory) when\nyou've confirmed the extraction succeeded.\n\n```bash\napt-get install p7zip-full sleuthkit\ncontrib/macdeploy/extract-osx-sdk.sh\nrm -rf 5.hfs MacOSX10.11.sdk\n```\n\nThe Gitian descriptors build 2 sets of files: Linux tools, then Apple binaries\nwhich are created using these tools. The build process has been designed to\navoid including the SDK's files in Gitian's outputs. All interim tarballs are\nfully deterministic and may be freely redistributed.\n\ngenisoimage is used to create the initial DMG. It is not deterministic as-is,\nso it has been patched. A system genisoimage will work fine, but it will not\nbe deterministic because the file-order will change between invocations.\nThe patch can be seen here:  [theuni/osx-cross-depends](https://raw.githubusercontent.com/theuni/osx-cross-depends/master/patches/cdrtools/genisoimage.diff).\nNo effort was made to fix this cleanly, so it likely leaks memory badly. But\nit's only used for a single invocation, so that's no real concern.\n\ngenisoimage cannot compress DMGs, so afterwards, the 'dmg' tool from the\nlibdmg-hfsplus project is used to compress it. There are several bugs in this\ntool and its maintainer has seemingly abandoned the project. It has been forked\nand is available (with fixes) here: [theuni/libdmg-hfsplus](https://github.com/theuni/libdmg-hfsplus).\n\nThe 'dmg' tool has the ability to create DMGs from scratch as well, but this\nfunctionality is broken. Only the compression feature is currently used.\nIdeally, the creation could be fixed and genisoimage would no longer be necessary.\n\nBackground images and other features can be added to DMG files by inserting a\n.DS_Store before creation. This is generated by the script\ncontrib/macdeploy/custom_dsstore.py.\n\nAs of OS X Mavericks (10.9), using an Apple-blessed key to sign binaries is a\nrequirement in order to satisfy the new Gatekeeper requirements. Because this\nprivate key cannot be shared, we'll have to be a bit creative in order for the\nbuild process to remain somewhat deterministic. Here's how it works:\n\n- Builders use Gitian to create an unsigned release. This outputs an unsigned\n  dmg which users may choose to bless and run. It also outputs an unsigned app\n  structure in the form of a tarball, which also contains all of the tools\n  that have been previously (deterministically) built in order to create a\n  final dmg.\n- The Apple keyholder uses this unsigned app to create a detached signature,\n  using the script that is also included there. Detached signatures are available from this [repository](https://github.com/bitcoin-core/bitcoin-detached-sigs).\n- Builders feed the unsigned app + detached signature back into Gitian. It\n  uses the pre-built tools to recombine the pieces into a deterministic dmg.\n"
  },
  {
    "path": "doc/README_windows.txt",
    "content": "Bitcoin Core\r\n=============\r\n\r\nIntro\r\n-----\r\nBitcoin is a free open source peer-to-peer electronic cash system that is\r\ncompletely decentralized, without the need for a central server or trusted\r\nparties.  Users hold the crypto keys to their own money and transact directly\r\nwith each other, with the help of a P2P network to check for double-spending.\r\n\r\n\r\nSetup\r\n-----\r\nUnpack the files into a directory and run bitcoin-qt.exe.\r\n\r\nBitcoin Core is the original Bitcoin client and it builds the backbone of the network.\r\nHowever, it downloads and stores the entire history of Bitcoin transactions;\r\ndepending on the speed of your computer and network connection, the synchronization\r\nprocess can take anywhere from a few hours to a day or more.\r\n\r\nSee the bitcoin wiki at:\r\n  https://en.bitcoin.it/wiki/Main_Page\r\nfor more help and information.\r\n"
  },
  {
    "path": "doc/REST-interface.md",
    "content": "Unauthenticated REST Interface\n==============================\n\nThe REST API can be enabled with the `-rest` option.\n\nThe interface runs on the same port as the JSON-RPC interface, by default port 34229 for mainnet, port 44229 for testnet,\nand port 45339 for regtest.\n\nSupported API\n-------------\n\n#### Transactions\n`GET /rest/tx/<TX-HASH>.<bin|hex|json>`\n\nGiven a transaction hash: returns a transaction in binary, hex-encoded binary, or JSON formats.\n\nFor full TX query capability, one must enable the transaction index via \"txindex=1\" command line / configuration option.\n\n#### Blocks\n`GET /rest/block/<BLOCK-HASH>.<bin|hex|json>`\n`GET /rest/block/notxdetails/<BLOCK-HASH>.<bin|hex|json>`\n\nGiven a block hash: returns a block, in binary, hex-encoded binary or JSON formats.\n\nThe HTTP request and response are both handled entirely in-memory, thus making maximum memory usage at least 2.66MB (1 MB max block, plus hex encoding) per request.\n\nWith the /notxdetails/ option JSON response will only contain the transaction hash instead of the complete transaction details. The option only affects the JSON response.\n\n#### Blockheaders\n`GET /rest/headers/<COUNT>/<BLOCK-HASH>.<bin|hex|json>`\n\nGiven a block hash: returns <COUNT> amount of blockheaders in upward direction.\n\n#### Chaininfos\n`GET /rest/chaininfo.json`\n\nReturns various state info regarding block chain processing.\nOnly supports JSON as output format.\n* chain : (string) current network name as defined in BIP70 (main, test, regtest)\n* blocks : (numeric) the current number of blocks processed in the server\n* headers : (numeric) the current number of headers we have validated\n* bestblockhash : (string) the hash of the currently best block\n* difficulty : (numeric) the current difficulty\n* mediantime : (numeric) the median time of the 11 blocks before the most recent block on the blockchain\n* verificationprogress : (numeric) estimate of verification progress [0..1]\n* chainwork : (string) total amount of work in active chain, in hexadecimal\n* pruned : (boolean) if the blocks are subject to pruning\n* pruneheight : (numeric) heighest block available\n* softforks : (array) status of softforks in progress\n* bip9_softforks : (object) status of BIP9 softforks in progress\n\n#### Query UTXO set\n`GET /rest/getutxos/<checkmempool>/<txid>-<n>/<txid>-<n>/.../<txid>-<n>.<bin|hex|json>`\n\nThe getutxo command allows querying of the UTXO set given a set of outpoints.\nSee BIP64 for input and output serialisation:\nhttps://github.com/bitcoin/bips/blob/master/bip-0064.mediawiki\n\nExample:\n```\n$ curl localhost:44229/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff7627ff72e5e8b0f71210f92ea7a4000c5d75-0.json 2>/dev/null | json_pp\n{\n   \"chainHeight\" : 325347,\n   \"chaintipHash\" : \"00000000fb01a7f3745a717f8caebee056c484e6e0bfe4a9591c235bb70506fb\",\n   \"bitmap\": \"1\",\n   \"utxos\" : [\n      {\n         \"txvers\" : 1\n         \"height\" : 2147483647,\n         \"value\" : 8.8687,\t\t \n         \"scriptPubKey\" : {\n            \"asm\" : \"OP_DUP OP_HASH160 1c7cebb529b86a04c683dfa87be49de35bcf589e OP_EQUALVERIFY OP_CHECKSIG\",\n            \"hex\" : \"76a9141c7cebb529b86a04c683dfa87be49de35bcf589e88ac\",\n            \"reqSigs\" : 1,\n            \"type\" : \"pubkeyhash\",\n            \"addresses\" : [\n               \"mi7as51dvLJsizWnTMurtRmrP8hG2m1XvD\"\n            ]\n         }\n      }\n   ]\n}\n```\n\n#### Memory pool\n`GET /rest/mempool/info.json`\n\nReturns various information about the TX mempool.\nOnly supports JSON as output format.\n* size : (numeric) the number of transactions in the TX mempool\n* bytes : (numeric) size of the TX mempool in bytes\n* usage : (numeric) total TX mempool memory usage\n* maxmempool : (numeric) maximum memory usage for the mempool in bytes\n* mempoolminfee : (numeric) minimum feerate (BTC per KB) for tx to be accepted\n\n`GET /rest/mempool/contents.json`\n\nReturns transactions in the TX mempool.\nOnly supports JSON as output format.\n\nRisks\n-------------\nRunning a web browser on the same node with a REST enabled bitcoind can be a risk. Accessing prepared XSS websites could read out tx/block data of your node by placing links like `<script src=\"http://127.0.0.1:34229/rest/tx/1234567890.json\">` which might break the nodes privacy.\n"
  },
  {
    "path": "doc/assets-attribution.md",
    "content": "The list of assets used in the bitcoin source and their attribution can now be found in [contrib/debian/copyright](../contrib/debian/copyright).\n"
  },
  {
    "path": "doc/benchmarking.md",
    "content": "Benchmarking\n============\n\nBitcoin Core has an internal benchmarking framework, with benchmarks\nfor cryptographic algorithms such as SHA1, SHA256, SHA512 and RIPEMD160. As well as the rolling bloom filter.\n\nRunning\n---------------------\nAfter compiling bitcoin-core, the benchmarks can be run with:\n\n    src/bench/bench_bitcoin\n\nThe output will look similar to:\n```\n# Benchmark, evals, iterations, total, min, max, median\nBase58CheckEncode, 5, 320000, 120.772, 7.49351e-05, 7.59374e-05, 7.54759e-05\nBase58Decode, 5, 800000, 122.833, 3.0467e-05, 3.11732e-05, 3.06304e-05\nBase58Encode, 5, 470000, 137.094, 5.81061e-05, 5.85109e-05, 5.84462e-05\nBenchLockedPool, 5, 530, 34.2023, 0.0128247, 0.0129613, 0.0129026\nCCheckQueueSpeedPrevectorJob, 5, 1400, 26.1762, 0.00365048, 0.00388629, 0.00367108\nCCoinsCaching, 5, 170000, 48.1074, 5.60229e-05, 5.72316e-05, 5.66214e-05\nCoinSelection, 5, 650, 34.6426, 0.0105801, 0.0107699, 0.010664\nDeserializeAndCheckBlockTest, 5, 160, 39.2084, 0.0483662, 0.0494199, 0.0490138\nDeserializeBlockTest, 5, 130, 23.8129, 0.0357731, 0.0373763, 0.0365858\nFastRandom_1bit, 5, 440000000, 38.1609, 1.72974e-08, 1.73882e-08, 1.73478e-08\nFastRandom_32bit, 5, 110000000, 72.8237, 1.29992e-07, 1.37014e-07, 1.30115e-07\nMempoolEviction, 5, 41000, 89.8883, 0.000432748, 0.000446857, 0.000438483\nPrevectorClear, 5, 5600, 47.9229, 0.00169952, 0.0017455, 0.00170315\nPrevectorDestructor, 5, 5700, 44.5498, 0.0015561, 0.00156977, 0.00156469\nRIPEMD160, 5, 440, 135.988, 0.0615496, 0.062268, 0.0617779\nRollingBloom, 5, 1500000, 36.5109, 4.80961e-06, 4.97463e-06, 4.85811e-06\nSHA1, 5, 570, 51.808, 0.018065, 0.0182623, 0.0181865\nSHA256, 5, 340, 8.31841, 0.00483231, 0.00499803, 0.00485486\nSHA256_32b, 5, 4700000, 10.469, 4.43441e-07, 4.47611e-07, 4.45223e-07\nSHA512, 5, 330, 33.3408, 0.02017, 0.0202554, 0.0201921\nSipHash_32b, 5, 40000000, 38.7088, 1.91103e-07, 1.96998e-07, 1.93792e-07\nSleep100ms, 5, 10, 5.01062, 0.100131, 0.100368, 0.100147\nTrig, 5, 12000000, 5.95494, 9.78115e-08, 1.04354e-07, 9.80682e-08\nVerifyScriptBench, 5, 6300, 9.02493, 0.000285566, 0.000288433, 0.000286175\n```\n\nHelp\n---------------------\n`-?` will print a list of options and exit:\n\n    src/bench/bench_bitcoin -?\n\nNotes\n---------------------\nMore benchmarks are needed for, in no particular order:\n- Script Validation\n- CCoinDBView caching\n- Coins database\n- Memory pool\n- Wallet coin selection\n"
  },
  {
    "path": "doc/bips.md",
    "content": "BIPs that are implemented by Bitcoin Core (up-to-date up to **v0.16.0**):\n\n* [`BIP 9`](https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki): The changes allowing multiple soft-forks to be deployed in parallel have been implemented since **v0.12.1**  ([PR #7575](https://github.com/bitcoin/bitcoin/pull/7575))\n* [`BIP 11`](https://github.com/bitcoin/bips/blob/master/bip-0011.mediawiki): Multisig outputs are standard since **v0.6.0** ([PR #669](https://github.com/bitcoin/bitcoin/pull/669)).\n* [`BIP 13`](https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki): The address format for P2SH addresses has been implemented since **v0.6.0** ([PR #669](https://github.com/bitcoin/bitcoin/pull/669)).\n* [`BIP 14`](https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki): The subversion string is being used as User Agent since **v0.6.0** ([PR #669](https://github.com/bitcoin/bitcoin/pull/669)).\n* [`BIP 16`](https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki): The pay-to-script-hash evaluation rules have been implemented since **v0.6.0**, and took effect on *April 1st 2012* ([PR #748](https://github.com/bitcoin/bitcoin/pull/748)).\n* [`BIP 21`](https://github.com/bitcoin/bips/blob/master/bip-0021.mediawiki): The URI format for Bitcoin payments has been implemented since **v0.6.0** ([PR #176](https://github.com/bitcoin/bitcoin/pull/176)).\n* [`BIP 22`](https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki): The 'getblocktemplate' (GBT) RPC protocol for mining has been implemented since **v0.7.0** ([PR #936](https://github.com/bitcoin/bitcoin/pull/936)).\n* [`BIP 23`](https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki): Some extensions to GBT have been implemented since **v0.10.0rc1**, including longpolling and block proposals ([PR #1816](https://github.com/bitcoin/bitcoin/pull/1816)).\n* [`BIP 30`](https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki): The evaluation rules to forbid creating new transactions with the same txid as previous not-fully-spent transactions were implemented since **v0.6.0**, and the rule took effect on *March 15th 2012* ([PR #915](https://github.com/bitcoin/bitcoin/pull/915)).\n* [`BIP 31`](https://github.com/bitcoin/bips/blob/master/bip-0031.mediawiki): The 'pong' protocol message (and the protocol version bump to 60001) has been implemented since **v0.6.1** ([PR #1081](https://github.com/bitcoin/bitcoin/pull/1081)).\n* [`BIP 32`](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki): Hierarchical Deterministic Wallets has been implemented since **v0.13.0** ([PR #8035](https://github.com/bitcoin/bitcoin/pull/8035)).\n* [`BIP 34`](https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki): The rule that requires blocks to contain their height (number) in the coinbase input, and the introduction of version 2 blocks has been implemented since **v0.7.0**. The rule took effect for version 2 blocks as of *block 224413* (March 5th 2013), and version 1 blocks are no longer allowed since *block 227931* (March 25th 2013) ([PR #1526](https://github.com/bitcoin/bitcoin/pull/1526)).\n* [`BIP 35`](https://github.com/bitcoin/bips/blob/master/bip-0035.mediawiki): The 'mempool' protocol message (and the protocol version bump to 60002) has been implemented since **v0.7.0** ([PR #1641](https://github.com/bitcoin/bitcoin/pull/1641)).\n* [`BIP 37`](https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki): The bloom filtering for transaction relaying, partial merkle trees for blocks, and the protocol version bump to 70001 (enabling low-bandwidth SPV clients) has been implemented since **v0.8.0** ([PR #1795](https://github.com/bitcoin/bitcoin/pull/1795)).\n* [`BIP 42`](https://github.com/bitcoin/bips/blob/master/bip-0042.mediawiki): The bug that would have caused the subsidy schedule to resume after block 13440000 was fixed in **v0.9.2** ([PR #3842](https://github.com/bitcoin/bitcoin/pull/3842)).\n* [`BIP 61`](https://github.com/bitcoin/bips/blob/master/bip-0061.mediawiki): The 'reject' protocol message (and the protocol version bump to 70002) was added in **v0.9.0** ([PR #3185](https://github.com/bitcoin/bitcoin/pull/3185)).\n* [`BIP 65`](https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki): The CHECKLOCKTIMEVERIFY softfork was merged in **v0.12.0** ([PR #6351](https://github.com/bitcoin/bitcoin/pull/6351)), and backported to **v0.11.2** and **v0.10.4**. Mempool-only CLTV was added in [PR #6124](https://github.com/bitcoin/bitcoin/pull/6124).\n* [`BIP 66`](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki): The strict DER rules and associated version 3 blocks have been implemented since **v0.10.0** ([PR #5713](https://github.com/bitcoin/bitcoin/pull/5713)).\n* [`BIP 68`](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki): Sequence locks have been implemented as of **v0.12.1**  ([PR #7184](https://github.com/bitcoin/bitcoin/pull/7184)), and have been activated since *block 419328*.\n* [`BIP 70`](https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki) [`71`](https://github.com/bitcoin/bips/blob/master/bip-0071.mediawiki) [`72`](https://github.com/bitcoin/bips/blob/master/bip-0072.mediawiki): Payment Protocol support has been available in Bitcoin Core GUI since **v0.9.0** ([PR #5216](https://github.com/bitcoin/bitcoin/pull/5216)).\n* [`BIP 90`](https://github.com/bitcoin/bips/blob/master/bip-0090.mediawiki): Trigger mechanism for activation of BIPs 34, 65, and 66 has been simplified to block height checks since **v0.14.0** ([PR #8391](https://github.com/bitcoin/bitcoin/pull/8391)).\n* [`BIP 111`](https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki): `NODE_BLOOM` service bit added, and enforced for all peer versions as of **v0.13.0** ([PR #6579](https://github.com/bitcoin/bitcoin/pull/6579) and [PR #6641](https://github.com/bitcoin/bitcoin/pull/6641)).\n* [`BIP 112`](https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki): The CHECKSEQUENCEVERIFY opcode has been implemented since **v0.12.1** ([PR #7524](https://github.com/bitcoin/bitcoin/pull/7524)) and has been activated since *block 419328*.\n* [`BIP 113`](https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki): Median time past lock-time calculations have been implemented since **v0.12.1** ([PR #6566](https://github.com/bitcoin/bitcoin/pull/6566)) and have been activated since *block 419328*.\n* [`BIP 125`](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki): Opt-in full replace-by-fee signaling honoured in mempool and mining as of **v0.12.0** ([PR 6871](https://github.com/bitcoin/bitcoin/pull/6871)).\n* [`BIP 130`](https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki): direct headers announcement is negotiated with peer versions `>=70012` as of **v0.12.0** ([PR 6494](https://github.com/bitcoin/bitcoin/pull/6494)).\n* [`BIP 133`](https://github.com/bitcoin/bips/blob/master/bip-0133.mediawiki): feefilter messages are respected and sent for peer versions `>=70013` as of **v0.13.0** ([PR 7542](https://github.com/bitcoin/bitcoin/pull/7542)).\n* [`BIP 141`](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki): Segregated Witness (Consensus Layer) as of **v0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)), and defined for mainnet as of **v0.13.1** ([PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)).\n* [`BIP 143`](https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki): Transaction Signature Verification for Version 0 Witness Program as of **v0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)) and defined for mainnet as of **v0.13.1** ([PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)).\n* [`BIP 144`](https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki): Segregated Witness as of **0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)).\n* [`BIP 145`](https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki): getblocktemplate updates for Segregated Witness as of **v0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)).\n* [`BIP 147`](https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki): NULLDUMMY softfork as of **v0.13.1** ([PR 8636](https://github.com/bitcoin/bitcoin/pull/8636) and [PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)).\n* [`BIP 152`](https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki): Compact block transfer and related optimizations are used as of **v0.13.0** ([PR 8068](https://github.com/bitcoin/bitcoin/pull/8068)).\n* [`BIP 159`](https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki): NODE_NETWORK_LIMITED service bit [signaling only] is supported as of **v0.16.0** ([PR 11740](https://github.com/bitcoin/bitcoin/pull/11740)).\n* [`BIP 173`](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki): Bech32 addresses for native Segregated Witness outputs are supported as of **v0.16.0** ([PR 11167](https://github.com/bitcoin/bitcoin/pull/11167)).\n* [`BIP 176`](https://github.com/bitcoin/bips/blob/master/bip-0176.mediawiki): Bits Denomination [QT only] is supported as of **v0.16.0** ([PR 12035](https://github.com/bitcoin/bitcoin/pull/12035)).\n"
  },
  {
    "path": "doc/build-netbsd.md",
    "content": "NetBSD build guide\n======================\n(updated for NetBSD 7.0)\n\nThis guide describes how to build bitcoind and command-line utilities on NetBSD.\n\nThis guide does not contain instructions for building the GUI.\n\nPreparation\n-------------\n\nYou will need the following modules, which can be installed via pkgsrc or pkgin:\n\n```\nautoconf\nautomake\nboost\ndb4\ngit\ngmake\nlibevent\nlibtool\npython27\n```\n\nDownload the source code:\n```\ngit clone https://github.com/bitcoin/bitcoin\n```\n\nSee [dependencies.md](dependencies.md) for a complete overview.\n\n### Building Bitcoin Core\n\n**Important**: Use `gmake` (the non-GNU `make` will exit with an error).\n\nWith wallet:\n```\n./autogen.sh\n./configure CPPFLAGS=\"-I/usr/pkg/include\" LDFLAGS=\"-L/usr/pkg/lib\" BOOST_CPPFLAGS=\"-I/usr/pkg/include\" BOOST_LDFLAGS=\"-L/usr/pkg/lib\"\ngmake\n```\n\nWithout wallet:\n```\n./autogen.sh\n./configure --disable-wallet CPPFLAGS=\"-I/usr/pkg/include\" LDFLAGS=\"-L/usr/pkg/lib\" BOOST_CPPFLAGS=\"-I/usr/pkg/include\" BOOST_LDFLAGS=\"-L/usr/pkg/lib\"\ngmake\n```\n"
  },
  {
    "path": "doc/build-openbsd.md",
    "content": "OpenBSD build guide\n======================\n(updated for OpenBSD 6.2)\n\nThis guide describes how to build bitcoind and command-line utilities on OpenBSD.\n\nOpenBSD is most commonly used as a server OS, so this guide does not contain instructions for building the GUI.\n\nPreparation\n-------------\n\nRun the following as root to install the base dependencies for building:\n\n```bash\npkg_add git gmake libevent libtool\npkg_add autoconf # (select highest version, e.g. 2.69)\npkg_add automake # (select highest version, e.g. 1.15)\npkg_add python # (select highest version, e.g. 3.6)\npkg_add boost\n\ngit clone https://github.com/bitcoin/bitcoin.git\n```\n\nSee [dependencies.md](dependencies.md) for a complete overview.\n\n**Important**: From OpenBSD 6.2 onwards a C++11-supporting clang compiler is\npart of the base image, and while building it is necessary to make sure that this\ncompiler is used and not ancient g++ 4.2.1. This is done by appending\n`CC=cc CXX=c++` to configuration commands. Mixing different compilers\nwithin the same executable will result in linker errors.\n\n### Building BerkeleyDB\n\nBerkeleyDB is only necessary for the wallet functionality. To skip this, pass\n`--disable-wallet` to `./configure` and skip to the next section.\n\nIt is recommended to use Berkeley DB 4.8. You cannot use the BerkeleyDB library\nfrom ports, for the same reason as boost above (g++/libstd++ incompatibility).\nIf you have to build it yourself, you can use [the installation script included\nin contrib/](/contrib/install_db4.sh) like so\n\n```shell\n./contrib/install_db4.sh `pwd` CC=cc CXX=c++\n```\n\nfrom the root of the repository. Then set `BDB_PREFIX` for the next section:\n\n```shell\nexport BDB_PREFIX=\"$PWD/db4\"\n```\n\n### Building Bitcoin Core\n\n**Important**: use `gmake`, not `make`. The non-GNU `make` will exit with a horrible error.\n\nPreparation:\n```bash\nexport AUTOCONF_VERSION=2.69 # replace this with the autoconf version that you installed\nexport AUTOMAKE_VERSION=1.15 # replace this with the automake version that you installed\n./autogen.sh\n```\nMake sure `BDB_PREFIX` is set to the appropriate path from the above steps.\n\nTo configure with wallet:\n```bash\n./configure --with-gui=no CC=cc CXX=c++ \\\n    BDB_LIBS=\"-L${BDB_PREFIX}/lib -ldb_cxx-4.8\" BDB_CFLAGS=\"-I${BDB_PREFIX}/include\"\n```\n\nTo configure without wallet:\n```bash\n./configure --disable-wallet --with-gui=no CC=cc CXX=c++\n```\n\nBuild and run the tests:\n```bash\ngmake # use -jX here for parallelism\ngmake check\n```\n\nResource limits\n-------------------\n\nIf the build runs into out-of-memory errors, the instructions in this section\nmight help.\n\nThe standard ulimit restrictions in OpenBSD are very strict:\n\n    data(kbytes)         1572864\n\nThis, unfortunately, in some cases not enough to compile some `.cpp` files in the project,\n(see issue [#6658](https://github.com/bitcoin/bitcoin/issues/6658)).\nIf your user is in the `staff` group the limit can be raised with:\n\n    ulimit -d 3000000\n\nThe change will only affect the current shell and processes spawned by it. To\nmake the change system-wide, change `datasize-cur` and `datasize-max` in\n`/etc/login.conf`, and reboot.\n\n"
  },
  {
    "path": "doc/build-osx.md",
    "content": "Mac OS X Build Instructions and Notes\n====================================\nThe commands in this guide should be executed in a Terminal application.\nThe built-in one is located in `/Applications/Utilities/Terminal.app`.\n\nPreparation\n-----------\nInstall the OS X command line tools:\n\n`xcode-select --install`\n\nWhen the popup appears, click `Install`.\n\nThen install [Homebrew](https://brew.sh).\n\nDependencies\n----------------------\n\n    brew install automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf python3 qt libevent\n\nSee [dependencies.md](dependencies.md) for a complete overview.\n\nIf you want to build the disk image with `make deploy` (.dmg / optional), you need RSVG\n\n    brew install librsvg\n\nNOTE: Building with Qt4 is still supported, however, could result in a broken UI. Building with Qt5 is recommended.\n\nBerkeley DB\n-----------\nIt is recommended to use Berkeley DB 4.8. If you have to build it yourself,\nyou can use [the installation script included in contrib/](/contrib/install_db4.sh)\nlike so\n\n```shell\n./contrib/install_db4.sh .\n```\n\nfrom the root of the repository.\n\n**Note**: You only need Berkeley DB if the wallet is enabled (see the section *Disable-Wallet mode* below).\n\nBuild Bitcoin Core\n------------------------\n\n1. Clone the bitcoin source code and cd into `bitcoin`\n\n        git clone https://github.com/bitcoin/bitcoin\n        cd bitcoin\n\n2.  Build bitcoin-core:\n\n    Configure and build the headless bitcoin binaries as well as the GUI (if Qt is found).\n\n    You can disable the GUI build by passing `--without-gui` to configure.\n\n        ./autogen.sh\n        ./configure\n        make\n\n3.  It is recommended to build and run the unit tests:\n\n        make check\n\n4.  You can also create a .dmg that contains the .app bundle (optional):\n\n        make deploy\n\nRunning\n-------\n\nBitcoin Core is now available at `./src/bitcoind`\n\nBefore running, it's recommended you create an RPC configuration file.\n\n    echo -e \"rpcuser=bitcoinrpc\\nrpcpassword=$(xxd -l 16 -p /dev/urandom)\" > \"/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf\"\n\n    chmod 600 \"/Users/${USER}/Library/Application Support/Bitcoin/bitcoin.conf\"\n\nThe first time you run bitcoind, it will start downloading the blockchain. This process could take several hours.\n\nYou can monitor the download process by looking at the debug.log file:\n\n    tail -f $HOME/Library/Application\\ Support/Bitcoin/debug.log\n\nOther commands:\n-------\n\n    ./src/bitcoind -daemon # Starts the bitcoin daemon.\n    ./src/bitcoin-cli --help # Outputs a list of command-line options.\n    ./src/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running.\n\nUsing Qt Creator as IDE\n------------------------\nYou can use Qt Creator as an IDE, for bitcoin development.\nDownload and install the community edition of [Qt Creator](https://www.qt.io/download/).\nUncheck everything except Qt Creator during the installation process.\n\n1. Make sure you installed everything through Homebrew mentioned above\n2. Do a proper ./configure --enable-debug\n3. In Qt Creator do \"New Project\" -> Import Project -> Import Existing Project\n4. Enter \"bitcoin-qt\" as project name, enter src/qt as location\n5. Leave the file selection as it is\n6. Confirm the \"summary page\"\n7. In the \"Projects\" tab select \"Manage Kits...\"\n8. Select the default \"Desktop\" kit and select \"Clang (x86 64bit in /usr/bin)\" as compiler\n9. Select LLDB as debugger (you might need to set the path to your installation)\n10. Start debugging with Qt Creator\n\nNotes\n-----\n\n* Tested on OS X 10.8 through 10.13 on 64-bit Intel processors only.\n\n* Building with downloaded Qt binaries is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714)\n"
  },
  {
    "path": "doc/build-unix.md",
    "content": "UNIX BUILD NOTES\n====================\nSome notes on how to build Bitcoin Core in Unix.\n\n(for OpenBSD specific instructions, see [build-openbsd.md](build-openbsd.md))\n\nNote\n---------------------\nAlways use absolute paths to configure and compile bitcoin and the dependencies,\nfor example, when specifying the path of the dependency:\n\n\t../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX\n\nHere BDB_PREFIX must be an absolute path - it is defined using $(pwd) which ensures\nthe usage of the absolute path.\n\nTo Build\n---------------------\n\n```bash\n./autogen.sh\n./configure\nmake\nmake install # optional\n```\n\nThis will build bitcoin-qt as well if the dependencies are met.\n\nDependencies\n---------------------\n\nThese dependencies are required:\n\n Library     | Purpose          | Description\n ------------|------------------|----------------------\n libssl      | Crypto           | Random Number Generation, Elliptic Curve Cryptography\n libboost    | Utility          | Library for threading, data structures, etc\n libevent    | Networking       | OS independent asynchronous networking\n\nOptional dependencies:\n\n Library     | Purpose          | Description\n ------------|------------------|----------------------\n miniupnpc   | UPnP Support     | Firewall-jumping support\n libdb4.8    | Berkeley DB      | Wallet storage (only needed when wallet enabled)\n qt          | GUI              | GUI toolkit (only needed when GUI enabled)\n protobuf    | Payments in GUI  | Data interchange format used for payment protocol (only needed when GUI enabled)\n libqrencode | QR codes in GUI  | Optional for generating QR codes (only needed when GUI enabled)\n univalue    | Utility          | JSON parsing and encoding (bundled version will be used unless --with-system-univalue passed to configure)\n libzmq3     | ZMQ notification | Optional, allows generating ZMQ notifications (requires ZMQ version >= 4.x)\n\nFor the versions used, see [dependencies.md](dependencies.md)\n\nMemory Requirements\n--------------------\n\nC++ compilers are memory-hungry. It is recommended to have at least 1.5 GB of\nmemory available when compiling Bitcoin Core. On systems with less, gcc can be\ntuned to conserve memory with additional CXXFLAGS:\n\n\n    ./configure CXXFLAGS=\"--param ggc-min-expand=1 --param ggc-min-heapsize=32768\"\n\nDependency Build Instructions: Ubuntu & Debian\n----------------------------------------------\nBuild requirements:\n\n    sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3\n\nOptions when installing required Boost library files:\n\n1. On at least Ubuntu 14.04+ and Debian 7+ there are generic names for the\nindividual boost development packages, so the following can be used to only\ninstall necessary parts of boost:\n\n        sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev\n\n2. If that doesn't work, you can install all boost development packages with:\n\n        sudo apt-get install libboost-all-dev\n\nBerkeleyDB is required for the wallet.\n\n**For Ubuntu only:** db4.8 packages are available [here](https://launchpad.net/~bitcoin/+archive/bitcoin).\nYou can add the repository and install using the following commands:\n\n    sudo apt-get install software-properties-common\n    sudo add-apt-repository ppa:bitcoin/bitcoin\n    sudo apt-get update\n    sudo apt-get install libdb4.8-dev libdb4.8++-dev\n\nUbuntu and Debian have their own libdb-dev and libdb++-dev packages, but these will install\nBerkeleyDB 5.1 or later, which break binary wallet compatibility with the distributed executables which\nare based on BerkeleyDB 4.8. If you do not care about wallet compatibility,\npass `--with-incompatible-bdb` to configure.\n\nSee the section \"Disable-wallet mode\" to build Bitcoin Core without wallet.\n\nOptional (see --with-miniupnpc and --enable-upnp-default):\n\n    sudo apt-get install libminiupnpc-dev\n\nZMQ dependencies (provides ZMQ API 4.x):\n\n    sudo apt-get install libzmq3-dev\n\nDependencies for the GUI: Ubuntu & Debian\n-----------------------------------------\n\nIf you want to build Bitcoin-Qt, make sure that the required packages for Qt development\nare installed. Either Qt 5 or Qt 4 are necessary to build the GUI.\nIf both Qt 4 and Qt 5 are installed, Qt 5 will be used. Pass `--with-gui=qt4` to configure to choose Qt4.\nTo build without GUI pass `--without-gui`.\n\nTo build with Qt 5 (recommended) you need the following:\n\n    sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler\n\nAlternatively, to build with Qt 4 you need the following:\n\n    sudo apt-get install libqt4-dev libprotobuf-dev protobuf-compiler\n\nlibqrencode (optional) can be installed with:\n\n    sudo apt-get install libqrencode-dev\n\nOnce these are installed, they will be found by configure and a bitcoin-qt executable will be\nbuilt by default.\n\nDependency Build Instructions: Fedora\n-------------------------------------\nBuild requirements:\n\n    sudo dnf install gcc-c++ libtool make autoconf automake openssl-devel libevent-devel boost-devel libdb4-devel libdb4-cxx-devel python3\n\nOptional:\n\n    sudo dnf install miniupnpc-devel\n\nTo build with Qt 5 (recommended) you need the following:\n\n    sudo dnf install qt5-qttools-devel qt5-qtbase-devel protobuf-devel\n\nlibqrencode (optional) can be installed with:\n\n    sudo dnf install qrencode-devel\n\nNotes\n-----\nThe release is built with GCC and then \"strip bitcoind\" to strip the debug\nsymbols, which reduces the executable size by about 90%.\n\n\nminiupnpc\n---------\n\n[miniupnpc](http://miniupnp.free.fr/) may be used for UPnP port mapping.  It can be downloaded from [here](\nhttp://miniupnp.tuxfamily.org/files/).  UPnP support is compiled in and\nturned off by default.  See the configure options for upnp behavior desired:\n\n\t--without-miniupnpc      No UPnP support miniupnp not required\n\t--disable-upnp-default   (the default) UPnP support turned off by default at runtime\n\t--enable-upnp-default    UPnP support turned on by default at runtime\n\n\nBerkeley DB\n-----------\nIt is recommended to use Berkeley DB 4.8. If you have to build it yourself,\nyou can use [the installation script included in contrib/](/contrib/install_db4.sh)\nlike so\n\n```shell\n./contrib/install_db4.sh `pwd`\n```\n\nfrom the root of the repository.\n\n**Note**: You only need Berkeley DB if the wallet is enabled (see the section *Disable-Wallet mode* below).\n\nBoost\n-----\nIf you need to build Boost yourself:\n\n\tsudo su\n\t./bootstrap.sh\n\t./bjam install\n\n\nSecurity\n--------\nTo help make your bitcoin installation more secure by making certain attacks impossible to\nexploit even if a vulnerability is found, binaries are hardened by default.\nThis can be disabled with:\n\nHardening Flags:\n\n\t./configure --enable-hardening\n\t./configure --disable-hardening\n\n\nHardening enables the following features:\n\n* Position Independent Executable\n    Build position independent code to take advantage of Address Space Layout Randomization\n    offered by some kernels. Attackers who can cause execution of code at an arbitrary memory\n    location are thwarted if they don't know where anything useful is located.\n    The stack and heap are randomly located by default but this allows the code section to be\n    randomly located as well.\n\n    On an AMD64 processor where a library was not compiled with -fPIC, this will cause an error\n    such as: \"relocation R_X86_64_32 against `......' can not be used when making a shared object;\"\n\n    To test that you have built PIE executable, install scanelf, part of paxutils, and use:\n\n    \tscanelf -e ./bitcoin\n\n    The output should contain:\n\n     TYPE\n    ET_DYN\n\n* Non-executable Stack\n    If the stack is executable then trivial stack based buffer overflow exploits are possible if\n    vulnerable buffers are found. By default, bitcoin should be built with a non-executable stack\n    but if one of the libraries it uses asks for an executable stack or someone makes a mistake\n    and uses a compiler extension which requires an executable stack, it will silently build an\n    executable without the non-executable stack protection.\n\n    To verify that the stack is non-executable after compiling use:\n    `scanelf -e ./bitcoin`\n\n    the output should contain:\n\tSTK/REL/PTL\n\tRW- R-- RW-\n\n    The STK RW- means that the stack is readable and writeable but not executable.\n\nDisable-wallet mode\n--------------------\nWhen the intention is to run only a P2P node without a wallet, bitcoin may be compiled in\ndisable-wallet mode with:\n\n    ./configure --disable-wallet\n\nIn this case there is no dependency on Berkeley DB 4.8.\n\nMining is also possible in disable-wallet mode, but only using the `getblocktemplate` RPC\ncall not `getwork`.\n\nAdditional Configure Flags\n--------------------------\nA list of additional configure flags can be displayed with:\n\n    ./configure --help\n\n\nSetup and Build Example: Arch Linux\n-----------------------------------\nThis example lists the steps necessary to setup and build a command line only, non-wallet distribution of the latest changes on Arch Linux:\n\n    pacman -S git base-devel boost libevent python\n    git clone https://github.com/bitcoin/bitcoin.git\n    cd bitcoin/\n    ./autogen.sh\n    ./configure --disable-wallet --without-gui --without-miniupnpc\n    make check\n\nNote:\nEnabling wallet support requires either compiling against a Berkeley DB newer than 4.8 (package `db`) using `--with-incompatible-bdb`,\nor building and depending on a local version of Berkeley DB 4.8. The readily available Arch Linux packages are currently built using\n`--with-incompatible-bdb` according to the [PKGBUILD](https://projects.archlinux.org/svntogit/community.git/tree/bitcoin/trunk/PKGBUILD).\nAs mentioned above, when maintaining portability of the wallet between the standard Bitcoin Core distributions and independently built\nnode software is desired, Berkeley DB 4.8 must be used.\n\n\nARM Cross-compilation\n-------------------\nThese steps can be performed on, for example, an Ubuntu VM. The depends system\nwill also work on other Linux distributions, however the commands for\ninstalling the toolchain will be different.\n\nMake sure you install the build requirements mentioned above.\nThen, install the toolchain and curl:\n\n    sudo apt-get install g++-arm-linux-gnueabihf curl\n\nTo build executables for ARM:\n\n    cd depends\n    make HOST=arm-linux-gnueabihf NO_QT=1\n    cd ..\n    ./configure --prefix=$PWD/depends/arm-linux-gnueabihf --enable-glibc-back-compat --enable-reduce-exports LDFLAGS=-static-libstdc++\n    make\n\n\nFor further documentation on the depends system see [README.md](../depends/README.md) in the depends directory.\n\nBuilding on FreeBSD\n--------------------\n\n(Updated as of FreeBSD 11.0)\n\nClang is installed by default as `cc` compiler, this makes it easier to get\nstarted than on [OpenBSD](build-openbsd.md). Installing dependencies:\n\n    pkg install autoconf automake libtool pkgconf\n    pkg install boost-libs openssl libevent\n    pkg install gmake\n\nYou need to use GNU make (`gmake`) instead of `make`.\n(`libressl` instead of `openssl` will also work)\n\nFor the wallet (optional):\n\n    ./contrib/install_db4.sh `pwd`\n    setenv BDB_PREFIX $PWD/db4\n\nThen build using:\n\n    ./autogen.sh\n    ./configure BDB_CFLAGS=\"-I${BDB_PREFIX}/include\" BDB_LIBS=\"-L${BDB_PREFIX}/lib -ldb_cxx\"\n    gmake\n\n*Note on debugging*: The version of `gdb` installed by default is [ancient and considered harmful](https://wiki.freebsd.org/GdbRetirement).\nIt is not suitable for debugging a multi-threaded C++ program, not even for getting backtraces. Please install the package `gdb` and\nuse the versioned gdb command e.g. `gdb7111`.\n"
  },
  {
    "path": "doc/build-windows.md",
    "content": "WINDOWS BUILD NOTES\n====================\n\nBelow are some notes on how to build Bitcoin Core for Windows.\n\nThe options known to work for building Bitcoin Core on Windows are:\n\n* On Linux using the [Mingw-w64](https://mingw-w64.org/doku.php) cross compiler tool chain. Ubuntu Bionic 18.04 is required\nand is the platform used to build the Bitcoin Core Windows release binaries.\n* On Windows using [Windows\nSubsystem for Linux (WSL)](https://msdn.microsoft.com/commandline/wsl/about) and the Mingw-w64 cross compiler tool chain.\n\nOther options which may work but which have not been extensively tested are (please contribute instructions):\n\n* On Windows using a POSIX compatibility layer application such as [cygwin](http://www.cygwin.com/) or [msys2](http://www.msys2.org/).\n* On Windows using a native compiler tool chain such as [Visual Studio](https://www.visualstudio.com).\n\nInstalling Windows Subsystem for Linux\n---------------------------------------\n\nWith Windows 10, Microsoft has released a new feature named the [Windows\nSubsystem for Linux (WSL)](https://msdn.microsoft.com/commandline/wsl/about). This\nfeature allows you to run a bash shell directly on Windows in an Ubuntu-based\nenvironment. Within this environment you can cross compile for Windows without\nthe need for a separate Linux VM or server. Note that while WSL can be installed with\nother Linux variants, such as OpenSUSE, the following instructions have only been\ntested with Ubuntu.\n\nThis feature is not supported in versions of Windows prior to Windows 10 or on\nWindows Server SKUs. In addition, it is available [only for 64-bit versions of\nWindows](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide).\n\nFull instructions to install WSL are available on the above link.\nTo install WSL on Windows 10 with Fall Creators Update installed (version >= 16215.0) do the following:\n\n1. Enable the Windows Subsystem for Linux feature\n  * From Start, search for \"Turn Windows features on or off\" (type 'turn')\n  * Select Windows Subsystem for Linux\n  * Click OK\n  * Restart if necessary\n2. Install Ubuntu\n  * Open Microsoft Store and search for \"Ubuntu 18.04\" or use [this link](https://www.microsoft.com/store/productId/9N9TNGVNDL3Q)\n  * Click Install\n3. Complete Installation\n  * Open a cmd prompt and type \"Ubuntu1804\"\n  * Create a new UNIX user account (this is a separate account from your Windows account)\n\nAfter the bash shell is active, you can follow the instructions below, starting\nwith the \"Cross-compilation\" section. Compiling the 64-bit version is\nrecommended but it is possible to compile the 32-bit version.\n\nCross-compilation for Ubuntu and Windows Subsystem for Linux\n------------------------------------------------------------\n\nThe steps below can be performed on Ubuntu (including in a VM) or WSL. The depends system\nwill also work on other Linux distributions, however the commands for\ninstalling the toolchain will be different.\n\nFirst, install the general dependencies:\n\n    sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git\n\nA host toolchain (`build-essential`) is necessary because some dependency\npackages (such as `protobuf`) need to build host utilities that are used in the\nbuild process.\n\nSee also: [dependencies.md](dependencies.md).\n\n## Building for 64-bit Windows\n\nThe first step is to install the mingw-w64 cross-compilation tool chain.\n\n    sudo apt install g++-mingw-w64-x86-64\n\nUbuntu Bionic 18.04 <sup>[1](#footnote1)</sup>:\n\n    sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.\n\nOnce the tool chain is installed the build steps are common:\n\nNote that for WSL the Bitcoin Core source path MUST be somewhere in the default mount file system, for\nexample /usr/src/bitcoin, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail.\nThis means you cannot use a directory that located directly on the host Windows file system to perform the build.\n\nThe next three steps are an example of how to acquire the source in an appropriate way.\n\n    cd /usr/src\n    sudo git clone https://github.com/bitcoin/bitcoin.git\n    sudo chmod -R a+rw bitcoin\n\nOnce the source code is ready the build steps are below.\n\n    PATH=$(echo \"$PATH\" | sed -e 's/:\\/mnt.*//g') # strip out problematic Windows %PATH% imported var\n    cd depends\n    make HOST=x86_64-w64-mingw32\n    cd ..\n    ./autogen.sh # not required when building from tarball\n    CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/\n    make\n\n## Building for 32-bit Windows\n\nTo build executables for Windows 32-bit, install the following dependencies:\n\n    sudo apt install g++-mingw-w64-i686 mingw-w64-i686-dev\n\nFor Ubuntu Bionic 18.04 and Windows Subsystem for Linux <sup>[1](#footnote1)</sup>:\n\n    sudo update-alternatives --config i686-w64-mingw32-g++  # Set the default mingw32 g++ compiler option to posix.\n\nNote that for WSL the Bitcoin Core source path MUST be somewhere in the default mount file system, for\nexample /usr/src/bitcoin, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail.\nThis means you cannot use a directory that located directly on the host Windows file system to perform the build.\n\nThe next three steps are an example of how to acquire the source in an appropriate way.\n\n    cd /usr/src\n    sudo git clone https://github.com/bitcoin/bitcoin.git\n    sudo chmod -R a+rw bitcoin\n\nThen build using:\n\n    PATH=$(echo \"$PATH\" | sed -e 's/:\\/mnt.*//g') # strip out problematic Windows %PATH% imported var\n    cd depends\n    make HOST=i686-w64-mingw32\n    cd ..\n    ./autogen.sh # not required when building from tarball\n    CONFIG_SITE=$PWD/depends/i686-w64-mingw32/share/config.site ./configure --prefix=/\n    make\n\n## Depends system\n\nFor further documentation on the depends system see [README.md](../depends/README.md) in the depends directory.\n\nInstallation\n-------------\n\nAfter building using the Windows subsystem it can be useful to copy the compiled\nexecutables to a directory on the windows drive in the same directory structure\nas they appear in the release `.zip` archive. This can be done in the following\nway. This will install to `c:\\workspace\\bitcoin`, for example:\n\n    make install DESTDIR=/mnt/c/workspace/bitcoin\n\nFootnotes\n---------\n\n<a name=\"footnote1\">1</a>: Starting from Ubuntu Xenial 16.04 both the 32 and 64 bit Mingw-w64 packages install two different\ncompiler options to allow a choice between either posix or win32 threads. The default option is win32 threads which is the more\nefficient since it will result in binary code that links directly with the Windows kernel32.lib. Unfortunately, the headers\nrequired to support win32 threads conflict with some of the classes in the C++11 standard library in particular std::mutex.\nIt's not possible to build the bitcoin code using the win32 version of the Mingw-w64 cross compilers (at least not without\nmodifying headers in the bitcoin source code).\n"
  },
  {
    "path": "doc/dependencies.md",
    "content": "Dependencies\n============\n\nThese are the dependencies currently used by Bitcoin Core. You can find instructions for installing them in the `build-*.md` file for your platform.\n\n| Dependency | Version used | Minimum required | CVEs | Shared | [Bundled Qt library](https://doc.qt.io/qt-5/configure-options.html) |\n| --- | --- | --- | --- | --- | --- |\n| Berkeley DB | [4.8.30](http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 4.8.x | No |  |  |\n| Boost | [1.64.0](http://www.boost.org/users/download/) | [1.47.0](https://github.com/bitcoin/bitcoin/pull/8920) | No |  |  |\n| ccache | [3.3.4](https://ccache.samba.org/download.html) |  | No |  |  |\n| Clang |  | [3.3+](http://llvm.org/releases/download.html) (C++11 support) |  |  |  |\n| D-Bus | [1.10.18](https://cgit.freedesktop.org/dbus/dbus/tree/NEWS?h=dbus-1.10) |  | No | Yes |  |\n| Expat | [2.2.1](https://libexpat.github.io/) |  | No | Yes |  |\n| fontconfig | [2.12.1](https://www.freedesktop.org/software/fontconfig/release/) |  | No | Yes |  |\n| FreeType | [2.7.1](http://download.savannah.gnu.org/releases/freetype) |  | No |  |  |\n| GCC |  | [4.8+](https://gcc.gnu.org/) |  |  |  |\n| HarfBuzz-NG |  |  |  |  |  |\n| libevent | [2.1.8-stable](https://github.com/libevent/libevent/releases) | 2.0.22 | No |  |  |\n| libjpeg |  |  |  |  | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk#L75) |\n| libpng |  |  |  |  | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk#L74) |\n| MiniUPnPc | [2.0.20170509](http://miniupnp.free.fr/files) |  | No |  |  |\n| OpenSSL | [1.0.1k](https://www.openssl.org/source) |  | Yes |  |  |\n| PCRE |  |  |  |  | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk#L76) |\n| protobuf | [2.6.3](https://github.com/google/protobuf/releases) |  | No |  |  |\n| Python (tests) |  | [3.4](https://www.python.org/downloads) |  |  |  |\n| qrencode | [3.4.4](https://fukuchi.org/works/qrencode) |  | No |  |  |\n| Qt | [5.7.1](https://download.qt.io/official_releases/qt/) | 4.7+ | No |  |  |\n| XCB |  |  |  |  | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk#L94) (Linux only) |\n| xkbcommon |  |  |  |  | [Yes](https://github.com/bitcoin/bitcoin/blob/master/depends/packages/qt.mk#L93) (Linux only) |\n| ZeroMQ | [4.2.2](https://github.com/zeromq/libzmq/releases) |  | No |  |  |\n| zlib | [1.2.11](http://zlib.net/) |  |  |  | No |\n"
  },
  {
    "path": "doc/developer-notes.md",
    "content": "Developer Notes\n===============\n\nVarious coding styles have been used during the history of the codebase,\nand the result is not very consistent. However, we're now trying to converge to\na single style, which is specified below. When writing patches, favor the new\nstyle over attempting to mimic the surrounding style, except for move-only\ncommits.\n\nDo not submit patches solely to modify the style of existing code.\n\n- **Indentation and whitespace rules** as specified in\n[src/.clang-format](/src/.clang-format). You can use the provided\n[clang-format-diff script](/contrib/devtools/README.md#clang-format-diffpy)\ntool to clean up patches automatically before submission.\n  - Braces on new lines for namespaces, classes, functions, methods.\n  - Braces on the same line for everything else.\n  - 4 space indentation (no tabs) for every block except namespaces.\n  - No indentation for `public`/`protected`/`private` or for `namespace`.\n  - No extra spaces inside parenthesis; don't do ( this )\n  - No space after function names; one space after `if`, `for` and `while`.\n  - If an `if` only has a single-statement `then`-clause, it can appear\n    on the same line as the `if`, without braces. In every other case,\n    braces are required, and the `then` and `else` clauses must appear\n    correctly indented on a new line.\n\n- **Symbol naming conventions**. These are preferred in new code, but are not\nrequired when doing so would need changes to significant pieces of existing\ncode.\n  - Variable and namespace names are all lowercase, and may use `_` to\n    separate words (snake_case).\n    - Class member variables have a `m_` prefix.\n    - Global variables have a `g_` prefix.\n  - Constant names are all uppercase, and use `_` to separate words.\n  - Class names, function names and method names are UpperCamelCase\n    (PascalCase). Do not prefix class names with `C`.\n\n- **Miscellaneous**\n  - `++i` is preferred over `i++`.\n  - `nullptr` is preferred over `NULL` or `(void*)0`.\n  - `static_assert` is preferred over `assert` where possible. Generally; compile-time checking is preferred over run-time checking.\n\nBlock style example:\n```c++\nint g_count = 0;\n\nnamespace foo\n{\nclass Class\n{\n    std::string m_name;\n\npublic:\n    bool Function(const std::string& s, int n)\n    {\n        // Comment summarising what this section of code does\n        for (int i = 0; i < n; ++i) {\n            int total_sum = 0;\n            // When something fails, return early\n            if (!Something()) return false;\n            ...\n            if (SomethingElse(i)) {\n                total_sum += ComputeSomething(g_count);\n            } else {\n                DoSomething(m_name, total_sum);\n            }\n        }\n\n        // Success return is usually at the end\n        return true;\n    }\n}\n} // namespace foo\n```\n\nDoxygen comments\n-----------------\n\nTo facilitate the generation of documentation, use doxygen-compatible comment blocks for functions, methods and fields.\n\nFor example, to describe a function use:\n```c++\n/**\n * ... text ...\n * @param[in] arg1    A description\n * @param[in] arg2    Another argument description\n * @pre Precondition for function...\n */\nbool function(int arg1, const char *arg2)\n```\nA complete list of `@xxx` commands can be found at http://www.stack.nl/~dimitri/doxygen/manual/commands.html.\nAs Doxygen recognizes the comments by the delimiters (`/**` and `*/` in this case), you don't\n*need* to provide any commands for a comment to be valid; just a description text is fine.\n\nTo describe a class use the same construct above the class definition:\n```c++\n/**\n * Alerts are for notifying old versions if they become too obsolete and\n * need to upgrade. The message is displayed in the status bar.\n * @see GetWarnings()\n */\nclass CAlert\n{\n```\n\nTo describe a member or variable use:\n```c++\nint var; //!< Detailed description after the member\n```\n\nor\n```cpp\n//! Description before the member\nint var;\n```\n\nAlso OK:\n```c++\n///\n/// ... text ...\n///\nbool function2(int arg1, const char *arg2)\n```\n\nNot OK (used plenty in the current source, but not picked up):\n```c++\n//\n// ... text ...\n//\n```\n\nA full list of comment syntaxes picked up by doxygen can be found at http://www.stack.nl/~dimitri/doxygen/manual/docblocks.html,\nbut if possible use one of the above styles.\n\nDevelopment tips and tricks\n---------------------------\n\n**compiling for debugging**\n\nRun configure with the --enable-debug option, then make. Or run configure with\nCXXFLAGS=\"-g -ggdb -O0\" or whatever debug flags you need.\n\n**debug.log**\n\nIf the code is behaving strangely, take a look in the debug.log file in the data directory;\nerror and debugging messages are written there.\n\nThe -debug=... command-line option controls debugging; running with just -debug or -debug=1 will turn\non all categories (and give you a very large debug.log file).\n\nThe Qt code routes qDebug() output to debug.log under category \"qt\": run with -debug=qt\nto see it.\n\n**testnet and regtest modes**\n\nRun with the -testnet option to run with \"play bitcoins\" on the test network, if you\nare testing multi-machine code that needs to operate across the internet.\n\nIf you are testing something that can run on one machine, run with the -regtest option.\nIn regression test mode, blocks can be created on-demand; see test/functional/ for tests\nthat run in -regtest mode.\n\n**DEBUG_LOCKORDER**\n\nBitcoin Core is a multithreaded application, and deadlocks or other multithreading bugs\ncan be very difficult to track down. Compiling with -DDEBUG_LOCKORDER (configure\nCXXFLAGS=\"-DDEBUG_LOCKORDER -g\") inserts run-time checks to keep track of which locks\nare held, and adds warnings to the debug.log file if inconsistencies are detected.\n\n**Valgrind suppressions file**\n\nValgrind is a programming tool for memory debugging, memory leak detection, and\nprofiling. The repo contains a Valgrind suppressions file\n([`valgrind.supp`](https://github.com/bitcoin/bitcoin/blob/master/contrib/valgrind.supp))\nwhich includes known Valgrind warnings in our dependencies that cannot be fixed\nin-tree. Example use:\n\n```shell\n$ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin\n$ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \\\n      --show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite\n$ valgrind -v --leak-check=full src/bitcoind -printtoconsole\n```\n\n**compiling for test coverage**\n\nLCOV can be used to generate a test coverage report based upon `make check`\nexecution. LCOV must be installed on your system (e.g. the `lcov` package\non Debian/Ubuntu).\n\nTo enable LCOV report generation during test runs:\n\n```shell\n./configure --enable-lcov\nmake\nmake cov\n\n# A coverage report will now be accessible at `./test_bitcoin.coverage/index.html`.\n```\n\nLocking/mutex usage notes\n-------------------------\n\nThe code is multi-threaded, and uses mutexes and the\nLOCK/TRY_LOCK macros to protect data structures.\n\nDeadlocks due to inconsistent lock ordering (thread 1 locks cs_main\nand then cs_wallet, while thread 2 locks them in the opposite order:\nresult, deadlock as each waits for the other to release its lock) are\na problem. Compile with -DDEBUG_LOCKORDER to get lock order\ninconsistencies reported in the debug.log file.\n\nRe-architecting the core code so there are better-defined interfaces\nbetween the various components is a goal, with any necessary locking\ndone by the components (e.g. see the self-contained CKeyStore class\nand its cs_KeyStore lock for example).\n\nThreads\n-------\n\n- ThreadScriptCheck : Verifies block scripts.\n\n- ThreadImport : Loads blocks from blk*.dat files or bootstrap.dat.\n\n- StartNode : Starts other threads.\n\n- ThreadDNSAddressSeed : Loads addresses of peers from the DNS.\n\n- ThreadMapPort : Universal plug-and-play startup/shutdown\n\n- ThreadSocketHandler : Sends/Receives data from peers on port 34230.\n\n- ThreadOpenAddedConnections : Opens network connections to added nodes.\n\n- ThreadOpenConnections : Initiates new connections to peers.\n\n- ThreadMessageHandler : Higher-level message handling (sending and receiving).\n\n- DumpAddresses : Dumps IP addresses of nodes to peers.dat.\n\n- ThreadFlushWalletDB : Close the wallet.dat file if it hasn't been used in 500ms.\n\n- ThreadRPCServer : Remote procedure call handler, listens on port 34229 for connections and services them.\n\n- BitcoinMiner : Generates bitcoins (if wallet is enabled).\n\n- Shutdown : Does an orderly shutdown of everything.\n\nIgnoring IDE/editor files\n--------------------------\n\nIn closed-source environments in which everyone uses the same IDE it is common\nto add temporary files it produces to the project-wide `.gitignore` file.\n\nHowever, in open source software such as Bitcoin Core, where everyone uses\ntheir own editors/IDE/tools, it is less common. Only you know what files your\neditor produces and this may change from version to version. The canonical way\nto do this is thus to create your local gitignore. Add this to `~/.gitconfig`:\n\n```\n[core]\n        excludesfile = /home/.../.gitignore_global\n```\n\n(alternatively, type the command `git config --global core.excludesfile ~/.gitignore_global`\non a terminal)\n\nThen put your favourite tool's temporary filenames in that file, e.g.\n```\n# NetBeans\nnbproject/\n```\n\nAnother option is to create a per-repository excludes file `.git/info/exclude`.\nThese are not committed but apply only to one repository.\n\nIf a set of tools is used by the build system or scripts the repository (for\nexample, lcov) it is perfectly acceptable to add its files to `.gitignore`\nand commit them.\n\nDevelopment guidelines\n============================\n\nA few non-style-related recommendations for developers, as well as points to\npay attention to for reviewers of Bitcoin Core code.\n\nGeneral Bitcoin Core\n----------------------\n\n- New features should be exposed on RPC first, then can be made available in the GUI\n\n  - *Rationale*: RPC allows for better automatic testing. The test suite for\n    the GUI is very limited\n\n- Make sure pull requests pass Travis CI before merging\n\n  - *Rationale*: Makes sure that they pass thorough testing, and that the tester will keep passing\n     on the master branch. Otherwise all new pull requests will start failing the tests, resulting in\n     confusion and mayhem\n\n  - *Explanation*: If the test suite is to be updated for a change, this has to\n    be done first\n\nWallet\n-------\n\n- Make sure that no crashes happen with run-time option `-disablewallet`.\n\n  - *Rationale*: In RPC code that conditionally uses the wallet (such as\n    `validateaddress`) it is easy to forget that global pointer `pwalletMain`\n    can be nullptr. See `test/functional/disablewallet.py` for functional tests\n    exercising the API with `-disablewallet`\n\n- Include `db_cxx.h` (BerkeleyDB header) only when `ENABLE_WALLET` is set\n\n  - *Rationale*: Otherwise compilation of the disable-wallet build will fail in environments without BerkeleyDB\n\nGeneral C++\n-------------\n\n- Assertions should not have side-effects\n\n  - *Rationale*: Even though the source code is set to refuse to compile\n    with assertions disabled, having side-effects in assertions is unexpected and\n    makes the code harder to understand\n\n- If you use the `.h`, you must link the `.cpp`\n\n  - *Rationale*: Include files define the interface for the code in implementation files. Including one but\n      not linking the other is confusing. Please avoid that. Moving functions from\n      the `.h` to the `.cpp` should not result in build errors\n\n- Use the RAII (Resource Acquisition Is Initialization) paradigm where possible. For example by using\n  `unique_ptr` for allocations in a function.\n\n  - *Rationale*: This avoids memory and resource leaks, and ensures exception safety\n\nC++ data structures\n--------------------\n\n- Never use the `std::map []` syntax when reading from a map, but instead use `.find()`\n\n  - *Rationale*: `[]` does an insert (of the default element) if the item doesn't\n    exist in the map yet. This has resulted in memory leaks in the past, as well as\n    race conditions (expecting read-read behavior). Using `[]` is fine for *writing* to a map\n\n- Do not compare an iterator from one data structure with an iterator of\n  another data structure (even if of the same type)\n\n  - *Rationale*: Behavior is undefined. In C++ parlor this means \"may reformat\n    the universe\", in practice this has resulted in at least one hard-to-debug crash bug\n\n- Watch out for out-of-bounds vector access. `&vch[vch.size()]` is illegal,\n  including `&vch[0]` for an empty vector. Use `vch.data()` and `vch.data() +\n  vch.size()` instead.\n\n- Vector bounds checking is only enabled in debug mode. Do not rely on it\n\n- Make sure that constructors initialize all fields. If this is skipped for a\n  good reason (i.e., optimization on the critical path), add an explicit\n  comment about this\n\n  - *Rationale*: Ensure determinism by avoiding accidental use of uninitialized\n    values. Also, static analyzers balk about this.\n\n- By default, declare single-argument constructors `explicit`.\n\n  - *Rationale*: This is a precaution to avoid unintended conversions that might\n    arise when single-argument constructors are used as implicit conversion\n    functions.\n\n- Use explicitly signed or unsigned `char`s, or even better `uint8_t` and\n  `int8_t`. Do not use bare `char` unless it is to pass to a third-party API.\n  This type can be signed or unsigned depending on the architecture, which can\n  lead to interoperability problems or dangerous conditions such as\n  out-of-bounds array accesses\n\n- Prefer explicit constructions over implicit ones that rely on 'magical' C++ behavior\n\n  - *Rationale*: Easier to understand what is happening, thus easier to spot mistakes, even for those\n  that are not language lawyers\n\nStrings and formatting\n------------------------\n\n- Be careful of `LogPrint` versus `LogPrintf`. `LogPrint` takes a `category` argument, `LogPrintf` does not.\n\n  - *Rationale*: Confusion of these can result in runtime exceptions due to\n    formatting mismatch, and it is easy to get wrong because of subtly similar naming\n\n- Use `std::string`, avoid C string manipulation functions\n\n  - *Rationale*: C++ string handling is marginally safer, less scope for\n    buffer overflows and surprises with `\\0` characters. Also some C string manipulations\n    tend to act differently depending on platform, or even the user locale\n\n- Use `ParseInt32`, `ParseInt64`, `ParseUInt32`, `ParseUInt64`, `ParseDouble` from `utilstrencodings.h` for number parsing\n\n  - *Rationale*: These functions do overflow checking, and avoid pesky locale issues\n\n- For `strprintf`, `LogPrint`, `LogPrintf` formatting characters don't need size specifiers\n\n  - *Rationale*: Bitcoin Core uses tinyformat, which is type safe. Leave them out to avoid confusion\n\nVariable names\n--------------\n\nAlthough the shadowing warning (`-Wshadow`) is not enabled by default (it prevents issues rising\nfrom using a different variable with the same name),\nplease name variables so that their names do not shadow variables defined in the source code.\n\nE.g. in member initializers, prepend `_` to the argument name shadowing the\nmember name:\n\n```c++\nclass AddressBookPage\n{\n    Mode mode;\n}\n\nAddressBookPage::AddressBookPage(Mode _mode) :\n      mode(_mode)\n...\n```\n\nWhen using nested cycles, do not name the inner cycle variable the same as in\nupper cycle etc.\n\n\nThreads and synchronization\n----------------------------\n\n- Build and run tests with `-DDEBUG_LOCKORDER` to verify that no potential\n  deadlocks are introduced. As of 0.12, this is defined by default when\n  configuring with `--enable-debug`\n\n- When using `LOCK`/`TRY_LOCK` be aware that the lock exists in the context of\n  the current scope, so surround the statement and the code that needs the lock\n  with braces\n\n  OK:\n\n```c++\n{\n    TRY_LOCK(cs_vNodes, lockNodes);\n    ...\n}\n```\n\n  Wrong:\n\n```c++\nTRY_LOCK(cs_vNodes, lockNodes);\n{\n    ...\n}\n```\n\nSource code organization\n--------------------------\n\n- Implementation code should go into the `.cpp` file and not the `.h`, unless necessary due to template usage or\n  when performance due to inlining is critical\n\n  - *Rationale*: Shorter and simpler header files are easier to read, and reduce compile time\n\n- Every `.cpp` and `.h` file should `#include` every header file it directly uses classes, functions or other\n  definitions from, even if those headers are already included indirectly through other headers. One exception\n  is that a `.cpp` file does not need to re-include the includes already included in its corresponding `.h` file.\n\n  - *Rationale*: Excluding headers because they are already indirectly included results in compilation\n    failures when those indirect dependencies change. Furthermore, it obscures what the real code\n    dependencies are.\n\n- Don't import anything into the global namespace (`using namespace ...`). Use\n  fully specified types such as `std::string`.\n\n  - *Rationale*: Avoids symbol conflicts\n\n- Terminate namespaces with a comment (`// namespace mynamespace`). The comment\n  should be placed on the same line as the brace closing the namespace, e.g.\n\n```c++\nnamespace mynamespace {\n    ...\n} // namespace mynamespace\n\nnamespace {\n    ...\n} // namespace\n```\n\n  - *Rationale*: Avoids confusion about the namespace context\n\n- Prefer `#include <primitives/transaction.h>` bracket syntax instead of\n  `#include \"primitives/transactions.h\"` quote syntax when possible.\n\n  - *Rationale*: Bracket syntax is less ambiguous because the preprocessor\n    searches a fixed list of include directories without taking location of the\n    source file into account. This allows quoted includes to stand out more when\n    the location of the source file actually is relevant.\n\nGUI\n-----\n\n- Do not display or manipulate dialogs in model code (classes `*Model`)\n\n  - *Rationale*: Model classes pass through events and data from the core, they\n    should not interact with the user. That's where View classes come in. The converse also\n    holds: try to not directly access core data structures from Views.\n\nSubtrees\n----------\n\nSeveral parts of the repository are subtrees of software maintained elsewhere.\n\nSome of these are maintained by active developers of Bitcoin Core, in which case changes should probably go\ndirectly upstream without being PRed directly against the project.  They will be merged back in the next\nsubtree merge.\n\nOthers are external projects without a tight relationship with our project.  Changes to these should also\nbe sent upstream but bugfixes may also be prudent to PR against Bitcoin Core so that they can be integrated\nquickly.  Cosmetic changes should be purely taken upstream.\n\nThere is a tool in contrib/devtools/git-subtree-check.sh to check a subtree directory for consistency with\nits upstream repository.\n\nCurrent subtrees include:\n\n- src/leveldb\n  - Upstream at https://github.com/google/leveldb ; Maintained by Google, but open important PRs to Core to avoid delay\n\n- src/libsecp256k1\n  - Upstream at https://github.com/bitcoin-core/secp256k1/ ; actively maintaned by Core contributors.\n\n- src/crypto/ctaes\n  - Upstream at https://github.com/bitcoin-core/ctaes ; actively maintained by Core contributors.\n\n- src/univalue\n  - Upstream at https://github.com/jgarzik/univalue ; report important PRs to Core to avoid delay.\n\n\nGit and GitHub tips\n---------------------\n\n- For resolving merge/rebase conflicts, it can be useful to enable diff3 style using\n  `git config merge.conflictstyle diff3`. Instead of\n\n        <<<\n        yours\n        ===\n        theirs\n        >>>\n\n  you will see\n\n        <<<\n        yours\n        |||\n        original\n        ===\n        theirs\n        >>>\n\n  This may make it much clearer what caused the conflict. In this style, you can often just look\n  at what changed between *original* and *theirs*, and mechanically apply that to *yours* (or the other way around).\n\n- When reviewing patches which change indentation in C++ files, use `git diff -w` and `git show -w`. This makes\n  the diff algorithm ignore whitespace changes. This feature is also available on github.com, by adding `?w=1`\n  at the end of any URL which shows a diff.\n\n- When reviewing patches that change symbol names in many places, use `git diff --word-diff`. This will instead\n  of showing the patch as deleted/added *lines*, show deleted/added *words*.\n\n- When reviewing patches that move code around, try using\n  `git diff --patience commit~:old/file.cpp commit:new/file/name.cpp`, and ignoring everything except the\n  moved body of code which should show up as neither `+` or `-` lines. In case it was not a pure move, this may\n  even work when combined with the `-w` or `--word-diff` options described above.\n\n- When looking at other's pull requests, it may make sense to add the following section to your `.git/config`\n  file:\n\n        [remote \"upstream-pull\"]\n                fetch = +refs/pull/*:refs/remotes/upstream-pull/*\n                url = git@github.com:bitcoin/bitcoin.git\n\n  This will add an `upstream-pull` remote to your git repository, which can be fetched using `git fetch --all`\n  or `git fetch upstream-pull`. Afterwards, you can use `upstream-pull/NUMBER/head` in arguments to `git show`,\n  `git checkout` and anywhere a commit id would be acceptable to see the changes from pull request NUMBER.\n\nScripted diffs\n--------------\n\nFor reformatting and refactoring commits where the changes can be easily automated using a bash script, we use\nscripted-diff commits. The bash script is included in the commit message and our Travis CI job checks that\nthe result of the script is identical to the commit. This aids reviewers since they can verify that the script\ndoes exactly what it's supposed to do. It is also helpful for rebasing (since the same script can just be re-run\non the new master commit).\n\nTo create a scripted-diff:\n\n- start the commit message with `scripted-diff:` (and then a description of the diff on the same line)\n- in the commit message include the bash script between lines containing just the following text:\n    - `-BEGIN VERIFY SCRIPT-`\n    - `-END VERIFY SCRIPT-`\n\nThe scripted-diff is verified by the tool `contrib/devtools/commit-script-check.sh`\n\nCommit `bb81e173` is an example of a scripted-diff.\n\nRPC interface guidelines\n--------------------------\n\nA few guidelines for introducing and reviewing new RPC interfaces:\n\n- Method naming: use consecutive lower-case names such as `getrawtransaction` and `submitblock`\n\n  - *Rationale*: Consistency with existing interface.\n\n- Argument naming: use snake case `fee_delta` (and not, e.g. camel case `feeDelta`)\n\n  - *Rationale*: Consistency with existing interface.\n\n- Use the JSON parser for parsing, don't manually parse integers or strings from\n  arguments unless absolutely necessary.\n\n  - *Rationale*: Introduces hand-rolled string manipulation code at both the caller and callee sites,\n    which is error prone, and it is easy to get things such as escaping wrong.\n    JSON already supports nested data structures, no need to re-invent the wheel.\n\n  - *Exception*: AmountFromValue can parse amounts as string. This was introduced because many JSON\n    parsers and formatters hard-code handling decimal numbers as floating point\n    values, resulting in potential loss of precision. This is unacceptable for\n    monetary values. **Always** use `AmountFromValue` and `ValueFromAmount` when\n    inputting or outputting monetary values. The only exceptions to this are\n    `prioritisetransaction` and `getblocktemplate` because their interface\n    is specified as-is in BIP22.\n\n- Missing arguments and 'null' should be treated the same: as default values. If there is no\n  default value, both cases should fail in the same way. The easiest way to follow this\n  guideline is detect unspecified arguments with `params[x].isNull()` instead of\n  `params.size() <= x`. The former returns true if the argument is either null or missing,\n  while the latter returns true if is missing, and false if it is null.\n\n  - *Rationale*: Avoids surprises when switching to name-based arguments. Missing name-based arguments\n  are passed as 'null'.\n\n- Try not to overload methods on argument type. E.g. don't make `getblock(true)` and `getblock(\"hash\")`\n  do different things.\n\n  - *Rationale*: This is impossible to use with `bitcoin-cli`, and can be surprising to users.\n\n  - *Exception*: Some RPC calls can take both an `int` and `bool`, most notably when a bool was switched\n    to a multi-value, or due to other historical reasons. **Always** have false map to 0 and\n    true to 1 in this case.\n\n- Don't forget to fill in the argument names correctly in the RPC command table.\n\n  - *Rationale*: If not, the call can not be used with name-based arguments.\n\n- Set okSafeMode in the RPC command table to a sensible value: safe mode is when the\n  blockchain is regarded to be in a confused state, and the client deems it unsafe to\n  do anything irreversible such as send. Anything that just queries should be permitted.\n\n  - *Rationale*: Troubleshooting a node in safe mode is difficult if half the\n    RPCs don't work.\n\n- Add every non-string RPC argument `(method, idx, name)` to the table `vRPCConvertParams` in `rpc/client.cpp`.\n\n  - *Rationale*: `bitcoin-cli` and the GUI debug console use this table to determine how to\n    convert a plaintext command line to JSON. If the types don't match, the method can be unusable\n    from there.\n\n- A RPC method must either be a wallet method or a non-wallet method. Do not\n  introduce new methods such as `signrawtransaction` that differ in behavior\n  based on presence of a wallet.\n\n  - *Rationale*: as well as complicating the implementation and interfering\n    with the introduction of multi-wallet, wallet and non-wallet code should be\n    separated to avoid introducing circular dependencies between code units.\n\n- Try to make the RPC response a JSON object.\n\n  - *Rationale*: If a RPC response is not a JSON object then it is harder to avoid API breakage if\n    new data in the response is needed.\n\n- Wallet RPCs call BlockUntilSyncedToCurrentChain to maintain consistency with\n  `getblockchaininfo`'s state immediately prior to the call's execution. Wallet\n  RPCs whose behavior does *not* depend on the current chainstate may omit this\n  call.\n\n  - *Rationale*: In previous versions of Bitcoin Core, the wallet was always\n    in-sync with the chainstate (by virtue of them all being updated in the\n    same cs_main lock). In order to maintain the behavior that wallet RPCs\n    return results as of at least the highest best-known block an RPC\n    client may be aware of prior to entering a wallet RPC call, we must block\n    until the wallet is caught up to the chainstate as of the RPC call's entry.\n    This also makes the API much easier for RPC clients to reason about.\n"
  },
  {
    "path": "doc/dnsseed-policy.md",
    "content": "Expectations for DNS Seed operators\n====================================\n\nBitcoin Core attempts to minimize the level of trust in DNS seeds,\nbut DNS seeds still pose a small amount of risk for the network.\nAs such, DNS seeds must be run by entities which have some minimum\nlevel of trust within the Bitcoin community.\n\nOther implementations of Bitcoin software may also use the same\nseeds and may be more exposed. In light of this exposure, this\ndocument establishes some basic expectations for operating dnsseeds.\n\n0. A DNS seed operating organization or person is expected to follow good\nhost security practices, maintain control of applicable infrastructure,\nand not sell or transfer control of the DNS seed. Any hosting services\ncontracted by the operator are equally expected to uphold these expectations.\n\n1. The DNS seed results must consist exclusively of fairly selected and\nfunctioning Bitcoin nodes from the public network to the best of the\noperator's understanding and capability.\n\n2. For the avoidance of doubt, the results may be randomized but must not\nsingle-out any group of hosts to receive different results unless due to an\nurgent technical necessity and disclosed.\n\n3. The results may not be served with a DNS TTL of less than one minute.\n\n4. Any logging of DNS queries should be only that which is necessary\nfor the operation of the service or urgent health of the Bitcoin\nnetwork and must not be retained longer than necessary nor disclosed\nto any third party.\n\n5. Information gathered as a result of the operators node-spidering\n(not from DNS queries) may be freely published or retained, but only\nif this data was not made more complete by biasing node connectivity\n(a violation of expectation (1)).\n\n6. Operators are encouraged, but not required, to publicly document the\ndetails of their operating practices.\n\n7. A reachable email contact address must be published for inquiries\nrelated to the DNS seed operation.\n\nIf these expectations cannot be satisfied the operator should\ndiscontinue providing services and contact the active Bitcoin\nCore development team as well as posting on\n[bitcoin-dev](https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev).\n\nBehavior outside of these expectations may be reasonable in some\nsituations but should be discussed in public in advance.\n\nSee also\n----------\n- [bitcoin-seeder](https://github.com/sipa/bitcoin-seeder) is a reference implementation of a DNS seed.\n"
  },
  {
    "path": "doc/files.md",
    "content": "\n* banlist.dat: stores the IPs/Subnets of banned nodes\n* bitcoin.conf: contains configuration settings for bitcoind or bitcoin-qt\n* bitcoind.pid: stores the process id of bitcoind while running\n* blocks/blk000??.dat: block data (custom, 128 MiB per file); since 0.8.0\n* blocks/rev000??.dat; block undo data (custom); since 0.8.0 (format changed since pre-0.8)\n* blocks/index/*; block index (LevelDB); since 0.8.0\n* chainstate/*; block chain state database (LevelDB); since 0.8.0\n* database/*: BDB database environment; only used for wallet since 0.8.0; moved to wallets/ directory on new installs since 0.16.0\n* db.log: wallet database log file; moved to wallets/ directory on new installs since 0.16.0\n* debug.log: contains debug information and general logging generated by bitcoind or bitcoin-qt\n* fee_estimates.dat: stores statistics used to estimate minimum transaction fees and priorities required for confirmation; since 0.10.0\n* mempool.dat: dump of the mempool's transactions; since 0.14.0.\n* peers.dat: peer IP address database (custom format); since 0.7.0\n* wallet.dat: personal wallet (BDB) with keys and transactions; moved to wallets/ directory on new installs since 0.16.0\n* wallets/database/*: BDB database environment; used for wallets since 0.16.0\n* wallets/db.log: wallet database log file; since 0.16.0\n* wallets/wallet.dat: personal wallet (BDB) with keys and transactions; since 0.16.0\n* .cookie: session RPC authentication cookie (written at start when cookie authentication is used, deleted on shutdown): since 0.12.0\n* onion_private_key: cached Tor hidden service private key for `-listenonion`: since 0.12.0\n* guisettings.ini.bak: backup of former GUI settings after `-resetguisettings` is used\n\nOnly used in pre-0.8.0\n---------------------\n* blktree/*; block chain index (LevelDB); since pre-0.8, replaced by blocks/index/* in 0.8.0\n* coins/*; unspent transaction output database (LevelDB); since pre-0.8, replaced by chainstate/* in 0.8.0\n\nOnly used before 0.8.0\n---------------------\n* blkindex.dat: block chain index database (BDB); replaced by {chainstate/*,blocks/index/*,blocks/rev000??.dat} in 0.8.0\n* blk000?.dat: block data (custom, 2 GiB per file); replaced by blocks/blk000??.dat in 0.8.0\n\nOnly used before 0.7.0\n---------------------\n* addr.dat: peer IP address database (BDB); replaced by peers.dat in 0.7.0\n"
  },
  {
    "path": "doc/fuzzing.md",
    "content": "Fuzz-testing Bitcoin Core\n==========================\n\nA special test harness `test_bitcoin_fuzzy` is provided to provide an easy\nentry point for fuzzers and the like. In this document we'll describe how to\nuse it with AFL.\n\nBuilding AFL\n-------------\n\nIt is recommended to always use the latest version of afl:\n```\nwget http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz\ntar -zxvf afl-latest.tgz\ncd afl-<version>\nmake\nexport AFLPATH=$PWD\n```\n\nInstrumentation\n----------------\n\nTo build Bitcoin Core using AFL instrumentation (this assumes that the\n`AFLPATH` was set as above):\n```\n./configure --disable-ccache --disable-shared --enable-tests CC=${AFLPATH}/afl-gcc CXX=${AFLPATH}/afl-g++\nexport AFL_HARDEN=1\ncd src/\nmake test/test_bitcoin_fuzzy\n```\nWe disable ccache because we don't want to pollute the ccache with instrumented\nobjects, and similarly don't want to use non-instrumented cached objects linked\nin.\n\nThe fuzzing can be sped up significantly (~200x) by using `afl-clang-fast` and\n`afl-clang-fast++` in place of `afl-gcc` and `afl-g++` when compiling. When\ncompiling using `afl-clang-fast`/`afl-clang-fast++` the resulting\n`test_bitcoin_fuzzy` binary will be instrumented in such a way that the AFL\nfeatures \"persistent mode\" and \"deferred forkserver\" can be used. See\nhttps://github.com/mcarpenter/afl/tree/master/llvm_mode for details.\n\nPreparing fuzzing\n------------------\n\nAFL needs an input directory with examples, and an output directory where it\nwill place examples that it found. These can be anywhere in the file system,\nwe'll define environment variables to make it easy to reference them.\n\n```\nmkdir inputs\nAFLIN=$PWD/inputs\nmkdir outputs\nAFLOUT=$PWD/outputs\n```\n\nExample inputs are available from:\n\n- https://download.visucore.com/bitcoin/bitcoin_fuzzy_in.tar.xz\n- http://strateman.ninja/fuzzing.tar.xz\n\nExtract these (or other starting inputs) into the `inputs` directory before starting fuzzing.\n\nFuzzing\n--------\n\nTo start the actual fuzzing use:\n```\n$AFLPATH/afl-fuzz -i ${AFLIN} -o ${AFLOUT} -m52 -- test/test_bitcoin_fuzzy\n```\n\nYou may have to change a few kernel parameters to test optimally - `afl-fuzz`\nwill print an error and suggestion if so.\n"
  },
  {
    "path": "doc/gitian-building.md",
    "content": "Gitian building\n================\n\nThis file was moved to [the Bitcoin Core documentation repository](https://github.com/bitcoin-core/docs/blob/master/gitian-building.md) at [https://github.com/bitcoin-core/docs](https://github.com/bitcoin-core/docs).\n"
  },
  {
    "path": "doc/init.md",
    "content": "Sample init scripts and service configuration for bitcoind\n==========================================================\n\nSample scripts and configuration files for systemd, Upstart and OpenRC\ncan be found in the contrib/init folder.\n\n    contrib/init/bitcoind.service:    systemd service unit configuration\n    contrib/init/bitcoind.openrc:     OpenRC compatible SysV style init script\n    contrib/init/bitcoind.openrcconf: OpenRC conf.d file\n    contrib/init/bitcoind.conf:       Upstart service configuration file\n    contrib/init/bitcoind.init:       CentOS compatible SysV style init script\n\nService User\n---------------------------------\n\nAll three Linux startup configurations assume the existence of a \"bitcoin\" user\nand group.  They must be created before attempting to use these scripts.\nThe OS X configuration assumes bitcoind will be set up for the current user.\n\nConfiguration\n---------------------------------\n\nAt a bare minimum, bitcoind requires that the rpcpassword setting be set\nwhen running as a daemon.  If the configuration file does not exist or this\nsetting is not set, bitcoind will shutdown promptly after startup.\n\nThis password does not have to be remembered or typed as it is mostly used\nas a fixed token that bitcoind and client programs read from the configuration\nfile, however it is recommended that a strong and secure password be used\nas this password is security critical to securing the wallet should the\nwallet be enabled.\n\nIf bitcoind is run with the \"-server\" flag (set by default), and no rpcpassword is set,\nit will use a special cookie file for authentication. The cookie is generated with random\ncontent when the daemon starts, and deleted when it exits. Read access to this file\ncontrols who can access it through RPC.\n\nBy default the cookie is stored in the data directory, but it's location can be overridden\nwith the option '-rpccookiefile'.\n\nThis allows for running bitcoind without having to do any manual configuration.\n\n`conf`, `pid`, and `wallet` accept relative paths which are interpreted as\nrelative to the data directory. `wallet` *only* supports relative paths.\n\nFor an example configuration file that describes the configuration settings,\nsee `contrib/debian/examples/bitcoin.conf`.\n\nPaths\n---------------------------------\n\n### Linux\n\nAll three configurations assume several paths that might need to be adjusted.\n\nBinary:              `/usr/bin/bitcoind`  \nConfiguration file:  `/etc/bitcoin/bitcoin.conf`  \nData directory:      `/var/lib/bitcoind`  \nPID file:            `/var/run/bitcoind/bitcoind.pid` (OpenRC and Upstart) or `/var/lib/bitcoind/bitcoind.pid` (systemd)  \nLock file:           `/var/lock/subsys/bitcoind` (CentOS)  \n\nThe configuration file, PID directory (if applicable) and data directory\nshould all be owned by the bitcoin user and group.  It is advised for security\nreasons to make the configuration file and data directory only readable by the\nbitcoin user and group.  Access to bitcoin-cli and other bitcoind rpc clients\ncan then be controlled by group membership.\n\n### Mac OS X\n\nBinary:              `/usr/local/bin/bitcoind`  \nConfiguration file:  `~/Library/Application Support/Bitcoin/bitcoin.conf`  \nData directory:      `~/Library/Application Support/Bitcoin`  \nLock file:           `~/Library/Application Support/Bitcoin/.lock`  \n\nInstalling Service Configuration\n-----------------------------------\n\n### systemd\n\nInstalling this .service file consists of just copying it to\n/usr/lib/systemd/system directory, followed by the command\n`systemctl daemon-reload` in order to update running systemd configuration.\n\nTo test, run `systemctl start bitcoind` and to enable for system startup run\n`systemctl enable bitcoind`\n\n### OpenRC\n\nRename bitcoind.openrc to bitcoind and drop it in /etc/init.d.  Double\ncheck ownership and permissions and make it executable.  Test it with\n`/etc/init.d/bitcoind start` and configure it to run on startup with\n`rc-update add bitcoind`\n\n### Upstart (for Debian/Ubuntu based distributions)\n\nDrop bitcoind.conf in /etc/init.  Test by running `service bitcoind start`\nit will automatically start on reboot.\n\nNOTE: This script is incompatible with CentOS 5 and Amazon Linux 2014 as they\nuse old versions of Upstart and do not supply the start-stop-daemon utility.\n\n### CentOS\n\nCopy bitcoind.init to /etc/init.d/bitcoind. Test by running `service bitcoind start`.\n\nUsing this script, you can adjust the path and flags to the bitcoind program by\nsetting the BITCOIND and FLAGS environment variables in the file\n/etc/sysconfig/bitcoind. You can also use the DAEMONOPTS environment variable here.\n\n### Mac OS X\n\nCopy org.bitcoin.bitcoind.plist into ~/Library/LaunchAgents. Load the launch agent by\nrunning `launchctl load ~/Library/LaunchAgents/org.bitcoin.bitcoind.plist`.\n\nThis Launch Agent will cause bitcoind to start whenever the user logs in.\n\nNOTE: This approach is intended for those wanting to run bitcoind as the current user.\nYou will need to modify org.bitcoin.bitcoind.plist if you intend to use it as a\nLaunch Daemon with a dedicated bitcoin user.\n\nAuto-respawn\n-----------------------------------\n\nAuto respawning is currently only configured for Upstart and systemd.\nReasonable defaults have been chosen but YMMV.\n"
  },
  {
    "path": "doc/man/Makefile.am",
    "content": "dist_man1_MANS=\n\nif BUILD_BITCOIND\n  dist_man1_MANS+=sugarchaind.1\nendif\n\nif ENABLE_QT\n  dist_man1_MANS+=sugarchain-qt.1\nendif\n\nif BUILD_BITCOIN_UTILS\n  dist_man1_MANS+=sugarchain-cli.1 sugarchain-tx.1\nendif\n"
  },
  {
    "path": "doc/man/sugarchain-cli.1",
    "content": ".\\\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.8.\n.TH SUGARCHAIN-CLI \"1\" \"January 2021\" \"sugarchain-cli v0.16.3.36\" \"User Commands\"\n.SH NAME\nsugarchain-cli \\- manual page for sugarchain-cli v0.16.3.36\n.SH DESCRIPTION\nSugarchain Yumekawa RPC client version v0.16.3.36\n.SS \"Usage:\"\n.TP\nsugarchain\\-cli [options] <command> [params]\nSend command to Sugarchain Yumekawa\n.IP\nsugarchain\\-cli [options] \\fB\\-named\\fR <command> [name=value] ... Send command to Sugarchain Yumekawa (with named arguments)\nsugarchain\\-cli [options] help                List commands\nsugarchain\\-cli [options] help <command>      Get help for a command\n.SH OPTIONS\n.HP\n\\-?\n.IP\nThis help message\n.HP\n\\fB\\-conf=\\fR<file>\n.IP\nSpecify configuration file (default: sugarchain.conf)\n.HP\n\\fB\\-datadir=\\fR<dir>\n.IP\nSpecify data directory\n.HP\n\\fB\\-getinfo\\fR\n.IP\nGet general information from the remote server. Note that unlike\nserver\\-side RPC calls, the results of \\fB\\-getinfo\\fR is the result of\nmultiple non\\-atomic requests. Some entries in the result may\nrepresent results from different states (e.g. wallet balance may\nbe as of a different block from the chain state reported)\n.PP\nChain selection options:\n.HP\n\\fB\\-testnet\\fR\n.IP\nUse the test chain\n.HP\n\\fB\\-regtest\\fR\n.IP\nEnter regression test mode, which uses a special chain in which blocks\ncan be solved instantly. This is intended for regression testing\ntools and app development.\n.HP\n\\fB\\-named\\fR\n.IP\nPass named instead of positional arguments (default: false)\n.HP\n\\fB\\-rpcconnect=\\fR<ip>\n.IP\nSend commands to node running on <ip> (default: 127.0.0.1)\n.HP\n\\fB\\-rpcport=\\fR<port>\n.IP\nConnect to JSON\\-RPC on <port> (default: 34229 or testnet: 44229)\n.HP\n\\fB\\-rpcwait\\fR\n.IP\nWait for RPC server to start\n.HP\n\\fB\\-rpcuser=\\fR<user>\n.IP\nUsername for JSON\\-RPC connections\n.HP\n\\fB\\-rpcpassword=\\fR<pw>\n.IP\nPassword for JSON\\-RPC connections\n.HP\n\\fB\\-rpcclienttimeout=\\fR<n>\n.IP\nTimeout in seconds during HTTP requests, or 0 for no timeout. (default:\n900)\n.HP\n\\fB\\-stdinrpcpass\\fR\n.TP\nRead RPC password from standard input as a single line.\nWhen combined\n.IP\nwith \\fB\\-stdin\\fR, the first line from standard input is used for the\nRPC password.\n.HP\n\\fB\\-stdin\\fR\n.IP\nRead extra arguments from standard input, one per line until EOF/Ctrl\\-D\n(recommended for sensitive information such as passphrases).\nWhen combined with \\fB\\-stdinrpcpass\\fR, the first line from standard\ninput is used for the RPC password.\n.HP\n\\fB\\-rpcwallet=\\fR<walletname>\n.IP\nSend RPC for non\\-default wallet on RPC server (argument is wallet\nfilename in sugarchaind directory, required if sugarchaind/\\-Qt\nruns with multiple wallets)\n.SH COPYRIGHT\nCopyright (C) 2009-2010 Satoshi Nakamoto\nCopyright (C) 2009-2018 The Bitcoin Core developers\nCopyright (C) 2013-2019 Alexander Peslyak - Yespower 1.0.1\nCopyright (C) 2016-2018 The Zcash developers - DigiShieldZEC\nCopyright (C) 2018-2020 The Sugarchain Yumekawa developers\n\nPlease contribute if you find Sugarchain Yumekawa useful. Visit\n<https://sugarchain.org> for further information about the software.\nThe source code is available from\n<https://github.com/sugarchain-project/sugarchain>.\n\nThis is experimental software.\nDistributed under the MIT software license, see the accompanying file COPYING\nor <https://opensource.org/licenses/MIT>\n\nThis product includes software developed by the OpenSSL Project for use in the\nOpenSSL Toolkit <https://www.openssl.org> and cryptographic software written by\nEric Young and UPnP software written by Thomas Bernard.\n"
  },
  {
    "path": "doc/man/sugarchain-qt.1",
    "content": ".\\\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.8.\n.TH SUGARCHAIN-QT \"1\" \"January 2021\" \"sugarchain-qt v0.16.3.36\" \"User Commands\"\n.SH NAME\nsugarchain-qt \\- manual page for sugarchain-qt v0.16.3.36\n.SH DESCRIPTION\nSugarchain Yumekawa version v0.16.3.36 (64\\-bit)\nUsage:\n.IP\nsugarchain\\-qt [command\\-line options]\n.SH OPTIONS\n.HP\n\\-?\n.IP\nPrint this help message and exit\n.HP\n\\fB\\-version\\fR\n.IP\nPrint version and exit\n.HP\n\\fB\\-alertnotify=\\fR<cmd>\n.IP\nExecute command when a relevant alert is received or we see a really\nlong fork (%s in cmd is replaced by message)\n.HP\n\\fB\\-blocknotify=\\fR<cmd>\n.IP\nExecute command when the best block changes (%s in cmd is replaced by\nblock hash)\n.HP\n\\fB\\-assumevalid=\\fR<hex>\n.IP\nIf this block is in the chain assume that it and its ancestors are valid\nand potentially skip their script verification (0 to verify all,\ndefault:\n855f0c66238bc0246c8ca25cf958283fd49b9fb4b217ddeb518e5ea9f5071b9e,\ntestnet:\nbc05c2d5e81785f287cd58a798b64467cff35c8ef2bbe8062d8420eeb86f4056)\n.HP\n\\fB\\-conf=\\fR<file>\n.IP\nSpecify configuration file (default: sugarchain.conf)\n.HP\n\\fB\\-datadir=\\fR<dir>\n.IP\nSpecify data directory\n.HP\n\\fB\\-dbcache=\\fR<n>\n.IP\nSet database cache size in megabytes (4 to 16384, default: 450)\n.HP\n\\fB\\-loadblock=\\fR<file>\n.IP\nImports blocks from external blk000??.dat file on startup\n.HP\n\\fB\\-debuglogfile=\\fR<file>\n.IP\nSpecify location of debug log file: this can be an absolute path or a\npath relative to the data directory (default: debug.log)\n.HP\n\\fB\\-maxorphantx=\\fR<n>\n.IP\nKeep at most <n> unconnectable transactions in memory (default: 100)\n.HP\n\\fB\\-maxmempool=\\fR<n>\n.IP\nKeep the transaction memory pool below <n> megabytes (default: 300)\n.HP\n\\fB\\-mempoolexpiry=\\fR<n>\n.IP\nDo not keep transactions in the mempool longer than <n> hours (default:\n336)\n.HP\n\\fB\\-persistmempool\\fR\n.IP\nWhether to save the mempool on shutdown and load on restart (default: 1)\n.HP\n\\fB\\-blockreconstructionextratxn=\\fR<n>\n.IP\nExtra transactions to keep in memory for compact block reconstructions\n(default: 100)\n.HP\n\\fB\\-par=\\fR<n>\n.IP\nSet the number of script verification threads (\\fB\\-8\\fR to 16, 0 = auto, <0 =\nleave that many cores free, default: 0)\n.HP\n\\fB\\-pid=\\fR<file>\n.IP\nSpecify pid file (default: sugarchaind.pid)\n.HP\n\\fB\\-prune=\\fR<n>\n.IP\nReduce storage requirements by enabling pruning (deleting) of old\nblocks. This allows the pruneblockchain RPC to be called to\ndelete specific blocks, and enables automatic pruning of old\nblocks if a target size in MiB is provided. This mode is\nincompatible with \\fB\\-txindex\\fR and \\fB\\-rescan\\fR. Warning: Reverting this\nsetting requires re\\-downloading the entire blockchain. (default:\n0 = disable pruning blocks, 1 = allow manual pruning via RPC,\n>=550 = automatically prune block files to stay under the\nspecified target size in MiB)\n.HP\n\\fB\\-reindex\\-chainstate\\fR\n.IP\nRebuild chain state from the currently indexed blocks\n.HP\n\\fB\\-reindex\\fR\n.IP\nRebuild chain state and block index from the blk*.dat files on disk\n.HP\n\\fB\\-sysperms\\fR\n.IP\nCreate new files with system default permissions, instead of umask 077\n(only effective with disabled wallet functionality)\n.HP\n\\fB\\-txindex\\fR\n.IP\nMaintain a full transaction index, used by the getrawtransaction rpc\ncall (default: 0)\n.PP\nConnection options:\n.HP\n\\fB\\-addnode=\\fR<ip>\n.IP\nAdd a node to connect to and attempt to keep the connection open (see\nthe `addnode` RPC command help for more info)\n.HP\n\\fB\\-banscore=\\fR<n>\n.IP\nThreshold for disconnecting misbehaving peers (default: 100)\n.HP\n\\fB\\-bantime=\\fR<n>\n.IP\nNumber of seconds to keep misbehaving peers from reconnecting (default:\n86400)\n.HP\n\\fB\\-bind=\\fR<addr>\n.IP\nBind to given address and always listen on it. Use [host]:port notation\nfor IPv6\n.HP\n\\fB\\-connect=\\fR<ip>\n.IP\nConnect only to the specified node(s); \\fB\\-connect\\fR=\\fI\\,0\\/\\fR disables automatic\nconnections (the rules for this peer are the same as for\n\\fB\\-addnode\\fR)\n.HP\n\\fB\\-discover\\fR\n.IP\nDiscover own IP addresses (default: 1 when listening and no \\fB\\-externalip\\fR\nor \\fB\\-proxy\\fR)\n.HP\n\\fB\\-dns\\fR\n.IP\nAllow DNS lookups for \\fB\\-addnode\\fR, \\fB\\-seednode\\fR and \\fB\\-connect\\fR (default: 1)\n.HP\n\\fB\\-dnsseed\\fR\n.IP\nQuery for peer addresses via DNS lookup, if low on addresses (default: 1\nunless \\fB\\-connect\\fR used)\n.HP\n\\fB\\-externalip=\\fR<ip>\n.IP\nSpecify your own public address\n.HP\n\\fB\\-forcednsseed\\fR\n.IP\nAlways query for peer addresses via DNS lookup (default: 0)\n.HP\n\\fB\\-listen\\fR\n.IP\nAccept connections from outside (default: 1 if no \\fB\\-proxy\\fR or \\fB\\-connect\\fR)\n.HP\n\\fB\\-listenonion\\fR\n.IP\nAutomatically create Tor hidden service (default: 1)\n.HP\n\\fB\\-maxconnections=\\fR<n>\n.IP\nMaintain at most <n> connections to peers (default: 125)\n.HP\n\\fB\\-maxreceivebuffer=\\fR<n>\n.IP\nMaximum per\\-connection receive buffer, <n>*1000 bytes (default: 5000)\n.HP\n\\fB\\-maxsendbuffer=\\fR<n>\n.IP\nMaximum per\\-connection send buffer, <n>*1000 bytes (default: 1000)\n.HP\n\\fB\\-maxtimeadjustment\\fR\n.IP\nMaximum allowed median peer time offset adjustment. Local perspective of\ntime may be influenced by peers forward or backward by this\namount. (default: 70 seconds)\n.HP\n\\fB\\-onion=\\fR<ip:port>\n.IP\nUse separate SOCKS5 proxy to reach peers via Tor hidden services\n(default: \\fB\\-proxy\\fR)\n.HP\n\\fB\\-onlynet=\\fR<net>\n.IP\nOnly connect to nodes in network <net> (ipv4, ipv6 or onion)\n.HP\n\\fB\\-permitbaremultisig\\fR\n.IP\nRelay non\\-P2SH multisig (default: 1)\n.HP\n\\fB\\-peerbloomfilters\\fR\n.IP\nSupport filtering of blocks and transaction with bloom filters (default:\n1)\n.HP\n\\fB\\-port=\\fR<port>\n.IP\nListen for connections on <port> (default: 34230 or testnet: 44230)\n.HP\n\\fB\\-proxy=\\fR<ip:port>\n.IP\nConnect through SOCKS5 proxy\n.HP\n\\fB\\-proxyrandomize\\fR\n.IP\nRandomize credentials for every proxy connection. This enables Tor\nstream isolation (default: 1)\n.HP\n\\fB\\-seednode=\\fR<ip>\n.IP\nConnect to a node to retrieve peer addresses, and disconnect\n.HP\n\\fB\\-timeout=\\fR<n>\n.IP\nSpecify connection timeout in milliseconds (minimum: 1, default: 5000)\n.HP\n\\fB\\-torcontrol=\\fR<ip>:<port>\n.IP\nTor control port to use if onion listening enabled (default:\n127.0.0.1:9051)\n.HP\n\\fB\\-torpassword=\\fR<pass>\n.IP\nTor control port password (default: empty)\n.HP\n\\fB\\-upnp\\fR\n.IP\nUse UPnP to map the listening port (default: 0)\n.HP\n\\fB\\-whitebind=\\fR<addr>\n.IP\nBind to given address and whitelist peers connecting to it. Use\n[host]:port notation for IPv6\n.HP\n\\fB\\-whitelist=\\fR<IP address or network>\n.IP\nWhitelist peers connecting from the given IP address (e.g. 1.2.3.4) or\nCIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple\ntimes. Whitelisted peers cannot be DoS banned and their\ntransactions are always relayed, even if they are already in the\nmempool, useful e.g. for a gateway\n.HP\n\\fB\\-maxuploadtarget=\\fR<n>\n.IP\nTries to keep outbound traffic under the given target (in MiB per 24h),\n0 = no limit (default: 0)\n.PP\nWallet options:\n.HP\n\\fB\\-addresstype\\fR\n.IP\nWhat type of addresses to use (\"legacy\", \"p2sh\\-segwit\", or \"bech32\",\ndefault: \"bech32\")\n.HP\n\\fB\\-changetype\\fR\n.IP\nWhat type of change to use (\"legacy\", \"p2sh\\-segwit\", or \"bech32\").\nDefault is same as \\fB\\-addresstype\\fR, except when\n\\fB\\-addresstype\\fR=\\fI\\,p2sh\\-segwit\\/\\fR a native segwit output is used when\nsending to a native segwit address)\n.HP\n\\fB\\-disablewallet\\fR\n.IP\nDo not load the wallet and disable wallet RPC calls\n.HP\n\\fB\\-keypool=\\fR<n>\n.IP\nSet key pool size to <n> (default: 1000)\n.HP\n\\fB\\-fallbackfee=\\fR<amt>\n.IP\nA fee rate (in SUGAR/kB) that will be used when fee estimation has\ninsufficient data (default: 0.0002)\n.HP\n\\fB\\-discardfee=\\fR<amt>\n.IP\nThe fee rate (in SUGAR/kB) that indicates your tolerance for discarding\nchange by adding it to the fee (default: 0.0001). Note: An output\nis discarded if it is dust at this rate, but we will always\ndiscard up to the dust relay fee and a discard fee above that is\nlimited by the fee estimate for the longest target\n.HP\n\\fB\\-mintxfee=\\fR<amt>\n.IP\nFees (in SUGAR/kB) smaller than this are considered zero fee for\ntransaction creation (default: 0.00001)\n.HP\n\\fB\\-paytxfee=\\fR<amt>\n.IP\nFee (in SUGAR/kB) to add to transactions you send (default: 0.00)\n.HP\n\\fB\\-rescan\\fR\n.IP\nRescan the block chain for missing wallet transactions on startup\n.HP\n\\fB\\-salvagewallet\\fR\n.IP\nAttempt to recover private keys from a corrupt wallet on startup\n.HP\n\\fB\\-spendzeroconfchange\\fR\n.IP\nSpend unconfirmed change when sending transactions (default: 1)\n.HP\n\\fB\\-txconfirmtarget=\\fR<n>\n.IP\nIf paytxfee is not set, include enough fee so transactions begin\nconfirmation on average within n blocks (default: 6)\n.HP\n\\fB\\-walletrbf\\fR\n.IP\nSend transactions with full\\-RBF opt\\-in enabled (RPC only, default: 0)\n.HP\n\\fB\\-upgradewallet\\fR\n.IP\nUpgrade wallet to latest format on startup\n.HP\n\\fB\\-wallet=\\fR<file>\n.IP\nSpecify wallet file (within data directory) (default: wallet.dat)\n.HP\n\\fB\\-walletbroadcast\\fR\n.IP\nMake the wallet broadcast transactions (default: 1)\n.HP\n\\fB\\-walletdir=\\fR<dir>\n.IP\nSpecify directory to hold wallets (default: <datadir>/wallets if it\nexists, otherwise <datadir>)\n.HP\n\\fB\\-walletnotify=\\fR<cmd>\n.IP\nExecute command when a wallet transaction changes (%s in cmd is replaced\nby TxID)\n.HP\n\\fB\\-zapwallettxes=\\fR<mode>\n.IP\nDelete all wallet transactions and only recover those parts of the\nblockchain through \\fB\\-rescan\\fR on startup (1 = keep tx meta data e.g.\naccount owner and payment request information, 2 = drop tx meta\ndata)\n.PP\nZeroMQ notification options:\n.HP\n\\fB\\-zmqpubhashblock=\\fR<address>\n.IP\nEnable publish hash block in <address>\n.HP\n\\fB\\-zmqpubhashtx=\\fR<address>\n.IP\nEnable publish hash transaction in <address>\n.HP\n\\fB\\-zmqpubrawblock=\\fR<address>\n.IP\nEnable publish raw block in <address>\n.HP\n\\fB\\-zmqpubrawtx=\\fR<address>\n.IP\nEnable publish raw transaction in <address>\n.PP\nDebugging/Testing options:\n.HP\n\\fB\\-uacomment=\\fR<cmt>\n.IP\nAppend comment to the user agent string\n.HP\n\\fB\\-debug=\\fR<category>\n.IP\nOutput debugging information (default: 0, supplying <category> is\noptional). If <category> is not supplied or if <category> = 1,\noutput all debugging information. <category> can be: net, tor,\nmempool, http, bench, zmq, db, rpc, estimatefee, addrman,\nselectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej,\nlibevent, coindb, qt, leveldb.\n.HP\n\\fB\\-debugexclude=\\fR<category>\n.IP\nExclude debugging information for a category. Can be used in conjunction\nwith \\fB\\-debug\\fR=\\fI\\,1\\/\\fR to output debug logs for all categories except one\nor more specified categories.\n.HP\n\\fB\\-help\\-debug\\fR\n.IP\nShow all debugging options (usage: \\fB\\-\\-help\\fR \\fB\\-help\\-debug\\fR)\n.HP\n\\fB\\-logips\\fR\n.IP\nInclude IP addresses in debug output (default: 0)\n.HP\n\\fB\\-logtimestamps\\fR\n.IP\nPrepend debug output with timestamp (default: 1)\n.HP\n\\fB\\-maxtxfee=\\fR<amt>\n.IP\nMaximum total fees (in SUGAR) to use in a single wallet transaction or\nraw transaction; setting this too low may abort large\ntransactions (default: 0.10)\n.HP\n\\fB\\-printtoconsole\\fR\n.IP\nSend trace/debug info to console instead of debug.log file\n.HP\n\\fB\\-prunedebuglogfile\\fR\n.IP\nPrune (limit) filesize of debug.log\n.HP\n\\fB\\-shrinkdebugfile\\fR\n.IP\nShrink debug.log file on client startup (default: 1 when no \\fB\\-debug\\fR)\n.PP\nChain selection options:\n.HP\n\\fB\\-testnet\\fR\n.IP\nUse the test chain\n.PP\nNode relay options:\n.HP\n\\fB\\-bytespersigop\\fR\n.IP\nEquivalent bytes per sigop in transactions for relay and mining\n(default: 20)\n.HP\n\\fB\\-datacarrier\\fR\n.IP\nRelay and mine data carrier transactions (default: 1)\n.HP\n\\fB\\-datacarriersize\\fR\n.IP\nMaximum size of data in data carrier transactions we relay and mine\n(default: 83)\n.HP\n\\fB\\-mempoolreplacement\\fR\n.IP\nEnable transaction replacement in the memory pool (default: 1)\n.HP\n\\fB\\-minrelaytxfee=\\fR<amt>\n.IP\nFees (in SUGAR/kB) smaller than this are considered zero fee for\nrelaying, mining and transaction creation (default: 0.00001)\n.HP\n\\fB\\-whitelistrelay\\fR\n.IP\nAccept relayed transactions received from whitelisted peers even when\nnot relaying transactions (default: 1)\n.HP\n\\fB\\-whitelistforcerelay\\fR\n.IP\nForce relay of transactions from whitelisted peers even if they violate\nlocal relay policy (default: 1)\n.PP\nBlock creation options:\n.HP\n\\fB\\-blockmaxweight=\\fR<n>\n.IP\nSet maximum BIP141 block weight (default: 3996000)\n.HP\n\\fB\\-blockmintxfee=\\fR<amt>\n.IP\nSet lowest fee rate (in SUGAR/kB) for transactions to be included in\nblock creation. (default: 0.00001)\n.PP\nRPC server options:\n.HP\n\\fB\\-server\\fR\n.IP\nAccept command line and JSON\\-RPC commands\n.HP\n\\fB\\-rest\\fR\n.IP\nAccept public REST requests (default: 0)\n.HP\n\\fB\\-rpcbind=\\fR<addr>[:port]\n.IP\nBind to given address to listen for JSON\\-RPC connections. This option is\nignored unless \\fB\\-rpcallowip\\fR is also passed. Port is optional and\noverrides \\fB\\-rpcport\\fR. Use [host]:port notation for IPv6. This\noption can be specified multiple times (default: 127.0.0.1 and\n::1 i.e., localhost, or if \\fB\\-rpcallowip\\fR has been specified,\n0.0.0.0 and :: i.e., all addresses)\n.HP\n\\fB\\-rpccookiefile=\\fR<loc>\n.IP\nLocation of the auth cookie (default: data dir)\n.HP\n\\fB\\-rpcuser=\\fR<user>\n.IP\nUsername for JSON\\-RPC connections\n.HP\n\\fB\\-rpcpassword=\\fR<pw>\n.IP\nPassword for JSON\\-RPC connections\n.HP\n\\fB\\-rpcauth=\\fR<userpw>\n.IP\nUsername and hashed password for JSON\\-RPC connections. The field\n<userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A\ncanonical python script is included in share/rpcuser. The client\nthen connects normally using the\nrpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This\noption can be specified multiple times\n.HP\n\\fB\\-rpcport=\\fR<port>\n.IP\nListen for JSON\\-RPC connections on <port> (default: 34229 or testnet:\n44229)\n.HP\n\\fB\\-rpcallowip=\\fR<ip>\n.IP\nAllow JSON\\-RPC connections from specified source. Valid for <ip> are a\nsingle IP (e.g. 1.2.3.4), a network/netmask (e.g.\n1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This\noption can be specified multiple times\n.HP\n\\fB\\-rpcserialversion\\fR\n.IP\nSets the serialization of raw transaction or block hex returned in\nnon\\-verbose mode, non\\-segwit(0) or segwit(1) (default: 1)\n.HP\n\\fB\\-rpcthreads=\\fR<n>\n.IP\nSet the number of threads to service RPC calls (default: 4)\n.PP\nUI Options:\n.HP\n\\fB\\-choosedatadir\\fR\n.IP\nChoose data directory on startup (default: 0)\n.HP\n\\fB\\-lang=\\fR<lang>\n.IP\nSet language, for example \"de_DE\" (default: system locale)\n.HP\n\\fB\\-min\\fR\n.IP\nStart minimized\n.HP\n\\fB\\-rootcertificates=\\fR<file>\n.IP\nSet SSL root certificates for payment request (default: \\fB\\-system\\-\\fR)\n.HP\n\\fB\\-splash\\fR\n.IP\nShow splash screen on startup (default: 1)\n.HP\n\\fB\\-resetguisettings\\fR\n.IP\nReset all settings changed in the GUI\n.SH COPYRIGHT\nCopyright (C) 2009-2010 Satoshi Nakamoto\nCopyright (C) 2009-2018 The Bitcoin Core developers\nCopyright (C) 2013-2019 Alexander Peslyak - Yespower 1.0.1\nCopyright (C) 2016-2018 The Zcash developers - DigiShieldZEC\nCopyright (C) 2018-2020 The Sugarchain Yumekawa developers\n\nPlease contribute if you find Sugarchain Yumekawa useful. Visit\n<https://sugarchain.org> for further information about the software.\nThe source code is available from\n<https://github.com/sugarchain-project/sugarchain>.\n\nThis is experimental software.\nDistributed under the MIT software license, see the accompanying file COPYING\nor <https://opensource.org/licenses/MIT>\n\nThis product includes software developed by the OpenSSL Project for use in the\nOpenSSL Toolkit <https://www.openssl.org> and cryptographic software written by\nEric Young and UPnP software written by Thomas Bernard.\n"
  },
  {
    "path": "doc/man/sugarchain-tx.1",
    "content": ".\\\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.8.\n.TH SUGARCHAIN-TX \"1\" \"January 2021\" \"sugarchain-tx v0.16.3.36\" \"User Commands\"\n.SH NAME\nsugarchain-tx \\- manual page for sugarchain-tx v0.16.3.36\n.SH DESCRIPTION\nSugarchain Yumekawa sugarchain\\-tx utility version v0.16.3.36\n.SS \"Usage:\"\n.TP\nsugarchain\\-tx [options] <hex\\-tx> [commands]\nUpdate hex\\-encoded sugarchain transaction\n.TP\nsugarchain\\-tx [options] \\fB\\-create\\fR [commands]\nCreate hex\\-encoded sugarchain transaction\n.SH OPTIONS\n.HP\n\\-?\n.IP\nThis help message\n.HP\n\\fB\\-create\\fR\n.IP\nCreate new, empty TX.\n.HP\n\\fB\\-json\\fR\n.IP\nSelect JSON output\n.HP\n\\fB\\-txid\\fR\n.IP\nOutput only the hex\\-encoded transaction id of the resultant transaction.\n.PP\nChain selection options:\n.HP\n\\fB\\-testnet\\fR\n.IP\nUse the test chain\n.HP\n\\fB\\-regtest\\fR\n.IP\nEnter regression test mode, which uses a special chain in which blocks\ncan be solved instantly. This is intended for regression testing\ntools and app development.\n.PP\nCommands:\n.IP\ndelin=N\n.IP\nDelete input N from TX\n.IP\ndelout=N\n.IP\nDelete output N from TX\n.IP\nin=TXID:VOUT(:SEQUENCE_NUMBER)\n.IP\nAdd input to TX\n.IP\nlocktime=N\n.IP\nSet TX lock time to N\n.IP\nnversion=N\n.IP\nSet TX version to N\n.IP\nreplaceable(=N)\n.IP\nSet RBF opt\\-in sequence number for input N (if not provided, opt\\-in all\navailable inputs)\n.IP\noutaddr=VALUE:ADDRESS\n.IP\nAdd address\\-based output to TX\n.IP\noutpubkey=VALUE:PUBKEY[:FLAGS]\n.IP\nAdd pay\\-to\\-pubkey output to TX. Optionally add the \"W\" flag to produce a\npay\\-to\\-witness\\-pubkey\\-hash output. Optionally add the \"S\" flag to\nwrap the output in a pay\\-to\\-script\\-hash.\n.IP\noutdata=[VALUE:]DATA\n.IP\nAdd data\\-based output to TX\n.IP\noutscript=VALUE:SCRIPT[:FLAGS]\n.IP\nAdd raw script output to TX. Optionally add the \"W\" flag to produce a\npay\\-to\\-witness\\-script\\-hash output. Optionally add the \"S\" flag to\nwrap the output in a pay\\-to\\-script\\-hash.\n.IP\noutmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]\n.IP\nAdd Pay To n\\-of\\-m Multi\\-sig output to TX. n = REQUIRED, m = PUBKEYS.\nOptionally add the \"W\" flag to produce a\npay\\-to\\-witness\\-script\\-hash output. Optionally add the \"S\" flag to\nwrap the output in a pay\\-to\\-script\\-hash.\n.IP\nsign=SIGHASH\\-FLAGS\n.IP\nAdd zero or more signatures to transaction. This command requires JSON\nregisters:prevtxs=JSON object, privatekeys=JSON object. See\nsignrawtransaction docs for format of sighash flags, JSON\nobjects.\n.PP\nRegister Commands:\n.IP\nload=NAME:FILENAME\n.IP\nLoad JSON file FILENAME into register NAME\n.IP\nset=NAME:JSON\\-STRING\n.IP\nSet register NAME to given JSON\\-STRING\n.SH COPYRIGHT\nCopyright (C) 2009-2010 Satoshi Nakamoto\nCopyright (C) 2009-2018 The Bitcoin Core developers\nCopyright (C) 2013-2019 Alexander Peslyak - Yespower 1.0.1\nCopyright (C) 2016-2018 The Zcash developers - DigiShieldZEC\nCopyright (C) 2018-2020 The Sugarchain Yumekawa developers\n\nPlease contribute if you find Sugarchain Yumekawa useful. Visit\n<https://sugarchain.org> for further information about the software.\nThe source code is available from\n<https://github.com/sugarchain-project/sugarchain>.\n\nThis is experimental software.\nDistributed under the MIT software license, see the accompanying file COPYING\nor <https://opensource.org/licenses/MIT>\n\nThis product includes software developed by the OpenSSL Project for use in the\nOpenSSL Toolkit <https://www.openssl.org> and cryptographic software written by\nEric Young and UPnP software written by Thomas Bernard.\n"
  },
  {
    "path": "doc/man/sugarchaind.1",
    "content": ".\\\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.8.\n.TH SUGARCHAIND \"1\" \"January 2021\" \"sugarchaind v0.16.3.36\" \"User Commands\"\n.SH NAME\nsugarchaind \\- manual page for sugarchaind v0.16.3.36\n.SH DESCRIPTION\nSugarchain Yumekawa Daemon version v0.16.3.36\n.SS \"Usage:\"\n.TP\nsugarchaind [options]\nStart Sugarchain Yumekawa Daemon\n.SH OPTIONS\n.HP\n\\-?\n.IP\nPrint this help message and exit\n.HP\n\\fB\\-version\\fR\n.IP\nPrint version and exit\n.HP\n\\fB\\-alertnotify=\\fR<cmd>\n.IP\nExecute command when a relevant alert is received or we see a really\nlong fork (%s in cmd is replaced by message)\n.HP\n\\fB\\-blocknotify=\\fR<cmd>\n.IP\nExecute command when the best block changes (%s in cmd is replaced by\nblock hash)\n.HP\n\\fB\\-assumevalid=\\fR<hex>\n.IP\nIf this block is in the chain assume that it and its ancestors are valid\nand potentially skip their script verification (0 to verify all,\ndefault:\n855f0c66238bc0246c8ca25cf958283fd49b9fb4b217ddeb518e5ea9f5071b9e,\ntestnet:\nbc05c2d5e81785f287cd58a798b64467cff35c8ef2bbe8062d8420eeb86f4056)\n.HP\n\\fB\\-conf=\\fR<file>\n.IP\nSpecify configuration file (default: sugarchain.conf)\n.HP\n\\fB\\-daemon\\fR\n.IP\nRun in the background as a daemon and accept commands\n.HP\n\\fB\\-datadir=\\fR<dir>\n.IP\nSpecify data directory\n.HP\n\\fB\\-dbcache=\\fR<n>\n.IP\nSet database cache size in megabytes (4 to 16384, default: 450)\n.HP\n\\fB\\-loadblock=\\fR<file>\n.IP\nImports blocks from external blk000??.dat file on startup\n.HP\n\\fB\\-debuglogfile=\\fR<file>\n.IP\nSpecify location of debug log file: this can be an absolute path or a\npath relative to the data directory (default: debug.log)\n.HP\n\\fB\\-maxorphantx=\\fR<n>\n.IP\nKeep at most <n> unconnectable transactions in memory (default: 100)\n.HP\n\\fB\\-maxmempool=\\fR<n>\n.IP\nKeep the transaction memory pool below <n> megabytes (default: 300)\n.HP\n\\fB\\-mempoolexpiry=\\fR<n>\n.IP\nDo not keep transactions in the mempool longer than <n> hours (default:\n336)\n.HP\n\\fB\\-persistmempool\\fR\n.IP\nWhether to save the mempool on shutdown and load on restart (default: 1)\n.HP\n\\fB\\-blockreconstructionextratxn=\\fR<n>\n.IP\nExtra transactions to keep in memory for compact block reconstructions\n(default: 100)\n.HP\n\\fB\\-par=\\fR<n>\n.IP\nSet the number of script verification threads (\\fB\\-8\\fR to 16, 0 = auto, <0 =\nleave that many cores free, default: 0)\n.HP\n\\fB\\-pid=\\fR<file>\n.IP\nSpecify pid file (default: sugarchaind.pid)\n.HP\n\\fB\\-prune=\\fR<n>\n.IP\nReduce storage requirements by enabling pruning (deleting) of old\nblocks. This allows the pruneblockchain RPC to be called to\ndelete specific blocks, and enables automatic pruning of old\nblocks if a target size in MiB is provided. This mode is\nincompatible with \\fB\\-txindex\\fR and \\fB\\-rescan\\fR. Warning: Reverting this\nsetting requires re\\-downloading the entire blockchain. (default:\n0 = disable pruning blocks, 1 = allow manual pruning via RPC,\n>=550 = automatically prune block files to stay under the\nspecified target size in MiB)\n.HP\n\\fB\\-reindex\\-chainstate\\fR\n.IP\nRebuild chain state from the currently indexed blocks\n.HP\n\\fB\\-reindex\\fR\n.IP\nRebuild chain state and block index from the blk*.dat files on disk\n.HP\n\\fB\\-sysperms\\fR\n.IP\nCreate new files with system default permissions, instead of umask 077\n(only effective with disabled wallet functionality)\n.HP\n\\fB\\-txindex\\fR\n.IP\nMaintain a full transaction index, used by the getrawtransaction rpc\ncall (default: 0)\n.PP\nConnection options:\n.HP\n\\fB\\-addnode=\\fR<ip>\n.IP\nAdd a node to connect to and attempt to keep the connection open (see\nthe `addnode` RPC command help for more info)\n.HP\n\\fB\\-banscore=\\fR<n>\n.IP\nThreshold for disconnecting misbehaving peers (default: 100)\n.HP\n\\fB\\-bantime=\\fR<n>\n.IP\nNumber of seconds to keep misbehaving peers from reconnecting (default:\n86400)\n.HP\n\\fB\\-bind=\\fR<addr>\n.IP\nBind to given address and always listen on it. Use [host]:port notation\nfor IPv6\n.HP\n\\fB\\-connect=\\fR<ip>\n.IP\nConnect only to the specified node(s); \\fB\\-connect\\fR=\\fI\\,0\\/\\fR disables automatic\nconnections (the rules for this peer are the same as for\n\\fB\\-addnode\\fR)\n.HP\n\\fB\\-discover\\fR\n.IP\nDiscover own IP addresses (default: 1 when listening and no \\fB\\-externalip\\fR\nor \\fB\\-proxy\\fR)\n.HP\n\\fB\\-dns\\fR\n.IP\nAllow DNS lookups for \\fB\\-addnode\\fR, \\fB\\-seednode\\fR and \\fB\\-connect\\fR (default: 1)\n.HP\n\\fB\\-dnsseed\\fR\n.IP\nQuery for peer addresses via DNS lookup, if low on addresses (default: 1\nunless \\fB\\-connect\\fR used)\n.HP\n\\fB\\-externalip=\\fR<ip>\n.IP\nSpecify your own public address\n.HP\n\\fB\\-forcednsseed\\fR\n.IP\nAlways query for peer addresses via DNS lookup (default: 0)\n.HP\n\\fB\\-listen\\fR\n.IP\nAccept connections from outside (default: 1 if no \\fB\\-proxy\\fR or \\fB\\-connect\\fR)\n.HP\n\\fB\\-listenonion\\fR\n.IP\nAutomatically create Tor hidden service (default: 1)\n.HP\n\\fB\\-maxconnections=\\fR<n>\n.IP\nMaintain at most <n> connections to peers (default: 125)\n.HP\n\\fB\\-maxreceivebuffer=\\fR<n>\n.IP\nMaximum per\\-connection receive buffer, <n>*1000 bytes (default: 5000)\n.HP\n\\fB\\-maxsendbuffer=\\fR<n>\n.IP\nMaximum per\\-connection send buffer, <n>*1000 bytes (default: 1000)\n.HP\n\\fB\\-maxtimeadjustment\\fR\n.IP\nMaximum allowed median peer time offset adjustment. Local perspective of\ntime may be influenced by peers forward or backward by this\namount. (default: 70 seconds)\n.HP\n\\fB\\-onion=\\fR<ip:port>\n.IP\nUse separate SOCKS5 proxy to reach peers via Tor hidden services\n(default: \\fB\\-proxy\\fR)\n.HP\n\\fB\\-onlynet=\\fR<net>\n.IP\nOnly connect to nodes in network <net> (ipv4, ipv6 or onion)\n.HP\n\\fB\\-permitbaremultisig\\fR\n.IP\nRelay non\\-P2SH multisig (default: 1)\n.HP\n\\fB\\-peerbloomfilters\\fR\n.IP\nSupport filtering of blocks and transaction with bloom filters (default:\n1)\n.HP\n\\fB\\-port=\\fR<port>\n.IP\nListen for connections on <port> (default: 34230 or testnet: 44230)\n.HP\n\\fB\\-proxy=\\fR<ip:port>\n.IP\nConnect through SOCKS5 proxy\n.HP\n\\fB\\-proxyrandomize\\fR\n.IP\nRandomize credentials for every proxy connection. This enables Tor\nstream isolation (default: 1)\n.HP\n\\fB\\-seednode=\\fR<ip>\n.IP\nConnect to a node to retrieve peer addresses, and disconnect\n.HP\n\\fB\\-timeout=\\fR<n>\n.IP\nSpecify connection timeout in milliseconds (minimum: 1, default: 5000)\n.HP\n\\fB\\-torcontrol=\\fR<ip>:<port>\n.IP\nTor control port to use if onion listening enabled (default:\n127.0.0.1:9051)\n.HP\n\\fB\\-torpassword=\\fR<pass>\n.IP\nTor control port password (default: empty)\n.HP\n\\fB\\-upnp\\fR\n.IP\nUse UPnP to map the listening port (default: 0)\n.HP\n\\fB\\-whitebind=\\fR<addr>\n.IP\nBind to given address and whitelist peers connecting to it. Use\n[host]:port notation for IPv6\n.HP\n\\fB\\-whitelist=\\fR<IP address or network>\n.IP\nWhitelist peers connecting from the given IP address (e.g. 1.2.3.4) or\nCIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple\ntimes. Whitelisted peers cannot be DoS banned and their\ntransactions are always relayed, even if they are already in the\nmempool, useful e.g. for a gateway\n.HP\n\\fB\\-maxuploadtarget=\\fR<n>\n.IP\nTries to keep outbound traffic under the given target (in MiB per 24h),\n0 = no limit (default: 0)\n.PP\nWallet options:\n.HP\n\\fB\\-addresstype\\fR\n.IP\nWhat type of addresses to use (\"legacy\", \"p2sh\\-segwit\", or \"bech32\",\ndefault: \"bech32\")\n.HP\n\\fB\\-changetype\\fR\n.IP\nWhat type of change to use (\"legacy\", \"p2sh\\-segwit\", or \"bech32\").\nDefault is same as \\fB\\-addresstype\\fR, except when\n\\fB\\-addresstype\\fR=\\fI\\,p2sh\\-segwit\\/\\fR a native segwit output is used when\nsending to a native segwit address)\n.HP\n\\fB\\-disablewallet\\fR\n.IP\nDo not load the wallet and disable wallet RPC calls\n.HP\n\\fB\\-keypool=\\fR<n>\n.IP\nSet key pool size to <n> (default: 1000)\n.HP\n\\fB\\-fallbackfee=\\fR<amt>\n.IP\nA fee rate (in SUGAR/kB) that will be used when fee estimation has\ninsufficient data (default: 0.0002)\n.HP\n\\fB\\-discardfee=\\fR<amt>\n.IP\nThe fee rate (in SUGAR/kB) that indicates your tolerance for discarding\nchange by adding it to the fee (default: 0.0001). Note: An output\nis discarded if it is dust at this rate, but we will always\ndiscard up to the dust relay fee and a discard fee above that is\nlimited by the fee estimate for the longest target\n.HP\n\\fB\\-mintxfee=\\fR<amt>\n.IP\nFees (in SUGAR/kB) smaller than this are considered zero fee for\ntransaction creation (default: 0.00001)\n.HP\n\\fB\\-paytxfee=\\fR<amt>\n.IP\nFee (in SUGAR/kB) to add to transactions you send (default: 0.00)\n.HP\n\\fB\\-rescan\\fR\n.IP\nRescan the block chain for missing wallet transactions on startup\n.HP\n\\fB\\-salvagewallet\\fR\n.IP\nAttempt to recover private keys from a corrupt wallet on startup\n.HP\n\\fB\\-spendzeroconfchange\\fR\n.IP\nSpend unconfirmed change when sending transactions (default: 1)\n.HP\n\\fB\\-txconfirmtarget=\\fR<n>\n.IP\nIf paytxfee is not set, include enough fee so transactions begin\nconfirmation on average within n blocks (default: 6)\n.HP\n\\fB\\-walletrbf\\fR\n.IP\nSend transactions with full\\-RBF opt\\-in enabled (RPC only, default: 0)\n.HP\n\\fB\\-upgradewallet\\fR\n.IP\nUpgrade wallet to latest format on startup\n.HP\n\\fB\\-wallet=\\fR<file>\n.IP\nSpecify wallet file (within data directory) (default: wallet.dat)\n.HP\n\\fB\\-walletbroadcast\\fR\n.IP\nMake the wallet broadcast transactions (default: 1)\n.HP\n\\fB\\-walletdir=\\fR<dir>\n.IP\nSpecify directory to hold wallets (default: <datadir>/wallets if it\nexists, otherwise <datadir>)\n.HP\n\\fB\\-walletnotify=\\fR<cmd>\n.IP\nExecute command when a wallet transaction changes (%s in cmd is replaced\nby TxID)\n.HP\n\\fB\\-zapwallettxes=\\fR<mode>\n.IP\nDelete all wallet transactions and only recover those parts of the\nblockchain through \\fB\\-rescan\\fR on startup (1 = keep tx meta data e.g.\naccount owner and payment request information, 2 = drop tx meta\ndata)\n.PP\nZeroMQ notification options:\n.HP\n\\fB\\-zmqpubhashblock=\\fR<address>\n.IP\nEnable publish hash block in <address>\n.HP\n\\fB\\-zmqpubhashtx=\\fR<address>\n.IP\nEnable publish hash transaction in <address>\n.HP\n\\fB\\-zmqpubrawblock=\\fR<address>\n.IP\nEnable publish raw block in <address>\n.HP\n\\fB\\-zmqpubrawtx=\\fR<address>\n.IP\nEnable publish raw transaction in <address>\n.PP\nDebugging/Testing options:\n.HP\n\\fB\\-uacomment=\\fR<cmt>\n.IP\nAppend comment to the user agent string\n.HP\n\\fB\\-debug=\\fR<category>\n.IP\nOutput debugging information (default: 0, supplying <category> is\noptional). If <category> is not supplied or if <category> = 1,\noutput all debugging information. <category> can be: net, tor,\nmempool, http, bench, zmq, db, rpc, estimatefee, addrman,\nselectcoins, reindex, cmpctblock, rand, prune, proxy, mempoolrej,\nlibevent, coindb, qt, leveldb.\n.HP\n\\fB\\-debugexclude=\\fR<category>\n.IP\nExclude debugging information for a category. Can be used in conjunction\nwith \\fB\\-debug\\fR=\\fI\\,1\\/\\fR to output debug logs for all categories except one\nor more specified categories.\n.HP\n\\fB\\-help\\-debug\\fR\n.IP\nShow all debugging options (usage: \\fB\\-\\-help\\fR \\fB\\-help\\-debug\\fR)\n.HP\n\\fB\\-logips\\fR\n.IP\nInclude IP addresses in debug output (default: 0)\n.HP\n\\fB\\-logtimestamps\\fR\n.IP\nPrepend debug output with timestamp (default: 1)\n.HP\n\\fB\\-maxtxfee=\\fR<amt>\n.IP\nMaximum total fees (in SUGAR) to use in a single wallet transaction or\nraw transaction; setting this too low may abort large\ntransactions (default: 0.10)\n.HP\n\\fB\\-printtoconsole\\fR\n.IP\nSend trace/debug info to console instead of debug.log file\n.HP\n\\fB\\-prunedebuglogfile\\fR\n.IP\nPrune (limit) filesize of debug.log\n.HP\n\\fB\\-shrinkdebugfile\\fR\n.IP\nShrink debug.log file on client startup (default: 1 when no \\fB\\-debug\\fR)\n.PP\nChain selection options:\n.HP\n\\fB\\-testnet\\fR\n.IP\nUse the test chain\n.PP\nNode relay options:\n.HP\n\\fB\\-bytespersigop\\fR\n.IP\nEquivalent bytes per sigop in transactions for relay and mining\n(default: 20)\n.HP\n\\fB\\-datacarrier\\fR\n.IP\nRelay and mine data carrier transactions (default: 1)\n.HP\n\\fB\\-datacarriersize\\fR\n.IP\nMaximum size of data in data carrier transactions we relay and mine\n(default: 83)\n.HP\n\\fB\\-mempoolreplacement\\fR\n.IP\nEnable transaction replacement in the memory pool (default: 1)\n.HP\n\\fB\\-minrelaytxfee=\\fR<amt>\n.IP\nFees (in SUGAR/kB) smaller than this are considered zero fee for\nrelaying, mining and transaction creation (default: 0.00001)\n.HP\n\\fB\\-whitelistrelay\\fR\n.IP\nAccept relayed transactions received from whitelisted peers even when\nnot relaying transactions (default: 1)\n.HP\n\\fB\\-whitelistforcerelay\\fR\n.IP\nForce relay of transactions from whitelisted peers even if they violate\nlocal relay policy (default: 1)\n.PP\nBlock creation options:\n.HP\n\\fB\\-blockmaxweight=\\fR<n>\n.IP\nSet maximum BIP141 block weight (default: 3996000)\n.HP\n\\fB\\-blockmintxfee=\\fR<amt>\n.IP\nSet lowest fee rate (in SUGAR/kB) for transactions to be included in\nblock creation. (default: 0.00001)\n.PP\nRPC server options:\n.HP\n\\fB\\-server\\fR\n.IP\nAccept command line and JSON\\-RPC commands\n.HP\n\\fB\\-rest\\fR\n.IP\nAccept public REST requests (default: 0)\n.HP\n\\fB\\-rpcbind=\\fR<addr>[:port]\n.IP\nBind to given address to listen for JSON\\-RPC connections. This option is\nignored unless \\fB\\-rpcallowip\\fR is also passed. Port is optional and\noverrides \\fB\\-rpcport\\fR. Use [host]:port notation for IPv6. This\noption can be specified multiple times (default: 127.0.0.1 and\n::1 i.e., localhost, or if \\fB\\-rpcallowip\\fR has been specified,\n0.0.0.0 and :: i.e., all addresses)\n.HP\n\\fB\\-rpccookiefile=\\fR<loc>\n.IP\nLocation of the auth cookie (default: data dir)\n.HP\n\\fB\\-rpcuser=\\fR<user>\n.IP\nUsername for JSON\\-RPC connections\n.HP\n\\fB\\-rpcpassword=\\fR<pw>\n.IP\nPassword for JSON\\-RPC connections\n.HP\n\\fB\\-rpcauth=\\fR<userpw>\n.IP\nUsername and hashed password for JSON\\-RPC connections. The field\n<userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A\ncanonical python script is included in share/rpcuser. The client\nthen connects normally using the\nrpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This\noption can be specified multiple times\n.HP\n\\fB\\-rpcport=\\fR<port>\n.IP\nListen for JSON\\-RPC connections on <port> (default: 34229 or testnet:\n44229)\n.HP\n\\fB\\-rpcallowip=\\fR<ip>\n.IP\nAllow JSON\\-RPC connections from specified source. Valid for <ip> are a\nsingle IP (e.g. 1.2.3.4), a network/netmask (e.g.\n1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This\noption can be specified multiple times\n.HP\n\\fB\\-rpcserialversion\\fR\n.IP\nSets the serialization of raw transaction or block hex returned in\nnon\\-verbose mode, non\\-segwit(0) or segwit(1) (default: 1)\n.HP\n\\fB\\-rpcthreads=\\fR<n>\n.IP\nSet the number of threads to service RPC calls (default: 4)\n.SH COPYRIGHT\nCopyright (C) 2009-2010 Satoshi Nakamoto\nCopyright (C) 2009-2018 The Bitcoin Core developers\nCopyright (C) 2013-2019 Alexander Peslyak - Yespower 1.0.1\nCopyright (C) 2016-2018 The Zcash developers - DigiShieldZEC\nCopyright (C) 2018-2020 The Sugarchain Yumekawa developers\n\nPlease contribute if you find Sugarchain Yumekawa useful. Visit\n<https://sugarchain.org> for further information about the software.\nThe source code is available from\n<https://github.com/sugarchain-project/sugarchain>.\n\nThis is experimental software.\nDistributed under the MIT software license, see the accompanying file COPYING\nor <https://opensource.org/licenses/MIT>\n\nThis product includes software developed by the OpenSSL Project for use in the\nOpenSSL Toolkit <https://www.openssl.org> and cryptographic software written by\nEric Young and UPnP software written by Thomas Bernard.\n"
  },
  {
    "path": "doc/reduce-traffic.md",
    "content": "Reduce Traffic\n==============\n\nSome node operators need to deal with bandwidth caps imposed by their ISPs.\n\nBy default, bitcoin-core allows up to 125 connections to different peers, 8 of\nwhich are outbound. You can therefore, have at most 117 inbound connections.\n\nThe default settings can result in relatively significant traffic consumption.\n\nWays to reduce traffic:\n\n## 1. Use `-maxuploadtarget=<MiB per day>`\n\nA major component of the traffic is caused by serving historic blocks to other nodes\nduring the initial blocks download phase (syncing up a new node).\nThis option can be specified in MiB per day and is turned off by default.\nThis is *not* a hard limit; only a threshold to minimize the outbound\ntraffic. When the limit is about to be reached, the uploaded data is cut by no\nlonger serving historic blocks (blocks older than one week).\nKeep in mind that new nodes require other nodes that are willing to serve\nhistoric blocks.\n\nWhitelisted peers will never be disconnected, although their traffic counts for\ncalculating the target.\n\n## 2. Disable \"listening\" (`-listen=0`)\n\nDisabling listening will result in fewer nodes connected (remember the maximum of 8\noutbound peers). Fewer nodes will result in less traffic usage as you are relaying\nblocks and transactions to fewer nodes.\n\n## 3. Reduce maximum connections (`-maxconnections=<num>`)\n\nReducing the maximum connected nodes to a minimum could be desirable if traffic\nlimits are tiny. Keep in mind that bitcoin's trustless model works best if you are\nconnected to a handful of nodes.\n"
  },
  {
    "path": "doc/release-notes.md",
    "content": "## Yumekawa v0.16.3.36-payapoya\n- Version: Final Release\n- Date: 2021-01-25\n\n**Changes:**\n- Major Fix:\n  * Add: Log output during initial header sync\n    [#174](https://github.com/sugarchain-project/sugarchain/pull/174)\n  * Add: Mainnet DNSSEED\n    [#167](https://github.com/sugarchain-project/sugarchain/pull/167)\n  * Enhanced chain security\n    [#172](https://github.com/sugarchain-project/sugarchain/pull/172)\n- Minor Fix:\n  * Build documentation\n    [#184](https://github.com/sugarchain-project/sugarchain/pull/184)\n\n**Known Issues**\n- Same as before\n\n**Credits:**\nThanks to everyone who directly contributed to this release\n- decryp2kanon\n- ROZ-MOFUMOFU-ME\n- volbil\n- Nugetzrul3\n- y-chan\n- cryptozeny\n\n**PGP:**\n```\n-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA256\n\ne89bf74cfa41c66ae9489390bfdd1144f87e448728e184be3854bd4294c2f41e  sugarchain-0.16.3.36-payapoya-aarch64-linux-gnu.tar.gz\n61fbc406fa30050132b18ec6b3b001f661f8350c9d34bdab834802fe896a7a2e  sugarchain-0.16.3.36-payapoya-arm-linux-gnueabihf.tar.gz\n5dd0817e1be7fd8efedf5bbd43583850dd6f5bd8324c6fe50783ba4becf2de90  sugarchain-0.16.3.36-payapoya-i686-pc-linux-gnu.tar.gz\n6571fdb35c3bd4aa44a8b6dae15128136257986b16d50cf6f6b091b2528a5f7e  sugarchain-0.16.3.36-payapoya-osx64.tar.gz\n620fa7a5b92fdd3d108ce38a55b505f360dc90d5071186ebd8ecb11e453f6503  sugarchain-0.16.3.36-payapoya-osx-unsigned.dmg\n7a1d56262fc9690d9f25ed292f30a058a14cbe5176b1007de69bdec8a43c78ca  sugarchain-0.16.3.36-payapoya.tar.gz\nb58d56bbafd991de163be0d69286988456a0b9d6a0965e040cb6a615cbc1ae5f  sugarchain-0.16.3.36-payapoya-win32-setup-unsigned.exe\n16d660bba5e8c3f10d42717a05c4df73dc9a91ef3295b77e05a97e7d672ee1e5  sugarchain-0.16.3.36-payapoya-win32.zip\n453fee9d4556de7c03ddb2f67d3b92246852612f9362394711a92e7354a7371f  sugarchain-0.16.3.36-payapoya-win64-setup-unsigned.exe\n30e49a2b410a7e6f9e7d76cf09fd01d756b2f234816f53cf669897917b5b02db  sugarchain-0.16.3.36-payapoya-win64.zip\nb2d0cb2886d1aa5f18a1b52b3a75fab9f1f38c54459c888555f69262cefa82ef  sugarchain-0.16.3.36-payapoya-x86_64-linux-gnu.tar.gz\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1\n\niQIcBAEBCAAGBQJgDcHyAAoJELB664A/uejpki8QAIDbUBGUR8voLCpQRoQkQcUM\ny0cu9dWKawHnRE0mIj6Mie2ZNbsQXXyZbZCWZ6/tb+LdwBMKhci07vEQ8psPM8kt\ntVAjxZ6OspHflOaaS5jjFqI9Pl/GQd4ARsBP2ezMtKXFWW29JVLgHNwtavKos6xF\npeGje9rkt0ERt89XoYHiysA8nQb6p2um1UTfWdntGi7uuliZy9SgDJACgGlj4qLJ\nZh/VZsfX/UyzEy3JIR977hYQjqEn7SWZ1G1rB6/+BE8kxuvXgERQFOK9NaErQISE\nWu64FglSBl/IW8Qa+6HCkHtS2ZbB4YGO+dlqRY1EE2HHL3OqJVnmxcm6/iJemJCk\nh85TtrAjIbDydR4IFxqSoLYTU/bCn+QBR+0+9mAICYVTVDYDW6POlVhYewg6XDjy\nNiACYIj51Y9TVwF9JHWeSLW2wSL/lzO1FvozBflNG/0WFA2K10z2cLn/OSuyFRDw\nZca9KEcmgo0cmJo0v9INPNfmZnUOmeFOpYZHTeLPCzWlgNDD6dv03lV45afeeq5U\n4agUjfG+mQ2+v0laIaL3NIYaJyh6mdOKOAlC5vK7jaXQO+Q/VECxyJSTFCTPnW7V\ns8LUt0ccBgBXRkkLYCRfJdCdBYQm404QO5f36JMDWnaiY3gRDYgpK0RMpMagm7M6\n9n6om+P6BGir9tax4BYc\n=7twE\n-----END PGP SIGNATURE-----\n```\n\n-----\n\n## Yumekawa v0.16.3.34-starboy\n- Version: Final Release\n- Date: 2020-06-07\n\n**Changes:**\n- Major Fix:\n  * Fix: IBD `30%` faster, and `60%` reduced data traffic\n    [#122](https://github.com/sugarchain-project/sugarchain/pull/122)\n  * Add: new option `-prunedebuglogfile`: limit filesize of debug.log\n    [#110](https://github.com/sugarchain-project/sugarchain/pull/110)\n  * Add: when IBD, print blockheader count on debug.log (only sugarchain-qt)\n    [#128](https://github.com/sugarchain-project/sugarchain/pull/128)\n  * Update: checkpoints (mainnet)\n    [#132](https://github.com/sugarchain-project/sugarchain/pull/132)\n  * Fix: IBD optimizing\n    [#135](https://github.com/sugarchain-project/sugarchain/pull/135)\n    [#22 (comment)](https://github.com/sugarchain-project/sugarchain/pull/22#issuecomment-568301895)\n  * Update: seed list\n    [#144](https://github.com/sugarchain-project/sugarchain/pull/144)\n  * Remove: BCLog::POW (-debug=pow)\n    [#142](https://github.com/sugarchain-project/sugarchain/pull/142)\n- Minor Fix:\n  * GUI: display size in `MB` (was GB)\n    [#125](https://github.com/sugarchain-project/sugarchain/pull/125)\n  * Revert: IBD settings back to BTC original\n    [#124](https://github.com/sugarchain-project/sugarchain/pull/124)\n  * Add: bootstrap height at `4421701`\n    [#143](https://github.com/sugarchain-project/sugarchain/pull/143)\n  * Fix: travis pathlib2\n    [#148](https://github.com/sugarchain-project/sugarchain/pull/148)\n\n**Known Issues**\n- Transaction too large:\n  * This is a part of BTC.\n  * It will be fixed in next *Taproot+Schnorr* update.\n- Slow update balance on wallet:\n  * This slow is a part of BTC.\n  * Update total balance *every minute (12 blocks)* interval.\n  * This fix is a (nice) workaround for now. [source](https://github.com/sugarchain-project/sugarchain/commit/72436c90b29844cf507895df053103f9b6840776#diff-2e3836af182cfb375329c3463ffd91f8)\n- Poor performance on ARM CPUs (32/64-Bit):\n  * No ARM optimization for Yespower yet.\n- Poor performance on 32-Bit OS:\n  * No SSE2 optimization for Yespower yet. [source](https://github.com/sugarchain-project/sugarchain/blob/d977987a83aba115d50a9130f0d7914330d1bc75/src/crypto/yespower-1.0.1/yespower-opt.c#L59)\n- Slow startup on low memory machines:\n  * Startup can take up to some hours on 1cpu 1024ram (+swap 3GB) VPS.\n  * Workaround is just increase RAM at least 2 GB.\n- Slow rescanning `wallet.dat`:\n  * If your wallet is too heavy or mining purpose, it may take very long when importing.\n\n**Credits:**\nThanks to everyone who directly contributed to this release\n- decryp2kanon\n- solardiz (original Yespower author)\n- barrystyle\n- volbil\n- Nugetzrul3\n- cryptozeny\n\n**Financial Support:**\nWe give our utmost thanks to the donors. This donation will be used for our future development. See [donations](https://github.com/sugarchain-project/Donations/blob/master/README.md).\n- Rakutens\n\n**PGP:**\n```\n-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA256\n\n7de00a9c41f96e6f124df29848b193f997104927d56aaf8932d03c67c4885633  sugarchain-0.16.3.34-starboy-aarch64-linux-gnu.tar.gz\n26d98deb5da2016777df5cd920c7b74c59bf72690600c0d8b30386d8879a93a4  sugarchain-0.16.3.34-starboy-arm-linux-gnueabihf.tar.gz\nf4fff1c073b9bf8b72e9137a77cb054e438f9e8761572f2bc0e97dee72246fd3  sugarchain-0.16.3.34-starboy-i686-pc-linux-gnu.tar.gz\nb60b2b341f4c017e49d0591b8076310ca5e3a3335279bda2377f186ed7101301  sugarchain-0.16.3.34-starboy-osx64.tar.gz\n02652111bd4173add743d8bb197d688975fa34a13e61720129c5d350ff52f7df  sugarchain-0.16.3.34-starboy-osx-unsigned.dmg\nf9dd0b1d05643909b13ba23592030521f5f7ea9d71f49b4e26ca24390f833b0e  sugarchain-0.16.3.34-starboy.tar.gz\n3566064845779cacf7fbce491b5a85b788bcb9574b217cbdf4b75f7cc2a1b94d  sugarchain-0.16.3.34-starboy-win32-setup-unsigned.exe\nd9b76c537648849e725b994e8a9bbf6743f81dcc54c322d4f0b3a632b66a6571  sugarchain-0.16.3.34-starboy-win32.zip\n78bf478722b4c822359c6eca66bfbe5f7397d63025e8b16d10070404ea1e1888  sugarchain-0.16.3.34-starboy-win64-setup-unsigned.exe\ndebb7652010021f49d1ad5b58060d7896cbd78ab5180d79a50189be26eb339ac  sugarchain-0.16.3.34-starboy-win64.zip\n4a79d2bb85c306fa37b57ab5790931103e4311b7dc8edeca4c86c3ec26590b62  sugarchain-0.16.3.34-starboy-x86_64-linux-gnu.tar.gz\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1\n\niQIcBAEBCAAGBQJe3CZVAAoJELB664A/uejpa8AP/iqFsypVOhqJ79+St2Vzoqlj\nVPBExELtoOr/BCt+GmBu9upmbowt0UU7JHiu/Mupf3Q1Uz3MJ9p/bQuVLWWugIGO\n+iOnYOOvCmI8DqN0HT8u/RhcdNVFFkV17+Ef/Fcvn3/k7JIvsvCNPivISYoMI/Ay\nhtuz7E7cDZvZ9PUfPDVwsQatl8m6NbNFTjcvTPsAIiiab+MEbkPHdzXF3BRbv2P7\noSduqlA8ty9T7YXiYlTE98gE3dMxh+gIWzCRqnhJtlLyrgv/sp4JY5aup0Gi7fth\n/NZITffXlJdakzzoUoSy563+MTQlWAIyh3GM5QOwHtoaijCAGYGhcTWvwqdGok6a\nFLCCO5he79hpprmIccJYtIMYubqf36Jm6uNxcyroTqFUAbTOnDjNQ9myKulnK1pb\n9XpYeitmpy/OB/Fks0YAOBQY/ybtluhoOMLUjRQjwjTo5bTThMKLG5olDr0jI3L7\nLA5P/mt+FsQ/NvUPd11rEZNeqKHhCTuU0sMyt6WWLb4xw12cNEv3rCail7LKRxBE\n82ZseXC0AbiQJ0cuKLZs3vGU+lA16kB1MEnARIiajh+xp4moNM+yz/YbYO/ViH/V\nlDc9GH/AxzF2WvhJxlVlKNBpWZK64yQAy0bi9lULoQK2sTSnWbasu02GnXDc+YtF\nNje4ppnRwR3nbnb6e95Q\n=S/DR\n-----END PGP SIGNATURE-----\n```\n\n-----\n\n## Yumekawa v0.16.3.30-moonlight\n- Version: Final Release\n- Date: 2020-03-02\n\n**Changes:**\n- Major Fix:\n  * add: Yespower cached PoW\n    [#22](https://github.com/sugarchain-project/sugarchain/pull/22)\n  * fix: enhanced Yespower cached PoW\n    [#61](https://github.com/sugarchain-project/sugarchain/pull/61)\n    [#69](https://github.com/sugarchain-project/sugarchain/pull/69)\n  * review: solardiz (original Yespower author) confirmed\n    [1](https://github.com/sugarchain-project/sugarchain/pull/22#issuecomment-568301895)\n    [2](https://github.com/sugarchain-project/sugarchain/pull/22#issuecomment-568306963)\n    [3](https://github.com/sugarchain-project/sugarchain/pull/22#issuecomment-568505605)\n    [4](https://github.com/sugarchain-project/sugarchain/issues/31#issuecomment-583833642)\n    [5](https://github.com/sugarchain-project/sugarchain/issues/32#issuecomment-568302174)\n  * fix: IBD: do not disconnect *whitelisted* peers during IBD\n    [#80](https://github.com/sugarchain-project/sugarchain/pull/80)\n  * remove: IBD: disable additional download during IBD, due to too much traffic\n    [#78](https://github.com/sugarchain-project/sugarchain/pull/78)\n  * add: chainwork, assumevalid, txdata, checkpoint and seeds\n    [#50](https://github.com/sugarchain-project/sugarchain/pull/50)\n    [#52](https://github.com/sugarchain-project/sugarchain/pull/52)\n- Minor Fix:\n  * fix: IBD: do not print this connection log during IBD\n    [#78](https://github.com/sugarchain-project/sugarchain/pull/78)\n  * add: bootstrap block height at 2601001\n    [#49](https://github.com/sugarchain-project/sugarchain/pull/49)\n  * add: kanon PGP\n    [#48](https://github.com/sugarchain-project/sugarchain/pull/48)\n  * fix: copyright\n    [#75](https://github.com/sugarchain-project/sugarchain/pull/75)\n    [#90](https://github.com/sugarchain-project/sugarchain/pull/90)\n    [#96](https://github.com/sugarchain-project/sugarchain/pull/96)\n  * fix: makeseeds.py version\n    [#89](https://github.com/sugarchain-project/sugarchain/pull/89)\n  * cleanup:\n    [#60](https://github.com/sugarchain-project/sugarchain/pull/60)\n    [#66](https://github.com/sugarchain-project/sugarchain/pull/66)\n    [#84](https://github.com/sugarchain-project/sugarchain/pull/84)\n    [#85](https://github.com/sugarchain-project/sugarchain/pull/85)\n    [#92](https://github.com/sugarchain-project/sugarchain/pull/92)\n\n**Known Issues**\n- Same as before\n\n**Credits:**\nThanks to everyone who directly contributed to this release\n- solardiz (original Yespower author)\n- volbil\n- okoto-xyz\n- decryp2kanon\n- cryptozeny\n\n**Financial Support:**\nWe give our utmost thanks to the donors. This donation will be used for our future development. See [donations](https://github.com/sugarchain-project/Donations/blob/master/README.md).\n\n- 唐伯虎\n- Rakutens\n- [happysensor.xyz](http://happysensor.xyz/)\n\n**PGP:**\n```\n-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA256\n\n6898bfa3b6f0fbaeb3a62e66ed55d7e906f884552a4c1fefad5c286c58e059d8  sugarchain-0.16.3.30-moonlight-aarch64-linux-gnu.tar.gz\n3106dda1444b4b3a12612b9691504e873d275c89558b34762551e0c731e8cc8c  sugarchain-0.16.3.30-moonlight-arm-linux-gnueabihf.tar.gz\ndbbba96b58d11181816eadbf8a7652c769da21769d36a799a0c8533440a66e30  sugarchain-0.16.3.30-moonlight-i686-pc-linux-gnu.tar.gz\n91a2d38c9beca3dabecfd1319a830ccd4a75c46f2b15d726d56e71a17efdf66e  sugarchain-0.16.3.30-moonlight-osx64.tar.gz\nd9783a54f53741e0826f3c66f9c5b4d968f662b1216d5b2dc5ca8d343c223cf1  sugarchain-0.16.3.30-moonlight-osx-unsigned.dmg\n91335f484a9f49dce114898edb1ab91bfeb9d9a7eb9eb5478f42624eb3890089  sugarchain-0.16.3.30-moonlight.tar.gz\n94d64b0fca87019140080723f6cc2069c306e89caa00910c9361f6129c33932b  sugarchain-0.16.3.30-moonlight-win32-setup-unsigned.exe\n969183f4928908468ff92a615d27643e95b66aef65dff56ec0bf0dea157f5b45  sugarchain-0.16.3.30-moonlight-win32.zip\n9e86291ee4a2f7cf2db2f07dd0c93b81a6cad30b7d4689a2a605a21e4dd05a13  sugarchain-0.16.3.30-moonlight-win64-setup-unsigned.exe\n141387def60d1c29cf78f75c61a704f406277e0a7b69a9d356843be1c1a751cf  sugarchain-0.16.3.30-moonlight-win64.zip\n20ca6c6e5fd395cd3ff0cc41601eaa156ee43ae92e44cc0b6eaea8b3cbf09b06  sugarchain-0.16.3.30-moonlight-x86_64-linux-gnu.tar.gz\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1\n\niQIcBAEBCAAGBQJeXMrUAAoJELB664A/uejp7r4P/iPk2C3HzKdLZhIWbGkhlsaD\ncURDAD7Wa5ccq4UoDNVHBCTTye0cqDWCccxp7PzTv+F8nctUXtcU8StcTx0NySwZ\n5fXQ8OP4x+QqFBBuYRld9y1Hhzns9ORK+sslJEgC4GlY6pQcTQso57xg6vPPAcUn\nnmJByUfDOuf9NcoV9fjMVHxZIBFkWeDLkeJGxN3FLSc+bxx6NkU94zDWS2J1jX1+\nDqVB+JmvJa8SY2VUC5jxheRmY1/npHLvQw6eDkox6sbUVpZR1+m9pVzM2MImz0Mb\nI8Uto7fwjCLEbIufoX/iCBmB8hOq1QM2mf5L18mypeifjb8LlMFr8uho2b4St2aU\nsuRYKUlHw4tnX+qYtkvaFR4Al5uEfvilIsdv8fBkk3pgxsdWgvNyxDL7BoHd3eHp\nY1aDOPOIMo7qh48w1vnRVFE6iXC9WLd0L408Gb+Z+py9dG0mP04I+8NYvn9VLiCu\nt6KPcTdkgXclT2JvEjz1GZMcil68RtJ2P+Cw4dlY4HAOl0/nuAHoTSLvMxnfYnl0\nCj2v4nq2s3huun/Ez+CNOHRLEsA+YIRb+Y+HiIV4WQTAFXakerWOEWAsdCIdKBFp\n7ULjTg4cR2u+4D7g7rVgE9r0Oe53TV9kal/BF5JGzRwW/gpnT/30WXRzt110nnkK\nvmysL9NojJ1rXA9E/mGc\n=gDHB\n-----END PGP SIGNATURE-----\n```\n\n-----\n\n## Yumekawa v0.16.3.24-bloomy\n- Version: Final Release\n- Date: 2019-11-10\n\n**Changes:**\n- Major Fix:\n  * fix: Timeout downloading block\n  * revert: download window back to `1024` (was 1024*120=122880)\n  * add: checkpointData, chainTxData\n  * add: seed list from dnsseed\n  * fix: boost warnings on OSX by @volbil\n  * fix: gitian github URL to official repo\n- Minor Fix:\n  * review: README.md by @Nugetzrul3\n  * rename: Sugarchain Yumekawa developers\n  * create: benchmark sh and result\n  * add: translation: Korean, Japanese, Chinese(zh_CH)\n  * add: bootstrap linearize at height `650000`, `1043000`\n  * fix: comment error (#6)\n\n**Known Issues**\n- Transaction too large:\n  * This is a part of BTC.\n  * It will be fixed in next *Schnorr Signature* update.\n- Slow update balance on wallet:\n  * Update total balance *every minute (12 blocks)* interval.\n  * This slow is a part of BTC.\n  * This fix is a (nice) workaround for now. [source](https://github.com/sugarchain-project/sugarchain/commit/72436c90b29844cf507895df053103f9b6840776#diff-2e3836af182cfb375329c3463ffd91f8)\n- Poor performance on ARM CPUs (32/64-Bit):\n  * ARM optimization for Yespower disabled for now.\n- Poor performance on 32-Bit OS:\n  * SSE2 for Yespower disabled for now. [source](https://github.com/sugarchain-project/sugarchain/blob/d977987a83aba115d50a9130f0d7914330d1bc75/src/crypto/yespower-1.0.1/yespower-opt.c#L59)\n  * Please use *64-bit* for best performance.\n\n**Credits:**\nThanks to everyone who directly contributed to this release (alphabetical order)\n- AestheticSenpai\n- cryptozeny\n- ilmango-doge\n- joeland1\n- nao20010128nao\n- Nugetzrul3\n- okoto-xyz\n- RicK~Z\n- solardiz\n- volbil\n- y-chan\n- zawy12\n\n**PGP:**\n```\n-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA256\n\n044e41405be4d8b276a7df8d1b7ef8f68d2e22089a41e54689a6112692d85652  sugarchain-0.16.3.24-bloomy-aarch64-linux-gnu.tar.gz\ncc53f4e768b2b7086640b75be916374b48cb158bd3a248b7c7b219416c97fda5  sugarchain-0.16.3.24-bloomy-arm-linux-gnueabihf.tar.gz\n69678ebfd54b76c1754ad622d902c1e7ac83fc0abc1cbeb2cc2c617e96a293b3  sugarchain-0.16.3.24-bloomy-i686-pc-linux-gnu.tar.gz\n94db81d05ca130fcaecc9ee1c27e0781e4d97eafe7dcea3ab57c430e44d77eef  sugarchain-0.16.3.24-bloomy-osx64.tar.gz\n951cdf79b3c68fcfe0bb07d16ff380413b9a57ed0399258f7ea0910593208378  sugarchain-0.16.3.24-bloomy-osx-unsigned.dmg\n7891337c22ca526345076e7873211f1a9e54dd54deff1363d309f9224d710518  sugarchain-0.16.3.24-bloomy.tar.gz\n2b4ffbe4a8226ffe1fc011582e5e3db3d91ef43aec0b27eb736f45dfd17946e1  sugarchain-0.16.3.24-bloomy-win32-setup-unsigned.exe\nfdd1384db27e7174e237b23f904421697b6567501c22719384e8e725baa91de6  sugarchain-0.16.3.24-bloomy-win32.zip\nb92b58c5c0ba939c1e354d5b7d8130771505a5b77d9b0fe01da6d25c78eaacc2  sugarchain-0.16.3.24-bloomy-win64-setup-unsigned.exe\n59c6789b365aec5fde61bd81326aeb0297fcb7b608aea3cad5d754237edb4f88  sugarchain-0.16.3.24-bloomy-win64.zip\ne972db66eb0e373469dbdb526fefd4e77006ef696adf565974b66c4f81c05e86  sugarchain-0.16.3.24-bloomy-x86_64-linux-gnu.tar.gz\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1\n\niQIcBAEBCAAGBQJdx6nmAAoJELndveKqrcQhGQEP/0GJ/YUlcgSMILklcXylzoxx\nZn48oiZ5/caLByv49Xuiv+jA+ieut+fuI0foiOiF60TnE4TCLddhyFfnDUPlhlZl\nwZu3iHRXu8MHimRKMkGPqPnwUDWOhHPJKpKiDnrGzDirMz+tQHFH3olXHs+Mcs9Z\nSMpTwfkrKYKIx7KFSBl1xCu3MlOR0fGAGuKalGtdRSgu2JQTtDIJrdEs5hdyV3If\nDLOlqWUfpRPy6Bnr5kArDpU0zyJB7xrfYEpP4n4D5yNQsb7Of/QZuhYbeTLLLWEz\n66tHICrVDU+nIuURRyhjzt1+oZs9pE3FXsNpS3z0b9KBT8iQczIbHV/qNUuBQrpm\nSeOLijOM5k79sQ1E25ixR6V/CJ/Kv+zgD+Lz7Ca1LCvoiz320X3EI3Hr02zN1UF/\n7eaTwogPNo+foIgiih8ylnOZL+cyIm53DQZNBuMmtPt5u0n4hIjPU6MFRMTjf0dP\nl299lSS3dO0gxpY+clEm/L1oz+inVGaD5/hmJy/NO8W86O6Z+axLUaBXV0WNxd+e\nFIhVsxra7TIRxWo9cbp1x8FBdlmf3FOYnbgawjBAxrcWw+N+Vrsx4m6/KU6QaP8D\nxYL5ZZjz9+fm+LEUdw07IBaKpdfYSVLjlMBi4pLXoo2b5On3Pt70B02QIpH5QpCc\n/tYDKGg802p4+GsNmZ8A\n=geDz\n-----END PGP SIGNATURE-----\n```\n\n-----\n\n## Yumekawa v0.16.3.21rc1\n- Version: The First Release\n- Date: 2019-08-24\n\nMainnet Launching: `2019/08/24 15:00 UTC`\nhttps://bitcointalk.org/index.php?topic=5177722.0\n\n**Changes:**\n- Block time: `5` seconds\n- Difficulty: [SugarShield-N510](https://github.com/sugarchain-project/sugarchain/blob/master-v0.16.3/src/pow.cpp)\n- Block reward: 42.94967296 COIN `pow(2,32)/1E+08`\n- Halving interval: 12500000 Blocks `pow(5,8)*32` [source](https://github.com/sugarchain-project/sugarchain/blob/32c7d945cda04374f1abbcb8e9787704e7171d4e/src/validation.cpp#L1168-L1211)\n- Total supply: 1073741824 COIN `pow(2,30)` [source](https://github.com/sugarchain-project/yumekawa-utils)\n- PoW algorithm: YespowerSugar\n  * Settings\n  ```cpp\n  yespower_params_t yespower_1_0_sugarchain = {\n    .version = YESPOWER_1_0,\n    .N = 2048,\n    .r = 32,\n    .pers = (const uint8_t *)\"Satoshi Nakamoto 31/Oct/2008 Proof-of-work is essentially one-CPU-one-vote\",\n    .perslen = 74\n  };\n  ```\n- Genesis:\n  * Timestamp [link](https://www.thetimes.co.uk/article/facebook-s-libra-knocks-bitcoin-b3zvn67k0)\n  ```cpp\n  \"The Times 17/July/2019 Bitcoin falls after senators call Facebook delusional over libra\"\n  ```\n  * Genesis block\n  ```cpp\n  genesis = CreateGenesisBlock(1565881200, 247, 0x1f3fffff, 1, 42.94967296 * COIN);\n  ```\n- Port: Main `34230/34229`, Testnet 44230/44229, Regtest 45340/45339\n  * Meaning: 34230 is the molar mass of a sugar [link](https://twitter.com/cryptozeny/status/1130167161475911682)\n- DEFAULT_MAX_TIME_ADJUSTMENT `70` (was 4200)\n- MAX_FUTURE_BLOCK_TIME `60` (was 7200)\n- QT delayed refresh balance [source](https://github.com/sugarchain-project/sugarchain/commit/72436c90b29844cf507895df053103f9b6840776#diff-2e3836af182cfb375329c3463ffd91f8)\n\n**Credits:**\nThanks to everyone who directly contributed to this release (alphabetical order)\n- cryptozeny\n- ilmango-doge\n- okoto-xyz\n- solardiz\n- volbil\n- zawy12\n\n**PGP:**\n```\n-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA256\n\n61ad7bbf3b6d5fe6a5b15b86be45539aa0f8c571e120f896f4c9110f80ecebb5  sugarchain-0.16.3.21rc1-aarch64-linux-gnu.tar.gz\n8d9b2e4ad2917f818619a4922a9337b499cbc52dd2ab814213ad3cf3027887de  sugarchain-0.16.3.21rc1-arm-linux-gnueabihf.tar.gz\nd390539304ce4029551e028b1101e610e8629dc382a3104f0c462aa22c158043  sugarchain-0.16.3.21rc1-i686-pc-linux-gnu.tar.gz\nea651fb1b26424659fbc2423dc03654b0c60f3e4151fa9241c6dbc6dc958d304  sugarchain-0.16.3.21rc1-osx64.tar.gz\n08bdb5e00f62b6b9d39fd3439d35549b9a07eeed0704ce5abc8502d805f58647  sugarchain-0.16.3.21rc1-osx-unsigned.dmg\n782a0cd3241b25f461009004bda17b1558b5d7e39913a671e2480f46f7a85db4  sugarchain-0.16.3.21rc1.tar.gz\n2b641f0c6871b7ef2aed68c8746da0b0e4a0cb0e675ad0004b1071fe6331f17f  sugarchain-0.16.3.21rc1-win32-setup-unsigned.exe\nd95577ece9f83841cff040d200792a40146bf0f00d287bf3943e70b6180a262f  sugarchain-0.16.3.21rc1-win32.zip\na97de97c75b25f0d2bb20ca3e685406e2ed0c41989a069c5a99390bd0d05b09f  sugarchain-0.16.3.21rc1-win64-setup-unsigned.exe\nbfa4d47bf4044274af15bcf202f238cbd5029b088aa09ac69520c20b98763e46  sugarchain-0.16.3.21rc1-win64.zip\nfd676441889bcfff2b26f94945c777bb1cd1f7338c25316f79d21dd9431ee556  sugarchain-0.16.3.21rc1-x86_64-linux-gnu.tar.gz\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1\n\niQIcBAEBCAAGBQJdXyT2AAoJELndveKqrcQhtG0QAINxBFHNCL5Fi8c4yWSG03LK\n0ZjkGyKCh/k+C5TSOreJLNAmrnKGT6gibc/djlXFEAq9ZcxXi+HKTYbKmRM8Uqtq\nvbTyaN2l3O9gY4usQReOgIxfbxdIu49VkUojeW1nzf0XD4UnptTspbPG4ugl3ELg\nGcJ1v1EVnHhyW5nERsNmn67XPClF4OJ+2qNDY57c1CeUiaIqINB2kQ0MF8QSFyOp\nAolkCTs04k+5g6PXA1V9u9jLoJ+b9OSqOc9lYyg0eTG7JcjUAHWGuAmEuN6DOFu5\nh14JnDs1oy6kKc9FczoCaMf5xmityXWhX+Xk67kZDPgmRLYc+CnNd5g4PocKwHm9\nMGwZPrTnD476sZ91xwM1N38VSmDKZS0dNVg2UFoE5gLE7jgACyMlBCNGGp9yoorw\noZkGNjeVd2pUcCbKmaifvE7hicvUHBC5aFo5PLoMAtCJNXMiVjd86lLqpqC2Mq4X\naGXpUTg6Dsmi+5/AfBH0+O02HTgDszQdVLiXmW/LjbOLn12KadyhCks5shS/zApW\nx2afUNP1+5nz2g8I5s5tCycHxyzRYEq9j0wiSbfxAdEJB9oYO7gD0BAN5muWAGDc\nzIiTBrgd4ezB5CO+oKom5vLMs2Jzw186jgsxZnZtolDNYYnSs04Y7i/1uQy0FFbx\nKXKegrTDAuPrWuoAMhxe\n=nPUF\n-----END PGP SIGNATURE-----\n```\n"
  },
  {
    "path": "doc/release-process.md",
    "content": "Release Process\n====================\n\nBefore every release candidate:\n\n* Update translations (ping wumpus on IRC) see [translation_process.md](https://github.com/bitcoin/bitcoin/blob/master/doc/translation_process.md#synchronising-translations).\n\n* Update manpages, see [gen-manpages.sh](https://github.com/bitcoin/bitcoin/blob/master/contrib/devtools/README.md#gen-manpagessh).\n\nBefore every minor and major release:\n\n* Update [bips.md](bips.md) to account for changes since the last release.\n* Update version in `configure.ac` (don't forget to set `CLIENT_VERSION_IS_RELEASE` to `true`)\n* Write release notes (see below)\n* Update `src/chainparams.cpp` nMinimumChainWork with information from the getblockchaininfo rpc.\n* Update `src/chainparams.cpp` defaultAssumeValid  with information from the getblockhash rpc.\n  - The selected value must not be orphaned so it may be useful to set the value two blocks back from the tip.\n  - Testnet should be set some tens of thousands back from the tip due to reorgs there.\n  - This update should be reviewed with a reindex-chainstate with assumevalid=0 to catch any defect\n     that causes rejection of blocks in the past history.\n\nBefore every major release:\n\n* Update hardcoded [seeds](/contrib/seeds/README.md), see [this pull request](https://github.com/bitcoin/bitcoin/pull/7415) for an example.\n* Update [`BLOCK_CHAIN_SIZE`](/src/qt/intro.cpp) to the current size plus some overhead.\n* Update `src/chainparams.cpp` chainTxData with statistics about the transaction count and rate.\n* Update version of `contrib/gitian-descriptors/*.yml`: usually one'd want to do this on master after branching off the release - but be sure to at least do it before a new major release\n\n### First time / New builders\n\nIf you're using the automated script (found in [contrib/gitian-build.sh](/contrib/gitian-build.sh)), then at this point you should run it with the \"--setup\" command. Otherwise ignore this.\n\nCheck out the source code in the following directory hierarchy.\n\n    cd /path/to/your/toplevel/build\n    git clone https://github.com/bitcoin-core/gitian.sigs.git\n    git clone https://github.com/bitcoin-core/bitcoin-detached-sigs.git\n    git clone https://github.com/devrandom/gitian-builder.git\n    git clone https://github.com/bitcoin/bitcoin.git\n\n### Bitcoin maintainers/release engineers, suggestion for writing release notes\n\nWrite release notes. git shortlog helps a lot, for example:\n\n    git shortlog --no-merges v(current version, e.g. 0.7.2)..v(new version, e.g. 0.8.0)\n\n(or ping @wumpus on IRC, he has specific tooling to generate the list of merged pulls\nand sort them into categories based on labels)\n\nGenerate list of authors:\n\n    git log --format='%aN' \"$*\" | sort -ui | sed -e 's/^/- /'\n\nTag version (or release candidate) in git\n\n    git tag -s v(new version, e.g. 0.8.0)\n\n### Setup and perform Gitian builds\n\nIf you're using the automated script (found in [contrib/gitian-build.sh](/contrib/gitian-build.sh)), then at this point you should run it with the \"--build\" command. Otherwise ignore this.\n\nSetup Gitian descriptors:\n\n    pushd ./bitcoin\n    export SIGNER=(your Gitian key, ie bluematt, sipa, etc)\n    export VERSION=(new version, e.g. 0.8.0)\n    git fetch\n    git checkout v${VERSION}\n    popd\n\nEnsure your gitian.sigs are up-to-date if you wish to gverify your builds against other Gitian signatures.\n\n    pushd ./gitian.sigs\n    git pull\n    popd\n\nEnsure gitian-builder is up-to-date:\n\n    pushd ./gitian-builder\n    git pull\n    popd\n\n### Fetch and create inputs: (first time, or when dependency versions change)\n\n    pushd ./gitian-builder\n    mkdir -p inputs\n    wget -P inputs https://bitcoincore.org/cfields/osslsigncode-Backports-to-1.7.1.patch\n    wget -P inputs http://downloads.sourceforge.net/project/osslsigncode/osslsigncode/osslsigncode-1.7.1.tar.gz\n    popd\n\nCreate the OS X SDK tarball, see the [OS X readme](README_osx.md) for details, and copy it into the inputs directory.\n\n### Optional: Seed the Gitian sources cache and offline git repositories\n\nBy default, Gitian will fetch source files as needed. To cache them ahead of time:\n\n    pushd ./gitian-builder\n    make -C ../bitcoin/depends download SOURCES_PATH=`pwd`/cache/common\n    popd\n\nOnly missing files will be fetched, so this is safe to re-run for each build.\n\nNOTE: Offline builds must use the --url flag to ensure Gitian fetches only from local URLs. For example:\n\n    pushd ./gitian-builder\n    ./bin/gbuild --url bitcoin=/path/to/bitcoin,signature=/path/to/sigs {rest of arguments}\n    popd\n\nThe gbuild invocations below <b>DO NOT DO THIS</b> by default.\n\n### Build and sign Bitcoin Core for Linux, Windows, and OS X:\n\n    pushd ./gitian-builder\n    ./bin/gbuild --num-make 2 --memory 3000 --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml\n    ./bin/gsign --signer $SIGNER --release ${VERSION}-linux --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml\n    mv build/out/bitcoin-*.tar.gz build/out/src/bitcoin-*.tar.gz ../\n\n    ./bin/gbuild --num-make 2 --memory 3000 --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-win.yml\n    ./bin/gsign --signer $SIGNER --release ${VERSION}-win-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win.yml\n    mv build/out/bitcoin-*-win-unsigned.tar.gz inputs/bitcoin-win-unsigned.tar.gz\n    mv build/out/bitcoin-*.zip build/out/bitcoin-*.exe ../\n\n    ./bin/gbuild --num-make 2 --memory 3000 --commit bitcoin=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml\n    ./bin/gsign --signer $SIGNER --release ${VERSION}-osx-unsigned --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml\n    mv build/out/bitcoin-*-osx-unsigned.tar.gz inputs/bitcoin-osx-unsigned.tar.gz\n    mv build/out/bitcoin-*.tar.gz build/out/bitcoin-*.dmg ../\n    popd\n\nBuild output expected:\n\n  1. source tarball (`bitcoin-${VERSION}.tar.gz`)\n  2. linux 32-bit and 64-bit dist tarballs (`bitcoin-${VERSION}-linux[32|64].tar.gz`)\n  3. windows 32-bit and 64-bit unsigned installers and dist zips (`bitcoin-${VERSION}-win[32|64]-setup-unsigned.exe`, `bitcoin-${VERSION}-win[32|64].zip`)\n  4. OS X unsigned installer and dist tarball (`bitcoin-${VERSION}-osx-unsigned.dmg`, `bitcoin-${VERSION}-osx64.tar.gz`)\n  5. Gitian signatures (in `gitian.sigs/${VERSION}-<linux|{win,osx}-unsigned>/(your Gitian key)/`)\n\n### Verify other gitian builders signatures to your own. (Optional)\n\nAdd other gitian builders keys to your gpg keyring, and/or refresh keys.\n\n    gpg --import bitcoin/contrib/gitian-keys/*.pgp\n    gpg --refresh-keys\n\nVerify the signatures\n\n    pushd ./gitian-builder\n    ./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-linux ../bitcoin/contrib/gitian-descriptors/gitian-linux.yml\n    ./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-win-unsigned ../bitcoin/contrib/gitian-descriptors/gitian-win.yml\n    ./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-osx-unsigned ../bitcoin/contrib/gitian-descriptors/gitian-osx.yml\n    popd\n\n### Next steps:\n\nCommit your signature to gitian.sigs:\n\n    pushd gitian.sigs\n    git add ${VERSION}-linux/${SIGNER}\n    git add ${VERSION}-win-unsigned/${SIGNER}\n    git add ${VERSION}-osx-unsigned/${SIGNER}\n    git commit -a\n    git push  # Assuming you can push to the gitian.sigs tree\n    popd\n\nCodesigner only: Create Windows/OS X detached signatures:\n- Only one person handles codesigning. Everyone else should skip to the next step.\n- Only once the Windows/OS X builds each have 3 matching signatures may they be signed with their respective release keys.\n\nCodesigner only: Sign the osx binary:\n\n    transfer bitcoin-osx-unsigned.tar.gz to osx for signing\n    tar xf bitcoin-osx-unsigned.tar.gz\n    ./detached-sig-create.sh -s \"Key ID\"\n    Enter the keychain password and authorize the signature\n    Move signature-osx.tar.gz back to the gitian host\n\nCodesigner only: Sign the windows binaries:\n\n    tar xf bitcoin-win-unsigned.tar.gz\n    ./detached-sig-create.sh -key /path/to/codesign.key\n    Enter the passphrase for the key when prompted\n    signature-win.tar.gz will be created\n\nCodesigner only: Commit the detached codesign payloads:\n\n    cd ~/bitcoin-detached-sigs\n    checkout the appropriate branch for this release series\n    rm -rf *\n    tar xf signature-osx.tar.gz\n    tar xf signature-win.tar.gz\n    git add -a\n    git commit -m \"point to ${VERSION}\"\n    git tag -s v${VERSION} HEAD\n    git push the current branch and new tag\n\nNon-codesigners: wait for Windows/OS X detached signatures:\n\n- Once the Windows/OS X builds each have 3 matching signatures, they will be signed with their respective release keys.\n- Detached signatures will then be committed to the [bitcoin-detached-sigs](https://github.com/bitcoin-core/bitcoin-detached-sigs) repository, which can be combined with the unsigned apps to create signed binaries.\n\nCreate (and optionally verify) the signed OS X binary:\n\n    pushd ./gitian-builder\n    ./bin/gbuild -i --commit signature=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-osx-signer.yml\n    ./bin/gsign --signer $SIGNER --release ${VERSION}-osx-signed --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-osx-signer.yml\n    ./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-osx-signed ../bitcoin/contrib/gitian-descriptors/gitian-osx-signer.yml\n    mv build/out/bitcoin-osx-signed.dmg ../bitcoin-${VERSION}-osx.dmg\n    popd\n\nCreate (and optionally verify) the signed Windows binaries:\n\n    pushd ./gitian-builder\n    ./bin/gbuild -i --commit signature=v${VERSION} ../bitcoin/contrib/gitian-descriptors/gitian-win-signer.yml\n    ./bin/gsign --signer $SIGNER --release ${VERSION}-win-signed --destination ../gitian.sigs/ ../bitcoin/contrib/gitian-descriptors/gitian-win-signer.yml\n    ./bin/gverify -v -d ../gitian.sigs/ -r ${VERSION}-win-signed ../bitcoin/contrib/gitian-descriptors/gitian-win-signer.yml\n    mv build/out/bitcoin-*win64-setup.exe ../bitcoin-${VERSION}-win64-setup.exe\n    mv build/out/bitcoin-*win32-setup.exe ../bitcoin-${VERSION}-win32-setup.exe\n    popd\n\nCommit your signature for the signed OS X/Windows binaries:\n\n    pushd gitian.sigs\n    git add ${VERSION}-osx-signed/${SIGNER}\n    git add ${VERSION}-win-signed/${SIGNER}\n    git commit -a\n    git push  # Assuming you can push to the gitian.sigs tree\n    popd\n\n### After 3 or more people have gitian-built and their results match:\n\n- Create `SHA256SUMS.asc` for the builds, and GPG-sign it:\n\n```bash\nsha256sum * > SHA256SUMS\n```\n\nThe list of files should be:\n```\nbitcoin-${VERSION}-aarch64-linux-gnu.tar.gz\nbitcoin-${VERSION}-arm-linux-gnueabihf.tar.gz\nbitcoin-${VERSION}-i686-pc-linux-gnu.tar.gz\nbitcoin-${VERSION}-x86_64-linux-gnu.tar.gz\nbitcoin-${VERSION}-osx64.tar.gz\nbitcoin-${VERSION}-osx.dmg\nbitcoin-${VERSION}.tar.gz\nbitcoin-${VERSION}-win32-setup.exe\nbitcoin-${VERSION}-win32.zip\nbitcoin-${VERSION}-win64-setup.exe\nbitcoin-${VERSION}-win64.zip\n```\nThe `*-debug*` files generated by the gitian build contain debug symbols\nfor troubleshooting by developers. It is assumed that anyone that is interested\nin debugging can run gitian to generate the files for themselves. To avoid\nend-user confusion about which file to pick, as well as save storage\nspace *do not upload these to the bitcoin.org server, nor put them in the torrent*.\n\n- GPG-sign it, delete the unsigned file:\n```\ngpg --digest-algo sha256 --clearsign SHA256SUMS # outputs SHA256SUMS.asc\nrm SHA256SUMS\n```\n(the digest algorithm is forced to sha256 to avoid confusion of the `Hash:` header that GPG adds with the SHA256 used for the files)\nNote: check that SHA256SUMS itself doesn't end up in SHA256SUMS, which is a spurious/nonsensical entry.\n\n- Upload zips and installers, as well as `SHA256SUMS.asc` from last step, to the bitcoin.org server\n  into `/var/www/bin/bitcoin-core-${VERSION}`\n\n- A `.torrent` will appear in the directory after a few minutes. Optionally help seed this torrent. To get the `magnet:` URI use:\n```bash\ntransmission-show -m <torrent file>\n```\nInsert the magnet URI into the announcement sent to mailing lists. This permits\npeople without access to `bitcoin.org` to download the binary distribution.\nAlso put it into the `optional_magnetlink:` slot in the YAML file for\nbitcoin.org (see below for bitcoin.org update instructions).\n\n- Update bitcoin.org version\n\n  - First, check to see if the Bitcoin.org maintainers have prepared a\n    release: https://github.com/bitcoin-dot-org/bitcoin.org/labels/Releases\n\n      - If they have, it will have previously failed their Travis CI\n        checks because the final release files weren't uploaded.\n        Trigger a Travis CI rebuild---if it passes, merge.\n\n  - If they have not prepared a release, follow the Bitcoin.org release\n    instructions: https://github.com/bitcoin-dot-org/bitcoin.org#release-notes\n\n  - After the pull request is merged, the website will automatically show the newest version within 15 minutes, as well\n    as update the OS download links. Ping @saivann/@harding (saivann/harding on Freenode) in case anything goes wrong\n\n- Announce the release:\n\n  - bitcoin-dev and bitcoin-core-dev mailing list\n\n  - Bitcoin Core announcements list https://bitcoincore.org/en/list/announcements/join/\n\n  - bitcoincore.org blog post\n\n  - Update title of #bitcoin on Freenode IRC\n\n  - Optionally twitter, reddit /r/Bitcoin, ... but this will usually sort out itself\n\n  - Notify BlueMatt so that he can start building [the PPAs](https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin)\n\n  - Archive release notes for the new version to `doc/release-notes/` (branch `master` and branch of the release)\n\n  - Create a [new GitHub release](https://github.com/bitcoin/bitcoin/releases/new) with a link to the archived release notes.\n\n  - Celebrate\n"
  },
  {
    "path": "doc/shared-libraries.md",
    "content": "Shared Libraries\n================\n\n## bitcoinconsensus\n\nThe purpose of this library is to make the verification functionality that is critical to Bitcoin's consensus available to other applications, e.g. to language bindings.\n\n### API\n\nThe interface is defined in the C header `bitcoinconsensus.h` located in  `src/script/bitcoinconsensus.h`.\n\n#### Version\n\n`bitcoinconsensus_version` returns an `unsigned int` with the API version *(currently at an experimental `0`)*.\n\n#### Script Validation\n\n`bitcoinconsensus_verify_script` returns an `int` with the status of the verification. It will be `1` if the input script correctly spends the previous output `scriptPubKey`.\n\n##### Parameters\n- `const unsigned char *scriptPubKey` - The previous output script that encumbers spending.\n- `unsigned int scriptPubKeyLen` - The number of bytes for the `scriptPubKey`.\n- `const unsigned char *txTo` - The transaction with the input that is spending the previous output.\n- `unsigned int txToLen` - The number of bytes for the `txTo`.\n- `unsigned int nIn` - The index of the input in `txTo` that spends the `scriptPubKey`.\n- `unsigned int flags` - The script validation flags *(see below)*.\n- `bitcoinconsensus_error* err` - Will have the error/success code for the operation *(see below)*.\n\n##### Script Flags\n- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NONE`\n- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH` - Evaluate P2SH ([BIP16](https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki)) subscripts\n- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG` - Enforce strict DER ([BIP66](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki)) compliance\n- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY` - Enforce NULLDUMMY ([BIP147](https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki))\n- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY` - Enable CHECKLOCKTIMEVERIFY ([BIP65](https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki))\n- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY` - Enable CHECKSEQUENCEVERIFY ([BIP112](https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki))\n- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS` - Enable WITNESS ([BIP141](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki))\n\n##### Errors\n- `bitcoinconsensus_ERR_OK` - No errors with input parameters *(see the return value of `bitcoinconsensus_verify_script` for the verification status)*\n- `bitcoinconsensus_ERR_TX_INDEX` - An invalid index for `txTo`\n- `bitcoinconsensus_ERR_TX_SIZE_MISMATCH` - `txToLen` did not match with the size of `txTo`\n- `bitcoinconsensus_ERR_DESERIALIZE` - An error deserializing `txTo`\n- `bitcoinconsensus_ERR_AMOUNT_REQUIRED` - Input amount is required if WITNESS is used\n\n### Example Implementations\n- [NBitcoin](https://github.com/NicolasDorier/NBitcoin/blob/master/NBitcoin/Script.cs#L814) (.NET Bindings)\n- [node-libbitcoinconsensus](https://github.com/bitpay/node-libbitcoinconsensus) (Node.js Bindings)\n- [java-libbitcoinconsensus](https://github.com/dexX7/java-libbitcoinconsensus) (Java Bindings)\n- [bitcoinconsensus-php](https://github.com/Bit-Wasp/bitcoinconsensus-php) (PHP Bindings)\n"
  },
  {
    "path": "doc/tor.md",
    "content": "TOR SUPPORT IN BITCOIN\n======================\n\nIt is possible to run Bitcoin as a Tor hidden service, and connect to such services.\n\nThe following directions assume you have a Tor proxy running on port 9050. Many distributions default to having a SOCKS proxy listening on port 9050, but others may not. In particular, the Tor Browser Bundle defaults to listening on port 9150. See [Tor Project FAQ:TBBSocksPort](https://www.torproject.org/docs/faq.html.en#TBBSocksPort) for how to properly\nconfigure Tor.\n\n\n1. Run bitcoin behind a Tor proxy\n---------------------------------\n\nThe first step is running Bitcoin behind a Tor proxy. This will already make all\noutgoing connections be anonymized, but more is possible.\n\n\t-proxy=ip:port  Set the proxy server. If SOCKS5 is selected (default), this proxy\n\t                server will be used to try to reach .onion addresses as well.\n\n\t-onion=ip:port  Set the proxy server to use for tor hidden services. You do not\n\t                need to set this if it's the same as -proxy. You can use -noonion\n\t                to explicitly disable access to hidden service.\n\n\t-listen         When using -proxy, listening is disabled by default. If you want\n\t                to run a hidden service (see next section), you'll need to enable\n\t                it explicitly.\n\n\t-connect=X      When behind a Tor proxy, you can specify .onion addresses instead\n\t-addnode=X      of IP addresses or hostnames in these parameters. It requires\n\t-seednode=X     SOCKS5. In Tor mode, such addresses can also be exchanged with\n\t                other P2P nodes.\n\nIn a typical situation, this suffices to run behind a Tor proxy:\n\n\t./bitcoin -proxy=127.0.0.1:9050\n\n\n2. Run a bitcoin hidden server\n------------------------------\n\nIf you configure your Tor system accordingly, it is possible to make your node also\nreachable from the Tor network. Add these lines to your /etc/tor/torrc (or equivalent\nconfig file):\n\n\tHiddenServiceDir /var/lib/tor/bitcoin-service/\n\tHiddenServicePort 34230 127.0.0.1:34230\n\tHiddenServicePort 44230 127.0.0.1:44230\n\nThe directory can be different of course, but (both) port numbers should be equal to\nyour bitcoind's P2P listen port (34230 by default).\n\n\t-externalip=X   You can tell bitcoin about its publicly reachable address using\n\t                this option, and this can be a .onion address. Given the above\n\t                configuration, you can find your onion address in\n\t                /var/lib/tor/bitcoin-service/hostname. Onion addresses are given\n\t                preference for your node to advertise itself with, for connections\n\t                coming from unroutable addresses (such as 127.0.0.1, where the\n\t                Tor proxy typically runs).\n\n\t-listen         You'll need to enable listening for incoming connections, as this\n\t                is off by default behind a proxy.\n\n\t-discover       When -externalip is specified, no attempt is made to discover local\n\t                IPv4 or IPv6 addresses. If you want to run a dual stack, reachable\n\t                from both Tor and IPv4 (or IPv6), you'll need to either pass your\n\t                other addresses using -externalip, or explicitly enable -discover.\n\t                Note that both addresses of a dual-stack system may be easily\n\t                linkable using traffic analysis.\n\nIn a typical situation, where you're only reachable via Tor, this should suffice:\n\n\t./bitcoind -proxy=127.0.0.1:9050 -externalip=57qr3yd1nyntf5k.onion -listen\n\n(obviously, replace the Onion address with your own). It should be noted that you still\nlisten on all devices and another node could establish a clearnet connection, when knowing\nyour address. To mitigate this, additionally bind the address of your Tor proxy:\n\n\t./bitcoind ... -bind=127.0.0.1\n\nIf you don't care too much about hiding your node, and want to be reachable on IPv4\nas well, use `discover` instead:\n\n\t./bitcoind ... -discover\n\nand open port 34230 on your firewall (or use -upnp).\n\nIf you only want to use Tor to reach onion addresses, but not use it as a proxy\nfor normal IPv4/IPv6 communication, use:\n\n\t./bitcoin -onion=127.0.0.1:9050 -externalip=57qr3yd1nyntf5k.onion -discover\n\n3. Automatically listen on Tor\n--------------------------------\n\nStarting with Tor version 0.2.7.1 it is possible, through Tor's control socket\nAPI, to create and destroy 'ephemeral' hidden services programmatically.\nBitcoin Core has been updated to make use of this.\n\nThis means that if Tor is running (and proper authentication has been configured),\nBitcoin Core automatically creates a hidden service to listen on. This will positively \naffect the number of available .onion nodes.\n\nThis new feature is enabled by default if Bitcoin Core is listening (`-listen`), and\nrequires a Tor connection to work. It can be explicitly disabled with `-listenonion=0`\nand, if not disabled, configured using the `-torcontrol` and `-torpassword` settings.\nTo show verbose debugging information, pass `-debug=tor`.\n\nConnecting to Tor's control socket API requires one of two authentication methods to be \nconfigured. For cookie authentication the user running bitcoind must have write access \nto the `CookieAuthFile` specified in Tor configuration. In some cases this is \npreconfigured and the creation of a hidden service is automatic. If permission problems \nare seen with `-debug=tor` they can be resolved by adding both the user running tor and \nthe user running bitcoind to the same group and setting permissions appropriately. On \nDebian-based systems the user running bitcoind can be added to the debian-tor group, \nwhich has the appropriate permissions. An alternative authentication method is the use \nof the `-torpassword` flag and a `hash-password` which can be enabled and specified in \nTor configuration.\n\n4. Privacy recommendations\n---------------------------\n\n- Do not add anything but bitcoin ports to the hidden service created in section 2.\n  If you run a web service too, create a new hidden service for that.\n  Otherwise it is trivial to link them, which may reduce privacy. Hidden\n  services created automatically (as in section 3) always have only one port\n  open.\n"
  },
  {
    "path": "doc/translation_process.md",
    "content": "Translations\n============\n\nThe Bitcoin-Core project has been designed to support multiple localisations. This makes adding new phrases, and completely new languages easily achievable. For managing all application translations, Bitcoin-Core makes use of the Transifex online translation management tool.\n\n### Helping to translate (using Transifex)\nTransifex is setup to monitor the GitHub repo for updates, and when code containing new translations is found, Transifex will process any changes. It may take several hours after a pull-request has been merged, to appear in the Transifex web interface.\n\nMultiple language support is critical in assisting Bitcoin’s global adoption, and growth. One of Bitcoin’s greatest strengths is cross-border money transfers, any help making that easier is greatly appreciated.\n\nSee the [Transifex Bitcoin project](https://www.transifex.com/projects/p/bitcoin/) to assist in translations. You should also join the translation mailing list for announcements - see details below.\n\n### Writing code with translations\nWe use automated scripts to help extract translations in both Qt, and non-Qt source files. It is rarely necessary to manually edit the files in `src/qt/locale/`. The translation source files must adhere to the following format:\n`bitcoin_xx_YY.ts or bitcoin_xx.ts`\n\n`src/qt/locale/bitcoin_en.ts` is treated in a special way. It is used as the source for all other translations. Whenever a string in the source code is changed, this file must be updated to reflect those changes. A custom script is used to extract strings from the non-Qt parts. This script makes use of `gettext`, so make sure that utility is installed (ie, `apt-get install gettext` on Ubuntu/Debian). Once this has been updated, `lupdate` (included in the Qt SDK) is used to update `bitcoin_en.ts`.\n\nTo automatically regenerate the `bitcoin_en.ts` file, run the following commands:\n```sh\ncd src/\nmake translate\n```\n\n`contrib/bitcoin-qt.pro` takes care of generating `.qm` (binary compiled) files from `.ts` (source files) files. It’s mostly automated, and you shouldn’t need to worry about it.\n\n**Example Qt translation**\n```cpp\nQToolBar *toolbar = addToolBar(tr(\"Tabs toolbar\"));\n```\n\n### Creating a pull-request\nFor general PRs, you shouldn’t include any updates to the translation source files. They will be updated periodically, primarily around pre-releases, allowing time for any new phrases to be translated before public releases. This is also important in avoiding translation related merge conflicts.\n\nWhen an updated source file is merged into the GitHub repo, Transifex will automatically detect it (although it can take several hours). Once processed, the new strings will show up as \"Remaining\" in the Transifex web interface and are ready for translators.\n\nTo create the pull-request, use the following commands:\n```\ngit add src/qt/bitcoinstrings.cpp src/qt/locale/bitcoin_en.ts\ngit commit\n```\n\n### Creating a Transifex account\nVisit the [Transifex Signup](https://www.transifex.com/signup/) page to create an account. Take note of your username and password, as they will be required to configure the command-line tool.\n\nYou can find the Bitcoin translation project at [https://www.transifex.com/projects/p/bitcoin/](https://www.transifex.com/projects/p/bitcoin/).\n\n### Installing the Transifex client command-line tool\nThe client it used to fetch updated translations. If you are having problems, or need more details, see [http://docs.transifex.com/developer/client/setup](http://docs.transifex.com/developer/client/setup)\n\n**For Linux and Mac**\n\n`pip install transifex-client`\n\nSetup your transifex client config as follows. Please *ignore the token field*.\n\n```ini\nnano ~/.transifexrc\n\n[https://www.transifex.com]\nhostname = https://www.transifex.com\npassword = PASSWORD\ntoken =\nusername = USERNAME\n```\n\n**For Windows**\n\nPlease see [http://docs.transifex.com/developer/client/setup#windows](http://docs.transifex.com/developer/client/setup#windows) for details on installation.\n\nThe Transifex Bitcoin project config file is included as part of the repo. It can be found at `.tx/config`, however you shouldn’t need change anything.\n\n### Synchronising translations\nTo assist in updating translations, we have created a script to help.\n\n1. `python contrib/devtools/update-translations.py`\n2. Update `src/qt/bitcoin_locale.qrc` manually or via\n   `ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\\(bitcoin_\\(.*\\)\\).ts/<file alias=\"\\2\">locale\\/\\1.qm<\\/file>/'`\n3. Update `src/Makefile.qt.include` manually or via\n   `ls src/qt/locale/*ts|xargs -n1 basename|sed 's/\\(bitcoin_\\(.*\\)\\).ts/  qt\\/locale\\/\\1.ts \\\\/'`\n4. `git add` new translations from `src/qt/locale/`\n\n**Do not directly download translations** one by one from the Transifex website, as we do a few post-processing steps before committing the translations.\n\n### Handling Plurals (in source files)\nWhen new plurals are added to the source file, it's important to do the following steps:\n\n1. Open `bitcoin_en.ts` in Qt Linguist (included in the Qt SDK)\n2. Search for `%n`, which will take you to the parts in the translation that use plurals\n3. Look for empty `English Translation (Singular)` and `English Translation (Plural)` fields\n4. Add the appropriate strings for the singular and plural form of the base string\n5. Mark the item as done (via the green arrow symbol in the toolbar)\n6. Repeat from step 2, until all singular and plural forms are in the source file\n7. Save the source file\n\n### Translating a new language\nTo create a new language template, you will need to edit the languages manifest file `src/qt/bitcoin_locale.qrc` and add a new entry. Below is an example of the English language entry.\n\n```xml\n<qresource prefix=\"/translations\">\n    <file alias=\"en\">locale/bitcoin_en.qm</file>\n    ...\n</qresource>\n```\n\n**Note:** that the language translation file **must end in `.qm`** (the compiled extension), and not `.ts`.\n\n### Questions and general assistance\nThe Bitcoin-Core translation maintainers include *tcatm, seone, Diapolo, wumpus and luke-jr*. You can find them, and others, in the Freenode IRC chatroom - `irc.freenode.net #bitcoin-core-dev`.\n\nIf you are a translator, you should also subscribe to the mailing list, https://groups.google.com/forum/#!forum/bitcoin-translators. Announcements will be posted during application pre-releases to notify translators to check for updates.\n"
  },
  {
    "path": "doc/translation_strings_policy.md",
    "content": "Translation Strings Policy\n===========================\n\nThis document provides guidelines for internationalization of the Bitcoin Core software.\n\nHow to translate?\n------------------\n\nTo mark a message as translatable\n\n- In GUI source code (under `src/qt`): use `tr(\"...\")`\n\n- In non-GUI source code (under `src`): use `_(\"...\")`\n\nNo internationalization is used for e.g. developer scripts outside `src`.\n\nStrings to be translated\n-------------------------\n\nOn a high level, these strings are to be translated:\n\n- GUI strings, anything that appears in a dialog or window\n\n- Command-line option documentation\n\n### GUI strings\n\nAnything that appears to the user in the GUI is to be translated. This includes labels, menu items, button texts, tooltips and window titles.\nThis includes messages passed to the GUI through the UI interface through `InitMessage`, `ThreadSafeMessageBox` or `ShowProgress`.\n\n### Command-line options\n\nDocumentation for the command line options in the output of `--help` should be translated as well.\n\nMake sure that default values do not end up in the string, but use string formatting like `strprintf(_(\"Threshold for disconnecting misbehaving peers (default: %u)\"), 100)`. Putting default values in strings has led to accidental translations in the past, and forces the string to be retranslated every time the value changes.\n\nDo not translate messages that are only shown to developers, such as those that only appear when `--help-debug` is used.\n\nGeneral recommendations\n------------------------\n\n### Avoid unnecessary translation strings\n\nTry not to burden translators with translating messages that are e.g. slight variations of other messages.\nIn the GUI, avoid the use of text where an icon or symbol will do.\nMake sure that placeholder texts in forms don't end up in the list of strings to be translated (use `<string notr=\"true\">`).\n\n### Make translated strings understandable\n\nTry to write translation strings in an understandable way, for both the user and the translator. Avoid overly technical or detailed messages\n\n### Do not translate internal errors\n\nDo not translate internal errors, or log messages, or messages that appear on the RPC interface. If an error is to be shown to the user,\nuse a translatable generic message, then log the detailed message to the log. E.g. \"A fatal internal error occurred, see debug.log for details\".\nThis helps troubleshooting; if the error is the same for everyone, the likelihood is increased that it can be found using a search engine.\n\n### Avoid fragments\n\nAvoid dividing up a message into fragments. Translators see every string separately, so may misunderstand the context if the messages are not self-contained.\n\n### Avoid HTML in translation strings\n\nThere have been difficulties with use of HTML in translation strings; translators should not be able to accidentally affect the formatting of messages.\nThis may sometimes be at conflict with the recommendation in the previous section.\n\n### Plurals\n\nPlurals can be complex in some languages. A quote from the gettext documentation:\n\n    In Polish we use e.g. plik (file) this way:\n    1 plik,\n    2,3,4 pliki,\n    5-21 pliko'w,\n    22-24 pliki,\n    25-31 pliko'w\n    and so on\n\nIn Qt code use tr's third argument for optional plurality. For example:\n\n    tr(\"%n hour(s)\",\"\",secs/HOUR_IN_SECONDS);\n    tr(\"%n day(s)\",\"\",secs/DAY_IN_SECONDS);\n    tr(\"%n week(s)\",\"\",secs/WEEK_IN_SECONDS);\n\nThis adds `<numerusform>`s to the respective `.ts` file, which can be translated separately depending on the language. In English, this is simply:\n\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation>\n            <numerusform>%n active connection to Bitcoin network</numerusform>\n            <numerusform>%n active connections to Bitcoin network</numerusform>\n        </translation>\n    </message>\n\nWhere it is possible try to avoid embedding numbers into the flow of the string at all. e.g.\n\n    WARNING: check your network connection, %d blocks received in the last %d hours (%d expected)\n\nversus\n\n    WARNING: check your network connection, less blocks (%d) were received in the last %n hours than expected (%d).\n\nThe second example reduces the number of pluralized words that translators have to handle from three to one, at no cost to comprehensibility of the sentence.\n\n### String freezes\n\nDuring a string freeze (often before a major release), no translation strings are to be added, modified or removed.\n\nThis can be checked by executing `make translate` in the `src` directory, then verifying that `bitcoin_en.ts` remains unchanged.\n"
  },
  {
    "path": "doc/travis-ci.md",
    "content": "Travis CI\n=========\n\nSupport for using travis-ci has been added in order to automate pull-testing.\nSee [travis-ci.org](https://travis-ci.org/) for more info\n\nThis procedure is different than the pull-tester that came before it in a few\nways.\n\nThere is nothing to administer. This is a major feature as it means\nthat builds have no local state. Because there is no ability to login to the\nbuilders to install packages (tools, dependencies, etc), the entire build\nprocedure must instead be controlled by a declarative script `.travis.yml`.\nThis script declares each build configuration, creates virtual machines as\nnecessary, builds, then discards the virtual machines.\n\nA build matrix is constructed to test a wide range of configurations, rather\nthan a single pass/fail. This helps to catch build failures and logic errors\nthat present on platforms other than the ones the author has tested. This\nmatrix is defined in the build script and can be changed at any time.\n\nAll builders use the dependency-generator in the [depends dir](/depends), rather than\nusing apt-get to install build dependencies. This guarantees that the tester\nis using the same versions as Gitian, so the build results are nearly identical\nto what would be found in a final release. However, this also means that builds\nwill fail if new dependencies are introduced without being added to the\ndependency generator.\n\nIn order to avoid rebuilding all dependencies for each build, the binaries are\ncached and re-used when possible. Changes in the dependency-generator will\ntrigger cache-invalidation and rebuilds as necessary.\n\nThese caches can be manually removed if necessary. This is one of the very few\nmanual operations that is possible with Travis, and it can be done by the\nBitcoin Core committer via the Travis web interface.\n\nIn some cases, secure strings may be needed for hiding sensitive info such as\nprivate keys or URLs. The travis client may be used to create these strings:\nhttp://docs.travis-ci.com/user/encryption-keys/\n\nFor the details of the build descriptor, see the official docs:\nhttp://docs.travis-ci.com/user/build-configuration/\n"
  },
  {
    "path": "doc/zmq.md",
    "content": "# Block and Transaction Broadcasting with ZeroMQ\n\n[ZeroMQ](http://zeromq.org/) is a lightweight wrapper around TCP\nconnections, inter-process communication, and shared-memory,\nproviding various message-oriented semantics such as publish/subscribe,\nrequest/reply, and push/pull.\n\nThe Bitcoin Core daemon can be configured to act as a trusted \"border\nrouter\", implementing the bitcoin wire protocol and relay, making\nconsensus decisions, maintaining the local blockchain database,\nbroadcasting locally generated transactions into the network, and\nproviding a queryable RPC interface to interact on a polled basis for\nrequesting blockchain related data. However, there exists only a\nlimited service to notify external software of events like the arrival\nof new blocks or transactions.\n\nThe ZeroMQ facility implements a notification interface through a set\nof specific notifiers. Currently there are notifiers that publish\nblocks and transactions. This read-only facility requires only the\nconnection of a corresponding ZeroMQ subscriber port in receiving\nsoftware; it is not authenticated nor is there any two-way protocol\ninvolvement. Therefore, subscribers should validate the received data\nsince it may be out of date, incomplete or even invalid.\n\nZeroMQ sockets are self-connecting and self-healing; that is,\nconnections made between two endpoints will be automatically restored\nafter an outage, and either end may be freely started or stopped in\nany order.\n\nBecause ZeroMQ is message oriented, subscribers receive transactions\nand blocks all-at-once and do not need to implement any sort of\nbuffering or reassembly.\n\n## Prerequisites\n\nThe ZeroMQ feature in Bitcoin Core requires ZeroMQ API version 4.x or\nnewer. Typically, it is packaged by distributions as something like\n*libzmq3-dev*. The C++ wrapper for ZeroMQ is *not* needed.\n\nIn order to run the example Python client scripts in contrib/ one must\nalso install *python3-zmq*, though this is not necessary for daemon\noperation.\n\n## Enabling\n\nBy default, the ZeroMQ feature is automatically compiled in if the\nnecessary prerequisites are found.  To disable, use --disable-zmq\nduring the *configure* step of building bitcoind:\n\n    $ ./configure --disable-zmq (other options)\n\nTo actually enable operation, one must set the appropriate options on\nthe command line or in the configuration file.\n\n## Usage\n\nCurrently, the following notifications are supported:\n\n    -zmqpubhashtx=address\n    -zmqpubhashblock=address\n    -zmqpubrawblock=address\n    -zmqpubrawtx=address\n\nThe socket type is PUB and the address must be a valid ZeroMQ socket\naddress. The same address can be used in more than one notification.\n\nFor instance:\n\n    $ bitcoind -zmqpubhashtx=tcp://127.0.0.1:28332 \\\n               -zmqpubrawtx=ipc:///tmp/bitcoind.tx.raw\n\nEach PUB notification has a topic and body, where the header\ncorresponds to the notification type. For instance, for the\nnotification `-zmqpubhashtx` the topic is `hashtx` (no null\nterminator) and the body is the transaction hash (32\nbytes).\n\nThese options can also be provided in bitcoin.conf.\n\nZeroMQ endpoint specifiers for TCP (and others) are documented in the\n[ZeroMQ API](http://api.zeromq.org/4-0:_start).\n\nClient side, then, the ZeroMQ subscriber socket must have the\nZMQ_SUBSCRIBE option set to one or either of these prefixes (for\ninstance, just `hash`); without doing so will result in no messages\narriving. Please see `contrib/zmq/zmq_sub.py` for a working example.\n\n## Remarks\n\nFrom the perspective of bitcoind, the ZeroMQ socket is write-only; PUB\nsockets don't even have a read function. Thus, there is no state\nintroduced into bitcoind directly. Furthermore, no information is\nbroadcast that wasn't already received from the public P2P network.\n\nNo authentication or authorization is done on connecting clients; it\nis assumed that the ZeroMQ port is exposed only to trusted entities,\nusing other means such as firewalling.\n\nNote that when the block chain tip changes, a reorganisation may occur\nand just the tip will be notified. It is up to the subscriber to\nretrieve the chain from the last known block to the new tip.\n\nThere are several possibilities that ZMQ notification can get lost\nduring transmission depending on the communication type your are\nusing. Bitcoind appends an up-counting sequence number to each\nnotification which allows listeners to detect lost notifications.\n"
  },
  {
    "path": "libbitcoinconsensus.pc.in",
    "content": "prefix=@prefix@\nexec_prefix=@exec_prefix@\nlibdir=@libdir@\nincludedir=@includedir@\n\nName: @PACKAGE_NAME@ consensus library\nDescription: Library for the Bitcoin consensus protocol.\nVersion: @PACKAGE_VERSION@\nLibs: -L${libdir} -lbitcoinconsensus\nCflags: -I${includedir}\nRequires.private: libcrypto\n"
  },
  {
    "path": "share/genbuild.sh",
    "content": "#!/bin/sh\n# Copyright (c) 2012-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nif [ $# -gt 1 ]; then\n    cd \"$2\" || exit 1\nfi\nif [ $# -gt 0 ]; then\n    FILE=\"$1\"\n    shift\n    if [ -f \"$FILE\" ]; then\n        INFO=\"$(head -n 1 \"$FILE\")\"\n    fi\nelse\n    echo \"Usage: $0 <filename> <srcroot>\"\n    exit 1\nfi\n\ngit_check_in_repo() {\n    ! { git status --porcelain -uall --ignored \"$@\" 2>/dev/null || echo '??'; } | grep -q '?'\n}\n\nDESC=\"\"\nSUFFIX=\"\"\nif [ \"${BITCOIN_GENBUILD_NO_GIT}\" != \"1\" -a -e \"$(which git 2>/dev/null)\" -a \"$(git rev-parse --is-inside-work-tree 2>/dev/null)\" = \"true\" ] && git_check_in_repo share/genbuild.sh; then\n    # clean 'dirty' status of touched files that haven't been modified\n    git diff >/dev/null 2>/dev/null \n\n    # if latest commit is tagged and not dirty, then override using the tag name\n    RAWDESC=$(git describe --abbrev=0 2>/dev/null)\n    if [ \"$(git rev-parse HEAD)\" = \"$(git rev-list -1 $RAWDESC 2>/dev/null)\" ]; then\n        git diff-index --quiet HEAD -- && DESC=$RAWDESC\n    fi\n\n    # otherwise generate suffix from git, i.e. string like \"59887e8-dirty\"\n    SUFFIX=$(git rev-parse --short HEAD)\n    git diff-index --quiet HEAD -- || SUFFIX=\"$SUFFIX-dirty\"\nfi\n\nif [ -n \"$DESC\" ]; then\n    NEWINFO=\"#define BUILD_DESC \\\"$DESC\\\"\"\nelif [ -n \"$SUFFIX\" ]; then\n    NEWINFO=\"#define BUILD_SUFFIX $SUFFIX\"\nelse\n    NEWINFO=\"// No build information available\"\nfi\n\n# only update build.h if necessary\nif [ \"$INFO\" != \"$NEWINFO\" ]; then\n    echo \"$NEWINFO\" >\"$FILE\"\nfi\n"
  },
  {
    "path": "share/pixmaps/bitcoin128.xpm",
    "content": "/* XPM */\nstatic char *bitcoin___[] = {\n/* columns rows colors chars-per-pixel */\n\"128 128 108 2 \",\n\"   c #000000\",\n\".  c #050609\",\n\"X  c #050A0D\",\n\"o  c #08090F\",\n\"O  c #0B0E15\",\n\"+  c #0D0F18\",\n\"@  c #001212\",\n\"#  c #091017\",\n\"$  c #041619\",\n\"%  c #0E111B\",\n\"&  c #001C1C\",\n\"*  c #10141F\",\n\"=  c #121623\",\n\"-  c #141826\",\n\";  c #161A2A\",\n\":  c #191D2F\",\n\">  c #191F31\",\n\",  c #002424\",\n\"<  c #002A2A\",\n\"1  c #1B2135\",\n\"2  c #1F243A\",\n\"3  c #003636\",\n\"4  c #003A3A\",\n\"5  c #21273E\",\n\"6  c #21283F\",\n\"7  c #232A44\",\n\"8  c #262E4A\",\n\"9  c #282F4C\",\n\"0  c #29324F\",\n\"q  c #2C3453\",\n\"w  c #2E3758\",\n\"e  c #2F385A\",\n\"r  c #313A5D\",\n\"t  c #343E63\",\n\"y  c #004444\",\n\"u  c #004C4C\",\n\"i  c #005151\",\n\"p  c #005F5F\",\n\"a  c #364067\",\n\"s  c #374169\",\n\"d  c #39446D\",\n\"f  c #3B4772\",\n\"g  c #374C73\",\n\"h  c #3B4872\",\n\"j  c #355077\",\n\"k  c #355278\",\n\"l  c #33597E\",\n\"z  c #006262\",\n\"x  c #006868\",\n\"c  c #0C6D75\",\n\"v  c #007474\",\n\"b  c #007A7A\",\n\"n  c #2F6385\",\n\"m  c #2C6D8D\",\n\"M  c #306284\",\n\"N  c #30678A\",\n\"B  c #2A7694\",\n\"V  c #297A97\",\n\"C  c #277F9B\",\n\"Z  c #287B98\",\n\"A  c #455385\",\n\"S  c #4B5A8F\",\n\"D  c #4B5B91\",\n\"F  c #50609A\",\n\"G  c #596BAA\",\n\"H  c #5F72B5\",\n\"J  c #6174BA\",\n\"K  c #6478BF\",\n\"L  c #667AC3\",\n\"P  c #687DC7\",\n\"I  c #008281\",\n\"U  c #008B8B\",\n\"Y  c #188E9F\",\n\"T  c #009191\",\n\"R  c #009E9E\",\n\"E  c #1F9AB1\",\n\"W  c #2587A1\",\n\"Q  c #248BA5\",\n\"!  c #2195AD\",\n\"~  c #00A5A5\",\n\"^  c #00ACAC\",\n\"/  c #1CA3B7\",\n\"(  c #1CA4B8\",\n\")  c #1AAABC\",\n\"_  c #00B4B4\",\n\"`  c #00BBBB\",\n\"'  c #18AFC0\",\n\"]  c #17B4C5\",\n\"[  c #15BBCA\",\n\"{  c #6C82CF\",\n\"}  c #6D83D1\",\n\"|  c #00C5C5\",\n\" . c #00CCCC\",\n\".. c #11C6D2\",\n\"X. c #11C9D4\",\n\"o. c #00D4D4\",\n\"O. c #0DD4DE\",\n\"+. c #00DBDB\",\n\"@. c #0BDCE4\",\n\"#. c #00E3E3\",\n\"$. c #09E0E7\",\n\"%. c #08E4EA\",\n\"&. c #03EAED\",\n\"*. c #05EDF1\",\n\"=. c #02F3F4\",\n\"-. c #02F7F9\",\n\";. c #00FFFF\",\n\":. c None\",\n/* pixels */\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { { { { { { { { } { { { { } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { } { { { { { { { { { { { { { { { { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { { { { { { { { { } } } } } } } { { { { { { { { { { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { } { { { { { { { { { { { } } } } { { P L H H H G G H H J L P P { } } { { { } { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { } } } { K G D h w 6 1 = % % O o o O % # = 1 7 e h D G K { } } } { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { } } { J F d 8 = O                                       . o = 8 d F K { } } { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { } } { H A q = .                                                           = q A H { } { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { } } K S 0 %                                                                         % 0 S K { { { { { { { { { { } { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { } { H f :                                                                                   . ; f H { } } { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { } { G r %                                                                                             % r G { } { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { } G r +                                                                                                     + r G } { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { } L h %                                                                                                             % h L } } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { } { { { } { D :                                                                                                                     > D P } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { } { { { { { } H e .                                                                                                                         . r H } { } { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { } { D ;                                                                                                                                 ; D { } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { } P f o                                                                                                                                     o d P } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { } H 8                                                                                                                                             9 H } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { } G >                                                                                                                                                 > G } { { { { } { } { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { } { { } F =                                                                                                                                                     = F } { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { } D +                                                                                                                                                         % D } { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { } D +                                                                                                                                                             + D } { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { } D +                                                                                                                                                                 + D } } { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { } { { } F +                                                                                                                                                                     + F } { { { { } { { :.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { } G =                                                                                                           . @ & < 4 i z I c +                                           = G } { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { } H >                                                                                         . X & < 4 i z b T ^ ` o.+.&.-.;.;.@.N 8                                             > H } { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.{ { { { { { { P 8                                                                         X & , 3 u p b U ~ `  .+.#.=.-.;.;.;.;.;.;.;.;.;.;.O.M d t =                                             8 P { { { { { { { :.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.{ { { { { { { { d                                                                 @ x U ~ _ | +.#.=.-.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.O.M d d d q .                                             d { { { { { { { { :.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.{ { { { { { } D O                                                               & ^ ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.@.M d d d d d :                                             o D } { { { { { { :.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.{ { { { { { } J ;                                                               & _ ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.$.m d d d d d d r o                                             ; J } { { { { { { :.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.{ { { { { { { r                                                               , _ ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.$.m d d d d d d d d 2                                               e { { { { { { { :.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.{ { { { { { } S .                                                             < | ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.$.m d d d d d d d d d t +                                             . S } } { { { { { :.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.{ { { { { } K >                                                             < | ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.%.m d d d d d d d d d d d 8                                               > K { { { } { { :.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.{ { { { { { } h                                                             3 o.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.&.V d d d d d d d d d d d d d =                                               h } { { { { { { :.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.{ { { { } } G %                                                           4 o.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.*.V d d d d d d d d d d d d d d q                                               % G } } { { { { :.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.{ } { { { { { r                                                           y o.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.&.V d d d d d d d d d d d d d d d d >                                               r } { { { { { { :.:.:.:.:.:.\",\n\":.:.:.:.:.:.{ { { { { } G +                                                         u #.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.*.V t d d d d d d d d d d d d d d d d r O                                             + G } { { { { { :.:.:.:.:.:.\",\n\":.:.:.:.:.{ { { { { { } r                                                         i #.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.*.W f d d d d d d d d d d d d d d d d d d 2                                               r { { { { { { { :.:.:.:.:.\",\n\":.:.:.:.:.{ { { { { } H %                                                       z &.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.=.Q d d d d d d d d d d d d d d d d d d d d a #                                             % H } { { { { { :.:.:.:.:.\",\n\":.:.:.:.{ { { { { { } f                                                       p &.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.*.Q d d d d d d d d d d d d d d d d d d d d d d 9                                               f } { { { { } { :.:.:.:.\",\n\":.:.:.:.{ { { { { } K :                                                   . v &.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.*.Q d d d d d d d d d d d d d d d d d d d d d d d d =                                             ; K } { { { { { :.:.:.:.\",\n\":.:.:.:.{ { { } { } S                                                   . v =.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.-.! d d d d d d d d d d d d d d d d d d d d d d d d d q .                                             S } { { { { { :.:.:.:.\",\n\":.:.:.{ { { { { { { q                                                 X b -.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.-.E d d d d d d d d d d d d d d d d d d d d d d d d d d d 1                                             q { { { { { { { :.:.:.\",\n\":.:.:.{ { { { { } H %                                               X U -.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.-.E f d d d d d d d d d d d d d d d d d d d d d d d d d d h e o                                           % H } { { { { { :.:.:.\",\n\":.:.:.{ { { { { } A                                               X U -.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.-.! h d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 2                                             A } { { { { { :.:.:.\",\n\":.:.{ { { { { { { 0                                             @ R -.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.-.E d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d a %                                           q { { { { { { { :.:.\",\n\":.:.{ { { { { } J =                                           @ R ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.) g d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 9                                           = K } } { { { { :.:.\",\n\":.:.{ { { { { } F .                                         & ~ ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.( g d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d =                                         . D } { { { { { :.:.\",\n\":.:.{ { { { { } d                                         & _ ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.) h d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d q .                                         d } { { { { { :.:.\",\n\":.:.{ { { { { { 8                                       , _ ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.) h d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d >                                         8 { { { { { { :.:.\",\n\":.{ { { { { } K -                                     < | ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.] g d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d r O                                       - K } { { { { { :.\",\n\":.{ { { { { } G O                                   < | ;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.[ j d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 5                                       O G } { { { { { :.\",\n\":.{ { { { { } S                                   4  .;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.] j d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d a %                                       S } { { { { } :.\",\n\":.{ { { { } } h                                 4 o.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.[ g d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 0                                       h } { { { { { :.\",\n\":.{ { { { { { w                               y o.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;...j d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d -                                     e } { { { { { :.\",\n\":.{ { { { { { 7                             u #.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.X.l d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d q .                                   7 { { { { { { :.\",\n\"{ { { { { { P 1                           u #.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.X.l d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 1                                   1 P { { { { { { \",\n\"{ { { { { } K =                         p &.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.X.k d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d r O                                 = K { { { { { { \",\n\"{ } { { { } H %                       $ Y [ [ X.O.@.%.*.-.-.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.;.X.l d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 5                                 % H } } { { { { \",\n\"{ { { { { } H %                         1 d d d g k l M m B C Q E ( ] [ X.O.@.&.*.-.-.;.;.;.;.;.;.O.M d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d t %                               % H } { { { { { \",\n\"{ { { { { } H O                         . 8 d d d d d d d d t d d d d d f g k l M N B Z Q ! ( ] ' M d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 8                               O H } { { { { { \",\n\"{ { { { { } G o                           O w d d d d d d d d d d d d d d d d d d d t d d t d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d -                             o G } { { { { { \",\n\"{ { { { { } G o                             * d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d s g d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d w .                           o G } { { { { { \",\n\"{ { { { { { H +                               1 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d >                           O H } { { { { { \",\n\"{ { { { { } H %                                 7 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d r O                         % H } { } { { { \",\n\"{ { { { { } H %                                 o e d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d ;                         + H } { { { { { \",\n\"{ { { { { } K =                                   % t d d d d d d d d d d d d d d d d d d d d d d d d d d d s d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 9 .                         = L } { { { { { \",\n\"{ { { { { { P 1                                     : d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d w O                           1 P { { { { { { \",\n\":.{ { { { { P 7                                       8 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d t %                             7 P { { { { { :.\",\n\":.{ { { { } } e                                       o w d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d a ;                               e } { { { { { :.\",\n\":.{ { { { { } h                                         % t d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 2                                 h } { { { { { :.\",\n\":.{ { { { { } D                                           ; d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 8                                   D } { { { { { :.\",\n\":.{ { { { { } G o                                           7 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d s d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d w o                                 o G } { { { { { :.\",\n\":.{ { { { { { L -                                           . q d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d g t +                                   - K } { { { { { :.\",\n\":.:.{ { { { { { 8                                             + r d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d f d =                                     8 { } { { { { :.:.\",\n\":.:.{ { { { { } f                                               ; a d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 1                                       d } { { { { { :.:.\",\n\":.:.{ { { { { } D .                                               2 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 7                                       . F } { { { { { :.:.\",\n\":.:.{ { { { { { K =                                               X 8 g d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d q X                                       = K { { { { { { :.:.\",\n\":.:.{ { { { { { { 0                                                 O r d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d r +                                         q { { { { { { { :.:.\",\n\":.:.:.{ { { { { } A                                                   - a d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d g d d d d s d d d d d d d d d d a =                                           A } { { { { { :.:.:.\",\n\":.:.:.{ { { { { } J %                                                   2 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d s d d d d d d d d d d d d d d d >                                           % J } { { { { { :.:.:.\",\n\":.:.:.{ { { { { { { 0                                                   . 9 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 7                                             0 { { { { { { { :.:.:.\",\n\":.:.:.:.{ { { { { } D                                                     O e d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d q .                                             D } { { { { { :.:.:.:.\",\n\":.:.:.:.{ { { { { { L ;                                                     = d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d e O                                             ; L { { { { { { :.:.:.:.\",\n\":.:.:.:.{ { { { { { { f                                                       2 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d s d d d d d d d d d d d d d d d d d d d d t =                                               h } { { { { { { :.:.:.:.\",\n\":.:.:.:.:.{ } { { { { H *                                                       8 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d :                                               % H { { { { { { :.:.:.:.:.\",\n\":.:.:.:.:.{ { { { { { { r                                                       o e d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 6                                                 r { { { } { { { :.:.:.:.:.\",\n\":.:.:.:.:.:.{ { { { { } G +                                                       * t d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 9 .                                               + G } { { { { } :.:.:.:.:.:.\",\n\":.:.:.:.:.:.{ { { { { { { r                                                         1 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d w O                                                 r } { { { { { { :.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.{ { { { { } G *                                                         8 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d a %                                                 % G } { { { { { :.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.{ { { { { { } f                                                         o w d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d :                                                   f } { { { { { { :.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.{ { { { { } K >                                                         * t d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d 2                                                   > L { { { { { { :.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.{ { { { { { } D .                                                         > d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d g 8                                                   . D } { { { { { { :.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.{ { { { { { { e                                                           6 d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d q o                                                   e { { { { { { { :.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.{ { { { { } } J ;                                                         . - 7 w t d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d t %                                                   ; H } { { { { { { :.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.{ { { { { { } D o                                                             . + : 7 r d d f d d d d d d d d d d d d d d d d d d d d d d d d d d ;                                                   o D } } { { { { { :.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.{ { { { { { { { d                                                                     . + > 8 r d d d d d d d d d d d d d d d d d d d d d d d d 2                                                     d { { { { } { { { :.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.{ { { { { { { P 0                                                                           o % 1 0 t d d f d d d d d d d d d d d d d d d d 7                                                     0 P { { { { { { { :.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { } H >                                                                                 o = 2 q t d d d d d d d d d d d d d d w .                                                   > H } { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { } G =                                                                                       O - 5 w a d d d d d d d d d t +                                                   = G } { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.} { { { { { { } F +                                                                                             + ; 7 r a d d d d d ;                                                   + F } { { } { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { } D +                                                                                                 . + : 8 r a >                                                   % D } { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { } D +                                                                                                       . +                                                   + D } { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { } } D +                                                                                                                                                         + D } { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { } F =                                                                                                                                                     = F } { { } { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { } G >                                                                                                                                                 1 G } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { } H 8                                                                                                                                             9 H } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { } P d O                                                                                                                                     o d P } } { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { } { S ;                                                                                                                                 ; D } } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { } } H r .                                                                                                                         . w H } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { } { S :                                                                                                                     > D { } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { } K h %                                                                                                             % h K } { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ } { { { { { { { } } G r +                                                                                                     + r G } { { { { { { { } { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { } } G r %                                                                                             % r G } } { } { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { } { H f ;                                                                                     ; f H { } { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { } } K S q *                                                                         * 0 D K } } { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { } { H A 0 = .                                                         . = 0 A H { } } { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { } { { { { { { { { { } { J F d 8 = O                                         o = 8 d F J { } } { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { { } } { K G S h e 7 1 = % # + . o + % % = 1 7 e h D G K { } } { { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { } { { { { { { } } } } { { P K H J H G G H H H L P P } } } } } { { { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { { { { { { { { } { } } } { { } } { { { { } { { { { { { { { } { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { } { { { { { { { { { { { { { { { { { } } { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { { { { { { { { { { { { { { } { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { { { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\",\n\":.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.{ { { { { { { { { { { { :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.\"\n};\n"
  },
  {
    "path": "share/pixmaps/bitcoin16.xpm",
    "content": "/* XPM */\nstatic char *bitcoin__[] = {\n/* columns rows colors chars-per-pixel */\n\"16 16 85 1 \",\n\"  c black\",\n\". c #020001\",\n\"X c #010102\",\n\"o c #000303\",\n\"O c #020204\",\n\"+ c #020305\",\n\"@ c #000404\",\n\"# c #000605\",\n\"$ c #030406\",\n\"% c #040509\",\n\"& c #05060A\",\n\"* c #06070B\",\n\"= c #07080D\",\n\"- c #07090E\",\n\"; c #08080E\",\n\": c #08090F\",\n\"> c #080A10\",\n\", c #090B11\",\n\"< c #0B0D16\",\n\"1 c #0E101A\",\n\"2 c #0F121D\",\n\"3 c #10141F\",\n\"4 c #111420\",\n\"5 c #111421\",\n\"6 c #141826\",\n\"7 c #151929\",\n\"8 c #1A1F32\",\n\"9 c #082F35\",\n\"0 c #1D2338\",\n\"q c #003D3D\",\n\"w c #20263E\",\n\"e c #133845\",\n\"r c #272F4B\",\n\"t c #272F4C\",\n\"y c #27304C\",\n\"u c #28304C\",\n\"i c #28304D\",\n\"p c #2A3250\",\n\"a c #2D3657\",\n\"s c #2E3758\",\n\"d c #2F3859\",\n\"f c #313B5E\",\n\"g c #354066\",\n\"h c #364168\",\n\"j c #374169\",\n\"k c #354369\",\n\"l c #38436B\",\n\"z c #39436D\",\n\"x c #39446D\",\n\"c c #39456D\",\n\"v c #39446E\",\n\"b c #39456E\",\n\"n c #3A446E\",\n\"m c #3A456E\",\n\"M c #3A456F\",\n\"N c #38466E\",\n\"B c #374A72\",\n\"V c #394870\",\n\"C c #006161\",\n\"Z c #006A6A\",\n\"A c #007675\",\n\"S c #4D5C93\",\n\"D c #5465A2\",\n\"F c #5466A2\",\n\"G c #5D70B2\",\n\"H c #657AC2\",\n\"J c #697FCA\",\n\"K c #6A7FCB\",\n\"L c #008181\",\n\"P c #058B8E\",\n\"I c #2290A8\",\n\"U c #2391AA\",\n\"Y c #2193AB\",\n\"T c #2194AB\",\n\"R c #15AEBD\",\n\"E c #0FCFDA\",\n\"W c #12C6D3\",\n\"Q c #00EBEB\",\n\"! c #00EFEF\",\n\"~ c #00F4F3\",\n\"^ c #03F5F7\",\n\"/ c #03F6F8\",\n\"( c #04F5F8\",\n\") c cyan\",\n\"_ c None\",\n/* pixels */\n\"_____KGFFGK_____\",\n\"___KSy4,>4tSK___\",\n\"__Hg=      ;gH__\",\n\"_KgO  qZLPe OgK_\",\n\"_S=  CQ)^Yj2 ;S_\",\n\"Ku #Z~)^IMMu# uK\",\n\"G4#A~)(YMlMj7 4G\",\n\"F=9RWEYNMlMMs*>F\",\n\"F>*pVBMMlMlMg3;F\",\n\"G4 <fMljMlMMw 4G\",\n\"Ky  6gMMlMMu% uK\",\n\"_S=  0jMMMs; ;S_\",\n\"_KgO O18ra2 #gK_\",\n\"__Hg;    # ;gH__\",\n\"___KSu5>>4rSK___\",\n\"_____KGFFGK_____\"\n};\n"
  },
  {
    "path": "share/pixmaps/bitcoin256.xpm",
    "content": "/* XPM */\nstatic char *bitcoin___[] = {\n/* columns rows colors chars-per-pixel */\n\"256 256 102 2 \",\n\"   c #000000\",\n\".  c #05060A\",\n\"X  c #040B0E\",\n\"o  c #08090F\",\n\"O  c #0A0C13\",\n\"+  c #0D0F18\",\n\"@  c #001414\",\n\"#  c #0E111B\",\n\"$  c #001D1D\",\n\"%  c #10131E\",\n\"&  c #0A1B22\",\n\"*  c #121522\",\n\"=  c #151927\",\n\"-  c #171B2C\",\n\";  c #181C2D\",\n\":  c #1A1F31\",\n\">  c #002323\",\n\",  c #002A2A\",\n\"<  c #1C2236\",\n\"1  c #1F253B\",\n\"2  c #013233\",\n\"3  c #003D3D\",\n\"4  c #20263D\",\n\"5  c #232A44\",\n\"6  c #262E4A\",\n\"7  c #29314E\",\n\"8  c #2C3454\",\n\"9  c #2E3758\",\n\"0  c #2F395B\",\n\"q  c #313B5E\",\n\"w  c #343E63\",\n\"e  c #004242\",\n\"r  c #004A4A\",\n\"t  c #005050\",\n\"y  c #005B5B\",\n\"u  c #364067\",\n\"i  c #374168\",\n\"p  c #39446D\",\n\"a  c #3A4770\",\n\"s  c #364D74\",\n\"d  c #3B4973\",\n\"f  c #2C5474\",\n\"g  c #33577C\",\n\"h  c #325A7E\",\n\"j  c #006464\",\n\"k  c #006A6A\",\n\"l  c #007171\",\n\"z  c #007C7C\",\n\"x  c #414E7D\",\n\"c  c #325D80\",\n\"v  c #2D6B8C\",\n\"b  c #306284\",\n\"n  c #2A7493\",\n\"m  c #297997\",\n\"M  c #455385\",\n\"N  c #4A598D\",\n\"B  c #4D5D94\",\n\"V  c #4F6098\",\n\"C  c #51629C\",\n\"Z  c #5566A2\",\n\"A  c #5668A6\",\n\"S  c #5A6DAE\",\n\"D  c #5E72B5\",\n\"F  c #6276BC\",\n\"G  c #6378BF\",\n\"H  c #667BC5\",\n\"J  c #687DC7\",\n\"K  c #697FCA\",\n\"L  c #008181\",\n\"P  c #008D8D\",\n\"I  c #009595\",\n\"U  c #009B9B\",\n\"Y  c #228EA7\",\n\"T  c #2193AB\",\n\"R  c #00A6A6\",\n\"E  c #00AFAF\",\n\"W  c #1DA1B6\",\n\"Q  c #1AACBE\",\n\"!  c #00B6B6\",\n\"~  c #00BDBD\",\n\"^  c #16B6C6\",\n\"/  c #18B1C2\",\n\"(  c #15BBCA\",\n\")  c #6C82CF\",\n\"_  c #6D83D1\",\n\"`  c #00C3C3\",\n\"'  c #07C7CC\",\n\"]  c #00CCCC\",\n\"[  c #0FCFD9\",\n\"{  c #10CAD5\",\n\"}  c #00D6D6\",\n\"|  c #0ED3DC\",\n\" . c #00DCDC\",\n\".. c #00E2E2\",\n\"X. c #09E1E7\",\n\"o. c #08E6EB\",\n\"O. c #05EAED\",\n\"+. c #06EEF3\",\n\"@. c #02F3F4\",\n\"#. c #03F6F8\",\n\"$. c #00FFFF\",\n\"%. c None\",\n/* pixels */\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ _ _ ) ) ) J D D D D D S C B B C D D D D D D H K ) _ _ _ _ _ _ ) ) ) _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ _ ) J F S B x u w 6 1 : # + # # + + .     . + + + + + # : 1 6 u u x V S F J ) _ _ _ _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ ) ) G A N p 8 < # O .                                                           + % < 8 p N Z G K _ _ _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ ) _ _ _ J D B i 6 * .                                                                                     O * 6 i B D H ) _ _ ) _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ K D N q : + .                                                                                                     . + : q N D K _ _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ ) J A a 5 #                                                                                                                         # 5 d A J ) _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) _ _ J Z q : o                                                                                                                                     . : w Z J _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ ) A a < .                                                                                                                                                 o < p A ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ D x 5 O                                                                                                                                                             O 6 d D _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) Z w #                                                                                                                                                                         # w Z ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ J B 7 o                                                                                                                                                                                 O 7 B H _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ _ H x < .                                                                                                                                                                                         . < x G _ _ _ _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ G x -                                                                                                                                                                                                     - d H _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ H d -                                                                                                                                                                                                             : x G _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ H x :                                                                                                                                                                                                                     - x H _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) C 1                                                                                                                                                                                                                             5 C ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) D 0 O                                                                                                                                                                                                                                 o q D ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ H d #                                                                                                                                                                                                                                         % d G _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) C <                                                                                                                                                                                                                                                 < C ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ G u O                                                                                                                                                                                                                                                     O u G _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) C <                                                                                                                                                                                                                                                             < C ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ G u O                                                                                                                                                                                                                                                                 O u G _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ C <                                                                                                                                                                                                                                                                         < C _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) M #                                                                                                                                                                                                                                                                             # M ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ H q .                                                                                                                                                                                                                                                                                 . q H _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ S 5                                                                                                                                                                                                                                                                                         5 S _ ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) B *                                                                                                                                                                                                                                                                                             * B ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) x O                                                                                                                                                                                                                                                                                                 O x ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) H a .                                                                                                                                                                                                                                                                                                     . a H ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) H 9                                                                                                                                                                                                                                                                                                             0 J ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ F 7                                                                                                                                                                                                                                                                                                                 6 F ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) S <                                                                                                                                                                                                                                                                                                                     < D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ F <                                                                                                                                                                                                                                                                                                                         < D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                                                                                                                                             < D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%._ ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                                                                                                                                                 < D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                                                                                                                                                     < D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                                                                                                                                                         < D _ ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                                                                                                                                                             < F ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ J 6                                                                                                                                                                                                                                                                                                                                                 6 H ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) J 9                                                                                                                                                                                                                                               . X $ $ 3 e .                                                                                         9 J ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) a                                                                                                                                                                                                                               . $ $ 2 r r z L I ! ` ....O.Y <                                                                                           a ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ x .                                                                                                                                                                                                         .   @ > , r r l L U ! ~  ...O.$.#.$.$.$.$.$.$.#.T p w +                                                                                         . x ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ B O                                                                                                                                                                                         . @ $ > e r k L I ! ! } ..O.#.#.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p 6                                                                                           O B _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ S *                                                                                                                                                                       . @ $ > e r j L L ! ! ]  ...#.#.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p p i *                                                                                           * S _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ H 5                                                                                                                                                     . X $ $ 3 e y L L R ! ] ....#.#.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p p p p 8 .                                                                                           4 H ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) q                                                                                                                                     . $ $ 2 r t z L R ! ` ....@.#.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.@.T p p p p p p p i -                                                                                             q ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ M .                                                                                                                                   > R  ...O.#.#.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p p p p p p p q O                                                                                           . M _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ C #                                                                                                                                   3 ` $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p p p p p p p p p 1                                                                                             # C _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) H <                                                                                                                                   e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.Q p p p p p p p p p p p p w +                                                                                             < G _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) u                                                                                                                                   e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ s p p p p p p p p p p p p p 5                                                                                               i ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ C O                                                                                                                                 e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ a p p p p p p p p p p p p p p i *                                                                                             O C _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ G <                                                                                                                                 e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ s p p p p p p p p p p p p p p p p 8 .                                                                                             < G _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) i                                                                                                                                 y  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ s p p p p p p p p p p p p p p p p p i -                                                                                               i ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ C O                                                                                                                               k @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ s i p p p p p p p p p p p p p p p p p p q o                                                                                             O C _ ) ) ) ) ) ) ) _ ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ G <                                                                                                                             . k @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.Q s p p p p p p p p p p p p p p p p p p p p p 1                                                                                               < G _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ d                                                                                                                               k @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ s p p p p p p p p p p p p p p p p p p p p p p w +                                                                                               d ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ S *                                                                                                                           . k @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.( s i p p p p p p p p p p p p p p p p p p p p p p p 5                                                                                               # D _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) _ ) ) ) ) ) ) ) ) ) 0                                                                                                                           X L @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ g p p p p p p p p p p p p p p p p p p p p p p p p p i *                                                                                               0 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ C O                                                                                                                         X I $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ c p p p p p p p p p p p p p p p p p p p p p p p p p p p 8 .                                                                                             o C _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ J 1                                                                                                                         X I $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ h p p p p p p p p p p p p p p p p p p p p p p p p p p p p p -                                                                                               4 J _ _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ x                                                                                                                         X U #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ c p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q O                                                                                               d _ _ _ ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ G ;                                                                                                                       @ I $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ h p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 1                                                                                               ; H _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ x                                                                                                                       > ! $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ c p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w +                                                                                             . d _ _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) H ;                                                                                                                     > ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.{ g p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5                                                                                               ; H _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ x                                                                                                                     > ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.{ h p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i *                                                                                               d _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) _ ) _ _ H -                                                                                                                   > ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.v p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 8 .                                                                                             : G _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) _ _ _ _ d                                                                                                                   2 ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p -                                                                                               M _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) J <                                                                                                                 e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n w x p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p d 0 .                                                                                             < J _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ B .                                                                                                               e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n p p w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5                                                                                             . B _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) 7                                                                                                               e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n x p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w +                                                                                             7 ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) Z O                                                                                                             e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n p w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 7                                                                                             . Z _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ w                                                                                                             y  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.v p p w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p *                                                                                             w _ _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ D #                                                                                                           k @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n i p w x w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 9 .                                                                                           # D _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ x                                                                                                         . k @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.+.m x w w x x w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p :                                                                                             x _ ) ) ) ) ) ) _ ) ) ) ) ) %.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.) ) _ ) ) ) ) ) ) ) ) ) ) ) 5                                                                                                         k @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p w x w x w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q o                                                                                           5 ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) _ _ A O                                                                                                       k @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.Y x p w x p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 4                                                                                           O A _ _ ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ a                                                                                                     X z @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.Y w w p p w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p u #                                                                                           a _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ K <                                                                                                   X I $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.Y x w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 6                                                                                           1 J _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.\",\n\"%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ Z .                                                                                                 X I $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i *                                                                                         . Z _ ) ) ) _ ) ) ) ) ) ) ) ) %.%.%.%.%.%.\",\n\"%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ w                                                                                                 X I $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 8 .                                                                                         w ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.\",\n\"%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ H :                                                                                               X I $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p <                                                                                         : J _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.\",\n\"%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) _ _ Z o                                                                                             > E #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p a 0 o                                                                                       . A _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.\",\n\"%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) _ _ d                                                                                             > ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.W p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 4                                                                                         d _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.\",\n\"%.%.%.%.%.) ) ) ) ) _ ) ) ) ) ) ) K 5                                                                                           > ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ d p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w +                                                                                       5 K ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.\",\n\"%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) F #                                                                                         > ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ s i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 7                                                                                       # F _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.\",\n\"%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ N                                                                                         , ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ s p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i *                                                                                       N _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.\",\n\"%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ q                                                                                       e } $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p a 9 .                                                                                     q _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.\",\n\"%.%.%.%.) ) ) ) ) ) ) ) ) ) ) _ J :                                                                                     e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ s p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p :                                                                                     : J ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.\",\n\"%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ D #                                                                                   e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$./ s i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q O                                                                                   + S _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.\",\n\"%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ B                                                                                   e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.Q s p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 4                                                                                   . B _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.\",\n\"%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ p                                                                               . t  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.Q p i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w +                                                                                   p _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.\",\n\"%.%.%.) ) ) ) ) ) ) ) ) ) ) ) K 6                                                                               k @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ s x p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 7                                                                                   6 ) ) ) _ ) ) ) ) ) _ ) ) ) %.%.%.\",\n\"%.%.%.) ) ) ) ) ) ) ) ) ) ) _ G *                                                                             k O.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ c p w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i -                                                                                 * G ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) ) _ A O                                                                           k @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ c i x x p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 9 .                                                                               O Z _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) ) _ B                                                                           l @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ g x w w w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p <                                                                                 B _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) ) _ p                                                                       X l @.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ h i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q O                                                                               p ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) ) ) 8                                                                     X U #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ g x w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5                                                                               8 ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) ) K <                                                                   X I $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ g p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w %                                                                             < K ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) ) F #                                                                 X I #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.[ c p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p a 7                                                                             # F ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) _ S O                                                               X I $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.X.b x w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p =                                                                           O S _ ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) _ C                                                               > R #.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n w p p p p p p p p p p p p p p p w x p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 9 .                                                                           C _ ) ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) _ x                                                             > ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n w x p p p p p p p p p p p p p p x w w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p <                                                                           x _ ) ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) _ i                                                           > ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.v x w w p p p p p p p p p p p p p p w x w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w O                                                                         i _ ) ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) _ u                                                         > ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n p p p p p p p p p p p p p w w x p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p a 5                                                                         i _ ) ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) ) 6                                                       > ~ $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n x w p p p p p p p p p p p p x p w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w #                                                                       6 ) ) ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) _ ) ) ) ) ) ) ) K 1                                                     e ] $.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 7                                                                       1 ) ) ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) J :                                                   e  .$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.o.n p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i -                                                                     : H ) ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) _ F #                                                 2 ' +.#.$.#.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.O.n p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 9 .                                                                   + D _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) _ _ D +                                                 & f c n m m Y W W ^ { { | o.O.O.#.$.#.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.Y p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p <                                                                   + F _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) _ D +                                                   ; w p w p p w p p a a s h h c n m m T W W ^ { { | o.O.O.#.#.#.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q +                                                                 + D _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) _ D +                                                   . 5 a a p w x p p p p p p p p i w p i p w p a a s h c c m m m T W W ^ { { | O.O.O.#.$.#.$.$.$.$.$.$.$.$.$.$.$.$.$.$.#.T p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5                                                                 + D _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) _ D +                                                     . 8 p p p p p p p p p p p p p a a p p p p p p p p p p w p w p p p p p a s g g c m n n T W W Q { { [ o.O.O.#.#.#.#.T p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p a u #                                                               + D _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\") ) ) ) ) ) ) ) ) ) ) ) _ D +                                                       % w p p p p p p p p p p p p p p p p p p p p p p p p p a p p p p p p p p p p p p x w w p p p p a d g g c n m m v p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 7                                                               + D _ ) ) ) ) ) ) ) ) ) ) ) ) \",\n\") ) ) ) ) ) ) ) ) ) ) ) _ V .                                                         = u p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i -                                                               B _ ) ) ) ) ) ) ) ) ) ) ) _ \",\n\") ) ) ) ) ) ) ) ) ) ) ) _ B                                                             4 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i 9 .                                                           . B _ ) ) ) ) ) ) ) ) ) ) ) ) \",\n\") ) ) ) ) ) ) ) ) ) ) ) _ B                                                             . 7 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p <                                                             B _ ) ) ) ) ) ) ) ) ) ) ) ) \",\n\") ) _ ) ) ) ) ) ) ) ) ) _ V .                                                             + w p p p p p p p p p p p p p p p p p p p p p s p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w O                                                         . C _ ) ) ) ) ) ) ) ) ) ) ) ) \",\n\") ) ) ) ) ) ) ) ) ) ) ) _ D +                                                               = i a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5                                                         + D ) ) ) ) ) ) ) ) ) ) ) ) ) \",\n\"%.) ) ) ) ) ) ) ) ) ) _ _ D +                                                                 1 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w *                                                       + D _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) _ D #                                                                 . 6 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 7 .                                                     + D _ _ _ ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) _ D +                                                                   O q p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i -                                                     + D _ ) _ ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) _ D +                                                                     = u p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 9 .                                                   + D _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) _ D #                                                                       < p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 6 .                                                   # D _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) _ H :                                                                       . 6 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 9 o                                                     ; H _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) K 4                                                                         o 9 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w #                                                       1 ) ) ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) ) 6                                                                           % w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p u =                                                         6 ) ) ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) _ w                                                                             : p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 1                                                           w _ ) ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) _ i                                                                             . 5 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5 .                                                           i _ _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) _ M                                                                               o q p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 9 .                                                             x _ _ ) ) ) ) ) ) ) ) ) ) ) %.\",\n\"%.) ) ) ) ) ) ) ) ) ) ) ) _ B                                                                                 % w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p a q #                                                               B _ _ ) ) ) ) ) ) ) ) ) ) _ %.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) _ _ S O                                                                                 : i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p u *                                                               + S _ ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) _ F #                                                                                   5 a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i :                                                                 # F ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) ) K <                                                                                   . 9 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5 .                                                                 1 K ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) _ ) ) ) ) ) ) ) ) ) ) ) 8                                                                                     + w a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 7 .                                                                   8 ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) ) _ p                                                                                       - i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w +                                                                     i _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) ) _ B                                                                                         5 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p u *                                                                       N _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.) ) ) ) ) ) ) ) ) ) ) ) _ Z .                                                                                       . 8 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i :                                                                       . A _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.\",\n\"%.%.%.) ) ) ) ) ) ) ) ) ) ) _ G *                                                                                         + q p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5                                                                         * G _ ) ) ) ) ) ) ) ) ) ) ) %.%.%.\",\n\"%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) 6                                                                                           = i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 7 .                                                                         6 ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.\",\n\"%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ p                                                                                             1 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p s p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 0 O                                                                           p _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.\",\n\"%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ B                                                                                             . 8 a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p u %                                                                             B _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.\",\n\"%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ D +                                                                                             + 0 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p ;                                                                             + D _ _ ) ) ) ) ) ) ) ) ) ) ) %.%.%.\",\n\"%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) J <                                                                                               * u p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 1                                                                               : J _ ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.\",\n\"%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ q                                                                                                 < p p p p p p p p p p p i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 6 .                                                                               q _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.\",\n\"%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ N                                                                                                 . 7 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 9 X                                                                                 N _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.\",\n\"%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ D #                                                                                                 O 0 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p u #                                                                                 # D _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.\",\n\"%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) K 5                                                                                                   & u p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p u -                                                                                   5 K ) ) ) ) ) _ ) ) ) ) ) ) %.%.%.%.%.\",\n\"%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ d                                                                                                     < p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i 1                                                                                     d _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.\",\n\"%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ Z O                                                                                                   . 6 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 6 .                                                                                   o A _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.\",\n\"%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) J <                                                                                                     o 9 a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 9 .                                                                                     < J ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.\",\n\"%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ q                                                                                                       % w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q #                                                                                       q _ ) ) ) ) ) ) ) ) ) ) ) _ %.%.%.%.%.%.\",\n\"%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ Z .                                                                                                       : p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i p p p p p p p p p p p p p p p p a i -                                                                                       o Z _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.\",\n\"%.%.%.%.%.%.) ) _ ) ) ) ) ) ) ) ) ) _ J 1                                                                                                         6 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p <                                                                                         < J _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ a                                                                                                         o 9 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5 .                                                                                         a _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ A O                                                                                                         % w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 8 .                                                                                         O A _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.) ) _ ) ) ) ) ) ) ) ) ) ) ) 5                                                                                                           ; i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q +                                                                                           5 ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) M                                                                                                             5 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i *                                                                                             x _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) D #                                                                                                           . 9 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p <                                                                                             % D _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) q                                                                                                             # w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5                                                                                               q ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ Z O                                                                                                             ; p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 8 .                                                                                             O Z ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) 7                                                                                                               4 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q O                                                                                               7 ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ B .                                                                                                             . 7 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p s p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p a u #                                                                                               . B _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) J <                                                                                                               + w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i ;                                                                                                 < J ) ) ) ) ) ) ) _ ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ x .                                                                                                               - u p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 4                                                                                                 . x _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) G -                                                                                                                 1 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 7 .                                                                                                 - J _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ d .                                                                                                               . 7 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p a 9 O                                                                                                   d _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) G ;                                                                                                                 O q p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w %                                                                                                   ; G ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ d .                                                                                                                 * u p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i -                                                                                                     x _ _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) H ;                                                                                                                   < p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i p p p p p p p p p p p p p p p p p p p p p p p p p p 4                                                                                                     ; G _ _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ x                                                                                                                   . 6 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 7 .                                                                                                     x _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) J 4                                                                                                                   O q p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i p p p p p p p p p p p p p 9 o                                                                                                     4 H _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ C .                                                                                                                   = u p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w #                                                                                                     . C _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) 0                                                                                                                     : p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i =                                                                                                       0 ) _ _ ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) _ ) _ D #                                                                                                                   . 5 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p <                                                                                                       * D _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ d .                                                                                                                   o 9 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 6 .                                                                                                       d _ ) ) ) ) ) ) ) ) ) ) ) _ ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) G <                                                                                                                     % w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 8 .                                                                                                       < G _ ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ C O                                                                                                                     < p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q #                                                                                                       O C _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) i                                                                                                                       5 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p u &                                                                                                         i ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) _ G <                                                                                                                     O 8 a a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p <                                                                                                         < G ) ) ) ) ) ) ) _ ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ C O                                                                                                                     + 5 8 w i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5                                                                                                         O C _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) i                                                                                                                           O - 5 9 w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 8 .                                                                                                         u ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ G <                                                                                                                               . + - 6 q i p a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p q +                                                                                                         < H ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ C #                                                                                                                                     . # : 6 q i p a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p u *                                                                                                         # C _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) _ ) ) ) ) ) ) _ M .                                                                                                                                           o * < 7 q p a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i :                                                                                                         . M _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) q                                                                                                                                                   o * 4 8 w p a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5                                                                                                           q ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) H 5                                                                                                                                                         O = 4 0 w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 8 .                                                                                                         5 H ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ S *                                                                                                                                                               + - 5 9 i p a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 0 O                                                                                                         * S _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ B O                                                                                                                                                                   . # : 6 q u p a p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w %                                                                                                         O B _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) x .                                                                                                                                                                         . # : 7 q i p a p p p p p p p p p p p p p p p p p p p p p p p p p p i ;                                                                                                         . x _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) _ ) ) ) ) ) ) ) ) _ _ a                                                                                                                                                                                 O * < 8 w p p p p p p p p p p p p p p p p p p p p p p p p p 4                                                                                                           d ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ J 0                                                                                                                                                                                       O = 1 8 w p a p p p p p p p p p p p p p p p p p p 7 .                                                                                                         9 J _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) J 6                                                                                                                                                                                             + - 5 9 w p p p p p p p p p p p p p p p 9 o                                                                                                         6 J ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                 . + ; 6 q i p p p p p p p p p p w #                                                                                                         < D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) _ ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                       . # : 6 q p p p p p p i ;                                                                                                         < D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                             . * < 7 w i p 4                                                                                                         < D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                                   o * ; .                                                                                                       < D _ ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                                                                                                                                             < D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                                                                                                                                         < D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D <                                                                                                                                                                                                                                                                                                                     1 D _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ D 6                                                                                                                                                                                                                                                                                                                 6 F _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) J 8 .                                                                                                                                                                                                                                                                                                           9 H _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ J a .                                                                                                                                                                                                                                                                                                     . a J ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) x o                                                                                                                                                                                                                                                                                                 o x ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ B *                                                                                                                                                                                                                                                                                             * B ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ S 5                                                                                                                                                                                                                                                                                         5 S _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ H q .                                                                                                                                                                                                                                                                                 . q H _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) M #                                                                                                                                                                                                                                                                             # M ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ C <                                                                                                                                                                                                                                                                         < C _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ H u O                                                                                                                                                                                                                                                                 O i G _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) C <                                                                                                                                                                                                                                                             < C ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ G u O                                                                                                                                                                                                                                                     O u G _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) C <                                                                                                                                                                                                                                                 < C ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ H d #                                                                                                                                                                                                                                         # d H _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ D 0 .                                                                                                                                                                                                                                 o 0 S _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) C 1 .                                                                                                                                                                                                                           1 C _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) _ _ H x -                                                                                                                                                                                                                   . - x H _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ G x :                                                                                                                                                                                                             - x G _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ H d : .                                                                                                                                                                                                   : x G _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ H d < .                                                                                                                                                                                         . < d H _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ J B 7 O                                                                                                                                                                                 O 7 B H _ _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) Z q #                                                                                                                                                                         # q Z ) _ ) _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) D x 5 O                                                                                                                                                             O 5 x D ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ K A d < o                                                                                                                                                 . 1 p A ) _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) _ _ J Z q < o                                                                                                                                     o : q Z J _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ ) J A d 5 #                                                                                                                         # 5 d A J _ _ _ ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ ) D N q : + .                                                                                                     . + ; q N F K _ _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ ) J D B i 6 * o                                                                                     . * 6 i B D H ) _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ _ K G A N p 8 < % O                                                             O % < 8 p N A G ) _ _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ _ _ J F S B M u u 6 1 : # + + + + + .     . + + + + + + : 4 6 u i x V S G J ) _ _ _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ _ _ _ ) K J F D D D D D B B B V D D D D D F J K ) _ _ _ _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ) ) ) ) _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) _ _ ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) _ ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\",\n\"%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.) ) ) ) ) ) %.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.%.\"\n};\n"
  },
  {
    "path": "share/pixmaps/bitcoin32.xpm",
    "content": "/* XPM */\nstatic char *bitcoin__[] = {\n/* columns rows colors chars-per-pixel */\n\"32 32 161 2 \",\n\"   c black\",\n\".  c #000001\",\n\"X  c #000101\",\n\"o  c #010101\",\n\"O  c #010102\",\n\"+  c #000303\",\n\"@  c #020203\",\n\"#  c #020204\",\n\"$  c #020304\",\n\"%  c #030305\",\n\"&  c #000404\",\n\"*  c #010506\",\n\"=  c #030406\",\n\"-  c #030407\",\n\";  c #000606\",\n\":  c #040407\",\n\">  c #040508\",\n\",  c #040509\",\n\"<  c #050609\",\n\"1  c #05090D\",\n\"2  c #07080D\",\n\"3  c #000E0E\",\n\"4  c #08090E\",\n\"5  c #08090F\",\n\"6  c #080A10\",\n\"7  c #090A11\",\n\"8  c #090B11\",\n\"9  c #0B0A12\",\n\"0  c #0A0C12\",\n\"q  c #0A0C13\",\n\"w  c #0B0D15\",\n\"e  c #0C0E17\",\n\"r  c #0F121C\",\n\"t  c #001919\",\n\"y  c #111420\",\n\"u  c #111521\",\n\"i  c #121623\",\n\"p  c #131624\",\n\"a  c #161A2A\",\n\"s  c #181C2D\",\n\"d  c #181C2E\",\n\"f  c #191E30\",\n\"g  c #191E31\",\n\"h  c #002727\",\n\"j  c #1B2033\",\n\"k  c #1C2236\",\n\"l  c #1D2338\",\n\"z  c #1E2339\",\n\"x  c #1E243A\",\n\"c  c #1F263C\",\n\"v  c #003838\",\n\"b  c #003939\",\n\"n  c #20263D\",\n\"m  c #232A44\",\n\"M  c #242B45\",\n\"N  c #252C46\",\n\"B  c #252D47\",\n\"V  c #262D49\",\n\"C  c #272E4A\",\n\"Z  c #282F4C\",\n\"A  c #2A324F\",\n\"S  c #2A3250\",\n\"D  c #2B3352\",\n\"F  c #2C3454\",\n\"G  c #2C3554\",\n\"H  c #2E3759\",\n\"J  c #2F385A\",\n\"K  c #31375A\",\n\"L  c #30395B\",\n\"P  c #333D61\",\n\"I  c #333D62\",\n\"U  c #343D63\",\n\"Y  c #343E63\",\n\"T  c #353F65\",\n\"R  c #004242\",\n\"E  c #06474B\",\n\"W  c #004949\",\n\"Q  c #004D4D\",\n\"!  c #005151\",\n\"~  c #005959\",\n\"^  c #1C5266\",\n\"/  c #364067\",\n\"(  c #374168\",\n\")  c #374169\",\n\"_  c #37426A\",\n\"`  c #3A416A\",\n\"'  c #3A416B\",\n\"]  c #38436B\",\n\"[  c #3A426B\",\n\"{  c #39426C\",\n\"}  c #38436C\",\n\"|  c #39436C\",\n\" . c #39436D\",\n\".. c #3A426C\",\n\"X. c #3B426C\",\n\"o. c #3A436C\",\n\"O. c #39446C\",\n\"+. c #39446D\",\n\"@. c #39456D\",\n\"#. c #39446E\",\n\"$. c #39456E\",\n\"%. c #3A456E\",\n\"&. c #3A456F\",\n\"*. c #3A466F\",\n\"=. c #006161\",\n\"-. c #006A6A\",\n\";. c #036A6C\",\n\":. c #2B7392\",\n\">. c #2A7795\",\n\",. c #297A97\",\n\"<. c #2A7A98\",\n\"1. c #287D9A\",\n\"2. c #4D5C93\",\n\"3. c #4D5D93\",\n\"4. c #52639E\",\n\"5. c #53639E\",\n\"6. c #5364A0\",\n\"7. c #5465A1\",\n\"8. c #5C6FB1\",\n\"9. c #657AC2\",\n\"0. c #677CC5\",\n\"q. c #687DC7\",\n\"w. c #697FCA\",\n\"e. c #009C9C\",\n\"r. c #27819C\",\n\"t. c #26839E\",\n\"y. c #25849F\",\n\"u. c #1E9CB2\",\n\"i. c #2488A2\",\n\"p. c #238BA5\",\n\"a. c #228FA8\",\n\"s. c #1AA9BC\",\n\"d. c #00B6B6\",\n\"f. c #16B6C6\",\n\"g. c #6C82CF\",\n\"h. c #6C83D0\",\n\"j. c #6D83D0\",\n\"k. c #6D83D1\",\n\"l. c #6D84D2\",\n\"z. c #6E84D2\",\n\"x. c #6E84D3\",\n\"c. c #6E85D3\",\n\"v. c #00C9C9\",\n\"b. c #00D9D9\",\n\"n. c #00DEDE\",\n\"m. c #00E3E3\",\n\"M. c #00E7E7\",\n\"N. c #08E1E7\",\n\"B. c #07E8ED\",\n\"V. c #06EAEF\",\n\"C. c #00ECEC\",\n\"Z. c #00EFEF\",\n\"A. c #02EFF0\",\n\"S. c #06ECF0\",\n\"D. c #05EEF2\",\n\"F. c #05EFF3\",\n\"G. c #04F1F4\",\n\"H. c #04F3F5\",\n\"J. c #00F4F4\",\n\"K. c cyan\",\n\"L. c None\",\n/* pixels */\n\"L.L.L.L.L.L.L.L.L.L.L.L.j.l.x.x.x.x.l.j.L.L.L.L.L.L.L.L.L.L.L.L.\",\n\"L.L.L.L.L.L.L.L.L.j.l.j.0.8.4.3.3.4.8.0.j.l.j.L.L.L.L.L.L.L.L.L.\",\n\"L.L.L.L.L.L.L.L.j.w.4.P f w , o o , w f P 4.w.l.L.L.L.L.L.L.L.L.\",\n\"L.L.L.L.L.L.j.g.7.B 2 o o o o o o o o o o 2 B 7.j.j.L.L.L.L.L.L.\",\n\"L.L.L.L.L.j.w.$.8 o o o o o o o o o o o o o o 8 $.q.j.L.L.L.L.L.\",\n\"L.L.L.L.j.9.F # o o o o o o o o o o o o o o o o # G 9.j.L.L.L.L.\",\n\"L.L.L.j.w.G o o o o o o o o % 3 t h v Q E 2 o o o o G w.j.L.L.L.\",\n\"L.L.L.g.$.o o o o o o o v e.d.v.b.M.J.N.:.l o o o o # $.g.L.L.L.\",\n\"L.L.l.7.8 o o o o o o R b.K.K.K.K.K.B.>.o.U e o o o o 8 7.l.L.L.\",\n\"L.j.w.B o o o o o o W n.K.K.K.K.K.S.,.o.o.$.B o o o o o B w.j.L.\",\n\"L.j.6.2 o o o o o ! m.K.K.K.K.K.S.<.o.o.$.o./ u o o o o 2 6.l.L.\",\n\"L.j.P o o o o o ~ M.K.K.K.K.K.F.t.o.o.$.o.$.$.D % o o o o P j.L.\",\n\"j.0.f o o o o =.C.K.K.K.K.K.F.y.o.#.#.#.$.$.] ] s o o o o f 0.j.\",\n\"x.8.w o o o -.Z.K.K.K.K.K.G.i.o.} o.#.#.] #.$.$.J 2 o o o w 8.j.\",\n\"x.4.< o o ;.J.K.K.K.K.K.G.p.$.] $.o.] $.#.#.$.o.$.l o o o < 4.x.\",\n\"x.3.% o % ^ <.t.a.u.s.f.i.$.O.$.o.$.] $.#.#.o.$.o.T w o o # 3.x.\",\n\"x.3.o o o 8 K o.T ] ] o.o.] ] #.#.$.$.] #.#.] ] $.$.m o o o 3.x.\",\n\"x.4.< o o o u / &.$.o.o.$.$.$.#.#.] o.$.#.#.$.$.$.) s o o < 4.x.\",\n\"l.8.w o o o o k o.o.] $.o.#.$.o.$.$.$.o.$.o.$.o.o.c o o o w 8.l.\",\n\"l.0.f o o o o # Z *.$.$.] #.o.$.] ] #.#.o.$.o.$.Z , o o o f 0.l.\",\n\"L.j.U o o o o o 8 H $.o.#.#.] ] $.o.#.#.] $.$.H 8 o o o o P j.L.\",\n\"L.l.4.2 o o o o o y T *.o.$.$.$.o.$.o.$.$.$.P r o o o o 2 4.l.L.\",\n\"L.j.w.B o o o o o o g o.$.o.#.o.#.$.$.o.] ) a o o o o o V w.j.L.\",\n\"L.L.l.7.8 o o o o o # N ] $.$.$.#.] ] $.$.l o o o o o w 6.l.L.L.\",\n\"L.L.L.g.$.o o o o o o % u l D P ] $.$.$.V # o o o o # $.g.L.L.L.\",\n\"L.L.L.j.w.F o o o o o o o o # 2 p c F D 8 o o o o o F w.j.L.L.L.\",\n\"L.L.L.L.j.9.D # o o o o o o o o o o # < o o o o o D 9.j.L.L.L.L.\",\n\"L.L.L.L.L.j.w.*.8 o o o o o o o o o o o o o o q *.w.j.L.L.L.L.L.\",\n\"L.L.L.L.L.L.j.g.7.B 2 o o o o o o o o o o 2 N 7.g.j.L.L.L.L.L.L.\",\n\"L.L.L.L.L.L.L.L.l.w.6.P d w , # o < w d P 6.w.j.L.L.L.L.L.L.L.L.\",\n\"L.L.L.L.L.L.L.L.L.j.l.j.0.8.4.3.3.4.8.0.j.l.j.L.L.L.L.L.L.L.L.L.\",\n\"L.L.L.L.L.L.L.L.L.L.L.L.j.l.x.x.x.l.l.j.L.L.L.L.L.L.L.L.L.L.L.L.\"\n};\n"
  },
  {
    "path": "share/pixmaps/bitcoin64.xpm",
    "content": "/* XPM */\nstatic char *bitcoin__[] = {\n/* columns rows colors chars-per-pixel */\n\"64 64 98 2 \",\n\"   c #000000\",\n\".  c #000807\",\n\"X  c #05060A\",\n\"o  c #050A0D\",\n\"O  c #090B11\",\n\"+  c #0D0F18\",\n\"@  c #001313\",\n\"#  c #0D111A\",\n\"$  c #001A1A\",\n\"%  c #10131E\",\n\"&  c #131724\",\n\"*  c #141826\",\n\"=  c #161B2A\",\n\"-  c #181D2F\",\n\";  c #1A1F31\",\n\":  c #002525\",\n\">  c #002B2B\",\n\",  c #1C2236\",\n\"<  c #1E243A\",\n\"1  c #003434\",\n\"2  c #003A3A\",\n\"3  c #20263D\",\n\"4  c #242B45\",\n\"5  c #272E4A\",\n\"6  c #282F4C\",\n\"7  c #29314E\",\n\"8  c #2B3453\",\n\"9  c #2E3759\",\n\"0  c #2F385A\",\n\"q  c #303A5C\",\n\"w  c #333D62\",\n\"e  c #004343\",\n\"r  c #004B4B\",\n\"t  c #005151\",\n\"y  c #005C5C\",\n\"u  c #364067\",\n\"i  c #374269\",\n\"p  c #39446D\",\n\"a  c #374C73\",\n\"s  c #3C4974\",\n\"d  c #355177\",\n\"f  c #34567B\",\n\"g  c #325A7E\",\n\"h  c #006262\",\n\"j  c #016868\",\n\"k  c #1C667A\",\n\"l  c #007474\",\n\"z  c #007878\",\n\"x  c #315F82\",\n\"c  c #137886\",\n\"v  c #2F6587\",\n\"b  c #2D6B8B\",\n\"n  c #316083\",\n\"m  c #2C708F\",\n\"M  c #2B7392\",\n\"N  c #297895\",\n\"B  c #277F9B\",\n\"V  c #287C99\",\n\"C  c #475587\",\n\"Z  c #475588\",\n\"A  c #48568A\",\n\"S  c #4D5D94\",\n\"D  c #53649F\",\n\"F  c #5364A0\",\n\"G  c #5668A6\",\n\"H  c #5F72B5\",\n\"J  c #6176BC\",\n\"K  c #657AC2\",\n\"L  c #687DC8\",\n\"P  c #008D8D\",\n\"I  c #009898\",\n\"U  c #248DA7\",\n\"Y  c #2097AE\",\n\"T  c #00A4A4\",\n\"R  c #1CA4B8\",\n\"E  c #00B4B4\",\n\"W  c #00B8B8\",\n\"Q  c #18B0C1\",\n\"!  c #14BDCB\",\n\"~  c #6C82CF\",\n\"^  c #6D84D1\",\n\"/  c #00C4C4\",\n\"(  c #00CBCB\",\n\")  c #14C1CF\",\n\"_  c #0FCFDA\",\n\"`  c #12C4D1\",\n\"'  c #10C9D5\",\n\"]  c #00D2D2\",\n\"[  c #0DD3DD\",\n\"{  c #00DBDB\",\n\"}  c #0BDCE3\",\n\"|  c #00E6E6\",\n\" . c #08E4EA\",\n\".. c #03EAEC\",\n\"X. c #06ECF1\",\n\"o. c #01F4F5\",\n\"O. c #00FFFF\",\n\"+. c None\",\n/* pixels */\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ^ ~ ~ ~ ~ ~ ^ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ~ ~ ~ ^ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.^ ~ ~ ~ ~ ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ ~ ~ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ~ ^ ^ ^ L H F C s i w w i s A D J L ^ ^ ~ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ^ ^ ~ J S w , # X                 X # , w S J ~ ^ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ~ ^ L G w * X                                 X * w G L ^ ~ ~ ~ ^ +.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ^ ~ D 7 O                                             O 7 F ~ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ^ ^ H 0 O                                                     O q H ^ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.~ ~ ~ ^ L A &                                                             * C ~ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.~ ~ ^ ^ K w X                                                                 X w K ^ ~ ^ ~ +.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.~ ~ ~ ^ J 5                                                                         4 J ^ ~ ~ ~ +.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.~ ~ ^ H <                                                                             < H ^ ~ ~ +.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.^ ~ ^ J <                                                           .                     < J ~ ~ ~ +.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.~ ~ ^ K 4                                         X o $ : 2 r h z P T c #                     5 K ~ ^ ~ +.+.+.+.+.+.\",\n\"+.+.+.+.+.~ ~ ~ ~ w                               o e y l P T E ( { | o.O.O.O.O.` f 6 X                     w ~ ~ ~ ~ +.+.+.+.+.\",\n\"+.+.+.+.+.~ ~ ^ Z X                             @ I o.O.O.O.O.O.O.O.O.O.O.O.O.) f p p =                     X A ^ ~ ~ +.+.+.+.+.\",\n\"+.+.+.+.~ ~ ^ H *                             @ T O.O.O.O.O.O.O.O.O.O.O.O.O.` f p p p 9 o                     & H ^ ~ ~ +.+.+.+.\",\n\"+.+.+.+.~ ~ ~ q                             $ T O.O.O.O.O.O.O.O.O.O.O.O.O.' f p p p p p ,                       0 ~ ~ ~ +.+.+.+.\",\n\"+.+.+.~ ~ ^ D O                           $ E O.O.O.O.O.O.O.O.O.O.O.O.O.' g p p p p p p w O                     O F ^ ~ ~ +.+.+.\",\n\"+.+.+.~ ~ ~ 7                           : W O.O.O.O.O.O.O.O.O.O.O.O.O._ g p p p p p p p p 4                       7 ~ ~ ~ +.+.+.\",\n\"+.+.~ ~ ^ G O                         > / O.O.O.O.O.O.O.O.O.O.O.O.O.[ x i p p p p p p p p i #                     O G ^ ~ ~ +.+.\",\n\"+.+.~ ~ ~ w                         > / O.O.O.O.O.O.O.O.O.O.O.O.O.[ x p p p p p p p p p p p 8 X                     w ^ ~ ~ +.+.\",\n\"+.+.^ ~ J &                       1 ( O.O.O.O.O.O.O.O.O.O.O.O.O.} n p p p p p p p p p p p p p =                     * J ~ ~ +.+.\",\n\"+.~ ^ ^ S X                     2 ] O.O.O.O.O.O.O.O.O.O.O.O.O.} n p i p p p p p p p p p p p p 0 o                   X S ^ ^ ~ +.\",\n\"+.~ ^ ^ w                     e { O.O.O.O.O.O.O.O.O.O.O.O.O.} b p p p p p p p p p p p p p p p p ,                     w ^ ~ ~ +.\",\n\"+.~ ~ L ,                   r { O.O.O.O.O.O.O.O.O.O.O.O.O.} b p p p p p p p p p p p p p p p p p w +                   , L ~ ~ +.\",\n\"+.~ ^ H #                 t | O.O.O.O.O.O.O.O.O.O.O.O.O. .m p p p p p p p p p p p p p p p p p p p 4                   # H ^ ^ +.\",\n\"~ ~ ^ D X               y | O.O.O.O.O.O.O.O.O.O.O.O.O. .m p p p p p p p p p p p p p p p p p p p p u %                 X F ^ ~ ~ \",\n\"~ ~ ^ A             X h ..O.O.O.O.O.O.O.O.O.O.O.O.O. .N p p p p p p p p p p p p p p p p p p p p p p 8 X                 Z ^ ^ ~ \",\n\"~ ~ ^ s             j ..O.O.O.O.O.O.O.O.O.O.O.O.O. .M p p p p p p p p p p p p p p p p p p p p p p p i =                 s ^ ^ ~ \",\n\"^ ~ ^ i           o k U Y R Q ! ' [ }  .X.o.o.o.X.V p p p p p p p p p p p p p p p p p p p p p p p p p 0 o               i ^ ~ ~ \",\n\"~ ~ ^ w             # w i i p p p a d g n b M U b p p p p p p p p p p p p p p p p p p p p p p p p p p p ,               w ^ ~ ~ \",\n\"^ ^ ^ w               ; p p p p p p i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w +             w ^ ^ ~ \",\n\"~ ^ ^ i                 4 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 3             i ^ ~ ~ \",\n\"~ ~ ^ s                 o 8 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p a w &             s ^ ~ ~ \",\n\"~ ~ ^ Z                   % w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p i =               A ^ ~ ~ \",\n\"~ ~ ^ D X                   = i p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p <               X F ^ ~ ~ \",\n\"+.~ ^ H #                     4 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 5 X               # J ~ ~ +.\",\n\"+.~ ^ L ,                     X 8 p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p 0 O                 , L ~ ~ +.\",\n\"+.~ ~ ^ w                       + w p p p p p p p p p p p p p p p p p p p p p p p p p p p p p p w #                   w ^ ~ ~ +.\",\n\"+.~ ~ ^ S X                       = i p p p p p p p p p p p p p p p p p p p p p p p p p p p p i =                   X S ^ ~ ~ +.\",\n\"+.+.~ ^ J =                         < p p p p p p p p p p p p p p p p p p p p p p p p p p p p <                     * J ~ ~ +.+.\",\n\"+.+.~ ~ ^ w                         X 7 p p p p p p p p p p p p p p p p p p p p p p p p p p 4 X                     w ^ ~ ~ +.+.\",\n\"+.+.~ ~ ^ G O                         + w p p p p p p p p p p p p p p p p p p p p p p p p 8 o                     O G ^ ~ ~ +.+.\",\n\"+.+.+.~ ~ ~ 6                           * i p p p p p p p p p p p p p p p p p p p p p p w #                       7 ~ ~ ^ +.+.+.\",\n\"+.+.+.~ ~ ^ D O                           < p p p p p p p p p p p p p p p p p p p p p i &                       O D ^ ~ ~ +.+.+.\",\n\"+.+.+.+.~ ~ ~ 0                           X 7 p p p p p p p p p p p p p p p p p p p i ,                         q ~ ~ ~ +.+.+.+.\",\n\"+.+.+.+.~ ~ ^ H &                           + 0 p p p p p p p p p p p p p p p p p a 4                         & H ^ ~ ~ +.+.+.+.\",\n\"+.+.+.+.+.~ ^ ^ A X                           O = 4 9 w p p p p p p p p p p p p p 8 X                       X A ^ ^ ~ +.+.+.+.+.\",\n\"+.+.+.+.+.~ ~ ~ ~ w                                 X # - 5 q i s p p p p p p p q +                         w ~ ~ ~ ~ +.+.+.+.+.\",\n\"+.+.+.+.+.+.~ ~ ~ K 4                                       X # ; 6 q i p p p i &                         4 K ~ ~ ~ +.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.~ ~ ^ J <                                             X & < 8 q ,                         < J ^ ~ ~ +.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.~ ^ ^ H <                                                   O                         < H ^ ~ ^ +.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.~ ~ ~ ^ J 4                                                                         4 J ^ ~ ~ ~ +.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.~ ~ ~ ^ K w X                                                                 X w K ^ ~ ~ ~ +.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.~ ~ ~ ~ ~ A &                                                             & A ~ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ^ H q O                                                     O 0 H ^ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ^ ^ ~ D 5 O                                             O 6 D ~ ^ ^ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ~ ^ ~ G w * X                                 X * w G ~ ^ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ~ ^ ~ J S w , % X                 X # , w S J ^ ^ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ~ ^ ^ ^ L J D A s i w w i s A D J K ^ ^ ^ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ~ ~ ~ ~ ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ ~ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ~ ~ ~ ~ ~ ~ ^ ~ ~ ~ ~ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.\",\n\"+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.~ ~ ~ ~ ~ ~ ~ ~ ~ ~ +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.\"\n};\n"
  },
  {
    "path": "share/qt/Info.plist.in",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist SYSTEM \"file://localhost/System/Library/DTDs/PropertyList.dtd\">\n<plist version=\"0.9\">\n<dict>\n  <key>LSMinimumSystemVersion</key>\n  <string>10.8.0</string>\n\n  <key>LSArchitecturePriority</key>\n  <array>\n    <string>x86_64</string>\n  </array>\n\n  <key>CFBundleIconFile</key>\n  <string>bitcoin.icns</string>\n\n  <key>CFBundlePackageType</key>\n  <string>APPL</string>\n\n  <key>CFBundleGetInfoString</key>\n  <string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@, Copyright © 2009-@COPYRIGHT_YEAR@ @COPYRIGHT_HOLDERS_FINAL@</string>\n\n  <key>CFBundleShortVersionString</key>\n  <string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@</string>\n\n  <key>CFBundleVersion</key>\n  <string>@CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@</string>\n\n  <key>CFBundleSignature</key>\n  <string>????</string>\n\n  <key>CFBundleExecutable</key>\n  <string>Sugarchain-Qt</string>\n  \n  <key>CFBundleName</key>\n  <string>Sugarchain-Qt</string>\n\n  <key>LSHasLocalizedDisplayName</key>\n  <true/>\n\n  <key>CFBundleIdentifier</key>\n  <string>org.sugarchainfoundation.Sugarchain-Qt</string>\n\n  <key>CFBundleURLTypes</key>\n  <array>\n    <dict>\n      <key>CFBundleTypeRole</key>\n      <string>Editor</string>\n      <key>CFBundleURLName</key>\n      <string>org.sugarchain.SugarchainPayment</string>\n      <key>CFBundleURLSchemes</key>\n      <array>\n        <string>sugarchain</string>\n      </array>\n    </dict>\n  </array>\n\n  <key>UTExportedTypeDeclarations</key>\n  <array>\n    <dict>\n      <key>UTTypeIdentifier</key>\n      <string>org.sugarchain.paymentrequest</string>\n      <key>UTTypeDescription</key>\n      <string>Sugarchain payment request</string>\n      <key>UTTypeConformsTo</key>\n      <array>\n        <string>public.data</string>\n      </array>\n      <key>UTTypeTagSpecification</key>\n      <dict>\n        <key>public.mime-type</key>\n        <string>application/x-sugarchain-payment-request</string>\n        <key>public.filename-extension</key>\n        <array>\n          <string>sugarchainpaymentrequest</string>\n        </array>\n      </dict>\n    </dict>\n  </array>\n\n  <key>CFBundleDocumentTypes</key>\n  <array>\n    <dict>\n      <key>CFBundleTypeRole</key>\n      <string>Editor</string>\n      <key>LSItemContentTypes</key>\n      <array>\n        <string>org.sugarchain.paymentrequest</string>\n      </array>\n      <key>LSHandlerRank</key>\n      <string>Owner</string>\n    </dict>\n  </array>\n\n  <key>NSPrincipalClass</key>\n    <string>NSApplication</string>\n\n  <key>NSHighResolutionCapable</key>\n    <string>True</string>\n\n  <key>LSAppNapIsDisabled</key>\n    <string>True</string>\n  \n  <key>LSApplicationCategoryType</key>\n    <string>public.app-category.finance</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "share/qt/extract_strings_qt.py",
    "content": "#!/usr/bin/env python\n# Copyright (c) 2012-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n'''\nExtract _(\"...\") strings for translation and convert to Qt stringdefs so that\nthey can be picked up by Qt linguist.\n'''\nfrom __future__ import division,print_function,unicode_literals\nfrom subprocess import Popen, PIPE\nimport operator\nimport os\nimport sys\n\nOUT_CPP=\"qt/bitcoinstrings.cpp\"\nEMPTY=['\"\"']\n\ndef parse_po(text):\n    \"\"\"\n    Parse 'po' format produced by xgettext.\n    Return a list of (msgid,msgstr) tuples.\n    \"\"\"\n    messages = []\n    msgid = []\n    msgstr = []\n    in_msgid = False\n    in_msgstr = False\n\n    for line in text.split('\\n'):\n        line = line.rstrip('\\r')\n        if line.startswith('msgid '):\n            if in_msgstr:\n                messages.append((msgid, msgstr))\n                in_msgstr = False\n            # message start\n            in_msgid = True\n\n            msgid = [line[6:]]\n        elif line.startswith('msgstr '):\n            in_msgid = False\n            in_msgstr = True\n            msgstr = [line[7:]]\n        elif line.startswith('\"'):\n            if in_msgid:\n                msgid.append(line)\n            if in_msgstr:\n                msgstr.append(line)\n\n    if in_msgstr:\n        messages.append((msgid, msgstr))\n\n    return messages\n\nfiles = sys.argv[1:]\n\n# xgettext -n --keyword=_ $FILES\nXGETTEXT=os.getenv('XGETTEXT', 'xgettext')\nif not XGETTEXT:\n    print('Cannot extract strings: xgettext utility is not installed or not configured.',file=sys.stderr)\n    print('Please install package \"gettext\" and re-run \\'./configure\\'.',file=sys.stderr)\n    sys.exit(1)\nchild = Popen([XGETTEXT,'--output=-','-n','--keyword=_'] + files, stdout=PIPE)\n(out, err) = child.communicate()\n\nmessages = parse_po(out.decode('utf-8'))\n\nf = open(OUT_CPP, 'w')\nf.write(\"\"\"\n\n#include <QtGlobal>\n\n// Automatically generated by extract_strings_qt.py\n#ifdef __GNUC__\n#define UNUSED __attribute__((unused))\n#else\n#define UNUSED\n#endif\n\"\"\")\nf.write('static const char UNUSED *bitcoin_strings[] = {\\n')\nf.write('QT_TRANSLATE_NOOP(\"bitcoin-core\", \"%s\"),\\n' % (os.getenv('PACKAGE_NAME'),))\nf.write('QT_TRANSLATE_NOOP(\"bitcoin-core\", \"%s\"),\\n' % (os.getenv('COPYRIGHT_HOLDERS'),))\nif os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION') != os.getenv('PACKAGE_NAME'):\n    f.write('QT_TRANSLATE_NOOP(\"bitcoin-core\", \"%s\"),\\n' % (os.getenv('COPYRIGHT_HOLDERS_SUBSTITUTION'),))\nmessages.sort(key=operator.itemgetter(0))\nfor (msgid, msgstr) in messages:\n    if msgid != EMPTY:\n        f.write('QT_TRANSLATE_NOOP(\"bitcoin-core\", %s),\\n' % ('\\n'.join(msgid)))\nf.write('};\\n')\nf.close()\n"
  },
  {
    "path": "share/rpcauth/README.md",
    "content": "RPC Tools\n---------------------\n\n### [RPCAuth](/share/rpcauth) ###\n\nCreate login credentials for a JSON-RPC user.\n\nUsage:\n\n    ./rpcauth.py <username>\n"
  },
  {
    "path": "share/rpcauth/rpcauth.py",
    "content": "#!/usr/bin/env python\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying \n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nimport hashlib\nimport sys\nimport os\nfrom random import SystemRandom\nimport base64\nimport hmac\n\nif len(sys.argv) < 2:\n    sys.stderr.write('Please include username as an argument.\\n')\n    sys.exit(0)\n\nusername = sys.argv[1]\n\n#This uses os.urandom() underneath\ncryptogen = SystemRandom()\n\n#Create 16 byte hex salt\nsalt_sequence = [cryptogen.randrange(256) for i in range(16)]\nhexseq = list(map(hex, salt_sequence))\nsalt = \"\".join([x[2:] for x in hexseq])\n\n#Create 32 byte b64 password\npassword = base64.urlsafe_b64encode(os.urandom(32))\n\ndigestmod = hashlib.sha256\n\nif sys.version_info.major >= 3:\n    password = password.decode('utf-8')\n    digestmod = 'SHA256'\n \nm = hmac.new(bytearray(salt, 'utf-8'), bytearray(password, 'utf-8'), digestmod)\nresult = m.hexdigest()\n\nprint(\"String to be appended to bitcoin.conf:\")\nprint(\"rpcauth=\"+username+\":\"+salt+\"$\"+result)\nprint(\"Your password:\\n\"+password)\n"
  },
  {
    "path": "share/setup.nsi.in",
    "content": "Name \"@PACKAGE_NAME@ (@WINDOWS_BITS@-bit)\"\n\nRequestExecutionLevel highest\nSetCompressor /SOLID lzma\n\n# General Symbol Definitions\n!define REGKEY \"SOFTWARE\\$(^Name)\"\n!define VERSION @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_REVISION@\n!define COMPANY \"@PACKAGE_NAME@ project\"\n!define URL @PACKAGE_URL@\n\n# MUI Symbol Definitions\n!define MUI_ICON \"@abs_top_srcdir@/share/pixmaps/bitcoin.ico\"\n!define MUI_WELCOMEFINISHPAGE_BITMAP \"@abs_top_srcdir@/share/pixmaps/nsis-wizard.bmp\"\n!define MUI_HEADERIMAGE\n!define MUI_HEADERIMAGE_RIGHT\n!define MUI_HEADERIMAGE_BITMAP \"@abs_top_srcdir@/share/pixmaps/nsis-header.bmp\"\n!define MUI_FINISHPAGE_NOAUTOCLOSE\n!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM\n!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}\n!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup\n!define MUI_STARTMENUPAGE_DEFAULTFOLDER \"@PACKAGE_NAME@\"\n!define MUI_FINISHPAGE_RUN \"$WINDIR\\explorer.exe\"\n!define MUI_FINISHPAGE_RUN_PARAMETERS $INSTDIR\\@BITCOIN_GUI_NAME@@EXEEXT@\n!define MUI_UNICON \"${NSISDIR}\\Contrib\\Graphics\\Icons\\modern-uninstall.ico\"\n!define MUI_UNWELCOMEFINISHPAGE_BITMAP \"@abs_top_srcdir@/share/pixmaps/nsis-wizard.bmp\"\n!define MUI_UNFINISHPAGE_NOAUTOCLOSE\n\n# Included files\n!include Sections.nsh\n!include MUI2.nsh\n!if \"@WINDOWS_BITS@\" == \"64\"\n!include x64.nsh\n!endif\n\n# Variables\nVar StartMenuGroup\n\n# Installer pages\n!insertmacro MUI_PAGE_WELCOME\n!insertmacro MUI_PAGE_DIRECTORY\n!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup\n!insertmacro MUI_PAGE_INSTFILES\n!insertmacro MUI_PAGE_FINISH\n!insertmacro MUI_UNPAGE_CONFIRM\n!insertmacro MUI_UNPAGE_INSTFILES\n\n# Installer languages\n!insertmacro MUI_LANGUAGE English\n\n# Installer attributes\nOutFile @abs_top_srcdir@/@PACKAGE_TARNAME@-${VERSION}-win@WINDOWS_BITS@-setup.exe\n!if \"@WINDOWS_BITS@\" == \"64\"\nInstallDir $PROGRAMFILES64\\Sugarchain\n!else\nInstallDir $PROGRAMFILES\\Sugarchain\n!endif\nCRCCheck on\nXPStyle on\nBrandingText \" \"\nShowInstDetails show\nVIProductVersion ${VERSION}.@CLIENT_VERSION_BUILD@\nVIAddVersionKey ProductName \"@PACKAGE_NAME@\"\nVIAddVersionKey ProductVersion \"${VERSION}\"\nVIAddVersionKey CompanyName \"${COMPANY}\"\nVIAddVersionKey CompanyWebsite \"${URL}\"\nVIAddVersionKey FileVersion \"${VERSION}\"\nVIAddVersionKey FileDescription \"\"\nVIAddVersionKey LegalCopyright \"\"\nInstallDirRegKey HKCU \"${REGKEY}\" Path\nShowUninstDetails show\n\n# Installer sections\nSection -Main SEC0000\n    SetOutPath $INSTDIR\n    SetOverwrite on\n    File @abs_top_srcdir@/release/@BITCOIN_GUI_NAME@@EXEEXT@\n    File /oname=COPYING.txt @abs_top_srcdir@/COPYING\n    File /oname=readme.txt @abs_top_srcdir@/doc/README_windows.txt\n    SetOutPath $INSTDIR\\daemon\n    File @abs_top_srcdir@/release/@BITCOIN_DAEMON_NAME@@EXEEXT@\n    File @abs_top_srcdir@/release/@BITCOIN_CLI_NAME@@EXEEXT@\n    SetOutPath $INSTDIR\\doc\n    File /r @abs_top_srcdir@/doc\\*.*\n    SetOutPath $INSTDIR\n    WriteRegStr HKCU \"${REGKEY}\\Components\" Main 1\nSectionEnd\n\nSection -post SEC0001\n    WriteRegStr HKCU \"${REGKEY}\" Path $INSTDIR\n    SetOutPath $INSTDIR\n    WriteUninstaller $INSTDIR\\uninstall.exe\n    !insertmacro MUI_STARTMENU_WRITE_BEGIN Application\n    CreateDirectory $SMPROGRAMS\\$StartMenuGroup\n    CreateShortcut \"$SMPROGRAMS\\$StartMenuGroup\\$(^Name).lnk\" $INSTDIR\\@BITCOIN_GUI_NAME@@EXEEXT@\n    CreateShortcut \"$SMPROGRAMS\\$StartMenuGroup\\@PACKAGE_NAME@ (testnet, @WINDOWS_BITS@-bit).lnk\" \"$INSTDIR\\@BITCOIN_GUI_NAME@@EXEEXT@\" \"-testnet\" \"$INSTDIR\\@BITCOIN_GUI_NAME@@EXEEXT@\" 1\n    CreateShortcut \"$SMPROGRAMS\\$StartMenuGroup\\Uninstall $(^Name).lnk\" $INSTDIR\\uninstall.exe\n    !insertmacro MUI_STARTMENU_WRITE_END\n    WriteRegStr HKCU \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\$(^Name)\" DisplayName \"$(^Name)\"\n    WriteRegStr HKCU \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\$(^Name)\" DisplayVersion \"${VERSION}\"\n    WriteRegStr HKCU \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\$(^Name)\" Publisher \"${COMPANY}\"\n    WriteRegStr HKCU \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\$(^Name)\" URLInfoAbout \"${URL}\"\n    WriteRegStr HKCU \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\$(^Name)\" DisplayIcon $INSTDIR\\uninstall.exe\n    WriteRegStr HKCU \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\$(^Name)\" UninstallString $INSTDIR\\uninstall.exe\n    WriteRegDWORD HKCU \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\$(^Name)\" NoModify 1\n    WriteRegDWORD HKCU \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\$(^Name)\" NoRepair 1\n    WriteRegStr HKCR \"@PACKAGE_TARNAME@\" \"URL Protocol\" \"\"\n    WriteRegStr HKCR \"@PACKAGE_TARNAME@\" \"\" \"URL:Sugarchain\"\n    WriteRegStr HKCR \"@PACKAGE_TARNAME@\\DefaultIcon\" \"\" $INSTDIR\\@BITCOIN_GUI_NAME@@EXEEXT@\n    WriteRegStr HKCR \"@PACKAGE_TARNAME@\\shell\\open\\command\" \"\" '\"$INSTDIR\\@BITCOIN_GUI_NAME@@EXEEXT@\" \"%1\"'\nSectionEnd\n\n# Macro for selecting uninstaller sections\n!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID\n    Push $R0\n    ReadRegStr $R0 HKCU \"${REGKEY}\\Components\" \"${SECTION_NAME}\"\n    StrCmp $R0 1 0 next${UNSECTION_ID}\n    !insertmacro SelectSection \"${UNSECTION_ID}\"\n    GoTo done${UNSECTION_ID}\nnext${UNSECTION_ID}:\n    !insertmacro UnselectSection \"${UNSECTION_ID}\"\ndone${UNSECTION_ID}:\n    Pop $R0\n!macroend\n\n# Uninstaller sections\nSection /o -un.Main UNSEC0000\n    Delete /REBOOTOK $INSTDIR\\@BITCOIN_GUI_NAME@@EXEEXT@\n    Delete /REBOOTOK $INSTDIR\\COPYING.txt\n    Delete /REBOOTOK $INSTDIR\\readme.txt\n    RMDir /r /REBOOTOK $INSTDIR\\daemon\n    RMDir /r /REBOOTOK $INSTDIR\\doc\n    DeleteRegValue HKCU \"${REGKEY}\\Components\" Main\nSectionEnd\n\nSection -un.post UNSEC0001\n    DeleteRegKey HKCU \"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\$(^Name)\"\n    Delete /REBOOTOK \"$SMPROGRAMS\\$StartMenuGroup\\Uninstall $(^Name).lnk\"\n    Delete /REBOOTOK \"$SMPROGRAMS\\$StartMenuGroup\\$(^Name).lnk\"\n    Delete /REBOOTOK \"$SMPROGRAMS\\$StartMenuGroup\\@PACKAGE_NAME@ (testnet, @WINDOWS_BITS@-bit).lnk\"\n    Delete /REBOOTOK \"$SMSTARTUP\\Sugarchain.lnk\"\n    Delete /REBOOTOK $INSTDIR\\uninstall.exe\n    Delete /REBOOTOK $INSTDIR\\debug.log\n    Delete /REBOOTOK $INSTDIR\\db.log\n    DeleteRegValue HKCU \"${REGKEY}\" StartMenuGroup\n    DeleteRegValue HKCU \"${REGKEY}\" Path\n    DeleteRegKey /IfEmpty HKCU \"${REGKEY}\\Components\"\n    DeleteRegKey /IfEmpty HKCU \"${REGKEY}\"\n    DeleteRegKey HKCR \"@PACKAGE_TARNAME@\"\n    RmDir /REBOOTOK $SMPROGRAMS\\$StartMenuGroup\n    RmDir /REBOOTOK $INSTDIR\n    Push $R0\n    StrCpy $R0 $StartMenuGroup 1\n    StrCmp $R0 \">\" no_smgroup\nno_smgroup:\n    Pop $R0\nSectionEnd\n\n# Installer functions\nFunction .onInit\n    InitPluginsDir\n!if \"@WINDOWS_BITS@\" == \"64\"\n    ${If} ${RunningX64}\n      ; disable registry redirection (enable access to 64-bit portion of registry)\n      SetRegView 64\n    ${Else}\n      MessageBox MB_OK|MB_ICONSTOP \"Cannot install 64-bit version on a 32-bit system.\"\n      Abort\n    ${EndIf}\n!endif\nFunctionEnd\n\n# Uninstaller functions\nFunction un.onInit\n    ReadRegStr $INSTDIR HKCU \"${REGKEY}\" Path\n    !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup\n    !insertmacro SELECT_UNSECTION Main ${UNSEC0000}\nFunctionEnd\n"
  },
  {
    "path": "src/.clang-format",
    "content": "Language:        Cpp\nAccessModifierOffset: -4\nAlignAfterOpenBracket: false\nAlignEscapedNewlinesLeft: true\nAlignTrailingComments: true\nAllowAllParametersOfDeclarationOnNextLine: false\nAllowShortBlocksOnASingleLine: false\nAllowShortFunctionsOnASingleLine: All\nAllowShortIfStatementsOnASingleLine: true\nAllowShortLoopsOnASingleLine: false\nAlwaysBreakBeforeMultilineStrings: false\nAlwaysBreakTemplateDeclarations: true\nBinPackParameters: false\nBreakBeforeBinaryOperators: false\nBreakBeforeBraces: Linux\nBreakBeforeTernaryOperators: false\nBreakConstructorInitializersBeforeComma: false\nColumnLimit:     0\nCommentPragmas:  '^ IWYU pragma:'\nConstructorInitializerAllOnOneLineOrOnePerLine: false\nConstructorInitializerIndentWidth: 4\nContinuationIndentWidth: 4\nCpp11BracedListStyle: true\nDerivePointerAlignment: false\nDisableFormat:   false\nIndentCaseLabels: false\nIndentFunctionDeclarationAfterType: false\nIndentWidth:     4\nKeepEmptyLinesAtTheStartOfBlocks: false\nMaxEmptyLinesToKeep: 2\nNamespaceIndentation: None\nObjCSpaceAfterProperty: false\nObjCSpaceBeforeProtocolList: false\nPenaltyBreakBeforeFirstCallParameter: 1\nPenaltyBreakComment: 300\nPenaltyBreakFirstLessLess: 120\nPenaltyBreakString: 1000\nPenaltyExcessCharacter: 1000000\nPenaltyReturnTypeOnItsOwnLine: 200\nPointerAlignment: Left\nSpaceBeforeAssignmentOperators: true\nSpaceBeforeParens: ControlStatements\nSpaceInEmptyParentheses: false\nSpacesBeforeTrailingComments: 1\nSpacesInAngles:  false\nSpacesInContainerLiterals: true\nSpacesInCStyleCastParentheses: false\nSpacesInParentheses: false\nStandard:        Cpp11\nTabWidth:        8\nUseTab:          Never\n"
  },
  {
    "path": "src/Makefile.am",
    "content": "# Copyright (c) 2013-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nDIST_SUBDIRS = secp256k1 univalue\n\nAM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS)\nAM_CXXFLAGS = $(HARDENED_CXXFLAGS) $(ERROR_CXXFLAGS)\nAM_CPPFLAGS = $(HARDENED_CPPFLAGS)\nEXTRA_LIBRARIES =\n\nif EMBEDDED_UNIVALUE\nLIBUNIVALUE = univalue/libunivalue.la\n\n$(LIBUNIVALUE): $(wildcard univalue/lib/*) $(wildcard univalue/include/*)\n\t$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)\nelse\nLIBUNIVALUE = $(UNIVALUE_LIBS)\nendif\n\nBITCOIN_INCLUDES=-I$(builddir) $(BDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS)\n\nBITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include\nBITCOIN_INCLUDES += $(UNIVALUE_CFLAGS)\n\nLIBBITCOIN_SERVER=libbitcoin_server.a\nLIBBITCOIN_COMMON=libbitcoin_common.a\nLIBBITCOIN_CONSENSUS=libbitcoin_consensus.a\nLIBBITCOIN_CLI=libbitcoin_cli.a\nLIBBITCOIN_UTIL=libbitcoin_util.a\nLIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a\nLIBBITCOINQT=qt/libbitcoinqt.a\nLIBSECP256K1=secp256k1/libsecp256k1.la\n\nif ENABLE_ZMQ\nLIBBITCOIN_ZMQ=libbitcoin_zmq.a\nendif\nif BUILD_BITCOIN_LIBS\nLIBBITCOINCONSENSUS=libbitcoinconsensus.la\nendif\nif ENABLE_WALLET\nLIBBITCOIN_WALLET=libbitcoin_wallet.a\nendif\n\n$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)\n\t$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)\n\n# Make is not made aware of per-object dependencies to avoid limiting building parallelization\n# But to build the less dependent modules first, we manually select their order here:\nEXTRA_LIBRARIES += \\\n  $(LIBBITCOIN_CRYPTO) \\\n  $(LIBBITCOIN_UTIL) \\\n  $(LIBBITCOIN_COMMON) \\\n  $(LIBBITCOIN_CONSENSUS) \\\n  $(LIBBITCOIN_SERVER) \\\n  $(LIBBITCOIN_CLI) \\\n  $(LIBBITCOIN_WALLET) \\\n  $(LIBBITCOIN_ZMQ)\n\nlib_LTLIBRARIES = $(LIBBITCOINCONSENSUS)\n\nbin_PROGRAMS =\nnoinst_PROGRAMS =\nTESTS =\nBENCHMARKS =\n\nif BUILD_BITCOIND\n  bin_PROGRAMS += sugarchaind\nendif\n\nif BUILD_BITCOIN_UTILS\n  bin_PROGRAMS += sugarchain-cli sugarchain-tx\nendif\n\n.PHONY: FORCE check-symbols check-security\n# bitcoin core #\nBITCOIN_CORE_H = \\\n  addrdb.h \\\n  addrman.h \\\n  base58.h \\\n  bech32.h \\\n  bloom.h \\\n  blockencodings.h \\\n  chain.h \\\n  chainparams.h \\\n  chainparamsbase.h \\\n  chainparamsseeds.h \\\n  checkpoints.h \\\n  checkqueue.h \\\n  clientversion.h \\\n  coins.h \\\n  compat.h \\\n  compat/byteswap.h \\\n  compat/endian.h \\\n  compat/sanity.h \\\n  compressor.h \\\n  consensus/consensus.h \\\n  consensus/tx_verify.h \\\n  core_io.h \\\n  core_memusage.h \\\n  cuckoocache.h \\\n  fs.h \\\n  httprpc.h \\\n  httpserver.h \\\n  indirectmap.h \\\n  init.h \\\n  key.h \\\n  keystore.h \\\n  dbwrapper.h \\\n  limitedmap.h \\\n  memusage.h \\\n  merkleblock.h \\\n  miner.h \\\n  net.h \\\n  net_processing.h \\\n  netaddress.h \\\n  netbase.h \\\n  netmessagemaker.h \\\n  noui.h \\\n  policy/feerate.h \\\n  policy/fees.h \\\n  policy/policy.h \\\n  policy/rbf.h \\\n  pow.h \\\n  protocol.h \\\n  random.h \\\n  reverse_iterator.h \\\n  reverselock.h \\\n  rpc/blockchain.h \\\n  rpc/client.h \\\n  rpc/mining.h \\\n  rpc/protocol.h \\\n  rpc/safemode.h \\\n  rpc/server.h \\\n  rpc/register.h \\\n  rpc/util.h \\\n  scheduler.h \\\n  script/sigcache.h \\\n  script/sign.h \\\n  script/standard.h \\\n  script/ismine.h \\\n  streams.h \\\n  support/allocators/secure.h \\\n  support/allocators/zeroafterfree.h \\\n  support/cleanse.h \\\n  support/events.h \\\n  support/lockedpool.h \\\n  sync.h \\\n  threadsafety.h \\\n  threadinterrupt.h \\\n  timedata.h \\\n  torcontrol.h \\\n  txdb.h \\\n  txmempool.h \\\n  ui_interface.h \\\n  undo.h \\\n  util.h \\\n  utilmoneystr.h \\\n  utiltime.h \\\n  validation.h \\\n  validationinterface.h \\\n  versionbits.h \\\n  wallet/coincontrol.h \\\n  wallet/crypter.h \\\n  wallet/db.h \\\n  wallet/feebumper.h \\\n  wallet/fees.h \\\n  wallet/init.h \\\n  wallet/rpcwallet.h \\\n  wallet/wallet.h \\\n  wallet/walletdb.h \\\n  wallet/walletutil.h \\\n  warnings.h \\\n  zmq/zmqabstractnotifier.h \\\n  zmq/zmqconfig.h\\\n  zmq/zmqnotificationinterface.h \\\n  zmq/zmqpublishnotifier.h\n\n\nobj/build.h: FORCE\n\t@$(MKDIR_P) $(builddir)/obj\n\t@$(top_srcdir)/share/genbuild.sh \"$(abs_top_builddir)/src/obj/build.h\" \\\n\t  \"$(abs_top_srcdir)\"\nlibbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h\n\n# server: shared between bitcoind and bitcoin-qt\nlibbitcoin_server_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)\nlibbitcoin_server_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nlibbitcoin_server_a_SOURCES = \\\n  addrdb.cpp \\\n  addrman.cpp \\\n  bloom.cpp \\\n  blockencodings.cpp \\\n  chain.cpp \\\n  checkpoints.cpp \\\n  consensus/tx_verify.cpp \\\n  httprpc.cpp \\\n  httpserver.cpp \\\n  init.cpp \\\n  dbwrapper.cpp \\\n  merkleblock.cpp \\\n  miner.cpp \\\n  net.cpp \\\n  net_processing.cpp \\\n  noui.cpp \\\n  policy/fees.cpp \\\n  policy/policy.cpp \\\n  policy/rbf.cpp \\\n  pow.cpp \\\n  rest.cpp \\\n  rpc/blockchain.cpp \\\n  rpc/mining.cpp \\\n  rpc/misc.cpp \\\n  rpc/net.cpp \\\n  rpc/rawtransaction.cpp \\\n  rpc/safemode.cpp \\\n  rpc/server.cpp \\\n  script/sigcache.cpp \\\n  script/ismine.cpp \\\n  timedata.cpp \\\n  torcontrol.cpp \\\n  txdb.cpp \\\n  txmempool.cpp \\\n  ui_interface.cpp \\\n  validation.cpp \\\n  validationinterface.cpp \\\n  versionbits.cpp \\\n  $(BITCOIN_CORE_H)\n\nif ENABLE_ZMQ\nlibbitcoin_zmq_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS)\nlibbitcoin_zmq_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nlibbitcoin_zmq_a_SOURCES = \\\n  zmq/zmqabstractnotifier.cpp \\\n  zmq/zmqnotificationinterface.cpp \\\n  zmq/zmqpublishnotifier.cpp\nendif\n\n\n# wallet: shared between bitcoind and bitcoin-qt, but only linked\n# when wallet enabled\nlibbitcoin_wallet_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)\nlibbitcoin_wallet_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nlibbitcoin_wallet_a_SOURCES = \\\n  wallet/crypter.cpp \\\n  wallet/db.cpp \\\n  wallet/feebumper.cpp \\\n  wallet/fees.cpp \\\n  wallet/init.cpp \\\n  wallet/rpcdump.cpp \\\n  wallet/rpcwallet.cpp \\\n  wallet/wallet.cpp \\\n  wallet/walletdb.cpp \\\n  wallet/walletutil.cpp \\\n  $(BITCOIN_CORE_H)\n\n# crypto primitives library\ncrypto_libbitcoin_crypto_a_CPPFLAGS = $(AM_CPPFLAGS)\ncrypto_libbitcoin_crypto_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\ncrypto_libbitcoin_crypto_a_CFLAGS = $(PIE_FLAGS) -Wall -O2 -fomit-frame-pointer\ncrypto_libbitcoin_crypto_a_SOURCES = \\\n  crypto/aes.cpp \\\n  crypto/aes.h \\\n  crypto/chacha20.h \\\n  crypto/chacha20.cpp \\\n  crypto/common.h \\\n  crypto/hmac_sha256.cpp \\\n  crypto/hmac_sha256.h \\\n  crypto/hmac_sha512.cpp \\\n  crypto/hmac_sha512.h \\\n  crypto/ripemd160.cpp \\\n  crypto/ripemd160.h \\\n  crypto/sha1.cpp \\\n  crypto/sha1.h \\\n  crypto/sha256.cpp \\\n  crypto/sha256.h \\\n  crypto/sha512.cpp \\\n  crypto/sha512.h \\\n  crypto/yespower-1.0.1/sha256.c \\\n  crypto/yespower-1.0.1/yespower.h \\\n  crypto/yespower-1.0.1/yespower-opt.c\n\nif USE_ASM\ncrypto_libbitcoin_crypto_a_SOURCES += crypto/sha256_sse4.cpp\nendif\n\n# consensus: shared between all executables that validate any consensus rules.\nlibbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)\nlibbitcoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nlibbitcoin_consensus_a_SOURCES = \\\n  amount.h \\\n  arith_uint256.cpp \\\n  arith_uint256.h \\\n  consensus/merkle.cpp \\\n  consensus/merkle.h \\\n  consensus/params.h \\\n  consensus/validation.h \\\n  hash.cpp \\\n  hash.h \\\n  prevector.h \\\n  primitives/block.cpp \\\n  primitives/block.h \\\n  primitives/transaction.cpp \\\n  primitives/transaction.h \\\n  pubkey.cpp \\\n  pubkey.h \\\n  script/bitcoinconsensus.cpp \\\n  script/interpreter.cpp \\\n  script/interpreter.h \\\n  script/script.cpp \\\n  script/script.h \\\n  script/script_error.cpp \\\n  script/script_error.h \\\n  serialize.h \\\n  tinyformat.h \\\n  uint256.cpp \\\n  uint256.h \\\n  utilstrencodings.cpp \\\n  utilstrencodings.h \\\n  version.h\n\n# common: shared between bitcoind, and bitcoin-qt and non-server tools\nlibbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)\nlibbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nlibbitcoin_common_a_SOURCES = \\\n  base58.cpp \\\n  bech32.cpp \\\n  chainparams.cpp \\\n  coins.cpp \\\n  compressor.cpp \\\n  core_read.cpp \\\n  core_write.cpp \\\n  key.cpp \\\n  keystore.cpp \\\n  netaddress.cpp \\\n  netbase.cpp \\\n  policy/feerate.cpp \\\n  protocol.cpp \\\n  scheduler.cpp \\\n  script/sign.cpp \\\n  script/standard.cpp \\\n  warnings.cpp \\\n  $(BITCOIN_CORE_H)\n\n# util: shared between all executables.\n# This library *must* be included to make sure that the glibc\n# backward-compatibility objects and their sanity checks are linked.\nlibbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)\nlibbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nlibbitcoin_util_a_SOURCES = \\\n  support/lockedpool.cpp \\\n  chainparamsbase.cpp \\\n  clientversion.cpp \\\n  compat/glibc_sanity.cpp \\\n  compat/glibcxx_sanity.cpp \\\n  compat/strnlen.cpp \\\n  fs.cpp \\\n  random.cpp \\\n  rpc/protocol.cpp \\\n  rpc/util.cpp \\\n  support/cleanse.cpp \\\n  sync.cpp \\\n  threadinterrupt.cpp \\\n  util.cpp \\\n  utilmoneystr.cpp \\\n  utilstrencodings.cpp \\\n  utiltime.cpp \\\n  $(BITCOIN_CORE_H)\n\nif GLIBC_BACK_COMPAT\nlibbitcoin_util_a_SOURCES += compat/glibc_compat.cpp\nendif\n\n# cli: shared between bitcoin-cli and bitcoin-qt\nlibbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)\nlibbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nlibbitcoin_cli_a_SOURCES = \\\n  rpc/client.cpp \\\n  $(BITCOIN_CORE_H)\n\nnodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h\n#\n\n# bitcoind binary #\nsugarchaind_SOURCES = bitcoind.cpp\nsugarchaind_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)\nsugarchaind_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nsugarchaind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)\n\nif TARGET_WINDOWS\nsugarchaind_SOURCES += bitcoind-res.rc\nendif\n\nsugarchaind_LDADD = \\\n  $(LIBBITCOIN_SERVER) \\\n  $(LIBBITCOIN_COMMON) \\\n  $(LIBUNIVALUE) \\\n  $(LIBBITCOIN_UTIL) \\\n  $(LIBBITCOIN_WALLET) \\\n  $(LIBBITCOIN_ZMQ) \\\n  $(LIBBITCOIN_CONSENSUS) \\\n  $(LIBBITCOIN_CRYPTO) \\\n  $(LIBLEVELDB) \\\n  $(LIBLEVELDB_SSE42) \\\n  $(LIBMEMENV) \\\n  $(LIBSECP256K1)\n\nsugarchaind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS)\n\n# bitcoin-cli binary #\nsugarchain_cli_SOURCES = bitcoin-cli.cpp\nsugarchain_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)\nsugarchain_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nsugarchain_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)\n\nif TARGET_WINDOWS\nsugarchain_cli_SOURCES += bitcoin-cli-res.rc\nendif\n\nsugarchain_cli_LDADD = \\\n  $(LIBBITCOIN_CLI) \\\n  $(LIBUNIVALUE) \\\n  $(LIBBITCOIN_UTIL) \\\n  $(LIBBITCOIN_CRYPTO)\n\nsugarchain_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(EVENT_LIBS)\n#\n\n# bitcoin-tx binary #\nsugarchain_tx_SOURCES = bitcoin-tx.cpp\nsugarchain_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)\nsugarchain_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nsugarchain_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)\n\nif TARGET_WINDOWS\nsugarchain_tx_SOURCES += bitcoin-tx-res.rc\nendif\n\nsugarchain_tx_LDADD = \\\n  $(LIBUNIVALUE) \\\n  $(LIBBITCOIN_COMMON) \\\n  $(LIBBITCOIN_UTIL) \\\n  $(LIBBITCOIN_CONSENSUS) \\\n  $(LIBBITCOIN_CRYPTO) \\\n  $(LIBSECP256K1)\n\nsugarchain_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)\n#\n\n# bitcoinconsensus library #\nif BUILD_BITCOIN_LIBS\ninclude_HEADERS = script/bitcoinconsensus.h\nlibbitcoinconsensus_la_SOURCES = $(crypto_libbitcoin_crypto_a_SOURCES) $(libbitcoin_consensus_a_SOURCES)\n\nif GLIBC_BACK_COMPAT\n  libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp\nendif\n\nlibbitcoinconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)\nlibbitcoinconsensus_la_LIBADD = $(LIBSECP256K1)\nlibbitcoinconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL\nlibbitcoinconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\n\nendif\n#\n\nCTAES_DIST =  crypto/ctaes/bench.c\nCTAES_DIST += crypto/ctaes/ctaes.c\nCTAES_DIST += crypto/ctaes/ctaes.h\nCTAES_DIST += crypto/ctaes/README.md\nCTAES_DIST += crypto/ctaes/test.c\n\nCLEANFILES = $(EXTRA_LIBRARIES)\n\nCLEANFILES += *.gcda *.gcno\nCLEANFILES += compat/*.gcda compat/*.gcno\nCLEANFILES += consensus/*.gcda consensus/*.gcno\nCLEANFILES += crypto/*.gcda crypto/*.gcno\nCLEANFILES += policy/*.gcda policy/*.gcno\nCLEANFILES += primitives/*.gcda primitives/*.gcno\nCLEANFILES += script/*.gcda script/*.gcno\nCLEANFILES += support/*.gcda support/*.gcno\nCLEANFILES += univalue/*.gcda univalue/*.gcno\nCLEANFILES += wallet/*.gcda wallet/*.gcno\nCLEANFILES += wallet/test/*.gcda wallet/test/*.gcno\nCLEANFILES += zmq/*.gcda zmq/*.gcno\nCLEANFILES += obj/build.h\n\nEXTRA_DIST = $(CTAES_DIST)\n\n\nconfig/bitcoin-config.h: config/stamp-h1\n\t@$(MAKE) -C $(top_builddir) $(subdir)/$(@)\nconfig/stamp-h1: $(top_srcdir)/$(subdir)/config/bitcoin-config.h.in $(top_builddir)/config.status\n\t$(AM_V_at)$(MAKE) -C $(top_builddir) $(subdir)/$(@)\n$(top_srcdir)/$(subdir)/config/bitcoin-config.h.in:  $(am__configure_deps)\n\t$(AM_V_at)$(MAKE) -C $(top_srcdir) $(subdir)/config/bitcoin-config.h.in\n\nclean-local:\n\t-$(MAKE) -C secp256k1 clean\n\t-$(MAKE) -C univalue clean\n\t-rm -f leveldb/*/*.gcda leveldb/*/*.gcno leveldb/helpers/memenv/*.gcda leveldb/helpers/memenv/*.gcno\n\t-rm -f config.h\n\t-rm -rf test/__pycache__\n\n.rc.o:\n\t@test -f $(WINDRES)\n\t## FIXME: How to get the appropriate modulename_CPPFLAGS in here?\n\t$(AM_V_GEN) $(WINDRES) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -DWINDRES_PREPROC -i $< -o $@\n\ncheck-symbols: $(bin_PROGRAMS)\nif GLIBC_BACK_COMPAT\n\t@echo \"Checking glibc back compat...\"\n\t$(AM_V_at) READELF=$(READELF) CPPFILT=$(CPPFILT) $(top_srcdir)/contrib/devtools/symbol-check.py < $(bin_PROGRAMS)\nendif\n\ncheck-security: $(bin_PROGRAMS)\nif HARDEN\n\t@echo \"Checking binary security...\"\n\t$(AM_V_at) READELF=$(READELF) OBJDUMP=$(OBJDUMP) $(top_srcdir)/contrib/devtools/security-check.py < $(bin_PROGRAMS)\nendif\n\n%.pb.cc %.pb.h: %.proto\n\t@test -f $(PROTOC)\n\t$(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(<D) $<\n\nif EMBEDDED_LEVELDB\ninclude Makefile.leveldb.include\nendif\n\nif ENABLE_TESTS\ninclude Makefile.test.include\nendif\n\nif ENABLE_BENCH\ninclude Makefile.bench.include\nendif\n\nif ENABLE_QT\ninclude Makefile.qt.include\nendif\n\nif ENABLE_QT_TESTS\ninclude Makefile.qttest.include\nendif\n"
  },
  {
    "path": "src/Makefile.bench.include",
    "content": "# Copyright (c) 2015-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nbin_PROGRAMS += bench/bench_sugarchain\nBENCH_SRCDIR = bench\nBENCH_BINARY = bench/bench_sugarchain$(EXEEXT)\n\nRAW_BENCH_FILES = \\\n  bench/data/block413567.raw\nGENERATED_BENCH_FILES = $(RAW_BENCH_FILES:.raw=.raw.h)\n\nbench_bench_sugarchain_SOURCES = \\\n  $(RAW_BENCH_FILES) \\\n  bench/bench_bitcoin.cpp \\\n  bench/bench.cpp \\\n  bench/bench.h \\\n  bench/checkblock.cpp \\\n  bench/checkqueue.cpp \\\n  bench/Examples.cpp \\\n  bench/rollingbloom.cpp \\\n  bench/crypto_hash.cpp \\\n  bench/ccoins_caching.cpp \\\n  bench/mempool_eviction.cpp \\\n  bench/verify_script.cpp \\\n  bench/base58.cpp \\\n  bench/lockedpool.cpp \\\n  bench/perf.cpp \\\n  bench/perf.h \\\n  bench/prevector_destructor.cpp\n\nnodist_bench_bench_sugarchain_SOURCES = $(GENERATED_BENCH_FILES)\n\nbench_bench_sugarchain_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CLFAGS) $(EVENT_PTHREADS_CFLAGS) -I$(builddir)/bench/\nbench_bench_sugarchain_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\nbench_bench_sugarchain_LDADD = \\\n  $(LIBBITCOIN_SERVER) \\\n  $(LIBBITCOIN_COMMON) \\\n  $(LIBBITCOIN_UTIL) \\\n  $(LIBBITCOIN_CONSENSUS) \\\n  $(LIBBITCOIN_CRYPTO) \\\n  $(LIBLEVELDB) \\\n  $(LIBLEVELDB_SSE42) \\\n  $(LIBMEMENV) \\\n  $(LIBSECP256K1) \\\n  $(LIBUNIVALUE)\n\nif ENABLE_ZMQ\nbench_bench_sugarchain_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)\nendif\n\nif ENABLE_WALLET\nbench_bench_sugarchain_SOURCES += bench/coin_selection.cpp\nbench_bench_sugarchain_LDADD += $(LIBBITCOIN_WALLET) $(LIBBITCOIN_CRYPTO)\nendif\n\nbench_bench_sugarchain_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)\nbench_bench_sugarchain_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)\n\nCLEAN_BITCOIN_BENCH = bench/*.gcda bench/*.gcno $(GENERATED_BENCH_FILES)\n\nCLEANFILES += $(CLEAN_BITCOIN_BENCH)\n\nbench/checkblock.cpp: bench/data/block413567.raw.h\n\nbitcoin_bench: $(BENCH_BINARY)\n\nbench: $(BENCH_BINARY) FORCE\n\t$(BENCH_BINARY)\n\nbitcoin_bench_clean : FORCE\n\trm -f $(CLEAN_BITCOIN_BENCH) $(bench_bench_bitcoin_OBJECTS) $(BENCH_BINARY)\n\n%.raw.h: %.raw\n\t@$(MKDIR_P) $(@D)\n\t@{ \\\n\t echo \"static unsigned const char $(*F)[] = {\" && \\\n\t $(HEXDUMP) -v -e '8/1 \"0x%02x, \"' -e '\"\\n\"' $< | $(SED) -e 's/0x  ,//g' && \\\n\t echo \"};\"; \\\n\t} > \"$@.new\" && mv -f \"$@.new\" \"$@\"\n\t@echo \"Generated $@\"\n"
  },
  {
    "path": "src/Makefile.leveldb.include",
    "content": "# Copyright (c) 2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nLIBLEVELDB_INT = leveldb/libleveldb.a\nLIBMEMENV_INT  = leveldb/libmemenv.a\nLIBLEVELDB_SSE42_INT  = leveldb/libleveldb_sse42.a\n\nEXTRA_LIBRARIES += $(LIBLEVELDB_INT)\nEXTRA_LIBRARIES += $(LIBMEMENV_INT)\nEXTRA_LIBRARIES += $(LIBLEVELDB_SSE42_INT)\n\nLIBLEVELDB += $(LIBLEVELDB_INT)\nLIBMEMENV += $(LIBMEMENV_INT)\nLIBLEVELDB_SSE42 = $(LIBLEVELDB_SSE42_INT)\n\nLEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include\nLEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv\n\nLEVELDB_CPPFLAGS_INT =\nLEVELDB_CPPFLAGS_INT += -I$(srcdir)/leveldb\nLEVELDB_CPPFLAGS_INT += $(LEVELDB_TARGET_FLAGS)\nLEVELDB_CPPFLAGS_INT += -DLEVELDB_ATOMIC_PRESENT\nLEVELDB_CPPFLAGS_INT += -D__STDC_LIMIT_MACROS\n\nif TARGET_WINDOWS\nLEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0500 -D__USE_MINGW_ANSI_STDIO=1\nelse\nLEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_POSIX\nendif\n\nleveldb_libleveldb_a_CPPFLAGS = $(AM_CPPFLAGS) $(LEVELDB_CPPFLAGS_INT) $(LEVELDB_CPPFLAGS)\nleveldb_libleveldb_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\n\nleveldb_libleveldb_a_SOURCES=\nleveldb_libleveldb_a_SOURCES += leveldb/port/atomic_pointer.h\nleveldb_libleveldb_a_SOURCES += leveldb/port/port_example.h\nleveldb_libleveldb_a_SOURCES += leveldb/port/port_posix.h\nleveldb_libleveldb_a_SOURCES += leveldb/port/win/stdint.h\nleveldb_libleveldb_a_SOURCES += leveldb/port/port.h\nleveldb_libleveldb_a_SOURCES += leveldb/port/port_win.h\nleveldb_libleveldb_a_SOURCES += leveldb/port/thread_annotations.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/db.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/options.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/comparator.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/filter_policy.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/slice.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/table_builder.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/env.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/c.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/iterator.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/cache.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/dumpfile.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/table.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/write_batch.h\nleveldb_libleveldb_a_SOURCES += leveldb/include/leveldb/status.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/log_format.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/memtable.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/version_set.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/write_batch_internal.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/filename.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/version_edit.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/dbformat.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/builder.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/log_writer.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/db_iter.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/skiplist.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/db_impl.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/table_cache.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/snapshot.h\nleveldb_libleveldb_a_SOURCES += leveldb/db/log_reader.h\nleveldb_libleveldb_a_SOURCES += leveldb/table/filter_block.h\nleveldb_libleveldb_a_SOURCES += leveldb/table/block_builder.h\nleveldb_libleveldb_a_SOURCES += leveldb/table/block.h\nleveldb_libleveldb_a_SOURCES += leveldb/table/two_level_iterator.h\nleveldb_libleveldb_a_SOURCES += leveldb/table/merger.h\nleveldb_libleveldb_a_SOURCES += leveldb/table/format.h\nleveldb_libleveldb_a_SOURCES += leveldb/table/iterator_wrapper.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/crc32c.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/env_posix_test_helper.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/arena.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/random.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/posix_logger.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/hash.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/histogram.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/coding.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/testutil.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/mutexlock.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/logging.h\nleveldb_libleveldb_a_SOURCES += leveldb/util/testharness.h\n\nleveldb_libleveldb_a_SOURCES += leveldb/db/builder.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/c.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/dbformat.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/db_impl.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/db_iter.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/dumpfile.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/filename.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/log_reader.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/log_writer.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/memtable.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/repair.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/table_cache.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/version_edit.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/version_set.cc\nleveldb_libleveldb_a_SOURCES += leveldb/db/write_batch.cc\nleveldb_libleveldb_a_SOURCES += leveldb/table/block_builder.cc\nleveldb_libleveldb_a_SOURCES += leveldb/table/block.cc\nleveldb_libleveldb_a_SOURCES += leveldb/table/filter_block.cc\nleveldb_libleveldb_a_SOURCES += leveldb/table/format.cc\nleveldb_libleveldb_a_SOURCES += leveldb/table/iterator.cc\nleveldb_libleveldb_a_SOURCES += leveldb/table/merger.cc\nleveldb_libleveldb_a_SOURCES += leveldb/table/table_builder.cc\nleveldb_libleveldb_a_SOURCES += leveldb/table/table.cc\nleveldb_libleveldb_a_SOURCES += leveldb/table/two_level_iterator.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/arena.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/bloom.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/cache.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/coding.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/comparator.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/crc32c.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/env.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/env_posix.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/filter_policy.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/hash.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/histogram.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/logging.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/options.cc\nleveldb_libleveldb_a_SOURCES += leveldb/util/status.cc\n\nif TARGET_WINDOWS\nleveldb_libleveldb_a_SOURCES += leveldb/util/env_win.cc\nleveldb_libleveldb_a_SOURCES += leveldb/port/port_win.cc\nelse\nleveldb_libleveldb_a_SOURCES += leveldb/port/port_posix.cc\nendif\n\nleveldb_libmemenv_a_CPPFLAGS = $(leveldb_libleveldb_a_CPPFLAGS)\nleveldb_libmemenv_a_CXXFLAGS = $(leveldb_libleveldb_a_CXXFLAGS)\nleveldb_libmemenv_a_SOURCES =  leveldb/helpers/memenv/memenv.cc\nleveldb_libmemenv_a_SOURCES += leveldb/helpers/memenv/memenv.h\n\nleveldb_libleveldb_sse42_a_CPPFLAGS = $(leveldb_libleveldb_a_CPPFLAGS)\nleveldb_libleveldb_sse42_a_CXXFLAGS = $(leveldb_libleveldb_a_CXXFLAGS)\nif ENABLE_HWCRC32\nleveldb_libleveldb_sse42_a_CPPFLAGS += -DLEVELDB_PLATFORM_POSIX_SSE\nleveldb_libleveldb_sse42_a_CXXFLAGS += $(SSE42_CXXFLAGS)\nendif\nleveldb_libleveldb_sse42_a_SOURCES =  leveldb/port/port_posix_sse.cc\n"
  },
  {
    "path": "src/Makefile.qt.include",
    "content": "# Copyright (c) 2013-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nbin_PROGRAMS += qt/sugarchain-qt\nEXTRA_LIBRARIES += qt/libbitcoinqt.a\n\n# bitcoin qt core #\nQT_TS = \\\n  qt/locale/bitcoin_af.ts \\\n  qt/locale/bitcoin_af_ZA.ts \\\n  qt/locale/bitcoin_am.ts \\\n  qt/locale/bitcoin_ar.ts \\\n  qt/locale/bitcoin_be_BY.ts \\\n  qt/locale/bitcoin_bg_BG.ts \\\n  qt/locale/bitcoin_bg.ts \\\n  qt/locale/bitcoin_bn.ts \\\n  qt/locale/bitcoin_bs.ts \\\n  qt/locale/bitcoin_ca_ES.ts \\\n  qt/locale/bitcoin_ca.ts \\\n  qt/locale/bitcoin_ca@valencia.ts \\\n  qt/locale/bitcoin_cs_CZ.ts \\\n  qt/locale/bitcoin_cs.ts \\\n  qt/locale/bitcoin_cy.ts \\\n  qt/locale/bitcoin_da.ts \\\n  qt/locale/bitcoin_de_DE.ts \\\n  qt/locale/bitcoin_de.ts \\\n  qt/locale/bitcoin_el_GR.ts \\\n  qt/locale/bitcoin_el.ts \\\n  qt/locale/bitcoin_en_AU.ts \\\n  qt/locale/bitcoin_en_GB.ts \\\n  qt/locale/bitcoin_en.ts \\\n  qt/locale/bitcoin_eo.ts \\\n  qt/locale/bitcoin_es_419.ts \\\n  qt/locale/bitcoin_es_AR.ts \\\n  qt/locale/bitcoin_es_CL.ts \\\n  qt/locale/bitcoin_es_CO.ts \\\n  qt/locale/bitcoin_es_DO.ts \\\n  qt/locale/bitcoin_es_ES.ts \\\n  qt/locale/bitcoin_es_MX.ts \\\n  qt/locale/bitcoin_es.ts \\\n  qt/locale/bitcoin_es_UY.ts \\\n  qt/locale/bitcoin_es_VE.ts \\\n  qt/locale/bitcoin_et_EE.ts \\\n  qt/locale/bitcoin_et.ts \\\n  qt/locale/bitcoin_eu_ES.ts \\\n  qt/locale/bitcoin_fa_IR.ts \\\n  qt/locale/bitcoin_fa.ts \\\n  qt/locale/bitcoin_fi.ts \\\n  qt/locale/bitcoin_fr_CA.ts \\\n  qt/locale/bitcoin_fr_FR.ts \\\n  qt/locale/bitcoin_fr.ts \\\n  qt/locale/bitcoin_gl.ts \\\n  qt/locale/bitcoin_he_IL.ts \\\n  qt/locale/bitcoin_he.ts \\\n  qt/locale/bitcoin_hi_IN.ts \\\n  qt/locale/bitcoin_hr.ts \\\n  qt/locale/bitcoin_hu_HU.ts \\\n  qt/locale/bitcoin_hu.ts \\\n  qt/locale/bitcoin_id_ID.ts \\\n  qt/locale/bitcoin_id.ts \\\n  qt/locale/bitcoin_is.ts \\\n  qt/locale/bitcoin_it_IT.ts \\\n  qt/locale/bitcoin_it.ts \\\n  qt/locale/bitcoin_ja_JP.ts \\\n  qt/locale/bitcoin_ja.ts \\\n  qt/locale/bitcoin_ka.ts \\\n  qt/locale/bitcoin_kk_KZ.ts \\\n  qt/locale/bitcoin_km_KH.ts \\\n  qt/locale/bitcoin_ko_KR.ts \\\n  qt/locale/bitcoin_ko.ts \\\n  qt/locale/bitcoin_ku_IQ.ts \\\n  qt/locale/bitcoin_ky.ts \\\n  qt/locale/bitcoin_la.ts \\\n  qt/locale/bitcoin_lt.ts \\\n  qt/locale/bitcoin_lv_LV.ts \\\n  qt/locale/bitcoin_mk_MK.ts \\\n  qt/locale/bitcoin_ml.ts \\\n  qt/locale/bitcoin_mn.ts \\\n  qt/locale/bitcoin_mr_IN.ts \\\n  qt/locale/bitcoin_ms_MY.ts \\\n  qt/locale/bitcoin_ms.ts \\\n  qt/locale/bitcoin_my.ts \\\n  qt/locale/bitcoin_nb_NO.ts \\\n  qt/locale/bitcoin_nb.ts \\\n  qt/locale/bitcoin_ne.ts \\\n  qt/locale/bitcoin_nl_NL.ts \\\n  qt/locale/bitcoin_nl.ts \\\n  qt/locale/bitcoin_pam.ts \\\n  qt/locale/bitcoin_pl_PL.ts \\\n  qt/locale/bitcoin_pl.ts \\\n  qt/locale/bitcoin_pt_BR.ts \\\n  qt/locale/bitcoin_pt_PT.ts \\\n  qt/locale/bitcoin_pt.ts \\\n  qt/locale/bitcoin_ro_RO.ts \\\n  qt/locale/bitcoin_ro.ts \\\n  qt/locale/bitcoin_ru_RU.ts \\\n  qt/locale/bitcoin_ru.ts \\\n  qt/locale/bitcoin_si.ts \\\n  qt/locale/bitcoin_sk.ts \\\n  qt/locale/bitcoin_sl_SI.ts \\\n  qt/locale/bitcoin_sn.ts \\\n  qt/locale/bitcoin_sq.ts \\\n  qt/locale/bitcoin_sr@latin.ts \\\n  qt/locale/bitcoin_sr.ts \\\n  qt/locale/bitcoin_sv.ts \\\n  qt/locale/bitcoin_ta_IN.ts \\\n  qt/locale/bitcoin_ta.ts \\\n  qt/locale/bitcoin_te.ts \\\n  qt/locale/bitcoin_th_TH.ts \\\n  qt/locale/bitcoin_th.ts \\\n  qt/locale/bitcoin_tr_TR.ts \\\n  qt/locale/bitcoin_tr.ts \\\n  qt/locale/bitcoin_uk.ts \\\n  qt/locale/bitcoin_ur_PK.ts \\\n  qt/locale/bitcoin_uz@Cyrl.ts \\\n  qt/locale/bitcoin_vi.ts \\\n  qt/locale/bitcoin_vi_VN.ts \\\n  qt/locale/bitcoin_zh_CN.ts \\\n  qt/locale/bitcoin_zh-Hans.ts \\\n  qt/locale/bitcoin_zh_HK.ts \\\n  qt/locale/bitcoin_zh.ts \\\n  qt/locale/bitcoin_zh_TW.ts\n\nQT_FORMS_UI = \\\n  qt/forms/addressbookpage.ui \\\n  qt/forms/askpassphrasedialog.ui \\\n  qt/forms/coincontroldialog.ui \\\n  qt/forms/editaddressdialog.ui \\\n  qt/forms/helpmessagedialog.ui \\\n  qt/forms/intro.ui \\\n  qt/forms/modaloverlay.ui \\\n  qt/forms/openuridialog.ui \\\n  qt/forms/optionsdialog.ui \\\n  qt/forms/overviewpage.ui \\\n  qt/forms/receivecoinsdialog.ui \\\n  qt/forms/receiverequestdialog.ui \\\n  qt/forms/debugwindow.ui \\\n  qt/forms/sendcoinsdialog.ui \\\n  qt/forms/sendcoinsentry.ui \\\n  qt/forms/signverifymessagedialog.ui \\\n  qt/forms/transactiondescdialog.ui\n\nQT_MOC_CPP = \\\n  qt/moc_addressbookpage.cpp \\\n  qt/moc_addresstablemodel.cpp \\\n  qt/moc_askpassphrasedialog.cpp \\\n  qt/moc_bantablemodel.cpp \\\n  qt/moc_bitcoinaddressvalidator.cpp \\\n  qt/moc_bitcoinamountfield.cpp \\\n  qt/moc_bitcoingui.cpp \\\n  qt/moc_bitcoinunits.cpp \\\n  qt/moc_callback.cpp \\\n  qt/moc_clientmodel.cpp \\\n  qt/moc_coincontroldialog.cpp \\\n  qt/moc_coincontroltreewidget.cpp \\\n  qt/moc_csvmodelwriter.cpp \\\n  qt/moc_editaddressdialog.cpp \\\n  qt/moc_guiutil.cpp \\\n  qt/moc_intro.cpp \\\n  qt/moc_macdockiconhandler.cpp \\\n  qt/moc_macnotificationhandler.cpp \\\n  qt/moc_modaloverlay.cpp \\\n  qt/moc_notificator.cpp \\\n  qt/moc_openuridialog.cpp \\\n  qt/moc_optionsdialog.cpp \\\n  qt/moc_optionsmodel.cpp \\\n  qt/moc_overviewpage.cpp \\\n  qt/moc_peertablemodel.cpp \\\n  qt/moc_paymentserver.cpp \\\n  qt/moc_qvalidatedlineedit.cpp \\\n  qt/moc_qvaluecombobox.cpp \\\n  qt/moc_receivecoinsdialog.cpp \\\n  qt/moc_receiverequestdialog.cpp \\\n  qt/moc_recentrequeststablemodel.cpp \\\n  qt/moc_rpcconsole.cpp \\\n  qt/moc_sendcoinsdialog.cpp \\\n  qt/moc_sendcoinsentry.cpp \\\n  qt/moc_signverifymessagedialog.cpp \\\n  qt/moc_splashscreen.cpp \\\n  qt/moc_trafficgraphwidget.cpp \\\n  qt/moc_transactiondesc.cpp \\\n  qt/moc_transactiondescdialog.cpp \\\n  qt/moc_transactionfilterproxy.cpp \\\n  qt/moc_transactiontablemodel.cpp \\\n  qt/moc_transactionview.cpp \\\n  qt/moc_utilitydialog.cpp \\\n  qt/moc_walletframe.cpp \\\n  qt/moc_walletmodel.cpp \\\n  qt/moc_walletview.cpp\n\nBITCOIN_MM = \\\n  qt/macdockiconhandler.mm \\\n  qt/macnotificationhandler.mm\n\nQT_MOC = \\\n  qt/bitcoin.moc \\\n  qt/bitcoinamountfield.moc \\\n  qt/callback.moc \\\n  qt/intro.moc \\\n  qt/overviewpage.moc \\\n  qt/rpcconsole.moc\n\nQT_QRC_CPP = qt/qrc_bitcoin.cpp\nQT_QRC = qt/bitcoin.qrc\nQT_QRC_LOCALE_CPP = qt/qrc_bitcoin_locale.cpp\nQT_QRC_LOCALE = qt/bitcoin_locale.qrc\n\nPROTOBUF_CC = qt/paymentrequest.pb.cc\nPROTOBUF_H = qt/paymentrequest.pb.h\nPROTOBUF_PROTO = qt/paymentrequest.proto\n\nBITCOIN_QT_H = \\\n  qt/addressbookpage.h \\\n  qt/addresstablemodel.h \\\n  qt/askpassphrasedialog.h \\\n  qt/bantablemodel.h \\\n  qt/bitcoinaddressvalidator.h \\\n  qt/bitcoinamountfield.h \\\n  qt/bitcoingui.h \\\n  qt/bitcoinunits.h \\\n  qt/callback.h \\\n  qt/clientmodel.h \\\n  qt/coincontroldialog.h \\\n  qt/coincontroltreewidget.h \\\n  qt/csvmodelwriter.h \\\n  qt/editaddressdialog.h \\\n  qt/guiconstants.h \\\n  qt/guiutil.h \\\n  qt/intro.h \\\n  qt/macdockiconhandler.h \\\n  qt/macnotificationhandler.h \\\n  qt/modaloverlay.h \\\n  qt/networkstyle.h \\\n  qt/notificator.h \\\n  qt/openuridialog.h \\\n  qt/optionsdialog.h \\\n  qt/optionsmodel.h \\\n  qt/overviewpage.h \\\n  qt/paymentrequestplus.h \\\n  qt/paymentserver.h \\\n  qt/peertablemodel.h \\\n  qt/platformstyle.h \\\n  qt/qvalidatedlineedit.h \\\n  qt/qvaluecombobox.h \\\n  qt/receivecoinsdialog.h \\\n  qt/receiverequestdialog.h \\\n  qt/recentrequeststablemodel.h \\\n  qt/rpcconsole.h \\\n  qt/sendcoinsdialog.h \\\n  qt/sendcoinsentry.h \\\n  qt/signverifymessagedialog.h \\\n  qt/splashscreen.h \\\n  qt/trafficgraphwidget.h \\\n  qt/transactiondesc.h \\\n  qt/transactiondescdialog.h \\\n  qt/transactionfilterproxy.h \\\n  qt/transactionrecord.h \\\n  qt/transactiontablemodel.h \\\n  qt/transactionview.h \\\n  qt/utilitydialog.h \\\n  qt/walletframe.h \\\n  qt/walletmodel.h \\\n  qt/walletmodeltransaction.h \\\n  qt/walletview.h \\\n  qt/winshutdownmonitor.h\n\nRES_ICONS = \\\n  qt/res/icons/add.png \\\n  qt/res/icons/address-book.png \\\n  qt/res/icons/about.png \\\n  qt/res/icons/about_qt.png \\\n  qt/res/icons/bitcoin.ico \\\n  qt/res/icons/bitcoin_testnet.ico \\\n  qt/res/icons/bitcoin.png \\\n  qt/res/icons/chevron.png \\\n  qt/res/icons/clock1.png \\\n  qt/res/icons/clock2.png \\\n  qt/res/icons/clock3.png \\\n  qt/res/icons/clock4.png \\\n  qt/res/icons/clock5.png \\\n  qt/res/icons/configure.png \\\n  qt/res/icons/connect0.png \\\n  qt/res/icons/connect1.png \\\n  qt/res/icons/connect2.png \\\n  qt/res/icons/connect3.png \\\n  qt/res/icons/connect4.png \\\n  qt/res/icons/debugwindow.png \\\n  qt/res/icons/edit.png \\\n  qt/res/icons/editcopy.png \\\n  qt/res/icons/editpaste.png \\\n  qt/res/icons/export.png \\\n  qt/res/icons/eye.png \\\n  qt/res/icons/eye_minus.png \\\n  qt/res/icons/eye_plus.png \\\n  qt/res/icons/filesave.png \\\n  qt/res/icons/fontbigger.png \\\n  qt/res/icons/fontsmaller.png \\\n  qt/res/icons/hd_disabled.png \\\n  qt/res/icons/hd_enabled.png \\\n  qt/res/icons/history.png \\\n  qt/res/icons/info.png \\\n  qt/res/icons/key.png \\\n  qt/res/icons/lock_closed.png \\\n  qt/res/icons/lock_open.png \\\n  qt/res/icons/network_disabled.png \\\n  qt/res/icons/open.png \\\n  qt/res/icons/overview.png \\\n  qt/res/icons/quit.png \\\n  qt/res/icons/receive.png \\\n  qt/res/icons/remove.png \\\n  qt/res/icons/send.png \\\n  qt/res/icons/synced.png \\\n  qt/res/icons/transaction0.png \\\n  qt/res/icons/transaction2.png \\\n  qt/res/icons/transaction_abandoned.png \\\n  qt/res/icons/transaction_conflicted.png \\\n  qt/res/icons/tx_inout.png \\\n  qt/res/icons/tx_input.png \\\n  qt/res/icons/tx_output.png \\\n  qt/res/icons/tx_mined.png \\\n  qt/res/icons/warning.png \\\n  qt/res/icons/verify.png\n\nBITCOIN_QT_BASE_CPP = \\\n  qt/bantablemodel.cpp \\\n  qt/bitcoinaddressvalidator.cpp \\\n  qt/bitcoinamountfield.cpp \\\n  qt/bitcoingui.cpp \\\n  qt/bitcoinunits.cpp \\\n  qt/clientmodel.cpp \\\n  qt/csvmodelwriter.cpp \\\n  qt/guiutil.cpp \\\n  qt/intro.cpp \\\n  qt/modaloverlay.cpp \\\n  qt/networkstyle.cpp \\\n  qt/notificator.cpp \\\n  qt/optionsdialog.cpp \\\n  qt/optionsmodel.cpp \\\n  qt/peertablemodel.cpp \\\n  qt/platformstyle.cpp \\\n  qt/qvalidatedlineedit.cpp \\\n  qt/qvaluecombobox.cpp \\\n  qt/rpcconsole.cpp \\\n  qt/splashscreen.cpp \\\n  qt/trafficgraphwidget.cpp \\\n  qt/utilitydialog.cpp\n\nBITCOIN_QT_WINDOWS_CPP = qt/winshutdownmonitor.cpp\n\nBITCOIN_QT_WALLET_CPP = \\\n  qt/addressbookpage.cpp \\\n  qt/addresstablemodel.cpp \\\n  qt/askpassphrasedialog.cpp \\\n  qt/coincontroldialog.cpp \\\n  qt/coincontroltreewidget.cpp \\\n  qt/editaddressdialog.cpp \\\n  qt/openuridialog.cpp \\\n  qt/overviewpage.cpp \\\n  qt/paymentrequestplus.cpp \\\n  qt/paymentserver.cpp \\\n  qt/receivecoinsdialog.cpp \\\n  qt/receiverequestdialog.cpp \\\n  qt/recentrequeststablemodel.cpp \\\n  qt/sendcoinsdialog.cpp \\\n  qt/sendcoinsentry.cpp \\\n  qt/signverifymessagedialog.cpp \\\n  qt/transactiondesc.cpp \\\n  qt/transactiondescdialog.cpp \\\n  qt/transactionfilterproxy.cpp \\\n  qt/transactionrecord.cpp \\\n  qt/transactiontablemodel.cpp \\\n  qt/transactionview.cpp \\\n  qt/walletframe.cpp \\\n  qt/walletmodel.cpp \\\n  qt/walletmodeltransaction.cpp \\\n  qt/walletview.cpp\n\nBITCOIN_QT_CPP = $(BITCOIN_QT_BASE_CPP)\nif TARGET_WINDOWS\nBITCOIN_QT_CPP += $(BITCOIN_QT_WINDOWS_CPP)\nendif\nif ENABLE_WALLET\nBITCOIN_QT_CPP += $(BITCOIN_QT_WALLET_CPP)\nendif\n\nRES_IMAGES = \n\nRES_MOVIES = $(wildcard $(srcdir)/qt/res/movies/spinner-*.png)\n\nBITCOIN_RC = qt/res/bitcoin-qt-res.rc\n\nBITCOIN_QT_INCLUDES = -DQT_NO_KEYWORDS\n\nqt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \\\n  $(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)\nqt_libbitcoinqt_a_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)\nqt_libbitcoinqt_a_OBJCXXFLAGS = $(AM_OBJCXXFLAGS) $(QT_PIE_FLAGS)\n\nqt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \\\n  $(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES)\n\nnodist_qt_libbitcoinqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(PROTOBUF_CC) \\\n  $(PROTOBUF_H) $(QT_QRC_CPP) $(QT_QRC_LOCALE_CPP)\n\n# forms/foo.h -> forms/ui_foo.h\nQT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:.ui=.h))))\n\n# Most files will depend on the forms and moc files as includes. Generate them\n# before anything else.\n$(QT_MOC): $(QT_FORMS_H)\n$(qt_libbitcoinqt_a_OBJECTS) $(qt_sugarchain_qt_OBJECTS) : | $(QT_MOC)\n\n#Generating these with a half-written protobuf header leads to wacky results.\n#This makes sure it's done.\n$(QT_MOC): $(PROTOBUF_H)\n$(QT_MOC_CPP): $(PROTOBUF_H)\n\n# bitcoin-qt binary #\nqt_sugarchain_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \\\n  $(QT_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)\nqt_sugarchain_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)\n\nqt_sugarchain_qt_SOURCES = qt/bitcoin.cpp\nif TARGET_DARWIN\n  qt_sugarchain_qt_SOURCES += $(BITCOIN_MM)\nendif\nif TARGET_WINDOWS\n  qt_sugarchain_qt_SOURCES += $(BITCOIN_RC)\nendif\nqt_sugarchain_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER)\nif ENABLE_WALLET\nqt_sugarchain_qt_LDADD += $(LIBBITCOIN_WALLET)\nendif\nif ENABLE_ZMQ\nqt_sugarchain_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)\nendif\nqt_sugarchain_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) \\\n  $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \\\n  $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)\nqt_sugarchain_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)\nqt_sugarchain_qt_LIBTOOLFLAGS = --tag CXX\n\n#locale/foo.ts -> locale/foo.qm\nQT_QM=$(QT_TS:.ts=.qm)\n\nSECONDARY: $(QT_QM)\n\n$(srcdir)/qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_wallet_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_zmq_a_SOURCES) $(libbitcoin_consensus_a_SOURCES) $(libbitcoin_util_a_SOURCES)\n\t@test -n $(XGETTEXT) || echo \"xgettext is required for updating translations\"\n\t$(AM_V_GEN) cd $(srcdir); XGETTEXT=$(XGETTEXT) PACKAGE_NAME=\"$(PACKAGE_NAME)\" COPYRIGHT_HOLDERS=\"$(COPYRIGHT_HOLDERS)\" COPYRIGHT_HOLDERS_SUBSTITUTION=\"$(COPYRIGHT_HOLDERS_SUBSTITUTION)\" $(PYTHON) ../share/qt/extract_strings_qt.py $^\n\ntranslate: $(srcdir)/qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_BASE_CPP) qt/bitcoin.cpp $(BITCOIN_QT_WINDOWS_CPP) $(BITCOIN_QT_WALLET_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM)\n\t@test -n $(LUPDATE) || echo \"lupdate is required for updating translations\"\n\t$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts $(srcdir)/qt/locale/bitcoin_en.ts\n\n$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)\n\t@test -f $(RCC)\n\t@cp -f $< $(@D)/temp_$(<F)\n\t$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin_locale $(@D)/temp_$(<F) | \\\n\t  $(SED) -e '/^\\*\\*.*Created:/d' -e '/^\\*\\*.*by:/d' > $@\n\t@rm $(@D)/temp_$(<F)\n\n$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H)\n\t@test -f $(RCC)\n\t$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \\\n\t  $(SED) -e '/^\\*\\*.*Created:/d' -e '/^\\*\\*.*by:/d' > $@\n\nCLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno qt/temp_bitcoin_locale.qrc\n\nCLEANFILES += $(CLEAN_QT)\n\nbitcoin_qt_clean: FORCE\n\trm -f $(CLEAN_QT) $(qt_libbitcoinqt_a_OBJECTS) $(qt_sugarchain_qt_OBJECTS) qt/sugarchain-qt$(EXEEXT) $(LIBBITCOINQT)\n\nbitcoin_qt : qt/sugarchain-qt$(EXEEXT)\n\nui_%.h: %.ui\n\t@test -f $(UIC)\n\t@$(MKDIR_P) $(@D)\n\t$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(UIC) -o $@ $< || (echo \"Error creating $@\"; false)\n\n%.moc: %.cpp\n\t$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES) $(MOC_DEFS) $< | \\\n\t  $(SED) -e '/^\\*\\*.*Created:/d' -e '/^\\*\\*.*by:/d' > $@\n\nmoc_%.cpp: %.h\n\t$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES) $(MOC_DEFS) $< | \\\n\t  $(SED) -e '/^\\*\\*.*Created:/d' -e '/^\\*\\*.*by:/d' > $@\n\n%.qm: %.ts\n\t@test -f $(LRELEASE)\n\t@$(MKDIR_P) $(@D)\n\t$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LRELEASE) -silent $< -qm $@\n"
  },
  {
    "path": "src/Makefile.qttest.include",
    "content": "# Copyright (c) 2013-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nbin_PROGRAMS += qt/test/test_sugarchain-qt\nTESTS += qt/test/test_sugarchain-qt\n\nTEST_QT_MOC_CPP = \\\n  qt/test/moc_compattests.cpp \\\n  qt/test/moc_rpcnestedtests.cpp \\\n  qt/test/moc_uritests.cpp\n\nif ENABLE_WALLET\nTEST_QT_MOC_CPP += \\\n  qt/test/moc_paymentservertests.cpp \\\n  qt/test/moc_wallettests.cpp\nendif\n\nTEST_QT_H = \\\n  qt/test/compattests.h \\\n  qt/test/rpcnestedtests.h \\\n  qt/test/uritests.h \\\n  qt/test/paymentrequestdata.h \\\n  qt/test/paymentservertests.h \\\n  qt/test/wallettests.h\n\nTEST_BITCOIN_CPP = \\\n  test/test_bitcoin.cpp\n\nTEST_BITCOIN_H = \\\n  test/test_bitcoin.h\n\nqt_test_test_sugarchain_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \\\n  $(QT_INCLUDES) $(QT_TEST_INCLUDES) $(PROTOBUF_CFLAGS)\n\nqt_test_test_sugarchain_qt_SOURCES = \\\n  qt/test/compattests.cpp \\\n  qt/test/rpcnestedtests.cpp \\\n  qt/test/test_main.cpp \\\n  qt/test/uritests.cpp \\\n  $(TEST_QT_H) \\\n  $(TEST_BITCOIN_CPP) \\\n  $(TEST_BITCOIN_H)\nif ENABLE_WALLET\nqt_test_test_sugarchain_qt_SOURCES += \\\n  qt/test/paymentservertests.cpp \\\n  qt/test/wallettests.cpp \\\n  wallet/test/wallet_test_fixture.cpp\nendif\n\nnodist_qt_test_test_sugarchain_qt_SOURCES = $(TEST_QT_MOC_CPP)\n\nqt_test_test_sugarchain_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER)\nif ENABLE_WALLET\nqt_test_test_sugarchain_qt_LDADD += $(LIBBITCOIN_WALLET)\nendif\nif ENABLE_ZMQ\nqt_test_test_sugarchain_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS)\nendif\nqt_test_test_sugarchain_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \\\n  $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \\\n  $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(LIBSECP256K1) \\\n  $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS)\nqt_test_test_sugarchain_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)\nqt_test_test_sugarchain_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS)\n\nCLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno\n\nCLEANFILES += $(CLEAN_BITCOIN_QT_TEST)\n\ntest_bitcoin_qt : qt/test/test_sugarchain-qt$(EXEEXT)\n\ntest_bitcoin_qt_check : qt/test/test_sugarchain-qt$(EXEEXT) FORCE\n\t$(MAKE) check-TESTS TESTS=$^\n\ntest_bitcoin_qt_clean: FORCE\n\trm -f $(CLEAN_BITCOIN_QT_TEST) $(qt_test_test_bitcoin_qt_OBJECTS)\n"
  },
  {
    "path": "src/Makefile.test.include",
    "content": "# Copyright (c) 2013-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nTESTS += test/test_sugarchain\nbin_PROGRAMS += test/test_sugarchain\nnoinst_PROGRAMS += test/test_sugarchain_fuzzy\nTEST_SRCDIR = test\nTEST_BINARY=test/test_sugarchain$(EXEEXT)\n\nJSON_TEST_FILES = \\\n  test/data/script_tests.json \\\n  test/data/base58_keys_valid.json \\\n  test/data/base58_encode_decode.json \\\n  test/data/base58_keys_invalid.json \\\n  test/data/tx_invalid.json \\\n  test/data/tx_valid.json \\\n  test/data/sighash.json\n\nRAW_TEST_FILES =\n\nGENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)\n\n# test_bitcoin binary #\nBITCOIN_TESTS =\\\n  test/arith_uint256_tests.cpp \\\n  test/scriptnum10.h \\\n  test/addrman_tests.cpp \\\n  test/amount_tests.cpp \\\n  test/allocator_tests.cpp \\\n  test/base32_tests.cpp \\\n  test/base58_tests.cpp \\\n  test/base64_tests.cpp \\\n  test/bech32_tests.cpp \\\n  test/bip32_tests.cpp \\\n  test/blockchain_tests.cpp \\\n  test/blockencodings_tests.cpp \\\n  test/bloom_tests.cpp \\\n  test/bswap_tests.cpp \\\n  test/checkqueue_tests.cpp \\\n  test/coins_tests.cpp \\\n  test/compress_tests.cpp \\\n  test/crypto_tests.cpp \\\n  test/cuckoocache_tests.cpp \\\n  test/DoS_tests.cpp \\\n  test/getarg_tests.cpp \\\n  test/hash_tests.cpp \\\n  test/key_tests.cpp \\\n  test/limitedmap_tests.cpp \\\n  test/dbwrapper_tests.cpp \\\n  test/main_tests.cpp \\\n  test/mempool_tests.cpp \\\n  test/merkle_tests.cpp \\\n  test/merkleblock_tests.cpp \\\n  test/miner_tests.cpp \\\n  test/multisig_tests.cpp \\\n  test/net_tests.cpp \\\n  test/netbase_tests.cpp \\\n  test/pmt_tests.cpp \\\n  test/policyestimator_tests.cpp \\\n  test/pow_tests.cpp \\\n  test/prevector_tests.cpp \\\n  test/raii_event_tests.cpp \\\n  test/random_tests.cpp \\\n  test/reverselock_tests.cpp \\\n  test/rpc_tests.cpp \\\n  test/sanity_tests.cpp \\\n  test/scheduler_tests.cpp \\\n  test/script_P2SH_tests.cpp \\\n  test/script_tests.cpp \\\n  test/script_standard_tests.cpp \\\n  test/scriptnum_tests.cpp \\\n  test/serialize_tests.cpp \\\n  test/sighash_tests.cpp \\\n  test/sigopcount_tests.cpp \\\n  test/skiplist_tests.cpp \\\n  test/streams_tests.cpp \\\n  test/test_bitcoin.cpp \\\n  test/test_bitcoin.h \\\n  test/test_bitcoin_main.cpp \\\n  test/timedata_tests.cpp \\\n  test/torcontrol_tests.cpp \\\n  test/transaction_tests.cpp \\\n  test/txvalidation_tests.cpp \\\n  test/txvalidationcache_tests.cpp \\\n  test/uint256_tests.cpp \\\n  test/util_tests.cpp \\\n  test/validation_block_tests.cpp \\\n  test/versionbits_tests.cpp\n\nif ENABLE_WALLET\nBITCOIN_TESTS += \\\n  wallet/test/wallet_test_fixture.cpp \\\n  wallet/test/wallet_test_fixture.h \\\n  wallet/test/accounting_tests.cpp \\\n  wallet/test/wallet_tests.cpp \\\n  wallet/test/crypto_tests.cpp\nendif\n\ntest_test_sugarchain_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)\ntest_test_sugarchain_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(EVENT_CFLAGS)\ntest_test_sugarchain_LDADD =\nif ENABLE_WALLET\ntest_test_sugarchain_LDADD += $(LIBBITCOIN_WALLET)\nendif\ntest_test_sugarchain_LDADD += $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \\\n  $(LIBLEVELDB) $(LIBLEVELDB_SSE42) $(LIBMEMENV) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS)\ntest_test_sugarchain_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\n\ntest_test_sugarchain_LDADD += $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS)\ntest_test_sugarchain_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static\n\nif ENABLE_ZMQ\ntest_test_sugarchain_LDADD += $(ZMQ_LIBS)\nendif\n#\n\n# test_bitcoin_fuzzy binary #\ntest_test_sugarchain_fuzzy_SOURCES = test/test_bitcoin_fuzzy.cpp\ntest_test_sugarchain_fuzzy_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)\ntest_test_sugarchain_fuzzy_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)\ntest_test_sugarchain_fuzzy_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)\n\ntest_test_sugarchain_fuzzy_LDADD = \\\n  $(LIBUNIVALUE) \\\n  $(LIBBITCOIN_SERVER) \\\n  $(LIBBITCOIN_COMMON) \\\n  $(LIBBITCOIN_UTIL) \\\n  $(LIBBITCOIN_CONSENSUS) \\\n  $(LIBBITCOIN_CRYPTO) \\\n  $(LIBSECP256K1)\n\ntest_test_sugarchain_fuzzy_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)\n#\n\nnodist_test_test_sugarchain_SOURCES = $(GENERATED_TEST_FILES)\n\n$(BITCOIN_TESTS): $(GENERATED_TEST_FILES)\n\nCLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)\n\nCLEANFILES += $(CLEAN_BITCOIN_TEST)\n\nbitcoin_test: $(TEST_BINARY)\n\nbitcoin_test_check: $(TEST_BINARY) FORCE\n\t$(MAKE) check-TESTS TESTS=$^\n\nbitcoin_test_clean : FORCE\n\trm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)\n\ncheck-local:\n\t@echo \"Running test/util/bitcoin-util-test.py...\"\n\t$(PYTHON) $(top_builddir)/test/util/bitcoin-util-test.py\n\t$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check\nif EMBEDDED_UNIVALUE\n\t$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check\nendif\n\n%.json.h: %.json\n\t@$(MKDIR_P) $(@D)\n\t@{ \\\n\t echo \"namespace json_tests{\" && \\\n\t echo \"static unsigned const char $(*F)[] = {\" && \\\n\t $(HEXDUMP) -v -e '8/1 \"0x%02x, \"' -e '\"\\n\"' $< | $(SED) -e 's/0x  ,//g' && \\\n\t echo \"};};\"; \\\n\t} > \"$@.new\" && mv -f \"$@.new\" \"$@\"\n\t@echo \"Generated $@\"\n"
  },
  {
    "path": "src/addrdb.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <addrdb.h>\n\n#include <addrman.h>\n#include <chainparams.h>\n#include <clientversion.h>\n#include <hash.h>\n#include <random.h>\n#include <streams.h>\n#include <tinyformat.h>\n#include <util.h>\n\nnamespace {\n\ntemplate <typename Stream, typename Data>\nbool SerializeDB(Stream& stream, const Data& data)\n{\n    // Write and commit header, data\n    try {\n        CHashWriter hasher(SER_DISK, CLIENT_VERSION);\n        stream << FLATDATA(Params().MessageStart()) << data;\n        hasher << FLATDATA(Params().MessageStart()) << data;\n        stream << hasher.GetHash();\n    } catch (const std::exception& e) {\n        return error(\"%s: Serialize or I/O error - %s\", __func__, e.what());\n    }\n\n    return true;\n}\n\ntemplate <typename Data>\nbool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data& data)\n{\n    // Generate random temporary filename\n    unsigned short randv = 0;\n    GetRandBytes((unsigned char*)&randv, sizeof(randv));\n    std::string tmpfn = strprintf(\"%s.%04x\", prefix, randv);\n\n    // open temp output file, and associate with CAutoFile\n    fs::path pathTmp = GetDataDir() / tmpfn;\n    FILE *file = fsbridge::fopen(pathTmp, \"wb\");\n    CAutoFile fileout(file, SER_DISK, CLIENT_VERSION);\n    if (fileout.IsNull())\n        return error(\"%s: Failed to open file %s\", __func__, pathTmp.string());\n\n    // Serialize\n    if (!SerializeDB(fileout, data)) return false;\n    FileCommit(fileout.Get());\n    fileout.fclose();\n\n    // replace existing file, if any, with new file\n    if (!RenameOver(pathTmp, path))\n        return error(\"%s: Rename-into-place failed\", __func__);\n\n    return true;\n}\n\ntemplate <typename Stream, typename Data>\nbool DeserializeDB(Stream& stream, Data& data, bool fCheckSum = true)\n{\n    try {\n        CHashVerifier<Stream> verifier(&stream);\n        // de-serialize file header (network specific magic number) and ..\n        unsigned char pchMsgTmp[4];\n        verifier >> FLATDATA(pchMsgTmp);\n        // ... verify the network matches ours\n        if (memcmp(pchMsgTmp, Params().MessageStart(), sizeof(pchMsgTmp)))\n            return error(\"%s: Invalid network magic number\", __func__);\n\n        // de-serialize data\n        verifier >> data;\n\n        // verify checksum\n        if (fCheckSum) {\n            uint256 hashTmp;\n            stream >> hashTmp;\n            if (hashTmp != verifier.GetHash()) {\n                return error(\"%s: Checksum mismatch, data corrupted\", __func__);\n            }\n        }\n    }\n    catch (const std::exception& e) {\n        return error(\"%s: Deserialize or I/O error - %s\", __func__, e.what());\n    }\n\n    return true;\n}\n\ntemplate <typename Data>\nbool DeserializeFileDB(const fs::path& path, Data& data)\n{\n    // open input file, and associate with CAutoFile\n    FILE *file = fsbridge::fopen(path, \"rb\");\n    CAutoFile filein(file, SER_DISK, CLIENT_VERSION);\n    if (filein.IsNull())\n        return error(\"%s: Failed to open file %s\", __func__, path.string());\n\n    return DeserializeDB(filein, data);\n}\n\n}\n\nCBanDB::CBanDB()\n{\n    pathBanlist = GetDataDir() / \"banlist.dat\";\n}\n\nbool CBanDB::Write(const banmap_t& banSet)\n{\n    return SerializeFileDB(\"banlist\", pathBanlist, banSet);\n}\n\nbool CBanDB::Read(banmap_t& banSet)\n{\n    return DeserializeFileDB(pathBanlist, banSet);\n}\n\nCAddrDB::CAddrDB()\n{\n    pathAddr = GetDataDir() / \"peers.dat\";\n}\n\nbool CAddrDB::Write(const CAddrMan& addr)\n{\n    return SerializeFileDB(\"peers\", pathAddr, addr);\n}\n\nbool CAddrDB::Read(CAddrMan& addr)\n{\n    return DeserializeFileDB(pathAddr, addr);\n}\n\nbool CAddrDB::Read(CAddrMan& addr, CDataStream& ssPeers)\n{\n    bool ret = DeserializeDB(ssPeers, addr, false);\n    if (!ret) {\n        // Ensure addrman is left in a clean state\n        addr.Clear();\n    }\n    return ret;\n}\n"
  },
  {
    "path": "src/addrdb.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_ADDRDB_H\n#define BITCOIN_ADDRDB_H\n\n#include <fs.h>\n#include <serialize.h>\n\n#include <string>\n#include <map>\n\nclass CSubNet;\nclass CAddrMan;\nclass CDataStream;\n\ntypedef enum BanReason\n{\n    BanReasonUnknown          = 0,\n    BanReasonNodeMisbehaving  = 1,\n    BanReasonManuallyAdded    = 2\n} BanReason;\n\nclass CBanEntry\n{\npublic:\n    static const int CURRENT_VERSION=1;\n    int nVersion;\n    int64_t nCreateTime;\n    int64_t nBanUntil;\n    uint8_t banReason;\n\n    CBanEntry()\n    {\n        SetNull();\n    }\n\n    explicit CBanEntry(int64_t nCreateTimeIn)\n    {\n        SetNull();\n        nCreateTime = nCreateTimeIn;\n    }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(this->nVersion);\n        READWRITE(nCreateTime);\n        READWRITE(nBanUntil);\n        READWRITE(banReason);\n    }\n\n    void SetNull()\n    {\n        nVersion = CBanEntry::CURRENT_VERSION;\n        nCreateTime = 0;\n        nBanUntil = 0;\n        banReason = BanReasonUnknown;\n    }\n\n    std::string banReasonToString() const\n    {\n        switch (banReason) {\n        case BanReasonNodeMisbehaving:\n            return \"node misbehaving\";\n        case BanReasonManuallyAdded:\n            return \"manually added\";\n        default:\n            return \"unknown\";\n        }\n    }\n};\n\ntypedef std::map<CSubNet, CBanEntry> banmap_t;\n\n/** Access to the (IP) address database (peers.dat) */\nclass CAddrDB\n{\nprivate:\n    fs::path pathAddr;\npublic:\n    CAddrDB();\n    bool Write(const CAddrMan& addr);\n    bool Read(CAddrMan& addr);\n    static bool Read(CAddrMan& addr, CDataStream& ssPeers);\n};\n\n/** Access to the banlist database (banlist.dat) */\nclass CBanDB\n{\nprivate:\n    fs::path pathBanlist;\npublic:\n    CBanDB();\n    bool Write(const banmap_t& banSet);\n    bool Read(banmap_t& banSet);\n};\n\n#endif // BITCOIN_ADDRDB_H\n"
  },
  {
    "path": "src/addrman.cpp",
    "content": "// Copyright (c) 2012 Pieter Wuille\n// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <addrman.h>\n\n#include <hash.h>\n#include <serialize.h>\n#include <streams.h>\n\nint CAddrInfo::GetTriedBucket(const uint256& nKey) const\n{\n    uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetKey()).GetHash().GetCheapHash();\n    uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP)).GetHash().GetCheapHash();\n    return hash2 % ADDRMAN_TRIED_BUCKET_COUNT;\n}\n\nint CAddrInfo::GetNewBucket(const uint256& nKey, const CNetAddr& src) const\n{\n    std::vector<unsigned char> vchSourceGroupKey = src.GetGroup();\n    uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << GetGroup() << vchSourceGroupKey).GetHash().GetCheapHash();\n    uint64_t hash2 = (CHashWriter(SER_GETHASH, 0) << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP)).GetHash().GetCheapHash();\n    return hash2 % ADDRMAN_NEW_BUCKET_COUNT;\n}\n\nint CAddrInfo::GetBucketPosition(const uint256 &nKey, bool fNew, int nBucket) const\n{\n    uint64_t hash1 = (CHashWriter(SER_GETHASH, 0) << nKey << (fNew ? 'N' : 'K') << nBucket << GetKey()).GetHash().GetCheapHash();\n    return hash1 % ADDRMAN_BUCKET_SIZE;\n}\n\nbool CAddrInfo::IsTerrible(int64_t nNow) const\n{\n    if (nLastTry && nLastTry >= nNow - 60) // never remove things tried in the last minute\n        return false;\n\n    if (nTime > nNow + 10 * 60) // came in a flying DeLorean\n        return true;\n\n    if (nTime == 0 || nNow - nTime > ADDRMAN_HORIZON_DAYS * 24 * 60 * 60) // not seen in recent history\n        return true;\n\n    if (nLastSuccess == 0 && nAttempts >= ADDRMAN_RETRIES) // tried N times and never a success\n        return true;\n\n    if (nNow - nLastSuccess > ADDRMAN_MIN_FAIL_DAYS * 24 * 60 * 60 && nAttempts >= ADDRMAN_MAX_FAILURES) // N successive failures in the last week\n        return true;\n\n    return false;\n}\n\ndouble CAddrInfo::GetChance(int64_t nNow) const\n{\n    double fChance = 1.0;\n    int64_t nSinceLastTry = std::max<int64_t>(nNow - nLastTry, 0);\n\n    // deprioritize very recent attempts away\n    if (nSinceLastTry < 60 * 10)\n        fChance *= 0.01;\n\n    // deprioritize 66% after each failed attempt, but at most 1/28th to avoid the search taking forever or overly penalizing outages.\n    fChance *= pow(0.66, std::min(nAttempts, 8));\n\n    return fChance;\n}\n\nCAddrInfo* CAddrMan::Find(const CNetAddr& addr, int* pnId)\n{\n    std::map<CNetAddr, int>::iterator it = mapAddr.find(addr);\n    if (it == mapAddr.end())\n        return nullptr;\n    if (pnId)\n        *pnId = (*it).second;\n    std::map<int, CAddrInfo>::iterator it2 = mapInfo.find((*it).second);\n    if (it2 != mapInfo.end())\n        return &(*it2).second;\n    return nullptr;\n}\n\nCAddrInfo* CAddrMan::Create(const CAddress& addr, const CNetAddr& addrSource, int* pnId)\n{\n    int nId = nIdCount++;\n    mapInfo[nId] = CAddrInfo(addr, addrSource);\n    mapAddr[addr] = nId;\n    mapInfo[nId].nRandomPos = vRandom.size();\n    vRandom.push_back(nId);\n    if (pnId)\n        *pnId = nId;\n    return &mapInfo[nId];\n}\n\nvoid CAddrMan::SwapRandom(unsigned int nRndPos1, unsigned int nRndPos2)\n{\n    if (nRndPos1 == nRndPos2)\n        return;\n\n    assert(nRndPos1 < vRandom.size() && nRndPos2 < vRandom.size());\n\n    int nId1 = vRandom[nRndPos1];\n    int nId2 = vRandom[nRndPos2];\n\n    assert(mapInfo.count(nId1) == 1);\n    assert(mapInfo.count(nId2) == 1);\n\n    mapInfo[nId1].nRandomPos = nRndPos2;\n    mapInfo[nId2].nRandomPos = nRndPos1;\n\n    vRandom[nRndPos1] = nId2;\n    vRandom[nRndPos2] = nId1;\n}\n\nvoid CAddrMan::Delete(int nId)\n{\n    assert(mapInfo.count(nId) != 0);\n    CAddrInfo& info = mapInfo[nId];\n    assert(!info.fInTried);\n    assert(info.nRefCount == 0);\n\n    SwapRandom(info.nRandomPos, vRandom.size() - 1);\n    vRandom.pop_back();\n    mapAddr.erase(info);\n    mapInfo.erase(nId);\n    nNew--;\n}\n\nvoid CAddrMan::ClearNew(int nUBucket, int nUBucketPos)\n{\n    // if there is an entry in the specified bucket, delete it.\n    if (vvNew[nUBucket][nUBucketPos] != -1) {\n        int nIdDelete = vvNew[nUBucket][nUBucketPos];\n        CAddrInfo& infoDelete = mapInfo[nIdDelete];\n        assert(infoDelete.nRefCount > 0);\n        infoDelete.nRefCount--;\n        vvNew[nUBucket][nUBucketPos] = -1;\n        if (infoDelete.nRefCount == 0) {\n            Delete(nIdDelete);\n        }\n    }\n}\n\nvoid CAddrMan::MakeTried(CAddrInfo& info, int nId)\n{\n    // remove the entry from all new buckets\n    for (int bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) {\n        int pos = info.GetBucketPosition(nKey, true, bucket);\n        if (vvNew[bucket][pos] == nId) {\n            vvNew[bucket][pos] = -1;\n            info.nRefCount--;\n        }\n    }\n    nNew--;\n\n    assert(info.nRefCount == 0);\n\n    // which tried bucket to move the entry to\n    int nKBucket = info.GetTriedBucket(nKey);\n    int nKBucketPos = info.GetBucketPosition(nKey, false, nKBucket);\n\n    // first make space to add it (the existing tried entry there is moved to new, deleting whatever is there).\n    if (vvTried[nKBucket][nKBucketPos] != -1) {\n        // find an item to evict\n        int nIdEvict = vvTried[nKBucket][nKBucketPos];\n        assert(mapInfo.count(nIdEvict) == 1);\n        CAddrInfo& infoOld = mapInfo[nIdEvict];\n\n        // Remove the to-be-evicted item from the tried set.\n        infoOld.fInTried = false;\n        vvTried[nKBucket][nKBucketPos] = -1;\n        nTried--;\n\n        // find which new bucket it belongs to\n        int nUBucket = infoOld.GetNewBucket(nKey);\n        int nUBucketPos = infoOld.GetBucketPosition(nKey, true, nUBucket);\n        ClearNew(nUBucket, nUBucketPos);\n        assert(vvNew[nUBucket][nUBucketPos] == -1);\n\n        // Enter it into the new set again.\n        infoOld.nRefCount = 1;\n        vvNew[nUBucket][nUBucketPos] = nIdEvict;\n        nNew++;\n    }\n    assert(vvTried[nKBucket][nKBucketPos] == -1);\n\n    vvTried[nKBucket][nKBucketPos] = nId;\n    nTried++;\n    info.fInTried = true;\n}\n\nvoid CAddrMan::Good_(const CService& addr, int64_t nTime)\n{\n    int nId;\n\n    nLastGood = nTime;\n\n    CAddrInfo* pinfo = Find(addr, &nId);\n\n    // if not found, bail out\n    if (!pinfo)\n        return;\n\n    CAddrInfo& info = *pinfo;\n\n    // check whether we are talking about the exact same CService (including same port)\n    if (info != addr)\n        return;\n\n    // update info\n    info.nLastSuccess = nTime;\n    info.nLastTry = nTime;\n    info.nAttempts = 0;\n    // nTime is not updated here, to avoid leaking information about\n    // currently-connected peers.\n\n    // if it is already in the tried set, don't do anything else\n    if (info.fInTried)\n        return;\n\n    // find a bucket it is in now\n    int nRnd = RandomInt(ADDRMAN_NEW_BUCKET_COUNT);\n    int nUBucket = -1;\n    for (unsigned int n = 0; n < ADDRMAN_NEW_BUCKET_COUNT; n++) {\n        int nB = (n + nRnd) % ADDRMAN_NEW_BUCKET_COUNT;\n        int nBpos = info.GetBucketPosition(nKey, true, nB);\n        if (vvNew[nB][nBpos] == nId) {\n            nUBucket = nB;\n            break;\n        }\n    }\n\n    // if no bucket is found, something bad happened;\n    // TODO: maybe re-add the node, but for now, just bail out\n    if (nUBucket == -1)\n        return;\n\n    LogPrint(BCLog::ADDRMAN, \"Moving %s to tried\\n\", addr.ToString());\n\n    // move nId to the tried tables\n    MakeTried(info, nId);\n}\n\nbool CAddrMan::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimePenalty)\n{\n    if (!addr.IsRoutable())\n        return false;\n\n    bool fNew = false;\n    int nId;\n    CAddrInfo* pinfo = Find(addr, &nId);\n\n    // Do not set a penalty for a source's self-announcement\n    if (addr == source) {\n        nTimePenalty = 0;\n    }\n\n    if (pinfo) {\n        // periodically update nTime\n        bool fCurrentlyOnline = (GetAdjustedTime() - addr.nTime < 24 * 60 * 60);\n        int64_t nUpdateInterval = (fCurrentlyOnline ? 60 * 60 : 24 * 60 * 60);\n        if (addr.nTime && (!pinfo->nTime || pinfo->nTime < addr.nTime - nUpdateInterval - nTimePenalty))\n            pinfo->nTime = std::max((int64_t)0, addr.nTime - nTimePenalty);\n\n        // add services\n        pinfo->nServices = ServiceFlags(pinfo->nServices | addr.nServices);\n\n        // do not update if no new information is present\n        if (!addr.nTime || (pinfo->nTime && addr.nTime <= pinfo->nTime))\n            return false;\n\n        // do not update if the entry was already in the \"tried\" table\n        if (pinfo->fInTried)\n            return false;\n\n        // do not update if the max reference count is reached\n        if (pinfo->nRefCount == ADDRMAN_NEW_BUCKETS_PER_ADDRESS)\n            return false;\n\n        // stochastic test: previous nRefCount == N: 2^N times harder to increase it\n        int nFactor = 1;\n        for (int n = 0; n < pinfo->nRefCount; n++)\n            nFactor *= 2;\n        if (nFactor > 1 && (RandomInt(nFactor) != 0))\n            return false;\n    } else {\n        pinfo = Create(addr, source, &nId);\n        pinfo->nTime = std::max((int64_t)0, (int64_t)pinfo->nTime - nTimePenalty);\n        nNew++;\n        fNew = true;\n    }\n\n    int nUBucket = pinfo->GetNewBucket(nKey, source);\n    int nUBucketPos = pinfo->GetBucketPosition(nKey, true, nUBucket);\n    if (vvNew[nUBucket][nUBucketPos] != nId) {\n        bool fInsert = vvNew[nUBucket][nUBucketPos] == -1;\n        if (!fInsert) {\n            CAddrInfo& infoExisting = mapInfo[vvNew[nUBucket][nUBucketPos]];\n            if (infoExisting.IsTerrible() || (infoExisting.nRefCount > 1 && pinfo->nRefCount == 0)) {\n                // Overwrite the existing new table entry.\n                fInsert = true;\n            }\n        }\n        if (fInsert) {\n            ClearNew(nUBucket, nUBucketPos);\n            pinfo->nRefCount++;\n            vvNew[nUBucket][nUBucketPos] = nId;\n        } else {\n            if (pinfo->nRefCount == 0) {\n                Delete(nId);\n            }\n        }\n    }\n    return fNew;\n}\n\nvoid CAddrMan::Attempt_(const CService& addr, bool fCountFailure, int64_t nTime)\n{\n    CAddrInfo* pinfo = Find(addr);\n\n    // if not found, bail out\n    if (!pinfo)\n        return;\n\n    CAddrInfo& info = *pinfo;\n\n    // check whether we are talking about the exact same CService (including same port)\n    if (info != addr)\n        return;\n\n    // update info\n    info.nLastTry = nTime;\n    if (fCountFailure && info.nLastCountAttempt < nLastGood) {\n        info.nLastCountAttempt = nTime;\n        info.nAttempts++;\n    }\n}\n\nCAddrInfo CAddrMan::Select_(bool newOnly)\n{\n    if (size() == 0)\n        return CAddrInfo();\n\n    if (newOnly && nNew == 0)\n        return CAddrInfo();\n\n    // Use a 50% chance for choosing between tried and new table entries.\n    if (!newOnly &&\n       (nTried > 0 && (nNew == 0 || RandomInt(2) == 0))) { \n        // use a tried node\n        double fChanceFactor = 1.0;\n        while (1) {\n            int nKBucket = RandomInt(ADDRMAN_TRIED_BUCKET_COUNT);\n            int nKBucketPos = RandomInt(ADDRMAN_BUCKET_SIZE);\n            while (vvTried[nKBucket][nKBucketPos] == -1) {\n                nKBucket = (nKBucket + insecure_rand.randbits(ADDRMAN_TRIED_BUCKET_COUNT_LOG2)) % ADDRMAN_TRIED_BUCKET_COUNT;\n                nKBucketPos = (nKBucketPos + insecure_rand.randbits(ADDRMAN_BUCKET_SIZE_LOG2)) % ADDRMAN_BUCKET_SIZE;\n            }\n            int nId = vvTried[nKBucket][nKBucketPos];\n            assert(mapInfo.count(nId) == 1);\n            CAddrInfo& info = mapInfo[nId];\n            if (RandomInt(1 << 30) < fChanceFactor * info.GetChance() * (1 << 30))\n                return info;\n            fChanceFactor *= 1.2;\n        }\n    } else {\n        // use a new node\n        double fChanceFactor = 1.0;\n        while (1) {\n            int nUBucket = RandomInt(ADDRMAN_NEW_BUCKET_COUNT);\n            int nUBucketPos = RandomInt(ADDRMAN_BUCKET_SIZE);\n            while (vvNew[nUBucket][nUBucketPos] == -1) {\n                nUBucket = (nUBucket + insecure_rand.randbits(ADDRMAN_NEW_BUCKET_COUNT_LOG2)) % ADDRMAN_NEW_BUCKET_COUNT;\n                nUBucketPos = (nUBucketPos + insecure_rand.randbits(ADDRMAN_BUCKET_SIZE_LOG2)) % ADDRMAN_BUCKET_SIZE;\n            }\n            int nId = vvNew[nUBucket][nUBucketPos];\n            assert(mapInfo.count(nId) == 1);\n            CAddrInfo& info = mapInfo[nId];\n            if (RandomInt(1 << 30) < fChanceFactor * info.GetChance() * (1 << 30))\n                return info;\n            fChanceFactor *= 1.2;\n        }\n    }\n}\n\n#ifdef DEBUG_ADDRMAN\nint CAddrMan::Check_()\n{\n    std::set<int> setTried;\n    std::map<int, int> mapNew;\n\n    if (vRandom.size() != (size_t)(nTried + nNew))\n        return -7;\n\n    for (const auto& entry : mapInfo) {\n        int n = entry.first;\n        const CAddrInfo& info = entry.second;\n        if (info.fInTried) {\n            if (!info.nLastSuccess)\n                return -1;\n            if (info.nRefCount)\n                return -2;\n            setTried.insert(n);\n        } else {\n            if (info.nRefCount < 0 || info.nRefCount > ADDRMAN_NEW_BUCKETS_PER_ADDRESS)\n                return -3;\n            if (!info.nRefCount)\n                return -4;\n            mapNew[n] = info.nRefCount;\n        }\n        if (mapAddr[info] != n)\n            return -5;\n        if (info.nRandomPos < 0 || (size_t)info.nRandomPos >= vRandom.size() || vRandom[info.nRandomPos] != n)\n            return -14;\n        if (info.nLastTry < 0)\n            return -6;\n        if (info.nLastSuccess < 0)\n            return -8;\n    }\n\n    if (setTried.size() != (size_t)nTried)\n        return -9;\n    if (mapNew.size() != (size_t)nNew)\n        return -10;\n\n    for (int n = 0; n < ADDRMAN_TRIED_BUCKET_COUNT; n++) {\n        for (int i = 0; i < ADDRMAN_BUCKET_SIZE; i++) {\n             if (vvTried[n][i] != -1) {\n                 if (!setTried.count(vvTried[n][i]))\n                     return -11;\n                 if (mapInfo[vvTried[n][i]].GetTriedBucket(nKey) != n)\n                     return -17;\n                 if (mapInfo[vvTried[n][i]].GetBucketPosition(nKey, false, n) != i)\n                     return -18;\n                 setTried.erase(vvTried[n][i]);\n             }\n        }\n    }\n\n    for (int n = 0; n < ADDRMAN_NEW_BUCKET_COUNT; n++) {\n        for (int i = 0; i < ADDRMAN_BUCKET_SIZE; i++) {\n            if (vvNew[n][i] != -1) {\n                if (!mapNew.count(vvNew[n][i]))\n                    return -12;\n                if (mapInfo[vvNew[n][i]].GetBucketPosition(nKey, true, n) != i)\n                    return -19;\n                if (--mapNew[vvNew[n][i]] == 0)\n                    mapNew.erase(vvNew[n][i]);\n            }\n        }\n    }\n\n    if (setTried.size())\n        return -13;\n    if (mapNew.size())\n        return -15;\n    if (nKey.IsNull())\n        return -16;\n\n    return 0;\n}\n#endif\n\nvoid CAddrMan::GetAddr_(std::vector<CAddress>& vAddr)\n{\n    unsigned int nNodes = ADDRMAN_GETADDR_MAX_PCT * vRandom.size() / 100;\n    if (nNodes > ADDRMAN_GETADDR_MAX)\n        nNodes = ADDRMAN_GETADDR_MAX;\n\n    // gather a list of random nodes, skipping those of low quality\n    for (unsigned int n = 0; n < vRandom.size(); n++) {\n        if (vAddr.size() >= nNodes)\n            break;\n\n        int nRndPos = RandomInt(vRandom.size() - n) + n;\n        SwapRandom(n, nRndPos);\n        assert(mapInfo.count(vRandom[n]) == 1);\n\n        const CAddrInfo& ai = mapInfo[vRandom[n]];\n        if (!ai.IsTerrible())\n            vAddr.push_back(ai);\n    }\n}\n\nvoid CAddrMan::Connected_(const CService& addr, int64_t nTime)\n{\n    CAddrInfo* pinfo = Find(addr);\n\n    // if not found, bail out\n    if (!pinfo)\n        return;\n\n    CAddrInfo& info = *pinfo;\n\n    // check whether we are talking about the exact same CService (including same port)\n    if (info != addr)\n        return;\n\n    // update info\n    int64_t nUpdateInterval = 20 * 60;\n    if (nTime - info.nTime > nUpdateInterval)\n        info.nTime = nTime;\n}\n\nvoid CAddrMan::SetServices_(const CService& addr, ServiceFlags nServices)\n{\n    CAddrInfo* pinfo = Find(addr);\n\n    // if not found, bail out\n    if (!pinfo)\n        return;\n\n    CAddrInfo& info = *pinfo;\n\n    // check whether we are talking about the exact same CService (including same port)\n    if (info != addr)\n        return;\n\n    // update info\n    info.nServices = nServices;\n}\n\nint CAddrMan::RandomInt(int nMax){\n    return GetRandInt(nMax);\n}\n"
  },
  {
    "path": "src/addrman.h",
    "content": "// Copyright (c) 2012 Pieter Wuille\n// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_ADDRMAN_H\n#define BITCOIN_ADDRMAN_H\n\n#include <netaddress.h>\n#include <protocol.h>\n#include <random.h>\n#include <sync.h>\n#include <timedata.h>\n#include <util.h>\n\n#include <map>\n#include <set>\n#include <stdint.h>\n#include <vector>\n\n/**\n * Extended statistics about a CAddress\n */\nclass CAddrInfo : public CAddress\n{\n\n\npublic:\n    //! last try whatsoever by us (memory only)\n    int64_t nLastTry;\n\n    //! last counted attempt (memory only)\n    int64_t nLastCountAttempt;\n\nprivate:\n    //! where knowledge about this address first came from\n    CNetAddr source;\n\n    //! last successful connection by us\n    int64_t nLastSuccess;\n\n    //! connection attempts since last successful attempt\n    int nAttempts;\n\n    //! reference count in new sets (memory only)\n    int nRefCount;\n\n    //! in tried set? (memory only)\n    bool fInTried;\n\n    //! position in vRandom\n    int nRandomPos;\n\n    friend class CAddrMan;\n\npublic:\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(*(CAddress*)this);\n        READWRITE(source);\n        READWRITE(nLastSuccess);\n        READWRITE(nAttempts);\n    }\n\n    void Init()\n    {\n        nLastSuccess = 0;\n        nLastTry = 0;\n        nLastCountAttempt = 0;\n        nAttempts = 0;\n        nRefCount = 0;\n        fInTried = false;\n        nRandomPos = -1;\n    }\n\n    CAddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn), source(addrSource)\n    {\n        Init();\n    }\n\n    CAddrInfo() : CAddress(), source()\n    {\n        Init();\n    }\n\n    //! Calculate in which \"tried\" bucket this entry belongs\n    int GetTriedBucket(const uint256 &nKey) const;\n\n    //! Calculate in which \"new\" bucket this entry belongs, given a certain source\n    int GetNewBucket(const uint256 &nKey, const CNetAddr& src) const;\n\n    //! Calculate in which \"new\" bucket this entry belongs, using its default source\n    int GetNewBucket(const uint256 &nKey) const\n    {\n        return GetNewBucket(nKey, source);\n    }\n\n    //! Calculate in which position of a bucket to store this entry.\n    int GetBucketPosition(const uint256 &nKey, bool fNew, int nBucket) const;\n\n    //! Determine whether the statistics about this entry are bad enough so that it can just be deleted\n    bool IsTerrible(int64_t nNow = GetAdjustedTime()) const;\n\n    //! Calculate the relative chance this entry should be given when selecting nodes to connect to\n    double GetChance(int64_t nNow = GetAdjustedTime()) const;\n\n};\n\n/** Stochastic address manager\n *\n * Design goals:\n *  * Keep the address tables in-memory, and asynchronously dump the entire table to peers.dat.\n *  * Make sure no (localized) attacker can fill the entire table with his nodes/addresses.\n *\n * To that end:\n *  * Addresses are organized into buckets.\n *    * Addresses that have not yet been tried go into 1024 \"new\" buckets.\n *      * Based on the address range (/16 for IPv4) of the source of information, 64 buckets are selected at random.\n *      * The actual bucket is chosen from one of these, based on the range in which the address itself is located.\n *      * One single address can occur in up to 8 different buckets to increase selection chances for addresses that\n *        are seen frequently. The chance for increasing this multiplicity decreases exponentially.\n *      * When adding a new address to a full bucket, a randomly chosen entry (with a bias favoring less recently seen\n *        ones) is removed from it first.\n *    * Addresses of nodes that are known to be accessible go into 256 \"tried\" buckets.\n *      * Each address range selects at random 8 of these buckets.\n *      * The actual bucket is chosen from one of these, based on the full address.\n *      * When adding a new good address to a full bucket, a randomly chosen entry (with a bias favoring less recently\n *        tried ones) is evicted from it, back to the \"new\" buckets.\n *    * Bucket selection is based on cryptographic hashing, using a randomly-generated 256-bit key, which should not\n *      be observable by adversaries.\n *    * Several indexes are kept for high performance. Defining DEBUG_ADDRMAN will introduce frequent (and expensive)\n *      consistency checks for the entire data structure.\n */\n\n//! total number of buckets for tried addresses\n#define ADDRMAN_TRIED_BUCKET_COUNT_LOG2 8\n\n//! total number of buckets for new addresses\n#define ADDRMAN_NEW_BUCKET_COUNT_LOG2 10\n\n//! maximum allowed number of entries in buckets for new and tried addresses\n#define ADDRMAN_BUCKET_SIZE_LOG2 6\n\n//! over how many buckets entries with tried addresses from a single group (/16 for IPv4) are spread\n#define ADDRMAN_TRIED_BUCKETS_PER_GROUP 8\n\n//! over how many buckets entries with new addresses originating from a single group are spread\n#define ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP 64\n\n//! in how many buckets for entries with new addresses a single address may occur\n#define ADDRMAN_NEW_BUCKETS_PER_ADDRESS 8\n\n//! how old addresses can maximally be\n#define ADDRMAN_HORIZON_DAYS 30\n\n//! after how many failed attempts we give up on a new node\n#define ADDRMAN_RETRIES 3\n\n//! how many successive failures are allowed ...\n#define ADDRMAN_MAX_FAILURES 10\n\n//! ... in at least this many days\n#define ADDRMAN_MIN_FAIL_DAYS 7\n\n//! the maximum percentage of nodes to return in a getaddr call\n#define ADDRMAN_GETADDR_MAX_PCT 23\n\n//! the maximum number of nodes to return in a getaddr call\n#define ADDRMAN_GETADDR_MAX 2500\n\n//! Convenience\n#define ADDRMAN_TRIED_BUCKET_COUNT (1 << ADDRMAN_TRIED_BUCKET_COUNT_LOG2)\n#define ADDRMAN_NEW_BUCKET_COUNT (1 << ADDRMAN_NEW_BUCKET_COUNT_LOG2)\n#define ADDRMAN_BUCKET_SIZE (1 << ADDRMAN_BUCKET_SIZE_LOG2)\n\n/** \n * Stochastical (IP) address manager \n */\nclass CAddrMan\n{\nprivate:\n    //! critical section to protect the inner data structures\n    mutable CCriticalSection cs;\n\n    //! last used nId\n    int nIdCount;\n\n    //! table with information about all nIds\n    std::map<int, CAddrInfo> mapInfo;\n\n    //! find an nId based on its network address\n    std::map<CNetAddr, int> mapAddr;\n\n    //! randomly-ordered vector of all nIds\n    std::vector<int> vRandom;\n\n    // number of \"tried\" entries\n    int nTried;\n\n    //! list of \"tried\" buckets\n    int vvTried[ADDRMAN_TRIED_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE];\n\n    //! number of (unique) \"new\" entries\n    int nNew;\n\n    //! list of \"new\" buckets\n    int vvNew[ADDRMAN_NEW_BUCKET_COUNT][ADDRMAN_BUCKET_SIZE];\n\n    //! last time Good was called (memory only)\n    int64_t nLastGood;\n\nprotected:\n    //! secret key to randomize bucket select with\n    uint256 nKey;\n\n    //! Source of random numbers for randomization in inner loops\n    FastRandomContext insecure_rand;\n\n    //! Find an entry.\n    CAddrInfo* Find(const CNetAddr& addr, int *pnId = nullptr);\n\n    //! find an entry, creating it if necessary.\n    //! nTime and nServices of the found node are updated, if necessary.\n    CAddrInfo* Create(const CAddress &addr, const CNetAddr &addrSource, int *pnId = nullptr);\n\n    //! Swap two elements in vRandom.\n    void SwapRandom(unsigned int nRandomPos1, unsigned int nRandomPos2);\n\n    //! Move an entry from the \"new\" table(s) to the \"tried\" table\n    void MakeTried(CAddrInfo& info, int nId);\n\n    //! Delete an entry. It must not be in tried, and have refcount 0.\n    void Delete(int nId);\n\n    //! Clear a position in a \"new\" table. This is the only place where entries are actually deleted.\n    void ClearNew(int nUBucket, int nUBucketPos);\n\n    //! Mark an entry \"good\", possibly moving it from \"new\" to \"tried\".\n    void Good_(const CService &addr, int64_t nTime);\n\n    //! Add an entry to the \"new\" table.\n    bool Add_(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty);\n\n    //! Mark an entry as attempted to connect.\n    void Attempt_(const CService &addr, bool fCountFailure, int64_t nTime);\n\n    //! Select an address to connect to, if newOnly is set to true, only the new table is selected from.\n    CAddrInfo Select_(bool newOnly);\n\n    //! Wraps GetRandInt to allow tests to override RandomInt and make it determinismistic.\n    virtual int RandomInt(int nMax);\n\n#ifdef DEBUG_ADDRMAN\n    //! Perform consistency check. Returns an error code or zero.\n    int Check_();\n#endif\n\n    //! Select several addresses at once.\n    void GetAddr_(std::vector<CAddress> &vAddr);\n\n    //! Mark an entry as currently-connected-to.\n    void Connected_(const CService &addr, int64_t nTime);\n\n    //! Update an entry's service bits.\n    void SetServices_(const CService &addr, ServiceFlags nServices);\n\npublic:\n    /**\n     * serialized format:\n     * * version byte (currently 1)\n     * * 0x20 + nKey (serialized as if it were a vector, for backward compatibility)\n     * * nNew\n     * * nTried\n     * * number of \"new\" buckets XOR 2**30\n     * * all nNew addrinfos in vvNew\n     * * all nTried addrinfos in vvTried\n     * * for each bucket:\n     *   * number of elements\n     *   * for each element: index\n     *\n     * 2**30 is xorred with the number of buckets to make addrman deserializer v0 detect it\n     * as incompatible. This is necessary because it did not check the version number on\n     * deserialization.\n     *\n     * Notice that vvTried, mapAddr and vVector are never encoded explicitly;\n     * they are instead reconstructed from the other information.\n     *\n     * vvNew is serialized, but only used if ADDRMAN_UNKNOWN_BUCKET_COUNT didn't change,\n     * otherwise it is reconstructed as well.\n     *\n     * This format is more complex, but significantly smaller (at most 1.5 MiB), and supports\n     * changes to the ADDRMAN_ parameters without breaking the on-disk structure.\n     *\n     * We don't use ADD_SERIALIZE_METHODS since the serialization and deserialization code has\n     * very little in common.\n     */\n    template<typename Stream>\n    void Serialize(Stream &s) const\n    {\n        LOCK(cs);\n\n        unsigned char nVersion = 1;\n        s << nVersion;\n        s << ((unsigned char)32);\n        s << nKey;\n        s << nNew;\n        s << nTried;\n\n        int nUBuckets = ADDRMAN_NEW_BUCKET_COUNT ^ (1 << 30);\n        s << nUBuckets;\n        std::map<int, int> mapUnkIds;\n        int nIds = 0;\n        for (const auto& entry : mapInfo) {\n            mapUnkIds[entry.first] = nIds;\n            const CAddrInfo &info = entry.second;\n            if (info.nRefCount) {\n                assert(nIds != nNew); // this means nNew was wrong, oh ow\n                s << info;\n                nIds++;\n            }\n        }\n        nIds = 0;\n        for (const auto& entry : mapInfo) {\n            const CAddrInfo &info = entry.second;\n            if (info.fInTried) {\n                assert(nIds != nTried); // this means nTried was wrong, oh ow\n                s << info;\n                nIds++;\n            }\n        }\n        for (int bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) {\n            int nSize = 0;\n            for (int i = 0; i < ADDRMAN_BUCKET_SIZE; i++) {\n                if (vvNew[bucket][i] != -1)\n                    nSize++;\n            }\n            s << nSize;\n            for (int i = 0; i < ADDRMAN_BUCKET_SIZE; i++) {\n                if (vvNew[bucket][i] != -1) {\n                    int nIndex = mapUnkIds[vvNew[bucket][i]];\n                    s << nIndex;\n                }\n            }\n        }\n    }\n\n    template<typename Stream>\n    void Unserialize(Stream& s)\n    {\n        LOCK(cs);\n\n        Clear();\n\n        unsigned char nVersion;\n        s >> nVersion;\n        unsigned char nKeySize;\n        s >> nKeySize;\n        if (nKeySize != 32) throw std::ios_base::failure(\"Incorrect keysize in addrman deserialization\");\n        s >> nKey;\n        s >> nNew;\n        s >> nTried;\n        int nUBuckets = 0;\n        s >> nUBuckets;\n        if (nVersion != 0) {\n            nUBuckets ^= (1 << 30);\n        }\n\n        if (nNew > ADDRMAN_NEW_BUCKET_COUNT * ADDRMAN_BUCKET_SIZE) {\n            throw std::ios_base::failure(\"Corrupt CAddrMan serialization, nNew exceeds limit.\");\n        }\n\n        if (nTried > ADDRMAN_TRIED_BUCKET_COUNT * ADDRMAN_BUCKET_SIZE) {\n            throw std::ios_base::failure(\"Corrupt CAddrMan serialization, nTried exceeds limit.\");\n        }\n\n        // Deserialize entries from the new table.\n        for (int n = 0; n < nNew; n++) {\n            CAddrInfo &info = mapInfo[n];\n            s >> info;\n            mapAddr[info] = n;\n            info.nRandomPos = vRandom.size();\n            vRandom.push_back(n);\n            if (nVersion != 1 || nUBuckets != ADDRMAN_NEW_BUCKET_COUNT) {\n                // In case the new table data cannot be used (nVersion unknown, or bucket count wrong),\n                // immediately try to give them a reference based on their primary source address.\n                int nUBucket = info.GetNewBucket(nKey);\n                int nUBucketPos = info.GetBucketPosition(nKey, true, nUBucket);\n                if (vvNew[nUBucket][nUBucketPos] == -1) {\n                    vvNew[nUBucket][nUBucketPos] = n;\n                    info.nRefCount++;\n                }\n            }\n        }\n        nIdCount = nNew;\n\n        // Deserialize entries from the tried table.\n        int nLost = 0;\n        for (int n = 0; n < nTried; n++) {\n            CAddrInfo info;\n            s >> info;\n            int nKBucket = info.GetTriedBucket(nKey);\n            int nKBucketPos = info.GetBucketPosition(nKey, false, nKBucket);\n            if (vvTried[nKBucket][nKBucketPos] == -1) {\n                info.nRandomPos = vRandom.size();\n                info.fInTried = true;\n                vRandom.push_back(nIdCount);\n                mapInfo[nIdCount] = info;\n                mapAddr[info] = nIdCount;\n                vvTried[nKBucket][nKBucketPos] = nIdCount;\n                nIdCount++;\n            } else {\n                nLost++;\n            }\n        }\n        nTried -= nLost;\n\n        // Deserialize positions in the new table (if possible).\n        for (int bucket = 0; bucket < nUBuckets; bucket++) {\n            int nSize = 0;\n            s >> nSize;\n            for (int n = 0; n < nSize; n++) {\n                int nIndex = 0;\n                s >> nIndex;\n                if (nIndex >= 0 && nIndex < nNew) {\n                    CAddrInfo &info = mapInfo[nIndex];\n                    int nUBucketPos = info.GetBucketPosition(nKey, true, bucket);\n                    if (nVersion == 1 && nUBuckets == ADDRMAN_NEW_BUCKET_COUNT && vvNew[bucket][nUBucketPos] == -1 && info.nRefCount < ADDRMAN_NEW_BUCKETS_PER_ADDRESS) {\n                        info.nRefCount++;\n                        vvNew[bucket][nUBucketPos] = nIndex;\n                    }\n                }\n            }\n        }\n\n        // Prune new entries with refcount 0 (as a result of collisions).\n        int nLostUnk = 0;\n        for (std::map<int, CAddrInfo>::const_iterator it = mapInfo.begin(); it != mapInfo.end(); ) {\n            if (it->second.fInTried == false && it->second.nRefCount == 0) {\n                std::map<int, CAddrInfo>::const_iterator itCopy = it++;\n                Delete(itCopy->first);\n                nLostUnk++;\n            } else {\n                it++;\n            }\n        }\n        if (nLost + nLostUnk > 0) {\n            LogPrint(BCLog::ADDRMAN, \"addrman lost %i new and %i tried addresses due to collisions\\n\", nLostUnk, nLost);\n        }\n\n        Check();\n    }\n\n    void Clear()\n    {\n        LOCK(cs);\n        std::vector<int>().swap(vRandom);\n        nKey = GetRandHash();\n        for (size_t bucket = 0; bucket < ADDRMAN_NEW_BUCKET_COUNT; bucket++) {\n            for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) {\n                vvNew[bucket][entry] = -1;\n            }\n        }\n        for (size_t bucket = 0; bucket < ADDRMAN_TRIED_BUCKET_COUNT; bucket++) {\n            for (size_t entry = 0; entry < ADDRMAN_BUCKET_SIZE; entry++) {\n                vvTried[bucket][entry] = -1;\n            }\n        }\n\n        nIdCount = 0;\n        nTried = 0;\n        nNew = 0;\n        nLastGood = 1; //Initially at 1 so that \"never\" is strictly worse.\n        mapInfo.clear();\n        mapAddr.clear();\n    }\n\n    CAddrMan()\n    {\n        Clear();\n    }\n\n    ~CAddrMan()\n    {\n        nKey.SetNull();\n    }\n\n    //! Return the number of (unique) addresses in all tables.\n    size_t size() const\n    {\n        LOCK(cs); // TODO: Cache this in an atomic to avoid this overhead\n        return vRandom.size();\n    }\n\n    //! Consistency check\n    void Check()\n    {\n#ifdef DEBUG_ADDRMAN\n        {\n            LOCK(cs);\n            int err;\n            if ((err=Check_()))\n                LogPrintf(\"ADDRMAN CONSISTENCY CHECK FAILED!!! err=%i\\n\", err);\n        }\n#endif\n    }\n\n    //! Add a single address.\n    bool Add(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty = 0)\n    {\n        LOCK(cs);\n        bool fRet = false;\n        Check();\n        fRet |= Add_(addr, source, nTimePenalty);\n        Check();\n        if (fRet) {\n            LogPrint(BCLog::ADDRMAN, \"Added %s from %s: %i tried, %i new\\n\", addr.ToStringIPPort(), source.ToString(), nTried, nNew);\n        }\n        return fRet;\n    }\n\n    //! Add multiple addresses.\n    bool Add(const std::vector<CAddress> &vAddr, const CNetAddr& source, int64_t nTimePenalty = 0)\n    {\n        LOCK(cs);\n        int nAdd = 0;\n        Check();\n        for (std::vector<CAddress>::const_iterator it = vAddr.begin(); it != vAddr.end(); it++)\n            nAdd += Add_(*it, source, nTimePenalty) ? 1 : 0;\n        Check();\n        if (nAdd) {\n            LogPrint(BCLog::ADDRMAN, \"Added %i addresses from %s: %i tried, %i new\\n\", nAdd, source.ToString(), nTried, nNew);\n        }\n        return nAdd > 0;\n    }\n\n    //! Mark an entry as accessible.\n    void Good(const CService &addr, int64_t nTime = GetAdjustedTime())\n    {\n        LOCK(cs);\n        Check();\n        Good_(addr, nTime);\n        Check();\n    }\n\n    //! Mark an entry as connection attempted to.\n    void Attempt(const CService &addr, bool fCountFailure, int64_t nTime = GetAdjustedTime())\n    {\n        LOCK(cs);\n        Check();\n        Attempt_(addr, fCountFailure, nTime);\n        Check();\n    }\n\n    /**\n     * Choose an address to connect to.\n     */\n    CAddrInfo Select(bool newOnly = false)\n    {\n        CAddrInfo addrRet;\n        {\n            LOCK(cs);\n            Check();\n            addrRet = Select_(newOnly);\n            Check();\n        }\n        return addrRet;\n    }\n\n    //! Return a bunch of addresses, selected at random.\n    std::vector<CAddress> GetAddr()\n    {\n        Check();\n        std::vector<CAddress> vAddr;\n        {\n            LOCK(cs);\n            GetAddr_(vAddr);\n        }\n        Check();\n        return vAddr;\n    }\n\n    //! Mark an entry as currently-connected-to.\n    void Connected(const CService &addr, int64_t nTime = GetAdjustedTime())\n    {\n        LOCK(cs);\n        Check();\n        Connected_(addr, nTime);\n        Check();\n    }\n\n    void SetServices(const CService &addr, ServiceFlags nServices)\n    {\n        LOCK(cs);\n        Check();\n        SetServices_(addr, nServices);\n        Check();\n    }\n\n};\n\n#endif // BITCOIN_ADDRMAN_H\n"
  },
  {
    "path": "src/amount.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2016 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_AMOUNT_H\n#define BITCOIN_AMOUNT_H\n\n#include <stdint.h>\n\n/** Amount in satoshis (Can be negative) */\ntypedef int64_t CAmount;\n\nstatic const CAmount COIN = 100000000;\nstatic const CAmount CENT = 1000000;\n\n/** No amount larger than this (in satoshi) is valid.\n *\n * Note that this constant is *not* the total money supply, which in Bitcoin\n * currently happens to be less than 21,000,000 BTC for various reasons, but\n * rather a sanity check. As this sanity check is used by consensus-critical\n * validation code, the exact value of the MAX_MONEY constant is consensus\n * critical; in unusual circumstances like a(nother) overflow bug that allowed\n * for the creation of coins out of thin air modification could lead to a fork.\n * */\n\n// SUGAR-HALVING\n// BTC: (was 21000000)\n// Total Supply in COINs (in theory):\t1073741824\n// Total Supply in COINs (in actual):\t1073741823.87500000\n// Difference: 0.125\nstatic const CAmount MAX_MONEY = 1073741824 * COIN; // total supply in theory\ninline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }\n\n#endif //  BITCOIN_AMOUNT_H\n"
  },
  {
    "path": "src/arith_uint256.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <arith_uint256.h>\n\n#include <uint256.h>\n#include <utilstrencodings.h>\n#include <crypto/common.h>\n\n#include <stdio.h>\n#include <string.h>\n\ntemplate <unsigned int BITS>\nbase_uint<BITS>::base_uint(const std::string& str)\n{\n    static_assert(BITS/32 > 0 && BITS%32 == 0, \"Template parameter BITS must be a positive multiple of 32.\");\n\n    SetHex(str);\n}\n\ntemplate <unsigned int BITS>\nbase_uint<BITS>& base_uint<BITS>::operator<<=(unsigned int shift)\n{\n    base_uint<BITS> a(*this);\n    for (int i = 0; i < WIDTH; i++)\n        pn[i] = 0;\n    int k = shift / 32;\n    shift = shift % 32;\n    for (int i = 0; i < WIDTH; i++) {\n        if (i + k + 1 < WIDTH && shift != 0)\n            pn[i + k + 1] |= (a.pn[i] >> (32 - shift));\n        if (i + k < WIDTH)\n            pn[i + k] |= (a.pn[i] << shift);\n    }\n    return *this;\n}\n\ntemplate <unsigned int BITS>\nbase_uint<BITS>& base_uint<BITS>::operator>>=(unsigned int shift)\n{\n    base_uint<BITS> a(*this);\n    for (int i = 0; i < WIDTH; i++)\n        pn[i] = 0;\n    int k = shift / 32;\n    shift = shift % 32;\n    for (int i = 0; i < WIDTH; i++) {\n        if (i - k - 1 >= 0 && shift != 0)\n            pn[i - k - 1] |= (a.pn[i] << (32 - shift));\n        if (i - k >= 0)\n            pn[i - k] |= (a.pn[i] >> shift);\n    }\n    return *this;\n}\n\ntemplate <unsigned int BITS>\nbase_uint<BITS>& base_uint<BITS>::operator*=(uint32_t b32)\n{\n    uint64_t carry = 0;\n    for (int i = 0; i < WIDTH; i++) {\n        uint64_t n = carry + (uint64_t)b32 * pn[i];\n        pn[i] = n & 0xffffffff;\n        carry = n >> 32;\n    }\n    return *this;\n}\n\ntemplate <unsigned int BITS>\nbase_uint<BITS>& base_uint<BITS>::operator*=(const base_uint& b)\n{\n    base_uint<BITS> a = *this;\n    *this = 0;\n    for (int j = 0; j < WIDTH; j++) {\n        uint64_t carry = 0;\n        for (int i = 0; i + j < WIDTH; i++) {\n            uint64_t n = carry + pn[i + j] + (uint64_t)a.pn[j] * b.pn[i];\n            pn[i + j] = n & 0xffffffff;\n            carry = n >> 32;\n        }\n    }\n    return *this;\n}\n\ntemplate <unsigned int BITS>\nbase_uint<BITS>& base_uint<BITS>::operator/=(const base_uint& b)\n{\n    base_uint<BITS> div = b;     // make a copy, so we can shift.\n    base_uint<BITS> num = *this; // make a copy, so we can subtract.\n    *this = 0;                   // the quotient.\n    int num_bits = num.bits();\n    int div_bits = div.bits();\n    if (div_bits == 0)\n        throw uint_error(\"Division by zero\");\n    if (div_bits > num_bits) // the result is certainly 0.\n        return *this;\n    int shift = num_bits - div_bits;\n    div <<= shift; // shift so that div and num align.\n    while (shift >= 0) {\n        if (num >= div) {\n            num -= div;\n            pn[shift / 32] |= (1 << (shift & 31)); // set a bit of the result.\n        }\n        div >>= 1; // shift back.\n        shift--;\n    }\n    // num now contains the remainder of the division.\n    return *this;\n}\n\ntemplate <unsigned int BITS>\nint base_uint<BITS>::CompareTo(const base_uint<BITS>& b) const\n{\n    for (int i = WIDTH - 1; i >= 0; i--) {\n        if (pn[i] < b.pn[i])\n            return -1;\n        if (pn[i] > b.pn[i])\n            return 1;\n    }\n    return 0;\n}\n\ntemplate <unsigned int BITS>\nbool base_uint<BITS>::EqualTo(uint64_t b) const\n{\n    for (int i = WIDTH - 1; i >= 2; i--) {\n        if (pn[i])\n            return false;\n    }\n    if (pn[1] != (b >> 32))\n        return false;\n    if (pn[0] != (b & 0xfffffffful))\n        return false;\n    return true;\n}\n\ntemplate <unsigned int BITS>\ndouble base_uint<BITS>::getdouble() const\n{\n    double ret = 0.0;\n    double fact = 1.0;\n    for (int i = 0; i < WIDTH; i++) {\n        ret += fact * pn[i];\n        fact *= 4294967296.0;\n    }\n    return ret;\n}\n\ntemplate <unsigned int BITS>\nstd::string base_uint<BITS>::GetHex() const\n{\n    return ArithToUint256(*this).GetHex();\n}\n\ntemplate <unsigned int BITS>\nvoid base_uint<BITS>::SetHex(const char* psz)\n{\n    *this = UintToArith256(uint256S(psz));\n}\n\ntemplate <unsigned int BITS>\nvoid base_uint<BITS>::SetHex(const std::string& str)\n{\n    SetHex(str.c_str());\n}\n\ntemplate <unsigned int BITS>\nstd::string base_uint<BITS>::ToString() const\n{\n    return (GetHex());\n}\n\ntemplate <unsigned int BITS>\nunsigned int base_uint<BITS>::bits() const\n{\n    for (int pos = WIDTH - 1; pos >= 0; pos--) {\n        if (pn[pos]) {\n            for (int nbits = 31; nbits > 0; nbits--) {\n                if (pn[pos] & 1 << nbits)\n                    return 32 * pos + nbits + 1;\n            }\n            return 32 * pos + 1;\n        }\n    }\n    return 0;\n}\n\n// Explicit instantiations for base_uint<256>\ntemplate base_uint<256>::base_uint(const std::string&);\ntemplate base_uint<256>& base_uint<256>::operator<<=(unsigned int);\ntemplate base_uint<256>& base_uint<256>::operator>>=(unsigned int);\ntemplate base_uint<256>& base_uint<256>::operator*=(uint32_t b32);\ntemplate base_uint<256>& base_uint<256>::operator*=(const base_uint<256>& b);\ntemplate base_uint<256>& base_uint<256>::operator/=(const base_uint<256>& b);\ntemplate int base_uint<256>::CompareTo(const base_uint<256>&) const;\ntemplate bool base_uint<256>::EqualTo(uint64_t) const;\ntemplate double base_uint<256>::getdouble() const;\ntemplate std::string base_uint<256>::GetHex() const;\ntemplate std::string base_uint<256>::ToString() const;\ntemplate void base_uint<256>::SetHex(const char*);\ntemplate void base_uint<256>::SetHex(const std::string&);\ntemplate unsigned int base_uint<256>::bits() const;\n\n// This implementation directly uses shifts instead of going\n// through an intermediate MPI representation.\narith_uint256& arith_uint256::SetCompact(uint32_t nCompact, bool* pfNegative, bool* pfOverflow)\n{\n    int nSize = nCompact >> 24;\n    uint32_t nWord = nCompact & 0x007fffff;\n    if (nSize <= 3) {\n        nWord >>= 8 * (3 - nSize);\n        *this = nWord;\n    } else {\n        *this = nWord;\n        *this <<= 8 * (nSize - 3);\n    }\n    if (pfNegative)\n        *pfNegative = nWord != 0 && (nCompact & 0x00800000) != 0;\n    if (pfOverflow)\n        *pfOverflow = nWord != 0 && ((nSize > 34) ||\n                                     (nWord > 0xff && nSize > 33) ||\n                                     (nWord > 0xffff && nSize > 32));\n    return *this;\n}\n\nuint32_t arith_uint256::GetCompact(bool fNegative) const\n{\n    int nSize = (bits() + 7) / 8;\n    uint32_t nCompact = 0;\n    if (nSize <= 3) {\n        nCompact = GetLow64() << 8 * (3 - nSize);\n    } else {\n        arith_uint256 bn = *this >> 8 * (nSize - 3);\n        nCompact = bn.GetLow64();\n    }\n    // The 0x00800000 bit denotes the sign.\n    // Thus, if it is already set, divide the mantissa by 256 and increase the exponent.\n    if (nCompact & 0x00800000) {\n        nCompact >>= 8;\n        nSize++;\n    }\n    assert((nCompact & ~0x007fffff) == 0);\n    assert(nSize < 256);\n    nCompact |= nSize << 24;\n    nCompact |= (fNegative && (nCompact & 0x007fffff) ? 0x00800000 : 0);\n    return nCompact;\n}\n\nuint256 ArithToUint256(const arith_uint256 &a)\n{\n    uint256 b;\n    for(int x=0; x<a.WIDTH; ++x)\n        WriteLE32(b.begin() + x*4, a.pn[x]);\n    return b;\n}\narith_uint256 UintToArith256(const uint256 &a)\n{\n    arith_uint256 b;\n    for(int x=0; x<b.WIDTH; ++x)\n        b.pn[x] = ReadLE32(a.begin() + x*4);\n    return b;\n}\n"
  },
  {
    "path": "src/arith_uint256.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_ARITH_UINT256_H\n#define BITCOIN_ARITH_UINT256_H\n\n#include <assert.h>\n#include <cstring>\n#include <stdexcept>\n#include <stdint.h>\n#include <string>\n#include <vector>\n\nclass uint256;\n\nclass uint_error : public std::runtime_error {\npublic:\n    explicit uint_error(const std::string& str) : std::runtime_error(str) {}\n};\n\n/** Template base class for unsigned big integers. */\ntemplate<unsigned int BITS>\nclass base_uint\n{\nprotected:\n    static constexpr int WIDTH = BITS / 32;\n    uint32_t pn[WIDTH];\npublic:\n\n    base_uint()\n    {\n        static_assert(BITS/32 > 0 && BITS%32 == 0, \"Template parameter BITS must be a positive multiple of 32.\");\n\n        for (int i = 0; i < WIDTH; i++)\n            pn[i] = 0;\n    }\n\n    base_uint(const base_uint& b)\n    {\n        static_assert(BITS/32 > 0 && BITS%32 == 0, \"Template parameter BITS must be a positive multiple of 32.\");\n\n        for (int i = 0; i < WIDTH; i++)\n            pn[i] = b.pn[i];\n    }\n\n    base_uint& operator=(const base_uint& b)\n    {\n        for (int i = 0; i < WIDTH; i++)\n            pn[i] = b.pn[i];\n        return *this;\n    }\n\n    base_uint(uint64_t b)\n    {\n        static_assert(BITS/32 > 0 && BITS%32 == 0, \"Template parameter BITS must be a positive multiple of 32.\");\n\n        pn[0] = (unsigned int)b;\n        pn[1] = (unsigned int)(b >> 32);\n        for (int i = 2; i < WIDTH; i++)\n            pn[i] = 0;\n    }\n\n    explicit base_uint(const std::string& str);\n\n    bool operator!() const\n    {\n        for (int i = 0; i < WIDTH; i++)\n            if (pn[i] != 0)\n                return false;\n        return true;\n    }\n\n    const base_uint operator~() const\n    {\n        base_uint ret;\n        for (int i = 0; i < WIDTH; i++)\n            ret.pn[i] = ~pn[i];\n        return ret;\n    }\n\n    const base_uint operator-() const\n    {\n        base_uint ret;\n        for (int i = 0; i < WIDTH; i++)\n            ret.pn[i] = ~pn[i];\n        ret++;\n        return ret;\n    }\n\n    double getdouble() const;\n\n    base_uint& operator=(uint64_t b)\n    {\n        pn[0] = (unsigned int)b;\n        pn[1] = (unsigned int)(b >> 32);\n        for (int i = 2; i < WIDTH; i++)\n            pn[i] = 0;\n        return *this;\n    }\n\n    base_uint& operator^=(const base_uint& b)\n    {\n        for (int i = 0; i < WIDTH; i++)\n            pn[i] ^= b.pn[i];\n        return *this;\n    }\n\n    base_uint& operator&=(const base_uint& b)\n    {\n        for (int i = 0; i < WIDTH; i++)\n            pn[i] &= b.pn[i];\n        return *this;\n    }\n\n    base_uint& operator|=(const base_uint& b)\n    {\n        for (int i = 0; i < WIDTH; i++)\n            pn[i] |= b.pn[i];\n        return *this;\n    }\n\n    base_uint& operator^=(uint64_t b)\n    {\n        pn[0] ^= (unsigned int)b;\n        pn[1] ^= (unsigned int)(b >> 32);\n        return *this;\n    }\n\n    base_uint& operator|=(uint64_t b)\n    {\n        pn[0] |= (unsigned int)b;\n        pn[1] |= (unsigned int)(b >> 32);\n        return *this;\n    }\n\n    base_uint& operator<<=(unsigned int shift);\n    base_uint& operator>>=(unsigned int shift);\n\n    base_uint& operator+=(const base_uint& b)\n    {\n        uint64_t carry = 0;\n        for (int i = 0; i < WIDTH; i++)\n        {\n            uint64_t n = carry + pn[i] + b.pn[i];\n            pn[i] = n & 0xffffffff;\n            carry = n >> 32;\n        }\n        return *this;\n    }\n\n    base_uint& operator-=(const base_uint& b)\n    {\n        *this += -b;\n        return *this;\n    }\n\n    base_uint& operator+=(uint64_t b64)\n    {\n        base_uint b;\n        b = b64;\n        *this += b;\n        return *this;\n    }\n\n    base_uint& operator-=(uint64_t b64)\n    {\n        base_uint b;\n        b = b64;\n        *this += -b;\n        return *this;\n    }\n\n    base_uint& operator*=(uint32_t b32);\n    base_uint& operator*=(const base_uint& b);\n    base_uint& operator/=(const base_uint& b);\n\n    base_uint& operator++()\n    {\n        // prefix operator\n        int i = 0;\n        while (i < WIDTH && ++pn[i] == 0)\n            i++;\n        return *this;\n    }\n\n    const base_uint operator++(int)\n    {\n        // postfix operator\n        const base_uint ret = *this;\n        ++(*this);\n        return ret;\n    }\n\n    base_uint& operator--()\n    {\n        // prefix operator\n        int i = 0;\n        while (i < WIDTH && --pn[i] == (uint32_t)-1)\n            i++;\n        return *this;\n    }\n\n    const base_uint operator--(int)\n    {\n        // postfix operator\n        const base_uint ret = *this;\n        --(*this);\n        return ret;\n    }\n\n    int CompareTo(const base_uint& b) const;\n    bool EqualTo(uint64_t b) const;\n\n    friend inline const base_uint operator+(const base_uint& a, const base_uint& b) { return base_uint(a) += b; }\n    friend inline const base_uint operator-(const base_uint& a, const base_uint& b) { return base_uint(a) -= b; }\n    friend inline const base_uint operator*(const base_uint& a, const base_uint& b) { return base_uint(a) *= b; }\n    friend inline const base_uint operator/(const base_uint& a, const base_uint& b) { return base_uint(a) /= b; }\n    friend inline const base_uint operator|(const base_uint& a, const base_uint& b) { return base_uint(a) |= b; }\n    friend inline const base_uint operator&(const base_uint& a, const base_uint& b) { return base_uint(a) &= b; }\n    friend inline const base_uint operator^(const base_uint& a, const base_uint& b) { return base_uint(a) ^= b; }\n    friend inline const base_uint operator>>(const base_uint& a, int shift) { return base_uint(a) >>= shift; }\n    friend inline const base_uint operator<<(const base_uint& a, int shift) { return base_uint(a) <<= shift; }\n    friend inline const base_uint operator*(const base_uint& a, uint32_t b) { return base_uint(a) *= b; }\n    friend inline bool operator==(const base_uint& a, const base_uint& b) { return memcmp(a.pn, b.pn, sizeof(a.pn)) == 0; }\n    friend inline bool operator!=(const base_uint& a, const base_uint& b) { return memcmp(a.pn, b.pn, sizeof(a.pn)) != 0; }\n    friend inline bool operator>(const base_uint& a, const base_uint& b) { return a.CompareTo(b) > 0; }\n    friend inline bool operator<(const base_uint& a, const base_uint& b) { return a.CompareTo(b) < 0; }\n    friend inline bool operator>=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) >= 0; }\n    friend inline bool operator<=(const base_uint& a, const base_uint& b) { return a.CompareTo(b) <= 0; }\n    friend inline bool operator==(const base_uint& a, uint64_t b) { return a.EqualTo(b); }\n    friend inline bool operator!=(const base_uint& a, uint64_t b) { return !a.EqualTo(b); }\n\n    std::string GetHex() const;\n    void SetHex(const char* psz);\n    void SetHex(const std::string& str);\n    std::string ToString() const;\n\n    unsigned int size() const\n    {\n        return sizeof(pn);\n    }\n\n    /**\n     * Returns the position of the highest bit set plus one, or zero if the\n     * value is zero.\n     */\n    unsigned int bits() const;\n\n    uint64_t GetLow64() const\n    {\n        static_assert(WIDTH >= 2, \"Assertion WIDTH >= 2 failed (WIDTH = BITS / 32). BITS is a template parameter.\");\n        return pn[0] | (uint64_t)pn[1] << 32;\n    }\n};\n\n/** 256-bit unsigned big integer. */\nclass arith_uint256 : public base_uint<256> {\npublic:\n    arith_uint256() {}\n    arith_uint256(const base_uint<256>& b) : base_uint<256>(b) {}\n    arith_uint256(uint64_t b) : base_uint<256>(b) {}\n    explicit arith_uint256(const std::string& str) : base_uint<256>(str) {}\n\n    /**\n     * The \"compact\" format is a representation of a whole\n     * number N using an unsigned 32bit number similar to a\n     * floating point format.\n     * The most significant 8 bits are the unsigned exponent of base 256.\n     * This exponent can be thought of as \"number of bytes of N\".\n     * The lower 23 bits are the mantissa.\n     * Bit number 24 (0x800000) represents the sign of N.\n     * N = (-1^sign) * mantissa * 256^(exponent-3)\n     *\n     * Satoshi's original implementation used BN_bn2mpi() and BN_mpi2bn().\n     * MPI uses the most significant bit of the first byte as sign.\n     * Thus 0x1234560000 is compact (0x05123456)\n     * and  0xc0de000000 is compact (0x0600c0de)\n     *\n     * Bitcoin only uses this \"compact\" format for encoding difficulty\n     * targets, which are unsigned 256bit quantities.  Thus, all the\n     * complexities of the sign bit and using base 256 are probably an\n     * implementation accident.\n     */\n    arith_uint256& SetCompact(uint32_t nCompact, bool *pfNegative = nullptr, bool *pfOverflow = nullptr);\n    uint32_t GetCompact(bool fNegative = false) const;\n\n    friend uint256 ArithToUint256(const arith_uint256 &);\n    friend arith_uint256 UintToArith256(const uint256 &);\n};\n\nuint256 ArithToUint256(const arith_uint256 &);\narith_uint256 UintToArith256(const uint256 &);\n\n#endif // BITCOIN_ARITH_UINT256_H\n"
  },
  {
    "path": "src/base58.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <base58.h>\n\n#include <bech32.h>\n#include <hash.h>\n#include <script/script.h>\n#include <uint256.h>\n#include <utilstrencodings.h>\n\n#include <boost/variant/apply_visitor.hpp>\n#include <boost/variant/static_visitor.hpp>\n\n#include <algorithm>\n#include <assert.h>\n#include <string.h>\n\n\n/** All alphanumeric characters except for \"0\", \"I\", \"O\", and \"l\" */\nstatic const char* pszBase58 = \"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";\n\nbool DecodeBase58(const char* psz, std::vector<unsigned char>& vch)\n{\n    // Skip leading spaces.\n    while (*psz && isspace(*psz))\n        psz++;\n    // Skip and count leading '1's.\n    int zeroes = 0;\n    int length = 0;\n    while (*psz == '1') {\n        zeroes++;\n        psz++;\n    }\n    // Allocate enough space in big-endian base256 representation.\n    int size = strlen(psz) * 733 /1000 + 1; // log(58) / log(256), rounded up.\n    std::vector<unsigned char> b256(size);\n    // Process the characters.\n    while (*psz && !isspace(*psz)) {\n        // Decode base58 character\n        const char* ch = strchr(pszBase58, *psz);\n        if (ch == nullptr)\n            return false;\n        // Apply \"b256 = b256 * 58 + ch\".\n        int carry = ch - pszBase58;\n        int i = 0;\n        for (std::vector<unsigned char>::reverse_iterator it = b256.rbegin(); (carry != 0 || i < length) && (it != b256.rend()); ++it, ++i) {\n            carry += 58 * (*it);\n            *it = carry % 256;\n            carry /= 256;\n        }\n        assert(carry == 0);\n        length = i;\n        psz++;\n    }\n    // Skip trailing spaces.\n    while (isspace(*psz))\n        psz++;\n    if (*psz != 0)\n        return false;\n    // Skip leading zeroes in b256.\n    std::vector<unsigned char>::iterator it = b256.begin() + (size - length);\n    while (it != b256.end() && *it == 0)\n        it++;\n    // Copy result into output vector.\n    vch.reserve(zeroes + (b256.end() - it));\n    vch.assign(zeroes, 0x00);\n    while (it != b256.end())\n        vch.push_back(*(it++));\n    return true;\n}\n\nstd::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)\n{\n    // Skip & count leading zeroes.\n    int zeroes = 0;\n    int length = 0;\n    while (pbegin != pend && *pbegin == 0) {\n        pbegin++;\n        zeroes++;\n    }\n    // Allocate enough space in big-endian base58 representation.\n    int size = (pend - pbegin) * 138 / 100 + 1; // log(256) / log(58), rounded up.\n    std::vector<unsigned char> b58(size);\n    // Process the bytes.\n    while (pbegin != pend) {\n        int carry = *pbegin;\n        int i = 0;\n        // Apply \"b58 = b58 * 256 + ch\".\n        for (std::vector<unsigned char>::reverse_iterator it = b58.rbegin(); (carry != 0 || i < length) && (it != b58.rend()); it++, i++) {\n            carry += 256 * (*it);\n            *it = carry % 58;\n            carry /= 58;\n        }\n\n        assert(carry == 0);\n        length = i;\n        pbegin++;\n    }\n    // Skip leading zeroes in base58 result.\n    std::vector<unsigned char>::iterator it = b58.begin() + (size - length);\n    while (it != b58.end() && *it == 0)\n        it++;\n    // Translate the result into a string.\n    std::string str;\n    str.reserve(zeroes + (b58.end() - it));\n    str.assign(zeroes, '1');\n    while (it != b58.end())\n        str += pszBase58[*(it++)];\n    return str;\n}\n\nstd::string EncodeBase58(const std::vector<unsigned char>& vch)\n{\n    return EncodeBase58(vch.data(), vch.data() + vch.size());\n}\n\nbool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet)\n{\n    return DecodeBase58(str.c_str(), vchRet);\n}\n\nstd::string EncodeBase58Check(const std::vector<unsigned char>& vchIn)\n{\n    // add 4-byte hash check to the end\n    std::vector<unsigned char> vch(vchIn);\n    uint256 hash = Hash(vch.begin(), vch.end());\n    vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);\n    return EncodeBase58(vch);\n}\n\nbool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet)\n{\n    if (!DecodeBase58(psz, vchRet) ||\n        (vchRet.size() < 4)) {\n        vchRet.clear();\n        return false;\n    }\n    // re-calculate the checksum, ensure it matches the included 4-byte checksum\n    uint256 hash = Hash(vchRet.begin(), vchRet.end() - 4);\n    if (memcmp(&hash, &vchRet[vchRet.size() - 4], 4) != 0) {\n        vchRet.clear();\n        return false;\n    }\n    vchRet.resize(vchRet.size() - 4);\n    return true;\n}\n\nbool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet)\n{\n    return DecodeBase58Check(str.c_str(), vchRet);\n}\n\nCBase58Data::CBase58Data()\n{\n    vchVersion.clear();\n    vchData.clear();\n}\n\nvoid CBase58Data::SetData(const std::vector<unsigned char>& vchVersionIn, const void* pdata, size_t nSize)\n{\n    vchVersion = vchVersionIn;\n    vchData.resize(nSize);\n    if (!vchData.empty())\n        memcpy(vchData.data(), pdata, nSize);\n}\n\nvoid CBase58Data::SetData(const std::vector<unsigned char>& vchVersionIn, const unsigned char* pbegin, const unsigned char* pend)\n{\n    SetData(vchVersionIn, (void*)pbegin, pend - pbegin);\n}\n\nbool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes)\n{\n    std::vector<unsigned char> vchTemp;\n    bool rc58 = DecodeBase58Check(psz, vchTemp);\n    if ((!rc58) || (vchTemp.size() < nVersionBytes)) {\n        vchData.clear();\n        vchVersion.clear();\n        return false;\n    }\n    vchVersion.assign(vchTemp.begin(), vchTemp.begin() + nVersionBytes);\n    vchData.resize(vchTemp.size() - nVersionBytes);\n    if (!vchData.empty())\n        memcpy(vchData.data(), vchTemp.data() + nVersionBytes, vchData.size());\n    memory_cleanse(vchTemp.data(), vchTemp.size());\n    return true;\n}\n\nbool CBase58Data::SetString(const std::string& str)\n{\n    return SetString(str.c_str());\n}\n\nstd::string CBase58Data::ToString() const\n{\n    std::vector<unsigned char> vch = vchVersion;\n    vch.insert(vch.end(), vchData.begin(), vchData.end());\n    return EncodeBase58Check(vch);\n}\n\nint CBase58Data::CompareTo(const CBase58Data& b58) const\n{\n    if (vchVersion < b58.vchVersion)\n        return -1;\n    if (vchVersion > b58.vchVersion)\n        return 1;\n    if (vchData < b58.vchData)\n        return -1;\n    if (vchData > b58.vchData)\n        return 1;\n    return 0;\n}\n\nnamespace\n{\nclass DestinationEncoder : public boost::static_visitor<std::string>\n{\nprivate:\n    const CChainParams& m_params;\n\npublic:\n    DestinationEncoder(const CChainParams& params) : m_params(params) {}\n\n    std::string operator()(const CKeyID& id) const\n    {\n        std::vector<unsigned char> data = m_params.Base58Prefix(CChainParams::PUBKEY_ADDRESS);\n        data.insert(data.end(), id.begin(), id.end());\n        return EncodeBase58Check(data);\n    }\n\n    std::string operator()(const CScriptID& id) const\n    {\n        std::vector<unsigned char> data = m_params.Base58Prefix(CChainParams::SCRIPT_ADDRESS);\n        data.insert(data.end(), id.begin(), id.end());\n        return EncodeBase58Check(data);\n    }\n\n    std::string operator()(const WitnessV0KeyHash& id) const\n    {\n        std::vector<unsigned char> data = {0};\n        ConvertBits<8, 5, true>(data, id.begin(), id.end());\n        return bech32::Encode(m_params.Bech32HRP(), data);\n    }\n\n    std::string operator()(const WitnessV0ScriptHash& id) const\n    {\n        std::vector<unsigned char> data = {0};\n        ConvertBits<8, 5, true>(data, id.begin(), id.end());\n        return bech32::Encode(m_params.Bech32HRP(), data);\n    }\n\n    std::string operator()(const WitnessUnknown& id) const\n    {\n        if (id.version < 1 || id.version > 16 || id.length < 2 || id.length > 40) {\n            return {};\n        }\n        std::vector<unsigned char> data = {(unsigned char)id.version};\n        ConvertBits<8, 5, true>(data, id.program, id.program + id.length);\n        return bech32::Encode(m_params.Bech32HRP(), data);\n    }\n\n    std::string operator()(const CNoDestination& no) const { return {}; }\n};\n\nCTxDestination DecodeDestination(const std::string& str, const CChainParams& params)\n{\n    std::vector<unsigned char> data;\n    uint160 hash;\n    if (DecodeBase58Check(str, data)) {\n        // base58-encoded Bitcoin addresses.\n        // Public-key-hash-addresses have version 0 (or 111 testnet).\n        // The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key.\n        const std::vector<unsigned char>& pubkey_prefix = params.Base58Prefix(CChainParams::PUBKEY_ADDRESS);\n        if (data.size() == hash.size() + pubkey_prefix.size() && std::equal(pubkey_prefix.begin(), pubkey_prefix.end(), data.begin())) {\n            std::copy(data.begin() + pubkey_prefix.size(), data.end(), hash.begin());\n            return CKeyID(hash);\n        }\n        // Script-hash-addresses have version 5 (or 196 testnet).\n        // The data vector contains RIPEMD160(SHA256(cscript)), where cscript is the serialized redemption script.\n        const std::vector<unsigned char>& script_prefix = params.Base58Prefix(CChainParams::SCRIPT_ADDRESS);\n        if (data.size() == hash.size() + script_prefix.size() && std::equal(script_prefix.begin(), script_prefix.end(), data.begin())) {\n            std::copy(data.begin() + script_prefix.size(), data.end(), hash.begin());\n            return CScriptID(hash);\n        }\n    }\n    data.clear();\n    auto bech = bech32::Decode(str);\n    if (bech.second.size() > 0 && bech.first == params.Bech32HRP()) {\n        // Bech32 decoding\n        int version = bech.second[0]; // The first 5 bit symbol is the witness version (0-16)\n        // The rest of the symbols are converted witness program bytes.\n        if (ConvertBits<5, 8, false>(data, bech.second.begin() + 1, bech.second.end())) {\n            if (version == 0) {\n                {\n                    WitnessV0KeyHash keyid;\n                    if (data.size() == keyid.size()) {\n                        std::copy(data.begin(), data.end(), keyid.begin());\n                        return keyid;\n                    }\n                }\n                {\n                    WitnessV0ScriptHash scriptid;\n                    if (data.size() == scriptid.size()) {\n                        std::copy(data.begin(), data.end(), scriptid.begin());\n                        return scriptid;\n                    }\n                }\n                return CNoDestination();\n            }\n            if (version > 16 || data.size() < 2 || data.size() > 40) {\n                return CNoDestination();\n            }\n            WitnessUnknown unk;\n            unk.version = version;\n            std::copy(data.begin(), data.end(), unk.program);\n            unk.length = data.size();\n            return unk;\n        }\n    }\n    return CNoDestination();\n}\n} // namespace\n\nvoid CBitcoinSecret::SetKey(const CKey& vchSecret)\n{\n    assert(vchSecret.IsValid());\n    SetData(Params().Base58Prefix(CChainParams::SECRET_KEY), vchSecret.begin(), vchSecret.size());\n    if (vchSecret.IsCompressed())\n        vchData.push_back(1);\n}\n\nCKey CBitcoinSecret::GetKey()\n{\n    CKey ret;\n    assert(vchData.size() >= 32);\n    ret.Set(vchData.begin(), vchData.begin() + 32, vchData.size() > 32 && vchData[32] == 1);\n    return ret;\n}\n\nbool CBitcoinSecret::IsValid() const\n{\n    bool fExpectedFormat = vchData.size() == 32 || (vchData.size() == 33 && vchData[32] == 1);\n    bool fCorrectVersion = vchVersion == Params().Base58Prefix(CChainParams::SECRET_KEY);\n    return fExpectedFormat && fCorrectVersion;\n}\n\nbool CBitcoinSecret::SetString(const char* pszSecret)\n{\n    return CBase58Data::SetString(pszSecret) && IsValid();\n}\n\nbool CBitcoinSecret::SetString(const std::string& strSecret)\n{\n    return SetString(strSecret.c_str());\n}\n\nstd::string EncodeDestination(const CTxDestination& dest)\n{\n    return boost::apply_visitor(DestinationEncoder(Params()), dest);\n}\n\nCTxDestination DecodeDestination(const std::string& str)\n{\n    return DecodeDestination(str, Params());\n}\n\nbool IsValidDestinationString(const std::string& str, const CChainParams& params)\n{\n    return IsValidDestination(DecodeDestination(str, params));\n}\n\nbool IsValidDestinationString(const std::string& str)\n{\n    return IsValidDestinationString(str, Params());\n}\n"
  },
  {
    "path": "src/base58.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n/**\n * Why base-58 instead of standard base-64 encoding?\n * - Don't want 0OIl characters that look the same in some fonts and\n *      could be used to create visually identical looking data.\n * - A string with non-alphanumeric characters is not as easily accepted as input.\n * - E-mail usually won't line-break if there's no punctuation to break at.\n * - Double-clicking selects the whole string as one word if it's all alphanumeric.\n */\n#ifndef BITCOIN_BASE58_H\n#define BITCOIN_BASE58_H\n\n#include <chainparams.h>\n#include <key.h>\n#include <pubkey.h>\n#include <script/standard.h>\n#include <support/allocators/zeroafterfree.h>\n\n#include <string>\n#include <vector>\n\n/**\n * Encode a byte sequence as a base58-encoded string.\n * pbegin and pend cannot be nullptr, unless both are.\n */\nstd::string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend);\n\n/**\n * Encode a byte vector as a base58-encoded string\n */\nstd::string EncodeBase58(const std::vector<unsigned char>& vch);\n\n/**\n * Decode a base58-encoded string (psz) into a byte vector (vchRet).\n * return true if decoding is successful.\n * psz cannot be nullptr.\n */\nbool DecodeBase58(const char* psz, std::vector<unsigned char>& vchRet);\n\n/**\n * Decode a base58-encoded string (str) into a byte vector (vchRet).\n * return true if decoding is successful.\n */\nbool DecodeBase58(const std::string& str, std::vector<unsigned char>& vchRet);\n\n/**\n * Encode a byte vector into a base58-encoded string, including checksum\n */\nstd::string EncodeBase58Check(const std::vector<unsigned char>& vchIn);\n\n/**\n * Decode a base58-encoded string (psz) that includes a checksum into a byte\n * vector (vchRet), return true if decoding is successful\n */\ninline bool DecodeBase58Check(const char* psz, std::vector<unsigned char>& vchRet);\n\n/**\n * Decode a base58-encoded string (str) that includes a checksum into a byte\n * vector (vchRet), return true if decoding is successful\n */\ninline bool DecodeBase58Check(const std::string& str, std::vector<unsigned char>& vchRet);\n\n/**\n * Base class for all base58-encoded data\n */\nclass CBase58Data\n{\nprotected:\n    //! the version byte(s)\n    std::vector<unsigned char> vchVersion;\n\n    //! the actually encoded data\n    typedef std::vector<unsigned char, zero_after_free_allocator<unsigned char> > vector_uchar;\n    vector_uchar vchData;\n\n    CBase58Data();\n    void SetData(const std::vector<unsigned char> &vchVersionIn, const void* pdata, size_t nSize);\n    void SetData(const std::vector<unsigned char> &vchVersionIn, const unsigned char *pbegin, const unsigned char *pend);\n\npublic:\n    bool SetString(const char* psz, unsigned int nVersionBytes = 1);\n    bool SetString(const std::string& str);\n    std::string ToString() const;\n    int CompareTo(const CBase58Data& b58) const;\n\n    bool operator==(const CBase58Data& b58) const { return CompareTo(b58) == 0; }\n    bool operator<=(const CBase58Data& b58) const { return CompareTo(b58) <= 0; }\n    bool operator>=(const CBase58Data& b58) const { return CompareTo(b58) >= 0; }\n    bool operator< (const CBase58Data& b58) const { return CompareTo(b58) <  0; }\n    bool operator> (const CBase58Data& b58) const { return CompareTo(b58) >  0; }\n};\n\n/**\n * A base58-encoded secret key\n */\nclass CBitcoinSecret : public CBase58Data\n{\npublic:\n    void SetKey(const CKey& vchSecret);\n    CKey GetKey();\n    bool IsValid() const;\n    bool SetString(const char* pszSecret);\n    bool SetString(const std::string& strSecret);\n\n    CBitcoinSecret(const CKey& vchSecret) { SetKey(vchSecret); }\n    CBitcoinSecret() {}\n};\n\ntemplate<typename K, int Size, CChainParams::Base58Type Type> class CBitcoinExtKeyBase : public CBase58Data\n{\npublic:\n    void SetKey(const K &key) {\n        unsigned char vch[Size];\n        key.Encode(vch);\n        SetData(Params().Base58Prefix(Type), vch, vch+Size);\n    }\n\n    K GetKey() {\n        K ret;\n        if (vchData.size() == Size) {\n            // If base58 encoded data does not hold an ext key, return a !IsValid() key\n            ret.Decode(vchData.data());\n        }\n        return ret;\n    }\n\n    CBitcoinExtKeyBase(const K &key) {\n        SetKey(key);\n    }\n\n    CBitcoinExtKeyBase(const std::string& strBase58c) {\n        SetString(strBase58c.c_str(), Params().Base58Prefix(Type).size());\n    }\n\n    CBitcoinExtKeyBase() {}\n};\n\ntypedef CBitcoinExtKeyBase<CExtKey, BIP32_EXTKEY_SIZE, CChainParams::EXT_SECRET_KEY> CBitcoinExtKey;\ntypedef CBitcoinExtKeyBase<CExtPubKey, BIP32_EXTKEY_SIZE, CChainParams::EXT_PUBLIC_KEY> CBitcoinExtPubKey;\n\nstd::string EncodeDestination(const CTxDestination& dest);\nCTxDestination DecodeDestination(const std::string& str);\nbool IsValidDestinationString(const std::string& str);\nbool IsValidDestinationString(const std::string& str, const CChainParams& params);\n\n#endif // BITCOIN_BASE58_H\n"
  },
  {
    "path": "src/bech32.cpp",
    "content": "// Copyright (c) 2017 Pieter Wuille\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bech32.h>\n\nnamespace\n{\n\ntypedef std::vector<uint8_t> data;\n\n/** The Bech32 character set for encoding. */\nconst char* CHARSET = \"qpzry9x8gf2tvdw0s3jn54khce6mua7l\";\n\n/** The Bech32 character set for decoding. */\nconst int8_t CHARSET_REV[128] = {\n    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n    15, -1, 10, 17, 21, 20, 26, 30,  7,  5, -1, -1, -1, -1, -1, -1,\n    -1, 29, -1, 24, 13, 25,  9,  8, 23, -1, 18, 22, 31, 27, 19, -1,\n     1,  0,  3, 16, 11, 28, 12, 14,  6,  4,  2, -1, -1, -1, -1, -1,\n    -1, 29, -1, 24, 13, 25,  9,  8, 23, -1, 18, 22, 31, 27, 19, -1,\n     1,  0,  3, 16, 11, 28, 12, 14,  6,  4,  2, -1, -1, -1, -1, -1\n};\n\n/** Concatenate two byte arrays. */\ndata Cat(data x, const data& y)\n{\n    x.insert(x.end(), y.begin(), y.end());\n    return x;\n}\n\n/** This function will compute what 6 5-bit values to XOR into the last 6 input values, in order to\n *  make the checksum 0. These 6 values are packed together in a single 30-bit integer. The higher\n *  bits correspond to earlier values. */\nuint32_t PolyMod(const data& v)\n{\n    // The input is interpreted as a list of coefficients of a polynomial over F = GF(32), with an\n    // implicit 1 in front. If the input is [v0,v1,v2,v3,v4], that polynomial is v(x) =\n    // 1*x^5 + v0*x^4 + v1*x^3 + v2*x^2 + v3*x + v4. The implicit 1 guarantees that\n    // [v0,v1,v2,...] has a distinct checksum from [0,v0,v1,v2,...].\n\n    // The output is a 30-bit integer whose 5-bit groups are the coefficients of the remainder of\n    // v(x) mod g(x), where g(x) is the Bech32 generator,\n    // x^6 + {29}x^5 + {22}x^4 + {20}x^3 + {21}x^2 + {29}x + {18}. g(x) is chosen in such a way\n    // that the resulting code is a BCH code, guaranteeing detection of up to 3 errors within a\n    // window of 1023 characters. Among the various possible BCH codes, one was selected to in\n    // fact guarantee detection of up to 4 errors within a window of 89 characters.\n\n    // Note that the coefficients are elements of GF(32), here represented as decimal numbers\n    // between {}. In this finite field, addition is just XOR of the corresponding numbers. For\n    // example, {27} + {13} = {27 ^ 13} = {22}. Multiplication is more complicated, and requires\n    // treating the bits of values themselves as coefficients of a polynomial over a smaller field,\n    // GF(2), and multiplying those polynomials mod a^5 + a^3 + 1. For example, {5} * {26} =\n    // (a^2 + 1) * (a^4 + a^3 + a) = (a^4 + a^3 + a) * a^2 + (a^4 + a^3 + a) = a^6 + a^5 + a^4 + a\n    // = a^3 + 1 (mod a^5 + a^3 + 1) = {9}.\n\n    // During the course of the loop below, `c` contains the bitpacked coefficients of the\n    // polynomial constructed from just the values of v that were processed so far, mod g(x). In\n    // the above example, `c` initially corresponds to 1 mod (x), and after processing 2 inputs of\n    // v, it corresponds to x^2 + v0*x + v1 mod g(x). As 1 mod g(x) = 1, that is the starting value\n    // for `c`.\n    uint32_t c = 1;\n    for (auto v_i : v) {\n        // We want to update `c` to correspond to a polynomial with one extra term. If the initial\n        // value of `c` consists of the coefficients of c(x) = f(x) mod g(x), we modify it to\n        // correspond to c'(x) = (f(x) * x + v_i) mod g(x), where v_i is the next input to\n        // process. Simplifying:\n        // c'(x) = (f(x) * x + v_i) mod g(x)\n        //         ((f(x) mod g(x)) * x + v_i) mod g(x)\n        //         (c(x) * x + v_i) mod g(x)\n        // If c(x) = c0*x^5 + c1*x^4 + c2*x^3 + c3*x^2 + c4*x + c5, we want to compute\n        // c'(x) = (c0*x^5 + c1*x^4 + c2*x^3 + c3*x^2 + c4*x + c5) * x + v_i mod g(x)\n        //       = c0*x^6 + c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + v_i mod g(x)\n        //       = c0*(x^6 mod g(x)) + c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + v_i\n        // If we call (x^6 mod g(x)) = k(x), this can be written as\n        // c'(x) = (c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + v_i) + c0*k(x)\n\n        // First, determine the value of c0:\n        uint8_t c0 = c >> 25;\n\n        // Then compute c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + v_i:\n        c = ((c & 0x1ffffff) << 5) ^ v_i;\n\n        // Finally, for each set bit n in c0, conditionally add {2^n}k(x):\n        if (c0 & 1)  c ^= 0x3b6a57b2; //     k(x) = {29}x^5 + {22}x^4 + {20}x^3 + {21}x^2 + {29}x + {18}\n        if (c0 & 2)  c ^= 0x26508e6d; //  {2}k(x) = {19}x^5 +  {5}x^4 +     x^3 +  {3}x^2 + {19}x + {13}\n        if (c0 & 4)  c ^= 0x1ea119fa; //  {4}k(x) = {15}x^5 + {10}x^4 +  {2}x^3 +  {6}x^2 + {15}x + {26}\n        if (c0 & 8)  c ^= 0x3d4233dd; //  {8}k(x) = {30}x^5 + {20}x^4 +  {4}x^3 + {12}x^2 + {30}x + {29}\n        if (c0 & 16) c ^= 0x2a1462b3; // {16}k(x) = {21}x^5 +     x^4 +  {8}x^3 + {24}x^2 + {21}x + {19}\n    }\n    return c;\n}\n\n/** Convert to lower case. */\ninline unsigned char LowerCase(unsigned char c)\n{\n    return (c >= 'A' && c <= 'Z') ? (c - 'A') + 'a' : c;\n}\n\n/** Expand a HRP for use in checksum computation. */\ndata ExpandHRP(const std::string& hrp)\n{\n    data ret;\n    ret.reserve(hrp.size() + 90);\n    ret.resize(hrp.size() * 2 + 1);\n    for (size_t i = 0; i < hrp.size(); ++i) {\n        unsigned char c = hrp[i];\n        ret[i] = c >> 5;\n        ret[i + hrp.size() + 1] = c & 0x1f;\n    }\n    ret[hrp.size()] = 0;\n    return ret;\n}\n\n/** Verify a checksum. */\nbool VerifyChecksum(const std::string& hrp, const data& values)\n{\n    // PolyMod computes what value to xor into the final values to make the checksum 0. However,\n    // if we required that the checksum was 0, it would be the case that appending a 0 to a valid\n    // list of values would result in a new valid list. For that reason, Bech32 requires the\n    // resulting checksum to be 1 instead.\n    return PolyMod(Cat(ExpandHRP(hrp), values)) == 1;\n}\n\n/** Create a checksum. */\ndata CreateChecksum(const std::string& hrp, const data& values)\n{\n    data enc = Cat(ExpandHRP(hrp), values);\n    enc.resize(enc.size() + 6); // Append 6 zeroes\n    uint32_t mod = PolyMod(enc) ^ 1; // Determine what to XOR into those 6 zeroes.\n    data ret(6);\n    for (size_t i = 0; i < 6; ++i) {\n        // Convert the 5-bit groups in mod to checksum values.\n        ret[i] = (mod >> (5 * (5 - i))) & 31;\n    }\n    return ret;\n}\n\n} // namespace\n\nnamespace bech32\n{\n\n/** Encode a Bech32 string. */\nstd::string Encode(const std::string& hrp, const data& values) {\n    data checksum = CreateChecksum(hrp, values);\n    data combined = Cat(values, checksum);\n    std::string ret = hrp + '1';\n    ret.reserve(ret.size() + combined.size());\n    for (auto c : combined) {\n        ret += CHARSET[c];\n    }\n    return ret;\n}\n\n/** Decode a Bech32 string. */\nstd::pair<std::string, data> Decode(const std::string& str) {\n    bool lower = false, upper = false;\n    for (size_t i = 0; i < str.size(); ++i) {\n        unsigned char c = str[i];\n        if (c < 33 || c > 126) return {};\n        if (c >= 'a' && c <= 'z') lower = true;\n        if (c >= 'A' && c <= 'Z') upper = true;\n    }\n    if (lower && upper) return {};\n    size_t pos = str.rfind('1');\n    if (str.size() > 90 || pos == str.npos || pos == 0 || pos + 7 > str.size()) {\n        return {};\n    }\n    data values(str.size() - 1 - pos);\n    for (size_t i = 0; i < str.size() - 1 - pos; ++i) {\n        unsigned char c = str[i + pos + 1];\n        int8_t rev = (c < 33 || c > 126) ? -1 : CHARSET_REV[c];\n        if (rev == -1) {\n            return {};\n        }\n        values[i] = rev;\n    }\n    std::string hrp;\n    for (size_t i = 0; i < pos; ++i) {\n        hrp += LowerCase(str[i]);\n    }\n    if (!VerifyChecksum(hrp, values)) {\n        return {};\n    }\n    return {hrp, data(values.begin(), values.end() - 6)};\n}\n\n} // namespace bech32\n"
  },
  {
    "path": "src/bech32.h",
    "content": "// Copyright (c) 2017 Pieter Wuille\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n// Bech32 is a string encoding format used in newer address types.\n// The output consists of a human-readable part (alphanumeric), a\n// separator character (1), and a base32 data section, the last\n// 6 characters of which are a checksum.\n//\n// For more information, see BIP 173.\n\n#include <stdint.h>\n#include <string>\n#include <vector>\n\nnamespace bech32\n{\n\n/** Encode a Bech32 string. Returns the empty string in case of failure. */\nstd::string Encode(const std::string& hrp, const std::vector<uint8_t>& values);\n\n/** Decode a Bech32 string. Returns (hrp, data). Empty hrp means failure. */\nstd::pair<std::string, std::vector<uint8_t>> Decode(const std::string& str);\n\n} // namespace bech32\n"
  },
  {
    "path": "src/bench/.gitignore",
    "content": "bench_sugarchain\n"
  },
  {
    "path": "src/bench/Examples.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n#include <validation.h>\n#include <utiltime.h>\n\n// Sanity test: this should loop ten times, and\n// min/max/average should be close to 7ms. (was 100ms)\nstatic void Sleep7ms(benchmark::State& state)\n{\n    while (state.KeepRunning()) {\n        MilliSleep(7);\n    }\n}\n\nBENCHMARK(Sleep7ms, 10);\n\n// Extremely fast-running benchmark:\n#include <math.h>\n\nvolatile double sum = 0.0; // volatile, global so not optimized away\n\nstatic void Trig(benchmark::State& state)\n{\n    double d = 0.01;\n    while (state.KeepRunning()) {\n        sum += sin(d);\n        d += 0.000001;\n    }\n}\n\nBENCHMARK(Trig, 12 * 1000 * 1000);\n"
  },
  {
    "path": "src/bench/base58.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n\n#include <validation.h>\n#include <base58.h>\n\n#include <array>\n#include <vector>\n#include <string>\n\n\nstatic void Base58Encode(benchmark::State& state)\n{\n    static const std::array<unsigned char, 32> buff = {\n        {\n            17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147,\n            227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90,\n            200, 24\n        }\n    };\n    while (state.KeepRunning()) {\n        EncodeBase58(buff.data(), buff.data() + buff.size());\n    }\n}\n\n\nstatic void Base58CheckEncode(benchmark::State& state)\n{\n    static const std::array<unsigned char, 32> buff = {\n        {\n            17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147,\n            227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90,\n            200, 24\n        }\n    };\n    std::vector<unsigned char> vch;\n    vch.assign(buff.begin(), buff.end());\n    while (state.KeepRunning()) {\n        EncodeBase58Check(vch);\n    }\n}\n\n\nstatic void Base58Decode(benchmark::State& state)\n{\n    const char* addr = \"17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhem\";\n    std::vector<unsigned char> vch;\n    while (state.KeepRunning()) {\n        DecodeBase58(addr, vch);\n    }\n}\n\n\nBENCHMARK(Base58Encode, 470 * 1000);\nBENCHMARK(Base58CheckEncode, 320 * 1000);\nBENCHMARK(Base58Decode, 800 * 1000);\n"
  },
  {
    "path": "src/bench/bench.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n#include <bench/perf.h>\n\n#include <assert.h>\n#include <iostream>\n#include <iomanip>\n#include <algorithm>\n#include <regex>\n#include <numeric>\n\nvoid benchmark::ConsolePrinter::header()\n{\n    std::cout << \"# Benchmark, evals, iterations, total, min, max, median\" << std::endl;\n}\n\nvoid benchmark::ConsolePrinter::result(const State& state)\n{\n    auto results = state.m_elapsed_results;\n    std::sort(results.begin(), results.end());\n\n    double total = state.m_num_iters * std::accumulate(results.begin(), results.end(), 0.0);\n\n    double front = 0;\n    double back = 0;\n    double median = 0;\n\n    if (!results.empty()) {\n        front = results.front();\n        back = results.back();\n\n        size_t mid = results.size() / 2;\n        median = results[mid];\n        if (0 == results.size() % 2) {\n            median = (results[mid] + results[mid + 1]) / 2;\n        }\n    }\n\n    std::cout << std::setprecision(6);\n    std::cout << state.m_name << \", \" << state.m_num_evals << \", \" << state.m_num_iters << \", \" << total << \", \" << front << \", \" << back << \", \" << median << std::endl;\n}\n\nvoid benchmark::ConsolePrinter::footer() {}\nbenchmark::PlotlyPrinter::PlotlyPrinter(std::string plotly_url, int64_t width, int64_t height)\n    : m_plotly_url(plotly_url), m_width(width), m_height(height)\n{\n}\n\nvoid benchmark::PlotlyPrinter::header()\n{\n    std::cout << \"<html><head>\"\n              << \"<script src=\\\"\" << m_plotly_url << \"\\\"></script>\"\n              << \"</head><body><div id=\\\"myDiv\\\" style=\\\"width:\" << m_width << \"px; height:\" << m_height << \"px\\\"></div>\"\n              << \"<script> var data = [\"\n              << std::endl;\n}\n\nvoid benchmark::PlotlyPrinter::result(const State& state)\n{\n    std::cout << \"{ \" << std::endl\n              << \"  name: '\" << state.m_name << \"', \" << std::endl\n              << \"  y: [\";\n\n    const char* prefix = \"\";\n    for (const auto& e : state.m_elapsed_results) {\n        std::cout << prefix << std::setprecision(6) << e;\n        prefix = \", \";\n    }\n    std::cout << \"],\" << std::endl\n              << \"  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\"\n              << std::endl\n              << \"},\" << std::endl;\n}\n\nvoid benchmark::PlotlyPrinter::footer()\n{\n    std::cout << \"]; var layout = { showlegend: false, yaxis: { rangemode: 'tozero', autorange: true } };\"\n              << \"Plotly.newPlot('myDiv', data, layout);\"\n              << \"</script></body></html>\";\n}\n\n\nbenchmark::BenchRunner::BenchmarkMap& benchmark::BenchRunner::benchmarks()\n{\n    static std::map<std::string, Bench> benchmarks_map;\n    return benchmarks_map;\n}\n\nbenchmark::BenchRunner::BenchRunner(std::string name, benchmark::BenchFunction func, uint64_t num_iters_for_one_second)\n{\n    benchmarks().insert(std::make_pair(name, Bench{func, num_iters_for_one_second}));\n}\n\nvoid benchmark::BenchRunner::RunAll(Printer& printer, uint64_t num_evals, double scaling, const std::string& filter, bool is_list_only)\n{\n    perf_init();\n    if (!std::ratio_less_equal<benchmark::clock::period, std::micro>::value) {\n        std::cerr << \"WARNING: Clock precision is worse than microsecond - benchmarks may be less accurate!\\n\";\n    }\n#ifdef DEBUG\n    std::cerr << \"WARNING: This is a debug build - may result in slower benchmarks.\\n\";\n#endif\n\n    std::regex reFilter(filter);\n    std::smatch baseMatch;\n\n    printer.header();\n\n    for (const auto& p : benchmarks()) {\n        if (!std::regex_match(p.first, baseMatch, reFilter)) {\n            continue;\n        }\n\n        uint64_t num_iters = static_cast<uint64_t>(p.second.num_iters_for_one_second * scaling);\n        if (0 == num_iters) {\n            num_iters = 1;\n        }\n        State state(p.first, num_evals, num_iters, printer);\n        if (!is_list_only) {\n            p.second.func(state);\n        }\n        printer.result(state);\n    }\n\n    printer.footer();\n\n    perf_fini();\n}\n\nbool benchmark::State::UpdateTimer(const benchmark::time_point current_time)\n{\n    if (m_start_time != time_point()) {\n        std::chrono::duration<double> diff = current_time - m_start_time;\n        m_elapsed_results.push_back(diff.count() / m_num_iters);\n\n        if (m_elapsed_results.size() == m_num_evals) {\n            return false;\n        }\n    }\n\n    m_num_iters_left = m_num_iters - 1;\n    return true;\n}\n"
  },
  {
    "path": "src/bench/bench.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_BENCH_BENCH_H\n#define BITCOIN_BENCH_BENCH_H\n\n#include <functional>\n#include <limits>\n#include <map>\n#include <string>\n#include <vector>\n#include <chrono>\n\n#include <boost/preprocessor/cat.hpp>\n#include <boost/preprocessor/stringize.hpp>\n\n// Simple micro-benchmarking framework; API mostly matches a subset of the Google Benchmark\n// framework (see https://github.com/google/benchmark)\n// Why not use the Google Benchmark framework? Because adding Yet Another Dependency\n// (that uses cmake as its build system and has lots of features we don't need) isn't\n// worth it.\n\n/*\n * Usage:\n\nstatic void CODE_TO_TIME(benchmark::State& state)\n{\n    ... do any setup needed...\n    while (state.KeepRunning()) {\n       ... do stuff you want to time...\n    }\n    ... do any cleanup needed...\n}\n\n// default to running benchmark for 5000 iterations\nBENCHMARK(CODE_TO_TIME, 5000);\n\n */\n\nnamespace benchmark {\n// In case high_resolution_clock is steady, prefer that, otherwise use steady_clock.\nstruct best_clock {\n    using hi_res_clock = std::chrono::high_resolution_clock;\n    using steady_clock = std::chrono::steady_clock;\n    using type = std::conditional<hi_res_clock::is_steady, hi_res_clock, steady_clock>::type;\n};\nusing clock = best_clock::type;\nusing time_point = clock::time_point;\nusing duration = clock::duration;\n\nclass Printer;\n\nclass State\n{\npublic:\n    std::string m_name;\n    uint64_t m_num_iters_left;\n    const uint64_t m_num_iters;\n    const uint64_t m_num_evals;\n    std::vector<double> m_elapsed_results;\n    time_point m_start_time;\n\n    bool UpdateTimer(time_point finish_time);\n\n    State(std::string name, uint64_t num_evals, double num_iters, Printer& printer) : m_name(name), m_num_iters_left(0), m_num_iters(num_iters), m_num_evals(num_evals)\n    {\n    }\n\n    inline bool KeepRunning()\n    {\n        if (m_num_iters_left--) {\n            return true;\n        }\n\n        bool result = UpdateTimer(clock::now());\n        // measure again so runtime of UpdateTimer is not included\n        m_start_time = clock::now();\n        return result;\n    }\n};\n\ntypedef std::function<void(State&)> BenchFunction;\n\nclass BenchRunner\n{\n    struct Bench {\n        BenchFunction func;\n        uint64_t num_iters_for_one_second;\n    };\n    typedef std::map<std::string, Bench> BenchmarkMap;\n    static BenchmarkMap& benchmarks();\n\npublic:\n    BenchRunner(std::string name, BenchFunction func, uint64_t num_iters_for_one_second);\n\n    static void RunAll(Printer& printer, uint64_t num_evals, double scaling, const std::string& filter, bool is_list_only);\n};\n\n// interface to output benchmark results.\nclass Printer\n{\npublic:\n    virtual ~Printer() {}\n    virtual void header() = 0;\n    virtual void result(const State& state) = 0;\n    virtual void footer() = 0;\n};\n\n// default printer to console, shows min, max, median.\nclass ConsolePrinter : public Printer\n{\npublic:\n    void header();\n    void result(const State& state);\n    void footer();\n};\n\n// creates box plot with plotly.js\nclass PlotlyPrinter : public Printer\n{\npublic:\n    PlotlyPrinter(std::string plotly_url, int64_t width, int64_t height);\n    void header();\n    void result(const State& state);\n    void footer();\n\nprivate:\n    std::string m_plotly_url;\n    int64_t m_width;\n    int64_t m_height;\n};\n}\n\n\n// BENCHMARK(foo, num_iters_for_one_second) expands to:  benchmark::BenchRunner bench_11foo(\"foo\", num_iterations);\n// Choose a num_iters_for_one_second that takes roughly 1 second. The goal is that all benchmarks should take approximately\n// the same time, and scaling factor can be used that the total time is appropriate for your system.\n#define BENCHMARK(n, num_iters_for_one_second) \\\n    benchmark::BenchRunner BOOST_PP_CAT(bench_, BOOST_PP_CAT(__LINE__, n))(BOOST_PP_STRINGIZE(n), n, (num_iters_for_one_second));\n\n#endif // BITCOIN_BENCH_BENCH_H\n"
  },
  {
    "path": "src/bench/bench_bitcoin.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n\n#include <crypto/sha256.h>\n#include <key.h>\n#include <validation.h>\n#include <util.h>\n#include <random.h>\n\n#include <boost/lexical_cast.hpp>\n\n#include <memory>\n\nstatic const int64_t DEFAULT_BENCH_EVALUATIONS = 5;\nstatic const char* DEFAULT_BENCH_FILTER = \".*\";\nstatic const char* DEFAULT_BENCH_SCALING = \"1.0\";\nstatic const char* DEFAULT_BENCH_PRINTER = \"console\";\nstatic const char* DEFAULT_PLOT_PLOTLYURL = \"https://cdn.plot.ly/plotly-latest.min.js\";\nstatic const int64_t DEFAULT_PLOT_WIDTH = 1024;\nstatic const int64_t DEFAULT_PLOT_HEIGHT = 768;\n\nint\nmain(int argc, char** argv)\n{\n    gArgs.ParseParameters(argc, argv);\n\n    if (gArgs.IsArgSet(\"-?\") || gArgs.IsArgSet(\"-h\") || gArgs.IsArgSet(\"-help\")) {\n        std::cout << HelpMessageGroup(_(\"Options:\"))\n                  << HelpMessageOpt(\"-?\", _(\"Print this help message and exit\"))\n                  << HelpMessageOpt(\"-list\", _(\"List benchmarks without executing them. Can be combined with -scaling and -filter\"))\n                  << HelpMessageOpt(\"-evals=<n>\", strprintf(_(\"Number of measurement evaluations to perform. (default: %u)\"), DEFAULT_BENCH_EVALUATIONS))\n                  << HelpMessageOpt(\"-filter=<regex>\", strprintf(_(\"Regular expression filter to select benchmark by name (default: %s)\"), DEFAULT_BENCH_FILTER))\n                  << HelpMessageOpt(\"-scaling=<n>\", strprintf(_(\"Scaling factor for benchmark's runtime (default: %u)\"), DEFAULT_BENCH_SCALING))\n                  << HelpMessageOpt(\"-printer=(console|plot)\", strprintf(_(\"Choose printer format. console: print data to console. plot: Print results as HTML graph (default: %s)\"), DEFAULT_BENCH_PRINTER))\n                  << HelpMessageOpt(\"-plot-plotlyurl=<uri>\", strprintf(_(\"URL to use for plotly.js (default: %s)\"), DEFAULT_PLOT_PLOTLYURL))\n                  << HelpMessageOpt(\"-plot-width=<x>\", strprintf(_(\"Plot width in pixel (default: %u)\"), DEFAULT_PLOT_WIDTH))\n                  << HelpMessageOpt(\"-plot-height=<x>\", strprintf(_(\"Plot height in pixel (default: %u)\"), DEFAULT_PLOT_HEIGHT));\n\n        return 0;\n    }\n\n    SHA256AutoDetect();\n    RandomInit();\n    ECC_Start();\n    SetupEnvironment();\n    fPrintToDebugLog = false; // don't want to write to debug.log file\n\n    int64_t evaluations = gArgs.GetArg(\"-evals\", DEFAULT_BENCH_EVALUATIONS);\n    std::string regex_filter = gArgs.GetArg(\"-filter\", DEFAULT_BENCH_FILTER);\n    std::string scaling_str = gArgs.GetArg(\"-scaling\", DEFAULT_BENCH_SCALING);\n    bool is_list_only = gArgs.GetBoolArg(\"-list\", false);\n\n    double scaling_factor = boost::lexical_cast<double>(scaling_str);\n\n\n    std::unique_ptr<benchmark::Printer> printer(new benchmark::ConsolePrinter());\n    std::string printer_arg = gArgs.GetArg(\"-printer\", DEFAULT_BENCH_PRINTER);\n    if (\"plot\" == printer_arg) {\n        printer.reset(new benchmark::PlotlyPrinter(\n            gArgs.GetArg(\"-plot-plotlyurl\", DEFAULT_PLOT_PLOTLYURL),\n            gArgs.GetArg(\"-plot-width\", DEFAULT_PLOT_WIDTH),\n            gArgs.GetArg(\"-plot-height\", DEFAULT_PLOT_HEIGHT)));\n    }\n\n    benchmark::BenchRunner::RunAll(*printer, evaluations, scaling_factor, regex_filter, is_list_only);\n\n    ECC_Stop();\n}\n"
  },
  {
    "path": "src/bench/bench_sugarchain.sh",
    "content": "./bench_sugarchain -printer=console > ./result/bench_sugarchain.txt\n./bench_sugarchain -printer=plot > ./result/bench_sugarchain.html\n"
  },
  {
    "path": "src/bench/ccoins_caching.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n#include <coins.h>\n#include <policy/policy.h>\n#include <wallet/crypter.h>\n\n#include <vector>\n\n// FIXME: Dedup with SetupDummyInputs in test/transaction_tests.cpp.\n//\n// Helper: create two dummy transactions, each with\n// two outputs.  The first has 11 and 50 CENT outputs\n// paid to a TX_PUBKEY, the second 21 and 22 CENT outputs\n// paid to a TX_PUBKEYHASH.\n//\nstatic std::vector<CMutableTransaction>\nSetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsViewCache& coinsRet)\n{\n    std::vector<CMutableTransaction> dummyTransactions;\n    dummyTransactions.resize(2);\n\n    // Add some keys to the keystore:\n    CKey key[4];\n    for (int i = 0; i < 4; i++) {\n        key[i].MakeNewKey(i % 2);\n        keystoreRet.AddKey(key[i]);\n    }\n\n    // Create some dummy input transactions\n    dummyTransactions[0].vout.resize(2);\n    dummyTransactions[0].vout[0].nValue = 11 * CENT;\n    dummyTransactions[0].vout[0].scriptPubKey << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG;\n    dummyTransactions[0].vout[1].nValue = 50 * CENT;\n    dummyTransactions[0].vout[1].scriptPubKey << ToByteVector(key[1].GetPubKey()) << OP_CHECKSIG;\n    AddCoins(coinsRet, dummyTransactions[0], 0);\n\n    dummyTransactions[1].vout.resize(2);\n    dummyTransactions[1].vout[0].nValue = 21 * CENT;\n    dummyTransactions[1].vout[0].scriptPubKey = GetScriptForDestination(key[2].GetPubKey().GetID());\n    dummyTransactions[1].vout[1].nValue = 22 * CENT;\n    dummyTransactions[1].vout[1].scriptPubKey = GetScriptForDestination(key[3].GetPubKey().GetID());\n    AddCoins(coinsRet, dummyTransactions[1], 0);\n\n    return dummyTransactions;\n}\n\n// Microbenchmark for simple accesses to a CCoinsViewCache database. Note from\n// laanwj, \"replicating the actual usage patterns of the client is hard though,\n// many times micro-benchmarks of the database showed completely different\n// characteristics than e.g. reindex timings. But that's not a requirement of\n// every benchmark.\"\n// (https://github.com/bitcoin/bitcoin/issues/7883#issuecomment-224807484)\nstatic void CCoinsCaching(benchmark::State& state)\n{\n    CBasicKeyStore keystore;\n    CCoinsView coinsDummy;\n    CCoinsViewCache coins(&coinsDummy);\n    std::vector<CMutableTransaction> dummyTransactions = SetupDummyInputs(keystore, coins);\n\n    CMutableTransaction t1;\n    t1.vin.resize(3);\n    t1.vin[0].prevout.hash = dummyTransactions[0].GetHash();\n    t1.vin[0].prevout.n = 1;\n    t1.vin[0].scriptSig << std::vector<unsigned char>(65, 0);\n    t1.vin[1].prevout.hash = dummyTransactions[1].GetHash();\n    t1.vin[1].prevout.n = 0;\n    t1.vin[1].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);\n    t1.vin[2].prevout.hash = dummyTransactions[1].GetHash();\n    t1.vin[2].prevout.n = 1;\n    t1.vin[2].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);\n    t1.vout.resize(2);\n    t1.vout[0].nValue = 90 * CENT;\n    t1.vout[0].scriptPubKey << OP_1;\n\n    // Benchmark.\n    while (state.KeepRunning()) {\n        bool success = AreInputsStandard(t1, coins);\n        assert(success);\n        CAmount value = coins.GetValueIn(t1);\n        assert(value == (50 + 21 + 22) * CENT);\n    }\n}\n\nBENCHMARK(CCoinsCaching, 170 * 1000);\n"
  },
  {
    "path": "src/bench/checkblock.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n\n#include <chainparams.h>\n#include <validation.h>\n#include <streams.h>\n#include <consensus/validation.h>\n\nnamespace block_bench {\n#include <bench/data/block413567.raw.h>\n} // namespace block_bench\n\n// These are the two major time-sinks which happen after we have fully received\n// a block off the wire, but before we can relay the block on to peers using\n// compact block relay.\n\nstatic void DeserializeBlockTest(benchmark::State& state)\n{\n    CDataStream stream((const char*)block_bench::block413567,\n            (const char*)&block_bench::block413567[sizeof(block_bench::block413567)],\n            SER_NETWORK, PROTOCOL_VERSION);\n    char a = '\\0';\n    stream.write(&a, 1); // Prevent compaction\n\n    while (state.KeepRunning()) {\n        CBlock block;\n        stream >> block;\n        assert(stream.Rewind(sizeof(block_bench::block413567)));\n    }\n}\n\nstatic void DeserializeAndCheckBlockTest(benchmark::State& state)\n{\n    CDataStream stream((const char*)block_bench::block413567,\n            (const char*)&block_bench::block413567[sizeof(block_bench::block413567)],\n            SER_NETWORK, PROTOCOL_VERSION);\n    char a = '\\0';\n    stream.write(&a, 1); // Prevent compaction\n\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN);\n\n    while (state.KeepRunning()) {\n        CBlock block; // Note that CBlock caches its checked state, so we need to recreate it here\n        stream >> block;\n        assert(stream.Rewind(sizeof(block_bench::block413567)));\n\n        CValidationState validationState;\n\n        /* // BEGIN - TESTS_DISABLED\n        assert(CheckBlock(block, validationState, chainParams->GetConsensus()));\n        */ // END - TESTS_DISABLED\n    }\n}\n\nBENCHMARK(DeserializeBlockTest, 130);\nBENCHMARK(DeserializeAndCheckBlockTest, 160);\n"
  },
  {
    "path": "src/bench/checkqueue.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n#include <util.h>\n#include <validation.h>\n#include <checkqueue.h>\n#include <prevector.h>\n#include <vector>\n#include <boost/thread/thread.hpp>\n#include <random.h>\n\n\nstatic const int MIN_CORES = 2;\nstatic const size_t BATCHES = 101;\nstatic const size_t BATCH_SIZE = 30;\nstatic const int PREVECTOR_SIZE = 28;\nstatic const unsigned int QUEUE_BATCH_SIZE = 128;\n\n// This Benchmark tests the CheckQueue with a slightly realistic workload,\n// where checks all contain a prevector that is indirect 50% of the time\n// and there is a little bit of work done between calls to Add.\nstatic void CCheckQueueSpeedPrevectorJob(benchmark::State& state)\n{\n    struct PrevectorJob {\n        prevector<PREVECTOR_SIZE, uint8_t> p;\n        PrevectorJob(){\n        }\n        explicit PrevectorJob(FastRandomContext& insecure_rand){\n            p.resize(insecure_rand.randrange(PREVECTOR_SIZE*2));\n        }\n        bool operator()()\n        {\n            return true;\n        }\n        void swap(PrevectorJob& x){p.swap(x.p);};\n    };\n    CCheckQueue<PrevectorJob> queue {QUEUE_BATCH_SIZE};\n    boost::thread_group tg;\n    for (auto x = 0; x < std::max(MIN_CORES, GetNumCores()); ++x) {\n       tg.create_thread([&]{queue.Thread();});\n    }\n    while (state.KeepRunning()) {\n        // Make insecure_rand here so that each iteration is identical.\n        FastRandomContext insecure_rand(true);\n        CCheckQueueControl<PrevectorJob> control(&queue);\n        std::vector<std::vector<PrevectorJob>> vBatches(BATCHES);\n        for (auto& vChecks : vBatches) {\n            vChecks.reserve(BATCH_SIZE);\n            for (size_t x = 0; x < BATCH_SIZE; ++x)\n                vChecks.emplace_back(insecure_rand);\n            control.Add(vChecks);\n        }\n        // control waits for completion by RAII, but\n        // it is done explicitly here for clarity\n        control.Wait();\n    }\n    tg.interrupt_all();\n    tg.join_all();\n}\nBENCHMARK(CCheckQueueSpeedPrevectorJob, 1400);\n"
  },
  {
    "path": "src/bench/coin_selection.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n#include <wallet/wallet.h>\n\n#include <set>\n\nstatic void addCoin(const CAmount& nValue, const CWallet& wallet, std::vector<COutput>& vCoins)\n{\n    int nInput = 0;\n\n    static int nextLockTime = 0;\n    CMutableTransaction tx;\n    tx.nLockTime = nextLockTime++; // so all transactions get different hashes\n    tx.vout.resize(nInput + 1);\n    tx.vout[nInput].nValue = nValue;\n    CWalletTx* wtx = new CWalletTx(&wallet, MakeTransactionRef(std::move(tx)));\n\n    int nAge = 6 * 24;\n    COutput output(wtx, nInput, nAge, true /* spendable */, true /* solvable */, true /* safe */);\n    vCoins.push_back(output);\n}\n\n// Simple benchmark for wallet coin selection. Note that it maybe be necessary\n// to build up more complicated scenarios in order to get meaningful\n// measurements of performance. From laanwj, \"Wallet coin selection is probably\n// the hardest, as you need a wider selection of scenarios, just testing the\n// same one over and over isn't too useful. Generating random isn't useful\n// either for measurements.\"\n// (https://github.com/bitcoin/bitcoin/issues/7883#issuecomment-224807484)\nstatic void CoinSelection(benchmark::State& state)\n{\n    const CWallet wallet;\n    std::vector<COutput> vCoins;\n    LOCK(wallet.cs_wallet);\n\n    while (state.KeepRunning()) {\n        // Empty wallet.\n        for (COutput output : vCoins)\n            delete output.tx;\n        vCoins.clear();\n\n        // Add coins.\n        for (int i = 0; i < 1000; i++)\n            addCoin(1000 * COIN, wallet, vCoins);\n        addCoin(3 * COIN, wallet, vCoins);\n\n        std::set<CInputCoin> setCoinsRet;\n        CAmount nValueRet;\n        bool success = wallet.SelectCoinsMinConf(1003 * COIN, 1, 6, 0, vCoins, setCoinsRet, nValueRet);\n        assert(success);\n        assert(nValueRet == 1003 * COIN);\n        assert(setCoinsRet.size() == 2);\n    }\n}\n\nBENCHMARK(CoinSelection, 650);\n"
  },
  {
    "path": "src/bench/crypto_hash.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <iostream>\n\n#include <bench/bench.h>\n#include <bloom.h>\n#include <hash.h>\n#include <random.h>\n#include <uint256.h>\n#include <utiltime.h>\n#include <crypto/ripemd160.h>\n#include <crypto/sha1.h>\n#include <crypto/sha256.h>\n#include <crypto/sha512.h>\n\n/* Number of bytes to hash per iteration */\nstatic const uint64_t BUFFER_SIZE = 1000*1000;\n\nstatic void RIPEMD160(benchmark::State& state)\n{\n    uint8_t hash[CRIPEMD160::OUTPUT_SIZE];\n    std::vector<uint8_t> in(BUFFER_SIZE,0);\n    while (state.KeepRunning())\n        CRIPEMD160().Write(in.data(), in.size()).Finalize(hash);\n}\n\nstatic void SHA1(benchmark::State& state)\n{\n    uint8_t hash[CSHA1::OUTPUT_SIZE];\n    std::vector<uint8_t> in(BUFFER_SIZE,0);\n    while (state.KeepRunning())\n        CSHA1().Write(in.data(), in.size()).Finalize(hash);\n}\n\nstatic void SHA256(benchmark::State& state)\n{\n    uint8_t hash[CSHA256::OUTPUT_SIZE];\n    std::vector<uint8_t> in(BUFFER_SIZE,0);\n    while (state.KeepRunning())\n        CSHA256().Write(in.data(), in.size()).Finalize(hash);\n}\n\nstatic void SHA256_32b(benchmark::State& state)\n{\n    std::vector<uint8_t> in(32,0);\n    while (state.KeepRunning()) {\n        CSHA256()\n            .Write(in.data(), in.size())\n            .Finalize(in.data());\n    }\n}\n\nstatic void SHA512(benchmark::State& state)\n{\n    uint8_t hash[CSHA512::OUTPUT_SIZE];\n    std::vector<uint8_t> in(BUFFER_SIZE,0);\n    while (state.KeepRunning())\n        CSHA512().Write(in.data(), in.size()).Finalize(hash);\n}\n\nstatic void SipHash_32b(benchmark::State& state)\n{\n    uint256 x;\n    uint64_t k1 = 0;\n    while (state.KeepRunning()) {\n        *((uint64_t*)x.begin()) = SipHashUint256(0, ++k1, x);\n    }\n}\n\nstatic void FastRandom_32bit(benchmark::State& state)\n{\n    FastRandomContext rng(true);\n    uint32_t x = 0;\n    while (state.KeepRunning()) {\n        x += rng.rand32();\n    }\n}\n\nstatic void FastRandom_1bit(benchmark::State& state)\n{\n    FastRandomContext rng(true);\n    uint32_t x = 0;\n    while (state.KeepRunning()) {\n        x += rng.randbool();\n    }\n}\n\nBENCHMARK(RIPEMD160, 440);\nBENCHMARK(SHA1, 570);\nBENCHMARK(SHA256, 340);\nBENCHMARK(SHA512, 330);\n\nBENCHMARK(SHA256_32b, 4700 * 1000);\nBENCHMARK(SipHash_32b, 40 * 1000 * 1000);\nBENCHMARK(FastRandom_32bit, 110 * 1000 * 1000);\nBENCHMARK(FastRandom_1bit, 440 * 1000 * 1000);\n"
  },
  {
    "path": "src/bench/lockedpool.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n\n#include <support/lockedpool.h>\n\n#include <iostream>\n#include <vector>\n\n#define ASIZE 2048\n#define BITER 5000\n#define MSIZE 2048\n\nstatic void BenchLockedPool(benchmark::State& state)\n{\n    void *synth_base = reinterpret_cast<void*>(0x08000000);\n    const size_t synth_size = 1024*1024;\n    Arena b(synth_base, synth_size, 16);\n\n    std::vector<void*> addr;\n    for (int x=0; x<ASIZE; ++x)\n        addr.push_back(nullptr);\n    uint32_t s = 0x12345678;\n    while (state.KeepRunning()) {\n        for (int x=0; x<BITER; ++x) {\n            int idx = s & (addr.size()-1);\n            if (s & 0x80000000) {\n                b.free(addr[idx]);\n                addr[idx] = nullptr;\n            } else if(!addr[idx]) {\n                addr[idx] = b.alloc((s >> 16) & (MSIZE-1));\n            }\n            bool lsb = s & 1;\n            s >>= 1;\n            if (lsb)\n                s ^= 0xf00f00f0; // LFSR period 0xf7ffffe0\n        }\n    }\n    for (void *ptr: addr)\n        b.free(ptr);\n    addr.clear();\n}\n\nBENCHMARK(BenchLockedPool, 530);\n"
  },
  {
    "path": "src/bench/mempool_eviction.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n#include <policy/policy.h>\n#include <txmempool.h>\n\n#include <list>\n#include <vector>\n\nstatic void AddTx(const CTransaction& tx, const CAmount& nFee, CTxMemPool& pool)\n{\n    int64_t nTime = 0;\n    unsigned int nHeight = 1;\n    bool spendsCoinbase = false;\n    unsigned int sigOpCost = 4;\n    LockPoints lp;\n    pool.addUnchecked(tx.GetHash(), CTxMemPoolEntry(\n                                        MakeTransactionRef(tx), nFee, nTime, nHeight,\n                                        spendsCoinbase, sigOpCost, lp));\n}\n\n// Right now this is only testing eviction performance in an extremely small\n// mempool. Code needs to be written to generate a much wider variety of\n// unique transactions for a more meaningful performance measurement.\nstatic void MempoolEviction(benchmark::State& state)\n{\n    CMutableTransaction tx1 = CMutableTransaction();\n    tx1.vin.resize(1);\n    tx1.vin[0].scriptSig = CScript() << OP_1;\n    tx1.vout.resize(1);\n    tx1.vout[0].scriptPubKey = CScript() << OP_1 << OP_EQUAL;\n    tx1.vout[0].nValue = 10 * COIN;\n\n    CMutableTransaction tx2 = CMutableTransaction();\n    tx2.vin.resize(1);\n    tx2.vin[0].scriptSig = CScript() << OP_2;\n    tx2.vout.resize(1);\n    tx2.vout[0].scriptPubKey = CScript() << OP_2 << OP_EQUAL;\n    tx2.vout[0].nValue = 10 * COIN;\n\n    CMutableTransaction tx3 = CMutableTransaction();\n    tx3.vin.resize(1);\n    tx3.vin[0].prevout = COutPoint(tx2.GetHash(), 0);\n    tx3.vin[0].scriptSig = CScript() << OP_2;\n    tx3.vout.resize(1);\n    tx3.vout[0].scriptPubKey = CScript() << OP_3 << OP_EQUAL;\n    tx3.vout[0].nValue = 10 * COIN;\n\n    CMutableTransaction tx4 = CMutableTransaction();\n    tx4.vin.resize(2);\n    tx4.vin[0].prevout.SetNull();\n    tx4.vin[0].scriptSig = CScript() << OP_4;\n    tx4.vin[1].prevout.SetNull();\n    tx4.vin[1].scriptSig = CScript() << OP_4;\n    tx4.vout.resize(2);\n    tx4.vout[0].scriptPubKey = CScript() << OP_4 << OP_EQUAL;\n    tx4.vout[0].nValue = 10 * COIN;\n    tx4.vout[1].scriptPubKey = CScript() << OP_4 << OP_EQUAL;\n    tx4.vout[1].nValue = 10 * COIN;\n\n    CMutableTransaction tx5 = CMutableTransaction();\n    tx5.vin.resize(2);\n    tx5.vin[0].prevout = COutPoint(tx4.GetHash(), 0);\n    tx5.vin[0].scriptSig = CScript() << OP_4;\n    tx5.vin[1].prevout.SetNull();\n    tx5.vin[1].scriptSig = CScript() << OP_5;\n    tx5.vout.resize(2);\n    tx5.vout[0].scriptPubKey = CScript() << OP_5 << OP_EQUAL;\n    tx5.vout[0].nValue = 10 * COIN;\n    tx5.vout[1].scriptPubKey = CScript() << OP_5 << OP_EQUAL;\n    tx5.vout[1].nValue = 10 * COIN;\n\n    CMutableTransaction tx6 = CMutableTransaction();\n    tx6.vin.resize(2);\n    tx6.vin[0].prevout = COutPoint(tx4.GetHash(), 1);\n    tx6.vin[0].scriptSig = CScript() << OP_4;\n    tx6.vin[1].prevout.SetNull();\n    tx6.vin[1].scriptSig = CScript() << OP_6;\n    tx6.vout.resize(2);\n    tx6.vout[0].scriptPubKey = CScript() << OP_6 << OP_EQUAL;\n    tx6.vout[0].nValue = 10 * COIN;\n    tx6.vout[1].scriptPubKey = CScript() << OP_6 << OP_EQUAL;\n    tx6.vout[1].nValue = 10 * COIN;\n\n    CMutableTransaction tx7 = CMutableTransaction();\n    tx7.vin.resize(2);\n    tx7.vin[0].prevout = COutPoint(tx5.GetHash(), 0);\n    tx7.vin[0].scriptSig = CScript() << OP_5;\n    tx7.vin[1].prevout = COutPoint(tx6.GetHash(), 0);\n    tx7.vin[1].scriptSig = CScript() << OP_6;\n    tx7.vout.resize(2);\n    tx7.vout[0].scriptPubKey = CScript() << OP_7 << OP_EQUAL;\n    tx7.vout[0].nValue = 10 * COIN;\n    tx7.vout[1].scriptPubKey = CScript() << OP_7 << OP_EQUAL;\n    tx7.vout[1].nValue = 10 * COIN;\n\n    CTxMemPool pool;\n\n    while (state.KeepRunning()) {\n        AddTx(tx1, 10000LL, pool);\n        AddTx(tx2, 5000LL, pool);\n        AddTx(tx3, 20000LL, pool);\n        AddTx(tx4, 7000LL, pool);\n        AddTx(tx5, 1000LL, pool);\n        AddTx(tx6, 1100LL, pool);\n        AddTx(tx7, 9000LL, pool);\n        pool.TrimToSize(pool.DynamicMemoryUsage() * 3 / 4);\n        pool.TrimToSize(GetVirtualTransactionSize(tx1));\n    }\n}\n\nBENCHMARK(MempoolEviction, 41000);\n"
  },
  {
    "path": "src/bench/perf.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/perf.h>\n\n#if defined(__i386__) || defined(__x86_64__)\n\n/* These architectures support querying the cycle counter\n * from user space, no need for any syscall overhead.\n */\nvoid perf_init(void) { }\nvoid perf_fini(void) { }\n\n#elif defined(__linux__)\n\n#include <unistd.h>\n#include <sys/syscall.h>\n#include <linux/perf_event.h>\n\nstatic int fd = -1;\nstatic struct perf_event_attr attr;\n\nvoid perf_init(void)\n{\n    attr.type = PERF_TYPE_HARDWARE;\n    attr.config = PERF_COUNT_HW_CPU_CYCLES;\n    fd = syscall(__NR_perf_event_open, &attr, 0, -1, -1, 0);\n}\n\nvoid perf_fini(void)\n{\n    if (fd != -1) {\n        close(fd);\n    }\n}\n\nuint64_t perf_cpucycles(void)\n{\n    uint64_t result = 0;\n    if (fd == -1 || read(fd, &result, sizeof(result)) < (ssize_t)sizeof(result)) {\n        return 0;\n    }\n    return result;\n}\n\n#else /* Unhandled platform */\n\nvoid perf_init(void) { }\nvoid perf_fini(void) { }\nuint64_t perf_cpucycles(void) { return 0; }\n\n#endif\n"
  },
  {
    "path": "src/bench/perf.h",
    "content": "// Copyright (c) 2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n/** Functions for measurement of CPU cycles */\n#ifndef H_PERF\n#define H_PERF\n\n#include <stdint.h>\n\n#if defined(__i386__)\n\nstatic inline uint64_t perf_cpucycles(void)\n{\n    uint64_t x;\n    __asm__ volatile (\".byte 0x0f, 0x31\" : \"=A\" (x));\n    return x;\n}\n\n#elif defined(__x86_64__)\n\nstatic inline uint64_t perf_cpucycles(void)\n{\n    uint32_t hi, lo;\n    __asm__ __volatile__ (\"rdtsc\" : \"=a\"(lo), \"=d\"(hi));\n    return ((uint64_t)lo)|(((uint64_t)hi)<<32);\n}\n#else\n\nuint64_t perf_cpucycles(void);\n\n#endif\n\nvoid perf_init(void);\nvoid perf_fini(void);\n\n#endif // H_PERF\n"
  },
  {
    "path": "src/bench/prevector_destructor.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n#include <prevector.h>\n\nstatic void PrevectorDestructor(benchmark::State& state)\n{\n    while (state.KeepRunning()) {\n        for (auto x = 0; x < 1000; ++x) {\n            prevector<28, unsigned char> t0;\n            prevector<28, unsigned char> t1;\n            t0.resize(28);\n            t1.resize(29);\n        }\n    }\n}\n\nstatic void PrevectorClear(benchmark::State& state)\n{\n\n    while (state.KeepRunning()) {\n        for (auto x = 0; x < 1000; ++x) {\n            prevector<28, unsigned char> t0;\n            prevector<28, unsigned char> t1;\n            t0.resize(28);\n            t0.clear();\n            t1.resize(29);\n            t0.clear();\n        }\n    }\n}\n\nBENCHMARK(PrevectorDestructor, 5700);\nBENCHMARK(PrevectorClear, 5600);\n"
  },
  {
    "path": "src/bench/result/bench_sugarchain.html",
    "content": "<html><head><script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script></head><body><div id=\"myDiv\" style=\"width:1024px; height:768px\"></div><script> var data = [\n{ \n  name: 'Base58CheckEncode', \n  y: [4.2165e-06, 3.84362e-06, 3.86314e-06, 3.80844e-06, 3.80853e-06],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'Base58Decode', \n  y: [1.58296e-06, 1.62313e-06, 1.68173e-06, 1.6458e-06, 1.75711e-06],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'Base58Encode', \n  y: [2.7211e-06, 3.03259e-06, 2.7014e-06, 2.64439e-06, 2.68411e-06],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'BenchLockedPool', \n  y: [0.00321992, 0.00345331, 0.00345888, 0.00301778, 0.00327073],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'CCheckQueueSpeedPrevectorJob', \n  y: [0.0019811, 0.00161886, 0.00184372, 0.00215099, 0.00200092],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'CCoinsCaching', \n  y: [7.20047e-06, 7.27122e-06, 8.04105e-06, 8.02028e-06, 8.11972e-06],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'CoinSelection', \n  y: [0.00159636, 0.00157227, 0.00198627, 0.00175013, 0.00183324],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'DeserializeAndCheckBlockTest', \n  y: [0.00836975, 0.00929652, 0.0082617, 0.00766157, 0.00812086],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'DeserializeBlockTest', \n  y: [0.00848056, 0.00814779, 0.00841431, 0.0092186, 0.00821284],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'FastRandom_1bit', \n  y: [3.14895e-09, 3.07516e-09, 3.02222e-09, 3.04951e-09, 3.34664e-09],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'FastRandom_32bit', \n  y: [1.10414e-08, 1.18344e-08, 1.17658e-08, 1.12162e-08, 1.08367e-08],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'MempoolEviction', \n  y: [3.18334e-05, 3.40618e-05, 3.58263e-05, 3.35313e-05, 3.40662e-05],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'PrevectorClear', \n  y: [0.000252145, 0.000249852, 0.000248277, 0.000248153, 0.000257188],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'PrevectorDestructor', \n  y: [0.000263638, 0.000258825, 0.000244563, 0.000259806, 0.000242385],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'RIPEMD160', \n  y: [0.00320847, 0.00264677, 0.00275689, 0.00264361, 0.00286079],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'RollingBloom', \n  y: [9.45388e-07, 8.16322e-07, 9.84285e-07, 9.18102e-07, 1.07067e-06],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'SHA1', \n  y: [0.00184675, 0.00183287, 0.00189097, 0.00177035, 0.00181655],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'SHA256', \n  y: [0.00319527, 0.00360509, 0.00352548, 0.00333476, 0.00347027],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'SHA256_32b', \n  y: [2.56107e-07, 2.60341e-07, 2.63208e-07, 2.50245e-07, 2.54084e-07],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'SHA512', \n  y: [0.00361862, 0.00332339, 0.00302983, 0.0034749, 0.00308952],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'SipHash_32b', \n  y: [2.77181e-08, 2.85482e-08, 2.99818e-08, 3.04574e-08, 3.2308e-08],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'Sleep7ms', \n  y: [0.00707745, 0.00707485, 0.0070732, 0.00706871, 0.00706965],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'Trig', \n  y: [3.27994e-08, 3.23535e-08, 3.17083e-08, 3.35787e-08, 3.31114e-08],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n{ \n  name: 'VerifyScriptBench', \n  y: [0.000241842, 0.000225841, 0.000210373, 0.000220866, 0.00021676],\n  boxpoints: 'all', jitter: 0.3, pointpos: 0, type: 'box',\n},\n]; var layout = { showlegend: false, yaxis: { rangemode: 'tozero', autorange: true } };Plotly.newPlot('myDiv', data, layout);</script></body></html>"
  },
  {
    "path": "src/bench/result/bench_sugarchain.txt",
    "content": "# Benchmark, evals, iterations, total, min, max, median\nBase58CheckEncode, 5, 320000, 6.18973, 3.73261e-06, 4.19197e-06, 3.81307e-06\nBase58Decode, 5, 800000, 6.30224, 1.54725e-06, 1.6263e-06, 1.55621e-06\nBase58Encode, 5, 470000, 6.17082, 2.59798e-06, 2.66394e-06, 2.632e-06\nBenchLockedPool, 5, 530, 7.84905, 0.00292264, 0.00304684, 0.00295052\nCCheckQueueSpeedPrevectorJob, 5, 1400, 14.2371, 0.0019116, 0.00211572, 0.00204709\nCCoinsCaching, 5, 170000, 6.00009, 6.89555e-06, 7.28004e-06, 7.02904e-06\nCoinSelection, 5, 650, 4.76595, 0.00141914, 0.00156635, 0.00144726\nDeserializeAndCheckBlockTest, 5, 160, 6.1779, 0.00752694, 0.00791166, 0.00771466\nDeserializeBlockTest, 5, 130, 4.95063, 0.00751456, 0.0077688, 0.0075995\nFastRandom_1bit, 5, 440000000, 6.81921, 3.02386e-09, 3.16456e-09, 3.10268e-09\nFastRandom_32bit, 5, 110000000, 5.94999, 1.05409e-08, 1.10328e-08, 1.0922e-08\nMempoolEviction, 5, 41000, 6.92141, 3.23072e-05, 3.71969e-05, 3.29579e-05\nPrevectorClear, 5, 5600, 6.62712, 0.00022186, 0.000256429, 0.000233558\nPrevectorDestructor, 5, 5700, 6.50645, 0.00022419, 0.000240712, 0.000225698\nRIPEMD160, 5, 440, 5.725, 0.00252291, 0.00277602, 0.00257227\nRollingBloom, 5, 1500000, 6.6425, 7.06042e-07, 1.03231e-06, 9.46264e-07\nSHA1, 5, 570, 5.39763, 0.00181063, 0.00195312, 0.00189114\nSHA256, 5, 340, 5.66514, 0.0032177, 0.00343535, 0.00337881\nSHA256_32b, 5, 4700000, 6.00746, 2.50462e-07, 2.6289e-07, 2.54598e-07\nSHA512, 5, 330, 5.30564, 0.00310958, 0.0033707, 0.00314884\nSipHash_32b, 5, 40000000, 5.75557, 2.7711e-08, 2.94179e-08, 2.90874e-08\nSleep7ms, 5, 10, 0.35389, 0.0070712, 0.00708146, 0.00707812\nTrig, 5, 12000000, 1.97675, 3.08524e-08, 3.46848e-08, 3.30816e-08\nVerifyScriptBench, 5, 6300, 6.65939, 0.00020222, 0.000219241, 0.00021455\n"
  },
  {
    "path": "src/bench/rollingbloom.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <iostream>\n\n#include <bench/bench.h>\n#include <bloom.h>\n\nstatic void RollingBloom(benchmark::State& state)\n{\n    CRollingBloomFilter filter(120000, 0.000001);\n    std::vector<unsigned char> data(32);\n    uint32_t count = 0;\n    uint64_t match = 0;\n    while (state.KeepRunning()) {\n        count++;\n        data[0] = count;\n        data[1] = count >> 8;\n        data[2] = count >> 16;\n        data[3] = count >> 24;\n        filter.insert(data);\n\n        data[0] = count >> 24;\n        data[1] = count >> 16;\n        data[2] = count >> 8;\n        data[3] = count;\n        match += filter.contains(data);\n    }\n}\n\nBENCHMARK(RollingBloom, 1500 * 1000);\n"
  },
  {
    "path": "src/bench/verify_script.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bench/bench.h>\n#include <key.h>\n#if defined(HAVE_CONSENSUS_LIB)\n#include <script/bitcoinconsensus.h>\n#endif\n#include <script/script.h>\n#include <script/sign.h>\n#include <streams.h>\n\n#include <array>\n\n// FIXME: Dedup with BuildCreditingTransaction in test/script_tests.cpp.\nstatic CMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey)\n{\n    CMutableTransaction txCredit;\n    txCredit.nVersion = 1;\n    txCredit.nLockTime = 0;\n    txCredit.vin.resize(1);\n    txCredit.vout.resize(1);\n    txCredit.vin[0].prevout.SetNull();\n    txCredit.vin[0].scriptSig = CScript() << CScriptNum(0) << CScriptNum(0);\n    txCredit.vin[0].nSequence = CTxIn::SEQUENCE_FINAL;\n    txCredit.vout[0].scriptPubKey = scriptPubKey;\n    txCredit.vout[0].nValue = 1;\n\n    return txCredit;\n}\n\n// FIXME: Dedup with BuildSpendingTransaction in test/script_tests.cpp.\nstatic CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMutableTransaction& txCredit)\n{\n    CMutableTransaction txSpend;\n    txSpend.nVersion = 1;\n    txSpend.nLockTime = 0;\n    txSpend.vin.resize(1);\n    txSpend.vout.resize(1);\n    txSpend.vin[0].prevout.hash = txCredit.GetHash();\n    txSpend.vin[0].prevout.n = 0;\n    txSpend.vin[0].scriptSig = scriptSig;\n    txSpend.vin[0].nSequence = CTxIn::SEQUENCE_FINAL;\n    txSpend.vout[0].scriptPubKey = CScript();\n    txSpend.vout[0].nValue = txCredit.vout[0].nValue;\n\n    return txSpend;\n}\n\n// Microbenchmark for verification of a basic P2WPKH script. Can be easily\n// modified to measure performance of other types of scripts.\nstatic void VerifyScriptBench(benchmark::State& state)\n{\n    const int flags = SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH;\n    const int witnessversion = 0;\n\n    // Keypair.\n    CKey key;\n    static const std::array<unsigned char, 32> vchKey = {\n        {\n            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1\n        }\n    };\n    key.Set(vchKey.begin(), vchKey.end(), false);\n    CPubKey pubkey = key.GetPubKey();\n    uint160 pubkeyHash;\n    CHash160().Write(pubkey.begin(), pubkey.size()).Finalize(pubkeyHash.begin());\n\n    // Script.\n    CScript scriptPubKey = CScript() << witnessversion << ToByteVector(pubkeyHash);\n    CScript scriptSig;\n    CScript witScriptPubkey = CScript() << OP_DUP << OP_HASH160 << ToByteVector(pubkeyHash) << OP_EQUALVERIFY << OP_CHECKSIG;\n    CTransaction txCredit = BuildCreditingTransaction(scriptPubKey);\n    CMutableTransaction txSpend = BuildSpendingTransaction(scriptSig, txCredit);\n    CScriptWitness& witness = txSpend.vin[0].scriptWitness;\n    witness.stack.emplace_back();\n    key.Sign(SignatureHash(witScriptPubkey, txSpend, 0, SIGHASH_ALL, txCredit.vout[0].nValue, SIGVERSION_WITNESS_V0), witness.stack.back(), 0);\n    witness.stack.back().push_back(static_cast<unsigned char>(SIGHASH_ALL));\n    witness.stack.push_back(ToByteVector(pubkey));\n\n    // Benchmark.\n    while (state.KeepRunning()) {\n        ScriptError err;\n        bool success = VerifyScript(\n            txSpend.vin[0].scriptSig,\n            txCredit.vout[0].scriptPubKey,\n            &txSpend.vin[0].scriptWitness,\n            flags,\n            MutableTransactionSignatureChecker(&txSpend, 0, txCredit.vout[0].nValue),\n            &err);\n        assert(err == SCRIPT_ERR_OK);\n        assert(success);\n\n#if defined(HAVE_CONSENSUS_LIB)\n        CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n        stream << txSpend;\n        int csuccess = bitcoinconsensus_verify_script_with_amount(\n            txCredit.vout[0].scriptPubKey.data(),\n            txCredit.vout[0].scriptPubKey.size(),\n            txCredit.vout[0].nValue,\n            (const unsigned char*)stream.data(), stream.size(), 0, flags, nullptr);\n        assert(csuccess == 1);\n#endif\n    }\n}\n\nBENCHMARK(VerifyScriptBench, 6300);\n"
  },
  {
    "path": "src/bitcoin-cli-res.rc",
    "content": "#include <windows.h>             // needed for VERSIONINFO\n#include \"clientversion.h\"       // holds the needed client version information\n\n#define VER_PRODUCTVERSION     CLIENT_VERSION_MAJOR,CLIENT_VERSION_MINOR,CLIENT_VERSION_REVISION,CLIENT_VERSION_BUILD\n#define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) \".\" STRINGIZE(CLIENT_VERSION_MINOR) \".\" STRINGIZE(CLIENT_VERSION_REVISION) \".\" STRINGIZE(CLIENT_VERSION_BUILD)\n#define VER_FILEVERSION        VER_PRODUCTVERSION\n#define VER_FILEVERSION_STR    VER_PRODUCTVERSION_STR\n\nVS_VERSION_INFO VERSIONINFO\nFILEVERSION     VER_FILEVERSION\nPRODUCTVERSION  VER_PRODUCTVERSION\nFILEOS          VOS_NT_WINDOWS32\nFILETYPE        VFT_APP\nBEGIN\n    BLOCK \"StringFileInfo\"\n    BEGIN\n        BLOCK \"040904E4\" // U.S. English - multilingual (hex)\n        BEGIN\n            VALUE \"CompanyName\",        \"Sugarchain\"\n            VALUE \"FileDescription\",    \"sugarchain-cli (JSON-RPC client for \" PACKAGE_NAME \")\"\n            VALUE \"FileVersion\",        VER_FILEVERSION_STR\n            VALUE \"InternalName\",       \"sugarchain-cli\"\n            VALUE \"LegalCopyright\",     COPYRIGHT_STR\n            VALUE \"LegalTrademarks1\",   \"Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.\"\n            VALUE \"OriginalFilename\",   \"sugarchain-cli.exe\"\n            VALUE \"ProductName\",        \"sugarchain-cli\"\n            VALUE \"ProductVersion\",     VER_PRODUCTVERSION_STR\n        END\n    END\n\n    BLOCK \"VarFileInfo\"\n    BEGIN\n        VALUE \"Translation\", 0x0, 1252 // language neutral - multilingual (decimal)\n    END\nEND\n"
  },
  {
    "path": "src/bitcoin-cli.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <chainparamsbase.h>\n#include <clientversion.h>\n#include <fs.h>\n#include <rpc/client.h>\n#include <rpc/protocol.h>\n#include <util.h>\n#include <utilstrencodings.h>\n\n#include <memory>\n#include <stdio.h>\n\n#include <event2/buffer.h>\n#include <event2/keyvalq_struct.h>\n#include <support/events.h>\n\n#include <univalue.h>\n\nstatic const char DEFAULT_RPCCONNECT[] = \"127.0.0.1\";\nstatic const int DEFAULT_HTTP_CLIENT_TIMEOUT=900;\nstatic const bool DEFAULT_NAMED=false;\nstatic const int CONTINUE_EXECUTION=-1;\n\nstd::string HelpMessageCli()\n{\n    const auto defaultBaseParams = CreateBaseChainParams(CBaseChainParams::MAIN);\n    const auto testnetBaseParams = CreateBaseChainParams(CBaseChainParams::TESTNET);\n    std::string strUsage;\n    strUsage += HelpMessageGroup(_(\"Options:\"));\n    strUsage += HelpMessageOpt(\"-?\", _(\"This help message\"));\n    strUsage += HelpMessageOpt(\"-conf=<file>\", strprintf(_(\"Specify configuration file (default: %s)\"), BITCOIN_CONF_FILENAME));\n    strUsage += HelpMessageOpt(\"-datadir=<dir>\", _(\"Specify data directory\"));\n    strUsage += HelpMessageOpt(\"-getinfo\", _(\"Get general information from the remote server. Note that unlike server-side RPC calls, the results of -getinfo is the result of multiple non-atomic requests. Some entries in the result may represent results from different states (e.g. wallet balance may be as of a different block from the chain state reported)\"));\n    AppendParamsHelpMessages(strUsage);\n    strUsage += HelpMessageOpt(\"-named\", strprintf(_(\"Pass named instead of positional arguments (default: %s)\"), DEFAULT_NAMED));\n    strUsage += HelpMessageOpt(\"-rpcconnect=<ip>\", strprintf(_(\"Send commands to node running on <ip> (default: %s)\"), DEFAULT_RPCCONNECT));\n    strUsage += HelpMessageOpt(\"-rpcport=<port>\", strprintf(_(\"Connect to JSON-RPC on <port> (default: %u or testnet: %u)\"), defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort()));\n    strUsage += HelpMessageOpt(\"-rpcwait\", _(\"Wait for RPC server to start\"));\n    strUsage += HelpMessageOpt(\"-rpcuser=<user>\", _(\"Username for JSON-RPC connections\"));\n    strUsage += HelpMessageOpt(\"-rpcpassword=<pw>\", _(\"Password for JSON-RPC connections\"));\n    strUsage += HelpMessageOpt(\"-rpcclienttimeout=<n>\", strprintf(_(\"Timeout in seconds during HTTP requests, or 0 for no timeout. (default: %d)\"), DEFAULT_HTTP_CLIENT_TIMEOUT));\n    strUsage += HelpMessageOpt(\"-stdinrpcpass\", strprintf(_(\"Read RPC password from standard input as a single line.  When combined with -stdin, the first line from standard input is used for the RPC password.\")));\n    strUsage += HelpMessageOpt(\"-stdin\", _(\"Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases).  When combined with -stdinrpcpass, the first line from standard input is used for the RPC password.\"));\n    strUsage += HelpMessageOpt(\"-rpcwallet=<walletname>\", _(\"Send RPC for non-default wallet on RPC server (argument is wallet filename in sugarchaind directory, required if sugarchaind/-Qt runs with multiple wallets)\"));\n\n    return strUsage;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// Start\n//\n\n//\n// Exception thrown on connection error.  This error is used to determine\n// when to wait if -rpcwait is given.\n//\nclass CConnectionFailed : public std::runtime_error\n{\npublic:\n\n    explicit inline CConnectionFailed(const std::string& msg) :\n        std::runtime_error(msg)\n    {}\n\n};\n\n//\n// This function returns either one of EXIT_ codes when it's expected to stop the process or\n// CONTINUE_EXECUTION when it's expected to continue further.\n//\nstatic int AppInitRPC(int argc, char* argv[])\n{\n    //\n    // Parameters\n    //\n    gArgs.ParseParameters(argc, argv);\n    if (argc<2 || gArgs.IsArgSet(\"-?\") || gArgs.IsArgSet(\"-h\") || gArgs.IsArgSet(\"-help\") || gArgs.IsArgSet(\"-version\")) {\n        std::string strUsage = strprintf(_(\"%s RPC client version\"), _(PACKAGE_NAME)) + \" \" + FormatFullVersion() + \"\\n\";\n        if (!gArgs.IsArgSet(\"-version\")) {\n            strUsage += \"\\n\" + _(\"Usage:\") + \"\\n\" +\n                  \"  sugarchain-cli [options] <command> [params]  \" + strprintf(_(\"Send command to %s\"), _(PACKAGE_NAME)) + \"\\n\" +\n                  \"  sugarchain-cli [options] -named <command> [name=value] ... \" + strprintf(_(\"Send command to %s (with named arguments)\"), _(PACKAGE_NAME)) + \"\\n\" +\n                  \"  sugarchain-cli [options] help                \" + _(\"List commands\") + \"\\n\" +\n                  \"  sugarchain-cli [options] help <command>      \" + _(\"Get help for a command\") + \"\\n\";\n\n            strUsage += \"\\n\" + HelpMessageCli();\n        }\n\n        fprintf(stdout, \"%s\", strUsage.c_str());\n        if (argc < 2) {\n            fprintf(stderr, \"Error: too few parameters\\n\");\n            return EXIT_FAILURE;\n        }\n        return EXIT_SUCCESS;\n    }\n    if (!fs::is_directory(GetDataDir(false))) {\n        fprintf(stderr, \"Error: Specified data directory \\\"%s\\\" does not exist.\\n\", gArgs.GetArg(\"-datadir\", \"\").c_str());\n        return EXIT_FAILURE;\n    }\n    try {\n        gArgs.ReadConfigFile(gArgs.GetArg(\"-conf\", BITCOIN_CONF_FILENAME));\n    } catch (const std::exception& e) {\n        fprintf(stderr,\"Error reading configuration file: %s\\n\", e.what());\n        return EXIT_FAILURE;\n    }\n    // Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause)\n    try {\n        SelectBaseParams(ChainNameFromCommandLine());\n    } catch (const std::exception& e) {\n        fprintf(stderr, \"Error: %s\\n\", e.what());\n        return EXIT_FAILURE;\n    }\n    if (gArgs.GetBoolArg(\"-rpcssl\", false))\n    {\n        fprintf(stderr, \"Error: SSL mode for RPC (-rpcssl) is no longer supported.\\n\");\n        return EXIT_FAILURE;\n    }\n    return CONTINUE_EXECUTION;\n}\n\n\n/** Reply structure for request_done to fill in */\nstruct HTTPReply\n{\n    HTTPReply(): status(0), error(-1) {}\n\n    int status;\n    int error;\n    std::string body;\n};\n\nconst char *http_errorstring(int code)\n{\n    switch(code) {\n#if LIBEVENT_VERSION_NUMBER >= 0x02010300\n    case EVREQ_HTTP_TIMEOUT:\n        return \"timeout reached\";\n    case EVREQ_HTTP_EOF:\n        return \"EOF reached\";\n    case EVREQ_HTTP_INVALID_HEADER:\n        return \"error while reading header, or invalid header\";\n    case EVREQ_HTTP_BUFFER_ERROR:\n        return \"error encountered while reading or writing\";\n    case EVREQ_HTTP_REQUEST_CANCEL:\n        return \"request was canceled\";\n    case EVREQ_HTTP_DATA_TOO_LONG:\n        return \"response body is larger than allowed\";\n#endif\n    default:\n        return \"unknown\";\n    }\n}\n\nstatic void http_request_done(struct evhttp_request *req, void *ctx)\n{\n    HTTPReply *reply = static_cast<HTTPReply*>(ctx);\n\n    if (req == nullptr) {\n        /* If req is nullptr, it means an error occurred while connecting: the\n         * error code will have been passed to http_error_cb.\n         */\n        reply->status = 0;\n        return;\n    }\n\n    reply->status = evhttp_request_get_response_code(req);\n\n    struct evbuffer *buf = evhttp_request_get_input_buffer(req);\n    if (buf)\n    {\n        size_t size = evbuffer_get_length(buf);\n        const char *data = (const char*)evbuffer_pullup(buf, size);\n        if (data)\n            reply->body = std::string(data, size);\n        evbuffer_drain(buf, size);\n    }\n}\n\n#if LIBEVENT_VERSION_NUMBER >= 0x02010300\nstatic void http_error_cb(enum evhttp_request_error err, void *ctx)\n{\n    HTTPReply *reply = static_cast<HTTPReply*>(ctx);\n    reply->error = err;\n}\n#endif\n\n/** Class that handles the conversion from a command-line to a JSON-RPC request,\n * as well as converting back to a JSON object that can be shown as result.\n */\nclass BaseRequestHandler\n{\npublic:\n    virtual UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) = 0;\n    virtual UniValue ProcessReply(const UniValue &batch_in) = 0;\n};\n\n/** Process getinfo requests */\nclass GetinfoRequestHandler: public BaseRequestHandler\n{\npublic:\n    const int ID_NETWORKINFO = 0;\n    const int ID_BLOCKCHAININFO = 1;\n    const int ID_WALLETINFO = 2;\n\n    /** Create a simulated `getinfo` request. */\n    UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) override\n    {\n        if (!args.empty()) {\n            throw std::runtime_error(\"-getinfo takes no arguments\");\n        }\n        UniValue result(UniValue::VARR);\n        result.push_back(JSONRPCRequestObj(\"getnetworkinfo\", NullUniValue, ID_NETWORKINFO));\n        result.push_back(JSONRPCRequestObj(\"getblockchaininfo\", NullUniValue, ID_BLOCKCHAININFO));\n        result.push_back(JSONRPCRequestObj(\"getwalletinfo\", NullUniValue, ID_WALLETINFO));\n        return result;\n    }\n\n    /** Collect values from the batch and form a simulated `getinfo` reply. */\n    UniValue ProcessReply(const UniValue &batch_in) override\n    {\n        UniValue result(UniValue::VOBJ);\n        std::vector<UniValue> batch = JSONRPCProcessBatchReply(batch_in, 3);\n        // Errors in getnetworkinfo() and getblockchaininfo() are fatal, pass them on\n        // getwalletinfo() is allowed to fail in case there is no wallet.\n        if (!batch[ID_NETWORKINFO][\"error\"].isNull()) {\n            return batch[ID_NETWORKINFO];\n        }\n        if (!batch[ID_BLOCKCHAININFO][\"error\"].isNull()) {\n            return batch[ID_BLOCKCHAININFO];\n        }\n        result.pushKV(\"version\", batch[ID_NETWORKINFO][\"result\"][\"version\"]);\n        result.pushKV(\"protocolversion\", batch[ID_NETWORKINFO][\"result\"][\"protocolversion\"]);\n        if (!batch[ID_WALLETINFO].isNull()) {\n            result.pushKV(\"walletversion\", batch[ID_WALLETINFO][\"result\"][\"walletversion\"]);\n            result.pushKV(\"balance\", batch[ID_WALLETINFO][\"result\"][\"balance\"]);\n        }\n        result.pushKV(\"blocks\", batch[ID_BLOCKCHAININFO][\"result\"][\"blocks\"]);\n        result.pushKV(\"timeoffset\", batch[ID_NETWORKINFO][\"result\"][\"timeoffset\"]);\n        result.pushKV(\"connections\", batch[ID_NETWORKINFO][\"result\"][\"connections\"]);\n        result.pushKV(\"proxy\", batch[ID_NETWORKINFO][\"result\"][\"networks\"][0][\"proxy\"]);\n        result.pushKV(\"difficulty\", batch[ID_BLOCKCHAININFO][\"result\"][\"difficulty\"]);\n        result.pushKV(\"testnet\", UniValue(batch[ID_BLOCKCHAININFO][\"result\"][\"chain\"].get_str() == \"test\"));\n        if (!batch[ID_WALLETINFO].isNull()) {\n            result.pushKV(\"walletversion\", batch[ID_WALLETINFO][\"result\"][\"walletversion\"]);\n            result.pushKV(\"balance\", batch[ID_WALLETINFO][\"result\"][\"balance\"]);\n            result.pushKV(\"keypoololdest\", batch[ID_WALLETINFO][\"result\"][\"keypoololdest\"]);\n            result.pushKV(\"keypoolsize\", batch[ID_WALLETINFO][\"result\"][\"keypoolsize\"]);\n            if (!batch[ID_WALLETINFO][\"result\"][\"unlocked_until\"].isNull()) {\n                result.pushKV(\"unlocked_until\", batch[ID_WALLETINFO][\"result\"][\"unlocked_until\"]);\n            }\n            result.pushKV(\"paytxfee\", batch[ID_WALLETINFO][\"result\"][\"paytxfee\"]);\n        }\n        result.pushKV(\"relayfee\", batch[ID_NETWORKINFO][\"result\"][\"relayfee\"]);\n        result.pushKV(\"warnings\", batch[ID_NETWORKINFO][\"result\"][\"warnings\"]);\n        return JSONRPCReplyObj(result, NullUniValue, 1);\n    }\n};\n\n/** Process default single requests */\nclass DefaultRequestHandler: public BaseRequestHandler {\npublic:\n    UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) override\n    {\n        UniValue params;\n        if(gArgs.GetBoolArg(\"-named\", DEFAULT_NAMED)) {\n            params = RPCConvertNamedValues(method, args);\n        } else {\n            params = RPCConvertValues(method, args);\n        }\n        return JSONRPCRequestObj(method, params, 1);\n    }\n\n    UniValue ProcessReply(const UniValue &reply) override\n    {\n        return reply.get_obj();\n    }\n};\n\nstatic UniValue CallRPC(BaseRequestHandler *rh, const std::string& strMethod, const std::vector<std::string>& args)\n{\n    std::string host;\n    // In preference order, we choose the following for the port:\n    //     1. -rpcport\n    //     2. port in -rpcconnect (ie following : in ipv4 or ]: in ipv6)\n    //     3. default port for chain\n    int port = BaseParams().RPCPort();\n    SplitHostPort(gArgs.GetArg(\"-rpcconnect\", DEFAULT_RPCCONNECT), port, host);\n    port = gArgs.GetArg(\"-rpcport\", port);\n\n    // Obtain event base\n    raii_event_base base = obtain_event_base();\n\n    // Synchronously look up hostname\n    raii_evhttp_connection evcon = obtain_evhttp_connection_base(base.get(), host, port);\n    evhttp_connection_set_timeout(evcon.get(), gArgs.GetArg(\"-rpcclienttimeout\", DEFAULT_HTTP_CLIENT_TIMEOUT));\n\n    HTTPReply response;\n    raii_evhttp_request req = obtain_evhttp_request(http_request_done, (void*)&response);\n    if (req == nullptr)\n        throw std::runtime_error(\"create http request failed\");\n#if LIBEVENT_VERSION_NUMBER >= 0x02010300\n    evhttp_request_set_error_cb(req.get(), http_error_cb);\n#endif\n\n    // Get credentials\n    std::string strRPCUserColonPass;\n    if (gArgs.GetArg(\"-rpcpassword\", \"\") == \"\") {\n        // Try fall back to cookie-based authentication if no password is provided\n        if (!GetAuthCookie(&strRPCUserColonPass)) {\n            throw std::runtime_error(strprintf(\n                _(\"Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set.  See -rpcpassword and -stdinrpcpass.  Configuration file: (%s)\"),\n                    GetConfigFile(gArgs.GetArg(\"-conf\", BITCOIN_CONF_FILENAME)).string().c_str()));\n\n        }\n    } else {\n        strRPCUserColonPass = gArgs.GetArg(\"-rpcuser\", \"\") + \":\" + gArgs.GetArg(\"-rpcpassword\", \"\");\n    }\n\n    struct evkeyvalq* output_headers = evhttp_request_get_output_headers(req.get());\n    assert(output_headers);\n    evhttp_add_header(output_headers, \"Host\", host.c_str());\n    evhttp_add_header(output_headers, \"Connection\", \"close\");\n    evhttp_add_header(output_headers, \"Authorization\", (std::string(\"Basic \") + EncodeBase64(strRPCUserColonPass)).c_str());\n\n    // Attach request data\n    std::string strRequest = rh->PrepareRequest(strMethod, args).write() + \"\\n\";\n    struct evbuffer* output_buffer = evhttp_request_get_output_buffer(req.get());\n    assert(output_buffer);\n    evbuffer_add(output_buffer, strRequest.data(), strRequest.size());\n\n    // check if we should use a special wallet endpoint\n    std::string endpoint = \"/\";\n    std::string walletName = gArgs.GetArg(\"-rpcwallet\", \"\");\n    if (!walletName.empty()) {\n        char *encodedURI = evhttp_uriencode(walletName.c_str(), walletName.size(), false);\n        if (encodedURI) {\n            endpoint = \"/wallet/\"+ std::string(encodedURI);\n            free(encodedURI);\n        }\n        else {\n            throw CConnectionFailed(\"uri-encode failed\");\n        }\n    }\n    int r = evhttp_make_request(evcon.get(), req.get(), EVHTTP_REQ_POST, endpoint.c_str());\n    req.release(); // ownership moved to evcon in above call\n    if (r != 0) {\n        throw CConnectionFailed(\"send http request failed\");\n    }\n\n    event_base_dispatch(base.get());\n\n    if (response.status == 0)\n        throw CConnectionFailed(strprintf(\"couldn't connect to server: %s (code %d)\\n(make sure server is running and you are connecting to the correct RPC port)\", http_errorstring(response.error), response.error));\n    else if (response.status == HTTP_UNAUTHORIZED)\n        throw std::runtime_error(\"incorrect rpcuser or rpcpassword (authorization failed)\");\n    else if (response.status >= 400 && response.status != HTTP_BAD_REQUEST && response.status != HTTP_NOT_FOUND && response.status != HTTP_INTERNAL_SERVER_ERROR)\n        throw std::runtime_error(strprintf(\"server returned HTTP error %d\", response.status));\n    else if (response.body.empty())\n        throw std::runtime_error(\"no response from server\");\n\n    // Parse reply\n    UniValue valReply(UniValue::VSTR);\n    if (!valReply.read(response.body))\n        throw std::runtime_error(\"couldn't parse reply from server\");\n    const UniValue reply = rh->ProcessReply(valReply);\n    if (reply.empty())\n        throw std::runtime_error(\"expected reply to have result, error and id properties\");\n\n    return reply;\n}\n\nint CommandLineRPC(int argc, char *argv[])\n{\n    std::string strPrint;\n    int nRet = 0;\n    try {\n        // Skip switches\n        while (argc > 1 && IsSwitchChar(argv[1][0])) {\n            argc--;\n            argv++;\n        }\n        std::string rpcPass;\n        if (gArgs.GetBoolArg(\"-stdinrpcpass\", false)) {\n            if (!std::getline(std::cin, rpcPass)) {\n                throw std::runtime_error(\"-stdinrpcpass specified but failed to read from standard input\");\n            }\n            gArgs.ForceSetArg(\"-rpcpassword\", rpcPass);\n        }\n        std::vector<std::string> args = std::vector<std::string>(&argv[1], &argv[argc]);\n        if (gArgs.GetBoolArg(\"-stdin\", false)) {\n            // Read one arg per line from stdin and append\n            std::string line;\n            while (std::getline(std::cin, line)) {\n                args.push_back(line);\n            }\n        }\n        std::unique_ptr<BaseRequestHandler> rh;\n        std::string method;\n        if (gArgs.GetBoolArg(\"-getinfo\", false)) {\n            rh.reset(new GetinfoRequestHandler());\n            method = \"\";\n        } else {\n            rh.reset(new DefaultRequestHandler());\n            if (args.size() < 1) {\n                throw std::runtime_error(\"too few parameters (need at least command)\");\n            }\n            method = args[0];\n            args.erase(args.begin()); // Remove trailing method name from arguments vector\n        }\n\n        // Execute and handle connection failures with -rpcwait\n        const bool fWait = gArgs.GetBoolArg(\"-rpcwait\", false);\n        do {\n            try {\n                const UniValue reply = CallRPC(rh.get(), method, args);\n\n                // Parse reply\n                const UniValue& result = find_value(reply, \"result\");\n                const UniValue& error  = find_value(reply, \"error\");\n\n                if (!error.isNull()) {\n                    // Error\n                    int code = error[\"code\"].get_int();\n                    if (fWait && code == RPC_IN_WARMUP)\n                        throw CConnectionFailed(\"server in warmup\");\n                    strPrint = \"error: \" + error.write();\n                    nRet = abs(code);\n                    if (error.isObject())\n                    {\n                        UniValue errCode = find_value(error, \"code\");\n                        UniValue errMsg  = find_value(error, \"message\");\n                        strPrint = errCode.isNull() ? \"\" : \"error code: \"+errCode.getValStr()+\"\\n\";\n\n                        if (errMsg.isStr())\n                            strPrint += \"error message:\\n\"+errMsg.get_str();\n\n                        if (errCode.isNum() && errCode.get_int() == RPC_WALLET_NOT_SPECIFIED) {\n                            strPrint += \"\\nTry adding \\\"-rpcwallet=<filename>\\\" option to sugarchain-cli command line.\";\n                        }\n                    }\n                } else {\n                    // Result\n                    if (result.isNull())\n                        strPrint = \"\";\n                    else if (result.isStr())\n                        strPrint = result.get_str();\n                    else\n                        strPrint = result.write(2);\n                }\n                // Connection succeeded, no need to retry.\n                break;\n            }\n            catch (const CConnectionFailed&) {\n                if (fWait)\n                    MilliSleep(1000);\n                else\n                    throw;\n            }\n        } while (fWait);\n    }\n    catch (const boost::thread_interrupted&) {\n        throw;\n    }\n    catch (const std::exception& e) {\n        strPrint = std::string(\"error: \") + e.what();\n        nRet = EXIT_FAILURE;\n    }\n    catch (...) {\n        PrintExceptionContinue(nullptr, \"CommandLineRPC()\");\n        throw;\n    }\n\n    if (strPrint != \"\") {\n        fprintf((nRet == 0 ? stdout : stderr), \"%s\\n\", strPrint.c_str());\n    }\n    return nRet;\n}\n\nint main(int argc, char* argv[])\n{\n    SetupEnvironment();\n    if (!SetupNetworking()) {\n        fprintf(stderr, \"Error: Initializing networking failed\\n\");\n        return EXIT_FAILURE;\n    }\n\n    try {\n        int ret = AppInitRPC(argc, argv);\n        if (ret != CONTINUE_EXECUTION)\n            return ret;\n    }\n    catch (const std::exception& e) {\n        PrintExceptionContinue(&e, \"AppInitRPC()\");\n        return EXIT_FAILURE;\n    } catch (...) {\n        PrintExceptionContinue(nullptr, \"AppInitRPC()\");\n        return EXIT_FAILURE;\n    }\n\n    int ret = EXIT_FAILURE;\n    try {\n        ret = CommandLineRPC(argc, argv);\n    }\n    catch (const std::exception& e) {\n        PrintExceptionContinue(&e, \"CommandLineRPC()\");\n    } catch (...) {\n        PrintExceptionContinue(nullptr, \"CommandLineRPC()\");\n    }\n    return ret;\n}\n"
  },
  {
    "path": "src/bitcoin-tx-res.rc",
    "content": "#include <windows.h>             // needed for VERSIONINFO\n#include \"clientversion.h\"       // holds the needed client version information\n\n#define VER_PRODUCTVERSION     CLIENT_VERSION_MAJOR,CLIENT_VERSION_MINOR,CLIENT_VERSION_REVISION,CLIENT_VERSION_BUILD\n#define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) \".\" STRINGIZE(CLIENT_VERSION_MINOR) \".\" STRINGIZE(CLIENT_VERSION_REVISION) \".\" STRINGIZE(CLIENT_VERSION_BUILD)\n#define VER_FILEVERSION        VER_PRODUCTVERSION\n#define VER_FILEVERSION_STR    VER_PRODUCTVERSION_STR\n\nVS_VERSION_INFO VERSIONINFO\nFILEVERSION     VER_FILEVERSION\nPRODUCTVERSION  VER_PRODUCTVERSION\nFILEOS          VOS_NT_WINDOWS32\nFILETYPE        VFT_APP\nBEGIN\n    BLOCK \"StringFileInfo\"\n    BEGIN\n        BLOCK \"040904E4\" // U.S. English - multilingual (hex)\n        BEGIN\n            VALUE \"CompanyName\",        \"Sugarchain\"\n            VALUE \"FileDescription\",    \"sugarchain-tx (CLI Bitcoin transaction editor utility)\"\n            VALUE \"FileVersion\",        VER_FILEVERSION_STR\n            VALUE \"InternalName\",       \"sugarchain-tx\"\n            VALUE \"LegalCopyright\",     COPYRIGHT_STR\n            VALUE \"LegalTrademarks1\",   \"Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.\"\n            VALUE \"OriginalFilename\",   \"sugarchain-tx.exe\"\n            VALUE \"ProductName\",        \"sugarchain-tx\"\n            VALUE \"ProductVersion\",     VER_PRODUCTVERSION_STR\n        END\n    END\n\n    BLOCK \"VarFileInfo\"\n    BEGIN\n        VALUE \"Translation\", 0x0, 1252 // language neutral - multilingual (decimal)\n    END\nEND\n"
  },
  {
    "path": "src/bitcoin-tx.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <base58.h>\n#include <clientversion.h>\n#include <coins.h>\n#include <consensus/consensus.h>\n#include <core_io.h>\n#include <keystore.h>\n#include <policy/policy.h>\n#include <policy/rbf.h>\n#include <primitives/transaction.h>\n#include <script/script.h>\n#include <script/sign.h>\n#include <univalue.h>\n#include <util.h>\n#include <utilmoneystr.h>\n#include <utilstrencodings.h>\n\n#include <memory>\n#include <stdio.h>\n\n#include <boost/algorithm/string.hpp>\n\nstatic bool fCreateBlank;\nstatic std::map<std::string,UniValue> registers;\nstatic const int CONTINUE_EXECUTION=-1;\n\n//\n// This function returns either one of EXIT_ codes when it's expected to stop the process or\n// CONTINUE_EXECUTION when it's expected to continue further.\n//\nstatic int AppInitRawTx(int argc, char* argv[])\n{\n    //\n    // Parameters\n    //\n    gArgs.ParseParameters(argc, argv);\n\n    // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)\n    try {\n        SelectParams(ChainNameFromCommandLine());\n    } catch (const std::exception& e) {\n        fprintf(stderr, \"Error: %s\\n\", e.what());\n        return EXIT_FAILURE;\n    }\n\n    fCreateBlank = gArgs.GetBoolArg(\"-create\", false);\n\n    if (argc<2 || gArgs.IsArgSet(\"-?\") || gArgs.IsArgSet(\"-h\") || gArgs.IsArgSet(\"-help\"))\n    {\n        // First part of help message is specific to this utility\n        std::string strUsage = strprintf(_(\"%s sugarchain-tx utility version\"), _(PACKAGE_NAME)) + \" \" + FormatFullVersion() + \"\\n\\n\" +\n            _(\"Usage:\") + \"\\n\" +\n              \"  sugarchain-tx [options] <hex-tx> [commands]  \" + _(\"Update hex-encoded sugarchain transaction\") + \"\\n\" +\n              \"  sugarchain-tx [options] -create [commands]   \" + _(\"Create hex-encoded sugarchain transaction\") + \"\\n\" +\n              \"\\n\";\n\n        fprintf(stdout, \"%s\", strUsage.c_str());\n\n        strUsage = HelpMessageGroup(_(\"Options:\"));\n        strUsage += HelpMessageOpt(\"-?\", _(\"This help message\"));\n        strUsage += HelpMessageOpt(\"-create\", _(\"Create new, empty TX.\"));\n        strUsage += HelpMessageOpt(\"-json\", _(\"Select JSON output\"));\n        strUsage += HelpMessageOpt(\"-txid\", _(\"Output only the hex-encoded transaction id of the resultant transaction.\"));\n        AppendParamsHelpMessages(strUsage);\n\n        fprintf(stdout, \"%s\", strUsage.c_str());\n\n        strUsage = HelpMessageGroup(_(\"Commands:\"));\n        strUsage += HelpMessageOpt(\"delin=N\", _(\"Delete input N from TX\"));\n        strUsage += HelpMessageOpt(\"delout=N\", _(\"Delete output N from TX\"));\n        strUsage += HelpMessageOpt(\"in=TXID:VOUT(:SEQUENCE_NUMBER)\", _(\"Add input to TX\"));\n        strUsage += HelpMessageOpt(\"locktime=N\", _(\"Set TX lock time to N\"));\n        strUsage += HelpMessageOpt(\"nversion=N\", _(\"Set TX version to N\"));\n        strUsage += HelpMessageOpt(\"replaceable(=N)\", _(\"Set RBF opt-in sequence number for input N (if not provided, opt-in all available inputs)\"));\n        strUsage += HelpMessageOpt(\"outaddr=VALUE:ADDRESS\", _(\"Add address-based output to TX\"));\n        strUsage += HelpMessageOpt(\"outpubkey=VALUE:PUBKEY[:FLAGS]\", _(\"Add pay-to-pubkey output to TX\") + \". \" +\n            _(\"Optionally add the \\\"W\\\" flag to produce a pay-to-witness-pubkey-hash output\") + \". \" +\n            _(\"Optionally add the \\\"S\\\" flag to wrap the output in a pay-to-script-hash.\"));\n        strUsage += HelpMessageOpt(\"outdata=[VALUE:]DATA\", _(\"Add data-based output to TX\"));\n        strUsage += HelpMessageOpt(\"outscript=VALUE:SCRIPT[:FLAGS]\", _(\"Add raw script output to TX\") + \". \" +\n            _(\"Optionally add the \\\"W\\\" flag to produce a pay-to-witness-script-hash output\") + \". \" +\n            _(\"Optionally add the \\\"S\\\" flag to wrap the output in a pay-to-script-hash.\"));\n        strUsage += HelpMessageOpt(\"outmultisig=VALUE:REQUIRED:PUBKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]\", _(\"Add Pay To n-of-m Multi-sig output to TX. n = REQUIRED, m = PUBKEYS\") + \". \" +\n            _(\"Optionally add the \\\"W\\\" flag to produce a pay-to-witness-script-hash output\") + \". \" +\n            _(\"Optionally add the \\\"S\\\" flag to wrap the output in a pay-to-script-hash.\"));\n        strUsage += HelpMessageOpt(\"sign=SIGHASH-FLAGS\", _(\"Add zero or more signatures to transaction\") + \". \" +\n            _(\"This command requires JSON registers:\") +\n            _(\"prevtxs=JSON object\") + \", \" +\n            _(\"privatekeys=JSON object\") + \". \" +\n            _(\"See signrawtransaction docs for format of sighash flags, JSON objects.\"));\n        fprintf(stdout, \"%s\", strUsage.c_str());\n\n        strUsage = HelpMessageGroup(_(\"Register Commands:\"));\n        strUsage += HelpMessageOpt(\"load=NAME:FILENAME\", _(\"Load JSON file FILENAME into register NAME\"));\n        strUsage += HelpMessageOpt(\"set=NAME:JSON-STRING\", _(\"Set register NAME to given JSON-STRING\"));\n        fprintf(stdout, \"%s\", strUsage.c_str());\n\n        if (argc < 2) {\n            fprintf(stderr, \"Error: too few parameters\\n\");\n            return EXIT_FAILURE;\n        }\n        return EXIT_SUCCESS;\n    }\n    return CONTINUE_EXECUTION;\n}\n\nstatic void RegisterSetJson(const std::string& key, const std::string& rawJson)\n{\n    UniValue val;\n    if (!val.read(rawJson)) {\n        std::string strErr = \"Cannot parse JSON for key \" + key;\n        throw std::runtime_error(strErr);\n    }\n\n    registers[key] = val;\n}\n\nstatic void RegisterSet(const std::string& strInput)\n{\n    // separate NAME:VALUE in string\n    size_t pos = strInput.find(':');\n    if ((pos == std::string::npos) ||\n        (pos == 0) ||\n        (pos == (strInput.size() - 1)))\n        throw std::runtime_error(\"Register input requires NAME:VALUE\");\n\n    std::string key = strInput.substr(0, pos);\n    std::string valStr = strInput.substr(pos + 1, std::string::npos);\n\n    RegisterSetJson(key, valStr);\n}\n\nstatic void RegisterLoad(const std::string& strInput)\n{\n    // separate NAME:FILENAME in string\n    size_t pos = strInput.find(':');\n    if ((pos == std::string::npos) ||\n        (pos == 0) ||\n        (pos == (strInput.size() - 1)))\n        throw std::runtime_error(\"Register load requires NAME:FILENAME\");\n\n    std::string key = strInput.substr(0, pos);\n    std::string filename = strInput.substr(pos + 1, std::string::npos);\n\n    FILE *f = fopen(filename.c_str(), \"r\");\n    if (!f) {\n        std::string strErr = \"Cannot open file \" + filename;\n        throw std::runtime_error(strErr);\n    }\n\n    // load file chunks into one big buffer\n    std::string valStr;\n    while ((!feof(f)) && (!ferror(f))) {\n        char buf[4096];\n        int bread = fread(buf, 1, sizeof(buf), f);\n        if (bread <= 0)\n            break;\n\n        valStr.insert(valStr.size(), buf, bread);\n    }\n\n    int error = ferror(f);\n    fclose(f);\n\n    if (error) {\n        std::string strErr = \"Error reading file \" + filename;\n        throw std::runtime_error(strErr);\n    }\n\n    // evaluate as JSON buffer register\n    RegisterSetJson(key, valStr);\n}\n\nstatic CAmount ExtractAndValidateValue(const std::string& strValue)\n{\n    CAmount value;\n    if (!ParseMoney(strValue, value))\n        throw std::runtime_error(\"invalid TX output value\");\n    return value;\n}\n\nstatic void MutateTxVersion(CMutableTransaction& tx, const std::string& cmdVal)\n{\n    int64_t newVersion = atoi64(cmdVal);\n    if (newVersion < 1 || newVersion > CTransaction::MAX_STANDARD_VERSION)\n        throw std::runtime_error(\"Invalid TX version requested\");\n\n    tx.nVersion = (int) newVersion;\n}\n\nstatic void MutateTxLocktime(CMutableTransaction& tx, const std::string& cmdVal)\n{\n    int64_t newLocktime = atoi64(cmdVal);\n    if (newLocktime < 0LL || newLocktime > 0xffffffffLL)\n        throw std::runtime_error(\"Invalid TX locktime requested\");\n\n    tx.nLockTime = (unsigned int) newLocktime;\n}\n\nstatic void MutateTxRBFOptIn(CMutableTransaction& tx, const std::string& strInIdx)\n{\n    // parse requested index\n    int inIdx = atoi(strInIdx);\n    if (inIdx < 0 || inIdx >= (int)tx.vin.size()) {\n        throw std::runtime_error(\"Invalid TX input index '\" + strInIdx + \"'\");\n    }\n\n    // set the nSequence to MAX_INT - 2 (= RBF opt in flag)\n    int cnt = 0;\n    for (CTxIn& txin : tx.vin) {\n        if (strInIdx == \"\" || cnt == inIdx) {\n            if (txin.nSequence > MAX_BIP125_RBF_SEQUENCE) {\n                txin.nSequence = MAX_BIP125_RBF_SEQUENCE;\n            }\n        }\n        ++cnt;\n    }\n}\n\nstatic void MutateTxAddInput(CMutableTransaction& tx, const std::string& strInput)\n{\n    std::vector<std::string> vStrInputParts;\n    boost::split(vStrInputParts, strInput, boost::is_any_of(\":\"));\n\n    // separate TXID:VOUT in string\n    if (vStrInputParts.size()<2)\n        throw std::runtime_error(\"TX input missing separator\");\n\n    // extract and validate TXID\n    std::string strTxid = vStrInputParts[0];\n    if ((strTxid.size() != 64) || !IsHex(strTxid))\n        throw std::runtime_error(\"invalid TX input txid\");\n    uint256 txid(uint256S(strTxid));\n\n    static const unsigned int minTxOutSz = 9;\n    static const unsigned int maxVout = MAX_BLOCK_WEIGHT / (WITNESS_SCALE_FACTOR * minTxOutSz);\n\n    // extract and validate vout\n    std::string strVout = vStrInputParts[1];\n    int vout = atoi(strVout);\n    if ((vout < 0) || (vout > (int)maxVout))\n        throw std::runtime_error(\"invalid TX input vout\");\n\n    // extract the optional sequence number\n    uint32_t nSequenceIn=std::numeric_limits<unsigned int>::max();\n    if (vStrInputParts.size() > 2)\n        nSequenceIn = std::stoul(vStrInputParts[2]);\n\n    // append to transaction input list\n    CTxIn txin(txid, vout, CScript(), nSequenceIn);\n    tx.vin.push_back(txin);\n}\n\nstatic void MutateTxAddOutAddr(CMutableTransaction& tx, const std::string& strInput)\n{\n    // Separate into VALUE:ADDRESS\n    std::vector<std::string> vStrInputParts;\n    boost::split(vStrInputParts, strInput, boost::is_any_of(\":\"));\n\n    if (vStrInputParts.size() != 2)\n        throw std::runtime_error(\"TX output missing or too many separators\");\n\n    // Extract and validate VALUE\n    CAmount value = ExtractAndValidateValue(vStrInputParts[0]);\n\n    // extract and validate ADDRESS\n    std::string strAddr = vStrInputParts[1];\n    CTxDestination destination = DecodeDestination(strAddr);\n    if (!IsValidDestination(destination)) {\n        throw std::runtime_error(\"invalid TX output address\");\n    }\n    CScript scriptPubKey = GetScriptForDestination(destination);\n\n    // construct TxOut, append to transaction output list\n    CTxOut txout(value, scriptPubKey);\n    tx.vout.push_back(txout);\n}\n\nstatic void MutateTxAddOutPubKey(CMutableTransaction& tx, const std::string& strInput)\n{\n    // Separate into VALUE:PUBKEY[:FLAGS]\n    std::vector<std::string> vStrInputParts;\n    boost::split(vStrInputParts, strInput, boost::is_any_of(\":\"));\n\n    if (vStrInputParts.size() < 2 || vStrInputParts.size() > 3)\n        throw std::runtime_error(\"TX output missing or too many separators\");\n\n    // Extract and validate VALUE\n    CAmount value = ExtractAndValidateValue(vStrInputParts[0]);\n\n    // Extract and validate PUBKEY\n    CPubKey pubkey(ParseHex(vStrInputParts[1]));\n    if (!pubkey.IsFullyValid())\n        throw std::runtime_error(\"invalid TX output pubkey\");\n    CScript scriptPubKey = GetScriptForRawPubKey(pubkey);\n\n    // Extract and validate FLAGS\n    bool bSegWit = false;\n    bool bScriptHash = false;\n    if (vStrInputParts.size() == 3) {\n        std::string flags = vStrInputParts[2];\n        bSegWit = (flags.find('W') != std::string::npos);\n        bScriptHash = (flags.find('S') != std::string::npos);\n    }\n\n    if (bSegWit) {\n        if (!pubkey.IsCompressed()) {\n            throw std::runtime_error(\"Uncompressed pubkeys are not useable for SegWit outputs\");\n        }\n        // Call GetScriptForWitness() to build a P2WSH scriptPubKey\n        scriptPubKey = GetScriptForWitness(scriptPubKey);\n    }\n    if (bScriptHash) {\n        // Get the ID for the script, and then construct a P2SH destination for it.\n        scriptPubKey = GetScriptForDestination(CScriptID(scriptPubKey));\n    }\n\n    // construct TxOut, append to transaction output list\n    CTxOut txout(value, scriptPubKey);\n    tx.vout.push_back(txout);\n}\n\nstatic void MutateTxAddOutMultiSig(CMutableTransaction& tx, const std::string& strInput)\n{\n    // Separate into VALUE:REQUIRED:NUMKEYS:PUBKEY1:PUBKEY2:....[:FLAGS]\n    std::vector<std::string> vStrInputParts;\n    boost::split(vStrInputParts, strInput, boost::is_any_of(\":\"));\n\n    // Check that there are enough parameters\n    if (vStrInputParts.size()<3)\n        throw std::runtime_error(\"Not enough multisig parameters\");\n\n    // Extract and validate VALUE\n    CAmount value = ExtractAndValidateValue(vStrInputParts[0]);\n\n    // Extract REQUIRED\n    uint32_t required = stoul(vStrInputParts[1]);\n\n    // Extract NUMKEYS\n    uint32_t numkeys = stoul(vStrInputParts[2]);\n\n    // Validate there are the correct number of pubkeys\n    if (vStrInputParts.size() < numkeys + 3)\n        throw std::runtime_error(\"incorrect number of multisig pubkeys\");\n\n    if (required < 1 || required > 20 || numkeys < 1 || numkeys > 20 || numkeys < required)\n        throw std::runtime_error(\"multisig parameter mismatch. Required \" \\\n                            + std::to_string(required) + \" of \" + std::to_string(numkeys) + \"signatures.\");\n\n    // extract and validate PUBKEYs\n    std::vector<CPubKey> pubkeys;\n    for(int pos = 1; pos <= int(numkeys); pos++) {\n        CPubKey pubkey(ParseHex(vStrInputParts[pos + 2]));\n        if (!pubkey.IsFullyValid())\n            throw std::runtime_error(\"invalid TX output pubkey\");\n        pubkeys.push_back(pubkey);\n    }\n\n    // Extract FLAGS\n    bool bSegWit = false;\n    bool bScriptHash = false;\n    if (vStrInputParts.size() == numkeys + 4) {\n        std::string flags = vStrInputParts.back();\n        bSegWit = (flags.find('W') != std::string::npos);\n        bScriptHash = (flags.find('S') != std::string::npos);\n    }\n    else if (vStrInputParts.size() > numkeys + 4) {\n        // Validate that there were no more parameters passed\n        throw std::runtime_error(\"Too many parameters\");\n    }\n\n    CScript scriptPubKey = GetScriptForMultisig(required, pubkeys);\n\n    if (bSegWit) {\n        for (CPubKey& pubkey : pubkeys) {\n            if (!pubkey.IsCompressed()) {\n                throw std::runtime_error(\"Uncompressed pubkeys are not useable for SegWit outputs\");\n            }\n        }\n        // Call GetScriptForWitness() to build a P2WSH scriptPubKey\n        scriptPubKey = GetScriptForWitness(scriptPubKey);\n    }\n    if (bScriptHash) {\n        if (scriptPubKey.size() > MAX_SCRIPT_ELEMENT_SIZE) {\n            throw std::runtime_error(strprintf(\n                        \"redeemScript exceeds size limit: %d > %d\", scriptPubKey.size(), MAX_SCRIPT_ELEMENT_SIZE));\n        }\n        // Get the ID for the script, and then construct a P2SH destination for it.\n        scriptPubKey = GetScriptForDestination(CScriptID(scriptPubKey));\n    }\n\n    // construct TxOut, append to transaction output list\n    CTxOut txout(value, scriptPubKey);\n    tx.vout.push_back(txout);\n}\n\nstatic void MutateTxAddOutData(CMutableTransaction& tx, const std::string& strInput)\n{\n    CAmount value = 0;\n\n    // separate [VALUE:]DATA in string\n    size_t pos = strInput.find(':');\n\n    if (pos==0)\n        throw std::runtime_error(\"TX output value not specified\");\n\n    if (pos != std::string::npos) {\n        // Extract and validate VALUE\n        value = ExtractAndValidateValue(strInput.substr(0, pos));\n    }\n\n    // extract and validate DATA\n    std::string strData = strInput.substr(pos + 1, std::string::npos);\n\n    if (!IsHex(strData))\n        throw std::runtime_error(\"invalid TX output data\");\n\n    std::vector<unsigned char> data = ParseHex(strData);\n\n    CTxOut txout(value, CScript() << OP_RETURN << data);\n    tx.vout.push_back(txout);\n}\n\nstatic void MutateTxAddOutScript(CMutableTransaction& tx, const std::string& strInput)\n{\n    // separate VALUE:SCRIPT[:FLAGS]\n    std::vector<std::string> vStrInputParts;\n    boost::split(vStrInputParts, strInput, boost::is_any_of(\":\"));\n    if (vStrInputParts.size() < 2)\n        throw std::runtime_error(\"TX output missing separator\");\n\n    // Extract and validate VALUE\n    CAmount value = ExtractAndValidateValue(vStrInputParts[0]);\n\n    // extract and validate script\n    std::string strScript = vStrInputParts[1];\n    CScript scriptPubKey = ParseScript(strScript);\n\n    // Extract FLAGS\n    bool bSegWit = false;\n    bool bScriptHash = false;\n    if (vStrInputParts.size() == 3) {\n        std::string flags = vStrInputParts.back();\n        bSegWit = (flags.find('W') != std::string::npos);\n        bScriptHash = (flags.find('S') != std::string::npos);\n    }\n\n    if (scriptPubKey.size() > MAX_SCRIPT_SIZE) {\n        throw std::runtime_error(strprintf(\n                    \"script exceeds size limit: %d > %d\", scriptPubKey.size(), MAX_SCRIPT_SIZE));\n    }\n\n    if (bSegWit) {\n        scriptPubKey = GetScriptForWitness(scriptPubKey);\n    }\n    if (bScriptHash) {\n        if (scriptPubKey.size() > MAX_SCRIPT_ELEMENT_SIZE) {\n            throw std::runtime_error(strprintf(\n                        \"redeemScript exceeds size limit: %d > %d\", scriptPubKey.size(), MAX_SCRIPT_ELEMENT_SIZE));\n        }\n        scriptPubKey = GetScriptForDestination(CScriptID(scriptPubKey));\n    }\n\n    // construct TxOut, append to transaction output list\n    CTxOut txout(value, scriptPubKey);\n    tx.vout.push_back(txout);\n}\n\nstatic void MutateTxDelInput(CMutableTransaction& tx, const std::string& strInIdx)\n{\n    // parse requested deletion index\n    int inIdx = atoi(strInIdx);\n    if (inIdx < 0 || inIdx >= (int)tx.vin.size()) {\n        std::string strErr = \"Invalid TX input index '\" + strInIdx + \"'\";\n        throw std::runtime_error(strErr.c_str());\n    }\n\n    // delete input from transaction\n    tx.vin.erase(tx.vin.begin() + inIdx);\n}\n\nstatic void MutateTxDelOutput(CMutableTransaction& tx, const std::string& strOutIdx)\n{\n    // parse requested deletion index\n    int outIdx = atoi(strOutIdx);\n    if (outIdx < 0 || outIdx >= (int)tx.vout.size()) {\n        std::string strErr = \"Invalid TX output index '\" + strOutIdx + \"'\";\n        throw std::runtime_error(strErr.c_str());\n    }\n\n    // delete output from transaction\n    tx.vout.erase(tx.vout.begin() + outIdx);\n}\n\nstatic const unsigned int N_SIGHASH_OPTS = 6;\nstatic const struct {\n    const char *flagStr;\n    int flags;\n} sighashOptions[N_SIGHASH_OPTS] = {\n    {\"ALL\", SIGHASH_ALL},\n    {\"NONE\", SIGHASH_NONE},\n    {\"SINGLE\", SIGHASH_SINGLE},\n    {\"ALL|ANYONECANPAY\", SIGHASH_ALL|SIGHASH_ANYONECANPAY},\n    {\"NONE|ANYONECANPAY\", SIGHASH_NONE|SIGHASH_ANYONECANPAY},\n    {\"SINGLE|ANYONECANPAY\", SIGHASH_SINGLE|SIGHASH_ANYONECANPAY},\n};\n\nstatic bool findSighashFlags(int& flags, const std::string& flagStr)\n{\n    flags = 0;\n\n    for (unsigned int i = 0; i < N_SIGHASH_OPTS; i++) {\n        if (flagStr == sighashOptions[i].flagStr) {\n            flags = sighashOptions[i].flags;\n            return true;\n        }\n    }\n\n    return false;\n}\n\nstatic CAmount AmountFromValue(const UniValue& value)\n{\n    if (!value.isNum() && !value.isStr())\n        throw std::runtime_error(\"Amount is not a number or string\");\n    CAmount amount;\n    if (!ParseFixedPoint(value.getValStr(), 8, &amount))\n        throw std::runtime_error(\"Invalid amount\");\n    if (!MoneyRange(amount))\n        throw std::runtime_error(\"Amount out of range\");\n    return amount;\n}\n\nstatic void MutateTxSign(CMutableTransaction& tx, const std::string& flagStr)\n{\n    int nHashType = SIGHASH_ALL;\n\n    if (flagStr.size() > 0)\n        if (!findSighashFlags(nHashType, flagStr))\n            throw std::runtime_error(\"unknown sighash flag/sign option\");\n\n    std::vector<CTransaction> txVariants;\n    txVariants.push_back(tx);\n\n    // mergedTx will end up with all the signatures; it\n    // starts as a clone of the raw tx:\n    CMutableTransaction mergedTx(txVariants[0]);\n    bool fComplete = true;\n    CCoinsView viewDummy;\n    CCoinsViewCache view(&viewDummy);\n\n    if (!registers.count(\"privatekeys\"))\n        throw std::runtime_error(\"privatekeys register variable must be set.\");\n    CBasicKeyStore tempKeystore;\n    UniValue keysObj = registers[\"privatekeys\"];\n\n    for (unsigned int kidx = 0; kidx < keysObj.size(); kidx++) {\n        if (!keysObj[kidx].isStr())\n            throw std::runtime_error(\"privatekey not a std::string\");\n        CBitcoinSecret vchSecret;\n        bool fGood = vchSecret.SetString(keysObj[kidx].getValStr());\n        if (!fGood)\n            throw std::runtime_error(\"privatekey not valid\");\n\n        CKey key = vchSecret.GetKey();\n        tempKeystore.AddKey(key);\n    }\n\n    // Add previous txouts given in the RPC call:\n    if (!registers.count(\"prevtxs\"))\n        throw std::runtime_error(\"prevtxs register variable must be set.\");\n    UniValue prevtxsObj = registers[\"prevtxs\"];\n    {\n        for (unsigned int previdx = 0; previdx < prevtxsObj.size(); previdx++) {\n            UniValue prevOut = prevtxsObj[previdx];\n            if (!prevOut.isObject())\n                throw std::runtime_error(\"expected prevtxs internal object\");\n\n            std::map<std::string, UniValue::VType> types = {\n                {\"txid\", UniValue::VSTR},\n                {\"vout\", UniValue::VNUM},\n                {\"scriptPubKey\", UniValue::VSTR},\n            };\n            if (!prevOut.checkObject(types))\n                throw std::runtime_error(\"prevtxs internal object typecheck fail\");\n\n            uint256 txid = ParseHashUV(prevOut[\"txid\"], \"txid\");\n\n            int nOut = atoi(prevOut[\"vout\"].getValStr());\n            if (nOut < 0)\n                throw std::runtime_error(\"vout must be positive\");\n\n            COutPoint out(txid, nOut);\n            std::vector<unsigned char> pkData(ParseHexUV(prevOut[\"scriptPubKey\"], \"scriptPubKey\"));\n            CScript scriptPubKey(pkData.begin(), pkData.end());\n\n            {\n                const Coin& coin = view.AccessCoin(out);\n                if (!coin.IsSpent() && coin.out.scriptPubKey != scriptPubKey) {\n                    std::string err(\"Previous output scriptPubKey mismatch:\\n\");\n                    err = err + ScriptToAsmStr(coin.out.scriptPubKey) + \"\\nvs:\\n\"+\n                        ScriptToAsmStr(scriptPubKey);\n                    throw std::runtime_error(err);\n                }\n                Coin newcoin;\n                newcoin.out.scriptPubKey = scriptPubKey;\n                newcoin.out.nValue = 0;\n                if (prevOut.exists(\"amount\")) {\n                    newcoin.out.nValue = AmountFromValue(prevOut[\"amount\"]);\n                }\n                newcoin.nHeight = 1;\n                view.AddCoin(out, std::move(newcoin), true);\n            }\n\n            // if redeemScript given and private keys given,\n            // add redeemScript to the tempKeystore so it can be signed:\n            if ((scriptPubKey.IsPayToScriptHash() || scriptPubKey.IsPayToWitnessScriptHash()) &&\n                prevOut.exists(\"redeemScript\")) {\n                UniValue v = prevOut[\"redeemScript\"];\n                std::vector<unsigned char> rsData(ParseHexUV(v, \"redeemScript\"));\n                CScript redeemScript(rsData.begin(), rsData.end());\n                tempKeystore.AddCScript(redeemScript);\n            }\n        }\n    }\n\n    const CKeyStore& keystore = tempKeystore;\n\n    bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE);\n\n    // Sign what we can:\n    for (unsigned int i = 0; i < mergedTx.vin.size(); i++) {\n        CTxIn& txin = mergedTx.vin[i];\n        const Coin& coin = view.AccessCoin(txin.prevout);\n        if (coin.IsSpent()) {\n            fComplete = false;\n            continue;\n        }\n        const CScript& prevPubKey = coin.out.scriptPubKey;\n        const CAmount& amount = coin.out.nValue;\n\n        SignatureData sigdata;\n        // Only sign SIGHASH_SINGLE if there's a corresponding output:\n        if (!fHashSingle || (i < mergedTx.vout.size()))\n            ProduceSignature(MutableTransactionSignatureCreator(&keystore, &mergedTx, i, amount, nHashType), prevPubKey, sigdata);\n\n        // ... and merge in other signatures:\n        for (const CTransaction& txv : txVariants)\n            sigdata = CombineSignatures(prevPubKey, MutableTransactionSignatureChecker(&mergedTx, i, amount), sigdata, DataFromTransaction(txv, i));\n        UpdateTransaction(mergedTx, i, sigdata);\n\n        if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, MutableTransactionSignatureChecker(&mergedTx, i, amount)))\n            fComplete = false;\n    }\n\n    if (fComplete) {\n        // do nothing... for now\n        // perhaps store this for later optional JSON output\n    }\n\n    tx = mergedTx;\n}\n\nclass Secp256k1Init\n{\n    ECCVerifyHandle globalVerifyHandle;\n\npublic:\n    Secp256k1Init() {\n        ECC_Start();\n    }\n    ~Secp256k1Init() {\n        ECC_Stop();\n    }\n};\n\nstatic void MutateTx(CMutableTransaction& tx, const std::string& command,\n                     const std::string& commandVal)\n{\n    std::unique_ptr<Secp256k1Init> ecc;\n\n    if (command == \"nversion\")\n        MutateTxVersion(tx, commandVal);\n    else if (command == \"locktime\")\n        MutateTxLocktime(tx, commandVal);\n    else if (command == \"replaceable\") {\n        MutateTxRBFOptIn(tx, commandVal);\n    }\n\n    else if (command == \"delin\")\n        MutateTxDelInput(tx, commandVal);\n    else if (command == \"in\")\n        MutateTxAddInput(tx, commandVal);\n\n    else if (command == \"delout\")\n        MutateTxDelOutput(tx, commandVal);\n    else if (command == \"outaddr\")\n        MutateTxAddOutAddr(tx, commandVal);\n    else if (command == \"outpubkey\") {\n        ecc.reset(new Secp256k1Init());\n        MutateTxAddOutPubKey(tx, commandVal);\n    } else if (command == \"outmultisig\") {\n        ecc.reset(new Secp256k1Init());\n        MutateTxAddOutMultiSig(tx, commandVal);\n    } else if (command == \"outscript\")\n        MutateTxAddOutScript(tx, commandVal);\n    else if (command == \"outdata\")\n        MutateTxAddOutData(tx, commandVal);\n\n    else if (command == \"sign\") {\n        ecc.reset(new Secp256k1Init());\n        MutateTxSign(tx, commandVal);\n    }\n\n    else if (command == \"load\")\n        RegisterLoad(commandVal);\n\n    else if (command == \"set\")\n        RegisterSet(commandVal);\n\n    else\n        throw std::runtime_error(\"unknown command\");\n}\n\nstatic void OutputTxJSON(const CTransaction& tx)\n{\n    UniValue entry(UniValue::VOBJ);\n    TxToUniv(tx, uint256(), entry);\n\n    std::string jsonOutput = entry.write(4);\n    fprintf(stdout, \"%s\\n\", jsonOutput.c_str());\n}\n\nstatic void OutputTxHash(const CTransaction& tx)\n{\n    std::string strHexHash = tx.GetHash().GetHex(); // the hex-encoded transaction hash (aka the transaction id)\n\n    fprintf(stdout, \"%s\\n\", strHexHash.c_str());\n}\n\nstatic void OutputTxHex(const CTransaction& tx)\n{\n    std::string strHex = EncodeHexTx(tx);\n\n    fprintf(stdout, \"%s\\n\", strHex.c_str());\n}\n\nstatic void OutputTx(const CTransaction& tx)\n{\n    if (gArgs.GetBoolArg(\"-json\", false))\n        OutputTxJSON(tx);\n    else if (gArgs.GetBoolArg(\"-txid\", false))\n        OutputTxHash(tx);\n    else\n        OutputTxHex(tx);\n}\n\nstatic std::string readStdin()\n{\n    char buf[4096];\n    std::string ret;\n\n    while (!feof(stdin)) {\n        size_t bread = fread(buf, 1, sizeof(buf), stdin);\n        ret.append(buf, bread);\n        if (bread < sizeof(buf))\n            break;\n    }\n\n    if (ferror(stdin))\n        throw std::runtime_error(\"error reading stdin\");\n\n    boost::algorithm::trim_right(ret);\n\n    return ret;\n}\n\nstatic int CommandLineRawTx(int argc, char* argv[])\n{\n    std::string strPrint;\n    int nRet = 0;\n    try {\n        // Skip switches; Permit common stdin convention \"-\"\n        while (argc > 1 && IsSwitchChar(argv[1][0]) &&\n               (argv[1][1] != 0)) {\n            argc--;\n            argv++;\n        }\n\n        CMutableTransaction tx;\n        int startArg;\n\n        if (!fCreateBlank) {\n            // require at least one param\n            if (argc < 2)\n                throw std::runtime_error(\"too few parameters\");\n\n            // param: hex-encoded bitcoin transaction\n            std::string strHexTx(argv[1]);\n            if (strHexTx == \"-\")                 // \"-\" implies standard input\n                strHexTx = readStdin();\n\n            if (!DecodeHexTx(tx, strHexTx, true))\n                throw std::runtime_error(\"invalid transaction encoding\");\n\n            startArg = 2;\n        } else\n            startArg = 1;\n\n        for (int i = startArg; i < argc; i++) {\n            std::string arg = argv[i];\n            std::string key, value;\n            size_t eqpos = arg.find('=');\n            if (eqpos == std::string::npos)\n                key = arg;\n            else {\n                key = arg.substr(0, eqpos);\n                value = arg.substr(eqpos + 1);\n            }\n\n            MutateTx(tx, key, value);\n        }\n\n        OutputTx(tx);\n    }\n\n    catch (const boost::thread_interrupted&) {\n        throw;\n    }\n    catch (const std::exception& e) {\n        strPrint = std::string(\"error: \") + e.what();\n        nRet = EXIT_FAILURE;\n    }\n    catch (...) {\n        PrintExceptionContinue(nullptr, \"CommandLineRawTx()\");\n        throw;\n    }\n\n    if (strPrint != \"\") {\n        fprintf((nRet == 0 ? stdout : stderr), \"%s\\n\", strPrint.c_str());\n    }\n    return nRet;\n}\n\nint main(int argc, char* argv[])\n{\n    SetupEnvironment();\n\n    try {\n        int ret = AppInitRawTx(argc, argv);\n        if (ret != CONTINUE_EXECUTION)\n            return ret;\n    }\n    catch (const std::exception& e) {\n        PrintExceptionContinue(&e, \"AppInitRawTx()\");\n        return EXIT_FAILURE;\n    } catch (...) {\n        PrintExceptionContinue(nullptr, \"AppInitRawTx()\");\n        return EXIT_FAILURE;\n    }\n\n    int ret = EXIT_FAILURE;\n    try {\n        ret = CommandLineRawTx(argc, argv);\n    }\n    catch (const std::exception& e) {\n        PrintExceptionContinue(&e, \"CommandLineRawTx()\");\n    } catch (...) {\n        PrintExceptionContinue(nullptr, \"CommandLineRawTx()\");\n    }\n    return ret;\n}\n"
  },
  {
    "path": "src/bitcoind-res.rc",
    "content": "#include <windows.h>             // needed for VERSIONINFO\n#include \"clientversion.h\"       // holds the needed client version information\n\n#define VER_PRODUCTVERSION     CLIENT_VERSION_MAJOR,CLIENT_VERSION_MINOR,CLIENT_VERSION_REVISION,CLIENT_VERSION_BUILD\n#define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) \".\" STRINGIZE(CLIENT_VERSION_MINOR) \".\" STRINGIZE(CLIENT_VERSION_REVISION) \".\" STRINGIZE(CLIENT_VERSION_BUILD)\n#define VER_FILEVERSION        VER_PRODUCTVERSION\n#define VER_FILEVERSION_STR    VER_PRODUCTVERSION_STR\n\nVS_VERSION_INFO VERSIONINFO\nFILEVERSION     VER_FILEVERSION\nPRODUCTVERSION  VER_PRODUCTVERSION\nFILEOS          VOS_NT_WINDOWS32\nFILETYPE        VFT_APP\nBEGIN\n    BLOCK \"StringFileInfo\"\n    BEGIN\n        BLOCK \"040904E4\" // U.S. English - multilingual (hex)\n        BEGIN\n            VALUE \"CompanyName\",        \"Sugarchain\"\n            VALUE \"FileDescription\",    \"sugarchaind (Sugarchain node with a JSON-RPC server)\"\n            VALUE \"FileVersion\",        VER_FILEVERSION_STR\n            VALUE \"InternalName\",       \"sugarchaind\"\n            VALUE \"LegalCopyright\",     COPYRIGHT_STR\n            VALUE \"LegalTrademarks1\",   \"Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.\"\n            VALUE \"OriginalFilename\",   \"sugarchaind.exe\"\n            VALUE \"ProductName\",        \"sugarchaind\"\n            VALUE \"ProductVersion\",     VER_PRODUCTVERSION_STR\n        END\n    END\n\n    BLOCK \"VarFileInfo\"\n    BEGIN\n        VALUE \"Translation\", 0x0, 1252 // language neutral - multilingual (decimal)\n    END\nEND\n"
  },
  {
    "path": "src/bitcoind.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <chainparams.h>\n#include <clientversion.h>\n#include <compat.h>\n#include <fs.h>\n#include <rpc/server.h>\n#include <init.h>\n#include <noui.h>\n#include <util.h>\n#include <httpserver.h>\n#include <httprpc.h>\n#include <utilstrencodings.h>\n\n#include <boost/thread.hpp>\n\n#include <stdio.h>\n\n/* Introduction text for doxygen: */\n\n/*! \\mainpage Developer documentation\n *\n * \\section intro_sec Introduction\n *\n * This is the developer documentation of the reference client for an experimental new digital currency called Bitcoin (https://www.bitcoin.org/),\n * which enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate\n * with no central authority: managing transactions and issuing money are carried out collectively by the network.\n *\n * The software is a community-driven open source project, released under the MIT license.\n *\n * \\section Navigation\n * Use the buttons <code>Namespaces</code>, <code>Classes</code> or <code>Files</code> at the top of the page to start navigating the code.\n */\n\nvoid WaitForShutdown()\n{\n    bool fShutdown = ShutdownRequested();\n    // Tell the main threads to shutdown.\n    while (!fShutdown)\n    {\n        MilliSleep(200);\n        fShutdown = ShutdownRequested();\n    }\n    Interrupt();\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// Start\n//\nbool AppInit(int argc, char* argv[])\n{\n    bool fRet = false;\n\n    //\n    // Parameters\n    //\n    // If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main()\n    gArgs.ParseParameters(argc, argv);\n\n    // Process help and version before taking care about datadir\n    if (gArgs.IsArgSet(\"-?\") || gArgs.IsArgSet(\"-h\") ||  gArgs.IsArgSet(\"-help\") || gArgs.IsArgSet(\"-version\"))\n    {\n        std::string strUsage = strprintf(_(\"%s Daemon\"), _(PACKAGE_NAME)) + \" \" + _(\"version\") + \" \" + FormatFullVersion() + \"\\n\";\n\n        if (gArgs.IsArgSet(\"-version\"))\n        {\n            strUsage += FormatParagraph(LicenseInfo());\n        }\n        else\n        {\n            strUsage += \"\\n\" + _(\"Usage:\") + \"\\n\" +\n                  \"  sugarchaind [options]                     \" + strprintf(_(\"Start %s Daemon\"), _(PACKAGE_NAME)) + \"\\n\";\n\n            strUsage += \"\\n\" + HelpMessage(HMM_BITCOIND);\n        }\n\n        fprintf(stdout, \"%s\", strUsage.c_str());\n        return true;\n    }\n\n    try\n    {\n        if (!fs::is_directory(GetDataDir(false)))\n        {\n            fprintf(stderr, \"Error: Specified data directory \\\"%s\\\" does not exist.\\n\", gArgs.GetArg(\"-datadir\", \"\").c_str());\n            return false;\n        }\n        try\n        {\n            gArgs.ReadConfigFile(gArgs.GetArg(\"-conf\", BITCOIN_CONF_FILENAME));\n        } catch (const std::exception& e) {\n            fprintf(stderr,\"Error reading configuration file: %s\\n\", e.what());\n            return false;\n        }\n        // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)\n        try {\n            SelectParams(ChainNameFromCommandLine());\n        } catch (const std::exception& e) {\n            fprintf(stderr, \"Error: %s\\n\", e.what());\n            return false;\n        }\n\n        // Error out when loose non-argument tokens are encountered on command line\n        for (int i = 1; i < argc; i++) {\n            if (!IsSwitchChar(argv[i][0])) {\n                fprintf(stderr, \"Error: Command line contains unexpected token '%s', see sugarchaind -h for a list of options.\\n\", argv[i]);\n                return false;\n            }\n        }\n\n        // -server defaults to true for bitcoind but not for the GUI so do this here\n        gArgs.SoftSetBoolArg(\"-server\", true);\n        // Set this early so that parameter interactions go to console\n        InitLogging();\n        InitParameterInteraction();\n        if (!AppInitBasicSetup())\n        {\n            // InitError will have been called with detailed error, which ends up on console\n            return false;\n        }\n        if (!AppInitParameterInteraction())\n        {\n            // InitError will have been called with detailed error, which ends up on console\n            return false;\n        }\n        if (!AppInitSanityChecks())\n        {\n            // InitError will have been called with detailed error, which ends up on console\n            return false;\n        }\n        if (gArgs.GetBoolArg(\"-daemon\", false))\n        {\n#if HAVE_DECL_DAEMON\n            fprintf(stdout, \"Sugarchain server starting\\n\");\n\n            // Daemonize\n            if (daemon(1, 0)) { // don't chdir (1), do close FDs (0)\n                fprintf(stderr, \"Error: daemon() failed: %s\\n\", strerror(errno));\n                return false;\n            }\n#else\n            fprintf(stderr, \"Error: -daemon is not supported on this operating system\\n\");\n            return false;\n#endif // HAVE_DECL_DAEMON\n        }\n        // Lock data directory after daemonization\n        if (!AppInitLockDataDirectory())\n        {\n            // If locking the data directory failed, exit immediately\n            return false;\n        }\n        fRet = AppInitMain();\n    }\n    catch (const std::exception& e) {\n        PrintExceptionContinue(&e, \"AppInit()\");\n    } catch (...) {\n        PrintExceptionContinue(nullptr, \"AppInit()\");\n    }\n\n    if (!fRet)\n    {\n        Interrupt();\n    } else {\n        WaitForShutdown();\n    }\n    Shutdown();\n\n    return fRet;\n}\n\nint main(int argc, char* argv[])\n{\n    SetupEnvironment();\n\n    // Connect sugarchaind signal handlers\n    noui_connect();\n\n    return (AppInit(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE);\n}\n"
  },
  {
    "path": "src/blockencodings.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <blockencodings.h>\n#include <consensus/consensus.h>\n#include <consensus/validation.h>\n#include <chainparams.h>\n#include <hash.h>\n#include <random.h>\n#include <streams.h>\n#include <txmempool.h>\n#include <validation.h>\n#include <util.h>\n\n#include <unordered_map>\n\nCBlockHeaderAndShortTxIDs::CBlockHeaderAndShortTxIDs(const CBlock& block, bool fUseWTXID) :\n        nonce(GetRand(std::numeric_limits<uint64_t>::max())),\n        shorttxids(block.vtx.size() - 1), prefilledtxn(1), header(block) {\n    FillShortTxIDSelector();\n    //TODO: Use our mempool prior to block acceptance to predictively fill more than just the coinbase\n    prefilledtxn[0] = {0, block.vtx[0]};\n    for (size_t i = 1; i < block.vtx.size(); i++) {\n        const CTransaction& tx = *block.vtx[i];\n        shorttxids[i - 1] = GetShortID(fUseWTXID ? tx.GetWitnessHash() : tx.GetHash());\n    }\n}\n\nvoid CBlockHeaderAndShortTxIDs::FillShortTxIDSelector() const {\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << header << nonce;\n    CSHA256 hasher;\n    hasher.Write((unsigned char*)&(*stream.begin()), stream.end() - stream.begin());\n    uint256 shorttxidhash;\n    hasher.Finalize(shorttxidhash.begin());\n    shorttxidk0 = shorttxidhash.GetUint64(0);\n    shorttxidk1 = shorttxidhash.GetUint64(1);\n}\n\nuint64_t CBlockHeaderAndShortTxIDs::GetShortID(const uint256& txhash) const {\n    static_assert(SHORTTXIDS_LENGTH == 6, \"shorttxids calculation assumes 6-byte shorttxids\");\n    return SipHashUint256(shorttxidk0, shorttxidk1, txhash) & 0xffffffffffffL;\n}\n\n\n\nReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& cmpctblock, const std::vector<std::pair<uint256, CTransactionRef>>& extra_txn) {\n    if (cmpctblock.header.IsNull() || (cmpctblock.shorttxids.empty() && cmpctblock.prefilledtxn.empty()))\n        return READ_STATUS_INVALID;\n    if (cmpctblock.shorttxids.size() + cmpctblock.prefilledtxn.size() > MAX_BLOCK_WEIGHT / MIN_SERIALIZABLE_TRANSACTION_WEIGHT)\n        return READ_STATUS_INVALID;\n\n    assert(header.IsNull() && txn_available.empty());\n    header = cmpctblock.header;\n    txn_available.resize(cmpctblock.BlockTxCount());\n\n    int32_t lastprefilledindex = -1;\n    for (size_t i = 0; i < cmpctblock.prefilledtxn.size(); i++) {\n        if (cmpctblock.prefilledtxn[i].tx->IsNull())\n            return READ_STATUS_INVALID;\n\n        lastprefilledindex += cmpctblock.prefilledtxn[i].index + 1; //index is a uint16_t, so can't overflow here\n        if (lastprefilledindex > std::numeric_limits<uint16_t>::max())\n            return READ_STATUS_INVALID;\n        if ((uint32_t)lastprefilledindex > cmpctblock.shorttxids.size() + i) {\n            // If we are inserting a tx at an index greater than our full list of shorttxids\n            // plus the number of prefilled txn we've inserted, then we have txn for which we\n            // have neither a prefilled txn or a shorttxid!\n            return READ_STATUS_INVALID;\n        }\n        txn_available[lastprefilledindex] = cmpctblock.prefilledtxn[i].tx;\n    }\n    prefilled_count = cmpctblock.prefilledtxn.size();\n\n    // Calculate map of txids -> positions and check mempool to see what we have (or don't)\n    // Because well-formed cmpctblock messages will have a (relatively) uniform distribution\n    // of short IDs, any highly-uneven distribution of elements can be safely treated as a\n    // READ_STATUS_FAILED.\n    std::unordered_map<uint64_t, uint16_t> shorttxids(cmpctblock.shorttxids.size());\n    uint16_t index_offset = 0;\n    for (size_t i = 0; i < cmpctblock.shorttxids.size(); i++) {\n        while (txn_available[i + index_offset])\n            index_offset++;\n        shorttxids[cmpctblock.shorttxids[i]] = i + index_offset;\n        // To determine the chance that the number of entries in a bucket exceeds N,\n        // we use the fact that the number of elements in a single bucket is\n        // binomially distributed (with n = the number of shorttxids S, and p =\n        // 1 / the number of buckets), that in the worst case the number of buckets is\n        // equal to S (due to std::unordered_map having a default load factor of 1.0),\n        // and that the chance for any bucket to exceed N elements is at most\n        // buckets * (the chance that any given bucket is above N elements).\n        // Thus: P(max_elements_per_bucket > N) <= S * (1 - cdf(binomial(n=S,p=1/S), N)).\n        // If we assume blocks of up to 16000, allowing 12 elements per bucket should\n        // only fail once per ~1 million block transfers (per peer and connection).\n        if (shorttxids.bucket_size(shorttxids.bucket(cmpctblock.shorttxids[i])) > 12)\n            return READ_STATUS_FAILED;\n    }\n    // TODO: in the shortid-collision case, we should instead request both transactions\n    // which collided. Falling back to full-block-request here is overkill.\n    if (shorttxids.size() != cmpctblock.shorttxids.size())\n        return READ_STATUS_FAILED; // Short ID collision\n\n    std::vector<bool> have_txn(txn_available.size());\n    {\n    LOCK(pool->cs);\n    const std::vector<std::pair<uint256, CTxMemPool::txiter> >& vTxHashes = pool->vTxHashes;\n    for (size_t i = 0; i < vTxHashes.size(); i++) {\n        uint64_t shortid = cmpctblock.GetShortID(vTxHashes[i].first);\n        std::unordered_map<uint64_t, uint16_t>::iterator idit = shorttxids.find(shortid);\n        if (idit != shorttxids.end()) {\n            if (!have_txn[idit->second]) {\n                txn_available[idit->second] = vTxHashes[i].second->GetSharedTx();\n                have_txn[idit->second]  = true;\n                mempool_count++;\n            } else {\n                // If we find two mempool txn that match the short id, just request it.\n                // This should be rare enough that the extra bandwidth doesn't matter,\n                // but eating a round-trip due to FillBlock failure would be annoying\n                if (txn_available[idit->second]) {\n                    txn_available[idit->second].reset();\n                    mempool_count--;\n                }\n            }\n        }\n        // Though ideally we'd continue scanning for the two-txn-match-shortid case,\n        // the performance win of an early exit here is too good to pass up and worth\n        // the extra risk.\n        if (mempool_count == shorttxids.size())\n            break;\n    }\n    }\n\n    for (size_t i = 0; i < extra_txn.size(); i++) {\n        uint64_t shortid = cmpctblock.GetShortID(extra_txn[i].first);\n        std::unordered_map<uint64_t, uint16_t>::iterator idit = shorttxids.find(shortid);\n        if (idit != shorttxids.end()) {\n            if (!have_txn[idit->second]) {\n                txn_available[idit->second] = extra_txn[i].second;\n                have_txn[idit->second]  = true;\n                mempool_count++;\n                extra_count++;\n            } else {\n                // If we find two mempool/extra txn that match the short id, just\n                // request it.\n                // This should be rare enough that the extra bandwidth doesn't matter,\n                // but eating a round-trip due to FillBlock failure would be annoying\n                // Note that we don't want duplication between extra_txn and mempool to\n                // trigger this case, so we compare witness hashes first\n                if (txn_available[idit->second] &&\n                        txn_available[idit->second]->GetWitnessHash() != extra_txn[i].second->GetWitnessHash()) {\n                    txn_available[idit->second].reset();\n                    mempool_count--;\n                    extra_count--;\n                }\n            }\n        }\n        // Though ideally we'd continue scanning for the two-txn-match-shortid case,\n        // the performance win of an early exit here is too good to pass up and worth\n        // the extra risk.\n        if (mempool_count == shorttxids.size())\n            break;\n    }\n\n    LogPrint(BCLog::CMPCTBLOCK, \"Initialized PartiallyDownloadedBlock for block %s using a cmpctblock of size %lu\\n\", cmpctblock.header.GetHash().ToString(), GetSerializeSize(cmpctblock, SER_NETWORK, PROTOCOL_VERSION));\n\n    return READ_STATUS_OK;\n}\n\nbool PartiallyDownloadedBlock::IsTxAvailable(size_t index) const {\n    assert(!header.IsNull());\n    assert(index < txn_available.size());\n    return txn_available[index] != nullptr;\n}\n\nReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing) {\n    assert(!header.IsNull());\n    uint256 hash = header.GetHash();\n    block = header;\n    block.vtx.resize(txn_available.size());\n\n    size_t tx_missing_offset = 0;\n    for (size_t i = 0; i < txn_available.size(); i++) {\n        if (!txn_available[i]) {\n            if (vtx_missing.size() <= tx_missing_offset)\n                return READ_STATUS_INVALID;\n            block.vtx[i] = vtx_missing[tx_missing_offset++];\n        } else\n            block.vtx[i] = std::move(txn_available[i]);\n    }\n\n    // Make sure we can't call FillBlock again.\n    header.SetNull();\n    txn_available.clear();\n\n    if (vtx_missing.size() != tx_missing_offset)\n        return READ_STATUS_INVALID;\n\n    CValidationState state;\n    if (!CheckBlock(block, state, Params().GetConsensus())) {\n        // TODO: We really want to just check merkle tree manually here,\n        // but that is expensive, and CheckBlock caches a block's\n        // \"checked-status\" (in the CBlock?). CBlock should be able to\n        // check its own merkle root and cache that check.\n        if (state.CorruptionPossible())\n            return READ_STATUS_FAILED; // Possible Short ID collision\n        return READ_STATUS_CHECKBLOCK_FAILED;\n    }\n\n    LogPrint(BCLog::CMPCTBLOCK, \"Successfully reconstructed block %s with %lu txn prefilled, %lu txn from mempool (incl at least %lu from extra pool) and %lu txn requested\\n\", hash.ToString(), prefilled_count, mempool_count, extra_count, vtx_missing.size());\n    if (vtx_missing.size() < 5) {\n        for (const auto& tx : vtx_missing) {\n            LogPrint(BCLog::CMPCTBLOCK, \"Reconstructed block %s required tx %s\\n\", hash.ToString(), tx->GetHash().ToString());\n        }\n    }\n\n    return READ_STATUS_OK;\n}\n"
  },
  {
    "path": "src/blockencodings.h",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_BLOCK_ENCODINGS_H\n#define BITCOIN_BLOCK_ENCODINGS_H\n\n#include <primitives/block.h>\n\n#include <memory>\n\nclass CTxMemPool;\n\n// Dumb helper to handle CTransaction compression at serialize-time\nstruct TransactionCompressor {\nprivate:\n    CTransactionRef& tx;\npublic:\n    explicit TransactionCompressor(CTransactionRef& txIn) : tx(txIn) {}\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(tx); //TODO: Compress tx encoding\n    }\n};\n\nclass BlockTransactionsRequest {\npublic:\n    // A BlockTransactionsRequest message\n    uint256 blockhash;\n    std::vector<uint16_t> indexes;\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(blockhash);\n        uint64_t indexes_size = (uint64_t)indexes.size();\n        READWRITE(COMPACTSIZE(indexes_size));\n        if (ser_action.ForRead()) {\n            size_t i = 0;\n            while (indexes.size() < indexes_size) {\n                indexes.resize(std::min((uint64_t)(1000 + indexes.size()), indexes_size));\n                for (; i < indexes.size(); i++) {\n                    uint64_t index = 0;\n                    READWRITE(COMPACTSIZE(index));\n                    if (index > std::numeric_limits<uint16_t>::max())\n                        throw std::ios_base::failure(\"index overflowed 16 bits\");\n                    indexes[i] = index;\n                }\n            }\n\n            uint16_t offset = 0;\n            for (size_t j = 0; j < indexes.size(); j++) {\n                if (uint64_t(indexes[j]) + uint64_t(offset) > std::numeric_limits<uint16_t>::max())\n                    throw std::ios_base::failure(\"indexes overflowed 16 bits\");\n                indexes[j] = indexes[j] + offset;\n                offset = indexes[j] + 1;\n            }\n        } else {\n            for (size_t i = 0; i < indexes.size(); i++) {\n                uint64_t index = indexes[i] - (i == 0 ? 0 : (indexes[i - 1] + 1));\n                READWRITE(COMPACTSIZE(index));\n            }\n        }\n    }\n};\n\nclass BlockTransactions {\npublic:\n    // A BlockTransactions message\n    uint256 blockhash;\n    std::vector<CTransactionRef> txn;\n\n    BlockTransactions() {}\n    explicit BlockTransactions(const BlockTransactionsRequest& req) :\n        blockhash(req.blockhash), txn(req.indexes.size()) {}\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(blockhash);\n        uint64_t txn_size = (uint64_t)txn.size();\n        READWRITE(COMPACTSIZE(txn_size));\n        if (ser_action.ForRead()) {\n            size_t i = 0;\n            while (txn.size() < txn_size) {\n                txn.resize(std::min((uint64_t)(1000 + txn.size()), txn_size));\n                for (; i < txn.size(); i++)\n                    READWRITE(REF(TransactionCompressor(txn[i])));\n            }\n        } else {\n            for (size_t i = 0; i < txn.size(); i++)\n                READWRITE(REF(TransactionCompressor(txn[i])));\n        }\n    }\n};\n\n// Dumb serialization/storage-helper for CBlockHeaderAndShortTxIDs and PartiallyDownloadedBlock\nstruct PrefilledTransaction {\n    // Used as an offset since last prefilled tx in CBlockHeaderAndShortTxIDs,\n    // as a proper transaction-in-block-index in PartiallyDownloadedBlock\n    uint16_t index;\n    CTransactionRef tx;\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        uint64_t idx = index;\n        READWRITE(COMPACTSIZE(idx));\n        if (idx > std::numeric_limits<uint16_t>::max())\n            throw std::ios_base::failure(\"index overflowed 16-bits\");\n        index = idx;\n        READWRITE(REF(TransactionCompressor(tx)));\n    }\n};\n\ntypedef enum ReadStatus_t\n{\n    READ_STATUS_OK,\n    READ_STATUS_INVALID, // Invalid object, peer is sending bogus crap\n    READ_STATUS_FAILED, // Failed to process object\n    READ_STATUS_CHECKBLOCK_FAILED, // Used only by FillBlock to indicate a\n                                   // failure in CheckBlock.\n} ReadStatus;\n\nclass CBlockHeaderAndShortTxIDs {\nprivate:\n    mutable uint64_t shorttxidk0, shorttxidk1;\n    uint64_t nonce;\n\n    void FillShortTxIDSelector() const;\n\n    friend class PartiallyDownloadedBlock;\n\n    static const int SHORTTXIDS_LENGTH = 6;\nprotected:\n    std::vector<uint64_t> shorttxids;\n    std::vector<PrefilledTransaction> prefilledtxn;\n\npublic:\n    CBlockHeader header;\n\n    // Dummy for deserialization\n    CBlockHeaderAndShortTxIDs() {}\n\n    CBlockHeaderAndShortTxIDs(const CBlock& block, bool fUseWTXID);\n\n    uint64_t GetShortID(const uint256& txhash) const;\n\n    size_t BlockTxCount() const { return shorttxids.size() + prefilledtxn.size(); }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(header);\n        READWRITE(nonce);\n\n        uint64_t shorttxids_size = (uint64_t)shorttxids.size();\n        READWRITE(COMPACTSIZE(shorttxids_size));\n        if (ser_action.ForRead()) {\n            size_t i = 0;\n            while (shorttxids.size() < shorttxids_size) {\n                shorttxids.resize(std::min((uint64_t)(1000 + shorttxids.size()), shorttxids_size));\n                for (; i < shorttxids.size(); i++) {\n                    uint32_t lsb = 0; uint16_t msb = 0;\n                    READWRITE(lsb);\n                    READWRITE(msb);\n                    shorttxids[i] = (uint64_t(msb) << 32) | uint64_t(lsb);\n                    static_assert(SHORTTXIDS_LENGTH == 6, \"shorttxids serialization assumes 6-byte shorttxids\");\n                }\n            }\n        } else {\n            for (size_t i = 0; i < shorttxids.size(); i++) {\n                uint32_t lsb = shorttxids[i] & 0xffffffff;\n                uint16_t msb = (shorttxids[i] >> 32) & 0xffff;\n                READWRITE(lsb);\n                READWRITE(msb);\n            }\n        }\n\n        READWRITE(prefilledtxn);\n\n        if (ser_action.ForRead())\n            FillShortTxIDSelector();\n    }\n};\n\nclass PartiallyDownloadedBlock {\nprotected:\n    std::vector<CTransactionRef> txn_available;\n    size_t prefilled_count = 0, mempool_count = 0, extra_count = 0;\n    CTxMemPool* pool;\npublic:\n    CBlockHeader header;\n    explicit PartiallyDownloadedBlock(CTxMemPool* poolIn) : pool(poolIn) {}\n\n    // extra_txn is a list of extra transactions to look at, in <witness hash, reference> form\n    ReadStatus InitData(const CBlockHeaderAndShortTxIDs& cmpctblock, const std::vector<std::pair<uint256, CTransactionRef>>& extra_txn);\n    bool IsTxAvailable(size_t index) const;\n    ReadStatus FillBlock(CBlock& block, const std::vector<CTransactionRef>& vtx_missing);\n};\n\n#endif\n"
  },
  {
    "path": "src/bloom.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bloom.h>\n\n#include <primitives/transaction.h>\n#include <hash.h>\n#include <script/script.h>\n#include <script/standard.h>\n#include <random.h>\n#include <streams.h>\n\n#include <math.h>\n#include <stdlib.h>\n\n\n#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455\n#define LN2 0.6931471805599453094172321214581765680755001343602552\n\nCBloomFilter::CBloomFilter(const unsigned int nElements, const double nFPRate, const unsigned int nTweakIn, unsigned char nFlagsIn) :\n    /**\n     * The ideal size for a bloom filter with a given number of elements and false positive rate is:\n     * - nElements * log(fp rate) / ln(2)^2\n     * We ignore filter parameters which will create a bloom filter larger than the protocol limits\n     */\n    vData(std::min((unsigned int)(-1  / LN2SQUARED * nElements * log(nFPRate)), MAX_BLOOM_FILTER_SIZE * 8) / 8),\n    /**\n     * The ideal number of hash functions is filter size * ln(2) / number of elements\n     * Again, we ignore filter parameters which will create a bloom filter with more hash functions than the protocol limits\n     * See https://en.wikipedia.org/wiki/Bloom_filter for an explanation of these formulas\n     */\n    isFull(false),\n    isEmpty(true),\n    nHashFuncs(std::min((unsigned int)(vData.size() * 8 / nElements * LN2), MAX_HASH_FUNCS)),\n    nTweak(nTweakIn),\n    nFlags(nFlagsIn)\n{\n}\n\n// Private constructor used by CRollingBloomFilter\nCBloomFilter::CBloomFilter(const unsigned int nElements, const double nFPRate, const unsigned int nTweakIn) :\n    vData((unsigned int)(-1  / LN2SQUARED * nElements * log(nFPRate)) / 8),\n    isFull(false),\n    isEmpty(true),\n    nHashFuncs((unsigned int)(vData.size() * 8 / nElements * LN2)),\n    nTweak(nTweakIn),\n    nFlags(BLOOM_UPDATE_NONE)\n{\n}\n\ninline unsigned int CBloomFilter::Hash(unsigned int nHashNum, const std::vector<unsigned char>& vDataToHash) const\n{\n    // 0xFBA4C795 chosen as it guarantees a reasonable bit difference between nHashNum values.\n    return MurmurHash3(nHashNum * 0xFBA4C795 + nTweak, vDataToHash) % (vData.size() * 8);\n}\n\nvoid CBloomFilter::insert(const std::vector<unsigned char>& vKey)\n{\n    if (isFull)\n        return;\n    for (unsigned int i = 0; i < nHashFuncs; i++)\n    {\n        unsigned int nIndex = Hash(i, vKey);\n        // Sets bit nIndex of vData\n        vData[nIndex >> 3] |= (1 << (7 & nIndex));\n    }\n    isEmpty = false;\n}\n\nvoid CBloomFilter::insert(const COutPoint& outpoint)\n{\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << outpoint;\n    std::vector<unsigned char> data(stream.begin(), stream.end());\n    insert(data);\n}\n\nvoid CBloomFilter::insert(const uint256& hash)\n{\n    std::vector<unsigned char> data(hash.begin(), hash.end());\n    insert(data);\n}\n\nbool CBloomFilter::contains(const std::vector<unsigned char>& vKey) const\n{\n    if (isFull)\n        return true;\n    if (isEmpty)\n        return false;\n    for (unsigned int i = 0; i < nHashFuncs; i++)\n    {\n        unsigned int nIndex = Hash(i, vKey);\n        // Checks bit nIndex of vData\n        if (!(vData[nIndex >> 3] & (1 << (7 & nIndex))))\n            return false;\n    }\n    return true;\n}\n\nbool CBloomFilter::contains(const COutPoint& outpoint) const\n{\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << outpoint;\n    std::vector<unsigned char> data(stream.begin(), stream.end());\n    return contains(data);\n}\n\nbool CBloomFilter::contains(const uint256& hash) const\n{\n    std::vector<unsigned char> data(hash.begin(), hash.end());\n    return contains(data);\n}\n\nvoid CBloomFilter::clear()\n{\n    vData.assign(vData.size(),0);\n    isFull = false;\n    isEmpty = true;\n}\n\nvoid CBloomFilter::reset(const unsigned int nNewTweak)\n{\n    clear();\n    nTweak = nNewTweak;\n}\n\nbool CBloomFilter::IsWithinSizeConstraints() const\n{\n    return vData.size() <= MAX_BLOOM_FILTER_SIZE && nHashFuncs <= MAX_HASH_FUNCS;\n}\n\nbool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx)\n{\n    bool fFound = false;\n    // Match if the filter contains the hash of tx\n    //  for finding tx when they appear in a block\n    if (isFull)\n        return true;\n    if (isEmpty)\n        return false;\n    const uint256& hash = tx.GetHash();\n    if (contains(hash))\n        fFound = true;\n\n    for (unsigned int i = 0; i < tx.vout.size(); i++)\n    {\n        const CTxOut& txout = tx.vout[i];\n        // Match if the filter contains any arbitrary script data element in any scriptPubKey in tx\n        // If this matches, also add the specific output that was matched.\n        // This means clients don't have to update the filter themselves when a new relevant tx \n        // is discovered in order to find spending transactions, which avoids round-tripping and race conditions.\n        CScript::const_iterator pc = txout.scriptPubKey.begin();\n        std::vector<unsigned char> data;\n        while (pc < txout.scriptPubKey.end())\n        {\n            opcodetype opcode;\n            if (!txout.scriptPubKey.GetOp(pc, opcode, data))\n                break;\n            if (data.size() != 0 && contains(data))\n            {\n                fFound = true;\n                if ((nFlags & BLOOM_UPDATE_MASK) == BLOOM_UPDATE_ALL)\n                    insert(COutPoint(hash, i));\n                else if ((nFlags & BLOOM_UPDATE_MASK) == BLOOM_UPDATE_P2PUBKEY_ONLY)\n                {\n                    txnouttype type;\n                    std::vector<std::vector<unsigned char> > vSolutions;\n                    if (Solver(txout.scriptPubKey, type, vSolutions) &&\n                            (type == TX_PUBKEY || type == TX_MULTISIG))\n                        insert(COutPoint(hash, i));\n                }\n                break;\n            }\n        }\n    }\n\n    if (fFound)\n        return true;\n\n    for (const CTxIn& txin : tx.vin)\n    {\n        // Match if the filter contains an outpoint tx spends\n        if (contains(txin.prevout))\n            return true;\n\n        // Match if the filter contains any arbitrary script data element in any scriptSig in tx\n        CScript::const_iterator pc = txin.scriptSig.begin();\n        std::vector<unsigned char> data;\n        while (pc < txin.scriptSig.end())\n        {\n            opcodetype opcode;\n            if (!txin.scriptSig.GetOp(pc, opcode, data))\n                break;\n            if (data.size() != 0 && contains(data))\n                return true;\n        }\n    }\n\n    return false;\n}\n\nvoid CBloomFilter::UpdateEmptyFull()\n{\n    bool full = true;\n    bool empty = true;\n    for (unsigned int i = 0; i < vData.size(); i++)\n    {\n        full &= vData[i] == 0xff;\n        empty &= vData[i] == 0;\n    }\n    isFull = full;\n    isEmpty = empty;\n}\n\nCRollingBloomFilter::CRollingBloomFilter(const unsigned int nElements, const double fpRate)\n{\n    double logFpRate = log(fpRate);\n    /* The optimal number of hash functions is log(fpRate) / log(0.5), but\n     * restrict it to the range 1-50. */\n    nHashFuncs = std::max(1, std::min((int)round(logFpRate / log(0.5)), 50));\n    /* In this rolling bloom filter, we'll store between 2 and 3 generations of nElements / 2 entries. */\n    nEntriesPerGeneration = (nElements + 1) / 2;\n    uint32_t nMaxElements = nEntriesPerGeneration * 3;\n    /* The maximum fpRate = pow(1.0 - exp(-nHashFuncs * nMaxElements / nFilterBits), nHashFuncs)\n     * =>          pow(fpRate, 1.0 / nHashFuncs) = 1.0 - exp(-nHashFuncs * nMaxElements / nFilterBits)\n     * =>          1.0 - pow(fpRate, 1.0 / nHashFuncs) = exp(-nHashFuncs * nMaxElements / nFilterBits)\n     * =>          log(1.0 - pow(fpRate, 1.0 / nHashFuncs)) = -nHashFuncs * nMaxElements / nFilterBits\n     * =>          nFilterBits = -nHashFuncs * nMaxElements / log(1.0 - pow(fpRate, 1.0 / nHashFuncs))\n     * =>          nFilterBits = -nHashFuncs * nMaxElements / log(1.0 - exp(logFpRate / nHashFuncs))\n     */\n    uint32_t nFilterBits = (uint32_t)ceil(-1.0 * nHashFuncs * nMaxElements / log(1.0 - exp(logFpRate / nHashFuncs)));\n    data.clear();\n    /* For each data element we need to store 2 bits. If both bits are 0, the\n     * bit is treated as unset. If the bits are (01), (10), or (11), the bit is\n     * treated as set in generation 1, 2, or 3 respectively.\n     * These bits are stored in separate integers: position P corresponds to bit\n     * (P & 63) of the integers data[(P >> 6) * 2] and data[(P >> 6) * 2 + 1]. */\n    data.resize(((nFilterBits + 63) / 64) << 1);\n    reset();\n}\n\n/* Similar to CBloomFilter::Hash */\nstatic inline uint32_t RollingBloomHash(unsigned int nHashNum, uint32_t nTweak, const std::vector<unsigned char>& vDataToHash) {\n    return MurmurHash3(nHashNum * 0xFBA4C795 + nTweak, vDataToHash);\n}\n\nvoid CRollingBloomFilter::insert(const std::vector<unsigned char>& vKey)\n{\n    if (nEntriesThisGeneration == nEntriesPerGeneration) {\n        nEntriesThisGeneration = 0;\n        nGeneration++;\n        if (nGeneration == 4) {\n            nGeneration = 1;\n        }\n        uint64_t nGenerationMask1 = 0 - (uint64_t)(nGeneration & 1);\n        uint64_t nGenerationMask2 = 0 - (uint64_t)(nGeneration >> 1);\n        /* Wipe old entries that used this generation number. */\n        for (uint32_t p = 0; p < data.size(); p += 2) {\n            uint64_t p1 = data[p], p2 = data[p + 1];\n            uint64_t mask = (p1 ^ nGenerationMask1) | (p2 ^ nGenerationMask2);\n            data[p] = p1 & mask;\n            data[p + 1] = p2 & mask;\n        }\n    }\n    nEntriesThisGeneration++;\n\n    for (int n = 0; n < nHashFuncs; n++) {\n        uint32_t h = RollingBloomHash(n, nTweak, vKey);\n        int bit = h & 0x3F;\n        uint32_t pos = (h >> 6) % data.size();\n        /* The lowest bit of pos is ignored, and set to zero for the first bit, and to one for the second. */\n        data[pos & ~1] = (data[pos & ~1] & ~(((uint64_t)1) << bit)) | ((uint64_t)(nGeneration & 1)) << bit;\n        data[pos | 1] = (data[pos | 1] & ~(((uint64_t)1) << bit)) | ((uint64_t)(nGeneration >> 1)) << bit;\n    }\n}\n\nvoid CRollingBloomFilter::insert(const uint256& hash)\n{\n    std::vector<unsigned char> vData(hash.begin(), hash.end());\n    insert(vData);\n}\n\nbool CRollingBloomFilter::contains(const std::vector<unsigned char>& vKey) const\n{\n    for (int n = 0; n < nHashFuncs; n++) {\n        uint32_t h = RollingBloomHash(n, nTweak, vKey);\n        int bit = h & 0x3F;\n        uint32_t pos = (h >> 6) % data.size();\n        /* If the relevant bit is not set in either data[pos & ~1] or data[pos | 1], the filter does not contain vKey */\n        if (!(((data[pos & ~1] | data[pos | 1]) >> bit) & 1)) {\n            return false;\n        }\n    }\n    return true;\n}\n\nbool CRollingBloomFilter::contains(const uint256& hash) const\n{\n    std::vector<unsigned char> vData(hash.begin(), hash.end());\n    return contains(vData);\n}\n\nvoid CRollingBloomFilter::reset()\n{\n    nTweak = GetRand(std::numeric_limits<unsigned int>::max());\n    nEntriesThisGeneration = 0;\n    nGeneration = 1;\n    for (std::vector<uint64_t>::iterator it = data.begin(); it != data.end(); it++) {\n        *it = 0;\n    }\n}\n"
  },
  {
    "path": "src/bloom.h",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_BLOOM_H\n#define BITCOIN_BLOOM_H\n\n#include <serialize.h>\n\n#include <vector>\n\nclass COutPoint;\nclass CTransaction;\nclass uint256;\n\n//! 20,000 items with fp rate < 0.1% or 10,000 items and <0.0001%\nstatic const unsigned int MAX_BLOOM_FILTER_SIZE = 36000; // bytes\nstatic const unsigned int MAX_HASH_FUNCS = 50;\n\n/**\n * First two bits of nFlags control how much IsRelevantAndUpdate actually updates\n * The remaining bits are reserved\n */\nenum bloomflags\n{\n    BLOOM_UPDATE_NONE = 0,\n    BLOOM_UPDATE_ALL = 1,\n    // Only adds outpoints to the filter if the output is a pay-to-pubkey/pay-to-multisig script\n    BLOOM_UPDATE_P2PUBKEY_ONLY = 2,\n    BLOOM_UPDATE_MASK = 3,\n};\n\n/**\n * BloomFilter is a probabilistic filter which SPV clients provide\n * so that we can filter the transactions we send them.\n * \n * This allows for significantly more efficient transaction and block downloads.\n * \n * Because bloom filters are probabilistic, a SPV node can increase the false-\n * positive rate, making us send it transactions which aren't actually its,\n * allowing clients to trade more bandwidth for more privacy by obfuscating which\n * keys are controlled by them.\n */\nclass CBloomFilter\n{\nprivate:\n    std::vector<unsigned char> vData;\n    bool isFull;\n    bool isEmpty;\n    unsigned int nHashFuncs;\n    unsigned int nTweak;\n    unsigned char nFlags;\n\n    unsigned int Hash(unsigned int nHashNum, const std::vector<unsigned char>& vDataToHash) const;\n\n    // Private constructor for CRollingBloomFilter, no restrictions on size\n    CBloomFilter(const unsigned int nElements, const double nFPRate, const unsigned int nTweak);\n    friend class CRollingBloomFilter;\n\npublic:\n    /**\n     * Creates a new bloom filter which will provide the given fp rate when filled with the given number of elements\n     * Note that if the given parameters will result in a filter outside the bounds of the protocol limits,\n     * the filter created will be as close to the given parameters as possible within the protocol limits.\n     * This will apply if nFPRate is very low or nElements is unreasonably high.\n     * nTweak is a constant which is added to the seed value passed to the hash function\n     * It should generally always be a random value (and is largely only exposed for unit testing)\n     * nFlags should be one of the BLOOM_UPDATE_* enums (not _MASK)\n     */\n    CBloomFilter(const unsigned int nElements, const double nFPRate, const unsigned int nTweak, unsigned char nFlagsIn);\n    CBloomFilter() : isFull(true), isEmpty(false), nHashFuncs(0), nTweak(0), nFlags(0) {}\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(vData);\n        READWRITE(nHashFuncs);\n        READWRITE(nTweak);\n        READWRITE(nFlags);\n    }\n\n    void insert(const std::vector<unsigned char>& vKey);\n    void insert(const COutPoint& outpoint);\n    void insert(const uint256& hash);\n\n    bool contains(const std::vector<unsigned char>& vKey) const;\n    bool contains(const COutPoint& outpoint) const;\n    bool contains(const uint256& hash) const;\n\n    void clear();\n    void reset(const unsigned int nNewTweak);\n\n    //! True if the size is <= MAX_BLOOM_FILTER_SIZE and the number of hash functions is <= MAX_HASH_FUNCS\n    //! (catch a filter which was just deserialized which was too big)\n    bool IsWithinSizeConstraints() const;\n\n    //! Also adds any outputs which match the filter to the filter (to match their spending txes)\n    bool IsRelevantAndUpdate(const CTransaction& tx);\n\n    //! Checks for empty and full filters to avoid wasting cpu\n    void UpdateEmptyFull();\n};\n\n/**\n * RollingBloomFilter is a probabilistic \"keep track of most recently inserted\" set.\n * Construct it with the number of items to keep track of, and a false-positive\n * rate. Unlike CBloomFilter, by default nTweak is set to a cryptographically\n * secure random value for you. Similarly rather than clear() the method\n * reset() is provided, which also changes nTweak to decrease the impact of\n * false-positives.\n *\n * contains(item) will always return true if item was one of the last N to 1.5*N\n * insert()'ed ... but may also return true for items that were not inserted.\n *\n * It needs around 1.8 bytes per element per factor 0.1 of false positive rate.\n * (More accurately: 3/(log(256)*log(2)) * log(1/fpRate) * nElements bytes)\n */\nclass CRollingBloomFilter\n{\npublic:\n    // A random bloom filter calls GetRand() at creation time.\n    // Don't create global CRollingBloomFilter objects, as they may be\n    // constructed before the randomizer is properly initialized.\n    CRollingBloomFilter(const unsigned int nElements, const double nFPRate);\n\n    void insert(const std::vector<unsigned char>& vKey);\n    void insert(const uint256& hash);\n    bool contains(const std::vector<unsigned char>& vKey) const;\n    bool contains(const uint256& hash) const;\n\n    void reset();\n\nprivate:\n    int nEntriesPerGeneration;\n    int nEntriesThisGeneration;\n    int nGeneration;\n    std::vector<uint64_t> data;\n    unsigned int nTweak;\n    int nHashFuncs;\n};\n\n#endif // BITCOIN_BLOOM_H\n"
  },
  {
    "path": "src/chain.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <chain.h>\n\n/**\n * CChain implementation\n */\nvoid CChain::SetTip(CBlockIndex *pindex) {\n    if (pindex == nullptr) {\n        vChain.clear();\n        return;\n    }\n    vChain.resize(pindex->nHeight + 1);\n    while (pindex && vChain[pindex->nHeight] != pindex) {\n        vChain[pindex->nHeight] = pindex;\n        pindex = pindex->pprev;\n    }\n}\n\nCBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const {\n    int nStep = 1;\n    std::vector<uint256> vHave;\n    vHave.reserve(32);\n\n    if (!pindex)\n        pindex = Tip();\n    while (pindex) {\n        vHave.push_back(pindex->GetBlockHash());\n        // Stop when we have added the genesis block.\n        if (pindex->nHeight == 0)\n            break;\n        // Exponentially larger steps back, plus the genesis block.\n        int nHeight = std::max(pindex->nHeight - nStep, 0);\n        if (Contains(pindex)) {\n            // Use O(1) CChain index if possible.\n            pindex = (*this)[nHeight];\n        } else {\n            // Otherwise, use O(log n) skiplist.\n            pindex = pindex->GetAncestor(nHeight);\n        }\n        if (vHave.size() > 10)\n            nStep *= 2;\n    }\n\n    return CBlockLocator(vHave);\n}\n\nconst CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const {\n    if (pindex == nullptr) {\n        return nullptr;\n    }\n    if (pindex->nHeight > Height())\n        pindex = pindex->GetAncestor(Height());\n    while (pindex && !Contains(pindex))\n        pindex = pindex->pprev;\n    return pindex;\n}\n\nCBlockIndex* CChain::FindEarliestAtLeast(int64_t nTime) const\n{\n    std::vector<CBlockIndex*>::const_iterator lower = std::lower_bound(vChain.begin(), vChain.end(), nTime,\n        [](CBlockIndex* pBlock, const int64_t& time) -> bool { return pBlock->GetBlockTimeMax() < time; });\n    return (lower == vChain.end() ? nullptr : *lower);\n}\n\n/** Turn the lowest '1' bit in the binary representation of a number into a '0'. */\nint static inline InvertLowestOne(int n) { return n & (n - 1); }\n\n/** Compute what height to jump back to with the CBlockIndex::pskip pointer. */\nint static inline GetSkipHeight(int height) {\n    if (height < 2)\n        return 0;\n\n    // Determine which height to jump back to. Any number strictly lower than height is acceptable,\n    // but the following expression seems to perform well in simulations (max 110 steps to go back\n    // up to 2**18 blocks).\n    return (height & 1) ? InvertLowestOne(InvertLowestOne(height - 1)) + 1 : InvertLowestOne(height);\n}\n\nconst CBlockIndex* CBlockIndex::GetAncestor(int height) const\n{\n    if (height > nHeight || height < 0) {\n        return nullptr;\n    }\n\n    const CBlockIndex* pindexWalk = this;\n    int heightWalk = nHeight;\n    while (heightWalk > height) {\n        int heightSkip = GetSkipHeight(heightWalk);\n        int heightSkipPrev = GetSkipHeight(heightWalk - 1);\n        if (pindexWalk->pskip != nullptr &&\n            (heightSkip == height ||\n             (heightSkip > height && !(heightSkipPrev < heightSkip - 2 &&\n                                       heightSkipPrev >= height)))) {\n            // Only follow pskip if pprev->pskip isn't better than pskip->pprev.\n            pindexWalk = pindexWalk->pskip;\n            heightWalk = heightSkip;\n        } else {\n            assert(pindexWalk->pprev);\n            pindexWalk = pindexWalk->pprev;\n            heightWalk--;\n        }\n    }\n    return pindexWalk;\n}\n\nCBlockIndex* CBlockIndex::GetAncestor(int height)\n{\n    return const_cast<CBlockIndex*>(static_cast<const CBlockIndex*>(this)->GetAncestor(height));\n}\n\nvoid CBlockIndex::BuildSkip()\n{\n    if (pprev)\n        pskip = pprev->GetAncestor(GetSkipHeight(nHeight));\n}\n\narith_uint256 GetBlockProof(const CBlockIndex& block)\n{\n    arith_uint256 bnTarget;\n    bool fNegative;\n    bool fOverflow;\n    bnTarget.SetCompact(block.nBits, &fNegative, &fOverflow);\n    if (fNegative || fOverflow || bnTarget == 0)\n        return 0;\n    // We need to compute 2**256 / (bnTarget+1), but we can't represent 2**256\n    // as it's too large for an arith_uint256. However, as 2**256 is at least as large\n    // as bnTarget+1, it is equal to ((2**256 - bnTarget - 1) / (bnTarget+1)) + 1,\n    // or ~bnTarget / (bnTarget+1) + 1.\n    return (~bnTarget / (bnTarget + 1)) + 1;\n}\n\nint64_t GetBlockProofEquivalentTime(const CBlockIndex& to, const CBlockIndex& from, const CBlockIndex& tip, const Consensus::Params& params)\n{\n    arith_uint256 r;\n    int sign = 1;\n    if (to.nChainWork > from.nChainWork) {\n        r = to.nChainWork - from.nChainWork;\n    } else {\n        r = from.nChainWork - to.nChainWork;\n        sign = -1;\n    }\n    r = r * arith_uint256(params.nPowTargetSpacing) / GetBlockProof(tip);\n    if (r.bits() > 63) {\n        return sign * std::numeric_limits<int64_t>::max();\n    }\n    return sign * r.GetLow64();\n}\n\n/** Find the last common ancestor two blocks have.\n *  Both pa and pb must be non-nullptr. */\nconst CBlockIndex* LastCommonAncestor(const CBlockIndex* pa, const CBlockIndex* pb) {\n    if (pa->nHeight > pb->nHeight) {\n        pa = pa->GetAncestor(pb->nHeight);\n    } else if (pb->nHeight > pa->nHeight) {\n        pb = pb->GetAncestor(pa->nHeight);\n    }\n\n    while (pa != pb && pa && pb) {\n        pa = pa->pprev;\n        pb = pb->pprev;\n    }\n\n    // Eventually all chain branches meet at the genesis block.\n    assert(pa == pb);\n    return pa;\n}\n"
  },
  {
    "path": "src/chain.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CHAIN_H\n#define BITCOIN_CHAIN_H\n\n#include <arith_uint256.h>\n#include <primitives/block.h>\n#include <pow.h>\n#include <tinyformat.h>\n#include <uint256.h>\n\n#include <vector>\n\n/**\n * Maximum amount of time that a block timestamp is allowed to exceed the\n * current network-adjusted time before the block will be accepted.\n */\n\n/*\nFTL must be changed to 300 or N*T/20 whichever is higher. FTL in BTC clones is MAX_FUTURE_BLOCK_TIME in chain.h.\n\nOption1: N*T/21.25 = 510*5/21.25 = 120 (or)\nOption2: N*T/42.5 = 510*5/42.5 = 60\n\n120x faster than bitcoin\n7200 / 120 = 60(sec)\n60(sec) = 12(blocks)\nBitcoin: 7200s == 12 blocks (blocktime: 600s)\nSugarchain: 60s == 12 blocks (blocktime: 5s)\n*/\n\nstatic const int64_t MAX_FUTURE_BLOCK_TIME = 2 * 60 * 60 / 120; // 7200/120=60(sec) // 12(blocks) // FIXME.SUGAR // SURE?\n\n/**\n * Timestamp window used as a grace period by code that compares external\n * timestamps (such as timestamps passed to RPCs, or wallet key creation times)\n * to block timestamps. This should be set at least as high as\n * MAX_FUTURE_BLOCK_TIME.\n */\nstatic const int64_t TIMESTAMP_WINDOW = MAX_FUTURE_BLOCK_TIME;\n\nclass CBlockFileInfo\n{\npublic:\n    unsigned int nBlocks;      //!< number of blocks stored in file\n    unsigned int nSize;        //!< number of used bytes of block file\n    unsigned int nUndoSize;    //!< number of used bytes in the undo file\n    unsigned int nHeightFirst; //!< lowest height of block in file\n    unsigned int nHeightLast;  //!< highest height of block in file\n    uint64_t nTimeFirst;       //!< earliest time of block in file\n    uint64_t nTimeLast;        //!< latest time of block in file\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(VARINT(nBlocks));\n        READWRITE(VARINT(nSize));\n        READWRITE(VARINT(nUndoSize));\n        READWRITE(VARINT(nHeightFirst));\n        READWRITE(VARINT(nHeightLast));\n        READWRITE(VARINT(nTimeFirst));\n        READWRITE(VARINT(nTimeLast));\n    }\n\n     void SetNull() {\n         nBlocks = 0;\n         nSize = 0;\n         nUndoSize = 0;\n         nHeightFirst = 0;\n         nHeightLast = 0;\n         nTimeFirst = 0;\n         nTimeLast = 0;\n     }\n\n     CBlockFileInfo() {\n         SetNull();\n     }\n\n     std::string ToString() const;\n\n     /** update statistics (does not update nSize) */\n     void AddBlock(unsigned int nHeightIn, uint64_t nTimeIn) {\n         if (nBlocks==0 || nHeightFirst > nHeightIn)\n             nHeightFirst = nHeightIn;\n         if (nBlocks==0 || nTimeFirst > nTimeIn)\n             nTimeFirst = nTimeIn;\n         nBlocks++;\n         if (nHeightIn > nHeightLast)\n             nHeightLast = nHeightIn;\n         if (nTimeIn > nTimeLast)\n             nTimeLast = nTimeIn;\n     }\n};\n\nstruct CDiskBlockPos\n{\n    int nFile;\n    unsigned int nPos;\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(VARINT(nFile));\n        READWRITE(VARINT(nPos));\n    }\n\n    CDiskBlockPos() {\n        SetNull();\n    }\n\n    CDiskBlockPos(int nFileIn, unsigned int nPosIn) {\n        nFile = nFileIn;\n        nPos = nPosIn;\n    }\n\n    friend bool operator==(const CDiskBlockPos &a, const CDiskBlockPos &b) {\n        return (a.nFile == b.nFile && a.nPos == b.nPos);\n    }\n\n    friend bool operator!=(const CDiskBlockPos &a, const CDiskBlockPos &b) {\n        return !(a == b);\n    }\n\n    void SetNull() { nFile = -1; nPos = 0; }\n    bool IsNull() const { return (nFile == -1); }\n\n    std::string ToString() const\n    {\n        return strprintf(\"CBlockDiskPos(nFile=%i, nPos=%i)\", nFile, nPos);\n    }\n\n};\n\nenum BlockStatus: uint32_t {\n    //! Unused.\n    BLOCK_VALID_UNKNOWN      =    0,\n\n    //! Parsed, version ok, hash satisfies claimed PoW, 1 <= vtx count <= max, timestamp not in future\n    BLOCK_VALID_HEADER       =    1,\n\n    //! All parent headers found, difficulty matches, timestamp >= median previous, checkpoint. Implies all parents\n    //! are also at least TREE.\n    BLOCK_VALID_TREE         =    2,\n\n    /**\n     * Only first tx is coinbase, 2 <= coinbase input script length <= 100, transactions valid, no duplicate txids,\n     * sigops, size, merkle root. Implies all parents are at least TREE but not necessarily TRANSACTIONS. When all\n     * parent blocks also have TRANSACTIONS, CBlockIndex::nChainTx will be set.\n     */\n    BLOCK_VALID_TRANSACTIONS =    3,\n\n    //! Outputs do not overspend inputs, no double spends, coinbase output ok, no immature coinbase spends, BIP30.\n    //! Implies all parents are also at least CHAIN.\n    BLOCK_VALID_CHAIN        =    4,\n\n    //! Scripts & signatures ok. Implies all parents are also at least SCRIPTS.\n    BLOCK_VALID_SCRIPTS      =    5,\n\n    //! All validity bits.\n    BLOCK_VALID_MASK         =   BLOCK_VALID_HEADER | BLOCK_VALID_TREE | BLOCK_VALID_TRANSACTIONS |\n                                 BLOCK_VALID_CHAIN | BLOCK_VALID_SCRIPTS,\n\n    BLOCK_HAVE_DATA          =    8, //!< full block available in blk*.dat\n    BLOCK_HAVE_UNDO          =   16, //!< undo data available in rev*.dat\n    BLOCK_HAVE_MASK          =   BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO,\n\n    BLOCK_FAILED_VALID       =   32, //!< stage after last reached validness failed\n    BLOCK_FAILED_CHILD       =   64, //!< descends from failed block\n    BLOCK_FAILED_MASK        =   BLOCK_FAILED_VALID | BLOCK_FAILED_CHILD,\n\n    BLOCK_OPT_WITNESS       =   128, //!< block data in blk*.data was received with a witness-enforcing client\n};\n\n/** The block chain is a tree shaped structure starting with the\n * genesis block at the root, with each block potentially having multiple\n * candidates to be the next block. A blockindex may have multiple pprev pointing\n * to it, but at most one of them can be part of the currently active branch.\n */\nclass CBlockIndex\n{\npublic:\n    //! pointer to the hash of the block, if any. Memory is owned by this CBlockIndex\n    const uint256* phashBlock;\n\n    //! pointer to the index of the predecessor of this block\n    CBlockIndex* pprev;\n\n    //! pointer to the index of some further predecessor of this block\n    CBlockIndex* pskip;\n\n    //! height of the entry in the chain. The genesis block has height 0\n    int nHeight;\n\n    //! Which # file this block is stored in (blk?????.dat)\n    int nFile;\n\n    //! Byte offset within blk?????.dat where this block's data is stored\n    unsigned int nDataPos;\n\n    //! Byte offset within rev?????.dat where this block's undo data is stored\n    unsigned int nUndoPos;\n\n    //! (memory only) Total amount of work (expected number of hashes) in the chain up to and including this block\n    arith_uint256 nChainWork;\n\n    //! Number of transactions in this block.\n    //! Note: in a potential headers-first mode, this number cannot be relied upon\n    unsigned int nTx;\n\n    //! (memory only) Number of transactions in the chain up to and including this block.\n    //! This value will be non-zero only if and only if transactions for this block and all its parents are available.\n    //! Change to 64-bit type when necessary; won't happen before 2030\n    unsigned int nChainTx;\n\n    //! Verification status of this block. See enum BlockStatus\n    uint32_t nStatus;\n\n    //! block header\n    int32_t nVersion;\n    uint256 hashMerkleRoot;\n    uint32_t nTime;\n    uint32_t nBits;\n    uint32_t nNonce;\n\n    //! (currently memory only, but don't have to be)\n    bool cache_init;\n    uint256 cache_block_hash, cache_PoW_hash;\n\n    //! (memory only) Sequential id assigned to distinguish order in which blocks are received.\n    int32_t nSequenceId;\n\n    //! (memory only) Maximum nTime in the chain up to and including this block.\n    unsigned int nTimeMax;\n\n    void SetNull()\n    {\n        phashBlock = nullptr;\n        pprev = nullptr;\n        pskip = nullptr;\n        nHeight = 0;\n        nFile = 0;\n        nDataPos = 0;\n        nUndoPos = 0;\n        nChainWork = arith_uint256();\n        nTx = 0;\n        nChainTx = 0;\n        nStatus = 0;\n        nSequenceId = 0;\n        nTimeMax = 0;\n\n        nVersion       = 0;\n        hashMerkleRoot = uint256();\n        nTime          = 0;\n        nBits          = 0;\n        nNonce         = 0;\n\n        cache_init     = false;\n    }\n\n    CBlockIndex()\n    {\n        SetNull();\n    }\n\n    explicit CBlockIndex(const CBlockHeader& block)\n    {\n        SetNull();\n\n        nVersion       = block.nVersion;\n        hashMerkleRoot = block.hashMerkleRoot;\n        nTime          = block.nTime;\n        nBits          = block.nBits;\n        nNonce         = block.nNonce;\n\n        cache_init     = block.cache_init;\n        cache_block_hash = block.cache_block_hash;\n        cache_PoW_hash = block.cache_PoW_hash;\n    }\n\n    CDiskBlockPos GetBlockPos() const {\n        CDiskBlockPos ret;\n        if (nStatus & BLOCK_HAVE_DATA) {\n            ret.nFile = nFile;\n            ret.nPos  = nDataPos;\n        }\n        return ret;\n    }\n\n    CDiskBlockPos GetUndoPos() const {\n        CDiskBlockPos ret;\n        if (nStatus & BLOCK_HAVE_UNDO) {\n            ret.nFile = nFile;\n            ret.nPos  = nUndoPos;\n        }\n        return ret;\n    }\n\n    CBlockHeader GetBlockHeader() const\n    {\n        CBlockHeader block;\n        block.nVersion       = nVersion;\n        if (pprev)\n            block.hashPrevBlock = pprev->GetBlockHash();\n        block.hashMerkleRoot = hashMerkleRoot;\n        block.nTime          = nTime;\n        block.nBits          = nBits;\n        block.nNonce         = nNonce;\n\n        block.cache_init     = cache_init;\n        block.cache_block_hash = cache_block_hash;\n        block.cache_PoW_hash = cache_PoW_hash;\n\n        return block;\n    }\n\n    uint256 GetBlockHash() const\n    {\n        return *phashBlock;\n    }\n\n    uint256 GetBlockPoWHash() const\n    {\n        return GetBlockHeader().GetPoWHash();\n    }\n\n    int64_t GetBlockTime() const\n    {\n        return (int64_t)nTime;\n    }\n\n    int64_t GetBlockTimeMax() const\n    {\n        return (int64_t)nTimeMax;\n    }\n\n    static constexpr int nMedianTimeSpan = 11;\n\n    int64_t GetMedianTimePast() const\n    {\n        int64_t pmedian[nMedianTimeSpan];\n        int64_t* pbegin = &pmedian[nMedianTimeSpan];\n        int64_t* pend = &pmedian[nMedianTimeSpan];\n\n        const CBlockIndex* pindex = this;\n        for (int i = 0; i < nMedianTimeSpan && pindex; i++, pindex = pindex->pprev)\n            *(--pbegin) = pindex->GetBlockTime();\n\n        std::sort(pbegin, pend);\n        return pbegin[(pend - pbegin)/2];\n    }\n\n    std::string ToString() const\n    {\n        return strprintf(\"CBlockIndex(pprev=%p, nHeight=%d, merkle=%s, hashBlock=%s)\",\n            pprev, nHeight,\n            hashMerkleRoot.ToString(),\n            GetBlockHash().ToString());\n    }\n\n    //! Check whether this block index entry is valid up to the passed validity level.\n    bool IsValid(enum BlockStatus nUpTo = BLOCK_VALID_TRANSACTIONS) const\n    {\n        assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed.\n        if (nStatus & BLOCK_FAILED_MASK)\n            return false;\n        return ((nStatus & BLOCK_VALID_MASK) >= nUpTo);\n    }\n\n    //! Raise the validity level of this block index entry.\n    //! Returns true if the validity was changed.\n    bool RaiseValidity(enum BlockStatus nUpTo)\n    {\n        assert(!(nUpTo & ~BLOCK_VALID_MASK)); // Only validity flags allowed.\n        if (nStatus & BLOCK_FAILED_MASK)\n            return false;\n        if ((nStatus & BLOCK_VALID_MASK) < nUpTo) {\n            nStatus = (nStatus & ~BLOCK_VALID_MASK) | nUpTo;\n            return true;\n        }\n        return false;\n    }\n\n    //! Build the skiplist pointer for this entry.\n    void BuildSkip();\n\n    //! Efficiently find an ancestor of this block.\n    CBlockIndex* GetAncestor(int height);\n    const CBlockIndex* GetAncestor(int height) const;\n};\n\narith_uint256 GetBlockProof(const CBlockIndex& block);\n/** Return the time it would take to redo the work difference between from and to, assuming the current hashrate corresponds to the difficulty at tip, in seconds. */\nint64_t GetBlockProofEquivalentTime(const CBlockIndex& to, const CBlockIndex& from, const CBlockIndex& tip, const Consensus::Params&);\n/** Find the forking point between two chain tips. */\nconst CBlockIndex* LastCommonAncestor(const CBlockIndex* pa, const CBlockIndex* pb);\n\n\n/** Used to marshal pointers into hashes for db storage. */\nclass CDiskBlockIndex : public CBlockIndex\n{\npublic:\n    uint256 hashPrev;\n\n    CDiskBlockIndex() {\n        hashPrev = uint256();\n    }\n\n    explicit CDiskBlockIndex(const CBlockIndex* pindex) : CBlockIndex(*pindex) {\n        hashPrev = (pprev ? pprev->GetBlockHash() : uint256());\n    }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        int _nVersion = s.GetVersion();\n        if (!(s.GetType() & SER_GETHASH))\n            READWRITE(VARINT(_nVersion));\n\n        READWRITE(VARINT(nHeight));\n        READWRITE(VARINT(nStatus));\n        READWRITE(VARINT(nTx));\n        if (nStatus & (BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO))\n            READWRITE(VARINT(nFile));\n        if (nStatus & BLOCK_HAVE_DATA)\n            READWRITE(VARINT(nDataPos));\n        if (nStatus & BLOCK_HAVE_UNDO)\n            READWRITE(VARINT(nUndoPos));\n\n        // block header\n        READWRITE(this->nVersion);\n        READWRITE(hashPrev);\n        READWRITE(hashMerkleRoot);\n        READWRITE(nTime);\n        READWRITE(nBits);\n        READWRITE(nNonce);\n    }\n\n    uint256 GetBlockHash() const\n    {\n        CBlockHeader block;\n        block.nVersion        = nVersion;\n        block.hashPrevBlock   = hashPrev;\n        block.hashMerkleRoot  = hashMerkleRoot;\n        block.nTime           = nTime;\n        block.nBits           = nBits;\n        block.nNonce          = nNonce;\n        return block.GetHash();\n    }\n\n\n    std::string ToString() const\n    {\n        std::string str = \"CDiskBlockIndex(\";\n        str += CBlockIndex::ToString();\n        str += strprintf(\"\\n                hashBlock=%s, hashPrev=%s)\",\n            GetBlockHash().ToString(),\n            hashPrev.ToString());\n        return str;\n    }\n};\n\n/** An in-memory indexed chain of blocks. */\nclass CChain {\nprivate:\n    std::vector<CBlockIndex*> vChain;\n\npublic:\n    /** Returns the index entry for the genesis block of this chain, or nullptr if none. */\n    CBlockIndex *Genesis() const {\n        return vChain.size() > 0 ? vChain[0] : nullptr;\n    }\n\n    /** Returns the index entry for the tip of this chain, or nullptr if none. */\n    CBlockIndex *Tip() const {\n        return vChain.size() > 0 ? vChain[vChain.size() - 1] : nullptr;\n    }\n\n    /** Returns the index entry at a particular height in this chain, or nullptr if no such height exists. */\n    CBlockIndex *operator[](int nHeight) const {\n        if (nHeight < 0 || nHeight >= (int)vChain.size())\n            return nullptr;\n        return vChain[nHeight];\n    }\n\n    /** Compare two chains efficiently. */\n    friend bool operator==(const CChain &a, const CChain &b) {\n        return a.vChain.size() == b.vChain.size() &&\n               a.vChain[a.vChain.size() - 1] == b.vChain[b.vChain.size() - 1];\n    }\n\n    /** Efficiently check whether a block is present in this chain. */\n    bool Contains(const CBlockIndex *pindex) const {\n        return (*this)[pindex->nHeight] == pindex;\n    }\n\n    /** Find the successor of a block in this chain, or nullptr if the given index is not found or is the tip. */\n    CBlockIndex *Next(const CBlockIndex *pindex) const {\n        if (Contains(pindex))\n            return (*this)[pindex->nHeight + 1];\n        else\n            return nullptr;\n    }\n\n    /** Return the maximal height in the chain. Is equal to chain.Tip() ? chain.Tip()->nHeight : -1. */\n    int Height() const {\n        return vChain.size() - 1;\n    }\n\n    /** Set/initialize a chain with a given tip. */\n    void SetTip(CBlockIndex *pindex);\n\n    /** Return a CBlockLocator that refers to a block in this chain (by default the tip). */\n    CBlockLocator GetLocator(const CBlockIndex *pindex = nullptr) const;\n\n    /** Find the last common block between this chain and a block index entry. */\n    const CBlockIndex *FindFork(const CBlockIndex *pindex) const;\n\n    /** Find the earliest block with timestamp equal or greater than the given. */\n    CBlockIndex* FindEarliestAtLeast(int64_t nTime) const;\n};\n\n#endif // BITCOIN_CHAIN_H\n"
  },
  {
    "path": "src/chainparams.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <chainparams.h>\n#include <consensus/merkle.h>\n\n#include <tinyformat.h>\n#include <util.h>\n#include <utilstrencodings.h>\n\n#include <assert.h>\n#include <memory>\n\n#include <chainparamsseeds.h>\n\n#include <arith_uint256.h> // DigiShieldZEC\n\nstatic CBlock CreateGenesisBlock(const char* pszTimestamp, const CScript& genesisOutputScript, uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)\n{\n    CMutableTransaction txNew;\n    txNew.nVersion = 1;\n    txNew.vin.resize(1);\n    txNew.vout.resize(1);\n    txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));\n    txNew.vout[0].nValue = genesisReward;\n    txNew.vout[0].scriptPubKey = genesisOutputScript;\n\n    CBlock genesis;\n    genesis.nTime    = nTime;\n    genesis.nBits    = nBits;\n    genesis.nNonce   = nNonce;\n    genesis.nVersion = nVersion;\n    genesis.vtx.push_back(MakeTransactionRef(std::move(txNew)));\n    genesis.hashPrevBlock.SetNull();\n    genesis.hashMerkleRoot = BlockMerkleRoot(genesis);\n\n    // BEGIN - DEBUG - SUGAR\n\n    // MAINNET\n    // if (genesis.nTime == 1565881200) {\n    //   printf(\"\\n*** BEGIN - DEBUG: MAINNET\\n\");\n    //   printf(\"nTime = %u\\n\", nTime);\n    //   printf(\"nNonce = %u\\n\", nNonce);\n    //   printf(\"nBits = 0x%x\\n\", nBits);\n    //   printf(\"nVersion = %d\\n\", nVersion);\n    //   printf(\"genesisReward = %ld\\n\", genesisReward);\n    //   printf(\"COIN = %ld\\n\", COIN);\n    //   printf(\"*** END - DEBUG\\n\");\n    // }\n\n    // TESTNET\n    // if (genesis.nTime == 1565913601) {\n    //   printf(\"\\n*** BEGIN - DEBUG: TESTNET\\n\");\n    //   printf(\"nTime = %u\\n\", nTime);\n    //   printf(\"nNonce = %u\\n\", nNonce);\n    //   printf(\"nBits = 0x%x\\n\", nBits);\n    //   printf(\"nVersion = %d\\n\", nVersion);\n    //   printf(\"genesisReward = %ld\\n\", genesisReward);\n    //   printf(\"COIN = %ld\\n\", COIN);\n    //   printf(\"*** END - DEBUG\\n\");\n    // }\n\n    // REGTEST\n    // if (genesis.nTime == 1565913602) {\n    //   printf(\"\\n*** BEGIN - DEBUG: REGTEST\\n\");\n    //   printf(\"nTime = %u\\n\", nTime);\n    //   printf(\"nNonce = %u\\n\", nNonce);\n    //   printf(\"nBits = 0x%x\\n\", nBits);\n    //   printf(\"nVersion = %d\\n\", nVersion);\n    //   printf(\"genesisReward = %ld\\n\", genesisReward);\n    //   printf(\"COIN = %ld\\n\", COIN);\n    //   printf(\"*** END - DEBUG\\n\");\n    // }\n\n    // END - DEBUG\n\n    return genesis;\n}\n\n/**\n * Build the genesis block. Note that the output of its generation\n * transaction cannot be spent since it did not originally exist in the\n * database.\n *\n * CBlock(hash=000000000019d6, ver=1, hashPrevBlock=00000000000000, hashMerkleRoot=4a5e1e, nTime=1231006505, nBits=1d00ffff, nNonce=2083236893, vtx=1)\n *   CTransaction(hash=4a5e1e, ver=1, vin.size=1, vout.size=1, nLockTime=0)\n *     CTxIn(COutPoint(000000, -1), coinbase 04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73)\n *     CTxOut(nValue=50.00000000, scriptPubKey=0x5F1DF16B2B704C8A578D0B)\n *   vMerkleTree: 4a5e1e\n */\nstatic CBlock CreateGenesisBlock(uint32_t nTime, uint32_t nNonce, uint32_t nBits, int32_t nVersion, const CAmount& genesisReward)\n{\n    const char* pszTimestamp = \"The Times 17/July/2019 Bitcoin falls after senators call Facebook delusional over libra\";\n    const CScript genesisOutputScript = CScript() << ParseHex(\"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f\") << OP_CHECKSIG;\n    return CreateGenesisBlock(pszTimestamp, genesisOutputScript, nTime, nNonce, nBits, nVersion, genesisReward);\n}\n\nvoid CChainParams::UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)\n{\n    consensus.vDeployments[d].nStartTime = nStartTime;\n    consensus.vDeployments[d].nTimeout = nTimeout;\n}\n\n// DigiShieldZEC\nconst arith_uint256 maxUint = UintToArith256(uint256S(\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\"));\n\n/**\n * Main network\n */\n/**\n * What makes a good checkpoint block?\n * + Is surrounded by blocks with reasonable timestamps\n *   (no blocks before with a timestamp after, none after with\n *    timestamp before)\n * + Contains no strange transactions\n */\n\nclass CMainParams : public CChainParams {\npublic:\n    CMainParams() {\n        strNetworkID = \"main\";\n\n        // SUGAR-HALVING\n        // BTC: (was 21000000)\n        // around 2 years = pow(5,8)*32 = 390625*32 = 12500000\n        // pow(5,8) * pow(2,32) / COIN = 390625 * 4294967296 / 100000000 = INTEGER (16777216.0)\n        // pow(5,8) = 390625 is an integer cycle of pow(2,32) = 4294967296\n        // 1st halving = 536870912*COIN = 12500000 * 42.94967296\n        // Total Supply in COINs (in theory):\t1073741824\n        // Total Supply in COINs (in actual):\t1073741823.87500000\n        // Difference: 0.125\n        consensus.nSubsidyHalvingInterval = 12500000;\n\n        consensus.BIP16Height = 0;  // always on\n        consensus.BIP34Height = 17;\n        consensus.BIP34Hash = uint256S(\"72e36f3fcdf98d3625dfe03f28a914c513b913231e479d53fc22e5e46cf5b585\"); // getblockhash 17\n        consensus.BIP65Height = 0;  // always on\n        consensus.BIP66Height = 0;  // always on\n\n        // GET powLimit by python // FIXME.SUGAR // SURE?\n        /*\n        >>> \"%d\" % 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n        '115792089237316195423570985008687907853269984665640564039457584007913129639935'\n        >>> 115792089237316195423570985008687907853269984665640564039457584007913129639935 / 1024\n        113078212145816597093331040047546785012958969400039613319782796882727665663L\n        >>> \"%x\" % 113078212145816597093331040047546785012958969400039613319782796882727665663L\n        '3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'\n        >>>\n        */\n\n        // getdifficulty() == 2.384149979653205e-07\n        // 0x1f3fffff == 0x003fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.GetCompact()\n        consensus.powLimit = uint256S(\"003fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n\n        // DEBUG - SUGAR\n        // printf(\"\\n*** BEGIN - DEBUG: MAIN\\n\");\n        // uint32_t powLimitTOnBits = UintToArith256(consensus.powLimit).GetCompact();\n        // printf(\"powLimitTOnBits = 0x%x\\n\", powLimitTOnBits);\n        // printf(\"*** END - DEBUG\\n\");\n\n        // SUGAR-HALVING\n        // 17 hours = 17*60*60 = 61200 (was two weeks: 14×24×60×60 = 1209600)\n        // available: 17*n hours or 17 days possible, because DigiShieldZEC uses n510 (17*n)\n        consensus.nPowTargetTimespan = 61200;\n\n        consensus.nPowAllowMinDifficultyBlocksAfterHeight = boost::none; // DigiShieldZEC\n        consensus.nPowAveragingWindow = 510; // DigiShieldZEC // 2550/nPowTargetSpacing(5) = 510\n\n        // DEBUG - SUGAR\n        // printf(\"\\n*** BEGIN - DEBUG: MAIN\\n\");\n        // printf(\"nPowAveragingWindowRatio = %s\\n\", (maxUint/UintToArith256(consensus.powLimit)).ToString().c_str());\n        // printf(\"nPowAveragingWindow = %ld\\n\", consensus.nPowAveragingWindow);\n        // printf(\"*** END - DEBUG\\n\");\n\n        assert(maxUint/UintToArith256(consensus.powLimit) == 1024); // DigiShieldZEC // 0x0000000000000000000000000000000000000000000000000000000000000400 == 1024\n        assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow); // DigiShieldZEC // true: 1024 >= 510\n\n        consensus.nPowMaxAdjustDown = 32; // DigiShieldZEC // 32% adjustment down\n        consensus.nPowMaxAdjustUp = 16; // DigiShieldZEC // 16% adjustment up\n\n        // SUGAR-HALVING\n        // 10*60/120 = 5 seconds block time\n        // 120x faster than bitcoin\n        consensus.nPowTargetSpacing = 5;\n\n        consensus.fPowAllowMinDifficultyBlocks = false; // DigiShieldZEC\n        consensus.fPowNoRetargeting = false; // DigiShieldZEC\n\n        // SUGAR-HALVING\n        // 75% of nMinerConfirmationWindow = 61200/5*0.75 = 9180 (was 1916 = 1209600/600*0.95+0.8)\n        // 9180/510 = 18 cycles of DigiShieldZEC\n        consensus.nRuleChangeActivationThreshold = 9180;\n\n        // SUGAR-HALVING\n        // nPowTargetTimespan/nPowTargetSpacing = 61200/5 = 12240 (was 2016 = 1209600/600)\n        // 12240/510 = 24 cycles of DigiShieldZEC\n        consensus.nMinerConfirmationWindow = 12240;\n\n        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;\n        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008\n        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008\n\n        // Deployment of BIP68, BIP112, and BIP113 are always on\n        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;\n        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;\n        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;\n\n        // Deployment of SegWit (BIP141, BIP143, and BIP147) is always on\n        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;\n        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;\n        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;\n\n        // The best chain should have at least this much work.\n        // TODO.SUGAR.UPDATE\n        // getblockhash 6513497 && \"chainwork\"\n        consensus.nMinimumChainWork = uint256S(\"00000000000000000000000000000000000000000000000000003f23ef34da28\");\n\n        // By default assume that the signatures in ancestors of this block are valid.\n        // TODO.SUGAR.UPDATE\n        // getblockhash 6513497 && \"hash\"\n        consensus.defaultAssumeValid = uint256S(\"855f0c66238bc0246c8ca25cf958283fd49b9fb4b217ddeb518e5ea9f5071b9e\");\n\n        /**\n         * The message start string is designed to be unlikely to occur in normal data.\n         * The characters are rarely used upper ASCII, not valid as UTF-8, and produce\n         * a large 32-bit integer with any alignment.\n         */\n        pchMessageStart[0] = 0x9f;\n        pchMessageStart[1] = 0xeb;\n        pchMessageStart[2] = 0x4b;\n        pchMessageStart[3] = 0x9d;\n        nDefaultPort = 34230;\n        nPruneAfterHeight = 100000;\n\n        // nTime: date -d '2019-08-16 00:00:00 KST' +%s = 1565881200\n        // genesisReward: pow(2,32) / COIN = 42.94967296 (was 50)\n        genesis = CreateGenesisBlock(1565881200, 247, 0x1f3fffff, 1, 42.94967296 * COIN);\n        consensus.hashGenesisBlock = genesis.GetHash();\n\n        // DEBUG - SUGAR\n        // printf(\"***\\n\");\n        // printf(\"genesis.GetPoWHash.MAIN = %s\\n\", genesis.GetPoWHash().ToString().c_str());\n        // printf(\"genesis.GetHash.MAIN = %s\\n\", genesis.GetHash().ToString().c_str());\n        // printf(\"genesis.hashMerkleRoot.MAIN %s\\n\",genesis.hashMerkleRoot.ToString().c_str());\n        // printf(\"***\\n\");\n\n        assert(genesis.GetPoWHash() == uint256S(\"0031205acedcc69a9c18f79b84790179d68fb90588bedee6587ff701bdde04eb\")); // genesis\n        assert(consensus.hashGenesisBlock == uint256S(\"7d5eaec2dbb75f99feadfa524c78b7cabc1d8c8204f79d4f3a83381b811b0adc\")); // genesis\n        assert(genesis.hashMerkleRoot == uint256S(\"7677ce2a579cb0411d1c9e6b1e9072b8f537f1e59cb387dacac2daac56e150b0\"));\n\n        // Note that of those which support the service bits prefix, most only support a subset of\n        // possible options.\n        // This is fine at runtime as we'll fall back to using them as a oneshot if they dont support the\n        // service bits we want, but we should get them updated to support all service bits wanted by any\n        // release ASAP to avoid it where possible.\n        vSeeds.emplace_back(\"1seed.sugarchain.info\"); // cryptozeny\n        vSeeds.emplace_back(\"2seed.sugarchain.info\"); // cryptozeny\n        vSeeds.emplace_back(\"seed.sugarchain.site\"); // ROZ\n        vSeeds.emplace_back(\"seed.sugar.hel.lu\"); // Hel\n\n        base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,63);  // legacy: starting with S (upper)\n        base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,125); // p2sh-segwit: starting with s (lower)\n        base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,128);\n        base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E};\n        base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4};\n\n        bech32_hrp = \"sugar\";   // bech32: starting with sugar1q\n\n        vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));\n\n        fDefaultConsistencyChecks = false;\n        fRequireStandard = true;\n        fMineBlocksOnDemand = false;\n\n        checkpointData = {\n            {\n                {1, uint256S(\"ce8a0df339f2edceb99c5325c95b2b0ae752e29de1193f6113549f0e1cae7c91\")},\n                {510, uint256S(\"f6f565e58812f89d8ea2aca296b9934ea82918f5bd443312af90b0be1465dbd1\")},\n                {511, uint256S(\"ef160a17b4ecc855d00dd6ce051df72f1e690d91811b74c50751ada2e14c5f1a\")},\n                {512, uint256S(\"094afbe86930e4950c601fde563cd2c7b9d050c1b567ad6fe48ae3b15a705ebb\")},\n                {900000, uint256S(\"8a566a463925cf028cb427edb6d4d18a9c1213bf472d9032369c4e45449eb71c\")},\n                {2601511, uint256S(\"e30af0fcf522354f43c3ab2cfb4805d175b1264608b6124eab0b635bdea2589d\")}, // 2601511=2601001+510\n                {4422211, uint256S(\"1f4186606aaab3cb3818f073599602e573476da9fed0b65c9f14646210d6b18f\")}, // 4422211=4421701+510\n                {6513497, uint256S(\"855f0c66238bc0246c8ca25cf958283fd49b9fb4b217ddeb518e5ea9f5071b9e\")},\n                // TODO.SUGAR.UPDATE\n            }\n        };\n\n        // TODO.SUGAR.UPDATE\n        chainTxData = ChainTxData{\n            // Data from RPC: getchaintxstats 4096 855f0c66238bc0246c8ca25cf958283fd49b9fb4b217ddeb518e5ea9f5071b9e (6513497)\n            /* nTime    */ 1599181736,\n            /* nTxCount */ 6858263,\n            /* dTxRate  */ 0.2053689306146399\n        };\n    }\n};\n\n/**\n * Testnet (v5)\n */\nclass CTestNetParams : public CChainParams {\npublic:\n    CTestNetParams() {\n        strNetworkID = \"test\";\n\n        // SUGAR-HALVING\n        // BTC: (was 21000000)\n        // around 2 years = pow(5,8)*32 = 390625*32 = 12500000\n        // pow(5,8) * pow(2,32) / COIN = 390625 * 4294967296 / 100000000 = INTEGER (16777216.0)\n        // pow(5,8) = 390625 is an integer cycle of pow(2,32) = 4294967296\n        // 1st halving = 536870912*COIN = 12500000 * 42.94967296\n        // Total Supply in COINs (in theory):\t1073741824\n        // Total Supply in COINs (in actual):\t1073741823.87500000\n        // Difference: 0.125\n        consensus.nSubsidyHalvingInterval = 12500000;\n\n        consensus.BIP16Height = 0;  // always on\n        consensus.BIP34Height = 17;\n        consensus.BIP34Hash = uint256S(\"\");   // TODO.SUGAR\n        consensus.BIP65Height = 0; // always on\n        consensus.BIP66Height = 0; // always on\n\n        // GET powLimit by python // FIXME.SUGAR // SURE?\n        /*\n        >>> \"%d\" % 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n        '115792089237316195423570985008687907853269984665640564039457584007913129639935'\n        >>> 115792089237316195423570985008687907853269984665640564039457584007913129639935 / 1024\n        113078212145816597093331040047546785012958969400039613319782796882727665663L\n        >>> \"%x\" % 113078212145816597093331040047546785012958969400039613319782796882727665663L\n        '3fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'\n        >>>\n        */\n\n        // getdifficulty() == 2.384149979653205e-07\n        // 0x1f3fffff == 0x003fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff.GetCompact()\n        consensus.powLimit = uint256S(\"003fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n\n        // DEBUG - SUGAR\n        // printf(\"\\n*** BEGIN - DEBUG: TESTNET\\n\");\n        // uint32_t powLimitTOnBits = UintToArith256(consensus.powLimit).GetCompact();\n        // printf(\"powLimitTOnBits = 0x%x\\n\", powLimitTOnBits);\n        // printf(\"*** END - DEBUG\\n\");\n\n        // SUGAR-HALVING\n        // 17 hours = 17*60*60 = 61200 (was two weeks: 14×24×60×60 = 1209600)\n        // available: 17*n hours or 17 days possible, because DigiShieldZEC uses n510 (17*n)\n        consensus.nPowTargetTimespan = 61200;\n\n        consensus.nPowAllowMinDifficultyBlocksAfterHeight = boost::none; // DigiShieldZEC\n        consensus.nPowAveragingWindow = 510; // 2550 / nPowTargetSpacing(5) = 510\n\n        // DEBUG - SUGAR\n        // printf(\"\\n*** BEGIN - DEBUG: TESTNET\\n\");\n        // printf(\"nPowAveragingWindowRatio = %s\\n\", (maxUint/UintToArith256(consensus.powLimit)).ToString().c_str());\n        // printf(\"nPowAveragingWindow = %ld\\n\", consensus.nPowAveragingWindow);\n        // printf(\"*** END - DEBUG\\n\");\n\n        assert(maxUint/UintToArith256(consensus.powLimit) == 1024); // DigiShieldZEC // 0x0000000000000000000000000000000000000000000000000000000000000400 == 1024\n        assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow); // DigiShieldZEC // true: 1024 >= 510\n\n        consensus.nPowMaxAdjustDown = 32; // DigiShieldZEC // 32% adjustment down\n        consensus.nPowMaxAdjustUp = 16; // DigiShieldZEC // 16% adjustment up\n\n        // SUGAR-HALVING\n        // 10*60/120 = 5 seconds block time\n        // 120x faster than bitcoin\n        consensus.nPowTargetSpacing = 5;\n\n        consensus.fPowAllowMinDifficultyBlocks = false; // DigiShieldZEC\n        consensus.fPowNoRetargeting = false; // DigiShieldZEC\n\n        // SUGAR-HALVING\n        // 75% of nMinerConfirmationWindow = 61200/5*0.75 = 9180 (was 1916 = 1209600/600*0.95+0.8)\n        // 9180/510 = 18 cycles of DigiShieldZEC\n        consensus.nRuleChangeActivationThreshold = 9180;\n\n        // SUGAR-HALVING\n        // nPowTargetTimespan/nPowTargetSpacing = 61200/5 = 12240 (was 2016 = 1209600/600)\n        // 12240/510 = 24 cycles of DigiShieldZEC\n        consensus.nMinerConfirmationWindow = 12240;\n\n        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;\n        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008\n        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008\n\n        // Deployment of BIP68, BIP112, and BIP113 are always on\n        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;\n        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;\n        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;\n\n        // Deployment of SegWit (BIP141, BIP143, and BIP147) is always on\n        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;\n        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;\n        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;\n\n        // The best chain should have at least this much work.\n        // TODO.SUGAR.UPDATE\n        // getblockhash 4000000 && \"chainwork\" (testnet)\n        consensus.nMinimumChainWork = uint256S(\"000000000000000000000000000000000000000000000000000000014d9bf048\");\n\n        // By default assume that the signatures in ancestors of this block are valid.\n        // TODO.SUGAR.UPDATE\n        // getblockhash 4000000 && \"hash\" (testnet)\n        consensus.defaultAssumeValid = uint256S(\"bc05c2d5e81785f287cd58a798b64467cff35c8ef2bbe8062d8420eeb86f4056\");\n\n        pchMessageStart[0] = 0xb0;\n        pchMessageStart[1] = 0x11;\n        pchMessageStart[2] = 0x90;\n        pchMessageStart[3] = 0x70;\n        nDefaultPort = 44230;\n        nPruneAfterHeight = 1000;\n\n        // nTime: date -d '2019-08-16 00:00:01 UTC' +%s = 1565913601\n        // genesisReward: pow(2,32) / COIN = 42.94967296 (was 50)\n        genesis = CreateGenesisBlock(1565913601, 490, 0x1f3fffff, 1, 42.94967296 * COIN);\n        consensus.hashGenesisBlock = genesis.GetHash();\n\n        // DEBUG - SUGAR\n        // printf(\"***\\n\");\n        // printf(\"genesis.GetPoWHash.TESTNET = %s\\n\", genesis.GetPoWHash().ToString().c_str());\n        // printf(\"genesis.GetHash.TESTNET = %s\\n\", genesis.GetHash().ToString().c_str());\n        // printf(\"genesis.hashMerkleRoot.TESTNET %s\\n\",genesis.hashMerkleRoot.ToString().c_str());\n        // printf(\"***\\n\");\n\n        assert(genesis.GetPoWHash() == uint256S(\"0032f49a73e00fc182e08d5ede75c1418c7833092d663e43a5463c1dbd096f28\")); // genesis\n        assert(consensus.hashGenesisBlock == uint256S(\"e0e0e42e493ba7b15f7b0fe1a7e66f73b7fd8b3e6e6a7b0e821a6b95040d3826\")); // genesis\n        assert(genesis.hashMerkleRoot == uint256S(\"7677ce2a579cb0411d1c9e6b1e9072b8f537f1e59cb387dacac2daac56e150b0\"));\n\n        vFixedSeeds.clear();\n        vSeeds.clear();\n        // nodes with support for servicebits filtering should be at the top\n        vSeeds.emplace_back(\"1seed-testnet.cryptozeny.com\"); // cryptozeny\n\n        base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,66);  // legacy: starting with T (upper)\n        base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,128); // p2sh-segwit: starting with t (lower)\n        base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,239);\n        base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};\n        base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};\n\n        bech32_hrp = \"tugar\";     // bech32: starting with tugar1q\n\n        vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test));\n\n        fDefaultConsistencyChecks = false;\n        fRequireStandard = false;\n        fMineBlocksOnDemand = false;\n\n\n        checkpointData = {\n            {\n                {1, uint256S(\"0741357f5ee729dffdebdc78f0897f4c244788effebb2cda22c5d5947bebd923\")},\n                {510, uint256S(\"9e355f520668f48212641bf674733d24e56c6b2f05ac60ba6fa860163feef8d4\")},\n                {511, uint256S(\"9418cef01af69fc2491afcb56c640df9d78e0d0768bf9e2748c1978d2ffb97ed\")},\n                {512, uint256S(\"c8663700fe1020185d26f1f06571dd51ed2f9c331436b83aa08dd21352f7ffea\")},\n                {780811, uint256S(\"bd83debccee1bef17340539beff64ad3feab03c25e5d91969cf5418b8e2fe5a7\")}, // 780811=780301+510\n                {4000000, uint256S(\"bc05c2d5e81785f287cd58a798b64467cff35c8ef2bbe8062d8420eeb86f4056\")},\n            }\n        };\n\n        // TODO.SUGAR.UPDATE\n        chainTxData = ChainTxData{\n            // Data from RPC: getchaintxstats 4096 bd83debccee1bef17340539beff64ad3feab03c25e5d91969cf5418b8e2fe5a7 (780811)\n            /* nTime    */ 1598648664,\n            /* nTxCount */ 4033793,\n            /* dTxRate  */ 0.1692345821801809\n        };\n\n    }\n};\n\n/**\n * Regression test\n */\nclass CRegTestParams : public CChainParams {\npublic:\n    CRegTestParams() {\n        strNetworkID = \"regtest\";\n\n        // SUGAR-HALVING // (was same as BTC)\n        consensus.nSubsidyHalvingInterval = 150;\n\n        // DEBUG - SUGAR\n        // printf(\"nSubsidyHalvingInterval = %d\\n\", consensus.nSubsidyHalvingInterval);\n\n        consensus.BIP16Height = 0; // always enforce P2SH BIP16 on regtest\n        consensus.BIP34Height = 100000000; // BIP34 has not activated on regtest (far in the future so block v1 are not rejected in tests)\n        consensus.BIP34Hash = uint256();\n        consensus.BIP65Height = 1351; // BIP65 activated on regtest (Used in rpc activation tests)\n        consensus.BIP66Height = 1251; // BIP66 activated on regtest (Used in rpc activation tests)\n\n        // GET powLimit by python // FIXME.SUGAR // SURE?\n        /*\n        >>> \"%d\" % 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n        '115792089237316195423570985008687907853269984665640564039457584007913129639935'\n        >>> 115792089237316195423570985008687907853269984665640564039457584007913129639935 / 17\n        6811299366900952671974763824040465167839410862684739061144563765171360567055L\n        >>> \"%x\" % 6811299366900952671974763824040465167839410862684739061144563765171360567055L\n        'f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f'\n        >>>\n        */\n\n        // getdifficulty() == 3.958060781902051e-09\n        // 0x200f0f0f == 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f.GetCompact()\n        consensus.powLimit = uint256S(\"0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f\");\n\n        // DEBUG - SUGAR\n        // printf(\"\\n*** BEGIN - DEBUG: REGTEST\\n\");\n        // uint32_t powLimitTOnBits = UintToArith256(consensus.powLimit).GetCompact();\n        // printf(\"powLimitTOnBits = 0x%x\\n\", powLimitTOnBits);\n        // printf(\"*** END - DEBUG\\n\");\n\n        // SUGAR-HALVING\n        // 17 hours = 17*60*60 = 61200 (was two weeks: 14×24×60×60 = 1209600)\n        // available: 17*n hours or 17 days possible, because DigiShieldZEC uses n510 (17*n)\n        consensus.nPowTargetTimespan = 61200;\n\n        consensus.nPowAllowMinDifficultyBlocksAfterHeight = boost::none; // DigiShieldZEC\n        consensus.nPowAveragingWindow = 17; // DigiShieldZEC // 85/nPowTargetSpacing(5) = 17\n\n        // DEBUG - SUGAR\n        // printf(\"\\n*** BEGIN - DEBUG: REGTEST\\n\");\n        // printf(\"nPowAveragingWindowRatio = %s\\n\", (maxUint/UintToArith256(consensus.powLimit)).ToString().c_str());\n        // printf(\"nPowAveragingWindow = %ld\\n\", consensus.nPowAveragingWindow);\n        // printf(\"*** END - DEBUG\\n\");\n\n        assert(maxUint/UintToArith256(consensus.powLimit) == 17); // DigiShieldZEC // 0x0000000000000000000000000000000000000000000000000000000000000011 == 17\n        assert(maxUint/UintToArith256(consensus.powLimit) >= consensus.nPowAveragingWindow); // DigiShieldZEC // true: 17 >= 17\n\n        consensus.nPowMaxAdjustDown = 0; // DigiShieldZEC // Turn off adjustment down\n        consensus.nPowMaxAdjustUp = 0; // DigiShieldZEC // Turn off adjustment up\n\n        // SUGAR-HALVING\n        // 10*60/120 = 5 seconds block time\n        // 120x faster than bitcoin\n        consensus.nPowTargetSpacing = 5;\n\n        consensus.fPowAllowMinDifficultyBlocks = true; // DigiShieldZEC\n        consensus.fPowNoRetargeting = true; // DigiShieldZEC\n\n        // SUGAR-HALVING // (was same as BTC)\n        consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains\n\n        // SUGAR-HALVING // (was same as BTC)\n        consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)\n\n        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;\n        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;\n        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;\n        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;\n        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 0;\n        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;\n        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;\n        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = Consensus::BIP9Deployment::ALWAYS_ACTIVE;\n        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;\n\n        // The best chain should have at least this much work.\n        consensus.nMinimumChainWork = uint256S(\"0x00\");\n\n        // By default assume that the signatures in ancestors of this block are valid.\n        consensus.defaultAssumeValid = uint256S(\"d567a9c891c7a47e6dd03f8006cb65b0d6406b5dc7b2c86d7a904815c394e1f1\"); // genesis\n\n        pchMessageStart[0] = 0xaf;\n        pchMessageStart[1] = 0xfb;\n        pchMessageStart[2] = 0x5b;\n        pchMessageStart[3] = 0xad;\n        nDefaultPort = 45340;\n        nPruneAfterHeight = 1000;\n\n        // nTime: date -d '2019-08-16 00:00:02 UTC' +%s = 1565913602\n        // genesisReward: pow(2,32) / COIN = 42.94967296 (was 50)\n        genesis = CreateGenesisBlock(1565913602, 9, 0x200f0f0f, 1, 42.94967296 * COIN);\n\n        consensus.hashGenesisBlock = genesis.GetHash();\n\n        // DEBUG - SUGAR\n        // printf(\"\\n*** BEGIN - DEBUG: REGTEST\\n\");\n        // printf(\"genesis.GetPoWHash.REGTEST = %s\\n\", genesis.GetPoWHash().ToString().c_str());\n        // printf(\"genesis.GetHash.REGTEST = %s\\n\", genesis.GetHash().ToString().c_str());\n        // printf(\"genesis.hashMerkleRoot.REGTEST %s\\n\",genesis.hashMerkleRoot.ToString().c_str());\n        // printf(\"*** END - DEBUG\\n\");\n\n        assert(genesis.GetPoWHash() == uint256S(\"0d144c097fa9c4cf7482fde74f95da8045b516490741af0ee9b1ac1f1dd6c914\")); // genesis\n        assert(consensus.hashGenesisBlock == uint256S(\"d567a9c891c7a47e6dd03f8006cb65b0d6406b5dc7b2c86d7a904815c394e1f1\")); // genesis\n        assert(genesis.hashMerkleRoot == uint256S(\"7677ce2a579cb0411d1c9e6b1e9072b8f537f1e59cb387dacac2daac56e150b0\"));\n\n        vFixedSeeds.clear(); //!< Regtest mode doesn't have any fixed seeds.\n        vSeeds.clear();      //!< Regtest mode doesn't have any DNS seeds.\n\n        fDefaultConsistencyChecks = true;\n        fRequireStandard = false;\n        fMineBlocksOnDemand = true;\n\n        checkpointData = {\n            {\n                {0, uint256S(\"d567a9c891c7a47e6dd03f8006cb65b0d6406b5dc7b2c86d7a904815c394e1f1\")}, // genesis\n            }\n        };\n\n        chainTxData = ChainTxData{\n            0,\n            0,\n            0\n        };\n\n        base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,61);  // legacy: starting with R (upper)\n        base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,123); // p2sh-segwit: starting with r (lower)\n        base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,239);\n        base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF};\n        base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94};\n\n        bech32_hrp = \"rugar\";    // bech32: starting with rugar1q\n    }\n};\n\nstatic std::unique_ptr<CChainParams> globalChainParams;\n\nconst CChainParams &Params() {\n    assert(globalChainParams);\n    return *globalChainParams;\n}\n\nstd::unique_ptr<CChainParams> CreateChainParams(const std::string& chain)\n{\n    if (chain == CBaseChainParams::MAIN)\n        return std::unique_ptr<CChainParams>(new CMainParams());\n    else if (chain == CBaseChainParams::TESTNET)\n        return std::unique_ptr<CChainParams>(new CTestNetParams());\n    else if (chain == CBaseChainParams::REGTEST)\n        return std::unique_ptr<CChainParams>(new CRegTestParams());\n    throw std::runtime_error(strprintf(\"%s: Unknown chain %s.\", __func__, chain));\n}\n\nvoid SelectParams(const std::string& network)\n{\n    SelectBaseParams(network);\n    globalChainParams = CreateChainParams(network);\n}\n\nvoid UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout)\n{\n    globalChainParams->UpdateVersionBitsParameters(d, nStartTime, nTimeout);\n}\n"
  },
  {
    "path": "src/chainparams.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CHAINPARAMS_H\n#define BITCOIN_CHAINPARAMS_H\n\n#include <chainparamsbase.h>\n#include <consensus/params.h>\n#include <primitives/block.h>\n#include <protocol.h>\n\n#include <memory>\n#include <vector>\n\nstruct SeedSpec6 {\n    uint8_t addr[16];\n    uint16_t port;\n};\n\ntypedef std::map<int, uint256> MapCheckpoints;\n\nstruct CCheckpointData {\n    MapCheckpoints mapCheckpoints;\n};\n\nstruct ChainTxData {\n    int64_t nTime;\n    int64_t nTxCount;\n    double dTxRate;\n};\n\n/**\n * CChainParams defines various tweakable parameters of a given instance of the\n * Bitcoin system. There are three: the main network on which people trade goods\n * and services, the public test network which gets reset from time to time and\n * a regression test mode which is intended for private networks only. It has\n * minimal difficulty to ensure that blocks can be found instantly.\n */\nclass CChainParams\n{\npublic:\n    enum Base58Type {\n        PUBKEY_ADDRESS,\n        SCRIPT_ADDRESS,\n        SECRET_KEY,\n        EXT_PUBLIC_KEY,\n        EXT_SECRET_KEY,\n\n        MAX_BASE58_TYPES\n    };\n\n    const Consensus::Params& GetConsensus() const { return consensus; }\n    const CMessageHeader::MessageStartChars& MessageStart() const { return pchMessageStart; }\n    int GetDefaultPort() const { return nDefaultPort; }\n\n    const CBlock& GenesisBlock() const { return genesis; }\n    /** Default value for -checkmempool and -checkblockindex argument */\n    bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; }\n    /** Policy: Filter transactions that do not match well-defined patterns */\n    bool RequireStandard() const { return fRequireStandard; }\n    uint64_t PruneAfterHeight() const { return nPruneAfterHeight; }\n    /** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */\n    bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }\n    /** Return the BIP70 network string (main, test or regtest) */\n    std::string NetworkIDString() const { return strNetworkID; }\n    /** Return the list of hostnames to look up for DNS seeds */\n    const std::vector<std::string>& DNSSeeds() const { return vSeeds; }\n    const std::vector<unsigned char>& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; }\n    const std::string& Bech32HRP() const { return bech32_hrp; }\n    const std::vector<SeedSpec6>& FixedSeeds() const { return vFixedSeeds; }\n    const CCheckpointData& Checkpoints() const { return checkpointData; }\n    const ChainTxData& TxData() const { return chainTxData; }\n    void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);\nprotected:\n    CChainParams() {}\n\n    Consensus::Params consensus;\n    CMessageHeader::MessageStartChars pchMessageStart;\n    int nDefaultPort;\n    uint64_t nPruneAfterHeight;\n    std::vector<std::string> vSeeds;\n    std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES];\n    std::string bech32_hrp;\n    std::string strNetworkID;\n    CBlock genesis;\n    std::vector<SeedSpec6> vFixedSeeds;\n    bool fDefaultConsistencyChecks;\n    bool fRequireStandard;\n    bool fMineBlocksOnDemand;\n    CCheckpointData checkpointData;\n    ChainTxData chainTxData;\n};\n\n/**\n * Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.\n * @returns a CChainParams* of the chosen chain.\n * @throws a std::runtime_error if the chain is not supported.\n */\nstd::unique_ptr<CChainParams> CreateChainParams(const std::string& chain);\n\n/**\n * Return the currently selected parameters. This won't change after app\n * startup, except for unit tests.\n */\nconst CChainParams &Params();\n\n/**\n * Sets the params returned by Params() to those for the given BIP70 chain name.\n * @throws std::runtime_error when the chain is not supported.\n */\nvoid SelectParams(const std::string& chain);\n\n/**\n * Allows modifying the Version Bits regtest parameters.\n */\nvoid UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout);\n\n#endif // BITCOIN_CHAINPARAMS_H\n"
  },
  {
    "path": "src/chainparamsbase.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <chainparamsbase.h>\n\n#include <tinyformat.h>\n#include <util.h>\n\n#include <assert.h>\n#include <memory>\n\nconst std::string CBaseChainParams::MAIN = \"main\";\nconst std::string CBaseChainParams::TESTNET = \"test\";\nconst std::string CBaseChainParams::REGTEST = \"regtest\";\n\nvoid AppendParamsHelpMessages(std::string& strUsage, bool debugHelp)\n{\n    strUsage += HelpMessageGroup(_(\"Chain selection options:\"));\n    strUsage += HelpMessageOpt(\"-testnet\", _(\"Use the test chain\"));\n    if (debugHelp) {\n        strUsage += HelpMessageOpt(\"-regtest\", \"Enter regression test mode, which uses a special chain in which blocks can be solved instantly. \"\n                                   \"This is intended for regression testing tools and app development.\");\n    }\n}\n\n/**\n * Main network\n */\nclass CBaseMainParams : public CBaseChainParams\n{\npublic:\n    CBaseMainParams()\n    {\n        nRPCPort = 34229;\n    }\n};\n\n/**\n * Testnet (v5)\n */\nclass CBaseTestNetParams : public CBaseChainParams\n{\npublic:\n    CBaseTestNetParams()\n    {\n        nRPCPort = 44229;\n        strDataDir = \"testnet5\";\n    }\n};\n\n/*\n * Regression test\n */\nclass CBaseRegTestParams : public CBaseChainParams\n{\npublic:\n    CBaseRegTestParams()\n    {\n        nRPCPort = 45339;\n        strDataDir = \"regtest\";\n    }\n};\n\nstatic std::unique_ptr<CBaseChainParams> globalChainBaseParams;\n\nconst CBaseChainParams& BaseParams()\n{\n    assert(globalChainBaseParams);\n    return *globalChainBaseParams;\n}\n\nstd::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain)\n{\n    if (chain == CBaseChainParams::MAIN)\n        return std::unique_ptr<CBaseChainParams>(new CBaseMainParams());\n    else if (chain == CBaseChainParams::TESTNET)\n        return std::unique_ptr<CBaseChainParams>(new CBaseTestNetParams());\n    else if (chain == CBaseChainParams::REGTEST)\n        return std::unique_ptr<CBaseChainParams>(new CBaseRegTestParams());\n    else\n        throw std::runtime_error(strprintf(\"%s: Unknown chain %s.\", __func__, chain));\n}\n\nvoid SelectBaseParams(const std::string& chain)\n{\n    globalChainBaseParams = CreateBaseChainParams(chain);\n}\n\nstd::string ChainNameFromCommandLine()\n{\n    bool fRegTest = gArgs.GetBoolArg(\"-regtest\", false);\n    bool fTestNet = gArgs.GetBoolArg(\"-testnet\", false);\n\n    if (fTestNet && fRegTest)\n        throw std::runtime_error(\"Invalid combination of -regtest and -testnet.\");\n    if (fRegTest)\n        return CBaseChainParams::REGTEST;\n    if (fTestNet)\n        return CBaseChainParams::TESTNET;\n    return CBaseChainParams::MAIN;\n}\n"
  },
  {
    "path": "src/chainparamsbase.h",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CHAINPARAMSBASE_H\n#define BITCOIN_CHAINPARAMSBASE_H\n\n#include <memory>\n#include <string>\n#include <vector>\n\n/**\n * CBaseChainParams defines the base parameters (shared between bitcoin-cli and bitcoind)\n * of a given instance of the Bitcoin system.\n */\nclass CBaseChainParams\n{\npublic:\n    /** BIP70 chain name strings (main, test or regtest) */\n    static const std::string MAIN;\n    static const std::string TESTNET;\n    static const std::string REGTEST;\n\n    const std::string& DataDir() const { return strDataDir; }\n    int RPCPort() const { return nRPCPort; }\n\nprotected:\n    CBaseChainParams() {}\n\n    int nRPCPort;\n    std::string strDataDir;\n};\n\n/**\n * Creates and returns a std::unique_ptr<CBaseChainParams> of the chosen chain.\n * @returns a CBaseChainParams* of the chosen chain.\n * @throws a std::runtime_error if the chain is not supported.\n */\nstd::unique_ptr<CBaseChainParams> CreateBaseChainParams(const std::string& chain);\n\n/**\n * Append the help messages for the chainparams options to the\n * parameter string.\n */\nvoid AppendParamsHelpMessages(std::string& strUsage, bool debugHelp=true);\n\n/**\n * Return the currently selected parameters. This won't change after app\n * startup, except for unit tests.\n */\nconst CBaseChainParams& BaseParams();\n\n/** Sets the params returned by Params() to those for the given network. */\nvoid SelectBaseParams(const std::string& chain);\n\n/**\n * Looks for -regtest, -testnet and returns the appropriate BIP70 chain name.\n * @return CBaseChainParams::MAX_NETWORK_TYPES if an invalid combination is given. CBaseChainParams::MAIN by default.\n */\nstd::string ChainNameFromCommandLine();\n\n#endif // BITCOIN_CHAINPARAMSBASE_H\n"
  },
  {
    "path": "src/chainparamsseeds.h",
    "content": "#ifndef BITCOIN_CHAINPARAMSSEEDS_H\n#define BITCOIN_CHAINPARAMSSEEDS_H\n/**\n * List of fixed seed nodes for the bitcoin network\n * AUTOGENERATED by contrib/seeds/generate-seeds.py\n *\n * Each line contains a 16-byte IPv6 address and a port.\n * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.\n */\nstatic SeedSpec6 pnSeed6_main[] = {\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x33,0x59,0xad,0xb2}, 34230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x8d,0x45,0xdb}, 34230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xaf,0x15,0x3c}, 34230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8b,0x63,0x44,0xdd}, 34230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x96,0x5f,0x8b,0xe1}, 34230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9b,0x8a,0x8b,0x61}, 34230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9d,0xf5,0x45,0x0f}, 34230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa0,0x77,0x65,0xdb}, 34230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa3,0x2c,0xae,0xb8}, 34230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcf,0x94,0x54,0x80}, 34230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd3,0x90,0x78,0xa4}, 34230}\n};\n\nstatic SeedSpec6 pnSeed6_test[] = {\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0xc2,0xac}, 44230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x96,0x5f,0x92,0xb9}, 44230},\n    {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x96,0x5f,0x9a,0x18}, 44230}\n};\n#endif // BITCOIN_CHAINPARAMSSEEDS_H\n"
  },
  {
    "path": "src/checkpoints.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <checkpoints.h>\n\n#include <chain.h>\n#include <chainparams.h>\n#include <reverse_iterator.h>\n#include <validation.h>\n\n#include <stdint.h>\n\n\nnamespace Checkpoints {\n\n    CBlockIndex* GetLastCheckpoint(const CCheckpointData& data)\n    {\n        const MapCheckpoints& checkpoints = data.mapCheckpoints;\n\n        for (const MapCheckpoints::value_type& i : reverse_iterate(checkpoints))\n        {\n            const uint256& hash = i.second;\n            BlockMap::const_iterator t = mapBlockIndex.find(hash);\n            if (t != mapBlockIndex.end())\n                return t->second;\n        }\n        return nullptr;\n    }\n\n} // namespace Checkpoints\n"
  },
  {
    "path": "src/checkpoints.h",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CHECKPOINTS_H\n#define BITCOIN_CHECKPOINTS_H\n\n#include <uint256.h>\n\n#include <map>\n\nclass CBlockIndex;\nstruct CCheckpointData;\n\n/**\n * Block-chain checkpoints are compiled-in sanity checks.\n * They are updated every release or three.\n */\nnamespace Checkpoints\n{\n\n//! Returns last CBlockIndex* in mapBlockIndex that is a checkpoint\nCBlockIndex* GetLastCheckpoint(const CCheckpointData& data);\n\n} //namespace Checkpoints\n\n#endif // BITCOIN_CHECKPOINTS_H\n"
  },
  {
    "path": "src/checkqueue.h",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CHECKQUEUE_H\n#define BITCOIN_CHECKQUEUE_H\n\n#include <sync.h>\n\n#include <algorithm>\n#include <vector>\n\n#include <boost/thread/condition_variable.hpp>\n#include <boost/thread/mutex.hpp>\n\ntemplate <typename T>\nclass CCheckQueueControl;\n\n/** \n * Queue for verifications that have to be performed.\n  * The verifications are represented by a type T, which must provide an\n  * operator(), returning a bool.\n  *\n  * One thread (the master) is assumed to push batches of verifications\n  * onto the queue, where they are processed by N-1 worker threads. When\n  * the master is done adding work, it temporarily joins the worker pool\n  * as an N'th worker, until all jobs are done.\n  */\ntemplate <typename T>\nclass CCheckQueue\n{\nprivate:\n    //! Mutex to protect the inner state\n    boost::mutex mutex;\n\n    //! Worker threads block on this when out of work\n    boost::condition_variable condWorker;\n\n    //! Master thread blocks on this when out of work\n    boost::condition_variable condMaster;\n\n    //! The queue of elements to be processed.\n    //! As the order of booleans doesn't matter, it is used as a LIFO (stack)\n    std::vector<T> queue;\n\n    //! The number of workers (including the master) that are idle.\n    int nIdle;\n\n    //! The total number of workers (including the master).\n    int nTotal;\n\n    //! The temporary evaluation result.\n    bool fAllOk;\n\n    /**\n     * Number of verifications that haven't completed yet.\n     * This includes elements that are no longer queued, but still in the\n     * worker's own batches.\n     */\n    unsigned int nTodo;\n\n    //! The maximum number of elements to be processed in one batch\n    unsigned int nBatchSize;\n\n    /** Internal function that does bulk of the verification work. */\n    bool Loop(bool fMaster = false)\n    {\n        boost::condition_variable& cond = fMaster ? condMaster : condWorker;\n        std::vector<T> vChecks;\n        vChecks.reserve(nBatchSize);\n        unsigned int nNow = 0;\n        bool fOk = true;\n        do {\n            {\n                boost::unique_lock<boost::mutex> lock(mutex);\n                // first do the clean-up of the previous loop run (allowing us to do it in the same critsect)\n                if (nNow) {\n                    fAllOk &= fOk;\n                    nTodo -= nNow;\n                    if (nTodo == 0 && !fMaster)\n                        // We processed the last element; inform the master it can exit and return the result\n                        condMaster.notify_one();\n                } else {\n                    // first iteration\n                    nTotal++;\n                }\n                // logically, the do loop starts here\n                while (queue.empty()) {\n                    if (fMaster && nTodo == 0) {\n                        nTotal--;\n                        bool fRet = fAllOk;\n                        // reset the status for new work later\n                        if (fMaster)\n                            fAllOk = true;\n                        // return the current status\n                        return fRet;\n                    }\n                    nIdle++;\n                    cond.wait(lock); // wait\n                    nIdle--;\n                }\n                // Decide how many work units to process now.\n                // * Do not try to do everything at once, but aim for increasingly smaller batches so\n                //   all workers finish approximately simultaneously.\n                // * Try to account for idle jobs which will instantly start helping.\n                // * Don't do batches smaller than 1 (duh), or larger than nBatchSize.\n                nNow = std::max(1U, std::min(nBatchSize, (unsigned int)queue.size() / (nTotal + nIdle + 1)));\n                vChecks.resize(nNow);\n                for (unsigned int i = 0; i < nNow; i++) {\n                    // We want the lock on the mutex to be as short as possible, so swap jobs from the global\n                    // queue to the local batch vector instead of copying.\n                    vChecks[i].swap(queue.back());\n                    queue.pop_back();\n                }\n                // Check whether we need to do work at all\n                fOk = fAllOk;\n            }\n            // execute work\n            for (T& check : vChecks)\n                if (fOk)\n                    fOk = check();\n            vChecks.clear();\n        } while (true);\n    }\n\npublic:\n    //! Mutex to ensure only one concurrent CCheckQueueControl\n    boost::mutex ControlMutex;\n\n    //! Create a new check queue\n    explicit CCheckQueue(unsigned int nBatchSizeIn) : nIdle(0), nTotal(0), fAllOk(true), nTodo(0), nBatchSize(nBatchSizeIn) {}\n\n    //! Worker thread\n    void Thread()\n    {\n        Loop();\n    }\n\n    //! Wait until execution finishes, and return whether all evaluations were successful.\n    bool Wait()\n    {\n        return Loop(true);\n    }\n\n    //! Add a batch of checks to the queue\n    void Add(std::vector<T>& vChecks)\n    {\n        boost::unique_lock<boost::mutex> lock(mutex);\n        for (T& check : vChecks) {\n            queue.push_back(T());\n            check.swap(queue.back());\n        }\n        nTodo += vChecks.size();\n        if (vChecks.size() == 1)\n            condWorker.notify_one();\n        else if (vChecks.size() > 1)\n            condWorker.notify_all();\n    }\n\n    ~CCheckQueue()\n    {\n    }\n\n};\n\n/** \n * RAII-style controller object for a CCheckQueue that guarantees the passed\n * queue is finished before continuing.\n */\ntemplate <typename T>\nclass CCheckQueueControl\n{\nprivate:\n    CCheckQueue<T> * const pqueue;\n    bool fDone;\n\npublic:\n    CCheckQueueControl() = delete;\n    CCheckQueueControl(const CCheckQueueControl&) = delete;\n    CCheckQueueControl& operator=(const CCheckQueueControl&) = delete;\n    explicit CCheckQueueControl(CCheckQueue<T> * const pqueueIn) : pqueue(pqueueIn), fDone(false)\n    {\n        // passed queue is supposed to be unused, or nullptr\n        if (pqueue != nullptr) {\n            ENTER_CRITICAL_SECTION(pqueue->ControlMutex);\n        }\n    }\n\n    bool Wait()\n    {\n        if (pqueue == nullptr)\n            return true;\n        bool fRet = pqueue->Wait();\n        fDone = true;\n        return fRet;\n    }\n\n    void Add(std::vector<T>& vChecks)\n    {\n        if (pqueue != nullptr)\n            pqueue->Add(vChecks);\n    }\n\n    ~CCheckQueueControl()\n    {\n        if (!fDone)\n            Wait();\n        if (pqueue != nullptr) {\n            LEAVE_CRITICAL_SECTION(pqueue->ControlMutex);\n        }\n    }\n};\n\n#endif // BITCOIN_CHECKQUEUE_H\n"
  },
  {
    "path": "src/clientversion.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <clientversion.h>\n\n#include <tinyformat.h>\n\n\n/**\n * Name of client reported in the 'version' message. Report the same name\n * for both bitcoind and bitcoin-qt, to make it harder for attackers to\n * target servers or GUI users specifically.\n */\nconst std::string CLIENT_NAME(\"Yumekawa\");\n\n/**\n * Client version number\n */\n#define CLIENT_VERSION_SUFFIX \"\"\n\n\n/**\n * The following part of the code determines the CLIENT_BUILD variable.\n * Several mechanisms are used for this:\n * * first, if HAVE_BUILD_INFO is defined, include build.h, a file that is\n *   generated by the build environment, possibly containing the output\n *   of git-describe in a macro called BUILD_DESC\n * * secondly, if this is an exported version of the code, GIT_ARCHIVE will\n *   be defined (automatically using the export-subst git attribute), and\n *   GIT_COMMIT will contain the commit id.\n * * then, three options exist for determining CLIENT_BUILD:\n *   * if BUILD_DESC is defined, use that literally (output of git-describe)\n *   * if not, but GIT_COMMIT is defined, use v[maj].[min].[rev].[build]-g[commit]\n *   * otherwise, use v[maj].[min].[rev].[build]-unk\n * finally CLIENT_VERSION_SUFFIX is added\n */\n\n//! First, include build.h if requested\n#ifdef HAVE_BUILD_INFO\n#include <obj/build.h>\n#endif\n\n//! git will put \"#define GIT_ARCHIVE 1\" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$\n#ifdef GIT_ARCHIVE\n#define GIT_COMMIT_ID \"$Format:%h$\"\n#define GIT_COMMIT_DATE \"$Format:%cD$\"\n#endif\n\n#define BUILD_DESC_WITH_SUFFIX(maj, min, rev, build, suffix) \\\n    \"v\" DO_STRINGIZE(maj) \".\" DO_STRINGIZE(min) \".\" DO_STRINGIZE(rev) \".\" DO_STRINGIZE(build) \"-\" DO_STRINGIZE(suffix)\n\n#define BUILD_DESC_FROM_COMMIT(maj, min, rev, build, commit) \\\n    \"v\" DO_STRINGIZE(maj) \".\" DO_STRINGIZE(min) \".\" DO_STRINGIZE(rev) \".\" DO_STRINGIZE(build) \"-g\" commit\n\n#define BUILD_DESC_FROM_UNKNOWN(maj, min, rev, build) \\\n    \"v\" DO_STRINGIZE(maj) \".\" DO_STRINGIZE(min) \".\" DO_STRINGIZE(rev) \".\" DO_STRINGIZE(build) \"-unk\"\n\n#ifndef BUILD_DESC\n#ifdef BUILD_SUFFIX\n#define BUILD_DESC BUILD_DESC_WITH_SUFFIX(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, BUILD_SUFFIX)\n#elif defined(GIT_COMMIT_ID)\n#define BUILD_DESC BUILD_DESC_FROM_COMMIT(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, GIT_COMMIT_ID)\n#else\n#define BUILD_DESC BUILD_DESC_FROM_UNKNOWN(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD)\n#endif\n#endif\n\nconst std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX);\n\nstatic std::string FormatVersion(int nVersion)\n{\n    if (nVersion % 100 == 0)\n        return strprintf(\"%d.%d.%d\", nVersion / 1000000, (nVersion / 10000) % 100, (nVersion / 100) % 100);\n    else\n        return strprintf(\"%d.%d.%d.%d\", nVersion / 1000000, (nVersion / 10000) % 100, (nVersion / 100) % 100, nVersion % 100);\n}\n\nstd::string FormatFullVersion()\n{\n    return CLIENT_BUILD;\n}\n\n/** \n * Format the subversion field according to BIP 14 spec (https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki) \n */\nstd::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments)\n{\n    std::ostringstream ss;\n    ss << \"/\";\n    ss << name << \":\" << FormatVersion(nClientVersion);\n    if (!comments.empty())\n    {\n        std::vector<std::string>::const_iterator it(comments.begin());\n        ss << \"(\" << *it;\n        for(++it; it != comments.end(); ++it)\n            ss << \"; \" << *it;\n        ss << \")\";\n    }\n    ss << \"/\";\n    return ss.str();\n}\n"
  },
  {
    "path": "src/clientversion.h",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CLIENTVERSION_H\n#define BITCOIN_CLIENTVERSION_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif //HAVE_CONFIG_H\n\n// Check that required client information is defined\n#if !defined(CLIENT_VERSION_MAJOR) || !defined(CLIENT_VERSION_MINOR) || !defined(CLIENT_VERSION_REVISION) || !defined(CLIENT_VERSION_BUILD) || !defined(CLIENT_VERSION_IS_RELEASE) || !defined(COPYRIGHT_YEAR)\n#error Client version information missing: version is not defined by bitcoin-config.h or in any other way\n#endif\n\n/**\n * Converts the parameter X to a string after macro replacement on X has been performed.\n * Don't merge these into one macro!\n */\n#define STRINGIZE(X) DO_STRINGIZE(X)\n#define DO_STRINGIZE(X) #X\n\n//! Copyright string used in Windows .rc files\n#define COPYRIGHT_STR \"2009-\" STRINGIZE(COPYRIGHT_YEAR) \" \" COPYRIGHT_HOLDERS_FINAL\n\n/**\n * bitcoind-res.rc includes this file, but it cannot cope with real c++ code.\n * WINDRES_PREPROC is defined to indicate that its pre-processor is running.\n * Anything other than a define should be guarded below.\n */\n\n#if !defined(WINDRES_PREPROC)\n\n#include <string>\n#include <vector>\n\nstatic const int CLIENT_VERSION =\n                           1000000 * CLIENT_VERSION_MAJOR\n                         +   10000 * CLIENT_VERSION_MINOR\n                         +     100 * CLIENT_VERSION_REVISION\n                         +       1 * CLIENT_VERSION_BUILD;\n\nextern const std::string CLIENT_NAME;\nextern const std::string CLIENT_BUILD;\n\n\nstd::string FormatFullVersion();\nstd::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);\n\n#endif // WINDRES_PREPROC\n\n#endif // BITCOIN_CLIENTVERSION_H\n"
  },
  {
    "path": "src/coins.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <coins.h>\n\n#include <consensus/consensus.h>\n#include <random.h>\n\nbool CCoinsView::GetCoin(const COutPoint &outpoint, Coin &coin) const { return false; }\nuint256 CCoinsView::GetBestBlock() const { return uint256(); }\nstd::vector<uint256> CCoinsView::GetHeadBlocks() const { return std::vector<uint256>(); }\nbool CCoinsView::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return false; }\nCCoinsViewCursor *CCoinsView::Cursor() const { return nullptr; }\n\nbool CCoinsView::HaveCoin(const COutPoint &outpoint) const\n{\n    Coin coin;\n    return GetCoin(outpoint, coin);\n}\n\nCCoinsViewBacked::CCoinsViewBacked(CCoinsView *viewIn) : base(viewIn) { }\nbool CCoinsViewBacked::GetCoin(const COutPoint &outpoint, Coin &coin) const { return base->GetCoin(outpoint, coin); }\nbool CCoinsViewBacked::HaveCoin(const COutPoint &outpoint) const { return base->HaveCoin(outpoint); }\nuint256 CCoinsViewBacked::GetBestBlock() const { return base->GetBestBlock(); }\nstd::vector<uint256> CCoinsViewBacked::GetHeadBlocks() const { return base->GetHeadBlocks(); }\nvoid CCoinsViewBacked::SetBackend(CCoinsView &viewIn) { base = &viewIn; }\nbool CCoinsViewBacked::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) { return base->BatchWrite(mapCoins, hashBlock); }\nCCoinsViewCursor *CCoinsViewBacked::Cursor() const { return base->Cursor(); }\nsize_t CCoinsViewBacked::EstimateSize() const { return base->EstimateSize(); }\n\nSaltedOutpointHasher::SaltedOutpointHasher() : k0(GetRand(std::numeric_limits<uint64_t>::max())), k1(GetRand(std::numeric_limits<uint64_t>::max())) {}\n\nCCoinsViewCache::CCoinsViewCache(CCoinsView *baseIn) : CCoinsViewBacked(baseIn), cachedCoinsUsage(0) {}\n\nsize_t CCoinsViewCache::DynamicMemoryUsage() const {\n    return memusage::DynamicUsage(cacheCoins) + cachedCoinsUsage;\n}\n\nCCoinsMap::iterator CCoinsViewCache::FetchCoin(const COutPoint &outpoint) const {\n    CCoinsMap::iterator it = cacheCoins.find(outpoint);\n    if (it != cacheCoins.end())\n        return it;\n    Coin tmp;\n    if (!base->GetCoin(outpoint, tmp))\n        return cacheCoins.end();\n    CCoinsMap::iterator ret = cacheCoins.emplace(std::piecewise_construct, std::forward_as_tuple(outpoint), std::forward_as_tuple(std::move(tmp))).first;\n    if (ret->second.coin.IsSpent()) {\n        // The parent only has an empty entry for this outpoint; we can consider our\n        // version as fresh.\n        ret->second.flags = CCoinsCacheEntry::FRESH;\n    }\n    cachedCoinsUsage += ret->second.coin.DynamicMemoryUsage();\n    return ret;\n}\n\nbool CCoinsViewCache::GetCoin(const COutPoint &outpoint, Coin &coin) const {\n    CCoinsMap::const_iterator it = FetchCoin(outpoint);\n    if (it != cacheCoins.end()) {\n        coin = it->second.coin;\n        return !coin.IsSpent();\n    }\n    return false;\n}\n\nvoid CCoinsViewCache::AddCoin(const COutPoint &outpoint, Coin&& coin, bool possible_overwrite) {\n    assert(!coin.IsSpent());\n    if (coin.out.scriptPubKey.IsUnspendable()) return;\n    CCoinsMap::iterator it;\n    bool inserted;\n    std::tie(it, inserted) = cacheCoins.emplace(std::piecewise_construct, std::forward_as_tuple(outpoint), std::tuple<>());\n    bool fresh = false;\n    if (!inserted) {\n        cachedCoinsUsage -= it->second.coin.DynamicMemoryUsage();\n    }\n    if (!possible_overwrite) {\n        if (!it->second.coin.IsSpent()) {\n            throw std::logic_error(\"Adding new coin that replaces non-pruned entry\");\n        }\n        fresh = !(it->second.flags & CCoinsCacheEntry::DIRTY);\n    }\n    it->second.coin = std::move(coin);\n    it->second.flags |= CCoinsCacheEntry::DIRTY | (fresh ? CCoinsCacheEntry::FRESH : 0);\n    cachedCoinsUsage += it->second.coin.DynamicMemoryUsage();\n}\n\nvoid AddCoins(CCoinsViewCache& cache, const CTransaction &tx, int nHeight, bool check) {\n    bool fCoinbase = tx.IsCoinBase();\n    const uint256& txid = tx.GetHash();\n    for (size_t i = 0; i < tx.vout.size(); ++i) {\n        bool overwrite = check ? cache.HaveCoin(COutPoint(txid, i)) : fCoinbase;\n        // Always set the possible_overwrite flag to AddCoin for coinbase txn, in order to correctly\n        // deal with the pre-BIP30 occurrences of duplicate coinbase transactions.\n        cache.AddCoin(COutPoint(txid, i), Coin(tx.vout[i], nHeight, fCoinbase), overwrite);\n    }\n}\n\nbool CCoinsViewCache::SpendCoin(const COutPoint &outpoint, Coin* moveout) {\n    CCoinsMap::iterator it = FetchCoin(outpoint);\n    if (it == cacheCoins.end()) return false;\n    cachedCoinsUsage -= it->second.coin.DynamicMemoryUsage();\n    if (moveout) {\n        *moveout = std::move(it->second.coin);\n    }\n    if (it->second.flags & CCoinsCacheEntry::FRESH) {\n        cacheCoins.erase(it);\n    } else {\n        it->second.flags |= CCoinsCacheEntry::DIRTY;\n        it->second.coin.Clear();\n    }\n    return true;\n}\n\nstatic const Coin coinEmpty;\n\nconst Coin& CCoinsViewCache::AccessCoin(const COutPoint &outpoint) const {\n    CCoinsMap::const_iterator it = FetchCoin(outpoint);\n    if (it == cacheCoins.end()) {\n        return coinEmpty;\n    } else {\n        return it->second.coin;\n    }\n}\n\nbool CCoinsViewCache::HaveCoin(const COutPoint &outpoint) const {\n    CCoinsMap::const_iterator it = FetchCoin(outpoint);\n    return (it != cacheCoins.end() && !it->second.coin.IsSpent());\n}\n\nbool CCoinsViewCache::HaveCoinInCache(const COutPoint &outpoint) const {\n    CCoinsMap::const_iterator it = cacheCoins.find(outpoint);\n    return (it != cacheCoins.end() && !it->second.coin.IsSpent());\n}\n\nuint256 CCoinsViewCache::GetBestBlock() const {\n    if (hashBlock.IsNull())\n        hashBlock = base->GetBestBlock();\n    return hashBlock;\n}\n\nvoid CCoinsViewCache::SetBestBlock(const uint256 &hashBlockIn) {\n    hashBlock = hashBlockIn;\n}\n\nbool CCoinsViewCache::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlockIn) {\n    for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end(); it = mapCoins.erase(it)) {\n        // Ignore non-dirty entries (optimization).\n        if (!(it->second.flags & CCoinsCacheEntry::DIRTY)) {\n            continue;\n        }\n        CCoinsMap::iterator itUs = cacheCoins.find(it->first);\n        if (itUs == cacheCoins.end()) {\n            // The parent cache does not have an entry, while the child does\n            // We can ignore it if it's both FRESH and pruned in the child\n            if (!(it->second.flags & CCoinsCacheEntry::FRESH && it->second.coin.IsSpent())) {\n                // Otherwise we will need to create it in the parent\n                // and move the data up and mark it as dirty\n                CCoinsCacheEntry& entry = cacheCoins[it->first];\n                entry.coin = std::move(it->second.coin);\n                cachedCoinsUsage += entry.coin.DynamicMemoryUsage();\n                entry.flags = CCoinsCacheEntry::DIRTY;\n                // We can mark it FRESH in the parent if it was FRESH in the child\n                // Otherwise it might have just been flushed from the parent's cache\n                // and already exist in the grandparent\n                if (it->second.flags & CCoinsCacheEntry::FRESH) {\n                    entry.flags |= CCoinsCacheEntry::FRESH;\n                }\n            }\n        } else {\n            // Assert that the child cache entry was not marked FRESH if the\n            // parent cache entry has unspent outputs. If this ever happens,\n            // it means the FRESH flag was misapplied and there is a logic\n            // error in the calling code.\n            if ((it->second.flags & CCoinsCacheEntry::FRESH) && !itUs->second.coin.IsSpent()) {\n                throw std::logic_error(\"FRESH flag misapplied to cache entry for base transaction with spendable outputs\");\n            }\n\n            // Found the entry in the parent cache\n            if ((itUs->second.flags & CCoinsCacheEntry::FRESH) && it->second.coin.IsSpent()) {\n                // The grandparent does not have an entry, and the child is\n                // modified and being pruned. This means we can just delete\n                // it from the parent.\n                cachedCoinsUsage -= itUs->second.coin.DynamicMemoryUsage();\n                cacheCoins.erase(itUs);\n            } else {\n                // A normal modification.\n                cachedCoinsUsage -= itUs->second.coin.DynamicMemoryUsage();\n                itUs->second.coin = std::move(it->second.coin);\n                cachedCoinsUsage += itUs->second.coin.DynamicMemoryUsage();\n                itUs->second.flags |= CCoinsCacheEntry::DIRTY;\n                // NOTE: It is possible the child has a FRESH flag here in\n                // the event the entry we found in the parent is pruned. But\n                // we must not copy that FRESH flag to the parent as that\n                // pruned state likely still needs to be communicated to the\n                // grandparent.\n            }\n        }\n    }\n    hashBlock = hashBlockIn;\n    return true;\n}\n\nbool CCoinsViewCache::Flush() {\n    bool fOk = base->BatchWrite(cacheCoins, hashBlock);\n    cacheCoins.clear();\n    cachedCoinsUsage = 0;\n    return fOk;\n}\n\nvoid CCoinsViewCache::Uncache(const COutPoint& hash)\n{\n    CCoinsMap::iterator it = cacheCoins.find(hash);\n    if (it != cacheCoins.end() && it->second.flags == 0) {\n        cachedCoinsUsage -= it->second.coin.DynamicMemoryUsage();\n        cacheCoins.erase(it);\n    }\n}\n\nunsigned int CCoinsViewCache::GetCacheSize() const {\n    return cacheCoins.size();\n}\n\nCAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const\n{\n    if (tx.IsCoinBase())\n        return 0;\n\n    CAmount nResult = 0;\n    for (unsigned int i = 0; i < tx.vin.size(); i++)\n        nResult += AccessCoin(tx.vin[i].prevout).out.nValue;\n\n    return nResult;\n}\n\nbool CCoinsViewCache::HaveInputs(const CTransaction& tx) const\n{\n    if (!tx.IsCoinBase()) {\n        for (unsigned int i = 0; i < tx.vin.size(); i++) {\n            if (!HaveCoin(tx.vin[i].prevout)) {\n                return false;\n            }\n        }\n    }\n    return true;\n}\n\nstatic const size_t MIN_TRANSACTION_OUTPUT_WEIGHT = WITNESS_SCALE_FACTOR * ::GetSerializeSize(CTxOut(), SER_NETWORK, PROTOCOL_VERSION);\nstatic const size_t MAX_OUTPUTS_PER_BLOCK = MAX_BLOCK_WEIGHT / MIN_TRANSACTION_OUTPUT_WEIGHT;\n\nconst Coin& AccessByTxid(const CCoinsViewCache& view, const uint256& txid)\n{\n    COutPoint iter(txid, 0);\n    while (iter.n < MAX_OUTPUTS_PER_BLOCK) {\n        const Coin& alternate = view.AccessCoin(iter);\n        if (!alternate.IsSpent()) return alternate;\n        ++iter.n;\n    }\n    return coinEmpty;\n}\n"
  },
  {
    "path": "src/coins.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_COINS_H\n#define BITCOIN_COINS_H\n\n#include <primitives/transaction.h>\n#include <compressor.h>\n#include <core_memusage.h>\n#include <hash.h>\n#include <memusage.h>\n#include <serialize.h>\n#include <uint256.h>\n\n#include <assert.h>\n#include <stdint.h>\n\n#include <unordered_map>\n\n/**\n * A UTXO entry.\n *\n * Serialized format:\n * - VARINT((coinbase ? 1 : 0) | (height << 1))\n * - the non-spent CTxOut (via CTxOutCompressor)\n */\nclass Coin\n{\npublic:\n    //! unspent transaction output\n    CTxOut out;\n\n    //! whether containing transaction was a coinbase\n    unsigned int fCoinBase : 1;\n\n    //! at which height this containing transaction was included in the active block chain\n    uint32_t nHeight : 31;\n\n    //! construct a Coin from a CTxOut and height/coinbase information.\n    Coin(CTxOut&& outIn, int nHeightIn, bool fCoinBaseIn) : out(std::move(outIn)), fCoinBase(fCoinBaseIn), nHeight(nHeightIn) {}\n    Coin(const CTxOut& outIn, int nHeightIn, bool fCoinBaseIn) : out(outIn), fCoinBase(fCoinBaseIn),nHeight(nHeightIn) {}\n\n    void Clear() {\n        out.SetNull();\n        fCoinBase = false;\n        nHeight = 0;\n    }\n\n    //! empty constructor\n    Coin() : fCoinBase(false), nHeight(0) { }\n\n    bool IsCoinBase() const {\n        return fCoinBase;\n    }\n\n    template<typename Stream>\n    void Serialize(Stream &s) const {\n        assert(!IsSpent());\n        uint32_t code = nHeight * 2 + fCoinBase;\n        ::Serialize(s, VARINT(code));\n        ::Serialize(s, CTxOutCompressor(REF(out)));\n    }\n\n    template<typename Stream>\n    void Unserialize(Stream &s) {\n        uint32_t code = 0;\n        ::Unserialize(s, VARINT(code));\n        nHeight = code >> 1;\n        fCoinBase = code & 1;\n        ::Unserialize(s, REF(CTxOutCompressor(out)));\n    }\n\n    bool IsSpent() const {\n        return out.IsNull();\n    }\n\n    size_t DynamicMemoryUsage() const {\n        return memusage::DynamicUsage(out.scriptPubKey);\n    }\n};\n\nclass SaltedOutpointHasher\n{\nprivate:\n    /** Salt */\n    const uint64_t k0, k1;\n\npublic:\n    SaltedOutpointHasher();\n\n    /**\n     * This *must* return size_t. With Boost 1.46 on 32-bit systems the\n     * unordered_map will behave unpredictably if the custom hasher returns a\n     * uint64_t, resulting in failures when syncing the chain (#4634).\n     */\n    size_t operator()(const COutPoint& id) const {\n        return SipHashUint256Extra(k0, k1, id.hash, id.n);\n    }\n};\n\nstruct CCoinsCacheEntry\n{\n    Coin coin; // The actual cached data.\n    unsigned char flags;\n\n    enum Flags {\n        DIRTY = (1 << 0), // This cache entry is potentially different from the version in the parent view.\n        FRESH = (1 << 1), // The parent view does not have this entry (or it is pruned).\n        /* Note that FRESH is a performance optimization with which we can\n         * erase coins that are fully spent if we know we do not need to\n         * flush the changes to the parent cache.  It is always safe to\n         * not mark FRESH if that condition is not guaranteed.\n         */\n    };\n\n    CCoinsCacheEntry() : flags(0) {}\n    explicit CCoinsCacheEntry(Coin&& coin_) : coin(std::move(coin_)), flags(0) {}\n};\n\ntypedef std::unordered_map<COutPoint, CCoinsCacheEntry, SaltedOutpointHasher> CCoinsMap;\n\n/** Cursor for iterating over CoinsView state */\nclass CCoinsViewCursor\n{\npublic:\n    CCoinsViewCursor(const uint256 &hashBlockIn): hashBlock(hashBlockIn) {}\n    virtual ~CCoinsViewCursor() {}\n\n    virtual bool GetKey(COutPoint &key) const = 0;\n    virtual bool GetValue(Coin &coin) const = 0;\n    virtual unsigned int GetValueSize() const = 0;\n\n    virtual bool Valid() const = 0;\n    virtual void Next() = 0;\n\n    //! Get best block at the time this cursor was created\n    const uint256 &GetBestBlock() const { return hashBlock; }\nprivate:\n    uint256 hashBlock;\n};\n\n/** Abstract view on the open txout dataset. */\nclass CCoinsView\n{\npublic:\n    /** Retrieve the Coin (unspent transaction output) for a given outpoint.\n     *  Returns true only when an unspent coin was found, which is returned in coin.\n     *  When false is returned, coin's value is unspecified.\n     */\n    virtual bool GetCoin(const COutPoint &outpoint, Coin &coin) const;\n\n    //! Just check whether a given outpoint is unspent.\n    virtual bool HaveCoin(const COutPoint &outpoint) const;\n\n    //! Retrieve the block hash whose state this CCoinsView currently represents\n    virtual uint256 GetBestBlock() const;\n\n    //! Retrieve the range of blocks that may have been only partially written.\n    //! If the database is in a consistent state, the result is the empty vector.\n    //! Otherwise, a two-element vector is returned consisting of the new and\n    //! the old block hash, in that order.\n    virtual std::vector<uint256> GetHeadBlocks() const;\n\n    //! Do a bulk modification (multiple Coin changes + BestBlock change).\n    //! The passed mapCoins can be modified.\n    virtual bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock);\n\n    //! Get a cursor to iterate over the whole state\n    virtual CCoinsViewCursor *Cursor() const;\n\n    //! As we use CCoinsViews polymorphically, have a virtual destructor\n    virtual ~CCoinsView() {}\n\n    //! Estimate database size (0 if not implemented)\n    virtual size_t EstimateSize() const { return 0; }\n};\n\n\n/** CCoinsView backed by another CCoinsView */\nclass CCoinsViewBacked : public CCoinsView\n{\nprotected:\n    CCoinsView *base;\n\npublic:\n    CCoinsViewBacked(CCoinsView *viewIn);\n    bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;\n    bool HaveCoin(const COutPoint &outpoint) const override;\n    uint256 GetBestBlock() const override;\n    std::vector<uint256> GetHeadBlocks() const override;\n    void SetBackend(CCoinsView &viewIn);\n    bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override;\n    CCoinsViewCursor *Cursor() const override;\n    size_t EstimateSize() const override;\n};\n\n\n/** CCoinsView that adds a memory cache for transactions to another CCoinsView */\nclass CCoinsViewCache : public CCoinsViewBacked\n{\nprotected:\n    /**\n     * Make mutable so that we can \"fill the cache\" even from Get-methods\n     * declared as \"const\".  \n     */\n    mutable uint256 hashBlock;\n    mutable CCoinsMap cacheCoins;\n\n    /* Cached dynamic memory usage for the inner Coin objects. */\n    mutable size_t cachedCoinsUsage;\n\npublic:\n    CCoinsViewCache(CCoinsView *baseIn);\n\n    /**\n     * By deleting the copy constructor, we prevent accidentally using it when one intends to create a cache on top of a base cache.\n     */\n    CCoinsViewCache(const CCoinsViewCache &) = delete;\n\n    // Standard CCoinsView methods\n    bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;\n    bool HaveCoin(const COutPoint &outpoint) const override;\n    uint256 GetBestBlock() const override;\n    void SetBestBlock(const uint256 &hashBlock);\n    bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override;\n    CCoinsViewCursor* Cursor() const override {\n        throw std::logic_error(\"CCoinsViewCache cursor iteration not supported.\");\n    }\n\n    /**\n     * Check if we have the given utxo already loaded in this cache.\n     * The semantics are the same as HaveCoin(), but no calls to\n     * the backing CCoinsView are made.\n     */\n    bool HaveCoinInCache(const COutPoint &outpoint) const;\n\n    /**\n     * Return a reference to Coin in the cache, or a pruned one if not found. This is\n     * more efficient than GetCoin.\n     *\n     * Generally, do not hold the reference returned for more than a short scope.\n     * While the current implementation allows for modifications to the contents\n     * of the cache while holding the reference, this behavior should not be relied\n     * on! To be safe, best to not hold the returned reference through any other\n     * calls to this cache.\n     */\n    const Coin& AccessCoin(const COutPoint &output) const;\n\n    /**\n     * Add a coin. Set potential_overwrite to true if a non-pruned version may\n     * already exist.\n     */\n    void AddCoin(const COutPoint& outpoint, Coin&& coin, bool potential_overwrite);\n\n    /**\n     * Spend a coin. Pass moveto in order to get the deleted data.\n     * If no unspent output exists for the passed outpoint, this call\n     * has no effect.\n     */\n    bool SpendCoin(const COutPoint &outpoint, Coin* moveto = nullptr);\n\n    /**\n     * Push the modifications applied to this cache to its base.\n     * Failure to call this method before destruction will cause the changes to be forgotten.\n     * If false is returned, the state of this cache (and its backing view) will be undefined.\n     */\n    bool Flush();\n\n    /**\n     * Removes the UTXO with the given outpoint from the cache, if it is\n     * not modified.\n     */\n    void Uncache(const COutPoint &outpoint);\n\n    //! Calculate the size of the cache (in number of transaction outputs)\n    unsigned int GetCacheSize() const;\n\n    //! Calculate the size of the cache (in bytes)\n    size_t DynamicMemoryUsage() const;\n\n    /** \n     * Amount of bitcoins coming in to a transaction\n     * Note that lightweight clients may not know anything besides the hash of previous transactions,\n     * so may not be able to calculate this.\n     *\n     * @param[in] tx\ttransaction for which we are checking input total\n     * @return\tSum of value of all inputs (scriptSigs)\n     */\n    CAmount GetValueIn(const CTransaction& tx) const;\n\n    //! Check whether all prevouts of the transaction are present in the UTXO set represented by this view\n    bool HaveInputs(const CTransaction& tx) const;\n\nprivate:\n    CCoinsMap::iterator FetchCoin(const COutPoint &outpoint) const;\n};\n\n//! Utility function to add all of a transaction's outputs to a cache.\n// When check is false, this assumes that overwrites are only possible for coinbase transactions.\n// When check is true, the underlying view may be queried to determine whether an addition is\n// an overwrite.\n// TODO: pass in a boolean to limit these possible overwrites to known\n// (pre-BIP34) cases.\nvoid AddCoins(CCoinsViewCache& cache, const CTransaction& tx, int nHeight, bool check = false);\n\n//! Utility function to find any unspent output with a given txid.\n// This function can be quite expensive because in the event of a transaction\n// which is not found in the cache, it can cause up to MAX_OUTPUTS_PER_BLOCK\n// lookups to database, so it should be used with care.\nconst Coin& AccessByTxid(const CCoinsViewCache& cache, const uint256& txid);\n\n#endif // BITCOIN_COINS_H\n"
  },
  {
    "path": "src/compat/byteswap.h",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_COMPAT_BYTESWAP_H\n#define BITCOIN_COMPAT_BYTESWAP_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <stdint.h>\n\n#if defined(HAVE_BYTESWAP_H)\n#include <byteswap.h>\n#endif\n\n#if defined(__APPLE__)\n\n#if !defined(bswap_16)\n\n// Mac OS X / Darwin features; we include a check for bswap_16 because if it is already defined, protobuf has\n// defined these macros for us already; if it isn't, we do it ourselves. In either case, we get the exact same\n// result regardless which path was taken\n#include <libkern/OSByteOrder.h>\n#define bswap_16(x) OSSwapInt16(x)\n#define bswap_32(x) OSSwapInt32(x)\n#define bswap_64(x) OSSwapInt64(x)\n\n#endif // !defined(bswap_16)\n\n#else\n// Non-Mac OS X / non-Darwin\n\n#if HAVE_DECL_BSWAP_16 == 0\ninline uint16_t bswap_16(uint16_t x)\n{\n    return (x >> 8) | (x << 8);\n}\n#endif // HAVE_DECL_BSWAP16 == 0\n\n#if HAVE_DECL_BSWAP_32 == 0\ninline uint32_t bswap_32(uint32_t x)\n{\n    return (((x & 0xff000000U) >> 24) | ((x & 0x00ff0000U) >>  8) |\n            ((x & 0x0000ff00U) <<  8) | ((x & 0x000000ffU) << 24));\n}\n#endif // HAVE_DECL_BSWAP32 == 0\n\n#if HAVE_DECL_BSWAP_64 == 0\ninline uint64_t bswap_64(uint64_t x)\n{\n     return (((x & 0xff00000000000000ull) >> 56)\n          | ((x & 0x00ff000000000000ull) >> 40)\n          | ((x & 0x0000ff0000000000ull) >> 24)\n          | ((x & 0x000000ff00000000ull) >> 8)\n          | ((x & 0x00000000ff000000ull) << 8)\n          | ((x & 0x0000000000ff0000ull) << 24)\n          | ((x & 0x000000000000ff00ull) << 40)\n          | ((x & 0x00000000000000ffull) << 56));\n}\n#endif // HAVE_DECL_BSWAP64 == 0\n\n#endif // defined(__APPLE__)\n\n#endif // BITCOIN_COMPAT_BYTESWAP_H\n"
  },
  {
    "path": "src/compat/endian.h",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_COMPAT_ENDIAN_H\n#define BITCOIN_COMPAT_ENDIAN_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <compat/byteswap.h>\n\n#include <stdint.h>\n\n#if defined(HAVE_ENDIAN_H)\n#include <endian.h>\n#elif defined(HAVE_SYS_ENDIAN_H)\n#include <sys/endian.h>\n#endif\n\n#ifndef HAVE_CONFIG_H\n// While not technically a supported configuration, defaulting to defining these\n// DECLs when we were compiled without autotools makes it easier for other build\n// systems to build things like libbitcoinconsensus for strange targets.\n#ifdef htobe16\n#define HAVE_DECL_HTOBE16 1\n#endif\n#ifdef htole16\n#define HAVE_DECL_HTOLE16 1\n#endif\n#ifdef be16toh\n#define HAVE_DECL_BE16TOH 1\n#endif\n#ifdef le16toh\n#define HAVE_DECL_LE16TOH 1\n#endif\n\n#ifdef htobe32\n#define HAVE_DECL_HTOBE32 1\n#endif\n#ifdef htole32\n#define HAVE_DECL_HTOLE32 1\n#endif\n#ifdef be32toh\n#define HAVE_DECL_BE32TOH 1\n#endif\n#ifdef le32toh\n#define HAVE_DECL_LE32TOH 1\n#endif\n\n#ifdef htobe64\n#define HAVE_DECL_HTOBE64 1\n#endif\n#ifdef htole64\n#define HAVE_DECL_HTOLE64 1\n#endif\n#ifdef be64toh\n#define HAVE_DECL_BE64TOH 1\n#endif\n#ifdef le64toh\n#define HAVE_DECL_LE64TOH 1\n#endif\n\n#endif // HAVE_CONFIG_H\n\n#if defined(WORDS_BIGENDIAN)\n\n#if HAVE_DECL_HTOBE16 == 0\ninline uint16_t htobe16(uint16_t host_16bits)\n{\n    return host_16bits;\n}\n#endif // HAVE_DECL_HTOBE16\n\n#if HAVE_DECL_HTOLE16 == 0\ninline uint16_t htole16(uint16_t host_16bits)\n{\n    return bswap_16(host_16bits);\n}\n#endif // HAVE_DECL_HTOLE16\n\n#if HAVE_DECL_BE16TOH == 0\ninline uint16_t be16toh(uint16_t big_endian_16bits)\n{\n    return big_endian_16bits;\n}\n#endif // HAVE_DECL_BE16TOH\n\n#if HAVE_DECL_LE16TOH == 0\ninline uint16_t le16toh(uint16_t little_endian_16bits)\n{\n    return bswap_16(little_endian_16bits);\n}\n#endif // HAVE_DECL_LE16TOH\n\n#if HAVE_DECL_HTOBE32 == 0\ninline uint32_t htobe32(uint32_t host_32bits)\n{\n    return host_32bits;\n}\n#endif // HAVE_DECL_HTOBE32\n\n#if HAVE_DECL_HTOLE32 == 0\ninline uint32_t htole32(uint32_t host_32bits)\n{\n    return bswap_32(host_32bits);\n}\n#endif // HAVE_DECL_HTOLE32\n\n#if HAVE_DECL_BE32TOH == 0\ninline uint32_t be32toh(uint32_t big_endian_32bits)\n{\n    return big_endian_32bits;\n}\n#endif // HAVE_DECL_BE32TOH\n\n#if HAVE_DECL_LE32TOH == 0\ninline uint32_t le32toh(uint32_t little_endian_32bits)\n{\n    return bswap_32(little_endian_32bits);\n}\n#endif // HAVE_DECL_LE32TOH\n\n#if HAVE_DECL_HTOBE64 == 0\ninline uint64_t htobe64(uint64_t host_64bits)\n{\n    return host_64bits;\n}\n#endif // HAVE_DECL_HTOBE64\n\n#if HAVE_DECL_HTOLE64 == 0\ninline uint64_t htole64(uint64_t host_64bits)\n{\n    return bswap_64(host_64bits);\n}\n#endif // HAVE_DECL_HTOLE64\n\n#if HAVE_DECL_BE64TOH == 0\ninline uint64_t be64toh(uint64_t big_endian_64bits)\n{\n    return big_endian_64bits;\n}\n#endif // HAVE_DECL_BE64TOH\n\n#if HAVE_DECL_LE64TOH == 0\ninline uint64_t le64toh(uint64_t little_endian_64bits)\n{\n    return bswap_64(little_endian_64bits);\n}\n#endif // HAVE_DECL_LE64TOH\n\n#else // WORDS_BIGENDIAN\n\n#if HAVE_DECL_HTOBE16 == 0\ninline uint16_t htobe16(uint16_t host_16bits)\n{\n    return bswap_16(host_16bits);\n}\n#endif // HAVE_DECL_HTOBE16\n\n#if HAVE_DECL_HTOLE16 == 0\ninline uint16_t htole16(uint16_t host_16bits)\n{\n    return host_16bits;\n}\n#endif // HAVE_DECL_HTOLE16\n\n#if HAVE_DECL_BE16TOH == 0\ninline uint16_t be16toh(uint16_t big_endian_16bits)\n{\n    return bswap_16(big_endian_16bits);\n}\n#endif // HAVE_DECL_BE16TOH\n\n#if HAVE_DECL_LE16TOH == 0\ninline uint16_t le16toh(uint16_t little_endian_16bits)\n{\n    return little_endian_16bits;\n}\n#endif // HAVE_DECL_LE16TOH\n\n#if HAVE_DECL_HTOBE32 == 0\ninline uint32_t htobe32(uint32_t host_32bits)\n{\n    return bswap_32(host_32bits);\n}\n#endif // HAVE_DECL_HTOBE32\n\n#if HAVE_DECL_HTOLE32 == 0\ninline uint32_t htole32(uint32_t host_32bits)\n{\n    return host_32bits;\n}\n#endif // HAVE_DECL_HTOLE32\n\n#if HAVE_DECL_BE32TOH == 0\ninline uint32_t be32toh(uint32_t big_endian_32bits)\n{\n    return bswap_32(big_endian_32bits);\n}\n#endif // HAVE_DECL_BE32TOH\n\n#if HAVE_DECL_LE32TOH == 0\ninline uint32_t le32toh(uint32_t little_endian_32bits)\n{\n    return little_endian_32bits;\n}\n#endif // HAVE_DECL_LE32TOH\n\n#if HAVE_DECL_HTOBE64 == 0\ninline uint64_t htobe64(uint64_t host_64bits)\n{\n    return bswap_64(host_64bits);\n}\n#endif // HAVE_DECL_HTOBE64\n\n#if HAVE_DECL_HTOLE64 == 0\ninline uint64_t htole64(uint64_t host_64bits)\n{\n    return host_64bits;\n}\n#endif // HAVE_DECL_HTOLE64\n\n#if HAVE_DECL_BE64TOH == 0\ninline uint64_t be64toh(uint64_t big_endian_64bits)\n{\n    return bswap_64(big_endian_64bits);\n}\n#endif // HAVE_DECL_BE64TOH\n\n#if HAVE_DECL_LE64TOH == 0\ninline uint64_t le64toh(uint64_t little_endian_64bits)\n{\n    return little_endian_64bits;\n}\n#endif // HAVE_DECL_LE64TOH\n\n#endif // WORDS_BIGENDIAN\n\n#endif // BITCOIN_COMPAT_ENDIAN_H\n"
  },
  {
    "path": "src/compat/glibc_compat.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <cstddef>\n\n#if defined(HAVE_SYS_SELECT_H)\n#include <sys/select.h>\n#endif\n\n// Prior to GLIBC_2.14, memcpy was aliased to memmove.\nextern \"C\" void* memmove(void* a, const void* b, size_t c);\nextern \"C\" void* memcpy(void* a, const void* b, size_t c)\n{\n    return memmove(a, b, c);\n}\n\nextern \"C\" void __chk_fail(void) __attribute__((__noreturn__));\nextern \"C\" FDELT_TYPE __fdelt_warn(FDELT_TYPE a)\n{\n    if (a >= FD_SETSIZE)\n        __chk_fail();\n    return a / __NFDBITS;\n}\nextern \"C\" FDELT_TYPE __fdelt_chk(FDELT_TYPE) __attribute__((weak, alias(\"__fdelt_warn\")));\n"
  },
  {
    "path": "src/compat/glibc_sanity.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <cstddef>\n\n#if defined(HAVE_SYS_SELECT_H)\n#include <sys/select.h>\n#endif\n\nextern \"C\" void* memcpy(void* a, const void* b, size_t c);\nvoid* memcpy_int(void* a, const void* b, size_t c)\n{\n    return memcpy(a, b, c);\n}\n\nnamespace\n{\n// trigger: Use the memcpy_int wrapper which calls our internal memcpy.\n//   A direct call to memcpy may be optimized away by the compiler.\n// test: Fill an array with a sequence of integers. memcpy to a new empty array.\n//   Verify that the arrays are equal. Use an odd size to decrease the odds of\n//   the call being optimized away.\ntemplate <unsigned int T>\nbool sanity_test_memcpy()\n{\n    unsigned int memcpy_test[T];\n    unsigned int memcpy_verify[T] = {};\n    for (unsigned int i = 0; i != T; ++i)\n        memcpy_test[i] = i;\n\n    memcpy_int(memcpy_verify, memcpy_test, sizeof(memcpy_test));\n\n    for (unsigned int i = 0; i != T; ++i) {\n        if (memcpy_verify[i] != i)\n            return false;\n    }\n    return true;\n}\n\n#if defined(HAVE_SYS_SELECT_H)\n// trigger: Call FD_SET to trigger __fdelt_chk. FORTIFY_SOURCE must be defined\n//   as >0 and optimizations must be set to at least -O2.\n// test: Add a file descriptor to an empty fd_set. Verify that it has been\n//   correctly added.\nbool sanity_test_fdelt()\n{\n    fd_set fds;\n    FD_ZERO(&fds);\n    FD_SET(0, &fds);\n    return FD_ISSET(0, &fds);\n}\n#endif\n\n} // namespace\n\nbool glibc_sanity_test()\n{\n#if defined(HAVE_SYS_SELECT_H)\n    if (!sanity_test_fdelt())\n        return false;\n#endif\n    return sanity_test_memcpy<1025>();\n}\n"
  },
  {
    "path": "src/compat/glibcxx_sanity.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <list>\n#include <locale>\n#include <stdexcept>\n\nnamespace\n{\n// trigger: use ctype<char>::widen to trigger ctype<char>::_M_widen_init().\n// test: convert a char from narrow to wide and back. Verify that the result\n//   matches the original.\nbool sanity_test_widen(char testchar)\n{\n    const std::ctype<char>& test(std::use_facet<std::ctype<char> >(std::locale()));\n    return test.narrow(test.widen(testchar), 'b') == testchar;\n}\n\n// trigger: use list::push_back and list::pop_back to trigger _M_hook and\n//   _M_unhook.\n// test: Push a sequence of integers into a list. Pop them off and verify that\n//   they match the original sequence.\nbool sanity_test_list(unsigned int size)\n{\n    std::list<unsigned int> test;\n    for (unsigned int i = 0; i != size; ++i)\n        test.push_back(i + 1);\n\n    if (test.size() != size)\n        return false;\n\n    while (!test.empty()) {\n        if (test.back() != test.size())\n            return false;\n        test.pop_back();\n    }\n    return true;\n}\n\n} // namespace\n\n// trigger: string::at(x) on an empty string to trigger __throw_out_of_range_fmt.\n// test: force std::string to throw an out_of_range exception. Verify that\n//   it's caught correctly.\nbool sanity_test_range_fmt()\n{\n    std::string test;\n    try {\n        test.at(1);\n    } catch (const std::out_of_range&) {\n        return true;\n    } catch (...) {\n    }\n    return false;\n}\n\nbool glibcxx_sanity_test()\n{\n    return sanity_test_widen('a') && sanity_test_list(100) && sanity_test_range_fmt();\n}\n"
  },
  {
    "path": "src/compat/sanity.h",
    "content": "// Copyright (c) 2009-2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_COMPAT_SANITY_H\n#define BITCOIN_COMPAT_SANITY_H\n\nbool glibc_sanity_test();\nbool glibcxx_sanity_test();\n\n#endif // BITCOIN_COMPAT_SANITY_H\n"
  },
  {
    "path": "src/compat/strnlen.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <cstring>\n\n#if HAVE_DECL_STRNLEN == 0\nsize_t strnlen( const char *start, size_t max_len)\n{\n    const char *end = (const char *)memchr(start, '\\0', max_len);\n\n    return end ? (size_t)(end - start) : max_len;\n}\n#endif // HAVE_DECL_STRNLEN\n"
  },
  {
    "path": "src/compat.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_COMPAT_H\n#define BITCOIN_COMPAT_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#ifdef WIN32\n#ifdef _WIN32_WINNT\n#undef _WIN32_WINNT\n#endif\n#define _WIN32_WINNT 0x0501\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN 1\n#endif\n#ifndef NOMINMAX\n#define NOMINMAX\n#endif\n#ifdef FD_SETSIZE\n#undef FD_SETSIZE // prevent redefinition compiler warning\n#endif\n#define FD_SETSIZE 1024 // max number of fds in fd_set\n\n#include <winsock2.h>     // Must be included before mswsock.h and windows.h\n\n#include <mswsock.h>\n#include <windows.h>\n#include <ws2tcpip.h>\n#include <stdint.h>\n#else\n#include <fcntl.h>\n#include <sys/mman.h>\n#include <sys/select.h>\n#include <sys/socket.h>\n#include <sys/types.h>\n#include <net/if.h>\n#include <netinet/in.h>\n#include <netinet/tcp.h>\n#include <arpa/inet.h>\n#include <ifaddrs.h>\n#include <limits.h>\n#include <netdb.h>\n#include <unistd.h>\n#endif\n\n#ifndef WIN32\ntypedef unsigned int SOCKET;\n#include <errno.h>\n#define WSAGetLastError()   errno\n#define WSAEINVAL           EINVAL\n#define WSAEALREADY         EALREADY\n#define WSAEWOULDBLOCK      EWOULDBLOCK\n#define WSAEMSGSIZE         EMSGSIZE\n#define WSAEINTR            EINTR\n#define WSAEINPROGRESS      EINPROGRESS\n#define WSAEADDRINUSE       EADDRINUSE\n#define WSAENOTSOCK         EBADF\n#define INVALID_SOCKET      (SOCKET)(~0)\n#define SOCKET_ERROR        -1\n#endif\n\n#ifdef WIN32\n#ifndef S_IRUSR\n#define S_IRUSR             0400\n#define S_IWUSR             0200\n#endif\n#else\n#define MAX_PATH            1024\n#endif\n#ifdef _MSC_VER\n#if !defined(ssize_t)\n#ifdef _WIN64\ntypedef int64_t ssize_t;\n#else\ntypedef int32_t ssize_t;\n#endif\n#endif\n#endif\n\n#if HAVE_DECL_STRNLEN == 0\nsize_t strnlen( const char *start, size_t max_len);\n#endif // HAVE_DECL_STRNLEN\n\nbool static inline IsSelectableSocket(const SOCKET& s) {\n#ifdef WIN32\n    return true;\n#else\n    return (s < FD_SETSIZE);\n#endif\n}\n\n#endif // BITCOIN_COMPAT_H\n"
  },
  {
    "path": "src/compressor.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <compressor.h>\n\n#include <hash.h>\n#include <pubkey.h>\n#include <script/standard.h>\n\nbool CScriptCompressor::IsToKeyID(CKeyID &hash) const\n{\n    if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160\n                            && script[2] == 20 && script[23] == OP_EQUALVERIFY\n                            && script[24] == OP_CHECKSIG) {\n        memcpy(&hash, &script[3], 20);\n        return true;\n    }\n    return false;\n}\n\nbool CScriptCompressor::IsToScriptID(CScriptID &hash) const\n{\n    if (script.size() == 23 && script[0] == OP_HASH160 && script[1] == 20\n                            && script[22] == OP_EQUAL) {\n        memcpy(&hash, &script[2], 20);\n        return true;\n    }\n    return false;\n}\n\nbool CScriptCompressor::IsToPubKey(CPubKey &pubkey) const\n{\n    if (script.size() == 35 && script[0] == 33 && script[34] == OP_CHECKSIG\n                            && (script[1] == 0x02 || script[1] == 0x03)) {\n        pubkey.Set(&script[1], &script[34]);\n        return true;\n    }\n    if (script.size() == 67 && script[0] == 65 && script[66] == OP_CHECKSIG\n                            && script[1] == 0x04) {\n        pubkey.Set(&script[1], &script[66]);\n        return pubkey.IsFullyValid(); // if not fully valid, a case that would not be compressible\n    }\n    return false;\n}\n\nbool CScriptCompressor::Compress(std::vector<unsigned char> &out) const\n{\n    CKeyID keyID;\n    if (IsToKeyID(keyID)) {\n        out.resize(21);\n        out[0] = 0x00;\n        memcpy(&out[1], &keyID, 20);\n        return true;\n    }\n    CScriptID scriptID;\n    if (IsToScriptID(scriptID)) {\n        out.resize(21);\n        out[0] = 0x01;\n        memcpy(&out[1], &scriptID, 20);\n        return true;\n    }\n    CPubKey pubkey;\n    if (IsToPubKey(pubkey)) {\n        out.resize(33);\n        memcpy(&out[1], &pubkey[1], 32);\n        if (pubkey[0] == 0x02 || pubkey[0] == 0x03) {\n            out[0] = pubkey[0];\n            return true;\n        } else if (pubkey[0] == 0x04) {\n            out[0] = 0x04 | (pubkey[64] & 0x01);\n            return true;\n        }\n    }\n    return false;\n}\n\nunsigned int CScriptCompressor::GetSpecialSize(unsigned int nSize) const\n{\n    if (nSize == 0 || nSize == 1)\n        return 20;\n    if (nSize == 2 || nSize == 3 || nSize == 4 || nSize == 5)\n        return 32;\n    return 0;\n}\n\nbool CScriptCompressor::Decompress(unsigned int nSize, const std::vector<unsigned char> &in)\n{\n    switch(nSize) {\n    case 0x00:\n        script.resize(25);\n        script[0] = OP_DUP;\n        script[1] = OP_HASH160;\n        script[2] = 20;\n        memcpy(&script[3], in.data(), 20);\n        script[23] = OP_EQUALVERIFY;\n        script[24] = OP_CHECKSIG;\n        return true;\n    case 0x01:\n        script.resize(23);\n        script[0] = OP_HASH160;\n        script[1] = 20;\n        memcpy(&script[2], in.data(), 20);\n        script[22] = OP_EQUAL;\n        return true;\n    case 0x02:\n    case 0x03:\n        script.resize(35);\n        script[0] = 33;\n        script[1] = nSize;\n        memcpy(&script[2], in.data(), 32);\n        script[34] = OP_CHECKSIG;\n        return true;\n    case 0x04:\n    case 0x05:\n        unsigned char vch[33] = {};\n        vch[0] = nSize - 2;\n        memcpy(&vch[1], in.data(), 32);\n        CPubKey pubkey(&vch[0], &vch[33]);\n        if (!pubkey.Decompress())\n            return false;\n        assert(pubkey.size() == 65);\n        script.resize(67);\n        script[0] = 65;\n        memcpy(&script[1], pubkey.begin(), 65);\n        script[66] = OP_CHECKSIG;\n        return true;\n    }\n    return false;\n}\n\n// Amount compression:\n// * If the amount is 0, output 0\n// * first, divide the amount (in base units) by the largest power of 10 possible; call the exponent e (e is max 9)\n// * if e<9, the last digit of the resulting number cannot be 0; store it as d, and drop it (divide by 10)\n//   * call the result n\n//   * output 1 + 10*(9*n + d - 1) + e\n// * if e==9, we only know the resulting number is not zero, so output 1 + 10*(n - 1) + 9\n// (this is decodable, as d is in [1-9] and e is in [0-9])\n\nuint64_t CTxOutCompressor::CompressAmount(uint64_t n)\n{\n    if (n == 0)\n        return 0;\n    int e = 0;\n    while (((n % 10) == 0) && e < 9) {\n        n /= 10;\n        e++;\n    }\n    if (e < 9) {\n        int d = (n % 10);\n        assert(d >= 1 && d <= 9);\n        n /= 10;\n        return 1 + (n*9 + d - 1)*10 + e;\n    } else {\n        return 1 + (n - 1)*10 + 9;\n    }\n}\n\nuint64_t CTxOutCompressor::DecompressAmount(uint64_t x)\n{\n    // x = 0  OR  x = 1+10*(9*n + d - 1) + e  OR  x = 1+10*(n - 1) + 9\n    if (x == 0)\n        return 0;\n    x--;\n    // x = 10*(9*n + d - 1) + e\n    int e = x % 10;\n    x /= 10;\n    uint64_t n = 0;\n    if (e < 9) {\n        // x = 9*n + d - 1\n        int d = (x % 9) + 1;\n        x /= 9;\n        // x = n\n        n = x*10 + d;\n    } else {\n        n = x+1;\n    }\n    while (e) {\n        n *= 10;\n        e--;\n    }\n    return n;\n}\n"
  },
  {
    "path": "src/compressor.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_COMPRESSOR_H\n#define BITCOIN_COMPRESSOR_H\n\n#include <primitives/transaction.h>\n#include <script/script.h>\n#include <serialize.h>\n\nclass CKeyID;\nclass CPubKey;\nclass CScriptID;\n\n/** Compact serializer for scripts.\n *\n *  It detects common cases and encodes them much more efficiently.\n *  3 special cases are defined:\n *  * Pay to pubkey hash (encoded as 21 bytes)\n *  * Pay to script hash (encoded as 21 bytes)\n *  * Pay to pubkey starting with 0x02, 0x03 or 0x04 (encoded as 33 bytes)\n *\n *  Other scripts up to 121 bytes require 1 byte + script length. Above\n *  that, scripts up to 16505 bytes require 2 bytes + script length.\n */\nclass CScriptCompressor\n{\nprivate:\n    /**\n     * make this static for now (there are only 6 special scripts defined)\n     * this can potentially be extended together with a new nVersion for\n     * transactions, in which case this value becomes dependent on nVersion\n     * and nHeight of the enclosing transaction.\n     */\n    static const unsigned int nSpecialScripts = 6;\n\n    CScript &script;\nprotected:\n    /**\n     * These check for scripts for which a special case with a shorter encoding is defined.\n     * They are implemented separately from the CScript test, as these test for exact byte\n     * sequence correspondences, and are more strict. For example, IsToPubKey also verifies\n     * whether the public key is valid (as invalid ones cannot be represented in compressed\n     * form).\n     */\n    bool IsToKeyID(CKeyID &hash) const;\n    bool IsToScriptID(CScriptID &hash) const;\n    bool IsToPubKey(CPubKey &pubkey) const;\n\n    bool Compress(std::vector<unsigned char> &out) const;\n    unsigned int GetSpecialSize(unsigned int nSize) const;\n    bool Decompress(unsigned int nSize, const std::vector<unsigned char> &out);\npublic:\n    explicit CScriptCompressor(CScript &scriptIn) : script(scriptIn) { }\n\n    template<typename Stream>\n    void Serialize(Stream &s) const {\n        std::vector<unsigned char> compr;\n        if (Compress(compr)) {\n            s << CFlatData(compr);\n            return;\n        }\n        unsigned int nSize = script.size() + nSpecialScripts;\n        s << VARINT(nSize);\n        s << CFlatData(script);\n    }\n\n    template<typename Stream>\n    void Unserialize(Stream &s) {\n        unsigned int nSize = 0;\n        s >> VARINT(nSize);\n        if (nSize < nSpecialScripts) {\n            std::vector<unsigned char> vch(GetSpecialSize(nSize), 0x00);\n            s >> REF(CFlatData(vch));\n            Decompress(nSize, vch);\n            return;\n        }\n        nSize -= nSpecialScripts;\n        if (nSize > MAX_SCRIPT_SIZE) {\n            // Overly long script, replace with a short invalid one\n            script << OP_RETURN;\n            s.ignore(nSize);\n        } else {\n            script.resize(nSize);\n            s >> REF(CFlatData(script));\n        }\n    }\n};\n\n/** wrapper for CTxOut that provides a more compact serialization */\nclass CTxOutCompressor\n{\nprivate:\n    CTxOut &txout;\n\npublic:\n    static uint64_t CompressAmount(uint64_t nAmount);\n    static uint64_t DecompressAmount(uint64_t nAmount);\n\n    explicit CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        if (!ser_action.ForRead()) {\n            uint64_t nVal = CompressAmount(txout.nValue);\n            READWRITE(VARINT(nVal));\n        } else {\n            uint64_t nVal = 0;\n            READWRITE(VARINT(nVal));\n            txout.nValue = DecompressAmount(nVal);\n        }\n        CScriptCompressor cscript(REF(txout.scriptPubKey));\n        READWRITE(cscript);\n    }\n};\n\n#endif // BITCOIN_COMPRESSOR_H\n"
  },
  {
    "path": "src/config/.empty",
    "content": ""
  },
  {
    "path": "src/consensus/consensus.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CONSENSUS_CONSENSUS_H\n#define BITCOIN_CONSENSUS_CONSENSUS_H\n\n#include <stdlib.h>\n#include <stdint.h>\n\n/** The maximum allowed size for a serialized block, in bytes (only for buffer size limits) */\nstatic const unsigned int MAX_BLOCK_SERIALIZED_SIZE = 4000000;\n/** The maximum allowed weight for a block, see BIP 141 (network rule) */\nstatic const unsigned int MAX_BLOCK_WEIGHT = 4000000;\n/** The maximum allowed number of signature check operations in a block (network rule) */\nstatic const int64_t MAX_BLOCK_SIGOPS_COST = 80000;\n/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */\nstatic const int COINBASE_MATURITY = 100;\n\nstatic const int WITNESS_SCALE_FACTOR = 4;\n\nstatic const size_t MIN_TRANSACTION_WEIGHT = WITNESS_SCALE_FACTOR * 60; // 60 is the lower bound for the size of a valid serialized CTransaction\nstatic const size_t MIN_SERIALIZABLE_TRANSACTION_WEIGHT = WITNESS_SCALE_FACTOR * 10; // 10 is the lower bound for the size of a serialized CTransaction\n\n/** Flags for nSequence and nLockTime locks */\n/** Interpret sequence numbers as relative lock-time constraints. */\nstatic constexpr unsigned int LOCKTIME_VERIFY_SEQUENCE = (1 << 0);\n/** Use GetMedianTimePast() instead of nTime for end point timestamp. */\nstatic constexpr unsigned int LOCKTIME_MEDIAN_TIME_PAST = (1 << 1);\n\n#endif // BITCOIN_CONSENSUS_CONSENSUS_H\n"
  },
  {
    "path": "src/consensus/merkle.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <consensus/merkle.h>\n#include <hash.h>\n#include <utilstrencodings.h>\n\n/*     WARNING! If you're reading this because you're learning about crypto\n       and/or designing a new system that will use merkle trees, keep in mind\n       that the following merkle tree algorithm has a serious flaw related to\n       duplicate txids, resulting in a vulnerability (CVE-2012-2459).\n\n       The reason is that if the number of hashes in the list at a given time\n       is odd, the last one is duplicated before computing the next level (which\n       is unusual in Merkle trees). This results in certain sequences of\n       transactions leading to the same merkle root. For example, these two\n       trees:\n\n                    A               A\n                  /  \\            /   \\\n                B     C         B       C\n               / \\    |        / \\     / \\\n              D   E   F       D   E   F   F\n             / \\ / \\ / \\     / \\ / \\ / \\ / \\\n             1 2 3 4 5 6     1 2 3 4 5 6 5 6\n\n       for transaction lists [1,2,3,4,5,6] and [1,2,3,4,5,6,5,6] (where 5 and\n       6 are repeated) result in the same root hash A (because the hash of both\n       of (F) and (F,F) is C).\n\n       The vulnerability results from being able to send a block with such a\n       transaction list, with the same merkle root, and the same block hash as\n       the original without duplication, resulting in failed validation. If the\n       receiving node proceeds to mark that block as permanently invalid\n       however, it will fail to accept further unmodified (and thus potentially\n       valid) versions of the same block. We defend against this by detecting\n       the case where we would hash two identical hashes at the end of the list\n       together, and treating that identically to the block having an invalid\n       merkle root. Assuming no double-SHA256 collisions, this will detect all\n       known ways of changing the transactions without affecting the merkle\n       root.\n*/\n\n/* This implements a constant-space merkle root/path calculator, limited to 2^32 leaves. */\nstatic void MerkleComputation(const std::vector<uint256>& leaves, uint256* proot, bool* pmutated, uint32_t branchpos, std::vector<uint256>* pbranch) {\n    if (pbranch) pbranch->clear();\n    if (leaves.size() == 0) {\n        if (pmutated) *pmutated = false;\n        if (proot) *proot = uint256();\n        return;\n    }\n    bool mutated = false;\n    // count is the number of leaves processed so far.\n    uint32_t count = 0;\n    // inner is an array of eagerly computed subtree hashes, indexed by tree\n    // level (0 being the leaves).\n    // For example, when count is 25 (11001 in binary), inner[4] is the hash of\n    // the first 16 leaves, inner[3] of the next 8 leaves, and inner[0] equal to\n    // the last leaf. The other inner entries are undefined.\n    uint256 inner[32];\n    // Which position in inner is a hash that depends on the matching leaf.\n    int matchlevel = -1;\n    // First process all leaves into 'inner' values.\n    while (count < leaves.size()) {\n        uint256 h = leaves[count];\n        bool matchh = count == branchpos;\n        count++;\n        int level;\n        // For each of the lower bits in count that are 0, do 1 step. Each\n        // corresponds to an inner value that existed before processing the\n        // current leaf, and each needs a hash to combine it.\n        for (level = 0; !(count & (((uint32_t)1) << level)); level++) {\n            if (pbranch) {\n                if (matchh) {\n                    pbranch->push_back(inner[level]);\n                } else if (matchlevel == level) {\n                    pbranch->push_back(h);\n                    matchh = true;\n                }\n            }\n            mutated |= (inner[level] == h);\n            CHash256().Write(inner[level].begin(), 32).Write(h.begin(), 32).Finalize(h.begin());\n        }\n        // Store the resulting hash at inner position level.\n        inner[level] = h;\n        if (matchh) {\n            matchlevel = level;\n        }\n    }\n    // Do a final 'sweep' over the rightmost branch of the tree to process\n    // odd levels, and reduce everything to a single top value.\n    // Level is the level (counted from the bottom) up to which we've sweeped.\n    int level = 0;\n    // As long as bit number level in count is zero, skip it. It means there\n    // is nothing left at this level.\n    while (!(count & (((uint32_t)1) << level))) {\n        level++;\n    }\n    uint256 h = inner[level];\n    bool matchh = matchlevel == level;\n    while (count != (((uint32_t)1) << level)) {\n        // If we reach this point, h is an inner value that is not the top.\n        // We combine it with itself (Bitcoin's special rule for odd levels in\n        // the tree) to produce a higher level one.\n        if (pbranch && matchh) {\n            pbranch->push_back(h);\n        }\n        CHash256().Write(h.begin(), 32).Write(h.begin(), 32).Finalize(h.begin());\n        // Increment count to the value it would have if two entries at this\n        // level had existed.\n        count += (((uint32_t)1) << level);\n        level++;\n        // And propagate the result upwards accordingly.\n        while (!(count & (((uint32_t)1) << level))) {\n            if (pbranch) {\n                if (matchh) {\n                    pbranch->push_back(inner[level]);\n                } else if (matchlevel == level) {\n                    pbranch->push_back(h);\n                    matchh = true;\n                }\n            }\n            CHash256().Write(inner[level].begin(), 32).Write(h.begin(), 32).Finalize(h.begin());\n            level++;\n        }\n    }\n    // Return result.\n    if (pmutated) *pmutated = mutated;\n    if (proot) *proot = h;\n}\n\nuint256 ComputeMerkleRoot(const std::vector<uint256>& leaves, bool* mutated) {\n    uint256 hash;\n    MerkleComputation(leaves, &hash, mutated, -1, nullptr);\n    return hash;\n}\n\nstd::vector<uint256> ComputeMerkleBranch(const std::vector<uint256>& leaves, uint32_t position) {\n    std::vector<uint256> ret;\n    MerkleComputation(leaves, nullptr, nullptr, position, &ret);\n    return ret;\n}\n\nuint256 ComputeMerkleRootFromBranch(const uint256& leaf, const std::vector<uint256>& vMerkleBranch, uint32_t nIndex) {\n    uint256 hash = leaf;\n    for (std::vector<uint256>::const_iterator it = vMerkleBranch.begin(); it != vMerkleBranch.end(); ++it) {\n        if (nIndex & 1) {\n            hash = Hash(BEGIN(*it), END(*it), BEGIN(hash), END(hash));\n        } else {\n            hash = Hash(BEGIN(hash), END(hash), BEGIN(*it), END(*it));\n        }\n        nIndex >>= 1;\n    }\n    return hash;\n}\n\nuint256 BlockMerkleRoot(const CBlock& block, bool* mutated)\n{\n    std::vector<uint256> leaves;\n    leaves.resize(block.vtx.size());\n    for (size_t s = 0; s < block.vtx.size(); s++) {\n        leaves[s] = block.vtx[s]->GetHash();\n    }\n    return ComputeMerkleRoot(leaves, mutated);\n}\n\nuint256 BlockWitnessMerkleRoot(const CBlock& block, bool* mutated)\n{\n    std::vector<uint256> leaves;\n    leaves.resize(block.vtx.size());\n    leaves[0].SetNull(); // The witness hash of the coinbase is 0.\n    for (size_t s = 1; s < block.vtx.size(); s++) {\n        leaves[s] = block.vtx[s]->GetWitnessHash();\n    }\n    return ComputeMerkleRoot(leaves, mutated);\n}\n\nstd::vector<uint256> BlockMerkleBranch(const CBlock& block, uint32_t position)\n{\n    std::vector<uint256> leaves;\n    leaves.resize(block.vtx.size());\n    for (size_t s = 0; s < block.vtx.size(); s++) {\n        leaves[s] = block.vtx[s]->GetHash();\n    }\n    return ComputeMerkleBranch(leaves, position);\n}\n"
  },
  {
    "path": "src/consensus/merkle.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_MERKLE\n#define BITCOIN_MERKLE\n\n#include <stdint.h>\n#include <vector>\n\n#include <primitives/transaction.h>\n#include <primitives/block.h>\n#include <uint256.h>\n\nuint256 ComputeMerkleRoot(const std::vector<uint256>& leaves, bool* mutated = nullptr);\nstd::vector<uint256> ComputeMerkleBranch(const std::vector<uint256>& leaves, uint32_t position);\nuint256 ComputeMerkleRootFromBranch(const uint256& leaf, const std::vector<uint256>& branch, uint32_t position);\n\n/*\n * Compute the Merkle root of the transactions in a block.\n * *mutated is set to true if a duplicated subtree was found.\n */\nuint256 BlockMerkleRoot(const CBlock& block, bool* mutated = nullptr);\n\n/*\n * Compute the Merkle root of the witness transactions in a block.\n * *mutated is set to true if a duplicated subtree was found.\n */\nuint256 BlockWitnessMerkleRoot(const CBlock& block, bool* mutated = nullptr);\n\n/*\n * Compute the Merkle branch for the tree of transactions in a block, for a\n * given position.\n * This can be verified using ComputeMerkleRootFromBranch.\n */\nstd::vector<uint256> BlockMerkleBranch(const CBlock& block, uint32_t position);\n\n#endif\n"
  },
  {
    "path": "src/consensus/params.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CONSENSUS_PARAMS_H\n#define BITCOIN_CONSENSUS_PARAMS_H\n\n#include <uint256.h>\n#include <limits>\n#include <map>\n#include <string>\n\n#include <boost/optional.hpp> // DigiShieldZEC\n\nnamespace Consensus {\n\nenum DeploymentPos\n{\n    DEPLOYMENT_TESTDUMMY,\n    DEPLOYMENT_CSV, // Deployment of BIP68, BIP112, and BIP113.\n    DEPLOYMENT_SEGWIT, // Deployment of BIP141, BIP143, and BIP147.\n    // NOTE: Also add new deployments to VersionBitsDeploymentInfo in versionbits.cpp\n    MAX_VERSION_BITS_DEPLOYMENTS\n};\n\n/**\n * Struct for each individual consensus rule change using BIP9.\n */\nstruct BIP9Deployment {\n    /** Bit position to select the particular bit in nVersion. */\n    int bit;\n    /** Start MedianTime for version bits miner confirmation. Can be a date in the past */\n    int64_t nStartTime;\n    /** Timeout/expiry MedianTime for the deployment attempt. */\n    int64_t nTimeout;\n\n    /** Constant for nTimeout very far in the future. */\n    static constexpr int64_t NO_TIMEOUT = std::numeric_limits<int64_t>::max();\n\n    /** Special value for nStartTime indicating that the deployment is always active.\n     *  This is useful for testing, as it means tests don't need to deal with the activation\n     *  process (which takes at least 3 BIP9 intervals). Only tests that specifically test the\n     *  behaviour during activation cannot use this. */\n    static constexpr int64_t ALWAYS_ACTIVE = -1;\n};\n\n/**\n * Parameters that influence chain consensus.\n */\nstruct Params {\n    uint256 hashGenesisBlock;\n    int nSubsidyHalvingInterval;\n    /** Block height at which BIP16 becomes active */\n    int BIP16Height;\n    /** Block height and hash at which BIP34 becomes active */\n    int BIP34Height;\n    uint256 BIP34Hash;\n    /** Block height at which BIP65 becomes active */\n    int BIP65Height;\n    /** Block height at which BIP66 becomes active */\n    int BIP66Height;\n    /**\n     * Minimum blocks including miner confirmation of the total of 2016 blocks in a retargeting period,\n     * (nPowTargetTimespan / nPowTargetSpacing) which is also used for BIP9 deployments.\n     * Examples: 1916 for 95%, 1512 for testchains.\n     */\n    uint32_t nRuleChangeActivationThreshold;\n    uint32_t nMinerConfirmationWindow;\n    BIP9Deployment vDeployments[MAX_VERSION_BITS_DEPLOYMENTS];\n    /** Proof of work parameters */\n    uint256 powLimit;\n    bool fPowAllowMinDifficultyBlocks;\n    bool fPowNoRetargeting;\n    int64_t nPowTargetSpacing;\n    int64_t nPowTargetTimespan;\n    int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; }\n    uint256 nMinimumChainWork;\n    uint256 defaultAssumeValid;\n    \n    // DigiShieldZEC\n    boost::optional<uint32_t> nPowAllowMinDifficultyBlocksAfterHeight;\n    int64_t nPowAveragingWindow;\n    int64_t AveragingWindowTimespan() const { return nPowAveragingWindow * nPowTargetSpacing; }\n    int64_t MinActualTimespan() const { return (AveragingWindowTimespan() * (100 - nPowMaxAdjustUp  )) / 100; }\n    int64_t MaxActualTimespan() const { return (AveragingWindowTimespan() * (100 + nPowMaxAdjustDown)) / 100; }\n    int64_t nPowMaxAdjustDown;\n    int64_t nPowMaxAdjustUp;\n};\n} // namespace Consensus\n\n#endif // BITCOIN_CONSENSUS_PARAMS_H\n"
  },
  {
    "path": "src/consensus/tx_verify.cpp",
    "content": "// Copyright (c) 2017-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <consensus/tx_verify.h>\n\n#include <consensus/consensus.h>\n#include <primitives/transaction.h>\n#include <script/interpreter.h>\n#include <consensus/validation.h>\n\n// TODO remove the following dependencies\n#include <chain.h>\n#include <coins.h>\n#include <utilmoneystr.h>\n\nbool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime)\n{\n    if (tx.nLockTime == 0)\n        return true;\n    if ((int64_t)tx.nLockTime < ((int64_t)tx.nLockTime < LOCKTIME_THRESHOLD ? (int64_t)nBlockHeight : nBlockTime))\n        return true;\n    for (const auto& txin : tx.vin) {\n        if (!(txin.nSequence == CTxIn::SEQUENCE_FINAL))\n            return false;\n    }\n    return true;\n}\n\nstd::pair<int, int64_t> CalculateSequenceLocks(const CTransaction &tx, int flags, std::vector<int>* prevHeights, const CBlockIndex& block)\n{\n    assert(prevHeights->size() == tx.vin.size());\n\n    // Will be set to the equivalent height- and time-based nLockTime\n    // values that would be necessary to satisfy all relative lock-\n    // time constraints given our view of block chain history.\n    // The semantics of nLockTime are the last invalid height/time, so\n    // use -1 to have the effect of any height or time being valid.\n    int nMinHeight = -1;\n    int64_t nMinTime = -1;\n\n    // tx.nVersion is signed integer so requires cast to unsigned otherwise\n    // we would be doing a signed comparison and half the range of nVersion\n    // wouldn't support BIP 68.\n    bool fEnforceBIP68 = static_cast<uint32_t>(tx.nVersion) >= 2\n                      && flags & LOCKTIME_VERIFY_SEQUENCE;\n\n    // Do not enforce sequence numbers as a relative lock time\n    // unless we have been instructed to\n    if (!fEnforceBIP68) {\n        return std::make_pair(nMinHeight, nMinTime);\n    }\n\n    for (size_t txinIndex = 0; txinIndex < tx.vin.size(); txinIndex++) {\n        const CTxIn& txin = tx.vin[txinIndex];\n\n        // Sequence numbers with the most significant bit set are not\n        // treated as relative lock-times, nor are they given any\n        // consensus-enforced meaning at this point.\n        if (txin.nSequence & CTxIn::SEQUENCE_LOCKTIME_DISABLE_FLAG) {\n            // The height of this input is not relevant for sequence locks\n            (*prevHeights)[txinIndex] = 0;\n            continue;\n        }\n\n        int nCoinHeight = (*prevHeights)[txinIndex];\n\n        if (txin.nSequence & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) {\n            int64_t nCoinTime = block.GetAncestor(std::max(nCoinHeight-1, 0))->GetMedianTimePast();\n            // NOTE: Subtract 1 to maintain nLockTime semantics\n            // BIP 68 relative lock times have the semantics of calculating\n            // the first block or time at which the transaction would be\n            // valid. When calculating the effective block time or height\n            // for the entire transaction, we switch to using the\n            // semantics of nLockTime which is the last invalid block\n            // time or height.  Thus we subtract 1 from the calculated\n            // time or height.\n\n            // Time-based relative lock-times are measured from the\n            // smallest allowed timestamp of the block containing the\n            // txout being spent, which is the median time past of the\n            // block prior.\n            nMinTime = std::max(nMinTime, nCoinTime + (int64_t)((txin.nSequence & CTxIn::SEQUENCE_LOCKTIME_MASK) << CTxIn::SEQUENCE_LOCKTIME_GRANULARITY) - 1);\n        } else {\n            nMinHeight = std::max(nMinHeight, nCoinHeight + (int)(txin.nSequence & CTxIn::SEQUENCE_LOCKTIME_MASK) - 1);\n        }\n    }\n\n    return std::make_pair(nMinHeight, nMinTime);\n}\n\nbool EvaluateSequenceLocks(const CBlockIndex& block, std::pair<int, int64_t> lockPair)\n{\n    assert(block.pprev);\n    int64_t nBlockTime = block.pprev->GetMedianTimePast();\n    if (lockPair.first >= block.nHeight || lockPair.second >= nBlockTime)\n        return false;\n\n    return true;\n}\n\nbool SequenceLocks(const CTransaction &tx, int flags, std::vector<int>* prevHeights, const CBlockIndex& block)\n{\n    return EvaluateSequenceLocks(block, CalculateSequenceLocks(tx, flags, prevHeights, block));\n}\n\nunsigned int GetLegacySigOpCount(const CTransaction& tx)\n{\n    unsigned int nSigOps = 0;\n    for (const auto& txin : tx.vin)\n    {\n        nSigOps += txin.scriptSig.GetSigOpCount(false);\n    }\n    for (const auto& txout : tx.vout)\n    {\n        nSigOps += txout.scriptPubKey.GetSigOpCount(false);\n    }\n    return nSigOps;\n}\n\nunsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& inputs)\n{\n    if (tx.IsCoinBase())\n        return 0;\n\n    unsigned int nSigOps = 0;\n    for (unsigned int i = 0; i < tx.vin.size(); i++)\n    {\n        const Coin& coin = inputs.AccessCoin(tx.vin[i].prevout);\n        assert(!coin.IsSpent());\n        const CTxOut &prevout = coin.out;\n        if (prevout.scriptPubKey.IsPayToScriptHash())\n            nSigOps += prevout.scriptPubKey.GetSigOpCount(tx.vin[i].scriptSig);\n    }\n    return nSigOps;\n}\n\nint64_t GetTransactionSigOpCost(const CTransaction& tx, const CCoinsViewCache& inputs, int flags)\n{\n    int64_t nSigOps = GetLegacySigOpCount(tx) * WITNESS_SCALE_FACTOR;\n\n    if (tx.IsCoinBase())\n        return nSigOps;\n\n    if (flags & SCRIPT_VERIFY_P2SH) {\n        nSigOps += GetP2SHSigOpCount(tx, inputs) * WITNESS_SCALE_FACTOR;\n    }\n\n    for (unsigned int i = 0; i < tx.vin.size(); i++)\n    {\n        const Coin& coin = inputs.AccessCoin(tx.vin[i].prevout);\n        assert(!coin.IsSpent());\n        const CTxOut &prevout = coin.out;\n        nSigOps += CountWitnessSigOps(tx.vin[i].scriptSig, prevout.scriptPubKey, &tx.vin[i].scriptWitness, flags);\n    }\n    return nSigOps;\n}\n\nbool CheckTransaction(const CTransaction& tx, CValidationState &state, bool fCheckDuplicateInputs)\n{\n    // Basic checks that don't depend on any context\n    if (tx.vin.empty())\n        return state.DoS(10, false, REJECT_INVALID, \"bad-txns-vin-empty\");\n    if (tx.vout.empty())\n        return state.DoS(10, false, REJECT_INVALID, \"bad-txns-vout-empty\");\n    // Size limits (this doesn't take the witness into account, as that hasn't been checked for malleability)\n    if (::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT)\n        return state.DoS(100, false, REJECT_INVALID, \"bad-txns-oversize\");\n\n    // Check for negative or overflow output values\n    CAmount nValueOut = 0;\n    for (const auto& txout : tx.vout)\n    {\n        if (txout.nValue < 0)\n            return state.DoS(100, false, REJECT_INVALID, \"bad-txns-vout-negative\");\n        if (txout.nValue > MAX_MONEY)\n            return state.DoS(100, false, REJECT_INVALID, \"bad-txns-vout-toolarge\");\n        nValueOut += txout.nValue;\n        if (!MoneyRange(nValueOut))\n            return state.DoS(100, false, REJECT_INVALID, \"bad-txns-txouttotal-toolarge\");\n    }\n\n    // Check for duplicate inputs - note that this check is slow so we skip it in CheckBlock\n    if (fCheckDuplicateInputs) {\n        std::set<COutPoint> vInOutPoints;\n        for (const auto& txin : tx.vin)\n        {\n            if (!vInOutPoints.insert(txin.prevout).second)\n                return state.DoS(100, false, REJECT_INVALID, \"bad-txns-inputs-duplicate\");\n        }\n    }\n\n    if (tx.IsCoinBase())\n    {\n        if (tx.vin[0].scriptSig.size() < 2 || tx.vin[0].scriptSig.size() > 100)\n            return state.DoS(100, false, REJECT_INVALID, \"bad-cb-length\");\n    }\n    else\n    {\n        for (const auto& txin : tx.vin)\n            if (txin.prevout.IsNull())\n                return state.DoS(10, false, REJECT_INVALID, \"bad-txns-prevout-null\");\n    }\n\n    return true;\n}\n\nbool Consensus::CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight, CAmount& txfee)\n{\n    // are the actual inputs available?\n    if (!inputs.HaveInputs(tx)) {\n        return state.DoS(100, false, REJECT_INVALID, \"bad-txns-inputs-missingorspent\", false,\n                         strprintf(\"%s: inputs missing/spent\", __func__));\n    }\n\n    CAmount nValueIn = 0;\n    for (unsigned int i = 0; i < tx.vin.size(); ++i) {\n        const COutPoint &prevout = tx.vin[i].prevout;\n        const Coin& coin = inputs.AccessCoin(prevout);\n        assert(!coin.IsSpent());\n\n        // If prev is coinbase, check that it's matured\n        if (coin.IsCoinBase() && nSpendHeight - coin.nHeight < COINBASE_MATURITY) {\n            return state.Invalid(false,\n                REJECT_INVALID, \"bad-txns-premature-spend-of-coinbase\",\n                strprintf(\"tried to spend coinbase at depth %d\", nSpendHeight - coin.nHeight));\n        }\n\n        // Check for negative or overflow input values\n        nValueIn += coin.out.nValue;\n        if (!MoneyRange(coin.out.nValue) || !MoneyRange(nValueIn)) {\n            return state.DoS(100, false, REJECT_INVALID, \"bad-txns-inputvalues-outofrange\");\n        }\n    }\n\n    const CAmount value_out = tx.GetValueOut();\n    if (nValueIn < value_out) {\n        return state.DoS(100, false, REJECT_INVALID, \"bad-txns-in-belowout\", false,\n            strprintf(\"value in (%s) < value out (%s)\", FormatMoney(nValueIn), FormatMoney(value_out)));\n    }\n\n    // Tally transaction fees\n    const CAmount txfee_aux = nValueIn - value_out;\n    if (!MoneyRange(txfee_aux)) {\n        return state.DoS(100, false, REJECT_INVALID, \"bad-txns-fee-outofrange\");\n    }\n\n    txfee = txfee_aux;\n    return true;\n}\n"
  },
  {
    "path": "src/consensus/tx_verify.h",
    "content": "// Copyright (c) 2017-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CONSENSUS_TX_VERIFY_H\n#define BITCOIN_CONSENSUS_TX_VERIFY_H\n\n#include <amount.h>\n\n#include <stdint.h>\n#include <vector>\n\nclass CBlockIndex;\nclass CCoinsViewCache;\nclass CTransaction;\nclass CValidationState;\n\n/** Transaction validation functions */\n\n/** Context-independent validity checks */\nbool CheckTransaction(const CTransaction& tx, CValidationState& state, bool fCheckDuplicateInputs=true);\n\nnamespace Consensus {\n/**\n * Check whether all inputs of this transaction are valid (no double spends and amounts)\n * This does not modify the UTXO set. This does not check scripts and sigs.\n * @param[out] txfee Set to the transaction fee if successful.\n * Preconditions: tx.IsCoinBase() is false.\n */\nbool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoinsViewCache& inputs, int nSpendHeight, CAmount& txfee);\n} // namespace Consensus\n\n/** Auxiliary functions for transaction validation (ideally should not be exposed) */\n\n/**\n * Count ECDSA signature operations the old-fashioned (pre-0.6) way\n * @return number of sigops this transaction's outputs will produce when spent\n * @see CTransaction::FetchInputs\n */\nunsigned int GetLegacySigOpCount(const CTransaction& tx);\n\n/**\n * Count ECDSA signature operations in pay-to-script-hash inputs.\n * \n * @param[in] mapInputs Map of previous transactions that have outputs we're spending\n * @return maximum number of sigops required to validate this transaction's inputs\n * @see CTransaction::FetchInputs\n */\nunsigned int GetP2SHSigOpCount(const CTransaction& tx, const CCoinsViewCache& mapInputs);\n\n/**\n * Compute total signature operation cost of a transaction.\n * @param[in] tx     Transaction for which we are computing the cost\n * @param[in] inputs Map of previous transactions that have outputs we're spending\n * @param[out] flags Script verification flags\n * @return Total signature operation cost of tx\n */\nint64_t GetTransactionSigOpCost(const CTransaction& tx, const CCoinsViewCache& inputs, int flags);\n\n/**\n * Check if transaction is final and can be included in a block with the\n * specified height and time. Consensus critical.\n */\nbool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime);\n\n/**\n * Calculates the block height and previous block's median time past at\n * which the transaction will be considered final in the context of BIP 68.\n * Also removes from the vector of input heights any entries which did not\n * correspond to sequence locked inputs as they do not affect the calculation.\n */\nstd::pair<int, int64_t> CalculateSequenceLocks(const CTransaction &tx, int flags, std::vector<int>* prevHeights, const CBlockIndex& block);\n\nbool EvaluateSequenceLocks(const CBlockIndex& block, std::pair<int, int64_t> lockPair);\n/**\n * Check if transaction is final per BIP 68 sequence numbers and can be included in a block.\n * Consensus critical. Takes as input a list of heights at which tx's inputs (in order) confirmed.\n */\nbool SequenceLocks(const CTransaction &tx, int flags, std::vector<int>* prevHeights, const CBlockIndex& block);\n\n#endif // BITCOIN_CONSENSUS_TX_VERIFY_H\n"
  },
  {
    "path": "src/consensus/validation.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CONSENSUS_VALIDATION_H\n#define BITCOIN_CONSENSUS_VALIDATION_H\n\n#include <string>\n#include <version.h>\n#include <consensus/consensus.h>\n#include <primitives/transaction.h>\n#include <primitives/block.h>\n\n/** \"reject\" message codes */\nstatic const unsigned char REJECT_MALFORMED = 0x01;\nstatic const unsigned char REJECT_INVALID = 0x10;\nstatic const unsigned char REJECT_OBSOLETE = 0x11;\nstatic const unsigned char REJECT_DUPLICATE = 0x12;\nstatic const unsigned char REJECT_NONSTANDARD = 0x40;\n// static const unsigned char REJECT_DUST = 0x41; // part of BIP 61\nstatic const unsigned char REJECT_INSUFFICIENTFEE = 0x42;\nstatic const unsigned char REJECT_CHECKPOINT = 0x43;\n\n/** Capture information about block/transaction validation */\nclass CValidationState {\nprivate:\n    enum mode_state {\n        MODE_VALID,   //!< everything ok\n        MODE_INVALID, //!< network rule violation (DoS value may be set)\n        MODE_ERROR,   //!< run-time error\n    } mode;\n    int nDoS;\n    std::string strRejectReason;\n    unsigned int chRejectCode;\n    bool corruptionPossible;\n    std::string strDebugMessage;\npublic:\n    CValidationState() : mode(MODE_VALID), nDoS(0), chRejectCode(0), corruptionPossible(false) {}\n    bool DoS(int level, bool ret = false,\n             unsigned int chRejectCodeIn=0, const std::string &strRejectReasonIn=\"\",\n             bool corruptionIn=false,\n             const std::string &strDebugMessageIn=\"\") {\n        chRejectCode = chRejectCodeIn;\n        strRejectReason = strRejectReasonIn;\n        corruptionPossible = corruptionIn;\n        strDebugMessage = strDebugMessageIn;\n        if (mode == MODE_ERROR)\n            return ret;\n        nDoS += level;\n        mode = MODE_INVALID;\n        return ret;\n    }\n    bool Invalid(bool ret = false,\n                 unsigned int _chRejectCode=0, const std::string &_strRejectReason=\"\",\n                 const std::string &_strDebugMessage=\"\") {\n        return DoS(0, ret, _chRejectCode, _strRejectReason, false, _strDebugMessage);\n    }\n    bool Error(const std::string& strRejectReasonIn) {\n        if (mode == MODE_VALID)\n            strRejectReason = strRejectReasonIn;\n        mode = MODE_ERROR;\n        return false;\n    }\n    bool IsValid() const {\n        return mode == MODE_VALID;\n    }\n    bool IsInvalid() const {\n        return mode == MODE_INVALID;\n    }\n    bool IsError() const {\n        return mode == MODE_ERROR;\n    }\n    bool IsInvalid(int &nDoSOut) const {\n        if (IsInvalid()) {\n            nDoSOut = nDoS;\n            return true;\n        }\n        return false;\n    }\n    bool CorruptionPossible() const {\n        return corruptionPossible;\n    }\n    void SetCorruptionPossible() {\n        corruptionPossible = true;\n    }\n    unsigned int GetRejectCode() const { return chRejectCode; }\n    std::string GetRejectReason() const { return strRejectReason; }\n    std::string GetDebugMessage() const { return strDebugMessage; }\n};\n\n// These implement the weight = (stripped_size * 4) + witness_size formula,\n// using only serialization with and without witness data. As witness_size\n// is equal to total_size - stripped_size, this formula is identical to:\n// weight = (stripped_size * 3) + total_size.\nstatic inline int64_t GetTransactionWeight(const CTransaction& tx)\n{\n    return ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);\n}\nstatic inline int64_t GetBlockWeight(const CBlock& block)\n{\n    return ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * (WITNESS_SCALE_FACTOR - 1) + ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION);\n}\n\n#endif // BITCOIN_CONSENSUS_VALIDATION_H\n"
  },
  {
    "path": "src/core_io.h",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CORE_IO_H\n#define BITCOIN_CORE_IO_H\n\n#include <amount.h>\n\n#include <string>\n#include <vector>\n\nclass CBlock;\nclass CScript;\nclass CTransaction;\nstruct CMutableTransaction;\nclass uint256;\nclass UniValue;\n\n// core_read.cpp\nCScript ParseScript(const std::string& s);\nstd::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode = false);\nbool DecodeHexTx(CMutableTransaction& tx, const std::string& hex_tx, bool try_no_witness = false, bool try_witness = true);\nbool DecodeHexBlk(CBlock&, const std::string& strHexBlk);\nuint256 ParseHashUV(const UniValue& v, const std::string& strName);\nuint256 ParseHashStr(const std::string&, const std::string& strName);\nstd::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName);\n\n// core_write.cpp\nUniValue ValueFromAmount(const CAmount& amount);\nstd::string FormatScript(const CScript& script);\nstd::string EncodeHexTx(const CTransaction& tx, const int serializeFlags = 0);\nvoid ScriptPubKeyToUniv(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);\nvoid TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex = true, int serialize_flags = 0);\n\n#endif // BITCOIN_CORE_IO_H\n"
  },
  {
    "path": "src/core_memusage.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CORE_MEMUSAGE_H\n#define BITCOIN_CORE_MEMUSAGE_H\n\n#include <primitives/transaction.h>\n#include <primitives/block.h>\n#include <memusage.h>\n\nstatic inline size_t RecursiveDynamicUsage(const CScript& script) {\n    return memusage::DynamicUsage(script);\n}\n\nstatic inline size_t RecursiveDynamicUsage(const COutPoint& out) {\n    return 0;\n}\n\nstatic inline size_t RecursiveDynamicUsage(const CTxIn& in) {\n    size_t mem = RecursiveDynamicUsage(in.scriptSig) + RecursiveDynamicUsage(in.prevout) + memusage::DynamicUsage(in.scriptWitness.stack);\n    for (std::vector<std::vector<unsigned char> >::const_iterator it = in.scriptWitness.stack.begin(); it != in.scriptWitness.stack.end(); it++) {\n         mem += memusage::DynamicUsage(*it);\n    }\n    return mem;\n}\n\nstatic inline size_t RecursiveDynamicUsage(const CTxOut& out) {\n    return RecursiveDynamicUsage(out.scriptPubKey);\n}\n\nstatic inline size_t RecursiveDynamicUsage(const CTransaction& tx) {\n    size_t mem = memusage::DynamicUsage(tx.vin) + memusage::DynamicUsage(tx.vout);\n    for (std::vector<CTxIn>::const_iterator it = tx.vin.begin(); it != tx.vin.end(); it++) {\n        mem += RecursiveDynamicUsage(*it);\n    }\n    for (std::vector<CTxOut>::const_iterator it = tx.vout.begin(); it != tx.vout.end(); it++) {\n        mem += RecursiveDynamicUsage(*it);\n    }\n    return mem;\n}\n\nstatic inline size_t RecursiveDynamicUsage(const CMutableTransaction& tx) {\n    size_t mem = memusage::DynamicUsage(tx.vin) + memusage::DynamicUsage(tx.vout);\n    for (std::vector<CTxIn>::const_iterator it = tx.vin.begin(); it != tx.vin.end(); it++) {\n        mem += RecursiveDynamicUsage(*it);\n    }\n    for (std::vector<CTxOut>::const_iterator it = tx.vout.begin(); it != tx.vout.end(); it++) {\n        mem += RecursiveDynamicUsage(*it);\n    }\n    return mem;\n}\n\nstatic inline size_t RecursiveDynamicUsage(const CBlock& block) {\n    size_t mem = memusage::DynamicUsage(block.vtx);\n    for (const auto& tx : block.vtx) {\n        mem += memusage::DynamicUsage(tx) + RecursiveDynamicUsage(*tx);\n    }\n    return mem;\n}\n\nstatic inline size_t RecursiveDynamicUsage(const CBlockLocator& locator) {\n    return memusage::DynamicUsage(locator.vHave);\n}\n\ntemplate<typename X>\nstatic inline size_t RecursiveDynamicUsage(const std::shared_ptr<X>& p) {\n    return p ? memusage::DynamicUsage(p) + RecursiveDynamicUsage(*p) : 0;\n}\n\n#endif // BITCOIN_CORE_MEMUSAGE_H\n"
  },
  {
    "path": "src/core_read.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <core_io.h>\n\n#include <primitives/block.h>\n#include <primitives/transaction.h>\n#include <script/script.h>\n#include <serialize.h>\n#include <streams.h>\n#include <univalue.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <version.h>\n\n#include <boost/algorithm/string/classification.hpp>\n#include <boost/algorithm/string/predicate.hpp>\n#include <boost/algorithm/string/replace.hpp>\n#include <boost/algorithm/string/split.hpp>\n\nCScript ParseScript(const std::string& s)\n{\n    CScript result;\n\n    static std::map<std::string, opcodetype> mapOpNames;\n\n    if (mapOpNames.empty())\n    {\n        for (unsigned int op = 0; op <= MAX_OPCODE; op++)\n        {\n            // Allow OP_RESERVED to get into mapOpNames\n            if (op < OP_NOP && op != OP_RESERVED)\n                continue;\n\n            const char* name = GetOpName((opcodetype)op);\n            if (strcmp(name, \"OP_UNKNOWN\") == 0)\n                continue;\n            std::string strName(name);\n            mapOpNames[strName] = (opcodetype)op;\n            // Convenience: OP_ADD and just ADD are both recognized:\n            boost::algorithm::replace_first(strName, \"OP_\", \"\");\n            mapOpNames[strName] = (opcodetype)op;\n        }\n    }\n\n    std::vector<std::string> words;\n    boost::algorithm::split(words, s, boost::algorithm::is_any_of(\" \\t\\n\"), boost::algorithm::token_compress_on);\n\n    for (std::vector<std::string>::const_iterator w = words.begin(); w != words.end(); ++w)\n    {\n        if (w->empty())\n        {\n            // Empty string, ignore. (boost::split given '' will return one word)\n        }\n        else if (all(*w, boost::algorithm::is_digit()) ||\n            (boost::algorithm::starts_with(*w, \"-\") && all(std::string(w->begin()+1, w->end()), boost::algorithm::is_digit())))\n        {\n            // Number\n            int64_t n = atoi64(*w);\n            result << n;\n        }\n        else if (boost::algorithm::starts_with(*w, \"0x\") && (w->begin()+2 != w->end()) && IsHex(std::string(w->begin()+2, w->end())))\n        {\n            // Raw hex data, inserted NOT pushed onto stack:\n            std::vector<unsigned char> raw = ParseHex(std::string(w->begin()+2, w->end()));\n            result.insert(result.end(), raw.begin(), raw.end());\n        }\n        else if (w->size() >= 2 && boost::algorithm::starts_with(*w, \"'\") && boost::algorithm::ends_with(*w, \"'\"))\n        {\n            // Single-quoted string, pushed as data. NOTE: this is poor-man's\n            // parsing, spaces/tabs/newlines in single-quoted strings won't work.\n            std::vector<unsigned char> value(w->begin()+1, w->end()-1);\n            result << value;\n        }\n        else if (mapOpNames.count(*w))\n        {\n            // opcode, e.g. OP_ADD or ADD:\n            result << mapOpNames[*w];\n        }\n        else\n        {\n            throw std::runtime_error(\"script parse error\");\n        }\n    }\n\n    return result;\n}\n\n// Check that all of the input and output scripts of a transaction contains valid opcodes\nbool CheckTxScriptsSanity(const CMutableTransaction& tx)\n{\n    // Check input scripts for non-coinbase txs\n    if (!CTransaction(tx).IsCoinBase()) {\n        for (unsigned int i = 0; i < tx.vin.size(); i++) {\n            if (!tx.vin[i].scriptSig.HasValidOps() || tx.vin[i].scriptSig.size() > MAX_SCRIPT_SIZE) {\n                return false;\n            }\n        }\n    }\n    // Check output scripts\n    for (unsigned int i = 0; i < tx.vout.size(); i++) {\n        if (!tx.vout[i].scriptPubKey.HasValidOps() || tx.vout[i].scriptPubKey.size() > MAX_SCRIPT_SIZE) {\n            return false;\n        }\n    }\n    \n    return true;\n}\n\nbool DecodeHexTx(CMutableTransaction& tx, const std::string& hex_tx, bool try_no_witness, bool try_witness)\n{\n    if (!IsHex(hex_tx)) {\n        return false;\n    }\n\n    std::vector<unsigned char> txData(ParseHex(hex_tx));\n\n    if (try_no_witness) {\n        CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS);\n        try {\n            ssData >> tx;\n            if (ssData.eof() && (!try_witness || CheckTxScriptsSanity(tx))) {\n                return true;\n            }\n        } catch (const std::exception&) {\n            // Fall through.\n        }\n    }\n\n    if (try_witness) {\n        CDataStream ssData(txData, SER_NETWORK, PROTOCOL_VERSION);\n        try {\n            ssData >> tx;\n            if (ssData.empty()) {\n                return true;\n            }\n        } catch (const std::exception&) {\n            // Fall through.\n        }\n    }\n    \n    return false;\n}\n\nbool DecodeHexBlk(CBlock& block, const std::string& strHexBlk)\n{\n    if (!IsHex(strHexBlk))\n        return false;\n\n    std::vector<unsigned char> blockData(ParseHex(strHexBlk));\n    CDataStream ssBlock(blockData, SER_NETWORK, PROTOCOL_VERSION);\n    try {\n        ssBlock >> block;\n    }\n    catch (const std::exception&) {\n        return false;\n    }\n\n    return true;\n}\n\nuint256 ParseHashUV(const UniValue& v, const std::string& strName)\n{\n    std::string strHex;\n    if (v.isStr())\n        strHex = v.getValStr();\n    return ParseHashStr(strHex, strName);  // Note: ParseHashStr(\"\") throws a runtime_error\n}\n\nuint256 ParseHashStr(const std::string& strHex, const std::string& strName)\n{\n    if (!IsHex(strHex)) // Note: IsHex(\"\") is false\n        throw std::runtime_error(strName + \" must be hexadecimal string (not '\" + strHex + \"')\");\n\n    uint256 result;\n    result.SetHex(strHex);\n    return result;\n}\n\nstd::vector<unsigned char> ParseHexUV(const UniValue& v, const std::string& strName)\n{\n    std::string strHex;\n    if (v.isStr())\n        strHex = v.getValStr();\n    if (!IsHex(strHex))\n        throw std::runtime_error(strName + \" must be hexadecimal string (not '\" + strHex + \"')\");\n    return ParseHex(strHex);\n}\n"
  },
  {
    "path": "src/core_write.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <core_io.h>\n\n#include <base58.h>\n#include <consensus/consensus.h>\n#include <consensus/validation.h>\n#include <script/script.h>\n#include <script/standard.h>\n#include <serialize.h>\n#include <streams.h>\n#include <univalue.h>\n#include <util.h>\n#include <utilmoneystr.h>\n#include <utilstrencodings.h>\n\nUniValue ValueFromAmount(const CAmount& amount)\n{\n    bool sign = amount < 0;\n    int64_t n_abs = (sign ? -amount : amount);\n    int64_t quotient = n_abs / COIN;\n    int64_t remainder = n_abs % COIN;\n    return UniValue(UniValue::VNUM,\n            strprintf(\"%s%d.%08d\", sign ? \"-\" : \"\", quotient, remainder));\n}\n\nstd::string FormatScript(const CScript& script)\n{\n    std::string ret;\n    CScript::const_iterator it = script.begin();\n    opcodetype op;\n    while (it != script.end()) {\n        CScript::const_iterator it2 = it;\n        std::vector<unsigned char> vch;\n        if (script.GetOp2(it, op, &vch)) {\n            if (op == OP_0) {\n                ret += \"0 \";\n                continue;\n            } else if ((op >= OP_1 && op <= OP_16) || op == OP_1NEGATE) {\n                ret += strprintf(\"%i \", op - OP_1NEGATE - 1);\n                continue;\n            } else if (op >= OP_NOP && op <= OP_NOP10) {\n                std::string str(GetOpName(op));\n                if (str.substr(0, 3) == std::string(\"OP_\")) {\n                    ret += str.substr(3, std::string::npos) + \" \";\n                    continue;\n                }\n            }\n            if (vch.size() > 0) {\n                ret += strprintf(\"0x%x 0x%x \", HexStr(it2, it - vch.size()), HexStr(it - vch.size(), it));\n            } else {\n                ret += strprintf(\"0x%x \", HexStr(it2, it));\n            }\n            continue;\n        }\n        ret += strprintf(\"0x%x \", HexStr(it2, script.end()));\n        break;\n    }\n    return ret.substr(0, ret.size() - 1);\n}\n\nconst std::map<unsigned char, std::string> mapSigHashTypes = {\n    {static_cast<unsigned char>(SIGHASH_ALL), std::string(\"ALL\")},\n    {static_cast<unsigned char>(SIGHASH_ALL|SIGHASH_ANYONECANPAY), std::string(\"ALL|ANYONECANPAY\")},\n    {static_cast<unsigned char>(SIGHASH_NONE), std::string(\"NONE\")},\n    {static_cast<unsigned char>(SIGHASH_NONE|SIGHASH_ANYONECANPAY), std::string(\"NONE|ANYONECANPAY\")},\n    {static_cast<unsigned char>(SIGHASH_SINGLE), std::string(\"SINGLE\")},\n    {static_cast<unsigned char>(SIGHASH_SINGLE|SIGHASH_ANYONECANPAY), std::string(\"SINGLE|ANYONECANPAY\")},\n};\n\n/**\n * Create the assembly string representation of a CScript object.\n * @param[in] script    CScript object to convert into the asm string representation.\n * @param[in] fAttemptSighashDecode    Whether to attempt to decode sighash types on data within the script that matches the format\n *                                     of a signature. Only pass true for scripts you believe could contain signatures. For example,\n *                                     pass false, or omit the this argument (defaults to false), for scriptPubKeys.\n */\nstd::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDecode)\n{\n    std::string str;\n    opcodetype opcode;\n    std::vector<unsigned char> vch;\n    CScript::const_iterator pc = script.begin();\n    while (pc < script.end()) {\n        if (!str.empty()) {\n            str += \" \";\n        }\n        if (!script.GetOp(pc, opcode, vch)) {\n            str += \"[error]\";\n            return str;\n        }\n        if (0 <= opcode && opcode <= OP_PUSHDATA4) {\n            if (vch.size() <= static_cast<std::vector<unsigned char>::size_type>(4)) {\n                str += strprintf(\"%d\", CScriptNum(vch, false).getint());\n            } else {\n                // the IsUnspendable check makes sure not to try to decode OP_RETURN data that may match the format of a signature\n                if (fAttemptSighashDecode && !script.IsUnspendable()) {\n                    std::string strSigHashDecode;\n                    // goal: only attempt to decode a defined sighash type from data that looks like a signature within a scriptSig.\n                    // this won't decode correctly formatted public keys in Pubkey or Multisig scripts due to\n                    // the restrictions on the pubkey formats (see IsCompressedOrUncompressedPubKey) being incongruous with the\n                    // checks in CheckSignatureEncoding.\n                    if (CheckSignatureEncoding(vch, SCRIPT_VERIFY_STRICTENC, nullptr)) {\n                        const unsigned char chSigHashType = vch.back();\n                        if (mapSigHashTypes.count(chSigHashType)) {\n                            strSigHashDecode = \"[\" + mapSigHashTypes.find(chSigHashType)->second + \"]\";\n                            vch.pop_back(); // remove the sighash type byte. it will be replaced by the decode.\n                        }\n                    }\n                    str += HexStr(vch) + strSigHashDecode;\n                } else {\n                    str += HexStr(vch);\n                }\n            }\n        } else {\n            str += GetOpName(opcode);\n        }\n    }\n    return str;\n}\n\nstd::string EncodeHexTx(const CTransaction& tx, const int serializeFlags)\n{\n    CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | serializeFlags);\n    ssTx << tx;\n    return HexStr(ssTx.begin(), ssTx.end());\n}\n\nvoid ScriptPubKeyToUniv(const CScript& scriptPubKey,\n                        UniValue& out, bool fIncludeHex)\n{\n    txnouttype type;\n    std::vector<CTxDestination> addresses;\n    int nRequired;\n\n    out.pushKV(\"asm\", ScriptToAsmStr(scriptPubKey));\n    if (fIncludeHex)\n        out.pushKV(\"hex\", HexStr(scriptPubKey.begin(), scriptPubKey.end()));\n\n    if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) {\n        out.pushKV(\"type\", GetTxnOutputType(type));\n        return;\n    }\n\n    out.pushKV(\"reqSigs\", nRequired);\n    out.pushKV(\"type\", GetTxnOutputType(type));\n\n    UniValue a(UniValue::VARR);\n    for (const CTxDestination& addr : addresses) {\n        a.push_back(EncodeDestination(addr));\n    }\n    out.pushKV(\"addresses\", a);\n}\n\nvoid TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry, bool include_hex, int serialize_flags)\n{\n    entry.pushKV(\"txid\", tx.GetHash().GetHex());\n    entry.pushKV(\"hash\", tx.GetWitnessHash().GetHex());\n    entry.pushKV(\"version\", tx.nVersion);\n    entry.pushKV(\"size\", (int)::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION));\n    entry.pushKV(\"vsize\", (GetTransactionWeight(tx) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR);\n    entry.pushKV(\"locktime\", (int64_t)tx.nLockTime);\n\n    UniValue vin(UniValue::VARR);\n    for (unsigned int i = 0; i < tx.vin.size(); i++) {\n        const CTxIn& txin = tx.vin[i];\n        UniValue in(UniValue::VOBJ);\n        if (tx.IsCoinBase())\n            in.pushKV(\"coinbase\", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()));\n        else {\n            in.pushKV(\"txid\", txin.prevout.hash.GetHex());\n            in.pushKV(\"vout\", (int64_t)txin.prevout.n);\n            UniValue o(UniValue::VOBJ);\n            o.pushKV(\"asm\", ScriptToAsmStr(txin.scriptSig, true));\n            o.pushKV(\"hex\", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()));\n            in.pushKV(\"scriptSig\", o);\n            if (!tx.vin[i].scriptWitness.IsNull()) {\n                UniValue txinwitness(UniValue::VARR);\n                for (const auto& item : tx.vin[i].scriptWitness.stack) {\n                    txinwitness.push_back(HexStr(item.begin(), item.end()));\n                }\n                in.pushKV(\"txinwitness\", txinwitness);\n            }\n        }\n        in.pushKV(\"sequence\", (int64_t)txin.nSequence);\n        vin.push_back(in);\n    }\n    entry.pushKV(\"vin\", vin);\n\n    UniValue vout(UniValue::VARR);\n    for (unsigned int i = 0; i < tx.vout.size(); i++) {\n        const CTxOut& txout = tx.vout[i];\n\n        UniValue out(UniValue::VOBJ);\n\n        out.pushKV(\"value\", ValueFromAmount(txout.nValue));\n        out.pushKV(\"n\", (int64_t)i);\n\n        UniValue o(UniValue::VOBJ);\n        ScriptPubKeyToUniv(txout.scriptPubKey, o, true);\n        out.pushKV(\"scriptPubKey\", o);\n        vout.push_back(out);\n    }\n    entry.pushKV(\"vout\", vout);\n\n    if (!hashBlock.IsNull())\n        entry.pushKV(\"blockhash\", hashBlock.GetHex());\n\n    if (include_hex) {\n        entry.pushKV(\"hex\", EncodeHexTx(tx, serialize_flags)); // the hex-encoded transaction. used the name \"hex\" to be consistent with the verbose output of \"getrawtransaction\".\n    }\n}\n"
  },
  {
    "path": "src/crypto/aes.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <crypto/aes.h>\n#include <crypto/common.h>\n\n#include <assert.h>\n#include <string.h>\n\nextern \"C\" {\n#include <crypto/ctaes/ctaes.c>\n}\n\nAES128Encrypt::AES128Encrypt(const unsigned char key[16])\n{\n    AES128_init(&ctx, key);\n}\n\nAES128Encrypt::~AES128Encrypt()\n{\n    memset(&ctx, 0, sizeof(ctx));\n}\n\nvoid AES128Encrypt::Encrypt(unsigned char ciphertext[16], const unsigned char plaintext[16]) const\n{\n    AES128_encrypt(&ctx, 1, ciphertext, plaintext);\n}\n\nAES128Decrypt::AES128Decrypt(const unsigned char key[16])\n{\n    AES128_init(&ctx, key);\n}\n\nAES128Decrypt::~AES128Decrypt()\n{\n    memset(&ctx, 0, sizeof(ctx));\n}\n\nvoid AES128Decrypt::Decrypt(unsigned char plaintext[16], const unsigned char ciphertext[16]) const\n{\n    AES128_decrypt(&ctx, 1, plaintext, ciphertext);\n}\n\nAES256Encrypt::AES256Encrypt(const unsigned char key[32])\n{\n    AES256_init(&ctx, key);\n}\n\nAES256Encrypt::~AES256Encrypt()\n{\n    memset(&ctx, 0, sizeof(ctx));\n}\n\nvoid AES256Encrypt::Encrypt(unsigned char ciphertext[16], const unsigned char plaintext[16]) const\n{\n    AES256_encrypt(&ctx, 1, ciphertext, plaintext);\n}\n\nAES256Decrypt::AES256Decrypt(const unsigned char key[32])\n{\n    AES256_init(&ctx, key);\n}\n\nAES256Decrypt::~AES256Decrypt()\n{\n    memset(&ctx, 0, sizeof(ctx));\n}\n\nvoid AES256Decrypt::Decrypt(unsigned char plaintext[16], const unsigned char ciphertext[16]) const\n{\n    AES256_decrypt(&ctx, 1, plaintext, ciphertext);\n}\n\n\ntemplate <typename T>\nstatic int CBCEncrypt(const T& enc, const unsigned char iv[AES_BLOCKSIZE], const unsigned char* data, int size, bool pad, unsigned char* out)\n{\n    int written = 0;\n    int padsize = size % AES_BLOCKSIZE;\n    unsigned char mixed[AES_BLOCKSIZE];\n\n    if (!data || !size || !out)\n        return 0;\n\n    if (!pad && padsize != 0)\n        return 0;\n\n    memcpy(mixed, iv, AES_BLOCKSIZE);\n\n    // Write all but the last block\n    while (written + AES_BLOCKSIZE <= size) {\n        for (int i = 0; i != AES_BLOCKSIZE; i++)\n            mixed[i] ^= *data++;\n        enc.Encrypt(out + written, mixed);\n        memcpy(mixed, out + written, AES_BLOCKSIZE);\n        written += AES_BLOCKSIZE;\n    }\n    if (pad) {\n        // For all that remains, pad each byte with the value of the remaining\n        // space. If there is none, pad by a full block.\n        for (int i = 0; i != padsize; i++)\n            mixed[i] ^= *data++;\n        for (int i = padsize; i != AES_BLOCKSIZE; i++)\n            mixed[i] ^= AES_BLOCKSIZE - padsize;\n        enc.Encrypt(out + written, mixed);\n        written += AES_BLOCKSIZE;\n    }\n    return written;\n}\n\ntemplate <typename T>\nstatic int CBCDecrypt(const T& dec, const unsigned char iv[AES_BLOCKSIZE], const unsigned char* data, int size, bool pad, unsigned char* out)\n{\n    int written = 0;\n    bool fail = false;\n    const unsigned char* prev = iv;\n\n    if (!data || !size || !out)\n        return 0;\n\n    if (size % AES_BLOCKSIZE != 0)\n        return 0;\n\n    // Decrypt all data. Padding will be checked in the output.\n    while (written != size) {\n        dec.Decrypt(out, data + written);\n        for (int i = 0; i != AES_BLOCKSIZE; i++)\n            *out++ ^= prev[i];\n        prev = data + written;\n        written += AES_BLOCKSIZE;\n    }\n\n    // When decrypting padding, attempt to run in constant-time\n    if (pad) {\n        // If used, padding size is the value of the last decrypted byte. For\n        // it to be valid, It must be between 1 and AES_BLOCKSIZE.\n        unsigned char padsize = *--out;\n        fail = !padsize | (padsize > AES_BLOCKSIZE);\n\n        // If not well-formed, treat it as though there's no padding.\n        padsize *= !fail;\n\n        // All padding must equal the last byte otherwise it's not well-formed\n        for (int i = AES_BLOCKSIZE; i != 0; i--)\n            fail |= ((i > AES_BLOCKSIZE - padsize) & (*out-- != padsize));\n\n        written -= padsize;\n    }\n    return written * !fail;\n}\n\nAES256CBCEncrypt::AES256CBCEncrypt(const unsigned char key[AES256_KEYSIZE], const unsigned char ivIn[AES_BLOCKSIZE], bool padIn)\n    : enc(key), pad(padIn)\n{\n    memcpy(iv, ivIn, AES_BLOCKSIZE);\n}\n\nint AES256CBCEncrypt::Encrypt(const unsigned char* data, int size, unsigned char* out) const\n{\n    return CBCEncrypt(enc, iv, data, size, pad, out);\n}\n\nAES256CBCEncrypt::~AES256CBCEncrypt()\n{\n    memset(iv, 0, sizeof(iv));\n}\n\nAES256CBCDecrypt::AES256CBCDecrypt(const unsigned char key[AES256_KEYSIZE], const unsigned char ivIn[AES_BLOCKSIZE], bool padIn)\n    : dec(key), pad(padIn)\n{\n    memcpy(iv, ivIn, AES_BLOCKSIZE);\n}\n\n\nint AES256CBCDecrypt::Decrypt(const unsigned char* data, int size, unsigned char* out) const\n{\n    return CBCDecrypt(dec, iv, data, size, pad, out);\n}\n\nAES256CBCDecrypt::~AES256CBCDecrypt()\n{\n    memset(iv, 0, sizeof(iv));\n}\n\nAES128CBCEncrypt::AES128CBCEncrypt(const unsigned char key[AES128_KEYSIZE], const unsigned char ivIn[AES_BLOCKSIZE], bool padIn)\n    : enc(key), pad(padIn)\n{\n    memcpy(iv, ivIn, AES_BLOCKSIZE);\n}\n\nAES128CBCEncrypt::~AES128CBCEncrypt()\n{\n    memset(iv, 0, AES_BLOCKSIZE);\n}\n\nint AES128CBCEncrypt::Encrypt(const unsigned char* data, int size, unsigned char* out) const\n{\n    return CBCEncrypt(enc, iv, data, size, pad, out);\n}\n\nAES128CBCDecrypt::AES128CBCDecrypt(const unsigned char key[AES128_KEYSIZE], const unsigned char ivIn[AES_BLOCKSIZE], bool padIn)\n    : dec(key), pad(padIn)\n{\n    memcpy(iv, ivIn, AES_BLOCKSIZE);\n}\n\nAES128CBCDecrypt::~AES128CBCDecrypt()\n{\n    memset(iv, 0, AES_BLOCKSIZE);\n}\n\nint AES128CBCDecrypt::Decrypt(const unsigned char* data, int size, unsigned char* out) const\n{\n    return CBCDecrypt(dec, iv, data, size, pad, out);\n}\n"
  },
  {
    "path": "src/crypto/aes.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n//\n// C++ wrapper around ctaes, a constant-time AES implementation\n\n#ifndef BITCOIN_CRYPTO_AES_H\n#define BITCOIN_CRYPTO_AES_H\n\nextern \"C\" {\n#include <crypto/ctaes/ctaes.h>\n}\n\nstatic const int AES_BLOCKSIZE = 16;\nstatic const int AES128_KEYSIZE = 16;\nstatic const int AES256_KEYSIZE = 32;\n\n/** An encryption class for AES-128. */\nclass AES128Encrypt\n{\nprivate:\n    AES128_ctx ctx;\n\npublic:\n    explicit AES128Encrypt(const unsigned char key[16]);\n    ~AES128Encrypt();\n    void Encrypt(unsigned char ciphertext[16], const unsigned char plaintext[16]) const;\n};\n\n/** A decryption class for AES-128. */\nclass AES128Decrypt\n{\nprivate:\n    AES128_ctx ctx;\n\npublic:\n    explicit AES128Decrypt(const unsigned char key[16]);\n    ~AES128Decrypt();\n    void Decrypt(unsigned char plaintext[16], const unsigned char ciphertext[16]) const;\n};\n\n/** An encryption class for AES-256. */\nclass AES256Encrypt\n{\nprivate:\n    AES256_ctx ctx;\n\npublic:\n    explicit AES256Encrypt(const unsigned char key[32]);\n    ~AES256Encrypt();\n    void Encrypt(unsigned char ciphertext[16], const unsigned char plaintext[16]) const;\n};\n\n/** A decryption class for AES-256. */\nclass AES256Decrypt\n{\nprivate:\n    AES256_ctx ctx;\n\npublic:\n    explicit AES256Decrypt(const unsigned char key[32]);\n    ~AES256Decrypt();\n    void Decrypt(unsigned char plaintext[16], const unsigned char ciphertext[16]) const;\n};\n\nclass AES256CBCEncrypt\n{\npublic:\n    AES256CBCEncrypt(const unsigned char key[AES256_KEYSIZE], const unsigned char ivIn[AES_BLOCKSIZE], bool padIn);\n    ~AES256CBCEncrypt();\n    int Encrypt(const unsigned char* data, int size, unsigned char* out) const;\n\nprivate:\n    const AES256Encrypt enc;\n    const bool pad;\n    unsigned char iv[AES_BLOCKSIZE];\n};\n\nclass AES256CBCDecrypt\n{\npublic:\n    AES256CBCDecrypt(const unsigned char key[AES256_KEYSIZE], const unsigned char ivIn[AES_BLOCKSIZE], bool padIn);\n    ~AES256CBCDecrypt();\n    int Decrypt(const unsigned char* data, int size, unsigned char* out) const;\n\nprivate:\n    const AES256Decrypt dec;\n    const bool pad;\n    unsigned char iv[AES_BLOCKSIZE];\n};\n\nclass AES128CBCEncrypt\n{\npublic:\n    AES128CBCEncrypt(const unsigned char key[AES128_KEYSIZE], const unsigned char ivIn[AES_BLOCKSIZE], bool padIn);\n    ~AES128CBCEncrypt();\n    int Encrypt(const unsigned char* data, int size, unsigned char* out) const;\n\nprivate:\n    const AES128Encrypt enc;\n    const bool pad;\n    unsigned char iv[AES_BLOCKSIZE];\n};\n\nclass AES128CBCDecrypt\n{\npublic:\n    AES128CBCDecrypt(const unsigned char key[AES128_KEYSIZE], const unsigned char ivIn[AES_BLOCKSIZE], bool padIn);\n    ~AES128CBCDecrypt();\n    int Decrypt(const unsigned char* data, int size, unsigned char* out) const;\n\nprivate:\n    const AES128Decrypt dec;\n    const bool pad;\n    unsigned char iv[AES_BLOCKSIZE];\n};\n\n#endif // BITCOIN_CRYPTO_AES_H\n"
  },
  {
    "path": "src/crypto/chacha20.cpp",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n// Based on the public domain implementation 'merged' by D. J. Bernstein\n// See https://cr.yp.to/chacha.html.\n\n#include <crypto/common.h>\n#include <crypto/chacha20.h>\n\n#include <string.h>\n\nconstexpr static inline uint32_t rotl32(uint32_t v, int c) { return (v << c) | (v >> (32 - c)); }\n\n#define QUARTERROUND(a,b,c,d) \\\n  a += b; d = rotl32(d ^ a, 16); \\\n  c += d; b = rotl32(b ^ c, 12); \\\n  a += b; d = rotl32(d ^ a, 8); \\\n  c += d; b = rotl32(b ^ c, 7);\n\nstatic const unsigned char sigma[] = \"expand 32-byte k\";\nstatic const unsigned char tau[] = \"expand 16-byte k\";\n\nvoid ChaCha20::SetKey(const unsigned char* k, size_t keylen)\n{\n    const unsigned char *constants;\n\n    input[4] = ReadLE32(k + 0);\n    input[5] = ReadLE32(k + 4);\n    input[6] = ReadLE32(k + 8);\n    input[7] = ReadLE32(k + 12);\n    if (keylen == 32) { /* recommended */\n        k += 16;\n        constants = sigma;\n    } else { /* keylen == 16 */\n        constants = tau;\n    }\n    input[8] = ReadLE32(k + 0);\n    input[9] = ReadLE32(k + 4);\n    input[10] = ReadLE32(k + 8);\n    input[11] = ReadLE32(k + 12);\n    input[0] = ReadLE32(constants + 0);\n    input[1] = ReadLE32(constants + 4);\n    input[2] = ReadLE32(constants + 8);\n    input[3] = ReadLE32(constants + 12);\n    input[12] = 0;\n    input[13] = 0;\n    input[14] = 0;\n    input[15] = 0;\n}\n\nChaCha20::ChaCha20()\n{\n    memset(input, 0, sizeof(input));\n}\n\nChaCha20::ChaCha20(const unsigned char* k, size_t keylen)\n{\n    SetKey(k, keylen);\n}\n\nvoid ChaCha20::SetIV(uint64_t iv)\n{\n    input[14] = iv;\n    input[15] = iv >> 32;\n}\n\nvoid ChaCha20::Seek(uint64_t pos)\n{\n    input[12] = pos;\n    input[13] = pos >> 32;\n}\n\nvoid ChaCha20::Output(unsigned char* c, size_t bytes)\n{\n    uint32_t x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;\n    uint32_t j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;\n    unsigned char *ctarget = nullptr;\n    unsigned char tmp[64];\n    unsigned int i;\n\n    if (!bytes) return;\n\n    j0 = input[0];\n    j1 = input[1];\n    j2 = input[2];\n    j3 = input[3];\n    j4 = input[4];\n    j5 = input[5];\n    j6 = input[6];\n    j7 = input[7];\n    j8 = input[8];\n    j9 = input[9];\n    j10 = input[10];\n    j11 = input[11];\n    j12 = input[12];\n    j13 = input[13];\n    j14 = input[14];\n    j15 = input[15];\n\n    for (;;) {\n        if (bytes < 64) {\n            ctarget = c;\n            c = tmp;\n        }\n        x0 = j0;\n        x1 = j1;\n        x2 = j2;\n        x3 = j3;\n        x4 = j4;\n        x5 = j5;\n        x6 = j6;\n        x7 = j7;\n        x8 = j8;\n        x9 = j9;\n        x10 = j10;\n        x11 = j11;\n        x12 = j12;\n        x13 = j13;\n        x14 = j14;\n        x15 = j15;\n        for (i = 20;i > 0;i -= 2) {\n            QUARTERROUND( x0, x4, x8,x12)\n            QUARTERROUND( x1, x5, x9,x13)\n            QUARTERROUND( x2, x6,x10,x14)\n            QUARTERROUND( x3, x7,x11,x15)\n            QUARTERROUND( x0, x5,x10,x15)\n            QUARTERROUND( x1, x6,x11,x12)\n            QUARTERROUND( x2, x7, x8,x13)\n            QUARTERROUND( x3, x4, x9,x14)\n        }\n        x0 += j0;\n        x1 += j1;\n        x2 += j2;\n        x3 += j3;\n        x4 += j4;\n        x5 += j5;\n        x6 += j6;\n        x7 += j7;\n        x8 += j8;\n        x9 += j9;\n        x10 += j10;\n        x11 += j11;\n        x12 += j12;\n        x13 += j13;\n        x14 += j14;\n        x15 += j15;\n\n        ++j12;\n        if (!j12) ++j13;\n\n        WriteLE32(c + 0, x0);\n        WriteLE32(c + 4, x1);\n        WriteLE32(c + 8, x2);\n        WriteLE32(c + 12, x3);\n        WriteLE32(c + 16, x4);\n        WriteLE32(c + 20, x5);\n        WriteLE32(c + 24, x6);\n        WriteLE32(c + 28, x7);\n        WriteLE32(c + 32, x8);\n        WriteLE32(c + 36, x9);\n        WriteLE32(c + 40, x10);\n        WriteLE32(c + 44, x11);\n        WriteLE32(c + 48, x12);\n        WriteLE32(c + 52, x13);\n        WriteLE32(c + 56, x14);\n        WriteLE32(c + 60, x15);\n\n        if (bytes <= 64) {\n            if (bytes < 64) {\n                for (i = 0;i < bytes;++i) ctarget[i] = c[i];\n            }\n            input[12] = j12;\n            input[13] = j13;\n            return;\n        }\n        bytes -= 64;\n        c += 64;\n    }\n}\n"
  },
  {
    "path": "src/crypto/chacha20.h",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CRYPTO_CHACHA20_H\n#define BITCOIN_CRYPTO_CHACHA20_H\n\n#include <stdint.h>\n#include <stdlib.h>\n\n/** A PRNG class for ChaCha20. */\nclass ChaCha20\n{\nprivate:\n    uint32_t input[16];\n\npublic:\n    ChaCha20();\n    ChaCha20(const unsigned char* key, size_t keylen);\n    void SetKey(const unsigned char* key, size_t keylen);\n    void SetIV(uint64_t iv);\n    void Seek(uint64_t pos);\n    void Output(unsigned char* output, size_t bytes);\n};\n\n#endif // BITCOIN_CRYPTO_CHACHA20_H\n"
  },
  {
    "path": "src/crypto/common.h",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CRYPTO_COMMON_H\n#define BITCOIN_CRYPTO_COMMON_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <stdint.h>\n#include <string.h>\n\n#include <compat/endian.h>\n\nuint16_t static inline ReadLE16(const unsigned char* ptr)\n{\n    uint16_t x;\n    memcpy((char*)&x, ptr, 2);\n    return le16toh(x);\n}\n\nuint32_t static inline ReadLE32(const unsigned char* ptr)\n{\n    uint32_t x;\n    memcpy((char*)&x, ptr, 4);\n    return le32toh(x);\n}\n\nuint64_t static inline ReadLE64(const unsigned char* ptr)\n{\n    uint64_t x;\n    memcpy((char*)&x, ptr, 8);\n    return le64toh(x);\n}\n\nvoid static inline WriteLE16(unsigned char* ptr, uint16_t x)\n{\n    uint16_t v = htole16(x);\n    memcpy(ptr, (char*)&v, 2);\n}\n\nvoid static inline WriteLE32(unsigned char* ptr, uint32_t x)\n{\n    uint32_t v = htole32(x);\n    memcpy(ptr, (char*)&v, 4);\n}\n\nvoid static inline WriteLE64(unsigned char* ptr, uint64_t x)\n{\n    uint64_t v = htole64(x);\n    memcpy(ptr, (char*)&v, 8);\n}\n\nuint32_t static inline ReadBE32(const unsigned char* ptr)\n{\n    uint32_t x;\n    memcpy((char*)&x, ptr, 4);\n    return be32toh(x);\n}\n\nuint64_t static inline ReadBE64(const unsigned char* ptr)\n{\n    uint64_t x;\n    memcpy((char*)&x, ptr, 8);\n    return be64toh(x);\n}\n\nvoid static inline WriteBE32(unsigned char* ptr, uint32_t x)\n{\n    uint32_t v = htobe32(x);\n    memcpy(ptr, (char*)&v, 4);\n}\n\nvoid static inline WriteBE64(unsigned char* ptr, uint64_t x)\n{\n    uint64_t v = htobe64(x);\n    memcpy(ptr, (char*)&v, 8);\n}\n\n/** Return the smallest number n such that (x >> n) == 0 (or 64 if the highest bit in x is set. */\nuint64_t static inline CountBits(uint64_t x)\n{\n#if HAVE_DECL___BUILTIN_CLZL\n    if (sizeof(unsigned long) >= sizeof(uint64_t)) {\n        return x ? 8 * sizeof(unsigned long) - __builtin_clzl(x) : 0;\n    }\n#endif\n#if HAVE_DECL___BUILTIN_CLZLL\n    if (sizeof(unsigned long long) >= sizeof(uint64_t)) {\n        return x ? 8 * sizeof(unsigned long long) - __builtin_clzll(x) : 0;\n    }\n#endif\n    int ret = 0;\n    while (x) {\n        x >>= 1;\n        ++ret;\n    }\n    return ret;\n}\n\n#endif // BITCOIN_CRYPTO_COMMON_H\n"
  },
  {
    "path": "src/crypto/ctaes/COPYING",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2016 Pieter Wuille\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "src/crypto/ctaes/README.md",
    "content": "ctaes\n=====\n\nSimple C module for constant-time AES encryption and decryption.\n\nFeatures:\n* Simple, pure C code without any dependencies.\n* No tables or data-dependent branches whatsoever, but using bit sliced approach from https://eprint.iacr.org/2009/129.pdf.\n* Very small object code: slightly over 4k of executable code when compiled with -Os.\n* Slower than implementations based on precomputed tables or specialized instructions, but can do ~15 MB/s on modern CPUs.\n\nPerformance\n-----------\n\nCompiled with GCC 5.3.1 with -O3, on an Intel(R) Core(TM) i7-4800MQ CPU, numbers in CPU cycles:\n\n| Algorithm | Key schedule | Encryption per byte | Decryption per byte |\n| --------- | ------------:| -------------------:| -------------------:|\n| AES-128   |         2.8k |                 154 |                 161 |\n| AES-192   |         3.1k |                 169 |                 181 |\n| AES-256   |         4.0k |                 191 |                 203 |\n\nBuild steps\n-----------\n\nObject code:\n\n    $ gcc -O3 ctaes.c -c -o ctaes.o\n\nTests:\n\n    $ gcc -O3 ctaes.c test.c -o test\n\nBenchmark:\n\n    $ gcc -O3 ctaes.c bench.c -o bench\n\nReview\n------\n\nResults of a formal review of the code can be found in http://bitcoin.sipa.be/ctaes/review.zip\n"
  },
  {
    "path": "src/crypto/ctaes/bench.c",
    "content": "#include <stdio.h>\n#include <math.h>\n#include \"sys/time.h\"\n\n#include \"ctaes.h\"\n\nstatic double gettimedouble(void) {\n    struct timeval tv;\n    gettimeofday(&tv, NULL);\n    return tv.tv_usec * 0.000001 + tv.tv_sec;\n}\n\nstatic void print_number(double x) {\n    double y = x;\n    int c = 0;\n    if (y < 0.0) {\n        y = -y;\n    }\n    while (y < 100.0) {\n        y *= 10.0;\n        c++;\n    }\n    printf(\"%.*f\", c, x);\n}\n\nstatic void run_benchmark(char *name, void (*benchmark)(void*), void (*setup)(void*), void (*teardown)(void*), void* data, int count, int iter) {\n    int i;\n    double min = HUGE_VAL;\n    double sum = 0.0;\n    double max = 0.0;\n    for (i = 0; i < count; i++) {\n        double begin, total;\n        if (setup != NULL) {\n            setup(data);\n        }\n        begin = gettimedouble();\n        benchmark(data);\n        total = gettimedouble() - begin;\n        if (teardown != NULL) {\n            teardown(data);\n        }\n        if (total < min) {\n            min = total;\n        }\n        if (total > max) {\n            max = total;\n        }\n        sum += total;\n    }\n    printf(\"%s: min \", name);\n    print_number(min * 1000000000.0 / iter);\n    printf(\"ns / avg \");\n    print_number((sum / count) * 1000000000.0 / iter);\n    printf(\"ns / max \");\n    print_number(max * 1000000000.0 / iter);\n    printf(\"ns\\n\");\n}\n\nstatic void bench_AES128_init(void* data) {\n    AES128_ctx* ctx = (AES128_ctx*)data;\n    int i;\n    for (i = 0; i < 50000; i++) {\n        AES128_init(ctx, (unsigned char*)ctx);\n    }\n}\n\nstatic void bench_AES128_encrypt_setup(void* data) {\n    AES128_ctx* ctx = (AES128_ctx*)data;\n    static const unsigned char key[16] = {0};\n    AES128_init(ctx, key);\n}\n\nstatic void bench_AES128_encrypt(void* data) {\n    const AES128_ctx* ctx = (const AES128_ctx*)data;\n    unsigned char scratch[16] = {0};\n    int i;\n    for (i = 0; i < 4000000 / 16; i++) {\n        AES128_encrypt(ctx, 1, scratch, scratch);\n    }\n}\n\nstatic void bench_AES128_decrypt(void* data) {\n    const AES128_ctx* ctx = (const AES128_ctx*)data;\n    unsigned char scratch[16] = {0};\n    int i;\n    for (i = 0; i < 4000000 / 16; i++) {\n        AES128_decrypt(ctx, 1, scratch, scratch);\n    }\n}\n\nstatic void bench_AES192_init(void* data) {\n    AES192_ctx* ctx = (AES192_ctx*)data;\n    int i;\n    for (i = 0; i < 50000; i++) {\n        AES192_init(ctx, (unsigned char*)ctx);\n    }\n}\n\nstatic void bench_AES192_encrypt_setup(void* data) {\n    AES192_ctx* ctx = (AES192_ctx*)data;\n    static const unsigned char key[16] = {0};\n    AES192_init(ctx, key);\n}\n\nstatic void bench_AES192_encrypt(void* data) {\n    const AES192_ctx* ctx = (const AES192_ctx*)data;\n    unsigned char scratch[16] = {0};\n    int i;\n    for (i = 0; i < 4000000 / 16; i++) {\n        AES192_encrypt(ctx, 1, scratch, scratch);\n    }\n}\n\nstatic void bench_AES192_decrypt(void* data) {\n    const AES192_ctx* ctx = (const AES192_ctx*)data;\n    unsigned char scratch[16] = {0};\n    int i;\n    for (i = 0; i < 4000000 / 16; i++) {\n        AES192_decrypt(ctx, 1, scratch, scratch);\n    }\n}\n\nstatic void bench_AES256_init(void* data) {\n    AES256_ctx* ctx = (AES256_ctx*)data;\n    int i;\n    for (i = 0; i < 50000; i++) {\n        AES256_init(ctx, (unsigned char*)ctx);\n    }\n}\n\n\nstatic void bench_AES256_encrypt_setup(void* data) {\n    AES256_ctx* ctx = (AES256_ctx*)data;\n    static const unsigned char key[16] = {0};\n    AES256_init(ctx, key);\n}\n\nstatic void bench_AES256_encrypt(void* data) {\n    const AES256_ctx* ctx = (const AES256_ctx*)data;\n    unsigned char scratch[16] = {0};\n    int i;\n    for (i = 0; i < 4000000 / 16; i++) {\n        AES256_encrypt(ctx, 1, scratch, scratch);\n    }\n}\n\nstatic void bench_AES256_decrypt(void* data) {\n    const AES256_ctx* ctx = (const AES256_ctx*)data;\n    unsigned char scratch[16] = {0};\n    int i;\n    for (i = 0; i < 4000000 / 16; i++) {\n        AES256_decrypt(ctx, 1, scratch, scratch);\n    }\n}\n\nint main(void) {\n    AES128_ctx ctx128;\n    AES192_ctx ctx192;\n    AES256_ctx ctx256;\n    run_benchmark(\"aes128_init\", bench_AES128_init, NULL, NULL, &ctx128, 20, 50000);\n    run_benchmark(\"aes128_encrypt_byte\", bench_AES128_encrypt, bench_AES128_encrypt_setup, NULL, &ctx128, 20, 4000000);\n    run_benchmark(\"aes128_decrypt_byte\", bench_AES128_decrypt, bench_AES128_encrypt_setup, NULL, &ctx128, 20, 4000000);\n    run_benchmark(\"aes192_init\", bench_AES192_init, NULL, NULL, &ctx192, 20, 50000);\n    run_benchmark(\"aes192_encrypt_byte\", bench_AES192_encrypt, bench_AES192_encrypt_setup, NULL, &ctx192, 20, 4000000);\n    run_benchmark(\"aes192_decrypt_byte\", bench_AES192_decrypt, bench_AES192_encrypt_setup, NULL, &ctx192, 20, 4000000);\n    run_benchmark(\"aes256_init\", bench_AES256_init, NULL, NULL, &ctx256, 20, 50000);\n    run_benchmark(\"aes256_encrypt_byte\", bench_AES256_encrypt, bench_AES256_encrypt_setup, NULL, &ctx256, 20, 4000000);\n    run_benchmark(\"aes256_decrypt_byte\", bench_AES256_decrypt, bench_AES256_encrypt_setup, NULL, &ctx256, 20, 4000000);\n    return 0;\n}\n"
  },
  {
    "path": "src/crypto/ctaes/ctaes.c",
    "content": " /*********************************************************************\n * Copyright (c) 2016 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n/* Constant time, unoptimized, concise, plain C, AES implementation\n * Based On:\n *   Emilia Kasper and Peter Schwabe, Faster and Timing-Attack Resistant AES-GCM\n *   http://www.iacr.org/archive/ches2009/57470001/57470001.pdf\n * But using 8 16-bit integers representing a single AES state rather than 8 128-bit\n * integers representing 8 AES states.\n */\n\n#include \"ctaes.h\"\n\n/* Slice variable slice_i contains the i'th bit of the 16 state variables in this order:\n *  0  1  2  3\n *  4  5  6  7\n *  8  9 10 11\n * 12 13 14 15\n */\n\n/** Convert a byte to sliced form, storing it corresponding to given row and column in s */\nstatic void LoadByte(AES_state* s, unsigned char byte, int r, int c) {\n    int i;\n    for (i = 0; i < 8; i++) {\n        s->slice[i] |= (byte & 1) << (r * 4 + c);\n        byte >>= 1;\n    }\n}\n\n/** Load 16 bytes of data into 8 sliced integers */\nstatic void LoadBytes(AES_state *s, const unsigned char* data16) {\n    int c;\n    for (c = 0; c < 4; c++) {\n        int r;\n        for (r = 0; r < 4; r++) {\n            LoadByte(s, *(data16++), r, c);\n        }\n    }\n}\n\n/** Convert 8 sliced integers into 16 bytes of data */\nstatic void SaveBytes(unsigned char* data16, const AES_state *s) {\n    int c;\n    for (c = 0; c < 4; c++) {\n        int r;\n        for (r = 0; r < 4; r++) {\n            int b;\n            uint8_t v = 0;\n            for (b = 0; b < 8; b++) {\n                v |= ((s->slice[b] >> (r * 4 + c)) & 1) << b;\n            }\n            *(data16++) = v;\n        }\n    }\n}\n\n/* S-box implementation based on the gate logic from:\n *   Joan Boyar and Rene Peralta, A depth-16 circuit for the AES S-box.\n *   https://eprint.iacr.org/2011/332.pdf\n*/\nstatic void SubBytes(AES_state *s, int inv) {\n    /* Load the bit slices */\n    uint16_t U0 = s->slice[7], U1 = s->slice[6], U2 = s->slice[5], U3 = s->slice[4];\n    uint16_t U4 = s->slice[3], U5 = s->slice[2], U6 = s->slice[1], U7 = s->slice[0];\n\n    uint16_t T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16;\n    uint16_t T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, D;\n    uint16_t M1, M6, M11, M13, M15, M20, M21, M22, M23, M25, M37, M38, M39, M40;\n    uint16_t M41, M42, M43, M44, M45, M46, M47, M48, M49, M50, M51, M52, M53, M54;\n    uint16_t M55, M56, M57, M58, M59, M60, M61, M62, M63;\n\n    if (inv) {\n        uint16_t R5, R13, R17, R18, R19;\n        /* Undo linear postprocessing */\n        T23 = U0 ^ U3;\n        T22 = ~(U1 ^ U3);\n        T2 = ~(U0 ^ U1);\n        T1 = U3 ^ U4;\n        T24 = ~(U4 ^ U7);\n        R5 = U6 ^ U7;\n        T8 = ~(U1 ^ T23);\n        T19 = T22 ^ R5;\n        T9 = ~(U7 ^ T1);\n        T10 = T2 ^ T24;\n        T13 = T2 ^ R5;\n        T3 = T1 ^ R5;\n        T25 = ~(U2 ^ T1);\n        R13 = U1 ^ U6;\n        T17 = ~(U2 ^ T19);\n        T20 = T24 ^ R13;\n        T4 = U4 ^ T8;\n        R17 = ~(U2 ^ U5);\n        R18 = ~(U5 ^ U6);\n        R19 = ~(U2 ^ U4);\n        D = U0 ^ R17;\n        T6 = T22 ^ R17;\n        T16 = R13 ^ R19;\n        T27 = T1 ^ R18;\n        T15 = T10 ^ T27;\n        T14 = T10 ^ R18;\n        T26 = T3 ^ T16;\n    } else {\n        /* Linear preprocessing. */\n        T1 = U0 ^ U3;\n        T2 = U0 ^ U5;\n        T3 = U0 ^ U6;\n        T4 = U3 ^ U5;\n        T5 = U4 ^ U6;\n        T6 = T1 ^ T5;\n        T7 = U1 ^ U2;\n        T8 = U7 ^ T6;\n        T9 = U7 ^ T7;\n        T10 = T6 ^ T7;\n        T11 = U1 ^ U5;\n        T12 = U2 ^ U5;\n        T13 = T3 ^ T4;\n        T14 = T6 ^ T11;\n        T15 = T5 ^ T11;\n        T16 = T5 ^ T12;\n        T17 = T9 ^ T16;\n        T18 = U3 ^ U7;\n        T19 = T7 ^ T18;\n        T20 = T1 ^ T19;\n        T21 = U6 ^ U7;\n        T22 = T7 ^ T21;\n        T23 = T2 ^ T22;\n        T24 = T2 ^ T10;\n        T25 = T20 ^ T17;\n        T26 = T3 ^ T16;\n        T27 = T1 ^ T12;\n        D = U7;\n    }\n\n    /* Non-linear transformation (shared between the forward and backward case) */\n    M1 = T13 & T6;\n    M6 = T3 & T16;\n    M11 = T1 & T15;\n    M13 = (T4 & T27) ^ M11;\n    M15 = (T2 & T10) ^ M11;\n    M20 = T14 ^ M1 ^ (T23 & T8) ^ M13;\n    M21 = (T19 & D) ^ M1 ^ T24 ^ M15;\n    M22 = T26 ^ M6 ^ (T22 & T9) ^ M13;\n    M23 = (T20 & T17) ^ M6 ^ M15 ^ T25;\n    M25 = M22 & M20;\n    M37 = M21 ^ ((M20 ^ M21) & (M23 ^ M25));\n    M38 = M20 ^ M25 ^ (M21 | (M20 & M23));\n    M39 = M23 ^ ((M22 ^ M23) & (M21 ^ M25));\n    M40 = M22 ^ M25 ^ (M23 | (M21 & M22));\n    M41 = M38 ^ M40;\n    M42 = M37 ^ M39;\n    M43 = M37 ^ M38;\n    M44 = M39 ^ M40;\n    M45 = M42 ^ M41;\n    M46 = M44 & T6;\n    M47 = M40 & T8;\n    M48 = M39 & D;\n    M49 = M43 & T16;\n    M50 = M38 & T9;\n    M51 = M37 & T17;\n    M52 = M42 & T15;\n    M53 = M45 & T27;\n    M54 = M41 & T10;\n    M55 = M44 & T13;\n    M56 = M40 & T23;\n    M57 = M39 & T19;\n    M58 = M43 & T3;\n    M59 = M38 & T22;\n    M60 = M37 & T20;\n    M61 = M42 & T1;\n    M62 = M45 & T4;\n    M63 = M41 & T2;\n\n    if (inv){\n        /* Undo linear preprocessing */\n        uint16_t P0 = M52 ^ M61;\n        uint16_t P1 = M58 ^ M59;\n        uint16_t P2 = M54 ^ M62;\n        uint16_t P3 = M47 ^ M50;\n        uint16_t P4 = M48 ^ M56;\n        uint16_t P5 = M46 ^ M51;\n        uint16_t P6 = M49 ^ M60;\n        uint16_t P7 = P0 ^ P1;\n        uint16_t P8 = M50 ^ M53;\n        uint16_t P9 = M55 ^ M63;\n        uint16_t P10 = M57 ^ P4;\n        uint16_t P11 = P0 ^ P3;\n        uint16_t P12 = M46 ^ M48;\n        uint16_t P13 = M49 ^ M51;\n        uint16_t P14 = M49 ^ M62;\n        uint16_t P15 = M54 ^ M59;\n        uint16_t P16 = M57 ^ M61;\n        uint16_t P17 = M58 ^ P2;\n        uint16_t P18 = M63 ^ P5;\n        uint16_t P19 = P2 ^ P3;\n        uint16_t P20 = P4 ^ P6;\n        uint16_t P22 = P2 ^ P7;\n        uint16_t P23 = P7 ^ P8;\n        uint16_t P24 = P5 ^ P7;\n        uint16_t P25 = P6 ^ P10;\n        uint16_t P26 = P9 ^ P11;\n        uint16_t P27 = P10 ^ P18;\n        uint16_t P28 = P11 ^ P25;\n        uint16_t P29 = P15 ^ P20;\n        s->slice[7] = P13 ^ P22;\n        s->slice[6] = P26 ^ P29;\n        s->slice[5] = P17 ^ P28;\n        s->slice[4] = P12 ^ P22;\n        s->slice[3] = P23 ^ P27;\n        s->slice[2] = P19 ^ P24;\n        s->slice[1] = P14 ^ P23;\n        s->slice[0] = P9 ^ P16;\n    } else {\n        /* Linear postprocessing */\n        uint16_t L0 = M61 ^ M62;\n        uint16_t L1 = M50 ^ M56;\n        uint16_t L2 = M46 ^ M48;\n        uint16_t L3 = M47 ^ M55;\n        uint16_t L4 = M54 ^ M58;\n        uint16_t L5 = M49 ^ M61;\n        uint16_t L6 = M62 ^ L5;\n        uint16_t L7 = M46 ^ L3;\n        uint16_t L8 = M51 ^ M59;\n        uint16_t L9 = M52 ^ M53;\n        uint16_t L10 = M53 ^ L4;\n        uint16_t L11 = M60 ^ L2;\n        uint16_t L12 = M48 ^ M51;\n        uint16_t L13 = M50 ^ L0;\n        uint16_t L14 = M52 ^ M61;\n        uint16_t L15 = M55 ^ L1;\n        uint16_t L16 = M56 ^ L0;\n        uint16_t L17 = M57 ^ L1;\n        uint16_t L18 = M58 ^ L8;\n        uint16_t L19 = M63 ^ L4;\n        uint16_t L20 = L0 ^ L1;\n        uint16_t L21 = L1 ^ L7;\n        uint16_t L22 = L3 ^ L12;\n        uint16_t L23 = L18 ^ L2;\n        uint16_t L24 = L15 ^ L9;\n        uint16_t L25 = L6 ^ L10;\n        uint16_t L26 = L7 ^ L9;\n        uint16_t L27 = L8 ^ L10;\n        uint16_t L28 = L11 ^ L14;\n        uint16_t L29 = L11 ^ L17;\n        s->slice[7] = L6 ^ L24;\n        s->slice[6] = ~(L16 ^ L26);\n        s->slice[5] = ~(L19 ^ L28);\n        s->slice[4] = L6 ^ L21;\n        s->slice[3] = L20 ^ L22;\n        s->slice[2] = L25 ^ L29;\n        s->slice[1] = ~(L13 ^ L27);\n        s->slice[0] = ~(L6 ^ L23);\n    }\n}\n\n#define BIT_RANGE(from,to) (((1 << ((to) - (from))) - 1) << (from))\n\n#define BIT_RANGE_LEFT(x,from,to,shift) (((x) & BIT_RANGE((from), (to))) << (shift))\n#define BIT_RANGE_RIGHT(x,from,to,shift) (((x) & BIT_RANGE((from), (to))) >> (shift))\n\nstatic void ShiftRows(AES_state* s) {\n    int i;\n    for (i = 0; i < 8; i++) {\n        uint16_t v = s->slice[i];\n        s->slice[i] =\n            (v & BIT_RANGE(0, 4)) |\n            BIT_RANGE_LEFT(v, 4, 5, 3) | BIT_RANGE_RIGHT(v, 5, 8, 1) |\n            BIT_RANGE_LEFT(v, 8, 10, 2) | BIT_RANGE_RIGHT(v, 10, 12, 2) |\n            BIT_RANGE_LEFT(v, 12, 15, 1) | BIT_RANGE_RIGHT(v, 15, 16, 3);\n    }\n}\n\nstatic void InvShiftRows(AES_state* s) {\n    int i;\n    for (i = 0; i < 8; i++) {\n        uint16_t v = s->slice[i];\n        s->slice[i] =\n            (v & BIT_RANGE(0, 4)) |\n            BIT_RANGE_LEFT(v, 4, 7, 1) | BIT_RANGE_RIGHT(v, 7, 8, 3) |\n            BIT_RANGE_LEFT(v, 8, 10, 2) | BIT_RANGE_RIGHT(v, 10, 12, 2) |\n            BIT_RANGE_LEFT(v, 12, 13, 3) | BIT_RANGE_RIGHT(v, 13, 16, 1);\n    }\n}\n\n#define ROT(x,b) (((x) >> ((b) * 4)) | ((x) << ((4-(b)) * 4)))\n\nstatic void MixColumns(AES_state* s, int inv) {\n    /* The MixColumns transform treats the bytes of the columns of the state as\n     * coefficients of a 3rd degree polynomial over GF(2^8) and multiplies them\n     * by the fixed polynomial a(x) = {03}x^3 + {01}x^2 + {01}x + {02}, modulo\n     * x^4 + {01}.\n     *\n     * In the inverse transform, we multiply by the inverse of a(x),\n     * a^-1(x) = {0b}x^3 + {0d}x^2 + {09}x + {0e}. This is equal to\n     * a(x) * ({04}x^2 + {05}), so we can reuse the forward transform's code\n     * (found in OpenSSL's bsaes-x86_64.pl, attributed to Jussi Kivilinna)\n     *\n     * In the bitsliced representation, a multiplication of every column by x\n     * mod x^4 + 1 is simply a right rotation.\n     */\n\n    /* Shared for both directions is a multiplication by a(x), which can be\n     * rewritten as (x^3 + x^2 + x) + {02}*(x^3 + {01}).\n     *\n     * First compute s into the s? variables, (x^3 + {01}) * s into the s?_01\n     * variables and (x^3 + x^2 + x)*s into the s?_123 variables.\n     */\n    uint16_t s0 = s->slice[0], s1 = s->slice[1], s2 = s->slice[2], s3 = s->slice[3];\n    uint16_t s4 = s->slice[4], s5 = s->slice[5], s6 = s->slice[6], s7 = s->slice[7];\n    uint16_t s0_01 = s0 ^ ROT(s0, 1), s0_123 = ROT(s0_01, 1) ^ ROT(s0, 3);\n    uint16_t s1_01 = s1 ^ ROT(s1, 1), s1_123 = ROT(s1_01, 1) ^ ROT(s1, 3);\n    uint16_t s2_01 = s2 ^ ROT(s2, 1), s2_123 = ROT(s2_01, 1) ^ ROT(s2, 3);\n    uint16_t s3_01 = s3 ^ ROT(s3, 1), s3_123 = ROT(s3_01, 1) ^ ROT(s3, 3);\n    uint16_t s4_01 = s4 ^ ROT(s4, 1), s4_123 = ROT(s4_01, 1) ^ ROT(s4, 3);\n    uint16_t s5_01 = s5 ^ ROT(s5, 1), s5_123 = ROT(s5_01, 1) ^ ROT(s5, 3);\n    uint16_t s6_01 = s6 ^ ROT(s6, 1), s6_123 = ROT(s6_01, 1) ^ ROT(s6, 3);\n    uint16_t s7_01 = s7 ^ ROT(s7, 1), s7_123 = ROT(s7_01, 1) ^ ROT(s7, 3);\n    /* Now compute s = s?_123 + {02} * s?_01. */\n    s->slice[0] = s7_01 ^ s0_123;\n    s->slice[1] = s7_01 ^ s0_01 ^ s1_123;\n    s->slice[2] = s1_01 ^ s2_123;\n    s->slice[3] = s7_01 ^ s2_01 ^ s3_123;\n    s->slice[4] = s7_01 ^ s3_01 ^ s4_123;\n    s->slice[5] = s4_01 ^ s5_123;\n    s->slice[6] = s5_01 ^ s6_123;\n    s->slice[7] = s6_01 ^ s7_123;\n    if (inv) {\n        /* In the reverse direction, we further need to multiply by\n         * {04}x^2 + {05}, which can be written as {04} * (x^2 + {01}) + {01}.\n         *\n         * First compute (x^2 + {01}) * s into the t?_02 variables: */\n        uint16_t t0_02 = s->slice[0] ^ ROT(s->slice[0], 2);\n        uint16_t t1_02 = s->slice[1] ^ ROT(s->slice[1], 2);\n        uint16_t t2_02 = s->slice[2] ^ ROT(s->slice[2], 2);\n        uint16_t t3_02 = s->slice[3] ^ ROT(s->slice[3], 2);\n        uint16_t t4_02 = s->slice[4] ^ ROT(s->slice[4], 2);\n        uint16_t t5_02 = s->slice[5] ^ ROT(s->slice[5], 2);\n        uint16_t t6_02 = s->slice[6] ^ ROT(s->slice[6], 2);\n        uint16_t t7_02 = s->slice[7] ^ ROT(s->slice[7], 2);\n        /* And then update s += {04} * t?_02 */\n        s->slice[0] ^= t6_02;\n        s->slice[1] ^= t6_02 ^ t7_02;\n        s->slice[2] ^= t0_02 ^ t7_02;\n        s->slice[3] ^= t1_02 ^ t6_02;\n        s->slice[4] ^= t2_02 ^ t6_02 ^ t7_02;\n        s->slice[5] ^= t3_02 ^ t7_02;\n        s->slice[6] ^= t4_02;\n        s->slice[7] ^= t5_02;\n    }\n}\n\nstatic void AddRoundKey(AES_state* s, const AES_state* round) {\n    int b;\n    for (b = 0; b < 8; b++) {\n        s->slice[b] ^= round->slice[b];\n    }\n}\n\n/** column_0(s) = column_c(a) */\nstatic void GetOneColumn(AES_state* s, const AES_state* a, int c) {\n    int b;\n    for (b = 0; b < 8; b++) {\n        s->slice[b] = (a->slice[b] >> c) & 0x1111;\n    }\n}\n\n/** column_c1(r) |= (column_0(s) ^= column_c2(a)) */\nstatic void KeySetupColumnMix(AES_state* s, AES_state* r, const AES_state* a, int c1, int c2) {\n    int b;\n    for (b = 0; b < 8; b++) {\n        r->slice[b] |= ((s->slice[b] ^= ((a->slice[b] >> c2) & 0x1111)) & 0x1111) << c1;\n    }\n}\n\n/** Rotate the rows in s one position upwards, and xor in r */\nstatic void KeySetupTransform(AES_state* s, const AES_state* r) {\n    int b;\n    for (b = 0; b < 8; b++) {\n        s->slice[b] = ((s->slice[b] >> 4) | (s->slice[b] << 12)) ^ r->slice[b];\n    }\n}\n\n/* Multiply the cells in s by x, as polynomials over GF(2) mod x^8 + x^4 + x^3 + x + 1 */\nstatic void MultX(AES_state* s) {\n    uint16_t top = s->slice[7];\n    s->slice[7] = s->slice[6];\n    s->slice[6] = s->slice[5];\n    s->slice[5] = s->slice[4];\n    s->slice[4] = s->slice[3] ^ top;\n    s->slice[3] = s->slice[2] ^ top;\n    s->slice[2] = s->slice[1];\n    s->slice[1] = s->slice[0] ^ top;\n    s->slice[0] = top;\n}\n\n/** Expand the cipher key into the key schedule.\n *\n *  state must be a pointer to an array of size nrounds + 1.\n *  key must be a pointer to 4 * nkeywords bytes.\n *\n *  AES128 uses nkeywords = 4, nrounds = 10\n *  AES192 uses nkeywords = 6, nrounds = 12\n *  AES256 uses nkeywords = 8, nrounds = 14\n */\nstatic void AES_setup(AES_state* rounds, const uint8_t* key, int nkeywords, int nrounds)\n{\n    int i;\n\n    /* The one-byte round constant */\n    AES_state rcon = {{1,0,0,0,0,0,0,0}};\n    /* The number of the word being generated, modulo nkeywords */\n    int pos = 0;\n    /* The column representing the word currently being processed */\n    AES_state column;\n\n    for (i = 0; i < nrounds + 1; i++) {\n        int b;\n        for (b = 0; b < 8; b++) {\n            rounds[i].slice[b] = 0;\n        }\n    }\n\n    /* The first nkeywords round columns are just taken from the key directly. */\n    for (i = 0; i < nkeywords; i++) {\n        int r;\n        for (r = 0; r < 4; r++) {\n            LoadByte(&rounds[i >> 2], *(key++), r, i & 3);\n        }\n    }\n\n    GetOneColumn(&column, &rounds[(nkeywords - 1) >> 2], (nkeywords - 1) & 3);\n\n    for (i = nkeywords; i < 4 * (nrounds + 1); i++) {\n        /* Transform column */\n        if (pos == 0) {\n            SubBytes(&column, 0);\n            KeySetupTransform(&column, &rcon);\n            MultX(&rcon);\n        } else if (nkeywords > 6 && pos == 4) {\n            SubBytes(&column, 0);\n        }\n        if (++pos == nkeywords) pos = 0;\n        KeySetupColumnMix(&column, &rounds[i >> 2], &rounds[(i - nkeywords) >> 2], i & 3, (i - nkeywords) & 3);\n    }\n}\n\nstatic void AES_encrypt(const AES_state* rounds, int nrounds, unsigned char* cipher16, const unsigned char* plain16) {\n    AES_state s = {{0}};\n    int round;\n\n    LoadBytes(&s, plain16);\n    AddRoundKey(&s, rounds++);\n\n    for (round = 1; round < nrounds; round++) {\n        SubBytes(&s, 0);\n        ShiftRows(&s);\n        MixColumns(&s, 0);\n        AddRoundKey(&s, rounds++);\n    }\n\n    SubBytes(&s, 0);\n    ShiftRows(&s);\n    AddRoundKey(&s, rounds);\n\n    SaveBytes(cipher16, &s);\n}\n\nstatic void AES_decrypt(const AES_state* rounds, int nrounds, unsigned char* plain16, const unsigned char* cipher16) {\n    /* Most AES decryption implementations use the alternate scheme\n     * (the Equivalent Inverse Cipher), which allows for more code reuse between\n     * the encryption and decryption code, but requires separate setup for both.\n     */\n    AES_state s = {{0}};\n    int round;\n\n    rounds += nrounds;\n\n    LoadBytes(&s, cipher16);\n    AddRoundKey(&s, rounds--);\n\n    for (round = 1; round < nrounds; round++) {\n        InvShiftRows(&s);\n        SubBytes(&s, 1);\n        AddRoundKey(&s, rounds--);\n        MixColumns(&s, 1);\n    }\n\n    InvShiftRows(&s);\n    SubBytes(&s, 1);\n    AddRoundKey(&s, rounds);\n\n    SaveBytes(plain16, &s);\n}\n\nvoid AES128_init(AES128_ctx* ctx, const unsigned char* key16) {\n    AES_setup(ctx->rk, key16, 4, 10);\n}\n\nvoid AES128_encrypt(const AES128_ctx* ctx, size_t blocks, unsigned char* cipher16, const unsigned char* plain16) {\n    while (blocks--) {\n        AES_encrypt(ctx->rk, 10, cipher16, plain16);\n        cipher16 += 16;\n        plain16 += 16;\n    }\n}\n\nvoid AES128_decrypt(const AES128_ctx* ctx, size_t blocks, unsigned char* plain16, const unsigned char* cipher16) {\n    while (blocks--) {\n        AES_decrypt(ctx->rk, 10, plain16, cipher16);\n        cipher16 += 16;\n        plain16 += 16;\n    }\n}\n\nvoid AES192_init(AES192_ctx* ctx, const unsigned char* key24) {\n    AES_setup(ctx->rk, key24, 6, 12);\n}\n\nvoid AES192_encrypt(const AES192_ctx* ctx, size_t blocks, unsigned char* cipher16, const unsigned char* plain16) {\n    while (blocks--) {\n        AES_encrypt(ctx->rk, 12, cipher16, plain16);\n        cipher16 += 16;\n        plain16 += 16;\n    }\n\n}\n\nvoid AES192_decrypt(const AES192_ctx* ctx, size_t blocks, unsigned char* plain16, const unsigned char* cipher16) {\n    while (blocks--) {\n        AES_decrypt(ctx->rk, 12, plain16, cipher16);\n        cipher16 += 16;\n        plain16 += 16;\n    }\n}\n\nvoid AES256_init(AES256_ctx* ctx, const unsigned char* key32) {\n    AES_setup(ctx->rk, key32, 8, 14);\n}\n\nvoid AES256_encrypt(const AES256_ctx* ctx, size_t blocks, unsigned char* cipher16, const unsigned char* plain16) {\n    while (blocks--) {\n        AES_encrypt(ctx->rk, 14, cipher16, plain16);\n        cipher16 += 16;\n        plain16 += 16;\n    }\n}\n\nvoid AES256_decrypt(const AES256_ctx* ctx, size_t blocks, unsigned char* plain16, const unsigned char* cipher16) {\n    while (blocks--) {\n        AES_decrypt(ctx->rk, 14, plain16, cipher16);\n        cipher16 += 16;\n        plain16 += 16;\n    }\n}\n"
  },
  {
    "path": "src/crypto/ctaes/ctaes.h",
    "content": " /*********************************************************************\n * Copyright (c) 2016 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef _CTAES_H_\n#define _CTAES_H_ 1\n\n#include <stdint.h>\n#include <stdlib.h>\n\ntypedef struct {\n    uint16_t slice[8];\n} AES_state;\n\ntypedef struct {\n    AES_state rk[11];\n} AES128_ctx;\n\ntypedef struct {\n    AES_state rk[13];\n} AES192_ctx;\n\ntypedef struct {\n    AES_state rk[15];\n} AES256_ctx;\n\nvoid AES128_init(AES128_ctx* ctx, const unsigned char* key16);\nvoid AES128_encrypt(const AES128_ctx* ctx, size_t blocks, unsigned char* cipher16, const unsigned char* plain16);\nvoid AES128_decrypt(const AES128_ctx* ctx, size_t blocks, unsigned char* plain16, const unsigned char* cipher16);\n\nvoid AES192_init(AES192_ctx* ctx, const unsigned char* key24);\nvoid AES192_encrypt(const AES192_ctx* ctx, size_t blocks, unsigned char* cipher16, const unsigned char* plain16);\nvoid AES192_decrypt(const AES192_ctx* ctx, size_t blocks, unsigned char* plain16, const unsigned char* cipher16);\n\nvoid AES256_init(AES256_ctx* ctx, const unsigned char* key32);\nvoid AES256_encrypt(const AES256_ctx* ctx, size_t blocks, unsigned char* cipher16, const unsigned char* plain16);\nvoid AES256_decrypt(const AES256_ctx* ctx, size_t blocks, unsigned char* plain16, const unsigned char* cipher16);\n\n#endif\n"
  },
  {
    "path": "src/crypto/ctaes/test.c",
    "content": " /*********************************************************************\n * Copyright (c) 2016 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#include \"ctaes.h\"\n\n#include <stdio.h>\n#include <string.h>\n#include <assert.h>\n\ntypedef struct {\n    int keysize;\n    const char* key;\n    const char* plain;\n    const char* cipher;\n} ctaes_test;\n\nstatic const ctaes_test ctaes_tests[] = {\n    /* AES test vectors from FIPS 197. */\n    {128, \"000102030405060708090a0b0c0d0e0f\", \"00112233445566778899aabbccddeeff\", \"69c4e0d86a7b0430d8cdb78070b4c55a\"},\n    {192, \"000102030405060708090a0b0c0d0e0f1011121314151617\", \"00112233445566778899aabbccddeeff\", \"dda97ca4864cdfe06eaf70a0ec0d7191\"},\n    {256, \"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f\", \"00112233445566778899aabbccddeeff\", \"8ea2b7ca516745bfeafc49904b496089\"},\n\n    /* AES-ECB test vectors from NIST sp800-38a. */\n    {128, \"2b7e151628aed2a6abf7158809cf4f3c\", \"6bc1bee22e409f96e93d7e117393172a\", \"3ad77bb40d7a3660a89ecaf32466ef97\"},\n    {128, \"2b7e151628aed2a6abf7158809cf4f3c\", \"ae2d8a571e03ac9c9eb76fac45af8e51\", \"f5d3d58503b9699de785895a96fdbaaf\"},\n    {128, \"2b7e151628aed2a6abf7158809cf4f3c\", \"30c81c46a35ce411e5fbc1191a0a52ef\", \"43b1cd7f598ece23881b00e3ed030688\"},\n    {128, \"2b7e151628aed2a6abf7158809cf4f3c\", \"f69f2445df4f9b17ad2b417be66c3710\", \"7b0c785e27e8ad3f8223207104725dd4\"},\n    {192, \"8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b\", \"6bc1bee22e409f96e93d7e117393172a\", \"bd334f1d6e45f25ff712a214571fa5cc\"},\n    {192, \"8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b\", \"ae2d8a571e03ac9c9eb76fac45af8e51\", \"974104846d0ad3ad7734ecb3ecee4eef\"},\n    {192, \"8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b\", \"30c81c46a35ce411e5fbc1191a0a52ef\", \"ef7afd2270e2e60adce0ba2face6444e\"},\n    {192, \"8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b\", \"f69f2445df4f9b17ad2b417be66c3710\", \"9a4b41ba738d6c72fb16691603c18e0e\"},\n    {256, \"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \"6bc1bee22e409f96e93d7e117393172a\", \"f3eed1bdb5d2a03c064b5a7e3db181f8\"},\n    {256, \"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \"ae2d8a571e03ac9c9eb76fac45af8e51\", \"591ccb10d410ed26dc5ba74a31362870\"},\n    {256, \"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \"30c81c46a35ce411e5fbc1191a0a52ef\", \"b6ed21b99ca6f4f9f153e7b1beafed1d\"},\n    {256, \"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \"f69f2445df4f9b17ad2b417be66c3710\", \"23304b7a39f9f3ff067d8d8f9e24ecc7\"}\n};\n\nstatic void from_hex(unsigned char* data, int len, const char* hex) {\n    int p;\n    for (p = 0; p < len; p++) {\n        int v = 0;\n        int n;\n        for (n = 0; n < 2; n++) {\n            assert((*hex >= '0' && *hex <= '9') || (*hex >= 'a' && *hex <= 'f'));\n            if (*hex >= '0' && *hex <= '9') {\n                v |= (*hex - '0') << (4 * (1 - n));\n            } else {\n                v |= (*hex - 'a' + 10) << (4 * (1 - n));\n            }\n            hex++;\n        }\n        *(data++) = v;\n    }\n    assert(*hex == 0);\n}\n\nint main(void) {\n    int i;\n    int fail = 0;\n    for (i = 0; i < sizeof(ctaes_tests) / sizeof(ctaes_tests[0]); i++) {\n        unsigned char key[32], plain[16], cipher[16], ciphered[16], deciphered[16];\n        const ctaes_test* test = &ctaes_tests[i];\n        assert(test->keysize == 128 || test->keysize == 192 || test->keysize == 256);\n        from_hex(plain, 16, test->plain);\n        from_hex(cipher, 16, test->cipher);\n        switch (test->keysize) {\n            case 128: {\n                AES128_ctx ctx;\n                from_hex(key, 16, test->key);\n                AES128_init(&ctx, key);\n                AES128_encrypt(&ctx, 1, ciphered, plain);\n                AES128_decrypt(&ctx, 1, deciphered, cipher);\n                break;\n            }\n            case 192: {\n                AES192_ctx ctx;\n                from_hex(key, 24, test->key);\n                AES192_init(&ctx, key);\n                AES192_encrypt(&ctx, 1, ciphered, plain);\n                AES192_decrypt(&ctx, 1, deciphered, cipher);\n                break;\n            }\n            case 256: {\n                AES256_ctx ctx;\n                from_hex(key, 32, test->key);\n                AES256_init(&ctx, key);\n                AES256_encrypt(&ctx, 1, ciphered, plain);\n                AES256_decrypt(&ctx, 1, deciphered, cipher);\n                break;\n            }\n        }\n        if (memcmp(cipher, ciphered, 16)) {\n            fprintf(stderr, \"E(key=\\\"%s\\\", plain=\\\"%s\\\") != \\\"%s\\\"\\n\", test->key, test->plain, test->cipher);\n            fail++;\n        }\n        if (memcmp(plain, deciphered, 16)) {\n            fprintf(stderr, \"D(key=\\\"%s\\\", cipher=\\\"%s\\\") != \\\"%s\\\"\\n\", test->key, test->cipher, test->plain);\n            fail++;\n        }\n    }\n    if (fail == 0) {\n        fprintf(stderr, \"All tests successful\\n\");\n    } else {\n        fprintf(stderr, \"%i tests failed\\n\", fail);\n    }\n    return (fail != 0);\n}\n"
  },
  {
    "path": "src/crypto/hmac_sha256.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <crypto/hmac_sha256.h>\n\n#include <string.h>\n\nCHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen)\n{\n    unsigned char rkey[64];\n    if (keylen <= 64) {\n        memcpy(rkey, key, keylen);\n        memset(rkey + keylen, 0, 64 - keylen);\n    } else {\n        CSHA256().Write(key, keylen).Finalize(rkey);\n        memset(rkey + 32, 0, 32);\n    }\n\n    for (int n = 0; n < 64; n++)\n        rkey[n] ^= 0x5c;\n    outer.Write(rkey, 64);\n\n    for (int n = 0; n < 64; n++)\n        rkey[n] ^= 0x5c ^ 0x36;\n    inner.Write(rkey, 64);\n}\n\nvoid CHMAC_SHA256::Finalize(unsigned char hash[OUTPUT_SIZE])\n{\n    unsigned char temp[32];\n    inner.Finalize(temp);\n    outer.Write(temp, 32).Finalize(hash);\n}\n"
  },
  {
    "path": "src/crypto/hmac_sha256.h",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CRYPTO_HMAC_SHA256_H\n#define BITCOIN_CRYPTO_HMAC_SHA256_H\n\n#include <crypto/sha256.h>\n\n#include <stdint.h>\n#include <stdlib.h>\n\n/** A hasher class for HMAC-SHA-256. */\nclass CHMAC_SHA256\n{\nprivate:\n    CSHA256 outer;\n    CSHA256 inner;\n\npublic:\n    static const size_t OUTPUT_SIZE = 32;\n\n    CHMAC_SHA256(const unsigned char* key, size_t keylen);\n    CHMAC_SHA256& Write(const unsigned char* data, size_t len)\n    {\n        inner.Write(data, len);\n        return *this;\n    }\n    void Finalize(unsigned char hash[OUTPUT_SIZE]);\n};\n\n#endif // BITCOIN_CRYPTO_HMAC_SHA256_H\n"
  },
  {
    "path": "src/crypto/hmac_sha512.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <crypto/hmac_sha512.h>\n\n#include <string.h>\n\nCHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen)\n{\n    unsigned char rkey[128];\n    if (keylen <= 128) {\n        memcpy(rkey, key, keylen);\n        memset(rkey + keylen, 0, 128 - keylen);\n    } else {\n        CSHA512().Write(key, keylen).Finalize(rkey);\n        memset(rkey + 64, 0, 64);\n    }\n\n    for (int n = 0; n < 128; n++)\n        rkey[n] ^= 0x5c;\n    outer.Write(rkey, 128);\n\n    for (int n = 0; n < 128; n++)\n        rkey[n] ^= 0x5c ^ 0x36;\n    inner.Write(rkey, 128);\n}\n\nvoid CHMAC_SHA512::Finalize(unsigned char hash[OUTPUT_SIZE])\n{\n    unsigned char temp[64];\n    inner.Finalize(temp);\n    outer.Write(temp, 64).Finalize(hash);\n}\n"
  },
  {
    "path": "src/crypto/hmac_sha512.h",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CRYPTO_HMAC_SHA512_H\n#define BITCOIN_CRYPTO_HMAC_SHA512_H\n\n#include <crypto/sha512.h>\n\n#include <stdint.h>\n#include <stdlib.h>\n\n/** A hasher class for HMAC-SHA-512. */\nclass CHMAC_SHA512\n{\nprivate:\n    CSHA512 outer;\n    CSHA512 inner;\n\npublic:\n    static const size_t OUTPUT_SIZE = 64;\n\n    CHMAC_SHA512(const unsigned char* key, size_t keylen);\n    CHMAC_SHA512& Write(const unsigned char* data, size_t len)\n    {\n        inner.Write(data, len);\n        return *this;\n    }\n    void Finalize(unsigned char hash[OUTPUT_SIZE]);\n};\n\n#endif // BITCOIN_CRYPTO_HMAC_SHA512_H\n"
  },
  {
    "path": "src/crypto/ripemd160.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <crypto/ripemd160.h>\n\n#include <crypto/common.h>\n\n#include <string.h>\n\n// Internal implementation code.\nnamespace\n{\n/// Internal RIPEMD-160 implementation.\nnamespace ripemd160\n{\nuint32_t inline f1(uint32_t x, uint32_t y, uint32_t z) { return x ^ y ^ z; }\nuint32_t inline f2(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (~x & z); }\nuint32_t inline f3(uint32_t x, uint32_t y, uint32_t z) { return (x | ~y) ^ z; }\nuint32_t inline f4(uint32_t x, uint32_t y, uint32_t z) { return (x & z) | (y & ~z); }\nuint32_t inline f5(uint32_t x, uint32_t y, uint32_t z) { return x ^ (y | ~z); }\n\n/** Initialize RIPEMD-160 state. */\nvoid inline Initialize(uint32_t* s)\n{\n    s[0] = 0x67452301ul;\n    s[1] = 0xEFCDAB89ul;\n    s[2] = 0x98BADCFEul;\n    s[3] = 0x10325476ul;\n    s[4] = 0xC3D2E1F0ul;\n}\n\nuint32_t inline rol(uint32_t x, int i) { return (x << i) | (x >> (32 - i)); }\n\nvoid inline Round(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t f, uint32_t x, uint32_t k, int r)\n{\n    a = rol(a + f + x + k, r) + e;\n    c = rol(c, 10);\n}\n\nvoid inline R11(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f1(b, c, d), x, 0, r); }\nvoid inline R21(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f2(b, c, d), x, 0x5A827999ul, r); }\nvoid inline R31(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f3(b, c, d), x, 0x6ED9EBA1ul, r); }\nvoid inline R41(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f4(b, c, d), x, 0x8F1BBCDCul, r); }\nvoid inline R51(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f5(b, c, d), x, 0xA953FD4Eul, r); }\n\nvoid inline R12(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f5(b, c, d), x, 0x50A28BE6ul, r); }\nvoid inline R22(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f4(b, c, d), x, 0x5C4DD124ul, r); }\nvoid inline R32(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f3(b, c, d), x, 0x6D703EF3ul, r); }\nvoid inline R42(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f2(b, c, d), x, 0x7A6D76E9ul, r); }\nvoid inline R52(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f1(b, c, d), x, 0, r); }\n\n/** Perform a RIPEMD-160 transformation, processing a 64-byte chunk. */\nvoid Transform(uint32_t* s, const unsigned char* chunk)\n{\n    uint32_t a1 = s[0], b1 = s[1], c1 = s[2], d1 = s[3], e1 = s[4];\n    uint32_t a2 = a1, b2 = b1, c2 = c1, d2 = d1, e2 = e1;\n    uint32_t w0 = ReadLE32(chunk + 0), w1 = ReadLE32(chunk + 4), w2 = ReadLE32(chunk + 8), w3 = ReadLE32(chunk + 12);\n    uint32_t w4 = ReadLE32(chunk + 16), w5 = ReadLE32(chunk + 20), w6 = ReadLE32(chunk + 24), w7 = ReadLE32(chunk + 28);\n    uint32_t w8 = ReadLE32(chunk + 32), w9 = ReadLE32(chunk + 36), w10 = ReadLE32(chunk + 40), w11 = ReadLE32(chunk + 44);\n    uint32_t w12 = ReadLE32(chunk + 48), w13 = ReadLE32(chunk + 52), w14 = ReadLE32(chunk + 56), w15 = ReadLE32(chunk + 60);\n\n    R11(a1, b1, c1, d1, e1, w0, 11);\n    R12(a2, b2, c2, d2, e2, w5, 8);\n    R11(e1, a1, b1, c1, d1, w1, 14);\n    R12(e2, a2, b2, c2, d2, w14, 9);\n    R11(d1, e1, a1, b1, c1, w2, 15);\n    R12(d2, e2, a2, b2, c2, w7, 9);\n    R11(c1, d1, e1, a1, b1, w3, 12);\n    R12(c2, d2, e2, a2, b2, w0, 11);\n    R11(b1, c1, d1, e1, a1, w4, 5);\n    R12(b2, c2, d2, e2, a2, w9, 13);\n    R11(a1, b1, c1, d1, e1, w5, 8);\n    R12(a2, b2, c2, d2, e2, w2, 15);\n    R11(e1, a1, b1, c1, d1, w6, 7);\n    R12(e2, a2, b2, c2, d2, w11, 15);\n    R11(d1, e1, a1, b1, c1, w7, 9);\n    R12(d2, e2, a2, b2, c2, w4, 5);\n    R11(c1, d1, e1, a1, b1, w8, 11);\n    R12(c2, d2, e2, a2, b2, w13, 7);\n    R11(b1, c1, d1, e1, a1, w9, 13);\n    R12(b2, c2, d2, e2, a2, w6, 7);\n    R11(a1, b1, c1, d1, e1, w10, 14);\n    R12(a2, b2, c2, d2, e2, w15, 8);\n    R11(e1, a1, b1, c1, d1, w11, 15);\n    R12(e2, a2, b2, c2, d2, w8, 11);\n    R11(d1, e1, a1, b1, c1, w12, 6);\n    R12(d2, e2, a2, b2, c2, w1, 14);\n    R11(c1, d1, e1, a1, b1, w13, 7);\n    R12(c2, d2, e2, a2, b2, w10, 14);\n    R11(b1, c1, d1, e1, a1, w14, 9);\n    R12(b2, c2, d2, e2, a2, w3, 12);\n    R11(a1, b1, c1, d1, e1, w15, 8);\n    R12(a2, b2, c2, d2, e2, w12, 6);\n\n    R21(e1, a1, b1, c1, d1, w7, 7);\n    R22(e2, a2, b2, c2, d2, w6, 9);\n    R21(d1, e1, a1, b1, c1, w4, 6);\n    R22(d2, e2, a2, b2, c2, w11, 13);\n    R21(c1, d1, e1, a1, b1, w13, 8);\n    R22(c2, d2, e2, a2, b2, w3, 15);\n    R21(b1, c1, d1, e1, a1, w1, 13);\n    R22(b2, c2, d2, e2, a2, w7, 7);\n    R21(a1, b1, c1, d1, e1, w10, 11);\n    R22(a2, b2, c2, d2, e2, w0, 12);\n    R21(e1, a1, b1, c1, d1, w6, 9);\n    R22(e2, a2, b2, c2, d2, w13, 8);\n    R21(d1, e1, a1, b1, c1, w15, 7);\n    R22(d2, e2, a2, b2, c2, w5, 9);\n    R21(c1, d1, e1, a1, b1, w3, 15);\n    R22(c2, d2, e2, a2, b2, w10, 11);\n    R21(b1, c1, d1, e1, a1, w12, 7);\n    R22(b2, c2, d2, e2, a2, w14, 7);\n    R21(a1, b1, c1, d1, e1, w0, 12);\n    R22(a2, b2, c2, d2, e2, w15, 7);\n    R21(e1, a1, b1, c1, d1, w9, 15);\n    R22(e2, a2, b2, c2, d2, w8, 12);\n    R21(d1, e1, a1, b1, c1, w5, 9);\n    R22(d2, e2, a2, b2, c2, w12, 7);\n    R21(c1, d1, e1, a1, b1, w2, 11);\n    R22(c2, d2, e2, a2, b2, w4, 6);\n    R21(b1, c1, d1, e1, a1, w14, 7);\n    R22(b2, c2, d2, e2, a2, w9, 15);\n    R21(a1, b1, c1, d1, e1, w11, 13);\n    R22(a2, b2, c2, d2, e2, w1, 13);\n    R21(e1, a1, b1, c1, d1, w8, 12);\n    R22(e2, a2, b2, c2, d2, w2, 11);\n\n    R31(d1, e1, a1, b1, c1, w3, 11);\n    R32(d2, e2, a2, b2, c2, w15, 9);\n    R31(c1, d1, e1, a1, b1, w10, 13);\n    R32(c2, d2, e2, a2, b2, w5, 7);\n    R31(b1, c1, d1, e1, a1, w14, 6);\n    R32(b2, c2, d2, e2, a2, w1, 15);\n    R31(a1, b1, c1, d1, e1, w4, 7);\n    R32(a2, b2, c2, d2, e2, w3, 11);\n    R31(e1, a1, b1, c1, d1, w9, 14);\n    R32(e2, a2, b2, c2, d2, w7, 8);\n    R31(d1, e1, a1, b1, c1, w15, 9);\n    R32(d2, e2, a2, b2, c2, w14, 6);\n    R31(c1, d1, e1, a1, b1, w8, 13);\n    R32(c2, d2, e2, a2, b2, w6, 6);\n    R31(b1, c1, d1, e1, a1, w1, 15);\n    R32(b2, c2, d2, e2, a2, w9, 14);\n    R31(a1, b1, c1, d1, e1, w2, 14);\n    R32(a2, b2, c2, d2, e2, w11, 12);\n    R31(e1, a1, b1, c1, d1, w7, 8);\n    R32(e2, a2, b2, c2, d2, w8, 13);\n    R31(d1, e1, a1, b1, c1, w0, 13);\n    R32(d2, e2, a2, b2, c2, w12, 5);\n    R31(c1, d1, e1, a1, b1, w6, 6);\n    R32(c2, d2, e2, a2, b2, w2, 14);\n    R31(b1, c1, d1, e1, a1, w13, 5);\n    R32(b2, c2, d2, e2, a2, w10, 13);\n    R31(a1, b1, c1, d1, e1, w11, 12);\n    R32(a2, b2, c2, d2, e2, w0, 13);\n    R31(e1, a1, b1, c1, d1, w5, 7);\n    R32(e2, a2, b2, c2, d2, w4, 7);\n    R31(d1, e1, a1, b1, c1, w12, 5);\n    R32(d2, e2, a2, b2, c2, w13, 5);\n\n    R41(c1, d1, e1, a1, b1, w1, 11);\n    R42(c2, d2, e2, a2, b2, w8, 15);\n    R41(b1, c1, d1, e1, a1, w9, 12);\n    R42(b2, c2, d2, e2, a2, w6, 5);\n    R41(a1, b1, c1, d1, e1, w11, 14);\n    R42(a2, b2, c2, d2, e2, w4, 8);\n    R41(e1, a1, b1, c1, d1, w10, 15);\n    R42(e2, a2, b2, c2, d2, w1, 11);\n    R41(d1, e1, a1, b1, c1, w0, 14);\n    R42(d2, e2, a2, b2, c2, w3, 14);\n    R41(c1, d1, e1, a1, b1, w8, 15);\n    R42(c2, d2, e2, a2, b2, w11, 14);\n    R41(b1, c1, d1, e1, a1, w12, 9);\n    R42(b2, c2, d2, e2, a2, w15, 6);\n    R41(a1, b1, c1, d1, e1, w4, 8);\n    R42(a2, b2, c2, d2, e2, w0, 14);\n    R41(e1, a1, b1, c1, d1, w13, 9);\n    R42(e2, a2, b2, c2, d2, w5, 6);\n    R41(d1, e1, a1, b1, c1, w3, 14);\n    R42(d2, e2, a2, b2, c2, w12, 9);\n    R41(c1, d1, e1, a1, b1, w7, 5);\n    R42(c2, d2, e2, a2, b2, w2, 12);\n    R41(b1, c1, d1, e1, a1, w15, 6);\n    R42(b2, c2, d2, e2, a2, w13, 9);\n    R41(a1, b1, c1, d1, e1, w14, 8);\n    R42(a2, b2, c2, d2, e2, w9, 12);\n    R41(e1, a1, b1, c1, d1, w5, 6);\n    R42(e2, a2, b2, c2, d2, w7, 5);\n    R41(d1, e1, a1, b1, c1, w6, 5);\n    R42(d2, e2, a2, b2, c2, w10, 15);\n    R41(c1, d1, e1, a1, b1, w2, 12);\n    R42(c2, d2, e2, a2, b2, w14, 8);\n\n    R51(b1, c1, d1, e1, a1, w4, 9);\n    R52(b2, c2, d2, e2, a2, w12, 8);\n    R51(a1, b1, c1, d1, e1, w0, 15);\n    R52(a2, b2, c2, d2, e2, w15, 5);\n    R51(e1, a1, b1, c1, d1, w5, 5);\n    R52(e2, a2, b2, c2, d2, w10, 12);\n    R51(d1, e1, a1, b1, c1, w9, 11);\n    R52(d2, e2, a2, b2, c2, w4, 9);\n    R51(c1, d1, e1, a1, b1, w7, 6);\n    R52(c2, d2, e2, a2, b2, w1, 12);\n    R51(b1, c1, d1, e1, a1, w12, 8);\n    R52(b2, c2, d2, e2, a2, w5, 5);\n    R51(a1, b1, c1, d1, e1, w2, 13);\n    R52(a2, b2, c2, d2, e2, w8, 14);\n    R51(e1, a1, b1, c1, d1, w10, 12);\n    R52(e2, a2, b2, c2, d2, w7, 6);\n    R51(d1, e1, a1, b1, c1, w14, 5);\n    R52(d2, e2, a2, b2, c2, w6, 8);\n    R51(c1, d1, e1, a1, b1, w1, 12);\n    R52(c2, d2, e2, a2, b2, w2, 13);\n    R51(b1, c1, d1, e1, a1, w3, 13);\n    R52(b2, c2, d2, e2, a2, w13, 6);\n    R51(a1, b1, c1, d1, e1, w8, 14);\n    R52(a2, b2, c2, d2, e2, w14, 5);\n    R51(e1, a1, b1, c1, d1, w11, 11);\n    R52(e2, a2, b2, c2, d2, w0, 15);\n    R51(d1, e1, a1, b1, c1, w6, 8);\n    R52(d2, e2, a2, b2, c2, w3, 13);\n    R51(c1, d1, e1, a1, b1, w15, 5);\n    R52(c2, d2, e2, a2, b2, w9, 11);\n    R51(b1, c1, d1, e1, a1, w13, 6);\n    R52(b2, c2, d2, e2, a2, w11, 11);\n\n    uint32_t t = s[0];\n    s[0] = s[1] + c1 + d2;\n    s[1] = s[2] + d1 + e2;\n    s[2] = s[3] + e1 + a2;\n    s[3] = s[4] + a1 + b2;\n    s[4] = t + b1 + c2;\n}\n\n} // namespace ripemd160\n\n} // namespace\n\n////// RIPEMD160\n\nCRIPEMD160::CRIPEMD160() : bytes(0)\n{\n    ripemd160::Initialize(s);\n}\n\nCRIPEMD160& CRIPEMD160::Write(const unsigned char* data, size_t len)\n{\n    const unsigned char* end = data + len;\n    size_t bufsize = bytes % 64;\n    if (bufsize && bufsize + len >= 64) {\n        // Fill the buffer, and process it.\n        memcpy(buf + bufsize, data, 64 - bufsize);\n        bytes += 64 - bufsize;\n        data += 64 - bufsize;\n        ripemd160::Transform(s, buf);\n        bufsize = 0;\n    }\n    while (end >= data + 64) {\n        // Process full chunks directly from the source.\n        ripemd160::Transform(s, data);\n        bytes += 64;\n        data += 64;\n    }\n    if (end > data) {\n        // Fill the buffer with what remains.\n        memcpy(buf + bufsize, data, end - data);\n        bytes += end - data;\n    }\n    return *this;\n}\n\nvoid CRIPEMD160::Finalize(unsigned char hash[OUTPUT_SIZE])\n{\n    static const unsigned char pad[64] = {0x80};\n    unsigned char sizedesc[8];\n    WriteLE64(sizedesc, bytes << 3);\n    Write(pad, 1 + ((119 - (bytes % 64)) % 64));\n    Write(sizedesc, 8);\n    WriteLE32(hash, s[0]);\n    WriteLE32(hash + 4, s[1]);\n    WriteLE32(hash + 8, s[2]);\n    WriteLE32(hash + 12, s[3]);\n    WriteLE32(hash + 16, s[4]);\n}\n\nCRIPEMD160& CRIPEMD160::Reset()\n{\n    bytes = 0;\n    ripemd160::Initialize(s);\n    return *this;\n}\n"
  },
  {
    "path": "src/crypto/ripemd160.h",
    "content": "// Copyright (c) 2014-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CRYPTO_RIPEMD160_H\n#define BITCOIN_CRYPTO_RIPEMD160_H\n\n#include <stdint.h>\n#include <stdlib.h>\n\n/** A hasher class for RIPEMD-160. */\nclass CRIPEMD160\n{\nprivate:\n    uint32_t s[5];\n    unsigned char buf[64];\n    uint64_t bytes;\n\npublic:\n    static const size_t OUTPUT_SIZE = 20;\n\n    CRIPEMD160();\n    CRIPEMD160& Write(const unsigned char* data, size_t len);\n    void Finalize(unsigned char hash[OUTPUT_SIZE]);\n    CRIPEMD160& Reset();\n};\n\n#endif // BITCOIN_CRYPTO_RIPEMD160_H\n"
  },
  {
    "path": "src/crypto/sha1.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <crypto/sha1.h>\n\n#include <crypto/common.h>\n\n#include <string.h>\n\n// Internal implementation code.\nnamespace\n{\n/// Internal SHA-1 implementation.\nnamespace sha1\n{\n/** One round of SHA-1. */\nvoid inline Round(uint32_t a, uint32_t& b, uint32_t c, uint32_t d, uint32_t& e, uint32_t f, uint32_t k, uint32_t w)\n{\n    e += ((a << 5) | (a >> 27)) + f + k + w;\n    b = (b << 30) | (b >> 2);\n}\n\nuint32_t inline f1(uint32_t b, uint32_t c, uint32_t d) { return d ^ (b & (c ^ d)); }\nuint32_t inline f2(uint32_t b, uint32_t c, uint32_t d) { return b ^ c ^ d; }\nuint32_t inline f3(uint32_t b, uint32_t c, uint32_t d) { return (b & c) | (d & (b | c)); }\n\nuint32_t inline left(uint32_t x) { return (x << 1) | (x >> 31); }\n\n/** Initialize SHA-1 state. */\nvoid inline Initialize(uint32_t* s)\n{\n    s[0] = 0x67452301ul;\n    s[1] = 0xEFCDAB89ul;\n    s[2] = 0x98BADCFEul;\n    s[3] = 0x10325476ul;\n    s[4] = 0xC3D2E1F0ul;\n}\n\nconst uint32_t k1 = 0x5A827999ul;\nconst uint32_t k2 = 0x6ED9EBA1ul;\nconst uint32_t k3 = 0x8F1BBCDCul;\nconst uint32_t k4 = 0xCA62C1D6ul;\n\n/** Perform a SHA-1 transformation, processing a 64-byte chunk. */\nvoid Transform(uint32_t* s, const unsigned char* chunk)\n{\n    uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4];\n    uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;\n\n    Round(a, b, c, d, e, f1(b, c, d), k1, w0 = ReadBE32(chunk + 0));\n    Round(e, a, b, c, d, f1(a, b, c), k1, w1 = ReadBE32(chunk + 4));\n    Round(d, e, a, b, c, f1(e, a, b), k1, w2 = ReadBE32(chunk + 8));\n    Round(c, d, e, a, b, f1(d, e, a), k1, w3 = ReadBE32(chunk + 12));\n    Round(b, c, d, e, a, f1(c, d, e), k1, w4 = ReadBE32(chunk + 16));\n    Round(a, b, c, d, e, f1(b, c, d), k1, w5 = ReadBE32(chunk + 20));\n    Round(e, a, b, c, d, f1(a, b, c), k1, w6 = ReadBE32(chunk + 24));\n    Round(d, e, a, b, c, f1(e, a, b), k1, w7 = ReadBE32(chunk + 28));\n    Round(c, d, e, a, b, f1(d, e, a), k1, w8 = ReadBE32(chunk + 32));\n    Round(b, c, d, e, a, f1(c, d, e), k1, w9 = ReadBE32(chunk + 36));\n    Round(a, b, c, d, e, f1(b, c, d), k1, w10 = ReadBE32(chunk + 40));\n    Round(e, a, b, c, d, f1(a, b, c), k1, w11 = ReadBE32(chunk + 44));\n    Round(d, e, a, b, c, f1(e, a, b), k1, w12 = ReadBE32(chunk + 48));\n    Round(c, d, e, a, b, f1(d, e, a), k1, w13 = ReadBE32(chunk + 52));\n    Round(b, c, d, e, a, f1(c, d, e), k1, w14 = ReadBE32(chunk + 56));\n    Round(a, b, c, d, e, f1(b, c, d), k1, w15 = ReadBE32(chunk + 60));\n\n    Round(e, a, b, c, d, f1(a, b, c), k1, w0 = left(w0 ^ w13 ^ w8 ^ w2));\n    Round(d, e, a, b, c, f1(e, a, b), k1, w1 = left(w1 ^ w14 ^ w9 ^ w3));\n    Round(c, d, e, a, b, f1(d, e, a), k1, w2 = left(w2 ^ w15 ^ w10 ^ w4));\n    Round(b, c, d, e, a, f1(c, d, e), k1, w3 = left(w3 ^ w0 ^ w11 ^ w5));\n    Round(a, b, c, d, e, f2(b, c, d), k2, w4 = left(w4 ^ w1 ^ w12 ^ w6));\n    Round(e, a, b, c, d, f2(a, b, c), k2, w5 = left(w5 ^ w2 ^ w13 ^ w7));\n    Round(d, e, a, b, c, f2(e, a, b), k2, w6 = left(w6 ^ w3 ^ w14 ^ w8));\n    Round(c, d, e, a, b, f2(d, e, a), k2, w7 = left(w7 ^ w4 ^ w15 ^ w9));\n    Round(b, c, d, e, a, f2(c, d, e), k2, w8 = left(w8 ^ w5 ^ w0 ^ w10));\n    Round(a, b, c, d, e, f2(b, c, d), k2, w9 = left(w9 ^ w6 ^ w1 ^ w11));\n    Round(e, a, b, c, d, f2(a, b, c), k2, w10 = left(w10 ^ w7 ^ w2 ^ w12));\n    Round(d, e, a, b, c, f2(e, a, b), k2, w11 = left(w11 ^ w8 ^ w3 ^ w13));\n    Round(c, d, e, a, b, f2(d, e, a), k2, w12 = left(w12 ^ w9 ^ w4 ^ w14));\n    Round(b, c, d, e, a, f2(c, d, e), k2, w13 = left(w13 ^ w10 ^ w5 ^ w15));\n    Round(a, b, c, d, e, f2(b, c, d), k2, w14 = left(w14 ^ w11 ^ w6 ^ w0));\n    Round(e, a, b, c, d, f2(a, b, c), k2, w15 = left(w15 ^ w12 ^ w7 ^ w1));\n\n    Round(d, e, a, b, c, f2(e, a, b), k2, w0 = left(w0 ^ w13 ^ w8 ^ w2));\n    Round(c, d, e, a, b, f2(d, e, a), k2, w1 = left(w1 ^ w14 ^ w9 ^ w3));\n    Round(b, c, d, e, a, f2(c, d, e), k2, w2 = left(w2 ^ w15 ^ w10 ^ w4));\n    Round(a, b, c, d, e, f2(b, c, d), k2, w3 = left(w3 ^ w0 ^ w11 ^ w5));\n    Round(e, a, b, c, d, f2(a, b, c), k2, w4 = left(w4 ^ w1 ^ w12 ^ w6));\n    Round(d, e, a, b, c, f2(e, a, b), k2, w5 = left(w5 ^ w2 ^ w13 ^ w7));\n    Round(c, d, e, a, b, f2(d, e, a), k2, w6 = left(w6 ^ w3 ^ w14 ^ w8));\n    Round(b, c, d, e, a, f2(c, d, e), k2, w7 = left(w7 ^ w4 ^ w15 ^ w9));\n    Round(a, b, c, d, e, f3(b, c, d), k3, w8 = left(w8 ^ w5 ^ w0 ^ w10));\n    Round(e, a, b, c, d, f3(a, b, c), k3, w9 = left(w9 ^ w6 ^ w1 ^ w11));\n    Round(d, e, a, b, c, f3(e, a, b), k3, w10 = left(w10 ^ w7 ^ w2 ^ w12));\n    Round(c, d, e, a, b, f3(d, e, a), k3, w11 = left(w11 ^ w8 ^ w3 ^ w13));\n    Round(b, c, d, e, a, f3(c, d, e), k3, w12 = left(w12 ^ w9 ^ w4 ^ w14));\n    Round(a, b, c, d, e, f3(b, c, d), k3, w13 = left(w13 ^ w10 ^ w5 ^ w15));\n    Round(e, a, b, c, d, f3(a, b, c), k3, w14 = left(w14 ^ w11 ^ w6 ^ w0));\n    Round(d, e, a, b, c, f3(e, a, b), k3, w15 = left(w15 ^ w12 ^ w7 ^ w1));\n\n    Round(c, d, e, a, b, f3(d, e, a), k3, w0 = left(w0 ^ w13 ^ w8 ^ w2));\n    Round(b, c, d, e, a, f3(c, d, e), k3, w1 = left(w1 ^ w14 ^ w9 ^ w3));\n    Round(a, b, c, d, e, f3(b, c, d), k3, w2 = left(w2 ^ w15 ^ w10 ^ w4));\n    Round(e, a, b, c, d, f3(a, b, c), k3, w3 = left(w3 ^ w0 ^ w11 ^ w5));\n    Round(d, e, a, b, c, f3(e, a, b), k3, w4 = left(w4 ^ w1 ^ w12 ^ w6));\n    Round(c, d, e, a, b, f3(d, e, a), k3, w5 = left(w5 ^ w2 ^ w13 ^ w7));\n    Round(b, c, d, e, a, f3(c, d, e), k3, w6 = left(w6 ^ w3 ^ w14 ^ w8));\n    Round(a, b, c, d, e, f3(b, c, d), k3, w7 = left(w7 ^ w4 ^ w15 ^ w9));\n    Round(e, a, b, c, d, f3(a, b, c), k3, w8 = left(w8 ^ w5 ^ w0 ^ w10));\n    Round(d, e, a, b, c, f3(e, a, b), k3, w9 = left(w9 ^ w6 ^ w1 ^ w11));\n    Round(c, d, e, a, b, f3(d, e, a), k3, w10 = left(w10 ^ w7 ^ w2 ^ w12));\n    Round(b, c, d, e, a, f3(c, d, e), k3, w11 = left(w11 ^ w8 ^ w3 ^ w13));\n    Round(a, b, c, d, e, f2(b, c, d), k4, w12 = left(w12 ^ w9 ^ w4 ^ w14));\n    Round(e, a, b, c, d, f2(a, b, c), k4, w13 = left(w13 ^ w10 ^ w5 ^ w15));\n    Round(d, e, a, b, c, f2(e, a, b), k4, w14 = left(w14 ^ w11 ^ w6 ^ w0));\n    Round(c, d, e, a, b, f2(d, e, a), k4, w15 = left(w15 ^ w12 ^ w7 ^ w1));\n\n    Round(b, c, d, e, a, f2(c, d, e), k4, w0 = left(w0 ^ w13 ^ w8 ^ w2));\n    Round(a, b, c, d, e, f2(b, c, d), k4, w1 = left(w1 ^ w14 ^ w9 ^ w3));\n    Round(e, a, b, c, d, f2(a, b, c), k4, w2 = left(w2 ^ w15 ^ w10 ^ w4));\n    Round(d, e, a, b, c, f2(e, a, b), k4, w3 = left(w3 ^ w0 ^ w11 ^ w5));\n    Round(c, d, e, a, b, f2(d, e, a), k4, w4 = left(w4 ^ w1 ^ w12 ^ w6));\n    Round(b, c, d, e, a, f2(c, d, e), k4, w5 = left(w5 ^ w2 ^ w13 ^ w7));\n    Round(a, b, c, d, e, f2(b, c, d), k4, w6 = left(w6 ^ w3 ^ w14 ^ w8));\n    Round(e, a, b, c, d, f2(a, b, c), k4, w7 = left(w7 ^ w4 ^ w15 ^ w9));\n    Round(d, e, a, b, c, f2(e, a, b), k4, w8 = left(w8 ^ w5 ^ w0 ^ w10));\n    Round(c, d, e, a, b, f2(d, e, a), k4, w9 = left(w9 ^ w6 ^ w1 ^ w11));\n    Round(b, c, d, e, a, f2(c, d, e), k4, w10 = left(w10 ^ w7 ^ w2 ^ w12));\n    Round(a, b, c, d, e, f2(b, c, d), k4, w11 = left(w11 ^ w8 ^ w3 ^ w13));\n    Round(e, a, b, c, d, f2(a, b, c), k4, w12 = left(w12 ^ w9 ^ w4 ^ w14));\n    Round(d, e, a, b, c, f2(e, a, b), k4, left(w13 ^ w10 ^ w5 ^ w15));\n    Round(c, d, e, a, b, f2(d, e, a), k4, left(w14 ^ w11 ^ w6 ^ w0));\n    Round(b, c, d, e, a, f2(c, d, e), k4, left(w15 ^ w12 ^ w7 ^ w1));\n\n    s[0] += a;\n    s[1] += b;\n    s[2] += c;\n    s[3] += d;\n    s[4] += e;\n}\n\n} // namespace sha1\n\n} // namespace\n\n////// SHA1\n\nCSHA1::CSHA1() : bytes(0)\n{\n    sha1::Initialize(s);\n}\n\nCSHA1& CSHA1::Write(const unsigned char* data, size_t len)\n{\n    const unsigned char* end = data + len;\n    size_t bufsize = bytes % 64;\n    if (bufsize && bufsize + len >= 64) {\n        // Fill the buffer, and process it.\n        memcpy(buf + bufsize, data, 64 - bufsize);\n        bytes += 64 - bufsize;\n        data += 64 - bufsize;\n        sha1::Transform(s, buf);\n        bufsize = 0;\n    }\n    while (end >= data + 64) {\n        // Process full chunks directly from the source.\n        sha1::Transform(s, data);\n        bytes += 64;\n        data += 64;\n    }\n    if (end > data) {\n        // Fill the buffer with what remains.\n        memcpy(buf + bufsize, data, end - data);\n        bytes += end - data;\n    }\n    return *this;\n}\n\nvoid CSHA1::Finalize(unsigned char hash[OUTPUT_SIZE])\n{\n    static const unsigned char pad[64] = {0x80};\n    unsigned char sizedesc[8];\n    WriteBE64(sizedesc, bytes << 3);\n    Write(pad, 1 + ((119 - (bytes % 64)) % 64));\n    Write(sizedesc, 8);\n    WriteBE32(hash, s[0]);\n    WriteBE32(hash + 4, s[1]);\n    WriteBE32(hash + 8, s[2]);\n    WriteBE32(hash + 12, s[3]);\n    WriteBE32(hash + 16, s[4]);\n}\n\nCSHA1& CSHA1::Reset()\n{\n    bytes = 0;\n    sha1::Initialize(s);\n    return *this;\n}\n"
  },
  {
    "path": "src/crypto/sha1.h",
    "content": "// Copyright (c) 2014-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CRYPTO_SHA1_H\n#define BITCOIN_CRYPTO_SHA1_H\n\n#include <stdint.h>\n#include <stdlib.h>\n\n/** A hasher class for SHA1. */\nclass CSHA1\n{\nprivate:\n    uint32_t s[5];\n    unsigned char buf[64];\n    uint64_t bytes;\n\npublic:\n    static const size_t OUTPUT_SIZE = 20;\n\n    CSHA1();\n    CSHA1& Write(const unsigned char* data, size_t len);\n    void Finalize(unsigned char hash[OUTPUT_SIZE]);\n    CSHA1& Reset();\n};\n\n#endif // BITCOIN_CRYPTO_SHA1_H\n"
  },
  {
    "path": "src/crypto/sha256.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <crypto/sha256.h>\n#include <crypto/common.h>\n\n#include <assert.h>\n#include <string.h>\n#include <atomic>\n\n#if defined(__x86_64__) || defined(__amd64__)\n#if defined(USE_ASM)\n#include <cpuid.h>\nnamespace sha256_sse4\n{\nvoid Transform(uint32_t* s, const unsigned char* chunk, size_t blocks);\n}\n#endif\n#endif\n\n// Internal implementation code.\nnamespace\n{\n/// Internal SHA-256 implementation.\nnamespace sha256\n{\nuint32_t inline Ch(uint32_t x, uint32_t y, uint32_t z) { return z ^ (x & (y ^ z)); }\nuint32_t inline Maj(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (z & (x | y)); }\nuint32_t inline Sigma0(uint32_t x) { return (x >> 2 | x << 30) ^ (x >> 13 | x << 19) ^ (x >> 22 | x << 10); }\nuint32_t inline Sigma1(uint32_t x) { return (x >> 6 | x << 26) ^ (x >> 11 | x << 21) ^ (x >> 25 | x << 7); }\nuint32_t inline sigma0(uint32_t x) { return (x >> 7 | x << 25) ^ (x >> 18 | x << 14) ^ (x >> 3); }\nuint32_t inline sigma1(uint32_t x) { return (x >> 17 | x << 15) ^ (x >> 19 | x << 13) ^ (x >> 10); }\n\n/** One round of SHA-256. */\nvoid inline Round(uint32_t a, uint32_t b, uint32_t c, uint32_t& d, uint32_t e, uint32_t f, uint32_t g, uint32_t& h, uint32_t k, uint32_t w)\n{\n    uint32_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w;\n    uint32_t t2 = Sigma0(a) + Maj(a, b, c);\n    d += t1;\n    h = t1 + t2;\n}\n\n/** Initialize SHA-256 state. */\nvoid inline Initialize(uint32_t* s)\n{\n    s[0] = 0x6a09e667ul;\n    s[1] = 0xbb67ae85ul;\n    s[2] = 0x3c6ef372ul;\n    s[3] = 0xa54ff53aul;\n    s[4] = 0x510e527ful;\n    s[5] = 0x9b05688cul;\n    s[6] = 0x1f83d9abul;\n    s[7] = 0x5be0cd19ul;\n}\n\n/** Perform a number of SHA-256 transformations, processing 64-byte chunks. */\nvoid Transform(uint32_t* s, const unsigned char* chunk, size_t blocks)\n{\n    while (blocks--) {\n        uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7];\n        uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;\n\n        Round(a, b, c, d, e, f, g, h, 0x428a2f98, w0 = ReadBE32(chunk + 0));\n        Round(h, a, b, c, d, e, f, g, 0x71374491, w1 = ReadBE32(chunk + 4));\n        Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf, w2 = ReadBE32(chunk + 8));\n        Round(f, g, h, a, b, c, d, e, 0xe9b5dba5, w3 = ReadBE32(chunk + 12));\n        Round(e, f, g, h, a, b, c, d, 0x3956c25b, w4 = ReadBE32(chunk + 16));\n        Round(d, e, f, g, h, a, b, c, 0x59f111f1, w5 = ReadBE32(chunk + 20));\n        Round(c, d, e, f, g, h, a, b, 0x923f82a4, w6 = ReadBE32(chunk + 24));\n        Round(b, c, d, e, f, g, h, a, 0xab1c5ed5, w7 = ReadBE32(chunk + 28));\n        Round(a, b, c, d, e, f, g, h, 0xd807aa98, w8 = ReadBE32(chunk + 32));\n        Round(h, a, b, c, d, e, f, g, 0x12835b01, w9 = ReadBE32(chunk + 36));\n        Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = ReadBE32(chunk + 40));\n        Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = ReadBE32(chunk + 44));\n        Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = ReadBE32(chunk + 48));\n        Round(d, e, f, g, h, a, b, c, 0x80deb1fe, w13 = ReadBE32(chunk + 52));\n        Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = ReadBE32(chunk + 56));\n        Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = ReadBE32(chunk + 60));\n\n        Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0(w1));\n        Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0(w2));\n        Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1(w0) + w11 + sigma0(w3));\n        Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1(w1) + w12 + sigma0(w4));\n        Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1(w2) + w13 + sigma0(w5));\n        Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1(w3) + w14 + sigma0(w6));\n        Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1(w4) + w15 + sigma0(w7));\n        Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1(w5) + w0 + sigma0(w8));\n        Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1(w6) + w1 + sigma0(w9));\n        Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1(w7) + w2 + sigma0(w10));\n        Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1(w8) + w3 + sigma0(w11));\n        Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1(w9) + w4 + sigma0(w12));\n        Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13));\n        Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14));\n        Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15));\n        Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0(w0));\n\n        Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0(w1));\n        Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0(w2));\n        Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1(w0) + w11 + sigma0(w3));\n        Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1(w1) + w12 + sigma0(w4));\n        Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1(w2) + w13 + sigma0(w5));\n        Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1(w3) + w14 + sigma0(w6));\n        Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1(w4) + w15 + sigma0(w7));\n        Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1(w5) + w0 + sigma0(w8));\n        Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1(w6) + w1 + sigma0(w9));\n        Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1(w7) + w2 + sigma0(w10));\n        Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1(w8) + w3 + sigma0(w11));\n        Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1(w9) + w4 + sigma0(w12));\n        Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13));\n        Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14));\n        Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15));\n        Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0(w0));\n\n        Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0(w1));\n        Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0(w2));\n        Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1(w0) + w11 + sigma0(w3));\n        Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1(w1) + w12 + sigma0(w4));\n        Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1(w2) + w13 + sigma0(w5));\n        Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1(w3) + w14 + sigma0(w6));\n        Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1(w4) + w15 + sigma0(w7));\n        Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1(w5) + w0 + sigma0(w8));\n        Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1(w6) + w1 + sigma0(w9));\n        Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1(w7) + w2 + sigma0(w10));\n        Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1(w8) + w3 + sigma0(w11));\n        Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1(w9) + w4 + sigma0(w12));\n        Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13));\n        Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14));\n        Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15));\n        Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0(w0));\n\n        s[0] += a;\n        s[1] += b;\n        s[2] += c;\n        s[3] += d;\n        s[4] += e;\n        s[5] += f;\n        s[6] += g;\n        s[7] += h;\n        chunk += 64;\n    }\n}\n\n} // namespace sha256\n\ntypedef void (*TransformType)(uint32_t*, const unsigned char*, size_t);\n\nbool SelfTest(TransformType tr) {\n    static const unsigned char in1[65] = {0, 0x80};\n    static const unsigned char in2[129] = {\n        0,\n        32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, \n        32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, \n        0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0\n    };\n    static const uint32_t init[8] = {0x6a09e667ul, 0xbb67ae85ul, 0x3c6ef372ul, 0xa54ff53aul, 0x510e527ful, 0x9b05688cul, 0x1f83d9abul, 0x5be0cd19ul};\n    static const uint32_t out1[8] = {0xe3b0c442ul, 0x98fc1c14ul, 0x9afbf4c8ul, 0x996fb924ul, 0x27ae41e4ul, 0x649b934cul, 0xa495991bul, 0x7852b855ul};\n    static const uint32_t out2[8] = {0xce4153b0ul, 0x147c2a86ul, 0x3ed4298eul, 0xe0676bc8ul, 0x79fc77a1ul, 0x2abe1f49ul, 0xb2b055dful, 0x1069523eul};\n    uint32_t buf[8];\n    memcpy(buf, init, sizeof(buf));\n    // Process nothing, and check we remain in the initial state.\n    tr(buf, nullptr, 0);\n    if (memcmp(buf, init, sizeof(buf))) return false;\n    // Process the padded empty string (unaligned)\n    tr(buf, in1 + 1, 1);\n    if (memcmp(buf, out1, sizeof(buf))) return false;\n    // Process 64 spaces (unaligned)\n    memcpy(buf, init, sizeof(buf));\n    tr(buf, in2 + 1, 2);\n    if (memcmp(buf, out2, sizeof(buf))) return false;\n    return true;\n}\n\nTransformType Transform = sha256::Transform;\n\n} // namespace\n\nstd::string SHA256AutoDetect()\n{\n#if defined(USE_ASM) && (defined(__x86_64__) || defined(__amd64__))\n    uint32_t eax, ebx, ecx, edx;\n    if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) && (ecx >> 19) & 1) {\n        Transform = sha256_sse4::Transform;\n        assert(SelfTest(Transform));\n        return \"sse4\";\n    }\n#endif\n\n    assert(SelfTest(Transform));\n    return \"standard\";\n}\n\n////// SHA-256\n\nCSHA256::CSHA256() : bytes(0)\n{\n    sha256::Initialize(s);\n}\n\nCSHA256& CSHA256::Write(const unsigned char* data, size_t len)\n{\n    const unsigned char* end = data + len;\n    size_t bufsize = bytes % 64;\n    if (bufsize && bufsize + len >= 64) {\n        // Fill the buffer, and process it.\n        memcpy(buf + bufsize, data, 64 - bufsize);\n        bytes += 64 - bufsize;\n        data += 64 - bufsize;\n        Transform(s, buf, 1);\n        bufsize = 0;\n    }\n    if (end - data >= 64) {\n        size_t blocks = (end - data) / 64;\n        Transform(s, data, blocks);\n        data += 64 * blocks;\n        bytes += 64 * blocks;\n    }\n    if (end > data) {\n        // Fill the buffer with what remains.\n        memcpy(buf + bufsize, data, end - data);\n        bytes += end - data;\n    }\n    return *this;\n}\n\nvoid CSHA256::Finalize(unsigned char hash[OUTPUT_SIZE])\n{\n    static const unsigned char pad[64] = {0x80};\n    unsigned char sizedesc[8];\n    WriteBE64(sizedesc, bytes << 3);\n    Write(pad, 1 + ((119 - (bytes % 64)) % 64));\n    Write(sizedesc, 8);\n    WriteBE32(hash, s[0]);\n    WriteBE32(hash + 4, s[1]);\n    WriteBE32(hash + 8, s[2]);\n    WriteBE32(hash + 12, s[3]);\n    WriteBE32(hash + 16, s[4]);\n    WriteBE32(hash + 20, s[5]);\n    WriteBE32(hash + 24, s[6]);\n    WriteBE32(hash + 28, s[7]);\n}\n\nCSHA256& CSHA256::Reset()\n{\n    bytes = 0;\n    sha256::Initialize(s);\n    return *this;\n}\n"
  },
  {
    "path": "src/crypto/sha256.h",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CRYPTO_SHA256_H\n#define BITCOIN_CRYPTO_SHA256_H\n\n#include <stdint.h>\n#include <stdlib.h>\n#include <string>\n\n/** A hasher class for SHA-256. */\nclass CSHA256\n{\nprivate:\n    uint32_t s[8];\n    unsigned char buf[64];\n    uint64_t bytes;\n\npublic:\n    static const size_t OUTPUT_SIZE = 32;\n\n    CSHA256();\n    CSHA256& Write(const unsigned char* data, size_t len);\n    void Finalize(unsigned char hash[OUTPUT_SIZE]);\n    CSHA256& Reset();\n};\n\n/** Autodetect the best available SHA256 implementation.\n *  Returns the name of the implementation.\n */\nstd::string SHA256AutoDetect();\n\n#endif // BITCOIN_CRYPTO_SHA256_H\n"
  },
  {
    "path": "src/crypto/sha256_sse4.cpp",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n//\n// This is a translation to GCC extended asm syntax from YASM code by Intel\n// (available at the bottom of this file).\n\n#include <stdint.h>\n#include <stdlib.h>\n\n#if defined(__x86_64__) || defined(__amd64__)\n\nnamespace sha256_sse4\n{\nvoid Transform(uint32_t* s, const unsigned char* chunk, size_t blocks)\n{\n    static const uint32_t K256 alignas(16) [] = {\n        0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n        0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n        0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n        0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n        0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n        0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n        0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n        0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n        0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n        0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n        0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n        0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n        0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n        0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n        0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n        0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,\n    };\n    static const uint32_t FLIP_MASK alignas(16) [] = {0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f};\n    static const uint32_t SHUF_00BA alignas(16) [] = {0x03020100, 0x0b0a0908, 0xffffffff, 0xffffffff};\n    static const uint32_t SHUF_DC00 alignas(16) [] = {0xffffffff, 0xffffffff, 0x03020100, 0x0b0a0908};\n    uint32_t a, b, c, d, f, g, h, y0, y1, y2;\n    uint64_t tbl;\n    uint64_t inp_end, inp;\n    uint32_t xfer alignas(16) [4];\n\n    __asm__ __volatile__(\n        \"shl    $0x6,%2;\"\n        \"je     Ldone_hash_%=;\"\n        \"add    %1,%2;\"\n        \"mov    %2,%14;\"\n        \"mov    (%0),%3;\"\n        \"mov    0x4(%0),%4;\"\n        \"mov    0x8(%0),%5;\"\n        \"mov    0xc(%0),%6;\"\n        \"mov    0x10(%0),%k2;\"\n        \"mov    0x14(%0),%7;\"\n        \"mov    0x18(%0),%8;\"\n        \"mov    0x1c(%0),%9;\"\n        \"movdqa %18,%%xmm12;\"\n        \"movdqa %19,%%xmm10;\"\n        \"movdqa %20,%%xmm11;\"\n\n        \"Lloop0_%=:\"\n        \"lea    %17,%13;\"\n        \"movdqu (%1),%%xmm4;\"\n        \"pshufb %%xmm12,%%xmm4;\"\n        \"movdqu 0x10(%1),%%xmm5;\"\n        \"pshufb %%xmm12,%%xmm5;\"\n        \"movdqu 0x20(%1),%%xmm6;\"\n        \"pshufb %%xmm12,%%xmm6;\"\n        \"movdqu 0x30(%1),%%xmm7;\"\n        \"pshufb %%xmm12,%%xmm7;\"\n        \"mov    %1,%15;\"\n        \"mov    $3,%1;\"\n\n        \"Lloop1_%=:\"\n        \"movdqa 0x0(%13),%%xmm9;\"\n        \"paddd  %%xmm4,%%xmm9;\"\n        \"movdqa %%xmm9,%16;\"\n        \"movdqa %%xmm7,%%xmm0;\"\n        \"mov    %k2,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %3,%11;\"\n        \"palignr $0x4,%%xmm6,%%xmm0;\"\n        \"ror    $0x9,%11;\"\n        \"xor    %k2,%10;\"\n        \"mov    %7,%12;\"\n        \"ror    $0x5,%10;\"\n        \"movdqa %%xmm5,%%xmm1;\"\n        \"xor    %3,%11;\"\n        \"xor    %8,%12;\"\n        \"paddd  %%xmm4,%%xmm0;\"\n        \"xor    %k2,%10;\"\n        \"and    %k2,%12;\"\n        \"ror    $0xb,%11;\"\n        \"palignr $0x4,%%xmm4,%%xmm1;\"\n        \"xor    %3,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %8,%12;\"\n        \"movdqa %%xmm1,%%xmm2;\"\n        \"ror    $0x2,%11;\"\n        \"add    %10,%12;\"\n        \"add    %16,%12;\"\n        \"movdqa %%xmm1,%%xmm3;\"\n        \"mov    %3,%10;\"\n        \"add    %12,%9;\"\n        \"mov    %3,%12;\"\n        \"pslld  $0x19,%%xmm1;\"\n        \"or     %5,%10;\"\n        \"add    %9,%6;\"\n        \"and    %5,%12;\"\n        \"psrld  $0x7,%%xmm2;\"\n        \"and    %4,%10;\"\n        \"add    %11,%9;\"\n        \"por    %%xmm2,%%xmm1;\"\n        \"or     %12,%10;\"\n        \"add    %10,%9;\"\n        \"movdqa %%xmm3,%%xmm2;\"\n        \"mov    %6,%10;\"\n        \"mov    %9,%11;\"\n        \"movdqa %%xmm3,%%xmm8;\"\n        \"ror    $0xe,%10;\"\n        \"xor    %6,%10;\"\n        \"mov    %k2,%12;\"\n        \"ror    $0x9,%11;\"\n        \"pslld  $0xe,%%xmm3;\"\n        \"xor    %9,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %7,%12;\"\n        \"psrld  $0x12,%%xmm2;\"\n        \"ror    $0xb,%11;\"\n        \"xor    %6,%10;\"\n        \"and    %6,%12;\"\n        \"ror    $0x6,%10;\"\n        \"pxor   %%xmm3,%%xmm1;\"\n        \"xor    %9,%11;\"\n        \"xor    %7,%12;\"\n        \"psrld  $0x3,%%xmm8;\"\n        \"add    %10,%12;\"\n        \"add    4+%16,%12;\"\n        \"ror    $0x2,%11;\"\n        \"pxor   %%xmm2,%%xmm1;\"\n        \"mov    %9,%10;\"\n        \"add    %12,%8;\"\n        \"mov    %9,%12;\"\n        \"pxor   %%xmm8,%%xmm1;\"\n        \"or     %4,%10;\"\n        \"add    %8,%5;\"\n        \"and    %4,%12;\"\n        \"pshufd $0xfa,%%xmm7,%%xmm2;\"\n        \"and    %3,%10;\"\n        \"add    %11,%8;\"\n        \"paddd  %%xmm1,%%xmm0;\"\n        \"or     %12,%10;\"\n        \"add    %10,%8;\"\n        \"movdqa %%xmm2,%%xmm3;\"\n        \"mov    %5,%10;\"\n        \"mov    %8,%11;\"\n        \"ror    $0xe,%10;\"\n        \"movdqa %%xmm2,%%xmm8;\"\n        \"xor    %5,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %6,%12;\"\n        \"xor    %8,%11;\"\n        \"ror    $0x5,%10;\"\n        \"psrlq  $0x11,%%xmm2;\"\n        \"xor    %k2,%12;\"\n        \"psrlq  $0x13,%%xmm3;\"\n        \"xor    %5,%10;\"\n        \"and    %5,%12;\"\n        \"psrld  $0xa,%%xmm8;\"\n        \"ror    $0xb,%11;\"\n        \"xor    %8,%11;\"\n        \"xor    %k2,%12;\"\n        \"ror    $0x6,%10;\"\n        \"pxor   %%xmm3,%%xmm2;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    8+%16,%12;\"\n        \"pxor   %%xmm2,%%xmm8;\"\n        \"mov    %8,%10;\"\n        \"add    %12,%7;\"\n        \"mov    %8,%12;\"\n        \"pshufb %%xmm10,%%xmm8;\"\n        \"or     %3,%10;\"\n        \"add    %7,%4;\"\n        \"and    %3,%12;\"\n        \"paddd  %%xmm8,%%xmm0;\"\n        \"and    %9,%10;\"\n        \"add    %11,%7;\"\n        \"pshufd $0x50,%%xmm0,%%xmm2;\"\n        \"or     %12,%10;\"\n        \"add    %10,%7;\"\n        \"movdqa %%xmm2,%%xmm3;\"\n        \"mov    %4,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %7,%11;\"\n        \"movdqa %%xmm2,%%xmm4;\"\n        \"ror    $0x9,%11;\"\n        \"xor    %4,%10;\"\n        \"mov    %5,%12;\"\n        \"ror    $0x5,%10;\"\n        \"psrlq  $0x11,%%xmm2;\"\n        \"xor    %7,%11;\"\n        \"xor    %6,%12;\"\n        \"psrlq  $0x13,%%xmm3;\"\n        \"xor    %4,%10;\"\n        \"and    %4,%12;\"\n        \"ror    $0xb,%11;\"\n        \"psrld  $0xa,%%xmm4;\"\n        \"xor    %7,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %6,%12;\"\n        \"pxor   %%xmm3,%%xmm2;\"\n        \"ror    $0x2,%11;\"\n        \"add    %10,%12;\"\n        \"add    12+%16,%12;\"\n        \"pxor   %%xmm2,%%xmm4;\"\n        \"mov    %7,%10;\"\n        \"add    %12,%k2;\"\n        \"mov    %7,%12;\"\n        \"pshufb %%xmm11,%%xmm4;\"\n        \"or     %9,%10;\"\n        \"add    %k2,%3;\"\n        \"and    %9,%12;\"\n        \"paddd  %%xmm0,%%xmm4;\"\n        \"and    %8,%10;\"\n        \"add    %11,%k2;\"\n        \"or     %12,%10;\"\n        \"add    %10,%k2;\"\n        \"movdqa 0x10(%13),%%xmm9;\"\n        \"paddd  %%xmm5,%%xmm9;\"\n        \"movdqa %%xmm9,%16;\"\n        \"movdqa %%xmm4,%%xmm0;\"\n        \"mov    %3,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %k2,%11;\"\n        \"palignr $0x4,%%xmm7,%%xmm0;\"\n        \"ror    $0x9,%11;\"\n        \"xor    %3,%10;\"\n        \"mov    %4,%12;\"\n        \"ror    $0x5,%10;\"\n        \"movdqa %%xmm6,%%xmm1;\"\n        \"xor    %k2,%11;\"\n        \"xor    %5,%12;\"\n        \"paddd  %%xmm5,%%xmm0;\"\n        \"xor    %3,%10;\"\n        \"and    %3,%12;\"\n        \"ror    $0xb,%11;\"\n        \"palignr $0x4,%%xmm5,%%xmm1;\"\n        \"xor    %k2,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %5,%12;\"\n        \"movdqa %%xmm1,%%xmm2;\"\n        \"ror    $0x2,%11;\"\n        \"add    %10,%12;\"\n        \"add    %16,%12;\"\n        \"movdqa %%xmm1,%%xmm3;\"\n        \"mov    %k2,%10;\"\n        \"add    %12,%6;\"\n        \"mov    %k2,%12;\"\n        \"pslld  $0x19,%%xmm1;\"\n        \"or     %8,%10;\"\n        \"add    %6,%9;\"\n        \"and    %8,%12;\"\n        \"psrld  $0x7,%%xmm2;\"\n        \"and    %7,%10;\"\n        \"add    %11,%6;\"\n        \"por    %%xmm2,%%xmm1;\"\n        \"or     %12,%10;\"\n        \"add    %10,%6;\"\n        \"movdqa %%xmm3,%%xmm2;\"\n        \"mov    %9,%10;\"\n        \"mov    %6,%11;\"\n        \"movdqa %%xmm3,%%xmm8;\"\n        \"ror    $0xe,%10;\"\n        \"xor    %9,%10;\"\n        \"mov    %3,%12;\"\n        \"ror    $0x9,%11;\"\n        \"pslld  $0xe,%%xmm3;\"\n        \"xor    %6,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %4,%12;\"\n        \"psrld  $0x12,%%xmm2;\"\n        \"ror    $0xb,%11;\"\n        \"xor    %9,%10;\"\n        \"and    %9,%12;\"\n        \"ror    $0x6,%10;\"\n        \"pxor   %%xmm3,%%xmm1;\"\n        \"xor    %6,%11;\"\n        \"xor    %4,%12;\"\n        \"psrld  $0x3,%%xmm8;\"\n        \"add    %10,%12;\"\n        \"add    4+%16,%12;\"\n        \"ror    $0x2,%11;\"\n        \"pxor   %%xmm2,%%xmm1;\"\n        \"mov    %6,%10;\"\n        \"add    %12,%5;\"\n        \"mov    %6,%12;\"\n        \"pxor   %%xmm8,%%xmm1;\"\n        \"or     %7,%10;\"\n        \"add    %5,%8;\"\n        \"and    %7,%12;\"\n        \"pshufd $0xfa,%%xmm4,%%xmm2;\"\n        \"and    %k2,%10;\"\n        \"add    %11,%5;\"\n        \"paddd  %%xmm1,%%xmm0;\"\n        \"or     %12,%10;\"\n        \"add    %10,%5;\"\n        \"movdqa %%xmm2,%%xmm3;\"\n        \"mov    %8,%10;\"\n        \"mov    %5,%11;\"\n        \"ror    $0xe,%10;\"\n        \"movdqa %%xmm2,%%xmm8;\"\n        \"xor    %8,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %9,%12;\"\n        \"xor    %5,%11;\"\n        \"ror    $0x5,%10;\"\n        \"psrlq  $0x11,%%xmm2;\"\n        \"xor    %3,%12;\"\n        \"psrlq  $0x13,%%xmm3;\"\n        \"xor    %8,%10;\"\n        \"and    %8,%12;\"\n        \"psrld  $0xa,%%xmm8;\"\n        \"ror    $0xb,%11;\"\n        \"xor    %5,%11;\"\n        \"xor    %3,%12;\"\n        \"ror    $0x6,%10;\"\n        \"pxor   %%xmm3,%%xmm2;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    8+%16,%12;\"\n        \"pxor   %%xmm2,%%xmm8;\"\n        \"mov    %5,%10;\"\n        \"add    %12,%4;\"\n        \"mov    %5,%12;\"\n        \"pshufb %%xmm10,%%xmm8;\"\n        \"or     %k2,%10;\"\n        \"add    %4,%7;\"\n        \"and    %k2,%12;\"\n        \"paddd  %%xmm8,%%xmm0;\"\n        \"and    %6,%10;\"\n        \"add    %11,%4;\"\n        \"pshufd $0x50,%%xmm0,%%xmm2;\"\n        \"or     %12,%10;\"\n        \"add    %10,%4;\"\n        \"movdqa %%xmm2,%%xmm3;\"\n        \"mov    %7,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %4,%11;\"\n        \"movdqa %%xmm2,%%xmm5;\"\n        \"ror    $0x9,%11;\"\n        \"xor    %7,%10;\"\n        \"mov    %8,%12;\"\n        \"ror    $0x5,%10;\"\n        \"psrlq  $0x11,%%xmm2;\"\n        \"xor    %4,%11;\"\n        \"xor    %9,%12;\"\n        \"psrlq  $0x13,%%xmm3;\"\n        \"xor    %7,%10;\"\n        \"and    %7,%12;\"\n        \"ror    $0xb,%11;\"\n        \"psrld  $0xa,%%xmm5;\"\n        \"xor    %4,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %9,%12;\"\n        \"pxor   %%xmm3,%%xmm2;\"\n        \"ror    $0x2,%11;\"\n        \"add    %10,%12;\"\n        \"add    12+%16,%12;\"\n        \"pxor   %%xmm2,%%xmm5;\"\n        \"mov    %4,%10;\"\n        \"add    %12,%3;\"\n        \"mov    %4,%12;\"\n        \"pshufb %%xmm11,%%xmm5;\"\n        \"or     %6,%10;\"\n        \"add    %3,%k2;\"\n        \"and    %6,%12;\"\n        \"paddd  %%xmm0,%%xmm5;\"\n        \"and    %5,%10;\"\n        \"add    %11,%3;\"\n        \"or     %12,%10;\"\n        \"add    %10,%3;\"\n        \"movdqa 0x20(%13),%%xmm9;\"\n        \"paddd  %%xmm6,%%xmm9;\"\n        \"movdqa %%xmm9,%16;\"\n        \"movdqa %%xmm5,%%xmm0;\"\n        \"mov    %k2,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %3,%11;\"\n        \"palignr $0x4,%%xmm4,%%xmm0;\"\n        \"ror    $0x9,%11;\"\n        \"xor    %k2,%10;\"\n        \"mov    %7,%12;\"\n        \"ror    $0x5,%10;\"\n        \"movdqa %%xmm7,%%xmm1;\"\n        \"xor    %3,%11;\"\n        \"xor    %8,%12;\"\n        \"paddd  %%xmm6,%%xmm0;\"\n        \"xor    %k2,%10;\"\n        \"and    %k2,%12;\"\n        \"ror    $0xb,%11;\"\n        \"palignr $0x4,%%xmm6,%%xmm1;\"\n        \"xor    %3,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %8,%12;\"\n        \"movdqa %%xmm1,%%xmm2;\"\n        \"ror    $0x2,%11;\"\n        \"add    %10,%12;\"\n        \"add    %16,%12;\"\n        \"movdqa %%xmm1,%%xmm3;\"\n        \"mov    %3,%10;\"\n        \"add    %12,%9;\"\n        \"mov    %3,%12;\"\n        \"pslld  $0x19,%%xmm1;\"\n        \"or     %5,%10;\"\n        \"add    %9,%6;\"\n        \"and    %5,%12;\"\n        \"psrld  $0x7,%%xmm2;\"\n        \"and    %4,%10;\"\n        \"add    %11,%9;\"\n        \"por    %%xmm2,%%xmm1;\"\n        \"or     %12,%10;\"\n        \"add    %10,%9;\"\n        \"movdqa %%xmm3,%%xmm2;\"\n        \"mov    %6,%10;\"\n        \"mov    %9,%11;\"\n        \"movdqa %%xmm3,%%xmm8;\"\n        \"ror    $0xe,%10;\"\n        \"xor    %6,%10;\"\n        \"mov    %k2,%12;\"\n        \"ror    $0x9,%11;\"\n        \"pslld  $0xe,%%xmm3;\"\n        \"xor    %9,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %7,%12;\"\n        \"psrld  $0x12,%%xmm2;\"\n        \"ror    $0xb,%11;\"\n        \"xor    %6,%10;\"\n        \"and    %6,%12;\"\n        \"ror    $0x6,%10;\"\n        \"pxor   %%xmm3,%%xmm1;\"\n        \"xor    %9,%11;\"\n        \"xor    %7,%12;\"\n        \"psrld  $0x3,%%xmm8;\"\n        \"add    %10,%12;\"\n        \"add    4+%16,%12;\"\n        \"ror    $0x2,%11;\"\n        \"pxor   %%xmm2,%%xmm1;\"\n        \"mov    %9,%10;\"\n        \"add    %12,%8;\"\n        \"mov    %9,%12;\"\n        \"pxor   %%xmm8,%%xmm1;\"\n        \"or     %4,%10;\"\n        \"add    %8,%5;\"\n        \"and    %4,%12;\"\n        \"pshufd $0xfa,%%xmm5,%%xmm2;\"\n        \"and    %3,%10;\"\n        \"add    %11,%8;\"\n        \"paddd  %%xmm1,%%xmm0;\"\n        \"or     %12,%10;\"\n        \"add    %10,%8;\"\n        \"movdqa %%xmm2,%%xmm3;\"\n        \"mov    %5,%10;\"\n        \"mov    %8,%11;\"\n        \"ror    $0xe,%10;\"\n        \"movdqa %%xmm2,%%xmm8;\"\n        \"xor    %5,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %6,%12;\"\n        \"xor    %8,%11;\"\n        \"ror    $0x5,%10;\"\n        \"psrlq  $0x11,%%xmm2;\"\n        \"xor    %k2,%12;\"\n        \"psrlq  $0x13,%%xmm3;\"\n        \"xor    %5,%10;\"\n        \"and    %5,%12;\"\n        \"psrld  $0xa,%%xmm8;\"\n        \"ror    $0xb,%11;\"\n        \"xor    %8,%11;\"\n        \"xor    %k2,%12;\"\n        \"ror    $0x6,%10;\"\n        \"pxor   %%xmm3,%%xmm2;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    8+%16,%12;\"\n        \"pxor   %%xmm2,%%xmm8;\"\n        \"mov    %8,%10;\"\n        \"add    %12,%7;\"\n        \"mov    %8,%12;\"\n        \"pshufb %%xmm10,%%xmm8;\"\n        \"or     %3,%10;\"\n        \"add    %7,%4;\"\n        \"and    %3,%12;\"\n        \"paddd  %%xmm8,%%xmm0;\"\n        \"and    %9,%10;\"\n        \"add    %11,%7;\"\n        \"pshufd $0x50,%%xmm0,%%xmm2;\"\n        \"or     %12,%10;\"\n        \"add    %10,%7;\"\n        \"movdqa %%xmm2,%%xmm3;\"\n        \"mov    %4,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %7,%11;\"\n        \"movdqa %%xmm2,%%xmm6;\"\n        \"ror    $0x9,%11;\"\n        \"xor    %4,%10;\"\n        \"mov    %5,%12;\"\n        \"ror    $0x5,%10;\"\n        \"psrlq  $0x11,%%xmm2;\"\n        \"xor    %7,%11;\"\n        \"xor    %6,%12;\"\n        \"psrlq  $0x13,%%xmm3;\"\n        \"xor    %4,%10;\"\n        \"and    %4,%12;\"\n        \"ror    $0xb,%11;\"\n        \"psrld  $0xa,%%xmm6;\"\n        \"xor    %7,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %6,%12;\"\n        \"pxor   %%xmm3,%%xmm2;\"\n        \"ror    $0x2,%11;\"\n        \"add    %10,%12;\"\n        \"add    12+%16,%12;\"\n        \"pxor   %%xmm2,%%xmm6;\"\n        \"mov    %7,%10;\"\n        \"add    %12,%k2;\"\n        \"mov    %7,%12;\"\n        \"pshufb %%xmm11,%%xmm6;\"\n        \"or     %9,%10;\"\n        \"add    %k2,%3;\"\n        \"and    %9,%12;\"\n        \"paddd  %%xmm0,%%xmm6;\"\n        \"and    %8,%10;\"\n        \"add    %11,%k2;\"\n        \"or     %12,%10;\"\n        \"add    %10,%k2;\"\n        \"movdqa 0x30(%13),%%xmm9;\"\n        \"paddd  %%xmm7,%%xmm9;\"\n        \"movdqa %%xmm9,%16;\"\n        \"add    $0x40,%13;\"\n        \"movdqa %%xmm6,%%xmm0;\"\n        \"mov    %3,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %k2,%11;\"\n        \"palignr $0x4,%%xmm5,%%xmm0;\"\n        \"ror    $0x9,%11;\"\n        \"xor    %3,%10;\"\n        \"mov    %4,%12;\"\n        \"ror    $0x5,%10;\"\n        \"movdqa %%xmm4,%%xmm1;\"\n        \"xor    %k2,%11;\"\n        \"xor    %5,%12;\"\n        \"paddd  %%xmm7,%%xmm0;\"\n        \"xor    %3,%10;\"\n        \"and    %3,%12;\"\n        \"ror    $0xb,%11;\"\n        \"palignr $0x4,%%xmm7,%%xmm1;\"\n        \"xor    %k2,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %5,%12;\"\n        \"movdqa %%xmm1,%%xmm2;\"\n        \"ror    $0x2,%11;\"\n        \"add    %10,%12;\"\n        \"add    %16,%12;\"\n        \"movdqa %%xmm1,%%xmm3;\"\n        \"mov    %k2,%10;\"\n        \"add    %12,%6;\"\n        \"mov    %k2,%12;\"\n        \"pslld  $0x19,%%xmm1;\"\n        \"or     %8,%10;\"\n        \"add    %6,%9;\"\n        \"and    %8,%12;\"\n        \"psrld  $0x7,%%xmm2;\"\n        \"and    %7,%10;\"\n        \"add    %11,%6;\"\n        \"por    %%xmm2,%%xmm1;\"\n        \"or     %12,%10;\"\n        \"add    %10,%6;\"\n        \"movdqa %%xmm3,%%xmm2;\"\n        \"mov    %9,%10;\"\n        \"mov    %6,%11;\"\n        \"movdqa %%xmm3,%%xmm8;\"\n        \"ror    $0xe,%10;\"\n        \"xor    %9,%10;\"\n        \"mov    %3,%12;\"\n        \"ror    $0x9,%11;\"\n        \"pslld  $0xe,%%xmm3;\"\n        \"xor    %6,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %4,%12;\"\n        \"psrld  $0x12,%%xmm2;\"\n        \"ror    $0xb,%11;\"\n        \"xor    %9,%10;\"\n        \"and    %9,%12;\"\n        \"ror    $0x6,%10;\"\n        \"pxor   %%xmm3,%%xmm1;\"\n        \"xor    %6,%11;\"\n        \"xor    %4,%12;\"\n        \"psrld  $0x3,%%xmm8;\"\n        \"add    %10,%12;\"\n        \"add    4+%16,%12;\"\n        \"ror    $0x2,%11;\"\n        \"pxor   %%xmm2,%%xmm1;\"\n        \"mov    %6,%10;\"\n        \"add    %12,%5;\"\n        \"mov    %6,%12;\"\n        \"pxor   %%xmm8,%%xmm1;\"\n        \"or     %7,%10;\"\n        \"add    %5,%8;\"\n        \"and    %7,%12;\"\n        \"pshufd $0xfa,%%xmm6,%%xmm2;\"\n        \"and    %k2,%10;\"\n        \"add    %11,%5;\"\n        \"paddd  %%xmm1,%%xmm0;\"\n        \"or     %12,%10;\"\n        \"add    %10,%5;\"\n        \"movdqa %%xmm2,%%xmm3;\"\n        \"mov    %8,%10;\"\n        \"mov    %5,%11;\"\n        \"ror    $0xe,%10;\"\n        \"movdqa %%xmm2,%%xmm8;\"\n        \"xor    %8,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %9,%12;\"\n        \"xor    %5,%11;\"\n        \"ror    $0x5,%10;\"\n        \"psrlq  $0x11,%%xmm2;\"\n        \"xor    %3,%12;\"\n        \"psrlq  $0x13,%%xmm3;\"\n        \"xor    %8,%10;\"\n        \"and    %8,%12;\"\n        \"psrld  $0xa,%%xmm8;\"\n        \"ror    $0xb,%11;\"\n        \"xor    %5,%11;\"\n        \"xor    %3,%12;\"\n        \"ror    $0x6,%10;\"\n        \"pxor   %%xmm3,%%xmm2;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    8+%16,%12;\"\n        \"pxor   %%xmm2,%%xmm8;\"\n        \"mov    %5,%10;\"\n        \"add    %12,%4;\"\n        \"mov    %5,%12;\"\n        \"pshufb %%xmm10,%%xmm8;\"\n        \"or     %k2,%10;\"\n        \"add    %4,%7;\"\n        \"and    %k2,%12;\"\n        \"paddd  %%xmm8,%%xmm0;\"\n        \"and    %6,%10;\"\n        \"add    %11,%4;\"\n        \"pshufd $0x50,%%xmm0,%%xmm2;\"\n        \"or     %12,%10;\"\n        \"add    %10,%4;\"\n        \"movdqa %%xmm2,%%xmm3;\"\n        \"mov    %7,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %4,%11;\"\n        \"movdqa %%xmm2,%%xmm7;\"\n        \"ror    $0x9,%11;\"\n        \"xor    %7,%10;\"\n        \"mov    %8,%12;\"\n        \"ror    $0x5,%10;\"\n        \"psrlq  $0x11,%%xmm2;\"\n        \"xor    %4,%11;\"\n        \"xor    %9,%12;\"\n        \"psrlq  $0x13,%%xmm3;\"\n        \"xor    %7,%10;\"\n        \"and    %7,%12;\"\n        \"ror    $0xb,%11;\"\n        \"psrld  $0xa,%%xmm7;\"\n        \"xor    %4,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %9,%12;\"\n        \"pxor   %%xmm3,%%xmm2;\"\n        \"ror    $0x2,%11;\"\n        \"add    %10,%12;\"\n        \"add    12+%16,%12;\"\n        \"pxor   %%xmm2,%%xmm7;\"\n        \"mov    %4,%10;\"\n        \"add    %12,%3;\"\n        \"mov    %4,%12;\"\n        \"pshufb %%xmm11,%%xmm7;\"\n        \"or     %6,%10;\"\n        \"add    %3,%k2;\"\n        \"and    %6,%12;\"\n        \"paddd  %%xmm0,%%xmm7;\"\n        \"and    %5,%10;\"\n        \"add    %11,%3;\"\n        \"or     %12,%10;\"\n        \"add    %10,%3;\"\n        \"sub    $0x1,%1;\"\n        \"jne    Lloop1_%=;\"\n        \"mov    $0x2,%1;\"\n\n        \"Lloop2_%=:\"\n        \"paddd  0x0(%13),%%xmm4;\"\n        \"movdqa %%xmm4,%16;\"\n        \"mov    %k2,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %3,%11;\"\n        \"xor    %k2,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %7,%12;\"\n        \"xor    %3,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %8,%12;\"\n        \"xor    %k2,%10;\"\n        \"ror    $0xb,%11;\"\n        \"and    %k2,%12;\"\n        \"xor    %3,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %8,%12;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    %16,%12;\"\n        \"mov    %3,%10;\"\n        \"add    %12,%9;\"\n        \"mov    %3,%12;\"\n        \"or     %5,%10;\"\n        \"add    %9,%6;\"\n        \"and    %5,%12;\"\n        \"and    %4,%10;\"\n        \"add    %11,%9;\"\n        \"or     %12,%10;\"\n        \"add    %10,%9;\"\n        \"mov    %6,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %9,%11;\"\n        \"xor    %6,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %k2,%12;\"\n        \"xor    %9,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %7,%12;\"\n        \"xor    %6,%10;\"\n        \"ror    $0xb,%11;\"\n        \"and    %6,%12;\"\n        \"xor    %9,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %7,%12;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    4+%16,%12;\"\n        \"mov    %9,%10;\"\n        \"add    %12,%8;\"\n        \"mov    %9,%12;\"\n        \"or     %4,%10;\"\n        \"add    %8,%5;\"\n        \"and    %4,%12;\"\n        \"and    %3,%10;\"\n        \"add    %11,%8;\"\n        \"or     %12,%10;\"\n        \"add    %10,%8;\"\n        \"mov    %5,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %8,%11;\"\n        \"xor    %5,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %6,%12;\"\n        \"xor    %8,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %k2,%12;\"\n        \"xor    %5,%10;\"\n        \"ror    $0xb,%11;\"\n        \"and    %5,%12;\"\n        \"xor    %8,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %k2,%12;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    8+%16,%12;\"\n        \"mov    %8,%10;\"\n        \"add    %12,%7;\"\n        \"mov    %8,%12;\"\n        \"or     %3,%10;\"\n        \"add    %7,%4;\"\n        \"and    %3,%12;\"\n        \"and    %9,%10;\"\n        \"add    %11,%7;\"\n        \"or     %12,%10;\"\n        \"add    %10,%7;\"\n        \"mov    %4,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %7,%11;\"\n        \"xor    %4,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %5,%12;\"\n        \"xor    %7,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %6,%12;\"\n        \"xor    %4,%10;\"\n        \"ror    $0xb,%11;\"\n        \"and    %4,%12;\"\n        \"xor    %7,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %6,%12;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    12+%16,%12;\"\n        \"mov    %7,%10;\"\n        \"add    %12,%k2;\"\n        \"mov    %7,%12;\"\n        \"or     %9,%10;\"\n        \"add    %k2,%3;\"\n        \"and    %9,%12;\"\n        \"and    %8,%10;\"\n        \"add    %11,%k2;\"\n        \"or     %12,%10;\"\n        \"add    %10,%k2;\"\n        \"paddd  0x10(%13),%%xmm5;\"\n        \"movdqa %%xmm5,%16;\"\n        \"add    $0x20,%13;\"\n        \"mov    %3,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %k2,%11;\"\n        \"xor    %3,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %4,%12;\"\n        \"xor    %k2,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %5,%12;\"\n        \"xor    %3,%10;\"\n        \"ror    $0xb,%11;\"\n        \"and    %3,%12;\"\n        \"xor    %k2,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %5,%12;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    %16,%12;\"\n        \"mov    %k2,%10;\"\n        \"add    %12,%6;\"\n        \"mov    %k2,%12;\"\n        \"or     %8,%10;\"\n        \"add    %6,%9;\"\n        \"and    %8,%12;\"\n        \"and    %7,%10;\"\n        \"add    %11,%6;\"\n        \"or     %12,%10;\"\n        \"add    %10,%6;\"\n        \"mov    %9,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %6,%11;\"\n        \"xor    %9,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %3,%12;\"\n        \"xor    %6,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %4,%12;\"\n        \"xor    %9,%10;\"\n        \"ror    $0xb,%11;\"\n        \"and    %9,%12;\"\n        \"xor    %6,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %4,%12;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    4+%16,%12;\"\n        \"mov    %6,%10;\"\n        \"add    %12,%5;\"\n        \"mov    %6,%12;\"\n        \"or     %7,%10;\"\n        \"add    %5,%8;\"\n        \"and    %7,%12;\"\n        \"and    %k2,%10;\"\n        \"add    %11,%5;\"\n        \"or     %12,%10;\"\n        \"add    %10,%5;\"\n        \"mov    %8,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %5,%11;\"\n        \"xor    %8,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %9,%12;\"\n        \"xor    %5,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %3,%12;\"\n        \"xor    %8,%10;\"\n        \"ror    $0xb,%11;\"\n        \"and    %8,%12;\"\n        \"xor    %5,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %3,%12;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    8+%16,%12;\"\n        \"mov    %5,%10;\"\n        \"add    %12,%4;\"\n        \"mov    %5,%12;\"\n        \"or     %k2,%10;\"\n        \"add    %4,%7;\"\n        \"and    %k2,%12;\"\n        \"and    %6,%10;\"\n        \"add    %11,%4;\"\n        \"or     %12,%10;\"\n        \"add    %10,%4;\"\n        \"mov    %7,%10;\"\n        \"ror    $0xe,%10;\"\n        \"mov    %4,%11;\"\n        \"xor    %7,%10;\"\n        \"ror    $0x9,%11;\"\n        \"mov    %8,%12;\"\n        \"xor    %4,%11;\"\n        \"ror    $0x5,%10;\"\n        \"xor    %9,%12;\"\n        \"xor    %7,%10;\"\n        \"ror    $0xb,%11;\"\n        \"and    %7,%12;\"\n        \"xor    %4,%11;\"\n        \"ror    $0x6,%10;\"\n        \"xor    %9,%12;\"\n        \"add    %10,%12;\"\n        \"ror    $0x2,%11;\"\n        \"add    12+%16,%12;\"\n        \"mov    %4,%10;\"\n        \"add    %12,%3;\"\n        \"mov    %4,%12;\"\n        \"or     %6,%10;\"\n        \"add    %3,%k2;\"\n        \"and    %6,%12;\"\n        \"and    %5,%10;\"\n        \"add    %11,%3;\"\n        \"or     %12,%10;\"\n        \"add    %10,%3;\"\n        \"movdqa %%xmm6,%%xmm4;\"\n        \"movdqa %%xmm7,%%xmm5;\"\n        \"sub    $0x1,%1;\"\n        \"jne    Lloop2_%=;\"\n        \"add    (%0),%3;\"\n        \"mov    %3,(%0);\"\n        \"add    0x4(%0),%4;\"\n        \"mov    %4,0x4(%0);\"\n        \"add    0x8(%0),%5;\"\n        \"mov    %5,0x8(%0);\"\n        \"add    0xc(%0),%6;\"\n        \"mov    %6,0xc(%0);\"\n        \"add    0x10(%0),%k2;\"\n        \"mov    %k2,0x10(%0);\"\n        \"add    0x14(%0),%7;\"\n        \"mov    %7,0x14(%0);\"\n        \"add    0x18(%0),%8;\"\n        \"mov    %8,0x18(%0);\"\n        \"add    0x1c(%0),%9;\"\n        \"mov    %9,0x1c(%0);\"\n        \"mov    %15,%1;\"\n        \"add    $0x40,%1;\"\n        \"cmp    %14,%1;\"\n        \"jne    Lloop0_%=;\"\n\n        \"Ldone_hash_%=:\"\n\n        : \"+r\"(s), \"+r\"(chunk), \"+r\"(blocks), \"=r\"(a), \"=r\"(b), \"=r\"(c), \"=r\"(d), /* e = chunk */ \"=r\"(f), \"=r\"(g), \"=r\"(h), \"=r\"(y0), \"=r\"(y1), \"=r\"(y2), \"=r\"(tbl), \"+m\"(inp_end), \"+m\"(inp), \"+m\"(xfer)\n        : \"m\"(K256), \"m\"(FLIP_MASK), \"m\"(SHUF_00BA), \"m\"(SHUF_DC00)\n        : \"cc\", \"memory\", \"xmm0\", \"xmm1\", \"xmm2\", \"xmm3\", \"xmm4\", \"xmm5\", \"xmm6\", \"xmm7\", \"xmm8\", \"xmm9\", \"xmm10\", \"xmm11\", \"xmm12\"\n   );\n}\n}\n\n/*\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n; Copyright (c) 2012, Intel Corporation \n; \n; All rights reserved. \n; \n; Redistribution and use in source and binary forms, with or without\n; modification, are permitted provided that the following conditions are\n; met: \n; \n; * Redistributions of source code must retain the above copyright\n;   notice, this list of conditions and the following disclaimer.  \n; \n; * Redistributions in binary form must reproduce the above copyright\n;   notice, this list of conditions and the following disclaimer in the\n;   documentation and/or other materials provided with the\n;   distribution. \n; \n; * Neither the name of the Intel Corporation nor the names of its\n;   contributors may be used to endorse or promote products derived from\n;   this software without specific prior written permission. \n; \n; \n; THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION \"AS IS\" AND ANY\n; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL CORPORATION OR\n; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; Example YASM command lines:\n; Windows:  yasm -Xvc -f x64 -rnasm -pnasm -o sha256_sse4.obj -g cv8 sha256_sse4.asm\n; Linux:    yasm -f x64 -f elf64 -X gnu -g dwarf2 -D LINUX -o sha256_sse4.o sha256_sse4.asm\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;\n; This code is described in an Intel White-Paper:\n; \"Fast SHA-256 Implementations on Intel Architecture Processors\"\n;\n; To find it, surf to http://www.intel.com/p/en_US/embedded \n; and search for that title.\n; The paper is expected to be released roughly at the end of April, 2012\n;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n; This code schedules 1 blocks at a time, with 4 lanes per block\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n%define\tMOVDQ movdqu ;; assume buffers not aligned \n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Define Macros\n\n; addm [mem], reg\n; Add reg to mem using reg-mem add and store\n%macro addm 2\n    add\t%2, %1\n    mov\t%1, %2\n%endm\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n; COPY_XMM_AND_BSWAP xmm, [mem], byte_flip_mask\n; Load xmm with mem and byte swap each dword\n%macro COPY_XMM_AND_BSWAP 3\n    MOVDQ %1, %2\n    pshufb %1, %3\n%endmacro\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n\n%define X0 xmm4\n%define X1 xmm5\n%define X2 xmm6\n%define X3 xmm7\n\n%define XTMP0 xmm0\n%define XTMP1 xmm1\n%define XTMP2 xmm2\n%define XTMP3 xmm3\n%define XTMP4 xmm8\n%define XFER  xmm9\n\n%define SHUF_00BA\txmm10 ; shuffle xBxA -> 00BA\n%define SHUF_DC00\txmm11 ; shuffle xDxC -> DC00\n%define BYTE_FLIP_MASK\txmm12\n    \n%ifdef LINUX\n%define NUM_BLKS rdx\t; 3rd arg\n%define CTX\trsi\t; 2nd arg\n%define INP\trdi\t; 1st arg\n\n%define SRND\trdi\t; clobbers INP\n%define c\tecx\n%define d \tr8d\n%define e \tedx\n%else\n%define NUM_BLKS r8\t; 3rd arg\n%define CTX\trdx \t; 2nd arg\n%define INP\trcx \t; 1st arg\n\n%define SRND\trcx\t; clobbers INP\n%define c \tedi \n%define d\tesi \n%define e \tr8d\n    \n%endif\n%define TBL\trbp\n%define a eax\n%define b ebx\n\n%define f r9d\n%define g r10d\n%define h r11d\n\n%define y0 r13d\n%define y1 r14d\n%define y2 r15d\n\n\n\n_INP_END_SIZE\tequ 8\n_INP_SIZE\tequ 8\n_XFER_SIZE\tequ 8\n%ifdef LINUX\n_XMM_SAVE_SIZE\tequ 0\n%else\n_XMM_SAVE_SIZE\tequ 7*16\n%endif\n; STACK_SIZE plus pushes must be an odd multiple of 8\n_ALIGN_SIZE\tequ 8\n\n_INP_END\tequ 0\n_INP\t\tequ _INP_END  + _INP_END_SIZE\n_XFER\t\tequ _INP      + _INP_SIZE\n_XMM_SAVE\tequ _XFER     + _XFER_SIZE + _ALIGN_SIZE\nSTACK_SIZE\tequ _XMM_SAVE + _XMM_SAVE_SIZE\n\n; rotate_Xs\n; Rotate values of symbols X0...X3\n%macro rotate_Xs 0\n%xdefine X_ X0\n%xdefine X0 X1\n%xdefine X1 X2\n%xdefine X2 X3\n%xdefine X3 X_\n%endm\n\n; ROTATE_ARGS\n; Rotate values of symbols a...h\n%macro ROTATE_ARGS 0\n%xdefine TMP_ h\n%xdefine h g\n%xdefine g f\n%xdefine f e\n%xdefine e d\n%xdefine d c\n%xdefine c b\n%xdefine b a\n%xdefine a TMP_\n%endm\n\n%macro FOUR_ROUNDS_AND_SCHED 0\n\t;; compute s0 four at a time and s1 two at a time\n\t;; compute W[-16] + W[-7] 4 at a time\n\tmovdqa\tXTMP0, X3\n    mov\ty0, e\t\t; y0 = e\n    ror\ty0, (25-11)\t; y0 = e >> (25-11)\n    mov\ty1, a\t\t; y1 = a\n\tpalignr\tXTMP0, X2, 4\t; XTMP0 = W[-7]\n    ror\ty1, (22-13)\t; y1 = a >> (22-13)\n    xor\ty0, e\t\t; y0 = e ^ (e >> (25-11))\n    mov\ty2, f\t\t; y2 = f\n    ror\ty0, (11-6)\t; y0 = (e >> (11-6)) ^ (e >> (25-6))\n\tmovdqa\tXTMP1, X1\n    xor\ty1, a\t\t; y1 = a ^ (a >> (22-13)\n    xor\ty2, g\t\t; y2 = f^g\n\tpaddd\tXTMP0, X0\t; XTMP0 = W[-7] + W[-16]\n    xor\ty0, e\t\t; y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))\n    and\ty2, e\t\t; y2 = (f^g)&e\n    ror\ty1, (13-2)\t; y1 = (a >> (13-2)) ^ (a >> (22-2))\n\t;; compute s0\n\tpalignr\tXTMP1, X0, 4\t; XTMP1 = W[-15]\n    xor\ty1, a\t\t; y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))\n    ror\ty0, 6\t\t; y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)\n    xor\ty2, g\t\t; y2 = CH = ((f^g)&e)^g\n\tmovdqa\tXTMP2, XTMP1\t; XTMP2 = W[-15]\n    ror\ty1, 2\t\t; y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)\n    add\ty2, y0\t\t; y2 = S1 + CH\n    add\ty2, [rsp + _XFER + 0*4]\t; y2 = k + w + S1 + CH\n\tmovdqa\tXTMP3, XTMP1\t; XTMP3 = W[-15]\n    mov\ty0, a\t\t; y0 = a\n    add\th, y2\t\t; h = h + S1 + CH + k + w\n    mov\ty2, a\t\t; y2 = a\n\tpslld\tXTMP1, (32-7)\n    or\ty0, c\t\t; y0 = a|c\n    add\td, h\t\t; d = d + h + S1 + CH + k + w\n    and\ty2, c\t\t; y2 = a&c\n\tpsrld\tXTMP2, 7\n    and\ty0, b\t\t; y0 = (a|c)&b\n    add\th, y1\t\t; h = h + S1 + CH + k + w + S0\n\tpor\tXTMP1, XTMP2\t; XTMP1 = W[-15] ror 7\n    or\ty0, y2\t\t; y0 = MAJ = (a|c)&b)|(a&c)\n    add\th, y0\t\t; h = h + S1 + CH + k + w + S0 + MAJ\n\nROTATE_ARGS\n\tmovdqa\tXTMP2, XTMP3\t; XTMP2 = W[-15]\n    mov\ty0, e\t\t; y0 = e\n    mov\ty1, a\t\t; y1 = a\n\tmovdqa\tXTMP4, XTMP3\t; XTMP4 = W[-15]\n    ror\ty0, (25-11)\t; y0 = e >> (25-11)\n    xor\ty0, e\t\t; y0 = e ^ (e >> (25-11))\n    mov\ty2, f\t\t; y2 = f\n    ror\ty1, (22-13)\t; y1 = a >> (22-13)\n\tpslld\tXTMP3, (32-18)\n    xor\ty1, a\t\t; y1 = a ^ (a >> (22-13)\n    ror\ty0, (11-6)\t; y0 = (e >> (11-6)) ^ (e >> (25-6))\n    xor\ty2, g\t\t; y2 = f^g\n\tpsrld\tXTMP2, 18\n    ror\ty1, (13-2)\t; y1 = (a >> (13-2)) ^ (a >> (22-2))\n    xor\ty0, e\t\t; y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))\n    and\ty2, e\t\t; y2 = (f^g)&e\n    ror\ty0, 6\t\t; y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)\n\tpxor\tXTMP1, XTMP3\n    xor\ty1, a\t\t; y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))\n    xor\ty2, g\t\t; y2 = CH = ((f^g)&e)^g\n\tpsrld\tXTMP4, 3\t; XTMP4 = W[-15] >> 3\n    add\ty2, y0\t\t; y2 = S1 + CH\n    add\ty2, [rsp + _XFER + 1*4]\t; y2 = k + w + S1 + CH\n    ror\ty1, 2\t\t; y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)\n\tpxor\tXTMP1, XTMP2\t; XTMP1 = W[-15] ror 7 ^ W[-15] ror 18\n    mov\ty0, a\t\t; y0 = a\n    add\th, y2\t\t; h = h + S1 + CH + k + w\n    mov\ty2, a\t\t; y2 = a\n\tpxor\tXTMP1, XTMP4\t; XTMP1 = s0\n    or\ty0, c\t\t; y0 = a|c\n    add\td, h\t\t; d = d + h + S1 + CH + k + w\n    and\ty2, c\t\t; y2 = a&c\n\t;; compute low s1\n\tpshufd\tXTMP2, X3, 11111010b\t; XTMP2 = W[-2] {BBAA}\n    and\ty0, b\t\t; y0 = (a|c)&b\n    add\th, y1\t\t; h = h + S1 + CH + k + w + S0\n\tpaddd\tXTMP0, XTMP1\t; XTMP0 = W[-16] + W[-7] + s0\n    or\ty0, y2\t\t; y0 = MAJ = (a|c)&b)|(a&c)\n    add\th, y0\t\t; h = h + S1 + CH + k + w + S0 + MAJ\n\nROTATE_ARGS\n\tmovdqa\tXTMP3, XTMP2\t; XTMP3 = W[-2] {BBAA}\n    mov\ty0, e\t\t; y0 = e\n    mov\ty1, a\t\t; y1 = a\n    ror\ty0, (25-11)\t; y0 = e >> (25-11)\n\tmovdqa\tXTMP4, XTMP2\t; XTMP4 = W[-2] {BBAA}\n    xor\ty0, e\t\t; y0 = e ^ (e >> (25-11))\n    ror\ty1, (22-13)\t; y1 = a >> (22-13)\n    mov\ty2, f\t\t; y2 = f\n    xor\ty1, a\t\t; y1 = a ^ (a >> (22-13)\n    ror\ty0, (11-6)\t; y0 = (e >> (11-6)) ^ (e >> (25-6))\n\tpsrlq\tXTMP2, 17\t; XTMP2 = W[-2] ror 17 {xBxA}\n    xor\ty2, g\t\t; y2 = f^g\n\tpsrlq\tXTMP3, 19\t; XTMP3 = W[-2] ror 19 {xBxA}\n    xor\ty0, e\t\t; y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))\n    and\ty2, e\t\t; y2 = (f^g)&e\n\tpsrld\tXTMP4, 10\t; XTMP4 = W[-2] >> 10 {BBAA}\n    ror\ty1, (13-2)\t; y1 = (a >> (13-2)) ^ (a >> (22-2))\n    xor\ty1, a\t\t; y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))\n    xor\ty2, g\t\t; y2 = CH = ((f^g)&e)^g\n    ror\ty0, 6\t\t; y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)\n\tpxor\tXTMP2, XTMP3\n    add\ty2, y0\t\t; y2 = S1 + CH\n    ror\ty1, 2\t\t; y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)\n    add\ty2, [rsp + _XFER + 2*4]\t; y2 = k + w + S1 + CH\n\tpxor\tXTMP4, XTMP2\t; XTMP4 = s1 {xBxA}\n    mov\ty0, a\t\t; y0 = a\n    add\th, y2\t\t; h = h + S1 + CH + k + w\n    mov\ty2, a\t\t; y2 = a\n\tpshufb\tXTMP4, SHUF_00BA\t; XTMP4 = s1 {00BA}\n    or\ty0, c\t\t; y0 = a|c\n    add\td, h\t\t; d = d + h + S1 + CH + k + w\n    and\ty2, c\t\t; y2 = a&c\n\tpaddd\tXTMP0, XTMP4\t; XTMP0 = {..., ..., W[1], W[0]}\n    and\ty0, b\t\t; y0 = (a|c)&b\n    add\th, y1\t\t; h = h + S1 + CH + k + w + S0\n\t;; compute high s1\n\tpshufd\tXTMP2, XTMP0, 01010000b\t; XTMP2 = W[-2] {DDCC}\n    or\ty0, y2\t\t; y0 = MAJ = (a|c)&b)|(a&c)\n    add\th, y0\t\t; h = h + S1 + CH + k + w + S0 + MAJ\n\nROTATE_ARGS\n\tmovdqa\tXTMP3, XTMP2\t; XTMP3 = W[-2] {DDCC}\n    mov\ty0, e\t\t; y0 = e\n    ror\ty0, (25-11)\t; y0 = e >> (25-11)\n    mov\ty1, a\t\t; y1 = a\n\tmovdqa\tX0,    XTMP2\t; X0    = W[-2] {DDCC}\n    ror\ty1, (22-13)\t; y1 = a >> (22-13)\n    xor\ty0, e\t\t; y0 = e ^ (e >> (25-11))\n    mov\ty2, f\t\t; y2 = f\n    ror\ty0, (11-6)\t; y0 = (e >> (11-6)) ^ (e >> (25-6))\n\tpsrlq\tXTMP2, 17\t; XTMP2 = W[-2] ror 17 {xDxC}\n    xor\ty1, a\t\t; y1 = a ^ (a >> (22-13)\n    xor\ty2, g\t\t; y2 = f^g\n\tpsrlq\tXTMP3, 19\t; XTMP3 = W[-2] ror 19 {xDxC}\n    xor\ty0, e\t\t; y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))\n    and\ty2, e\t\t; y2 = (f^g)&e\n    ror\ty1, (13-2)\t; y1 = (a >> (13-2)) ^ (a >> (22-2))\n\tpsrld\tX0,    10\t; X0 = W[-2] >> 10 {DDCC}\n    xor\ty1, a\t\t; y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))\n    ror\ty0, 6\t\t; y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)\n    xor\ty2, g\t\t; y2 = CH = ((f^g)&e)^g\n\tpxor\tXTMP2, XTMP3\n    ror\ty1, 2\t\t; y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)\n    add\ty2, y0\t\t; y2 = S1 + CH\n    add\ty2, [rsp + _XFER + 3*4]\t; y2 = k + w + S1 + CH\n\tpxor\tX0, XTMP2\t; X0 = s1 {xDxC}\n    mov\ty0, a\t\t; y0 = a\n    add\th, y2\t\t; h = h + S1 + CH + k + w\n    mov\ty2, a\t\t; y2 = a\n\tpshufb\tX0, SHUF_DC00\t; X0 = s1 {DC00}\n    or\ty0, c\t\t; y0 = a|c\n    add\td, h\t\t; d = d + h + S1 + CH + k + w\n    and\ty2, c\t\t; y2 = a&c\n\tpaddd\tX0, XTMP0\t; X0 = {W[3], W[2], W[1], W[0]}\n    and\ty0, b\t\t; y0 = (a|c)&b\n    add\th, y1\t\t; h = h + S1 + CH + k + w + S0\n    or\ty0, y2\t\t; y0 = MAJ = (a|c)&b)|(a&c)\n    add\th, y0\t\t; h = h + S1 + CH + k + w + S0 + MAJ\n\nROTATE_ARGS\nrotate_Xs\n%endm\n\n;; input is [rsp + _XFER + %1 * 4]\n%macro DO_ROUND 1\n    mov\ty0, e\t\t; y0 = e\n    ror\ty0, (25-11)\t; y0 = e >> (25-11)\n    mov\ty1, a\t\t; y1 = a\n    xor\ty0, e\t\t; y0 = e ^ (e >> (25-11))\n    ror\ty1, (22-13)\t; y1 = a >> (22-13)\n    mov\ty2, f\t\t; y2 = f\n    xor\ty1, a\t\t; y1 = a ^ (a >> (22-13)\n    ror\ty0, (11-6)\t; y0 = (e >> (11-6)) ^ (e >> (25-6))\n    xor\ty2, g\t\t; y2 = f^g\n    xor\ty0, e\t\t; y0 = e ^ (e >> (11-6)) ^ (e >> (25-6))\n    ror\ty1, (13-2)\t; y1 = (a >> (13-2)) ^ (a >> (22-2))\n    and\ty2, e\t\t; y2 = (f^g)&e\n    xor\ty1, a\t\t; y1 = a ^ (a >> (13-2)) ^ (a >> (22-2))\n    ror\ty0, 6\t\t; y0 = S1 = (e>>6) & (e>>11) ^ (e>>25)\n    xor\ty2, g\t\t; y2 = CH = ((f^g)&e)^g\n    add\ty2, y0\t\t; y2 = S1 + CH\n    ror\ty1, 2\t\t; y1 = S0 = (a>>2) ^ (a>>13) ^ (a>>22)\n    add\ty2, [rsp + _XFER + %1 * 4]\t; y2 = k + w + S1 + CH\n    mov\ty0, a\t\t; y0 = a\n    add\th, y2\t\t; h = h + S1 + CH + k + w\n    mov\ty2, a\t\t; y2 = a\n    or\ty0, c\t\t; y0 = a|c\n    add\td, h\t\t; d = d + h + S1 + CH + k + w\n    and\ty2, c\t\t; y2 = a&c\n    and\ty0, b\t\t; y0 = (a|c)&b\n    add\th, y1\t\t; h = h + S1 + CH + k + w + S0\n    or\ty0, y2\t\t; y0 = MAJ = (a|c)&b)|(a&c)\n    add\th, y0\t\t; h = h + S1 + CH + k + w + S0 + MAJ\n    ROTATE_ARGS\n%endm\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\n;; void sha256_sse4(void *input_data, UINT32 digest[8], UINT64 num_blks)\n;; arg 1 : pointer to input data\n;; arg 2 : pointer to digest\n;; arg 3 : Num blocks\nsection .text\nglobal sha256_sse4\nalign 32\nsha256_sse4:\n    push\trbx\n%ifndef LINUX\n    push\trsi\n    push\trdi\n%endif\n    push\trbp\n    push\tr13\n    push\tr14\n    push\tr15\n\n    sub\trsp,STACK_SIZE\n%ifndef LINUX\n    movdqa\t[rsp + _XMM_SAVE + 0*16],xmm6\t\n    movdqa\t[rsp + _XMM_SAVE + 1*16],xmm7\n    movdqa\t[rsp + _XMM_SAVE + 2*16],xmm8\t\n    movdqa\t[rsp + _XMM_SAVE + 3*16],xmm9\t\n    movdqa\t[rsp + _XMM_SAVE + 4*16],xmm10\n    movdqa\t[rsp + _XMM_SAVE + 5*16],xmm11\n    movdqa\t[rsp + _XMM_SAVE + 6*16],xmm12\n%endif\n\n    shl\tNUM_BLKS, 6\t; convert to bytes\n    jz\tdone_hash\n    add\tNUM_BLKS, INP\t; pointer to end of data\n    mov\t[rsp + _INP_END], NUM_BLKS\n\n    ;; load initial digest\n    mov\ta,[4*0 + CTX]\n    mov\tb,[4*1 + CTX]\n    mov\tc,[4*2 + CTX]\n    mov\td,[4*3 + CTX]\n    mov\te,[4*4 + CTX]\n    mov\tf,[4*5 + CTX]\n    mov\tg,[4*6 + CTX]\n    mov\th,[4*7 + CTX]\n\n    movdqa\tBYTE_FLIP_MASK, [PSHUFFLE_BYTE_FLIP_MASK wrt rip]\n    movdqa\tSHUF_00BA, [_SHUF_00BA wrt rip]\n    movdqa\tSHUF_DC00, [_SHUF_DC00 wrt rip]\n\nloop0:\n    lea\tTBL,[K256 wrt rip]\n\n    ;; byte swap first 16 dwords\n    COPY_XMM_AND_BSWAP\tX0, [INP + 0*16], BYTE_FLIP_MASK\n    COPY_XMM_AND_BSWAP\tX1, [INP + 1*16], BYTE_FLIP_MASK\n    COPY_XMM_AND_BSWAP\tX2, [INP + 2*16], BYTE_FLIP_MASK\n    COPY_XMM_AND_BSWAP\tX3, [INP + 3*16], BYTE_FLIP_MASK\n    \n    mov\t[rsp + _INP], INP\n\n    ;; schedule 48 input dwords, by doing 3 rounds of 16 each\n    mov\tSRND, 3\nalign 16\nloop1:\n    movdqa\tXFER, [TBL + 0*16]\n    paddd\tXFER, X0\n    movdqa\t[rsp + _XFER], XFER\n    FOUR_ROUNDS_AND_SCHED\n\n    movdqa\tXFER, [TBL + 1*16]\n    paddd\tXFER, X0\n    movdqa\t[rsp + _XFER], XFER\n    FOUR_ROUNDS_AND_SCHED\n\n    movdqa\tXFER, [TBL + 2*16]\n    paddd\tXFER, X0\n    movdqa\t[rsp + _XFER], XFER\n    FOUR_ROUNDS_AND_SCHED\n\n    movdqa\tXFER, [TBL + 3*16]\n    paddd\tXFER, X0\n    movdqa\t[rsp + _XFER], XFER\n    add\tTBL, 4*16\n    FOUR_ROUNDS_AND_SCHED\n\n    sub\tSRND, 1\n    jne\tloop1\n\n    mov\tSRND, 2\nloop2:\n    paddd\tX0, [TBL + 0*16]\n    movdqa\t[rsp + _XFER], X0\n    DO_ROUND\t0\n    DO_ROUND\t1\n    DO_ROUND\t2\n    DO_ROUND\t3\n    paddd\tX1, [TBL + 1*16]\n    movdqa\t[rsp + _XFER], X1\n    add\tTBL, 2*16\n    DO_ROUND\t0\n    DO_ROUND\t1\n    DO_ROUND\t2\n    DO_ROUND\t3\n\n    movdqa\tX0, X2\n    movdqa\tX1, X3\n\n    sub\tSRND, 1\n    jne\tloop2\n\n    addm\t[4*0 + CTX],a\n    addm\t[4*1 + CTX],b\n    addm\t[4*2 + CTX],c\n    addm\t[4*3 + CTX],d\n    addm\t[4*4 + CTX],e\n    addm\t[4*5 + CTX],f\n    addm\t[4*6 + CTX],g\n    addm\t[4*7 + CTX],h\n\n    mov\tINP, [rsp + _INP]\n    add\tINP, 64\n    cmp\tINP, [rsp + _INP_END]\n    jne\tloop0\n\ndone_hash:\n%ifndef LINUX\n    movdqa\txmm6,[rsp + _XMM_SAVE + 0*16]\n    movdqa\txmm7,[rsp + _XMM_SAVE + 1*16]\n    movdqa\txmm8,[rsp + _XMM_SAVE + 2*16]\n    movdqa\txmm9,[rsp + _XMM_SAVE + 3*16]\n    movdqa\txmm10,[rsp + _XMM_SAVE + 4*16]\n    movdqa\txmm11,[rsp + _XMM_SAVE + 5*16]\n    movdqa\txmm12,[rsp + _XMM_SAVE + 6*16]\n%endif\n\n    add\trsp, STACK_SIZE\n\n    pop\tr15\n    pop\tr14\n    pop\tr13\n    pop\trbp\n%ifndef LINUX\n    pop\trdi\n    pop\trsi\n%endif\n    pop\trbx\n\n    ret\t\n    \n\nsection .data\nalign 64\nK256:\n    dd\t0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5\n    dd\t0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5\n    dd\t0xd807aa98,0x12835b01,0x243185be,0x550c7dc3\n    dd\t0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174\n    dd\t0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc\n    dd\t0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da\n    dd\t0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7\n    dd\t0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967\n    dd\t0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13\n    dd\t0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85\n    dd\t0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3\n    dd\t0xd192e819,0xd6990624,0xf40e3585,0x106aa070\n    dd\t0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5\n    dd\t0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3\n    dd\t0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208\n    dd\t0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2\n\nPSHUFFLE_BYTE_FLIP_MASK: ddq 0x0c0d0e0f08090a0b0405060700010203\n\n; shuffle xBxA -> 00BA\n_SHUF_00BA:              ddq 0xFFFFFFFFFFFFFFFF0b0a090803020100\n\n; shuffle xDxC -> DC00\n_SHUF_DC00:              ddq 0x0b0a090803020100FFFFFFFFFFFFFFFF\n*/\n\n#endif\n"
  },
  {
    "path": "src/crypto/sha512.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <crypto/sha512.h>\n\n#include <crypto/common.h>\n\n#include <string.h>\n\n// Internal implementation code.\nnamespace\n{\n/// Internal SHA-512 implementation.\nnamespace sha512\n{\nuint64_t inline Ch(uint64_t x, uint64_t y, uint64_t z) { return z ^ (x & (y ^ z)); }\nuint64_t inline Maj(uint64_t x, uint64_t y, uint64_t z) { return (x & y) | (z & (x | y)); }\nuint64_t inline Sigma0(uint64_t x) { return (x >> 28 | x << 36) ^ (x >> 34 | x << 30) ^ (x >> 39 | x << 25); }\nuint64_t inline Sigma1(uint64_t x) { return (x >> 14 | x << 50) ^ (x >> 18 | x << 46) ^ (x >> 41 | x << 23); }\nuint64_t inline sigma0(uint64_t x) { return (x >> 1 | x << 63) ^ (x >> 8 | x << 56) ^ (x >> 7); }\nuint64_t inline sigma1(uint64_t x) { return (x >> 19 | x << 45) ^ (x >> 61 | x << 3) ^ (x >> 6); }\n\n/** One round of SHA-512. */\nvoid inline Round(uint64_t a, uint64_t b, uint64_t c, uint64_t& d, uint64_t e, uint64_t f, uint64_t g, uint64_t& h, uint64_t k, uint64_t w)\n{\n    uint64_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w;\n    uint64_t t2 = Sigma0(a) + Maj(a, b, c);\n    d += t1;\n    h = t1 + t2;\n}\n\n/** Initialize SHA-256 state. */\nvoid inline Initialize(uint64_t* s)\n{\n    s[0] = 0x6a09e667f3bcc908ull;\n    s[1] = 0xbb67ae8584caa73bull;\n    s[2] = 0x3c6ef372fe94f82bull;\n    s[3] = 0xa54ff53a5f1d36f1ull;\n    s[4] = 0x510e527fade682d1ull;\n    s[5] = 0x9b05688c2b3e6c1full;\n    s[6] = 0x1f83d9abfb41bd6bull;\n    s[7] = 0x5be0cd19137e2179ull;\n}\n\n/** Perform one SHA-512 transformation, processing a 128-byte chunk. */\nvoid Transform(uint64_t* s, const unsigned char* chunk)\n{\n    uint64_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7];\n    uint64_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;\n\n    Round(a, b, c, d, e, f, g, h, 0x428a2f98d728ae22ull, w0 = ReadBE64(chunk + 0));\n    Round(h, a, b, c, d, e, f, g, 0x7137449123ef65cdull, w1 = ReadBE64(chunk + 8));\n    Round(g, h, a, b, c, d, e, f, 0xb5c0fbcfec4d3b2full, w2 = ReadBE64(chunk + 16));\n    Round(f, g, h, a, b, c, d, e, 0xe9b5dba58189dbbcull, w3 = ReadBE64(chunk + 24));\n    Round(e, f, g, h, a, b, c, d, 0x3956c25bf348b538ull, w4 = ReadBE64(chunk + 32));\n    Round(d, e, f, g, h, a, b, c, 0x59f111f1b605d019ull, w5 = ReadBE64(chunk + 40));\n    Round(c, d, e, f, g, h, a, b, 0x923f82a4af194f9bull, w6 = ReadBE64(chunk + 48));\n    Round(b, c, d, e, f, g, h, a, 0xab1c5ed5da6d8118ull, w7 = ReadBE64(chunk + 56));\n    Round(a, b, c, d, e, f, g, h, 0xd807aa98a3030242ull, w8 = ReadBE64(chunk + 64));\n    Round(h, a, b, c, d, e, f, g, 0x12835b0145706fbeull, w9 = ReadBE64(chunk + 72));\n    Round(g, h, a, b, c, d, e, f, 0x243185be4ee4b28cull, w10 = ReadBE64(chunk + 80));\n    Round(f, g, h, a, b, c, d, e, 0x550c7dc3d5ffb4e2ull, w11 = ReadBE64(chunk + 88));\n    Round(e, f, g, h, a, b, c, d, 0x72be5d74f27b896full, w12 = ReadBE64(chunk + 96));\n    Round(d, e, f, g, h, a, b, c, 0x80deb1fe3b1696b1ull, w13 = ReadBE64(chunk + 104));\n    Round(c, d, e, f, g, h, a, b, 0x9bdc06a725c71235ull, w14 = ReadBE64(chunk + 112));\n    Round(b, c, d, e, f, g, h, a, 0xc19bf174cf692694ull, w15 = ReadBE64(chunk + 120));\n\n    Round(a, b, c, d, e, f, g, h, 0xe49b69c19ef14ad2ull, w0 += sigma1(w14) + w9 + sigma0(w1));\n    Round(h, a, b, c, d, e, f, g, 0xefbe4786384f25e3ull, w1 += sigma1(w15) + w10 + sigma0(w2));\n    Round(g, h, a, b, c, d, e, f, 0x0fc19dc68b8cd5b5ull, w2 += sigma1(w0) + w11 + sigma0(w3));\n    Round(f, g, h, a, b, c, d, e, 0x240ca1cc77ac9c65ull, w3 += sigma1(w1) + w12 + sigma0(w4));\n    Round(e, f, g, h, a, b, c, d, 0x2de92c6f592b0275ull, w4 += sigma1(w2) + w13 + sigma0(w5));\n    Round(d, e, f, g, h, a, b, c, 0x4a7484aa6ea6e483ull, w5 += sigma1(w3) + w14 + sigma0(w6));\n    Round(c, d, e, f, g, h, a, b, 0x5cb0a9dcbd41fbd4ull, w6 += sigma1(w4) + w15 + sigma0(w7));\n    Round(b, c, d, e, f, g, h, a, 0x76f988da831153b5ull, w7 += sigma1(w5) + w0 + sigma0(w8));\n    Round(a, b, c, d, e, f, g, h, 0x983e5152ee66dfabull, w8 += sigma1(w6) + w1 + sigma0(w9));\n    Round(h, a, b, c, d, e, f, g, 0xa831c66d2db43210ull, w9 += sigma1(w7) + w2 + sigma0(w10));\n    Round(g, h, a, b, c, d, e, f, 0xb00327c898fb213full, w10 += sigma1(w8) + w3 + sigma0(w11));\n    Round(f, g, h, a, b, c, d, e, 0xbf597fc7beef0ee4ull, w11 += sigma1(w9) + w4 + sigma0(w12));\n    Round(e, f, g, h, a, b, c, d, 0xc6e00bf33da88fc2ull, w12 += sigma1(w10) + w5 + sigma0(w13));\n    Round(d, e, f, g, h, a, b, c, 0xd5a79147930aa725ull, w13 += sigma1(w11) + w6 + sigma0(w14));\n    Round(c, d, e, f, g, h, a, b, 0x06ca6351e003826full, w14 += sigma1(w12) + w7 + sigma0(w15));\n    Round(b, c, d, e, f, g, h, a, 0x142929670a0e6e70ull, w15 += sigma1(w13) + w8 + sigma0(w0));\n\n    Round(a, b, c, d, e, f, g, h, 0x27b70a8546d22ffcull, w0 += sigma1(w14) + w9 + sigma0(w1));\n    Round(h, a, b, c, d, e, f, g, 0x2e1b21385c26c926ull, w1 += sigma1(w15) + w10 + sigma0(w2));\n    Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc5ac42aedull, w2 += sigma1(w0) + w11 + sigma0(w3));\n    Round(f, g, h, a, b, c, d, e, 0x53380d139d95b3dfull, w3 += sigma1(w1) + w12 + sigma0(w4));\n    Round(e, f, g, h, a, b, c, d, 0x650a73548baf63deull, w4 += sigma1(w2) + w13 + sigma0(w5));\n    Round(d, e, f, g, h, a, b, c, 0x766a0abb3c77b2a8ull, w5 += sigma1(w3) + w14 + sigma0(w6));\n    Round(c, d, e, f, g, h, a, b, 0x81c2c92e47edaee6ull, w6 += sigma1(w4) + w15 + sigma0(w7));\n    Round(b, c, d, e, f, g, h, a, 0x92722c851482353bull, w7 += sigma1(w5) + w0 + sigma0(w8));\n    Round(a, b, c, d, e, f, g, h, 0xa2bfe8a14cf10364ull, w8 += sigma1(w6) + w1 + sigma0(w9));\n    Round(h, a, b, c, d, e, f, g, 0xa81a664bbc423001ull, w9 += sigma1(w7) + w2 + sigma0(w10));\n    Round(g, h, a, b, c, d, e, f, 0xc24b8b70d0f89791ull, w10 += sigma1(w8) + w3 + sigma0(w11));\n    Round(f, g, h, a, b, c, d, e, 0xc76c51a30654be30ull, w11 += sigma1(w9) + w4 + sigma0(w12));\n    Round(e, f, g, h, a, b, c, d, 0xd192e819d6ef5218ull, w12 += sigma1(w10) + w5 + sigma0(w13));\n    Round(d, e, f, g, h, a, b, c, 0xd69906245565a910ull, w13 += sigma1(w11) + w6 + sigma0(w14));\n    Round(c, d, e, f, g, h, a, b, 0xf40e35855771202aull, w14 += sigma1(w12) + w7 + sigma0(w15));\n    Round(b, c, d, e, f, g, h, a, 0x106aa07032bbd1b8ull, w15 += sigma1(w13) + w8 + sigma0(w0));\n\n    Round(a, b, c, d, e, f, g, h, 0x19a4c116b8d2d0c8ull, w0 += sigma1(w14) + w9 + sigma0(w1));\n    Round(h, a, b, c, d, e, f, g, 0x1e376c085141ab53ull, w1 += sigma1(w15) + w10 + sigma0(w2));\n    Round(g, h, a, b, c, d, e, f, 0x2748774cdf8eeb99ull, w2 += sigma1(w0) + w11 + sigma0(w3));\n    Round(f, g, h, a, b, c, d, e, 0x34b0bcb5e19b48a8ull, w3 += sigma1(w1) + w12 + sigma0(w4));\n    Round(e, f, g, h, a, b, c, d, 0x391c0cb3c5c95a63ull, w4 += sigma1(w2) + w13 + sigma0(w5));\n    Round(d, e, f, g, h, a, b, c, 0x4ed8aa4ae3418acbull, w5 += sigma1(w3) + w14 + sigma0(w6));\n    Round(c, d, e, f, g, h, a, b, 0x5b9cca4f7763e373ull, w6 += sigma1(w4) + w15 + sigma0(w7));\n    Round(b, c, d, e, f, g, h, a, 0x682e6ff3d6b2b8a3ull, w7 += sigma1(w5) + w0 + sigma0(w8));\n    Round(a, b, c, d, e, f, g, h, 0x748f82ee5defb2fcull, w8 += sigma1(w6) + w1 + sigma0(w9));\n    Round(h, a, b, c, d, e, f, g, 0x78a5636f43172f60ull, w9 += sigma1(w7) + w2 + sigma0(w10));\n    Round(g, h, a, b, c, d, e, f, 0x84c87814a1f0ab72ull, w10 += sigma1(w8) + w3 + sigma0(w11));\n    Round(f, g, h, a, b, c, d, e, 0x8cc702081a6439ecull, w11 += sigma1(w9) + w4 + sigma0(w12));\n    Round(e, f, g, h, a, b, c, d, 0x90befffa23631e28ull, w12 += sigma1(w10) + w5 + sigma0(w13));\n    Round(d, e, f, g, h, a, b, c, 0xa4506cebde82bde9ull, w13 += sigma1(w11) + w6 + sigma0(w14));\n    Round(c, d, e, f, g, h, a, b, 0xbef9a3f7b2c67915ull, w14 += sigma1(w12) + w7 + sigma0(w15));\n    Round(b, c, d, e, f, g, h, a, 0xc67178f2e372532bull, w15 += sigma1(w13) + w8 + sigma0(w0));\n\n    Round(a, b, c, d, e, f, g, h, 0xca273eceea26619cull, w0 += sigma1(w14) + w9 + sigma0(w1));\n    Round(h, a, b, c, d, e, f, g, 0xd186b8c721c0c207ull, w1 += sigma1(w15) + w10 + sigma0(w2));\n    Round(g, h, a, b, c, d, e, f, 0xeada7dd6cde0eb1eull, w2 += sigma1(w0) + w11 + sigma0(w3));\n    Round(f, g, h, a, b, c, d, e, 0xf57d4f7fee6ed178ull, w3 += sigma1(w1) + w12 + sigma0(w4));\n    Round(e, f, g, h, a, b, c, d, 0x06f067aa72176fbaull, w4 += sigma1(w2) + w13 + sigma0(w5));\n    Round(d, e, f, g, h, a, b, c, 0x0a637dc5a2c898a6ull, w5 += sigma1(w3) + w14 + sigma0(w6));\n    Round(c, d, e, f, g, h, a, b, 0x113f9804bef90daeull, w6 += sigma1(w4) + w15 + sigma0(w7));\n    Round(b, c, d, e, f, g, h, a, 0x1b710b35131c471bull, w7 += sigma1(w5) + w0 + sigma0(w8));\n    Round(a, b, c, d, e, f, g, h, 0x28db77f523047d84ull, w8 += sigma1(w6) + w1 + sigma0(w9));\n    Round(h, a, b, c, d, e, f, g, 0x32caab7b40c72493ull, w9 += sigma1(w7) + w2 + sigma0(w10));\n    Round(g, h, a, b, c, d, e, f, 0x3c9ebe0a15c9bebcull, w10 += sigma1(w8) + w3 + sigma0(w11));\n    Round(f, g, h, a, b, c, d, e, 0x431d67c49c100d4cull, w11 += sigma1(w9) + w4 + sigma0(w12));\n    Round(e, f, g, h, a, b, c, d, 0x4cc5d4becb3e42b6ull, w12 += sigma1(w10) + w5 + sigma0(w13));\n    Round(d, e, f, g, h, a, b, c, 0x597f299cfc657e2aull, w13 += sigma1(w11) + w6 + sigma0(w14));\n    Round(c, d, e, f, g, h, a, b, 0x5fcb6fab3ad6faecull, w14 + sigma1(w12) + w7 + sigma0(w15));\n    Round(b, c, d, e, f, g, h, a, 0x6c44198c4a475817ull, w15 + sigma1(w13) + w8 + sigma0(w0));\n\n    s[0] += a;\n    s[1] += b;\n    s[2] += c;\n    s[3] += d;\n    s[4] += e;\n    s[5] += f;\n    s[6] += g;\n    s[7] += h;\n}\n\n} // namespace sha512\n\n} // namespace\n\n\n////// SHA-512\n\nCSHA512::CSHA512() : bytes(0)\n{\n    sha512::Initialize(s);\n}\n\nCSHA512& CSHA512::Write(const unsigned char* data, size_t len)\n{\n    const unsigned char* end = data + len;\n    size_t bufsize = bytes % 128;\n    if (bufsize && bufsize + len >= 128) {\n        // Fill the buffer, and process it.\n        memcpy(buf + bufsize, data, 128 - bufsize);\n        bytes += 128 - bufsize;\n        data += 128 - bufsize;\n        sha512::Transform(s, buf);\n        bufsize = 0;\n    }\n    while (end >= data + 128) {\n        // Process full chunks directly from the source.\n        sha512::Transform(s, data);\n        data += 128;\n        bytes += 128;\n    }\n    if (end > data) {\n        // Fill the buffer with what remains.\n        memcpy(buf + bufsize, data, end - data);\n        bytes += end - data;\n    }\n    return *this;\n}\n\nvoid CSHA512::Finalize(unsigned char hash[OUTPUT_SIZE])\n{\n    static const unsigned char pad[128] = {0x80};\n    unsigned char sizedesc[16] = {0x00};\n    WriteBE64(sizedesc + 8, bytes << 3);\n    Write(pad, 1 + ((239 - (bytes % 128)) % 128));\n    Write(sizedesc, 16);\n    WriteBE64(hash, s[0]);\n    WriteBE64(hash + 8, s[1]);\n    WriteBE64(hash + 16, s[2]);\n    WriteBE64(hash + 24, s[3]);\n    WriteBE64(hash + 32, s[4]);\n    WriteBE64(hash + 40, s[5]);\n    WriteBE64(hash + 48, s[6]);\n    WriteBE64(hash + 56, s[7]);\n}\n\nCSHA512& CSHA512::Reset()\n{\n    bytes = 0;\n    sha512::Initialize(s);\n    return *this;\n}\n"
  },
  {
    "path": "src/crypto/sha512.h",
    "content": "// Copyright (c) 2014-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CRYPTO_SHA512_H\n#define BITCOIN_CRYPTO_SHA512_H\n\n#include <stdint.h>\n#include <stdlib.h>\n\n/** A hasher class for SHA-512. */\nclass CSHA512\n{\nprivate:\n    uint64_t s[8];\n    unsigned char buf[128];\n    uint64_t bytes;\n\npublic:\n    static const size_t OUTPUT_SIZE = 64;\n\n    CSHA512();\n    CSHA512& Write(const unsigned char* data, size_t len);\n    void Finalize(unsigned char hash[OUTPUT_SIZE]);\n    CSHA512& Reset();\n};\n\n#endif // BITCOIN_CRYPTO_SHA512_H\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/CHANGES",
    "content": "\tChanges made between 1.0.0 (2018/07/12) and 1.0.1 (2019/06/30).\n\nFill the destination buffer with all set bits on error for fail-safety\nof the caller's \"< target\" check in case the caller neglects to check\nfor errors.\n\nSimplified SMix2 for its final invocation with Nloop=2 in yespower 0.5.\n\nRevised the \"XOR of yespower\" tests to trigger duplicate index in the\nlast SMix2 invocation in yespower 0.5 for N=2048 with at least one of\nthe values of r being tested.  This is needed to test that a proper\nkind of BlockMix is used in that special case, which would previously be\nleft untested.\n\nAdded x32 ABI support (x86-64 with 32-bit pointers).\n\nAdded a bit more detail to the README on caching of the computed PoW\nhashes when integrating yespower in an altcoin based on Bitcoin Core.\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/PERFORMANCE",
    "content": "Included with yespower is the \"benchmark\" program, which is built by\nsimply invoking \"make\".  When invoked without parameters, it tests\nyespower 0.5 at N = 2048, r = 8, which appears to be the lowest setting\nin use by existing cryptocurrencies.  On an i7-4770K with 4x DDR3-1600\n(on two memory channels) running CentOS 7 for x86-64 (and built with\nCentOS 7's default version of gcc) and with thread affinity set, this\nreports between 3700 and 3800 hashes per second for both SSE2 and AVX\nbuilds, e.g.:\n\n$ GOMP_CPU_AFFINITY=0-7 OMP_NUM_THREADS=4 ./benchmark\nversion=0.5 N=2048 r=8\nWill use 2048.00 KiB RAM\na5 9f ec 4c 4f dd a1 6e 3b 14 05 ad da 66 d5 25 b6 8e 7c ad fc fe 6a c0 66 c7 ad 11 8c d8 05 90\nBenchmarking 1 thread ...\n1018 H/s real, 1018 H/s virtual (2047 hashes in 2.01 seconds)\nBenchmarking 4 threads ...\n3773 H/s real, 950 H/s virtual (8188 hashes in 2.17 seconds)\nmin 0.984 ms, avg 1.052 ms, max 1.074 ms\n\nRunning 8 threads (to match the logical rather than the physical CPU\ncore count) results in very slightly worse performance on this system,\nbut this might be the other way around on another and/or with other\nparameters.  Upgrading to yespower 1.0, performance at these parameters\nimproves to almost 4000 hashes per second:\n\n$ GOMP_CPU_AFFINITY=0-7 OMP_NUM_THREADS=4 ./benchmark 10\nversion=1.0 N=2048 r=8\nWill use 2048.00 KiB RAM\nd0 78 cd d4 cf 3f 5a a8 4e 3c 4a 58 66 29 81 d8 2d 27 e5 67 36 37 c4 be 77 63 61 32 24 c1 8a 93\nBenchmarking 1 thread ...\n1080 H/s real, 1080 H/s virtual (4095 hashes in 3.79 seconds)\nBenchmarking 4 threads ...\n3995 H/s real, 1011 H/s virtual (16380 hashes in 4.10 seconds)\nmin 0.923 ms, avg 0.989 ms, max 1.137 ms\n\nRunning 8 threads results in substantial slowdown with this new version\n(to between 3200 and 3400 hashes per second) because of cache thrashing.\n\nFor higher settings such as those achieving 8 MiB instead of the 2 MiB\nabove, this system performs at around 800 hashes per second for yespower\n0.5 and at around 830 hashes per second for yespower 1.0:\n\n$ GOMP_CPU_AFFINITY=0-7 OMP_NUM_THREADS=4 ./benchmark 5 2048 32\nversion=0.5 N=2048 r=32\nWill use 8192.00 KiB RAM\n56 0a 89 1b 5c a2 e1 c6 36 11 1a 9f f7 c8 94 a5 d0 a2 60 2f 43 fd cf a5 94 9b 95 e2 2f e4 46 1e\nBenchmarking 1 thread ...\n265 H/s real, 265 H/s virtual (1023 hashes in 3.85 seconds)\nBenchmarking 4 threads ...\n803 H/s real, 200 H/s virtual (4092 hashes in 5.09 seconds)\nmin 4.924 ms, avg 4.980 ms, max 5.074 ms\n\n$ GOMP_CPU_AFFINITY=0-7 OMP_NUM_THREADS=4 ./benchmark 10 2048 32\nversion=1.0 N=2048 r=32\nWill use 8192.00 KiB RAM\nf7 69 26 ae 4a dc 56 53 90 2f f0 22 78 ea aa 39 eb 99 84 11 ac 3e a6 24 2e 19 6d fb c4 3d 68 25\nBenchmarking 1 thread ...\n275 H/s real, 275 H/s virtual (1023 hashes in 3.71 seconds)\nBenchmarking 4 threads ...\n831 H/s real, 209 H/s virtual (4092 hashes in 4.92 seconds)\nmin 3.614 ms, avg 4.769 ms, max 5.011 ms\n\nAgain, running 8 threads results in a slowdown, albeit not as bad as can\nbe seen for lower settings.\n\nOn x86(-64), the following code versions may reasonably be built: SSE2,\nAVX, and XOP.  (There's no reason to build for AVX2 and higher, which is\nunsuitable for and thus unused by current yespower anyway.  There's also\nno reason to build yespower as-is for SSE4, although there's a disabled\nby default 32-bit specific SSE4 code version that may be re-enabled and\ngiven a try if someone is so inclined; it may perform slightly slower or\nslightly faster across different systems.)\n\nyescrypt and especially yespower 1.0 have been designed to fit the SSE2\ninstruction set almost perfectly, so there's very little benefit from\nthe AVX and XOP builds, yet even at yespower 1.0 there may be\nperformance differences between SSE2, AVX, and XOP builds within 2% or\nso (and it is unclear which is the fastest on a given system until\ntested, except that where XOP is supported it is almost always faster\nthan AVX).\n\nProper setting of thread affinities to run exactly one thread per\nphysical CPU core is non-trivial.  In the above examples, it so happened\nthat the first 4 logical CPU numbers corresponded to different physical\ncores, but this won't always be the case.  This can vary even between\napparently similar systems.  On Linux, the mapping of logical CPUs to\nphysical cores may be obtained from /proc/cpuinfo (on x86[-64] and MIC)\nor sysfs, which an optimized implementation of e.g. a cryptocurrency\nminer could use.  If you do not bother obtaining this information from\nthe operating system, you might be better off not setting thread\naffinities at all (in order to avoid the risk of doing this incorrectly,\nwhich would have a greater negative performance impact) and/or running\nas many threads as there are logical CPUs.  Also, there's no certainty\nwhether different and future CPUs will run yespower faster using one or\nmaybe more threads per physical core.\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/README",
    "content": "\tWhat is yespower?\n\nyespower is a proof-of-work (PoW) focused fork of yescrypt.  While\nyescrypt is a password-based key derivation function (KDF) and password\nhashing scheme, and thus is meant for processing passwords, yespower is\nmeant for processing trial inputs such as block headers (including\nnonces) in PoW-based blockchains.\n\nOn its own, yespower isn't a complete proof-of-work system.  Rather, in\nthe blockchain use case, yespower's return value is meant to be checked\nfor being numerically no greater than the blockchain's current target\n(which is related to mining difficulty) or else the proof attempt\n(yespower invocation) is to be repeated (with a different nonce) until\nthe condition is finally met (allowing a new block to be mined).  This\nprocess isn't specific to yespower and isn't part of yespower itself\n(rather, it is similar in many PoW-based blockchains and is to be\ndefined and implemented externally to yespower) and thus isn't described\nin here any further.\n\n\n\tWhy or why not yespower?\n\nDifferent proof-of-work schemes in existence vary in many aspects,\nincluding in friendliness to different types of hardware.  There's\ndemand for all sorts of hardware (un)friendliness in those - for\ndifferent use cases and by different communities.\n\nyespower in particular is designed to be CPU-friendly, GPU-unfriendly,\nand FPGA/ASIC-neutral.  In other words, it's meant to be relatively\nefficient to compute on current CPUs and relatively inefficient on\ncurrent GPUs.  Unfortunately, being GPU-unfriendly also means that\neventual FPGA and ASIC implementations will only compete with CPUs, and\nat least ASICs will win over the CPUs (FPGAs might not because of this\nmarket's peculiarities - large FPGAs are even more \"over-priced\" than\nlarge CPUs are), albeit by far not to the extent they did e.g. for\nBitcoin and Litecoin.\n\nThere's a lot of talk about \"ASIC resistance\".  What is (or should be)\nmeant by that is limiting the advantage of specialized ASICs.  While\nlimiting the advantage at KDF to e.g. 10x and at password hashing to\ne.g. 100x (talking orders of magnitude here, in whatever terms) may be\nconsidered \"ASIC resistant\" (as compared to e.g. 100,000x we'd have\nwithout trying), similar improvement factors are practically not \"ASIC\nresistant\" for cryptocurrency mining where they can make all the\ndifference between CPU mining being profitable and not.  There might\nalso exist in-between PoW use cases where moderate ASIC advantage is OK,\nsuch as with non-cryptocurrency and/or private/permissioned blockchains.\n\nThus, current yespower may be considered either a short-term choice\n(valid until one of its uses provides sufficient perceived incentive to\nlikely result in specialized ASICs) or a deliberate choice of a pro-CPU,\nanti-GPU, moderately-pro-ASIC PoW scheme.  It is also possible to\nrespond to known improvements in future GPUs/implementations and/or to\nASICs with new versions of yespower that users would need to switch to.\n\n\n\tyespower versions.\n\nyespower includes optimized and specialized re-implementation of the\nobsolete yescrypt 0.5 (based off its first submission to Password\nHashing Competition back in 2014) now re-released as yespower 0.5, and\nbrand new proof-of-work specific variation known as yespower 1.0.\n\nyespower 0.5 is intended as a compatible upgrade for cryptocurrencies\nthat already use yescrypt 0.5 (providing a few percent speedup), and\nyespower 1.0 may be used as a further upgrade or a new choice of PoW by\nthose and other cryptocurrencies and other projects.\n\nThere are many significant differences between yespower 0.5 and 1.0\nunder the hood, but the main user visible difference is yespower 1.0\ngreatly improving on GPU-unfriendliness in light of improvements seen in\nmodern GPUs (up to and including NVIDIA Volta) and GPU implementations\nof yescrypt 0.5.  This is achieved mostly through greater use of CPUs'\nL2 cache.\n\nThe version of algorithm to use is requested through parameters,\nallowing for both algorithms to co-exist in client and miner\nimplementations (such as in preparation for a cryptocurrency hard-fork\nand/or supporting multiple cryptocurrencies in one program).\n\n\n\tParameter selection.\n\nFor new uses of yespower, set the requested version to the highest\nsupported, and set N*r to the highest you can reasonably afford in terms\nof proof verification time (which might in turn be determined by desired\nshare rate per mining pool server), using one of the following options:\n\n1 MiB: N = 1024, r = 8\n2 MiB: N = 2048, r = 8\n4 MiB: N = 1024, r = 32\n8 MiB: N = 2048, r = 32\n16 MiB: N = 4096, r = 32\n\nand so on for higher N keeping r=32.\n\nYou may also set the personalization string to your liking, but that is\nnot required (you can set its pointer to NULL and its length to 0).  Its\nsupport is provided mostly for compatibility with existing modifications\nof yescrypt 0.5.\n\n\n\tPerformance.\n\nPlease refer to PERFORMANCE for some benchmarks and performance tuning.\n\n\n\tHow to test yespower for proper operation.\n\nOn a Unix-like system, invoke \"make check\".  This will build and run a\nprogram called \"tests\", and check its output against the supplied file\nTESTS-OK.  If everything matches, the final line of output should be the\nword \"PASSED\".\n\nWe do most of our testing on Linux systems with gcc.  The supplied\nMakefile assumes that you use gcc.\n\n\n\tAlternate code versions and make targets.\n\nTwo implementations of yespower are included: reference and optimized.\nBy default, the optimized implementation is built.  Internally, the\noptimized implementation uses conditional compilation to choose between\nusage of various SIMD instruction sets where supported and scalar code.\n\nThe reference implementation is unoptimized and is very slow, but it has\nsimpler and shorter source code.  Its purpose is to provide a simple\nhuman- and machine-readable specification that implementations intended\nfor actual use should be tested against.  It is deliberately mostly not\noptimized, and it is not meant to be used in production.\n\nSimilarly to \"make check\", there's \"make check-ref\" to build and test\nthe reference implementation.  There's also \"make ref\" to build the\nreference implementation and have the \"benchmark\" program use it.\n\n\"make clean\" may need to be run between making different builds.\n\n\n\tHow to integrate yespower in a program.\n\nAlthough yespower.h provides several functions, chances are that you\nwill only need to use yespower_tls().  Please see the comment on this\nfunction in yespower.h and its example usage in tests.c and benchmark.c,\nincluding parameter sets requesting yescrypt 0.5 as used by certain\nexisting cryptocurrencies.\n\nTo integrate yespower in an altcoin based on Bitcoin Core, you might\ninvoke yespower_tls() from either a maybe-new (depending on where you\nfork from) CBlockHeader::GetPoWHash() (and invoke that where PoW is\nneeded like e.g. Litecoin does for scrypt) or CBlockHeader::GetHash()\n(easier, but inefficient and you'll be stuck with that inefficiency).\n\nYou'll also want to implement caching of the computed PoW hashes like\ne.g. YACoin does for scrypt.  Caching is especially important if you\ninvoke yespower from CBlockHeader::GetHash().  However, even if you use\nor introduce CBlockHeader::GetPoWHash() caching may still be desirable\nas the PoW hash is commonly requested 4 times per block fetched during a\nnode's initial blockchain sync (once during prefetch of block headers,\nand 3 times more during validation of a fully fetched block).  On the\nother hand, you'll likely want to bypass the cache when PoW is computed\nby the node's built-in miner.\n\nFurther detail on this (generating new genesis blocks, etc.) is even\nfarther from being yespower-specific and thus is not provided here.\nJust like (and even more so than) yespower itself, the above guidance is\nprovided as-is and without guarantee of being correct and safe to\nfollow.  You're supposed to know what you're doing.\n\n\n\tCredits.\n\nscrypt has been designed by Colin Percival.  yescrypt and yespower have\nbeen designed by Solar Designer building upon scrypt.\n\nThe following other people and projects have also indirectly helped make\nyespower what it is:\n\n - Bill Cox\n - Rich Felker\n - Anthony Ferrara\n - Christian Forler\n - Taylor Hornby\n - Dmitry Khovratovich\n - Samuel Neves\n - Marcos Simplicio\n - Ken T Takusagawa\n - Jakob Wenzel\n - Christian Winnerlein\n\n - DARPA Cyber Fast Track\n - Password Hashing Competition\n\n\n\tContact info.\n\nFirst, please check the yespower homepage for new versions, etc.:\n\n    https://www.openwall.com/yespower/\n\nIf you have anything valuable to add or a non-trivial question to ask,\nyou may contact the maintainer of yespower at:\n\n    Solar Designer <solar at openwall.com>\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/TESTS-OK",
    "content": "yespower(5, 2048, 8, \"Client Key\") = a5 9f ec 4c 4f dd a1 6e 3b 14 05 ad da 66 d5 25 b6 8e 7c ad fc fe 6a c0 66 c7 ad 11 8c d8 05 90\nyespower(5, 2048, 8, BSTY) = 5e a2 b2 95 6a 9e ac e3 0a 32 37 ff 1d 44 1e de e1 dc 25 aa b8 f0 ea 15 c1 21 65 f8 3a 7b c2 65\nyespower(5, 4096, 16, \"Client Key\") = 92 7e 72 d0 de d3 d8 04 75 47 3f 40 f1 74 3c 67 28 9d 45 3d 52 42 d4 f5 5a f4 e3 25 e0 66 99 c5\nyespower(5, 4096, 24, \"Jagaricoin\") = 0e 13 66 97 32 11 e7 fe a8 ad 9d 81 98 9c 84 a2 54 d9 68 c9 d3 33 dd 8f f0 99 32 4f 38 61 1e 04\nyespower(5, 4096, 32, \"WaviBanana\") = 3a e0 5a bb 3c 5c f6 f7 54 15 a9 25 54 c9 8d 50 e3 8e c9 55 2c fa 78 37 36 16 f4 80 b2 4e 55 9f\nyespower(5, 2048, 32, \"Client Key\") = 56 0a 89 1b 5c a2 e1 c6 36 11 1a 9f f7 c8 94 a5 d0 a2 60 2f 43 fd cf a5 94 9b 95 e2 2f e4 46 1e\nyespower(5, 1024, 32, \"Client Key\") = 2a 79 e5 3d 1b e6 66 9b c5 56 cc c4 17 bc e3 d2 2a 74 a2 32 f5 6b 8e 1d 39 b4 57 92 67 5d e1 08\nyespower(5, 2048, 8, NULL) = 5e cb d8 e8 d7 c9 0b ae d4 bb f8 91 6a 12 25 dc c3 c6 5f 5c 91 65 ba e8 1c dd e3 cf fa d1 28 e8\nyespower(10, 2048, 8, NULL) = 69 e0 e8 95 b3 df 7a ee b8 37 d7 1f e1 99 e9 d3 4f 7e c4 6e cb ca 7a 2c 43 08 e5 18 57 ae 9b 46\nyespower(10, 4096, 16, NULL) = 33 fb 8f 06 38 24 a4 a0 20 f6 3d ca 53 5f 5c a6 6a b5 57 64 68 c7 5d 1c ca ac 75 42 f7 64 95 ac\nyespower(10, 4096, 32, NULL) = 77 1a ee fd a8 fe 79 a0 82 5b c7 f2 ae e1 62 ab 55 78 57 46 39 ff c6 ca 37 23 cc 18 e5 e3 e2 85\nyespower(10, 2048, 32, NULL) = d5 ef b8 13 cd 26 3e 9b 34 54 01 30 23 3c bb c6 a9 21 fb ff 34 31 e5 ec 1a 1a bd e2 ae a6 ff 4d\nyespower(10, 1024, 32, NULL) = 50 1b 79 2d b4 2e 38 8f 6e 7d 45 3c 95 d0 3a 12 a3 60 16 a5 15 4a 68 83 90 dd c6 09 a4 0c 67 99\nyespower(10, 1024, 32, \"personality test\") = 1f 02 69 ac f5 65 c4 9a dc 0e f9 b8 f2 6a b3 80 8c dc 38 39 4a 25 4f dd ee dc c3 aa cf f6 ad 9d\nXOR of yespower(5, ...) = ae f1 32 91 87 0f 55 70 47 f4 2e 9b ef a6 16 df e5 f1 96 77 e1 3f 8b a6 92 f7 c5 97 55 a0 f5 0e\nXOR of yespower(10, ...) = 8d 13 c5 fb 07 30 96 75 d1 b8 48 92 77 ba 4b e4 40 33 be df ae 7a 60 43 8a 9b e2 1f 3a 7b 12 37\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/benchmark.c",
    "content": "/*-\n * Copyright 2013-2018 Alexander Peslyak\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#include <stdio.h>\n#include <stdlib.h> /* for atoi() */\n#include <string.h>\n#include <unistd.h>\n#include <time.h>\n#include <sys/times.h>\n#include <sched.h>\n\n#include \"yespower.h\"\n\n#ifdef _OPENMP\n#include <omp.h>\n\n#define NSAVE 1000\n\nstatic uint64_t time_us(void)\n{\n\tstruct timespec t;\n#ifdef CLOCK_MONOTONIC_RAW\n\tif (clock_gettime(CLOCK_MONOTONIC_RAW, &t))\n\t\treturn 0;\n#else\n\tif (clock_gettime(CLOCK_MONOTONIC, &t))\n\t\treturn 0;\n#endif\n\treturn 1 + (uint64_t)t.tv_sec * 1000000 + t.tv_nsec / 1000;\n}\n#endif\n\nint main(int argc, const char * const *argv)\n{\n\tyespower_params_t params = {\n\t\t.version = YESPOWER_0_5,\n\t\t.N = 2048,\n\t\t.r = 8,\n\t\t.pers = (const uint8_t *)\"Client Key\",\n\t\t.perslen = 10\n\t};\n\n\tif (argc > 1)\n\t\tparams.version = atoi(argv[1]);\n\tif (argc > 2)\n\t\tparams.N = atoi(argv[2]);\n\tif (argc > 3)\n\t\tparams.r = atoi(argv[3]);\n\n\tprintf(\"version=%.1f N=%u r=%u\\n\",\n\t    params.version * 0.1, params.N, params.r);\n\n\tprintf(\"Will use %.2f KiB RAM\\n\", 0.125 * params.N * params.r);\n\n\tstatic __thread union {\n\t\tuint8_t u8[80];\n\t\tuint32_t u32[20];\n\t} src;\n\tyespower_binary_t dst;\n\tunsigned int i;\n\n\tfor (i = 0; i < sizeof(src); i++)\n\t\tsrc.u8[i] = i * 3;\n\n\tif (yespower_tls(src.u8, sizeof(src), &params, &dst)) {\n\t\tputs(\"FAILED\");\n\t\treturn 1;\n\t}\n\n\tfor (i = 0; i < sizeof(dst); i++)\n\t\tprintf(\"%02x%c\", dst.uc[i], i < sizeof(dst) - 1 ? ' ' : '\\n');\n\n\tputs(\"Benchmarking 1 thread ...\");\n\n\tclock_t clk_tck = sysconf(_SC_CLK_TCK);\n\tstruct tms start_tms, end_tms;\n\tclock_t start = times(&start_tms), end;\n\tunsigned int n;\n\tunsigned long long count;\n#ifdef _OPENMP\n\tyespower_binary_t save[NSAVE];\n\tunsigned int nsave = 0;\n#endif\n\tuint32_t seed = start * 1812433253U;\n\n\tn = 1;\n\tcount = 0;\n\tdo {\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tyespower_binary_t *p = &dst;\n#ifdef _OPENMP\n\t\t\tif (nsave < NSAVE)\n\t\t\t\tp = &save[nsave++];\n#endif\n\t\t\tsrc.u32[19] = seed + (count + i);\n\t\t\tif (yespower_tls(src.u8, sizeof(src), &params, p)) {\n\t\t\t\tputs(\"FAILED\");\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\tcount += n;\n\n\t\tend = times(&end_tms);\n\t\tn <<= 1;\n\t} while (end - start < clk_tck * 2);\n\n\tclock_t start_v = start_tms.tms_utime + start_tms.tms_stime +\n\t    start_tms.tms_cutime + start_tms.tms_cstime;\n\tclock_t end_v = end_tms.tms_utime + end_tms.tms_stime +\n\t    end_tms.tms_cutime + end_tms.tms_cstime;\n\n\tprintf(\"%llu H/s real, %llu H/s virtual \"\n\t    \"(%llu hashes in %.2f seconds)\\n\",\n\t    count * clk_tck / (end - start),\n\t    count * clk_tck / (end_v - start_v),\n\t    count, (double)(end - start) / clk_tck);\n\n\tfor (i = 0; i < nsave; i++) {\n\t\tunsigned int j;\n\t\tfor (j = i + 1; j < nsave; j++) {\n\t\t\tunsigned int k = 8;\n\t\t\tif (!memcmp(&save[i], &save[j], k)) {\n\t\t\t\tprintf(\"%u-byte collision(s) detected\\n\", k);\n\t\t\t\ti = nsave; break;\n\t\t\t}\n\t\t}\n\t}\n\n#ifdef _OPENMP\n\tunsigned int nt = omp_get_max_threads();\n\n\tprintf(\"Benchmarking %u thread%s ...\\n\",\n\t    nt, nt == 1 ? \"\" : \"s\");\n\n\ttypedef struct {\n\t\tuint64_t min, max, total;\n\t} thread_data_s;\n\tunion {\n\t\tthread_data_s s;\n\t\tuint8_t cachelines[2][64]; /* avoid false sharing */\n\t} thread_data[nt]; /* tricky to align this when on stack */\n\n\tunsigned int t;\n\tfor (t = 0; t < nt; t++) {\n\t\tthread_data_s *td = &thread_data[t].s;\n\t\ttd->min = ~(uint64_t)0; td->max = 0; td->total = 0;\n\t}\n\n\tunsigned long long count1 = count, count_restart = 0;\n\n\tif (!geteuid()) {\n\t\tputs(\"Running as root, so trying to set SCHED_RR\");\n#pragma omp parallel\n\t\t{\n\t\t\tstruct sched_param param = { .sched_priority = 1 };\n\t\t\tif (sched_setscheduler(getpid(), SCHED_RR, &param))\n\t\t\t\tperror(\"sched_setscheduler\");\n\t\t}\n\t}\n\n\tstart = times(&start_tms);\n\n\tn = count * omp_get_max_threads();\n\tcount = 0;\n\tdo {\n#pragma omp parallel for default(none) copyin(src) private(i, dst) shared(n, thread_data, params, seed, count, save, nsave)\n\t\tfor (i = 0; i < n; i++) {\n\t\t\tunsigned int j = count + i;\n\n\t\t\tsrc.u32[19] = seed + j;\n\n\t\t\tuint64_t start1 = time_us();\n\n\t\t\tif (yespower_tls(src.u8, sizeof(src), &params, &dst)) {\n#pragma omp critical\n\t\t\t\tputs(\"FAILED\");\n\t\t\t}\n\n\t\t\tuint64_t end1 = time_us();\n\t\t\tif (end1 < start1)\n\t\t\t\tend1 = start1;\n\t\t\tuint64_t diff1 = end1 - start1;\n\n\t\t\tthread_data_s *td = &thread_data[omp_get_thread_num()].s;\n\t\t\ttd->total += diff1;\n\t\t\tif (diff1 < td->min)\n\t\t\t\ttd->min = diff1;\n\t\t\tif (diff1 > td->max)\n\t\t\t\ttd->max = diff1;\n\n#ifdef _OPENMP\n\t\t\tif (j < nsave && memcmp(&save[j], &dst, sizeof(dst))) {\n#pragma omp critical\n\t\t\t\tprintf(\"Mismatch at %u\\n\", j);\n\t\t\t}\n#endif\n\t\t}\n\n\t\tcount += n;\n\t\tif ((count - n) < count1 && count >= count1) {\n/* Disregard our repeat of single thread's results (could be partially cached\n * by same core, but OTOH other cores not yet warmed up to full clock rate). */\n\t\t\tstart = times(&start_tms);\n\t\t\tcount_restart = count;\n\t\t\tfor (t = 0; t < nt; t++) {\n\t\t\t\tthread_data_s *td = &thread_data[t].s;\n\t\t\t\ttd->min = ~(uint64_t)0; td->max = 0; td->total = 0;\n\t\t\t}\n\t\t} else {\n\t\t\tn <<= 1;\n\t\t}\n\n\t\tend = times(&end_tms);\n\t} while (end - start < clk_tck);\n\n\tif (!count_restart)\n\t\tputs(\"Didn't reach single-thread's hash count\");\n\tcount -= count_restart;\n\n\tstart_v = start_tms.tms_utime + start_tms.tms_stime +\n\t    start_tms.tms_cutime + start_tms.tms_cstime;\n\tend_v = end_tms.tms_utime + end_tms.tms_stime +\n\t    end_tms.tms_cutime + end_tms.tms_cstime;\n\n\tprintf(\"%llu H/s real, %llu H/s virtual \"\n\t    \"(%llu hashes in %.2f seconds)\\n\",\n\t    count * clk_tck / (end - start),\n\t    count * clk_tck / (end_v - start_v),\n\t    count, (double)(end - start) / clk_tck);\n\n\tuint64_t min = ~(uint64_t)0, max = 0, total = 0;\n\tfor (t = 0; t < nt; t++) {\n\t\tthread_data_s *td = &thread_data[t].s;\n\t\ttotal += td->total;\n\t\tif (td->min < min)\n\t\t\tmin = td->min;\n\t\tif (td->max > max)\n\t\t\tmax = td->max;\n\t}\n\tprintf(\"min %.3f ms, avg %.3f ms, max %.3f ms\\n\",\n\t\tmin / 1000.0, total / 1000.0 / count, max / 1000.0);\n#endif\n\n\treturn 0;\n}\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/insecure_memzero.h",
    "content": "#define insecure_memzero(buf, len) /* empty */\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/sha256.c",
    "content": "/*-\n * Copyright 2005-2016 Colin Percival\n * Copyright 2016-2018 Alexander Peslyak\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#include <assert.h>\n#include <stdint.h>\n#include <string.h>\n\n#include \"insecure_memzero.h\"\n#include \"sysendian.h\"\n\n#include \"sha256.h\"\n\n#ifdef __ICC\n/* Miscompile with icc 14.0.0 (at least), so don't use restrict there */\n#define restrict\n#elif __STDC_VERSION__ >= 199901L\n/* Have restrict */\n#elif defined(__GNUC__)\n#define restrict __restrict\n#else\n#define restrict\n#endif\n\n/*\n * Encode a length len*2 vector of (uint32_t) into a length len*8 vector of\n * (uint8_t) in big-endian form.\n */\nstatic void\nbe32enc_vect(uint8_t * dst, const uint32_t * src, size_t len)\n{\n\n\t/* Encode vector, two words at a time. */\n\tdo {\n\t\tbe32enc(&dst[0], src[0]);\n\t\tbe32enc(&dst[4], src[1]);\n\t\tsrc += 2;\n\t\tdst += 8;\n\t} while (--len);\n}\n\n/*\n * Decode a big-endian length len*8 vector of (uint8_t) into a length\n * len*2 vector of (uint32_t).\n */\nstatic void\nbe32dec_vect(uint32_t * dst, const uint8_t * src, size_t len)\n{\n\n\t/* Decode vector, two words at a time. */\n\tdo {\n\t\tdst[0] = be32dec(&src[0]);\n\t\tdst[1] = be32dec(&src[4]);\n\t\tsrc += 8;\n\t\tdst += 2;\n\t} while (--len);\n}\n\n/* SHA256 round constants. */\nstatic const uint32_t Krnd[64] = {\n\t0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n\t0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n\t0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n\t0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n\t0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n\t0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n\t0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n\t0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n\t0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n\t0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n\t0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n\t0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n\t0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n\t0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n\t0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n\t0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n};\n\n/* Elementary functions used by SHA256 */\n#define Ch(x, y, z)\t((x & (y ^ z)) ^ z)\n#define Maj(x, y, z)\t((x & (y | z)) | (y & z))\n#define SHR(x, n)\t(x >> n)\n#define ROTR(x, n)\t((x >> n) | (x << (32 - n)))\n#define S0(x)\t\t(ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))\n#define S1(x)\t\t(ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))\n#define s0(x)\t\t(ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3))\n#define s1(x)\t\t(ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10))\n\n/* SHA256 round function */\n#define RND(a, b, c, d, e, f, g, h, k)\t\t\t\\\n\th += S1(e) + Ch(e, f, g) + k;\t\t\t\\\n\td += h;\t\t\t\t\t\t\\\n\th += S0(a) + Maj(a, b, c);\n\n/* Adjusted round function for rotating state */\n#define RNDr(S, W, i, ii)\t\t\t\\\n\tRND(S[(64 - i) % 8], S[(65 - i) % 8],\t\\\n\t    S[(66 - i) % 8], S[(67 - i) % 8],\t\\\n\t    S[(68 - i) % 8], S[(69 - i) % 8],\t\\\n\t    S[(70 - i) % 8], S[(71 - i) % 8],\t\\\n\t    W[i + ii] + Krnd[i + ii])\n\n/* Message schedule computation */\n#define MSCH(W, ii, i)\t\t\t\t\\\n\tW[i + ii + 16] = s1(W[i + ii + 14]) + W[i + ii + 9] + s0(W[i + ii + 1]) + W[i + ii]\n\n/*\n * SHA256 block compression function.  The 256-bit state is transformed via\n * the 512-bit input block to produce a new state.\n */\nstatic void\nSHA256_Transform(uint32_t state[static restrict 8],\n    const uint8_t block[static restrict 64],\n    uint32_t W[static restrict 64], uint32_t S[static restrict 8])\n{\n\tint i;\n\n\t/* 1. Prepare the first part of the message schedule W. */\n\tbe32dec_vect(W, block, 8);\n\n\t/* 2. Initialize working variables. */\n\tmemcpy(S, state, 32);\n\n\t/* 3. Mix. */\n\tfor (i = 0; i < 64; i += 16) {\n\t\tRNDr(S, W, 0, i);\n\t\tRNDr(S, W, 1, i);\n\t\tRNDr(S, W, 2, i);\n\t\tRNDr(S, W, 3, i);\n\t\tRNDr(S, W, 4, i);\n\t\tRNDr(S, W, 5, i);\n\t\tRNDr(S, W, 6, i);\n\t\tRNDr(S, W, 7, i);\n\t\tRNDr(S, W, 8, i);\n\t\tRNDr(S, W, 9, i);\n\t\tRNDr(S, W, 10, i);\n\t\tRNDr(S, W, 11, i);\n\t\tRNDr(S, W, 12, i);\n\t\tRNDr(S, W, 13, i);\n\t\tRNDr(S, W, 14, i);\n\t\tRNDr(S, W, 15, i);\n\n\t\tif (i == 48)\n\t\t\tbreak;\n\t\tMSCH(W, 0, i);\n\t\tMSCH(W, 1, i);\n\t\tMSCH(W, 2, i);\n\t\tMSCH(W, 3, i);\n\t\tMSCH(W, 4, i);\n\t\tMSCH(W, 5, i);\n\t\tMSCH(W, 6, i);\n\t\tMSCH(W, 7, i);\n\t\tMSCH(W, 8, i);\n\t\tMSCH(W, 9, i);\n\t\tMSCH(W, 10, i);\n\t\tMSCH(W, 11, i);\n\t\tMSCH(W, 12, i);\n\t\tMSCH(W, 13, i);\n\t\tMSCH(W, 14, i);\n\t\tMSCH(W, 15, i);\n\t}\n\n\t/* 4. Mix local working variables into global state. */\n\tstate[0] += S[0];\n\tstate[1] += S[1];\n\tstate[2] += S[2];\n\tstate[3] += S[3];\n\tstate[4] += S[4];\n\tstate[5] += S[5];\n\tstate[6] += S[6];\n\tstate[7] += S[7];\n}\n\nstatic const uint8_t PAD[64] = {\n\t0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n\t0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n};\n\n/* Add padding and terminating bit-count. */\nstatic void\nSHA256_Pad(SHA256_CTX * ctx, uint32_t tmp32[static restrict 72])\n{\n\tsize_t r;\n\n\t/* Figure out how many bytes we have buffered. */\n\tr = (ctx->count >> 3) & 0x3f;\n\n\t/* Pad to 56 mod 64, transforming if we finish a block en route. */\n\tif (r < 56) {\n\t\t/* Pad to 56 mod 64. */\n\t\tmemcpy(&ctx->buf[r], PAD, 56 - r);\n\t} else {\n\t\t/* Finish the current block and mix. */\n\t\tmemcpy(&ctx->buf[r], PAD, 64 - r);\n\t\tSHA256_Transform(ctx->state, ctx->buf, &tmp32[0], &tmp32[64]);\n\n\t\t/* The start of the final block is all zeroes. */\n\t\tmemset(&ctx->buf[0], 0, 56);\n\t}\n\n\t/* Add the terminating bit-count. */\n\tbe64enc(&ctx->buf[56], ctx->count);\n\n\t/* Mix in the final block. */\n\tSHA256_Transform(ctx->state, ctx->buf, &tmp32[0], &tmp32[64]);\n}\n\n/* Magic initialization constants. */\nstatic const uint32_t initial_state[8] = {\n\t0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A,\n\t0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19\n};\n\n/**\n * SHA256_Init(ctx):\n * Initialize the SHA256 context ${ctx}.\n */\nvoid\nSHA256_Init(SHA256_CTX * ctx)\n{\n\n\t/* Zero bits processed so far. */\n\tctx->count = 0;\n\n\t/* Initialize state. */\n\tmemcpy(ctx->state, initial_state, sizeof(initial_state));\n}\n\n/**\n * SHA256_Update(ctx, in, len):\n * Input ${len} bytes from ${in} into the SHA256 context ${ctx}.\n */\nstatic void\n_SHA256_Update(SHA256_CTX * ctx, const void * in, size_t len,\n    uint32_t tmp32[static restrict 72])\n{\n\tuint32_t r;\n\tconst uint8_t * src = in;\n\n\t/* Return immediately if we have nothing to do. */\n\tif (len == 0)\n\t\treturn;\n\n\t/* Number of bytes left in the buffer from previous updates. */\n\tr = (ctx->count >> 3) & 0x3f;\n\n\t/* Update number of bits. */\n\tctx->count += (uint64_t)(len) << 3;\n\n\t/* Handle the case where we don't need to perform any transforms. */\n\tif (len < 64 - r) {\n\t\tmemcpy(&ctx->buf[r], src, len);\n\t\treturn;\n\t}\n\n\t/* Finish the current block. */\n\tmemcpy(&ctx->buf[r], src, 64 - r);\n\tSHA256_Transform(ctx->state, ctx->buf, &tmp32[0], &tmp32[64]);\n\tsrc += 64 - r;\n\tlen -= 64 - r;\n\n\t/* Perform complete blocks. */\n\twhile (len >= 64) {\n\t\tSHA256_Transform(ctx->state, src, &tmp32[0], &tmp32[64]);\n\t\tsrc += 64;\n\t\tlen -= 64;\n\t}\n\n\t/* Copy left over data into buffer. */\n\tmemcpy(ctx->buf, src, len);\n}\n\n/* Wrapper function for intermediate-values sanitization. */\nvoid\nSHA256_Update(SHA256_CTX * ctx, const void * in, size_t len)\n{\n\tuint32_t tmp32[72];\n\n\t/* Call the real function. */\n\t_SHA256_Update(ctx, in, len, tmp32);\n\n\t/* Clean the stack. */\n\tinsecure_memzero(tmp32, 288);\n}\n\n/**\n * SHA256_Final(digest, ctx):\n * Output the SHA256 hash of the data input to the context ${ctx} into the\n * buffer ${digest}.\n */\nstatic void\n_SHA256_Final(uint8_t digest[32], SHA256_CTX * ctx,\n    uint32_t tmp32[static restrict 72])\n{\n\n\t/* Add padding. */\n\tSHA256_Pad(ctx, tmp32);\n\n\t/* Write the hash. */\n\tbe32enc_vect(digest, ctx->state, 4);\n}\n\n/* Wrapper function for intermediate-values sanitization. */\nvoid\nSHA256_Final(uint8_t digest[32], SHA256_CTX * ctx)\n{\n\tuint32_t tmp32[72];\n\n\t/* Call the real function. */\n\t_SHA256_Final(digest, ctx, tmp32);\n\n\t/* Clear the context state. */\n\tinsecure_memzero(ctx, sizeof(SHA256_CTX));\n\n\t/* Clean the stack. */\n\tinsecure_memzero(tmp32, 288);\n}\n\n/**\n * SHA256_Buf(in, len, digest):\n * Compute the SHA256 hash of ${len} bytes from ${in} and write it to ${digest}.\n */\nvoid\nSHA256_Buf(const void * in, size_t len, uint8_t digest[32])\n{\n\tSHA256_CTX ctx;\n\tuint32_t tmp32[72];\n\n\tSHA256_Init(&ctx);\n\t_SHA256_Update(&ctx, in, len, tmp32);\n\t_SHA256_Final(digest, &ctx, tmp32);\n\n\t/* Clean the stack. */\n\tinsecure_memzero(&ctx, sizeof(SHA256_CTX));\n\tinsecure_memzero(tmp32, 288);\n}\n\n/**\n * HMAC_SHA256_Init(ctx, K, Klen):\n * Initialize the HMAC-SHA256 context ${ctx} with ${Klen} bytes of key from\n * ${K}.\n */\nstatic void\n_HMAC_SHA256_Init(HMAC_SHA256_CTX * ctx, const void * _K, size_t Klen,\n    uint32_t tmp32[static restrict 72], uint8_t pad[static restrict 64],\n    uint8_t khash[static restrict 32])\n{\n\tconst uint8_t * K = _K;\n\tsize_t i;\n\n\t/* If Klen > 64, the key is really SHA256(K). */\n\tif (Klen > 64) {\n\t\tSHA256_Init(&ctx->ictx);\n\t\t_SHA256_Update(&ctx->ictx, K, Klen, tmp32);\n\t\t_SHA256_Final(khash, &ctx->ictx, tmp32);\n\t\tK = khash;\n\t\tKlen = 32;\n\t}\n\n\t/* Inner SHA256 operation is SHA256(K xor [block of 0x36] || data). */\n\tSHA256_Init(&ctx->ictx);\n\tmemset(pad, 0x36, 64);\n\tfor (i = 0; i < Klen; i++)\n\t\tpad[i] ^= K[i];\n\t_SHA256_Update(&ctx->ictx, pad, 64, tmp32);\n\n\t/* Outer SHA256 operation is SHA256(K xor [block of 0x5c] || hash). */\n\tSHA256_Init(&ctx->octx);\n\tmemset(pad, 0x5c, 64);\n\tfor (i = 0; i < Klen; i++)\n\t\tpad[i] ^= K[i];\n\t_SHA256_Update(&ctx->octx, pad, 64, tmp32);\n}\n\n/* Wrapper function for intermediate-values sanitization. */\nvoid\nHMAC_SHA256_Init(HMAC_SHA256_CTX * ctx, const void * _K, size_t Klen)\n{\n\tuint32_t tmp32[72];\n\tuint8_t pad[64];\n\tuint8_t khash[32];\n\n\t/* Call the real function. */\n\t_HMAC_SHA256_Init(ctx, _K, Klen, tmp32, pad, khash);\n\n\t/* Clean the stack. */\n\tinsecure_memzero(tmp32, 288);\n\tinsecure_memzero(khash, 32);\n\tinsecure_memzero(pad, 64);\n}\n\n/**\n * HMAC_SHA256_Update(ctx, in, len):\n * Input ${len} bytes from ${in} into the HMAC-SHA256 context ${ctx}.\n */\nstatic void\n_HMAC_SHA256_Update(HMAC_SHA256_CTX * ctx, const void * in, size_t len,\n    uint32_t tmp32[static restrict 72])\n{\n\n\t/* Feed data to the inner SHA256 operation. */\n\t_SHA256_Update(&ctx->ictx, in, len, tmp32);\n}\n\n/* Wrapper function for intermediate-values sanitization. */\nvoid\nHMAC_SHA256_Update(HMAC_SHA256_CTX * ctx, const void * in, size_t len)\n{\n\tuint32_t tmp32[72];\n\n\t/* Call the real function. */\n\t_HMAC_SHA256_Update(ctx, in, len, tmp32);\n\n\t/* Clean the stack. */\n\tinsecure_memzero(tmp32, 288);\n}\n\n/**\n * HMAC_SHA256_Final(digest, ctx):\n * Output the HMAC-SHA256 of the data input to the context ${ctx} into the\n * buffer ${digest}.\n */\nstatic void\n_HMAC_SHA256_Final(uint8_t digest[32], HMAC_SHA256_CTX * ctx,\n    uint32_t tmp32[static restrict 72], uint8_t ihash[static restrict 32])\n{\n\n\t/* Finish the inner SHA256 operation. */\n\t_SHA256_Final(ihash, &ctx->ictx, tmp32);\n\n\t/* Feed the inner hash to the outer SHA256 operation. */\n\t_SHA256_Update(&ctx->octx, ihash, 32, tmp32);\n\n\t/* Finish the outer SHA256 operation. */\n\t_SHA256_Final(digest, &ctx->octx, tmp32);\n}\n\n/* Wrapper function for intermediate-values sanitization. */\nvoid\nHMAC_SHA256_Final(uint8_t digest[32], HMAC_SHA256_CTX * ctx)\n{\n\tuint32_t tmp32[72];\n\tuint8_t ihash[32];\n\n\t/* Call the real function. */\n\t_HMAC_SHA256_Final(digest, ctx, tmp32, ihash);\n\n\t/* Clean the stack. */\n\tinsecure_memzero(tmp32, 288);\n\tinsecure_memzero(ihash, 32);\n}\n\n/**\n * HMAC_SHA256_Buf(K, Klen, in, len, digest):\n * Compute the HMAC-SHA256 of ${len} bytes from ${in} using the key ${K} of\n * length ${Klen}, and write the result to ${digest}.\n */\nvoid\nHMAC_SHA256_Buf(const void * K, size_t Klen, const void * in, size_t len,\n    uint8_t digest[32])\n{\n\tHMAC_SHA256_CTX ctx;\n\tuint32_t tmp32[72];\n\tuint8_t tmp8[96];\n\n\t_HMAC_SHA256_Init(&ctx, K, Klen, tmp32, &tmp8[0], &tmp8[64]);\n\t_HMAC_SHA256_Update(&ctx, in, len, tmp32);\n\t_HMAC_SHA256_Final(digest, &ctx, tmp32, &tmp8[0]);\n\n\t/* Clean the stack. */\n\tinsecure_memzero(&ctx, sizeof(HMAC_SHA256_CTX));\n\tinsecure_memzero(tmp32, 288);\n\tinsecure_memzero(tmp8, 96);\n}\n\n/* Add padding and terminating bit-count, but don't invoke Transform yet. */\nstatic int\nSHA256_Pad_Almost(SHA256_CTX * ctx, uint8_t len[static restrict 8],\n    uint32_t tmp32[static restrict 72])\n{\n\tuint32_t r;\n\n\tr = (ctx->count >> 3) & 0x3f;\n\tif (r >= 56)\n\t\treturn -1;\n\n\t/*\n\t * Convert length to a vector of bytes -- we do this now rather\n\t * than later because the length will change after we pad.\n\t */\n\tbe64enc(len, ctx->count);\n\n\t/* Add 1--56 bytes so that the resulting length is 56 mod 64. */\n\t_SHA256_Update(ctx, PAD, 56 - r, tmp32);\n\n\t/* Add the terminating bit-count. */\n\tctx->buf[63] = len[7];\n\t_SHA256_Update(ctx, len, 7, tmp32);\n\n\treturn 0;\n}\n\n/**\n * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen):\n * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and\n * write the output to buf.  The value dkLen must be at most 32 * (2^32 - 1).\n */\nvoid\nPBKDF2_SHA256(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt,\n    size_t saltlen, uint64_t c, uint8_t * buf, size_t dkLen)\n{\n\tHMAC_SHA256_CTX Phctx, PShctx, hctx;\n\tuint32_t tmp32[72];\n\tunion {\n\t\tuint8_t tmp8[96];\n\t\tuint32_t state[8];\n\t} u;\n\tsize_t i;\n\tuint8_t ivec[4];\n\tuint8_t U[32];\n\tuint8_t T[32];\n\tuint64_t j;\n\tint k;\n\tsize_t clen;\n\n\t/* Sanity-check. */\n\tassert(dkLen <= 32 * (size_t)(UINT32_MAX));\n\n\tif (c == 1 && (dkLen & 31) == 0 && (saltlen & 63) <= 51) {\n\t\tuint32_t oldcount;\n\t\tuint8_t * ivecp;\n\n\t\t/* Compute HMAC state after processing P and S. */\n\t\t_HMAC_SHA256_Init(&hctx, passwd, passwdlen,\n\t\t    tmp32, &u.tmp8[0], &u.tmp8[64]);\n\t\t_HMAC_SHA256_Update(&hctx, salt, saltlen, tmp32);\n\n\t\t/* Prepare ictx padding. */\n\t\toldcount = hctx.ictx.count & (0x3f << 3);\n\t\t_HMAC_SHA256_Update(&hctx, \"\\0\\0\\0\", 4, tmp32);\n\t\tif ((hctx.ictx.count & (0x3f << 3)) < oldcount ||\n\t\t    SHA256_Pad_Almost(&hctx.ictx, u.tmp8, tmp32))\n\t\t\tgoto generic; /* Can't happen due to saltlen check */\n\t\tivecp = hctx.ictx.buf + (oldcount >> 3);\n\n\t\t/* Prepare octx padding. */\n\t\thctx.octx.count += 32 << 3;\n\t\tSHA256_Pad_Almost(&hctx.octx, u.tmp8, tmp32);\n\n\t\t/* Iterate through the blocks. */\n\t\tfor (i = 0; i * 32 < dkLen; i++) {\n\t\t\t/* Generate INT(i + 1). */\n\t\t\tbe32enc(ivecp, (uint32_t)(i + 1));\n\n\t\t\t/* Compute U_1 = PRF(P, S || INT(i)). */\n\t\t\tmemcpy(u.state, hctx.ictx.state, sizeof(u.state));\n\t\t\tSHA256_Transform(u.state, hctx.ictx.buf,\n\t\t\t    &tmp32[0], &tmp32[64]);\n\t\t\tbe32enc_vect(hctx.octx.buf, u.state, 4);\n\t\t\tmemcpy(u.state, hctx.octx.state, sizeof(u.state));\n\t\t\tSHA256_Transform(u.state, hctx.octx.buf,\n\t\t\t    &tmp32[0], &tmp32[64]);\n\t\t\tbe32enc_vect(&buf[i * 32], u.state, 4);\n\t\t}\n\n\t\tgoto cleanup;\n\t}\n\ngeneric:\n\t/* Compute HMAC state after processing P. */\n\t_HMAC_SHA256_Init(&Phctx, passwd, passwdlen,\n\t    tmp32, &u.tmp8[0], &u.tmp8[64]);\n\n\t/* Compute HMAC state after processing P and S. */\n\tmemcpy(&PShctx, &Phctx, sizeof(HMAC_SHA256_CTX));\n\t_HMAC_SHA256_Update(&PShctx, salt, saltlen, tmp32);\n\n\t/* Iterate through the blocks. */\n\tfor (i = 0; i * 32 < dkLen; i++) {\n\t\t/* Generate INT(i + 1). */\n\t\tbe32enc(ivec, (uint32_t)(i + 1));\n\n\t\t/* Compute U_1 = PRF(P, S || INT(i)). */\n\t\tmemcpy(&hctx, &PShctx, sizeof(HMAC_SHA256_CTX));\n\t\t_HMAC_SHA256_Update(&hctx, ivec, 4, tmp32);\n\t\t_HMAC_SHA256_Final(T, &hctx, tmp32, u.tmp8);\n\n\t\tif (c > 1) {\n\t\t\t/* T_i = U_1 ... */\n\t\t\tmemcpy(U, T, 32);\n\n\t\t\tfor (j = 2; j <= c; j++) {\n\t\t\t\t/* Compute U_j. */\n\t\t\t\tmemcpy(&hctx, &Phctx, sizeof(HMAC_SHA256_CTX));\n\t\t\t\t_HMAC_SHA256_Update(&hctx, U, 32, tmp32);\n\t\t\t\t_HMAC_SHA256_Final(U, &hctx, tmp32, u.tmp8);\n\n\t\t\t\t/* ... xor U_j ... */\n\t\t\t\tfor (k = 0; k < 32; k++)\n\t\t\t\t\tT[k] ^= U[k];\n\t\t\t}\n\t\t}\n\n\t\t/* Copy as many bytes as necessary into buf. */\n\t\tclen = dkLen - i * 32;\n\t\tif (clen > 32)\n\t\t\tclen = 32;\n\t\tmemcpy(&buf[i * 32], T, clen);\n\t}\n\n\t/* Clean the stack. */\n\tinsecure_memzero(&Phctx, sizeof(HMAC_SHA256_CTX));\n\tinsecure_memzero(&PShctx, sizeof(HMAC_SHA256_CTX));\n\tinsecure_memzero(U, 32);\n\tinsecure_memzero(T, 32);\n\ncleanup:\n\tinsecure_memzero(&hctx, sizeof(HMAC_SHA256_CTX));\n\tinsecure_memzero(tmp32, 288);\n\tinsecure_memzero(&u, sizeof(u));\n}\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/sha256.h",
    "content": "/*-\n * Copyright 2005-2016 Colin Percival\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#ifndef _SHA256_H_\n#define _SHA256_H_\n\n#include <stddef.h>\n#include <stdint.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Use #defines in order to avoid namespace collisions with anyone else's\n * SHA256 code (e.g., the code in OpenSSL).\n */\n#define SHA256_Init libcperciva_SHA256_Init\n#define SHA256_Update libcperciva_SHA256_Update\n#define SHA256_Final libcperciva_SHA256_Final\n#define SHA256_Buf libcperciva_SHA256_Buf\n#define SHA256_CTX libcperciva_SHA256_CTX\n#define HMAC_SHA256_Init libcperciva_HMAC_SHA256_Init\n#define HMAC_SHA256_Update libcperciva_HMAC_SHA256_Update\n#define HMAC_SHA256_Final libcperciva_HMAC_SHA256_Final\n#define HMAC_SHA256_Buf libcperciva_HMAC_SHA256_Buf\n#define HMAC_SHA256_CTX libcperciva_HMAC_SHA256_CTX\n\n/* Context structure for SHA256 operations. */\ntypedef struct {\n\tuint32_t state[8];\n\tuint64_t count;\n\tuint8_t buf[64];\n} SHA256_CTX;\n\n/**\n * SHA256_Init(ctx):\n * Initialize the SHA256 context ${ctx}.\n */\nvoid SHA256_Init(SHA256_CTX *);\n\n/**\n * SHA256_Update(ctx, in, len):\n * Input ${len} bytes from ${in} into the SHA256 context ${ctx}.\n */\nvoid SHA256_Update(SHA256_CTX *, const void *, size_t);\n\n/**\n * SHA256_Final(digest, ctx):\n * Output the SHA256 hash of the data input to the context ${ctx} into the\n * buffer ${digest}.\n */\nvoid SHA256_Final(uint8_t[32], SHA256_CTX *);\n\n/**\n * SHA256_Buf(in, len, digest):\n * Compute the SHA256 hash of ${len} bytes from ${in} and write it to ${digest}.\n */\nvoid SHA256_Buf(const void *, size_t, uint8_t[32]);\n\n/* Context structure for HMAC-SHA256 operations. */\ntypedef struct {\n\tSHA256_CTX ictx;\n\tSHA256_CTX octx;\n} HMAC_SHA256_CTX;\n\n/**\n * HMAC_SHA256_Init(ctx, K, Klen):\n * Initialize the HMAC-SHA256 context ${ctx} with ${Klen} bytes of key from\n * ${K}.\n */\nvoid HMAC_SHA256_Init(HMAC_SHA256_CTX *, const void *, size_t);\n\n/**\n * HMAC_SHA256_Update(ctx, in, len):\n * Input ${len} bytes from ${in} into the HMAC-SHA256 context ${ctx}.\n */\nvoid HMAC_SHA256_Update(HMAC_SHA256_CTX *, const void *, size_t);\n\n/**\n * HMAC_SHA256_Final(digest, ctx):\n * Output the HMAC-SHA256 of the data input to the context ${ctx} into the\n * buffer ${digest}.\n */\nvoid HMAC_SHA256_Final(uint8_t[32], HMAC_SHA256_CTX *);\n\n/**\n * HMAC_SHA256_Buf(K, Klen, in, len, digest):\n * Compute the HMAC-SHA256 of ${len} bytes from ${in} using the key ${K} of\n * length ${Klen}, and write the result to ${digest}.\n */\nvoid HMAC_SHA256_Buf(const void *, size_t, const void *, size_t, uint8_t[32]);\n\n/**\n * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen):\n * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and\n * write the output to buf.  The value dkLen must be at most 32 * (2^32 - 1).\n */\nvoid PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t,\n    uint64_t, uint8_t *, size_t);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !_SHA256_H_ */\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/sysendian.h",
    "content": "/*-\n * Copyright 2007-2014 Colin Percival\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#ifndef _SYSENDIAN_H_\n#define _SYSENDIAN_H_\n\n#include <stdint.h>\n\n/* Avoid namespace collisions with BSD <sys/endian.h>. */\n#define be32dec libcperciva_be32dec\n#define be32enc libcperciva_be32enc\n#define be64enc libcperciva_be64enc\n#define le32dec libcperciva_le32dec\n#define le32enc libcperciva_le32enc\n\nstatic inline uint32_t\nbe32dec(const void * pp)\n{\n\tconst uint8_t * p = (uint8_t const *)pp;\n\n\treturn ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) +\n\t    ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24));\n}\n\nstatic inline void\nbe32enc(void * pp, uint32_t x)\n{\n\tuint8_t * p = (uint8_t *)pp;\n\n\tp[3] = x & 0xff;\n\tp[2] = (x >> 8) & 0xff;\n\tp[1] = (x >> 16) & 0xff;\n\tp[0] = (x >> 24) & 0xff;\n}\n\nstatic inline void\nbe64enc(void * pp, uint64_t x)\n{\n\tuint8_t * p = (uint8_t *)pp;\n\n\tp[7] = x & 0xff;\n\tp[6] = (x >> 8) & 0xff;\n\tp[5] = (x >> 16) & 0xff;\n\tp[4] = (x >> 24) & 0xff;\n\tp[3] = (x >> 32) & 0xff;\n\tp[2] = (x >> 40) & 0xff;\n\tp[1] = (x >> 48) & 0xff;\n\tp[0] = (x >> 56) & 0xff;\n}\n\nstatic inline uint32_t\nle32dec(const void * pp)\n{\n\tconst uint8_t * p = (uint8_t const *)pp;\n\n\treturn ((uint32_t)(p[0]) + ((uint32_t)(p[1]) << 8) +\n\t    ((uint32_t)(p[2]) << 16) + ((uint32_t)(p[3]) << 24));\n}\n\nstatic inline void\nle32enc(void * pp, uint32_t x)\n{\n\tuint8_t * p = (uint8_t *)pp;\n\n\tp[0] = x & 0xff;\n\tp[1] = (x >> 8) & 0xff;\n\tp[2] = (x >> 16) & 0xff;\n\tp[3] = (x >> 24) & 0xff;\n}\n\n#endif /* !_SYSENDIAN_H_ */\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/tests.c",
    "content": "/*-\n * Copyright 2013-2018 Alexander Peslyak\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"yespower.h\"\n\n#undef TEST_PBKDF2_SHA256\n\n#ifdef TEST_PBKDF2_SHA256\n#include <assert.h>\n\n#include \"sha256.h\"\n\nstatic void print_PBKDF2_SHA256_raw(const char *passwd, size_t passwdlen,\n    const char *salt, size_t saltlen, uint64_t c, size_t dkLen)\n{\n\tuint8_t dk[64];\n\tsize_t i;\n\n\tassert(dkLen <= sizeof(dk));\n\n\t/* XXX This prints the strings truncated at first NUL */\n\tprintf(\"PBKDF2_SHA256(\\\"%s\\\", \\\"%s\\\", %llu, %llu) = \",\n\t    passwd, salt, (unsigned long long)c, (unsigned long long)dkLen);\n\n\tPBKDF2_SHA256((const uint8_t *) passwd, passwdlen,\n\t    (const uint8_t *) salt, saltlen, c, dk, dkLen);\n\n\tfor (i = 0; i < dkLen; i++)\n\t\tprintf(\"%02x%c\", dk[i], i < dkLen - 1 ? ' ' : '\\n');\n}\n\nstatic void print_PBKDF2_SHA256(const char *passwd,\n    const char *salt, uint64_t c, size_t dkLen)\n{\n\tprint_PBKDF2_SHA256_raw(passwd, strlen(passwd), salt, strlen(salt), c,\n\t    dkLen);\n}\n#endif\n\nstatic const char *pers_bsty_magic = \"BSTY\";\n\nstatic void print_yespower(yespower_version_t version, uint32_t N, uint32_t r,\n    const char *pers)\n{\n\tyespower_params_t params = {\n\t\t.version = version,\n\t\t.N = N,\n\t\t.r = r,\n\t\t.pers = (const uint8_t *)pers,\n\t\t.perslen = pers ? strlen(pers) : 0\n\t};\n\tuint8_t src[80];\n\tyespower_binary_t dst;\n\tsize_t i;\n\n\tconst char *q = (pers && pers != pers_bsty_magic) ? \"\\\"\": \"\";\n\tprintf(\"yespower(%u, %u, %u, %s%s%s) = \", (unsigned int)version, N, r,\n\t    q, pers ? pers : \"NULL\", q);\n\n\tfor (i = 0; i < sizeof(src); i++)\n\t\tsrc[i] = i * 3;\n\n\tif (pers == pers_bsty_magic) {\n\t\tparams.pers = src;\n\t\tparams.perslen = sizeof(src);\n\t}\n\n\tif (yespower_tls(src, sizeof(src), &params, &dst)) {\n\t\tputs(\"FAILED\");\n\t\treturn;\n\t}\n\n\tfor (i = 0; i < sizeof(dst); i++)\n\t\tprintf(\"%02x%c\", dst.uc[i], i < sizeof(dst) - 1 ? ' ' : '\\n');\n}\n\nstatic void print_yespower_loop(yespower_version_t version, const char *pers)\n{\n\tuint32_t N, r;\n\tuint8_t src[80];\n\tyespower_binary_t dst, xor = {{0}};\n\tsize_t i;\n\n\tprintf(\"XOR of yespower(%u, ...) = \", (unsigned int)version);\n\n\t/*\n\t * This value of src is chosen to trigger duplicate index in the last\n\t * SMix2 invocation in yespower 0.5 for N=2048 with at least one of the\n\t * values of r below.  This is needed to test that a non-save version\n\t * of BlockMix is used in that special case.  Most other values of src\n\t * would leave this untested.\n\t */\n\tsrc[0] = 43;\n\tfor (i = 1; i < sizeof(src); i++)\n\t\tsrc[i] = i * 3;\n\n\tfor (N = 1024; N <= 4096; N <<= 1) {\n\t\tfor (r = 8; r <= 32; r++) {\n\t\t\tyespower_params_t params = {\n\t\t\t\t.version = version,\n\t\t\t\t.N = N,\n\t\t\t\t.r = r,\n\t\t\t\t.pers = (const uint8_t *)pers,\n\t\t\t\t.perslen = pers ? strlen(pers) : 0\n\t\t\t};\n\t\t\tif (yespower_tls(src, sizeof(src), &params, &dst)) {\n\t\t\t\tputs(\"FAILED\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (i = 0; i < sizeof(xor); i++)\n\t\t\t\txor.uc[i] ^= dst.uc[i];\n\t\t}\n\t}\n\n\tfor (i = 0; i < sizeof(xor); i++)\n\t\tprintf(\"%02x%c\", xor.uc[i], i < sizeof(xor) - 1 ? ' ' : '\\n');\n}\n\nint main(void)\n{\n\tsetvbuf(stdout, NULL, _IOLBF, 0);\n\n#ifdef TEST_PBKDF2_SHA256\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 1, 20);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 2, 20);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 4096, 20);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 16777216, 20);\n\tprint_PBKDF2_SHA256(\"passwordPASSWORDpassword\",\n\t    \"saltSALTsaltSALTsaltSALTsaltSALTsalt\", 4096, 25);\n\tprint_PBKDF2_SHA256_raw(\"pass\\0word\", 9, \"sa\\0lt\", 5, 4096, 16);\n#if 0\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 1, 32);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 2, 32);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 4096, 32);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 16777216, 32);\n\tprint_PBKDF2_SHA256(\"passwordPASSWORDpassword\",\n\t    \"saltSALTsaltSALTsaltSALTsaltSALTsalt\", 4096, 40);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 4096, 16);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 1, 20);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 2, 20);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 4096, 20);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 16777216, 20);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 4096, 25);\n\tprint_PBKDF2_SHA256(\"password\", \"salt\", 4096, 16);\n#endif\n#endif\n\n\tprint_yespower(YESPOWER_0_5, 2048, 8, \"Client Key\"); /* yescrypt 0.5 */\n\tprint_yespower(YESPOWER_0_5, 2048, 8, pers_bsty_magic); /* BSTY */\n\tprint_yespower(YESPOWER_0_5, 4096, 16, \"Client Key\"); /* Cryply */\n\tprint_yespower(YESPOWER_0_5, 4096, 24, \"Jagaricoin\");\n\tprint_yespower(YESPOWER_0_5, 4096, 32, \"WaviBanana\");\n\tprint_yespower(YESPOWER_0_5, 2048, 32, \"Client Key\");\n\tprint_yespower(YESPOWER_0_5, 1024, 32, \"Client Key\");\n\n\tprint_yespower(YESPOWER_0_5, 2048, 8, NULL); /* no personality */\n\n\tprint_yespower(YESPOWER_1_0, 2048, 8, NULL);\n\tprint_yespower(YESPOWER_1_0, 4096, 16, NULL);\n\tprint_yespower(YESPOWER_1_0, 4096, 32, NULL);\n\tprint_yespower(YESPOWER_1_0, 2048, 32, NULL);\n\tprint_yespower(YESPOWER_1_0, 1024, 32, NULL);\n\n\tprint_yespower(YESPOWER_1_0, 1024, 32, \"personality test\");\n\n\tprint_yespower_loop(YESPOWER_0_5, \"Client Key\");\n\tprint_yespower_loop(YESPOWER_1_0, NULL);\n\n\treturn 0;\n}\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/yespower-opt.c",
    "content": "/*-\n * Copyright 2009 Colin Percival\n * Copyright 2012-2019 Alexander Peslyak\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * This file was originally written by Colin Percival as part of the Tarsnap\n * online backup system.\n *\n * This is a proof-of-work focused fork of yescrypt, including optimized and\n * cut-down implementation of the obsolete yescrypt 0.5 (based off its first\n * submission to PHC back in 2014) and a new proof-of-work specific variation\n * known as yespower 1.0.  The former is intended as an upgrade for\n * cryptocurrencies that already use yescrypt 0.5 and the latter may be used\n * as a further upgrade (hard fork) by those and other cryptocurrencies.  The\n * version of algorithm to use is requested through parameters, allowing for\n * both algorithms to co-exist in client and miner implementations (such as in\n * preparation for a hard-fork).\n */\n\n#ifndef _YESPOWER_OPT_C_PASS_\n#define _YESPOWER_OPT_C_PASS_ 1\n#endif\n\n#if _YESPOWER_OPT_C_PASS_ == 1\n/*\n * AVX and especially XOP speed up Salsa20 a lot, but needlessly result in\n * extra instruction prefixes for pwxform (which we make more use of).  While\n * no slowdown from the prefixes is generally observed on AMD CPUs supporting\n * XOP, some slowdown is sometimes observed on Intel CPUs with AVX.\n */\n#ifdef __XOP__\n#warning \"Note: XOP is enabled.  That's great.\"\n#elif defined(__AVX__)\n#warning \"Note: AVX is enabled.  That's OK.\"\n#elif defined(__SSE2__)\n#warning \"Note: AVX and XOP are not enabled.  That's OK.\"\n#elif defined(__x86_64__) || defined(__i386__)\n#warning \"SSE2 not enabled.  Expect poor performance.\"\n#else\n#warning \"Note: building generic code for non-x86.  That's OK.\"\n#endif\n\n/*\n * The SSE4 code version has fewer instructions than the generic SSE2 version,\n * but all of the instructions are SIMD, thereby wasting the scalar execution\n * units.  Thus, the generic SSE2 version below actually runs faster on some\n * CPUs due to its balanced mix of SIMD and scalar instructions.\n */\n#undef USE_SSE4_FOR_32BIT\n\n#ifdef __SSE2__\n/*\n * GCC before 4.9 would by default unnecessarily use store/load (without\n * SSE4.1) or (V)PEXTR (with SSE4.1 or AVX) instead of simply (V)MOV.\n * This was tracked as GCC bug 54349.\n * \"-mtune=corei7\" works around this, but is only supported for GCC 4.6+.\n * We use inline asm for pre-4.6 GCC, further down this file.\n */\n#if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && __GNUC_MINOR__ < 9 && \\\n    !defined(__clang__) && !defined(__ICC)\n#pragma GCC target (\"tune=corei7\")\n#endif\n#include <emmintrin.h>\n#ifdef __XOP__\n#include <x86intrin.h>\n#endif\n#elif defined(__SSE__)\n#include <xmmintrin.h>\n#endif\n\n#include <errno.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"insecure_memzero.h\"\n#include \"sha256.h\"\n#include \"sysendian.h\"\n\n#include \"yespower.h\"\n\n#include \"yespower-platform.c\"\n\n#if __STDC_VERSION__ >= 199901L\n/* Have restrict */\n#elif defined(__GNUC__)\n#define restrict __restrict\n#else\n#define restrict\n#endif\n\n#ifdef __GNUC__\n#define unlikely(exp) __builtin_expect(exp, 0)\n#else\n#define unlikely(exp) (exp)\n#endif\n\n#ifdef __SSE__\n#define PREFETCH(x, hint) _mm_prefetch((const char *)(x), (hint));\n#else\n#undef PREFETCH\n#endif\n\ntypedef union {\n\tuint32_t w[16];\n\tuint64_t d[8];\n#ifdef __SSE2__\n\t__m128i q[4];\n#endif\n} salsa20_blk_t;\n\nstatic inline void salsa20_simd_shuffle(const salsa20_blk_t *Bin,\n    salsa20_blk_t *Bout)\n{\n#define COMBINE(out, in1, in2) \\\n\tBout->d[out] = Bin->w[in1 * 2] | ((uint64_t)Bin->w[in2 * 2 + 1] << 32);\n\tCOMBINE(0, 0, 2)\n\tCOMBINE(1, 5, 7)\n\tCOMBINE(2, 2, 4)\n\tCOMBINE(3, 7, 1)\n\tCOMBINE(4, 4, 6)\n\tCOMBINE(5, 1, 3)\n\tCOMBINE(6, 6, 0)\n\tCOMBINE(7, 3, 5)\n#undef COMBINE\n}\n\nstatic inline void salsa20_simd_unshuffle(const salsa20_blk_t *Bin,\n    salsa20_blk_t *Bout)\n{\n#define UNCOMBINE(out, in1, in2) \\\n\tBout->w[out * 2] = Bin->d[in1]; \\\n\tBout->w[out * 2 + 1] = Bin->d[in2] >> 32;\n\tUNCOMBINE(0, 0, 6)\n\tUNCOMBINE(1, 5, 3)\n\tUNCOMBINE(2, 2, 0)\n\tUNCOMBINE(3, 7, 5)\n\tUNCOMBINE(4, 4, 2)\n\tUNCOMBINE(5, 1, 7)\n\tUNCOMBINE(6, 6, 4)\n\tUNCOMBINE(7, 3, 1)\n#undef UNCOMBINE\n}\n\n#ifdef __SSE2__\n#define DECL_X \\\n\t__m128i X0, X1, X2, X3;\n#define DECL_Y \\\n\t__m128i Y0, Y1, Y2, Y3;\n#define READ_X(in) \\\n\tX0 = (in).q[0]; X1 = (in).q[1]; X2 = (in).q[2]; X3 = (in).q[3];\n#define WRITE_X(out) \\\n\t(out).q[0] = X0; (out).q[1] = X1; (out).q[2] = X2; (out).q[3] = X3;\n\n#ifdef __XOP__\n#define ARX(out, in1, in2, s) \\\n\tout = _mm_xor_si128(out, _mm_roti_epi32(_mm_add_epi32(in1, in2), s));\n#else\n#define ARX(out, in1, in2, s) { \\\n\t__m128i tmp = _mm_add_epi32(in1, in2); \\\n\tout = _mm_xor_si128(out, _mm_slli_epi32(tmp, s)); \\\n\tout = _mm_xor_si128(out, _mm_srli_epi32(tmp, 32 - s)); \\\n}\n#endif\n\n#define SALSA20_2ROUNDS \\\n\t/* Operate on \"columns\" */ \\\n\tARX(X1, X0, X3, 7) \\\n\tARX(X2, X1, X0, 9) \\\n\tARX(X3, X2, X1, 13) \\\n\tARX(X0, X3, X2, 18) \\\n\t/* Rearrange data */ \\\n\tX1 = _mm_shuffle_epi32(X1, 0x93); \\\n\tX2 = _mm_shuffle_epi32(X2, 0x4E); \\\n\tX3 = _mm_shuffle_epi32(X3, 0x39); \\\n\t/* Operate on \"rows\" */ \\\n\tARX(X3, X0, X1, 7) \\\n\tARX(X2, X3, X0, 9) \\\n\tARX(X1, X2, X3, 13) \\\n\tARX(X0, X1, X2, 18) \\\n\t/* Rearrange data */ \\\n\tX1 = _mm_shuffle_epi32(X1, 0x39); \\\n\tX2 = _mm_shuffle_epi32(X2, 0x4E); \\\n\tX3 = _mm_shuffle_epi32(X3, 0x93);\n\n/**\n * Apply the Salsa20 core to the block provided in (X0 ... X3).\n */\n#define SALSA20_wrapper(out, rounds) { \\\n\t__m128i Z0 = X0, Z1 = X1, Z2 = X2, Z3 = X3; \\\n\trounds \\\n\t(out).q[0] = X0 = _mm_add_epi32(X0, Z0); \\\n\t(out).q[1] = X1 = _mm_add_epi32(X1, Z1); \\\n\t(out).q[2] = X2 = _mm_add_epi32(X2, Z2); \\\n\t(out).q[3] = X3 = _mm_add_epi32(X3, Z3); \\\n}\n\n/**\n * Apply the Salsa20/2 core to the block provided in X.\n */\n#define SALSA20_2(out) \\\n\tSALSA20_wrapper(out, SALSA20_2ROUNDS)\n\n#define SALSA20_8ROUNDS \\\n\tSALSA20_2ROUNDS SALSA20_2ROUNDS SALSA20_2ROUNDS SALSA20_2ROUNDS\n\n/**\n * Apply the Salsa20/8 core to the block provided in X.\n */\n#define SALSA20_8(out) \\\n\tSALSA20_wrapper(out, SALSA20_8ROUNDS)\n\n#define XOR_X(in) \\\n\tX0 = _mm_xor_si128(X0, (in).q[0]); \\\n\tX1 = _mm_xor_si128(X1, (in).q[1]); \\\n\tX2 = _mm_xor_si128(X2, (in).q[2]); \\\n\tX3 = _mm_xor_si128(X3, (in).q[3]);\n\n#define XOR_X_2(in1, in2) \\\n\tX0 = _mm_xor_si128((in1).q[0], (in2).q[0]); \\\n\tX1 = _mm_xor_si128((in1).q[1], (in2).q[1]); \\\n\tX2 = _mm_xor_si128((in1).q[2], (in2).q[2]); \\\n\tX3 = _mm_xor_si128((in1).q[3], (in2).q[3]);\n\n#define XOR_X_WRITE_XOR_Y_2(out, in) \\\n\t(out).q[0] = Y0 = _mm_xor_si128((out).q[0], (in).q[0]); \\\n\t(out).q[1] = Y1 = _mm_xor_si128((out).q[1], (in).q[1]); \\\n\t(out).q[2] = Y2 = _mm_xor_si128((out).q[2], (in).q[2]); \\\n\t(out).q[3] = Y3 = _mm_xor_si128((out).q[3], (in).q[3]); \\\n\tX0 = _mm_xor_si128(X0, Y0); \\\n\tX1 = _mm_xor_si128(X1, Y1); \\\n\tX2 = _mm_xor_si128(X2, Y2); \\\n\tX3 = _mm_xor_si128(X3, Y3);\n\n#define INTEGERIFY _mm_cvtsi128_si32(X0)\n\n#else /* !defined(__SSE2__) */\n\n#define DECL_X \\\n\tsalsa20_blk_t X;\n#define DECL_Y \\\n\tsalsa20_blk_t Y;\n\n#define COPY(out, in) \\\n\t(out).d[0] = (in).d[0]; \\\n\t(out).d[1] = (in).d[1]; \\\n\t(out).d[2] = (in).d[2]; \\\n\t(out).d[3] = (in).d[3]; \\\n\t(out).d[4] = (in).d[4]; \\\n\t(out).d[5] = (in).d[5]; \\\n\t(out).d[6] = (in).d[6]; \\\n\t(out).d[7] = (in).d[7];\n\n#define READ_X(in) COPY(X, in)\n#define WRITE_X(out) COPY(out, X)\n\n/**\n * salsa20(B):\n * Apply the Salsa20 core to the provided block.\n */\nstatic inline void salsa20(salsa20_blk_t *restrict B,\n    salsa20_blk_t *restrict Bout, uint32_t doublerounds)\n{\n\tsalsa20_blk_t X;\n#define x X.w\n\n\tsalsa20_simd_unshuffle(B, &X);\n\n\tdo {\n#define R(a,b) (((a) << (b)) | ((a) >> (32 - (b))))\n\t\t/* Operate on columns */\n\t\tx[ 4] ^= R(x[ 0]+x[12], 7);  x[ 8] ^= R(x[ 4]+x[ 0], 9);\n\t\tx[12] ^= R(x[ 8]+x[ 4],13);  x[ 0] ^= R(x[12]+x[ 8],18);\n\n\t\tx[ 9] ^= R(x[ 5]+x[ 1], 7);  x[13] ^= R(x[ 9]+x[ 5], 9);\n\t\tx[ 1] ^= R(x[13]+x[ 9],13);  x[ 5] ^= R(x[ 1]+x[13],18);\n\n\t\tx[14] ^= R(x[10]+x[ 6], 7);  x[ 2] ^= R(x[14]+x[10], 9);\n\t\tx[ 6] ^= R(x[ 2]+x[14],13);  x[10] ^= R(x[ 6]+x[ 2],18);\n\n\t\tx[ 3] ^= R(x[15]+x[11], 7);  x[ 7] ^= R(x[ 3]+x[15], 9);\n\t\tx[11] ^= R(x[ 7]+x[ 3],13);  x[15] ^= R(x[11]+x[ 7],18);\n\n\t\t/* Operate on rows */\n\t\tx[ 1] ^= R(x[ 0]+x[ 3], 7);  x[ 2] ^= R(x[ 1]+x[ 0], 9);\n\t\tx[ 3] ^= R(x[ 2]+x[ 1],13);  x[ 0] ^= R(x[ 3]+x[ 2],18);\n\n\t\tx[ 6] ^= R(x[ 5]+x[ 4], 7);  x[ 7] ^= R(x[ 6]+x[ 5], 9);\n\t\tx[ 4] ^= R(x[ 7]+x[ 6],13);  x[ 5] ^= R(x[ 4]+x[ 7],18);\n\n\t\tx[11] ^= R(x[10]+x[ 9], 7);  x[ 8] ^= R(x[11]+x[10], 9);\n\t\tx[ 9] ^= R(x[ 8]+x[11],13);  x[10] ^= R(x[ 9]+x[ 8],18);\n\n\t\tx[12] ^= R(x[15]+x[14], 7);  x[13] ^= R(x[12]+x[15], 9);\n\t\tx[14] ^= R(x[13]+x[12],13);  x[15] ^= R(x[14]+x[13],18);\n#undef R\n\t} while (--doublerounds);\n#undef x\n\n\t{\n\t\tuint32_t i;\n\t\tsalsa20_simd_shuffle(&X, Bout);\n\t\tfor (i = 0; i < 16; i += 4) {\n\t\t\tB->w[i] = Bout->w[i] += B->w[i];\n\t\t\tB->w[i + 1] = Bout->w[i + 1] += B->w[i + 1];\n\t\t\tB->w[i + 2] = Bout->w[i + 2] += B->w[i + 2];\n\t\t\tB->w[i + 3] = Bout->w[i + 3] += B->w[i + 3];\n\t\t}\n\t}\n}\n\n/**\n * Apply the Salsa20/2 core to the block provided in X.\n */\n#define SALSA20_2(out) \\\n\tsalsa20(&X, &out, 1);\n\n/**\n * Apply the Salsa20/8 core to the block provided in X.\n */\n#define SALSA20_8(out) \\\n\tsalsa20(&X, &out, 4);\n\n#define XOR(out, in1, in2) \\\n\t(out).d[0] = (in1).d[0] ^ (in2).d[0]; \\\n\t(out).d[1] = (in1).d[1] ^ (in2).d[1]; \\\n\t(out).d[2] = (in1).d[2] ^ (in2).d[2]; \\\n\t(out).d[3] = (in1).d[3] ^ (in2).d[3]; \\\n\t(out).d[4] = (in1).d[4] ^ (in2).d[4]; \\\n\t(out).d[5] = (in1).d[5] ^ (in2).d[5]; \\\n\t(out).d[6] = (in1).d[6] ^ (in2).d[6]; \\\n\t(out).d[7] = (in1).d[7] ^ (in2).d[7];\n\n#define XOR_X(in) XOR(X, X, in)\n#define XOR_X_2(in1, in2) XOR(X, in1, in2)\n#define XOR_X_WRITE_XOR_Y_2(out, in) \\\n\tXOR(Y, out, in) \\\n\tCOPY(out, Y) \\\n\tXOR(X, X, Y)\n\n#define INTEGERIFY (uint32_t)X.d[0]\n#endif\n\n/**\n * Apply the Salsa20 core to the block provided in X ^ in.\n */\n#define SALSA20_XOR_MEM(in, out) \\\n\tXOR_X(in) \\\n\tSALSA20(out)\n\n#define SALSA20 SALSA20_8\n#else /* pass 2 */\n#undef SALSA20\n#define SALSA20 SALSA20_2\n#endif\n\n/**\n * blockmix_salsa(Bin, Bout):\n * Compute Bout = BlockMix_{salsa20, 1}(Bin).  The input Bin must be 128\n * bytes in length; the output Bout must also be the same size.\n */\nstatic inline void blockmix_salsa(const salsa20_blk_t *restrict Bin,\n    salsa20_blk_t *restrict Bout)\n{\n\tDECL_X\n\n\tREAD_X(Bin[1])\n\tSALSA20_XOR_MEM(Bin[0], Bout[0])\n\tSALSA20_XOR_MEM(Bin[1], Bout[1])\n}\n\nstatic inline uint32_t blockmix_salsa_xor(const salsa20_blk_t *restrict Bin1,\n    const salsa20_blk_t *restrict Bin2, salsa20_blk_t *restrict Bout)\n{\n\tDECL_X\n\n\tXOR_X_2(Bin1[1], Bin2[1])\n\tXOR_X(Bin1[0])\n\tSALSA20_XOR_MEM(Bin2[0], Bout[0])\n\tXOR_X(Bin1[1])\n\tSALSA20_XOR_MEM(Bin2[1], Bout[1])\n\n\treturn INTEGERIFY;\n}\n\n#if _YESPOWER_OPT_C_PASS_ == 1\n/* This is tunable, but it is part of what defines a yespower version */\n/* Version 0.5 */\n#define Swidth_0_5 8\n/* Version 1.0 */\n#define Swidth_1_0 11\n\n/* Not tunable in this implementation, hard-coded in a few places */\n#define PWXsimple 2\n#define PWXgather 4\n\n/* Derived value.  Not tunable on its own. */\n#define PWXbytes (PWXgather * PWXsimple * 8)\n\n/* (Maybe-)runtime derived values.  Not tunable on their own. */\n#define Swidth_to_Sbytes1(Swidth) ((1 << (Swidth)) * PWXsimple * 8)\n#define Swidth_to_Smask(Swidth) (((1 << (Swidth)) - 1) * PWXsimple * 8)\n#define Smask_to_Smask2(Smask) (((uint64_t)(Smask) << 32) | (Smask))\n\n/* These should be compile-time derived */\n#define Smask2_0_5 Smask_to_Smask2(Swidth_to_Smask(Swidth_0_5))\n#define Smask2_1_0 Smask_to_Smask2(Swidth_to_Smask(Swidth_1_0))\n\ntypedef struct {\n\tuint8_t *S0, *S1, *S2;\n\tsize_t w;\n\tuint32_t Sbytes;\n} pwxform_ctx_t;\n\n#define DECL_SMASK2REG /* empty */\n#define MAYBE_MEMORY_BARRIER /* empty */\n\n#ifdef __SSE2__\n/*\n * (V)PSRLDQ and (V)PSHUFD have higher throughput than (V)PSRLQ on some CPUs\n * starting with Sandy Bridge.  Additionally, PSHUFD uses separate source and\n * destination registers, whereas the shifts would require an extra move\n * instruction for our code when building without AVX.  Unfortunately, PSHUFD\n * is much slower on Conroe (4 cycles latency vs. 1 cycle latency for PSRLQ)\n * and somewhat slower on some non-Intel CPUs (luckily not including AMD\n * Bulldozer and Piledriver).\n */\n#ifdef __AVX__\n#define HI32(X) \\\n\t_mm_srli_si128((X), 4)\n#elif 1 /* As an option, check for __SSE4_1__ here not to hurt Conroe */\n#define HI32(X) \\\n\t_mm_shuffle_epi32((X), _MM_SHUFFLE(2,3,0,1))\n#else\n#define HI32(X) \\\n\t_mm_srli_epi64((X), 32)\n#endif\n\n#if defined(__x86_64__) && \\\n    __GNUC__ == 4 && __GNUC_MINOR__ < 6 && !defined(__ICC)\n#ifdef __AVX__\n#define MOVQ \"vmovq\"\n#else\n/* \"movq\" would be more correct, but \"movd\" is supported by older binutils\n * due to an error in AMD's spec for x86-64. */\n#define MOVQ \"movd\"\n#endif\n#define EXTRACT64(X) ({ \\\n\tuint64_t result; \\\n\t__asm__(MOVQ \" %1, %0\" : \"=r\" (result) : \"x\" (X)); \\\n\tresult; \\\n})\n#elif defined(__x86_64__) && !defined(_MSC_VER) && !defined(__OPEN64__)\n/* MSVC and Open64 had bugs */\n#define EXTRACT64(X) _mm_cvtsi128_si64(X)\n#elif defined(__x86_64__) && defined(__SSE4_1__)\n/* No known bugs for this intrinsic */\n#include <smmintrin.h>\n#define EXTRACT64(X) _mm_extract_epi64((X), 0)\n#elif defined(USE_SSE4_FOR_32BIT) && defined(__SSE4_1__)\n/* 32-bit */\n#include <smmintrin.h>\n#if 0\n/* This is currently unused by the code below, which instead uses these two\n * intrinsics explicitly when (!defined(__x86_64__) && defined(__SSE4_1__)) */\n#define EXTRACT64(X) \\\n\t((uint64_t)(uint32_t)_mm_cvtsi128_si32(X) | \\\n\t((uint64_t)(uint32_t)_mm_extract_epi32((X), 1) << 32))\n#endif\n#else\n/* 32-bit or compilers with known past bugs in _mm_cvtsi128_si64() */\n#define EXTRACT64(X) \\\n\t((uint64_t)(uint32_t)_mm_cvtsi128_si32(X) | \\\n\t((uint64_t)(uint32_t)_mm_cvtsi128_si32(HI32(X)) << 32))\n#endif\n\n#if defined(__x86_64__) && (defined(__AVX__) || !defined(__GNUC__))\n/* 64-bit with AVX */\n/* Force use of 64-bit AND instead of two 32-bit ANDs */\n#undef DECL_SMASK2REG\n#if defined(__GNUC__) && !defined(__ICC)\n#define DECL_SMASK2REG uint64_t Smask2reg = Smask2;\n/* Force use of lower-numbered registers to reduce number of prefixes, relying\n * on out-of-order execution and register renaming. */\n#define FORCE_REGALLOC_1 \\\n\t__asm__(\"\" : \"=a\" (x), \"+d\" (Smask2reg), \"+S\" (S0), \"+D\" (S1));\n#define FORCE_REGALLOC_2 \\\n\t__asm__(\"\" : : \"c\" (lo));\n#else\nstatic volatile uint64_t Smask2var = Smask2;\n#define DECL_SMASK2REG uint64_t Smask2reg = Smask2var;\n#define FORCE_REGALLOC_1 /* empty */\n#define FORCE_REGALLOC_2 /* empty */\n#endif\n#define PWXFORM_SIMD(X) { \\\n\tuint64_t x; \\\n\tFORCE_REGALLOC_1 \\\n\tuint32_t lo = x = EXTRACT64(X) & Smask2reg; \\\n\tFORCE_REGALLOC_2 \\\n\tuint32_t hi = x >> 32; \\\n\tX = _mm_mul_epu32(HI32(X), X); \\\n\tX = _mm_add_epi64(X, *(__m128i *)(S0 + lo)); \\\n\tX = _mm_xor_si128(X, *(__m128i *)(S1 + hi)); \\\n}\n#elif defined(__x86_64__)\n/* 64-bit without AVX.  This relies on out-of-order execution and register\n * renaming.  It may actually be fastest on CPUs with AVX(2) as well - e.g.,\n * it runs great on Haswell. */\n#warning \"Note: using x86-64 inline assembly for pwxform.  That's great.\"\n#undef MAYBE_MEMORY_BARRIER\n#define MAYBE_MEMORY_BARRIER \\\n\t__asm__(\"\" : : : \"memory\");\n#ifdef __ILP32__ /* x32 */\n#define REGISTER_PREFIX \"e\"\n#else\n#define REGISTER_PREFIX \"r\"\n#endif\n#define PWXFORM_SIMD(X) { \\\n\t__m128i H; \\\n\t__asm__( \\\n\t    \"movd %0, %%rax\\n\\t\" \\\n\t    \"pshufd $0xb1, %0, %1\\n\\t\" \\\n\t    \"andq %2, %%rax\\n\\t\" \\\n\t    \"pmuludq %1, %0\\n\\t\" \\\n\t    \"movl %%eax, %%ecx\\n\\t\" \\\n\t    \"shrq $0x20, %%rax\\n\\t\" \\\n\t    \"paddq (%3,%%\" REGISTER_PREFIX \"cx), %0\\n\\t\" \\\n\t    \"pxor (%4,%%\" REGISTER_PREFIX \"ax), %0\\n\\t\" \\\n\t    : \"+x\" (X), \"=x\" (H) \\\n\t    : \"d\" (Smask2), \"S\" (S0), \"D\" (S1) \\\n\t    : \"cc\", \"ax\", \"cx\"); \\\n}\n#elif defined(USE_SSE4_FOR_32BIT) && defined(__SSE4_1__)\n/* 32-bit with SSE4.1 */\n#define PWXFORM_SIMD(X) { \\\n\t__m128i x = _mm_and_si128(X, _mm_set1_epi64x(Smask2)); \\\n\t__m128i s0 = *(__m128i *)(S0 + (uint32_t)_mm_cvtsi128_si32(x)); \\\n\t__m128i s1 = *(__m128i *)(S1 + (uint32_t)_mm_extract_epi32(x, 1)); \\\n\tX = _mm_mul_epu32(HI32(X), X); \\\n\tX = _mm_add_epi64(X, s0); \\\n\tX = _mm_xor_si128(X, s1); \\\n}\n#else\n/* 32-bit without SSE4.1 */\n#define PWXFORM_SIMD(X) { \\\n\tuint64_t x = EXTRACT64(X) & Smask2; \\\n\t__m128i s0 = *(__m128i *)(S0 + (uint32_t)x); \\\n\t__m128i s1 = *(__m128i *)(S1 + (x >> 32)); \\\n\tX = _mm_mul_epu32(HI32(X), X); \\\n\tX = _mm_add_epi64(X, s0); \\\n\tX = _mm_xor_si128(X, s1); \\\n}\n#endif\n\n#define PWXFORM_SIMD_WRITE(X, Sw) \\\n\tPWXFORM_SIMD(X) \\\n\tMAYBE_MEMORY_BARRIER \\\n\t*(__m128i *)(Sw + w) = X; \\\n\tMAYBE_MEMORY_BARRIER\n\n#define PWXFORM_ROUND \\\n\tPWXFORM_SIMD(X0) \\\n\tPWXFORM_SIMD(X1) \\\n\tPWXFORM_SIMD(X2) \\\n\tPWXFORM_SIMD(X3)\n\n#define PWXFORM_ROUND_WRITE4 \\\n\tPWXFORM_SIMD_WRITE(X0, S0) \\\n\tPWXFORM_SIMD_WRITE(X1, S1) \\\n\tw += 16; \\\n\tPWXFORM_SIMD_WRITE(X2, S0) \\\n\tPWXFORM_SIMD_WRITE(X3, S1) \\\n\tw += 16;\n\n#define PWXFORM_ROUND_WRITE2 \\\n\tPWXFORM_SIMD_WRITE(X0, S0) \\\n\tPWXFORM_SIMD_WRITE(X1, S1) \\\n\tw += 16; \\\n\tPWXFORM_SIMD(X2) \\\n\tPWXFORM_SIMD(X3)\n\n#else /* !defined(__SSE2__) */\n\n#define PWXFORM_SIMD(x0, x1) { \\\n\tuint64_t x = x0 & Smask2; \\\n\tuint64_t *p0 = (uint64_t *)(S0 + (uint32_t)x); \\\n\tuint64_t *p1 = (uint64_t *)(S1 + (x >> 32)); \\\n\tx0 = ((x0 >> 32) * (uint32_t)x0 + p0[0]) ^ p1[0]; \\\n\tx1 = ((x1 >> 32) * (uint32_t)x1 + p0[1]) ^ p1[1]; \\\n}\n\n#define PWXFORM_SIMD_WRITE(x0, x1, Sw) \\\n\tPWXFORM_SIMD(x0, x1) \\\n\t((uint64_t *)(Sw + w))[0] = x0; \\\n\t((uint64_t *)(Sw + w))[1] = x1;\n\n#define PWXFORM_ROUND \\\n\tPWXFORM_SIMD(X.d[0], X.d[1]) \\\n\tPWXFORM_SIMD(X.d[2], X.d[3]) \\\n\tPWXFORM_SIMD(X.d[4], X.d[5]) \\\n\tPWXFORM_SIMD(X.d[6], X.d[7])\n\n#define PWXFORM_ROUND_WRITE4 \\\n\tPWXFORM_SIMD_WRITE(X.d[0], X.d[1], S0) \\\n\tPWXFORM_SIMD_WRITE(X.d[2], X.d[3], S1) \\\n\tw += 16; \\\n\tPWXFORM_SIMD_WRITE(X.d[4], X.d[5], S0) \\\n\tPWXFORM_SIMD_WRITE(X.d[6], X.d[7], S1) \\\n\tw += 16;\n\n#define PWXFORM_ROUND_WRITE2 \\\n\tPWXFORM_SIMD_WRITE(X.d[0], X.d[1], S0) \\\n\tPWXFORM_SIMD_WRITE(X.d[2], X.d[3], S1) \\\n\tw += 16; \\\n\tPWXFORM_SIMD(X.d[4], X.d[5]) \\\n\tPWXFORM_SIMD(X.d[6], X.d[7])\n#endif\n\n#define PWXFORM \\\n\tPWXFORM_ROUND PWXFORM_ROUND PWXFORM_ROUND \\\n\tPWXFORM_ROUND PWXFORM_ROUND PWXFORM_ROUND\n\n#define Smask2 Smask2_0_5\n\n#else /* pass 2 */\n\n#undef PWXFORM\n#define PWXFORM \\\n\tPWXFORM_ROUND_WRITE4 PWXFORM_ROUND_WRITE2 PWXFORM_ROUND_WRITE2 \\\n\tw &= Smask2; \\\n\t{ \\\n\t\tuint8_t *Stmp = S2; \\\n\t\tS2 = S1; \\\n\t\tS1 = S0; \\\n\t\tS0 = Stmp; \\\n\t}\n\n#undef Smask2\n#define Smask2 Smask2_1_0\n\n#endif\n\n/**\n * blockmix_pwxform(Bin, Bout, r, S):\n * Compute Bout = BlockMix_pwxform{salsa20, r, S}(Bin).  The input Bin must\n * be 128r bytes in length; the output Bout must also be the same size.\n */\nstatic void blockmix(const salsa20_blk_t *restrict Bin,\n    salsa20_blk_t *restrict Bout, size_t r, pwxform_ctx_t *restrict ctx)\n{\n\tif (unlikely(!ctx)) {\n\t\tblockmix_salsa(Bin, Bout);\n\t\treturn;\n\t}\n\n\tuint8_t *S0 = ctx->S0, *S1 = ctx->S1;\n#if _YESPOWER_OPT_C_PASS_ > 1\n\tuint8_t *S2 = ctx->S2;\n\tsize_t w = ctx->w;\n#endif\n\tsize_t i;\n\tDECL_X\n\n\t/* Convert count of 128-byte blocks to max index of 64-byte block */\n\tr = r * 2 - 1;\n\n\tREAD_X(Bin[r])\n\n\tDECL_SMASK2REG\n\n\ti = 0;\n\tdo {\n\t\tXOR_X(Bin[i])\n\t\tPWXFORM\n\t\tif (unlikely(i >= r))\n\t\t\tbreak;\n\t\tWRITE_X(Bout[i])\n\t\ti++;\n\t} while (1);\n\n#if _YESPOWER_OPT_C_PASS_ > 1\n\tctx->S0 = S0; ctx->S1 = S1; ctx->S2 = S2;\n\tctx->w = w;\n#endif\n\n\tSALSA20(Bout[i])\n}\n\nstatic uint32_t blockmix_xor(const salsa20_blk_t *restrict Bin1,\n    const salsa20_blk_t *restrict Bin2, salsa20_blk_t *restrict Bout,\n    size_t r, pwxform_ctx_t *restrict ctx)\n{\n\tif (unlikely(!ctx))\n\t\treturn blockmix_salsa_xor(Bin1, Bin2, Bout);\n\n\tuint8_t *S0 = ctx->S0, *S1 = ctx->S1;\n#if _YESPOWER_OPT_C_PASS_ > 1\n\tuint8_t *S2 = ctx->S2;\n\tsize_t w = ctx->w;\n#endif\n\tsize_t i;\n\tDECL_X\n\n\t/* Convert count of 128-byte blocks to max index of 64-byte block */\n\tr = r * 2 - 1;\n\n#ifdef PREFETCH\n\tPREFETCH(&Bin2[r], _MM_HINT_T0)\n\tfor (i = 0; i < r; i++) {\n\t\tPREFETCH(&Bin2[i], _MM_HINT_T0)\n\t}\n#endif\n\n\tXOR_X_2(Bin1[r], Bin2[r])\n\n\tDECL_SMASK2REG\n\n\ti = 0;\n\tr--;\n\tdo {\n\t\tXOR_X(Bin1[i])\n\t\tXOR_X(Bin2[i])\n\t\tPWXFORM\n\t\tWRITE_X(Bout[i])\n\n\t\tXOR_X(Bin1[i + 1])\n\t\tXOR_X(Bin2[i + 1])\n\t\tPWXFORM\n\n\t\tif (unlikely(i >= r))\n\t\t\tbreak;\n\n\t\tWRITE_X(Bout[i + 1])\n\n\t\ti += 2;\n\t} while (1);\n\ti++;\n\n#if _YESPOWER_OPT_C_PASS_ > 1\n\tctx->S0 = S0; ctx->S1 = S1; ctx->S2 = S2;\n\tctx->w = w;\n#endif\n\n\tSALSA20(Bout[i])\n\n\treturn INTEGERIFY;\n}\n\nstatic uint32_t blockmix_xor_save(salsa20_blk_t *restrict Bin1out,\n    salsa20_blk_t *restrict Bin2,\n    size_t r, pwxform_ctx_t *restrict ctx)\n{\n\tuint8_t *S0 = ctx->S0, *S1 = ctx->S1;\n#if _YESPOWER_OPT_C_PASS_ > 1\n\tuint8_t *S2 = ctx->S2;\n\tsize_t w = ctx->w;\n#endif\n\tsize_t i;\n\tDECL_X\n\tDECL_Y\n\n\t/* Convert count of 128-byte blocks to max index of 64-byte block */\n\tr = r * 2 - 1;\n\n#ifdef PREFETCH\n\tPREFETCH(&Bin2[r], _MM_HINT_T0)\n\tfor (i = 0; i < r; i++) {\n\t\tPREFETCH(&Bin2[i], _MM_HINT_T0)\n\t}\n#endif\n\n\tXOR_X_2(Bin1out[r], Bin2[r])\n\n\tDECL_SMASK2REG\n\n\ti = 0;\n\tr--;\n\tdo {\n\t\tXOR_X_WRITE_XOR_Y_2(Bin2[i], Bin1out[i])\n\t\tPWXFORM\n\t\tWRITE_X(Bin1out[i])\n\n\t\tXOR_X_WRITE_XOR_Y_2(Bin2[i + 1], Bin1out[i + 1])\n\t\tPWXFORM\n\n\t\tif (unlikely(i >= r))\n\t\t\tbreak;\n\n\t\tWRITE_X(Bin1out[i + 1])\n\n\t\ti += 2;\n\t} while (1);\n\ti++;\n\n#if _YESPOWER_OPT_C_PASS_ > 1\n\tctx->S0 = S0; ctx->S1 = S1; ctx->S2 = S2;\n\tctx->w = w;\n#endif\n\n\tSALSA20(Bin1out[i])\n\n\treturn INTEGERIFY;\n}\n\n#if _YESPOWER_OPT_C_PASS_ == 1\n/**\n * integerify(B, r):\n * Return the result of parsing B_{2r-1} as a little-endian integer.\n */\nstatic inline uint32_t integerify(const salsa20_blk_t *B, size_t r)\n{\n/*\n * Our 64-bit words are in host byte order, which is why we don't just read\n * w[0] here (would be wrong on big-endian).  Also, our 32-bit words are\n * SIMD-shuffled, but we only care about the least significant 32 bits anyway.\n */\n\treturn (uint32_t)B[2 * r - 1].d[0];\n}\n#endif\n\n/**\n * smix1(B, r, N, V, XY, S):\n * Compute first loop of B = SMix_r(B, N).  The input B must be 128r bytes in\n * length; the temporary storage V must be 128rN bytes in length; the temporary\n * storage XY must be 128r+64 bytes in length.  N must be even and at least 4.\n * The array V must be aligned to a multiple of 64 bytes, and arrays B and XY\n * to a multiple of at least 16 bytes.\n */\nstatic void smix1(uint8_t *B, size_t r, uint32_t N,\n    salsa20_blk_t *V, salsa20_blk_t *XY, pwxform_ctx_t *ctx)\n{\n\tsize_t s = 2 * r;\n\tsalsa20_blk_t *X = V, *Y = &V[s], *V_j;\n\tuint32_t i, j, n;\n\n#if _YESPOWER_OPT_C_PASS_ == 1\n\tfor (i = 0; i < 2 * r; i++) {\n#else\n\tfor (i = 0; i < 2; i++) {\n#endif\n\t\tconst salsa20_blk_t *src = (salsa20_blk_t *)&B[i * 64];\n\t\tsalsa20_blk_t *tmp = Y;\n\t\tsalsa20_blk_t *dst = &X[i];\n\t\tsize_t k;\n\t\tfor (k = 0; k < 16; k++)\n\t\t\ttmp->w[k] = le32dec(&src->w[k]);\n\t\tsalsa20_simd_shuffle(tmp, dst);\n\t}\n\n#if _YESPOWER_OPT_C_PASS_ > 1\n\tfor (i = 1; i < r; i++)\n\t\tblockmix(&X[(i - 1) * 2], &X[i * 2], 1, ctx);\n#endif\n\n\tblockmix(X, Y, r, ctx);\n\tX = Y + s;\n\tblockmix(Y, X, r, ctx);\n\tj = integerify(X, r);\n\n\tfor (n = 2; n < N; n <<= 1) {\n\t\tuint32_t m = (n < N / 2) ? n : (N - 1 - n);\n\t\tfor (i = 1; i < m; i += 2) {\n\t\t\tY = X + s;\n\t\t\tj &= n - 1;\n\t\t\tj += i - 1;\n\t\t\tV_j = &V[j * s];\n\t\t\tj = blockmix_xor(X, V_j, Y, r, ctx);\n\t\t\tj &= n - 1;\n\t\t\tj += i;\n\t\t\tV_j = &V[j * s];\n\t\t\tX = Y + s;\n\t\t\tj = blockmix_xor(Y, V_j, X, r, ctx);\n\t\t}\n\t}\n\tn >>= 1;\n\n\tj &= n - 1;\n\tj += N - 2 - n;\n\tV_j = &V[j * s];\n\tY = X + s;\n\tj = blockmix_xor(X, V_j, Y, r, ctx);\n\tj &= n - 1;\n\tj += N - 1 - n;\n\tV_j = &V[j * s];\n\tblockmix_xor(Y, V_j, XY, r, ctx);\n\n\tfor (i = 0; i < 2 * r; i++) {\n\t\tconst salsa20_blk_t *src = &XY[i];\n\t\tsalsa20_blk_t *tmp = &XY[s];\n\t\tsalsa20_blk_t *dst = (salsa20_blk_t *)&B[i * 64];\n\t\tsize_t k;\n\t\tfor (k = 0; k < 16; k++)\n\t\t\tle32enc(&tmp->w[k], src->w[k]);\n\t\tsalsa20_simd_unshuffle(tmp, dst);\n\t}\n}\n\n/**\n * smix2(B, r, N, Nloop, V, XY, S):\n * Compute second loop of B = SMix_r(B, N).  The input B must be 128r bytes in\n * length; the temporary storage V must be 128rN bytes in length; the temporary\n * storage XY must be 256r bytes in length.  N must be a power of 2 and at\n * least 2.  Nloop must be even.  The array V must be aligned to a multiple of\n * 64 bytes, and arrays B and XY to a multiple of at least 16 bytes.\n */\nstatic void smix2(uint8_t *B, size_t r, uint32_t N, uint32_t Nloop,\n    salsa20_blk_t *V, salsa20_blk_t *XY, pwxform_ctx_t *ctx)\n{\n\tsize_t s = 2 * r;\n\tsalsa20_blk_t *X = XY, *Y = &XY[s];\n\tuint32_t i, j;\n\n\tfor (i = 0; i < 2 * r; i++) {\n\t\tconst salsa20_blk_t *src = (salsa20_blk_t *)&B[i * 64];\n\t\tsalsa20_blk_t *tmp = Y;\n\t\tsalsa20_blk_t *dst = &X[i];\n\t\tsize_t k;\n\t\tfor (k = 0; k < 16; k++)\n\t\t\ttmp->w[k] = le32dec(&src->w[k]);\n\t\tsalsa20_simd_shuffle(tmp, dst);\n\t}\n\n\tj = integerify(X, r) & (N - 1);\n\n#if _YESPOWER_OPT_C_PASS_ == 1\n\tif (Nloop > 2) {\n#endif\n\t\tdo {\n\t\t\tsalsa20_blk_t *V_j = &V[j * s];\n\t\t\tj = blockmix_xor_save(X, V_j, r, ctx) & (N - 1);\n\t\t\tV_j = &V[j * s];\n\t\t\tj = blockmix_xor_save(X, V_j, r, ctx) & (N - 1);\n\t\t} while (Nloop -= 2);\n#if _YESPOWER_OPT_C_PASS_ == 1\n\t} else {\n\t\tconst salsa20_blk_t * V_j = &V[j * s];\n\t\tj = blockmix_xor(X, V_j, Y, r, ctx) & (N - 1);\n\t\tV_j = &V[j * s];\n\t\tblockmix_xor(Y, V_j, X, r, ctx);\n\t}\n#endif\n\n\tfor (i = 0; i < 2 * r; i++) {\n\t\tconst salsa20_blk_t *src = &X[i];\n\t\tsalsa20_blk_t *tmp = Y;\n\t\tsalsa20_blk_t *dst = (salsa20_blk_t *)&B[i * 64];\n\t\tsize_t k;\n\t\tfor (k = 0; k < 16; k++)\n\t\t\tle32enc(&tmp->w[k], src->w[k]);\n\t\tsalsa20_simd_unshuffle(tmp, dst);\n\t}\n}\n\n/**\n * smix(B, r, N, V, XY, S):\n * Compute B = SMix_r(B, N).  The input B must be 128rp bytes in length; the\n * temporary storage V must be 128rN bytes in length; the temporary storage\n * XY must be 256r bytes in length.  N must be a power of 2 and at least 16.\n * The array V must be aligned to a multiple of 64 bytes, and arrays B and XY\n * to a multiple of at least 16 bytes (aligning them to 64 bytes as well saves\n * cache lines, but it might also result in cache bank conflicts).\n */\nstatic void smix(uint8_t *B, size_t r, uint32_t N,\n    salsa20_blk_t *V, salsa20_blk_t *XY, pwxform_ctx_t *ctx)\n{\n#if _YESPOWER_OPT_C_PASS_ == 1\n\tuint32_t Nloop_all = (N + 2) / 3; /* 1/3, round up */\n\tuint32_t Nloop_rw = Nloop_all;\n\n\tNloop_all++; Nloop_all &= ~(uint32_t)1; /* round up to even */\n\tNloop_rw &= ~(uint32_t)1; /* round down to even */\n#else\n\tuint32_t Nloop_rw = (N + 2) / 3; /* 1/3, round up */\n\tNloop_rw++; Nloop_rw &= ~(uint32_t)1; /* round up to even */\n#endif\n\n\tsmix1(B, 1, ctx->Sbytes / 128, (salsa20_blk_t *)ctx->S0, XY, NULL);\n\tsmix1(B, r, N, V, XY, ctx);\n\tsmix2(B, r, N, Nloop_rw /* must be > 2 */, V, XY, ctx);\n#if _YESPOWER_OPT_C_PASS_ == 1\n\tif (Nloop_all > Nloop_rw)\n\t\tsmix2(B, r, N, 2, V, XY, ctx);\n#endif\n}\n\n#if _YESPOWER_OPT_C_PASS_ == 1\n#undef _YESPOWER_OPT_C_PASS_\n#define _YESPOWER_OPT_C_PASS_ 2\n#define blockmix_salsa blockmix_salsa_1_0\n#define blockmix_salsa_xor blockmix_salsa_xor_1_0\n#define blockmix blockmix_1_0\n#define blockmix_xor blockmix_xor_1_0\n#define blockmix_xor_save blockmix_xor_save_1_0\n#define smix1 smix1_1_0\n#define smix2 smix2_1_0\n#define smix smix_1_0\n#include \"yespower-opt.c\"\n#undef smix\n\n/**\n * yespower(local, src, srclen, params, dst):\n * Compute yespower(src[0 .. srclen - 1], N, r), to be checked for \"< target\".\n * local is the thread-local data structure, allowing to preserve and reuse a\n * memory allocation across calls, thereby reducing its overhead.\n *\n * Return 0 on success; or -1 on error.\n */\nint yespower(yespower_local_t *local,\n    const uint8_t *src, size_t srclen,\n    const yespower_params_t *params,\n    yespower_binary_t *dst)\n{\n\tyespower_version_t version = params->version;\n\tuint32_t N = params->N;\n\tuint32_t r = params->r;\n\tconst uint8_t *pers = params->pers;\n\tsize_t perslen = params->perslen;\n\tuint32_t Swidth;\n\tsize_t B_size, V_size, XY_size, need;\n\tuint8_t *B, *S;\n\tsalsa20_blk_t *V, *XY;\n\tpwxform_ctx_t ctx;\n\tuint8_t sha256[32];\n\n\t/* Sanity-check parameters */\n\tif ((version != YESPOWER_0_5 && version != YESPOWER_1_0) ||\n\t    N < 1024 || N > 512 * 1024 || r < 8 || r > 32 ||\n\t    (N & (N - 1)) != 0 ||\n\t    (!pers && perslen)) {\n\t\terrno = EINVAL;\n\t\tgoto fail;\n\t}\n\n\t/* Allocate memory */\n\tB_size = (size_t)128 * r;\n\tV_size = B_size * N;\n\tif (version == YESPOWER_0_5) {\n\t\tXY_size = B_size * 2;\n\t\tSwidth = Swidth_0_5;\n\t\tctx.Sbytes = 2 * Swidth_to_Sbytes1(Swidth);\n\t} else {\n\t\tXY_size = B_size + 64;\n\t\tSwidth = Swidth_1_0;\n\t\tctx.Sbytes = 3 * Swidth_to_Sbytes1(Swidth);\n\t}\n\tneed = B_size + V_size + XY_size + ctx.Sbytes;\n\tif (local->aligned_size < need) {\n\t\tif (free_region(local))\n\t\t\tgoto fail;\n\t\tif (!alloc_region(local, need))\n\t\t\tgoto fail;\n\t}\n\tB = (uint8_t *)local->aligned;\n\tV = (salsa20_blk_t *)((uint8_t *)B + B_size);\n\tXY = (salsa20_blk_t *)((uint8_t *)V + V_size);\n\tS = (uint8_t *)XY + XY_size;\n\tctx.S0 = S;\n\tctx.S1 = S + Swidth_to_Sbytes1(Swidth);\n\n\tSHA256_Buf(src, srclen, sha256);\n\n\tif (version == YESPOWER_0_5) {\n\t\tPBKDF2_SHA256(sha256, sizeof(sha256), src, srclen, 1,\n\t\t    B, B_size);\n\t\tmemcpy(sha256, B, sizeof(sha256));\n\t\tsmix(B, r, N, V, XY, &ctx);\n\t\tPBKDF2_SHA256(sha256, sizeof(sha256), B, B_size, 1,\n\t\t    (uint8_t *)dst, sizeof(*dst));\n\n\t\tif (pers) {\n\t\t\tHMAC_SHA256_Buf(dst, sizeof(*dst), pers, perslen,\n\t\t\t    sha256);\n\t\t\tSHA256_Buf(sha256, sizeof(sha256), (uint8_t *)dst);\n\t\t}\n\t} else {\n\t\tctx.S2 = S + 2 * Swidth_to_Sbytes1(Swidth);\n\t\tctx.w = 0;\n\n\t\tif (pers) {\n\t\t\tsrc = pers;\n\t\t\tsrclen = perslen;\n\t\t} else {\n\t\t\tsrclen = 0;\n\t\t}\n\n\t\tPBKDF2_SHA256(sha256, sizeof(sha256), src, srclen, 1, B, 128);\n\t\tmemcpy(sha256, B, sizeof(sha256));\n\t\tsmix_1_0(B, r, N, V, XY, &ctx);\n\t\tHMAC_SHA256_Buf(B + B_size - 64, 64,\n\t\t    sha256, sizeof(sha256), (uint8_t *)dst);\n\t}\n\n\t/* Success! */\n\treturn 0;\n\nfail:\n\tmemset(dst, 0xff, sizeof(*dst));\n\treturn -1;\n}\n\n/**\n * yespower_tls(src, srclen, params, dst):\n * Compute yespower(src[0 .. srclen - 1], N, r), to be checked for \"< target\".\n * The memory allocation is maintained internally using thread-local storage.\n *\n * Return 0 on success; or -1 on error.\n */\nint yespower_tls(const uint8_t *src, size_t srclen,\n    const yespower_params_t *params, yespower_binary_t *dst)\n{\n\tstatic __thread int initialized = 0;\n\tstatic __thread yespower_local_t local;\n\n\tif (!initialized) {\n\t\tinit_region(&local);\n\t\tinitialized = 1;\n\t}\n\n\treturn yespower(&local, src, srclen, params, dst);\n}\n\nint yespower_init_local(yespower_local_t *local)\n{\n\tinit_region(local);\n\treturn 0;\n}\n\nint yespower_free_local(yespower_local_t *local)\n{\n\treturn free_region(local);\n}\n#endif\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/yespower-platform.c",
    "content": "/*-\n * Copyright 2013-2018 Alexander Peslyak\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n#ifdef __unix__\n#include <sys/mman.h>\n#endif\n\n#define HUGEPAGE_THRESHOLD\t\t(12 * 1024 * 1024)\n\n#ifdef __x86_64__\n#define HUGEPAGE_SIZE\t\t\t(2 * 1024 * 1024)\n#else\n#undef HUGEPAGE_SIZE\n#endif\n\nstatic void *alloc_region(yespower_region_t *region, size_t size)\n{\n\tsize_t base_size = size;\n\tuint8_t *base, *aligned;\n#ifdef MAP_ANON\n\tint flags =\n#ifdef MAP_NOCORE\n\t    MAP_NOCORE |\n#endif\n\t    MAP_ANON | MAP_PRIVATE;\n#if defined(MAP_HUGETLB) && defined(HUGEPAGE_SIZE)\n\tsize_t new_size = size;\n\tconst size_t hugepage_mask = (size_t)HUGEPAGE_SIZE - 1;\n\tif (size >= HUGEPAGE_THRESHOLD && size + hugepage_mask >= size) {\n\t\tflags |= MAP_HUGETLB;\n/*\n * Linux's munmap() fails on MAP_HUGETLB mappings if size is not a multiple of\n * huge page size, so let's round up to huge page size here.\n */\n\t\tnew_size = size + hugepage_mask;\n\t\tnew_size &= ~hugepage_mask;\n\t}\n\tbase = mmap(NULL, new_size, PROT_READ | PROT_WRITE, flags, -1, 0);\n\tif (base != MAP_FAILED) {\n\t\tbase_size = new_size;\n\t} else if (flags & MAP_HUGETLB) {\n\t\tflags &= ~MAP_HUGETLB;\n\t\tbase = mmap(NULL, size, PROT_READ | PROT_WRITE, flags, -1, 0);\n\t}\n\n#else\n\tbase = mmap(NULL, size, PROT_READ | PROT_WRITE, flags, -1, 0);\n#endif\n\tif (base == MAP_FAILED)\n\t\tbase = NULL;\n\taligned = base;\n#elif defined(HAVE_POSIX_MEMALIGN)\n\tif ((errno = posix_memalign((void **)&base, 64, size)) != 0)\n\t\tbase = NULL;\n\taligned = base;\n#else\n\tbase = aligned = NULL;\n\tif (size + 63 < size) {\n\t\terrno = ENOMEM;\n\t} else if ((base = malloc(size + 63)) != NULL) {\n\t\taligned = base + 63;\n\t\taligned -= (uintptr_t)aligned & 63;\n\t}\n#endif\n\tregion->base = base;\n\tregion->aligned = aligned;\n\tregion->base_size = base ? base_size : 0;\n\tregion->aligned_size = base ? size : 0;\n\treturn aligned;\n}\n\nstatic inline void init_region(yespower_region_t *region)\n{\n\tregion->base = region->aligned = NULL;\n\tregion->base_size = region->aligned_size = 0;\n}\n\nstatic int free_region(yespower_region_t *region)\n{\n\tif (region->base) {\n#ifdef MAP_ANON\n\t\tif (munmap(region->base, region->base_size))\n\t\t\treturn -1;\n#else\n\t\tfree(region->base);\n#endif\n\t}\n\tinit_region(region);\n\treturn 0;\n}\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/yespower-ref.c",
    "content": "/*-\n * Copyright 2009 Colin Percival\n * Copyright 2013-2019 Alexander Peslyak\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * This file was originally written by Colin Percival as part of the Tarsnap\n * online backup system.\n *\n * This is a proof-of-work focused fork of yescrypt, including reference and\n * cut-down implementation of the obsolete yescrypt 0.5 (based off its first\n * submission to PHC back in 2014) and a new proof-of-work specific variation\n * known as yespower 1.0.  The former is intended as an upgrade for\n * cryptocurrencies that already use yescrypt 0.5 and the latter may be used\n * as a further upgrade (hard fork) by those and other cryptocurrencies.  The\n * version of algorithm to use is requested through parameters, allowing for\n * both algorithms to co-exist in client and miner implementations (such as in\n * preparation for a hard-fork).\n *\n * This is the reference implementation.  Its purpose is to provide a simple\n * human- and machine-readable specification that implementations intended\n * for actual use should be tested against.  It is deliberately mostly not\n * optimized, and it is not meant to be used in production.  Instead, use\n * yespower-opt.c.\n */\n\n#warning \"This reference implementation is deliberately mostly not optimized. Use yespower-opt.c instead unless you're testing (against) the reference implementation on purpose.\"\n\n#include <errno.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include \"sha256.h\"\n#include \"sysendian.h\"\n\n#include \"yespower.h\"\n\nstatic void blkcpy(uint32_t *dst, const uint32_t *src, size_t count)\n{\n\tdo {\n\t\t*dst++ = *src++;\n\t} while (--count);\n}\n\nstatic void blkxor(uint32_t *dst, const uint32_t *src, size_t count)\n{\n\tdo {\n\t\t*dst++ ^= *src++;\n\t} while (--count);\n}\n\n/**\n * salsa20(B):\n * Apply the Salsa20 core to the provided block.\n */\nstatic void salsa20(uint32_t B[16], uint32_t rounds)\n{\n\tuint32_t x[16];\n\tsize_t i;\n\n\t/* SIMD unshuffle */\n\tfor (i = 0; i < 16; i++)\n\t\tx[i * 5 % 16] = B[i];\n\n\tfor (i = 0; i < rounds; i += 2) {\n#define R(a,b) (((a) << (b)) | ((a) >> (32 - (b))))\n\t\t/* Operate on columns */\n\t\tx[ 4] ^= R(x[ 0]+x[12], 7);  x[ 8] ^= R(x[ 4]+x[ 0], 9);\n\t\tx[12] ^= R(x[ 8]+x[ 4],13);  x[ 0] ^= R(x[12]+x[ 8],18);\n\n\t\tx[ 9] ^= R(x[ 5]+x[ 1], 7);  x[13] ^= R(x[ 9]+x[ 5], 9);\n\t\tx[ 1] ^= R(x[13]+x[ 9],13);  x[ 5] ^= R(x[ 1]+x[13],18);\n\n\t\tx[14] ^= R(x[10]+x[ 6], 7);  x[ 2] ^= R(x[14]+x[10], 9);\n\t\tx[ 6] ^= R(x[ 2]+x[14],13);  x[10] ^= R(x[ 6]+x[ 2],18);\n\n\t\tx[ 3] ^= R(x[15]+x[11], 7);  x[ 7] ^= R(x[ 3]+x[15], 9);\n\t\tx[11] ^= R(x[ 7]+x[ 3],13);  x[15] ^= R(x[11]+x[ 7],18);\n\n\t\t/* Operate on rows */\n\t\tx[ 1] ^= R(x[ 0]+x[ 3], 7);  x[ 2] ^= R(x[ 1]+x[ 0], 9);\n\t\tx[ 3] ^= R(x[ 2]+x[ 1],13);  x[ 0] ^= R(x[ 3]+x[ 2],18);\n\n\t\tx[ 6] ^= R(x[ 5]+x[ 4], 7);  x[ 7] ^= R(x[ 6]+x[ 5], 9);\n\t\tx[ 4] ^= R(x[ 7]+x[ 6],13);  x[ 5] ^= R(x[ 4]+x[ 7],18);\n\n\t\tx[11] ^= R(x[10]+x[ 9], 7);  x[ 8] ^= R(x[11]+x[10], 9);\n\t\tx[ 9] ^= R(x[ 8]+x[11],13);  x[10] ^= R(x[ 9]+x[ 8],18);\n\n\t\tx[12] ^= R(x[15]+x[14], 7);  x[13] ^= R(x[12]+x[15], 9);\n\t\tx[14] ^= R(x[13]+x[12],13);  x[15] ^= R(x[14]+x[13],18);\n#undef R\n\t}\n\n\t/* SIMD shuffle */\n\tfor (i = 0; i < 16; i++)\n\t\tB[i] += x[i * 5 % 16];\n}\n\n/**\n * blockmix_salsa(B):\n * Compute B = BlockMix_{salsa20, 1}(B).  The input B must be 128 bytes in\n * length.\n */\nstatic void blockmix_salsa(uint32_t *B, uint32_t rounds)\n{\n\tuint32_t X[16];\n\tsize_t i;\n\n\t/* 1: X <-- B_{2r - 1} */\n\tblkcpy(X, &B[16], 16);\n\n\t/* 2: for i = 0 to 2r - 1 do */\n\tfor (i = 0; i < 2; i++) {\n\t\t/* 3: X <-- H(X xor B_i) */\n\t\tblkxor(X, &B[i * 16], 16);\n\t\tsalsa20(X, rounds);\n\n\t\t/* 4: Y_i <-- X */\n\t\t/* 6: B' <-- (Y_0, Y_2 ... Y_{2r-2}, Y_1, Y_3 ... Y_{2r-1}) */\n\t\tblkcpy(&B[i * 16], X, 16);\n\t}\n}\n\n/*\n * These are tunable, but they must meet certain constraints and are part of\n * what defines a yespower version.\n */\n#define PWXsimple 2\n#define PWXgather 4\n/* Version 0.5 */\n#define PWXrounds_0_5 6\n#define Swidth_0_5 8\n/* Version 1.0 */\n#define PWXrounds_1_0 3\n#define Swidth_1_0 11\n\n/* Derived values.  Not tunable on their own. */\n#define PWXbytes (PWXgather * PWXsimple * 8)\n#define PWXwords (PWXbytes / sizeof(uint32_t))\n#define rmin ((PWXbytes + 127) / 128)\n\n/* Runtime derived values.  Not tunable on their own. */\n#define Swidth_to_Sbytes1(Swidth) ((1 << Swidth) * PWXsimple * 8)\n#define Swidth_to_Smask(Swidth) (((1 << Swidth) - 1) * PWXsimple * 8)\n\ntypedef struct {\n\tyespower_version_t version;\n\tuint32_t salsa20_rounds;\n\tuint32_t PWXrounds, Swidth, Sbytes, Smask;\n\tuint32_t *S;\n\tuint32_t (*S0)[2], (*S1)[2], (*S2)[2];\n\tsize_t w;\n} pwxform_ctx_t;\n\n/**\n * pwxform(B):\n * Transform the provided block using the provided S-boxes.\n */\nstatic void pwxform(uint32_t *B, pwxform_ctx_t *ctx)\n{\n\tuint32_t (*X)[PWXsimple][2] = (uint32_t (*)[PWXsimple][2])B;\n\tuint32_t (*S0)[2] = ctx->S0, (*S1)[2] = ctx->S1, (*S2)[2] = ctx->S2;\n\tuint32_t Smask = ctx->Smask;\n\tsize_t w = ctx->w;\n\tsize_t i, j, k;\n\n\t/* 1: for i = 0 to PWXrounds - 1 do */\n\tfor (i = 0; i < ctx->PWXrounds; i++) {\n\t\t/* 2: for j = 0 to PWXgather - 1 do */\n\t\tfor (j = 0; j < PWXgather; j++) {\n\t\t\tuint32_t xl = X[j][0][0];\n\t\t\tuint32_t xh = X[j][0][1];\n\t\t\tuint32_t (*p0)[2], (*p1)[2];\n\n\t\t\t/* 3: p0 <-- (lo(B_{j,0}) & Smask) / (PWXsimple * 8) */\n\t\t\tp0 = S0 + (xl & Smask) / sizeof(*S0);\n\t\t\t/* 4: p1 <-- (hi(B_{j,0}) & Smask) / (PWXsimple * 8) */\n\t\t\tp1 = S1 + (xh & Smask) / sizeof(*S1);\n\n\t\t\t/* 5: for k = 0 to PWXsimple - 1 do */\n\t\t\tfor (k = 0; k < PWXsimple; k++) {\n\t\t\t\tuint64_t x, s0, s1;\n\n\t\t\t\t/* 6: B_{j,k} <-- (hi(B_{j,k}) * lo(B_{j,k}) + S0_{p0,k}) xor S1_{p1,k} */\n\t\t\t\ts0 = ((uint64_t)p0[k][1] << 32) + p0[k][0];\n\t\t\t\ts1 = ((uint64_t)p1[k][1] << 32) + p1[k][0];\n\n\t\t\t\txl = X[j][k][0];\n\t\t\t\txh = X[j][k][1];\n\n\t\t\t\tx = (uint64_t)xh * xl;\n\t\t\t\tx += s0;\n\t\t\t\tx ^= s1;\n\n\t\t\t\tX[j][k][0] = x;\n\t\t\t\tX[j][k][1] = x >> 32;\n\t\t\t}\n\n\t\t\tif (ctx->version != YESPOWER_0_5 &&\n\t\t\t    (i == 0 || j < PWXgather / 2)) {\n\t\t\t\tif (j & 1) {\n\t\t\t\t\tfor (k = 0; k < PWXsimple; k++) {\n\t\t\t\t\t\tS1[w][0] = X[j][k][0];\n\t\t\t\t\t\tS1[w][1] = X[j][k][1];\n\t\t\t\t\t\tw++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (k = 0; k < PWXsimple; k++) {\n\t\t\t\t\t\tS0[w + k][0] = X[j][k][0];\n\t\t\t\t\t\tS0[w + k][1] = X[j][k][1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (ctx->version != YESPOWER_0_5) {\n\t\t/* 14: (S0, S1, S2) <-- (S2, S0, S1) */\n\t\tctx->S0 = S2;\n\t\tctx->S1 = S0;\n\t\tctx->S2 = S1;\n\t\t/* 15: w <-- w mod 2^Swidth */\n\t\tctx->w = w & ((1 << ctx->Swidth) * PWXsimple - 1);\n\t}\n}\n\n/**\n * blockmix_pwxform(B, ctx, r):\n * Compute B = BlockMix_pwxform{salsa20, ctx, r}(B).  The input B must be\n * 128r bytes in length.\n */\nstatic void blockmix_pwxform(uint32_t *B, pwxform_ctx_t *ctx, size_t r)\n{\n\tuint32_t X[PWXwords];\n\tsize_t r1, i;\n\n\t/* Convert 128-byte blocks to PWXbytes blocks */\n\t/* 1: r_1 <-- 128r / PWXbytes */\n\tr1 = 128 * r / PWXbytes;\n\n\t/* 2: X <-- B'_{r_1 - 1} */\n\tblkcpy(X, &B[(r1 - 1) * PWXwords], PWXwords);\n\n\t/* 3: for i = 0 to r_1 - 1 do */\n\tfor (i = 0; i < r1; i++) {\n\t\t/* 4: if r_1 > 1 */\n\t\tif (r1 > 1) {\n\t\t\t/* 5: X <-- X xor B'_i */\n\t\t\tblkxor(X, &B[i * PWXwords], PWXwords);\n\t\t}\n\n\t\t/* 7: X <-- pwxform(X) */\n\t\tpwxform(X, ctx);\n\n\t\t/* 8: B'_i <-- X */\n\t\tblkcpy(&B[i * PWXwords], X, PWXwords);\n\t}\n\n\t/* 10: i <-- floor((r_1 - 1) * PWXbytes / 64) */\n\ti = (r1 - 1) * PWXbytes / 64;\n\n\t/* 11: B_i <-- H(B_i) */\n\tsalsa20(&B[i * 16], ctx->salsa20_rounds);\n\n#if 1 /* No-op with our current pwxform settings, but do it to make sure */\n\t/* 12: for i = i + 1 to 2r - 1 do */\n\tfor (i++; i < 2 * r; i++) {\n\t\t/* 13: B_i <-- H(B_i xor B_{i-1}) */\n\t\tblkxor(&B[i * 16], &B[(i - 1) * 16], 16);\n\t\tsalsa20(&B[i * 16], ctx->salsa20_rounds);\n\t}\n#endif\n}\n\n/**\n * integerify(B, r):\n * Return the result of parsing B_{2r-1} as a little-endian integer.\n */\nstatic uint32_t integerify(const uint32_t *B, size_t r)\n{\n/*\n * Our 32-bit words are in host byte order.  Also, they are SIMD-shuffled, but\n * we only care about the least significant 32 bits anyway.\n */\n\tconst uint32_t *X = &B[(2 * r - 1) * 16];\n\treturn X[0];\n}\n\n/**\n * p2floor(x):\n * Largest power of 2 not greater than argument.\n */\nstatic uint32_t p2floor(uint32_t x)\n{\n\tuint32_t y;\n\twhile ((y = x & (x - 1)))\n\t\tx = y;\n\treturn x;\n}\n\n/**\n * wrap(x, i):\n * Wrap x to the range 0 to i-1.\n */\nstatic uint32_t wrap(uint32_t x, uint32_t i)\n{\n\tuint32_t n = p2floor(i);\n\treturn (x & (n - 1)) + (i - n);\n}\n\n/**\n * smix1(B, r, N, V, X, ctx):\n * Compute first loop of B = SMix_r(B, N).  The input B must be 128r bytes in\n * length; the temporary storage V must be 128rN bytes in length; the temporary\n * storage X must be 128r bytes in length.\n */\nstatic void smix1(uint32_t *B, size_t r, uint32_t N,\n    uint32_t *V, uint32_t *X, pwxform_ctx_t *ctx)\n{\n\tsize_t s = 32 * r;\n\tuint32_t i, j;\n\tsize_t k;\n\n\t/* 1: X <-- B */\n\tfor (k = 0; k < 2 * r; k++)\n\t\tfor (i = 0; i < 16; i++)\n\t\t\tX[k * 16 + i] = le32dec(&B[k * 16 + (i * 5 % 16)]);\n\n\tif (ctx->version != YESPOWER_0_5) {\n\t\tfor (k = 1; k < r; k++) {\n\t\t\tblkcpy(&X[k * 32], &X[(k - 1) * 32], 32);\n\t\t\tblockmix_pwxform(&X[k * 32], ctx, 1);\n\t\t}\n\t}\n\n\t/* 2: for i = 0 to N - 1 do */\n\tfor (i = 0; i < N; i++) {\n\t\t/* 3: V_i <-- X */\n\t\tblkcpy(&V[i * s], X, s);\n\n\t\tif (i > 1) {\n\t\t\t/* j <-- Wrap(Integerify(X), i) */\n\t\t\tj = wrap(integerify(X, r), i);\n\n\t\t\t/* X <-- X xor V_j */\n\t\t\tblkxor(X, &V[j * s], s);\n\t\t}\n\n\t\t/* 4: X <-- H(X) */\n\t\tif (V != ctx->S)\n\t\t\tblockmix_pwxform(X, ctx, r);\n\t\telse\n\t\t\tblockmix_salsa(X, ctx->salsa20_rounds);\n\t}\n\n\t/* B' <-- X */\n\tfor (k = 0; k < 2 * r; k++)\n\t\tfor (i = 0; i < 16; i++)\n\t\t\tle32enc(&B[k * 16 + (i * 5 % 16)], X[k * 16 + i]);\n}\n\n/**\n * smix2(B, r, N, Nloop, V, X, ctx):\n * Compute second loop of B = SMix_r(B, N).  The input B must be 128r bytes in\n * length; the temporary storage V must be 128rN bytes in length; the temporary\n * storage X must be 128r bytes in length.  The value N must be a power of 2\n * greater than 1.\n */\nstatic void smix2(uint32_t *B, size_t r, uint32_t N, uint32_t Nloop,\n    uint32_t *V, uint32_t *X, pwxform_ctx_t *ctx)\n{\n\tsize_t s = 32 * r;\n\tuint32_t i, j;\n\tsize_t k;\n\n\t/* X <-- B */\n\tfor (k = 0; k < 2 * r; k++)\n\t\tfor (i = 0; i < 16; i++)\n\t\t\tX[k * 16 + i] = le32dec(&B[k * 16 + (i * 5 % 16)]);\n\n\t/* 6: for i = 0 to N - 1 do */\n\tfor (i = 0; i < Nloop; i++) {\n\t\t/* 7: j <-- Integerify(X) mod N */\n\t\tj = integerify(X, r) & (N - 1);\n\n\t\t/* 8.1: X <-- X xor V_j */\n\t\tblkxor(X, &V[j * s], s);\n\t\t/* V_j <-- X */\n\t\tif (Nloop != 2)\n\t\t\tblkcpy(&V[j * s], X, s);\n\n\t\t/* 8.2: X <-- H(X) */\n\t\tblockmix_pwxform(X, ctx, r);\n\t}\n\n\t/* 10: B' <-- X */\n\tfor (k = 0; k < 2 * r; k++)\n\t\tfor (i = 0; i < 16; i++)\n\t\t\tle32enc(&B[k * 16 + (i * 5 % 16)], X[k * 16 + i]);\n}\n\n/**\n * smix(B, r, N, p, t, V, X, ctx):\n * Compute B = SMix_r(B, N).  The input B must be 128rp bytes in length; the\n * temporary storage V must be 128rN bytes in length; the temporary storage\n * X must be 128r bytes in length.  The value N must be a power of 2 and at\n * least 16.\n */\nstatic void smix(uint32_t *B, size_t r, uint32_t N,\n    uint32_t *V, uint32_t *X, pwxform_ctx_t *ctx)\n{\n\tuint32_t Nloop_all = (N + 2) / 3; /* 1/3, round up */\n\tuint32_t Nloop_rw = Nloop_all;\n\n\tNloop_all++; Nloop_all &= ~(uint32_t)1; /* round up to even */\n\tif (ctx->version == YESPOWER_0_5) {\n\t\tNloop_rw &= ~(uint32_t)1; /* round down to even */\n\t} else {\n\t\tNloop_rw++; Nloop_rw &= ~(uint32_t)1; /* round up to even */\n\t}\n\n\tsmix1(B, 1, ctx->Sbytes / 128, ctx->S, X, ctx);\n\tsmix1(B, r, N, V, X, ctx);\n\tsmix2(B, r, N, Nloop_rw /* must be > 2 */, V, X, ctx);\n\tsmix2(B, r, N, Nloop_all - Nloop_rw /* 0 or 2 */, V, X, ctx);\n}\n\n/**\n * yespower(local, src, srclen, params, dst):\n * Compute yespower(src[0 .. srclen - 1], N, r), to be checked for \"< target\".\n *\n * Return 0 on success; or -1 on error.\n */\nint yespower(yespower_local_t *local,\n    const uint8_t *src, size_t srclen,\n    const yespower_params_t *params, yespower_binary_t *dst)\n{\n\tyespower_version_t version = params->version;\n\tuint32_t N = params->N;\n\tuint32_t r = params->r;\n\tconst uint8_t *pers = params->pers;\n\tsize_t perslen = params->perslen;\n\tint retval = -1;\n\tsize_t B_size, V_size;\n\tuint32_t *B, *V, *X, *S;\n\tpwxform_ctx_t ctx;\n\tuint32_t sha256[8];\n\n\tmemset(dst, 0xff, sizeof(*dst));\n\n\t/* Sanity-check parameters */\n\tif ((version != YESPOWER_0_5 && version != YESPOWER_1_0) ||\n\t    N < 1024 || N > 512 * 1024 || r < 8 || r > 32 ||\n\t    (N & (N - 1)) != 0 || r < rmin ||\n\t    (!pers && perslen)) {\n\t\terrno = EINVAL;\n\t\treturn -1;\n\t}\n\n\t/* Allocate memory */\n\tB_size = (size_t)128 * r;\n\tV_size = B_size * N;\n\tif ((V = malloc(V_size)) == NULL)\n\t\treturn -1;\n\tif ((B = malloc(B_size)) == NULL)\n\t\tgoto free_V;\n\tif ((X = malloc(B_size)) == NULL)\n\t\tgoto free_B;\n\tctx.version = version;\n\tif (version == YESPOWER_0_5) {\n\t\tctx.salsa20_rounds = 8;\n\t\tctx.PWXrounds = PWXrounds_0_5;\n\t\tctx.Swidth = Swidth_0_5;\n\t\tctx.Sbytes = 2 * Swidth_to_Sbytes1(ctx.Swidth);\n\t} else {\n\t\tctx.salsa20_rounds = 2;\n\t\tctx.PWXrounds = PWXrounds_1_0;\n\t\tctx.Swidth = Swidth_1_0;\n\t\tctx.Sbytes = 3 * Swidth_to_Sbytes1(ctx.Swidth);\n\t}\n\tif ((S = malloc(ctx.Sbytes)) == NULL)\n\t\tgoto free_X;\n\tctx.S = S;\n\tctx.S0 = (uint32_t (*)[2])S;\n\tctx.S1 = ctx.S0 + (1 << ctx.Swidth) * PWXsimple;\n\tctx.S2 = ctx.S1 + (1 << ctx.Swidth) * PWXsimple;\n\tctx.Smask = Swidth_to_Smask(ctx.Swidth);\n\tctx.w = 0;\n\n\tSHA256_Buf(src, srclen, (uint8_t *)sha256);\n\n\tif (version != YESPOWER_0_5) {\n\t\tif (pers) {\n\t\t\tsrc = pers;\n\t\t\tsrclen = perslen;\n\t\t} else {\n\t\t\tsrclen = 0;\n\t\t}\n\t}\n\n\t/* 1: (B_0 ... B_{p-1}) <-- PBKDF2(P, S, 1, p * MFLen) */\n\tPBKDF2_SHA256((uint8_t *)sha256, sizeof(sha256),\n\t    src, srclen, 1, (uint8_t *)B, B_size);\n\n\tblkcpy(sha256, B, sizeof(sha256) / sizeof(sha256[0]));\n\n\t/* 3: B_i <-- MF(B_i, N) */\n\tsmix(B, r, N, V, X, &ctx);\n\n\tif (version == YESPOWER_0_5) {\n\t\t/* 5: DK <-- PBKDF2(P, B, 1, dkLen) */\n\t\tPBKDF2_SHA256((uint8_t *)sha256, sizeof(sha256),\n\t\t    (uint8_t *)B, B_size, 1, (uint8_t *)dst, sizeof(*dst));\n\n\t\tif (pers) {\n\t\t\tHMAC_SHA256_Buf(dst, sizeof(*dst), pers, perslen,\n\t\t\t    (uint8_t *)sha256);\n\t\t\tSHA256_Buf(sha256, sizeof(sha256), (uint8_t *)dst);\n\t\t}\n\t} else {\n\t\tHMAC_SHA256_Buf((uint8_t *)B + B_size - 64, 64,\n\t\t    sha256, sizeof(sha256), (uint8_t *)dst);\n\t}\n\n\t/* Success! */\n\tretval = 0;\n\n\t/* Free memory */\n\tfree(S);\nfree_X:\n\tfree(X);\nfree_B:\n\tfree(B);\nfree_V:\n\tfree(V);\n\n\treturn retval;\n}\n\nint yespower_tls(const uint8_t *src, size_t srclen,\n    const yespower_params_t *params, yespower_binary_t *dst)\n{\n/* The reference implementation doesn't use thread-local storage */\n\treturn yespower(NULL, src, srclen, params, dst);\n}\n\nint yespower_init_local(yespower_local_t *local)\n{\n/* The reference implementation doesn't use the local structure */\n\tlocal->base = local->aligned = NULL;\n\tlocal->base_size = local->aligned_size = 0;\n\treturn 0;\n}\n\nint yespower_free_local(yespower_local_t *local)\n{\n/* The reference implementation frees its memory in yespower() */\n\t(void)local; /* unused */\n\treturn 0;\n}\n"
  },
  {
    "path": "src/crypto/yespower-1.0.1/yespower.h",
    "content": "/*-\n * Copyright 2009 Colin Percival\n * Copyright 2013-2018 Alexander Peslyak\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * This file was originally written by Colin Percival as part of the Tarsnap\n * online backup system.\n */\n#ifndef _YESPOWER_H_\n#define _YESPOWER_H_\n\n#include <stdint.h>\n#include <stdlib.h> /* for size_t */\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/**\n * Internal type used by the memory allocator.  Please do not use it directly.\n * Use yespower_local_t instead.\n */\ntypedef struct {\n\tvoid *base, *aligned;\n\tsize_t base_size, aligned_size;\n} yespower_region_t;\n\n/**\n * Type for thread-local (RAM) data structure.\n */\ntypedef yespower_region_t yespower_local_t;\n\n/*\n * Type for yespower algorithm version numbers.\n */\ntypedef enum { YESPOWER_0_5 = 5, YESPOWER_1_0 = 10 } yespower_version_t;\n\n/**\n * yespower parameters combined into one struct.\n */\ntypedef struct {\n\tyespower_version_t version;\n\tuint32_t N, r;\n\tconst uint8_t *pers;\n\tsize_t perslen;\n} yespower_params_t;\n\n/**\n * A 256-bit yespower hash.\n */\ntypedef struct {\n\tunsigned char uc[32];\n} yespower_binary_t;\n\n/**\n * yespower_init_local(local):\n * Initialize the thread-local (RAM) data structure.  Actual memory allocation\n * is currently fully postponed until a call to yespower().\n *\n * Return 0 on success; or -1 on error.\n *\n * MT-safe as long as local is local to the thread.\n */\nextern int yespower_init_local(yespower_local_t *local);\n\n/**\n * yespower_free_local(local):\n * Free memory that may have been allocated for an initialized thread-local\n * (RAM) data structure.\n *\n * Return 0 on success; or -1 on error.\n *\n * MT-safe as long as local is local to the thread.\n */\nextern int yespower_free_local(yespower_local_t *local);\n\n/**\n * yespower(local, src, srclen, params, dst):\n * Compute yespower(src[0 .. srclen - 1], N, r), to be checked for \"< target\".\n * local is the thread-local data structure, allowing to preserve and reuse a\n * memory allocation across calls, thereby reducing processing overhead.\n *\n * Return 0 on success; or -1 on error.\n *\n * local must be initialized with yespower_init_local().\n *\n * MT-safe as long as local and dst are local to the thread.\n */\nextern int yespower(yespower_local_t *local,\n    const uint8_t *src, size_t srclen,\n    const yespower_params_t *params, yespower_binary_t *dst);\n\n/**\n * yespower_tls(src, srclen, params, dst):\n * Compute yespower(src[0 .. srclen - 1], N, r), to be checked for \"< target\".\n * The memory allocation is maintained internally using thread-local storage.\n *\n * Return 0 on success; or -1 on error.\n *\n * MT-safe as long as dst is local to the thread.\n */\nextern int yespower_tls(const uint8_t *src, size_t srclen,\n    const yespower_params_t *params, yespower_binary_t *dst);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* !_YESPOWER_H_ */\n"
  },
  {
    "path": "src/cuckoocache.h",
    "content": "// Copyright (c) 2016 Jeremy Rubin\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CUCKOOCACHE_H\n#define BITCOIN_CUCKOOCACHE_H\n\n#include <array>\n#include <algorithm>\n#include <atomic>\n#include <cstring>\n#include <cmath>\n#include <memory>\n#include <vector>\n\n\n/** namespace CuckooCache provides high performance cache primitives\n *\n * Summary:\n *\n * 1) bit_packed_atomic_flags is bit-packed atomic flags for garbage collection\n *\n * 2) cache is a cache which is performant in memory usage and lookup speed. It\n * is lockfree for erase operations. Elements are lazily erased on the next\n * insert.\n */\nnamespace CuckooCache\n{\n/** bit_packed_atomic_flags implements a container for garbage collection flags\n * that is only thread unsafe on calls to setup. This class bit-packs collection\n * flags for memory efficiency.\n *\n * All operations are std::memory_order_relaxed so external mechanisms must\n * ensure that writes and reads are properly synchronized.\n *\n * On setup(n), all bits up to n are marked as collected.\n *\n * Under the hood, because it is an 8-bit type, it makes sense to use a multiple\n * of 8 for setup, but it will be safe if that is not the case as well.\n *\n */\nclass bit_packed_atomic_flags\n{\n    std::unique_ptr<std::atomic<uint8_t>[]> mem;\n\npublic:\n    /** No default constructor as there must be some size */\n    bit_packed_atomic_flags() = delete;\n\n    /**\n     * bit_packed_atomic_flags constructor creates memory to sufficiently\n     * keep track of garbage collection information for size entries.\n     *\n     * @param size the number of elements to allocate space for\n     *\n     * @post bit_set, bit_unset, and bit_is_set function properly forall x. x <\n     * size\n     * @post All calls to bit_is_set (without subsequent bit_unset) will return\n     * true.\n     */\n    explicit bit_packed_atomic_flags(uint32_t size)\n    {\n        // pad out the size if needed\n        size = (size + 7) / 8;\n        mem.reset(new std::atomic<uint8_t>[size]);\n        for (uint32_t i = 0; i < size; ++i)\n            mem[i].store(0xFF);\n    };\n\n    /** setup marks all entries and ensures that bit_packed_atomic_flags can store\n     * at least size entries\n     *\n     * @param b the number of elements to allocate space for\n     * @post bit_set, bit_unset, and bit_is_set function properly forall x. x <\n     * b\n     * @post All calls to bit_is_set (without subsequent bit_unset) will return\n     * true.\n     */\n    inline void setup(uint32_t b)\n    {\n        bit_packed_atomic_flags d(b);\n        std::swap(mem, d.mem);\n    }\n\n    /** bit_set sets an entry as discardable.\n     *\n     * @param s the index of the entry to bit_set.\n     * @post immediately subsequent call (assuming proper external memory\n     * ordering) to bit_is_set(s) == true.\n     *\n     */\n    inline void bit_set(uint32_t s)\n    {\n        mem[s >> 3].fetch_or(1 << (s & 7), std::memory_order_relaxed);\n    }\n\n    /**  bit_unset marks an entry as something that should not be overwritten\n     *\n     * @param s the index of the entry to bit_unset.\n     * @post immediately subsequent call (assuming proper external memory\n     * ordering) to bit_is_set(s) == false.\n     */\n    inline void bit_unset(uint32_t s)\n    {\n        mem[s >> 3].fetch_and(~(1 << (s & 7)), std::memory_order_relaxed);\n    }\n\n    /** bit_is_set queries the table for discardability at s\n     *\n     * @param s the index of the entry to read.\n     * @returns if the bit at index s was set.\n     * */\n    inline bool bit_is_set(uint32_t s) const\n    {\n        return (1 << (s & 7)) & mem[s >> 3].load(std::memory_order_relaxed);\n    }\n};\n\n/** cache implements a cache with properties similar to a cuckoo-set\n *\n *  The cache is able to hold up to (~(uint32_t)0) - 1 elements.\n *\n *  Read Operations:\n *      - contains(*, false)\n *\n *  Read+Erase Operations:\n *      - contains(*, true)\n *\n *  Erase Operations:\n *      - allow_erase()\n *\n *  Write Operations:\n *      - setup()\n *      - setup_bytes()\n *      - insert()\n *      - please_keep()\n *\n *  Synchronization Free Operations:\n *      - invalid()\n *      - compute_hashes()\n *\n * User Must Guarantee:\n *\n * 1) Write Requires synchronized access (e.g., a lock)\n * 2) Read Requires no concurrent Write, synchronized with the last insert.\n * 3) Erase requires no concurrent Write, synchronized with last insert.\n * 4) An Erase caller must release all memory before allowing a new Writer.\n *\n *\n * Note on function names:\n *   - The name \"allow_erase\" is used because the real discard happens later.\n *   - The name \"please_keep\" is used because elements may be erased anyways on insert.\n *\n * @tparam Element should be a movable and copyable type\n * @tparam Hash should be a function/callable which takes a template parameter\n * hash_select and an Element and extracts a hash from it. Should return\n * high-entropy uint32_t hashes for `Hash h; h<0>(e) ... h<7>(e)`.\n */\ntemplate <typename Element, typename Hash>\nclass cache\n{\nprivate:\n    /** table stores all the elements */\n    std::vector<Element> table;\n\n    /** size stores the total available slots in the hash table */\n    uint32_t size;\n\n    /** The bit_packed_atomic_flags array is marked mutable because we want\n     * garbage collection to be allowed to occur from const methods */\n    mutable bit_packed_atomic_flags collection_flags;\n\n    /** epoch_flags tracks how recently an element was inserted into\n     * the cache. true denotes recent, false denotes not-recent. See insert()\n     * method for full semantics.\n     */\n    mutable std::vector<bool> epoch_flags;\n\n    /** epoch_heuristic_counter is used to determine when an epoch might be aged\n     * & an expensive scan should be done.  epoch_heuristic_counter is\n     * decremented on insert and reset to the new number of inserts which would\n     * cause the epoch to reach epoch_size when it reaches zero.\n     */\n    uint32_t epoch_heuristic_counter;\n\n    /** epoch_size is set to be the number of elements supposed to be in a\n     * epoch. When the number of non-erased elements in an epoch\n     * exceeds epoch_size, a new epoch should be started and all\n     * current entries demoted. epoch_size is set to be 45% of size because\n     * we want to keep load around 90%, and we support 3 epochs at once --\n     * one \"dead\" which has been erased, one \"dying\" which has been marked to be\n     * erased next, and one \"living\" which new inserts add to.\n     */\n    uint32_t epoch_size;\n\n    /** depth_limit determines how many elements insert should try to replace.\n     * Should be set to log2(n)*/\n    uint8_t depth_limit;\n\n    /** hash_function is a const instance of the hash function. It cannot be\n     * static or initialized at call time as it may have internal state (such as\n     * a nonce).\n     * */\n    const Hash hash_function;\n\n    /** compute_hashes is convenience for not having to write out this\n     * expression everywhere we use the hash values of an Element.\n     *\n     * We need to map the 32-bit input hash onto a hash bucket in a range [0, size) in a\n     *  manner which preserves as much of the hash's uniformity as possible.  Ideally\n     *  this would be done by bitmasking but the size is usually not a power of two.\n     *\n     * The naive approach would be to use a mod -- which isn't perfectly uniform but so\n     *  long as the hash is much larger than size it is not that bad.  Unfortunately,\n     *  mod/division is fairly slow on ordinary microprocessors (e.g. 90-ish cycles on\n     *  haswell, ARM doesn't even have an instruction for it.); when the divisor is a\n     *  constant the compiler will do clever tricks to turn it into a multiply+add+shift,\n     *  but size is a run-time value so the compiler can't do that here.\n     *\n     * One option would be to implement the same trick the compiler uses and compute the\n     *  constants for exact division based on the size, as described in \"{N}-bit Unsigned\n     *  Division via {N}-bit Multiply-Add\" by Arch D. Robison in 2005. But that code is\n     *  somewhat complicated and the result is still slower than other options:\n     *\n     * Instead we treat the 32-bit random number as a Q32 fixed-point number in the range\n     *  [0,1) and simply multiply it by the size.  Then we just shift the result down by\n     *  32-bits to get our bucket number.  The results has non-uniformity the same as a\n     *  mod, but it is much faster to compute. More about this technique can be found at\n     *  http://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/\n     *\n     * The resulting non-uniformity is also more equally distributed which would be\n     *  advantageous for something like linear probing, though it shouldn't matter\n     *  one way or the other for a cuckoo table.\n     *\n     * The primary disadvantage of this approach is increased intermediate precision is\n     *  required but for a 32-bit random number we only need the high 32 bits of a\n     *  32*32->64 multiply, which means the operation is reasonably fast even on a\n     *  typical 32-bit processor.\n     *\n     * @param e the element whose hashes will be returned\n     * @returns std::array<uint32_t, 8> of deterministic hashes derived from e\n     */\n    inline std::array<uint32_t, 8> compute_hashes(const Element& e) const\n    {\n        return {{(uint32_t)((hash_function.template operator()<0>(e) * (uint64_t)size) >> 32),\n                 (uint32_t)((hash_function.template operator()<1>(e) * (uint64_t)size) >> 32),\n                 (uint32_t)((hash_function.template operator()<2>(e) * (uint64_t)size) >> 32),\n                 (uint32_t)((hash_function.template operator()<3>(e) * (uint64_t)size) >> 32),\n                 (uint32_t)((hash_function.template operator()<4>(e) * (uint64_t)size) >> 32),\n                 (uint32_t)((hash_function.template operator()<5>(e) * (uint64_t)size) >> 32),\n                 (uint32_t)((hash_function.template operator()<6>(e) * (uint64_t)size) >> 32),\n                 (uint32_t)((hash_function.template operator()<7>(e) * (uint64_t)size) >> 32)}};\n    }\n\n    /* end\n     * @returns a constexpr index that can never be inserted to */\n    constexpr uint32_t invalid() const\n    {\n        return ~(uint32_t)0;\n    }\n\n    /** allow_erase marks the element at index n as discardable. Threadsafe\n     * without any concurrent insert.\n     * @param n the index to allow erasure of\n     */\n    inline void allow_erase(uint32_t n) const\n    {\n        collection_flags.bit_set(n);\n    }\n\n    /** please_keep marks the element at index n as an entry that should be kept.\n     * Threadsafe without any concurrent insert.\n     * @param n the index to prioritize keeping\n     */\n    inline void please_keep(uint32_t n) const\n    {\n        collection_flags.bit_unset(n);\n    }\n\n    /** epoch_check handles the changing of epochs for elements stored in the\n     * cache. epoch_check should be run before every insert.\n     *\n     * First, epoch_check decrements and checks the cheap heuristic, and then does\n     * a more expensive scan if the cheap heuristic runs out. If the expensive\n     * scan succeeds, the epochs are aged and old elements are allow_erased. The\n     * cheap heuristic is reset to retrigger after the worst case growth of the\n     * current epoch's elements would exceed the epoch_size.\n     */\n    void epoch_check()\n    {\n        if (epoch_heuristic_counter != 0) {\n            --epoch_heuristic_counter;\n            return;\n        }\n        // count the number of elements from the latest epoch which\n        // have not been erased.\n        uint32_t epoch_unused_count = 0;\n        for (uint32_t i = 0; i < size; ++i)\n            epoch_unused_count += epoch_flags[i] &&\n                                  !collection_flags.bit_is_set(i);\n        // If there are more non-deleted entries in the current epoch than the\n        // epoch size, then allow_erase on all elements in the old epoch (marked\n        // false) and move all elements in the current epoch to the old epoch\n        // but do not call allow_erase on their indices.\n        if (epoch_unused_count >= epoch_size) {\n            for (uint32_t i = 0; i < size; ++i)\n                if (epoch_flags[i])\n                    epoch_flags[i] = false;\n                else\n                    allow_erase(i);\n            epoch_heuristic_counter = epoch_size;\n        } else\n            // reset the epoch_heuristic_counter to next do a scan when worst\n            // case behavior (no intermittent erases) would exceed epoch size,\n            // with a reasonable minimum scan size.\n            // Ordinarily, we would have to sanity check std::min(epoch_size,\n            // epoch_unused_count), but we already know that `epoch_unused_count\n            // < epoch_size` in this branch\n            epoch_heuristic_counter = std::max(1u, std::max(epoch_size / 16,\n                        epoch_size - epoch_unused_count));\n    }\n\npublic:\n    /** You must always construct a cache with some elements via a subsequent\n     * call to setup or setup_bytes, otherwise operations may segfault.\n     */\n    cache() : table(), size(), collection_flags(0), epoch_flags(),\n    epoch_heuristic_counter(), epoch_size(), depth_limit(0), hash_function()\n    {\n    }\n\n    /** setup initializes the container to store no more than new_size\n     * elements.\n     *\n     * setup should only be called once.\n     *\n     * @param new_size the desired number of elements to store\n     * @returns the maximum number of elements storable\n     **/\n    uint32_t setup(uint32_t new_size)\n    {\n        // depth_limit must be at least one otherwise errors can occur.\n        depth_limit = static_cast<uint8_t>(std::log2(static_cast<float>(std::max((uint32_t)2, new_size))));\n        size = std::max<uint32_t>(2, new_size);\n        table.resize(size);\n        collection_flags.setup(size);\n        epoch_flags.resize(size);\n        // Set to 45% as described above\n        epoch_size = std::max((uint32_t)1, (45 * size) / 100);\n        // Initially set to wait for a whole epoch\n        epoch_heuristic_counter = epoch_size;\n        return size;\n    }\n\n    /** setup_bytes is a convenience function which accounts for internal memory\n     * usage when deciding how many elements to store. It isn't perfect because\n     * it doesn't account for any overhead (struct size, MallocUsage, collection\n     * and epoch flags). This was done to simplify selecting a power of two\n     * size. In the expected use case, an extra two bits per entry should be\n     * negligible compared to the size of the elements.\n     *\n     * @param bytes the approximate number of bytes to use for this data\n     * structure.\n     * @returns the maximum number of elements storable (see setup()\n     * documentation for more detail)\n     */\n    uint32_t setup_bytes(size_t bytes)\n    {\n        return setup(bytes/sizeof(Element));\n    }\n\n    /** insert loops at most depth_limit times trying to insert a hash\n     * at various locations in the table via a variant of the Cuckoo Algorithm\n     * with eight hash locations.\n     *\n     * It drops the last tried element if it runs out of depth before\n     * encountering an open slot.\n     *\n     * Thus\n     *\n     * insert(x);\n     * return contains(x, false);\n     *\n     * is not guaranteed to return true.\n     *\n     * @param e the element to insert\n     * @post one of the following: All previously inserted elements and e are\n     * now in the table, one previously inserted element is evicted from the\n     * table, the entry attempted to be inserted is evicted.\n     *\n     */\n    inline void insert(Element e)\n    {\n        epoch_check();\n        uint32_t last_loc = invalid();\n        bool last_epoch = true;\n        std::array<uint32_t, 8> locs = compute_hashes(e);\n        // Make sure we have not already inserted this element\n        // If we have, make sure that it does not get deleted\n        for (uint32_t loc : locs)\n            if (table[loc] == e) {\n                please_keep(loc);\n                epoch_flags[loc] = last_epoch;\n                return;\n            }\n        for (uint8_t depth = 0; depth < depth_limit; ++depth) {\n            // First try to insert to an empty slot, if one exists\n            for (uint32_t loc : locs) {\n                if (!collection_flags.bit_is_set(loc))\n                    continue;\n                table[loc] = std::move(e);\n                please_keep(loc);\n                epoch_flags[loc] = last_epoch;\n                return;\n            }\n            /** Swap with the element at the location that was\n            * not the last one looked at. Example:\n            *\n            * 1) On first iteration, last_loc == invalid(), find returns last, so\n            *    last_loc defaults to locs[0].\n            * 2) On further iterations, where last_loc == locs[k], last_loc will\n            *    go to locs[k+1 % 8], i.e., next of the 8 indices wrapping around\n            *    to 0 if needed.\n            *\n            * This prevents moving the element we just put in.\n            *\n            * The swap is not a move -- we must switch onto the evicted element\n            * for the next iteration.\n            */\n            last_loc = locs[(1 + (std::find(locs.begin(), locs.end(), last_loc) - locs.begin())) & 7];\n            std::swap(table[last_loc], e);\n            // Can't std::swap a std::vector<bool>::reference and a bool&.\n            bool epoch = last_epoch;\n            last_epoch = epoch_flags[last_loc];\n            epoch_flags[last_loc] = epoch;\n\n            // Recompute the locs -- unfortunately happens one too many times!\n            locs = compute_hashes(e);\n        }\n    }\n\n    /* contains iterates through the hash locations for a given element\n     * and checks to see if it is present.\n     *\n     * contains does not check garbage collected state (in other words,\n     * garbage is only collected when the space is needed), so:\n     *\n     * insert(x);\n     * if (contains(x, true))\n     *     return contains(x, false);\n     * else\n     *     return true;\n     *\n     * executed on a single thread will always return true!\n     *\n     * This is a great property for re-org performance for example.\n     *\n     * contains returns a bool set true if the element was found.\n     *\n     * @param e the element to check\n     * @param erase\n     *\n     * @post if erase is true and the element is found, then the garbage collect\n     * flag is set\n     * @returns true if the element is found, false otherwise\n     */\n    inline bool contains(const Element& e, const bool erase) const\n    {\n        std::array<uint32_t, 8> locs = compute_hashes(e);\n        for (uint32_t loc : locs)\n            if (table[loc] == e) {\n                if (erase)\n                    allow_erase(loc);\n                return true;\n            }\n        return false;\n    }\n};\n} // namespace CuckooCache\n\n#endif // BITCOIN_CUCKOOCACHE_H\n"
  },
  {
    "path": "src/dbwrapper.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <dbwrapper.h>\n\n#include <memory>\n#include <random.h>\n\n#include <leveldb/cache.h>\n#include <leveldb/env.h>\n#include <leveldb/filter_policy.h>\n#include <memenv.h>\n#include <stdint.h>\n#include <algorithm>\n\nclass CBitcoinLevelDBLogger : public leveldb::Logger {\npublic:\n    // This code is adapted from posix_logger.h, which is why it is using vsprintf.\n    // Please do not do this in normal code\n    void Logv(const char * format, va_list ap) override {\n            if (!LogAcceptCategory(BCLog::LEVELDB)) {\n                return;\n            }\n            char buffer[500];\n            for (int iter = 0; iter < 2; iter++) {\n                char* base;\n                int bufsize;\n                if (iter == 0) {\n                    bufsize = sizeof(buffer);\n                    base = buffer;\n                }\n                else {\n                    bufsize = 30000;\n                    base = new char[bufsize];\n                }\n                char* p = base;\n                char* limit = base + bufsize;\n\n                // Print the message\n                if (p < limit) {\n                    va_list backup_ap;\n                    va_copy(backup_ap, ap);\n                    // Do not use vsnprintf elsewhere in bitcoin source code, see above.\n                    p += vsnprintf(p, limit - p, format, backup_ap);\n                    va_end(backup_ap);\n                }\n\n                // Truncate to available space if necessary\n                if (p >= limit) {\n                    if (iter == 0) {\n                        continue;       // Try again with larger buffer\n                    }\n                    else {\n                        p = limit - 1;\n                    }\n                }\n\n                // Add newline if necessary\n                if (p == base || p[-1] != '\\n') {\n                    *p++ = '\\n';\n                }\n\n                assert(p <= limit);\n                base[std::min(bufsize - 1, (int)(p - base))] = '\\0';\n                LogPrintf(\"leveldb: %s\", base);\n                if (base != buffer) {\n                    delete[] base;\n                }\n                break;\n            }\n    }\n};\n\nstatic leveldb::Options GetOptions(size_t nCacheSize)\n{\n    leveldb::Options options;\n    options.block_cache = leveldb::NewLRUCache(nCacheSize / 2);\n    options.write_buffer_size = nCacheSize / 4; // up to two write buffers may be held in memory simultaneously\n    options.filter_policy = leveldb::NewBloomFilterPolicy(10);\n    options.compression = leveldb::kNoCompression;\n    options.max_open_files = 64;\n    options.info_log = new CBitcoinLevelDBLogger();\n    if (leveldb::kMajorVersion > 1 || (leveldb::kMajorVersion == 1 && leveldb::kMinorVersion >= 16)) {\n        // LevelDB versions before 1.16 consider short writes to be corruption. Only trigger error\n        // on corruption in later versions.\n        options.paranoid_checks = true;\n    }\n    return options;\n}\n\nCDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bool fWipe, bool obfuscate)\n{\n    penv = nullptr;\n    readoptions.verify_checksums = true;\n    iteroptions.verify_checksums = true;\n    iteroptions.fill_cache = false;\n    syncoptions.sync = true;\n    options = GetOptions(nCacheSize);\n    options.create_if_missing = true;\n    if (fMemory) {\n        penv = leveldb::NewMemEnv(leveldb::Env::Default());\n        options.env = penv;\n    } else {\n        if (fWipe) {\n            LogPrintf(\"Wiping LevelDB in %s\\n\", path.string());\n            leveldb::Status result = leveldb::DestroyDB(path.string(), options);\n            dbwrapper_private::HandleError(result);\n        }\n        TryCreateDirectories(path);\n        LogPrintf(\"Opening LevelDB in %s\\n\", path.string());\n    }\n    leveldb::Status status = leveldb::DB::Open(options, path.string(), &pdb);\n    dbwrapper_private::HandleError(status);\n    LogPrintf(\"Opened LevelDB successfully\\n\");\n\n    if (gArgs.GetBoolArg(\"-forcecompactdb\", false)) {\n        LogPrintf(\"Starting database compaction of %s\\n\", path.string());\n        pdb->CompactRange(nullptr, nullptr);\n        LogPrintf(\"Finished database compaction of %s\\n\", path.string());\n    }\n\n    // The base-case obfuscation key, which is a noop.\n    obfuscate_key = std::vector<unsigned char>(OBFUSCATE_KEY_NUM_BYTES, '\\000');\n\n    bool key_exists = Read(OBFUSCATE_KEY_KEY, obfuscate_key);\n\n    if (!key_exists && obfuscate && IsEmpty()) {\n        // Initialize non-degenerate obfuscation if it won't upset\n        // existing, non-obfuscated data.\n        std::vector<unsigned char> new_key = CreateObfuscateKey();\n\n        // Write `new_key` so we don't obfuscate the key with itself\n        Write(OBFUSCATE_KEY_KEY, new_key);\n        obfuscate_key = new_key;\n\n        LogPrintf(\"Wrote new obfuscate key for %s: %s\\n\", path.string(), HexStr(obfuscate_key));\n    }\n\n    LogPrintf(\"Using obfuscation key for %s: %s\\n\", path.string(), HexStr(obfuscate_key));\n}\n\nCDBWrapper::~CDBWrapper()\n{\n    delete pdb;\n    pdb = nullptr;\n    delete options.filter_policy;\n    options.filter_policy = nullptr;\n    delete options.info_log;\n    options.info_log = nullptr;\n    delete options.block_cache;\n    options.block_cache = nullptr;\n    delete penv;\n    options.env = nullptr;\n}\n\nbool CDBWrapper::WriteBatch(CDBBatch& batch, bool fSync)\n{\n    leveldb::Status status = pdb->Write(fSync ? syncoptions : writeoptions, &batch.batch);\n    dbwrapper_private::HandleError(status);\n    return true;\n}\n\n// Prefixed with null character to avoid collisions with other keys\n//\n// We must use a string constructor which specifies length so that we copy\n// past the null-terminator.\nconst std::string CDBWrapper::OBFUSCATE_KEY_KEY(\"\\000obfuscate_key\", 14);\n\nconst unsigned int CDBWrapper::OBFUSCATE_KEY_NUM_BYTES = 8;\n\n/**\n * Returns a string (consisting of 8 random bytes) suitable for use as an\n * obfuscating XOR key.\n */\nstd::vector<unsigned char> CDBWrapper::CreateObfuscateKey() const\n{\n    unsigned char buff[OBFUSCATE_KEY_NUM_BYTES];\n    GetRandBytes(buff, OBFUSCATE_KEY_NUM_BYTES);\n    return std::vector<unsigned char>(&buff[0], &buff[OBFUSCATE_KEY_NUM_BYTES]);\n\n}\n\nbool CDBWrapper::IsEmpty()\n{\n    std::unique_ptr<CDBIterator> it(NewIterator());\n    it->SeekToFirst();\n    return !(it->Valid());\n}\n\nCDBIterator::~CDBIterator() { delete piter; }\nbool CDBIterator::Valid() const { return piter->Valid(); }\nvoid CDBIterator::SeekToFirst() { piter->SeekToFirst(); }\nvoid CDBIterator::Next() { piter->Next(); }\n\nnamespace dbwrapper_private {\n\nvoid HandleError(const leveldb::Status& status)\n{\n    if (status.ok())\n        return;\n    LogPrintf(\"%s\\n\", status.ToString());\n    if (status.IsCorruption())\n        throw dbwrapper_error(\"Database corrupted\");\n    if (status.IsIOError())\n        throw dbwrapper_error(\"Database I/O error\");\n    if (status.IsNotFound())\n        throw dbwrapper_error(\"Database entry missing\");\n    throw dbwrapper_error(\"Unknown database error\");\n}\n\nconst std::vector<unsigned char>& GetObfuscateKey(const CDBWrapper &w)\n{\n    return w.obfuscate_key;\n}\n\n} // namespace dbwrapper_private\n"
  },
  {
    "path": "src/dbwrapper.h",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_DBWRAPPER_H\n#define BITCOIN_DBWRAPPER_H\n\n#include <clientversion.h>\n#include <fs.h>\n#include <serialize.h>\n#include <streams.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <version.h>\n\n#include <leveldb/db.h>\n#include <leveldb/write_batch.h>\n\nstatic const size_t DBWRAPPER_PREALLOC_KEY_SIZE = 64;\nstatic const size_t DBWRAPPER_PREALLOC_VALUE_SIZE = 1024;\n\nclass dbwrapper_error : public std::runtime_error\n{\npublic:\n    explicit dbwrapper_error(const std::string& msg) : std::runtime_error(msg) {}\n};\n\nclass CDBWrapper;\n\n/** These should be considered an implementation detail of the specific database.\n */\nnamespace dbwrapper_private {\n\n/** Handle database error by throwing dbwrapper_error exception.\n */\nvoid HandleError(const leveldb::Status& status);\n\n/** Work around circular dependency, as well as for testing in dbwrapper_tests.\n * Database obfuscation should be considered an implementation detail of the\n * specific database.\n */\nconst std::vector<unsigned char>& GetObfuscateKey(const CDBWrapper &w);\n\n};\n\n/** Batch of changes queued to be written to a CDBWrapper */\nclass CDBBatch\n{\n    friend class CDBWrapper;\n\nprivate:\n    const CDBWrapper &parent;\n    leveldb::WriteBatch batch;\n\n    CDataStream ssKey;\n    CDataStream ssValue;\n\n    size_t size_estimate;\n\npublic:\n    /**\n     * @param[in] _parent   CDBWrapper that this batch is to be submitted to\n     */\n    explicit CDBBatch(const CDBWrapper &_parent) : parent(_parent), ssKey(SER_DISK, CLIENT_VERSION), ssValue(SER_DISK, CLIENT_VERSION), size_estimate(0) { };\n\n    void Clear()\n    {\n        batch.Clear();\n        size_estimate = 0;\n    }\n\n    template <typename K, typename V>\n    void Write(const K& key, const V& value)\n    {\n        ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);\n        ssKey << key;\n        leveldb::Slice slKey(ssKey.data(), ssKey.size());\n\n        ssValue.reserve(DBWRAPPER_PREALLOC_VALUE_SIZE);\n        ssValue << value;\n        ssValue.Xor(dbwrapper_private::GetObfuscateKey(parent));\n        leveldb::Slice slValue(ssValue.data(), ssValue.size());\n\n        batch.Put(slKey, slValue);\n        // LevelDB serializes writes as:\n        // - byte: header\n        // - varint: key length (1 byte up to 127B, 2 bytes up to 16383B, ...)\n        // - byte[]: key\n        // - varint: value length\n        // - byte[]: value\n        // The formula below assumes the key and value are both less than 16k.\n        size_estimate += 3 + (slKey.size() > 127) + slKey.size() + (slValue.size() > 127) + slValue.size();\n        ssKey.clear();\n        ssValue.clear();\n    }\n\n    template <typename K>\n    void Erase(const K& key)\n    {\n        ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);\n        ssKey << key;\n        leveldb::Slice slKey(ssKey.data(), ssKey.size());\n\n        batch.Delete(slKey);\n        // LevelDB serializes erases as:\n        // - byte: header\n        // - varint: key length\n        // - byte[]: key\n        // The formula below assumes the key is less than 16kB.\n        size_estimate += 2 + (slKey.size() > 127) + slKey.size();\n        ssKey.clear();\n    }\n\n    size_t SizeEstimate() const { return size_estimate; }\n};\n\nclass CDBIterator\n{\nprivate:\n    const CDBWrapper &parent;\n    leveldb::Iterator *piter;\n\npublic:\n\n    /**\n     * @param[in] _parent          Parent CDBWrapper instance.\n     * @param[in] _piter           The original leveldb iterator.\n     */\n    CDBIterator(const CDBWrapper &_parent, leveldb::Iterator *_piter) :\n        parent(_parent), piter(_piter) { };\n    ~CDBIterator();\n\n    bool Valid() const;\n\n    void SeekToFirst();\n\n    template<typename K> void Seek(const K& key) {\n        CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n        ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);\n        ssKey << key;\n        leveldb::Slice slKey(ssKey.data(), ssKey.size());\n        piter->Seek(slKey);\n    }\n\n    void Next();\n\n    template<typename K> bool GetKey(K& key) {\n        leveldb::Slice slKey = piter->key();\n        try {\n            CDataStream ssKey(slKey.data(), slKey.data() + slKey.size(), SER_DISK, CLIENT_VERSION);\n            ssKey >> key;\n        } catch (const std::exception&) {\n            return false;\n        }\n        return true;\n    }\n\n    template<typename V> bool GetValue(V& value) {\n        leveldb::Slice slValue = piter->value();\n        try {\n            CDataStream ssValue(slValue.data(), slValue.data() + slValue.size(), SER_DISK, CLIENT_VERSION);\n            ssValue.Xor(dbwrapper_private::GetObfuscateKey(parent));\n            ssValue >> value;\n        } catch (const std::exception&) {\n            return false;\n        }\n        return true;\n    }\n\n    unsigned int GetValueSize() {\n        return piter->value().size();\n    }\n\n};\n\nclass CDBWrapper\n{\n    friend const std::vector<unsigned char>& dbwrapper_private::GetObfuscateKey(const CDBWrapper &w);\nprivate:\n    //! custom environment this database is using (may be nullptr in case of default environment)\n    leveldb::Env* penv;\n\n    //! database options used\n    leveldb::Options options;\n\n    //! options used when reading from the database\n    leveldb::ReadOptions readoptions;\n\n    //! options used when iterating over values of the database\n    leveldb::ReadOptions iteroptions;\n\n    //! options used when writing to the database\n    leveldb::WriteOptions writeoptions;\n\n    //! options used when sync writing to the database\n    leveldb::WriteOptions syncoptions;\n\n    //! the database itself\n    leveldb::DB* pdb;\n\n    //! a key used for optional XOR-obfuscation of the database\n    std::vector<unsigned char> obfuscate_key;\n\n    //! the key under which the obfuscation key is stored\n    static const std::string OBFUSCATE_KEY_KEY;\n\n    //! the length of the obfuscate key in number of bytes\n    static const unsigned int OBFUSCATE_KEY_NUM_BYTES;\n\n    std::vector<unsigned char> CreateObfuscateKey() const;\n\npublic:\n    /**\n     * @param[in] path        Location in the filesystem where leveldb data will be stored.\n     * @param[in] nCacheSize  Configures various leveldb cache settings.\n     * @param[in] fMemory     If true, use leveldb's memory environment.\n     * @param[in] fWipe       If true, remove all existing data.\n     * @param[in] obfuscate   If true, store data obfuscated via simple XOR. If false, XOR\n     *                        with a zero'd byte array.\n     */\n    CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory = false, bool fWipe = false, bool obfuscate = false);\n    ~CDBWrapper();\n\n    template <typename K, typename V>\n    bool Read(const K& key, V& value) const\n    {\n        CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n        ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);\n        ssKey << key;\n        leveldb::Slice slKey(ssKey.data(), ssKey.size());\n\n        std::string strValue;\n        leveldb::Status status = pdb->Get(readoptions, slKey, &strValue);\n        if (!status.ok()) {\n            if (status.IsNotFound())\n                return false;\n            LogPrintf(\"LevelDB read failure: %s\\n\", status.ToString());\n            dbwrapper_private::HandleError(status);\n        }\n        try {\n            CDataStream ssValue(strValue.data(), strValue.data() + strValue.size(), SER_DISK, CLIENT_VERSION);\n            ssValue.Xor(obfuscate_key);\n            ssValue >> value;\n        } catch (const std::exception&) {\n            return false;\n        }\n        return true;\n    }\n\n    template <typename K, typename V>\n    bool Write(const K& key, const V& value, bool fSync = false)\n    {\n        CDBBatch batch(*this);\n        batch.Write(key, value);\n        return WriteBatch(batch, fSync);\n    }\n\n    template <typename K>\n    bool Exists(const K& key) const\n    {\n        CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n        ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);\n        ssKey << key;\n        leveldb::Slice slKey(ssKey.data(), ssKey.size());\n\n        std::string strValue;\n        leveldb::Status status = pdb->Get(readoptions, slKey, &strValue);\n        if (!status.ok()) {\n            if (status.IsNotFound())\n                return false;\n            LogPrintf(\"LevelDB read failure: %s\\n\", status.ToString());\n            dbwrapper_private::HandleError(status);\n        }\n        return true;\n    }\n\n    template <typename K>\n    bool Erase(const K& key, bool fSync = false)\n    {\n        CDBBatch batch(*this);\n        batch.Erase(key);\n        return WriteBatch(batch, fSync);\n    }\n\n    bool WriteBatch(CDBBatch& batch, bool fSync = false);\n\n    // not available for LevelDB; provide for compatibility with BDB\n    bool Flush()\n    {\n        return true;\n    }\n\n    bool Sync()\n    {\n        CDBBatch batch(*this);\n        return WriteBatch(batch, true);\n    }\n\n    CDBIterator *NewIterator()\n    {\n        return new CDBIterator(*this, pdb->NewIterator(iteroptions));\n    }\n\n    /**\n     * Return true if the database managed by this class contains no entries.\n     */\n    bool IsEmpty();\n\n    template<typename K>\n    size_t EstimateSize(const K& key_begin, const K& key_end) const\n    {\n        CDataStream ssKey1(SER_DISK, CLIENT_VERSION), ssKey2(SER_DISK, CLIENT_VERSION);\n        ssKey1.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);\n        ssKey2.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);\n        ssKey1 << key_begin;\n        ssKey2 << key_end;\n        leveldb::Slice slKey1(ssKey1.data(), ssKey1.size());\n        leveldb::Slice slKey2(ssKey2.data(), ssKey2.size());\n        uint64_t size = 0;\n        leveldb::Range range(slKey1, slKey2);\n        pdb->GetApproximateSizes(&range, 1, &size);\n        return size;\n    }\n\n    /**\n     * Compact a certain range of keys in the database.\n     */\n    template<typename K>\n    void CompactRange(const K& key_begin, const K& key_end) const\n    {\n        CDataStream ssKey1(SER_DISK, CLIENT_VERSION), ssKey2(SER_DISK, CLIENT_VERSION);\n        ssKey1.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);\n        ssKey2.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);\n        ssKey1 << key_begin;\n        ssKey2 << key_end;\n        leveldb::Slice slKey1(ssKey1.data(), ssKey1.size());\n        leveldb::Slice slKey2(ssKey2.data(), ssKey2.size());\n        pdb->CompactRange(&slKey1, &slKey2);\n    }\n\n};\n\n#endif // BITCOIN_DBWRAPPER_H\n"
  },
  {
    "path": "src/fs.cpp",
    "content": "#include <fs.h>\n\nnamespace fsbridge {\n\nFILE *fopen(const fs::path& p, const char *mode)\n{\n    return ::fopen(p.string().c_str(), mode);\n}\n\nFILE *freopen(const fs::path& p, const char *mode, FILE *stream)\n{\n    return ::freopen(p.string().c_str(), mode, stream);\n}\n\n} // fsbridge\n"
  },
  {
    "path": "src/fs.h",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_FS_H\n#define BITCOIN_FS_H\n\n#include <stdio.h>\n#include <string>\n\n#include <boost/filesystem.hpp>\n#include <boost/filesystem/fstream.hpp>\n\n#ifdef WIN32\n#include <boost/filesystem/detail/utf8_codecvt_facet.hpp>\n#endif\n\n/** Filesystem operations and types */\nnamespace fs = boost::filesystem;\n\n/** Bridge operations to C stdio */\nnamespace fsbridge {\n    FILE *fopen(const fs::path& p, const char *mode);\n    FILE *freopen(const fs::path& p, const char *mode, FILE *stream);\n};\n\n#endif // BITCOIN_FS_H\n"
  },
  {
    "path": "src/hash.cpp",
    "content": "// Copyright (c) 2013-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <hash.h>\n#include <crypto/common.h>\n#include <crypto/hmac_sha512.h>\n\n\ninline uint32_t ROTL32(uint32_t x, int8_t r)\n{\n    return (x << r) | (x >> (32 - r));\n}\n\nunsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char>& vDataToHash)\n{\n    // The following is MurmurHash3 (x86_32), see http://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp\n    uint32_t h1 = nHashSeed;\n    const uint32_t c1 = 0xcc9e2d51;\n    const uint32_t c2 = 0x1b873593;\n\n    const int nblocks = vDataToHash.size() / 4;\n\n    //----------\n    // body\n    const uint8_t* blocks = vDataToHash.data();\n\n    for (int i = 0; i < nblocks; ++i) {\n        uint32_t k1 = ReadLE32(blocks + i*4);\n\n        k1 *= c1;\n        k1 = ROTL32(k1, 15);\n        k1 *= c2;\n\n        h1 ^= k1;\n        h1 = ROTL32(h1, 13);\n        h1 = h1 * 5 + 0xe6546b64;\n    }\n\n    //----------\n    // tail\n    const uint8_t* tail = vDataToHash.data() + nblocks * 4;\n\n    uint32_t k1 = 0;\n\n    switch (vDataToHash.size() & 3) {\n        case 3:\n            k1 ^= tail[2] << 16;\n        case 2:\n            k1 ^= tail[1] << 8;\n        case 1:\n            k1 ^= tail[0];\n            k1 *= c1;\n            k1 = ROTL32(k1, 15);\n            k1 *= c2;\n            h1 ^= k1;\n    }\n\n    //----------\n    // finalization\n    h1 ^= vDataToHash.size();\n    h1 ^= h1 >> 16;\n    h1 *= 0x85ebca6b;\n    h1 ^= h1 >> 13;\n    h1 *= 0xc2b2ae35;\n    h1 ^= h1 >> 16;\n\n    return h1;\n}\n\nvoid BIP32Hash(const ChainCode &chainCode, unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64])\n{\n    unsigned char num[4];\n    num[0] = (nChild >> 24) & 0xFF;\n    num[1] = (nChild >> 16) & 0xFF;\n    num[2] = (nChild >>  8) & 0xFF;\n    num[3] = (nChild >>  0) & 0xFF;\n    CHMAC_SHA512(chainCode.begin(), chainCode.size()).Write(&header, 1).Write(data, 32).Write(num, 4).Finalize(output);\n}\n\n#define ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))\n\n#define SIPROUND do { \\\n    v0 += v1; v1 = ROTL(v1, 13); v1 ^= v0; \\\n    v0 = ROTL(v0, 32); \\\n    v2 += v3; v3 = ROTL(v3, 16); v3 ^= v2; \\\n    v0 += v3; v3 = ROTL(v3, 21); v3 ^= v0; \\\n    v2 += v1; v1 = ROTL(v1, 17); v1 ^= v2; \\\n    v2 = ROTL(v2, 32); \\\n} while (0)\n\nCSipHasher::CSipHasher(uint64_t k0, uint64_t k1)\n{\n    v[0] = 0x736f6d6570736575ULL ^ k0;\n    v[1] = 0x646f72616e646f6dULL ^ k1;\n    v[2] = 0x6c7967656e657261ULL ^ k0;\n    v[3] = 0x7465646279746573ULL ^ k1;\n    count = 0;\n    tmp = 0;\n}\n\nCSipHasher& CSipHasher::Write(uint64_t data)\n{\n    uint64_t v0 = v[0], v1 = v[1], v2 = v[2], v3 = v[3];\n\n    assert(count % 8 == 0);\n\n    v3 ^= data;\n    SIPROUND;\n    SIPROUND;\n    v0 ^= data;\n\n    v[0] = v0;\n    v[1] = v1;\n    v[2] = v2;\n    v[3] = v3;\n\n    count += 8;\n    return *this;\n}\n\nCSipHasher& CSipHasher::Write(const unsigned char* data, size_t size)\n{\n    uint64_t v0 = v[0], v1 = v[1], v2 = v[2], v3 = v[3];\n    uint64_t t = tmp;\n    int c = count;\n\n    while (size--) {\n        t |= ((uint64_t)(*(data++))) << (8 * (c % 8));\n        c++;\n        if ((c & 7) == 0) {\n            v3 ^= t;\n            SIPROUND;\n            SIPROUND;\n            v0 ^= t;\n            t = 0;\n        }\n    }\n\n    v[0] = v0;\n    v[1] = v1;\n    v[2] = v2;\n    v[3] = v3;\n    count = c;\n    tmp = t;\n\n    return *this;\n}\n\nuint64_t CSipHasher::Finalize() const\n{\n    uint64_t v0 = v[0], v1 = v[1], v2 = v[2], v3 = v[3];\n\n    uint64_t t = tmp | (((uint64_t)count) << 56);\n\n    v3 ^= t;\n    SIPROUND;\n    SIPROUND;\n    v0 ^= t;\n    v2 ^= 0xFF;\n    SIPROUND;\n    SIPROUND;\n    SIPROUND;\n    SIPROUND;\n    return v0 ^ v1 ^ v2 ^ v3;\n}\n\nuint64_t SipHashUint256(uint64_t k0, uint64_t k1, const uint256& val)\n{\n    /* Specialized implementation for efficiency */\n    uint64_t d = val.GetUint64(0);\n\n    uint64_t v0 = 0x736f6d6570736575ULL ^ k0;\n    uint64_t v1 = 0x646f72616e646f6dULL ^ k1;\n    uint64_t v2 = 0x6c7967656e657261ULL ^ k0;\n    uint64_t v3 = 0x7465646279746573ULL ^ k1 ^ d;\n\n    SIPROUND;\n    SIPROUND;\n    v0 ^= d;\n    d = val.GetUint64(1);\n    v3 ^= d;\n    SIPROUND;\n    SIPROUND;\n    v0 ^= d;\n    d = val.GetUint64(2);\n    v3 ^= d;\n    SIPROUND;\n    SIPROUND;\n    v0 ^= d;\n    d = val.GetUint64(3);\n    v3 ^= d;\n    SIPROUND;\n    SIPROUND;\n    v0 ^= d;\n    v3 ^= ((uint64_t)4) << 59;\n    SIPROUND;\n    SIPROUND;\n    v0 ^= ((uint64_t)4) << 59;\n    v2 ^= 0xFF;\n    SIPROUND;\n    SIPROUND;\n    SIPROUND;\n    SIPROUND;\n    return v0 ^ v1 ^ v2 ^ v3;\n}\n\nuint64_t SipHashUint256Extra(uint64_t k0, uint64_t k1, const uint256& val, uint32_t extra)\n{\n    /* Specialized implementation for efficiency */\n    uint64_t d = val.GetUint64(0);\n\n    uint64_t v0 = 0x736f6d6570736575ULL ^ k0;\n    uint64_t v1 = 0x646f72616e646f6dULL ^ k1;\n    uint64_t v2 = 0x6c7967656e657261ULL ^ k0;\n    uint64_t v3 = 0x7465646279746573ULL ^ k1 ^ d;\n\n    SIPROUND;\n    SIPROUND;\n    v0 ^= d;\n    d = val.GetUint64(1);\n    v3 ^= d;\n    SIPROUND;\n    SIPROUND;\n    v0 ^= d;\n    d = val.GetUint64(2);\n    v3 ^= d;\n    SIPROUND;\n    SIPROUND;\n    v0 ^= d;\n    d = val.GetUint64(3);\n    v3 ^= d;\n    SIPROUND;\n    SIPROUND;\n    v0 ^= d;\n    d = (((uint64_t)36) << 56) | extra;\n    v3 ^= d;\n    SIPROUND;\n    SIPROUND;\n    v0 ^= d;\n    v2 ^= 0xFF;\n    SIPROUND;\n    SIPROUND;\n    SIPROUND;\n    SIPROUND;\n    return v0 ^ v1 ^ v2 ^ v3;\n}\n"
  },
  {
    "path": "src/hash.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_HASH_H\n#define BITCOIN_HASH_H\n\n#include <crypto/ripemd160.h>\n#include <crypto/sha256.h>\n#include <prevector.h>\n#include <serialize.h>\n#include <uint256.h>\n#include <version.h>\n\n#include <vector>\n\ntypedef uint256 ChainCode;\n\n/** A hasher class for Bitcoin's 256-bit hash (double SHA-256). */\nclass CHash256 {\nprivate:\n    CSHA256 sha;\npublic:\n    static const size_t OUTPUT_SIZE = CSHA256::OUTPUT_SIZE;\n\n    void Finalize(unsigned char hash[OUTPUT_SIZE]) {\n        unsigned char buf[CSHA256::OUTPUT_SIZE];\n        sha.Finalize(buf);\n        sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(hash);\n    }\n\n    CHash256& Write(const unsigned char *data, size_t len) {\n        sha.Write(data, len);\n        return *this;\n    }\n\n    CHash256& Reset() {\n        sha.Reset();\n        return *this;\n    }\n};\n\n/** A hasher class for Bitcoin's 160-bit hash (SHA-256 + RIPEMD-160). */\nclass CHash160 {\nprivate:\n    CSHA256 sha;\npublic:\n    static const size_t OUTPUT_SIZE = CRIPEMD160::OUTPUT_SIZE;\n\n    void Finalize(unsigned char hash[OUTPUT_SIZE]) {\n        unsigned char buf[CSHA256::OUTPUT_SIZE];\n        sha.Finalize(buf);\n        CRIPEMD160().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(hash);\n    }\n\n    CHash160& Write(const unsigned char *data, size_t len) {\n        sha.Write(data, len);\n        return *this;\n    }\n\n    CHash160& Reset() {\n        sha.Reset();\n        return *this;\n    }\n};\n\n/** Compute the 256-bit hash of an object. */\ntemplate<typename T1>\ninline uint256 Hash(const T1 pbegin, const T1 pend)\n{\n    static const unsigned char pblank[1] = {};\n    uint256 result;\n    CHash256().Write(pbegin == pend ? pblank : (const unsigned char*)&pbegin[0], (pend - pbegin) * sizeof(pbegin[0]))\n              .Finalize((unsigned char*)&result);\n    return result;\n}\n\n/** Compute the 256-bit hash of the concatenation of two objects. */\ntemplate<typename T1, typename T2>\ninline uint256 Hash(const T1 p1begin, const T1 p1end,\n                    const T2 p2begin, const T2 p2end) {\n    static const unsigned char pblank[1] = {};\n    uint256 result;\n    CHash256().Write(p1begin == p1end ? pblank : (const unsigned char*)&p1begin[0], (p1end - p1begin) * sizeof(p1begin[0]))\n              .Write(p2begin == p2end ? pblank : (const unsigned char*)&p2begin[0], (p2end - p2begin) * sizeof(p2begin[0]))\n              .Finalize((unsigned char*)&result);\n    return result;\n}\n\n/** Compute the 160-bit hash an object. */\ntemplate<typename T1>\ninline uint160 Hash160(const T1 pbegin, const T1 pend)\n{\n    static unsigned char pblank[1] = {};\n    uint160 result;\n    CHash160().Write(pbegin == pend ? pblank : (const unsigned char*)&pbegin[0], (pend - pbegin) * sizeof(pbegin[0]))\n              .Finalize((unsigned char*)&result);\n    return result;\n}\n\n/** Compute the 160-bit hash of a vector. */\ninline uint160 Hash160(const std::vector<unsigned char>& vch)\n{\n    return Hash160(vch.begin(), vch.end());\n}\n\n/** Compute the 160-bit hash of a vector. */\ntemplate<unsigned int N>\ninline uint160 Hash160(const prevector<N, unsigned char>& vch)\n{\n    return Hash160(vch.begin(), vch.end());\n}\n\n/** A writer stream (for serialization) that computes a 256-bit hash. */\nclass CHashWriter\n{\nprivate:\n    CHash256 ctx;\n\n    const int nType;\n    const int nVersion;\npublic:\n\n    CHashWriter(int nTypeIn, int nVersionIn) : nType(nTypeIn), nVersion(nVersionIn) {}\n\n    int GetType() const { return nType; }\n    int GetVersion() const { return nVersion; }\n\n    void write(const char *pch, size_t size) {\n        ctx.Write((const unsigned char*)pch, size);\n    }\n\n    // invalidates the object\n    uint256 GetHash() {\n        uint256 result;\n        ctx.Finalize((unsigned char*)&result);\n        return result;\n    }\n\n    template<typename T>\n    CHashWriter& operator<<(const T& obj) {\n        // Serialize to this stream\n        ::Serialize(*this, obj);\n        return (*this);\n    }\n};\n\n/** Reads data from an underlying stream, while hashing the read data. */\ntemplate<typename Source>\nclass CHashVerifier : public CHashWriter\n{\nprivate:\n    Source* source;\n\npublic:\n    explicit CHashVerifier(Source* source_) : CHashWriter(source_->GetType(), source_->GetVersion()), source(source_) {}\n\n    void read(char* pch, size_t nSize)\n    {\n        source->read(pch, nSize);\n        this->write(pch, nSize);\n    }\n\n    void ignore(size_t nSize)\n    {\n        char data[1024];\n        while (nSize > 0) {\n            size_t now = std::min<size_t>(nSize, 1024);\n            read(data, now);\n            nSize -= now;\n        }\n    }\n\n    template<typename T>\n    CHashVerifier<Source>& operator>>(T& obj)\n    {\n        // Unserialize from this stream\n        ::Unserialize(*this, obj);\n        return (*this);\n    }\n};\n\n/** Compute the 256-bit hash of an object's serialization. */\ntemplate<typename T>\nuint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)\n{\n    CHashWriter ss(nType, nVersion);\n    ss << obj;\n    return ss.GetHash();\n}\n\nunsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char>& vDataToHash);\n\nvoid BIP32Hash(const ChainCode &chainCode, unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64]);\n\n/** SipHash-2-4 */\nclass CSipHasher\n{\nprivate:\n    uint64_t v[4];\n    uint64_t tmp;\n    int count;\n\npublic:\n    /** Construct a SipHash calculator initialized with 128-bit key (k0, k1) */\n    CSipHasher(uint64_t k0, uint64_t k1);\n    /** Hash a 64-bit integer worth of data\n     *  It is treated as if this was the little-endian interpretation of 8 bytes.\n     *  This function can only be used when a multiple of 8 bytes have been written so far.\n     */\n    CSipHasher& Write(uint64_t data);\n    /** Hash arbitrary bytes. */\n    CSipHasher& Write(const unsigned char* data, size_t size);\n    /** Compute the 64-bit SipHash-2-4 of the data written so far. The object remains untouched. */\n    uint64_t Finalize() const;\n};\n\n/** Optimized SipHash-2-4 implementation for uint256.\n *\n *  It is identical to:\n *    SipHasher(k0, k1)\n *      .Write(val.GetUint64(0))\n *      .Write(val.GetUint64(1))\n *      .Write(val.GetUint64(2))\n *      .Write(val.GetUint64(3))\n *      .Finalize()\n */\nuint64_t SipHashUint256(uint64_t k0, uint64_t k1, const uint256& val);\nuint64_t SipHashUint256Extra(uint64_t k0, uint64_t k1, const uint256& val, uint32_t extra);\n\n#endif // BITCOIN_HASH_H\n"
  },
  {
    "path": "src/httprpc.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <httprpc.h>\n\n#include <base58.h>\n#include <chainparams.h>\n#include <httpserver.h>\n#include <rpc/protocol.h>\n#include <rpc/server.h>\n#include <random.h>\n#include <sync.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <ui_interface.h>\n#include <crypto/hmac_sha256.h>\n#include <stdio.h>\n\n#include <memory>\n\n#include <boost/algorithm/string.hpp> // boost::trim\n\n/** WWW-Authenticate to present with 401 Unauthorized response */\nstatic const char* WWW_AUTH_HEADER_DATA = \"Basic realm=\\\"jsonrpc\\\"\";\n\n/** Simple one-shot callback timer to be used by the RPC mechanism to e.g.\n * re-lock the wallet.\n */\nclass HTTPRPCTimer : public RPCTimerBase\n{\npublic:\n    HTTPRPCTimer(struct event_base* eventBase, std::function<void(void)>& func, int64_t millis) :\n        ev(eventBase, false, func)\n    {\n        struct timeval tv;\n        tv.tv_sec = millis/1000;\n        tv.tv_usec = (millis%1000)*1000;\n        ev.trigger(&tv);\n    }\nprivate:\n    HTTPEvent ev;\n};\n\nclass HTTPRPCTimerInterface : public RPCTimerInterface\n{\npublic:\n    explicit HTTPRPCTimerInterface(struct event_base* _base) : base(_base)\n    {\n    }\n    const char* Name() override\n    {\n        return \"HTTP\";\n    }\n    RPCTimerBase* NewTimer(std::function<void(void)>& func, int64_t millis) override\n    {\n        return new HTTPRPCTimer(base, func, millis);\n    }\nprivate:\n    struct event_base* base;\n};\n\n\n/* Pre-base64-encoded authentication token */\nstatic std::string strRPCUserColonPass;\n/* Stored RPC timer interface (for unregistration) */\nstatic std::unique_ptr<HTTPRPCTimerInterface> httpRPCTimerInterface;\n\nstatic void JSONErrorReply(HTTPRequest* req, const UniValue& objError, const UniValue& id)\n{\n    // Send error reply from json-rpc error object\n    int nStatus = HTTP_INTERNAL_SERVER_ERROR;\n    int code = find_value(objError, \"code\").get_int();\n\n    if (code == RPC_INVALID_REQUEST)\n        nStatus = HTTP_BAD_REQUEST;\n    else if (code == RPC_METHOD_NOT_FOUND)\n        nStatus = HTTP_NOT_FOUND;\n\n    std::string strReply = JSONRPCReply(NullUniValue, objError, id);\n\n    req->WriteHeader(\"Content-Type\", \"application/json\");\n    req->WriteReply(nStatus, strReply);\n}\n\n//This function checks username and password against -rpcauth\n//entries from config file.\nstatic bool multiUserAuthorized(std::string strUserPass)\n{    \n    if (strUserPass.find(':') == std::string::npos) {\n        return false;\n    }\n    std::string strUser = strUserPass.substr(0, strUserPass.find(':'));\n    std::string strPass = strUserPass.substr(strUserPass.find(':') + 1);\n\n    for (const std::string& strRPCAuth : gArgs.GetArgs(\"-rpcauth\")) {\n        //Search for multi-user login/pass \"rpcauth\" from config\n        std::vector<std::string> vFields;\n        boost::split(vFields, strRPCAuth, boost::is_any_of(\":$\"));\n        if (vFields.size() != 3) {\n            //Incorrect formatting in config file\n            continue;\n        }\n\n        std::string strName = vFields[0];\n        if (!TimingResistantEqual(strName, strUser)) {\n            continue;\n        }\n\n        std::string strSalt = vFields[1];\n        std::string strHash = vFields[2];\n\n        static const unsigned int KEY_SIZE = 32;\n        unsigned char out[KEY_SIZE];\n\n        CHMAC_SHA256(reinterpret_cast<const unsigned char*>(strSalt.c_str()), strSalt.size()).Write(reinterpret_cast<const unsigned char*>(strPass.c_str()), strPass.size()).Finalize(out);\n        std::vector<unsigned char> hexvec(out, out+KEY_SIZE);\n        std::string strHashFromPass = HexStr(hexvec);\n\n        if (TimingResistantEqual(strHashFromPass, strHash)) {\n            return true;\n        }\n    }\n    return false;\n}\n\nstatic bool RPCAuthorized(const std::string& strAuth, std::string& strAuthUsernameOut)\n{\n    if (strRPCUserColonPass.empty()) // Belt-and-suspenders measure if InitRPCAuthentication was not called\n        return false;\n    if (strAuth.substr(0, 6) != \"Basic \")\n        return false;\n    std::string strUserPass64 = strAuth.substr(6);\n    boost::trim(strUserPass64);\n    std::string strUserPass = DecodeBase64(strUserPass64);\n\n    if (strUserPass.find(':') != std::string::npos)\n        strAuthUsernameOut = strUserPass.substr(0, strUserPass.find(':'));\n\n    //Check if authorized under single-user field\n    if (TimingResistantEqual(strUserPass, strRPCUserColonPass)) {\n        return true;\n    }\n    return multiUserAuthorized(strUserPass);\n}\n\nstatic bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)\n{\n    // JSONRPC handles only POST\n    if (req->GetRequestMethod() != HTTPRequest::POST) {\n        req->WriteReply(HTTP_BAD_METHOD, \"JSONRPC server handles only POST requests\");\n        return false;\n    }\n    // Check authorization\n    std::pair<bool, std::string> authHeader = req->GetHeader(\"authorization\");\n    if (!authHeader.first) {\n        req->WriteHeader(\"WWW-Authenticate\", WWW_AUTH_HEADER_DATA);\n        req->WriteReply(HTTP_UNAUTHORIZED);\n        return false;\n    }\n\n    JSONRPCRequest jreq;\n    if (!RPCAuthorized(authHeader.second, jreq.authUser)) {\n        LogPrintf(\"ThreadRPCServer incorrect password attempt from %s\\n\", req->GetPeer().ToString());\n\n        /* Deter brute-forcing\n           If this results in a DoS the user really\n           shouldn't have their RPC port exposed. */\n        MilliSleep(250);\n\n        req->WriteHeader(\"WWW-Authenticate\", WWW_AUTH_HEADER_DATA);\n        req->WriteReply(HTTP_UNAUTHORIZED);\n        return false;\n    }\n\n    try {\n        // Parse request\n        UniValue valRequest;\n        if (!valRequest.read(req->ReadBody()))\n            throw JSONRPCError(RPC_PARSE_ERROR, \"Parse error\");\n\n        // Set the URI\n        jreq.URI = req->GetURI();\n\n        std::string strReply;\n        // singleton request\n        if (valRequest.isObject()) {\n            jreq.parse(valRequest);\n\n            UniValue result = tableRPC.execute(jreq);\n\n            // Send reply\n            strReply = JSONRPCReply(result, NullUniValue, jreq.id);\n\n        // array of requests\n        } else if (valRequest.isArray())\n            strReply = JSONRPCExecBatch(jreq, valRequest.get_array());\n        else\n            throw JSONRPCError(RPC_PARSE_ERROR, \"Top-level object parse error\");\n\n        req->WriteHeader(\"Content-Type\", \"application/json\");\n        req->WriteReply(HTTP_OK, strReply);\n    } catch (const UniValue& objError) {\n        JSONErrorReply(req, objError, jreq.id);\n        return false;\n    } catch (const std::exception& e) {\n        JSONErrorReply(req, JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id);\n        return false;\n    }\n    return true;\n}\n\nstatic bool InitRPCAuthentication()\n{\n    if (gArgs.GetArg(\"-rpcpassword\", \"\") == \"\")\n    {\n        LogPrintf(\"No rpcpassword set - using random cookie authentication\\n\");\n        if (!GenerateAuthCookie(&strRPCUserColonPass)) {\n            uiInterface.ThreadSafeMessageBox(\n                _(\"Error: A fatal internal error occurred, see debug.log for details\"), // Same message as AbortNode\n                \"\", CClientUIInterface::MSG_ERROR);\n            return false;\n        }\n    } else {\n        LogPrintf(\"Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcuser for rpcauth auth generation.\\n\");\n        strRPCUserColonPass = gArgs.GetArg(\"-rpcuser\", \"\") + \":\" + gArgs.GetArg(\"-rpcpassword\", \"\");\n    }\n    return true;\n}\n\nbool StartHTTPRPC()\n{\n    LogPrint(BCLog::RPC, \"Starting HTTP RPC server\\n\");\n    if (!InitRPCAuthentication())\n        return false;\n\n    RegisterHTTPHandler(\"/\", true, HTTPReq_JSONRPC);\n#ifdef ENABLE_WALLET\n    // ifdef can be removed once we switch to better endpoint support and API versioning\n    RegisterHTTPHandler(\"/wallet/\", false, HTTPReq_JSONRPC);\n#endif\n    assert(EventBase());\n    httpRPCTimerInterface = MakeUnique<HTTPRPCTimerInterface>(EventBase());\n    RPCSetTimerInterface(httpRPCTimerInterface.get());\n    return true;\n}\n\nvoid InterruptHTTPRPC()\n{\n    LogPrint(BCLog::RPC, \"Interrupting HTTP RPC server\\n\");\n}\n\nvoid StopHTTPRPC()\n{\n    LogPrint(BCLog::RPC, \"Stopping HTTP RPC server\\n\");\n    UnregisterHTTPHandler(\"/\", true);\n    if (httpRPCTimerInterface) {\n        RPCUnsetTimerInterface(httpRPCTimerInterface.get());\n        httpRPCTimerInterface.reset();\n    }\n}\n"
  },
  {
    "path": "src/httprpc.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_HTTPRPC_H\n#define BITCOIN_HTTPRPC_H\n\n#include <string>\n#include <map>\n\n/** Start HTTP RPC subsystem.\n * Precondition; HTTP and RPC has been started.\n */\nbool StartHTTPRPC();\n/** Interrupt HTTP RPC subsystem.\n */\nvoid InterruptHTTPRPC();\n/** Stop HTTP RPC subsystem.\n * Precondition; HTTP and RPC has been stopped.\n */\nvoid StopHTTPRPC();\n\n/** Start HTTP REST subsystem.\n * Precondition; HTTP and RPC has been started.\n */\nbool StartREST();\n/** Interrupt RPC REST subsystem.\n */\nvoid InterruptREST();\n/** Stop HTTP REST subsystem.\n * Precondition; HTTP and RPC has been stopped.\n */\nvoid StopREST();\n\n#endif\n"
  },
  {
    "path": "src/httpserver.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <httpserver.h>\n\n#include <chainparamsbase.h>\n#include <compat.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <netbase.h>\n#include <rpc/protocol.h> // For HTTP status codes\n#include <sync.h>\n#include <ui_interface.h>\n\n#include <memory>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include <sys/types.h>\n#include <sys/stat.h>\n#include <signal.h>\n#include <future>\n\n#include <event2/thread.h>\n#include <event2/buffer.h>\n#include <event2/bufferevent.h>\n#include <event2/util.h>\n#include <event2/keyvalq_struct.h>\n\n#include <support/events.h>\n\n#ifdef EVENT__HAVE_NETINET_IN_H\n#include <netinet/in.h>\n#ifdef _XOPEN_SOURCE_EXTENDED\n#include <arpa/inet.h>\n#endif\n#endif\n\n/** Maximum size of http request (request line + headers) */\nstatic const size_t MAX_HEADERS_SIZE = 8192;\n\n/** HTTP request work item */\nclass HTTPWorkItem final : public HTTPClosure\n{\npublic:\n    HTTPWorkItem(std::unique_ptr<HTTPRequest> _req, const std::string &_path, const HTTPRequestHandler& _func):\n        req(std::move(_req)), path(_path), func(_func)\n    {\n    }\n    void operator()() override\n    {\n        func(req.get(), path);\n    }\n\n    std::unique_ptr<HTTPRequest> req;\n\nprivate:\n    std::string path;\n    HTTPRequestHandler func;\n};\n\n/** Simple work queue for distributing work over multiple threads.\n * Work items are simply callable objects.\n */\ntemplate <typename WorkItem>\nclass WorkQueue\n{\nprivate:\n    /** Mutex protects entire object */\n    std::mutex cs;\n    std::condition_variable cond;\n    std::deque<std::unique_ptr<WorkItem>> queue;\n    bool running;\n    size_t maxDepth;\n\npublic:\n    explicit WorkQueue(size_t _maxDepth) : running(true),\n                                 maxDepth(_maxDepth)\n    {\n    }\n    /** Precondition: worker threads have all stopped (they have been joined).\n     */\n    ~WorkQueue()\n    {\n    }\n    /** Enqueue a work item */\n    bool Enqueue(WorkItem* item)\n    {\n        std::unique_lock<std::mutex> lock(cs);\n        if (queue.size() >= maxDepth) {\n            return false;\n        }\n        queue.emplace_back(std::unique_ptr<WorkItem>(item));\n        cond.notify_one();\n        return true;\n    }\n    /** Thread function */\n    void Run()\n    {\n        while (true) {\n            std::unique_ptr<WorkItem> i;\n            {\n                std::unique_lock<std::mutex> lock(cs);\n                while (running && queue.empty())\n                    cond.wait(lock);\n                if (!running)\n                    break;\n                i = std::move(queue.front());\n                queue.pop_front();\n            }\n            (*i)();\n        }\n    }\n    /** Interrupt and exit loops */\n    void Interrupt()\n    {\n        std::unique_lock<std::mutex> lock(cs);\n        running = false;\n        cond.notify_all();\n    }\n};\n\nstruct HTTPPathHandler\n{\n    HTTPPathHandler() {}\n    HTTPPathHandler(std::string _prefix, bool _exactMatch, HTTPRequestHandler _handler):\n        prefix(_prefix), exactMatch(_exactMatch), handler(_handler)\n    {\n    }\n    std::string prefix;\n    bool exactMatch;\n    HTTPRequestHandler handler;\n};\n\n/** HTTP module state */\n\n//! libevent event loop\nstatic struct event_base* eventBase = nullptr;\n//! HTTP server\nstruct evhttp* eventHTTP = nullptr;\n//! List of subnets to allow RPC connections from\nstatic std::vector<CSubNet> rpc_allow_subnets;\n//! Work queue for handling longer requests off the event loop thread\nstatic WorkQueue<HTTPClosure>* workQueue = nullptr;\n//! Handlers for (sub)paths\nstd::vector<HTTPPathHandler> pathHandlers;\n//! Bound listening sockets\nstd::vector<evhttp_bound_socket *> boundSockets;\n\n/** Check if a network address is allowed to access the HTTP server */\nstatic bool ClientAllowed(const CNetAddr& netaddr)\n{\n    if (!netaddr.IsValid())\n        return false;\n    for(const CSubNet& subnet : rpc_allow_subnets)\n        if (subnet.Match(netaddr))\n            return true;\n    return false;\n}\n\n/** Initialize ACL list for HTTP server */\nstatic bool InitHTTPAllowList()\n{\n    rpc_allow_subnets.clear();\n    CNetAddr localv4;\n    CNetAddr localv6;\n    LookupHost(\"127.0.0.1\", localv4, false);\n    LookupHost(\"::1\", localv6, false);\n    rpc_allow_subnets.push_back(CSubNet(localv4, 8));      // always allow IPv4 local subnet\n    rpc_allow_subnets.push_back(CSubNet(localv6));         // always allow IPv6 localhost\n    for (const std::string& strAllow : gArgs.GetArgs(\"-rpcallowip\")) {\n        CSubNet subnet;\n        LookupSubNet(strAllow.c_str(), subnet);\n        if (!subnet.IsValid()) {\n            uiInterface.ThreadSafeMessageBox(\n                strprintf(\"Invalid -rpcallowip subnet specification: %s. Valid are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24).\", strAllow),\n                \"\", CClientUIInterface::MSG_ERROR);\n            return false;\n        }\n        rpc_allow_subnets.push_back(subnet);\n    }\n    std::string strAllowed;\n    for (const CSubNet& subnet : rpc_allow_subnets)\n        strAllowed += subnet.ToString() + \" \";\n    LogPrint(BCLog::HTTP, \"Allowing HTTP connections from: %s\\n\", strAllowed);\n    return true;\n}\n\n/** HTTP request method as string - use for logging only */\nstatic std::string RequestMethodString(HTTPRequest::RequestMethod m)\n{\n    switch (m) {\n    case HTTPRequest::GET:\n        return \"GET\";\n        break;\n    case HTTPRequest::POST:\n        return \"POST\";\n        break;\n    case HTTPRequest::HEAD:\n        return \"HEAD\";\n        break;\n    case HTTPRequest::PUT:\n        return \"PUT\";\n        break;\n    default:\n        return \"unknown\";\n    }\n}\n\n/** HTTP request callback */\nstatic void http_request_cb(struct evhttp_request* req, void* arg)\n{\n    // Disable reading to work around a libevent bug, fixed in 2.2.0.\n    if (event_get_version_number() >= 0x02010600 && event_get_version_number() < 0x02020001) {\n        evhttp_connection* conn = evhttp_request_get_connection(req);\n        if (conn) {\n            bufferevent* bev = evhttp_connection_get_bufferevent(conn);\n            if (bev) {\n                bufferevent_disable(bev, EV_READ);\n            }\n        }\n    }\n    std::unique_ptr<HTTPRequest> hreq(new HTTPRequest(req));\n\n    LogPrint(BCLog::HTTP, \"Received a %s request for %s from %s\\n\",\n             RequestMethodString(hreq->GetRequestMethod()), hreq->GetURI(), hreq->GetPeer().ToString());\n\n    // Early address-based allow check\n    if (!ClientAllowed(hreq->GetPeer())) {\n        hreq->WriteReply(HTTP_FORBIDDEN);\n        return;\n    }\n\n    // Early reject unknown HTTP methods\n    if (hreq->GetRequestMethod() == HTTPRequest::UNKNOWN) {\n        hreq->WriteReply(HTTP_BADMETHOD);\n        return;\n    }\n\n    // Find registered handler for prefix\n    std::string strURI = hreq->GetURI();\n    std::string path;\n    std::vector<HTTPPathHandler>::const_iterator i = pathHandlers.begin();\n    std::vector<HTTPPathHandler>::const_iterator iend = pathHandlers.end();\n    for (; i != iend; ++i) {\n        bool match = false;\n        if (i->exactMatch)\n            match = (strURI == i->prefix);\n        else\n            match = (strURI.substr(0, i->prefix.size()) == i->prefix);\n        if (match) {\n            path = strURI.substr(i->prefix.size());\n            break;\n        }\n    }\n\n    // Dispatch to worker thread\n    if (i != iend) {\n        std::unique_ptr<HTTPWorkItem> item(new HTTPWorkItem(std::move(hreq), path, i->handler));\n        assert(workQueue);\n        if (workQueue->Enqueue(item.get()))\n            item.release(); /* if true, queue took ownership */\n        else {\n            LogPrintf(\"WARNING: request rejected because http work queue depth exceeded, it can be increased with the -rpcworkqueue= setting\\n\");\n            item->req->WriteReply(HTTP_INTERNAL, \"Work queue depth exceeded\");\n        }\n    } else {\n        hreq->WriteReply(HTTP_NOTFOUND);\n    }\n}\n\n/** Callback to reject HTTP requests after shutdown. */\nstatic void http_reject_request_cb(struct evhttp_request* req, void*)\n{\n    LogPrint(BCLog::HTTP, \"Rejecting request while shutting down\\n\");\n    evhttp_send_error(req, HTTP_SERVUNAVAIL, nullptr);\n}\n\n/** Event dispatcher thread */\nstatic bool ThreadHTTP(struct event_base* base, struct evhttp* http)\n{\n    RenameThread(\"sugarchain-http\");\n    LogPrint(BCLog::HTTP, \"Entering http event loop\\n\");\n    event_base_dispatch(base);\n    // Event loop will be interrupted by InterruptHTTPServer()\n    LogPrint(BCLog::HTTP, \"Exited http event loop\\n\");\n    return event_base_got_break(base) == 0;\n}\n\n/** Bind HTTP server to specified addresses */\nstatic bool HTTPBindAddresses(struct evhttp* http)\n{\n    int defaultPort = gArgs.GetArg(\"-rpcport\", BaseParams().RPCPort());\n    std::vector<std::pair<std::string, uint16_t> > endpoints;\n\n    // Determine what addresses to bind to\n    if (!gArgs.IsArgSet(\"-rpcallowip\")) { // Default to loopback if not allowing external IPs\n        endpoints.push_back(std::make_pair(\"::1\", defaultPort));\n        endpoints.push_back(std::make_pair(\"127.0.0.1\", defaultPort));\n        if (gArgs.IsArgSet(\"-rpcbind\")) {\n            LogPrintf(\"WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\\n\");\n        }\n    } else if (gArgs.IsArgSet(\"-rpcbind\")) { // Specific bind address\n        for (const std::string& strRPCBind : gArgs.GetArgs(\"-rpcbind\")) {\n            int port = defaultPort;\n            std::string host;\n            SplitHostPort(strRPCBind, port, host);\n            endpoints.push_back(std::make_pair(host, port));\n        }\n    } else { // No specific bind address specified, bind to any\n        endpoints.push_back(std::make_pair(\"::\", defaultPort));\n        endpoints.push_back(std::make_pair(\"0.0.0.0\", defaultPort));\n    }\n\n    // Bind addresses\n    for (std::vector<std::pair<std::string, uint16_t> >::iterator i = endpoints.begin(); i != endpoints.end(); ++i) {\n        LogPrint(BCLog::HTTP, \"Binding RPC on address %s port %i\\n\", i->first, i->second);\n        evhttp_bound_socket *bind_handle = evhttp_bind_socket_with_handle(http, i->first.empty() ? nullptr : i->first.c_str(), i->second);\n        if (bind_handle) {\n            boundSockets.push_back(bind_handle);\n        } else {\n            LogPrintf(\"Binding RPC on address %s port %i failed.\\n\", i->first, i->second);\n        }\n    }\n    return !boundSockets.empty();\n}\n\n/** Simple wrapper to set thread name and run work queue */\nstatic void HTTPWorkQueueRun(WorkQueue<HTTPClosure>* queue)\n{\n    RenameThread(\"sugarchain-httpworker\");\n    queue->Run();\n}\n\n/** libevent event log callback */\nstatic void libevent_log_cb(int severity, const char *msg)\n{\n#ifndef EVENT_LOG_WARN\n// EVENT_LOG_WARN was added in 2.0.19; but before then _EVENT_LOG_WARN existed.\n# define EVENT_LOG_WARN _EVENT_LOG_WARN\n#endif\n    if (severity >= EVENT_LOG_WARN) // Log warn messages and higher without debug category\n        LogPrintf(\"libevent: %s\\n\", msg);\n    else\n        LogPrint(BCLog::LIBEVENT, \"libevent: %s\\n\", msg);\n}\n\nbool InitHTTPServer()\n{\n    if (!InitHTTPAllowList())\n        return false;\n\n    if (gArgs.GetBoolArg(\"-rpcssl\", false)) {\n        uiInterface.ThreadSafeMessageBox(\n            \"SSL mode for RPC (-rpcssl) is no longer supported.\",\n            \"\", CClientUIInterface::MSG_ERROR);\n        return false;\n    }\n\n    // Redirect libevent's logging to our own log\n    event_set_log_callback(&libevent_log_cb);\n    // Update libevent's log handling. Returns false if our version of\n    // libevent doesn't support debug logging, in which case we should\n    // clear the BCLog::LIBEVENT flag.\n    if (!UpdateHTTPServerLogging(logCategories & BCLog::LIBEVENT)) {\n        logCategories &= ~BCLog::LIBEVENT;\n    }\n\n#ifdef WIN32\n    evthread_use_windows_threads();\n#else\n    evthread_use_pthreads();\n#endif\n\n    raii_event_base base_ctr = obtain_event_base();\n\n    /* Create a new evhttp object to handle requests. */\n    raii_evhttp http_ctr = obtain_evhttp(base_ctr.get());\n    struct evhttp* http = http_ctr.get();\n    if (!http) {\n        LogPrintf(\"couldn't create evhttp. Exiting.\\n\");\n        return false;\n    }\n\n    evhttp_set_timeout(http, gArgs.GetArg(\"-rpcservertimeout\", DEFAULT_HTTP_SERVER_TIMEOUT));\n    evhttp_set_max_headers_size(http, MAX_HEADERS_SIZE);\n    evhttp_set_max_body_size(http, MAX_SIZE);\n    evhttp_set_gencb(http, http_request_cb, nullptr);\n\n    if (!HTTPBindAddresses(http)) {\n        LogPrintf(\"Unable to bind any endpoint for RPC server\\n\");\n        return false;\n    }\n\n    LogPrint(BCLog::HTTP, \"Initialized HTTP server\\n\");\n    int workQueueDepth = std::max((long)gArgs.GetArg(\"-rpcworkqueue\", DEFAULT_HTTP_WORKQUEUE), 1L);\n    LogPrintf(\"HTTP: creating work queue of depth %d\\n\", workQueueDepth);\n\n    workQueue = new WorkQueue<HTTPClosure>(workQueueDepth);\n    // transfer ownership to eventBase/HTTP via .release()\n    eventBase = base_ctr.release();\n    eventHTTP = http_ctr.release();\n    return true;\n}\n\nbool UpdateHTTPServerLogging(bool enable) {\n#if LIBEVENT_VERSION_NUMBER >= 0x02010100\n    if (enable) {\n        event_enable_debug_logging(EVENT_DBG_ALL);\n    } else {\n        event_enable_debug_logging(EVENT_DBG_NONE);\n    }\n    return true;\n#else\n    // Can't update libevent logging if version < 02010100\n    return false;\n#endif\n}\n\nstd::thread threadHTTP;\nstd::future<bool> threadResult;\nstatic std::vector<std::thread> g_thread_http_workers;\n\nbool StartHTTPServer()\n{\n    LogPrint(BCLog::HTTP, \"Starting HTTP server\\n\");\n    int rpcThreads = std::max((long)gArgs.GetArg(\"-rpcthreads\", DEFAULT_HTTP_THREADS), 1L);\n    LogPrintf(\"HTTP: starting %d worker threads\\n\", rpcThreads);\n    std::packaged_task<bool(event_base*, evhttp*)> task(ThreadHTTP);\n    threadResult = task.get_future();\n    threadHTTP = std::thread(std::move(task), eventBase, eventHTTP);\n\n    for (int i = 0; i < rpcThreads; i++) {\n        g_thread_http_workers.emplace_back(HTTPWorkQueueRun, workQueue);\n    }\n    return true;\n}\n\nvoid InterruptHTTPServer()\n{\n    LogPrint(BCLog::HTTP, \"Interrupting HTTP server\\n\");\n    if (eventHTTP) {\n        // Unlisten sockets\n        for (evhttp_bound_socket *socket : boundSockets) {\n            evhttp_del_accept_socket(eventHTTP, socket);\n        }\n        // Reject requests on current connections\n        evhttp_set_gencb(eventHTTP, http_reject_request_cb, nullptr);\n    }\n    if (workQueue)\n        workQueue->Interrupt();\n}\n\nvoid StopHTTPServer()\n{\n    LogPrint(BCLog::HTTP, \"Stopping HTTP server\\n\");\n    if (workQueue) {\n        LogPrint(BCLog::HTTP, \"Waiting for HTTP worker threads to exit\\n\");\n        for (auto& thread: g_thread_http_workers) {\n            thread.join();\n        }\n        g_thread_http_workers.clear();\n        delete workQueue;\n        workQueue = nullptr;\n    }\n    if (eventBase) {\n        LogPrint(BCLog::HTTP, \"Waiting for HTTP event thread to exit\\n\");\n        // Exit the event loop as soon as there are no active events.\n        event_base_loopexit(eventBase, nullptr);\n        // Give event loop a few seconds to exit (to send back last RPC responses), then break it\n        // Before this was solved with event_base_loopexit, but that didn't work as expected in\n        // at least libevent 2.0.21 and always introduced a delay. In libevent\n        // master that appears to be solved, so in the future that solution\n        // could be used again (if desirable).\n        // (see discussion in https://github.com/bitcoin/bitcoin/pull/6990)\n        if (threadResult.valid() && threadResult.wait_for(std::chrono::milliseconds(2000)) == std::future_status::timeout) {\n            LogPrintf(\"HTTP event loop did not exit within allotted time, sending loopbreak\\n\");\n            event_base_loopbreak(eventBase);\n        }\n        threadHTTP.join();\n    }\n    if (eventHTTP) {\n        evhttp_free(eventHTTP);\n        eventHTTP = nullptr;\n    }\n    if (eventBase) {\n        event_base_free(eventBase);\n        eventBase = nullptr;\n    }\n    LogPrint(BCLog::HTTP, \"Stopped HTTP server\\n\");\n}\n\nstruct event_base* EventBase()\n{\n    return eventBase;\n}\n\nstatic void httpevent_callback_fn(evutil_socket_t, short, void* data)\n{\n    // Static handler: simply call inner handler\n    HTTPEvent *self = ((HTTPEvent*)data);\n    self->handler();\n    if (self->deleteWhenTriggered)\n        delete self;\n}\n\nHTTPEvent::HTTPEvent(struct event_base* base, bool _deleteWhenTriggered, const std::function<void(void)>& _handler):\n    deleteWhenTriggered(_deleteWhenTriggered), handler(_handler)\n{\n    ev = event_new(base, -1, 0, httpevent_callback_fn, this);\n    assert(ev);\n}\nHTTPEvent::~HTTPEvent()\n{\n    event_free(ev);\n}\nvoid HTTPEvent::trigger(struct timeval* tv)\n{\n    if (tv == nullptr)\n        event_active(ev, 0, 0); // immediately trigger event in main thread\n    else\n        evtimer_add(ev, tv); // trigger after timeval passed\n}\nHTTPRequest::HTTPRequest(struct evhttp_request* _req) : req(_req),\n                                                       replySent(false)\n{\n}\nHTTPRequest::~HTTPRequest()\n{\n    if (!replySent) {\n        // Keep track of whether reply was sent to avoid request leaks\n        LogPrintf(\"%s: Unhandled request\\n\", __func__);\n        WriteReply(HTTP_INTERNAL, \"Unhandled request\");\n    }\n    // evhttpd cleans up the request, as long as a reply was sent.\n}\n\nstd::pair<bool, std::string> HTTPRequest::GetHeader(const std::string& hdr)\n{\n    const struct evkeyvalq* headers = evhttp_request_get_input_headers(req);\n    assert(headers);\n    const char* val = evhttp_find_header(headers, hdr.c_str());\n    if (val)\n        return std::make_pair(true, val);\n    else\n        return std::make_pair(false, \"\");\n}\n\nstd::string HTTPRequest::ReadBody()\n{\n    struct evbuffer* buf = evhttp_request_get_input_buffer(req);\n    if (!buf)\n        return \"\";\n    size_t size = evbuffer_get_length(buf);\n    /** Trivial implementation: if this is ever a performance bottleneck,\n     * internal copying can be avoided in multi-segment buffers by using\n     * evbuffer_peek and an awkward loop. Though in that case, it'd be even\n     * better to not copy into an intermediate string but use a stream\n     * abstraction to consume the evbuffer on the fly in the parsing algorithm.\n     */\n    const char* data = (const char*)evbuffer_pullup(buf, size);\n    if (!data) // returns nullptr in case of empty buffer\n        return \"\";\n    std::string rv(data, size);\n    evbuffer_drain(buf, size);\n    return rv;\n}\n\nvoid HTTPRequest::WriteHeader(const std::string& hdr, const std::string& value)\n{\n    struct evkeyvalq* headers = evhttp_request_get_output_headers(req);\n    assert(headers);\n    evhttp_add_header(headers, hdr.c_str(), value.c_str());\n}\n\n/** Closure sent to main thread to request a reply to be sent to\n * a HTTP request.\n * Replies must be sent in the main loop in the main http thread,\n * this cannot be done from worker threads.\n */\nvoid HTTPRequest::WriteReply(int nStatus, const std::string& strReply)\n{\n    assert(!replySent && req);\n    // Send event to main http thread to send reply message\n    struct evbuffer* evb = evhttp_request_get_output_buffer(req);\n    assert(evb);\n    evbuffer_add(evb, strReply.data(), strReply.size());\n    auto req_copy = req;\n    HTTPEvent* ev = new HTTPEvent(eventBase, true, [req_copy, nStatus]{\n        evhttp_send_reply(req_copy, nStatus, nullptr, nullptr);\n        // Re-enable reading from the socket. This is the second part of the libevent\n        // workaround above.\n        if (event_get_version_number() >= 0x02010600 && event_get_version_number() < 0x02020001) {\n            evhttp_connection* conn = evhttp_request_get_connection(req_copy);\n            if (conn) {\n                bufferevent* bev = evhttp_connection_get_bufferevent(conn);\n                if (bev) {\n                    bufferevent_enable(bev, EV_READ | EV_WRITE);\n                }\n            }\n        }\n    });\n    ev->trigger(nullptr);\n    replySent = true;\n    req = nullptr; // transferred back to main thread\n}\n\nCService HTTPRequest::GetPeer()\n{\n    evhttp_connection* con = evhttp_request_get_connection(req);\n    CService peer;\n    if (con) {\n        // evhttp retains ownership over returned address string\n        const char* address = \"\";\n        uint16_t port = 0;\n        evhttp_connection_get_peer(con, (char**)&address, &port);\n        peer = LookupNumeric(address, port);\n    }\n    return peer;\n}\n\nstd::string HTTPRequest::GetURI()\n{\n    return evhttp_request_get_uri(req);\n}\n\nHTTPRequest::RequestMethod HTTPRequest::GetRequestMethod()\n{\n    switch (evhttp_request_get_command(req)) {\n    case EVHTTP_REQ_GET:\n        return GET;\n        break;\n    case EVHTTP_REQ_POST:\n        return POST;\n        break;\n    case EVHTTP_REQ_HEAD:\n        return HEAD;\n        break;\n    case EVHTTP_REQ_PUT:\n        return PUT;\n        break;\n    default:\n        return UNKNOWN;\n        break;\n    }\n}\n\nvoid RegisterHTTPHandler(const std::string &prefix, bool exactMatch, const HTTPRequestHandler &handler)\n{\n    LogPrint(BCLog::HTTP, \"Registering HTTP handler for %s (exactmatch %d)\\n\", prefix, exactMatch);\n    pathHandlers.push_back(HTTPPathHandler(prefix, exactMatch, handler));\n}\n\nvoid UnregisterHTTPHandler(const std::string &prefix, bool exactMatch)\n{\n    std::vector<HTTPPathHandler>::iterator i = pathHandlers.begin();\n    std::vector<HTTPPathHandler>::iterator iend = pathHandlers.end();\n    for (; i != iend; ++i)\n        if (i->prefix == prefix && i->exactMatch == exactMatch)\n            break;\n    if (i != iend)\n    {\n        LogPrint(BCLog::HTTP, \"Unregistering HTTP handler for %s (exactmatch %d)\\n\", prefix, exactMatch);\n        pathHandlers.erase(i);\n    }\n}\n\nstd::string urlDecode(const std::string &urlEncoded) {\n    std::string res;\n    if (!urlEncoded.empty()) {\n        char *decoded = evhttp_uridecode(urlEncoded.c_str(), false, nullptr);\n        if (decoded) {\n            res = std::string(decoded);\n            free(decoded);\n        }\n    }\n    return res;\n}\n"
  },
  {
    "path": "src/httpserver.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_HTTPSERVER_H\n#define BITCOIN_HTTPSERVER_H\n\n#include <string>\n#include <stdint.h>\n#include <functional>\n\nstatic const int DEFAULT_HTTP_THREADS=4;\nstatic const int DEFAULT_HTTP_WORKQUEUE=128; // was 16 // FIXME.SUGAR // for huge RPC calling\nstatic const int DEFAULT_HTTP_SERVER_TIMEOUT=30;\n\nstruct evhttp_request;\nstruct event_base;\nclass CService;\nclass HTTPRequest;\n\n/** Initialize HTTP server.\n * Call this before RegisterHTTPHandler or EventBase().\n */\nbool InitHTTPServer();\n/** Start HTTP server.\n * This is separate from InitHTTPServer to give users race-condition-free time\n * to register their handlers between InitHTTPServer and StartHTTPServer.\n */\nbool StartHTTPServer();\n/** Interrupt HTTP server threads */\nvoid InterruptHTTPServer();\n/** Stop HTTP server */\nvoid StopHTTPServer();\n\n/** Change logging level for libevent. Removes BCLog::LIBEVENT from logCategories if\n * libevent doesn't support debug logging.*/\nbool UpdateHTTPServerLogging(bool enable);\n\n/** Handler for requests to a certain HTTP path */\ntypedef std::function<bool(HTTPRequest* req, const std::string &)> HTTPRequestHandler;\n/** Register handler for prefix.\n * If multiple handlers match a prefix, the first-registered one will\n * be invoked.\n */\nvoid RegisterHTTPHandler(const std::string &prefix, bool exactMatch, const HTTPRequestHandler &handler);\n/** Unregister handler for prefix */\nvoid UnregisterHTTPHandler(const std::string &prefix, bool exactMatch);\n\n/** Return evhttp event base. This can be used by submodules to\n * queue timers or custom events.\n */\nstruct event_base* EventBase();\n\n/** In-flight HTTP request.\n * Thin C++ wrapper around evhttp_request.\n */\nclass HTTPRequest\n{\nprivate:\n    struct evhttp_request* req;\n    bool replySent;\n\npublic:\n    explicit HTTPRequest(struct evhttp_request* req);\n    ~HTTPRequest();\n\n    enum RequestMethod {\n        UNKNOWN,\n        GET,\n        POST,\n        HEAD,\n        PUT\n    };\n\n    /** Get requested URI.\n     */\n    std::string GetURI();\n\n    /** Get CService (address:ip) for the origin of the http request.\n     */\n    CService GetPeer();\n\n    /** Get request method.\n     */\n    RequestMethod GetRequestMethod();\n\n    /**\n     * Get the request header specified by hdr, or an empty string.\n     * Return a pair (isPresent,string).\n     */\n    std::pair<bool, std::string> GetHeader(const std::string& hdr);\n\n    /**\n     * Read request body.\n     *\n     * @note As this consumes the underlying buffer, call this only once.\n     * Repeated calls will return an empty string.\n     */\n    std::string ReadBody();\n\n    /**\n     * Write output header.\n     *\n     * @note call this before calling WriteErrorReply or Reply.\n     */\n    void WriteHeader(const std::string& hdr, const std::string& value);\n\n    /**\n     * Write HTTP reply.\n     * nStatus is the HTTP status code to send.\n     * strReply is the body of the reply. Keep it empty to send a standard message.\n     *\n     * @note Can be called only once. As this will give the request back to the\n     * main thread, do not call any other HTTPRequest methods after calling this.\n     */\n    void WriteReply(int nStatus, const std::string& strReply = \"\");\n};\n\n/** Event handler closure.\n */\nclass HTTPClosure\n{\npublic:\n    virtual void operator()() = 0;\n    virtual ~HTTPClosure() {}\n};\n\n/** Event class. This can be used either as a cross-thread trigger or as a timer.\n */\nclass HTTPEvent\n{\npublic:\n    /** Create a new event.\n     * deleteWhenTriggered deletes this event object after the event is triggered (and the handler called)\n     * handler is the handler to call when the event is triggered.\n     */\n    HTTPEvent(struct event_base* base, bool deleteWhenTriggered, const std::function<void(void)>& handler);\n    ~HTTPEvent();\n\n    /** Trigger the event. If tv is 0, trigger it immediately. Otherwise trigger it after\n     * the given time has elapsed.\n     */\n    void trigger(struct timeval* tv);\n\n    bool deleteWhenTriggered;\n    std::function<void(void)> handler;\nprivate:\n    struct event* ev;\n};\n\nstd::string urlDecode(const std::string &urlEncoded);\n\n#endif // BITCOIN_HTTPSERVER_H\n"
  },
  {
    "path": "src/indirectmap.h",
    "content": "// Copyright (c) 2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_INDIRECTMAP_H\n#define BITCOIN_INDIRECTMAP_H\n\ntemplate <class T>\nstruct DereferencingComparator { bool operator()(const T a, const T b) const { return *a < *b; } };\n\n/* Map whose keys are pointers, but are compared by their dereferenced values.\n *\n * Differs from a plain std::map<const K*, T, DereferencingComparator<K*> > in\n * that methods that take a key for comparison take a K rather than taking a K*\n * (taking a K* would be confusing, since it's the value rather than the address\n * of the object for comparison that matters due to the dereferencing comparator).\n *\n * Objects pointed to by keys must not be modified in any way that changes the\n * result of DereferencingComparator.\n */\ntemplate <class K, class T>\nclass indirectmap {\nprivate:\n    typedef std::map<const K*, T, DereferencingComparator<const K*> > base;\n    base m;\npublic:\n    typedef typename base::iterator iterator;\n    typedef typename base::const_iterator const_iterator;\n    typedef typename base::size_type size_type;\n    typedef typename base::value_type value_type;\n\n    // passthrough (pointer interface)\n    std::pair<iterator, bool> insert(const value_type& value) { return m.insert(value); }\n\n    // pass address (value interface)\n    iterator find(const K& key)                     { return m.find(&key); }\n    const_iterator find(const K& key) const         { return m.find(&key); }\n    iterator lower_bound(const K& key)              { return m.lower_bound(&key); }\n    const_iterator lower_bound(const K& key) const  { return m.lower_bound(&key); }\n    size_type erase(const K& key)                   { return m.erase(&key); }\n    size_type count(const K& key) const             { return m.count(&key); }\n\n    // passthrough\n    bool empty() const              { return m.empty(); }\n    size_type size() const          { return m.size(); }\n    size_type max_size() const      { return m.max_size(); }\n    void clear()                    { m.clear(); }\n    iterator begin()                { return m.begin(); }\n    iterator end()                  { return m.end(); }\n    const_iterator begin() const    { return m.begin(); }\n    const_iterator end() const      { return m.end(); }\n    const_iterator cbegin() const   { return m.cbegin(); }\n    const_iterator cend() const     { return m.cend(); }\n};\n\n#endif // BITCOIN_INDIRECTMAP_H\n"
  },
  {
    "path": "src/init.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <init.h>\n\n#include <addrman.h>\n#include <amount.h>\n#include <chain.h>\n#include <chainparams.h>\n#include <checkpoints.h>\n#include <compat/sanity.h>\n#include <consensus/validation.h>\n#include <fs.h>\n#include <httpserver.h>\n#include <httprpc.h>\n#include <key.h>\n#include <validation.h>\n#include <miner.h>\n#include <netbase.h>\n#include <net.h>\n#include <net_processing.h>\n#include <policy/feerate.h>\n#include <policy/fees.h>\n#include <policy/policy.h>\n#include <rpc/server.h>\n#include <rpc/register.h>\n#include <rpc/safemode.h>\n#include <rpc/blockchain.h>\n#include <script/standard.h>\n#include <script/sigcache.h>\n#include <scheduler.h>\n#include <timedata.h>\n#include <txdb.h>\n#include <txmempool.h>\n#include <torcontrol.h>\n#include <ui_interface.h>\n#include <util.h>\n#include <utilmoneystr.h>\n#include <validationinterface.h>\n#ifdef ENABLE_WALLET\n#include <wallet/init.h>\n#endif\n#include <warnings.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <memory>\n\n#ifndef WIN32\n#include <signal.h>\n#endif\n\n#include <boost/algorithm/string/classification.hpp>\n#include <boost/algorithm/string/replace.hpp>\n#include <boost/algorithm/string/split.hpp>\n#include <boost/bind.hpp>\n#include <boost/interprocess/sync/file_lock.hpp>\n#include <boost/thread.hpp>\n#include <openssl/crypto.h>\n\n#if ENABLE_ZMQ\n#include <zmq/zmqnotificationinterface.h>\n#endif\n\nbool fFeeEstimatesInitialized = false;\nstatic const bool DEFAULT_PROXYRANDOMIZE = true;\nstatic const bool DEFAULT_REST_ENABLE = false;\nstatic const bool DEFAULT_STOPAFTERBLOCKIMPORT = false;\n\nstd::unique_ptr<CConnman> g_connman;\nstd::unique_ptr<PeerLogicValidation> peerLogic;\n\n#if ENABLE_ZMQ\nstatic CZMQNotificationInterface* pzmqNotificationInterface = nullptr;\n#endif\n\n#ifdef WIN32\n// Win32 LevelDB doesn't use filedescriptors, and the ones used for\n// accessing block files don't count towards the fd_set size limit\n// anyway.\n#define MIN_CORE_FILEDESCRIPTORS 0\n#else\n#define MIN_CORE_FILEDESCRIPTORS 150\n#endif\n\nstatic const char* FEE_ESTIMATES_FILENAME=\"fee_estimates.dat\";\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// Shutdown\n//\n\n//\n// Thread management and startup/shutdown:\n//\n// The network-processing threads are all part of a thread group\n// created by AppInit() or the Qt main() function.\n//\n// A clean exit happens when StartShutdown() or the SIGTERM\n// signal handler sets fRequestShutdown, which makes main thread's\n// WaitForShutdown() interrupts the thread group.\n// And then, WaitForShutdown() makes all other on-going threads\n// in the thread group join the main thread.\n// Shutdown() is then called to clean up database connections, and stop other\n// threads that should only be stopped after the main network-processing\n// threads have exited.\n//\n// Shutdown for Qt is very similar, only it uses a QTimer to detect\n// fRequestShutdown getting set, and then does the normal Qt\n// shutdown thing.\n//\n\nstd::atomic<bool> fRequestShutdown(false);\nstd::atomic<bool> fDumpMempoolLater(false);\n\nvoid StartShutdown()\n{\n    fRequestShutdown = true;\n}\nbool ShutdownRequested()\n{\n    return fRequestShutdown;\n}\n\n/**\n * This is a minimally invasive approach to shutdown on LevelDB read errors from the\n * chainstate, while keeping user interface out of the common library, which is shared\n * between bitcoind, and bitcoin-qt and non-server tools.\n*/\nclass CCoinsViewErrorCatcher final : public CCoinsViewBacked\n{\npublic:\n    explicit CCoinsViewErrorCatcher(CCoinsView* view) : CCoinsViewBacked(view) {}\n    bool GetCoin(const COutPoint &outpoint, Coin &coin) const override {\n        try {\n            return CCoinsViewBacked::GetCoin(outpoint, coin);\n        } catch(const std::runtime_error& e) {\n            uiInterface.ThreadSafeMessageBox(_(\"Error reading from database, shutting down.\"), \"\", CClientUIInterface::MSG_ERROR);\n            LogPrintf(\"Error reading from database: %s\\n\", e.what());\n            // Starting the shutdown sequence and returning false to the caller would be\n            // interpreted as 'entry not found' (as opposed to unable to read data), and\n            // could lead to invalid interpretation. Just exit immediately, as we can't\n            // continue anyway, and all writes should be atomic.\n            abort();\n        }\n    }\n    // Writes do not need similar protection, as failure to write is handled by the caller.\n};\n\nstatic std::unique_ptr<CCoinsViewErrorCatcher> pcoinscatcher;\nstatic std::unique_ptr<ECCVerifyHandle> globalVerifyHandle;\n\nstatic boost::thread_group threadGroup;\nstatic CScheduler scheduler;\n\nvoid Interrupt()\n{\n    InterruptHTTPServer();\n    InterruptHTTPRPC();\n    InterruptRPC();\n    InterruptREST();\n    InterruptTorControl();\n    if (g_connman)\n        g_connman->Interrupt();\n}\n\nvoid Shutdown()\n{\n    LogPrintf(\"%s: In progress...\\n\", __func__);\n    static CCriticalSection cs_Shutdown;\n    TRY_LOCK(cs_Shutdown, lockShutdown);\n    if (!lockShutdown)\n        return;\n\n    /// Note: Shutdown() must be able to handle cases in which initialization failed part of the way,\n    /// for example if the data directory was found to be locked.\n    /// Be sure that anything that writes files or flushes caches only does this if the respective\n    /// module was initialized.\n    RenameThread(\"sugarchain-shutoff\");\n    mempool.AddTransactionsUpdated(1);\n\n    StopHTTPRPC();\n    StopREST();\n    StopRPC();\n    StopHTTPServer();\n#ifdef ENABLE_WALLET\n    FlushWallets();\n#endif\n    MapPort(false);\n\n    // Because these depend on each-other, we make sure that neither can be\n    // using the other before destroying them.\n    if (peerLogic) UnregisterValidationInterface(peerLogic.get());\n    if (g_connman) g_connman->Stop();\n    peerLogic.reset();\n    g_connman.reset();\n\n    StopTorControl();\n\n    // After everything has been shut down, but before things get flushed, stop the\n    // CScheduler/checkqueue threadGroup\n    threadGroup.interrupt_all();\n    threadGroup.join_all();\n\n    if (fDumpMempoolLater && gArgs.GetArg(\"-persistmempool\", DEFAULT_PERSIST_MEMPOOL)) {\n        DumpMempool();\n    }\n\n    if (fFeeEstimatesInitialized)\n    {\n        ::feeEstimator.FlushUnconfirmed(::mempool);\n        fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;\n        CAutoFile est_fileout(fsbridge::fopen(est_path, \"wb\"), SER_DISK, CLIENT_VERSION);\n        if (!est_fileout.IsNull())\n            ::feeEstimator.Write(est_fileout);\n        else\n            LogPrintf(\"%s: Failed to write fee estimates to %s\\n\", __func__, est_path.string());\n        fFeeEstimatesInitialized = false;\n    }\n\n    // FlushStateToDisk generates a SetBestChain callback, which we should avoid missing\n    if (pcoinsTip != nullptr) {\n        FlushStateToDisk();\n    }\n\n    // After there are no more peers/RPC left to give us new data which may generate\n    // CValidationInterface callbacks, flush them...\n    GetMainSignals().FlushBackgroundCallbacks();\n\n    // Any future callbacks will be dropped. This should absolutely be safe - if\n    // missing a callback results in an unrecoverable situation, unclean shutdown\n    // would too. The only reason to do the above flushes is to let the wallet catch\n    // up with our current chain to avoid any strange pruning edge cases and make\n    // next startup faster by avoiding rescan.\n\n    {\n        LOCK(cs_main);\n        if (pcoinsTip != nullptr) {\n            FlushStateToDisk();\n        }\n        pcoinsTip.reset();\n        pcoinscatcher.reset();\n        pcoinsdbview.reset();\n        pblocktree.reset();\n    }\n#ifdef ENABLE_WALLET\n    StopWallets();\n#endif\n\n#if ENABLE_ZMQ\n    if (pzmqNotificationInterface) {\n        UnregisterValidationInterface(pzmqNotificationInterface);\n        delete pzmqNotificationInterface;\n        pzmqNotificationInterface = nullptr;\n    }\n#endif\n\n#ifndef WIN32\n    try {\n        fs::remove(GetPidFile());\n    } catch (const fs::filesystem_error& e) {\n        LogPrintf(\"%s: Unable to remove pidfile: %s\\n\", __func__, e.what());\n    }\n#endif\n    UnregisterAllValidationInterfaces();\n    GetMainSignals().UnregisterBackgroundSignalScheduler();\n    GetMainSignals().UnregisterWithMempoolSignals(mempool);\n#ifdef ENABLE_WALLET\n    CloseWallets();\n#endif\n    globalVerifyHandle.reset();\n    ECC_Stop();\n    LogPrintf(\"%s: done\\n\", __func__);\n}\n\n/**\n * Signal handlers are very limited in what they are allowed to do.\n * The execution context the handler is invoked in is not guaranteed,\n * so we restrict handler operations to just touching variables:\n */\n#ifndef WIN32\nstatic void HandleSIGTERM(int)\n{\n    fRequestShutdown = true;\n}\n\nstatic void HandleSIGHUP(int)\n{\n    fReopenDebugLog = true;\n}\n#else\nstatic BOOL WINAPI consoleCtrlHandler(DWORD dwCtrlType)\n{\n    fRequestShutdown = true;\n    Sleep(INFINITE);\n    return true;\n}\n#endif\n\n#ifndef WIN32\nstatic void registerSignalHandler(int signal, void(*handler)(int))\n{\n    struct sigaction sa;\n    sa.sa_handler = handler;\n    sigemptyset(&sa.sa_mask);\n    sa.sa_flags = 0;\n    sigaction(signal, &sa, nullptr);\n}\n#endif\n\nvoid OnRPCStarted()\n{\n    uiInterface.NotifyBlockTip.connect(&RPCNotifyBlockChange);\n}\n\nvoid OnRPCStopped()\n{\n    uiInterface.NotifyBlockTip.disconnect(&RPCNotifyBlockChange);\n    RPCNotifyBlockChange(false, nullptr);\n    cvBlockChange.notify_all();\n    LogPrint(BCLog::RPC, \"RPC stopped.\\n\");\n}\n\nstd::string HelpMessage(HelpMessageMode mode)\n{\n    const auto defaultBaseParams = CreateBaseChainParams(CBaseChainParams::MAIN);\n    const auto testnetBaseParams = CreateBaseChainParams(CBaseChainParams::TESTNET);\n    const auto defaultChainParams = CreateChainParams(CBaseChainParams::MAIN);\n    const auto testnetChainParams = CreateChainParams(CBaseChainParams::TESTNET);\n    const bool showDebug = gArgs.GetBoolArg(\"-help-debug\", false);\n\n    // When adding new options to the categories, please keep and ensure alphabetical ordering.\n    // Do not translate _(...) -help-debug options, Many technical terms, and only a very small audience, so is unnecessary stress to translators.\n    std::string strUsage = HelpMessageGroup(_(\"Options:\"));\n    strUsage += HelpMessageOpt(\"-?\", _(\"Print this help message and exit\"));\n    strUsage += HelpMessageOpt(\"-version\", _(\"Print version and exit\"));\n    strUsage += HelpMessageOpt(\"-alertnotify=<cmd>\", _(\"Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)\"));\n    strUsage += HelpMessageOpt(\"-blocknotify=<cmd>\", _(\"Execute command when the best block changes (%s in cmd is replaced by block hash)\"));\n    if (showDebug)\n        strUsage += HelpMessageOpt(\"-blocksonly\", strprintf(_(\"Whether to operate in a blocks only mode (default: %u)\"), DEFAULT_BLOCKSONLY));\n    strUsage +=HelpMessageOpt(\"-assumevalid=<hex>\", strprintf(_(\"If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)\"), defaultChainParams->GetConsensus().defaultAssumeValid.GetHex(), testnetChainParams->GetConsensus().defaultAssumeValid.GetHex()));\n    strUsage += HelpMessageOpt(\"-conf=<file>\", strprintf(_(\"Specify configuration file (default: %s)\"), BITCOIN_CONF_FILENAME));\n    if (mode == HMM_BITCOIND)\n    {\n#if HAVE_DECL_DAEMON\n        strUsage += HelpMessageOpt(\"-daemon\", _(\"Run in the background as a daemon and accept commands\"));\n#endif\n    }\n    strUsage += HelpMessageOpt(\"-datadir=<dir>\", _(\"Specify data directory\"));\n    if (showDebug) {\n        strUsage += HelpMessageOpt(\"-dbbatchsize\", strprintf(\"Maximum database write batch size in bytes (default: %u)\", nDefaultDbBatchSize));\n    }\n    strUsage += HelpMessageOpt(\"-dbcache=<n>\", strprintf(_(\"Set database cache size in megabytes (%d to %d, default: %d)\"), nMinDbCache, nMaxDbCache, nDefaultDbCache));\n    if (showDebug)\n        strUsage += HelpMessageOpt(\"-feefilter\", strprintf(\"Tell other nodes to filter invs to us by our mempool min fee (default: %u)\", DEFAULT_FEEFILTER));\n    strUsage += HelpMessageOpt(\"-loadblock=<file>\", _(\"Imports blocks from external blk000??.dat file on startup\"));\n    strUsage += HelpMessageOpt(\"-debuglogfile=<file>\", strprintf(_(\"Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)\"), DEFAULT_DEBUGLOGFILE));\n    strUsage += HelpMessageOpt(\"-maxorphantx=<n>\", strprintf(_(\"Keep at most <n> unconnectable transactions in memory (default: %u)\"), DEFAULT_MAX_ORPHAN_TRANSACTIONS));\n    strUsage += HelpMessageOpt(\"-maxmempool=<n>\", strprintf(_(\"Keep the transaction memory pool below <n> megabytes (default: %u)\"), DEFAULT_MAX_MEMPOOL_SIZE));\n    strUsage += HelpMessageOpt(\"-mempoolexpiry=<n>\", strprintf(_(\"Do not keep transactions in the mempool longer than <n> hours (default: %u)\"), DEFAULT_MEMPOOL_EXPIRY));\n    if (showDebug) {\n        strUsage += HelpMessageOpt(\"-minimumchainwork=<hex>\", strprintf(\"Minimum work assumed to exist on a valid chain in hex (default: %s, testnet: %s)\", defaultChainParams->GetConsensus().nMinimumChainWork.GetHex(), testnetChainParams->GetConsensus().nMinimumChainWork.GetHex()));\n    }\n    strUsage += HelpMessageOpt(\"-persistmempool\", strprintf(_(\"Whether to save the mempool on shutdown and load on restart (default: %u)\"), DEFAULT_PERSIST_MEMPOOL));\n    strUsage += HelpMessageOpt(\"-blockreconstructionextratxn=<n>\", strprintf(_(\"Extra transactions to keep in memory for compact block reconstructions (default: %u)\"), DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN));\n    strUsage += HelpMessageOpt(\"-par=<n>\", strprintf(_(\"Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)\"),\n        -GetNumCores(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS));\n#ifndef WIN32\n    strUsage += HelpMessageOpt(\"-pid=<file>\", strprintf(_(\"Specify pid file (default: %s)\"), BITCOIN_PID_FILENAME));\n#endif\n    strUsage += HelpMessageOpt(\"-prune=<n>\", strprintf(_(\"Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. \"\n            \"Warning: Reverting this setting requires re-downloading the entire blockchain. \"\n            \"(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >=%u = automatically prune block files to stay under the specified target size in MiB)\"), MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024));\n    strUsage += HelpMessageOpt(\"-reindex-chainstate\", _(\"Rebuild chain state from the currently indexed blocks\"));\n    strUsage += HelpMessageOpt(\"-reindex\", _(\"Rebuild chain state and block index from the blk*.dat files on disk\"));\n#ifndef WIN32\n    strUsage += HelpMessageOpt(\"-sysperms\", _(\"Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)\"));\n#endif\n    strUsage += HelpMessageOpt(\"-txindex\", strprintf(_(\"Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)\"), DEFAULT_TXINDEX));\n\n    strUsage += HelpMessageGroup(_(\"Connection options:\"));\n    strUsage += HelpMessageOpt(\"-addnode=<ip>\", _(\"Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)\"));\n    strUsage += HelpMessageOpt(\"-banscore=<n>\", strprintf(_(\"Threshold for disconnecting misbehaving peers (default: %u)\"), DEFAULT_BANSCORE_THRESHOLD));\n    strUsage += HelpMessageOpt(\"-bantime=<n>\", strprintf(_(\"Number of seconds to keep misbehaving peers from reconnecting (default: %u)\"), DEFAULT_MISBEHAVING_BANTIME));\n    strUsage += HelpMessageOpt(\"-bind=<addr>\", _(\"Bind to given address and always listen on it. Use [host]:port notation for IPv6\"));\n    strUsage += HelpMessageOpt(\"-connect=<ip>\", _(\"Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)\"));\n    strUsage += HelpMessageOpt(\"-discover\", _(\"Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)\"));\n    strUsage += HelpMessageOpt(\"-dns\", _(\"Allow DNS lookups for -addnode, -seednode and -connect\") + \" \" + strprintf(_(\"(default: %u)\"), DEFAULT_NAME_LOOKUP));\n    strUsage += HelpMessageOpt(\"-dnsseed\", _(\"Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)\"));\n    strUsage += HelpMessageOpt(\"-externalip=<ip>\", _(\"Specify your own public address\"));\n    strUsage += HelpMessageOpt(\"-forcednsseed\", strprintf(_(\"Always query for peer addresses via DNS lookup (default: %u)\"), DEFAULT_FORCEDNSSEED));\n    strUsage += HelpMessageOpt(\"-listen\", _(\"Accept connections from outside (default: 1 if no -proxy or -connect)\"));\n    strUsage += HelpMessageOpt(\"-listenonion\", strprintf(_(\"Automatically create Tor hidden service (default: %d)\"), DEFAULT_LISTEN_ONION));\n    strUsage += HelpMessageOpt(\"-maxconnections=<n>\", strprintf(_(\"Maintain at most <n> connections to peers (default: %u)\"), DEFAULT_MAX_PEER_CONNECTIONS));\n    strUsage += HelpMessageOpt(\"-maxreceivebuffer=<n>\", strprintf(_(\"Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)\"), DEFAULT_MAXRECEIVEBUFFER));\n    strUsage += HelpMessageOpt(\"-maxsendbuffer=<n>\", strprintf(_(\"Maximum per-connection send buffer, <n>*1000 bytes (default: %u)\"), DEFAULT_MAXSENDBUFFER));\n    strUsage += HelpMessageOpt(\"-maxtimeadjustment\", strprintf(_(\"Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)\"), DEFAULT_MAX_TIME_ADJUSTMENT));\n    strUsage += HelpMessageOpt(\"-onion=<ip:port>\", strprintf(_(\"Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)\"), \"-proxy\"));\n    strUsage += HelpMessageOpt(\"-onlynet=<net>\", _(\"Only connect to nodes in network <net> (ipv4, ipv6 or onion)\"));\n    strUsage += HelpMessageOpt(\"-permitbaremultisig\", strprintf(_(\"Relay non-P2SH multisig (default: %u)\"), DEFAULT_PERMIT_BAREMULTISIG));\n    strUsage += HelpMessageOpt(\"-peerbloomfilters\", strprintf(_(\"Support filtering of blocks and transaction with bloom filters (default: %u)\"), DEFAULT_PEERBLOOMFILTERS));\n    strUsage += HelpMessageOpt(\"-port=<port>\", strprintf(_(\"Listen for connections on <port> (default: %u or testnet: %u)\"), defaultChainParams->GetDefaultPort(), testnetChainParams->GetDefaultPort()));\n    strUsage += HelpMessageOpt(\"-proxy=<ip:port>\", _(\"Connect through SOCKS5 proxy\"));\n    strUsage += HelpMessageOpt(\"-proxyrandomize\", strprintf(_(\"Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)\"), DEFAULT_PROXYRANDOMIZE));\n    strUsage += HelpMessageOpt(\"-seednode=<ip>\", _(\"Connect to a node to retrieve peer addresses, and disconnect\"));\n    strUsage += HelpMessageOpt(\"-timeout=<n>\", strprintf(_(\"Specify connection timeout in milliseconds (minimum: 1, default: %d)\"), DEFAULT_CONNECT_TIMEOUT));\n    strUsage += HelpMessageOpt(\"-torcontrol=<ip>:<port>\", strprintf(_(\"Tor control port to use if onion listening enabled (default: %s)\"), DEFAULT_TOR_CONTROL));\n    strUsage += HelpMessageOpt(\"-torpassword=<pass>\", _(\"Tor control port password (default: empty)\"));\n#ifdef USE_UPNP\n#if USE_UPNP\n    strUsage += HelpMessageOpt(\"-upnp\", _(\"Use UPnP to map the listening port (default: 1 when listening and no -proxy)\"));\n#else\n    strUsage += HelpMessageOpt(\"-upnp\", strprintf(_(\"Use UPnP to map the listening port (default: %u)\"), 0));\n#endif\n#endif\n    strUsage += HelpMessageOpt(\"-whitebind=<addr>\", _(\"Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6\"));\n    strUsage += HelpMessageOpt(\"-whitelist=<IP address or network>\", _(\"Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.\") +\n        \" \" + _(\"Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway\"));\n    strUsage += HelpMessageOpt(\"-maxuploadtarget=<n>\", strprintf(_(\"Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)\"), DEFAULT_MAX_UPLOAD_TARGET));\n\n#ifdef ENABLE_WALLET\n    strUsage += GetWalletHelpString(showDebug);\n#endif\n\n#if ENABLE_ZMQ\n    strUsage += HelpMessageGroup(_(\"ZeroMQ notification options:\"));\n    strUsage += HelpMessageOpt(\"-zmqpubhashblock=<address>\", _(\"Enable publish hash block in <address>\"));\n    strUsage += HelpMessageOpt(\"-zmqpubhashtx=<address>\", _(\"Enable publish hash transaction in <address>\"));\n    strUsage += HelpMessageOpt(\"-zmqpubrawblock=<address>\", _(\"Enable publish raw block in <address>\"));\n    strUsage += HelpMessageOpt(\"-zmqpubrawtx=<address>\", _(\"Enable publish raw transaction in <address>\"));\n#endif\n\n    strUsage += HelpMessageGroup(_(\"Debugging/Testing options:\"));\n    strUsage += HelpMessageOpt(\"-uacomment=<cmt>\", _(\"Append comment to the user agent string\"));\n    if (showDebug)\n    {\n        strUsage += HelpMessageOpt(\"-checkblocks=<n>\", strprintf(_(\"How many blocks to check at startup (default: %u, 0 = all)\"), DEFAULT_CHECKBLOCKS));\n        strUsage += HelpMessageOpt(\"-checklevel=<n>\", strprintf(_(\"How thorough the block verification of -checkblocks is (0-4, default: %u)\"), DEFAULT_CHECKLEVEL));\n        strUsage += HelpMessageOpt(\"-checkblockindex\", strprintf(\"Do a full consistency check for mapBlockIndex, setBlockIndexCandidates, chainActive and mapBlocksUnlinked occasionally. Also sets -checkmempool (default: %u)\", defaultChainParams->DefaultConsistencyChecks()));\n        strUsage += HelpMessageOpt(\"-checkmempool=<n>\", strprintf(\"Run checks every <n> transactions (default: %u)\", defaultChainParams->DefaultConsistencyChecks()));\n        strUsage += HelpMessageOpt(\"-checkpoints\", strprintf(\"Disable expensive verification for known chain history (default: %u)\", DEFAULT_CHECKPOINTS_ENABLED));\n        strUsage += HelpMessageOpt(\"-disablesafemode\", strprintf(\"Disable safemode, override a real safe mode event (default: %u)\", DEFAULT_DISABLE_SAFEMODE));\n        strUsage += HelpMessageOpt(\"-deprecatedrpc=<method>\", \"Allows deprecated RPC method(s) to be used\");\n        strUsage += HelpMessageOpt(\"-testsafemode\", strprintf(\"Force safe mode (default: %u)\", DEFAULT_TESTSAFEMODE));\n        strUsage += HelpMessageOpt(\"-dropmessagestest=<n>\", \"Randomly drop 1 of every <n> network messages\");\n        strUsage += HelpMessageOpt(\"-fuzzmessagestest=<n>\", \"Randomly fuzz 1 of every <n> network messages\");\n        strUsage += HelpMessageOpt(\"-stopafterblockimport\", strprintf(\"Stop running after importing blocks from disk (default: %u)\", DEFAULT_STOPAFTERBLOCKIMPORT));\n        strUsage += HelpMessageOpt(\"-stopatheight\", strprintf(\"Stop running after reaching the given height in the main chain (default: %u)\", DEFAULT_STOPATHEIGHT));\n\n        strUsage += HelpMessageOpt(\"-limitancestorcount=<n>\", strprintf(\"Do not accept transactions if number of in-mempool ancestors is <n> or more (default: %u)\", DEFAULT_ANCESTOR_LIMIT));\n        strUsage += HelpMessageOpt(\"-limitancestorsize=<n>\", strprintf(\"Do not accept transactions whose size with all in-mempool ancestors exceeds <n> kilobytes (default: %u)\", DEFAULT_ANCESTOR_SIZE_LIMIT));\n        strUsage += HelpMessageOpt(\"-limitdescendantcount=<n>\", strprintf(\"Do not accept transactions if any ancestor would have <n> or more in-mempool descendants (default: %u)\", DEFAULT_DESCENDANT_LIMIT));\n        strUsage += HelpMessageOpt(\"-limitdescendantsize=<n>\", strprintf(\"Do not accept transactions if any ancestor would have more than <n> kilobytes of in-mempool descendants (default: %u).\", DEFAULT_DESCENDANT_SIZE_LIMIT));\n        strUsage += HelpMessageOpt(\"-vbparams=deployment:start:end\", \"Use given start/end times for specified version bits deployment (regtest-only)\");\n    }\n    strUsage += HelpMessageOpt(\"-debug=<category>\", strprintf(_(\"Output debugging information (default: %u, supplying <category> is optional)\"), 0) + \". \" +\n        _(\"If <category> is not supplied or if <category> = 1, output all debugging information.\") + \" \" + _(\"<category> can be:\") + \" \" + ListLogCategories() + \".\");\n    strUsage += HelpMessageOpt(\"-debugexclude=<category>\", strprintf(_(\"Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.\")));\n    strUsage += HelpMessageOpt(\"-help-debug\", _(\"Show all debugging options (usage: --help -help-debug)\"));\n    strUsage += HelpMessageOpt(\"-logips\", strprintf(_(\"Include IP addresses in debug output (default: %u)\"), DEFAULT_LOGIPS));\n    strUsage += HelpMessageOpt(\"-logtimestamps\", strprintf(_(\"Prepend debug output with timestamp (default: %u)\"), DEFAULT_LOGTIMESTAMPS));\n    if (showDebug)\n    {\n        strUsage += HelpMessageOpt(\"-logtimemicros\", strprintf(\"Add microsecond precision to debug timestamps (default: %u)\", DEFAULT_LOGTIMEMICROS));\n        strUsage += HelpMessageOpt(\"-mocktime=<n>\", \"Replace actual time with <n> seconds since epoch (default: 0)\");\n        strUsage += HelpMessageOpt(\"-maxsigcachesize=<n>\", strprintf(\"Limit sum of signature cache and script execution cache sizes to <n> MiB (default: %u)\", DEFAULT_MAX_SIG_CACHE_SIZE));\n        strUsage += HelpMessageOpt(\"-maxtipage=<n>\", strprintf(\"Maximum tip age in seconds to consider node in initial block download (default: %u)\", DEFAULT_MAX_TIP_AGE));\n    }\n    strUsage += HelpMessageOpt(\"-maxtxfee=<amt>\", strprintf(_(\"Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)\"),\n        CURRENCY_UNIT, FormatMoney(DEFAULT_TRANSACTION_MAXFEE)));\n    strUsage += HelpMessageOpt(\"-printtoconsole\", _(\"Send trace/debug info to console instead of debug.log file\"));\n    strUsage += HelpMessageOpt(\"-prunedebuglogfile\", _(\"Prune (limit) filesize of debug.log\")); // FIXME.SUGAR // prune debug.log\n    if (showDebug)\n    {\n        strUsage += HelpMessageOpt(\"-printpriority\", strprintf(\"Log transaction fee per kB when mining blocks (default: %u)\", DEFAULT_PRINTPRIORITY));\n    }\n    strUsage += HelpMessageOpt(\"-shrinkdebugfile\", _(\"Shrink debug.log file on client startup (default: 1 when no -debug)\"));\n\n    AppendParamsHelpMessages(strUsage, showDebug);\n\n    strUsage += HelpMessageGroup(_(\"Node relay options:\"));\n    if (showDebug) {\n        strUsage += HelpMessageOpt(\"-acceptnonstdtxn\", strprintf(\"Relay and mine \\\"non-standard\\\" transactions (%sdefault: %u)\", \"testnet/regtest only; \", !testnetChainParams->RequireStandard()));\n        strUsage += HelpMessageOpt(\"-incrementalrelayfee=<amt>\", strprintf(\"Fee rate (in %s/kB) used to define cost of relay, used for mempool limiting and BIP 125 replacement. (default: %s)\", CURRENCY_UNIT, FormatMoney(DEFAULT_INCREMENTAL_RELAY_FEE)));\n        strUsage += HelpMessageOpt(\"-dustrelayfee=<amt>\", strprintf(\"Fee rate (in %s/kB) used to defined dust, the value of an output such that it will cost more than its value in fees at this fee rate to spend it. (default: %s)\", CURRENCY_UNIT, FormatMoney(DUST_RELAY_TX_FEE)));\n    }\n    strUsage += HelpMessageOpt(\"-bytespersigop\", strprintf(_(\"Equivalent bytes per sigop in transactions for relay and mining (default: %u)\"), DEFAULT_BYTES_PER_SIGOP));\n    strUsage += HelpMessageOpt(\"-datacarrier\", strprintf(_(\"Relay and mine data carrier transactions (default: %u)\"), DEFAULT_ACCEPT_DATACARRIER));\n    strUsage += HelpMessageOpt(\"-datacarriersize\", strprintf(_(\"Maximum size of data in data carrier transactions we relay and mine (default: %u)\"), MAX_OP_RETURN_RELAY));\n    strUsage += HelpMessageOpt(\"-mempoolreplacement\", strprintf(_(\"Enable transaction replacement in the memory pool (default: %u)\"), DEFAULT_ENABLE_REPLACEMENT));\n    strUsage += HelpMessageOpt(\"-minrelaytxfee=<amt>\", strprintf(_(\"Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)\"),\n        CURRENCY_UNIT, FormatMoney(DEFAULT_MIN_RELAY_TX_FEE)));\n    strUsage += HelpMessageOpt(\"-whitelistrelay\", strprintf(_(\"Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)\"), DEFAULT_WHITELISTRELAY));\n    strUsage += HelpMessageOpt(\"-whitelistforcerelay\", strprintf(_(\"Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)\"), DEFAULT_WHITELISTFORCERELAY));\n\n    strUsage += HelpMessageGroup(_(\"Block creation options:\"));\n    strUsage += HelpMessageOpt(\"-blockmaxweight=<n>\", strprintf(_(\"Set maximum BIP141 block weight (default: %d)\"), DEFAULT_BLOCK_MAX_WEIGHT));\n    strUsage += HelpMessageOpt(\"-blockmintxfee=<amt>\", strprintf(_(\"Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)\"), CURRENCY_UNIT, FormatMoney(DEFAULT_BLOCK_MIN_TX_FEE)));\n    if (showDebug)\n        strUsage += HelpMessageOpt(\"-blockversion=<n>\", \"Override block version to test forking scenarios\");\n\n    strUsage += HelpMessageGroup(_(\"RPC server options:\"));\n    strUsage += HelpMessageOpt(\"-server\", _(\"Accept command line and JSON-RPC commands\"));\n    strUsage += HelpMessageOpt(\"-rest\", strprintf(_(\"Accept public REST requests (default: %u)\"), DEFAULT_REST_ENABLE));\n    strUsage += HelpMessageOpt(\"-rpcbind=<addr>[:port]\", _(\"Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)\"));\n    strUsage += HelpMessageOpt(\"-rpccookiefile=<loc>\", _(\"Location of the auth cookie (default: data dir)\"));\n    strUsage += HelpMessageOpt(\"-rpcuser=<user>\", _(\"Username for JSON-RPC connections\"));\n    strUsage += HelpMessageOpt(\"-rpcpassword=<pw>\", _(\"Password for JSON-RPC connections\"));\n    strUsage += HelpMessageOpt(\"-rpcauth=<userpw>\", _(\"Username and hashed password for JSON-RPC connections. The field <userpw> comes in the format: <USERNAME>:<SALT>$<HASH>. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This option can be specified multiple times\"));\n    strUsage += HelpMessageOpt(\"-rpcport=<port>\", strprintf(_(\"Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)\"), defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort()));\n    strUsage += HelpMessageOpt(\"-rpcallowip=<ip>\", _(\"Allow JSON-RPC connections from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times\"));\n    strUsage += HelpMessageOpt(\"-rpcserialversion\", strprintf(_(\"Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)\"), DEFAULT_RPC_SERIALIZE_VERSION));\n    strUsage += HelpMessageOpt(\"-rpcthreads=<n>\", strprintf(_(\"Set the number of threads to service RPC calls (default: %d)\"), DEFAULT_HTTP_THREADS));\n    if (showDebug) {\n        strUsage += HelpMessageOpt(\"-rpcworkqueue=<n>\", strprintf(\"Set the depth of the work queue to service RPC calls (default: %d)\", DEFAULT_HTTP_WORKQUEUE));\n        strUsage += HelpMessageOpt(\"-rpcservertimeout=<n>\", strprintf(\"Timeout during HTTP requests (default: %d)\", DEFAULT_HTTP_SERVER_TIMEOUT));\n    }\n\n    return strUsage;\n}\n\n// FIXME.SUGAR\n// QT About Sugarchain\nstd::string LicenseInfo()\n{\n    const std::string URL_SOURCE_CODE = \"<https://github.com/sugarchain-project/sugarchain>\";\n    const std::string URL_WEBSITE = \"<https://sugarchain.org>\";\n\n    // BEGIN - Adding Additional CopyrightHolders (1/2)\n    const std::string Copyright_1 = strprintf(_(\"Copyright (C) %i-%i\"), 2009, 2010) + \" \" + \"Satoshi Nakamoto\";\n    const std::string Copyright_2 = strprintf(_(\"Copyright (C) %i-%i\"), 2009, 2018) + \" \" + \"The Bitcoin Core developers\";\n    const std::string Copyright_3 = strprintf(_(\"Copyright (C) %i-%i\"), 2013, 2019) + \" \" + \"Alexander Peslyak - Yespower 1.0.1\";\n    const std::string Copyright_4 = strprintf(_(\"Copyright (C) %i-%i\"), 2016, 2018) + \" \" + \"The Zcash developers - DigiShieldZEC\";\n    // END - Adding Additional CopyrightHolders (1/2)\n\n    return\n           // BEGIN - Placing Additional CopyrightHolders\n           Copyright_1 + \"\\n\" +\n           Copyright_2 + \"\\n\" +\n           Copyright_3 + \"\\n\" +\n           Copyright_4 + \"\\n\" +\n           CopyrightHolders(strprintf(_(\"Copyright (C) %i-%i\"), 2018, COPYRIGHT_YEAR) + \" \") + \"\\n\" +\n           // END - Placing Additional CopyrightHolders\n           \"\\n\" +\n           strprintf(_(\"Please contribute if you find %s useful. \"\n                       \"Visit %s for further information about the software.\"),\n               PACKAGE_NAME, URL_WEBSITE) +\n           \"\\n\" +\n           strprintf(_(\"The source code is available from %s.\"),\n               URL_SOURCE_CODE) +\n           \"\\n\" +\n           \"\\n\" +\n           _(\"This is experimental software.\") + \"\\n\" +\n           strprintf(_(\"Distributed under the MIT software license, see the accompanying file %s or %s\"), \"COPYING\", \"<https://opensource.org/licenses/MIT>\") + \"\\n\" +\n           \"\\n\" +\n           strprintf(_(\"This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.\"), \"<https://www.openssl.org>\") +\n           \"\\n\";\n}\n\nstatic void BlockNotifyCallback(bool initialSync, const CBlockIndex *pBlockIndex)\n{\n    if (initialSync || !pBlockIndex)\n        return;\n\n    std::string strCmd = gArgs.GetArg(\"-blocknotify\", \"\");\n    if (!strCmd.empty()) {\n        boost::replace_all(strCmd, \"%s\", pBlockIndex->GetBlockHash().GetHex());\n        boost::thread t(runCommand, strCmd); // thread runs free\n    }\n}\n\nstatic bool fHaveGenesis = false;\nstatic CWaitableCriticalSection cs_GenesisWait;\nstatic CConditionVariable condvar_GenesisWait;\n\nstatic void BlockNotifyGenesisWait(bool, const CBlockIndex *pBlockIndex)\n{\n    if (pBlockIndex != nullptr) {\n        {\n            WaitableLock lock_GenesisWait(cs_GenesisWait);\n            fHaveGenesis = true;\n        }\n        condvar_GenesisWait.notify_all();\n    }\n}\n\nstruct CImportingNow\n{\n    CImportingNow() {\n        assert(fImporting == false);\n        fImporting = true;\n    }\n\n    ~CImportingNow() {\n        assert(fImporting == true);\n        fImporting = false;\n    }\n};\n\n\n// If we're using -prune with -reindex, then delete block files that will be ignored by the\n// reindex.  Since reindexing works by starting at block file 0 and looping until a blockfile\n// is missing, do the same here to delete any later block files after a gap.  Also delete all\n// rev files since they'll be rewritten by the reindex anyway.  This ensures that vinfoBlockFile\n// is in sync with what's actually on disk by the time we start downloading, so that pruning\n// works correctly.\nvoid CleanupBlockRevFiles()\n{\n    std::map<std::string, fs::path> mapBlockFiles;\n\n    // Glob all blk?????.dat and rev?????.dat files from the blocks directory.\n    // Remove the rev files immediately and insert the blk file paths into an\n    // ordered map keyed by block file index.\n    LogPrintf(\"Removing unusable blk?????.dat and rev?????.dat files for -reindex with -prune\\n\");\n    fs::path blocksdir = GetDataDir() / \"blocks\";\n    for (fs::directory_iterator it(blocksdir); it != fs::directory_iterator(); it++) {\n        if (fs::is_regular_file(*it) &&\n            it->path().filename().string().length() == 12 &&\n            it->path().filename().string().substr(8,4) == \".dat\")\n        {\n            if (it->path().filename().string().substr(0,3) == \"blk\")\n                mapBlockFiles[it->path().filename().string().substr(3,5)] = it->path();\n            else if (it->path().filename().string().substr(0,3) == \"rev\")\n                remove(it->path());\n        }\n    }\n\n    // Remove all block files that aren't part of a contiguous set starting at\n    // zero by walking the ordered map (keys are block file indices) by\n    // keeping a separate counter.  Once we hit a gap (or if 0 doesn't exist)\n    // start removing block files.\n    int nContigCounter = 0;\n    for (const std::pair<std::string, fs::path>& item : mapBlockFiles) {\n        if (atoi(item.first) == nContigCounter) {\n            nContigCounter++;\n            continue;\n        }\n        remove(item.second);\n    }\n}\n\nvoid ThreadImport(std::vector<fs::path> vImportFiles)\n{\n    const CChainParams& chainparams = Params();\n    RenameThread(\"sugarchain-loadblk\");\n\n    {\n    CImportingNow imp;\n\n    // -reindex\n    if (fReindex) {\n        int nFile = 0;\n        while (true) {\n            CDiskBlockPos pos(nFile, 0);\n            if (!fs::exists(GetBlockPosFilename(pos, \"blk\")))\n                break; // No block files left to reindex\n            FILE *file = OpenBlockFile(pos, true);\n            if (!file)\n                break; // This error is logged in OpenBlockFile\n            LogPrintf(\"Reindexing block file blk%05u.dat...\\n\", (unsigned int)nFile);\n            LoadExternalBlockFile(chainparams, file, &pos);\n            nFile++;\n        }\n        pblocktree->WriteReindexing(false);\n        fReindex = false;\n        LogPrintf(\"Reindexing finished\\n\");\n        // To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked):\n        LoadGenesisBlock(chainparams);\n    }\n\n    // hardcoded $DATADIR/bootstrap.dat\n    fs::path pathBootstrap = GetDataDir() / \"bootstrap.dat\";\n    if (fs::exists(pathBootstrap)) {\n        FILE *file = fsbridge::fopen(pathBootstrap, \"rb\");\n        if (file) {\n            fs::path pathBootstrapOld = GetDataDir() / \"bootstrap.dat.old\";\n            LogPrintf(\"Importing bootstrap.dat...\\n\");\n            LoadExternalBlockFile(chainparams, file);\n            RenameOver(pathBootstrap, pathBootstrapOld);\n        } else {\n            LogPrintf(\"Warning: Could not open bootstrap file %s\\n\", pathBootstrap.string());\n        }\n    }\n\n    // -loadblock=\n    for (const fs::path& path : vImportFiles) {\n        FILE *file = fsbridge::fopen(path, \"rb\");\n        if (file) {\n            LogPrintf(\"Importing blocks file %s...\\n\", path.string());\n            LoadExternalBlockFile(chainparams, file);\n        } else {\n            LogPrintf(\"Warning: Could not open blocks file %s\\n\", path.string());\n        }\n    }\n\n    // scan for better chains in the block chain database, that are not yet connected in the active best chain\n    CValidationState state;\n    if (!ActivateBestChain(state, chainparams)) {\n        LogPrintf(\"Failed to connect best block\\n\");\n        StartShutdown();\n        return;\n    }\n\n    if (gArgs.GetBoolArg(\"-stopafterblockimport\", DEFAULT_STOPAFTERBLOCKIMPORT)) {\n        LogPrintf(\"Stopping after block import\\n\");\n        StartShutdown();\n        return;\n    }\n    } // End scope of CImportingNow\n    if (gArgs.GetArg(\"-persistmempool\", DEFAULT_PERSIST_MEMPOOL)) {\n        LoadMempool();\n        fDumpMempoolLater = !fRequestShutdown;\n    }\n}\n\n/** Sanity checks\n *  Ensure that Bitcoin is running in a usable environment with all\n *  necessary library support.\n */\nbool InitSanityCheck(void)\n{\n    if(!ECC_InitSanityCheck()) {\n        InitError(\"Elliptic curve cryptography sanity check failure. Aborting.\");\n        return false;\n    }\n\n    if (!glibc_sanity_test() || !glibcxx_sanity_test())\n        return false;\n\n    if (!Random_SanityCheck()) {\n        InitError(\"OS cryptographic RNG sanity check failure. Aborting.\");\n        return false;\n    }\n\n    return true;\n}\n\nbool AppInitServers()\n{\n    RPCServer::OnStarted(&OnRPCStarted);\n    RPCServer::OnStopped(&OnRPCStopped);\n    if (!InitHTTPServer())\n        return false;\n    if (!StartRPC())\n        return false;\n    if (!StartHTTPRPC())\n        return false;\n    if (gArgs.GetBoolArg(\"-rest\", DEFAULT_REST_ENABLE) && !StartREST())\n        return false;\n    if (!StartHTTPServer())\n        return false;\n    return true;\n}\n\n// Parameter interaction based on rules\nvoid InitParameterInteraction()\n{\n    // when specifying an explicit binding address, you want to listen on it\n    // even when -connect or -proxy is specified\n    if (gArgs.IsArgSet(\"-bind\")) {\n        if (gArgs.SoftSetBoolArg(\"-listen\", true))\n            LogPrintf(\"%s: parameter interaction: -bind set -> setting -listen=1\\n\", __func__);\n    }\n    if (gArgs.IsArgSet(\"-whitebind\")) {\n        if (gArgs.SoftSetBoolArg(\"-listen\", true))\n            LogPrintf(\"%s: parameter interaction: -whitebind set -> setting -listen=1\\n\", __func__);\n    }\n\n    if (gArgs.IsArgSet(\"-connect\")) {\n        // when only connecting to trusted nodes, do not seed via DNS, or listen by default\n        if (gArgs.SoftSetBoolArg(\"-dnsseed\", false))\n            LogPrintf(\"%s: parameter interaction: -connect set -> setting -dnsseed=0\\n\", __func__);\n        if (gArgs.SoftSetBoolArg(\"-listen\", false))\n            LogPrintf(\"%s: parameter interaction: -connect set -> setting -listen=0\\n\", __func__);\n    }\n\n    if (gArgs.IsArgSet(\"-proxy\")) {\n        // to protect privacy, do not listen by default if a default proxy server is specified\n        if (gArgs.SoftSetBoolArg(\"-listen\", false))\n            LogPrintf(\"%s: parameter interaction: -proxy set -> setting -listen=0\\n\", __func__);\n        // to protect privacy, do not use UPNP when a proxy is set. The user may still specify -listen=1\n        // to listen locally, so don't rely on this happening through -listen below.\n        if (gArgs.SoftSetBoolArg(\"-upnp\", false))\n            LogPrintf(\"%s: parameter interaction: -proxy set -> setting -upnp=0\\n\", __func__);\n        // to protect privacy, do not discover addresses by default\n        if (gArgs.SoftSetBoolArg(\"-discover\", false))\n            LogPrintf(\"%s: parameter interaction: -proxy set -> setting -discover=0\\n\", __func__);\n    }\n\n    if (!gArgs.GetBoolArg(\"-listen\", DEFAULT_LISTEN)) {\n        // do not map ports or try to retrieve public IP when not listening (pointless)\n        if (gArgs.SoftSetBoolArg(\"-upnp\", false))\n            LogPrintf(\"%s: parameter interaction: -listen=0 -> setting -upnp=0\\n\", __func__);\n        if (gArgs.SoftSetBoolArg(\"-discover\", false))\n            LogPrintf(\"%s: parameter interaction: -listen=0 -> setting -discover=0\\n\", __func__);\n        if (gArgs.SoftSetBoolArg(\"-listenonion\", false))\n            LogPrintf(\"%s: parameter interaction: -listen=0 -> setting -listenonion=0\\n\", __func__);\n    }\n\n    if (gArgs.IsArgSet(\"-externalip\")) {\n        // if an explicit public IP is specified, do not try to find others\n        if (gArgs.SoftSetBoolArg(\"-discover\", false))\n            LogPrintf(\"%s: parameter interaction: -externalip set -> setting -discover=0\\n\", __func__);\n    }\n\n    // disable whitelistrelay in blocksonly mode\n    if (gArgs.GetBoolArg(\"-blocksonly\", DEFAULT_BLOCKSONLY)) {\n        if (gArgs.SoftSetBoolArg(\"-whitelistrelay\", false))\n            LogPrintf(\"%s: parameter interaction: -blocksonly=1 -> setting -whitelistrelay=0\\n\", __func__);\n    }\n\n    // Forcing relay from whitelisted hosts implies we will accept relays from them in the first place.\n    if (gArgs.GetBoolArg(\"-whitelistforcerelay\", DEFAULT_WHITELISTFORCERELAY)) {\n        if (gArgs.SoftSetBoolArg(\"-whitelistrelay\", true))\n            LogPrintf(\"%s: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1\\n\", __func__);\n    }\n}\n\nstatic std::string ResolveErrMsg(const char * const optname, const std::string& strBind)\n{\n    return strprintf(_(\"Cannot resolve -%s address: '%s'\"), optname, strBind);\n}\n\nvoid InitLogging()\n{\n    fPrintToConsole = gArgs.GetBoolArg(\"-printtoconsole\", false);\n    fPruneDebugLog = gArgs.GetBoolArg(\"-prunedebuglogfile\", false); // FIXME.SUGAR // prune debug.log\n    fLogTimestamps = gArgs.GetBoolArg(\"-logtimestamps\", DEFAULT_LOGTIMESTAMPS);\n    fLogTimeMicros = gArgs.GetBoolArg(\"-logtimemicros\", DEFAULT_LOGTIMEMICROS);\n    fLogIPs = gArgs.GetBoolArg(\"-logips\", DEFAULT_LOGIPS);\n\n    LogPrintf(\"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\");\n    std::string version_string = FormatFullVersion();\n#ifdef DEBUG\n    version_string += \" (debug build)\";\n#else\n    version_string += \" (release build)\";\n#endif\n    LogPrintf(PACKAGE_NAME \" version %s\\n\", version_string);\n}\n\nnamespace { // Variables internal to initialization process only\n\nint nMaxConnections;\nint nUserMaxConnections;\nint nFD;\nServiceFlags nLocalServices = ServiceFlags(NODE_NETWORK | NODE_NETWORK_LIMITED);\n\n} // namespace\n\n[[noreturn]] static void new_handler_terminate()\n{\n    // Rather than throwing std::bad-alloc if allocation fails, terminate\n    // immediately to (try to) avoid chain corruption.\n    // Since LogPrintf may itself allocate memory, set the handler directly\n    // to terminate first.\n    std::set_new_handler(std::terminate);\n    LogPrintf(\"Error: Out of memory. Terminating.\\n\");\n\n    // The log was successful, terminate now.\n    std::terminate();\n};\n\nbool AppInitBasicSetup()\n{\n    // ********************************************************* Step 1: setup\n#ifdef _MSC_VER\n    // Turn off Microsoft heap dump noise\n    _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);\n    _CrtSetReportFile(_CRT_WARN, CreateFileA(\"NUL\", GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, 0));\n    // Disable confusing \"helpful\" text message on abort, Ctrl-C\n    _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);\n#endif\n#ifdef WIN32\n    // Enable Data Execution Prevention (DEP)\n    // Minimum supported OS versions: WinXP SP3, WinVista >= SP1, Win Server 2008\n    // A failure is non-critical and needs no further attention!\n#ifndef PROCESS_DEP_ENABLE\n    // We define this here, because GCCs winbase.h limits this to _WIN32_WINNT >= 0x0601 (Windows 7),\n    // which is not correct. Can be removed, when GCCs winbase.h is fixed!\n#define PROCESS_DEP_ENABLE 0x00000001\n#endif\n    typedef BOOL (WINAPI *PSETPROCDEPPOL)(DWORD);\n    PSETPROCDEPPOL setProcDEPPol = (PSETPROCDEPPOL)GetProcAddress(GetModuleHandleA(\"Kernel32.dll\"), \"SetProcessDEPPolicy\");\n    if (setProcDEPPol != nullptr) setProcDEPPol(PROCESS_DEP_ENABLE);\n#endif\n\n    if (!SetupNetworking())\n        return InitError(\"Initializing networking failed\");\n\n#ifndef WIN32\n    if (!gArgs.GetBoolArg(\"-sysperms\", false)) {\n        umask(077);\n    }\n\n    // Clean shutdown on SIGTERM\n    registerSignalHandler(SIGTERM, HandleSIGTERM);\n    registerSignalHandler(SIGINT, HandleSIGTERM);\n\n    // Reopen debug.log on SIGHUP\n    registerSignalHandler(SIGHUP, HandleSIGHUP);\n\n    // Ignore SIGPIPE, otherwise it will bring the daemon down if the client closes unexpectedly\n    signal(SIGPIPE, SIG_IGN);\n#else\n    SetConsoleCtrlHandler(consoleCtrlHandler, true);\n#endif\n\n    std::set_new_handler(new_handler_terminate);\n\n    return true;\n}\n\nbool AppInitParameterInteraction()\n{\n    const CChainParams& chainparams = Params();\n    // ********************************************************* Step 2: parameter interactions\n\n    // also see: InitParameterInteraction()\n\n    // if using block pruning, then disallow txindex\n    if (gArgs.GetArg(\"-prune\", 0)) {\n        if (gArgs.GetBoolArg(\"-txindex\", DEFAULT_TXINDEX))\n            return InitError(_(\"Prune mode is incompatible with -txindex.\"));\n    }\n\n    // -bind and -whitebind can't be set when not listening\n    size_t nUserBind = gArgs.GetArgs(\"-bind\").size() + gArgs.GetArgs(\"-whitebind\").size();\n    if (nUserBind != 0 && !gArgs.GetBoolArg(\"-listen\", DEFAULT_LISTEN)) {\n        return InitError(\"Cannot set -bind or -whitebind together with -listen=0\");\n    }\n\n    // Make sure enough file descriptors are available\n    int nBind = std::max(nUserBind, size_t(1));\n    nUserMaxConnections = gArgs.GetArg(\"-maxconnections\", DEFAULT_MAX_PEER_CONNECTIONS);\n    nMaxConnections = std::max(nUserMaxConnections, 0);\n\n    // Trim requested connection counts, to fit into system limitations\n    nMaxConnections = std::max(std::min(nMaxConnections, (int)(FD_SETSIZE - nBind - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS)), 0);\n    nFD = RaiseFileDescriptorLimit(nMaxConnections + MIN_CORE_FILEDESCRIPTORS + MAX_ADDNODE_CONNECTIONS);\n    if (nFD < MIN_CORE_FILEDESCRIPTORS)\n        return InitError(_(\"Not enough file descriptors available.\"));\n    nMaxConnections = std::min(nFD - MIN_CORE_FILEDESCRIPTORS - MAX_ADDNODE_CONNECTIONS, nMaxConnections);\n\n    if (nMaxConnections < nUserMaxConnections)\n        InitWarning(strprintf(_(\"Reducing -maxconnections from %d to %d, because of system limitations.\"), nUserMaxConnections, nMaxConnections));\n\n    // ********************************************************* Step 3: parameter-to-internal-flags\n    if (gArgs.IsArgSet(\"-debug\")) {\n        // Special-case: if -debug=0/-nodebug is set, turn off debugging messages\n        const std::vector<std::string> categories = gArgs.GetArgs(\"-debug\");\n\n        if (std::none_of(categories.begin(), categories.end(),\n            [](std::string cat){return cat == \"0\" || cat == \"none\";})) {\n            for (const auto& cat : categories) {\n                uint32_t flag = 0;\n                if (!GetLogCategory(&flag, &cat)) {\n                    InitWarning(strprintf(_(\"Unsupported logging category %s=%s.\"), \"-debug\", cat));\n                    continue;\n                }\n                logCategories |= flag;\n            }\n        }\n    }\n\n    // Now remove the logging categories which were explicitly excluded\n    for (const std::string& cat : gArgs.GetArgs(\"-debugexclude\")) {\n        uint32_t flag = 0;\n        if (!GetLogCategory(&flag, &cat)) {\n            InitWarning(strprintf(_(\"Unsupported logging category %s=%s.\"), \"-debugexclude\", cat));\n            continue;\n        }\n        logCategories &= ~flag;\n    }\n\n    // Check for -debugnet\n    if (gArgs.GetBoolArg(\"-debugnet\", false))\n        InitWarning(_(\"Unsupported argument -debugnet ignored, use -debug=net.\"));\n    // Check for -socks - as this is a privacy risk to continue, exit here\n    if (gArgs.IsArgSet(\"-socks\"))\n        return InitError(_(\"Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.\"));\n    // Check for -tor - as this is a privacy risk to continue, exit here\n    if (gArgs.GetBoolArg(\"-tor\", false))\n        return InitError(_(\"Unsupported argument -tor found, use -onion.\"));\n\n    if (gArgs.GetBoolArg(\"-benchmark\", false))\n        InitWarning(_(\"Unsupported argument -benchmark ignored, use -debug=bench.\"));\n\n    if (gArgs.GetBoolArg(\"-whitelistalwaysrelay\", false))\n        InitWarning(_(\"Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.\"));\n\n    if (gArgs.IsArgSet(\"-blockminsize\"))\n        InitWarning(\"Unsupported argument -blockminsize ignored.\");\n\n    // Checkmempool and checkblockindex default to true in regtest mode\n    int ratio = std::min<int>(std::max<int>(gArgs.GetArg(\"-checkmempool\", chainparams.DefaultConsistencyChecks() ? 1 : 0), 0), 1000000);\n    if (ratio != 0) {\n        mempool.setSanityCheck(1.0 / ratio);\n    }\n    fCheckBlockIndex = gArgs.GetBoolArg(\"-checkblockindex\", chainparams.DefaultConsistencyChecks());\n    fCheckpointsEnabled = gArgs.GetBoolArg(\"-checkpoints\", DEFAULT_CHECKPOINTS_ENABLED);\n\n    hashAssumeValid = uint256S(gArgs.GetArg(\"-assumevalid\", chainparams.GetConsensus().defaultAssumeValid.GetHex()));\n    if (!hashAssumeValid.IsNull())\n        LogPrintf(\"Assuming ancestors of block %s have valid signatures.\\n\", hashAssumeValid.GetHex());\n    else\n        LogPrintf(\"Validating signatures for all blocks.\\n\");\n\n    if (gArgs.IsArgSet(\"-minimumchainwork\")) {\n        const std::string minChainWorkStr = gArgs.GetArg(\"-minimumchainwork\", \"\");\n        if (!IsHexNumber(minChainWorkStr)) {\n            return InitError(strprintf(\"Invalid non-hex (%s) minimum chain work value specified\", minChainWorkStr));\n        }\n        nMinimumChainWork = UintToArith256(uint256S(minChainWorkStr));\n    } else {\n        nMinimumChainWork = UintToArith256(chainparams.GetConsensus().nMinimumChainWork);\n    }\n    LogPrintf(\"Setting nMinimumChainWork=%s\\n\", nMinimumChainWork.GetHex());\n    if (nMinimumChainWork < UintToArith256(chainparams.GetConsensus().nMinimumChainWork)) {\n        LogPrintf(\"Warning: nMinimumChainWork set below default value of %s\\n\", chainparams.GetConsensus().nMinimumChainWork.GetHex());\n    }\n\n    // mempool limits\n    int64_t nMempoolSizeMax = gArgs.GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;\n    int64_t nMempoolSizeMin = gArgs.GetArg(\"-limitdescendantsize\", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40;\n    if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin)\n        return InitError(strprintf(_(\"-maxmempool must be at least %d MB\"), std::ceil(nMempoolSizeMin / 1000000.0)));\n    // incremental relay fee sets the minimum feerate increase necessary for BIP 125 replacement in the mempool\n    // and the amount the mempool min fee increases above the feerate of txs evicted due to mempool limiting.\n    if (gArgs.IsArgSet(\"-incrementalrelayfee\"))\n    {\n        CAmount n = 0;\n        if (!ParseMoney(gArgs.GetArg(\"-incrementalrelayfee\", \"\"), n))\n            return InitError(AmountErrMsg(\"incrementalrelayfee\", gArgs.GetArg(\"-incrementalrelayfee\", \"\")));\n        incrementalRelayFee = CFeeRate(n);\n    }\n\n    // -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency\n    nScriptCheckThreads = gArgs.GetArg(\"-par\", DEFAULT_SCRIPTCHECK_THREADS);\n    if (nScriptCheckThreads <= 0)\n        nScriptCheckThreads += GetNumCores();\n    if (nScriptCheckThreads <= 1)\n        nScriptCheckThreads = 0;\n    else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS)\n        nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS;\n\n    // block pruning; get the amount of disk space (in MiB) to allot for block & undo files\n    int64_t nPruneArg = gArgs.GetArg(\"-prune\", 0);\n    if (nPruneArg < 0) {\n        return InitError(_(\"Prune cannot be configured with a negative value.\"));\n    }\n    nPruneTarget = (uint64_t) nPruneArg * 1024 * 1024;\n    if (nPruneArg == 1) {  // manual pruning: -prune=1\n        LogPrintf(\"Block pruning enabled.  Use RPC call pruneblockchain(height) to manually prune block and undo files.\\n\");\n        nPruneTarget = std::numeric_limits<uint64_t>::max();\n        fPruneMode = true;\n    } else if (nPruneTarget) {\n        if (nPruneTarget < MIN_DISK_SPACE_FOR_BLOCK_FILES) {\n            return InitError(strprintf(_(\"Prune configured below the minimum of %d MiB.  Please use a higher number.\"), MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024));\n        }\n        LogPrintf(\"Prune configured to target %uMiB on disk for block and undo files.\\n\", nPruneTarget / 1024 / 1024);\n        fPruneMode = true;\n    }\n\n    nConnectTimeout = gArgs.GetArg(\"-timeout\", DEFAULT_CONNECT_TIMEOUT);\n    if (nConnectTimeout <= 0)\n        nConnectTimeout = DEFAULT_CONNECT_TIMEOUT;\n\n    if (gArgs.IsArgSet(\"-minrelaytxfee\")) {\n        CAmount n = 0;\n        if (!ParseMoney(gArgs.GetArg(\"-minrelaytxfee\", \"\"), n)) {\n            return InitError(AmountErrMsg(\"minrelaytxfee\", gArgs.GetArg(\"-minrelaytxfee\", \"\")));\n        }\n        // High fee check is done afterward in WalletParameterInteraction()\n        ::minRelayTxFee = CFeeRate(n);\n    } else if (incrementalRelayFee > ::minRelayTxFee) {\n        // Allow only setting incrementalRelayFee to control both\n        ::minRelayTxFee = incrementalRelayFee;\n        LogPrintf(\"Increasing minrelaytxfee to %s to match incrementalrelayfee\\n\",::minRelayTxFee.ToString());\n    }\n\n    // Sanity check argument for min fee for including tx in block\n    // TODO: Harmonize which arguments need sanity checking and where that happens\n    if (gArgs.IsArgSet(\"-blockmintxfee\"))\n    {\n        CAmount n = 0;\n        if (!ParseMoney(gArgs.GetArg(\"-blockmintxfee\", \"\"), n))\n            return InitError(AmountErrMsg(\"blockmintxfee\", gArgs.GetArg(\"-blockmintxfee\", \"\")));\n    }\n\n    // Feerate used to define dust.  Shouldn't be changed lightly as old\n    // implementations may inadvertently create non-standard transactions\n    if (gArgs.IsArgSet(\"-dustrelayfee\"))\n    {\n        CAmount n = 0;\n        if (!ParseMoney(gArgs.GetArg(\"-dustrelayfee\", \"\"), n) || 0 == n)\n            return InitError(AmountErrMsg(\"dustrelayfee\", gArgs.GetArg(\"-dustrelayfee\", \"\")));\n        dustRelayFee = CFeeRate(n);\n    }\n\n    fRequireStandard = !gArgs.GetBoolArg(\"-acceptnonstdtxn\", !chainparams.RequireStandard());\n    if (chainparams.RequireStandard() && !fRequireStandard)\n        return InitError(strprintf(\"acceptnonstdtxn is not currently supported for %s chain\", chainparams.NetworkIDString()));\n    nBytesPerSigOp = gArgs.GetArg(\"-bytespersigop\", nBytesPerSigOp);\n\n#ifdef ENABLE_WALLET\n    if (!WalletParameterInteraction())\n        return false;\n#endif\n\n    fIsBareMultisigStd = gArgs.GetBoolArg(\"-permitbaremultisig\", DEFAULT_PERMIT_BAREMULTISIG);\n    fAcceptDatacarrier = gArgs.GetBoolArg(\"-datacarrier\", DEFAULT_ACCEPT_DATACARRIER);\n    nMaxDatacarrierBytes = gArgs.GetArg(\"-datacarriersize\", nMaxDatacarrierBytes);\n\n    // Option to startup with mocktime set (used for regression testing):\n    SetMockTime(gArgs.GetArg(\"-mocktime\", 0)); // SetMockTime(0) is a no-op\n\n    if (gArgs.GetBoolArg(\"-peerbloomfilters\", DEFAULT_PEERBLOOMFILTERS))\n        nLocalServices = ServiceFlags(nLocalServices | NODE_BLOOM);\n\n    if (gArgs.GetArg(\"-rpcserialversion\", DEFAULT_RPC_SERIALIZE_VERSION) < 0)\n        return InitError(\"rpcserialversion must be non-negative.\");\n\n    if (gArgs.GetArg(\"-rpcserialversion\", DEFAULT_RPC_SERIALIZE_VERSION) > 1)\n        return InitError(\"unknown rpcserialversion requested.\");\n\n    nMaxTipAge = gArgs.GetArg(\"-maxtipage\", DEFAULT_MAX_TIP_AGE);\n\n    fEnableReplacement = gArgs.GetBoolArg(\"-mempoolreplacement\", DEFAULT_ENABLE_REPLACEMENT);\n    if ((!fEnableReplacement) && gArgs.IsArgSet(\"-mempoolreplacement\")) {\n        // Minimal effort at forwards compatibility\n        std::string strReplacementModeList = gArgs.GetArg(\"-mempoolreplacement\", \"\");  // default is impossible\n        std::vector<std::string> vstrReplacementModes;\n        boost::split(vstrReplacementModes, strReplacementModeList, boost::is_any_of(\",\"));\n        fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), \"fee\") != vstrReplacementModes.end());\n    }\n\n    if (gArgs.IsArgSet(\"-vbparams\")) {\n        // Allow overriding version bits parameters for testing\n        if (!chainparams.MineBlocksOnDemand()) {\n            return InitError(\"Version bits parameters may only be overridden on regtest.\");\n        }\n        for (const std::string& strDeployment : gArgs.GetArgs(\"-vbparams\")) {\n            std::vector<std::string> vDeploymentParams;\n            boost::split(vDeploymentParams, strDeployment, boost::is_any_of(\":\"));\n            if (vDeploymentParams.size() != 3) {\n                return InitError(\"Version bits parameters malformed, expecting deployment:start:end\");\n            }\n            int64_t nStartTime, nTimeout;\n            if (!ParseInt64(vDeploymentParams[1], &nStartTime)) {\n                return InitError(strprintf(\"Invalid nStartTime (%s)\", vDeploymentParams[1]));\n            }\n            if (!ParseInt64(vDeploymentParams[2], &nTimeout)) {\n                return InitError(strprintf(\"Invalid nTimeout (%s)\", vDeploymentParams[2]));\n            }\n            bool found = false;\n            for (int j=0; j<(int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j)\n            {\n                if (vDeploymentParams[0].compare(VersionBitsDeploymentInfo[j].name) == 0) {\n                    UpdateVersionBitsParameters(Consensus::DeploymentPos(j), nStartTime, nTimeout);\n                    found = true;\n                    LogPrintf(\"Setting version bits activation parameters for %s to start=%ld, timeout=%ld\\n\", vDeploymentParams[0], nStartTime, nTimeout);\n                    break;\n                }\n            }\n            if (!found) {\n                return InitError(strprintf(\"Invalid deployment (%s)\", vDeploymentParams[0]));\n            }\n        }\n    }\n    return true;\n}\n\nstatic bool LockDataDirectory(bool probeOnly)\n{\n    // Make sure only a single Bitcoin process is using the data directory.\n    fs::path datadir = GetDataDir();\n    if (!LockDirectory(datadir, \".lock\", probeOnly)) {\n        return InitError(strprintf(_(\"Cannot obtain a lock on data directory %s. %s is probably already running.\"), datadir.string(), _(PACKAGE_NAME)));\n    }\n    return true;\n}\n\nbool AppInitSanityChecks()\n{\n    // ********************************************************* Step 4: sanity checks\n\n    // Initialize elliptic curve code\n    std::string sha256_algo = SHA256AutoDetect();\n    LogPrintf(\"Using the '%s' SHA256 implementation\\n\", sha256_algo);\n    RandomInit();\n    ECC_Start();\n    globalVerifyHandle.reset(new ECCVerifyHandle());\n\n    // Sanity check\n    if (!InitSanityCheck())\n        return InitError(strprintf(_(\"Initialization sanity check failed. %s is shutting down.\"), _(PACKAGE_NAME)));\n\n    // Probe the data directory lock to give an early error message, if possible\n    // We cannot hold the data directory lock here, as the forking for daemon() hasn't yet happened,\n    // and a fork will cause weird behavior to it.\n    return LockDataDirectory(true);\n}\n\nbool AppInitLockDataDirectory()\n{\n    // After daemonization get the data directory lock again and hold on to it until exit\n    // This creates a slight window for a race condition to happen, however this condition is harmless: it\n    // will at most make us exit without printing a message to console.\n    if (!LockDataDirectory(false)) {\n        // Detailed error printed inside LockDataDirectory\n        return false;\n    }\n    return true;\n}\n\nbool AppInitMain()\n{\n    const CChainParams& chainparams = Params();\n    // ********************************************************* Step 4a: application initialization\n#ifndef WIN32\n    CreatePidFile(GetPidFile(), getpid());\n#endif\n    if (gArgs.GetBoolArg(\"-shrinkdebugfile\", logCategories == BCLog::NONE)) {\n        // Do this first since it both loads a bunch of debug.log into memory,\n        // and because this needs to happen before any other debug.log printing\n        ShrinkDebugFile();\n    }\n\n    if (fPrintToDebugLog) {\n        if (!OpenDebugLog()) {\n            return InitError(strprintf(\"Could not open debug log file %s\", GetDebugLogPath().string()));\n        }\n    }\n\n    if (!fLogTimestamps)\n        LogPrintf(\"Startup time: %s\\n\", DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", GetTime()));\n    LogPrintf(\"Default data directory %s\\n\", GetDefaultDataDir().string());\n    LogPrintf(\"Using data directory %s\\n\", GetDataDir().string());\n    LogPrintf(\"Using config file %s\\n\", GetConfigFile(gArgs.GetArg(\"-conf\", BITCOIN_CONF_FILENAME)).string());\n    LogPrintf(\"Using at most %i automatic connections (%i file descriptors available)\\n\", nMaxConnections, nFD);\n\n    // Warn about relative -datadir path.\n    if (gArgs.IsArgSet(\"-datadir\") && !fs::path(gArgs.GetArg(\"-datadir\", \"\")).is_absolute()) {\n        LogPrintf(\"Warning: relative datadir option '%s' specified, which will be interpreted relative to the \"\n                  \"current working directory '%s'. This is fragile, because if sugarchain is started in the future \"\n                  \"from a different location, it will be unable to locate the current data files. There could \"\n                  \"also be data loss if sugarchain is started while in a temporary directory.\\n\",\n            gArgs.GetArg(\"-datadir\", \"\"), fs::current_path().string());\n    }\n\n    InitSignatureCache();\n    InitScriptExecutionCache();\n\n    LogPrintf(\"Using %u threads for script verification\\n\", nScriptCheckThreads);\n    if (nScriptCheckThreads) {\n        for (int i=0; i<nScriptCheckThreads-1; i++)\n            threadGroup.create_thread(&ThreadScriptCheck);\n    }\n\n    // Start the lightweight task scheduler thread\n    CScheduler::Function serviceLoop = boost::bind(&CScheduler::serviceQueue, &scheduler);\n    threadGroup.create_thread(boost::bind(&TraceThread<CScheduler::Function>, \"scheduler\", serviceLoop));\n\n    GetMainSignals().RegisterBackgroundSignalScheduler(scheduler);\n    GetMainSignals().RegisterWithMempoolSignals(mempool);\n\n    /* Register RPC commands regardless of -server setting so they will be\n     * available in the GUI RPC console even if external calls are disabled.\n     */\n    RegisterAllCoreRPCCommands(tableRPC);\n#ifdef ENABLE_WALLET\n    RegisterWalletRPC(tableRPC);\n#endif\n\n    /* Start the RPC server already.  It will be started in \"warmup\" mode\n     * and not really process calls already (but it will signify connections\n     * that the server is there and will be ready later).  Warmup mode will\n     * be disabled when initialisation is finished.\n     */\n    if (gArgs.GetBoolArg(\"-server\", false))\n    {\n        uiInterface.InitMessage.connect(SetRPCWarmupStatus);\n        if (!AppInitServers())\n            return InitError(_(\"Unable to start HTTP server. See debug log for details.\"));\n    }\n\n    int64_t nStart;\n\n    // ********************************************************* Step 5: verify wallet database integrity\n#ifdef ENABLE_WALLET\n    if (!VerifyWallets())\n        return false;\n#endif\n    // ********************************************************* Step 6: network initialization\n    // Note that we absolutely cannot open any actual connections\n    // until the very end (\"start node\") as the UTXO/block state\n    // is not yet setup and may end up being set up twice if we\n    // need to reindex later.\n\n    assert(!g_connman);\n    g_connman = std::unique_ptr<CConnman>(new CConnman(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max())));\n    CConnman& connman = *g_connman;\n\n    peerLogic.reset(new PeerLogicValidation(&connman, scheduler));\n    RegisterValidationInterface(peerLogic.get());\n\n    // sanitize comments per BIP-0014, format user agent and check total size\n    std::vector<std::string> uacomments;\n    for (const std::string& cmt : gArgs.GetArgs(\"-uacomment\")) {\n        if (cmt != SanitizeString(cmt, SAFE_CHARS_UA_COMMENT))\n            return InitError(strprintf(_(\"User Agent comment (%s) contains unsafe characters.\"), cmt));\n        uacomments.push_back(cmt);\n    }\n    strSubVersion = FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, uacomments);\n    if (strSubVersion.size() > MAX_SUBVERSION_LENGTH) {\n        return InitError(strprintf(_(\"Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.\"),\n            strSubVersion.size(), MAX_SUBVERSION_LENGTH));\n    }\n\n    if (gArgs.IsArgSet(\"-onlynet\")) {\n        std::set<enum Network> nets;\n        for (const std::string& snet : gArgs.GetArgs(\"-onlynet\")) {\n            enum Network net = ParseNetwork(snet);\n            if (net == NET_UNROUTABLE)\n                return InitError(strprintf(_(\"Unknown network specified in -onlynet: '%s'\"), snet));\n            nets.insert(net);\n        }\n        for (int n = 0; n < NET_MAX; n++) {\n            enum Network net = (enum Network)n;\n            if (!nets.count(net))\n                SetLimited(net);\n        }\n    }\n\n    // Check for host lookup allowed before parsing any network related parameters\n    fNameLookup = gArgs.GetBoolArg(\"-dns\", DEFAULT_NAME_LOOKUP);\n\n    bool proxyRandomize = gArgs.GetBoolArg(\"-proxyrandomize\", DEFAULT_PROXYRANDOMIZE);\n    // -proxy sets a proxy for all outgoing network traffic\n    // -noproxy (or -proxy=0) as well as the empty string can be used to not set a proxy, this is the default\n    std::string proxyArg = gArgs.GetArg(\"-proxy\", \"\");\n    SetLimited(NET_TOR);\n    if (proxyArg != \"\" && proxyArg != \"0\") {\n        CService proxyAddr;\n        if (!Lookup(proxyArg.c_str(), proxyAddr, 9050, fNameLookup)) {\n            return InitError(strprintf(_(\"Invalid -proxy address or hostname: '%s'\"), proxyArg));\n        }\n\n        proxyType addrProxy = proxyType(proxyAddr, proxyRandomize);\n        if (!addrProxy.IsValid())\n            return InitError(strprintf(_(\"Invalid -proxy address or hostname: '%s'\"), proxyArg));\n\n        SetProxy(NET_IPV4, addrProxy);\n        SetProxy(NET_IPV6, addrProxy);\n        SetProxy(NET_TOR, addrProxy);\n        SetNameProxy(addrProxy);\n        SetLimited(NET_TOR, false); // by default, -proxy sets onion as reachable, unless -noonion later\n    }\n\n    // -onion can be used to set only a proxy for .onion, or override normal proxy for .onion addresses\n    // -noonion (or -onion=0) disables connecting to .onion entirely\n    // An empty string is used to not override the onion proxy (in which case it defaults to -proxy set above, or none)\n    std::string onionArg = gArgs.GetArg(\"-onion\", \"\");\n    if (onionArg != \"\") {\n        if (onionArg == \"0\") { // Handle -noonion/-onion=0\n            SetLimited(NET_TOR); // set onions as unreachable\n        } else {\n            CService onionProxy;\n            if (!Lookup(onionArg.c_str(), onionProxy, 9050, fNameLookup)) {\n                return InitError(strprintf(_(\"Invalid -onion address or hostname: '%s'\"), onionArg));\n            }\n            proxyType addrOnion = proxyType(onionProxy, proxyRandomize);\n            if (!addrOnion.IsValid())\n                return InitError(strprintf(_(\"Invalid -onion address or hostname: '%s'\"), onionArg));\n            SetProxy(NET_TOR, addrOnion);\n            SetLimited(NET_TOR, false);\n        }\n    }\n\n    // see Step 2: parameter interactions for more information about these\n    fListen = gArgs.GetBoolArg(\"-listen\", DEFAULT_LISTEN);\n    fDiscover = gArgs.GetBoolArg(\"-discover\", true);\n    fRelayTxes = !gArgs.GetBoolArg(\"-blocksonly\", DEFAULT_BLOCKSONLY);\n\n    for (const std::string& strAddr : gArgs.GetArgs(\"-externalip\")) {\n        CService addrLocal;\n        if (Lookup(strAddr.c_str(), addrLocal, GetListenPort(), fNameLookup) && addrLocal.IsValid())\n            AddLocal(addrLocal, LOCAL_MANUAL);\n        else\n            return InitError(ResolveErrMsg(\"externalip\", strAddr));\n    }\n\n#if ENABLE_ZMQ\n    pzmqNotificationInterface = CZMQNotificationInterface::Create();\n\n    if (pzmqNotificationInterface) {\n        RegisterValidationInterface(pzmqNotificationInterface);\n    }\n#endif\n    uint64_t nMaxOutboundLimit = 0; //unlimited unless -maxuploadtarget is set\n    uint64_t nMaxOutboundTimeframe = MAX_UPLOAD_TIMEFRAME;\n\n    if (gArgs.IsArgSet(\"-maxuploadtarget\")) {\n        nMaxOutboundLimit = gArgs.GetArg(\"-maxuploadtarget\", DEFAULT_MAX_UPLOAD_TARGET)*1024*1024;\n    }\n\n    // ********************************************************* Step 7: load block chain\n\n    fReindex = gArgs.GetBoolArg(\"-reindex\", false);\n    bool fReindexChainState = gArgs.GetBoolArg(\"-reindex-chainstate\", false);\n\n    // cache size calculations\n    int64_t nTotalCache = (gArgs.GetArg(\"-dbcache\", nDefaultDbCache) << 20);\n    nTotalCache = std::max(nTotalCache, nMinDbCache << 20); // total cache cannot be less than nMinDbCache\n    nTotalCache = std::min(nTotalCache, nMaxDbCache << 20); // total cache cannot be greater than nMaxDbcache\n    int64_t nBlockTreeDBCache = nTotalCache / 8;\n    nBlockTreeDBCache = std::min(nBlockTreeDBCache, (gArgs.GetBoolArg(\"-txindex\", DEFAULT_TXINDEX) ? nMaxBlockDBAndTxIndexCache : nMaxBlockDBCache) << 20);\n    nTotalCache -= nBlockTreeDBCache;\n    int64_t nCoinDBCache = std::min(nTotalCache / 2, (nTotalCache / 4) + (1 << 23)); // use 25%-50% of the remainder for disk cache\n    nCoinDBCache = std::min(nCoinDBCache, nMaxCoinsDBCache << 20); // cap total coins db cache\n    nTotalCache -= nCoinDBCache;\n    nCoinCacheUsage = nTotalCache; // the rest goes to in-memory cache\n    int64_t nMempoolSizeMax = gArgs.GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;\n    LogPrintf(\"Cache configuration:\\n\");\n    LogPrintf(\"* Using %.1fMiB for block index database\\n\", nBlockTreeDBCache * (1.0 / 1024 / 1024));\n    LogPrintf(\"* Using %.1fMiB for chain state database\\n\", nCoinDBCache * (1.0 / 1024 / 1024));\n    LogPrintf(\"* Using %.1fMiB for in-memory UTXO set (plus up to %.1fMiB of unused mempool space)\\n\", nCoinCacheUsage * (1.0 / 1024 / 1024), nMempoolSizeMax * (1.0 / 1024 / 1024));\n\n    bool fLoaded = false;\n    while (!fLoaded && !fRequestShutdown) {\n        bool fReset = fReindex;\n        std::string strLoadError;\n\n        uiInterface.InitMessage(_(\"Loading block index...\"));\n\n        nStart = GetTimeMillis();\n        do {\n            try {\n                UnloadBlockIndex();\n                pcoinsTip.reset();\n                pcoinsdbview.reset();\n                pcoinscatcher.reset();\n                // new CBlockTreeDB tries to delete the existing file, which\n                // fails if it's still open from the previous loop. Close it first:\n                pblocktree.reset();\n                pblocktree.reset(new CBlockTreeDB(nBlockTreeDBCache, false, fReset));\n\n                if (fReset) {\n                    pblocktree->WriteReindexing(true);\n                    //If we're reindexing in prune mode, wipe away unusable block files and all undo data files\n                    if (fPruneMode)\n                        CleanupBlockRevFiles();\n                }\n\n                if (fRequestShutdown) break;\n\n                // LoadBlockIndex will load fTxIndex from the db, or set it if\n                // we're reindexing. It will also load fHavePruned if we've\n                // ever removed a block file from disk.\n                // Note that it also sets fReindex based on the disk flag!\n                // From here on out fReindex and fReset mean something different!\n                if (!LoadBlockIndex(chainparams)) {\n                    strLoadError = _(\"Error loading block database\");\n                    break;\n                }\n\n                // If the loaded chain has a wrong genesis, bail out immediately\n                // (we're likely using a testnet datadir, or the other way around).\n                if (!mapBlockIndex.empty() && mapBlockIndex.count(chainparams.GetConsensus().hashGenesisBlock) == 0)\n                    return InitError(_(\"Incorrect or no genesis block found. Wrong datadir for network?\"));\n\n                // Check for changed -txindex state\n                if (fTxIndex != gArgs.GetBoolArg(\"-txindex\", DEFAULT_TXINDEX)) {\n                    strLoadError = _(\"You need to rebuild the database using -reindex to change -txindex\");\n                    break;\n                }\n\n                // Check for changed -prune state.  What we are concerned about is a user who has pruned blocks\n                // in the past, but is now trying to run unpruned.\n                if (fHavePruned && !fPruneMode) {\n                    strLoadError = _(\"You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain\");\n                    break;\n                }\n\n                // At this point blocktree args are consistent with what's on disk.\n                // If we're not mid-reindex (based on disk + args), add a genesis block on disk\n                // (otherwise we use the one already on disk).\n                // This is called again in ThreadImport after the reindex completes.\n                if (!fReindex && !LoadGenesisBlock(chainparams)) {\n                    strLoadError = _(\"Error initializing block database\");\n                    break;\n                }\n\n                // At this point we're either in reindex or we've loaded a useful\n                // block tree into mapBlockIndex!\n\n                pcoinsdbview.reset(new CCoinsViewDB(nCoinDBCache, false, fReset || fReindexChainState));\n                pcoinscatcher.reset(new CCoinsViewErrorCatcher(pcoinsdbview.get()));\n\n                // If necessary, upgrade from older database format.\n                // This is a no-op if we cleared the coinsviewdb with -reindex or -reindex-chainstate\n                if (!pcoinsdbview->Upgrade()) {\n                    strLoadError = _(\"Error upgrading chainstate database\");\n                    break;\n                }\n\n                // ReplayBlocks is a no-op if we cleared the coinsviewdb with -reindex or -reindex-chainstate\n                if (!ReplayBlocks(chainparams, pcoinsdbview.get())) {\n                    strLoadError = _(\"Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.\");\n                    break;\n                }\n\n                // The on-disk coinsdb is now in a good state, create the cache\n                pcoinsTip.reset(new CCoinsViewCache(pcoinscatcher.get()));\n\n                bool is_coinsview_empty = fReset || fReindexChainState || pcoinsTip->GetBestBlock().IsNull();\n                if (!is_coinsview_empty) {\n                    // LoadChainTip sets chainActive based on pcoinsTip's best block\n                    if (!LoadChainTip(chainparams)) {\n                        strLoadError = _(\"Error initializing block database\");\n                        break;\n                    }\n                    assert(chainActive.Tip() != nullptr);\n                }\n\n                if (!fReset) {\n                    // Note that RewindBlockIndex MUST run even if we're about to -reindex-chainstate.\n                    // It both disconnects blocks based on chainActive, and drops block data in\n                    // mapBlockIndex based on lack of available witness data.\n                    uiInterface.InitMessage(_(\"Rewinding blocks...\"));\n                    if (!RewindBlockIndex(chainparams)) {\n                        strLoadError = _(\"Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain\");\n                        break;\n                    }\n                }\n\n                if (!is_coinsview_empty) {\n                    uiInterface.InitMessage(_(\"Verifying blocks...\"));\n                    if (fHavePruned && gArgs.GetArg(\"-checkblocks\", DEFAULT_CHECKBLOCKS) > MIN_BLOCKS_TO_KEEP) {\n                        LogPrintf(\"Prune: pruned datadir may not have more than %d blocks; only checking available blocks\",\n                            MIN_BLOCKS_TO_KEEP);\n                    }\n\n                    {\n                        LOCK(cs_main);\n                        CBlockIndex* tip = chainActive.Tip();\n                        RPCNotifyBlockChange(true, tip);\n                        if (tip && tip->nTime > GetAdjustedTime() + 2 * 60 * 60) {\n                            strLoadError = _(\"The block database contains a block which appears to be from the future. \"\n                                    \"This may be due to your computer's date and time being set incorrectly. \"\n                                    \"Only rebuild the block database if you are sure that your computer's date and time are correct\");\n                            break;\n                        }\n                    }\n\n                    if (!CVerifyDB().VerifyDB(chainparams, pcoinsdbview.get(), gArgs.GetArg(\"-checklevel\", DEFAULT_CHECKLEVEL),\n                                  gArgs.GetArg(\"-checkblocks\", DEFAULT_CHECKBLOCKS))) {\n                        strLoadError = _(\"Corrupted block database detected\");\n                        break;\n                    }\n                }\n            } catch (const std::exception& e) {\n                LogPrintf(\"%s\\n\", e.what());\n                strLoadError = _(\"Error opening block database\");\n                break;\n            }\n\n            fLoaded = true;\n        } while(false);\n\n        if (!fLoaded && !fRequestShutdown) {\n            // first suggest a reindex\n            if (!fReset) {\n                bool fRet = uiInterface.ThreadSafeQuestion(\n                    strLoadError + \".\\n\\n\" + _(\"Do you want to rebuild the block database now?\"),\n                    strLoadError + \".\\nPlease restart with -reindex or -reindex-chainstate to recover.\",\n                    \"\", CClientUIInterface::MSG_ERROR | CClientUIInterface::BTN_ABORT);\n                if (fRet) {\n                    fReindex = true;\n                    fRequestShutdown = false;\n                } else {\n                    LogPrintf(\"Aborted block database rebuild. Exiting.\\n\");\n                    return false;\n                }\n            } else {\n                return InitError(strLoadError);\n            }\n        }\n    }\n\n    // As LoadBlockIndex can take several minutes, it's possible the user\n    // requested to kill the GUI during the last operation. If so, exit.\n    // As the program has not fully started yet, Shutdown() is possibly overkill.\n    if (fRequestShutdown)\n    {\n        LogPrintf(\"Shutdown requested. Exiting.\\n\");\n        return false;\n    }\n    if (fLoaded) {\n        LogPrintf(\" block index %15dms\\n\", GetTimeMillis() - nStart);\n    }\n\n    fs::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;\n    CAutoFile est_filein(fsbridge::fopen(est_path, \"rb\"), SER_DISK, CLIENT_VERSION);\n    // Allowed to fail as this file IS missing on first startup.\n    if (!est_filein.IsNull())\n        ::feeEstimator.Read(est_filein);\n    fFeeEstimatesInitialized = true;\n\n    // ********************************************************* Step 8: load wallet\n#ifdef ENABLE_WALLET\n    if (!OpenWallets())\n        return false;\n#else\n    LogPrintf(\"No wallet support compiled in!\\n\");\n#endif\n\n    // ********************************************************* Step 9: data directory maintenance\n\n    // if pruning, unset the service bit and perform the initial blockstore prune\n    // after any wallet rescanning has taken place.\n    if (fPruneMode) {\n        LogPrintf(\"Unsetting NODE_NETWORK on prune mode\\n\");\n        nLocalServices = ServiceFlags(nLocalServices & ~NODE_NETWORK);\n        if (!fReindex) {\n            uiInterface.InitMessage(_(\"Pruning blockstore...\"));\n            PruneAndFlush();\n        }\n    }\n\n    if (chainparams.GetConsensus().vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout != 0) {\n        // Only advertise witness capabilities if they have a reasonable start time.\n        // This allows us to have the code merged without a defined softfork, by setting its\n        // end time to 0.\n        // Note that setting NODE_WITNESS is never required: the only downside from not\n        // doing so is that after activation, no upgraded nodes will fetch from you.\n        nLocalServices = ServiceFlags(nLocalServices | NODE_WITNESS);\n    }\n\n    // ********************************************************* Step 10: import blocks\n\n    if (!CheckDiskSpace())\n        return false;\n\n    // Either install a handler to notify us when genesis activates, or set fHaveGenesis directly.\n    // No locking, as this happens before any background thread is started.\n    if (chainActive.Tip() == nullptr) {\n        uiInterface.NotifyBlockTip.connect(BlockNotifyGenesisWait);\n    } else {\n        fHaveGenesis = true;\n    }\n\n    if (gArgs.IsArgSet(\"-blocknotify\"))\n        uiInterface.NotifyBlockTip.connect(BlockNotifyCallback);\n\n    std::vector<fs::path> vImportFiles;\n    for (const std::string& strFile : gArgs.GetArgs(\"-loadblock\")) {\n        vImportFiles.push_back(strFile);\n    }\n\n    threadGroup.create_thread(boost::bind(&ThreadImport, vImportFiles));\n\n    // Wait for genesis block to be processed\n    {\n        WaitableLock lock(cs_GenesisWait);\n        // We previously could hang here if StartShutdown() is called prior to\n        // ThreadImport getting started, so instead we just wait on a timer to\n        // check ShutdownRequested() regularly.\n        while (!fHaveGenesis && !ShutdownRequested()) {\n            condvar_GenesisWait.wait_for(lock, std::chrono::milliseconds(500));\n        }\n        uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait);\n    }\n\n    if (ShutdownRequested()) {\n        return false;\n    }\n\n    // ********************************************************* Step 11: start node\n\n    int chain_active_height;\n\n    //// debug print\n    {\n        LOCK(cs_main);\n        LogPrintf(\"mapBlockIndex.size() = %u\\n\", mapBlockIndex.size());\n        chain_active_height = chainActive.Height();\n    }\n    LogPrintf(\"nBestHeight = %d\\n\", chain_active_height);\n\n    if (gArgs.GetBoolArg(\"-listenonion\", DEFAULT_LISTEN_ONION))\n        StartTorControl(threadGroup, scheduler);\n\n    Discover(threadGroup);\n\n    // Map ports with UPnP\n    MapPort(gArgs.GetBoolArg(\"-upnp\", DEFAULT_UPNP));\n\n    CConnman::Options connOptions;\n    connOptions.nLocalServices = nLocalServices;\n    connOptions.nMaxConnections = nMaxConnections;\n    connOptions.nMaxOutbound = std::min(MAX_OUTBOUND_CONNECTIONS, connOptions.nMaxConnections);\n    connOptions.nMaxAddnode = MAX_ADDNODE_CONNECTIONS;\n    connOptions.nMaxFeeler = 1;\n    connOptions.nBestHeight = chain_active_height;\n    connOptions.uiInterface = &uiInterface;\n    connOptions.m_msgproc = peerLogic.get();\n    connOptions.nSendBufferMaxSize = 1000*gArgs.GetArg(\"-maxsendbuffer\", DEFAULT_MAXSENDBUFFER);\n    connOptions.nReceiveFloodSize = 1000*gArgs.GetArg(\"-maxreceivebuffer\", DEFAULT_MAXRECEIVEBUFFER);\n    connOptions.m_added_nodes = gArgs.GetArgs(\"-addnode\");\n\n    connOptions.nMaxOutboundTimeframe = nMaxOutboundTimeframe;\n    connOptions.nMaxOutboundLimit = nMaxOutboundLimit;\n\n    for (const std::string& strBind : gArgs.GetArgs(\"-bind\")) {\n        CService addrBind;\n        if (!Lookup(strBind.c_str(), addrBind, GetListenPort(), false)) {\n            return InitError(ResolveErrMsg(\"bind\", strBind));\n        }\n        connOptions.vBinds.push_back(addrBind);\n    }\n    for (const std::string& strBind : gArgs.GetArgs(\"-whitebind\")) {\n        CService addrBind;\n        if (!Lookup(strBind.c_str(), addrBind, 0, false)) {\n            return InitError(ResolveErrMsg(\"whitebind\", strBind));\n        }\n        if (addrBind.GetPort() == 0) {\n            return InitError(strprintf(_(\"Need to specify a port with -whitebind: '%s'\"), strBind));\n        }\n        connOptions.vWhiteBinds.push_back(addrBind);\n    }\n\n    for (const auto& net : gArgs.GetArgs(\"-whitelist\")) {\n        CSubNet subnet;\n        LookupSubNet(net.c_str(), subnet);\n        if (!subnet.IsValid())\n            return InitError(strprintf(_(\"Invalid netmask specified in -whitelist: '%s'\"), net));\n        connOptions.vWhitelistedRange.push_back(subnet);\n    }\n\n    connOptions.vSeedNodes = gArgs.GetArgs(\"-seednode\");\n\n    // Initiate outbound connections unless connect=0\n    connOptions.m_use_addrman_outgoing = !gArgs.IsArgSet(\"-connect\");\n    if (!connOptions.m_use_addrman_outgoing) {\n        const auto connect = gArgs.GetArgs(\"-connect\");\n        if (connect.size() != 1 || connect[0] != \"0\") {\n            connOptions.m_specified_outgoing = connect;\n        }\n    }\n    if (!connman.Start(scheduler, connOptions)) {\n        return false;\n    }\n\n    // ********************************************************* Step 12: finished\n\n    SetRPCWarmupFinished();\n    uiInterface.InitMessage(_(\"Done loading\"));\n\n#ifdef ENABLE_WALLET\n    StartWallets(scheduler);\n#endif\n\n    return true;\n}\n"
  },
  {
    "path": "src/init.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_INIT_H\n#define BITCOIN_INIT_H\n\n#include <string>\n\nclass CScheduler;\nclass CWallet;\n\nnamespace boost\n{\nclass thread_group;\n} // namespace boost\n\nvoid StartShutdown();\nbool ShutdownRequested();\n/** Interrupt threads */\nvoid Interrupt();\nvoid Shutdown();\n//!Initialize the logging infrastructure\nvoid InitLogging();\n//!Parameter interaction: change current parameters depending on various rules\nvoid InitParameterInteraction();\n\n/** Initialize bitcoin core: Basic context setup.\n *  @note This can be done before daemonization. Do not call Shutdown() if this function fails.\n *  @pre Parameters should be parsed and config file should be read.\n */\nbool AppInitBasicSetup();\n/**\n * Initialization: parameter interaction.\n * @note This can be done before daemonization. Do not call Shutdown() if this function fails.\n * @pre Parameters should be parsed and config file should be read, AppInitBasicSetup should have been called.\n */\nbool AppInitParameterInteraction();\n/**\n * Initialization sanity checks: ecc init, sanity checks, dir lock.\n * @note This can be done before daemonization. Do not call Shutdown() if this function fails.\n * @pre Parameters should be parsed and config file should be read, AppInitParameterInteraction should have been called.\n */\nbool AppInitSanityChecks();\n/**\n * Lock bitcoin core data directory.\n * @note This should only be done after daemonization. Do not call Shutdown() if this function fails.\n * @pre Parameters should be parsed and config file should be read, AppInitSanityChecks should have been called.\n */\nbool AppInitLockDataDirectory();\n/**\n * Bitcoin core main initialization.\n * @note This should only be done after daemonization. Call Shutdown() if this function fails.\n * @pre Parameters should be parsed and config file should be read, AppInitLockDataDirectory should have been called.\n */\nbool AppInitMain();\n\n/** The help message mode determines what help message to show */\nenum HelpMessageMode {\n    HMM_BITCOIND,\n    HMM_BITCOIN_QT\n};\n\n/** Help for options shared between UI and daemon (for -help) */\nstd::string HelpMessage(HelpMessageMode mode);\n/** Returns licensing information (for -version) */\nstd::string LicenseInfo();\n\n#endif // BITCOIN_INIT_H\n"
  },
  {
    "path": "src/key.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2017 The Zcash developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <key.h>\n\n#include <arith_uint256.h>\n#include <crypto/common.h>\n#include <crypto/hmac_sha512.h>\n#include <random.h>\n\n#include <secp256k1.h>\n#include <secp256k1_recovery.h>\n\nstatic secp256k1_context* secp256k1_context_sign = nullptr;\n\n/** These functions are taken from the libsecp256k1 distribution and are very ugly. */\n\n/**\n * This parses a format loosely based on a DER encoding of the ECPrivateKey type from\n * section C.4 of SEC 1 <http://www.secg.org/sec1-v2.pdf>, with the following caveats:\n *\n * * The octet-length of the SEQUENCE must be encoded as 1 or 2 octets. It is not\n *   required to be encoded as one octet if it is less than 256, as DER would require.\n * * The octet-length of the SEQUENCE must not be greater than the remaining\n *   length of the key encoding, but need not match it (i.e. the encoding may contain\n *   junk after the encoded SEQUENCE).\n * * The privateKey OCTET STRING is zero-filled on the left to 32 octets.\n * * Anything after the encoding of the privateKey OCTET STRING is ignored, whether\n *   or not it is validly encoded DER.\n *\n * out32 must point to an output buffer of length at least 32 bytes.\n */\nstatic int ec_privkey_import_der(const secp256k1_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {\n    const unsigned char *end = privkey + privkeylen;\n    memset(out32, 0, 32);\n    /* sequence header */\n    if (end - privkey < 1 || *privkey != 0x30u) {\n        return 0;\n    }\n    privkey++;\n    /* sequence length constructor */\n    if (end - privkey < 1 || !(*privkey & 0x80u)) {\n        return 0;\n    }\n    size_t lenb = *privkey & ~0x80u; privkey++;\n    if (lenb < 1 || lenb > 2) {\n        return 0;\n    }\n    if (end - privkey < lenb) {\n        return 0;\n    }\n    /* sequence length */\n    size_t len = privkey[lenb-1] | (lenb > 1 ? privkey[lenb-2] << 8 : 0u);\n    privkey += lenb;\n    if (end - privkey < len) {\n        return 0;\n    }\n    /* sequence element 0: version number (=1) */\n    if (end - privkey < 3 || privkey[0] != 0x02u || privkey[1] != 0x01u || privkey[2] != 0x01u) {\n        return 0;\n    }\n    privkey += 3;\n    /* sequence element 1: octet string, up to 32 bytes */\n    if (end - privkey < 2 || privkey[0] != 0x04u) {\n        return 0;\n    }\n    size_t oslen = privkey[1];\n    privkey += 2;\n    if (oslen > 32 || end - privkey < oslen) {\n        return 0;\n    }\n    memcpy(out32 + (32 - oslen), privkey, oslen);\n    if (!secp256k1_ec_seckey_verify(ctx, out32)) {\n        memset(out32, 0, 32);\n        return 0;\n    }\n    return 1;\n}\n\n/**\n * This serializes to a DER encoding of the ECPrivateKey type from section C.4 of SEC 1\n * <http://www.secg.org/sec1-v2.pdf>. The optional parameters and publicKey fields are\n * included.\n *\n * privkey must point to an output buffer of length at least CKey::PRIVATE_KEY_SIZE bytes.\n * privkeylen must initially be set to the size of the privkey buffer. Upon return it\n * will be set to the number of bytes used in the buffer.\n * key32 must point to a 32-byte raw private key.\n */\nstatic int ec_privkey_export_der(const secp256k1_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {\n    assert(*privkeylen >= CKey::PRIVATE_KEY_SIZE);\n    secp256k1_pubkey pubkey;\n    size_t pubkeylen = 0;\n    if (!secp256k1_ec_pubkey_create(ctx, &pubkey, key32)) {\n        *privkeylen = 0;\n        return 0;\n    }\n    if (compressed) {\n        static const unsigned char begin[] = {\n            0x30,0x81,0xD3,0x02,0x01,0x01,0x04,0x20\n        };\n        static const unsigned char middle[] = {\n            0xA0,0x81,0x85,0x30,0x81,0x82,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48,\n            0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04,\n            0x21,0x02,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87,\n            0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8,\n            0x17,0x98,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E,\n            0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x24,0x03,0x22,0x00\n        };\n        unsigned char *ptr = privkey;\n        memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin);\n        memcpy(ptr, key32, 32); ptr += 32;\n        memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);\n        pubkeylen = CPubKey::COMPRESSED_PUBLIC_KEY_SIZE;\n        secp256k1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);\n        ptr += pubkeylen;\n        *privkeylen = ptr - privkey;\n        assert(*privkeylen == CKey::COMPRESSED_PRIVATE_KEY_SIZE);\n    } else {\n        static const unsigned char begin[] = {\n            0x30,0x82,0x01,0x13,0x02,0x01,0x01,0x04,0x20\n        };\n        static const unsigned char middle[] = {\n            0xA0,0x81,0xA5,0x30,0x81,0xA2,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48,\n            0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04,\n            0x41,0x04,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87,\n            0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8,\n            0x17,0x98,0x48,0x3A,0xDA,0x77,0x26,0xA3,0xC4,0x65,0x5D,0xA4,0xFB,0xFC,0x0E,0x11,\n            0x08,0xA8,0xFD,0x17,0xB4,0x48,0xA6,0x85,0x54,0x19,0x9C,0x47,0xD0,0x8F,0xFB,0x10,\n            0xD4,0xB8,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E,\n            0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x44,0x03,0x42,0x00\n        };\n        unsigned char *ptr = privkey;\n        memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin);\n        memcpy(ptr, key32, 32); ptr += 32;\n        memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);\n        pubkeylen = CPubKey::PUBLIC_KEY_SIZE;\n        secp256k1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);\n        ptr += pubkeylen;\n        *privkeylen = ptr - privkey;\n        assert(*privkeylen == CKey::PRIVATE_KEY_SIZE);\n    }\n    return 1;\n}\n\nbool CKey::Check(const unsigned char *vch) {\n    return secp256k1_ec_seckey_verify(secp256k1_context_sign, vch);\n}\n\nvoid CKey::MakeNewKey(bool fCompressedIn) {\n    do {\n        GetStrongRandBytes(keydata.data(), keydata.size());\n    } while (!Check(keydata.data()));\n    fValid = true;\n    fCompressed = fCompressedIn;\n}\n\nCPrivKey CKey::GetPrivKey() const {\n    assert(fValid);\n    CPrivKey privkey;\n    int ret;\n    size_t privkeylen;\n    privkey.resize(PRIVATE_KEY_SIZE);\n    privkeylen = PRIVATE_KEY_SIZE;\n    ret = ec_privkey_export_der(secp256k1_context_sign, (unsigned char*) privkey.data(), &privkeylen, begin(), fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);\n    assert(ret);\n    privkey.resize(privkeylen);\n    return privkey;\n}\n\nCPubKey CKey::GetPubKey() const {\n    assert(fValid);\n    secp256k1_pubkey pubkey;\n    size_t clen = CPubKey::PUBLIC_KEY_SIZE;\n    CPubKey result;\n    int ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &pubkey, begin());\n    assert(ret);\n    secp256k1_ec_pubkey_serialize(secp256k1_context_sign, (unsigned char*)result.begin(), &clen, &pubkey, fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);\n    assert(result.size() == clen);\n    assert(result.IsValid());\n    return result;\n}\n\nbool CKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, uint32_t test_case) const {\n    if (!fValid)\n        return false;\n    vchSig.resize(CPubKey::SIGNATURE_SIZE);\n    size_t nSigLen = CPubKey::SIGNATURE_SIZE;\n    unsigned char extra_entropy[32] = {0};\n    WriteLE32(extra_entropy, test_case);\n    secp256k1_ecdsa_signature sig;\n    int ret = secp256k1_ecdsa_sign(secp256k1_context_sign, &sig, hash.begin(), begin(), secp256k1_nonce_function_rfc6979, test_case ? extra_entropy : nullptr);\n    assert(ret);\n    secp256k1_ecdsa_signature_serialize_der(secp256k1_context_sign, (unsigned char*)vchSig.data(), &nSigLen, &sig);\n    vchSig.resize(nSigLen);\n    return true;\n}\n\nbool CKey::VerifyPubKey(const CPubKey& pubkey) const {\n    if (pubkey.IsCompressed() != fCompressed) {\n        return false;\n    }\n    unsigned char rnd[8];\n    std::string str = \"Bitcoin key verification\\n\";\n    GetRandBytes(rnd, sizeof(rnd));\n    uint256 hash;\n    CHash256().Write((unsigned char*)str.data(), str.size()).Write(rnd, sizeof(rnd)).Finalize(hash.begin());\n    std::vector<unsigned char> vchSig;\n    Sign(hash, vchSig);\n    return pubkey.Verify(hash, vchSig);\n}\n\nbool CKey::SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig) const {\n    if (!fValid)\n        return false;\n    vchSig.resize(CPubKey::COMPACT_SIGNATURE_SIZE);\n    int rec = -1;\n    secp256k1_ecdsa_recoverable_signature sig;\n    int ret = secp256k1_ecdsa_sign_recoverable(secp256k1_context_sign, &sig, hash.begin(), begin(), secp256k1_nonce_function_rfc6979, nullptr);\n    assert(ret);\n    secp256k1_ecdsa_recoverable_signature_serialize_compact(secp256k1_context_sign, (unsigned char*)&vchSig[1], &rec, &sig);\n    assert(ret);\n    assert(rec != -1);\n    vchSig[0] = 27 + rec + (fCompressed ? 4 : 0);\n    return true;\n}\n\nbool CKey::Load(const CPrivKey &privkey, const CPubKey &vchPubKey, bool fSkipCheck=false) {\n    if (!ec_privkey_import_der(secp256k1_context_sign, (unsigned char*)begin(), privkey.data(), privkey.size()))\n        return false;\n    fCompressed = vchPubKey.IsCompressed();\n    fValid = true;\n\n    if (fSkipCheck)\n        return true;\n\n    return VerifyPubKey(vchPubKey);\n}\n\nbool CKey::Derive(CKey& keyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const {\n    assert(IsValid());\n    assert(IsCompressed());\n    std::vector<unsigned char, secure_allocator<unsigned char>> vout(64);\n    if ((nChild >> 31) == 0) {\n        CPubKey pubkey = GetPubKey();\n        assert(pubkey.size() == CPubKey::COMPRESSED_PUBLIC_KEY_SIZE);\n        BIP32Hash(cc, nChild, *pubkey.begin(), pubkey.begin()+1, vout.data());\n    } else {\n        assert(size() == 32);\n        BIP32Hash(cc, nChild, 0, begin(), vout.data());\n    }\n    memcpy(ccChild.begin(), vout.data()+32, 32);\n    memcpy((unsigned char*)keyChild.begin(), begin(), 32);\n    bool ret = secp256k1_ec_privkey_tweak_add(secp256k1_context_sign, (unsigned char*)keyChild.begin(), vout.data());\n    keyChild.fCompressed = true;\n    keyChild.fValid = ret;\n    return ret;\n}\n\nbool CExtKey::Derive(CExtKey &out, unsigned int _nChild) const {\n    out.nDepth = nDepth + 1;\n    CKeyID id = key.GetPubKey().GetID();\n    memcpy(&out.vchFingerprint[0], &id, 4);\n    out.nChild = _nChild;\n    return key.Derive(out.key, out.chaincode, _nChild, chaincode);\n}\n\nvoid CExtKey::SetMaster(const unsigned char *seed, unsigned int nSeedLen) {\n    static const unsigned char hashkey[] = {'B','i','t','c','o','i','n',' ','s','e','e','d'};\n    std::vector<unsigned char, secure_allocator<unsigned char>> vout(64);\n    CHMAC_SHA512(hashkey, sizeof(hashkey)).Write(seed, nSeedLen).Finalize(vout.data());\n    key.Set(vout.data(), vout.data() + 32, true);\n    memcpy(chaincode.begin(), vout.data() + 32, 32);\n    nDepth = 0;\n    nChild = 0;\n    memset(vchFingerprint, 0, sizeof(vchFingerprint));\n}\n\nCExtPubKey CExtKey::Neuter() const {\n    CExtPubKey ret;\n    ret.nDepth = nDepth;\n    memcpy(&ret.vchFingerprint[0], &vchFingerprint[0], 4);\n    ret.nChild = nChild;\n    ret.pubkey = key.GetPubKey();\n    ret.chaincode = chaincode;\n    return ret;\n}\n\nvoid CExtKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const {\n    code[0] = nDepth;\n    memcpy(code+1, vchFingerprint, 4);\n    code[5] = (nChild >> 24) & 0xFF; code[6] = (nChild >> 16) & 0xFF;\n    code[7] = (nChild >>  8) & 0xFF; code[8] = (nChild >>  0) & 0xFF;\n    memcpy(code+9, chaincode.begin(), 32);\n    code[41] = 0;\n    assert(key.size() == 32);\n    memcpy(code+42, key.begin(), 32);\n}\n\nvoid CExtKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) {\n    nDepth = code[0];\n    memcpy(vchFingerprint, code+1, 4);\n    nChild = (code[5] << 24) | (code[6] << 16) | (code[7] << 8) | code[8];\n    memcpy(chaincode.begin(), code+9, 32);\n    key.Set(code+42, code+BIP32_EXTKEY_SIZE, true);\n}\n\nbool ECC_InitSanityCheck() {\n    CKey key;\n    key.MakeNewKey(true);\n    CPubKey pubkey = key.GetPubKey();\n    return key.VerifyPubKey(pubkey);\n}\n\nvoid ECC_Start() {\n    assert(secp256k1_context_sign == nullptr);\n\n    secp256k1_context *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);\n    assert(ctx != nullptr);\n\n    {\n        // Pass in a random blinding seed to the secp256k1 context.\n        std::vector<unsigned char, secure_allocator<unsigned char>> vseed(32);\n        GetRandBytes(vseed.data(), 32);\n        bool ret = secp256k1_context_randomize(ctx, vseed.data());\n        assert(ret);\n    }\n\n    secp256k1_context_sign = ctx;\n}\n\nvoid ECC_Stop() {\n    secp256k1_context *ctx = secp256k1_context_sign;\n    secp256k1_context_sign = nullptr;\n\n    if (ctx) {\n        secp256k1_context_destroy(ctx);\n    }\n}\n"
  },
  {
    "path": "src/key.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2017 The Zcash developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_KEY_H\n#define BITCOIN_KEY_H\n\n#include <pubkey.h>\n#include <serialize.h>\n#include <support/allocators/secure.h>\n#include <uint256.h>\n\n#include <stdexcept>\n#include <vector>\n\n\n/**\n * secure_allocator is defined in allocators.h\n * CPrivKey is a serialized private key, with all parameters included\n * (PRIVATE_KEY_SIZE bytes)\n */\ntypedef std::vector<unsigned char, secure_allocator<unsigned char> > CPrivKey;\n\n/** An encapsulated private key. */\nclass CKey\n{\npublic:\n    /**\n     * secp256k1:\n     */\n    static const unsigned int PRIVATE_KEY_SIZE            = 279;\n    static const unsigned int COMPRESSED_PRIVATE_KEY_SIZE = 214;\n    /**\n     * see www.keylength.com\n     * script supports up to 75 for single byte push\n     */\n    static_assert(\n        PRIVATE_KEY_SIZE >= COMPRESSED_PRIVATE_KEY_SIZE,\n        \"COMPRESSED_PRIVATE_KEY_SIZE is larger than PRIVATE_KEY_SIZE\");\n\nprivate:\n    //! Whether this private key is valid. We check for correctness when modifying the key\n    //! data, so fValid should always correspond to the actual state.\n    bool fValid;\n\n    //! Whether the public key corresponding to this private key is (to be) compressed.\n    bool fCompressed;\n\n    //! The actual byte data\n    std::vector<unsigned char, secure_allocator<unsigned char> > keydata;\n\n    //! Check whether the 32-byte array pointed to by vch is valid keydata.\n    bool static Check(const unsigned char* vch);\n\npublic:\n    //! Construct an invalid private key.\n    CKey() : fValid(false), fCompressed(false)\n    {\n        // Important: vch must be 32 bytes in length to not break serialization\n        keydata.resize(32);\n    }\n\n    friend bool operator==(const CKey& a, const CKey& b)\n    {\n        return a.fCompressed == b.fCompressed &&\n            a.size() == b.size() &&\n            memcmp(a.keydata.data(), b.keydata.data(), a.size()) == 0;\n    }\n\n    //! Initialize using begin and end iterators to byte data.\n    template <typename T>\n    void Set(const T pbegin, const T pend, bool fCompressedIn)\n    {\n        if (size_t(pend - pbegin) != keydata.size()) {\n            fValid = false;\n        } else if (Check(&pbegin[0])) {\n            memcpy(keydata.data(), (unsigned char*)&pbegin[0], keydata.size());\n            fValid = true;\n            fCompressed = fCompressedIn;\n        } else {\n            fValid = false;\n        }\n    }\n\n    //! Simple read-only vector-like interface.\n    unsigned int size() const { return (fValid ? keydata.size() : 0); }\n    const unsigned char* begin() const { return keydata.data(); }\n    const unsigned char* end() const { return keydata.data() + size(); }\n\n    //! Check whether this private key is valid.\n    bool IsValid() const { return fValid; }\n\n    //! Check whether the public key corresponding to this private key is (to be) compressed.\n    bool IsCompressed() const { return fCompressed; }\n\n    //! Generate a new private key using a cryptographic PRNG.\n    void MakeNewKey(bool fCompressed);\n\n    /**\n     * Convert the private key to a CPrivKey (serialized OpenSSL private key data).\n     * This is expensive.\n     */\n    CPrivKey GetPrivKey() const;\n\n    /**\n     * Compute the public key from a private key.\n     * This is expensive.\n     */\n    CPubKey GetPubKey() const;\n\n    /**\n     * Create a DER-serialized signature.\n     * The test_case parameter tweaks the deterministic nonce.\n     */\n    bool Sign(const uint256& hash, std::vector<unsigned char>& vchSig, uint32_t test_case = 0) const;\n\n    /**\n     * Create a compact signature (65 bytes), which allows reconstructing the used public key.\n     * The format is one header byte, followed by two times 32 bytes for the serialized r and s values.\n     * The header byte: 0x1B = first key with even y, 0x1C = first key with odd y,\n     *                  0x1D = second key with even y, 0x1E = second key with odd y,\n     *                  add 0x04 for compressed keys.\n     */\n    bool SignCompact(const uint256& hash, std::vector<unsigned char>& vchSig) const;\n\n    //! Derive BIP32 child key.\n    bool Derive(CKey& keyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const;\n\n    /**\n     * Verify thoroughly whether a private key and a public key match.\n     * This is done using a different mechanism than just regenerating it.\n     */\n    bool VerifyPubKey(const CPubKey& vchPubKey) const;\n\n    //! Load private key and check that public key matches.\n    bool Load(const CPrivKey& privkey, const CPubKey& vchPubKey, bool fSkipCheck);\n};\n\nstruct CExtKey {\n    unsigned char nDepth;\n    unsigned char vchFingerprint[4];\n    unsigned int nChild;\n    ChainCode chaincode;\n    CKey key;\n\n    friend bool operator==(const CExtKey& a, const CExtKey& b)\n    {\n        return a.nDepth == b.nDepth &&\n            memcmp(&a.vchFingerprint[0], &b.vchFingerprint[0], sizeof(vchFingerprint)) == 0 &&\n            a.nChild == b.nChild &&\n            a.chaincode == b.chaincode &&\n            a.key == b.key;\n    }\n\n    void Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const;\n    void Decode(const unsigned char code[BIP32_EXTKEY_SIZE]);\n    bool Derive(CExtKey& out, unsigned int nChild) const;\n    CExtPubKey Neuter() const;\n    void SetMaster(const unsigned char* seed, unsigned int nSeedLen);\n    template <typename Stream>\n    void Serialize(Stream& s) const\n    {\n        unsigned int len = BIP32_EXTKEY_SIZE;\n        ::WriteCompactSize(s, len);\n        unsigned char code[BIP32_EXTKEY_SIZE];\n        Encode(code);\n        s.write((const char *)&code[0], len);\n    }\n    template <typename Stream>\n    void Unserialize(Stream& s)\n    {\n        unsigned int len = ::ReadCompactSize(s);\n        unsigned char code[BIP32_EXTKEY_SIZE];\n        if (len != BIP32_EXTKEY_SIZE)\n            throw std::runtime_error(\"Invalid extended key size\\n\");\n        s.read((char *)&code[0], len);\n        Decode(code);\n    }\n};\n\n/** Initialize the elliptic curve support. May not be called twice without calling ECC_Stop first. */\nvoid ECC_Start(void);\n\n/** Deinitialize the elliptic curve support. No-op if ECC_Start wasn't called first. */\nvoid ECC_Stop(void);\n\n/** Check that required EC support is available at runtime. */\nbool ECC_InitSanityCheck(void);\n\n#endif // BITCOIN_KEY_H\n"
  },
  {
    "path": "src/keystore.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <keystore.h>\n\n#include <util.h>\n\nbool CKeyStore::AddKey(const CKey &key) {\n    return AddKeyPubKey(key, key.GetPubKey());\n}\n\nvoid CBasicKeyStore::ImplicitlyLearnRelatedKeyScripts(const CPubKey& pubkey)\n{\n    AssertLockHeld(cs_KeyStore);\n    CKeyID key_id = pubkey.GetID();\n    // We must actually know about this key already.\n    assert(HaveKey(key_id) || mapWatchKeys.count(key_id));\n    // This adds the redeemscripts necessary to detect P2WPKH and P2SH-P2WPKH\n    // outputs. Technically P2WPKH outputs don't have a redeemscript to be\n    // spent. However, our current IsMine logic requires the corresponding\n    // P2SH-P2WPKH redeemscript to be present in the wallet in order to accept\n    // payment even to P2WPKH outputs.\n    // Also note that having superfluous scripts in the keystore never hurts.\n    // They're only used to guide recursion in signing and IsMine logic - if\n    // a script is present but we can't do anything with it, it has no effect.\n    // \"Implicitly\" refers to fact that scripts are derived automatically from\n    // existing keys, and are present in memory, even without being explicitly\n    // loaded (e.g. from a file).\n    if (pubkey.IsCompressed()) {\n        CScript script = GetScriptForDestination(WitnessV0KeyHash(key_id));\n        // This does not use AddCScript, as it may be overridden.\n        CScriptID id(script);\n        mapScripts[id] = std::move(script);\n    }\n}\n\nbool CBasicKeyStore::GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const\n{\n    CKey key;\n    if (!GetKey(address, key)) {\n        LOCK(cs_KeyStore);\n        WatchKeyMap::const_iterator it = mapWatchKeys.find(address);\n        if (it != mapWatchKeys.end()) {\n            vchPubKeyOut = it->second;\n            return true;\n        }\n        return false;\n    }\n    vchPubKeyOut = key.GetPubKey();\n    return true;\n}\n\nbool CBasicKeyStore::AddKeyPubKey(const CKey& key, const CPubKey &pubkey)\n{\n    LOCK(cs_KeyStore);\n    mapKeys[pubkey.GetID()] = key;\n    ImplicitlyLearnRelatedKeyScripts(pubkey);\n    return true;\n}\n\nbool CBasicKeyStore::HaveKey(const CKeyID &address) const\n{\n    LOCK(cs_KeyStore);\n    return mapKeys.count(address) > 0;\n}\n\nstd::set<CKeyID> CBasicKeyStore::GetKeys() const\n{\n    LOCK(cs_KeyStore);\n    std::set<CKeyID> set_address;\n    for (const auto& mi : mapKeys) {\n        set_address.insert(mi.first);\n    }\n    return set_address;\n}\n\nbool CBasicKeyStore::GetKey(const CKeyID &address, CKey &keyOut) const\n{\n    LOCK(cs_KeyStore);\n    KeyMap::const_iterator mi = mapKeys.find(address);\n    if (mi != mapKeys.end()) {\n        keyOut = mi->second;\n        return true;\n    }\n    return false;\n}\n\nbool CBasicKeyStore::AddCScript(const CScript& redeemScript)\n{\n    if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE)\n        return error(\"CBasicKeyStore::AddCScript(): redeemScripts > %i bytes are invalid\", MAX_SCRIPT_ELEMENT_SIZE);\n\n    LOCK(cs_KeyStore);\n    mapScripts[CScriptID(redeemScript)] = redeemScript;\n    return true;\n}\n\nbool CBasicKeyStore::HaveCScript(const CScriptID& hash) const\n{\n    LOCK(cs_KeyStore);\n    return mapScripts.count(hash) > 0;\n}\n\nstd::set<CScriptID> CBasicKeyStore::GetCScripts() const\n{\n    LOCK(cs_KeyStore);\n    std::set<CScriptID> set_script;\n    for (const auto& mi : mapScripts) {\n        set_script.insert(mi.first);\n    }\n    return set_script;\n}\n\nbool CBasicKeyStore::GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const\n{\n    LOCK(cs_KeyStore);\n    ScriptMap::const_iterator mi = mapScripts.find(hash);\n    if (mi != mapScripts.end())\n    {\n        redeemScriptOut = (*mi).second;\n        return true;\n    }\n    return false;\n}\n\nstatic bool ExtractPubKey(const CScript &dest, CPubKey& pubKeyOut)\n{\n    //TODO: Use Solver to extract this?\n    CScript::const_iterator pc = dest.begin();\n    opcodetype opcode;\n    std::vector<unsigned char> vch;\n    if (!dest.GetOp(pc, opcode, vch) || vch.size() < 33 || vch.size() > 65)\n        return false;\n    pubKeyOut = CPubKey(vch);\n    if (!pubKeyOut.IsFullyValid())\n        return false;\n    if (!dest.GetOp(pc, opcode, vch) || opcode != OP_CHECKSIG || dest.GetOp(pc, opcode, vch))\n        return false;\n    return true;\n}\n\nbool CBasicKeyStore::AddWatchOnly(const CScript &dest)\n{\n    LOCK(cs_KeyStore);\n    setWatchOnly.insert(dest);\n    CPubKey pubKey;\n    if (ExtractPubKey(dest, pubKey)) {\n        mapWatchKeys[pubKey.GetID()] = pubKey;\n        ImplicitlyLearnRelatedKeyScripts(pubKey);\n    }\n    return true;\n}\n\nbool CBasicKeyStore::RemoveWatchOnly(const CScript &dest)\n{\n    LOCK(cs_KeyStore);\n    setWatchOnly.erase(dest);\n    CPubKey pubKey;\n    if (ExtractPubKey(dest, pubKey)) {\n        mapWatchKeys.erase(pubKey.GetID());\n    }\n    // Related CScripts are not removed; having superfluous scripts around is\n    // harmless (see comment in ImplicitlyLearnRelatedKeyScripts).\n    return true;\n}\n\nbool CBasicKeyStore::HaveWatchOnly(const CScript &dest) const\n{\n    LOCK(cs_KeyStore);\n    return setWatchOnly.count(dest) > 0;\n}\n\nbool CBasicKeyStore::HaveWatchOnly() const\n{\n    LOCK(cs_KeyStore);\n    return (!setWatchOnly.empty());\n}\n\nCKeyID GetKeyForDestination(const CKeyStore& store, const CTxDestination& dest)\n{\n    // Only supports destinations which map to single public keys, i.e. P2PKH,\n    // P2WPKH, and P2SH-P2WPKH.\n    if (auto id = boost::get<CKeyID>(&dest)) {\n        return *id;\n    }\n    if (auto witness_id = boost::get<WitnessV0KeyHash>(&dest)) {\n        return CKeyID(*witness_id);\n    }\n    if (auto script_id = boost::get<CScriptID>(&dest)) {\n        CScript script;\n        CTxDestination inner_dest;\n        if (store.GetCScript(*script_id, script) && ExtractDestination(script, inner_dest)) {\n            if (auto inner_witness_id = boost::get<WitnessV0KeyHash>(&inner_dest)) {\n                return CKeyID(*inner_witness_id);\n            }\n        }\n    }\n    return CKeyID();\n}\n"
  },
  {
    "path": "src/keystore.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_KEYSTORE_H\n#define BITCOIN_KEYSTORE_H\n\n#include <key.h>\n#include <pubkey.h>\n#include <script/script.h>\n#include <script/standard.h>\n#include <sync.h>\n\n#include <boost/signals2/signal.hpp>\n\n/** A virtual base class for key stores */\nclass CKeyStore\n{\nprotected:\n    mutable CCriticalSection cs_KeyStore;\n\npublic:\n    virtual ~CKeyStore() {}\n\n    //! Add a key to the store.\n    virtual bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey) =0;\n    virtual bool AddKey(const CKey &key);\n\n    //! Check whether a key corresponding to a given address is present in the store.\n    virtual bool HaveKey(const CKeyID &address) const =0;\n    virtual bool GetKey(const CKeyID &address, CKey& keyOut) const =0;\n    virtual std::set<CKeyID> GetKeys() const =0;\n    virtual bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const =0;\n\n    //! Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki\n    virtual bool AddCScript(const CScript& redeemScript) =0;\n    virtual bool HaveCScript(const CScriptID &hash) const =0;\n    virtual std::set<CScriptID> GetCScripts() const =0;\n    virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const =0;\n\n    //! Support for Watch-only addresses\n    virtual bool AddWatchOnly(const CScript &dest) =0;\n    virtual bool RemoveWatchOnly(const CScript &dest) =0;\n    virtual bool HaveWatchOnly(const CScript &dest) const =0;\n    virtual bool HaveWatchOnly() const =0;\n};\n\ntypedef std::map<CKeyID, CKey> KeyMap;\ntypedef std::map<CKeyID, CPubKey> WatchKeyMap;\ntypedef std::map<CScriptID, CScript > ScriptMap;\ntypedef std::set<CScript> WatchOnlySet;\n\n/** Basic key store, that keeps keys in an address->secret map */\nclass CBasicKeyStore : public CKeyStore\n{\nprotected:\n    KeyMap mapKeys;\n    WatchKeyMap mapWatchKeys;\n    ScriptMap mapScripts;\n    WatchOnlySet setWatchOnly;\n\n    void ImplicitlyLearnRelatedKeyScripts(const CPubKey& pubkey);\n\npublic:\n    bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override;\n    bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const override;\n    bool HaveKey(const CKeyID &address) const override;\n    std::set<CKeyID> GetKeys() const override;\n    bool GetKey(const CKeyID &address, CKey &keyOut) const override;\n    bool AddCScript(const CScript& redeemScript) override;\n    bool HaveCScript(const CScriptID &hash) const override;\n    std::set<CScriptID> GetCScripts() const override;\n    bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const override;\n\n    bool AddWatchOnly(const CScript &dest) override;\n    bool RemoveWatchOnly(const CScript &dest) override;\n    bool HaveWatchOnly(const CScript &dest) const override;\n    bool HaveWatchOnly() const override;\n};\n\ntypedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial;\ntypedef std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char> > > CryptedKeyMap;\n\n/** Return the CKeyID of the key involved in a script (if there is a unique one). */\nCKeyID GetKeyForDestination(const CKeyStore& store, const CTxDestination& dest);\n\n#endif // BITCOIN_KEYSTORE_H\n"
  },
  {
    "path": "src/leveldb/.gitignore",
    "content": "build_config.mk\n*.a\n*.o\n*.dylib*\n*.so\n*.so.*\n*_test\ndb_bench\nleveldbutil\nRelease\nDebug\nBenchmark\nvs2010.*\n"
  },
  {
    "path": "src/leveldb/.travis.yml",
    "content": "language: cpp\ncompiler:\n- clang\n- gcc\nos:\n- linux\n- osx\nsudo: false\nbefore_install:\n- echo $LANG\n- echo $LC_ALL\nscript:\n- make -j 4 check\n"
  },
  {
    "path": "src/leveldb/AUTHORS",
    "content": "# Names should be added to this file like so:\n# Name or Organization <email address>\n\nGoogle Inc.\n\n# Initial version authors:\nJeffrey Dean <jeff@google.com>\nSanjay Ghemawat <sanjay@google.com>\n\n# Partial list of contributors:\nKevin Regan <kevin.d.regan@gmail.com>\nJohan Bilien <jobi@litl.com>\n"
  },
  {
    "path": "src/leveldb/CONTRIBUTING.md",
    "content": "# Contributing\n\nWe'd love to accept your code patches! However, before we can take them, we\nhave to jump a couple of legal hurdles.\n\n## Contributor License Agreements\n\nPlease fill out either the individual or corporate Contributor License\nAgreement as appropriate.\n\n* If you are an individual writing original source code and you're sure you\nown the intellectual property, then sign an [individual CLA](https://developers.google.com/open-source/cla/individual).\n* If you work for a company that wants to allow you to contribute your work,\nthen sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate).\n\nFollow either of the two links above to access the appropriate CLA and\ninstructions for how to sign and return it.\n\n## Submitting a Patch\n\n1. Sign the contributors license agreement above.\n2. Decide which code you want to submit. A submission should be a set of changes\nthat addresses one issue in the [issue tracker](https://github.com/google/leveldb/issues).\nPlease don't mix more than one logical change per submission, because it makes\nthe history hard to follow. If you want to make a change\n(e.g. add a sample or feature) that doesn't have a corresponding issue in the\nissue tracker, please create one.\n3. **Submitting**: When you are ready to submit, send us a Pull Request. Be\nsure to include the issue number you fixed and the name you used to sign\nthe CLA.\n\n## Writing Code ##\n\nIf your contribution contains code, please make sure that it follows \n[the style guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml).\nOtherwise we will have to ask you to make changes, and that's no fun for anyone.\n"
  },
  {
    "path": "src/leveldb/LICENSE",
    "content": "Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n   * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n   * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n   * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "src/leveldb/Makefile",
    "content": "# Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n# Use of this source code is governed by a BSD-style license that can be\n# found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#-----------------------------------------------\n# Uncomment exactly one of the lines labelled (A), (B), and (C) below\n# to switch between compilation modes.\n\n# (A) Production use (optimized mode)\nOPT ?= -O2 -DNDEBUG\n# (B) Debug mode, w/ full line-level debugging symbols\n# OPT ?= -g2\n# (C) Profiling mode: opt, but w/debugging symbols\n# OPT ?= -O2 -g2 -DNDEBUG\n#-----------------------------------------------\n\n# detect what platform we're building on\n$(shell CC=\"$(CC)\" CXX=\"$(CXX)\" TARGET_OS=\"$(TARGET_OS)\" \\\n    ./build_detect_platform build_config.mk ./)\n# this file is generated by the previous line to set build flags and sources\ninclude build_config.mk\n\nTESTS = \\\n\tdb/autocompact_test \\\n\tdb/c_test \\\n\tdb/corruption_test \\\n\tdb/db_test \\\n\tdb/dbformat_test \\\n\tdb/fault_injection_test \\\n\tdb/filename_test \\\n\tdb/log_test \\\n\tdb/recovery_test \\\n\tdb/skiplist_test \\\n\tdb/version_edit_test \\\n\tdb/version_set_test \\\n\tdb/write_batch_test \\\n\thelpers/memenv/memenv_test \\\n\tissues/issue178_test \\\n\tissues/issue200_test \\\n\ttable/filter_block_test \\\n\ttable/table_test \\\n\tutil/arena_test \\\n\tutil/bloom_test \\\n\tutil/cache_test \\\n\tutil/coding_test \\\n\tutil/crc32c_test \\\n\tutil/env_posix_test \\\n\tutil/env_test \\\n\tutil/hash_test\n\nUTILS = \\\n\tdb/db_bench \\\n\tdb/leveldbutil\n\n# Put the object files in a subdirectory, but the application at the top of the object dir.\nPROGNAMES := $(notdir $(TESTS) $(UTILS))\n\n# On Linux may need libkyotocabinet-dev for dependency.\nBENCHMARKS = \\\n\tdoc/bench/db_bench_sqlite3 \\\n\tdoc/bench/db_bench_tree_db\n\nCFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)\nCXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT)\n\nLDFLAGS += $(PLATFORM_LDFLAGS)\nLIBS += $(PLATFORM_LIBS)\n\nSIMULATOR_OUTDIR=out-ios-x86\nDEVICE_OUTDIR=out-ios-arm\n\nifeq ($(PLATFORM), IOS)\n# Note: iOS should probably be using libtool, not ar.\nAR=xcrun ar\nSIMULATORSDK=$(shell xcrun -sdk iphonesimulator --show-sdk-path)\nDEVICESDK=$(shell xcrun -sdk iphoneos --show-sdk-path)\nDEVICE_CFLAGS = -isysroot \"$(DEVICESDK)\" -arch armv6 -arch armv7 -arch armv7s -arch arm64\nSIMULATOR_CFLAGS = -isysroot \"$(SIMULATORSDK)\" -arch i686 -arch x86_64\nSTATIC_OUTDIR=out-ios-universal\nelse\nSTATIC_OUTDIR=out-static\nSHARED_OUTDIR=out-shared\nSTATIC_PROGRAMS := $(addprefix $(STATIC_OUTDIR)/, $(PROGNAMES))\nSHARED_PROGRAMS := $(addprefix $(SHARED_OUTDIR)/, db_bench)\nendif\n\nSTATIC_LIBOBJECTS := $(addprefix $(STATIC_OUTDIR)/, $(SOURCES:.cc=.o))\nSTATIC_MEMENVOBJECTS := $(addprefix $(STATIC_OUTDIR)/, $(MEMENV_SOURCES:.cc=.o))\n\nDEVICE_LIBOBJECTS := $(addprefix $(DEVICE_OUTDIR)/, $(SOURCES:.cc=.o))\nDEVICE_MEMENVOBJECTS := $(addprefix $(DEVICE_OUTDIR)/, $(MEMENV_SOURCES:.cc=.o))\n\nSIMULATOR_LIBOBJECTS := $(addprefix $(SIMULATOR_OUTDIR)/, $(SOURCES:.cc=.o))\nSIMULATOR_MEMENVOBJECTS := $(addprefix $(SIMULATOR_OUTDIR)/, $(MEMENV_SOURCES:.cc=.o))\n\nSHARED_LIBOBJECTS := $(addprefix $(SHARED_OUTDIR)/, $(SOURCES:.cc=.o))\nSHARED_MEMENVOBJECTS := $(addprefix $(SHARED_OUTDIR)/, $(MEMENV_SOURCES:.cc=.o))\n\nTESTUTIL := $(STATIC_OUTDIR)/util/testutil.o\nTESTHARNESS := $(STATIC_OUTDIR)/util/testharness.o $(TESTUTIL)\n\nSTATIC_TESTOBJS := $(addprefix $(STATIC_OUTDIR)/, $(addsuffix .o, $(TESTS)))\nSTATIC_UTILOBJS := $(addprefix $(STATIC_OUTDIR)/, $(addsuffix .o, $(UTILS)))\nSTATIC_ALLOBJS := $(STATIC_LIBOBJECTS) $(STATIC_MEMENVOBJECTS) $(STATIC_TESTOBJS) $(STATIC_UTILOBJS) $(TESTHARNESS)\nDEVICE_ALLOBJS := $(DEVICE_LIBOBJECTS) $(DEVICE_MEMENVOBJECTS)\nSIMULATOR_ALLOBJS := $(SIMULATOR_LIBOBJECTS) $(SIMULATOR_MEMENVOBJECTS)\n\ndefault: all\n\n# Should we build shared libraries?\nifneq ($(PLATFORM_SHARED_EXT),)\n\n# Many leveldb test apps use non-exported API's. Only build a subset for testing.\nSHARED_ALLOBJS := $(SHARED_LIBOBJECTS) $(SHARED_MEMENVOBJECTS) $(TESTHARNESS)\n\nifneq ($(PLATFORM_SHARED_VERSIONED),true)\nSHARED_LIB1 = libleveldb.$(PLATFORM_SHARED_EXT)\nSHARED_LIB2 = $(SHARED_LIB1)\nSHARED_LIB3 = $(SHARED_LIB1)\nSHARED_LIBS = $(SHARED_LIB1)\nSHARED_MEMENVLIB = $(SHARED_OUTDIR)/libmemenv.a\nelse\n# Update db.h if you change these.\nSHARED_VERSION_MAJOR = 1\nSHARED_VERSION_MINOR = 20\nSHARED_LIB1 = libleveldb.$(PLATFORM_SHARED_EXT)\nSHARED_LIB2 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR)\nSHARED_LIB3 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR)\nSHARED_LIBS = $(SHARED_OUTDIR)/$(SHARED_LIB1) $(SHARED_OUTDIR)/$(SHARED_LIB2) $(SHARED_OUTDIR)/$(SHARED_LIB3)\n$(SHARED_OUTDIR)/$(SHARED_LIB1): $(SHARED_OUTDIR)/$(SHARED_LIB3)\n\tln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB1)\n$(SHARED_OUTDIR)/$(SHARED_LIB2): $(SHARED_OUTDIR)/$(SHARED_LIB3)\n\tln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB2)\nSHARED_MEMENVLIB = $(SHARED_OUTDIR)/libmemenv.a\nendif\n\n$(SHARED_OUTDIR)/$(SHARED_LIB3): $(SHARED_LIBOBJECTS)\n\t$(CXX) $(LDFLAGS) $(PLATFORM_SHARED_LDFLAGS)$(SHARED_LIB2) $(SHARED_LIBOBJECTS) -o $(SHARED_OUTDIR)/$(SHARED_LIB3) $(LIBS)\n\nendif  # PLATFORM_SHARED_EXT\n\nall: $(SHARED_LIBS) $(SHARED_PROGRAMS) $(STATIC_OUTDIR)/libleveldb.a $(STATIC_OUTDIR)/libmemenv.a $(STATIC_PROGRAMS)\n\ncheck: $(STATIC_PROGRAMS)\n\tfor t in $(notdir $(TESTS)); do echo \"***** Running $$t\"; $(STATIC_OUTDIR)/$$t || exit 1; done\n\nclean:\n\t-rm -rf out-static out-shared out-ios-x86 out-ios-arm out-ios-universal\n\t-rm -f build_config.mk\n\t-rm -rf ios-x86 ios-arm\n\n$(STATIC_OUTDIR):\n\tmkdir $@\n\n$(STATIC_OUTDIR)/db: | $(STATIC_OUTDIR)\n\tmkdir $@\n\n$(STATIC_OUTDIR)/helpers/memenv: | $(STATIC_OUTDIR)\n\tmkdir -p $@\n\n$(STATIC_OUTDIR)/port: | $(STATIC_OUTDIR)\n\tmkdir $@\n\n$(STATIC_OUTDIR)/table: | $(STATIC_OUTDIR)\n\tmkdir $@\n\n$(STATIC_OUTDIR)/util: | $(STATIC_OUTDIR)\n\tmkdir $@\n\n.PHONY: STATIC_OBJDIRS\nSTATIC_OBJDIRS: \\\n\t$(STATIC_OUTDIR)/db \\\n\t$(STATIC_OUTDIR)/port \\\n\t$(STATIC_OUTDIR)/table \\\n\t$(STATIC_OUTDIR)/util \\\n\t$(STATIC_OUTDIR)/helpers/memenv\n\n$(SHARED_OUTDIR):\n\tmkdir $@\n\n$(SHARED_OUTDIR)/db: | $(SHARED_OUTDIR)\n\tmkdir $@\n\n$(SHARED_OUTDIR)/helpers/memenv: | $(SHARED_OUTDIR)\n\tmkdir -p $@\n\n$(SHARED_OUTDIR)/port: | $(SHARED_OUTDIR)\n\tmkdir $@\n\n$(SHARED_OUTDIR)/table: | $(SHARED_OUTDIR)\n\tmkdir $@\n\n$(SHARED_OUTDIR)/util: | $(SHARED_OUTDIR)\n\tmkdir $@\n\n.PHONY: SHARED_OBJDIRS\nSHARED_OBJDIRS: \\\n\t$(SHARED_OUTDIR)/db \\\n\t$(SHARED_OUTDIR)/port \\\n\t$(SHARED_OUTDIR)/table \\\n\t$(SHARED_OUTDIR)/util \\\n\t$(SHARED_OUTDIR)/helpers/memenv\n\n$(DEVICE_OUTDIR):\n\tmkdir $@\n\n$(DEVICE_OUTDIR)/db: | $(DEVICE_OUTDIR)\n\tmkdir $@\n\n$(DEVICE_OUTDIR)/helpers/memenv: | $(DEVICE_OUTDIR)\n\tmkdir -p $@\n\n$(DEVICE_OUTDIR)/port: | $(DEVICE_OUTDIR)\n\tmkdir $@\n\n$(DEVICE_OUTDIR)/table: | $(DEVICE_OUTDIR)\n\tmkdir $@\n\n$(DEVICE_OUTDIR)/util: | $(DEVICE_OUTDIR)\n\tmkdir $@\n\n.PHONY: DEVICE_OBJDIRS\nDEVICE_OBJDIRS: \\\n\t$(DEVICE_OUTDIR)/db \\\n\t$(DEVICE_OUTDIR)/port \\\n\t$(DEVICE_OUTDIR)/table \\\n\t$(DEVICE_OUTDIR)/util \\\n\t$(DEVICE_OUTDIR)/helpers/memenv\n\n$(SIMULATOR_OUTDIR):\n\tmkdir $@\n\n$(SIMULATOR_OUTDIR)/db: | $(SIMULATOR_OUTDIR)\n\tmkdir $@\n\n$(SIMULATOR_OUTDIR)/helpers/memenv: | $(SIMULATOR_OUTDIR)\n\tmkdir -p $@\n\n$(SIMULATOR_OUTDIR)/port: | $(SIMULATOR_OUTDIR)\n\tmkdir $@\n\n$(SIMULATOR_OUTDIR)/table: | $(SIMULATOR_OUTDIR)\n\tmkdir $@\n\n$(SIMULATOR_OUTDIR)/util: | $(SIMULATOR_OUTDIR)\n\tmkdir $@\n\n.PHONY: SIMULATOR_OBJDIRS\nSIMULATOR_OBJDIRS: \\\n\t$(SIMULATOR_OUTDIR)/db \\\n\t$(SIMULATOR_OUTDIR)/port \\\n\t$(SIMULATOR_OUTDIR)/table \\\n\t$(SIMULATOR_OUTDIR)/util \\\n\t$(SIMULATOR_OUTDIR)/helpers/memenv\n\n$(STATIC_ALLOBJS): | STATIC_OBJDIRS\n$(DEVICE_ALLOBJS): | DEVICE_OBJDIRS\n$(SIMULATOR_ALLOBJS): | SIMULATOR_OBJDIRS\n$(SHARED_ALLOBJS): | SHARED_OBJDIRS\n\nifeq ($(PLATFORM), IOS)\n$(DEVICE_OUTDIR)/libleveldb.a: $(DEVICE_LIBOBJECTS)\n\trm -f $@\n\t$(AR) -rs $@ $(DEVICE_LIBOBJECTS)\n\n$(SIMULATOR_OUTDIR)/libleveldb.a: $(SIMULATOR_LIBOBJECTS)\n\trm -f $@\n\t$(AR) -rs $@ $(SIMULATOR_LIBOBJECTS)\n\n$(DEVICE_OUTDIR)/libmemenv.a: $(DEVICE_MEMENVOBJECTS)\n\trm -f $@\n\t$(AR) -rs $@ $(DEVICE_MEMENVOBJECTS)\n\n$(SIMULATOR_OUTDIR)/libmemenv.a: $(SIMULATOR_MEMENVOBJECTS)\n\trm -f $@\n\t$(AR) -rs $@ $(SIMULATOR_MEMENVOBJECTS)\n\n# For iOS, create universal object libraries to be used on both the simulator and\n# a device.\n$(STATIC_OUTDIR)/libleveldb.a: $(STATIC_OUTDIR) $(DEVICE_OUTDIR)/libleveldb.a $(SIMULATOR_OUTDIR)/libleveldb.a\n\tlipo -create $(DEVICE_OUTDIR)/libleveldb.a $(SIMULATOR_OUTDIR)/libleveldb.a -output $@\n\n$(STATIC_OUTDIR)/libmemenv.a: $(STATIC_OUTDIR) $(DEVICE_OUTDIR)/libmemenv.a $(SIMULATOR_OUTDIR)/libmemenv.a\n\tlipo -create $(DEVICE_OUTDIR)/libmemenv.a $(SIMULATOR_OUTDIR)/libmemenv.a -output $@\nelse\n$(STATIC_OUTDIR)/libleveldb.a:$(STATIC_LIBOBJECTS)\n\trm -f $@\n\t$(AR) -rs $@ $(STATIC_LIBOBJECTS)\n\n$(STATIC_OUTDIR)/libmemenv.a:$(STATIC_MEMENVOBJECTS)\n\trm -f $@\n\t$(AR) -rs $@ $(STATIC_MEMENVOBJECTS)\nendif\n\n$(SHARED_MEMENVLIB):$(SHARED_MEMENVOBJECTS)\n\trm -f $@\n\t$(AR) -rs $@ $(SHARED_MEMENVOBJECTS)\n\n$(STATIC_OUTDIR)/db_bench:db/db_bench.cc $(STATIC_LIBOBJECTS) $(TESTUTIL)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/db_bench.cc $(STATIC_LIBOBJECTS) $(TESTUTIL) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/db_bench_sqlite3:doc/bench/db_bench_sqlite3.cc $(STATIC_LIBOBJECTS) $(TESTUTIL)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) doc/bench/db_bench_sqlite3.cc $(STATIC_LIBOBJECTS) $(TESTUTIL) -o $@ -lsqlite3 $(LIBS)\n\n$(STATIC_OUTDIR)/db_bench_tree_db:doc/bench/db_bench_tree_db.cc $(STATIC_LIBOBJECTS) $(TESTUTIL)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) doc/bench/db_bench_tree_db.cc $(STATIC_LIBOBJECTS) $(TESTUTIL) -o $@ -lkyotocabinet $(LIBS)\n\n$(STATIC_OUTDIR)/leveldbutil:db/leveldbutil.cc $(STATIC_LIBOBJECTS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/leveldbutil.cc $(STATIC_LIBOBJECTS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/arena_test:util/arena_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) util/arena_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/autocompact_test:db/autocompact_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/autocompact_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/bloom_test:util/bloom_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) util/bloom_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/c_test:$(STATIC_OUTDIR)/db/c_test.o $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(STATIC_OUTDIR)/db/c_test.o $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/cache_test:util/cache_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) util/cache_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/coding_test:util/coding_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) util/coding_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/corruption_test:db/corruption_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/corruption_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/crc32c_test:util/crc32c_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) util/crc32c_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/db_test:db/db_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/db_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/dbformat_test:db/dbformat_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/dbformat_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/env_posix_test:util/env_posix_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) util/env_posix_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/env_test:util/env_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) util/env_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/fault_injection_test:db/fault_injection_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/fault_injection_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/filename_test:db/filename_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/filename_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/filter_block_test:table/filter_block_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) table/filter_block_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/hash_test:util/hash_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) util/hash_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/issue178_test:issues/issue178_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) issues/issue178_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/issue200_test:issues/issue200_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) issues/issue200_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/log_test:db/log_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/log_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/recovery_test:db/recovery_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/recovery_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/table_test:table/table_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) table/table_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/skiplist_test:db/skiplist_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/skiplist_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/version_edit_test:db/version_edit_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/version_edit_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/version_set_test:db/version_set_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/version_set_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/write_batch_test:db/write_batch_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)\n\t$(CXX) $(LDFLAGS) $(CXXFLAGS) db/write_batch_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)\n\n$(STATIC_OUTDIR)/memenv_test:$(STATIC_OUTDIR)/helpers/memenv/memenv_test.o $(STATIC_OUTDIR)/libmemenv.a $(STATIC_OUTDIR)/libleveldb.a $(TESTHARNESS)\n\t$(XCRUN) $(CXX) $(LDFLAGS) $(STATIC_OUTDIR)/helpers/memenv/memenv_test.o $(STATIC_OUTDIR)/libmemenv.a $(STATIC_OUTDIR)/libleveldb.a $(TESTHARNESS) -o $@ $(LIBS)\n\n$(SHARED_OUTDIR)/db_bench:$(SHARED_OUTDIR)/db/db_bench.o $(SHARED_LIBS) $(TESTUTIL)\n\t$(XCRUN) $(CXX) $(LDFLAGS) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(SHARED_OUTDIR)/db/db_bench.o $(TESTUTIL) $(SHARED_OUTDIR)/$(SHARED_LIB3) -o $@ $(LIBS)\n\n.PHONY: run-shared\nrun-shared: $(SHARED_OUTDIR)/db_bench\n\tLD_LIBRARY_PATH=$(SHARED_OUTDIR) $(SHARED_OUTDIR)/db_bench\n\n$(SIMULATOR_OUTDIR)/%.o: %.cc\n\txcrun -sdk iphonesimulator $(CXX) $(CXXFLAGS) $(SIMULATOR_CFLAGS) -c $< -o $@\n\n$(DEVICE_OUTDIR)/%.o: %.cc\n\txcrun -sdk iphoneos $(CXX) $(CXXFLAGS) $(DEVICE_CFLAGS) -c $< -o $@\n\n$(SIMULATOR_OUTDIR)/%.o: %.c\n\txcrun -sdk iphonesimulator $(CC) $(CFLAGS) $(SIMULATOR_CFLAGS) -c $< -o $@\n\n$(DEVICE_OUTDIR)/%.o: %.c\n\txcrun -sdk iphoneos $(CC) $(CFLAGS) $(DEVICE_CFLAGS) -c $< -o $@\n\n$(STATIC_OUTDIR)/%.o: %.cc\n\t$(CXX) $(CXXFLAGS) -c $< -o $@\n\n$(STATIC_OUTDIR)/%.o: %.c\n\t$(CC) $(CFLAGS) -c $< -o $@\n\n$(SHARED_OUTDIR)/%.o: %.cc\n\t$(CXX) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) -c $< -o $@\n\n$(SHARED_OUTDIR)/%.o: %.c\n\t$(CC) $(CFLAGS) $(PLATFORM_SHARED_CFLAGS) -c $< -o $@\n\n$(STATIC_OUTDIR)/port/port_posix_sse.o: port/port_posix_sse.cc\n\t$(CXX) $(CXXFLAGS) $(PLATFORM_SSEFLAGS) -c $< -o $@\n\n$(SHARED_OUTDIR)/port/port_posix_sse.o: port/port_posix_sse.cc\n\t$(CXX) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(PLATFORM_SSEFLAGS) -c $< -o $@\n"
  },
  {
    "path": "src/leveldb/NEWS",
    "content": "Release 1.2 2011-05-16\n----------------------\n\nFixes for larger databases (tested up to one billion 100-byte entries,\ni.e., ~100GB).\n\n(1) Place hard limit on number of level-0 files.  This fixes errors\nof the form \"too many open files\".\n\n(2) Fixed memtable management.  Before the fix, a heavy write burst\ncould cause unbounded memory usage.\n\nA fix for a logging bug where the reader would incorrectly complain\nabout corruption.\n\nAllow public access to WriteBatch contents so that users can easily\nwrap a DB.\n"
  },
  {
    "path": "src/leveldb/README.md",
    "content": "**LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.**\n\n[![Build Status](https://travis-ci.org/google/leveldb.svg?branch=master)](https://travis-ci.org/google/leveldb)\n\nAuthors: Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com)\n\n# Features\n  * Keys and values are arbitrary byte arrays.\n  * Data is stored sorted by key.\n  * Callers can provide a custom comparison function to override the sort order.\n  * The basic operations are `Put(key,value)`, `Get(key)`, `Delete(key)`.\n  * Multiple changes can be made in one atomic batch.\n  * Users can create a transient snapshot to get a consistent view of data.\n  * Forward and backward iteration is supported over the data.\n  * Data is automatically compressed using the [Snappy compression library](http://google.github.io/snappy/).\n  * External activity (file system operations etc.) is relayed through a virtual interface so users can customize the operating system interactions.\n\n# Documentation\n  [LevelDB library documentation](https://github.com/google/leveldb/blob/master/doc/index.md) is online and bundled with the source code.\n\n\n# Limitations\n  * This is not a SQL database.  It does not have a relational data model, it does not support SQL queries, and it has no support for indexes.\n  * Only a single process (possibly multi-threaded) can access a particular database at a time.\n  * There is no client-server support builtin to the library.  An application that needs such support will have to wrap their own server around the library.\n\n# Contributing to the leveldb Project\nThe leveldb project welcomes contributions. leveldb's primary goal is to be\na reliable and fast key/value store. Changes that are in line with the\nfeatures/limitations outlined above, and meet the requirements below,\nwill be considered.\n\nContribution requirements:\n\n1. **POSIX only**. We _generally_ will only accept changes that are both\n   compiled, and tested on a POSIX platform - usually Linux. Very small\n   changes will sometimes be accepted, but consider that more of an\n   exception than the rule.\n\n2. **Stable API**. We strive very hard to maintain a stable API. Changes that\n   require changes for projects using leveldb _might_ be rejected without\n   sufficient benefit to the project.\n\n3. **Tests**: All changes must be accompanied by a new (or changed) test, or\n   a sufficient explanation as to why a new (or changed) test is not required.\n\n## Submitting a Pull Request\nBefore any pull request will be accepted the author must first sign a\nContributor License Agreement (CLA) at https://cla.developers.google.com/.\n\nIn order to keep the commit timeline linear\n[squash](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Squashing-Commits)\nyour changes down to a single commit and [rebase](https://git-scm.com/docs/git-rebase)\non google/leveldb/master. This keeps the commit timeline linear and more easily sync'ed\nwith the internal repository at Google. More information at GitHub's\n[About Git rebase](https://help.github.com/articles/about-git-rebase/) page.\n\n# Performance\n\nHere is a performance report (with explanations) from the run of the\nincluded db_bench program.  The results are somewhat noisy, but should\nbe enough to get a ballpark performance estimate.\n\n## Setup\n\nWe use a database with a million entries.  Each entry has a 16 byte\nkey, and a 100 byte value.  Values used by the benchmark compress to\nabout half their original size.\n\n    LevelDB:    version 1.1\n    Date:       Sun May  1 12:11:26 2011\n    CPU:        4 x Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz\n    CPUCache:   4096 KB\n    Keys:       16 bytes each\n    Values:     100 bytes each (50 bytes after compression)\n    Entries:    1000000\n    Raw Size:   110.6 MB (estimated)\n    File Size:  62.9 MB (estimated)\n\n## Write performance\n\nThe \"fill\" benchmarks create a brand new database, in either\nsequential, or random order.  The \"fillsync\" benchmark flushes data\nfrom the operating system to the disk after every operation; the other\nwrite operations leave the data sitting in the operating system buffer\ncache for a while.  The \"overwrite\" benchmark does random writes that\nupdate existing keys in the database.\n\n    fillseq      :       1.765 micros/op;   62.7 MB/s\n    fillsync     :     268.409 micros/op;    0.4 MB/s (10000 ops)\n    fillrandom   :       2.460 micros/op;   45.0 MB/s\n    overwrite    :       2.380 micros/op;   46.5 MB/s\n\nEach \"op\" above corresponds to a write of a single key/value pair.\nI.e., a random write benchmark goes at approximately 400,000 writes per second.\n\nEach \"fillsync\" operation costs much less (0.3 millisecond)\nthan a disk seek (typically 10 milliseconds).  We suspect that this is\nbecause the hard disk itself is buffering the update in its memory and\nresponding before the data has been written to the platter.  This may\nor may not be safe based on whether or not the hard disk has enough\npower to save its memory in the event of a power failure.\n\n## Read performance\n\nWe list the performance of reading sequentially in both the forward\nand reverse direction, and also the performance of a random lookup.\nNote that the database created by the benchmark is quite small.\nTherefore the report characterizes the performance of leveldb when the\nworking set fits in memory.  The cost of reading a piece of data that\nis not present in the operating system buffer cache will be dominated\nby the one or two disk seeks needed to fetch the data from disk.\nWrite performance will be mostly unaffected by whether or not the\nworking set fits in memory.\n\n    readrandom  : 16.677 micros/op;  (approximately 60,000 reads per second)\n    readseq     :  0.476 micros/op;  232.3 MB/s\n    readreverse :  0.724 micros/op;  152.9 MB/s\n\nLevelDB compacts its underlying storage data in the background to\nimprove read performance.  The results listed above were done\nimmediately after a lot of random writes.  The results after\ncompactions (which are usually triggered automatically) are better.\n\n    readrandom  : 11.602 micros/op;  (approximately 85,000 reads per second)\n    readseq     :  0.423 micros/op;  261.8 MB/s\n    readreverse :  0.663 micros/op;  166.9 MB/s\n\nSome of the high cost of reads comes from repeated decompression of blocks\nread from disk.  If we supply enough cache to the leveldb so it can hold the\nuncompressed blocks in memory, the read performance improves again:\n\n    readrandom  : 9.775 micros/op;  (approximately 100,000 reads per second before compaction)\n    readrandom  : 5.215 micros/op;  (approximately 190,000 reads per second after compaction)\n\n## Repository contents\n\nSee [doc/index.md](doc/index.md) for more explanation. See\n[doc/impl.md](doc/impl.md) for a brief overview of the implementation.\n\nThe public interface is in include/*.h.  Callers should not include or\nrely on the details of any other header files in this package.  Those\ninternal APIs may be changed without warning.\n\nGuide to header files:\n\n* **include/db.h**: Main interface to the DB: Start here\n\n* **include/options.h**: Control over the behavior of an entire database,\nand also control over the behavior of individual reads and writes.\n\n* **include/comparator.h**: Abstraction for user-specified comparison function.\nIf you want just bytewise comparison of keys, you can use the default\ncomparator, but clients can write their own comparator implementations if they\nwant custom ordering (e.g. to handle different character encodings, etc.)\n\n* **include/iterator.h**: Interface for iterating over data. You can get\nan iterator from a DB object.\n\n* **include/write_batch.h**: Interface for atomically applying multiple\nupdates to a database.\n\n* **include/slice.h**: A simple module for maintaining a pointer and a\nlength into some other byte array.\n\n* **include/status.h**: Status is returned from many of the public interfaces\nand is used to report success and various kinds of errors.\n\n* **include/env.h**:\nAbstraction of the OS environment.  A posix implementation of this interface is\nin util/env_posix.cc\n\n* **include/table.h, include/table_builder.h**: Lower-level modules that most\nclients probably won't use directly\n"
  },
  {
    "path": "src/leveldb/TODO",
    "content": "ss\n- Stats\n\ndb\n- Maybe implement DB::BulkDeleteForRange(start_key, end_key)\n  that would blow away files whose ranges are entirely contained\n  within [start_key..end_key]?  For Chrome, deletion of obsolete\n  object stores, etc. can be done in the background anyway, so\n  probably not that important.\n- There have been requests for MultiGet.\n\nAfter a range is completely deleted, what gets rid of the\ncorresponding files if we do no future changes to that range.  Make\nthe conditions for triggering compactions fire in more situations?\n"
  },
  {
    "path": "src/leveldb/WINDOWS.md",
    "content": "# Building LevelDB On Windows\n\n## Prereqs \n\nInstall the [Windows Software Development Kit version 7.1](http://www.microsoft.com/downloads/dlx/en-us/listdetailsview.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b).\n\nDownload and extract the [Snappy source distribution](http://snappy.googlecode.com/files/snappy-1.0.5.tar.gz)\n\n1. Open the \"Windows SDK 7.1 Command Prompt\" :\n   Start Menu -> \"Microsoft Windows SDK v7.1\" > \"Windows SDK 7.1 Command Prompt\"\n2. Change the directory to the leveldb project\n\n## Building the Static lib \n\n* 32 bit Version \n\n        setenv /x86\n        msbuild.exe /p:Configuration=Release /p:Platform=Win32 /p:Snappy=..\\snappy-1.0.5\n\n* 64 bit Version \n\n        setenv /x64\n        msbuild.exe /p:Configuration=Release /p:Platform=x64 /p:Snappy=..\\snappy-1.0.5\n\n\n## Building and Running the Benchmark app\n\n* 32 bit Version \n\n\t    setenv /x86\n\t    msbuild.exe /p:Configuration=Benchmark /p:Platform=Win32 /p:Snappy=..\\snappy-1.0.5\n\t\tBenchmark\\leveldb.exe\n\n* 64 bit Version \n\n\t    setenv /x64\n\t    msbuild.exe /p:Configuration=Benchmark /p:Platform=x64 /p:Snappy=..\\snappy-1.0.5\n\t    x64\\Benchmark\\leveldb.exe\n\n"
  },
  {
    "path": "src/leveldb/build_detect_platform",
    "content": "#!/bin/sh\n#\n# Detects OS we're compiling on and outputs a file specified by the first\n# argument, which in turn gets read while processing Makefile.\n#\n# The output will set the following variables:\n#   CC                          C Compiler path\n#   CXX                         C++ Compiler path\n#   PLATFORM_LDFLAGS            Linker flags\n#   PLATFORM_LIBS               Libraries flags\n#   PLATFORM_SHARED_EXT         Extension for shared libraries\n#   PLATFORM_SHARED_LDFLAGS     Flags for building shared library\n#                               This flag is embedded just before the name\n#                               of the shared library without intervening spaces\n#   PLATFORM_SHARED_CFLAGS      Flags for compiling objects for shared library\n#   PLATFORM_CCFLAGS            C compiler flags\n#   PLATFORM_CXXFLAGS           C++ compiler flags.  Will contain:\n#   PLATFORM_SHARED_VERSIONED   Set to 'true' if platform supports versioned\n#                               shared libraries, empty otherwise.\n#\n# The PLATFORM_CCFLAGS and PLATFORM_CXXFLAGS might include the following:\n#\n#       -DLEVELDB_ATOMIC_PRESENT     if <atomic> is present\n#       -DLEVELDB_PLATFORM_POSIX     for Posix-based platforms\n#       -DSNAPPY                     if the Snappy library is present\n#\n\nOUTPUT=$1\nPREFIX=$2\nif test -z \"$OUTPUT\" || test -z \"$PREFIX\"; then\n  echo \"usage: $0 <output-filename> <directory_prefix>\" >&2\n  exit 1\nfi\n\n# Delete existing output, if it exists\nrm -f $OUTPUT\ntouch $OUTPUT\n\nif test -z \"$CC\"; then\n    CC=cc\nfi\n\nif test -z \"$CXX\"; then\n    CXX=g++\nfi\n\nif test -z \"$TMPDIR\"; then\n    TMPDIR=/tmp\nfi\n\n# Detect OS\nif test -z \"$TARGET_OS\"; then\n    TARGET_OS=`uname -s`\nfi\n\nCOMMON_FLAGS=\nCROSS_COMPILE=\nPLATFORM_CCFLAGS=\nPLATFORM_CXXFLAGS=\nPLATFORM_LDFLAGS=\nPLATFORM_LIBS=\nPLATFORM_SHARED_EXT=\"so\"\nPLATFORM_SHARED_LDFLAGS=\"-shared -Wl,-soname -Wl,\"\nPLATFORM_SHARED_CFLAGS=\"-fPIC\"\nPLATFORM_SHARED_VERSIONED=true\nPLATFORM_SSEFLAGS=\n\nMEMCMP_FLAG=\nif [ \"$CXX\" = \"g++\" ]; then\n    # Use libc's memcmp instead of GCC's memcmp.  This results in ~40%\n    # performance improvement on readrandom under gcc 4.4.3 on Linux/x86.\n    MEMCMP_FLAG=\"-fno-builtin-memcmp\"\nfi\n\ncase \"$TARGET_OS\" in\n    CYGWIN_*)\n        PLATFORM=OS_LINUX\n        COMMON_FLAGS=\"$MEMCMP_FLAG -lpthread -DOS_LINUX -DCYGWIN\"\n        PLATFORM_LDFLAGS=\"-lpthread\"\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        ;;\n    Darwin)\n        PLATFORM=OS_MACOSX\n        COMMON_FLAGS=\"$MEMCMP_FLAG -DOS_MACOSX\"\n        PLATFORM_SHARED_EXT=dylib\n        [ -z \"$INSTALL_PATH\" ] && INSTALL_PATH=`pwd`\n        PLATFORM_SHARED_LDFLAGS=\"-dynamiclib -install_name $INSTALL_PATH/\"\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        ;;\n    Linux)\n        PLATFORM=OS_LINUX\n        COMMON_FLAGS=\"$MEMCMP_FLAG -pthread -DOS_LINUX\"\n        PLATFORM_LDFLAGS=\"-pthread\"\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        ;;\n    SunOS)\n        PLATFORM=OS_SOLARIS\n        COMMON_FLAGS=\"$MEMCMP_FLAG -D_REENTRANT -DOS_SOLARIS\"\n        PLATFORM_LIBS=\"-lpthread -lrt\"\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        ;;\n    FreeBSD)\n        PLATFORM=OS_FREEBSD\n        COMMON_FLAGS=\"$MEMCMP_FLAG -D_REENTRANT -DOS_FREEBSD\"\n        PLATFORM_LIBS=\"-lpthread\"\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        ;;\n    GNU/kFreeBSD)\n        PLATFORM=OS_KFREEBSD\n        COMMON_FLAGS=\"$MEMCMP_FLAG -D_REENTRANT -DOS_KFREEBSD\"\n        PLATFORM_LIBS=\"-lpthread\"\n        PORT_FILE=port/port_posix.cc\n        ;;\n    NetBSD)\n        PLATFORM=OS_NETBSD\n        COMMON_FLAGS=\"$MEMCMP_FLAG -D_REENTRANT -DOS_NETBSD\"\n        PLATFORM_LIBS=\"-lpthread -lgcc_s\"\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        ;;\n    OpenBSD)\n        PLATFORM=OS_OPENBSD\n        COMMON_FLAGS=\"$MEMCMP_FLAG -D_REENTRANT -DOS_OPENBSD\"\n        PLATFORM_LDFLAGS=\"-pthread\"\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        ;;\n    DragonFly)\n        PLATFORM=OS_DRAGONFLYBSD\n        COMMON_FLAGS=\"$MEMCMP_FLAG -D_REENTRANT -DOS_DRAGONFLYBSD\"\n        PLATFORM_LIBS=\"-lpthread\"\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        ;;\n    OS_ANDROID_CROSSCOMPILE)\n        PLATFORM=OS_ANDROID\n        COMMON_FLAGS=\"$MEMCMP_FLAG -D_REENTRANT -DOS_ANDROID -DLEVELDB_PLATFORM_POSIX\"\n        PLATFORM_LDFLAGS=\"\"  # All pthread features are in the Android C library\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        CROSS_COMPILE=true\n        ;;\n    HP-UX)\n        PLATFORM=OS_HPUX\n        COMMON_FLAGS=\"$MEMCMP_FLAG -D_REENTRANT -DOS_HPUX\"\n        PLATFORM_LDFLAGS=\"-pthread\"\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        # man ld: +h internal_name\n        PLATFORM_SHARED_LDFLAGS=\"-shared -Wl,+h -Wl,\"\n        ;;\n    IOS)\n        PLATFORM=IOS\n        COMMON_FLAGS=\"$MEMCMP_FLAG -DOS_MACOSX\"\n        [ -z \"$INSTALL_PATH\" ] && INSTALL_PATH=`pwd`\n        PORT_FILE=port/port_posix.cc\n        PORT_SSE_FILE=port/port_posix_sse.cc\n        PLATFORM_SHARED_EXT=\n        PLATFORM_SHARED_LDFLAGS=\n        PLATFORM_SHARED_CFLAGS=\n        PLATFORM_SHARED_VERSIONED=\n        ;;\n    OS_WINDOWS_CROSSCOMPILE | NATIVE_WINDOWS)\n        PLATFORM=OS_WINDOWS\n        COMMON_FLAGS=\"-fno-builtin-memcmp -D_REENTRANT -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0500 -D__USE_MINGW_ANSI_STDIO=1\"\n        PLATFORM_SOURCES=\"util/env_win.cc\"\n        PLATFORM_LIBS=\"-lshlwapi\"\n        PORT_FILE=port/port_win.cc\n        CROSS_COMPILE=true\n        ;;\n    *)\n        echo \"Unknown platform!\" >&2\n        exit 1\nesac\n\n# We want to make a list of all cc files within util, db, table, and helpers\n# except for the test and benchmark files. By default, find will output a list\n# of all files matching either rule, so we need to append -print to make the\n# prune take effect.\nDIRS=\"$PREFIX/db $PREFIX/util $PREFIX/table\"\n\nset -f # temporarily disable globbing so that our patterns aren't expanded\nPRUNE_TEST=\"-name *test*.cc -prune\"\nPRUNE_BENCH=\"-name *_bench.cc -prune\"\nPRUNE_TOOL=\"-name leveldbutil.cc -prune\"\nPORTABLE_FILES=`find $DIRS $PRUNE_TEST -o $PRUNE_BENCH -o $PRUNE_TOOL -o -name '*.cc' -print | sort | sed \"s,^$PREFIX/,,\" | tr \"\\n\" \" \"`\n\nset +f # re-enable globbing\n\n# The sources consist of the portable files, plus the platform-specific port\n# file.\necho \"SOURCES=$PORTABLE_FILES $PORT_FILE $PORT_SSE_FILE\" >> $OUTPUT\necho \"MEMENV_SOURCES=helpers/memenv/memenv.cc\" >> $OUTPUT\n\nif [ \"$CROSS_COMPILE\" = \"true\" ]; then\n    # Cross-compiling; do not try any compilation tests.\n    true\nelse\n    CXXOUTPUT=\"${TMPDIR}/leveldb_build_detect_platform-cxx.$$\"\n\n    # If -std=c++0x works, use <atomic> as fallback for when memory barriers\n    # are not available.\n    $CXX $CXXFLAGS -std=c++0x -x c++ - -o $CXXOUTPUT 2>/dev/null  <<EOF\n      #include <atomic>\n      int main() {}\nEOF\n    if [ \"$?\" = 0 ]; then\n        COMMON_FLAGS=\"$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT\"\n        PLATFORM_CXXFLAGS=\"-std=c++0x\"\n    else\n        COMMON_FLAGS=\"$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX\"\n    fi\n\n    # Test whether tcmalloc is available\n    $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null  <<EOF\n      int main() {}\nEOF\n    if [ \"$?\" = 0 ]; then\n        PLATFORM_LIBS=\"$PLATFORM_LIBS -ltcmalloc\"\n    fi\n\n    rm -f $CXXOUTPUT 2>/dev/null\n\n    # Test if gcc SSE 4.2 is supported\n    $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -msse4.2 2>/dev/null  <<EOF\n      int main() {}\nEOF\n    if [ \"$?\" = 0 ]; then\n        PLATFORM_SSEFLAGS=\"-msse4.2\"\n    fi\n\n    rm -f $CXXOUTPUT 2>/dev/null\nfi\n\n# Use the SSE 4.2 CRC32C intrinsics iff runtime checks indicate compiler supports them.\nif [ -n \"$PLATFORM_SSEFLAGS\" ]; then\n    PLATFORM_SSEFLAGS=\"$PLATFORM_SSEFLAGS -DLEVELDB_PLATFORM_POSIX_SSE\"\nfi\n\nPLATFORM_CCFLAGS=\"$PLATFORM_CCFLAGS $COMMON_FLAGS\"\nPLATFORM_CXXFLAGS=\"$PLATFORM_CXXFLAGS $COMMON_FLAGS\"\n\necho \"CC=$CC\" >> $OUTPUT\necho \"CXX=$CXX\" >> $OUTPUT\necho \"PLATFORM=$PLATFORM\" >> $OUTPUT\necho \"PLATFORM_LDFLAGS=$PLATFORM_LDFLAGS\" >> $OUTPUT\necho \"PLATFORM_LIBS=$PLATFORM_LIBS\" >> $OUTPUT\necho \"PLATFORM_CCFLAGS=$PLATFORM_CCFLAGS\" >> $OUTPUT\necho \"PLATFORM_CXXFLAGS=$PLATFORM_CXXFLAGS\" >> $OUTPUT\necho \"PLATFORM_SSEFLAGS=$PLATFORM_SSEFLAGS\" >> $OUTPUT\necho \"PLATFORM_SHARED_CFLAGS=$PLATFORM_SHARED_CFLAGS\" >> $OUTPUT\necho \"PLATFORM_SHARED_EXT=$PLATFORM_SHARED_EXT\" >> $OUTPUT\necho \"PLATFORM_SHARED_LDFLAGS=$PLATFORM_SHARED_LDFLAGS\" >> $OUTPUT\necho \"PLATFORM_SHARED_VERSIONED=$PLATFORM_SHARED_VERSIONED\" >> $OUTPUT\n"
  },
  {
    "path": "src/leveldb/db/autocompact_test.cc",
    "content": "// Copyright (c) 2013 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/db.h\"\n#include \"db/db_impl.h\"\n#include \"leveldb/cache.h\"\n#include \"util/testharness.h\"\n#include \"util/testutil.h\"\n\nnamespace leveldb {\n\nclass AutoCompactTest {\n public:\n  std::string dbname_;\n  Cache* tiny_cache_;\n  Options options_;\n  DB* db_;\n\n  AutoCompactTest() {\n    dbname_ = test::TmpDir() + \"/autocompact_test\";\n    tiny_cache_ = NewLRUCache(100);\n    options_.block_cache = tiny_cache_;\n    DestroyDB(dbname_, options_);\n    options_.create_if_missing = true;\n    options_.compression = kNoCompression;\n    ASSERT_OK(DB::Open(options_, dbname_, &db_));\n  }\n\n  ~AutoCompactTest() {\n    delete db_;\n    DestroyDB(dbname_, Options());\n    delete tiny_cache_;\n  }\n\n  std::string Key(int i) {\n    char buf[100];\n    snprintf(buf, sizeof(buf), \"key%06d\", i);\n    return std::string(buf);\n  }\n\n  uint64_t Size(const Slice& start, const Slice& limit) {\n    Range r(start, limit);\n    uint64_t size;\n    db_->GetApproximateSizes(&r, 1, &size);\n    return size;\n  }\n\n  void DoReads(int n);\n};\n\nstatic const int kValueSize = 200 * 1024;\nstatic const int kTotalSize = 100 * 1024 * 1024;\nstatic const int kCount = kTotalSize / kValueSize;\n\n// Read through the first n keys repeatedly and check that they get\n// compacted (verified by checking the size of the key space).\nvoid AutoCompactTest::DoReads(int n) {\n  std::string value(kValueSize, 'x');\n  DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);\n\n  // Fill database\n  for (int i = 0; i < kCount; i++) {\n    ASSERT_OK(db_->Put(WriteOptions(), Key(i), value));\n  }\n  ASSERT_OK(dbi->TEST_CompactMemTable());\n\n  // Delete everything\n  for (int i = 0; i < kCount; i++) {\n    ASSERT_OK(db_->Delete(WriteOptions(), Key(i)));\n  }\n  ASSERT_OK(dbi->TEST_CompactMemTable());\n\n  // Get initial measurement of the space we will be reading.\n  const int64_t initial_size = Size(Key(0), Key(n));\n  const int64_t initial_other_size = Size(Key(n), Key(kCount));\n\n  // Read until size drops significantly.\n  std::string limit_key = Key(n);\n  for (int read = 0; true; read++) {\n    ASSERT_LT(read, 100) << \"Taking too long to compact\";\n    Iterator* iter = db_->NewIterator(ReadOptions());\n    for (iter->SeekToFirst();\n         iter->Valid() && iter->key().ToString() < limit_key;\n         iter->Next()) {\n      // Drop data\n    }\n    delete iter;\n    // Wait a little bit to allow any triggered compactions to complete.\n    Env::Default()->SleepForMicroseconds(1000000);\n    uint64_t size = Size(Key(0), Key(n));\n    fprintf(stderr, \"iter %3d => %7.3f MB [other %7.3f MB]\\n\",\n            read+1, size/1048576.0, Size(Key(n), Key(kCount))/1048576.0);\n    if (size <= initial_size/10) {\n      break;\n    }\n  }\n\n  // Verify that the size of the key space not touched by the reads\n  // is pretty much unchanged.\n  const int64_t final_other_size = Size(Key(n), Key(kCount));\n  ASSERT_LE(final_other_size, initial_other_size + 1048576);\n  ASSERT_GE(final_other_size, initial_other_size/5 - 1048576);\n}\n\nTEST(AutoCompactTest, ReadAll) {\n  DoReads(kCount);\n}\n\nTEST(AutoCompactTest, ReadHalf) {\n  DoReads(kCount/2);\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/builder.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/builder.h\"\n\n#include \"db/filename.h\"\n#include \"db/dbformat.h\"\n#include \"db/table_cache.h\"\n#include \"db/version_edit.h\"\n#include \"leveldb/db.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/iterator.h\"\n\nnamespace leveldb {\n\nStatus BuildTable(const std::string& dbname,\n                  Env* env,\n                  const Options& options,\n                  TableCache* table_cache,\n                  Iterator* iter,\n                  FileMetaData* meta) {\n  Status s;\n  meta->file_size = 0;\n  iter->SeekToFirst();\n\n  std::string fname = TableFileName(dbname, meta->number);\n  if (iter->Valid()) {\n    WritableFile* file;\n    s = env->NewWritableFile(fname, &file);\n    if (!s.ok()) {\n      return s;\n    }\n\n    TableBuilder* builder = new TableBuilder(options, file);\n    meta->smallest.DecodeFrom(iter->key());\n    for (; iter->Valid(); iter->Next()) {\n      Slice key = iter->key();\n      meta->largest.DecodeFrom(key);\n      builder->Add(key, iter->value());\n    }\n\n    // Finish and check for builder errors\n    if (s.ok()) {\n      s = builder->Finish();\n      if (s.ok()) {\n        meta->file_size = builder->FileSize();\n        assert(meta->file_size > 0);\n      }\n    } else {\n      builder->Abandon();\n    }\n    delete builder;\n\n    // Finish and check for file errors\n    if (s.ok()) {\n      s = file->Sync();\n    }\n    if (s.ok()) {\n      s = file->Close();\n    }\n    delete file;\n    file = NULL;\n\n    if (s.ok()) {\n      // Verify that the table is usable\n      Iterator* it = table_cache->NewIterator(ReadOptions(),\n                                              meta->number,\n                                              meta->file_size);\n      s = it->status();\n      delete it;\n    }\n  }\n\n  // Check for input iterator errors\n  if (!iter->status().ok()) {\n    s = iter->status();\n  }\n\n  if (s.ok() && meta->file_size > 0) {\n    // Keep it\n  } else {\n    env->DeleteFile(fname);\n  }\n  return s;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/builder.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_BUILDER_H_\n#define STORAGE_LEVELDB_DB_BUILDER_H_\n\n#include \"leveldb/status.h\"\n\nnamespace leveldb {\n\nstruct Options;\nstruct FileMetaData;\n\nclass Env;\nclass Iterator;\nclass TableCache;\nclass VersionEdit;\n\n// Build a Table file from the contents of *iter.  The generated file\n// will be named according to meta->number.  On success, the rest of\n// *meta will be filled with metadata about the generated table.\n// If no data is present in *iter, meta->file_size will be set to\n// zero, and no Table file will be produced.\nextern Status BuildTable(const std::string& dbname,\n                         Env* env,\n                         const Options& options,\n                         TableCache* table_cache,\n                         Iterator* iter,\n                         FileMetaData* meta);\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_BUILDER_H_\n"
  },
  {
    "path": "src/leveldb/db/c.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/c.h\"\n\n#include <stdlib.h>\n#include <unistd.h>\n#include \"leveldb/cache.h\"\n#include \"leveldb/comparator.h\"\n#include \"leveldb/db.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/filter_policy.h\"\n#include \"leveldb/iterator.h\"\n#include \"leveldb/options.h\"\n#include \"leveldb/status.h\"\n#include \"leveldb/write_batch.h\"\n\nusing leveldb::Cache;\nusing leveldb::Comparator;\nusing leveldb::CompressionType;\nusing leveldb::DB;\nusing leveldb::Env;\nusing leveldb::FileLock;\nusing leveldb::FilterPolicy;\nusing leveldb::Iterator;\nusing leveldb::kMajorVersion;\nusing leveldb::kMinorVersion;\nusing leveldb::Logger;\nusing leveldb::NewBloomFilterPolicy;\nusing leveldb::NewLRUCache;\nusing leveldb::Options;\nusing leveldb::RandomAccessFile;\nusing leveldb::Range;\nusing leveldb::ReadOptions;\nusing leveldb::SequentialFile;\nusing leveldb::Slice;\nusing leveldb::Snapshot;\nusing leveldb::Status;\nusing leveldb::WritableFile;\nusing leveldb::WriteBatch;\nusing leveldb::WriteOptions;\n\nextern \"C\" {\n\nstruct leveldb_t              { DB*               rep; };\nstruct leveldb_iterator_t     { Iterator*         rep; };\nstruct leveldb_writebatch_t   { WriteBatch        rep; };\nstruct leveldb_snapshot_t     { const Snapshot*   rep; };\nstruct leveldb_readoptions_t  { ReadOptions       rep; };\nstruct leveldb_writeoptions_t { WriteOptions      rep; };\nstruct leveldb_options_t      { Options           rep; };\nstruct leveldb_cache_t        { Cache*            rep; };\nstruct leveldb_seqfile_t      { SequentialFile*   rep; };\nstruct leveldb_randomfile_t   { RandomAccessFile* rep; };\nstruct leveldb_writablefile_t { WritableFile*     rep; };\nstruct leveldb_logger_t       { Logger*           rep; };\nstruct leveldb_filelock_t     { FileLock*         rep; };\n\nstruct leveldb_comparator_t : public Comparator {\n  void* state_;\n  void (*destructor_)(void*);\n  int (*compare_)(\n      void*,\n      const char* a, size_t alen,\n      const char* b, size_t blen);\n  const char* (*name_)(void*);\n\n  virtual ~leveldb_comparator_t() {\n    (*destructor_)(state_);\n  }\n\n  virtual int Compare(const Slice& a, const Slice& b) const {\n    return (*compare_)(state_, a.data(), a.size(), b.data(), b.size());\n  }\n\n  virtual const char* Name() const {\n    return (*name_)(state_);\n  }\n\n  // No-ops since the C binding does not support key shortening methods.\n  virtual void FindShortestSeparator(std::string*, const Slice&) const { }\n  virtual void FindShortSuccessor(std::string* key) const { }\n};\n\nstruct leveldb_filterpolicy_t : public FilterPolicy {\n  void* state_;\n  void (*destructor_)(void*);\n  const char* (*name_)(void*);\n  char* (*create_)(\n      void*,\n      const char* const* key_array, const size_t* key_length_array,\n      int num_keys,\n      size_t* filter_length);\n  unsigned char (*key_match_)(\n      void*,\n      const char* key, size_t length,\n      const char* filter, size_t filter_length);\n\n  virtual ~leveldb_filterpolicy_t() {\n    (*destructor_)(state_);\n  }\n\n  virtual const char* Name() const {\n    return (*name_)(state_);\n  }\n\n  virtual void CreateFilter(const Slice* keys, int n, std::string* dst) const {\n    std::vector<const char*> key_pointers(n);\n    std::vector<size_t> key_sizes(n);\n    for (int i = 0; i < n; i++) {\n      key_pointers[i] = keys[i].data();\n      key_sizes[i] = keys[i].size();\n    }\n    size_t len;\n    char* filter = (*create_)(state_, &key_pointers[0], &key_sizes[0], n, &len);\n    dst->append(filter, len);\n    free(filter);\n  }\n\n  virtual bool KeyMayMatch(const Slice& key, const Slice& filter) const {\n    return (*key_match_)(state_, key.data(), key.size(),\n                         filter.data(), filter.size());\n  }\n};\n\nstruct leveldb_env_t {\n  Env* rep;\n  bool is_default;\n};\n\nstatic bool SaveError(char** errptr, const Status& s) {\n  assert(errptr != NULL);\n  if (s.ok()) {\n    return false;\n  } else if (*errptr == NULL) {\n    *errptr = strdup(s.ToString().c_str());\n  } else {\n    // TODO(sanjay): Merge with existing error?\n    free(*errptr);\n    *errptr = strdup(s.ToString().c_str());\n  }\n  return true;\n}\n\nstatic char* CopyString(const std::string& str) {\n  char* result = reinterpret_cast<char*>(malloc(sizeof(char) * str.size()));\n  memcpy(result, str.data(), sizeof(char) * str.size());\n  return result;\n}\n\nleveldb_t* leveldb_open(\n    const leveldb_options_t* options,\n    const char* name,\n    char** errptr) {\n  DB* db;\n  if (SaveError(errptr, DB::Open(options->rep, std::string(name), &db))) {\n    return NULL;\n  }\n  leveldb_t* result = new leveldb_t;\n  result->rep = db;\n  return result;\n}\n\nvoid leveldb_close(leveldb_t* db) {\n  delete db->rep;\n  delete db;\n}\n\nvoid leveldb_put(\n    leveldb_t* db,\n    const leveldb_writeoptions_t* options,\n    const char* key, size_t keylen,\n    const char* val, size_t vallen,\n    char** errptr) {\n  SaveError(errptr,\n            db->rep->Put(options->rep, Slice(key, keylen), Slice(val, vallen)));\n}\n\nvoid leveldb_delete(\n    leveldb_t* db,\n    const leveldb_writeoptions_t* options,\n    const char* key, size_t keylen,\n    char** errptr) {\n  SaveError(errptr, db->rep->Delete(options->rep, Slice(key, keylen)));\n}\n\n\nvoid leveldb_write(\n    leveldb_t* db,\n    const leveldb_writeoptions_t* options,\n    leveldb_writebatch_t* batch,\n    char** errptr) {\n  SaveError(errptr, db->rep->Write(options->rep, &batch->rep));\n}\n\nchar* leveldb_get(\n    leveldb_t* db,\n    const leveldb_readoptions_t* options,\n    const char* key, size_t keylen,\n    size_t* vallen,\n    char** errptr) {\n  char* result = NULL;\n  std::string tmp;\n  Status s = db->rep->Get(options->rep, Slice(key, keylen), &tmp);\n  if (s.ok()) {\n    *vallen = tmp.size();\n    result = CopyString(tmp);\n  } else {\n    *vallen = 0;\n    if (!s.IsNotFound()) {\n      SaveError(errptr, s);\n    }\n  }\n  return result;\n}\n\nleveldb_iterator_t* leveldb_create_iterator(\n    leveldb_t* db,\n    const leveldb_readoptions_t* options) {\n  leveldb_iterator_t* result = new leveldb_iterator_t;\n  result->rep = db->rep->NewIterator(options->rep);\n  return result;\n}\n\nconst leveldb_snapshot_t* leveldb_create_snapshot(\n    leveldb_t* db) {\n  leveldb_snapshot_t* result = new leveldb_snapshot_t;\n  result->rep = db->rep->GetSnapshot();\n  return result;\n}\n\nvoid leveldb_release_snapshot(\n    leveldb_t* db,\n    const leveldb_snapshot_t* snapshot) {\n  db->rep->ReleaseSnapshot(snapshot->rep);\n  delete snapshot;\n}\n\nchar* leveldb_property_value(\n    leveldb_t* db,\n    const char* propname) {\n  std::string tmp;\n  if (db->rep->GetProperty(Slice(propname), &tmp)) {\n    // We use strdup() since we expect human readable output.\n    return strdup(tmp.c_str());\n  } else {\n    return NULL;\n  }\n}\n\nvoid leveldb_approximate_sizes(\n    leveldb_t* db,\n    int num_ranges,\n    const char* const* range_start_key, const size_t* range_start_key_len,\n    const char* const* range_limit_key, const size_t* range_limit_key_len,\n    uint64_t* sizes) {\n  Range* ranges = new Range[num_ranges];\n  for (int i = 0; i < num_ranges; i++) {\n    ranges[i].start = Slice(range_start_key[i], range_start_key_len[i]);\n    ranges[i].limit = Slice(range_limit_key[i], range_limit_key_len[i]);\n  }\n  db->rep->GetApproximateSizes(ranges, num_ranges, sizes);\n  delete[] ranges;\n}\n\nvoid leveldb_compact_range(\n    leveldb_t* db,\n    const char* start_key, size_t start_key_len,\n    const char* limit_key, size_t limit_key_len) {\n  Slice a, b;\n  db->rep->CompactRange(\n      // Pass NULL Slice if corresponding \"const char*\" is NULL\n      (start_key ? (a = Slice(start_key, start_key_len), &a) : NULL),\n      (limit_key ? (b = Slice(limit_key, limit_key_len), &b) : NULL));\n}\n\nvoid leveldb_destroy_db(\n    const leveldb_options_t* options,\n    const char* name,\n    char** errptr) {\n  SaveError(errptr, DestroyDB(name, options->rep));\n}\n\nvoid leveldb_repair_db(\n    const leveldb_options_t* options,\n    const char* name,\n    char** errptr) {\n  SaveError(errptr, RepairDB(name, options->rep));\n}\n\nvoid leveldb_iter_destroy(leveldb_iterator_t* iter) {\n  delete iter->rep;\n  delete iter;\n}\n\nunsigned char leveldb_iter_valid(const leveldb_iterator_t* iter) {\n  return iter->rep->Valid();\n}\n\nvoid leveldb_iter_seek_to_first(leveldb_iterator_t* iter) {\n  iter->rep->SeekToFirst();\n}\n\nvoid leveldb_iter_seek_to_last(leveldb_iterator_t* iter) {\n  iter->rep->SeekToLast();\n}\n\nvoid leveldb_iter_seek(leveldb_iterator_t* iter, const char* k, size_t klen) {\n  iter->rep->Seek(Slice(k, klen));\n}\n\nvoid leveldb_iter_next(leveldb_iterator_t* iter) {\n  iter->rep->Next();\n}\n\nvoid leveldb_iter_prev(leveldb_iterator_t* iter) {\n  iter->rep->Prev();\n}\n\nconst char* leveldb_iter_key(const leveldb_iterator_t* iter, size_t* klen) {\n  Slice s = iter->rep->key();\n  *klen = s.size();\n  return s.data();\n}\n\nconst char* leveldb_iter_value(const leveldb_iterator_t* iter, size_t* vlen) {\n  Slice s = iter->rep->value();\n  *vlen = s.size();\n  return s.data();\n}\n\nvoid leveldb_iter_get_error(const leveldb_iterator_t* iter, char** errptr) {\n  SaveError(errptr, iter->rep->status());\n}\n\nleveldb_writebatch_t* leveldb_writebatch_create() {\n  return new leveldb_writebatch_t;\n}\n\nvoid leveldb_writebatch_destroy(leveldb_writebatch_t* b) {\n  delete b;\n}\n\nvoid leveldb_writebatch_clear(leveldb_writebatch_t* b) {\n  b->rep.Clear();\n}\n\nvoid leveldb_writebatch_put(\n    leveldb_writebatch_t* b,\n    const char* key, size_t klen,\n    const char* val, size_t vlen) {\n  b->rep.Put(Slice(key, klen), Slice(val, vlen));\n}\n\nvoid leveldb_writebatch_delete(\n    leveldb_writebatch_t* b,\n    const char* key, size_t klen) {\n  b->rep.Delete(Slice(key, klen));\n}\n\nvoid leveldb_writebatch_iterate(\n    leveldb_writebatch_t* b,\n    void* state,\n    void (*put)(void*, const char* k, size_t klen, const char* v, size_t vlen),\n    void (*deleted)(void*, const char* k, size_t klen)) {\n  class H : public WriteBatch::Handler {\n   public:\n    void* state_;\n    void (*put_)(void*, const char* k, size_t klen, const char* v, size_t vlen);\n    void (*deleted_)(void*, const char* k, size_t klen);\n    virtual void Put(const Slice& key, const Slice& value) {\n      (*put_)(state_, key.data(), key.size(), value.data(), value.size());\n    }\n    virtual void Delete(const Slice& key) {\n      (*deleted_)(state_, key.data(), key.size());\n    }\n  };\n  H handler;\n  handler.state_ = state;\n  handler.put_ = put;\n  handler.deleted_ = deleted;\n  b->rep.Iterate(&handler);\n}\n\nleveldb_options_t* leveldb_options_create() {\n  return new leveldb_options_t;\n}\n\nvoid leveldb_options_destroy(leveldb_options_t* options) {\n  delete options;\n}\n\nvoid leveldb_options_set_comparator(\n    leveldb_options_t* opt,\n    leveldb_comparator_t* cmp) {\n  opt->rep.comparator = cmp;\n}\n\nvoid leveldb_options_set_filter_policy(\n    leveldb_options_t* opt,\n    leveldb_filterpolicy_t* policy) {\n  opt->rep.filter_policy = policy;\n}\n\nvoid leveldb_options_set_create_if_missing(\n    leveldb_options_t* opt, unsigned char v) {\n  opt->rep.create_if_missing = v;\n}\n\nvoid leveldb_options_set_error_if_exists(\n    leveldb_options_t* opt, unsigned char v) {\n  opt->rep.error_if_exists = v;\n}\n\nvoid leveldb_options_set_paranoid_checks(\n    leveldb_options_t* opt, unsigned char v) {\n  opt->rep.paranoid_checks = v;\n}\n\nvoid leveldb_options_set_env(leveldb_options_t* opt, leveldb_env_t* env) {\n  opt->rep.env = (env ? env->rep : NULL);\n}\n\nvoid leveldb_options_set_info_log(leveldb_options_t* opt, leveldb_logger_t* l) {\n  opt->rep.info_log = (l ? l->rep : NULL);\n}\n\nvoid leveldb_options_set_write_buffer_size(leveldb_options_t* opt, size_t s) {\n  opt->rep.write_buffer_size = s;\n}\n\nvoid leveldb_options_set_max_open_files(leveldb_options_t* opt, int n) {\n  opt->rep.max_open_files = n;\n}\n\nvoid leveldb_options_set_cache(leveldb_options_t* opt, leveldb_cache_t* c) {\n  opt->rep.block_cache = c->rep;\n}\n\nvoid leveldb_options_set_block_size(leveldb_options_t* opt, size_t s) {\n  opt->rep.block_size = s;\n}\n\nvoid leveldb_options_set_block_restart_interval(leveldb_options_t* opt, int n) {\n  opt->rep.block_restart_interval = n;\n}\n\nvoid leveldb_options_set_compression(leveldb_options_t* opt, int t) {\n  opt->rep.compression = static_cast<CompressionType>(t);\n}\n\nleveldb_comparator_t* leveldb_comparator_create(\n    void* state,\n    void (*destructor)(void*),\n    int (*compare)(\n        void*,\n        const char* a, size_t alen,\n        const char* b, size_t blen),\n    const char* (*name)(void*)) {\n  leveldb_comparator_t* result = new leveldb_comparator_t;\n  result->state_ = state;\n  result->destructor_ = destructor;\n  result->compare_ = compare;\n  result->name_ = name;\n  return result;\n}\n\nvoid leveldb_comparator_destroy(leveldb_comparator_t* cmp) {\n  delete cmp;\n}\n\nleveldb_filterpolicy_t* leveldb_filterpolicy_create(\n    void* state,\n    void (*destructor)(void*),\n    char* (*create_filter)(\n        void*,\n        const char* const* key_array, const size_t* key_length_array,\n        int num_keys,\n        size_t* filter_length),\n    unsigned char (*key_may_match)(\n        void*,\n        const char* key, size_t length,\n        const char* filter, size_t filter_length),\n    const char* (*name)(void*)) {\n  leveldb_filterpolicy_t* result = new leveldb_filterpolicy_t;\n  result->state_ = state;\n  result->destructor_ = destructor;\n  result->create_ = create_filter;\n  result->key_match_ = key_may_match;\n  result->name_ = name;\n  return result;\n}\n\nvoid leveldb_filterpolicy_destroy(leveldb_filterpolicy_t* filter) {\n  delete filter;\n}\n\nleveldb_filterpolicy_t* leveldb_filterpolicy_create_bloom(int bits_per_key) {\n  // Make a leveldb_filterpolicy_t, but override all of its methods so\n  // they delegate to a NewBloomFilterPolicy() instead of user\n  // supplied C functions.\n  struct Wrapper : public leveldb_filterpolicy_t {\n    const FilterPolicy* rep_;\n    ~Wrapper() { delete rep_; }\n    const char* Name() const { return rep_->Name(); }\n    void CreateFilter(const Slice* keys, int n, std::string* dst) const {\n      return rep_->CreateFilter(keys, n, dst);\n    }\n    bool KeyMayMatch(const Slice& key, const Slice& filter) const {\n      return rep_->KeyMayMatch(key, filter);\n    }\n    static void DoNothing(void*) { }\n  };\n  Wrapper* wrapper = new Wrapper;\n  wrapper->rep_ = NewBloomFilterPolicy(bits_per_key);\n  wrapper->state_ = NULL;\n  wrapper->destructor_ = &Wrapper::DoNothing;\n  return wrapper;\n}\n\nleveldb_readoptions_t* leveldb_readoptions_create() {\n  return new leveldb_readoptions_t;\n}\n\nvoid leveldb_readoptions_destroy(leveldb_readoptions_t* opt) {\n  delete opt;\n}\n\nvoid leveldb_readoptions_set_verify_checksums(\n    leveldb_readoptions_t* opt,\n    unsigned char v) {\n  opt->rep.verify_checksums = v;\n}\n\nvoid leveldb_readoptions_set_fill_cache(\n    leveldb_readoptions_t* opt, unsigned char v) {\n  opt->rep.fill_cache = v;\n}\n\nvoid leveldb_readoptions_set_snapshot(\n    leveldb_readoptions_t* opt,\n    const leveldb_snapshot_t* snap) {\n  opt->rep.snapshot = (snap ? snap->rep : NULL);\n}\n\nleveldb_writeoptions_t* leveldb_writeoptions_create() {\n  return new leveldb_writeoptions_t;\n}\n\nvoid leveldb_writeoptions_destroy(leveldb_writeoptions_t* opt) {\n  delete opt;\n}\n\nvoid leveldb_writeoptions_set_sync(\n    leveldb_writeoptions_t* opt, unsigned char v) {\n  opt->rep.sync = v;\n}\n\nleveldb_cache_t* leveldb_cache_create_lru(size_t capacity) {\n  leveldb_cache_t* c = new leveldb_cache_t;\n  c->rep = NewLRUCache(capacity);\n  return c;\n}\n\nvoid leveldb_cache_destroy(leveldb_cache_t* cache) {\n  delete cache->rep;\n  delete cache;\n}\n\nleveldb_env_t* leveldb_create_default_env() {\n  leveldb_env_t* result = new leveldb_env_t;\n  result->rep = Env::Default();\n  result->is_default = true;\n  return result;\n}\n\nvoid leveldb_env_destroy(leveldb_env_t* env) {\n  if (!env->is_default) delete env->rep;\n  delete env;\n}\n\nvoid leveldb_free(void* ptr) {\n  free(ptr);\n}\n\nint leveldb_major_version() {\n  return kMajorVersion;\n}\n\nint leveldb_minor_version() {\n  return kMinorVersion;\n}\n\n}  // end extern \"C\"\n"
  },
  {
    "path": "src/leveldb/db/c_test.c",
    "content": "/* Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n   Use of this source code is governed by a BSD-style license that can be\n   found in the LICENSE file. See the AUTHORS file for names of contributors. */\n\n#include \"leveldb/c.h\"\n\n#include <stddef.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/types.h>\n#include <unistd.h>\n\nconst char* phase = \"\";\nstatic char dbname[200];\n\nstatic void StartPhase(const char* name) {\n  fprintf(stderr, \"=== Test %s\\n\", name);\n  phase = name;\n}\n\nstatic const char* GetTempDir(void) {\n    const char* ret = getenv(\"TEST_TMPDIR\");\n    if (ret == NULL || ret[0] == '\\0')\n        ret = \"/tmp\";\n    return ret;\n}\n\n#define CheckNoError(err)                                               \\\n  if ((err) != NULL) {                                                  \\\n    fprintf(stderr, \"%s:%d: %s: %s\\n\", __FILE__, __LINE__, phase, (err)); \\\n    abort();                                                            \\\n  }\n\n#define CheckCondition(cond)                                            \\\n  if (!(cond)) {                                                        \\\n    fprintf(stderr, \"%s:%d: %s: %s\\n\", __FILE__, __LINE__, phase, #cond); \\\n    abort();                                                            \\\n  }\n\nstatic void CheckEqual(const char* expected, const char* v, size_t n) {\n  if (expected == NULL && v == NULL) {\n    // ok\n  } else if (expected != NULL && v != NULL && n == strlen(expected) &&\n             memcmp(expected, v, n) == 0) {\n    // ok\n    return;\n  } else {\n    fprintf(stderr, \"%s: expected '%s', got '%s'\\n\",\n            phase,\n            (expected ? expected : \"(null)\"),\n            (v ? v : \"(null\"));\n    abort();\n  }\n}\n\nstatic void Free(char** ptr) {\n  if (*ptr) {\n    free(*ptr);\n    *ptr = NULL;\n  }\n}\n\nstatic void CheckGet(\n    leveldb_t* db,\n    const leveldb_readoptions_t* options,\n    const char* key,\n    const char* expected) {\n  char* err = NULL;\n  size_t val_len;\n  char* val;\n  val = leveldb_get(db, options, key, strlen(key), &val_len, &err);\n  CheckNoError(err);\n  CheckEqual(expected, val, val_len);\n  Free(&val);\n}\n\nstatic void CheckIter(leveldb_iterator_t* iter,\n                      const char* key, const char* val) {\n  size_t len;\n  const char* str;\n  str = leveldb_iter_key(iter, &len);\n  CheckEqual(key, str, len);\n  str = leveldb_iter_value(iter, &len);\n  CheckEqual(val, str, len);\n}\n\n// Callback from leveldb_writebatch_iterate()\nstatic void CheckPut(void* ptr,\n                     const char* k, size_t klen,\n                     const char* v, size_t vlen) {\n  int* state = (int*) ptr;\n  CheckCondition(*state < 2);\n  switch (*state) {\n    case 0:\n      CheckEqual(\"bar\", k, klen);\n      CheckEqual(\"b\", v, vlen);\n      break;\n    case 1:\n      CheckEqual(\"box\", k, klen);\n      CheckEqual(\"c\", v, vlen);\n      break;\n  }\n  (*state)++;\n}\n\n// Callback from leveldb_writebatch_iterate()\nstatic void CheckDel(void* ptr, const char* k, size_t klen) {\n  int* state = (int*) ptr;\n  CheckCondition(*state == 2);\n  CheckEqual(\"bar\", k, klen);\n  (*state)++;\n}\n\nstatic void CmpDestroy(void* arg) { }\n\nstatic int CmpCompare(void* arg, const char* a, size_t alen,\n                      const char* b, size_t blen) {\n  int n = (alen < blen) ? alen : blen;\n  int r = memcmp(a, b, n);\n  if (r == 0) {\n    if (alen < blen) r = -1;\n    else if (alen > blen) r = +1;\n  }\n  return r;\n}\n\nstatic const char* CmpName(void* arg) {\n  return \"foo\";\n}\n\n// Custom filter policy\nstatic unsigned char fake_filter_result = 1;\nstatic void FilterDestroy(void* arg) { }\nstatic const char* FilterName(void* arg) {\n  return \"TestFilter\";\n}\nstatic char* FilterCreate(\n    void* arg,\n    const char* const* key_array, const size_t* key_length_array,\n    int num_keys,\n    size_t* filter_length) {\n  *filter_length = 4;\n  char* result = malloc(4);\n  memcpy(result, \"fake\", 4);\n  return result;\n}\nunsigned char FilterKeyMatch(\n    void* arg,\n    const char* key, size_t length,\n    const char* filter, size_t filter_length) {\n  CheckCondition(filter_length == 4);\n  CheckCondition(memcmp(filter, \"fake\", 4) == 0);\n  return fake_filter_result;\n}\n\nint main(int argc, char** argv) {\n  leveldb_t* db;\n  leveldb_comparator_t* cmp;\n  leveldb_cache_t* cache;\n  leveldb_env_t* env;\n  leveldb_options_t* options;\n  leveldb_readoptions_t* roptions;\n  leveldb_writeoptions_t* woptions;\n  char* err = NULL;\n  int run = -1;\n\n  CheckCondition(leveldb_major_version() >= 1);\n  CheckCondition(leveldb_minor_version() >= 1);\n\n  snprintf(dbname, sizeof(dbname),\n           \"%s/leveldb_c_test-%d\",\n           GetTempDir(),\n           ((int) geteuid()));\n\n  StartPhase(\"create_objects\");\n  cmp = leveldb_comparator_create(NULL, CmpDestroy, CmpCompare, CmpName);\n  env = leveldb_create_default_env();\n  cache = leveldb_cache_create_lru(100000);\n\n  options = leveldb_options_create();\n  leveldb_options_set_comparator(options, cmp);\n  leveldb_options_set_error_if_exists(options, 1);\n  leveldb_options_set_cache(options, cache);\n  leveldb_options_set_env(options, env);\n  leveldb_options_set_info_log(options, NULL);\n  leveldb_options_set_write_buffer_size(options, 100000);\n  leveldb_options_set_paranoid_checks(options, 1);\n  leveldb_options_set_max_open_files(options, 10);\n  leveldb_options_set_block_size(options, 1024);\n  leveldb_options_set_block_restart_interval(options, 8);\n  leveldb_options_set_compression(options, leveldb_no_compression);\n\n  roptions = leveldb_readoptions_create();\n  leveldb_readoptions_set_verify_checksums(roptions, 1);\n  leveldb_readoptions_set_fill_cache(roptions, 0);\n\n  woptions = leveldb_writeoptions_create();\n  leveldb_writeoptions_set_sync(woptions, 1);\n\n  StartPhase(\"destroy\");\n  leveldb_destroy_db(options, dbname, &err);\n  Free(&err);\n\n  StartPhase(\"open_error\");\n  db = leveldb_open(options, dbname, &err);\n  CheckCondition(err != NULL);\n  Free(&err);\n\n  StartPhase(\"leveldb_free\");\n  db = leveldb_open(options, dbname, &err);\n  CheckCondition(err != NULL);\n  leveldb_free(err);\n  err = NULL;\n\n  StartPhase(\"open\");\n  leveldb_options_set_create_if_missing(options, 1);\n  db = leveldb_open(options, dbname, &err);\n  CheckNoError(err);\n  CheckGet(db, roptions, \"foo\", NULL);\n\n  StartPhase(\"put\");\n  leveldb_put(db, woptions, \"foo\", 3, \"hello\", 5, &err);\n  CheckNoError(err);\n  CheckGet(db, roptions, \"foo\", \"hello\");\n\n  StartPhase(\"compactall\");\n  leveldb_compact_range(db, NULL, 0, NULL, 0);\n  CheckGet(db, roptions, \"foo\", \"hello\");\n\n  StartPhase(\"compactrange\");\n  leveldb_compact_range(db, \"a\", 1, \"z\", 1);\n  CheckGet(db, roptions, \"foo\", \"hello\");\n\n  StartPhase(\"writebatch\");\n  {\n    leveldb_writebatch_t* wb = leveldb_writebatch_create();\n    leveldb_writebatch_put(wb, \"foo\", 3, \"a\", 1);\n    leveldb_writebatch_clear(wb);\n    leveldb_writebatch_put(wb, \"bar\", 3, \"b\", 1);\n    leveldb_writebatch_put(wb, \"box\", 3, \"c\", 1);\n    leveldb_writebatch_delete(wb, \"bar\", 3);\n    leveldb_write(db, woptions, wb, &err);\n    CheckNoError(err);\n    CheckGet(db, roptions, \"foo\", \"hello\");\n    CheckGet(db, roptions, \"bar\", NULL);\n    CheckGet(db, roptions, \"box\", \"c\");\n    int pos = 0;\n    leveldb_writebatch_iterate(wb, &pos, CheckPut, CheckDel);\n    CheckCondition(pos == 3);\n    leveldb_writebatch_destroy(wb);\n  }\n\n  StartPhase(\"iter\");\n  {\n    leveldb_iterator_t* iter = leveldb_create_iterator(db, roptions);\n    CheckCondition(!leveldb_iter_valid(iter));\n    leveldb_iter_seek_to_first(iter);\n    CheckCondition(leveldb_iter_valid(iter));\n    CheckIter(iter, \"box\", \"c\");\n    leveldb_iter_next(iter);\n    CheckIter(iter, \"foo\", \"hello\");\n    leveldb_iter_prev(iter);\n    CheckIter(iter, \"box\", \"c\");\n    leveldb_iter_prev(iter);\n    CheckCondition(!leveldb_iter_valid(iter));\n    leveldb_iter_seek_to_last(iter);\n    CheckIter(iter, \"foo\", \"hello\");\n    leveldb_iter_seek(iter, \"b\", 1);\n    CheckIter(iter, \"box\", \"c\");\n    leveldb_iter_get_error(iter, &err);\n    CheckNoError(err);\n    leveldb_iter_destroy(iter);\n  }\n\n  StartPhase(\"approximate_sizes\");\n  {\n    int i;\n    int n = 20000;\n    char keybuf[100];\n    char valbuf[100];\n    uint64_t sizes[2];\n    const char* start[2] = { \"a\", \"k00000000000000010000\" };\n    size_t start_len[2] = { 1, 21 };\n    const char* limit[2] = { \"k00000000000000010000\", \"z\" };\n    size_t limit_len[2] = { 21, 1 };\n    leveldb_writeoptions_set_sync(woptions, 0);\n    for (i = 0; i < n; i++) {\n      snprintf(keybuf, sizeof(keybuf), \"k%020d\", i);\n      snprintf(valbuf, sizeof(valbuf), \"v%020d\", i);\n      leveldb_put(db, woptions, keybuf, strlen(keybuf), valbuf, strlen(valbuf),\n                  &err);\n      CheckNoError(err);\n    }\n    leveldb_approximate_sizes(db, 2, start, start_len, limit, limit_len, sizes);\n    CheckCondition(sizes[0] > 0);\n    CheckCondition(sizes[1] > 0);\n  }\n\n  StartPhase(\"property\");\n  {\n    char* prop = leveldb_property_value(db, \"nosuchprop\");\n    CheckCondition(prop == NULL);\n    prop = leveldb_property_value(db, \"leveldb.stats\");\n    CheckCondition(prop != NULL);\n    Free(&prop);\n  }\n\n  StartPhase(\"snapshot\");\n  {\n    const leveldb_snapshot_t* snap;\n    snap = leveldb_create_snapshot(db);\n    leveldb_delete(db, woptions, \"foo\", 3, &err);\n    CheckNoError(err);\n    leveldb_readoptions_set_snapshot(roptions, snap);\n    CheckGet(db, roptions, \"foo\", \"hello\");\n    leveldb_readoptions_set_snapshot(roptions, NULL);\n    CheckGet(db, roptions, \"foo\", NULL);\n    leveldb_release_snapshot(db, snap);\n  }\n\n  StartPhase(\"repair\");\n  {\n    leveldb_close(db);\n    leveldb_options_set_create_if_missing(options, 0);\n    leveldb_options_set_error_if_exists(options, 0);\n    leveldb_repair_db(options, dbname, &err);\n    CheckNoError(err);\n    db = leveldb_open(options, dbname, &err);\n    CheckNoError(err);\n    CheckGet(db, roptions, \"foo\", NULL);\n    CheckGet(db, roptions, \"bar\", NULL);\n    CheckGet(db, roptions, \"box\", \"c\");\n    leveldb_options_set_create_if_missing(options, 1);\n    leveldb_options_set_error_if_exists(options, 1);\n  }\n\n  StartPhase(\"filter\");\n  for (run = 0; run < 2; run++) {\n    // First run uses custom filter, second run uses bloom filter\n    CheckNoError(err);\n    leveldb_filterpolicy_t* policy;\n    if (run == 0) {\n      policy = leveldb_filterpolicy_create(\n          NULL, FilterDestroy, FilterCreate, FilterKeyMatch, FilterName);\n    } else {\n      policy = leveldb_filterpolicy_create_bloom(10);\n    }\n\n    // Create new database\n    leveldb_close(db);\n    leveldb_destroy_db(options, dbname, &err);\n    leveldb_options_set_filter_policy(options, policy);\n    db = leveldb_open(options, dbname, &err);\n    CheckNoError(err);\n    leveldb_put(db, woptions, \"foo\", 3, \"foovalue\", 8, &err);\n    CheckNoError(err);\n    leveldb_put(db, woptions, \"bar\", 3, \"barvalue\", 8, &err);\n    CheckNoError(err);\n    leveldb_compact_range(db, NULL, 0, NULL, 0);\n\n    fake_filter_result = 1;\n    CheckGet(db, roptions, \"foo\", \"foovalue\");\n    CheckGet(db, roptions, \"bar\", \"barvalue\");\n    if (phase == 0) {\n      // Must not find value when custom filter returns false\n      fake_filter_result = 0;\n      CheckGet(db, roptions, \"foo\", NULL);\n      CheckGet(db, roptions, \"bar\", NULL);\n      fake_filter_result = 1;\n\n      CheckGet(db, roptions, \"foo\", \"foovalue\");\n      CheckGet(db, roptions, \"bar\", \"barvalue\");\n    }\n    leveldb_options_set_filter_policy(options, NULL);\n    leveldb_filterpolicy_destroy(policy);\n  }\n\n  StartPhase(\"cleanup\");\n  leveldb_close(db);\n  leveldb_options_destroy(options);\n  leveldb_readoptions_destroy(roptions);\n  leveldb_writeoptions_destroy(woptions);\n  leveldb_cache_destroy(cache);\n  leveldb_comparator_destroy(cmp);\n  leveldb_env_destroy(env);\n\n  fprintf(stderr, \"PASS\\n\");\n  return 0;\n}\n"
  },
  {
    "path": "src/leveldb/db/corruption_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/db.h\"\n\n#include <errno.h>\n#include <fcntl.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n#include \"leveldb/cache.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/table.h\"\n#include \"leveldb/write_batch.h\"\n#include \"db/db_impl.h\"\n#include \"db/filename.h\"\n#include \"db/log_format.h\"\n#include \"db/version_set.h\"\n#include \"util/logging.h\"\n#include \"util/testharness.h\"\n#include \"util/testutil.h\"\n\nnamespace leveldb {\n\nstatic const int kValueSize = 1000;\n\nclass CorruptionTest {\n public:\n  test::ErrorEnv env_;\n  std::string dbname_;\n  Cache* tiny_cache_;\n  Options options_;\n  DB* db_;\n\n  CorruptionTest() {\n    tiny_cache_ = NewLRUCache(100);\n    options_.env = &env_;\n    options_.block_cache = tiny_cache_;\n    dbname_ = test::TmpDir() + \"/corruption_test\";\n    DestroyDB(dbname_, options_);\n\n    db_ = NULL;\n    options_.create_if_missing = true;\n    Reopen();\n    options_.create_if_missing = false;\n  }\n\n  ~CorruptionTest() {\n     delete db_;\n     DestroyDB(dbname_, Options());\n     delete tiny_cache_;\n  }\n\n  Status TryReopen() {\n    delete db_;\n    db_ = NULL;\n    return DB::Open(options_, dbname_, &db_);\n  }\n\n  void Reopen() {\n    ASSERT_OK(TryReopen());\n  }\n\n  void RepairDB() {\n    delete db_;\n    db_ = NULL;\n    ASSERT_OK(::leveldb::RepairDB(dbname_, options_));\n  }\n\n  void Build(int n) {\n    std::string key_space, value_space;\n    WriteBatch batch;\n    for (int i = 0; i < n; i++) {\n      //if ((i % 100) == 0) fprintf(stderr, \"@ %d of %d\\n\", i, n);\n      Slice key = Key(i, &key_space);\n      batch.Clear();\n      batch.Put(key, Value(i, &value_space));\n      WriteOptions options;\n      // Corrupt() doesn't work without this sync on windows; stat reports 0 for\n      // the file size.\n      if (i == n - 1) {\n        options.sync = true;\n      }\n      ASSERT_OK(db_->Write(options, &batch));\n    }\n  }\n\n  void Check(int min_expected, int max_expected) {\n    int next_expected = 0;\n    int missed = 0;\n    int bad_keys = 0;\n    int bad_values = 0;\n    int correct = 0;\n    std::string value_space;\n    Iterator* iter = db_->NewIterator(ReadOptions());\n    for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {\n      uint64_t key;\n      Slice in(iter->key());\n      if (in == \"\" || in == \"~\") {\n        // Ignore boundary keys.\n        continue;\n      }\n      if (!ConsumeDecimalNumber(&in, &key) ||\n          !in.empty() ||\n          key < next_expected) {\n        bad_keys++;\n        continue;\n      }\n      missed += (key - next_expected);\n      next_expected = key + 1;\n      if (iter->value() != Value(key, &value_space)) {\n        bad_values++;\n      } else {\n        correct++;\n      }\n    }\n    delete iter;\n\n    fprintf(stderr,\n            \"expected=%d..%d; got=%d; bad_keys=%d; bad_values=%d; missed=%d\\n\",\n            min_expected, max_expected, correct, bad_keys, bad_values, missed);\n    ASSERT_LE(min_expected, correct);\n    ASSERT_GE(max_expected, correct);\n  }\n\n  void Corrupt(FileType filetype, int offset, int bytes_to_corrupt) {\n    // Pick file to corrupt\n    std::vector<std::string> filenames;\n    ASSERT_OK(env_.GetChildren(dbname_, &filenames));\n    uint64_t number;\n    FileType type;\n    std::string fname;\n    int picked_number = -1;\n    for (size_t i = 0; i < filenames.size(); i++) {\n      if (ParseFileName(filenames[i], &number, &type) &&\n          type == filetype &&\n          int(number) > picked_number) {  // Pick latest file\n        fname = dbname_ + \"/\" + filenames[i];\n        picked_number = number;\n      }\n    }\n    ASSERT_TRUE(!fname.empty()) << filetype;\n\n    struct stat sbuf;\n    if (stat(fname.c_str(), &sbuf) != 0) {\n      const char* msg = strerror(errno);\n      ASSERT_TRUE(false) << fname << \": \" << msg;\n    }\n\n    if (offset < 0) {\n      // Relative to end of file; make it absolute\n      if (-offset > sbuf.st_size) {\n        offset = 0;\n      } else {\n        offset = sbuf.st_size + offset;\n      }\n    }\n    if (offset > sbuf.st_size) {\n      offset = sbuf.st_size;\n    }\n    if (offset + bytes_to_corrupt > sbuf.st_size) {\n      bytes_to_corrupt = sbuf.st_size - offset;\n    }\n\n    // Do it\n    std::string contents;\n    Status s = ReadFileToString(Env::Default(), fname, &contents);\n    ASSERT_TRUE(s.ok()) << s.ToString();\n    for (int i = 0; i < bytes_to_corrupt; i++) {\n      contents[i + offset] ^= 0x80;\n    }\n    s = WriteStringToFile(Env::Default(), contents, fname);\n    ASSERT_TRUE(s.ok()) << s.ToString();\n  }\n\n  int Property(const std::string& name) {\n    std::string property;\n    int result;\n    if (db_->GetProperty(name, &property) &&\n        sscanf(property.c_str(), \"%d\", &result) == 1) {\n      return result;\n    } else {\n      return -1;\n    }\n  }\n\n  // Return the ith key\n  Slice Key(int i, std::string* storage) {\n    char buf[100];\n    snprintf(buf, sizeof(buf), \"%016d\", i);\n    storage->assign(buf, strlen(buf));\n    return Slice(*storage);\n  }\n\n  // Return the value to associate with the specified key\n  Slice Value(int k, std::string* storage) {\n    Random r(k);\n    return test::RandomString(&r, kValueSize, storage);\n  }\n};\n\nTEST(CorruptionTest, Recovery) {\n  Build(100);\n  Check(100, 100);\n  Corrupt(kLogFile, 19, 1);      // WriteBatch tag for first record\n  Corrupt(kLogFile, log::kBlockSize + 1000, 1);  // Somewhere in second block\n  Reopen();\n\n  // The 64 records in the first two log blocks are completely lost.\n  Check(36, 36);\n}\n\nTEST(CorruptionTest, RecoverWriteError) {\n  env_.writable_file_error_ = true;\n  Status s = TryReopen();\n  ASSERT_TRUE(!s.ok());\n}\n\nTEST(CorruptionTest, NewFileErrorDuringWrite) {\n  // Do enough writing to force minor compaction\n  env_.writable_file_error_ = true;\n  const int num = 3 + (Options().write_buffer_size / kValueSize);\n  std::string value_storage;\n  Status s;\n  for (int i = 0; s.ok() && i < num; i++) {\n    WriteBatch batch;\n    batch.Put(\"a\", Value(100, &value_storage));\n    s = db_->Write(WriteOptions(), &batch);\n  }\n  ASSERT_TRUE(!s.ok());\n  ASSERT_GE(env_.num_writable_file_errors_, 1);\n  env_.writable_file_error_ = false;\n  Reopen();\n}\n\nTEST(CorruptionTest, TableFile) {\n  Build(100);\n  DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);\n  dbi->TEST_CompactMemTable();\n  dbi->TEST_CompactRange(0, NULL, NULL);\n  dbi->TEST_CompactRange(1, NULL, NULL);\n\n  Corrupt(kTableFile, 100, 1);\n  Check(90, 99);\n}\n\nTEST(CorruptionTest, TableFileRepair) {\n  options_.block_size = 2 * kValueSize;  // Limit scope of corruption\n  options_.paranoid_checks = true;\n  Reopen();\n  Build(100);\n  DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);\n  dbi->TEST_CompactMemTable();\n  dbi->TEST_CompactRange(0, NULL, NULL);\n  dbi->TEST_CompactRange(1, NULL, NULL);\n\n  Corrupt(kTableFile, 100, 1);\n  RepairDB();\n  Reopen();\n  Check(95, 99);\n}\n\nTEST(CorruptionTest, TableFileIndexData) {\n  Build(10000);  // Enough to build multiple Tables\n  DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);\n  dbi->TEST_CompactMemTable();\n\n  Corrupt(kTableFile, -2000, 500);\n  Reopen();\n  Check(5000, 9999);\n}\n\nTEST(CorruptionTest, MissingDescriptor) {\n  Build(1000);\n  RepairDB();\n  Reopen();\n  Check(1000, 1000);\n}\n\nTEST(CorruptionTest, SequenceNumberRecovery) {\n  ASSERT_OK(db_->Put(WriteOptions(), \"foo\", \"v1\"));\n  ASSERT_OK(db_->Put(WriteOptions(), \"foo\", \"v2\"));\n  ASSERT_OK(db_->Put(WriteOptions(), \"foo\", \"v3\"));\n  ASSERT_OK(db_->Put(WriteOptions(), \"foo\", \"v4\"));\n  ASSERT_OK(db_->Put(WriteOptions(), \"foo\", \"v5\"));\n  RepairDB();\n  Reopen();\n  std::string v;\n  ASSERT_OK(db_->Get(ReadOptions(), \"foo\", &v));\n  ASSERT_EQ(\"v5\", v);\n  // Write something.  If sequence number was not recovered properly,\n  // it will be hidden by an earlier write.\n  ASSERT_OK(db_->Put(WriteOptions(), \"foo\", \"v6\"));\n  ASSERT_OK(db_->Get(ReadOptions(), \"foo\", &v));\n  ASSERT_EQ(\"v6\", v);\n  Reopen();\n  ASSERT_OK(db_->Get(ReadOptions(), \"foo\", &v));\n  ASSERT_EQ(\"v6\", v);\n}\n\nTEST(CorruptionTest, CorruptedDescriptor) {\n  ASSERT_OK(db_->Put(WriteOptions(), \"foo\", \"hello\"));\n  DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);\n  dbi->TEST_CompactMemTable();\n  dbi->TEST_CompactRange(0, NULL, NULL);\n\n  Corrupt(kDescriptorFile, 0, 1000);\n  Status s = TryReopen();\n  ASSERT_TRUE(!s.ok());\n\n  RepairDB();\n  Reopen();\n  std::string v;\n  ASSERT_OK(db_->Get(ReadOptions(), \"foo\", &v));\n  ASSERT_EQ(\"hello\", v);\n}\n\nTEST(CorruptionTest, CompactionInputError) {\n  Build(10);\n  DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);\n  dbi->TEST_CompactMemTable();\n  const int last = config::kMaxMemCompactLevel;\n  ASSERT_EQ(1, Property(\"leveldb.num-files-at-level\" + NumberToString(last)));\n\n  Corrupt(kTableFile, 100, 1);\n  Check(5, 9);\n\n  // Force compactions by writing lots of values\n  Build(10000);\n  Check(10000, 10000);\n}\n\nTEST(CorruptionTest, CompactionInputErrorParanoid) {\n  options_.paranoid_checks = true;\n  options_.write_buffer_size = 512 << 10;\n  Reopen();\n  DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);\n\n  // Make multiple inputs so we need to compact.\n  for (int i = 0; i < 2; i++) {\n    Build(10);\n    dbi->TEST_CompactMemTable();\n    Corrupt(kTableFile, 100, 1);\n    env_.SleepForMicroseconds(100000);\n  }\n  dbi->CompactRange(NULL, NULL);\n\n  // Write must fail because of corrupted table\n  std::string tmp1, tmp2;\n  Status s = db_->Put(WriteOptions(), Key(5, &tmp1), Value(5, &tmp2));\n  ASSERT_TRUE(!s.ok()) << \"write did not fail in corrupted paranoid db\";\n}\n\nTEST(CorruptionTest, UnrelatedKeys) {\n  Build(10);\n  DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);\n  dbi->TEST_CompactMemTable();\n  Corrupt(kTableFile, 100, 1);\n\n  std::string tmp1, tmp2;\n  ASSERT_OK(db_->Put(WriteOptions(), Key(1000, &tmp1), Value(1000, &tmp2)));\n  std::string v;\n  ASSERT_OK(db_->Get(ReadOptions(), Key(1000, &tmp1), &v));\n  ASSERT_EQ(Value(1000, &tmp2).ToString(), v);\n  dbi->TEST_CompactMemTable();\n  ASSERT_OK(db_->Get(ReadOptions(), Key(1000, &tmp1), &v));\n  ASSERT_EQ(Value(1000, &tmp2).ToString(), v);\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/db_bench.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <sys/types.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include \"db/db_impl.h\"\n#include \"db/version_set.h\"\n#include \"leveldb/cache.h\"\n#include \"leveldb/db.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/write_batch.h\"\n#include \"port/port.h\"\n#include \"util/crc32c.h\"\n#include \"util/histogram.h\"\n#include \"util/mutexlock.h\"\n#include \"util/random.h\"\n#include \"util/testutil.h\"\n\n// Comma-separated list of operations to run in the specified order\n//   Actual benchmarks:\n//      fillseq       -- write N values in sequential key order in async mode\n//      fillrandom    -- write N values in random key order in async mode\n//      overwrite     -- overwrite N values in random key order in async mode\n//      fillsync      -- write N/100 values in random key order in sync mode\n//      fill100K      -- write N/1000 100K values in random order in async mode\n//      deleteseq     -- delete N keys in sequential order\n//      deleterandom  -- delete N keys in random order\n//      readseq       -- read N times sequentially\n//      readreverse   -- read N times in reverse order\n//      readrandom    -- read N times in random order\n//      readmissing   -- read N missing keys in random order\n//      readhot       -- read N times in random order from 1% section of DB\n//      seekrandom    -- N random seeks\n//      open          -- cost of opening a DB\n//      crc32c        -- repeated crc32c of 4K of data\n//      acquireload   -- load N*1000 times\n//   Meta operations:\n//      compact     -- Compact the entire DB\n//      stats       -- Print DB stats\n//      sstables    -- Print sstable info\n//      heapprofile -- Dump a heap profile (if supported by this port)\nstatic const char* FLAGS_benchmarks =\n    \"fillseq,\"\n    \"fillsync,\"\n    \"fillrandom,\"\n    \"overwrite,\"\n    \"readrandom,\"\n    \"readrandom,\"  // Extra run to allow previous compactions to quiesce\n    \"readseq,\"\n    \"readreverse,\"\n    \"compact,\"\n    \"readrandom,\"\n    \"readseq,\"\n    \"readreverse,\"\n    \"fill100K,\"\n    \"crc32c,\"\n    \"snappycomp,\"\n    \"snappyuncomp,\"\n    \"acquireload,\"\n    ;\n\n// Number of key/values to place in database\nstatic int FLAGS_num = 1000000;\n\n// Number of read operations to do.  If negative, do FLAGS_num reads.\nstatic int FLAGS_reads = -1;\n\n// Number of concurrent threads to run.\nstatic int FLAGS_threads = 1;\n\n// Size of each value\nstatic int FLAGS_value_size = 100;\n\n// Arrange to generate values that shrink to this fraction of\n// their original size after compression\nstatic double FLAGS_compression_ratio = 0.5;\n\n// Print histogram of operation timings\nstatic bool FLAGS_histogram = false;\n\n// Number of bytes to buffer in memtable before compacting\n// (initialized to default value by \"main\")\nstatic int FLAGS_write_buffer_size = 0;\n\n// Number of bytes written to each file.\n// (initialized to default value by \"main\")\nstatic int FLAGS_max_file_size = 0;\n\n// Approximate size of user data packed per block (before compression.\n// (initialized to default value by \"main\")\nstatic int FLAGS_block_size = 0;\n\n// Number of bytes to use as a cache of uncompressed data.\n// Negative means use default settings.\nstatic int FLAGS_cache_size = -1;\n\n// Maximum number of files to keep open at the same time (use default if == 0)\nstatic int FLAGS_open_files = 0;\n\n// Bloom filter bits per key.\n// Negative means use default settings.\nstatic int FLAGS_bloom_bits = -1;\n\n// If true, do not destroy the existing database.  If you set this\n// flag and also specify a benchmark that wants a fresh database, that\n// benchmark will fail.\nstatic bool FLAGS_use_existing_db = false;\n\n// If true, reuse existing log/MANIFEST files when re-opening a database.\nstatic bool FLAGS_reuse_logs = false;\n\n// Use the db with the following name.\nstatic const char* FLAGS_db = NULL;\n\nnamespace leveldb {\n\nnamespace {\nleveldb::Env* g_env = NULL;\n\n// Helper for quickly generating random data.\nclass RandomGenerator {\n private:\n  std::string data_;\n  int pos_;\n\n public:\n  RandomGenerator() {\n    // We use a limited amount of data over and over again and ensure\n    // that it is larger than the compression window (32KB), and also\n    // large enough to serve all typical value sizes we want to write.\n    Random rnd(301);\n    std::string piece;\n    while (data_.size() < 1048576) {\n      // Add a short fragment that is as compressible as specified\n      // by FLAGS_compression_ratio.\n      test::CompressibleString(&rnd, FLAGS_compression_ratio, 100, &piece);\n      data_.append(piece);\n    }\n    pos_ = 0;\n  }\n\n  Slice Generate(size_t len) {\n    if (pos_ + len > data_.size()) {\n      pos_ = 0;\n      assert(len < data_.size());\n    }\n    pos_ += len;\n    return Slice(data_.data() + pos_ - len, len);\n  }\n};\n\n#if defined(__linux)\nstatic Slice TrimSpace(Slice s) {\n  size_t start = 0;\n  while (start < s.size() && isspace(s[start])) {\n    start++;\n  }\n  size_t limit = s.size();\n  while (limit > start && isspace(s[limit-1])) {\n    limit--;\n  }\n  return Slice(s.data() + start, limit - start);\n}\n#endif\n\nstatic void AppendWithSpace(std::string* str, Slice msg) {\n  if (msg.empty()) return;\n  if (!str->empty()) {\n    str->push_back(' ');\n  }\n  str->append(msg.data(), msg.size());\n}\n\nclass Stats {\n private:\n  double start_;\n  double finish_;\n  double seconds_;\n  int done_;\n  int next_report_;\n  int64_t bytes_;\n  double last_op_finish_;\n  Histogram hist_;\n  std::string message_;\n\n public:\n  Stats() { Start(); }\n\n  void Start() {\n    next_report_ = 100;\n    last_op_finish_ = start_;\n    hist_.Clear();\n    done_ = 0;\n    bytes_ = 0;\n    seconds_ = 0;\n    start_ = g_env->NowMicros();\n    finish_ = start_;\n    message_.clear();\n  }\n\n  void Merge(const Stats& other) {\n    hist_.Merge(other.hist_);\n    done_ += other.done_;\n    bytes_ += other.bytes_;\n    seconds_ += other.seconds_;\n    if (other.start_ < start_) start_ = other.start_;\n    if (other.finish_ > finish_) finish_ = other.finish_;\n\n    // Just keep the messages from one thread\n    if (message_.empty()) message_ = other.message_;\n  }\n\n  void Stop() {\n    finish_ = g_env->NowMicros();\n    seconds_ = (finish_ - start_) * 1e-6;\n  }\n\n  void AddMessage(Slice msg) {\n    AppendWithSpace(&message_, msg);\n  }\n\n  void FinishedSingleOp() {\n    if (FLAGS_histogram) {\n      double now = g_env->NowMicros();\n      double micros = now - last_op_finish_;\n      hist_.Add(micros);\n      if (micros > 20000) {\n        fprintf(stderr, \"long op: %.1f micros%30s\\r\", micros, \"\");\n        fflush(stderr);\n      }\n      last_op_finish_ = now;\n    }\n\n    done_++;\n    if (done_ >= next_report_) {\n      if      (next_report_ < 1000)   next_report_ += 100;\n      else if (next_report_ < 5000)   next_report_ += 500;\n      else if (next_report_ < 10000)  next_report_ += 1000;\n      else if (next_report_ < 50000)  next_report_ += 5000;\n      else if (next_report_ < 100000) next_report_ += 10000;\n      else if (next_report_ < 500000) next_report_ += 50000;\n      else                            next_report_ += 100000;\n      fprintf(stderr, \"... finished %d ops%30s\\r\", done_, \"\");\n      fflush(stderr);\n    }\n  }\n\n  void AddBytes(int64_t n) {\n    bytes_ += n;\n  }\n\n  void Report(const Slice& name) {\n    // Pretend at least one op was done in case we are running a benchmark\n    // that does not call FinishedSingleOp().\n    if (done_ < 1) done_ = 1;\n\n    std::string extra;\n    if (bytes_ > 0) {\n      // Rate is computed on actual elapsed time, not the sum of per-thread\n      // elapsed times.\n      double elapsed = (finish_ - start_) * 1e-6;\n      char rate[100];\n      snprintf(rate, sizeof(rate), \"%6.1f MB/s\",\n               (bytes_ / 1048576.0) / elapsed);\n      extra = rate;\n    }\n    AppendWithSpace(&extra, message_);\n\n    fprintf(stdout, \"%-12s : %11.3f micros/op;%s%s\\n\",\n            name.ToString().c_str(),\n            seconds_ * 1e6 / done_,\n            (extra.empty() ? \"\" : \" \"),\n            extra.c_str());\n    if (FLAGS_histogram) {\n      fprintf(stdout, \"Microseconds per op:\\n%s\\n\", hist_.ToString().c_str());\n    }\n    fflush(stdout);\n  }\n};\n\n// State shared by all concurrent executions of the same benchmark.\nstruct SharedState {\n  port::Mutex mu;\n  port::CondVar cv;\n  int total;\n\n  // Each thread goes through the following states:\n  //    (1) initializing\n  //    (2) waiting for others to be initialized\n  //    (3) running\n  //    (4) done\n\n  int num_initialized;\n  int num_done;\n  bool start;\n\n  SharedState() : cv(&mu) { }\n};\n\n// Per-thread state for concurrent executions of the same benchmark.\nstruct ThreadState {\n  int tid;             // 0..n-1 when running in n threads\n  Random rand;         // Has different seeds for different threads\n  Stats stats;\n  SharedState* shared;\n\n  ThreadState(int index)\n      : tid(index),\n        rand(1000 + index) {\n  }\n};\n\n}  // namespace\n\nclass Benchmark {\n private:\n  Cache* cache_;\n  const FilterPolicy* filter_policy_;\n  DB* db_;\n  int num_;\n  int value_size_;\n  int entries_per_batch_;\n  WriteOptions write_options_;\n  int reads_;\n  int heap_counter_;\n\n  void PrintHeader() {\n    const int kKeySize = 16;\n    PrintEnvironment();\n    fprintf(stdout, \"Keys:       %d bytes each\\n\", kKeySize);\n    fprintf(stdout, \"Values:     %d bytes each (%d bytes after compression)\\n\",\n            FLAGS_value_size,\n            static_cast<int>(FLAGS_value_size * FLAGS_compression_ratio + 0.5));\n    fprintf(stdout, \"Entries:    %d\\n\", num_);\n    fprintf(stdout, \"RawSize:    %.1f MB (estimated)\\n\",\n            ((static_cast<int64_t>(kKeySize + FLAGS_value_size) * num_)\n             / 1048576.0));\n    fprintf(stdout, \"FileSize:   %.1f MB (estimated)\\n\",\n            (((kKeySize + FLAGS_value_size * FLAGS_compression_ratio) * num_)\n             / 1048576.0));\n    PrintWarnings();\n    fprintf(stdout, \"------------------------------------------------\\n\");\n  }\n\n  void PrintWarnings() {\n#if defined(__GNUC__) && !defined(__OPTIMIZE__)\n    fprintf(stdout,\n            \"WARNING: Optimization is disabled: benchmarks unnecessarily slow\\n\"\n            );\n#endif\n#ifndef NDEBUG\n    fprintf(stdout,\n            \"WARNING: Assertions are enabled; benchmarks unnecessarily slow\\n\");\n#endif\n\n    // See if snappy is working by attempting to compress a compressible string\n    const char text[] = \"yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\";\n    std::string compressed;\n    if (!port::Snappy_Compress(text, sizeof(text), &compressed)) {\n      fprintf(stdout, \"WARNING: Snappy compression is not enabled\\n\");\n    } else if (compressed.size() >= sizeof(text)) {\n      fprintf(stdout, \"WARNING: Snappy compression is not effective\\n\");\n    }\n  }\n\n  void PrintEnvironment() {\n    fprintf(stderr, \"LevelDB:    version %d.%d\\n\",\n            kMajorVersion, kMinorVersion);\n\n#if defined(__linux)\n    time_t now = time(NULL);\n    fprintf(stderr, \"Date:       %s\", ctime(&now));  // ctime() adds newline\n\n    FILE* cpuinfo = fopen(\"/proc/cpuinfo\", \"r\");\n    if (cpuinfo != NULL) {\n      char line[1000];\n      int num_cpus = 0;\n      std::string cpu_type;\n      std::string cache_size;\n      while (fgets(line, sizeof(line), cpuinfo) != NULL) {\n        const char* sep = strchr(line, ':');\n        if (sep == NULL) {\n          continue;\n        }\n        Slice key = TrimSpace(Slice(line, sep - 1 - line));\n        Slice val = TrimSpace(Slice(sep + 1));\n        if (key == \"model name\") {\n          ++num_cpus;\n          cpu_type = val.ToString();\n        } else if (key == \"cache size\") {\n          cache_size = val.ToString();\n        }\n      }\n      fclose(cpuinfo);\n      fprintf(stderr, \"CPU:        %d * %s\\n\", num_cpus, cpu_type.c_str());\n      fprintf(stderr, \"CPUCache:   %s\\n\", cache_size.c_str());\n    }\n#endif\n  }\n\n public:\n  Benchmark()\n  : cache_(FLAGS_cache_size >= 0 ? NewLRUCache(FLAGS_cache_size) : NULL),\n    filter_policy_(FLAGS_bloom_bits >= 0\n                   ? NewBloomFilterPolicy(FLAGS_bloom_bits)\n                   : NULL),\n    db_(NULL),\n    num_(FLAGS_num),\n    value_size_(FLAGS_value_size),\n    entries_per_batch_(1),\n    reads_(FLAGS_reads < 0 ? FLAGS_num : FLAGS_reads),\n    heap_counter_(0) {\n    std::vector<std::string> files;\n    g_env->GetChildren(FLAGS_db, &files);\n    for (size_t i = 0; i < files.size(); i++) {\n      if (Slice(files[i]).starts_with(\"heap-\")) {\n        g_env->DeleteFile(std::string(FLAGS_db) + \"/\" + files[i]);\n      }\n    }\n    if (!FLAGS_use_existing_db) {\n      DestroyDB(FLAGS_db, Options());\n    }\n  }\n\n  ~Benchmark() {\n    delete db_;\n    delete cache_;\n    delete filter_policy_;\n  }\n\n  void Run() {\n    PrintHeader();\n    Open();\n\n    const char* benchmarks = FLAGS_benchmarks;\n    while (benchmarks != NULL) {\n      const char* sep = strchr(benchmarks, ',');\n      Slice name;\n      if (sep == NULL) {\n        name = benchmarks;\n        benchmarks = NULL;\n      } else {\n        name = Slice(benchmarks, sep - benchmarks);\n        benchmarks = sep + 1;\n      }\n\n      // Reset parameters that may be overridden below\n      num_ = FLAGS_num;\n      reads_ = (FLAGS_reads < 0 ? FLAGS_num : FLAGS_reads);\n      value_size_ = FLAGS_value_size;\n      entries_per_batch_ = 1;\n      write_options_ = WriteOptions();\n\n      void (Benchmark::*method)(ThreadState*) = NULL;\n      bool fresh_db = false;\n      int num_threads = FLAGS_threads;\n\n      if (name == Slice(\"open\")) {\n        method = &Benchmark::OpenBench;\n        num_ /= 10000;\n        if (num_ < 1) num_ = 1;\n      } else if (name == Slice(\"fillseq\")) {\n        fresh_db = true;\n        method = &Benchmark::WriteSeq;\n      } else if (name == Slice(\"fillbatch\")) {\n        fresh_db = true;\n        entries_per_batch_ = 1000;\n        method = &Benchmark::WriteSeq;\n      } else if (name == Slice(\"fillrandom\")) {\n        fresh_db = true;\n        method = &Benchmark::WriteRandom;\n      } else if (name == Slice(\"overwrite\")) {\n        fresh_db = false;\n        method = &Benchmark::WriteRandom;\n      } else if (name == Slice(\"fillsync\")) {\n        fresh_db = true;\n        num_ /= 1000;\n        write_options_.sync = true;\n        method = &Benchmark::WriteRandom;\n      } else if (name == Slice(\"fill100K\")) {\n        fresh_db = true;\n        num_ /= 1000;\n        value_size_ = 100 * 1000;\n        method = &Benchmark::WriteRandom;\n      } else if (name == Slice(\"readseq\")) {\n        method = &Benchmark::ReadSequential;\n      } else if (name == Slice(\"readreverse\")) {\n        method = &Benchmark::ReadReverse;\n      } else if (name == Slice(\"readrandom\")) {\n        method = &Benchmark::ReadRandom;\n      } else if (name == Slice(\"readmissing\")) {\n        method = &Benchmark::ReadMissing;\n      } else if (name == Slice(\"seekrandom\")) {\n        method = &Benchmark::SeekRandom;\n      } else if (name == Slice(\"readhot\")) {\n        method = &Benchmark::ReadHot;\n      } else if (name == Slice(\"readrandomsmall\")) {\n        reads_ /= 1000;\n        method = &Benchmark::ReadRandom;\n      } else if (name == Slice(\"deleteseq\")) {\n        method = &Benchmark::DeleteSeq;\n      } else if (name == Slice(\"deleterandom\")) {\n        method = &Benchmark::DeleteRandom;\n      } else if (name == Slice(\"readwhilewriting\")) {\n        num_threads++;  // Add extra thread for writing\n        method = &Benchmark::ReadWhileWriting;\n      } else if (name == Slice(\"compact\")) {\n        method = &Benchmark::Compact;\n      } else if (name == Slice(\"crc32c\")) {\n        method = &Benchmark::Crc32c;\n      } else if (name == Slice(\"acquireload\")) {\n        method = &Benchmark::AcquireLoad;\n      } else if (name == Slice(\"snappycomp\")) {\n        method = &Benchmark::SnappyCompress;\n      } else if (name == Slice(\"snappyuncomp\")) {\n        method = &Benchmark::SnappyUncompress;\n      } else if (name == Slice(\"heapprofile\")) {\n        HeapProfile();\n      } else if (name == Slice(\"stats\")) {\n        PrintStats(\"leveldb.stats\");\n      } else if (name == Slice(\"sstables\")) {\n        PrintStats(\"leveldb.sstables\");\n      } else {\n        if (name != Slice()) {  // No error message for empty name\n          fprintf(stderr, \"unknown benchmark '%s'\\n\", name.ToString().c_str());\n        }\n      }\n\n      if (fresh_db) {\n        if (FLAGS_use_existing_db) {\n          fprintf(stdout, \"%-12s : skipped (--use_existing_db is true)\\n\",\n                  name.ToString().c_str());\n          method = NULL;\n        } else {\n          delete db_;\n          db_ = NULL;\n          DestroyDB(FLAGS_db, Options());\n          Open();\n        }\n      }\n\n      if (method != NULL) {\n        RunBenchmark(num_threads, name, method);\n      }\n    }\n  }\n\n private:\n  struct ThreadArg {\n    Benchmark* bm;\n    SharedState* shared;\n    ThreadState* thread;\n    void (Benchmark::*method)(ThreadState*);\n  };\n\n  static void ThreadBody(void* v) {\n    ThreadArg* arg = reinterpret_cast<ThreadArg*>(v);\n    SharedState* shared = arg->shared;\n    ThreadState* thread = arg->thread;\n    {\n      MutexLock l(&shared->mu);\n      shared->num_initialized++;\n      if (shared->num_initialized >= shared->total) {\n        shared->cv.SignalAll();\n      }\n      while (!shared->start) {\n        shared->cv.Wait();\n      }\n    }\n\n    thread->stats.Start();\n    (arg->bm->*(arg->method))(thread);\n    thread->stats.Stop();\n\n    {\n      MutexLock l(&shared->mu);\n      shared->num_done++;\n      if (shared->num_done >= shared->total) {\n        shared->cv.SignalAll();\n      }\n    }\n  }\n\n  void RunBenchmark(int n, Slice name,\n                    void (Benchmark::*method)(ThreadState*)) {\n    SharedState shared;\n    shared.total = n;\n    shared.num_initialized = 0;\n    shared.num_done = 0;\n    shared.start = false;\n\n    ThreadArg* arg = new ThreadArg[n];\n    for (int i = 0; i < n; i++) {\n      arg[i].bm = this;\n      arg[i].method = method;\n      arg[i].shared = &shared;\n      arg[i].thread = new ThreadState(i);\n      arg[i].thread->shared = &shared;\n      g_env->StartThread(ThreadBody, &arg[i]);\n    }\n\n    shared.mu.Lock();\n    while (shared.num_initialized < n) {\n      shared.cv.Wait();\n    }\n\n    shared.start = true;\n    shared.cv.SignalAll();\n    while (shared.num_done < n) {\n      shared.cv.Wait();\n    }\n    shared.mu.Unlock();\n\n    for (int i = 1; i < n; i++) {\n      arg[0].thread->stats.Merge(arg[i].thread->stats);\n    }\n    arg[0].thread->stats.Report(name);\n\n    for (int i = 0; i < n; i++) {\n      delete arg[i].thread;\n    }\n    delete[] arg;\n  }\n\n  void Crc32c(ThreadState* thread) {\n    // Checksum about 500MB of data total\n    const int size = 4096;\n    const char* label = \"(4K per op)\";\n    std::string data(size, 'x');\n    int64_t bytes = 0;\n    uint32_t crc = 0;\n    while (bytes < 500 * 1048576) {\n      crc = crc32c::Value(data.data(), size);\n      thread->stats.FinishedSingleOp();\n      bytes += size;\n    }\n    // Print so result is not dead\n    fprintf(stderr, \"... crc=0x%x\\r\", static_cast<unsigned int>(crc));\n\n    thread->stats.AddBytes(bytes);\n    thread->stats.AddMessage(label);\n  }\n\n  void AcquireLoad(ThreadState* thread) {\n    int dummy;\n    port::AtomicPointer ap(&dummy);\n    int count = 0;\n    void *ptr = NULL;\n    thread->stats.AddMessage(\"(each op is 1000 loads)\");\n    while (count < 100000) {\n      for (int i = 0; i < 1000; i++) {\n        ptr = ap.Acquire_Load();\n      }\n      count++;\n      thread->stats.FinishedSingleOp();\n    }\n    if (ptr == NULL) exit(1); // Disable unused variable warning.\n  }\n\n  void SnappyCompress(ThreadState* thread) {\n    RandomGenerator gen;\n    Slice input = gen.Generate(Options().block_size);\n    int64_t bytes = 0;\n    int64_t produced = 0;\n    bool ok = true;\n    std::string compressed;\n    while (ok && bytes < 1024 * 1048576) {  // Compress 1G\n      ok = port::Snappy_Compress(input.data(), input.size(), &compressed);\n      produced += compressed.size();\n      bytes += input.size();\n      thread->stats.FinishedSingleOp();\n    }\n\n    if (!ok) {\n      thread->stats.AddMessage(\"(snappy failure)\");\n    } else {\n      char buf[100];\n      snprintf(buf, sizeof(buf), \"(output: %.1f%%)\",\n               (produced * 100.0) / bytes);\n      thread->stats.AddMessage(buf);\n      thread->stats.AddBytes(bytes);\n    }\n  }\n\n  void SnappyUncompress(ThreadState* thread) {\n    RandomGenerator gen;\n    Slice input = gen.Generate(Options().block_size);\n    std::string compressed;\n    bool ok = port::Snappy_Compress(input.data(), input.size(), &compressed);\n    int64_t bytes = 0;\n    char* uncompressed = new char[input.size()];\n    while (ok && bytes < 1024 * 1048576) {  // Compress 1G\n      ok =  port::Snappy_Uncompress(compressed.data(), compressed.size(),\n                                    uncompressed);\n      bytes += input.size();\n      thread->stats.FinishedSingleOp();\n    }\n    delete[] uncompressed;\n\n    if (!ok) {\n      thread->stats.AddMessage(\"(snappy failure)\");\n    } else {\n      thread->stats.AddBytes(bytes);\n    }\n  }\n\n  void Open() {\n    assert(db_ == NULL);\n    Options options;\n    options.env = g_env;\n    options.create_if_missing = !FLAGS_use_existing_db;\n    options.block_cache = cache_;\n    options.write_buffer_size = FLAGS_write_buffer_size;\n    options.max_file_size = FLAGS_max_file_size;\n    options.block_size = FLAGS_block_size;\n    options.max_open_files = FLAGS_open_files;\n    options.filter_policy = filter_policy_;\n    options.reuse_logs = FLAGS_reuse_logs;\n    Status s = DB::Open(options, FLAGS_db, &db_);\n    if (!s.ok()) {\n      fprintf(stderr, \"open error: %s\\n\", s.ToString().c_str());\n      exit(1);\n    }\n  }\n\n  void OpenBench(ThreadState* thread) {\n    for (int i = 0; i < num_; i++) {\n      delete db_;\n      Open();\n      thread->stats.FinishedSingleOp();\n    }\n  }\n\n  void WriteSeq(ThreadState* thread) {\n    DoWrite(thread, true);\n  }\n\n  void WriteRandom(ThreadState* thread) {\n    DoWrite(thread, false);\n  }\n\n  void DoWrite(ThreadState* thread, bool seq) {\n    if (num_ != FLAGS_num) {\n      char msg[100];\n      snprintf(msg, sizeof(msg), \"(%d ops)\", num_);\n      thread->stats.AddMessage(msg);\n    }\n\n    RandomGenerator gen;\n    WriteBatch batch;\n    Status s;\n    int64_t bytes = 0;\n    for (int i = 0; i < num_; i += entries_per_batch_) {\n      batch.Clear();\n      for (int j = 0; j < entries_per_batch_; j++) {\n        const int k = seq ? i+j : (thread->rand.Next() % FLAGS_num);\n        char key[100];\n        snprintf(key, sizeof(key), \"%016d\", k);\n        batch.Put(key, gen.Generate(value_size_));\n        bytes += value_size_ + strlen(key);\n        thread->stats.FinishedSingleOp();\n      }\n      s = db_->Write(write_options_, &batch);\n      if (!s.ok()) {\n        fprintf(stderr, \"put error: %s\\n\", s.ToString().c_str());\n        exit(1);\n      }\n    }\n    thread->stats.AddBytes(bytes);\n  }\n\n  void ReadSequential(ThreadState* thread) {\n    Iterator* iter = db_->NewIterator(ReadOptions());\n    int i = 0;\n    int64_t bytes = 0;\n    for (iter->SeekToFirst(); i < reads_ && iter->Valid(); iter->Next()) {\n      bytes += iter->key().size() + iter->value().size();\n      thread->stats.FinishedSingleOp();\n      ++i;\n    }\n    delete iter;\n    thread->stats.AddBytes(bytes);\n  }\n\n  void ReadReverse(ThreadState* thread) {\n    Iterator* iter = db_->NewIterator(ReadOptions());\n    int i = 0;\n    int64_t bytes = 0;\n    for (iter->SeekToLast(); i < reads_ && iter->Valid(); iter->Prev()) {\n      bytes += iter->key().size() + iter->value().size();\n      thread->stats.FinishedSingleOp();\n      ++i;\n    }\n    delete iter;\n    thread->stats.AddBytes(bytes);\n  }\n\n  void ReadRandom(ThreadState* thread) {\n    ReadOptions options;\n    std::string value;\n    int found = 0;\n    for (int i = 0; i < reads_; i++) {\n      char key[100];\n      const int k = thread->rand.Next() % FLAGS_num;\n      snprintf(key, sizeof(key), \"%016d\", k);\n      if (db_->Get(options, key, &value).ok()) {\n        found++;\n      }\n      thread->stats.FinishedSingleOp();\n    }\n    char msg[100];\n    snprintf(msg, sizeof(msg), \"(%d of %d found)\", found, num_);\n    thread->stats.AddMessage(msg);\n  }\n\n  void ReadMissing(ThreadState* thread) {\n    ReadOptions options;\n    std::string value;\n    for (int i = 0; i < reads_; i++) {\n      char key[100];\n      const int k = thread->rand.Next() % FLAGS_num;\n      snprintf(key, sizeof(key), \"%016d.\", k);\n      db_->Get(options, key, &value);\n      thread->stats.FinishedSingleOp();\n    }\n  }\n\n  void ReadHot(ThreadState* thread) {\n    ReadOptions options;\n    std::string value;\n    const int range = (FLAGS_num + 99) / 100;\n    for (int i = 0; i < reads_; i++) {\n      char key[100];\n      const int k = thread->rand.Next() % range;\n      snprintf(key, sizeof(key), \"%016d\", k);\n      db_->Get(options, key, &value);\n      thread->stats.FinishedSingleOp();\n    }\n  }\n\n  void SeekRandom(ThreadState* thread) {\n    ReadOptions options;\n    int found = 0;\n    for (int i = 0; i < reads_; i++) {\n      Iterator* iter = db_->NewIterator(options);\n      char key[100];\n      const int k = thread->rand.Next() % FLAGS_num;\n      snprintf(key, sizeof(key), \"%016d\", k);\n      iter->Seek(key);\n      if (iter->Valid() && iter->key() == key) found++;\n      delete iter;\n      thread->stats.FinishedSingleOp();\n    }\n    char msg[100];\n    snprintf(msg, sizeof(msg), \"(%d of %d found)\", found, num_);\n    thread->stats.AddMessage(msg);\n  }\n\n  void DoDelete(ThreadState* thread, bool seq) {\n    RandomGenerator gen;\n    WriteBatch batch;\n    Status s;\n    for (int i = 0; i < num_; i += entries_per_batch_) {\n      batch.Clear();\n      for (int j = 0; j < entries_per_batch_; j++) {\n        const int k = seq ? i+j : (thread->rand.Next() % FLAGS_num);\n        char key[100];\n        snprintf(key, sizeof(key), \"%016d\", k);\n        batch.Delete(key);\n        thread->stats.FinishedSingleOp();\n      }\n      s = db_->Write(write_options_, &batch);\n      if (!s.ok()) {\n        fprintf(stderr, \"del error: %s\\n\", s.ToString().c_str());\n        exit(1);\n      }\n    }\n  }\n\n  void DeleteSeq(ThreadState* thread) {\n    DoDelete(thread, true);\n  }\n\n  void DeleteRandom(ThreadState* thread) {\n    DoDelete(thread, false);\n  }\n\n  void ReadWhileWriting(ThreadState* thread) {\n    if (thread->tid > 0) {\n      ReadRandom(thread);\n    } else {\n      // Special thread that keeps writing until other threads are done.\n      RandomGenerator gen;\n      while (true) {\n        {\n          MutexLock l(&thread->shared->mu);\n          if (thread->shared->num_done + 1 >= thread->shared->num_initialized) {\n            // Other threads have finished\n            break;\n          }\n        }\n\n        const int k = thread->rand.Next() % FLAGS_num;\n        char key[100];\n        snprintf(key, sizeof(key), \"%016d\", k);\n        Status s = db_->Put(write_options_, key, gen.Generate(value_size_));\n        if (!s.ok()) {\n          fprintf(stderr, \"put error: %s\\n\", s.ToString().c_str());\n          exit(1);\n        }\n      }\n\n      // Do not count any of the preceding work/delay in stats.\n      thread->stats.Start();\n    }\n  }\n\n  void Compact(ThreadState* thread) {\n    db_->CompactRange(NULL, NULL);\n  }\n\n  void PrintStats(const char* key) {\n    std::string stats;\n    if (!db_->GetProperty(key, &stats)) {\n      stats = \"(failed)\";\n    }\n    fprintf(stdout, \"\\n%s\\n\", stats.c_str());\n  }\n\n  static void WriteToFile(void* arg, const char* buf, int n) {\n    reinterpret_cast<WritableFile*>(arg)->Append(Slice(buf, n));\n  }\n\n  void HeapProfile() {\n    char fname[100];\n    snprintf(fname, sizeof(fname), \"%s/heap-%04d\", FLAGS_db, ++heap_counter_);\n    WritableFile* file;\n    Status s = g_env->NewWritableFile(fname, &file);\n    if (!s.ok()) {\n      fprintf(stderr, \"%s\\n\", s.ToString().c_str());\n      return;\n    }\n    bool ok = port::GetHeapProfile(WriteToFile, file);\n    delete file;\n    if (!ok) {\n      fprintf(stderr, \"heap profiling not supported\\n\");\n      g_env->DeleteFile(fname);\n    }\n  }\n};\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  FLAGS_write_buffer_size = leveldb::Options().write_buffer_size;\n  FLAGS_max_file_size = leveldb::Options().max_file_size;\n  FLAGS_block_size = leveldb::Options().block_size;\n  FLAGS_open_files = leveldb::Options().max_open_files;\n  std::string default_db_path;\n\n  for (int i = 1; i < argc; i++) {\n    double d;\n    int n;\n    char junk;\n    if (leveldb::Slice(argv[i]).starts_with(\"--benchmarks=\")) {\n      FLAGS_benchmarks = argv[i] + strlen(\"--benchmarks=\");\n    } else if (sscanf(argv[i], \"--compression_ratio=%lf%c\", &d, &junk) == 1) {\n      FLAGS_compression_ratio = d;\n    } else if (sscanf(argv[i], \"--histogram=%d%c\", &n, &junk) == 1 &&\n               (n == 0 || n == 1)) {\n      FLAGS_histogram = n;\n    } else if (sscanf(argv[i], \"--use_existing_db=%d%c\", &n, &junk) == 1 &&\n               (n == 0 || n == 1)) {\n      FLAGS_use_existing_db = n;\n    } else if (sscanf(argv[i], \"--reuse_logs=%d%c\", &n, &junk) == 1 &&\n               (n == 0 || n == 1)) {\n      FLAGS_reuse_logs = n;\n    } else if (sscanf(argv[i], \"--num=%d%c\", &n, &junk) == 1) {\n      FLAGS_num = n;\n    } else if (sscanf(argv[i], \"--reads=%d%c\", &n, &junk) == 1) {\n      FLAGS_reads = n;\n    } else if (sscanf(argv[i], \"--threads=%d%c\", &n, &junk) == 1) {\n      FLAGS_threads = n;\n    } else if (sscanf(argv[i], \"--value_size=%d%c\", &n, &junk) == 1) {\n      FLAGS_value_size = n;\n    } else if (sscanf(argv[i], \"--write_buffer_size=%d%c\", &n, &junk) == 1) {\n      FLAGS_write_buffer_size = n;\n    } else if (sscanf(argv[i], \"--max_file_size=%d%c\", &n, &junk) == 1) {\n      FLAGS_max_file_size = n;\n    } else if (sscanf(argv[i], \"--block_size=%d%c\", &n, &junk) == 1) {\n      FLAGS_block_size = n;\n    } else if (sscanf(argv[i], \"--cache_size=%d%c\", &n, &junk) == 1) {\n      FLAGS_cache_size = n;\n    } else if (sscanf(argv[i], \"--bloom_bits=%d%c\", &n, &junk) == 1) {\n      FLAGS_bloom_bits = n;\n    } else if (sscanf(argv[i], \"--open_files=%d%c\", &n, &junk) == 1) {\n      FLAGS_open_files = n;\n    } else if (strncmp(argv[i], \"--db=\", 5) == 0) {\n      FLAGS_db = argv[i] + 5;\n    } else {\n      fprintf(stderr, \"Invalid flag '%s'\\n\", argv[i]);\n      exit(1);\n    }\n  }\n\n  leveldb::g_env = leveldb::Env::Default();\n\n  // Choose a location for the test database if none given with --db=<path>\n  if (FLAGS_db == NULL) {\n      leveldb::g_env->GetTestDirectory(&default_db_path);\n      default_db_path += \"/dbbench\";\n      FLAGS_db = default_db_path.c_str();\n  }\n\n  leveldb::Benchmark benchmark;\n  benchmark.Run();\n  return 0;\n}\n"
  },
  {
    "path": "src/leveldb/db/db_impl.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/db_impl.h\"\n\n#include <algorithm>\n#include <set>\n#include <string>\n#include <stdint.h>\n#include <stdio.h>\n#include <vector>\n#include \"db/builder.h\"\n#include \"db/db_iter.h\"\n#include \"db/dbformat.h\"\n#include \"db/filename.h\"\n#include \"db/log_reader.h\"\n#include \"db/log_writer.h\"\n#include \"db/memtable.h\"\n#include \"db/table_cache.h\"\n#include \"db/version_set.h\"\n#include \"db/write_batch_internal.h\"\n#include \"leveldb/db.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/status.h\"\n#include \"leveldb/table.h\"\n#include \"leveldb/table_builder.h\"\n#include \"port/port.h\"\n#include \"table/block.h\"\n#include \"table/merger.h\"\n#include \"table/two_level_iterator.h\"\n#include \"util/coding.h\"\n#include \"util/logging.h\"\n#include \"util/mutexlock.h\"\n\nnamespace leveldb {\n\nconst int kNumNonTableCacheFiles = 10;\n\n// Information kept for every waiting writer\nstruct DBImpl::Writer {\n  Status status;\n  WriteBatch* batch;\n  bool sync;\n  bool done;\n  port::CondVar cv;\n\n  explicit Writer(port::Mutex* mu) : cv(mu) { }\n};\n\nstruct DBImpl::CompactionState {\n  Compaction* const compaction;\n\n  // Sequence numbers < smallest_snapshot are not significant since we\n  // will never have to service a snapshot below smallest_snapshot.\n  // Therefore if we have seen a sequence number S <= smallest_snapshot,\n  // we can drop all entries for the same key with sequence numbers < S.\n  SequenceNumber smallest_snapshot;\n\n  // Files produced by compaction\n  struct Output {\n    uint64_t number;\n    uint64_t file_size;\n    InternalKey smallest, largest;\n  };\n  std::vector<Output> outputs;\n\n  // State kept for output being generated\n  WritableFile* outfile;\n  TableBuilder* builder;\n\n  uint64_t total_bytes;\n\n  Output* current_output() { return &outputs[outputs.size()-1]; }\n\n  explicit CompactionState(Compaction* c)\n      : compaction(c),\n        outfile(NULL),\n        builder(NULL),\n        total_bytes(0) {\n  }\n};\n\n// Fix user-supplied options to be reasonable\ntemplate <class T,class V>\nstatic void ClipToRange(T* ptr, V minvalue, V maxvalue) {\n  if (static_cast<V>(*ptr) > maxvalue) *ptr = maxvalue;\n  if (static_cast<V>(*ptr) < minvalue) *ptr = minvalue;\n}\nOptions SanitizeOptions(const std::string& dbname,\n                        const InternalKeyComparator* icmp,\n                        const InternalFilterPolicy* ipolicy,\n                        const Options& src) {\n  Options result = src;\n  result.comparator = icmp;\n  result.filter_policy = (src.filter_policy != NULL) ? ipolicy : NULL;\n  ClipToRange(&result.max_open_files,    64 + kNumNonTableCacheFiles, 50000);\n  ClipToRange(&result.write_buffer_size, 64<<10,                      1<<30);\n  ClipToRange(&result.max_file_size,     1<<20,                       1<<30);\n  ClipToRange(&result.block_size,        1<<10,                       4<<20);\n  if (result.info_log == NULL) {\n    // Open a log file in the same directory as the db\n    src.env->CreateDir(dbname);  // In case it does not exist\n    src.env->RenameFile(InfoLogFileName(dbname), OldInfoLogFileName(dbname));\n    Status s = src.env->NewLogger(InfoLogFileName(dbname), &result.info_log);\n    if (!s.ok()) {\n      // No place suitable for logging\n      result.info_log = NULL;\n    }\n  }\n  if (result.block_cache == NULL) {\n    result.block_cache = NewLRUCache(8 << 20);\n  }\n  return result;\n}\n\nDBImpl::DBImpl(const Options& raw_options, const std::string& dbname)\n    : env_(raw_options.env),\n      internal_comparator_(raw_options.comparator),\n      internal_filter_policy_(raw_options.filter_policy),\n      options_(SanitizeOptions(dbname, &internal_comparator_,\n                               &internal_filter_policy_, raw_options)),\n      owns_info_log_(options_.info_log != raw_options.info_log),\n      owns_cache_(options_.block_cache != raw_options.block_cache),\n      dbname_(dbname),\n      db_lock_(NULL),\n      shutting_down_(NULL),\n      bg_cv_(&mutex_),\n      mem_(NULL),\n      imm_(NULL),\n      logfile_(NULL),\n      logfile_number_(0),\n      log_(NULL),\n      seed_(0),\n      tmp_batch_(new WriteBatch),\n      bg_compaction_scheduled_(false),\n      manual_compaction_(NULL) {\n  has_imm_.Release_Store(NULL);\n\n  // Reserve ten files or so for other uses and give the rest to TableCache.\n  const int table_cache_size = options_.max_open_files - kNumNonTableCacheFiles;\n  table_cache_ = new TableCache(dbname_, &options_, table_cache_size);\n\n  versions_ = new VersionSet(dbname_, &options_, table_cache_,\n                             &internal_comparator_);\n}\n\nDBImpl::~DBImpl() {\n  // Wait for background work to finish\n  mutex_.Lock();\n  shutting_down_.Release_Store(this);  // Any non-NULL value is ok\n  while (bg_compaction_scheduled_) {\n    bg_cv_.Wait();\n  }\n  mutex_.Unlock();\n\n  if (db_lock_ != NULL) {\n    env_->UnlockFile(db_lock_);\n  }\n\n  delete versions_;\n  if (mem_ != NULL) mem_->Unref();\n  if (imm_ != NULL) imm_->Unref();\n  delete tmp_batch_;\n  delete log_;\n  delete logfile_;\n  delete table_cache_;\n\n  if (owns_info_log_) {\n    delete options_.info_log;\n  }\n  if (owns_cache_) {\n    delete options_.block_cache;\n  }\n}\n\nStatus DBImpl::NewDB() {\n  VersionEdit new_db;\n  new_db.SetComparatorName(user_comparator()->Name());\n  new_db.SetLogNumber(0);\n  new_db.SetNextFile(2);\n  new_db.SetLastSequence(0);\n\n  const std::string manifest = DescriptorFileName(dbname_, 1);\n  WritableFile* file;\n  Status s = env_->NewWritableFile(manifest, &file);\n  if (!s.ok()) {\n    return s;\n  }\n  {\n    log::Writer log(file);\n    std::string record;\n    new_db.EncodeTo(&record);\n    s = log.AddRecord(record);\n    if (s.ok()) {\n      s = file->Close();\n    }\n  }\n  delete file;\n  if (s.ok()) {\n    // Make \"CURRENT\" file that points to the new manifest file.\n    s = SetCurrentFile(env_, dbname_, 1);\n  } else {\n    env_->DeleteFile(manifest);\n  }\n  return s;\n}\n\nvoid DBImpl::MaybeIgnoreError(Status* s) const {\n  if (s->ok() || options_.paranoid_checks) {\n    // No change needed\n  } else {\n    Log(options_.info_log, \"Ignoring error %s\", s->ToString().c_str());\n    *s = Status::OK();\n  }\n}\n\nvoid DBImpl::DeleteObsoleteFiles() {\n  if (!bg_error_.ok()) {\n    // After a background error, we don't know whether a new version may\n    // or may not have been committed, so we cannot safely garbage collect.\n    return;\n  }\n\n  // Make a set of all of the live files\n  std::set<uint64_t> live = pending_outputs_;\n  versions_->AddLiveFiles(&live);\n\n  std::vector<std::string> filenames;\n  env_->GetChildren(dbname_, &filenames); // Ignoring errors on purpose\n  uint64_t number;\n  FileType type;\n  for (size_t i = 0; i < filenames.size(); i++) {\n    if (ParseFileName(filenames[i], &number, &type)) {\n      bool keep = true;\n      switch (type) {\n        case kLogFile:\n          keep = ((number >= versions_->LogNumber()) ||\n                  (number == versions_->PrevLogNumber()));\n          break;\n        case kDescriptorFile:\n          // Keep my manifest file, and any newer incarnations'\n          // (in case there is a race that allows other incarnations)\n          keep = (number >= versions_->ManifestFileNumber());\n          break;\n        case kTableFile:\n          keep = (live.find(number) != live.end());\n          break;\n        case kTempFile:\n          // Any temp files that are currently being written to must\n          // be recorded in pending_outputs_, which is inserted into \"live\"\n          keep = (live.find(number) != live.end());\n          break;\n        case kCurrentFile:\n        case kDBLockFile:\n        case kInfoLogFile:\n          keep = true;\n          break;\n      }\n\n      if (!keep) {\n        if (type == kTableFile) {\n          table_cache_->Evict(number);\n        }\n        Log(options_.info_log, \"Delete type=%d #%lld\\n\",\n            int(type),\n            static_cast<unsigned long long>(number));\n        env_->DeleteFile(dbname_ + \"/\" + filenames[i]);\n      }\n    }\n  }\n}\n\nStatus DBImpl::Recover(VersionEdit* edit, bool *save_manifest) {\n  mutex_.AssertHeld();\n\n  // Ignore error from CreateDir since the creation of the DB is\n  // committed only when the descriptor is created, and this directory\n  // may already exist from a previous failed creation attempt.\n  env_->CreateDir(dbname_);\n  assert(db_lock_ == NULL);\n  Status s = env_->LockFile(LockFileName(dbname_), &db_lock_);\n  if (!s.ok()) {\n    return s;\n  }\n\n  if (!env_->FileExists(CurrentFileName(dbname_))) {\n    if (options_.create_if_missing) {\n      s = NewDB();\n      if (!s.ok()) {\n        return s;\n      }\n    } else {\n      return Status::InvalidArgument(\n          dbname_, \"does not exist (create_if_missing is false)\");\n    }\n  } else {\n    if (options_.error_if_exists) {\n      return Status::InvalidArgument(\n          dbname_, \"exists (error_if_exists is true)\");\n    }\n  }\n\n  s = versions_->Recover(save_manifest);\n  if (!s.ok()) {\n    return s;\n  }\n  SequenceNumber max_sequence(0);\n\n  // Recover from all newer log files than the ones named in the\n  // descriptor (new log files may have been added by the previous\n  // incarnation without registering them in the descriptor).\n  //\n  // Note that PrevLogNumber() is no longer used, but we pay\n  // attention to it in case we are recovering a database\n  // produced by an older version of leveldb.\n  const uint64_t min_log = versions_->LogNumber();\n  const uint64_t prev_log = versions_->PrevLogNumber();\n  std::vector<std::string> filenames;\n  s = env_->GetChildren(dbname_, &filenames);\n  if (!s.ok()) {\n    return s;\n  }\n  std::set<uint64_t> expected;\n  versions_->AddLiveFiles(&expected);\n  uint64_t number;\n  FileType type;\n  std::vector<uint64_t> logs;\n  for (size_t i = 0; i < filenames.size(); i++) {\n    if (ParseFileName(filenames[i], &number, &type)) {\n      expected.erase(number);\n      if (type == kLogFile && ((number >= min_log) || (number == prev_log)))\n        logs.push_back(number);\n    }\n  }\n  if (!expected.empty()) {\n    char buf[50];\n    snprintf(buf, sizeof(buf), \"%d missing files; e.g.\",\n             static_cast<int>(expected.size()));\n    return Status::Corruption(buf, TableFileName(dbname_, *(expected.begin())));\n  }\n\n  // Recover in the order in which the logs were generated\n  std::sort(logs.begin(), logs.end());\n  for (size_t i = 0; i < logs.size(); i++) {\n    s = RecoverLogFile(logs[i], (i == logs.size() - 1), save_manifest, edit,\n                       &max_sequence);\n    if (!s.ok()) {\n      return s;\n    }\n\n    // The previous incarnation may not have written any MANIFEST\n    // records after allocating this log number.  So we manually\n    // update the file number allocation counter in VersionSet.\n    versions_->MarkFileNumberUsed(logs[i]);\n  }\n\n  if (versions_->LastSequence() < max_sequence) {\n    versions_->SetLastSequence(max_sequence);\n  }\n\n  return Status::OK();\n}\n\nStatus DBImpl::RecoverLogFile(uint64_t log_number, bool last_log,\n                              bool* save_manifest, VersionEdit* edit,\n                              SequenceNumber* max_sequence) {\n  struct LogReporter : public log::Reader::Reporter {\n    Env* env;\n    Logger* info_log;\n    const char* fname;\n    Status* status;  // NULL if options_.paranoid_checks==false\n    virtual void Corruption(size_t bytes, const Status& s) {\n      Log(info_log, \"%s%s: dropping %d bytes; %s\",\n          (this->status == NULL ? \"(ignoring error) \" : \"\"),\n          fname, static_cast<int>(bytes), s.ToString().c_str());\n      if (this->status != NULL && this->status->ok()) *this->status = s;\n    }\n  };\n\n  mutex_.AssertHeld();\n\n  // Open the log file\n  std::string fname = LogFileName(dbname_, log_number);\n  SequentialFile* file;\n  Status status = env_->NewSequentialFile(fname, &file);\n  if (!status.ok()) {\n    MaybeIgnoreError(&status);\n    return status;\n  }\n\n  // Create the log reader.\n  LogReporter reporter;\n  reporter.env = env_;\n  reporter.info_log = options_.info_log;\n  reporter.fname = fname.c_str();\n  reporter.status = (options_.paranoid_checks ? &status : NULL);\n  // We intentionally make log::Reader do checksumming even if\n  // paranoid_checks==false so that corruptions cause entire commits\n  // to be skipped instead of propagating bad information (like overly\n  // large sequence numbers).\n  log::Reader reader(file, &reporter, true/*checksum*/,\n                     0/*initial_offset*/);\n  Log(options_.info_log, \"Recovering log #%llu\",\n      (unsigned long long) log_number);\n\n  // Read all the records and add to a memtable\n  std::string scratch;\n  Slice record;\n  WriteBatch batch;\n  int compactions = 0;\n  MemTable* mem = NULL;\n  while (reader.ReadRecord(&record, &scratch) &&\n         status.ok()) {\n    if (record.size() < 12) {\n      reporter.Corruption(\n          record.size(), Status::Corruption(\"log record too small\", fname));\n      continue;\n    }\n    WriteBatchInternal::SetContents(&batch, record);\n\n    if (mem == NULL) {\n      mem = new MemTable(internal_comparator_);\n      mem->Ref();\n    }\n    status = WriteBatchInternal::InsertInto(&batch, mem);\n    MaybeIgnoreError(&status);\n    if (!status.ok()) {\n      break;\n    }\n    const SequenceNumber last_seq =\n        WriteBatchInternal::Sequence(&batch) +\n        WriteBatchInternal::Count(&batch) - 1;\n    if (last_seq > *max_sequence) {\n      *max_sequence = last_seq;\n    }\n\n    if (mem->ApproximateMemoryUsage() > options_.write_buffer_size) {\n      compactions++;\n      *save_manifest = true;\n      status = WriteLevel0Table(mem, edit, NULL);\n      mem->Unref();\n      mem = NULL;\n      if (!status.ok()) {\n        // Reflect errors immediately so that conditions like full\n        // file-systems cause the DB::Open() to fail.\n        break;\n      }\n    }\n  }\n\n  delete file;\n\n  // See if we should keep reusing the last log file.\n  if (status.ok() && options_.reuse_logs && last_log && compactions == 0) {\n    assert(logfile_ == NULL);\n    assert(log_ == NULL);\n    assert(mem_ == NULL);\n    uint64_t lfile_size;\n    if (env_->GetFileSize(fname, &lfile_size).ok() &&\n        env_->NewAppendableFile(fname, &logfile_).ok()) {\n      Log(options_.info_log, \"Reusing old log %s \\n\", fname.c_str());\n      log_ = new log::Writer(logfile_, lfile_size);\n      logfile_number_ = log_number;\n      if (mem != NULL) {\n        mem_ = mem;\n        mem = NULL;\n      } else {\n        // mem can be NULL if lognum exists but was empty.\n        mem_ = new MemTable(internal_comparator_);\n        mem_->Ref();\n      }\n    }\n  }\n\n  if (mem != NULL) {\n    // mem did not get reused; compact it.\n    if (status.ok()) {\n      *save_manifest = true;\n      status = WriteLevel0Table(mem, edit, NULL);\n    }\n    mem->Unref();\n  }\n\n  return status;\n}\n\nStatus DBImpl::WriteLevel0Table(MemTable* mem, VersionEdit* edit,\n                                Version* base) {\n  mutex_.AssertHeld();\n  const uint64_t start_micros = env_->NowMicros();\n  FileMetaData meta;\n  meta.number = versions_->NewFileNumber();\n  pending_outputs_.insert(meta.number);\n  Iterator* iter = mem->NewIterator();\n  Log(options_.info_log, \"Level-0 table #%llu: started\",\n      (unsigned long long) meta.number);\n\n  Status s;\n  {\n    mutex_.Unlock();\n    s = BuildTable(dbname_, env_, options_, table_cache_, iter, &meta);\n    mutex_.Lock();\n  }\n\n  Log(options_.info_log, \"Level-0 table #%llu: %lld bytes %s\",\n      (unsigned long long) meta.number,\n      (unsigned long long) meta.file_size,\n      s.ToString().c_str());\n  delete iter;\n  pending_outputs_.erase(meta.number);\n\n\n  // Note that if file_size is zero, the file has been deleted and\n  // should not be added to the manifest.\n  int level = 0;\n  if (s.ok() && meta.file_size > 0) {\n    const Slice min_user_key = meta.smallest.user_key();\n    const Slice max_user_key = meta.largest.user_key();\n    if (base != NULL) {\n      level = base->PickLevelForMemTableOutput(min_user_key, max_user_key);\n    }\n    edit->AddFile(level, meta.number, meta.file_size,\n                  meta.smallest, meta.largest);\n  }\n\n  CompactionStats stats;\n  stats.micros = env_->NowMicros() - start_micros;\n  stats.bytes_written = meta.file_size;\n  stats_[level].Add(stats);\n  return s;\n}\n\nvoid DBImpl::CompactMemTable() {\n  mutex_.AssertHeld();\n  assert(imm_ != NULL);\n\n  // Save the contents of the memtable as a new Table\n  VersionEdit edit;\n  Version* base = versions_->current();\n  base->Ref();\n  Status s = WriteLevel0Table(imm_, &edit, base);\n  base->Unref();\n\n  if (s.ok() && shutting_down_.Acquire_Load()) {\n    s = Status::IOError(\"Deleting DB during memtable compaction\");\n  }\n\n  // Replace immutable memtable with the generated Table\n  if (s.ok()) {\n    edit.SetPrevLogNumber(0);\n    edit.SetLogNumber(logfile_number_);  // Earlier logs no longer needed\n    s = versions_->LogAndApply(&edit, &mutex_);\n  }\n\n  if (s.ok()) {\n    // Commit to the new state\n    imm_->Unref();\n    imm_ = NULL;\n    has_imm_.Release_Store(NULL);\n    DeleteObsoleteFiles();\n  } else {\n    RecordBackgroundError(s);\n  }\n}\n\nvoid DBImpl::CompactRange(const Slice* begin, const Slice* end) {\n  int max_level_with_files = 1;\n  {\n    MutexLock l(&mutex_);\n    Version* base = versions_->current();\n    for (int level = 1; level < config::kNumLevels; level++) {\n      if (base->OverlapInLevel(level, begin, end)) {\n        max_level_with_files = level;\n      }\n    }\n  }\n  TEST_CompactMemTable(); // TODO(sanjay): Skip if memtable does not overlap\n  for (int level = 0; level < max_level_with_files; level++) {\n    TEST_CompactRange(level, begin, end);\n  }\n}\n\nvoid DBImpl::TEST_CompactRange(int level, const Slice* begin,const Slice* end) {\n  assert(level >= 0);\n  assert(level + 1 < config::kNumLevels);\n\n  InternalKey begin_storage, end_storage;\n\n  ManualCompaction manual;\n  manual.level = level;\n  manual.done = false;\n  if (begin == NULL) {\n    manual.begin = NULL;\n  } else {\n    begin_storage = InternalKey(*begin, kMaxSequenceNumber, kValueTypeForSeek);\n    manual.begin = &begin_storage;\n  }\n  if (end == NULL) {\n    manual.end = NULL;\n  } else {\n    end_storage = InternalKey(*end, 0, static_cast<ValueType>(0));\n    manual.end = &end_storage;\n  }\n\n  MutexLock l(&mutex_);\n  while (!manual.done && !shutting_down_.Acquire_Load() && bg_error_.ok()) {\n    if (manual_compaction_ == NULL) {  // Idle\n      manual_compaction_ = &manual;\n      MaybeScheduleCompaction();\n    } else {  // Running either my compaction or another compaction.\n      bg_cv_.Wait();\n    }\n  }\n  if (manual_compaction_ == &manual) {\n    // Cancel my manual compaction since we aborted early for some reason.\n    manual_compaction_ = NULL;\n  }\n}\n\nStatus DBImpl::TEST_CompactMemTable() {\n  // NULL batch means just wait for earlier writes to be done\n  Status s = Write(WriteOptions(), NULL);\n  if (s.ok()) {\n    // Wait until the compaction completes\n    MutexLock l(&mutex_);\n    while (imm_ != NULL && bg_error_.ok()) {\n      bg_cv_.Wait();\n    }\n    if (imm_ != NULL) {\n      s = bg_error_;\n    }\n  }\n  return s;\n}\n\nvoid DBImpl::RecordBackgroundError(const Status& s) {\n  mutex_.AssertHeld();\n  if (bg_error_.ok()) {\n    bg_error_ = s;\n    bg_cv_.SignalAll();\n  }\n}\n\nvoid DBImpl::MaybeScheduleCompaction() {\n  mutex_.AssertHeld();\n  if (bg_compaction_scheduled_) {\n    // Already scheduled\n  } else if (shutting_down_.Acquire_Load()) {\n    // DB is being deleted; no more background compactions\n  } else if (!bg_error_.ok()) {\n    // Already got an error; no more changes\n  } else if (imm_ == NULL &&\n             manual_compaction_ == NULL &&\n             !versions_->NeedsCompaction()) {\n    // No work to be done\n  } else {\n    bg_compaction_scheduled_ = true;\n    env_->Schedule(&DBImpl::BGWork, this);\n  }\n}\n\nvoid DBImpl::BGWork(void* db) {\n  reinterpret_cast<DBImpl*>(db)->BackgroundCall();\n}\n\nvoid DBImpl::BackgroundCall() {\n  MutexLock l(&mutex_);\n  assert(bg_compaction_scheduled_);\n  if (shutting_down_.Acquire_Load()) {\n    // No more background work when shutting down.\n  } else if (!bg_error_.ok()) {\n    // No more background work after a background error.\n  } else {\n    BackgroundCompaction();\n  }\n\n  bg_compaction_scheduled_ = false;\n\n  // Previous compaction may have produced too many files in a level,\n  // so reschedule another compaction if needed.\n  MaybeScheduleCompaction();\n  bg_cv_.SignalAll();\n}\n\nvoid DBImpl::BackgroundCompaction() {\n  mutex_.AssertHeld();\n\n  if (imm_ != NULL) {\n    CompactMemTable();\n    return;\n  }\n\n  Compaction* c;\n  bool is_manual = (manual_compaction_ != NULL);\n  InternalKey manual_end;\n  if (is_manual) {\n    ManualCompaction* m = manual_compaction_;\n    c = versions_->CompactRange(m->level, m->begin, m->end);\n    m->done = (c == NULL);\n    if (c != NULL) {\n      manual_end = c->input(0, c->num_input_files(0) - 1)->largest;\n    }\n    Log(options_.info_log,\n        \"Manual compaction at level-%d from %s .. %s; will stop at %s\\n\",\n        m->level,\n        (m->begin ? m->begin->DebugString().c_str() : \"(begin)\"),\n        (m->end ? m->end->DebugString().c_str() : \"(end)\"),\n        (m->done ? \"(end)\" : manual_end.DebugString().c_str()));\n  } else {\n    c = versions_->PickCompaction();\n  }\n\n  Status status;\n  if (c == NULL) {\n    // Nothing to do\n  } else if (!is_manual && c->IsTrivialMove()) {\n    // Move file to next level\n    assert(c->num_input_files(0) == 1);\n    FileMetaData* f = c->input(0, 0);\n    c->edit()->DeleteFile(c->level(), f->number);\n    c->edit()->AddFile(c->level() + 1, f->number, f->file_size,\n                       f->smallest, f->largest);\n    status = versions_->LogAndApply(c->edit(), &mutex_);\n    if (!status.ok()) {\n      RecordBackgroundError(status);\n    }\n    VersionSet::LevelSummaryStorage tmp;\n    Log(options_.info_log, \"Moved #%lld to level-%d %lld bytes %s: %s\\n\",\n        static_cast<unsigned long long>(f->number),\n        c->level() + 1,\n        static_cast<unsigned long long>(f->file_size),\n        status.ToString().c_str(),\n        versions_->LevelSummary(&tmp));\n  } else {\n    CompactionState* compact = new CompactionState(c);\n    status = DoCompactionWork(compact);\n    if (!status.ok()) {\n      RecordBackgroundError(status);\n    }\n    CleanupCompaction(compact);\n    c->ReleaseInputs();\n    DeleteObsoleteFiles();\n  }\n  delete c;\n\n  if (status.ok()) {\n    // Done\n  } else if (shutting_down_.Acquire_Load()) {\n    // Ignore compaction errors found during shutting down\n  } else {\n    Log(options_.info_log,\n        \"Compaction error: %s\", status.ToString().c_str());\n  }\n\n  if (is_manual) {\n    ManualCompaction* m = manual_compaction_;\n    if (!status.ok()) {\n      m->done = true;\n    }\n    if (!m->done) {\n      // We only compacted part of the requested range.  Update *m\n      // to the range that is left to be compacted.\n      m->tmp_storage = manual_end;\n      m->begin = &m->tmp_storage;\n    }\n    manual_compaction_ = NULL;\n  }\n}\n\nvoid DBImpl::CleanupCompaction(CompactionState* compact) {\n  mutex_.AssertHeld();\n  if (compact->builder != NULL) {\n    // May happen if we get a shutdown call in the middle of compaction\n    compact->builder->Abandon();\n    delete compact->builder;\n  } else {\n    assert(compact->outfile == NULL);\n  }\n  delete compact->outfile;\n  for (size_t i = 0; i < compact->outputs.size(); i++) {\n    const CompactionState::Output& out = compact->outputs[i];\n    pending_outputs_.erase(out.number);\n  }\n  delete compact;\n}\n\nStatus DBImpl::OpenCompactionOutputFile(CompactionState* compact) {\n  assert(compact != NULL);\n  assert(compact->builder == NULL);\n  uint64_t file_number;\n  {\n    mutex_.Lock();\n    file_number = versions_->NewFileNumber();\n    pending_outputs_.insert(file_number);\n    CompactionState::Output out;\n    out.number = file_number;\n    out.smallest.Clear();\n    out.largest.Clear();\n    compact->outputs.push_back(out);\n    mutex_.Unlock();\n  }\n\n  // Make the output file\n  std::string fname = TableFileName(dbname_, file_number);\n  Status s = env_->NewWritableFile(fname, &compact->outfile);\n  if (s.ok()) {\n    compact->builder = new TableBuilder(options_, compact->outfile);\n  }\n  return s;\n}\n\nStatus DBImpl::FinishCompactionOutputFile(CompactionState* compact,\n                                          Iterator* input) {\n  assert(compact != NULL);\n  assert(compact->outfile != NULL);\n  assert(compact->builder != NULL);\n\n  const uint64_t output_number = compact->current_output()->number;\n  assert(output_number != 0);\n\n  // Check for iterator errors\n  Status s = input->status();\n  const uint64_t current_entries = compact->builder->NumEntries();\n  if (s.ok()) {\n    s = compact->builder->Finish();\n  } else {\n    compact->builder->Abandon();\n  }\n  const uint64_t current_bytes = compact->builder->FileSize();\n  compact->current_output()->file_size = current_bytes;\n  compact->total_bytes += current_bytes;\n  delete compact->builder;\n  compact->builder = NULL;\n\n  // Finish and check for file errors\n  if (s.ok()) {\n    s = compact->outfile->Sync();\n  }\n  if (s.ok()) {\n    s = compact->outfile->Close();\n  }\n  delete compact->outfile;\n  compact->outfile = NULL;\n\n  if (s.ok() && current_entries > 0) {\n    // Verify that the table is usable\n    Iterator* iter = table_cache_->NewIterator(ReadOptions(),\n                                               output_number,\n                                               current_bytes);\n    s = iter->status();\n    delete iter;\n    if (s.ok()) {\n      Log(options_.info_log,\n          \"Generated table #%llu@%d: %lld keys, %lld bytes\",\n          (unsigned long long) output_number,\n          compact->compaction->level(),\n          (unsigned long long) current_entries,\n          (unsigned long long) current_bytes);\n    }\n  }\n  return s;\n}\n\n\nStatus DBImpl::InstallCompactionResults(CompactionState* compact) {\n  mutex_.AssertHeld();\n  Log(options_.info_log,  \"Compacted %d@%d + %d@%d files => %lld bytes\",\n      compact->compaction->num_input_files(0),\n      compact->compaction->level(),\n      compact->compaction->num_input_files(1),\n      compact->compaction->level() + 1,\n      static_cast<long long>(compact->total_bytes));\n\n  // Add compaction outputs\n  compact->compaction->AddInputDeletions(compact->compaction->edit());\n  const int level = compact->compaction->level();\n  for (size_t i = 0; i < compact->outputs.size(); i++) {\n    const CompactionState::Output& out = compact->outputs[i];\n    compact->compaction->edit()->AddFile(\n        level + 1,\n        out.number, out.file_size, out.smallest, out.largest);\n  }\n  return versions_->LogAndApply(compact->compaction->edit(), &mutex_);\n}\n\nStatus DBImpl::DoCompactionWork(CompactionState* compact) {\n  const uint64_t start_micros = env_->NowMicros();\n  int64_t imm_micros = 0;  // Micros spent doing imm_ compactions\n\n  Log(options_.info_log,  \"Compacting %d@%d + %d@%d files\",\n      compact->compaction->num_input_files(0),\n      compact->compaction->level(),\n      compact->compaction->num_input_files(1),\n      compact->compaction->level() + 1);\n\n  assert(versions_->NumLevelFiles(compact->compaction->level()) > 0);\n  assert(compact->builder == NULL);\n  assert(compact->outfile == NULL);\n  if (snapshots_.empty()) {\n    compact->smallest_snapshot = versions_->LastSequence();\n  } else {\n    compact->smallest_snapshot = snapshots_.oldest()->number_;\n  }\n\n  // Release mutex while we're actually doing the compaction work\n  mutex_.Unlock();\n\n  Iterator* input = versions_->MakeInputIterator(compact->compaction);\n  input->SeekToFirst();\n  Status status;\n  ParsedInternalKey ikey;\n  std::string current_user_key;\n  bool has_current_user_key = false;\n  SequenceNumber last_sequence_for_key = kMaxSequenceNumber;\n  for (; input->Valid() && !shutting_down_.Acquire_Load(); ) {\n    // Prioritize immutable compaction work\n    if (has_imm_.NoBarrier_Load() != NULL) {\n      const uint64_t imm_start = env_->NowMicros();\n      mutex_.Lock();\n      if (imm_ != NULL) {\n        CompactMemTable();\n        bg_cv_.SignalAll();  // Wakeup MakeRoomForWrite() if necessary\n      }\n      mutex_.Unlock();\n      imm_micros += (env_->NowMicros() - imm_start);\n    }\n\n    Slice key = input->key();\n    if (compact->compaction->ShouldStopBefore(key) &&\n        compact->builder != NULL) {\n      status = FinishCompactionOutputFile(compact, input);\n      if (!status.ok()) {\n        break;\n      }\n    }\n\n    // Handle key/value, add to state, etc.\n    bool drop = false;\n    if (!ParseInternalKey(key, &ikey)) {\n      // Do not hide error keys\n      current_user_key.clear();\n      has_current_user_key = false;\n      last_sequence_for_key = kMaxSequenceNumber;\n    } else {\n      if (!has_current_user_key ||\n          user_comparator()->Compare(ikey.user_key,\n                                     Slice(current_user_key)) != 0) {\n        // First occurrence of this user key\n        current_user_key.assign(ikey.user_key.data(), ikey.user_key.size());\n        has_current_user_key = true;\n        last_sequence_for_key = kMaxSequenceNumber;\n      }\n\n      if (last_sequence_for_key <= compact->smallest_snapshot) {\n        // Hidden by an newer entry for same user key\n        drop = true;    // (A)\n      } else if (ikey.type == kTypeDeletion &&\n                 ikey.sequence <= compact->smallest_snapshot &&\n                 compact->compaction->IsBaseLevelForKey(ikey.user_key)) {\n        // For this user key:\n        // (1) there is no data in higher levels\n        // (2) data in lower levels will have larger sequence numbers\n        // (3) data in layers that are being compacted here and have\n        //     smaller sequence numbers will be dropped in the next\n        //     few iterations of this loop (by rule (A) above).\n        // Therefore this deletion marker is obsolete and can be dropped.\n        drop = true;\n      }\n\n      last_sequence_for_key = ikey.sequence;\n    }\n#if 0\n    Log(options_.info_log,\n        \"  Compact: %s, seq %d, type: %d %d, drop: %d, is_base: %d, \"\n        \"%d smallest_snapshot: %d\",\n        ikey.user_key.ToString().c_str(),\n        (int)ikey.sequence, ikey.type, kTypeValue, drop,\n        compact->compaction->IsBaseLevelForKey(ikey.user_key),\n        (int)last_sequence_for_key, (int)compact->smallest_snapshot);\n#endif\n\n    if (!drop) {\n      // Open output file if necessary\n      if (compact->builder == NULL) {\n        status = OpenCompactionOutputFile(compact);\n        if (!status.ok()) {\n          break;\n        }\n      }\n      if (compact->builder->NumEntries() == 0) {\n        compact->current_output()->smallest.DecodeFrom(key);\n      }\n      compact->current_output()->largest.DecodeFrom(key);\n      compact->builder->Add(key, input->value());\n\n      // Close output file if it is big enough\n      if (compact->builder->FileSize() >=\n          compact->compaction->MaxOutputFileSize()) {\n        status = FinishCompactionOutputFile(compact, input);\n        if (!status.ok()) {\n          break;\n        }\n      }\n    }\n\n    input->Next();\n  }\n\n  if (status.ok() && shutting_down_.Acquire_Load()) {\n    status = Status::IOError(\"Deleting DB during compaction\");\n  }\n  if (status.ok() && compact->builder != NULL) {\n    status = FinishCompactionOutputFile(compact, input);\n  }\n  if (status.ok()) {\n    status = input->status();\n  }\n  delete input;\n  input = NULL;\n\n  CompactionStats stats;\n  stats.micros = env_->NowMicros() - start_micros - imm_micros;\n  for (int which = 0; which < 2; which++) {\n    for (int i = 0; i < compact->compaction->num_input_files(which); i++) {\n      stats.bytes_read += compact->compaction->input(which, i)->file_size;\n    }\n  }\n  for (size_t i = 0; i < compact->outputs.size(); i++) {\n    stats.bytes_written += compact->outputs[i].file_size;\n  }\n\n  mutex_.Lock();\n  stats_[compact->compaction->level() + 1].Add(stats);\n\n  if (status.ok()) {\n    status = InstallCompactionResults(compact);\n  }\n  if (!status.ok()) {\n    RecordBackgroundError(status);\n  }\n  VersionSet::LevelSummaryStorage tmp;\n  Log(options_.info_log,\n      \"compacted to: %s\", versions_->LevelSummary(&tmp));\n  return status;\n}\n\nnamespace {\nstruct IterState {\n  port::Mutex* mu;\n  Version* version;\n  MemTable* mem;\n  MemTable* imm;\n};\n\nstatic void CleanupIteratorState(void* arg1, void* arg2) {\n  IterState* state = reinterpret_cast<IterState*>(arg1);\n  state->mu->Lock();\n  state->mem->Unref();\n  if (state->imm != NULL) state->imm->Unref();\n  state->version->Unref();\n  state->mu->Unlock();\n  delete state;\n}\n}  // namespace\n\nIterator* DBImpl::NewInternalIterator(const ReadOptions& options,\n                                      SequenceNumber* latest_snapshot,\n                                      uint32_t* seed) {\n  IterState* cleanup = new IterState;\n  mutex_.Lock();\n  *latest_snapshot = versions_->LastSequence();\n\n  // Collect together all needed child iterators\n  std::vector<Iterator*> list;\n  list.push_back(mem_->NewIterator());\n  mem_->Ref();\n  if (imm_ != NULL) {\n    list.push_back(imm_->NewIterator());\n    imm_->Ref();\n  }\n  versions_->current()->AddIterators(options, &list);\n  Iterator* internal_iter =\n      NewMergingIterator(&internal_comparator_, &list[0], list.size());\n  versions_->current()->Ref();\n\n  cleanup->mu = &mutex_;\n  cleanup->mem = mem_;\n  cleanup->imm = imm_;\n  cleanup->version = versions_->current();\n  internal_iter->RegisterCleanup(CleanupIteratorState, cleanup, NULL);\n\n  *seed = ++seed_;\n  mutex_.Unlock();\n  return internal_iter;\n}\n\nIterator* DBImpl::TEST_NewInternalIterator() {\n  SequenceNumber ignored;\n  uint32_t ignored_seed;\n  return NewInternalIterator(ReadOptions(), &ignored, &ignored_seed);\n}\n\nint64_t DBImpl::TEST_MaxNextLevelOverlappingBytes() {\n  MutexLock l(&mutex_);\n  return versions_->MaxNextLevelOverlappingBytes();\n}\n\nStatus DBImpl::Get(const ReadOptions& options,\n                   const Slice& key,\n                   std::string* value) {\n  Status s;\n  MutexLock l(&mutex_);\n  SequenceNumber snapshot;\n  if (options.snapshot != NULL) {\n    snapshot = reinterpret_cast<const SnapshotImpl*>(options.snapshot)->number_;\n  } else {\n    snapshot = versions_->LastSequence();\n  }\n\n  MemTable* mem = mem_;\n  MemTable* imm = imm_;\n  Version* current = versions_->current();\n  mem->Ref();\n  if (imm != NULL) imm->Ref();\n  current->Ref();\n\n  bool have_stat_update = false;\n  Version::GetStats stats;\n\n  // Unlock while reading from files and memtables\n  {\n    mutex_.Unlock();\n    // First look in the memtable, then in the immutable memtable (if any).\n    LookupKey lkey(key, snapshot);\n    if (mem->Get(lkey, value, &s)) {\n      // Done\n    } else if (imm != NULL && imm->Get(lkey, value, &s)) {\n      // Done\n    } else {\n      s = current->Get(options, lkey, value, &stats);\n      have_stat_update = true;\n    }\n    mutex_.Lock();\n  }\n\n  if (have_stat_update && current->UpdateStats(stats)) {\n    MaybeScheduleCompaction();\n  }\n  mem->Unref();\n  if (imm != NULL) imm->Unref();\n  current->Unref();\n  return s;\n}\n\nIterator* DBImpl::NewIterator(const ReadOptions& options) {\n  SequenceNumber latest_snapshot;\n  uint32_t seed;\n  Iterator* iter = NewInternalIterator(options, &latest_snapshot, &seed);\n  return NewDBIterator(\n      this, user_comparator(), iter,\n      (options.snapshot != NULL\n       ? reinterpret_cast<const SnapshotImpl*>(options.snapshot)->number_\n       : latest_snapshot),\n      seed);\n}\n\nvoid DBImpl::RecordReadSample(Slice key) {\n  MutexLock l(&mutex_);\n  if (versions_->current()->RecordReadSample(key)) {\n    MaybeScheduleCompaction();\n  }\n}\n\nconst Snapshot* DBImpl::GetSnapshot() {\n  MutexLock l(&mutex_);\n  return snapshots_.New(versions_->LastSequence());\n}\n\nvoid DBImpl::ReleaseSnapshot(const Snapshot* s) {\n  MutexLock l(&mutex_);\n  snapshots_.Delete(reinterpret_cast<const SnapshotImpl*>(s));\n}\n\n// Convenience methods\nStatus DBImpl::Put(const WriteOptions& o, const Slice& key, const Slice& val) {\n  return DB::Put(o, key, val);\n}\n\nStatus DBImpl::Delete(const WriteOptions& options, const Slice& key) {\n  return DB::Delete(options, key);\n}\n\nStatus DBImpl::Write(const WriteOptions& options, WriteBatch* my_batch) {\n  Writer w(&mutex_);\n  w.batch = my_batch;\n  w.sync = options.sync;\n  w.done = false;\n\n  MutexLock l(&mutex_);\n  writers_.push_back(&w);\n  while (!w.done && &w != writers_.front()) {\n    w.cv.Wait();\n  }\n  if (w.done) {\n    return w.status;\n  }\n\n  // May temporarily unlock and wait.\n  Status status = MakeRoomForWrite(my_batch == NULL);\n  uint64_t last_sequence = versions_->LastSequence();\n  Writer* last_writer = &w;\n  if (status.ok() && my_batch != NULL) {  // NULL batch is for compactions\n    WriteBatch* updates = BuildBatchGroup(&last_writer);\n    WriteBatchInternal::SetSequence(updates, last_sequence + 1);\n    last_sequence += WriteBatchInternal::Count(updates);\n\n    // Add to log and apply to memtable.  We can release the lock\n    // during this phase since &w is currently responsible for logging\n    // and protects against concurrent loggers and concurrent writes\n    // into mem_.\n    {\n      mutex_.Unlock();\n      status = log_->AddRecord(WriteBatchInternal::Contents(updates));\n      bool sync_error = false;\n      if (status.ok() && options.sync) {\n        status = logfile_->Sync();\n        if (!status.ok()) {\n          sync_error = true;\n        }\n      }\n      if (status.ok()) {\n        status = WriteBatchInternal::InsertInto(updates, mem_);\n      }\n      mutex_.Lock();\n      if (sync_error) {\n        // The state of the log file is indeterminate: the log record we\n        // just added may or may not show up when the DB is re-opened.\n        // So we force the DB into a mode where all future writes fail.\n        RecordBackgroundError(status);\n      }\n    }\n    if (updates == tmp_batch_) tmp_batch_->Clear();\n\n    versions_->SetLastSequence(last_sequence);\n  }\n\n  while (true) {\n    Writer* ready = writers_.front();\n    writers_.pop_front();\n    if (ready != &w) {\n      ready->status = status;\n      ready->done = true;\n      ready->cv.Signal();\n    }\n    if (ready == last_writer) break;\n  }\n\n  // Notify new head of write queue\n  if (!writers_.empty()) {\n    writers_.front()->cv.Signal();\n  }\n\n  return status;\n}\n\n// REQUIRES: Writer list must be non-empty\n// REQUIRES: First writer must have a non-NULL batch\nWriteBatch* DBImpl::BuildBatchGroup(Writer** last_writer) {\n  assert(!writers_.empty());\n  Writer* first = writers_.front();\n  WriteBatch* result = first->batch;\n  assert(result != NULL);\n\n  size_t size = WriteBatchInternal::ByteSize(first->batch);\n\n  // Allow the group to grow up to a maximum size, but if the\n  // original write is small, limit the growth so we do not slow\n  // down the small write too much.\n  size_t max_size = 1 << 20;\n  if (size <= (128<<10)) {\n    max_size = size + (128<<10);\n  }\n\n  *last_writer = first;\n  std::deque<Writer*>::iterator iter = writers_.begin();\n  ++iter;  // Advance past \"first\"\n  for (; iter != writers_.end(); ++iter) {\n    Writer* w = *iter;\n    if (w->sync && !first->sync) {\n      // Do not include a sync write into a batch handled by a non-sync write.\n      break;\n    }\n\n    if (w->batch != NULL) {\n      size += WriteBatchInternal::ByteSize(w->batch);\n      if (size > max_size) {\n        // Do not make batch too big\n        break;\n      }\n\n      // Append to *result\n      if (result == first->batch) {\n        // Switch to temporary batch instead of disturbing caller's batch\n        result = tmp_batch_;\n        assert(WriteBatchInternal::Count(result) == 0);\n        WriteBatchInternal::Append(result, first->batch);\n      }\n      WriteBatchInternal::Append(result, w->batch);\n    }\n    *last_writer = w;\n  }\n  return result;\n}\n\n// REQUIRES: mutex_ is held\n// REQUIRES: this thread is currently at the front of the writer queue\nStatus DBImpl::MakeRoomForWrite(bool force) {\n  mutex_.AssertHeld();\n  assert(!writers_.empty());\n  bool allow_delay = !force;\n  Status s;\n  while (true) {\n    if (!bg_error_.ok()) {\n      // Yield previous error\n      s = bg_error_;\n      break;\n    } else if (\n        allow_delay &&\n        versions_->NumLevelFiles(0) >= config::kL0_SlowdownWritesTrigger) {\n      // We are getting close to hitting a hard limit on the number of\n      // L0 files.  Rather than delaying a single write by several\n      // seconds when we hit the hard limit, start delaying each\n      // individual write by 1ms to reduce latency variance.  Also,\n      // this delay hands over some CPU to the compaction thread in\n      // case it is sharing the same core as the writer.\n      mutex_.Unlock();\n      env_->SleepForMicroseconds(1000);\n      allow_delay = false;  // Do not delay a single write more than once\n      mutex_.Lock();\n    } else if (!force &&\n               (mem_->ApproximateMemoryUsage() <= options_.write_buffer_size)) {\n      // There is room in current memtable\n      break;\n    } else if (imm_ != NULL) {\n      // We have filled up the current memtable, but the previous\n      // one is still being compacted, so we wait.\n      Log(options_.info_log, \"Current memtable full; waiting...\\n\");\n      bg_cv_.Wait();\n    } else if (versions_->NumLevelFiles(0) >= config::kL0_StopWritesTrigger) {\n      // There are too many level-0 files.\n      Log(options_.info_log, \"Too many L0 files; waiting...\\n\");\n      bg_cv_.Wait();\n    } else {\n      // Attempt to switch to a new memtable and trigger compaction of old\n      assert(versions_->PrevLogNumber() == 0);\n      uint64_t new_log_number = versions_->NewFileNumber();\n      WritableFile* lfile = NULL;\n      s = env_->NewWritableFile(LogFileName(dbname_, new_log_number), &lfile);\n      if (!s.ok()) {\n        // Avoid chewing through file number space in a tight loop.\n        versions_->ReuseFileNumber(new_log_number);\n        break;\n      }\n      delete log_;\n      delete logfile_;\n      logfile_ = lfile;\n      logfile_number_ = new_log_number;\n      log_ = new log::Writer(lfile);\n      imm_ = mem_;\n      has_imm_.Release_Store(imm_);\n      mem_ = new MemTable(internal_comparator_);\n      mem_->Ref();\n      force = false;   // Do not force another compaction if have room\n      MaybeScheduleCompaction();\n    }\n  }\n  return s;\n}\n\nbool DBImpl::GetProperty(const Slice& property, std::string* value) {\n  value->clear();\n\n  MutexLock l(&mutex_);\n  Slice in = property;\n  Slice prefix(\"leveldb.\");\n  if (!in.starts_with(prefix)) return false;\n  in.remove_prefix(prefix.size());\n\n  if (in.starts_with(\"num-files-at-level\")) {\n    in.remove_prefix(strlen(\"num-files-at-level\"));\n    uint64_t level;\n    bool ok = ConsumeDecimalNumber(&in, &level) && in.empty();\n    if (!ok || level >= config::kNumLevels) {\n      return false;\n    } else {\n      char buf[100];\n      snprintf(buf, sizeof(buf), \"%d\",\n               versions_->NumLevelFiles(static_cast<int>(level)));\n      *value = buf;\n      return true;\n    }\n  } else if (in == \"stats\") {\n    char buf[200];\n    snprintf(buf, sizeof(buf),\n             \"                               Compactions\\n\"\n             \"Level  Files Size(MB) Time(sec) Read(MB) Write(MB)\\n\"\n             \"--------------------------------------------------\\n\"\n             );\n    value->append(buf);\n    for (int level = 0; level < config::kNumLevels; level++) {\n      int files = versions_->NumLevelFiles(level);\n      if (stats_[level].micros > 0 || files > 0) {\n        snprintf(\n            buf, sizeof(buf),\n            \"%3d %8d %8.0f %9.0f %8.0f %9.0f\\n\",\n            level,\n            files,\n            versions_->NumLevelBytes(level) / 1048576.0,\n            stats_[level].micros / 1e6,\n            stats_[level].bytes_read / 1048576.0,\n            stats_[level].bytes_written / 1048576.0);\n        value->append(buf);\n      }\n    }\n    return true;\n  } else if (in == \"sstables\") {\n    *value = versions_->current()->DebugString();\n    return true;\n  } else if (in == \"approximate-memory-usage\") {\n    size_t total_usage = options_.block_cache->TotalCharge();\n    if (mem_) {\n      total_usage += mem_->ApproximateMemoryUsage();\n    }\n    if (imm_) {\n      total_usage += imm_->ApproximateMemoryUsage();\n    }\n    char buf[50];\n    snprintf(buf, sizeof(buf), \"%llu\",\n             static_cast<unsigned long long>(total_usage));\n    value->append(buf);\n    return true;\n  }\n\n  return false;\n}\n\nvoid DBImpl::GetApproximateSizes(\n    const Range* range, int n,\n    uint64_t* sizes) {\n  // TODO(opt): better implementation\n  Version* v;\n  {\n    MutexLock l(&mutex_);\n    versions_->current()->Ref();\n    v = versions_->current();\n  }\n\n  for (int i = 0; i < n; i++) {\n    // Convert user_key into a corresponding internal key.\n    InternalKey k1(range[i].start, kMaxSequenceNumber, kValueTypeForSeek);\n    InternalKey k2(range[i].limit, kMaxSequenceNumber, kValueTypeForSeek);\n    uint64_t start = versions_->ApproximateOffsetOf(v, k1);\n    uint64_t limit = versions_->ApproximateOffsetOf(v, k2);\n    sizes[i] = (limit >= start ? limit - start : 0);\n  }\n\n  {\n    MutexLock l(&mutex_);\n    v->Unref();\n  }\n}\n\n// Default implementations of convenience methods that subclasses of DB\n// can call if they wish\nStatus DB::Put(const WriteOptions& opt, const Slice& key, const Slice& value) {\n  WriteBatch batch;\n  batch.Put(key, value);\n  return Write(opt, &batch);\n}\n\nStatus DB::Delete(const WriteOptions& opt, const Slice& key) {\n  WriteBatch batch;\n  batch.Delete(key);\n  return Write(opt, &batch);\n}\n\nDB::~DB() { }\n\nStatus DB::Open(const Options& options, const std::string& dbname,\n                DB** dbptr) {\n  *dbptr = NULL;\n\n  DBImpl* impl = new DBImpl(options, dbname);\n  impl->mutex_.Lock();\n  VersionEdit edit;\n  // Recover handles create_if_missing, error_if_exists\n  bool save_manifest = false;\n  Status s = impl->Recover(&edit, &save_manifest);\n  if (s.ok() && impl->mem_ == NULL) {\n    // Create new log and a corresponding memtable.\n    uint64_t new_log_number = impl->versions_->NewFileNumber();\n    WritableFile* lfile;\n    s = options.env->NewWritableFile(LogFileName(dbname, new_log_number),\n                                     &lfile);\n    if (s.ok()) {\n      edit.SetLogNumber(new_log_number);\n      impl->logfile_ = lfile;\n      impl->logfile_number_ = new_log_number;\n      impl->log_ = new log::Writer(lfile);\n      impl->mem_ = new MemTable(impl->internal_comparator_);\n      impl->mem_->Ref();\n    }\n  }\n  if (s.ok() && save_manifest) {\n    edit.SetPrevLogNumber(0);  // No older logs needed after recovery.\n    edit.SetLogNumber(impl->logfile_number_);\n    s = impl->versions_->LogAndApply(&edit, &impl->mutex_);\n  }\n  if (s.ok()) {\n    impl->DeleteObsoleteFiles();\n    impl->MaybeScheduleCompaction();\n  }\n  impl->mutex_.Unlock();\n  if (s.ok()) {\n    assert(impl->mem_ != NULL);\n    *dbptr = impl;\n  } else {\n    delete impl;\n  }\n  return s;\n}\n\nSnapshot::~Snapshot() {\n}\n\nStatus DestroyDB(const std::string& dbname, const Options& options) {\n  Env* env = options.env;\n  std::vector<std::string> filenames;\n  // Ignore error in case directory does not exist\n  env->GetChildren(dbname, &filenames);\n  if (filenames.empty()) {\n    return Status::OK();\n  }\n\n  FileLock* lock;\n  const std::string lockname = LockFileName(dbname);\n  Status result = env->LockFile(lockname, &lock);\n  if (result.ok()) {\n    uint64_t number;\n    FileType type;\n    for (size_t i = 0; i < filenames.size(); i++) {\n      if (ParseFileName(filenames[i], &number, &type) &&\n          type != kDBLockFile) {  // Lock file will be deleted at end\n        Status del = env->DeleteFile(dbname + \"/\" + filenames[i]);\n        if (result.ok() && !del.ok()) {\n          result = del;\n        }\n      }\n    }\n    env->UnlockFile(lock);  // Ignore error since state is already gone\n    env->DeleteFile(lockname);\n    env->DeleteDir(dbname);  // Ignore error in case dir contains other files\n  }\n  return result;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/db_impl.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_DB_IMPL_H_\n#define STORAGE_LEVELDB_DB_DB_IMPL_H_\n\n#include <deque>\n#include <set>\n#include \"db/dbformat.h\"\n#include \"db/log_writer.h\"\n#include \"db/snapshot.h\"\n#include \"leveldb/db.h\"\n#include \"leveldb/env.h\"\n#include \"port/port.h\"\n#include \"port/thread_annotations.h\"\n\nnamespace leveldb {\n\nclass MemTable;\nclass TableCache;\nclass Version;\nclass VersionEdit;\nclass VersionSet;\n\nclass DBImpl : public DB {\n public:\n  DBImpl(const Options& options, const std::string& dbname);\n  virtual ~DBImpl();\n\n  // Implementations of the DB interface\n  virtual Status Put(const WriteOptions&, const Slice& key, const Slice& value);\n  virtual Status Delete(const WriteOptions&, const Slice& key);\n  virtual Status Write(const WriteOptions& options, WriteBatch* updates);\n  virtual Status Get(const ReadOptions& options,\n                     const Slice& key,\n                     std::string* value);\n  virtual Iterator* NewIterator(const ReadOptions&);\n  virtual const Snapshot* GetSnapshot();\n  virtual void ReleaseSnapshot(const Snapshot* snapshot);\n  virtual bool GetProperty(const Slice& property, std::string* value);\n  virtual void GetApproximateSizes(const Range* range, int n, uint64_t* sizes);\n  virtual void CompactRange(const Slice* begin, const Slice* end);\n\n  // Extra methods (for testing) that are not in the public DB interface\n\n  // Compact any files in the named level that overlap [*begin,*end]\n  void TEST_CompactRange(int level, const Slice* begin, const Slice* end);\n\n  // Force current memtable contents to be compacted.\n  Status TEST_CompactMemTable();\n\n  // Return an internal iterator over the current state of the database.\n  // The keys of this iterator are internal keys (see format.h).\n  // The returned iterator should be deleted when no longer needed.\n  Iterator* TEST_NewInternalIterator();\n\n  // Return the maximum overlapping data (in bytes) at next level for any\n  // file at a level >= 1.\n  int64_t TEST_MaxNextLevelOverlappingBytes();\n\n  // Record a sample of bytes read at the specified internal key.\n  // Samples are taken approximately once every config::kReadBytesPeriod\n  // bytes.\n  void RecordReadSample(Slice key);\n\n private:\n  friend class DB;\n  struct CompactionState;\n  struct Writer;\n\n  Iterator* NewInternalIterator(const ReadOptions&,\n                                SequenceNumber* latest_snapshot,\n                                uint32_t* seed);\n\n  Status NewDB();\n\n  // Recover the descriptor from persistent storage.  May do a significant\n  // amount of work to recover recently logged updates.  Any changes to\n  // be made to the descriptor are added to *edit.\n  Status Recover(VersionEdit* edit, bool* save_manifest)\n      EXCLUSIVE_LOCKS_REQUIRED(mutex_);\n\n  void MaybeIgnoreError(Status* s) const;\n\n  // Delete any unneeded files and stale in-memory entries.\n  void DeleteObsoleteFiles();\n\n  // Compact the in-memory write buffer to disk.  Switches to a new\n  // log-file/memtable and writes a new descriptor iff successful.\n  // Errors are recorded in bg_error_.\n  void CompactMemTable() EXCLUSIVE_LOCKS_REQUIRED(mutex_);\n\n  Status RecoverLogFile(uint64_t log_number, bool last_log, bool* save_manifest,\n                        VersionEdit* edit, SequenceNumber* max_sequence)\n      EXCLUSIVE_LOCKS_REQUIRED(mutex_);\n\n  Status WriteLevel0Table(MemTable* mem, VersionEdit* edit, Version* base)\n      EXCLUSIVE_LOCKS_REQUIRED(mutex_);\n\n  Status MakeRoomForWrite(bool force /* compact even if there is room? */)\n      EXCLUSIVE_LOCKS_REQUIRED(mutex_);\n  WriteBatch* BuildBatchGroup(Writer** last_writer);\n\n  void RecordBackgroundError(const Status& s);\n\n  void MaybeScheduleCompaction() EXCLUSIVE_LOCKS_REQUIRED(mutex_);\n  static void BGWork(void* db);\n  void BackgroundCall();\n  void  BackgroundCompaction() EXCLUSIVE_LOCKS_REQUIRED(mutex_);\n  void CleanupCompaction(CompactionState* compact)\n      EXCLUSIVE_LOCKS_REQUIRED(mutex_);\n  Status DoCompactionWork(CompactionState* compact)\n      EXCLUSIVE_LOCKS_REQUIRED(mutex_);\n\n  Status OpenCompactionOutputFile(CompactionState* compact);\n  Status FinishCompactionOutputFile(CompactionState* compact, Iterator* input);\n  Status InstallCompactionResults(CompactionState* compact)\n      EXCLUSIVE_LOCKS_REQUIRED(mutex_);\n\n  // Constant after construction\n  Env* const env_;\n  const InternalKeyComparator internal_comparator_;\n  const InternalFilterPolicy internal_filter_policy_;\n  const Options options_;  // options_.comparator == &internal_comparator_\n  bool owns_info_log_;\n  bool owns_cache_;\n  const std::string dbname_;\n\n  // table_cache_ provides its own synchronization\n  TableCache* table_cache_;\n\n  // Lock over the persistent DB state.  Non-NULL iff successfully acquired.\n  FileLock* db_lock_;\n\n  // State below is protected by mutex_\n  port::Mutex mutex_;\n  port::AtomicPointer shutting_down_;\n  port::CondVar bg_cv_;          // Signalled when background work finishes\n  MemTable* mem_;\n  MemTable* imm_;                // Memtable being compacted\n  port::AtomicPointer has_imm_;  // So bg thread can detect non-NULL imm_\n  WritableFile* logfile_;\n  uint64_t logfile_number_;\n  log::Writer* log_;\n  uint32_t seed_;                // For sampling.\n\n  // Queue of writers.\n  std::deque<Writer*> writers_;\n  WriteBatch* tmp_batch_;\n\n  SnapshotList snapshots_;\n\n  // Set of table files to protect from deletion because they are\n  // part of ongoing compactions.\n  std::set<uint64_t> pending_outputs_;\n\n  // Has a background compaction been scheduled or is running?\n  bool bg_compaction_scheduled_;\n\n  // Information for a manual compaction\n  struct ManualCompaction {\n    int level;\n    bool done;\n    const InternalKey* begin;   // NULL means beginning of key range\n    const InternalKey* end;     // NULL means end of key range\n    InternalKey tmp_storage;    // Used to keep track of compaction progress\n  };\n  ManualCompaction* manual_compaction_;\n\n  VersionSet* versions_;\n\n  // Have we encountered a background error in paranoid mode?\n  Status bg_error_;\n\n  // Per level compaction stats.  stats_[level] stores the stats for\n  // compactions that produced data for the specified \"level\".\n  struct CompactionStats {\n    int64_t micros;\n    int64_t bytes_read;\n    int64_t bytes_written;\n\n    CompactionStats() : micros(0), bytes_read(0), bytes_written(0) { }\n\n    void Add(const CompactionStats& c) {\n      this->micros += c.micros;\n      this->bytes_read += c.bytes_read;\n      this->bytes_written += c.bytes_written;\n    }\n  };\n  CompactionStats stats_[config::kNumLevels];\n\n  // No copying allowed\n  DBImpl(const DBImpl&);\n  void operator=(const DBImpl&);\n\n  const Comparator* user_comparator() const {\n    return internal_comparator_.user_comparator();\n  }\n};\n\n// Sanitize db options.  The caller should delete result.info_log if\n// it is not equal to src.info_log.\nextern Options SanitizeOptions(const std::string& db,\n                               const InternalKeyComparator* icmp,\n                               const InternalFilterPolicy* ipolicy,\n                               const Options& src);\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_DB_IMPL_H_\n"
  },
  {
    "path": "src/leveldb/db/db_iter.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/db_iter.h\"\n\n#include \"db/filename.h\"\n#include \"db/db_impl.h\"\n#include \"db/dbformat.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/iterator.h\"\n#include \"port/port.h\"\n#include \"util/logging.h\"\n#include \"util/mutexlock.h\"\n#include \"util/random.h\"\n\nnamespace leveldb {\n\n#if 0\nstatic void DumpInternalIter(Iterator* iter) {\n  for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {\n    ParsedInternalKey k;\n    if (!ParseInternalKey(iter->key(), &k)) {\n      fprintf(stderr, \"Corrupt '%s'\\n\", EscapeString(iter->key()).c_str());\n    } else {\n      fprintf(stderr, \"@ '%s'\\n\", k.DebugString().c_str());\n    }\n  }\n}\n#endif\n\nnamespace {\n\n// Memtables and sstables that make the DB representation contain\n// (userkey,seq,type) => uservalue entries.  DBIter\n// combines multiple entries for the same userkey found in the DB\n// representation into a single entry while accounting for sequence\n// numbers, deletion markers, overwrites, etc.\nclass DBIter: public Iterator {\n public:\n  // Which direction is the iterator currently moving?\n  // (1) When moving forward, the internal iterator is positioned at\n  //     the exact entry that yields this->key(), this->value()\n  // (2) When moving backwards, the internal iterator is positioned\n  //     just before all entries whose user key == this->key().\n  enum Direction {\n    kForward,\n    kReverse\n  };\n\n  DBIter(DBImpl* db, const Comparator* cmp, Iterator* iter, SequenceNumber s,\n         uint32_t seed)\n      : db_(db),\n        user_comparator_(cmp),\n        iter_(iter),\n        sequence_(s),\n        direction_(kForward),\n        valid_(false),\n        rnd_(seed),\n        bytes_counter_(RandomPeriod()) {\n  }\n  virtual ~DBIter() {\n    delete iter_;\n  }\n  virtual bool Valid() const { return valid_; }\n  virtual Slice key() const {\n    assert(valid_);\n    return (direction_ == kForward) ? ExtractUserKey(iter_->key()) : saved_key_;\n  }\n  virtual Slice value() const {\n    assert(valid_);\n    return (direction_ == kForward) ? iter_->value() : saved_value_;\n  }\n  virtual Status status() const {\n    if (status_.ok()) {\n      return iter_->status();\n    } else {\n      return status_;\n    }\n  }\n\n  virtual void Next();\n  virtual void Prev();\n  virtual void Seek(const Slice& target);\n  virtual void SeekToFirst();\n  virtual void SeekToLast();\n\n private:\n  void FindNextUserEntry(bool skipping, std::string* skip);\n  void FindPrevUserEntry();\n  bool ParseKey(ParsedInternalKey* key);\n\n  inline void SaveKey(const Slice& k, std::string* dst) {\n    dst->assign(k.data(), k.size());\n  }\n\n  inline void ClearSavedValue() {\n    if (saved_value_.capacity() > 1048576) {\n      std::string empty;\n      swap(empty, saved_value_);\n    } else {\n      saved_value_.clear();\n    }\n  }\n\n  // Pick next gap with average value of config::kReadBytesPeriod.\n  ssize_t RandomPeriod() {\n    return rnd_.Uniform(2*config::kReadBytesPeriod);\n  }\n\n  DBImpl* db_;\n  const Comparator* const user_comparator_;\n  Iterator* const iter_;\n  SequenceNumber const sequence_;\n\n  Status status_;\n  std::string saved_key_;     // == current key when direction_==kReverse\n  std::string saved_value_;   // == current raw value when direction_==kReverse\n  Direction direction_;\n  bool valid_;\n\n  Random rnd_;\n  ssize_t bytes_counter_;\n\n  // No copying allowed\n  DBIter(const DBIter&);\n  void operator=(const DBIter&);\n};\n\ninline bool DBIter::ParseKey(ParsedInternalKey* ikey) {\n  Slice k = iter_->key();\n  ssize_t n = k.size() + iter_->value().size();\n  bytes_counter_ -= n;\n  while (bytes_counter_ < 0) {\n    bytes_counter_ += RandomPeriod();\n    db_->RecordReadSample(k);\n  }\n  if (!ParseInternalKey(k, ikey)) {\n    status_ = Status::Corruption(\"corrupted internal key in DBIter\");\n    return false;\n  } else {\n    return true;\n  }\n}\n\nvoid DBIter::Next() {\n  assert(valid_);\n\n  if (direction_ == kReverse) {  // Switch directions?\n    direction_ = kForward;\n    // iter_ is pointing just before the entries for this->key(),\n    // so advance into the range of entries for this->key() and then\n    // use the normal skipping code below.\n    if (!iter_->Valid()) {\n      iter_->SeekToFirst();\n    } else {\n      iter_->Next();\n    }\n    if (!iter_->Valid()) {\n      valid_ = false;\n      saved_key_.clear();\n      return;\n    }\n    // saved_key_ already contains the key to skip past.\n  } else {\n    // Store in saved_key_ the current key so we skip it below.\n    SaveKey(ExtractUserKey(iter_->key()), &saved_key_);\n  }\n\n  FindNextUserEntry(true, &saved_key_);\n}\n\nvoid DBIter::FindNextUserEntry(bool skipping, std::string* skip) {\n  // Loop until we hit an acceptable entry to yield\n  assert(iter_->Valid());\n  assert(direction_ == kForward);\n  do {\n    ParsedInternalKey ikey;\n    if (ParseKey(&ikey) && ikey.sequence <= sequence_) {\n      switch (ikey.type) {\n        case kTypeDeletion:\n          // Arrange to skip all upcoming entries for this key since\n          // they are hidden by this deletion.\n          SaveKey(ikey.user_key, skip);\n          skipping = true;\n          break;\n        case kTypeValue:\n          if (skipping &&\n              user_comparator_->Compare(ikey.user_key, *skip) <= 0) {\n            // Entry hidden\n          } else {\n            valid_ = true;\n            saved_key_.clear();\n            return;\n          }\n          break;\n      }\n    }\n    iter_->Next();\n  } while (iter_->Valid());\n  saved_key_.clear();\n  valid_ = false;\n}\n\nvoid DBIter::Prev() {\n  assert(valid_);\n\n  if (direction_ == kForward) {  // Switch directions?\n    // iter_ is pointing at the current entry.  Scan backwards until\n    // the key changes so we can use the normal reverse scanning code.\n    assert(iter_->Valid());  // Otherwise valid_ would have been false\n    SaveKey(ExtractUserKey(iter_->key()), &saved_key_);\n    while (true) {\n      iter_->Prev();\n      if (!iter_->Valid()) {\n        valid_ = false;\n        saved_key_.clear();\n        ClearSavedValue();\n        return;\n      }\n      if (user_comparator_->Compare(ExtractUserKey(iter_->key()),\n                                    saved_key_) < 0) {\n        break;\n      }\n    }\n    direction_ = kReverse;\n  }\n\n  FindPrevUserEntry();\n}\n\nvoid DBIter::FindPrevUserEntry() {\n  assert(direction_ == kReverse);\n\n  ValueType value_type = kTypeDeletion;\n  if (iter_->Valid()) {\n    do {\n      ParsedInternalKey ikey;\n      if (ParseKey(&ikey) && ikey.sequence <= sequence_) {\n        if ((value_type != kTypeDeletion) &&\n            user_comparator_->Compare(ikey.user_key, saved_key_) < 0) {\n          // We encountered a non-deleted value in entries for previous keys,\n          break;\n        }\n        value_type = ikey.type;\n        if (value_type == kTypeDeletion) {\n          saved_key_.clear();\n          ClearSavedValue();\n        } else {\n          Slice raw_value = iter_->value();\n          if (saved_value_.capacity() > raw_value.size() + 1048576) {\n            std::string empty;\n            swap(empty, saved_value_);\n          }\n          SaveKey(ExtractUserKey(iter_->key()), &saved_key_);\n          saved_value_.assign(raw_value.data(), raw_value.size());\n        }\n      }\n      iter_->Prev();\n    } while (iter_->Valid());\n  }\n\n  if (value_type == kTypeDeletion) {\n    // End\n    valid_ = false;\n    saved_key_.clear();\n    ClearSavedValue();\n    direction_ = kForward;\n  } else {\n    valid_ = true;\n  }\n}\n\nvoid DBIter::Seek(const Slice& target) {\n  direction_ = kForward;\n  ClearSavedValue();\n  saved_key_.clear();\n  AppendInternalKey(\n      &saved_key_, ParsedInternalKey(target, sequence_, kValueTypeForSeek));\n  iter_->Seek(saved_key_);\n  if (iter_->Valid()) {\n    FindNextUserEntry(false, &saved_key_ /* temporary storage */);\n  } else {\n    valid_ = false;\n  }\n}\n\nvoid DBIter::SeekToFirst() {\n  direction_ = kForward;\n  ClearSavedValue();\n  iter_->SeekToFirst();\n  if (iter_->Valid()) {\n    FindNextUserEntry(false, &saved_key_ /* temporary storage */);\n  } else {\n    valid_ = false;\n  }\n}\n\nvoid DBIter::SeekToLast() {\n  direction_ = kReverse;\n  ClearSavedValue();\n  iter_->SeekToLast();\n  FindPrevUserEntry();\n}\n\n}  // anonymous namespace\n\nIterator* NewDBIterator(\n    DBImpl* db,\n    const Comparator* user_key_comparator,\n    Iterator* internal_iter,\n    SequenceNumber sequence,\n    uint32_t seed) {\n  return new DBIter(db, user_key_comparator, internal_iter, sequence, seed);\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/db_iter.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_DB_ITER_H_\n#define STORAGE_LEVELDB_DB_DB_ITER_H_\n\n#include <stdint.h>\n#include \"leveldb/db.h\"\n#include \"db/dbformat.h\"\n\nnamespace leveldb {\n\nclass DBImpl;\n\n// Return a new iterator that converts internal keys (yielded by\n// \"*internal_iter\") that were live at the specified \"sequence\" number\n// into appropriate user keys.\nextern Iterator* NewDBIterator(\n    DBImpl* db,\n    const Comparator* user_key_comparator,\n    Iterator* internal_iter,\n    SequenceNumber sequence,\n    uint32_t seed);\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_DB_ITER_H_\n"
  },
  {
    "path": "src/leveldb/db/db_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/db.h\"\n#include \"leveldb/filter_policy.h\"\n#include \"db/db_impl.h\"\n#include \"db/filename.h\"\n#include \"db/version_set.h\"\n#include \"db/write_batch_internal.h\"\n#include \"leveldb/cache.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/table.h\"\n#include \"util/hash.h\"\n#include \"util/logging.h\"\n#include \"util/mutexlock.h\"\n#include \"util/testharness.h\"\n#include \"util/testutil.h\"\n\nnamespace leveldb {\n\nstatic std::string RandomString(Random* rnd, int len) {\n  std::string r;\n  test::RandomString(rnd, len, &r);\n  return r;\n}\n\nnamespace {\nclass AtomicCounter {\n private:\n  port::Mutex mu_;\n  int count_;\n public:\n  AtomicCounter() : count_(0) { }\n  void Increment() {\n    IncrementBy(1);\n  }\n  void IncrementBy(int count) {\n    MutexLock l(&mu_);\n    count_ += count;\n  }\n  int Read() {\n    MutexLock l(&mu_);\n    return count_;\n  }\n  void Reset() {\n    MutexLock l(&mu_);\n    count_ = 0;\n  }\n};\n\nvoid DelayMilliseconds(int millis) {\n  Env::Default()->SleepForMicroseconds(millis * 1000);\n}\n}\n\n// Special Env used to delay background operations\nclass SpecialEnv : public EnvWrapper {\n public:\n  // sstable/log Sync() calls are blocked while this pointer is non-NULL.\n  port::AtomicPointer delay_data_sync_;\n\n  // sstable/log Sync() calls return an error.\n  port::AtomicPointer data_sync_error_;\n\n  // Simulate no-space errors while this pointer is non-NULL.\n  port::AtomicPointer no_space_;\n\n  // Simulate non-writable file system while this pointer is non-NULL\n  port::AtomicPointer non_writable_;\n\n  // Force sync of manifest files to fail while this pointer is non-NULL\n  port::AtomicPointer manifest_sync_error_;\n\n  // Force write to manifest files to fail while this pointer is non-NULL\n  port::AtomicPointer manifest_write_error_;\n\n  bool count_random_reads_;\n  AtomicCounter random_read_counter_;\n\n  explicit SpecialEnv(Env* base) : EnvWrapper(base) {\n    delay_data_sync_.Release_Store(NULL);\n    data_sync_error_.Release_Store(NULL);\n    no_space_.Release_Store(NULL);\n    non_writable_.Release_Store(NULL);\n    count_random_reads_ = false;\n    manifest_sync_error_.Release_Store(NULL);\n    manifest_write_error_.Release_Store(NULL);\n  }\n\n  Status NewWritableFile(const std::string& f, WritableFile** r) {\n    class DataFile : public WritableFile {\n     private:\n      SpecialEnv* env_;\n      WritableFile* base_;\n\n     public:\n      DataFile(SpecialEnv* env, WritableFile* base)\n          : env_(env),\n            base_(base) {\n      }\n      ~DataFile() { delete base_; }\n      Status Append(const Slice& data) {\n        if (env_->no_space_.Acquire_Load() != NULL) {\n          // Drop writes on the floor\n          return Status::OK();\n        } else {\n          return base_->Append(data);\n        }\n      }\n      Status Close() { return base_->Close(); }\n      Status Flush() { return base_->Flush(); }\n      Status Sync() {\n        if (env_->data_sync_error_.Acquire_Load() != NULL) {\n          return Status::IOError(\"simulated data sync error\");\n        }\n        while (env_->delay_data_sync_.Acquire_Load() != NULL) {\n          DelayMilliseconds(100);\n        }\n        return base_->Sync();\n      }\n    };\n    class ManifestFile : public WritableFile {\n     private:\n      SpecialEnv* env_;\n      WritableFile* base_;\n     public:\n      ManifestFile(SpecialEnv* env, WritableFile* b) : env_(env), base_(b) { }\n      ~ManifestFile() { delete base_; }\n      Status Append(const Slice& data) {\n        if (env_->manifest_write_error_.Acquire_Load() != NULL) {\n          return Status::IOError(\"simulated writer error\");\n        } else {\n          return base_->Append(data);\n        }\n      }\n      Status Close() { return base_->Close(); }\n      Status Flush() { return base_->Flush(); }\n      Status Sync() {\n        if (env_->manifest_sync_error_.Acquire_Load() != NULL) {\n          return Status::IOError(\"simulated sync error\");\n        } else {\n          return base_->Sync();\n        }\n      }\n    };\n\n    if (non_writable_.Acquire_Load() != NULL) {\n      return Status::IOError(\"simulated write error\");\n    }\n\n    Status s = target()->NewWritableFile(f, r);\n    if (s.ok()) {\n      if (strstr(f.c_str(), \".ldb\") != NULL ||\n          strstr(f.c_str(), \".log\") != NULL) {\n        *r = new DataFile(this, *r);\n      } else if (strstr(f.c_str(), \"MANIFEST\") != NULL) {\n        *r = new ManifestFile(this, *r);\n      }\n    }\n    return s;\n  }\n\n  Status NewRandomAccessFile(const std::string& f, RandomAccessFile** r) {\n    class CountingFile : public RandomAccessFile {\n     private:\n      RandomAccessFile* target_;\n      AtomicCounter* counter_;\n     public:\n      CountingFile(RandomAccessFile* target, AtomicCounter* counter)\n          : target_(target), counter_(counter) {\n      }\n      virtual ~CountingFile() { delete target_; }\n      virtual Status Read(uint64_t offset, size_t n, Slice* result,\n                          char* scratch) const {\n        counter_->Increment();\n        return target_->Read(offset, n, result, scratch);\n      }\n    };\n\n    Status s = target()->NewRandomAccessFile(f, r);\n    if (s.ok() && count_random_reads_) {\n      *r = new CountingFile(*r, &random_read_counter_);\n    }\n    return s;\n  }\n};\n\nclass DBTest {\n private:\n  const FilterPolicy* filter_policy_;\n\n  // Sequence of option configurations to try\n  enum OptionConfig {\n    kDefault,\n    kReuse,\n    kFilter,\n    kUncompressed,\n    kEnd\n  };\n  int option_config_;\n\n public:\n  std::string dbname_;\n  SpecialEnv* env_;\n  DB* db_;\n\n  Options last_options_;\n\n  DBTest() : option_config_(kDefault),\n             env_(new SpecialEnv(Env::Default())) {\n    filter_policy_ = NewBloomFilterPolicy(10);\n    dbname_ = test::TmpDir() + \"/db_test\";\n    DestroyDB(dbname_, Options());\n    db_ = NULL;\n    Reopen();\n  }\n\n  ~DBTest() {\n    delete db_;\n    DestroyDB(dbname_, Options());\n    delete env_;\n    delete filter_policy_;\n  }\n\n  // Switch to a fresh database with the next option configuration to\n  // test.  Return false if there are no more configurations to test.\n  bool ChangeOptions() {\n    option_config_++;\n    if (option_config_ >= kEnd) {\n      return false;\n    } else {\n      DestroyAndReopen();\n      return true;\n    }\n  }\n\n  // Return the current option configuration.\n  Options CurrentOptions() {\n    Options options;\n    options.reuse_logs = false;\n    switch (option_config_) {\n      case kReuse:\n        options.reuse_logs = true;\n        break;\n      case kFilter:\n        options.filter_policy = filter_policy_;\n        break;\n      case kUncompressed:\n        options.compression = kNoCompression;\n        break;\n      default:\n        break;\n    }\n    return options;\n  }\n\n  DBImpl* dbfull() {\n    return reinterpret_cast<DBImpl*>(db_);\n  }\n\n  void Reopen(Options* options = NULL) {\n    ASSERT_OK(TryReopen(options));\n  }\n\n  void Close() {\n    delete db_;\n    db_ = NULL;\n  }\n\n  void DestroyAndReopen(Options* options = NULL) {\n    delete db_;\n    db_ = NULL;\n    DestroyDB(dbname_, Options());\n    ASSERT_OK(TryReopen(options));\n  }\n\n  Status TryReopen(Options* options) {\n    delete db_;\n    db_ = NULL;\n    Options opts;\n    if (options != NULL) {\n      opts = *options;\n    } else {\n      opts = CurrentOptions();\n      opts.create_if_missing = true;\n    }\n    last_options_ = opts;\n\n    return DB::Open(opts, dbname_, &db_);\n  }\n\n  Status Put(const std::string& k, const std::string& v) {\n    return db_->Put(WriteOptions(), k, v);\n  }\n\n  Status Delete(const std::string& k) {\n    return db_->Delete(WriteOptions(), k);\n  }\n\n  std::string Get(const std::string& k, const Snapshot* snapshot = NULL) {\n    ReadOptions options;\n    options.snapshot = snapshot;\n    std::string result;\n    Status s = db_->Get(options, k, &result);\n    if (s.IsNotFound()) {\n      result = \"NOT_FOUND\";\n    } else if (!s.ok()) {\n      result = s.ToString();\n    }\n    return result;\n  }\n\n  // Return a string that contains all key,value pairs in order,\n  // formatted like \"(k1->v1)(k2->v2)\".\n  std::string Contents() {\n    std::vector<std::string> forward;\n    std::string result;\n    Iterator* iter = db_->NewIterator(ReadOptions());\n    for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {\n      std::string s = IterStatus(iter);\n      result.push_back('(');\n      result.append(s);\n      result.push_back(')');\n      forward.push_back(s);\n    }\n\n    // Check reverse iteration results are the reverse of forward results\n    size_t matched = 0;\n    for (iter->SeekToLast(); iter->Valid(); iter->Prev()) {\n      ASSERT_LT(matched, forward.size());\n      ASSERT_EQ(IterStatus(iter), forward[forward.size() - matched - 1]);\n      matched++;\n    }\n    ASSERT_EQ(matched, forward.size());\n\n    delete iter;\n    return result;\n  }\n\n  std::string AllEntriesFor(const Slice& user_key) {\n    Iterator* iter = dbfull()->TEST_NewInternalIterator();\n    InternalKey target(user_key, kMaxSequenceNumber, kTypeValue);\n    iter->Seek(target.Encode());\n    std::string result;\n    if (!iter->status().ok()) {\n      result = iter->status().ToString();\n    } else {\n      result = \"[ \";\n      bool first = true;\n      while (iter->Valid()) {\n        ParsedInternalKey ikey;\n        if (!ParseInternalKey(iter->key(), &ikey)) {\n          result += \"CORRUPTED\";\n        } else {\n          if (last_options_.comparator->Compare(ikey.user_key, user_key) != 0) {\n            break;\n          }\n          if (!first) {\n            result += \", \";\n          }\n          first = false;\n          switch (ikey.type) {\n            case kTypeValue:\n              result += iter->value().ToString();\n              break;\n            case kTypeDeletion:\n              result += \"DEL\";\n              break;\n          }\n        }\n        iter->Next();\n      }\n      if (!first) {\n        result += \" \";\n      }\n      result += \"]\";\n    }\n    delete iter;\n    return result;\n  }\n\n  int NumTableFilesAtLevel(int level) {\n    std::string property;\n    ASSERT_TRUE(\n        db_->GetProperty(\"leveldb.num-files-at-level\" + NumberToString(level),\n                         &property));\n    return atoi(property.c_str());\n  }\n\n  int TotalTableFiles() {\n    int result = 0;\n    for (int level = 0; level < config::kNumLevels; level++) {\n      result += NumTableFilesAtLevel(level);\n    }\n    return result;\n  }\n\n  // Return spread of files per level\n  std::string FilesPerLevel() {\n    std::string result;\n    int last_non_zero_offset = 0;\n    for (int level = 0; level < config::kNumLevels; level++) {\n      int f = NumTableFilesAtLevel(level);\n      char buf[100];\n      snprintf(buf, sizeof(buf), \"%s%d\", (level ? \",\" : \"\"), f);\n      result += buf;\n      if (f > 0) {\n        last_non_zero_offset = result.size();\n      }\n    }\n    result.resize(last_non_zero_offset);\n    return result;\n  }\n\n  int CountFiles() {\n    std::vector<std::string> files;\n    env_->GetChildren(dbname_, &files);\n    return static_cast<int>(files.size());\n  }\n\n  uint64_t Size(const Slice& start, const Slice& limit) {\n    Range r(start, limit);\n    uint64_t size;\n    db_->GetApproximateSizes(&r, 1, &size);\n    return size;\n  }\n\n  void Compact(const Slice& start, const Slice& limit) {\n    db_->CompactRange(&start, &limit);\n  }\n\n  // Do n memtable compactions, each of which produces an sstable\n  // covering the range [small,large].\n  void MakeTables(int n, const std::string& small, const std::string& large) {\n    for (int i = 0; i < n; i++) {\n      Put(small, \"begin\");\n      Put(large, \"end\");\n      dbfull()->TEST_CompactMemTable();\n    }\n  }\n\n  // Prevent pushing of new sstables into deeper levels by adding\n  // tables that cover a specified range to all levels.\n  void FillLevels(const std::string& smallest, const std::string& largest) {\n    MakeTables(config::kNumLevels, smallest, largest);\n  }\n\n  void DumpFileCounts(const char* label) {\n    fprintf(stderr, \"---\\n%s:\\n\", label);\n    fprintf(stderr, \"maxoverlap: %lld\\n\",\n            static_cast<long long>(\n                dbfull()->TEST_MaxNextLevelOverlappingBytes()));\n    for (int level = 0; level < config::kNumLevels; level++) {\n      int num = NumTableFilesAtLevel(level);\n      if (num > 0) {\n        fprintf(stderr, \"  level %3d : %d files\\n\", level, num);\n      }\n    }\n  }\n\n  std::string DumpSSTableList() {\n    std::string property;\n    db_->GetProperty(\"leveldb.sstables\", &property);\n    return property;\n  }\n\n  std::string IterStatus(Iterator* iter) {\n    std::string result;\n    if (iter->Valid()) {\n      result = iter->key().ToString() + \"->\" + iter->value().ToString();\n    } else {\n      result = \"(invalid)\";\n    }\n    return result;\n  }\n\n  bool DeleteAnSSTFile() {\n    std::vector<std::string> filenames;\n    ASSERT_OK(env_->GetChildren(dbname_, &filenames));\n    uint64_t number;\n    FileType type;\n    for (size_t i = 0; i < filenames.size(); i++) {\n      if (ParseFileName(filenames[i], &number, &type) && type == kTableFile) {\n        ASSERT_OK(env_->DeleteFile(TableFileName(dbname_, number)));\n        return true;\n      }\n    }\n    return false;\n  }\n\n  // Returns number of files renamed.\n  int RenameLDBToSST() {\n    std::vector<std::string> filenames;\n    ASSERT_OK(env_->GetChildren(dbname_, &filenames));\n    uint64_t number;\n    FileType type;\n    int files_renamed = 0;\n    for (size_t i = 0; i < filenames.size(); i++) {\n      if (ParseFileName(filenames[i], &number, &type) && type == kTableFile) {\n        const std::string from = TableFileName(dbname_, number);\n        const std::string to = SSTTableFileName(dbname_, number);\n        ASSERT_OK(env_->RenameFile(from, to));\n        files_renamed++;\n      }\n    }\n    return files_renamed;\n  }\n};\n\nTEST(DBTest, Empty) {\n  do {\n    ASSERT_TRUE(db_ != NULL);\n    ASSERT_EQ(\"NOT_FOUND\", Get(\"foo\"));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, ReadWrite) {\n  do {\n    ASSERT_OK(Put(\"foo\", \"v1\"));\n    ASSERT_EQ(\"v1\", Get(\"foo\"));\n    ASSERT_OK(Put(\"bar\", \"v2\"));\n    ASSERT_OK(Put(\"foo\", \"v3\"));\n    ASSERT_EQ(\"v3\", Get(\"foo\"));\n    ASSERT_EQ(\"v2\", Get(\"bar\"));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, PutDeleteGet) {\n  do {\n    ASSERT_OK(db_->Put(WriteOptions(), \"foo\", \"v1\"));\n    ASSERT_EQ(\"v1\", Get(\"foo\"));\n    ASSERT_OK(db_->Put(WriteOptions(), \"foo\", \"v2\"));\n    ASSERT_EQ(\"v2\", Get(\"foo\"));\n    ASSERT_OK(db_->Delete(WriteOptions(), \"foo\"));\n    ASSERT_EQ(\"NOT_FOUND\", Get(\"foo\"));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, GetFromImmutableLayer) {\n  do {\n    Options options = CurrentOptions();\n    options.env = env_;\n    options.write_buffer_size = 100000;  // Small write buffer\n    Reopen(&options);\n\n    ASSERT_OK(Put(\"foo\", \"v1\"));\n    ASSERT_EQ(\"v1\", Get(\"foo\"));\n\n    env_->delay_data_sync_.Release_Store(env_);      // Block sync calls\n    Put(\"k1\", std::string(100000, 'x'));             // Fill memtable\n    Put(\"k2\", std::string(100000, 'y'));             // Trigger compaction\n    ASSERT_EQ(\"v1\", Get(\"foo\"));\n    env_->delay_data_sync_.Release_Store(NULL);      // Release sync calls\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, GetFromVersions) {\n  do {\n    ASSERT_OK(Put(\"foo\", \"v1\"));\n    dbfull()->TEST_CompactMemTable();\n    ASSERT_EQ(\"v1\", Get(\"foo\"));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, GetMemUsage) {\n  do {\n    ASSERT_OK(Put(\"foo\", \"v1\"));\n    std::string val;\n    ASSERT_TRUE(db_->GetProperty(\"leveldb.approximate-memory-usage\", &val));\n    int mem_usage = atoi(val.c_str());\n    ASSERT_GT(mem_usage, 0);\n    ASSERT_LT(mem_usage, 5*1024*1024);\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, GetSnapshot) {\n  do {\n    // Try with both a short key and a long key\n    for (int i = 0; i < 2; i++) {\n      std::string key = (i == 0) ? std::string(\"foo\") : std::string(200, 'x');\n      ASSERT_OK(Put(key, \"v1\"));\n      const Snapshot* s1 = db_->GetSnapshot();\n      ASSERT_OK(Put(key, \"v2\"));\n      ASSERT_EQ(\"v2\", Get(key));\n      ASSERT_EQ(\"v1\", Get(key, s1));\n      dbfull()->TEST_CompactMemTable();\n      ASSERT_EQ(\"v2\", Get(key));\n      ASSERT_EQ(\"v1\", Get(key, s1));\n      db_->ReleaseSnapshot(s1);\n    }\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, GetLevel0Ordering) {\n  do {\n    // Check that we process level-0 files in correct order.  The code\n    // below generates two level-0 files where the earlier one comes\n    // before the later one in the level-0 file list since the earlier\n    // one has a smaller \"smallest\" key.\n    ASSERT_OK(Put(\"bar\", \"b\"));\n    ASSERT_OK(Put(\"foo\", \"v1\"));\n    dbfull()->TEST_CompactMemTable();\n    ASSERT_OK(Put(\"foo\", \"v2\"));\n    dbfull()->TEST_CompactMemTable();\n    ASSERT_EQ(\"v2\", Get(\"foo\"));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, GetOrderedByLevels) {\n  do {\n    ASSERT_OK(Put(\"foo\", \"v1\"));\n    Compact(\"a\", \"z\");\n    ASSERT_EQ(\"v1\", Get(\"foo\"));\n    ASSERT_OK(Put(\"foo\", \"v2\"));\n    ASSERT_EQ(\"v2\", Get(\"foo\"));\n    dbfull()->TEST_CompactMemTable();\n    ASSERT_EQ(\"v2\", Get(\"foo\"));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, GetPicksCorrectFile) {\n  do {\n    // Arrange to have multiple files in a non-level-0 level.\n    ASSERT_OK(Put(\"a\", \"va\"));\n    Compact(\"a\", \"b\");\n    ASSERT_OK(Put(\"x\", \"vx\"));\n    Compact(\"x\", \"y\");\n    ASSERT_OK(Put(\"f\", \"vf\"));\n    Compact(\"f\", \"g\");\n    ASSERT_EQ(\"va\", Get(\"a\"));\n    ASSERT_EQ(\"vf\", Get(\"f\"));\n    ASSERT_EQ(\"vx\", Get(\"x\"));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, GetEncountersEmptyLevel) {\n  do {\n    // Arrange for the following to happen:\n    //   * sstable A in level 0\n    //   * nothing in level 1\n    //   * sstable B in level 2\n    // Then do enough Get() calls to arrange for an automatic compaction\n    // of sstable A.  A bug would cause the compaction to be marked as\n    // occurring at level 1 (instead of the correct level 0).\n\n    // Step 1: First place sstables in levels 0 and 2\n    int compaction_count = 0;\n    while (NumTableFilesAtLevel(0) == 0 ||\n           NumTableFilesAtLevel(2) == 0) {\n      ASSERT_LE(compaction_count, 100) << \"could not fill levels 0 and 2\";\n      compaction_count++;\n      Put(\"a\", \"begin\");\n      Put(\"z\", \"end\");\n      dbfull()->TEST_CompactMemTable();\n    }\n\n    // Step 2: clear level 1 if necessary.\n    dbfull()->TEST_CompactRange(1, NULL, NULL);\n    ASSERT_EQ(NumTableFilesAtLevel(0), 1);\n    ASSERT_EQ(NumTableFilesAtLevel(1), 0);\n    ASSERT_EQ(NumTableFilesAtLevel(2), 1);\n\n    // Step 3: read a bunch of times\n    for (int i = 0; i < 1000; i++) {\n      ASSERT_EQ(\"NOT_FOUND\", Get(\"missing\"));\n    }\n\n    // Step 4: Wait for compaction to finish\n    DelayMilliseconds(1000);\n\n    ASSERT_EQ(NumTableFilesAtLevel(0), 0);\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, IterEmpty) {\n  Iterator* iter = db_->NewIterator(ReadOptions());\n\n  iter->SeekToFirst();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  iter->SeekToLast();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  iter->Seek(\"foo\");\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  delete iter;\n}\n\nTEST(DBTest, IterSingle) {\n  ASSERT_OK(Put(\"a\", \"va\"));\n  Iterator* iter = db_->NewIterator(ReadOptions());\n\n  iter->SeekToFirst();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n  iter->SeekToFirst();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  iter->SeekToLast();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n  iter->SeekToLast();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  iter->Seek(\"\");\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  iter->Seek(\"a\");\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  iter->Seek(\"b\");\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  delete iter;\n}\n\nTEST(DBTest, IterMulti) {\n  ASSERT_OK(Put(\"a\", \"va\"));\n  ASSERT_OK(Put(\"b\", \"vb\"));\n  ASSERT_OK(Put(\"c\", \"vc\"));\n  Iterator* iter = db_->NewIterator(ReadOptions());\n\n  iter->SeekToFirst();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"b->vb\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"c->vc\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n  iter->SeekToFirst();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  iter->SeekToLast();\n  ASSERT_EQ(IterStatus(iter), \"c->vc\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"b->vb\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n  iter->SeekToLast();\n  ASSERT_EQ(IterStatus(iter), \"c->vc\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  iter->Seek(\"\");\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Seek(\"a\");\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Seek(\"ax\");\n  ASSERT_EQ(IterStatus(iter), \"b->vb\");\n  iter->Seek(\"b\");\n  ASSERT_EQ(IterStatus(iter), \"b->vb\");\n  iter->Seek(\"z\");\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  // Switch from reverse to forward\n  iter->SeekToLast();\n  iter->Prev();\n  iter->Prev();\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"b->vb\");\n\n  // Switch from forward to reverse\n  iter->SeekToFirst();\n  iter->Next();\n  iter->Next();\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"b->vb\");\n\n  // Make sure iter stays at snapshot\n  ASSERT_OK(Put(\"a\",  \"va2\"));\n  ASSERT_OK(Put(\"a2\", \"va3\"));\n  ASSERT_OK(Put(\"b\",  \"vb2\"));\n  ASSERT_OK(Put(\"c\",  \"vc2\"));\n  ASSERT_OK(Delete(\"b\"));\n  iter->SeekToFirst();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"b->vb\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"c->vc\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n  iter->SeekToLast();\n  ASSERT_EQ(IterStatus(iter), \"c->vc\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"b->vb\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  delete iter;\n}\n\nTEST(DBTest, IterSmallAndLargeMix) {\n  ASSERT_OK(Put(\"a\", \"va\"));\n  ASSERT_OK(Put(\"b\", std::string(100000, 'b')));\n  ASSERT_OK(Put(\"c\", \"vc\"));\n  ASSERT_OK(Put(\"d\", std::string(100000, 'd')));\n  ASSERT_OK(Put(\"e\", std::string(100000, 'e')));\n\n  Iterator* iter = db_->NewIterator(ReadOptions());\n\n  iter->SeekToFirst();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"b->\" + std::string(100000, 'b'));\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"c->vc\");\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"d->\" + std::string(100000, 'd'));\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"e->\" + std::string(100000, 'e'));\n  iter->Next();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  iter->SeekToLast();\n  ASSERT_EQ(IterStatus(iter), \"e->\" + std::string(100000, 'e'));\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"d->\" + std::string(100000, 'd'));\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"c->vc\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"b->\" + std::string(100000, 'b'));\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"a->va\");\n  iter->Prev();\n  ASSERT_EQ(IterStatus(iter), \"(invalid)\");\n\n  delete iter;\n}\n\nTEST(DBTest, IterMultiWithDelete) {\n  do {\n    ASSERT_OK(Put(\"a\", \"va\"));\n    ASSERT_OK(Put(\"b\", \"vb\"));\n    ASSERT_OK(Put(\"c\", \"vc\"));\n    ASSERT_OK(Delete(\"b\"));\n    ASSERT_EQ(\"NOT_FOUND\", Get(\"b\"));\n\n    Iterator* iter = db_->NewIterator(ReadOptions());\n    iter->Seek(\"c\");\n    ASSERT_EQ(IterStatus(iter), \"c->vc\");\n    iter->Prev();\n    ASSERT_EQ(IterStatus(iter), \"a->va\");\n    delete iter;\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, Recover) {\n  do {\n    ASSERT_OK(Put(\"foo\", \"v1\"));\n    ASSERT_OK(Put(\"baz\", \"v5\"));\n\n    Reopen();\n    ASSERT_EQ(\"v1\", Get(\"foo\"));\n\n    ASSERT_EQ(\"v1\", Get(\"foo\"));\n    ASSERT_EQ(\"v5\", Get(\"baz\"));\n    ASSERT_OK(Put(\"bar\", \"v2\"));\n    ASSERT_OK(Put(\"foo\", \"v3\"));\n\n    Reopen();\n    ASSERT_EQ(\"v3\", Get(\"foo\"));\n    ASSERT_OK(Put(\"foo\", \"v4\"));\n    ASSERT_EQ(\"v4\", Get(\"foo\"));\n    ASSERT_EQ(\"v2\", Get(\"bar\"));\n    ASSERT_EQ(\"v5\", Get(\"baz\"));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, RecoveryWithEmptyLog) {\n  do {\n    ASSERT_OK(Put(\"foo\", \"v1\"));\n    ASSERT_OK(Put(\"foo\", \"v2\"));\n    Reopen();\n    Reopen();\n    ASSERT_OK(Put(\"foo\", \"v3\"));\n    Reopen();\n    ASSERT_EQ(\"v3\", Get(\"foo\"));\n  } while (ChangeOptions());\n}\n\n// Check that writes done during a memtable compaction are recovered\n// if the database is shutdown during the memtable compaction.\nTEST(DBTest, RecoverDuringMemtableCompaction) {\n  do {\n    Options options = CurrentOptions();\n    options.env = env_;\n    options.write_buffer_size = 1000000;\n    Reopen(&options);\n\n    // Trigger a long memtable compaction and reopen the database during it\n    ASSERT_OK(Put(\"foo\", \"v1\"));                         // Goes to 1st log file\n    ASSERT_OK(Put(\"big1\", std::string(10000000, 'x')));  // Fills memtable\n    ASSERT_OK(Put(\"big2\", std::string(1000, 'y')));      // Triggers compaction\n    ASSERT_OK(Put(\"bar\", \"v2\"));                         // Goes to new log file\n\n    Reopen(&options);\n    ASSERT_EQ(\"v1\", Get(\"foo\"));\n    ASSERT_EQ(\"v2\", Get(\"bar\"));\n    ASSERT_EQ(std::string(10000000, 'x'), Get(\"big1\"));\n    ASSERT_EQ(std::string(1000, 'y'), Get(\"big2\"));\n  } while (ChangeOptions());\n}\n\nstatic std::string Key(int i) {\n  char buf[100];\n  snprintf(buf, sizeof(buf), \"key%06d\", i);\n  return std::string(buf);\n}\n\nTEST(DBTest, MinorCompactionsHappen) {\n  Options options = CurrentOptions();\n  options.write_buffer_size = 10000;\n  Reopen(&options);\n\n  const int N = 500;\n\n  int starting_num_tables = TotalTableFiles();\n  for (int i = 0; i < N; i++) {\n    ASSERT_OK(Put(Key(i), Key(i) + std::string(1000, 'v')));\n  }\n  int ending_num_tables = TotalTableFiles();\n  ASSERT_GT(ending_num_tables, starting_num_tables);\n\n  for (int i = 0; i < N; i++) {\n    ASSERT_EQ(Key(i) + std::string(1000, 'v'), Get(Key(i)));\n  }\n\n  Reopen();\n\n  for (int i = 0; i < N; i++) {\n    ASSERT_EQ(Key(i) + std::string(1000, 'v'), Get(Key(i)));\n  }\n}\n\nTEST(DBTest, RecoverWithLargeLog) {\n  {\n    Options options = CurrentOptions();\n    Reopen(&options);\n    ASSERT_OK(Put(\"big1\", std::string(200000, '1')));\n    ASSERT_OK(Put(\"big2\", std::string(200000, '2')));\n    ASSERT_OK(Put(\"small3\", std::string(10, '3')));\n    ASSERT_OK(Put(\"small4\", std::string(10, '4')));\n    ASSERT_EQ(NumTableFilesAtLevel(0), 0);\n  }\n\n  // Make sure that if we re-open with a small write buffer size that\n  // we flush table files in the middle of a large log file.\n  Options options = CurrentOptions();\n  options.write_buffer_size = 100000;\n  Reopen(&options);\n  ASSERT_EQ(NumTableFilesAtLevel(0), 3);\n  ASSERT_EQ(std::string(200000, '1'), Get(\"big1\"));\n  ASSERT_EQ(std::string(200000, '2'), Get(\"big2\"));\n  ASSERT_EQ(std::string(10, '3'), Get(\"small3\"));\n  ASSERT_EQ(std::string(10, '4'), Get(\"small4\"));\n  ASSERT_GT(NumTableFilesAtLevel(0), 1);\n}\n\nTEST(DBTest, CompactionsGenerateMultipleFiles) {\n  Options options = CurrentOptions();\n  options.write_buffer_size = 100000000;        // Large write buffer\n  Reopen(&options);\n\n  Random rnd(301);\n\n  // Write 8MB (80 values, each 100K)\n  ASSERT_EQ(NumTableFilesAtLevel(0), 0);\n  std::vector<std::string> values;\n  for (int i = 0; i < 80; i++) {\n    values.push_back(RandomString(&rnd, 100000));\n    ASSERT_OK(Put(Key(i), values[i]));\n  }\n\n  // Reopening moves updates to level-0\n  Reopen(&options);\n  dbfull()->TEST_CompactRange(0, NULL, NULL);\n\n  ASSERT_EQ(NumTableFilesAtLevel(0), 0);\n  ASSERT_GT(NumTableFilesAtLevel(1), 1);\n  for (int i = 0; i < 80; i++) {\n    ASSERT_EQ(Get(Key(i)), values[i]);\n  }\n}\n\nTEST(DBTest, RepeatedWritesToSameKey) {\n  Options options = CurrentOptions();\n  options.env = env_;\n  options.write_buffer_size = 100000;  // Small write buffer\n  Reopen(&options);\n\n  // We must have at most one file per level except for level-0,\n  // which may have up to kL0_StopWritesTrigger files.\n  const int kMaxFiles = config::kNumLevels + config::kL0_StopWritesTrigger;\n\n  Random rnd(301);\n  std::string value = RandomString(&rnd, 2 * options.write_buffer_size);\n  for (int i = 0; i < 5 * kMaxFiles; i++) {\n    Put(\"key\", value);\n    ASSERT_LE(TotalTableFiles(), kMaxFiles);\n    fprintf(stderr, \"after %d: %d files\\n\", int(i+1), TotalTableFiles());\n  }\n}\n\nTEST(DBTest, SparseMerge) {\n  Options options = CurrentOptions();\n  options.compression = kNoCompression;\n  Reopen(&options);\n\n  FillLevels(\"A\", \"Z\");\n\n  // Suppose there is:\n  //    small amount of data with prefix A\n  //    large amount of data with prefix B\n  //    small amount of data with prefix C\n  // and that recent updates have made small changes to all three prefixes.\n  // Check that we do not do a compaction that merges all of B in one shot.\n  const std::string value(1000, 'x');\n  Put(\"A\", \"va\");\n  // Write approximately 100MB of \"B\" values\n  for (int i = 0; i < 100000; i++) {\n    char key[100];\n    snprintf(key, sizeof(key), \"B%010d\", i);\n    Put(key, value);\n  }\n  Put(\"C\", \"vc\");\n  dbfull()->TEST_CompactMemTable();\n  dbfull()->TEST_CompactRange(0, NULL, NULL);\n\n  // Make sparse update\n  Put(\"A\",    \"va2\");\n  Put(\"B100\", \"bvalue2\");\n  Put(\"C\",    \"vc2\");\n  dbfull()->TEST_CompactMemTable();\n\n  // Compactions should not cause us to create a situation where\n  // a file overlaps too much data at the next level.\n  ASSERT_LE(dbfull()->TEST_MaxNextLevelOverlappingBytes(), 20*1048576);\n  dbfull()->TEST_CompactRange(0, NULL, NULL);\n  ASSERT_LE(dbfull()->TEST_MaxNextLevelOverlappingBytes(), 20*1048576);\n  dbfull()->TEST_CompactRange(1, NULL, NULL);\n  ASSERT_LE(dbfull()->TEST_MaxNextLevelOverlappingBytes(), 20*1048576);\n}\n\nstatic bool Between(uint64_t val, uint64_t low, uint64_t high) {\n  bool result = (val >= low) && (val <= high);\n  if (!result) {\n    fprintf(stderr, \"Value %llu is not in range [%llu, %llu]\\n\",\n            (unsigned long long)(val),\n            (unsigned long long)(low),\n            (unsigned long long)(high));\n  }\n  return result;\n}\n\nTEST(DBTest, ApproximateSizes) {\n  do {\n    Options options = CurrentOptions();\n    options.write_buffer_size = 100000000;        // Large write buffer\n    options.compression = kNoCompression;\n    DestroyAndReopen();\n\n    ASSERT_TRUE(Between(Size(\"\", \"xyz\"), 0, 0));\n    Reopen(&options);\n    ASSERT_TRUE(Between(Size(\"\", \"xyz\"), 0, 0));\n\n    // Write 8MB (80 values, each 100K)\n    ASSERT_EQ(NumTableFilesAtLevel(0), 0);\n    const int N = 80;\n    static const int S1 = 100000;\n    static const int S2 = 105000;  // Allow some expansion from metadata\n    Random rnd(301);\n    for (int i = 0; i < N; i++) {\n      ASSERT_OK(Put(Key(i), RandomString(&rnd, S1)));\n    }\n\n    // 0 because GetApproximateSizes() does not account for memtable space\n    ASSERT_TRUE(Between(Size(\"\", Key(50)), 0, 0));\n\n    if (options.reuse_logs) {\n      // Recovery will reuse memtable, and GetApproximateSizes() does not\n      // account for memtable usage;\n      Reopen(&options);\n      ASSERT_TRUE(Between(Size(\"\", Key(50)), 0, 0));\n      continue;\n    }\n\n    // Check sizes across recovery by reopening a few times\n    for (int run = 0; run < 3; run++) {\n      Reopen(&options);\n\n      for (int compact_start = 0; compact_start < N; compact_start += 10) {\n        for (int i = 0; i < N; i += 10) {\n          ASSERT_TRUE(Between(Size(\"\", Key(i)), S1*i, S2*i));\n          ASSERT_TRUE(Between(Size(\"\", Key(i)+\".suffix\"), S1*(i+1), S2*(i+1)));\n          ASSERT_TRUE(Between(Size(Key(i), Key(i+10)), S1*10, S2*10));\n        }\n        ASSERT_TRUE(Between(Size(\"\", Key(50)), S1*50, S2*50));\n        ASSERT_TRUE(Between(Size(\"\", Key(50)+\".suffix\"), S1*50, S2*50));\n\n        std::string cstart_str = Key(compact_start);\n        std::string cend_str = Key(compact_start + 9);\n        Slice cstart = cstart_str;\n        Slice cend = cend_str;\n        dbfull()->TEST_CompactRange(0, &cstart, &cend);\n      }\n\n      ASSERT_EQ(NumTableFilesAtLevel(0), 0);\n      ASSERT_GT(NumTableFilesAtLevel(1), 0);\n    }\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, ApproximateSizes_MixOfSmallAndLarge) {\n  do {\n    Options options = CurrentOptions();\n    options.compression = kNoCompression;\n    Reopen();\n\n    Random rnd(301);\n    std::string big1 = RandomString(&rnd, 100000);\n    ASSERT_OK(Put(Key(0), RandomString(&rnd, 10000)));\n    ASSERT_OK(Put(Key(1), RandomString(&rnd, 10000)));\n    ASSERT_OK(Put(Key(2), big1));\n    ASSERT_OK(Put(Key(3), RandomString(&rnd, 10000)));\n    ASSERT_OK(Put(Key(4), big1));\n    ASSERT_OK(Put(Key(5), RandomString(&rnd, 10000)));\n    ASSERT_OK(Put(Key(6), RandomString(&rnd, 300000)));\n    ASSERT_OK(Put(Key(7), RandomString(&rnd, 10000)));\n\n    if (options.reuse_logs) {\n      // Need to force a memtable compaction since recovery does not do so.\n      ASSERT_OK(dbfull()->TEST_CompactMemTable());\n    }\n\n    // Check sizes across recovery by reopening a few times\n    for (int run = 0; run < 3; run++) {\n      Reopen(&options);\n\n      ASSERT_TRUE(Between(Size(\"\", Key(0)), 0, 0));\n      ASSERT_TRUE(Between(Size(\"\", Key(1)), 10000, 11000));\n      ASSERT_TRUE(Between(Size(\"\", Key(2)), 20000, 21000));\n      ASSERT_TRUE(Between(Size(\"\", Key(3)), 120000, 121000));\n      ASSERT_TRUE(Between(Size(\"\", Key(4)), 130000, 131000));\n      ASSERT_TRUE(Between(Size(\"\", Key(5)), 230000, 231000));\n      ASSERT_TRUE(Between(Size(\"\", Key(6)), 240000, 241000));\n      ASSERT_TRUE(Between(Size(\"\", Key(7)), 540000, 541000));\n      ASSERT_TRUE(Between(Size(\"\", Key(8)), 550000, 560000));\n\n      ASSERT_TRUE(Between(Size(Key(3), Key(5)), 110000, 111000));\n\n      dbfull()->TEST_CompactRange(0, NULL, NULL);\n    }\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, IteratorPinsRef) {\n  Put(\"foo\", \"hello\");\n\n  // Get iterator that will yield the current contents of the DB.\n  Iterator* iter = db_->NewIterator(ReadOptions());\n\n  // Write to force compactions\n  Put(\"foo\", \"newvalue1\");\n  for (int i = 0; i < 100; i++) {\n    ASSERT_OK(Put(Key(i), Key(i) + std::string(100000, 'v'))); // 100K values\n  }\n  Put(\"foo\", \"newvalue2\");\n\n  iter->SeekToFirst();\n  ASSERT_TRUE(iter->Valid());\n  ASSERT_EQ(\"foo\", iter->key().ToString());\n  ASSERT_EQ(\"hello\", iter->value().ToString());\n  iter->Next();\n  ASSERT_TRUE(!iter->Valid());\n  delete iter;\n}\n\nTEST(DBTest, Snapshot) {\n  do {\n    Put(\"foo\", \"v1\");\n    const Snapshot* s1 = db_->GetSnapshot();\n    Put(\"foo\", \"v2\");\n    const Snapshot* s2 = db_->GetSnapshot();\n    Put(\"foo\", \"v3\");\n    const Snapshot* s3 = db_->GetSnapshot();\n\n    Put(\"foo\", \"v4\");\n    ASSERT_EQ(\"v1\", Get(\"foo\", s1));\n    ASSERT_EQ(\"v2\", Get(\"foo\", s2));\n    ASSERT_EQ(\"v3\", Get(\"foo\", s3));\n    ASSERT_EQ(\"v4\", Get(\"foo\"));\n\n    db_->ReleaseSnapshot(s3);\n    ASSERT_EQ(\"v1\", Get(\"foo\", s1));\n    ASSERT_EQ(\"v2\", Get(\"foo\", s2));\n    ASSERT_EQ(\"v4\", Get(\"foo\"));\n\n    db_->ReleaseSnapshot(s1);\n    ASSERT_EQ(\"v2\", Get(\"foo\", s2));\n    ASSERT_EQ(\"v4\", Get(\"foo\"));\n\n    db_->ReleaseSnapshot(s2);\n    ASSERT_EQ(\"v4\", Get(\"foo\"));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, HiddenValuesAreRemoved) {\n  do {\n    Random rnd(301);\n    FillLevels(\"a\", \"z\");\n\n    std::string big = RandomString(&rnd, 50000);\n    Put(\"foo\", big);\n    Put(\"pastfoo\", \"v\");\n    const Snapshot* snapshot = db_->GetSnapshot();\n    Put(\"foo\", \"tiny\");\n    Put(\"pastfoo2\", \"v2\");        // Advance sequence number one more\n\n    ASSERT_OK(dbfull()->TEST_CompactMemTable());\n    ASSERT_GT(NumTableFilesAtLevel(0), 0);\n\n    ASSERT_EQ(big, Get(\"foo\", snapshot));\n    ASSERT_TRUE(Between(Size(\"\", \"pastfoo\"), 50000, 60000));\n    db_->ReleaseSnapshot(snapshot);\n    ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ tiny, \" + big + \" ]\");\n    Slice x(\"x\");\n    dbfull()->TEST_CompactRange(0, NULL, &x);\n    ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ tiny ]\");\n    ASSERT_EQ(NumTableFilesAtLevel(0), 0);\n    ASSERT_GE(NumTableFilesAtLevel(1), 1);\n    dbfull()->TEST_CompactRange(1, NULL, &x);\n    ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ tiny ]\");\n\n    ASSERT_TRUE(Between(Size(\"\", \"pastfoo\"), 0, 1000));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, DeletionMarkers1) {\n  Put(\"foo\", \"v1\");\n  ASSERT_OK(dbfull()->TEST_CompactMemTable());\n  const int last = config::kMaxMemCompactLevel;\n  ASSERT_EQ(NumTableFilesAtLevel(last), 1);   // foo => v1 is now in last level\n\n  // Place a table at level last-1 to prevent merging with preceding mutation\n  Put(\"a\", \"begin\");\n  Put(\"z\", \"end\");\n  dbfull()->TEST_CompactMemTable();\n  ASSERT_EQ(NumTableFilesAtLevel(last), 1);\n  ASSERT_EQ(NumTableFilesAtLevel(last-1), 1);\n\n  Delete(\"foo\");\n  Put(\"foo\", \"v2\");\n  ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ v2, DEL, v1 ]\");\n  ASSERT_OK(dbfull()->TEST_CompactMemTable());  // Moves to level last-2\n  ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ v2, DEL, v1 ]\");\n  Slice z(\"z\");\n  dbfull()->TEST_CompactRange(last-2, NULL, &z);\n  // DEL eliminated, but v1 remains because we aren't compacting that level\n  // (DEL can be eliminated because v2 hides v1).\n  ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ v2, v1 ]\");\n  dbfull()->TEST_CompactRange(last-1, NULL, NULL);\n  // Merging last-1 w/ last, so we are the base level for \"foo\", so\n  // DEL is removed.  (as is v1).\n  ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ v2 ]\");\n}\n\nTEST(DBTest, DeletionMarkers2) {\n  Put(\"foo\", \"v1\");\n  ASSERT_OK(dbfull()->TEST_CompactMemTable());\n  const int last = config::kMaxMemCompactLevel;\n  ASSERT_EQ(NumTableFilesAtLevel(last), 1);   // foo => v1 is now in last level\n\n  // Place a table at level last-1 to prevent merging with preceding mutation\n  Put(\"a\", \"begin\");\n  Put(\"z\", \"end\");\n  dbfull()->TEST_CompactMemTable();\n  ASSERT_EQ(NumTableFilesAtLevel(last), 1);\n  ASSERT_EQ(NumTableFilesAtLevel(last-1), 1);\n\n  Delete(\"foo\");\n  ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ DEL, v1 ]\");\n  ASSERT_OK(dbfull()->TEST_CompactMemTable());  // Moves to level last-2\n  ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ DEL, v1 ]\");\n  dbfull()->TEST_CompactRange(last-2, NULL, NULL);\n  // DEL kept: \"last\" file overlaps\n  ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ DEL, v1 ]\");\n  dbfull()->TEST_CompactRange(last-1, NULL, NULL);\n  // Merging last-1 w/ last, so we are the base level for \"foo\", so\n  // DEL is removed.  (as is v1).\n  ASSERT_EQ(AllEntriesFor(\"foo\"), \"[ ]\");\n}\n\nTEST(DBTest, OverlapInLevel0) {\n  do {\n    ASSERT_EQ(config::kMaxMemCompactLevel, 2) << \"Fix test to match config\";\n\n    // Fill levels 1 and 2 to disable the pushing of new memtables to levels > 0.\n    ASSERT_OK(Put(\"100\", \"v100\"));\n    ASSERT_OK(Put(\"999\", \"v999\"));\n    dbfull()->TEST_CompactMemTable();\n    ASSERT_OK(Delete(\"100\"));\n    ASSERT_OK(Delete(\"999\"));\n    dbfull()->TEST_CompactMemTable();\n    ASSERT_EQ(\"0,1,1\", FilesPerLevel());\n\n    // Make files spanning the following ranges in level-0:\n    //  files[0]  200 .. 900\n    //  files[1]  300 .. 500\n    // Note that files are sorted by smallest key.\n    ASSERT_OK(Put(\"300\", \"v300\"));\n    ASSERT_OK(Put(\"500\", \"v500\"));\n    dbfull()->TEST_CompactMemTable();\n    ASSERT_OK(Put(\"200\", \"v200\"));\n    ASSERT_OK(Put(\"600\", \"v600\"));\n    ASSERT_OK(Put(\"900\", \"v900\"));\n    dbfull()->TEST_CompactMemTable();\n    ASSERT_EQ(\"2,1,1\", FilesPerLevel());\n\n    // Compact away the placeholder files we created initially\n    dbfull()->TEST_CompactRange(1, NULL, NULL);\n    dbfull()->TEST_CompactRange(2, NULL, NULL);\n    ASSERT_EQ(\"2\", FilesPerLevel());\n\n    // Do a memtable compaction.  Before bug-fix, the compaction would\n    // not detect the overlap with level-0 files and would incorrectly place\n    // the deletion in a deeper level.\n    ASSERT_OK(Delete(\"600\"));\n    dbfull()->TEST_CompactMemTable();\n    ASSERT_EQ(\"3\", FilesPerLevel());\n    ASSERT_EQ(\"NOT_FOUND\", Get(\"600\"));\n  } while (ChangeOptions());\n}\n\nTEST(DBTest, L0_CompactionBug_Issue44_a) {\n  Reopen();\n  ASSERT_OK(Put(\"b\", \"v\"));\n  Reopen();\n  ASSERT_OK(Delete(\"b\"));\n  ASSERT_OK(Delete(\"a\"));\n  Reopen();\n  ASSERT_OK(Delete(\"a\"));\n  Reopen();\n  ASSERT_OK(Put(\"a\", \"v\"));\n  Reopen();\n  Reopen();\n  ASSERT_EQ(\"(a->v)\", Contents());\n  DelayMilliseconds(1000);  // Wait for compaction to finish\n  ASSERT_EQ(\"(a->v)\", Contents());\n}\n\nTEST(DBTest, L0_CompactionBug_Issue44_b) {\n  Reopen();\n  Put(\"\",\"\");\n  Reopen();\n  Delete(\"e\");\n  Put(\"\",\"\");\n  Reopen();\n  Put(\"c\", \"cv\");\n  Reopen();\n  Put(\"\",\"\");\n  Reopen();\n  Put(\"\",\"\");\n  DelayMilliseconds(1000);  // Wait for compaction to finish\n  Reopen();\n  Put(\"d\",\"dv\");\n  Reopen();\n  Put(\"\",\"\");\n  Reopen();\n  Delete(\"d\");\n  Delete(\"b\");\n  Reopen();\n  ASSERT_EQ(\"(->)(c->cv)\", Contents());\n  DelayMilliseconds(1000);  // Wait for compaction to finish\n  ASSERT_EQ(\"(->)(c->cv)\", Contents());\n}\n\nTEST(DBTest, ComparatorCheck) {\n  class NewComparator : public Comparator {\n   public:\n    virtual const char* Name() const { return \"leveldb.NewComparator\"; }\n    virtual int Compare(const Slice& a, const Slice& b) const {\n      return BytewiseComparator()->Compare(a, b);\n    }\n    virtual void FindShortestSeparator(std::string* s, const Slice& l) const {\n      BytewiseComparator()->FindShortestSeparator(s, l);\n    }\n    virtual void FindShortSuccessor(std::string* key) const {\n      BytewiseComparator()->FindShortSuccessor(key);\n    }\n  };\n  NewComparator cmp;\n  Options new_options = CurrentOptions();\n  new_options.comparator = &cmp;\n  Status s = TryReopen(&new_options);\n  ASSERT_TRUE(!s.ok());\n  ASSERT_TRUE(s.ToString().find(\"comparator\") != std::string::npos)\n      << s.ToString();\n}\n\nTEST(DBTest, CustomComparator) {\n  class NumberComparator : public Comparator {\n   public:\n    virtual const char* Name() const { return \"test.NumberComparator\"; }\n    virtual int Compare(const Slice& a, const Slice& b) const {\n      return ToNumber(a) - ToNumber(b);\n    }\n    virtual void FindShortestSeparator(std::string* s, const Slice& l) const {\n      ToNumber(*s);     // Check format\n      ToNumber(l);      // Check format\n    }\n    virtual void FindShortSuccessor(std::string* key) const {\n      ToNumber(*key);   // Check format\n    }\n   private:\n    static int ToNumber(const Slice& x) {\n      // Check that there are no extra characters.\n      ASSERT_TRUE(x.size() >= 2 && x[0] == '[' && x[x.size()-1] == ']')\n          << EscapeString(x);\n      int val;\n      char ignored;\n      ASSERT_TRUE(sscanf(x.ToString().c_str(), \"[%i]%c\", &val, &ignored) == 1)\n          << EscapeString(x);\n      return val;\n    }\n  };\n  NumberComparator cmp;\n  Options new_options = CurrentOptions();\n  new_options.create_if_missing = true;\n  new_options.comparator = &cmp;\n  new_options.filter_policy = NULL;     // Cannot use bloom filters\n  new_options.write_buffer_size = 1000;  // Compact more often\n  DestroyAndReopen(&new_options);\n  ASSERT_OK(Put(\"[10]\", \"ten\"));\n  ASSERT_OK(Put(\"[0x14]\", \"twenty\"));\n  for (int i = 0; i < 2; i++) {\n    ASSERT_EQ(\"ten\", Get(\"[10]\"));\n    ASSERT_EQ(\"ten\", Get(\"[0xa]\"));\n    ASSERT_EQ(\"twenty\", Get(\"[20]\"));\n    ASSERT_EQ(\"twenty\", Get(\"[0x14]\"));\n    ASSERT_EQ(\"NOT_FOUND\", Get(\"[15]\"));\n    ASSERT_EQ(\"NOT_FOUND\", Get(\"[0xf]\"));\n    Compact(\"[0]\", \"[9999]\");\n  }\n\n  for (int run = 0; run < 2; run++) {\n    for (int i = 0; i < 1000; i++) {\n      char buf[100];\n      snprintf(buf, sizeof(buf), \"[%d]\", i*10);\n      ASSERT_OK(Put(buf, buf));\n    }\n    Compact(\"[0]\", \"[1000000]\");\n  }\n}\n\nTEST(DBTest, ManualCompaction) {\n  ASSERT_EQ(config::kMaxMemCompactLevel, 2)\n      << \"Need to update this test to match kMaxMemCompactLevel\";\n\n  MakeTables(3, \"p\", \"q\");\n  ASSERT_EQ(\"1,1,1\", FilesPerLevel());\n\n  // Compaction range falls before files\n  Compact(\"\", \"c\");\n  ASSERT_EQ(\"1,1,1\", FilesPerLevel());\n\n  // Compaction range falls after files\n  Compact(\"r\", \"z\");\n  ASSERT_EQ(\"1,1,1\", FilesPerLevel());\n\n  // Compaction range overlaps files\n  Compact(\"p1\", \"p9\");\n  ASSERT_EQ(\"0,0,1\", FilesPerLevel());\n\n  // Populate a different range\n  MakeTables(3, \"c\", \"e\");\n  ASSERT_EQ(\"1,1,2\", FilesPerLevel());\n\n  // Compact just the new range\n  Compact(\"b\", \"f\");\n  ASSERT_EQ(\"0,0,2\", FilesPerLevel());\n\n  // Compact all\n  MakeTables(1, \"a\", \"z\");\n  ASSERT_EQ(\"0,1,2\", FilesPerLevel());\n  db_->CompactRange(NULL, NULL);\n  ASSERT_EQ(\"0,0,1\", FilesPerLevel());\n}\n\nTEST(DBTest, DBOpen_Options) {\n  std::string dbname = test::TmpDir() + \"/db_options_test\";\n  DestroyDB(dbname, Options());\n\n  // Does not exist, and create_if_missing == false: error\n  DB* db = NULL;\n  Options opts;\n  opts.create_if_missing = false;\n  Status s = DB::Open(opts, dbname, &db);\n  ASSERT_TRUE(strstr(s.ToString().c_str(), \"does not exist\") != NULL);\n  ASSERT_TRUE(db == NULL);\n\n  // Does not exist, and create_if_missing == true: OK\n  opts.create_if_missing = true;\n  s = DB::Open(opts, dbname, &db);\n  ASSERT_OK(s);\n  ASSERT_TRUE(db != NULL);\n\n  delete db;\n  db = NULL;\n\n  // Does exist, and error_if_exists == true: error\n  opts.create_if_missing = false;\n  opts.error_if_exists = true;\n  s = DB::Open(opts, dbname, &db);\n  ASSERT_TRUE(strstr(s.ToString().c_str(), \"exists\") != NULL);\n  ASSERT_TRUE(db == NULL);\n\n  // Does exist, and error_if_exists == false: OK\n  opts.create_if_missing = true;\n  opts.error_if_exists = false;\n  s = DB::Open(opts, dbname, &db);\n  ASSERT_OK(s);\n  ASSERT_TRUE(db != NULL);\n\n  delete db;\n  db = NULL;\n}\n\nTEST(DBTest, Locking) {\n  DB* db2 = NULL;\n  Status s = DB::Open(CurrentOptions(), dbname_, &db2);\n  ASSERT_TRUE(!s.ok()) << \"Locking did not prevent re-opening db\";\n}\n\n// Check that number of files does not grow when we are out of space\nTEST(DBTest, NoSpace) {\n  Options options = CurrentOptions();\n  options.env = env_;\n  Reopen(&options);\n\n  ASSERT_OK(Put(\"foo\", \"v1\"));\n  ASSERT_EQ(\"v1\", Get(\"foo\"));\n  Compact(\"a\", \"z\");\n  const int num_files = CountFiles();\n  env_->no_space_.Release_Store(env_);   // Force out-of-space errors\n  for (int i = 0; i < 10; i++) {\n    for (int level = 0; level < config::kNumLevels-1; level++) {\n      dbfull()->TEST_CompactRange(level, NULL, NULL);\n    }\n  }\n  env_->no_space_.Release_Store(NULL);\n  ASSERT_LT(CountFiles(), num_files + 3);\n}\n\nTEST(DBTest, NonWritableFileSystem) {\n  Options options = CurrentOptions();\n  options.write_buffer_size = 1000;\n  options.env = env_;\n  Reopen(&options);\n  ASSERT_OK(Put(\"foo\", \"v1\"));\n  env_->non_writable_.Release_Store(env_);  // Force errors for new files\n  std::string big(100000, 'x');\n  int errors = 0;\n  for (int i = 0; i < 20; i++) {\n    fprintf(stderr, \"iter %d; errors %d\\n\", i, errors);\n    if (!Put(\"foo\", big).ok()) {\n      errors++;\n      DelayMilliseconds(100);\n    }\n  }\n  ASSERT_GT(errors, 0);\n  env_->non_writable_.Release_Store(NULL);\n}\n\nTEST(DBTest, WriteSyncError) {\n  // Check that log sync errors cause the DB to disallow future writes.\n\n  // (a) Cause log sync calls to fail\n  Options options = CurrentOptions();\n  options.env = env_;\n  Reopen(&options);\n  env_->data_sync_error_.Release_Store(env_);\n\n  // (b) Normal write should succeed\n  WriteOptions w;\n  ASSERT_OK(db_->Put(w, \"k1\", \"v1\"));\n  ASSERT_EQ(\"v1\", Get(\"k1\"));\n\n  // (c) Do a sync write; should fail\n  w.sync = true;\n  ASSERT_TRUE(!db_->Put(w, \"k2\", \"v2\").ok());\n  ASSERT_EQ(\"v1\", Get(\"k1\"));\n  ASSERT_EQ(\"NOT_FOUND\", Get(\"k2\"));\n\n  // (d) make sync behave normally\n  env_->data_sync_error_.Release_Store(NULL);\n\n  // (e) Do a non-sync write; should fail\n  w.sync = false;\n  ASSERT_TRUE(!db_->Put(w, \"k3\", \"v3\").ok());\n  ASSERT_EQ(\"v1\", Get(\"k1\"));\n  ASSERT_EQ(\"NOT_FOUND\", Get(\"k2\"));\n  ASSERT_EQ(\"NOT_FOUND\", Get(\"k3\"));\n}\n\nTEST(DBTest, ManifestWriteError) {\n  // Test for the following problem:\n  // (a) Compaction produces file F\n  // (b) Log record containing F is written to MANIFEST file, but Sync() fails\n  // (c) GC deletes F\n  // (d) After reopening DB, reads fail since deleted F is named in log record\n\n  // We iterate twice.  In the second iteration, everything is the\n  // same except the log record never makes it to the MANIFEST file.\n  for (int iter = 0; iter < 2; iter++) {\n    port::AtomicPointer* error_type = (iter == 0)\n        ? &env_->manifest_sync_error_\n        : &env_->manifest_write_error_;\n\n    // Insert foo=>bar mapping\n    Options options = CurrentOptions();\n    options.env = env_;\n    options.create_if_missing = true;\n    options.error_if_exists = false;\n    DestroyAndReopen(&options);\n    ASSERT_OK(Put(\"foo\", \"bar\"));\n    ASSERT_EQ(\"bar\", Get(\"foo\"));\n\n    // Memtable compaction (will succeed)\n    dbfull()->TEST_CompactMemTable();\n    ASSERT_EQ(\"bar\", Get(\"foo\"));\n    const int last = config::kMaxMemCompactLevel;\n    ASSERT_EQ(NumTableFilesAtLevel(last), 1);   // foo=>bar is now in last level\n\n    // Merging compaction (will fail)\n    error_type->Release_Store(env_);\n    dbfull()->TEST_CompactRange(last, NULL, NULL);  // Should fail\n    ASSERT_EQ(\"bar\", Get(\"foo\"));\n\n    // Recovery: should not lose data\n    error_type->Release_Store(NULL);\n    Reopen(&options);\n    ASSERT_EQ(\"bar\", Get(\"foo\"));\n  }\n}\n\nTEST(DBTest, MissingSSTFile) {\n  ASSERT_OK(Put(\"foo\", \"bar\"));\n  ASSERT_EQ(\"bar\", Get(\"foo\"));\n\n  // Dump the memtable to disk.\n  dbfull()->TEST_CompactMemTable();\n  ASSERT_EQ(\"bar\", Get(\"foo\"));\n\n  Close();\n  ASSERT_TRUE(DeleteAnSSTFile());\n  Options options = CurrentOptions();\n  options.paranoid_checks = true;\n  Status s = TryReopen(&options);\n  ASSERT_TRUE(!s.ok());\n  ASSERT_TRUE(s.ToString().find(\"issing\") != std::string::npos)\n      << s.ToString();\n}\n\nTEST(DBTest, StillReadSST) {\n  ASSERT_OK(Put(\"foo\", \"bar\"));\n  ASSERT_EQ(\"bar\", Get(\"foo\"));\n\n  // Dump the memtable to disk.\n  dbfull()->TEST_CompactMemTable();\n  ASSERT_EQ(\"bar\", Get(\"foo\"));\n  Close();\n  ASSERT_GT(RenameLDBToSST(), 0);\n  Options options = CurrentOptions();\n  options.paranoid_checks = true;\n  Status s = TryReopen(&options);\n  ASSERT_TRUE(s.ok());\n  ASSERT_EQ(\"bar\", Get(\"foo\"));\n}\n\nTEST(DBTest, FilesDeletedAfterCompaction) {\n  ASSERT_OK(Put(\"foo\", \"v2\"));\n  Compact(\"a\", \"z\");\n  const int num_files = CountFiles();\n  for (int i = 0; i < 10; i++) {\n    ASSERT_OK(Put(\"foo\", \"v2\"));\n    Compact(\"a\", \"z\");\n  }\n  ASSERT_EQ(CountFiles(), num_files);\n}\n\nTEST(DBTest, BloomFilter) {\n  env_->count_random_reads_ = true;\n  Options options = CurrentOptions();\n  options.env = env_;\n  options.block_cache = NewLRUCache(0);  // Prevent cache hits\n  options.filter_policy = NewBloomFilterPolicy(10);\n  Reopen(&options);\n\n  // Populate multiple layers\n  const int N = 10000;\n  for (int i = 0; i < N; i++) {\n    ASSERT_OK(Put(Key(i), Key(i)));\n  }\n  Compact(\"a\", \"z\");\n  for (int i = 0; i < N; i += 100) {\n    ASSERT_OK(Put(Key(i), Key(i)));\n  }\n  dbfull()->TEST_CompactMemTable();\n\n  // Prevent auto compactions triggered by seeks\n  env_->delay_data_sync_.Release_Store(env_);\n\n  // Lookup present keys.  Should rarely read from small sstable.\n  env_->random_read_counter_.Reset();\n  for (int i = 0; i < N; i++) {\n    ASSERT_EQ(Key(i), Get(Key(i)));\n  }\n  int reads = env_->random_read_counter_.Read();\n  fprintf(stderr, \"%d present => %d reads\\n\", N, reads);\n  ASSERT_GE(reads, N);\n  ASSERT_LE(reads, N + 2*N/100);\n\n  // Lookup present keys.  Should rarely read from either sstable.\n  env_->random_read_counter_.Reset();\n  for (int i = 0; i < N; i++) {\n    ASSERT_EQ(\"NOT_FOUND\", Get(Key(i) + \".missing\"));\n  }\n  reads = env_->random_read_counter_.Read();\n  fprintf(stderr, \"%d missing => %d reads\\n\", N, reads);\n  ASSERT_LE(reads, 3*N/100);\n\n  env_->delay_data_sync_.Release_Store(NULL);\n  Close();\n  delete options.block_cache;\n  delete options.filter_policy;\n}\n\n// Multi-threaded test:\nnamespace {\n\nstatic const int kNumThreads = 4;\nstatic const int kTestSeconds = 10;\nstatic const int kNumKeys = 1000;\n\nstruct MTState {\n  DBTest* test;\n  port::AtomicPointer stop;\n  port::AtomicPointer counter[kNumThreads];\n  port::AtomicPointer thread_done[kNumThreads];\n};\n\nstruct MTThread {\n  MTState* state;\n  int id;\n};\n\nstatic void MTThreadBody(void* arg) {\n  MTThread* t = reinterpret_cast<MTThread*>(arg);\n  int id = t->id;\n  DB* db = t->state->test->db_;\n  uintptr_t counter = 0;\n  fprintf(stderr, \"... starting thread %d\\n\", id);\n  Random rnd(1000 + id);\n  std::string value;\n  char valbuf[1500];\n  while (t->state->stop.Acquire_Load() == NULL) {\n    t->state->counter[id].Release_Store(reinterpret_cast<void*>(counter));\n\n    int key = rnd.Uniform(kNumKeys);\n    char keybuf[20];\n    snprintf(keybuf, sizeof(keybuf), \"%016d\", key);\n\n    if (rnd.OneIn(2)) {\n      // Write values of the form <key, my id, counter>.\n      // We add some padding for force compactions.\n      snprintf(valbuf, sizeof(valbuf), \"%d.%d.%-1000d\",\n               key, id, static_cast<int>(counter));\n      ASSERT_OK(db->Put(WriteOptions(), Slice(keybuf), Slice(valbuf)));\n    } else {\n      // Read a value and verify that it matches the pattern written above.\n      Status s = db->Get(ReadOptions(), Slice(keybuf), &value);\n      if (s.IsNotFound()) {\n        // Key has not yet been written\n      } else {\n        // Check that the writer thread counter is >= the counter in the value\n        ASSERT_OK(s);\n        int k, w, c;\n        ASSERT_EQ(3, sscanf(value.c_str(), \"%d.%d.%d\", &k, &w, &c)) << value;\n        ASSERT_EQ(k, key);\n        ASSERT_GE(w, 0);\n        ASSERT_LT(w, kNumThreads);\n        ASSERT_LE(static_cast<uintptr_t>(c), reinterpret_cast<uintptr_t>(\n            t->state->counter[w].Acquire_Load()));\n      }\n    }\n    counter++;\n  }\n  t->state->thread_done[id].Release_Store(t);\n  fprintf(stderr, \"... stopping thread %d after %d ops\\n\", id, int(counter));\n}\n\n}  // namespace\n\nTEST(DBTest, MultiThreaded) {\n  do {\n    // Initialize state\n    MTState mt;\n    mt.test = this;\n    mt.stop.Release_Store(0);\n    for (int id = 0; id < kNumThreads; id++) {\n      mt.counter[id].Release_Store(0);\n      mt.thread_done[id].Release_Store(0);\n    }\n\n    // Start threads\n    MTThread thread[kNumThreads];\n    for (int id = 0; id < kNumThreads; id++) {\n      thread[id].state = &mt;\n      thread[id].id = id;\n      env_->StartThread(MTThreadBody, &thread[id]);\n    }\n\n    // Let them run for a while\n    DelayMilliseconds(kTestSeconds * 1000);\n\n    // Stop the threads and wait for them to finish\n    mt.stop.Release_Store(&mt);\n    for (int id = 0; id < kNumThreads; id++) {\n      while (mt.thread_done[id].Acquire_Load() == NULL) {\n        DelayMilliseconds(100);\n      }\n    }\n  } while (ChangeOptions());\n}\n\nnamespace {\ntypedef std::map<std::string, std::string> KVMap;\n}\n\nclass ModelDB: public DB {\n public:\n  class ModelSnapshot : public Snapshot {\n   public:\n    KVMap map_;\n  };\n\n  explicit ModelDB(const Options& options): options_(options) { }\n  ~ModelDB() { }\n  virtual Status Put(const WriteOptions& o, const Slice& k, const Slice& v) {\n    return DB::Put(o, k, v);\n  }\n  virtual Status Delete(const WriteOptions& o, const Slice& key) {\n    return DB::Delete(o, key);\n  }\n  virtual Status Get(const ReadOptions& options,\n                     const Slice& key, std::string* value) {\n    assert(false);      // Not implemented\n    return Status::NotFound(key);\n  }\n  virtual Iterator* NewIterator(const ReadOptions& options) {\n    if (options.snapshot == NULL) {\n      KVMap* saved = new KVMap;\n      *saved = map_;\n      return new ModelIter(saved, true);\n    } else {\n      const KVMap* snapshot_state =\n          &(reinterpret_cast<const ModelSnapshot*>(options.snapshot)->map_);\n      return new ModelIter(snapshot_state, false);\n    }\n  }\n  virtual const Snapshot* GetSnapshot() {\n    ModelSnapshot* snapshot = new ModelSnapshot;\n    snapshot->map_ = map_;\n    return snapshot;\n  }\n\n  virtual void ReleaseSnapshot(const Snapshot* snapshot) {\n    delete reinterpret_cast<const ModelSnapshot*>(snapshot);\n  }\n  virtual Status Write(const WriteOptions& options, WriteBatch* batch) {\n    class Handler : public WriteBatch::Handler {\n     public:\n      KVMap* map_;\n      virtual void Put(const Slice& key, const Slice& value) {\n        (*map_)[key.ToString()] = value.ToString();\n      }\n      virtual void Delete(const Slice& key) {\n        map_->erase(key.ToString());\n      }\n    };\n    Handler handler;\n    handler.map_ = &map_;\n    return batch->Iterate(&handler);\n  }\n\n  virtual bool GetProperty(const Slice& property, std::string* value) {\n    return false;\n  }\n  virtual void GetApproximateSizes(const Range* r, int n, uint64_t* sizes) {\n    for (int i = 0; i < n; i++) {\n      sizes[i] = 0;\n    }\n  }\n  virtual void CompactRange(const Slice* start, const Slice* end) {\n  }\n\n private:\n  class ModelIter: public Iterator {\n   public:\n    ModelIter(const KVMap* map, bool owned)\n        : map_(map), owned_(owned), iter_(map_->end()) {\n    }\n    ~ModelIter() {\n      if (owned_) delete map_;\n    }\n    virtual bool Valid() const { return iter_ != map_->end(); }\n    virtual void SeekToFirst() { iter_ = map_->begin(); }\n    virtual void SeekToLast() {\n      if (map_->empty()) {\n        iter_ = map_->end();\n      } else {\n        iter_ = map_->find(map_->rbegin()->first);\n      }\n    }\n    virtual void Seek(const Slice& k) {\n      iter_ = map_->lower_bound(k.ToString());\n    }\n    virtual void Next() { ++iter_; }\n    virtual void Prev() { --iter_; }\n    virtual Slice key() const { return iter_->first; }\n    virtual Slice value() const { return iter_->second; }\n    virtual Status status() const { return Status::OK(); }\n   private:\n    const KVMap* const map_;\n    const bool owned_;  // Do we own map_\n    KVMap::const_iterator iter_;\n  };\n  const Options options_;\n  KVMap map_;\n};\n\nstatic std::string RandomKey(Random* rnd) {\n  int len = (rnd->OneIn(3)\n             ? 1                // Short sometimes to encourage collisions\n             : (rnd->OneIn(100) ? rnd->Skewed(10) : rnd->Uniform(10)));\n  return test::RandomKey(rnd, len);\n}\n\nstatic bool CompareIterators(int step,\n                             DB* model,\n                             DB* db,\n                             const Snapshot* model_snap,\n                             const Snapshot* db_snap) {\n  ReadOptions options;\n  options.snapshot = model_snap;\n  Iterator* miter = model->NewIterator(options);\n  options.snapshot = db_snap;\n  Iterator* dbiter = db->NewIterator(options);\n  bool ok = true;\n  int count = 0;\n  for (miter->SeekToFirst(), dbiter->SeekToFirst();\n       ok && miter->Valid() && dbiter->Valid();\n       miter->Next(), dbiter->Next()) {\n    count++;\n    if (miter->key().compare(dbiter->key()) != 0) {\n      fprintf(stderr, \"step %d: Key mismatch: '%s' vs. '%s'\\n\",\n              step,\n              EscapeString(miter->key()).c_str(),\n              EscapeString(dbiter->key()).c_str());\n      ok = false;\n      break;\n    }\n\n    if (miter->value().compare(dbiter->value()) != 0) {\n      fprintf(stderr, \"step %d: Value mismatch for key '%s': '%s' vs. '%s'\\n\",\n              step,\n              EscapeString(miter->key()).c_str(),\n              EscapeString(miter->value()).c_str(),\n              EscapeString(miter->value()).c_str());\n      ok = false;\n    }\n  }\n\n  if (ok) {\n    if (miter->Valid() != dbiter->Valid()) {\n      fprintf(stderr, \"step %d: Mismatch at end of iterators: %d vs. %d\\n\",\n              step, miter->Valid(), dbiter->Valid());\n      ok = false;\n    }\n  }\n  fprintf(stderr, \"%d entries compared: ok=%d\\n\", count, ok);\n  delete miter;\n  delete dbiter;\n  return ok;\n}\n\nTEST(DBTest, Randomized) {\n  Random rnd(test::RandomSeed());\n  do {\n    ModelDB model(CurrentOptions());\n    const int N = 10000;\n    const Snapshot* model_snap = NULL;\n    const Snapshot* db_snap = NULL;\n    std::string k, v;\n    for (int step = 0; step < N; step++) {\n      if (step % 100 == 0) {\n        fprintf(stderr, \"Step %d of %d\\n\", step, N);\n      }\n      // TODO(sanjay): Test Get() works\n      int p = rnd.Uniform(100);\n      if (p < 45) {                               // Put\n        k = RandomKey(&rnd);\n        v = RandomString(&rnd,\n                         rnd.OneIn(20)\n                         ? 100 + rnd.Uniform(100)\n                         : rnd.Uniform(8));\n        ASSERT_OK(model.Put(WriteOptions(), k, v));\n        ASSERT_OK(db_->Put(WriteOptions(), k, v));\n\n      } else if (p < 90) {                        // Delete\n        k = RandomKey(&rnd);\n        ASSERT_OK(model.Delete(WriteOptions(), k));\n        ASSERT_OK(db_->Delete(WriteOptions(), k));\n\n\n      } else {                                    // Multi-element batch\n        WriteBatch b;\n        const int num = rnd.Uniform(8);\n        for (int i = 0; i < num; i++) {\n          if (i == 0 || !rnd.OneIn(10)) {\n            k = RandomKey(&rnd);\n          } else {\n            // Periodically re-use the same key from the previous iter, so\n            // we have multiple entries in the write batch for the same key\n          }\n          if (rnd.OneIn(2)) {\n            v = RandomString(&rnd, rnd.Uniform(10));\n            b.Put(k, v);\n          } else {\n            b.Delete(k);\n          }\n        }\n        ASSERT_OK(model.Write(WriteOptions(), &b));\n        ASSERT_OK(db_->Write(WriteOptions(), &b));\n      }\n\n      if ((step % 100) == 0) {\n        ASSERT_TRUE(CompareIterators(step, &model, db_, NULL, NULL));\n        ASSERT_TRUE(CompareIterators(step, &model, db_, model_snap, db_snap));\n        // Save a snapshot from each DB this time that we'll use next\n        // time we compare things, to make sure the current state is\n        // preserved with the snapshot\n        if (model_snap != NULL) model.ReleaseSnapshot(model_snap);\n        if (db_snap != NULL) db_->ReleaseSnapshot(db_snap);\n\n        Reopen();\n        ASSERT_TRUE(CompareIterators(step, &model, db_, NULL, NULL));\n\n        model_snap = model.GetSnapshot();\n        db_snap = db_->GetSnapshot();\n      }\n    }\n    if (model_snap != NULL) model.ReleaseSnapshot(model_snap);\n    if (db_snap != NULL) db_->ReleaseSnapshot(db_snap);\n  } while (ChangeOptions());\n}\n\nstd::string MakeKey(unsigned int num) {\n  char buf[30];\n  snprintf(buf, sizeof(buf), \"%016u\", num);\n  return std::string(buf);\n}\n\nvoid BM_LogAndApply(int iters, int num_base_files) {\n  std::string dbname = test::TmpDir() + \"/leveldb_test_benchmark\";\n  DestroyDB(dbname, Options());\n\n  DB* db = NULL;\n  Options opts;\n  opts.create_if_missing = true;\n  Status s = DB::Open(opts, dbname, &db);\n  ASSERT_OK(s);\n  ASSERT_TRUE(db != NULL);\n\n  delete db;\n  db = NULL;\n\n  Env* env = Env::Default();\n\n  port::Mutex mu;\n  MutexLock l(&mu);\n\n  InternalKeyComparator cmp(BytewiseComparator());\n  Options options;\n  VersionSet vset(dbname, &options, NULL, &cmp);\n  bool save_manifest;\n  ASSERT_OK(vset.Recover(&save_manifest));\n  VersionEdit vbase;\n  uint64_t fnum = 1;\n  for (int i = 0; i < num_base_files; i++) {\n    InternalKey start(MakeKey(2*fnum), 1, kTypeValue);\n    InternalKey limit(MakeKey(2*fnum+1), 1, kTypeDeletion);\n    vbase.AddFile(2, fnum++, 1 /* file size */, start, limit);\n  }\n  ASSERT_OK(vset.LogAndApply(&vbase, &mu));\n\n  uint64_t start_micros = env->NowMicros();\n\n  for (int i = 0; i < iters; i++) {\n    VersionEdit vedit;\n    vedit.DeleteFile(2, fnum);\n    InternalKey start(MakeKey(2*fnum), 1, kTypeValue);\n    InternalKey limit(MakeKey(2*fnum+1), 1, kTypeDeletion);\n    vedit.AddFile(2, fnum++, 1 /* file size */, start, limit);\n    vset.LogAndApply(&vedit, &mu);\n  }\n  uint64_t stop_micros = env->NowMicros();\n  unsigned int us = stop_micros - start_micros;\n  char buf[16];\n  snprintf(buf, sizeof(buf), \"%d\", num_base_files);\n  fprintf(stderr,\n          \"BM_LogAndApply/%-6s   %8d iters : %9u us (%7.0f us / iter)\\n\",\n          buf, iters, us, ((float)us) / iters);\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  if (argc > 1 && std::string(argv[1]) == \"--benchmark\") {\n    leveldb::BM_LogAndApply(1000, 1);\n    leveldb::BM_LogAndApply(1000, 100);\n    leveldb::BM_LogAndApply(1000, 10000);\n    leveldb::BM_LogAndApply(100, 100000);\n    return 0;\n  }\n\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/dbformat.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <stdio.h>\n#include \"db/dbformat.h\"\n#include \"port/port.h\"\n#include \"util/coding.h\"\n\nnamespace leveldb {\n\nstatic uint64_t PackSequenceAndType(uint64_t seq, ValueType t) {\n  assert(seq <= kMaxSequenceNumber);\n  assert(t <= kValueTypeForSeek);\n  return (seq << 8) | t;\n}\n\nvoid AppendInternalKey(std::string* result, const ParsedInternalKey& key) {\n  result->append(key.user_key.data(), key.user_key.size());\n  PutFixed64(result, PackSequenceAndType(key.sequence, key.type));\n}\n\nstd::string ParsedInternalKey::DebugString() const {\n  char buf[50];\n  snprintf(buf, sizeof(buf), \"' @ %llu : %d\",\n           (unsigned long long) sequence,\n           int(type));\n  std::string result = \"'\";\n  result += EscapeString(user_key.ToString());\n  result += buf;\n  return result;\n}\n\nstd::string InternalKey::DebugString() const {\n  std::string result;\n  ParsedInternalKey parsed;\n  if (ParseInternalKey(rep_, &parsed)) {\n    result = parsed.DebugString();\n  } else {\n    result = \"(bad)\";\n    result.append(EscapeString(rep_));\n  }\n  return result;\n}\n\nconst char* InternalKeyComparator::Name() const {\n  return \"leveldb.InternalKeyComparator\";\n}\n\nint InternalKeyComparator::Compare(const Slice& akey, const Slice& bkey) const {\n  // Order by:\n  //    increasing user key (according to user-supplied comparator)\n  //    decreasing sequence number\n  //    decreasing type (though sequence# should be enough to disambiguate)\n  int r = user_comparator_->Compare(ExtractUserKey(akey), ExtractUserKey(bkey));\n  if (r == 0) {\n    const uint64_t anum = DecodeFixed64(akey.data() + akey.size() - 8);\n    const uint64_t bnum = DecodeFixed64(bkey.data() + bkey.size() - 8);\n    if (anum > bnum) {\n      r = -1;\n    } else if (anum < bnum) {\n      r = +1;\n    }\n  }\n  return r;\n}\n\nvoid InternalKeyComparator::FindShortestSeparator(\n      std::string* start,\n      const Slice& limit) const {\n  // Attempt to shorten the user portion of the key\n  Slice user_start = ExtractUserKey(*start);\n  Slice user_limit = ExtractUserKey(limit);\n  std::string tmp(user_start.data(), user_start.size());\n  user_comparator_->FindShortestSeparator(&tmp, user_limit);\n  if (tmp.size() < user_start.size() &&\n      user_comparator_->Compare(user_start, tmp) < 0) {\n    // User key has become shorter physically, but larger logically.\n    // Tack on the earliest possible number to the shortened user key.\n    PutFixed64(&tmp, PackSequenceAndType(kMaxSequenceNumber,kValueTypeForSeek));\n    assert(this->Compare(*start, tmp) < 0);\n    assert(this->Compare(tmp, limit) < 0);\n    start->swap(tmp);\n  }\n}\n\nvoid InternalKeyComparator::FindShortSuccessor(std::string* key) const {\n  Slice user_key = ExtractUserKey(*key);\n  std::string tmp(user_key.data(), user_key.size());\n  user_comparator_->FindShortSuccessor(&tmp);\n  if (tmp.size() < user_key.size() &&\n      user_comparator_->Compare(user_key, tmp) < 0) {\n    // User key has become shorter physically, but larger logically.\n    // Tack on the earliest possible number to the shortened user key.\n    PutFixed64(&tmp, PackSequenceAndType(kMaxSequenceNumber,kValueTypeForSeek));\n    assert(this->Compare(*key, tmp) < 0);\n    key->swap(tmp);\n  }\n}\n\nconst char* InternalFilterPolicy::Name() const {\n  return user_policy_->Name();\n}\n\nvoid InternalFilterPolicy::CreateFilter(const Slice* keys, int n,\n                                        std::string* dst) const {\n  // We rely on the fact that the code in table.cc does not mind us\n  // adjusting keys[].\n  Slice* mkey = const_cast<Slice*>(keys);\n  for (int i = 0; i < n; i++) {\n    mkey[i] = ExtractUserKey(keys[i]);\n    // TODO(sanjay): Suppress dups?\n  }\n  user_policy_->CreateFilter(keys, n, dst);\n}\n\nbool InternalFilterPolicy::KeyMayMatch(const Slice& key, const Slice& f) const {\n  return user_policy_->KeyMayMatch(ExtractUserKey(key), f);\n}\n\nLookupKey::LookupKey(const Slice& user_key, SequenceNumber s) {\n  size_t usize = user_key.size();\n  size_t needed = usize + 13;  // A conservative estimate\n  char* dst;\n  if (needed <= sizeof(space_)) {\n    dst = space_;\n  } else {\n    dst = new char[needed];\n  }\n  start_ = dst;\n  dst = EncodeVarint32(dst, usize + 8);\n  kstart_ = dst;\n  memcpy(dst, user_key.data(), usize);\n  dst += usize;\n  EncodeFixed64(dst, PackSequenceAndType(s, kValueTypeForSeek));\n  dst += 8;\n  end_ = dst;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/dbformat.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_DBFORMAT_H_\n#define STORAGE_LEVELDB_DB_DBFORMAT_H_\n\n#include <stdio.h>\n#include \"leveldb/comparator.h\"\n#include \"leveldb/db.h\"\n#include \"leveldb/filter_policy.h\"\n#include \"leveldb/slice.h\"\n#include \"leveldb/table_builder.h\"\n#include \"util/coding.h\"\n#include \"util/logging.h\"\n\nnamespace leveldb {\n\n// Grouping of constants.  We may want to make some of these\n// parameters set via options.\nnamespace config {\nstatic const int kNumLevels = 7;\n\n// Level-0 compaction is started when we hit this many files.\nstatic const int kL0_CompactionTrigger = 4;\n\n// Soft limit on number of level-0 files.  We slow down writes at this point.\nstatic const int kL0_SlowdownWritesTrigger = 8;\n\n// Maximum number of level-0 files.  We stop writes at this point.\nstatic const int kL0_StopWritesTrigger = 12;\n\n// Maximum level to which a new compacted memtable is pushed if it\n// does not create overlap.  We try to push to level 2 to avoid the\n// relatively expensive level 0=>1 compactions and to avoid some\n// expensive manifest file operations.  We do not push all the way to\n// the largest level since that can generate a lot of wasted disk\n// space if the same key space is being repeatedly overwritten.\nstatic const int kMaxMemCompactLevel = 2;\n\n// Approximate gap in bytes between samples of data read during iteration.\nstatic const int kReadBytesPeriod = 1048576;\n\n}  // namespace config\n\nclass InternalKey;\n\n// Value types encoded as the last component of internal keys.\n// DO NOT CHANGE THESE ENUM VALUES: they are embedded in the on-disk\n// data structures.\nenum ValueType {\n  kTypeDeletion = 0x0,\n  kTypeValue = 0x1\n};\n// kValueTypeForSeek defines the ValueType that should be passed when\n// constructing a ParsedInternalKey object for seeking to a particular\n// sequence number (since we sort sequence numbers in decreasing order\n// and the value type is embedded as the low 8 bits in the sequence\n// number in internal keys, we need to use the highest-numbered\n// ValueType, not the lowest).\nstatic const ValueType kValueTypeForSeek = kTypeValue;\n\ntypedef uint64_t SequenceNumber;\n\n// We leave eight bits empty at the bottom so a type and sequence#\n// can be packed together into 64-bits.\nstatic const SequenceNumber kMaxSequenceNumber =\n    ((0x1ull << 56) - 1);\n\nstruct ParsedInternalKey {\n  Slice user_key;\n  SequenceNumber sequence;\n  ValueType type;\n\n  ParsedInternalKey() { }  // Intentionally left uninitialized (for speed)\n  ParsedInternalKey(const Slice& u, const SequenceNumber& seq, ValueType t)\n      : user_key(u), sequence(seq), type(t) { }\n  std::string DebugString() const;\n};\n\n// Return the length of the encoding of \"key\".\ninline size_t InternalKeyEncodingLength(const ParsedInternalKey& key) {\n  return key.user_key.size() + 8;\n}\n\n// Append the serialization of \"key\" to *result.\nextern void AppendInternalKey(std::string* result,\n                              const ParsedInternalKey& key);\n\n// Attempt to parse an internal key from \"internal_key\".  On success,\n// stores the parsed data in \"*result\", and returns true.\n//\n// On error, returns false, leaves \"*result\" in an undefined state.\nextern bool ParseInternalKey(const Slice& internal_key,\n                             ParsedInternalKey* result);\n\n// Returns the user key portion of an internal key.\ninline Slice ExtractUserKey(const Slice& internal_key) {\n  assert(internal_key.size() >= 8);\n  return Slice(internal_key.data(), internal_key.size() - 8);\n}\n\ninline ValueType ExtractValueType(const Slice& internal_key) {\n  assert(internal_key.size() >= 8);\n  const size_t n = internal_key.size();\n  uint64_t num = DecodeFixed64(internal_key.data() + n - 8);\n  unsigned char c = num & 0xff;\n  return static_cast<ValueType>(c);\n}\n\n// A comparator for internal keys that uses a specified comparator for\n// the user key portion and breaks ties by decreasing sequence number.\nclass InternalKeyComparator : public Comparator {\n private:\n  const Comparator* user_comparator_;\n public:\n  explicit InternalKeyComparator(const Comparator* c) : user_comparator_(c) { }\n  virtual const char* Name() const;\n  virtual int Compare(const Slice& a, const Slice& b) const;\n  virtual void FindShortestSeparator(\n      std::string* start,\n      const Slice& limit) const;\n  virtual void FindShortSuccessor(std::string* key) const;\n\n  const Comparator* user_comparator() const { return user_comparator_; }\n\n  int Compare(const InternalKey& a, const InternalKey& b) const;\n};\n\n// Filter policy wrapper that converts from internal keys to user keys\nclass InternalFilterPolicy : public FilterPolicy {\n private:\n  const FilterPolicy* const user_policy_;\n public:\n  explicit InternalFilterPolicy(const FilterPolicy* p) : user_policy_(p) { }\n  virtual const char* Name() const;\n  virtual void CreateFilter(const Slice* keys, int n, std::string* dst) const;\n  virtual bool KeyMayMatch(const Slice& key, const Slice& filter) const;\n};\n\n// Modules in this directory should keep internal keys wrapped inside\n// the following class instead of plain strings so that we do not\n// incorrectly use string comparisons instead of an InternalKeyComparator.\nclass InternalKey {\n private:\n  std::string rep_;\n public:\n  InternalKey() { }   // Leave rep_ as empty to indicate it is invalid\n  InternalKey(const Slice& user_key, SequenceNumber s, ValueType t) {\n    AppendInternalKey(&rep_, ParsedInternalKey(user_key, s, t));\n  }\n\n  void DecodeFrom(const Slice& s) { rep_.assign(s.data(), s.size()); }\n  Slice Encode() const {\n    assert(!rep_.empty());\n    return rep_;\n  }\n\n  Slice user_key() const { return ExtractUserKey(rep_); }\n\n  void SetFrom(const ParsedInternalKey& p) {\n    rep_.clear();\n    AppendInternalKey(&rep_, p);\n  }\n\n  void Clear() { rep_.clear(); }\n\n  std::string DebugString() const;\n};\n\ninline int InternalKeyComparator::Compare(\n    const InternalKey& a, const InternalKey& b) const {\n  return Compare(a.Encode(), b.Encode());\n}\n\ninline bool ParseInternalKey(const Slice& internal_key,\n                             ParsedInternalKey* result) {\n  const size_t n = internal_key.size();\n  if (n < 8) return false;\n  uint64_t num = DecodeFixed64(internal_key.data() + n - 8);\n  unsigned char c = num & 0xff;\n  result->sequence = num >> 8;\n  result->type = static_cast<ValueType>(c);\n  result->user_key = Slice(internal_key.data(), n - 8);\n  return (c <= static_cast<unsigned char>(kTypeValue));\n}\n\n// A helper class useful for DBImpl::Get()\nclass LookupKey {\n public:\n  // Initialize *this for looking up user_key at a snapshot with\n  // the specified sequence number.\n  LookupKey(const Slice& user_key, SequenceNumber sequence);\n\n  ~LookupKey();\n\n  // Return a key suitable for lookup in a MemTable.\n  Slice memtable_key() const { return Slice(start_, end_ - start_); }\n\n  // Return an internal key (suitable for passing to an internal iterator)\n  Slice internal_key() const { return Slice(kstart_, end_ - kstart_); }\n\n  // Return the user key\n  Slice user_key() const { return Slice(kstart_, end_ - kstart_ - 8); }\n\n private:\n  // We construct a char array of the form:\n  //    klength  varint32               <-- start_\n  //    userkey  char[klength]          <-- kstart_\n  //    tag      uint64\n  //                                    <-- end_\n  // The array is a suitable MemTable key.\n  // The suffix starting with \"userkey\" can be used as an InternalKey.\n  const char* start_;\n  const char* kstart_;\n  const char* end_;\n  char space_[200];      // Avoid allocation for short keys\n\n  // No copying allowed\n  LookupKey(const LookupKey&);\n  void operator=(const LookupKey&);\n};\n\ninline LookupKey::~LookupKey() {\n  if (start_ != space_) delete[] start_;\n}\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_DBFORMAT_H_\n"
  },
  {
    "path": "src/leveldb/db/dbformat_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/dbformat.h\"\n#include \"util/logging.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\nstatic std::string IKey(const std::string& user_key,\n                        uint64_t seq,\n                        ValueType vt) {\n  std::string encoded;\n  AppendInternalKey(&encoded, ParsedInternalKey(user_key, seq, vt));\n  return encoded;\n}\n\nstatic std::string Shorten(const std::string& s, const std::string& l) {\n  std::string result = s;\n  InternalKeyComparator(BytewiseComparator()).FindShortestSeparator(&result, l);\n  return result;\n}\n\nstatic std::string ShortSuccessor(const std::string& s) {\n  std::string result = s;\n  InternalKeyComparator(BytewiseComparator()).FindShortSuccessor(&result);\n  return result;\n}\n\nstatic void TestKey(const std::string& key,\n                    uint64_t seq,\n                    ValueType vt) {\n  std::string encoded = IKey(key, seq, vt);\n\n  Slice in(encoded);\n  ParsedInternalKey decoded(\"\", 0, kTypeValue);\n\n  ASSERT_TRUE(ParseInternalKey(in, &decoded));\n  ASSERT_EQ(key, decoded.user_key.ToString());\n  ASSERT_EQ(seq, decoded.sequence);\n  ASSERT_EQ(vt, decoded.type);\n\n  ASSERT_TRUE(!ParseInternalKey(Slice(\"bar\"), &decoded));\n}\n\nclass FormatTest { };\n\nTEST(FormatTest, InternalKey_EncodeDecode) {\n  const char* keys[] = { \"\", \"k\", \"hello\", \"longggggggggggggggggggggg\" };\n  const uint64_t seq[] = {\n    1, 2, 3,\n    (1ull << 8) - 1, 1ull << 8, (1ull << 8) + 1,\n    (1ull << 16) - 1, 1ull << 16, (1ull << 16) + 1,\n    (1ull << 32) - 1, 1ull << 32, (1ull << 32) + 1\n  };\n  for (int k = 0; k < sizeof(keys) / sizeof(keys[0]); k++) {\n    for (int s = 0; s < sizeof(seq) / sizeof(seq[0]); s++) {\n      TestKey(keys[k], seq[s], kTypeValue);\n      TestKey(\"hello\", 1, kTypeDeletion);\n    }\n  }\n}\n\nTEST(FormatTest, InternalKeyShortSeparator) {\n  // When user keys are same\n  ASSERT_EQ(IKey(\"foo\", 100, kTypeValue),\n            Shorten(IKey(\"foo\", 100, kTypeValue),\n                    IKey(\"foo\", 99, kTypeValue)));\n  ASSERT_EQ(IKey(\"foo\", 100, kTypeValue),\n            Shorten(IKey(\"foo\", 100, kTypeValue),\n                    IKey(\"foo\", 101, kTypeValue)));\n  ASSERT_EQ(IKey(\"foo\", 100, kTypeValue),\n            Shorten(IKey(\"foo\", 100, kTypeValue),\n                    IKey(\"foo\", 100, kTypeValue)));\n  ASSERT_EQ(IKey(\"foo\", 100, kTypeValue),\n            Shorten(IKey(\"foo\", 100, kTypeValue),\n                    IKey(\"foo\", 100, kTypeDeletion)));\n\n  // When user keys are misordered\n  ASSERT_EQ(IKey(\"foo\", 100, kTypeValue),\n            Shorten(IKey(\"foo\", 100, kTypeValue),\n                    IKey(\"bar\", 99, kTypeValue)));\n\n  // When user keys are different, but correctly ordered\n  ASSERT_EQ(IKey(\"g\", kMaxSequenceNumber, kValueTypeForSeek),\n            Shorten(IKey(\"foo\", 100, kTypeValue),\n                    IKey(\"hello\", 200, kTypeValue)));\n\n  // When start user key is prefix of limit user key\n  ASSERT_EQ(IKey(\"foo\", 100, kTypeValue),\n            Shorten(IKey(\"foo\", 100, kTypeValue),\n                    IKey(\"foobar\", 200, kTypeValue)));\n\n  // When limit user key is prefix of start user key\n  ASSERT_EQ(IKey(\"foobar\", 100, kTypeValue),\n            Shorten(IKey(\"foobar\", 100, kTypeValue),\n                    IKey(\"foo\", 200, kTypeValue)));\n}\n\nTEST(FormatTest, InternalKeyShortestSuccessor) {\n  ASSERT_EQ(IKey(\"g\", kMaxSequenceNumber, kValueTypeForSeek),\n            ShortSuccessor(IKey(\"foo\", 100, kTypeValue)));\n  ASSERT_EQ(IKey(\"\\xff\\xff\", 100, kTypeValue),\n            ShortSuccessor(IKey(\"\\xff\\xff\", 100, kTypeValue)));\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/dumpfile.cc",
    "content": "// Copyright (c) 2012 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <stdio.h>\n#include \"db/dbformat.h\"\n#include \"db/filename.h\"\n#include \"db/log_reader.h\"\n#include \"db/version_edit.h\"\n#include \"db/write_batch_internal.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/iterator.h\"\n#include \"leveldb/options.h\"\n#include \"leveldb/status.h\"\n#include \"leveldb/table.h\"\n#include \"leveldb/write_batch.h\"\n#include \"util/logging.h\"\n\nnamespace leveldb {\n\nnamespace {\n\nbool GuessType(const std::string& fname, FileType* type) {\n  size_t pos = fname.rfind('/');\n  std::string basename;\n  if (pos == std::string::npos) {\n    basename = fname;\n  } else {\n    basename = std::string(fname.data() + pos + 1, fname.size() - pos - 1);\n  }\n  uint64_t ignored;\n  return ParseFileName(basename, &ignored, type);\n}\n\n// Notified when log reader encounters corruption.\nclass CorruptionReporter : public log::Reader::Reporter {\n public:\n  WritableFile* dst_;\n  virtual void Corruption(size_t bytes, const Status& status) {\n    std::string r = \"corruption: \";\n    AppendNumberTo(&r, bytes);\n    r += \" bytes; \";\n    r += status.ToString();\n    r.push_back('\\n');\n    dst_->Append(r);\n  }\n};\n\n// Print contents of a log file. (*func)() is called on every record.\nStatus PrintLogContents(Env* env, const std::string& fname,\n                        void (*func)(uint64_t, Slice, WritableFile*),\n                        WritableFile* dst) {\n  SequentialFile* file;\n  Status s = env->NewSequentialFile(fname, &file);\n  if (!s.ok()) {\n    return s;\n  }\n  CorruptionReporter reporter;\n  reporter.dst_ = dst;\n  log::Reader reader(file, &reporter, true, 0);\n  Slice record;\n  std::string scratch;\n  while (reader.ReadRecord(&record, &scratch)) {\n    (*func)(reader.LastRecordOffset(), record, dst);\n  }\n  delete file;\n  return Status::OK();\n}\n\n// Called on every item found in a WriteBatch.\nclass WriteBatchItemPrinter : public WriteBatch::Handler {\n public:\n  WritableFile* dst_;\n  virtual void Put(const Slice& key, const Slice& value) {\n    std::string r = \"  put '\";\n    AppendEscapedStringTo(&r, key);\n    r += \"' '\";\n    AppendEscapedStringTo(&r, value);\n    r += \"'\\n\";\n    dst_->Append(r);\n  }\n  virtual void Delete(const Slice& key) {\n    std::string r = \"  del '\";\n    AppendEscapedStringTo(&r, key);\n    r += \"'\\n\";\n    dst_->Append(r);\n  }\n};\n\n\n// Called on every log record (each one of which is a WriteBatch)\n// found in a kLogFile.\nstatic void WriteBatchPrinter(uint64_t pos, Slice record, WritableFile* dst) {\n  std::string r = \"--- offset \";\n  AppendNumberTo(&r, pos);\n  r += \"; \";\n  if (record.size() < 12) {\n    r += \"log record length \";\n    AppendNumberTo(&r, record.size());\n    r += \" is too small\\n\";\n    dst->Append(r);\n    return;\n  }\n  WriteBatch batch;\n  WriteBatchInternal::SetContents(&batch, record);\n  r += \"sequence \";\n  AppendNumberTo(&r, WriteBatchInternal::Sequence(&batch));\n  r.push_back('\\n');\n  dst->Append(r);\n  WriteBatchItemPrinter batch_item_printer;\n  batch_item_printer.dst_ = dst;\n  Status s = batch.Iterate(&batch_item_printer);\n  if (!s.ok()) {\n    dst->Append(\"  error: \" + s.ToString() + \"\\n\");\n  }\n}\n\nStatus DumpLog(Env* env, const std::string& fname, WritableFile* dst) {\n  return PrintLogContents(env, fname, WriteBatchPrinter, dst);\n}\n\n// Called on every log record (each one of which is a WriteBatch)\n// found in a kDescriptorFile.\nstatic void VersionEditPrinter(uint64_t pos, Slice record, WritableFile* dst) {\n  std::string r = \"--- offset \";\n  AppendNumberTo(&r, pos);\n  r += \"; \";\n  VersionEdit edit;\n  Status s = edit.DecodeFrom(record);\n  if (!s.ok()) {\n    r += s.ToString();\n    r.push_back('\\n');\n  } else {\n    r += edit.DebugString();\n  }\n  dst->Append(r);\n}\n\nStatus DumpDescriptor(Env* env, const std::string& fname, WritableFile* dst) {\n  return PrintLogContents(env, fname, VersionEditPrinter, dst);\n}\n\nStatus DumpTable(Env* env, const std::string& fname, WritableFile* dst) {\n  uint64_t file_size;\n  RandomAccessFile* file = NULL;\n  Table* table = NULL;\n  Status s = env->GetFileSize(fname, &file_size);\n  if (s.ok()) {\n    s = env->NewRandomAccessFile(fname, &file);\n  }\n  if (s.ok()) {\n    // We use the default comparator, which may or may not match the\n    // comparator used in this database. However this should not cause\n    // problems since we only use Table operations that do not require\n    // any comparisons.  In particular, we do not call Seek or Prev.\n    s = Table::Open(Options(), file, file_size, &table);\n  }\n  if (!s.ok()) {\n    delete table;\n    delete file;\n    return s;\n  }\n\n  ReadOptions ro;\n  ro.fill_cache = false;\n  Iterator* iter = table->NewIterator(ro);\n  std::string r;\n  for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {\n    r.clear();\n    ParsedInternalKey key;\n    if (!ParseInternalKey(iter->key(), &key)) {\n      r = \"badkey '\";\n      AppendEscapedStringTo(&r, iter->key());\n      r += \"' => '\";\n      AppendEscapedStringTo(&r, iter->value());\n      r += \"'\\n\";\n      dst->Append(r);\n    } else {\n      r = \"'\";\n      AppendEscapedStringTo(&r, key.user_key);\n      r += \"' @ \";\n      AppendNumberTo(&r, key.sequence);\n      r += \" : \";\n      if (key.type == kTypeDeletion) {\n        r += \"del\";\n      } else if (key.type == kTypeValue) {\n        r += \"val\";\n      } else {\n        AppendNumberTo(&r, key.type);\n      }\n      r += \" => '\";\n      AppendEscapedStringTo(&r, iter->value());\n      r += \"'\\n\";\n      dst->Append(r);\n    }\n  }\n  s = iter->status();\n  if (!s.ok()) {\n    dst->Append(\"iterator error: \" + s.ToString() + \"\\n\");\n  }\n\n  delete iter;\n  delete table;\n  delete file;\n  return Status::OK();\n}\n\n}  // namespace\n\nStatus DumpFile(Env* env, const std::string& fname, WritableFile* dst) {\n  FileType ftype;\n  if (!GuessType(fname, &ftype)) {\n    return Status::InvalidArgument(fname + \": unknown file type\");\n  }\n  switch (ftype) {\n    case kLogFile:         return DumpLog(env, fname, dst);\n    case kDescriptorFile:  return DumpDescriptor(env, fname, dst);\n    case kTableFile:       return DumpTable(env, fname, dst);\n    default:\n      break;\n  }\n  return Status::InvalidArgument(fname + \": not a dump-able file type\");\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/fault_injection_test.cc",
    "content": "// Copyright 2014 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n// This test uses a custom Env to keep track of the state of a filesystem as of\n// the last \"sync\". It then checks for data loss errors by purposely dropping\n// file data (or entire files) not protected by a \"sync\".\n\n#include \"leveldb/db.h\"\n\n#include <map>\n#include <set>\n#include \"db/db_impl.h\"\n#include \"db/filename.h\"\n#include \"db/log_format.h\"\n#include \"db/version_set.h\"\n#include \"leveldb/cache.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/table.h\"\n#include \"leveldb/write_batch.h\"\n#include \"util/logging.h\"\n#include \"util/mutexlock.h\"\n#include \"util/testharness.h\"\n#include \"util/testutil.h\"\n\nnamespace leveldb {\n\nstatic const int kValueSize = 1000;\nstatic const int kMaxNumValues = 2000;\nstatic const size_t kNumIterations = 3;\n\nclass FaultInjectionTestEnv;\n\nnamespace {\n\n// Assume a filename, and not a directory name like \"/foo/bar/\"\nstatic std::string GetDirName(const std::string filename) {\n  size_t found = filename.find_last_of(\"/\\\\\");\n  if (found == std::string::npos) {\n    return \"\";\n  } else {\n    return filename.substr(0, found);\n  }\n}\n\nStatus SyncDir(const std::string& dir) {\n  // As this is a test it isn't required to *actually* sync this directory.\n  return Status::OK();\n}\n\n// A basic file truncation function suitable for this test.\nStatus Truncate(const std::string& filename, uint64_t length) {\n  leveldb::Env* env = leveldb::Env::Default();\n\n  SequentialFile* orig_file;\n  Status s = env->NewSequentialFile(filename, &orig_file);\n  if (!s.ok())\n    return s;\n\n  char* scratch = new char[length];\n  leveldb::Slice result;\n  s = orig_file->Read(length, &result, scratch);\n  delete orig_file;\n  if (s.ok()) {\n    std::string tmp_name = GetDirName(filename) + \"/truncate.tmp\";\n    WritableFile* tmp_file;\n    s = env->NewWritableFile(tmp_name, &tmp_file);\n    if (s.ok()) {\n      s = tmp_file->Append(result);\n      delete tmp_file;\n      if (s.ok()) {\n        s = env->RenameFile(tmp_name, filename);\n      } else {\n        env->DeleteFile(tmp_name);\n      }\n    }\n  }\n\n  delete[] scratch;\n\n  return s;\n}\n\nstruct FileState {\n  std::string filename_;\n  ssize_t pos_;\n  ssize_t pos_at_last_sync_;\n  ssize_t pos_at_last_flush_;\n\n  FileState(const std::string& filename)\n      : filename_(filename),\n        pos_(-1),\n        pos_at_last_sync_(-1),\n        pos_at_last_flush_(-1) { }\n\n  FileState() : pos_(-1), pos_at_last_sync_(-1), pos_at_last_flush_(-1) {}\n\n  bool IsFullySynced() const { return pos_ <= 0 || pos_ == pos_at_last_sync_; }\n\n  Status DropUnsyncedData() const;\n};\n\n}  // anonymous namespace\n\n// A wrapper around WritableFile which informs another Env whenever this file\n// is written to or sync'ed.\nclass TestWritableFile : public WritableFile {\n public:\n  TestWritableFile(const FileState& state,\n                   WritableFile* f,\n                   FaultInjectionTestEnv* env);\n  virtual ~TestWritableFile();\n  virtual Status Append(const Slice& data);\n  virtual Status Close();\n  virtual Status Flush();\n  virtual Status Sync();\n\n private:\n  FileState state_;\n  WritableFile* target_;\n  bool writable_file_opened_;\n  FaultInjectionTestEnv* env_;\n\n  Status SyncParent();\n};\n\nclass FaultInjectionTestEnv : public EnvWrapper {\n public:\n  FaultInjectionTestEnv() : EnvWrapper(Env::Default()), filesystem_active_(true) {}\n  virtual ~FaultInjectionTestEnv() { }\n  virtual Status NewWritableFile(const std::string& fname,\n                                 WritableFile** result);\n  virtual Status NewAppendableFile(const std::string& fname,\n                                   WritableFile** result);\n  virtual Status DeleteFile(const std::string& f);\n  virtual Status RenameFile(const std::string& s, const std::string& t);\n\n  void WritableFileClosed(const FileState& state);\n  Status DropUnsyncedFileData();\n  Status DeleteFilesCreatedAfterLastDirSync();\n  void DirWasSynced();\n  bool IsFileCreatedSinceLastDirSync(const std::string& filename);\n  void ResetState();\n  void UntrackFile(const std::string& f);\n  // Setting the filesystem to inactive is the test equivalent to simulating a\n  // system reset. Setting to inactive will freeze our saved filesystem state so\n  // that it will stop being recorded. It can then be reset back to the state at\n  // the time of the reset.\n  bool IsFilesystemActive() const { return filesystem_active_; }\n  void SetFilesystemActive(bool active) { filesystem_active_ = active; }\n\n private:\n  port::Mutex mutex_;\n  std::map<std::string, FileState> db_file_state_;\n  std::set<std::string> new_files_since_last_dir_sync_;\n  bool filesystem_active_;  // Record flushes, syncs, writes\n};\n\nTestWritableFile::TestWritableFile(const FileState& state,\n                                   WritableFile* f,\n                                   FaultInjectionTestEnv* env)\n    : state_(state),\n      target_(f),\n      writable_file_opened_(true),\n      env_(env) {\n  assert(f != NULL);\n}\n\nTestWritableFile::~TestWritableFile() {\n  if (writable_file_opened_) {\n    Close();\n  }\n  delete target_;\n}\n\nStatus TestWritableFile::Append(const Slice& data) {\n  Status s = target_->Append(data);\n  if (s.ok() && env_->IsFilesystemActive()) {\n    state_.pos_ += data.size();\n  }\n  return s;\n}\n\nStatus TestWritableFile::Close() {\n  writable_file_opened_ = false;\n  Status s = target_->Close();\n  if (s.ok()) {\n    env_->WritableFileClosed(state_);\n  }\n  return s;\n}\n\nStatus TestWritableFile::Flush() {\n  Status s = target_->Flush();\n  if (s.ok() && env_->IsFilesystemActive()) {\n    state_.pos_at_last_flush_ = state_.pos_;\n  }\n  return s;\n}\n\nStatus TestWritableFile::SyncParent() {\n  Status s = SyncDir(GetDirName(state_.filename_));\n  if (s.ok()) {\n    env_->DirWasSynced();\n  }\n  return s;\n}\n\nStatus TestWritableFile::Sync() {\n  if (!env_->IsFilesystemActive()) {\n    return Status::OK();\n  }\n  // Ensure new files referred to by the manifest are in the filesystem.\n  Status s = target_->Sync();\n  if (s.ok()) {\n    state_.pos_at_last_sync_ = state_.pos_;\n  }\n  if (env_->IsFileCreatedSinceLastDirSync(state_.filename_)) {\n    Status ps = SyncParent();\n    if (s.ok() && !ps.ok()) {\n      s = ps;\n    }\n  }\n  return s;\n}\n\nStatus FaultInjectionTestEnv::NewWritableFile(const std::string& fname,\n                                              WritableFile** result) {\n  WritableFile* actual_writable_file;\n  Status s = target()->NewWritableFile(fname, &actual_writable_file);\n  if (s.ok()) {\n    FileState state(fname);\n    state.pos_ = 0;\n    *result = new TestWritableFile(state, actual_writable_file, this);\n    // NewWritableFile doesn't append to files, so if the same file is\n    // opened again then it will be truncated - so forget our saved\n    // state.\n    UntrackFile(fname);\n    MutexLock l(&mutex_);\n    new_files_since_last_dir_sync_.insert(fname);\n  }\n  return s;\n}\n\nStatus FaultInjectionTestEnv::NewAppendableFile(const std::string& fname,\n                                                WritableFile** result) {\n  WritableFile* actual_writable_file;\n  Status s = target()->NewAppendableFile(fname, &actual_writable_file);\n  if (s.ok()) {\n    FileState state(fname);\n    state.pos_ = 0;\n    {\n      MutexLock l(&mutex_);\n      if (db_file_state_.count(fname) == 0) {\n        new_files_since_last_dir_sync_.insert(fname);\n      } else {\n        state = db_file_state_[fname];\n      }\n    }\n    *result = new TestWritableFile(state, actual_writable_file, this);\n  }\n  return s;\n}\n\nStatus FaultInjectionTestEnv::DropUnsyncedFileData() {\n  Status s;\n  MutexLock l(&mutex_);\n  for (std::map<std::string, FileState>::const_iterator it =\n           db_file_state_.begin();\n       s.ok() && it != db_file_state_.end(); ++it) {\n    const FileState& state = it->second;\n    if (!state.IsFullySynced()) {\n      s = state.DropUnsyncedData();\n    }\n  }\n  return s;\n}\n\nvoid FaultInjectionTestEnv::DirWasSynced() {\n  MutexLock l(&mutex_);\n  new_files_since_last_dir_sync_.clear();\n}\n\nbool FaultInjectionTestEnv::IsFileCreatedSinceLastDirSync(\n    const std::string& filename) {\n  MutexLock l(&mutex_);\n  return new_files_since_last_dir_sync_.find(filename) !=\n         new_files_since_last_dir_sync_.end();\n}\n\nvoid FaultInjectionTestEnv::UntrackFile(const std::string& f) {\n  MutexLock l(&mutex_);\n  db_file_state_.erase(f);\n  new_files_since_last_dir_sync_.erase(f);\n}\n\nStatus FaultInjectionTestEnv::DeleteFile(const std::string& f) {\n  Status s = EnvWrapper::DeleteFile(f);\n  ASSERT_OK(s);\n  if (s.ok()) {\n    UntrackFile(f);\n  }\n  return s;\n}\n\nStatus FaultInjectionTestEnv::RenameFile(const std::string& s,\n                                         const std::string& t) {\n  Status ret = EnvWrapper::RenameFile(s, t);\n\n  if (ret.ok()) {\n    MutexLock l(&mutex_);\n    if (db_file_state_.find(s) != db_file_state_.end()) {\n      db_file_state_[t] = db_file_state_[s];\n      db_file_state_.erase(s);\n    }\n\n    if (new_files_since_last_dir_sync_.erase(s) != 0) {\n      assert(new_files_since_last_dir_sync_.find(t) ==\n             new_files_since_last_dir_sync_.end());\n      new_files_since_last_dir_sync_.insert(t);\n    }\n  }\n\n  return ret;\n}\n\nvoid FaultInjectionTestEnv::ResetState() {\n  // Since we are not destroying the database, the existing files\n  // should keep their recorded synced/flushed state. Therefore\n  // we do not reset db_file_state_ and new_files_since_last_dir_sync_.\n  MutexLock l(&mutex_);\n  SetFilesystemActive(true);\n}\n\nStatus FaultInjectionTestEnv::DeleteFilesCreatedAfterLastDirSync() {\n  // Because DeleteFile access this container make a copy to avoid deadlock\n  mutex_.Lock();\n  std::set<std::string> new_files(new_files_since_last_dir_sync_.begin(),\n                                  new_files_since_last_dir_sync_.end());\n  mutex_.Unlock();\n  Status s;\n  std::set<std::string>::const_iterator it;\n  for (it = new_files.begin(); s.ok() && it != new_files.end(); ++it) {\n    s = DeleteFile(*it);\n  }\n  return s;\n}\n\nvoid FaultInjectionTestEnv::WritableFileClosed(const FileState& state) {\n  MutexLock l(&mutex_);\n  db_file_state_[state.filename_] = state;\n}\n\nStatus FileState::DropUnsyncedData() const {\n  ssize_t sync_pos = pos_at_last_sync_ == -1 ? 0 : pos_at_last_sync_;\n  return Truncate(filename_, sync_pos);\n}\n\nclass FaultInjectionTest {\n public:\n  enum ExpectedVerifResult { VAL_EXPECT_NO_ERROR, VAL_EXPECT_ERROR };\n  enum ResetMethod { RESET_DROP_UNSYNCED_DATA, RESET_DELETE_UNSYNCED_FILES };\n\n  FaultInjectionTestEnv* env_;\n  std::string dbname_;\n  Cache* tiny_cache_;\n  Options options_;\n  DB* db_;\n\n  FaultInjectionTest()\n      : env_(new FaultInjectionTestEnv),\n        tiny_cache_(NewLRUCache(100)),\n        db_(NULL) {\n    dbname_ = test::TmpDir() + \"/fault_test\";\n    DestroyDB(dbname_, Options());  // Destroy any db from earlier run\n    options_.reuse_logs = true;\n    options_.env = env_;\n    options_.paranoid_checks = true;\n    options_.block_cache = tiny_cache_;\n    options_.create_if_missing = true;\n  }\n\n  ~FaultInjectionTest() {\n    CloseDB();\n    DestroyDB(dbname_, Options());\n    delete tiny_cache_;\n    delete env_;\n  }\n\n  void ReuseLogs(bool reuse) {\n    options_.reuse_logs = reuse;\n  }\n\n  void Build(int start_idx, int num_vals) {\n    std::string key_space, value_space;\n    WriteBatch batch;\n    for (int i = start_idx; i < start_idx + num_vals; i++) {\n      Slice key = Key(i, &key_space);\n      batch.Clear();\n      batch.Put(key, Value(i, &value_space));\n      WriteOptions options;\n      ASSERT_OK(db_->Write(options, &batch));\n    }\n  }\n\n  Status ReadValue(int i, std::string* val) const {\n    std::string key_space, value_space;\n    Slice key = Key(i, &key_space);\n    Value(i, &value_space);\n    ReadOptions options;\n    return db_->Get(options, key, val);\n  }\n\n  Status Verify(int start_idx, int num_vals,\n                ExpectedVerifResult expected) const {\n    std::string val;\n    std::string value_space;\n    Status s;\n    for (int i = start_idx; i < start_idx + num_vals && s.ok(); i++) {\n      Value(i, &value_space);\n      s = ReadValue(i, &val);\n      if (expected == VAL_EXPECT_NO_ERROR) {\n        if (s.ok()) {\n          ASSERT_EQ(value_space, val);\n        }\n      } else if (s.ok()) {\n        fprintf(stderr, \"Expected an error at %d, but was OK\\n\", i);\n        s = Status::IOError(dbname_, \"Expected value error:\");\n      } else {\n        s = Status::OK();  // An expected error\n      }\n    }\n    return s;\n  }\n\n  // Return the ith key\n  Slice Key(int i, std::string* storage) const {\n    char buf[100];\n    snprintf(buf, sizeof(buf), \"%016d\", i);\n    storage->assign(buf, strlen(buf));\n    return Slice(*storage);\n  }\n\n  // Return the value to associate with the specified key\n  Slice Value(int k, std::string* storage) const {\n    Random r(k);\n    return test::RandomString(&r, kValueSize, storage);\n  }\n\n  Status OpenDB() {\n    delete db_;\n    db_ = NULL;\n    env_->ResetState();\n    return DB::Open(options_, dbname_, &db_);\n  }\n\n  void CloseDB() {\n    delete db_;\n    db_ = NULL;\n  }\n\n  void DeleteAllData() {\n    Iterator* iter = db_->NewIterator(ReadOptions());\n    WriteOptions options;\n    for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {\n      ASSERT_OK(db_->Delete(WriteOptions(), iter->key()));\n    }\n\n    delete iter;\n  }\n\n  void ResetDBState(ResetMethod reset_method) {\n    switch (reset_method) {\n      case RESET_DROP_UNSYNCED_DATA:\n        ASSERT_OK(env_->DropUnsyncedFileData());\n        break;\n      case RESET_DELETE_UNSYNCED_FILES:\n        ASSERT_OK(env_->DeleteFilesCreatedAfterLastDirSync());\n        break;\n      default:\n        assert(false);\n    }\n  }\n\n  void PartialCompactTestPreFault(int num_pre_sync, int num_post_sync) {\n    DeleteAllData();\n    Build(0, num_pre_sync);\n    db_->CompactRange(NULL, NULL);\n    Build(num_pre_sync, num_post_sync);\n  }\n\n  void PartialCompactTestReopenWithFault(ResetMethod reset_method,\n                                         int num_pre_sync,\n                                         int num_post_sync) {\n    env_->SetFilesystemActive(false);\n    CloseDB();\n    ResetDBState(reset_method);\n    ASSERT_OK(OpenDB());\n    ASSERT_OK(Verify(0, num_pre_sync, FaultInjectionTest::VAL_EXPECT_NO_ERROR));\n    ASSERT_OK(Verify(num_pre_sync, num_post_sync, FaultInjectionTest::VAL_EXPECT_ERROR));\n  }\n\n  void NoWriteTestPreFault() {\n  }\n\n  void NoWriteTestReopenWithFault(ResetMethod reset_method) {\n    CloseDB();\n    ResetDBState(reset_method);\n    ASSERT_OK(OpenDB());\n  }\n\n  void DoTest() {\n    Random rnd(0);\n    ASSERT_OK(OpenDB());\n    for (size_t idx = 0; idx < kNumIterations; idx++) {\n      int num_pre_sync = rnd.Uniform(kMaxNumValues);\n      int num_post_sync = rnd.Uniform(kMaxNumValues);\n\n      PartialCompactTestPreFault(num_pre_sync, num_post_sync);\n      PartialCompactTestReopenWithFault(RESET_DROP_UNSYNCED_DATA,\n                                        num_pre_sync,\n                                        num_post_sync);\n\n      NoWriteTestPreFault();\n      NoWriteTestReopenWithFault(RESET_DROP_UNSYNCED_DATA);\n\n      PartialCompactTestPreFault(num_pre_sync, num_post_sync);\n      // No new files created so we expect all values since no files will be\n      // dropped.\n      PartialCompactTestReopenWithFault(RESET_DELETE_UNSYNCED_FILES,\n                                        num_pre_sync + num_post_sync,\n                                        0);\n\n      NoWriteTestPreFault();\n      NoWriteTestReopenWithFault(RESET_DELETE_UNSYNCED_FILES);\n    }\n  }\n};\n\nTEST(FaultInjectionTest, FaultTestNoLogReuse) {\n  ReuseLogs(false);\n  DoTest();\n}\n\nTEST(FaultInjectionTest, FaultTestWithLogReuse) {\n  ReuseLogs(true);\n  DoTest();\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/filename.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <ctype.h>\n#include <stdio.h>\n#include \"db/filename.h\"\n#include \"db/dbformat.h\"\n#include \"leveldb/env.h\"\n#include \"util/logging.h\"\n\nnamespace leveldb {\n\n// A utility routine: write \"data\" to the named file and Sync() it.\nextern Status WriteStringToFileSync(Env* env, const Slice& data,\n                                    const std::string& fname);\n\nstatic std::string MakeFileName(const std::string& name, uint64_t number,\n                                const char* suffix) {\n  char buf[100];\n  snprintf(buf, sizeof(buf), \"/%06llu.%s\",\n           static_cast<unsigned long long>(number),\n           suffix);\n  return name + buf;\n}\n\nstd::string LogFileName(const std::string& name, uint64_t number) {\n  assert(number > 0);\n  return MakeFileName(name, number, \"log\");\n}\n\nstd::string TableFileName(const std::string& name, uint64_t number) {\n  assert(number > 0);\n  return MakeFileName(name, number, \"ldb\");\n}\n\nstd::string SSTTableFileName(const std::string& name, uint64_t number) {\n  assert(number > 0);\n  return MakeFileName(name, number, \"sst\");\n}\n\nstd::string DescriptorFileName(const std::string& dbname, uint64_t number) {\n  assert(number > 0);\n  char buf[100];\n  snprintf(buf, sizeof(buf), \"/MANIFEST-%06llu\",\n           static_cast<unsigned long long>(number));\n  return dbname + buf;\n}\n\nstd::string CurrentFileName(const std::string& dbname) {\n  return dbname + \"/CURRENT\";\n}\n\nstd::string LockFileName(const std::string& dbname) {\n  return dbname + \"/LOCK\";\n}\n\nstd::string TempFileName(const std::string& dbname, uint64_t number) {\n  assert(number > 0);\n  return MakeFileName(dbname, number, \"dbtmp\");\n}\n\nstd::string InfoLogFileName(const std::string& dbname) {\n  return dbname + \"/LOG\";\n}\n\n// Return the name of the old info log file for \"dbname\".\nstd::string OldInfoLogFileName(const std::string& dbname) {\n  return dbname + \"/LOG.old\";\n}\n\n\n// Owned filenames have the form:\n//    dbname/CURRENT\n//    dbname/LOCK\n//    dbname/LOG\n//    dbname/LOG.old\n//    dbname/MANIFEST-[0-9]+\n//    dbname/[0-9]+.(log|sst|ldb)\nbool ParseFileName(const std::string& fname,\n                   uint64_t* number,\n                   FileType* type) {\n  Slice rest(fname);\n  if (rest == \"CURRENT\") {\n    *number = 0;\n    *type = kCurrentFile;\n  } else if (rest == \"LOCK\") {\n    *number = 0;\n    *type = kDBLockFile;\n  } else if (rest == \"LOG\" || rest == \"LOG.old\") {\n    *number = 0;\n    *type = kInfoLogFile;\n  } else if (rest.starts_with(\"MANIFEST-\")) {\n    rest.remove_prefix(strlen(\"MANIFEST-\"));\n    uint64_t num;\n    if (!ConsumeDecimalNumber(&rest, &num)) {\n      return false;\n    }\n    if (!rest.empty()) {\n      return false;\n    }\n    *type = kDescriptorFile;\n    *number = num;\n  } else {\n    // Avoid strtoull() to keep filename format independent of the\n    // current locale\n    uint64_t num;\n    if (!ConsumeDecimalNumber(&rest, &num)) {\n      return false;\n    }\n    Slice suffix = rest;\n    if (suffix == Slice(\".log\")) {\n      *type = kLogFile;\n    } else if (suffix == Slice(\".sst\") || suffix == Slice(\".ldb\")) {\n      *type = kTableFile;\n    } else if (suffix == Slice(\".dbtmp\")) {\n      *type = kTempFile;\n    } else {\n      return false;\n    }\n    *number = num;\n  }\n  return true;\n}\n\nStatus SetCurrentFile(Env* env, const std::string& dbname,\n                      uint64_t descriptor_number) {\n  // Remove leading \"dbname/\" and add newline to manifest file name\n  std::string manifest = DescriptorFileName(dbname, descriptor_number);\n  Slice contents = manifest;\n  assert(contents.starts_with(dbname + \"/\"));\n  contents.remove_prefix(dbname.size() + 1);\n  std::string tmp = TempFileName(dbname, descriptor_number);\n  Status s = WriteStringToFileSync(env, contents.ToString() + \"\\n\", tmp);\n  if (s.ok()) {\n    s = env->RenameFile(tmp, CurrentFileName(dbname));\n  }\n  if (!s.ok()) {\n    env->DeleteFile(tmp);\n  }\n  return s;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/filename.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// File names used by DB code\n\n#ifndef STORAGE_LEVELDB_DB_FILENAME_H_\n#define STORAGE_LEVELDB_DB_FILENAME_H_\n\n#include <stdint.h>\n#include <string>\n#include \"leveldb/slice.h\"\n#include \"leveldb/status.h\"\n#include \"port/port.h\"\n\nnamespace leveldb {\n\nclass Env;\n\nenum FileType {\n  kLogFile,\n  kDBLockFile,\n  kTableFile,\n  kDescriptorFile,\n  kCurrentFile,\n  kTempFile,\n  kInfoLogFile  // Either the current one, or an old one\n};\n\n// Return the name of the log file with the specified number\n// in the db named by \"dbname\".  The result will be prefixed with\n// \"dbname\".\nextern std::string LogFileName(const std::string& dbname, uint64_t number);\n\n// Return the name of the sstable with the specified number\n// in the db named by \"dbname\".  The result will be prefixed with\n// \"dbname\".\nextern std::string TableFileName(const std::string& dbname, uint64_t number);\n\n// Return the legacy file name for an sstable with the specified number\n// in the db named by \"dbname\". The result will be prefixed with\n// \"dbname\".\nextern std::string SSTTableFileName(const std::string& dbname, uint64_t number);\n\n// Return the name of the descriptor file for the db named by\n// \"dbname\" and the specified incarnation number.  The result will be\n// prefixed with \"dbname\".\nextern std::string DescriptorFileName(const std::string& dbname,\n                                      uint64_t number);\n\n// Return the name of the current file.  This file contains the name\n// of the current manifest file.  The result will be prefixed with\n// \"dbname\".\nextern std::string CurrentFileName(const std::string& dbname);\n\n// Return the name of the lock file for the db named by\n// \"dbname\".  The result will be prefixed with \"dbname\".\nextern std::string LockFileName(const std::string& dbname);\n\n// Return the name of a temporary file owned by the db named \"dbname\".\n// The result will be prefixed with \"dbname\".\nextern std::string TempFileName(const std::string& dbname, uint64_t number);\n\n// Return the name of the info log file for \"dbname\".\nextern std::string InfoLogFileName(const std::string& dbname);\n\n// Return the name of the old info log file for \"dbname\".\nextern std::string OldInfoLogFileName(const std::string& dbname);\n\n// If filename is a leveldb file, store the type of the file in *type.\n// The number encoded in the filename is stored in *number.  If the\n// filename was successfully parsed, returns true.  Else return false.\nextern bool ParseFileName(const std::string& filename,\n                          uint64_t* number,\n                          FileType* type);\n\n// Make the CURRENT file point to the descriptor file with the\n// specified number.\nextern Status SetCurrentFile(Env* env, const std::string& dbname,\n                             uint64_t descriptor_number);\n\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_FILENAME_H_\n"
  },
  {
    "path": "src/leveldb/db/filename_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/filename.h\"\n\n#include \"db/dbformat.h\"\n#include \"port/port.h\"\n#include \"util/logging.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\nclass FileNameTest { };\n\nTEST(FileNameTest, Parse) {\n  Slice db;\n  FileType type;\n  uint64_t number;\n\n  // Successful parses\n  static struct {\n    const char* fname;\n    uint64_t number;\n    FileType type;\n  } cases[] = {\n    { \"100.log\",            100,   kLogFile },\n    { \"0.log\",              0,     kLogFile },\n    { \"0.sst\",              0,     kTableFile },\n    { \"0.ldb\",              0,     kTableFile },\n    { \"CURRENT\",            0,     kCurrentFile },\n    { \"LOCK\",               0,     kDBLockFile },\n    { \"MANIFEST-2\",         2,     kDescriptorFile },\n    { \"MANIFEST-7\",         7,     kDescriptorFile },\n    { \"LOG\",                0,     kInfoLogFile },\n    { \"LOG.old\",            0,     kInfoLogFile },\n    { \"18446744073709551615.log\", 18446744073709551615ull, kLogFile },\n  };\n  for (int i = 0; i < sizeof(cases) / sizeof(cases[0]); i++) {\n    std::string f = cases[i].fname;\n    ASSERT_TRUE(ParseFileName(f, &number, &type)) << f;\n    ASSERT_EQ(cases[i].type, type) << f;\n    ASSERT_EQ(cases[i].number, number) << f;\n  }\n\n  // Errors\n  static const char* errors[] = {\n    \"\",\n    \"foo\",\n    \"foo-dx-100.log\",\n    \".log\",\n    \"\",\n    \"manifest\",\n    \"CURREN\",\n    \"CURRENTX\",\n    \"MANIFES\",\n    \"MANIFEST\",\n    \"MANIFEST-\",\n    \"XMANIFEST-3\",\n    \"MANIFEST-3x\",\n    \"LOC\",\n    \"LOCKx\",\n    \"LO\",\n    \"LOGx\",\n    \"18446744073709551616.log\",\n    \"184467440737095516150.log\",\n    \"100\",\n    \"100.\",\n    \"100.lop\"\n  };\n  for (int i = 0; i < sizeof(errors) / sizeof(errors[0]); i++) {\n    std::string f = errors[i];\n    ASSERT_TRUE(!ParseFileName(f, &number, &type)) << f;\n  }\n}\n\nTEST(FileNameTest, Construction) {\n  uint64_t number;\n  FileType type;\n  std::string fname;\n\n  fname = CurrentFileName(\"foo\");\n  ASSERT_EQ(\"foo/\", std::string(fname.data(), 4));\n  ASSERT_TRUE(ParseFileName(fname.c_str() + 4, &number, &type));\n  ASSERT_EQ(0, number);\n  ASSERT_EQ(kCurrentFile, type);\n\n  fname = LockFileName(\"foo\");\n  ASSERT_EQ(\"foo/\", std::string(fname.data(), 4));\n  ASSERT_TRUE(ParseFileName(fname.c_str() + 4, &number, &type));\n  ASSERT_EQ(0, number);\n  ASSERT_EQ(kDBLockFile, type);\n\n  fname = LogFileName(\"foo\", 192);\n  ASSERT_EQ(\"foo/\", std::string(fname.data(), 4));\n  ASSERT_TRUE(ParseFileName(fname.c_str() + 4, &number, &type));\n  ASSERT_EQ(192, number);\n  ASSERT_EQ(kLogFile, type);\n\n  fname = TableFileName(\"bar\", 200);\n  ASSERT_EQ(\"bar/\", std::string(fname.data(), 4));\n  ASSERT_TRUE(ParseFileName(fname.c_str() + 4, &number, &type));\n  ASSERT_EQ(200, number);\n  ASSERT_EQ(kTableFile, type);\n\n  fname = DescriptorFileName(\"bar\", 100);\n  ASSERT_EQ(\"bar/\", std::string(fname.data(), 4));\n  ASSERT_TRUE(ParseFileName(fname.c_str() + 4, &number, &type));\n  ASSERT_EQ(100, number);\n  ASSERT_EQ(kDescriptorFile, type);\n\n  fname = TempFileName(\"tmp\", 999);\n  ASSERT_EQ(\"tmp/\", std::string(fname.data(), 4));\n  ASSERT_TRUE(ParseFileName(fname.c_str() + 4, &number, &type));\n  ASSERT_EQ(999, number);\n  ASSERT_EQ(kTempFile, type);\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/leveldbutil.cc",
    "content": "// Copyright (c) 2012 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <stdio.h>\n#include \"leveldb/dumpfile.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/status.h\"\n\nnamespace leveldb {\nnamespace {\n\nclass StdoutPrinter : public WritableFile {\n public:\n  virtual Status Append(const Slice& data) {\n    fwrite(data.data(), 1, data.size(), stdout);\n    return Status::OK();\n  }\n  virtual Status Close() { return Status::OK(); }\n  virtual Status Flush() { return Status::OK(); }\n  virtual Status Sync() { return Status::OK(); }\n  virtual std::string GetName() const { return \"[stdout]\"; }\n};\n\nbool HandleDumpCommand(Env* env, char** files, int num) {\n  StdoutPrinter printer;\n  bool ok = true;\n  for (int i = 0; i < num; i++) {\n    Status s = DumpFile(env, files[i], &printer);\n    if (!s.ok()) {\n      fprintf(stderr, \"%s\\n\", s.ToString().c_str());\n      ok = false;\n    }\n  }\n  return ok;\n}\n\n}  // namespace\n}  // namespace leveldb\n\nstatic void Usage() {\n  fprintf(\n      stderr,\n      \"Usage: leveldbutil command...\\n\"\n      \"   dump files...         -- dump contents of specified files\\n\"\n      );\n}\n\nint main(int argc, char** argv) {\n  leveldb::Env* env = leveldb::Env::Default();\n  bool ok = true;\n  if (argc < 2) {\n    Usage();\n    ok = false;\n  } else {\n    std::string command = argv[1];\n    if (command == \"dump\") {\n      ok = leveldb::HandleDumpCommand(env, argv+2, argc-2);\n    } else {\n      Usage();\n      ok = false;\n    }\n  }\n  return (ok ? 0 : 1);\n}\n"
  },
  {
    "path": "src/leveldb/db/log_format.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// Log format information shared by reader and writer.\n// See ../doc/log_format.md for more detail.\n\n#ifndef STORAGE_LEVELDB_DB_LOG_FORMAT_H_\n#define STORAGE_LEVELDB_DB_LOG_FORMAT_H_\n\nnamespace leveldb {\nnamespace log {\n\nenum RecordType {\n  // Zero is reserved for preallocated files\n  kZeroType = 0,\n\n  kFullType = 1,\n\n  // For fragments\n  kFirstType = 2,\n  kMiddleType = 3,\n  kLastType = 4\n};\nstatic const int kMaxRecordType = kLastType;\n\nstatic const int kBlockSize = 32768;\n\n// Header is checksum (4 bytes), length (2 bytes), type (1 byte).\nstatic const int kHeaderSize = 4 + 2 + 1;\n\n}  // namespace log\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_LOG_FORMAT_H_\n"
  },
  {
    "path": "src/leveldb/db/log_reader.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/log_reader.h\"\n\n#include <stdio.h>\n#include \"leveldb/env.h\"\n#include \"util/coding.h\"\n#include \"util/crc32c.h\"\n\nnamespace leveldb {\nnamespace log {\n\nReader::Reporter::~Reporter() {\n}\n\nReader::Reader(SequentialFile* file, Reporter* reporter, bool checksum,\n               uint64_t initial_offset)\n    : file_(file),\n      reporter_(reporter),\n      checksum_(checksum),\n      backing_store_(new char[kBlockSize]),\n      buffer_(),\n      eof_(false),\n      last_record_offset_(0),\n      end_of_buffer_offset_(0),\n      initial_offset_(initial_offset),\n      resyncing_(initial_offset > 0) {\n}\n\nReader::~Reader() {\n  delete[] backing_store_;\n}\n\nbool Reader::SkipToInitialBlock() {\n  size_t offset_in_block = initial_offset_ % kBlockSize;\n  uint64_t block_start_location = initial_offset_ - offset_in_block;\n\n  // Don't search a block if we'd be in the trailer\n  if (offset_in_block > kBlockSize - 6) {\n    offset_in_block = 0;\n    block_start_location += kBlockSize;\n  }\n\n  end_of_buffer_offset_ = block_start_location;\n\n  // Skip to start of first block that can contain the initial record\n  if (block_start_location > 0) {\n    Status skip_status = file_->Skip(block_start_location);\n    if (!skip_status.ok()) {\n      ReportDrop(block_start_location, skip_status);\n      return false;\n    }\n  }\n\n  return true;\n}\n\nbool Reader::ReadRecord(Slice* record, std::string* scratch) {\n  if (last_record_offset_ < initial_offset_) {\n    if (!SkipToInitialBlock()) {\n      return false;\n    }\n  }\n\n  scratch->clear();\n  record->clear();\n  bool in_fragmented_record = false;\n  // Record offset of the logical record that we're reading\n  // 0 is a dummy value to make compilers happy\n  uint64_t prospective_record_offset = 0;\n\n  Slice fragment;\n  while (true) {\n    const unsigned int record_type = ReadPhysicalRecord(&fragment);\n\n    // ReadPhysicalRecord may have only had an empty trailer remaining in its\n    // internal buffer. Calculate the offset of the next physical record now\n    // that it has returned, properly accounting for its header size.\n    uint64_t physical_record_offset =\n        end_of_buffer_offset_ - buffer_.size() - kHeaderSize - fragment.size();\n\n    if (resyncing_) {\n      if (record_type == kMiddleType) {\n        continue;\n      } else if (record_type == kLastType) {\n        resyncing_ = false;\n        continue;\n      } else {\n        resyncing_ = false;\n      }\n    }\n\n    switch (record_type) {\n      case kFullType:\n        if (in_fragmented_record) {\n          // Handle bug in earlier versions of log::Writer where\n          // it could emit an empty kFirstType record at the tail end\n          // of a block followed by a kFullType or kFirstType record\n          // at the beginning of the next block.\n          if (scratch->empty()) {\n            in_fragmented_record = false;\n          } else {\n            ReportCorruption(scratch->size(), \"partial record without end(1)\");\n          }\n        }\n        prospective_record_offset = physical_record_offset;\n        scratch->clear();\n        *record = fragment;\n        last_record_offset_ = prospective_record_offset;\n        return true;\n\n      case kFirstType:\n        if (in_fragmented_record) {\n          // Handle bug in earlier versions of log::Writer where\n          // it could emit an empty kFirstType record at the tail end\n          // of a block followed by a kFullType or kFirstType record\n          // at the beginning of the next block.\n          if (scratch->empty()) {\n            in_fragmented_record = false;\n          } else {\n            ReportCorruption(scratch->size(), \"partial record without end(2)\");\n          }\n        }\n        prospective_record_offset = physical_record_offset;\n        scratch->assign(fragment.data(), fragment.size());\n        in_fragmented_record = true;\n        break;\n\n      case kMiddleType:\n        if (!in_fragmented_record) {\n          ReportCorruption(fragment.size(),\n                           \"missing start of fragmented record(1)\");\n        } else {\n          scratch->append(fragment.data(), fragment.size());\n        }\n        break;\n\n      case kLastType:\n        if (!in_fragmented_record) {\n          ReportCorruption(fragment.size(),\n                           \"missing start of fragmented record(2)\");\n        } else {\n          scratch->append(fragment.data(), fragment.size());\n          *record = Slice(*scratch);\n          last_record_offset_ = prospective_record_offset;\n          return true;\n        }\n        break;\n\n      case kEof:\n        if (in_fragmented_record) {\n          // This can be caused by the writer dying immediately after\n          // writing a physical record but before completing the next; don't\n          // treat it as a corruption, just ignore the entire logical record.\n          scratch->clear();\n        }\n        return false;\n\n      case kBadRecord:\n        if (in_fragmented_record) {\n          ReportCorruption(scratch->size(), \"error in middle of record\");\n          in_fragmented_record = false;\n          scratch->clear();\n        }\n        break;\n\n      default: {\n        char buf[40];\n        snprintf(buf, sizeof(buf), \"unknown record type %u\", record_type);\n        ReportCorruption(\n            (fragment.size() + (in_fragmented_record ? scratch->size() : 0)),\n            buf);\n        in_fragmented_record = false;\n        scratch->clear();\n        break;\n      }\n    }\n  }\n  return false;\n}\n\nuint64_t Reader::LastRecordOffset() {\n  return last_record_offset_;\n}\n\nvoid Reader::ReportCorruption(uint64_t bytes, const char* reason) {\n  ReportDrop(bytes, Status::Corruption(reason, file_->GetName()));\n}\n\nvoid Reader::ReportDrop(uint64_t bytes, const Status& reason) {\n  if (reporter_ != NULL &&\n      end_of_buffer_offset_ - buffer_.size() - bytes >= initial_offset_) {\n    reporter_->Corruption(static_cast<size_t>(bytes), reason);\n  }\n}\n\nunsigned int Reader::ReadPhysicalRecord(Slice* result) {\n  while (true) {\n    if (buffer_.size() < kHeaderSize) {\n      if (!eof_) {\n        // Last read was a full read, so this is a trailer to skip\n        buffer_.clear();\n        Status status = file_->Read(kBlockSize, &buffer_, backing_store_);\n        end_of_buffer_offset_ += buffer_.size();\n        if (!status.ok()) {\n          buffer_.clear();\n          ReportDrop(kBlockSize, status);\n          eof_ = true;\n          return kEof;\n        } else if (buffer_.size() < kBlockSize) {\n          eof_ = true;\n        }\n        continue;\n      } else {\n        // Note that if buffer_ is non-empty, we have a truncated header at the\n        // end of the file, which can be caused by the writer crashing in the\n        // middle of writing the header. Instead of considering this an error,\n        // just report EOF.\n        buffer_.clear();\n        return kEof;\n      }\n    }\n\n    // Parse the header\n    const char* header = buffer_.data();\n    const uint32_t a = static_cast<uint32_t>(header[4]) & 0xff;\n    const uint32_t b = static_cast<uint32_t>(header[5]) & 0xff;\n    const unsigned int type = header[6];\n    const uint32_t length = a | (b << 8);\n    if (kHeaderSize + length > buffer_.size()) {\n      size_t drop_size = buffer_.size();\n      buffer_.clear();\n      if (!eof_) {\n        ReportCorruption(drop_size, \"bad record length\");\n        return kBadRecord;\n      }\n      // If the end of the file has been reached without reading |length| bytes\n      // of payload, assume the writer died in the middle of writing the record.\n      // Don't report a corruption.\n      return kEof;\n    }\n\n    if (type == kZeroType && length == 0) {\n      // Skip zero length record without reporting any drops since\n      // such records are produced by the mmap based writing code in\n      // env_posix.cc that preallocates file regions.\n      buffer_.clear();\n      return kBadRecord;\n    }\n\n    // Check crc\n    if (checksum_) {\n      uint32_t expected_crc = crc32c::Unmask(DecodeFixed32(header));\n      uint32_t actual_crc = crc32c::Value(header + 6, 1 + length);\n      if (actual_crc != expected_crc) {\n        // Drop the rest of the buffer since \"length\" itself may have\n        // been corrupted and if we trust it, we could find some\n        // fragment of a real log record that just happens to look\n        // like a valid log record.\n        size_t drop_size = buffer_.size();\n        buffer_.clear();\n        ReportCorruption(drop_size, \"checksum mismatch\");\n        return kBadRecord;\n      }\n    }\n\n    buffer_.remove_prefix(kHeaderSize + length);\n\n    // Skip physical record that started before initial_offset_\n    if (end_of_buffer_offset_ - buffer_.size() - kHeaderSize - length <\n        initial_offset_) {\n      result->clear();\n      return kBadRecord;\n    }\n\n    *result = Slice(header + kHeaderSize, length);\n    return type;\n  }\n}\n\n}  // namespace log\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/log_reader.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_LOG_READER_H_\n#define STORAGE_LEVELDB_DB_LOG_READER_H_\n\n#include <stdint.h>\n\n#include \"db/log_format.h\"\n#include \"leveldb/slice.h\"\n#include \"leveldb/status.h\"\n\nnamespace leveldb {\n\nclass SequentialFile;\n\nnamespace log {\n\nclass Reader {\n public:\n  // Interface for reporting errors.\n  class Reporter {\n   public:\n    virtual ~Reporter();\n\n    // Some corruption was detected.  \"size\" is the approximate number\n    // of bytes dropped due to the corruption.\n    virtual void Corruption(size_t bytes, const Status& status) = 0;\n  };\n\n  // Create a reader that will return log records from \"*file\".\n  // \"*file\" must remain live while this Reader is in use.\n  //\n  // If \"reporter\" is non-NULL, it is notified whenever some data is\n  // dropped due to a detected corruption.  \"*reporter\" must remain\n  // live while this Reader is in use.\n  //\n  // If \"checksum\" is true, verify checksums if available.\n  //\n  // The Reader will start reading at the first record located at physical\n  // position >= initial_offset within the file.\n  Reader(SequentialFile* file, Reporter* reporter, bool checksum,\n         uint64_t initial_offset);\n\n  ~Reader();\n\n  // Read the next record into *record.  Returns true if read\n  // successfully, false if we hit end of the input.  May use\n  // \"*scratch\" as temporary storage.  The contents filled in *record\n  // will only be valid until the next mutating operation on this\n  // reader or the next mutation to *scratch.\n  bool ReadRecord(Slice* record, std::string* scratch);\n\n  // Returns the physical offset of the last record returned by ReadRecord.\n  //\n  // Undefined before the first call to ReadRecord.\n  uint64_t LastRecordOffset();\n\n private:\n  SequentialFile* const file_;\n  Reporter* const reporter_;\n  bool const checksum_;\n  char* const backing_store_;\n  Slice buffer_;\n  bool eof_;   // Last Read() indicated EOF by returning < kBlockSize\n\n  // Offset of the last record returned by ReadRecord.\n  uint64_t last_record_offset_;\n  // Offset of the first location past the end of buffer_.\n  uint64_t end_of_buffer_offset_;\n\n  // Offset at which to start looking for the first record to return\n  uint64_t const initial_offset_;\n\n  // True if we are resynchronizing after a seek (initial_offset_ > 0). In\n  // particular, a run of kMiddleType and kLastType records can be silently\n  // skipped in this mode\n  bool resyncing_;\n\n  // Extend record types with the following special values\n  enum {\n    kEof = kMaxRecordType + 1,\n    // Returned whenever we find an invalid physical record.\n    // Currently there are three situations in which this happens:\n    // * The record has an invalid CRC (ReadPhysicalRecord reports a drop)\n    // * The record is a 0-length record (No drop is reported)\n    // * The record is below constructor's initial_offset (No drop is reported)\n    kBadRecord = kMaxRecordType + 2\n  };\n\n  // Skips all blocks that are completely before \"initial_offset_\".\n  //\n  // Returns true on success. Handles reporting.\n  bool SkipToInitialBlock();\n\n  // Return type, or one of the preceding special values\n  unsigned int ReadPhysicalRecord(Slice* result);\n\n  // Reports dropped bytes to the reporter.\n  // buffer_ must be updated to remove the dropped bytes prior to invocation.\n  void ReportCorruption(uint64_t bytes, const char* reason);\n  void ReportDrop(uint64_t bytes, const Status& reason);\n\n  // No copying allowed\n  Reader(const Reader&);\n  void operator=(const Reader&);\n};\n\n}  // namespace log\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_LOG_READER_H_\n"
  },
  {
    "path": "src/leveldb/db/log_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/log_reader.h\"\n#include \"db/log_writer.h\"\n#include \"leveldb/env.h\"\n#include \"util/coding.h\"\n#include \"util/crc32c.h\"\n#include \"util/random.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\nnamespace log {\n\n// Construct a string of the specified length made out of the supplied\n// partial string.\nstatic std::string BigString(const std::string& partial_string, size_t n) {\n  std::string result;\n  while (result.size() < n) {\n    result.append(partial_string);\n  }\n  result.resize(n);\n  return result;\n}\n\n// Construct a string from a number\nstatic std::string NumberString(int n) {\n  char buf[50];\n  snprintf(buf, sizeof(buf), \"%d.\", n);\n  return std::string(buf);\n}\n\n// Return a skewed potentially long string\nstatic std::string RandomSkewedString(int i, Random* rnd) {\n  return BigString(NumberString(i), rnd->Skewed(17));\n}\n\nclass LogTest {\n private:\n  class StringDest : public WritableFile {\n   public:\n    std::string contents_;\n\n    virtual Status Close() { return Status::OK(); }\n    virtual Status Flush() { return Status::OK(); }\n    virtual Status Sync() { return Status::OK(); }\n    virtual Status Append(const Slice& slice) {\n      contents_.append(slice.data(), slice.size());\n      return Status::OK();\n    }\n  };\n\n  class StringSource : public SequentialFile {\n   public:\n    Slice contents_;\n    bool force_error_;\n    bool returned_partial_;\n    StringSource() : force_error_(false), returned_partial_(false) { }\n\n    virtual Status Read(size_t n, Slice* result, char* scratch) {\n      ASSERT_TRUE(!returned_partial_) << \"must not Read() after eof/error\";\n\n      if (force_error_) {\n        force_error_ = false;\n        returned_partial_ = true;\n        return Status::Corruption(\"read error\");\n      }\n\n      if (contents_.size() < n) {\n        n = contents_.size();\n        returned_partial_ = true;\n      }\n      *result = Slice(contents_.data(), n);\n      contents_.remove_prefix(n);\n      return Status::OK();\n    }\n\n    virtual Status Skip(uint64_t n) {\n      if (n > contents_.size()) {\n        contents_.clear();\n        return Status::NotFound(\"in-memory file skipped past end\");\n      }\n\n      contents_.remove_prefix(n);\n\n      return Status::OK();\n    }\n  };\n\n  class ReportCollector : public Reader::Reporter {\n   public:\n    size_t dropped_bytes_;\n    std::string message_;\n\n    ReportCollector() : dropped_bytes_(0) { }\n    virtual void Corruption(size_t bytes, const Status& status) {\n      dropped_bytes_ += bytes;\n      message_.append(status.ToString());\n    }\n  };\n\n  StringDest dest_;\n  StringSource source_;\n  ReportCollector report_;\n  bool reading_;\n  Writer* writer_;\n  Reader* reader_;\n\n  // Record metadata for testing initial offset functionality\n  static size_t initial_offset_record_sizes_[];\n  static uint64_t initial_offset_last_record_offsets_[];\n  static int num_initial_offset_records_;\n\n public:\n  LogTest() : reading_(false),\n              writer_(new Writer(&dest_)),\n              reader_(new Reader(&source_, &report_, true/*checksum*/,\n                      0/*initial_offset*/)) {\n  }\n\n  ~LogTest() {\n    delete writer_;\n    delete reader_;\n  }\n\n  void ReopenForAppend() {\n    delete writer_;\n    writer_ = new Writer(&dest_, dest_.contents_.size());\n  }\n\n  void Write(const std::string& msg) {\n    ASSERT_TRUE(!reading_) << \"Write() after starting to read\";\n    writer_->AddRecord(Slice(msg));\n  }\n\n  size_t WrittenBytes() const {\n    return dest_.contents_.size();\n  }\n\n  std::string Read() {\n    if (!reading_) {\n      reading_ = true;\n      source_.contents_ = Slice(dest_.contents_);\n    }\n    std::string scratch;\n    Slice record;\n    if (reader_->ReadRecord(&record, &scratch)) {\n      return record.ToString();\n    } else {\n      return \"EOF\";\n    }\n  }\n\n  void IncrementByte(int offset, int delta) {\n    dest_.contents_[offset] += delta;\n  }\n\n  void SetByte(int offset, char new_byte) {\n    dest_.contents_[offset] = new_byte;\n  }\n\n  void ShrinkSize(int bytes) {\n    dest_.contents_.resize(dest_.contents_.size() - bytes);\n  }\n\n  void FixChecksum(int header_offset, int len) {\n    // Compute crc of type/len/data\n    uint32_t crc = crc32c::Value(&dest_.contents_[header_offset+6], 1 + len);\n    crc = crc32c::Mask(crc);\n    EncodeFixed32(&dest_.contents_[header_offset], crc);\n  }\n\n  void ForceError() {\n    source_.force_error_ = true;\n  }\n\n  size_t DroppedBytes() const {\n    return report_.dropped_bytes_;\n  }\n\n  std::string ReportMessage() const {\n    return report_.message_;\n  }\n\n  // Returns OK iff recorded error message contains \"msg\"\n  std::string MatchError(const std::string& msg) const {\n    if (report_.message_.find(msg) == std::string::npos) {\n      return report_.message_;\n    } else {\n      return \"OK\";\n    }\n  }\n\n  void WriteInitialOffsetLog() {\n    for (int i = 0; i < num_initial_offset_records_; i++) {\n      std::string record(initial_offset_record_sizes_[i],\n                         static_cast<char>('a' + i));\n      Write(record);\n    }\n  }\n\n  void StartReadingAt(uint64_t initial_offset) {\n    delete reader_;\n    reader_ = new Reader(&source_, &report_, true/*checksum*/, initial_offset);\n  }\n\n  void CheckOffsetPastEndReturnsNoRecords(uint64_t offset_past_end) {\n    WriteInitialOffsetLog();\n    reading_ = true;\n    source_.contents_ = Slice(dest_.contents_);\n    Reader* offset_reader = new Reader(&source_, &report_, true/*checksum*/,\n                                       WrittenBytes() + offset_past_end);\n    Slice record;\n    std::string scratch;\n    ASSERT_TRUE(!offset_reader->ReadRecord(&record, &scratch));\n    delete offset_reader;\n  }\n\n  void CheckInitialOffsetRecord(uint64_t initial_offset,\n                                int expected_record_offset) {\n    WriteInitialOffsetLog();\n    reading_ = true;\n    source_.contents_ = Slice(dest_.contents_);\n    Reader* offset_reader = new Reader(&source_, &report_, true/*checksum*/,\n                                       initial_offset);\n\n    // Read all records from expected_record_offset through the last one.\n    ASSERT_LT(expected_record_offset, num_initial_offset_records_);\n    for (; expected_record_offset < num_initial_offset_records_;\n         ++expected_record_offset) {\n      Slice record;\n      std::string scratch;\n      ASSERT_TRUE(offset_reader->ReadRecord(&record, &scratch));\n      ASSERT_EQ(initial_offset_record_sizes_[expected_record_offset],\n                record.size());\n      ASSERT_EQ(initial_offset_last_record_offsets_[expected_record_offset],\n                offset_reader->LastRecordOffset());\n      ASSERT_EQ((char)('a' + expected_record_offset), record.data()[0]);\n    }\n    delete offset_reader;\n  }\n};\n\nsize_t LogTest::initial_offset_record_sizes_[] =\n    {10000,  // Two sizable records in first block\n     10000,\n     2 * log::kBlockSize - 1000,  // Span three blocks\n     1,\n     13716,  // Consume all but two bytes of block 3.\n     log::kBlockSize - kHeaderSize, // Consume the entirety of block 4.\n    };\n\nuint64_t LogTest::initial_offset_last_record_offsets_[] =\n    {0,\n     kHeaderSize + 10000,\n     2 * (kHeaderSize + 10000),\n     2 * (kHeaderSize + 10000) +\n         (2 * log::kBlockSize - 1000) + 3 * kHeaderSize,\n     2 * (kHeaderSize + 10000) +\n         (2 * log::kBlockSize - 1000) + 3 * kHeaderSize\n         + kHeaderSize + 1,\n     3 * log::kBlockSize,\n    };\n\n// LogTest::initial_offset_last_record_offsets_ must be defined before this.\nint LogTest::num_initial_offset_records_ =\n    sizeof(LogTest::initial_offset_last_record_offsets_)/sizeof(uint64_t);\n\nTEST(LogTest, Empty) {\n  ASSERT_EQ(\"EOF\", Read());\n}\n\nTEST(LogTest, ReadWrite) {\n  Write(\"foo\");\n  Write(\"bar\");\n  Write(\"\");\n  Write(\"xxxx\");\n  ASSERT_EQ(\"foo\", Read());\n  ASSERT_EQ(\"bar\", Read());\n  ASSERT_EQ(\"\", Read());\n  ASSERT_EQ(\"xxxx\", Read());\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(\"EOF\", Read());  // Make sure reads at eof work\n}\n\nTEST(LogTest, ManyBlocks) {\n  for (int i = 0; i < 100000; i++) {\n    Write(NumberString(i));\n  }\n  for (int i = 0; i < 100000; i++) {\n    ASSERT_EQ(NumberString(i), Read());\n  }\n  ASSERT_EQ(\"EOF\", Read());\n}\n\nTEST(LogTest, Fragmentation) {\n  Write(\"small\");\n  Write(BigString(\"medium\", 50000));\n  Write(BigString(\"large\", 100000));\n  ASSERT_EQ(\"small\", Read());\n  ASSERT_EQ(BigString(\"medium\", 50000), Read());\n  ASSERT_EQ(BigString(\"large\", 100000), Read());\n  ASSERT_EQ(\"EOF\", Read());\n}\n\nTEST(LogTest, MarginalTrailer) {\n  // Make a trailer that is exactly the same length as an empty record.\n  const int n = kBlockSize - 2*kHeaderSize;\n  Write(BigString(\"foo\", n));\n  ASSERT_EQ(kBlockSize - kHeaderSize, WrittenBytes());\n  Write(\"\");\n  Write(\"bar\");\n  ASSERT_EQ(BigString(\"foo\", n), Read());\n  ASSERT_EQ(\"\", Read());\n  ASSERT_EQ(\"bar\", Read());\n  ASSERT_EQ(\"EOF\", Read());\n}\n\nTEST(LogTest, MarginalTrailer2) {\n  // Make a trailer that is exactly the same length as an empty record.\n  const int n = kBlockSize - 2*kHeaderSize;\n  Write(BigString(\"foo\", n));\n  ASSERT_EQ(kBlockSize - kHeaderSize, WrittenBytes());\n  Write(\"bar\");\n  ASSERT_EQ(BigString(\"foo\", n), Read());\n  ASSERT_EQ(\"bar\", Read());\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(0, DroppedBytes());\n  ASSERT_EQ(\"\", ReportMessage());\n}\n\nTEST(LogTest, ShortTrailer) {\n  const int n = kBlockSize - 2*kHeaderSize + 4;\n  Write(BigString(\"foo\", n));\n  ASSERT_EQ(kBlockSize - kHeaderSize + 4, WrittenBytes());\n  Write(\"\");\n  Write(\"bar\");\n  ASSERT_EQ(BigString(\"foo\", n), Read());\n  ASSERT_EQ(\"\", Read());\n  ASSERT_EQ(\"bar\", Read());\n  ASSERT_EQ(\"EOF\", Read());\n}\n\nTEST(LogTest, AlignedEof) {\n  const int n = kBlockSize - 2*kHeaderSize + 4;\n  Write(BigString(\"foo\", n));\n  ASSERT_EQ(kBlockSize - kHeaderSize + 4, WrittenBytes());\n  ASSERT_EQ(BigString(\"foo\", n), Read());\n  ASSERT_EQ(\"EOF\", Read());\n}\n\nTEST(LogTest, OpenForAppend) {\n  Write(\"hello\");\n  ReopenForAppend();\n  Write(\"world\");\n  ASSERT_EQ(\"hello\", Read());\n  ASSERT_EQ(\"world\", Read());\n  ASSERT_EQ(\"EOF\", Read());\n}\n\nTEST(LogTest, RandomRead) {\n  const int N = 500;\n  Random write_rnd(301);\n  for (int i = 0; i < N; i++) {\n    Write(RandomSkewedString(i, &write_rnd));\n  }\n  Random read_rnd(301);\n  for (int i = 0; i < N; i++) {\n    ASSERT_EQ(RandomSkewedString(i, &read_rnd), Read());\n  }\n  ASSERT_EQ(\"EOF\", Read());\n}\n\n// Tests of all the error paths in log_reader.cc follow:\n\nTEST(LogTest, ReadError) {\n  Write(\"foo\");\n  ForceError();\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(kBlockSize, DroppedBytes());\n  ASSERT_EQ(\"OK\", MatchError(\"read error\"));\n}\n\nTEST(LogTest, BadRecordType) {\n  Write(\"foo\");\n  // Type is stored in header[6]\n  IncrementByte(6, 100);\n  FixChecksum(0, 3);\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(3, DroppedBytes());\n  ASSERT_EQ(\"OK\", MatchError(\"unknown record type\"));\n}\n\nTEST(LogTest, TruncatedTrailingRecordIsIgnored) {\n  Write(\"foo\");\n  ShrinkSize(4);   // Drop all payload as well as a header byte\n  ASSERT_EQ(\"EOF\", Read());\n  // Truncated last record is ignored, not treated as an error.\n  ASSERT_EQ(0, DroppedBytes());\n  ASSERT_EQ(\"\", ReportMessage());\n}\n\nTEST(LogTest, BadLength) {\n  const int kPayloadSize = kBlockSize - kHeaderSize;\n  Write(BigString(\"bar\", kPayloadSize));\n  Write(\"foo\");\n  // Least significant size byte is stored in header[4].\n  IncrementByte(4, 1);\n  ASSERT_EQ(\"foo\", Read());\n  ASSERT_EQ(kBlockSize, DroppedBytes());\n  ASSERT_EQ(\"OK\", MatchError(\"bad record length\"));\n}\n\nTEST(LogTest, BadLengthAtEndIsIgnored) {\n  Write(\"foo\");\n  ShrinkSize(1);\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(0, DroppedBytes());\n  ASSERT_EQ(\"\", ReportMessage());\n}\n\nTEST(LogTest, ChecksumMismatch) {\n  Write(\"foo\");\n  IncrementByte(0, 10);\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(10, DroppedBytes());\n  ASSERT_EQ(\"OK\", MatchError(\"checksum mismatch\"));\n}\n\nTEST(LogTest, UnexpectedMiddleType) {\n  Write(\"foo\");\n  SetByte(6, kMiddleType);\n  FixChecksum(0, 3);\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(3, DroppedBytes());\n  ASSERT_EQ(\"OK\", MatchError(\"missing start\"));\n}\n\nTEST(LogTest, UnexpectedLastType) {\n  Write(\"foo\");\n  SetByte(6, kLastType);\n  FixChecksum(0, 3);\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(3, DroppedBytes());\n  ASSERT_EQ(\"OK\", MatchError(\"missing start\"));\n}\n\nTEST(LogTest, UnexpectedFullType) {\n  Write(\"foo\");\n  Write(\"bar\");\n  SetByte(6, kFirstType);\n  FixChecksum(0, 3);\n  ASSERT_EQ(\"bar\", Read());\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(3, DroppedBytes());\n  ASSERT_EQ(\"OK\", MatchError(\"partial record without end\"));\n}\n\nTEST(LogTest, UnexpectedFirstType) {\n  Write(\"foo\");\n  Write(BigString(\"bar\", 100000));\n  SetByte(6, kFirstType);\n  FixChecksum(0, 3);\n  ASSERT_EQ(BigString(\"bar\", 100000), Read());\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(3, DroppedBytes());\n  ASSERT_EQ(\"OK\", MatchError(\"partial record without end\"));\n}\n\nTEST(LogTest, MissingLastIsIgnored) {\n  Write(BigString(\"bar\", kBlockSize));\n  // Remove the LAST block, including header.\n  ShrinkSize(14);\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(\"\", ReportMessage());\n  ASSERT_EQ(0, DroppedBytes());\n}\n\nTEST(LogTest, PartialLastIsIgnored) {\n  Write(BigString(\"bar\", kBlockSize));\n  // Cause a bad record length in the LAST block.\n  ShrinkSize(1);\n  ASSERT_EQ(\"EOF\", Read());\n  ASSERT_EQ(\"\", ReportMessage());\n  ASSERT_EQ(0, DroppedBytes());\n}\n\nTEST(LogTest, SkipIntoMultiRecord) {\n  // Consider a fragmented record:\n  //    first(R1), middle(R1), last(R1), first(R2)\n  // If initial_offset points to a record after first(R1) but before first(R2)\n  // incomplete fragment errors are not actual errors, and must be suppressed\n  // until a new first or full record is encountered.\n  Write(BigString(\"foo\", 3*kBlockSize));\n  Write(\"correct\");\n  StartReadingAt(kBlockSize);\n\n  ASSERT_EQ(\"correct\", Read());\n  ASSERT_EQ(\"\", ReportMessage());\n  ASSERT_EQ(0, DroppedBytes());\n  ASSERT_EQ(\"EOF\", Read());\n}\n\nTEST(LogTest, ErrorJoinsRecords) {\n  // Consider two fragmented records:\n  //    first(R1) last(R1) first(R2) last(R2)\n  // where the middle two fragments disappear.  We do not want\n  // first(R1),last(R2) to get joined and returned as a valid record.\n\n  // Write records that span two blocks\n  Write(BigString(\"foo\", kBlockSize));\n  Write(BigString(\"bar\", kBlockSize));\n  Write(\"correct\");\n\n  // Wipe the middle block\n  for (int offset = kBlockSize; offset < 2*kBlockSize; offset++) {\n    SetByte(offset, 'x');\n  }\n\n  ASSERT_EQ(\"correct\", Read());\n  ASSERT_EQ(\"EOF\", Read());\n  const size_t dropped = DroppedBytes();\n  ASSERT_LE(dropped, 2*kBlockSize + 100);\n  ASSERT_GE(dropped, 2*kBlockSize);\n}\n\nTEST(LogTest, ReadStart) {\n  CheckInitialOffsetRecord(0, 0);\n}\n\nTEST(LogTest, ReadSecondOneOff) {\n  CheckInitialOffsetRecord(1, 1);\n}\n\nTEST(LogTest, ReadSecondTenThousand) {\n  CheckInitialOffsetRecord(10000, 1);\n}\n\nTEST(LogTest, ReadSecondStart) {\n  CheckInitialOffsetRecord(10007, 1);\n}\n\nTEST(LogTest, ReadThirdOneOff) {\n  CheckInitialOffsetRecord(10008, 2);\n}\n\nTEST(LogTest, ReadThirdStart) {\n  CheckInitialOffsetRecord(20014, 2);\n}\n\nTEST(LogTest, ReadFourthOneOff) {\n  CheckInitialOffsetRecord(20015, 3);\n}\n\nTEST(LogTest, ReadFourthFirstBlockTrailer) {\n  CheckInitialOffsetRecord(log::kBlockSize - 4, 3);\n}\n\nTEST(LogTest, ReadFourthMiddleBlock) {\n  CheckInitialOffsetRecord(log::kBlockSize + 1, 3);\n}\n\nTEST(LogTest, ReadFourthLastBlock) {\n  CheckInitialOffsetRecord(2 * log::kBlockSize + 1, 3);\n}\n\nTEST(LogTest, ReadFourthStart) {\n  CheckInitialOffsetRecord(\n      2 * (kHeaderSize + 1000) + (2 * log::kBlockSize - 1000) + 3 * kHeaderSize,\n      3);\n}\n\nTEST(LogTest, ReadInitialOffsetIntoBlockPadding) {\n  CheckInitialOffsetRecord(3 * log::kBlockSize - 3, 5);\n}\n\nTEST(LogTest, ReadEnd) {\n  CheckOffsetPastEndReturnsNoRecords(0);\n}\n\nTEST(LogTest, ReadPastEnd) {\n  CheckOffsetPastEndReturnsNoRecords(5);\n}\n\n}  // namespace log\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/log_writer.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/log_writer.h\"\n\n#include <stdint.h>\n#include \"leveldb/env.h\"\n#include \"util/coding.h\"\n#include \"util/crc32c.h\"\n\nnamespace leveldb {\nnamespace log {\n\nstatic void InitTypeCrc(uint32_t* type_crc) {\n  for (int i = 0; i <= kMaxRecordType; i++) {\n    char t = static_cast<char>(i);\n    type_crc[i] = crc32c::Value(&t, 1);\n  }\n}\n\nWriter::Writer(WritableFile* dest)\n    : dest_(dest),\n      block_offset_(0) {\n  InitTypeCrc(type_crc_);\n}\n\nWriter::Writer(WritableFile* dest, uint64_t dest_length)\n    : dest_(dest), block_offset_(dest_length % kBlockSize) {\n  InitTypeCrc(type_crc_);\n}\n\nWriter::~Writer() {\n}\n\nStatus Writer::AddRecord(const Slice& slice) {\n  const char* ptr = slice.data();\n  size_t left = slice.size();\n\n  // Fragment the record if necessary and emit it.  Note that if slice\n  // is empty, we still want to iterate once to emit a single\n  // zero-length record\n  Status s;\n  bool begin = true;\n  do {\n    const int leftover = kBlockSize - block_offset_;\n    assert(leftover >= 0);\n    if (leftover < kHeaderSize) {\n      // Switch to a new block\n      if (leftover > 0) {\n        // Fill the trailer (literal below relies on kHeaderSize being 7)\n        assert(kHeaderSize == 7);\n        dest_->Append(Slice(\"\\x00\\x00\\x00\\x00\\x00\\x00\", leftover));\n      }\n      block_offset_ = 0;\n    }\n\n    // Invariant: we never leave < kHeaderSize bytes in a block.\n    assert(kBlockSize - block_offset_ - kHeaderSize >= 0);\n\n    const size_t avail = kBlockSize - block_offset_ - kHeaderSize;\n    const size_t fragment_length = (left < avail) ? left : avail;\n\n    RecordType type;\n    const bool end = (left == fragment_length);\n    if (begin && end) {\n      type = kFullType;\n    } else if (begin) {\n      type = kFirstType;\n    } else if (end) {\n      type = kLastType;\n    } else {\n      type = kMiddleType;\n    }\n\n    s = EmitPhysicalRecord(type, ptr, fragment_length);\n    ptr += fragment_length;\n    left -= fragment_length;\n    begin = false;\n  } while (s.ok() && left > 0);\n  return s;\n}\n\nStatus Writer::EmitPhysicalRecord(RecordType t, const char* ptr, size_t n) {\n  assert(n <= 0xffff);  // Must fit in two bytes\n  assert(block_offset_ + kHeaderSize + n <= kBlockSize);\n\n  // Format the header\n  char buf[kHeaderSize];\n  buf[4] = static_cast<char>(n & 0xff);\n  buf[5] = static_cast<char>(n >> 8);\n  buf[6] = static_cast<char>(t);\n\n  // Compute the crc of the record type and the payload.\n  uint32_t crc = crc32c::Extend(type_crc_[t], ptr, n);\n  crc = crc32c::Mask(crc);                 // Adjust for storage\n  EncodeFixed32(buf, crc);\n\n  // Write the header and the payload\n  Status s = dest_->Append(Slice(buf, kHeaderSize));\n  if (s.ok()) {\n    s = dest_->Append(Slice(ptr, n));\n    if (s.ok()) {\n      s = dest_->Flush();\n    }\n  }\n  block_offset_ += kHeaderSize + n;\n  return s;\n}\n\n}  // namespace log\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/log_writer.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_LOG_WRITER_H_\n#define STORAGE_LEVELDB_DB_LOG_WRITER_H_\n\n#include <stdint.h>\n#include \"db/log_format.h\"\n#include \"leveldb/slice.h\"\n#include \"leveldb/status.h\"\n\nnamespace leveldb {\n\nclass WritableFile;\n\nnamespace log {\n\nclass Writer {\n public:\n  // Create a writer that will append data to \"*dest\".\n  // \"*dest\" must be initially empty.\n  // \"*dest\" must remain live while this Writer is in use.\n  explicit Writer(WritableFile* dest);\n\n  // Create a writer that will append data to \"*dest\".\n  // \"*dest\" must have initial length \"dest_length\".\n  // \"*dest\" must remain live while this Writer is in use.\n  Writer(WritableFile* dest, uint64_t dest_length);\n\n  ~Writer();\n\n  Status AddRecord(const Slice& slice);\n\n private:\n  WritableFile* dest_;\n  int block_offset_;       // Current offset in block\n\n  // crc32c values for all supported record types.  These are\n  // pre-computed to reduce the overhead of computing the crc of the\n  // record type stored in the header.\n  uint32_t type_crc_[kMaxRecordType + 1];\n\n  Status EmitPhysicalRecord(RecordType type, const char* ptr, size_t length);\n\n  // No copying allowed\n  Writer(const Writer&);\n  void operator=(const Writer&);\n};\n\n}  // namespace log\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_LOG_WRITER_H_\n"
  },
  {
    "path": "src/leveldb/db/memtable.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/memtable.h\"\n#include \"db/dbformat.h\"\n#include \"leveldb/comparator.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/iterator.h\"\n#include \"util/coding.h\"\n\nnamespace leveldb {\n\nstatic Slice GetLengthPrefixedSlice(const char* data) {\n  uint32_t len;\n  const char* p = data;\n  p = GetVarint32Ptr(p, p + 5, &len);  // +5: we assume \"p\" is not corrupted\n  return Slice(p, len);\n}\n\nMemTable::MemTable(const InternalKeyComparator& cmp)\n    : comparator_(cmp),\n      refs_(0),\n      table_(comparator_, &arena_) {\n}\n\nMemTable::~MemTable() {\n  assert(refs_ == 0);\n}\n\nsize_t MemTable::ApproximateMemoryUsage() { return arena_.MemoryUsage(); }\n\nint MemTable::KeyComparator::operator()(const char* aptr, const char* bptr)\n    const {\n  // Internal keys are encoded as length-prefixed strings.\n  Slice a = GetLengthPrefixedSlice(aptr);\n  Slice b = GetLengthPrefixedSlice(bptr);\n  return comparator.Compare(a, b);\n}\n\n// Encode a suitable internal key target for \"target\" and return it.\n// Uses *scratch as scratch space, and the returned pointer will point\n// into this scratch space.\nstatic const char* EncodeKey(std::string* scratch, const Slice& target) {\n  scratch->clear();\n  PutVarint32(scratch, target.size());\n  scratch->append(target.data(), target.size());\n  return scratch->data();\n}\n\nclass MemTableIterator: public Iterator {\n public:\n  explicit MemTableIterator(MemTable::Table* table) : iter_(table) { }\n\n  virtual bool Valid() const { return iter_.Valid(); }\n  virtual void Seek(const Slice& k) { iter_.Seek(EncodeKey(&tmp_, k)); }\n  virtual void SeekToFirst() { iter_.SeekToFirst(); }\n  virtual void SeekToLast() { iter_.SeekToLast(); }\n  virtual void Next() { iter_.Next(); }\n  virtual void Prev() { iter_.Prev(); }\n  virtual Slice key() const { return GetLengthPrefixedSlice(iter_.key()); }\n  virtual Slice value() const {\n    Slice key_slice = GetLengthPrefixedSlice(iter_.key());\n    return GetLengthPrefixedSlice(key_slice.data() + key_slice.size());\n  }\n\n  virtual Status status() const { return Status::OK(); }\n\n private:\n  MemTable::Table::Iterator iter_;\n  std::string tmp_;       // For passing to EncodeKey\n\n  // No copying allowed\n  MemTableIterator(const MemTableIterator&);\n  void operator=(const MemTableIterator&);\n};\n\nIterator* MemTable::NewIterator() {\n  return new MemTableIterator(&table_);\n}\n\nvoid MemTable::Add(SequenceNumber s, ValueType type,\n                   const Slice& key,\n                   const Slice& value) {\n  // Format of an entry is concatenation of:\n  //  key_size     : varint32 of internal_key.size()\n  //  key bytes    : char[internal_key.size()]\n  //  value_size   : varint32 of value.size()\n  //  value bytes  : char[value.size()]\n  size_t key_size = key.size();\n  size_t val_size = value.size();\n  size_t internal_key_size = key_size + 8;\n  const size_t encoded_len =\n      VarintLength(internal_key_size) + internal_key_size +\n      VarintLength(val_size) + val_size;\n  char* buf = arena_.Allocate(encoded_len);\n  char* p = EncodeVarint32(buf, internal_key_size);\n  memcpy(p, key.data(), key_size);\n  p += key_size;\n  EncodeFixed64(p, (s << 8) | type);\n  p += 8;\n  p = EncodeVarint32(p, val_size);\n  memcpy(p, value.data(), val_size);\n  assert(p + val_size == buf + encoded_len);\n  table_.Insert(buf);\n}\n\nbool MemTable::Get(const LookupKey& key, std::string* value, Status* s) {\n  Slice memkey = key.memtable_key();\n  Table::Iterator iter(&table_);\n  iter.Seek(memkey.data());\n  if (iter.Valid()) {\n    // entry format is:\n    //    klength  varint32\n    //    userkey  char[klength]\n    //    tag      uint64\n    //    vlength  varint32\n    //    value    char[vlength]\n    // Check that it belongs to same user key.  We do not check the\n    // sequence number since the Seek() call above should have skipped\n    // all entries with overly large sequence numbers.\n    const char* entry = iter.key();\n    uint32_t key_length;\n    const char* key_ptr = GetVarint32Ptr(entry, entry+5, &key_length);\n    if (comparator_.comparator.user_comparator()->Compare(\n            Slice(key_ptr, key_length - 8),\n            key.user_key()) == 0) {\n      // Correct user key\n      const uint64_t tag = DecodeFixed64(key_ptr + key_length - 8);\n      switch (static_cast<ValueType>(tag & 0xff)) {\n        case kTypeValue: {\n          Slice v = GetLengthPrefixedSlice(key_ptr + key_length);\n          value->assign(v.data(), v.size());\n          return true;\n        }\n        case kTypeDeletion:\n          *s = Status::NotFound(Slice());\n          return true;\n      }\n    }\n  }\n  return false;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/memtable.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_MEMTABLE_H_\n#define STORAGE_LEVELDB_DB_MEMTABLE_H_\n\n#include <string>\n#include \"leveldb/db.h\"\n#include \"db/dbformat.h\"\n#include \"db/skiplist.h\"\n#include \"util/arena.h\"\n\nnamespace leveldb {\n\nclass InternalKeyComparator;\nclass Mutex;\nclass MemTableIterator;\n\nclass MemTable {\n public:\n  // MemTables are reference counted.  The initial reference count\n  // is zero and the caller must call Ref() at least once.\n  explicit MemTable(const InternalKeyComparator& comparator);\n\n  // Increase reference count.\n  void Ref() { ++refs_; }\n\n  // Drop reference count.  Delete if no more references exist.\n  void Unref() {\n    --refs_;\n    assert(refs_ >= 0);\n    if (refs_ <= 0) {\n      delete this;\n    }\n  }\n\n  // Returns an estimate of the number of bytes of data in use by this\n  // data structure. It is safe to call when MemTable is being modified.\n  size_t ApproximateMemoryUsage();\n\n  // Return an iterator that yields the contents of the memtable.\n  //\n  // The caller must ensure that the underlying MemTable remains live\n  // while the returned iterator is live.  The keys returned by this\n  // iterator are internal keys encoded by AppendInternalKey in the\n  // db/format.{h,cc} module.\n  Iterator* NewIterator();\n\n  // Add an entry into memtable that maps key to value at the\n  // specified sequence number and with the specified type.\n  // Typically value will be empty if type==kTypeDeletion.\n  void Add(SequenceNumber seq, ValueType type,\n           const Slice& key,\n           const Slice& value);\n\n  // If memtable contains a value for key, store it in *value and return true.\n  // If memtable contains a deletion for key, store a NotFound() error\n  // in *status and return true.\n  // Else, return false.\n  bool Get(const LookupKey& key, std::string* value, Status* s);\n\n private:\n  ~MemTable();  // Private since only Unref() should be used to delete it\n\n  struct KeyComparator {\n    const InternalKeyComparator comparator;\n    explicit KeyComparator(const InternalKeyComparator& c) : comparator(c) { }\n    int operator()(const char* a, const char* b) const;\n  };\n  friend class MemTableIterator;\n  friend class MemTableBackwardIterator;\n\n  typedef SkipList<const char*, KeyComparator> Table;\n\n  KeyComparator comparator_;\n  int refs_;\n  Arena arena_;\n  Table table_;\n\n  // No copying allowed\n  MemTable(const MemTable&);\n  void operator=(const MemTable&);\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_MEMTABLE_H_\n"
  },
  {
    "path": "src/leveldb/db/recovery_test.cc",
    "content": "// Copyright (c) 2014 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/db_impl.h\"\n#include \"db/filename.h\"\n#include \"db/version_set.h\"\n#include \"db/write_batch_internal.h\"\n#include \"leveldb/db.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/write_batch.h\"\n#include \"util/logging.h\"\n#include \"util/testharness.h\"\n#include \"util/testutil.h\"\n\nnamespace leveldb {\n\nclass RecoveryTest {\n public:\n  RecoveryTest() : env_(Env::Default()), db_(NULL) {\n    dbname_ = test::TmpDir() + \"/recovery_test\";\n    DestroyDB(dbname_, Options());\n    Open();\n  }\n\n  ~RecoveryTest() {\n    Close();\n    DestroyDB(dbname_, Options());\n  }\n\n  DBImpl* dbfull() const { return reinterpret_cast<DBImpl*>(db_); }\n  Env* env() const { return env_; }\n\n  bool CanAppend() {\n    WritableFile* tmp;\n    Status s = env_->NewAppendableFile(CurrentFileName(dbname_), &tmp);\n    delete tmp;\n    if (s.IsNotSupportedError()) {\n      return false;\n    } else {\n      return true;\n    }\n  }\n\n  void Close() {\n    delete db_;\n    db_ = NULL;\n  }\n\n  void Open(Options* options = NULL) {\n    Close();\n    Options opts;\n    if (options != NULL) {\n      opts = *options;\n    } else {\n      opts.reuse_logs = true;  // TODO(sanjay): test both ways\n      opts.create_if_missing = true;\n    }\n    if (opts.env == NULL) {\n      opts.env = env_;\n    }\n    ASSERT_OK(DB::Open(opts, dbname_, &db_));\n    ASSERT_EQ(1, NumLogs());\n  }\n\n  Status Put(const std::string& k, const std::string& v) {\n    return db_->Put(WriteOptions(), k, v);\n  }\n\n  std::string Get(const std::string& k, const Snapshot* snapshot = NULL) {\n    std::string result;\n    Status s = db_->Get(ReadOptions(), k, &result);\n    if (s.IsNotFound()) {\n      result = \"NOT_FOUND\";\n    } else if (!s.ok()) {\n      result = s.ToString();\n    }\n    return result;\n  }\n\n  std::string ManifestFileName() {\n    std::string current;\n    ASSERT_OK(ReadFileToString(env_, CurrentFileName(dbname_), &current));\n    size_t len = current.size();\n    if (len > 0 && current[len-1] == '\\n') {\n      current.resize(len - 1);\n    }\n    return dbname_ + \"/\" + current;\n  }\n\n  std::string LogName(uint64_t number) {\n    return LogFileName(dbname_, number);\n  }\n\n  size_t DeleteLogFiles() {\n    std::vector<uint64_t> logs = GetFiles(kLogFile);\n    for (size_t i = 0; i < logs.size(); i++) {\n      ASSERT_OK(env_->DeleteFile(LogName(logs[i]))) << LogName(logs[i]);\n    }\n    return logs.size();\n  }\n\n  uint64_t FirstLogFile() {\n    return GetFiles(kLogFile)[0];\n  }\n\n  std::vector<uint64_t> GetFiles(FileType t) {\n    std::vector<std::string> filenames;\n    ASSERT_OK(env_->GetChildren(dbname_, &filenames));\n    std::vector<uint64_t> result;\n    for (size_t i = 0; i < filenames.size(); i++) {\n      uint64_t number;\n      FileType type;\n      if (ParseFileName(filenames[i], &number, &type) && type == t) {\n        result.push_back(number);\n      }\n    }\n    return result;\n  }\n\n  int NumLogs() {\n    return GetFiles(kLogFile).size();\n  }\n\n  int NumTables() {\n    return GetFiles(kTableFile).size();\n  }\n\n  uint64_t FileSize(const std::string& fname) {\n    uint64_t result;\n    ASSERT_OK(env_->GetFileSize(fname, &result)) << fname;\n    return result;\n  }\n\n  void CompactMemTable() {\n    dbfull()->TEST_CompactMemTable();\n  }\n\n  // Directly construct a log file that sets key to val.\n  void MakeLogFile(uint64_t lognum, SequenceNumber seq, Slice key, Slice val) {\n    std::string fname = LogFileName(dbname_, lognum);\n    WritableFile* file;\n    ASSERT_OK(env_->NewWritableFile(fname, &file));\n    log::Writer writer(file);\n    WriteBatch batch;\n    batch.Put(key, val);\n    WriteBatchInternal::SetSequence(&batch, seq);\n    ASSERT_OK(writer.AddRecord(WriteBatchInternal::Contents(&batch)));\n    ASSERT_OK(file->Flush());\n    delete file;\n  }\n\n private:\n  std::string dbname_;\n  Env* env_;\n  DB* db_;\n};\n\nTEST(RecoveryTest, ManifestReused) {\n  if (!CanAppend()) {\n    fprintf(stderr, \"skipping test because env does not support appending\\n\");\n    return;\n  }\n  ASSERT_OK(Put(\"foo\", \"bar\"));\n  Close();\n  std::string old_manifest = ManifestFileName();\n  Open();\n  ASSERT_EQ(old_manifest, ManifestFileName());\n  ASSERT_EQ(\"bar\", Get(\"foo\"));\n  Open();\n  ASSERT_EQ(old_manifest, ManifestFileName());\n  ASSERT_EQ(\"bar\", Get(\"foo\"));\n}\n\nTEST(RecoveryTest, LargeManifestCompacted) {\n  if (!CanAppend()) {\n    fprintf(stderr, \"skipping test because env does not support appending\\n\");\n    return;\n  }\n  ASSERT_OK(Put(\"foo\", \"bar\"));\n  Close();\n  std::string old_manifest = ManifestFileName();\n\n  // Pad with zeroes to make manifest file very big.\n  {\n    uint64_t len = FileSize(old_manifest);\n    WritableFile* file;\n    ASSERT_OK(env()->NewAppendableFile(old_manifest, &file));\n    std::string zeroes(3*1048576 - static_cast<size_t>(len), 0);\n    ASSERT_OK(file->Append(zeroes));\n    ASSERT_OK(file->Flush());\n    delete file;\n  }\n\n  Open();\n  std::string new_manifest = ManifestFileName();\n  ASSERT_NE(old_manifest, new_manifest);\n  ASSERT_GT(10000, FileSize(new_manifest));\n  ASSERT_EQ(\"bar\", Get(\"foo\"));\n\n  Open();\n  ASSERT_EQ(new_manifest, ManifestFileName());\n  ASSERT_EQ(\"bar\", Get(\"foo\"));\n}\n\nTEST(RecoveryTest, NoLogFiles) {\n  ASSERT_OK(Put(\"foo\", \"bar\"));\n  ASSERT_EQ(1, DeleteLogFiles());\n  Open();\n  ASSERT_EQ(\"NOT_FOUND\", Get(\"foo\"));\n  Open();\n  ASSERT_EQ(\"NOT_FOUND\", Get(\"foo\"));\n}\n\nTEST(RecoveryTest, LogFileReuse) {\n  if (!CanAppend()) {\n    fprintf(stderr, \"skipping test because env does not support appending\\n\");\n    return;\n  }\n  for (int i = 0; i < 2; i++) {\n    ASSERT_OK(Put(\"foo\", \"bar\"));\n    if (i == 0) {\n      // Compact to ensure current log is empty\n      CompactMemTable();\n    }\n    Close();\n    ASSERT_EQ(1, NumLogs());\n    uint64_t number = FirstLogFile();\n    if (i == 0) {\n      ASSERT_EQ(0, FileSize(LogName(number)));\n    } else {\n      ASSERT_LT(0, FileSize(LogName(number)));\n    }\n    Open();\n    ASSERT_EQ(1, NumLogs());\n    ASSERT_EQ(number, FirstLogFile()) << \"did not reuse log file\";\n    ASSERT_EQ(\"bar\", Get(\"foo\"));\n    Open();\n    ASSERT_EQ(1, NumLogs());\n    ASSERT_EQ(number, FirstLogFile()) << \"did not reuse log file\";\n    ASSERT_EQ(\"bar\", Get(\"foo\"));\n  }\n}\n\nTEST(RecoveryTest, MultipleMemTables) {\n  // Make a large log.\n  const int kNum = 1000;\n  for (int i = 0; i < kNum; i++) {\n    char buf[100];\n    snprintf(buf, sizeof(buf), \"%050d\", i);\n    ASSERT_OK(Put(buf, buf));\n  }\n  ASSERT_EQ(0, NumTables());\n  Close();\n  ASSERT_EQ(0, NumTables());\n  ASSERT_EQ(1, NumLogs());\n  uint64_t old_log_file = FirstLogFile();\n\n  // Force creation of multiple memtables by reducing the write buffer size.\n  Options opt;\n  opt.reuse_logs = true;\n  opt.write_buffer_size = (kNum*100) / 2;\n  Open(&opt);\n  ASSERT_LE(2, NumTables());\n  ASSERT_EQ(1, NumLogs());\n  ASSERT_NE(old_log_file, FirstLogFile()) << \"must not reuse log\";\n  for (int i = 0; i < kNum; i++) {\n    char buf[100];\n    snprintf(buf, sizeof(buf), \"%050d\", i);\n    ASSERT_EQ(buf, Get(buf));\n  }\n}\n\nTEST(RecoveryTest, MultipleLogFiles) {\n  ASSERT_OK(Put(\"foo\", \"bar\"));\n  Close();\n  ASSERT_EQ(1, NumLogs());\n\n  // Make a bunch of uncompacted log files.\n  uint64_t old_log = FirstLogFile();\n  MakeLogFile(old_log+1, 1000, \"hello\", \"world\");\n  MakeLogFile(old_log+2, 1001, \"hi\", \"there\");\n  MakeLogFile(old_log+3, 1002, \"foo\", \"bar2\");\n\n  // Recover and check that all log files were processed.\n  Open();\n  ASSERT_LE(1, NumTables());\n  ASSERT_EQ(1, NumLogs());\n  uint64_t new_log = FirstLogFile();\n  ASSERT_LE(old_log+3, new_log);\n  ASSERT_EQ(\"bar2\", Get(\"foo\"));\n  ASSERT_EQ(\"world\", Get(\"hello\"));\n  ASSERT_EQ(\"there\", Get(\"hi\"));\n\n  // Test that previous recovery produced recoverable state.\n  Open();\n  ASSERT_LE(1, NumTables());\n  ASSERT_EQ(1, NumLogs());\n  if (CanAppend()) {\n    ASSERT_EQ(new_log, FirstLogFile());\n  }\n  ASSERT_EQ(\"bar2\", Get(\"foo\"));\n  ASSERT_EQ(\"world\", Get(\"hello\"));\n  ASSERT_EQ(\"there\", Get(\"hi\"));\n\n  // Check that introducing an older log file does not cause it to be re-read.\n  Close();\n  MakeLogFile(old_log+1, 2000, \"hello\", \"stale write\");\n  Open();\n  ASSERT_LE(1, NumTables());\n  ASSERT_EQ(1, NumLogs());\n  if (CanAppend()) {\n    ASSERT_EQ(new_log, FirstLogFile());\n  }\n  ASSERT_EQ(\"bar2\", Get(\"foo\"));\n  ASSERT_EQ(\"world\", Get(\"hello\"));\n  ASSERT_EQ(\"there\", Get(\"hi\"));\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/repair.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// We recover the contents of the descriptor from the other files we find.\n// (1) Any log files are first converted to tables\n// (2) We scan every table to compute\n//     (a) smallest/largest for the table\n//     (b) largest sequence number in the table\n// (3) We generate descriptor contents:\n//      - log number is set to zero\n//      - next-file-number is set to 1 + largest file number we found\n//      - last-sequence-number is set to largest sequence# found across\n//        all tables (see 2c)\n//      - compaction pointers are cleared\n//      - every table file is added at level 0\n//\n// Possible optimization 1:\n//   (a) Compute total size and use to pick appropriate max-level M\n//   (b) Sort tables by largest sequence# in the table\n//   (c) For each table: if it overlaps earlier table, place in level-0,\n//       else place in level-M.\n// Possible optimization 2:\n//   Store per-table metadata (smallest, largest, largest-seq#, ...)\n//   in the table's meta section to speed up ScanTable.\n\n#include \"db/builder.h\"\n#include \"db/db_impl.h\"\n#include \"db/dbformat.h\"\n#include \"db/filename.h\"\n#include \"db/log_reader.h\"\n#include \"db/log_writer.h\"\n#include \"db/memtable.h\"\n#include \"db/table_cache.h\"\n#include \"db/version_edit.h\"\n#include \"db/write_batch_internal.h\"\n#include \"leveldb/comparator.h\"\n#include \"leveldb/db.h\"\n#include \"leveldb/env.h\"\n\nnamespace leveldb {\n\nnamespace {\n\nclass Repairer {\n public:\n  Repairer(const std::string& dbname, const Options& options)\n      : dbname_(dbname),\n        env_(options.env),\n        icmp_(options.comparator),\n        ipolicy_(options.filter_policy),\n        options_(SanitizeOptions(dbname, &icmp_, &ipolicy_, options)),\n        owns_info_log_(options_.info_log != options.info_log),\n        owns_cache_(options_.block_cache != options.block_cache),\n        next_file_number_(1) {\n    // TableCache can be small since we expect each table to be opened once.\n    table_cache_ = new TableCache(dbname_, &options_, 10);\n  }\n\n  ~Repairer() {\n    delete table_cache_;\n    if (owns_info_log_) {\n      delete options_.info_log;\n    }\n    if (owns_cache_) {\n      delete options_.block_cache;\n    }\n  }\n\n  Status Run() {\n    Status status = FindFiles();\n    if (status.ok()) {\n      ConvertLogFilesToTables();\n      ExtractMetaData();\n      status = WriteDescriptor();\n    }\n    if (status.ok()) {\n      unsigned long long bytes = 0;\n      for (size_t i = 0; i < tables_.size(); i++) {\n        bytes += tables_[i].meta.file_size;\n      }\n      Log(options_.info_log,\n          \"**** Repaired leveldb %s; \"\n          \"recovered %d files; %llu bytes. \"\n          \"Some data may have been lost. \"\n          \"****\",\n          dbname_.c_str(),\n          static_cast<int>(tables_.size()),\n          bytes);\n    }\n    return status;\n  }\n\n private:\n  struct TableInfo {\n    FileMetaData meta;\n    SequenceNumber max_sequence;\n  };\n\n  std::string const dbname_;\n  Env* const env_;\n  InternalKeyComparator const icmp_;\n  InternalFilterPolicy const ipolicy_;\n  Options const options_;\n  bool owns_info_log_;\n  bool owns_cache_;\n  TableCache* table_cache_;\n  VersionEdit edit_;\n\n  std::vector<std::string> manifests_;\n  std::vector<uint64_t> table_numbers_;\n  std::vector<uint64_t> logs_;\n  std::vector<TableInfo> tables_;\n  uint64_t next_file_number_;\n\n  Status FindFiles() {\n    std::vector<std::string> filenames;\n    Status status = env_->GetChildren(dbname_, &filenames);\n    if (!status.ok()) {\n      return status;\n    }\n    if (filenames.empty()) {\n      return Status::IOError(dbname_, \"repair found no files\");\n    }\n\n    uint64_t number;\n    FileType type;\n    for (size_t i = 0; i < filenames.size(); i++) {\n      if (ParseFileName(filenames[i], &number, &type)) {\n        if (type == kDescriptorFile) {\n          manifests_.push_back(filenames[i]);\n        } else {\n          if (number + 1 > next_file_number_) {\n            next_file_number_ = number + 1;\n          }\n          if (type == kLogFile) {\n            logs_.push_back(number);\n          } else if (type == kTableFile) {\n            table_numbers_.push_back(number);\n          } else {\n            // Ignore other files\n          }\n        }\n      }\n    }\n    return status;\n  }\n\n  void ConvertLogFilesToTables() {\n    for (size_t i = 0; i < logs_.size(); i++) {\n      std::string logname = LogFileName(dbname_, logs_[i]);\n      Status status = ConvertLogToTable(logs_[i]);\n      if (!status.ok()) {\n        Log(options_.info_log, \"Log #%llu: ignoring conversion error: %s\",\n            (unsigned long long) logs_[i],\n            status.ToString().c_str());\n      }\n      ArchiveFile(logname);\n    }\n  }\n\n  Status ConvertLogToTable(uint64_t log) {\n    struct LogReporter : public log::Reader::Reporter {\n      Env* env;\n      Logger* info_log;\n      uint64_t lognum;\n      virtual void Corruption(size_t bytes, const Status& s) {\n        // We print error messages for corruption, but continue repairing.\n        Log(info_log, \"Log #%llu: dropping %d bytes; %s\",\n            (unsigned long long) lognum,\n            static_cast<int>(bytes),\n            s.ToString().c_str());\n      }\n    };\n\n    // Open the log file\n    std::string logname = LogFileName(dbname_, log);\n    SequentialFile* lfile;\n    Status status = env_->NewSequentialFile(logname, &lfile);\n    if (!status.ok()) {\n      return status;\n    }\n\n    // Create the log reader.\n    LogReporter reporter;\n    reporter.env = env_;\n    reporter.info_log = options_.info_log;\n    reporter.lognum = log;\n    // We intentionally make log::Reader do checksumming so that\n    // corruptions cause entire commits to be skipped instead of\n    // propagating bad information (like overly large sequence\n    // numbers).\n    log::Reader reader(lfile, &reporter, false/*do not checksum*/,\n                       0/*initial_offset*/);\n\n    // Read all the records and add to a memtable\n    std::string scratch;\n    Slice record;\n    WriteBatch batch;\n    MemTable* mem = new MemTable(icmp_);\n    mem->Ref();\n    int counter = 0;\n    while (reader.ReadRecord(&record, &scratch)) {\n      if (record.size() < 12) {\n        reporter.Corruption(\n            record.size(), Status::Corruption(\"log record too small\", logname));\n        continue;\n      }\n      WriteBatchInternal::SetContents(&batch, record);\n      status = WriteBatchInternal::InsertInto(&batch, mem);\n      if (status.ok()) {\n        counter += WriteBatchInternal::Count(&batch);\n      } else {\n        Log(options_.info_log, \"Log #%llu: ignoring %s\",\n            (unsigned long long) log,\n            status.ToString().c_str());\n        status = Status::OK();  // Keep going with rest of file\n      }\n    }\n    delete lfile;\n\n    // Do not record a version edit for this conversion to a Table\n    // since ExtractMetaData() will also generate edits.\n    FileMetaData meta;\n    meta.number = next_file_number_++;\n    Iterator* iter = mem->NewIterator();\n    status = BuildTable(dbname_, env_, options_, table_cache_, iter, &meta);\n    delete iter;\n    mem->Unref();\n    mem = NULL;\n    if (status.ok()) {\n      if (meta.file_size > 0) {\n        table_numbers_.push_back(meta.number);\n      }\n    }\n    Log(options_.info_log, \"Log #%llu: %d ops saved to Table #%llu %s\",\n        (unsigned long long) log,\n        counter,\n        (unsigned long long) meta.number,\n        status.ToString().c_str());\n    return status;\n  }\n\n  void ExtractMetaData() {\n    for (size_t i = 0; i < table_numbers_.size(); i++) {\n      ScanTable(table_numbers_[i]);\n    }\n  }\n\n  Iterator* NewTableIterator(const FileMetaData& meta) {\n    // Same as compaction iterators: if paranoid_checks are on, turn\n    // on checksum verification.\n    ReadOptions r;\n    r.verify_checksums = options_.paranoid_checks;\n    return table_cache_->NewIterator(r, meta.number, meta.file_size);\n  }\n\n  void ScanTable(uint64_t number) {\n    TableInfo t;\n    t.meta.number = number;\n    std::string fname = TableFileName(dbname_, number);\n    Status status = env_->GetFileSize(fname, &t.meta.file_size);\n    if (!status.ok()) {\n      // Try alternate file name.\n      fname = SSTTableFileName(dbname_, number);\n      Status s2 = env_->GetFileSize(fname, &t.meta.file_size);\n      if (s2.ok()) {\n        status = Status::OK();\n      }\n    }\n    if (!status.ok()) {\n      ArchiveFile(TableFileName(dbname_, number));\n      ArchiveFile(SSTTableFileName(dbname_, number));\n      Log(options_.info_log, \"Table #%llu: dropped: %s\",\n          (unsigned long long) t.meta.number,\n          status.ToString().c_str());\n      return;\n    }\n\n    // Extract metadata by scanning through table.\n    int counter = 0;\n    Iterator* iter = NewTableIterator(t.meta);\n    bool empty = true;\n    ParsedInternalKey parsed;\n    t.max_sequence = 0;\n    for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {\n      Slice key = iter->key();\n      if (!ParseInternalKey(key, &parsed)) {\n        Log(options_.info_log, \"Table #%llu: unparsable key %s\",\n            (unsigned long long) t.meta.number,\n            EscapeString(key).c_str());\n        continue;\n      }\n\n      counter++;\n      if (empty) {\n        empty = false;\n        t.meta.smallest.DecodeFrom(key);\n      }\n      t.meta.largest.DecodeFrom(key);\n      if (parsed.sequence > t.max_sequence) {\n        t.max_sequence = parsed.sequence;\n      }\n    }\n    if (!iter->status().ok()) {\n      status = iter->status();\n    }\n    delete iter;\n    Log(options_.info_log, \"Table #%llu: %d entries %s\",\n        (unsigned long long) t.meta.number,\n        counter,\n        status.ToString().c_str());\n\n    if (status.ok()) {\n      tables_.push_back(t);\n    } else {\n      RepairTable(fname, t);  // RepairTable archives input file.\n    }\n  }\n\n  void RepairTable(const std::string& src, TableInfo t) {\n    // We will copy src contents to a new table and then rename the\n    // new table over the source.\n\n    // Create builder.\n    std::string copy = TableFileName(dbname_, next_file_number_++);\n    WritableFile* file;\n    Status s = env_->NewWritableFile(copy, &file);\n    if (!s.ok()) {\n      return;\n    }\n    TableBuilder* builder = new TableBuilder(options_, file);\n\n    // Copy data.\n    Iterator* iter = NewTableIterator(t.meta);\n    int counter = 0;\n    for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {\n      builder->Add(iter->key(), iter->value());\n      counter++;\n    }\n    delete iter;\n\n    ArchiveFile(src);\n    if (counter == 0) {\n      builder->Abandon();  // Nothing to save\n    } else {\n      s = builder->Finish();\n      if (s.ok()) {\n        t.meta.file_size = builder->FileSize();\n      }\n    }\n    delete builder;\n    builder = NULL;\n\n    if (s.ok()) {\n      s = file->Close();\n    }\n    delete file;\n    file = NULL;\n\n    if (counter > 0 && s.ok()) {\n      std::string orig = TableFileName(dbname_, t.meta.number);\n      s = env_->RenameFile(copy, orig);\n      if (s.ok()) {\n        Log(options_.info_log, \"Table #%llu: %d entries repaired\",\n            (unsigned long long) t.meta.number, counter);\n        tables_.push_back(t);\n      }\n    }\n    if (!s.ok()) {\n      env_->DeleteFile(copy);\n    }\n  }\n\n  Status WriteDescriptor() {\n    std::string tmp = TempFileName(dbname_, 1);\n    WritableFile* file;\n    Status status = env_->NewWritableFile(tmp, &file);\n    if (!status.ok()) {\n      return status;\n    }\n\n    SequenceNumber max_sequence = 0;\n    for (size_t i = 0; i < tables_.size(); i++) {\n      if (max_sequence < tables_[i].max_sequence) {\n        max_sequence = tables_[i].max_sequence;\n      }\n    }\n\n    edit_.SetComparatorName(icmp_.user_comparator()->Name());\n    edit_.SetLogNumber(0);\n    edit_.SetNextFile(next_file_number_);\n    edit_.SetLastSequence(max_sequence);\n\n    for (size_t i = 0; i < tables_.size(); i++) {\n      // TODO(opt): separate out into multiple levels\n      const TableInfo& t = tables_[i];\n      edit_.AddFile(0, t.meta.number, t.meta.file_size,\n                    t.meta.smallest, t.meta.largest);\n    }\n\n    //fprintf(stderr, \"NewDescriptor:\\n%s\\n\", edit_.DebugString().c_str());\n    {\n      log::Writer log(file);\n      std::string record;\n      edit_.EncodeTo(&record);\n      status = log.AddRecord(record);\n    }\n    if (status.ok()) {\n      status = file->Close();\n    }\n    delete file;\n    file = NULL;\n\n    if (!status.ok()) {\n      env_->DeleteFile(tmp);\n    } else {\n      // Discard older manifests\n      for (size_t i = 0; i < manifests_.size(); i++) {\n        ArchiveFile(dbname_ + \"/\" + manifests_[i]);\n      }\n\n      // Install new manifest\n      status = env_->RenameFile(tmp, DescriptorFileName(dbname_, 1));\n      if (status.ok()) {\n        status = SetCurrentFile(env_, dbname_, 1);\n      } else {\n        env_->DeleteFile(tmp);\n      }\n    }\n    return status;\n  }\n\n  void ArchiveFile(const std::string& fname) {\n    // Move into another directory.  E.g., for\n    //    dir/foo\n    // rename to\n    //    dir/lost/foo\n    const char* slash = strrchr(fname.c_str(), '/');\n    std::string new_dir;\n    if (slash != NULL) {\n      new_dir.assign(fname.data(), slash - fname.data());\n    }\n    new_dir.append(\"/lost\");\n    env_->CreateDir(new_dir);  // Ignore error\n    std::string new_file = new_dir;\n    new_file.append(\"/\");\n    new_file.append((slash == NULL) ? fname.c_str() : slash + 1);\n    Status s = env_->RenameFile(fname, new_file);\n    Log(options_.info_log, \"Archiving %s: %s\\n\",\n        fname.c_str(), s.ToString().c_str());\n  }\n};\n}  // namespace\n\nStatus RepairDB(const std::string& dbname, const Options& options) {\n  Repairer repairer(dbname, options);\n  return repairer.Run();\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/skiplist.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_SKIPLIST_H_\n#define STORAGE_LEVELDB_DB_SKIPLIST_H_\n\n// Thread safety\n// -------------\n//\n// Writes require external synchronization, most likely a mutex.\n// Reads require a guarantee that the SkipList will not be destroyed\n// while the read is in progress.  Apart from that, reads progress\n// without any internal locking or synchronization.\n//\n// Invariants:\n//\n// (1) Allocated nodes are never deleted until the SkipList is\n// destroyed.  This is trivially guaranteed by the code since we\n// never delete any skip list nodes.\n//\n// (2) The contents of a Node except for the next/prev pointers are\n// immutable after the Node has been linked into the SkipList.\n// Only Insert() modifies the list, and it is careful to initialize\n// a node and use release-stores to publish the nodes in one or\n// more lists.\n//\n// ... prev vs. next pointer ordering ...\n\n#include <assert.h>\n#include <stdlib.h>\n#include \"port/port.h\"\n#include \"util/arena.h\"\n#include \"util/random.h\"\n\nnamespace leveldb {\n\nclass Arena;\n\ntemplate<typename Key, class Comparator>\nclass SkipList {\n private:\n  struct Node;\n\n public:\n  // Create a new SkipList object that will use \"cmp\" for comparing keys,\n  // and will allocate memory using \"*arena\".  Objects allocated in the arena\n  // must remain allocated for the lifetime of the skiplist object.\n  explicit SkipList(Comparator cmp, Arena* arena);\n\n  // Insert key into the list.\n  // REQUIRES: nothing that compares equal to key is currently in the list.\n  void Insert(const Key& key);\n\n  // Returns true iff an entry that compares equal to key is in the list.\n  bool Contains(const Key& key) const;\n\n  // Iteration over the contents of a skip list\n  class Iterator {\n   public:\n    // Initialize an iterator over the specified list.\n    // The returned iterator is not valid.\n    explicit Iterator(const SkipList* list);\n\n    // Returns true iff the iterator is positioned at a valid node.\n    bool Valid() const;\n\n    // Returns the key at the current position.\n    // REQUIRES: Valid()\n    const Key& key() const;\n\n    // Advances to the next position.\n    // REQUIRES: Valid()\n    void Next();\n\n    // Advances to the previous position.\n    // REQUIRES: Valid()\n    void Prev();\n\n    // Advance to the first entry with a key >= target\n    void Seek(const Key& target);\n\n    // Position at the first entry in list.\n    // Final state of iterator is Valid() iff list is not empty.\n    void SeekToFirst();\n\n    // Position at the last entry in list.\n    // Final state of iterator is Valid() iff list is not empty.\n    void SeekToLast();\n\n   private:\n    const SkipList* list_;\n    Node* node_;\n    // Intentionally copyable\n  };\n\n private:\n  enum { kMaxHeight = 12 };\n\n  // Immutable after construction\n  Comparator const compare_;\n  Arena* const arena_;    // Arena used for allocations of nodes\n\n  Node* const head_;\n\n  // Modified only by Insert().  Read racily by readers, but stale\n  // values are ok.\n  port::AtomicPointer max_height_;   // Height of the entire list\n\n  inline int GetMaxHeight() const {\n    return static_cast<int>(\n        reinterpret_cast<intptr_t>(max_height_.NoBarrier_Load()));\n  }\n\n  // Read/written only by Insert().\n  Random rnd_;\n\n  Node* NewNode(const Key& key, int height);\n  int RandomHeight();\n  bool Equal(const Key& a, const Key& b) const { return (compare_(a, b) == 0); }\n\n  // Return true if key is greater than the data stored in \"n\"\n  bool KeyIsAfterNode(const Key& key, Node* n) const;\n\n  // Return the earliest node that comes at or after key.\n  // Return NULL if there is no such node.\n  //\n  // If prev is non-NULL, fills prev[level] with pointer to previous\n  // node at \"level\" for every level in [0..max_height_-1].\n  Node* FindGreaterOrEqual(const Key& key, Node** prev) const;\n\n  // Return the latest node with a key < key.\n  // Return head_ if there is no such node.\n  Node* FindLessThan(const Key& key) const;\n\n  // Return the last node in the list.\n  // Return head_ if list is empty.\n  Node* FindLast() const;\n\n  // No copying allowed\n  SkipList(const SkipList&);\n  void operator=(const SkipList&);\n};\n\n// Implementation details follow\ntemplate<typename Key, class Comparator>\nstruct SkipList<Key,Comparator>::Node {\n  explicit Node(const Key& k) : key(k) { }\n\n  Key const key;\n\n  // Accessors/mutators for links.  Wrapped in methods so we can\n  // add the appropriate barriers as necessary.\n  Node* Next(int n) {\n    assert(n >= 0);\n    // Use an 'acquire load' so that we observe a fully initialized\n    // version of the returned Node.\n    return reinterpret_cast<Node*>(next_[n].Acquire_Load());\n  }\n  void SetNext(int n, Node* x) {\n    assert(n >= 0);\n    // Use a 'release store' so that anybody who reads through this\n    // pointer observes a fully initialized version of the inserted node.\n    next_[n].Release_Store(x);\n  }\n\n  // No-barrier variants that can be safely used in a few locations.\n  Node* NoBarrier_Next(int n) {\n    assert(n >= 0);\n    return reinterpret_cast<Node*>(next_[n].NoBarrier_Load());\n  }\n  void NoBarrier_SetNext(int n, Node* x) {\n    assert(n >= 0);\n    next_[n].NoBarrier_Store(x);\n  }\n\n private:\n  // Array of length equal to the node height.  next_[0] is lowest level link.\n  port::AtomicPointer next_[1];\n};\n\ntemplate<typename Key, class Comparator>\ntypename SkipList<Key,Comparator>::Node*\nSkipList<Key,Comparator>::NewNode(const Key& key, int height) {\n  char* mem = arena_->AllocateAligned(\n      sizeof(Node) + sizeof(port::AtomicPointer) * (height - 1));\n  return new (mem) Node(key);\n}\n\ntemplate<typename Key, class Comparator>\ninline SkipList<Key,Comparator>::Iterator::Iterator(const SkipList* list) {\n  list_ = list;\n  node_ = NULL;\n}\n\ntemplate<typename Key, class Comparator>\ninline bool SkipList<Key,Comparator>::Iterator::Valid() const {\n  return node_ != NULL;\n}\n\ntemplate<typename Key, class Comparator>\ninline const Key& SkipList<Key,Comparator>::Iterator::key() const {\n  assert(Valid());\n  return node_->key;\n}\n\ntemplate<typename Key, class Comparator>\ninline void SkipList<Key,Comparator>::Iterator::Next() {\n  assert(Valid());\n  node_ = node_->Next(0);\n}\n\ntemplate<typename Key, class Comparator>\ninline void SkipList<Key,Comparator>::Iterator::Prev() {\n  // Instead of using explicit \"prev\" links, we just search for the\n  // last node that falls before key.\n  assert(Valid());\n  node_ = list_->FindLessThan(node_->key);\n  if (node_ == list_->head_) {\n    node_ = NULL;\n  }\n}\n\ntemplate<typename Key, class Comparator>\ninline void SkipList<Key,Comparator>::Iterator::Seek(const Key& target) {\n  node_ = list_->FindGreaterOrEqual(target, NULL);\n}\n\ntemplate<typename Key, class Comparator>\ninline void SkipList<Key,Comparator>::Iterator::SeekToFirst() {\n  node_ = list_->head_->Next(0);\n}\n\ntemplate<typename Key, class Comparator>\ninline void SkipList<Key,Comparator>::Iterator::SeekToLast() {\n  node_ = list_->FindLast();\n  if (node_ == list_->head_) {\n    node_ = NULL;\n  }\n}\n\ntemplate<typename Key, class Comparator>\nint SkipList<Key,Comparator>::RandomHeight() {\n  // Increase height with probability 1 in kBranching\n  static const unsigned int kBranching = 4;\n  int height = 1;\n  while (height < kMaxHeight && ((rnd_.Next() % kBranching) == 0)) {\n    height++;\n  }\n  assert(height > 0);\n  assert(height <= kMaxHeight);\n  return height;\n}\n\ntemplate<typename Key, class Comparator>\nbool SkipList<Key,Comparator>::KeyIsAfterNode(const Key& key, Node* n) const {\n  // NULL n is considered infinite\n  return (n != NULL) && (compare_(n->key, key) < 0);\n}\n\ntemplate<typename Key, class Comparator>\ntypename SkipList<Key,Comparator>::Node* SkipList<Key,Comparator>::FindGreaterOrEqual(const Key& key, Node** prev)\n    const {\n  Node* x = head_;\n  int level = GetMaxHeight() - 1;\n  while (true) {\n    Node* next = x->Next(level);\n    if (KeyIsAfterNode(key, next)) {\n      // Keep searching in this list\n      x = next;\n    } else {\n      if (prev != NULL) prev[level] = x;\n      if (level == 0) {\n        return next;\n      } else {\n        // Switch to next list\n        level--;\n      }\n    }\n  }\n}\n\ntemplate<typename Key, class Comparator>\ntypename SkipList<Key,Comparator>::Node*\nSkipList<Key,Comparator>::FindLessThan(const Key& key) const {\n  Node* x = head_;\n  int level = GetMaxHeight() - 1;\n  while (true) {\n    assert(x == head_ || compare_(x->key, key) < 0);\n    Node* next = x->Next(level);\n    if (next == NULL || compare_(next->key, key) >= 0) {\n      if (level == 0) {\n        return x;\n      } else {\n        // Switch to next list\n        level--;\n      }\n    } else {\n      x = next;\n    }\n  }\n}\n\ntemplate<typename Key, class Comparator>\ntypename SkipList<Key,Comparator>::Node* SkipList<Key,Comparator>::FindLast()\n    const {\n  Node* x = head_;\n  int level = GetMaxHeight() - 1;\n  while (true) {\n    Node* next = x->Next(level);\n    if (next == NULL) {\n      if (level == 0) {\n        return x;\n      } else {\n        // Switch to next list\n        level--;\n      }\n    } else {\n      x = next;\n    }\n  }\n}\n\ntemplate<typename Key, class Comparator>\nSkipList<Key,Comparator>::SkipList(Comparator cmp, Arena* arena)\n    : compare_(cmp),\n      arena_(arena),\n      head_(NewNode(0 /* any key will do */, kMaxHeight)),\n      max_height_(reinterpret_cast<void*>(1)),\n      rnd_(0xdeadbeef) {\n  for (int i = 0; i < kMaxHeight; i++) {\n    head_->SetNext(i, NULL);\n  }\n}\n\ntemplate<typename Key, class Comparator>\nvoid SkipList<Key,Comparator>::Insert(const Key& key) {\n  // TODO(opt): We can use a barrier-free variant of FindGreaterOrEqual()\n  // here since Insert() is externally synchronized.\n  Node* prev[kMaxHeight];\n  Node* x = FindGreaterOrEqual(key, prev);\n\n  // Our data structure does not allow duplicate insertion\n  assert(x == NULL || !Equal(key, x->key));\n\n  int height = RandomHeight();\n  if (height > GetMaxHeight()) {\n    for (int i = GetMaxHeight(); i < height; i++) {\n      prev[i] = head_;\n    }\n    //fprintf(stderr, \"Change height from %d to %d\\n\", max_height_, height);\n\n    // It is ok to mutate max_height_ without any synchronization\n    // with concurrent readers.  A concurrent reader that observes\n    // the new value of max_height_ will see either the old value of\n    // new level pointers from head_ (NULL), or a new value set in\n    // the loop below.  In the former case the reader will\n    // immediately drop to the next level since NULL sorts after all\n    // keys.  In the latter case the reader will use the new node.\n    max_height_.NoBarrier_Store(reinterpret_cast<void*>(height));\n  }\n\n  x = NewNode(key, height);\n  for (int i = 0; i < height; i++) {\n    // NoBarrier_SetNext() suffices since we will add a barrier when\n    // we publish a pointer to \"x\" in prev[i].\n    x->NoBarrier_SetNext(i, prev[i]->NoBarrier_Next(i));\n    prev[i]->SetNext(i, x);\n  }\n}\n\ntemplate<typename Key, class Comparator>\nbool SkipList<Key,Comparator>::Contains(const Key& key) const {\n  Node* x = FindGreaterOrEqual(key, NULL);\n  if (x != NULL && Equal(key, x->key)) {\n    return true;\n  } else {\n    return false;\n  }\n}\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_SKIPLIST_H_\n"
  },
  {
    "path": "src/leveldb/db/skiplist_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/skiplist.h\"\n#include <set>\n#include \"leveldb/env.h\"\n#include \"util/arena.h\"\n#include \"util/hash.h\"\n#include \"util/random.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\ntypedef uint64_t Key;\n\nstruct Comparator {\n  int operator()(const Key& a, const Key& b) const {\n    if (a < b) {\n      return -1;\n    } else if (a > b) {\n      return +1;\n    } else {\n      return 0;\n    }\n  }\n};\n\nclass SkipTest { };\n\nTEST(SkipTest, Empty) {\n  Arena arena;\n  Comparator cmp;\n  SkipList<Key, Comparator> list(cmp, &arena);\n  ASSERT_TRUE(!list.Contains(10));\n\n  SkipList<Key, Comparator>::Iterator iter(&list);\n  ASSERT_TRUE(!iter.Valid());\n  iter.SeekToFirst();\n  ASSERT_TRUE(!iter.Valid());\n  iter.Seek(100);\n  ASSERT_TRUE(!iter.Valid());\n  iter.SeekToLast();\n  ASSERT_TRUE(!iter.Valid());\n}\n\nTEST(SkipTest, InsertAndLookup) {\n  const int N = 2000;\n  const int R = 5000;\n  Random rnd(1000);\n  std::set<Key> keys;\n  Arena arena;\n  Comparator cmp;\n  SkipList<Key, Comparator> list(cmp, &arena);\n  for (int i = 0; i < N; i++) {\n    Key key = rnd.Next() % R;\n    if (keys.insert(key).second) {\n      list.Insert(key);\n    }\n  }\n\n  for (int i = 0; i < R; i++) {\n    if (list.Contains(i)) {\n      ASSERT_EQ(keys.count(i), 1);\n    } else {\n      ASSERT_EQ(keys.count(i), 0);\n    }\n  }\n\n  // Simple iterator tests\n  {\n    SkipList<Key, Comparator>::Iterator iter(&list);\n    ASSERT_TRUE(!iter.Valid());\n\n    iter.Seek(0);\n    ASSERT_TRUE(iter.Valid());\n    ASSERT_EQ(*(keys.begin()), iter.key());\n\n    iter.SeekToFirst();\n    ASSERT_TRUE(iter.Valid());\n    ASSERT_EQ(*(keys.begin()), iter.key());\n\n    iter.SeekToLast();\n    ASSERT_TRUE(iter.Valid());\n    ASSERT_EQ(*(keys.rbegin()), iter.key());\n  }\n\n  // Forward iteration test\n  for (int i = 0; i < R; i++) {\n    SkipList<Key, Comparator>::Iterator iter(&list);\n    iter.Seek(i);\n\n    // Compare against model iterator\n    std::set<Key>::iterator model_iter = keys.lower_bound(i);\n    for (int j = 0; j < 3; j++) {\n      if (model_iter == keys.end()) {\n        ASSERT_TRUE(!iter.Valid());\n        break;\n      } else {\n        ASSERT_TRUE(iter.Valid());\n        ASSERT_EQ(*model_iter, iter.key());\n        ++model_iter;\n        iter.Next();\n      }\n    }\n  }\n\n  // Backward iteration test\n  {\n    SkipList<Key, Comparator>::Iterator iter(&list);\n    iter.SeekToLast();\n\n    // Compare against model iterator\n    for (std::set<Key>::reverse_iterator model_iter = keys.rbegin();\n         model_iter != keys.rend();\n         ++model_iter) {\n      ASSERT_TRUE(iter.Valid());\n      ASSERT_EQ(*model_iter, iter.key());\n      iter.Prev();\n    }\n    ASSERT_TRUE(!iter.Valid());\n  }\n}\n\n// We want to make sure that with a single writer and multiple\n// concurrent readers (with no synchronization other than when a\n// reader's iterator is created), the reader always observes all the\n// data that was present in the skip list when the iterator was\n// constructor.  Because insertions are happening concurrently, we may\n// also observe new values that were inserted since the iterator was\n// constructed, but we should never miss any values that were present\n// at iterator construction time.\n//\n// We generate multi-part keys:\n//     <key,gen,hash>\n// where:\n//     key is in range [0..K-1]\n//     gen is a generation number for key\n//     hash is hash(key,gen)\n//\n// The insertion code picks a random key, sets gen to be 1 + the last\n// generation number inserted for that key, and sets hash to Hash(key,gen).\n//\n// At the beginning of a read, we snapshot the last inserted\n// generation number for each key.  We then iterate, including random\n// calls to Next() and Seek().  For every key we encounter, we\n// check that it is either expected given the initial snapshot or has\n// been concurrently added since the iterator started.\nclass ConcurrentTest {\n private:\n  static const uint32_t K = 4;\n\n  static uint64_t key(Key key) { return (key >> 40); }\n  static uint64_t gen(Key key) { return (key >> 8) & 0xffffffffu; }\n  static uint64_t hash(Key key) { return key & 0xff; }\n\n  static uint64_t HashNumbers(uint64_t k, uint64_t g) {\n    uint64_t data[2] = { k, g };\n    return Hash(reinterpret_cast<char*>(data), sizeof(data), 0);\n  }\n\n  static Key MakeKey(uint64_t k, uint64_t g) {\n    assert(sizeof(Key) == sizeof(uint64_t));\n    assert(k <= K);  // We sometimes pass K to seek to the end of the skiplist\n    assert(g <= 0xffffffffu);\n    return ((k << 40) | (g << 8) | (HashNumbers(k, g) & 0xff));\n  }\n\n  static bool IsValidKey(Key k) {\n    return hash(k) == (HashNumbers(key(k), gen(k)) & 0xff);\n  }\n\n  static Key RandomTarget(Random* rnd) {\n    switch (rnd->Next() % 10) {\n      case 0:\n        // Seek to beginning\n        return MakeKey(0, 0);\n      case 1:\n        // Seek to end\n        return MakeKey(K, 0);\n      default:\n        // Seek to middle\n        return MakeKey(rnd->Next() % K, 0);\n    }\n  }\n\n  // Per-key generation\n  struct State {\n    port::AtomicPointer generation[K];\n    void Set(int k, intptr_t v) {\n      generation[k].Release_Store(reinterpret_cast<void*>(v));\n    }\n    intptr_t Get(int k) {\n      return reinterpret_cast<intptr_t>(generation[k].Acquire_Load());\n    }\n\n    State() {\n      for (int k = 0; k < K; k++) {\n        Set(k, 0);\n      }\n    }\n  };\n\n  // Current state of the test\n  State current_;\n\n  Arena arena_;\n\n  // SkipList is not protected by mu_.  We just use a single writer\n  // thread to modify it.\n  SkipList<Key, Comparator> list_;\n\n public:\n  ConcurrentTest() : list_(Comparator(), &arena_) { }\n\n  // REQUIRES: External synchronization\n  void WriteStep(Random* rnd) {\n    const uint32_t k = rnd->Next() % K;\n    const intptr_t g = current_.Get(k) + 1;\n    const Key key = MakeKey(k, g);\n    list_.Insert(key);\n    current_.Set(k, g);\n  }\n\n  void ReadStep(Random* rnd) {\n    // Remember the initial committed state of the skiplist.\n    State initial_state;\n    for (int k = 0; k < K; k++) {\n      initial_state.Set(k, current_.Get(k));\n    }\n\n    Key pos = RandomTarget(rnd);\n    SkipList<Key, Comparator>::Iterator iter(&list_);\n    iter.Seek(pos);\n    while (true) {\n      Key current;\n      if (!iter.Valid()) {\n        current = MakeKey(K, 0);\n      } else {\n        current = iter.key();\n        ASSERT_TRUE(IsValidKey(current)) << current;\n      }\n      ASSERT_LE(pos, current) << \"should not go backwards\";\n\n      // Verify that everything in [pos,current) was not present in\n      // initial_state.\n      while (pos < current) {\n        ASSERT_LT(key(pos), K) << pos;\n\n        // Note that generation 0 is never inserted, so it is ok if\n        // <*,0,*> is missing.\n        ASSERT_TRUE((gen(pos) == 0) ||\n                    (gen(pos) > static_cast<Key>(initial_state.Get(key(pos))))\n                    ) << \"key: \" << key(pos)\n                      << \"; gen: \" << gen(pos)\n                      << \"; initgen: \"\n                      << initial_state.Get(key(pos));\n\n        // Advance to next key in the valid key space\n        if (key(pos) < key(current)) {\n          pos = MakeKey(key(pos) + 1, 0);\n        } else {\n          pos = MakeKey(key(pos), gen(pos) + 1);\n        }\n      }\n\n      if (!iter.Valid()) {\n        break;\n      }\n\n      if (rnd->Next() % 2) {\n        iter.Next();\n        pos = MakeKey(key(pos), gen(pos) + 1);\n      } else {\n        Key new_target = RandomTarget(rnd);\n        if (new_target > pos) {\n          pos = new_target;\n          iter.Seek(new_target);\n        }\n      }\n    }\n  }\n};\nconst uint32_t ConcurrentTest::K;\n\n// Simple test that does single-threaded testing of the ConcurrentTest\n// scaffolding.\nTEST(SkipTest, ConcurrentWithoutThreads) {\n  ConcurrentTest test;\n  Random rnd(test::RandomSeed());\n  for (int i = 0; i < 10000; i++) {\n    test.ReadStep(&rnd);\n    test.WriteStep(&rnd);\n  }\n}\n\nclass TestState {\n public:\n  ConcurrentTest t_;\n  int seed_;\n  port::AtomicPointer quit_flag_;\n\n  enum ReaderState {\n    STARTING,\n    RUNNING,\n    DONE\n  };\n\n  explicit TestState(int s)\n      : seed_(s),\n        quit_flag_(NULL),\n        state_(STARTING),\n        state_cv_(&mu_) {}\n\n  void Wait(ReaderState s) {\n    mu_.Lock();\n    while (state_ != s) {\n      state_cv_.Wait();\n    }\n    mu_.Unlock();\n  }\n\n  void Change(ReaderState s) {\n    mu_.Lock();\n    state_ = s;\n    state_cv_.Signal();\n    mu_.Unlock();\n  }\n\n private:\n  port::Mutex mu_;\n  ReaderState state_;\n  port::CondVar state_cv_;\n};\n\nstatic void ConcurrentReader(void* arg) {\n  TestState* state = reinterpret_cast<TestState*>(arg);\n  Random rnd(state->seed_);\n  int64_t reads = 0;\n  state->Change(TestState::RUNNING);\n  while (!state->quit_flag_.Acquire_Load()) {\n    state->t_.ReadStep(&rnd);\n    ++reads;\n  }\n  state->Change(TestState::DONE);\n}\n\nstatic void RunConcurrent(int run) {\n  const int seed = test::RandomSeed() + (run * 100);\n  Random rnd(seed);\n  const int N = 1000;\n  const int kSize = 1000;\n  for (int i = 0; i < N; i++) {\n    if ((i % 100) == 0) {\n      fprintf(stderr, \"Run %d of %d\\n\", i, N);\n    }\n    TestState state(seed + 1);\n    Env::Default()->Schedule(ConcurrentReader, &state);\n    state.Wait(TestState::RUNNING);\n    for (int i = 0; i < kSize; i++) {\n      state.t_.WriteStep(&rnd);\n    }\n    state.quit_flag_.Release_Store(&state);  // Any non-NULL arg will do\n    state.Wait(TestState::DONE);\n  }\n}\n\nTEST(SkipTest, Concurrent1) { RunConcurrent(1); }\nTEST(SkipTest, Concurrent2) { RunConcurrent(2); }\nTEST(SkipTest, Concurrent3) { RunConcurrent(3); }\nTEST(SkipTest, Concurrent4) { RunConcurrent(4); }\nTEST(SkipTest, Concurrent5) { RunConcurrent(5); }\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/snapshot.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_SNAPSHOT_H_\n#define STORAGE_LEVELDB_DB_SNAPSHOT_H_\n\n#include \"db/dbformat.h\"\n#include \"leveldb/db.h\"\n\nnamespace leveldb {\n\nclass SnapshotList;\n\n// Snapshots are kept in a doubly-linked list in the DB.\n// Each SnapshotImpl corresponds to a particular sequence number.\nclass SnapshotImpl : public Snapshot {\n public:\n  SequenceNumber number_;  // const after creation\n\n private:\n  friend class SnapshotList;\n\n  // SnapshotImpl is kept in a doubly-linked circular list\n  SnapshotImpl* prev_;\n  SnapshotImpl* next_;\n\n  SnapshotList* list_;                 // just for sanity checks\n};\n\nclass SnapshotList {\n public:\n  SnapshotList() {\n    list_.prev_ = &list_;\n    list_.next_ = &list_;\n  }\n\n  bool empty() const { return list_.next_ == &list_; }\n  SnapshotImpl* oldest() const { assert(!empty()); return list_.next_; }\n  SnapshotImpl* newest() const { assert(!empty()); return list_.prev_; }\n\n  const SnapshotImpl* New(SequenceNumber seq) {\n    SnapshotImpl* s = new SnapshotImpl;\n    s->number_ = seq;\n    s->list_ = this;\n    s->next_ = &list_;\n    s->prev_ = list_.prev_;\n    s->prev_->next_ = s;\n    s->next_->prev_ = s;\n    return s;\n  }\n\n  void Delete(const SnapshotImpl* s) {\n    assert(s->list_ == this);\n    s->prev_->next_ = s->next_;\n    s->next_->prev_ = s->prev_;\n    delete s;\n  }\n\n private:\n  // Dummy head of doubly-linked list of snapshots\n  SnapshotImpl list_;\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_SNAPSHOT_H_\n"
  },
  {
    "path": "src/leveldb/db/table_cache.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/table_cache.h\"\n\n#include \"db/filename.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/table.h\"\n#include \"util/coding.h\"\n\nnamespace leveldb {\n\nstruct TableAndFile {\n  RandomAccessFile* file;\n  Table* table;\n};\n\nstatic void DeleteEntry(const Slice& key, void* value) {\n  TableAndFile* tf = reinterpret_cast<TableAndFile*>(value);\n  delete tf->table;\n  delete tf->file;\n  delete tf;\n}\n\nstatic void UnrefEntry(void* arg1, void* arg2) {\n  Cache* cache = reinterpret_cast<Cache*>(arg1);\n  Cache::Handle* h = reinterpret_cast<Cache::Handle*>(arg2);\n  cache->Release(h);\n}\n\nTableCache::TableCache(const std::string& dbname,\n                       const Options* options,\n                       int entries)\n    : env_(options->env),\n      dbname_(dbname),\n      options_(options),\n      cache_(NewLRUCache(entries)) {\n}\n\nTableCache::~TableCache() {\n  delete cache_;\n}\n\nStatus TableCache::FindTable(uint64_t file_number, uint64_t file_size,\n                             Cache::Handle** handle) {\n  Status s;\n  char buf[sizeof(file_number)];\n  EncodeFixed64(buf, file_number);\n  Slice key(buf, sizeof(buf));\n  *handle = cache_->Lookup(key);\n  if (*handle == NULL) {\n    std::string fname = TableFileName(dbname_, file_number);\n    RandomAccessFile* file = NULL;\n    Table* table = NULL;\n    s = env_->NewRandomAccessFile(fname, &file);\n    if (!s.ok()) {\n      std::string old_fname = SSTTableFileName(dbname_, file_number);\n      if (env_->NewRandomAccessFile(old_fname, &file).ok()) {\n        s = Status::OK();\n      }\n    }\n    if (s.ok()) {\n      s = Table::Open(*options_, file, file_size, &table);\n    }\n\n    if (!s.ok()) {\n      assert(table == NULL);\n      delete file;\n      // We do not cache error results so that if the error is transient,\n      // or somebody repairs the file, we recover automatically.\n    } else {\n      TableAndFile* tf = new TableAndFile;\n      tf->file = file;\n      tf->table = table;\n      *handle = cache_->Insert(key, tf, 1, &DeleteEntry);\n    }\n  }\n  return s;\n}\n\nIterator* TableCache::NewIterator(const ReadOptions& options,\n                                  uint64_t file_number,\n                                  uint64_t file_size,\n                                  Table** tableptr) {\n  if (tableptr != NULL) {\n    *tableptr = NULL;\n  }\n\n  Cache::Handle* handle = NULL;\n  Status s = FindTable(file_number, file_size, &handle);\n  if (!s.ok()) {\n    return NewErrorIterator(s);\n  }\n\n  Table* table = reinterpret_cast<TableAndFile*>(cache_->Value(handle))->table;\n  Iterator* result = table->NewIterator(options);\n  result->RegisterCleanup(&UnrefEntry, cache_, handle);\n  if (tableptr != NULL) {\n    *tableptr = table;\n  }\n  return result;\n}\n\nStatus TableCache::Get(const ReadOptions& options,\n                       uint64_t file_number,\n                       uint64_t file_size,\n                       const Slice& k,\n                       void* arg,\n                       void (*saver)(void*, const Slice&, const Slice&)) {\n  Cache::Handle* handle = NULL;\n  Status s = FindTable(file_number, file_size, &handle);\n  if (s.ok()) {\n    Table* t = reinterpret_cast<TableAndFile*>(cache_->Value(handle))->table;\n    s = t->InternalGet(options, k, arg, saver);\n    cache_->Release(handle);\n  }\n  return s;\n}\n\nvoid TableCache::Evict(uint64_t file_number) {\n  char buf[sizeof(file_number)];\n  EncodeFixed64(buf, file_number);\n  cache_->Erase(Slice(buf, sizeof(buf)));\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/table_cache.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// Thread-safe (provides internal synchronization)\n\n#ifndef STORAGE_LEVELDB_DB_TABLE_CACHE_H_\n#define STORAGE_LEVELDB_DB_TABLE_CACHE_H_\n\n#include <string>\n#include <stdint.h>\n#include \"db/dbformat.h\"\n#include \"leveldb/cache.h\"\n#include \"leveldb/table.h\"\n#include \"port/port.h\"\n\nnamespace leveldb {\n\nclass Env;\n\nclass TableCache {\n public:\n  TableCache(const std::string& dbname, const Options* options, int entries);\n  ~TableCache();\n\n  // Return an iterator for the specified file number (the corresponding\n  // file length must be exactly \"file_size\" bytes).  If \"tableptr\" is\n  // non-NULL, also sets \"*tableptr\" to point to the Table object\n  // underlying the returned iterator, or NULL if no Table object underlies\n  // the returned iterator.  The returned \"*tableptr\" object is owned by\n  // the cache and should not be deleted, and is valid for as long as the\n  // returned iterator is live.\n  Iterator* NewIterator(const ReadOptions& options,\n                        uint64_t file_number,\n                        uint64_t file_size,\n                        Table** tableptr = NULL);\n\n  // If a seek to internal key \"k\" in specified file finds an entry,\n  // call (*handle_result)(arg, found_key, found_value).\n  Status Get(const ReadOptions& options,\n             uint64_t file_number,\n             uint64_t file_size,\n             const Slice& k,\n             void* arg,\n             void (*handle_result)(void*, const Slice&, const Slice&));\n\n  // Evict any entry for the specified file number\n  void Evict(uint64_t file_number);\n\n private:\n  Env* const env_;\n  const std::string dbname_;\n  const Options* options_;\n  Cache* cache_;\n\n  Status FindTable(uint64_t file_number, uint64_t file_size, Cache::Handle**);\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_TABLE_CACHE_H_\n"
  },
  {
    "path": "src/leveldb/db/version_edit.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/version_edit.h\"\n\n#include \"db/version_set.h\"\n#include \"util/coding.h\"\n\nnamespace leveldb {\n\n// Tag numbers for serialized VersionEdit.  These numbers are written to\n// disk and should not be changed.\nenum Tag {\n  kComparator           = 1,\n  kLogNumber            = 2,\n  kNextFileNumber       = 3,\n  kLastSequence         = 4,\n  kCompactPointer       = 5,\n  kDeletedFile          = 6,\n  kNewFile              = 7,\n  // 8 was used for large value refs\n  kPrevLogNumber        = 9\n};\n\nvoid VersionEdit::Clear() {\n  comparator_.clear();\n  log_number_ = 0;\n  prev_log_number_ = 0;\n  last_sequence_ = 0;\n  next_file_number_ = 0;\n  has_comparator_ = false;\n  has_log_number_ = false;\n  has_prev_log_number_ = false;\n  has_next_file_number_ = false;\n  has_last_sequence_ = false;\n  deleted_files_.clear();\n  new_files_.clear();\n}\n\nvoid VersionEdit::EncodeTo(std::string* dst) const {\n  if (has_comparator_) {\n    PutVarint32(dst, kComparator);\n    PutLengthPrefixedSlice(dst, comparator_);\n  }\n  if (has_log_number_) {\n    PutVarint32(dst, kLogNumber);\n    PutVarint64(dst, log_number_);\n  }\n  if (has_prev_log_number_) {\n    PutVarint32(dst, kPrevLogNumber);\n    PutVarint64(dst, prev_log_number_);\n  }\n  if (has_next_file_number_) {\n    PutVarint32(dst, kNextFileNumber);\n    PutVarint64(dst, next_file_number_);\n  }\n  if (has_last_sequence_) {\n    PutVarint32(dst, kLastSequence);\n    PutVarint64(dst, last_sequence_);\n  }\n\n  for (size_t i = 0; i < compact_pointers_.size(); i++) {\n    PutVarint32(dst, kCompactPointer);\n    PutVarint32(dst, compact_pointers_[i].first);  // level\n    PutLengthPrefixedSlice(dst, compact_pointers_[i].second.Encode());\n  }\n\n  for (DeletedFileSet::const_iterator iter = deleted_files_.begin();\n       iter != deleted_files_.end();\n       ++iter) {\n    PutVarint32(dst, kDeletedFile);\n    PutVarint32(dst, iter->first);   // level\n    PutVarint64(dst, iter->second);  // file number\n  }\n\n  for (size_t i = 0; i < new_files_.size(); i++) {\n    const FileMetaData& f = new_files_[i].second;\n    PutVarint32(dst, kNewFile);\n    PutVarint32(dst, new_files_[i].first);  // level\n    PutVarint64(dst, f.number);\n    PutVarint64(dst, f.file_size);\n    PutLengthPrefixedSlice(dst, f.smallest.Encode());\n    PutLengthPrefixedSlice(dst, f.largest.Encode());\n  }\n}\n\nstatic bool GetInternalKey(Slice* input, InternalKey* dst) {\n  Slice str;\n  if (GetLengthPrefixedSlice(input, &str)) {\n    dst->DecodeFrom(str);\n    return true;\n  } else {\n    return false;\n  }\n}\n\nstatic bool GetLevel(Slice* input, int* level) {\n  uint32_t v;\n  if (GetVarint32(input, &v) &&\n      v < config::kNumLevels) {\n    *level = v;\n    return true;\n  } else {\n    return false;\n  }\n}\n\nStatus VersionEdit::DecodeFrom(const Slice& src) {\n  Clear();\n  Slice input = src;\n  const char* msg = NULL;\n  uint32_t tag;\n\n  // Temporary storage for parsing\n  int level;\n  uint64_t number;\n  FileMetaData f;\n  Slice str;\n  InternalKey key;\n\n  while (msg == NULL && GetVarint32(&input, &tag)) {\n    switch (tag) {\n      case kComparator:\n        if (GetLengthPrefixedSlice(&input, &str)) {\n          comparator_ = str.ToString();\n          has_comparator_ = true;\n        } else {\n          msg = \"comparator name\";\n        }\n        break;\n\n      case kLogNumber:\n        if (GetVarint64(&input, &log_number_)) {\n          has_log_number_ = true;\n        } else {\n          msg = \"log number\";\n        }\n        break;\n\n      case kPrevLogNumber:\n        if (GetVarint64(&input, &prev_log_number_)) {\n          has_prev_log_number_ = true;\n        } else {\n          msg = \"previous log number\";\n        }\n        break;\n\n      case kNextFileNumber:\n        if (GetVarint64(&input, &next_file_number_)) {\n          has_next_file_number_ = true;\n        } else {\n          msg = \"next file number\";\n        }\n        break;\n\n      case kLastSequence:\n        if (GetVarint64(&input, &last_sequence_)) {\n          has_last_sequence_ = true;\n        } else {\n          msg = \"last sequence number\";\n        }\n        break;\n\n      case kCompactPointer:\n        if (GetLevel(&input, &level) &&\n            GetInternalKey(&input, &key)) {\n          compact_pointers_.push_back(std::make_pair(level, key));\n        } else {\n          msg = \"compaction pointer\";\n        }\n        break;\n\n      case kDeletedFile:\n        if (GetLevel(&input, &level) &&\n            GetVarint64(&input, &number)) {\n          deleted_files_.insert(std::make_pair(level, number));\n        } else {\n          msg = \"deleted file\";\n        }\n        break;\n\n      case kNewFile:\n        if (GetLevel(&input, &level) &&\n            GetVarint64(&input, &f.number) &&\n            GetVarint64(&input, &f.file_size) &&\n            GetInternalKey(&input, &f.smallest) &&\n            GetInternalKey(&input, &f.largest)) {\n          new_files_.push_back(std::make_pair(level, f));\n        } else {\n          msg = \"new-file entry\";\n        }\n        break;\n\n      default:\n        msg = \"unknown tag\";\n        break;\n    }\n  }\n\n  if (msg == NULL && !input.empty()) {\n    msg = \"invalid tag\";\n  }\n\n  Status result;\n  if (msg != NULL) {\n    result = Status::Corruption(\"VersionEdit\", msg);\n  }\n  return result;\n}\n\nstd::string VersionEdit::DebugString() const {\n  std::string r;\n  r.append(\"VersionEdit {\");\n  if (has_comparator_) {\n    r.append(\"\\n  Comparator: \");\n    r.append(comparator_);\n  }\n  if (has_log_number_) {\n    r.append(\"\\n  LogNumber: \");\n    AppendNumberTo(&r, log_number_);\n  }\n  if (has_prev_log_number_) {\n    r.append(\"\\n  PrevLogNumber: \");\n    AppendNumberTo(&r, prev_log_number_);\n  }\n  if (has_next_file_number_) {\n    r.append(\"\\n  NextFile: \");\n    AppendNumberTo(&r, next_file_number_);\n  }\n  if (has_last_sequence_) {\n    r.append(\"\\n  LastSeq: \");\n    AppendNumberTo(&r, last_sequence_);\n  }\n  for (size_t i = 0; i < compact_pointers_.size(); i++) {\n    r.append(\"\\n  CompactPointer: \");\n    AppendNumberTo(&r, compact_pointers_[i].first);\n    r.append(\" \");\n    r.append(compact_pointers_[i].second.DebugString());\n  }\n  for (DeletedFileSet::const_iterator iter = deleted_files_.begin();\n       iter != deleted_files_.end();\n       ++iter) {\n    r.append(\"\\n  DeleteFile: \");\n    AppendNumberTo(&r, iter->first);\n    r.append(\" \");\n    AppendNumberTo(&r, iter->second);\n  }\n  for (size_t i = 0; i < new_files_.size(); i++) {\n    const FileMetaData& f = new_files_[i].second;\n    r.append(\"\\n  AddFile: \");\n    AppendNumberTo(&r, new_files_[i].first);\n    r.append(\" \");\n    AppendNumberTo(&r, f.number);\n    r.append(\" \");\n    AppendNumberTo(&r, f.file_size);\n    r.append(\" \");\n    r.append(f.smallest.DebugString());\n    r.append(\" .. \");\n    r.append(f.largest.DebugString());\n  }\n  r.append(\"\\n}\\n\");\n  return r;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/version_edit.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_VERSION_EDIT_H_\n#define STORAGE_LEVELDB_DB_VERSION_EDIT_H_\n\n#include <set>\n#include <utility>\n#include <vector>\n#include \"db/dbformat.h\"\n\nnamespace leveldb {\n\nclass VersionSet;\n\nstruct FileMetaData {\n  int refs;\n  int allowed_seeks;          // Seeks allowed until compaction\n  uint64_t number;\n  uint64_t file_size;         // File size in bytes\n  InternalKey smallest;       // Smallest internal key served by table\n  InternalKey largest;        // Largest internal key served by table\n\n  FileMetaData() : refs(0), allowed_seeks(1 << 30), file_size(0) { }\n};\n\nclass VersionEdit {\n public:\n  VersionEdit() { Clear(); }\n  ~VersionEdit() { }\n\n  void Clear();\n\n  void SetComparatorName(const Slice& name) {\n    has_comparator_ = true;\n    comparator_ = name.ToString();\n  }\n  void SetLogNumber(uint64_t num) {\n    has_log_number_ = true;\n    log_number_ = num;\n  }\n  void SetPrevLogNumber(uint64_t num) {\n    has_prev_log_number_ = true;\n    prev_log_number_ = num;\n  }\n  void SetNextFile(uint64_t num) {\n    has_next_file_number_ = true;\n    next_file_number_ = num;\n  }\n  void SetLastSequence(SequenceNumber seq) {\n    has_last_sequence_ = true;\n    last_sequence_ = seq;\n  }\n  void SetCompactPointer(int level, const InternalKey& key) {\n    compact_pointers_.push_back(std::make_pair(level, key));\n  }\n\n  // Add the specified file at the specified number.\n  // REQUIRES: This version has not been saved (see VersionSet::SaveTo)\n  // REQUIRES: \"smallest\" and \"largest\" are smallest and largest keys in file\n  void AddFile(int level, uint64_t file,\n               uint64_t file_size,\n               const InternalKey& smallest,\n               const InternalKey& largest) {\n    FileMetaData f;\n    f.number = file;\n    f.file_size = file_size;\n    f.smallest = smallest;\n    f.largest = largest;\n    new_files_.push_back(std::make_pair(level, f));\n  }\n\n  // Delete the specified \"file\" from the specified \"level\".\n  void DeleteFile(int level, uint64_t file) {\n    deleted_files_.insert(std::make_pair(level, file));\n  }\n\n  void EncodeTo(std::string* dst) const;\n  Status DecodeFrom(const Slice& src);\n\n  std::string DebugString() const;\n\n private:\n  friend class VersionSet;\n\n  typedef std::set< std::pair<int, uint64_t> > DeletedFileSet;\n\n  std::string comparator_;\n  uint64_t log_number_;\n  uint64_t prev_log_number_;\n  uint64_t next_file_number_;\n  SequenceNumber last_sequence_;\n  bool has_comparator_;\n  bool has_log_number_;\n  bool has_prev_log_number_;\n  bool has_next_file_number_;\n  bool has_last_sequence_;\n\n  std::vector< std::pair<int, InternalKey> > compact_pointers_;\n  DeletedFileSet deleted_files_;\n  std::vector< std::pair<int, FileMetaData> > new_files_;\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_VERSION_EDIT_H_\n"
  },
  {
    "path": "src/leveldb/db/version_edit_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/version_edit.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\nstatic void TestEncodeDecode(const VersionEdit& edit) {\n  std::string encoded, encoded2;\n  edit.EncodeTo(&encoded);\n  VersionEdit parsed;\n  Status s = parsed.DecodeFrom(encoded);\n  ASSERT_TRUE(s.ok()) << s.ToString();\n  parsed.EncodeTo(&encoded2);\n  ASSERT_EQ(encoded, encoded2);\n}\n\nclass VersionEditTest { };\n\nTEST(VersionEditTest, EncodeDecode) {\n  static const uint64_t kBig = 1ull << 50;\n\n  VersionEdit edit;\n  for (int i = 0; i < 4; i++) {\n    TestEncodeDecode(edit);\n    edit.AddFile(3, kBig + 300 + i, kBig + 400 + i,\n                 InternalKey(\"foo\", kBig + 500 + i, kTypeValue),\n                 InternalKey(\"zoo\", kBig + 600 + i, kTypeDeletion));\n    edit.DeleteFile(4, kBig + 700 + i);\n    edit.SetCompactPointer(i, InternalKey(\"x\", kBig + 900 + i, kTypeValue));\n  }\n\n  edit.SetComparatorName(\"foo\");\n  edit.SetLogNumber(kBig + 100);\n  edit.SetNextFile(kBig + 200);\n  edit.SetLastSequence(kBig + 1000);\n  TestEncodeDecode(edit);\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/version_set.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/version_set.h\"\n\n#include <algorithm>\n#include <stdio.h>\n#include \"db/filename.h\"\n#include \"db/log_reader.h\"\n#include \"db/log_writer.h\"\n#include \"db/memtable.h\"\n#include \"db/table_cache.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/table_builder.h\"\n#include \"table/merger.h\"\n#include \"table/two_level_iterator.h\"\n#include \"util/coding.h\"\n#include \"util/logging.h\"\n\nnamespace leveldb {\n\nstatic size_t TargetFileSize(const Options* options) {\n  return options->max_file_size;\n}\n\n// Maximum bytes of overlaps in grandparent (i.e., level+2) before we\n// stop building a single file in a level->level+1 compaction.\nstatic int64_t MaxGrandParentOverlapBytes(const Options* options) {\n  return 10 * TargetFileSize(options);\n}\n\n// Maximum number of bytes in all compacted files.  We avoid expanding\n// the lower level file set of a compaction if it would make the\n// total compaction cover more than this many bytes.\nstatic int64_t ExpandedCompactionByteSizeLimit(const Options* options) {\n  return 25 * TargetFileSize(options);\n}\n\nstatic double MaxBytesForLevel(const Options* options, int level) {\n  // Note: the result for level zero is not really used since we set\n  // the level-0 compaction threshold based on number of files.\n\n  // Result for both level-0 and level-1\n  double result = 10. * 1048576.0;\n  while (level > 1) {\n    result *= 10;\n    level--;\n  }\n  return result;\n}\n\nstatic uint64_t MaxFileSizeForLevel(const Options* options, int level) {\n  // We could vary per level to reduce number of files?\n  return TargetFileSize(options);\n}\n\nstatic int64_t TotalFileSize(const std::vector<FileMetaData*>& files) {\n  int64_t sum = 0;\n  for (size_t i = 0; i < files.size(); i++) {\n    sum += files[i]->file_size;\n  }\n  return sum;\n}\n\nVersion::~Version() {\n  assert(refs_ == 0);\n\n  // Remove from linked list\n  prev_->next_ = next_;\n  next_->prev_ = prev_;\n\n  // Drop references to files\n  for (int level = 0; level < config::kNumLevels; level++) {\n    for (size_t i = 0; i < files_[level].size(); i++) {\n      FileMetaData* f = files_[level][i];\n      assert(f->refs > 0);\n      f->refs--;\n      if (f->refs <= 0) {\n        delete f;\n      }\n    }\n  }\n}\n\nint FindFile(const InternalKeyComparator& icmp,\n             const std::vector<FileMetaData*>& files,\n             const Slice& key) {\n  uint32_t left = 0;\n  uint32_t right = files.size();\n  while (left < right) {\n    uint32_t mid = (left + right) / 2;\n    const FileMetaData* f = files[mid];\n    if (icmp.InternalKeyComparator::Compare(f->largest.Encode(), key) < 0) {\n      // Key at \"mid.largest\" is < \"target\".  Therefore all\n      // files at or before \"mid\" are uninteresting.\n      left = mid + 1;\n    } else {\n      // Key at \"mid.largest\" is >= \"target\".  Therefore all files\n      // after \"mid\" are uninteresting.\n      right = mid;\n    }\n  }\n  return right;\n}\n\nstatic bool AfterFile(const Comparator* ucmp,\n                      const Slice* user_key, const FileMetaData* f) {\n  // NULL user_key occurs before all keys and is therefore never after *f\n  return (user_key != NULL &&\n          ucmp->Compare(*user_key, f->largest.user_key()) > 0);\n}\n\nstatic bool BeforeFile(const Comparator* ucmp,\n                       const Slice* user_key, const FileMetaData* f) {\n  // NULL user_key occurs after all keys and is therefore never before *f\n  return (user_key != NULL &&\n          ucmp->Compare(*user_key, f->smallest.user_key()) < 0);\n}\n\nbool SomeFileOverlapsRange(\n    const InternalKeyComparator& icmp,\n    bool disjoint_sorted_files,\n    const std::vector<FileMetaData*>& files,\n    const Slice* smallest_user_key,\n    const Slice* largest_user_key) {\n  const Comparator* ucmp = icmp.user_comparator();\n  if (!disjoint_sorted_files) {\n    // Need to check against all files\n    for (size_t i = 0; i < files.size(); i++) {\n      const FileMetaData* f = files[i];\n      if (AfterFile(ucmp, smallest_user_key, f) ||\n          BeforeFile(ucmp, largest_user_key, f)) {\n        // No overlap\n      } else {\n        return true;  // Overlap\n      }\n    }\n    return false;\n  }\n\n  // Binary search over file list\n  uint32_t index = 0;\n  if (smallest_user_key != NULL) {\n    // Find the earliest possible internal key for smallest_user_key\n    InternalKey small(*smallest_user_key, kMaxSequenceNumber,kValueTypeForSeek);\n    index = FindFile(icmp, files, small.Encode());\n  }\n\n  if (index >= files.size()) {\n    // beginning of range is after all files, so no overlap.\n    return false;\n  }\n\n  return !BeforeFile(ucmp, largest_user_key, files[index]);\n}\n\n// An internal iterator.  For a given version/level pair, yields\n// information about the files in the level.  For a given entry, key()\n// is the largest key that occurs in the file, and value() is an\n// 16-byte value containing the file number and file size, both\n// encoded using EncodeFixed64.\nclass Version::LevelFileNumIterator : public Iterator {\n public:\n  LevelFileNumIterator(const InternalKeyComparator& icmp,\n                       const std::vector<FileMetaData*>* flist)\n      : icmp_(icmp),\n        flist_(flist),\n        index_(flist->size()) {        // Marks as invalid\n  }\n  virtual bool Valid() const {\n    return index_ < flist_->size();\n  }\n  virtual void Seek(const Slice& target) {\n    index_ = FindFile(icmp_, *flist_, target);\n  }\n  virtual void SeekToFirst() { index_ = 0; }\n  virtual void SeekToLast() {\n    index_ = flist_->empty() ? 0 : flist_->size() - 1;\n  }\n  virtual void Next() {\n    assert(Valid());\n    index_++;\n  }\n  virtual void Prev() {\n    assert(Valid());\n    if (index_ == 0) {\n      index_ = flist_->size();  // Marks as invalid\n    } else {\n      index_--;\n    }\n  }\n  Slice key() const {\n    assert(Valid());\n    return (*flist_)[index_]->largest.Encode();\n  }\n  Slice value() const {\n    assert(Valid());\n    EncodeFixed64(value_buf_, (*flist_)[index_]->number);\n    EncodeFixed64(value_buf_+8, (*flist_)[index_]->file_size);\n    return Slice(value_buf_, sizeof(value_buf_));\n  }\n  virtual Status status() const { return Status::OK(); }\n private:\n  const InternalKeyComparator icmp_;\n  const std::vector<FileMetaData*>* const flist_;\n  uint32_t index_;\n\n  // Backing store for value().  Holds the file number and size.\n  mutable char value_buf_[16];\n};\n\nstatic Iterator* GetFileIterator(void* arg,\n                                 const ReadOptions& options,\n                                 const Slice& file_value) {\n  TableCache* cache = reinterpret_cast<TableCache*>(arg);\n  if (file_value.size() != 16) {\n    return NewErrorIterator(\n        Status::Corruption(\"FileReader invoked with unexpected value\"));\n  } else {\n    return cache->NewIterator(options,\n                              DecodeFixed64(file_value.data()),\n                              DecodeFixed64(file_value.data() + 8));\n  }\n}\n\nIterator* Version::NewConcatenatingIterator(const ReadOptions& options,\n                                            int level) const {\n  return NewTwoLevelIterator(\n      new LevelFileNumIterator(vset_->icmp_, &files_[level]),\n      &GetFileIterator, vset_->table_cache_, options);\n}\n\nvoid Version::AddIterators(const ReadOptions& options,\n                           std::vector<Iterator*>* iters) {\n  // Merge all level zero files together since they may overlap\n  for (size_t i = 0; i < files_[0].size(); i++) {\n    iters->push_back(\n        vset_->table_cache_->NewIterator(\n            options, files_[0][i]->number, files_[0][i]->file_size));\n  }\n\n  // For levels > 0, we can use a concatenating iterator that sequentially\n  // walks through the non-overlapping files in the level, opening them\n  // lazily.\n  for (int level = 1; level < config::kNumLevels; level++) {\n    if (!files_[level].empty()) {\n      iters->push_back(NewConcatenatingIterator(options, level));\n    }\n  }\n}\n\n// Callback from TableCache::Get()\nnamespace {\nenum SaverState {\n  kNotFound,\n  kFound,\n  kDeleted,\n  kCorrupt,\n};\nstruct Saver {\n  SaverState state;\n  const Comparator* ucmp;\n  Slice user_key;\n  std::string* value;\n};\n}\nstatic void SaveValue(void* arg, const Slice& ikey, const Slice& v) {\n  Saver* s = reinterpret_cast<Saver*>(arg);\n  ParsedInternalKey parsed_key;\n  if (!ParseInternalKey(ikey, &parsed_key)) {\n    s->state = kCorrupt;\n  } else {\n    if (s->ucmp->Compare(parsed_key.user_key, s->user_key) == 0) {\n      s->state = (parsed_key.type == kTypeValue) ? kFound : kDeleted;\n      if (s->state == kFound) {\n        s->value->assign(v.data(), v.size());\n      }\n    }\n  }\n}\n\nstatic bool NewestFirst(FileMetaData* a, FileMetaData* b) {\n  return a->number > b->number;\n}\n\nvoid Version::ForEachOverlapping(Slice user_key, Slice internal_key,\n                                 void* arg,\n                                 bool (*func)(void*, int, FileMetaData*)) {\n  // TODO(sanjay): Change Version::Get() to use this function.\n  const Comparator* ucmp = vset_->icmp_.user_comparator();\n\n  // Search level-0 in order from newest to oldest.\n  std::vector<FileMetaData*> tmp;\n  tmp.reserve(files_[0].size());\n  for (uint32_t i = 0; i < files_[0].size(); i++) {\n    FileMetaData* f = files_[0][i];\n    if (ucmp->Compare(user_key, f->smallest.user_key()) >= 0 &&\n        ucmp->Compare(user_key, f->largest.user_key()) <= 0) {\n      tmp.push_back(f);\n    }\n  }\n  if (!tmp.empty()) {\n    std::sort(tmp.begin(), tmp.end(), NewestFirst);\n    for (uint32_t i = 0; i < tmp.size(); i++) {\n      if (!(*func)(arg, 0, tmp[i])) {\n        return;\n      }\n    }\n  }\n\n  // Search other levels.\n  for (int level = 1; level < config::kNumLevels; level++) {\n    size_t num_files = files_[level].size();\n    if (num_files == 0) continue;\n\n    // Binary search to find earliest index whose largest key >= internal_key.\n    uint32_t index = FindFile(vset_->icmp_, files_[level], internal_key);\n    if (index < num_files) {\n      FileMetaData* f = files_[level][index];\n      if (ucmp->Compare(user_key, f->smallest.user_key()) < 0) {\n        // All of \"f\" is past any data for user_key\n      } else {\n        if (!(*func)(arg, level, f)) {\n          return;\n        }\n      }\n    }\n  }\n}\n\nStatus Version::Get(const ReadOptions& options,\n                    const LookupKey& k,\n                    std::string* value,\n                    GetStats* stats) {\n  Slice ikey = k.internal_key();\n  Slice user_key = k.user_key();\n  const Comparator* ucmp = vset_->icmp_.user_comparator();\n  Status s;\n\n  stats->seek_file = NULL;\n  stats->seek_file_level = -1;\n  FileMetaData* last_file_read = NULL;\n  int last_file_read_level = -1;\n\n  // We can search level-by-level since entries never hop across\n  // levels.  Therefore we are guaranteed that if we find data\n  // in an smaller level, later levels are irrelevant.\n  std::vector<FileMetaData*> tmp;\n  FileMetaData* tmp2;\n  for (int level = 0; level < config::kNumLevels; level++) {\n    size_t num_files = files_[level].size();\n    if (num_files == 0) continue;\n\n    // Get the list of files to search in this level\n    FileMetaData* const* files = &files_[level][0];\n    if (level == 0) {\n      // Level-0 files may overlap each other.  Find all files that\n      // overlap user_key and process them in order from newest to oldest.\n      tmp.reserve(num_files);\n      for (uint32_t i = 0; i < num_files; i++) {\n        FileMetaData* f = files[i];\n        if (ucmp->Compare(user_key, f->smallest.user_key()) >= 0 &&\n            ucmp->Compare(user_key, f->largest.user_key()) <= 0) {\n          tmp.push_back(f);\n        }\n      }\n      if (tmp.empty()) continue;\n\n      std::sort(tmp.begin(), tmp.end(), NewestFirst);\n      files = &tmp[0];\n      num_files = tmp.size();\n    } else {\n      // Binary search to find earliest index whose largest key >= ikey.\n      uint32_t index = FindFile(vset_->icmp_, files_[level], ikey);\n      if (index >= num_files) {\n        files = NULL;\n        num_files = 0;\n      } else {\n        tmp2 = files[index];\n        if (ucmp->Compare(user_key, tmp2->smallest.user_key()) < 0) {\n          // All of \"tmp2\" is past any data for user_key\n          files = NULL;\n          num_files = 0;\n        } else {\n          files = &tmp2;\n          num_files = 1;\n        }\n      }\n    }\n\n    for (uint32_t i = 0; i < num_files; ++i) {\n      if (last_file_read != NULL && stats->seek_file == NULL) {\n        // We have had more than one seek for this read.  Charge the 1st file.\n        stats->seek_file = last_file_read;\n        stats->seek_file_level = last_file_read_level;\n      }\n\n      FileMetaData* f = files[i];\n      last_file_read = f;\n      last_file_read_level = level;\n\n      Saver saver;\n      saver.state = kNotFound;\n      saver.ucmp = ucmp;\n      saver.user_key = user_key;\n      saver.value = value;\n      s = vset_->table_cache_->Get(options, f->number, f->file_size,\n                                   ikey, &saver, SaveValue);\n      if (!s.ok()) {\n        return s;\n      }\n      switch (saver.state) {\n        case kNotFound:\n          break;      // Keep searching in other files\n        case kFound:\n          return s;\n        case kDeleted:\n          s = Status::NotFound(Slice());  // Use empty error message for speed\n          return s;\n        case kCorrupt:\n          s = Status::Corruption(\"corrupted key for \", user_key);\n          return s;\n      }\n    }\n  }\n\n  return Status::NotFound(Slice());  // Use an empty error message for speed\n}\n\nbool Version::UpdateStats(const GetStats& stats) {\n  FileMetaData* f = stats.seek_file;\n  if (f != NULL) {\n    f->allowed_seeks--;\n    if (f->allowed_seeks <= 0 && file_to_compact_ == NULL) {\n      file_to_compact_ = f;\n      file_to_compact_level_ = stats.seek_file_level;\n      return true;\n    }\n  }\n  return false;\n}\n\nbool Version::RecordReadSample(Slice internal_key) {\n  ParsedInternalKey ikey;\n  if (!ParseInternalKey(internal_key, &ikey)) {\n    return false;\n  }\n\n  struct State {\n    GetStats stats;  // Holds first matching file\n    int matches;\n\n    static bool Match(void* arg, int level, FileMetaData* f) {\n      State* state = reinterpret_cast<State*>(arg);\n      state->matches++;\n      if (state->matches == 1) {\n        // Remember first match.\n        state->stats.seek_file = f;\n        state->stats.seek_file_level = level;\n      }\n      // We can stop iterating once we have a second match.\n      return state->matches < 2;\n    }\n  };\n\n  State state;\n  state.matches = 0;\n  ForEachOverlapping(ikey.user_key, internal_key, &state, &State::Match);\n\n  // Must have at least two matches since we want to merge across\n  // files. But what if we have a single file that contains many\n  // overwrites and deletions?  Should we have another mechanism for\n  // finding such files?\n  if (state.matches >= 2) {\n    // 1MB cost is about 1 seek (see comment in Builder::Apply).\n    return UpdateStats(state.stats);\n  }\n  return false;\n}\n\nvoid Version::Ref() {\n  ++refs_;\n}\n\nvoid Version::Unref() {\n  assert(this != &vset_->dummy_versions_);\n  assert(refs_ >= 1);\n  --refs_;\n  if (refs_ == 0) {\n    delete this;\n  }\n}\n\nbool Version::OverlapInLevel(int level,\n                             const Slice* smallest_user_key,\n                             const Slice* largest_user_key) {\n  return SomeFileOverlapsRange(vset_->icmp_, (level > 0), files_[level],\n                               smallest_user_key, largest_user_key);\n}\n\nint Version::PickLevelForMemTableOutput(\n    const Slice& smallest_user_key,\n    const Slice& largest_user_key) {\n  int level = 0;\n  if (!OverlapInLevel(0, &smallest_user_key, &largest_user_key)) {\n    // Push to next level if there is no overlap in next level,\n    // and the #bytes overlapping in the level after that are limited.\n    InternalKey start(smallest_user_key, kMaxSequenceNumber, kValueTypeForSeek);\n    InternalKey limit(largest_user_key, 0, static_cast<ValueType>(0));\n    std::vector<FileMetaData*> overlaps;\n    while (level < config::kMaxMemCompactLevel) {\n      if (OverlapInLevel(level + 1, &smallest_user_key, &largest_user_key)) {\n        break;\n      }\n      if (level + 2 < config::kNumLevels) {\n        // Check that file does not overlap too many grandparent bytes.\n        GetOverlappingInputs(level + 2, &start, &limit, &overlaps);\n        const int64_t sum = TotalFileSize(overlaps);\n        if (sum > MaxGrandParentOverlapBytes(vset_->options_)) {\n          break;\n        }\n      }\n      level++;\n    }\n  }\n  return level;\n}\n\n// Store in \"*inputs\" all files in \"level\" that overlap [begin,end]\nvoid Version::GetOverlappingInputs(\n    int level,\n    const InternalKey* begin,\n    const InternalKey* end,\n    std::vector<FileMetaData*>* inputs) {\n  assert(level >= 0);\n  assert(level < config::kNumLevels);\n  inputs->clear();\n  Slice user_begin, user_end;\n  if (begin != NULL) {\n    user_begin = begin->user_key();\n  }\n  if (end != NULL) {\n    user_end = end->user_key();\n  }\n  const Comparator* user_cmp = vset_->icmp_.user_comparator();\n  for (size_t i = 0; i < files_[level].size(); ) {\n    FileMetaData* f = files_[level][i++];\n    const Slice file_start = f->smallest.user_key();\n    const Slice file_limit = f->largest.user_key();\n    if (begin != NULL && user_cmp->Compare(file_limit, user_begin) < 0) {\n      // \"f\" is completely before specified range; skip it\n    } else if (end != NULL && user_cmp->Compare(file_start, user_end) > 0) {\n      // \"f\" is completely after specified range; skip it\n    } else {\n      inputs->push_back(f);\n      if (level == 0) {\n        // Level-0 files may overlap each other.  So check if the newly\n        // added file has expanded the range.  If so, restart search.\n        if (begin != NULL && user_cmp->Compare(file_start, user_begin) < 0) {\n          user_begin = file_start;\n          inputs->clear();\n          i = 0;\n        } else if (end != NULL && user_cmp->Compare(file_limit, user_end) > 0) {\n          user_end = file_limit;\n          inputs->clear();\n          i = 0;\n        }\n      }\n    }\n  }\n}\n\nstd::string Version::DebugString() const {\n  std::string r;\n  for (int level = 0; level < config::kNumLevels; level++) {\n    // E.g.,\n    //   --- level 1 ---\n    //   17:123['a' .. 'd']\n    //   20:43['e' .. 'g']\n    r.append(\"--- level \");\n    AppendNumberTo(&r, level);\n    r.append(\" ---\\n\");\n    const std::vector<FileMetaData*>& files = files_[level];\n    for (size_t i = 0; i < files.size(); i++) {\n      r.push_back(' ');\n      AppendNumberTo(&r, files[i]->number);\n      r.push_back(':');\n      AppendNumberTo(&r, files[i]->file_size);\n      r.append(\"[\");\n      r.append(files[i]->smallest.DebugString());\n      r.append(\" .. \");\n      r.append(files[i]->largest.DebugString());\n      r.append(\"]\\n\");\n    }\n  }\n  return r;\n}\n\n// A helper class so we can efficiently apply a whole sequence\n// of edits to a particular state without creating intermediate\n// Versions that contain full copies of the intermediate state.\nclass VersionSet::Builder {\n private:\n  // Helper to sort by v->files_[file_number].smallest\n  struct BySmallestKey {\n    const InternalKeyComparator* internal_comparator;\n\n    bool operator()(FileMetaData* f1, FileMetaData* f2) const {\n      int r = internal_comparator->Compare(f1->smallest, f2->smallest);\n      if (r != 0) {\n        return (r < 0);\n      } else {\n        // Break ties by file number\n        return (f1->number < f2->number);\n      }\n    }\n  };\n\n  typedef std::set<FileMetaData*, BySmallestKey> FileSet;\n  struct LevelState {\n    std::set<uint64_t> deleted_files;\n    FileSet* added_files;\n  };\n\n  VersionSet* vset_;\n  Version* base_;\n  LevelState levels_[config::kNumLevels];\n\n public:\n  // Initialize a builder with the files from *base and other info from *vset\n  Builder(VersionSet* vset, Version* base)\n      : vset_(vset),\n        base_(base) {\n    base_->Ref();\n    BySmallestKey cmp;\n    cmp.internal_comparator = &vset_->icmp_;\n    for (int level = 0; level < config::kNumLevels; level++) {\n      levels_[level].added_files = new FileSet(cmp);\n    }\n  }\n\n  ~Builder() {\n    for (int level = 0; level < config::kNumLevels; level++) {\n      const FileSet* added = levels_[level].added_files;\n      std::vector<FileMetaData*> to_unref;\n      to_unref.reserve(added->size());\n      for (FileSet::const_iterator it = added->begin();\n          it != added->end(); ++it) {\n        to_unref.push_back(*it);\n      }\n      delete added;\n      for (uint32_t i = 0; i < to_unref.size(); i++) {\n        FileMetaData* f = to_unref[i];\n        f->refs--;\n        if (f->refs <= 0) {\n          delete f;\n        }\n      }\n    }\n    base_->Unref();\n  }\n\n  // Apply all of the edits in *edit to the current state.\n  void Apply(VersionEdit* edit) {\n    // Update compaction pointers\n    for (size_t i = 0; i < edit->compact_pointers_.size(); i++) {\n      const int level = edit->compact_pointers_[i].first;\n      vset_->compact_pointer_[level] =\n          edit->compact_pointers_[i].second.Encode().ToString();\n    }\n\n    // Delete files\n    const VersionEdit::DeletedFileSet& del = edit->deleted_files_;\n    for (VersionEdit::DeletedFileSet::const_iterator iter = del.begin();\n         iter != del.end();\n         ++iter) {\n      const int level = iter->first;\n      const uint64_t number = iter->second;\n      levels_[level].deleted_files.insert(number);\n    }\n\n    // Add new files\n    for (size_t i = 0; i < edit->new_files_.size(); i++) {\n      const int level = edit->new_files_[i].first;\n      FileMetaData* f = new FileMetaData(edit->new_files_[i].second);\n      f->refs = 1;\n\n      // We arrange to automatically compact this file after\n      // a certain number of seeks.  Let's assume:\n      //   (1) One seek costs 10ms\n      //   (2) Writing or reading 1MB costs 10ms (100MB/s)\n      //   (3) A compaction of 1MB does 25MB of IO:\n      //         1MB read from this level\n      //         10-12MB read from next level (boundaries may be misaligned)\n      //         10-12MB written to next level\n      // This implies that 25 seeks cost the same as the compaction\n      // of 1MB of data.  I.e., one seek costs approximately the\n      // same as the compaction of 40KB of data.  We are a little\n      // conservative and allow approximately one seek for every 16KB\n      // of data before triggering a compaction.\n      f->allowed_seeks = (f->file_size / 16384);\n      if (f->allowed_seeks < 100) f->allowed_seeks = 100;\n\n      levels_[level].deleted_files.erase(f->number);\n      levels_[level].added_files->insert(f);\n    }\n  }\n\n  // Save the current state in *v.\n  void SaveTo(Version* v) {\n    BySmallestKey cmp;\n    cmp.internal_comparator = &vset_->icmp_;\n    for (int level = 0; level < config::kNumLevels; level++) {\n      // Merge the set of added files with the set of pre-existing files.\n      // Drop any deleted files.  Store the result in *v.\n      const std::vector<FileMetaData*>& base_files = base_->files_[level];\n      std::vector<FileMetaData*>::const_iterator base_iter = base_files.begin();\n      std::vector<FileMetaData*>::const_iterator base_end = base_files.end();\n      const FileSet* added = levels_[level].added_files;\n      v->files_[level].reserve(base_files.size() + added->size());\n      for (FileSet::const_iterator added_iter = added->begin();\n           added_iter != added->end();\n           ++added_iter) {\n        // Add all smaller files listed in base_\n        for (std::vector<FileMetaData*>::const_iterator bpos\n                 = std::upper_bound(base_iter, base_end, *added_iter, cmp);\n             base_iter != bpos;\n             ++base_iter) {\n          MaybeAddFile(v, level, *base_iter);\n        }\n\n        MaybeAddFile(v, level, *added_iter);\n      }\n\n      // Add remaining base files\n      for (; base_iter != base_end; ++base_iter) {\n        MaybeAddFile(v, level, *base_iter);\n      }\n\n#ifndef NDEBUG\n      // Make sure there is no overlap in levels > 0\n      if (level > 0) {\n        for (uint32_t i = 1; i < v->files_[level].size(); i++) {\n          const InternalKey& prev_end = v->files_[level][i-1]->largest;\n          const InternalKey& this_begin = v->files_[level][i]->smallest;\n          if (vset_->icmp_.Compare(prev_end, this_begin) >= 0) {\n            fprintf(stderr, \"overlapping ranges in same level %s vs. %s\\n\",\n                    prev_end.DebugString().c_str(),\n                    this_begin.DebugString().c_str());\n            abort();\n          }\n        }\n      }\n#endif\n    }\n  }\n\n  void MaybeAddFile(Version* v, int level, FileMetaData* f) {\n    if (levels_[level].deleted_files.count(f->number) > 0) {\n      // File is deleted: do nothing\n    } else {\n      std::vector<FileMetaData*>* files = &v->files_[level];\n      if (level > 0 && !files->empty()) {\n        // Must not overlap\n        assert(vset_->icmp_.Compare((*files)[files->size()-1]->largest,\n                                    f->smallest) < 0);\n      }\n      f->refs++;\n      files->push_back(f);\n    }\n  }\n};\n\nVersionSet::VersionSet(const std::string& dbname,\n                       const Options* options,\n                       TableCache* table_cache,\n                       const InternalKeyComparator* cmp)\n    : env_(options->env),\n      dbname_(dbname),\n      options_(options),\n      table_cache_(table_cache),\n      icmp_(*cmp),\n      next_file_number_(2),\n      manifest_file_number_(0),  // Filled by Recover()\n      last_sequence_(0),\n      log_number_(0),\n      prev_log_number_(0),\n      descriptor_file_(NULL),\n      descriptor_log_(NULL),\n      dummy_versions_(this),\n      current_(NULL) {\n  AppendVersion(new Version(this));\n}\n\nVersionSet::~VersionSet() {\n  current_->Unref();\n  assert(dummy_versions_.next_ == &dummy_versions_);  // List must be empty\n  delete descriptor_log_;\n  delete descriptor_file_;\n}\n\nvoid VersionSet::AppendVersion(Version* v) {\n  // Make \"v\" current\n  assert(v->refs_ == 0);\n  assert(v != current_);\n  if (current_ != NULL) {\n    current_->Unref();\n  }\n  current_ = v;\n  v->Ref();\n\n  // Append to linked list\n  v->prev_ = dummy_versions_.prev_;\n  v->next_ = &dummy_versions_;\n  v->prev_->next_ = v;\n  v->next_->prev_ = v;\n}\n\nStatus VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu) {\n  if (edit->has_log_number_) {\n    assert(edit->log_number_ >= log_number_);\n    assert(edit->log_number_ < next_file_number_);\n  } else {\n    edit->SetLogNumber(log_number_);\n  }\n\n  if (!edit->has_prev_log_number_) {\n    edit->SetPrevLogNumber(prev_log_number_);\n  }\n\n  edit->SetNextFile(next_file_number_);\n  edit->SetLastSequence(last_sequence_);\n\n  Version* v = new Version(this);\n  {\n    Builder builder(this, current_);\n    builder.Apply(edit);\n    builder.SaveTo(v);\n  }\n  Finalize(v);\n\n  // Initialize new descriptor log file if necessary by creating\n  // a temporary file that contains a snapshot of the current version.\n  std::string new_manifest_file;\n  Status s;\n  if (descriptor_log_ == NULL) {\n    // No reason to unlock *mu here since we only hit this path in the\n    // first call to LogAndApply (when opening the database).\n    assert(descriptor_file_ == NULL);\n    new_manifest_file = DescriptorFileName(dbname_, manifest_file_number_);\n    edit->SetNextFile(next_file_number_);\n    s = env_->NewWritableFile(new_manifest_file, &descriptor_file_);\n    if (s.ok()) {\n      descriptor_log_ = new log::Writer(descriptor_file_);\n      s = WriteSnapshot(descriptor_log_);\n    }\n  }\n\n  // Unlock during expensive MANIFEST log write\n  {\n    mu->Unlock();\n\n    // Write new record to MANIFEST log\n    if (s.ok()) {\n      std::string record;\n      edit->EncodeTo(&record);\n      s = descriptor_log_->AddRecord(record);\n      if (s.ok()) {\n        s = descriptor_file_->Sync();\n      }\n      if (!s.ok()) {\n        Log(options_->info_log, \"MANIFEST write: %s\\n\", s.ToString().c_str());\n      }\n    }\n\n    // If we just created a new descriptor file, install it by writing a\n    // new CURRENT file that points to it.\n    if (s.ok() && !new_manifest_file.empty()) {\n      s = SetCurrentFile(env_, dbname_, manifest_file_number_);\n    }\n\n    mu->Lock();\n  }\n\n  // Install the new version\n  if (s.ok()) {\n    AppendVersion(v);\n    log_number_ = edit->log_number_;\n    prev_log_number_ = edit->prev_log_number_;\n  } else {\n    delete v;\n    if (!new_manifest_file.empty()) {\n      delete descriptor_log_;\n      delete descriptor_file_;\n      descriptor_log_ = NULL;\n      descriptor_file_ = NULL;\n      env_->DeleteFile(new_manifest_file);\n    }\n  }\n\n  return s;\n}\n\nStatus VersionSet::Recover(bool *save_manifest) {\n  struct LogReporter : public log::Reader::Reporter {\n    Status* status;\n    virtual void Corruption(size_t bytes, const Status& s) {\n      if (this->status->ok()) *this->status = s;\n    }\n  };\n\n  // Read \"CURRENT\" file, which contains a pointer to the current manifest file\n  std::string current;\n  Status s = ReadFileToString(env_, CurrentFileName(dbname_), &current);\n  if (!s.ok()) {\n    return s;\n  }\n  if (current.empty() || current[current.size()-1] != '\\n') {\n    return Status::Corruption(\"CURRENT file does not end with newline\");\n  }\n  current.resize(current.size() - 1);\n\n  std::string dscname = dbname_ + \"/\" + current;\n  SequentialFile* file;\n  s = env_->NewSequentialFile(dscname, &file);\n  if (!s.ok()) {\n    return s;\n  }\n\n  bool have_log_number = false;\n  bool have_prev_log_number = false;\n  bool have_next_file = false;\n  bool have_last_sequence = false;\n  uint64_t next_file = 0;\n  uint64_t last_sequence = 0;\n  uint64_t log_number = 0;\n  uint64_t prev_log_number = 0;\n  Builder builder(this, current_);\n\n  {\n    LogReporter reporter;\n    reporter.status = &s;\n    log::Reader reader(file, &reporter, true/*checksum*/, 0/*initial_offset*/);\n    Slice record;\n    std::string scratch;\n    while (reader.ReadRecord(&record, &scratch) && s.ok()) {\n      VersionEdit edit;\n      s = edit.DecodeFrom(record);\n      if (s.ok()) {\n        if (edit.has_comparator_ &&\n            edit.comparator_ != icmp_.user_comparator()->Name()) {\n          s = Status::InvalidArgument(\n              edit.comparator_ + \" does not match existing comparator \",\n              icmp_.user_comparator()->Name());\n        }\n      }\n\n      if (s.ok()) {\n        builder.Apply(&edit);\n      }\n\n      if (edit.has_log_number_) {\n        log_number = edit.log_number_;\n        have_log_number = true;\n      }\n\n      if (edit.has_prev_log_number_) {\n        prev_log_number = edit.prev_log_number_;\n        have_prev_log_number = true;\n      }\n\n      if (edit.has_next_file_number_) {\n        next_file = edit.next_file_number_;\n        have_next_file = true;\n      }\n\n      if (edit.has_last_sequence_) {\n        last_sequence = edit.last_sequence_;\n        have_last_sequence = true;\n      }\n    }\n  }\n  delete file;\n  file = NULL;\n\n  if (s.ok()) {\n    if (!have_next_file) {\n      s = Status::Corruption(\"no meta-nextfile entry in descriptor\");\n    } else if (!have_log_number) {\n      s = Status::Corruption(\"no meta-lognumber entry in descriptor\");\n    } else if (!have_last_sequence) {\n      s = Status::Corruption(\"no last-sequence-number entry in descriptor\");\n    }\n\n    if (!have_prev_log_number) {\n      prev_log_number = 0;\n    }\n\n    MarkFileNumberUsed(prev_log_number);\n    MarkFileNumberUsed(log_number);\n  }\n\n  if (s.ok()) {\n    Version* v = new Version(this);\n    builder.SaveTo(v);\n    // Install recovered version\n    Finalize(v);\n    AppendVersion(v);\n    manifest_file_number_ = next_file;\n    next_file_number_ = next_file + 1;\n    last_sequence_ = last_sequence;\n    log_number_ = log_number;\n    prev_log_number_ = prev_log_number;\n\n    // See if we can reuse the existing MANIFEST file.\n    if (ReuseManifest(dscname, current)) {\n      // No need to save new manifest\n    } else {\n      *save_manifest = true;\n    }\n  }\n\n  return s;\n}\n\nbool VersionSet::ReuseManifest(const std::string& dscname,\n                               const std::string& dscbase) {\n  if (!options_->reuse_logs) {\n    return false;\n  }\n  FileType manifest_type;\n  uint64_t manifest_number;\n  uint64_t manifest_size;\n  if (!ParseFileName(dscbase, &manifest_number, &manifest_type) ||\n      manifest_type != kDescriptorFile ||\n      !env_->GetFileSize(dscname, &manifest_size).ok() ||\n      // Make new compacted MANIFEST if old one is too big\n      manifest_size >= TargetFileSize(options_)) {\n    return false;\n  }\n\n  assert(descriptor_file_ == NULL);\n  assert(descriptor_log_ == NULL);\n  Status r = env_->NewAppendableFile(dscname, &descriptor_file_);\n  if (!r.ok()) {\n    Log(options_->info_log, \"Reuse MANIFEST: %s\\n\", r.ToString().c_str());\n    assert(descriptor_file_ == NULL);\n    return false;\n  }\n\n  Log(options_->info_log, \"Reusing MANIFEST %s\\n\", dscname.c_str());\n  descriptor_log_ = new log::Writer(descriptor_file_, manifest_size);\n  manifest_file_number_ = manifest_number;\n  return true;\n}\n\nvoid VersionSet::MarkFileNumberUsed(uint64_t number) {\n  if (next_file_number_ <= number) {\n    next_file_number_ = number + 1;\n  }\n}\n\nvoid VersionSet::Finalize(Version* v) {\n  // Precomputed best level for next compaction\n  int best_level = -1;\n  double best_score = -1;\n\n  for (int level = 0; level < config::kNumLevels-1; level++) {\n    double score;\n    if (level == 0) {\n      // We treat level-0 specially by bounding the number of files\n      // instead of number of bytes for two reasons:\n      //\n      // (1) With larger write-buffer sizes, it is nice not to do too\n      // many level-0 compactions.\n      //\n      // (2) The files in level-0 are merged on every read and\n      // therefore we wish to avoid too many files when the individual\n      // file size is small (perhaps because of a small write-buffer\n      // setting, or very high compression ratios, or lots of\n      // overwrites/deletions).\n      score = v->files_[level].size() /\n          static_cast<double>(config::kL0_CompactionTrigger);\n    } else {\n      // Compute the ratio of current size to size limit.\n      const uint64_t level_bytes = TotalFileSize(v->files_[level]);\n      score =\n          static_cast<double>(level_bytes) / MaxBytesForLevel(options_, level);\n    }\n\n    if (score > best_score) {\n      best_level = level;\n      best_score = score;\n    }\n  }\n\n  v->compaction_level_ = best_level;\n  v->compaction_score_ = best_score;\n}\n\nStatus VersionSet::WriteSnapshot(log::Writer* log) {\n  // TODO: Break up into multiple records to reduce memory usage on recovery?\n\n  // Save metadata\n  VersionEdit edit;\n  edit.SetComparatorName(icmp_.user_comparator()->Name());\n\n  // Save compaction pointers\n  for (int level = 0; level < config::kNumLevels; level++) {\n    if (!compact_pointer_[level].empty()) {\n      InternalKey key;\n      key.DecodeFrom(compact_pointer_[level]);\n      edit.SetCompactPointer(level, key);\n    }\n  }\n\n  // Save files\n  for (int level = 0; level < config::kNumLevels; level++) {\n    const std::vector<FileMetaData*>& files = current_->files_[level];\n    for (size_t i = 0; i < files.size(); i++) {\n      const FileMetaData* f = files[i];\n      edit.AddFile(level, f->number, f->file_size, f->smallest, f->largest);\n    }\n  }\n\n  std::string record;\n  edit.EncodeTo(&record);\n  return log->AddRecord(record);\n}\n\nint VersionSet::NumLevelFiles(int level) const {\n  assert(level >= 0);\n  assert(level < config::kNumLevels);\n  return current_->files_[level].size();\n}\n\nconst char* VersionSet::LevelSummary(LevelSummaryStorage* scratch) const {\n  // Update code if kNumLevels changes\n  assert(config::kNumLevels == 7);\n  snprintf(scratch->buffer, sizeof(scratch->buffer),\n           \"files[ %d %d %d %d %d %d %d ]\",\n           int(current_->files_[0].size()),\n           int(current_->files_[1].size()),\n           int(current_->files_[2].size()),\n           int(current_->files_[3].size()),\n           int(current_->files_[4].size()),\n           int(current_->files_[5].size()),\n           int(current_->files_[6].size()));\n  return scratch->buffer;\n}\n\nuint64_t VersionSet::ApproximateOffsetOf(Version* v, const InternalKey& ikey) {\n  uint64_t result = 0;\n  for (int level = 0; level < config::kNumLevels; level++) {\n    const std::vector<FileMetaData*>& files = v->files_[level];\n    for (size_t i = 0; i < files.size(); i++) {\n      if (icmp_.Compare(files[i]->largest, ikey) <= 0) {\n        // Entire file is before \"ikey\", so just add the file size\n        result += files[i]->file_size;\n      } else if (icmp_.Compare(files[i]->smallest, ikey) > 0) {\n        // Entire file is after \"ikey\", so ignore\n        if (level > 0) {\n          // Files other than level 0 are sorted by meta->smallest, so\n          // no further files in this level will contain data for\n          // \"ikey\".\n          break;\n        }\n      } else {\n        // \"ikey\" falls in the range for this table.  Add the\n        // approximate offset of \"ikey\" within the table.\n        Table* tableptr;\n        Iterator* iter = table_cache_->NewIterator(\n            ReadOptions(), files[i]->number, files[i]->file_size, &tableptr);\n        if (tableptr != NULL) {\n          result += tableptr->ApproximateOffsetOf(ikey.Encode());\n        }\n        delete iter;\n      }\n    }\n  }\n  return result;\n}\n\nvoid VersionSet::AddLiveFiles(std::set<uint64_t>* live) {\n  for (Version* v = dummy_versions_.next_;\n       v != &dummy_versions_;\n       v = v->next_) {\n    for (int level = 0; level < config::kNumLevels; level++) {\n      const std::vector<FileMetaData*>& files = v->files_[level];\n      for (size_t i = 0; i < files.size(); i++) {\n        live->insert(files[i]->number);\n      }\n    }\n  }\n}\n\nint64_t VersionSet::NumLevelBytes(int level) const {\n  assert(level >= 0);\n  assert(level < config::kNumLevels);\n  return TotalFileSize(current_->files_[level]);\n}\n\nint64_t VersionSet::MaxNextLevelOverlappingBytes() {\n  int64_t result = 0;\n  std::vector<FileMetaData*> overlaps;\n  for (int level = 1; level < config::kNumLevels - 1; level++) {\n    for (size_t i = 0; i < current_->files_[level].size(); i++) {\n      const FileMetaData* f = current_->files_[level][i];\n      current_->GetOverlappingInputs(level+1, &f->smallest, &f->largest,\n                                     &overlaps);\n      const int64_t sum = TotalFileSize(overlaps);\n      if (sum > result) {\n        result = sum;\n      }\n    }\n  }\n  return result;\n}\n\n// Stores the minimal range that covers all entries in inputs in\n// *smallest, *largest.\n// REQUIRES: inputs is not empty\nvoid VersionSet::GetRange(const std::vector<FileMetaData*>& inputs,\n                          InternalKey* smallest,\n                          InternalKey* largest) {\n  assert(!inputs.empty());\n  smallest->Clear();\n  largest->Clear();\n  for (size_t i = 0; i < inputs.size(); i++) {\n    FileMetaData* f = inputs[i];\n    if (i == 0) {\n      *smallest = f->smallest;\n      *largest = f->largest;\n    } else {\n      if (icmp_.Compare(f->smallest, *smallest) < 0) {\n        *smallest = f->smallest;\n      }\n      if (icmp_.Compare(f->largest, *largest) > 0) {\n        *largest = f->largest;\n      }\n    }\n  }\n}\n\n// Stores the minimal range that covers all entries in inputs1 and inputs2\n// in *smallest, *largest.\n// REQUIRES: inputs is not empty\nvoid VersionSet::GetRange2(const std::vector<FileMetaData*>& inputs1,\n                           const std::vector<FileMetaData*>& inputs2,\n                           InternalKey* smallest,\n                           InternalKey* largest) {\n  std::vector<FileMetaData*> all = inputs1;\n  all.insert(all.end(), inputs2.begin(), inputs2.end());\n  GetRange(all, smallest, largest);\n}\n\nIterator* VersionSet::MakeInputIterator(Compaction* c) {\n  ReadOptions options;\n  options.verify_checksums = options_->paranoid_checks;\n  options.fill_cache = false;\n\n  // Level-0 files have to be merged together.  For other levels,\n  // we will make a concatenating iterator per level.\n  // TODO(opt): use concatenating iterator for level-0 if there is no overlap\n  const int space = (c->level() == 0 ? c->inputs_[0].size() + 1 : 2);\n  Iterator** list = new Iterator*[space];\n  int num = 0;\n  for (int which = 0; which < 2; which++) {\n    if (!c->inputs_[which].empty()) {\n      if (c->level() + which == 0) {\n        const std::vector<FileMetaData*>& files = c->inputs_[which];\n        for (size_t i = 0; i < files.size(); i++) {\n          list[num++] = table_cache_->NewIterator(\n              options, files[i]->number, files[i]->file_size);\n        }\n      } else {\n        // Create concatenating iterator for the files from this level\n        list[num++] = NewTwoLevelIterator(\n            new Version::LevelFileNumIterator(icmp_, &c->inputs_[which]),\n            &GetFileIterator, table_cache_, options);\n      }\n    }\n  }\n  assert(num <= space);\n  Iterator* result = NewMergingIterator(&icmp_, list, num);\n  delete[] list;\n  return result;\n}\n\nCompaction* VersionSet::PickCompaction() {\n  Compaction* c;\n  int level;\n\n  // We prefer compactions triggered by too much data in a level over\n  // the compactions triggered by seeks.\n  const bool size_compaction = (current_->compaction_score_ >= 1);\n  const bool seek_compaction = (current_->file_to_compact_ != NULL);\n  if (size_compaction) {\n    level = current_->compaction_level_;\n    assert(level >= 0);\n    assert(level+1 < config::kNumLevels);\n    c = new Compaction(options_, level);\n\n    // Pick the first file that comes after compact_pointer_[level]\n    for (size_t i = 0; i < current_->files_[level].size(); i++) {\n      FileMetaData* f = current_->files_[level][i];\n      if (compact_pointer_[level].empty() ||\n          icmp_.Compare(f->largest.Encode(), compact_pointer_[level]) > 0) {\n        c->inputs_[0].push_back(f);\n        break;\n      }\n    }\n    if (c->inputs_[0].empty()) {\n      // Wrap-around to the beginning of the key space\n      c->inputs_[0].push_back(current_->files_[level][0]);\n    }\n  } else if (seek_compaction) {\n    level = current_->file_to_compact_level_;\n    c = new Compaction(options_, level);\n    c->inputs_[0].push_back(current_->file_to_compact_);\n  } else {\n    return NULL;\n  }\n\n  c->input_version_ = current_;\n  c->input_version_->Ref();\n\n  // Files in level 0 may overlap each other, so pick up all overlapping ones\n  if (level == 0) {\n    InternalKey smallest, largest;\n    GetRange(c->inputs_[0], &smallest, &largest);\n    // Note that the next call will discard the file we placed in\n    // c->inputs_[0] earlier and replace it with an overlapping set\n    // which will include the picked file.\n    current_->GetOverlappingInputs(0, &smallest, &largest, &c->inputs_[0]);\n    assert(!c->inputs_[0].empty());\n  }\n\n  SetupOtherInputs(c);\n\n  return c;\n}\n\nvoid VersionSet::SetupOtherInputs(Compaction* c) {\n  const int level = c->level();\n  InternalKey smallest, largest;\n  GetRange(c->inputs_[0], &smallest, &largest);\n\n  current_->GetOverlappingInputs(level+1, &smallest, &largest, &c->inputs_[1]);\n\n  // Get entire range covered by compaction\n  InternalKey all_start, all_limit;\n  GetRange2(c->inputs_[0], c->inputs_[1], &all_start, &all_limit);\n\n  // See if we can grow the number of inputs in \"level\" without\n  // changing the number of \"level+1\" files we pick up.\n  if (!c->inputs_[1].empty()) {\n    std::vector<FileMetaData*> expanded0;\n    current_->GetOverlappingInputs(level, &all_start, &all_limit, &expanded0);\n    const int64_t inputs0_size = TotalFileSize(c->inputs_[0]);\n    const int64_t inputs1_size = TotalFileSize(c->inputs_[1]);\n    const int64_t expanded0_size = TotalFileSize(expanded0);\n    if (expanded0.size() > c->inputs_[0].size() &&\n        inputs1_size + expanded0_size <\n            ExpandedCompactionByteSizeLimit(options_)) {\n      InternalKey new_start, new_limit;\n      GetRange(expanded0, &new_start, &new_limit);\n      std::vector<FileMetaData*> expanded1;\n      current_->GetOverlappingInputs(level+1, &new_start, &new_limit,\n                                     &expanded1);\n      if (expanded1.size() == c->inputs_[1].size()) {\n        Log(options_->info_log,\n            \"Expanding@%d %d+%d (%ld+%ld bytes) to %d+%d (%ld+%ld bytes)\\n\",\n            level,\n            int(c->inputs_[0].size()),\n            int(c->inputs_[1].size()),\n            long(inputs0_size), long(inputs1_size),\n            int(expanded0.size()),\n            int(expanded1.size()),\n            long(expanded0_size), long(inputs1_size));\n        smallest = new_start;\n        largest = new_limit;\n        c->inputs_[0] = expanded0;\n        c->inputs_[1] = expanded1;\n        GetRange2(c->inputs_[0], c->inputs_[1], &all_start, &all_limit);\n      }\n    }\n  }\n\n  // Compute the set of grandparent files that overlap this compaction\n  // (parent == level+1; grandparent == level+2)\n  if (level + 2 < config::kNumLevels) {\n    current_->GetOverlappingInputs(level + 2, &all_start, &all_limit,\n                                   &c->grandparents_);\n  }\n\n  if (false) {\n    Log(options_->info_log, \"Compacting %d '%s' .. '%s'\",\n        level,\n        smallest.DebugString().c_str(),\n        largest.DebugString().c_str());\n  }\n\n  // Update the place where we will do the next compaction for this level.\n  // We update this immediately instead of waiting for the VersionEdit\n  // to be applied so that if the compaction fails, we will try a different\n  // key range next time.\n  compact_pointer_[level] = largest.Encode().ToString();\n  c->edit_.SetCompactPointer(level, largest);\n}\n\nCompaction* VersionSet::CompactRange(\n    int level,\n    const InternalKey* begin,\n    const InternalKey* end) {\n  std::vector<FileMetaData*> inputs;\n  current_->GetOverlappingInputs(level, begin, end, &inputs);\n  if (inputs.empty()) {\n    return NULL;\n  }\n\n  // Avoid compacting too much in one shot in case the range is large.\n  // But we cannot do this for level-0 since level-0 files can overlap\n  // and we must not pick one file and drop another older file if the\n  // two files overlap.\n  if (level > 0) {\n    const uint64_t limit = MaxFileSizeForLevel(options_, level);\n    uint64_t total = 0;\n    for (size_t i = 0; i < inputs.size(); i++) {\n      uint64_t s = inputs[i]->file_size;\n      total += s;\n      if (total >= limit) {\n        inputs.resize(i + 1);\n        break;\n      }\n    }\n  }\n\n  Compaction* c = new Compaction(options_, level);\n  c->input_version_ = current_;\n  c->input_version_->Ref();\n  c->inputs_[0] = inputs;\n  SetupOtherInputs(c);\n  return c;\n}\n\nCompaction::Compaction(const Options* options, int level)\n    : level_(level),\n      max_output_file_size_(MaxFileSizeForLevel(options, level)),\n      input_version_(NULL),\n      grandparent_index_(0),\n      seen_key_(false),\n      overlapped_bytes_(0) {\n  for (int i = 0; i < config::kNumLevels; i++) {\n    level_ptrs_[i] = 0;\n  }\n}\n\nCompaction::~Compaction() {\n  if (input_version_ != NULL) {\n    input_version_->Unref();\n  }\n}\n\nbool Compaction::IsTrivialMove() const {\n  const VersionSet* vset = input_version_->vset_;\n  // Avoid a move if there is lots of overlapping grandparent data.\n  // Otherwise, the move could create a parent file that will require\n  // a very expensive merge later on.\n  return (num_input_files(0) == 1 && num_input_files(1) == 0 &&\n          TotalFileSize(grandparents_) <=\n              MaxGrandParentOverlapBytes(vset->options_));\n}\n\nvoid Compaction::AddInputDeletions(VersionEdit* edit) {\n  for (int which = 0; which < 2; which++) {\n    for (size_t i = 0; i < inputs_[which].size(); i++) {\n      edit->DeleteFile(level_ + which, inputs_[which][i]->number);\n    }\n  }\n}\n\nbool Compaction::IsBaseLevelForKey(const Slice& user_key) {\n  // Maybe use binary search to find right entry instead of linear search?\n  const Comparator* user_cmp = input_version_->vset_->icmp_.user_comparator();\n  for (int lvl = level_ + 2; lvl < config::kNumLevels; lvl++) {\n    const std::vector<FileMetaData*>& files = input_version_->files_[lvl];\n    for (; level_ptrs_[lvl] < files.size(); ) {\n      FileMetaData* f = files[level_ptrs_[lvl]];\n      if (user_cmp->Compare(user_key, f->largest.user_key()) <= 0) {\n        // We've advanced far enough\n        if (user_cmp->Compare(user_key, f->smallest.user_key()) >= 0) {\n          // Key falls in this file's range, so definitely not base level\n          return false;\n        }\n        break;\n      }\n      level_ptrs_[lvl]++;\n    }\n  }\n  return true;\n}\n\nbool Compaction::ShouldStopBefore(const Slice& internal_key) {\n  const VersionSet* vset = input_version_->vset_;\n  // Scan to find earliest grandparent file that contains key.\n  const InternalKeyComparator* icmp = &vset->icmp_;\n  while (grandparent_index_ < grandparents_.size() &&\n      icmp->Compare(internal_key,\n                    grandparents_[grandparent_index_]->largest.Encode()) > 0) {\n    if (seen_key_) {\n      overlapped_bytes_ += grandparents_[grandparent_index_]->file_size;\n    }\n    grandparent_index_++;\n  }\n  seen_key_ = true;\n\n  if (overlapped_bytes_ > MaxGrandParentOverlapBytes(vset->options_)) {\n    // Too much overlap for current output; start new output\n    overlapped_bytes_ = 0;\n    return true;\n  } else {\n    return false;\n  }\n}\n\nvoid Compaction::ReleaseInputs() {\n  if (input_version_ != NULL) {\n    input_version_->Unref();\n    input_version_ = NULL;\n  }\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/version_set.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// The representation of a DBImpl consists of a set of Versions.  The\n// newest version is called \"current\".  Older versions may be kept\n// around to provide a consistent view to live iterators.\n//\n// Each Version keeps track of a set of Table files per level.  The\n// entire set of versions is maintained in a VersionSet.\n//\n// Version,VersionSet are thread-compatible, but require external\n// synchronization on all accesses.\n\n#ifndef STORAGE_LEVELDB_DB_VERSION_SET_H_\n#define STORAGE_LEVELDB_DB_VERSION_SET_H_\n\n#include <map>\n#include <set>\n#include <vector>\n#include \"db/dbformat.h\"\n#include \"db/version_edit.h\"\n#include \"port/port.h\"\n#include \"port/thread_annotations.h\"\n\nnamespace leveldb {\n\nnamespace log { class Writer; }\n\nclass Compaction;\nclass Iterator;\nclass MemTable;\nclass TableBuilder;\nclass TableCache;\nclass Version;\nclass VersionSet;\nclass WritableFile;\n\n// Return the smallest index i such that files[i]->largest >= key.\n// Return files.size() if there is no such file.\n// REQUIRES: \"files\" contains a sorted list of non-overlapping files.\nextern int FindFile(const InternalKeyComparator& icmp,\n                    const std::vector<FileMetaData*>& files,\n                    const Slice& key);\n\n// Returns true iff some file in \"files\" overlaps the user key range\n// [*smallest,*largest].\n// smallest==NULL represents a key smaller than all keys in the DB.\n// largest==NULL represents a key largest than all keys in the DB.\n// REQUIRES: If disjoint_sorted_files, files[] contains disjoint ranges\n//           in sorted order.\nextern bool SomeFileOverlapsRange(\n    const InternalKeyComparator& icmp,\n    bool disjoint_sorted_files,\n    const std::vector<FileMetaData*>& files,\n    const Slice* smallest_user_key,\n    const Slice* largest_user_key);\n\nclass Version {\n public:\n  // Append to *iters a sequence of iterators that will\n  // yield the contents of this Version when merged together.\n  // REQUIRES: This version has been saved (see VersionSet::SaveTo)\n  void AddIterators(const ReadOptions&, std::vector<Iterator*>* iters);\n\n  // Lookup the value for key.  If found, store it in *val and\n  // return OK.  Else return a non-OK status.  Fills *stats.\n  // REQUIRES: lock is not held\n  struct GetStats {\n    FileMetaData* seek_file;\n    int seek_file_level;\n  };\n  Status Get(const ReadOptions&, const LookupKey& key, std::string* val,\n             GetStats* stats);\n\n  // Adds \"stats\" into the current state.  Returns true if a new\n  // compaction may need to be triggered, false otherwise.\n  // REQUIRES: lock is held\n  bool UpdateStats(const GetStats& stats);\n\n  // Record a sample of bytes read at the specified internal key.\n  // Samples are taken approximately once every config::kReadBytesPeriod\n  // bytes.  Returns true if a new compaction may need to be triggered.\n  // REQUIRES: lock is held\n  bool RecordReadSample(Slice key);\n\n  // Reference count management (so Versions do not disappear out from\n  // under live iterators)\n  void Ref();\n  void Unref();\n\n  void GetOverlappingInputs(\n      int level,\n      const InternalKey* begin,         // NULL means before all keys\n      const InternalKey* end,           // NULL means after all keys\n      std::vector<FileMetaData*>* inputs);\n\n  // Returns true iff some file in the specified level overlaps\n  // some part of [*smallest_user_key,*largest_user_key].\n  // smallest_user_key==NULL represents a key smaller than all keys in the DB.\n  // largest_user_key==NULL represents a key largest than all keys in the DB.\n  bool OverlapInLevel(int level,\n                      const Slice* smallest_user_key,\n                      const Slice* largest_user_key);\n\n  // Return the level at which we should place a new memtable compaction\n  // result that covers the range [smallest_user_key,largest_user_key].\n  int PickLevelForMemTableOutput(const Slice& smallest_user_key,\n                                 const Slice& largest_user_key);\n\n  int NumFiles(int level) const { return files_[level].size(); }\n\n  // Return a human readable string that describes this version's contents.\n  std::string DebugString() const;\n\n private:\n  friend class Compaction;\n  friend class VersionSet;\n\n  class LevelFileNumIterator;\n  Iterator* NewConcatenatingIterator(const ReadOptions&, int level) const;\n\n  // Call func(arg, level, f) for every file that overlaps user_key in\n  // order from newest to oldest.  If an invocation of func returns\n  // false, makes no more calls.\n  //\n  // REQUIRES: user portion of internal_key == user_key.\n  void ForEachOverlapping(Slice user_key, Slice internal_key,\n                          void* arg,\n                          bool (*func)(void*, int, FileMetaData*));\n\n  VersionSet* vset_;            // VersionSet to which this Version belongs\n  Version* next_;               // Next version in linked list\n  Version* prev_;               // Previous version in linked list\n  int refs_;                    // Number of live refs to this version\n\n  // List of files per level\n  std::vector<FileMetaData*> files_[config::kNumLevels];\n\n  // Next file to compact based on seek stats.\n  FileMetaData* file_to_compact_;\n  int file_to_compact_level_;\n\n  // Level that should be compacted next and its compaction score.\n  // Score < 1 means compaction is not strictly needed.  These fields\n  // are initialized by Finalize().\n  double compaction_score_;\n  int compaction_level_;\n\n  explicit Version(VersionSet* vset)\n      : vset_(vset), next_(this), prev_(this), refs_(0),\n        file_to_compact_(NULL),\n        file_to_compact_level_(-1),\n        compaction_score_(-1),\n        compaction_level_(-1) {\n  }\n\n  ~Version();\n\n  // No copying allowed\n  Version(const Version&);\n  void operator=(const Version&);\n};\n\nclass VersionSet {\n public:\n  VersionSet(const std::string& dbname,\n             const Options* options,\n             TableCache* table_cache,\n             const InternalKeyComparator*);\n  ~VersionSet();\n\n  // Apply *edit to the current version to form a new descriptor that\n  // is both saved to persistent state and installed as the new\n  // current version.  Will release *mu while actually writing to the file.\n  // REQUIRES: *mu is held on entry.\n  // REQUIRES: no other thread concurrently calls LogAndApply()\n  Status LogAndApply(VersionEdit* edit, port::Mutex* mu)\n      EXCLUSIVE_LOCKS_REQUIRED(mu);\n\n  // Recover the last saved descriptor from persistent storage.\n  Status Recover(bool *save_manifest);\n\n  // Return the current version.\n  Version* current() const { return current_; }\n\n  // Return the current manifest file number\n  uint64_t ManifestFileNumber() const { return manifest_file_number_; }\n\n  // Allocate and return a new file number\n  uint64_t NewFileNumber() { return next_file_number_++; }\n\n  // Arrange to reuse \"file_number\" unless a newer file number has\n  // already been allocated.\n  // REQUIRES: \"file_number\" was returned by a call to NewFileNumber().\n  void ReuseFileNumber(uint64_t file_number) {\n    if (next_file_number_ == file_number + 1) {\n      next_file_number_ = file_number;\n    }\n  }\n\n  // Return the number of Table files at the specified level.\n  int NumLevelFiles(int level) const;\n\n  // Return the combined file size of all files at the specified level.\n  int64_t NumLevelBytes(int level) const;\n\n  // Return the last sequence number.\n  uint64_t LastSequence() const { return last_sequence_; }\n\n  // Set the last sequence number to s.\n  void SetLastSequence(uint64_t s) {\n    assert(s >= last_sequence_);\n    last_sequence_ = s;\n  }\n\n  // Mark the specified file number as used.\n  void MarkFileNumberUsed(uint64_t number);\n\n  // Return the current log file number.\n  uint64_t LogNumber() const { return log_number_; }\n\n  // Return the log file number for the log file that is currently\n  // being compacted, or zero if there is no such log file.\n  uint64_t PrevLogNumber() const { return prev_log_number_; }\n\n  // Pick level and inputs for a new compaction.\n  // Returns NULL if there is no compaction to be done.\n  // Otherwise returns a pointer to a heap-allocated object that\n  // describes the compaction.  Caller should delete the result.\n  Compaction* PickCompaction();\n\n  // Return a compaction object for compacting the range [begin,end] in\n  // the specified level.  Returns NULL if there is nothing in that\n  // level that overlaps the specified range.  Caller should delete\n  // the result.\n  Compaction* CompactRange(\n      int level,\n      const InternalKey* begin,\n      const InternalKey* end);\n\n  // Return the maximum overlapping data (in bytes) at next level for any\n  // file at a level >= 1.\n  int64_t MaxNextLevelOverlappingBytes();\n\n  // Create an iterator that reads over the compaction inputs for \"*c\".\n  // The caller should delete the iterator when no longer needed.\n  Iterator* MakeInputIterator(Compaction* c);\n\n  // Returns true iff some level needs a compaction.\n  bool NeedsCompaction() const {\n    Version* v = current_;\n    return (v->compaction_score_ >= 1) || (v->file_to_compact_ != NULL);\n  }\n\n  // Add all files listed in any live version to *live.\n  // May also mutate some internal state.\n  void AddLiveFiles(std::set<uint64_t>* live);\n\n  // Return the approximate offset in the database of the data for\n  // \"key\" as of version \"v\".\n  uint64_t ApproximateOffsetOf(Version* v, const InternalKey& key);\n\n  // Return a human-readable short (single-line) summary of the number\n  // of files per level.  Uses *scratch as backing store.\n  struct LevelSummaryStorage {\n    char buffer[100];\n  };\n  const char* LevelSummary(LevelSummaryStorage* scratch) const;\n\n private:\n  class Builder;\n\n  friend class Compaction;\n  friend class Version;\n\n  bool ReuseManifest(const std::string& dscname, const std::string& dscbase);\n\n  void Finalize(Version* v);\n\n  void GetRange(const std::vector<FileMetaData*>& inputs,\n                InternalKey* smallest,\n                InternalKey* largest);\n\n  void GetRange2(const std::vector<FileMetaData*>& inputs1,\n                 const std::vector<FileMetaData*>& inputs2,\n                 InternalKey* smallest,\n                 InternalKey* largest);\n\n  void SetupOtherInputs(Compaction* c);\n\n  // Save current contents to *log\n  Status WriteSnapshot(log::Writer* log);\n\n  void AppendVersion(Version* v);\n\n  Env* const env_;\n  const std::string dbname_;\n  const Options* const options_;\n  TableCache* const table_cache_;\n  const InternalKeyComparator icmp_;\n  uint64_t next_file_number_;\n  uint64_t manifest_file_number_;\n  uint64_t last_sequence_;\n  uint64_t log_number_;\n  uint64_t prev_log_number_;  // 0 or backing store for memtable being compacted\n\n  // Opened lazily\n  WritableFile* descriptor_file_;\n  log::Writer* descriptor_log_;\n  Version dummy_versions_;  // Head of circular doubly-linked list of versions.\n  Version* current_;        // == dummy_versions_.prev_\n\n  // Per-level key at which the next compaction at that level should start.\n  // Either an empty string, or a valid InternalKey.\n  std::string compact_pointer_[config::kNumLevels];\n\n  // No copying allowed\n  VersionSet(const VersionSet&);\n  void operator=(const VersionSet&);\n};\n\n// A Compaction encapsulates information about a compaction.\nclass Compaction {\n public:\n  ~Compaction();\n\n  // Return the level that is being compacted.  Inputs from \"level\"\n  // and \"level+1\" will be merged to produce a set of \"level+1\" files.\n  int level() const { return level_; }\n\n  // Return the object that holds the edits to the descriptor done\n  // by this compaction.\n  VersionEdit* edit() { return &edit_; }\n\n  // \"which\" must be either 0 or 1\n  int num_input_files(int which) const { return inputs_[which].size(); }\n\n  // Return the ith input file at \"level()+which\" (\"which\" must be 0 or 1).\n  FileMetaData* input(int which, int i) const { return inputs_[which][i]; }\n\n  // Maximum size of files to build during this compaction.\n  uint64_t MaxOutputFileSize() const { return max_output_file_size_; }\n\n  // Is this a trivial compaction that can be implemented by just\n  // moving a single input file to the next level (no merging or splitting)\n  bool IsTrivialMove() const;\n\n  // Add all inputs to this compaction as delete operations to *edit.\n  void AddInputDeletions(VersionEdit* edit);\n\n  // Returns true if the information we have available guarantees that\n  // the compaction is producing data in \"level+1\" for which no data exists\n  // in levels greater than \"level+1\".\n  bool IsBaseLevelForKey(const Slice& user_key);\n\n  // Returns true iff we should stop building the current output\n  // before processing \"internal_key\".\n  bool ShouldStopBefore(const Slice& internal_key);\n\n  // Release the input version for the compaction, once the compaction\n  // is successful.\n  void ReleaseInputs();\n\n private:\n  friend class Version;\n  friend class VersionSet;\n\n  Compaction(const Options* options, int level);\n\n  int level_;\n  uint64_t max_output_file_size_;\n  Version* input_version_;\n  VersionEdit edit_;\n\n  // Each compaction reads inputs from \"level_\" and \"level_+1\"\n  std::vector<FileMetaData*> inputs_[2];      // The two sets of inputs\n\n  // State used to check for number of overlapping grandparent files\n  // (parent == level_ + 1, grandparent == level_ + 2)\n  std::vector<FileMetaData*> grandparents_;\n  size_t grandparent_index_;  // Index in grandparent_starts_\n  bool seen_key_;             // Some output key has been seen\n  int64_t overlapped_bytes_;  // Bytes of overlap between current output\n                              // and grandparent files\n\n  // State for implementing IsBaseLevelForKey\n\n  // level_ptrs_ holds indices into input_version_->levels_: our state\n  // is that we are positioned at one of the file ranges for each\n  // higher level than the ones involved in this compaction (i.e. for\n  // all L >= level_ + 2).\n  size_t level_ptrs_[config::kNumLevels];\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_DB_VERSION_SET_H_\n"
  },
  {
    "path": "src/leveldb/db/version_set_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"db/version_set.h\"\n#include \"util/logging.h\"\n#include \"util/testharness.h\"\n#include \"util/testutil.h\"\n\nnamespace leveldb {\n\nclass FindFileTest {\n public:\n  std::vector<FileMetaData*> files_;\n  bool disjoint_sorted_files_;\n\n  FindFileTest() : disjoint_sorted_files_(true) { }\n\n  ~FindFileTest() {\n    for (int i = 0; i < files_.size(); i++) {\n      delete files_[i];\n    }\n  }\n\n  void Add(const char* smallest, const char* largest,\n           SequenceNumber smallest_seq = 100,\n           SequenceNumber largest_seq = 100) {\n    FileMetaData* f = new FileMetaData;\n    f->number = files_.size() + 1;\n    f->smallest = InternalKey(smallest, smallest_seq, kTypeValue);\n    f->largest = InternalKey(largest, largest_seq, kTypeValue);\n    files_.push_back(f);\n  }\n\n  int Find(const char* key) {\n    InternalKey target(key, 100, kTypeValue);\n    InternalKeyComparator cmp(BytewiseComparator());\n    return FindFile(cmp, files_, target.Encode());\n  }\n\n  bool Overlaps(const char* smallest, const char* largest) {\n    InternalKeyComparator cmp(BytewiseComparator());\n    Slice s(smallest != NULL ? smallest : \"\");\n    Slice l(largest != NULL ? largest : \"\");\n    return SomeFileOverlapsRange(cmp, disjoint_sorted_files_, files_,\n                                 (smallest != NULL ? &s : NULL),\n                                 (largest != NULL ? &l : NULL));\n  }\n};\n\nTEST(FindFileTest, Empty) {\n  ASSERT_EQ(0, Find(\"foo\"));\n  ASSERT_TRUE(! Overlaps(\"a\", \"z\"));\n  ASSERT_TRUE(! Overlaps(NULL, \"z\"));\n  ASSERT_TRUE(! Overlaps(\"a\", NULL));\n  ASSERT_TRUE(! Overlaps(NULL, NULL));\n}\n\nTEST(FindFileTest, Single) {\n  Add(\"p\", \"q\");\n  ASSERT_EQ(0, Find(\"a\"));\n  ASSERT_EQ(0, Find(\"p\"));\n  ASSERT_EQ(0, Find(\"p1\"));\n  ASSERT_EQ(0, Find(\"q\"));\n  ASSERT_EQ(1, Find(\"q1\"));\n  ASSERT_EQ(1, Find(\"z\"));\n\n  ASSERT_TRUE(! Overlaps(\"a\", \"b\"));\n  ASSERT_TRUE(! Overlaps(\"z1\", \"z2\"));\n  ASSERT_TRUE(Overlaps(\"a\", \"p\"));\n  ASSERT_TRUE(Overlaps(\"a\", \"q\"));\n  ASSERT_TRUE(Overlaps(\"a\", \"z\"));\n  ASSERT_TRUE(Overlaps(\"p\", \"p1\"));\n  ASSERT_TRUE(Overlaps(\"p\", \"q\"));\n  ASSERT_TRUE(Overlaps(\"p\", \"z\"));\n  ASSERT_TRUE(Overlaps(\"p1\", \"p2\"));\n  ASSERT_TRUE(Overlaps(\"p1\", \"z\"));\n  ASSERT_TRUE(Overlaps(\"q\", \"q\"));\n  ASSERT_TRUE(Overlaps(\"q\", \"q1\"));\n\n  ASSERT_TRUE(! Overlaps(NULL, \"j\"));\n  ASSERT_TRUE(! Overlaps(\"r\", NULL));\n  ASSERT_TRUE(Overlaps(NULL, \"p\"));\n  ASSERT_TRUE(Overlaps(NULL, \"p1\"));\n  ASSERT_TRUE(Overlaps(\"q\", NULL));\n  ASSERT_TRUE(Overlaps(NULL, NULL));\n}\n\n\nTEST(FindFileTest, Multiple) {\n  Add(\"150\", \"200\");\n  Add(\"200\", \"250\");\n  Add(\"300\", \"350\");\n  Add(\"400\", \"450\");\n  ASSERT_EQ(0, Find(\"100\"));\n  ASSERT_EQ(0, Find(\"150\"));\n  ASSERT_EQ(0, Find(\"151\"));\n  ASSERT_EQ(0, Find(\"199\"));\n  ASSERT_EQ(0, Find(\"200\"));\n  ASSERT_EQ(1, Find(\"201\"));\n  ASSERT_EQ(1, Find(\"249\"));\n  ASSERT_EQ(1, Find(\"250\"));\n  ASSERT_EQ(2, Find(\"251\"));\n  ASSERT_EQ(2, Find(\"299\"));\n  ASSERT_EQ(2, Find(\"300\"));\n  ASSERT_EQ(2, Find(\"349\"));\n  ASSERT_EQ(2, Find(\"350\"));\n  ASSERT_EQ(3, Find(\"351\"));\n  ASSERT_EQ(3, Find(\"400\"));\n  ASSERT_EQ(3, Find(\"450\"));\n  ASSERT_EQ(4, Find(\"451\"));\n\n  ASSERT_TRUE(! Overlaps(\"100\", \"149\"));\n  ASSERT_TRUE(! Overlaps(\"251\", \"299\"));\n  ASSERT_TRUE(! Overlaps(\"451\", \"500\"));\n  ASSERT_TRUE(! Overlaps(\"351\", \"399\"));\n\n  ASSERT_TRUE(Overlaps(\"100\", \"150\"));\n  ASSERT_TRUE(Overlaps(\"100\", \"200\"));\n  ASSERT_TRUE(Overlaps(\"100\", \"300\"));\n  ASSERT_TRUE(Overlaps(\"100\", \"400\"));\n  ASSERT_TRUE(Overlaps(\"100\", \"500\"));\n  ASSERT_TRUE(Overlaps(\"375\", \"400\"));\n  ASSERT_TRUE(Overlaps(\"450\", \"450\"));\n  ASSERT_TRUE(Overlaps(\"450\", \"500\"));\n}\n\nTEST(FindFileTest, MultipleNullBoundaries) {\n  Add(\"150\", \"200\");\n  Add(\"200\", \"250\");\n  Add(\"300\", \"350\");\n  Add(\"400\", \"450\");\n  ASSERT_TRUE(! Overlaps(NULL, \"149\"));\n  ASSERT_TRUE(! Overlaps(\"451\", NULL));\n  ASSERT_TRUE(Overlaps(NULL, NULL));\n  ASSERT_TRUE(Overlaps(NULL, \"150\"));\n  ASSERT_TRUE(Overlaps(NULL, \"199\"));\n  ASSERT_TRUE(Overlaps(NULL, \"200\"));\n  ASSERT_TRUE(Overlaps(NULL, \"201\"));\n  ASSERT_TRUE(Overlaps(NULL, \"400\"));\n  ASSERT_TRUE(Overlaps(NULL, \"800\"));\n  ASSERT_TRUE(Overlaps(\"100\", NULL));\n  ASSERT_TRUE(Overlaps(\"200\", NULL));\n  ASSERT_TRUE(Overlaps(\"449\", NULL));\n  ASSERT_TRUE(Overlaps(\"450\", NULL));\n}\n\nTEST(FindFileTest, OverlapSequenceChecks) {\n  Add(\"200\", \"200\", 5000, 3000);\n  ASSERT_TRUE(! Overlaps(\"199\", \"199\"));\n  ASSERT_TRUE(! Overlaps(\"201\", \"300\"));\n  ASSERT_TRUE(Overlaps(\"200\", \"200\"));\n  ASSERT_TRUE(Overlaps(\"190\", \"200\"));\n  ASSERT_TRUE(Overlaps(\"200\", \"210\"));\n}\n\nTEST(FindFileTest, OverlappingFiles) {\n  Add(\"150\", \"600\");\n  Add(\"400\", \"500\");\n  disjoint_sorted_files_ = false;\n  ASSERT_TRUE(! Overlaps(\"100\", \"149\"));\n  ASSERT_TRUE(! Overlaps(\"601\", \"700\"));\n  ASSERT_TRUE(Overlaps(\"100\", \"150\"));\n  ASSERT_TRUE(Overlaps(\"100\", \"200\"));\n  ASSERT_TRUE(Overlaps(\"100\", \"300\"));\n  ASSERT_TRUE(Overlaps(\"100\", \"400\"));\n  ASSERT_TRUE(Overlaps(\"100\", \"500\"));\n  ASSERT_TRUE(Overlaps(\"375\", \"400\"));\n  ASSERT_TRUE(Overlaps(\"450\", \"450\"));\n  ASSERT_TRUE(Overlaps(\"450\", \"500\"));\n  ASSERT_TRUE(Overlaps(\"450\", \"700\"));\n  ASSERT_TRUE(Overlaps(\"600\", \"700\"));\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/db/write_batch.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// WriteBatch::rep_ :=\n//    sequence: fixed64\n//    count: fixed32\n//    data: record[count]\n// record :=\n//    kTypeValue varstring varstring         |\n//    kTypeDeletion varstring\n// varstring :=\n//    len: varint32\n//    data: uint8[len]\n\n#include \"leveldb/write_batch.h\"\n\n#include \"leveldb/db.h\"\n#include \"db/dbformat.h\"\n#include \"db/memtable.h\"\n#include \"db/write_batch_internal.h\"\n#include \"util/coding.h\"\n\nnamespace leveldb {\n\n// WriteBatch header has an 8-byte sequence number followed by a 4-byte count.\nstatic const size_t kHeader = 12;\n\nWriteBatch::WriteBatch() {\n  Clear();\n}\n\nWriteBatch::~WriteBatch() { }\n\nWriteBatch::Handler::~Handler() { }\n\nvoid WriteBatch::Clear() {\n  rep_.clear();\n  rep_.resize(kHeader);\n}\n\nStatus WriteBatch::Iterate(Handler* handler) const {\n  Slice input(rep_);\n  if (input.size() < kHeader) {\n    return Status::Corruption(\"malformed WriteBatch (too small)\");\n  }\n\n  input.remove_prefix(kHeader);\n  Slice key, value;\n  int found = 0;\n  while (!input.empty()) {\n    found++;\n    char tag = input[0];\n    input.remove_prefix(1);\n    switch (tag) {\n      case kTypeValue:\n        if (GetLengthPrefixedSlice(&input, &key) &&\n            GetLengthPrefixedSlice(&input, &value)) {\n          handler->Put(key, value);\n        } else {\n          return Status::Corruption(\"bad WriteBatch Put\");\n        }\n        break;\n      case kTypeDeletion:\n        if (GetLengthPrefixedSlice(&input, &key)) {\n          handler->Delete(key);\n        } else {\n          return Status::Corruption(\"bad WriteBatch Delete\");\n        }\n        break;\n      default:\n        return Status::Corruption(\"unknown WriteBatch tag\");\n    }\n  }\n  if (found != WriteBatchInternal::Count(this)) {\n    return Status::Corruption(\"WriteBatch has wrong count\");\n  } else {\n    return Status::OK();\n  }\n}\n\nint WriteBatchInternal::Count(const WriteBatch* b) {\n  return DecodeFixed32(b->rep_.data() + 8);\n}\n\nvoid WriteBatchInternal::SetCount(WriteBatch* b, int n) {\n  EncodeFixed32(&b->rep_[8], n);\n}\n\nSequenceNumber WriteBatchInternal::Sequence(const WriteBatch* b) {\n  return SequenceNumber(DecodeFixed64(b->rep_.data()));\n}\n\nvoid WriteBatchInternal::SetSequence(WriteBatch* b, SequenceNumber seq) {\n  EncodeFixed64(&b->rep_[0], seq);\n}\n\nvoid WriteBatch::Put(const Slice& key, const Slice& value) {\n  WriteBatchInternal::SetCount(this, WriteBatchInternal::Count(this) + 1);\n  rep_.push_back(static_cast<char>(kTypeValue));\n  PutLengthPrefixedSlice(&rep_, key);\n  PutLengthPrefixedSlice(&rep_, value);\n}\n\nvoid WriteBatch::Delete(const Slice& key) {\n  WriteBatchInternal::SetCount(this, WriteBatchInternal::Count(this) + 1);\n  rep_.push_back(static_cast<char>(kTypeDeletion));\n  PutLengthPrefixedSlice(&rep_, key);\n}\n\nnamespace {\nclass MemTableInserter : public WriteBatch::Handler {\n public:\n  SequenceNumber sequence_;\n  MemTable* mem_;\n\n  virtual void Put(const Slice& key, const Slice& value) {\n    mem_->Add(sequence_, kTypeValue, key, value);\n    sequence_++;\n  }\n  virtual void Delete(const Slice& key) {\n    mem_->Add(sequence_, kTypeDeletion, key, Slice());\n    sequence_++;\n  }\n};\n}  // namespace\n\nStatus WriteBatchInternal::InsertInto(const WriteBatch* b,\n                                      MemTable* memtable) {\n  MemTableInserter inserter;\n  inserter.sequence_ = WriteBatchInternal::Sequence(b);\n  inserter.mem_ = memtable;\n  return b->Iterate(&inserter);\n}\n\nvoid WriteBatchInternal::SetContents(WriteBatch* b, const Slice& contents) {\n  assert(contents.size() >= kHeader);\n  b->rep_.assign(contents.data(), contents.size());\n}\n\nvoid WriteBatchInternal::Append(WriteBatch* dst, const WriteBatch* src) {\n  SetCount(dst, Count(dst) + Count(src));\n  assert(src->rep_.size() >= kHeader);\n  dst->rep_.append(src->rep_.data() + kHeader, src->rep_.size() - kHeader);\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/db/write_batch_internal.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_\n#define STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_\n\n#include \"db/dbformat.h\"\n#include \"leveldb/write_batch.h\"\n\nnamespace leveldb {\n\nclass MemTable;\n\n// WriteBatchInternal provides static methods for manipulating a\n// WriteBatch that we don't want in the public WriteBatch interface.\nclass WriteBatchInternal {\n public:\n  // Return the number of entries in the batch.\n  static int Count(const WriteBatch* batch);\n\n  // Set the count for the number of entries in the batch.\n  static void SetCount(WriteBatch* batch, int n);\n\n  // Return the sequence number for the start of this batch.\n  static SequenceNumber Sequence(const WriteBatch* batch);\n\n  // Store the specified number as the sequence number for the start of\n  // this batch.\n  static void SetSequence(WriteBatch* batch, SequenceNumber seq);\n\n  static Slice Contents(const WriteBatch* batch) {\n    return Slice(batch->rep_);\n  }\n\n  static size_t ByteSize(const WriteBatch* batch) {\n    return batch->rep_.size();\n  }\n\n  static void SetContents(WriteBatch* batch, const Slice& contents);\n\n  static Status InsertInto(const WriteBatch* batch, MemTable* memtable);\n\n  static void Append(WriteBatch* dst, const WriteBatch* src);\n};\n\n}  // namespace leveldb\n\n\n#endif  // STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_\n"
  },
  {
    "path": "src/leveldb/db/write_batch_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/db.h\"\n\n#include \"db/memtable.h\"\n#include \"db/write_batch_internal.h\"\n#include \"leveldb/env.h\"\n#include \"util/logging.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\nstatic std::string PrintContents(WriteBatch* b) {\n  InternalKeyComparator cmp(BytewiseComparator());\n  MemTable* mem = new MemTable(cmp);\n  mem->Ref();\n  std::string state;\n  Status s = WriteBatchInternal::InsertInto(b, mem);\n  int count = 0;\n  Iterator* iter = mem->NewIterator();\n  for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {\n    ParsedInternalKey ikey;\n    ASSERT_TRUE(ParseInternalKey(iter->key(), &ikey));\n    switch (ikey.type) {\n      case kTypeValue:\n        state.append(\"Put(\");\n        state.append(ikey.user_key.ToString());\n        state.append(\", \");\n        state.append(iter->value().ToString());\n        state.append(\")\");\n        count++;\n        break;\n      case kTypeDeletion:\n        state.append(\"Delete(\");\n        state.append(ikey.user_key.ToString());\n        state.append(\")\");\n        count++;\n        break;\n    }\n    state.append(\"@\");\n    state.append(NumberToString(ikey.sequence));\n  }\n  delete iter;\n  if (!s.ok()) {\n    state.append(\"ParseError()\");\n  } else if (count != WriteBatchInternal::Count(b)) {\n    state.append(\"CountMismatch()\");\n  }\n  mem->Unref();\n  return state;\n}\n\nclass WriteBatchTest { };\n\nTEST(WriteBatchTest, Empty) {\n  WriteBatch batch;\n  ASSERT_EQ(\"\", PrintContents(&batch));\n  ASSERT_EQ(0, WriteBatchInternal::Count(&batch));\n}\n\nTEST(WriteBatchTest, Multiple) {\n  WriteBatch batch;\n  batch.Put(Slice(\"foo\"), Slice(\"bar\"));\n  batch.Delete(Slice(\"box\"));\n  batch.Put(Slice(\"baz\"), Slice(\"boo\"));\n  WriteBatchInternal::SetSequence(&batch, 100);\n  ASSERT_EQ(100, WriteBatchInternal::Sequence(&batch));\n  ASSERT_EQ(3, WriteBatchInternal::Count(&batch));\n  ASSERT_EQ(\"Put(baz, boo)@102\"\n            \"Delete(box)@101\"\n            \"Put(foo, bar)@100\",\n            PrintContents(&batch));\n}\n\nTEST(WriteBatchTest, Corruption) {\n  WriteBatch batch;\n  batch.Put(Slice(\"foo\"), Slice(\"bar\"));\n  batch.Delete(Slice(\"box\"));\n  WriteBatchInternal::SetSequence(&batch, 200);\n  Slice contents = WriteBatchInternal::Contents(&batch);\n  WriteBatchInternal::SetContents(&batch,\n                                  Slice(contents.data(),contents.size()-1));\n  ASSERT_EQ(\"Put(foo, bar)@200\"\n            \"ParseError()\",\n            PrintContents(&batch));\n}\n\nTEST(WriteBatchTest, Append) {\n  WriteBatch b1, b2;\n  WriteBatchInternal::SetSequence(&b1, 200);\n  WriteBatchInternal::SetSequence(&b2, 300);\n  WriteBatchInternal::Append(&b1, &b2);\n  ASSERT_EQ(\"\",\n            PrintContents(&b1));\n  b2.Put(\"a\", \"va\");\n  WriteBatchInternal::Append(&b1, &b2);\n  ASSERT_EQ(\"Put(a, va)@200\",\n            PrintContents(&b1));\n  b2.Clear();\n  b2.Put(\"b\", \"vb\");\n  WriteBatchInternal::Append(&b1, &b2);\n  ASSERT_EQ(\"Put(a, va)@200\"\n            \"Put(b, vb)@201\",\n            PrintContents(&b1));\n  b2.Delete(\"foo\");\n  WriteBatchInternal::Append(&b1, &b2);\n  ASSERT_EQ(\"Put(a, va)@200\"\n            \"Put(b, vb)@202\"\n            \"Put(b, vb)@201\"\n            \"Delete(foo)@203\",\n            PrintContents(&b1));\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/doc/bench/db_bench_sqlite3.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sqlite3.h>\n#include \"util/histogram.h\"\n#include \"util/random.h\"\n#include \"util/testutil.h\"\n\n// Comma-separated list of operations to run in the specified order\n//   Actual benchmarks:\n//\n//   fillseq       -- write N values in sequential key order in async mode\n//   fillseqsync   -- write N/100 values in sequential key order in sync mode\n//   fillseqbatch  -- batch write N values in sequential key order in async mode\n//   fillrandom    -- write N values in random key order in async mode\n//   fillrandsync  -- write N/100 values in random key order in sync mode\n//   fillrandbatch -- batch write N values in sequential key order in async mode\n//   overwrite     -- overwrite N values in random key order in async mode\n//   fillrand100K  -- write N/1000 100K values in random order in async mode\n//   fillseq100K   -- write N/1000 100K values in sequential order in async mode\n//   readseq       -- read N times sequentially\n//   readrandom    -- read N times in random order\n//   readrand100K  -- read N/1000 100K values in sequential order in async mode\nstatic const char* FLAGS_benchmarks =\n    \"fillseq,\"\n    \"fillseqsync,\"\n    \"fillseqbatch,\"\n    \"fillrandom,\"\n    \"fillrandsync,\"\n    \"fillrandbatch,\"\n    \"overwrite,\"\n    \"overwritebatch,\"\n    \"readrandom,\"\n    \"readseq,\"\n    \"fillrand100K,\"\n    \"fillseq100K,\"\n    \"readseq,\"\n    \"readrand100K,\"\n    ;\n\n// Number of key/values to place in database\nstatic int FLAGS_num = 1000000;\n\n// Number of read operations to do.  If negative, do FLAGS_num reads.\nstatic int FLAGS_reads = -1;\n\n// Size of each value\nstatic int FLAGS_value_size = 100;\n\n// Print histogram of operation timings\nstatic bool FLAGS_histogram = false;\n\n// Arrange to generate values that shrink to this fraction of\n// their original size after compression\nstatic double FLAGS_compression_ratio = 0.5;\n\n// Page size. Default 1 KB.\nstatic int FLAGS_page_size = 1024;\n\n// Number of pages.\n// Default cache size = FLAGS_page_size * FLAGS_num_pages = 4 MB.\nstatic int FLAGS_num_pages = 4096;\n\n// If true, do not destroy the existing database.  If you set this\n// flag and also specify a benchmark that wants a fresh database, that\n// benchmark will fail.\nstatic bool FLAGS_use_existing_db = false;\n\n// If true, we allow batch writes to occur\nstatic bool FLAGS_transaction = true;\n\n// If true, we enable Write-Ahead Logging\nstatic bool FLAGS_WAL_enabled = true;\n\n// Use the db with the following name.\nstatic const char* FLAGS_db = NULL;\n\ninline\nstatic void ExecErrorCheck(int status, char *err_msg) {\n  if (status != SQLITE_OK) {\n    fprintf(stderr, \"SQL error: %s\\n\", err_msg);\n    sqlite3_free(err_msg);\n    exit(1);\n  }\n}\n\ninline\nstatic void StepErrorCheck(int status) {\n  if (status != SQLITE_DONE) {\n    fprintf(stderr, \"SQL step error: status = %d\\n\", status);\n    exit(1);\n  }\n}\n\ninline\nstatic void ErrorCheck(int status) {\n  if (status != SQLITE_OK) {\n    fprintf(stderr, \"sqlite3 error: status = %d\\n\", status);\n    exit(1);\n  }\n}\n\ninline\nstatic void WalCheckpoint(sqlite3* db_) {\n  // Flush all writes to disk\n  if (FLAGS_WAL_enabled) {\n    sqlite3_wal_checkpoint_v2(db_, NULL, SQLITE_CHECKPOINT_FULL, NULL, NULL);\n  }\n}\n\nnamespace leveldb {\n\n// Helper for quickly generating random data.\nnamespace {\nclass RandomGenerator {\n private:\n  std::string data_;\n  int pos_;\n\n public:\n  RandomGenerator() {\n    // We use a limited amount of data over and over again and ensure\n    // that it is larger than the compression window (32KB), and also\n    // large enough to serve all typical value sizes we want to write.\n    Random rnd(301);\n    std::string piece;\n    while (data_.size() < 1048576) {\n      // Add a short fragment that is as compressible as specified\n      // by FLAGS_compression_ratio.\n      test::CompressibleString(&rnd, FLAGS_compression_ratio, 100, &piece);\n      data_.append(piece);\n    }\n    pos_ = 0;\n  }\n\n  Slice Generate(int len) {\n    if (pos_ + len > data_.size()) {\n      pos_ = 0;\n      assert(len < data_.size());\n    }\n    pos_ += len;\n    return Slice(data_.data() + pos_ - len, len);\n  }\n};\n\nstatic Slice TrimSpace(Slice s) {\n  int start = 0;\n  while (start < s.size() && isspace(s[start])) {\n    start++;\n  }\n  int limit = s.size();\n  while (limit > start && isspace(s[limit-1])) {\n    limit--;\n  }\n  return Slice(s.data() + start, limit - start);\n}\n\n}  // namespace\n\nclass Benchmark {\n private:\n  sqlite3* db_;\n  int db_num_;\n  int num_;\n  int reads_;\n  double start_;\n  double last_op_finish_;\n  int64_t bytes_;\n  std::string message_;\n  Histogram hist_;\n  RandomGenerator gen_;\n  Random rand_;\n\n  // State kept for progress messages\n  int done_;\n  int next_report_;     // When to report next\n\n  void PrintHeader() {\n    const int kKeySize = 16;\n    PrintEnvironment();\n    fprintf(stdout, \"Keys:       %d bytes each\\n\", kKeySize);\n    fprintf(stdout, \"Values:     %d bytes each\\n\", FLAGS_value_size);\n    fprintf(stdout, \"Entries:    %d\\n\", num_);\n    fprintf(stdout, \"RawSize:    %.1f MB (estimated)\\n\",\n            ((static_cast<int64_t>(kKeySize + FLAGS_value_size) * num_)\n             / 1048576.0));\n    PrintWarnings();\n    fprintf(stdout, \"------------------------------------------------\\n\");\n  }\n\n  void PrintWarnings() {\n#if defined(__GNUC__) && !defined(__OPTIMIZE__)\n    fprintf(stdout,\n            \"WARNING: Optimization is disabled: benchmarks unnecessarily slow\\n\"\n            );\n#endif\n#ifndef NDEBUG\n    fprintf(stdout,\n            \"WARNING: Assertions are enabled; benchmarks unnecessarily slow\\n\");\n#endif\n  }\n\n  void PrintEnvironment() {\n    fprintf(stderr, \"SQLite:     version %s\\n\", SQLITE_VERSION);\n\n#if defined(__linux)\n    time_t now = time(NULL);\n    fprintf(stderr, \"Date:       %s\", ctime(&now));  // ctime() adds newline\n\n    FILE* cpuinfo = fopen(\"/proc/cpuinfo\", \"r\");\n    if (cpuinfo != NULL) {\n      char line[1000];\n      int num_cpus = 0;\n      std::string cpu_type;\n      std::string cache_size;\n      while (fgets(line, sizeof(line), cpuinfo) != NULL) {\n        const char* sep = strchr(line, ':');\n        if (sep == NULL) {\n          continue;\n        }\n        Slice key = TrimSpace(Slice(line, sep - 1 - line));\n        Slice val = TrimSpace(Slice(sep + 1));\n        if (key == \"model name\") {\n          ++num_cpus;\n          cpu_type = val.ToString();\n        } else if (key == \"cache size\") {\n          cache_size = val.ToString();\n        }\n      }\n      fclose(cpuinfo);\n      fprintf(stderr, \"CPU:        %d * %s\\n\", num_cpus, cpu_type.c_str());\n      fprintf(stderr, \"CPUCache:   %s\\n\", cache_size.c_str());\n    }\n#endif\n  }\n\n  void Start() {\n    start_ = Env::Default()->NowMicros() * 1e-6;\n    bytes_ = 0;\n    message_.clear();\n    last_op_finish_ = start_;\n    hist_.Clear();\n    done_ = 0;\n    next_report_ = 100;\n  }\n\n  void FinishedSingleOp() {\n    if (FLAGS_histogram) {\n      double now = Env::Default()->NowMicros() * 1e-6;\n      double micros = (now - last_op_finish_) * 1e6;\n      hist_.Add(micros);\n      if (micros > 20000) {\n        fprintf(stderr, \"long op: %.1f micros%30s\\r\", micros, \"\");\n        fflush(stderr);\n      }\n      last_op_finish_ = now;\n    }\n\n    done_++;\n    if (done_ >= next_report_) {\n      if      (next_report_ < 1000)   next_report_ += 100;\n      else if (next_report_ < 5000)   next_report_ += 500;\n      else if (next_report_ < 10000)  next_report_ += 1000;\n      else if (next_report_ < 50000)  next_report_ += 5000;\n      else if (next_report_ < 100000) next_report_ += 10000;\n      else if (next_report_ < 500000) next_report_ += 50000;\n      else                            next_report_ += 100000;\n      fprintf(stderr, \"... finished %d ops%30s\\r\", done_, \"\");\n      fflush(stderr);\n    }\n  }\n\n  void Stop(const Slice& name) {\n    double finish = Env::Default()->NowMicros() * 1e-6;\n\n    // Pretend at least one op was done in case we are running a benchmark\n    // that does not call FinishedSingleOp().\n    if (done_ < 1) done_ = 1;\n\n    if (bytes_ > 0) {\n      char rate[100];\n      snprintf(rate, sizeof(rate), \"%6.1f MB/s\",\n               (bytes_ / 1048576.0) / (finish - start_));\n      if (!message_.empty()) {\n        message_  = std::string(rate) + \" \" + message_;\n      } else {\n        message_ = rate;\n      }\n    }\n\n    fprintf(stdout, \"%-12s : %11.3f micros/op;%s%s\\n\",\n            name.ToString().c_str(),\n            (finish - start_) * 1e6 / done_,\n            (message_.empty() ? \"\" : \" \"),\n            message_.c_str());\n    if (FLAGS_histogram) {\n      fprintf(stdout, \"Microseconds per op:\\n%s\\n\", hist_.ToString().c_str());\n    }\n    fflush(stdout);\n  }\n\n public:\n  enum Order {\n    SEQUENTIAL,\n    RANDOM\n  };\n  enum DBState {\n    FRESH,\n    EXISTING\n  };\n\n  Benchmark()\n  : db_(NULL),\n    db_num_(0),\n    num_(FLAGS_num),\n    reads_(FLAGS_reads < 0 ? FLAGS_num : FLAGS_reads),\n    bytes_(0),\n    rand_(301) {\n    std::vector<std::string> files;\n    std::string test_dir;\n    Env::Default()->GetTestDirectory(&test_dir);\n    Env::Default()->GetChildren(test_dir, &files);\n    if (!FLAGS_use_existing_db) {\n      for (int i = 0; i < files.size(); i++) {\n        if (Slice(files[i]).starts_with(\"dbbench_sqlite3\")) {\n          std::string file_name(test_dir);\n          file_name += \"/\";\n          file_name += files[i];\n          Env::Default()->DeleteFile(file_name.c_str());\n        }\n      }\n    }\n  }\n\n  ~Benchmark() {\n    int status = sqlite3_close(db_);\n    ErrorCheck(status);\n  }\n\n  void Run() {\n    PrintHeader();\n    Open();\n\n    const char* benchmarks = FLAGS_benchmarks;\n    while (benchmarks != NULL) {\n      const char* sep = strchr(benchmarks, ',');\n      Slice name;\n      if (sep == NULL) {\n        name = benchmarks;\n        benchmarks = NULL;\n      } else {\n        name = Slice(benchmarks, sep - benchmarks);\n        benchmarks = sep + 1;\n      }\n\n      bytes_ = 0;\n      Start();\n\n      bool known = true;\n      bool write_sync = false;\n      if (name == Slice(\"fillseq\")) {\n        Write(write_sync, SEQUENTIAL, FRESH, num_, FLAGS_value_size, 1);\n        WalCheckpoint(db_);\n      } else if (name == Slice(\"fillseqbatch\")) {\n        Write(write_sync, SEQUENTIAL, FRESH, num_, FLAGS_value_size, 1000);\n        WalCheckpoint(db_);\n      } else if (name == Slice(\"fillrandom\")) {\n        Write(write_sync, RANDOM, FRESH, num_, FLAGS_value_size, 1);\n        WalCheckpoint(db_);\n      } else if (name == Slice(\"fillrandbatch\")) {\n        Write(write_sync, RANDOM, FRESH, num_, FLAGS_value_size, 1000);\n        WalCheckpoint(db_);\n      } else if (name == Slice(\"overwrite\")) {\n        Write(write_sync, RANDOM, EXISTING, num_, FLAGS_value_size, 1);\n        WalCheckpoint(db_);\n      } else if (name == Slice(\"overwritebatch\")) {\n        Write(write_sync, RANDOM, EXISTING, num_, FLAGS_value_size, 1000);\n        WalCheckpoint(db_);\n      } else if (name == Slice(\"fillrandsync\")) {\n        write_sync = true;\n        Write(write_sync, RANDOM, FRESH, num_ / 100, FLAGS_value_size, 1);\n        WalCheckpoint(db_);\n      } else if (name == Slice(\"fillseqsync\")) {\n        write_sync = true;\n        Write(write_sync, SEQUENTIAL, FRESH, num_ / 100, FLAGS_value_size, 1);\n        WalCheckpoint(db_);\n      } else if (name == Slice(\"fillrand100K\")) {\n        Write(write_sync, RANDOM, FRESH, num_ / 1000, 100 * 1000, 1);\n        WalCheckpoint(db_);\n      } else if (name == Slice(\"fillseq100K\")) {\n        Write(write_sync, SEQUENTIAL, FRESH, num_ / 1000, 100 * 1000, 1);\n        WalCheckpoint(db_);\n      } else if (name == Slice(\"readseq\")) {\n        ReadSequential();\n      } else if (name == Slice(\"readrandom\")) {\n        Read(RANDOM, 1);\n      } else if (name == Slice(\"readrand100K\")) {\n        int n = reads_;\n        reads_ /= 1000;\n        Read(RANDOM, 1);\n        reads_ = n;\n      } else {\n        known = false;\n        if (name != Slice()) {  // No error message for empty name\n          fprintf(stderr, \"unknown benchmark '%s'\\n\", name.ToString().c_str());\n        }\n      }\n      if (known) {\n        Stop(name);\n      }\n    }\n  }\n\n  void Open() {\n    assert(db_ == NULL);\n\n    int status;\n    char file_name[100];\n    char* err_msg = NULL;\n    db_num_++;\n\n    // Open database\n    std::string tmp_dir;\n    Env::Default()->GetTestDirectory(&tmp_dir);\n    snprintf(file_name, sizeof(file_name),\n             \"%s/dbbench_sqlite3-%d.db\",\n             tmp_dir.c_str(),\n             db_num_);\n    status = sqlite3_open(file_name, &db_);\n    if (status) {\n      fprintf(stderr, \"open error: %s\\n\", sqlite3_errmsg(db_));\n      exit(1);\n    }\n\n    // Change SQLite cache size\n    char cache_size[100];\n    snprintf(cache_size, sizeof(cache_size), \"PRAGMA cache_size = %d\",\n             FLAGS_num_pages);\n    status = sqlite3_exec(db_, cache_size, NULL, NULL, &err_msg);\n    ExecErrorCheck(status, err_msg);\n\n    // FLAGS_page_size is defaulted to 1024\n    if (FLAGS_page_size != 1024) {\n      char page_size[100];\n      snprintf(page_size, sizeof(page_size), \"PRAGMA page_size = %d\",\n               FLAGS_page_size);\n      status = sqlite3_exec(db_, page_size, NULL, NULL, &err_msg);\n      ExecErrorCheck(status, err_msg);\n    }\n\n    // Change journal mode to WAL if WAL enabled flag is on\n    if (FLAGS_WAL_enabled) {\n      std::string WAL_stmt = \"PRAGMA journal_mode = WAL\";\n\n      // LevelDB's default cache size is a combined 4 MB\n      std::string WAL_checkpoint = \"PRAGMA wal_autocheckpoint = 4096\";\n      status = sqlite3_exec(db_, WAL_stmt.c_str(), NULL, NULL, &err_msg);\n      ExecErrorCheck(status, err_msg);\n      status = sqlite3_exec(db_, WAL_checkpoint.c_str(), NULL, NULL, &err_msg);\n      ExecErrorCheck(status, err_msg);\n    }\n\n    // Change locking mode to exclusive and create tables/index for database\n    std::string locking_stmt = \"PRAGMA locking_mode = EXCLUSIVE\";\n    std::string create_stmt =\n          \"CREATE TABLE test (key blob, value blob, PRIMARY KEY(key))\";\n    std::string stmt_array[] = { locking_stmt, create_stmt };\n    int stmt_array_length = sizeof(stmt_array) / sizeof(std::string);\n    for (int i = 0; i < stmt_array_length; i++) {\n      status = sqlite3_exec(db_, stmt_array[i].c_str(), NULL, NULL, &err_msg);\n      ExecErrorCheck(status, err_msg);\n    }\n  }\n\n  void Write(bool write_sync, Order order, DBState state,\n             int num_entries, int value_size, int entries_per_batch) {\n    // Create new database if state == FRESH\n    if (state == FRESH) {\n      if (FLAGS_use_existing_db) {\n        message_ = \"skipping (--use_existing_db is true)\";\n        return;\n      }\n      sqlite3_close(db_);\n      db_ = NULL;\n      Open();\n      Start();\n    }\n\n    if (num_entries != num_) {\n      char msg[100];\n      snprintf(msg, sizeof(msg), \"(%d ops)\", num_entries);\n      message_ = msg;\n    }\n\n    char* err_msg = NULL;\n    int status;\n\n    sqlite3_stmt *replace_stmt, *begin_trans_stmt, *end_trans_stmt;\n    std::string replace_str = \"REPLACE INTO test (key, value) VALUES (?, ?)\";\n    std::string begin_trans_str = \"BEGIN TRANSACTION;\";\n    std::string end_trans_str = \"END TRANSACTION;\";\n\n    // Check for synchronous flag in options\n    std::string sync_stmt = (write_sync) ? \"PRAGMA synchronous = FULL\" :\n                                           \"PRAGMA synchronous = OFF\";\n    status = sqlite3_exec(db_, sync_stmt.c_str(), NULL, NULL, &err_msg);\n    ExecErrorCheck(status, err_msg);\n\n    // Preparing sqlite3 statements\n    status = sqlite3_prepare_v2(db_, replace_str.c_str(), -1,\n                                &replace_stmt, NULL);\n    ErrorCheck(status);\n    status = sqlite3_prepare_v2(db_, begin_trans_str.c_str(), -1,\n                                &begin_trans_stmt, NULL);\n    ErrorCheck(status);\n    status = sqlite3_prepare_v2(db_, end_trans_str.c_str(), -1,\n                                &end_trans_stmt, NULL);\n    ErrorCheck(status);\n\n    bool transaction = (entries_per_batch > 1);\n    for (int i = 0; i < num_entries; i += entries_per_batch) {\n      // Begin write transaction\n      if (FLAGS_transaction && transaction) {\n        status = sqlite3_step(begin_trans_stmt);\n        StepErrorCheck(status);\n        status = sqlite3_reset(begin_trans_stmt);\n        ErrorCheck(status);\n      }\n\n      // Create and execute SQL statements\n      for (int j = 0; j < entries_per_batch; j++) {\n        const char* value = gen_.Generate(value_size).data();\n\n        // Create values for key-value pair\n        const int k = (order == SEQUENTIAL) ? i + j :\n                      (rand_.Next() % num_entries);\n        char key[100];\n        snprintf(key, sizeof(key), \"%016d\", k);\n\n        // Bind KV values into replace_stmt\n        status = sqlite3_bind_blob(replace_stmt, 1, key, 16, SQLITE_STATIC);\n        ErrorCheck(status);\n        status = sqlite3_bind_blob(replace_stmt, 2, value,\n                                   value_size, SQLITE_STATIC);\n        ErrorCheck(status);\n\n        // Execute replace_stmt\n        bytes_ += value_size + strlen(key);\n        status = sqlite3_step(replace_stmt);\n        StepErrorCheck(status);\n\n        // Reset SQLite statement for another use\n        status = sqlite3_clear_bindings(replace_stmt);\n        ErrorCheck(status);\n        status = sqlite3_reset(replace_stmt);\n        ErrorCheck(status);\n\n        FinishedSingleOp();\n      }\n\n      // End write transaction\n      if (FLAGS_transaction && transaction) {\n        status = sqlite3_step(end_trans_stmt);\n        StepErrorCheck(status);\n        status = sqlite3_reset(end_trans_stmt);\n        ErrorCheck(status);\n      }\n    }\n\n    status = sqlite3_finalize(replace_stmt);\n    ErrorCheck(status);\n    status = sqlite3_finalize(begin_trans_stmt);\n    ErrorCheck(status);\n    status = sqlite3_finalize(end_trans_stmt);\n    ErrorCheck(status);\n  }\n\n  void Read(Order order, int entries_per_batch) {\n    int status;\n    sqlite3_stmt *read_stmt, *begin_trans_stmt, *end_trans_stmt;\n\n    std::string read_str = \"SELECT * FROM test WHERE key = ?\";\n    std::string begin_trans_str = \"BEGIN TRANSACTION;\";\n    std::string end_trans_str = \"END TRANSACTION;\";\n\n    // Preparing sqlite3 statements\n    status = sqlite3_prepare_v2(db_, begin_trans_str.c_str(), -1,\n                                &begin_trans_stmt, NULL);\n    ErrorCheck(status);\n    status = sqlite3_prepare_v2(db_, end_trans_str.c_str(), -1,\n                                &end_trans_stmt, NULL);\n    ErrorCheck(status);\n    status = sqlite3_prepare_v2(db_, read_str.c_str(), -1, &read_stmt, NULL);\n    ErrorCheck(status);\n\n    bool transaction = (entries_per_batch > 1);\n    for (int i = 0; i < reads_; i += entries_per_batch) {\n      // Begin read transaction\n      if (FLAGS_transaction && transaction) {\n        status = sqlite3_step(begin_trans_stmt);\n        StepErrorCheck(status);\n        status = sqlite3_reset(begin_trans_stmt);\n        ErrorCheck(status);\n      }\n\n      // Create and execute SQL statements\n      for (int j = 0; j < entries_per_batch; j++) {\n        // Create key value\n        char key[100];\n        int k = (order == SEQUENTIAL) ? i + j : (rand_.Next() % reads_);\n        snprintf(key, sizeof(key), \"%016d\", k);\n\n        // Bind key value into read_stmt\n        status = sqlite3_bind_blob(read_stmt, 1, key, 16, SQLITE_STATIC);\n        ErrorCheck(status);\n\n        // Execute read statement\n        while ((status = sqlite3_step(read_stmt)) == SQLITE_ROW) {}\n        StepErrorCheck(status);\n\n        // Reset SQLite statement for another use\n        status = sqlite3_clear_bindings(read_stmt);\n        ErrorCheck(status);\n        status = sqlite3_reset(read_stmt);\n        ErrorCheck(status);\n        FinishedSingleOp();\n      }\n\n      // End read transaction\n      if (FLAGS_transaction && transaction) {\n        status = sqlite3_step(end_trans_stmt);\n        StepErrorCheck(status);\n        status = sqlite3_reset(end_trans_stmt);\n        ErrorCheck(status);\n      }\n    }\n\n    status = sqlite3_finalize(read_stmt);\n    ErrorCheck(status);\n    status = sqlite3_finalize(begin_trans_stmt);\n    ErrorCheck(status);\n    status = sqlite3_finalize(end_trans_stmt);\n    ErrorCheck(status);\n  }\n\n  void ReadSequential() {\n    int status;\n    sqlite3_stmt *pStmt;\n    std::string read_str = \"SELECT * FROM test ORDER BY key\";\n\n    status = sqlite3_prepare_v2(db_, read_str.c_str(), -1, &pStmt, NULL);\n    ErrorCheck(status);\n    for (int i = 0; i < reads_ && SQLITE_ROW == sqlite3_step(pStmt); i++) {\n      bytes_ += sqlite3_column_bytes(pStmt, 1) + sqlite3_column_bytes(pStmt, 2);\n      FinishedSingleOp();\n    }\n\n    status = sqlite3_finalize(pStmt);\n    ErrorCheck(status);\n  }\n\n};\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  std::string default_db_path;\n  for (int i = 1; i < argc; i++) {\n    double d;\n    int n;\n    char junk;\n    if (leveldb::Slice(argv[i]).starts_with(\"--benchmarks=\")) {\n      FLAGS_benchmarks = argv[i] + strlen(\"--benchmarks=\");\n    } else if (sscanf(argv[i], \"--histogram=%d%c\", &n, &junk) == 1 &&\n               (n == 0 || n == 1)) {\n      FLAGS_histogram = n;\n    } else if (sscanf(argv[i], \"--compression_ratio=%lf%c\", &d, &junk) == 1) {\n      FLAGS_compression_ratio = d;\n    } else if (sscanf(argv[i], \"--use_existing_db=%d%c\", &n, &junk) == 1 &&\n               (n == 0 || n == 1)) {\n      FLAGS_use_existing_db = n;\n    } else if (sscanf(argv[i], \"--num=%d%c\", &n, &junk) == 1) {\n      FLAGS_num = n;\n    } else if (sscanf(argv[i], \"--reads=%d%c\", &n, &junk) == 1) {\n      FLAGS_reads = n;\n    } else if (sscanf(argv[i], \"--value_size=%d%c\", &n, &junk) == 1) {\n      FLAGS_value_size = n;\n    } else if (leveldb::Slice(argv[i]) == leveldb::Slice(\"--no_transaction\")) {\n      FLAGS_transaction = false;\n    } else if (sscanf(argv[i], \"--page_size=%d%c\", &n, &junk) == 1) {\n      FLAGS_page_size = n;\n    } else if (sscanf(argv[i], \"--num_pages=%d%c\", &n, &junk) == 1) {\n      FLAGS_num_pages = n;\n    } else if (sscanf(argv[i], \"--WAL_enabled=%d%c\", &n, &junk) == 1 &&\n               (n == 0 || n == 1)) {\n      FLAGS_WAL_enabled = n;\n    } else if (strncmp(argv[i], \"--db=\", 5) == 0) {\n      FLAGS_db = argv[i] + 5;\n    } else {\n      fprintf(stderr, \"Invalid flag '%s'\\n\", argv[i]);\n      exit(1);\n    }\n  }\n\n  // Choose a location for the test database if none given with --db=<path>\n  if (FLAGS_db == NULL) {\n      leveldb::Env::Default()->GetTestDirectory(&default_db_path);\n      default_db_path += \"/dbbench\";\n      FLAGS_db = default_db_path.c_str();\n  }\n\n  leveldb::Benchmark benchmark;\n  benchmark.Run();\n  return 0;\n}\n"
  },
  {
    "path": "src/leveldb/doc/bench/db_bench_tree_db.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <kcpolydb.h>\n#include \"util/histogram.h\"\n#include \"util/random.h\"\n#include \"util/testutil.h\"\n\n// Comma-separated list of operations to run in the specified order\n//   Actual benchmarks:\n//\n//   fillseq       -- write N values in sequential key order in async mode\n//   fillrandom    -- write N values in random key order in async mode\n//   overwrite     -- overwrite N values in random key order in async mode\n//   fillseqsync   -- write N/100 values in sequential key order in sync mode\n//   fillrandsync  -- write N/100 values in random key order in sync mode\n//   fillrand100K  -- write N/1000 100K values in random order in async mode\n//   fillseq100K   -- write N/1000 100K values in seq order in async mode\n//   readseq       -- read N times sequentially\n//   readseq100K   -- read N/1000 100K values in sequential order in async mode\n//   readrand100K  -- read N/1000 100K values in sequential order in async mode\n//   readrandom    -- read N times in random order\nstatic const char* FLAGS_benchmarks =\n    \"fillseq,\"\n    \"fillseqsync,\"\n    \"fillrandsync,\"\n    \"fillrandom,\"\n    \"overwrite,\"\n    \"readrandom,\"\n    \"readseq,\"\n    \"fillrand100K,\"\n    \"fillseq100K,\"\n    \"readseq100K,\"\n    \"readrand100K,\"\n    ;\n\n// Number of key/values to place in database\nstatic int FLAGS_num = 1000000;\n\n// Number of read operations to do.  If negative, do FLAGS_num reads.\nstatic int FLAGS_reads = -1;\n\n// Size of each value\nstatic int FLAGS_value_size = 100;\n\n// Arrange to generate values that shrink to this fraction of\n// their original size after compression\nstatic double FLAGS_compression_ratio = 0.5;\n\n// Print histogram of operation timings\nstatic bool FLAGS_histogram = false;\n\n// Cache size. Default 4 MB\nstatic int FLAGS_cache_size = 4194304;\n\n// Page size. Default 1 KB\nstatic int FLAGS_page_size = 1024;\n\n// If true, do not destroy the existing database.  If you set this\n// flag and also specify a benchmark that wants a fresh database, that\n// benchmark will fail.\nstatic bool FLAGS_use_existing_db = false;\n\n// Compression flag. If true, compression is on. If false, compression\n// is off.\nstatic bool FLAGS_compression = true;\n\n// Use the db with the following name.\nstatic const char* FLAGS_db = NULL;\n\ninline\nstatic void DBSynchronize(kyotocabinet::TreeDB* db_)\n{\n  // Synchronize will flush writes to disk\n  if (!db_->synchronize()) {\n    fprintf(stderr, \"synchronize error: %s\\n\", db_->error().name());\n  }\n}\n\nnamespace leveldb {\n\n// Helper for quickly generating random data.\nnamespace {\nclass RandomGenerator {\n private:\n  std::string data_;\n  int pos_;\n\n public:\n  RandomGenerator() {\n    // We use a limited amount of data over and over again and ensure\n    // that it is larger than the compression window (32KB), and also\n    // large enough to serve all typical value sizes we want to write.\n    Random rnd(301);\n    std::string piece;\n    while (data_.size() < 1048576) {\n      // Add a short fragment that is as compressible as specified\n      // by FLAGS_compression_ratio.\n      test::CompressibleString(&rnd, FLAGS_compression_ratio, 100, &piece);\n      data_.append(piece);\n    }\n    pos_ = 0;\n  }\n\n  Slice Generate(int len) {\n    if (pos_ + len > data_.size()) {\n      pos_ = 0;\n      assert(len < data_.size());\n    }\n    pos_ += len;\n    return Slice(data_.data() + pos_ - len, len);\n  }\n};\n\nstatic Slice TrimSpace(Slice s) {\n  int start = 0;\n  while (start < s.size() && isspace(s[start])) {\n    start++;\n  }\n  int limit = s.size();\n  while (limit > start && isspace(s[limit-1])) {\n    limit--;\n  }\n  return Slice(s.data() + start, limit - start);\n}\n\n}  // namespace\n\nclass Benchmark {\n private:\n  kyotocabinet::TreeDB* db_;\n  int db_num_;\n  int num_;\n  int reads_;\n  double start_;\n  double last_op_finish_;\n  int64_t bytes_;\n  std::string message_;\n  Histogram hist_;\n  RandomGenerator gen_;\n  Random rand_;\n  kyotocabinet::LZOCompressor<kyotocabinet::LZO::RAW> comp_;\n\n  // State kept for progress messages\n  int done_;\n  int next_report_;     // When to report next\n\n  void PrintHeader() {\n    const int kKeySize = 16;\n    PrintEnvironment();\n    fprintf(stdout, \"Keys:       %d bytes each\\n\", kKeySize);\n    fprintf(stdout, \"Values:     %d bytes each (%d bytes after compression)\\n\",\n            FLAGS_value_size,\n            static_cast<int>(FLAGS_value_size * FLAGS_compression_ratio + 0.5));\n    fprintf(stdout, \"Entries:    %d\\n\", num_);\n    fprintf(stdout, \"RawSize:    %.1f MB (estimated)\\n\",\n            ((static_cast<int64_t>(kKeySize + FLAGS_value_size) * num_)\n             / 1048576.0));\n    fprintf(stdout, \"FileSize:   %.1f MB (estimated)\\n\",\n            (((kKeySize + FLAGS_value_size * FLAGS_compression_ratio) * num_)\n             / 1048576.0));\n    PrintWarnings();\n    fprintf(stdout, \"------------------------------------------------\\n\");\n  }\n\n  void PrintWarnings() {\n#if defined(__GNUC__) && !defined(__OPTIMIZE__)\n    fprintf(stdout,\n            \"WARNING: Optimization is disabled: benchmarks unnecessarily slow\\n\"\n            );\n#endif\n#ifndef NDEBUG\n    fprintf(stdout,\n            \"WARNING: Assertions are enabled; benchmarks unnecessarily slow\\n\");\n#endif\n  }\n\n  void PrintEnvironment() {\n    fprintf(stderr, \"Kyoto Cabinet:    version %s, lib ver %d, lib rev %d\\n\",\n            kyotocabinet::VERSION, kyotocabinet::LIBVER, kyotocabinet::LIBREV);\n\n#if defined(__linux)\n    time_t now = time(NULL);\n    fprintf(stderr, \"Date:           %s\", ctime(&now));  // ctime() adds newline\n\n    FILE* cpuinfo = fopen(\"/proc/cpuinfo\", \"r\");\n    if (cpuinfo != NULL) {\n      char line[1000];\n      int num_cpus = 0;\n      std::string cpu_type;\n      std::string cache_size;\n      while (fgets(line, sizeof(line), cpuinfo) != NULL) {\n        const char* sep = strchr(line, ':');\n        if (sep == NULL) {\n          continue;\n        }\n        Slice key = TrimSpace(Slice(line, sep - 1 - line));\n        Slice val = TrimSpace(Slice(sep + 1));\n        if (key == \"model name\") {\n          ++num_cpus;\n          cpu_type = val.ToString();\n        } else if (key == \"cache size\") {\n          cache_size = val.ToString();\n        }\n      }\n      fclose(cpuinfo);\n      fprintf(stderr, \"CPU:            %d * %s\\n\", num_cpus, cpu_type.c_str());\n      fprintf(stderr, \"CPUCache:       %s\\n\", cache_size.c_str());\n    }\n#endif\n  }\n\n  void Start() {\n    start_ = Env::Default()->NowMicros() * 1e-6;\n    bytes_ = 0;\n    message_.clear();\n    last_op_finish_ = start_;\n    hist_.Clear();\n    done_ = 0;\n    next_report_ = 100;\n  }\n\n  void FinishedSingleOp() {\n    if (FLAGS_histogram) {\n      double now = Env::Default()->NowMicros() * 1e-6;\n      double micros = (now - last_op_finish_) * 1e6;\n      hist_.Add(micros);\n      if (micros > 20000) {\n        fprintf(stderr, \"long op: %.1f micros%30s\\r\", micros, \"\");\n        fflush(stderr);\n      }\n      last_op_finish_ = now;\n    }\n\n    done_++;\n    if (done_ >= next_report_) {\n      if      (next_report_ < 1000)   next_report_ += 100;\n      else if (next_report_ < 5000)   next_report_ += 500;\n      else if (next_report_ < 10000)  next_report_ += 1000;\n      else if (next_report_ < 50000)  next_report_ += 5000;\n      else if (next_report_ < 100000) next_report_ += 10000;\n      else if (next_report_ < 500000) next_report_ += 50000;\n      else                            next_report_ += 100000;\n      fprintf(stderr, \"... finished %d ops%30s\\r\", done_, \"\");\n      fflush(stderr);\n    }\n  }\n\n  void Stop(const Slice& name) {\n    double finish = Env::Default()->NowMicros() * 1e-6;\n\n    // Pretend at least one op was done in case we are running a benchmark\n    // that does not call FinishedSingleOp().\n    if (done_ < 1) done_ = 1;\n\n    if (bytes_ > 0) {\n      char rate[100];\n      snprintf(rate, sizeof(rate), \"%6.1f MB/s\",\n               (bytes_ / 1048576.0) / (finish - start_));\n      if (!message_.empty()) {\n        message_  = std::string(rate) + \" \" + message_;\n      } else {\n        message_ = rate;\n      }\n    }\n\n    fprintf(stdout, \"%-12s : %11.3f micros/op;%s%s\\n\",\n            name.ToString().c_str(),\n            (finish - start_) * 1e6 / done_,\n            (message_.empty() ? \"\" : \" \"),\n            message_.c_str());\n    if (FLAGS_histogram) {\n      fprintf(stdout, \"Microseconds per op:\\n%s\\n\", hist_.ToString().c_str());\n    }\n    fflush(stdout);\n  }\n\n public:\n  enum Order {\n    SEQUENTIAL,\n    RANDOM\n  };\n  enum DBState {\n    FRESH,\n    EXISTING\n  };\n\n  Benchmark()\n  : db_(NULL),\n    num_(FLAGS_num),\n    reads_(FLAGS_reads < 0 ? FLAGS_num : FLAGS_reads),\n    bytes_(0),\n    rand_(301) {\n    std::vector<std::string> files;\n    std::string test_dir;\n    Env::Default()->GetTestDirectory(&test_dir);\n    Env::Default()->GetChildren(test_dir.c_str(), &files);\n    if (!FLAGS_use_existing_db) {\n      for (int i = 0; i < files.size(); i++) {\n        if (Slice(files[i]).starts_with(\"dbbench_polyDB\")) {\n          std::string file_name(test_dir);\n          file_name += \"/\";\n          file_name += files[i];\n          Env::Default()->DeleteFile(file_name.c_str());\n        }\n      }\n    }\n  }\n\n  ~Benchmark() {\n    if (!db_->close()) {\n      fprintf(stderr, \"close error: %s\\n\", db_->error().name());\n    }\n  }\n\n  void Run() {\n    PrintHeader();\n    Open(false);\n\n    const char* benchmarks = FLAGS_benchmarks;\n    while (benchmarks != NULL) {\n      const char* sep = strchr(benchmarks, ',');\n      Slice name;\n      if (sep == NULL) {\n        name = benchmarks;\n        benchmarks = NULL;\n      } else {\n        name = Slice(benchmarks, sep - benchmarks);\n        benchmarks = sep + 1;\n      }\n\n      Start();\n\n      bool known = true;\n      bool write_sync = false;\n      if (name == Slice(\"fillseq\")) {\n        Write(write_sync, SEQUENTIAL, FRESH, num_, FLAGS_value_size, 1);\n        DBSynchronize(db_);\n      } else if (name == Slice(\"fillrandom\")) {\n        Write(write_sync, RANDOM, FRESH, num_, FLAGS_value_size, 1);\n        DBSynchronize(db_);\n      } else if (name == Slice(\"overwrite\")) {\n        Write(write_sync, RANDOM, EXISTING, num_, FLAGS_value_size, 1);\n        DBSynchronize(db_);\n      } else if (name == Slice(\"fillrandsync\")) {\n        write_sync = true;\n        Write(write_sync, RANDOM, FRESH, num_ / 100, FLAGS_value_size, 1);\n        DBSynchronize(db_);\n      } else if (name == Slice(\"fillseqsync\")) {\n        write_sync = true;\n        Write(write_sync, SEQUENTIAL, FRESH, num_ / 100, FLAGS_value_size, 1);\n        DBSynchronize(db_);\n      } else if (name == Slice(\"fillrand100K\")) {\n        Write(write_sync, RANDOM, FRESH, num_ / 1000, 100 * 1000, 1);\n        DBSynchronize(db_);\n      } else if (name == Slice(\"fillseq100K\")) {\n        Write(write_sync, SEQUENTIAL, FRESH, num_ / 1000, 100 * 1000, 1);\n        DBSynchronize(db_);\n      } else if (name == Slice(\"readseq\")) {\n        ReadSequential();\n      } else if (name == Slice(\"readrandom\")) {\n        ReadRandom();\n      } else if (name == Slice(\"readrand100K\")) {\n        int n = reads_;\n        reads_ /= 1000;\n        ReadRandom();\n        reads_ = n;\n      } else if (name == Slice(\"readseq100K\")) {\n        int n = reads_;\n        reads_ /= 1000;\n        ReadSequential();\n        reads_ = n;\n      } else {\n        known = false;\n        if (name != Slice()) {  // No error message for empty name\n          fprintf(stderr, \"unknown benchmark '%s'\\n\", name.ToString().c_str());\n        }\n      }\n      if (known) {\n        Stop(name);\n      }\n    }\n  }\n\n private:\n    void Open(bool sync) {\n    assert(db_ == NULL);\n\n    // Initialize db_\n    db_ = new kyotocabinet::TreeDB();\n    char file_name[100];\n    db_num_++;\n    std::string test_dir;\n    Env::Default()->GetTestDirectory(&test_dir);\n    snprintf(file_name, sizeof(file_name),\n             \"%s/dbbench_polyDB-%d.kct\",\n             test_dir.c_str(),\n             db_num_);\n\n    // Create tuning options and open the database\n    int open_options = kyotocabinet::PolyDB::OWRITER |\n                       kyotocabinet::PolyDB::OCREATE;\n    int tune_options = kyotocabinet::TreeDB::TSMALL |\n        kyotocabinet::TreeDB::TLINEAR;\n    if (FLAGS_compression) {\n      tune_options |= kyotocabinet::TreeDB::TCOMPRESS;\n      db_->tune_compressor(&comp_);\n    }\n    db_->tune_options(tune_options);\n    db_->tune_page_cache(FLAGS_cache_size);\n    db_->tune_page(FLAGS_page_size);\n    db_->tune_map(256LL<<20);\n    if (sync) {\n      open_options |= kyotocabinet::PolyDB::OAUTOSYNC;\n    }\n    if (!db_->open(file_name, open_options)) {\n      fprintf(stderr, \"open error: %s\\n\", db_->error().name());\n    }\n  }\n\n  void Write(bool sync, Order order, DBState state,\n             int num_entries, int value_size, int entries_per_batch) {\n    // Create new database if state == FRESH\n    if (state == FRESH) {\n      if (FLAGS_use_existing_db) {\n        message_ = \"skipping (--use_existing_db is true)\";\n        return;\n      }\n      delete db_;\n      db_ = NULL;\n      Open(sync);\n      Start();  // Do not count time taken to destroy/open\n    }\n\n    if (num_entries != num_) {\n      char msg[100];\n      snprintf(msg, sizeof(msg), \"(%d ops)\", num_entries);\n      message_ = msg;\n    }\n\n    // Write to database\n    for (int i = 0; i < num_entries; i++)\n    {\n      const int k = (order == SEQUENTIAL) ? i : (rand_.Next() % num_entries);\n      char key[100];\n      snprintf(key, sizeof(key), \"%016d\", k);\n      bytes_ += value_size + strlen(key);\n      std::string cpp_key = key;\n      if (!db_->set(cpp_key, gen_.Generate(value_size).ToString())) {\n        fprintf(stderr, \"set error: %s\\n\", db_->error().name());\n      }\n      FinishedSingleOp();\n    }\n  }\n\n  void ReadSequential() {\n    kyotocabinet::DB::Cursor* cur = db_->cursor();\n    cur->jump();\n    std::string ckey, cvalue;\n    while (cur->get(&ckey, &cvalue, true)) {\n      bytes_ += ckey.size() + cvalue.size();\n      FinishedSingleOp();\n    }\n    delete cur;\n  }\n\n  void ReadRandom() {\n    std::string value;\n    for (int i = 0; i < reads_; i++) {\n      char key[100];\n      const int k = rand_.Next() % reads_;\n      snprintf(key, sizeof(key), \"%016d\", k);\n      db_->get(key, &value);\n      FinishedSingleOp();\n    }\n  }\n};\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  std::string default_db_path;\n  for (int i = 1; i < argc; i++) {\n    double d;\n    int n;\n    char junk;\n    if (leveldb::Slice(argv[i]).starts_with(\"--benchmarks=\")) {\n      FLAGS_benchmarks = argv[i] + strlen(\"--benchmarks=\");\n    } else if (sscanf(argv[i], \"--compression_ratio=%lf%c\", &d, &junk) == 1) {\n      FLAGS_compression_ratio = d;\n    } else if (sscanf(argv[i], \"--histogram=%d%c\", &n, &junk) == 1 &&\n               (n == 0 || n == 1)) {\n      FLAGS_histogram = n;\n    } else if (sscanf(argv[i], \"--num=%d%c\", &n, &junk) == 1) {\n      FLAGS_num = n;\n    } else if (sscanf(argv[i], \"--reads=%d%c\", &n, &junk) == 1) {\n      FLAGS_reads = n;\n    } else if (sscanf(argv[i], \"--value_size=%d%c\", &n, &junk) == 1) {\n      FLAGS_value_size = n;\n    } else if (sscanf(argv[i], \"--cache_size=%d%c\", &n, &junk) == 1) {\n      FLAGS_cache_size = n;\n    } else if (sscanf(argv[i], \"--page_size=%d%c\", &n, &junk) == 1) {\n      FLAGS_page_size = n;\n    } else if (sscanf(argv[i], \"--compression=%d%c\", &n, &junk) == 1 &&\n               (n == 0 || n == 1)) {\n      FLAGS_compression = (n == 1) ? true : false;\n    } else if (strncmp(argv[i], \"--db=\", 5) == 0) {\n      FLAGS_db = argv[i] + 5;\n    } else {\n      fprintf(stderr, \"Invalid flag '%s'\\n\", argv[i]);\n      exit(1);\n    }\n  }\n\n  // Choose a location for the test database if none given with --db=<path>\n  if (FLAGS_db == NULL) {\n      leveldb::Env::Default()->GetTestDirectory(&default_db_path);\n      default_db_path += \"/dbbench\";\n      FLAGS_db = default_db_path.c_str();\n  }\n\n  leveldb::Benchmark benchmark;\n  benchmark.Run();\n  return 0;\n}\n"
  },
  {
    "path": "src/leveldb/doc/benchmark.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<title>LevelDB Benchmarks</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<style>\nbody {\n  font-family:Helvetica,sans-serif;\n  padding:20px;\n}\n\nh2 {\n  padding-top:30px;\n}\n\ntable.bn {\n  width:800px;\n  border-collapse:collapse;\n  border:0;\n  padding:0;\n}\n\ntable.bnbase {\n  width:650px;\n}\n\ntable.bn td {\n  padding:2px 0;\n}\n\ntable.bn td.c1 {\n  font-weight:bold;\n  width:150px;\n}\n\ntable.bn td.c1 div.e {\n  float:right;\n  font-weight:normal;\n}\n\ntable.bn td.c2 {\n  width:150px;\n  text-align:right;\n  padding:2px;\n}\n\ntable.bn td.c3 {\n  width:350px;\n}\n\ntable.bn td.c4 {\n  width:150px;\n  font-size:small;\n  padding-left:4px;\n}\n\n/* chart bars */\ndiv.bldb {\n  background-color:#0255df;\n}\n\ndiv.bkct {\n  background-color:#df5555;\n}\n\ndiv.bsql {\n  background-color:#aadf55;\n}\n\n.code {\n  font-family:monospace;\n  font-size:large;\n}\n\n.todo {\n  color: red;\n}\n\n</style>\n</head>\n<body>\n<h1>LevelDB Benchmarks</h1>\n<p>Google, July 2011</p>\n<hr>\n\n<p>In order to test LevelDB's performance, we benchmark it against other well-established database implementations. We compare LevelDB (revision 39) against <a href=\"http://www.sqlite.org/\">SQLite3</a> (version 3.7.6.3) and <a href=\"http://fallabs.com/kyotocabinet/spex.html\">Kyoto Cabinet's</a> (version 1.2.67) TreeDB (a B+Tree based key-value store). We would like to acknowledge Scott Hess and Mikio Hirabayashi for their suggestions and contributions to the SQLite3 and Kyoto Cabinet benchmarks, respectively.</p>\n\n<p>Benchmarks were all performed on a six-core Intel(R) Xeon(R) CPU X5650 @ 2.67GHz, with 12288 KB of total L3 cache and 12 GB of DDR3 RAM at 1333 MHz. (Note that LevelDB uses at most two CPUs since the benchmarks are single threaded: one to run the benchmark, and one for background compactions.) We ran the benchmarks on two machines (with identical processors), one with an Ext3 file system and one with an Ext4 file system. The machine with the Ext3 file system has a SATA Hitachi HDS721050CLA362 hard drive. The machine with the Ext4 file system has a SATA Samsung HD502HJ hard drive. Both hard drives spin at 7200 RPM and have hard drive write-caching enabled (using `hdparm -W 1 [device]`). The numbers reported below are the median of three measurements.</p>\n\n<h4>Benchmark Source Code</h4>\n<p>We wrote benchmark tools for SQLite and Kyoto TreeDB based on LevelDB's <span class=\"code\">db_bench</span>. The code for each of the benchmarks resides here:</p>\n<ul>\n\t<li> <b>LevelDB:</b> <a href=\"http://code.google.com/p/leveldb/source/browse/trunk/db/db_bench.cc\">db/db_bench.cc</a>.</li>\n\t<li> <b>SQLite:</b> <a href=\"http://code.google.com/p/leveldb/source/browse/#svn%2Ftrunk%2Fdoc%2Fbench%2Fdb_bench_sqlite3.cc\">doc/bench/db_bench_sqlite3.cc</a>.</li>\n\t<li> <b>Kyoto TreeDB:</b> <a href=\"http://code.google.com/p/leveldb/source/browse/#svn%2Ftrunk%2Fdoc%2Fbench%2Fdb_bench_tree_db.cc\">doc/bench/db_bench_tree_db.cc</a>.</li>\n</ul>\n\n<h4>Custom Build Specifications</h4>\n<ul>\n<li>LevelDB: LevelDB was compiled with the <a href=\"http://code.google.com/p/google-perftools\">tcmalloc</a> library and the <a href=\"http://code.google.com/p/snappy/\">Snappy</a> compression library (revision 33).  Assertions were disabled.</li>\n<li>TreeDB: TreeDB was compiled using the <a href=\"http://www.oberhumer.com/opensource/lzo/\">LZO</a> compression library (version 2.03). Furthermore, we enabled the TSMALL and TLINEAR options when opening the database in order to reduce the footprint of each record.</li>\n<li>SQLite: We tuned SQLite's performance, by setting its locking mode to exclusive.  We also enabled SQLite's <a href=\"http://www.sqlite.org/draft/wal.html\">write-ahead logging</a>.</li>\n</ul>\n\n<h2>1. Baseline Performance</h2>\n<p>This section gives the baseline performance of all the\ndatabases.  Following sections show how performance changes as various\nparameters are varied.  For the baseline:</p>\n<ul>\n\t<li> Each database is allowed 4 MB of cache memory.</li>\n        <li> Databases are opened in <em>asynchronous</em> write mode.\n             (LevelDB's sync option, TreeDB's OAUTOSYNC option, and\n             SQLite3's synchronous options are all turned off).  I.e.,\n             every write is pushed to the operating system, but the\n             benchmark does not wait for the write to reach the disk.</li>\n\t<li> Keys are 16 bytes each.</li>\n        <li> Value are 100 bytes each (with enough redundancy so that\n             a simple compressor shrinks them to 50% of their original\n             size).</li>\n\t<li> Sequential reads/writes traverse the key space in increasing order.</li>\n\t<li> Random reads/writes traverse the key space in random order.</li>\n</ul>\n\n<h3>A. Sequential Reads</h3>\n<table class=\"bn bnbase\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">4,030,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">1,010,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:95px\">&nbsp;</div></td>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">383,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:33px\">&nbsp;</div></td>\n</table>\n<h3>B. Random Reads</h3>\n<table class=\"bn bnbase\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">129,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:298px\">&nbsp;</div></td>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">151,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:350px\">&nbsp;</div></td>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">134,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:310px\">&nbsp;</div></td>\n</table>\n<h3>C. Sequential Writes</h3>\n<table class=\"bn bnbase\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">779,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">342,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:154px\">&nbsp;</div></td>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">48,600 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:22px\">&nbsp;</div></td>\n</table>\n<h3>D. Random Writes</h3>\n<table class=\"bn bnbase\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">164,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">88,500 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:188px\">&nbsp;</div></td>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">9,860 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:21px\">&nbsp;</div></td>\n</table>\n\n<p>LevelDB outperforms both SQLite3 and TreeDB in sequential and random write operations and sequential read operations. Kyoto Cabinet has the fastest random read operations.</p>\n\n<h2>2. Write Performance under Different Configurations</h2>\n<h3>A. Large Values </h3>\n<p>For this benchmark, we start with an empty database, and write 100,000 byte values (~50% compressible). To keep the benchmark running time reasonable, we stop after writing 1000 values.</p>\n<h4>Sequential Writes</h4>\n<table class=\"bn bnbase\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">1,100 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:234px\">&nbsp;</div></td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">1,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:224px\">&nbsp;</div></td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">1,600 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:350px\">&nbsp;</div></td></tr>\n</table>\n<h4>Random Writes</h4>\n<table class=\"bn bnbase\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">480 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:105px\">&nbsp;</div></td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">1,100 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:240px\">&nbsp;</div></td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">1,600 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:350px\">&nbsp;</div></td></tr>\n</table>\n<p>LevelDB doesn't perform as well with large values of 100,000 bytes each. This is because LevelDB writes keys and values at least twice: first time to the transaction log, and second time (during a compaction) to a sorted file.\nWith larger values, LevelDB's per-operation efficiency is swamped by the\ncost of extra copies of large values.</p>\n<h3>B. Batch Writes</h3>\n<p>A batch write is a set of writes that are applied atomically to the underlying database. A single batch of N writes may be significantly faster than N individual writes. The following benchmark writes one thousand batches where each batch contains one thousand 100-byte values. TreeDB does not support batch writes and is omitted from this benchmark.</p>\n<h4>Sequential Writes</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">840,000 entries/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.08x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">124,000 entries/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:52px\">&nbsp;</div></td>\n    <td class=\"c4\">(2.55x baseline)</td></tr>\n</table>\n<h4>Random Writes</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">221,000 entries/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.35x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">22,000 entries/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:34px\">&nbsp;</div></td>\n    <td class=\"c4\">(2.23x baseline)</td></tr>\n</table>\n\n<p>Because of the way LevelDB persistent storage is organized, batches of\nrandom writes are not much slower (only a factor of 4x) than batches\nof sequential writes.</p>\n\n<h3>C. Synchronous Writes</h3>\n<p>In the following benchmark, we enable the synchronous writing modes\nof all of the databases.  Since this change significantly slows down the\nbenchmark, we stop after 10,000 writes. For synchronous write tests, we've\ndisabled hard drive write-caching (using `hdparm -W 0 [device]`).</p>\n<ul>\n    <li>For LevelDB, we set WriteOptions.sync = true.</li>\n    <li>In TreeDB, we enabled TreeDB's OAUTOSYNC option.</li>\n    <li>For SQLite3, we set \"PRAGMA synchronous = FULL\".</li>\n</ul>\n<h4>Sequential Writes</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">100 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(0.003x baseline)</td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">7 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:27px\">&nbsp;</div></td>\n    <td class=\"c4\">(0.0004x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">88 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:315px\">&nbsp;</div></td>\n    <td class=\"c4\">(0.002x baseline)</td></tr>\n</table>\n<h4>Random Writes</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">100 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(0.015x baseline)</td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">8 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:29px\">&nbsp;</div></td>\n    <td class=\"c4\">(0.001x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">88 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:314px\">&nbsp;</div></td>\n    <td class=\"c4\">(0.009x baseline)</td></tr>\n</table>\n\n<p>Also see the <code>ext4</code> performance numbers below\nsince synchronous writes behave significantly differently\non <code>ext3</code> and <code>ext4</code>.</p>\n\n<h3>D. Turning Compression Off</h3>\n\n<p>In the baseline measurements, LevelDB and TreeDB were using\nlight-weight compression\n(<a href=\"http://code.google.com/p/snappy/\">Snappy</a> for LevelDB,\nand <a href=\"http://www.oberhumer.com/opensource/lzo/\">LZO</a> for\nTreeDB). SQLite3, by default does not use compression.  The\nexperiments below show what happens when compression is disabled in\nall of the databases (the SQLite3 numbers are just a copy of\nits baseline measurements):</p>\n\n<h4>Sequential Writes</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">594,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(0.76x baseline)</td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">485,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:239px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.42x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">48,600 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:29px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.00x baseline)</td></tr>\n</table>\n<h4>Random Writes</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">135,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:296px\">&nbsp;</div></td>\n    <td class=\"c4\">(0.82x baseline)</td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">159,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.80x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">9,860 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:22px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.00x baseline)</td></tr>\n</table>\n\n<p>LevelDB's write performance is better with compression than without\nsince compression decreases the amount of data that has to be written\nto disk.  Therefore LevelDB users can leave compression enabled in\nmost scenarios without having worry about a tradeoff between space\nusage and performance.  TreeDB's performance on the other hand is\nbetter without compression than with compression.  Presumably this is\nbecause TreeDB's compression library (LZO) is more expensive than\nLevelDB's compression library (Snappy).<p>\n\n<h3>E. Using More Memory</h3>\n<p>We increased the overall cache size for each database to 128 MB. For LevelDB, we partitioned 128 MB into a 120 MB write buffer and 8 MB of cache (up from 2 MB of write buffer and 2 MB of cache). For SQLite3, we kept the page size at 1024 bytes, but increased the number of pages to 131,072 (up from 4096). For TreeDB, we also kept the page size at 1024 bytes, but increased the cache size to 128 MB (up from 4 MB).</p>\n<h4>Sequential Writes</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">812,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.04x baseline)</td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">321,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:138px\">&nbsp;</div></td>\n    <td class=\"c4\">(0.94x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">48,500 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:21px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.00x baseline)</td></tr>\n</table>\n<h4>Random Writes</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">355,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(2.16x baseline)</td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">284,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:280px\">&nbsp;</div></td>\n    <td class=\"c4\">(3.21x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">9,670 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:10px\">&nbsp;</div></td>\n    <td class=\"c4\">(0.98x baseline)</td></tr>\n</table>\n\n<p>SQLite's performance does not change substantially when compared to\nthe baseline, but the random write performance for both LevelDB and\nTreeDB increases significantly.  LevelDB's performance improves\nbecause a larger write buffer reduces the need to merge sorted files\n(since it creates a smaller number of larger sorted files).  TreeDB's\nperformance goes up because the entire database is available in memory\nfor fast in-place updates.</p>\n\n  <h2>3. Read Performance under Different Configurations</h2>\n<h3>A. Larger Caches</h3>\n<p>We increased the overall memory usage to 128 MB for each database.\nFor LevelDB, we allocated 8 MB to LevelDB's write buffer and 120 MB\nto LevelDB's cache. The other databases don't differentiate between a\nwrite buffer and a cache, so we simply set their cache size to 128\nMB.</p>\n<h4>Sequential Reads</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">5,210,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.29x baseline)</td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">1,070,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:72px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.06x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">609,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:41px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.59x baseline)</td></tr>\n</table>\n\n<h4>Random Reads</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">190,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:144px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.47x baseline)</td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">463,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(3.07x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">186,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:141px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.39x baseline)</td></tr>\n</table>\n\n<p>As expected, the read performance of all of the databases increases\nwhen the caches are enlarged.  In particular, TreeDB seems to make\nvery effective use of a cache that is large enough to hold the entire\ndatabase.</p>\n\n<h3>B. No Compression Reads </h3>\n<p>For this benchmark, we populated a database with 1 million entries consisting of 16 byte keys and 100 byte values. We compiled LevelDB and Kyoto Cabinet without compression support, so results that are read out from the database are already uncompressed. We've listed the SQLite3 baseline read performance as a point of comparison.</p>\n<h4>Sequential Reads</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">4,880,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.21x baseline)</td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">1,230,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:88px\">&nbsp;</div></td>\n    <td class=\"c4\">(3.60x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">383,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:27px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.00x baseline)</td></tr>\n</table>\n<h4>Random Reads</h4>\n<table class=\"bn\">\n<tr><td class=\"c1\">LevelDB</td>\n    <td class=\"c2\">149,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bldb\" style=\"width:300px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.16x baseline)</td></tr>\n<tr><td class=\"c1\">Kyoto TreeDB</td>\n    <td class=\"c2\">175,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bkct\" style=\"width:350px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.16x baseline)</td></tr>\n<tr><td class=\"c1\">SQLite3</td>\n    <td class=\"c2\">134,000 ops/sec</td>\n    <td class=\"c3\"><div class=\"bsql\" style=\"width:268px\">&nbsp;</div></td>\n    <td class=\"c4\">(1.00x baseline)</td></tr>\n</table>\n\n<p>Performance of both LevelDB and TreeDB improves a small amount when\ncompression is disabled.  Note however that under different workloads,\nperformance may very well be better with compression if it allows more\nof the working set to fit in memory.</p>\n\n<h2>Note about Ext4 Filesystems</h2>\n<p>The preceding numbers are for an ext3 file system. Synchronous writes are much slower under <a href=\"http://en.wikipedia.org/wiki/Ext4\">ext4</a> (LevelDB drops to ~31 writes / second and TreeDB drops to ~5 writes / second; SQLite3's synchronous writes do not noticeably drop) due to ext4's different handling of <span class=\"code\">fsync</span> / <span class=\"code\">msync</span> calls. Even LevelDB's asynchronous write performance drops somewhat since it spreads its storage across multiple files and issues <span class=\"code\">fsync</span> calls when switching to a new file.</p>\n\n<h2>Acknowledgements</h2>\n<p>Jeff Dean and Sanjay Ghemawat wrote LevelDB. Kevin Tseng wrote and compiled these benchmarks. Mikio Hirabayashi, Scott Hess, and Gabor Cselle provided help and advice.</p>\n</body>\n</html>\n"
  },
  {
    "path": "src/leveldb/doc/impl.md",
    "content": "## Files\n\nThe implementation of leveldb is similar in spirit to the representation of a\nsingle [Bigtable tablet (section 5.3)](http://research.google.com/archive/bigtable.html).\nHowever the organization of the files that make up the representation is\nsomewhat different and is explained below.\n\nEach database is represented by a set of files stored in a directory. There are\nseveral different types of files as documented below:\n\n### Log files\n\nA log file (*.log) stores a sequence of recent updates. Each update is appended\nto the current log file. When the log file reaches a pre-determined size\n(approximately 4MB by default), it is converted to a sorted table (see below)\nand a new log file is created for future updates.\n\nA copy of the current log file is kept in an in-memory structure (the\n`memtable`). This copy is consulted on every read so that read operations\nreflect all logged updates.\n\n## Sorted tables\n\nA sorted table (*.ldb) stores a sequence of entries sorted by key. Each entry is\neither a value for the key, or a deletion marker for the key. (Deletion markers\nare kept around to hide obsolete values present in older sorted tables).\n\nThe set of sorted tables are organized into a sequence of levels. The sorted\ntable generated from a log file is placed in a special **young** level (also\ncalled level-0). When the number of young files exceeds a certain threshold\n(currently four), all of the young files are merged together with all of the\noverlapping level-1 files to produce a sequence of new level-1 files (we create\na new level-1 file for every 2MB of data.)\n\nFiles in the young level may contain overlapping keys. However files in other\nlevels have distinct non-overlapping key ranges. Consider level number L where\nL >= 1. When the combined size of files in level-L exceeds (10^L) MB (i.e., 10MB\nfor level-1, 100MB for level-2, ...), one file in level-L, and all of the\noverlapping files in level-(L+1) are merged to form a set of new files for\nlevel-(L+1). These merges have the effect of gradually migrating new updates\nfrom the young level to the largest level using only bulk reads and writes\n(i.e., minimizing expensive seeks).\n\n### Manifest\n\nA MANIFEST file lists the set of sorted tables that make up each level, the\ncorresponding key ranges, and other important metadata. A new MANIFEST file\n(with a new number embedded in the file name) is created whenever the database\nis reopened. The MANIFEST file is formatted as a log, and changes made to the\nserving state (as files are added or removed) are appended to this log.\n\n### Current\n\nCURRENT is a simple text file that contains the name of the latest MANIFEST\nfile.\n\n### Info logs\n\nInformational messages are printed to files named LOG and LOG.old.\n\n### Others\n\nOther files used for miscellaneous purposes may also be present (LOCK, *.dbtmp).\n\n## Level 0\n\nWhen the log file grows above a certain size (1MB by default):\nCreate a brand new memtable and log file and direct future updates here\nIn the background:\nWrite the contents of the previous memtable to an sstable\nDiscard the memtable\nDelete the old log file and the old memtable\nAdd the new sstable to the young (level-0) level.\n\n## Compactions\n\nWhen the size of level L exceeds its limit, we compact it in a background\nthread. The compaction picks a file from level L and all overlapping files from\nthe next level L+1. Note that if a level-L file overlaps only part of a\nlevel-(L+1) file, the entire file at level-(L+1) is used as an input to the\ncompaction and will be discarded after the compaction.  Aside: because level-0\nis special (files in it may overlap each other), we treat compactions from\nlevel-0 to level-1 specially: a level-0 compaction may pick more than one\nlevel-0 file in case some of these files overlap each other.\n\nA compaction merges the contents of the picked files to produce a sequence of\nlevel-(L+1) files. We switch to producing a new level-(L+1) file after the\ncurrent output file has reached the target file size (2MB). We also switch to a\nnew output file when the key range of the current output file has grown enough\nto overlap more than ten level-(L+2) files.  This last rule ensures that a later\ncompaction of a level-(L+1) file will not pick up too much data from\nlevel-(L+2).\n\nThe old files are discarded and the new files are added to the serving state.\n\nCompactions for a particular level rotate through the key space. In more detail,\nfor each level L, we remember the ending key of the last compaction at level L.\nThe next compaction for level L will pick the first file that starts after this\nkey (wrapping around to the beginning of the key space if there is no such\nfile).\n\nCompactions drop overwritten values. They also drop deletion markers if there\nare no higher numbered levels that contain a file whose range overlaps the\ncurrent key.\n\n### Timing\n\nLevel-0 compactions will read up to four 1MB files from level-0, and at worst\nall the level-1 files (10MB). I.e., we will read 14MB and write 14MB.\n\nOther than the special level-0 compactions, we will pick one 2MB file from level\nL. In the worst case, this will overlap ~ 12 files from level L+1 (10 because\nlevel-(L+1) is ten times the size of level-L, and another two at the boundaries\nsince the file ranges at level-L will usually not be aligned with the file\nranges at level-L+1). The compaction will therefore read 26MB and write 26MB.\nAssuming a disk IO rate of 100MB/s (ballpark range for modern drives), the worst\ncompaction cost will be approximately 0.5 second.\n\nIf we throttle the background writing to something small, say 10% of the full\n100MB/s speed, a compaction may take up to 5 seconds. If the user is writing at\n10MB/s, we might build up lots of level-0 files (~50 to hold the 5*10MB). This\nmay significantly increase the cost of reads due to the overhead of merging more\nfiles together on every read.\n\nSolution 1: To reduce this problem, we might want to increase the log switching\nthreshold when the number of level-0 files is large. Though the downside is that\nthe larger this threshold, the more memory we will need to hold the\ncorresponding memtable.\n\nSolution 2: We might want to decrease write rate artificially when the number of\nlevel-0 files goes up.\n\nSolution 3: We work on reducing the cost of very wide merges. Perhaps most of\nthe level-0 files will have their blocks sitting uncompressed in the cache and\nwe will only need to worry about the O(N) complexity in the merging iterator.\n\n### Number of files\n\nInstead of always making 2MB files, we could make larger files for larger levels\nto reduce the total file count, though at the expense of more bursty\ncompactions.  Alternatively, we could shard the set of files into multiple\ndirectories.\n\nAn experiment on an ext3 filesystem on Feb 04, 2011 shows the following timings\nto do 100K file opens in directories with varying number of files:\n\n\n| Files in directory | Microseconds to open a file |\n|-------------------:|----------------------------:|\n|               1000 |                           9 |\n|              10000 |                          10 |\n|             100000 |                          16 |\n\nSo maybe even the sharding is not necessary on modern filesystems?\n\n## Recovery\n\n* Read CURRENT to find name of the latest committed MANIFEST\n* Read the named MANIFEST file\n* Clean up stale files\n* We could open all sstables here, but it is probably better to be lazy...\n* Convert log chunk to a new level-0 sstable\n* Start directing new writes to a new log file with recovered sequence#\n\n## Garbage collection of files\n\n`DeleteObsoleteFiles()` is called at the end of every compaction and at the end\nof recovery. It finds the names of all files in the database. It deletes all log\nfiles that are not the current log file. It deletes all table files that are not\nreferenced from some level and are not the output of an active compaction.\n"
  },
  {
    "path": "src/leveldb/doc/index.md",
    "content": "leveldb\n=======\n\n_Jeff Dean, Sanjay Ghemawat_\n\nThe leveldb library provides a persistent key value store. Keys and values are\narbitrary byte arrays.  The keys are ordered within the key value store\naccording to a user-specified comparator function.\n\n## Opening A Database\n\nA leveldb database has a name which corresponds to a file system directory. All\nof the contents of database are stored in this directory. The following example\nshows how to open a database, creating it if necessary:\n\n```c++\n#include <cassert>\n#include \"leveldb/db.h\"\n\nleveldb::DB* db;\nleveldb::Options options;\noptions.create_if_missing = true;\nleveldb::Status status = leveldb::DB::Open(options, \"/tmp/testdb\", &db);\nassert(status.ok());\n...\n```\n\nIf you want to raise an error if the database already exists, add the following\nline before the `leveldb::DB::Open` call:\n\n```c++\noptions.error_if_exists = true;\n```\n\n## Status\n\nYou may have noticed the `leveldb::Status` type above. Values of this type are\nreturned by most functions in leveldb that may encounter an error. You can check\nif such a result is ok, and also print an associated error message:\n\n```c++\nleveldb::Status s = ...;\nif (!s.ok()) cerr << s.ToString() << endl;\n```\n\n## Closing A Database\n\nWhen you are done with a database, just delete the database object. Example:\n\n```c++\n... open the db as described above ...\n... do something with db ...\ndelete db;\n```\n\n## Reads And Writes\n\nThe database provides Put, Delete, and Get methods to modify/query the database.\nFor example, the following code moves the value stored under key1 to key2.\n\n```c++\nstd::string value;\nleveldb::Status s = db->Get(leveldb::ReadOptions(), key1, &value);\nif (s.ok()) s = db->Put(leveldb::WriteOptions(), key2, value);\nif (s.ok()) s = db->Delete(leveldb::WriteOptions(), key1);\n```\n\n## Atomic Updates\n\nNote that if the process dies after the Put of key2 but before the delete of\nkey1, the same value may be left stored under multiple keys. Such problems can\nbe avoided by using the `WriteBatch` class to atomically apply a set of updates:\n\n```c++\n#include \"leveldb/write_batch.h\"\n...\nstd::string value;\nleveldb::Status s = db->Get(leveldb::ReadOptions(), key1, &value);\nif (s.ok()) {\n  leveldb::WriteBatch batch;\n  batch.Delete(key1);\n  batch.Put(key2, value);\n  s = db->Write(leveldb::WriteOptions(), &batch);\n}\n```\n\nThe `WriteBatch` holds a sequence of edits to be made to the database, and these\nedits within the batch are applied in order. Note that we called Delete before\nPut so that if key1 is identical to key2, we do not end up erroneously dropping\nthe value entirely.\n\nApart from its atomicity benefits, `WriteBatch` may also be used to speed up\nbulk updates by placing lots of individual mutations into the same batch.\n\n## Synchronous Writes\n\nBy default, each write to leveldb is asynchronous: it returns after pushing the\nwrite from the process into the operating system. The transfer from operating\nsystem memory to the underlying persistent storage happens asynchronously. The\nsync flag can be turned on for a particular write to make the write operation\nnot return until the data being written has been pushed all the way to\npersistent storage. (On Posix systems, this is implemented by calling either\n`fsync(...)` or `fdatasync(...)` or `msync(..., MS_SYNC)` before the write\noperation returns.)\n\n```c++\nleveldb::WriteOptions write_options;\nwrite_options.sync = true;\ndb->Put(write_options, ...);\n```\n\nAsynchronous writes are often more than a thousand times as fast as synchronous\nwrites. The downside of asynchronous writes is that a crash of the machine may\ncause the last few updates to be lost. Note that a crash of just the writing\nprocess (i.e., not a reboot) will not cause any loss since even when sync is\nfalse, an update is pushed from the process memory into the operating system\nbefore it is considered done.\n\nAsynchronous writes can often be used safely. For example, when loading a large\namount of data into the database you can handle lost updates by restarting the\nbulk load after a crash. A hybrid scheme is also possible where every Nth write\nis synchronous, and in the event of a crash, the bulk load is restarted just\nafter the last synchronous write finished by the previous run. (The synchronous\nwrite can update a marker that describes where to restart on a crash.)\n\n`WriteBatch` provides an alternative to asynchronous writes. Multiple updates\nmay be placed in the same WriteBatch and applied together using a synchronous\nwrite (i.e., `write_options.sync` is set to true). The extra cost of the\nsynchronous write will be amortized across all of the writes in the batch.\n\n## Concurrency\n\nA database may only be opened by one process at a time. The leveldb\nimplementation acquires a lock from the operating system to prevent misuse.\nWithin a single process, the same `leveldb::DB` object may be safely shared by\nmultiple concurrent threads. I.e., different threads may write into or fetch\niterators or call Get on the same database without any external synchronization\n(the leveldb implementation will automatically do the required synchronization).\nHowever other objects (like Iterator and `WriteBatch`) may require external\nsynchronization. If two threads share such an object, they must protect access\nto it using their own locking protocol. More details are available in the public\nheader files.\n\n## Iteration\n\nThe following example demonstrates how to print all key,value pairs in a\ndatabase.\n\n```c++\nleveldb::Iterator* it = db->NewIterator(leveldb::ReadOptions());\nfor (it->SeekToFirst(); it->Valid(); it->Next()) {\n  cout << it->key().ToString() << \": \"  << it->value().ToString() << endl;\n}\nassert(it->status().ok());  // Check for any errors found during the scan\ndelete it;\n```\n\nThe following variation shows how to process just the keys in the range\n[start,limit):\n\n```c++\nfor (it->Seek(start);\n   it->Valid() && it->key().ToString() < limit;\n   it->Next()) {\n  ...\n}\n```\n\nYou can also process entries in reverse order. (Caveat: reverse iteration may be\nsomewhat slower than forward iteration.)\n\n```c++\nfor (it->SeekToLast(); it->Valid(); it->Prev()) {\n  ...\n}\n```\n\n## Snapshots\n\nSnapshots provide consistent read-only views over the entire state of the\nkey-value store.  `ReadOptions::snapshot` may be non-NULL to indicate that a\nread should operate on a particular version of the DB state. If\n`ReadOptions::snapshot` is NULL, the read will operate on an implicit snapshot\nof the current state.\n\nSnapshots are created by the `DB::GetSnapshot()` method:\n\n```c++\nleveldb::ReadOptions options;\noptions.snapshot = db->GetSnapshot();\n... apply some updates to db ...\nleveldb::Iterator* iter = db->NewIterator(options);\n... read using iter to view the state when the snapshot was created ...\ndelete iter;\ndb->ReleaseSnapshot(options.snapshot);\n```\n\nNote that when a snapshot is no longer needed, it should be released using the\n`DB::ReleaseSnapshot` interface. This allows the implementation to get rid of\nstate that was being maintained just to support reading as of that snapshot.\n\n## Slice\n\nThe return value of the `it->key()` and `it->value()` calls above are instances\nof the `leveldb::Slice` type. Slice is a simple structure that contains a length\nand a pointer to an external byte array. Returning a Slice is a cheaper\nalternative to returning a `std::string` since we do not need to copy\npotentially large keys and values. In addition, leveldb methods do not return\nnull-terminated C-style strings since leveldb keys and values are allowed to\ncontain `'\\0'` bytes.\n\nC++ strings and null-terminated C-style strings can be easily converted to a\nSlice:\n\n```c++\nleveldb::Slice s1 = \"hello\";\n\nstd::string str(\"world\");\nleveldb::Slice s2 = str;\n```\n\nA Slice can be easily converted back to a C++ string:\n\n```c++\nstd::string str = s1.ToString();\nassert(str == std::string(\"hello\"));\n```\n\nBe careful when using Slices since it is up to the caller to ensure that the\nexternal byte array into which the Slice points remains live while the Slice is\nin use. For example, the following is buggy:\n\n```c++\nleveldb::Slice slice;\nif (...) {\n  std::string str = ...;\n  slice = str;\n}\nUse(slice);\n```\n\nWhen the if statement goes out of scope, str will be destroyed and the backing\nstorage for slice will disappear.\n\n## Comparators\n\nThe preceding examples used the default ordering function for key, which orders\nbytes lexicographically. You can however supply a custom comparator when opening\na database.  For example, suppose each database key consists of two numbers and\nwe should sort by the first number, breaking ties by the second number. First,\ndefine a proper subclass of `leveldb::Comparator` that expresses these rules:\n\n```c++\nclass TwoPartComparator : public leveldb::Comparator {\n public:\n  // Three-way comparison function:\n  //   if a < b: negative result\n  //   if a > b: positive result\n  //   else: zero result\n  int Compare(const leveldb::Slice& a, const leveldb::Slice& b) const {\n    int a1, a2, b1, b2;\n    ParseKey(a, &a1, &a2);\n    ParseKey(b, &b1, &b2);\n    if (a1 < b1) return -1;\n    if (a1 > b1) return +1;\n    if (a2 < b2) return -1;\n    if (a2 > b2) return +1;\n    return 0;\n  }\n\n  // Ignore the following methods for now:\n  const char* Name() const { return \"TwoPartComparator\"; }\n  void FindShortestSeparator(std::string*, const leveldb::Slice&) const {}\n  void FindShortSuccessor(std::string*) const {}\n};\n```\n\nNow create a database using this custom comparator:\n\n```c++\nTwoPartComparator cmp;\nleveldb::DB* db;\nleveldb::Options options;\noptions.create_if_missing = true;\noptions.comparator = &cmp;\nleveldb::Status status = leveldb::DB::Open(options, \"/tmp/testdb\", &db);\n...\n```\n\n### Backwards compatibility\n\nThe result of the comparator's Name method is attached to the database when it\nis created, and is checked on every subsequent database open. If the name\nchanges, the `leveldb::DB::Open` call will fail. Therefore, change the name if\nand only if the new key format and comparison function are incompatible with\nexisting databases, and it is ok to discard the contents of all existing\ndatabases.\n\nYou can however still gradually evolve your key format over time with a little\nbit of pre-planning. For example, you could store a version number at the end of\neach key (one byte should suffice for most uses). When you wish to switch to a\nnew key format (e.g., adding an optional third part to the keys processed by\n`TwoPartComparator`), (a) keep the same comparator name (b) increment the\nversion number for new keys (c) change the comparator function so it uses the\nversion numbers found in the keys to decide how to interpret them.\n\n## Performance\n\nPerformance can be tuned by changing the default values of the types defined in\n`include/leveldb/options.h`.\n\n### Block size\n\nleveldb groups adjacent keys together into the same block and such a block is\nthe unit of transfer to and from persistent storage. The default block size is\napproximately 4096 uncompressed bytes.  Applications that mostly do bulk scans\nover the contents of the database may wish to increase this size. Applications\nthat do a lot of point reads of small values may wish to switch to a smaller\nblock size if performance measurements indicate an improvement. There isn't much\nbenefit in using blocks smaller than one kilobyte, or larger than a few\nmegabytes. Also note that compression will be more effective with larger block\nsizes.\n\n### Compression\n\nEach block is individually compressed before being written to persistent\nstorage. Compression is on by default since the default compression method is\nvery fast, and is automatically disabled for uncompressible data. In rare cases,\napplications may want to disable compression entirely, but should only do so if\nbenchmarks show a performance improvement:\n\n```c++\nleveldb::Options options;\noptions.compression = leveldb::kNoCompression;\n... leveldb::DB::Open(options, name, ...) ....\n```\n\n### Cache\n\nThe contents of the database are stored in a set of files in the filesystem and\neach file stores a sequence of compressed blocks. If options.cache is non-NULL,\nit is used to cache frequently used uncompressed block contents.\n\n```c++\n#include \"leveldb/cache.h\"\n\nleveldb::Options options;\noptions.cache = leveldb::NewLRUCache(100 * 1048576);  // 100MB cache\nleveldb::DB* db;\nleveldb::DB::Open(options, name, &db);\n... use the db ...\ndelete db\ndelete options.cache;\n```\n\nNote that the cache holds uncompressed data, and therefore it should be sized\naccording to application level data sizes, without any reduction from\ncompression. (Caching of compressed blocks is left to the operating system\nbuffer cache, or any custom Env implementation provided by the client.)\n\nWhen performing a bulk read, the application may wish to disable caching so that\nthe data processed by the bulk read does not end up displacing most of the\ncached contents. A per-iterator option can be used to achieve this:\n\n```c++\nleveldb::ReadOptions options;\noptions.fill_cache = false;\nleveldb::Iterator* it = db->NewIterator(options);\nfor (it->SeekToFirst(); it->Valid(); it->Next()) {\n  ...\n}\n```\n\n### Key Layout\n\nNote that the unit of disk transfer and caching is a block. Adjacent keys\n(according to the database sort order) will usually be placed in the same block.\nTherefore the application can improve its performance by placing keys that are\naccessed together near each other and placing infrequently used keys in a\nseparate region of the key space.\n\nFor example, suppose we are implementing a simple file system on top of leveldb.\nThe types of entries we might wish to store are:\n\n    filename -> permission-bits, length, list of file_block_ids\n    file_block_id -> data\n\nWe might want to prefix filename keys with one letter (say '/') and the\n`file_block_id` keys with a different letter (say '0') so that scans over just\nthe metadata do not force us to fetch and cache bulky file contents.\n\n### Filters\n\nBecause of the way leveldb data is organized on disk, a single `Get()` call may\ninvolve multiple reads from disk. The optional FilterPolicy mechanism can be\nused to reduce the number of disk reads substantially.\n\n```c++\nleveldb::Options options;\noptions.filter_policy = NewBloomFilterPolicy(10);\nleveldb::DB* db;\nleveldb::DB::Open(options, \"/tmp/testdb\", &db);\n... use the database ...\ndelete db;\ndelete options.filter_policy;\n```\n\nThe preceding code associates a Bloom filter based filtering policy with the\ndatabase.  Bloom filter based filtering relies on keeping some number of bits of\ndata in memory per key (in this case 10 bits per key since that is the argument\nwe passed to `NewBloomFilterPolicy`). This filter will reduce the number of\nunnecessary disk reads needed for Get() calls by a factor of approximately\na 100. Increasing the bits per key will lead to a larger reduction at the cost\nof more memory usage. We recommend that applications whose working set does not\nfit in memory and that do a lot of random reads set a filter policy.\n\nIf you are using a custom comparator, you should ensure that the filter policy\nyou are using is compatible with your comparator. For example, consider a\ncomparator that ignores trailing spaces when comparing keys.\n`NewBloomFilterPolicy` must not be used with such a comparator. Instead, the\napplication should provide a custom filter policy that also ignores trailing\nspaces. For example:\n\n```c++\nclass CustomFilterPolicy : public leveldb::FilterPolicy {\n private:\n  FilterPolicy* builtin_policy_;\n\n public:\n  CustomFilterPolicy() : builtin_policy_(NewBloomFilterPolicy(10)) {}\n  ~CustomFilterPolicy() { delete builtin_policy_; }\n\n  const char* Name() const { return \"IgnoreTrailingSpacesFilter\"; }\n\n  void CreateFilter(const Slice* keys, int n, std::string* dst) const {\n    // Use builtin bloom filter code after removing trailing spaces\n    std::vector<Slice> trimmed(n);\n    for (int i = 0; i < n; i++) {\n      trimmed[i] = RemoveTrailingSpaces(keys[i]);\n    }\n    return builtin_policy_->CreateFilter(&trimmed[i], n, dst);\n  }\n};\n```\n\nAdvanced applications may provide a filter policy that does not use a bloom\nfilter but uses some other mechanism for summarizing a set of keys. See\n`leveldb/filter_policy.h` for detail.\n\n## Checksums\n\nleveldb associates checksums with all data it stores in the file system. There\nare two separate controls provided over how aggressively these checksums are\nverified:\n\n`ReadOptions::verify_checksums` may be set to true to force checksum\nverification of all data that is read from the file system on behalf of a\nparticular read.  By default, no such verification is done.\n\n`Options::paranoid_checks` may be set to true before opening a database to make\nthe database implementation raise an error as soon as it detects an internal\ncorruption. Depending on which portion of the database has been corrupted, the\nerror may be raised when the database is opened, or later by another database\noperation. By default, paranoid checking is off so that the database can be used\neven if parts of its persistent storage have been corrupted.\n\nIf a database is corrupted (perhaps it cannot be opened when paranoid checking\nis turned on), the `leveldb::RepairDB` function may be used to recover as much\nof the data as possible\n\n## Approximate Sizes\n\nThe `GetApproximateSizes` method can used to get the approximate number of bytes\nof file system space used by one or more key ranges.\n\n```c++\nleveldb::Range ranges[2];\nranges[0] = leveldb::Range(\"a\", \"c\");\nranges[1] = leveldb::Range(\"x\", \"z\");\nuint64_t sizes[2];\nleveldb::Status s = db->GetApproximateSizes(ranges, 2, sizes);\n```\n\nThe preceding call will set `sizes[0]` to the approximate number of bytes of\nfile system space used by the key range `[a..c)` and `sizes[1]` to the\napproximate number of bytes used by the key range `[x..z)`.\n\n## Environment\n\nAll file operations (and other operating system calls) issued by the leveldb\nimplementation are routed through a `leveldb::Env` object. Sophisticated clients\nmay wish to provide their own Env implementation to get better control.\nFor example, an application may introduce artificial delays in the file IO\npaths to limit the impact of leveldb on other activities in the system.\n\n```c++\nclass SlowEnv : public leveldb::Env {\n  ... implementation of the Env interface ...\n};\n\nSlowEnv env;\nleveldb::Options options;\noptions.env = &env;\nStatus s = leveldb::DB::Open(options, ...);\n```\n\n## Porting\n\nleveldb may be ported to a new platform by providing platform specific\nimplementations of the types/methods/functions exported by\n`leveldb/port/port.h`.  See `leveldb/port/port_example.h` for more details.\n\nIn addition, the new platform may need a new default `leveldb::Env`\nimplementation.  See `leveldb/util/env_posix.h` for an example.\n\n## Other Information\n\nDetails about the leveldb implementation may be found in the following\ndocuments:\n\n1. [Implementation notes](impl.md)\n2. [Format of an immutable Table file](table_format.md)\n3. [Format of a log file](log_format.md)\n"
  },
  {
    "path": "src/leveldb/doc/log_format.md",
    "content": "leveldb Log format\n==================\nThe log file contents are a sequence of 32KB blocks.  The only exception is that\nthe tail of the file may contain a partial block.\n\nEach block consists of a sequence of records:\n\n    block := record* trailer?\n    record :=\n      checksum: uint32     // crc32c of type and data[] ; little-endian\n      length: uint16       // little-endian\n      type: uint8          // One of FULL, FIRST, MIDDLE, LAST\n      data: uint8[length]\n\nA record never starts within the last six bytes of a block (since it won't fit).\nAny leftover bytes here form the trailer, which must consist entirely of zero\nbytes and must be skipped by readers.\n\nAside: if exactly seven bytes are left in the current block, and a new non-zero\nlength record is added, the writer must emit a FIRST record (which contains zero\nbytes of user data) to fill up the trailing seven bytes of the block and then\nemit all of the user data in subsequent blocks.\n\nMore types may be added in the future.  Some Readers may skip record types they\ndo not understand, others may report that some data was skipped.\n\n    FULL == 1\n    FIRST == 2\n    MIDDLE == 3\n    LAST == 4\n\nThe FULL record contains the contents of an entire user record.\n\nFIRST, MIDDLE, LAST are types used for user records that have been split into\nmultiple fragments (typically because of block boundaries).  FIRST is the type\nof the first fragment of a user record, LAST is the type of the last fragment of\na user record, and MIDDLE is the type of all interior fragments of a user\nrecord.\n\nExample: consider a sequence of user records:\n\n    A: length 1000\n    B: length 97270\n    C: length 8000\n\n**A** will be stored as a FULL record in the first block.\n\n**B** will be split into three fragments: first fragment occupies the rest of\nthe first block, second fragment occupies the entirety of the second block, and\nthe third fragment occupies a prefix of the third block.  This will leave six\nbytes free in the third block, which will be left empty as the trailer.\n\n**C** will be stored as a FULL record in the fourth block.\n\n----\n\n## Some benefits over the recordio format:\n\n1. We do not need any heuristics for resyncing - just go to next block boundary\n   and scan.  If there is a corruption, skip to the next block.  As a\n   side-benefit, we do not get confused when part of the contents of one log\n   file are embedded as a record inside another log file.\n\n2. Splitting at approximate boundaries (e.g., for mapreduce) is simple: find the\n   next block boundary and skip records until we hit a FULL or FIRST record.\n\n3. We do not need extra buffering for large records.\n\n## Some downsides compared to recordio format:\n\n1. No packing of tiny records.  This could be fixed by adding a new record type,\n   so it is a shortcoming of the current implementation, not necessarily the\n   format.\n\n2. No compression.  Again, this could be fixed by adding new record types.\n"
  },
  {
    "path": "src/leveldb/doc/table_format.md",
    "content": "leveldb File format\n===================\n\n    <beginning_of_file>\n    [data block 1]\n    [data block 2]\n    ...\n    [data block N]\n    [meta block 1]\n    ...\n    [meta block K]\n    [metaindex block]\n    [index block]\n    [Footer]        (fixed size; starts at file_size - sizeof(Footer))\n    <end_of_file>\n\nThe file contains internal pointers.  Each such pointer is called\na BlockHandle and contains the following information:\n\n    offset:   varint64\n    size:     varint64\n\nSee [varints](https://developers.google.com/protocol-buffers/docs/encoding#varints)\nfor an explanation of varint64 format.\n\n1.  The sequence of key/value pairs in the file are stored in sorted\norder and partitioned into a sequence of data blocks.  These blocks\ncome one after another at the beginning of the file.  Each data block\nis formatted according to the code in `block_builder.cc`, and then\noptionally compressed.\n\n2. After the data blocks we store a bunch of meta blocks.  The\nsupported meta block types are described below.  More meta block types\nmay be added in the future.  Each meta block is again formatted using\n`block_builder.cc` and then optionally compressed.\n\n3. A \"metaindex\" block.  It contains one entry for every other meta\nblock where the key is the name of the meta block and the value is a\nBlockHandle pointing to that meta block.\n\n4. An \"index\" block.  This block contains one entry per data block,\nwhere the key is a string >= last key in that data block and before\nthe first key in the successive data block.  The value is the\nBlockHandle for the data block.\n\n5. At the very end of the file is a fixed length footer that contains\nthe BlockHandle of the metaindex and index blocks as well as a magic number.\n\n        metaindex_handle: char[p];     // Block handle for metaindex\n        index_handle:     char[q];     // Block handle for index\n        padding:          char[40-p-q];// zeroed bytes to make fixed length\n                                       // (40==2*BlockHandle::kMaxEncodedLength)\n        magic:            fixed64;     // == 0xdb4775248b80fb57 (little-endian)\n\n## \"filter\" Meta Block\n\nIf a `FilterPolicy` was specified when the database was opened, a\nfilter block is stored in each table.  The \"metaindex\" block contains\nan entry that maps from `filter.<N>` to the BlockHandle for the filter\nblock where `<N>` is the string returned by the filter policy's\n`Name()` method.\n\nThe filter block stores a sequence of filters, where filter i contains\nthe output of `FilterPolicy::CreateFilter()` on all keys that are stored\nin a block whose file offset falls within the range\n\n    [ i*base ... (i+1)*base-1 ]\n\nCurrently, \"base\" is 2KB.  So for example, if blocks X and Y start in\nthe range `[ 0KB .. 2KB-1 ]`, all of the keys in X and Y will be\nconverted to a filter by calling `FilterPolicy::CreateFilter()`, and the\nresulting filter will be stored as the first filter in the filter\nblock.\n\nThe filter block is formatted as follows:\n\n    [filter 0]\n    [filter 1]\n    [filter 2]\n    ...\n    [filter N-1]\n\n    [offset of filter 0]                  : 4 bytes\n    [offset of filter 1]                  : 4 bytes\n    [offset of filter 2]                  : 4 bytes\n    ...\n    [offset of filter N-1]                : 4 bytes\n\n    [offset of beginning of offset array] : 4 bytes\n    lg(base)                              : 1 byte\n\nThe offset array at the end of the filter block allows efficient\nmapping from a data block offset to the corresponding filter.\n\n## \"stats\" Meta Block\n\nThis meta block contains a bunch of stats.  The key is the name\nof the statistic.  The value contains the statistic.\n\nTODO(postrelease): record following stats.\n\n    data size\n    index size\n    key size (uncompressed)\n    value size (uncompressed)\n    number of entries\n    number of data blocks\n"
  },
  {
    "path": "src/leveldb/helpers/memenv/memenv.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"helpers/memenv/memenv.h\"\n\n#include \"leveldb/env.h\"\n#include \"leveldb/status.h\"\n#include \"port/port.h\"\n#include \"util/mutexlock.h\"\n#include <map>\n#include <string.h>\n#include <string>\n#include <vector>\n\nnamespace leveldb {\n\nnamespace {\n\nclass FileState {\n public:\n  // FileStates are reference counted. The initial reference count is zero\n  // and the caller must call Ref() at least once.\n  FileState() : refs_(0), size_(0) {}\n\n  // Increase the reference count.\n  void Ref() {\n    MutexLock lock(&refs_mutex_);\n    ++refs_;\n  }\n\n  // Decrease the reference count. Delete if this is the last reference.\n  void Unref() {\n    bool do_delete = false;\n\n    {\n      MutexLock lock(&refs_mutex_);\n      --refs_;\n      assert(refs_ >= 0);\n      if (refs_ <= 0) {\n        do_delete = true;\n      }\n    }\n\n    if (do_delete) {\n      delete this;\n    }\n  }\n\n  uint64_t Size() const { return size_; }\n\n  Status Read(uint64_t offset, size_t n, Slice* result, char* scratch) const {\n    if (offset > size_) {\n      return Status::IOError(\"Offset greater than file size.\");\n    }\n    const uint64_t available = size_ - offset;\n    if (n > available) {\n      n = static_cast<size_t>(available);\n    }\n    if (n == 0) {\n      *result = Slice();\n      return Status::OK();\n    }\n\n    assert(offset / kBlockSize <= SIZE_MAX);\n    size_t block = static_cast<size_t>(offset / kBlockSize);\n    size_t block_offset = offset % kBlockSize;\n\n    if (n <= kBlockSize - block_offset) {\n      // The requested bytes are all in the first block.\n      *result = Slice(blocks_[block] + block_offset, n);\n      return Status::OK();\n    }\n\n    size_t bytes_to_copy = n;\n    char* dst = scratch;\n\n    while (bytes_to_copy > 0) {\n      size_t avail = kBlockSize - block_offset;\n      if (avail > bytes_to_copy) {\n        avail = bytes_to_copy;\n      }\n      memcpy(dst, blocks_[block] + block_offset, avail);\n\n      bytes_to_copy -= avail;\n      dst += avail;\n      block++;\n      block_offset = 0;\n    }\n\n    *result = Slice(scratch, n);\n    return Status::OK();\n  }\n\n  Status Append(const Slice& data) {\n    const char* src = data.data();\n    size_t src_len = data.size();\n\n    while (src_len > 0) {\n      size_t avail;\n      size_t offset = size_ % kBlockSize;\n\n      if (offset != 0) {\n        // There is some room in the last block.\n        avail = kBlockSize - offset;\n      } else {\n        // No room in the last block; push new one.\n        blocks_.push_back(new char[kBlockSize]);\n        avail = kBlockSize;\n      }\n\n      if (avail > src_len) {\n        avail = src_len;\n      }\n      memcpy(blocks_.back() + offset, src, avail);\n      src_len -= avail;\n      src += avail;\n      size_ += avail;\n    }\n\n    return Status::OK();\n  }\n\n private:\n  // Private since only Unref() should be used to delete it.\n  ~FileState() {\n    for (std::vector<char*>::iterator i = blocks_.begin(); i != blocks_.end();\n         ++i) {\n      delete [] *i;\n    }\n  }\n\n  // No copying allowed.\n  FileState(const FileState&);\n  void operator=(const FileState&);\n\n  port::Mutex refs_mutex_;\n  int refs_;  // Protected by refs_mutex_;\n\n  // The following fields are not protected by any mutex. They are only mutable\n  // while the file is being written, and concurrent access is not allowed\n  // to writable files.\n  std::vector<char*> blocks_;\n  uint64_t size_;\n\n  enum { kBlockSize = 8 * 1024 };\n};\n\nclass SequentialFileImpl : public SequentialFile {\n public:\n  explicit SequentialFileImpl(FileState* file) : file_(file), pos_(0) {\n    file_->Ref();\n  }\n\n  ~SequentialFileImpl() {\n    file_->Unref();\n  }\n\n  virtual Status Read(size_t n, Slice* result, char* scratch) {\n    Status s = file_->Read(pos_, n, result, scratch);\n    if (s.ok()) {\n      pos_ += result->size();\n    }\n    return s;\n  }\n\n  virtual Status Skip(uint64_t n) {\n    if (pos_ > file_->Size()) {\n      return Status::IOError(\"pos_ > file_->Size()\");\n    }\n    const uint64_t available = file_->Size() - pos_;\n    if (n > available) {\n      n = available;\n    }\n    pos_ += n;\n    return Status::OK();\n  }\n\n  virtual std::string GetName() const { return \"[memenv]\"; }\n private:\n  FileState* file_;\n  uint64_t pos_;\n};\n\nclass RandomAccessFileImpl : public RandomAccessFile {\n public:\n  explicit RandomAccessFileImpl(FileState* file) : file_(file) {\n    file_->Ref();\n  }\n\n  ~RandomAccessFileImpl() {\n    file_->Unref();\n  }\n\n  virtual Status Read(uint64_t offset, size_t n, Slice* result,\n                      char* scratch) const {\n    return file_->Read(offset, n, result, scratch);\n  }\n\n  virtual std::string GetName() const { return \"[memenv]\"; }\n private:\n  FileState* file_;\n};\n\nclass WritableFileImpl : public WritableFile {\n public:\n  WritableFileImpl(FileState* file) : file_(file) {\n    file_->Ref();\n  }\n\n  ~WritableFileImpl() {\n    file_->Unref();\n  }\n\n  virtual Status Append(const Slice& data) {\n    return file_->Append(data);\n  }\n\n  virtual Status Close() { return Status::OK(); }\n  virtual Status Flush() { return Status::OK(); }\n  virtual Status Sync() { return Status::OK(); }\n\n  virtual std::string GetName() const { return \"[memenv]\"; }\n private:\n  FileState* file_;\n};\n\nclass NoOpLogger : public Logger {\n public:\n  virtual void Logv(const char* format, va_list ap) { }\n};\n\nclass InMemoryEnv : public EnvWrapper {\n public:\n  explicit InMemoryEnv(Env* base_env) : EnvWrapper(base_env) { }\n\n  virtual ~InMemoryEnv() {\n    for (FileSystem::iterator i = file_map_.begin(); i != file_map_.end(); ++i){\n      i->second->Unref();\n    }\n  }\n\n  // Partial implementation of the Env interface.\n  virtual Status NewSequentialFile(const std::string& fname,\n                                   SequentialFile** result) {\n    MutexLock lock(&mutex_);\n    if (file_map_.find(fname) == file_map_.end()) {\n      *result = NULL;\n      return Status::IOError(fname, \"File not found\");\n    }\n\n    *result = new SequentialFileImpl(file_map_[fname]);\n    return Status::OK();\n  }\n\n  virtual Status NewRandomAccessFile(const std::string& fname,\n                                     RandomAccessFile** result) {\n    MutexLock lock(&mutex_);\n    if (file_map_.find(fname) == file_map_.end()) {\n      *result = NULL;\n      return Status::IOError(fname, \"File not found\");\n    }\n\n    *result = new RandomAccessFileImpl(file_map_[fname]);\n    return Status::OK();\n  }\n\n  virtual Status NewWritableFile(const std::string& fname,\n                                 WritableFile** result) {\n    MutexLock lock(&mutex_);\n    if (file_map_.find(fname) != file_map_.end()) {\n      DeleteFileInternal(fname);\n    }\n\n    FileState* file = new FileState();\n    file->Ref();\n    file_map_[fname] = file;\n\n    *result = new WritableFileImpl(file);\n    return Status::OK();\n  }\n\n  virtual Status NewAppendableFile(const std::string& fname,\n                                   WritableFile** result) {\n    MutexLock lock(&mutex_);\n    FileState** sptr = &file_map_[fname];\n    FileState* file = *sptr;\n    if (file == NULL) {\n      file = new FileState();\n      file->Ref();\n    }\n    *result = new WritableFileImpl(file);\n    return Status::OK();\n  }\n\n  virtual bool FileExists(const std::string& fname) {\n    MutexLock lock(&mutex_);\n    return file_map_.find(fname) != file_map_.end();\n  }\n\n  virtual Status GetChildren(const std::string& dir,\n                             std::vector<std::string>* result) {\n    MutexLock lock(&mutex_);\n    result->clear();\n\n    for (FileSystem::iterator i = file_map_.begin(); i != file_map_.end(); ++i){\n      const std::string& filename = i->first;\n\n      if (filename.size() >= dir.size() + 1 && filename[dir.size()] == '/' &&\n          Slice(filename).starts_with(Slice(dir))) {\n        result->push_back(filename.substr(dir.size() + 1));\n      }\n    }\n\n    return Status::OK();\n  }\n\n  void DeleteFileInternal(const std::string& fname) {\n    if (file_map_.find(fname) == file_map_.end()) {\n      return;\n    }\n\n    file_map_[fname]->Unref();\n    file_map_.erase(fname);\n  }\n\n  virtual Status DeleteFile(const std::string& fname) {\n    MutexLock lock(&mutex_);\n    if (file_map_.find(fname) == file_map_.end()) {\n      return Status::IOError(fname, \"File not found\");\n    }\n\n    DeleteFileInternal(fname);\n    return Status::OK();\n  }\n\n  virtual Status CreateDir(const std::string& dirname) {\n    return Status::OK();\n  }\n\n  virtual Status DeleteDir(const std::string& dirname) {\n    return Status::OK();\n  }\n\n  virtual Status GetFileSize(const std::string& fname, uint64_t* file_size) {\n    MutexLock lock(&mutex_);\n    if (file_map_.find(fname) == file_map_.end()) {\n      return Status::IOError(fname, \"File not found\");\n    }\n\n    *file_size = file_map_[fname]->Size();\n    return Status::OK();\n  }\n\n  virtual Status RenameFile(const std::string& src,\n                            const std::string& target) {\n    MutexLock lock(&mutex_);\n    if (file_map_.find(src) == file_map_.end()) {\n      return Status::IOError(src, \"File not found\");\n    }\n\n    DeleteFileInternal(target);\n    file_map_[target] = file_map_[src];\n    file_map_.erase(src);\n    return Status::OK();\n  }\n\n  virtual Status LockFile(const std::string& fname, FileLock** lock) {\n    *lock = new FileLock;\n    return Status::OK();\n  }\n\n  virtual Status UnlockFile(FileLock* lock) {\n    delete lock;\n    return Status::OK();\n  }\n\n  virtual Status GetTestDirectory(std::string* path) {\n    *path = \"/test\";\n    return Status::OK();\n  }\n\n  virtual Status NewLogger(const std::string& fname, Logger** result) {\n    *result = new NoOpLogger;\n    return Status::OK();\n  }\n\n private:\n  // Map from filenames to FileState objects, representing a simple file system.\n  typedef std::map<std::string, FileState*> FileSystem;\n  port::Mutex mutex_;\n  FileSystem file_map_;  // Protected by mutex_.\n};\n\n}  // namespace\n\nEnv* NewMemEnv(Env* base_env) {\n  return new InMemoryEnv(base_env);\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/helpers/memenv/memenv.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_\n#define STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_\n\nnamespace leveldb {\n\nclass Env;\n\n// Returns a new environment that stores its data in memory and delegates\n// all non-file-storage tasks to base_env. The caller must delete the result\n// when it is no longer needed.\n// *base_env must remain live while the result is in use.\nEnv* NewMemEnv(Env* base_env);\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_\n"
  },
  {
    "path": "src/leveldb/helpers/memenv/memenv_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"helpers/memenv/memenv.h\"\n\n#include \"db/db_impl.h\"\n#include \"leveldb/db.h\"\n#include \"leveldb/env.h\"\n#include \"util/testharness.h\"\n#include <string>\n#include <vector>\n\nnamespace leveldb {\n\nclass MemEnvTest {\n public:\n  Env* env_;\n\n  MemEnvTest()\n      : env_(NewMemEnv(Env::Default())) {\n  }\n  ~MemEnvTest() {\n    delete env_;\n  }\n};\n\nTEST(MemEnvTest, Basics) {\n  uint64_t file_size;\n  WritableFile* writable_file;\n  std::vector<std::string> children;\n\n  ASSERT_OK(env_->CreateDir(\"/dir\"));\n\n  // Check that the directory is empty.\n  ASSERT_TRUE(!env_->FileExists(\"/dir/non_existent\"));\n  ASSERT_TRUE(!env_->GetFileSize(\"/dir/non_existent\", &file_size).ok());\n  ASSERT_OK(env_->GetChildren(\"/dir\", &children));\n  ASSERT_EQ(0, children.size());\n\n  // Create a file.\n  ASSERT_OK(env_->NewWritableFile(\"/dir/f\", &writable_file));\n  ASSERT_OK(env_->GetFileSize(\"/dir/f\", &file_size));\n  ASSERT_EQ(0, file_size);\n  delete writable_file;\n\n  // Check that the file exists.\n  ASSERT_TRUE(env_->FileExists(\"/dir/f\"));\n  ASSERT_OK(env_->GetFileSize(\"/dir/f\", &file_size));\n  ASSERT_EQ(0, file_size);\n  ASSERT_OK(env_->GetChildren(\"/dir\", &children));\n  ASSERT_EQ(1, children.size());\n  ASSERT_EQ(\"f\", children[0]);\n\n  // Write to the file.\n  ASSERT_OK(env_->NewWritableFile(\"/dir/f\", &writable_file));\n  ASSERT_OK(writable_file->Append(\"abc\"));\n  delete writable_file;\n\n  // Check that append works.\n  ASSERT_OK(env_->NewAppendableFile(\"/dir/f\", &writable_file));\n  ASSERT_OK(env_->GetFileSize(\"/dir/f\", &file_size));\n  ASSERT_EQ(3, file_size);\n  ASSERT_OK(writable_file->Append(\"hello\"));\n  delete writable_file;\n\n  // Check for expected size.\n  ASSERT_OK(env_->GetFileSize(\"/dir/f\", &file_size));\n  ASSERT_EQ(8, file_size);\n\n  // Check that renaming works.\n  ASSERT_TRUE(!env_->RenameFile(\"/dir/non_existent\", \"/dir/g\").ok());\n  ASSERT_OK(env_->RenameFile(\"/dir/f\", \"/dir/g\"));\n  ASSERT_TRUE(!env_->FileExists(\"/dir/f\"));\n  ASSERT_TRUE(env_->FileExists(\"/dir/g\"));\n  ASSERT_OK(env_->GetFileSize(\"/dir/g\", &file_size));\n  ASSERT_EQ(8, file_size);\n\n  // Check that opening non-existent file fails.\n  SequentialFile* seq_file;\n  RandomAccessFile* rand_file;\n  ASSERT_TRUE(!env_->NewSequentialFile(\"/dir/non_existent\", &seq_file).ok());\n  ASSERT_TRUE(!seq_file);\n  ASSERT_TRUE(!env_->NewRandomAccessFile(\"/dir/non_existent\", &rand_file).ok());\n  ASSERT_TRUE(!rand_file);\n\n  // Check that deleting works.\n  ASSERT_TRUE(!env_->DeleteFile(\"/dir/non_existent\").ok());\n  ASSERT_OK(env_->DeleteFile(\"/dir/g\"));\n  ASSERT_TRUE(!env_->FileExists(\"/dir/g\"));\n  ASSERT_OK(env_->GetChildren(\"/dir\", &children));\n  ASSERT_EQ(0, children.size());\n  ASSERT_OK(env_->DeleteDir(\"/dir\"));\n}\n\nTEST(MemEnvTest, ReadWrite) {\n  WritableFile* writable_file;\n  SequentialFile* seq_file;\n  RandomAccessFile* rand_file;\n  Slice result;\n  char scratch[100];\n\n  ASSERT_OK(env_->CreateDir(\"/dir\"));\n\n  ASSERT_OK(env_->NewWritableFile(\"/dir/f\", &writable_file));\n  ASSERT_OK(writable_file->Append(\"hello \"));\n  ASSERT_OK(writable_file->Append(\"world\"));\n  delete writable_file;\n\n  // Read sequentially.\n  ASSERT_OK(env_->NewSequentialFile(\"/dir/f\", &seq_file));\n  ASSERT_OK(seq_file->Read(5, &result, scratch)); // Read \"hello\".\n  ASSERT_EQ(0, result.compare(\"hello\"));\n  ASSERT_OK(seq_file->Skip(1));\n  ASSERT_OK(seq_file->Read(1000, &result, scratch)); // Read \"world\".\n  ASSERT_EQ(0, result.compare(\"world\"));\n  ASSERT_OK(seq_file->Read(1000, &result, scratch)); // Try reading past EOF.\n  ASSERT_EQ(0, result.size());\n  ASSERT_OK(seq_file->Skip(100)); // Try to skip past end of file.\n  ASSERT_OK(seq_file->Read(1000, &result, scratch));\n  ASSERT_EQ(0, result.size());\n  delete seq_file;\n\n  // Random reads.\n  ASSERT_OK(env_->NewRandomAccessFile(\"/dir/f\", &rand_file));\n  ASSERT_OK(rand_file->Read(6, 5, &result, scratch)); // Read \"world\".\n  ASSERT_EQ(0, result.compare(\"world\"));\n  ASSERT_OK(rand_file->Read(0, 5, &result, scratch)); // Read \"hello\".\n  ASSERT_EQ(0, result.compare(\"hello\"));\n  ASSERT_OK(rand_file->Read(10, 100, &result, scratch)); // Read \"d\".\n  ASSERT_EQ(0, result.compare(\"d\"));\n\n  // Too high offset.\n  ASSERT_TRUE(!rand_file->Read(1000, 5, &result, scratch).ok());\n  delete rand_file;\n}\n\nTEST(MemEnvTest, Locks) {\n  FileLock* lock;\n\n  // These are no-ops, but we test they return success.\n  ASSERT_OK(env_->LockFile(\"some file\", &lock));\n  ASSERT_OK(env_->UnlockFile(lock));\n}\n\nTEST(MemEnvTest, Misc) {\n  std::string test_dir;\n  ASSERT_OK(env_->GetTestDirectory(&test_dir));\n  ASSERT_TRUE(!test_dir.empty());\n\n  WritableFile* writable_file;\n  ASSERT_OK(env_->NewWritableFile(\"/a/b\", &writable_file));\n\n  // These are no-ops, but we test they return success.\n  ASSERT_OK(writable_file->Sync());\n  ASSERT_OK(writable_file->Flush());\n  ASSERT_OK(writable_file->Close());\n  delete writable_file;\n}\n\nTEST(MemEnvTest, LargeWrite) {\n  const size_t kWriteSize = 300 * 1024;\n  char* scratch = new char[kWriteSize * 2];\n\n  std::string write_data;\n  for (size_t i = 0; i < kWriteSize; ++i) {\n    write_data.append(1, static_cast<char>(i));\n  }\n\n  WritableFile* writable_file;\n  ASSERT_OK(env_->NewWritableFile(\"/dir/f\", &writable_file));\n  ASSERT_OK(writable_file->Append(\"foo\"));\n  ASSERT_OK(writable_file->Append(write_data));\n  delete writable_file;\n\n  SequentialFile* seq_file;\n  Slice result;\n  ASSERT_OK(env_->NewSequentialFile(\"/dir/f\", &seq_file));\n  ASSERT_OK(seq_file->Read(3, &result, scratch)); // Read \"foo\".\n  ASSERT_EQ(0, result.compare(\"foo\"));\n\n  size_t read = 0;\n  std::string read_data;\n  while (read < kWriteSize) {\n    ASSERT_OK(seq_file->Read(kWriteSize - read, &result, scratch));\n    read_data.append(result.data(), result.size());\n    read += result.size();\n  }\n  ASSERT_TRUE(write_data == read_data);\n  delete seq_file;\n  delete [] scratch;\n}\n\nTEST(MemEnvTest, DBTest) {\n  Options options;\n  options.create_if_missing = true;\n  options.env = env_;\n  DB* db;\n\n  const Slice keys[] = {Slice(\"aaa\"), Slice(\"bbb\"), Slice(\"ccc\")};\n  const Slice vals[] = {Slice(\"foo\"), Slice(\"bar\"), Slice(\"baz\")};\n\n  ASSERT_OK(DB::Open(options, \"/dir/db\", &db));\n  for (size_t i = 0; i < 3; ++i) {\n    ASSERT_OK(db->Put(WriteOptions(), keys[i], vals[i]));\n  }\n\n  for (size_t i = 0; i < 3; ++i) {\n    std::string res;\n    ASSERT_OK(db->Get(ReadOptions(), keys[i], &res));\n    ASSERT_TRUE(res == vals[i]);\n  }\n\n  Iterator* iterator = db->NewIterator(ReadOptions());\n  iterator->SeekToFirst();\n  for (size_t i = 0; i < 3; ++i) {\n    ASSERT_TRUE(iterator->Valid());\n    ASSERT_TRUE(keys[i] == iterator->key());\n    ASSERT_TRUE(vals[i] == iterator->value());\n    iterator->Next();\n  }\n  ASSERT_TRUE(!iterator->Valid());\n  delete iterator;\n\n  DBImpl* dbi = reinterpret_cast<DBImpl*>(db);\n  ASSERT_OK(dbi->TEST_CompactMemTable());\n\n  for (size_t i = 0; i < 3; ++i) {\n    std::string res;\n    ASSERT_OK(db->Get(ReadOptions(), keys[i], &res));\n    ASSERT_TRUE(res == vals[i]);\n  }\n\n  delete db;\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/include/leveldb/c.h",
    "content": "/* Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n  Use of this source code is governed by a BSD-style license that can be\n  found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n  C bindings for leveldb.  May be useful as a stable ABI that can be\n  used by programs that keep leveldb in a shared library, or for\n  a JNI api.\n\n  Does not support:\n  . getters for the option types\n  . custom comparators that implement key shortening\n  . custom iter, db, env, cache implementations using just the C bindings\n\n  Some conventions:\n\n  (1) We expose just opaque struct pointers and functions to clients.\n  This allows us to change internal representations without having to\n  recompile clients.\n\n  (2) For simplicity, there is no equivalent to the Slice type.  Instead,\n  the caller has to pass the pointer and length as separate\n  arguments.\n\n  (3) Errors are represented by a null-terminated c string.  NULL\n  means no error.  All operations that can raise an error are passed\n  a \"char** errptr\" as the last argument.  One of the following must\n  be true on entry:\n     *errptr == NULL\n     *errptr points to a malloc()ed null-terminated error message\n       (On Windows, *errptr must have been malloc()-ed by this library.)\n  On success, a leveldb routine leaves *errptr unchanged.\n  On failure, leveldb frees the old value of *errptr and\n  set *errptr to a malloc()ed error message.\n\n  (4) Bools have the type unsigned char (0 == false; rest == true)\n\n  (5) All of the pointer arguments must be non-NULL.\n*/\n\n#ifndef STORAGE_LEVELDB_INCLUDE_C_H_\n#define STORAGE_LEVELDB_INCLUDE_C_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <stdarg.h>\n#include <stddef.h>\n#include <stdint.h>\n\n/* Exported types */\n\ntypedef struct leveldb_t               leveldb_t;\ntypedef struct leveldb_cache_t         leveldb_cache_t;\ntypedef struct leveldb_comparator_t    leveldb_comparator_t;\ntypedef struct leveldb_env_t           leveldb_env_t;\ntypedef struct leveldb_filelock_t      leveldb_filelock_t;\ntypedef struct leveldb_filterpolicy_t  leveldb_filterpolicy_t;\ntypedef struct leveldb_iterator_t      leveldb_iterator_t;\ntypedef struct leveldb_logger_t        leveldb_logger_t;\ntypedef struct leveldb_options_t       leveldb_options_t;\ntypedef struct leveldb_randomfile_t    leveldb_randomfile_t;\ntypedef struct leveldb_readoptions_t   leveldb_readoptions_t;\ntypedef struct leveldb_seqfile_t       leveldb_seqfile_t;\ntypedef struct leveldb_snapshot_t      leveldb_snapshot_t;\ntypedef struct leveldb_writablefile_t  leveldb_writablefile_t;\ntypedef struct leveldb_writebatch_t    leveldb_writebatch_t;\ntypedef struct leveldb_writeoptions_t  leveldb_writeoptions_t;\n\n/* DB operations */\n\nextern leveldb_t* leveldb_open(\n    const leveldb_options_t* options,\n    const char* name,\n    char** errptr);\n\nextern void leveldb_close(leveldb_t* db);\n\nextern void leveldb_put(\n    leveldb_t* db,\n    const leveldb_writeoptions_t* options,\n    const char* key, size_t keylen,\n    const char* val, size_t vallen,\n    char** errptr);\n\nextern void leveldb_delete(\n    leveldb_t* db,\n    const leveldb_writeoptions_t* options,\n    const char* key, size_t keylen,\n    char** errptr);\n\nextern void leveldb_write(\n    leveldb_t* db,\n    const leveldb_writeoptions_t* options,\n    leveldb_writebatch_t* batch,\n    char** errptr);\n\n/* Returns NULL if not found.  A malloc()ed array otherwise.\n   Stores the length of the array in *vallen. */\nextern char* leveldb_get(\n    leveldb_t* db,\n    const leveldb_readoptions_t* options,\n    const char* key, size_t keylen,\n    size_t* vallen,\n    char** errptr);\n\nextern leveldb_iterator_t* leveldb_create_iterator(\n    leveldb_t* db,\n    const leveldb_readoptions_t* options);\n\nextern const leveldb_snapshot_t* leveldb_create_snapshot(\n    leveldb_t* db);\n\nextern void leveldb_release_snapshot(\n    leveldb_t* db,\n    const leveldb_snapshot_t* snapshot);\n\n/* Returns NULL if property name is unknown.\n   Else returns a pointer to a malloc()-ed null-terminated value. */\nextern char* leveldb_property_value(\n    leveldb_t* db,\n    const char* propname);\n\nextern void leveldb_approximate_sizes(\n    leveldb_t* db,\n    int num_ranges,\n    const char* const* range_start_key, const size_t* range_start_key_len,\n    const char* const* range_limit_key, const size_t* range_limit_key_len,\n    uint64_t* sizes);\n\nextern void leveldb_compact_range(\n    leveldb_t* db,\n    const char* start_key, size_t start_key_len,\n    const char* limit_key, size_t limit_key_len);\n\n/* Management operations */\n\nextern void leveldb_destroy_db(\n    const leveldb_options_t* options,\n    const char* name,\n    char** errptr);\n\nextern void leveldb_repair_db(\n    const leveldb_options_t* options,\n    const char* name,\n    char** errptr);\n\n/* Iterator */\n\nextern void leveldb_iter_destroy(leveldb_iterator_t*);\nextern unsigned char leveldb_iter_valid(const leveldb_iterator_t*);\nextern void leveldb_iter_seek_to_first(leveldb_iterator_t*);\nextern void leveldb_iter_seek_to_last(leveldb_iterator_t*);\nextern void leveldb_iter_seek(leveldb_iterator_t*, const char* k, size_t klen);\nextern void leveldb_iter_next(leveldb_iterator_t*);\nextern void leveldb_iter_prev(leveldb_iterator_t*);\nextern const char* leveldb_iter_key(const leveldb_iterator_t*, size_t* klen);\nextern const char* leveldb_iter_value(const leveldb_iterator_t*, size_t* vlen);\nextern void leveldb_iter_get_error(const leveldb_iterator_t*, char** errptr);\n\n/* Write batch */\n\nextern leveldb_writebatch_t* leveldb_writebatch_create();\nextern void leveldb_writebatch_destroy(leveldb_writebatch_t*);\nextern void leveldb_writebatch_clear(leveldb_writebatch_t*);\nextern void leveldb_writebatch_put(\n    leveldb_writebatch_t*,\n    const char* key, size_t klen,\n    const char* val, size_t vlen);\nextern void leveldb_writebatch_delete(\n    leveldb_writebatch_t*,\n    const char* key, size_t klen);\nextern void leveldb_writebatch_iterate(\n    leveldb_writebatch_t*,\n    void* state,\n    void (*put)(void*, const char* k, size_t klen, const char* v, size_t vlen),\n    void (*deleted)(void*, const char* k, size_t klen));\n\n/* Options */\n\nextern leveldb_options_t* leveldb_options_create();\nextern void leveldb_options_destroy(leveldb_options_t*);\nextern void leveldb_options_set_comparator(\n    leveldb_options_t*,\n    leveldb_comparator_t*);\nextern void leveldb_options_set_filter_policy(\n    leveldb_options_t*,\n    leveldb_filterpolicy_t*);\nextern void leveldb_options_set_create_if_missing(\n    leveldb_options_t*, unsigned char);\nextern void leveldb_options_set_error_if_exists(\n    leveldb_options_t*, unsigned char);\nextern void leveldb_options_set_paranoid_checks(\n    leveldb_options_t*, unsigned char);\nextern void leveldb_options_set_env(leveldb_options_t*, leveldb_env_t*);\nextern void leveldb_options_set_info_log(leveldb_options_t*, leveldb_logger_t*);\nextern void leveldb_options_set_write_buffer_size(leveldb_options_t*, size_t);\nextern void leveldb_options_set_max_open_files(leveldb_options_t*, int);\nextern void leveldb_options_set_cache(leveldb_options_t*, leveldb_cache_t*);\nextern void leveldb_options_set_block_size(leveldb_options_t*, size_t);\nextern void leveldb_options_set_block_restart_interval(leveldb_options_t*, int);\n\nenum {\n  leveldb_no_compression = 0,\n  leveldb_snappy_compression = 1\n};\nextern void leveldb_options_set_compression(leveldb_options_t*, int);\n\n/* Comparator */\n\nextern leveldb_comparator_t* leveldb_comparator_create(\n    void* state,\n    void (*destructor)(void*),\n    int (*compare)(\n        void*,\n        const char* a, size_t alen,\n        const char* b, size_t blen),\n    const char* (*name)(void*));\nextern void leveldb_comparator_destroy(leveldb_comparator_t*);\n\n/* Filter policy */\n\nextern leveldb_filterpolicy_t* leveldb_filterpolicy_create(\n    void* state,\n    void (*destructor)(void*),\n    char* (*create_filter)(\n        void*,\n        const char* const* key_array, const size_t* key_length_array,\n        int num_keys,\n        size_t* filter_length),\n    unsigned char (*key_may_match)(\n        void*,\n        const char* key, size_t length,\n        const char* filter, size_t filter_length),\n    const char* (*name)(void*));\nextern void leveldb_filterpolicy_destroy(leveldb_filterpolicy_t*);\n\nextern leveldb_filterpolicy_t* leveldb_filterpolicy_create_bloom(\n    int bits_per_key);\n\n/* Read options */\n\nextern leveldb_readoptions_t* leveldb_readoptions_create();\nextern void leveldb_readoptions_destroy(leveldb_readoptions_t*);\nextern void leveldb_readoptions_set_verify_checksums(\n    leveldb_readoptions_t*,\n    unsigned char);\nextern void leveldb_readoptions_set_fill_cache(\n    leveldb_readoptions_t*, unsigned char);\nextern void leveldb_readoptions_set_snapshot(\n    leveldb_readoptions_t*,\n    const leveldb_snapshot_t*);\n\n/* Write options */\n\nextern leveldb_writeoptions_t* leveldb_writeoptions_create();\nextern void leveldb_writeoptions_destroy(leveldb_writeoptions_t*);\nextern void leveldb_writeoptions_set_sync(\n    leveldb_writeoptions_t*, unsigned char);\n\n/* Cache */\n\nextern leveldb_cache_t* leveldb_cache_create_lru(size_t capacity);\nextern void leveldb_cache_destroy(leveldb_cache_t* cache);\n\n/* Env */\n\nextern leveldb_env_t* leveldb_create_default_env();\nextern void leveldb_env_destroy(leveldb_env_t*);\n\n/* Utility */\n\n/* Calls free(ptr).\n   REQUIRES: ptr was malloc()-ed and returned by one of the routines\n   in this file.  Note that in certain cases (typically on Windows), you\n   may need to call this routine instead of free(ptr) to dispose of\n   malloc()-ed memory returned by this library. */\nextern void leveldb_free(void* ptr);\n\n/* Return the major version number for this release. */\nextern int leveldb_major_version();\n\n/* Return the minor version number for this release. */\nextern int leveldb_minor_version();\n\n#ifdef __cplusplus\n}  /* end extern \"C\" */\n#endif\n\n#endif  /* STORAGE_LEVELDB_INCLUDE_C_H_ */\n"
  },
  {
    "path": "src/leveldb/include/leveldb/cache.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// A Cache is an interface that maps keys to values.  It has internal\n// synchronization and may be safely accessed concurrently from\n// multiple threads.  It may automatically evict entries to make room\n// for new entries.  Values have a specified charge against the cache\n// capacity.  For example, a cache where the values are variable\n// length strings, may use the length of the string as the charge for\n// the string.\n//\n// A builtin cache implementation with a least-recently-used eviction\n// policy is provided.  Clients may use their own implementations if\n// they want something more sophisticated (like scan-resistance, a\n// custom eviction policy, variable cache sizing, etc.)\n\n#ifndef STORAGE_LEVELDB_INCLUDE_CACHE_H_\n#define STORAGE_LEVELDB_INCLUDE_CACHE_H_\n\n#include <stdint.h>\n#include \"leveldb/slice.h\"\n\nnamespace leveldb {\n\nclass Cache;\n\n// Create a new cache with a fixed size capacity.  This implementation\n// of Cache uses a least-recently-used eviction policy.\nextern Cache* NewLRUCache(size_t capacity);\n\nclass Cache {\n public:\n  Cache() { }\n\n  // Destroys all existing entries by calling the \"deleter\"\n  // function that was passed to the constructor.\n  virtual ~Cache();\n\n  // Opaque handle to an entry stored in the cache.\n  struct Handle { };\n\n  // Insert a mapping from key->value into the cache and assign it\n  // the specified charge against the total cache capacity.\n  //\n  // Returns a handle that corresponds to the mapping.  The caller\n  // must call this->Release(handle) when the returned mapping is no\n  // longer needed.\n  //\n  // When the inserted entry is no longer needed, the key and\n  // value will be passed to \"deleter\".\n  virtual Handle* Insert(const Slice& key, void* value, size_t charge,\n                         void (*deleter)(const Slice& key, void* value)) = 0;\n\n  // If the cache has no mapping for \"key\", returns NULL.\n  //\n  // Else return a handle that corresponds to the mapping.  The caller\n  // must call this->Release(handle) when the returned mapping is no\n  // longer needed.\n  virtual Handle* Lookup(const Slice& key) = 0;\n\n  // Release a mapping returned by a previous Lookup().\n  // REQUIRES: handle must not have been released yet.\n  // REQUIRES: handle must have been returned by a method on *this.\n  virtual void Release(Handle* handle) = 0;\n\n  // Return the value encapsulated in a handle returned by a\n  // successful Lookup().\n  // REQUIRES: handle must not have been released yet.\n  // REQUIRES: handle must have been returned by a method on *this.\n  virtual void* Value(Handle* handle) = 0;\n\n  // If the cache contains entry for key, erase it.  Note that the\n  // underlying entry will be kept around until all existing handles\n  // to it have been released.\n  virtual void Erase(const Slice& key) = 0;\n\n  // Return a new numeric id.  May be used by multiple clients who are\n  // sharing the same cache to partition the key space.  Typically the\n  // client will allocate a new id at startup and prepend the id to\n  // its cache keys.\n  virtual uint64_t NewId() = 0;\n\n  // Remove all cache entries that are not actively in use.  Memory-constrained\n  // applications may wish to call this method to reduce memory usage.\n  // Default implementation of Prune() does nothing.  Subclasses are strongly\n  // encouraged to override the default implementation.  A future release of\n  // leveldb may change Prune() to a pure abstract method.\n  virtual void Prune() {}\n\n  // Return an estimate of the combined charges of all elements stored in the\n  // cache.\n  virtual size_t TotalCharge() const = 0;\n\n private:\n  void LRU_Remove(Handle* e);\n  void LRU_Append(Handle* e);\n  void Unref(Handle* e);\n\n  struct Rep;\n  Rep* rep_;\n\n  // No copying allowed\n  Cache(const Cache&);\n  void operator=(const Cache&);\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_CACHE_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/comparator.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_COMPARATOR_H_\n#define STORAGE_LEVELDB_INCLUDE_COMPARATOR_H_\n\n#include <string>\n\nnamespace leveldb {\n\nclass Slice;\n\n// A Comparator object provides a total order across slices that are\n// used as keys in an sstable or a database.  A Comparator implementation\n// must be thread-safe since leveldb may invoke its methods concurrently\n// from multiple threads.\nclass Comparator {\n public:\n  virtual ~Comparator();\n\n  // Three-way comparison.  Returns value:\n  //   < 0 iff \"a\" < \"b\",\n  //   == 0 iff \"a\" == \"b\",\n  //   > 0 iff \"a\" > \"b\"\n  virtual int Compare(const Slice& a, const Slice& b) const = 0;\n\n  // The name of the comparator.  Used to check for comparator\n  // mismatches (i.e., a DB created with one comparator is\n  // accessed using a different comparator.\n  //\n  // The client of this package should switch to a new name whenever\n  // the comparator implementation changes in a way that will cause\n  // the relative ordering of any two keys to change.\n  //\n  // Names starting with \"leveldb.\" are reserved and should not be used\n  // by any clients of this package.\n  virtual const char* Name() const = 0;\n\n  // Advanced functions: these are used to reduce the space requirements\n  // for internal data structures like index blocks.\n\n  // If *start < limit, changes *start to a short string in [start,limit).\n  // Simple comparator implementations may return with *start unchanged,\n  // i.e., an implementation of this method that does nothing is correct.\n  virtual void FindShortestSeparator(\n      std::string* start,\n      const Slice& limit) const = 0;\n\n  // Changes *key to a short string >= *key.\n  // Simple comparator implementations may return with *key unchanged,\n  // i.e., an implementation of this method that does nothing is correct.\n  virtual void FindShortSuccessor(std::string* key) const = 0;\n};\n\n// Return a builtin comparator that uses lexicographic byte-wise\n// ordering.  The result remains the property of this module and\n// must not be deleted.\nextern const Comparator* BytewiseComparator();\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_COMPARATOR_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/db.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_DB_H_\n#define STORAGE_LEVELDB_INCLUDE_DB_H_\n\n#include <stdint.h>\n#include <stdio.h>\n#include \"leveldb/iterator.h\"\n#include \"leveldb/options.h\"\n\nnamespace leveldb {\n\n// Update Makefile if you change these\nstatic const int kMajorVersion = 1;\nstatic const int kMinorVersion = 20;\n\nstruct Options;\nstruct ReadOptions;\nstruct WriteOptions;\nclass WriteBatch;\n\n// Abstract handle to particular state of a DB.\n// A Snapshot is an immutable object and can therefore be safely\n// accessed from multiple threads without any external synchronization.\nclass Snapshot {\n protected:\n  virtual ~Snapshot();\n};\n\n// A range of keys\nstruct Range {\n  Slice start;          // Included in the range\n  Slice limit;          // Not included in the range\n\n  Range() { }\n  Range(const Slice& s, const Slice& l) : start(s), limit(l) { }\n};\n\n// A DB is a persistent ordered map from keys to values.\n// A DB is safe for concurrent access from multiple threads without\n// any external synchronization.\nclass DB {\n public:\n  // Open the database with the specified \"name\".\n  // Stores a pointer to a heap-allocated database in *dbptr and returns\n  // OK on success.\n  // Stores NULL in *dbptr and returns a non-OK status on error.\n  // Caller should delete *dbptr when it is no longer needed.\n  static Status Open(const Options& options,\n                     const std::string& name,\n                     DB** dbptr);\n\n  DB() { }\n  virtual ~DB();\n\n  // Set the database entry for \"key\" to \"value\".  Returns OK on success,\n  // and a non-OK status on error.\n  // Note: consider setting options.sync = true.\n  virtual Status Put(const WriteOptions& options,\n                     const Slice& key,\n                     const Slice& value) = 0;\n\n  // Remove the database entry (if any) for \"key\".  Returns OK on\n  // success, and a non-OK status on error.  It is not an error if \"key\"\n  // did not exist in the database.\n  // Note: consider setting options.sync = true.\n  virtual Status Delete(const WriteOptions& options, const Slice& key) = 0;\n\n  // Apply the specified updates to the database.\n  // Returns OK on success, non-OK on failure.\n  // Note: consider setting options.sync = true.\n  virtual Status Write(const WriteOptions& options, WriteBatch* updates) = 0;\n\n  // If the database contains an entry for \"key\" store the\n  // corresponding value in *value and return OK.\n  //\n  // If there is no entry for \"key\" leave *value unchanged and return\n  // a status for which Status::IsNotFound() returns true.\n  //\n  // May return some other Status on an error.\n  virtual Status Get(const ReadOptions& options,\n                     const Slice& key, std::string* value) = 0;\n\n  // Return a heap-allocated iterator over the contents of the database.\n  // The result of NewIterator() is initially invalid (caller must\n  // call one of the Seek methods on the iterator before using it).\n  //\n  // Caller should delete the iterator when it is no longer needed.\n  // The returned iterator should be deleted before this db is deleted.\n  virtual Iterator* NewIterator(const ReadOptions& options) = 0;\n\n  // Return a handle to the current DB state.  Iterators created with\n  // this handle will all observe a stable snapshot of the current DB\n  // state.  The caller must call ReleaseSnapshot(result) when the\n  // snapshot is no longer needed.\n  virtual const Snapshot* GetSnapshot() = 0;\n\n  // Release a previously acquired snapshot.  The caller must not\n  // use \"snapshot\" after this call.\n  virtual void ReleaseSnapshot(const Snapshot* snapshot) = 0;\n\n  // DB implementations can export properties about their state\n  // via this method.  If \"property\" is a valid property understood by this\n  // DB implementation, fills \"*value\" with its current value and returns\n  // true.  Otherwise returns false.\n  //\n  //\n  // Valid property names include:\n  //\n  //  \"leveldb.num-files-at-level<N>\" - return the number of files at level <N>,\n  //     where <N> is an ASCII representation of a level number (e.g. \"0\").\n  //  \"leveldb.stats\" - returns a multi-line string that describes statistics\n  //     about the internal operation of the DB.\n  //  \"leveldb.sstables\" - returns a multi-line string that describes all\n  //     of the sstables that make up the db contents.\n  //  \"leveldb.approximate-memory-usage\" - returns the approximate number of\n  //     bytes of memory in use by the DB.\n  virtual bool GetProperty(const Slice& property, std::string* value) = 0;\n\n  // For each i in [0,n-1], store in \"sizes[i]\", the approximate\n  // file system space used by keys in \"[range[i].start .. range[i].limit)\".\n  //\n  // Note that the returned sizes measure file system space usage, so\n  // if the user data compresses by a factor of ten, the returned\n  // sizes will be one-tenth the size of the corresponding user data size.\n  //\n  // The results may not include the sizes of recently written data.\n  virtual void GetApproximateSizes(const Range* range, int n,\n                                   uint64_t* sizes) = 0;\n\n  // Compact the underlying storage for the key range [*begin,*end].\n  // In particular, deleted and overwritten versions are discarded,\n  // and the data is rearranged to reduce the cost of operations\n  // needed to access the data.  This operation should typically only\n  // be invoked by users who understand the underlying implementation.\n  //\n  // begin==NULL is treated as a key before all keys in the database.\n  // end==NULL is treated as a key after all keys in the database.\n  // Therefore the following call will compact the entire database:\n  //    db->CompactRange(NULL, NULL);\n  virtual void CompactRange(const Slice* begin, const Slice* end) = 0;\n\n private:\n  // No copying allowed\n  DB(const DB&);\n  void operator=(const DB&);\n};\n\n// Destroy the contents of the specified database.\n// Be very careful using this method.\nStatus DestroyDB(const std::string& name, const Options& options);\n\n// If a DB cannot be opened, you may attempt to call this method to\n// resurrect as much of the contents of the database as possible.\n// Some data may be lost, so be careful when calling this function\n// on a database that contains important information.\nStatus RepairDB(const std::string& dbname, const Options& options);\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_DB_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/dumpfile.h",
    "content": "// Copyright (c) 2014 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_\n#define STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_\n\n#include <string>\n#include \"leveldb/env.h\"\n#include \"leveldb/status.h\"\n\nnamespace leveldb {\n\n// Dump the contents of the file named by fname in text format to\n// *dst.  Makes a sequence of dst->Append() calls; each call is passed\n// the newline-terminated text corresponding to a single item found\n// in the file.\n//\n// Returns a non-OK result if fname does not name a leveldb storage\n// file, or if the file cannot be read.\nStatus DumpFile(Env* env, const std::string& fname, WritableFile* dst);\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/env.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// An Env is an interface used by the leveldb implementation to access\n// operating system functionality like the filesystem etc.  Callers\n// may wish to provide a custom Env object when opening a database to\n// get fine gain control; e.g., to rate limit file system operations.\n//\n// All Env implementations are safe for concurrent access from\n// multiple threads without any external synchronization.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_ENV_H_\n#define STORAGE_LEVELDB_INCLUDE_ENV_H_\n\n#include <string>\n#include <vector>\n#include <stdarg.h>\n#include <stdint.h>\n#include \"leveldb/status.h\"\n\nnamespace leveldb {\n\nclass FileLock;\nclass Logger;\nclass RandomAccessFile;\nclass SequentialFile;\nclass Slice;\nclass WritableFile;\n\nclass Env {\n public:\n  Env() { }\n  virtual ~Env();\n\n  // Return a default environment suitable for the current operating\n  // system.  Sophisticated users may wish to provide their own Env\n  // implementation instead of relying on this default environment.\n  //\n  // The result of Default() belongs to leveldb and must never be deleted.\n  static Env* Default();\n\n  // Create a brand new sequentially-readable file with the specified name.\n  // On success, stores a pointer to the new file in *result and returns OK.\n  // On failure stores NULL in *result and returns non-OK.  If the file does\n  // not exist, returns a non-OK status.\n  //\n  // The returned file will only be accessed by one thread at a time.\n  virtual Status NewSequentialFile(const std::string& fname,\n                                   SequentialFile** result) = 0;\n\n  // Create a brand new random access read-only file with the\n  // specified name.  On success, stores a pointer to the new file in\n  // *result and returns OK.  On failure stores NULL in *result and\n  // returns non-OK.  If the file does not exist, returns a non-OK\n  // status.\n  //\n  // The returned file may be concurrently accessed by multiple threads.\n  virtual Status NewRandomAccessFile(const std::string& fname,\n                                     RandomAccessFile** result) = 0;\n\n  // Create an object that writes to a new file with the specified\n  // name.  Deletes any existing file with the same name and creates a\n  // new file.  On success, stores a pointer to the new file in\n  // *result and returns OK.  On failure stores NULL in *result and\n  // returns non-OK.\n  //\n  // The returned file will only be accessed by one thread at a time.\n  virtual Status NewWritableFile(const std::string& fname,\n                                 WritableFile** result) = 0;\n\n  // Create an object that either appends to an existing file, or\n  // writes to a new file (if the file does not exist to begin with).\n  // On success, stores a pointer to the new file in *result and\n  // returns OK.  On failure stores NULL in *result and returns\n  // non-OK.\n  //\n  // The returned file will only be accessed by one thread at a time.\n  //\n  // May return an IsNotSupportedError error if this Env does\n  // not allow appending to an existing file.  Users of Env (including\n  // the leveldb implementation) must be prepared to deal with\n  // an Env that does not support appending.\n  virtual Status NewAppendableFile(const std::string& fname,\n                                   WritableFile** result);\n\n  // Returns true iff the named file exists.\n  virtual bool FileExists(const std::string& fname) = 0;\n\n  // Store in *result the names of the children of the specified directory.\n  // The names are relative to \"dir\".\n  // Original contents of *results are dropped.\n  virtual Status GetChildren(const std::string& dir,\n                             std::vector<std::string>* result) = 0;\n\n  // Delete the named file.\n  virtual Status DeleteFile(const std::string& fname) = 0;\n\n  // Create the specified directory.\n  virtual Status CreateDir(const std::string& dirname) = 0;\n\n  // Delete the specified directory.\n  virtual Status DeleteDir(const std::string& dirname) = 0;\n\n  // Store the size of fname in *file_size.\n  virtual Status GetFileSize(const std::string& fname, uint64_t* file_size) = 0;\n\n  // Rename file src to target.\n  virtual Status RenameFile(const std::string& src,\n                            const std::string& target) = 0;\n\n  // Lock the specified file.  Used to prevent concurrent access to\n  // the same db by multiple processes.  On failure, stores NULL in\n  // *lock and returns non-OK.\n  //\n  // On success, stores a pointer to the object that represents the\n  // acquired lock in *lock and returns OK.  The caller should call\n  // UnlockFile(*lock) to release the lock.  If the process exits,\n  // the lock will be automatically released.\n  //\n  // If somebody else already holds the lock, finishes immediately\n  // with a failure.  I.e., this call does not wait for existing locks\n  // to go away.\n  //\n  // May create the named file if it does not already exist.\n  virtual Status LockFile(const std::string& fname, FileLock** lock) = 0;\n\n  // Release the lock acquired by a previous successful call to LockFile.\n  // REQUIRES: lock was returned by a successful LockFile() call\n  // REQUIRES: lock has not already been unlocked.\n  virtual Status UnlockFile(FileLock* lock) = 0;\n\n  // Arrange to run \"(*function)(arg)\" once in a background thread.\n  //\n  // \"function\" may run in an unspecified thread.  Multiple functions\n  // added to the same Env may run concurrently in different threads.\n  // I.e., the caller may not assume that background work items are\n  // serialized.\n  virtual void Schedule(\n      void (*function)(void* arg),\n      void* arg) = 0;\n\n  // Start a new thread, invoking \"function(arg)\" within the new thread.\n  // When \"function(arg)\" returns, the thread will be destroyed.\n  virtual void StartThread(void (*function)(void* arg), void* arg) = 0;\n\n  // *path is set to a temporary directory that can be used for testing. It may\n  // or many not have just been created. The directory may or may not differ\n  // between runs of the same process, but subsequent calls will return the\n  // same directory.\n  virtual Status GetTestDirectory(std::string* path) = 0;\n\n  // Create and return a log file for storing informational messages.\n  virtual Status NewLogger(const std::string& fname, Logger** result) = 0;\n\n  // Returns the number of micro-seconds since some fixed point in time. Only\n  // useful for computing deltas of time.\n  virtual uint64_t NowMicros() = 0;\n\n  // Sleep/delay the thread for the prescribed number of micro-seconds.\n  virtual void SleepForMicroseconds(int micros) = 0;\n\n private:\n  // No copying allowed\n  Env(const Env&);\n  void operator=(const Env&);\n};\n\n// A file abstraction for reading sequentially through a file\nclass SequentialFile {\n public:\n  SequentialFile() { }\n  virtual ~SequentialFile();\n\n  // Read up to \"n\" bytes from the file.  \"scratch[0..n-1]\" may be\n  // written by this routine.  Sets \"*result\" to the data that was\n  // read (including if fewer than \"n\" bytes were successfully read).\n  // May set \"*result\" to point at data in \"scratch[0..n-1]\", so\n  // \"scratch[0..n-1]\" must be live when \"*result\" is used.\n  // If an error was encountered, returns a non-OK status.\n  //\n  // REQUIRES: External synchronization\n  virtual Status Read(size_t n, Slice* result, char* scratch) = 0;\n\n  // Skip \"n\" bytes from the file. This is guaranteed to be no\n  // slower that reading the same data, but may be faster.\n  //\n  // If end of file is reached, skipping will stop at the end of the\n  // file, and Skip will return OK.\n  //\n  // REQUIRES: External synchronization\n  virtual Status Skip(uint64_t n) = 0;\n\n  // Get a name for the file, only for error reporting\n  virtual std::string GetName() const = 0;\n\n private:\n  // No copying allowed\n  SequentialFile(const SequentialFile&);\n  void operator=(const SequentialFile&);\n};\n\n// A file abstraction for randomly reading the contents of a file.\nclass RandomAccessFile {\n public:\n  RandomAccessFile() { }\n  virtual ~RandomAccessFile();\n\n  // Read up to \"n\" bytes from the file starting at \"offset\".\n  // \"scratch[0..n-1]\" may be written by this routine.  Sets \"*result\"\n  // to the data that was read (including if fewer than \"n\" bytes were\n  // successfully read).  May set \"*result\" to point at data in\n  // \"scratch[0..n-1]\", so \"scratch[0..n-1]\" must be live when\n  // \"*result\" is used.  If an error was encountered, returns a non-OK\n  // status.\n  //\n  // Safe for concurrent use by multiple threads.\n  virtual Status Read(uint64_t offset, size_t n, Slice* result,\n                      char* scratch) const = 0;\n\n  // Get a name for the file, only for error reporting\n  virtual std::string GetName() const = 0;\n\n private:\n  // No copying allowed\n  RandomAccessFile(const RandomAccessFile&);\n  void operator=(const RandomAccessFile&);\n};\n\n// A file abstraction for sequential writing.  The implementation\n// must provide buffering since callers may append small fragments\n// at a time to the file.\nclass WritableFile {\n public:\n  WritableFile() { }\n  virtual ~WritableFile();\n\n  virtual Status Append(const Slice& data) = 0;\n  virtual Status Close() = 0;\n  virtual Status Flush() = 0;\n  virtual Status Sync() = 0;\n\n  // Get a name for the file, only for error reporting\n  virtual std::string GetName() const = 0;\n\n private:\n  // No copying allowed\n  WritableFile(const WritableFile&);\n  void operator=(const WritableFile&);\n};\n\n// An interface for writing log messages.\nclass Logger {\n public:\n  Logger() { }\n  virtual ~Logger();\n\n  // Write an entry to the log file with the specified format.\n  virtual void Logv(const char* format, va_list ap) = 0;\n\n private:\n  // No copying allowed\n  Logger(const Logger&);\n  void operator=(const Logger&);\n};\n\n\n// Identifies a locked file.\nclass FileLock {\n public:\n  FileLock() { }\n  virtual ~FileLock();\n private:\n  // No copying allowed\n  FileLock(const FileLock&);\n  void operator=(const FileLock&);\n};\n\n// Log the specified data to *info_log if info_log is non-NULL.\nextern void Log(Logger* info_log, const char* format, ...)\n#   if defined(__GNUC__) || defined(__clang__)\n    __attribute__((__format__ (__printf__, 2, 3)))\n#   endif\n    ;\n\n// A utility routine: write \"data\" to the named file.\nextern Status WriteStringToFile(Env* env, const Slice& data,\n                                const std::string& fname);\n\n// A utility routine: read contents of named file into *data\nextern Status ReadFileToString(Env* env, const std::string& fname,\n                               std::string* data);\n\n// An implementation of Env that forwards all calls to another Env.\n// May be useful to clients who wish to override just part of the\n// functionality of another Env.\nclass EnvWrapper : public Env {\n public:\n  // Initialize an EnvWrapper that delegates all calls to *t\n  explicit EnvWrapper(Env* t) : target_(t) { }\n  virtual ~EnvWrapper();\n\n  // Return the target to which this Env forwards all calls\n  Env* target() const { return target_; }\n\n  // The following text is boilerplate that forwards all methods to target()\n  Status NewSequentialFile(const std::string& f, SequentialFile** r) {\n    return target_->NewSequentialFile(f, r);\n  }\n  Status NewRandomAccessFile(const std::string& f, RandomAccessFile** r) {\n    return target_->NewRandomAccessFile(f, r);\n  }\n  Status NewWritableFile(const std::string& f, WritableFile** r) {\n    return target_->NewWritableFile(f, r);\n  }\n  Status NewAppendableFile(const std::string& f, WritableFile** r) {\n    return target_->NewAppendableFile(f, r);\n  }\n  bool FileExists(const std::string& f) { return target_->FileExists(f); }\n  Status GetChildren(const std::string& dir, std::vector<std::string>* r) {\n    return target_->GetChildren(dir, r);\n  }\n  Status DeleteFile(const std::string& f) { return target_->DeleteFile(f); }\n  Status CreateDir(const std::string& d) { return target_->CreateDir(d); }\n  Status DeleteDir(const std::string& d) { return target_->DeleteDir(d); }\n  Status GetFileSize(const std::string& f, uint64_t* s) {\n    return target_->GetFileSize(f, s);\n  }\n  Status RenameFile(const std::string& s, const std::string& t) {\n    return target_->RenameFile(s, t);\n  }\n  Status LockFile(const std::string& f, FileLock** l) {\n    return target_->LockFile(f, l);\n  }\n  Status UnlockFile(FileLock* l) { return target_->UnlockFile(l); }\n  void Schedule(void (*f)(void*), void* a) {\n    return target_->Schedule(f, a);\n  }\n  void StartThread(void (*f)(void*), void* a) {\n    return target_->StartThread(f, a);\n  }\n  virtual Status GetTestDirectory(std::string* path) {\n    return target_->GetTestDirectory(path);\n  }\n  virtual Status NewLogger(const std::string& fname, Logger** result) {\n    return target_->NewLogger(fname, result);\n  }\n  uint64_t NowMicros() {\n    return target_->NowMicros();\n  }\n  void SleepForMicroseconds(int micros) {\n    target_->SleepForMicroseconds(micros);\n  }\n private:\n  Env* target_;\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_ENV_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/filter_policy.h",
    "content": "// Copyright (c) 2012 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// A database can be configured with a custom FilterPolicy object.\n// This object is responsible for creating a small filter from a set\n// of keys.  These filters are stored in leveldb and are consulted\n// automatically by leveldb to decide whether or not to read some\n// information from disk. In many cases, a filter can cut down the\n// number of disk seeks form a handful to a single disk seek per\n// DB::Get() call.\n//\n// Most people will want to use the builtin bloom filter support (see\n// NewBloomFilterPolicy() below).\n\n#ifndef STORAGE_LEVELDB_INCLUDE_FILTER_POLICY_H_\n#define STORAGE_LEVELDB_INCLUDE_FILTER_POLICY_H_\n\n#include <string>\n\nnamespace leveldb {\n\nclass Slice;\n\nclass FilterPolicy {\n public:\n  virtual ~FilterPolicy();\n\n  // Return the name of this policy.  Note that if the filter encoding\n  // changes in an incompatible way, the name returned by this method\n  // must be changed.  Otherwise, old incompatible filters may be\n  // passed to methods of this type.\n  virtual const char* Name() const = 0;\n\n  // keys[0,n-1] contains a list of keys (potentially with duplicates)\n  // that are ordered according to the user supplied comparator.\n  // Append a filter that summarizes keys[0,n-1] to *dst.\n  //\n  // Warning: do not change the initial contents of *dst.  Instead,\n  // append the newly constructed filter to *dst.\n  virtual void CreateFilter(const Slice* keys, int n, std::string* dst)\n      const = 0;\n\n  // \"filter\" contains the data appended by a preceding call to\n  // CreateFilter() on this class.  This method must return true if\n  // the key was in the list of keys passed to CreateFilter().\n  // This method may return true or false if the key was not on the\n  // list, but it should aim to return false with a high probability.\n  virtual bool KeyMayMatch(const Slice& key, const Slice& filter) const = 0;\n};\n\n// Return a new filter policy that uses a bloom filter with approximately\n// the specified number of bits per key.  A good value for bits_per_key\n// is 10, which yields a filter with ~ 1% false positive rate.\n//\n// Callers must delete the result after any database that is using the\n// result has been closed.\n//\n// Note: if you are using a custom comparator that ignores some parts\n// of the keys being compared, you must not use NewBloomFilterPolicy()\n// and must provide your own FilterPolicy that also ignores the\n// corresponding parts of the keys.  For example, if the comparator\n// ignores trailing spaces, it would be incorrect to use a\n// FilterPolicy (like NewBloomFilterPolicy) that does not ignore\n// trailing spaces in keys.\nextern const FilterPolicy* NewBloomFilterPolicy(int bits_per_key);\n\n}\n\n#endif  // STORAGE_LEVELDB_INCLUDE_FILTER_POLICY_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/iterator.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// An iterator yields a sequence of key/value pairs from a source.\n// The following class defines the interface.  Multiple implementations\n// are provided by this library.  In particular, iterators are provided\n// to access the contents of a Table or a DB.\n//\n// Multiple threads can invoke const methods on an Iterator without\n// external synchronization, but if any of the threads may call a\n// non-const method, all threads accessing the same Iterator must use\n// external synchronization.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_ITERATOR_H_\n#define STORAGE_LEVELDB_INCLUDE_ITERATOR_H_\n\n#include \"leveldb/slice.h\"\n#include \"leveldb/status.h\"\n\nnamespace leveldb {\n\nclass Iterator {\n public:\n  Iterator();\n  virtual ~Iterator();\n\n  // An iterator is either positioned at a key/value pair, or\n  // not valid.  This method returns true iff the iterator is valid.\n  virtual bool Valid() const = 0;\n\n  // Position at the first key in the source.  The iterator is Valid()\n  // after this call iff the source is not empty.\n  virtual void SeekToFirst() = 0;\n\n  // Position at the last key in the source.  The iterator is\n  // Valid() after this call iff the source is not empty.\n  virtual void SeekToLast() = 0;\n\n  // Position at the first key in the source that is at or past target.\n  // The iterator is Valid() after this call iff the source contains\n  // an entry that comes at or past target.\n  virtual void Seek(const Slice& target) = 0;\n\n  // Moves to the next entry in the source.  After this call, Valid() is\n  // true iff the iterator was not positioned at the last entry in the source.\n  // REQUIRES: Valid()\n  virtual void Next() = 0;\n\n  // Moves to the previous entry in the source.  After this call, Valid() is\n  // true iff the iterator was not positioned at the first entry in source.\n  // REQUIRES: Valid()\n  virtual void Prev() = 0;\n\n  // Return the key for the current entry.  The underlying storage for\n  // the returned slice is valid only until the next modification of\n  // the iterator.\n  // REQUIRES: Valid()\n  virtual Slice key() const = 0;\n\n  // Return the value for the current entry.  The underlying storage for\n  // the returned slice is valid only until the next modification of\n  // the iterator.\n  // REQUIRES: Valid()\n  virtual Slice value() const = 0;\n\n  // If an error has occurred, return it.  Else return an ok status.\n  virtual Status status() const = 0;\n\n  // Clients are allowed to register function/arg1/arg2 triples that\n  // will be invoked when this iterator is destroyed.\n  //\n  // Note that unlike all of the preceding methods, this method is\n  // not abstract and therefore clients should not override it.\n  typedef void (*CleanupFunction)(void* arg1, void* arg2);\n  void RegisterCleanup(CleanupFunction function, void* arg1, void* arg2);\n\n private:\n  struct Cleanup {\n    CleanupFunction function;\n    void* arg1;\n    void* arg2;\n    Cleanup* next;\n  };\n  Cleanup cleanup_;\n\n  // No copying allowed\n  Iterator(const Iterator&);\n  void operator=(const Iterator&);\n};\n\n// Return an empty iterator (yields nothing).\nextern Iterator* NewEmptyIterator();\n\n// Return an empty iterator with the specified status.\nextern Iterator* NewErrorIterator(const Status& status);\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_ITERATOR_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/options.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_OPTIONS_H_\n#define STORAGE_LEVELDB_INCLUDE_OPTIONS_H_\n\n#include <stddef.h>\n\nnamespace leveldb {\n\nclass Cache;\nclass Comparator;\nclass Env;\nclass FilterPolicy;\nclass Logger;\nclass Snapshot;\n\n// DB contents are stored in a set of blocks, each of which holds a\n// sequence of key,value pairs.  Each block may be compressed before\n// being stored in a file.  The following enum describes which\n// compression method (if any) is used to compress a block.\nenum CompressionType {\n  // NOTE: do not change the values of existing entries, as these are\n  // part of the persistent format on disk.\n  kNoCompression     = 0x0,\n  kSnappyCompression = 0x1\n};\n\n// Options to control the behavior of a database (passed to DB::Open)\nstruct Options {\n  // -------------------\n  // Parameters that affect behavior\n\n  // Comparator used to define the order of keys in the table.\n  // Default: a comparator that uses lexicographic byte-wise ordering\n  //\n  // REQUIRES: The client must ensure that the comparator supplied\n  // here has the same name and orders keys *exactly* the same as the\n  // comparator provided to previous open calls on the same DB.\n  const Comparator* comparator;\n\n  // If true, the database will be created if it is missing.\n  // Default: false\n  bool create_if_missing;\n\n  // If true, an error is raised if the database already exists.\n  // Default: false\n  bool error_if_exists;\n\n  // If true, the implementation will do aggressive checking of the\n  // data it is processing and will stop early if it detects any\n  // errors.  This may have unforeseen ramifications: for example, a\n  // corruption of one DB entry may cause a large number of entries to\n  // become unreadable or for the entire DB to become unopenable.\n  // Default: false\n  bool paranoid_checks;\n\n  // Use the specified object to interact with the environment,\n  // e.g. to read/write files, schedule background work, etc.\n  // Default: Env::Default()\n  Env* env;\n\n  // Any internal progress/error information generated by the db will\n  // be written to info_log if it is non-NULL, or to a file stored\n  // in the same directory as the DB contents if info_log is NULL.\n  // Default: NULL\n  Logger* info_log;\n\n  // -------------------\n  // Parameters that affect performance\n\n  // Amount of data to build up in memory (backed by an unsorted log\n  // on disk) before converting to a sorted on-disk file.\n  //\n  // Larger values increase performance, especially during bulk loads.\n  // Up to two write buffers may be held in memory at the same time,\n  // so you may wish to adjust this parameter to control memory usage.\n  // Also, a larger write buffer will result in a longer recovery time\n  // the next time the database is opened.\n  //\n  // Default: 4MB\n  size_t write_buffer_size;\n\n  // Number of open files that can be used by the DB.  You may need to\n  // increase this if your database has a large working set (budget\n  // one open file per 2MB of working set).\n  //\n  // Default: 1000\n  int max_open_files;\n\n  // Control over blocks (user data is stored in a set of blocks, and\n  // a block is the unit of reading from disk).\n\n  // If non-NULL, use the specified cache for blocks.\n  // If NULL, leveldb will automatically create and use an 8MB internal cache.\n  // Default: NULL\n  Cache* block_cache;\n\n  // Approximate size of user data packed per block.  Note that the\n  // block size specified here corresponds to uncompressed data.  The\n  // actual size of the unit read from disk may be smaller if\n  // compression is enabled.  This parameter can be changed dynamically.\n  //\n  // Default: 4K\n  size_t block_size;\n\n  // Number of keys between restart points for delta encoding of keys.\n  // This parameter can be changed dynamically.  Most clients should\n  // leave this parameter alone.\n  //\n  // Default: 16\n  int block_restart_interval;\n\n  // Leveldb will write up to this amount of bytes to a file before\n  // switching to a new one.\n  // Most clients should leave this parameter alone.  However if your\n  // filesystem is more efficient with larger files, you could\n  // consider increasing the value.  The downside will be longer\n  // compactions and hence longer latency/performance hiccups.\n  // Another reason to increase this parameter might be when you are\n  // initially populating a large database.\n  //\n  // Default: 2MB\n  size_t max_file_size;\n\n  // Compress blocks using the specified compression algorithm.  This\n  // parameter can be changed dynamically.\n  //\n  // Default: kSnappyCompression, which gives lightweight but fast\n  // compression.\n  //\n  // Typical speeds of kSnappyCompression on an Intel(R) Core(TM)2 2.4GHz:\n  //    ~200-500MB/s compression\n  //    ~400-800MB/s decompression\n  // Note that these speeds are significantly faster than most\n  // persistent storage speeds, and therefore it is typically never\n  // worth switching to kNoCompression.  Even if the input data is\n  // incompressible, the kSnappyCompression implementation will\n  // efficiently detect that and will switch to uncompressed mode.\n  CompressionType compression;\n\n  // EXPERIMENTAL: If true, append to existing MANIFEST and log files\n  // when a database is opened.  This can significantly speed up open.\n  //\n  // Default: currently false, but may become true later.\n  bool reuse_logs;\n\n  // If non-NULL, use the specified filter policy to reduce disk reads.\n  // Many applications will benefit from passing the result of\n  // NewBloomFilterPolicy() here.\n  //\n  // Default: NULL\n  const FilterPolicy* filter_policy;\n\n  // Create an Options object with default values for all fields.\n  Options();\n};\n\n// Options that control read operations\nstruct ReadOptions {\n  // If true, all data read from underlying storage will be\n  // verified against corresponding checksums.\n  // Default: false\n  bool verify_checksums;\n\n  // Should the data read for this iteration be cached in memory?\n  // Callers may wish to set this field to false for bulk scans.\n  // Default: true\n  bool fill_cache;\n\n  // If \"snapshot\" is non-NULL, read as of the supplied snapshot\n  // (which must belong to the DB that is being read and which must\n  // not have been released).  If \"snapshot\" is NULL, use an implicit\n  // snapshot of the state at the beginning of this read operation.\n  // Default: NULL\n  const Snapshot* snapshot;\n\n  ReadOptions()\n      : verify_checksums(false),\n        fill_cache(true),\n        snapshot(NULL) {\n  }\n};\n\n// Options that control write operations\nstruct WriteOptions {\n  // If true, the write will be flushed from the operating system\n  // buffer cache (by calling WritableFile::Sync()) before the write\n  // is considered complete.  If this flag is true, writes will be\n  // slower.\n  //\n  // If this flag is false, and the machine crashes, some recent\n  // writes may be lost.  Note that if it is just the process that\n  // crashes (i.e., the machine does not reboot), no writes will be\n  // lost even if sync==false.\n  //\n  // In other words, a DB write with sync==false has similar\n  // crash semantics as the \"write()\" system call.  A DB write\n  // with sync==true has similar crash semantics to a \"write()\"\n  // system call followed by \"fsync()\".\n  //\n  // Default: false\n  bool sync;\n\n  WriteOptions()\n      : sync(false) {\n  }\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_OPTIONS_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/slice.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// Slice is a simple structure containing a pointer into some external\n// storage and a size.  The user of a Slice must ensure that the slice\n// is not used after the corresponding external storage has been\n// deallocated.\n//\n// Multiple threads can invoke const methods on a Slice without\n// external synchronization, but if any of the threads may call a\n// non-const method, all threads accessing the same Slice must use\n// external synchronization.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_SLICE_H_\n#define STORAGE_LEVELDB_INCLUDE_SLICE_H_\n\n#include <assert.h>\n#include <stddef.h>\n#include <string.h>\n#include <string>\n\nnamespace leveldb {\n\nclass Slice {\n public:\n  // Create an empty slice.\n  Slice() : data_(\"\"), size_(0) { }\n\n  // Create a slice that refers to d[0,n-1].\n  Slice(const char* d, size_t n) : data_(d), size_(n) { }\n\n  // Create a slice that refers to the contents of \"s\"\n  Slice(const std::string& s) : data_(s.data()), size_(s.size()) { }\n\n  // Create a slice that refers to s[0,strlen(s)-1]\n  Slice(const char* s) : data_(s), size_(strlen(s)) { }\n\n  // Return a pointer to the beginning of the referenced data\n  const char* data() const { return data_; }\n\n  // Return the length (in bytes) of the referenced data\n  size_t size() const { return size_; }\n\n  // Return true iff the length of the referenced data is zero\n  bool empty() const { return size_ == 0; }\n\n  // Return the ith byte in the referenced data.\n  // REQUIRES: n < size()\n  char operator[](size_t n) const {\n    assert(n < size());\n    return data_[n];\n  }\n\n  // Change this slice to refer to an empty array\n  void clear() { data_ = \"\"; size_ = 0; }\n\n  // Drop the first \"n\" bytes from this slice.\n  void remove_prefix(size_t n) {\n    assert(n <= size());\n    data_ += n;\n    size_ -= n;\n  }\n\n  // Return a string that contains the copy of the referenced data.\n  std::string ToString() const { return std::string(data_, size_); }\n\n  // Three-way comparison.  Returns value:\n  //   <  0 iff \"*this\" <  \"b\",\n  //   == 0 iff \"*this\" == \"b\",\n  //   >  0 iff \"*this\" >  \"b\"\n  int compare(const Slice& b) const;\n\n  // Return true iff \"x\" is a prefix of \"*this\"\n  bool starts_with(const Slice& x) const {\n    return ((size_ >= x.size_) &&\n            (memcmp(data_, x.data_, x.size_) == 0));\n  }\n\n private:\n  const char* data_;\n  size_t size_;\n\n  // Intentionally copyable\n};\n\ninline bool operator==(const Slice& x, const Slice& y) {\n  return ((x.size() == y.size()) &&\n          (memcmp(x.data(), y.data(), x.size()) == 0));\n}\n\ninline bool operator!=(const Slice& x, const Slice& y) {\n  return !(x == y);\n}\n\ninline int Slice::compare(const Slice& b) const {\n  const size_t min_len = (size_ < b.size_) ? size_ : b.size_;\n  int r = memcmp(data_, b.data_, min_len);\n  if (r == 0) {\n    if (size_ < b.size_) r = -1;\n    else if (size_ > b.size_) r = +1;\n  }\n  return r;\n}\n\n}  // namespace leveldb\n\n\n#endif  // STORAGE_LEVELDB_INCLUDE_SLICE_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/status.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// A Status encapsulates the result of an operation.  It may indicate success,\n// or it may indicate an error with an associated error message.\n//\n// Multiple threads can invoke const methods on a Status without\n// external synchronization, but if any of the threads may call a\n// non-const method, all threads accessing the same Status must use\n// external synchronization.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_STATUS_H_\n#define STORAGE_LEVELDB_INCLUDE_STATUS_H_\n\n#include <string>\n#include \"leveldb/slice.h\"\n\nnamespace leveldb {\n\nclass Status {\n public:\n  // Create a success status.\n  Status() : state_(NULL) { }\n  ~Status() { delete[] state_; }\n\n  // Copy the specified status.\n  Status(const Status& s);\n  void operator=(const Status& s);\n\n  // Return a success status.\n  static Status OK() { return Status(); }\n\n  // Return error status of an appropriate type.\n  static Status NotFound(const Slice& msg, const Slice& msg2 = Slice()) {\n    return Status(kNotFound, msg, msg2);\n  }\n  static Status Corruption(const Slice& msg, const Slice& msg2 = Slice()) {\n    return Status(kCorruption, msg, msg2);\n  }\n  static Status NotSupported(const Slice& msg, const Slice& msg2 = Slice()) {\n    return Status(kNotSupported, msg, msg2);\n  }\n  static Status InvalidArgument(const Slice& msg, const Slice& msg2 = Slice()) {\n    return Status(kInvalidArgument, msg, msg2);\n  }\n  static Status IOError(const Slice& msg, const Slice& msg2 = Slice()) {\n    return Status(kIOError, msg, msg2);\n  }\n\n  // Returns true iff the status indicates success.\n  bool ok() const { return (state_ == NULL); }\n\n  // Returns true iff the status indicates a NotFound error.\n  bool IsNotFound() const { return code() == kNotFound; }\n\n  // Returns true iff the status indicates a Corruption error.\n  bool IsCorruption() const { return code() == kCorruption; }\n\n  // Returns true iff the status indicates an IOError.\n  bool IsIOError() const { return code() == kIOError; }\n\n  // Returns true iff the status indicates a NotSupportedError.\n  bool IsNotSupportedError() const { return code() == kNotSupported; }\n\n  // Returns true iff the status indicates an InvalidArgument.\n  bool IsInvalidArgument() const { return code() == kInvalidArgument; }\n\n  // Return a string representation of this status suitable for printing.\n  // Returns the string \"OK\" for success.\n  std::string ToString() const;\n\n private:\n  // OK status has a NULL state_.  Otherwise, state_ is a new[] array\n  // of the following form:\n  //    state_[0..3] == length of message\n  //    state_[4]    == code\n  //    state_[5..]  == message\n  const char* state_;\n\n  enum Code {\n    kOk = 0,\n    kNotFound = 1,\n    kCorruption = 2,\n    kNotSupported = 3,\n    kInvalidArgument = 4,\n    kIOError = 5\n  };\n\n  Code code() const {\n    return (state_ == NULL) ? kOk : static_cast<Code>(state_[4]);\n  }\n\n  Status(Code code, const Slice& msg, const Slice& msg2);\n  static const char* CopyState(const char* s);\n};\n\ninline Status::Status(const Status& s) {\n  state_ = (s.state_ == NULL) ? NULL : CopyState(s.state_);\n}\ninline void Status::operator=(const Status& s) {\n  // The following condition catches both aliasing (when this == &s),\n  // and the common case where both s and *this are ok.\n  if (state_ != s.state_) {\n    delete[] state_;\n    state_ = (s.state_ == NULL) ? NULL : CopyState(s.state_);\n  }\n}\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_STATUS_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/table.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_TABLE_H_\n#define STORAGE_LEVELDB_INCLUDE_TABLE_H_\n\n#include <stdint.h>\n#include \"leveldb/iterator.h\"\n\nnamespace leveldb {\n\nclass Block;\nclass BlockHandle;\nclass Footer;\nstruct Options;\nclass RandomAccessFile;\nstruct ReadOptions;\nclass TableCache;\n\n// A Table is a sorted map from strings to strings.  Tables are\n// immutable and persistent.  A Table may be safely accessed from\n// multiple threads without external synchronization.\nclass Table {\n public:\n  // Attempt to open the table that is stored in bytes [0..file_size)\n  // of \"file\", and read the metadata entries necessary to allow\n  // retrieving data from the table.\n  //\n  // If successful, returns ok and sets \"*table\" to the newly opened\n  // table.  The client should delete \"*table\" when no longer needed.\n  // If there was an error while initializing the table, sets \"*table\"\n  // to NULL and returns a non-ok status.  Does not take ownership of\n  // \"*source\", but the client must ensure that \"source\" remains live\n  // for the duration of the returned table's lifetime.\n  //\n  // *file must remain live while this Table is in use.\n  static Status Open(const Options& options,\n                     RandomAccessFile* file,\n                     uint64_t file_size,\n                     Table** table);\n\n  ~Table();\n\n  // Returns a new iterator over the table contents.\n  // The result of NewIterator() is initially invalid (caller must\n  // call one of the Seek methods on the iterator before using it).\n  Iterator* NewIterator(const ReadOptions&) const;\n\n  // Given a key, return an approximate byte offset in the file where\n  // the data for that key begins (or would begin if the key were\n  // present in the file).  The returned value is in terms of file\n  // bytes, and so includes effects like compression of the underlying data.\n  // E.g., the approximate offset of the last key in the table will\n  // be close to the file length.\n  uint64_t ApproximateOffsetOf(const Slice& key) const;\n\n private:\n  struct Rep;\n  Rep* rep_;\n\n  explicit Table(Rep* rep) { rep_ = rep; }\n  static Iterator* BlockReader(void*, const ReadOptions&, const Slice&);\n\n  // Calls (*handle_result)(arg, ...) with the entry found after a call\n  // to Seek(key).  May not make such a call if filter policy says\n  // that key is not present.\n  friend class TableCache;\n  Status InternalGet(\n      const ReadOptions&, const Slice& key,\n      void* arg,\n      void (*handle_result)(void* arg, const Slice& k, const Slice& v));\n\n\n  void ReadMeta(const Footer& footer);\n  void ReadFilter(const Slice& filter_handle_value);\n\n  // No copying allowed\n  Table(const Table&);\n  void operator=(const Table&);\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_TABLE_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/table_builder.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// TableBuilder provides the interface used to build a Table\n// (an immutable and sorted map from keys to values).\n//\n// Multiple threads can invoke const methods on a TableBuilder without\n// external synchronization, but if any of the threads may call a\n// non-const method, all threads accessing the same TableBuilder must use\n// external synchronization.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_\n#define STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_\n\n#include <stdint.h>\n#include \"leveldb/options.h\"\n#include \"leveldb/status.h\"\n\nnamespace leveldb {\n\nclass BlockBuilder;\nclass BlockHandle;\nclass WritableFile;\n\nclass TableBuilder {\n public:\n  // Create a builder that will store the contents of the table it is\n  // building in *file.  Does not close the file.  It is up to the\n  // caller to close the file after calling Finish().\n  TableBuilder(const Options& options, WritableFile* file);\n\n  // REQUIRES: Either Finish() or Abandon() has been called.\n  ~TableBuilder();\n\n  // Change the options used by this builder.  Note: only some of the\n  // option fields can be changed after construction.  If a field is\n  // not allowed to change dynamically and its value in the structure\n  // passed to the constructor is different from its value in the\n  // structure passed to this method, this method will return an error\n  // without changing any fields.\n  Status ChangeOptions(const Options& options);\n\n  // Add key,value to the table being constructed.\n  // REQUIRES: key is after any previously added key according to comparator.\n  // REQUIRES: Finish(), Abandon() have not been called\n  void Add(const Slice& key, const Slice& value);\n\n  // Advanced operation: flush any buffered key/value pairs to file.\n  // Can be used to ensure that two adjacent entries never live in\n  // the same data block.  Most clients should not need to use this method.\n  // REQUIRES: Finish(), Abandon() have not been called\n  void Flush();\n\n  // Return non-ok iff some error has been detected.\n  Status status() const;\n\n  // Finish building the table.  Stops using the file passed to the\n  // constructor after this function returns.\n  // REQUIRES: Finish(), Abandon() have not been called\n  Status Finish();\n\n  // Indicate that the contents of this builder should be abandoned.  Stops\n  // using the file passed to the constructor after this function returns.\n  // If the caller is not going to call Finish(), it must call Abandon()\n  // before destroying this builder.\n  // REQUIRES: Finish(), Abandon() have not been called\n  void Abandon();\n\n  // Number of calls to Add() so far.\n  uint64_t NumEntries() const;\n\n  // Size of the file generated so far.  If invoked after a successful\n  // Finish() call, returns the size of the final generated file.\n  uint64_t FileSize() const;\n\n private:\n  bool ok() const { return status().ok(); }\n  void WriteBlock(BlockBuilder* block, BlockHandle* handle);\n  void WriteRawBlock(const Slice& data, CompressionType, BlockHandle* handle);\n\n  struct Rep;\n  Rep* rep_;\n\n  // No copying allowed\n  TableBuilder(const TableBuilder&);\n  void operator=(const TableBuilder&);\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_\n"
  },
  {
    "path": "src/leveldb/include/leveldb/write_batch.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// WriteBatch holds a collection of updates to apply atomically to a DB.\n//\n// The updates are applied in the order in which they are added\n// to the WriteBatch.  For example, the value of \"key\" will be \"v3\"\n// after the following batch is written:\n//\n//    batch.Put(\"key\", \"v1\");\n//    batch.Delete(\"key\");\n//    batch.Put(\"key\", \"v2\");\n//    batch.Put(\"key\", \"v3\");\n//\n// Multiple threads can invoke const methods on a WriteBatch without\n// external synchronization, but if any of the threads may call a\n// non-const method, all threads accessing the same WriteBatch must use\n// external synchronization.\n\n#ifndef STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_\n#define STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_\n\n#include <string>\n#include \"leveldb/status.h\"\n\nnamespace leveldb {\n\nclass Slice;\n\nclass WriteBatch {\n public:\n  WriteBatch();\n  ~WriteBatch();\n\n  // Store the mapping \"key->value\" in the database.\n  void Put(const Slice& key, const Slice& value);\n\n  // If the database contains a mapping for \"key\", erase it.  Else do nothing.\n  void Delete(const Slice& key);\n\n  // Clear all updates buffered in this batch.\n  void Clear();\n\n  // Support for iterating over the contents of a batch.\n  class Handler {\n   public:\n    virtual ~Handler();\n    virtual void Put(const Slice& key, const Slice& value) = 0;\n    virtual void Delete(const Slice& key) = 0;\n  };\n  Status Iterate(Handler* handler) const;\n\n private:\n  friend class WriteBatchInternal;\n\n  std::string rep_;  // See comment in write_batch.cc for the format of rep_\n\n  // Intentionally copyable\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_\n"
  },
  {
    "path": "src/leveldb/issues/issue178_test.cc",
    "content": "// Copyright (c) 2013 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n// Test for issue 178: a manual compaction causes deleted data to reappear.\n#include <iostream>\n#include <sstream>\n#include <cstdlib>\n\n#include \"leveldb/db.h\"\n#include \"leveldb/write_batch.h\"\n#include \"util/testharness.h\"\n\nnamespace {\n\nconst int kNumKeys = 1100000;\n\nstd::string Key1(int i) {\n  char buf[100];\n  snprintf(buf, sizeof(buf), \"my_key_%d\", i);\n  return buf;\n}\n\nstd::string Key2(int i) {\n  return Key1(i) + \"_xxx\";\n}\n\nclass Issue178 { };\n\nTEST(Issue178, Test) {\n  // Get rid of any state from an old run.\n  std::string dbpath = leveldb::test::TmpDir() + \"/leveldb_cbug_test\";\n  DestroyDB(dbpath, leveldb::Options());\n\n  // Open database.  Disable compression since it affects the creation\n  // of layers and the code below is trying to test against a very\n  // specific scenario.\n  leveldb::DB* db;\n  leveldb::Options db_options;\n  db_options.create_if_missing = true;\n  db_options.compression = leveldb::kNoCompression;\n  ASSERT_OK(leveldb::DB::Open(db_options, dbpath, &db));\n\n  // create first key range\n  leveldb::WriteBatch batch;\n  for (size_t i = 0; i < kNumKeys; i++) {\n    batch.Put(Key1(i), \"value for range 1 key\");\n  }\n  ASSERT_OK(db->Write(leveldb::WriteOptions(), &batch));\n\n  // create second key range\n  batch.Clear();\n  for (size_t i = 0; i < kNumKeys; i++) {\n    batch.Put(Key2(i), \"value for range 2 key\");\n  }\n  ASSERT_OK(db->Write(leveldb::WriteOptions(), &batch));\n\n  // delete second key range\n  batch.Clear();\n  for (size_t i = 0; i < kNumKeys; i++) {\n    batch.Delete(Key2(i));\n  }\n  ASSERT_OK(db->Write(leveldb::WriteOptions(), &batch));\n\n  // compact database\n  std::string start_key = Key1(0);\n  std::string end_key = Key1(kNumKeys - 1);\n  leveldb::Slice least(start_key.data(), start_key.size());\n  leveldb::Slice greatest(end_key.data(), end_key.size());\n\n  // commenting out the line below causes the example to work correctly\n  db->CompactRange(&least, &greatest);\n\n  // count the keys\n  leveldb::Iterator* iter = db->NewIterator(leveldb::ReadOptions());\n  size_t num_keys = 0;\n  for (iter->SeekToFirst(); iter->Valid(); iter->Next()) {\n    num_keys++;\n  }\n  delete iter;\n  ASSERT_EQ(kNumKeys, num_keys) << \"Bad number of keys\";\n\n  // close database\n  delete db;\n  DestroyDB(dbpath, leveldb::Options());\n}\n\n}  // anonymous namespace\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/issues/issue200_test.cc",
    "content": "// Copyright (c) 2013 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n// Test for issue 200: when iterator switches direction from backward\n// to forward, the current key can be yielded unexpectedly if a new\n// mutation has been added just before the current key.\n\n#include \"leveldb/db.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\nclass Issue200 { };\n\nTEST(Issue200, Test) {\n  // Get rid of any state from an old run.\n  std::string dbpath = test::TmpDir() + \"/leveldb_issue200_test\";\n  DestroyDB(dbpath, Options());\n\n  DB *db;\n  Options options;\n  options.create_if_missing = true;\n  ASSERT_OK(DB::Open(options, dbpath, &db));\n\n  WriteOptions write_options;\n  ASSERT_OK(db->Put(write_options, \"1\", \"b\"));\n  ASSERT_OK(db->Put(write_options, \"2\", \"c\"));\n  ASSERT_OK(db->Put(write_options, \"3\", \"d\"));\n  ASSERT_OK(db->Put(write_options, \"4\", \"e\"));\n  ASSERT_OK(db->Put(write_options, \"5\", \"f\"));\n\n  ReadOptions read_options;\n  Iterator *iter = db->NewIterator(read_options);\n\n  // Add an element that should not be reflected in the iterator.\n  ASSERT_OK(db->Put(write_options, \"25\", \"cd\"));\n\n  iter->Seek(\"5\");\n  ASSERT_EQ(iter->key().ToString(), \"5\");\n  iter->Prev();\n  ASSERT_EQ(iter->key().ToString(), \"4\");\n  iter->Prev();\n  ASSERT_EQ(iter->key().ToString(), \"3\");\n  iter->Next();\n  ASSERT_EQ(iter->key().ToString(), \"4\");\n  iter->Next();\n  ASSERT_EQ(iter->key().ToString(), \"5\");\n\n  delete iter;\n  delete db;\n  DestroyDB(dbpath, options);\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/port/README",
    "content": "This directory contains interfaces and implementations that isolate the\nrest of the package from platform details.\n\nCode in the rest of the package includes \"port.h\" from this directory.\n\"port.h\" in turn includes a platform specific \"port_<platform>.h\" file\nthat provides the platform specific implementation.\n\nSee port_posix.h for an example of what must be provided in a platform\nspecific header file.\n\n"
  },
  {
    "path": "src/leveldb/port/atomic_pointer.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n// AtomicPointer provides storage for a lock-free pointer.\n// Platform-dependent implementation of AtomicPointer:\n// - If the platform provides a cheap barrier, we use it with raw pointers\n// - If <atomic> is present (on newer versions of gcc, it is), we use\n//   a <atomic>-based AtomicPointer.  However we prefer the memory\n//   barrier based version, because at least on a gcc 4.4 32-bit build\n//   on linux, we have encountered a buggy <atomic> implementation.\n//   Also, some <atomic> implementations are much slower than a memory-barrier\n//   based implementation (~16ns for <atomic> based acquire-load vs. ~1ns for\n//   a barrier based acquire-load).\n// This code is based on atomicops-internals-* in Google's perftools:\n// http://code.google.com/p/google-perftools/source/browse/#svn%2Ftrunk%2Fsrc%2Fbase\n\n#ifndef PORT_ATOMIC_POINTER_H_\n#define PORT_ATOMIC_POINTER_H_\n\n#include <stdint.h>\n#ifdef LEVELDB_ATOMIC_PRESENT\n#include <atomic>\n#endif\n#ifdef OS_WIN\n#include <windows.h>\n#endif\n#ifdef OS_MACOSX\n#include <libkern/OSAtomic.h>\n#endif\n\n#if defined(_M_X64) || defined(__x86_64__)\n#define ARCH_CPU_X86_FAMILY 1\n#elif defined(_M_IX86) || defined(__i386__) || defined(__i386)\n#define ARCH_CPU_X86_FAMILY 1\n#elif defined(__ARMEL__)\n#define ARCH_CPU_ARM_FAMILY 1\n#elif defined(__aarch64__)\n#define ARCH_CPU_ARM64_FAMILY 1\n#elif defined(__ppc__) || defined(__powerpc__) || defined(__powerpc64__)\n#define ARCH_CPU_PPC_FAMILY 1\n#elif defined(__mips__)\n#define ARCH_CPU_MIPS_FAMILY 1\n#endif\n\nnamespace leveldb {\nnamespace port {\n\n// AtomicPointer based on <cstdatomic> if available\n#if defined(LEVELDB_ATOMIC_PRESENT)\nclass AtomicPointer {\n private:\n  std::atomic<void*> rep_;\n public:\n  AtomicPointer() { }\n  explicit AtomicPointer(void* v) : rep_(v) { }\n  inline void* Acquire_Load() const {\n    return rep_.load(std::memory_order_acquire);\n  }\n  inline void Release_Store(void* v) {\n    rep_.store(v, std::memory_order_release);\n  }\n  inline void* NoBarrier_Load() const {\n    return rep_.load(std::memory_order_relaxed);\n  }\n  inline void NoBarrier_Store(void* v) {\n    rep_.store(v, std::memory_order_relaxed);\n  }\n};\n\n#else\n\n// Define MemoryBarrier() if available\n// Windows on x86\n#if defined(OS_WIN) && defined(COMPILER_MSVC) && defined(ARCH_CPU_X86_FAMILY)\n// windows.h already provides a MemoryBarrier(void) macro\n// http://msdn.microsoft.com/en-us/library/ms684208(v=vs.85).aspx\n#define LEVELDB_HAVE_MEMORY_BARRIER\n\n// Mac OS\n#elif defined(OS_MACOSX)\ninline void MemoryBarrier() {\n  OSMemoryBarrier();\n}\n#define LEVELDB_HAVE_MEMORY_BARRIER\n\n// Gcc on x86\n#elif defined(ARCH_CPU_X86_FAMILY) && defined(__GNUC__)\ninline void MemoryBarrier() {\n  // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on\n  // this idiom. Also see http://en.wikipedia.org/wiki/Memory_ordering.\n  __asm__ __volatile__(\"\" : : : \"memory\");\n}\n#define LEVELDB_HAVE_MEMORY_BARRIER\n\n// Sun Studio\n#elif defined(ARCH_CPU_X86_FAMILY) && defined(__SUNPRO_CC)\ninline void MemoryBarrier() {\n  // See http://gcc.gnu.org/ml/gcc/2003-04/msg01180.html for a discussion on\n  // this idiom. Also see http://en.wikipedia.org/wiki/Memory_ordering.\n  asm volatile(\"\" : : : \"memory\");\n}\n#define LEVELDB_HAVE_MEMORY_BARRIER\n\n// ARM Linux\n#elif defined(ARCH_CPU_ARM_FAMILY) && defined(__linux__)\ntypedef void (*LinuxKernelMemoryBarrierFunc)(void);\n// The Linux ARM kernel provides a highly optimized device-specific memory\n// barrier function at a fixed memory address that is mapped in every\n// user-level process.\n//\n// This beats using CPU-specific instructions which are, on single-core\n// devices, un-necessary and very costly (e.g. ARMv7-A \"dmb\" takes more\n// than 180ns on a Cortex-A8 like the one on a Nexus One). Benchmarking\n// shows that the extra function call cost is completely negligible on\n// multi-core devices.\n//\ninline void MemoryBarrier() {\n  (*(LinuxKernelMemoryBarrierFunc)0xffff0fa0)();\n}\n#define LEVELDB_HAVE_MEMORY_BARRIER\n\n// ARM64\n#elif defined(ARCH_CPU_ARM64_FAMILY)\ninline void MemoryBarrier() {\n  asm volatile(\"dmb sy\" : : : \"memory\");\n}\n#define LEVELDB_HAVE_MEMORY_BARRIER\n\n// PPC\n#elif defined(ARCH_CPU_PPC_FAMILY) && defined(__GNUC__)\ninline void MemoryBarrier() {\n  // TODO for some powerpc expert: is there a cheaper suitable variant?\n  // Perhaps by having separate barriers for acquire and release ops.\n  asm volatile(\"sync\" : : : \"memory\");\n}\n#define LEVELDB_HAVE_MEMORY_BARRIER\n\n// MIPS\n#elif defined(ARCH_CPU_MIPS_FAMILY) && defined(__GNUC__)\ninline void MemoryBarrier() {\n  __asm__ __volatile__(\"sync\" : : : \"memory\");\n}\n#define LEVELDB_HAVE_MEMORY_BARRIER\n\n#endif\n\n// AtomicPointer built using platform-specific MemoryBarrier()\n#if defined(LEVELDB_HAVE_MEMORY_BARRIER)\nclass AtomicPointer {\n private:\n  void* rep_;\n public:\n  AtomicPointer() { }\n  explicit AtomicPointer(void* p) : rep_(p) {}\n  inline void* NoBarrier_Load() const { return rep_; }\n  inline void NoBarrier_Store(void* v) { rep_ = v; }\n  inline void* Acquire_Load() const {\n    void* result = rep_;\n    MemoryBarrier();\n    return result;\n  }\n  inline void Release_Store(void* v) {\n    MemoryBarrier();\n    rep_ = v;\n  }\n};\n\n// Atomic pointer based on sparc memory barriers\n#elif defined(__sparcv9) && defined(__GNUC__)\nclass AtomicPointer {\n private:\n  void* rep_;\n public:\n  AtomicPointer() { }\n  explicit AtomicPointer(void* v) : rep_(v) { }\n  inline void* Acquire_Load() const {\n    void* val;\n    __asm__ __volatile__ (\n        \"ldx [%[rep_]], %[val] \\n\\t\"\n         \"membar #LoadLoad|#LoadStore \\n\\t\"\n        : [val] \"=r\" (val)\n        : [rep_] \"r\" (&rep_)\n        : \"memory\");\n    return val;\n  }\n  inline void Release_Store(void* v) {\n    __asm__ __volatile__ (\n        \"membar #LoadStore|#StoreStore \\n\\t\"\n        \"stx %[v], [%[rep_]] \\n\\t\"\n        :\n        : [rep_] \"r\" (&rep_), [v] \"r\" (v)\n        : \"memory\");\n  }\n  inline void* NoBarrier_Load() const { return rep_; }\n  inline void NoBarrier_Store(void* v) { rep_ = v; }\n};\n\n// Atomic pointer based on ia64 acq/rel\n#elif defined(__ia64) && defined(__GNUC__)\nclass AtomicPointer {\n private:\n  void* rep_;\n public:\n  AtomicPointer() { }\n  explicit AtomicPointer(void* v) : rep_(v) { }\n  inline void* Acquire_Load() const {\n    void* val    ;\n    __asm__ __volatile__ (\n        \"ld8.acq %[val] = [%[rep_]] \\n\\t\"\n        : [val] \"=r\" (val)\n        : [rep_] \"r\" (&rep_)\n        : \"memory\"\n        );\n    return val;\n  }\n  inline void Release_Store(void* v) {\n    __asm__ __volatile__ (\n        \"st8.rel [%[rep_]] = %[v]  \\n\\t\"\n        :\n        : [rep_] \"r\" (&rep_), [v] \"r\" (v)\n        : \"memory\"\n        );\n  }\n  inline void* NoBarrier_Load() const { return rep_; }\n  inline void NoBarrier_Store(void* v) { rep_ = v; }\n};\n\n// We have neither MemoryBarrier(), nor <atomic>\n#else\n#error Please implement AtomicPointer for this platform.\n\n#endif\n#endif\n\n#undef LEVELDB_HAVE_MEMORY_BARRIER\n#undef ARCH_CPU_X86_FAMILY\n#undef ARCH_CPU_ARM_FAMILY\n#undef ARCH_CPU_ARM64_FAMILY\n#undef ARCH_CPU_PPC_FAMILY\n\n}  // namespace port\n}  // namespace leveldb\n\n#endif  // PORT_ATOMIC_POINTER_H_\n"
  },
  {
    "path": "src/leveldb/port/port.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_PORT_PORT_H_\n#define STORAGE_LEVELDB_PORT_PORT_H_\n\n#include <string.h>\n\n// Include the appropriate platform specific file below.  If you are\n// porting to a new platform, see \"port_example.h\" for documentation\n// of what the new port_<platform>.h file must provide.\n#if defined(LEVELDB_PLATFORM_POSIX)\n#  include \"port/port_posix.h\"\n#elif defined(LEVELDB_PLATFORM_CHROMIUM)\n#  include \"port/port_chromium.h\"\n#elif defined(LEVELDB_PLATFORM_WINDOWS)\n#  include \"port/port_win.h\"\n#endif\n\n#endif  // STORAGE_LEVELDB_PORT_PORT_H_\n"
  },
  {
    "path": "src/leveldb/port/port_example.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// This file contains the specification, but not the implementations,\n// of the types/operations/etc. that should be defined by a platform\n// specific port_<platform>.h file.  Use this file as a reference for\n// how to port this package to a new platform.\n\n#ifndef STORAGE_LEVELDB_PORT_PORT_EXAMPLE_H_\n#define STORAGE_LEVELDB_PORT_PORT_EXAMPLE_H_\n\nnamespace leveldb {\nnamespace port {\n\n// TODO(jorlow): Many of these belong more in the environment class rather than\n//               here. We should try moving them and see if it affects perf.\n\n// The following boolean constant must be true on a little-endian machine\n// and false otherwise.\nstatic const bool kLittleEndian = true /* or some other expression */;\n\n// ------------------ Threading -------------------\n\n// A Mutex represents an exclusive lock.\nclass Mutex {\n public:\n  Mutex();\n  ~Mutex();\n\n  // Lock the mutex.  Waits until other lockers have exited.\n  // Will deadlock if the mutex is already locked by this thread.\n  void Lock();\n\n  // Unlock the mutex.\n  // REQUIRES: This mutex was locked by this thread.\n  void Unlock();\n\n  // Optionally crash if this thread does not hold this mutex.\n  // The implementation must be fast, especially if NDEBUG is\n  // defined.  The implementation is allowed to skip all checks.\n  void AssertHeld();\n};\n\nclass CondVar {\n public:\n  explicit CondVar(Mutex* mu);\n  ~CondVar();\n\n  // Atomically release *mu and block on this condition variable until\n  // either a call to SignalAll(), or a call to Signal() that picks\n  // this thread to wakeup.\n  // REQUIRES: this thread holds *mu\n  void Wait();\n\n  // If there are some threads waiting, wake up at least one of them.\n  void Signal();\n\n  // Wake up all waiting threads.\n  void SignallAll();\n};\n\n// Thread-safe initialization.\n// Used as follows:\n//      static port::OnceType init_control = LEVELDB_ONCE_INIT;\n//      static void Initializer() { ... do something ...; }\n//      ...\n//      port::InitOnce(&init_control, &Initializer);\ntypedef intptr_t OnceType;\n#define LEVELDB_ONCE_INIT 0\nextern void InitOnce(port::OnceType*, void (*initializer)());\n\n// A type that holds a pointer that can be read or written atomically\n// (i.e., without word-tearing.)\nclass AtomicPointer {\n private:\n  intptr_t rep_;\n public:\n  // Initialize to arbitrary value\n  AtomicPointer();\n\n  // Initialize to hold v\n  explicit AtomicPointer(void* v) : rep_(v) { }\n\n  // Read and return the stored pointer with the guarantee that no\n  // later memory access (read or write) by this thread can be\n  // reordered ahead of this read.\n  void* Acquire_Load() const;\n\n  // Set v as the stored pointer with the guarantee that no earlier\n  // memory access (read or write) by this thread can be reordered\n  // after this store.\n  void Release_Store(void* v);\n\n  // Read the stored pointer with no ordering guarantees.\n  void* NoBarrier_Load() const;\n\n  // Set va as the stored pointer with no ordering guarantees.\n  void NoBarrier_Store(void* v);\n};\n\n// ------------------ Compression -------------------\n\n// Store the snappy compression of \"input[0,input_length-1]\" in *output.\n// Returns false if snappy is not supported by this port.\nextern bool Snappy_Compress(const char* input, size_t input_length,\n                            std::string* output);\n\n// If input[0,input_length-1] looks like a valid snappy compressed\n// buffer, store the size of the uncompressed data in *result and\n// return true.  Else return false.\nextern bool Snappy_GetUncompressedLength(const char* input, size_t length,\n                                         size_t* result);\n\n// Attempt to snappy uncompress input[0,input_length-1] into *output.\n// Returns true if successful, false if the input is invalid lightweight\n// compressed data.\n//\n// REQUIRES: at least the first \"n\" bytes of output[] must be writable\n// where \"n\" is the result of a successful call to\n// Snappy_GetUncompressedLength.\nextern bool Snappy_Uncompress(const char* input_data, size_t input_length,\n                              char* output);\n\n// ------------------ Miscellaneous -------------------\n\n// If heap profiling is not supported, returns false.\n// Else repeatedly calls (*func)(arg, data, n) and then returns true.\n// The concatenation of all \"data[0,n-1]\" fragments is the heap profile.\nextern bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg);\n\n// Determine whether a working accelerated crc32 implementation exists\n// Returns true if AcceleratedCRC32C is safe to call\nbool HasAcceleratedCRC32C();\n\n// Extend the CRC to include the first n bytes of buf.\n//\n// Returns zero if the CRC cannot be extended using acceleration, else returns\n// the newly extended CRC value (which may also be zero).\nuint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size);\n\n}  // namespace port\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_PORT_PORT_EXAMPLE_H_\n"
  },
  {
    "path": "src/leveldb/port/port_posix.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"port/port_posix.h\"\n\n#include <cstdlib>\n#include <stdio.h>\n#include <string.h>\n\n#if (defined(__x86_64__) || defined(__i386__)) && defined(__GNUC__)\n#include <cpuid.h>\n#endif\n\nnamespace leveldb {\nnamespace port {\n\nstatic void PthreadCall(const char* label, int result) {\n  if (result != 0) {\n    fprintf(stderr, \"pthread %s: %s\\n\", label, strerror(result));\n    abort();\n  }\n}\n\nMutex::Mutex() { PthreadCall(\"init mutex\", pthread_mutex_init(&mu_, NULL)); }\n\nMutex::~Mutex() { PthreadCall(\"destroy mutex\", pthread_mutex_destroy(&mu_)); }\n\nvoid Mutex::Lock() { PthreadCall(\"lock\", pthread_mutex_lock(&mu_)); }\n\nvoid Mutex::Unlock() { PthreadCall(\"unlock\", pthread_mutex_unlock(&mu_)); }\n\nCondVar::CondVar(Mutex* mu)\n    : mu_(mu) {\n    PthreadCall(\"init cv\", pthread_cond_init(&cv_, NULL));\n}\n\nCondVar::~CondVar() { PthreadCall(\"destroy cv\", pthread_cond_destroy(&cv_)); }\n\nvoid CondVar::Wait() {\n  PthreadCall(\"wait\", pthread_cond_wait(&cv_, &mu_->mu_));\n}\n\nvoid CondVar::Signal() {\n  PthreadCall(\"signal\", pthread_cond_signal(&cv_));\n}\n\nvoid CondVar::SignalAll() {\n  PthreadCall(\"broadcast\", pthread_cond_broadcast(&cv_));\n}\n\nvoid InitOnce(OnceType* once, void (*initializer)()) {\n  PthreadCall(\"once\", pthread_once(once, initializer));\n}\n\nbool HasAcceleratedCRC32C() {\n#if (defined(__x86_64__) || defined(__i386__)) && defined(__GNUC__)\n  unsigned int eax, ebx, ecx, edx;\n  __get_cpuid(1, &eax, &ebx, &ecx, &edx);\n  return (ecx & (1 << 20)) != 0;\n#else\n  return false;\n#endif\n}\n\n}  // namespace port\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/port/port_posix.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// See port_example.h for documentation for the following types/functions.\n\n#ifndef STORAGE_LEVELDB_PORT_PORT_POSIX_H_\n#define STORAGE_LEVELDB_PORT_PORT_POSIX_H_\n\n#undef PLATFORM_IS_LITTLE_ENDIAN\n#if defined(OS_MACOSX)\n  #include <machine/endian.h>\n  #if defined(__DARWIN_LITTLE_ENDIAN) && defined(__DARWIN_BYTE_ORDER)\n    #define PLATFORM_IS_LITTLE_ENDIAN \\\n        (__DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN)\n  #endif\n#elif defined(OS_SOLARIS)\n  #include <sys/isa_defs.h>\n  #ifdef _LITTLE_ENDIAN\n    #define PLATFORM_IS_LITTLE_ENDIAN true\n  #else\n    #define PLATFORM_IS_LITTLE_ENDIAN false\n  #endif\n#elif defined(OS_FREEBSD) || defined(OS_OPENBSD) ||\\\n      defined(OS_NETBSD) || defined(OS_DRAGONFLYBSD)\n  #include <sys/types.h>\n  #include <sys/endian.h>\n  #define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN)\n#elif defined(OS_HPUX)\n  #define PLATFORM_IS_LITTLE_ENDIAN false\n#elif defined(OS_ANDROID)\n  // Due to a bug in the NDK x86 <sys/endian.h> definition,\n  // _BYTE_ORDER must be used instead of __BYTE_ORDER on Android.\n  // See http://code.google.com/p/android/issues/detail?id=39824\n  #include <endian.h>\n  #define PLATFORM_IS_LITTLE_ENDIAN  (_BYTE_ORDER == _LITTLE_ENDIAN)\n#else\n  #include <endian.h>\n#endif\n\n#include <pthread.h>\n#ifdef SNAPPY\n#include <snappy.h>\n#endif\n#include <stdint.h>\n#include <string>\n#include \"port/atomic_pointer.h\"\n\n#ifndef PLATFORM_IS_LITTLE_ENDIAN\n#define PLATFORM_IS_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN)\n#endif\n\n#if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\\\n    defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\\\n    defined(OS_ANDROID) || defined(OS_HPUX) || defined(CYGWIN)\n// Use fread/fwrite/fflush on platforms without _unlocked variants\n#define fread_unlocked fread\n#define fwrite_unlocked fwrite\n#define fflush_unlocked fflush\n#endif\n\n#if defined(OS_FREEBSD) ||\\\n    defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD)\n// Use fsync() on platforms without fdatasync()\n#define fdatasync fsync\n#endif\n\n#if defined(OS_MACOSX)\n#define fdatasync(fd) fcntl(fd, F_FULLFSYNC, 0)\n#endif\n\n#if defined(OS_ANDROID) && __ANDROID_API__ < 9\n// fdatasync() was only introduced in API level 9 on Android. Use fsync()\n// when targetting older platforms.\n#define fdatasync fsync\n#endif\n\nnamespace leveldb {\nnamespace port {\n\nstatic const bool kLittleEndian = PLATFORM_IS_LITTLE_ENDIAN;\n#undef PLATFORM_IS_LITTLE_ENDIAN\n\nclass CondVar;\n\nclass Mutex {\n public:\n  Mutex();\n  ~Mutex();\n\n  void Lock();\n  void Unlock();\n  void AssertHeld() { }\n\n private:\n  friend class CondVar;\n  pthread_mutex_t mu_;\n\n  // No copying\n  Mutex(const Mutex&);\n  void operator=(const Mutex&);\n};\n\nclass CondVar {\n public:\n  explicit CondVar(Mutex* mu);\n  ~CondVar();\n  void Wait();\n  void Signal();\n  void SignalAll();\n private:\n  pthread_cond_t cv_;\n  Mutex* mu_;\n};\n\ntypedef pthread_once_t OnceType;\n#define LEVELDB_ONCE_INIT PTHREAD_ONCE_INIT\nextern void InitOnce(OnceType* once, void (*initializer)());\n\ninline bool Snappy_Compress(const char* input, size_t length,\n                            ::std::string* output) {\n#ifdef SNAPPY\n  output->resize(snappy::MaxCompressedLength(length));\n  size_t outlen;\n  snappy::RawCompress(input, length, &(*output)[0], &outlen);\n  output->resize(outlen);\n  return true;\n#endif\n\n  return false;\n}\n\ninline bool Snappy_GetUncompressedLength(const char* input, size_t length,\n                                         size_t* result) {\n#ifdef SNAPPY\n  return snappy::GetUncompressedLength(input, length, result);\n#else\n  return false;\n#endif\n}\n\ninline bool Snappy_Uncompress(const char* input, size_t length,\n                              char* output) {\n#ifdef SNAPPY\n  return snappy::RawUncompress(input, length, output);\n#else\n  return false;\n#endif\n}\n\ninline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {\n  return false;\n}\n\nbool HasAcceleratedCRC32C();\nuint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size);\n\n} // namespace port\n} // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_PORT_PORT_POSIX_H_\n"
  },
  {
    "path": "src/leveldb/port/port_posix_sse.cc",
    "content": "// Copyright 2016 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// A portable implementation of crc32c, optimized to handle\n// four bytes at a time.\n//\n// In a separate source file to allow this accelerated CRC32C function to be\n// compiled with the appropriate compiler flags to enable x86 SSE 4.2\n// instructions.\n\n#include <stdint.h>\n#include <string.h>\n#include \"port/port.h\"\n\n#if defined(LEVELDB_PLATFORM_POSIX_SSE)\n\n#if defined(_MSC_VER)\n#include <intrin.h>\n#elif defined(__GNUC__) && defined(__SSE4_2__)\n#include <nmmintrin.h>\n#endif\n\n#endif  // defined(LEVELDB_PLATFORM_POSIX_SSE)\n\nnamespace leveldb {\nnamespace port {\n\n#if defined(LEVELDB_PLATFORM_POSIX_SSE)\n\n// Used to fetch a naturally-aligned 32-bit word in little endian byte-order\nstatic inline uint32_t LE_LOAD32(const uint8_t *p) {\n  // SSE is x86 only, so ensured that |p| is always little-endian.\n  uint32_t word;\n  memcpy(&word, p, sizeof(word));\n  return word;\n}\n\n#if defined(_M_X64) || defined(__x86_64__)  // LE_LOAD64 is only used on x64.\n\n// Used to fetch a naturally-aligned 64-bit word in little endian byte-order\nstatic inline uint64_t LE_LOAD64(const uint8_t *p) {\n  uint64_t dword;\n  memcpy(&dword, p, sizeof(dword));\n  return dword;\n}\n\n#endif  // defined(_M_X64) || defined(__x86_64__)\n\n#endif  // defined(LEVELDB_PLATFORM_POSIX_SSE)\n\n// For further improvements see Intel publication at:\n// http://download.intel.com/design/intarch/papers/323405.pdf\nuint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size) {\n#if !defined(LEVELDB_PLATFORM_POSIX_SSE)\n  return 0;\n#else\n\n  const uint8_t *p = reinterpret_cast<const uint8_t *>(buf);\n  const uint8_t *e = p + size;\n  uint32_t l = crc ^ 0xffffffffu;\n\n#define STEP1 do {                              \\\n    l = _mm_crc32_u8(l, *p++);                  \\\n} while (0)\n#define STEP4 do {                              \\\n    l = _mm_crc32_u32(l, LE_LOAD32(p));         \\\n    p += 4;                                     \\\n} while (0)\n#define STEP8 do {                              \\\n    l = _mm_crc32_u64(l, LE_LOAD64(p));         \\\n    p += 8;                                     \\\n} while (0)\n\n  if (size > 16) {\n    // Process unaligned bytes\n    for (unsigned int i = reinterpret_cast<uintptr_t>(p) % 8; i; --i) {\n      STEP1;\n    }\n\n    // _mm_crc32_u64 is only available on x64.\n#if defined(_M_X64) || defined(__x86_64__)\n    // Process 8 bytes at a time\n    while ((e-p) >= 8) {\n      STEP8;\n    }\n    // Process 4 bytes at a time\n    if ((e-p) >= 4) {\n      STEP4;\n    }\n#else  // !(defined(_M_X64) || defined(__x86_64__))\n    // Process 4 bytes at a time\n    while ((e-p) >= 4) {\n      STEP4;\n    }\n#endif  // defined(_M_X64) || defined(__x86_64__)\n  }\n  // Process the last few bytes\n  while (p != e) {\n    STEP1;\n  }\n#undef STEP8\n#undef STEP4\n#undef STEP1\n  return l ^ 0xffffffffu;\n#endif  // defined(LEVELDB_PLATFORM_POSIX_SSE)\n}\n\n}  // namespace port\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/port/port_win.cc",
    "content": "// LevelDB Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// See port_example.h for documentation for the following types/functions.\n\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n// \n//  * Redistributions of source code must retain the above copyright\n//    notice, this list of conditions and the following disclaimer.\n//  * Redistributions in binary form must reproduce the above copyright\n//    notice, this list of conditions and the following disclaimer in the\n//    documentation and/or other materials provided with the distribution.\n//  * Neither the name of the University of California, Berkeley nor the\n//    names of its contributors may be used to endorse or promote products\n//    derived from this software without specific prior written permission.\n// \n// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY\n// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n\n#include \"port/port_win.h\"\n\n#include <windows.h>\n#include <cassert>\n#include <intrin.h>\n\nnamespace leveldb {\nnamespace port {\n\nMutex::Mutex() :\n    cs_(NULL) {\n  assert(!cs_);\n  cs_ = static_cast<void *>(new CRITICAL_SECTION());\n  ::InitializeCriticalSection(static_cast<CRITICAL_SECTION *>(cs_));\n  assert(cs_);\n}\n\nMutex::~Mutex() {\n  assert(cs_);\n  ::DeleteCriticalSection(static_cast<CRITICAL_SECTION *>(cs_));\n  delete static_cast<CRITICAL_SECTION *>(cs_);\n  cs_ = NULL;\n  assert(!cs_);\n}\n\nvoid Mutex::Lock() {\n  assert(cs_);\n  ::EnterCriticalSection(static_cast<CRITICAL_SECTION *>(cs_));\n}\n\nvoid Mutex::Unlock() {\n  assert(cs_);\n  ::LeaveCriticalSection(static_cast<CRITICAL_SECTION *>(cs_));\n}\n\nvoid Mutex::AssertHeld() {\n  assert(cs_);\n  assert(1);\n}\n\nCondVar::CondVar(Mutex* mu) :\n    waiting_(0), \n    mu_(mu), \n    sem1_(::CreateSemaphore(NULL, 0, 10000, NULL)), \n    sem2_(::CreateSemaphore(NULL, 0, 10000, NULL)) {\n  assert(mu_);\n}\n\nCondVar::~CondVar() {\n  ::CloseHandle(sem1_);\n  ::CloseHandle(sem2_);\n}\n\nvoid CondVar::Wait() {\n  mu_->AssertHeld();\n\n  wait_mtx_.Lock();\n  ++waiting_;\n  wait_mtx_.Unlock();\n\n  mu_->Unlock();\n\n  // initiate handshake\n  ::WaitForSingleObject(sem1_, INFINITE);\n  ::ReleaseSemaphore(sem2_, 1, NULL);\n  mu_->Lock();\n}\n\nvoid CondVar::Signal() {\n  wait_mtx_.Lock();\n  if (waiting_ > 0) {\n    --waiting_;\n\n    // finalize handshake\n    ::ReleaseSemaphore(sem1_, 1, NULL);\n    ::WaitForSingleObject(sem2_, INFINITE);\n  }\n  wait_mtx_.Unlock();\n}\n\nvoid CondVar::SignalAll() {\n  wait_mtx_.Lock();\n  ::ReleaseSemaphore(sem1_, waiting_, NULL);\n  while(waiting_ > 0) {\n    --waiting_;\n    ::WaitForSingleObject(sem2_, INFINITE);\n  }\n  wait_mtx_.Unlock();\n}\n\nAtomicPointer::AtomicPointer(void* v) {\n  Release_Store(v);\n}\n\nvoid InitOnce(OnceType* once, void (*initializer)()) {\n  once->InitOnce(initializer);\n}\n\nvoid* AtomicPointer::Acquire_Load() const {\n  void * p = NULL;\n  InterlockedExchangePointer(&p, rep_);\n  return p;\n}\n\nvoid AtomicPointer::Release_Store(void* v) {\n  InterlockedExchangePointer(&rep_, v);\n}\n\nvoid* AtomicPointer::NoBarrier_Load() const {\n  return rep_;\n}\n\nvoid AtomicPointer::NoBarrier_Store(void* v) {\n  rep_ = v;\n}\n\nbool HasAcceleratedCRC32C() {\n#if defined(__x86_64__) || defined(__i386__)\n  int cpu_info[4];\n  __cpuid(cpu_info, 1);\n  return (cpu_info[2] & (1 << 20)) != 0;\n#else\n  return false;\n#endif\n}\n\n}\n}\n"
  },
  {
    "path": "src/leveldb/port/port_win.h",
    "content": "// LevelDB Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// See port_example.h for documentation for the following types/functions.\n\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n// \n//  * Redistributions of source code must retain the above copyright\n//    notice, this list of conditions and the following disclaimer.\n//  * Redistributions in binary form must reproduce the above copyright\n//    notice, this list of conditions and the following disclaimer in the\n//    documentation and/or other materials provided with the distribution.\n//  * Neither the name of the University of California, Berkeley nor the\n//    names of its contributors may be used to endorse or promote products\n//    derived from this software without specific prior written permission.\n// \n// THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY\n// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n// DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n\n#ifndef STORAGE_LEVELDB_PORT_PORT_WIN_H_\n#define STORAGE_LEVELDB_PORT_PORT_WIN_H_\n\n#ifdef _MSC_VER\n#define snprintf _snprintf\n#define close _close\n#define fread_unlocked _fread_nolock\n#endif\n\n#include <string>\n#include <stdint.h>\n#ifdef SNAPPY\n#include <snappy.h>\n#endif\n\nnamespace leveldb {\nnamespace port {\n\n// Windows is little endian (for now :p)\nstatic const bool kLittleEndian = true;\n\nclass CondVar;\n\nclass Mutex {\n public:\n  Mutex();\n  ~Mutex();\n\n  void Lock();\n  void Unlock();\n  void AssertHeld();\n\n private:\n  friend class CondVar;\n  // critical sections are more efficient than mutexes\n  // but they are not recursive and can only be used to synchronize threads within the same process\n  // we use opaque void * to avoid including windows.h in port_win.h\n  void * cs_;\n\n  // No copying\n  Mutex(const Mutex&);\n  void operator=(const Mutex&);\n};\n\n// the Win32 API offers a dependable condition variable mechanism, but only starting with\n// Windows 2008 and Vista\n// no matter what we will implement our own condition variable with a semaphore\n// implementation as described in a paper written by Andrew D. Birrell in 2003\nclass CondVar {\n public:\n  explicit CondVar(Mutex* mu);\n  ~CondVar();\n  void Wait();\n  void Signal();\n  void SignalAll();\n private:\n  Mutex* mu_;\n  \n  Mutex wait_mtx_;\n  long waiting_;\n  \n  void * sem1_;\n  void * sem2_;\n  \n  \n};\n\nclass OnceType {\npublic:\n//    OnceType() : init_(false) {}\n    OnceType(const OnceType &once) : init_(once.init_) {}\n    OnceType(bool f) : init_(f) {}\n    void InitOnce(void (*initializer)()) {\n        mutex_.Lock();\n        if (!init_) {\n            init_ = true;\n            initializer();\n        }\n        mutex_.Unlock();\n    }\n\nprivate:\n    bool init_;\n    Mutex mutex_;\n};\n\n#define LEVELDB_ONCE_INIT false\nextern void InitOnce(port::OnceType*, void (*initializer)());\n\n// Storage for a lock-free pointer\nclass AtomicPointer {\n private:\n  void * rep_;\n public:\n  AtomicPointer() : rep_(NULL) { }\n  explicit AtomicPointer(void* v); \n  void* Acquire_Load() const;\n\n  void Release_Store(void* v);\n\n  void* NoBarrier_Load() const;\n\n  void NoBarrier_Store(void* v);\n};\n\ninline bool Snappy_Compress(const char* input, size_t length,\n                            ::std::string* output) {\n#ifdef SNAPPY\n  output->resize(snappy::MaxCompressedLength(length));\n  size_t outlen;\n  snappy::RawCompress(input, length, &(*output)[0], &outlen);\n  output->resize(outlen);\n  return true;\n#endif\n\n  return false;\n}\n\ninline bool Snappy_GetUncompressedLength(const char* input, size_t length,\n                                         size_t* result) {\n#ifdef SNAPPY\n  return snappy::GetUncompressedLength(input, length, result);\n#else\n  return false;\n#endif\n}\n\ninline bool Snappy_Uncompress(const char* input, size_t length,\n                              char* output) {\n#ifdef SNAPPY\n  return snappy::RawUncompress(input, length, output);\n#else\n  return false;\n#endif\n}\n\ninline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {\n  return false;\n}\n\nbool HasAcceleratedCRC32C();\nuint32_t AcceleratedCRC32C(uint32_t crc, const char* buf, size_t size);\n\n}\n}\n\n#endif  // STORAGE_LEVELDB_PORT_PORT_WIN_H_\n"
  },
  {
    "path": "src/leveldb/port/thread_annotations.h",
    "content": "// Copyright (c) 2012 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_\n#define STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_\n\n// Some environments provide custom macros to aid in static thread-safety\n// analysis.  Provide empty definitions of such macros unless they are already\n// defined.\n\n#ifndef EXCLUSIVE_LOCKS_REQUIRED\n#define EXCLUSIVE_LOCKS_REQUIRED(...)\n#endif\n\n#ifndef SHARED_LOCKS_REQUIRED\n#define SHARED_LOCKS_REQUIRED(...)\n#endif\n\n#ifndef LOCKS_EXCLUDED\n#define LOCKS_EXCLUDED(...)\n#endif\n\n#ifndef LOCK_RETURNED\n#define LOCK_RETURNED(x)\n#endif\n\n#ifndef LOCKABLE\n#define LOCKABLE\n#endif\n\n#ifndef SCOPED_LOCKABLE\n#define SCOPED_LOCKABLE\n#endif\n\n#ifndef EXCLUSIVE_LOCK_FUNCTION\n#define EXCLUSIVE_LOCK_FUNCTION(...)\n#endif\n\n#ifndef SHARED_LOCK_FUNCTION\n#define SHARED_LOCK_FUNCTION(...)\n#endif\n\n#ifndef EXCLUSIVE_TRYLOCK_FUNCTION\n#define EXCLUSIVE_TRYLOCK_FUNCTION(...)\n#endif\n\n#ifndef SHARED_TRYLOCK_FUNCTION\n#define SHARED_TRYLOCK_FUNCTION(...)\n#endif\n\n#ifndef UNLOCK_FUNCTION\n#define UNLOCK_FUNCTION(...)\n#endif\n\n#ifndef NO_THREAD_SAFETY_ANALYSIS\n#define NO_THREAD_SAFETY_ANALYSIS\n#endif\n\n#endif  // STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H_\n"
  },
  {
    "path": "src/leveldb/port/win/stdint.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n// MSVC didn't ship with this file until the 2010 version.\n\n#ifndef STORAGE_LEVELDB_PORT_WIN_STDINT_H_\n#define STORAGE_LEVELDB_PORT_WIN_STDINT_H_\n\n#if !defined(_MSC_VER)\n#error This file should only be included when compiling with MSVC.\n#endif\n\n// Define C99 equivalent types.\ntypedef signed char           int8_t;\ntypedef signed short          int16_t;\ntypedef signed int            int32_t;\ntypedef signed long long      int64_t;\ntypedef unsigned char         uint8_t;\ntypedef unsigned short        uint16_t;\ntypedef unsigned int          uint32_t;\ntypedef unsigned long long    uint64_t;\n\n#endif  // STORAGE_LEVELDB_PORT_WIN_STDINT_H_\n"
  },
  {
    "path": "src/leveldb/table/block.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// Decodes the blocks generated by block_builder.cc.\n\n#include \"table/block.h\"\n\n#include <vector>\n#include <algorithm>\n#include \"leveldb/comparator.h\"\n#include \"table/format.h\"\n#include \"util/coding.h\"\n#include \"util/logging.h\"\n\nnamespace leveldb {\n\ninline uint32_t Block::NumRestarts() const {\n  assert(size_ >= sizeof(uint32_t));\n  return DecodeFixed32(data_ + size_ - sizeof(uint32_t));\n}\n\nBlock::Block(const BlockContents& contents)\n    : data_(contents.data.data()),\n      size_(contents.data.size()),\n      owned_(contents.heap_allocated) {\n  if (size_ < sizeof(uint32_t)) {\n    size_ = 0;  // Error marker\n  } else {\n    size_t max_restarts_allowed = (size_-sizeof(uint32_t)) / sizeof(uint32_t);\n    if (NumRestarts() > max_restarts_allowed) {\n      // The size is too small for NumRestarts()\n      size_ = 0;\n    } else {\n      restart_offset_ = size_ - (1 + NumRestarts()) * sizeof(uint32_t);\n    }\n  }\n}\n\nBlock::~Block() {\n  if (owned_) {\n    delete[] data_;\n  }\n}\n\n// Helper routine: decode the next block entry starting at \"p\",\n// storing the number of shared key bytes, non_shared key bytes,\n// and the length of the value in \"*shared\", \"*non_shared\", and\n// \"*value_length\", respectively.  Will not dereference past \"limit\".\n//\n// If any errors are detected, returns NULL.  Otherwise, returns a\n// pointer to the key delta (just past the three decoded values).\nstatic inline const char* DecodeEntry(const char* p, const char* limit,\n                                      uint32_t* shared,\n                                      uint32_t* non_shared,\n                                      uint32_t* value_length) {\n  if (limit - p < 3) return NULL;\n  *shared = reinterpret_cast<const unsigned char*>(p)[0];\n  *non_shared = reinterpret_cast<const unsigned char*>(p)[1];\n  *value_length = reinterpret_cast<const unsigned char*>(p)[2];\n  if ((*shared | *non_shared | *value_length) < 128) {\n    // Fast path: all three values are encoded in one byte each\n    p += 3;\n  } else {\n    if ((p = GetVarint32Ptr(p, limit, shared)) == NULL) return NULL;\n    if ((p = GetVarint32Ptr(p, limit, non_shared)) == NULL) return NULL;\n    if ((p = GetVarint32Ptr(p, limit, value_length)) == NULL) return NULL;\n  }\n\n  if (static_cast<uint32_t>(limit - p) < (*non_shared + *value_length)) {\n    return NULL;\n  }\n  return p;\n}\n\nclass Block::Iter : public Iterator {\n private:\n  const Comparator* const comparator_;\n  const char* const data_;      // underlying block contents\n  uint32_t const restarts_;     // Offset of restart array (list of fixed32)\n  uint32_t const num_restarts_; // Number of uint32_t entries in restart array\n\n  // current_ is offset in data_ of current entry.  >= restarts_ if !Valid\n  uint32_t current_;\n  uint32_t restart_index_;  // Index of restart block in which current_ falls\n  std::string key_;\n  Slice value_;\n  Status status_;\n\n  inline int Compare(const Slice& a, const Slice& b) const {\n    return comparator_->Compare(a, b);\n  }\n\n  // Return the offset in data_ just past the end of the current entry.\n  inline uint32_t NextEntryOffset() const {\n    return (value_.data() + value_.size()) - data_;\n  }\n\n  uint32_t GetRestartPoint(uint32_t index) {\n    assert(index < num_restarts_);\n    return DecodeFixed32(data_ + restarts_ + index * sizeof(uint32_t));\n  }\n\n  void SeekToRestartPoint(uint32_t index) {\n    key_.clear();\n    restart_index_ = index;\n    // current_ will be fixed by ParseNextKey();\n\n    // ParseNextKey() starts at the end of value_, so set value_ accordingly\n    uint32_t offset = GetRestartPoint(index);\n    value_ = Slice(data_ + offset, 0);\n  }\n\n public:\n  Iter(const Comparator* comparator,\n       const char* data,\n       uint32_t restarts,\n       uint32_t num_restarts)\n      : comparator_(comparator),\n        data_(data),\n        restarts_(restarts),\n        num_restarts_(num_restarts),\n        current_(restarts_),\n        restart_index_(num_restarts_) {\n    assert(num_restarts_ > 0);\n  }\n\n  virtual bool Valid() const { return current_ < restarts_; }\n  virtual Status status() const { return status_; }\n  virtual Slice key() const {\n    assert(Valid());\n    return key_;\n  }\n  virtual Slice value() const {\n    assert(Valid());\n    return value_;\n  }\n\n  virtual void Next() {\n    assert(Valid());\n    ParseNextKey();\n  }\n\n  virtual void Prev() {\n    assert(Valid());\n\n    // Scan backwards to a restart point before current_\n    const uint32_t original = current_;\n    while (GetRestartPoint(restart_index_) >= original) {\n      if (restart_index_ == 0) {\n        // No more entries\n        current_ = restarts_;\n        restart_index_ = num_restarts_;\n        return;\n      }\n      restart_index_--;\n    }\n\n    SeekToRestartPoint(restart_index_);\n    do {\n      // Loop until end of current entry hits the start of original entry\n    } while (ParseNextKey() && NextEntryOffset() < original);\n  }\n\n  virtual void Seek(const Slice& target) {\n    // Binary search in restart array to find the last restart point\n    // with a key < target\n    uint32_t left = 0;\n    uint32_t right = num_restarts_ - 1;\n    while (left < right) {\n      uint32_t mid = (left + right + 1) / 2;\n      uint32_t region_offset = GetRestartPoint(mid);\n      uint32_t shared, non_shared, value_length;\n      const char* key_ptr = DecodeEntry(data_ + region_offset,\n                                        data_ + restarts_,\n                                        &shared, &non_shared, &value_length);\n      if (key_ptr == NULL || (shared != 0)) {\n        CorruptionError();\n        return;\n      }\n      Slice mid_key(key_ptr, non_shared);\n      if (Compare(mid_key, target) < 0) {\n        // Key at \"mid\" is smaller than \"target\".  Therefore all\n        // blocks before \"mid\" are uninteresting.\n        left = mid;\n      } else {\n        // Key at \"mid\" is >= \"target\".  Therefore all blocks at or\n        // after \"mid\" are uninteresting.\n        right = mid - 1;\n      }\n    }\n\n    // Linear search (within restart block) for first key >= target\n    SeekToRestartPoint(left);\n    while (true) {\n      if (!ParseNextKey()) {\n        return;\n      }\n      if (Compare(key_, target) >= 0) {\n        return;\n      }\n    }\n  }\n\n  virtual void SeekToFirst() {\n    SeekToRestartPoint(0);\n    ParseNextKey();\n  }\n\n  virtual void SeekToLast() {\n    SeekToRestartPoint(num_restarts_ - 1);\n    while (ParseNextKey() && NextEntryOffset() < restarts_) {\n      // Keep skipping\n    }\n  }\n\n private:\n  void CorruptionError() {\n    current_ = restarts_;\n    restart_index_ = num_restarts_;\n    status_ = Status::Corruption(\"bad entry in block\");\n    key_.clear();\n    value_.clear();\n  }\n\n  bool ParseNextKey() {\n    current_ = NextEntryOffset();\n    const char* p = data_ + current_;\n    const char* limit = data_ + restarts_;  // Restarts come right after data\n    if (p >= limit) {\n      // No more entries to return.  Mark as invalid.\n      current_ = restarts_;\n      restart_index_ = num_restarts_;\n      return false;\n    }\n\n    // Decode next entry\n    uint32_t shared, non_shared, value_length;\n    p = DecodeEntry(p, limit, &shared, &non_shared, &value_length);\n    if (p == NULL || key_.size() < shared) {\n      CorruptionError();\n      return false;\n    } else {\n      key_.resize(shared);\n      key_.append(p, non_shared);\n      value_ = Slice(p + non_shared, value_length);\n      while (restart_index_ + 1 < num_restarts_ &&\n             GetRestartPoint(restart_index_ + 1) < current_) {\n        ++restart_index_;\n      }\n      return true;\n    }\n  }\n};\n\nIterator* Block::NewIterator(const Comparator* cmp) {\n  if (size_ < sizeof(uint32_t)) {\n    return NewErrorIterator(Status::Corruption(\"bad block contents\"));\n  }\n  const uint32_t num_restarts = NumRestarts();\n  if (num_restarts == 0) {\n    return NewEmptyIterator();\n  } else {\n    return new Iter(cmp, data_, restart_offset_, num_restarts);\n  }\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/table/block.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_\n#define STORAGE_LEVELDB_TABLE_BLOCK_H_\n\n#include <stddef.h>\n#include <stdint.h>\n#include \"leveldb/iterator.h\"\n\nnamespace leveldb {\n\nstruct BlockContents;\nclass Comparator;\n\nclass Block {\n public:\n  // Initialize the block with the specified contents.\n  explicit Block(const BlockContents& contents);\n\n  ~Block();\n\n  size_t size() const { return size_; }\n  Iterator* NewIterator(const Comparator* comparator);\n\n private:\n  uint32_t NumRestarts() const;\n\n  const char* data_;\n  size_t size_;\n  uint32_t restart_offset_;     // Offset in data_ of restart array\n  bool owned_;                  // Block owns data_[]\n\n  // No copying allowed\n  Block(const Block&);\n  void operator=(const Block&);\n\n  class Iter;\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_TABLE_BLOCK_H_\n"
  },
  {
    "path": "src/leveldb/table/block_builder.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// BlockBuilder generates blocks where keys are prefix-compressed:\n//\n// When we store a key, we drop the prefix shared with the previous\n// string.  This helps reduce the space requirement significantly.\n// Furthermore, once every K keys, we do not apply the prefix\n// compression and store the entire key.  We call this a \"restart\n// point\".  The tail end of the block stores the offsets of all of the\n// restart points, and can be used to do a binary search when looking\n// for a particular key.  Values are stored as-is (without compression)\n// immediately following the corresponding key.\n//\n// An entry for a particular key-value pair has the form:\n//     shared_bytes: varint32\n//     unshared_bytes: varint32\n//     value_length: varint32\n//     key_delta: char[unshared_bytes]\n//     value: char[value_length]\n// shared_bytes == 0 for restart points.\n//\n// The trailer of the block has the form:\n//     restarts: uint32[num_restarts]\n//     num_restarts: uint32\n// restarts[i] contains the offset within the block of the ith restart point.\n\n#include \"table/block_builder.h\"\n\n#include <algorithm>\n#include <assert.h>\n#include \"leveldb/comparator.h\"\n#include \"leveldb/table_builder.h\"\n#include \"util/coding.h\"\n\nnamespace leveldb {\n\nBlockBuilder::BlockBuilder(const Options* options)\n    : options_(options),\n      restarts_(),\n      counter_(0),\n      finished_(false) {\n  assert(options->block_restart_interval >= 1);\n  restarts_.push_back(0);       // First restart point is at offset 0\n}\n\nvoid BlockBuilder::Reset() {\n  buffer_.clear();\n  restarts_.clear();\n  restarts_.push_back(0);       // First restart point is at offset 0\n  counter_ = 0;\n  finished_ = false;\n  last_key_.clear();\n}\n\nsize_t BlockBuilder::CurrentSizeEstimate() const {\n  return (buffer_.size() +                        // Raw data buffer\n          restarts_.size() * sizeof(uint32_t) +   // Restart array\n          sizeof(uint32_t));                      // Restart array length\n}\n\nSlice BlockBuilder::Finish() {\n  // Append restart array\n  for (size_t i = 0; i < restarts_.size(); i++) {\n    PutFixed32(&buffer_, restarts_[i]);\n  }\n  PutFixed32(&buffer_, restarts_.size());\n  finished_ = true;\n  return Slice(buffer_);\n}\n\nvoid BlockBuilder::Add(const Slice& key, const Slice& value) {\n  Slice last_key_piece(last_key_);\n  assert(!finished_);\n  assert(counter_ <= options_->block_restart_interval);\n  assert(buffer_.empty() // No values yet?\n         || options_->comparator->Compare(key, last_key_piece) > 0);\n  size_t shared = 0;\n  if (counter_ < options_->block_restart_interval) {\n    // See how much sharing to do with previous string\n    const size_t min_length = std::min(last_key_piece.size(), key.size());\n    while ((shared < min_length) && (last_key_piece[shared] == key[shared])) {\n      shared++;\n    }\n  } else {\n    // Restart compression\n    restarts_.push_back(buffer_.size());\n    counter_ = 0;\n  }\n  const size_t non_shared = key.size() - shared;\n\n  // Add \"<shared><non_shared><value_size>\" to buffer_\n  PutVarint32(&buffer_, shared);\n  PutVarint32(&buffer_, non_shared);\n  PutVarint32(&buffer_, value.size());\n\n  // Add string delta to buffer_ followed by value\n  buffer_.append(key.data() + shared, non_shared);\n  buffer_.append(value.data(), value.size());\n\n  // Update state\n  last_key_.resize(shared);\n  last_key_.append(key.data() + shared, non_shared);\n  assert(Slice(last_key_) == key);\n  counter_++;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/table/block_builder.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_\n#define STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_\n\n#include <vector>\n\n#include <stdint.h>\n#include \"leveldb/slice.h\"\n\nnamespace leveldb {\n\nstruct Options;\n\nclass BlockBuilder {\n public:\n  explicit BlockBuilder(const Options* options);\n\n  // Reset the contents as if the BlockBuilder was just constructed.\n  void Reset();\n\n  // REQUIRES: Finish() has not been called since the last call to Reset().\n  // REQUIRES: key is larger than any previously added key\n  void Add(const Slice& key, const Slice& value);\n\n  // Finish building the block and return a slice that refers to the\n  // block contents.  The returned slice will remain valid for the\n  // lifetime of this builder or until Reset() is called.\n  Slice Finish();\n\n  // Returns an estimate of the current (uncompressed) size of the block\n  // we are building.\n  size_t CurrentSizeEstimate() const;\n\n  // Return true iff no entries have been added since the last Reset()\n  bool empty() const {\n    return buffer_.empty();\n  }\n\n private:\n  const Options*        options_;\n  std::string           buffer_;      // Destination buffer\n  std::vector<uint32_t> restarts_;    // Restart points\n  int                   counter_;     // Number of entries emitted since restart\n  bool                  finished_;    // Has Finish() been called?\n  std::string           last_key_;\n\n  // No copying allowed\n  BlockBuilder(const BlockBuilder&);\n  void operator=(const BlockBuilder&);\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_\n"
  },
  {
    "path": "src/leveldb/table/filter_block.cc",
    "content": "// Copyright (c) 2012 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"table/filter_block.h\"\n\n#include \"leveldb/filter_policy.h\"\n#include \"util/coding.h\"\n\nnamespace leveldb {\n\n// See doc/table_format.md for an explanation of the filter block format.\n\n// Generate new filter every 2KB of data\nstatic const size_t kFilterBaseLg = 11;\nstatic const size_t kFilterBase = 1 << kFilterBaseLg;\n\nFilterBlockBuilder::FilterBlockBuilder(const FilterPolicy* policy)\n    : policy_(policy) {\n}\n\nvoid FilterBlockBuilder::StartBlock(uint64_t block_offset) {\n  uint64_t filter_index = (block_offset / kFilterBase);\n  assert(filter_index >= filter_offsets_.size());\n  while (filter_index > filter_offsets_.size()) {\n    GenerateFilter();\n  }\n}\n\nvoid FilterBlockBuilder::AddKey(const Slice& key) {\n  Slice k = key;\n  start_.push_back(keys_.size());\n  keys_.append(k.data(), k.size());\n}\n\nSlice FilterBlockBuilder::Finish() {\n  if (!start_.empty()) {\n    GenerateFilter();\n  }\n\n  // Append array of per-filter offsets\n  const uint32_t array_offset = result_.size();\n  for (size_t i = 0; i < filter_offsets_.size(); i++) {\n    PutFixed32(&result_, filter_offsets_[i]);\n  }\n\n  PutFixed32(&result_, array_offset);\n  result_.push_back(kFilterBaseLg);  // Save encoding parameter in result\n  return Slice(result_);\n}\n\nvoid FilterBlockBuilder::GenerateFilter() {\n  const size_t num_keys = start_.size();\n  if (num_keys == 0) {\n    // Fast path if there are no keys for this filter\n    filter_offsets_.push_back(result_.size());\n    return;\n  }\n\n  // Make list of keys from flattened key structure\n  start_.push_back(keys_.size());  // Simplify length computation\n  tmp_keys_.resize(num_keys);\n  for (size_t i = 0; i < num_keys; i++) {\n    const char* base = keys_.data() + start_[i];\n    size_t length = start_[i+1] - start_[i];\n    tmp_keys_[i] = Slice(base, length);\n  }\n\n  // Generate filter for current set of keys and append to result_.\n  filter_offsets_.push_back(result_.size());\n  policy_->CreateFilter(&tmp_keys_[0], static_cast<int>(num_keys), &result_);\n\n  tmp_keys_.clear();\n  keys_.clear();\n  start_.clear();\n}\n\nFilterBlockReader::FilterBlockReader(const FilterPolicy* policy,\n                                     const Slice& contents)\n    : policy_(policy),\n      data_(NULL),\n      offset_(NULL),\n      num_(0),\n      base_lg_(0) {\n  size_t n = contents.size();\n  if (n < 5) return;  // 1 byte for base_lg_ and 4 for start of offset array\n  base_lg_ = contents[n-1];\n  uint32_t last_word = DecodeFixed32(contents.data() + n - 5);\n  if (last_word > n - 5) return;\n  data_ = contents.data();\n  offset_ = data_ + last_word;\n  num_ = (n - 5 - last_word) / 4;\n}\n\nbool FilterBlockReader::KeyMayMatch(uint64_t block_offset, const Slice& key) {\n  uint64_t index = block_offset >> base_lg_;\n  if (index < num_) {\n    uint32_t start = DecodeFixed32(offset_ + index*4);\n    uint32_t limit = DecodeFixed32(offset_ + index*4 + 4);\n    if (start <= limit && limit <= static_cast<size_t>(offset_ - data_)) {\n      Slice filter = Slice(data_ + start, limit - start);\n      return policy_->KeyMayMatch(key, filter);\n    } else if (start == limit) {\n      // Empty filters do not match any keys\n      return false;\n    }\n  }\n  return true;  // Errors are treated as potential matches\n}\n\n}\n"
  },
  {
    "path": "src/leveldb/table/filter_block.h",
    "content": "// Copyright (c) 2012 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// A filter block is stored near the end of a Table file.  It contains\n// filters (e.g., bloom filters) for all data blocks in the table combined\n// into a single filter block.\n\n#ifndef STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_\n#define STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_\n\n#include <stddef.h>\n#include <stdint.h>\n#include <string>\n#include <vector>\n#include \"leveldb/slice.h\"\n#include \"util/hash.h\"\n\nnamespace leveldb {\n\nclass FilterPolicy;\n\n// A FilterBlockBuilder is used to construct all of the filters for a\n// particular Table.  It generates a single string which is stored as\n// a special block in the Table.\n//\n// The sequence of calls to FilterBlockBuilder must match the regexp:\n//      (StartBlock AddKey*)* Finish\nclass FilterBlockBuilder {\n public:\n  explicit FilterBlockBuilder(const FilterPolicy*);\n\n  void StartBlock(uint64_t block_offset);\n  void AddKey(const Slice& key);\n  Slice Finish();\n\n private:\n  void GenerateFilter();\n\n  const FilterPolicy* policy_;\n  std::string keys_;              // Flattened key contents\n  std::vector<size_t> start_;     // Starting index in keys_ of each key\n  std::string result_;            // Filter data computed so far\n  std::vector<Slice> tmp_keys_;   // policy_->CreateFilter() argument\n  std::vector<uint32_t> filter_offsets_;\n\n  // No copying allowed\n  FilterBlockBuilder(const FilterBlockBuilder&);\n  void operator=(const FilterBlockBuilder&);\n};\n\nclass FilterBlockReader {\n public:\n // REQUIRES: \"contents\" and *policy must stay live while *this is live.\n  FilterBlockReader(const FilterPolicy* policy, const Slice& contents);\n  bool KeyMayMatch(uint64_t block_offset, const Slice& key);\n\n private:\n  const FilterPolicy* policy_;\n  const char* data_;    // Pointer to filter data (at block-start)\n  const char* offset_;  // Pointer to beginning of offset array (at block-end)\n  size_t num_;          // Number of entries in offset array\n  size_t base_lg_;      // Encoding parameter (see kFilterBaseLg in .cc file)\n};\n\n}\n\n#endif  // STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_\n"
  },
  {
    "path": "src/leveldb/table/filter_block_test.cc",
    "content": "// Copyright (c) 2012 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"table/filter_block.h\"\n\n#include \"leveldb/filter_policy.h\"\n#include \"util/coding.h\"\n#include \"util/hash.h\"\n#include \"util/logging.h\"\n#include \"util/testharness.h\"\n#include \"util/testutil.h\"\n\nnamespace leveldb {\n\n// For testing: emit an array with one hash value per key\nclass TestHashFilter : public FilterPolicy {\n public:\n  virtual const char* Name() const {\n    return \"TestHashFilter\";\n  }\n\n  virtual void CreateFilter(const Slice* keys, int n, std::string* dst) const {\n    for (int i = 0; i < n; i++) {\n      uint32_t h = Hash(keys[i].data(), keys[i].size(), 1);\n      PutFixed32(dst, h);\n    }\n  }\n\n  virtual bool KeyMayMatch(const Slice& key, const Slice& filter) const {\n    uint32_t h = Hash(key.data(), key.size(), 1);\n    for (size_t i = 0; i + 4 <= filter.size(); i += 4) {\n      if (h == DecodeFixed32(filter.data() + i)) {\n        return true;\n      }\n    }\n    return false;\n  }\n};\n\nclass FilterBlockTest {\n public:\n  TestHashFilter policy_;\n};\n\nTEST(FilterBlockTest, EmptyBuilder) {\n  FilterBlockBuilder builder(&policy_);\n  Slice block = builder.Finish();\n  ASSERT_EQ(\"\\\\x00\\\\x00\\\\x00\\\\x00\\\\x0b\", EscapeString(block));\n  FilterBlockReader reader(&policy_, block);\n  ASSERT_TRUE(reader.KeyMayMatch(0, \"foo\"));\n  ASSERT_TRUE(reader.KeyMayMatch(100000, \"foo\"));\n}\n\nTEST(FilterBlockTest, SingleChunk) {\n  FilterBlockBuilder builder(&policy_);\n  builder.StartBlock(100);\n  builder.AddKey(\"foo\");\n  builder.AddKey(\"bar\");\n  builder.AddKey(\"box\");\n  builder.StartBlock(200);\n  builder.AddKey(\"box\");\n  builder.StartBlock(300);\n  builder.AddKey(\"hello\");\n  Slice block = builder.Finish();\n  FilterBlockReader reader(&policy_, block);\n  ASSERT_TRUE(reader.KeyMayMatch(100, \"foo\"));\n  ASSERT_TRUE(reader.KeyMayMatch(100, \"bar\"));\n  ASSERT_TRUE(reader.KeyMayMatch(100, \"box\"));\n  ASSERT_TRUE(reader.KeyMayMatch(100, \"hello\"));\n  ASSERT_TRUE(reader.KeyMayMatch(100, \"foo\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(100, \"missing\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(100, \"other\"));\n}\n\nTEST(FilterBlockTest, MultiChunk) {\n  FilterBlockBuilder builder(&policy_);\n\n  // First filter\n  builder.StartBlock(0);\n  builder.AddKey(\"foo\");\n  builder.StartBlock(2000);\n  builder.AddKey(\"bar\");\n\n  // Second filter\n  builder.StartBlock(3100);\n  builder.AddKey(\"box\");\n\n  // Third filter is empty\n\n  // Last filter\n  builder.StartBlock(9000);\n  builder.AddKey(\"box\");\n  builder.AddKey(\"hello\");\n\n  Slice block = builder.Finish();\n  FilterBlockReader reader(&policy_, block);\n\n  // Check first filter\n  ASSERT_TRUE(reader.KeyMayMatch(0, \"foo\"));\n  ASSERT_TRUE(reader.KeyMayMatch(2000, \"bar\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(0, \"box\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(0, \"hello\"));\n\n  // Check second filter\n  ASSERT_TRUE(reader.KeyMayMatch(3100, \"box\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(3100, \"foo\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(3100, \"bar\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(3100, \"hello\"));\n\n  // Check third filter (empty)\n  ASSERT_TRUE(! reader.KeyMayMatch(4100, \"foo\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(4100, \"bar\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(4100, \"box\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(4100, \"hello\"));\n\n  // Check last filter\n  ASSERT_TRUE(reader.KeyMayMatch(9000, \"box\"));\n  ASSERT_TRUE(reader.KeyMayMatch(9000, \"hello\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(9000, \"foo\"));\n  ASSERT_TRUE(! reader.KeyMayMatch(9000, \"bar\"));\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/table/format.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"table/format.h\"\n\n#include \"leveldb/env.h\"\n#include \"port/port.h\"\n#include \"table/block.h\"\n#include \"util/coding.h\"\n#include \"util/crc32c.h\"\n\nnamespace leveldb {\n\nvoid BlockHandle::EncodeTo(std::string* dst) const {\n  // Sanity check that all fields have been set\n  assert(offset_ != ~static_cast<uint64_t>(0));\n  assert(size_ != ~static_cast<uint64_t>(0));\n  PutVarint64(dst, offset_);\n  PutVarint64(dst, size_);\n}\n\nStatus BlockHandle::DecodeFrom(Slice* input) {\n  if (GetVarint64(input, &offset_) &&\n      GetVarint64(input, &size_)) {\n    return Status::OK();\n  } else {\n    return Status::Corruption(\"bad block handle\");\n  }\n}\n\nvoid Footer::EncodeTo(std::string* dst) const {\n  const size_t original_size = dst->size();\n  metaindex_handle_.EncodeTo(dst);\n  index_handle_.EncodeTo(dst);\n  dst->resize(2 * BlockHandle::kMaxEncodedLength);  // Padding\n  PutFixed32(dst, static_cast<uint32_t>(kTableMagicNumber & 0xffffffffu));\n  PutFixed32(dst, static_cast<uint32_t>(kTableMagicNumber >> 32));\n  assert(dst->size() == original_size + kEncodedLength);\n  (void)original_size;  // Disable unused variable warning.\n}\n\nStatus Footer::DecodeFrom(Slice* input) {\n  const char* magic_ptr = input->data() + kEncodedLength - 8;\n  const uint32_t magic_lo = DecodeFixed32(magic_ptr);\n  const uint32_t magic_hi = DecodeFixed32(magic_ptr + 4);\n  const uint64_t magic = ((static_cast<uint64_t>(magic_hi) << 32) |\n                          (static_cast<uint64_t>(magic_lo)));\n  if (magic != kTableMagicNumber) {\n    return Status::Corruption(\"not an sstable (bad magic number)\");\n  }\n\n  Status result = metaindex_handle_.DecodeFrom(input);\n  if (result.ok()) {\n    result = index_handle_.DecodeFrom(input);\n  }\n  if (result.ok()) {\n    // We skip over any leftover data (just padding for now) in \"input\"\n    const char* end = magic_ptr + 8;\n    *input = Slice(end, input->data() + input->size() - end);\n  }\n  return result;\n}\n\nStatus ReadBlock(RandomAccessFile* file,\n                 const ReadOptions& options,\n                 const BlockHandle& handle,\n                 BlockContents* result) {\n  result->data = Slice();\n  result->cachable = false;\n  result->heap_allocated = false;\n\n  // Read the block contents as well as the type/crc footer.\n  // See table_builder.cc for the code that built this structure.\n  size_t n = static_cast<size_t>(handle.size());\n  char* buf = new char[n + kBlockTrailerSize];\n  Slice contents;\n  Status s = file->Read(handle.offset(), n + kBlockTrailerSize, &contents, buf);\n  if (!s.ok()) {\n    delete[] buf;\n    return s;\n  }\n  if (contents.size() != n + kBlockTrailerSize) {\n    delete[] buf;\n    return Status::Corruption(\"truncated block read\", file->GetName());\n  }\n\n  // Check the crc of the type and the block contents\n  const char* data = contents.data();    // Pointer to where Read put the data\n  if (options.verify_checksums) {\n    const uint32_t crc = crc32c::Unmask(DecodeFixed32(data + n + 1));\n    const uint32_t actual = crc32c::Value(data, n + 1);\n    if (actual != crc) {\n      delete[] buf;\n      s = Status::Corruption(\"block checksum mismatch\", file->GetName());\n      return s;\n    }\n  }\n\n  switch (data[n]) {\n    case kNoCompression:\n      if (data != buf) {\n        // File implementation gave us pointer to some other data.\n        // Use it directly under the assumption that it will be live\n        // while the file is open.\n        delete[] buf;\n        result->data = Slice(data, n);\n        result->heap_allocated = false;\n        result->cachable = false;  // Do not double-cache\n      } else {\n        result->data = Slice(buf, n);\n        result->heap_allocated = true;\n        result->cachable = true;\n      }\n\n      // Ok\n      break;\n    case kSnappyCompression: {\n      size_t ulength = 0;\n      if (!port::Snappy_GetUncompressedLength(data, n, &ulength)) {\n        delete[] buf;\n        return Status::Corruption(\"corrupted compressed block contents\", file->GetName());\n      }\n      char* ubuf = new char[ulength];\n      if (!port::Snappy_Uncompress(data, n, ubuf)) {\n        delete[] buf;\n        delete[] ubuf;\n        return Status::Corruption(\"corrupted compressed block contents\", file->GetName());\n      }\n      delete[] buf;\n      result->data = Slice(ubuf, ulength);\n      result->heap_allocated = true;\n      result->cachable = true;\n      break;\n    }\n    default:\n      delete[] buf;\n      return Status::Corruption(\"bad block type\", file->GetName());\n  }\n\n  return Status::OK();\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/table/format.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_TABLE_FORMAT_H_\n#define STORAGE_LEVELDB_TABLE_FORMAT_H_\n\n#include <string>\n#include <stdint.h>\n#include \"leveldb/slice.h\"\n#include \"leveldb/status.h\"\n#include \"leveldb/table_builder.h\"\n\nnamespace leveldb {\n\nclass Block;\nclass RandomAccessFile;\nstruct ReadOptions;\n\n// BlockHandle is a pointer to the extent of a file that stores a data\n// block or a meta block.\nclass BlockHandle {\n public:\n  BlockHandle();\n\n  // The offset of the block in the file.\n  uint64_t offset() const { return offset_; }\n  void set_offset(uint64_t offset) { offset_ = offset; }\n\n  // The size of the stored block\n  uint64_t size() const { return size_; }\n  void set_size(uint64_t size) { size_ = size; }\n\n  void EncodeTo(std::string* dst) const;\n  Status DecodeFrom(Slice* input);\n\n  // Maximum encoding length of a BlockHandle\n  enum { kMaxEncodedLength = 10 + 10 };\n\n private:\n  uint64_t offset_;\n  uint64_t size_;\n};\n\n// Footer encapsulates the fixed information stored at the tail\n// end of every table file.\nclass Footer {\n public:\n  Footer() { }\n\n  // The block handle for the metaindex block of the table\n  const BlockHandle& metaindex_handle() const { return metaindex_handle_; }\n  void set_metaindex_handle(const BlockHandle& h) { metaindex_handle_ = h; }\n\n  // The block handle for the index block of the table\n  const BlockHandle& index_handle() const {\n    return index_handle_;\n  }\n  void set_index_handle(const BlockHandle& h) {\n    index_handle_ = h;\n  }\n\n  void EncodeTo(std::string* dst) const;\n  Status DecodeFrom(Slice* input);\n\n  // Encoded length of a Footer.  Note that the serialization of a\n  // Footer will always occupy exactly this many bytes.  It consists\n  // of two block handles and a magic number.\n  enum {\n    kEncodedLength = 2*BlockHandle::kMaxEncodedLength + 8\n  };\n\n private:\n  BlockHandle metaindex_handle_;\n  BlockHandle index_handle_;\n};\n\n// kTableMagicNumber was picked by running\n//    echo http://code.google.com/p/leveldb/ | sha1sum\n// and taking the leading 64 bits.\nstatic const uint64_t kTableMagicNumber = 0xdb4775248b80fb57ull;\n\n// 1-byte type + 32-bit crc\nstatic const size_t kBlockTrailerSize = 5;\n\nstruct BlockContents {\n  Slice data;           // Actual contents of data\n  bool cachable;        // True iff data can be cached\n  bool heap_allocated;  // True iff caller should delete[] data.data()\n};\n\n// Read the block identified by \"handle\" from \"file\".  On failure\n// return non-OK.  On success fill *result and return OK.\nextern Status ReadBlock(RandomAccessFile* file,\n                        const ReadOptions& options,\n                        const BlockHandle& handle,\n                        BlockContents* result);\n\n// Implementation details follow.  Clients should ignore,\n\ninline BlockHandle::BlockHandle()\n    : offset_(~static_cast<uint64_t>(0)),\n      size_(~static_cast<uint64_t>(0)) {\n}\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_TABLE_FORMAT_H_\n"
  },
  {
    "path": "src/leveldb/table/iterator.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/iterator.h\"\n\nnamespace leveldb {\n\nIterator::Iterator() {\n  cleanup_.function = NULL;\n  cleanup_.next = NULL;\n}\n\nIterator::~Iterator() {\n  if (cleanup_.function != NULL) {\n    (*cleanup_.function)(cleanup_.arg1, cleanup_.arg2);\n    for (Cleanup* c = cleanup_.next; c != NULL; ) {\n      (*c->function)(c->arg1, c->arg2);\n      Cleanup* next = c->next;\n      delete c;\n      c = next;\n    }\n  }\n}\n\nvoid Iterator::RegisterCleanup(CleanupFunction func, void* arg1, void* arg2) {\n  assert(func != NULL);\n  Cleanup* c;\n  if (cleanup_.function == NULL) {\n    c = &cleanup_;\n  } else {\n    c = new Cleanup;\n    c->next = cleanup_.next;\n    cleanup_.next = c;\n  }\n  c->function = func;\n  c->arg1 = arg1;\n  c->arg2 = arg2;\n}\n\nnamespace {\nclass EmptyIterator : public Iterator {\n public:\n  EmptyIterator(const Status& s) : status_(s) { }\n  virtual bool Valid() const { return false; }\n  virtual void Seek(const Slice& target) { }\n  virtual void SeekToFirst() { }\n  virtual void SeekToLast() { }\n  virtual void Next() { assert(false); }\n  virtual void Prev() { assert(false); }\n  Slice key() const { assert(false); return Slice(); }\n  Slice value() const { assert(false); return Slice(); }\n  virtual Status status() const { return status_; }\n private:\n  Status status_;\n};\n}  // namespace\n\nIterator* NewEmptyIterator() {\n  return new EmptyIterator(Status::OK());\n}\n\nIterator* NewErrorIterator(const Status& status) {\n  return new EmptyIterator(status);\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/table/iterator_wrapper.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_TABLE_ITERATOR_WRAPPER_H_\n#define STORAGE_LEVELDB_TABLE_ITERATOR_WRAPPER_H_\n\n#include \"leveldb/iterator.h\"\n#include \"leveldb/slice.h\"\n\nnamespace leveldb {\n\n// A internal wrapper class with an interface similar to Iterator that\n// caches the valid() and key() results for an underlying iterator.\n// This can help avoid virtual function calls and also gives better\n// cache locality.\nclass IteratorWrapper {\n public:\n  IteratorWrapper(): iter_(NULL), valid_(false) { }\n  explicit IteratorWrapper(Iterator* iter): iter_(NULL) {\n    Set(iter);\n  }\n  ~IteratorWrapper() { delete iter_; }\n  Iterator* iter() const { return iter_; }\n\n  // Takes ownership of \"iter\" and will delete it when destroyed, or\n  // when Set() is invoked again.\n  void Set(Iterator* iter) {\n    delete iter_;\n    iter_ = iter;\n    if (iter_ == NULL) {\n      valid_ = false;\n    } else {\n      Update();\n    }\n  }\n\n\n  // Iterator interface methods\n  bool Valid() const        { return valid_; }\n  Slice key() const         { assert(Valid()); return key_; }\n  Slice value() const       { assert(Valid()); return iter_->value(); }\n  // Methods below require iter() != NULL\n  Status status() const     { assert(iter_); return iter_->status(); }\n  void Next()               { assert(iter_); iter_->Next();        Update(); }\n  void Prev()               { assert(iter_); iter_->Prev();        Update(); }\n  void Seek(const Slice& k) { assert(iter_); iter_->Seek(k);       Update(); }\n  void SeekToFirst()        { assert(iter_); iter_->SeekToFirst(); Update(); }\n  void SeekToLast()         { assert(iter_); iter_->SeekToLast();  Update(); }\n\n private:\n  void Update() {\n    valid_ = iter_->Valid();\n    if (valid_) {\n      key_ = iter_->key();\n    }\n  }\n\n  Iterator* iter_;\n  bool valid_;\n  Slice key_;\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_TABLE_ITERATOR_WRAPPER_H_\n"
  },
  {
    "path": "src/leveldb/table/merger.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"table/merger.h\"\n\n#include \"leveldb/comparator.h\"\n#include \"leveldb/iterator.h\"\n#include \"table/iterator_wrapper.h\"\n\nnamespace leveldb {\n\nnamespace {\nclass MergingIterator : public Iterator {\n public:\n  MergingIterator(const Comparator* comparator, Iterator** children, int n)\n      : comparator_(comparator),\n        children_(new IteratorWrapper[n]),\n        n_(n),\n        current_(NULL),\n        direction_(kForward) {\n    for (int i = 0; i < n; i++) {\n      children_[i].Set(children[i]);\n    }\n  }\n\n  virtual ~MergingIterator() {\n    delete[] children_;\n  }\n\n  virtual bool Valid() const {\n    return (current_ != NULL);\n  }\n\n  virtual void SeekToFirst() {\n    for (int i = 0; i < n_; i++) {\n      children_[i].SeekToFirst();\n    }\n    FindSmallest();\n    direction_ = kForward;\n  }\n\n  virtual void SeekToLast() {\n    for (int i = 0; i < n_; i++) {\n      children_[i].SeekToLast();\n    }\n    FindLargest();\n    direction_ = kReverse;\n  }\n\n  virtual void Seek(const Slice& target) {\n    for (int i = 0; i < n_; i++) {\n      children_[i].Seek(target);\n    }\n    FindSmallest();\n    direction_ = kForward;\n  }\n\n  virtual void Next() {\n    assert(Valid());\n\n    // Ensure that all children are positioned after key().\n    // If we are moving in the forward direction, it is already\n    // true for all of the non-current_ children since current_ is\n    // the smallest child and key() == current_->key().  Otherwise,\n    // we explicitly position the non-current_ children.\n    if (direction_ != kForward) {\n      for (int i = 0; i < n_; i++) {\n        IteratorWrapper* child = &children_[i];\n        if (child != current_) {\n          child->Seek(key());\n          if (child->Valid() &&\n              comparator_->Compare(key(), child->key()) == 0) {\n            child->Next();\n          }\n        }\n      }\n      direction_ = kForward;\n    }\n\n    current_->Next();\n    FindSmallest();\n  }\n\n  virtual void Prev() {\n    assert(Valid());\n\n    // Ensure that all children are positioned before key().\n    // If we are moving in the reverse direction, it is already\n    // true for all of the non-current_ children since current_ is\n    // the largest child and key() == current_->key().  Otherwise,\n    // we explicitly position the non-current_ children.\n    if (direction_ != kReverse) {\n      for (int i = 0; i < n_; i++) {\n        IteratorWrapper* child = &children_[i];\n        if (child != current_) {\n          child->Seek(key());\n          if (child->Valid()) {\n            // Child is at first entry >= key().  Step back one to be < key()\n            child->Prev();\n          } else {\n            // Child has no entries >= key().  Position at last entry.\n            child->SeekToLast();\n          }\n        }\n      }\n      direction_ = kReverse;\n    }\n\n    current_->Prev();\n    FindLargest();\n  }\n\n  virtual Slice key() const {\n    assert(Valid());\n    return current_->key();\n  }\n\n  virtual Slice value() const {\n    assert(Valid());\n    return current_->value();\n  }\n\n  virtual Status status() const {\n    Status status;\n    for (int i = 0; i < n_; i++) {\n      status = children_[i].status();\n      if (!status.ok()) {\n        break;\n      }\n    }\n    return status;\n  }\n\n private:\n  void FindSmallest();\n  void FindLargest();\n\n  // We might want to use a heap in case there are lots of children.\n  // For now we use a simple array since we expect a very small number\n  // of children in leveldb.\n  const Comparator* comparator_;\n  IteratorWrapper* children_;\n  int n_;\n  IteratorWrapper* current_;\n\n  // Which direction is the iterator moving?\n  enum Direction {\n    kForward,\n    kReverse\n  };\n  Direction direction_;\n};\n\nvoid MergingIterator::FindSmallest() {\n  IteratorWrapper* smallest = NULL;\n  for (int i = 0; i < n_; i++) {\n    IteratorWrapper* child = &children_[i];\n    if (child->Valid()) {\n      if (smallest == NULL) {\n        smallest = child;\n      } else if (comparator_->Compare(child->key(), smallest->key()) < 0) {\n        smallest = child;\n      }\n    }\n  }\n  current_ = smallest;\n}\n\nvoid MergingIterator::FindLargest() {\n  IteratorWrapper* largest = NULL;\n  for (int i = n_-1; i >= 0; i--) {\n    IteratorWrapper* child = &children_[i];\n    if (child->Valid()) {\n      if (largest == NULL) {\n        largest = child;\n      } else if (comparator_->Compare(child->key(), largest->key()) > 0) {\n        largest = child;\n      }\n    }\n  }\n  current_ = largest;\n}\n}  // namespace\n\nIterator* NewMergingIterator(const Comparator* cmp, Iterator** list, int n) {\n  assert(n >= 0);\n  if (n == 0) {\n    return NewEmptyIterator();\n  } else if (n == 1) {\n    return list[0];\n  } else {\n    return new MergingIterator(cmp, list, n);\n  }\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/table/merger.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_TABLE_MERGER_H_\n#define STORAGE_LEVELDB_TABLE_MERGER_H_\n\nnamespace leveldb {\n\nclass Comparator;\nclass Iterator;\n\n// Return an iterator that provided the union of the data in\n// children[0,n-1].  Takes ownership of the child iterators and\n// will delete them when the result iterator is deleted.\n//\n// The result does no duplicate suppression.  I.e., if a particular\n// key is present in K child iterators, it will be yielded K times.\n//\n// REQUIRES: n >= 0\nextern Iterator* NewMergingIterator(\n    const Comparator* comparator, Iterator** children, int n);\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_TABLE_MERGER_H_\n"
  },
  {
    "path": "src/leveldb/table/table.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/table.h\"\n\n#include \"leveldb/cache.h\"\n#include \"leveldb/comparator.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/filter_policy.h\"\n#include \"leveldb/options.h\"\n#include \"table/block.h\"\n#include \"table/filter_block.h\"\n#include \"table/format.h\"\n#include \"table/two_level_iterator.h\"\n#include \"util/coding.h\"\n\nnamespace leveldb {\n\nstruct Table::Rep {\n  ~Rep() {\n    delete filter;\n    delete [] filter_data;\n    delete index_block;\n  }\n\n  Options options;\n  Status status;\n  RandomAccessFile* file;\n  uint64_t cache_id;\n  FilterBlockReader* filter;\n  const char* filter_data;\n\n  BlockHandle metaindex_handle;  // Handle to metaindex_block: saved from footer\n  Block* index_block;\n};\n\nStatus Table::Open(const Options& options,\n                   RandomAccessFile* file,\n                   uint64_t size,\n                   Table** table) {\n  *table = NULL;\n  if (size < Footer::kEncodedLength) {\n    return Status::Corruption(\"file is too short to be an sstable\");\n  }\n\n  char footer_space[Footer::kEncodedLength];\n  Slice footer_input;\n  Status s = file->Read(size - Footer::kEncodedLength, Footer::kEncodedLength,\n                        &footer_input, footer_space);\n  if (!s.ok()) return s;\n\n  Footer footer;\n  s = footer.DecodeFrom(&footer_input);\n  if (!s.ok()) return s;\n\n  // Read the index block\n  BlockContents contents;\n  Block* index_block = NULL;\n  if (s.ok()) {\n    ReadOptions opt;\n    if (options.paranoid_checks) {\n      opt.verify_checksums = true;\n    }\n    s = ReadBlock(file, opt, footer.index_handle(), &contents);\n    if (s.ok()) {\n      index_block = new Block(contents);\n    }\n  }\n\n  if (s.ok()) {\n    // We've successfully read the footer and the index block: we're\n    // ready to serve requests.\n    Rep* rep = new Table::Rep;\n    rep->options = options;\n    rep->file = file;\n    rep->metaindex_handle = footer.metaindex_handle();\n    rep->index_block = index_block;\n    rep->cache_id = (options.block_cache ? options.block_cache->NewId() : 0);\n    rep->filter_data = NULL;\n    rep->filter = NULL;\n    *table = new Table(rep);\n    (*table)->ReadMeta(footer);\n  } else {\n    delete index_block;\n  }\n\n  return s;\n}\n\nvoid Table::ReadMeta(const Footer& footer) {\n  if (rep_->options.filter_policy == NULL) {\n    return;  // Do not need any metadata\n  }\n\n  // TODO(sanjay): Skip this if footer.metaindex_handle() size indicates\n  // it is an empty block.\n  ReadOptions opt;\n  if (rep_->options.paranoid_checks) {\n    opt.verify_checksums = true;\n  }\n  BlockContents contents;\n  if (!ReadBlock(rep_->file, opt, footer.metaindex_handle(), &contents).ok()) {\n    // Do not propagate errors since meta info is not needed for operation\n    return;\n  }\n  Block* meta = new Block(contents);\n\n  Iterator* iter = meta->NewIterator(BytewiseComparator());\n  std::string key = \"filter.\";\n  key.append(rep_->options.filter_policy->Name());\n  iter->Seek(key);\n  if (iter->Valid() && iter->key() == Slice(key)) {\n    ReadFilter(iter->value());\n  }\n  delete iter;\n  delete meta;\n}\n\nvoid Table::ReadFilter(const Slice& filter_handle_value) {\n  Slice v = filter_handle_value;\n  BlockHandle filter_handle;\n  if (!filter_handle.DecodeFrom(&v).ok()) {\n    return;\n  }\n\n  // We might want to unify with ReadBlock() if we start\n  // requiring checksum verification in Table::Open.\n  ReadOptions opt;\n  if (rep_->options.paranoid_checks) {\n    opt.verify_checksums = true;\n  }\n  BlockContents block;\n  if (!ReadBlock(rep_->file, opt, filter_handle, &block).ok()) {\n    return;\n  }\n  if (block.heap_allocated) {\n    rep_->filter_data = block.data.data();     // Will need to delete later\n  }\n  rep_->filter = new FilterBlockReader(rep_->options.filter_policy, block.data);\n}\n\nTable::~Table() {\n  delete rep_;\n}\n\nstatic void DeleteBlock(void* arg, void* ignored) {\n  delete reinterpret_cast<Block*>(arg);\n}\n\nstatic void DeleteCachedBlock(const Slice& key, void* value) {\n  Block* block = reinterpret_cast<Block*>(value);\n  delete block;\n}\n\nstatic void ReleaseBlock(void* arg, void* h) {\n  Cache* cache = reinterpret_cast<Cache*>(arg);\n  Cache::Handle* handle = reinterpret_cast<Cache::Handle*>(h);\n  cache->Release(handle);\n}\n\n// Convert an index iterator value (i.e., an encoded BlockHandle)\n// into an iterator over the contents of the corresponding block.\nIterator* Table::BlockReader(void* arg,\n                             const ReadOptions& options,\n                             const Slice& index_value) {\n  Table* table = reinterpret_cast<Table*>(arg);\n  Cache* block_cache = table->rep_->options.block_cache;\n  Block* block = NULL;\n  Cache::Handle* cache_handle = NULL;\n\n  BlockHandle handle;\n  Slice input = index_value;\n  Status s = handle.DecodeFrom(&input);\n  // We intentionally allow extra stuff in index_value so that we\n  // can add more features in the future.\n\n  if (s.ok()) {\n    BlockContents contents;\n    if (block_cache != NULL) {\n      char cache_key_buffer[16];\n      EncodeFixed64(cache_key_buffer, table->rep_->cache_id);\n      EncodeFixed64(cache_key_buffer+8, handle.offset());\n      Slice key(cache_key_buffer, sizeof(cache_key_buffer));\n      cache_handle = block_cache->Lookup(key);\n      if (cache_handle != NULL) {\n        block = reinterpret_cast<Block*>(block_cache->Value(cache_handle));\n      } else {\n        s = ReadBlock(table->rep_->file, options, handle, &contents);\n        if (s.ok()) {\n          block = new Block(contents);\n          if (contents.cachable && options.fill_cache) {\n            cache_handle = block_cache->Insert(\n                key, block, block->size(), &DeleteCachedBlock);\n          }\n        }\n      }\n    } else {\n      s = ReadBlock(table->rep_->file, options, handle, &contents);\n      if (s.ok()) {\n        block = new Block(contents);\n      }\n    }\n  }\n\n  Iterator* iter;\n  if (block != NULL) {\n    iter = block->NewIterator(table->rep_->options.comparator);\n    if (cache_handle == NULL) {\n      iter->RegisterCleanup(&DeleteBlock, block, NULL);\n    } else {\n      iter->RegisterCleanup(&ReleaseBlock, block_cache, cache_handle);\n    }\n  } else {\n    iter = NewErrorIterator(s);\n  }\n  return iter;\n}\n\nIterator* Table::NewIterator(const ReadOptions& options) const {\n  return NewTwoLevelIterator(\n      rep_->index_block->NewIterator(rep_->options.comparator),\n      &Table::BlockReader, const_cast<Table*>(this), options);\n}\n\nStatus Table::InternalGet(const ReadOptions& options, const Slice& k,\n                          void* arg,\n                          void (*saver)(void*, const Slice&, const Slice&)) {\n  Status s;\n  Iterator* iiter = rep_->index_block->NewIterator(rep_->options.comparator);\n  iiter->Seek(k);\n  if (iiter->Valid()) {\n    Slice handle_value = iiter->value();\n    FilterBlockReader* filter = rep_->filter;\n    BlockHandle handle;\n    if (filter != NULL &&\n        handle.DecodeFrom(&handle_value).ok() &&\n        !filter->KeyMayMatch(handle.offset(), k)) {\n      // Not found\n    } else {\n      Iterator* block_iter = BlockReader(this, options, iiter->value());\n      block_iter->Seek(k);\n      if (block_iter->Valid()) {\n        (*saver)(arg, block_iter->key(), block_iter->value());\n      }\n      s = block_iter->status();\n      delete block_iter;\n    }\n  }\n  if (s.ok()) {\n    s = iiter->status();\n  }\n  delete iiter;\n  return s;\n}\n\n\nuint64_t Table::ApproximateOffsetOf(const Slice& key) const {\n  Iterator* index_iter =\n      rep_->index_block->NewIterator(rep_->options.comparator);\n  index_iter->Seek(key);\n  uint64_t result;\n  if (index_iter->Valid()) {\n    BlockHandle handle;\n    Slice input = index_iter->value();\n    Status s = handle.DecodeFrom(&input);\n    if (s.ok()) {\n      result = handle.offset();\n    } else {\n      // Strange: we can't decode the block handle in the index block.\n      // We'll just return the offset of the metaindex block, which is\n      // close to the whole file size for this case.\n      result = rep_->metaindex_handle.offset();\n    }\n  } else {\n    // key is past the last key in the file.  Approximate the offset\n    // by returning the offset of the metaindex block (which is\n    // right near the end of the file).\n    result = rep_->metaindex_handle.offset();\n  }\n  delete index_iter;\n  return result;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/table/table_builder.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/table_builder.h\"\n\n#include <assert.h>\n#include \"leveldb/comparator.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/filter_policy.h\"\n#include \"leveldb/options.h\"\n#include \"table/block_builder.h\"\n#include \"table/filter_block.h\"\n#include \"table/format.h\"\n#include \"util/coding.h\"\n#include \"util/crc32c.h\"\n\nnamespace leveldb {\n\nstruct TableBuilder::Rep {\n  Options options;\n  Options index_block_options;\n  WritableFile* file;\n  uint64_t offset;\n  Status status;\n  BlockBuilder data_block;\n  BlockBuilder index_block;\n  std::string last_key;\n  int64_t num_entries;\n  bool closed;          // Either Finish() or Abandon() has been called.\n  FilterBlockBuilder* filter_block;\n\n  // We do not emit the index entry for a block until we have seen the\n  // first key for the next data block.  This allows us to use shorter\n  // keys in the index block.  For example, consider a block boundary\n  // between the keys \"the quick brown fox\" and \"the who\".  We can use\n  // \"the r\" as the key for the index block entry since it is >= all\n  // entries in the first block and < all entries in subsequent\n  // blocks.\n  //\n  // Invariant: r->pending_index_entry is true only if data_block is empty.\n  bool pending_index_entry;\n  BlockHandle pending_handle;  // Handle to add to index block\n\n  std::string compressed_output;\n\n  Rep(const Options& opt, WritableFile* f)\n      : options(opt),\n        index_block_options(opt),\n        file(f),\n        offset(0),\n        data_block(&options),\n        index_block(&index_block_options),\n        num_entries(0),\n        closed(false),\n        filter_block(opt.filter_policy == NULL ? NULL\n                     : new FilterBlockBuilder(opt.filter_policy)),\n        pending_index_entry(false) {\n    index_block_options.block_restart_interval = 1;\n  }\n};\n\nTableBuilder::TableBuilder(const Options& options, WritableFile* file)\n    : rep_(new Rep(options, file)) {\n  if (rep_->filter_block != NULL) {\n    rep_->filter_block->StartBlock(0);\n  }\n}\n\nTableBuilder::~TableBuilder() {\n  assert(rep_->closed);  // Catch errors where caller forgot to call Finish()\n  delete rep_->filter_block;\n  delete rep_;\n}\n\nStatus TableBuilder::ChangeOptions(const Options& options) {\n  // Note: if more fields are added to Options, update\n  // this function to catch changes that should not be allowed to\n  // change in the middle of building a Table.\n  if (options.comparator != rep_->options.comparator) {\n    return Status::InvalidArgument(\"changing comparator while building table\");\n  }\n\n  // Note that any live BlockBuilders point to rep_->options and therefore\n  // will automatically pick up the updated options.\n  rep_->options = options;\n  rep_->index_block_options = options;\n  rep_->index_block_options.block_restart_interval = 1;\n  return Status::OK();\n}\n\nvoid TableBuilder::Add(const Slice& key, const Slice& value) {\n  Rep* r = rep_;\n  assert(!r->closed);\n  if (!ok()) return;\n  if (r->num_entries > 0) {\n    assert(r->options.comparator->Compare(key, Slice(r->last_key)) > 0);\n  }\n\n  if (r->pending_index_entry) {\n    assert(r->data_block.empty());\n    r->options.comparator->FindShortestSeparator(&r->last_key, key);\n    std::string handle_encoding;\n    r->pending_handle.EncodeTo(&handle_encoding);\n    r->index_block.Add(r->last_key, Slice(handle_encoding));\n    r->pending_index_entry = false;\n  }\n\n  if (r->filter_block != NULL) {\n    r->filter_block->AddKey(key);\n  }\n\n  r->last_key.assign(key.data(), key.size());\n  r->num_entries++;\n  r->data_block.Add(key, value);\n\n  const size_t estimated_block_size = r->data_block.CurrentSizeEstimate();\n  if (estimated_block_size >= r->options.block_size) {\n    Flush();\n  }\n}\n\nvoid TableBuilder::Flush() {\n  Rep* r = rep_;\n  assert(!r->closed);\n  if (!ok()) return;\n  if (r->data_block.empty()) return;\n  assert(!r->pending_index_entry);\n  WriteBlock(&r->data_block, &r->pending_handle);\n  if (ok()) {\n    r->pending_index_entry = true;\n    r->status = r->file->Flush();\n  }\n  if (r->filter_block != NULL) {\n    r->filter_block->StartBlock(r->offset);\n  }\n}\n\nvoid TableBuilder::WriteBlock(BlockBuilder* block, BlockHandle* handle) {\n  // File format contains a sequence of blocks where each block has:\n  //    block_data: uint8[n]\n  //    type: uint8\n  //    crc: uint32\n  assert(ok());\n  Rep* r = rep_;\n  Slice raw = block->Finish();\n\n  Slice block_contents;\n  CompressionType type = r->options.compression;\n  // TODO(postrelease): Support more compression options: zlib?\n  switch (type) {\n    case kNoCompression:\n      block_contents = raw;\n      break;\n\n    case kSnappyCompression: {\n      std::string* compressed = &r->compressed_output;\n      if (port::Snappy_Compress(raw.data(), raw.size(), compressed) &&\n          compressed->size() < raw.size() - (raw.size() / 8u)) {\n        block_contents = *compressed;\n      } else {\n        // Snappy not supported, or compressed less than 12.5%, so just\n        // store uncompressed form\n        block_contents = raw;\n        type = kNoCompression;\n      }\n      break;\n    }\n  }\n  WriteRawBlock(block_contents, type, handle);\n  r->compressed_output.clear();\n  block->Reset();\n}\n\nvoid TableBuilder::WriteRawBlock(const Slice& block_contents,\n                                 CompressionType type,\n                                 BlockHandle* handle) {\n  Rep* r = rep_;\n  handle->set_offset(r->offset);\n  handle->set_size(block_contents.size());\n  r->status = r->file->Append(block_contents);\n  if (r->status.ok()) {\n    char trailer[kBlockTrailerSize];\n    trailer[0] = type;\n    uint32_t crc = crc32c::Value(block_contents.data(), block_contents.size());\n    crc = crc32c::Extend(crc, trailer, 1);  // Extend crc to cover block type\n    EncodeFixed32(trailer+1, crc32c::Mask(crc));\n    r->status = r->file->Append(Slice(trailer, kBlockTrailerSize));\n    if (r->status.ok()) {\n      r->offset += block_contents.size() + kBlockTrailerSize;\n    }\n  }\n}\n\nStatus TableBuilder::status() const {\n  return rep_->status;\n}\n\nStatus TableBuilder::Finish() {\n  Rep* r = rep_;\n  Flush();\n  assert(!r->closed);\n  r->closed = true;\n\n  BlockHandle filter_block_handle, metaindex_block_handle, index_block_handle;\n\n  // Write filter block\n  if (ok() && r->filter_block != NULL) {\n    WriteRawBlock(r->filter_block->Finish(), kNoCompression,\n                  &filter_block_handle);\n  }\n\n  // Write metaindex block\n  if (ok()) {\n    BlockBuilder meta_index_block(&r->options);\n    if (r->filter_block != NULL) {\n      // Add mapping from \"filter.Name\" to location of filter data\n      std::string key = \"filter.\";\n      key.append(r->options.filter_policy->Name());\n      std::string handle_encoding;\n      filter_block_handle.EncodeTo(&handle_encoding);\n      meta_index_block.Add(key, handle_encoding);\n    }\n\n    // TODO(postrelease): Add stats and other meta blocks\n    WriteBlock(&meta_index_block, &metaindex_block_handle);\n  }\n\n  // Write index block\n  if (ok()) {\n    if (r->pending_index_entry) {\n      r->options.comparator->FindShortSuccessor(&r->last_key);\n      std::string handle_encoding;\n      r->pending_handle.EncodeTo(&handle_encoding);\n      r->index_block.Add(r->last_key, Slice(handle_encoding));\n      r->pending_index_entry = false;\n    }\n    WriteBlock(&r->index_block, &index_block_handle);\n  }\n\n  // Write footer\n  if (ok()) {\n    Footer footer;\n    footer.set_metaindex_handle(metaindex_block_handle);\n    footer.set_index_handle(index_block_handle);\n    std::string footer_encoding;\n    footer.EncodeTo(&footer_encoding);\n    r->status = r->file->Append(footer_encoding);\n    if (r->status.ok()) {\n      r->offset += footer_encoding.size();\n    }\n  }\n  return r->status;\n}\n\nvoid TableBuilder::Abandon() {\n  Rep* r = rep_;\n  assert(!r->closed);\n  r->closed = true;\n}\n\nuint64_t TableBuilder::NumEntries() const {\n  return rep_->num_entries;\n}\n\nuint64_t TableBuilder::FileSize() const {\n  return rep_->offset;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/table/table_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/table.h\"\n\n#include <map>\n#include <string>\n#include \"db/dbformat.h\"\n#include \"db/memtable.h\"\n#include \"db/write_batch_internal.h\"\n#include \"leveldb/db.h\"\n#include \"leveldb/env.h\"\n#include \"leveldb/iterator.h\"\n#include \"leveldb/table_builder.h\"\n#include \"table/block.h\"\n#include \"table/block_builder.h\"\n#include \"table/format.h\"\n#include \"util/random.h\"\n#include \"util/testharness.h\"\n#include \"util/testutil.h\"\n\nnamespace leveldb {\n\n// Return reverse of \"key\".\n// Used to test non-lexicographic comparators.\nstatic std::string Reverse(const Slice& key) {\n  std::string str(key.ToString());\n  std::string rev(\"\");\n  for (std::string::reverse_iterator rit = str.rbegin();\n       rit != str.rend(); ++rit) {\n    rev.push_back(*rit);\n  }\n  return rev;\n}\n\nnamespace {\nclass ReverseKeyComparator : public Comparator {\n public:\n  virtual const char* Name() const {\n    return \"leveldb.ReverseBytewiseComparator\";\n  }\n\n  virtual int Compare(const Slice& a, const Slice& b) const {\n    return BytewiseComparator()->Compare(Reverse(a), Reverse(b));\n  }\n\n  virtual void FindShortestSeparator(\n      std::string* start,\n      const Slice& limit) const {\n    std::string s = Reverse(*start);\n    std::string l = Reverse(limit);\n    BytewiseComparator()->FindShortestSeparator(&s, l);\n    *start = Reverse(s);\n  }\n\n  virtual void FindShortSuccessor(std::string* key) const {\n    std::string s = Reverse(*key);\n    BytewiseComparator()->FindShortSuccessor(&s);\n    *key = Reverse(s);\n  }\n};\n}  // namespace\nstatic ReverseKeyComparator reverse_key_comparator;\n\nstatic void Increment(const Comparator* cmp, std::string* key) {\n  if (cmp == BytewiseComparator()) {\n    key->push_back('\\0');\n  } else {\n    assert(cmp == &reverse_key_comparator);\n    std::string rev = Reverse(*key);\n    rev.push_back('\\0');\n    *key = Reverse(rev);\n  }\n}\n\n// An STL comparator that uses a Comparator\nnamespace {\nstruct STLLessThan {\n  const Comparator* cmp;\n\n  STLLessThan() : cmp(BytewiseComparator()) { }\n  STLLessThan(const Comparator* c) : cmp(c) { }\n  bool operator()(const std::string& a, const std::string& b) const {\n    return cmp->Compare(Slice(a), Slice(b)) < 0;\n  }\n};\n}  // namespace\n\nclass StringSink: public WritableFile {\n public:\n  ~StringSink() { }\n\n  const std::string& contents() const { return contents_; }\n\n  virtual Status Close() { return Status::OK(); }\n  virtual Status Flush() { return Status::OK(); }\n  virtual Status Sync() { return Status::OK(); }\n\n  virtual Status Append(const Slice& data) {\n    contents_.append(data.data(), data.size());\n    return Status::OK();\n  }\n\n private:\n  std::string contents_;\n};\n\n\nclass StringSource: public RandomAccessFile {\n public:\n  StringSource(const Slice& contents)\n      : contents_(contents.data(), contents.size()) {\n  }\n\n  virtual ~StringSource() { }\n\n  uint64_t Size() const { return contents_.size(); }\n\n  virtual Status Read(uint64_t offset, size_t n, Slice* result,\n                       char* scratch) const {\n    if (offset > contents_.size()) {\n      return Status::InvalidArgument(\"invalid Read offset\");\n    }\n    if (offset + n > contents_.size()) {\n      n = contents_.size() - offset;\n    }\n    memcpy(scratch, &contents_[offset], n);\n    *result = Slice(scratch, n);\n    return Status::OK();\n  }\n\n private:\n  std::string contents_;\n};\n\ntypedef std::map<std::string, std::string, STLLessThan> KVMap;\n\n// Helper class for tests to unify the interface between\n// BlockBuilder/TableBuilder and Block/Table.\nclass Constructor {\n public:\n  explicit Constructor(const Comparator* cmp) : data_(STLLessThan(cmp)) { }\n  virtual ~Constructor() { }\n\n  void Add(const std::string& key, const Slice& value) {\n    data_[key] = value.ToString();\n  }\n\n  // Finish constructing the data structure with all the keys that have\n  // been added so far.  Returns the keys in sorted order in \"*keys\"\n  // and stores the key/value pairs in \"*kvmap\"\n  void Finish(const Options& options,\n              std::vector<std::string>* keys,\n              KVMap* kvmap) {\n    *kvmap = data_;\n    keys->clear();\n    for (KVMap::const_iterator it = data_.begin();\n         it != data_.end();\n         ++it) {\n      keys->push_back(it->first);\n    }\n    data_.clear();\n    Status s = FinishImpl(options, *kvmap);\n    ASSERT_TRUE(s.ok()) << s.ToString();\n  }\n\n  // Construct the data structure from the data in \"data\"\n  virtual Status FinishImpl(const Options& options, const KVMap& data) = 0;\n\n  virtual Iterator* NewIterator() const = 0;\n\n  virtual const KVMap& data() { return data_; }\n\n  virtual DB* db() const { return NULL; }  // Overridden in DBConstructor\n\n private:\n  KVMap data_;\n};\n\nclass BlockConstructor: public Constructor {\n public:\n  explicit BlockConstructor(const Comparator* cmp)\n      : Constructor(cmp),\n        comparator_(cmp),\n        block_(NULL) { }\n  ~BlockConstructor() {\n    delete block_;\n  }\n  virtual Status FinishImpl(const Options& options, const KVMap& data) {\n    delete block_;\n    block_ = NULL;\n    BlockBuilder builder(&options);\n\n    for (KVMap::const_iterator it = data.begin();\n         it != data.end();\n         ++it) {\n      builder.Add(it->first, it->second);\n    }\n    // Open the block\n    data_ = builder.Finish().ToString();\n    BlockContents contents;\n    contents.data = data_;\n    contents.cachable = false;\n    contents.heap_allocated = false;\n    block_ = new Block(contents);\n    return Status::OK();\n  }\n  virtual Iterator* NewIterator() const {\n    return block_->NewIterator(comparator_);\n  }\n\n private:\n  const Comparator* comparator_;\n  std::string data_;\n  Block* block_;\n\n  BlockConstructor();\n};\n\nclass TableConstructor: public Constructor {\n public:\n  TableConstructor(const Comparator* cmp)\n      : Constructor(cmp),\n        source_(NULL), table_(NULL) {\n  }\n  ~TableConstructor() {\n    Reset();\n  }\n  virtual Status FinishImpl(const Options& options, const KVMap& data) {\n    Reset();\n    StringSink sink;\n    TableBuilder builder(options, &sink);\n\n    for (KVMap::const_iterator it = data.begin();\n         it != data.end();\n         ++it) {\n      builder.Add(it->first, it->second);\n      ASSERT_TRUE(builder.status().ok());\n    }\n    Status s = builder.Finish();\n    ASSERT_TRUE(s.ok()) << s.ToString();\n\n    ASSERT_EQ(sink.contents().size(), builder.FileSize());\n\n    // Open the table\n    source_ = new StringSource(sink.contents());\n    Options table_options;\n    table_options.comparator = options.comparator;\n    return Table::Open(table_options, source_, sink.contents().size(), &table_);\n  }\n\n  virtual Iterator* NewIterator() const {\n    return table_->NewIterator(ReadOptions());\n  }\n\n  uint64_t ApproximateOffsetOf(const Slice& key) const {\n    return table_->ApproximateOffsetOf(key);\n  }\n\n private:\n  void Reset() {\n    delete table_;\n    delete source_;\n    table_ = NULL;\n    source_ = NULL;\n  }\n\n  StringSource* source_;\n  Table* table_;\n\n  TableConstructor();\n};\n\n// A helper class that converts internal format keys into user keys\nclass KeyConvertingIterator: public Iterator {\n public:\n  explicit KeyConvertingIterator(Iterator* iter) : iter_(iter) { }\n  virtual ~KeyConvertingIterator() { delete iter_; }\n  virtual bool Valid() const { return iter_->Valid(); }\n  virtual void Seek(const Slice& target) {\n    ParsedInternalKey ikey(target, kMaxSequenceNumber, kTypeValue);\n    std::string encoded;\n    AppendInternalKey(&encoded, ikey);\n    iter_->Seek(encoded);\n  }\n  virtual void SeekToFirst() { iter_->SeekToFirst(); }\n  virtual void SeekToLast() { iter_->SeekToLast(); }\n  virtual void Next() { iter_->Next(); }\n  virtual void Prev() { iter_->Prev(); }\n\n  virtual Slice key() const {\n    assert(Valid());\n    ParsedInternalKey key;\n    if (!ParseInternalKey(iter_->key(), &key)) {\n      status_ = Status::Corruption(\"malformed internal key\");\n      return Slice(\"corrupted key\");\n    }\n    return key.user_key;\n  }\n\n  virtual Slice value() const { return iter_->value(); }\n  virtual Status status() const {\n    return status_.ok() ? iter_->status() : status_;\n  }\n\n private:\n  mutable Status status_;\n  Iterator* iter_;\n\n  // No copying allowed\n  KeyConvertingIterator(const KeyConvertingIterator&);\n  void operator=(const KeyConvertingIterator&);\n};\n\nclass MemTableConstructor: public Constructor {\n public:\n  explicit MemTableConstructor(const Comparator* cmp)\n      : Constructor(cmp),\n        internal_comparator_(cmp) {\n    memtable_ = new MemTable(internal_comparator_);\n    memtable_->Ref();\n  }\n  ~MemTableConstructor() {\n    memtable_->Unref();\n  }\n  virtual Status FinishImpl(const Options& options, const KVMap& data) {\n    memtable_->Unref();\n    memtable_ = new MemTable(internal_comparator_);\n    memtable_->Ref();\n    int seq = 1;\n    for (KVMap::const_iterator it = data.begin();\n         it != data.end();\n         ++it) {\n      memtable_->Add(seq, kTypeValue, it->first, it->second);\n      seq++;\n    }\n    return Status::OK();\n  }\n  virtual Iterator* NewIterator() const {\n    return new KeyConvertingIterator(memtable_->NewIterator());\n  }\n\n private:\n  InternalKeyComparator internal_comparator_;\n  MemTable* memtable_;\n};\n\nclass DBConstructor: public Constructor {\n public:\n  explicit DBConstructor(const Comparator* cmp)\n      : Constructor(cmp),\n        comparator_(cmp) {\n    db_ = NULL;\n    NewDB();\n  }\n  ~DBConstructor() {\n    delete db_;\n  }\n  virtual Status FinishImpl(const Options& options, const KVMap& data) {\n    delete db_;\n    db_ = NULL;\n    NewDB();\n    for (KVMap::const_iterator it = data.begin();\n         it != data.end();\n         ++it) {\n      WriteBatch batch;\n      batch.Put(it->first, it->second);\n      ASSERT_TRUE(db_->Write(WriteOptions(), &batch).ok());\n    }\n    return Status::OK();\n  }\n  virtual Iterator* NewIterator() const {\n    return db_->NewIterator(ReadOptions());\n  }\n\n  virtual DB* db() const { return db_; }\n\n private:\n  void NewDB() {\n    std::string name = test::TmpDir() + \"/table_testdb\";\n\n    Options options;\n    options.comparator = comparator_;\n    Status status = DestroyDB(name, options);\n    ASSERT_TRUE(status.ok()) << status.ToString();\n\n    options.create_if_missing = true;\n    options.error_if_exists = true;\n    options.write_buffer_size = 10000;  // Something small to force merging\n    status = DB::Open(options, name, &db_);\n    ASSERT_TRUE(status.ok()) << status.ToString();\n  }\n\n  const Comparator* comparator_;\n  DB* db_;\n};\n\nenum TestType {\n  TABLE_TEST,\n  BLOCK_TEST,\n  MEMTABLE_TEST,\n  DB_TEST\n};\n\nstruct TestArgs {\n  TestType type;\n  bool reverse_compare;\n  int restart_interval;\n};\n\nstatic const TestArgs kTestArgList[] = {\n  { TABLE_TEST, false, 16 },\n  { TABLE_TEST, false, 1 },\n  { TABLE_TEST, false, 1024 },\n  { TABLE_TEST, true, 16 },\n  { TABLE_TEST, true, 1 },\n  { TABLE_TEST, true, 1024 },\n\n  { BLOCK_TEST, false, 16 },\n  { BLOCK_TEST, false, 1 },\n  { BLOCK_TEST, false, 1024 },\n  { BLOCK_TEST, true, 16 },\n  { BLOCK_TEST, true, 1 },\n  { BLOCK_TEST, true, 1024 },\n\n  // Restart interval does not matter for memtables\n  { MEMTABLE_TEST, false, 16 },\n  { MEMTABLE_TEST, true, 16 },\n\n  // Do not bother with restart interval variations for DB\n  { DB_TEST, false, 16 },\n  { DB_TEST, true, 16 },\n};\nstatic const int kNumTestArgs = sizeof(kTestArgList) / sizeof(kTestArgList[0]);\n\nclass Harness {\n public:\n  Harness() : constructor_(NULL) { }\n\n  void Init(const TestArgs& args) {\n    delete constructor_;\n    constructor_ = NULL;\n    options_ = Options();\n\n    options_.block_restart_interval = args.restart_interval;\n    // Use shorter block size for tests to exercise block boundary\n    // conditions more.\n    options_.block_size = 256;\n    if (args.reverse_compare) {\n      options_.comparator = &reverse_key_comparator;\n    }\n    switch (args.type) {\n      case TABLE_TEST:\n        constructor_ = new TableConstructor(options_.comparator);\n        break;\n      case BLOCK_TEST:\n        constructor_ = new BlockConstructor(options_.comparator);\n        break;\n      case MEMTABLE_TEST:\n        constructor_ = new MemTableConstructor(options_.comparator);\n        break;\n      case DB_TEST:\n        constructor_ = new DBConstructor(options_.comparator);\n        break;\n    }\n  }\n\n  ~Harness() {\n    delete constructor_;\n  }\n\n  void Add(const std::string& key, const std::string& value) {\n    constructor_->Add(key, value);\n  }\n\n  void Test(Random* rnd) {\n    std::vector<std::string> keys;\n    KVMap data;\n    constructor_->Finish(options_, &keys, &data);\n\n    TestForwardScan(keys, data);\n    TestBackwardScan(keys, data);\n    TestRandomAccess(rnd, keys, data);\n  }\n\n  void TestForwardScan(const std::vector<std::string>& keys,\n                       const KVMap& data) {\n    Iterator* iter = constructor_->NewIterator();\n    ASSERT_TRUE(!iter->Valid());\n    iter->SeekToFirst();\n    for (KVMap::const_iterator model_iter = data.begin();\n         model_iter != data.end();\n         ++model_iter) {\n      ASSERT_EQ(ToString(data, model_iter), ToString(iter));\n      iter->Next();\n    }\n    ASSERT_TRUE(!iter->Valid());\n    delete iter;\n  }\n\n  void TestBackwardScan(const std::vector<std::string>& keys,\n                        const KVMap& data) {\n    Iterator* iter = constructor_->NewIterator();\n    ASSERT_TRUE(!iter->Valid());\n    iter->SeekToLast();\n    for (KVMap::const_reverse_iterator model_iter = data.rbegin();\n         model_iter != data.rend();\n         ++model_iter) {\n      ASSERT_EQ(ToString(data, model_iter), ToString(iter));\n      iter->Prev();\n    }\n    ASSERT_TRUE(!iter->Valid());\n    delete iter;\n  }\n\n  void TestRandomAccess(Random* rnd,\n                        const std::vector<std::string>& keys,\n                        const KVMap& data) {\n    static const bool kVerbose = false;\n    Iterator* iter = constructor_->NewIterator();\n    ASSERT_TRUE(!iter->Valid());\n    KVMap::const_iterator model_iter = data.begin();\n    if (kVerbose) fprintf(stderr, \"---\\n\");\n    for (int i = 0; i < 200; i++) {\n      const int toss = rnd->Uniform(5);\n      switch (toss) {\n        case 0: {\n          if (iter->Valid()) {\n            if (kVerbose) fprintf(stderr, \"Next\\n\");\n            iter->Next();\n            ++model_iter;\n            ASSERT_EQ(ToString(data, model_iter), ToString(iter));\n          }\n          break;\n        }\n\n        case 1: {\n          if (kVerbose) fprintf(stderr, \"SeekToFirst\\n\");\n          iter->SeekToFirst();\n          model_iter = data.begin();\n          ASSERT_EQ(ToString(data, model_iter), ToString(iter));\n          break;\n        }\n\n        case 2: {\n          std::string key = PickRandomKey(rnd, keys);\n          model_iter = data.lower_bound(key);\n          if (kVerbose) fprintf(stderr, \"Seek '%s'\\n\",\n                                EscapeString(key).c_str());\n          iter->Seek(Slice(key));\n          ASSERT_EQ(ToString(data, model_iter), ToString(iter));\n          break;\n        }\n\n        case 3: {\n          if (iter->Valid()) {\n            if (kVerbose) fprintf(stderr, \"Prev\\n\");\n            iter->Prev();\n            if (model_iter == data.begin()) {\n              model_iter = data.end();   // Wrap around to invalid value\n            } else {\n              --model_iter;\n            }\n            ASSERT_EQ(ToString(data, model_iter), ToString(iter));\n          }\n          break;\n        }\n\n        case 4: {\n          if (kVerbose) fprintf(stderr, \"SeekToLast\\n\");\n          iter->SeekToLast();\n          if (keys.empty()) {\n            model_iter = data.end();\n          } else {\n            std::string last = data.rbegin()->first;\n            model_iter = data.lower_bound(last);\n          }\n          ASSERT_EQ(ToString(data, model_iter), ToString(iter));\n          break;\n        }\n      }\n    }\n    delete iter;\n  }\n\n  std::string ToString(const KVMap& data, const KVMap::const_iterator& it) {\n    if (it == data.end()) {\n      return \"END\";\n    } else {\n      return \"'\" + it->first + \"->\" + it->second + \"'\";\n    }\n  }\n\n  std::string ToString(const KVMap& data,\n                       const KVMap::const_reverse_iterator& it) {\n    if (it == data.rend()) {\n      return \"END\";\n    } else {\n      return \"'\" + it->first + \"->\" + it->second + \"'\";\n    }\n  }\n\n  std::string ToString(const Iterator* it) {\n    if (!it->Valid()) {\n      return \"END\";\n    } else {\n      return \"'\" + it->key().ToString() + \"->\" + it->value().ToString() + \"'\";\n    }\n  }\n\n  std::string PickRandomKey(Random* rnd, const std::vector<std::string>& keys) {\n    if (keys.empty()) {\n      return \"foo\";\n    } else {\n      const int index = rnd->Uniform(keys.size());\n      std::string result = keys[index];\n      switch (rnd->Uniform(3)) {\n        case 0:\n          // Return an existing key\n          break;\n        case 1: {\n          // Attempt to return something smaller than an existing key\n          if (result.size() > 0 && result[result.size()-1] > '\\0') {\n            result[result.size()-1]--;\n          }\n          break;\n        }\n        case 2: {\n          // Return something larger than an existing key\n          Increment(options_.comparator, &result);\n          break;\n        }\n      }\n      return result;\n    }\n  }\n\n  // Returns NULL if not running against a DB\n  DB* db() const { return constructor_->db(); }\n\n private:\n  Options options_;\n  Constructor* constructor_;\n};\n\n// Test empty table/block.\nTEST(Harness, Empty) {\n  for (int i = 0; i < kNumTestArgs; i++) {\n    Init(kTestArgList[i]);\n    Random rnd(test::RandomSeed() + 1);\n    Test(&rnd);\n  }\n}\n\n// Special test for a block with no restart entries.  The C++ leveldb\n// code never generates such blocks, but the Java version of leveldb\n// seems to.\nTEST(Harness, ZeroRestartPointsInBlock) {\n  char data[sizeof(uint32_t)];\n  memset(data, 0, sizeof(data));\n  BlockContents contents;\n  contents.data = Slice(data, sizeof(data));\n  contents.cachable = false;\n  contents.heap_allocated = false;\n  Block block(contents);\n  Iterator* iter = block.NewIterator(BytewiseComparator());\n  iter->SeekToFirst();\n  ASSERT_TRUE(!iter->Valid());\n  iter->SeekToLast();\n  ASSERT_TRUE(!iter->Valid());\n  iter->Seek(\"foo\");\n  ASSERT_TRUE(!iter->Valid());\n  delete iter;\n}\n\n// Test the empty key\nTEST(Harness, SimpleEmptyKey) {\n  for (int i = 0; i < kNumTestArgs; i++) {\n    Init(kTestArgList[i]);\n    Random rnd(test::RandomSeed() + 1);\n    Add(\"\", \"v\");\n    Test(&rnd);\n  }\n}\n\nTEST(Harness, SimpleSingle) {\n  for (int i = 0; i < kNumTestArgs; i++) {\n    Init(kTestArgList[i]);\n    Random rnd(test::RandomSeed() + 2);\n    Add(\"abc\", \"v\");\n    Test(&rnd);\n  }\n}\n\nTEST(Harness, SimpleMulti) {\n  for (int i = 0; i < kNumTestArgs; i++) {\n    Init(kTestArgList[i]);\n    Random rnd(test::RandomSeed() + 3);\n    Add(\"abc\", \"v\");\n    Add(\"abcd\", \"v\");\n    Add(\"ac\", \"v2\");\n    Test(&rnd);\n  }\n}\n\nTEST(Harness, SimpleSpecialKey) {\n  for (int i = 0; i < kNumTestArgs; i++) {\n    Init(kTestArgList[i]);\n    Random rnd(test::RandomSeed() + 4);\n    Add(\"\\xff\\xff\", \"v3\");\n    Test(&rnd);\n  }\n}\n\nTEST(Harness, Randomized) {\n  for (int i = 0; i < kNumTestArgs; i++) {\n    Init(kTestArgList[i]);\n    Random rnd(test::RandomSeed() + 5);\n    for (int num_entries = 0; num_entries < 2000;\n         num_entries += (num_entries < 50 ? 1 : 200)) {\n      if ((num_entries % 10) == 0) {\n        fprintf(stderr, \"case %d of %d: num_entries = %d\\n\",\n                (i + 1), int(kNumTestArgs), num_entries);\n      }\n      for (int e = 0; e < num_entries; e++) {\n        std::string v;\n        Add(test::RandomKey(&rnd, rnd.Skewed(4)),\n            test::RandomString(&rnd, rnd.Skewed(5), &v).ToString());\n      }\n      Test(&rnd);\n    }\n  }\n}\n\nTEST(Harness, RandomizedLongDB) {\n  Random rnd(test::RandomSeed());\n  TestArgs args = { DB_TEST, false, 16 };\n  Init(args);\n  int num_entries = 100000;\n  for (int e = 0; e < num_entries; e++) {\n    std::string v;\n    Add(test::RandomKey(&rnd, rnd.Skewed(4)),\n        test::RandomString(&rnd, rnd.Skewed(5), &v).ToString());\n  }\n  Test(&rnd);\n\n  // We must have created enough data to force merging\n  int files = 0;\n  for (int level = 0; level < config::kNumLevels; level++) {\n    std::string value;\n    char name[100];\n    snprintf(name, sizeof(name), \"leveldb.num-files-at-level%d\", level);\n    ASSERT_TRUE(db()->GetProperty(name, &value));\n    files += atoi(value.c_str());\n  }\n  ASSERT_GT(files, 0);\n}\n\nclass MemTableTest { };\n\nTEST(MemTableTest, Simple) {\n  InternalKeyComparator cmp(BytewiseComparator());\n  MemTable* memtable = new MemTable(cmp);\n  memtable->Ref();\n  WriteBatch batch;\n  WriteBatchInternal::SetSequence(&batch, 100);\n  batch.Put(std::string(\"k1\"), std::string(\"v1\"));\n  batch.Put(std::string(\"k2\"), std::string(\"v2\"));\n  batch.Put(std::string(\"k3\"), std::string(\"v3\"));\n  batch.Put(std::string(\"largekey\"), std::string(\"vlarge\"));\n  ASSERT_TRUE(WriteBatchInternal::InsertInto(&batch, memtable).ok());\n\n  Iterator* iter = memtable->NewIterator();\n  iter->SeekToFirst();\n  while (iter->Valid()) {\n    fprintf(stderr, \"key: '%s' -> '%s'\\n\",\n            iter->key().ToString().c_str(),\n            iter->value().ToString().c_str());\n    iter->Next();\n  }\n\n  delete iter;\n  memtable->Unref();\n}\n\nstatic bool Between(uint64_t val, uint64_t low, uint64_t high) {\n  bool result = (val >= low) && (val <= high);\n  if (!result) {\n    fprintf(stderr, \"Value %llu is not in range [%llu, %llu]\\n\",\n            (unsigned long long)(val),\n            (unsigned long long)(low),\n            (unsigned long long)(high));\n  }\n  return result;\n}\n\nclass TableTest { };\n\nTEST(TableTest, ApproximateOffsetOfPlain) {\n  TableConstructor c(BytewiseComparator());\n  c.Add(\"k01\", \"hello\");\n  c.Add(\"k02\", \"hello2\");\n  c.Add(\"k03\", std::string(10000, 'x'));\n  c.Add(\"k04\", std::string(200000, 'x'));\n  c.Add(\"k05\", std::string(300000, 'x'));\n  c.Add(\"k06\", \"hello3\");\n  c.Add(\"k07\", std::string(100000, 'x'));\n  std::vector<std::string> keys;\n  KVMap kvmap;\n  Options options;\n  options.block_size = 1024;\n  options.compression = kNoCompression;\n  c.Finish(options, &keys, &kvmap);\n\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"abc\"),       0,      0));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k01\"),       0,      0));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k01a\"),      0,      0));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k02\"),       0,      0));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k03\"),       0,      0));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k04\"),   10000,  11000));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k04a\"), 210000, 211000));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k05\"),  210000, 211000));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k06\"),  510000, 511000));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k07\"),  510000, 511000));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"xyz\"),  610000, 612000));\n\n}\n\nstatic bool SnappyCompressionSupported() {\n  std::string out;\n  Slice in = \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\";\n  return port::Snappy_Compress(in.data(), in.size(), &out);\n}\n\nTEST(TableTest, ApproximateOffsetOfCompressed) {\n  if (!SnappyCompressionSupported()) {\n    fprintf(stderr, \"skipping compression tests\\n\");\n    return;\n  }\n\n  Random rnd(301);\n  TableConstructor c(BytewiseComparator());\n  std::string tmp;\n  c.Add(\"k01\", \"hello\");\n  c.Add(\"k02\", test::CompressibleString(&rnd, 0.25, 10000, &tmp));\n  c.Add(\"k03\", \"hello3\");\n  c.Add(\"k04\", test::CompressibleString(&rnd, 0.25, 10000, &tmp));\n  std::vector<std::string> keys;\n  KVMap kvmap;\n  Options options;\n  options.block_size = 1024;\n  options.compression = kSnappyCompression;\n  c.Finish(options, &keys, &kvmap);\n\n  // Expected upper and lower bounds of space used by compressible strings.\n  static const int kSlop = 1000;  // Compressor effectiveness varies.\n  const int expected = 2500;  // 10000 * compression ratio (0.25)\n  const int min_z = expected - kSlop;\n  const int max_z = expected + kSlop;\n\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"abc\"), 0, kSlop));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k01\"), 0, kSlop));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k02\"), 0, kSlop));\n  // Have now emitted a large compressible string, so adjust expected offset.\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k03\"), min_z, max_z));\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"k04\"), min_z, max_z));\n  // Have now emitted two large compressible strings, so adjust expected offset.\n  ASSERT_TRUE(Between(c.ApproximateOffsetOf(\"xyz\"), 2 * min_z, 2 * max_z));\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/table/two_level_iterator.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"table/two_level_iterator.h\"\n\n#include \"leveldb/table.h\"\n#include \"table/block.h\"\n#include \"table/format.h\"\n#include \"table/iterator_wrapper.h\"\n\nnamespace leveldb {\n\nnamespace {\n\ntypedef Iterator* (*BlockFunction)(void*, const ReadOptions&, const Slice&);\n\nclass TwoLevelIterator: public Iterator {\n public:\n  TwoLevelIterator(\n    Iterator* index_iter,\n    BlockFunction block_function,\n    void* arg,\n    const ReadOptions& options);\n\n  virtual ~TwoLevelIterator();\n\n  virtual void Seek(const Slice& target);\n  virtual void SeekToFirst();\n  virtual void SeekToLast();\n  virtual void Next();\n  virtual void Prev();\n\n  virtual bool Valid() const {\n    return data_iter_.Valid();\n  }\n  virtual Slice key() const {\n    assert(Valid());\n    return data_iter_.key();\n  }\n  virtual Slice value() const {\n    assert(Valid());\n    return data_iter_.value();\n  }\n  virtual Status status() const {\n    // It'd be nice if status() returned a const Status& instead of a Status\n    if (!index_iter_.status().ok()) {\n      return index_iter_.status();\n    } else if (data_iter_.iter() != NULL && !data_iter_.status().ok()) {\n      return data_iter_.status();\n    } else {\n      return status_;\n    }\n  }\n\n private:\n  void SaveError(const Status& s) {\n    if (status_.ok() && !s.ok()) status_ = s;\n  }\n  void SkipEmptyDataBlocksForward();\n  void SkipEmptyDataBlocksBackward();\n  void SetDataIterator(Iterator* data_iter);\n  void InitDataBlock();\n\n  BlockFunction block_function_;\n  void* arg_;\n  const ReadOptions options_;\n  Status status_;\n  IteratorWrapper index_iter_;\n  IteratorWrapper data_iter_; // May be NULL\n  // If data_iter_ is non-NULL, then \"data_block_handle_\" holds the\n  // \"index_value\" passed to block_function_ to create the data_iter_.\n  std::string data_block_handle_;\n};\n\nTwoLevelIterator::TwoLevelIterator(\n    Iterator* index_iter,\n    BlockFunction block_function,\n    void* arg,\n    const ReadOptions& options)\n    : block_function_(block_function),\n      arg_(arg),\n      options_(options),\n      index_iter_(index_iter),\n      data_iter_(NULL) {\n}\n\nTwoLevelIterator::~TwoLevelIterator() {\n}\n\nvoid TwoLevelIterator::Seek(const Slice& target) {\n  index_iter_.Seek(target);\n  InitDataBlock();\n  if (data_iter_.iter() != NULL) data_iter_.Seek(target);\n  SkipEmptyDataBlocksForward();\n}\n\nvoid TwoLevelIterator::SeekToFirst() {\n  index_iter_.SeekToFirst();\n  InitDataBlock();\n  if (data_iter_.iter() != NULL) data_iter_.SeekToFirst();\n  SkipEmptyDataBlocksForward();\n}\n\nvoid TwoLevelIterator::SeekToLast() {\n  index_iter_.SeekToLast();\n  InitDataBlock();\n  if (data_iter_.iter() != NULL) data_iter_.SeekToLast();\n  SkipEmptyDataBlocksBackward();\n}\n\nvoid TwoLevelIterator::Next() {\n  assert(Valid());\n  data_iter_.Next();\n  SkipEmptyDataBlocksForward();\n}\n\nvoid TwoLevelIterator::Prev() {\n  assert(Valid());\n  data_iter_.Prev();\n  SkipEmptyDataBlocksBackward();\n}\n\n\nvoid TwoLevelIterator::SkipEmptyDataBlocksForward() {\n  while (data_iter_.iter() == NULL || !data_iter_.Valid()) {\n    // Move to next block\n    if (!index_iter_.Valid()) {\n      SetDataIterator(NULL);\n      return;\n    }\n    index_iter_.Next();\n    InitDataBlock();\n    if (data_iter_.iter() != NULL) data_iter_.SeekToFirst();\n  }\n}\n\nvoid TwoLevelIterator::SkipEmptyDataBlocksBackward() {\n  while (data_iter_.iter() == NULL || !data_iter_.Valid()) {\n    // Move to next block\n    if (!index_iter_.Valid()) {\n      SetDataIterator(NULL);\n      return;\n    }\n    index_iter_.Prev();\n    InitDataBlock();\n    if (data_iter_.iter() != NULL) data_iter_.SeekToLast();\n  }\n}\n\nvoid TwoLevelIterator::SetDataIterator(Iterator* data_iter) {\n  if (data_iter_.iter() != NULL) SaveError(data_iter_.status());\n  data_iter_.Set(data_iter);\n}\n\nvoid TwoLevelIterator::InitDataBlock() {\n  if (!index_iter_.Valid()) {\n    SetDataIterator(NULL);\n  } else {\n    Slice handle = index_iter_.value();\n    if (data_iter_.iter() != NULL && handle.compare(data_block_handle_) == 0) {\n      // data_iter_ is already constructed with this iterator, so\n      // no need to change anything\n    } else {\n      Iterator* iter = (*block_function_)(arg_, options_, handle);\n      data_block_handle_.assign(handle.data(), handle.size());\n      SetDataIterator(iter);\n    }\n  }\n}\n\n}  // namespace\n\nIterator* NewTwoLevelIterator(\n    Iterator* index_iter,\n    BlockFunction block_function,\n    void* arg,\n    const ReadOptions& options) {\n  return new TwoLevelIterator(index_iter, block_function, arg, options);\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/table/two_level_iterator.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_\n#define STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_\n\n#include \"leveldb/iterator.h\"\n\nnamespace leveldb {\n\nstruct ReadOptions;\n\n// Return a new two level iterator.  A two-level iterator contains an\n// index iterator whose values point to a sequence of blocks where\n// each block is itself a sequence of key,value pairs.  The returned\n// two-level iterator yields the concatenation of all key/value pairs\n// in the sequence of blocks.  Takes ownership of \"index_iter\" and\n// will delete it when no longer needed.\n//\n// Uses a supplied function to convert an index_iter value into\n// an iterator over the contents of the corresponding block.\nextern Iterator* NewTwoLevelIterator(\n    Iterator* index_iter,\n    Iterator* (*block_function)(\n        void* arg,\n        const ReadOptions& options,\n        const Slice& index_value),\n    void* arg,\n    const ReadOptions& options);\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_\n"
  },
  {
    "path": "src/leveldb/util/arena.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"util/arena.h\"\n#include <assert.h>\n\nnamespace leveldb {\n\nstatic const int kBlockSize = 4096;\n\nArena::Arena() : memory_usage_(0) {\n  alloc_ptr_ = NULL;  // First allocation will allocate a block\n  alloc_bytes_remaining_ = 0;\n}\n\nArena::~Arena() {\n  for (size_t i = 0; i < blocks_.size(); i++) {\n    delete[] blocks_[i];\n  }\n}\n\nchar* Arena::AllocateFallback(size_t bytes) {\n  if (bytes > kBlockSize / 4) {\n    // Object is more than a quarter of our block size.  Allocate it separately\n    // to avoid wasting too much space in leftover bytes.\n    char* result = AllocateNewBlock(bytes);\n    return result;\n  }\n\n  // We waste the remaining space in the current block.\n  alloc_ptr_ = AllocateNewBlock(kBlockSize);\n  alloc_bytes_remaining_ = kBlockSize;\n\n  char* result = alloc_ptr_;\n  alloc_ptr_ += bytes;\n  alloc_bytes_remaining_ -= bytes;\n  return result;\n}\n\nchar* Arena::AllocateAligned(size_t bytes) {\n  const int align = (sizeof(void*) > 8) ? sizeof(void*) : 8;\n  assert((align & (align-1)) == 0);   // Pointer size should be a power of 2\n  size_t current_mod = reinterpret_cast<uintptr_t>(alloc_ptr_) & (align-1);\n  size_t slop = (current_mod == 0 ? 0 : align - current_mod);\n  size_t needed = bytes + slop;\n  char* result;\n  if (needed <= alloc_bytes_remaining_) {\n    result = alloc_ptr_ + slop;\n    alloc_ptr_ += needed;\n    alloc_bytes_remaining_ -= needed;\n  } else {\n    // AllocateFallback always returned aligned memory\n    result = AllocateFallback(bytes);\n  }\n  assert((reinterpret_cast<uintptr_t>(result) & (align-1)) == 0);\n  return result;\n}\n\nchar* Arena::AllocateNewBlock(size_t block_bytes) {\n  char* result = new char[block_bytes];\n  blocks_.push_back(result);\n  memory_usage_.NoBarrier_Store(\n      reinterpret_cast<void*>(MemoryUsage() + block_bytes + sizeof(char*)));\n  return result;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/arena.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_UTIL_ARENA_H_\n#define STORAGE_LEVELDB_UTIL_ARENA_H_\n\n#include <vector>\n#include <assert.h>\n#include <stddef.h>\n#include <stdint.h>\n#include \"port/port.h\"\n\nnamespace leveldb {\n\nclass Arena {\n public:\n  Arena();\n  ~Arena();\n\n  // Return a pointer to a newly allocated memory block of \"bytes\" bytes.\n  char* Allocate(size_t bytes);\n\n  // Allocate memory with the normal alignment guarantees provided by malloc\n  char* AllocateAligned(size_t bytes);\n\n  // Returns an estimate of the total memory usage of data allocated\n  // by the arena.\n  size_t MemoryUsage() const {\n    return reinterpret_cast<uintptr_t>(memory_usage_.NoBarrier_Load());\n  }\n\n private:\n  char* AllocateFallback(size_t bytes);\n  char* AllocateNewBlock(size_t block_bytes);\n\n  // Allocation state\n  char* alloc_ptr_;\n  size_t alloc_bytes_remaining_;\n\n  // Array of new[] allocated memory blocks\n  std::vector<char*> blocks_;\n\n  // Total memory usage of the arena.\n  port::AtomicPointer memory_usage_;\n\n  // No copying allowed\n  Arena(const Arena&);\n  void operator=(const Arena&);\n};\n\ninline char* Arena::Allocate(size_t bytes) {\n  // The semantics of what to return are a bit messy if we allow\n  // 0-byte allocations, so we disallow them here (we don't need\n  // them for our internal use).\n  assert(bytes > 0);\n  if (bytes <= alloc_bytes_remaining_) {\n    char* result = alloc_ptr_;\n    alloc_ptr_ += bytes;\n    alloc_bytes_remaining_ -= bytes;\n    return result;\n  }\n  return AllocateFallback(bytes);\n}\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_UTIL_ARENA_H_\n"
  },
  {
    "path": "src/leveldb/util/arena_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"util/arena.h\"\n\n#include \"util/random.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\nclass ArenaTest { };\n\nTEST(ArenaTest, Empty) {\n  Arena arena;\n}\n\nTEST(ArenaTest, Simple) {\n  std::vector<std::pair<size_t, char*> > allocated;\n  Arena arena;\n  const int N = 100000;\n  size_t bytes = 0;\n  Random rnd(301);\n  for (int i = 0; i < N; i++) {\n    size_t s;\n    if (i % (N / 10) == 0) {\n      s = i;\n    } else {\n      s = rnd.OneIn(4000) ? rnd.Uniform(6000) :\n          (rnd.OneIn(10) ? rnd.Uniform(100) : rnd.Uniform(20));\n    }\n    if (s == 0) {\n      // Our arena disallows size 0 allocations.\n      s = 1;\n    }\n    char* r;\n    if (rnd.OneIn(10)) {\n      r = arena.AllocateAligned(s);\n    } else {\n      r = arena.Allocate(s);\n    }\n\n    for (size_t b = 0; b < s; b++) {\n      // Fill the \"i\"th allocation with a known bit pattern\n      r[b] = i % 256;\n    }\n    bytes += s;\n    allocated.push_back(std::make_pair(s, r));\n    ASSERT_GE(arena.MemoryUsage(), bytes);\n    if (i > N/10) {\n      ASSERT_LE(arena.MemoryUsage(), bytes * 1.10);\n    }\n  }\n  for (size_t i = 0; i < allocated.size(); i++) {\n    size_t num_bytes = allocated[i].first;\n    const char* p = allocated[i].second;\n    for (size_t b = 0; b < num_bytes; b++) {\n      // Check the \"i\"th allocation for the known bit pattern\n      ASSERT_EQ(int(p[b]) & 0xff, i % 256);\n    }\n  }\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/util/bloom.cc",
    "content": "// Copyright (c) 2012 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/filter_policy.h\"\n\n#include \"leveldb/slice.h\"\n#include \"util/hash.h\"\n\nnamespace leveldb {\n\nnamespace {\nstatic uint32_t BloomHash(const Slice& key) {\n  return Hash(key.data(), key.size(), 0xbc9f1d34);\n}\n\nclass BloomFilterPolicy : public FilterPolicy {\n private:\n  size_t bits_per_key_;\n  size_t k_;\n\n public:\n  explicit BloomFilterPolicy(int bits_per_key)\n      : bits_per_key_(bits_per_key) {\n    // We intentionally round down to reduce probing cost a little bit\n    k_ = static_cast<size_t>(bits_per_key * 0.69);  // 0.69 =~ ln(2)\n    if (k_ < 1) k_ = 1;\n    if (k_ > 30) k_ = 30;\n  }\n\n  virtual const char* Name() const {\n    return \"leveldb.BuiltinBloomFilter2\";\n  }\n\n  virtual void CreateFilter(const Slice* keys, int n, std::string* dst) const {\n    // Compute bloom filter size (in both bits and bytes)\n    size_t bits = n * bits_per_key_;\n\n    // For small n, we can see a very high false positive rate.  Fix it\n    // by enforcing a minimum bloom filter length.\n    if (bits < 64) bits = 64;\n\n    size_t bytes = (bits + 7) / 8;\n    bits = bytes * 8;\n\n    const size_t init_size = dst->size();\n    dst->resize(init_size + bytes, 0);\n    dst->push_back(static_cast<char>(k_));  // Remember # of probes in filter\n    char* array = &(*dst)[init_size];\n    for (int i = 0; i < n; i++) {\n      // Use double-hashing to generate a sequence of hash values.\n      // See analysis in [Kirsch,Mitzenmacher 2006].\n      uint32_t h = BloomHash(keys[i]);\n      const uint32_t delta = (h >> 17) | (h << 15);  // Rotate right 17 bits\n      for (size_t j = 0; j < k_; j++) {\n        const uint32_t bitpos = h % bits;\n        array[bitpos/8] |= (1 << (bitpos % 8));\n        h += delta;\n      }\n    }\n  }\n\n  virtual bool KeyMayMatch(const Slice& key, const Slice& bloom_filter) const {\n    const size_t len = bloom_filter.size();\n    if (len < 2) return false;\n\n    const char* array = bloom_filter.data();\n    const size_t bits = (len - 1) * 8;\n\n    // Use the encoded k so that we can read filters generated by\n    // bloom filters created using different parameters.\n    const size_t k = array[len-1];\n    if (k > 30) {\n      // Reserved for potentially new encodings for short bloom filters.\n      // Consider it a match.\n      return true;\n    }\n\n    uint32_t h = BloomHash(key);\n    const uint32_t delta = (h >> 17) | (h << 15);  // Rotate right 17 bits\n    for (size_t j = 0; j < k; j++) {\n      const uint32_t bitpos = h % bits;\n      if ((array[bitpos/8] & (1 << (bitpos % 8))) == 0) return false;\n      h += delta;\n    }\n    return true;\n  }\n};\n}\n\nconst FilterPolicy* NewBloomFilterPolicy(int bits_per_key) {\n  return new BloomFilterPolicy(bits_per_key);\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/bloom_test.cc",
    "content": "// Copyright (c) 2012 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/filter_policy.h\"\n\n#include \"util/coding.h\"\n#include \"util/logging.h\"\n#include \"util/testharness.h\"\n#include \"util/testutil.h\"\n\nnamespace leveldb {\n\nstatic const int kVerbose = 1;\n\nstatic Slice Key(int i, char* buffer) {\n  EncodeFixed32(buffer, i);\n  return Slice(buffer, sizeof(uint32_t));\n}\n\nclass BloomTest {\n private:\n  const FilterPolicy* policy_;\n  std::string filter_;\n  std::vector<std::string> keys_;\n\n public:\n  BloomTest() : policy_(NewBloomFilterPolicy(10)) { }\n\n  ~BloomTest() {\n    delete policy_;\n  }\n\n  void Reset() {\n    keys_.clear();\n    filter_.clear();\n  }\n\n  void Add(const Slice& s) {\n    keys_.push_back(s.ToString());\n  }\n\n  void Build() {\n    std::vector<Slice> key_slices;\n    for (size_t i = 0; i < keys_.size(); i++) {\n      key_slices.push_back(Slice(keys_[i]));\n    }\n    filter_.clear();\n    policy_->CreateFilter(&key_slices[0], static_cast<int>(key_slices.size()),\n                          &filter_);\n    keys_.clear();\n    if (kVerbose >= 2) DumpFilter();\n  }\n\n  size_t FilterSize() const {\n    return filter_.size();\n  }\n\n  void DumpFilter() {\n    fprintf(stderr, \"F(\");\n    for (size_t i = 0; i+1 < filter_.size(); i++) {\n      const unsigned int c = static_cast<unsigned int>(filter_[i]);\n      for (int j = 0; j < 8; j++) {\n        fprintf(stderr, \"%c\", (c & (1 <<j)) ? '1' : '.');\n      }\n    }\n    fprintf(stderr, \")\\n\");\n  }\n\n  bool Matches(const Slice& s) {\n    if (!keys_.empty()) {\n      Build();\n    }\n    return policy_->KeyMayMatch(s, filter_);\n  }\n\n  double FalsePositiveRate() {\n    char buffer[sizeof(int)];\n    int result = 0;\n    for (int i = 0; i < 10000; i++) {\n      if (Matches(Key(i + 1000000000, buffer))) {\n        result++;\n      }\n    }\n    return result / 10000.0;\n  }\n};\n\nTEST(BloomTest, EmptyFilter) {\n  ASSERT_TRUE(! Matches(\"hello\"));\n  ASSERT_TRUE(! Matches(\"world\"));\n}\n\nTEST(BloomTest, Small) {\n  Add(\"hello\");\n  Add(\"world\");\n  ASSERT_TRUE(Matches(\"hello\"));\n  ASSERT_TRUE(Matches(\"world\"));\n  ASSERT_TRUE(! Matches(\"x\"));\n  ASSERT_TRUE(! Matches(\"foo\"));\n}\n\nstatic int NextLength(int length) {\n  if (length < 10) {\n    length += 1;\n  } else if (length < 100) {\n    length += 10;\n  } else if (length < 1000) {\n    length += 100;\n  } else {\n    length += 1000;\n  }\n  return length;\n}\n\nTEST(BloomTest, VaryingLengths) {\n  char buffer[sizeof(int)];\n\n  // Count number of filters that significantly exceed the false positive rate\n  int mediocre_filters = 0;\n  int good_filters = 0;\n\n  for (int length = 1; length <= 10000; length = NextLength(length)) {\n    Reset();\n    for (int i = 0; i < length; i++) {\n      Add(Key(i, buffer));\n    }\n    Build();\n\n    ASSERT_LE(FilterSize(), static_cast<size_t>((length * 10 / 8) + 40))\n        << length;\n\n    // All added keys must match\n    for (int i = 0; i < length; i++) {\n      ASSERT_TRUE(Matches(Key(i, buffer)))\n          << \"Length \" << length << \"; key \" << i;\n    }\n\n    // Check false positive rate\n    double rate = FalsePositiveRate();\n    if (kVerbose >= 1) {\n      fprintf(stderr, \"False positives: %5.2f%% @ length = %6d ; bytes = %6d\\n\",\n              rate*100.0, length, static_cast<int>(FilterSize()));\n    }\n    ASSERT_LE(rate, 0.02);   // Must not be over 2%\n    if (rate > 0.0125) mediocre_filters++;  // Allowed, but not too often\n    else good_filters++;\n  }\n  if (kVerbose >= 1) {\n    fprintf(stderr, \"Filters: %d good, %d mediocre\\n\",\n            good_filters, mediocre_filters);\n  }\n  ASSERT_LE(mediocre_filters, good_filters/5);\n}\n\n// Different bits-per-byte\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/util/cache.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <assert.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n#include \"leveldb/cache.h\"\n#include \"port/port.h\"\n#include \"util/hash.h\"\n#include \"util/mutexlock.h\"\n\nnamespace leveldb {\n\nCache::~Cache() {\n}\n\nnamespace {\n\n// LRU cache implementation\n//\n// Cache entries have an \"in_cache\" boolean indicating whether the cache has a\n// reference on the entry.  The only ways that this can become false without the\n// entry being passed to its \"deleter\" are via Erase(), via Insert() when\n// an element with a duplicate key is inserted, or on destruction of the cache.\n//\n// The cache keeps two linked lists of items in the cache.  All items in the\n// cache are in one list or the other, and never both.  Items still referenced\n// by clients but erased from the cache are in neither list.  The lists are:\n// - in-use:  contains the items currently referenced by clients, in no\n//   particular order.  (This list is used for invariant checking.  If we\n//   removed the check, elements that would otherwise be on this list could be\n//   left as disconnected singleton lists.)\n// - LRU:  contains the items not currently referenced by clients, in LRU order\n// Elements are moved between these lists by the Ref() and Unref() methods,\n// when they detect an element in the cache acquiring or losing its only\n// external reference.\n\n// An entry is a variable length heap-allocated structure.  Entries\n// are kept in a circular doubly linked list ordered by access time.\nstruct LRUHandle {\n  void* value;\n  void (*deleter)(const Slice&, void* value);\n  LRUHandle* next_hash;\n  LRUHandle* next;\n  LRUHandle* prev;\n  size_t charge;      // TODO(opt): Only allow uint32_t?\n  size_t key_length;\n  bool in_cache;      // Whether entry is in the cache.\n  uint32_t refs;      // References, including cache reference, if present.\n  uint32_t hash;      // Hash of key(); used for fast sharding and comparisons\n  char key_data[1];   // Beginning of key\n\n  Slice key() const {\n    // For cheaper lookups, we allow a temporary Handle object\n    // to store a pointer to a key in \"value\".\n    if (next == this) {\n      return *(reinterpret_cast<Slice*>(value));\n    } else {\n      return Slice(key_data, key_length);\n    }\n  }\n};\n\n// We provide our own simple hash table since it removes a whole bunch\n// of porting hacks and is also faster than some of the built-in hash\n// table implementations in some of the compiler/runtime combinations\n// we have tested.  E.g., readrandom speeds up by ~5% over the g++\n// 4.4.3's builtin hashtable.\nclass HandleTable {\n public:\n  HandleTable() : length_(0), elems_(0), list_(NULL) { Resize(); }\n  ~HandleTable() { delete[] list_; }\n\n  LRUHandle* Lookup(const Slice& key, uint32_t hash) {\n    return *FindPointer(key, hash);\n  }\n\n  LRUHandle* Insert(LRUHandle* h) {\n    LRUHandle** ptr = FindPointer(h->key(), h->hash);\n    LRUHandle* old = *ptr;\n    h->next_hash = (old == NULL ? NULL : old->next_hash);\n    *ptr = h;\n    if (old == NULL) {\n      ++elems_;\n      if (elems_ > length_) {\n        // Since each cache entry is fairly large, we aim for a small\n        // average linked list length (<= 1).\n        Resize();\n      }\n    }\n    return old;\n  }\n\n  LRUHandle* Remove(const Slice& key, uint32_t hash) {\n    LRUHandle** ptr = FindPointer(key, hash);\n    LRUHandle* result = *ptr;\n    if (result != NULL) {\n      *ptr = result->next_hash;\n      --elems_;\n    }\n    return result;\n  }\n\n private:\n  // The table consists of an array of buckets where each bucket is\n  // a linked list of cache entries that hash into the bucket.\n  uint32_t length_;\n  uint32_t elems_;\n  LRUHandle** list_;\n\n  // Return a pointer to slot that points to a cache entry that\n  // matches key/hash.  If there is no such cache entry, return a\n  // pointer to the trailing slot in the corresponding linked list.\n  LRUHandle** FindPointer(const Slice& key, uint32_t hash) {\n    LRUHandle** ptr = &list_[hash & (length_ - 1)];\n    while (*ptr != NULL &&\n           ((*ptr)->hash != hash || key != (*ptr)->key())) {\n      ptr = &(*ptr)->next_hash;\n    }\n    return ptr;\n  }\n\n  void Resize() {\n    uint32_t new_length = 4;\n    while (new_length < elems_) {\n      new_length *= 2;\n    }\n    LRUHandle** new_list = new LRUHandle*[new_length];\n    memset(new_list, 0, sizeof(new_list[0]) * new_length);\n    uint32_t count = 0;\n    for (uint32_t i = 0; i < length_; i++) {\n      LRUHandle* h = list_[i];\n      while (h != NULL) {\n        LRUHandle* next = h->next_hash;\n        uint32_t hash = h->hash;\n        LRUHandle** ptr = &new_list[hash & (new_length - 1)];\n        h->next_hash = *ptr;\n        *ptr = h;\n        h = next;\n        count++;\n      }\n    }\n    assert(elems_ == count);\n    delete[] list_;\n    list_ = new_list;\n    length_ = new_length;\n  }\n};\n\n// A single shard of sharded cache.\nclass LRUCache {\n public:\n  LRUCache();\n  ~LRUCache();\n\n  // Separate from constructor so caller can easily make an array of LRUCache\n  void SetCapacity(size_t capacity) { capacity_ = capacity; }\n\n  // Like Cache methods, but with an extra \"hash\" parameter.\n  Cache::Handle* Insert(const Slice& key, uint32_t hash,\n                        void* value, size_t charge,\n                        void (*deleter)(const Slice& key, void* value));\n  Cache::Handle* Lookup(const Slice& key, uint32_t hash);\n  void Release(Cache::Handle* handle);\n  void Erase(const Slice& key, uint32_t hash);\n  void Prune();\n  size_t TotalCharge() const {\n    MutexLock l(&mutex_);\n    return usage_;\n  }\n\n private:\n  void LRU_Remove(LRUHandle* e);\n  void LRU_Append(LRUHandle*list, LRUHandle* e);\n  void Ref(LRUHandle* e);\n  void Unref(LRUHandle* e);\n  bool FinishErase(LRUHandle* e);\n\n  // Initialized before use.\n  size_t capacity_;\n\n  // mutex_ protects the following state.\n  mutable port::Mutex mutex_;\n  size_t usage_;\n\n  // Dummy head of LRU list.\n  // lru.prev is newest entry, lru.next is oldest entry.\n  // Entries have refs==1 and in_cache==true.\n  LRUHandle lru_;\n\n  // Dummy head of in-use list.\n  // Entries are in use by clients, and have refs >= 2 and in_cache==true.\n  LRUHandle in_use_;\n\n  HandleTable table_;\n};\n\nLRUCache::LRUCache()\n    : usage_(0) {\n  // Make empty circular linked lists.\n  lru_.next = &lru_;\n  lru_.prev = &lru_;\n  in_use_.next = &in_use_;\n  in_use_.prev = &in_use_;\n}\n\nLRUCache::~LRUCache() {\n  assert(in_use_.next == &in_use_);  // Error if caller has an unreleased handle\n  for (LRUHandle* e = lru_.next; e != &lru_; ) {\n    LRUHandle* next = e->next;\n    assert(e->in_cache);\n    e->in_cache = false;\n    assert(e->refs == 1);  // Invariant of lru_ list.\n    Unref(e);\n    e = next;\n  }\n}\n\nvoid LRUCache::Ref(LRUHandle* e) {\n  if (e->refs == 1 && e->in_cache) {  // If on lru_ list, move to in_use_ list.\n    LRU_Remove(e);\n    LRU_Append(&in_use_, e);\n  }\n  e->refs++;\n}\n\nvoid LRUCache::Unref(LRUHandle* e) {\n  assert(e->refs > 0);\n  e->refs--;\n  if (e->refs == 0) { // Deallocate.\n    assert(!e->in_cache);\n    (*e->deleter)(e->key(), e->value);\n    free(e);\n  } else if (e->in_cache && e->refs == 1) {  // No longer in use; move to lru_ list.\n    LRU_Remove(e);\n    LRU_Append(&lru_, e);\n  }\n}\n\nvoid LRUCache::LRU_Remove(LRUHandle* e) {\n  e->next->prev = e->prev;\n  e->prev->next = e->next;\n}\n\nvoid LRUCache::LRU_Append(LRUHandle* list, LRUHandle* e) {\n  // Make \"e\" newest entry by inserting just before *list\n  e->next = list;\n  e->prev = list->prev;\n  e->prev->next = e;\n  e->next->prev = e;\n}\n\nCache::Handle* LRUCache::Lookup(const Slice& key, uint32_t hash) {\n  MutexLock l(&mutex_);\n  LRUHandle* e = table_.Lookup(key, hash);\n  if (e != NULL) {\n    Ref(e);\n  }\n  return reinterpret_cast<Cache::Handle*>(e);\n}\n\nvoid LRUCache::Release(Cache::Handle* handle) {\n  MutexLock l(&mutex_);\n  Unref(reinterpret_cast<LRUHandle*>(handle));\n}\n\nCache::Handle* LRUCache::Insert(\n    const Slice& key, uint32_t hash, void* value, size_t charge,\n    void (*deleter)(const Slice& key, void* value)) {\n  MutexLock l(&mutex_);\n\n  LRUHandle* e = reinterpret_cast<LRUHandle*>(\n      malloc(sizeof(LRUHandle)-1 + key.size()));\n  e->value = value;\n  e->deleter = deleter;\n  e->charge = charge;\n  e->key_length = key.size();\n  e->hash = hash;\n  e->in_cache = false;\n  e->refs = 1;  // for the returned handle.\n  memcpy(e->key_data, key.data(), key.size());\n\n  if (capacity_ > 0) {\n    e->refs++;  // for the cache's reference.\n    e->in_cache = true;\n    LRU_Append(&in_use_, e);\n    usage_ += charge;\n    FinishErase(table_.Insert(e));\n  } // else don't cache.  (Tests use capacity_==0 to turn off caching.)\n\n  while (usage_ > capacity_ && lru_.next != &lru_) {\n    LRUHandle* old = lru_.next;\n    assert(old->refs == 1);\n    bool erased = FinishErase(table_.Remove(old->key(), old->hash));\n    if (!erased) {  // to avoid unused variable when compiled NDEBUG\n      assert(erased);\n    }\n  }\n\n  return reinterpret_cast<Cache::Handle*>(e);\n}\n\n// If e != NULL, finish removing *e from the cache; it has already been removed\n// from the hash table.  Return whether e != NULL.  Requires mutex_ held.\nbool LRUCache::FinishErase(LRUHandle* e) {\n  if (e != NULL) {\n    assert(e->in_cache);\n    LRU_Remove(e);\n    e->in_cache = false;\n    usage_ -= e->charge;\n    Unref(e);\n  }\n  return e != NULL;\n}\n\nvoid LRUCache::Erase(const Slice& key, uint32_t hash) {\n  MutexLock l(&mutex_);\n  FinishErase(table_.Remove(key, hash));\n}\n\nvoid LRUCache::Prune() {\n  MutexLock l(&mutex_);\n  while (lru_.next != &lru_) {\n    LRUHandle* e = lru_.next;\n    assert(e->refs == 1);\n    bool erased = FinishErase(table_.Remove(e->key(), e->hash));\n    if (!erased) {  // to avoid unused variable when compiled NDEBUG\n      assert(erased);\n    }\n  }\n}\n\nstatic const int kNumShardBits = 4;\nstatic const int kNumShards = 1 << kNumShardBits;\n\nclass ShardedLRUCache : public Cache {\n private:\n  LRUCache shard_[kNumShards];\n  port::Mutex id_mutex_;\n  uint64_t last_id_;\n\n  static inline uint32_t HashSlice(const Slice& s) {\n    return Hash(s.data(), s.size(), 0);\n  }\n\n  static uint32_t Shard(uint32_t hash) {\n    return hash >> (32 - kNumShardBits);\n  }\n\n public:\n  explicit ShardedLRUCache(size_t capacity)\n      : last_id_(0) {\n    const size_t per_shard = (capacity + (kNumShards - 1)) / kNumShards;\n    for (int s = 0; s < kNumShards; s++) {\n      shard_[s].SetCapacity(per_shard);\n    }\n  }\n  virtual ~ShardedLRUCache() { }\n  virtual Handle* Insert(const Slice& key, void* value, size_t charge,\n                         void (*deleter)(const Slice& key, void* value)) {\n    const uint32_t hash = HashSlice(key);\n    return shard_[Shard(hash)].Insert(key, hash, value, charge, deleter);\n  }\n  virtual Handle* Lookup(const Slice& key) {\n    const uint32_t hash = HashSlice(key);\n    return shard_[Shard(hash)].Lookup(key, hash);\n  }\n  virtual void Release(Handle* handle) {\n    LRUHandle* h = reinterpret_cast<LRUHandle*>(handle);\n    shard_[Shard(h->hash)].Release(handle);\n  }\n  virtual void Erase(const Slice& key) {\n    const uint32_t hash = HashSlice(key);\n    shard_[Shard(hash)].Erase(key, hash);\n  }\n  virtual void* Value(Handle* handle) {\n    return reinterpret_cast<LRUHandle*>(handle)->value;\n  }\n  virtual uint64_t NewId() {\n    MutexLock l(&id_mutex_);\n    return ++(last_id_);\n  }\n  virtual void Prune() {\n    for (int s = 0; s < kNumShards; s++) {\n      shard_[s].Prune();\n    }\n  }\n  virtual size_t TotalCharge() const {\n    size_t total = 0;\n    for (int s = 0; s < kNumShards; s++) {\n      total += shard_[s].TotalCharge();\n    }\n    return total;\n  }\n};\n\n}  // end anonymous namespace\n\nCache* NewLRUCache(size_t capacity) {\n  return new ShardedLRUCache(capacity);\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/cache_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/cache.h\"\n\n#include <vector>\n#include \"util/coding.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\n// Conversions between numeric keys/values and the types expected by Cache.\nstatic std::string EncodeKey(int k) {\n  std::string result;\n  PutFixed32(&result, k);\n  return result;\n}\nstatic int DecodeKey(const Slice& k) {\n  assert(k.size() == 4);\n  return DecodeFixed32(k.data());\n}\nstatic void* EncodeValue(uintptr_t v) { return reinterpret_cast<void*>(v); }\nstatic int DecodeValue(void* v) { return reinterpret_cast<uintptr_t>(v); }\n\nclass CacheTest {\n public:\n  static CacheTest* current_;\n\n  static void Deleter(const Slice& key, void* v) {\n    current_->deleted_keys_.push_back(DecodeKey(key));\n    current_->deleted_values_.push_back(DecodeValue(v));\n  }\n\n  static const int kCacheSize = 1000;\n  std::vector<int> deleted_keys_;\n  std::vector<int> deleted_values_;\n  Cache* cache_;\n\n  CacheTest() : cache_(NewLRUCache(kCacheSize)) {\n    current_ = this;\n  }\n\n  ~CacheTest() {\n    delete cache_;\n  }\n\n  int Lookup(int key) {\n    Cache::Handle* handle = cache_->Lookup(EncodeKey(key));\n    const int r = (handle == NULL) ? -1 : DecodeValue(cache_->Value(handle));\n    if (handle != NULL) {\n      cache_->Release(handle);\n    }\n    return r;\n  }\n\n  void Insert(int key, int value, int charge = 1) {\n    cache_->Release(cache_->Insert(EncodeKey(key), EncodeValue(value), charge,\n                                   &CacheTest::Deleter));\n  }\n\n  Cache::Handle* InsertAndReturnHandle(int key, int value, int charge = 1) {\n    return cache_->Insert(EncodeKey(key), EncodeValue(value), charge,\n                          &CacheTest::Deleter);\n  }\n\n  void Erase(int key) {\n    cache_->Erase(EncodeKey(key));\n  }\n};\nCacheTest* CacheTest::current_;\n\nTEST(CacheTest, HitAndMiss) {\n  ASSERT_EQ(-1, Lookup(100));\n\n  Insert(100, 101);\n  ASSERT_EQ(101, Lookup(100));\n  ASSERT_EQ(-1,  Lookup(200));\n  ASSERT_EQ(-1,  Lookup(300));\n\n  Insert(200, 201);\n  ASSERT_EQ(101, Lookup(100));\n  ASSERT_EQ(201, Lookup(200));\n  ASSERT_EQ(-1,  Lookup(300));\n\n  Insert(100, 102);\n  ASSERT_EQ(102, Lookup(100));\n  ASSERT_EQ(201, Lookup(200));\n  ASSERT_EQ(-1,  Lookup(300));\n\n  ASSERT_EQ(1, deleted_keys_.size());\n  ASSERT_EQ(100, deleted_keys_[0]);\n  ASSERT_EQ(101, deleted_values_[0]);\n}\n\nTEST(CacheTest, Erase) {\n  Erase(200);\n  ASSERT_EQ(0, deleted_keys_.size());\n\n  Insert(100, 101);\n  Insert(200, 201);\n  Erase(100);\n  ASSERT_EQ(-1,  Lookup(100));\n  ASSERT_EQ(201, Lookup(200));\n  ASSERT_EQ(1, deleted_keys_.size());\n  ASSERT_EQ(100, deleted_keys_[0]);\n  ASSERT_EQ(101, deleted_values_[0]);\n\n  Erase(100);\n  ASSERT_EQ(-1,  Lookup(100));\n  ASSERT_EQ(201, Lookup(200));\n  ASSERT_EQ(1, deleted_keys_.size());\n}\n\nTEST(CacheTest, EntriesArePinned) {\n  Insert(100, 101);\n  Cache::Handle* h1 = cache_->Lookup(EncodeKey(100));\n  ASSERT_EQ(101, DecodeValue(cache_->Value(h1)));\n\n  Insert(100, 102);\n  Cache::Handle* h2 = cache_->Lookup(EncodeKey(100));\n  ASSERT_EQ(102, DecodeValue(cache_->Value(h2)));\n  ASSERT_EQ(0, deleted_keys_.size());\n\n  cache_->Release(h1);\n  ASSERT_EQ(1, deleted_keys_.size());\n  ASSERT_EQ(100, deleted_keys_[0]);\n  ASSERT_EQ(101, deleted_values_[0]);\n\n  Erase(100);\n  ASSERT_EQ(-1, Lookup(100));\n  ASSERT_EQ(1, deleted_keys_.size());\n\n  cache_->Release(h2);\n  ASSERT_EQ(2, deleted_keys_.size());\n  ASSERT_EQ(100, deleted_keys_[1]);\n  ASSERT_EQ(102, deleted_values_[1]);\n}\n\nTEST(CacheTest, EvictionPolicy) {\n  Insert(100, 101);\n  Insert(200, 201);\n  Insert(300, 301);\n  Cache::Handle* h = cache_->Lookup(EncodeKey(300));\n\n  // Frequently used entry must be kept around,\n  // as must things that are still in use.\n  for (int i = 0; i < kCacheSize + 100; i++) {\n    Insert(1000+i, 2000+i);\n    ASSERT_EQ(2000+i, Lookup(1000+i));\n    ASSERT_EQ(101, Lookup(100));\n  }\n  ASSERT_EQ(101, Lookup(100));\n  ASSERT_EQ(-1, Lookup(200));\n  ASSERT_EQ(301, Lookup(300));\n  cache_->Release(h);\n}\n\nTEST(CacheTest, UseExceedsCacheSize) {\n  // Overfill the cache, keeping handles on all inserted entries.\n  std::vector<Cache::Handle*> h;\n  for (int i = 0; i < kCacheSize + 100; i++) {\n    h.push_back(InsertAndReturnHandle(1000+i, 2000+i));\n  }\n\n  // Check that all the entries can be found in the cache.\n  for (int i = 0; i < h.size(); i++) {\n    ASSERT_EQ(2000+i, Lookup(1000+i));\n  }\n\n  for (int i = 0; i < h.size(); i++) {\n    cache_->Release(h[i]);\n  }\n}\n\nTEST(CacheTest, HeavyEntries) {\n  // Add a bunch of light and heavy entries and then count the combined\n  // size of items still in the cache, which must be approximately the\n  // same as the total capacity.\n  const int kLight = 1;\n  const int kHeavy = 10;\n  int added = 0;\n  int index = 0;\n  while (added < 2*kCacheSize) {\n    const int weight = (index & 1) ? kLight : kHeavy;\n    Insert(index, 1000+index, weight);\n    added += weight;\n    index++;\n  }\n\n  int cached_weight = 0;\n  for (int i = 0; i < index; i++) {\n    const int weight = (i & 1 ? kLight : kHeavy);\n    int r = Lookup(i);\n    if (r >= 0) {\n      cached_weight += weight;\n      ASSERT_EQ(1000+i, r);\n    }\n  }\n  ASSERT_LE(cached_weight, kCacheSize + kCacheSize/10);\n}\n\nTEST(CacheTest, NewId) {\n  uint64_t a = cache_->NewId();\n  uint64_t b = cache_->NewId();\n  ASSERT_NE(a, b);\n}\n\nTEST(CacheTest, Prune) {\n  Insert(1, 100);\n  Insert(2, 200);\n\n  Cache::Handle* handle = cache_->Lookup(EncodeKey(1));\n  ASSERT_TRUE(handle);\n  cache_->Prune();\n  cache_->Release(handle);\n\n  ASSERT_EQ(100, Lookup(1));\n  ASSERT_EQ(-1, Lookup(2));\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/util/coding.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"util/coding.h\"\n\nnamespace leveldb {\n\nvoid EncodeFixed32(char* buf, uint32_t value) {\n  if (port::kLittleEndian) {\n    memcpy(buf, &value, sizeof(value));\n  } else {\n    buf[0] = value & 0xff;\n    buf[1] = (value >> 8) & 0xff;\n    buf[2] = (value >> 16) & 0xff;\n    buf[3] = (value >> 24) & 0xff;\n  }\n}\n\nvoid EncodeFixed64(char* buf, uint64_t value) {\n  if (port::kLittleEndian) {\n    memcpy(buf, &value, sizeof(value));\n  } else {\n    buf[0] = value & 0xff;\n    buf[1] = (value >> 8) & 0xff;\n    buf[2] = (value >> 16) & 0xff;\n    buf[3] = (value >> 24) & 0xff;\n    buf[4] = (value >> 32) & 0xff;\n    buf[5] = (value >> 40) & 0xff;\n    buf[6] = (value >> 48) & 0xff;\n    buf[7] = (value >> 56) & 0xff;\n  }\n}\n\nvoid PutFixed32(std::string* dst, uint32_t value) {\n  char buf[sizeof(value)];\n  EncodeFixed32(buf, value);\n  dst->append(buf, sizeof(buf));\n}\n\nvoid PutFixed64(std::string* dst, uint64_t value) {\n  char buf[sizeof(value)];\n  EncodeFixed64(buf, value);\n  dst->append(buf, sizeof(buf));\n}\n\nchar* EncodeVarint32(char* dst, uint32_t v) {\n  // Operate on characters as unsigneds\n  unsigned char* ptr = reinterpret_cast<unsigned char*>(dst);\n  static const int B = 128;\n  if (v < (1<<7)) {\n    *(ptr++) = v;\n  } else if (v < (1<<14)) {\n    *(ptr++) = v | B;\n    *(ptr++) = v>>7;\n  } else if (v < (1<<21)) {\n    *(ptr++) = v | B;\n    *(ptr++) = (v>>7) | B;\n    *(ptr++) = v>>14;\n  } else if (v < (1<<28)) {\n    *(ptr++) = v | B;\n    *(ptr++) = (v>>7) | B;\n    *(ptr++) = (v>>14) | B;\n    *(ptr++) = v>>21;\n  } else {\n    *(ptr++) = v | B;\n    *(ptr++) = (v>>7) | B;\n    *(ptr++) = (v>>14) | B;\n    *(ptr++) = (v>>21) | B;\n    *(ptr++) = v>>28;\n  }\n  return reinterpret_cast<char*>(ptr);\n}\n\nvoid PutVarint32(std::string* dst, uint32_t v) {\n  char buf[5];\n  char* ptr = EncodeVarint32(buf, v);\n  dst->append(buf, ptr - buf);\n}\n\nchar* EncodeVarint64(char* dst, uint64_t v) {\n  static const int B = 128;\n  unsigned char* ptr = reinterpret_cast<unsigned char*>(dst);\n  while (v >= B) {\n    *(ptr++) = (v & (B-1)) | B;\n    v >>= 7;\n  }\n  *(ptr++) = static_cast<unsigned char>(v);\n  return reinterpret_cast<char*>(ptr);\n}\n\nvoid PutVarint64(std::string* dst, uint64_t v) {\n  char buf[10];\n  char* ptr = EncodeVarint64(buf, v);\n  dst->append(buf, ptr - buf);\n}\n\nvoid PutLengthPrefixedSlice(std::string* dst, const Slice& value) {\n  PutVarint32(dst, value.size());\n  dst->append(value.data(), value.size());\n}\n\nint VarintLength(uint64_t v) {\n  int len = 1;\n  while (v >= 128) {\n    v >>= 7;\n    len++;\n  }\n  return len;\n}\n\nconst char* GetVarint32PtrFallback(const char* p,\n                                   const char* limit,\n                                   uint32_t* value) {\n  uint32_t result = 0;\n  for (uint32_t shift = 0; shift <= 28 && p < limit; shift += 7) {\n    uint32_t byte = *(reinterpret_cast<const unsigned char*>(p));\n    p++;\n    if (byte & 128) {\n      // More bytes are present\n      result |= ((byte & 127) << shift);\n    } else {\n      result |= (byte << shift);\n      *value = result;\n      return reinterpret_cast<const char*>(p);\n    }\n  }\n  return NULL;\n}\n\nbool GetVarint32(Slice* input, uint32_t* value) {\n  const char* p = input->data();\n  const char* limit = p + input->size();\n  const char* q = GetVarint32Ptr(p, limit, value);\n  if (q == NULL) {\n    return false;\n  } else {\n    *input = Slice(q, limit - q);\n    return true;\n  }\n}\n\nconst char* GetVarint64Ptr(const char* p, const char* limit, uint64_t* value) {\n  uint64_t result = 0;\n  for (uint32_t shift = 0; shift <= 63 && p < limit; shift += 7) {\n    uint64_t byte = *(reinterpret_cast<const unsigned char*>(p));\n    p++;\n    if (byte & 128) {\n      // More bytes are present\n      result |= ((byte & 127) << shift);\n    } else {\n      result |= (byte << shift);\n      *value = result;\n      return reinterpret_cast<const char*>(p);\n    }\n  }\n  return NULL;\n}\n\nbool GetVarint64(Slice* input, uint64_t* value) {\n  const char* p = input->data();\n  const char* limit = p + input->size();\n  const char* q = GetVarint64Ptr(p, limit, value);\n  if (q == NULL) {\n    return false;\n  } else {\n    *input = Slice(q, limit - q);\n    return true;\n  }\n}\n\nconst char* GetLengthPrefixedSlice(const char* p, const char* limit,\n                                   Slice* result) {\n  uint32_t len;\n  p = GetVarint32Ptr(p, limit, &len);\n  if (p == NULL) return NULL;\n  if (p + len > limit) return NULL;\n  *result = Slice(p, len);\n  return p + len;\n}\n\nbool GetLengthPrefixedSlice(Slice* input, Slice* result) {\n  uint32_t len;\n  if (GetVarint32(input, &len) &&\n      input->size() >= len) {\n    *result = Slice(input->data(), len);\n    input->remove_prefix(len);\n    return true;\n  } else {\n    return false;\n  }\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/coding.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// Endian-neutral encoding:\n// * Fixed-length numbers are encoded with least-significant byte first\n// * In addition we support variable length \"varint\" encoding\n// * Strings are encoded prefixed by their length in varint format\n\n#ifndef STORAGE_LEVELDB_UTIL_CODING_H_\n#define STORAGE_LEVELDB_UTIL_CODING_H_\n\n#include <stdint.h>\n#include <string.h>\n#include <string>\n#include \"leveldb/slice.h\"\n#include \"port/port.h\"\n\nnamespace leveldb {\n\n// Standard Put... routines append to a string\nextern void PutFixed32(std::string* dst, uint32_t value);\nextern void PutFixed64(std::string* dst, uint64_t value);\nextern void PutVarint32(std::string* dst, uint32_t value);\nextern void PutVarint64(std::string* dst, uint64_t value);\nextern void PutLengthPrefixedSlice(std::string* dst, const Slice& value);\n\n// Standard Get... routines parse a value from the beginning of a Slice\n// and advance the slice past the parsed value.\nextern bool GetVarint32(Slice* input, uint32_t* value);\nextern bool GetVarint64(Slice* input, uint64_t* value);\nextern bool GetLengthPrefixedSlice(Slice* input, Slice* result);\n\n// Pointer-based variants of GetVarint...  These either store a value\n// in *v and return a pointer just past the parsed value, or return\n// NULL on error.  These routines only look at bytes in the range\n// [p..limit-1]\nextern const char* GetVarint32Ptr(const char* p,const char* limit, uint32_t* v);\nextern const char* GetVarint64Ptr(const char* p,const char* limit, uint64_t* v);\n\n// Returns the length of the varint32 or varint64 encoding of \"v\"\nextern int VarintLength(uint64_t v);\n\n// Lower-level versions of Put... that write directly into a character buffer\n// REQUIRES: dst has enough space for the value being written\nextern void EncodeFixed32(char* dst, uint32_t value);\nextern void EncodeFixed64(char* dst, uint64_t value);\n\n// Lower-level versions of Put... that write directly into a character buffer\n// and return a pointer just past the last byte written.\n// REQUIRES: dst has enough space for the value being written\nextern char* EncodeVarint32(char* dst, uint32_t value);\nextern char* EncodeVarint64(char* dst, uint64_t value);\n\n// Lower-level versions of Get... that read directly from a character buffer\n// without any bounds checking.\n\ninline uint32_t DecodeFixed32(const char* ptr) {\n  if (port::kLittleEndian) {\n    // Load the raw bytes\n    uint32_t result;\n    memcpy(&result, ptr, sizeof(result));  // gcc optimizes this to a plain load\n    return result;\n  } else {\n    return ((static_cast<uint32_t>(static_cast<unsigned char>(ptr[0])))\n        | (static_cast<uint32_t>(static_cast<unsigned char>(ptr[1])) << 8)\n        | (static_cast<uint32_t>(static_cast<unsigned char>(ptr[2])) << 16)\n        | (static_cast<uint32_t>(static_cast<unsigned char>(ptr[3])) << 24));\n  }\n}\n\ninline uint64_t DecodeFixed64(const char* ptr) {\n  if (port::kLittleEndian) {\n    // Load the raw bytes\n    uint64_t result;\n    memcpy(&result, ptr, sizeof(result));  // gcc optimizes this to a plain load\n    return result;\n  } else {\n    uint64_t lo = DecodeFixed32(ptr);\n    uint64_t hi = DecodeFixed32(ptr + 4);\n    return (hi << 32) | lo;\n  }\n}\n\n// Internal routine for use by fallback path of GetVarint32Ptr\nextern const char* GetVarint32PtrFallback(const char* p,\n                                          const char* limit,\n                                          uint32_t* value);\ninline const char* GetVarint32Ptr(const char* p,\n                                  const char* limit,\n                                  uint32_t* value) {\n  if (p < limit) {\n    uint32_t result = *(reinterpret_cast<const unsigned char*>(p));\n    if ((result & 128) == 0) {\n      *value = result;\n      return p + 1;\n    }\n  }\n  return GetVarint32PtrFallback(p, limit, value);\n}\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_UTIL_CODING_H_\n"
  },
  {
    "path": "src/leveldb/util/coding_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"util/coding.h\"\n\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\nclass Coding { };\n\nTEST(Coding, Fixed32) {\n  std::string s;\n  for (uint32_t v = 0; v < 100000; v++) {\n    PutFixed32(&s, v);\n  }\n\n  const char* p = s.data();\n  for (uint32_t v = 0; v < 100000; v++) {\n    uint32_t actual = DecodeFixed32(p);\n    ASSERT_EQ(v, actual);\n    p += sizeof(uint32_t);\n  }\n}\n\nTEST(Coding, Fixed64) {\n  std::string s;\n  for (int power = 0; power <= 63; power++) {\n    uint64_t v = static_cast<uint64_t>(1) << power;\n    PutFixed64(&s, v - 1);\n    PutFixed64(&s, v + 0);\n    PutFixed64(&s, v + 1);\n  }\n\n  const char* p = s.data();\n  for (int power = 0; power <= 63; power++) {\n    uint64_t v = static_cast<uint64_t>(1) << power;\n    uint64_t actual;\n    actual = DecodeFixed64(p);\n    ASSERT_EQ(v-1, actual);\n    p += sizeof(uint64_t);\n\n    actual = DecodeFixed64(p);\n    ASSERT_EQ(v+0, actual);\n    p += sizeof(uint64_t);\n\n    actual = DecodeFixed64(p);\n    ASSERT_EQ(v+1, actual);\n    p += sizeof(uint64_t);\n  }\n}\n\n// Test that encoding routines generate little-endian encodings\nTEST(Coding, EncodingOutput) {\n  std::string dst;\n  PutFixed32(&dst, 0x04030201);\n  ASSERT_EQ(4, dst.size());\n  ASSERT_EQ(0x01, static_cast<int>(dst[0]));\n  ASSERT_EQ(0x02, static_cast<int>(dst[1]));\n  ASSERT_EQ(0x03, static_cast<int>(dst[2]));\n  ASSERT_EQ(0x04, static_cast<int>(dst[3]));\n\n  dst.clear();\n  PutFixed64(&dst, 0x0807060504030201ull);\n  ASSERT_EQ(8, dst.size());\n  ASSERT_EQ(0x01, static_cast<int>(dst[0]));\n  ASSERT_EQ(0x02, static_cast<int>(dst[1]));\n  ASSERT_EQ(0x03, static_cast<int>(dst[2]));\n  ASSERT_EQ(0x04, static_cast<int>(dst[3]));\n  ASSERT_EQ(0x05, static_cast<int>(dst[4]));\n  ASSERT_EQ(0x06, static_cast<int>(dst[5]));\n  ASSERT_EQ(0x07, static_cast<int>(dst[6]));\n  ASSERT_EQ(0x08, static_cast<int>(dst[7]));\n}\n\nTEST(Coding, Varint32) {\n  std::string s;\n  for (uint32_t i = 0; i < (32 * 32); i++) {\n    uint32_t v = (i / 32) << (i % 32);\n    PutVarint32(&s, v);\n  }\n\n  const char* p = s.data();\n  const char* limit = p + s.size();\n  for (uint32_t i = 0; i < (32 * 32); i++) {\n    uint32_t expected = (i / 32) << (i % 32);\n    uint32_t actual;\n    const char* start = p;\n    p = GetVarint32Ptr(p, limit, &actual);\n    ASSERT_TRUE(p != NULL);\n    ASSERT_EQ(expected, actual);\n    ASSERT_EQ(VarintLength(actual), p - start);\n  }\n  ASSERT_EQ(p, s.data() + s.size());\n}\n\nTEST(Coding, Varint64) {\n  // Construct the list of values to check\n  std::vector<uint64_t> values;\n  // Some special values\n  values.push_back(0);\n  values.push_back(100);\n  values.push_back(~static_cast<uint64_t>(0));\n  values.push_back(~static_cast<uint64_t>(0) - 1);\n  for (uint32_t k = 0; k < 64; k++) {\n    // Test values near powers of two\n    const uint64_t power = 1ull << k;\n    values.push_back(power);\n    values.push_back(power-1);\n    values.push_back(power+1);\n  }\n\n  std::string s;\n  for (size_t i = 0; i < values.size(); i++) {\n    PutVarint64(&s, values[i]);\n  }\n\n  const char* p = s.data();\n  const char* limit = p + s.size();\n  for (size_t i = 0; i < values.size(); i++) {\n    ASSERT_TRUE(p < limit);\n    uint64_t actual;\n    const char* start = p;\n    p = GetVarint64Ptr(p, limit, &actual);\n    ASSERT_TRUE(p != NULL);\n    ASSERT_EQ(values[i], actual);\n    ASSERT_EQ(VarintLength(actual), p - start);\n  }\n  ASSERT_EQ(p, limit);\n\n}\n\nTEST(Coding, Varint32Overflow) {\n  uint32_t result;\n  std::string input(\"\\x81\\x82\\x83\\x84\\x85\\x11\");\n  ASSERT_TRUE(GetVarint32Ptr(input.data(), input.data() + input.size(), &result)\n              == NULL);\n}\n\nTEST(Coding, Varint32Truncation) {\n  uint32_t large_value = (1u << 31) + 100;\n  std::string s;\n  PutVarint32(&s, large_value);\n  uint32_t result;\n  for (size_t len = 0; len < s.size() - 1; len++) {\n    ASSERT_TRUE(GetVarint32Ptr(s.data(), s.data() + len, &result) == NULL);\n  }\n  ASSERT_TRUE(GetVarint32Ptr(s.data(), s.data() + s.size(), &result) != NULL);\n  ASSERT_EQ(large_value, result);\n}\n\nTEST(Coding, Varint64Overflow) {\n  uint64_t result;\n  std::string input(\"\\x81\\x82\\x83\\x84\\x85\\x81\\x82\\x83\\x84\\x85\\x11\");\n  ASSERT_TRUE(GetVarint64Ptr(input.data(), input.data() + input.size(), &result)\n              == NULL);\n}\n\nTEST(Coding, Varint64Truncation) {\n  uint64_t large_value = (1ull << 63) + 100ull;\n  std::string s;\n  PutVarint64(&s, large_value);\n  uint64_t result;\n  for (size_t len = 0; len < s.size() - 1; len++) {\n    ASSERT_TRUE(GetVarint64Ptr(s.data(), s.data() + len, &result) == NULL);\n  }\n  ASSERT_TRUE(GetVarint64Ptr(s.data(), s.data() + s.size(), &result) != NULL);\n  ASSERT_EQ(large_value, result);\n}\n\nTEST(Coding, Strings) {\n  std::string s;\n  PutLengthPrefixedSlice(&s, Slice(\"\"));\n  PutLengthPrefixedSlice(&s, Slice(\"foo\"));\n  PutLengthPrefixedSlice(&s, Slice(\"bar\"));\n  PutLengthPrefixedSlice(&s, Slice(std::string(200, 'x')));\n\n  Slice input(s);\n  Slice v;\n  ASSERT_TRUE(GetLengthPrefixedSlice(&input, &v));\n  ASSERT_EQ(\"\", v.ToString());\n  ASSERT_TRUE(GetLengthPrefixedSlice(&input, &v));\n  ASSERT_EQ(\"foo\", v.ToString());\n  ASSERT_TRUE(GetLengthPrefixedSlice(&input, &v));\n  ASSERT_EQ(\"bar\", v.ToString());\n  ASSERT_TRUE(GetLengthPrefixedSlice(&input, &v));\n  ASSERT_EQ(std::string(200, 'x'), v.ToString());\n  ASSERT_EQ(\"\", input.ToString());\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/util/comparator.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <algorithm>\n#include <stdint.h>\n#include \"leveldb/comparator.h\"\n#include \"leveldb/slice.h\"\n#include \"port/port.h\"\n#include \"util/logging.h\"\n\nnamespace leveldb {\n\nComparator::~Comparator() { }\n\nnamespace {\nclass BytewiseComparatorImpl : public Comparator {\n public:\n  BytewiseComparatorImpl() { }\n\n  virtual const char* Name() const {\n    return \"leveldb.BytewiseComparator\";\n  }\n\n  virtual int Compare(const Slice& a, const Slice& b) const {\n    return a.compare(b);\n  }\n\n  virtual void FindShortestSeparator(\n      std::string* start,\n      const Slice& limit) const {\n    // Find length of common prefix\n    size_t min_length = std::min(start->size(), limit.size());\n    size_t diff_index = 0;\n    while ((diff_index < min_length) &&\n           ((*start)[diff_index] == limit[diff_index])) {\n      diff_index++;\n    }\n\n    if (diff_index >= min_length) {\n      // Do not shorten if one string is a prefix of the other\n    } else {\n      uint8_t diff_byte = static_cast<uint8_t>((*start)[diff_index]);\n      if (diff_byte < static_cast<uint8_t>(0xff) &&\n          diff_byte + 1 < static_cast<uint8_t>(limit[diff_index])) {\n        (*start)[diff_index]++;\n        start->resize(diff_index + 1);\n        assert(Compare(*start, limit) < 0);\n      }\n    }\n  }\n\n  virtual void FindShortSuccessor(std::string* key) const {\n    // Find first character that can be incremented\n    size_t n = key->size();\n    for (size_t i = 0; i < n; i++) {\n      const uint8_t byte = (*key)[i];\n      if (byte != static_cast<uint8_t>(0xff)) {\n        (*key)[i] = byte + 1;\n        key->resize(i+1);\n        return;\n      }\n    }\n    // *key is a run of 0xffs.  Leave it alone.\n  }\n};\n}  // namespace\n\nstatic port::OnceType once = LEVELDB_ONCE_INIT;\nstatic const Comparator* bytewise;\n\nstatic void InitModule() {\n  bytewise = new BytewiseComparatorImpl;\n}\n\nconst Comparator* BytewiseComparator() {\n  port::InitOnce(&once, InitModule);\n  return bytewise;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/crc32c.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// A portable implementation of crc32c, optimized to handle\n// four bytes at a time.\n\n#include \"util/crc32c.h\"\n\n#include <stdint.h>\n\n#include \"port/port.h\"\n#include \"util/coding.h\"\n\nnamespace leveldb {\nnamespace crc32c {\n\nstatic const uint32_t table0_[256] = {\n  0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4,\n  0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb,\n  0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b,\n  0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24,\n  0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b,\n  0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384,\n  0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54,\n  0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b,\n  0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a,\n  0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35,\n  0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5,\n  0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa,\n  0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45,\n  0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a,\n  0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a,\n  0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595,\n  0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48,\n  0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957,\n  0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687,\n  0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198,\n  0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927,\n  0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38,\n  0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8,\n  0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7,\n  0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096,\n  0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789,\n  0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859,\n  0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46,\n  0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9,\n  0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6,\n  0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36,\n  0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829,\n  0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c,\n  0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93,\n  0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043,\n  0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c,\n  0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3,\n  0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc,\n  0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c,\n  0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033,\n  0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652,\n  0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d,\n  0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d,\n  0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982,\n  0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d,\n  0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622,\n  0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2,\n  0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed,\n  0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530,\n  0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f,\n  0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff,\n  0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0,\n  0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f,\n  0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540,\n  0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90,\n  0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f,\n  0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee,\n  0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1,\n  0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321,\n  0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e,\n  0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81,\n  0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e,\n  0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e,\n  0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351\n};\nstatic const uint32_t table1_[256] = {\n  0x00000000, 0x13a29877, 0x274530ee, 0x34e7a899,\n  0x4e8a61dc, 0x5d28f9ab, 0x69cf5132, 0x7a6dc945,\n  0x9d14c3b8, 0x8eb65bcf, 0xba51f356, 0xa9f36b21,\n  0xd39ea264, 0xc03c3a13, 0xf4db928a, 0xe7790afd,\n  0x3fc5f181, 0x2c6769f6, 0x1880c16f, 0x0b225918,\n  0x714f905d, 0x62ed082a, 0x560aa0b3, 0x45a838c4,\n  0xa2d13239, 0xb173aa4e, 0x859402d7, 0x96369aa0,\n  0xec5b53e5, 0xfff9cb92, 0xcb1e630b, 0xd8bcfb7c,\n  0x7f8be302, 0x6c297b75, 0x58ced3ec, 0x4b6c4b9b,\n  0x310182de, 0x22a31aa9, 0x1644b230, 0x05e62a47,\n  0xe29f20ba, 0xf13db8cd, 0xc5da1054, 0xd6788823,\n  0xac154166, 0xbfb7d911, 0x8b507188, 0x98f2e9ff,\n  0x404e1283, 0x53ec8af4, 0x670b226d, 0x74a9ba1a,\n  0x0ec4735f, 0x1d66eb28, 0x298143b1, 0x3a23dbc6,\n  0xdd5ad13b, 0xcef8494c, 0xfa1fe1d5, 0xe9bd79a2,\n  0x93d0b0e7, 0x80722890, 0xb4958009, 0xa737187e,\n  0xff17c604, 0xecb55e73, 0xd852f6ea, 0xcbf06e9d,\n  0xb19da7d8, 0xa23f3faf, 0x96d89736, 0x857a0f41,\n  0x620305bc, 0x71a19dcb, 0x45463552, 0x56e4ad25,\n  0x2c896460, 0x3f2bfc17, 0x0bcc548e, 0x186eccf9,\n  0xc0d23785, 0xd370aff2, 0xe797076b, 0xf4359f1c,\n  0x8e585659, 0x9dface2e, 0xa91d66b7, 0xbabffec0,\n  0x5dc6f43d, 0x4e646c4a, 0x7a83c4d3, 0x69215ca4,\n  0x134c95e1, 0x00ee0d96, 0x3409a50f, 0x27ab3d78,\n  0x809c2506, 0x933ebd71, 0xa7d915e8, 0xb47b8d9f,\n  0xce1644da, 0xddb4dcad, 0xe9537434, 0xfaf1ec43,\n  0x1d88e6be, 0x0e2a7ec9, 0x3acdd650, 0x296f4e27,\n  0x53028762, 0x40a01f15, 0x7447b78c, 0x67e52ffb,\n  0xbf59d487, 0xacfb4cf0, 0x981ce469, 0x8bbe7c1e,\n  0xf1d3b55b, 0xe2712d2c, 0xd69685b5, 0xc5341dc2,\n  0x224d173f, 0x31ef8f48, 0x050827d1, 0x16aabfa6,\n  0x6cc776e3, 0x7f65ee94, 0x4b82460d, 0x5820de7a,\n  0xfbc3faf9, 0xe861628e, 0xdc86ca17, 0xcf245260,\n  0xb5499b25, 0xa6eb0352, 0x920cabcb, 0x81ae33bc,\n  0x66d73941, 0x7575a136, 0x419209af, 0x523091d8,\n  0x285d589d, 0x3bffc0ea, 0x0f186873, 0x1cbaf004,\n  0xc4060b78, 0xd7a4930f, 0xe3433b96, 0xf0e1a3e1,\n  0x8a8c6aa4, 0x992ef2d3, 0xadc95a4a, 0xbe6bc23d,\n  0x5912c8c0, 0x4ab050b7, 0x7e57f82e, 0x6df56059,\n  0x1798a91c, 0x043a316b, 0x30dd99f2, 0x237f0185,\n  0x844819fb, 0x97ea818c, 0xa30d2915, 0xb0afb162,\n  0xcac27827, 0xd960e050, 0xed8748c9, 0xfe25d0be,\n  0x195cda43, 0x0afe4234, 0x3e19eaad, 0x2dbb72da,\n  0x57d6bb9f, 0x447423e8, 0x70938b71, 0x63311306,\n  0xbb8de87a, 0xa82f700d, 0x9cc8d894, 0x8f6a40e3,\n  0xf50789a6, 0xe6a511d1, 0xd242b948, 0xc1e0213f,\n  0x26992bc2, 0x353bb3b5, 0x01dc1b2c, 0x127e835b,\n  0x68134a1e, 0x7bb1d269, 0x4f567af0, 0x5cf4e287,\n  0x04d43cfd, 0x1776a48a, 0x23910c13, 0x30339464,\n  0x4a5e5d21, 0x59fcc556, 0x6d1b6dcf, 0x7eb9f5b8,\n  0x99c0ff45, 0x8a626732, 0xbe85cfab, 0xad2757dc,\n  0xd74a9e99, 0xc4e806ee, 0xf00fae77, 0xe3ad3600,\n  0x3b11cd7c, 0x28b3550b, 0x1c54fd92, 0x0ff665e5,\n  0x759baca0, 0x663934d7, 0x52de9c4e, 0x417c0439,\n  0xa6050ec4, 0xb5a796b3, 0x81403e2a, 0x92e2a65d,\n  0xe88f6f18, 0xfb2df76f, 0xcfca5ff6, 0xdc68c781,\n  0x7b5fdfff, 0x68fd4788, 0x5c1aef11, 0x4fb87766,\n  0x35d5be23, 0x26772654, 0x12908ecd, 0x013216ba,\n  0xe64b1c47, 0xf5e98430, 0xc10e2ca9, 0xd2acb4de,\n  0xa8c17d9b, 0xbb63e5ec, 0x8f844d75, 0x9c26d502,\n  0x449a2e7e, 0x5738b609, 0x63df1e90, 0x707d86e7,\n  0x0a104fa2, 0x19b2d7d5, 0x2d557f4c, 0x3ef7e73b,\n  0xd98eedc6, 0xca2c75b1, 0xfecbdd28, 0xed69455f,\n  0x97048c1a, 0x84a6146d, 0xb041bcf4, 0xa3e32483\n};\nstatic const uint32_t table2_[256] = {\n  0x00000000, 0xa541927e, 0x4f6f520d, 0xea2ec073,\n  0x9edea41a, 0x3b9f3664, 0xd1b1f617, 0x74f06469,\n  0x38513ec5, 0x9d10acbb, 0x773e6cc8, 0xd27ffeb6,\n  0xa68f9adf, 0x03ce08a1, 0xe9e0c8d2, 0x4ca15aac,\n  0x70a27d8a, 0xd5e3eff4, 0x3fcd2f87, 0x9a8cbdf9,\n  0xee7cd990, 0x4b3d4bee, 0xa1138b9d, 0x045219e3,\n  0x48f3434f, 0xedb2d131, 0x079c1142, 0xa2dd833c,\n  0xd62de755, 0x736c752b, 0x9942b558, 0x3c032726,\n  0xe144fb14, 0x4405696a, 0xae2ba919, 0x0b6a3b67,\n  0x7f9a5f0e, 0xdadbcd70, 0x30f50d03, 0x95b49f7d,\n  0xd915c5d1, 0x7c5457af, 0x967a97dc, 0x333b05a2,\n  0x47cb61cb, 0xe28af3b5, 0x08a433c6, 0xade5a1b8,\n  0x91e6869e, 0x34a714e0, 0xde89d493, 0x7bc846ed,\n  0x0f382284, 0xaa79b0fa, 0x40577089, 0xe516e2f7,\n  0xa9b7b85b, 0x0cf62a25, 0xe6d8ea56, 0x43997828,\n  0x37691c41, 0x92288e3f, 0x78064e4c, 0xdd47dc32,\n  0xc76580d9, 0x622412a7, 0x880ad2d4, 0x2d4b40aa,\n  0x59bb24c3, 0xfcfab6bd, 0x16d476ce, 0xb395e4b0,\n  0xff34be1c, 0x5a752c62, 0xb05bec11, 0x151a7e6f,\n  0x61ea1a06, 0xc4ab8878, 0x2e85480b, 0x8bc4da75,\n  0xb7c7fd53, 0x12866f2d, 0xf8a8af5e, 0x5de93d20,\n  0x29195949, 0x8c58cb37, 0x66760b44, 0xc337993a,\n  0x8f96c396, 0x2ad751e8, 0xc0f9919b, 0x65b803e5,\n  0x1148678c, 0xb409f5f2, 0x5e273581, 0xfb66a7ff,\n  0x26217bcd, 0x8360e9b3, 0x694e29c0, 0xcc0fbbbe,\n  0xb8ffdfd7, 0x1dbe4da9, 0xf7908dda, 0x52d11fa4,\n  0x1e704508, 0xbb31d776, 0x511f1705, 0xf45e857b,\n  0x80aee112, 0x25ef736c, 0xcfc1b31f, 0x6a802161,\n  0x56830647, 0xf3c29439, 0x19ec544a, 0xbcadc634,\n  0xc85da25d, 0x6d1c3023, 0x8732f050, 0x2273622e,\n  0x6ed23882, 0xcb93aafc, 0x21bd6a8f, 0x84fcf8f1,\n  0xf00c9c98, 0x554d0ee6, 0xbf63ce95, 0x1a225ceb,\n  0x8b277743, 0x2e66e53d, 0xc448254e, 0x6109b730,\n  0x15f9d359, 0xb0b84127, 0x5a968154, 0xffd7132a,\n  0xb3764986, 0x1637dbf8, 0xfc191b8b, 0x595889f5,\n  0x2da8ed9c, 0x88e97fe2, 0x62c7bf91, 0xc7862def,\n  0xfb850ac9, 0x5ec498b7, 0xb4ea58c4, 0x11abcaba,\n  0x655baed3, 0xc01a3cad, 0x2a34fcde, 0x8f756ea0,\n  0xc3d4340c, 0x6695a672, 0x8cbb6601, 0x29faf47f,\n  0x5d0a9016, 0xf84b0268, 0x1265c21b, 0xb7245065,\n  0x6a638c57, 0xcf221e29, 0x250cde5a, 0x804d4c24,\n  0xf4bd284d, 0x51fcba33, 0xbbd27a40, 0x1e93e83e,\n  0x5232b292, 0xf77320ec, 0x1d5de09f, 0xb81c72e1,\n  0xccec1688, 0x69ad84f6, 0x83834485, 0x26c2d6fb,\n  0x1ac1f1dd, 0xbf8063a3, 0x55aea3d0, 0xf0ef31ae,\n  0x841f55c7, 0x215ec7b9, 0xcb7007ca, 0x6e3195b4,\n  0x2290cf18, 0x87d15d66, 0x6dff9d15, 0xc8be0f6b,\n  0xbc4e6b02, 0x190ff97c, 0xf321390f, 0x5660ab71,\n  0x4c42f79a, 0xe90365e4, 0x032da597, 0xa66c37e9,\n  0xd29c5380, 0x77ddc1fe, 0x9df3018d, 0x38b293f3,\n  0x7413c95f, 0xd1525b21, 0x3b7c9b52, 0x9e3d092c,\n  0xeacd6d45, 0x4f8cff3b, 0xa5a23f48, 0x00e3ad36,\n  0x3ce08a10, 0x99a1186e, 0x738fd81d, 0xd6ce4a63,\n  0xa23e2e0a, 0x077fbc74, 0xed517c07, 0x4810ee79,\n  0x04b1b4d5, 0xa1f026ab, 0x4bdee6d8, 0xee9f74a6,\n  0x9a6f10cf, 0x3f2e82b1, 0xd50042c2, 0x7041d0bc,\n  0xad060c8e, 0x08479ef0, 0xe2695e83, 0x4728ccfd,\n  0x33d8a894, 0x96993aea, 0x7cb7fa99, 0xd9f668e7,\n  0x9557324b, 0x3016a035, 0xda386046, 0x7f79f238,\n  0x0b899651, 0xaec8042f, 0x44e6c45c, 0xe1a75622,\n  0xdda47104, 0x78e5e37a, 0x92cb2309, 0x378ab177,\n  0x437ad51e, 0xe63b4760, 0x0c158713, 0xa954156d,\n  0xe5f54fc1, 0x40b4ddbf, 0xaa9a1dcc, 0x0fdb8fb2,\n  0x7b2bebdb, 0xde6a79a5, 0x3444b9d6, 0x91052ba8\n};\nstatic const uint32_t table3_[256] = {\n  0x00000000, 0xdd45aab8, 0xbf672381, 0x62228939,\n  0x7b2231f3, 0xa6679b4b, 0xc4451272, 0x1900b8ca,\n  0xf64463e6, 0x2b01c95e, 0x49234067, 0x9466eadf,\n  0x8d665215, 0x5023f8ad, 0x32017194, 0xef44db2c,\n  0xe964b13d, 0x34211b85, 0x560392bc, 0x8b463804,\n  0x924680ce, 0x4f032a76, 0x2d21a34f, 0xf06409f7,\n  0x1f20d2db, 0xc2657863, 0xa047f15a, 0x7d025be2,\n  0x6402e328, 0xb9474990, 0xdb65c0a9, 0x06206a11,\n  0xd725148b, 0x0a60be33, 0x6842370a, 0xb5079db2,\n  0xac072578, 0x71428fc0, 0x136006f9, 0xce25ac41,\n  0x2161776d, 0xfc24ddd5, 0x9e0654ec, 0x4343fe54,\n  0x5a43469e, 0x8706ec26, 0xe524651f, 0x3861cfa7,\n  0x3e41a5b6, 0xe3040f0e, 0x81268637, 0x5c632c8f,\n  0x45639445, 0x98263efd, 0xfa04b7c4, 0x27411d7c,\n  0xc805c650, 0x15406ce8, 0x7762e5d1, 0xaa274f69,\n  0xb327f7a3, 0x6e625d1b, 0x0c40d422, 0xd1057e9a,\n  0xaba65fe7, 0x76e3f55f, 0x14c17c66, 0xc984d6de,\n  0xd0846e14, 0x0dc1c4ac, 0x6fe34d95, 0xb2a6e72d,\n  0x5de23c01, 0x80a796b9, 0xe2851f80, 0x3fc0b538,\n  0x26c00df2, 0xfb85a74a, 0x99a72e73, 0x44e284cb,\n  0x42c2eeda, 0x9f874462, 0xfda5cd5b, 0x20e067e3,\n  0x39e0df29, 0xe4a57591, 0x8687fca8, 0x5bc25610,\n  0xb4868d3c, 0x69c32784, 0x0be1aebd, 0xd6a40405,\n  0xcfa4bccf, 0x12e11677, 0x70c39f4e, 0xad8635f6,\n  0x7c834b6c, 0xa1c6e1d4, 0xc3e468ed, 0x1ea1c255,\n  0x07a17a9f, 0xdae4d027, 0xb8c6591e, 0x6583f3a6,\n  0x8ac7288a, 0x57828232, 0x35a00b0b, 0xe8e5a1b3,\n  0xf1e51979, 0x2ca0b3c1, 0x4e823af8, 0x93c79040,\n  0x95e7fa51, 0x48a250e9, 0x2a80d9d0, 0xf7c57368,\n  0xeec5cba2, 0x3380611a, 0x51a2e823, 0x8ce7429b,\n  0x63a399b7, 0xbee6330f, 0xdcc4ba36, 0x0181108e,\n  0x1881a844, 0xc5c402fc, 0xa7e68bc5, 0x7aa3217d,\n  0x52a0c93f, 0x8fe56387, 0xedc7eabe, 0x30824006,\n  0x2982f8cc, 0xf4c75274, 0x96e5db4d, 0x4ba071f5,\n  0xa4e4aad9, 0x79a10061, 0x1b838958, 0xc6c623e0,\n  0xdfc69b2a, 0x02833192, 0x60a1b8ab, 0xbde41213,\n  0xbbc47802, 0x6681d2ba, 0x04a35b83, 0xd9e6f13b,\n  0xc0e649f1, 0x1da3e349, 0x7f816a70, 0xa2c4c0c8,\n  0x4d801be4, 0x90c5b15c, 0xf2e73865, 0x2fa292dd,\n  0x36a22a17, 0xebe780af, 0x89c50996, 0x5480a32e,\n  0x8585ddb4, 0x58c0770c, 0x3ae2fe35, 0xe7a7548d,\n  0xfea7ec47, 0x23e246ff, 0x41c0cfc6, 0x9c85657e,\n  0x73c1be52, 0xae8414ea, 0xcca69dd3, 0x11e3376b,\n  0x08e38fa1, 0xd5a62519, 0xb784ac20, 0x6ac10698,\n  0x6ce16c89, 0xb1a4c631, 0xd3864f08, 0x0ec3e5b0,\n  0x17c35d7a, 0xca86f7c2, 0xa8a47efb, 0x75e1d443,\n  0x9aa50f6f, 0x47e0a5d7, 0x25c22cee, 0xf8878656,\n  0xe1873e9c, 0x3cc29424, 0x5ee01d1d, 0x83a5b7a5,\n  0xf90696d8, 0x24433c60, 0x4661b559, 0x9b241fe1,\n  0x8224a72b, 0x5f610d93, 0x3d4384aa, 0xe0062e12,\n  0x0f42f53e, 0xd2075f86, 0xb025d6bf, 0x6d607c07,\n  0x7460c4cd, 0xa9256e75, 0xcb07e74c, 0x16424df4,\n  0x106227e5, 0xcd278d5d, 0xaf050464, 0x7240aedc,\n  0x6b401616, 0xb605bcae, 0xd4273597, 0x09629f2f,\n  0xe6264403, 0x3b63eebb, 0x59416782, 0x8404cd3a,\n  0x9d0475f0, 0x4041df48, 0x22635671, 0xff26fcc9,\n  0x2e238253, 0xf36628eb, 0x9144a1d2, 0x4c010b6a,\n  0x5501b3a0, 0x88441918, 0xea669021, 0x37233a99,\n  0xd867e1b5, 0x05224b0d, 0x6700c234, 0xba45688c,\n  0xa345d046, 0x7e007afe, 0x1c22f3c7, 0xc167597f,\n  0xc747336e, 0x1a0299d6, 0x782010ef, 0xa565ba57,\n  0xbc65029d, 0x6120a825, 0x0302211c, 0xde478ba4,\n  0x31035088, 0xec46fa30, 0x8e647309, 0x5321d9b1,\n  0x4a21617b, 0x9764cbc3, 0xf54642fa, 0x2803e842\n};\n\n// Used to fetch a naturally-aligned 32-bit word in little endian byte-order\nstatic inline uint32_t LE_LOAD32(const uint8_t *p) {\n  return DecodeFixed32(reinterpret_cast<const char*>(p));\n}\n\n// Determine if the CPU running this program can accelerate the CRC32C\n// calculation.\nstatic bool CanAccelerateCRC32C() {\n  if (!port::HasAcceleratedCRC32C())\n    return false;\n\n  // Double-check that the accelerated implementation functions correctly.\n  // port::AcceleretedCRC32C returns zero when unable to accelerate.\n  static const char kTestCRCBuffer[] = \"TestCRCBuffer\";\n  static const char kBufSize = sizeof(kTestCRCBuffer) - 1;\n  static const uint32_t kTestCRCValue = 0xdcbc59fa;\n\n  return port::AcceleratedCRC32C(0, kTestCRCBuffer, kBufSize) == kTestCRCValue;\n}\n\nuint32_t Extend(uint32_t crc, const char* buf, size_t size) {\n  static bool accelerate = CanAccelerateCRC32C();\n  if (accelerate) {\n    return port::AcceleratedCRC32C(crc, buf, size);\n  }\n\n  const uint8_t *p = reinterpret_cast<const uint8_t *>(buf);\n  const uint8_t *e = p + size;\n  uint32_t l = crc ^ 0xffffffffu;\n\n#define STEP1 do {                              \\\n    int c = (l & 0xff) ^ *p++;                  \\\n    l = table0_[c] ^ (l >> 8);                  \\\n} while (0)\n#define STEP4 do {                              \\\n    uint32_t c = l ^ LE_LOAD32(p);              \\\n    p += 4;                                     \\\n    l = table3_[c & 0xff] ^                     \\\n        table2_[(c >> 8) & 0xff] ^              \\\n        table1_[(c >> 16) & 0xff] ^             \\\n        table0_[c >> 24];                       \\\n} while (0)\n\n  // Point x at first 4-byte aligned byte in string.  This might be\n  // just past the end of the string.\n  const uintptr_t pval = reinterpret_cast<uintptr_t>(p);\n  const uint8_t* x = reinterpret_cast<const uint8_t*>(((pval + 3) >> 2) << 2);\n  if (x <= e) {\n    // Process bytes until finished or p is 4-byte aligned\n    while (p != x) {\n      STEP1;\n    }\n  }\n  // Process bytes 16 at a time\n  while ((e-p) >= 16) {\n    STEP4; STEP4; STEP4; STEP4;\n  }\n  // Process bytes 4 at a time\n  while ((e-p) >= 4) {\n    STEP4;\n  }\n  // Process the last few bytes\n  while (p != e) {\n    STEP1;\n  }\n#undef STEP4\n#undef STEP1\n  return l ^ 0xffffffffu;\n}\n\n}  // namespace crc32c\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/crc32c.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_UTIL_CRC32C_H_\n#define STORAGE_LEVELDB_UTIL_CRC32C_H_\n\n#include <stddef.h>\n#include <stdint.h>\n\nnamespace leveldb {\nnamespace crc32c {\n\n// Return the crc32c of concat(A, data[0,n-1]) where init_crc is the\n// crc32c of some string A.  Extend() is often used to maintain the\n// crc32c of a stream of data.\nextern uint32_t Extend(uint32_t init_crc, const char* data, size_t n);\n\n// Return the crc32c of data[0,n-1]\ninline uint32_t Value(const char* data, size_t n) {\n  return Extend(0, data, n);\n}\n\nstatic const uint32_t kMaskDelta = 0xa282ead8ul;\n\n// Return a masked representation of crc.\n//\n// Motivation: it is problematic to compute the CRC of a string that\n// contains embedded CRCs.  Therefore we recommend that CRCs stored\n// somewhere (e.g., in files) should be masked before being stored.\ninline uint32_t Mask(uint32_t crc) {\n  // Rotate right by 15 bits and add a constant.\n  return ((crc >> 15) | (crc << 17)) + kMaskDelta;\n}\n\n// Return the crc whose masked representation is masked_crc.\ninline uint32_t Unmask(uint32_t masked_crc) {\n  uint32_t rot = masked_crc - kMaskDelta;\n  return ((rot >> 17) | (rot << 15));\n}\n\n}  // namespace crc32c\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_UTIL_CRC32C_H_\n"
  },
  {
    "path": "src/leveldb/util/crc32c_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"util/crc32c.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\nnamespace crc32c {\n\nclass CRC { };\n\nTEST(CRC, StandardResults) {\n  // From rfc3720 section B.4.\n  char buf[32];\n\n  memset(buf, 0, sizeof(buf));\n  ASSERT_EQ(0x8a9136aa, Value(buf, sizeof(buf)));\n\n  memset(buf, 0xff, sizeof(buf));\n  ASSERT_EQ(0x62a8ab43, Value(buf, sizeof(buf)));\n\n  for (int i = 0; i < 32; i++) {\n    buf[i] = i;\n  }\n  ASSERT_EQ(0x46dd794e, Value(buf, sizeof(buf)));\n\n  for (int i = 0; i < 32; i++) {\n    buf[i] = 31 - i;\n  }\n  ASSERT_EQ(0x113fdb5c, Value(buf, sizeof(buf)));\n\n  unsigned char data[48] = {\n    0x01, 0xc0, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00,\n    0x14, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x04, 0x00,\n    0x00, 0x00, 0x00, 0x14,\n    0x00, 0x00, 0x00, 0x18,\n    0x28, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00,\n    0x02, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00,\n  };\n  ASSERT_EQ(0xd9963a56, Value(reinterpret_cast<char*>(data), sizeof(data)));\n}\n\nTEST(CRC, Values) {\n  ASSERT_NE(Value(\"a\", 1), Value(\"foo\", 3));\n}\n\nTEST(CRC, Extend) {\n  ASSERT_EQ(Value(\"hello world\", 11),\n            Extend(Value(\"hello \", 6), \"world\", 5));\n}\n\nTEST(CRC, Mask) {\n  uint32_t crc = Value(\"foo\", 3);\n  ASSERT_NE(crc, Mask(crc));\n  ASSERT_NE(crc, Mask(Mask(crc)));\n  ASSERT_EQ(crc, Unmask(Mask(crc)));\n  ASSERT_EQ(crc, Unmask(Unmask(Mask(Mask(crc)))));\n}\n\n}  // namespace crc32c\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/util/env.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/env.h\"\n\nnamespace leveldb {\n\nEnv::~Env() {\n}\n\nStatus Env::NewAppendableFile(const std::string& fname, WritableFile** result) {\n  return Status::NotSupported(\"NewAppendableFile\", fname);\n}\n\nSequentialFile::~SequentialFile() {\n}\n\nRandomAccessFile::~RandomAccessFile() {\n}\n\nWritableFile::~WritableFile() {\n}\n\nLogger::~Logger() {\n}\n\nFileLock::~FileLock() {\n}\n\nvoid Log(Logger* info_log, const char* format, ...) {\n  if (info_log != NULL) {\n    va_list ap;\n    va_start(ap, format);\n    info_log->Logv(format, ap);\n    va_end(ap);\n  }\n}\n\nstatic Status DoWriteStringToFile(Env* env, const Slice& data,\n                                  const std::string& fname,\n                                  bool should_sync) {\n  WritableFile* file;\n  Status s = env->NewWritableFile(fname, &file);\n  if (!s.ok()) {\n    return s;\n  }\n  s = file->Append(data);\n  if (s.ok() && should_sync) {\n    s = file->Sync();\n  }\n  if (s.ok()) {\n    s = file->Close();\n  }\n  delete file;  // Will auto-close if we did not close above\n  if (!s.ok()) {\n    env->DeleteFile(fname);\n  }\n  return s;\n}\n\nStatus WriteStringToFile(Env* env, const Slice& data,\n                         const std::string& fname) {\n  return DoWriteStringToFile(env, data, fname, false);\n}\n\nStatus WriteStringToFileSync(Env* env, const Slice& data,\n                             const std::string& fname) {\n  return DoWriteStringToFile(env, data, fname, true);\n}\n\nStatus ReadFileToString(Env* env, const std::string& fname, std::string* data) {\n  data->clear();\n  SequentialFile* file;\n  Status s = env->NewSequentialFile(fname, &file);\n  if (!s.ok()) {\n    return s;\n  }\n  static const int kBufferSize = 8192;\n  char* space = new char[kBufferSize];\n  while (true) {\n    Slice fragment;\n    s = file->Read(kBufferSize, &fragment, space);\n    if (!s.ok()) {\n      break;\n    }\n    data->append(fragment.data(), fragment.size());\n    if (fragment.empty()) {\n      break;\n    }\n  }\n  delete[] space;\n  delete file;\n  return s;\n}\n\nEnvWrapper::~EnvWrapper() {\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/env_posix.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n#if !defined(LEVELDB_PLATFORM_WINDOWS)\n\n#include <dirent.h>\n#include <errno.h>\n#include <fcntl.h>\n#include <pthread.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <sys/mman.h>\n#include <sys/resource.h>\n#include <sys/stat.h>\n#include <sys/time.h>\n#include <sys/types.h>\n#include <time.h>\n#include <unistd.h>\n#include <deque>\n#include <limits>\n#include <set>\n#include \"leveldb/env.h\"\n#include \"leveldb/slice.h\"\n#include \"port/port.h\"\n#include \"util/logging.h\"\n#include \"util/mutexlock.h\"\n#include \"util/posix_logger.h\"\n#include \"util/env_posix_test_helper.h\"\n\nnamespace leveldb {\n\nnamespace {\n\nstatic int open_read_only_file_limit = -1;\nstatic int mmap_limit = -1;\n\nstatic Status IOError(const std::string& context, int err_number) {\n  return Status::IOError(context, strerror(err_number));\n}\n\n// Helper class to limit resource usage to avoid exhaustion.\n// Currently used to limit read-only file descriptors and mmap file usage\n// so that we do not end up running out of file descriptors, virtual memory,\n// or running into kernel performance problems for very large databases.\nclass Limiter {\n public:\n  // Limit maximum number of resources to |n|.\n  Limiter(intptr_t n) {\n    SetAllowed(n);\n  }\n\n  // If another resource is available, acquire it and return true.\n  // Else return false.\n  bool Acquire() {\n    if (GetAllowed() <= 0) {\n      return false;\n    }\n    MutexLock l(&mu_);\n    intptr_t x = GetAllowed();\n    if (x <= 0) {\n      return false;\n    } else {\n      SetAllowed(x - 1);\n      return true;\n    }\n  }\n\n  // Release a resource acquired by a previous call to Acquire() that returned\n  // true.\n  void Release() {\n    MutexLock l(&mu_);\n    SetAllowed(GetAllowed() + 1);\n  }\n\n private:\n  port::Mutex mu_;\n  port::AtomicPointer allowed_;\n\n  intptr_t GetAllowed() const {\n    return reinterpret_cast<intptr_t>(allowed_.Acquire_Load());\n  }\n\n  // REQUIRES: mu_ must be held\n  void SetAllowed(intptr_t v) {\n    allowed_.Release_Store(reinterpret_cast<void*>(v));\n  }\n\n  Limiter(const Limiter&);\n  void operator=(const Limiter&);\n};\n\nclass PosixSequentialFile: public SequentialFile {\n private:\n  std::string filename_;\n  FILE* file_;\n\n public:\n  PosixSequentialFile(const std::string& fname, FILE* f)\n      : filename_(fname), file_(f) { }\n  virtual ~PosixSequentialFile() { fclose(file_); }\n\n  virtual Status Read(size_t n, Slice* result, char* scratch) {\n    Status s;\n    size_t r = fread_unlocked(scratch, 1, n, file_);\n    *result = Slice(scratch, r);\n    if (r < n) {\n      if (feof(file_)) {\n        // We leave status as ok if we hit the end of the file\n      } else {\n        // A partial read with an error: return a non-ok status\n        s = IOError(filename_, errno);\n      }\n    }\n    return s;\n  }\n\n  virtual Status Skip(uint64_t n) {\n    if (fseek(file_, n, SEEK_CUR)) {\n      return IOError(filename_, errno);\n    }\n    return Status::OK();\n  }\n\n  virtual std::string GetName() const { return filename_; }\n};\n\n// pread() based random-access\nclass PosixRandomAccessFile: public RandomAccessFile {\n private:\n  std::string filename_;\n  bool temporary_fd_;  // If true, fd_ is -1 and we open on every read.\n  int fd_;\n  Limiter* limiter_;\n\n public:\n  PosixRandomAccessFile(const std::string& fname, int fd, Limiter* limiter)\n      : filename_(fname), fd_(fd), limiter_(limiter) {\n    temporary_fd_ = !limiter->Acquire();\n    if (temporary_fd_) {\n      // Open file on every access.\n      close(fd_);\n      fd_ = -1;\n    }\n  }\n\n  virtual ~PosixRandomAccessFile() {\n    if (!temporary_fd_) {\n      close(fd_);\n      limiter_->Release();\n    }\n  }\n\n  virtual Status Read(uint64_t offset, size_t n, Slice* result,\n                      char* scratch) const {\n    int fd = fd_;\n    if (temporary_fd_) {\n      fd = open(filename_.c_str(), O_RDONLY);\n      if (fd < 0) {\n        return IOError(filename_, errno);\n      }\n    }\n\n    Status s;\n    ssize_t r = pread(fd, scratch, n, static_cast<off_t>(offset));\n    *result = Slice(scratch, (r < 0) ? 0 : r);\n    if (r < 0) {\n      // An error: return a non-ok status\n      s = IOError(filename_, errno);\n    }\n    if (temporary_fd_) {\n      // Close the temporary file descriptor opened earlier.\n      close(fd);\n    }\n    return s;\n  }\n\n  virtual std::string GetName() const { return filename_; }\n};\n\n// mmap() based random-access\nclass PosixMmapReadableFile: public RandomAccessFile {\n private:\n  std::string filename_;\n  void* mmapped_region_;\n  size_t length_;\n  Limiter* limiter_;\n\n public:\n  // base[0,length-1] contains the mmapped contents of the file.\n  PosixMmapReadableFile(const std::string& fname, void* base, size_t length,\n                        Limiter* limiter)\n      : filename_(fname), mmapped_region_(base), length_(length),\n        limiter_(limiter) {\n  }\n\n  virtual ~PosixMmapReadableFile() {\n    munmap(mmapped_region_, length_);\n    limiter_->Release();\n  }\n\n  virtual Status Read(uint64_t offset, size_t n, Slice* result,\n                      char* scratch) const {\n    Status s;\n    if (offset + n > length_) {\n      *result = Slice();\n      s = IOError(filename_, EINVAL);\n    } else {\n      *result = Slice(reinterpret_cast<char*>(mmapped_region_) + offset, n);\n    }\n    return s;\n  }\n\n  virtual std::string GetName() const { return filename_; }\n};\n\nclass PosixWritableFile : public WritableFile {\n private:\n  std::string filename_;\n  FILE* file_;\n\n public:\n  PosixWritableFile(const std::string& fname, FILE* f)\n      : filename_(fname), file_(f) { }\n\n  ~PosixWritableFile() {\n    if (file_ != NULL) {\n      // Ignoring any potential errors\n      fclose(file_);\n    }\n  }\n\n  virtual Status Append(const Slice& data) {\n    size_t r = fwrite_unlocked(data.data(), 1, data.size(), file_);\n    if (r != data.size()) {\n      return IOError(filename_, errno);\n    }\n    return Status::OK();\n  }\n\n  virtual Status Close() {\n    Status result;\n    if (fclose(file_) != 0) {\n      result = IOError(filename_, errno);\n    }\n    file_ = NULL;\n    return result;\n  }\n\n  virtual Status Flush() {\n    if (fflush_unlocked(file_) != 0) {\n      return IOError(filename_, errno);\n    }\n    return Status::OK();\n  }\n\n  Status SyncDirIfManifest() {\n    const char* f = filename_.c_str();\n    const char* sep = strrchr(f, '/');\n    Slice basename;\n    std::string dir;\n    if (sep == NULL) {\n      dir = \".\";\n      basename = f;\n    } else {\n      dir = std::string(f, sep - f);\n      basename = sep + 1;\n    }\n    Status s;\n    if (basename.starts_with(\"MANIFEST\")) {\n      int fd = open(dir.c_str(), O_RDONLY);\n      if (fd < 0) {\n        s = IOError(dir, errno);\n      } else {\n        if (fsync(fd) < 0 && errno != EINVAL) {\n          s = IOError(dir, errno);\n        }\n        close(fd);\n      }\n    }\n    return s;\n  }\n\n  virtual Status Sync() {\n    // Ensure new files referred to by the manifest are in the filesystem.\n    Status s = SyncDirIfManifest();\n    if (!s.ok()) {\n      return s;\n    }\n    if (fflush_unlocked(file_) != 0 ||\n        fdatasync(fileno(file_)) != 0) {\n      s = Status::IOError(filename_, strerror(errno));\n    }\n    return s;\n  }\n\n  virtual std::string GetName() const { return filename_; }\n};\n\nstatic int LockOrUnlock(int fd, bool lock) {\n  errno = 0;\n  struct flock f;\n  memset(&f, 0, sizeof(f));\n  f.l_type = (lock ? F_WRLCK : F_UNLCK);\n  f.l_whence = SEEK_SET;\n  f.l_start = 0;\n  f.l_len = 0;        // Lock/unlock entire file\n  return fcntl(fd, F_SETLK, &f);\n}\n\nclass PosixFileLock : public FileLock {\n public:\n  int fd_;\n  std::string name_;\n};\n\n// Set of locked files.  We keep a separate set instead of just\n// relying on fcntrl(F_SETLK) since fcntl(F_SETLK) does not provide\n// any protection against multiple uses from the same process.\nclass PosixLockTable {\n private:\n  port::Mutex mu_;\n  std::set<std::string> locked_files_;\n public:\n  bool Insert(const std::string& fname) {\n    MutexLock l(&mu_);\n    return locked_files_.insert(fname).second;\n  }\n  void Remove(const std::string& fname) {\n    MutexLock l(&mu_);\n    locked_files_.erase(fname);\n  }\n};\n\nclass PosixEnv : public Env {\n public:\n  PosixEnv();\n  virtual ~PosixEnv() {\n    char msg[] = \"Destroying Env::Default()\\n\";\n    fwrite(msg, 1, sizeof(msg), stderr);\n    abort();\n  }\n\n  virtual Status NewSequentialFile(const std::string& fname,\n                                   SequentialFile** result) {\n    FILE* f = fopen(fname.c_str(), \"r\");\n    if (f == NULL) {\n      *result = NULL;\n      return IOError(fname, errno);\n    } else {\n      *result = new PosixSequentialFile(fname, f);\n      return Status::OK();\n    }\n  }\n\n  virtual Status NewRandomAccessFile(const std::string& fname,\n                                     RandomAccessFile** result) {\n    *result = NULL;\n    Status s;\n    int fd = open(fname.c_str(), O_RDONLY);\n    if (fd < 0) {\n      s = IOError(fname, errno);\n    } else if (mmap_limit_.Acquire()) {\n      uint64_t size;\n      s = GetFileSize(fname, &size);\n      if (s.ok()) {\n        void* base = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);\n        if (base != MAP_FAILED) {\n          *result = new PosixMmapReadableFile(fname, base, size, &mmap_limit_);\n        } else {\n          s = IOError(fname, errno);\n        }\n      }\n      close(fd);\n      if (!s.ok()) {\n        mmap_limit_.Release();\n      }\n    } else {\n      *result = new PosixRandomAccessFile(fname, fd, &fd_limit_);\n    }\n    return s;\n  }\n\n  virtual Status NewWritableFile(const std::string& fname,\n                                 WritableFile** result) {\n    Status s;\n    FILE* f = fopen(fname.c_str(), \"w\");\n    if (f == NULL) {\n      *result = NULL;\n      s = IOError(fname, errno);\n    } else {\n      *result = new PosixWritableFile(fname, f);\n    }\n    return s;\n  }\n\n  virtual Status NewAppendableFile(const std::string& fname,\n                                   WritableFile** result) {\n    Status s;\n    FILE* f = fopen(fname.c_str(), \"a\");\n    if (f == NULL) {\n      *result = NULL;\n      s = IOError(fname, errno);\n    } else {\n      *result = new PosixWritableFile(fname, f);\n    }\n    return s;\n  }\n\n  virtual bool FileExists(const std::string& fname) {\n    return access(fname.c_str(), F_OK) == 0;\n  }\n\n  virtual Status GetChildren(const std::string& dir,\n                             std::vector<std::string>* result) {\n    result->clear();\n    DIR* d = opendir(dir.c_str());\n    if (d == NULL) {\n      return IOError(dir, errno);\n    }\n    struct dirent* entry;\n    while ((entry = readdir(d)) != NULL) {\n      result->push_back(entry->d_name);\n    }\n    closedir(d);\n    return Status::OK();\n  }\n\n  virtual Status DeleteFile(const std::string& fname) {\n    Status result;\n    if (unlink(fname.c_str()) != 0) {\n      result = IOError(fname, errno);\n    }\n    return result;\n  }\n\n  virtual Status CreateDir(const std::string& name) {\n    Status result;\n    if (mkdir(name.c_str(), 0755) != 0) {\n      result = IOError(name, errno);\n    }\n    return result;\n  }\n\n  virtual Status DeleteDir(const std::string& name) {\n    Status result;\n    if (rmdir(name.c_str()) != 0) {\n      result = IOError(name, errno);\n    }\n    return result;\n  }\n\n  virtual Status GetFileSize(const std::string& fname, uint64_t* size) {\n    Status s;\n    struct stat sbuf;\n    if (stat(fname.c_str(), &sbuf) != 0) {\n      *size = 0;\n      s = IOError(fname, errno);\n    } else {\n      *size = sbuf.st_size;\n    }\n    return s;\n  }\n\n  virtual Status RenameFile(const std::string& src, const std::string& target) {\n    Status result;\n    if (rename(src.c_str(), target.c_str()) != 0) {\n      result = IOError(src, errno);\n    }\n    return result;\n  }\n\n  virtual Status LockFile(const std::string& fname, FileLock** lock) {\n    *lock = NULL;\n    Status result;\n    int fd = open(fname.c_str(), O_RDWR | O_CREAT, 0644);\n    if (fd < 0) {\n      result = IOError(fname, errno);\n    } else if (!locks_.Insert(fname)) {\n      close(fd);\n      result = Status::IOError(\"lock \" + fname, \"already held by process\");\n    } else if (LockOrUnlock(fd, true) == -1) {\n      result = IOError(\"lock \" + fname, errno);\n      close(fd);\n      locks_.Remove(fname);\n    } else {\n      PosixFileLock* my_lock = new PosixFileLock;\n      my_lock->fd_ = fd;\n      my_lock->name_ = fname;\n      *lock = my_lock;\n    }\n    return result;\n  }\n\n  virtual Status UnlockFile(FileLock* lock) {\n    PosixFileLock* my_lock = reinterpret_cast<PosixFileLock*>(lock);\n    Status result;\n    if (LockOrUnlock(my_lock->fd_, false) == -1) {\n      result = IOError(\"unlock\", errno);\n    }\n    locks_.Remove(my_lock->name_);\n    close(my_lock->fd_);\n    delete my_lock;\n    return result;\n  }\n\n  virtual void Schedule(void (*function)(void*), void* arg);\n\n  virtual void StartThread(void (*function)(void* arg), void* arg);\n\n  virtual Status GetTestDirectory(std::string* result) {\n    const char* env = getenv(\"TEST_TMPDIR\");\n    if (env && env[0] != '\\0') {\n      *result = env;\n    } else {\n      char buf[100];\n      snprintf(buf, sizeof(buf), \"/tmp/leveldbtest-%d\", int(geteuid()));\n      *result = buf;\n    }\n    // Directory may already exist\n    CreateDir(*result);\n    return Status::OK();\n  }\n\n  static uint64_t gettid() {\n    pthread_t tid = pthread_self();\n    uint64_t thread_id = 0;\n    memcpy(&thread_id, &tid, std::min(sizeof(thread_id), sizeof(tid)));\n    return thread_id;\n  }\n\n  virtual Status NewLogger(const std::string& fname, Logger** result) {\n    FILE* f = fopen(fname.c_str(), \"w\");\n    if (f == NULL) {\n      *result = NULL;\n      return IOError(fname, errno);\n    } else {\n      *result = new PosixLogger(f, &PosixEnv::gettid);\n      return Status::OK();\n    }\n  }\n\n  virtual uint64_t NowMicros() {\n    struct timeval tv;\n    gettimeofday(&tv, NULL);\n    return static_cast<uint64_t>(tv.tv_sec) * 1000000 + tv.tv_usec;\n  }\n\n  virtual void SleepForMicroseconds(int micros) {\n    usleep(micros);\n  }\n\n private:\n  void PthreadCall(const char* label, int result) {\n    if (result != 0) {\n      fprintf(stderr, \"pthread %s: %s\\n\", label, strerror(result));\n      abort();\n    }\n  }\n\n  // BGThread() is the body of the background thread\n  void BGThread();\n  static void* BGThreadWrapper(void* arg) {\n    reinterpret_cast<PosixEnv*>(arg)->BGThread();\n    return NULL;\n  }\n\n  pthread_mutex_t mu_;\n  pthread_cond_t bgsignal_;\n  pthread_t bgthread_;\n  bool started_bgthread_;\n\n  // Entry per Schedule() call\n  struct BGItem { void* arg; void (*function)(void*); };\n  typedef std::deque<BGItem> BGQueue;\n  BGQueue queue_;\n\n  PosixLockTable locks_;\n  Limiter mmap_limit_;\n  Limiter fd_limit_;\n};\n\n// Return the maximum number of concurrent mmaps.\nstatic int MaxMmaps() {\n  if (mmap_limit >= 0) {\n    return mmap_limit;\n  }\n  // Up to 1000 mmaps for 64-bit binaries; none for smaller pointer sizes.\n  mmap_limit = sizeof(void*) >= 8 ? 1000 : 0;\n  return mmap_limit;\n}\n\n// Return the maximum number of read-only files to keep open.\nstatic intptr_t MaxOpenFiles() {\n  if (open_read_only_file_limit >= 0) {\n    return open_read_only_file_limit;\n  }\n  struct rlimit rlim;\n  if (getrlimit(RLIMIT_NOFILE, &rlim)) {\n    // getrlimit failed, fallback to hard-coded default.\n    open_read_only_file_limit = 50;\n  } else if (rlim.rlim_cur == RLIM_INFINITY) {\n    open_read_only_file_limit = std::numeric_limits<int>::max();\n  } else {\n    // Allow use of 20% of available file descriptors for read-only files.\n    open_read_only_file_limit = rlim.rlim_cur / 5;\n  }\n  return open_read_only_file_limit;\n}\n\nPosixEnv::PosixEnv()\n    : started_bgthread_(false),\n      mmap_limit_(MaxMmaps()),\n      fd_limit_(MaxOpenFiles()) {\n  PthreadCall(\"mutex_init\", pthread_mutex_init(&mu_, NULL));\n  PthreadCall(\"cvar_init\", pthread_cond_init(&bgsignal_, NULL));\n}\n\nvoid PosixEnv::Schedule(void (*function)(void*), void* arg) {\n  PthreadCall(\"lock\", pthread_mutex_lock(&mu_));\n\n  // Start background thread if necessary\n  if (!started_bgthread_) {\n    started_bgthread_ = true;\n    PthreadCall(\n        \"create thread\",\n        pthread_create(&bgthread_, NULL,  &PosixEnv::BGThreadWrapper, this));\n  }\n\n  // If the queue is currently empty, the background thread may currently be\n  // waiting.\n  if (queue_.empty()) {\n    PthreadCall(\"signal\", pthread_cond_signal(&bgsignal_));\n  }\n\n  // Add to priority queue\n  queue_.push_back(BGItem());\n  queue_.back().function = function;\n  queue_.back().arg = arg;\n\n  PthreadCall(\"unlock\", pthread_mutex_unlock(&mu_));\n}\n\nvoid PosixEnv::BGThread() {\n  while (true) {\n    // Wait until there is an item that is ready to run\n    PthreadCall(\"lock\", pthread_mutex_lock(&mu_));\n    while (queue_.empty()) {\n      PthreadCall(\"wait\", pthread_cond_wait(&bgsignal_, &mu_));\n    }\n\n    void (*function)(void*) = queue_.front().function;\n    void* arg = queue_.front().arg;\n    queue_.pop_front();\n\n    PthreadCall(\"unlock\", pthread_mutex_unlock(&mu_));\n    (*function)(arg);\n  }\n}\n\nnamespace {\nstruct StartThreadState {\n  void (*user_function)(void*);\n  void* arg;\n};\n}\nstatic void* StartThreadWrapper(void* arg) {\n  StartThreadState* state = reinterpret_cast<StartThreadState*>(arg);\n  state->user_function(state->arg);\n  delete state;\n  return NULL;\n}\n\nvoid PosixEnv::StartThread(void (*function)(void* arg), void* arg) {\n  pthread_t t;\n  StartThreadState* state = new StartThreadState;\n  state->user_function = function;\n  state->arg = arg;\n  PthreadCall(\"start thread\",\n              pthread_create(&t, NULL,  &StartThreadWrapper, state));\n}\n\n}  // namespace\n\nstatic pthread_once_t once = PTHREAD_ONCE_INIT;\nstatic Env* default_env;\nstatic void InitDefaultEnv() { default_env = new PosixEnv; }\n\nvoid EnvPosixTestHelper::SetReadOnlyFDLimit(int limit) {\n  assert(default_env == NULL);\n  open_read_only_file_limit = limit;\n}\n\nvoid EnvPosixTestHelper::SetReadOnlyMMapLimit(int limit) {\n  assert(default_env == NULL);\n  mmap_limit = limit;\n}\n\nEnv* Env::Default() {\n  pthread_once(&once, InitDefaultEnv);\n  return default_env;\n}\n\n}  // namespace leveldb\n\n#endif\n"
  },
  {
    "path": "src/leveldb/util/env_posix_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/env.h\"\n\n#include \"port/port.h\"\n#include \"util/testharness.h\"\n#include \"util/env_posix_test_helper.h\"\n\nnamespace leveldb {\n\nstatic const int kDelayMicros = 100000;\nstatic const int kReadOnlyFileLimit = 4;\nstatic const int kMMapLimit = 4;\n\nclass EnvPosixTest {\n public:\n  Env* env_;\n  EnvPosixTest() : env_(Env::Default()) { }\n\n  static void SetFileLimits(int read_only_file_limit, int mmap_limit) {\n    EnvPosixTestHelper::SetReadOnlyFDLimit(read_only_file_limit);\n    EnvPosixTestHelper::SetReadOnlyMMapLimit(mmap_limit);\n  }\n};\n\nTEST(EnvPosixTest, TestOpenOnRead) {\n  // Write some test data to a single file that will be opened |n| times.\n  std::string test_dir;\n  ASSERT_OK(env_->GetTestDirectory(&test_dir));\n  std::string test_file = test_dir + \"/open_on_read.txt\";\n\n  FILE* f = fopen(test_file.c_str(), \"w\");\n  ASSERT_TRUE(f != NULL);\n  const char kFileData[] = \"abcdefghijklmnopqrstuvwxyz\";\n  fputs(kFileData, f);\n  fclose(f);\n\n  // Open test file some number above the sum of the two limits to force\n  // open-on-read behavior of POSIX Env leveldb::RandomAccessFile.\n  const int kNumFiles = kReadOnlyFileLimit + kMMapLimit + 5;\n  leveldb::RandomAccessFile* files[kNumFiles] = {0};\n  for (int i = 0; i < kNumFiles; i++) {\n    ASSERT_OK(env_->NewRandomAccessFile(test_file, &files[i]));\n  }\n  char scratch;\n  Slice read_result;\n  for (int i = 0; i < kNumFiles; i++) {\n    ASSERT_OK(files[i]->Read(i, 1, &read_result, &scratch));\n    ASSERT_EQ(kFileData[i], read_result[0]);\n  }\n  for (int i = 0; i < kNumFiles; i++) {\n    delete files[i];\n  }\n  ASSERT_OK(env_->DeleteFile(test_file));\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  // All tests currently run with the same read-only file limits.\n  leveldb::EnvPosixTest::SetFileLimits(leveldb::kReadOnlyFileLimit,\n                                       leveldb::kMMapLimit);\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/util/env_posix_test_helper.h",
    "content": "// Copyright 2017 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_\n#define STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_\n\nnamespace leveldb {\n\nclass EnvPosixTest;\n\n// A helper for the POSIX Env to facilitate testing.\nclass EnvPosixTestHelper {\n private:\n  friend class EnvPosixTest;\n\n  // Set the maximum number of read-only files that will be opened.\n  // Must be called before creating an Env.\n  static void SetReadOnlyFDLimit(int limit);\n\n  // Set the maximum number of read-only files that will be mapped via mmap.\n  // Must be called before creating an Env.\n  static void SetReadOnlyMMapLimit(int limit);\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_UTIL_ENV_POSIX_TEST_HELPER_H_\n"
  },
  {
    "path": "src/leveldb/util/env_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/env.h\"\n\n#include \"port/port.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\nstatic const int kDelayMicros = 100000;\nstatic const int kReadOnlyFileLimit = 4;\nstatic const int kMMapLimit = 4;\n\nclass EnvTest {\n private:\n  port::Mutex mu_;\n  std::string events_;\n\n public:\n  Env* env_;\n  EnvTest() : env_(Env::Default()) { }\n};\n\nstatic void SetBool(void* ptr) {\n  reinterpret_cast<port::AtomicPointer*>(ptr)->NoBarrier_Store(ptr);\n}\n\nTEST(EnvTest, RunImmediately) {\n  port::AtomicPointer called (NULL);\n  env_->Schedule(&SetBool, &called);\n  env_->SleepForMicroseconds(kDelayMicros);\n  ASSERT_TRUE(called.NoBarrier_Load() != NULL);\n}\n\nTEST(EnvTest, RunMany) {\n  port::AtomicPointer last_id (NULL);\n\n  struct CB {\n    port::AtomicPointer* last_id_ptr;   // Pointer to shared slot\n    uintptr_t id;             // Order# for the execution of this callback\n\n    CB(port::AtomicPointer* p, int i) : last_id_ptr(p), id(i) { }\n\n    static void Run(void* v) {\n      CB* cb = reinterpret_cast<CB*>(v);\n      void* cur = cb->last_id_ptr->NoBarrier_Load();\n      ASSERT_EQ(cb->id-1, reinterpret_cast<uintptr_t>(cur));\n      cb->last_id_ptr->Release_Store(reinterpret_cast<void*>(cb->id));\n    }\n  };\n\n  // Schedule in different order than start time\n  CB cb1(&last_id, 1);\n  CB cb2(&last_id, 2);\n  CB cb3(&last_id, 3);\n  CB cb4(&last_id, 4);\n  env_->Schedule(&CB::Run, &cb1);\n  env_->Schedule(&CB::Run, &cb2);\n  env_->Schedule(&CB::Run, &cb3);\n  env_->Schedule(&CB::Run, &cb4);\n\n  env_->SleepForMicroseconds(kDelayMicros);\n  void* cur = last_id.Acquire_Load();\n  ASSERT_EQ(4, reinterpret_cast<uintptr_t>(cur));\n}\n\nstruct State {\n  port::Mutex mu;\n  int val;\n  int num_running;\n};\n\nstatic void ThreadBody(void* arg) {\n  State* s = reinterpret_cast<State*>(arg);\n  s->mu.Lock();\n  s->val += 1;\n  s->num_running -= 1;\n  s->mu.Unlock();\n}\n\nTEST(EnvTest, StartThread) {\n  State state;\n  state.val = 0;\n  state.num_running = 3;\n  for (int i = 0; i < 3; i++) {\n    env_->StartThread(&ThreadBody, &state);\n  }\n  while (true) {\n    state.mu.Lock();\n    int num = state.num_running;\n    state.mu.Unlock();\n    if (num == 0) {\n      break;\n    }\n    env_->SleepForMicroseconds(kDelayMicros);\n  }\n  ASSERT_EQ(state.val, 3);\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/util/env_win.cc",
    "content": "// This file contains source that originates from:\n// http://code.google.com/p/leveldbwin/source/browse/trunk/win32_impl_src/env_win32.h\n// http://code.google.com/p/leveldbwin/source/browse/trunk/win32_impl_src/port_win32.cc\n// Those files don't have any explicit license headers but the \n// project (http://code.google.com/p/leveldbwin/) lists the 'New BSD License'\n// as the license.\n#if defined(LEVELDB_PLATFORM_WINDOWS)\n#include <map>\n\n\n#include \"leveldb/env.h\"\n\n#include \"port/port.h\"\n#include \"leveldb/slice.h\"\n#include \"util/logging.h\"\n\n#include <shlwapi.h>\n#include <process.h>\n#include <cstring>\n#include <stdio.h>\n#include <errno.h>\n#include <io.h>\n#include <algorithm>\n\n#ifdef max\n#undef max\n#endif\n\n#ifndef va_copy\n#define va_copy(d,s) ((d) = (s))\n#endif\n\n#if defined DeleteFile\n#undef DeleteFile\n#endif\n\n//Declarations\nnamespace leveldb\n{\n\nnamespace Win32\n{\n\n#define DISALLOW_COPY_AND_ASSIGN(TypeName) \\\n  TypeName(const TypeName&);               \\\n  void operator=(const TypeName&)\n\nstd::string GetCurrentDir();\nstd::wstring GetCurrentDirW();\n\nstatic const std::string CurrentDir = GetCurrentDir();\nstatic const std::wstring CurrentDirW = GetCurrentDirW();\n\nstd::string& ModifyPath(std::string& path);\nstd::wstring& ModifyPath(std::wstring& path);\n\nstd::string GetLastErrSz();\nstd::wstring GetLastErrSzW();\n\nsize_t GetPageSize();\n\ntypedef void (*ScheduleProc)(void*) ;\n\nstruct WorkItemWrapper\n{\n    WorkItemWrapper(ScheduleProc proc_,void* content_);\n    ScheduleProc proc;\n    void* pContent;\n};\n\nDWORD WINAPI WorkItemWrapperProc(LPVOID pContent);\n\nclass Win32SequentialFile : public SequentialFile\n{\npublic:\n    friend class Win32Env;\n    virtual ~Win32SequentialFile();\n    virtual Status Read(size_t n, Slice* result, char* scratch);\n    virtual Status Skip(uint64_t n);\n    BOOL isEnable();\n    virtual std::string GetName() const { return _filename; }\nprivate:\n    BOOL _Init();\n    void _CleanUp();\n    Win32SequentialFile(const std::string& fname);\n    std::string _filename;\n    ::HANDLE _hFile;\n    DISALLOW_COPY_AND_ASSIGN(Win32SequentialFile);\n};\n\nclass Win32RandomAccessFile : public RandomAccessFile\n{\npublic:\n    friend class Win32Env;\n    virtual ~Win32RandomAccessFile();\n    virtual Status Read(uint64_t offset, size_t n, Slice* result,char* scratch) const;\n    BOOL isEnable();\n    virtual std::string GetName() const { return _filename; }\nprivate:\n    BOOL _Init(LPCWSTR path);\n    void _CleanUp();\n    Win32RandomAccessFile(const std::string& fname);\n    HANDLE _hFile;\n    const std::string _filename;\n    DISALLOW_COPY_AND_ASSIGN(Win32RandomAccessFile);\n};\n\nclass Win32WritableFile : public WritableFile\n{\npublic:\n    Win32WritableFile(const std::string& fname, bool append);\n    ~Win32WritableFile();\n\n    virtual Status Append(const Slice& data);\n    virtual Status Close();\n    virtual Status Flush();\n    virtual Status Sync();\n    BOOL isEnable();\n    virtual std::string GetName() const { return filename_; }\nprivate:\n    std::string filename_;\n    ::HANDLE _hFile;\n};\n\nclass Win32FileLock : public FileLock\n{\npublic:\n    friend class Win32Env;\n    virtual ~Win32FileLock();\n    BOOL isEnable();\nprivate:\n    BOOL _Init(LPCWSTR path);\n    void _CleanUp();\n    Win32FileLock(const std::string& fname);\n    HANDLE _hFile;\n    std::string _filename;\n    DISALLOW_COPY_AND_ASSIGN(Win32FileLock);\n};\n\nclass Win32Logger : public Logger\n{\npublic: \n    friend class Win32Env;\n    virtual ~Win32Logger();\n    virtual void Logv(const char* format, va_list ap);\nprivate:\n    explicit Win32Logger(WritableFile* pFile);\n    WritableFile* _pFileProxy;\n    DISALLOW_COPY_AND_ASSIGN(Win32Logger);\n};\n\nclass Win32Env : public Env\n{\npublic:\n    Win32Env();\n    virtual ~Win32Env();\n    virtual Status NewSequentialFile(const std::string& fname,\n        SequentialFile** result);\n\n    virtual Status NewRandomAccessFile(const std::string& fname,\n        RandomAccessFile** result);\n    virtual Status NewWritableFile(const std::string& fname,\n        WritableFile** result);\n    virtual Status NewAppendableFile(const std::string& fname,\n        WritableFile** result);\n\n    virtual bool FileExists(const std::string& fname);\n\n    virtual Status GetChildren(const std::string& dir,\n        std::vector<std::string>* result);\n\n    virtual Status DeleteFile(const std::string& fname);\n\n    virtual Status CreateDir(const std::string& dirname);\n\n    virtual Status DeleteDir(const std::string& dirname);\n\n    virtual Status GetFileSize(const std::string& fname, uint64_t* file_size);\n\n    virtual Status RenameFile(const std::string& src,\n        const std::string& target);\n\n    virtual Status LockFile(const std::string& fname, FileLock** lock);\n\n    virtual Status UnlockFile(FileLock* lock);\n\n    virtual void Schedule(\n        void (*function)(void* arg),\n        void* arg);\n\n    virtual void StartThread(void (*function)(void* arg), void* arg);\n\n    virtual Status GetTestDirectory(std::string* path);\n\n    //virtual void Logv(WritableFile* log, const char* format, va_list ap);\n\n    virtual Status NewLogger(const std::string& fname, Logger** result);\n\n    virtual uint64_t NowMicros();\n\n    virtual void SleepForMicroseconds(int micros);\n};\n\nvoid ToWidePath(const std::string& value, std::wstring& target) {\n\twchar_t buffer[MAX_PATH];\n\tMultiByteToWideChar(CP_ACP, 0, value.c_str(), -1, buffer, MAX_PATH);\n\ttarget = buffer;\n}\n\nvoid ToNarrowPath(const std::wstring& value, std::string& target) {\n\tchar buffer[MAX_PATH];\n\tWideCharToMultiByte(CP_ACP, 0, value.c_str(), -1, buffer, MAX_PATH, NULL, NULL);\n\ttarget = buffer;\n}\n\nstd::string GetCurrentDir()\n{\n    CHAR path[MAX_PATH];\n    ::GetModuleFileNameA(::GetModuleHandleA(NULL),path,MAX_PATH);\n    *strrchr(path,'\\\\') = 0;\n    return std::string(path);\n}\n\nstd::wstring GetCurrentDirW()\n{\n    WCHAR path[MAX_PATH];\n    ::GetModuleFileNameW(::GetModuleHandleW(NULL),path,MAX_PATH);\n    *wcsrchr(path,L'\\\\') = 0;\n    return std::wstring(path);\n}\n\nstd::string& ModifyPath(std::string& path)\n{\n    if(path[0] == '/' || path[0] == '\\\\'){\n        path = CurrentDir + path;\n    }\n    std::replace(path.begin(),path.end(),'/','\\\\');\n\n    return path;\n}\n\nstd::wstring& ModifyPath(std::wstring& path)\n{\n    if(path[0] == L'/' || path[0] == L'\\\\'){\n        path = CurrentDirW + path;\n    }\n    std::replace(path.begin(),path.end(),L'/',L'\\\\');\n    return path;\n}\n\nstd::string GetLastErrSz()\n{\n    LPWSTR lpMsgBuf;\n    FormatMessageW( \n        FORMAT_MESSAGE_ALLOCATE_BUFFER | \n        FORMAT_MESSAGE_FROM_SYSTEM | \n        FORMAT_MESSAGE_IGNORE_INSERTS,\n        NULL,\n        GetLastError(),\n        0, // Default language\n        (LPWSTR) &lpMsgBuf,\n        0,\n        NULL \n        );\n    std::string Err;\n\tToNarrowPath(lpMsgBuf, Err); \n    LocalFree( lpMsgBuf );\n    return Err;\n}\n\nstd::wstring GetLastErrSzW()\n{\n    LPVOID lpMsgBuf;\n    FormatMessageW( \n        FORMAT_MESSAGE_ALLOCATE_BUFFER | \n        FORMAT_MESSAGE_FROM_SYSTEM | \n        FORMAT_MESSAGE_IGNORE_INSERTS,\n        NULL,\n        GetLastError(),\n        0, // Default language\n        (LPWSTR) &lpMsgBuf,\n        0,\n        NULL \n        );\n    std::wstring Err = (LPCWSTR)lpMsgBuf;\n    LocalFree(lpMsgBuf);\n    return Err;\n}\n\nWorkItemWrapper::WorkItemWrapper( ScheduleProc proc_,void* content_ ) :\n    proc(proc_),pContent(content_)\n{\n\n}\n\nDWORD WINAPI WorkItemWrapperProc(LPVOID pContent)\n{\n    WorkItemWrapper* item = static_cast<WorkItemWrapper*>(pContent);\n    ScheduleProc TempProc = item->proc;\n    void* arg = item->pContent;\n    delete item;\n    TempProc(arg);\n    return 0;\n}\n\nsize_t GetPageSize()\n{\n    SYSTEM_INFO si;\n    GetSystemInfo(&si);\n    return std::max(si.dwPageSize,si.dwAllocationGranularity);\n}\n\nconst size_t g_PageSize = GetPageSize();\n\n\nWin32SequentialFile::Win32SequentialFile( const std::string& fname ) :\n    _filename(fname),_hFile(NULL)\n{\n    _Init();\n}\n\nWin32SequentialFile::~Win32SequentialFile()\n{\n    _CleanUp();\n}\n\nStatus Win32SequentialFile::Read( size_t n, Slice* result, char* scratch )\n{\n    Status sRet;\n    DWORD hasRead = 0;\n    if(_hFile && ReadFile(_hFile,scratch,n,&hasRead,NULL) ){\n        *result = Slice(scratch,hasRead);\n    } else {\n        sRet = Status::IOError(_filename, Win32::GetLastErrSz() );\n    }\n    return sRet;\n}\n\nStatus Win32SequentialFile::Skip( uint64_t n )\n{\n    Status sRet;\n    LARGE_INTEGER Move,NowPointer;\n    Move.QuadPart = n;\n    if(!SetFilePointerEx(_hFile,Move,&NowPointer,FILE_CURRENT)){\n        sRet = Status::IOError(_filename,Win32::GetLastErrSz());\n    }\n    return sRet;\n}\n\nBOOL Win32SequentialFile::isEnable()\n{\n    return _hFile ? TRUE : FALSE;\n}\n\nBOOL Win32SequentialFile::_Init()\n{\n\tstd::wstring path;\n\tToWidePath(_filename, path);\n\t_hFile = CreateFileW(path.c_str(),\n                         GENERIC_READ,\n                         FILE_SHARE_READ | FILE_SHARE_WRITE,\n                         NULL,\n                         OPEN_EXISTING,\n                         FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,\n                         NULL);\n    if (_hFile == INVALID_HANDLE_VALUE)\n        _hFile = NULL;\n    return _hFile ? TRUE : FALSE;\n}\n\nvoid Win32SequentialFile::_CleanUp()\n{\n    if(_hFile){\n        CloseHandle(_hFile);\n        _hFile = NULL;\n    }\n}\n\nWin32RandomAccessFile::Win32RandomAccessFile( const std::string& fname ) :\n    _filename(fname),_hFile(NULL)\n{\n\tstd::wstring path;\n\tToWidePath(fname, path);\n    _Init( path.c_str() );\n}\n\nWin32RandomAccessFile::~Win32RandomAccessFile()\n{\n    _CleanUp();\n}\n\nStatus Win32RandomAccessFile::Read(uint64_t offset,size_t n,Slice* result,char* scratch) const\n{\n    Status sRet;\n    OVERLAPPED ol = {0};\n    ZeroMemory(&ol,sizeof(ol));\n    ol.Offset = (DWORD)offset;\n    ol.OffsetHigh = (DWORD)(offset >> 32);\n    DWORD hasRead = 0;\n    if(!ReadFile(_hFile,scratch,n,&hasRead,&ol))\n        sRet = Status::IOError(_filename,Win32::GetLastErrSz());\n    else\n        *result = Slice(scratch,hasRead);\n    return sRet;\n}\n\nBOOL Win32RandomAccessFile::_Init( LPCWSTR path )\n{\n    BOOL bRet = FALSE;\n    if(!_hFile)\n        _hFile = ::CreateFileW(path,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,\n        FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,NULL);\n    if(!_hFile || _hFile == INVALID_HANDLE_VALUE )\n        _hFile = NULL;\n    else\n        bRet = TRUE;\n    return bRet;\n}\n\nBOOL Win32RandomAccessFile::isEnable()\n{\n    return _hFile ? TRUE : FALSE;\n}\n\nvoid Win32RandomAccessFile::_CleanUp()\n{\n    if(_hFile){\n        ::CloseHandle(_hFile);\n        _hFile = NULL;\n    }\n}\n\nWin32WritableFile::Win32WritableFile(const std::string& fname, bool append)\n    : filename_(fname)\n{\n    std::wstring path;\n    ToWidePath(fname, path);\n    // NewAppendableFile: append to an existing file, or create a new one\n    //     if none exists - this is OPEN_ALWAYS behavior, with\n    //     FILE_APPEND_DATA to avoid having to manually position the file\n    //     pointer at the end of the file.\n    // NewWritableFile: create a new file, delete if it exists - this is\n    //     CREATE_ALWAYS behavior. This file is used for writing only so\n    //     use GENERIC_WRITE.\n    _hFile = CreateFileW(path.c_str(),\n                         append ? FILE_APPEND_DATA : GENERIC_WRITE,\n                         FILE_SHARE_READ|FILE_SHARE_DELETE|FILE_SHARE_WRITE,\n                         NULL,\n                         append ? OPEN_ALWAYS : CREATE_ALWAYS,\n                         FILE_ATTRIBUTE_NORMAL,\n                         NULL);\n    // CreateFileW returns INVALID_HANDLE_VALUE in case of error, always check isEnable() before use\n}\n\nWin32WritableFile::~Win32WritableFile()\n{\n    if (_hFile != INVALID_HANDLE_VALUE)\n        Close();\n}\n\nStatus Win32WritableFile::Append(const Slice& data)\n{\n    DWORD r = 0;\n    if (!WriteFile(_hFile, data.data(), data.size(), &r, NULL) || r != data.size()) {\n        return Status::IOError(\"Win32WritableFile.Append::WriteFile: \"+filename_, Win32::GetLastErrSz());\n    }\n    return Status::OK();\n}\n\nStatus Win32WritableFile::Close()\n{\n    if (!CloseHandle(_hFile)) {\n        return Status::IOError(\"Win32WritableFile.Close::CloseHandle: \"+filename_, Win32::GetLastErrSz());\n    }\n    _hFile = INVALID_HANDLE_VALUE;\n    return Status::OK();\n}\n\nStatus Win32WritableFile::Flush()\n{\n    // Nothing to do here, there are no application-side buffers\n    return Status::OK();\n}\n\nStatus Win32WritableFile::Sync()\n{\n    if (!FlushFileBuffers(_hFile)) {\n        return Status::IOError(\"Win32WritableFile.Sync::FlushFileBuffers \"+filename_, Win32::GetLastErrSz());\n    }\n    return Status::OK();\n}\n\nBOOL Win32WritableFile::isEnable()\n{\n    return _hFile != INVALID_HANDLE_VALUE;\n}\n\nWin32FileLock::Win32FileLock( const std::string& fname ) :\n    _hFile(NULL),_filename(fname)\n{\n\tstd::wstring path;\n\tToWidePath(fname, path);\n\t_Init(path.c_str());\n}\n\nWin32FileLock::~Win32FileLock()\n{\n    _CleanUp();\n}\n\nBOOL Win32FileLock::_Init( LPCWSTR path )\n{\n    BOOL bRet = FALSE;\n    if(!_hFile)\n        _hFile = ::CreateFileW(path,0,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);\n    if(!_hFile || _hFile == INVALID_HANDLE_VALUE ){\n        _hFile = NULL;\n    }\n    else\n        bRet = TRUE;\n    return bRet;\n}\n\nvoid Win32FileLock::_CleanUp()\n{\n    ::CloseHandle(_hFile);\n    _hFile = NULL;\n}\n\nBOOL Win32FileLock::isEnable()\n{\n    return _hFile ? TRUE : FALSE;\n}\n\nWin32Logger::Win32Logger(WritableFile* pFile) : _pFileProxy(pFile)\n{\n    assert(_pFileProxy);\n}\n\nWin32Logger::~Win32Logger()\n{\n    if(_pFileProxy)\n        delete _pFileProxy;\n}\n\nvoid Win32Logger::Logv( const char* format, va_list ap )\n{\n    uint64_t thread_id = ::GetCurrentThreadId();\n\n    // We try twice: the first time with a fixed-size stack allocated buffer,\n    // and the second time with a much larger dynamically allocated buffer.\n    char buffer[500];\n    for (int iter = 0; iter < 2; iter++) {\n        char* base;\n        int bufsize;\n        if (iter == 0) {\n            bufsize = sizeof(buffer);\n            base = buffer;\n        } else {\n            bufsize = 30000;\n            base = new char[bufsize];\n        }\n        char* p = base;\n        char* limit = base + bufsize;\n\n        SYSTEMTIME st;\n        GetLocalTime(&st);\n        p += snprintf(p, limit - p,\n            \"%04d/%02d/%02d-%02d:%02d:%02d.%06d %llx \",\n            int(st.wYear),\n            int(st.wMonth),\n            int(st.wDay),\n            int(st.wHour),\n            int(st.wMinute),\n            int(st.wMinute),\n            int(st.wMilliseconds),\n            static_cast<long long unsigned int>(thread_id));\n\n        // Print the message\n        if (p < limit) {\n            va_list backup_ap;\n            va_copy(backup_ap, ap);\n            p += vsnprintf(p, limit - p, format, backup_ap);\n            va_end(backup_ap);\n        }\n\n        // Truncate to available space if necessary\n        if (p >= limit) {\n            if (iter == 0) {\n                continue;       // Try again with larger buffer\n            } else {\n                p = limit - 1;\n            }\n        }\n\n        // Add newline if necessary\n        if (p == base || p[-1] != '\\n') {\n            *p++ = '\\n';\n        }\n\n        assert(p <= limit);\n        DWORD hasWritten = 0;\n        if(_pFileProxy){\n            _pFileProxy->Append(Slice(base, p - base));\n            _pFileProxy->Flush();\n        }\n        if (base != buffer) {\n            delete[] base;\n        }\n        break;\n    }\n}\n\nbool Win32Env::FileExists(const std::string& fname)\n{\n\tstd::string path = fname;\n    std::wstring wpath;\n\tToWidePath(ModifyPath(path), wpath);\n    return ::PathFileExistsW(wpath.c_str()) ? true : false;\n}\n\nStatus Win32Env::GetChildren(const std::string& dir, std::vector<std::string>* result)\n{\n    Status sRet;\n    ::WIN32_FIND_DATAW wfd;\n    std::string path = dir;\n    ModifyPath(path);\n    path += \"\\\\*.*\";\n\tstd::wstring wpath;\n\tToWidePath(path, wpath);\n\n\t::HANDLE hFind = ::FindFirstFileW(wpath.c_str() ,&wfd);\n    if(hFind && hFind != INVALID_HANDLE_VALUE){\n        BOOL hasNext = TRUE;\n        std::string child;\n        while(hasNext){\n            ToNarrowPath(wfd.cFileName, child); \n            if(child != \"..\" && child != \".\")  {\n                result->push_back(child);\n            }\n            hasNext = ::FindNextFileW(hFind,&wfd);\n        }\n        ::FindClose(hFind);\n    }\n    else\n        sRet = Status::IOError(dir,\"Could not get children.\");\n    return sRet;\n}\n\nvoid Win32Env::SleepForMicroseconds( int micros )\n{\n    ::Sleep((micros + 999) /1000);\n}\n\n\nStatus Win32Env::DeleteFile( const std::string& fname )\n{\n    Status sRet;\n    std::string path = fname;\n    std::wstring wpath;\n\tToWidePath(ModifyPath(path), wpath);\n\n    if(!::DeleteFileW(wpath.c_str())) {\n        sRet = Status::IOError(path, \"Could not delete file.\");\n    }\n    return sRet;\n}\n\nStatus Win32Env::GetFileSize( const std::string& fname, uint64_t* file_size )\n{\n    Status sRet;\n    std::string path = fname;\n    std::wstring wpath;\n\tToWidePath(ModifyPath(path), wpath);\n\n    HANDLE file = ::CreateFileW(wpath.c_str(),\n        GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);\n    LARGE_INTEGER li;\n    if(::GetFileSizeEx(file,&li)){\n        *file_size = (uint64_t)li.QuadPart;\n    }else\n        sRet = Status::IOError(path,\"Could not get the file size.\");\n    CloseHandle(file);\n    return sRet;\n}\n\nStatus Win32Env::RenameFile( const std::string& src, const std::string& target )\n{\n    Status sRet;\n    std::string src_path = src;\n    std::wstring wsrc_path;\n\tToWidePath(ModifyPath(src_path), wsrc_path);\n\tstd::string target_path = target;\n    std::wstring wtarget_path;\n\tToWidePath(ModifyPath(target_path), wtarget_path);\n\n    if(!MoveFileW(wsrc_path.c_str(), wtarget_path.c_str() ) ){\n        DWORD err = GetLastError();\n        if(err == 0x000000b7){\n            if(!::DeleteFileW(wtarget_path.c_str() ) )\n                sRet = Status::IOError(src, \"Could not rename file.\");\n\t\t\telse if(!::MoveFileW(wsrc_path.c_str(),\n                                 wtarget_path.c_str() ) )\n                sRet = Status::IOError(src, \"Could not rename file.\");    \n        }\n    }\n    return sRet;\n}\n\nStatus Win32Env::LockFile( const std::string& fname, FileLock** lock )\n{\n    Status sRet;\n    std::string path = fname;\n    ModifyPath(path);\n    Win32FileLock* _lock = new Win32FileLock(path);\n    if(!_lock->isEnable()){\n        delete _lock;\n        *lock = NULL;\n        sRet = Status::IOError(path, \"Could not lock file.\");\n    }\n    else\n        *lock = _lock;\n    return sRet;\n}\n\nStatus Win32Env::UnlockFile( FileLock* lock )\n{\n    Status sRet;\n    delete lock;\n    return sRet;\n}\n\nvoid Win32Env::Schedule( void (*function)(void* arg), void* arg )\n{\n    QueueUserWorkItem(Win32::WorkItemWrapperProc,\n                      new Win32::WorkItemWrapper(function,arg),\n                      WT_EXECUTEDEFAULT);\n}\n\nvoid Win32Env::StartThread( void (*function)(void* arg), void* arg )\n{\n    ::_beginthread(function,0,arg);\n}\n\nStatus Win32Env::GetTestDirectory( std::string* path )\n{\n    Status sRet;\n    WCHAR TempPath[MAX_PATH];\n    ::GetTempPathW(MAX_PATH,TempPath);\n\tToNarrowPath(TempPath, *path);\n    path->append(\"leveldb\\\\test\\\\\");\n    ModifyPath(*path);\n    return sRet;\n}\n\nuint64_t Win32Env::NowMicros()\n{\n#ifndef USE_VISTA_API\n#define GetTickCount64 GetTickCount\n#endif\n    return (uint64_t)(GetTickCount64()*1000);\n}\n\nstatic Status CreateDirInner( const std::string& dirname )\n{\n    Status sRet;\n    DWORD attr = ::GetFileAttributes(dirname.c_str());\n    if (attr == INVALID_FILE_ATTRIBUTES) { // doesn't exist:\n      std::size_t slash = dirname.find_last_of(\"\\\\\");\n      if (slash != std::string::npos){\n\tsRet = CreateDirInner(dirname.substr(0, slash));\n\tif (!sRet.ok()) return sRet;\n      }\n      BOOL result = ::CreateDirectory(dirname.c_str(), NULL);\n      if (result == FALSE) {\n\tsRet = Status::IOError(dirname, \"Could not create directory.\");\n\treturn sRet;\n      }\n    }\n    return sRet;\n}\n\nStatus Win32Env::CreateDir( const std::string& dirname )\n{\n    std::string path = dirname;\n    if(path[path.length() - 1] != '\\\\'){\n        path += '\\\\';\n    }\n    ModifyPath(path);\n\n    return CreateDirInner(path);\n}\n\nStatus Win32Env::DeleteDir( const std::string& dirname )\n{\n    Status sRet;\n    std::wstring path;\n\tToWidePath(dirname, path);\n    ModifyPath(path);\n    if(!::RemoveDirectoryW( path.c_str() ) ){\n        sRet = Status::IOError(dirname, \"Could not delete directory.\");\n    }\n    return sRet;\n}\n\nStatus Win32Env::NewSequentialFile( const std::string& fname, SequentialFile** result )\n{\n    Status sRet;\n    std::string path = fname;\n    ModifyPath(path);\n    Win32SequentialFile* pFile = new Win32SequentialFile(path);\n    if(pFile->isEnable()){\n        *result = pFile;\n    }else {\n        delete pFile;\n        sRet = Status::IOError(path, Win32::GetLastErrSz());\n    }\n    return sRet;\n}\n\nStatus Win32Env::NewRandomAccessFile( const std::string& fname, RandomAccessFile** result )\n{\n    Status sRet;\n    std::string path = fname;\n    Win32RandomAccessFile* pFile = new Win32RandomAccessFile(ModifyPath(path));\n    if(!pFile->isEnable()){\n        delete pFile;\n        *result = NULL;\n        sRet = Status::IOError(path, Win32::GetLastErrSz());\n    }else\n        *result = pFile;\n    return sRet;\n}\n\nStatus Win32Env::NewLogger( const std::string& fname, Logger** result )\n{\n    Status sRet;\n    std::string path = fname;\n    // Logs are opened with write semantics, not with append semantics\n    // (see PosixEnv::NewLogger)\n    Win32WritableFile* pMapFile = new Win32WritableFile(ModifyPath(path), false);\n    if(!pMapFile->isEnable()){\n        delete pMapFile;\n        *result = NULL;\n        sRet = Status::IOError(path,\"could not create a logger.\");\n    }else\n        *result = new Win32Logger(pMapFile);\n    return sRet;\n}\n\nStatus Win32Env::NewWritableFile( const std::string& fname, WritableFile** result )\n{\n    Status sRet;\n    std::string path = fname;\n    Win32WritableFile* pFile = new Win32WritableFile(ModifyPath(path), false);\n    if(!pFile->isEnable()){\n        *result = NULL;\n        sRet = Status::IOError(fname,Win32::GetLastErrSz());\n    }else\n        *result = pFile;\n    return sRet;\n}\n\nStatus Win32Env::NewAppendableFile( const std::string& fname, WritableFile** result )\n{\n    Status sRet;\n    std::string path = fname;\n    Win32WritableFile* pFile = new Win32WritableFile(ModifyPath(path), true);\n    if(!pFile->isEnable()){\n        *result = NULL;\n        sRet = Status::IOError(fname,Win32::GetLastErrSz());\n    }else\n        *result = pFile;\n    return sRet;\n}\n\nWin32Env::Win32Env()\n{\n\n}\n\nWin32Env::~Win32Env()\n{\n\n}\n\n\n}  // Win32 namespace\n\nstatic port::OnceType once = LEVELDB_ONCE_INIT;\nstatic Env* default_env;\nstatic void InitDefaultEnv() { default_env = new Win32::Win32Env(); }\n\nEnv* Env::Default() {\n  port::InitOnce(&once, InitDefaultEnv);\n  return default_env;\n}\n\n}  // namespace leveldb\n\n#endif // defined(LEVELDB_PLATFORM_WINDOWS)\n"
  },
  {
    "path": "src/leveldb/util/filter_policy.cc",
    "content": "// Copyright (c) 2012 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/filter_policy.h\"\n\nnamespace leveldb {\n\nFilterPolicy::~FilterPolicy() { }\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/hash.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <string.h>\n#include \"util/coding.h\"\n#include \"util/hash.h\"\n\n// The FALLTHROUGH_INTENDED macro can be used to annotate implicit fall-through\n// between switch labels. The real definition should be provided externally.\n// This one is a fallback version for unsupported compilers.\n#ifndef FALLTHROUGH_INTENDED\n#define FALLTHROUGH_INTENDED do { } while (0)\n#endif\n\nnamespace leveldb {\n\nuint32_t Hash(const char* data, size_t n, uint32_t seed) {\n  // Similar to murmur hash\n  const uint32_t m = 0xc6a4a793;\n  const uint32_t r = 24;\n  const char* limit = data + n;\n  uint32_t h = seed ^ (n * m);\n\n  // Pick up four bytes at a time\n  while (data + 4 <= limit) {\n    uint32_t w = DecodeFixed32(data);\n    data += 4;\n    h += w;\n    h *= m;\n    h ^= (h >> 16);\n  }\n\n  // Pick up remaining bytes\n  switch (limit - data) {\n    case 3:\n      h += static_cast<unsigned char>(data[2]) << 16;\n      FALLTHROUGH_INTENDED;\n    case 2:\n      h += static_cast<unsigned char>(data[1]) << 8;\n      FALLTHROUGH_INTENDED;\n    case 1:\n      h += static_cast<unsigned char>(data[0]);\n      h *= m;\n      h ^= (h >> r);\n      break;\n  }\n  return h;\n}\n\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/hash.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// Simple hash function used for internal data structures\n\n#ifndef STORAGE_LEVELDB_UTIL_HASH_H_\n#define STORAGE_LEVELDB_UTIL_HASH_H_\n\n#include <stddef.h>\n#include <stdint.h>\n\nnamespace leveldb {\n\nextern uint32_t Hash(const char* data, size_t n, uint32_t seed);\n\n}\n\n#endif  // STORAGE_LEVELDB_UTIL_HASH_H_\n"
  },
  {
    "path": "src/leveldb/util/hash_test.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"util/hash.h\"\n#include \"util/testharness.h\"\n\nnamespace leveldb {\n\nclass HASH { };\n\nTEST(HASH, SignedUnsignedIssue) {\n  const unsigned char data1[1] = {0x62};\n  const unsigned char data2[2] = {0xc3, 0x97};\n  const unsigned char data3[3] = {0xe2, 0x99, 0xa5};\n  const unsigned char data4[4] = {0xe1, 0x80, 0xb9, 0x32};\n  const unsigned char data5[48] = {\n    0x01, 0xc0, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00,\n    0x14, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x04, 0x00,\n    0x00, 0x00, 0x00, 0x14,\n    0x00, 0x00, 0x00, 0x18,\n    0x28, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00,\n    0x02, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0x00,\n  };\n\n  ASSERT_EQ(Hash(0, 0, 0xbc9f1d34), 0xbc9f1d34);\n  ASSERT_EQ(\n      Hash(reinterpret_cast<const char*>(data1), sizeof(data1), 0xbc9f1d34),\n      0xef1345c4);\n  ASSERT_EQ(\n      Hash(reinterpret_cast<const char*>(data2), sizeof(data2), 0xbc9f1d34),\n      0x5b663814);\n  ASSERT_EQ(\n      Hash(reinterpret_cast<const char*>(data3), sizeof(data3), 0xbc9f1d34),\n      0x323c078f);\n  ASSERT_EQ(\n      Hash(reinterpret_cast<const char*>(data4), sizeof(data4), 0xbc9f1d34),\n      0xed21633a);\n  ASSERT_EQ(\n      Hash(reinterpret_cast<const char*>(data5), sizeof(data5), 0x12345678),\n      0xf333dabb);\n}\n\n}  // namespace leveldb\n\nint main(int argc, char** argv) {\n  return leveldb::test::RunAllTests();\n}\n"
  },
  {
    "path": "src/leveldb/util/histogram.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <math.h>\n#include <stdio.h>\n#include \"port/port.h\"\n#include \"util/histogram.h\"\n\nnamespace leveldb {\n\nconst double Histogram::kBucketLimit[kNumBuckets] = {\n  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 25, 30, 35, 40, 45,\n  50, 60, 70, 80, 90, 100, 120, 140, 160, 180, 200, 250, 300, 350, 400, 450,\n  500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 1800, 2000, 2500, 3000,\n  3500, 4000, 4500, 5000, 6000, 7000, 8000, 9000, 10000, 12000, 14000,\n  16000, 18000, 20000, 25000, 30000, 35000, 40000, 45000, 50000, 60000,\n  70000, 80000, 90000, 100000, 120000, 140000, 160000, 180000, 200000,\n  250000, 300000, 350000, 400000, 450000, 500000, 600000, 700000, 800000,\n  900000, 1000000, 1200000, 1400000, 1600000, 1800000, 2000000, 2500000,\n  3000000, 3500000, 4000000, 4500000, 5000000, 6000000, 7000000, 8000000,\n  9000000, 10000000, 12000000, 14000000, 16000000, 18000000, 20000000,\n  25000000, 30000000, 35000000, 40000000, 45000000, 50000000, 60000000,\n  70000000, 80000000, 90000000, 100000000, 120000000, 140000000, 160000000,\n  180000000, 200000000, 250000000, 300000000, 350000000, 400000000,\n  450000000, 500000000, 600000000, 700000000, 800000000, 900000000,\n  1000000000, 1200000000, 1400000000, 1600000000, 1800000000, 2000000000,\n  2500000000.0, 3000000000.0, 3500000000.0, 4000000000.0, 4500000000.0,\n  5000000000.0, 6000000000.0, 7000000000.0, 8000000000.0, 9000000000.0,\n  1e200,\n};\n\nvoid Histogram::Clear() {\n  min_ = kBucketLimit[kNumBuckets-1];\n  max_ = 0;\n  num_ = 0;\n  sum_ = 0;\n  sum_squares_ = 0;\n  for (int i = 0; i < kNumBuckets; i++) {\n    buckets_[i] = 0;\n  }\n}\n\nvoid Histogram::Add(double value) {\n  // Linear search is fast enough for our usage in db_bench\n  int b = 0;\n  while (b < kNumBuckets - 1 && kBucketLimit[b] <= value) {\n    b++;\n  }\n  buckets_[b] += 1.0;\n  if (min_ > value) min_ = value;\n  if (max_ < value) max_ = value;\n  num_++;\n  sum_ += value;\n  sum_squares_ += (value * value);\n}\n\nvoid Histogram::Merge(const Histogram& other) {\n  if (other.min_ < min_) min_ = other.min_;\n  if (other.max_ > max_) max_ = other.max_;\n  num_ += other.num_;\n  sum_ += other.sum_;\n  sum_squares_ += other.sum_squares_;\n  for (int b = 0; b < kNumBuckets; b++) {\n    buckets_[b] += other.buckets_[b];\n  }\n}\n\ndouble Histogram::Median() const {\n  return Percentile(50.0);\n}\n\ndouble Histogram::Percentile(double p) const {\n  double threshold = num_ * (p / 100.0);\n  double sum = 0;\n  for (int b = 0; b < kNumBuckets; b++) {\n    sum += buckets_[b];\n    if (sum >= threshold) {\n      // Scale linearly within this bucket\n      double left_point = (b == 0) ? 0 : kBucketLimit[b-1];\n      double right_point = kBucketLimit[b];\n      double left_sum = sum - buckets_[b];\n      double right_sum = sum;\n      double pos = (threshold - left_sum) / (right_sum - left_sum);\n      double r = left_point + (right_point - left_point) * pos;\n      if (r < min_) r = min_;\n      if (r > max_) r = max_;\n      return r;\n    }\n  }\n  return max_;\n}\n\ndouble Histogram::Average() const {\n  if (num_ == 0.0) return 0;\n  return sum_ / num_;\n}\n\ndouble Histogram::StandardDeviation() const {\n  if (num_ == 0.0) return 0;\n  double variance = (sum_squares_ * num_ - sum_ * sum_) / (num_ * num_);\n  return sqrt(variance);\n}\n\nstd::string Histogram::ToString() const {\n  std::string r;\n  char buf[200];\n  snprintf(buf, sizeof(buf),\n           \"Count: %.0f  Average: %.4f  StdDev: %.2f\\n\",\n           num_, Average(), StandardDeviation());\n  r.append(buf);\n  snprintf(buf, sizeof(buf),\n           \"Min: %.4f  Median: %.4f  Max: %.4f\\n\",\n           (num_ == 0.0 ? 0.0 : min_), Median(), max_);\n  r.append(buf);\n  r.append(\"------------------------------------------------------\\n\");\n  const double mult = 100.0 / num_;\n  double sum = 0;\n  for (int b = 0; b < kNumBuckets; b++) {\n    if (buckets_[b] <= 0.0) continue;\n    sum += buckets_[b];\n    snprintf(buf, sizeof(buf),\n             \"[ %7.0f, %7.0f ) %7.0f %7.3f%% %7.3f%% \",\n             ((b == 0) ? 0.0 : kBucketLimit[b-1]),      // left\n             kBucketLimit[b],                           // right\n             buckets_[b],                               // count\n             mult * buckets_[b],                        // percentage\n             mult * sum);                               // cumulative percentage\n    r.append(buf);\n\n    // Add hash marks based on percentage; 20 marks for 100%.\n    int marks = static_cast<int>(20*(buckets_[b] / num_) + 0.5);\n    r.append(marks, '#');\n    r.push_back('\\n');\n  }\n  return r;\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/histogram.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_UTIL_HISTOGRAM_H_\n#define STORAGE_LEVELDB_UTIL_HISTOGRAM_H_\n\n#include <string>\n\nnamespace leveldb {\n\nclass Histogram {\n public:\n  Histogram() { }\n  ~Histogram() { }\n\n  void Clear();\n  void Add(double value);\n  void Merge(const Histogram& other);\n\n  std::string ToString() const;\n\n private:\n  double min_;\n  double max_;\n  double num_;\n  double sum_;\n  double sum_squares_;\n\n  enum { kNumBuckets = 154 };\n  static const double kBucketLimit[kNumBuckets];\n  double buckets_[kNumBuckets];\n\n  double Median() const;\n  double Percentile(double p) const;\n  double Average() const;\n  double StandardDeviation() const;\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_UTIL_HISTOGRAM_H_\n"
  },
  {
    "path": "src/leveldb/util/logging.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"util/logging.h\"\n\n#include <errno.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include \"leveldb/env.h\"\n#include \"leveldb/slice.h\"\n\nnamespace leveldb {\n\nvoid AppendNumberTo(std::string* str, uint64_t num) {\n  char buf[30];\n  snprintf(buf, sizeof(buf), \"%llu\", (unsigned long long) num);\n  str->append(buf);\n}\n\nvoid AppendEscapedStringTo(std::string* str, const Slice& value) {\n  for (size_t i = 0; i < value.size(); i++) {\n    char c = value[i];\n    if (c >= ' ' && c <= '~') {\n      str->push_back(c);\n    } else {\n      char buf[10];\n      snprintf(buf, sizeof(buf), \"\\\\x%02x\",\n               static_cast<unsigned int>(c) & 0xff);\n      str->append(buf);\n    }\n  }\n}\n\nstd::string NumberToString(uint64_t num) {\n  std::string r;\n  AppendNumberTo(&r, num);\n  return r;\n}\n\nstd::string EscapeString(const Slice& value) {\n  std::string r;\n  AppendEscapedStringTo(&r, value);\n  return r;\n}\n\nbool ConsumeDecimalNumber(Slice* in, uint64_t* val) {\n  uint64_t v = 0;\n  int digits = 0;\n  while (!in->empty()) {\n    unsigned char c = (*in)[0];\n    if (c >= '0' && c <= '9') {\n      ++digits;\n      const int delta = (c - '0');\n      static const uint64_t kMaxUint64 = ~static_cast<uint64_t>(0);\n      if (v > kMaxUint64/10 ||\n          (v == kMaxUint64/10 && delta > kMaxUint64%10)) {\n        // Overflow\n        return false;\n      }\n      v = (v * 10) + delta;\n      in->remove_prefix(1);\n    } else {\n      break;\n    }\n  }\n  *val = v;\n  return (digits > 0);\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/logging.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// Must not be included from any .h files to avoid polluting the namespace\n// with macros.\n\n#ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_\n#define STORAGE_LEVELDB_UTIL_LOGGING_H_\n\n#include <stdio.h>\n#include <stdint.h>\n#include <string>\n#include \"port/port.h\"\n\nnamespace leveldb {\n\nclass Slice;\nclass WritableFile;\n\n// Append a human-readable printout of \"num\" to *str\nextern void AppendNumberTo(std::string* str, uint64_t num);\n\n// Append a human-readable printout of \"value\" to *str.\n// Escapes any non-printable characters found in \"value\".\nextern void AppendEscapedStringTo(std::string* str, const Slice& value);\n\n// Return a human-readable printout of \"num\"\nextern std::string NumberToString(uint64_t num);\n\n// Return a human-readable version of \"value\".\n// Escapes any non-printable characters found in \"value\".\nextern std::string EscapeString(const Slice& value);\n\n// Parse a human-readable number from \"*in\" into *value.  On success,\n// advances \"*in\" past the consumed number and sets \"*val\" to the\n// numeric value.  Otherwise, returns false and leaves *in in an\n// unspecified state.\nextern bool ConsumeDecimalNumber(Slice* in, uint64_t* val);\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_UTIL_LOGGING_H_\n"
  },
  {
    "path": "src/leveldb/util/mutexlock.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_\n#define STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_\n\n#include \"port/port.h\"\n#include \"port/thread_annotations.h\"\n\nnamespace leveldb {\n\n// Helper class that locks a mutex on construction and unlocks the mutex when\n// the destructor of the MutexLock object is invoked.\n//\n// Typical usage:\n//\n//   void MyClass::MyMethod() {\n//     MutexLock l(&mu_);       // mu_ is an instance variable\n//     ... some complex code, possibly with multiple return paths ...\n//   }\n\nclass SCOPED_LOCKABLE MutexLock {\n public:\n  explicit MutexLock(port::Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu)\n      : mu_(mu)  {\n    this->mu_->Lock();\n  }\n  ~MutexLock() UNLOCK_FUNCTION() { this->mu_->Unlock(); }\n\n private:\n  port::Mutex *const mu_;\n  // No copying allowed\n  MutexLock(const MutexLock&);\n  void operator=(const MutexLock&);\n};\n\n}  // namespace leveldb\n\n\n#endif  // STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_\n"
  },
  {
    "path": "src/leveldb/util/options.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"leveldb/options.h\"\n\n#include \"leveldb/comparator.h\"\n#include \"leveldb/env.h\"\n\nnamespace leveldb {\n\nOptions::Options()\n    : comparator(BytewiseComparator()),\n      create_if_missing(false),\n      error_if_exists(false),\n      paranoid_checks(false),\n      env(Env::Default()),\n      info_log(NULL),\n      write_buffer_size(4<<20),\n      max_open_files(1000),\n      block_cache(NULL),\n      block_size(4096),\n      block_restart_interval(16),\n      max_file_size(2<<20),\n      compression(kSnappyCompression),\n      reuse_logs(false),\n      filter_policy(NULL) {\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/posix_logger.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n//\n// Logger implementation that can be shared by all environments\n// where enough Posix functionality is available.\n\n#ifndef STORAGE_LEVELDB_UTIL_POSIX_LOGGER_H_\n#define STORAGE_LEVELDB_UTIL_POSIX_LOGGER_H_\n\n#include <algorithm>\n#include <stdio.h>\n#include <sys/time.h>\n#include <time.h>\n#include \"leveldb/env.h\"\n\nnamespace leveldb {\n\nclass PosixLogger : public Logger {\n private:\n  FILE* file_;\n  uint64_t (*gettid_)();  // Return the thread id for the current thread\n public:\n  PosixLogger(FILE* f, uint64_t (*gettid)()) : file_(f), gettid_(gettid) { }\n  virtual ~PosixLogger() {\n    fclose(file_);\n  }\n  virtual void Logv(const char* format, va_list ap) {\n    const uint64_t thread_id = (*gettid_)();\n\n    // We try twice: the first time with a fixed-size stack allocated buffer,\n    // and the second time with a much larger dynamically allocated buffer.\n    char buffer[500];\n    for (int iter = 0; iter < 2; iter++) {\n      char* base;\n      int bufsize;\n      if (iter == 0) {\n        bufsize = sizeof(buffer);\n        base = buffer;\n      } else {\n        bufsize = 30000;\n        base = new char[bufsize];\n      }\n      char* p = base;\n      char* limit = base + bufsize;\n\n      struct timeval now_tv;\n      gettimeofday(&now_tv, NULL);\n      const time_t seconds = now_tv.tv_sec;\n      struct tm t;\n      localtime_r(&seconds, &t);\n      p += snprintf(p, limit - p,\n                    \"%04d/%02d/%02d-%02d:%02d:%02d.%06d %llx \",\n                    t.tm_year + 1900,\n                    t.tm_mon + 1,\n                    t.tm_mday,\n                    t.tm_hour,\n                    t.tm_min,\n                    t.tm_sec,\n                    static_cast<int>(now_tv.tv_usec),\n                    static_cast<long long unsigned int>(thread_id));\n\n      // Print the message\n      if (p < limit) {\n        va_list backup_ap;\n        va_copy(backup_ap, ap);\n        p += vsnprintf(p, limit - p, format, backup_ap);\n        va_end(backup_ap);\n      }\n\n      // Truncate to available space if necessary\n      if (p >= limit) {\n        if (iter == 0) {\n          continue;       // Try again with larger buffer\n        } else {\n          p = limit - 1;\n        }\n      }\n\n      // Add newline if necessary\n      if (p == base || p[-1] != '\\n') {\n        *p++ = '\\n';\n      }\n\n      assert(p <= limit);\n      fwrite(base, 1, p - base, file_);\n      fflush(file_);\n      if (base != buffer) {\n        delete[] base;\n      }\n      break;\n    }\n  }\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_UTIL_POSIX_LOGGER_H_\n"
  },
  {
    "path": "src/leveldb/util/random.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_UTIL_RANDOM_H_\n#define STORAGE_LEVELDB_UTIL_RANDOM_H_\n\n#include <stdint.h>\n\nnamespace leveldb {\n\n// A very simple random number generator.  Not especially good at\n// generating truly random bits, but good enough for our needs in this\n// package.\nclass Random {\n private:\n  uint32_t seed_;\n public:\n  explicit Random(uint32_t s) : seed_(s & 0x7fffffffu) {\n    // Avoid bad seeds.\n    if (seed_ == 0 || seed_ == 2147483647L) {\n      seed_ = 1;\n    }\n  }\n  uint32_t Next() {\n    static const uint32_t M = 2147483647L;   // 2^31-1\n    static const uint64_t A = 16807;  // bits 14, 8, 7, 5, 2, 1, 0\n    // We are computing\n    //       seed_ = (seed_ * A) % M,    where M = 2^31-1\n    //\n    // seed_ must not be zero or M, or else all subsequent computed values\n    // will be zero or M respectively.  For all other values, seed_ will end\n    // up cycling through every number in [1,M-1]\n    uint64_t product = seed_ * A;\n\n    // Compute (product % M) using the fact that ((x << 31) % M) == x.\n    seed_ = static_cast<uint32_t>((product >> 31) + (product & M));\n    // The first reduction may overflow by 1 bit, so we may need to\n    // repeat.  mod == M is not possible; using > allows the faster\n    // sign-bit-based test.\n    if (seed_ > M) {\n      seed_ -= M;\n    }\n    return seed_;\n  }\n  // Returns a uniformly distributed value in the range [0..n-1]\n  // REQUIRES: n > 0\n  uint32_t Uniform(int n) { return Next() % n; }\n\n  // Randomly returns true ~\"1/n\" of the time, and false otherwise.\n  // REQUIRES: n > 0\n  bool OneIn(int n) { return (Next() % n) == 0; }\n\n  // Skewed: pick \"base\" uniformly from range [0,max_log] and then\n  // return \"base\" random bits.  The effect is to pick a number in the\n  // range [0,2^max_log-1] with exponential bias towards smaller numbers.\n  uint32_t Skewed(int max_log) {\n    return Uniform(1 << Uniform(max_log + 1));\n  }\n};\n\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_UTIL_RANDOM_H_\n"
  },
  {
    "path": "src/leveldb/util/status.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include <stdio.h>\n#include \"port/port.h\"\n#include \"leveldb/status.h\"\n\nnamespace leveldb {\n\nconst char* Status::CopyState(const char* state) {\n  uint32_t size;\n  memcpy(&size, state, sizeof(size));\n  char* result = new char[size + 5];\n  memcpy(result, state, size + 5);\n  return result;\n}\n\nStatus::Status(Code code, const Slice& msg, const Slice& msg2) {\n  assert(code != kOk);\n  const uint32_t len1 = msg.size();\n  const uint32_t len2 = msg2.size();\n  const uint32_t size = len1 + (len2 ? (2 + len2) : 0);\n  char* result = new char[size + 5];\n  memcpy(result, &size, sizeof(size));\n  result[4] = static_cast<char>(code);\n  memcpy(result + 5, msg.data(), len1);\n  if (len2) {\n    result[5 + len1] = ':';\n    result[6 + len1] = ' ';\n    memcpy(result + 7 + len1, msg2.data(), len2);\n  }\n  state_ = result;\n}\n\nstd::string Status::ToString() const {\n  if (state_ == NULL) {\n    return \"OK\";\n  } else {\n    char tmp[30];\n    const char* type;\n    switch (code()) {\n      case kOk:\n        type = \"OK\";\n        break;\n      case kNotFound:\n        type = \"NotFound: \";\n        break;\n      case kCorruption:\n        type = \"Corruption: \";\n        break;\n      case kNotSupported:\n        type = \"Not implemented: \";\n        break;\n      case kInvalidArgument:\n        type = \"Invalid argument: \";\n        break;\n      case kIOError:\n        type = \"IO error: \";\n        break;\n      default:\n        snprintf(tmp, sizeof(tmp), \"Unknown code(%d): \",\n                 static_cast<int>(code()));\n        type = tmp;\n        break;\n    }\n    std::string result(type);\n    uint32_t length;\n    memcpy(&length, state_, sizeof(length));\n    result.append(state_ + 5, length);\n    return result;\n  }\n}\n\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/testharness.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"util/testharness.h\"\n\n#include <string>\n#include <stdlib.h>\n#include <sys/stat.h>\n#include <sys/types.h>\n\nnamespace leveldb {\nnamespace test {\n\nnamespace {\nstruct Test {\n  const char* base;\n  const char* name;\n  void (*func)();\n};\nstd::vector<Test>* tests;\n}\n\nbool RegisterTest(const char* base, const char* name, void (*func)()) {\n  if (tests == NULL) {\n    tests = new std::vector<Test>;\n  }\n  Test t;\n  t.base = base;\n  t.name = name;\n  t.func = func;\n  tests->push_back(t);\n  return true;\n}\n\nint RunAllTests() {\n  const char* matcher = getenv(\"LEVELDB_TESTS\");\n\n  int num = 0;\n  if (tests != NULL) {\n    for (size_t i = 0; i < tests->size(); i++) {\n      const Test& t = (*tests)[i];\n      if (matcher != NULL) {\n        std::string name = t.base;\n        name.push_back('.');\n        name.append(t.name);\n        if (strstr(name.c_str(), matcher) == NULL) {\n          continue;\n        }\n      }\n      fprintf(stderr, \"==== Test %s.%s\\n\", t.base, t.name);\n      (*t.func)();\n      ++num;\n    }\n  }\n  fprintf(stderr, \"==== PASSED %d tests\\n\", num);\n  return 0;\n}\n\nstd::string TmpDir() {\n  std::string dir;\n  Status s = Env::Default()->GetTestDirectory(&dir);\n  ASSERT_TRUE(s.ok()) << s.ToString();\n  return dir;\n}\n\nint RandomSeed() {\n  const char* env = getenv(\"TEST_RANDOM_SEED\");\n  int result = (env != NULL ? atoi(env) : 301);\n  if (result <= 0) {\n    result = 301;\n  }\n  return result;\n}\n\n}  // namespace test\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/testharness.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_UTIL_TESTHARNESS_H_\n#define STORAGE_LEVELDB_UTIL_TESTHARNESS_H_\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <sstream>\n#include \"leveldb/env.h\"\n#include \"leveldb/slice.h\"\n#include \"util/random.h\"\n\nnamespace leveldb {\nnamespace test {\n\n// Run some of the tests registered by the TEST() macro.  If the\n// environment variable \"LEVELDB_TESTS\" is not set, runs all tests.\n// Otherwise, runs only the tests whose name contains the value of\n// \"LEVELDB_TESTS\" as a substring.  E.g., suppose the tests are:\n//    TEST(Foo, Hello) { ... }\n//    TEST(Foo, World) { ... }\n// LEVELDB_TESTS=Hello will run the first test\n// LEVELDB_TESTS=o     will run both tests\n// LEVELDB_TESTS=Junk  will run no tests\n//\n// Returns 0 if all tests pass.\n// Dies or returns a non-zero value if some test fails.\nextern int RunAllTests();\n\n// Return the directory to use for temporary storage.\nextern std::string TmpDir();\n\n// Return a randomization seed for this run.  Typically returns the\n// same number on repeated invocations of this binary, but automated\n// runs may be able to vary the seed.\nextern int RandomSeed();\n\n// An instance of Tester is allocated to hold temporary state during\n// the execution of an assertion.\nclass Tester {\n private:\n  bool ok_;\n  const char* fname_;\n  int line_;\n  std::stringstream ss_;\n\n public:\n  Tester(const char* f, int l)\n      : ok_(true), fname_(f), line_(l) {\n  }\n\n  ~Tester() {\n    if (!ok_) {\n      fprintf(stderr, \"%s:%d:%s\\n\", fname_, line_, ss_.str().c_str());\n      exit(1);\n    }\n  }\n\n  Tester& Is(bool b, const char* msg) {\n    if (!b) {\n      ss_ << \" Assertion failure \" << msg;\n      ok_ = false;\n    }\n    return *this;\n  }\n\n  Tester& IsOk(const Status& s) {\n    if (!s.ok()) {\n      ss_ << \" \" << s.ToString();\n      ok_ = false;\n    }\n    return *this;\n  }\n\n#define BINARY_OP(name,op)                              \\\n  template <class X, class Y>                           \\\n  Tester& name(const X& x, const Y& y) {                \\\n    if (! (x op y)) {                                   \\\n      ss_ << \" failed: \" << x << (\" \" #op \" \") << y;    \\\n      ok_ = false;                                      \\\n    }                                                   \\\n    return *this;                                       \\\n  }\n\n  BINARY_OP(IsEq, ==)\n  BINARY_OP(IsNe, !=)\n  BINARY_OP(IsGe, >=)\n  BINARY_OP(IsGt, >)\n  BINARY_OP(IsLe, <=)\n  BINARY_OP(IsLt, <)\n#undef BINARY_OP\n\n  // Attach the specified value to the error message if an error has occurred\n  template <class V>\n  Tester& operator<<(const V& value) {\n    if (!ok_) {\n      ss_ << \" \" << value;\n    }\n    return *this;\n  }\n};\n\n#define ASSERT_TRUE(c) ::leveldb::test::Tester(__FILE__, __LINE__).Is((c), #c)\n#define ASSERT_OK(s) ::leveldb::test::Tester(__FILE__, __LINE__).IsOk((s))\n#define ASSERT_EQ(a,b) ::leveldb::test::Tester(__FILE__, __LINE__).IsEq((a),(b))\n#define ASSERT_NE(a,b) ::leveldb::test::Tester(__FILE__, __LINE__).IsNe((a),(b))\n#define ASSERT_GE(a,b) ::leveldb::test::Tester(__FILE__, __LINE__).IsGe((a),(b))\n#define ASSERT_GT(a,b) ::leveldb::test::Tester(__FILE__, __LINE__).IsGt((a),(b))\n#define ASSERT_LE(a,b) ::leveldb::test::Tester(__FILE__, __LINE__).IsLe((a),(b))\n#define ASSERT_LT(a,b) ::leveldb::test::Tester(__FILE__, __LINE__).IsLt((a),(b))\n\n#define TCONCAT(a,b) TCONCAT1(a,b)\n#define TCONCAT1(a,b) a##b\n\n#define TEST(base,name)                                                 \\\nclass TCONCAT(_Test_,name) : public base {                              \\\n public:                                                                \\\n  void _Run();                                                          \\\n  static void _RunIt() {                                                \\\n    TCONCAT(_Test_,name) t;                                             \\\n    t._Run();                                                           \\\n  }                                                                     \\\n};                                                                      \\\nbool TCONCAT(_Test_ignored_,name) =                                     \\\n  ::leveldb::test::RegisterTest(#base, #name, &TCONCAT(_Test_,name)::_RunIt); \\\nvoid TCONCAT(_Test_,name)::_Run()\n\n// Register the specified test.  Typically not used directly, but\n// invoked via the macro expansion of TEST.\nextern bool RegisterTest(const char* base, const char* name, void (*func)());\n\n\n}  // namespace test\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_UTIL_TESTHARNESS_H_\n"
  },
  {
    "path": "src/leveldb/util/testutil.cc",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#include \"util/testutil.h\"\n\n#include \"util/random.h\"\n\nnamespace leveldb {\nnamespace test {\n\nSlice RandomString(Random* rnd, int len, std::string* dst) {\n  dst->resize(len);\n  for (int i = 0; i < len; i++) {\n    (*dst)[i] = static_cast<char>(' ' + rnd->Uniform(95));   // ' ' .. '~'\n  }\n  return Slice(*dst);\n}\n\nstd::string RandomKey(Random* rnd, int len) {\n  // Make sure to generate a wide variety of characters so we\n  // test the boundary conditions for short-key optimizations.\n  static const char kTestChars[] = {\n    '\\0', '\\1', 'a', 'b', 'c', 'd', 'e', '\\xfd', '\\xfe', '\\xff'\n  };\n  std::string result;\n  for (int i = 0; i < len; i++) {\n    result += kTestChars[rnd->Uniform(sizeof(kTestChars))];\n  }\n  return result;\n}\n\n\nextern Slice CompressibleString(Random* rnd, double compressed_fraction,\n                                size_t len, std::string* dst) {\n  int raw = static_cast<int>(len * compressed_fraction);\n  if (raw < 1) raw = 1;\n  std::string raw_data;\n  RandomString(rnd, raw, &raw_data);\n\n  // Duplicate the random data until we have filled \"len\" bytes\n  dst->clear();\n  while (dst->size() < len) {\n    dst->append(raw_data);\n  }\n  dst->resize(len);\n  return Slice(*dst);\n}\n\n}  // namespace test\n}  // namespace leveldb\n"
  },
  {
    "path": "src/leveldb/util/testutil.h",
    "content": "// Copyright (c) 2011 The LevelDB Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file. See the AUTHORS file for names of contributors.\n\n#ifndef STORAGE_LEVELDB_UTIL_TESTUTIL_H_\n#define STORAGE_LEVELDB_UTIL_TESTUTIL_H_\n\n#include \"leveldb/env.h\"\n#include \"leveldb/slice.h\"\n#include \"util/random.h\"\n\nnamespace leveldb {\nnamespace test {\n\n// Store in *dst a random string of length \"len\" and return a Slice that\n// references the generated data.\nextern Slice RandomString(Random* rnd, int len, std::string* dst);\n\n// Return a random key with the specified length that may contain interesting\n// characters (e.g. \\x00, \\xff, etc.).\nextern std::string RandomKey(Random* rnd, int len);\n\n// Store in *dst a string of length \"len\" that will compress to\n// \"N*compressed_fraction\" bytes and return a Slice that references\n// the generated data.\nextern Slice CompressibleString(Random* rnd, double compressed_fraction,\n                                size_t len, std::string* dst);\n\n// A wrapper that allows injection of errors.\nclass ErrorEnv : public EnvWrapper {\n public:\n  bool writable_file_error_;\n  int num_writable_file_errors_;\n\n  ErrorEnv() : EnvWrapper(Env::Default()),\n               writable_file_error_(false),\n               num_writable_file_errors_(0) { }\n\n  virtual Status NewWritableFile(const std::string& fname,\n                                 WritableFile** result) {\n    if (writable_file_error_) {\n      ++num_writable_file_errors_;\n      *result = NULL;\n      return Status::IOError(fname, \"fake error\");\n    }\n    return target()->NewWritableFile(fname, result);\n  }\n\n  virtual Status NewAppendableFile(const std::string& fname,\n                                   WritableFile** result) {\n    if (writable_file_error_) {\n      ++num_writable_file_errors_;\n      *result = NULL;\n      return Status::IOError(fname, \"fake error\");\n    }\n    return target()->NewAppendableFile(fname, result);\n  }\n};\n\n}  // namespace test\n}  // namespace leveldb\n\n#endif  // STORAGE_LEVELDB_UTIL_TESTUTIL_H_\n"
  },
  {
    "path": "src/limitedmap.h",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_LIMITEDMAP_H\n#define BITCOIN_LIMITEDMAP_H\n\n#include <assert.h>\n#include <map>\n\n/** STL-like map container that only keeps the N elements with the highest value. */\ntemplate <typename K, typename V>\nclass limitedmap\n{\npublic:\n    typedef K key_type;\n    typedef V mapped_type;\n    typedef std::pair<const key_type, mapped_type> value_type;\n    typedef typename std::map<K, V>::const_iterator const_iterator;\n    typedef typename std::map<K, V>::size_type size_type;\n\nprotected:\n    std::map<K, V> map;\n    typedef typename std::map<K, V>::iterator iterator;\n    std::multimap<V, iterator> rmap;\n    typedef typename std::multimap<V, iterator>::iterator rmap_iterator;\n    size_type nMaxSize;\n\npublic:\n    explicit limitedmap(size_type nMaxSizeIn)\n    {\n        assert(nMaxSizeIn > 0);\n        nMaxSize = nMaxSizeIn;\n    }\n    const_iterator begin() const { return map.begin(); }\n    const_iterator end() const { return map.end(); }\n    size_type size() const { return map.size(); }\n    bool empty() const { return map.empty(); }\n    const_iterator find(const key_type& k) const { return map.find(k); }\n    size_type count(const key_type& k) const { return map.count(k); }\n    void insert(const value_type& x)\n    {\n        std::pair<iterator, bool> ret = map.insert(x);\n        if (ret.second) {\n            if (map.size() > nMaxSize) {\n                map.erase(rmap.begin()->second);\n                rmap.erase(rmap.begin());\n            }\n            rmap.insert(make_pair(x.second, ret.first));\n        }\n    }\n    void erase(const key_type& k)\n    {\n        iterator itTarget = map.find(k);\n        if (itTarget == map.end())\n            return;\n        std::pair<rmap_iterator, rmap_iterator> itPair = rmap.equal_range(itTarget->second);\n        for (rmap_iterator it = itPair.first; it != itPair.second; ++it)\n            if (it->second == itTarget) {\n                rmap.erase(it);\n                map.erase(itTarget);\n                return;\n            }\n        // Shouldn't ever get here\n        assert(0);\n    }\n    void update(const_iterator itIn, const mapped_type& v)\n    {\n        // Using map::erase() with empty range instead of map::find() to get a non-const iterator,\n        // since it is a constant time operation in C++11. For more details, see\n        // https://stackoverflow.com/questions/765148/how-to-remove-constness-of-const-iterator\n        iterator itTarget = map.erase(itIn, itIn);\n        \n        if (itTarget == map.end())\n            return;\n        std::pair<rmap_iterator, rmap_iterator> itPair = rmap.equal_range(itTarget->second);\n        for (rmap_iterator it = itPair.first; it != itPair.second; ++it)\n            if (it->second == itTarget) {\n                rmap.erase(it);\n                itTarget->second = v;\n                rmap.insert(make_pair(v, itTarget));\n                return;\n            }\n        // Shouldn't ever get here\n        assert(0);\n    }\n    size_type max_size() const { return nMaxSize; }\n    size_type max_size(size_type s)\n    {\n        assert(s > 0);\n        while (map.size() > s) {\n            map.erase(rmap.begin()->second);\n            rmap.erase(rmap.begin());\n        }\n        nMaxSize = s;\n        return nMaxSize;\n    }\n};\n\n#endif // BITCOIN_LIMITEDMAP_H\n"
  },
  {
    "path": "src/memusage.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_MEMUSAGE_H\n#define BITCOIN_MEMUSAGE_H\n\n#include <indirectmap.h>\n\n#include <stdlib.h>\n\n#include <map>\n#include <memory>\n#include <set>\n#include <vector>\n#include <unordered_map>\n#include <unordered_set>\n\n\nnamespace memusage\n{\n\n/** Compute the total memory used by allocating alloc bytes. */\nstatic size_t MallocUsage(size_t alloc);\n\n/** Dynamic memory usage for built-in types is zero. */\nstatic inline size_t DynamicUsage(const int8_t& v) { return 0; }\nstatic inline size_t DynamicUsage(const uint8_t& v) { return 0; }\nstatic inline size_t DynamicUsage(const int16_t& v) { return 0; }\nstatic inline size_t DynamicUsage(const uint16_t& v) { return 0; }\nstatic inline size_t DynamicUsage(const int32_t& v) { return 0; }\nstatic inline size_t DynamicUsage(const uint32_t& v) { return 0; }\nstatic inline size_t DynamicUsage(const int64_t& v) { return 0; }\nstatic inline size_t DynamicUsage(const uint64_t& v) { return 0; }\nstatic inline size_t DynamicUsage(const float& v) { return 0; }\nstatic inline size_t DynamicUsage(const double& v) { return 0; }\ntemplate<typename X> static inline size_t DynamicUsage(X * const &v) { return 0; }\ntemplate<typename X> static inline size_t DynamicUsage(const X * const &v) { return 0; }\n\n/** Compute the memory used for dynamically allocated but owned data structures.\n *  For generic data types, this is *not* recursive. DynamicUsage(vector<vector<int> >)\n *  will compute the memory used for the vector<int>'s, but not for the ints inside.\n *  This is for efficiency reasons, as these functions are intended to be fast. If\n *  application data structures require more accurate inner accounting, they should\n *  iterate themselves, or use more efficient caching + updating on modification.\n */\n\nstatic inline size_t MallocUsage(size_t alloc)\n{\n    // Measured on libc6 2.19 on Linux.\n    if (alloc == 0) {\n        return 0;\n    } else if (sizeof(void*) == 8) {\n        return ((alloc + 31) >> 4) << 4;\n    } else if (sizeof(void*) == 4) {\n        return ((alloc + 15) >> 3) << 3;\n    } else {\n        assert(0);\n    }\n}\n\n// STL data structures\n\ntemplate<typename X>\nstruct stl_tree_node\n{\nprivate:\n    int color;\n    void* parent;\n    void* left;\n    void* right;\n    X x;\n};\n\nstruct stl_shared_counter\n{\n    /* Various platforms use different sized counters here.\n     * Conservatively assume that they won't be larger than size_t. */\n    void* class_type;\n    size_t use_count;\n    size_t weak_count;\n};\n\ntemplate<typename X>\nstatic inline size_t DynamicUsage(const std::vector<X>& v)\n{\n    return MallocUsage(v.capacity() * sizeof(X));\n}\n\ntemplate<unsigned int N, typename X, typename S, typename D>\nstatic inline size_t DynamicUsage(const prevector<N, X, S, D>& v)\n{\n    return MallocUsage(v.allocated_memory());\n}\n\ntemplate<typename X, typename Y>\nstatic inline size_t DynamicUsage(const std::set<X, Y>& s)\n{\n    return MallocUsage(sizeof(stl_tree_node<X>)) * s.size();\n}\n\ntemplate<typename X, typename Y>\nstatic inline size_t IncrementalDynamicUsage(const std::set<X, Y>& s)\n{\n    return MallocUsage(sizeof(stl_tree_node<X>));\n}\n\ntemplate<typename X, typename Y, typename Z>\nstatic inline size_t DynamicUsage(const std::map<X, Y, Z>& m)\n{\n    return MallocUsage(sizeof(stl_tree_node<std::pair<const X, Y> >)) * m.size();\n}\n\ntemplate<typename X, typename Y, typename Z>\nstatic inline size_t IncrementalDynamicUsage(const std::map<X, Y, Z>& m)\n{\n    return MallocUsage(sizeof(stl_tree_node<std::pair<const X, Y> >));\n}\n\n// indirectmap has underlying map with pointer as key\n\ntemplate<typename X, typename Y>\nstatic inline size_t DynamicUsage(const indirectmap<X, Y>& m)\n{\n    return MallocUsage(sizeof(stl_tree_node<std::pair<const X*, Y> >)) * m.size();\n}\n\ntemplate<typename X, typename Y>\nstatic inline size_t IncrementalDynamicUsage(const indirectmap<X, Y>& m)\n{\n    return MallocUsage(sizeof(stl_tree_node<std::pair<const X*, Y> >));\n}\n\ntemplate<typename X>\nstatic inline size_t DynamicUsage(const std::unique_ptr<X>& p)\n{\n    return p ? MallocUsage(sizeof(X)) : 0;\n}\n\ntemplate<typename X>\nstatic inline size_t DynamicUsage(const std::shared_ptr<X>& p)\n{\n    // A shared_ptr can either use a single continuous memory block for both\n    // the counter and the storage (when using std::make_shared), or separate.\n    // We can't observe the difference, however, so assume the worst.\n    return p ? MallocUsage(sizeof(X)) + MallocUsage(sizeof(stl_shared_counter)) : 0;\n}\n\ntemplate<typename X>\nstruct unordered_node : private X\n{\nprivate:\n    void* ptr;\n};\n\ntemplate<typename X, typename Y>\nstatic inline size_t DynamicUsage(const std::unordered_set<X, Y>& s)\n{\n    return MallocUsage(sizeof(unordered_node<X>)) * s.size() + MallocUsage(sizeof(void*) * s.bucket_count());\n}\n\ntemplate<typename X, typename Y, typename Z>\nstatic inline size_t DynamicUsage(const std::unordered_map<X, Y, Z>& m)\n{\n    return MallocUsage(sizeof(unordered_node<std::pair<const X, Y> >)) * m.size() + MallocUsage(sizeof(void*) * m.bucket_count());\n}\n\n}\n\n#endif // BITCOIN_MEMUSAGE_H\n"
  },
  {
    "path": "src/merkleblock.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <merkleblock.h>\n\n#include <hash.h>\n#include <consensus/consensus.h>\n#include <utilstrencodings.h>\n\n\nCMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter* filter, const std::set<uint256>* txids)\n{\n    header = block.GetBlockHeader();\n\n    std::vector<bool> vMatch;\n    std::vector<uint256> vHashes;\n\n    vMatch.reserve(block.vtx.size());\n    vHashes.reserve(block.vtx.size());\n\n    for (unsigned int i = 0; i < block.vtx.size(); i++)\n    {\n        const uint256& hash = block.vtx[i]->GetHash();\n        if (txids && txids->count(hash)) {\n            vMatch.push_back(true);\n        } else if (filter && filter->IsRelevantAndUpdate(*block.vtx[i])) {\n            vMatch.push_back(true);\n            vMatchedTxn.emplace_back(i, hash);\n        } else {\n            vMatch.push_back(false);\n        }\n        vHashes.push_back(hash);\n    }\n\n    txn = CPartialMerkleTree(vHashes, vMatch);\n}\n\nuint256 CPartialMerkleTree::CalcHash(int height, unsigned int pos, const std::vector<uint256> &vTxid) {\n    //we can never have zero txs in a merkle block, we always need the coinbase tx\n    //if we do not have this assert, we can hit a memory access violation when indexing into vTxid\n    assert(vTxid.size() != 0);\n    if (height == 0) {\n        // hash at height 0 is the txids themself\n        return vTxid[pos];\n    } else {\n        // calculate left hash\n        uint256 left = CalcHash(height-1, pos*2, vTxid), right;\n        // calculate right hash if not beyond the end of the array - copy left hash otherwise\n        if (pos*2+1 < CalcTreeWidth(height-1))\n            right = CalcHash(height-1, pos*2+1, vTxid);\n        else\n            right = left;\n        // combine subhashes\n        return Hash(BEGIN(left), END(left), BEGIN(right), END(right));\n    }\n}\n\nvoid CPartialMerkleTree::TraverseAndBuild(int height, unsigned int pos, const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch) {\n    // determine whether this node is the parent of at least one matched txid\n    bool fParentOfMatch = false;\n    for (unsigned int p = pos << height; p < (pos+1) << height && p < nTransactions; p++)\n        fParentOfMatch |= vMatch[p];\n    // store as flag bit\n    vBits.push_back(fParentOfMatch);\n    if (height==0 || !fParentOfMatch) {\n        // if at height 0, or nothing interesting below, store hash and stop\n        vHash.push_back(CalcHash(height, pos, vTxid));\n    } else {\n        // otherwise, don't store any hash, but descend into the subtrees\n        TraverseAndBuild(height-1, pos*2, vTxid, vMatch);\n        if (pos*2+1 < CalcTreeWidth(height-1))\n            TraverseAndBuild(height-1, pos*2+1, vTxid, vMatch);\n    }\n}\n\nuint256 CPartialMerkleTree::TraverseAndExtract(int height, unsigned int pos, unsigned int &nBitsUsed, unsigned int &nHashUsed, std::vector<uint256> &vMatch, std::vector<unsigned int> &vnIndex) {\n    if (nBitsUsed >= vBits.size()) {\n        // overflowed the bits array - failure\n        fBad = true;\n        return uint256();\n    }\n    bool fParentOfMatch = vBits[nBitsUsed++];\n    if (height==0 || !fParentOfMatch) {\n        // if at height 0, or nothing interesting below, use stored hash and do not descend\n        if (nHashUsed >= vHash.size()) {\n            // overflowed the hash array - failure\n            fBad = true;\n            return uint256();\n        }\n        const uint256 &hash = vHash[nHashUsed++];\n        if (height==0 && fParentOfMatch) { // in case of height 0, we have a matched txid\n            vMatch.push_back(hash);\n            vnIndex.push_back(pos);\n        }\n        return hash;\n    } else {\n        // otherwise, descend into the subtrees to extract matched txids and hashes\n        uint256 left = TraverseAndExtract(height-1, pos*2, nBitsUsed, nHashUsed, vMatch, vnIndex), right;\n        if (pos*2+1 < CalcTreeWidth(height-1)) {\n            right = TraverseAndExtract(height-1, pos*2+1, nBitsUsed, nHashUsed, vMatch, vnIndex);\n            if (right == left) {\n                // The left and right branches should never be identical, as the transaction\n                // hashes covered by them must each be unique.\n                fBad = true;\n            }\n        } else {\n            right = left;\n        }\n        // and combine them before returning\n        return Hash(BEGIN(left), END(left), BEGIN(right), END(right));\n    }\n}\n\nCPartialMerkleTree::CPartialMerkleTree(const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch) : nTransactions(vTxid.size()), fBad(false) {\n    // reset state\n    vBits.clear();\n    vHash.clear();\n\n    // calculate height of tree\n    int nHeight = 0;\n    while (CalcTreeWidth(nHeight) > 1)\n        nHeight++;\n\n    // traverse the partial tree\n    TraverseAndBuild(nHeight, 0, vTxid, vMatch);\n}\n\nCPartialMerkleTree::CPartialMerkleTree() : nTransactions(0), fBad(true) {}\n\nuint256 CPartialMerkleTree::ExtractMatches(std::vector<uint256> &vMatch, std::vector<unsigned int> &vnIndex) {\n    vMatch.clear();\n    // An empty set will not work\n    if (nTransactions == 0)\n        return uint256();\n    // check for excessively high numbers of transactions\n    if (nTransactions > MAX_BLOCK_WEIGHT / MIN_TRANSACTION_WEIGHT)\n        return uint256();\n    // there can never be more hashes provided than one for every txid\n    if (vHash.size() > nTransactions)\n        return uint256();\n    // there must be at least one bit per node in the partial tree, and at least one node per hash\n    if (vBits.size() < vHash.size())\n        return uint256();\n    // calculate height of tree\n    int nHeight = 0;\n    while (CalcTreeWidth(nHeight) > 1)\n        nHeight++;\n    // traverse the partial tree\n    unsigned int nBitsUsed = 0, nHashUsed = 0;\n    uint256 hashMerkleRoot = TraverseAndExtract(nHeight, 0, nBitsUsed, nHashUsed, vMatch, vnIndex);\n    // verify that no problems occurred during the tree traversal\n    if (fBad)\n        return uint256();\n    // verify that all bits were consumed (except for the padding caused by serializing it as a byte sequence)\n    if ((nBitsUsed+7)/8 != (vBits.size()+7)/8)\n        return uint256();\n    // verify that all hashes were consumed\n    if (nHashUsed != vHash.size())\n        return uint256();\n    return hashMerkleRoot;\n}\n"
  },
  {
    "path": "src/merkleblock.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_MERKLEBLOCK_H\n#define BITCOIN_MERKLEBLOCK_H\n\n#include <serialize.h>\n#include <uint256.h>\n#include <primitives/block.h>\n#include <bloom.h>\n\n#include <vector>\n\n/** Data structure that represents a partial merkle tree.\n *\n * It represents a subset of the txid's of a known block, in a way that\n * allows recovery of the list of txid's and the merkle root, in an\n * authenticated way.\n *\n * The encoding works as follows: we traverse the tree in depth-first order,\n * storing a bit for each traversed node, signifying whether the node is the\n * parent of at least one matched leaf txid (or a matched txid itself). In\n * case we are at the leaf level, or this bit is 0, its merkle node hash is\n * stored, and its children are not explored further. Otherwise, no hash is\n * stored, but we recurse into both (or the only) child branch. During\n * decoding, the same depth-first traversal is performed, consuming bits and\n * hashes as they written during encoding.\n *\n * The serialization is fixed and provides a hard guarantee about the\n * encoded size:\n *\n *   SIZE <= 10 + ceil(32.25*N)\n *\n * Where N represents the number of leaf nodes of the partial tree. N itself\n * is bounded by:\n *\n *   N <= total_transactions\n *   N <= 1 + matched_transactions*tree_height\n *\n * The serialization format:\n *  - uint32     total_transactions (4 bytes)\n *  - varint     number of hashes   (1-3 bytes)\n *  - uint256[]  hashes in depth-first order (<= 32*N bytes)\n *  - varint     number of bytes of flag bits (1-3 bytes)\n *  - byte[]     flag bits, packed per 8 in a byte, least significant bit first (<= 2*N-1 bits)\n * The size constraints follow from this.\n */\nclass CPartialMerkleTree\n{\nprotected:\n    /** the total number of transactions in the block */\n    unsigned int nTransactions;\n\n    /** node-is-parent-of-matched-txid bits */\n    std::vector<bool> vBits;\n\n    /** txids and internal hashes */\n    std::vector<uint256> vHash;\n\n    /** flag set when encountering invalid data */\n    bool fBad;\n\n    /** helper function to efficiently calculate the number of nodes at given height in the merkle tree */\n    unsigned int CalcTreeWidth(int height) const {\n        return (nTransactions+(1 << height)-1) >> height;\n    }\n\n    /** calculate the hash of a node in the merkle tree (at leaf level: the txid's themselves) */\n    uint256 CalcHash(int height, unsigned int pos, const std::vector<uint256> &vTxid);\n\n    /** recursive function that traverses tree nodes, storing the data as bits and hashes */\n    void TraverseAndBuild(int height, unsigned int pos, const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch);\n\n    /**\n     * recursive function that traverses tree nodes, consuming the bits and hashes produced by TraverseAndBuild.\n     * it returns the hash of the respective node and its respective index.\n     */\n    uint256 TraverseAndExtract(int height, unsigned int pos, unsigned int &nBitsUsed, unsigned int &nHashUsed, std::vector<uint256> &vMatch, std::vector<unsigned int> &vnIndex);\n\npublic:\n\n    /** serialization implementation */\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(nTransactions);\n        READWRITE(vHash);\n        std::vector<unsigned char> vBytes;\n        if (ser_action.ForRead()) {\n            READWRITE(vBytes);\n            CPartialMerkleTree &us = *(const_cast<CPartialMerkleTree*>(this));\n            us.vBits.resize(vBytes.size() * 8);\n            for (unsigned int p = 0; p < us.vBits.size(); p++)\n                us.vBits[p] = (vBytes[p / 8] & (1 << (p % 8))) != 0;\n            us.fBad = false;\n        } else {\n            vBytes.resize((vBits.size()+7)/8);\n            for (unsigned int p = 0; p < vBits.size(); p++)\n                vBytes[p / 8] |= vBits[p] << (p % 8);\n            READWRITE(vBytes);\n        }\n    }\n\n    /** Construct a partial merkle tree from a list of transaction ids, and a mask that selects a subset of them */\n    CPartialMerkleTree(const std::vector<uint256> &vTxid, const std::vector<bool> &vMatch);\n\n    CPartialMerkleTree();\n\n    /**\n     * extract the matching txid's represented by this partial merkle tree\n     * and their respective indices within the partial tree.\n     * returns the merkle root, or 0 in case of failure\n     */\n    uint256 ExtractMatches(std::vector<uint256> &vMatch, std::vector<unsigned int> &vnIndex);\n\n    /** Get number of transactions the merkle proof is indicating for cross-reference with\n     * local blockchain knowledge.\n     */\n    unsigned int GetNumTransactions() const { return nTransactions; };\n\n};\n\n\n/**\n * Used to relay blocks as header + vector<merkle branch>\n * to filtered nodes.\n *\n * NOTE: The class assumes that the given CBlock has *at least* 1 transaction. If the CBlock has 0 txs, it will hit an assertion.\n */\nclass CMerkleBlock\n{\npublic:\n    /** Public only for unit testing */\n    CBlockHeader header;\n    CPartialMerkleTree txn;\n\n    /**\n     * Public only for unit testing and relay testing (not relayed).\n     *\n     * Used only when a bloom filter is specified to allow\n     * testing the transactions which matched the bloom filter.\n     */\n    std::vector<std::pair<unsigned int, uint256> > vMatchedTxn;\n\n    /**\n     * Create from a CBlock, filtering transactions according to filter\n     * Note that this will call IsRelevantAndUpdate on the filter for each transaction,\n     * thus the filter will likely be modified.\n     */\n    CMerkleBlock(const CBlock& block, CBloomFilter& filter) : CMerkleBlock(block, &filter, nullptr) { }\n\n    // Create from a CBlock, matching the txids in the set\n    CMerkleBlock(const CBlock& block, const std::set<uint256>& txids) : CMerkleBlock(block, nullptr, &txids) { }\n\n    CMerkleBlock() {}\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(header);\n        READWRITE(txn);\n    }\n\nprivate:\n    // Combined constructor to consolidate code\n    CMerkleBlock(const CBlock& block, CBloomFilter* filter, const std::set<uint256>* txids);\n};\n\n#endif // BITCOIN_MERKLEBLOCK_H\n"
  },
  {
    "path": "src/miner.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <miner.h>\n\n#include <amount.h>\n#include <chain.h>\n#include <chainparams.h>\n#include <coins.h>\n#include <consensus/consensus.h>\n#include <consensus/tx_verify.h>\n#include <consensus/merkle.h>\n#include <consensus/validation.h>\n#include <hash.h>\n#include <validation.h>\n#include <net.h>\n#include <policy/feerate.h>\n#include <policy/policy.h>\n#include <pow.h>\n#include <primitives/transaction.h>\n#include <script/standard.h>\n#include <timedata.h>\n#include <util.h>\n#include <utilmoneystr.h>\n#include <validationinterface.h>\n\n#include <algorithm>\n#include <memory>\n#include <queue>\n#include <utility>\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// BitcoinMiner\n//\n\n//\n// Unconfirmed transactions in the memory pool often depend on other\n// transactions in the memory pool. When we select transactions from the\n// pool, we select by highest fee rate of a transaction combined with all\n// its ancestors.\n\nuint64_t nLastBlockTx = 0;\nuint64_t nLastBlockWeight = 0;\n\nint64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)\n{\n    int64_t nOldTime = pblock->nTime;\n    int64_t nNewTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());\n\n    if (nOldTime < nNewTime)\n        pblock->nTime = nNewTime;\n\n    // Updating time can change work required on testnet:\n    if (consensusParams.fPowAllowMinDifficultyBlocks)\n        pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, consensusParams);\n\n    return nNewTime - nOldTime;\n}\n\nBlockAssembler::Options::Options() {\n    blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE);\n    nBlockMaxWeight = DEFAULT_BLOCK_MAX_WEIGHT;\n}\n\nBlockAssembler::BlockAssembler(const CChainParams& params, const Options& options) : chainparams(params)\n{\n    blockMinFeeRate = options.blockMinFeeRate;\n    // Limit weight to between 4K and MAX_BLOCK_WEIGHT-4K for sanity:\n    nBlockMaxWeight = std::max<size_t>(4000, std::min<size_t>(MAX_BLOCK_WEIGHT - 4000, options.nBlockMaxWeight));\n}\n\nstatic BlockAssembler::Options DefaultOptions(const CChainParams& params)\n{\n    // Block resource limits\n    // If -blockmaxweight is not given, limit to DEFAULT_BLOCK_MAX_WEIGHT\n    BlockAssembler::Options options;\n    options.nBlockMaxWeight = gArgs.GetArg(\"-blockmaxweight\", DEFAULT_BLOCK_MAX_WEIGHT);\n    if (gArgs.IsArgSet(\"-blockmintxfee\")) {\n        CAmount n = 0;\n        ParseMoney(gArgs.GetArg(\"-blockmintxfee\", \"\"), n);\n        options.blockMinFeeRate = CFeeRate(n);\n    } else {\n        options.blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE);\n    }\n    return options;\n}\n\nBlockAssembler::BlockAssembler(const CChainParams& params) : BlockAssembler(params, DefaultOptions(params)) {}\n\nvoid BlockAssembler::resetBlock()\n{\n    inBlock.clear();\n\n    // Reserve space for coinbase tx\n    nBlockWeight = 4000;\n    nBlockSigOpsCost = 400;\n    fIncludeWitness = false;\n\n    // These counters do not include coinbase tx\n    nBlockTx = 0;\n    nFees = 0;\n}\n\nstd::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn, bool fMineWitnessTx)\n{\n    int64_t nTimeStart = GetTimeMicros();\n\n    resetBlock();\n\n    pblocktemplate.reset(new CBlockTemplate());\n\n    if(!pblocktemplate.get())\n        return nullptr;\n    pblock = &pblocktemplate->block; // pointer for convenience\n\n    // Add dummy coinbase tx as first transaction\n    pblock->vtx.emplace_back();\n    pblocktemplate->vTxFees.push_back(-1); // updated at end\n    pblocktemplate->vTxSigOpsCost.push_back(-1); // updated at end\n\n    LOCK2(cs_main, mempool.cs);\n    CBlockIndex* pindexPrev = chainActive.Tip();\n    assert(pindexPrev != nullptr);\n    nHeight = pindexPrev->nHeight + 1;\n\n    pblock->nVersion = ComputeBlockVersion(pindexPrev, chainparams.GetConsensus());\n    // -regtest only: allow overriding block.nVersion with\n    // -blockversion=N to test forking scenarios\n    if (chainparams.MineBlocksOnDemand())\n        pblock->nVersion = gArgs.GetArg(\"-blockversion\", pblock->nVersion);\n\n    pblock->nTime = GetAdjustedTime();\n    const int64_t nMedianTimePast = pindexPrev->GetMedianTimePast();\n\n    nLockTimeCutoff = (STANDARD_LOCKTIME_VERIFY_FLAGS & LOCKTIME_MEDIAN_TIME_PAST)\n                       ? nMedianTimePast\n                       : pblock->GetBlockTime();\n\n    // Decide whether to include witness transactions\n    // This is only needed in case the witness softfork activation is reverted\n    // (which would require a very deep reorganization) or when\n    // -promiscuousmempoolflags is used.\n    // TODO: replace this with a call to main to assess validity of a mempool\n    // transaction (which in most cases can be a no-op).\n    fIncludeWitness = IsWitnessEnabled(pindexPrev, chainparams.GetConsensus()) && fMineWitnessTx;\n\n    int nPackagesSelected = 0;\n    int nDescendantsUpdated = 0;\n    addPackageTxs(nPackagesSelected, nDescendantsUpdated);\n\n    int64_t nTime1 = GetTimeMicros();\n\n    nLastBlockTx = nBlockTx;\n    nLastBlockWeight = nBlockWeight;\n\n    // Create coinbase transaction.\n    CMutableTransaction coinbaseTx;\n    coinbaseTx.vin.resize(1);\n    coinbaseTx.vin[0].prevout.SetNull();\n    coinbaseTx.vout.resize(1);\n    coinbaseTx.vout[0].scriptPubKey = scriptPubKeyIn;\n    coinbaseTx.vout[0].nValue = nFees + GetBlockSubsidy(nHeight, chainparams.GetConsensus());\n    coinbaseTx.vin[0].scriptSig = CScript() << nHeight << OP_0;\n    pblock->vtx[0] = MakeTransactionRef(std::move(coinbaseTx));\n    pblocktemplate->vchCoinbaseCommitment = GenerateCoinbaseCommitment(*pblock, pindexPrev, chainparams.GetConsensus());\n    pblocktemplate->vTxFees[0] = -nFees;\n\n    LogPrintf(\"CreateNewBlock(): block weight: %u txs: %u fees: %ld sigops %d\\n\", GetBlockWeight(*pblock), nBlockTx, nFees, nBlockSigOpsCost);\n\n    // Fill in header\n    pblock->hashPrevBlock  = pindexPrev->GetBlockHash();\n    UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev);\n    pblock->nBits          = GetNextWorkRequired(pindexPrev, pblock, chainparams.GetConsensus());\n    pblock->nNonce         = 0;\n    pblocktemplate->vTxSigOpsCost[0] = WITNESS_SCALE_FACTOR * GetLegacySigOpCount(*pblock->vtx[0]);\n\n    CValidationState state;\n    if (!TestBlockValidity(state, chainparams, *pblock, pindexPrev, false, false)) {\n        throw std::runtime_error(strprintf(\"%s: TestBlockValidity failed: %s\", __func__, FormatStateMessage(state)));\n    }\n    int64_t nTime2 = GetTimeMicros();\n\n    LogPrint(BCLog::BENCH, \"CreateNewBlock() packages: %.2fms (%d packages, %d updated descendants), validity: %.2fms (total %.2fms)\\n\", 0.001 * (nTime1 - nTimeStart), nPackagesSelected, nDescendantsUpdated, 0.001 * (nTime2 - nTime1), 0.001 * (nTime2 - nTimeStart));\n\n    return std::move(pblocktemplate);\n}\n\nvoid BlockAssembler::onlyUnconfirmed(CTxMemPool::setEntries& testSet)\n{\n    for (CTxMemPool::setEntries::iterator iit = testSet.begin(); iit != testSet.end(); ) {\n        // Only test txs not already in the block\n        if (inBlock.count(*iit)) {\n            testSet.erase(iit++);\n        }\n        else {\n            iit++;\n        }\n    }\n}\n\nbool BlockAssembler::TestPackage(uint64_t packageSize, int64_t packageSigOpsCost) const\n{\n    // TODO: switch to weight-based accounting for packages instead of vsize-based accounting.\n    if (nBlockWeight + WITNESS_SCALE_FACTOR * packageSize >= nBlockMaxWeight)\n        return false;\n    if (nBlockSigOpsCost + packageSigOpsCost >= MAX_BLOCK_SIGOPS_COST)\n        return false;\n    return true;\n}\n\n// Perform transaction-level checks before adding to block:\n// - transaction finality (locktime)\n// - premature witness (in case segwit transactions are added to mempool before\n//   segwit activation)\nbool BlockAssembler::TestPackageTransactions(const CTxMemPool::setEntries& package)\n{\n    for (const CTxMemPool::txiter it : package) {\n        if (!IsFinalTx(it->GetTx(), nHeight, nLockTimeCutoff))\n            return false;\n        if (!fIncludeWitness && it->GetTx().HasWitness())\n            return false;\n    }\n    return true;\n}\n\nvoid BlockAssembler::AddToBlock(CTxMemPool::txiter iter)\n{\n    pblock->vtx.emplace_back(iter->GetSharedTx());\n    pblocktemplate->vTxFees.push_back(iter->GetFee());\n    pblocktemplate->vTxSigOpsCost.push_back(iter->GetSigOpCost());\n    nBlockWeight += iter->GetTxWeight();\n    ++nBlockTx;\n    nBlockSigOpsCost += iter->GetSigOpCost();\n    nFees += iter->GetFee();\n    inBlock.insert(iter);\n\n    bool fPrintPriority = gArgs.GetBoolArg(\"-printpriority\", DEFAULT_PRINTPRIORITY);\n    if (fPrintPriority) {\n        LogPrintf(\"fee %s txid %s\\n\",\n                  CFeeRate(iter->GetModifiedFee(), iter->GetTxSize()).ToString(),\n                  iter->GetTx().GetHash().ToString());\n    }\n}\n\nint BlockAssembler::UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded,\n        indexed_modified_transaction_set &mapModifiedTx)\n{\n    int nDescendantsUpdated = 0;\n    for (const CTxMemPool::txiter it : alreadyAdded) {\n        CTxMemPool::setEntries descendants;\n        mempool.CalculateDescendants(it, descendants);\n        // Insert all descendants (not yet in block) into the modified set\n        for (CTxMemPool::txiter desc : descendants) {\n            if (alreadyAdded.count(desc))\n                continue;\n            ++nDescendantsUpdated;\n            modtxiter mit = mapModifiedTx.find(desc);\n            if (mit == mapModifiedTx.end()) {\n                CTxMemPoolModifiedEntry modEntry(desc);\n                modEntry.nSizeWithAncestors -= it->GetTxSize();\n                modEntry.nModFeesWithAncestors -= it->GetModifiedFee();\n                modEntry.nSigOpCostWithAncestors -= it->GetSigOpCost();\n                mapModifiedTx.insert(modEntry);\n            } else {\n                mapModifiedTx.modify(mit, update_for_parent_inclusion(it));\n            }\n        }\n    }\n    return nDescendantsUpdated;\n}\n\n// Skip entries in mapTx that are already in a block or are present\n// in mapModifiedTx (which implies that the mapTx ancestor state is\n// stale due to ancestor inclusion in the block)\n// Also skip transactions that we've already failed to add. This can happen if\n// we consider a transaction in mapModifiedTx and it fails: we can then\n// potentially consider it again while walking mapTx.  It's currently\n// guaranteed to fail again, but as a belt-and-suspenders check we put it in\n// failedTx and avoid re-evaluation, since the re-evaluation would be using\n// cached size/sigops/fee values that are not actually correct.\nbool BlockAssembler::SkipMapTxEntry(CTxMemPool::txiter it, indexed_modified_transaction_set &mapModifiedTx, CTxMemPool::setEntries &failedTx)\n{\n    assert (it != mempool.mapTx.end());\n    return mapModifiedTx.count(it) || inBlock.count(it) || failedTx.count(it);\n}\n\nvoid BlockAssembler::SortForBlock(const CTxMemPool::setEntries& package, CTxMemPool::txiter entry, std::vector<CTxMemPool::txiter>& sortedEntries)\n{\n    // Sort package by ancestor count\n    // If a transaction A depends on transaction B, then A's ancestor count\n    // must be greater than B's.  So this is sufficient to validly order the\n    // transactions for block inclusion.\n    sortedEntries.clear();\n    sortedEntries.insert(sortedEntries.begin(), package.begin(), package.end());\n    std::sort(sortedEntries.begin(), sortedEntries.end(), CompareTxIterByAncestorCount());\n}\n\n// This transaction selection algorithm orders the mempool based\n// on feerate of a transaction including all unconfirmed ancestors.\n// Since we don't remove transactions from the mempool as we select them\n// for block inclusion, we need an alternate method of updating the feerate\n// of a transaction with its not-yet-selected ancestors as we go.\n// This is accomplished by walking the in-mempool descendants of selected\n// transactions and storing a temporary modified state in mapModifiedTxs.\n// Each time through the loop, we compare the best transaction in\n// mapModifiedTxs with the next transaction in the mempool to decide what\n// transaction package to work on next.\nvoid BlockAssembler::addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated)\n{\n    // mapModifiedTx will store sorted packages after they are modified\n    // because some of their txs are already in the block\n    indexed_modified_transaction_set mapModifiedTx;\n    // Keep track of entries that failed inclusion, to avoid duplicate work\n    CTxMemPool::setEntries failedTx;\n\n    // Start by adding all descendants of previously added txs to mapModifiedTx\n    // and modifying them for their already included ancestors\n    UpdatePackagesForAdded(inBlock, mapModifiedTx);\n\n    CTxMemPool::indexed_transaction_set::index<ancestor_score>::type::iterator mi = mempool.mapTx.get<ancestor_score>().begin();\n    CTxMemPool::txiter iter;\n\n    // Limit the number of attempts to add transactions to the block when it is\n    // close to full; this is just a simple heuristic to finish quickly if the\n    // mempool has a lot of entries.\n    const int64_t MAX_CONSECUTIVE_FAILURES = 1000;\n    int64_t nConsecutiveFailed = 0;\n\n    while (mi != mempool.mapTx.get<ancestor_score>().end() || !mapModifiedTx.empty())\n    {\n        // First try to find a new transaction in mapTx to evaluate.\n        if (mi != mempool.mapTx.get<ancestor_score>().end() &&\n                SkipMapTxEntry(mempool.mapTx.project<0>(mi), mapModifiedTx, failedTx)) {\n            ++mi;\n            continue;\n        }\n\n        // Now that mi is not stale, determine which transaction to evaluate:\n        // the next entry from mapTx, or the best from mapModifiedTx?\n        bool fUsingModified = false;\n\n        modtxscoreiter modit = mapModifiedTx.get<ancestor_score>().begin();\n        if (mi == mempool.mapTx.get<ancestor_score>().end()) {\n            // We're out of entries in mapTx; use the entry from mapModifiedTx\n            iter = modit->iter;\n            fUsingModified = true;\n        } else {\n            // Try to compare the mapTx entry to the mapModifiedTx entry\n            iter = mempool.mapTx.project<0>(mi);\n            if (modit != mapModifiedTx.get<ancestor_score>().end() &&\n                    CompareTxMemPoolEntryByAncestorFee()(*modit, CTxMemPoolModifiedEntry(iter))) {\n                // The best entry in mapModifiedTx has higher score\n                // than the one from mapTx.\n                // Switch which transaction (package) to consider\n                iter = modit->iter;\n                fUsingModified = true;\n            } else {\n                // Either no entry in mapModifiedTx, or it's worse than mapTx.\n                // Increment mi for the next loop iteration.\n                ++mi;\n            }\n        }\n\n        // We skip mapTx entries that are inBlock, and mapModifiedTx shouldn't\n        // contain anything that is inBlock.\n        assert(!inBlock.count(iter));\n\n        uint64_t packageSize = iter->GetSizeWithAncestors();\n        CAmount packageFees = iter->GetModFeesWithAncestors();\n        int64_t packageSigOpsCost = iter->GetSigOpCostWithAncestors();\n        if (fUsingModified) {\n            packageSize = modit->nSizeWithAncestors;\n            packageFees = modit->nModFeesWithAncestors;\n            packageSigOpsCost = modit->nSigOpCostWithAncestors;\n        }\n\n        if (packageFees < blockMinFeeRate.GetFee(packageSize)) {\n            // Everything else we might consider has a lower fee rate\n            return;\n        }\n\n        if (!TestPackage(packageSize, packageSigOpsCost)) {\n            if (fUsingModified) {\n                // Since we always look at the best entry in mapModifiedTx,\n                // we must erase failed entries so that we can consider the\n                // next best entry on the next loop iteration\n                mapModifiedTx.get<ancestor_score>().erase(modit);\n                failedTx.insert(iter);\n            }\n\n            ++nConsecutiveFailed;\n\n            if (nConsecutiveFailed > MAX_CONSECUTIVE_FAILURES && nBlockWeight >\n                    nBlockMaxWeight - 4000) {\n                // Give up if we're close to full and haven't succeeded in a while\n                break;\n            }\n            continue;\n        }\n\n        CTxMemPool::setEntries ancestors;\n        uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();\n        std::string dummy;\n        mempool.CalculateMemPoolAncestors(*iter, ancestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy, false);\n\n        onlyUnconfirmed(ancestors);\n        ancestors.insert(iter);\n\n        // Test if all tx's are Final\n        if (!TestPackageTransactions(ancestors)) {\n            if (fUsingModified) {\n                mapModifiedTx.get<ancestor_score>().erase(modit);\n                failedTx.insert(iter);\n            }\n            continue;\n        }\n\n        // This transaction will make it in; reset the failed counter.\n        nConsecutiveFailed = 0;\n\n        // Package can be added. Sort the entries in a valid order.\n        std::vector<CTxMemPool::txiter> sortedEntries;\n        SortForBlock(ancestors, iter, sortedEntries);\n\n        for (size_t i=0; i<sortedEntries.size(); ++i) {\n            AddToBlock(sortedEntries[i]);\n            // Erase from the modified set, if present\n            mapModifiedTx.erase(sortedEntries[i]);\n        }\n\n        ++nPackagesSelected;\n\n        // Update transactions that depend on each of these\n        nDescendantsUpdated += UpdatePackagesForAdded(ancestors, mapModifiedTx);\n    }\n}\n\nvoid IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce)\n{\n    // Update nExtraNonce\n    static uint256 hashPrevBlock;\n    if (hashPrevBlock != pblock->hashPrevBlock)\n    {\n        nExtraNonce = 0;\n        hashPrevBlock = pblock->hashPrevBlock;\n    }\n    ++nExtraNonce;\n    unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2\n    CMutableTransaction txCoinbase(*pblock->vtx[0]);\n    txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS;\n    assert(txCoinbase.vin[0].scriptSig.size() <= 100);\n\n    pblock->vtx[0] = MakeTransactionRef(std::move(txCoinbase));\n    pblock->hashMerkleRoot = BlockMerkleRoot(*pblock);\n}\n"
  },
  {
    "path": "src/miner.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_MINER_H\n#define BITCOIN_MINER_H\n\n#include <primitives/block.h>\n#include <txmempool.h>\n\n#include <stdint.h>\n#include <memory>\n#include <boost/multi_index_container.hpp>\n#include <boost/multi_index/ordered_index.hpp>\n\nclass CBlockIndex;\nclass CChainParams;\nclass CScript;\n\nnamespace Consensus { struct Params; };\n\nstatic const bool DEFAULT_PRINTPRIORITY = false;\n\nstruct CBlockTemplate\n{\n    CBlock block;\n    std::vector<CAmount> vTxFees;\n    std::vector<int64_t> vTxSigOpsCost;\n    std::vector<unsigned char> vchCoinbaseCommitment;\n};\n\n// Container for tracking updates to ancestor feerate as we include (parent)\n// transactions in a block\nstruct CTxMemPoolModifiedEntry {\n    explicit CTxMemPoolModifiedEntry(CTxMemPool::txiter entry)\n    {\n        iter = entry;\n        nSizeWithAncestors = entry->GetSizeWithAncestors();\n        nModFeesWithAncestors = entry->GetModFeesWithAncestors();\n        nSigOpCostWithAncestors = entry->GetSigOpCostWithAncestors();\n    }\n\n    int64_t GetModifiedFee() const { return iter->GetModifiedFee(); }\n    uint64_t GetSizeWithAncestors() const { return nSizeWithAncestors; }\n    CAmount GetModFeesWithAncestors() const { return nModFeesWithAncestors; }\n    size_t GetTxSize() const { return iter->GetTxSize(); }\n    const CTransaction& GetTx() const { return iter->GetTx(); }\n\n    CTxMemPool::txiter iter;\n    uint64_t nSizeWithAncestors;\n    CAmount nModFeesWithAncestors;\n    int64_t nSigOpCostWithAncestors;\n};\n\n/** Comparator for CTxMemPool::txiter objects.\n *  It simply compares the internal memory address of the CTxMemPoolEntry object\n *  pointed to. This means it has no meaning, and is only useful for using them\n *  as key in other indexes.\n */\nstruct CompareCTxMemPoolIter {\n    bool operator()(const CTxMemPool::txiter& a, const CTxMemPool::txiter& b) const\n    {\n        return &(*a) < &(*b);\n    }\n};\n\nstruct modifiedentry_iter {\n    typedef CTxMemPool::txiter result_type;\n    result_type operator() (const CTxMemPoolModifiedEntry &entry) const\n    {\n        return entry.iter;\n    }\n};\n\n// A comparator that sorts transactions based on number of ancestors.\n// This is sufficient to sort an ancestor package in an order that is valid\n// to appear in a block.\nstruct CompareTxIterByAncestorCount {\n    bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b) const\n    {\n        if (a->GetCountWithAncestors() != b->GetCountWithAncestors())\n            return a->GetCountWithAncestors() < b->GetCountWithAncestors();\n        return CTxMemPool::CompareIteratorByHash()(a, b);\n    }\n};\n\ntypedef boost::multi_index_container<\n    CTxMemPoolModifiedEntry,\n    boost::multi_index::indexed_by<\n        boost::multi_index::ordered_unique<\n            modifiedentry_iter,\n            CompareCTxMemPoolIter\n        >,\n        // sorted by modified ancestor fee rate\n        boost::multi_index::ordered_non_unique<\n            // Reuse same tag from CTxMemPool's similar index\n            boost::multi_index::tag<ancestor_score>,\n            boost::multi_index::identity<CTxMemPoolModifiedEntry>,\n            CompareTxMemPoolEntryByAncestorFee\n        >\n    >\n> indexed_modified_transaction_set;\n\ntypedef indexed_modified_transaction_set::nth_index<0>::type::iterator modtxiter;\ntypedef indexed_modified_transaction_set::index<ancestor_score>::type::iterator modtxscoreiter;\n\nstruct update_for_parent_inclusion\n{\n    explicit update_for_parent_inclusion(CTxMemPool::txiter it) : iter(it) {}\n\n    void operator() (CTxMemPoolModifiedEntry &e)\n    {\n        e.nModFeesWithAncestors -= iter->GetFee();\n        e.nSizeWithAncestors -= iter->GetTxSize();\n        e.nSigOpCostWithAncestors -= iter->GetSigOpCost();\n    }\n\n    CTxMemPool::txiter iter;\n};\n\n/** Generate a new block, without valid proof-of-work */\nclass BlockAssembler\n{\nprivate:\n    // The constructed block template\n    std::unique_ptr<CBlockTemplate> pblocktemplate;\n    // A convenience pointer that always refers to the CBlock in pblocktemplate\n    CBlock* pblock;\n\n    // Configuration parameters for the block size\n    bool fIncludeWitness;\n    unsigned int nBlockMaxWeight;\n    CFeeRate blockMinFeeRate;\n\n    // Information on the current status of the block\n    uint64_t nBlockWeight;\n    uint64_t nBlockTx;\n    uint64_t nBlockSigOpsCost;\n    CAmount nFees;\n    CTxMemPool::setEntries inBlock;\n\n    // Chain context for the block\n    int nHeight;\n    int64_t nLockTimeCutoff;\n    const CChainParams& chainparams;\n\npublic:\n    struct Options {\n        Options();\n        size_t nBlockMaxWeight;\n        CFeeRate blockMinFeeRate;\n    };\n\n    explicit BlockAssembler(const CChainParams& params);\n    BlockAssembler(const CChainParams& params, const Options& options);\n\n    /** Construct a new block template with coinbase to scriptPubKeyIn */\n    std::unique_ptr<CBlockTemplate> CreateNewBlock(const CScript& scriptPubKeyIn, bool fMineWitnessTx=true);\n\nprivate:\n    // utility functions\n    /** Clear the block's state and prepare for assembling a new block */\n    void resetBlock();\n    /** Add a tx to the block */\n    void AddToBlock(CTxMemPool::txiter iter);\n\n    // Methods for how to add transactions to a block.\n    /** Add transactions based on feerate including unconfirmed ancestors\n      * Increments nPackagesSelected / nDescendantsUpdated with corresponding\n      * statistics from the package selection (for logging statistics). */\n    void addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated);\n\n    // helper functions for addPackageTxs()\n    /** Remove confirmed (inBlock) entries from given set */\n    void onlyUnconfirmed(CTxMemPool::setEntries& testSet);\n    /** Test if a new package would \"fit\" in the block */\n    bool TestPackage(uint64_t packageSize, int64_t packageSigOpsCost) const;\n    /** Perform checks on each transaction in a package:\n      * locktime, premature-witness, serialized size (if necessary)\n      * These checks should always succeed, and they're here\n      * only as an extra check in case of suboptimal node configuration */\n    bool TestPackageTransactions(const CTxMemPool::setEntries& package);\n    /** Return true if given transaction from mapTx has already been evaluated,\n      * or if the transaction's cached data in mapTx is incorrect. */\n    bool SkipMapTxEntry(CTxMemPool::txiter it, indexed_modified_transaction_set &mapModifiedTx, CTxMemPool::setEntries &failedTx);\n    /** Sort the package in an order that is valid to appear in a block */\n    void SortForBlock(const CTxMemPool::setEntries& package, CTxMemPool::txiter entry, std::vector<CTxMemPool::txiter>& sortedEntries);\n    /** Add descendants of given transactions to mapModifiedTx with ancestor\n      * state updated assuming given transactions are inBlock. Returns number\n      * of updated descendants. */\n    int UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded, indexed_modified_transaction_set &mapModifiedTx);\n};\n\n/** Modify the extranonce in a block */\nvoid IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce);\nint64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);\n\n#endif // BITCOIN_MINER_H\n"
  },
  {
    "path": "src/net.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <net.h>\n\n#include <chainparams.h>\n#include <clientversion.h>\n#include <consensus/consensus.h>\n#include <crypto/common.h>\n#include <crypto/sha256.h>\n#include <primitives/transaction.h>\n#include <netbase.h>\n#include <scheduler.h>\n#include <ui_interface.h>\n#include <utilstrencodings.h>\n\n#include <memory>\n#ifdef WIN32\n#include <string.h>\n#else\n#include <fcntl.h>\n#endif\n\n#ifdef USE_UPNP\n#include <miniupnpc/miniupnpc.h>\n#include <miniupnpc/miniwget.h>\n#include <miniupnpc/upnpcommands.h>\n#include <miniupnpc/upnperrors.h>\n#endif\n\n\n#include <math.h>\n\n// Dump addresses to peers.dat and banlist.dat every 15 minutes (900s)\n#define DUMP_ADDRESSES_INTERVAL 900\n\n// We add a random period time (0 to 1 seconds) to feeler connections to prevent synchronization.\n#define FEELER_SLEEP_WINDOW 1\n\n#if !defined(HAVE_MSG_NOSIGNAL)\n#define MSG_NOSIGNAL 0\n#endif\n\n// MSG_DONTWAIT is not available on some platforms, if it doesn't exist define it as 0\n#if !defined(HAVE_MSG_DONTWAIT)\n#define MSG_DONTWAIT 0\n#endif\n\n// Fix for ancient MinGW versions, that don't have defined these in ws2tcpip.h.\n// Todo: Can be removed when our pull-tester is upgraded to a modern MinGW version.\n#ifdef WIN32\n#ifndef PROTECTION_LEVEL_UNRESTRICTED\n#define PROTECTION_LEVEL_UNRESTRICTED 10\n#endif\n#ifndef IPV6_PROTECTION_LEVEL\n#define IPV6_PROTECTION_LEVEL 23\n#endif\n#endif\n\n/** Used to pass flags to the Bind() function */\nenum BindFlags {\n    BF_NONE         = 0,\n    BF_EXPLICIT     = (1U << 0),\n    BF_REPORT_ERROR = (1U << 1),\n    BF_WHITELIST    = (1U << 2),\n};\n\nconst static std::string NET_MESSAGE_COMMAND_OTHER = \"*other*\";\n\nstatic const uint64_t RANDOMIZER_ID_NETGROUP = 0x6c0edd8036ef4036ULL; // SHA256(\"netgroup\")[0:8]\nstatic const uint64_t RANDOMIZER_ID_LOCALHOSTNONCE = 0xd93e69e2bbfa5735ULL; // SHA256(\"localhostnonce\")[0:8]\n//\n// Global state variables\n//\nbool fDiscover = true;\nbool fListen = true;\nbool fRelayTxes = true;\nCCriticalSection cs_mapLocalHost;\nstd::map<CNetAddr, LocalServiceInfo> mapLocalHost;\nstatic bool vfLimited[NET_MAX] = {};\nstd::string strSubVersion;\n\nlimitedmap<uint256, int64_t> mapAlreadyAskedFor(MAX_INV_SZ);\n\nvoid CConnman::AddOneShot(const std::string& strDest)\n{\n    LOCK(cs_vOneShots);\n    vOneShots.push_back(strDest);\n}\n\nunsigned short GetListenPort()\n{\n    return (unsigned short)(gArgs.GetArg(\"-port\", Params().GetDefaultPort()));\n}\n\n// find 'best' local address for a particular peer\nbool GetLocal(CService& addr, const CNetAddr *paddrPeer)\n{\n    if (!fListen)\n        return false;\n\n    int nBestScore = -1;\n    int nBestReachability = -1;\n    {\n        LOCK(cs_mapLocalHost);\n        for (const auto& entry : mapLocalHost)\n        {\n            int nScore = entry.second.nScore;\n            int nReachability = entry.first.GetReachabilityFrom(paddrPeer);\n            if (nReachability > nBestReachability || (nReachability == nBestReachability && nScore > nBestScore))\n            {\n                addr = CService(entry.first, entry.second.nPort);\n                nBestReachability = nReachability;\n                nBestScore = nScore;\n            }\n        }\n    }\n    return nBestScore >= 0;\n}\n\n//! Convert the pnSeeds6 array into usable address objects.\nstatic std::vector<CAddress> convertSeed6(const std::vector<SeedSpec6> &vSeedsIn)\n{\n    // It'll only connect to one or two seed nodes because once it connects,\n    // it'll get a pile of addresses with newer timestamps.\n    // Seed nodes are given a random 'last seen time' of between one and two\n    // weeks ago.\n    const int64_t nOneWeek = 7*24*60*60;\n    std::vector<CAddress> vSeedsOut;\n    vSeedsOut.reserve(vSeedsIn.size());\n    for (const auto& seed_in : vSeedsIn) {\n        struct in6_addr ip;\n        memcpy(&ip, seed_in.addr, sizeof(ip));\n        CAddress addr(CService(ip, seed_in.port), GetDesirableServiceFlags(NODE_NONE));\n        addr.nTime = GetTime() - GetRand(nOneWeek) - nOneWeek;\n        vSeedsOut.push_back(addr);\n    }\n    return vSeedsOut;\n}\n\n// get best local address for a particular peer as a CAddress\n// Otherwise, return the unroutable 0.0.0.0 but filled in with\n// the normal parameters, since the IP may be changed to a useful\n// one by discovery.\nCAddress GetLocalAddress(const CNetAddr *paddrPeer, ServiceFlags nLocalServices)\n{\n    CAddress ret(CService(CNetAddr(),GetListenPort()), nLocalServices);\n    CService addr;\n    if (GetLocal(addr, paddrPeer))\n    {\n        ret = CAddress(addr, nLocalServices);\n    }\n    ret.nTime = GetAdjustedTime();\n    return ret;\n}\n\nint GetnScore(const CService& addr)\n{\n    LOCK(cs_mapLocalHost);\n    if (mapLocalHost.count(addr) == LOCAL_NONE)\n        return 0;\n    return mapLocalHost[addr].nScore;\n}\n\n// Is our peer's addrLocal potentially useful as an external IP source?\nbool IsPeerAddrLocalGood(CNode *pnode)\n{\n    CService addrLocal = pnode->GetAddrLocal();\n    return fDiscover && pnode->addr.IsRoutable() && addrLocal.IsRoutable() &&\n           !IsLimited(addrLocal.GetNetwork());\n}\n\n// pushes our own address to a peer\nvoid AdvertiseLocal(CNode *pnode)\n{\n    if (fListen && pnode->fSuccessfullyConnected)\n    {\n        CAddress addrLocal = GetLocalAddress(&pnode->addr, pnode->GetLocalServices());\n        // If discovery is enabled, sometimes give our peer the address it\n        // tells us that it sees us as in case it has a better idea of our\n        // address than we do.\n        if (IsPeerAddrLocalGood(pnode) && (!addrLocal.IsRoutable() ||\n             GetRand((GetnScore(addrLocal) > LOCAL_MANUAL) ? 8:2) == 0))\n        {\n            addrLocal.SetIP(pnode->GetAddrLocal());\n        }\n        if (addrLocal.IsRoutable())\n        {\n            LogPrint(BCLog::NET, \"AdvertiseLocal: advertising address %s\\n\", addrLocal.ToString());\n            FastRandomContext insecure_rand;\n            pnode->PushAddress(addrLocal, insecure_rand);\n        }\n    }\n}\n\n// learn a new local address\nbool AddLocal(const CService& addr, int nScore)\n{\n    if (!addr.IsRoutable())\n        return false;\n\n    if (!fDiscover && nScore < LOCAL_MANUAL)\n        return false;\n\n    if (IsLimited(addr))\n        return false;\n\n    LogPrintf(\"AddLocal(%s,%i)\\n\", addr.ToString(), nScore);\n\n    {\n        LOCK(cs_mapLocalHost);\n        bool fAlready = mapLocalHost.count(addr) > 0;\n        LocalServiceInfo &info = mapLocalHost[addr];\n        if (!fAlready || nScore >= info.nScore) {\n            info.nScore = nScore + (fAlready ? 1 : 0);\n            info.nPort = addr.GetPort();\n        }\n    }\n\n    return true;\n}\n\nbool AddLocal(const CNetAddr &addr, int nScore)\n{\n    return AddLocal(CService(addr, GetListenPort()), nScore);\n}\n\nbool RemoveLocal(const CService& addr)\n{\n    LOCK(cs_mapLocalHost);\n    LogPrintf(\"RemoveLocal(%s)\\n\", addr.ToString());\n    mapLocalHost.erase(addr);\n    return true;\n}\n\n/** Make a particular network entirely off-limits (no automatic connects to it) */\nvoid SetLimited(enum Network net, bool fLimited)\n{\n    if (net == NET_UNROUTABLE || net == NET_INTERNAL)\n        return;\n    LOCK(cs_mapLocalHost);\n    vfLimited[net] = fLimited;\n}\n\nbool IsLimited(enum Network net)\n{\n    LOCK(cs_mapLocalHost);\n    return vfLimited[net];\n}\n\nbool IsLimited(const CNetAddr &addr)\n{\n    return IsLimited(addr.GetNetwork());\n}\n\n/** vote for a local address */\nbool SeenLocal(const CService& addr)\n{\n    {\n        LOCK(cs_mapLocalHost);\n        if (mapLocalHost.count(addr) == 0)\n            return false;\n        mapLocalHost[addr].nScore++;\n    }\n    return true;\n}\n\n\n/** check whether a given address is potentially local */\nbool IsLocal(const CService& addr)\n{\n    LOCK(cs_mapLocalHost);\n    return mapLocalHost.count(addr) > 0;\n}\n\n/** check whether a given network is one we can probably connect to */\nbool IsReachable(enum Network net)\n{\n    LOCK(cs_mapLocalHost);\n    return !vfLimited[net];\n}\n\n/** check whether a given address is in a network we can probably connect to */\nbool IsReachable(const CNetAddr& addr)\n{\n    enum Network net = addr.GetNetwork();\n    return IsReachable(net);\n}\n\n\nCNode* CConnman::FindNode(const CNetAddr& ip)\n{\n    LOCK(cs_vNodes);\n    for (CNode* pnode : vNodes) {\n        if ((CNetAddr)pnode->addr == ip) {\n            return pnode;\n        }\n    }\n    return nullptr;\n}\n\nCNode* CConnman::FindNode(const CSubNet& subNet)\n{\n    LOCK(cs_vNodes);\n    for (CNode* pnode : vNodes) {\n        if (subNet.Match((CNetAddr)pnode->addr)) {\n            return pnode;\n        }\n    }\n    return nullptr;\n}\n\nCNode* CConnman::FindNode(const std::string& addrName)\n{\n    LOCK(cs_vNodes);\n    for (CNode* pnode : vNodes) {\n        if (pnode->GetAddrName() == addrName) {\n            return pnode;\n        }\n    }\n    return nullptr;\n}\n\nCNode* CConnman::FindNode(const CService& addr)\n{\n    LOCK(cs_vNodes);\n    for (CNode* pnode : vNodes) {\n        if ((CService)pnode->addr == addr) {\n            return pnode;\n        }\n    }\n    return nullptr;\n}\n\nbool CConnman::CheckIncomingNonce(uint64_t nonce)\n{\n    LOCK(cs_vNodes);\n    for (CNode* pnode : vNodes) {\n        if (!pnode->fSuccessfullyConnected && !pnode->fInbound && pnode->GetLocalNonce() == nonce)\n            return false;\n    }\n    return true;\n}\n\n/** Get the bind address for a socket as CAddress */\nstatic CAddress GetBindAddress(SOCKET sock)\n{\n    CAddress addr_bind;\n    struct sockaddr_storage sockaddr_bind;\n    socklen_t sockaddr_bind_len = sizeof(sockaddr_bind);\n    if (sock != INVALID_SOCKET) {\n        if (!getsockname(sock, (struct sockaddr*)&sockaddr_bind, &sockaddr_bind_len)) {\n            addr_bind.SetSockAddr((const struct sockaddr*)&sockaddr_bind);\n        } else {\n            LogPrint(BCLog::NET, \"Warning: getsockname failed\\n\");\n        }\n    }\n    return addr_bind;\n}\n\nCNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure)\n{\n    if (pszDest == nullptr) {\n        if (IsLocal(addrConnect))\n            return nullptr;\n\n        // Look for an existing connection\n        CNode* pnode = FindNode((CService)addrConnect);\n        if (pnode)\n        {\n            LogPrintf(\"Failed to open new connection, already connected\\n\");\n            return nullptr;\n        }\n    }\n\n    /// debug print\n    LogPrint(BCLog::NET, \"trying connection %s lastseen=%.1fhrs\\n\",\n        pszDest ? pszDest : addrConnect.ToString(),\n        pszDest ? 0.0 : (double)(GetAdjustedTime() - addrConnect.nTime)/3600.0);\n\n    // Resolve\n    const int default_port = Params().GetDefaultPort();\n    if (pszDest) {\n        std::vector<CService> resolved;\n        if (Lookup(pszDest, resolved,  default_port, fNameLookup && !HaveNameProxy(), 256) && !resolved.empty()) {\n            addrConnect = CAddress(resolved[GetRand(resolved.size())], NODE_NONE);\n            if (!addrConnect.IsValid()) {\n                LogPrint(BCLog::NET, \"Resolver returned invalid address %s for %s\", addrConnect.ToString(), pszDest);\n                return nullptr;\n            }\n            // It is possible that we already have a connection to the IP/port pszDest resolved to.\n            // In that case, drop the connection that was just created, and return the existing CNode instead.\n            // Also store the name we used to connect in that CNode, so that future FindNode() calls to that\n            // name catch this early.\n            LOCK(cs_vNodes);\n            CNode* pnode = FindNode((CService)addrConnect);\n            if (pnode)\n            {\n                pnode->MaybeSetAddrName(std::string(pszDest));\n                LogPrintf(\"Failed to open new connection, already connected\\n\");\n                return nullptr;\n            }\n        }\n    }\n\n    // Connect\n    bool connected = false;\n    SOCKET hSocket = INVALID_SOCKET;\n    proxyType proxy;\n    if (addrConnect.IsValid()) {\n        bool proxyConnectionFailed = false;\n\n        if (GetProxy(addrConnect.GetNetwork(), proxy)) {\n            hSocket = CreateSocket(proxy.proxy);\n            if (hSocket == INVALID_SOCKET) {\n                return nullptr;\n            }\n            connected = ConnectThroughProxy(proxy, addrConnect.ToStringIP(), addrConnect.GetPort(), hSocket, nConnectTimeout, &proxyConnectionFailed);\n        } else {\n            // no proxy needed (none set for target network)\n            hSocket = CreateSocket(addrConnect);\n            if (hSocket == INVALID_SOCKET) {\n                return nullptr;\n            }\n            connected = ConnectSocketDirectly(addrConnect, hSocket, nConnectTimeout);\n        }\n        if (!proxyConnectionFailed) {\n            // If a connection to the node was attempted, and failure (if any) is not caused by a problem connecting to\n            // the proxy, mark this as an attempt.\n            addrman.Attempt(addrConnect, fCountFailure);\n        }\n    } else if (pszDest && GetNameProxy(proxy)) {\n        hSocket = CreateSocket(proxy.proxy);\n        if (hSocket == INVALID_SOCKET) {\n            return nullptr;\n        }\n        std::string host;\n        int port = default_port;\n        SplitHostPort(std::string(pszDest), port, host);\n        connected = ConnectThroughProxy(proxy, host, port, hSocket, nConnectTimeout, nullptr);\n    }\n    if (!connected) {\n        CloseSocket(hSocket);\n        return nullptr;\n    }\n\n    // Add node\n    NodeId id = GetNewNodeId();\n    uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();\n    CAddress addr_bind = GetBindAddress(hSocket);\n    CNode* pnode = new CNode(id, nLocalServices, GetBestHeight(), hSocket, addrConnect, CalculateKeyedNetGroup(addrConnect), nonce, addr_bind, pszDest ? pszDest : \"\", false);\n    pnode->AddRef();\n\n    return pnode;\n}\n\nvoid CConnman::DumpBanlist()\n{\n    SweepBanned(); // clean unused entries (if bantime has expired)\n\n    if (!BannedSetIsDirty())\n        return;\n\n    int64_t nStart = GetTimeMillis();\n\n    CBanDB bandb;\n    banmap_t banmap;\n    GetBanned(banmap);\n    if (bandb.Write(banmap)) {\n        SetBannedSetDirty(false);\n    }\n\n    LogPrint(BCLog::NET, \"Flushed %d banned node ips/subnets to banlist.dat  %dms\\n\",\n        banmap.size(), GetTimeMillis() - nStart);\n}\n\nvoid CNode::CloseSocketDisconnect()\n{\n    fDisconnect = true;\n    LOCK(cs_hSocket);\n    if (hSocket != INVALID_SOCKET)\n    {\n        LogPrint(BCLog::NET, \"disconnecting peer=%d\\n\", id);\n        CloseSocket(hSocket);\n    }\n}\n\nvoid CConnman::ClearBanned()\n{\n    {\n        LOCK(cs_setBanned);\n        setBanned.clear();\n        setBannedIsDirty = true;\n    }\n    DumpBanlist(); //store banlist to disk\n    if(clientInterface)\n        clientInterface->BannedListChanged();\n}\n\nbool CConnman::IsBanned(CNetAddr ip)\n{\n    LOCK(cs_setBanned);\n    for (const auto& it : setBanned) {\n        CSubNet subNet = it.first;\n        CBanEntry banEntry = it.second;\n\n        if (subNet.Match(ip) && GetTime() < banEntry.nBanUntil) {\n            return true;\n        }\n    }\n    return false;\n}\n\nbool CConnman::IsBanned(CSubNet subnet)\n{\n    LOCK(cs_setBanned);\n    banmap_t::iterator i = setBanned.find(subnet);\n    if (i != setBanned.end())\n    {\n        CBanEntry banEntry = (*i).second;\n        if (GetTime() < banEntry.nBanUntil) {\n            return true;\n        }\n    }\n    return false;\n}\n\nvoid CConnman::Ban(const CNetAddr& addr, const BanReason &banReason, int64_t bantimeoffset, bool sinceUnixEpoch) {\n    CSubNet subNet(addr);\n    Ban(subNet, banReason, bantimeoffset, sinceUnixEpoch);\n}\n\nvoid CConnman::Ban(const CSubNet& subNet, const BanReason &banReason, int64_t bantimeoffset, bool sinceUnixEpoch) {\n    CBanEntry banEntry(GetTime());\n    banEntry.banReason = banReason;\n    if (bantimeoffset <= 0)\n    {\n        bantimeoffset = gArgs.GetArg(\"-bantime\", DEFAULT_MISBEHAVING_BANTIME);\n        sinceUnixEpoch = false;\n    }\n    banEntry.nBanUntil = (sinceUnixEpoch ? 0 : GetTime() )+bantimeoffset;\n\n    {\n        LOCK(cs_setBanned);\n        if (setBanned[subNet].nBanUntil < banEntry.nBanUntil) {\n            setBanned[subNet] = banEntry;\n            setBannedIsDirty = true;\n        }\n        else\n            return;\n    }\n    if(clientInterface)\n        clientInterface->BannedListChanged();\n    {\n        LOCK(cs_vNodes);\n        for (CNode* pnode : vNodes) {\n            if (subNet.Match((CNetAddr)pnode->addr))\n                pnode->fDisconnect = true;\n        }\n    }\n    if(banReason == BanReasonManuallyAdded)\n        DumpBanlist(); //store banlist to disk immediately if user requested ban\n}\n\nbool CConnman::Unban(const CNetAddr &addr) {\n    CSubNet subNet(addr);\n    return Unban(subNet);\n}\n\nbool CConnman::Unban(const CSubNet &subNet) {\n    {\n        LOCK(cs_setBanned);\n        if (!setBanned.erase(subNet))\n            return false;\n        setBannedIsDirty = true;\n    }\n    if(clientInterface)\n        clientInterface->BannedListChanged();\n    DumpBanlist(); //store banlist to disk immediately\n    return true;\n}\n\nvoid CConnman::GetBanned(banmap_t &banMap)\n{\n    LOCK(cs_setBanned);\n    // Sweep the banlist so expired bans are not returned\n    SweepBanned();\n    banMap = setBanned; //create a thread safe copy\n}\n\nvoid CConnman::SetBanned(const banmap_t &banMap)\n{\n    LOCK(cs_setBanned);\n    setBanned = banMap;\n    setBannedIsDirty = true;\n}\n\nvoid CConnman::SweepBanned()\n{\n    int64_t now = GetTime();\n    bool notifyUI = false;\n    {\n        LOCK(cs_setBanned);\n        banmap_t::iterator it = setBanned.begin();\n        while(it != setBanned.end())\n        {\n            CSubNet subNet = (*it).first;\n            CBanEntry banEntry = (*it).second;\n            if(now > banEntry.nBanUntil)\n            {\n                setBanned.erase(it++);\n                setBannedIsDirty = true;\n                notifyUI = true;\n                LogPrint(BCLog::NET, \"%s: Removed banned node ip/subnet from banlist.dat: %s\\n\", __func__, subNet.ToString());\n            }\n            else\n                ++it;\n        }\n    }\n    // update UI\n    if(notifyUI && clientInterface) {\n        clientInterface->BannedListChanged();\n    }\n}\n\nbool CConnman::BannedSetIsDirty()\n{\n    LOCK(cs_setBanned);\n    return setBannedIsDirty;\n}\n\nvoid CConnman::SetBannedSetDirty(bool dirty)\n{\n    LOCK(cs_setBanned); //reuse setBanned lock for the isDirty flag\n    setBannedIsDirty = dirty;\n}\n\n\nbool CConnman::IsWhitelistedRange(const CNetAddr &addr) {\n    for (const CSubNet& subnet : vWhitelistedRange) {\n        if (subnet.Match(addr))\n            return true;\n    }\n    return false;\n}\n\nstd::string CNode::GetAddrName() const {\n    LOCK(cs_addrName);\n    return addrName;\n}\n\nvoid CNode::MaybeSetAddrName(const std::string& addrNameIn) {\n    LOCK(cs_addrName);\n    if (addrName.empty()) {\n        addrName = addrNameIn;\n    }\n}\n\nCService CNode::GetAddrLocal() const {\n    LOCK(cs_addrLocal);\n    return addrLocal;\n}\n\nvoid CNode::SetAddrLocal(const CService& addrLocalIn) {\n    LOCK(cs_addrLocal);\n    if (addrLocal.IsValid()) {\n        error(\"Addr local already set for node: %i. Refusing to change from %s to %s\", id, addrLocal.ToString(), addrLocalIn.ToString());\n    } else {\n        addrLocal = addrLocalIn;\n    }\n}\n\n#undef X\n#define X(name) stats.name = name\nvoid CNode::copyStats(CNodeStats &stats)\n{\n    stats.nodeid = this->GetId();\n    X(nServices);\n    X(addr);\n    X(addrBind);\n    {\n        LOCK(cs_filter);\n        X(fRelayTxes);\n    }\n    X(nLastSend);\n    X(nLastRecv);\n    X(nTimeConnected);\n    X(nTimeOffset);\n    stats.addrName = GetAddrName();\n    X(nVersion);\n    {\n        LOCK(cs_SubVer);\n        X(cleanSubVer);\n    }\n    X(fInbound);\n    X(m_manual_connection);\n    X(nStartingHeight);\n    {\n        LOCK(cs_vSend);\n        X(mapSendBytesPerMsgCmd);\n        X(nSendBytes);\n    }\n    {\n        LOCK(cs_vRecv);\n        X(mapRecvBytesPerMsgCmd);\n        X(nRecvBytes);\n    }\n    X(fWhitelisted);\n\n    // It is common for nodes with good ping times to suddenly become lagged,\n    // due to a new block arriving or other large transfer.\n    // Merely reporting pingtime might fool the caller into thinking the node was still responsive,\n    // since pingtime does not update until the ping is complete, which might take a while.\n    // So, if a ping is taking an unusually long time in flight,\n    // the caller can immediately detect that this is happening.\n    int64_t nPingUsecWait = 0;\n    if ((0 != nPingNonceSent) && (0 != nPingUsecStart)) {\n        nPingUsecWait = GetTimeMicros() - nPingUsecStart;\n    }\n\n    // Raw ping time is in microseconds, but show it to user as whole seconds (Bitcoin users should be well used to small numbers with many decimal places by now :)\n    stats.dPingTime = (((double)nPingUsecTime) / 1e6);\n    stats.dMinPing  = (((double)nMinPingUsecTime) / 1e6);\n    stats.dPingWait = (((double)nPingUsecWait) / 1e6);\n\n    // Leave string empty if addrLocal invalid (not filled in yet)\n    CService addrLocalUnlocked = GetAddrLocal();\n    stats.addrLocal = addrLocalUnlocked.IsValid() ? addrLocalUnlocked.ToString() : \"\";\n}\n#undef X\n\nbool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes, bool& complete)\n{\n    complete = false;\n    int64_t nTimeMicros = GetTimeMicros();\n    LOCK(cs_vRecv);\n    nLastRecv = nTimeMicros / 1000000;\n    nRecvBytes += nBytes;\n    while (nBytes > 0) {\n\n        // get current incomplete message, or create a new one\n        if (vRecvMsg.empty() ||\n            vRecvMsg.back().complete())\n            vRecvMsg.push_back(CNetMessage(Params().MessageStart(), SER_NETWORK, INIT_PROTO_VERSION));\n\n        CNetMessage& msg = vRecvMsg.back();\n\n        // absorb network data\n        int handled;\n        if (!msg.in_data)\n            handled = msg.readHeader(pch, nBytes);\n        else\n            handled = msg.readData(pch, nBytes);\n\n        if (handled < 0)\n            return false;\n\n        if (msg.in_data && msg.hdr.nMessageSize > MAX_PROTOCOL_MESSAGE_LENGTH) {\n            LogPrint(BCLog::NET, \"Oversized message from peer=%i, disconnecting\\n\", GetId());\n            return false;\n        }\n\n        pch += handled;\n        nBytes -= handled;\n\n        if (msg.complete()) {\n\n            //store received bytes per message command\n            //to prevent a memory DOS, only allow valid commands\n            mapMsgCmdSize::iterator i = mapRecvBytesPerMsgCmd.find(msg.hdr.pchCommand);\n            if (i == mapRecvBytesPerMsgCmd.end())\n                i = mapRecvBytesPerMsgCmd.find(NET_MESSAGE_COMMAND_OTHER);\n            assert(i != mapRecvBytesPerMsgCmd.end());\n            i->second += msg.hdr.nMessageSize + CMessageHeader::HEADER_SIZE;\n\n            msg.nTime = nTimeMicros;\n            complete = true;\n        }\n    }\n\n    return true;\n}\n\nvoid CNode::SetSendVersion(int nVersionIn)\n{\n    // Send version may only be changed in the version message, and\n    // only one version message is allowed per session. We can therefore\n    // treat this value as const and even atomic as long as it's only used\n    // once a version message has been successfully processed. Any attempt to\n    // set this twice is an error.\n    if (nSendVersion != 0) {\n        error(\"Send version already set for node: %i. Refusing to change from %i to %i\", id, nSendVersion, nVersionIn);\n    } else {\n        nSendVersion = nVersionIn;\n    }\n}\n\nint CNode::GetSendVersion() const\n{\n    // The send version should always be explicitly set to\n    // INIT_PROTO_VERSION rather than using this value until SetSendVersion\n    // has been called.\n    if (nSendVersion == 0) {\n        error(\"Requesting unset send version for node: %i. Using %i\", id, INIT_PROTO_VERSION);\n        return INIT_PROTO_VERSION;\n    }\n    return nSendVersion;\n}\n\n\nint CNetMessage::readHeader(const char *pch, unsigned int nBytes)\n{\n    // copy data to temporary parsing buffer\n    unsigned int nRemaining = 24 - nHdrPos;\n    unsigned int nCopy = std::min(nRemaining, nBytes);\n\n    memcpy(&hdrbuf[nHdrPos], pch, nCopy);\n    nHdrPos += nCopy;\n\n    // if header incomplete, exit\n    if (nHdrPos < 24)\n        return nCopy;\n\n    // deserialize to CMessageHeader\n    try {\n        hdrbuf >> hdr;\n    }\n    catch (const std::exception&) {\n        return -1;\n    }\n\n    // reject messages larger than MAX_SIZE\n    if (hdr.nMessageSize > MAX_SIZE)\n        return -1;\n\n    // switch state to reading message data\n    in_data = true;\n\n    return nCopy;\n}\n\nint CNetMessage::readData(const char *pch, unsigned int nBytes)\n{\n    unsigned int nRemaining = hdr.nMessageSize - nDataPos;\n    unsigned int nCopy = std::min(nRemaining, nBytes);\n\n    if (vRecv.size() < nDataPos + nCopy) {\n        // Allocate up to 256 KiB ahead, but never more than the total message size.\n        vRecv.resize(std::min(hdr.nMessageSize, nDataPos + nCopy + 256 * 1024));\n    }\n\n    hasher.Write((const unsigned char*)pch, nCopy);\n    memcpy(&vRecv[nDataPos], pch, nCopy);\n    nDataPos += nCopy;\n\n    return nCopy;\n}\n\nconst uint256& CNetMessage::GetMessageHash() const\n{\n    assert(complete());\n    if (data_hash.IsNull())\n        hasher.Finalize(data_hash.begin());\n    return data_hash;\n}\n\n\n\n\n\n\n\n\n\n// requires LOCK(cs_vSend)\nsize_t CConnman::SocketSendData(CNode *pnode) const\n{\n    auto it = pnode->vSendMsg.begin();\n    size_t nSentSize = 0;\n\n    while (it != pnode->vSendMsg.end()) {\n        const auto &data = *it;\n        assert(data.size() > pnode->nSendOffset);\n        int nBytes = 0;\n        {\n            LOCK(pnode->cs_hSocket);\n            if (pnode->hSocket == INVALID_SOCKET)\n                break;\n            nBytes = send(pnode->hSocket, reinterpret_cast<const char*>(data.data()) + pnode->nSendOffset, data.size() - pnode->nSendOffset, MSG_NOSIGNAL | MSG_DONTWAIT);\n        }\n        if (nBytes > 0) {\n            pnode->nLastSend = GetSystemTimeInSeconds();\n            pnode->nSendBytes += nBytes;\n            pnode->nSendOffset += nBytes;\n            nSentSize += nBytes;\n            if (pnode->nSendOffset == data.size()) {\n                pnode->nSendOffset = 0;\n                pnode->nSendSize -= data.size();\n                pnode->fPauseSend = pnode->nSendSize > nSendBufferMaxSize;\n                it++;\n            } else {\n                // could not send full message; stop sending more\n                break;\n            }\n        } else {\n            if (nBytes < 0) {\n                // error\n                int nErr = WSAGetLastError();\n                if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)\n                {\n                    LogPrintf(\"socket send error %s\\n\", NetworkErrorString(nErr));\n                    pnode->CloseSocketDisconnect();\n                }\n            }\n            // couldn't send anything at all\n            break;\n        }\n    }\n\n    if (it == pnode->vSendMsg.end()) {\n        assert(pnode->nSendOffset == 0);\n        assert(pnode->nSendSize == 0);\n    }\n    pnode->vSendMsg.erase(pnode->vSendMsg.begin(), it);\n    return nSentSize;\n}\n\nstruct NodeEvictionCandidate\n{\n    NodeId id;\n    int64_t nTimeConnected;\n    int64_t nMinPingUsecTime;\n    int64_t nLastBlockTime;\n    int64_t nLastTXTime;\n    bool fRelevantServices;\n    bool fRelayTxes;\n    bool fBloomFilter;\n    CAddress addr;\n    uint64_t nKeyedNetGroup;\n};\n\nstatic bool ReverseCompareNodeMinPingTime(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)\n{\n    return a.nMinPingUsecTime > b.nMinPingUsecTime;\n}\n\nstatic bool ReverseCompareNodeTimeConnected(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)\n{\n    return a.nTimeConnected > b.nTimeConnected;\n}\n\nstatic bool CompareNetGroupKeyed(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b) {\n    return a.nKeyedNetGroup < b.nKeyedNetGroup;\n}\n\nstatic bool CompareNodeBlockTime(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)\n{\n    // There is a fall-through here because it is common for a node to have many peers which have not yet relayed a block.\n    if (a.nLastBlockTime != b.nLastBlockTime) return a.nLastBlockTime < b.nLastBlockTime;\n    if (a.fRelevantServices != b.fRelevantServices) return b.fRelevantServices;\n    return a.nTimeConnected > b.nTimeConnected;\n}\n\nstatic bool CompareNodeTXTime(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)\n{\n    // There is a fall-through here because it is common for a node to have more than a few peers that have not yet relayed txn.\n    if (a.nLastTXTime != b.nLastTXTime) return a.nLastTXTime < b.nLastTXTime;\n    if (a.fRelayTxes != b.fRelayTxes) return b.fRelayTxes;\n    if (a.fBloomFilter != b.fBloomFilter) return a.fBloomFilter;\n    return a.nTimeConnected > b.nTimeConnected;\n}\n\n\n//! Sort an array by the specified comparator, then erase the last K elements.\ntemplate<typename T, typename Comparator>\nstatic void EraseLastKElements(std::vector<T> &elements, Comparator comparator, size_t k)\n{\n    std::sort(elements.begin(), elements.end(), comparator);\n    size_t eraseSize = std::min(k, elements.size());\n    elements.erase(elements.end() - eraseSize, elements.end());\n}\n\n/** Try to find a connection to evict when the node is full.\n *  Extreme care must be taken to avoid opening the node to attacker\n *   triggered network partitioning.\n *  The strategy used here is to protect a small number of peers\n *   for each of several distinct characteristics which are difficult\n *   to forge.  In order to partition a node the attacker must be\n *   simultaneously better at all of them than honest peers.\n */\nbool CConnman::AttemptToEvictConnection()\n{\n    std::vector<NodeEvictionCandidate> vEvictionCandidates;\n    {\n        LOCK(cs_vNodes);\n\n        for (const CNode* node : vNodes) {\n            if (node->fWhitelisted)\n                continue;\n            if (!node->fInbound)\n                continue;\n            if (node->fDisconnect)\n                continue;\n            NodeEvictionCandidate candidate = {node->GetId(), node->nTimeConnected, node->nMinPingUsecTime,\n                                               node->nLastBlockTime, node->nLastTXTime,\n                                               HasAllDesirableServiceFlags(node->nServices),\n                                               node->fRelayTxes, node->pfilter != nullptr, node->addr, node->nKeyedNetGroup};\n            vEvictionCandidates.push_back(candidate);\n        }\n    }\n\n    // Protect connections with certain characteristics\n\n    // Deterministically select 4 peers to protect by netgroup.\n    // An attacker cannot predict which netgroups will be protected\n    EraseLastKElements(vEvictionCandidates, CompareNetGroupKeyed, 4);\n    // Protect the 8 nodes with the lowest minimum ping time.\n    // An attacker cannot manipulate this metric without physically moving nodes closer to the target.\n    EraseLastKElements(vEvictionCandidates, ReverseCompareNodeMinPingTime, 8);\n    // Protect 4 nodes that most recently sent us transactions.\n    // An attacker cannot manipulate this metric without performing useful work.\n    EraseLastKElements(vEvictionCandidates, CompareNodeTXTime, 4);\n    // Protect 4 nodes that most recently sent us blocks.\n    // An attacker cannot manipulate this metric without performing useful work.\n    EraseLastKElements(vEvictionCandidates, CompareNodeBlockTime, 4);\n    // Protect the half of the remaining nodes which have been connected the longest.\n    // This replicates the non-eviction implicit behavior, and precludes attacks that start later.\n    EraseLastKElements(vEvictionCandidates, ReverseCompareNodeTimeConnected, vEvictionCandidates.size() / 2);\n\n    if (vEvictionCandidates.empty()) return false;\n\n    // Identify the network group with the most connections and youngest member.\n    // (vEvictionCandidates is already sorted by reverse connect time)\n    uint64_t naMostConnections;\n    unsigned int nMostConnections = 0;\n    int64_t nMostConnectionsTime = 0;\n    std::map<uint64_t, std::vector<NodeEvictionCandidate> > mapNetGroupNodes;\n    for (const NodeEvictionCandidate &node : vEvictionCandidates) {\n        std::vector<NodeEvictionCandidate> &group = mapNetGroupNodes[node.nKeyedNetGroup];\n        group.push_back(node);\n        int64_t grouptime = group[0].nTimeConnected;\n\n        if (group.size() > nMostConnections || (group.size() == nMostConnections && grouptime > nMostConnectionsTime)) {\n            nMostConnections = group.size();\n            nMostConnectionsTime = grouptime;\n            naMostConnections = node.nKeyedNetGroup;\n        }\n    }\n\n    // Reduce to the network group with the most connections\n    vEvictionCandidates = std::move(mapNetGroupNodes[naMostConnections]);\n\n    // Disconnect from the network group with the most connections\n    NodeId evicted = vEvictionCandidates.front().id;\n    LOCK(cs_vNodes);\n    for (CNode* pnode : vNodes) {\n        if (pnode->GetId() == evicted) {\n            pnode->fDisconnect = true;\n            return true;\n        }\n    }\n    return false;\n}\n\nvoid CConnman::AcceptConnection(const ListenSocket& hListenSocket) {\n    struct sockaddr_storage sockaddr;\n    socklen_t len = sizeof(sockaddr);\n    SOCKET hSocket = accept(hListenSocket.socket, (struct sockaddr*)&sockaddr, &len);\n    CAddress addr;\n    int nInbound = 0;\n    int nMaxInbound = nMaxConnections - (nMaxOutbound + nMaxFeeler);\n\n    if (hSocket != INVALID_SOCKET) {\n        if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr)) {\n            LogPrintf(\"Warning: Unknown socket family\\n\");\n        }\n    }\n\n    bool whitelisted = hListenSocket.whitelisted || IsWhitelistedRange(addr);\n    {\n        LOCK(cs_vNodes);\n        for (const CNode* pnode : vNodes) {\n            if (pnode->fInbound) nInbound++;\n        }\n    }\n\n    if (hSocket == INVALID_SOCKET)\n    {\n        int nErr = WSAGetLastError();\n        if (nErr != WSAEWOULDBLOCK)\n            LogPrintf(\"socket error accept failed: %s\\n\", NetworkErrorString(nErr));\n        return;\n    }\n\n    if (!fNetworkActive) {\n        LogPrintf(\"connection from %s dropped: not accepting new connections\\n\", addr.ToString());\n        CloseSocket(hSocket);\n        return;\n    }\n\n    if (!IsSelectableSocket(hSocket))\n    {\n        LogPrintf(\"connection from %s dropped: non-selectable socket\\n\", addr.ToString());\n        CloseSocket(hSocket);\n        return;\n    }\n\n    // According to the internet TCP_NODELAY is not carried into accepted sockets\n    // on all platforms.  Set it again here just to be sure.\n    SetSocketNoDelay(hSocket);\n\n    if (IsBanned(addr) && !whitelisted)\n    {\n        LogPrint(BCLog::NET, \"connection from %s dropped (banned)\\n\", addr.ToString());\n        CloseSocket(hSocket);\n        return;\n    }\n\n    if (nInbound >= nMaxInbound)\n    {\n        if (!AttemptToEvictConnection()) {\n            // No connection to evict, disconnect the new connection\n            LogPrint(BCLog::NET, \"failed to find an eviction candidate - connection dropped (full)\\n\");\n            CloseSocket(hSocket);\n            return;\n        }\n    }\n\n    NodeId id = GetNewNodeId();\n    uint64_t nonce = GetDeterministicRandomizer(RANDOMIZER_ID_LOCALHOSTNONCE).Write(id).Finalize();\n    CAddress addr_bind = GetBindAddress(hSocket);\n\n    CNode* pnode = new CNode(id, nLocalServices, GetBestHeight(), hSocket, addr, CalculateKeyedNetGroup(addr), nonce, addr_bind, \"\", true);\n    pnode->AddRef();\n    pnode->fWhitelisted = whitelisted;\n    m_msgproc->InitializeNode(pnode);\n\n    LogPrint(BCLog::NET, \"connection from %s accepted\\n\", addr.ToString());\n\n    {\n        LOCK(cs_vNodes);\n        vNodes.push_back(pnode);\n    }\n}\n\nvoid CConnman::ThreadSocketHandler()\n{\n    unsigned int nPrevNodeCount = 0;\n    while (!interruptNet)\n    {\n        //\n        // Disconnect nodes\n        //\n        {\n            LOCK(cs_vNodes);\n            // Disconnect unused nodes\n            std::vector<CNode*> vNodesCopy = vNodes;\n            for (CNode* pnode : vNodesCopy)\n            {\n                if (pnode->fDisconnect)\n                {\n                    // remove from vNodes\n                    vNodes.erase(remove(vNodes.begin(), vNodes.end(), pnode), vNodes.end());\n\n                    // release outbound grant (if any)\n                    pnode->grantOutbound.Release();\n\n                    // close socket and cleanup\n                    pnode->CloseSocketDisconnect();\n\n                    // hold in disconnected pool until all refs are released\n                    pnode->Release();\n                    vNodesDisconnected.push_back(pnode);\n                }\n            }\n        }\n        {\n            // Delete disconnected nodes\n            std::list<CNode*> vNodesDisconnectedCopy = vNodesDisconnected;\n            for (CNode* pnode : vNodesDisconnectedCopy)\n            {\n                // wait until threads are done using it\n                if (pnode->GetRefCount() <= 0) {\n                    bool fDelete = false;\n                    {\n                        TRY_LOCK(pnode->cs_inventory, lockInv);\n                        if (lockInv) {\n                            TRY_LOCK(pnode->cs_vSend, lockSend);\n                            if (lockSend) {\n                                fDelete = true;\n                            }\n                        }\n                    }\n                    if (fDelete) {\n                        vNodesDisconnected.remove(pnode);\n                        DeleteNode(pnode);\n                    }\n                }\n            }\n        }\n        size_t vNodesSize;\n        {\n            LOCK(cs_vNodes);\n            vNodesSize = vNodes.size();\n        }\n        if(vNodesSize != nPrevNodeCount) {\n            nPrevNodeCount = vNodesSize;\n            if(clientInterface)\n                clientInterface->NotifyNumConnectionsChanged(nPrevNodeCount);\n        }\n\n        //\n        // Find which sockets have data to receive\n        //\n        struct timeval timeout;\n        timeout.tv_sec  = 0;\n        timeout.tv_usec = 50000; // frequency to poll pnode->vSend\n\n        fd_set fdsetRecv;\n        fd_set fdsetSend;\n        fd_set fdsetError;\n        FD_ZERO(&fdsetRecv);\n        FD_ZERO(&fdsetSend);\n        FD_ZERO(&fdsetError);\n        SOCKET hSocketMax = 0;\n        bool have_fds = false;\n\n        for (const ListenSocket& hListenSocket : vhListenSocket) {\n            FD_SET(hListenSocket.socket, &fdsetRecv);\n            hSocketMax = std::max(hSocketMax, hListenSocket.socket);\n            have_fds = true;\n        }\n\n        {\n            LOCK(cs_vNodes);\n            for (CNode* pnode : vNodes)\n            {\n                // Implement the following logic:\n                // * If there is data to send, select() for sending data. As this only\n                //   happens when optimistic write failed, we choose to first drain the\n                //   write buffer in this case before receiving more. This avoids\n                //   needlessly queueing received data, if the remote peer is not themselves\n                //   receiving data. This means properly utilizing TCP flow control signalling.\n                // * Otherwise, if there is space left in the receive buffer, select() for\n                //   receiving data.\n                // * Hand off all complete messages to the processor, to be handled without\n                //   blocking here.\n\n                bool select_recv = !pnode->fPauseRecv;\n                bool select_send;\n                {\n                    LOCK(pnode->cs_vSend);\n                    select_send = !pnode->vSendMsg.empty();\n                }\n\n                LOCK(pnode->cs_hSocket);\n                if (pnode->hSocket == INVALID_SOCKET)\n                    continue;\n\n                FD_SET(pnode->hSocket, &fdsetError);\n                hSocketMax = std::max(hSocketMax, pnode->hSocket);\n                have_fds = true;\n\n                if (select_send) {\n                    FD_SET(pnode->hSocket, &fdsetSend);\n                    continue;\n                }\n                if (select_recv) {\n                    FD_SET(pnode->hSocket, &fdsetRecv);\n                }\n            }\n        }\n\n        int nSelect = select(have_fds ? hSocketMax + 1 : 0,\n                             &fdsetRecv, &fdsetSend, &fdsetError, &timeout);\n        if (interruptNet)\n            return;\n\n        if (nSelect == SOCKET_ERROR)\n        {\n            if (have_fds)\n            {\n                int nErr = WSAGetLastError();\n                LogPrintf(\"socket select error %s\\n\", NetworkErrorString(nErr));\n                for (unsigned int i = 0; i <= hSocketMax; i++)\n                    FD_SET(i, &fdsetRecv);\n            }\n            FD_ZERO(&fdsetSend);\n            FD_ZERO(&fdsetError);\n            if (!interruptNet.sleep_for(std::chrono::milliseconds(timeout.tv_usec/1000)))\n                return;\n        }\n\n        //\n        // Accept new connections\n        //\n        for (const ListenSocket& hListenSocket : vhListenSocket)\n        {\n            if (hListenSocket.socket != INVALID_SOCKET && FD_ISSET(hListenSocket.socket, &fdsetRecv))\n            {\n                AcceptConnection(hListenSocket);\n            }\n        }\n\n        //\n        // Service each socket\n        //\n        std::vector<CNode*> vNodesCopy;\n        {\n            LOCK(cs_vNodes);\n            vNodesCopy = vNodes;\n            for (CNode* pnode : vNodesCopy)\n                pnode->AddRef();\n        }\n        for (CNode* pnode : vNodesCopy)\n        {\n            if (interruptNet)\n                return;\n\n            //\n            // Receive\n            //\n            bool recvSet = false;\n            bool sendSet = false;\n            bool errorSet = false;\n            {\n                LOCK(pnode->cs_hSocket);\n                if (pnode->hSocket == INVALID_SOCKET)\n                    continue;\n                recvSet = FD_ISSET(pnode->hSocket, &fdsetRecv);\n                sendSet = FD_ISSET(pnode->hSocket, &fdsetSend);\n                errorSet = FD_ISSET(pnode->hSocket, &fdsetError);\n            }\n            if (recvSet || errorSet)\n            {\n                // typical socket buffer is 8K-64K\n                char pchBuf[0x10000];\n                int nBytes = 0;\n                {\n                    LOCK(pnode->cs_hSocket);\n                    if (pnode->hSocket == INVALID_SOCKET)\n                        continue;\n                    nBytes = recv(pnode->hSocket, pchBuf, sizeof(pchBuf), MSG_DONTWAIT);\n                }\n                if (nBytes > 0)\n                {\n                    bool notify = false;\n                    if (!pnode->ReceiveMsgBytes(pchBuf, nBytes, notify))\n                        pnode->CloseSocketDisconnect();\n                    RecordBytesRecv(nBytes);\n                    if (notify) {\n                        size_t nSizeAdded = 0;\n                        auto it(pnode->vRecvMsg.begin());\n                        for (; it != pnode->vRecvMsg.end(); ++it) {\n                            if (!it->complete())\n                                break;\n                            nSizeAdded += it->vRecv.size() + CMessageHeader::HEADER_SIZE;\n                        }\n                        {\n                            LOCK(pnode->cs_vProcessMsg);\n                            pnode->vProcessMsg.splice(pnode->vProcessMsg.end(), pnode->vRecvMsg, pnode->vRecvMsg.begin(), it);\n                            pnode->nProcessQueueSize += nSizeAdded;\n                            pnode->fPauseRecv = pnode->nProcessQueueSize > nReceiveFloodSize;\n                        }\n                        WakeMessageHandler();\n                    }\n                }\n                else if (nBytes == 0)\n                {\n                    // socket closed gracefully\n                    if (!pnode->fDisconnect) {\n                        LogPrint(BCLog::NET, \"socket closed\\n\");\n                    }\n                    pnode->CloseSocketDisconnect();\n                }\n                else if (nBytes < 0)\n                {\n                    // error\n                    int nErr = WSAGetLastError();\n                    if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)\n                    {\n                        if (!pnode->fDisconnect)\n                            LogPrintf(\"socket recv error %s\\n\", NetworkErrorString(nErr));\n                        pnode->CloseSocketDisconnect();\n                    }\n                }\n            }\n\n            //\n            // Send\n            //\n            if (sendSet)\n            {\n                LOCK(pnode->cs_vSend);\n                size_t nBytes = SocketSendData(pnode);\n                if (nBytes) {\n                    RecordBytesSent(nBytes);\n                }\n            }\n\n            //\n            // Inactivity checking\n            //\n            int64_t nTime = GetSystemTimeInSeconds();\n            if (nTime - pnode->nTimeConnected > 60)\n            {\n                if (pnode->nLastRecv == 0 || pnode->nLastSend == 0)\n                {\n                    LogPrint(BCLog::NET, \"socket no message in first 60 seconds, %d %d from %d\\n\", pnode->nLastRecv != 0, pnode->nLastSend != 0, pnode->GetId());\n                    pnode->fDisconnect = true;\n                }\n                else if (nTime - pnode->nLastSend > TIMEOUT_INTERVAL)\n                {\n                    LogPrintf(\"socket sending timeout: %is\\n\", nTime - pnode->nLastSend);\n                    pnode->fDisconnect = true;\n                }\n                else if (nTime - pnode->nLastRecv > (pnode->nVersion > BIP0031_VERSION ? TIMEOUT_INTERVAL : 90*60))\n                {\n                    LogPrintf(\"socket receive timeout: %is\\n\", nTime - pnode->nLastRecv);\n                    pnode->fDisconnect = true;\n                }\n                else if (pnode->nPingNonceSent && pnode->nPingUsecStart + TIMEOUT_INTERVAL * 1000000 < GetTimeMicros())\n                {\n                    LogPrintf(\"ping timeout: %fs\\n\", 0.000001 * (GetTimeMicros() - pnode->nPingUsecStart));\n                    pnode->fDisconnect = true;\n                }\n                else if (!pnode->fSuccessfullyConnected)\n                {\n                    LogPrintf(\"version handshake timeout from %d\\n\", pnode->GetId());\n                    pnode->fDisconnect = true;\n                }\n            }\n        }\n        {\n            LOCK(cs_vNodes);\n            for (CNode* pnode : vNodesCopy)\n                pnode->Release();\n        }\n    }\n}\n\nvoid CConnman::WakeMessageHandler()\n{\n    {\n        std::lock_guard<std::mutex> lock(mutexMsgProc);\n        fMsgProcWake = true;\n    }\n    condMsgProc.notify_one();\n}\n\n\n\n\n\n\n#ifdef USE_UPNP\nvoid ThreadMapPort()\n{\n    std::string port = strprintf(\"%u\", GetListenPort());\n    const char * multicastif = nullptr;\n    const char * minissdpdpath = nullptr;\n    struct UPNPDev * devlist = nullptr;\n    char lanaddr[64];\n\n#ifndef UPNPDISCOVER_SUCCESS\n    /* miniupnpc 1.5 */\n    devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0);\n#elif MINIUPNPC_API_VERSION < 14\n    /* miniupnpc 1.6 */\n    int error = 0;\n    devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);\n#else\n    /* miniupnpc 1.9.20150730 */\n    int error = 0;\n    devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, 2, &error);\n#endif\n\n    struct UPNPUrls urls;\n    struct IGDdatas data;\n    int r;\n\n    r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));\n    if (r == 1)\n    {\n        if (fDiscover) {\n            char externalIPAddress[40];\n            r = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIPAddress);\n            if(r != UPNPCOMMAND_SUCCESS)\n                LogPrintf(\"UPnP: GetExternalIPAddress() returned %d\\n\", r);\n            else\n            {\n                if(externalIPAddress[0])\n                {\n                    CNetAddr resolved;\n                    if(LookupHost(externalIPAddress, resolved, false)) {\n                        LogPrintf(\"UPnP: ExternalIPAddress = %s\\n\", resolved.ToString().c_str());\n                        AddLocal(resolved, LOCAL_UPNP);\n                    }\n                }\n                else\n                    LogPrintf(\"UPnP: GetExternalIPAddress failed.\\n\");\n            }\n        }\n\n        std::string strDesc = \"Sugarchain \" + FormatFullVersion();\n\n        try {\n            while (true) {\n#ifndef UPNPDISCOVER_SUCCESS\n                /* miniupnpc 1.5 */\n                r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,\n                                    port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), \"TCP\", 0);\n#else\n                /* miniupnpc 1.6 */\n                r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,\n                                    port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), \"TCP\", 0, \"0\");\n#endif\n\n                if(r!=UPNPCOMMAND_SUCCESS)\n                    LogPrintf(\"AddPortMapping(%s, %s, %s) failed with code %d (%s)\\n\",\n                        port, port, lanaddr, r, strupnperror(r));\n                else\n                    LogPrintf(\"UPnP Port Mapping successful.\\n\");\n\n                MilliSleep(20*60*1000); // Refresh every 20 minutes\n            }\n        }\n        catch (const boost::thread_interrupted&)\n        {\n            r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), \"TCP\", 0);\n            LogPrintf(\"UPNP_DeletePortMapping() returned: %d\\n\", r);\n            freeUPNPDevlist(devlist); devlist = nullptr;\n            FreeUPNPUrls(&urls);\n            throw;\n        }\n    } else {\n        LogPrintf(\"No valid UPnP IGDs found\\n\");\n        freeUPNPDevlist(devlist); devlist = nullptr;\n        if (r != 0)\n            FreeUPNPUrls(&urls);\n    }\n}\n\nvoid MapPort(bool fUseUPnP)\n{\n    static std::unique_ptr<boost::thread> upnp_thread;\n\n    if (fUseUPnP)\n    {\n        if (upnp_thread) {\n            upnp_thread->interrupt();\n            upnp_thread->join();\n        }\n        upnp_thread.reset(new boost::thread(boost::bind(&TraceThread<void (*)()>, \"upnp\", &ThreadMapPort)));\n    }\n    else if (upnp_thread) {\n        upnp_thread->interrupt();\n        upnp_thread->join();\n        upnp_thread.reset();\n    }\n}\n\n#else\nvoid MapPort(bool)\n{\n    // Intentionally left blank.\n}\n#endif\n\n\n\n\n\n\nvoid CConnman::ThreadDNSAddressSeed()\n{\n    // goal: only query DNS seeds if address need is acute\n    // Avoiding DNS seeds when we don't need them improves user privacy by\n    //  creating fewer identifying DNS requests, reduces trust by giving seeds\n    //  less influence on the network topology, and reduces traffic to the seeds.\n    if ((addrman.size() > 0) &&\n        (!gArgs.GetBoolArg(\"-forcednsseed\", DEFAULT_FORCEDNSSEED))) {\n        if (!interruptNet.sleep_for(std::chrono::seconds(11)))\n            return;\n\n        LOCK(cs_vNodes);\n        int nRelevant = 0;\n        for (auto pnode : vNodes) {\n            nRelevant += pnode->fSuccessfullyConnected && !pnode->fFeeler && !pnode->fOneShot && !pnode->m_manual_connection && !pnode->fInbound;\n        }\n        if (nRelevant >= 2) {\n            LogPrintf(\"P2P peers available. Skipped DNS seeding.\\n\");\n            return;\n        }\n    }\n\n    const std::vector<std::string> &vSeeds = Params().DNSSeeds();\n    int found = 0;\n\n    LogPrintf(\"Loading addresses from DNS seeds (could take a while)\\n\");\n\n    for (const std::string &seed : vSeeds) {\n        if (interruptNet) {\n            return;\n        }\n        if (HaveNameProxy()) {\n            AddOneShot(seed);\n        } else {\n            std::vector<CNetAddr> vIPs;\n            std::vector<CAddress> vAdd;\n            ServiceFlags requiredServiceBits = GetDesirableServiceFlags(NODE_NONE);\n            std::string host = strprintf(\"x%x.%s\", requiredServiceBits, seed);\n            CNetAddr resolveSource;\n            if (!resolveSource.SetInternal(host)) {\n                continue;\n            }\n            unsigned int nMaxIPs = 256; // Limits number of IPs learned from a DNS seed\n            if (LookupHost(host.c_str(), vIPs, nMaxIPs, true))\n            {\n                for (const CNetAddr& ip : vIPs)\n                {\n                    int nOneDay = 24*3600;\n                    CAddress addr = CAddress(CService(ip, Params().GetDefaultPort()), requiredServiceBits);\n                    addr.nTime = GetTime() - 3*nOneDay - GetRand(4*nOneDay); // use a random age between 3 and 7 days old\n                    vAdd.push_back(addr);\n                    found++;\n                }\n                addrman.Add(vAdd, resolveSource);\n            } else {\n                // We now avoid directly using results from DNS Seeds which do not support service bit filtering,\n                // instead using them as a oneshot to get nodes with our desired service bits.\n                AddOneShot(seed);\n            }\n        }\n    }\n\n    LogPrintf(\"%d addresses found from DNS seeds\\n\", found);\n}\n\n\n\n\n\n\n\n\n\n\n\n\nvoid CConnman::DumpAddresses()\n{\n    int64_t nStart = GetTimeMillis();\n\n    CAddrDB adb;\n    adb.Write(addrman);\n\n    LogPrint(BCLog::NET, \"Flushed %d addresses to peers.dat  %dms\\n\",\n           addrman.size(), GetTimeMillis() - nStart);\n}\n\nvoid CConnman::DumpData()\n{\n    DumpAddresses();\n    DumpBanlist();\n}\n\nvoid CConnman::ProcessOneShot()\n{\n    std::string strDest;\n    {\n        LOCK(cs_vOneShots);\n        if (vOneShots.empty())\n            return;\n        strDest = vOneShots.front();\n        vOneShots.pop_front();\n    }\n    CAddress addr;\n    CSemaphoreGrant grant(*semOutbound, true);\n    if (grant) {\n        OpenNetworkConnection(addr, false, &grant, strDest.c_str(), true);\n    }\n}\n\nbool CConnman::GetTryNewOutboundPeer()\n{\n    return m_try_another_outbound_peer;\n}\n\nvoid CConnman::SetTryNewOutboundPeer(bool flag)\n{\n    m_try_another_outbound_peer = flag;\n    LogPrint(BCLog::NET, \"net: setting try another outbound peer=%s\\n\", flag ? \"true\" : \"false\");\n}\n\n// Return the number of peers we have over our outbound connection limit\n// Exclude peers that are marked for disconnect, or are going to be\n// disconnected soon (eg one-shots and feelers)\n// Also exclude peers that haven't finished initial connection handshake yet\n// (so that we don't decide we're over our desired connection limit, and then\n// evict some peer that has finished the handshake)\nint CConnman::GetExtraOutboundCount()\n{\n    int nOutbound = 0;\n    {\n        LOCK(cs_vNodes);\n        for (CNode* pnode : vNodes) {\n            if (!pnode->fInbound && !pnode->m_manual_connection && !pnode->fFeeler && !pnode->fDisconnect && !pnode->fOneShot && pnode->fSuccessfullyConnected) {\n                ++nOutbound;\n            }\n        }\n    }\n    return std::max(nOutbound - nMaxOutbound, 0);\n}\n\nvoid CConnman::ThreadOpenConnections(const std::vector<std::string> connect)\n{\n    // Connect to specific addresses\n    if (!connect.empty())\n    {\n        for (int64_t nLoop = 0;; nLoop++)\n        {\n            ProcessOneShot();\n            for (const std::string& strAddr : connect)\n            {\n                CAddress addr(CService(), NODE_NONE);\n                OpenNetworkConnection(addr, false, nullptr, strAddr.c_str(), false, false, true);\n                for (int i = 0; i < 10 && i < nLoop; i++)\n                {\n                    if (!interruptNet.sleep_for(std::chrono::milliseconds(500)))\n                        return;\n                }\n            }\n            if (!interruptNet.sleep_for(std::chrono::milliseconds(500)))\n                return;\n        }\n    }\n\n    // Initiate network connections\n    int64_t nStart = GetTime();\n\n    // Minimum time before next feeler connection (in microseconds).\n    int64_t nNextFeeler = PoissonNextSend(nStart*1000*1000, FEELER_INTERVAL);\n    while (!interruptNet)\n    {\n        ProcessOneShot();\n\n        if (!interruptNet.sleep_for(std::chrono::milliseconds(500)))\n            return;\n\n        CSemaphoreGrant grant(*semOutbound);\n        if (interruptNet)\n            return;\n\n        // Add seed nodes if DNS seeds are all down (an infrastructure attack?).\n        if (addrman.size() == 0 && (GetTime() - nStart > 60)) {\n            static bool done = false;\n            if (!done) {\n                LogPrintf(\"Adding fixed seed nodes as DNS doesn't seem to be available.\\n\");\n                CNetAddr local;\n                local.SetInternal(\"fixedseeds\");\n                addrman.Add(convertSeed6(Params().FixedSeeds()), local);\n                done = true;\n            }\n        }\n\n        //\n        // Choose an address to connect to based on most recently seen\n        //\n        CAddress addrConnect;\n\n        // Only connect out to one peer per network group (/16 for IPv4).\n        // Do this here so we don't have to critsect vNodes inside mapAddresses critsect.\n        int nOutbound = 0;\n        std::set<std::vector<unsigned char> > setConnected;\n        {\n            LOCK(cs_vNodes);\n            for (CNode* pnode : vNodes) {\n                if (!pnode->fInbound && !pnode->m_manual_connection) {\n                    // Netgroups for inbound and addnode peers are not excluded because our goal here\n                    // is to not use multiple of our limited outbound slots on a single netgroup\n                    // but inbound and addnode peers do not use our outbound slots.  Inbound peers\n                    // also have the added issue that they're attacker controlled and could be used\n                    // to prevent us from connecting to particular hosts if we used them here.\n                    setConnected.insert(pnode->addr.GetGroup());\n                    nOutbound++;\n                }\n            }\n        }\n\n        // Feeler Connections\n        //\n        // Design goals:\n        //  * Increase the number of connectable addresses in the tried table.\n        //\n        // Method:\n        //  * Choose a random address from new and attempt to connect to it if we can connect\n        //    successfully it is added to tried.\n        //  * Start attempting feeler connections only after node finishes making outbound\n        //    connections.\n        //  * Only make a feeler connection once every few minutes.\n        //\n        bool fFeeler = false;\n\n        if (nOutbound >= nMaxOutbound && !GetTryNewOutboundPeer()) {\n            int64_t nTime = GetTimeMicros(); // The current time right now (in microseconds).\n            if (nTime > nNextFeeler) {\n                nNextFeeler = PoissonNextSend(nTime, FEELER_INTERVAL);\n                fFeeler = true;\n            } else {\n                continue;\n            }\n        }\n\n        int64_t nANow = GetAdjustedTime();\n        int nTries = 0;\n        while (!interruptNet)\n        {\n            CAddrInfo addr = addrman.Select(fFeeler);\n\n            // if we selected an invalid address, restart\n            if (!addr.IsValid() || setConnected.count(addr.GetGroup()) || IsLocal(addr))\n                break;\n\n            // If we didn't find an appropriate destination after trying 100 addresses fetched from addrman,\n            // stop this loop, and let the outer loop run again (which sleeps, adds seed nodes, recalculates\n            // already-connected network ranges, ...) before trying new addrman addresses.\n            nTries++;\n            if (nTries > 100)\n                break;\n\n            if (IsLimited(addr))\n                continue;\n\n            // only consider very recently tried nodes after 30 failed attempts\n            if (nANow - addr.nLastTry < 600 && nTries < 30)\n                continue;\n\n            // for non-feelers, require all the services we'll want,\n            // for feelers, only require they be a full node (only because most\n            // SPV clients don't have a good address DB available)\n            if (!fFeeler && !HasAllDesirableServiceFlags(addr.nServices)) {\n                continue;\n            } else if (fFeeler && !MayHaveUsefulAddressDB(addr.nServices)) {\n                continue;\n            }\n\n            // do not allow non-default ports, unless after 50 invalid addresses selected already\n            if (addr.GetPort() != Params().GetDefaultPort() && nTries < 50)\n                continue;\n\n            addrConnect = addr;\n            break;\n        }\n\n        if (addrConnect.IsValid()) {\n\n            if (fFeeler) {\n                // Add small amount of random noise before connection to avoid synchronization.\n                int randsleep = GetRandInt(FEELER_SLEEP_WINDOW * 1000);\n                if (!interruptNet.sleep_for(std::chrono::milliseconds(randsleep)))\n                    return;\n                LogPrint(BCLog::NET, \"Making feeler connection to %s\\n\", addrConnect.ToString());\n            }\n\n            OpenNetworkConnection(addrConnect, (int)setConnected.size() >= std::min(nMaxConnections - 1, 2), &grant, nullptr, false, fFeeler);\n        }\n    }\n}\n\nstd::vector<AddedNodeInfo> CConnman::GetAddedNodeInfo()\n{\n    std::vector<AddedNodeInfo> ret;\n\n    std::list<std::string> lAddresses(0);\n    {\n        LOCK(cs_vAddedNodes);\n        ret.reserve(vAddedNodes.size());\n        std::copy(vAddedNodes.cbegin(), vAddedNodes.cend(), std::back_inserter(lAddresses));\n    }\n\n\n    // Build a map of all already connected addresses (by IP:port and by name) to inbound/outbound and resolved CService\n    std::map<CService, bool> mapConnected;\n    std::map<std::string, std::pair<bool, CService>> mapConnectedByName;\n    {\n        LOCK(cs_vNodes);\n        for (const CNode* pnode : vNodes) {\n            if (pnode->addr.IsValid()) {\n                mapConnected[pnode->addr] = pnode->fInbound;\n            }\n            std::string addrName = pnode->GetAddrName();\n            if (!addrName.empty()) {\n                mapConnectedByName[std::move(addrName)] = std::make_pair(pnode->fInbound, static_cast<const CService&>(pnode->addr));\n            }\n        }\n    }\n\n    for (const std::string& strAddNode : lAddresses) {\n        CService service(LookupNumeric(strAddNode.c_str(), Params().GetDefaultPort()));\n        if (service.IsValid()) {\n            // strAddNode is an IP:port\n            auto it = mapConnected.find(service);\n            if (it != mapConnected.end()) {\n                ret.push_back(AddedNodeInfo{strAddNode, service, true, it->second});\n            } else {\n                ret.push_back(AddedNodeInfo{strAddNode, CService(), false, false});\n            }\n        } else {\n            // strAddNode is a name\n            auto it = mapConnectedByName.find(strAddNode);\n            if (it != mapConnectedByName.end()) {\n                ret.push_back(AddedNodeInfo{strAddNode, it->second.second, true, it->second.first});\n            } else {\n                ret.push_back(AddedNodeInfo{strAddNode, CService(), false, false});\n            }\n        }\n    }\n\n    return ret;\n}\n\nvoid CConnman::ThreadOpenAddedConnections()\n{\n    while (true)\n    {\n        CSemaphoreGrant grant(*semAddnode);\n        std::vector<AddedNodeInfo> vInfo = GetAddedNodeInfo();\n        bool tried = false;\n        for (const AddedNodeInfo& info : vInfo) {\n            if (!info.fConnected) {\n                if (!grant.TryAcquire()) {\n                    // If we've used up our semaphore and need a new one, lets not wait here since while we are waiting\n                    // the addednodeinfo state might change.\n                    break;\n                }\n                tried = true;\n                CAddress addr(CService(), NODE_NONE);\n                OpenNetworkConnection(addr, false, &grant, info.strAddedNode.c_str(), false, false, true);\n                if (!interruptNet.sleep_for(std::chrono::milliseconds(500)))\n                    return;\n            }\n        }\n        // Retry every 60 seconds if a connection was attempted, otherwise two seconds\n        if (!interruptNet.sleep_for(std::chrono::seconds(tried ? 60 : 2)))\n            return;\n    }\n}\n\n// if successful, this moves the passed grant to the constructed node\nvoid CConnman::OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound, const char *pszDest, bool fOneShot, bool fFeeler, bool manual_connection)\n{\n    //\n    // Initiate outbound network connection\n    //\n    if (interruptNet) {\n        return;\n    }\n    if (!fNetworkActive) {\n        return;\n    }\n    if (!pszDest) {\n        if (IsLocal(addrConnect) ||\n            FindNode((CNetAddr)addrConnect) || IsBanned(addrConnect) ||\n            FindNode(addrConnect.ToStringIPPort()))\n            return;\n    } else if (FindNode(std::string(pszDest)))\n        return;\n\n    CNode* pnode = ConnectNode(addrConnect, pszDest, fCountFailure);\n\n    if (!pnode)\n        return;\n    if (grantOutbound)\n        grantOutbound->MoveTo(pnode->grantOutbound);\n    if (fOneShot)\n        pnode->fOneShot = true;\n    if (fFeeler)\n        pnode->fFeeler = true;\n    if (manual_connection)\n        pnode->m_manual_connection = true;\n\n    m_msgproc->InitializeNode(pnode);\n    {\n        LOCK(cs_vNodes);\n        vNodes.push_back(pnode);\n    }\n}\n\nvoid CConnman::ThreadMessageHandler()\n{\n    while (!flagInterruptMsgProc)\n    {\n        std::vector<CNode*> vNodesCopy;\n        {\n            LOCK(cs_vNodes);\n            vNodesCopy = vNodes;\n            for (CNode* pnode : vNodesCopy) {\n                pnode->AddRef();\n            }\n        }\n\n        bool fMoreWork = false;\n\n        for (CNode* pnode : vNodesCopy)\n        {\n            if (pnode->fDisconnect)\n                continue;\n\n            // Receive messages\n            bool fMoreNodeWork = m_msgproc->ProcessMessages(pnode, flagInterruptMsgProc);\n            fMoreWork |= (fMoreNodeWork && !pnode->fPauseSend);\n            if (flagInterruptMsgProc)\n                return;\n            // Send messages\n            {\n                LOCK(pnode->cs_sendProcessing);\n                m_msgproc->SendMessages(pnode, flagInterruptMsgProc);\n            }\n\n            if (flagInterruptMsgProc)\n                return;\n        }\n\n        {\n            LOCK(cs_vNodes);\n            for (CNode* pnode : vNodesCopy)\n                pnode->Release();\n        }\n\n        std::unique_lock<std::mutex> lock(mutexMsgProc);\n        if (!fMoreWork) {\n            condMsgProc.wait_until(lock, std::chrono::steady_clock::now() + std::chrono::milliseconds(100), [this] { return fMsgProcWake; });\n        }\n        fMsgProcWake = false;\n    }\n}\n\n\n\n\n\n\nbool CConnman::BindListenPort(const CService &addrBind, std::string& strError, bool fWhitelisted)\n{\n    strError = \"\";\n    int nOne = 1;\n\n    // Create socket for listening for incoming connections\n    struct sockaddr_storage sockaddr;\n    socklen_t len = sizeof(sockaddr);\n    if (!addrBind.GetSockAddr((struct sockaddr*)&sockaddr, &len))\n    {\n        strError = strprintf(\"Error: Bind address family for %s not supported\", addrBind.ToString());\n        LogPrintf(\"%s\\n\", strError);\n        return false;\n    }\n\n    SOCKET hListenSocket = CreateSocket(addrBind);\n    if (hListenSocket == INVALID_SOCKET)\n    {\n        strError = strprintf(\"Error: Couldn't open socket for incoming connections (socket returned error %s)\", NetworkErrorString(WSAGetLastError()));\n        LogPrintf(\"%s\\n\", strError);\n        return false;\n    }\n#ifndef WIN32\n    // Allow binding if the port is still in TIME_WAIT state after\n    // the program was closed and restarted.\n    setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (void*)&nOne, sizeof(int));\n#else\n    setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (const char*)&nOne, sizeof(int));\n#endif\n\n    // some systems don't have IPV6_V6ONLY but are always v6only; others do have the option\n    // and enable it by default or not. Try to enable it, if possible.\n    if (addrBind.IsIPv6()) {\n#ifdef IPV6_V6ONLY\n#ifdef WIN32\n        setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&nOne, sizeof(int));\n#else\n        setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&nOne, sizeof(int));\n#endif\n#endif\n#ifdef WIN32\n        int nProtLevel = PROTECTION_LEVEL_UNRESTRICTED;\n        setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_PROTECTION_LEVEL, (const char*)&nProtLevel, sizeof(int));\n#endif\n    }\n\n    if (::bind(hListenSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR)\n    {\n        int nErr = WSAGetLastError();\n        if (nErr == WSAEADDRINUSE)\n            strError = strprintf(_(\"Unable to bind to %s on this computer. %s is probably already running.\"), addrBind.ToString(), _(PACKAGE_NAME));\n        else\n            strError = strprintf(_(\"Unable to bind to %s on this computer (bind returned error %s)\"), addrBind.ToString(), NetworkErrorString(nErr));\n        LogPrintf(\"%s\\n\", strError);\n        CloseSocket(hListenSocket);\n        return false;\n    }\n    LogPrintf(\"Bound to %s\\n\", addrBind.ToString());\n\n    // Listen for incoming connections\n    if (listen(hListenSocket, SOMAXCONN) == SOCKET_ERROR)\n    {\n        strError = strprintf(_(\"Error: Listening for incoming connections failed (listen returned error %s)\"), NetworkErrorString(WSAGetLastError()));\n        LogPrintf(\"%s\\n\", strError);\n        CloseSocket(hListenSocket);\n        return false;\n    }\n\n    vhListenSocket.push_back(ListenSocket(hListenSocket, fWhitelisted));\n\n    if (addrBind.IsRoutable() && fDiscover && !fWhitelisted)\n        AddLocal(addrBind, LOCAL_BIND);\n\n    return true;\n}\n\nvoid Discover(boost::thread_group& threadGroup)\n{\n    if (!fDiscover)\n        return;\n\n#ifdef WIN32\n    // Get local host IP\n    char pszHostName[256] = \"\";\n    if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR)\n    {\n        std::vector<CNetAddr> vaddr;\n        if (LookupHost(pszHostName, vaddr, 0, true))\n        {\n            for (const CNetAddr &addr : vaddr)\n            {\n                if (AddLocal(addr, LOCAL_IF))\n                    LogPrintf(\"%s: %s - %s\\n\", __func__, pszHostName, addr.ToString());\n            }\n        }\n    }\n#else\n    // Get local host ip\n    struct ifaddrs* myaddrs;\n    if (getifaddrs(&myaddrs) == 0)\n    {\n        for (struct ifaddrs* ifa = myaddrs; ifa != nullptr; ifa = ifa->ifa_next)\n        {\n            if (ifa->ifa_addr == nullptr) continue;\n            if ((ifa->ifa_flags & IFF_UP) == 0) continue;\n            if (strcmp(ifa->ifa_name, \"lo\") == 0) continue;\n            if (strcmp(ifa->ifa_name, \"lo0\") == 0) continue;\n            if (ifa->ifa_addr->sa_family == AF_INET)\n            {\n                struct sockaddr_in* s4 = (struct sockaddr_in*)(ifa->ifa_addr);\n                CNetAddr addr(s4->sin_addr);\n                if (AddLocal(addr, LOCAL_IF))\n                    LogPrintf(\"%s: IPv4 %s: %s\\n\", __func__, ifa->ifa_name, addr.ToString());\n            }\n            else if (ifa->ifa_addr->sa_family == AF_INET6)\n            {\n                struct sockaddr_in6* s6 = (struct sockaddr_in6*)(ifa->ifa_addr);\n                CNetAddr addr(s6->sin6_addr);\n                if (AddLocal(addr, LOCAL_IF))\n                    LogPrintf(\"%s: IPv6 %s: %s\\n\", __func__, ifa->ifa_name, addr.ToString());\n            }\n        }\n        freeifaddrs(myaddrs);\n    }\n#endif\n}\n\nvoid CConnman::SetNetworkActive(bool active)\n{\n    LogPrint(BCLog::NET, \"SetNetworkActive: %s\\n\", active);\n\n    if (fNetworkActive == active) {\n        return;\n    }\n\n    fNetworkActive = active;\n\n    if (!fNetworkActive) {\n        LOCK(cs_vNodes);\n        // Close sockets to all nodes\n        for (CNode* pnode : vNodes) {\n            pnode->CloseSocketDisconnect();\n        }\n    }\n\n    uiInterface.NotifyNetworkActiveChanged(fNetworkActive);\n}\n\nCConnman::CConnman(uint64_t nSeed0In, uint64_t nSeed1In) : nSeed0(nSeed0In), nSeed1(nSeed1In)\n{\n    fNetworkActive = true;\n    setBannedIsDirty = false;\n    fAddressesInitialized = false;\n    nLastNodeId = 0;\n    nSendBufferMaxSize = 0;\n    nReceiveFloodSize = 0;\n    flagInterruptMsgProc = false;\n    SetTryNewOutboundPeer(false);\n\n    Options connOptions;\n    Init(connOptions);\n}\n\nNodeId CConnman::GetNewNodeId()\n{\n    return nLastNodeId.fetch_add(1, std::memory_order_relaxed);\n}\n\n\nbool CConnman::Bind(const CService &addr, unsigned int flags) {\n    if (!(flags & BF_EXPLICIT) && IsLimited(addr))\n        return false;\n    std::string strError;\n    if (!BindListenPort(addr, strError, (flags & BF_WHITELIST) != 0)) {\n        if ((flags & BF_REPORT_ERROR) && clientInterface) {\n            clientInterface->ThreadSafeMessageBox(strError, \"\", CClientUIInterface::MSG_ERROR);\n        }\n        return false;\n    }\n    return true;\n}\n\nbool CConnman::InitBinds(const std::vector<CService>& binds, const std::vector<CService>& whiteBinds) {\n    bool fBound = false;\n    for (const auto& addrBind : binds) {\n        fBound |= Bind(addrBind, (BF_EXPLICIT | BF_REPORT_ERROR));\n    }\n    for (const auto& addrBind : whiteBinds) {\n        fBound |= Bind(addrBind, (BF_EXPLICIT | BF_REPORT_ERROR | BF_WHITELIST));\n    }\n    if (binds.empty() && whiteBinds.empty()) {\n        struct in_addr inaddr_any;\n        inaddr_any.s_addr = INADDR_ANY;\n        fBound |= Bind(CService(in6addr_any, GetListenPort()), BF_NONE);\n        fBound |= Bind(CService(inaddr_any, GetListenPort()), !fBound ? BF_REPORT_ERROR : BF_NONE);\n    }\n    return fBound;\n}\n\nbool CConnman::Start(CScheduler& scheduler, const Options& connOptions)\n{\n    Init(connOptions);\n\n    {\n        LOCK(cs_totalBytesRecv);\n        nTotalBytesRecv = 0;\n    }\n    {\n        LOCK(cs_totalBytesSent);\n        nTotalBytesSent = 0;\n        nMaxOutboundTotalBytesSentInCycle = 0;\n        nMaxOutboundCycleStartTime = 0;\n    }\n\n    if (fListen && !InitBinds(connOptions.vBinds, connOptions.vWhiteBinds)) {\n        if (clientInterface) {\n            clientInterface->ThreadSafeMessageBox(\n                _(\"Failed to listen on any port. Use -listen=0 if you want this.\"),\n                \"\", CClientUIInterface::MSG_ERROR);\n        }\n        return false;\n    }\n\n    for (const auto& strDest : connOptions.vSeedNodes) {\n        AddOneShot(strDest);\n    }\n\n    if (clientInterface) {\n        clientInterface->InitMessage(_(\"Loading P2P addresses...\"));\n    }\n    // Load addresses from peers.dat\n    int64_t nStart = GetTimeMillis();\n    {\n        CAddrDB adb;\n        if (adb.Read(addrman))\n            LogPrintf(\"Loaded %i addresses from peers.dat  %dms\\n\", addrman.size(), GetTimeMillis() - nStart);\n        else {\n            addrman.Clear(); // Addrman can be in an inconsistent state after failure, reset it\n            LogPrintf(\"Invalid or missing peers.dat; recreating\\n\");\n            DumpAddresses();\n        }\n    }\n    if (clientInterface)\n        clientInterface->InitMessage(_(\"Loading banlist...\"));\n    // Load addresses from banlist.dat\n    nStart = GetTimeMillis();\n    CBanDB bandb;\n    banmap_t banmap;\n    if (bandb.Read(banmap)) {\n        SetBanned(banmap); // thread save setter\n        SetBannedSetDirty(false); // no need to write down, just read data\n        SweepBanned(); // sweep out unused entries\n\n        LogPrint(BCLog::NET, \"Loaded %d banned node ips/subnets from banlist.dat  %dms\\n\",\n            banmap.size(), GetTimeMillis() - nStart);\n    } else {\n        LogPrintf(\"Invalid or missing banlist.dat; recreating\\n\");\n        SetBannedSetDirty(true); // force write\n        DumpBanlist();\n    }\n\n    uiInterface.InitMessage(_(\"Starting network threads...\"));\n\n    fAddressesInitialized = true;\n\n    if (semOutbound == nullptr) {\n        // initialize semaphore\n        semOutbound = MakeUnique<CSemaphore>(std::min((nMaxOutbound + nMaxFeeler), nMaxConnections));\n    }\n    if (semAddnode == nullptr) {\n        // initialize semaphore\n        semAddnode = MakeUnique<CSemaphore>(nMaxAddnode);\n    }\n\n    //\n    // Start threads\n    //\n    assert(m_msgproc);\n    InterruptSocks5(false);\n    interruptNet.reset();\n    flagInterruptMsgProc = false;\n\n    {\n        std::unique_lock<std::mutex> lock(mutexMsgProc);\n        fMsgProcWake = false;\n    }\n\n    // Send and receive from sockets, accept connections\n    threadSocketHandler = std::thread(&TraceThread<std::function<void()> >, \"net\", std::function<void()>(std::bind(&CConnman::ThreadSocketHandler, this)));\n\n    if (!gArgs.GetBoolArg(\"-dnsseed\", true))\n        LogPrintf(\"DNS seeding disabled\\n\");\n    else\n        threadDNSAddressSeed = std::thread(&TraceThread<std::function<void()> >, \"dnsseed\", std::function<void()>(std::bind(&CConnman::ThreadDNSAddressSeed, this)));\n\n    // Initiate outbound connections from -addnode\n    threadOpenAddedConnections = std::thread(&TraceThread<std::function<void()> >, \"addcon\", std::function<void()>(std::bind(&CConnman::ThreadOpenAddedConnections, this)));\n\n    if (connOptions.m_use_addrman_outgoing && !connOptions.m_specified_outgoing.empty()) {\n        if (clientInterface) {\n            clientInterface->ThreadSafeMessageBox(\n                _(\"Cannot provide specific connections and have addrman find outgoing connections at the same.\"),\n                \"\", CClientUIInterface::MSG_ERROR);\n        }\n        return false;\n    }\n    if (connOptions.m_use_addrman_outgoing || !connOptions.m_specified_outgoing.empty())\n        threadOpenConnections = std::thread(&TraceThread<std::function<void()> >, \"opencon\", std::function<void()>(std::bind(&CConnman::ThreadOpenConnections, this, connOptions.m_specified_outgoing)));\n\n    // Process messages\n    threadMessageHandler = std::thread(&TraceThread<std::function<void()> >, \"msghand\", std::function<void()>(std::bind(&CConnman::ThreadMessageHandler, this)));\n\n    // Dump network addresses\n    scheduler.scheduleEvery(std::bind(&CConnman::DumpData, this), DUMP_ADDRESSES_INTERVAL * 1000);\n\n    return true;\n}\n\nclass CNetCleanup\n{\npublic:\n    CNetCleanup() {}\n\n    ~CNetCleanup()\n    {\n#ifdef WIN32\n        // Shutdown Windows Sockets\n        WSACleanup();\n#endif\n    }\n}\ninstance_of_cnetcleanup;\n\nvoid CConnman::Interrupt()\n{\n    {\n        std::lock_guard<std::mutex> lock(mutexMsgProc);\n        flagInterruptMsgProc = true;\n    }\n    condMsgProc.notify_all();\n\n    interruptNet();\n    InterruptSocks5(true);\n\n    if (semOutbound) {\n        for (int i=0; i<(nMaxOutbound + nMaxFeeler); i++) {\n            semOutbound->post();\n        }\n    }\n\n    if (semAddnode) {\n        for (int i=0; i<nMaxAddnode; i++) {\n            semAddnode->post();\n        }\n    }\n}\n\nvoid CConnman::Stop()\n{\n    if (threadMessageHandler.joinable())\n        threadMessageHandler.join();\n    if (threadOpenConnections.joinable())\n        threadOpenConnections.join();\n    if (threadOpenAddedConnections.joinable())\n        threadOpenAddedConnections.join();\n    if (threadDNSAddressSeed.joinable())\n        threadDNSAddressSeed.join();\n    if (threadSocketHandler.joinable())\n        threadSocketHandler.join();\n\n    if (fAddressesInitialized)\n    {\n        DumpData();\n        fAddressesInitialized = false;\n    }\n\n    // Close sockets\n    for (CNode* pnode : vNodes)\n        pnode->CloseSocketDisconnect();\n    for (ListenSocket& hListenSocket : vhListenSocket)\n        if (hListenSocket.socket != INVALID_SOCKET)\n            if (!CloseSocket(hListenSocket.socket))\n                LogPrintf(\"CloseSocket(hListenSocket) failed with error %s\\n\", NetworkErrorString(WSAGetLastError()));\n\n    // clean up some globals (to help leak detection)\n    for (CNode *pnode : vNodes) {\n        DeleteNode(pnode);\n    }\n    for (CNode *pnode : vNodesDisconnected) {\n        DeleteNode(pnode);\n    }\n    vNodes.clear();\n    vNodesDisconnected.clear();\n    vhListenSocket.clear();\n    semOutbound.reset();\n    semAddnode.reset();\n}\n\nvoid CConnman::DeleteNode(CNode* pnode)\n{\n    assert(pnode);\n    bool fUpdateConnectionTime = false;\n    m_msgproc->FinalizeNode(pnode->GetId(), fUpdateConnectionTime);\n    if(fUpdateConnectionTime) {\n        addrman.Connected(pnode->addr);\n    }\n    delete pnode;\n}\n\nCConnman::~CConnman()\n{\n    Interrupt();\n    Stop();\n}\n\nsize_t CConnman::GetAddressCount() const\n{\n    return addrman.size();\n}\n\nvoid CConnman::SetServices(const CService &addr, ServiceFlags nServices)\n{\n    addrman.SetServices(addr, nServices);\n}\n\nvoid CConnman::MarkAddressGood(const CAddress& addr)\n{\n    addrman.Good(addr);\n}\n\nvoid CConnman::AddNewAddresses(const std::vector<CAddress>& vAddr, const CAddress& addrFrom, int64_t nTimePenalty)\n{\n    addrman.Add(vAddr, addrFrom, nTimePenalty);\n}\n\nstd::vector<CAddress> CConnman::GetAddresses()\n{\n    return addrman.GetAddr();\n}\n\nbool CConnman::AddNode(const std::string& strNode)\n{\n    LOCK(cs_vAddedNodes);\n    for (const std::string& it : vAddedNodes) {\n        if (strNode == it) return false;\n    }\n\n    vAddedNodes.push_back(strNode);\n    return true;\n}\n\nbool CConnman::RemoveAddedNode(const std::string& strNode)\n{\n    LOCK(cs_vAddedNodes);\n    for(std::vector<std::string>::iterator it = vAddedNodes.begin(); it != vAddedNodes.end(); ++it) {\n        if (strNode == *it) {\n            vAddedNodes.erase(it);\n            return true;\n        }\n    }\n    return false;\n}\n\nsize_t CConnman::GetNodeCount(NumConnections flags)\n{\n    LOCK(cs_vNodes);\n    if (flags == CConnman::CONNECTIONS_ALL) // Shortcut if we want total\n        return vNodes.size();\n\n    int nNum = 0;\n    for (const auto& pnode : vNodes) {\n        if (flags & (pnode->fInbound ? CONNECTIONS_IN : CONNECTIONS_OUT)) {\n            nNum++;\n        }\n    }\n\n    return nNum;\n}\n\nvoid CConnman::GetNodeStats(std::vector<CNodeStats>& vstats)\n{\n    vstats.clear();\n    LOCK(cs_vNodes);\n    vstats.reserve(vNodes.size());\n    for (CNode* pnode : vNodes) {\n        vstats.emplace_back();\n        pnode->copyStats(vstats.back());\n    }\n}\n\nbool CConnman::DisconnectNode(const std::string& strNode)\n{\n    LOCK(cs_vNodes);\n    if (CNode* pnode = FindNode(strNode)) {\n        pnode->fDisconnect = true;\n        return true;\n    }\n    return false;\n}\nbool CConnman::DisconnectNode(NodeId id)\n{\n    LOCK(cs_vNodes);\n    for(CNode* pnode : vNodes) {\n        if (id == pnode->GetId()) {\n            pnode->fDisconnect = true;\n            return true;\n        }\n    }\n    return false;\n}\n\nvoid CConnman::RecordBytesRecv(uint64_t bytes)\n{\n    LOCK(cs_totalBytesRecv);\n    nTotalBytesRecv += bytes;\n}\n\nvoid CConnman::RecordBytesSent(uint64_t bytes)\n{\n    LOCK(cs_totalBytesSent);\n    nTotalBytesSent += bytes;\n\n    uint64_t now = GetTime();\n    if (nMaxOutboundCycleStartTime + nMaxOutboundTimeframe < now)\n    {\n        // timeframe expired, reset cycle\n        nMaxOutboundCycleStartTime = now;\n        nMaxOutboundTotalBytesSentInCycle = 0;\n    }\n\n    // TODO, exclude whitebind peers\n    nMaxOutboundTotalBytesSentInCycle += bytes;\n}\n\nvoid CConnman::SetMaxOutboundTarget(uint64_t limit)\n{\n    LOCK(cs_totalBytesSent);\n    nMaxOutboundLimit = limit;\n}\n\nuint64_t CConnman::GetMaxOutboundTarget()\n{\n    LOCK(cs_totalBytesSent);\n    return nMaxOutboundLimit;\n}\n\nuint64_t CConnman::GetMaxOutboundTimeframe()\n{\n    LOCK(cs_totalBytesSent);\n    return nMaxOutboundTimeframe;\n}\n\nuint64_t CConnman::GetMaxOutboundTimeLeftInCycle()\n{\n    LOCK(cs_totalBytesSent);\n    if (nMaxOutboundLimit == 0)\n        return 0;\n\n    if (nMaxOutboundCycleStartTime == 0)\n        return nMaxOutboundTimeframe;\n\n    uint64_t cycleEndTime = nMaxOutboundCycleStartTime + nMaxOutboundTimeframe;\n    uint64_t now = GetTime();\n    return (cycleEndTime < now) ? 0 : cycleEndTime - GetTime();\n}\n\nvoid CConnman::SetMaxOutboundTimeframe(uint64_t timeframe)\n{\n    LOCK(cs_totalBytesSent);\n    if (nMaxOutboundTimeframe != timeframe)\n    {\n        // reset measure-cycle in case of changing\n        // the timeframe\n        nMaxOutboundCycleStartTime = GetTime();\n    }\n    nMaxOutboundTimeframe = timeframe;\n}\n\nbool CConnman::OutboundTargetReached(bool historicalBlockServingLimit)\n{\n    LOCK(cs_totalBytesSent);\n    if (nMaxOutboundLimit == 0)\n        return false;\n\n    if (historicalBlockServingLimit)\n    {\n        // keep a large enough buffer to at least relay each block once\n        uint64_t timeLeftInCycle = GetMaxOutboundTimeLeftInCycle();\n        uint64_t buffer = timeLeftInCycle / 600 * MAX_BLOCK_SERIALIZED_SIZE;\n        if (buffer >= nMaxOutboundLimit || nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit - buffer)\n            return true;\n    }\n    else if (nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit)\n        return true;\n\n    return false;\n}\n\nuint64_t CConnman::GetOutboundTargetBytesLeft()\n{\n    LOCK(cs_totalBytesSent);\n    if (nMaxOutboundLimit == 0)\n        return 0;\n\n    return (nMaxOutboundTotalBytesSentInCycle >= nMaxOutboundLimit) ? 0 : nMaxOutboundLimit - nMaxOutboundTotalBytesSentInCycle;\n}\n\nuint64_t CConnman::GetTotalBytesRecv()\n{\n    LOCK(cs_totalBytesRecv);\n    return nTotalBytesRecv;\n}\n\nuint64_t CConnman::GetTotalBytesSent()\n{\n    LOCK(cs_totalBytesSent);\n    return nTotalBytesSent;\n}\n\nServiceFlags CConnman::GetLocalServices() const\n{\n    return nLocalServices;\n}\n\nvoid CConnman::SetBestHeight(int height)\n{\n    nBestHeight.store(height, std::memory_order_release);\n}\n\nint CConnman::GetBestHeight() const\n{\n    return nBestHeight.load(std::memory_order_acquire);\n}\n\nunsigned int CConnman::GetReceiveFloodSize() const { return nReceiveFloodSize; }\n\nCNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string& addrNameIn, bool fInboundIn) :\n    nTimeConnected(GetSystemTimeInSeconds()),\n    addr(addrIn),\n    addrBind(addrBindIn),\n    fInbound(fInboundIn),\n    nKeyedNetGroup(nKeyedNetGroupIn),\n    addrKnown(5000, 0.001),\n    filterInventoryKnown(50000, 0.000001),\n    id(idIn),\n    nLocalHostNonce(nLocalHostNonceIn),\n    nLocalServices(nLocalServicesIn),\n    nMyStartingHeight(nMyStartingHeightIn),\n    nSendVersion(0)\n{\n    nServices = NODE_NONE;\n    hSocket = hSocketIn;\n    nRecvVersion = INIT_PROTO_VERSION;\n    nLastSend = 0;\n    nLastRecv = 0;\n    nSendBytes = 0;\n    nRecvBytes = 0;\n    nTimeOffset = 0;\n    addrName = addrNameIn == \"\" ? addr.ToStringIPPort() : addrNameIn;\n    nVersion = 0;\n    strSubVer = \"\";\n    fWhitelisted = false;\n    fOneShot = false;\n    m_manual_connection = false;\n    fClient = false; // set by version message\n    fFeeler = false;\n    fSuccessfullyConnected = false;\n    fDisconnect = false;\n    nRefCount = 0;\n    nSendSize = 0;\n    nSendOffset = 0;\n    hashContinue = uint256();\n    nStartingHeight = -1;\n    filterInventoryKnown.reset();\n    fSendMempool = false;\n    fGetAddr = false;\n    nNextLocalAddrSend = 0;\n    nNextAddrSend = 0;\n    nNextInvSend = 0;\n    fRelayTxes = false;\n    fSentAddr = false;\n    pfilter = MakeUnique<CBloomFilter>();\n    timeLastMempoolReq = 0;\n    nLastBlockTime = 0;\n    nLastTXTime = 0;\n    nPingNonceSent = 0;\n    nPingUsecStart = 0;\n    nPingUsecTime = 0;\n    fPingQueued = false;\n    nMinPingUsecTime = std::numeric_limits<int64_t>::max();\n    minFeeFilter = 0;\n    lastSentFeeFilter = 0;\n    nextSendTimeFeeFilter = 0;\n    fPauseRecv = false;\n    fPauseSend = false;\n    nProcessQueueSize = 0;\n\n    for (const std::string &msg : getAllNetMessageTypes())\n        mapRecvBytesPerMsgCmd[msg] = 0;\n    mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER] = 0;\n\n    if (fLogIPs) {\n        LogPrint(BCLog::NET, \"Added connection to %s peer=%d\\n\", addrName, id);\n    } else {\n        LogPrint(BCLog::NET, \"Added connection peer=%d\\n\", id);\n    }\n}\n\nCNode::~CNode()\n{\n    CloseSocket(hSocket);\n}\n\nvoid CNode::AskFor(const CInv& inv)\n{\n    if (mapAskFor.size() > MAPASKFOR_MAX_SZ || setAskFor.size() > SETASKFOR_MAX_SZ)\n        return;\n    // a peer may not have multiple non-responded queue positions for a single inv item\n    if (!setAskFor.insert(inv.hash).second)\n        return;\n\n    // We're using mapAskFor as a priority queue,\n    // the key is the earliest time the request can be sent\n    int64_t nRequestTime;\n    limitedmap<uint256, int64_t>::const_iterator it = mapAlreadyAskedFor.find(inv.hash);\n    if (it != mapAlreadyAskedFor.end())\n        nRequestTime = it->second;\n    else\n        nRequestTime = 0;\n    LogPrint(BCLog::NET, \"askfor %s  %d (%s) peer=%d\\n\", inv.ToString(), nRequestTime, DateTimeStrFormat(\"%H:%M:%S\", nRequestTime/1000000), id);\n\n    // Make sure not to reuse time indexes to keep things in the same order\n    int64_t nNow = GetTimeMicros() - 1000000;\n    static int64_t nLastTime;\n    ++nLastTime;\n    nNow = std::max(nNow, nLastTime);\n    nLastTime = nNow;\n\n    // Each retry is 2 minutes after the last\n    nRequestTime = std::max(nRequestTime + 2 * 60 * 1000000, nNow);\n    if (it != mapAlreadyAskedFor.end())\n        mapAlreadyAskedFor.update(it, nRequestTime);\n    else\n        mapAlreadyAskedFor.insert(std::make_pair(inv.hash, nRequestTime));\n    mapAskFor.insert(std::make_pair(nRequestTime, inv));\n}\n\nbool CConnman::NodeFullyConnected(const CNode* pnode)\n{\n    return pnode && pnode->fSuccessfullyConnected && !pnode->fDisconnect;\n}\n\nvoid CConnman::PushMessage(CNode* pnode, CSerializedNetMsg&& msg)\n{\n    size_t nMessageSize = msg.data.size();\n    size_t nTotalSize = nMessageSize + CMessageHeader::HEADER_SIZE;\n    LogPrint(BCLog::NET, \"sending %s (%d bytes) peer=%d\\n\",  SanitizeString(msg.command.c_str()), nMessageSize, pnode->GetId());\n\n    std::vector<unsigned char> serializedHeader;\n    serializedHeader.reserve(CMessageHeader::HEADER_SIZE);\n    uint256 hash = Hash(msg.data.data(), msg.data.data() + nMessageSize);\n    CMessageHeader hdr(Params().MessageStart(), msg.command.c_str(), nMessageSize);\n    memcpy(hdr.pchChecksum, hash.begin(), CMessageHeader::CHECKSUM_SIZE);\n\n    CVectorWriter{SER_NETWORK, INIT_PROTO_VERSION, serializedHeader, 0, hdr};\n\n    size_t nBytesSent = 0;\n    {\n        LOCK(pnode->cs_vSend);\n        bool optimisticSend(pnode->vSendMsg.empty());\n\n        //log total amount of bytes per command\n        pnode->mapSendBytesPerMsgCmd[msg.command] += nTotalSize;\n        pnode->nSendSize += nTotalSize;\n\n        if (pnode->nSendSize > nSendBufferMaxSize)\n            pnode->fPauseSend = true;\n        pnode->vSendMsg.push_back(std::move(serializedHeader));\n        if (nMessageSize)\n            pnode->vSendMsg.push_back(std::move(msg.data));\n\n        // If write queue empty, attempt \"optimistic write\"\n        if (optimisticSend == true)\n            nBytesSent = SocketSendData(pnode);\n    }\n    if (nBytesSent)\n        RecordBytesSent(nBytesSent);\n}\n\nbool CConnman::ForNode(NodeId id, std::function<bool(CNode* pnode)> func)\n{\n    CNode* found = nullptr;\n    LOCK(cs_vNodes);\n    for (auto&& pnode : vNodes) {\n        if(pnode->GetId() == id) {\n            found = pnode;\n            break;\n        }\n    }\n    return found != nullptr && NodeFullyConnected(found) && func(found);\n}\n\nint64_t PoissonNextSend(int64_t nNow, int average_interval_seconds) {\n    return nNow + (int64_t)(log1p(GetRand(1ULL << 48) * -0.0000000000000035527136788 /* -1/2^48 */) * average_interval_seconds * -1000000.0 + 0.5);\n}\n\nCSipHasher CConnman::GetDeterministicRandomizer(uint64_t id) const\n{\n    return CSipHasher(nSeed0, nSeed1).Write(id);\n}\n\nuint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad) const\n{\n    std::vector<unsigned char> vchNetGroup(ad.GetGroup());\n\n    return GetDeterministicRandomizer(RANDOMIZER_ID_NETGROUP).Write(vchNetGroup.data(), vchNetGroup.size()).Finalize();\n}\n"
  },
  {
    "path": "src/net.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_NET_H\n#define BITCOIN_NET_H\n\n#include <addrdb.h>\n#include <addrman.h>\n#include <amount.h>\n#include <bloom.h>\n#include <compat.h>\n#include <hash.h>\n#include <limitedmap.h>\n#include <netaddress.h>\n#include <policy/feerate.h>\n#include <protocol.h>\n#include <random.h>\n#include <streams.h>\n#include <sync.h>\n#include <uint256.h>\n#include <threadinterrupt.h>\n\n#include <atomic>\n#include <deque>\n#include <stdint.h>\n#include <thread>\n#include <memory>\n#include <condition_variable>\n\n#ifndef WIN32\n#include <arpa/inet.h>\n#endif\n\n\nclass CScheduler;\nclass CNode;\n\nnamespace boost {\n    class thread_group;\n} // namespace boost\n\n/** Time between pings automatically sent out for latency probing and keepalive (in seconds). */\nstatic const int PING_INTERVAL = 2 * 60;\n/** Time after which to disconnect, after waiting for a ping response (or inactivity). */\nstatic const int TIMEOUT_INTERVAL = 20 * 60;\n/** Run the feeler connection loop once every 2 minutes or 120 seconds. **/\nstatic const int FEELER_INTERVAL = 120;\n/** The maximum number of entries in an 'inv' protocol message */\nstatic const unsigned int MAX_INV_SZ = 50000;\n/** The maximum number of new addresses to accumulate before announcing. */\nstatic const unsigned int MAX_ADDR_TO_SEND = 1000;\n/** Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable). */\nstatic const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 4 * 1000 * 1000;\n/** Maximum length of strSubVer in `version` message */\nstatic const unsigned int MAX_SUBVERSION_LENGTH = 256;\n/** Maximum number of automatic outgoing nodes */\nstatic const int MAX_OUTBOUND_CONNECTIONS = 8;\n/** Maximum number of addnode outgoing nodes */\nstatic const int MAX_ADDNODE_CONNECTIONS = 8;\n/** -listen default */\nstatic const bool DEFAULT_LISTEN = true;\n/** -upnp default */\n#ifdef USE_UPNP\nstatic const bool DEFAULT_UPNP = USE_UPNP;\n#else\nstatic const bool DEFAULT_UPNP = false;\n#endif\n/** The maximum number of entries in mapAskFor */\nstatic const size_t MAPASKFOR_MAX_SZ = MAX_INV_SZ;\n/** The maximum number of entries in setAskFor (larger due to getdata latency)*/\nstatic const size_t SETASKFOR_MAX_SZ = 2 * MAX_INV_SZ;\n/** The maximum number of peer connections to maintain. */\nstatic const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125;\n/** The default for -maxuploadtarget. 0 = Unlimited */\nstatic const uint64_t DEFAULT_MAX_UPLOAD_TARGET = 0;\n/** The default timeframe for -maxuploadtarget. 1 day. */\nstatic const uint64_t MAX_UPLOAD_TIMEFRAME = 60 * 60 * 24;\n/** Default for blocks only*/\nstatic const bool DEFAULT_BLOCKSONLY = false;\n\nstatic const bool DEFAULT_FORCEDNSSEED = false;\nstatic const size_t DEFAULT_MAXRECEIVEBUFFER = 5 * 1000;\nstatic const size_t DEFAULT_MAXSENDBUFFER    = 1 * 1000;\n\n// NOTE: When adjusting this, update rpcnet:setban's help (\"24h\")\nstatic const unsigned int DEFAULT_MISBEHAVING_BANTIME = 60 * 60 * 24;  // Default 24-hour ban\n\ntypedef int64_t NodeId;\n\nstruct AddedNodeInfo\n{\n    std::string strAddedNode;\n    CService resolvedAddress;\n    bool fConnected;\n    bool fInbound;\n};\n\nclass CNodeStats;\nclass CClientUIInterface;\n\nstruct CSerializedNetMsg\n{\n    CSerializedNetMsg() = default;\n    CSerializedNetMsg(CSerializedNetMsg&&) = default;\n    CSerializedNetMsg& operator=(CSerializedNetMsg&&) = default;\n    // No copying, only moves.\n    CSerializedNetMsg(const CSerializedNetMsg& msg) = delete;\n    CSerializedNetMsg& operator=(const CSerializedNetMsg&) = delete;\n\n    std::vector<unsigned char> data;\n    std::string command;\n};\n\nclass NetEventsInterface;\nclass CConnman\n{\npublic:\n\n    enum NumConnections {\n        CONNECTIONS_NONE = 0,\n        CONNECTIONS_IN = (1U << 0),\n        CONNECTIONS_OUT = (1U << 1),\n        CONNECTIONS_ALL = (CONNECTIONS_IN | CONNECTIONS_OUT),\n    };\n\n    struct Options\n    {\n        ServiceFlags nLocalServices = NODE_NONE;\n        int nMaxConnections = 0;\n        int nMaxOutbound = 0;\n        int nMaxAddnode = 0;\n        int nMaxFeeler = 0;\n        int nBestHeight = 0;\n        CClientUIInterface* uiInterface = nullptr;\n        NetEventsInterface* m_msgproc = nullptr;\n        unsigned int nSendBufferMaxSize = 0;\n        unsigned int nReceiveFloodSize = 0;\n        uint64_t nMaxOutboundTimeframe = 0;\n        uint64_t nMaxOutboundLimit = 0;\n        std::vector<std::string> vSeedNodes;\n        std::vector<CSubNet> vWhitelistedRange;\n        std::vector<CService> vBinds, vWhiteBinds;\n        bool m_use_addrman_outgoing = true;\n        std::vector<std::string> m_specified_outgoing;\n        std::vector<std::string> m_added_nodes;\n    };\n\n    void Init(const Options& connOptions) {\n        nLocalServices = connOptions.nLocalServices;\n        nMaxConnections = connOptions.nMaxConnections;\n        nMaxOutbound = std::min(connOptions.nMaxOutbound, connOptions.nMaxConnections);\n        nMaxAddnode = connOptions.nMaxAddnode;\n        nMaxFeeler = connOptions.nMaxFeeler;\n        nBestHeight = connOptions.nBestHeight;\n        clientInterface = connOptions.uiInterface;\n        m_msgproc = connOptions.m_msgproc;\n        nSendBufferMaxSize = connOptions.nSendBufferMaxSize;\n        nReceiveFloodSize = connOptions.nReceiveFloodSize;\n        {\n            LOCK(cs_totalBytesSent);\n            nMaxOutboundTimeframe = connOptions.nMaxOutboundTimeframe;\n            nMaxOutboundLimit = connOptions.nMaxOutboundLimit;\n        }\n        vWhitelistedRange = connOptions.vWhitelistedRange;\n        {\n            LOCK(cs_vAddedNodes);\n            vAddedNodes = connOptions.m_added_nodes;\n        }\n    }\n\n    CConnman(uint64_t seed0, uint64_t seed1);\n    ~CConnman();\n    bool Start(CScheduler& scheduler, const Options& options);\n    void Stop();\n    void Interrupt();\n    bool GetNetworkActive() const { return fNetworkActive; };\n    void SetNetworkActive(bool active);\n    void OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound = nullptr, const char *strDest = nullptr, bool fOneShot = false, bool fFeeler = false, bool manual_connection = false);\n    bool CheckIncomingNonce(uint64_t nonce);\n\n    bool ForNode(NodeId id, std::function<bool(CNode* pnode)> func);\n\n    void PushMessage(CNode* pnode, CSerializedNetMsg&& msg);\n\n    template<typename Callable>\n    void ForEachNode(Callable&& func)\n    {\n        LOCK(cs_vNodes);\n        for (auto&& node : vNodes) {\n            if (NodeFullyConnected(node))\n                func(node);\n        }\n    };\n\n    template<typename Callable>\n    void ForEachNode(Callable&& func) const\n    {\n        LOCK(cs_vNodes);\n        for (auto&& node : vNodes) {\n            if (NodeFullyConnected(node))\n                func(node);\n        }\n    };\n\n    template<typename Callable, typename CallableAfter>\n    void ForEachNodeThen(Callable&& pre, CallableAfter&& post)\n    {\n        LOCK(cs_vNodes);\n        for (auto&& node : vNodes) {\n            if (NodeFullyConnected(node))\n                pre(node);\n        }\n        post();\n    };\n\n    template<typename Callable, typename CallableAfter>\n    void ForEachNodeThen(Callable&& pre, CallableAfter&& post) const\n    {\n        LOCK(cs_vNodes);\n        for (auto&& node : vNodes) {\n            if (NodeFullyConnected(node))\n                pre(node);\n        }\n        post();\n    };\n\n    // Addrman functions\n    size_t GetAddressCount() const;\n    void SetServices(const CService &addr, ServiceFlags nServices);\n    void MarkAddressGood(const CAddress& addr);\n    void AddNewAddresses(const std::vector<CAddress>& vAddr, const CAddress& addrFrom, int64_t nTimePenalty = 0);\n    std::vector<CAddress> GetAddresses();\n\n    // Denial-of-service detection/prevention\n    // The idea is to detect peers that are behaving\n    // badly and disconnect/ban them, but do it in a\n    // one-coding-mistake-won't-shatter-the-entire-network\n    // way.\n    // IMPORTANT:  There should be nothing I can give a\n    // node that it will forward on that will make that\n    // node's peers drop it. If there is, an attacker\n    // can isolate a node and/or try to split the network.\n    // Dropping a node for sending stuff that is invalid\n    // now but might be valid in a later version is also\n    // dangerous, because it can cause a network split\n    // between nodes running old code and nodes running\n    // new code.\n    void Ban(const CNetAddr& netAddr, const BanReason& reason, int64_t bantimeoffset = 0, bool sinceUnixEpoch = false);\n    void Ban(const CSubNet& subNet, const BanReason& reason, int64_t bantimeoffset = 0, bool sinceUnixEpoch = false);\n    void ClearBanned(); // needed for unit testing\n    bool IsBanned(CNetAddr ip);\n    bool IsBanned(CSubNet subnet);\n    bool Unban(const CNetAddr &ip);\n    bool Unban(const CSubNet &ip);\n    void GetBanned(banmap_t &banmap);\n    void SetBanned(const banmap_t &banmap);\n\n    // This allows temporarily exceeding nMaxOutbound, with the goal of finding\n    // a peer that is better than all our current peers.\n    void SetTryNewOutboundPeer(bool flag);\n    bool GetTryNewOutboundPeer();\n\n    // Return the number of outbound peers we have in excess of our target (eg,\n    // if we previously called SetTryNewOutboundPeer(true), and have since set\n    // to false, we may have extra peers that we wish to disconnect). This may\n    // return a value less than (num_outbound_connections - num_outbound_slots)\n    // in cases where some outbound connections are not yet fully connected, or\n    // not yet fully disconnected.\n    int GetExtraOutboundCount();\n\n    bool AddNode(const std::string& node);\n    bool RemoveAddedNode(const std::string& node);\n    std::vector<AddedNodeInfo> GetAddedNodeInfo();\n\n    size_t GetNodeCount(NumConnections num);\n    void GetNodeStats(std::vector<CNodeStats>& vstats);\n    bool DisconnectNode(const std::string& node);\n    bool DisconnectNode(NodeId id);\n\n    ServiceFlags GetLocalServices() const;\n\n    //!set the max outbound target in bytes\n    void SetMaxOutboundTarget(uint64_t limit);\n    uint64_t GetMaxOutboundTarget();\n\n    //!set the timeframe for the max outbound target\n    void SetMaxOutboundTimeframe(uint64_t timeframe);\n    uint64_t GetMaxOutboundTimeframe();\n\n    //!check if the outbound target is reached\n    // if param historicalBlockServingLimit is set true, the function will\n    // response true if the limit for serving historical blocks has been reached\n    bool OutboundTargetReached(bool historicalBlockServingLimit);\n\n    //!response the bytes left in the current max outbound cycle\n    // in case of no limit, it will always response 0\n    uint64_t GetOutboundTargetBytesLeft();\n\n    //!response the time in second left in the current max outbound cycle\n    // in case of no limit, it will always response 0\n    uint64_t GetMaxOutboundTimeLeftInCycle();\n\n    uint64_t GetTotalBytesRecv();\n    uint64_t GetTotalBytesSent();\n\n    void SetBestHeight(int height);\n    int GetBestHeight() const;\n\n    /** Get a unique deterministic randomizer. */\n    CSipHasher GetDeterministicRandomizer(uint64_t id) const;\n\n    unsigned int GetReceiveFloodSize() const;\n\n    void WakeMessageHandler();\nprivate:\n    struct ListenSocket {\n        SOCKET socket;\n        bool whitelisted;\n\n        ListenSocket(SOCKET socket_, bool whitelisted_) : socket(socket_), whitelisted(whitelisted_) {}\n    };\n\n    bool BindListenPort(const CService &bindAddr, std::string& strError, bool fWhitelisted = false);\n    bool Bind(const CService &addr, unsigned int flags);\n    bool InitBinds(const std::vector<CService>& binds, const std::vector<CService>& whiteBinds);\n    void ThreadOpenAddedConnections();\n    void AddOneShot(const std::string& strDest);\n    void ProcessOneShot();\n    void ThreadOpenConnections(std::vector<std::string> connect);\n    void ThreadMessageHandler();\n    void AcceptConnection(const ListenSocket& hListenSocket);\n    void ThreadSocketHandler();\n    void ThreadDNSAddressSeed();\n\n    uint64_t CalculateKeyedNetGroup(const CAddress& ad) const;\n\n    CNode* FindNode(const CNetAddr& ip);\n    CNode* FindNode(const CSubNet& subNet);\n    CNode* FindNode(const std::string& addrName);\n    CNode* FindNode(const CService& addr);\n\n    bool AttemptToEvictConnection();\n    CNode* ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure);\n    bool IsWhitelistedRange(const CNetAddr &addr);\n\n    void DeleteNode(CNode* pnode);\n\n    NodeId GetNewNodeId();\n\n    size_t SocketSendData(CNode *pnode) const;\n    //!check is the banlist has unwritten changes\n    bool BannedSetIsDirty();\n    //!set the \"dirty\" flag for the banlist\n    void SetBannedSetDirty(bool dirty=true);\n    //!clean unused entries (if bantime has expired)\n    void SweepBanned();\n    void DumpAddresses();\n    void DumpData();\n    void DumpBanlist();\n\n    // Network stats\n    void RecordBytesRecv(uint64_t bytes);\n    void RecordBytesSent(uint64_t bytes);\n\n    // Whether the node should be passed out in ForEach* callbacks\n    static bool NodeFullyConnected(const CNode* pnode);\n\n    // Network usage totals\n    CCriticalSection cs_totalBytesRecv;\n    CCriticalSection cs_totalBytesSent;\n    uint64_t nTotalBytesRecv GUARDED_BY(cs_totalBytesRecv);\n    uint64_t nTotalBytesSent GUARDED_BY(cs_totalBytesSent);\n\n    // outbound limit & stats\n    uint64_t nMaxOutboundTotalBytesSentInCycle GUARDED_BY(cs_totalBytesSent);\n    uint64_t nMaxOutboundCycleStartTime GUARDED_BY(cs_totalBytesSent);\n    uint64_t nMaxOutboundLimit GUARDED_BY(cs_totalBytesSent);\n    uint64_t nMaxOutboundTimeframe GUARDED_BY(cs_totalBytesSent);\n\n    // Whitelisted ranges. Any node connecting from these is automatically\n    // whitelisted (as well as those connecting to whitelisted binds).\n    std::vector<CSubNet> vWhitelistedRange;\n\n    unsigned int nSendBufferMaxSize;\n    unsigned int nReceiveFloodSize;\n\n    std::vector<ListenSocket> vhListenSocket;\n    std::atomic<bool> fNetworkActive;\n    banmap_t setBanned;\n    CCriticalSection cs_setBanned;\n    bool setBannedIsDirty;\n    bool fAddressesInitialized;\n    CAddrMan addrman;\n    std::deque<std::string> vOneShots;\n    CCriticalSection cs_vOneShots;\n    std::vector<std::string> vAddedNodes GUARDED_BY(cs_vAddedNodes);\n    CCriticalSection cs_vAddedNodes;\n    std::vector<CNode*> vNodes;\n    std::list<CNode*> vNodesDisconnected;\n    mutable CCriticalSection cs_vNodes;\n    std::atomic<NodeId> nLastNodeId;\n\n    /** Services this instance offers */\n    ServiceFlags nLocalServices;\n\n    std::unique_ptr<CSemaphore> semOutbound;\n    std::unique_ptr<CSemaphore> semAddnode;\n    int nMaxConnections;\n    int nMaxOutbound;\n    int nMaxAddnode;\n    int nMaxFeeler;\n    std::atomic<int> nBestHeight;\n    CClientUIInterface* clientInterface;\n    NetEventsInterface* m_msgproc;\n\n    /** SipHasher seeds for deterministic randomness */\n    const uint64_t nSeed0, nSeed1;\n\n    /** flag for waking the message processor. */\n    bool fMsgProcWake;\n\n    std::condition_variable condMsgProc;\n    std::mutex mutexMsgProc;\n    std::atomic<bool> flagInterruptMsgProc;\n\n    CThreadInterrupt interruptNet;\n\n    std::thread threadDNSAddressSeed;\n    std::thread threadSocketHandler;\n    std::thread threadOpenAddedConnections;\n    std::thread threadOpenConnections;\n    std::thread threadMessageHandler;\n\n    /** flag for deciding to connect to an extra outbound peer,\n     *  in excess of nMaxOutbound\n     *  This takes the place of a feeler connection */\n    std::atomic_bool m_try_another_outbound_peer;\n\n    friend struct CConnmanTest;\n};\nextern std::unique_ptr<CConnman> g_connman;\nvoid Discover(boost::thread_group& threadGroup);\nvoid MapPort(bool fUseUPnP);\nunsigned short GetListenPort();\nbool BindListenPort(const CService &bindAddr, std::string& strError, bool fWhitelisted = false);\n\nstruct CombinerAll\n{\n    typedef bool result_type;\n\n    template<typename I>\n    bool operator()(I first, I last) const\n    {\n        while (first != last) {\n            if (!(*first)) return false;\n            ++first;\n        }\n        return true;\n    }\n};\n\n/**\n * Interface for message handling\n */\nclass NetEventsInterface\n{\npublic:\n    virtual bool ProcessMessages(CNode* pnode, std::atomic<bool>& interrupt) = 0;\n    virtual bool SendMessages(CNode* pnode, std::atomic<bool>& interrupt) = 0;\n    virtual void InitializeNode(CNode* pnode) = 0;\n    virtual void FinalizeNode(NodeId id, bool& update_connection_time) = 0;\n};\n\nenum\n{\n    LOCAL_NONE,   // unknown\n    LOCAL_IF,     // address a local interface listens on\n    LOCAL_BIND,   // address explicit bound to\n    LOCAL_UPNP,   // address reported by UPnP\n    LOCAL_MANUAL, // address explicitly specified (-externalip=)\n\n    LOCAL_MAX\n};\n\nbool IsPeerAddrLocalGood(CNode *pnode);\nvoid AdvertiseLocal(CNode *pnode);\nvoid SetLimited(enum Network net, bool fLimited = true);\nbool IsLimited(enum Network net);\nbool IsLimited(const CNetAddr& addr);\nbool AddLocal(const CService& addr, int nScore = LOCAL_NONE);\nbool AddLocal(const CNetAddr& addr, int nScore = LOCAL_NONE);\nbool RemoveLocal(const CService& addr);\nbool SeenLocal(const CService& addr);\nbool IsLocal(const CService& addr);\nbool GetLocal(CService &addr, const CNetAddr *paddrPeer = nullptr);\nbool IsReachable(enum Network net);\nbool IsReachable(const CNetAddr &addr);\nCAddress GetLocalAddress(const CNetAddr *paddrPeer, ServiceFlags nLocalServices);\n\n\nextern bool fDiscover;\nextern bool fListen;\nextern bool fRelayTxes;\n\nextern limitedmap<uint256, int64_t> mapAlreadyAskedFor;\n\n/** Subversion as sent to the P2P network in `version` messages */\nextern std::string strSubVersion;\n\nstruct LocalServiceInfo {\n    int nScore;\n    int nPort;\n};\n\nextern CCriticalSection cs_mapLocalHost;\nextern std::map<CNetAddr, LocalServiceInfo> mapLocalHost;\ntypedef std::map<std::string, uint64_t> mapMsgCmdSize; //command, total bytes\n\nclass CNodeStats\n{\npublic:\n    NodeId nodeid;\n    ServiceFlags nServices;\n    bool fRelayTxes;\n    int64_t nLastSend;\n    int64_t nLastRecv;\n    int64_t nTimeConnected;\n    int64_t nTimeOffset;\n    std::string addrName;\n    int nVersion;\n    std::string cleanSubVer;\n    bool fInbound;\n    bool m_manual_connection;\n    int nStartingHeight;\n    uint64_t nSendBytes;\n    mapMsgCmdSize mapSendBytesPerMsgCmd;\n    uint64_t nRecvBytes;\n    mapMsgCmdSize mapRecvBytesPerMsgCmd;\n    bool fWhitelisted;\n    double dPingTime;\n    double dPingWait;\n    double dMinPing;\n    // Our address, as reported by the peer\n    std::string addrLocal;\n    // Address of this peer\n    CAddress addr;\n    // Bind address of our side of the connection\n    CAddress addrBind;\n};\n\n\n\n\nclass CNetMessage {\nprivate:\n    mutable CHash256 hasher;\n    mutable uint256 data_hash;\npublic:\n    bool in_data;                   // parsing header (false) or data (true)\n\n    CDataStream hdrbuf;             // partially received header\n    CMessageHeader hdr;             // complete header\n    unsigned int nHdrPos;\n\n    CDataStream vRecv;              // received message data\n    unsigned int nDataPos;\n\n    int64_t nTime;                  // time (in microseconds) of message receipt.\n\n    CNetMessage(const CMessageHeader::MessageStartChars& pchMessageStartIn, int nTypeIn, int nVersionIn) : hdrbuf(nTypeIn, nVersionIn), hdr(pchMessageStartIn), vRecv(nTypeIn, nVersionIn) {\n        hdrbuf.resize(24);\n        in_data = false;\n        nHdrPos = 0;\n        nDataPos = 0;\n        nTime = 0;\n    }\n\n    bool complete() const\n    {\n        if (!in_data)\n            return false;\n        return (hdr.nMessageSize == nDataPos);\n    }\n\n    const uint256& GetMessageHash() const;\n\n    void SetVersion(int nVersionIn)\n    {\n        hdrbuf.SetVersion(nVersionIn);\n        vRecv.SetVersion(nVersionIn);\n    }\n\n    int readHeader(const char *pch, unsigned int nBytes);\n    int readData(const char *pch, unsigned int nBytes);\n};\n\n\n/** Information about a peer */\nclass CNode\n{\n    friend class CConnman;\npublic:\n    // socket\n    std::atomic<ServiceFlags> nServices;\n    SOCKET hSocket;\n    size_t nSendSize; // total size of all vSendMsg entries\n    size_t nSendOffset; // offset inside the first vSendMsg already sent\n    uint64_t nSendBytes;\n    std::deque<std::vector<unsigned char>> vSendMsg;\n    CCriticalSection cs_vSend;\n    CCriticalSection cs_hSocket;\n    CCriticalSection cs_vRecv;\n\n    CCriticalSection cs_vProcessMsg;\n    std::list<CNetMessage> vProcessMsg;\n    size_t nProcessQueueSize;\n\n    CCriticalSection cs_sendProcessing;\n\n    std::deque<CInv> vRecvGetData;\n    uint64_t nRecvBytes;\n    std::atomic<int> nRecvVersion;\n\n    std::atomic<int64_t> nLastSend;\n    std::atomic<int64_t> nLastRecv;\n    const int64_t nTimeConnected;\n    std::atomic<int64_t> nTimeOffset;\n    // Address of this peer\n    const CAddress addr;\n    // Bind address of our side of the connection\n    const CAddress addrBind;\n    std::atomic<int> nVersion;\n    // strSubVer is whatever byte array we read from the wire. However, this field is intended\n    // to be printed out, displayed to humans in various forms and so on. So we sanitize it and\n    // store the sanitized version in cleanSubVer. The original should be used when dealing with\n    // the network or wire types and the cleaned string used when displayed or logged.\n    std::string strSubVer, cleanSubVer;\n    CCriticalSection cs_SubVer; // used for both cleanSubVer and strSubVer\n    bool fWhitelisted; // This peer can bypass DoS banning.\n    bool fFeeler; // If true this node is being used as a short lived feeler.\n    bool fOneShot;\n    bool m_manual_connection;\n    bool fClient;\n    const bool fInbound;\n    std::atomic_bool fSuccessfullyConnected;\n    std::atomic_bool fDisconnect;\n    // We use fRelayTxes for two purposes -\n    // a) it allows us to not relay tx invs before receiving the peer's version message\n    // b) the peer may tell us in its version message that we should not relay tx invs\n    //    unless it loads a bloom filter.\n    bool fRelayTxes; //protected by cs_filter\n    bool fSentAddr;\n    CSemaphoreGrant grantOutbound;\n    CCriticalSection cs_filter;\n    std::unique_ptr<CBloomFilter> pfilter;\n    std::atomic<int> nRefCount;\n\n    const uint64_t nKeyedNetGroup;\n    std::atomic_bool fPauseRecv;\n    std::atomic_bool fPauseSend;\nprotected:\n\n    mapMsgCmdSize mapSendBytesPerMsgCmd;\n    mapMsgCmdSize mapRecvBytesPerMsgCmd;\n\npublic:\n    uint256 hashContinue;\n    std::atomic<int> nStartingHeight;\n\n    // flood relay\n    std::vector<CAddress> vAddrToSend;\n    CRollingBloomFilter addrKnown;\n    bool fGetAddr;\n    std::set<uint256> setKnown;\n    int64_t nNextAddrSend;\n    int64_t nNextLocalAddrSend;\n\n    // inventory based relay\n    CRollingBloomFilter filterInventoryKnown;\n    // Set of transaction ids we still have to announce.\n    // They are sorted by the mempool before relay, so the order is not important.\n    std::set<uint256> setInventoryTxToSend;\n    // List of block ids we still have announce.\n    // There is no final sorting before sending, as they are always sent immediately\n    // and in the order requested.\n    std::vector<uint256> vInventoryBlockToSend;\n    CCriticalSection cs_inventory;\n    std::set<uint256> setAskFor;\n    std::multimap<int64_t, CInv> mapAskFor;\n    int64_t nNextInvSend;\n    // Used for headers announcements - unfiltered blocks to relay\n    // Also protected by cs_inventory\n    std::vector<uint256> vBlockHashesToAnnounce;\n    // Used for BIP35 mempool sending, also protected by cs_inventory\n    bool fSendMempool;\n\n    // Last time a \"MEMPOOL\" request was serviced.\n    std::atomic<int64_t> timeLastMempoolReq;\n\n    // Block and TXN accept times\n    std::atomic<int64_t> nLastBlockTime;\n    std::atomic<int64_t> nLastTXTime;\n\n    // Ping time measurement:\n    // The pong reply we're expecting, or 0 if no pong expected.\n    std::atomic<uint64_t> nPingNonceSent;\n    // Time (in usec) the last ping was sent, or 0 if no ping was ever sent.\n    std::atomic<int64_t> nPingUsecStart;\n    // Last measured round-trip time.\n    std::atomic<int64_t> nPingUsecTime;\n    // Best measured round-trip time.\n    std::atomic<int64_t> nMinPingUsecTime;\n    // Whether a ping is requested.\n    std::atomic<bool> fPingQueued;\n    // Minimum fee rate with which to filter inv's to this node\n    CAmount minFeeFilter;\n    CCriticalSection cs_feeFilter;\n    CAmount lastSentFeeFilter;\n    int64_t nextSendTimeFeeFilter;\n\n    CNode(NodeId id, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn, SOCKET hSocketIn, const CAddress &addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress &addrBindIn, const std::string &addrNameIn = \"\", bool fInboundIn = false);\n    ~CNode();\n    CNode(const CNode&) = delete;\n    CNode& operator=(const CNode&) = delete;\n\nprivate:\n    const NodeId id;\n    const uint64_t nLocalHostNonce;\n    // Services offered to this peer\n    const ServiceFlags nLocalServices;\n    const int nMyStartingHeight;\n    int nSendVersion;\n    std::list<CNetMessage> vRecvMsg;  // Used only by SocketHandler thread\n\n    mutable CCriticalSection cs_addrName;\n    std::string addrName;\n\n    // Our address, as reported by the peer\n    CService addrLocal;\n    mutable CCriticalSection cs_addrLocal;\npublic:\n\n    NodeId GetId() const {\n        return id;\n    }\n\n    uint64_t GetLocalNonce() const {\n        return nLocalHostNonce;\n    }\n\n    int GetMyStartingHeight() const {\n        return nMyStartingHeight;\n    }\n\n    int GetRefCount() const\n    {\n        assert(nRefCount >= 0);\n        return nRefCount;\n    }\n\n    bool ReceiveMsgBytes(const char *pch, unsigned int nBytes, bool& complete);\n\n    void SetRecvVersion(int nVersionIn)\n    {\n        nRecvVersion = nVersionIn;\n    }\n    int GetRecvVersion() const\n    {\n        return nRecvVersion;\n    }\n    void SetSendVersion(int nVersionIn);\n    int GetSendVersion() const;\n\n    CService GetAddrLocal() const;\n    //! May not be called more than once\n    void SetAddrLocal(const CService& addrLocalIn);\n\n    CNode* AddRef()\n    {\n        nRefCount++;\n        return this;\n    }\n\n    void Release()\n    {\n        nRefCount--;\n    }\n\n\n\n    void AddAddressKnown(const CAddress& _addr)\n    {\n        addrKnown.insert(_addr.GetKey());\n    }\n\n    void PushAddress(const CAddress& _addr, FastRandomContext &insecure_rand)\n    {\n        // Known checking here is only to save space from duplicates.\n        // SendMessages will filter it again for knowns that were added\n        // after addresses were pushed.\n        if (_addr.IsValid() && !addrKnown.contains(_addr.GetKey())) {\n            if (vAddrToSend.size() >= MAX_ADDR_TO_SEND) {\n                vAddrToSend[insecure_rand.randrange(vAddrToSend.size())] = _addr;\n            } else {\n                vAddrToSend.push_back(_addr);\n            }\n        }\n    }\n\n\n    void AddInventoryKnown(const CInv& inv)\n    {\n        {\n            LOCK(cs_inventory);\n            filterInventoryKnown.insert(inv.hash);\n        }\n    }\n\n    void PushInventory(const CInv& inv)\n    {\n        LOCK(cs_inventory);\n        if (inv.type == MSG_TX) {\n            if (!filterInventoryKnown.contains(inv.hash)) {\n                setInventoryTxToSend.insert(inv.hash);\n            }\n        } else if (inv.type == MSG_BLOCK) {\n            vInventoryBlockToSend.push_back(inv.hash);\n        }\n    }\n\n    void PushBlockHash(const uint256 &hash)\n    {\n        LOCK(cs_inventory);\n        vBlockHashesToAnnounce.push_back(hash);\n    }\n\n    void AskFor(const CInv& inv);\n\n    void CloseSocketDisconnect();\n\n    void copyStats(CNodeStats &stats);\n\n    ServiceFlags GetLocalServices() const\n    {\n        return nLocalServices;\n    }\n\n    std::string GetAddrName() const;\n    //! Sets the addrName only if it was not previously set\n    void MaybeSetAddrName(const std::string& addrNameIn);\n};\n\n\n\n\n\n/** Return a timestamp in the future (in microseconds) for exponentially distributed events. */\nint64_t PoissonNextSend(int64_t nNow, int average_interval_seconds);\n\n#endif // BITCOIN_NET_H\n"
  },
  {
    "path": "src/net_processing.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <net_processing.h>\n\n#include <addrman.h>\n#include <arith_uint256.h>\n#include <blockencodings.h>\n#include <chainparams.h>\n#include <consensus/validation.h>\n#include <hash.h>\n#include <init.h>\n#include <validation.h>\n#include <merkleblock.h>\n#include <netmessagemaker.h>\n#include <netbase.h>\n#include <policy/fees.h>\n#include <policy/policy.h>\n#include <primitives/block.h>\n#include <primitives/transaction.h>\n#include <random.h>\n#include <reverse_iterator.h>\n#include <scheduler.h>\n#include <tinyformat.h>\n#include <txmempool.h>\n#include <ui_interface.h>\n#include <util.h>\n#include <utilmoneystr.h>\n#include <utilstrencodings.h>\n\n#include <memory>\n\n#if defined(NDEBUG)\n# error \"Sugarchain cannot be compiled without assertions.\"\n#endif\n\nstd::atomic<int64_t> nTimeBestReceived(0); // Used only to inform the wallet of when we last received a block\n\nstruct IteratorComparator\n{\n    template<typename I>\n    bool operator()(const I& a, const I& b) const\n    {\n        return &(*a) < &(*b);\n    }\n};\n\nstruct COrphanTx {\n    // When modifying, adapt the copy of this definition in tests/DoS_tests.\n    CTransactionRef tx;\n    NodeId fromPeer;\n    int64_t nTimeExpire;\n};\nstatic CCriticalSection g_cs_orphans;\nstd::map<uint256, COrphanTx> mapOrphanTransactions GUARDED_BY(g_cs_orphans);\nstd::map<COutPoint, std::set<std::map<uint256, COrphanTx>::iterator, IteratorComparator>> mapOrphanTransactionsByPrev GUARDED_BY(g_cs_orphans);\nvoid EraseOrphansFor(NodeId peer);\n\nstatic size_t vExtraTxnForCompactIt GUARDED_BY(g_cs_orphans) = 0;\nstatic std::vector<std::pair<uint256, CTransactionRef>> vExtraTxnForCompact GUARDED_BY(g_cs_orphans);\n\nstatic const uint64_t RANDOMIZER_ID_ADDRESS_RELAY = 0x3cac0035b5866b90ULL; // SHA256(\"main address relay\")[0:8]\n\n/// Age after which a stale block will no longer be served if requested as\n/// protection against fingerprinting. Set to one month, denominated in seconds.\nstatic const int STALE_RELAY_AGE_LIMIT = 30 * 24 * 60 * 60;\n\n/// Age after which a block is considered historical for purposes of rate\n/// limiting block relay. Set to one week, denominated in seconds.\nstatic const int HISTORICAL_BLOCK_AGE = 7 * 24 * 60 * 60;\n\n// Internal stuff\nnamespace {\n    /** Number of nodes with fSyncStarted. */\n    int nSyncStarted = 0;\n\n    /**\n     * Sources of received blocks, saved to be able to send them reject\n     * messages or ban them when processing happens afterwards. Protected by\n     * cs_main.\n     * Set mapBlockSource[hash].second to false if the node should not be\n     * punished if the block is invalid.\n     */\n    std::map<uint256, std::pair<NodeId, bool>> mapBlockSource;\n\n    /**\n     * Filter for transactions that were recently rejected by\n     * AcceptToMemoryPool. These are not rerequested until the chain tip\n     * changes, at which point the entire filter is reset. Protected by\n     * cs_main.\n     *\n     * Without this filter we'd be re-requesting txs from each of our peers,\n     * increasing bandwidth consumption considerably. For instance, with 100\n     * peers, half of which relay a tx we don't accept, that might be a 50x\n     * bandwidth increase. A flooding attacker attempting to roll-over the\n     * filter using minimum-sized, 60byte, transactions might manage to send\n     * 1000/sec if we have fast peers, so we pick 120,000 to give our peers a\n     * two minute window to send invs to us.\n     *\n     * Decreasing the false positive rate is fairly cheap, so we pick one in a\n     * million to make it highly unlikely for users to have issues with this\n     * filter.\n     *\n     * Memory used: 1.3 MB\n     */\n    std::unique_ptr<CRollingBloomFilter> recentRejects;\n    uint256 hashRecentRejectsChainTip;\n\n    /** Blocks that are in flight, and that are in the queue to be downloaded. Protected by cs_main. */\n    struct QueuedBlock {\n        uint256 hash;\n        const CBlockIndex* pindex;                               //!< Optional.\n        bool fValidatedHeaders;                                  //!< Whether this block has validated headers at the time of request.\n        std::unique_ptr<PartiallyDownloadedBlock> partialBlock;  //!< Optional, used for CMPCTBLOCK downloads\n    };\n    std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> > mapBlocksInFlight;\n\n    /** Stack of nodes which we have set to announce using compact blocks */\n    std::list<NodeId> lNodesAnnouncingHeaderAndIDs;\n\n    /** Number of preferable block download peers. */\n    int nPreferredDownload = 0;\n\n    /** Number of peers from which we're downloading blocks. */\n    int nPeersWithValidatedDownloads = 0;\n\n    /** Number of outbound peers with m_chain_sync.m_protect. */\n    int g_outbound_peers_with_protect_from_disconnect = 0;\n\n    /** When our tip was last updated. */\n    std::atomic<int64_t> g_last_tip_update(0);\n\n    /** Relay map, protected by cs_main. */\n    typedef std::map<uint256, CTransactionRef> MapRelay;\n    MapRelay mapRelay;\n    /** Expiration-time ordered list of (expire time, relay map entry) pairs, protected by cs_main). */\n    std::deque<std::pair<int64_t, MapRelay::iterator>> vRelayExpiration;\n} // namespace\n\nnamespace {\n\nstruct CBlockReject {\n    unsigned char chRejectCode;\n    std::string strRejectReason;\n    uint256 hashBlock;\n};\n\n/**\n * Maintain validation-specific state about nodes, protected by cs_main, instead\n * by CNode's own locks. This simplifies asynchronous operation, where\n * processing of incoming data is done after the ProcessMessage call returns,\n * and we're no longer holding the node's locks.\n */\nstruct CNodeState {\n    //! The peer's address\n    const CService address;\n    //! Whether we have a fully established connection.\n    bool fCurrentlyConnected;\n    //! Accumulated misbehaviour score for this peer.\n    int nMisbehavior;\n    //! Whether this peer should be disconnected and banned (unless whitelisted).\n    bool fShouldBan;\n    //! String name of this peer (debugging/logging purposes).\n    const std::string name;\n    //! List of asynchronously-determined block rejections to notify this peer about.\n    std::vector<CBlockReject> rejects;\n    //! The best known block we know this peer has announced.\n    const CBlockIndex *pindexBestKnownBlock;\n    //! The hash of the last unknown block this peer has announced.\n    uint256 hashLastUnknownBlock;\n    //! The last full block we both have.\n    const CBlockIndex *pindexLastCommonBlock;\n    //! The best header we have sent our peer.\n    const CBlockIndex *pindexBestHeaderSent;\n    //! Length of current-streak of unconnecting headers announcements\n    int nUnconnectingHeaders;\n    //! Whether we've started headers synchronization with this peer.\n    bool fSyncStarted;\n    //! When to potentially disconnect peer for stalling headers download\n    int64_t nHeadersSyncTimeout;\n    //! Since when we're stalling block download progress (in microseconds), or 0.\n    int64_t nStallingSince;\n    std::list<QueuedBlock> vBlocksInFlight;\n    //! When the first entry in vBlocksInFlight started downloading. Don't care when vBlocksInFlight is empty.\n    int64_t nDownloadingSince;\n    int nBlocksInFlight;\n    int nBlocksInFlightValidHeaders;\n    //! Whether we consider this a preferred download peer.\n    bool fPreferredDownload;\n    //! Whether this peer wants invs or headers (when possible) for block announcements.\n    bool fPreferHeaders;\n    //! Whether this peer wants invs or cmpctblocks (when possible) for block announcements.\n    bool fPreferHeaderAndIDs;\n    /**\n      * Whether this peer will send us cmpctblocks if we request them.\n      * This is not used to gate request logic, as we really only care about fSupportsDesiredCmpctVersion,\n      * but is used as a flag to \"lock in\" the version of compact blocks (fWantsCmpctWitness) we send.\n      */\n    bool fProvidesHeaderAndIDs;\n    //! Whether this peer can give us witnesses\n    bool fHaveWitness;\n    //! Whether this peer wants witnesses in cmpctblocks/blocktxns\n    bool fWantsCmpctWitness;\n    /**\n     * If we've announced NODE_WITNESS to this peer: whether the peer sends witnesses in cmpctblocks/blocktxns,\n     * otherwise: whether this peer sends non-witnesses in cmpctblocks/blocktxns.\n     */\n    bool fSupportsDesiredCmpctVersion;\n\n    /** State used to enforce CHAIN_SYNC_TIMEOUT\n      * Only in effect for outbound, non-manual connections, with\n      * m_protect == false\n      * Algorithm: if a peer's best known block has less work than our tip,\n      * set a timeout CHAIN_SYNC_TIMEOUT seconds in the future:\n      *   - If at timeout their best known block now has more work than our tip\n      *     when the timeout was set, then either reset the timeout or clear it\n      *     (after comparing against our current tip's work)\n      *   - If at timeout their best known block still has less work than our\n      *     tip did when the timeout was set, then send a getheaders message,\n      *     and set a shorter timeout, HEADERS_RESPONSE_TIME seconds in future.\n      *     If their best known block is still behind when that new timeout is\n      *     reached, disconnect.\n      */\n    struct ChainSyncTimeoutState {\n        //! A timeout used for checking whether our peer has sufficiently synced\n        int64_t m_timeout;\n        //! A header with the work we require on our peer's chain\n        const CBlockIndex * m_work_header;\n        //! After timeout is reached, set to true after sending getheaders\n        bool m_sent_getheaders;\n        //! Whether this peer is protected from disconnection due to a bad/slow chain\n        bool m_protect;\n    };\n\n    ChainSyncTimeoutState m_chain_sync;\n\n    //! Time of last new block announcement\n    int64_t m_last_block_announcement;\n\n    CNodeState(CAddress addrIn, std::string addrNameIn) : address(addrIn), name(addrNameIn) {\n        fCurrentlyConnected = false;\n        nMisbehavior = 0;\n        fShouldBan = false;\n        pindexBestKnownBlock = nullptr;\n        hashLastUnknownBlock.SetNull();\n        pindexLastCommonBlock = nullptr;\n        pindexBestHeaderSent = nullptr;\n        nUnconnectingHeaders = 0;\n        fSyncStarted = false;\n        nHeadersSyncTimeout = 0;\n        nStallingSince = 0;\n        nDownloadingSince = 0;\n        nBlocksInFlight = 0;\n        nBlocksInFlightValidHeaders = 0;\n        fPreferredDownload = false;\n        fPreferHeaders = false;\n        fPreferHeaderAndIDs = false;\n        fProvidesHeaderAndIDs = false;\n        fHaveWitness = false;\n        fWantsCmpctWitness = false;\n        fSupportsDesiredCmpctVersion = false;\n        m_chain_sync = { 0, nullptr, false, false };\n        m_last_block_announcement = 0;\n    }\n};\n\n/** Map maintaining per-node state. Requires cs_main. */\nstd::map<NodeId, CNodeState> mapNodeState;\n\n// Requires cs_main.\nCNodeState *State(NodeId pnode) {\n    std::map<NodeId, CNodeState>::iterator it = mapNodeState.find(pnode);\n    if (it == mapNodeState.end())\n        return nullptr;\n    return &it->second;\n}\n\nvoid UpdatePreferredDownload(CNode* node, CNodeState* state)\n{\n    nPreferredDownload -= state->fPreferredDownload;\n\n    // Whether this node should be marked as a preferred download node.\n    state->fPreferredDownload = (!node->fInbound || node->fWhitelisted) && !node->fOneShot && !node->fClient;\n\n    nPreferredDownload += state->fPreferredDownload;\n}\n\nvoid PushNodeVersion(CNode *pnode, CConnman* connman, int64_t nTime)\n{\n    ServiceFlags nLocalNodeServices = pnode->GetLocalServices();\n    uint64_t nonce = pnode->GetLocalNonce();\n    int nNodeStartingHeight = pnode->GetMyStartingHeight();\n    NodeId nodeid = pnode->GetId();\n    CAddress addr = pnode->addr;\n\n    CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService(), addr.nServices));\n    CAddress addrMe = CAddress(CService(), nLocalNodeServices);\n\n    connman->PushMessage(pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::VERSION, PROTOCOL_VERSION, (uint64_t)nLocalNodeServices, nTime, addrYou, addrMe,\n            nonce, strSubVersion, nNodeStartingHeight, ::fRelayTxes));\n\n    if (fLogIPs) {\n        LogPrint(BCLog::NET, \"send version message: version %d, blocks=%d, us=%s, them=%s, peer=%d\\n\", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), addrYou.ToString(), nodeid);\n    } else {\n        LogPrint(BCLog::NET, \"send version message: version %d, blocks=%d, us=%s, peer=%d\\n\", PROTOCOL_VERSION, nNodeStartingHeight, addrMe.ToString(), nodeid);\n    }\n}\n\n// Requires cs_main.\n// Returns a bool indicating whether we requested this block.\n// Also used if a block was /not/ received and timed out or started with another peer\nbool MarkBlockAsReceived(const uint256& hash) {\n    std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> >::iterator itInFlight = mapBlocksInFlight.find(hash);\n    if (itInFlight != mapBlocksInFlight.end()) {\n        CNodeState *state = State(itInFlight->second.first);\n        assert(state != nullptr);\n        state->nBlocksInFlightValidHeaders -= itInFlight->second.second->fValidatedHeaders;\n        if (state->nBlocksInFlightValidHeaders == 0 && itInFlight->second.second->fValidatedHeaders) {\n            // Last validated block on the queue was received.\n            nPeersWithValidatedDownloads--;\n        }\n        if (state->vBlocksInFlight.begin() == itInFlight->second.second) {\n            // First block on the queue was received, update the start download time for the next one\n            state->nDownloadingSince = std::max(state->nDownloadingSince, GetTimeMicros());\n        }\n        state->vBlocksInFlight.erase(itInFlight->second.second);\n        state->nBlocksInFlight--;\n        state->nStallingSince = 0;\n        mapBlocksInFlight.erase(itInFlight);\n        return true;\n    }\n    return false;\n}\n\n// Requires cs_main.\n// returns false, still setting pit, if the block was already in flight from the same peer\n// pit will only be valid as long as the same cs_main lock is being held\nbool MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, const CBlockIndex* pindex = nullptr, std::list<QueuedBlock>::iterator** pit = nullptr) {\n    CNodeState *state = State(nodeid);\n    assert(state != nullptr);\n\n    // Short-circuit most stuff in case its from the same node\n    std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> >::iterator itInFlight = mapBlocksInFlight.find(hash);\n    if (itInFlight != mapBlocksInFlight.end() && itInFlight->second.first == nodeid) {\n        if (pit) {\n            *pit = &itInFlight->second.second;\n        }\n        return false;\n    }\n\n    // Make sure it's not listed somewhere already.\n    MarkBlockAsReceived(hash);\n\n    std::list<QueuedBlock>::iterator it = state->vBlocksInFlight.insert(state->vBlocksInFlight.end(),\n            {hash, pindex, pindex != nullptr, std::unique_ptr<PartiallyDownloadedBlock>(pit ? new PartiallyDownloadedBlock(&mempool) : nullptr)});\n    state->nBlocksInFlight++;\n    state->nBlocksInFlightValidHeaders += it->fValidatedHeaders;\n    if (state->nBlocksInFlight == 1) {\n        // We're starting a block download (batch) from this peer.\n        state->nDownloadingSince = GetTimeMicros();\n    }\n    if (state->nBlocksInFlightValidHeaders == 1 && pindex != nullptr) {\n        nPeersWithValidatedDownloads++;\n    }\n    itInFlight = mapBlocksInFlight.insert(std::make_pair(hash, std::make_pair(nodeid, it))).first;\n    if (pit)\n        *pit = &itInFlight->second.second;\n    return true;\n}\n\n/** Check whether the last unknown block a peer advertised is not yet known. */\nvoid ProcessBlockAvailability(NodeId nodeid) {\n    CNodeState *state = State(nodeid);\n    assert(state != nullptr);\n\n    if (!state->hashLastUnknownBlock.IsNull()) {\n        BlockMap::iterator itOld = mapBlockIndex.find(state->hashLastUnknownBlock);\n        if (itOld != mapBlockIndex.end() && itOld->second->nChainWork > 0) {\n            if (state->pindexBestKnownBlock == nullptr || itOld->second->nChainWork >= state->pindexBestKnownBlock->nChainWork)\n                state->pindexBestKnownBlock = itOld->second;\n            state->hashLastUnknownBlock.SetNull();\n        }\n    }\n}\n\n/** Update tracking information about which blocks a peer is assumed to have. */\nvoid UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) {\n    CNodeState *state = State(nodeid);\n    assert(state != nullptr);\n\n    ProcessBlockAvailability(nodeid);\n\n    BlockMap::iterator it = mapBlockIndex.find(hash);\n    if (it != mapBlockIndex.end() && it->second->nChainWork > 0) {\n        // An actually better block was announced.\n        if (state->pindexBestKnownBlock == nullptr || it->second->nChainWork >= state->pindexBestKnownBlock->nChainWork)\n            state->pindexBestKnownBlock = it->second;\n    } else {\n        // An unknown block was announced; just assume that the latest one is the best one.\n        state->hashLastUnknownBlock = hash;\n    }\n}\n\nvoid MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid, CConnman* connman) {\n    AssertLockHeld(cs_main);\n    CNodeState* nodestate = State(nodeid);\n    if (!nodestate || !nodestate->fSupportsDesiredCmpctVersion) {\n        // Never ask from peers who can't provide witnesses.\n        return;\n    }\n    if (nodestate->fProvidesHeaderAndIDs) {\n        for (std::list<NodeId>::iterator it = lNodesAnnouncingHeaderAndIDs.begin(); it != lNodesAnnouncingHeaderAndIDs.end(); it++) {\n            if (*it == nodeid) {\n                lNodesAnnouncingHeaderAndIDs.erase(it);\n                lNodesAnnouncingHeaderAndIDs.push_back(nodeid);\n                return;\n            }\n        }\n        connman->ForNode(nodeid, [connman](CNode* pfrom){\n            uint64_t nCMPCTBLOCKVersion = (pfrom->GetLocalServices() & NODE_WITNESS) ? 2 : 1;\n            if (lNodesAnnouncingHeaderAndIDs.size() >= 3) {\n                // As per BIP152, we only get 3 of our peers to announce\n                // blocks using compact encodings.\n                connman->ForNode(lNodesAnnouncingHeaderAndIDs.front(), [connman, nCMPCTBLOCKVersion](CNode* pnodeStop){\n                    connman->PushMessage(pnodeStop, CNetMsgMaker(pnodeStop->GetSendVersion()).Make(NetMsgType::SENDCMPCT, /*fAnnounceUsingCMPCTBLOCK=*/false, nCMPCTBLOCKVersion));\n                    return true;\n                });\n                lNodesAnnouncingHeaderAndIDs.pop_front();\n            }\n            connman->PushMessage(pfrom, CNetMsgMaker(pfrom->GetSendVersion()).Make(NetMsgType::SENDCMPCT, /*fAnnounceUsingCMPCTBLOCK=*/true, nCMPCTBLOCKVersion));\n            lNodesAnnouncingHeaderAndIDs.push_back(pfrom->GetId());\n            return true;\n        });\n    }\n}\n\nbool TipMayBeStale(const Consensus::Params &consensusParams)\n{\n    AssertLockHeld(cs_main);\n    if (g_last_tip_update == 0) {\n        g_last_tip_update = GetTime();\n    }\n    return g_last_tip_update < GetTime() - consensusParams.nPowTargetSpacing * 3 && mapBlocksInFlight.empty();\n}\n\n// Requires cs_main\nbool CanDirectFetch(const Consensus::Params &consensusParams)\n{\n    return chainActive.Tip()->GetBlockTime() > GetAdjustedTime() - consensusParams.nPowTargetSpacing * 20;\n}\n\n// Requires cs_main\nbool PeerHasHeader(CNodeState *state, const CBlockIndex *pindex)\n{\n    if (state->pindexBestKnownBlock && pindex == state->pindexBestKnownBlock->GetAncestor(pindex->nHeight))\n        return true;\n    if (state->pindexBestHeaderSent && pindex == state->pindexBestHeaderSent->GetAncestor(pindex->nHeight))\n        return true;\n    return false;\n}\n\n/** Update pindexLastCommonBlock and add not-in-flight missing successors to vBlocks, until it has\n *  at most count entries. */\nvoid FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<const CBlockIndex*>& vBlocks, NodeId& nodeStaller, const Consensus::Params& consensusParams) {\n    if (count == 0)\n        return;\n\n    vBlocks.reserve(vBlocks.size() + count);\n    CNodeState *state = State(nodeid);\n    assert(state != nullptr);\n\n    // Make sure pindexBestKnownBlock is up to date, we'll need it.\n    ProcessBlockAvailability(nodeid);\n\n    if (state->pindexBestKnownBlock == nullptr || state->pindexBestKnownBlock->nChainWork < chainActive.Tip()->nChainWork || state->pindexBestKnownBlock->nChainWork < nMinimumChainWork) {\n        // This peer has nothing interesting.\n        return;\n    }\n\n    if (state->pindexLastCommonBlock == nullptr) {\n        // Bootstrap quickly by guessing a parent of our best tip is the forking point.\n        // Guessing wrong in either direction is not a problem.\n        state->pindexLastCommonBlock = chainActive[std::min(state->pindexBestKnownBlock->nHeight, chainActive.Height())];\n    }\n\n    // If the peer reorganized, our previous pindexLastCommonBlock may not be an ancestor\n    // of its current tip anymore. Go back enough to fix that.\n    state->pindexLastCommonBlock = LastCommonAncestor(state->pindexLastCommonBlock, state->pindexBestKnownBlock);\n    if (state->pindexLastCommonBlock == state->pindexBestKnownBlock)\n        return;\n\n    std::vector<const CBlockIndex*> vToFetch;\n    const CBlockIndex *pindexWalk = state->pindexLastCommonBlock;\n    // Never fetch further than the best block we know the peer has, or more than BLOCK_DOWNLOAD_WINDOW + 1 beyond the last\n    // linked block we have in common with this peer. The +1 is so we can detect stalling, namely if we would be able to\n    // download that next block if the window were 1 larger.\n    int nWindowEnd = state->pindexLastCommonBlock->nHeight + BLOCK_DOWNLOAD_WINDOW;\n    int nMaxHeight = std::min<int>(state->pindexBestKnownBlock->nHeight, nWindowEnd + 1);\n    NodeId waitingfor = -1;\n    while (pindexWalk->nHeight < nMaxHeight) {\n        // Read up to 128 (or more, if more blocks than that are needed) successors of pindexWalk (towards\n        // pindexBestKnownBlock) into vToFetch. We fetch 128, because CBlockIndex::GetAncestor may be as expensive\n        // as iterating over ~100 CBlockIndex* entries anyway.\n        int nToFetch = std::min(nMaxHeight - pindexWalk->nHeight, std::max<int>(count - vBlocks.size(), 128));\n        vToFetch.resize(nToFetch);\n        pindexWalk = state->pindexBestKnownBlock->GetAncestor(pindexWalk->nHeight + nToFetch);\n        vToFetch[nToFetch - 1] = pindexWalk;\n        for (unsigned int i = nToFetch - 1; i > 0; i--) {\n            vToFetch[i - 1] = vToFetch[i]->pprev;\n        }\n\n        // Iterate over those blocks in vToFetch (in forward direction), adding the ones that\n        // are not yet downloaded and not in flight to vBlocks. In the mean time, update\n        // pindexLastCommonBlock as long as all ancestors are already downloaded, or if it's\n        // already part of our chain (and therefore don't need it even if pruned).\n        for (const CBlockIndex* pindex : vToFetch) {\n            if (!pindex->IsValid(BLOCK_VALID_TREE)) {\n                // We consider the chain that this peer is on invalid.\n                return;\n            }\n            if (!State(nodeid)->fHaveWitness && IsWitnessEnabled(pindex->pprev, consensusParams)) {\n                // We wouldn't download this block or its descendants from this peer.\n                return;\n            }\n            if (pindex->nStatus & BLOCK_HAVE_DATA || chainActive.Contains(pindex)) {\n                if (pindex->nChainTx)\n                    state->pindexLastCommonBlock = pindex;\n            } else if (mapBlocksInFlight.count(pindex->GetBlockHash()) == 0) {\n                // The block is not already downloaded, and not yet in flight.\n                if (pindex->nHeight > nWindowEnd) {\n                    // We reached the end of the window.\n                    if (vBlocks.size() == 0 && waitingfor != nodeid) {\n                        // We aren't able to fetch anything, but we would be if the download window was one larger.\n                        nodeStaller = waitingfor;\n                    }\n                    return;\n                }\n                vBlocks.push_back(pindex);\n                if (vBlocks.size() == count) {\n                    return;\n                }\n            } else if (waitingfor == -1) {\n                // This is the first already-in-flight block.\n                waitingfor = mapBlocksInFlight[pindex->GetBlockHash()].first;\n            }\n        }\n    }\n}\n\n} // namespace\n\n// This function is used for testing the stale tip eviction logic, see\n// DoS_tests.cpp\nvoid UpdateLastBlockAnnounceTime(NodeId node, int64_t time_in_seconds)\n{\n    LOCK(cs_main);\n    CNodeState *state = State(node);\n    if (state) state->m_last_block_announcement = time_in_seconds;\n}\n\n// Returns true for outbound peers, excluding manual connections, feelers, and\n// one-shots\nbool IsOutboundDisconnectionCandidate(const CNode *node)\n{\n    return !(node->fInbound || node->m_manual_connection || node->fFeeler || node->fOneShot);\n}\n\nvoid PeerLogicValidation::InitializeNode(CNode *pnode) {\n    CAddress addr = pnode->addr;\n    std::string addrName = pnode->GetAddrName();\n    NodeId nodeid = pnode->GetId();\n    {\n        LOCK(cs_main);\n        mapNodeState.emplace_hint(mapNodeState.end(), std::piecewise_construct, std::forward_as_tuple(nodeid), std::forward_as_tuple(addr, std::move(addrName)));\n    }\n    if(!pnode->fInbound)\n        PushNodeVersion(pnode, connman, GetTime());\n}\n\nvoid PeerLogicValidation::FinalizeNode(NodeId nodeid, bool& fUpdateConnectionTime) {\n    fUpdateConnectionTime = false;\n    LOCK(cs_main);\n    CNodeState *state = State(nodeid);\n    assert(state != nullptr);\n\n    if (state->fSyncStarted)\n        nSyncStarted--;\n\n    if (state->nMisbehavior == 0 && state->fCurrentlyConnected) {\n        fUpdateConnectionTime = true;\n    }\n\n    for (const QueuedBlock& entry : state->vBlocksInFlight) {\n        mapBlocksInFlight.erase(entry.hash);\n    }\n    EraseOrphansFor(nodeid);\n    nPreferredDownload -= state->fPreferredDownload;\n    nPeersWithValidatedDownloads -= (state->nBlocksInFlightValidHeaders != 0);\n    assert(nPeersWithValidatedDownloads >= 0);\n    g_outbound_peers_with_protect_from_disconnect -= state->m_chain_sync.m_protect;\n    assert(g_outbound_peers_with_protect_from_disconnect >= 0);\n\n    mapNodeState.erase(nodeid);\n\n    if (mapNodeState.empty()) {\n        // Do a consistency check after the last peer is removed.\n        assert(mapBlocksInFlight.empty());\n        assert(nPreferredDownload == 0);\n        assert(nPeersWithValidatedDownloads == 0);\n        assert(g_outbound_peers_with_protect_from_disconnect == 0);\n    }\n    LogPrint(BCLog::NET, \"Cleared nodestate for peer=%d\\n\", nodeid);\n}\n\nbool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats) {\n    LOCK(cs_main);\n    CNodeState *state = State(nodeid);\n    if (state == nullptr)\n        return false;\n    stats.nMisbehavior = state->nMisbehavior;\n    stats.nSyncHeight = state->pindexBestKnownBlock ? state->pindexBestKnownBlock->nHeight : -1;\n    stats.nCommonHeight = state->pindexLastCommonBlock ? state->pindexLastCommonBlock->nHeight : -1;\n    for (const QueuedBlock& queue : state->vBlocksInFlight) {\n        if (queue.pindex)\n            stats.vHeightInFlight.push_back(queue.pindex->nHeight);\n    }\n    return true;\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// mapOrphanTransactions\n//\n\nvoid AddToCompactExtraTransactions(const CTransactionRef& tx) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans)\n{\n    size_t max_extra_txn = gArgs.GetArg(\"-blockreconstructionextratxn\", DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN);\n    if (max_extra_txn <= 0)\n        return;\n    if (!vExtraTxnForCompact.size())\n        vExtraTxnForCompact.resize(max_extra_txn);\n    vExtraTxnForCompact[vExtraTxnForCompactIt] = std::make_pair(tx->GetWitnessHash(), tx);\n    vExtraTxnForCompactIt = (vExtraTxnForCompactIt + 1) % max_extra_txn;\n}\n\nbool AddOrphanTx(const CTransactionRef& tx, NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans)\n{\n    const uint256& hash = tx->GetHash();\n    if (mapOrphanTransactions.count(hash))\n        return false;\n\n    // Ignore big transactions, to avoid a\n    // send-big-orphans memory exhaustion attack. If a peer has a legitimate\n    // large transaction with a missing parent then we assume\n    // it will rebroadcast it later, after the parent transaction(s)\n    // have been mined or received.\n    // 100 orphans, each of which is at most 99,999 bytes big is\n    // at most 10 megabytes of orphans and somewhat more byprev index (in the worst case):\n    unsigned int sz = GetTransactionWeight(*tx);\n    if (sz >= MAX_STANDARD_TX_WEIGHT)\n    {\n        LogPrint(BCLog::MEMPOOL, \"ignoring large orphan tx (size: %u, hash: %s)\\n\", sz, hash.ToString());\n        return false;\n    }\n\n    auto ret = mapOrphanTransactions.emplace(hash, COrphanTx{tx, peer, GetTime() + ORPHAN_TX_EXPIRE_TIME});\n    assert(ret.second);\n    for (const CTxIn& txin : tx->vin) {\n        mapOrphanTransactionsByPrev[txin.prevout].insert(ret.first);\n    }\n\n    AddToCompactExtraTransactions(tx);\n\n    LogPrint(BCLog::MEMPOOL, \"stored orphan tx %s (mapsz %u outsz %u)\\n\", hash.ToString(),\n             mapOrphanTransactions.size(), mapOrphanTransactionsByPrev.size());\n    return true;\n}\n\nint static EraseOrphanTx(uint256 hash) EXCLUSIVE_LOCKS_REQUIRED(g_cs_orphans)\n{\n    std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.find(hash);\n    if (it == mapOrphanTransactions.end())\n        return 0;\n    for (const CTxIn& txin : it->second.tx->vin)\n    {\n        auto itPrev = mapOrphanTransactionsByPrev.find(txin.prevout);\n        if (itPrev == mapOrphanTransactionsByPrev.end())\n            continue;\n        itPrev->second.erase(it);\n        if (itPrev->second.empty())\n            mapOrphanTransactionsByPrev.erase(itPrev);\n    }\n    mapOrphanTransactions.erase(it);\n    return 1;\n}\n\nvoid EraseOrphansFor(NodeId peer)\n{\n    LOCK(g_cs_orphans);\n    int nErased = 0;\n    std::map<uint256, COrphanTx>::iterator iter = mapOrphanTransactions.begin();\n    while (iter != mapOrphanTransactions.end())\n    {\n        std::map<uint256, COrphanTx>::iterator maybeErase = iter++; // increment to avoid iterator becoming invalid\n        if (maybeErase->second.fromPeer == peer)\n        {\n            nErased += EraseOrphanTx(maybeErase->second.tx->GetHash());\n        }\n    }\n    if (nErased > 0) LogPrint(BCLog::MEMPOOL, \"Erased %d orphan tx from peer=%d\\n\", nErased, peer);\n}\n\n\nunsigned int LimitOrphanTxSize(unsigned int nMaxOrphans)\n{\n    LOCK(g_cs_orphans);\n\n    unsigned int nEvicted = 0;\n    static int64_t nNextSweep;\n    int64_t nNow = GetTime();\n    if (nNextSweep <= nNow) {\n        // Sweep out expired orphan pool entries:\n        int nErased = 0;\n        int64_t nMinExpTime = nNow + ORPHAN_TX_EXPIRE_TIME - ORPHAN_TX_EXPIRE_INTERVAL;\n        std::map<uint256, COrphanTx>::iterator iter = mapOrphanTransactions.begin();\n        while (iter != mapOrphanTransactions.end())\n        {\n            std::map<uint256, COrphanTx>::iterator maybeErase = iter++;\n            if (maybeErase->second.nTimeExpire <= nNow) {\n                nErased += EraseOrphanTx(maybeErase->second.tx->GetHash());\n            } else {\n                nMinExpTime = std::min(maybeErase->second.nTimeExpire, nMinExpTime);\n            }\n        }\n        // Sweep again 5 minutes after the next entry that expires in order to batch the linear scan.\n        nNextSweep = nMinExpTime + ORPHAN_TX_EXPIRE_INTERVAL;\n        if (nErased > 0) LogPrint(BCLog::MEMPOOL, \"Erased %d orphan tx due to expiration\\n\", nErased);\n    }\n    while (mapOrphanTransactions.size() > nMaxOrphans)\n    {\n        // Evict a random orphan:\n        uint256 randomhash = GetRandHash();\n        std::map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.lower_bound(randomhash);\n        if (it == mapOrphanTransactions.end())\n            it = mapOrphanTransactions.begin();\n        EraseOrphanTx(it->first);\n        ++nEvicted;\n    }\n    return nEvicted;\n}\n\n// Requires cs_main.\nvoid Misbehaving(NodeId pnode, int howmuch)\n{\n    if (howmuch == 0)\n        return;\n\n    CNodeState *state = State(pnode);\n    if (state == nullptr)\n        return;\n\n    state->nMisbehavior += howmuch;\n    int banscore = gArgs.GetArg(\"-banscore\", DEFAULT_BANSCORE_THRESHOLD);\n    if (state->nMisbehavior >= banscore && state->nMisbehavior - howmuch < banscore)\n    {\n        LogPrintf(\"%s: %s peer=%d (%d -> %d) BAN THRESHOLD EXCEEDED\\n\", __func__, state->name, pnode, state->nMisbehavior-howmuch, state->nMisbehavior);\n        state->fShouldBan = true;\n    } else\n        LogPrintf(\"%s: %s peer=%d (%d -> %d)\\n\", __func__, state->name, pnode, state->nMisbehavior-howmuch, state->nMisbehavior);\n}\n\n\n\n\n\n\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// blockchain -> download logic notification\n//\n\n// To prevent fingerprinting attacks, only send blocks/headers outside of the\n// active chain if they are no more than a month older (both in time, and in\n// best equivalent proof of work) than the best header chain we know about and\n// we fully-validated them at some point.\nstatic bool BlockRequestAllowed(const CBlockIndex* pindex, const Consensus::Params& consensusParams)\n{\n    AssertLockHeld(cs_main);\n    if (chainActive.Contains(pindex)) return true;\n    return pindex->IsValid(BLOCK_VALID_SCRIPTS) && (pindexBestHeader != nullptr) &&\n        (pindexBestHeader->GetBlockTime() - pindex->GetBlockTime() < STALE_RELAY_AGE_LIMIT) &&\n        (GetBlockProofEquivalentTime(*pindexBestHeader, *pindex, *pindexBestHeader, consensusParams) < STALE_RELAY_AGE_LIMIT);\n}\n\nPeerLogicValidation::PeerLogicValidation(CConnman* connmanIn, CScheduler &scheduler) : connman(connmanIn), m_stale_tip_check_time(0) {\n    // Initialize global variables that cannot be constructed at startup.\n    recentRejects.reset(new CRollingBloomFilter(120000, 0.000001));\n\n    const Consensus::Params& consensusParams = Params().GetConsensus();\n    // Stale tip checking and peer eviction are on two different timers, but we\n    // don't want them to get out of sync due to drift in the scheduler, so we\n    // combine them in one function and schedule at the quicker (peer-eviction)\n    // timer.\n    static_assert(EXTRA_PEER_CHECK_INTERVAL < STALE_CHECK_INTERVAL, \"peer eviction timer should be less than stale tip check timer\");\n    scheduler.scheduleEvery(std::bind(&PeerLogicValidation::CheckForStaleTipAndEvictPeers, this, consensusParams), EXTRA_PEER_CHECK_INTERVAL * 1000);\n}\n\nvoid PeerLogicValidation::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindex, const std::vector<CTransactionRef>& vtxConflicted) {\n    LOCK(g_cs_orphans);\n\n    std::vector<uint256> vOrphanErase;\n\n    for (const CTransactionRef& ptx : pblock->vtx) {\n        const CTransaction& tx = *ptx;\n\n        // Which orphan pool entries must we evict?\n        for (const auto& txin : tx.vin) {\n            auto itByPrev = mapOrphanTransactionsByPrev.find(txin.prevout);\n            if (itByPrev == mapOrphanTransactionsByPrev.end()) continue;\n            for (auto mi = itByPrev->second.begin(); mi != itByPrev->second.end(); ++mi) {\n                const CTransaction& orphanTx = *(*mi)->second.tx;\n                const uint256& orphanHash = orphanTx.GetHash();\n                vOrphanErase.push_back(orphanHash);\n            }\n        }\n    }\n\n    // Erase orphan transactions include or precluded by this block\n    if (vOrphanErase.size()) {\n        int nErased = 0;\n        for (uint256 &orphanHash : vOrphanErase) {\n            nErased += EraseOrphanTx(orphanHash);\n        }\n        LogPrint(BCLog::MEMPOOL, \"Erased %d orphan tx included or conflicted by block\\n\", nErased);\n    }\n\n    g_last_tip_update = GetTime();\n}\n\n// All of the following cache a recent block, and are protected by cs_most_recent_block\nstatic CCriticalSection cs_most_recent_block;\nstatic std::shared_ptr<const CBlock> most_recent_block;\nstatic std::shared_ptr<const CBlockHeaderAndShortTxIDs> most_recent_compact_block;\nstatic uint256 most_recent_block_hash;\nstatic bool fWitnessesPresentInMostRecentCompactBlock;\n\nvoid PeerLogicValidation::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) {\n    std::shared_ptr<const CBlockHeaderAndShortTxIDs> pcmpctblock = std::make_shared<const CBlockHeaderAndShortTxIDs> (*pblock, true);\n    const CNetMsgMaker msgMaker(PROTOCOL_VERSION);\n\n    LOCK(cs_main);\n\n    static int nHighestFastAnnounce = 0;\n    if (pindex->nHeight <= nHighestFastAnnounce)\n        return;\n    nHighestFastAnnounce = pindex->nHeight;\n\n    bool fWitnessEnabled = IsWitnessEnabled(pindex->pprev, Params().GetConsensus());\n    uint256 hashBlock(pblock->GetHash());\n\n    {\n        LOCK(cs_most_recent_block);\n        most_recent_block_hash = hashBlock;\n        most_recent_block = pblock;\n        most_recent_compact_block = pcmpctblock;\n        fWitnessesPresentInMostRecentCompactBlock = fWitnessEnabled;\n    }\n\n    connman->ForEachNode([this, &pcmpctblock, pindex, &msgMaker, fWitnessEnabled, &hashBlock](CNode* pnode) {\n        // TODO: Avoid the repeated-serialization here\n        if (pnode->nVersion < INVALID_CB_NO_BAN_VERSION || pnode->fDisconnect)\n            return;\n        ProcessBlockAvailability(pnode->GetId());\n        CNodeState &state = *State(pnode->GetId());\n        // If the peer has, or we announced to them the previous block already,\n        // but we don't think they have this one, go ahead and announce it\n        if (state.fPreferHeaderAndIDs && (!fWitnessEnabled || state.fWantsCmpctWitness) &&\n                !PeerHasHeader(&state, pindex) && PeerHasHeader(&state, pindex->pprev)) {\n\n            LogPrint(BCLog::NET, \"%s sending header-and-ids %s to peer=%d\\n\", \"PeerLogicValidation::NewPoWValidBlock\",\n                    hashBlock.ToString(), pnode->GetId());\n            connman->PushMessage(pnode, msgMaker.Make(NetMsgType::CMPCTBLOCK, *pcmpctblock));\n            state.pindexBestHeaderSent = pindex;\n        }\n    });\n}\n\nvoid PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {\n    const int nNewHeight = pindexNew->nHeight;\n    connman->SetBestHeight(nNewHeight);\n\n    if (!fInitialDownload) {\n        // Find the hashes of all blocks that weren't previously in the best chain.\n        std::vector<uint256> vHashes;\n        const CBlockIndex *pindexToAnnounce = pindexNew;\n        while (pindexToAnnounce != pindexFork) {\n            vHashes.push_back(pindexToAnnounce->GetBlockHash());\n            pindexToAnnounce = pindexToAnnounce->pprev;\n            if (vHashes.size() == MAX_BLOCKS_TO_ANNOUNCE) {\n                // Limit announcements in case of a huge reorganization.\n                // Rely on the peer's synchronization mechanism in that case.\n                break;\n            }\n        }\n        // Relay inventory, but don't relay old inventory during initial block download.\n        connman->ForEachNode([nNewHeight, &vHashes](CNode* pnode) {\n            if (nNewHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 0)) {\n                for (const uint256& hash : reverse_iterate(vHashes)) {\n                    pnode->PushBlockHash(hash);\n                }\n            }\n        });\n        connman->WakeMessageHandler();\n    }\n\n    nTimeBestReceived = GetTime();\n}\n\nvoid PeerLogicValidation::BlockChecked(const CBlock& block, const CValidationState& state) {\n    LOCK(cs_main);\n\n    const uint256 hash(block.GetHash());\n    std::map<uint256, std::pair<NodeId, bool>>::iterator it = mapBlockSource.find(hash);\n\n    int nDoS = 0;\n    if (state.IsInvalid(nDoS)) {\n        // Don't send reject message with code 0 or an internal reject code.\n        if (it != mapBlockSource.end() && State(it->second.first) && state.GetRejectCode() > 0 && state.GetRejectCode() < REJECT_INTERNAL) {\n            CBlockReject reject = {(unsigned char)state.GetRejectCode(), state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), hash};\n            State(it->second.first)->rejects.push_back(reject);\n            if (nDoS > 0 && it->second.second)\n                Misbehaving(it->second.first, nDoS);\n        }\n    }\n    // Check that:\n    // 1. The block is valid\n    // 2. We're not in initial block download\n    // 3. This is currently the best block we're aware of. We haven't updated\n    //    the tip yet so we have no way to check this directly here. Instead we\n    //    just check that there are currently no other blocks in flight.\n    else if (state.IsValid() &&\n             !IsInitialBlockDownload() &&\n             mapBlocksInFlight.count(hash) == mapBlocksInFlight.size()) {\n        if (it != mapBlockSource.end()) {\n            MaybeSetPeerAsAnnouncingHeaderAndIDs(it->second.first, connman);\n        }\n    }\n    if (it != mapBlockSource.end())\n        mapBlockSource.erase(it);\n}\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// Messages\n//\n\n\nbool static AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)\n{\n    switch (inv.type)\n    {\n    case MSG_TX:\n    case MSG_WITNESS_TX:\n        {\n            assert(recentRejects);\n            if (chainActive.Tip()->GetBlockHash() != hashRecentRejectsChainTip)\n            {\n                // If the chain tip has changed previously rejected transactions\n                // might be now valid, e.g. due to a nLockTime'd tx becoming valid,\n                // or a double-spend. Reset the rejects filter and give those\n                // txs a second chance.\n                hashRecentRejectsChainTip = chainActive.Tip()->GetBlockHash();\n                recentRejects->reset();\n            }\n\n            {\n                LOCK(g_cs_orphans);\n                if (mapOrphanTransactions.count(inv.hash)) return true;\n            }\n\n            return recentRejects->contains(inv.hash) ||\n                   mempool.exists(inv.hash) ||\n                   pcoinsTip->HaveCoinInCache(COutPoint(inv.hash, 0)) || // Best effort: only try output 0 and 1\n                   pcoinsTip->HaveCoinInCache(COutPoint(inv.hash, 1));\n        }\n    case MSG_BLOCK:\n    case MSG_WITNESS_BLOCK:\n        return mapBlockIndex.count(inv.hash);\n    }\n    // Don't know what it is, just say we already got one\n    return true;\n}\n\nstatic void RelayTransaction(const CTransaction& tx, CConnman* connman)\n{\n    CInv inv(MSG_TX, tx.GetHash());\n    connman->ForEachNode([&inv](CNode* pnode)\n    {\n        pnode->PushInventory(inv);\n    });\n}\n\nstatic void RelayAddress(const CAddress& addr, bool fReachable, CConnman* connman)\n{\n    unsigned int nRelayNodes = fReachable ? 2 : 1; // limited relaying of addresses outside our network(s)\n\n    // Relay to a limited number of other nodes\n    // Use deterministic randomness to send to the same nodes for 24 hours\n    // at a time so the addrKnowns of the chosen nodes prevent repeats\n    uint64_t hashAddr = addr.GetHash();\n    const CSipHasher hasher = connman->GetDeterministicRandomizer(RANDOMIZER_ID_ADDRESS_RELAY).Write(hashAddr << 32).Write((GetTime() + hashAddr) / (24*60*60));\n    FastRandomContext insecure_rand;\n\n    std::array<std::pair<uint64_t, CNode*>,2> best{{{0, nullptr}, {0, nullptr}}};\n    assert(nRelayNodes <= best.size());\n\n    auto sortfunc = [&best, &hasher, nRelayNodes](CNode* pnode) {\n        if (pnode->nVersion >= CADDR_TIME_VERSION) {\n            uint64_t hashKey = CSipHasher(hasher).Write(pnode->GetId()).Finalize();\n            for (unsigned int i = 0; i < nRelayNodes; i++) {\n                 if (hashKey > best[i].first) {\n                     std::copy(best.begin() + i, best.begin() + nRelayNodes - 1, best.begin() + i + 1);\n                     best[i] = std::make_pair(hashKey, pnode);\n                     break;\n                 }\n            }\n        }\n    };\n\n    auto pushfunc = [&addr, &best, nRelayNodes, &insecure_rand] {\n        for (unsigned int i = 0; i < nRelayNodes && best[i].first != 0; i++) {\n            best[i].second->PushAddress(addr, insecure_rand);\n        }\n    };\n\n    connman->ForEachNodeThen(std::move(sortfunc), std::move(pushfunc));\n}\n\nvoid static ProcessGetBlockData(CNode* pfrom, const Consensus::Params& consensusParams, const CInv& inv, CConnman* connman, const std::atomic<bool>& interruptMsgProc)\n{\n    bool send = false;\n    std::shared_ptr<const CBlock> a_recent_block;\n    std::shared_ptr<const CBlockHeaderAndShortTxIDs> a_recent_compact_block;\n    bool fWitnessesPresentInARecentCompactBlock;\n    {\n        LOCK(cs_most_recent_block);\n        a_recent_block = most_recent_block;\n        a_recent_compact_block = most_recent_compact_block;\n        fWitnessesPresentInARecentCompactBlock = fWitnessesPresentInMostRecentCompactBlock;\n    }\n\n    bool need_activate_chain = false;\n    {\n        LOCK(cs_main);\n        BlockMap::iterator mi = mapBlockIndex.find(inv.hash);\n        if (mi != mapBlockIndex.end())\n        {\n            if (mi->second->nChainTx && !mi->second->IsValid(BLOCK_VALID_SCRIPTS) &&\n                    mi->second->IsValid(BLOCK_VALID_TREE)) {\n                // If we have the block and all of its parents, but have not yet validated it,\n                // we might be in the middle of connecting it (ie in the unlock of cs_main\n                // before ActivateBestChain but after AcceptBlock).\n                // In this case, we need to run ActivateBestChain prior to checking the relay\n                // conditions below.\n                need_activate_chain = true;\n            }\n        }\n    } // release cs_main before calling ActivateBestChain\n    if (need_activate_chain) {\n        CValidationState dummy;\n        ActivateBestChain(dummy, Params(), a_recent_block);\n    }\n\n    LOCK(cs_main);\n    BlockMap::iterator mi = mapBlockIndex.find(inv.hash);\n    if (mi != mapBlockIndex.end()) {\n        send = BlockRequestAllowed(mi->second, consensusParams);\n        if (!send) {\n            LogPrint(BCLog::NET, \"%s: ignoring request from peer=%i for old block that isn't in the main chain\\n\", __func__, pfrom->GetId());\n        }\n    }\n    const CNetMsgMaker msgMaker(pfrom->GetSendVersion());\n    // disconnect node in case we have reached the outbound limit for serving historical blocks\n    // never disconnect whitelisted nodes\n    if (send && connman->OutboundTargetReached(true) && ( ((pindexBestHeader != nullptr) && (pindexBestHeader->GetBlockTime() - mi->second->GetBlockTime() > HISTORICAL_BLOCK_AGE)) || inv.type == MSG_FILTERED_BLOCK) && !pfrom->fWhitelisted)\n    {\n        LogPrint(BCLog::NET, \"historical block serving limit reached, disconnect peer=%d\\n\", pfrom->GetId());\n\n        //disconnect node\n        pfrom->fDisconnect = true;\n        send = false;\n    }\n    // Avoid leaking prune-height by never sending blocks below the NODE_NETWORK_LIMITED threshold\n    if (send && !pfrom->fWhitelisted && (\n            (((pfrom->GetLocalServices() & NODE_NETWORK_LIMITED) == NODE_NETWORK_LIMITED) && ((pfrom->GetLocalServices() & NODE_NETWORK) != NODE_NETWORK) && (chainActive.Tip()->nHeight - mi->second->nHeight > (int)NODE_NETWORK_LIMITED_MIN_BLOCKS + 2 /* add two blocks buffer extension for possible races */) )\n       )) {\n        LogPrint(BCLog::NET, \"Ignore block request below NODE_NETWORK_LIMITED threshold from peer=%d\\n\", pfrom->GetId());\n\n        //disconnect node and prevent it from stalling (would otherwise wait for the missing block)\n        pfrom->fDisconnect = true;\n        send = false;\n    }\n    // Pruned nodes may have deleted the block, so check whether\n    // it's available before trying to send.\n    if (send && (mi->second->nStatus & BLOCK_HAVE_DATA))\n    {\n        std::shared_ptr<const CBlock> pblock;\n        if (a_recent_block && a_recent_block->GetHash() == (*mi).second->GetBlockHash()) {\n            pblock = a_recent_block;\n        } else {\n            // Send block from disk\n            std::shared_ptr<CBlock> pblockRead = std::make_shared<CBlock>();\n            if (!ReadBlockFromDisk(*pblockRead, (*mi).second, consensusParams))\n                assert(!\"cannot load block from disk\");\n            pblock = pblockRead;\n        }\n        if (inv.type == MSG_BLOCK)\n            connman->PushMessage(pfrom, msgMaker.Make(SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::BLOCK, *pblock));\n        else if (inv.type == MSG_WITNESS_BLOCK)\n            connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::BLOCK, *pblock));\n        else if (inv.type == MSG_FILTERED_BLOCK)\n        {\n            bool sendMerkleBlock = false;\n            CMerkleBlock merkleBlock;\n            {\n                LOCK(pfrom->cs_filter);\n                if (pfrom->pfilter) {\n                    sendMerkleBlock = true;\n                    merkleBlock = CMerkleBlock(*pblock, *pfrom->pfilter);\n                }\n            }\n            if (sendMerkleBlock) {\n                connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::MERKLEBLOCK, merkleBlock));\n                // CMerkleBlock just contains hashes, so also push any transactions in the block the client did not see\n                // This avoids hurting performance by pointlessly requiring a round-trip\n                // Note that there is currently no way for a node to request any single transactions we didn't send here -\n                // they must either disconnect and retry or request the full block.\n                // Thus, the protocol spec specified allows for us to provide duplicate txn here,\n                // however we MUST always provide at least what the remote peer needs\n                typedef std::pair<unsigned int, uint256> PairType;\n                for (PairType& pair : merkleBlock.vMatchedTxn)\n                    connman->PushMessage(pfrom, msgMaker.Make(SERIALIZE_TRANSACTION_NO_WITNESS, NetMsgType::TX, *pblock->vtx[pair.first]));\n            }\n            // else\n                // no response\n        }\n        else if (inv.type == MSG_CMPCT_BLOCK)\n        {\n            // If a peer is asking for old blocks, we're almost guaranteed\n            // they won't have a useful mempool to match against a compact block,\n            // and we don't feel like constructing the object for them, so\n            // instead we respond with the full, non-compact block.\n            bool fPeerWantsWitness = State(pfrom->GetId())->fWantsCmpctWitness;\n            int nSendFlags = fPeerWantsWitness ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS;\n            if (CanDirectFetch(consensusParams) && mi->second->nHeight >= chainActive.Height() - MAX_CMPCTBLOCK_DEPTH) {\n                if ((fPeerWantsWitness || !fWitnessesPresentInARecentCompactBlock) && a_recent_compact_block && a_recent_compact_block->header.GetHash() == mi->second->GetBlockHash()) {\n                    connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::CMPCTBLOCK, *a_recent_compact_block));\n                } else {\n                    CBlockHeaderAndShortTxIDs cmpctblock(*pblock, fPeerWantsWitness);\n                    connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::CMPCTBLOCK, cmpctblock));\n                }\n            } else {\n                connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::BLOCK, *pblock));\n            }\n        }\n\n        // Trigger the peer node to send a getblocks request for the next batch of inventory\n        if (inv.hash == pfrom->hashContinue)\n        {\n            // Bypass PushInventory, this must send even if redundant,\n            // and we want it right after the last block so they don't\n            // wait for other stuff first.\n            std::vector<CInv> vInv;\n            vInv.push_back(CInv(MSG_BLOCK, chainActive.Tip()->GetBlockHash()));\n            connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::INV, vInv));\n            pfrom->hashContinue.SetNull();\n        }\n    }\n}\n\nvoid static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParams, CConnman* connman, const std::atomic<bool>& interruptMsgProc)\n{\n    AssertLockNotHeld(cs_main);\n\n    std::deque<CInv>::iterator it = pfrom->vRecvGetData.begin();\n    std::vector<CInv> vNotFound;\n    const CNetMsgMaker msgMaker(pfrom->GetSendVersion());\n    {\n        LOCK(cs_main);\n\n        while (it != pfrom->vRecvGetData.end() && (it->type == MSG_TX || it->type == MSG_WITNESS_TX)) {\n            if (interruptMsgProc)\n                return;\n            // Don't bother if send buffer is too full to respond anyway\n            if (pfrom->fPauseSend)\n                break;\n\n            const CInv &inv = *it;\n            it++;\n\n            // Send stream from relay memory\n            bool push = false;\n            auto mi = mapRelay.find(inv.hash);\n            int nSendFlags = (inv.type == MSG_TX ? SERIALIZE_TRANSACTION_NO_WITNESS : 0);\n            if (mi != mapRelay.end()) {\n                connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::TX, *mi->second));\n                push = true;\n            } else if (pfrom->timeLastMempoolReq) {\n                auto txinfo = mempool.info(inv.hash);\n                // To protect privacy, do not answer getdata using the mempool when\n                // that TX couldn't have been INVed in reply to a MEMPOOL request.\n                if (txinfo.tx && txinfo.nTime <= pfrom->timeLastMempoolReq) {\n                    connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::TX, *txinfo.tx));\n                    push = true;\n                }\n            }\n            if (!push) {\n                vNotFound.push_back(inv);\n            }\n        }\n    } // release cs_main\n\n    if (it != pfrom->vRecvGetData.end() && !pfrom->fPauseSend) {\n        const CInv &inv = *it;\n        if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK || inv.type == MSG_CMPCT_BLOCK || inv.type == MSG_WITNESS_BLOCK) {\n            it++;\n            ProcessGetBlockData(pfrom, consensusParams, inv, connman, interruptMsgProc);\n        }\n    }\n\n    pfrom->vRecvGetData.erase(pfrom->vRecvGetData.begin(), it);\n\n    if (!vNotFound.empty()) {\n        // Let the peer know that we didn't find what it asked for, so it doesn't\n        // have to wait around forever. Currently only SPV clients actually care\n        // about this message: it's needed when they are recursively walking the\n        // dependencies of relevant unconfirmed transactions. SPV clients want to\n        // do that because they want to know about (and store and rebroadcast and\n        // risk analyze) the dependencies of transactions relevant to them, without\n        // having to download the entire memory pool.\n        connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::NOTFOUND, vNotFound));\n    }\n}\n\nuint32_t GetFetchFlags(CNode* pfrom) {\n    uint32_t nFetchFlags = 0;\n    if ((pfrom->GetLocalServices() & NODE_WITNESS) && State(pfrom->GetId())->fHaveWitness) {\n        nFetchFlags |= MSG_WITNESS_FLAG;\n    }\n    return nFetchFlags;\n}\n\ninline void static SendBlockTransactions(const CBlock& block, const BlockTransactionsRequest& req, CNode* pfrom, CConnman* connman) {\n    BlockTransactions resp(req);\n    for (size_t i = 0; i < req.indexes.size(); i++) {\n        if (req.indexes[i] >= block.vtx.size()) {\n            LOCK(cs_main);\n            Misbehaving(pfrom->GetId(), 100);\n            LogPrintf(\"Peer %d sent us a getblocktxn with out-of-bounds tx indices\", pfrom->GetId());\n            return;\n        }\n        resp.txn[i] = block.vtx[req.indexes[i]];\n    }\n    LOCK(cs_main);\n    const CNetMsgMaker msgMaker(pfrom->GetSendVersion());\n    int nSendFlags = State(pfrom->GetId())->fWantsCmpctWitness ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS;\n    connman->PushMessage(pfrom, msgMaker.Make(nSendFlags, NetMsgType::BLOCKTXN, resp));\n}\n\nbool static ProcessHeadersMessage(CNode *pfrom, CConnman *connman, const std::vector<CBlockHeader>& headers, const CChainParams& chainparams, bool punish_duplicate_invalid)\n{\n    const CNetMsgMaker msgMaker(pfrom->GetSendVersion());\n    size_t nCount = headers.size();\n\n    if (nCount == 0) {\n        // Nothing interesting. Stop asking this peers for more headers.\n        return true;\n    }\n\n    bool received_new_header = false;\n    const CBlockIndex *pindexLast = nullptr;\n    {\n        LOCK(cs_main);\n        CNodeState *nodestate = State(pfrom->GetId());\n\n        // If this looks like it could be a block announcement (nCount <\n        // MAX_BLOCKS_TO_ANNOUNCE), use special logic for handling headers that\n        // don't connect:\n        // - Send a getheaders message in response to try to connect the chain.\n        // - The peer can send up to MAX_UNCONNECTING_HEADERS in a row that\n        //   don't connect before giving DoS points\n        // - Once a headers message is received that is valid and does connect,\n        //   nUnconnectingHeaders gets reset back to 0.\n        if (mapBlockIndex.find(headers[0].hashPrevBlock) == mapBlockIndex.end() && nCount < MAX_BLOCKS_TO_ANNOUNCE) {\n            nodestate->nUnconnectingHeaders++;\n            connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETHEADERS, chainActive.GetLocator(pindexBestHeader), uint256()));\n            LogPrint(BCLog::NET, \"received header %s: missing prev block %s, sending getheaders (%d) to end (peer=%d, nUnconnectingHeaders=%d)\\n\",\n                    headers[0].GetHash().ToString(),\n                    headers[0].hashPrevBlock.ToString(),\n                    pindexBestHeader->nHeight,\n                    pfrom->GetId(), nodestate->nUnconnectingHeaders);\n            // Set hashLastUnknownBlock for this peer, so that if we\n            // eventually get the headers - even from a different peer -\n            // we can use this peer to download.\n            UpdateBlockAvailability(pfrom->GetId(), headers.back().GetHash());\n\n            if (nodestate->nUnconnectingHeaders % MAX_UNCONNECTING_HEADERS == 0) {\n                Misbehaving(pfrom->GetId(), 20);\n            }\n            return true;\n        }\n\n        uint256 hashLastBlock;\n        for (const CBlockHeader& header : headers) {\n            if (!hashLastBlock.IsNull() && header.hashPrevBlock != hashLastBlock) {\n                Misbehaving(pfrom->GetId(), 20);\n                return error(\"non-continuous headers sequence\");\n            }\n            hashLastBlock = header.GetHash();\n        }\n\n        // If we don't have the last header, then they'll have given us\n        // something new (if these headers are valid).\n        if (mapBlockIndex.find(hashLastBlock) == mapBlockIndex.end()) {\n            received_new_header = true;\n        }\n    }\n\n    CValidationState state;\n    CBlockHeader first_invalid_header;\n    if (!ProcessNewBlockHeaders(headers, state, chainparams, &pindexLast, &first_invalid_header)) {\n        int nDoS;\n        if (state.IsInvalid(nDoS)) {\n            LOCK(cs_main);\n            if (nDoS > 0) {\n                Misbehaving(pfrom->GetId(), nDoS);\n            }\n            if (punish_duplicate_invalid && mapBlockIndex.find(first_invalid_header.GetHash()) != mapBlockIndex.end()) {\n                // Goal: don't allow outbound peers to use up our outbound\n                // connection slots if they are on incompatible chains.\n                //\n                // We ask the caller to set punish_invalid appropriately based\n                // on the peer and the method of header delivery (compact\n                // blocks are allowed to be invalid in some circumstances,\n                // under BIP 152).\n                // Here, we try to detect the narrow situation that we have a\n                // valid block header (ie it was valid at the time the header\n                // was received, and hence stored in mapBlockIndex) but know the\n                // block is invalid, and that a peer has announced that same\n                // block as being on its active chain.\n                // Disconnect the peer in such a situation.\n                //\n                // Note: if the header that is invalid was not accepted to our\n                // mapBlockIndex at all, that may also be grounds for\n                // disconnecting the peer, as the chain they are on is likely\n                // to be incompatible. However, there is a circumstance where\n                // that does not hold: if the header's timestamp is more than\n                // 2 hours ahead of our current time. In that case, the header\n                // may become valid in the future, and we don't want to\n                // disconnect a peer merely for serving us one too-far-ahead\n                // block header, to prevent an attacker from splitting the\n                // network by mining a block right at the 2 hour boundary.\n                //\n                // TODO: update the DoS logic (or, rather, rewrite the\n                // DoS-interface between validation and net_processing) so that\n                // the interface is cleaner, and so that we disconnect on all the\n                // reasons that a peer's headers chain is incompatible\n                // with ours (eg block->nVersion softforks, MTP violations,\n                // etc), and not just the duplicate-invalid case.\n                pfrom->fDisconnect = true;\n            }\n            return error(\"invalid header received\");\n        }\n    }\n\n    {\n        LOCK(cs_main);\n        CNodeState *nodestate = State(pfrom->GetId());\n        if (nodestate->nUnconnectingHeaders > 0) {\n            LogPrint(BCLog::NET, \"peer=%d: resetting nUnconnectingHeaders (%d -> 0)\\n\", pfrom->GetId(), nodestate->nUnconnectingHeaders);\n        }\n        nodestate->nUnconnectingHeaders = 0;\n\n        assert(pindexLast);\n        UpdateBlockAvailability(pfrom->GetId(), pindexLast->GetBlockHash());\n\n        // From here, pindexBestKnownBlock should be guaranteed to be non-null,\n        // because it is set in UpdateBlockAvailability. Some nullptr checks\n        // are still present, however, as belt-and-suspenders.\n\n        if (received_new_header && pindexLast->nChainWork > chainActive.Tip()->nChainWork) {\n            nodestate->m_last_block_announcement = GetTime();\n        }\n\n        // FIXME.SUGAR\n        // IBD: disable additional download during IBD, due to too much traffic\n        /*\n        if (nCount == MAX_HEADERS_RESULTS) {\n            // Headers message had its maximum size; the peer may have more headers.\n            // TODO: optimize: if pindexLast is an ancestor of chainActive.Tip or pindexBestHeader, continue\n            // from there instead.\n            LogPrint(BCLog::NET, \"more getheaders (%d) to end to peer=%d (startheight:%d)\\n\", pindexLast->nHeight, pfrom->GetId(), pfrom->nStartingHeight);\n            connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETHEADERS, chainActive.GetLocator(pindexLast), uint256()));\n        }\n        */\n\n        bool fCanDirectFetch = CanDirectFetch(chainparams.GetConsensus());\n        // If this set of headers is valid and ends in a block with at least as\n        // much work as our tip, download as much as possible.\n        if (fCanDirectFetch && pindexLast->IsValid(BLOCK_VALID_TREE) && chainActive.Tip()->nChainWork <= pindexLast->nChainWork) {\n            std::vector<const CBlockIndex*> vToFetch;\n            const CBlockIndex *pindexWalk = pindexLast;\n            // Calculate all the blocks we'd need to switch to pindexLast, up to a limit.\n            while (pindexWalk && !chainActive.Contains(pindexWalk) && vToFetch.size() <= MAX_BLOCKS_IN_TRANSIT_PER_PEER) {\n                if (!(pindexWalk->nStatus & BLOCK_HAVE_DATA) &&\n                        !mapBlocksInFlight.count(pindexWalk->GetBlockHash()) &&\n                        (!IsWitnessEnabled(pindexWalk->pprev, chainparams.GetConsensus()) || State(pfrom->GetId())->fHaveWitness)) {\n                    // We don't have this block, and it's not yet in flight.\n                    vToFetch.push_back(pindexWalk);\n                }\n                pindexWalk = pindexWalk->pprev;\n            }\n            // If pindexWalk still isn't on our main chain, we're looking at a\n            // very large reorg at a time we think we're close to caught up to\n            // the main chain -- this shouldn't really happen.  Bail out on the\n            // direct fetch and rely on parallel download instead.\n            if (!chainActive.Contains(pindexWalk)) {\n                LogPrint(BCLog::NET, \"Large reorg, won't direct fetch to %s (%d)\\n\",\n                        pindexLast->GetBlockHash().ToString(),\n                        pindexLast->nHeight);\n            } else {\n                std::vector<CInv> vGetData;\n                // Download as much as possible, from earliest to latest.\n                for (const CBlockIndex *pindex : reverse_iterate(vToFetch)) {\n                    if (nodestate->nBlocksInFlight >= MAX_BLOCKS_IN_TRANSIT_PER_PEER) {\n                        // Can't download any more from this peer\n                        break;\n                    }\n                    uint32_t nFetchFlags = GetFetchFlags(pfrom);\n                    vGetData.push_back(CInv(MSG_BLOCK | nFetchFlags, pindex->GetBlockHash()));\n                    MarkBlockAsInFlight(pfrom->GetId(), pindex->GetBlockHash(), pindex);\n                    LogPrint(BCLog::NET, \"Requesting block %s from  peer=%d\\n\",\n                            pindex->GetBlockHash().ToString(), pfrom->GetId());\n                }\n                if (vGetData.size() > 1) {\n                    LogPrint(BCLog::NET, \"Downloading blocks toward %s (%d) via headers direct fetch\\n\",\n                            pindexLast->GetBlockHash().ToString(), pindexLast->nHeight);\n                }\n                if (vGetData.size() > 0) {\n                    if (nodestate->fSupportsDesiredCmpctVersion && vGetData.size() == 1 && mapBlocksInFlight.size() == 1 && pindexLast->pprev->IsValid(BLOCK_VALID_CHAIN)) {\n                        // In any case, we want to download using a compact block, not a regular one\n                        vGetData[0] = CInv(MSG_CMPCT_BLOCK, vGetData[0].hash);\n                    }\n                    connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, vGetData));\n                }\n            }\n        }\n        // If we're in IBD, we want outbound peers that will serve us a useful\n        // chain. Disconnect peers that are on chains with insufficient work.\n        if (IsInitialBlockDownload() && nCount != MAX_HEADERS_RESULTS) {\n            // When nCount < MAX_HEADERS_RESULTS, we know we have no more\n            // headers to fetch from this peer.\n            if (nodestate->pindexBestKnownBlock && nodestate->pindexBestKnownBlock->nChainWork < nMinimumChainWork) {\n                // This peer has too little work on their headers chain to help\n                // us sync -- disconnect if using an outbound slot (unless\n                // whitelisted or addnode).\n                // Note: We compare their tip to nMinimumChainWork (rather than\n                // chainActive.Tip()) because we won't start block download\n                // until we have a headers chain that has at least\n                // nMinimumChainWork, even if a peer has a chain past our tip,\n                // as an anti-DoS measure.\n                if (IsOutboundDisconnectionCandidate(pfrom)) {\n                    LogPrintf(\"Disconnecting outbound peer %d -- headers chain has insufficient work\\n\", pfrom->GetId());\n                    pfrom->fDisconnect = true;\n                }\n            }\n        }\n\n        if (!pfrom->fDisconnect && IsOutboundDisconnectionCandidate(pfrom) && nodestate->pindexBestKnownBlock != nullptr) {\n            // If this is an outbound peer, check to see if we should protect\n            // it from the bad/lagging chain logic.\n            if (g_outbound_peers_with_protect_from_disconnect < MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT && nodestate->pindexBestKnownBlock->nChainWork >= chainActive.Tip()->nChainWork && !nodestate->m_chain_sync.m_protect) {\n                LogPrint(BCLog::NET, \"Protecting outbound peer=%d from eviction\\n\", pfrom->GetId());\n                nodestate->m_chain_sync.m_protect = true;\n                ++g_outbound_peers_with_protect_from_disconnect;\n            }\n        }\n    }\n\n    return true;\n}\n\nbool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, int64_t nTimeReceived, const CChainParams& chainparams, CConnman* connman, const std::atomic<bool>& interruptMsgProc)\n{\n    LogPrint(BCLog::NET, \"received: %s (%u bytes) peer=%d\\n\", SanitizeString(strCommand), vRecv.size(), pfrom->GetId());\n    if (gArgs.IsArgSet(\"-dropmessagestest\") && GetRand(gArgs.GetArg(\"-dropmessagestest\", 0)) == 0)\n    {\n        LogPrintf(\"dropmessagestest DROPPING RECV MESSAGE\\n\");\n        return true;\n    }\n\n\n    if (!(pfrom->GetLocalServices() & NODE_BLOOM) &&\n              (strCommand == NetMsgType::FILTERLOAD ||\n               strCommand == NetMsgType::FILTERADD))\n    {\n        if (pfrom->nVersion >= NO_BLOOM_VERSION) {\n            LOCK(cs_main);\n            Misbehaving(pfrom->GetId(), 100);\n            return false;\n        } else {\n            pfrom->fDisconnect = true;\n            return false;\n        }\n    }\n\n    if (strCommand == NetMsgType::REJECT)\n    {\n        if (LogAcceptCategory(BCLog::NET)) {\n            try {\n                std::string strMsg; unsigned char ccode; std::string strReason;\n                vRecv >> LIMITED_STRING(strMsg, CMessageHeader::COMMAND_SIZE) >> ccode >> LIMITED_STRING(strReason, MAX_REJECT_MESSAGE_LENGTH);\n\n                std::ostringstream ss;\n                ss << strMsg << \" code \" << itostr(ccode) << \": \" << strReason;\n\n                if (strMsg == NetMsgType::BLOCK || strMsg == NetMsgType::TX)\n                {\n                    uint256 hash;\n                    vRecv >> hash;\n                    ss << \": hash \" << hash.ToString();\n                }\n                LogPrint(BCLog::NET, \"Reject %s\\n\", SanitizeString(ss.str()));\n            } catch (const std::ios_base::failure&) {\n                // Avoid feedback loops by preventing reject messages from triggering a new reject message.\n                LogPrint(BCLog::NET, \"Unparseable reject message received\\n\");\n            }\n        }\n    }\n\n    else if (strCommand == NetMsgType::VERSION)\n    {\n        // Each connection can only send one version message\n        if (pfrom->nVersion != 0)\n        {\n            connman->PushMessage(pfrom, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::REJECT, strCommand, REJECT_DUPLICATE, std::string(\"Duplicate version message\")));\n            LOCK(cs_main);\n            Misbehaving(pfrom->GetId(), 1);\n            return false;\n        }\n\n        int64_t nTime;\n        CAddress addrMe;\n        CAddress addrFrom;\n        uint64_t nNonce = 1;\n        uint64_t nServiceInt;\n        ServiceFlags nServices;\n        int nVersion;\n        int nSendVersion;\n        std::string strSubVer;\n        std::string cleanSubVer;\n        int nStartingHeight = -1;\n        bool fRelay = true;\n\n        vRecv >> nVersion >> nServiceInt >> nTime >> addrMe;\n        nSendVersion = std::min(nVersion, PROTOCOL_VERSION);\n        nServices = ServiceFlags(nServiceInt);\n        if (!pfrom->fInbound)\n        {\n            connman->SetServices(pfrom->addr, nServices);\n        }\n        if (!pfrom->fInbound && !pfrom->fFeeler && !pfrom->m_manual_connection && !HasAllDesirableServiceFlags(nServices))\n        {\n            LogPrint(BCLog::NET, \"peer=%d does not offer the expected services (%08x offered, %08x expected); disconnecting\\n\", pfrom->GetId(), nServices, GetDesirableServiceFlags(nServices));\n            connman->PushMessage(pfrom, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::REJECT, strCommand, REJECT_NONSTANDARD,\n                               strprintf(\"Expected to offer services %08x\", GetDesirableServiceFlags(nServices))));\n            pfrom->fDisconnect = true;\n            return false;\n        }\n\n        if (nServices & ((1 << 7) | (1 << 5))) {\n            if (GetTime() < 1533096000) {\n                // Immediately disconnect peers that use service bits 6 or 8 until August 1st, 2018\n                // These bits have been used as a flag to indicate that a node is running incompatible\n                // consensus rules instead of changing the network magic, so we're stuck disconnecting\n                // based on these service bits, at least for a while.\n                pfrom->fDisconnect = true;\n                return false;\n            }\n        }\n\n        if (nVersion < MIN_PEER_PROTO_VERSION)\n        {\n            // disconnect from peers older than this proto version\n            LogPrint(BCLog::NET, \"peer=%d using obsolete version %i; disconnecting\\n\", pfrom->GetId(), nVersion);\n            connman->PushMessage(pfrom, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::REJECT, strCommand, REJECT_OBSOLETE,\n                               strprintf(\"Version must be %d or greater\", MIN_PEER_PROTO_VERSION)));\n            pfrom->fDisconnect = true;\n            return false;\n        }\n\n        if (nVersion == 10300)\n            nVersion = 300;\n        if (!vRecv.empty())\n            vRecv >> addrFrom >> nNonce;\n        if (!vRecv.empty()) {\n            vRecv >> LIMITED_STRING(strSubVer, MAX_SUBVERSION_LENGTH);\n            cleanSubVer = SanitizeString(strSubVer);\n        }\n        if (!vRecv.empty()) {\n            vRecv >> nStartingHeight;\n        }\n        if (!vRecv.empty())\n            vRecv >> fRelay;\n        // Disconnect if we connected to ourself\n        if (pfrom->fInbound && !connman->CheckIncomingNonce(nNonce))\n        {\n            LogPrintf(\"connected to self at %s, disconnecting\\n\", pfrom->addr.ToString());\n            pfrom->fDisconnect = true;\n            return true;\n        }\n\n        if (pfrom->fInbound && addrMe.IsRoutable())\n        {\n            SeenLocal(addrMe);\n        }\n\n        // Be shy and don't send version until we hear\n        if (pfrom->fInbound)\n            PushNodeVersion(pfrom, connman, GetAdjustedTime());\n\n        connman->PushMessage(pfrom, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::VERACK));\n\n        pfrom->nServices = nServices;\n        pfrom->SetAddrLocal(addrMe);\n        {\n            LOCK(pfrom->cs_SubVer);\n            pfrom->strSubVer = strSubVer;\n            pfrom->cleanSubVer = cleanSubVer;\n        }\n        pfrom->nStartingHeight = nStartingHeight;\n        pfrom->fClient = !(nServices & NODE_NETWORK);\n        {\n            LOCK(pfrom->cs_filter);\n            pfrom->fRelayTxes = fRelay; // set to true after we get the first filter* message\n        }\n\n        // Change version\n        pfrom->SetSendVersion(nSendVersion);\n        pfrom->nVersion = nVersion;\n\n        if((nServices & NODE_WITNESS))\n        {\n            LOCK(cs_main);\n            State(pfrom->GetId())->fHaveWitness = true;\n        }\n\n        // Potentially mark this peer as a preferred download peer.\n        {\n        LOCK(cs_main);\n        UpdatePreferredDownload(pfrom, State(pfrom->GetId()));\n        }\n\n        if (!pfrom->fInbound)\n        {\n            // Advertise our address\n            if (fListen && !IsInitialBlockDownload())\n            {\n                CAddress addr = GetLocalAddress(&pfrom->addr, pfrom->GetLocalServices());\n                FastRandomContext insecure_rand;\n                if (addr.IsRoutable())\n                {\n                    LogPrint(BCLog::NET, \"ProcessMessages: advertising address %s\\n\", addr.ToString());\n                    pfrom->PushAddress(addr, insecure_rand);\n                } else if (IsPeerAddrLocalGood(pfrom)) {\n                    addr.SetIP(addrMe);\n                    LogPrint(BCLog::NET, \"ProcessMessages: advertising address %s\\n\", addr.ToString());\n                    pfrom->PushAddress(addr, insecure_rand);\n                }\n            }\n\n            // Get recent addresses\n            if (pfrom->fOneShot || pfrom->nVersion >= CADDR_TIME_VERSION || connman->GetAddressCount() < 1000)\n            {\n                connman->PushMessage(pfrom, CNetMsgMaker(nSendVersion).Make(NetMsgType::GETADDR));\n                pfrom->fGetAddr = true;\n            }\n            connman->MarkAddressGood(pfrom->addr);\n        }\n\n        std::string remoteAddr;\n        if (fLogIPs)\n            remoteAddr = \", peeraddr=\" + pfrom->addr.ToString();\n\n        LogPrint(BCLog::NET, \"receive version message: %s: version %d, blocks=%d, us=%s, peer=%d%s\\n\",\n                  cleanSubVer, pfrom->nVersion,\n                  pfrom->nStartingHeight, addrMe.ToString(), pfrom->GetId(),\n                  remoteAddr);\n\n        int64_t nTimeOffset = nTime - GetTime();\n        pfrom->nTimeOffset = nTimeOffset;\n        AddTimeData(pfrom->addr, nTimeOffset);\n\n        // If the peer is old enough to have the old alert system, send it the final alert.\n        if (pfrom->nVersion <= 70012) {\n            CDataStream finalAlert(ParseHex(\"60010000000000000000000000ffffff7f00000000ffffff7ffeffff7f01ffffff7f00000000ffffff7f00ffffff7f002f555247454e543a20416c657274206b657920636f6d70726f6d697365642c2075706772616465207265717569726564004630440220653febd6410f470f6bae11cad19c48413becb1ac2c17f908fd0fd53bdc3abd5202206d0e9c96fe88d4a0f01ed9dedae2b6f9e00da94cad0fecaae66ecf689bf71b50\"), SER_NETWORK, PROTOCOL_VERSION);\n            connman->PushMessage(pfrom, CNetMsgMaker(nSendVersion).Make(\"alert\", finalAlert));\n        }\n\n        // Feeler connections exist only to verify if address is online.\n        if (pfrom->fFeeler) {\n            assert(pfrom->fInbound == false);\n            pfrom->fDisconnect = true;\n        }\n        return true;\n    }\n\n\n    else if (pfrom->nVersion == 0)\n    {\n        // Must have a version message before anything else\n        LOCK(cs_main);\n        Misbehaving(pfrom->GetId(), 1);\n        return false;\n    }\n\n    // At this point, the outgoing message serialization version can't change.\n    const CNetMsgMaker msgMaker(pfrom->GetSendVersion());\n\n    if (strCommand == NetMsgType::VERACK)\n    {\n        pfrom->SetRecvVersion(std::min(pfrom->nVersion.load(), PROTOCOL_VERSION));\n\n        if (!pfrom->fInbound) {\n            // Mark this node as currently connected, so we update its timestamp later.\n            LOCK(cs_main);\n            State(pfrom->GetId())->fCurrentlyConnected = true;\n            LogPrintf(\"New outbound peer connected: version: %d, blocks=%d, peer=%d%s\\n\",\n                      pfrom->nVersion.load(), pfrom->nStartingHeight, pfrom->GetId(),\n                      (fLogIPs ? strprintf(\", peeraddr=%s\", pfrom->addr.ToString()) : \"\"));\n        }\n\n        if (pfrom->nVersion >= SENDHEADERS_VERSION) {\n            // Tell our peer we prefer to receive headers rather than inv's\n            // We send this to non-NODE NETWORK peers as well, because even\n            // non-NODE NETWORK peers can announce blocks (such as pruning\n            // nodes)\n            connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::SENDHEADERS));\n        }\n        if (pfrom->nVersion >= SHORT_IDS_BLOCKS_VERSION) {\n            // Tell our peer we are willing to provide version 1 or 2 cmpctblocks\n            // However, we do not request new block announcements using\n            // cmpctblock messages.\n            // We send this to non-NODE NETWORK peers as well, because\n            // they may wish to request compact blocks from us\n            bool fAnnounceUsingCMPCTBLOCK = false;\n            uint64_t nCMPCTBLOCKVersion = 2;\n            if (pfrom->GetLocalServices() & NODE_WITNESS)\n                connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion));\n            nCMPCTBLOCKVersion = 1;\n            connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion));\n        }\n        pfrom->fSuccessfullyConnected = true;\n    }\n\n    else if (!pfrom->fSuccessfullyConnected)\n    {\n        // Must have a verack message before anything else\n        LOCK(cs_main);\n        Misbehaving(pfrom->GetId(), 1);\n        return false;\n    }\n\n    else if (strCommand == NetMsgType::ADDR)\n    {\n        std::vector<CAddress> vAddr;\n        vRecv >> vAddr;\n\n        // Don't want addr from older versions unless seeding\n        if (pfrom->nVersion < CADDR_TIME_VERSION && connman->GetAddressCount() > 1000)\n            return true;\n        if (vAddr.size() > 1000)\n        {\n            LOCK(cs_main);\n            Misbehaving(pfrom->GetId(), 20);\n            return error(\"message addr size() = %u\", vAddr.size());\n        }\n\n        // Store the new addresses\n        std::vector<CAddress> vAddrOk;\n        int64_t nNow = GetAdjustedTime();\n        int64_t nSince = nNow - 10 * 60;\n        for (CAddress& addr : vAddr)\n        {\n            if (interruptMsgProc)\n                return true;\n\n            // We only bother storing full nodes, though this may include\n            // things which we would not make an outbound connection to, in\n            // part because we may make feeler connections to them.\n            if (!MayHaveUsefulAddressDB(addr.nServices))\n                continue;\n\n            if (addr.nTime <= 100000000 || addr.nTime > nNow + 10 * 60)\n                addr.nTime = nNow - 5 * 24 * 60 * 60;\n            pfrom->AddAddressKnown(addr);\n            bool fReachable = IsReachable(addr);\n            if (addr.nTime > nSince && !pfrom->fGetAddr && vAddr.size() <= 10 && addr.IsRoutable())\n            {\n                // Relay to a limited number of other nodes\n                RelayAddress(addr, fReachable, connman);\n            }\n            // Do not store addresses outside our network\n            if (fReachable)\n                vAddrOk.push_back(addr);\n        }\n        connman->AddNewAddresses(vAddrOk, pfrom->addr, 2 * 60 * 60);\n        if (vAddr.size() < 1000)\n            pfrom->fGetAddr = false;\n        if (pfrom->fOneShot)\n            pfrom->fDisconnect = true;\n    }\n\n    else if (strCommand == NetMsgType::SENDHEADERS)\n    {\n        LOCK(cs_main);\n        State(pfrom->GetId())->fPreferHeaders = true;\n    }\n\n    else if (strCommand == NetMsgType::SENDCMPCT)\n    {\n        bool fAnnounceUsingCMPCTBLOCK = false;\n        uint64_t nCMPCTBLOCKVersion = 0;\n        vRecv >> fAnnounceUsingCMPCTBLOCK >> nCMPCTBLOCKVersion;\n        if (nCMPCTBLOCKVersion == 1 || ((pfrom->GetLocalServices() & NODE_WITNESS) && nCMPCTBLOCKVersion == 2)) {\n            LOCK(cs_main);\n            // fProvidesHeaderAndIDs is used to \"lock in\" version of compact blocks we send (fWantsCmpctWitness)\n            if (!State(pfrom->GetId())->fProvidesHeaderAndIDs) {\n                State(pfrom->GetId())->fProvidesHeaderAndIDs = true;\n                State(pfrom->GetId())->fWantsCmpctWitness = nCMPCTBLOCKVersion == 2;\n            }\n            if (State(pfrom->GetId())->fWantsCmpctWitness == (nCMPCTBLOCKVersion == 2)) // ignore later version announces\n                State(pfrom->GetId())->fPreferHeaderAndIDs = fAnnounceUsingCMPCTBLOCK;\n            if (!State(pfrom->GetId())->fSupportsDesiredCmpctVersion) {\n                if (pfrom->GetLocalServices() & NODE_WITNESS)\n                    State(pfrom->GetId())->fSupportsDesiredCmpctVersion = (nCMPCTBLOCKVersion == 2);\n                else\n                    State(pfrom->GetId())->fSupportsDesiredCmpctVersion = (nCMPCTBLOCKVersion == 1);\n            }\n        }\n    }\n\n\n    else if (strCommand == NetMsgType::INV)\n    {\n        std::vector<CInv> vInv;\n        vRecv >> vInv;\n        if (vInv.size() > MAX_INV_SZ)\n        {\n            LOCK(cs_main);\n            Misbehaving(pfrom->GetId(), 20);\n            return error(\"message inv size() = %u\", vInv.size());\n        }\n\n        bool fBlocksOnly = !fRelayTxes;\n\n        // Allow whitelisted peers to send data other than blocks in blocks only mode if whitelistrelay is true\n        if (pfrom->fWhitelisted && gArgs.GetBoolArg(\"-whitelistrelay\", DEFAULT_WHITELISTRELAY))\n            fBlocksOnly = false;\n\n        LOCK(cs_main);\n\n        uint32_t nFetchFlags = GetFetchFlags(pfrom);\n\n        for (CInv &inv : vInv)\n        {\n            if (interruptMsgProc)\n                return true;\n\n            bool fAlreadyHave = AlreadyHave(inv);\n            LogPrint(BCLog::NET, \"got inv: %s  %s peer=%d\\n\", inv.ToString(), fAlreadyHave ? \"have\" : \"new\", pfrom->GetId());\n\n            if (inv.type == MSG_TX) {\n                inv.type |= nFetchFlags;\n            }\n\n            if (inv.type == MSG_BLOCK) {\n                UpdateBlockAvailability(pfrom->GetId(), inv.hash);\n                if (!fAlreadyHave && !fImporting && !fReindex && !mapBlocksInFlight.count(inv.hash)) {\n                    // We used to request the full block here, but since headers-announcements are now the\n                    // primary method of announcement on the network, and since, in the case that a node\n                    // fell back to inv we probably have a reorg which we should get the headers for first,\n                    // we now only provide a getheaders response here. When we receive the headers, we will\n                    // then ask for the blocks we need.\n                    connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETHEADERS, chainActive.GetLocator(pindexBestHeader), inv.hash));\n                    LogPrint(BCLog::NET, \"getheaders (%d) %s to peer=%d\\n\", pindexBestHeader->nHeight, inv.hash.ToString(), pfrom->GetId());\n                }\n            }\n            else\n            {\n                pfrom->AddInventoryKnown(inv);\n                if (fBlocksOnly) {\n                    LogPrint(BCLog::NET, \"transaction (%s) inv sent in violation of protocol peer=%d\\n\", inv.hash.ToString(), pfrom->GetId());\n                } else if (!fAlreadyHave && !fImporting && !fReindex && !IsInitialBlockDownload()) {\n                    pfrom->AskFor(inv);\n                }\n            }\n        }\n    }\n\n\n    else if (strCommand == NetMsgType::GETDATA)\n    {\n        std::vector<CInv> vInv;\n        vRecv >> vInv;\n        if (vInv.size() > MAX_INV_SZ)\n        {\n            LOCK(cs_main);\n            Misbehaving(pfrom->GetId(), 20);\n            return error(\"message getdata size() = %u\", vInv.size());\n        }\n\n        LogPrint(BCLog::NET, \"received getdata (%u invsz) peer=%d\\n\", vInv.size(), pfrom->GetId());\n\n        if (vInv.size() > 0) {\n            LogPrint(BCLog::NET, \"received getdata for: %s peer=%d\\n\", vInv[0].ToString(), pfrom->GetId());\n        }\n\n        pfrom->vRecvGetData.insert(pfrom->vRecvGetData.end(), vInv.begin(), vInv.end());\n        ProcessGetData(pfrom, chainparams.GetConsensus(), connman, interruptMsgProc);\n    }\n\n\n    else if (strCommand == NetMsgType::GETBLOCKS)\n    {\n        CBlockLocator locator;\n        uint256 hashStop;\n        vRecv >> locator >> hashStop;\n\n        // We might have announced the currently-being-connected tip using a\n        // compact block, which resulted in the peer sending a getblocks\n        // request, which we would otherwise respond to without the new block.\n        // To avoid this situation we simply verify that we are on our best\n        // known chain now. This is super overkill, but we handle it better\n        // for getheaders requests, and there are no known nodes which support\n        // compact blocks but still use getblocks to request blocks.\n        {\n            std::shared_ptr<const CBlock> a_recent_block;\n            {\n                LOCK(cs_most_recent_block);\n                a_recent_block = most_recent_block;\n            }\n            CValidationState dummy;\n            ActivateBestChain(dummy, Params(), a_recent_block);\n        }\n\n        LOCK(cs_main);\n\n        // Find the last block the caller has in the main chain\n        const CBlockIndex* pindex = FindForkInGlobalIndex(chainActive, locator);\n\n        // Send the rest of the chain\n        if (pindex)\n            pindex = chainActive.Next(pindex);\n        int nLimit = 500;\n        LogPrint(BCLog::NET, \"getblocks %d to %s limit %d from peer=%d\\n\", (pindex ? pindex->nHeight : -1), hashStop.IsNull() ? \"end\" : hashStop.ToString(), nLimit, pfrom->GetId());\n        for (; pindex; pindex = chainActive.Next(pindex))\n        {\n            if (pindex->GetBlockHash() == hashStop)\n            {\n                LogPrint(BCLog::NET, \"  getblocks stopping at %d %s\\n\", pindex->nHeight, pindex->GetBlockHash().ToString());\n                break;\n            }\n            // If pruning, don't inv blocks unless we have on disk and are likely to still have\n            // for some reasonable time window (1 hour) that block relay might require.\n            const int nPrunedBlocksLikelyToHave = MIN_BLOCKS_TO_KEEP - 3600 / chainparams.GetConsensus().nPowTargetSpacing;\n            if (fPruneMode && (!(pindex->nStatus & BLOCK_HAVE_DATA) || pindex->nHeight <= chainActive.Tip()->nHeight - nPrunedBlocksLikelyToHave))\n            {\n                LogPrint(BCLog::NET, \" getblocks stopping, pruned or too old block at %d %s\\n\", pindex->nHeight, pindex->GetBlockHash().ToString());\n                break;\n            }\n            pfrom->PushInventory(CInv(MSG_BLOCK, pindex->GetBlockHash()));\n            if (--nLimit <= 0)\n            {\n                // When this block is requested, we'll send an inv that'll\n                // trigger the peer to getblocks the next batch of inventory.\n                LogPrint(BCLog::NET, \"  getblocks stopping at limit %d %s\\n\", pindex->nHeight, pindex->GetBlockHash().ToString());\n                pfrom->hashContinue = pindex->GetBlockHash();\n                break;\n            }\n        }\n    }\n\n\n    else if (strCommand == NetMsgType::GETBLOCKTXN)\n    {\n        BlockTransactionsRequest req;\n        vRecv >> req;\n\n        std::shared_ptr<const CBlock> recent_block;\n        {\n            LOCK(cs_most_recent_block);\n            if (most_recent_block_hash == req.blockhash)\n                recent_block = most_recent_block;\n            // Unlock cs_most_recent_block to avoid cs_main lock inversion\n        }\n        if (recent_block) {\n            SendBlockTransactions(*recent_block, req, pfrom, connman);\n            return true;\n        }\n\n        LOCK(cs_main);\n\n        BlockMap::iterator it = mapBlockIndex.find(req.blockhash);\n        if (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA)) {\n            LogPrint(BCLog::NET, \"Peer %d sent us a getblocktxn for a block we don't have\", pfrom->GetId());\n            return true;\n        }\n\n        if (it->second->nHeight < chainActive.Height() - MAX_BLOCKTXN_DEPTH) {\n            // If an older block is requested (should never happen in practice,\n            // but can happen in tests) send a block response instead of a\n            // blocktxn response. Sending a full block response instead of a\n            // small blocktxn response is preferable in the case where a peer\n            // might maliciously send lots of getblocktxn requests to trigger\n            // expensive disk reads, because it will require the peer to\n            // actually receive all the data read from disk over the network.\n            LogPrint(BCLog::NET, \"Peer %d sent us a getblocktxn for a block > %i deep\", pfrom->GetId(), MAX_BLOCKTXN_DEPTH);\n            CInv inv;\n            inv.type = State(pfrom->GetId())->fWantsCmpctWitness ? MSG_WITNESS_BLOCK : MSG_BLOCK;\n            inv.hash = req.blockhash;\n            pfrom->vRecvGetData.push_back(inv);\n            // The message processing loop will go around again (without pausing) and we'll respond then (without cs_main)\n            return true;\n        }\n\n        CBlock block;\n        bool ret = ReadBlockFromDisk(block, it->second, chainparams.GetConsensus());\n        assert(ret);\n\n        SendBlockTransactions(block, req, pfrom, connman);\n    }\n\n\n    else if (strCommand == NetMsgType::GETHEADERS)\n    {\n        CBlockLocator locator;\n        uint256 hashStop;\n        vRecv >> locator >> hashStop;\n\n        LOCK(cs_main);\n        if (IsInitialBlockDownload() && !pfrom->fWhitelisted) {\n            LogPrint(BCLog::NET, \"Ignoring getheaders from peer=%d because node is in initial block download\\n\", pfrom->GetId());\n            return true;\n        }\n\n        CNodeState *nodestate = State(pfrom->GetId());\n        const CBlockIndex* pindex = nullptr;\n        if (locator.IsNull())\n        {\n            // If locator is null, return the hashStop block\n            BlockMap::iterator mi = mapBlockIndex.find(hashStop);\n            if (mi == mapBlockIndex.end())\n                return true;\n            pindex = (*mi).second;\n\n            if (!BlockRequestAllowed(pindex, chainparams.GetConsensus())) {\n                LogPrint(BCLog::NET, \"%s: ignoring request from peer=%i for old block header that isn't in the main chain\\n\", __func__, pfrom->GetId());\n                return true;\n            }\n        }\n        else\n        {\n            // Find the last block the caller has in the main chain\n            pindex = FindForkInGlobalIndex(chainActive, locator);\n            if (pindex)\n                pindex = chainActive.Next(pindex);\n        }\n\n        // we must use CBlocks, as CBlockHeaders won't include the 0x00 nTx count at the end\n        std::vector<CBlock> vHeaders;\n        int nLimit = MAX_HEADERS_RESULTS;\n        LogPrint(BCLog::NET, \"getheaders %d to %s from peer=%d\\n\", (pindex ? pindex->nHeight : -1), hashStop.IsNull() ? \"end\" : hashStop.ToString(), pfrom->GetId());\n        for (; pindex; pindex = chainActive.Next(pindex))\n        {\n            vHeaders.push_back(pindex->GetBlockHeader());\n            if (--nLimit <= 0 || pindex->GetBlockHash() == hashStop)\n                break;\n        }\n        // pindex can be nullptr either if we sent chainActive.Tip() OR\n        // if our peer has chainActive.Tip() (and thus we are sending an empty\n        // headers message). In both cases it's safe to update\n        // pindexBestHeaderSent to be our tip.\n        //\n        // It is important that we simply reset the BestHeaderSent value here,\n        // and not max(BestHeaderSent, newHeaderSent). We might have announced\n        // the currently-being-connected tip using a compact block, which\n        // resulted in the peer sending a headers request, which we respond to\n        // without the new block. By resetting the BestHeaderSent, we ensure we\n        // will re-announce the new block via headers (or compact blocks again)\n        // in the SendMessages logic.\n        nodestate->pindexBestHeaderSent = pindex ? pindex : chainActive.Tip();\n        connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::HEADERS, vHeaders));\n    }\n\n\n    else if (strCommand == NetMsgType::TX)\n    {\n        // Stop processing the transaction early if\n        // We are in blocks only mode and peer is either not whitelisted or whitelistrelay is off\n        if (!fRelayTxes && (!pfrom->fWhitelisted || !gArgs.GetBoolArg(\"-whitelistrelay\", DEFAULT_WHITELISTRELAY)))\n        {\n            LogPrint(BCLog::NET, \"transaction sent in violation of protocol peer=%d\\n\", pfrom->GetId());\n            return true;\n        }\n\n        std::deque<COutPoint> vWorkQueue;\n        std::vector<uint256> vEraseQueue;\n        CTransactionRef ptx;\n        vRecv >> ptx;\n        const CTransaction& tx = *ptx;\n\n        CInv inv(MSG_TX, tx.GetHash());\n        pfrom->AddInventoryKnown(inv);\n\n        LOCK2(cs_main, g_cs_orphans);\n\n        bool fMissingInputs = false;\n        CValidationState state;\n\n        pfrom->setAskFor.erase(inv.hash);\n        mapAlreadyAskedFor.erase(inv.hash);\n\n        std::list<CTransactionRef> lRemovedTxn;\n\n        if (!AlreadyHave(inv) &&\n            AcceptToMemoryPool(mempool, state, ptx, &fMissingInputs, &lRemovedTxn, false /* bypass_limits */, 0 /* nAbsurdFee */)) {\n            mempool.check(pcoinsTip.get());\n            RelayTransaction(tx, connman);\n            for (unsigned int i = 0; i < tx.vout.size(); i++) {\n                vWorkQueue.emplace_back(inv.hash, i);\n            }\n\n            pfrom->nLastTXTime = GetTime();\n\n            LogPrint(BCLog::MEMPOOL, \"AcceptToMemoryPool: peer=%d: accepted %s (poolsz %u txn, %u kB)\\n\",\n                pfrom->GetId(),\n                tx.GetHash().ToString(),\n                mempool.size(), mempool.DynamicMemoryUsage() / 1000);\n\n            // Recursively process any orphan transactions that depended on this one\n            std::set<NodeId> setMisbehaving;\n            while (!vWorkQueue.empty()) {\n                auto itByPrev = mapOrphanTransactionsByPrev.find(vWorkQueue.front());\n                vWorkQueue.pop_front();\n                if (itByPrev == mapOrphanTransactionsByPrev.end())\n                    continue;\n                for (auto mi = itByPrev->second.begin();\n                     mi != itByPrev->second.end();\n                     ++mi)\n                {\n                    const CTransactionRef& porphanTx = (*mi)->second.tx;\n                    const CTransaction& orphanTx = *porphanTx;\n                    const uint256& orphanHash = orphanTx.GetHash();\n                    NodeId fromPeer = (*mi)->second.fromPeer;\n                    bool fMissingInputs2 = false;\n                    // Use a dummy CValidationState so someone can't setup nodes to counter-DoS based on orphan\n                    // resolution (that is, feeding people an invalid transaction based on LegitTxX in order to get\n                    // anyone relaying LegitTxX banned)\n                    CValidationState stateDummy;\n\n\n                    if (setMisbehaving.count(fromPeer))\n                        continue;\n                    if (AcceptToMemoryPool(mempool, stateDummy, porphanTx, &fMissingInputs2, &lRemovedTxn, false /* bypass_limits */, 0 /* nAbsurdFee */)) {\n                        LogPrint(BCLog::MEMPOOL, \"   accepted orphan tx %s\\n\", orphanHash.ToString());\n                        RelayTransaction(orphanTx, connman);\n                        for (unsigned int i = 0; i < orphanTx.vout.size(); i++) {\n                            vWorkQueue.emplace_back(orphanHash, i);\n                        }\n                        vEraseQueue.push_back(orphanHash);\n                    }\n                    else if (!fMissingInputs2)\n                    {\n                        int nDos = 0;\n                        if (stateDummy.IsInvalid(nDos) && nDos > 0)\n                        {\n                            // Punish peer that gave us an invalid orphan tx\n                            Misbehaving(fromPeer, nDos);\n                            setMisbehaving.insert(fromPeer);\n                            LogPrint(BCLog::MEMPOOL, \"   invalid orphan tx %s\\n\", orphanHash.ToString());\n                        }\n                        // Has inputs but not accepted to mempool\n                        // Probably non-standard or insufficient fee\n                        LogPrint(BCLog::MEMPOOL, \"   removed orphan tx %s\\n\", orphanHash.ToString());\n                        vEraseQueue.push_back(orphanHash);\n                        if (!orphanTx.HasWitness() && !stateDummy.CorruptionPossible()) {\n                            // Do not use rejection cache for witness transactions or\n                            // witness-stripped transactions, as they can have been malleated.\n                            // See https://github.com/bitcoin/bitcoin/issues/8279 for details.\n                            assert(recentRejects);\n                            recentRejects->insert(orphanHash);\n                        }\n                    }\n                    mempool.check(pcoinsTip.get());\n                }\n            }\n\n            for (uint256 hash : vEraseQueue)\n                EraseOrphanTx(hash);\n        }\n        else if (fMissingInputs)\n        {\n            bool fRejectedParents = false; // It may be the case that the orphans parents have all been rejected\n            for (const CTxIn& txin : tx.vin) {\n                if (recentRejects->contains(txin.prevout.hash)) {\n                    fRejectedParents = true;\n                    break;\n                }\n            }\n            if (!fRejectedParents) {\n                uint32_t nFetchFlags = GetFetchFlags(pfrom);\n                for (const CTxIn& txin : tx.vin) {\n                    CInv _inv(MSG_TX | nFetchFlags, txin.prevout.hash);\n                    pfrom->AddInventoryKnown(_inv);\n                    if (!AlreadyHave(_inv)) pfrom->AskFor(_inv);\n                }\n                AddOrphanTx(ptx, pfrom->GetId());\n\n                // DoS prevention: do not allow mapOrphanTransactions to grow unbounded\n                unsigned int nMaxOrphanTx = (unsigned int)std::max((int64_t)0, gArgs.GetArg(\"-maxorphantx\", DEFAULT_MAX_ORPHAN_TRANSACTIONS));\n                unsigned int nEvicted = LimitOrphanTxSize(nMaxOrphanTx);\n                if (nEvicted > 0) {\n                    LogPrint(BCLog::MEMPOOL, \"mapOrphan overflow, removed %u tx\\n\", nEvicted);\n                }\n            } else {\n                LogPrint(BCLog::MEMPOOL, \"not keeping orphan with rejected parents %s\\n\",tx.GetHash().ToString());\n                // We will continue to reject this tx since it has rejected\n                // parents so avoid re-requesting it from other peers.\n                recentRejects->insert(tx.GetHash());\n            }\n        } else {\n            if (!tx.HasWitness() && !state.CorruptionPossible()) {\n                // Do not use rejection cache for witness transactions or\n                // witness-stripped transactions, as they can have been malleated.\n                // See https://github.com/bitcoin/bitcoin/issues/8279 for details.\n                assert(recentRejects);\n                recentRejects->insert(tx.GetHash());\n                if (RecursiveDynamicUsage(*ptx) < 100000) {\n                    AddToCompactExtraTransactions(ptx);\n                }\n            } else if (tx.HasWitness() && RecursiveDynamicUsage(*ptx) < 100000) {\n                AddToCompactExtraTransactions(ptx);\n            }\n\n            if (pfrom->fWhitelisted && gArgs.GetBoolArg(\"-whitelistforcerelay\", DEFAULT_WHITELISTFORCERELAY)) {\n                // Always relay transactions received from whitelisted peers, even\n                // if they were already in the mempool or rejected from it due\n                // to policy, allowing the node to function as a gateway for\n                // nodes hidden behind it.\n                //\n                // Never relay transactions that we would assign a non-zero DoS\n                // score for, as we expect peers to do the same with us in that\n                // case.\n                int nDoS = 0;\n                if (!state.IsInvalid(nDoS) || nDoS == 0) {\n                    LogPrintf(\"Force relaying tx %s from whitelisted peer=%d\\n\", tx.GetHash().ToString(), pfrom->GetId());\n                    RelayTransaction(tx, connman);\n                } else {\n                    LogPrintf(\"Not relaying invalid transaction %s from whitelisted peer=%d (%s)\\n\", tx.GetHash().ToString(), pfrom->GetId(), FormatStateMessage(state));\n                }\n            }\n        }\n\n        for (const CTransactionRef& removedTx : lRemovedTxn)\n            AddToCompactExtraTransactions(removedTx);\n\n        int nDoS = 0;\n        if (state.IsInvalid(nDoS))\n        {\n            LogPrint(BCLog::MEMPOOLREJ, \"%s from peer=%d was not accepted: %s\\n\", tx.GetHash().ToString(),\n                pfrom->GetId(),\n                FormatStateMessage(state));\n            if (state.GetRejectCode() > 0 && state.GetRejectCode() < REJECT_INTERNAL) // Never send AcceptToMemoryPool's internal codes over P2P\n                connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::REJECT, strCommand, (unsigned char)state.GetRejectCode(),\n                                   state.GetRejectReason().substr(0, MAX_REJECT_MESSAGE_LENGTH), inv.hash));\n            if (nDoS > 0) {\n                Misbehaving(pfrom->GetId(), nDoS);\n            }\n        }\n    }\n\n\n    else if (strCommand == NetMsgType::CMPCTBLOCK && !fImporting && !fReindex) // Ignore blocks received while importing\n    {\n        CBlockHeaderAndShortTxIDs cmpctblock;\n        vRecv >> cmpctblock;\n\n        bool received_new_header = false;\n\n        {\n        LOCK(cs_main);\n\n        if (mapBlockIndex.find(cmpctblock.header.hashPrevBlock) == mapBlockIndex.end()) {\n            // Doesn't connect (or is genesis), instead of DoSing in AcceptBlockHeader, request deeper headers\n            if (!IsInitialBlockDownload())\n                connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETHEADERS, chainActive.GetLocator(pindexBestHeader), uint256()));\n            return true;\n        }\n\n        if (mapBlockIndex.find(cmpctblock.header.GetHash()) == mapBlockIndex.end()) {\n            received_new_header = true;\n        }\n        }\n\n        const CBlockIndex *pindex = nullptr;\n        CValidationState state;\n        if (!ProcessNewBlockHeaders({cmpctblock.header}, state, chainparams, &pindex)) {\n            int nDoS;\n            if (state.IsInvalid(nDoS)) {\n                if (nDoS > 0) {\n                    LogPrintf(\"Peer %d sent us invalid header via cmpctblock\\n\", pfrom->GetId());\n                    LOCK(cs_main);\n                    Misbehaving(pfrom->GetId(), nDoS);\n                } else {\n                    LogPrint(BCLog::NET, \"Peer %d sent us invalid header via cmpctblock\\n\", pfrom->GetId());\n                }\n                return true;\n            }\n        }\n\n        // When we succeed in decoding a block's txids from a cmpctblock\n        // message we typically jump to the BLOCKTXN handling code, with a\n        // dummy (empty) BLOCKTXN message, to re-use the logic there in\n        // completing processing of the putative block (without cs_main).\n        bool fProcessBLOCKTXN = false;\n        CDataStream blockTxnMsg(SER_NETWORK, PROTOCOL_VERSION);\n\n        // If we end up treating this as a plain headers message, call that as well\n        // without cs_main.\n        bool fRevertToHeaderProcessing = false;\n\n        // Keep a CBlock for \"optimistic\" compactblock reconstructions (see\n        // below)\n        std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();\n        bool fBlockReconstructed = false;\n\n        {\n        LOCK2(cs_main, g_cs_orphans);\n        // If AcceptBlockHeader returned true, it set pindex\n        assert(pindex);\n        UpdateBlockAvailability(pfrom->GetId(), pindex->GetBlockHash());\n\n        CNodeState *nodestate = State(pfrom->GetId());\n\n        // If this was a new header with more work than our tip, update the\n        // peer's last block announcement time\n        if (received_new_header && pindex->nChainWork > chainActive.Tip()->nChainWork) {\n            nodestate->m_last_block_announcement = GetTime();\n        }\n\n        std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> >::iterator blockInFlightIt = mapBlocksInFlight.find(pindex->GetBlockHash());\n        bool fAlreadyInFlight = blockInFlightIt != mapBlocksInFlight.end();\n\n        if (pindex->nStatus & BLOCK_HAVE_DATA) // Nothing to do here\n            return true;\n\n        if (pindex->nChainWork <= chainActive.Tip()->nChainWork || // We know something better\n                pindex->nTx != 0) { // We had this block at some point, but pruned it\n            if (fAlreadyInFlight) {\n                // We requested this block for some reason, but our mempool will probably be useless\n                // so we just grab the block via normal getdata\n                std::vector<CInv> vInv(1);\n                vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(pfrom), cmpctblock.header.GetHash());\n                connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));\n            }\n            return true;\n        }\n\n        // If we're not close to tip yet, give up and let parallel block fetch work its magic\n        if (!fAlreadyInFlight && !CanDirectFetch(chainparams.GetConsensus()))\n            return true;\n\n        if (IsWitnessEnabled(pindex->pprev, chainparams.GetConsensus()) && !nodestate->fSupportsDesiredCmpctVersion) {\n            // Don't bother trying to process compact blocks from v1 peers\n            // after segwit activates.\n            return true;\n        }\n\n        // We want to be a bit conservative just to be extra careful about DoS\n        // possibilities in compact block processing...\n        if (pindex->nHeight <= chainActive.Height() + 2) {\n            if ((!fAlreadyInFlight && nodestate->nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER) ||\n                 (fAlreadyInFlight && blockInFlightIt->second.first == pfrom->GetId())) {\n                std::list<QueuedBlock>::iterator* queuedBlockIt = nullptr;\n                if (!MarkBlockAsInFlight(pfrom->GetId(), pindex->GetBlockHash(), pindex, &queuedBlockIt)) {\n                    if (!(*queuedBlockIt)->partialBlock)\n                        (*queuedBlockIt)->partialBlock.reset(new PartiallyDownloadedBlock(&mempool));\n                    else {\n                        // The block was already in flight using compact blocks from the same peer\n                        LogPrint(BCLog::NET, \"Peer sent us compact block we were already syncing!\\n\");\n                        return true;\n                    }\n                }\n\n                PartiallyDownloadedBlock& partialBlock = *(*queuedBlockIt)->partialBlock;\n                ReadStatus status = partialBlock.InitData(cmpctblock, vExtraTxnForCompact);\n                if (status == READ_STATUS_INVALID) {\n                    MarkBlockAsReceived(pindex->GetBlockHash()); // Reset in-flight state in case of whitelist\n                    Misbehaving(pfrom->GetId(), 100);\n                    LogPrintf(\"Peer %d sent us invalid compact block\\n\", pfrom->GetId());\n                    return true;\n                } else if (status == READ_STATUS_FAILED) {\n                    // Duplicate txindexes, the block is now in-flight, so just request it\n                    std::vector<CInv> vInv(1);\n                    vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(pfrom), cmpctblock.header.GetHash());\n                    connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));\n                    return true;\n                }\n\n                BlockTransactionsRequest req;\n                for (size_t i = 0; i < cmpctblock.BlockTxCount(); i++) {\n                    if (!partialBlock.IsTxAvailable(i))\n                        req.indexes.push_back(i);\n                }\n                if (req.indexes.empty()) {\n                    // Dirty hack to jump to BLOCKTXN code (TODO: move message handling into their own functions)\n                    BlockTransactions txn;\n                    txn.blockhash = cmpctblock.header.GetHash();\n                    blockTxnMsg << txn;\n                    fProcessBLOCKTXN = true;\n                } else {\n                    req.blockhash = pindex->GetBlockHash();\n                    connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETBLOCKTXN, req));\n                }\n            } else {\n                // This block is either already in flight from a different\n                // peer, or this peer has too many blocks outstanding to\n                // download from.\n                // Optimistically try to reconstruct anyway since we might be\n                // able to without any round trips.\n                PartiallyDownloadedBlock tempBlock(&mempool);\n                ReadStatus status = tempBlock.InitData(cmpctblock, vExtraTxnForCompact);\n                if (status != READ_STATUS_OK) {\n                    // TODO: don't ignore failures\n                    return true;\n                }\n                std::vector<CTransactionRef> dummy;\n                status = tempBlock.FillBlock(*pblock, dummy);\n                if (status == READ_STATUS_OK) {\n                    fBlockReconstructed = true;\n                }\n            }\n        } else {\n            if (fAlreadyInFlight) {\n                // We requested this block, but its far into the future, so our\n                // mempool will probably be useless - request the block normally\n                std::vector<CInv> vInv(1);\n                vInv[0] = CInv(MSG_BLOCK | GetFetchFlags(pfrom), cmpctblock.header.GetHash());\n                connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, vInv));\n                return true;\n            } else {\n                // If this was an announce-cmpctblock, we want the same treatment as a header message\n                fRevertToHeaderProcessing = true;\n            }\n        }\n        } // cs_main\n\n        if (fProcessBLOCKTXN)\n            return ProcessMessage(pfrom, NetMsgType::BLOCKTXN, blockTxnMsg, nTimeReceived, chainparams, connman, interruptMsgProc);\n\n        if (fRevertToHeaderProcessing) {\n            // Headers received from HB compact block peers are permitted to be\n            // relayed before full validation (see BIP 152), so we don't want to disconnect\n            // the peer if the header turns out to be for an invalid block.\n            // Note that if a peer tries to build on an invalid chain, that\n            // will be detected and the peer will be banned.\n            return ProcessHeadersMessage(pfrom, connman, {cmpctblock.header}, chainparams, /*punish_duplicate_invalid=*/false);\n        }\n\n        if (fBlockReconstructed) {\n            // If we got here, we were able to optimistically reconstruct a\n            // block that is in flight from some other peer.\n            {\n                LOCK(cs_main);\n                mapBlockSource.emplace(pblock->GetHash(), std::make_pair(pfrom->GetId(), false));\n            }\n            bool fNewBlock = false;\n            // Setting fForceProcessing to true means that we bypass some of\n            // our anti-DoS protections in AcceptBlock, which filters\n            // unrequested blocks that might be trying to waste our resources\n            // (eg disk space). Because we only try to reconstruct blocks when\n            // we're close to caught up (via the CanDirectFetch() requirement\n            // above, combined with the behavior of not requesting blocks until\n            // we have a chain with at least nMinimumChainWork), and we ignore\n            // compact blocks with less work than our tip, it is safe to treat\n            // reconstructed compact blocks as having been requested.\n            ProcessNewBlock(chainparams, pblock, /*fForceProcessing=*/true, &fNewBlock);\n            if (fNewBlock) {\n                pfrom->nLastBlockTime = GetTime();\n            } else {\n                LOCK(cs_main);\n                mapBlockSource.erase(pblock->GetHash());\n            }\n            LOCK(cs_main); // hold cs_main for CBlockIndex::IsValid()\n            if (pindex->IsValid(BLOCK_VALID_TRANSACTIONS)) {\n                // Clear download state for this block, which is in\n                // process from some other peer.  We do this after calling\n                // ProcessNewBlock so that a malleated cmpctblock announcement\n                // can't be used to interfere with block relay.\n                MarkBlockAsReceived(pblock->GetHash());\n            }\n        }\n\n    }\n\n    else if (strCommand == NetMsgType::BLOCKTXN && !fImporting && !fReindex) // Ignore blocks received while importing\n    {\n        BlockTransactions resp;\n        vRecv >> resp;\n\n        std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();\n        bool fBlockRead = false;\n        {\n            LOCK(cs_main);\n\n            std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> >::iterator it = mapBlocksInFlight.find(resp.blockhash);\n            if (it == mapBlocksInFlight.end() || !it->second.second->partialBlock ||\n                    it->second.first != pfrom->GetId()) {\n                LogPrint(BCLog::NET, \"Peer %d sent us block transactions for block we weren't expecting\\n\", pfrom->GetId());\n                return true;\n            }\n\n            PartiallyDownloadedBlock& partialBlock = *it->second.second->partialBlock;\n            ReadStatus status = partialBlock.FillBlock(*pblock, resp.txn);\n            if (status == READ_STATUS_INVALID) {\n                MarkBlockAsReceived(resp.blockhash); // Reset in-flight state in case of whitelist\n                Misbehaving(pfrom->GetId(), 100);\n                LogPrintf(\"Peer %d sent us invalid compact block/non-matching block transactions\\n\", pfrom->GetId());\n                return true;\n            } else if (status == READ_STATUS_FAILED) {\n                // Might have collided, fall back to getdata now :(\n                std::vector<CInv> invs;\n                invs.push_back(CInv(MSG_BLOCK | GetFetchFlags(pfrom), resp.blockhash));\n                connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, invs));\n            } else {\n                // Block is either okay, or possibly we received\n                // READ_STATUS_CHECKBLOCK_FAILED.\n                // Note that CheckBlock can only fail for one of a few reasons:\n                // 1. bad-proof-of-work (impossible here, because we've already\n                //    accepted the header)\n                // 2. merkleroot doesn't match the transactions given (already\n                //    caught in FillBlock with READ_STATUS_FAILED, so\n                //    impossible here)\n                // 3. the block is otherwise invalid (eg invalid coinbase,\n                //    block is too big, too many legacy sigops, etc).\n                // So if CheckBlock failed, #3 is the only possibility.\n                // Under BIP 152, we don't DoS-ban unless proof of work is\n                // invalid (we don't require all the stateless checks to have\n                // been run).  This is handled below, so just treat this as\n                // though the block was successfully read, and rely on the\n                // handling in ProcessNewBlock to ensure the block index is\n                // updated, reject messages go out, etc.\n                MarkBlockAsReceived(resp.blockhash); // it is now an empty pointer\n                fBlockRead = true;\n                // mapBlockSource is only used for sending reject messages and DoS scores,\n                // so the race between here and cs_main in ProcessNewBlock is fine.\n                // BIP 152 permits peers to relay compact blocks after validating\n                // the header only; we should not punish peers if the block turns\n                // out to be invalid.\n                mapBlockSource.emplace(resp.blockhash, std::make_pair(pfrom->GetId(), false));\n            }\n        } // Don't hold cs_main when we call into ProcessNewBlock\n        if (fBlockRead) {\n            bool fNewBlock = false;\n            // Since we requested this block (it was in mapBlocksInFlight), force it to be processed,\n            // even if it would not be a candidate for new tip (missing previous block, chain not long enough, etc)\n            // This bypasses some anti-DoS logic in AcceptBlock (eg to prevent\n            // disk-space attacks), but this should be safe due to the\n            // protections in the compact block handler -- see related comment\n            // in compact block optimistic reconstruction handling.\n            ProcessNewBlock(chainparams, pblock, /*fForceProcessing=*/true, &fNewBlock);\n            if (fNewBlock) {\n                pfrom->nLastBlockTime = GetTime();\n            } else {\n                LOCK(cs_main);\n                mapBlockSource.erase(pblock->GetHash());\n            }\n        }\n    }\n\n\n    else if (strCommand == NetMsgType::HEADERS && !fImporting && !fReindex) // Ignore headers received while importing\n    {\n        std::vector<CBlockHeader> headers;\n\n        // Bypass the normal CBlock deserialization, as we don't want to risk deserializing 2000 full blocks.\n        unsigned int nCount = ReadCompactSize(vRecv);\n        if (nCount > MAX_HEADERS_RESULTS) {\n            LOCK(cs_main);\n            Misbehaving(pfrom->GetId(), 20);\n            return error(\"headers message size = %u\", nCount);\n        }\n        headers.resize(nCount);\n        for (unsigned int n = 0; n < nCount; n++) {\n            vRecv >> headers[n];\n            ReadCompactSize(vRecv); // ignore tx count; assume it is 0.\n        }\n\n        // Headers received via a HEADERS message should be valid, and reflect\n        // the chain the peer is on. If we receive a known-invalid header,\n        // disconnect the peer if it is using one of our outbound connection\n        // slots.\n        bool should_punish = !pfrom->fInbound && !pfrom->m_manual_connection;\n        return ProcessHeadersMessage(pfrom, connman, headers, chainparams, should_punish);\n    }\n\n    else if (strCommand == NetMsgType::BLOCK && !fImporting && !fReindex) // Ignore blocks received while importing\n    {\n        std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();\n        vRecv >> *pblock;\n\n        LogPrint(BCLog::NET, \"received block %s peer=%d\\n\", pblock->GetHash().ToString(), pfrom->GetId());\n\n        bool forceProcessing = false;\n        const uint256 hash(pblock->GetHash());\n        {\n            LOCK(cs_main);\n            // Also always process if we requested the block explicitly, as we may\n            // need it even though it is not a candidate for a new best tip.\n            forceProcessing |= MarkBlockAsReceived(hash);\n            // mapBlockSource is only used for sending reject messages and DoS scores,\n            // so the race between here and cs_main in ProcessNewBlock is fine.\n            mapBlockSource.emplace(hash, std::make_pair(pfrom->GetId(), true));\n        }\n        bool fNewBlock = false;\n        ProcessNewBlock(chainparams, pblock, forceProcessing, &fNewBlock);\n        if (fNewBlock) {\n            pfrom->nLastBlockTime = GetTime();\n        } else {\n            LOCK(cs_main);\n            mapBlockSource.erase(pblock->GetHash());\n        }\n    }\n\n\n    else if (strCommand == NetMsgType::GETADDR)\n    {\n        // This asymmetric behavior for inbound and outbound connections was introduced\n        // to prevent a fingerprinting attack: an attacker can send specific fake addresses\n        // to users' AddrMan and later request them by sending getaddr messages.\n        // Making nodes which are behind NAT and can only make outgoing connections ignore\n        // the getaddr message mitigates the attack.\n        if (!pfrom->fInbound) {\n            LogPrint(BCLog::NET, \"Ignoring \\\"getaddr\\\" from outbound connection. peer=%d\\n\", pfrom->GetId());\n            return true;\n        }\n\n        // Only send one GetAddr response per connection to reduce resource waste\n        //  and discourage addr stamping of INV announcements.\n        if (pfrom->fSentAddr) {\n            LogPrint(BCLog::NET, \"Ignoring repeated \\\"getaddr\\\". peer=%d\\n\", pfrom->GetId());\n            return true;\n        }\n        pfrom->fSentAddr = true;\n\n        pfrom->vAddrToSend.clear();\n        std::vector<CAddress> vAddr = connman->GetAddresses();\n        FastRandomContext insecure_rand;\n        for (const CAddress &addr : vAddr)\n            pfrom->PushAddress(addr, insecure_rand);\n    }\n\n\n    else if (strCommand == NetMsgType::MEMPOOL)\n    {\n        if (!(pfrom->GetLocalServices() & NODE_BLOOM) && !pfrom->fWhitelisted)\n        {\n            LogPrint(BCLog::NET, \"mempool request with bloom filters disabled, disconnect peer=%d\\n\", pfrom->GetId());\n            pfrom->fDisconnect = true;\n            return true;\n        }\n\n        if (connman->OutboundTargetReached(false) && !pfrom->fWhitelisted)\n        {\n            LogPrint(BCLog::NET, \"mempool request with bandwidth limit reached, disconnect peer=%d\\n\", pfrom->GetId());\n            pfrom->fDisconnect = true;\n            return true;\n        }\n\n        LOCK(pfrom->cs_inventory);\n        pfrom->fSendMempool = true;\n    }\n\n\n    else if (strCommand == NetMsgType::PING)\n    {\n        if (pfrom->nVersion > BIP0031_VERSION)\n        {\n            uint64_t nonce = 0;\n            vRecv >> nonce;\n            // Echo the message back with the nonce. This allows for two useful features:\n            //\n            // 1) A remote node can quickly check if the connection is operational\n            // 2) Remote nodes can measure the latency of the network thread. If this node\n            //    is overloaded it won't respond to pings quickly and the remote node can\n            //    avoid sending us more work, like chain download requests.\n            //\n            // The nonce stops the remote getting confused between different pings: without\n            // it, if the remote node sends a ping once per second and this node takes 5\n            // seconds to respond to each, the 5th ping the remote sends would appear to\n            // return very quickly.\n            connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::PONG, nonce));\n        }\n    }\n\n\n    else if (strCommand == NetMsgType::PONG)\n    {\n        int64_t pingUsecEnd = nTimeReceived;\n        uint64_t nonce = 0;\n        size_t nAvail = vRecv.in_avail();\n        bool bPingFinished = false;\n        std::string sProblem;\n\n        if (nAvail >= sizeof(nonce)) {\n            vRecv >> nonce;\n\n            // Only process pong message if there is an outstanding ping (old ping without nonce should never pong)\n            if (pfrom->nPingNonceSent != 0) {\n                if (nonce == pfrom->nPingNonceSent) {\n                    // Matching pong received, this ping is no longer outstanding\n                    bPingFinished = true;\n                    int64_t pingUsecTime = pingUsecEnd - pfrom->nPingUsecStart;\n                    if (pingUsecTime > 0) {\n                        // Successful ping time measurement, replace previous\n                        pfrom->nPingUsecTime = pingUsecTime;\n                        pfrom->nMinPingUsecTime = std::min(pfrom->nMinPingUsecTime.load(), pingUsecTime);\n                    } else {\n                        // This should never happen\n                        sProblem = \"Timing mishap\";\n                    }\n                } else {\n                    // Nonce mismatches are normal when pings are overlapping\n                    sProblem = \"Nonce mismatch\";\n                    if (nonce == 0) {\n                        // This is most likely a bug in another implementation somewhere; cancel this ping\n                        bPingFinished = true;\n                        sProblem = \"Nonce zero\";\n                    }\n                }\n            } else {\n                sProblem = \"Unsolicited pong without ping\";\n            }\n        } else {\n            // This is most likely a bug in another implementation somewhere; cancel this ping\n            bPingFinished = true;\n            sProblem = \"Short payload\";\n        }\n\n        if (!(sProblem.empty())) {\n            LogPrint(BCLog::NET, \"pong peer=%d: %s, %x expected, %x received, %u bytes\\n\",\n                pfrom->GetId(),\n                sProblem,\n                pfrom->nPingNonceSent,\n                nonce,\n                nAvail);\n        }\n        if (bPingFinished) {\n            pfrom->nPingNonceSent = 0;\n        }\n    }\n\n\n    else if (strCommand == NetMsgType::FILTERLOAD)\n    {\n        CBloomFilter filter;\n        vRecv >> filter;\n\n        if (!filter.IsWithinSizeConstraints())\n        {\n            // There is no excuse for sending a too-large filter\n            LOCK(cs_main);\n            Misbehaving(pfrom->GetId(), 100);\n        }\n        else\n        {\n            LOCK(pfrom->cs_filter);\n            pfrom->pfilter.reset(new CBloomFilter(filter));\n            pfrom->pfilter->UpdateEmptyFull();\n            pfrom->fRelayTxes = true;\n        }\n    }\n\n\n    else if (strCommand == NetMsgType::FILTERADD)\n    {\n        std::vector<unsigned char> vData;\n        vRecv >> vData;\n\n        // Nodes must NEVER send a data item > 520 bytes (the max size for a script data object,\n        // and thus, the maximum size any matched object can have) in a filteradd message\n        bool bad = false;\n        if (vData.size() > MAX_SCRIPT_ELEMENT_SIZE) {\n            bad = true;\n        } else {\n            LOCK(pfrom->cs_filter);\n            if (pfrom->pfilter) {\n                pfrom->pfilter->insert(vData);\n            } else {\n                bad = true;\n            }\n        }\n        if (bad) {\n            LOCK(cs_main);\n            Misbehaving(pfrom->GetId(), 100);\n        }\n    }\n\n\n    else if (strCommand == NetMsgType::FILTERCLEAR)\n    {\n        LOCK(pfrom->cs_filter);\n        if (pfrom->GetLocalServices() & NODE_BLOOM) {\n            pfrom->pfilter.reset(new CBloomFilter());\n        }\n        pfrom->fRelayTxes = true;\n    }\n\n    else if (strCommand == NetMsgType::FEEFILTER) {\n        CAmount newFeeFilter = 0;\n        vRecv >> newFeeFilter;\n        if (MoneyRange(newFeeFilter)) {\n            {\n                LOCK(pfrom->cs_feeFilter);\n                pfrom->minFeeFilter = newFeeFilter;\n            }\n            LogPrint(BCLog::NET, \"received: feefilter of %s from peer=%d\\n\", CFeeRate(newFeeFilter).ToString(), pfrom->GetId());\n        }\n    }\n\n    else if (strCommand == NetMsgType::NOTFOUND) {\n        // We do not care about the NOTFOUND message, but logging an Unknown Command\n        // message would be undesirable as we transmit it ourselves.\n    }\n\n    else {\n        // Ignore unknown commands for extensibility\n        LogPrint(BCLog::NET, \"Unknown command \\\"%s\\\" from peer=%d\\n\", SanitizeString(strCommand), pfrom->GetId());\n    }\n\n\n\n    return true;\n}\n\nstatic bool SendRejectsAndCheckIfBanned(CNode* pnode, CConnman* connman)\n{\n    AssertLockHeld(cs_main);\n    CNodeState &state = *State(pnode->GetId());\n\n    for (const CBlockReject& reject : state.rejects) {\n        connman->PushMessage(pnode, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::REJECT, (std::string)NetMsgType::BLOCK, reject.chRejectCode, reject.strRejectReason, reject.hashBlock));\n    }\n    state.rejects.clear();\n\n    if (state.fShouldBan) {\n        state.fShouldBan = false;\n        if (pnode->fWhitelisted)\n            LogPrintf(\"Warning: not punishing whitelisted peer %s!\\n\", pnode->addr.ToString());\n        else if (pnode->m_manual_connection)\n            LogPrintf(\"Warning: not punishing manually-connected peer %s!\\n\", pnode->addr.ToString());\n        else {\n            pnode->fDisconnect = true;\n            if (pnode->addr.IsLocal())\n                LogPrintf(\"Warning: not banning local peer %s!\\n\", pnode->addr.ToString());\n            else\n            {\n                connman->Ban(pnode->addr, BanReasonNodeMisbehaving);\n            }\n        }\n        return true;\n    }\n    return false;\n}\n\nbool PeerLogicValidation::ProcessMessages(CNode* pfrom, std::atomic<bool>& interruptMsgProc)\n{\n    const CChainParams& chainparams = Params();\n    //\n    // Message format\n    //  (4) message start\n    //  (12) command\n    //  (4) size\n    //  (4) checksum\n    //  (x) data\n    //\n    bool fMoreWork = false;\n\n    if (!pfrom->vRecvGetData.empty())\n        ProcessGetData(pfrom, chainparams.GetConsensus(), connman, interruptMsgProc);\n\n    if (pfrom->fDisconnect)\n        return false;\n\n    // this maintains the order of responses\n    if (!pfrom->vRecvGetData.empty()) return true;\n\n    // Don't bother if send buffer is too full to respond anyway\n    if (pfrom->fPauseSend)\n        return false;\n\n    std::list<CNetMessage> msgs;\n    {\n        LOCK(pfrom->cs_vProcessMsg);\n        if (pfrom->vProcessMsg.empty())\n            return false;\n        // Just take one message\n        msgs.splice(msgs.begin(), pfrom->vProcessMsg, pfrom->vProcessMsg.begin());\n        pfrom->nProcessQueueSize -= msgs.front().vRecv.size() + CMessageHeader::HEADER_SIZE;\n        pfrom->fPauseRecv = pfrom->nProcessQueueSize > connman->GetReceiveFloodSize();\n        fMoreWork = !pfrom->vProcessMsg.empty();\n    }\n    CNetMessage& msg(msgs.front());\n\n    msg.SetVersion(pfrom->GetRecvVersion());\n    // Scan for message start\n    if (memcmp(msg.hdr.pchMessageStart, chainparams.MessageStart(), CMessageHeader::MESSAGE_START_SIZE) != 0) {\n        LogPrint(BCLog::NET, \"PROCESSMESSAGE: INVALID MESSAGESTART %s peer=%d\\n\", SanitizeString(msg.hdr.GetCommand()), pfrom->GetId());\n        pfrom->fDisconnect = true;\n        return false;\n    }\n\n    // Read header\n    CMessageHeader& hdr = msg.hdr;\n    if (!hdr.IsValid(chainparams.MessageStart()))\n    {\n        LogPrint(BCLog::NET, \"PROCESSMESSAGE: ERRORS IN HEADER %s peer=%d\\n\", SanitizeString(hdr.GetCommand()), pfrom->GetId());\n        return fMoreWork;\n    }\n    std::string strCommand = hdr.GetCommand();\n\n    // Message size\n    unsigned int nMessageSize = hdr.nMessageSize;\n\n    // Checksum\n    CDataStream& vRecv = msg.vRecv;\n    const uint256& hash = msg.GetMessageHash();\n    if (memcmp(hash.begin(), hdr.pchChecksum, CMessageHeader::CHECKSUM_SIZE) != 0)\n    {\n        LogPrint(BCLog::NET, \"%s(%s, %u bytes): CHECKSUM ERROR expected %s was %s\\n\", __func__,\n           SanitizeString(strCommand), nMessageSize,\n           HexStr(hash.begin(), hash.begin()+CMessageHeader::CHECKSUM_SIZE),\n           HexStr(hdr.pchChecksum, hdr.pchChecksum+CMessageHeader::CHECKSUM_SIZE));\n        return fMoreWork;\n    }\n\n    // Process message\n    bool fRet = false;\n    try\n    {\n        fRet = ProcessMessage(pfrom, strCommand, vRecv, msg.nTime, chainparams, connman, interruptMsgProc);\n        if (interruptMsgProc)\n            return false;\n        if (!pfrom->vRecvGetData.empty())\n            fMoreWork = true;\n    }\n    catch (const std::ios_base::failure& e)\n    {\n        connman->PushMessage(pfrom, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::REJECT, strCommand, REJECT_MALFORMED, std::string(\"error parsing message\")));\n        if (strstr(e.what(), \"end of data\"))\n        {\n            // Allow exceptions from under-length message on vRecv\n            LogPrint(BCLog::NET, \"%s(%s, %u bytes): Exception '%s' caught, normally caused by a message being shorter than its stated length\\n\", __func__, SanitizeString(strCommand), nMessageSize, e.what());\n        }\n        else if (strstr(e.what(), \"size too large\"))\n        {\n            // Allow exceptions from over-long size\n            LogPrint(BCLog::NET, \"%s(%s, %u bytes): Exception '%s' caught\\n\", __func__, SanitizeString(strCommand), nMessageSize, e.what());\n        }\n        else if (strstr(e.what(), \"non-canonical ReadCompactSize()\"))\n        {\n            // Allow exceptions from non-canonical encoding\n            LogPrint(BCLog::NET, \"%s(%s, %u bytes): Exception '%s' caught\\n\", __func__, SanitizeString(strCommand), nMessageSize, e.what());\n        }\n        else\n        {\n            PrintExceptionContinue(&e, \"ProcessMessages()\");\n        }\n    }\n    catch (const std::exception& e) {\n        PrintExceptionContinue(&e, \"ProcessMessages()\");\n    } catch (...) {\n        PrintExceptionContinue(nullptr, \"ProcessMessages()\");\n    }\n\n    if (!fRet) {\n        LogPrint(BCLog::NET, \"%s(%s, %u bytes) FAILED peer=%d\\n\", __func__, SanitizeString(strCommand), nMessageSize, pfrom->GetId());\n    }\n\n    LOCK(cs_main);\n    SendRejectsAndCheckIfBanned(pfrom, connman);\n\n    return fMoreWork;\n}\n\nvoid PeerLogicValidation::ConsiderEviction(CNode *pto, int64_t time_in_seconds)\n{\n    AssertLockHeld(cs_main);\n\n    CNodeState &state = *State(pto->GetId());\n    const CNetMsgMaker msgMaker(pto->GetSendVersion());\n\n    if (!state.m_chain_sync.m_protect && IsOutboundDisconnectionCandidate(pto) && state.fSyncStarted) {\n        // This is an outbound peer subject to disconnection if they don't\n        // announce a block with as much work as the current tip within\n        // CHAIN_SYNC_TIMEOUT + HEADERS_RESPONSE_TIME seconds (note: if\n        // their chain has more work than ours, we should sync to it,\n        // unless it's invalid, in which case we should find that out and\n        // disconnect from them elsewhere).\n        if (state.pindexBestKnownBlock != nullptr && state.pindexBestKnownBlock->nChainWork >= chainActive.Tip()->nChainWork) {\n            if (state.m_chain_sync.m_timeout != 0) {\n                state.m_chain_sync.m_timeout = 0;\n                state.m_chain_sync.m_work_header = nullptr;\n                state.m_chain_sync.m_sent_getheaders = false;\n            }\n        } else if (state.m_chain_sync.m_timeout == 0 || (state.m_chain_sync.m_work_header != nullptr && state.pindexBestKnownBlock != nullptr && state.pindexBestKnownBlock->nChainWork >= state.m_chain_sync.m_work_header->nChainWork)) {\n            // Our best block known by this peer is behind our tip, and we're either noticing\n            // that for the first time, OR this peer was able to catch up to some earlier point\n            // where we checked against our tip.\n            // Either way, set a new timeout based on current tip.\n            state.m_chain_sync.m_timeout = time_in_seconds + CHAIN_SYNC_TIMEOUT;\n            state.m_chain_sync.m_work_header = chainActive.Tip();\n            state.m_chain_sync.m_sent_getheaders = false;\n        } else if (state.m_chain_sync.m_timeout > 0 && time_in_seconds > state.m_chain_sync.m_timeout) {\n            // No evidence yet that our peer has synced to a chain with work equal to that\n            // of our tip, when we first detected it was behind. Send a single getheaders\n            // message to give the peer a chance to update us.\n            if (state.m_chain_sync.m_sent_getheaders) {\n                // They've run out of time to catch up!\n                LogPrintf(\"Disconnecting outbound peer %d for old chain, best known block = %s\\n\", pto->GetId(), state.pindexBestKnownBlock != nullptr ? state.pindexBestKnownBlock->GetBlockHash().ToString() : \"<none>\");\n                pto->fDisconnect = true;\n            } else {\n                assert(state.m_chain_sync.m_work_header);\n                LogPrint(BCLog::NET, \"sending getheaders to outbound peer=%d to verify chain work (current best known block:%s, benchmark blockhash: %s)\\n\", pto->GetId(), state.pindexBestKnownBlock != nullptr ? state.pindexBestKnownBlock->GetBlockHash().ToString() : \"<none>\", state.m_chain_sync.m_work_header->GetBlockHash().ToString());\n                connman->PushMessage(pto, msgMaker.Make(NetMsgType::GETHEADERS, chainActive.GetLocator(state.m_chain_sync.m_work_header->pprev), uint256()));\n                state.m_chain_sync.m_sent_getheaders = true;\n                constexpr int64_t HEADERS_RESPONSE_TIME = 120; // 2 minutes\n                // Bump the timeout to allow a response, which could clear the timeout\n                // (if the response shows the peer has synced), reset the timeout (if\n                // the peer syncs to the required work but not to our tip), or result\n                // in disconnect (if we advance to the timeout and pindexBestKnownBlock\n                // has not sufficiently progressed)\n                state.m_chain_sync.m_timeout = time_in_seconds + HEADERS_RESPONSE_TIME;\n            }\n        }\n    }\n}\n\nvoid PeerLogicValidation::EvictExtraOutboundPeers(int64_t time_in_seconds)\n{\n    // Check whether we have too many outbound peers\n    int extra_peers = connman->GetExtraOutboundCount();\n    if (extra_peers > 0) {\n        // If we have more outbound peers than we target, disconnect one.\n        // Pick the outbound peer that least recently announced\n        // us a new block, with ties broken by choosing the more recent\n        // connection (higher node id)\n        NodeId worst_peer = -1;\n        int64_t oldest_block_announcement = std::numeric_limits<int64_t>::max();\n\n        LOCK(cs_main);\n\n        connman->ForEachNode([&](CNode* pnode) {\n            // Ignore non-outbound peers, or nodes marked for disconnect already\n            if (!IsOutboundDisconnectionCandidate(pnode) || pnode->fDisconnect) return;\n            CNodeState *state = State(pnode->GetId());\n            if (state == nullptr) return; // shouldn't be possible, but just in case\n            // Don't evict our protected peers\n            if (state->m_chain_sync.m_protect) return;\n            if (state->m_last_block_announcement < oldest_block_announcement || (state->m_last_block_announcement == oldest_block_announcement && pnode->GetId() > worst_peer)) {\n                worst_peer = pnode->GetId();\n                oldest_block_announcement = state->m_last_block_announcement;\n            }\n        });\n        if (worst_peer != -1) {\n            bool disconnected = connman->ForNode(worst_peer, [&](CNode *pnode) {\n                // Only disconnect a peer that has been connected to us for\n                // some reasonable fraction of our check-frequency, to give\n                // it time for new information to have arrived.\n                // Also don't disconnect any peer we're trying to download a\n                // block from.\n                CNodeState &state = *State(pnode->GetId());\n                if (time_in_seconds - pnode->nTimeConnected > MINIMUM_CONNECT_TIME && state.nBlocksInFlight == 0) {\n                    LogPrint(BCLog::NET, \"disconnecting extra outbound peer=%d (last block announcement received at time %d)\\n\", pnode->GetId(), oldest_block_announcement);\n                    pnode->fDisconnect = true;\n                    return true;\n                } else {\n                    LogPrint(BCLog::NET, \"keeping outbound peer=%d chosen for eviction (connect time: %d, blocks_in_flight: %d)\\n\", pnode->GetId(), pnode->nTimeConnected, state.nBlocksInFlight);\n                    return false;\n                }\n            });\n            if (disconnected) {\n                // If we disconnected an extra peer, that means we successfully\n                // connected to at least one peer after the last time we\n                // detected a stale tip. Don't try any more extra peers until\n                // we next detect a stale tip, to limit the load we put on the\n                // network from these extra connections.\n                connman->SetTryNewOutboundPeer(false);\n            }\n        }\n    }\n}\n\nvoid PeerLogicValidation::CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams)\n{\n    if (connman == nullptr) return;\n\n    int64_t time_in_seconds = GetTime();\n\n    EvictExtraOutboundPeers(time_in_seconds);\n\n    if (time_in_seconds > m_stale_tip_check_time) {\n        LOCK(cs_main);\n        // Check whether our tip is stale, and if so, allow using an extra\n        // outbound peer\n        if (TipMayBeStale(consensusParams)) {\n            if (!IsInitialBlockDownload()) { // FIXME.SUGAR // IBD: do not print this connection log during IBD\n                LogPrintf(\"Potential stale tip detected, will try using extra outbound peer (last tip update: %d seconds ago)\\n\", time_in_seconds - g_last_tip_update);\n            }\n            connman->SetTryNewOutboundPeer(true);\n        } else if (connman->GetTryNewOutboundPeer()) {\n            connman->SetTryNewOutboundPeer(false);\n        }\n        m_stale_tip_check_time = time_in_seconds + STALE_CHECK_INTERVAL;\n    }\n}\n\nclass CompareInvMempoolOrder\n{\n    CTxMemPool *mp;\npublic:\n    explicit CompareInvMempoolOrder(CTxMemPool *_mempool)\n    {\n        mp = _mempool;\n    }\n\n    bool operator()(std::set<uint256>::iterator a, std::set<uint256>::iterator b)\n    {\n        /* As std::make_heap produces a max-heap, we want the entries with the\n         * fewest ancestors/highest fee to sort later. */\n        return mp->CompareDepthAndScore(*b, *a);\n    }\n};\n\nbool PeerLogicValidation::SendMessages(CNode* pto, std::atomic<bool>& interruptMsgProc)\n{\n    const Consensus::Params& consensusParams = Params().GetConsensus();\n    {\n        // Don't send anything until the version handshake is complete\n        if (!pto->fSuccessfullyConnected || pto->fDisconnect)\n            return true;\n\n        // If we get here, the outgoing message serialization version is set and can't change.\n        const CNetMsgMaker msgMaker(pto->GetSendVersion());\n\n        //\n        // Message: ping\n        //\n        bool pingSend = false;\n        if (pto->fPingQueued) {\n            // RPC ping request by user\n            pingSend = true;\n        }\n        if (pto->nPingNonceSent == 0 && pto->nPingUsecStart + PING_INTERVAL * 1000000 < GetTimeMicros()) {\n            // Ping automatically sent as a latency probe & keepalive.\n            pingSend = true;\n        }\n        if (pingSend) {\n            uint64_t nonce = 0;\n            while (nonce == 0) {\n                GetRandBytes((unsigned char*)&nonce, sizeof(nonce));\n            }\n            pto->fPingQueued = false;\n            pto->nPingUsecStart = GetTimeMicros();\n            if (pto->nVersion > BIP0031_VERSION) {\n                pto->nPingNonceSent = nonce;\n                connman->PushMessage(pto, msgMaker.Make(NetMsgType::PING, nonce));\n            } else {\n                // Peer is too old to support ping command with nonce, pong will never arrive.\n                pto->nPingNonceSent = 0;\n                connman->PushMessage(pto, msgMaker.Make(NetMsgType::PING));\n            }\n        }\n\n        TRY_LOCK(cs_main, lockMain); // Acquire cs_main for IsInitialBlockDownload() and CNodeState()\n        if (!lockMain)\n            return true;\n\n        if (SendRejectsAndCheckIfBanned(pto, connman))\n            return true;\n        CNodeState &state = *State(pto->GetId());\n\n        // Address refresh broadcast\n        int64_t nNow = GetTimeMicros();\n        if (!IsInitialBlockDownload() && pto->nNextLocalAddrSend < nNow) {\n            AdvertiseLocal(pto);\n            pto->nNextLocalAddrSend = PoissonNextSend(nNow, AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL);\n        }\n\n        //\n        // Message: addr\n        //\n        if (pto->nNextAddrSend < nNow) {\n            pto->nNextAddrSend = PoissonNextSend(nNow, AVG_ADDRESS_BROADCAST_INTERVAL);\n            std::vector<CAddress> vAddr;\n            vAddr.reserve(pto->vAddrToSend.size());\n            for (const CAddress& addr : pto->vAddrToSend)\n            {\n                if (!pto->addrKnown.contains(addr.GetKey()))\n                {\n                    pto->addrKnown.insert(addr.GetKey());\n                    vAddr.push_back(addr);\n                    // receiver rejects addr messages larger than 1000\n                    if (vAddr.size() >= 1000)\n                    {\n                        connman->PushMessage(pto, msgMaker.Make(NetMsgType::ADDR, vAddr));\n                        vAddr.clear();\n                    }\n                }\n            }\n            pto->vAddrToSend.clear();\n            if (!vAddr.empty())\n                connman->PushMessage(pto, msgMaker.Make(NetMsgType::ADDR, vAddr));\n            // we only send the big addr message once\n            if (pto->vAddrToSend.capacity() > 40)\n                pto->vAddrToSend.shrink_to_fit();\n        }\n\n        // Start block sync\n        if (pindexBestHeader == nullptr)\n            pindexBestHeader = chainActive.Tip();\n        bool fFetch = state.fPreferredDownload || (nPreferredDownload == 0 && !pto->fClient && !pto->fOneShot); // Download if this is a nice peer, or we have no nice peers and this one might do.\n        if (!state.fSyncStarted && !pto->fClient && !fImporting && !fReindex) {\n            // Only actively request headers from a single peer, unless we're close to today.\n            if ((nSyncStarted == 0 && fFetch) || pindexBestHeader->GetBlockTime() > GetAdjustedTime() - 24 * 60 * 60) {\n                state.fSyncStarted = true;\n                state.nHeadersSyncTimeout = GetTimeMicros() + HEADERS_DOWNLOAD_TIMEOUT_BASE + HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER * (GetAdjustedTime() - pindexBestHeader->GetBlockTime())/(consensusParams.nPowTargetSpacing);\n                nSyncStarted++;\n                const CBlockIndex *pindexStart = pindexBestHeader;\n                /* If possible, start at the block preceding the currently\n                   best known header.  This ensures that we always get a\n                   non-empty list of headers back as long as the peer\n                   is up-to-date.  With a non-empty response, we can initialise\n                   the peer's known best block.  This wouldn't be possible\n                   if we requested starting at pindexBestHeader and\n                   got back an empty response.  */\n                if (pindexStart->pprev)\n                    pindexStart = pindexStart->pprev;\n                LogPrint(BCLog::NET, \"initial getheaders (%d) to peer=%d (startheight:%d)\\n\", pindexStart->nHeight, pto->GetId(), pto->nStartingHeight);\n                connman->PushMessage(pto, msgMaker.Make(NetMsgType::GETHEADERS, chainActive.GetLocator(pindexStart), uint256()));\n            }\n        }\n\n        // Resend wallet transactions that haven't gotten in a block yet\n        // Except during reindex, importing and IBD, when old wallet\n        // transactions become unconfirmed and spams other nodes.\n        if (!fReindex && !fImporting && !IsInitialBlockDownload())\n        {\n            GetMainSignals().Broadcast(nTimeBestReceived, connman);\n        }\n\n        //\n        // Try sending block announcements via headers\n        //\n        {\n            // If we have less than MAX_BLOCKS_TO_ANNOUNCE in our\n            // list of block hashes we're relaying, and our peer wants\n            // headers announcements, then find the first header\n            // not yet known to our peer but would connect, and send.\n            // If no header would connect, or if we have too many\n            // blocks, or if the peer doesn't want headers, just\n            // add all to the inv queue.\n            LOCK(pto->cs_inventory);\n            std::vector<CBlock> vHeaders;\n            bool fRevertToInv = ((!state.fPreferHeaders &&\n                                 (!state.fPreferHeaderAndIDs || pto->vBlockHashesToAnnounce.size() > 1)) ||\n                                pto->vBlockHashesToAnnounce.size() > MAX_BLOCKS_TO_ANNOUNCE);\n            const CBlockIndex *pBestIndex = nullptr; // last header queued for delivery\n            ProcessBlockAvailability(pto->GetId()); // ensure pindexBestKnownBlock is up-to-date\n\n            if (!fRevertToInv) {\n                bool fFoundStartingHeader = false;\n                // Try to find first header that our peer doesn't have, and\n                // then send all headers past that one.  If we come across any\n                // headers that aren't on chainActive, give up.\n                for (const uint256 &hash : pto->vBlockHashesToAnnounce) {\n                    BlockMap::iterator mi = mapBlockIndex.find(hash);\n                    assert(mi != mapBlockIndex.end());\n                    const CBlockIndex *pindex = mi->second;\n                    if (chainActive[pindex->nHeight] != pindex) {\n                        // Bail out if we reorged away from this block\n                        fRevertToInv = true;\n                        break;\n                    }\n                    if (pBestIndex != nullptr && pindex->pprev != pBestIndex) {\n                        // This means that the list of blocks to announce don't\n                        // connect to each other.\n                        // This shouldn't really be possible to hit during\n                        // regular operation (because reorgs should take us to\n                        // a chain that has some block not on the prior chain,\n                        // which should be caught by the prior check), but one\n                        // way this could happen is by using invalidateblock /\n                        // reconsiderblock repeatedly on the tip, causing it to\n                        // be added multiple times to vBlockHashesToAnnounce.\n                        // Robustly deal with this rare situation by reverting\n                        // to an inv.\n                        fRevertToInv = true;\n                        break;\n                    }\n                    pBestIndex = pindex;\n                    if (fFoundStartingHeader) {\n                        // add this to the headers message\n                        vHeaders.push_back(pindex->GetBlockHeader());\n                    } else if (PeerHasHeader(&state, pindex)) {\n                        continue; // keep looking for the first new block\n                    } else if (pindex->pprev == nullptr || PeerHasHeader(&state, pindex->pprev)) {\n                        // Peer doesn't have this header but they do have the prior one.\n                        // Start sending headers.\n                        fFoundStartingHeader = true;\n                        vHeaders.push_back(pindex->GetBlockHeader());\n                    } else {\n                        // Peer doesn't have this header or the prior one -- nothing will\n                        // connect, so bail out.\n                        fRevertToInv = true;\n                        break;\n                    }\n                }\n            }\n            if (!fRevertToInv && !vHeaders.empty()) {\n                if (vHeaders.size() == 1 && state.fPreferHeaderAndIDs) {\n                    // We only send up to 1 block as header-and-ids, as otherwise\n                    // probably means we're doing an initial-ish-sync or they're slow\n                    LogPrint(BCLog::NET, \"%s sending header-and-ids %s to peer=%d\\n\", __func__,\n                            vHeaders.front().GetHash().ToString(), pto->GetId());\n\n                    int nSendFlags = state.fWantsCmpctWitness ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS;\n\n                    bool fGotBlockFromCache = false;\n                    {\n                        LOCK(cs_most_recent_block);\n                        if (most_recent_block_hash == pBestIndex->GetBlockHash()) {\n                            if (state.fWantsCmpctWitness || !fWitnessesPresentInMostRecentCompactBlock)\n                                connman->PushMessage(pto, msgMaker.Make(nSendFlags, NetMsgType::CMPCTBLOCK, *most_recent_compact_block));\n                            else {\n                                CBlockHeaderAndShortTxIDs cmpctblock(*most_recent_block, state.fWantsCmpctWitness);\n                                connman->PushMessage(pto, msgMaker.Make(nSendFlags, NetMsgType::CMPCTBLOCK, cmpctblock));\n                            }\n                            fGotBlockFromCache = true;\n                        }\n                    }\n                    if (!fGotBlockFromCache) {\n                        CBlock block;\n                        bool ret = ReadBlockFromDisk(block, pBestIndex, consensusParams);\n                        assert(ret);\n                        CBlockHeaderAndShortTxIDs cmpctblock(block, state.fWantsCmpctWitness);\n                        connman->PushMessage(pto, msgMaker.Make(nSendFlags, NetMsgType::CMPCTBLOCK, cmpctblock));\n                    }\n                    state.pindexBestHeaderSent = pBestIndex;\n                } else if (state.fPreferHeaders) {\n                    if (vHeaders.size() > 1) {\n                        LogPrint(BCLog::NET, \"%s: %u headers, range (%s, %s), to peer=%d\\n\", __func__,\n                                vHeaders.size(),\n                                vHeaders.front().GetHash().ToString(),\n                                vHeaders.back().GetHash().ToString(), pto->GetId());\n                    } else {\n                        LogPrint(BCLog::NET, \"%s: sending header %s to peer=%d\\n\", __func__,\n                                vHeaders.front().GetHash().ToString(), pto->GetId());\n                    }\n                    connman->PushMessage(pto, msgMaker.Make(NetMsgType::HEADERS, vHeaders));\n                    state.pindexBestHeaderSent = pBestIndex;\n                } else\n                    fRevertToInv = true;\n            }\n            if (fRevertToInv) {\n                // If falling back to using an inv, just try to inv the tip.\n                // The last entry in vBlockHashesToAnnounce was our tip at some point\n                // in the past.\n                if (!pto->vBlockHashesToAnnounce.empty()) {\n                    const uint256 &hashToAnnounce = pto->vBlockHashesToAnnounce.back();\n                    BlockMap::iterator mi = mapBlockIndex.find(hashToAnnounce);\n                    assert(mi != mapBlockIndex.end());\n                    const CBlockIndex *pindex = mi->second;\n\n                    // Warn if we're announcing a block that is not on the main chain.\n                    // This should be very rare and could be optimized out.\n                    // Just log for now.\n                    if (chainActive[pindex->nHeight] != pindex) {\n                        LogPrint(BCLog::NET, \"Announcing block %s not on main chain (tip=%s)\\n\",\n                            hashToAnnounce.ToString(), chainActive.Tip()->GetBlockHash().ToString());\n                    }\n\n                    // If the peer's chain has this block, don't inv it back.\n                    if (!PeerHasHeader(&state, pindex)) {\n                        pto->PushInventory(CInv(MSG_BLOCK, hashToAnnounce));\n                        LogPrint(BCLog::NET, \"%s: sending inv peer=%d hash=%s\\n\", __func__,\n                            pto->GetId(), hashToAnnounce.ToString());\n                    }\n                }\n            }\n            pto->vBlockHashesToAnnounce.clear();\n        }\n\n        //\n        // Message: inventory\n        //\n        std::vector<CInv> vInv;\n        {\n            LOCK(pto->cs_inventory);\n            vInv.reserve(std::max<size_t>(pto->vInventoryBlockToSend.size(), INVENTORY_BROADCAST_MAX));\n\n            // Add blocks\n            for (const uint256& hash : pto->vInventoryBlockToSend) {\n                vInv.push_back(CInv(MSG_BLOCK, hash));\n                if (vInv.size() == MAX_INV_SZ) {\n                    connman->PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));\n                    vInv.clear();\n                }\n            }\n            pto->vInventoryBlockToSend.clear();\n\n            // Check whether periodic sends should happen\n            bool fSendTrickle = pto->fWhitelisted;\n            if (pto->nNextInvSend < nNow) {\n                fSendTrickle = true;\n                // Use half the delay for outbound peers, as there is less privacy concern for them.\n                pto->nNextInvSend = PoissonNextSend(nNow, INVENTORY_BROADCAST_INTERVAL >> !pto->fInbound);\n            }\n\n            // Time to send but the peer has requested we not relay transactions.\n            if (fSendTrickle) {\n                LOCK(pto->cs_filter);\n                if (!pto->fRelayTxes) pto->setInventoryTxToSend.clear();\n            }\n\n            // Respond to BIP35 mempool requests\n            if (fSendTrickle && pto->fSendMempool) {\n                auto vtxinfo = mempool.infoAll();\n                pto->fSendMempool = false;\n                CAmount filterrate = 0;\n                {\n                    LOCK(pto->cs_feeFilter);\n                    filterrate = pto->minFeeFilter;\n                }\n\n                LOCK(pto->cs_filter);\n\n                for (const auto& txinfo : vtxinfo) {\n                    const uint256& hash = txinfo.tx->GetHash();\n                    CInv inv(MSG_TX, hash);\n                    pto->setInventoryTxToSend.erase(hash);\n                    if (filterrate) {\n                        if (txinfo.feeRate.GetFeePerK() < filterrate)\n                            continue;\n                    }\n                    if (pto->pfilter) {\n                        if (!pto->pfilter->IsRelevantAndUpdate(*txinfo.tx)) continue;\n                    }\n                    pto->filterInventoryKnown.insert(hash);\n                    vInv.push_back(inv);\n                    if (vInv.size() == MAX_INV_SZ) {\n                        connman->PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));\n                        vInv.clear();\n                    }\n                }\n                pto->timeLastMempoolReq = GetTime();\n            }\n\n            // Determine transactions to relay\n            if (fSendTrickle) {\n                // Produce a vector with all candidates for sending\n                std::vector<std::set<uint256>::iterator> vInvTx;\n                vInvTx.reserve(pto->setInventoryTxToSend.size());\n                for (std::set<uint256>::iterator it = pto->setInventoryTxToSend.begin(); it != pto->setInventoryTxToSend.end(); it++) {\n                    vInvTx.push_back(it);\n                }\n                CAmount filterrate = 0;\n                {\n                    LOCK(pto->cs_feeFilter);\n                    filterrate = pto->minFeeFilter;\n                }\n                // Topologically and fee-rate sort the inventory we send for privacy and priority reasons.\n                // A heap is used so that not all items need sorting if only a few are being sent.\n                CompareInvMempoolOrder compareInvMempoolOrder(&mempool);\n                std::make_heap(vInvTx.begin(), vInvTx.end(), compareInvMempoolOrder);\n                // No reason to drain out at many times the network's capacity,\n                // especially since we have many peers and some will draw much shorter delays.\n                unsigned int nRelayedTransactions = 0;\n                LOCK(pto->cs_filter);\n                while (!vInvTx.empty() && nRelayedTransactions < INVENTORY_BROADCAST_MAX) {\n                    // Fetch the top element from the heap\n                    std::pop_heap(vInvTx.begin(), vInvTx.end(), compareInvMempoolOrder);\n                    std::set<uint256>::iterator it = vInvTx.back();\n                    vInvTx.pop_back();\n                    uint256 hash = *it;\n                    // Remove it from the to-be-sent set\n                    pto->setInventoryTxToSend.erase(it);\n                    // Check if not in the filter already\n                    if (pto->filterInventoryKnown.contains(hash)) {\n                        continue;\n                    }\n                    // Not in the mempool anymore? don't bother sending it.\n                    auto txinfo = mempool.info(hash);\n                    if (!txinfo.tx) {\n                        continue;\n                    }\n                    if (filterrate && txinfo.feeRate.GetFeePerK() < filterrate) {\n                        continue;\n                    }\n                    if (pto->pfilter && !pto->pfilter->IsRelevantAndUpdate(*txinfo.tx)) continue;\n                    // Send\n                    vInv.push_back(CInv(MSG_TX, hash));\n                    nRelayedTransactions++;\n                    {\n                        // Expire old relay messages\n                        while (!vRelayExpiration.empty() && vRelayExpiration.front().first < nNow)\n                        {\n                            mapRelay.erase(vRelayExpiration.front().second);\n                            vRelayExpiration.pop_front();\n                        }\n\n                        auto ret = mapRelay.insert(std::make_pair(hash, std::move(txinfo.tx)));\n                        if (ret.second) {\n                            vRelayExpiration.push_back(std::make_pair(nNow + 15 * 60 * 1000000, ret.first));\n                        }\n                    }\n                    if (vInv.size() == MAX_INV_SZ) {\n                        connman->PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));\n                        vInv.clear();\n                    }\n                    pto->filterInventoryKnown.insert(hash);\n                }\n            }\n        }\n        if (!vInv.empty())\n            connman->PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv));\n\n        // Detect whether we're stalling\n        nNow = GetTimeMicros();\n        if (state.nStallingSince && state.nStallingSince < nNow - 1000000 * BLOCK_STALLING_TIMEOUT) {\n            // Stalling only triggers when the block download window cannot move. During normal steady state,\n            // the download window should be much larger than the to-be-downloaded set of blocks, so disconnection\n            // should only happen during initial block download.\n            LogPrintf(\"Peer=%d is stalling block download, disconnecting\\n\", pto->GetId());\n            pto->fDisconnect = true;\n            return true;\n        }\n        // In case there is a block that has been in flight from this peer for 2 + 0.5 * N times the block interval\n        // (with N the number of peers from which we're downloading validated blocks), disconnect due to timeout.\n        // We compensate for other peers to prevent killing off peers due to our own downstream link\n        // being saturated. We only count validated in-flight blocks so peers can't advertise non-existing block hashes\n        // to unreasonably increase our timeout.\n        if (state.vBlocksInFlight.size() > 0) {\n            QueuedBlock &queuedBlock = state.vBlocksInFlight.front();\n            int nOtherPeersWithValidatedDownloads = nPeersWithValidatedDownloads - (state.nBlocksInFlightValidHeaders > 0);\n\n            // FIXME.SUGAR // SURE?\n            // 120x faster than bitcoin\n            // (consensusParams.nPowTargetSpacing * 120) = 600 seconds = 10 minutes (BTC)\n\n            if (nNow > state.nDownloadingSince + (consensusParams.nPowTargetSpacing * 120) * (BLOCK_DOWNLOAD_TIMEOUT_BASE + BLOCK_DOWNLOAD_TIMEOUT_PER_PEER * nOtherPeersWithValidatedDownloads)) {\n                LogPrintf(\"Timeout downloading block %s from peer=%d, disconnecting\\n\", queuedBlock.hash.ToString(), pto->GetId());\n                pto->fDisconnect = true;\n                return true;\n            }\n        }\n        // Check for headers sync timeouts\n        if (state.fSyncStarted && state.nHeadersSyncTimeout < std::numeric_limits<int64_t>::max()) {\n            // Detect whether this is a stalling initial-headers-sync peer\n            if (pindexBestHeader->GetBlockTime() <= GetAdjustedTime() - 24*60*60) {\n                if (nNow > state.nHeadersSyncTimeout && nSyncStarted == 1 && (nPreferredDownload - state.fPreferredDownload >= 1)) {\n                    // Disconnect a (non-whitelisted) peer if it is our only sync peer,\n                    // and we have others we could be using instead.\n                    // Note: If all our peers are inbound, then we won't\n                    // disconnect our sync peer for stalling; we have bigger\n                    // problems if we can't get any outbound peers.\n                    if (!pto->fWhitelisted) {\n                        LogPrintf(\"Timeout downloading headers from peer=%d, disconnecting\\n\", pto->GetId());\n                        pto->fDisconnect = true;\n                        return true;\n                    } else {\n                        LogPrintf(\"Timeout downloading headers from whitelisted peer=%d, not disconnecting\\n\", pto->GetId());\n                        // Reset the headers sync state so that we have a\n                        // chance to try downloading from a different peer.\n                        // Note: this will also result in at least one more\n                        // getheaders message to be sent to\n                        // this peer (eventually).\n                        state.fSyncStarted = false;\n                        nSyncStarted--;\n                        state.nHeadersSyncTimeout = 0;\n                    }\n                }\n            } else {\n                // After we've caught up once, reset the timeout so we can't trigger\n                // disconnect later.\n                state.nHeadersSyncTimeout = std::numeric_limits<int64_t>::max();\n            }\n        }\n\n        // Check that outbound peers have reasonable chains\n        // GetTime() is used by this anti-DoS logic so we can test this using mocktime\n        ConsiderEviction(pto, GetTime());\n\n        //\n        // Message: getdata (blocks)\n        //\n        std::vector<CInv> vGetData;\n        if (!pto->fClient && (fFetch || !IsInitialBlockDownload()) && state.nBlocksInFlight < MAX_BLOCKS_IN_TRANSIT_PER_PEER) {\n            std::vector<const CBlockIndex*> vToDownload;\n            NodeId staller = -1;\n            FindNextBlocksToDownload(pto->GetId(), MAX_BLOCKS_IN_TRANSIT_PER_PEER - state.nBlocksInFlight, vToDownload, staller, consensusParams);\n            for (const CBlockIndex *pindex : vToDownload) {\n                uint32_t nFetchFlags = GetFetchFlags(pto);\n                vGetData.push_back(CInv(MSG_BLOCK | nFetchFlags, pindex->GetBlockHash()));\n                MarkBlockAsInFlight(pto->GetId(), pindex->GetBlockHash(), pindex);\n                LogPrint(BCLog::NET, \"Requesting block %s (%d) peer=%d\\n\", pindex->GetBlockHash().ToString(),\n                    pindex->nHeight, pto->GetId());\n            }\n            if (state.nBlocksInFlight == 0 && staller != -1) {\n                if (State(staller)->nStallingSince == 0) {\n                    State(staller)->nStallingSince = nNow;\n                    LogPrint(BCLog::NET, \"Stall started peer=%d\\n\", staller);\n                }\n            }\n        }\n\n        //\n        // Message: getdata (non-blocks)\n        //\n        while (!pto->mapAskFor.empty() && (*pto->mapAskFor.begin()).first <= nNow)\n        {\n            const CInv& inv = (*pto->mapAskFor.begin()).second;\n            if (!AlreadyHave(inv))\n            {\n                LogPrint(BCLog::NET, \"Requesting %s peer=%d\\n\", inv.ToString(), pto->GetId());\n                vGetData.push_back(inv);\n                if (vGetData.size() >= 1000)\n                {\n                    connman->PushMessage(pto, msgMaker.Make(NetMsgType::GETDATA, vGetData));\n                    vGetData.clear();\n                }\n            } else {\n                //If we're not going to ask, don't expect a response.\n                pto->setAskFor.erase(inv.hash);\n            }\n            pto->mapAskFor.erase(pto->mapAskFor.begin());\n        }\n        if (!vGetData.empty())\n            connman->PushMessage(pto, msgMaker.Make(NetMsgType::GETDATA, vGetData));\n\n        //\n        // Message: feefilter\n        //\n        // We don't want white listed peers to filter txs to us if we have -whitelistforcerelay\n        if (pto->nVersion >= FEEFILTER_VERSION && gArgs.GetBoolArg(\"-feefilter\", DEFAULT_FEEFILTER) &&\n            !(pto->fWhitelisted && gArgs.GetBoolArg(\"-whitelistforcerelay\", DEFAULT_WHITELISTFORCERELAY))) {\n            CAmount currentFilter = mempool.GetMinFee(gArgs.GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFeePerK();\n            int64_t timeNow = GetTimeMicros();\n            if (timeNow > pto->nextSendTimeFeeFilter) {\n                static CFeeRate default_feerate(DEFAULT_MIN_RELAY_TX_FEE);\n                static FeeFilterRounder filterRounder(default_feerate);\n                CAmount filterToSend = filterRounder.round(currentFilter);\n                // We always have a fee filter of at least minRelayTxFee\n                filterToSend = std::max(filterToSend, ::minRelayTxFee.GetFeePerK());\n                if (filterToSend != pto->lastSentFeeFilter) {\n                    connman->PushMessage(pto, msgMaker.Make(NetMsgType::FEEFILTER, filterToSend));\n                    pto->lastSentFeeFilter = filterToSend;\n                }\n                pto->nextSendTimeFeeFilter = PoissonNextSend(timeNow, AVG_FEEFILTER_BROADCAST_INTERVAL);\n            }\n            // If the fee filter has changed substantially and it's still more than MAX_FEEFILTER_CHANGE_DELAY\n            // until scheduled broadcast, then move the broadcast to within MAX_FEEFILTER_CHANGE_DELAY.\n            else if (timeNow + MAX_FEEFILTER_CHANGE_DELAY * 1000000 < pto->nextSendTimeFeeFilter &&\n                     (currentFilter < 3 * pto->lastSentFeeFilter / 4 || currentFilter > 4 * pto->lastSentFeeFilter / 3)) {\n                pto->nextSendTimeFeeFilter = timeNow + GetRandInt(MAX_FEEFILTER_CHANGE_DELAY) * 1000000;\n            }\n        }\n    }\n    return true;\n}\n\nclass CNetProcessingCleanup\n{\npublic:\n    CNetProcessingCleanup() {}\n    ~CNetProcessingCleanup() {\n        // orphan transactions\n        mapOrphanTransactions.clear();\n        mapOrphanTransactionsByPrev.clear();\n    }\n} instance_of_cnetprocessingcleanup;\n"
  },
  {
    "path": "src/net_processing.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_NET_PROCESSING_H\n#define BITCOIN_NET_PROCESSING_H\n\n#include <net.h>\n#include <validationinterface.h>\n#include <consensus/params.h>\n\n/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */\nstatic const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;\n/** Expiration time for orphan transactions in seconds */\nstatic const int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60;\n/** Minimum time between orphan transactions expire time checks in seconds */\nstatic const int64_t ORPHAN_TX_EXPIRE_INTERVAL = 5 * 60;\n/** Default number of orphan+recently-replaced txn to keep around for block reconstruction */\nstatic const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100;\n/** Headers download timeout expressed in microseconds\n *  Timeout = base + per_header * (expected number of headers) */\nstatic constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_BASE = 15 * 60 * 1000000; // 15 minutes\nstatic constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER = 1000; // 1ms/header\n/** Protect at least this many outbound peers from disconnection due to slow/\n * behind headers chain.\n */\nstatic constexpr int32_t MAX_OUTBOUND_PEERS_TO_PROTECT_FROM_DISCONNECT = 4;\n/** Timeout for (unprotected) outbound peers to sync to our chainwork, in seconds */\nstatic constexpr int64_t CHAIN_SYNC_TIMEOUT = 20 * 60; // 20 minutes\n\n// FIXME.SUGAR // SURE?\n// 120x faster than bitcoin\n/** How frequently to check for stale tips, in seconds */\n// (10 * 60 / 120) = 5\nstatic constexpr int64_t STALE_CHECK_INTERVAL = 5; // seconds // FIXME.SUGAR\n/** How frequently to check for extra outbound peers and disconnect, in seconds */\n// bitcoin:     (600 / 45) = 13.333...\n// litecoin:    (150 / 45) = 3.333...\n// sugarchain:  (5 / 3) = 1.666...\nstatic constexpr int64_t EXTRA_PEER_CHECK_INTERVAL = 3; // seconds // FIXME.SUGAR\n/** Minimum time an outbound-peer-eviction candidate must be connected for, in order to evict, in seconds */\n// (30 / 2) = 15 \nstatic constexpr int64_t MINIMUM_CONNECT_TIME = 15; // seconds // FIXME.SUGAR\n\nclass PeerLogicValidation : public CValidationInterface, public NetEventsInterface {\nprivate:\n    CConnman* const connman;\n\npublic:\n    explicit PeerLogicValidation(CConnman* connman, CScheduler &scheduler);\n\n    void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted) override;\n    void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;\n    void BlockChecked(const CBlock& block, const CValidationState& state) override;\n    void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) override;\n\n\n    void InitializeNode(CNode* pnode) override;\n    void FinalizeNode(NodeId nodeid, bool& fUpdateConnectionTime) override;\n    /** Process protocol messages received from a given node */\n    bool ProcessMessages(CNode* pfrom, std::atomic<bool>& interrupt) override;\n    /**\n    * Send queued protocol messages to be sent to a give node.\n    *\n    * @param[in]   pto             The node which we are sending messages to.\n    * @param[in]   interrupt       Interrupt condition for processing threads\n    * @return                      True if there is more work to be done\n    */\n    bool SendMessages(CNode* pto, std::atomic<bool>& interrupt) override;\n\n    void ConsiderEviction(CNode *pto, int64_t time_in_seconds);\n    void CheckForStaleTipAndEvictPeers(const Consensus::Params &consensusParams);\n    void EvictExtraOutboundPeers(int64_t time_in_seconds);\n\nprivate:\n    int64_t m_stale_tip_check_time; //! Next time to check for stale tip\n};\n\nstruct CNodeStateStats {\n    int nMisbehavior;\n    int nSyncHeight;\n    int nCommonHeight;\n    std::vector<int> vHeightInFlight;\n};\n\n/** Get statistics from node state */\nbool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats);\n/** Increase a node's misbehavior score. */\nvoid Misbehaving(NodeId nodeid, int howmuch);\n\n#endif // BITCOIN_NET_PROCESSING_H\n"
  },
  {
    "path": "src/netaddress.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <netaddress.h>\n#include <hash.h>\n#include <utilstrencodings.h>\n#include <tinyformat.h>\n\nstatic const unsigned char pchIPv4[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff };\nstatic const unsigned char pchOnionCat[] = {0xFD,0x87,0xD8,0x7E,0xEB,0x43};\n\n// 0xFD + sha256(\"bitcoin\")[0:5]\nstatic const unsigned char g_internal_prefix[] = { 0xFD, 0x6B, 0x88, 0xC0, 0x87, 0x24 };\n\nvoid CNetAddr::Init()\n{\n    memset(ip, 0, sizeof(ip));\n    scopeId = 0;\n}\n\nvoid CNetAddr::SetIP(const CNetAddr& ipIn)\n{\n    memcpy(ip, ipIn.ip, sizeof(ip));\n}\n\nvoid CNetAddr::SetRaw(Network network, const uint8_t *ip_in)\n{\n    switch(network)\n    {\n        case NET_IPV4:\n            memcpy(ip, pchIPv4, 12);\n            memcpy(ip+12, ip_in, 4);\n            break;\n        case NET_IPV6:\n            memcpy(ip, ip_in, 16);\n            break;\n        default:\n            assert(!\"invalid network\");\n    }\n}\n\nbool CNetAddr::SetInternal(const std::string &name)\n{\n    if (name.empty()) {\n        return false;\n    }\n    unsigned char hash[32] = {};\n    CSHA256().Write((const unsigned char*)name.data(), name.size()).Finalize(hash);\n    memcpy(ip, g_internal_prefix, sizeof(g_internal_prefix));\n    memcpy(ip + sizeof(g_internal_prefix), hash, sizeof(ip) - sizeof(g_internal_prefix));\n    return true;\n}\n\nbool CNetAddr::SetSpecial(const std::string &strName)\n{\n    if (strName.size()>6 && strName.substr(strName.size() - 6, 6) == \".onion\") {\n        std::vector<unsigned char> vchAddr = DecodeBase32(strName.substr(0, strName.size() - 6).c_str());\n        if (vchAddr.size() != 16-sizeof(pchOnionCat))\n            return false;\n        memcpy(ip, pchOnionCat, sizeof(pchOnionCat));\n        for (unsigned int i=0; i<16-sizeof(pchOnionCat); i++)\n            ip[i + sizeof(pchOnionCat)] = vchAddr[i];\n        return true;\n    }\n    return false;\n}\n\nCNetAddr::CNetAddr()\n{\n    Init();\n}\n\nCNetAddr::CNetAddr(const struct in_addr& ipv4Addr)\n{\n    SetRaw(NET_IPV4, (const uint8_t*)&ipv4Addr);\n}\n\nCNetAddr::CNetAddr(const struct in6_addr& ipv6Addr, const uint32_t scope)\n{\n    SetRaw(NET_IPV6, (const uint8_t*)&ipv6Addr);\n    scopeId = scope;\n}\n\nunsigned int CNetAddr::GetByte(int n) const\n{\n    return ip[15-n];\n}\n\nbool CNetAddr::IsIPv4() const\n{\n    return (memcmp(ip, pchIPv4, sizeof(pchIPv4)) == 0);\n}\n\nbool CNetAddr::IsIPv6() const\n{\n    return (!IsIPv4() && !IsTor() && !IsInternal());\n}\n\nbool CNetAddr::IsRFC1918() const\n{\n    return IsIPv4() && (\n        GetByte(3) == 10 ||\n        (GetByte(3) == 192 && GetByte(2) == 168) ||\n        (GetByte(3) == 172 && (GetByte(2) >= 16 && GetByte(2) <= 31)));\n}\n\nbool CNetAddr::IsRFC2544() const\n{\n    return IsIPv4() && GetByte(3) == 198 && (GetByte(2) == 18 || GetByte(2) == 19);\n}\n\nbool CNetAddr::IsRFC3927() const\n{\n    return IsIPv4() && (GetByte(3) == 169 && GetByte(2) == 254);\n}\n\nbool CNetAddr::IsRFC6598() const\n{\n    return IsIPv4() && GetByte(3) == 100 && GetByte(2) >= 64 && GetByte(2) <= 127;\n}\n\nbool CNetAddr::IsRFC5737() const\n{\n    return IsIPv4() && ((GetByte(3) == 192 && GetByte(2) == 0 && GetByte(1) == 2) ||\n        (GetByte(3) == 198 && GetByte(2) == 51 && GetByte(1) == 100) ||\n        (GetByte(3) == 203 && GetByte(2) == 0 && GetByte(1) == 113));\n}\n\nbool CNetAddr::IsRFC3849() const\n{\n    return GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x0D && GetByte(12) == 0xB8;\n}\n\nbool CNetAddr::IsRFC3964() const\n{\n    return (GetByte(15) == 0x20 && GetByte(14) == 0x02);\n}\n\nbool CNetAddr::IsRFC6052() const\n{\n    static const unsigned char pchRFC6052[] = {0,0x64,0xFF,0x9B,0,0,0,0,0,0,0,0};\n    return (memcmp(ip, pchRFC6052, sizeof(pchRFC6052)) == 0);\n}\n\nbool CNetAddr::IsRFC4380() const\n{\n    return (GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0 && GetByte(12) == 0);\n}\n\nbool CNetAddr::IsRFC4862() const\n{\n    static const unsigned char pchRFC4862[] = {0xFE,0x80,0,0,0,0,0,0};\n    return (memcmp(ip, pchRFC4862, sizeof(pchRFC4862)) == 0);\n}\n\nbool CNetAddr::IsRFC4193() const\n{\n    return ((GetByte(15) & 0xFE) == 0xFC);\n}\n\nbool CNetAddr::IsRFC6145() const\n{\n    static const unsigned char pchRFC6145[] = {0,0,0,0,0,0,0,0,0xFF,0xFF,0,0};\n    return (memcmp(ip, pchRFC6145, sizeof(pchRFC6145)) == 0);\n}\n\nbool CNetAddr::IsRFC4843() const\n{\n    return (GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x00 && (GetByte(12) & 0xF0) == 0x10);\n}\n\nbool CNetAddr::IsTor() const\n{\n    return (memcmp(ip, pchOnionCat, sizeof(pchOnionCat)) == 0);\n}\n\nbool CNetAddr::IsLocal() const\n{\n    // IPv4 loopback\n   if (IsIPv4() && (GetByte(3) == 127 || GetByte(3) == 0))\n       return true;\n\n   // IPv6 loopback (::1/128)\n   static const unsigned char pchLocal[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};\n   if (memcmp(ip, pchLocal, 16) == 0)\n       return true;\n\n   return false;\n}\n\nbool CNetAddr::IsValid() const\n{\n    // Cleanup 3-byte shifted addresses caused by garbage in size field\n    // of addr messages from versions before 0.2.9 checksum.\n    // Two consecutive addr messages look like this:\n    // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26...\n    // so if the first length field is garbled, it reads the second batch\n    // of addr misaligned by 3 bytes.\n    if (memcmp(ip, pchIPv4+3, sizeof(pchIPv4)-3) == 0)\n        return false;\n\n    // unspecified IPv6 address (::/128)\n    unsigned char ipNone6[16] = {};\n    if (memcmp(ip, ipNone6, 16) == 0)\n        return false;\n\n    // documentation IPv6 address\n    if (IsRFC3849())\n        return false;\n\n    if (IsInternal())\n        return false;\n\n    if (IsIPv4())\n    {\n        // INADDR_NONE\n        uint32_t ipNone = INADDR_NONE;\n        if (memcmp(ip+12, &ipNone, 4) == 0)\n            return false;\n\n        // 0\n        ipNone = 0;\n        if (memcmp(ip+12, &ipNone, 4) == 0)\n            return false;\n    }\n\n    return true;\n}\n\nbool CNetAddr::IsRoutable() const\n{\n    return IsValid() && !(IsRFC1918() || IsRFC2544() || IsRFC3927() || IsRFC4862() || IsRFC6598() || IsRFC5737() || (IsRFC4193() && !IsTor()) || IsRFC4843() || IsLocal() || IsInternal());\n}\n\nbool CNetAddr::IsInternal() const\n{\n   return memcmp(ip, g_internal_prefix, sizeof(g_internal_prefix)) == 0;\n}\n\nenum Network CNetAddr::GetNetwork() const\n{\n    if (IsInternal())\n        return NET_INTERNAL;\n\n    if (!IsRoutable())\n        return NET_UNROUTABLE;\n\n    if (IsIPv4())\n        return NET_IPV4;\n\n    if (IsTor())\n        return NET_TOR;\n\n    return NET_IPV6;\n}\n\nstd::string CNetAddr::ToStringIP() const\n{\n    if (IsTor())\n        return EncodeBase32(&ip[6], 10) + \".onion\";\n    if (IsInternal())\n        return EncodeBase32(ip + sizeof(g_internal_prefix), sizeof(ip) - sizeof(g_internal_prefix)) + \".internal\";\n    CService serv(*this, 0);\n    struct sockaddr_storage sockaddr;\n    socklen_t socklen = sizeof(sockaddr);\n    if (serv.GetSockAddr((struct sockaddr*)&sockaddr, &socklen)) {\n        char name[1025] = \"\";\n        if (!getnameinfo((const struct sockaddr*)&sockaddr, socklen, name, sizeof(name), nullptr, 0, NI_NUMERICHOST))\n            return std::string(name);\n    }\n    if (IsIPv4())\n        return strprintf(\"%u.%u.%u.%u\", GetByte(3), GetByte(2), GetByte(1), GetByte(0));\n    else\n        return strprintf(\"%x:%x:%x:%x:%x:%x:%x:%x\",\n                         GetByte(15) << 8 | GetByte(14), GetByte(13) << 8 | GetByte(12),\n                         GetByte(11) << 8 | GetByte(10), GetByte(9) << 8 | GetByte(8),\n                         GetByte(7) << 8 | GetByte(6), GetByte(5) << 8 | GetByte(4),\n                         GetByte(3) << 8 | GetByte(2), GetByte(1) << 8 | GetByte(0));\n}\n\nstd::string CNetAddr::ToString() const\n{\n    return ToStringIP();\n}\n\nbool operator==(const CNetAddr& a, const CNetAddr& b)\n{\n    return (memcmp(a.ip, b.ip, 16) == 0);\n}\n\nbool operator!=(const CNetAddr& a, const CNetAddr& b)\n{\n    return (memcmp(a.ip, b.ip, 16) != 0);\n}\n\nbool operator<(const CNetAddr& a, const CNetAddr& b)\n{\n    return (memcmp(a.ip, b.ip, 16) < 0);\n}\n\nbool CNetAddr::GetInAddr(struct in_addr* pipv4Addr) const\n{\n    if (!IsIPv4())\n        return false;\n    memcpy(pipv4Addr, ip+12, 4);\n    return true;\n}\n\nbool CNetAddr::GetIn6Addr(struct in6_addr* pipv6Addr) const\n{\n    memcpy(pipv6Addr, ip, 16);\n    return true;\n}\n\n// get canonical identifier of an address' group\n// no two connections will be attempted to addresses with the same group\nstd::vector<unsigned char> CNetAddr::GetGroup() const\n{\n    std::vector<unsigned char> vchRet;\n    int nClass = NET_IPV6;\n    int nStartByte = 0;\n    int nBits = 16;\n\n    // all local addresses belong to the same group\n    if (IsLocal())\n    {\n        nClass = 255;\n        nBits = 0;\n    }\n    // all internal-usage addresses get their own group\n    if (IsInternal())\n    {\n        nClass = NET_INTERNAL;\n        nStartByte = sizeof(g_internal_prefix);\n        nBits = (sizeof(ip) - sizeof(g_internal_prefix)) * 8;\n    }\n    // all other unroutable addresses belong to the same group\n    else if (!IsRoutable())\n    {\n        nClass = NET_UNROUTABLE;\n        nBits = 0;\n    }\n    // for IPv4 addresses, '1' + the 16 higher-order bits of the IP\n    // includes mapped IPv4, SIIT translated IPv4, and the well-known prefix\n    else if (IsIPv4() || IsRFC6145() || IsRFC6052())\n    {\n        nClass = NET_IPV4;\n        nStartByte = 12;\n    }\n    // for 6to4 tunnelled addresses, use the encapsulated IPv4 address\n    else if (IsRFC3964())\n    {\n        nClass = NET_IPV4;\n        nStartByte = 2;\n    }\n    // for Teredo-tunnelled IPv6 addresses, use the encapsulated IPv4 address\n    else if (IsRFC4380())\n    {\n        vchRet.push_back(NET_IPV4);\n        vchRet.push_back(GetByte(3) ^ 0xFF);\n        vchRet.push_back(GetByte(2) ^ 0xFF);\n        return vchRet;\n    }\n    else if (IsTor())\n    {\n        nClass = NET_TOR;\n        nStartByte = 6;\n        nBits = 4;\n    }\n    // for he.net, use /36 groups\n    else if (GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x04 && GetByte(12) == 0x70)\n        nBits = 36;\n    // for the rest of the IPv6 network, use /32 groups\n    else\n        nBits = 32;\n\n    vchRet.push_back(nClass);\n    while (nBits >= 8)\n    {\n        vchRet.push_back(GetByte(15 - nStartByte));\n        nStartByte++;\n        nBits -= 8;\n    }\n    if (nBits > 0)\n        vchRet.push_back(GetByte(15 - nStartByte) | ((1 << (8 - nBits)) - 1));\n\n    return vchRet;\n}\n\nuint64_t CNetAddr::GetHash() const\n{\n    uint256 hash = Hash(&ip[0], &ip[16]);\n    uint64_t nRet;\n    memcpy(&nRet, &hash, sizeof(nRet));\n    return nRet;\n}\n\n// private extensions to enum Network, only returned by GetExtNetwork,\n// and only used in GetReachabilityFrom\nstatic const int NET_UNKNOWN = NET_MAX + 0;\nstatic const int NET_TEREDO  = NET_MAX + 1;\nint static GetExtNetwork(const CNetAddr *addr)\n{\n    if (addr == nullptr)\n        return NET_UNKNOWN;\n    if (addr->IsRFC4380())\n        return NET_TEREDO;\n    return addr->GetNetwork();\n}\n\n/** Calculates a metric for how reachable (*this) is from a given partner */\nint CNetAddr::GetReachabilityFrom(const CNetAddr *paddrPartner) const\n{\n    enum Reachability {\n        REACH_UNREACHABLE,\n        REACH_DEFAULT,\n        REACH_TEREDO,\n        REACH_IPV6_WEAK,\n        REACH_IPV4,\n        REACH_IPV6_STRONG,\n        REACH_PRIVATE\n    };\n\n    if (!IsRoutable() || IsInternal())\n        return REACH_UNREACHABLE;\n\n    int ourNet = GetExtNetwork(this);\n    int theirNet = GetExtNetwork(paddrPartner);\n    bool fTunnel = IsRFC3964() || IsRFC6052() || IsRFC6145();\n\n    switch(theirNet) {\n    case NET_IPV4:\n        switch(ourNet) {\n        default:       return REACH_DEFAULT;\n        case NET_IPV4: return REACH_IPV4;\n        }\n    case NET_IPV6:\n        switch(ourNet) {\n        default:         return REACH_DEFAULT;\n        case NET_TEREDO: return REACH_TEREDO;\n        case NET_IPV4:   return REACH_IPV4;\n        case NET_IPV6:   return fTunnel ? REACH_IPV6_WEAK : REACH_IPV6_STRONG; // only prefer giving our IPv6 address if it's not tunnelled\n        }\n    case NET_TOR:\n        switch(ourNet) {\n        default:         return REACH_DEFAULT;\n        case NET_IPV4:   return REACH_IPV4; // Tor users can connect to IPv4 as well\n        case NET_TOR:    return REACH_PRIVATE;\n        }\n    case NET_TEREDO:\n        switch(ourNet) {\n        default:          return REACH_DEFAULT;\n        case NET_TEREDO:  return REACH_TEREDO;\n        case NET_IPV6:    return REACH_IPV6_WEAK;\n        case NET_IPV4:    return REACH_IPV4;\n        }\n    case NET_UNKNOWN:\n    case NET_UNROUTABLE:\n    default:\n        switch(ourNet) {\n        default:          return REACH_DEFAULT;\n        case NET_TEREDO:  return REACH_TEREDO;\n        case NET_IPV6:    return REACH_IPV6_WEAK;\n        case NET_IPV4:    return REACH_IPV4;\n        case NET_TOR:     return REACH_PRIVATE; // either from Tor, or don't care about our address\n        }\n    }\n}\n\nvoid CService::Init()\n{\n    port = 0;\n}\n\nCService::CService()\n{\n    Init();\n}\n\nCService::CService(const CNetAddr& cip, unsigned short portIn) : CNetAddr(cip), port(portIn)\n{\n}\n\nCService::CService(const struct in_addr& ipv4Addr, unsigned short portIn) : CNetAddr(ipv4Addr), port(portIn)\n{\n}\n\nCService::CService(const struct in6_addr& ipv6Addr, unsigned short portIn) : CNetAddr(ipv6Addr), port(portIn)\n{\n}\n\nCService::CService(const struct sockaddr_in& addr) : CNetAddr(addr.sin_addr), port(ntohs(addr.sin_port))\n{\n    assert(addr.sin_family == AF_INET);\n}\n\nCService::CService(const struct sockaddr_in6 &addr) : CNetAddr(addr.sin6_addr, addr.sin6_scope_id), port(ntohs(addr.sin6_port))\n{\n   assert(addr.sin6_family == AF_INET6);\n}\n\nbool CService::SetSockAddr(const struct sockaddr *paddr)\n{\n    switch (paddr->sa_family) {\n    case AF_INET:\n        *this = CService(*(const struct sockaddr_in*)paddr);\n        return true;\n    case AF_INET6:\n        *this = CService(*(const struct sockaddr_in6*)paddr);\n        return true;\n    default:\n        return false;\n    }\n}\n\nunsigned short CService::GetPort() const\n{\n    return port;\n}\n\nbool operator==(const CService& a, const CService& b)\n{\n    return (CNetAddr)a == (CNetAddr)b && a.port == b.port;\n}\n\nbool operator!=(const CService& a, const CService& b)\n{\n    return (CNetAddr)a != (CNetAddr)b || a.port != b.port;\n}\n\nbool operator<(const CService& a, const CService& b)\n{\n    return (CNetAddr)a < (CNetAddr)b || ((CNetAddr)a == (CNetAddr)b && a.port < b.port);\n}\n\nbool CService::GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const\n{\n    if (IsIPv4()) {\n        if (*addrlen < (socklen_t)sizeof(struct sockaddr_in))\n            return false;\n        *addrlen = sizeof(struct sockaddr_in);\n        struct sockaddr_in *paddrin = (struct sockaddr_in*)paddr;\n        memset(paddrin, 0, *addrlen);\n        if (!GetInAddr(&paddrin->sin_addr))\n            return false;\n        paddrin->sin_family = AF_INET;\n        paddrin->sin_port = htons(port);\n        return true;\n    }\n    if (IsIPv6()) {\n        if (*addrlen < (socklen_t)sizeof(struct sockaddr_in6))\n            return false;\n        *addrlen = sizeof(struct sockaddr_in6);\n        struct sockaddr_in6 *paddrin6 = (struct sockaddr_in6*)paddr;\n        memset(paddrin6, 0, *addrlen);\n        if (!GetIn6Addr(&paddrin6->sin6_addr))\n            return false;\n        paddrin6->sin6_scope_id = scopeId;\n        paddrin6->sin6_family = AF_INET6;\n        paddrin6->sin6_port = htons(port);\n        return true;\n    }\n    return false;\n}\n\nstd::vector<unsigned char> CService::GetKey() const\n{\n     std::vector<unsigned char> vKey;\n     vKey.resize(18);\n     memcpy(vKey.data(), ip, 16);\n     vKey[16] = port / 0x100;\n     vKey[17] = port & 0x0FF;\n     return vKey;\n}\n\nstd::string CService::ToStringPort() const\n{\n    return strprintf(\"%u\", port);\n}\n\nstd::string CService::ToStringIPPort() const\n{\n    if (IsIPv4() || IsTor() || IsInternal()) {\n        return ToStringIP() + \":\" + ToStringPort();\n    } else {\n        return \"[\" + ToStringIP() + \"]:\" + ToStringPort();\n    }\n}\n\nstd::string CService::ToString() const\n{\n    return ToStringIPPort();\n}\n\nCSubNet::CSubNet():\n    valid(false)\n{\n    memset(netmask, 0, sizeof(netmask));\n}\n\nCSubNet::CSubNet(const CNetAddr &addr, int32_t mask)\n{\n    valid = true;\n    network = addr;\n    // Default to /32 (IPv4) or /128 (IPv6), i.e. match single address\n    memset(netmask, 255, sizeof(netmask));\n\n    // IPv4 addresses start at offset 12, and first 12 bytes must match, so just offset n\n    const int astartofs = network.IsIPv4() ? 12 : 0;\n\n    int32_t n = mask;\n    if(n >= 0 && n <= (128 - astartofs*8)) // Only valid if in range of bits of address\n    {\n        n += astartofs*8;\n        // Clear bits [n..127]\n        for (; n < 128; ++n)\n            netmask[n>>3] &= ~(1<<(7-(n&7)));\n    } else\n        valid = false;\n\n    // Normalize network according to netmask\n    for(int x=0; x<16; ++x)\n        network.ip[x] &= netmask[x];\n}\n\nCSubNet::CSubNet(const CNetAddr &addr, const CNetAddr &mask)\n{\n    valid = true;\n    network = addr;\n    // Default to /32 (IPv4) or /128 (IPv6), i.e. match single address\n    memset(netmask, 255, sizeof(netmask));\n\n    // IPv4 addresses start at offset 12, and first 12 bytes must match, so just offset n\n    const int astartofs = network.IsIPv4() ? 12 : 0;\n\n    for(int x=astartofs; x<16; ++x)\n        netmask[x] = mask.ip[x];\n\n    // Normalize network according to netmask\n    for(int x=0; x<16; ++x)\n        network.ip[x] &= netmask[x];\n}\n\nCSubNet::CSubNet(const CNetAddr &addr):\n    valid(addr.IsValid())\n{\n    memset(netmask, 255, sizeof(netmask));\n    network = addr;\n}\n\nbool CSubNet::Match(const CNetAddr &addr) const\n{\n    if (!valid || !addr.IsValid())\n        return false;\n    for(int x=0; x<16; ++x)\n        if ((addr.ip[x] & netmask[x]) != network.ip[x])\n            return false;\n    return true;\n}\n\nstatic inline int NetmaskBits(uint8_t x)\n{\n    switch(x) {\n    case 0x00: return 0; break;\n    case 0x80: return 1; break;\n    case 0xc0: return 2; break;\n    case 0xe0: return 3; break;\n    case 0xf0: return 4; break;\n    case 0xf8: return 5; break;\n    case 0xfc: return 6; break;\n    case 0xfe: return 7; break;\n    case 0xff: return 8; break;\n    default: return -1; break;\n    }\n}\n\nstd::string CSubNet::ToString() const\n{\n    /* Parse binary 1{n}0{N-n} to see if mask can be represented as /n */\n    int cidr = 0;\n    bool valid_cidr = true;\n    int n = network.IsIPv4() ? 12 : 0;\n    for (; n < 16 && netmask[n] == 0xff; ++n)\n        cidr += 8;\n    if (n < 16) {\n        int bits = NetmaskBits(netmask[n]);\n        if (bits < 0)\n            valid_cidr = false;\n        else\n            cidr += bits;\n        ++n;\n    }\n    for (; n < 16 && valid_cidr; ++n)\n        if (netmask[n] != 0x00)\n            valid_cidr = false;\n\n    /* Format output */\n    std::string strNetmask;\n    if (valid_cidr) {\n        strNetmask = strprintf(\"%u\", cidr);\n    } else {\n        if (network.IsIPv4())\n            strNetmask = strprintf(\"%u.%u.%u.%u\", netmask[12], netmask[13], netmask[14], netmask[15]);\n        else\n            strNetmask = strprintf(\"%x:%x:%x:%x:%x:%x:%x:%x\",\n                             netmask[0] << 8 | netmask[1], netmask[2] << 8 | netmask[3],\n                             netmask[4] << 8 | netmask[5], netmask[6] << 8 | netmask[7],\n                             netmask[8] << 8 | netmask[9], netmask[10] << 8 | netmask[11],\n                             netmask[12] << 8 | netmask[13], netmask[14] << 8 | netmask[15]);\n    }\n\n    return network.ToString() + \"/\" + strNetmask;\n}\n\nbool CSubNet::IsValid() const\n{\n    return valid;\n}\n\nbool operator==(const CSubNet& a, const CSubNet& b)\n{\n    return a.valid == b.valid && a.network == b.network && !memcmp(a.netmask, b.netmask, 16);\n}\n\nbool operator!=(const CSubNet& a, const CSubNet& b)\n{\n    return !(a==b);\n}\n\nbool operator<(const CSubNet& a, const CSubNet& b)\n{\n    return (a.network < b.network || (a.network == b.network && memcmp(a.netmask, b.netmask, 16) < 0));\n}\n"
  },
  {
    "path": "src/netaddress.h",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_NETADDRESS_H\n#define BITCOIN_NETADDRESS_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <compat.h>\n#include <serialize.h>\n\n#include <stdint.h>\n#include <string>\n#include <vector>\n\nenum Network\n{\n    NET_UNROUTABLE = 0,\n    NET_IPV4,\n    NET_IPV6,\n    NET_TOR,\n    NET_INTERNAL,\n\n    NET_MAX,\n};\n\n/** IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96)) */\nclass CNetAddr\n{\n    protected:\n        unsigned char ip[16]; // in network byte order\n        uint32_t scopeId; // for scoped/link-local ipv6 addresses\n\n    public:\n        CNetAddr();\n        explicit CNetAddr(const struct in_addr& ipv4Addr);\n        void Init();\n        void SetIP(const CNetAddr& ip);\n\n        /**\n         * Set raw IPv4 or IPv6 address (in network byte order)\n         * @note Only NET_IPV4 and NET_IPV6 are allowed for network.\n         */\n        void SetRaw(Network network, const uint8_t *data);\n\n        /**\n          * Transform an arbitrary string into a non-routable ipv6 address.\n          * Useful for mapping resolved addresses back to their source.\n         */\n        bool SetInternal(const std::string& name);\n\n        bool SetSpecial(const std::string &strName); // for Tor addresses\n        bool IsIPv4() const;    // IPv4 mapped address (::FFFF:0:0/96, 0.0.0.0/0)\n        bool IsIPv6() const;    // IPv6 address (not mapped IPv4, not Tor)\n        bool IsRFC1918() const; // IPv4 private networks (10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12)\n        bool IsRFC2544() const; // IPv4 inter-network communications (192.18.0.0/15)\n        bool IsRFC6598() const; // IPv4 ISP-level NAT (100.64.0.0/10)\n        bool IsRFC5737() const; // IPv4 documentation addresses (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24)\n        bool IsRFC3849() const; // IPv6 documentation address (2001:0DB8::/32)\n        bool IsRFC3927() const; // IPv4 autoconfig (169.254.0.0/16)\n        bool IsRFC3964() const; // IPv6 6to4 tunnelling (2002::/16)\n        bool IsRFC4193() const; // IPv6 unique local (FC00::/7)\n        bool IsRFC4380() const; // IPv6 Teredo tunnelling (2001::/32)\n        bool IsRFC4843() const; // IPv6 ORCHID (2001:10::/28)\n        bool IsRFC4862() const; // IPv6 autoconfig (FE80::/64)\n        bool IsRFC6052() const; // IPv6 well-known prefix (64:FF9B::/96)\n        bool IsRFC6145() const; // IPv6 IPv4-translated address (::FFFF:0:0:0/96)\n        bool IsTor() const;\n        bool IsLocal() const;\n        bool IsRoutable() const;\n        bool IsInternal() const;\n        bool IsValid() const;\n        enum Network GetNetwork() const;\n        std::string ToString() const;\n        std::string ToStringIP() const;\n        unsigned int GetByte(int n) const;\n        uint64_t GetHash() const;\n        bool GetInAddr(struct in_addr* pipv4Addr) const;\n        std::vector<unsigned char> GetGroup() const;\n        int GetReachabilityFrom(const CNetAddr *paddrPartner = nullptr) const;\n\n        explicit CNetAddr(const struct in6_addr& pipv6Addr, const uint32_t scope = 0);\n        bool GetIn6Addr(struct in6_addr* pipv6Addr) const;\n\n        friend bool operator==(const CNetAddr& a, const CNetAddr& b);\n        friend bool operator!=(const CNetAddr& a, const CNetAddr& b);\n        friend bool operator<(const CNetAddr& a, const CNetAddr& b);\n\n        ADD_SERIALIZE_METHODS;\n\n        template <typename Stream, typename Operation>\n        inline void SerializationOp(Stream& s, Operation ser_action) {\n            READWRITE(FLATDATA(ip));\n        }\n\n        friend class CSubNet;\n};\n\nclass CSubNet\n{\n    protected:\n        /// Network (base) address\n        CNetAddr network;\n        /// Netmask, in network byte order\n        uint8_t netmask[16];\n        /// Is this value valid? (only used to signal parse errors)\n        bool valid;\n\n    public:\n        CSubNet();\n        CSubNet(const CNetAddr &addr, int32_t mask);\n        CSubNet(const CNetAddr &addr, const CNetAddr &mask);\n\n        //constructor for single ip subnet (<ipv4>/32 or <ipv6>/128)\n        explicit CSubNet(const CNetAddr &addr);\n\n        bool Match(const CNetAddr &addr) const;\n\n        std::string ToString() const;\n        bool IsValid() const;\n\n        friend bool operator==(const CSubNet& a, const CSubNet& b);\n        friend bool operator!=(const CSubNet& a, const CSubNet& b);\n        friend bool operator<(const CSubNet& a, const CSubNet& b);\n\n        ADD_SERIALIZE_METHODS;\n\n        template <typename Stream, typename Operation>\n        inline void SerializationOp(Stream& s, Operation ser_action) {\n            READWRITE(network);\n            READWRITE(FLATDATA(netmask));\n            READWRITE(FLATDATA(valid));\n        }\n};\n\n/** A combination of a network address (CNetAddr) and a (TCP) port */\nclass CService : public CNetAddr\n{\n    protected:\n        unsigned short port; // host order\n\n    public:\n        CService();\n        CService(const CNetAddr& ip, unsigned short port);\n        CService(const struct in_addr& ipv4Addr, unsigned short port);\n        explicit CService(const struct sockaddr_in& addr);\n        void Init();\n        unsigned short GetPort() const;\n        bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const;\n        bool SetSockAddr(const struct sockaddr* paddr);\n        friend bool operator==(const CService& a, const CService& b);\n        friend bool operator!=(const CService& a, const CService& b);\n        friend bool operator<(const CService& a, const CService& b);\n        std::vector<unsigned char> GetKey() const;\n        std::string ToString() const;\n        std::string ToStringPort() const;\n        std::string ToStringIPPort() const;\n\n        CService(const struct in6_addr& ipv6Addr, unsigned short port);\n        explicit CService(const struct sockaddr_in6& addr);\n\n        ADD_SERIALIZE_METHODS;\n\n        template <typename Stream, typename Operation>\n        inline void SerializationOp(Stream& s, Operation ser_action) {\n            READWRITE(FLATDATA(ip));\n            unsigned short portN = htons(port);\n            READWRITE(FLATDATA(portN));\n            if (ser_action.ForRead())\n                 port = ntohs(portN);\n        }\n};\n\n#endif // BITCOIN_NETADDRESS_H\n"
  },
  {
    "path": "src/netbase.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <netbase.h>\n\n#include <hash.h>\n#include <sync.h>\n#include <uint256.h>\n#include <random.h>\n#include <util.h>\n#include <utilstrencodings.h>\n\n#include <atomic>\n\n#ifndef WIN32\n#include <fcntl.h>\n#endif\n\n#include <boost/algorithm/string/case_conv.hpp> // for to_lower()\n#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()\n\n#include <validation.h> // FIXME.SUGAR // IBD: for IsInitialBlockDownload()\n\n#if !defined(HAVE_MSG_NOSIGNAL)\n#define MSG_NOSIGNAL 0\n#endif\n\n// Settings\nstatic proxyType proxyInfo[NET_MAX];\nstatic proxyType nameProxy;\nstatic CCriticalSection cs_proxyInfos;\nint nConnectTimeout = DEFAULT_CONNECT_TIMEOUT;\nbool fNameLookup = DEFAULT_NAME_LOOKUP;\n\n// Need ample time for negotiation for very slow proxies such as Tor (milliseconds)\nstatic const int SOCKS5_RECV_TIMEOUT = 20 * 1000;\nstatic std::atomic<bool> interruptSocks5Recv(false);\n\nenum Network ParseNetwork(std::string net) {\n    boost::to_lower(net);\n    if (net == \"ipv4\") return NET_IPV4;\n    if (net == \"ipv6\") return NET_IPV6;\n    if (net == \"tor\" || net == \"onion\")  return NET_TOR;\n    return NET_UNROUTABLE;\n}\n\nstd::string GetNetworkName(enum Network net) {\n    switch(net)\n    {\n    case NET_IPV4: return \"ipv4\";\n    case NET_IPV6: return \"ipv6\";\n    case NET_TOR: return \"onion\";\n    default: return \"\";\n    }\n}\n\nbool static LookupIntern(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup)\n{\n    vIP.clear();\n\n    {\n        CNetAddr addr;\n        if (addr.SetSpecial(std::string(pszName))) {\n            vIP.push_back(addr);\n            return true;\n        }\n    }\n\n    struct addrinfo aiHint;\n    memset(&aiHint, 0, sizeof(struct addrinfo));\n\n    aiHint.ai_socktype = SOCK_STREAM;\n    aiHint.ai_protocol = IPPROTO_TCP;\n    aiHint.ai_family = AF_UNSPEC;\n#ifdef WIN32\n    aiHint.ai_flags = fAllowLookup ? 0 : AI_NUMERICHOST;\n#else\n    aiHint.ai_flags = fAllowLookup ? AI_ADDRCONFIG : AI_NUMERICHOST;\n#endif\n    struct addrinfo *aiRes = nullptr;\n    int nErr = getaddrinfo(pszName, nullptr, &aiHint, &aiRes);\n    if (nErr)\n        return false;\n\n    struct addrinfo *aiTrav = aiRes;\n    while (aiTrav != nullptr && (nMaxSolutions == 0 || vIP.size() < nMaxSolutions))\n    {\n        CNetAddr resolved;\n        if (aiTrav->ai_family == AF_INET)\n        {\n            assert(aiTrav->ai_addrlen >= sizeof(sockaddr_in));\n            resolved = CNetAddr(((struct sockaddr_in*)(aiTrav->ai_addr))->sin_addr);\n        }\n\n        if (aiTrav->ai_family == AF_INET6)\n        {\n            assert(aiTrav->ai_addrlen >= sizeof(sockaddr_in6));\n            struct sockaddr_in6* s6 = (struct sockaddr_in6*) aiTrav->ai_addr;\n            resolved = CNetAddr(s6->sin6_addr, s6->sin6_scope_id);\n        }\n        /* Never allow resolving to an internal address. Consider any such result invalid */\n        if (!resolved.IsInternal()) {\n            vIP.push_back(resolved);\n        }\n\n        aiTrav = aiTrav->ai_next;\n    }\n\n    freeaddrinfo(aiRes);\n\n    return (vIP.size() > 0);\n}\n\nbool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup)\n{\n    std::string strHost(pszName);\n    if (strHost.empty())\n        return false;\n    if (boost::algorithm::starts_with(strHost, \"[\") && boost::algorithm::ends_with(strHost, \"]\"))\n    {\n        strHost = strHost.substr(1, strHost.size() - 2);\n    }\n\n    return LookupIntern(strHost.c_str(), vIP, nMaxSolutions, fAllowLookup);\n}\n\nbool LookupHost(const char *pszName, CNetAddr& addr, bool fAllowLookup)\n{\n    std::vector<CNetAddr> vIP;\n    LookupHost(pszName, vIP, 1, fAllowLookup);\n    if(vIP.empty())\n        return false;\n    addr = vIP.front();\n    return true;\n}\n\nbool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault, bool fAllowLookup, unsigned int nMaxSolutions)\n{\n    if (pszName[0] == 0)\n        return false;\n    int port = portDefault;\n    std::string hostname = \"\";\n    SplitHostPort(std::string(pszName), port, hostname);\n\n    std::vector<CNetAddr> vIP;\n    bool fRet = LookupIntern(hostname.c_str(), vIP, nMaxSolutions, fAllowLookup);\n    if (!fRet)\n        return false;\n    vAddr.resize(vIP.size());\n    for (unsigned int i = 0; i < vIP.size(); i++)\n        vAddr[i] = CService(vIP[i], port);\n    return true;\n}\n\nbool Lookup(const char *pszName, CService& addr, int portDefault, bool fAllowLookup)\n{\n    std::vector<CService> vService;\n    bool fRet = Lookup(pszName, vService, portDefault, fAllowLookup, 1);\n    if (!fRet)\n        return false;\n    addr = vService[0];\n    return true;\n}\n\nCService LookupNumeric(const char *pszName, int portDefault)\n{\n    CService addr;\n    // \"1.2:345\" will fail to resolve the ip, but will still set the port.\n    // If the ip fails to resolve, re-init the result.\n    if(!Lookup(pszName, addr, portDefault, false))\n        addr = CService();\n    return addr;\n}\n\nstruct timeval MillisToTimeval(int64_t nTimeout)\n{\n    struct timeval timeout;\n    timeout.tv_sec  = nTimeout / 1000;\n    timeout.tv_usec = (nTimeout % 1000) * 1000;\n    return timeout;\n}\n\n/** SOCKS version */\nenum SOCKSVersion: uint8_t {\n    SOCKS4 = 0x04,\n    SOCKS5 = 0x05\n};\n\n/** Values defined for METHOD in RFC1928 */\nenum SOCKS5Method: uint8_t {\n    NOAUTH = 0x00,        //! No authentication required\n    GSSAPI = 0x01,        //! GSSAPI\n    USER_PASS = 0x02,     //! Username/password\n    NO_ACCEPTABLE = 0xff, //! No acceptable methods\n};\n\n/** Values defined for CMD in RFC1928 */\nenum SOCKS5Command: uint8_t {\n    CONNECT = 0x01,\n    BIND = 0x02,\n    UDP_ASSOCIATE = 0x03\n};\n\n/** Values defined for REP in RFC1928 */\nenum SOCKS5Reply: uint8_t {\n    SUCCEEDED = 0x00,        //! Succeeded\n    GENFAILURE = 0x01,       //! General failure\n    NOTALLOWED = 0x02,       //! Connection not allowed by ruleset\n    NETUNREACHABLE = 0x03,   //! Network unreachable\n    HOSTUNREACHABLE = 0x04,  //! Network unreachable\n    CONNREFUSED = 0x05,      //! Connection refused\n    TTLEXPIRED = 0x06,       //! TTL expired\n    CMDUNSUPPORTED = 0x07,   //! Command not supported\n    ATYPEUNSUPPORTED = 0x08, //! Address type not supported\n};\n\n/** Values defined for ATYPE in RFC1928 */\nenum SOCKS5Atyp: uint8_t {\n    IPV4 = 0x01,\n    DOMAINNAME = 0x03,\n    IPV6 = 0x04,\n};\n\n/** Status codes that can be returned by InterruptibleRecv */\nenum class IntrRecvError {\n    OK,\n    Timeout,\n    Disconnected,\n    NetworkError,\n    Interrupted\n};\n\n/**\n * Read bytes from socket. This will either read the full number of bytes requested\n * or return False on error or timeout.\n * This function can be interrupted by calling InterruptSocks5()\n *\n * @param data Buffer to receive into\n * @param len  Length of data to receive\n * @param timeout  Timeout in milliseconds for receive operation\n *\n * @note This function requires that hSocket is in non-blocking mode.\n */\nstatic IntrRecvError InterruptibleRecv(uint8_t* data, size_t len, int timeout, const SOCKET& hSocket)\n{\n    int64_t curTime = GetTimeMillis();\n    int64_t endTime = curTime + timeout;\n    // Maximum time to wait in one select call. It will take up until this time (in millis)\n    // to break off in case of an interruption.\n    const int64_t maxWait = 1000;\n    while (len > 0 && curTime < endTime) {\n        ssize_t ret = recv(hSocket, (char*)data, len, 0); // Optimistically try the recv first\n        if (ret > 0) {\n            len -= ret;\n            data += ret;\n        } else if (ret == 0) { // Unexpected disconnection\n            return IntrRecvError::Disconnected;\n        } else { // Other error or blocking\n            int nErr = WSAGetLastError();\n            if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL) {\n                if (!IsSelectableSocket(hSocket)) {\n                    return IntrRecvError::NetworkError;\n                }\n                struct timeval tval = MillisToTimeval(std::min(endTime - curTime, maxWait));\n                fd_set fdset;\n                FD_ZERO(&fdset);\n                FD_SET(hSocket, &fdset);\n                int nRet = select(hSocket + 1, &fdset, nullptr, nullptr, &tval);\n                if (nRet == SOCKET_ERROR) {\n                    return IntrRecvError::NetworkError;\n                }\n            } else {\n                return IntrRecvError::NetworkError;\n            }\n        }\n        if (interruptSocks5Recv)\n            return IntrRecvError::Interrupted;\n        curTime = GetTimeMillis();\n    }\n    return len == 0 ? IntrRecvError::OK : IntrRecvError::Timeout;\n}\n\n/** Credentials for proxy authentication */\nstruct ProxyCredentials\n{\n    std::string username;\n    std::string password;\n};\n\n/** Convert SOCKS5 reply to an error message */\nstd::string Socks5ErrorString(uint8_t err)\n{\n    switch(err) {\n        case SOCKS5Reply::GENFAILURE:\n            return \"general failure\";\n        case SOCKS5Reply::NOTALLOWED:\n            return \"connection not allowed\";\n        case SOCKS5Reply::NETUNREACHABLE:\n            return \"network unreachable\";\n        case SOCKS5Reply::HOSTUNREACHABLE:\n            return \"host unreachable\";\n        case SOCKS5Reply::CONNREFUSED:\n            return \"connection refused\";\n        case SOCKS5Reply::TTLEXPIRED:\n            return \"TTL expired\";\n        case SOCKS5Reply::CMDUNSUPPORTED:\n            return \"protocol error\";\n        case SOCKS5Reply::ATYPEUNSUPPORTED:\n            return \"address type not supported\";\n        default:\n            return \"unknown\";\n    }\n}\n\n/** Connect using SOCKS5 (as described in RFC1928) */\nstatic bool Socks5(const std::string& strDest, int port, const ProxyCredentials *auth, const SOCKET& hSocket)\n{\n    IntrRecvError recvr;\n    LogPrint(BCLog::NET, \"SOCKS5 connecting %s\\n\", strDest);\n    if (strDest.size() > 255) {\n        return error(\"Hostname too long\");\n    }\n    // Accepted authentication methods\n    std::vector<uint8_t> vSocks5Init;\n    vSocks5Init.push_back(SOCKSVersion::SOCKS5);\n    if (auth) {\n        vSocks5Init.push_back(0x02); // Number of methods\n        vSocks5Init.push_back(SOCKS5Method::NOAUTH);\n        vSocks5Init.push_back(SOCKS5Method::USER_PASS);\n    } else {\n        vSocks5Init.push_back(0x01); // Number of methods\n        vSocks5Init.push_back(SOCKS5Method::NOAUTH);\n    }\n    ssize_t ret = send(hSocket, (const char*)vSocks5Init.data(), vSocks5Init.size(), MSG_NOSIGNAL);\n    if (ret != (ssize_t)vSocks5Init.size()) {\n        return error(\"Error sending to proxy\");\n    }\n    uint8_t pchRet1[2];\n    if ((recvr = InterruptibleRecv(pchRet1, 2, SOCKS5_RECV_TIMEOUT, hSocket)) != IntrRecvError::OK) {\n        LogPrintf(\"Socks5() connect to %s:%d failed: InterruptibleRecv() timeout or other failure\\n\", strDest, port);\n        return false;\n    }\n    if (pchRet1[0] != SOCKSVersion::SOCKS5) {\n        return error(\"Proxy failed to initialize\");\n    }\n    if (pchRet1[1] == SOCKS5Method::USER_PASS && auth) {\n        // Perform username/password authentication (as described in RFC1929)\n        std::vector<uint8_t> vAuth;\n        vAuth.push_back(0x01); // Current (and only) version of user/pass subnegotiation\n        if (auth->username.size() > 255 || auth->password.size() > 255)\n            return error(\"Proxy username or password too long\");\n        vAuth.push_back(auth->username.size());\n        vAuth.insert(vAuth.end(), auth->username.begin(), auth->username.end());\n        vAuth.push_back(auth->password.size());\n        vAuth.insert(vAuth.end(), auth->password.begin(), auth->password.end());\n        ret = send(hSocket, (const char*)vAuth.data(), vAuth.size(), MSG_NOSIGNAL);\n        if (ret != (ssize_t)vAuth.size()) {\n            return error(\"Error sending authentication to proxy\");\n        }\n        LogPrint(BCLog::PROXY, \"SOCKS5 sending proxy authentication %s:%s\\n\", auth->username, auth->password);\n        uint8_t pchRetA[2];\n        if ((recvr = InterruptibleRecv(pchRetA, 2, SOCKS5_RECV_TIMEOUT, hSocket)) != IntrRecvError::OK) {\n            return error(\"Error reading proxy authentication response\");\n        }\n        if (pchRetA[0] != 0x01 || pchRetA[1] != 0x00) {\n            return error(\"Proxy authentication unsuccessful\");\n        }\n    } else if (pchRet1[1] == SOCKS5Method::NOAUTH) {\n        // Perform no authentication\n    } else {\n        return error(\"Proxy requested wrong authentication method %02x\", pchRet1[1]);\n    }\n    std::vector<uint8_t> vSocks5;\n    vSocks5.push_back(SOCKSVersion::SOCKS5); // VER protocol version\n    vSocks5.push_back(SOCKS5Command::CONNECT); // CMD CONNECT\n    vSocks5.push_back(0x00); // RSV Reserved must be 0\n    vSocks5.push_back(SOCKS5Atyp::DOMAINNAME); // ATYP DOMAINNAME\n    vSocks5.push_back(strDest.size()); // Length<=255 is checked at beginning of function\n    vSocks5.insert(vSocks5.end(), strDest.begin(), strDest.end());\n    vSocks5.push_back((port >> 8) & 0xFF);\n    vSocks5.push_back((port >> 0) & 0xFF);\n    ret = send(hSocket, (const char*)vSocks5.data(), vSocks5.size(), MSG_NOSIGNAL);\n    if (ret != (ssize_t)vSocks5.size()) {\n        return error(\"Error sending to proxy\");\n    }\n    uint8_t pchRet2[4];\n    if ((recvr = InterruptibleRecv(pchRet2, 4, SOCKS5_RECV_TIMEOUT, hSocket)) != IntrRecvError::OK) {\n        if (recvr == IntrRecvError::Timeout) {\n            /* If a timeout happens here, this effectively means we timed out while connecting\n             * to the remote node. This is very common for Tor, so do not print an\n             * error message. */\n            return false;\n        } else {\n            return error(\"Error while reading proxy response\");\n        }\n    }\n    if (pchRet2[0] != SOCKSVersion::SOCKS5) {\n        return error(\"Proxy failed to accept request\");\n    }\n    if (pchRet2[1] != SOCKS5Reply::SUCCEEDED) {\n        // Failures to connect to a peer that are not proxy errors\n        LogPrintf(\"Socks5() connect to %s:%d failed: %s\\n\", strDest, port, Socks5ErrorString(pchRet2[1]));\n        return false;\n    }\n    if (pchRet2[2] != 0x00) { // Reserved field must be 0\n        return error(\"Error: malformed proxy response\");\n    }\n    uint8_t pchRet3[256];\n    switch (pchRet2[3])\n    {\n        case SOCKS5Atyp::IPV4: recvr = InterruptibleRecv(pchRet3, 4, SOCKS5_RECV_TIMEOUT, hSocket); break;\n        case SOCKS5Atyp::IPV6: recvr = InterruptibleRecv(pchRet3, 16, SOCKS5_RECV_TIMEOUT, hSocket); break;\n        case SOCKS5Atyp::DOMAINNAME:\n        {\n            recvr = InterruptibleRecv(pchRet3, 1, SOCKS5_RECV_TIMEOUT, hSocket);\n            if (recvr != IntrRecvError::OK) {\n                return error(\"Error reading from proxy\");\n            }\n            int nRecv = pchRet3[0];\n            recvr = InterruptibleRecv(pchRet3, nRecv, SOCKS5_RECV_TIMEOUT, hSocket);\n            break;\n        }\n        default: return error(\"Error: malformed proxy response\");\n    }\n    if (recvr != IntrRecvError::OK) {\n        return error(\"Error reading from proxy\");\n    }\n    if ((recvr = InterruptibleRecv(pchRet3, 2, SOCKS5_RECV_TIMEOUT, hSocket)) != IntrRecvError::OK) {\n        return error(\"Error reading from proxy\");\n    }\n    LogPrint(BCLog::NET, \"SOCKS5 connected %s\\n\", strDest);\n    return true;\n}\n\nSOCKET CreateSocket(const CService &addrConnect)\n{\n    struct sockaddr_storage sockaddr;\n    socklen_t len = sizeof(sockaddr);\n    if (!addrConnect.GetSockAddr((struct sockaddr*)&sockaddr, &len)) {\n        LogPrintf(\"Cannot create socket for %s: unsupported network\\n\", addrConnect.ToString());\n        return INVALID_SOCKET;\n    }\n\n    SOCKET hSocket = socket(((struct sockaddr*)&sockaddr)->sa_family, SOCK_STREAM, IPPROTO_TCP);\n    if (hSocket == INVALID_SOCKET)\n        return INVALID_SOCKET;\n\n    if (!IsSelectableSocket(hSocket)) {\n        CloseSocket(hSocket);\n        LogPrintf(\"Cannot create connection: non-selectable socket created (fd >= FD_SETSIZE ?)\\n\");\n        return INVALID_SOCKET;\n    }\n\n#ifdef SO_NOSIGPIPE\n    int set = 1;\n    // Different way of disabling SIGPIPE on BSD\n    setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int));\n#endif\n\n    //Disable Nagle's algorithm\n    SetSocketNoDelay(hSocket);\n\n    // Set to non-blocking\n    if (!SetSocketNonBlocking(hSocket, true)) {\n        CloseSocket(hSocket);\n        LogPrintf(\"ConnectSocketDirectly: Setting socket to non-blocking failed, error %s\\n\", NetworkErrorString(WSAGetLastError()));\n    }\n    return hSocket;\n}\n\nbool ConnectSocketDirectly(const CService &addrConnect, const SOCKET& hSocket, int nTimeout)\n{\n    struct sockaddr_storage sockaddr;\n    socklen_t len = sizeof(sockaddr);\n    if (hSocket == INVALID_SOCKET) {\n        LogPrintf(\"Cannot connect to %s: invalid socket\\n\", addrConnect.ToString());\n        return false;\n    }\n    if (!addrConnect.GetSockAddr((struct sockaddr*)&sockaddr, &len)) {\n        LogPrintf(\"Cannot connect to %s: unsupported network\\n\", addrConnect.ToString());\n        return false;\n    }\n    if (connect(hSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR)\n    {\n        int nErr = WSAGetLastError();\n        // WSAEINVAL is here because some legacy version of winsock uses it\n        if (nErr == WSAEINPROGRESS || nErr == WSAEWOULDBLOCK || nErr == WSAEINVAL)\n        {\n            struct timeval timeout = MillisToTimeval(nTimeout);\n            fd_set fdset;\n            FD_ZERO(&fdset);\n            FD_SET(hSocket, &fdset);\n            int nRet = select(hSocket + 1, nullptr, &fdset, nullptr, &timeout);\n            if (nRet == 0)\n            {\n                LogPrint(BCLog::NET, \"connection to %s timeout\\n\", addrConnect.ToString());\n                return false;\n            }\n            if (nRet == SOCKET_ERROR)\n            {\n                LogPrintf(\"select() for %s failed: %s\\n\", addrConnect.ToString(), NetworkErrorString(WSAGetLastError()));\n                return false;\n            }\n            socklen_t nRetSize = sizeof(nRet);\n#ifdef WIN32\n            if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, (char*)(&nRet), &nRetSize) == SOCKET_ERROR)\n#else\n            if (getsockopt(hSocket, SOL_SOCKET, SO_ERROR, &nRet, &nRetSize) == SOCKET_ERROR)\n#endif\n            {\n                LogPrintf(\"getsockopt() for %s failed: %s\\n\", addrConnect.ToString(), NetworkErrorString(WSAGetLastError()));\n                return false;\n            }\n            if (nRet != 0)\n            {\n                if (!IsInitialBlockDownload()) { // FIXME.SUGAR // IBD: do not print this connection log during IBD\n                    LogPrintf(\"connect() to %s failed after select(): %s\\n\", addrConnect.ToString(), NetworkErrorString(nRet));\n                }\n                return false;\n            }\n        }\n#ifdef WIN32\n        else if (WSAGetLastError() != WSAEISCONN)\n#else\n        else\n#endif\n        {\n            if (!IsInitialBlockDownload()) { // FIXME.SUGAR // IBD: do not print this connection log during IBD\n                LogPrintf(\"connect() to %s failed: %s\\n\", addrConnect.ToString(), NetworkErrorString(WSAGetLastError()));\n            }\n            return false;\n        }\n    }\n    return true;\n}\n\nbool SetProxy(enum Network net, const proxyType &addrProxy) {\n    assert(net >= 0 && net < NET_MAX);\n    if (!addrProxy.IsValid())\n        return false;\n    LOCK(cs_proxyInfos);\n    proxyInfo[net] = addrProxy;\n    return true;\n}\n\nbool GetProxy(enum Network net, proxyType &proxyInfoOut) {\n    assert(net >= 0 && net < NET_MAX);\n    LOCK(cs_proxyInfos);\n    if (!proxyInfo[net].IsValid())\n        return false;\n    proxyInfoOut = proxyInfo[net];\n    return true;\n}\n\nbool SetNameProxy(const proxyType &addrProxy) {\n    if (!addrProxy.IsValid())\n        return false;\n    LOCK(cs_proxyInfos);\n    nameProxy = addrProxy;\n    return true;\n}\n\nbool GetNameProxy(proxyType &nameProxyOut) {\n    LOCK(cs_proxyInfos);\n    if(!nameProxy.IsValid())\n        return false;\n    nameProxyOut = nameProxy;\n    return true;\n}\n\nbool HaveNameProxy() {\n    LOCK(cs_proxyInfos);\n    return nameProxy.IsValid();\n}\n\nbool IsProxy(const CNetAddr &addr) {\n    LOCK(cs_proxyInfos);\n    for (int i = 0; i < NET_MAX; i++) {\n        if (addr == (CNetAddr)proxyInfo[i].proxy)\n            return true;\n    }\n    return false;\n}\n\nbool ConnectThroughProxy(const proxyType &proxy, const std::string& strDest, int port, const SOCKET& hSocket, int nTimeout, bool *outProxyConnectionFailed)\n{\n    // first connect to proxy server\n    if (!ConnectSocketDirectly(proxy.proxy, hSocket, nTimeout)) {\n        if (outProxyConnectionFailed)\n            *outProxyConnectionFailed = true;\n        return false;\n    }\n    // do socks negotiation\n    if (proxy.randomize_credentials) {\n        ProxyCredentials random_auth;\n        static std::atomic_int counter(0);\n        random_auth.username = random_auth.password = strprintf(\"%i\", counter++);\n        if (!Socks5(strDest, (unsigned short)port, &random_auth, hSocket)) {\n            return false;\n        }\n    } else {\n        if (!Socks5(strDest, (unsigned short)port, 0, hSocket)) {\n            return false;\n        }\n    }\n    return true;\n}\nbool LookupSubNet(const char* pszName, CSubNet& ret)\n{\n    std::string strSubnet(pszName);\n    size_t slash = strSubnet.find_last_of('/');\n    std::vector<CNetAddr> vIP;\n\n    std::string strAddress = strSubnet.substr(0, slash);\n    if (LookupHost(strAddress.c_str(), vIP, 1, false))\n    {\n        CNetAddr network = vIP[0];\n        if (slash != strSubnet.npos)\n        {\n            std::string strNetmask = strSubnet.substr(slash + 1);\n            int32_t n;\n            // IPv4 addresses start at offset 12, and first 12 bytes must match, so just offset n\n            if (ParseInt32(strNetmask, &n)) { // If valid number, assume /24 syntax\n                ret = CSubNet(network, n);\n                return ret.IsValid();\n            }\n            else // If not a valid number, try full netmask syntax\n            {\n                // Never allow lookup for netmask\n                if (LookupHost(strNetmask.c_str(), vIP, 1, false)) {\n                    ret = CSubNet(network, vIP[0]);\n                    return ret.IsValid();\n                }\n            }\n        }\n        else\n        {\n            ret = CSubNet(network);\n            return ret.IsValid();\n        }\n    }\n    return false;\n}\n\n#ifdef WIN32\nstd::string NetworkErrorString(int err)\n{\n    char buf[256];\n    buf[0] = 0;\n    if(FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK,\n            nullptr, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),\n            buf, sizeof(buf), nullptr))\n    {\n        return strprintf(\"%s (%d)\", buf, err);\n    }\n    else\n    {\n        return strprintf(\"Unknown error (%d)\", err);\n    }\n}\n#else\nstd::string NetworkErrorString(int err)\n{\n    char buf[256];\n    buf[0] = 0;\n    /* Too bad there are two incompatible implementations of the\n     * thread-safe strerror. */\n    const char *s;\n#ifdef STRERROR_R_CHAR_P /* GNU variant can return a pointer outside the passed buffer */\n    s = strerror_r(err, buf, sizeof(buf));\n#else /* POSIX variant always returns message in buffer */\n    s = buf;\n    if (strerror_r(err, buf, sizeof(buf)))\n        buf[0] = 0;\n#endif\n    return strprintf(\"%s (%d)\", s, err);\n}\n#endif\n\nbool CloseSocket(SOCKET& hSocket)\n{\n    if (hSocket == INVALID_SOCKET)\n        return false;\n#ifdef WIN32\n    int ret = closesocket(hSocket);\n#else\n    int ret = close(hSocket);\n#endif\n    if (ret) {\n        LogPrintf(\"Socket close failed: %d. Error: %s\\n\", hSocket, NetworkErrorString(WSAGetLastError()));\n    }\n    hSocket = INVALID_SOCKET;\n    return ret != SOCKET_ERROR;\n}\n\nbool SetSocketNonBlocking(const SOCKET& hSocket, bool fNonBlocking)\n{\n    if (fNonBlocking) {\n#ifdef WIN32\n        u_long nOne = 1;\n        if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR) {\n#else\n        int fFlags = fcntl(hSocket, F_GETFL, 0);\n        if (fcntl(hSocket, F_SETFL, fFlags | O_NONBLOCK) == SOCKET_ERROR) {\n#endif\n            return false;\n        }\n    } else {\n#ifdef WIN32\n        u_long nZero = 0;\n        if (ioctlsocket(hSocket, FIONBIO, &nZero) == SOCKET_ERROR) {\n#else\n        int fFlags = fcntl(hSocket, F_GETFL, 0);\n        if (fcntl(hSocket, F_SETFL, fFlags & ~O_NONBLOCK) == SOCKET_ERROR) {\n#endif\n            return false;\n        }\n    }\n\n    return true;\n}\n\nbool SetSocketNoDelay(const SOCKET& hSocket)\n{\n    int set = 1;\n    int rc = setsockopt(hSocket, IPPROTO_TCP, TCP_NODELAY, (const char*)&set, sizeof(int));\n    return rc == 0;\n}\n\nvoid InterruptSocks5(bool interrupt)\n{\n    interruptSocks5Recv = interrupt;\n}\n"
  },
  {
    "path": "src/netbase.h",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_NETBASE_H\n#define BITCOIN_NETBASE_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <compat.h>\n#include <netaddress.h>\n#include <serialize.h>\n\n#include <stdint.h>\n#include <string>\n#include <vector>\n\nextern int nConnectTimeout;\nextern bool fNameLookup;\n\n//! -timeout default\nstatic const int DEFAULT_CONNECT_TIMEOUT = 5000;\n//! -dns default\nstatic const int DEFAULT_NAME_LOOKUP = true;\n\nclass proxyType\n{\npublic:\n    proxyType(): randomize_credentials(false) {}\n    explicit proxyType(const CService &_proxy, bool _randomize_credentials=false): proxy(_proxy), randomize_credentials(_randomize_credentials) {}\n\n    bool IsValid() const { return proxy.IsValid(); }\n\n    CService proxy;\n    bool randomize_credentials;\n};\n\nenum Network ParseNetwork(std::string net);\nstd::string GetNetworkName(enum Network net);\nbool SetProxy(enum Network net, const proxyType &addrProxy);\nbool GetProxy(enum Network net, proxyType &proxyInfoOut);\nbool IsProxy(const CNetAddr &addr);\nbool SetNameProxy(const proxyType &addrProxy);\nbool HaveNameProxy();\nbool GetNameProxy(proxyType &nameProxyOut);\nbool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup);\nbool LookupHost(const char *pszName, CNetAddr& addr, bool fAllowLookup);\nbool Lookup(const char *pszName, CService& addr, int portDefault, bool fAllowLookup);\nbool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault, bool fAllowLookup, unsigned int nMaxSolutions);\nCService LookupNumeric(const char *pszName, int portDefault = 0);\nbool LookupSubNet(const char *pszName, CSubNet& subnet);\nSOCKET CreateSocket(const CService &addrConnect);\nbool ConnectSocketDirectly(const CService &addrConnect, const SOCKET& hSocketRet, int nTimeout);\nbool ConnectThroughProxy(const proxyType &proxy, const std::string& strDest, int port, const SOCKET& hSocketRet, int nTimeout, bool *outProxyConnectionFailed);\n/** Return readable error string for a network error code */\nstd::string NetworkErrorString(int err);\n/** Close socket and set hSocket to INVALID_SOCKET */\nbool CloseSocket(SOCKET& hSocket);\n/** Disable or enable blocking-mode for a socket */\nbool SetSocketNonBlocking(const SOCKET& hSocket, bool fNonBlocking);\n/** Set the TCP_NODELAY flag on a socket */\nbool SetSocketNoDelay(const SOCKET& hSocket);\n/**\n * Convert milliseconds to a struct timeval for e.g. select.\n */\nstruct timeval MillisToTimeval(int64_t nTimeout);\nvoid InterruptSocks5(bool interrupt);\n\n#endif // BITCOIN_NETBASE_H\n"
  },
  {
    "path": "src/netmessagemaker.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_NETMESSAGEMAKER_H\n#define BITCOIN_NETMESSAGEMAKER_H\n\n#include <net.h>\n#include <serialize.h>\n\nclass CNetMsgMaker\n{\npublic:\n    explicit CNetMsgMaker(int nVersionIn) : nVersion(nVersionIn){}\n\n    template <typename... Args>\n    CSerializedNetMsg Make(int nFlags, std::string sCommand, Args&&... args) const\n    {\n        CSerializedNetMsg msg;\n        msg.command = std::move(sCommand);\n        CVectorWriter{ SER_NETWORK, nFlags | nVersion, msg.data, 0, std::forward<Args>(args)... };\n        return msg;\n    }\n\n    template <typename... Args>\n    CSerializedNetMsg Make(std::string sCommand, Args&&... args) const\n    {\n        return Make(0, std::move(sCommand), std::forward<Args>(args)...);\n    }\n\nprivate:\n    const int nVersion;\n};\n\n#endif // BITCOIN_NETMESSAGEMAKER_H\n"
  },
  {
    "path": "src/noui.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <noui.h>\n\n#include <ui_interface.h>\n#include <util.h>\n\n#include <cstdio>\n#include <stdint.h>\n#include <string>\n\nstatic bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)\n{\n    bool fSecure = style & CClientUIInterface::SECURE;\n    style &= ~CClientUIInterface::SECURE;\n\n    std::string strCaption;\n    // Check for usage of predefined caption\n    switch (style) {\n    case CClientUIInterface::MSG_ERROR:\n        strCaption += _(\"Error\");\n        break;\n    case CClientUIInterface::MSG_WARNING:\n        strCaption += _(\"Warning\");\n        break;\n    case CClientUIInterface::MSG_INFORMATION:\n        strCaption += _(\"Information\");\n        break;\n    default:\n        strCaption += caption; // Use supplied caption (can be empty)\n    }\n\n    if (!fSecure)\n        LogPrintf(\"%s: %s\\n\", strCaption, message);\n    fprintf(stderr, \"%s: %s\\n\", strCaption.c_str(), message.c_str());\n    return false;\n}\n\nstatic bool noui_ThreadSafeQuestion(const std::string& /* ignored interactive message */, const std::string& message, const std::string& caption, unsigned int style)\n{\n    return noui_ThreadSafeMessageBox(message, caption, style);\n}\n\nstatic void noui_InitMessage(const std::string& message)\n{\n    LogPrintf(\"init message: %s\\n\", message);\n}\n\nvoid noui_connect()\n{\n    // Connect bitcoind signal handlers\n    uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox);\n    uiInterface.ThreadSafeQuestion.connect(noui_ThreadSafeQuestion);\n    uiInterface.InitMessage.connect(noui_InitMessage);\n}\n"
  },
  {
    "path": "src/noui.h",
    "content": "// Copyright (c) 2013-2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_NOUI_H\n#define BITCOIN_NOUI_H\n\nextern void noui_connect();\n\n#endif // BITCOIN_NOUI_H\n"
  },
  {
    "path": "src/obj/.gitignore",
    "content": "*\n!.gitignore\n"
  },
  {
    "path": "src/obj-test/.gitignore",
    "content": "*\n!.gitignore\n"
  },
  {
    "path": "src/policy/feerate.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <policy/feerate.h>\n\n#include <tinyformat.h>\n\nconst std::string CURRENCY_UNIT = \"SUGAR\";\n\nCFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nBytes_)\n{\n    assert(nBytes_ <= uint64_t(std::numeric_limits<int64_t>::max()));\n    int64_t nSize = int64_t(nBytes_);\n\n    if (nSize > 0)\n        nSatoshisPerK = nFeePaid * 1000 / nSize;\n    else\n        nSatoshisPerK = 0;\n}\n\nCAmount CFeeRate::GetFee(size_t nBytes_) const\n{\n    assert(nBytes_ <= uint64_t(std::numeric_limits<int64_t>::max()));\n    int64_t nSize = int64_t(nBytes_);\n\n    CAmount nFee = nSatoshisPerK * nSize / 1000;\n\n    if (nFee == 0 && nSize != 0) {\n        if (nSatoshisPerK > 0)\n            nFee = CAmount(1);\n        if (nSatoshisPerK < 0)\n            nFee = CAmount(-1);\n    }\n\n    return nFee;\n}\n\nstd::string CFeeRate::ToString() const\n{\n    return strprintf(\"%d.%08d %s/kB\", nSatoshisPerK / COIN, nSatoshisPerK % COIN, CURRENCY_UNIT);\n}\n"
  },
  {
    "path": "src/policy/feerate.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_POLICY_FEERATE_H\n#define BITCOIN_POLICY_FEERATE_H\n\n#include <amount.h>\n#include <serialize.h>\n\n#include <string>\n\nextern const std::string CURRENCY_UNIT;\n\n/**\n * Fee rate in satoshis per kilobyte: CAmount / kB\n */\nclass CFeeRate\n{\nprivate:\n    CAmount nSatoshisPerK; // unit is satoshis-per-1,000-bytes\n\npublic:\n    /** Fee rate of 0 satoshis per kB */\n    CFeeRate() : nSatoshisPerK(0) { }\n    template<typename I>\n    CFeeRate(const I _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) {\n        // We've previously had bugs creep in from silent double->int conversion...\n        static_assert(std::is_integral<I>::value, \"CFeeRate should be used without floats\");\n    }\n    /** Constructor for a fee rate in satoshis per kB. The size in bytes must not exceed (2^63 - 1)*/\n    CFeeRate(const CAmount& nFeePaid, size_t nBytes);\n    /**\n     * Return the fee in satoshis for the given size in bytes.\n     */\n    CAmount GetFee(size_t nBytes) const;\n    /**\n     * Return the fee in satoshis for a size of 1000 bytes\n     */\n    CAmount GetFeePerK() const { return GetFee(1000); }\n    friend bool operator<(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK < b.nSatoshisPerK; }\n    friend bool operator>(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK > b.nSatoshisPerK; }\n    friend bool operator==(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK == b.nSatoshisPerK; }\n    friend bool operator<=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK <= b.nSatoshisPerK; }\n    friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; }\n    friend bool operator!=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK != b.nSatoshisPerK; }\n    CFeeRate& operator+=(const CFeeRate& a) { nSatoshisPerK += a.nSatoshisPerK; return *this; }\n    std::string ToString() const;\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(nSatoshisPerK);\n    }\n};\n\n#endif //  BITCOIN_POLICY_FEERATE_H\n"
  },
  {
    "path": "src/policy/fees.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <policy/fees.h>\n#include <policy/policy.h>\n\n#include <clientversion.h>\n#include <primitives/transaction.h>\n#include <streams.h>\n#include <txmempool.h>\n#include <util.h>\n\nstatic constexpr double INF_FEERATE = 1e99;\n\nstd::string StringForFeeEstimateHorizon(FeeEstimateHorizon horizon) {\n    static const std::map<FeeEstimateHorizon, std::string> horizon_strings = {\n        {FeeEstimateHorizon::SHORT_HALFLIFE, \"short\"},\n        {FeeEstimateHorizon::MED_HALFLIFE, \"medium\"},\n        {FeeEstimateHorizon::LONG_HALFLIFE, \"long\"},\n    };\n    auto horizon_string = horizon_strings.find(horizon);\n\n    if (horizon_string == horizon_strings.end()) return \"unknown\";\n\n    return horizon_string->second;\n}\n\nstd::string StringForFeeReason(FeeReason reason) {\n    static const std::map<FeeReason, std::string> fee_reason_strings = {\n        {FeeReason::NONE, \"None\"},\n        {FeeReason::HALF_ESTIMATE, \"Half Target 60% Threshold\"},\n        {FeeReason::FULL_ESTIMATE, \"Target 85% Threshold\"},\n        {FeeReason::DOUBLE_ESTIMATE, \"Double Target 95% Threshold\"},\n        {FeeReason::CONSERVATIVE, \"Conservative Double Target longer horizon\"},\n        {FeeReason::MEMPOOL_MIN, \"Mempool Min Fee\"},\n        {FeeReason::PAYTXFEE, \"PayTxFee set\"},\n        {FeeReason::FALLBACK, \"Fallback fee\"},\n        {FeeReason::REQUIRED, \"Minimum Required Fee\"},\n        {FeeReason::MAXTXFEE, \"MaxTxFee limit\"}\n    };\n    auto reason_string = fee_reason_strings.find(reason);\n\n    if (reason_string == fee_reason_strings.end()) return \"Unknown\";\n\n    return reason_string->second;\n}\n\nbool FeeModeFromString(const std::string& mode_string, FeeEstimateMode& fee_estimate_mode) {\n    static const std::map<std::string, FeeEstimateMode> fee_modes = {\n        {\"UNSET\", FeeEstimateMode::UNSET},\n        {\"ECONOMICAL\", FeeEstimateMode::ECONOMICAL},\n        {\"CONSERVATIVE\", FeeEstimateMode::CONSERVATIVE},\n    };\n    auto mode = fee_modes.find(mode_string);\n\n    if (mode == fee_modes.end()) return false;\n\n    fee_estimate_mode = mode->second;\n    return true;\n}\n\n/**\n * We will instantiate an instance of this class to track transactions that were\n * included in a block. We will lump transactions into a bucket according to their\n * approximate feerate and then track how long it took for those txs to be included in a block\n *\n * The tracking of unconfirmed (mempool) transactions is completely independent of the\n * historical tracking of transactions that have been confirmed in a block.\n */\nclass TxConfirmStats\n{\nprivate:\n    //Define the buckets we will group transactions into\n    const std::vector<double>& buckets;              // The upper-bound of the range for the bucket (inclusive)\n    const std::map<double, unsigned int>& bucketMap; // Map of bucket upper-bound to index into all vectors by bucket\n\n    // For each bucket X:\n    // Count the total # of txs in each bucket\n    // Track the historical moving average of this total over blocks\n    std::vector<double> txCtAvg;\n\n    // Count the total # of txs confirmed within Y blocks in each bucket\n    // Track the historical moving average of theses totals over blocks\n    std::vector<std::vector<double>> confAvg; // confAvg[Y][X]\n\n    // Track moving avg of txs which have been evicted from the mempool\n    // after failing to be confirmed within Y blocks\n    std::vector<std::vector<double>> failAvg; // failAvg[Y][X]\n\n    // Sum the total feerate of all tx's in each bucket\n    // Track the historical moving average of this total over blocks\n    std::vector<double> avg;\n\n    // Combine the conf counts with tx counts to calculate the confirmation % for each Y,X\n    // Combine the total value with the tx counts to calculate the avg feerate per bucket\n\n    double decay;\n\n    // Resolution (# of blocks) with which confirmations are tracked\n    unsigned int scale;\n\n    // Mempool counts of outstanding transactions\n    // For each bucket X, track the number of transactions in the mempool\n    // that are unconfirmed for each possible confirmation value Y\n    std::vector<std::vector<int> > unconfTxs;  //unconfTxs[Y][X]\n    // transactions still unconfirmed after GetMaxConfirms for each bucket\n    std::vector<int> oldUnconfTxs;\n\n    void resizeInMemoryCounters(size_t newbuckets);\n\npublic:\n    /**\n     * Create new TxConfirmStats. This is called by BlockPolicyEstimator's\n     * constructor with default values.\n     * @param defaultBuckets contains the upper limits for the bucket boundaries\n     * @param maxPeriods max number of periods to track\n     * @param decay how much to decay the historical moving average per block\n     */\n    TxConfirmStats(const std::vector<double>& defaultBuckets, const std::map<double, unsigned int>& defaultBucketMap,\n                   unsigned int maxPeriods, double decay, unsigned int scale);\n\n    /** Roll the circular buffer for unconfirmed txs*/\n    void ClearCurrent(unsigned int nBlockHeight);\n\n    /**\n     * Record a new transaction data point in the current block stats\n     * @param blocksToConfirm the number of blocks it took this transaction to confirm\n     * @param val the feerate of the transaction\n     * @warning blocksToConfirm is 1-based and has to be >= 1\n     */\n    void Record(int blocksToConfirm, double val);\n\n    /** Record a new transaction entering the mempool*/\n    unsigned int NewTx(unsigned int nBlockHeight, double val);\n\n    /** Remove a transaction from mempool tracking stats*/\n    void removeTx(unsigned int entryHeight, unsigned int nBestSeenHeight,\n                  unsigned int bucketIndex, bool inBlock);\n\n    /** Update our estimates by decaying our historical moving average and updating\n        with the data gathered from the current block */\n    void UpdateMovingAverages();\n\n    /**\n     * Calculate a feerate estimate.  Find the lowest value bucket (or range of buckets\n     * to make sure we have enough data points) whose transactions still have sufficient likelihood\n     * of being confirmed within the target number of confirmations\n     * @param confTarget target number of confirmations\n     * @param sufficientTxVal required average number of transactions per block in a bucket range\n     * @param minSuccess the success probability we require\n     * @param requireGreater return the lowest feerate such that all higher values pass minSuccess OR\n     *        return the highest feerate such that all lower values fail minSuccess\n     * @param nBlockHeight the current block height\n     */\n    double EstimateMedianVal(int confTarget, double sufficientTxVal,\n                             double minSuccess, bool requireGreater, unsigned int nBlockHeight,\n                             EstimationResult *result = nullptr) const;\n\n    /** Return the max number of confirms we're tracking */\n    unsigned int GetMaxConfirms() const { return scale * confAvg.size(); }\n\n    /** Write state of estimation data to a file*/\n    void Write(CAutoFile& fileout) const;\n\n    /**\n     * Read saved state of estimation data from a file and replace all internal data structures and\n     * variables with this state.\n     */\n    void Read(CAutoFile& filein, int nFileVersion, size_t numBuckets);\n};\n\n\nTxConfirmStats::TxConfirmStats(const std::vector<double>& defaultBuckets,\n                                const std::map<double, unsigned int>& defaultBucketMap,\n                               unsigned int maxPeriods, double _decay, unsigned int _scale)\n    : buckets(defaultBuckets), bucketMap(defaultBucketMap)\n{\n    decay = _decay;\n    assert(_scale != 0 && \"_scale must be non-zero\");\n    scale = _scale;\n    confAvg.resize(maxPeriods);\n    for (unsigned int i = 0; i < maxPeriods; i++) {\n        confAvg[i].resize(buckets.size());\n    }\n    failAvg.resize(maxPeriods);\n    for (unsigned int i = 0; i < maxPeriods; i++) {\n        failAvg[i].resize(buckets.size());\n    }\n\n    txCtAvg.resize(buckets.size());\n    avg.resize(buckets.size());\n\n    resizeInMemoryCounters(buckets.size());\n}\n\nvoid TxConfirmStats::resizeInMemoryCounters(size_t newbuckets) {\n    // newbuckets must be passed in because the buckets referred to during Read have not been updated yet.\n    unconfTxs.resize(GetMaxConfirms());\n    for (unsigned int i = 0; i < unconfTxs.size(); i++) {\n        unconfTxs[i].resize(newbuckets);\n    }\n    oldUnconfTxs.resize(newbuckets);\n}\n\n// Roll the unconfirmed txs circular buffer\nvoid TxConfirmStats::ClearCurrent(unsigned int nBlockHeight)\n{\n    for (unsigned int j = 0; j < buckets.size(); j++) {\n        oldUnconfTxs[j] += unconfTxs[nBlockHeight%unconfTxs.size()][j];\n        unconfTxs[nBlockHeight%unconfTxs.size()][j] = 0;\n    }\n}\n\n\nvoid TxConfirmStats::Record(int blocksToConfirm, double val)\n{\n    // blocksToConfirm is 1-based\n    if (blocksToConfirm < 1)\n        return;\n    int periodsToConfirm = (blocksToConfirm + scale - 1)/scale;\n    unsigned int bucketindex = bucketMap.lower_bound(val)->second;\n    for (size_t i = periodsToConfirm; i <= confAvg.size(); i++) {\n        confAvg[i - 1][bucketindex]++;\n    }\n    txCtAvg[bucketindex]++;\n    avg[bucketindex] += val;\n}\n\nvoid TxConfirmStats::UpdateMovingAverages()\n{\n    for (unsigned int j = 0; j < buckets.size(); j++) {\n        for (unsigned int i = 0; i < confAvg.size(); i++)\n            confAvg[i][j] = confAvg[i][j] * decay;\n        for (unsigned int i = 0; i < failAvg.size(); i++)\n            failAvg[i][j] = failAvg[i][j] * decay;\n        avg[j] = avg[j] * decay;\n        txCtAvg[j] = txCtAvg[j] * decay;\n    }\n}\n\n// returns -1 on error conditions\ndouble TxConfirmStats::EstimateMedianVal(int confTarget, double sufficientTxVal,\n                                         double successBreakPoint, bool requireGreater,\n                                         unsigned int nBlockHeight, EstimationResult *result) const\n{\n    // Counters for a bucket (or range of buckets)\n    double nConf = 0; // Number of tx's confirmed within the confTarget\n    double totalNum = 0; // Total number of tx's that were ever confirmed\n    int extraNum = 0;  // Number of tx's still in mempool for confTarget or longer\n    double failNum = 0; // Number of tx's that were never confirmed but removed from the mempool after confTarget\n    int periodTarget = (confTarget + scale - 1)/scale;\n\n    int maxbucketindex = buckets.size() - 1;\n\n    // requireGreater means we are looking for the lowest feerate such that all higher\n    // values pass, so we start at maxbucketindex (highest feerate) and look at successively\n    // smaller buckets until we reach failure.  Otherwise, we are looking for the highest\n    // feerate such that all lower values fail, and we go in the opposite direction.\n    unsigned int startbucket = requireGreater ? maxbucketindex : 0;\n    int step = requireGreater ? -1 : 1;\n\n    // We'll combine buckets until we have enough samples.\n    // The near and far variables will define the range we've combined\n    // The best variables are the last range we saw which still had a high\n    // enough confirmation rate to count as success.\n    // The cur variables are the current range we're counting.\n    unsigned int curNearBucket = startbucket;\n    unsigned int bestNearBucket = startbucket;\n    unsigned int curFarBucket = startbucket;\n    unsigned int bestFarBucket = startbucket;\n\n    bool foundAnswer = false;\n    unsigned int bins = unconfTxs.size();\n    bool newBucketRange = true;\n    bool passing = true;\n    EstimatorBucket passBucket;\n    EstimatorBucket failBucket;\n\n    // Start counting from highest(default) or lowest feerate transactions\n    for (int bucket = startbucket; bucket >= 0 && bucket <= maxbucketindex; bucket += step) {\n        if (newBucketRange) {\n            curNearBucket = bucket;\n            newBucketRange = false;\n        }\n        curFarBucket = bucket;\n        nConf += confAvg[periodTarget - 1][bucket];\n        totalNum += txCtAvg[bucket];\n        failNum += failAvg[periodTarget - 1][bucket];\n        for (unsigned int confct = confTarget; confct < GetMaxConfirms(); confct++)\n            extraNum += unconfTxs[(nBlockHeight - confct)%bins][bucket];\n        extraNum += oldUnconfTxs[bucket];\n        // If we have enough transaction data points in this range of buckets,\n        // we can test for success\n        // (Only count the confirmed data points, so that each confirmation count\n        // will be looking at the same amount of data and same bucket breaks)\n        if (totalNum >= sufficientTxVal / (1 - decay)) {\n            double curPct = nConf / (totalNum + failNum + extraNum);\n\n            // Check to see if we are no longer getting confirmed at the success rate\n            if ((requireGreater && curPct < successBreakPoint) || (!requireGreater && curPct > successBreakPoint)) {\n                if (passing == true) {\n                    // First time we hit a failure record the failed bucket\n                    unsigned int failMinBucket = std::min(curNearBucket, curFarBucket);\n                    unsigned int failMaxBucket = std::max(curNearBucket, curFarBucket);\n                    failBucket.start = failMinBucket ? buckets[failMinBucket - 1] : 0;\n                    failBucket.end = buckets[failMaxBucket];\n                    failBucket.withinTarget = nConf;\n                    failBucket.totalConfirmed = totalNum;\n                    failBucket.inMempool = extraNum;\n                    failBucket.leftMempool = failNum;\n                    passing = false;\n                }\n                continue;\n            }\n            // Otherwise update the cumulative stats, and the bucket variables\n            // and reset the counters\n            else {\n                failBucket = EstimatorBucket(); // Reset any failed bucket, currently passing\n                foundAnswer = true;\n                passing = true;\n                passBucket.withinTarget = nConf;\n                nConf = 0;\n                passBucket.totalConfirmed = totalNum;\n                totalNum = 0;\n                passBucket.inMempool = extraNum;\n                passBucket.leftMempool = failNum;\n                failNum = 0;\n                extraNum = 0;\n                bestNearBucket = curNearBucket;\n                bestFarBucket = curFarBucket;\n                newBucketRange = true;\n            }\n        }\n    }\n\n    double median = -1;\n    double txSum = 0;\n\n    // Calculate the \"average\" feerate of the best bucket range that met success conditions\n    // Find the bucket with the median transaction and then report the average feerate from that bucket\n    // This is a compromise between finding the median which we can't since we don't save all tx's\n    // and reporting the average which is less accurate\n    unsigned int minBucket = std::min(bestNearBucket, bestFarBucket);\n    unsigned int maxBucket = std::max(bestNearBucket, bestFarBucket);\n    for (unsigned int j = minBucket; j <= maxBucket; j++) {\n        txSum += txCtAvg[j];\n    }\n    if (foundAnswer && txSum != 0) {\n        txSum = txSum / 2;\n        for (unsigned int j = minBucket; j <= maxBucket; j++) {\n            if (txCtAvg[j] < txSum)\n                txSum -= txCtAvg[j];\n            else { // we're in the right bucket\n                median = avg[j] / txCtAvg[j];\n                break;\n            }\n        }\n\n        passBucket.start = minBucket ? buckets[minBucket-1] : 0;\n        passBucket.end = buckets[maxBucket];\n    }\n\n    // If we were passing until we reached last few buckets with insufficient data, then report those as failed\n    if (passing && !newBucketRange) {\n        unsigned int failMinBucket = std::min(curNearBucket, curFarBucket);\n        unsigned int failMaxBucket = std::max(curNearBucket, curFarBucket);\n        failBucket.start = failMinBucket ? buckets[failMinBucket - 1] : 0;\n        failBucket.end = buckets[failMaxBucket];\n        failBucket.withinTarget = nConf;\n        failBucket.totalConfirmed = totalNum;\n        failBucket.inMempool = extraNum;\n        failBucket.leftMempool = failNum;\n    }\n\n    LogPrint(BCLog::ESTIMATEFEE, \"FeeEst: %d %s%.0f%% decay %.5f: feerate: %g from (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out) Fail: (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out)\\n\",\n             confTarget, requireGreater ? \">\" : \"<\", 100.0 * successBreakPoint, decay,\n             median, passBucket.start, passBucket.end,\n             100 * passBucket.withinTarget / (passBucket.totalConfirmed + passBucket.inMempool + passBucket.leftMempool),\n             passBucket.withinTarget, passBucket.totalConfirmed, passBucket.inMempool, passBucket.leftMempool,\n             failBucket.start, failBucket.end,\n             100 * failBucket.withinTarget / (failBucket.totalConfirmed + failBucket.inMempool + failBucket.leftMempool),\n             failBucket.withinTarget, failBucket.totalConfirmed, failBucket.inMempool, failBucket.leftMempool);\n\n\n    if (result) {\n        result->pass = passBucket;\n        result->fail = failBucket;\n        result->decay = decay;\n        result->scale = scale;\n    }\n    return median;\n}\n\nvoid TxConfirmStats::Write(CAutoFile& fileout) const\n{\n    fileout << decay;\n    fileout << scale;\n    fileout << avg;\n    fileout << txCtAvg;\n    fileout << confAvg;\n    fileout << failAvg;\n}\n\nvoid TxConfirmStats::Read(CAutoFile& filein, int nFileVersion, size_t numBuckets)\n{\n    // Read data file and do some very basic sanity checking\n    // buckets and bucketMap are not updated yet, so don't access them\n    // If there is a read failure, we'll just discard this entire object anyway\n    size_t maxConfirms, maxPeriods;\n\n    // The current version will store the decay with each individual TxConfirmStats and also keep a scale factor\n    filein >> decay;\n    if (decay <= 0 || decay >= 1) {\n        throw std::runtime_error(\"Corrupt estimates file. Decay must be between 0 and 1 (non-inclusive)\");\n    }\n    filein >> scale;\n    if (scale == 0) {\n        throw std::runtime_error(\"Corrupt estimates file. Scale must be non-zero\");\n    }\n\n    filein >> avg;\n    if (avg.size() != numBuckets) {\n        throw std::runtime_error(\"Corrupt estimates file. Mismatch in feerate average bucket count\");\n    }\n    filein >> txCtAvg;\n    if (txCtAvg.size() != numBuckets) {\n        throw std::runtime_error(\"Corrupt estimates file. Mismatch in tx count bucket count\");\n    }\n    filein >> confAvg;\n    maxPeriods = confAvg.size();\n    maxConfirms = scale * maxPeriods;\n\n    if (maxConfirms <= 0 || maxConfirms > 6 * 24 * 7) { // one week\n        throw std::runtime_error(\"Corrupt estimates file.  Must maintain estimates for between 1 and 1008 (one week) confirms\");\n    }\n    for (unsigned int i = 0; i < maxPeriods; i++) {\n        if (confAvg[i].size() != numBuckets) {\n            throw std::runtime_error(\"Corrupt estimates file. Mismatch in feerate conf average bucket count\");\n        }\n    }\n\n    filein >> failAvg;\n    if (maxPeriods != failAvg.size()) {\n        throw std::runtime_error(\"Corrupt estimates file. Mismatch in confirms tracked for failures\");\n    }\n    for (unsigned int i = 0; i < maxPeriods; i++) {\n        if (failAvg[i].size() != numBuckets) {\n            throw std::runtime_error(\"Corrupt estimates file. Mismatch in one of failure average bucket counts\");\n        }\n    }\n\n    // Resize the current block variables which aren't stored in the data file\n    // to match the number of confirms and buckets\n    resizeInMemoryCounters(numBuckets);\n\n    LogPrint(BCLog::ESTIMATEFEE, \"Reading estimates: %u buckets counting confirms up to %u blocks\\n\",\n             numBuckets, maxConfirms);\n}\n\nunsigned int TxConfirmStats::NewTx(unsigned int nBlockHeight, double val)\n{\n    unsigned int bucketindex = bucketMap.lower_bound(val)->second;\n    unsigned int blockIndex = nBlockHeight % unconfTxs.size();\n    unconfTxs[blockIndex][bucketindex]++;\n    return bucketindex;\n}\n\nvoid TxConfirmStats::removeTx(unsigned int entryHeight, unsigned int nBestSeenHeight, unsigned int bucketindex, bool inBlock)\n{\n    //nBestSeenHeight is not updated yet for the new block\n    int blocksAgo = nBestSeenHeight - entryHeight;\n    if (nBestSeenHeight == 0)  // the BlockPolicyEstimator hasn't seen any blocks yet\n        blocksAgo = 0;\n    if (blocksAgo < 0) {\n        LogPrint(BCLog::ESTIMATEFEE, \"Blockpolicy error, blocks ago is negative for mempool tx\\n\");\n        return;  //This can't happen because we call this with our best seen height, no entries can have higher\n    }\n\n    if (blocksAgo >= (int)unconfTxs.size()) {\n        if (oldUnconfTxs[bucketindex] > 0) {\n            oldUnconfTxs[bucketindex]--;\n        } else {\n            LogPrint(BCLog::ESTIMATEFEE, \"Blockpolicy error, mempool tx removed from >25 blocks,bucketIndex=%u already\\n\",\n                     bucketindex);\n        }\n    }\n    else {\n        unsigned int blockIndex = entryHeight % unconfTxs.size();\n        if (unconfTxs[blockIndex][bucketindex] > 0) {\n            unconfTxs[blockIndex][bucketindex]--;\n        } else {\n            LogPrint(BCLog::ESTIMATEFEE, \"Blockpolicy error, mempool tx removed from blockIndex=%u,bucketIndex=%u already\\n\",\n                     blockIndex, bucketindex);\n        }\n    }\n    if (!inBlock && (unsigned int)blocksAgo >= scale) { // Only counts as a failure if not confirmed for entire period\n        assert(scale != 0);\n        unsigned int periodsAgo = blocksAgo / scale;\n        for (size_t i = 0; i < periodsAgo && i < failAvg.size(); i++) {\n            failAvg[i][bucketindex]++;\n        }\n    }\n}\n\n// This function is called from CTxMemPool::removeUnchecked to ensure\n// txs removed from the mempool for any reason are no longer\n// tracked. Txs that were part of a block have already been removed in\n// processBlockTx to ensure they are never double tracked, but it is\n// of no harm to try to remove them again.\nbool CBlockPolicyEstimator::removeTx(uint256 hash, bool inBlock)\n{\n    LOCK(cs_feeEstimator);\n    std::map<uint256, TxStatsInfo>::iterator pos = mapMemPoolTxs.find(hash);\n    if (pos != mapMemPoolTxs.end()) {\n        feeStats->removeTx(pos->second.blockHeight, nBestSeenHeight, pos->second.bucketIndex, inBlock);\n        shortStats->removeTx(pos->second.blockHeight, nBestSeenHeight, pos->second.bucketIndex, inBlock);\n        longStats->removeTx(pos->second.blockHeight, nBestSeenHeight, pos->second.bucketIndex, inBlock);\n        mapMemPoolTxs.erase(hash);\n        return true;\n    } else {\n        return false;\n    }\n}\n\nCBlockPolicyEstimator::CBlockPolicyEstimator()\n    : nBestSeenHeight(0), firstRecordedHeight(0), historicalFirst(0), historicalBest(0), trackedTxs(0), untrackedTxs(0)\n{\n    static_assert(MIN_BUCKET_FEERATE > 0, \"Min feerate must be nonzero\");\n    size_t bucketIndex = 0;\n    for (double bucketBoundary = MIN_BUCKET_FEERATE; bucketBoundary <= MAX_BUCKET_FEERATE; bucketBoundary *= FEE_SPACING, bucketIndex++) {\n        buckets.push_back(bucketBoundary);\n        bucketMap[bucketBoundary] = bucketIndex;\n    }\n    buckets.push_back(INF_FEERATE);\n    bucketMap[INF_FEERATE] = bucketIndex;\n    assert(bucketMap.size() == buckets.size());\n\n    feeStats = std::unique_ptr<TxConfirmStats>(new TxConfirmStats(buckets, bucketMap, MED_BLOCK_PERIODS, MED_DECAY, MED_SCALE));\n    shortStats = std::unique_ptr<TxConfirmStats>(new TxConfirmStats(buckets, bucketMap, SHORT_BLOCK_PERIODS, SHORT_DECAY, SHORT_SCALE));\n    longStats = std::unique_ptr<TxConfirmStats>(new TxConfirmStats(buckets, bucketMap, LONG_BLOCK_PERIODS, LONG_DECAY, LONG_SCALE));\n}\n\nCBlockPolicyEstimator::~CBlockPolicyEstimator()\n{\n}\n\nvoid CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, bool validFeeEstimate)\n{\n    LOCK(cs_feeEstimator);\n    unsigned int txHeight = entry.GetHeight();\n    uint256 hash = entry.GetTx().GetHash();\n    if (mapMemPoolTxs.count(hash)) {\n        LogPrint(BCLog::ESTIMATEFEE, \"Blockpolicy error mempool tx %s already being tracked\\n\",\n                 hash.ToString().c_str());\n        return;\n    }\n\n    if (txHeight != nBestSeenHeight) {\n        // Ignore side chains and re-orgs; assuming they are random they don't\n        // affect the estimate.  We'll potentially double count transactions in 1-block reorgs.\n        // Ignore txs if BlockPolicyEstimator is not in sync with chainActive.Tip().\n        // It will be synced next time a block is processed.\n        return;\n    }\n\n    // Only want to be updating estimates when our blockchain is synced,\n    // otherwise we'll miscalculate how many blocks its taking to get included.\n    if (!validFeeEstimate) {\n        untrackedTxs++;\n        return;\n    }\n    trackedTxs++;\n\n    // Feerates are stored and reported as BTC-per-kb:\n    CFeeRate feeRate(entry.GetFee(), entry.GetTxSize());\n\n    mapMemPoolTxs[hash].blockHeight = txHeight;\n    unsigned int bucketIndex = feeStats->NewTx(txHeight, (double)feeRate.GetFeePerK());\n    mapMemPoolTxs[hash].bucketIndex = bucketIndex;\n    unsigned int bucketIndex2 = shortStats->NewTx(txHeight, (double)feeRate.GetFeePerK());\n    assert(bucketIndex == bucketIndex2);\n    unsigned int bucketIndex3 = longStats->NewTx(txHeight, (double)feeRate.GetFeePerK());\n    assert(bucketIndex == bucketIndex3);\n}\n\nbool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const CTxMemPoolEntry* entry)\n{\n    if (!removeTx(entry->GetTx().GetHash(), true)) {\n        // This transaction wasn't being tracked for fee estimation\n        return false;\n    }\n\n    // How many blocks did it take for miners to include this transaction?\n    // blocksToConfirm is 1-based, so a transaction included in the earliest\n    // possible block has confirmation count of 1\n    int blocksToConfirm = nBlockHeight - entry->GetHeight();\n    if (blocksToConfirm <= 0) {\n        // This can't happen because we don't process transactions from a block with a height\n        // lower than our greatest seen height\n        LogPrint(BCLog::ESTIMATEFEE, \"Blockpolicy error Transaction had negative blocksToConfirm\\n\");\n        return false;\n    }\n\n    // Feerates are stored and reported as BTC-per-kb:\n    CFeeRate feeRate(entry->GetFee(), entry->GetTxSize());\n\n    feeStats->Record(blocksToConfirm, (double)feeRate.GetFeePerK());\n    shortStats->Record(blocksToConfirm, (double)feeRate.GetFeePerK());\n    longStats->Record(blocksToConfirm, (double)feeRate.GetFeePerK());\n    return true;\n}\n\nvoid CBlockPolicyEstimator::processBlock(unsigned int nBlockHeight,\n                                         std::vector<const CTxMemPoolEntry*>& entries)\n{\n    LOCK(cs_feeEstimator);\n    if (nBlockHeight <= nBestSeenHeight) {\n        // Ignore side chains and re-orgs; assuming they are random\n        // they don't affect the estimate.\n        // And if an attacker can re-org the chain at will, then\n        // you've got much bigger problems than \"attacker can influence\n        // transaction fees.\"\n        return;\n    }\n\n    // Must update nBestSeenHeight in sync with ClearCurrent so that\n    // calls to removeTx (via processBlockTx) correctly calculate age\n    // of unconfirmed txs to remove from tracking.\n    nBestSeenHeight = nBlockHeight;\n\n    // Update unconfirmed circular buffer\n    feeStats->ClearCurrent(nBlockHeight);\n    shortStats->ClearCurrent(nBlockHeight);\n    longStats->ClearCurrent(nBlockHeight);\n\n    // Decay all exponential averages\n    feeStats->UpdateMovingAverages();\n    shortStats->UpdateMovingAverages();\n    longStats->UpdateMovingAverages();\n\n    unsigned int countedTxs = 0;\n    // Update averages with data points from current block\n    for (const auto& entry : entries) {\n        if (processBlockTx(nBlockHeight, entry))\n            countedTxs++;\n    }\n\n    if (firstRecordedHeight == 0 && countedTxs > 0) {\n        firstRecordedHeight = nBestSeenHeight;\n        LogPrint(BCLog::ESTIMATEFEE, \"Blockpolicy first recorded height %u\\n\", firstRecordedHeight);\n    }\n\n\n    LogPrint(BCLog::ESTIMATEFEE, \"Blockpolicy estimates updated by %u of %u block txs, since last block %u of %u tracked, mempool map size %u, max target %u from %s\\n\",\n             countedTxs, entries.size(), trackedTxs, trackedTxs + untrackedTxs, mapMemPoolTxs.size(),\n             MaxUsableEstimate(), HistoricalBlockSpan() > BlockSpan() ? \"historical\" : \"current\");\n\n    trackedTxs = 0;\n    untrackedTxs = 0;\n}\n\nCFeeRate CBlockPolicyEstimator::estimateFee(int confTarget) const\n{\n    // It's not possible to get reasonable estimates for confTarget of 1\n    if (confTarget <= 1)\n        return CFeeRate(0);\n\n    return estimateRawFee(confTarget, DOUBLE_SUCCESS_PCT, FeeEstimateHorizon::MED_HALFLIFE);\n}\n\nCFeeRate CBlockPolicyEstimator::estimateRawFee(int confTarget, double successThreshold, FeeEstimateHorizon horizon, EstimationResult* result) const\n{\n    TxConfirmStats* stats;\n    double sufficientTxs = SUFFICIENT_FEETXS;\n    switch (horizon) {\n    case FeeEstimateHorizon::SHORT_HALFLIFE: {\n        stats = shortStats.get();\n        sufficientTxs = SUFFICIENT_TXS_SHORT;\n        break;\n    }\n    case FeeEstimateHorizon::MED_HALFLIFE: {\n        stats = feeStats.get();\n        break;\n    }\n    case FeeEstimateHorizon::LONG_HALFLIFE: {\n        stats = longStats.get();\n        break;\n    }\n    default: {\n        throw std::out_of_range(\"CBlockPolicyEstimator::estimateRawFee unknown FeeEstimateHorizon\");\n    }\n    }\n\n    LOCK(cs_feeEstimator);\n    // Return failure if trying to analyze a target we're not tracking\n    if (confTarget <= 0 || (unsigned int)confTarget > stats->GetMaxConfirms())\n        return CFeeRate(0);\n    if (successThreshold > 1)\n        return CFeeRate(0);\n\n    double median = stats->EstimateMedianVal(confTarget, sufficientTxs, successThreshold, true, nBestSeenHeight, result);\n\n    if (median < 0)\n        return CFeeRate(0);\n\n    return CFeeRate(llround(median));\n}\n\nunsigned int CBlockPolicyEstimator::HighestTargetTracked(FeeEstimateHorizon horizon) const\n{\n    switch (horizon) {\n    case FeeEstimateHorizon::SHORT_HALFLIFE: {\n        return shortStats->GetMaxConfirms();\n    }\n    case FeeEstimateHorizon::MED_HALFLIFE: {\n        return feeStats->GetMaxConfirms();\n    }\n    case FeeEstimateHorizon::LONG_HALFLIFE: {\n        return longStats->GetMaxConfirms();\n    }\n    default: {\n        throw std::out_of_range(\"CBlockPolicyEstimator::HighestTargetTracked unknown FeeEstimateHorizon\");\n    }\n    }\n}\n\nunsigned int CBlockPolicyEstimator::BlockSpan() const\n{\n    if (firstRecordedHeight == 0) return 0;\n    assert(nBestSeenHeight >= firstRecordedHeight);\n\n    return nBestSeenHeight - firstRecordedHeight;\n}\n\nunsigned int CBlockPolicyEstimator::HistoricalBlockSpan() const\n{\n    if (historicalFirst == 0) return 0;\n    assert(historicalBest >= historicalFirst);\n\n    if (nBestSeenHeight - historicalBest > OLDEST_ESTIMATE_HISTORY) return 0;\n\n    return historicalBest - historicalFirst;\n}\n\nunsigned int CBlockPolicyEstimator::MaxUsableEstimate() const\n{\n    // Block spans are divided by 2 to make sure there are enough potential failing data points for the estimate\n    return std::min(longStats->GetMaxConfirms(), std::max(BlockSpan(), HistoricalBlockSpan()) / 2);\n}\n\n/** Return a fee estimate at the required successThreshold from the shortest\n * time horizon which tracks confirmations up to the desired target.  If\n * checkShorterHorizon is requested, also allow short time horizon estimates\n * for a lower target to reduce the given answer */\ndouble CBlockPolicyEstimator::estimateCombinedFee(unsigned int confTarget, double successThreshold, bool checkShorterHorizon, EstimationResult *result) const\n{\n    double estimate = -1;\n    if (confTarget >= 1 && confTarget <= longStats->GetMaxConfirms()) {\n        // Find estimate from shortest time horizon possible\n        if (confTarget <= shortStats->GetMaxConfirms()) { // short horizon\n            estimate = shortStats->EstimateMedianVal(confTarget, SUFFICIENT_TXS_SHORT, successThreshold, true, nBestSeenHeight, result);\n        }\n        else if (confTarget <= feeStats->GetMaxConfirms()) { // medium horizon\n            estimate = feeStats->EstimateMedianVal(confTarget, SUFFICIENT_FEETXS, successThreshold, true, nBestSeenHeight, result);\n        }\n        else { // long horizon\n            estimate = longStats->EstimateMedianVal(confTarget, SUFFICIENT_FEETXS, successThreshold, true, nBestSeenHeight, result);\n        }\n        if (checkShorterHorizon) {\n            EstimationResult tempResult;\n            // If a lower confTarget from a more recent horizon returns a lower answer use it.\n            if (confTarget > feeStats->GetMaxConfirms()) {\n                double medMax = feeStats->EstimateMedianVal(feeStats->GetMaxConfirms(), SUFFICIENT_FEETXS, successThreshold, true, nBestSeenHeight, &tempResult);\n                if (medMax > 0 && (estimate == -1 || medMax < estimate)) {\n                    estimate = medMax;\n                    if (result) *result = tempResult;\n                }\n            }\n            if (confTarget > shortStats->GetMaxConfirms()) {\n                double shortMax = shortStats->EstimateMedianVal(shortStats->GetMaxConfirms(), SUFFICIENT_TXS_SHORT, successThreshold, true, nBestSeenHeight, &tempResult);\n                if (shortMax > 0 && (estimate == -1 || shortMax < estimate)) {\n                    estimate = shortMax;\n                    if (result) *result = tempResult;\n                }\n            }\n        }\n    }\n    return estimate;\n}\n\n/** Ensure that for a conservative estimate, the DOUBLE_SUCCESS_PCT is also met\n * at 2 * target for any longer time horizons.\n */\ndouble CBlockPolicyEstimator::estimateConservativeFee(unsigned int doubleTarget, EstimationResult *result) const\n{\n    double estimate = -1;\n    EstimationResult tempResult;\n    if (doubleTarget <= shortStats->GetMaxConfirms()) {\n        estimate = feeStats->EstimateMedianVal(doubleTarget, SUFFICIENT_FEETXS, DOUBLE_SUCCESS_PCT, true, nBestSeenHeight, result);\n    }\n    if (doubleTarget <= feeStats->GetMaxConfirms()) {\n        double longEstimate = longStats->EstimateMedianVal(doubleTarget, SUFFICIENT_FEETXS, DOUBLE_SUCCESS_PCT, true, nBestSeenHeight, &tempResult);\n        if (longEstimate > estimate) {\n            estimate = longEstimate;\n            if (result) *result = tempResult;\n        }\n    }\n    return estimate;\n}\n\n/** estimateSmartFee returns the max of the feerates calculated with a 60%\n * threshold required at target / 2, an 85% threshold required at target and a\n * 95% threshold required at 2 * target.  Each calculation is performed at the\n * shortest time horizon which tracks the required target.  Conservative\n * estimates, however, required the 95% threshold at 2 * target be met for any\n * longer time horizons also.\n */\nCFeeRate CBlockPolicyEstimator::estimateSmartFee(int confTarget, FeeCalculation *feeCalc, bool conservative) const\n{\n    LOCK(cs_feeEstimator);\n\n    if (feeCalc) {\n        feeCalc->desiredTarget = confTarget;\n        feeCalc->returnedTarget = confTarget;\n    }\n\n    double median = -1;\n    EstimationResult tempResult;\n\n    // Return failure if trying to analyze a target we're not tracking\n    if (confTarget <= 0 || (unsigned int)confTarget > longStats->GetMaxConfirms()) {\n        return CFeeRate(0);  // error condition\n    }\n\n    // It's not possible to get reasonable estimates for confTarget of 1\n    if (confTarget == 1) confTarget = 2;\n\n    unsigned int maxUsableEstimate = MaxUsableEstimate();\n    if ((unsigned int)confTarget > maxUsableEstimate) {\n        confTarget = maxUsableEstimate;\n    }\n    if (feeCalc) feeCalc->returnedTarget = confTarget;\n\n    if (confTarget <= 1) return CFeeRate(0); // error condition\n\n    assert(confTarget > 0); //estimateCombinedFee and estimateConservativeFee take unsigned ints\n    /** true is passed to estimateCombined fee for target/2 and target so\n     * that we check the max confirms for shorter time horizons as well.\n     * This is necessary to preserve monotonically increasing estimates.\n     * For non-conservative estimates we do the same thing for 2*target, but\n     * for conservative estimates we want to skip these shorter horizons\n     * checks for 2*target because we are taking the max over all time\n     * horizons so we already have monotonically increasing estimates and\n     * the purpose of conservative estimates is not to let short term\n     * fluctuations lower our estimates by too much.\n     */\n    double halfEst = estimateCombinedFee(confTarget/2, HALF_SUCCESS_PCT, true, &tempResult);\n    if (feeCalc) {\n        feeCalc->est = tempResult;\n        feeCalc->reason = FeeReason::HALF_ESTIMATE;\n    }\n    median = halfEst;\n    double actualEst = estimateCombinedFee(confTarget, SUCCESS_PCT, true, &tempResult);\n    if (actualEst > median) {\n        median = actualEst;\n        if (feeCalc) {\n            feeCalc->est = tempResult;\n            feeCalc->reason = FeeReason::FULL_ESTIMATE;\n        }\n    }\n    double doubleEst = estimateCombinedFee(2 * confTarget, DOUBLE_SUCCESS_PCT, !conservative, &tempResult);\n    if (doubleEst > median) {\n        median = doubleEst;\n        if (feeCalc) {\n            feeCalc->est = tempResult;\n            feeCalc->reason = FeeReason::DOUBLE_ESTIMATE;\n        }\n    }\n\n    if (conservative || median == -1) {\n        double consEst =  estimateConservativeFee(2 * confTarget, &tempResult);\n        if (consEst > median) {\n            median = consEst;\n            if (feeCalc) {\n                feeCalc->est = tempResult;\n                feeCalc->reason = FeeReason::CONSERVATIVE;\n            }\n        }\n    }\n\n    if (median < 0) return CFeeRate(0); // error condition\n\n    return CFeeRate(llround(median));\n}\n\n\nbool CBlockPolicyEstimator::Write(CAutoFile& fileout) const\n{\n    try {\n        LOCK(cs_feeEstimator);\n        fileout << 149900; // version required to read: 0.14.99 or later\n        fileout << CLIENT_VERSION; // version that wrote the file\n        fileout << nBestSeenHeight;\n        if (BlockSpan() > HistoricalBlockSpan()/2) {\n            fileout << firstRecordedHeight << nBestSeenHeight;\n        }\n        else {\n            fileout << historicalFirst << historicalBest;\n        }\n        fileout << buckets;\n        feeStats->Write(fileout);\n        shortStats->Write(fileout);\n        longStats->Write(fileout);\n    }\n    catch (const std::exception&) {\n        LogPrintf(\"CBlockPolicyEstimator::Write(): unable to write policy estimator data (non-fatal)\\n\");\n        return false;\n    }\n    return true;\n}\n\nbool CBlockPolicyEstimator::Read(CAutoFile& filein)\n{\n    try {\n        LOCK(cs_feeEstimator);\n        int nVersionRequired, nVersionThatWrote;\n        filein >> nVersionRequired >> nVersionThatWrote;\n        if (nVersionRequired > CLIENT_VERSION)\n            return error(\"CBlockPolicyEstimator::Read(): up-version (%d) fee estimate file\", nVersionRequired);\n\n        // Read fee estimates file into temporary variables so existing data\n        // structures aren't corrupted if there is an exception.\n        unsigned int nFileBestSeenHeight;\n        filein >> nFileBestSeenHeight;\n\n        if (nVersionRequired < 149900) {\n            LogPrintf(\"%s: incompatible old fee estimation data (non-fatal). Version: %d\\n\", __func__, nVersionRequired);\n        } else { // New format introduced in 149900\n            unsigned int nFileHistoricalFirst, nFileHistoricalBest;\n            filein >> nFileHistoricalFirst >> nFileHistoricalBest;\n            if (nFileHistoricalFirst > nFileHistoricalBest || nFileHistoricalBest > nFileBestSeenHeight) {\n                throw std::runtime_error(\"Corrupt estimates file. Historical block range for estimates is invalid\");\n            }\n            std::vector<double> fileBuckets;\n            filein >> fileBuckets;\n            size_t numBuckets = fileBuckets.size();\n            if (numBuckets <= 1 || numBuckets > 1000)\n                throw std::runtime_error(\"Corrupt estimates file. Must have between 2 and 1000 feerate buckets\");\n\n            std::unique_ptr<TxConfirmStats> fileFeeStats(new TxConfirmStats(buckets, bucketMap, MED_BLOCK_PERIODS, MED_DECAY, MED_SCALE));\n            std::unique_ptr<TxConfirmStats> fileShortStats(new TxConfirmStats(buckets, bucketMap, SHORT_BLOCK_PERIODS, SHORT_DECAY, SHORT_SCALE));\n            std::unique_ptr<TxConfirmStats> fileLongStats(new TxConfirmStats(buckets, bucketMap, LONG_BLOCK_PERIODS, LONG_DECAY, LONG_SCALE));\n            fileFeeStats->Read(filein, nVersionThatWrote, numBuckets);\n            fileShortStats->Read(filein, nVersionThatWrote, numBuckets);\n            fileLongStats->Read(filein, nVersionThatWrote, numBuckets);\n\n            // Fee estimates file parsed correctly\n            // Copy buckets from file and refresh our bucketmap\n            buckets = fileBuckets;\n            bucketMap.clear();\n            for (unsigned int i = 0; i < buckets.size(); i++) {\n                bucketMap[buckets[i]] = i;\n            }\n\n            // Destroy old TxConfirmStats and point to new ones that already reference buckets and bucketMap\n            feeStats = std::move(fileFeeStats);\n            shortStats = std::move(fileShortStats);\n            longStats = std::move(fileLongStats);\n\n            nBestSeenHeight = nFileBestSeenHeight;\n            historicalFirst = nFileHistoricalFirst;\n            historicalBest = nFileHistoricalBest;\n        }\n    }\n    catch (const std::exception& e) {\n        LogPrintf(\"CBlockPolicyEstimator::Read(): unable to read policy estimator data (non-fatal): %s\\n\",e.what());\n        return false;\n    }\n    return true;\n}\n\nvoid CBlockPolicyEstimator::FlushUnconfirmed(CTxMemPool& pool) {\n    int64_t startclear = GetTimeMicros();\n    std::vector<uint256> txids;\n    pool.queryHashes(txids);\n    LOCK(cs_feeEstimator);\n    for (auto& txid : txids) {\n        removeTx(txid, false);\n    }\n    int64_t endclear = GetTimeMicros();\n    LogPrint(BCLog::ESTIMATEFEE, \"Recorded %u unconfirmed txs from mempool in %gs\\n\",txids.size(), (endclear - startclear)*0.000001);\n}\n\nFeeFilterRounder::FeeFilterRounder(const CFeeRate& minIncrementalFee)\n{\n    CAmount minFeeLimit = std::max(CAmount(1), minIncrementalFee.GetFeePerK() / 2);\n    feeset.insert(0);\n    for (double bucketBoundary = minFeeLimit; bucketBoundary <= MAX_FILTER_FEERATE; bucketBoundary *= FEE_FILTER_SPACING) {\n        feeset.insert(bucketBoundary);\n    }\n}\n\nCAmount FeeFilterRounder::round(CAmount currentMinFee)\n{\n    std::set<double>::iterator it = feeset.lower_bound(currentMinFee);\n    if ((it != feeset.begin() && insecure_rand.rand32() % 3 != 0) || it == feeset.end()) {\n        it--;\n    }\n    return static_cast<CAmount>(*it);\n}\n"
  },
  {
    "path": "src/policy/fees.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#ifndef BITCOIN_POLICYESTIMATOR_H\n#define BITCOIN_POLICYESTIMATOR_H\n\n#include <amount.h>\n#include <policy/feerate.h>\n#include <uint256.h>\n#include <random.h>\n#include <sync.h>\n\n#include <map>\n#include <memory>\n#include <string>\n#include <vector>\n\nclass CAutoFile;\nclass CFeeRate;\nclass CTxMemPoolEntry;\nclass CTxMemPool;\nclass TxConfirmStats;\n\n/** \\class CBlockPolicyEstimator\n * The BlockPolicyEstimator is used for estimating the feerate needed\n * for a transaction to be included in a block within a certain number of\n * blocks.\n *\n * At a high level the algorithm works by grouping transactions into buckets\n * based on having similar feerates and then tracking how long it\n * takes transactions in the various buckets to be mined.  It operates under\n * the assumption that in general transactions of higher feerate will be\n * included in blocks before transactions of lower feerate.   So for\n * example if you wanted to know what feerate you should put on a transaction to\n * be included in a block within the next 5 blocks, you would start by looking\n * at the bucket with the highest feerate transactions and verifying that a\n * sufficiently high percentage of them were confirmed within 5 blocks and\n * then you would look at the next highest feerate bucket, and so on, stopping at\n * the last bucket to pass the test.   The average feerate of transactions in this\n * bucket will give you an indication of the lowest feerate you can put on a\n * transaction and still have a sufficiently high chance of being confirmed\n * within your desired 5 blocks.\n *\n * Here is a brief description of the implementation:\n * When a transaction enters the mempool, we track the height of the block chain\n * at entry.  All further calculations are conducted only on this set of \"seen\"\n * transactions. Whenever a block comes in, we count the number of transactions\n * in each bucket and the total amount of feerate paid in each bucket. Then we\n * calculate how many blocks Y it took each transaction to be mined.  We convert\n * from a number of blocks to a number of periods Y' each encompassing \"scale\"\n * blocks.  This is tracked in 3 different data sets each up to a maximum\n * number of periods. Within each data set we have an array of counters in each\n * feerate bucket and we increment all the counters from Y' up to max periods\n * representing that a tx was successfully confirmed in less than or equal to\n * that many periods. We want to save a history of this information, so at any\n * time we have a counter of the total number of transactions that happened in a\n * given feerate bucket and the total number that were confirmed in each of the\n * periods or less for any bucket.  We save this history by keeping an\n * exponentially decaying moving average of each one of these stats.  This is\n * done for a different decay in each of the 3 data sets to keep relevant data\n * from different time horizons.  Furthermore we also keep track of the number\n * unmined (in mempool or left mempool without being included in a block)\n * transactions in each bucket and for how many blocks they have been\n * outstanding and use both of these numbers to increase the number of transactions\n * we've seen in that feerate bucket when calculating an estimate for any number\n * of confirmations below the number of blocks they've been outstanding.\n */\n\n/* Identifier for each of the 3 different TxConfirmStats which will track\n * history over different time horizons. */\nenum FeeEstimateHorizon {\n    SHORT_HALFLIFE = 0,\n    MED_HALFLIFE = 1,\n    LONG_HALFLIFE = 2\n};\n\nstd::string StringForFeeEstimateHorizon(FeeEstimateHorizon horizon);\n\n/* Enumeration of reason for returned fee estimate */\nenum class FeeReason {\n    NONE,\n    HALF_ESTIMATE,\n    FULL_ESTIMATE,\n    DOUBLE_ESTIMATE,\n    CONSERVATIVE,\n    MEMPOOL_MIN,\n    PAYTXFEE,\n    FALLBACK,\n    REQUIRED,\n    MAXTXFEE,\n};\n\nstd::string StringForFeeReason(FeeReason reason);\n\n/* Used to determine type of fee estimation requested */\nenum class FeeEstimateMode {\n    UNSET,        //! Use default settings based on other criteria\n    ECONOMICAL,   //! Force estimateSmartFee to use non-conservative estimates\n    CONSERVATIVE, //! Force estimateSmartFee to use conservative estimates\n};\n\nbool FeeModeFromString(const std::string& mode_string, FeeEstimateMode& fee_estimate_mode);\n\n/* Used to return detailed information about a feerate bucket */\nstruct EstimatorBucket\n{\n    double start = -1;\n    double end = -1;\n    double withinTarget = 0;\n    double totalConfirmed = 0;\n    double inMempool = 0;\n    double leftMempool = 0;\n};\n\n/* Used to return detailed information about a fee estimate calculation */\nstruct EstimationResult\n{\n    EstimatorBucket pass;\n    EstimatorBucket fail;\n    double decay = 0;\n    unsigned int scale = 0;\n};\n\nstruct FeeCalculation\n{\n    EstimationResult est;\n    FeeReason reason = FeeReason::NONE;\n    int desiredTarget = 0;\n    int returnedTarget = 0;\n};\n\n/**\n *  We want to be able to estimate feerates that are needed on tx's to be included in\n * a certain number of blocks.  Every time a block is added to the best chain, this class records\n * stats on the transactions included in that block\n */\nclass CBlockPolicyEstimator\n{\nprivate:\n    /** Track confirm delays up to 12 blocks for short horizon */\n    static constexpr unsigned int SHORT_BLOCK_PERIODS = 12;\n    static constexpr unsigned int SHORT_SCALE = 1;\n    /** Track confirm delays up to 48 blocks for medium horizon */\n    static constexpr unsigned int MED_BLOCK_PERIODS = 24;\n    static constexpr unsigned int MED_SCALE = 2;\n    /** Track confirm delays up to 1008 blocks for long horizon */\n    static constexpr unsigned int LONG_BLOCK_PERIODS = 42;\n    static constexpr unsigned int LONG_SCALE = 24;\n    /** Historical estimates that are older than this aren't valid */\n    static const unsigned int OLDEST_ESTIMATE_HISTORY = 6 * 1008;\n\n    /** Decay of .962 is a half-life of 18 blocks or about 3 hours */\n    static constexpr double SHORT_DECAY = .962;\n    /** Decay of .998 is a half-life of 144 blocks or about 1 day */\n    static constexpr double MED_DECAY = .9952;\n    /** Decay of .9995 is a half-life of 1008 blocks or about 1 week */\n    static constexpr double LONG_DECAY = .99931;\n\n    /** Require greater than 60% of X feerate transactions to be confirmed within Y/2 blocks*/\n    static constexpr double HALF_SUCCESS_PCT = .6;\n    /** Require greater than 85% of X feerate transactions to be confirmed within Y blocks*/\n    static constexpr double SUCCESS_PCT = .85;\n    /** Require greater than 95% of X feerate transactions to be confirmed within 2 * Y blocks*/\n    static constexpr double DOUBLE_SUCCESS_PCT = .95;\n\n    /** Require an avg of 0.1 tx in the combined feerate bucket per block to have stat significance */\n    static constexpr double SUFFICIENT_FEETXS = 0.1;\n    /** Require an avg of 0.5 tx when using short decay since there are fewer blocks considered*/\n    static constexpr double SUFFICIENT_TXS_SHORT = 0.5;\n\n    /** Minimum and Maximum values for tracking feerates\n     * The MIN_BUCKET_FEERATE should just be set to the lowest reasonable feerate we\n     * might ever want to track.  Historically this has been 1000 since it was\n     * inheriting DEFAULT_MIN_RELAY_TX_FEE and changing it is disruptive as it\n     * invalidates old estimates files. So leave it at 1000 unless it becomes\n     * necessary to lower it, and then lower it substantially.\n     */\n    static constexpr double MIN_BUCKET_FEERATE = 1000;\n    static constexpr double MAX_BUCKET_FEERATE = 1e7;\n\n    /** Spacing of FeeRate buckets\n     * We have to lump transactions into buckets based on feerate, but we want to be able\n     * to give accurate estimates over a large range of potential feerates\n     * Therefore it makes sense to exponentially space the buckets\n     */\n    static constexpr double FEE_SPACING = 1.05;\n\npublic:\n    /** Create new BlockPolicyEstimator and initialize stats tracking classes with default values */\n    CBlockPolicyEstimator();\n    ~CBlockPolicyEstimator();\n\n    /** Process all the transactions that have been included in a block */\n    void processBlock(unsigned int nBlockHeight,\n                      std::vector<const CTxMemPoolEntry*>& entries);\n\n    /** Process a transaction accepted to the mempool*/\n    void processTransaction(const CTxMemPoolEntry& entry, bool validFeeEstimate);\n\n    /** Remove a transaction from the mempool tracking stats*/\n    bool removeTx(uint256 hash, bool inBlock);\n\n    /** DEPRECATED. Return a feerate estimate */\n    CFeeRate estimateFee(int confTarget) const;\n\n    /** Estimate feerate needed to get be included in a block within confTarget\n     *  blocks. If no answer can be given at confTarget, return an estimate at\n     *  the closest target where one can be given.  'conservative' estimates are\n     *  valid over longer time horizons also.\n     */\n    CFeeRate estimateSmartFee(int confTarget, FeeCalculation *feeCalc, bool conservative) const;\n\n    /** Return a specific fee estimate calculation with a given success\n     * threshold and time horizon, and optionally return detailed data about\n     * calculation\n     */\n    CFeeRate estimateRawFee(int confTarget, double successThreshold, FeeEstimateHorizon horizon, EstimationResult *result = nullptr) const;\n\n    /** Write estimation data to a file */\n    bool Write(CAutoFile& fileout) const;\n\n    /** Read estimation data from a file */\n    bool Read(CAutoFile& filein);\n\n    /** Empty mempool transactions on shutdown to record failure to confirm for txs still in mempool */\n    void FlushUnconfirmed(CTxMemPool& pool);\n\n    /** Calculation of highest target that estimates are tracked for */\n    unsigned int HighestTargetTracked(FeeEstimateHorizon horizon) const;\n\nprivate:\n    unsigned int nBestSeenHeight;\n    unsigned int firstRecordedHeight;\n    unsigned int historicalFirst;\n    unsigned int historicalBest;\n\n    struct TxStatsInfo\n    {\n        unsigned int blockHeight;\n        unsigned int bucketIndex;\n        TxStatsInfo() : blockHeight(0), bucketIndex(0) {}\n    };\n\n    // map of txids to information about that transaction\n    std::map<uint256, TxStatsInfo> mapMemPoolTxs;\n\n    /** Classes to track historical data on transaction confirmations */\n    std::unique_ptr<TxConfirmStats> feeStats;\n    std::unique_ptr<TxConfirmStats> shortStats;\n    std::unique_ptr<TxConfirmStats> longStats;\n\n    unsigned int trackedTxs;\n    unsigned int untrackedTxs;\n\n    std::vector<double> buckets;              // The upper-bound of the range for the bucket (inclusive)\n    std::map<double, unsigned int> bucketMap; // Map of bucket upper-bound to index into all vectors by bucket\n\n    mutable CCriticalSection cs_feeEstimator;\n\n    /** Process a transaction confirmed in a block*/\n    bool processBlockTx(unsigned int nBlockHeight, const CTxMemPoolEntry* entry);\n\n    /** Helper for estimateSmartFee */\n    double estimateCombinedFee(unsigned int confTarget, double successThreshold, bool checkShorterHorizon, EstimationResult *result) const;\n    /** Helper for estimateSmartFee */\n    double estimateConservativeFee(unsigned int doubleTarget, EstimationResult *result) const;\n    /** Number of blocks of data recorded while fee estimates have been running */\n    unsigned int BlockSpan() const;\n    /** Number of blocks of recorded fee estimate data represented in saved data file */\n    unsigned int HistoricalBlockSpan() const;\n    /** Calculation of highest target that reasonable estimate can be provided for */\n    unsigned int MaxUsableEstimate() const;\n};\n\nclass FeeFilterRounder\n{\nprivate:\n    static constexpr double MAX_FILTER_FEERATE = 1e7;\n    /** FEE_FILTER_SPACING is just used to provide some quantization of fee\n     * filter results.  Historically it reused FEE_SPACING, but it is completely\n     * unrelated, and was made a separate constant so the two concepts are not\n     * tied together */\n    static constexpr double FEE_FILTER_SPACING = 1.1;\n\npublic:\n    /** Create new FeeFilterRounder */\n    explicit FeeFilterRounder(const CFeeRate& minIncrementalFee);\n\n    /** Quantize a minimum fee for privacy purpose before broadcast **/\n    CAmount round(CAmount currentMinFee);\n\nprivate:\n    std::set<double> feeset;\n    FastRandomContext insecure_rand;\n};\n\n#endif /*BITCOIN_POLICYESTIMATOR_H */\n"
  },
  {
    "path": "src/policy/policy.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n// NOTE: This file is intended to be customised by the end user, and includes only local node policy logic\n\n#include <policy/policy.h>\n\n#include <consensus/validation.h>\n#include <validation.h>\n#include <coins.h>\n#include <tinyformat.h>\n#include <util.h>\n#include <utilstrencodings.h>\n\n\nCAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFeeIn)\n{\n    // \"Dust\" is defined in terms of dustRelayFee,\n    // which has units satoshis-per-kilobyte.\n    // If you'd pay more in fees than the value of the output\n    // to spend something, then we consider it dust.\n    // A typical spendable non-segwit txout is 34 bytes big, and will\n    // need a CTxIn of at least 148 bytes to spend:\n    // so dust is a spendable txout less than\n    // 182*dustRelayFee/1000 (in satoshis).\n    // 546 satoshis at the default rate of 3000 sat/kB.\n    // A typical spendable segwit txout is 31 bytes big, and will\n    // need a CTxIn of at least 67 bytes to spend:\n    // so dust is a spendable txout less than\n    // 98*dustRelayFee/1000 (in satoshis).\n    // 294 satoshis at the default rate of 3000 sat/kB.\n    if (txout.scriptPubKey.IsUnspendable())\n        return 0;\n\n    size_t nSize = GetSerializeSize(txout, SER_DISK, 0);\n    int witnessversion = 0;\n    std::vector<unsigned char> witnessprogram;\n\n    if (txout.scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {\n        // sum the sizes of the parts of a transaction input\n        // with 75% segwit discount applied to the script size.\n        nSize += (32 + 4 + 1 + (107 / WITNESS_SCALE_FACTOR) + 4);\n    } else {\n        nSize += (32 + 4 + 1 + 107 + 4); // the 148 mentioned above\n    }\n\n    return dustRelayFeeIn.GetFee(nSize);\n}\n\nbool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFeeIn)\n{\n    return (txout.nValue < GetDustThreshold(txout, dustRelayFeeIn));\n}\n\nbool IsStandard(const CScript& scriptPubKey, txnouttype& whichType, const bool witnessEnabled)\n{\n    std::vector<std::vector<unsigned char> > vSolutions;\n    if (!Solver(scriptPubKey, whichType, vSolutions))\n        return false;\n\n    if (whichType == TX_MULTISIG)\n    {\n        unsigned char m = vSolutions.front()[0];\n        unsigned char n = vSolutions.back()[0];\n        // Support up to x-of-3 multisig txns as standard\n        if (n < 1 || n > 3)\n            return false;\n        if (m < 1 || m > n)\n            return false;\n    } else if (whichType == TX_NULL_DATA &&\n               (!fAcceptDatacarrier || scriptPubKey.size() > nMaxDatacarrierBytes))\n          return false;\n\n    else if (!witnessEnabled && (whichType == TX_WITNESS_V0_KEYHASH || whichType == TX_WITNESS_V0_SCRIPTHASH))\n        return false;\n\n    return whichType != TX_NONSTANDARD && whichType != TX_WITNESS_UNKNOWN;\n}\n\nbool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnessEnabled)\n{\n    if (tx.nVersion > CTransaction::MAX_STANDARD_VERSION || tx.nVersion < 1) {\n        reason = \"version\";\n        return false;\n    }\n\n    // Extremely large transactions with lots of inputs can cost the network\n    // almost as much to process as they cost the sender in fees, because\n    // computing signature hashes is O(ninputs*txsize). Limiting transactions\n    // to MAX_STANDARD_TX_WEIGHT mitigates CPU exhaustion attacks.\n    unsigned int sz = GetTransactionWeight(tx);\n    if (sz >= MAX_STANDARD_TX_WEIGHT) {\n        reason = \"tx-size\";\n        return false;\n    }\n\n    for (const CTxIn& txin : tx.vin)\n    {\n        // Biggest 'standard' txin is a 15-of-15 P2SH multisig with compressed\n        // keys (remember the 520 byte limit on redeemScript size). That works\n        // out to a (15*(33+1))+3=513 byte redeemScript, 513+1+15*(73+1)+3=1627\n        // bytes of scriptSig, which we round off to 1650 bytes for some minor\n        // future-proofing. That's also enough to spend a 20-of-20\n        // CHECKMULTISIG scriptPubKey, though such a scriptPubKey is not\n        // considered standard.\n        if (txin.scriptSig.size() > 1650) {\n            reason = \"scriptsig-size\";\n            return false;\n        }\n        if (!txin.scriptSig.IsPushOnly()) {\n            reason = \"scriptsig-not-pushonly\";\n            return false;\n        }\n    }\n\n    unsigned int nDataOut = 0;\n    txnouttype whichType;\n    for (const CTxOut& txout : tx.vout) {\n        if (!::IsStandard(txout.scriptPubKey, whichType, witnessEnabled)) {\n            reason = \"scriptpubkey\";\n            return false;\n        }\n\n        if (whichType == TX_NULL_DATA)\n            nDataOut++;\n        else if ((whichType == TX_MULTISIG) && (!fIsBareMultisigStd)) {\n            reason = \"bare-multisig\";\n            return false;\n        } else if (IsDust(txout, ::dustRelayFee)) {\n            reason = \"dust\";\n            return false;\n        }\n    }\n\n    // only one OP_RETURN txout is permitted\n    if (nDataOut > 1) {\n        reason = \"multi-op-return\";\n        return false;\n    }\n\n    return true;\n}\n\n/**\n * Check transaction inputs to mitigate two\n * potential denial-of-service attacks:\n *\n * 1. scriptSigs with extra data stuffed into them,\n *    not consumed by scriptPubKey (or P2SH script)\n * 2. P2SH scripts with a crazy number of expensive\n *    CHECKSIG/CHECKMULTISIG operations\n *\n * Why bother? To avoid denial-of-service attacks; an attacker\n * can submit a standard HASH... OP_EQUAL transaction,\n * which will get accepted into blocks. The redemption\n * script can be anything; an attacker could use a very\n * expensive-to-check-upon-redemption script like:\n *   DUP CHECKSIG DROP ... repeated 100 times... OP_1\n */\nbool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs)\n{\n    if (tx.IsCoinBase())\n        return true; // Coinbases don't use vin normally\n\n    for (unsigned int i = 0; i < tx.vin.size(); i++)\n    {\n        const CTxOut& prev = mapInputs.AccessCoin(tx.vin[i].prevout).out;\n\n        std::vector<std::vector<unsigned char> > vSolutions;\n        txnouttype whichType;\n        // get the scriptPubKey corresponding to this input:\n        const CScript& prevScript = prev.scriptPubKey;\n        if (!Solver(prevScript, whichType, vSolutions))\n            return false;\n\n        if (whichType == TX_SCRIPTHASH)\n        {\n            std::vector<std::vector<unsigned char> > stack;\n            // convert the scriptSig into a stack, so we can inspect the redeemScript\n            if (!EvalScript(stack, tx.vin[i].scriptSig, SCRIPT_VERIFY_NONE, BaseSignatureChecker(), SIGVERSION_BASE))\n                return false;\n            if (stack.empty())\n                return false;\n            CScript subscript(stack.back().begin(), stack.back().end());\n            if (subscript.GetSigOpCount(true) > MAX_P2SH_SIGOPS) {\n                return false;\n            }\n        }\n    }\n\n    return true;\n}\n\nbool IsWitnessStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs)\n{\n    if (tx.IsCoinBase())\n        return true; // Coinbases are skipped\n\n    for (unsigned int i = 0; i < tx.vin.size(); i++)\n    {\n        // We don't care if witness for this input is empty, since it must not be bloated.\n        // If the script is invalid without witness, it would be caught sooner or later during validation.\n        if (tx.vin[i].scriptWitness.IsNull())\n            continue;\n\n        const CTxOut &prev = mapInputs.AccessCoin(tx.vin[i].prevout).out;\n\n        // get the scriptPubKey corresponding to this input:\n        CScript prevScript = prev.scriptPubKey;\n\n        if (prevScript.IsPayToScriptHash()) {\n            std::vector <std::vector<unsigned char> > stack;\n            // If the scriptPubKey is P2SH, we try to extract the redeemScript casually by converting the scriptSig\n            // into a stack. We do not check IsPushOnly nor compare the hash as these will be done later anyway.\n            // If the check fails at this stage, we know that this txid must be a bad one.\n            if (!EvalScript(stack, tx.vin[i].scriptSig, SCRIPT_VERIFY_NONE, BaseSignatureChecker(), SIGVERSION_BASE))\n                return false;\n            if (stack.empty())\n                return false;\n            prevScript = CScript(stack.back().begin(), stack.back().end());\n        }\n\n        int witnessversion = 0;\n        std::vector<unsigned char> witnessprogram;\n\n        // Non-witness program must not be associated with any witness\n        if (!prevScript.IsWitnessProgram(witnessversion, witnessprogram))\n            return false;\n\n        // Check P2WSH standard limits\n        if (witnessversion == 0 && witnessprogram.size() == 32) {\n            if (tx.vin[i].scriptWitness.stack.back().size() > MAX_STANDARD_P2WSH_SCRIPT_SIZE)\n                return false;\n            size_t sizeWitnessStack = tx.vin[i].scriptWitness.stack.size() - 1;\n            if (sizeWitnessStack > MAX_STANDARD_P2WSH_STACK_ITEMS)\n                return false;\n            for (unsigned int j = 0; j < sizeWitnessStack; j++) {\n                if (tx.vin[i].scriptWitness.stack[j].size() > MAX_STANDARD_P2WSH_STACK_ITEM_SIZE)\n                    return false;\n            }\n        }\n    }\n    return true;\n}\n\nCFeeRate incrementalRelayFee = CFeeRate(DEFAULT_INCREMENTAL_RELAY_FEE);\nCFeeRate dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE);\nunsigned int nBytesPerSigOp = DEFAULT_BYTES_PER_SIGOP;\n\nint64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost)\n{\n    return (std::max(nWeight, nSigOpCost * nBytesPerSigOp) + WITNESS_SCALE_FACTOR - 1) / WITNESS_SCALE_FACTOR;\n}\n\nint64_t GetVirtualTransactionSize(const CTransaction& tx, int64_t nSigOpCost)\n{\n    return GetVirtualTransactionSize(GetTransactionWeight(tx), nSigOpCost);\n}\n"
  },
  {
    "path": "src/policy/policy.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_POLICY_POLICY_H\n#define BITCOIN_POLICY_POLICY_H\n\n#include <consensus/consensus.h>\n#include <policy/feerate.h>\n#include <script/interpreter.h>\n#include <script/standard.h>\n\n#include <string>\n\nclass CCoinsViewCache;\nclass CTxOut;\n\n/** Default for -blockmaxweight, which controls the range of block weights the mining code will create **/\nstatic const unsigned int DEFAULT_BLOCK_MAX_WEIGHT = MAX_BLOCK_WEIGHT - 4000;\n/** Default for -blockmintxfee, which sets the minimum feerate for a transaction in blocks created by mining code **/\nstatic const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 1000;\n/** The maximum weight for transactions we're willing to relay/mine */\nstatic const unsigned int MAX_STANDARD_TX_WEIGHT = 400000;\n/** The minimum non-witness size for transactions we're willing to relay/mine (1 segwit input + 1 P2WPKH output = 82 bytes) */\nstatic const unsigned int MIN_STANDARD_TX_NONWITNESS_SIZE = 82;\n/** Maximum number of signature check operations in an IsStandard() P2SH script */\nstatic const unsigned int MAX_P2SH_SIGOPS = 15;\n/** The maximum number of sigops we're willing to relay/mine in a single tx */\nstatic const unsigned int MAX_STANDARD_TX_SIGOPS_COST = MAX_BLOCK_SIGOPS_COST/5;\n/** Default for -maxmempool, maximum megabytes of mempool memory usage */\nstatic const unsigned int DEFAULT_MAX_MEMPOOL_SIZE = 300;\n/** Default for -incrementalrelayfee, which sets the minimum feerate increase for mempool limiting or BIP 125 replacement **/\nstatic const unsigned int DEFAULT_INCREMENTAL_RELAY_FEE = 1000;\n/** Default for -bytespersigop */\nstatic const unsigned int DEFAULT_BYTES_PER_SIGOP = 20;\n/** The maximum number of witness stack items in a standard P2WSH script */\nstatic const unsigned int MAX_STANDARD_P2WSH_STACK_ITEMS = 100;\n/** The maximum size of each witness stack item in a standard P2WSH script */\nstatic const unsigned int MAX_STANDARD_P2WSH_STACK_ITEM_SIZE = 80;\n/** The maximum size of a standard witnessScript */\nstatic const unsigned int MAX_STANDARD_P2WSH_SCRIPT_SIZE = 3600;\n/** Min feerate for defining dust. Historically this has been based on the\n * minRelayTxFee, however changing the dust limit changes which transactions are\n * standard and should be done with care and ideally rarely. It makes sense to\n * only increase the dust limit after prior releases were already not creating\n * outputs below the new threshold */\nstatic const unsigned int DUST_RELAY_TX_FEE = 3000;\n/**\n * Standard script verification flags that standard transactions will comply\n * with. However scripts violating these flags may still be present in valid\n * blocks and we must accept those blocks.\n */\nstatic constexpr unsigned int STANDARD_SCRIPT_VERIFY_FLAGS = MANDATORY_SCRIPT_VERIFY_FLAGS |\n                                                             SCRIPT_VERIFY_DERSIG |\n                                                             SCRIPT_VERIFY_STRICTENC |\n                                                             SCRIPT_VERIFY_MINIMALDATA |\n                                                             SCRIPT_VERIFY_NULLDUMMY |\n                                                             SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS |\n                                                             SCRIPT_VERIFY_CLEANSTACK |\n                                                             SCRIPT_VERIFY_MINIMALIF |\n                                                             SCRIPT_VERIFY_NULLFAIL |\n                                                             SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY |\n                                                             SCRIPT_VERIFY_CHECKSEQUENCEVERIFY |\n                                                             SCRIPT_VERIFY_LOW_S |\n                                                             SCRIPT_VERIFY_WITNESS |\n                                                             SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM |\n                                                             SCRIPT_VERIFY_WITNESS_PUBKEYTYPE |\n                                                             SCRIPT_VERIFY_CONST_SCRIPTCODE;\n\n/** For convenience, standard but not mandatory verify flags. */\nstatic constexpr unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS = STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS;\n\n/** Used as the flags parameter to sequence and nLocktime checks in non-consensus code. */\nstatic constexpr unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_VERIFY_SEQUENCE |\n                                                               LOCKTIME_MEDIAN_TIME_PAST;\n\nCAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFee);\n\nbool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFee);\n\nbool IsStandard(const CScript& scriptPubKey, txnouttype& whichType, const bool witnessEnabled = false);\n    /**\n     * Check for standard transaction types\n     * @return True if all outputs (scriptPubKeys) use only standard transaction forms\n     */\nbool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnessEnabled = false);\n    /**\n     * Check for standard transaction types\n     * @param[in] mapInputs    Map of previous transactions that have outputs we're spending\n     * @return True if all inputs (scriptSigs) use only standard transaction forms\n     */\nbool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs);\n    /**\n     * Check if the transaction is over standard P2WSH resources limit:\n     * 3600bytes witnessScript size, 80bytes per witness stack element, 100 witness stack elements\n     * These limits are adequate for multi-signature up to n-of-100 using OP_CHECKSIG, OP_ADD, and OP_EQUAL,\n     */\nbool IsWitnessStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs);\n\nextern CFeeRate incrementalRelayFee;\nextern CFeeRate dustRelayFee;\nextern unsigned int nBytesPerSigOp;\n\n/** Compute the virtual transaction size (weight reinterpreted as bytes). */\nint64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost);\nint64_t GetVirtualTransactionSize(const CTransaction& tx, int64_t nSigOpCost = 0);\n\n#endif // BITCOIN_POLICY_POLICY_H\n"
  },
  {
    "path": "src/policy/rbf.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <policy/rbf.h>\n\nbool SignalsOptInRBF(const CTransaction &tx)\n{\n    for (const CTxIn &txin : tx.vin) {\n        if (txin.nSequence < std::numeric_limits<unsigned int>::max()-1) {\n            return true;\n        }\n    }\n    return false;\n}\n\nRBFTransactionState IsRBFOptIn(const CTransaction &tx, CTxMemPool &pool)\n{\n    AssertLockHeld(pool.cs);\n\n    CTxMemPool::setEntries setAncestors;\n\n    // First check the transaction itself.\n    if (SignalsOptInRBF(tx)) {\n        return RBF_TRANSACTIONSTATE_REPLACEABLE_BIP125;\n    }\n\n    // If this transaction is not in our mempool, then we can't be sure\n    // we will know about all its inputs.\n    if (!pool.exists(tx.GetHash())) {\n        return RBF_TRANSACTIONSTATE_UNKNOWN;\n    }\n\n    // If all the inputs have nSequence >= maxint-1, it still might be\n    // signaled for RBF if any unconfirmed parents have signaled.\n    uint64_t noLimit = std::numeric_limits<uint64_t>::max();\n    std::string dummy;\n    CTxMemPoolEntry entry = *pool.mapTx.find(tx.GetHash());\n    pool.CalculateMemPoolAncestors(entry, setAncestors, noLimit, noLimit, noLimit, noLimit, dummy, false);\n\n    for (CTxMemPool::txiter it : setAncestors) {\n        if (SignalsOptInRBF(it->GetTx())) {\n            return RBF_TRANSACTIONSTATE_REPLACEABLE_BIP125;\n        }\n    }\n    return RBF_TRANSACTIONSTATE_FINAL;\n}\n"
  },
  {
    "path": "src/policy/rbf.h",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_POLICY_RBF_H\n#define BITCOIN_POLICY_RBF_H\n\n#include <txmempool.h>\n\nstatic const uint32_t MAX_BIP125_RBF_SEQUENCE = 0xfffffffd;\n\nenum RBFTransactionState {\n    RBF_TRANSACTIONSTATE_UNKNOWN,\n    RBF_TRANSACTIONSTATE_REPLACEABLE_BIP125,\n    RBF_TRANSACTIONSTATE_FINAL\n};\n\n// Check whether the sequence numbers on this transaction are signaling\n// opt-in to replace-by-fee, according to BIP 125\nbool SignalsOptInRBF(const CTransaction &tx);\n\n// Determine whether an in-mempool transaction is signaling opt-in to RBF\n// according to BIP 125\n// This involves checking sequence numbers of the transaction, as well\n// as the sequence numbers of all in-mempool ancestors.\nRBFTransactionState IsRBFOptIn(const CTransaction &tx, CTxMemPool &pool);\n\n#endif // BITCOIN_POLICY_RBF_H\n"
  },
  {
    "path": "src/pow.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2016-2018 The Zcash developers - DigiShieldZEC\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <pow.h>\n\n#include <arith_uint256.h>\n#include <chain.h>\n#include <primitives/block.h>\n#include <uint256.h>\n\nunsigned int GetNextWorkRequired_BTC(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)\n{\n    assert(pindexLast != nullptr);\n    unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact();\n\n    // Only change once per difficulty adjustment interval\n    if ((pindexLast->nHeight+1) % params.DifficultyAdjustmentInterval() != 0)\n    {\n        if (params.fPowAllowMinDifficultyBlocks)\n        {\n            // Special difficulty rule for testnet:\n            // If the new block's timestamp is more than 2* 10 minutes\n            // then allow mining of a min-difficulty block.\n            if (pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing*2)\n                return nProofOfWorkLimit;\n            else\n            {\n                // Return the last non-special-min-difficulty-rules-block\n                const CBlockIndex* pindex = pindexLast;\n                while (pindex->pprev && pindex->nHeight % params.DifficultyAdjustmentInterval() != 0 && pindex->nBits == nProofOfWorkLimit)\n                    pindex = pindex->pprev;\n                return pindex->nBits;\n            }\n        }\n        return pindexLast->nBits;\n    }\n\n    // Go back by what we want to be 14 days worth of blocks\n    int nHeightFirst = pindexLast->nHeight - (params.DifficultyAdjustmentInterval()-1);\n    assert(nHeightFirst >= 0);\n    const CBlockIndex* pindexFirst = pindexLast->GetAncestor(nHeightFirst);\n    assert(pindexFirst);\n\n    return CalculateNextWorkRequired_BTC(pindexLast, pindexFirst->GetBlockTime(), params);\n}\n\n// DigiShieldZEC\nunsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params)\n{\n    unsigned int nProofOfWorkLimit = UintToArith256(params.powLimit).GetCompact();\n\n    // Genesis block\n    if (pindexLast == nullptr) // FIXME.SUGAR // SURE? // <chain.cpp>\n        return nProofOfWorkLimit;\n\n    {\n        // Comparing to pindexLast->nHeight with >= because this function\n        // returns the work required for the block after pindexLast.\n        if (params.nPowAllowMinDifficultyBlocksAfterHeight != boost::none &&\n            pindexLast->nHeight >= params.nPowAllowMinDifficultyBlocksAfterHeight.get())\n        {\n            // Special difficulty rule for testnet:\n            // If the new block's timestamp is more than 6 * 2.5 minutes\n            // then allow mining of a min-difficulty block.\n            if (pblock && pblock->GetBlockTime() > pindexLast->GetBlockTime() + params.nPowTargetSpacing * 6)\n                return nProofOfWorkLimit;\n        }\n    }\n\n    // Find the first block in the averaging interval\n    const CBlockIndex* pindexFirst = pindexLast;\n    arith_uint256 bnTot {0};\n    for (int i = 0; pindexFirst && i < params.nPowAveragingWindow; i++) {\n        arith_uint256 bnTmp;\n        bnTmp.SetCompact(pindexFirst->nBits);\n        bnTot += bnTmp;\n        pindexFirst = pindexFirst->pprev;\n    }\n\n    // Check we have enough blocks\n    if (pindexFirst == nullptr) // FIXME.SUGAR // SURE? // <chain.cpp>\n        return nProofOfWorkLimit;\n\n    arith_uint256 bnAvg {bnTot / params.nPowAveragingWindow};\n\n    // FIXME.SUGAR // SURE?\n    if (params.fPowNoRetargeting && params.fPowAllowMinDifficultyBlocks) {\n        // Special difficulty rule for REGTEST: NO RETARGET\n        // It fixs test/validation_block_tests/processnewblock_signals_ordering\n        return pindexLast->nBits;\n    }\n\n    return CalculateNextWorkRequired(bnAvg, pindexLast->GetMedianTimePast(), pindexFirst->GetMedianTimePast(), params);\n}\n\nunsigned int CalculateNextWorkRequired_BTC(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::Params& params)\n{\n    if (params.fPowNoRetargeting)\n        return pindexLast->nBits;\n\n    // Limit adjustment step\n    int64_t nActualTimespan = pindexLast->GetBlockTime() - nFirstBlockTime;\n    if (nActualTimespan < params.nPowTargetTimespan/4)\n        nActualTimespan = params.nPowTargetTimespan/4;\n    if (nActualTimespan > params.nPowTargetTimespan*4)\n        nActualTimespan = params.nPowTargetTimespan*4;\n\n    // Retarget\n    const arith_uint256 bnPowLimit = UintToArith256(params.powLimit);\n    arith_uint256 bnNew;\n    bnNew.SetCompact(pindexLast->nBits);\n    bnNew *= nActualTimespan;\n    bnNew /= params.nPowTargetTimespan;\n\n    if (bnNew > bnPowLimit)\n        bnNew = bnPowLimit;\n\n    return bnNew.GetCompact();\n}\n\n// DigiShieldZEC\nunsigned int CalculateNextWorkRequired(arith_uint256 bnAvg,\n                                       int64_t nLastBlockTime, int64_t nFirstBlockTime,\n                                       const Consensus::Params& params)\n{\n    // Limit adjustment step\n    // Use medians to prevent time-warp attacks\n    int64_t nActualTimespan = nLastBlockTime - nFirstBlockTime;\n    nActualTimespan = params.AveragingWindowTimespan() + (nActualTimespan - params.AveragingWindowTimespan())/4;\n\n    if (nActualTimespan < params.MinActualTimespan())\n        nActualTimespan = params.MinActualTimespan();\n    if (nActualTimespan > params.MaxActualTimespan())\n        nActualTimespan = params.MaxActualTimespan();\n\n    // Retarget\n    const arith_uint256 bnPowLimit = UintToArith256(params.powLimit);\n    arith_uint256 bnNew {bnAvg};\n    bnNew /= params.AveragingWindowTimespan();\n    bnNew *= nActualTimespan;\n\n    if (bnNew > bnPowLimit)\n        bnNew = bnPowLimit;\n\n    return bnNew.GetCompact();\n}\n\nbool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params& params)\n{\n    bool fNegative;\n    bool fOverflow;\n    arith_uint256 bnTarget;\n\n    bnTarget.SetCompact(nBits, &fNegative, &fOverflow);\n\n    // Check range\n    if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))\n        return false;\n\n    // Check proof of work matches claimed amount\n    if (UintToArith256(hash) > bnTarget)\n        return false;\n\n    return true;\n}\n"
  },
  {
    "path": "src/pow.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2016-2018 The Zcash developers - DigiShieldZEC\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_POW_H\n#define BITCOIN_POW_H\n\n#include <consensus/params.h>\n\n#include <stdint.h>\n\nclass CBlockHeader;\nclass CBlockIndex;\nclass uint256;\n\nunsigned int GetNextWorkRequired_BTC(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params&);\nunsigned int CalculateNextWorkRequired_BTC(const CBlockIndex* pindexLast, int64_t nFirstBlockTime, const Consensus::Params&);\n\n// DigiShieldZEC\nclass arith_uint256;\nunsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params&);\nunsigned int CalculateNextWorkRequired(arith_uint256 bnAvg,\n                                       int64_t nLastBlockTime, int64_t nFirstBlockTime,\n                                       const Consensus::Params&);\n                                       \n/** Check whether a block hash satisfies the proof-of-work requirement specified by nBits */\nbool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params&);\n\n#endif // BITCOIN_POW_H\n"
  },
  {
    "path": "src/prevector.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_PREVECTOR_H\n#define BITCOIN_PREVECTOR_H\n\n#include <assert.h>\n#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n\n#include <iterator>\n#include <type_traits>\n\n#pragma pack(push, 1)\n/** Implements a drop-in replacement for std::vector<T> which stores up to N\n *  elements directly (without heap allocation). The types Size and Diff are\n *  used to store element counts, and can be any unsigned + signed type.\n *\n *  Storage layout is either:\n *  - Direct allocation:\n *    - Size _size: the number of used elements (between 0 and N)\n *    - T direct[N]: an array of N elements of type T\n *      (only the first _size are initialized).\n *  - Indirect allocation:\n *    - Size _size: the number of used elements plus N + 1\n *    - Size capacity: the number of allocated elements\n *    - T* indirect: a pointer to an array of capacity elements of type T\n *      (only the first _size are initialized).\n *\n *  The data type T must be movable by memmove/realloc(). Once we switch to C++,\n *  move constructors can be used instead.\n */\ntemplate<unsigned int N, typename T, typename Size = uint32_t, typename Diff = int32_t>\nclass prevector {\npublic:\n    typedef Size size_type;\n    typedef Diff difference_type;\n    typedef T value_type;\n    typedef value_type& reference;\n    typedef const value_type& const_reference;\n    typedef value_type* pointer;\n    typedef const value_type* const_pointer;\n\n    class iterator {\n        T* ptr;\n    public:\n        typedef Diff difference_type;\n        typedef T value_type;\n        typedef T* pointer;\n        typedef T& reference;\n        typedef std::random_access_iterator_tag iterator_category;\n        iterator(T* ptr_) : ptr(ptr_) {}\n        T& operator*() const { return *ptr; }\n        T* operator->() const { return ptr; }\n        T& operator[](size_type pos) { return ptr[pos]; }\n        const T& operator[](size_type pos) const { return ptr[pos]; }\n        iterator& operator++() { ptr++; return *this; }\n        iterator& operator--() { ptr--; return *this; }\n        iterator operator++(int) { iterator copy(*this); ++(*this); return copy; }\n        iterator operator--(int) { iterator copy(*this); --(*this); return copy; }\n        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }\n        iterator operator+(size_type n) { return iterator(ptr + n); }\n        iterator& operator+=(size_type n) { ptr += n; return *this; }\n        iterator operator-(size_type n) { return iterator(ptr - n); }\n        iterator& operator-=(size_type n) { ptr -= n; return *this; }\n        bool operator==(iterator x) const { return ptr == x.ptr; }\n        bool operator!=(iterator x) const { return ptr != x.ptr; }\n        bool operator>=(iterator x) const { return ptr >= x.ptr; }\n        bool operator<=(iterator x) const { return ptr <= x.ptr; }\n        bool operator>(iterator x) const { return ptr > x.ptr; }\n        bool operator<(iterator x) const { return ptr < x.ptr; }\n    };\n\n    class reverse_iterator {\n        T* ptr;\n    public:\n        typedef Diff difference_type;\n        typedef T value_type;\n        typedef T* pointer;\n        typedef T& reference;\n        typedef std::bidirectional_iterator_tag iterator_category;\n        reverse_iterator(T* ptr_) : ptr(ptr_) {}\n        T& operator*() { return *ptr; }\n        const T& operator*() const { return *ptr; }\n        T* operator->() { return ptr; }\n        const T* operator->() const { return ptr; }\n        reverse_iterator& operator--() { ptr++; return *this; }\n        reverse_iterator& operator++() { ptr--; return *this; }\n        reverse_iterator operator++(int) { reverse_iterator copy(*this); ++(*this); return copy; }\n        reverse_iterator operator--(int) { reverse_iterator copy(*this); --(*this); return copy; }\n        bool operator==(reverse_iterator x) const { return ptr == x.ptr; }\n        bool operator!=(reverse_iterator x) const { return ptr != x.ptr; }\n    };\n\n    class const_iterator {\n        const T* ptr;\n    public:\n        typedef Diff difference_type;\n        typedef const T value_type;\n        typedef const T* pointer;\n        typedef const T& reference;\n        typedef std::random_access_iterator_tag iterator_category;\n        const_iterator(const T* ptr_) : ptr(ptr_) {}\n        const_iterator(iterator x) : ptr(&(*x)) {}\n        const T& operator*() const { return *ptr; }\n        const T* operator->() const { return ptr; }\n        const T& operator[](size_type pos) const { return ptr[pos]; }\n        const_iterator& operator++() { ptr++; return *this; }\n        const_iterator& operator--() { ptr--; return *this; }\n        const_iterator operator++(int) { const_iterator copy(*this); ++(*this); return copy; }\n        const_iterator operator--(int) { const_iterator copy(*this); --(*this); return copy; }\n        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }\n        const_iterator operator+(size_type n) { return const_iterator(ptr + n); }\n        const_iterator& operator+=(size_type n) { ptr += n; return *this; }\n        const_iterator operator-(size_type n) { return const_iterator(ptr - n); }\n        const_iterator& operator-=(size_type n) { ptr -= n; return *this; }\n        bool operator==(const_iterator x) const { return ptr == x.ptr; }\n        bool operator!=(const_iterator x) const { return ptr != x.ptr; }\n        bool operator>=(const_iterator x) const { return ptr >= x.ptr; }\n        bool operator<=(const_iterator x) const { return ptr <= x.ptr; }\n        bool operator>(const_iterator x) const { return ptr > x.ptr; }\n        bool operator<(const_iterator x) const { return ptr < x.ptr; }\n    };\n\n    class const_reverse_iterator {\n        const T* ptr;\n    public:\n        typedef Diff difference_type;\n        typedef const T value_type;\n        typedef const T* pointer;\n        typedef const T& reference;\n        typedef std::bidirectional_iterator_tag iterator_category;\n        const_reverse_iterator(const T* ptr_) : ptr(ptr_) {}\n        const_reverse_iterator(reverse_iterator x) : ptr(&(*x)) {}\n        const T& operator*() const { return *ptr; }\n        const T* operator->() const { return ptr; }\n        const_reverse_iterator& operator--() { ptr++; return *this; }\n        const_reverse_iterator& operator++() { ptr--; return *this; }\n        const_reverse_iterator operator++(int) { const_reverse_iterator copy(*this); ++(*this); return copy; }\n        const_reverse_iterator operator--(int) { const_reverse_iterator copy(*this); --(*this); return copy; }\n        bool operator==(const_reverse_iterator x) const { return ptr == x.ptr; }\n        bool operator!=(const_reverse_iterator x) const { return ptr != x.ptr; }\n    };\n\nprivate:\n    size_type _size;\n    union direct_or_indirect {\n        char direct[sizeof(T) * N];\n        struct {\n            size_type capacity;\n            char* indirect;\n        };\n    } _union;\n\n    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }\n    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }\n    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect) + pos; }\n    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect) + pos; }\n    bool is_direct() const { return _size <= N; }\n\n    void change_capacity(size_type new_capacity) {\n        if (new_capacity <= N) {\n            if (!is_direct()) {\n                T* indirect = indirect_ptr(0);\n                T* src = indirect;\n                T* dst = direct_ptr(0);\n                memcpy(dst, src, size() * sizeof(T));\n                free(indirect);\n                _size -= N + 1;\n            }\n        } else {\n            if (!is_direct()) {\n                /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert\n                    success. These should instead use an allocator or new/delete so that handlers\n                    are called as necessary, but performance would be slightly degraded by doing so. */\n                _union.indirect = static_cast<char*>(realloc(_union.indirect, ((size_t)sizeof(T)) * new_capacity));\n                assert(_union.indirect);\n                _union.capacity = new_capacity;\n            } else {\n                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));\n                assert(new_indirect);\n                T* src = direct_ptr(0);\n                T* dst = reinterpret_cast<T*>(new_indirect);\n                memcpy(dst, src, size() * sizeof(T));\n                _union.indirect = new_indirect;\n                _union.capacity = new_capacity;\n                _size += N + 1;\n            }\n        }\n    }\n\n    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }\n    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }\n\npublic:\n    void assign(size_type n, const T& val) {\n        clear();\n        if (capacity() < n) {\n            change_capacity(n);\n        }\n        while (size() < n) {\n            _size++;\n            new(static_cast<void*>(item_ptr(size() - 1))) T(val);\n        }\n    }\n\n    template<typename InputIterator>\n    void assign(InputIterator first, InputIterator last) {\n        size_type n = last - first;\n        clear();\n        if (capacity() < n) {\n            change_capacity(n);\n        }\n        while (first != last) {\n            _size++;\n            new(static_cast<void*>(item_ptr(size() - 1))) T(*first);\n            ++first;\n        }\n    }\n\n    prevector() : _size(0), _union{{}} {}\n\n    explicit prevector(size_type n) : _size(0) {\n        resize(n);\n    }\n\n    explicit prevector(size_type n, const T& val = T()) : _size(0) {\n        change_capacity(n);\n        while (size() < n) {\n            _size++;\n            new(static_cast<void*>(item_ptr(size() - 1))) T(val);\n        }\n    }\n\n    template<typename InputIterator>\n    prevector(InputIterator first, InputIterator last) : _size(0) {\n        size_type n = last - first;\n        change_capacity(n);\n        while (first != last) {\n            _size++;\n            new(static_cast<void*>(item_ptr(size() - 1))) T(*first);\n            ++first;\n        }\n    }\n\n    prevector(const prevector<N, T, Size, Diff>& other) : _size(0) {\n        change_capacity(other.size());\n        const_iterator it = other.begin();\n        while (it != other.end()) {\n            _size++;\n            new(static_cast<void*>(item_ptr(size() - 1))) T(*it);\n            ++it;\n        }\n    }\n\n    prevector(prevector<N, T, Size, Diff>&& other) : _size(0) {\n        swap(other);\n    }\n\n    prevector& operator=(const prevector<N, T, Size, Diff>& other) {\n        if (&other == this) {\n            return *this;\n        }\n        resize(0);\n        change_capacity(other.size());\n        const_iterator it = other.begin();\n        while (it != other.end()) {\n            _size++;\n            new(static_cast<void*>(item_ptr(size() - 1))) T(*it);\n            ++it;\n        }\n        return *this;\n    }\n\n    prevector& operator=(prevector<N, T, Size, Diff>&& other) {\n        swap(other);\n        return *this;\n    }\n\n    size_type size() const {\n        return is_direct() ? _size : _size - N - 1;\n    }\n\n    bool empty() const {\n        return size() == 0;\n    }\n\n    iterator begin() { return iterator(item_ptr(0)); }\n    const_iterator begin() const { return const_iterator(item_ptr(0)); }\n    iterator end() { return iterator(item_ptr(size())); }\n    const_iterator end() const { return const_iterator(item_ptr(size())); }\n\n    reverse_iterator rbegin() { return reverse_iterator(item_ptr(size() - 1)); }\n    const_reverse_iterator rbegin() const { return const_reverse_iterator(item_ptr(size() - 1)); }\n    reverse_iterator rend() { return reverse_iterator(item_ptr(-1)); }\n    const_reverse_iterator rend() const { return const_reverse_iterator(item_ptr(-1)); }\n\n    size_t capacity() const {\n        if (is_direct()) {\n            return N;\n        } else {\n            return _union.capacity;\n        }\n    }\n\n    T& operator[](size_type pos) {\n        return *item_ptr(pos);\n    }\n\n    const T& operator[](size_type pos) const {\n        return *item_ptr(pos);\n    }\n\n    void resize(size_type new_size) {\n        if (size() > new_size) {\n            erase(item_ptr(new_size), end());\n        }\n        if (new_size > capacity()) {\n            change_capacity(new_size);\n        }\n        while (size() < new_size) {\n            _size++;\n            new(static_cast<void*>(item_ptr(size() - 1))) T();\n        }\n    }\n\n    void reserve(size_type new_capacity) {\n        if (new_capacity > capacity()) {\n            change_capacity(new_capacity);\n        }\n    }\n\n    void shrink_to_fit() {\n        change_capacity(size());\n    }\n\n    void clear() {\n        resize(0);\n    }\n\n    iterator insert(iterator pos, const T& value) {\n        size_type p = pos - begin();\n        size_type new_size = size() + 1;\n        if (capacity() < new_size) {\n            change_capacity(new_size + (new_size >> 1));\n        }\n        memmove(item_ptr(p + 1), item_ptr(p), (size() - p) * sizeof(T));\n        _size++;\n        new(static_cast<void*>(item_ptr(p))) T(value);\n        return iterator(item_ptr(p));\n    }\n\n    void insert(iterator pos, size_type count, const T& value) {\n        size_type p = pos - begin();\n        size_type new_size = size() + count;\n        if (capacity() < new_size) {\n            change_capacity(new_size + (new_size >> 1));\n        }\n        memmove(item_ptr(p + count), item_ptr(p), (size() - p) * sizeof(T));\n        _size += count;\n        for (size_type i = 0; i < count; i++) {\n            new(static_cast<void*>(item_ptr(p + i))) T(value);\n        }\n    }\n\n    template<typename InputIterator>\n    void insert(iterator pos, InputIterator first, InputIterator last) {\n        size_type p = pos - begin();\n        difference_type count = last - first;\n        size_type new_size = size() + count;\n        if (capacity() < new_size) {\n            change_capacity(new_size + (new_size >> 1));\n        }\n        memmove(item_ptr(p + count), item_ptr(p), (size() - p) * sizeof(T));\n        _size += count;\n        while (first != last) {\n            new(static_cast<void*>(item_ptr(p))) T(*first);\n            ++p;\n            ++first;\n        }\n    }\n\n    iterator erase(iterator pos) {\n        return erase(pos, pos + 1);\n    }\n\n    iterator erase(iterator first, iterator last) {\n        // Erase is not allowed to the change the object's capacity. That means\n        // that when starting with an indirectly allocated prevector with\n        // size and capacity > N, the result may be a still indirectly allocated\n        // prevector with size <= N and capacity > N. A shrink_to_fit() call is\n        // necessary to switch to the (more efficient) directly allocated\n        // representation (with capacity N and size <= N).\n        iterator p = first;\n        char* endp = (char*)&(*end());\n        if (!std::is_trivially_destructible<T>::value) {\n            while (p != last) {\n                (*p).~T();\n                _size--;\n                ++p;\n            }\n        } else {\n            _size -= last - p;\n        }\n        memmove(&(*first), &(*last), endp - ((char*)(&(*last))));\n        return first;\n    }\n\n    void push_back(const T& value) {\n        size_type new_size = size() + 1;\n        if (capacity() < new_size) {\n            change_capacity(new_size + (new_size >> 1));\n        }\n        new(item_ptr(size())) T(value);\n        _size++;\n    }\n\n    void pop_back() {\n        erase(end() - 1, end());\n    }\n\n    T& front() {\n        return *item_ptr(0);\n    }\n\n    const T& front() const {\n        return *item_ptr(0);\n    }\n\n    T& back() {\n        return *item_ptr(size() - 1);\n    }\n\n    const T& back() const {\n        return *item_ptr(size() - 1);\n    }\n\n    void swap(prevector<N, T, Size, Diff>& other) {\n        std::swap(_union, other._union);\n        std::swap(_size, other._size);\n    }\n\n    ~prevector() {\n        if (!std::is_trivially_destructible<T>::value) {\n            clear();\n        }\n        if (!is_direct()) {\n            free(_union.indirect);\n            _union.indirect = nullptr;\n        }\n    }\n\n    bool operator==(const prevector<N, T, Size, Diff>& other) const {\n        if (other.size() != size()) {\n            return false;\n        }\n        const_iterator b1 = begin();\n        const_iterator b2 = other.begin();\n        const_iterator e1 = end();\n        while (b1 != e1) {\n            if ((*b1) != (*b2)) {\n                return false;\n            }\n            ++b1;\n            ++b2;\n        }\n        return true;\n    }\n\n    bool operator!=(const prevector<N, T, Size, Diff>& other) const {\n        return !(*this == other);\n    }\n\n    bool operator<(const prevector<N, T, Size, Diff>& other) const {\n        if (size() < other.size()) {\n            return true;\n        }\n        if (size() > other.size()) {\n            return false;\n        }\n        const_iterator b1 = begin();\n        const_iterator b2 = other.begin();\n        const_iterator e1 = end();\n        while (b1 != e1) {\n            if ((*b1) < (*b2)) {\n                return true;\n            }\n            if ((*b2) < (*b1)) {\n                return false;\n            }\n            ++b1;\n            ++b2;\n        }\n        return false;\n    }\n\n    size_t allocated_memory() const {\n        if (is_direct()) {\n            return 0;\n        } else {\n            return ((size_t)(sizeof(T))) * _union.capacity;\n        }\n    }\n\n    value_type* data() {\n        return item_ptr(0);\n    }\n\n    const value_type* data() const {\n        return item_ptr(0);\n    }\n};\n#pragma pack(pop)\n\n#endif // BITCOIN_PREVECTOR_H\n"
  },
  {
    "path": "src/primitives/block.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <primitives/block.h>\n\n#include <hash.h>\n#include <tinyformat.h>\n#include <utilstrencodings.h>\n#include <crypto/common.h>\n\n// yespower\n#include <crypto/yespower-1.0.1/yespower.h>\n#include <streams.h>\n#include <version.h>\n\n// yespower exit()\n#include <stdlib.h>\n\n// yespower PoW cache\n#include <sync.h>\n\nuint256 CBlockHeaderUncached::GetHash() const\n{\n    return SerializeHash(*this);\n}\n\n// yespowerUncached\nuint256 CBlockHeaderUncached::GetPoWHash() const\n{\n    static const yespower_params_t yespower_1_0_sugarchain = {\n        .version = YESPOWER_1_0,\n        .N = 2048,\n        .r = 32,\n        .pers = (const uint8_t *)\"Satoshi Nakamoto 31/Oct/2008 Proof-of-work is essentially one-CPU-one-vote\",\n        .perslen = 74\n    };\n    uint256 hash;\n    CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);\n    ss << *this;\n    if (yespower_tls((const uint8_t *)&ss[0], ss.size(), &yespower_1_0_sugarchain, (yespower_binary_t *)&hash)) {\n        fprintf(stderr, \"Error: CBlockHeaderUncached::GetPoWHash(): failed to compute PoW hash (out of memory?)\\n\");\n        exit(1);\n    }\n    return hash;\n}\n\n// yespower_cached\nuint256 CBlockHeader::GetPoWHash_cached() const\n{\n    uint256 block_hash = GetHash();\n    LOCK(cache_lock);\n    if (cache_init) {\n        if (block_hash != cache_block_hash) {\n            fprintf(stderr, \"Error: CBlockHeader::GetPoWHash_cached(): block hash changed unexpectedly\\n\");\n            exit(1);\n        }\n        // yespower PoW cache: log // O (cyan) = HIT\n        // printf(\"\\033[36;1mO\\033[0m block = %s PoW = %s\\n\", cache_block_hash.ToString().c_str(), cache_PoW_hash.ToString().c_str());\n    } else {\n        cache_PoW_hash = GetPoWHash();\n        cache_block_hash = block_hash;\n        cache_init = true;\n        // yespower PoW cache: log // x = MISS\n        // printf(\"x block = %s PoW = %s\\n\", cache_block_hash.ToString().c_str(), cache_PoW_hash.ToString().c_str());\n    }\n    return cache_PoW_hash;\n}\n\nstd::string CBlock::ToString() const\n{\n    std::stringstream s;\n    s << strprintf(\"CBlock(hash=%s, ver=0x%08x, hashPrevBlock=%s, hashMerkleRoot=%s, nTime=%u, nBits=%08x, nNonce=%u, vtx=%u)\\n\",\n        GetHash().ToString(),\n        nVersion,\n        hashPrevBlock.ToString(),\n        hashMerkleRoot.ToString(),\n        nTime, nBits, nNonce,\n        vtx.size());\n    for (const auto& tx : vtx) {\n        s << \"  \" << tx->ToString() << \"\\n\";\n    }\n    return s.str();\n}\n"
  },
  {
    "path": "src/primitives/block.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_PRIMITIVES_BLOCK_H\n#define BITCOIN_PRIMITIVES_BLOCK_H\n\n#include <primitives/transaction.h>\n#include <serialize.h>\n#include <uint256.h>\n\n// yespower PoW cache\n#include <sync.h>\n\n/** Nodes collect new transactions into a block, hash them into a hash tree,\n * and scan through nonce values to make the block's hash satisfy proof-of-work\n * requirements.  When they solve the proof-of-work, they broadcast the block\n * to everyone and the block is added to the block chain.  The first transaction\n * in the block is a special one that creates a new coin owned by the creator\n * of the block.\n */\nclass CBlockHeaderUncached\n{\npublic:\n    // header\n    int32_t nVersion;\n    uint256 hashPrevBlock;\n    uint256 hashMerkleRoot;\n    uint32_t nTime;\n    uint32_t nBits;\n    uint32_t nNonce;\n\n    CBlockHeaderUncached()\n    {\n        SetNull();\n    }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(this->nVersion);\n        READWRITE(hashPrevBlock);\n        READWRITE(hashMerkleRoot);\n        READWRITE(nTime);\n        READWRITE(nBits);\n        READWRITE(nNonce);\n    }\n\n    void SetNull()\n    {\n        nVersion = 0;\n        hashPrevBlock.SetNull();\n        hashMerkleRoot.SetNull();\n        nTime = 0;\n        nBits = 0;\n        nNonce = 0;\n    }\n\n    bool IsNull() const\n    {\n        return (nBits == 0);\n    }\n\n    uint256 GetHash() const;\n\n    uint256 GetPoWHash() const; // yespower\n\n    int64_t GetBlockTime() const\n    {\n        return (int64_t)nTime;\n    }\n};\n\nclass CBlockHeader : public CBlockHeaderUncached\n{\npublic:\n    mutable CCriticalSection cache_lock;\n    mutable bool cache_init;\n    mutable uint256 cache_block_hash, cache_PoW_hash;\n\n    CBlockHeader()\n    {\n        cache_init = false;\n    }\n\n    CBlockHeader(const CBlockHeader& header)\n    {\n        *this = header;\n    }\n\n    CBlockHeader& operator=(const CBlockHeader& header)\n    {\n        *(CBlockHeaderUncached*)this = (CBlockHeaderUncached)header;\n        cache_init = header.cache_init;\n        cache_block_hash = header.cache_block_hash;\n        cache_PoW_hash = header.cache_PoW_hash;\n        return *this;\n    }\n\n    uint256 GetPoWHash_cached() const;\n};\n\nclass CBlock : public CBlockHeader\n{\npublic:\n    // network and disk\n    std::vector<CTransactionRef> vtx;\n\n    // memory only\n    mutable bool fChecked;\n\n    CBlock()\n    {\n        SetNull();\n    }\n\n    CBlock(const CBlockHeader &header)\n    {\n        SetNull();\n        *((CBlockHeader*)this) = header;\n    }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(*(CBlockHeader*)this);\n        READWRITE(vtx);\n    }\n\n    void SetNull()\n    {\n        CBlockHeader::SetNull();\n        vtx.clear();\n        fChecked = false;\n    }\n\n    CBlockHeader GetBlockHeader() const\n    {\n        CBlockHeader block;\n        block.nVersion       = nVersion;\n        block.hashPrevBlock  = hashPrevBlock;\n        block.hashMerkleRoot = hashMerkleRoot;\n        block.nTime          = nTime;\n        block.nBits          = nBits;\n        block.nNonce         = nNonce;\n        return block;\n    }\n\n    std::string ToString() const;\n};\n\n/** Describes a place in the block chain to another node such that if the\n * other node doesn't have the same branch, it can find a recent common trunk.\n * The further back it is, the further before the fork it may be.\n */\nstruct CBlockLocator\n{\n    std::vector<uint256> vHave;\n\n    CBlockLocator() {}\n\n    explicit CBlockLocator(const std::vector<uint256>& vHaveIn) : vHave(vHaveIn) {}\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        int nVersion = s.GetVersion();\n        if (!(s.GetType() & SER_GETHASH))\n            READWRITE(nVersion);\n        READWRITE(vHave);\n    }\n\n    void SetNull()\n    {\n        vHave.clear();\n    }\n\n    bool IsNull() const\n    {\n        return vHave.empty();\n    }\n};\n\n#endif // BITCOIN_PRIMITIVES_BLOCK_H\n"
  },
  {
    "path": "src/primitives/transaction.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <primitives/transaction.h>\n\n#include <hash.h>\n#include <tinyformat.h>\n#include <utilstrencodings.h>\n\nstd::string COutPoint::ToString() const\n{\n    return strprintf(\"COutPoint(%s, %u)\", hash.ToString().substr(0,10), n);\n}\n\nCTxIn::CTxIn(COutPoint prevoutIn, CScript scriptSigIn, uint32_t nSequenceIn)\n{\n    prevout = prevoutIn;\n    scriptSig = scriptSigIn;\n    nSequence = nSequenceIn;\n}\n\nCTxIn::CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn, uint32_t nSequenceIn)\n{\n    prevout = COutPoint(hashPrevTx, nOut);\n    scriptSig = scriptSigIn;\n    nSequence = nSequenceIn;\n}\n\nstd::string CTxIn::ToString() const\n{\n    std::string str;\n    str += \"CTxIn(\";\n    str += prevout.ToString();\n    if (prevout.IsNull())\n        str += strprintf(\", coinbase %s\", HexStr(scriptSig));\n    else\n        str += strprintf(\", scriptSig=%s\", HexStr(scriptSig).substr(0, 24));\n    if (nSequence != SEQUENCE_FINAL)\n        str += strprintf(\", nSequence=%u\", nSequence);\n    str += \")\";\n    return str;\n}\n\nCTxOut::CTxOut(const CAmount& nValueIn, CScript scriptPubKeyIn)\n{\n    nValue = nValueIn;\n    scriptPubKey = scriptPubKeyIn;\n}\n\nstd::string CTxOut::ToString() const\n{\n    return strprintf(\"CTxOut(nValue=%d.%08d, scriptPubKey=%s)\", nValue / COIN, nValue % COIN, HexStr(scriptPubKey).substr(0, 30));\n}\n\nCMutableTransaction::CMutableTransaction() : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {}\nCMutableTransaction::CMutableTransaction(const CTransaction& tx) : vin(tx.vin), vout(tx.vout), nVersion(tx.nVersion), nLockTime(tx.nLockTime) {}\n\nuint256 CMutableTransaction::GetHash() const\n{\n    return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS);\n}\n\nuint256 CTransaction::ComputeHash() const\n{\n    return SerializeHash(*this, SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS);\n}\n\nuint256 CTransaction::GetWitnessHash() const\n{\n    if (!HasWitness()) {\n        return GetHash();\n    }\n    return SerializeHash(*this, SER_GETHASH, 0);\n}\n\n/* For backward compatibility, the hash is initialized to 0. TODO: remove the need for this default constructor entirely. */\nCTransaction::CTransaction() : vin(), vout(), nVersion(CTransaction::CURRENT_VERSION), nLockTime(0), hash() {}\nCTransaction::CTransaction(const CMutableTransaction &tx) : vin(tx.vin), vout(tx.vout), nVersion(tx.nVersion), nLockTime(tx.nLockTime), hash(ComputeHash()) {}\nCTransaction::CTransaction(CMutableTransaction &&tx) : vin(std::move(tx.vin)), vout(std::move(tx.vout)), nVersion(tx.nVersion), nLockTime(tx.nLockTime), hash(ComputeHash()) {}\n\nCAmount CTransaction::GetValueOut() const\n{\n    CAmount nValueOut = 0;\n    for (const auto& tx_out : vout) {\n        nValueOut += tx_out.nValue;\n        if (!MoneyRange(tx_out.nValue) || !MoneyRange(nValueOut))\n            throw std::runtime_error(std::string(__func__) + \": value out of range\");\n    }\n    return nValueOut;\n}\n\nunsigned int CTransaction::GetTotalSize() const\n{\n    return ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION);\n}\n\nstd::string CTransaction::ToString() const\n{\n    std::string str;\n    str += strprintf(\"CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\\n\",\n        GetHash().ToString().substr(0,10),\n        nVersion,\n        vin.size(),\n        vout.size(),\n        nLockTime);\n    for (const auto& tx_in : vin)\n        str += \"    \" + tx_in.ToString() + \"\\n\";\n    for (const auto& tx_in : vin)\n        str += \"    \" + tx_in.scriptWitness.ToString() + \"\\n\";\n    for (const auto& tx_out : vout)\n        str += \"    \" + tx_out.ToString() + \"\\n\";\n    return str;\n}\n"
  },
  {
    "path": "src/primitives/transaction.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_PRIMITIVES_TRANSACTION_H\n#define BITCOIN_PRIMITIVES_TRANSACTION_H\n\n#include <stdint.h>\n#include <amount.h>\n#include <script/script.h>\n#include <serialize.h>\n#include <uint256.h>\n\nstatic const int SERIALIZE_TRANSACTION_NO_WITNESS = 0x40000000;\n\n/** An outpoint - a combination of a transaction hash and an index n into its vout */\nclass COutPoint\n{\npublic:\n    uint256 hash;\n    uint32_t n;\n\n    COutPoint(): n((uint32_t) -1) { }\n    COutPoint(const uint256& hashIn, uint32_t nIn): hash(hashIn), n(nIn) { }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(hash);\n        READWRITE(n);\n    }\n\n    void SetNull() { hash.SetNull(); n = (uint32_t) -1; }\n    bool IsNull() const { return (hash.IsNull() && n == (uint32_t) -1); }\n\n    friend bool operator<(const COutPoint& a, const COutPoint& b)\n    {\n        int cmp = a.hash.Compare(b.hash);\n        return cmp < 0 || (cmp == 0 && a.n < b.n);\n    }\n\n    friend bool operator==(const COutPoint& a, const COutPoint& b)\n    {\n        return (a.hash == b.hash && a.n == b.n);\n    }\n\n    friend bool operator!=(const COutPoint& a, const COutPoint& b)\n    {\n        return !(a == b);\n    }\n\n    std::string ToString() const;\n};\n\n/** An input of a transaction.  It contains the location of the previous\n * transaction's output that it claims and a signature that matches the\n * output's public key.\n */\nclass CTxIn\n{\npublic:\n    COutPoint prevout;\n    CScript scriptSig;\n    uint32_t nSequence;\n    CScriptWitness scriptWitness; //! Only serialized through CTransaction\n\n    /* Setting nSequence to this value for every input in a transaction\n     * disables nLockTime. */\n    static const uint32_t SEQUENCE_FINAL = 0xffffffff;\n\n    /* Below flags apply in the context of BIP 68*/\n    /* If this flag set, CTxIn::nSequence is NOT interpreted as a\n     * relative lock-time. */\n    static const uint32_t SEQUENCE_LOCKTIME_DISABLE_FLAG = (1 << 31);\n\n    /* If CTxIn::nSequence encodes a relative lock-time and this flag\n     * is set, the relative lock-time has units of 512 seconds,\n     * otherwise it specifies blocks with a granularity of 1. */\n    static const uint32_t SEQUENCE_LOCKTIME_TYPE_FLAG = (1 << 22);\n\n    /* If CTxIn::nSequence encodes a relative lock-time, this mask is\n     * applied to extract that lock-time from the sequence field. */\n    static const uint32_t SEQUENCE_LOCKTIME_MASK = 0x0000ffff;\n\n    /* In order to use the same number of bits to encode roughly the\n     * same wall-clock duration, and because blocks are naturally\n     * limited to occur every 600s on average, the minimum granularity\n     * for time-based relative lock-time is fixed at 512 seconds.\n     * Converting from CTxIn::nSequence to seconds is performed by\n     * multiplying by 512 = 2^9, or equivalently shifting up by\n     * 9 bits. */\n    static const int SEQUENCE_LOCKTIME_GRANULARITY = 9;\n\n    CTxIn()\n    {\n        nSequence = SEQUENCE_FINAL;\n    }\n\n    explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=SEQUENCE_FINAL);\n    CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=SEQUENCE_FINAL);\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(prevout);\n        READWRITE(scriptSig);\n        READWRITE(nSequence);\n    }\n\n    friend bool operator==(const CTxIn& a, const CTxIn& b)\n    {\n        return (a.prevout   == b.prevout &&\n                a.scriptSig == b.scriptSig &&\n                a.nSequence == b.nSequence);\n    }\n\n    friend bool operator!=(const CTxIn& a, const CTxIn& b)\n    {\n        return !(a == b);\n    }\n\n    std::string ToString() const;\n};\n\n/** An output of a transaction.  It contains the public key that the next input\n * must be able to sign with to claim it.\n */\nclass CTxOut\n{\npublic:\n    CAmount nValue;\n    CScript scriptPubKey;\n\n    CTxOut()\n    {\n        SetNull();\n    }\n\n    CTxOut(const CAmount& nValueIn, CScript scriptPubKeyIn);\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(nValue);\n        READWRITE(scriptPubKey);\n    }\n\n    void SetNull()\n    {\n        nValue = -1;\n        scriptPubKey.clear();\n    }\n\n    bool IsNull() const\n    {\n        return (nValue == -1);\n    }\n\n    friend bool operator==(const CTxOut& a, const CTxOut& b)\n    {\n        return (a.nValue       == b.nValue &&\n                a.scriptPubKey == b.scriptPubKey);\n    }\n\n    friend bool operator!=(const CTxOut& a, const CTxOut& b)\n    {\n        return !(a == b);\n    }\n\n    std::string ToString() const;\n};\n\nstruct CMutableTransaction;\n\n/**\n * Basic transaction serialization format:\n * - int32_t nVersion\n * - std::vector<CTxIn> vin\n * - std::vector<CTxOut> vout\n * - uint32_t nLockTime\n *\n * Extended transaction serialization format:\n * - int32_t nVersion\n * - unsigned char dummy = 0x00\n * - unsigned char flags (!= 0)\n * - std::vector<CTxIn> vin\n * - std::vector<CTxOut> vout\n * - if (flags & 1):\n *   - CTxWitness wit;\n * - uint32_t nLockTime\n */\ntemplate<typename Stream, typename TxType>\ninline void UnserializeTransaction(TxType& tx, Stream& s) {\n    const bool fAllowWitness = !(s.GetVersion() & SERIALIZE_TRANSACTION_NO_WITNESS);\n\n    s >> tx.nVersion;\n    unsigned char flags = 0;\n    tx.vin.clear();\n    tx.vout.clear();\n    /* Try to read the vin. In case the dummy is there, this will be read as an empty vector. */\n    s >> tx.vin;\n    if (tx.vin.size() == 0 && fAllowWitness) {\n        /* We read a dummy or an empty vin. */\n        s >> flags;\n        if (flags != 0) {\n            s >> tx.vin;\n            s >> tx.vout;\n        }\n    } else {\n        /* We read a non-empty vin. Assume a normal vout follows. */\n        s >> tx.vout;\n    }\n    if ((flags & 1) && fAllowWitness) {\n        /* The witness flag is present, and we support witnesses. */\n        flags ^= 1;\n        for (size_t i = 0; i < tx.vin.size(); i++) {\n            s >> tx.vin[i].scriptWitness.stack;\n        }\n    }\n    if (flags) {\n        /* Unknown flag in the serialization */\n        throw std::ios_base::failure(\"Unknown transaction optional data\");\n    }\n    s >> tx.nLockTime;\n}\n\ntemplate<typename Stream, typename TxType>\ninline void SerializeTransaction(const TxType& tx, Stream& s) {\n    const bool fAllowWitness = !(s.GetVersion() & SERIALIZE_TRANSACTION_NO_WITNESS);\n\n    s << tx.nVersion;\n    unsigned char flags = 0;\n    // Consistency check\n    if (fAllowWitness) {\n        /* Check whether witnesses need to be serialized. */\n        if (tx.HasWitness()) {\n            flags |= 1;\n        }\n    }\n    if (flags) {\n        /* Use extended format in case witnesses are to be serialized. */\n        std::vector<CTxIn> vinDummy;\n        s << vinDummy;\n        s << flags;\n    }\n    s << tx.vin;\n    s << tx.vout;\n    if (flags & 1) {\n        for (size_t i = 0; i < tx.vin.size(); i++) {\n            s << tx.vin[i].scriptWitness.stack;\n        }\n    }\n    s << tx.nLockTime;\n}\n\n\n/** The basic transaction that is broadcasted on the network and contained in\n * blocks.  A transaction can contain multiple inputs and outputs.\n */\nclass CTransaction\n{\npublic:\n    // Default transaction version.\n    static const int32_t CURRENT_VERSION=2;\n\n    // Changing the default transaction version requires a two step process: first\n    // adapting relay policy by bumping MAX_STANDARD_VERSION, and then later date\n    // bumping the default CURRENT_VERSION at which point both CURRENT_VERSION and\n    // MAX_STANDARD_VERSION will be equal.\n    static const int32_t MAX_STANDARD_VERSION=2;\n\n    // The local variables are made const to prevent unintended modification\n    // without updating the cached hash value. However, CTransaction is not\n    // actually immutable; deserialization and assignment are implemented,\n    // and bypass the constness. This is safe, as they update the entire\n    // structure, including the hash.\n    const std::vector<CTxIn> vin;\n    const std::vector<CTxOut> vout;\n    const int32_t nVersion;\n    const uint32_t nLockTime;\n\nprivate:\n    /** Memory only. */\n    const uint256 hash;\n\n    uint256 ComputeHash() const;\n\npublic:\n    /** Construct a CTransaction that qualifies as IsNull() */\n    CTransaction();\n\n    /** Convert a CMutableTransaction into a CTransaction. */\n    CTransaction(const CMutableTransaction &tx);\n    CTransaction(CMutableTransaction &&tx);\n\n    template <typename Stream>\n    inline void Serialize(Stream& s) const {\n        SerializeTransaction(*this, s);\n    }\n\n    /** This deserializing constructor is provided instead of an Unserialize method.\n     *  Unserialize is not possible, since it would require overwriting const fields. */\n    template <typename Stream>\n    CTransaction(deserialize_type, Stream& s) : CTransaction(CMutableTransaction(deserialize, s)) {}\n\n    bool IsNull() const {\n        return vin.empty() && vout.empty();\n    }\n\n    const uint256& GetHash() const {\n        return hash;\n    }\n\n    // Compute a hash that includes both transaction and witness data\n    uint256 GetWitnessHash() const;\n\n    // Return sum of txouts.\n    CAmount GetValueOut() const;\n    // GetValueIn() is a method on CCoinsViewCache, because\n    // inputs must be known to compute value in.\n\n    /**\n     * Get the total transaction size in bytes, including witness data.\n     * \"Total Size\" defined in BIP141 and BIP144.\n     * @return Total transaction size in bytes\n     */\n    unsigned int GetTotalSize() const;\n\n    bool IsCoinBase() const\n    {\n        return (vin.size() == 1 && vin[0].prevout.IsNull());\n    }\n\n    friend bool operator==(const CTransaction& a, const CTransaction& b)\n    {\n        return a.hash == b.hash;\n    }\n\n    friend bool operator!=(const CTransaction& a, const CTransaction& b)\n    {\n        return a.hash != b.hash;\n    }\n\n    std::string ToString() const;\n\n    bool HasWitness() const\n    {\n        for (size_t i = 0; i < vin.size(); i++) {\n            if (!vin[i].scriptWitness.IsNull()) {\n                return true;\n            }\n        }\n        return false;\n    }\n};\n\n/** A mutable version of CTransaction. */\nstruct CMutableTransaction\n{\n    std::vector<CTxIn> vin;\n    std::vector<CTxOut> vout;\n    int32_t nVersion;\n    uint32_t nLockTime;\n\n    CMutableTransaction();\n    CMutableTransaction(const CTransaction& tx);\n\n    template <typename Stream>\n    inline void Serialize(Stream& s) const {\n        SerializeTransaction(*this, s);\n    }\n\n\n    template <typename Stream>\n    inline void Unserialize(Stream& s) {\n        UnserializeTransaction(*this, s);\n    }\n\n    template <typename Stream>\n    CMutableTransaction(deserialize_type, Stream& s) {\n        Unserialize(s);\n    }\n\n    /** Compute the hash of this CMutableTransaction. This is computed on the\n     * fly, as opposed to GetHash() in CTransaction, which uses a cached result.\n     */\n    uint256 GetHash() const;\n\n    friend bool operator==(const CMutableTransaction& a, const CMutableTransaction& b)\n    {\n        return a.GetHash() == b.GetHash();\n    }\n\n    bool HasWitness() const\n    {\n        for (size_t i = 0; i < vin.size(); i++) {\n            if (!vin[i].scriptWitness.IsNull()) {\n                return true;\n            }\n        }\n        return false;\n    }\n};\n\ntypedef std::shared_ptr<const CTransaction> CTransactionRef;\nstatic inline CTransactionRef MakeTransactionRef() { return std::make_shared<const CTransaction>(); }\ntemplate <typename Tx> static inline CTransactionRef MakeTransactionRef(Tx&& txIn) { return std::make_shared<const CTransaction>(std::forward<Tx>(txIn)); }\n\n#endif // BITCOIN_PRIMITIVES_TRANSACTION_H\n"
  },
  {
    "path": "src/protocol.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <protocol.h>\n\n#include <util.h>\n#include <utilstrencodings.h>\n\n#ifndef WIN32\n# include <arpa/inet.h>\n#endif\n\nnamespace NetMsgType {\nconst char *VERSION=\"version\";\nconst char *VERACK=\"verack\";\nconst char *ADDR=\"addr\";\nconst char *INV=\"inv\";\nconst char *GETDATA=\"getdata\";\nconst char *MERKLEBLOCK=\"merkleblock\";\nconst char *GETBLOCKS=\"getblocks\";\nconst char *GETHEADERS=\"getheaders\";\nconst char *TX=\"tx\";\nconst char *HEADERS=\"headers\";\nconst char *BLOCK=\"block\";\nconst char *GETADDR=\"getaddr\";\nconst char *MEMPOOL=\"mempool\";\nconst char *PING=\"ping\";\nconst char *PONG=\"pong\";\nconst char *NOTFOUND=\"notfound\";\nconst char *FILTERLOAD=\"filterload\";\nconst char *FILTERADD=\"filteradd\";\nconst char *FILTERCLEAR=\"filterclear\";\nconst char *REJECT=\"reject\";\nconst char *SENDHEADERS=\"sendheaders\";\nconst char *FEEFILTER=\"feefilter\";\nconst char *SENDCMPCT=\"sendcmpct\";\nconst char *CMPCTBLOCK=\"cmpctblock\";\nconst char *GETBLOCKTXN=\"getblocktxn\";\nconst char *BLOCKTXN=\"blocktxn\";\n} // namespace NetMsgType\n\n/** All known message types. Keep this in the same order as the list of\n * messages above and in protocol.h.\n */\nconst static std::string allNetMessageTypes[] = {\n    NetMsgType::VERSION,\n    NetMsgType::VERACK,\n    NetMsgType::ADDR,\n    NetMsgType::INV,\n    NetMsgType::GETDATA,\n    NetMsgType::MERKLEBLOCK,\n    NetMsgType::GETBLOCKS,\n    NetMsgType::GETHEADERS,\n    NetMsgType::TX,\n    NetMsgType::HEADERS,\n    NetMsgType::BLOCK,\n    NetMsgType::GETADDR,\n    NetMsgType::MEMPOOL,\n    NetMsgType::PING,\n    NetMsgType::PONG,\n    NetMsgType::NOTFOUND,\n    NetMsgType::FILTERLOAD,\n    NetMsgType::FILTERADD,\n    NetMsgType::FILTERCLEAR,\n    NetMsgType::REJECT,\n    NetMsgType::SENDHEADERS,\n    NetMsgType::FEEFILTER,\n    NetMsgType::SENDCMPCT,\n    NetMsgType::CMPCTBLOCK,\n    NetMsgType::GETBLOCKTXN,\n    NetMsgType::BLOCKTXN,\n};\nconst static std::vector<std::string> allNetMessageTypesVec(allNetMessageTypes, allNetMessageTypes+ARRAYLEN(allNetMessageTypes));\n\nCMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn)\n{\n    memcpy(pchMessageStart, pchMessageStartIn, MESSAGE_START_SIZE);\n    memset(pchCommand, 0, sizeof(pchCommand));\n    nMessageSize = -1;\n    memset(pchChecksum, 0, CHECKSUM_SIZE);\n}\n\nCMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn, const char* pszCommand, unsigned int nMessageSizeIn)\n{\n    memcpy(pchMessageStart, pchMessageStartIn, MESSAGE_START_SIZE);\n    memset(pchCommand, 0, sizeof(pchCommand));\n    strncpy(pchCommand, pszCommand, COMMAND_SIZE);\n    nMessageSize = nMessageSizeIn;\n    memset(pchChecksum, 0, CHECKSUM_SIZE);\n}\n\nstd::string CMessageHeader::GetCommand() const\n{\n    return std::string(pchCommand, pchCommand + strnlen(pchCommand, COMMAND_SIZE));\n}\n\nbool CMessageHeader::IsValid(const MessageStartChars& pchMessageStartIn) const\n{\n    // Check start string\n    if (memcmp(pchMessageStart, pchMessageStartIn, MESSAGE_START_SIZE) != 0)\n        return false;\n\n    // Check the command string for errors\n    for (const char* p1 = pchCommand; p1 < pchCommand + COMMAND_SIZE; p1++)\n    {\n        if (*p1 == 0)\n        {\n            // Must be all zeros after the first zero\n            for (; p1 < pchCommand + COMMAND_SIZE; p1++)\n                if (*p1 != 0)\n                    return false;\n        }\n        else if (*p1 < ' ' || *p1 > 0x7E)\n            return false;\n    }\n\n    // Message size\n    if (nMessageSize > MAX_SIZE)\n    {\n        LogPrintf(\"CMessageHeader::IsValid(): (%s, %u bytes) nMessageSize > MAX_SIZE\\n\", GetCommand(), nMessageSize);\n        return false;\n    }\n\n    return true;\n}\n\n\n\nCAddress::CAddress() : CService()\n{\n    Init();\n}\n\nCAddress::CAddress(CService ipIn, ServiceFlags nServicesIn) : CService(ipIn)\n{\n    Init();\n    nServices = nServicesIn;\n}\n\nvoid CAddress::Init()\n{\n    nServices = NODE_NONE;\n    nTime = 100000000;\n}\n\nCInv::CInv()\n{\n    type = 0;\n    hash.SetNull();\n}\n\nCInv::CInv(int typeIn, const uint256& hashIn) : type(typeIn), hash(hashIn) {}\n\nbool operator<(const CInv& a, const CInv& b)\n{\n    return (a.type < b.type || (a.type == b.type && a.hash < b.hash));\n}\n\nstd::string CInv::GetCommand() const\n{\n    std::string cmd;\n    if (type & MSG_WITNESS_FLAG)\n        cmd.append(\"witness-\");\n    int masked = type & MSG_TYPE_MASK;\n    switch (masked)\n    {\n    case MSG_TX:             return cmd.append(NetMsgType::TX);\n    case MSG_BLOCK:          return cmd.append(NetMsgType::BLOCK);\n    case MSG_FILTERED_BLOCK: return cmd.append(NetMsgType::MERKLEBLOCK);\n    case MSG_CMPCT_BLOCK:    return cmd.append(NetMsgType::CMPCTBLOCK);\n    default:\n        throw std::out_of_range(strprintf(\"CInv::GetCommand(): type=%d unknown type\", type));\n    }\n}\n\nstd::string CInv::ToString() const\n{\n    try {\n        return strprintf(\"%s %s\", GetCommand(), hash.ToString());\n    } catch(const std::out_of_range &) {\n        return strprintf(\"0x%08x %s\", type, hash.ToString());\n    }\n}\n\nconst std::vector<std::string> &getAllNetMessageTypes()\n{\n    return allNetMessageTypesVec;\n}\n"
  },
  {
    "path": "src/protocol.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef __cplusplus\n#error This header can only be compiled as C++.\n#endif\n\n#ifndef BITCOIN_PROTOCOL_H\n#define BITCOIN_PROTOCOL_H\n\n#include <netaddress.h>\n#include <serialize.h>\n#include <uint256.h>\n#include <version.h>\n\n#include <stdint.h>\n#include <string>\n\n/** Message header.\n * (4) message start.\n * (12) command.\n * (4) size.\n * (4) checksum.\n */\nclass CMessageHeader\n{\npublic:\n    static constexpr size_t MESSAGE_START_SIZE = 4;\n    static constexpr size_t COMMAND_SIZE = 12;\n    static constexpr size_t MESSAGE_SIZE_SIZE = 4;\n    static constexpr size_t CHECKSUM_SIZE = 4;\n    static constexpr size_t MESSAGE_SIZE_OFFSET = MESSAGE_START_SIZE + COMMAND_SIZE;\n    static constexpr size_t CHECKSUM_OFFSET = MESSAGE_SIZE_OFFSET + MESSAGE_SIZE_SIZE;\n    static constexpr size_t HEADER_SIZE = MESSAGE_START_SIZE + COMMAND_SIZE + MESSAGE_SIZE_SIZE + CHECKSUM_SIZE;\n    typedef unsigned char MessageStartChars[MESSAGE_START_SIZE];\n\n    explicit CMessageHeader(const MessageStartChars& pchMessageStartIn);\n    CMessageHeader(const MessageStartChars& pchMessageStartIn, const char* pszCommand, unsigned int nMessageSizeIn);\n\n    std::string GetCommand() const;\n    bool IsValid(const MessageStartChars& messageStart) const;\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action)\n    {\n        READWRITE(FLATDATA(pchMessageStart));\n        READWRITE(FLATDATA(pchCommand));\n        READWRITE(nMessageSize);\n        READWRITE(FLATDATA(pchChecksum));\n    }\n\n    char pchMessageStart[MESSAGE_START_SIZE];\n    char pchCommand[COMMAND_SIZE];\n    uint32_t nMessageSize;\n    uint8_t pchChecksum[CHECKSUM_SIZE];\n};\n\n/**\n * Bitcoin protocol message types. When adding new message types, don't forget\n * to update allNetMessageTypes in protocol.cpp.\n */\nnamespace NetMsgType {\n\n/**\n * The version message provides information about the transmitting node to the\n * receiving node at the beginning of a connection.\n * @see https://bitcoin.org/en/developer-reference#version\n */\nextern const char *VERSION;\n/**\n * The verack message acknowledges a previously-received version message,\n * informing the connecting node that it can begin to send other messages.\n * @see https://bitcoin.org/en/developer-reference#verack\n */\nextern const char *VERACK;\n/**\n * The addr (IP address) message relays connection information for peers on the\n * network.\n * @see https://bitcoin.org/en/developer-reference#addr\n */\nextern const char *ADDR;\n/**\n * The inv message (inventory message) transmits one or more inventories of\n * objects known to the transmitting peer.\n * @see https://bitcoin.org/en/developer-reference#inv\n */\nextern const char *INV;\n/**\n * The getdata message requests one or more data objects from another node.\n * @see https://bitcoin.org/en/developer-reference#getdata\n */\nextern const char *GETDATA;\n/**\n * The merkleblock message is a reply to a getdata message which requested a\n * block using the inventory type MSG_MERKLEBLOCK.\n * @since protocol version 70001 as described by BIP37.\n * @see https://bitcoin.org/en/developer-reference#merkleblock\n */\nextern const char *MERKLEBLOCK;\n/**\n * The getblocks message requests an inv message that provides block header\n * hashes starting from a particular point in the block chain.\n * @see https://bitcoin.org/en/developer-reference#getblocks\n */\nextern const char *GETBLOCKS;\n/**\n * The getheaders message requests a headers message that provides block\n * headers starting from a particular point in the block chain.\n * @since protocol version 31800.\n * @see https://bitcoin.org/en/developer-reference#getheaders\n */\nextern const char *GETHEADERS;\n/**\n * The tx message transmits a single transaction.\n * @see https://bitcoin.org/en/developer-reference#tx\n */\nextern const char *TX;\n/**\n * The headers message sends one or more block headers to a node which\n * previously requested certain headers with a getheaders message.\n * @since protocol version 31800.\n * @see https://bitcoin.org/en/developer-reference#headers\n */\nextern const char *HEADERS;\n/**\n * The block message transmits a single serialized block.\n * @see https://bitcoin.org/en/developer-reference#block\n */\nextern const char *BLOCK;\n/**\n * The getaddr message requests an addr message from the receiving node,\n * preferably one with lots of IP addresses of other receiving nodes.\n * @see https://bitcoin.org/en/developer-reference#getaddr\n */\nextern const char *GETADDR;\n/**\n * The mempool message requests the TXIDs of transactions that the receiving\n * node has verified as valid but which have not yet appeared in a block.\n * @since protocol version 60002.\n * @see https://bitcoin.org/en/developer-reference#mempool\n */\nextern const char *MEMPOOL;\n/**\n * The ping message is sent periodically to help confirm that the receiving\n * peer is still connected.\n * @see https://bitcoin.org/en/developer-reference#ping\n */\nextern const char *PING;\n/**\n * The pong message replies to a ping message, proving to the pinging node that\n * the ponging node is still alive.\n * @since protocol version 60001 as described by BIP31.\n * @see https://bitcoin.org/en/developer-reference#pong\n */\nextern const char *PONG;\n/**\n * The notfound message is a reply to a getdata message which requested an\n * object the receiving node does not have available for relay.\n * @since protocol version 70001.\n * @see https://bitcoin.org/en/developer-reference#notfound\n */\nextern const char *NOTFOUND;\n/**\n * The filterload message tells the receiving peer to filter all relayed\n * transactions and requested merkle blocks through the provided filter.\n * @since protocol version 70001 as described by BIP37.\n *   Only available with service bit NODE_BLOOM since protocol version\n *   70011 as described by BIP111.\n * @see https://bitcoin.org/en/developer-reference#filterload\n */\nextern const char *FILTERLOAD;\n/**\n * The filteradd message tells the receiving peer to add a single element to a\n * previously-set bloom filter, such as a new public key.\n * @since protocol version 70001 as described by BIP37.\n *   Only available with service bit NODE_BLOOM since protocol version\n *   70011 as described by BIP111.\n * @see https://bitcoin.org/en/developer-reference#filteradd\n */\nextern const char *FILTERADD;\n/**\n * The filterclear message tells the receiving peer to remove a previously-set\n * bloom filter.\n * @since protocol version 70001 as described by BIP37.\n *   Only available with service bit NODE_BLOOM since protocol version\n *   70011 as described by BIP111.\n * @see https://bitcoin.org/en/developer-reference#filterclear\n */\nextern const char *FILTERCLEAR;\n/**\n * The reject message informs the receiving node that one of its previous\n * messages has been rejected.\n * @since protocol version 70002 as described by BIP61.\n * @see https://bitcoin.org/en/developer-reference#reject\n */\nextern const char *REJECT;\n/**\n * Indicates that a node prefers to receive new block announcements via a\n * \"headers\" message rather than an \"inv\".\n * @since protocol version 70012 as described by BIP130.\n * @see https://bitcoin.org/en/developer-reference#sendheaders\n */\nextern const char *SENDHEADERS;\n/**\n * The feefilter message tells the receiving peer not to inv us any txs\n * which do not meet the specified min fee rate.\n * @since protocol version 70013 as described by BIP133\n */\nextern const char *FEEFILTER;\n/**\n * Contains a 1-byte bool and 8-byte LE version number.\n * Indicates that a node is willing to provide blocks via \"cmpctblock\" messages.\n * May indicate that a node prefers to receive new block announcements via a\n * \"cmpctblock\" message rather than an \"inv\", depending on message contents.\n * @since protocol version 70014 as described by BIP 152\n */\nextern const char *SENDCMPCT;\n/**\n * Contains a CBlockHeaderAndShortTxIDs object - providing a header and\n * list of \"short txids\".\n * @since protocol version 70014 as described by BIP 152\n */\nextern const char *CMPCTBLOCK;\n/**\n * Contains a BlockTransactionsRequest\n * Peer should respond with \"blocktxn\" message.\n * @since protocol version 70014 as described by BIP 152\n */\nextern const char *GETBLOCKTXN;\n/**\n * Contains a BlockTransactions.\n * Sent in response to a \"getblocktxn\" message.\n * @since protocol version 70014 as described by BIP 152\n */\nextern const char *BLOCKTXN;\n};\n\n/* Get a vector of all valid message types (see above) */\nconst std::vector<std::string> &getAllNetMessageTypes();\n\n/** nServices flags */\nenum ServiceFlags : uint64_t {\n    // Nothing\n    NODE_NONE = 0,\n    // NODE_NETWORK means that the node is capable of serving the complete block chain. It is currently\n    // set by all Bitcoin Core non pruned nodes, and is unset by SPV clients or other light clients.\n    NODE_NETWORK = (1 << 0),\n    // NODE_GETUTXO means the node is capable of responding to the getutxo protocol request.\n    // Bitcoin Core does not support this but a patch set called Bitcoin XT does.\n    // See BIP 64 for details on how this is implemented.\n    NODE_GETUTXO = (1 << 1),\n    // NODE_BLOOM means the node is capable and willing to handle bloom-filtered connections.\n    // Bitcoin Core nodes used to support this by default, without advertising this bit,\n    // but no longer do as of protocol version 70011 (= NO_BLOOM_VERSION)\n    NODE_BLOOM = (1 << 2),\n    // NODE_WITNESS indicates that a node can be asked for blocks and transactions including\n    // witness data.\n    NODE_WITNESS = (1 << 3),\n    // NODE_XTHIN means the node supports Xtreme Thinblocks\n    // If this is turned off then the node will not service nor make xthin requests\n    NODE_XTHIN = (1 << 4),\n    // NODE_NETWORK_LIMITED means the same as NODE_NETWORK with the limitation of only\n    // serving the last 288 (2 day) blocks\n    // See BIP159 for details on how this is implemented.\n    NODE_NETWORK_LIMITED = (1 << 10),\n\n    // Bits 24-31 are reserved for temporary experiments. Just pick a bit that\n    // isn't getting used, or one not being used much, and notify the\n    // bitcoin-development mailing list. Remember that service bits are just\n    // unauthenticated advertisements, so your code must be robust against\n    // collisions and other cases where nodes may be advertising a service they\n    // do not actually support. Other service bits should be allocated via the\n    // BIP process.\n};\n\n/**\n * Gets the set of service flags which are \"desirable\" for a given peer.\n *\n * These are the flags which are required for a peer to support for them\n * to be \"interesting\" to us, ie for us to wish to use one of our few\n * outbound connection slots for or for us to wish to prioritize keeping\n * their connection around.\n *\n * Relevant service flags may be peer- and state-specific in that the\n * version of the peer may determine which flags are required (eg in the\n * case of NODE_NETWORK_LIMITED where we seek out NODE_NETWORK peers\n * unless they set NODE_NETWORK_LIMITED and we are out of IBD, in which\n * case NODE_NETWORK_LIMITED suffices).\n *\n * Thus, generally, avoid calling with peerServices == NODE_NONE, unless\n * state-specific flags must absolutely be avoided. When called with\n * peerServices == NODE_NONE, the returned desirable service flags are\n * guaranteed to not change dependant on state - ie they are suitable for\n * use when describing peers which we know to be desirable, but for which\n * we do not have a confirmed set of service flags.\n *\n * If the NODE_NONE return value is changed, contrib/seeds/makeseeds.py\n * should be updated appropriately to filter for the same nodes.\n */\nstatic ServiceFlags GetDesirableServiceFlags(ServiceFlags services) {\n    return ServiceFlags(NODE_NETWORK | NODE_WITNESS);\n}\n\n/**\n * A shortcut for (services & GetDesirableServiceFlags(services))\n * == GetDesirableServiceFlags(services), ie determines whether the given\n * set of service flags are sufficient for a peer to be \"relevant\".\n */\nstatic inline bool HasAllDesirableServiceFlags(ServiceFlags services) {\n    return !(GetDesirableServiceFlags(services) & (~services));\n}\n\n/**\n * Checks if a peer with the given service flags may be capable of having a\n * robust address-storage DB. Currently an alias for checking NODE_NETWORK.\n */\nstatic inline bool MayHaveUsefulAddressDB(ServiceFlags services) {\n    return services & NODE_NETWORK;\n}\n\n/** A CService with information about it as peer */\nclass CAddress : public CService\n{\npublic:\n    CAddress();\n    explicit CAddress(CService ipIn, ServiceFlags nServicesIn);\n\n    void Init();\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action)\n    {\n        if (ser_action.ForRead())\n            Init();\n        int nVersion = s.GetVersion();\n        if (s.GetType() & SER_DISK)\n            READWRITE(nVersion);\n        if ((s.GetType() & SER_DISK) ||\n            (nVersion >= CADDR_TIME_VERSION && !(s.GetType() & SER_GETHASH)))\n            READWRITE(nTime);\n        uint64_t nServicesInt = nServices;\n        READWRITE(nServicesInt);\n        nServices = (ServiceFlags)nServicesInt;\n        READWRITE(*(CService*)this);\n    }\n\n    // TODO: make private (improves encapsulation)\npublic:\n    ServiceFlags nServices;\n\n    // disk and network only\n    unsigned int nTime;\n};\n\n/** getdata message type flags */\nconst uint32_t MSG_WITNESS_FLAG = 1 << 30;\nconst uint32_t MSG_TYPE_MASK    = 0xffffffff >> 2;\n\n/** getdata / inv message types.\n * These numbers are defined by the protocol. When adding a new value, be sure\n * to mention it in the respective BIP.\n */\nenum GetDataMsg\n{\n    UNDEFINED = 0,\n    MSG_TX = 1,\n    MSG_BLOCK = 2,\n    // The following can only occur in getdata. Invs always use TX or BLOCK.\n    MSG_FILTERED_BLOCK = 3,  //!< Defined in BIP37\n    MSG_CMPCT_BLOCK = 4,     //!< Defined in BIP152\n    MSG_WITNESS_BLOCK = MSG_BLOCK | MSG_WITNESS_FLAG, //!< Defined in BIP144\n    MSG_WITNESS_TX = MSG_TX | MSG_WITNESS_FLAG,       //!< Defined in BIP144\n    MSG_FILTERED_WITNESS_BLOCK = MSG_FILTERED_BLOCK | MSG_WITNESS_FLAG,\n};\n\n/** inv message data */\nclass CInv\n{\npublic:\n    CInv();\n    CInv(int typeIn, const uint256& hashIn);\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action)\n    {\n        READWRITE(type);\n        READWRITE(hash);\n    }\n\n    friend bool operator<(const CInv& a, const CInv& b);\n\n    std::string GetCommand() const;\n    std::string ToString() const;\n\n    // TODO: make private (improves encapsulation)\npublic:\n    int type;\n    uint256 hash;\n};\n\n#endif // BITCOIN_PROTOCOL_H\n"
  },
  {
    "path": "src/pubkey.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2017 The Zcash developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <pubkey.h>\n\n#include <secp256k1.h>\n#include <secp256k1_recovery.h>\n\nnamespace\n{\n/* Global secp256k1_context object used for verification. */\nsecp256k1_context* secp256k1_context_verify = nullptr;\n} // namespace\n\n/** This function is taken from the libsecp256k1 distribution and implements\n *  DER parsing for ECDSA signatures, while supporting an arbitrary subset of\n *  format violations.\n *\n *  Supported violations include negative integers, excessive padding, garbage\n *  at the end, and overly long length descriptors. This is safe to use in\n *  Bitcoin because since the activation of BIP66, signatures are verified to be\n *  strict DER before being passed to this module, and we know it supports all\n *  violations present in the blockchain before that point.\n */\nstatic int ecdsa_signature_parse_der_lax(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {\n    size_t rpos, rlen, spos, slen;\n    size_t pos = 0;\n    size_t lenbyte;\n    unsigned char tmpsig[64] = {0};\n    int overflow = 0;\n\n    /* Hack to initialize sig with a correctly-parsed but invalid signature. */\n    secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);\n\n    /* Sequence tag byte */\n    if (pos == inputlen || input[pos] != 0x30) {\n        return 0;\n    }\n    pos++;\n\n    /* Sequence length bytes */\n    if (pos == inputlen) {\n        return 0;\n    }\n    lenbyte = input[pos++];\n    if (lenbyte & 0x80) {\n        lenbyte -= 0x80;\n        if (lenbyte > inputlen - pos) {\n            return 0;\n        }\n        pos += lenbyte;\n    }\n\n    /* Integer tag byte for R */\n    if (pos == inputlen || input[pos] != 0x02) {\n        return 0;\n    }\n    pos++;\n\n    /* Integer length for R */\n    if (pos == inputlen) {\n        return 0;\n    }\n    lenbyte = input[pos++];\n    if (lenbyte & 0x80) {\n        lenbyte -= 0x80;\n        if (lenbyte > inputlen - pos) {\n            return 0;\n        }\n        while (lenbyte > 0 && input[pos] == 0) {\n            pos++;\n            lenbyte--;\n        }\n        static_assert(sizeof(size_t) >= 4, \"size_t too small\");\n        if (lenbyte >= 4) {\n            return 0;\n        }\n        rlen = 0;\n        while (lenbyte > 0) {\n            rlen = (rlen << 8) + input[pos];\n            pos++;\n            lenbyte--;\n        }\n    } else {\n        rlen = lenbyte;\n    }\n    if (rlen > inputlen - pos) {\n        return 0;\n    }\n    rpos = pos;\n    pos += rlen;\n\n    /* Integer tag byte for S */\n    if (pos == inputlen || input[pos] != 0x02) {\n        return 0;\n    }\n    pos++;\n\n    /* Integer length for S */\n    if (pos == inputlen) {\n        return 0;\n    }\n    lenbyte = input[pos++];\n    if (lenbyte & 0x80) {\n        lenbyte -= 0x80;\n        if (lenbyte > inputlen - pos) {\n            return 0;\n        }\n        while (lenbyte > 0 && input[pos] == 0) {\n            pos++;\n            lenbyte--;\n        }\n        static_assert(sizeof(size_t) >= 4, \"size_t too small\");\n        if (lenbyte >= 4) {\n            return 0;\n        }\n        slen = 0;\n        while (lenbyte > 0) {\n            slen = (slen << 8) + input[pos];\n            pos++;\n            lenbyte--;\n        }\n    } else {\n        slen = lenbyte;\n    }\n    if (slen > inputlen - pos) {\n        return 0;\n    }\n    spos = pos;\n\n    /* Ignore leading zeroes in R */\n    while (rlen > 0 && input[rpos] == 0) {\n        rlen--;\n        rpos++;\n    }\n    /* Copy R value */\n    if (rlen > 32) {\n        overflow = 1;\n    } else {\n        memcpy(tmpsig + 32 - rlen, input + rpos, rlen);\n    }\n\n    /* Ignore leading zeroes in S */\n    while (slen > 0 && input[spos] == 0) {\n        slen--;\n        spos++;\n    }\n    /* Copy S value */\n    if (slen > 32) {\n        overflow = 1;\n    } else {\n        memcpy(tmpsig + 64 - slen, input + spos, slen);\n    }\n\n    if (!overflow) {\n        overflow = !secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);\n    }\n    if (overflow) {\n        /* Overwrite the result again with a correctly-parsed but invalid\n           signature if parsing failed. */\n        memset(tmpsig, 0, 64);\n        secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);\n    }\n    return 1;\n}\n\nbool CPubKey::Verify(const uint256 &hash, const std::vector<unsigned char>& vchSig) const {\n    if (!IsValid())\n        return false;\n    secp256k1_pubkey pubkey;\n    secp256k1_ecdsa_signature sig;\n    if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {\n        return false;\n    }\n    if (!ecdsa_signature_parse_der_lax(secp256k1_context_verify, &sig, vchSig.data(), vchSig.size())) {\n        return false;\n    }\n    /* libsecp256k1's ECDSA verification requires lower-S signatures, which have\n     * not historically been enforced in Bitcoin, so normalize them first. */\n    secp256k1_ecdsa_signature_normalize(secp256k1_context_verify, &sig, &sig);\n    return secp256k1_ecdsa_verify(secp256k1_context_verify, &sig, hash.begin(), &pubkey);\n}\n\nbool CPubKey::RecoverCompact(const uint256 &hash, const std::vector<unsigned char>& vchSig) {\n    if (vchSig.size() != COMPACT_SIGNATURE_SIZE)\n        return false;\n    int recid = (vchSig[0] - 27) & 3;\n    bool fComp = ((vchSig[0] - 27) & 4) != 0;\n    secp256k1_pubkey pubkey;\n    secp256k1_ecdsa_recoverable_signature sig;\n    if (!secp256k1_ecdsa_recoverable_signature_parse_compact(secp256k1_context_verify, &sig, &vchSig[1], recid)) {\n        return false;\n    }\n    if (!secp256k1_ecdsa_recover(secp256k1_context_verify, &pubkey, &sig, hash.begin())) {\n        return false;\n    }\n    unsigned char pub[PUBLIC_KEY_SIZE];\n    size_t publen = PUBLIC_KEY_SIZE;\n    secp256k1_ec_pubkey_serialize(secp256k1_context_verify, pub, &publen, &pubkey, fComp ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);\n    Set(pub, pub + publen);\n    return true;\n}\n\nbool CPubKey::IsFullyValid() const {\n    if (!IsValid())\n        return false;\n    secp256k1_pubkey pubkey;\n    return secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size());\n}\n\nbool CPubKey::Decompress() {\n    if (!IsValid())\n        return false;\n    secp256k1_pubkey pubkey;\n    if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {\n        return false;\n    }\n    unsigned char pub[PUBLIC_KEY_SIZE];\n    size_t publen = PUBLIC_KEY_SIZE;\n    secp256k1_ec_pubkey_serialize(secp256k1_context_verify, pub, &publen, &pubkey, SECP256K1_EC_UNCOMPRESSED);\n    Set(pub, pub + publen);\n    return true;\n}\n\nbool CPubKey::Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const {\n    assert(IsValid());\n    assert((nChild >> 31) == 0);\n    assert(size() == COMPRESSED_PUBLIC_KEY_SIZE);\n    unsigned char out[64];\n    BIP32Hash(cc, nChild, *begin(), begin()+1, out);\n    memcpy(ccChild.begin(), out+32, 32);\n    secp256k1_pubkey pubkey;\n    if (!secp256k1_ec_pubkey_parse(secp256k1_context_verify, &pubkey, &(*this)[0], size())) {\n        return false;\n    }\n    if (!secp256k1_ec_pubkey_tweak_add(secp256k1_context_verify, &pubkey, out)) {\n        return false;\n    }\n    unsigned char pub[COMPRESSED_PUBLIC_KEY_SIZE];\n    size_t publen = COMPRESSED_PUBLIC_KEY_SIZE;\n    secp256k1_ec_pubkey_serialize(secp256k1_context_verify, pub, &publen, &pubkey, SECP256K1_EC_COMPRESSED);\n    pubkeyChild.Set(pub, pub + publen);\n    return true;\n}\n\nvoid CExtPubKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const {\n    code[0] = nDepth;\n    memcpy(code+1, vchFingerprint, 4);\n    code[5] = (nChild >> 24) & 0xFF; code[6] = (nChild >> 16) & 0xFF;\n    code[7] = (nChild >>  8) & 0xFF; code[8] = (nChild >>  0) & 0xFF;\n    memcpy(code+9, chaincode.begin(), 32);\n    assert(pubkey.size() == CPubKey::COMPRESSED_PUBLIC_KEY_SIZE);\n    memcpy(code+41, pubkey.begin(), CPubKey::COMPRESSED_PUBLIC_KEY_SIZE);\n}\n\nvoid CExtPubKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) {\n    nDepth = code[0];\n    memcpy(vchFingerprint, code+1, 4);\n    nChild = (code[5] << 24) | (code[6] << 16) | (code[7] << 8) | code[8];\n    memcpy(chaincode.begin(), code+9, 32);\n    pubkey.Set(code+41, code+BIP32_EXTKEY_SIZE);\n}\n\nbool CExtPubKey::Derive(CExtPubKey &out, unsigned int _nChild) const {\n    out.nDepth = nDepth + 1;\n    CKeyID id = pubkey.GetID();\n    memcpy(&out.vchFingerprint[0], &id, 4);\n    out.nChild = _nChild;\n    return pubkey.Derive(out.pubkey, out.chaincode, _nChild, chaincode);\n}\n\n/* static */ bool CPubKey::CheckLowS(const std::vector<unsigned char>& vchSig) {\n    secp256k1_ecdsa_signature sig;\n    if (!ecdsa_signature_parse_der_lax(secp256k1_context_verify, &sig, vchSig.data(), vchSig.size())) {\n        return false;\n    }\n    return (!secp256k1_ecdsa_signature_normalize(secp256k1_context_verify, nullptr, &sig));\n}\n\n/* static */ int ECCVerifyHandle::refcount = 0;\n\nECCVerifyHandle::ECCVerifyHandle()\n{\n    if (refcount == 0) {\n        assert(secp256k1_context_verify == nullptr);\n        secp256k1_context_verify = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY);\n        assert(secp256k1_context_verify != nullptr);\n    }\n    refcount++;\n}\n\nECCVerifyHandle::~ECCVerifyHandle()\n{\n    refcount--;\n    if (refcount == 0) {\n        assert(secp256k1_context_verify != nullptr);\n        secp256k1_context_destroy(secp256k1_context_verify);\n        secp256k1_context_verify = nullptr;\n    }\n}\n"
  },
  {
    "path": "src/pubkey.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2017 The Zcash developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_PUBKEY_H\n#define BITCOIN_PUBKEY_H\n\n#include <hash.h>\n#include <serialize.h>\n#include <uint256.h>\n\n#include <stdexcept>\n#include <vector>\n\nconst unsigned int BIP32_EXTKEY_SIZE = 74;\n\n/** A reference to a CKey: the Hash160 of its serialized public key */\nclass CKeyID : public uint160\n{\npublic:\n    CKeyID() : uint160() {}\n    explicit CKeyID(const uint160& in) : uint160(in) {}\n};\n\ntypedef uint256 ChainCode;\n\n/** An encapsulated public key. */\nclass CPubKey\n{\npublic:\n    /**\n     * secp256k1:\n     */\n    static const unsigned int PUBLIC_KEY_SIZE             = 65;\n    static const unsigned int COMPRESSED_PUBLIC_KEY_SIZE  = 33;\n    static const unsigned int SIGNATURE_SIZE              = 72;\n    static const unsigned int COMPACT_SIGNATURE_SIZE      = 65;\n    /**\n     * see www.keylength.com\n     * script supports up to 75 for single byte push\n     */\n    static_assert(\n        PUBLIC_KEY_SIZE >= COMPRESSED_PUBLIC_KEY_SIZE,\n        \"COMPRESSED_PUBLIC_KEY_SIZE is larger than PUBLIC_KEY_SIZE\");\n\nprivate:\n\n    /**\n     * Just store the serialized data.\n     * Its length can very cheaply be computed from the first byte.\n     */\n    unsigned char vch[PUBLIC_KEY_SIZE];\n\n    //! Compute the length of a pubkey with a given first byte.\n    unsigned int static GetLen(unsigned char chHeader)\n    {\n        if (chHeader == 2 || chHeader == 3)\n            return COMPRESSED_PUBLIC_KEY_SIZE;\n        if (chHeader == 4 || chHeader == 6 || chHeader == 7)\n            return PUBLIC_KEY_SIZE;\n        return 0;\n    }\n\n    //! Set this key data to be invalid\n    void Invalidate()\n    {\n        vch[0] = 0xFF;\n    }\n\npublic:\n    //! Construct an invalid public key.\n    CPubKey()\n    {\n        Invalidate();\n    }\n\n    //! Initialize a public key using begin/end iterators to byte data.\n    template <typename T>\n    void Set(const T pbegin, const T pend)\n    {\n        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);\n        if (len && len == (pend - pbegin))\n            memcpy(vch, (unsigned char*)&pbegin[0], len);\n        else\n            Invalidate();\n    }\n\n    //! Construct a public key using begin/end iterators to byte data.\n    template <typename T>\n    CPubKey(const T pbegin, const T pend)\n    {\n        Set(pbegin, pend);\n    }\n\n    //! Construct a public key from a byte vector.\n    explicit CPubKey(const std::vector<unsigned char>& _vch)\n    {\n        Set(_vch.begin(), _vch.end());\n    }\n\n    //! Simple read-only vector-like interface to the pubkey data.\n    unsigned int size() const { return GetLen(vch[0]); }\n    const unsigned char* begin() const { return vch; }\n    const unsigned char* end() const { return vch + size(); }\n    const unsigned char& operator[](unsigned int pos) const { return vch[pos]; }\n\n    //! Comparator implementation.\n    friend bool operator==(const CPubKey& a, const CPubKey& b)\n    {\n        return a.vch[0] == b.vch[0] &&\n               memcmp(a.vch, b.vch, a.size()) == 0;\n    }\n    friend bool operator!=(const CPubKey& a, const CPubKey& b)\n    {\n        return !(a == b);\n    }\n    friend bool operator<(const CPubKey& a, const CPubKey& b)\n    {\n        return a.vch[0] < b.vch[0] ||\n               (a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) < 0);\n    }\n\n    //! Implement serialization, as if this was a byte vector.\n    template <typename Stream>\n    void Serialize(Stream& s) const\n    {\n        unsigned int len = size();\n        ::WriteCompactSize(s, len);\n        s.write((char*)vch, len);\n    }\n    template <typename Stream>\n    void Unserialize(Stream& s)\n    {\n        unsigned int len = ::ReadCompactSize(s);\n        if (len <= PUBLIC_KEY_SIZE) {\n            s.read((char*)vch, len);\n        } else {\n            // invalid pubkey, skip available data\n            char dummy;\n            while (len--)\n                s.read(&dummy, 1);\n            Invalidate();\n        }\n    }\n\n    //! Get the KeyID of this public key (hash of its serialization)\n    CKeyID GetID() const\n    {\n        return CKeyID(Hash160(vch, vch + size()));\n    }\n\n    //! Get the 256-bit hash of this public key.\n    uint256 GetHash() const\n    {\n        return Hash(vch, vch + size());\n    }\n\n    /*\n     * Check syntactic correctness.\n     *\n     * Note that this is consensus critical as CheckSig() calls it!\n     */\n    bool IsValid() const\n    {\n        return size() > 0;\n    }\n\n    //! fully validate whether this is a valid public key (more expensive than IsValid())\n    bool IsFullyValid() const;\n\n    //! Check whether this is a compressed public key.\n    bool IsCompressed() const\n    {\n        return size() == COMPRESSED_PUBLIC_KEY_SIZE;\n    }\n\n    /**\n     * Verify a DER signature (~72 bytes).\n     * If this public key is not fully valid, the return value will be false.\n     */\n    bool Verify(const uint256& hash, const std::vector<unsigned char>& vchSig) const;\n\n    /**\n     * Check whether a signature is normalized (lower-S).\n     */\n    static bool CheckLowS(const std::vector<unsigned char>& vchSig);\n\n    //! Recover a public key from a compact signature.\n    bool RecoverCompact(const uint256& hash, const std::vector<unsigned char>& vchSig);\n\n    //! Turn this public key into an uncompressed public key.\n    bool Decompress();\n\n    //! Derive BIP32 child pubkey.\n    bool Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const;\n};\n\nstruct CExtPubKey {\n    unsigned char nDepth;\n    unsigned char vchFingerprint[4];\n    unsigned int nChild;\n    ChainCode chaincode;\n    CPubKey pubkey;\n\n    friend bool operator==(const CExtPubKey &a, const CExtPubKey &b)\n    {\n        return a.nDepth == b.nDepth &&\n            memcmp(&a.vchFingerprint[0], &b.vchFingerprint[0], sizeof(vchFingerprint)) == 0 &&\n            a.nChild == b.nChild &&\n            a.chaincode == b.chaincode &&\n            a.pubkey == b.pubkey;\n    }\n\n    void Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const;\n    void Decode(const unsigned char code[BIP32_EXTKEY_SIZE]);\n    bool Derive(CExtPubKey& out, unsigned int nChild) const;\n\n    void Serialize(CSizeComputer& s) const\n    {\n        // Optimized implementation for ::GetSerializeSize that avoids copying.\n        s.seek(BIP32_EXTKEY_SIZE + 1); // add one byte for the size (compact int)\n    }\n    template <typename Stream>\n    void Serialize(Stream& s) const\n    {\n        unsigned int len = BIP32_EXTKEY_SIZE;\n        ::WriteCompactSize(s, len);\n        unsigned char code[BIP32_EXTKEY_SIZE];\n        Encode(code);\n        s.write((const char *)&code[0], len);\n    }\n    template <typename Stream>\n    void Unserialize(Stream& s)\n    {\n        unsigned int len = ::ReadCompactSize(s);\n        unsigned char code[BIP32_EXTKEY_SIZE];\n        if (len != BIP32_EXTKEY_SIZE)\n            throw std::runtime_error(\"Invalid extended key size\\n\");\n        s.read((char *)&code[0], len);\n        Decode(code);\n    }\n};\n\n/** Users of this module must hold an ECCVerifyHandle. The constructor and\n *  destructor of these are not allowed to run in parallel, though. */\nclass ECCVerifyHandle\n{\n    static int refcount;\n\npublic:\n    ECCVerifyHandle();\n    ~ECCVerifyHandle();\n};\n\n#endif // BITCOIN_PUBKEY_H\n"
  },
  {
    "path": "src/qt/addressbookpage.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <qt/addressbookpage.h>\n#include <qt/forms/ui_addressbookpage.h>\n\n#include <qt/addresstablemodel.h>\n#include <qt/bitcoingui.h>\n#include <qt/csvmodelwriter.h>\n#include <qt/editaddressdialog.h>\n#include <qt/guiutil.h>\n#include <qt/platformstyle.h>\n\n#include <QIcon>\n#include <QMenu>\n#include <QMessageBox>\n#include <QSortFilterProxyModel>\n\nAddressBookPage::AddressBookPage(const PlatformStyle *platformStyle, Mode _mode, Tabs _tab, QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::AddressBookPage),\n    model(0),\n    mode(_mode),\n    tab(_tab)\n{\n    ui->setupUi(this);\n\n    if (!platformStyle->getImagesOnButtons()) {\n        ui->newAddress->setIcon(QIcon());\n        ui->copyAddress->setIcon(QIcon());\n        ui->deleteAddress->setIcon(QIcon());\n        ui->exportButton->setIcon(QIcon());\n    } else {\n        ui->newAddress->setIcon(platformStyle->SingleColorIcon(\":/icons/add\"));\n        ui->copyAddress->setIcon(platformStyle->SingleColorIcon(\":/icons/editcopy\"));\n        ui->deleteAddress->setIcon(platformStyle->SingleColorIcon(\":/icons/remove\"));\n        ui->exportButton->setIcon(platformStyle->SingleColorIcon(\":/icons/export\"));\n    }\n\n    switch(mode)\n    {\n    case ForSelection:\n        switch(tab)\n        {\n        case SendingTab: setWindowTitle(tr(\"Choose the address to send coins to\")); break;\n        case ReceivingTab: setWindowTitle(tr(\"Choose the address to receive coins with\")); break;\n        }\n        connect(ui->tableView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(accept()));\n        ui->tableView->setEditTriggers(QAbstractItemView::NoEditTriggers);\n        ui->tableView->setFocus();\n        ui->closeButton->setText(tr(\"C&hoose\"));\n        ui->exportButton->hide();\n        break;\n    case ForEditing:\n        switch(tab)\n        {\n        case SendingTab: setWindowTitle(tr(\"Sending addresses\")); break;\n        case ReceivingTab: setWindowTitle(tr(\"Receiving addresses\")); break;\n        }\n        break;\n    }\n    switch(tab)\n    {\n    case SendingTab:\n        ui->labelExplanation->setText(tr(\"These are your Sugarchain addresses for sending payments. Always check the amount and the receiving address before sending coins.\"));\n        ui->deleteAddress->setVisible(true);\n        break;\n    case ReceivingTab:\n        ui->labelExplanation->setText(tr(\"These are your Sugarchain addresses for receiving payments. It is recommended to use a new receiving address for each transaction.\"));\n        ui->deleteAddress->setVisible(false);\n        break;\n    }\n\n    // Context menu actions\n    QAction *copyAddressAction = new QAction(tr(\"&Copy Address\"), this);\n    QAction *copyLabelAction = new QAction(tr(\"Copy &Label\"), this);\n    QAction *editAction = new QAction(tr(\"&Edit\"), this);\n    deleteAction = new QAction(ui->deleteAddress->text(), this);\n\n    // Build context menu\n    contextMenu = new QMenu(this);\n    contextMenu->addAction(copyAddressAction);\n    contextMenu->addAction(copyLabelAction);\n    contextMenu->addAction(editAction);\n    if(tab == SendingTab)\n        contextMenu->addAction(deleteAction);\n    contextMenu->addSeparator();\n\n    // Connect signals for context menu actions\n    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(on_copyAddress_clicked()));\n    connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(onCopyLabelAction()));\n    connect(editAction, SIGNAL(triggered()), this, SLOT(onEditAction()));\n    connect(deleteAction, SIGNAL(triggered()), this, SLOT(on_deleteAddress_clicked()));\n\n    connect(ui->tableView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));\n\n    connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(accept()));\n}\n\nAddressBookPage::~AddressBookPage()\n{\n    delete ui;\n}\n\nvoid AddressBookPage::setModel(AddressTableModel *_model)\n{\n    this->model = _model;\n    if(!_model)\n        return;\n\n    proxyModel = new QSortFilterProxyModel(this);\n    proxyModel->setSourceModel(_model);\n    proxyModel->setDynamicSortFilter(true);\n    proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);\n    proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);\n    switch(tab)\n    {\n    case ReceivingTab:\n        // Receive filter\n        proxyModel->setFilterRole(AddressTableModel::TypeRole);\n        proxyModel->setFilterFixedString(AddressTableModel::Receive);\n        break;\n    case SendingTab:\n        // Send filter\n        proxyModel->setFilterRole(AddressTableModel::TypeRole);\n        proxyModel->setFilterFixedString(AddressTableModel::Send);\n        break;\n    }\n    ui->tableView->setModel(proxyModel);\n    ui->tableView->sortByColumn(0, Qt::AscendingOrder);\n\n    // Set column widths\n#if QT_VERSION < 0x050000\n    ui->tableView->horizontalHeader()->setResizeMode(AddressTableModel::Label, QHeaderView::Stretch);\n    ui->tableView->horizontalHeader()->setResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents);\n#else\n    ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Label, QHeaderView::Stretch);\n    ui->tableView->horizontalHeader()->setSectionResizeMode(AddressTableModel::Address, QHeaderView::ResizeToContents);\n#endif\n\n    connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),\n        this, SLOT(selectionChanged()));\n\n    // Select row for newly created address\n    connect(_model, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(selectNewAddress(QModelIndex,int,int)));\n\n    selectionChanged();\n}\n\nvoid AddressBookPage::on_copyAddress_clicked()\n{\n    GUIUtil::copyEntryData(ui->tableView, AddressTableModel::Address);\n}\n\nvoid AddressBookPage::onCopyLabelAction()\n{\n    GUIUtil::copyEntryData(ui->tableView, AddressTableModel::Label);\n}\n\nvoid AddressBookPage::onEditAction()\n{\n    if(!model)\n        return;\n\n    if(!ui->tableView->selectionModel())\n        return;\n    QModelIndexList indexes = ui->tableView->selectionModel()->selectedRows();\n    if(indexes.isEmpty())\n        return;\n\n    EditAddressDialog dlg(\n        tab == SendingTab ?\n        EditAddressDialog::EditSendingAddress :\n        EditAddressDialog::EditReceivingAddress, this);\n    dlg.setModel(model);\n    QModelIndex origIndex = proxyModel->mapToSource(indexes.at(0));\n    dlg.loadRow(origIndex.row());\n    dlg.exec();\n}\n\nvoid AddressBookPage::on_newAddress_clicked()\n{\n    if(!model)\n        return;\n\n    EditAddressDialog dlg(\n        tab == SendingTab ?\n        EditAddressDialog::NewSendingAddress :\n        EditAddressDialog::NewReceivingAddress, this);\n    dlg.setModel(model);\n    if(dlg.exec())\n    {\n        newAddressToSelect = dlg.getAddress();\n    }\n}\n\nvoid AddressBookPage::on_deleteAddress_clicked()\n{\n    QTableView *table = ui->tableView;\n    if(!table->selectionModel())\n        return;\n\n    QModelIndexList indexes = table->selectionModel()->selectedRows();\n    if(!indexes.isEmpty())\n    {\n        table->model()->removeRow(indexes.at(0).row());\n    }\n}\n\nvoid AddressBookPage::selectionChanged()\n{\n    // Set button states based on selected tab and selection\n    QTableView *table = ui->tableView;\n    if(!table->selectionModel())\n        return;\n\n    if(table->selectionModel()->hasSelection())\n    {\n        switch(tab)\n        {\n        case SendingTab:\n            // In sending tab, allow deletion of selection\n            ui->deleteAddress->setEnabled(true);\n            ui->deleteAddress->setVisible(true);\n            deleteAction->setEnabled(true);\n            break;\n        case ReceivingTab:\n            // Deleting receiving addresses, however, is not allowed\n            ui->deleteAddress->setEnabled(false);\n            ui->deleteAddress->setVisible(false);\n            deleteAction->setEnabled(false);\n            break;\n        }\n        ui->copyAddress->setEnabled(true);\n    }\n    else\n    {\n        ui->deleteAddress->setEnabled(false);\n        ui->copyAddress->setEnabled(false);\n    }\n}\n\nvoid AddressBookPage::done(int retval)\n{\n    QTableView *table = ui->tableView;\n    if(!table->selectionModel() || !table->model())\n        return;\n\n    // Figure out which address was selected, and return it\n    QModelIndexList indexes = table->selectionModel()->selectedRows(AddressTableModel::Address);\n\n    for (const QModelIndex& index : indexes) {\n        QVariant address = table->model()->data(index);\n        returnValue = address.toString();\n    }\n\n    if(returnValue.isEmpty())\n    {\n        // If no address entry selected, return rejected\n        retval = Rejected;\n    }\n\n    QDialog::done(retval);\n}\n\nvoid AddressBookPage::on_exportButton_clicked()\n{\n    // CSV is currently the only supported format\n    QString filename = GUIUtil::getSaveFileName(this,\n        tr(\"Export Address List\"), QString(),\n        tr(\"Comma separated file (*.csv)\"), nullptr);\n\n    if (filename.isNull())\n        return;\n\n    CSVModelWriter writer(filename);\n\n    // name, column, role\n    writer.setModel(proxyModel);\n    writer.addColumn(\"Label\", AddressTableModel::Label, Qt::EditRole);\n    writer.addColumn(\"Address\", AddressTableModel::Address, Qt::EditRole);\n\n    if(!writer.write()) {\n        QMessageBox::critical(this, tr(\"Exporting Failed\"),\n            tr(\"There was an error trying to save the address list to %1. Please try again.\").arg(filename));\n    }\n}\n\nvoid AddressBookPage::contextualMenu(const QPoint &point)\n{\n    QModelIndex index = ui->tableView->indexAt(point);\n    if(index.isValid())\n    {\n        contextMenu->exec(QCursor::pos());\n    }\n}\n\nvoid AddressBookPage::selectNewAddress(const QModelIndex &parent, int begin, int /*end*/)\n{\n    QModelIndex idx = proxyModel->mapFromSource(model->index(begin, AddressTableModel::Address, parent));\n    if(idx.isValid() && (idx.data(Qt::EditRole).toString() == newAddressToSelect))\n    {\n        // Select row of newly created address, once\n        ui->tableView->setFocus();\n        ui->tableView->selectRow(idx.row());\n        newAddressToSelect.clear();\n    }\n}\n"
  },
  {
    "path": "src/qt/addressbookpage.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_ADDRESSBOOKPAGE_H\n#define BITCOIN_QT_ADDRESSBOOKPAGE_H\n\n#include <QDialog>\n\nclass AddressTableModel;\nclass PlatformStyle;\n\nnamespace Ui {\n    class AddressBookPage;\n}\n\nQT_BEGIN_NAMESPACE\nclass QItemSelection;\nclass QMenu;\nclass QModelIndex;\nclass QSortFilterProxyModel;\nQT_END_NAMESPACE\n\n/** Widget that shows a list of sending or receiving addresses.\n  */\nclass AddressBookPage : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    enum Tabs {\n        SendingTab = 0,\n        ReceivingTab = 1\n    };\n\n    enum Mode {\n        ForSelection, /**< Open address book to pick address */\n        ForEditing  /**< Open address book for editing */\n    };\n\n    explicit AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent);\n    ~AddressBookPage();\n\n    void setModel(AddressTableModel *model);\n    const QString &getReturnValue() const { return returnValue; }\n\npublic Q_SLOTS:\n    void done(int retval);\n\nprivate:\n    Ui::AddressBookPage *ui;\n    AddressTableModel *model;\n    Mode mode;\n    Tabs tab;\n    QString returnValue;\n    QSortFilterProxyModel *proxyModel;\n    QMenu *contextMenu;\n    QAction *deleteAction; // to be able to explicitly disable it\n    QString newAddressToSelect;\n\nprivate Q_SLOTS:\n    /** Delete currently selected address entry */\n    void on_deleteAddress_clicked();\n    /** Create a new address for receiving coins and / or add a new address book entry */\n    void on_newAddress_clicked();\n    /** Copy address of currently selected address entry to clipboard */\n    void on_copyAddress_clicked();\n    /** Copy label of currently selected address entry to clipboard (no button) */\n    void onCopyLabelAction();\n    /** Edit currently selected address entry (no button) */\n    void onEditAction();\n    /** Export button clicked */\n    void on_exportButton_clicked();\n\n    /** Set button states based on selected tab and selection */\n    void selectionChanged();\n    /** Spawn contextual menu (right mouse menu) for address book entry */\n    void contextualMenu(const QPoint &point);\n    /** New entry/entries were added to address table */\n    void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);\n\nQ_SIGNALS:\n    void sendCoins(QString addr);\n};\n\n#endif // BITCOIN_QT_ADDRESSBOOKPAGE_H\n"
  },
  {
    "path": "src/qt/addresstablemodel.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/addresstablemodel.h>\n\n#include <qt/guiutil.h>\n#include <qt/walletmodel.h>\n\n#include <base58.h>\n#include <wallet/wallet.h>\n\n\n#include <QFont>\n#include <QDebug>\n\nconst QString AddressTableModel::Send = \"S\";\nconst QString AddressTableModel::Receive = \"R\";\n\nstruct AddressTableEntry\n{\n    enum Type {\n        Sending,\n        Receiving,\n        Hidden /* QSortFilterProxyModel will filter these out */\n    };\n\n    Type type;\n    QString label;\n    QString address;\n\n    AddressTableEntry() {}\n    AddressTableEntry(Type _type, const QString &_label, const QString &_address):\n        type(_type), label(_label), address(_address) {}\n};\n\nstruct AddressTableEntryLessThan\n{\n    bool operator()(const AddressTableEntry &a, const AddressTableEntry &b) const\n    {\n        return a.address < b.address;\n    }\n    bool operator()(const AddressTableEntry &a, const QString &b) const\n    {\n        return a.address < b;\n    }\n    bool operator()(const QString &a, const AddressTableEntry &b) const\n    {\n        return a < b.address;\n    }\n};\n\n/* Determine address type from address purpose */\nstatic AddressTableEntry::Type translateTransactionType(const QString &strPurpose, bool isMine)\n{\n    AddressTableEntry::Type addressType = AddressTableEntry::Hidden;\n    // \"refund\" addresses aren't shown, and change addresses aren't in mapAddressBook at all.\n    if (strPurpose == \"send\")\n        addressType = AddressTableEntry::Sending;\n    else if (strPurpose == \"receive\")\n        addressType = AddressTableEntry::Receiving;\n    else if (strPurpose == \"unknown\" || strPurpose == \"\") // if purpose not set, guess\n        addressType = (isMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending);\n    return addressType;\n}\n\n// Private implementation\nclass AddressTablePriv\n{\npublic:\n    CWallet *wallet;\n    QList<AddressTableEntry> cachedAddressTable;\n    AddressTableModel *parent;\n\n    AddressTablePriv(CWallet *_wallet, AddressTableModel *_parent):\n        wallet(_wallet), parent(_parent) {}\n\n    void refreshAddressTable()\n    {\n        cachedAddressTable.clear();\n        {\n            LOCK(wallet->cs_wallet);\n            for (const std::pair<CTxDestination, CAddressBookData>& item : wallet->mapAddressBook)\n            {\n                const CTxDestination& address = item.first;\n                bool fMine = IsMine(*wallet, address);\n                AddressTableEntry::Type addressType = translateTransactionType(\n                        QString::fromStdString(item.second.purpose), fMine);\n                const std::string& strName = item.second.name;\n                cachedAddressTable.append(AddressTableEntry(addressType,\n                                  QString::fromStdString(strName),\n                                  QString::fromStdString(EncodeDestination(address))));\n            }\n        }\n        // qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order\n        // Even though the map is already sorted this re-sorting step is needed because the originating map\n        // is sorted by binary address, not by base58() address.\n        qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());\n    }\n\n    void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status)\n    {\n        // Find address / label in model\n        QList<AddressTableEntry>::iterator lower = qLowerBound(\n            cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());\n        QList<AddressTableEntry>::iterator upper = qUpperBound(\n            cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());\n        int lowerIndex = (lower - cachedAddressTable.begin());\n        int upperIndex = (upper - cachedAddressTable.begin());\n        bool inModel = (lower != upper);\n        AddressTableEntry::Type newEntryType = translateTransactionType(purpose, isMine);\n\n        switch(status)\n        {\n        case CT_NEW:\n            if(inModel)\n            {\n                qWarning() << \"AddressTablePriv::updateEntry: Warning: Got CT_NEW, but entry is already in model\";\n                break;\n            }\n            parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex);\n            cachedAddressTable.insert(lowerIndex, AddressTableEntry(newEntryType, label, address));\n            parent->endInsertRows();\n            break;\n        case CT_UPDATED:\n            if(!inModel)\n            {\n                qWarning() << \"AddressTablePriv::updateEntry: Warning: Got CT_UPDATED, but entry is not in model\";\n                break;\n            }\n            lower->type = newEntryType;\n            lower->label = label;\n            parent->emitDataChanged(lowerIndex);\n            break;\n        case CT_DELETED:\n            if(!inModel)\n            {\n                qWarning() << \"AddressTablePriv::updateEntry: Warning: Got CT_DELETED, but entry is not in model\";\n                break;\n            }\n            parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);\n            cachedAddressTable.erase(lower, upper);\n            parent->endRemoveRows();\n            break;\n        }\n    }\n\n    int size()\n    {\n        return cachedAddressTable.size();\n    }\n\n    AddressTableEntry *index(int idx)\n    {\n        if(idx >= 0 && idx < cachedAddressTable.size())\n        {\n            return &cachedAddressTable[idx];\n        }\n        else\n        {\n            return 0;\n        }\n    }\n};\n\nAddressTableModel::AddressTableModel(CWallet *_wallet, WalletModel *parent) :\n    QAbstractTableModel(parent),walletModel(parent),wallet(_wallet),priv(0)\n{\n    columns << tr(\"Label\") << tr(\"Address\");\n    priv = new AddressTablePriv(wallet, this);\n    priv->refreshAddressTable();\n}\n\nAddressTableModel::~AddressTableModel()\n{\n    delete priv;\n}\n\nint AddressTableModel::rowCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    return priv->size();\n}\n\nint AddressTableModel::columnCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    return columns.length();\n}\n\nQVariant AddressTableModel::data(const QModelIndex &index, int role) const\n{\n    if(!index.isValid())\n        return QVariant();\n\n    AddressTableEntry *rec = static_cast<AddressTableEntry*>(index.internalPointer());\n\n    if(role == Qt::DisplayRole || role == Qt::EditRole)\n    {\n        switch(index.column())\n        {\n        case Label:\n            if(rec->label.isEmpty() && role == Qt::DisplayRole)\n            {\n                return tr(\"(no label)\");\n            }\n            else\n            {\n                return rec->label;\n            }\n        case Address:\n            return rec->address;\n        }\n    }\n    else if (role == Qt::FontRole)\n    {\n        QFont font;\n        if(index.column() == Address)\n        {\n            font = GUIUtil::fixedPitchFont();\n        }\n        return font;\n    }\n    else if (role == TypeRole)\n    {\n        switch(rec->type)\n        {\n        case AddressTableEntry::Sending:\n            return Send;\n        case AddressTableEntry::Receiving:\n            return Receive;\n        default: break;\n        }\n    }\n    return QVariant();\n}\n\nbool AddressTableModel::setData(const QModelIndex &index, const QVariant &value, int role)\n{\n    if(!index.isValid())\n        return false;\n    AddressTableEntry *rec = static_cast<AddressTableEntry*>(index.internalPointer());\n    std::string strPurpose = (rec->type == AddressTableEntry::Sending ? \"send\" : \"receive\");\n    editStatus = OK;\n\n    if(role == Qt::EditRole)\n    {\n        LOCK(wallet->cs_wallet); /* For SetAddressBook / DelAddressBook */\n        CTxDestination curAddress = DecodeDestination(rec->address.toStdString());\n        if(index.column() == Label)\n        {\n            // Do nothing, if old label == new label\n            if(rec->label == value.toString())\n            {\n                editStatus = NO_CHANGES;\n                return false;\n            }\n            wallet->SetAddressBook(curAddress, value.toString().toStdString(), strPurpose);\n        } else if(index.column() == Address) {\n            CTxDestination newAddress = DecodeDestination(value.toString().toStdString());\n            // Refuse to set invalid address, set error status and return false\n            if(boost::get<CNoDestination>(&newAddress))\n            {\n                editStatus = INVALID_ADDRESS;\n                return false;\n            }\n            // Do nothing, if old address == new address\n            else if(newAddress == curAddress)\n            {\n                editStatus = NO_CHANGES;\n                return false;\n            }\n            // Check for duplicate addresses to prevent accidental deletion of addresses, if you try\n            // to paste an existing address over another address (with a different label)\n            else if(wallet->mapAddressBook.count(newAddress))\n            {\n                editStatus = DUPLICATE_ADDRESS;\n                return false;\n            }\n            // Double-check that we're not overwriting a receiving address\n            else if(rec->type == AddressTableEntry::Sending)\n            {\n                // Remove old entry\n                wallet->DelAddressBook(curAddress);\n                // Add new entry with new address\n                wallet->SetAddressBook(newAddress, rec->label.toStdString(), strPurpose);\n            }\n        }\n        return true;\n    }\n    return false;\n}\n\nQVariant AddressTableModel::headerData(int section, Qt::Orientation orientation, int role) const\n{\n    if(orientation == Qt::Horizontal)\n    {\n        if(role == Qt::DisplayRole && section < columns.size())\n        {\n            return columns[section];\n        }\n    }\n    return QVariant();\n}\n\nQt::ItemFlags AddressTableModel::flags(const QModelIndex &index) const\n{\n    if(!index.isValid())\n        return 0;\n    AddressTableEntry *rec = static_cast<AddressTableEntry*>(index.internalPointer());\n\n    Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;\n    // Can edit address and label for sending addresses,\n    // and only label for receiving addresses.\n    if(rec->type == AddressTableEntry::Sending ||\n      (rec->type == AddressTableEntry::Receiving && index.column()==Label))\n    {\n        retval |= Qt::ItemIsEditable;\n    }\n    return retval;\n}\n\nQModelIndex AddressTableModel::index(int row, int column, const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    AddressTableEntry *data = priv->index(row);\n    if(data)\n    {\n        return createIndex(row, column, priv->index(row));\n    }\n    else\n    {\n        return QModelIndex();\n    }\n}\n\nvoid AddressTableModel::updateEntry(const QString &address,\n        const QString &label, bool isMine, const QString &purpose, int status)\n{\n    // Update address book model from Bitcoin core\n    priv->updateEntry(address, label, isMine, purpose, status);\n}\n\nQString AddressTableModel::addRow(const QString &type, const QString &label, const QString &address, const OutputType address_type)\n{\n    std::string strLabel = label.toStdString();\n    std::string strAddress = address.toStdString();\n\n    editStatus = OK;\n\n    if(type == Send)\n    {\n        if(!walletModel->validateAddress(address))\n        {\n            editStatus = INVALID_ADDRESS;\n            return QString();\n        }\n        // Check for duplicate addresses\n        {\n            LOCK(wallet->cs_wallet);\n            if(wallet->mapAddressBook.count(DecodeDestination(strAddress)))\n            {\n                editStatus = DUPLICATE_ADDRESS;\n                return QString();\n            }\n        }\n    }\n    else if(type == Receive)\n    {\n        // Generate a new address to associate with given label\n        CPubKey newKey;\n        if(!wallet->GetKeyFromPool(newKey))\n        {\n            WalletModel::UnlockContext ctx(walletModel->requestUnlock());\n            if(!ctx.isValid())\n            {\n                // Unlock wallet failed or was cancelled\n                editStatus = WALLET_UNLOCK_FAILURE;\n                return QString();\n            }\n            if(!wallet->GetKeyFromPool(newKey))\n            {\n                editStatus = KEY_GENERATION_FAILURE;\n                return QString();\n            }\n        }\n        wallet->LearnRelatedScripts(newKey, address_type);\n        strAddress = EncodeDestination(GetDestinationForKey(newKey, address_type));\n    }\n    else\n    {\n        return QString();\n    }\n\n    // Add entry\n    {\n        LOCK(wallet->cs_wallet);\n        wallet->SetAddressBook(DecodeDestination(strAddress), strLabel,\n                               (type == Send ? \"send\" : \"receive\"));\n    }\n    return QString::fromStdString(strAddress);\n}\n\nbool AddressTableModel::removeRows(int row, int count, const QModelIndex &parent)\n{\n    Q_UNUSED(parent);\n    AddressTableEntry *rec = priv->index(row);\n    if(count != 1 || !rec || rec->type == AddressTableEntry::Receiving)\n    {\n        // Can only remove one row at a time, and cannot remove rows not in model.\n        // Also refuse to remove receiving addresses.\n        return false;\n    }\n    {\n        LOCK(wallet->cs_wallet);\n        wallet->DelAddressBook(DecodeDestination(rec->address.toStdString()));\n    }\n    return true;\n}\n\n/* Look up label for address in address book, if not found return empty string.\n */\nQString AddressTableModel::labelForAddress(const QString &address) const\n{\n    {\n        LOCK(wallet->cs_wallet);\n        CTxDestination destination = DecodeDestination(address.toStdString());\n        std::map<CTxDestination, CAddressBookData>::iterator mi = wallet->mapAddressBook.find(destination);\n        if (mi != wallet->mapAddressBook.end())\n        {\n            return QString::fromStdString(mi->second.name);\n        }\n    }\n    return QString();\n}\n\nint AddressTableModel::lookupAddress(const QString &address) const\n{\n    QModelIndexList lst = match(index(0, Address, QModelIndex()),\n                                Qt::EditRole, address, 1, Qt::MatchExactly);\n    if(lst.isEmpty())\n    {\n        return -1;\n    }\n    else\n    {\n        return lst.at(0).row();\n    }\n}\n\nvoid AddressTableModel::emitDataChanged(int idx)\n{\n    Q_EMIT dataChanged(index(idx, 0, QModelIndex()), index(idx, columns.length()-1, QModelIndex()));\n}\n"
  },
  {
    "path": "src/qt/addresstablemodel.h",
    "content": "// Copyright (c) 2011-2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_ADDRESSTABLEMODEL_H\n#define BITCOIN_QT_ADDRESSTABLEMODEL_H\n\n#include <QAbstractTableModel>\n#include <QStringList>\n\nenum OutputType : int;\n\nclass AddressTablePriv;\nclass WalletModel;\n\nclass CWallet;\n\n/**\n   Qt model of the address book in the core. This allows views to access and modify the address book.\n */\nclass AddressTableModel : public QAbstractTableModel\n{\n    Q_OBJECT\n\npublic:\n    explicit AddressTableModel(CWallet *wallet, WalletModel *parent = 0);\n    ~AddressTableModel();\n\n    enum ColumnIndex {\n        Label = 0,   /**< User specified label */\n        Address = 1  /**< Bitcoin address */\n    };\n\n    enum RoleIndex {\n        TypeRole = Qt::UserRole /**< Type of address (#Send or #Receive) */\n    };\n\n    /** Return status of edit/insert operation */\n    enum EditStatus {\n        OK,                     /**< Everything ok */\n        NO_CHANGES,             /**< No changes were made during edit operation */\n        INVALID_ADDRESS,        /**< Unparseable address */\n        DUPLICATE_ADDRESS,      /**< Address already in address book */\n        WALLET_UNLOCK_FAILURE,  /**< Wallet could not be unlocked to create new receiving address */\n        KEY_GENERATION_FAILURE  /**< Generating a new public key for a receiving address failed */\n    };\n\n    static const QString Send;      /**< Specifies send address */\n    static const QString Receive;   /**< Specifies receive address */\n\n    /** @name Methods overridden from QAbstractTableModel\n        @{*/\n    int rowCount(const QModelIndex &parent) const;\n    int columnCount(const QModelIndex &parent) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    bool setData(const QModelIndex &index, const QVariant &value, int role);\n    QVariant headerData(int section, Qt::Orientation orientation, int role) const;\n    QModelIndex index(int row, int column, const QModelIndex &parent) const;\n    bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    /*@}*/\n\n    /* Add an address to the model.\n       Returns the added address on success, and an empty string otherwise.\n     */\n    QString addRow(const QString &type, const QString &label, const QString &address, const OutputType address_type);\n\n    /* Look up label for address in address book, if not found return empty string.\n     */\n    QString labelForAddress(const QString &address) const;\n\n    /* Look up row index of an address in the model.\n       Return -1 if not found.\n     */\n    int lookupAddress(const QString &address) const;\n\n    EditStatus getEditStatus() const { return editStatus; }\n\nprivate:\n    WalletModel *walletModel;\n    CWallet *wallet;\n    AddressTablePriv *priv;\n    QStringList columns;\n    EditStatus editStatus;\n\n    /** Notify listeners that data changed. */\n    void emitDataChanged(int index);\n\npublic Q_SLOTS:\n    /* Update address list from core.\n     */\n    void updateEntry(const QString &address, const QString &label, bool isMine, const QString &purpose, int status);\n\n    friend class AddressTablePriv;\n};\n\n#endif // BITCOIN_QT_ADDRESSTABLEMODEL_H\n"
  },
  {
    "path": "src/qt/askpassphrasedialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <qt/askpassphrasedialog.h>\n#include <qt/forms/ui_askpassphrasedialog.h>\n\n#include <qt/guiconstants.h>\n#include <qt/walletmodel.h>\n\n#include <support/allocators/secure.h>\n\n#include <QKeyEvent>\n#include <QMessageBox>\n#include <QPushButton>\n\nAskPassphraseDialog::AskPassphraseDialog(Mode _mode, QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::AskPassphraseDialog),\n    mode(_mode),\n    model(0),\n    fCapsLock(false)\n{\n    ui->setupUi(this);\n\n    ui->passEdit1->setMinimumSize(ui->passEdit1->sizeHint());\n    ui->passEdit2->setMinimumSize(ui->passEdit2->sizeHint());\n    ui->passEdit3->setMinimumSize(ui->passEdit3->sizeHint());\n\n    ui->passEdit1->setMaxLength(MAX_PASSPHRASE_SIZE);\n    ui->passEdit2->setMaxLength(MAX_PASSPHRASE_SIZE);\n    ui->passEdit3->setMaxLength(MAX_PASSPHRASE_SIZE);\n\n    // Setup Caps Lock detection.\n    ui->passEdit1->installEventFilter(this);\n    ui->passEdit2->installEventFilter(this);\n    ui->passEdit3->installEventFilter(this);\n\n    switch(mode)\n    {\n        case Encrypt: // Ask passphrase x2\n            ui->warningLabel->setText(tr(\"Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>.\"));\n            ui->passLabel1->hide();\n            ui->passEdit1->hide();\n            setWindowTitle(tr(\"Encrypt wallet\"));\n            break;\n        case Unlock: // Ask passphrase\n            ui->warningLabel->setText(tr(\"This operation needs your wallet passphrase to unlock the wallet.\"));\n            ui->passLabel2->hide();\n            ui->passEdit2->hide();\n            ui->passLabel3->hide();\n            ui->passEdit3->hide();\n            setWindowTitle(tr(\"Unlock wallet\"));\n            break;\n        case Decrypt:   // Ask passphrase\n            ui->warningLabel->setText(tr(\"This operation needs your wallet passphrase to decrypt the wallet.\"));\n            ui->passLabel2->hide();\n            ui->passEdit2->hide();\n            ui->passLabel3->hide();\n            ui->passEdit3->hide();\n            setWindowTitle(tr(\"Decrypt wallet\"));\n            break;\n        case ChangePass: // Ask old passphrase + new passphrase x2\n            setWindowTitle(tr(\"Change passphrase\"));\n            ui->warningLabel->setText(tr(\"Enter the old passphrase and new passphrase to the wallet.\"));\n            break;\n    }\n    textChanged();\n    connect(ui->toggleShowPasswordButton, SIGNAL(toggled(bool)), this, SLOT(toggleShowPassword(bool)));\n    connect(ui->passEdit1, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));\n    connect(ui->passEdit2, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));\n    connect(ui->passEdit3, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));\n}\n\nAskPassphraseDialog::~AskPassphraseDialog()\n{\n    secureClearPassFields();\n    delete ui;\n}\n\nvoid AskPassphraseDialog::setModel(WalletModel *_model)\n{\n    this->model = _model;\n}\n\nvoid AskPassphraseDialog::accept()\n{\n    SecureString oldpass, newpass1, newpass2;\n    if(!model)\n        return;\n    oldpass.reserve(MAX_PASSPHRASE_SIZE);\n    newpass1.reserve(MAX_PASSPHRASE_SIZE);\n    newpass2.reserve(MAX_PASSPHRASE_SIZE);\n    // TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)\n    // Alternately, find a way to make this input mlock()'d to begin with.\n    oldpass.assign(ui->passEdit1->text().toStdString().c_str());\n    newpass1.assign(ui->passEdit2->text().toStdString().c_str());\n    newpass2.assign(ui->passEdit3->text().toStdString().c_str());\n\n    secureClearPassFields();\n\n    switch(mode)\n    {\n    case Encrypt: {\n        if(newpass1.empty() || newpass2.empty())\n        {\n            // Cannot encrypt with empty passphrase\n            break;\n        }\n        QMessageBox::StandardButton retval = QMessageBox::question(this, tr(\"Confirm wallet encryption\"),\n                 tr(\"Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR SUGARCHAINS</b>!\") + \"<br><br>\" + tr(\"Are you sure you wish to encrypt your wallet?\"),\n                 QMessageBox::Yes|QMessageBox::Cancel,\n                 QMessageBox::Cancel);\n        if(retval == QMessageBox::Yes)\n        {\n            if(newpass1 == newpass2)\n            {\n                if(model->setWalletEncrypted(true, newpass1))\n                {\n                    QMessageBox::warning(this, tr(\"Wallet encrypted\"),\n                                         \"<qt>\" +\n                                         tr(\"%1 will close now to finish the encryption process. \"\n                                         \"Remember that encrypting your wallet cannot fully protect \"\n                                         \"your sugarchains from being stolen by malware infecting your computer.\").arg(tr(PACKAGE_NAME)) +\n                                         \"<br><br><b>\" +\n                                         tr(\"IMPORTANT: Any previous backups you have made of your wallet file \"\n                                         \"should be replaced with the newly generated, encrypted wallet file. \"\n                                         \"For security reasons, previous backups of the unencrypted wallet file \"\n                                         \"will become useless as soon as you start using the new, encrypted wallet.\") +\n                                         \"</b></qt>\");\n                    QApplication::quit();\n                }\n                else\n                {\n                    QMessageBox::critical(this, tr(\"Wallet encryption failed\"),\n                                         tr(\"Wallet encryption failed due to an internal error. Your wallet was not encrypted.\"));\n                }\n                QDialog::accept(); // Success\n            }\n            else\n            {\n                QMessageBox::critical(this, tr(\"Wallet encryption failed\"),\n                                     tr(\"The supplied passphrases do not match.\"));\n            }\n        }\n        else\n        {\n            QDialog::reject(); // Cancelled\n        }\n        } break;\n    case Unlock:\n        if(!model->setWalletLocked(false, oldpass))\n        {\n            QMessageBox::critical(this, tr(\"Wallet unlock failed\"),\n                                  tr(\"The passphrase entered for the wallet decryption was incorrect.\"));\n        }\n        else\n        {\n            QDialog::accept(); // Success\n        }\n        break;\n    case Decrypt:\n        if(!model->setWalletEncrypted(false, oldpass))\n        {\n            QMessageBox::critical(this, tr(\"Wallet decryption failed\"),\n                                  tr(\"The passphrase entered for the wallet decryption was incorrect.\"));\n        }\n        else\n        {\n            QDialog::accept(); // Success\n        }\n        break;\n    case ChangePass:\n        if(newpass1 == newpass2)\n        {\n            if(model->changePassphrase(oldpass, newpass1))\n            {\n                QMessageBox::information(this, tr(\"Wallet encrypted\"),\n                                     tr(\"Wallet passphrase was successfully changed.\"));\n                QDialog::accept(); // Success\n            }\n            else\n            {\n                QMessageBox::critical(this, tr(\"Wallet encryption failed\"),\n                                     tr(\"The passphrase entered for the wallet decryption was incorrect.\"));\n            }\n        }\n        else\n        {\n            QMessageBox::critical(this, tr(\"Wallet encryption failed\"),\n                                 tr(\"The supplied passphrases do not match.\"));\n        }\n        break;\n    }\n}\n\nvoid AskPassphraseDialog::textChanged()\n{\n    // Validate input, set Ok button to enabled when acceptable\n    bool acceptable = false;\n    switch(mode)\n    {\n    case Encrypt: // New passphrase x2\n        acceptable = !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();\n        break;\n    case Unlock: // Old passphrase x1\n    case Decrypt:\n        acceptable = !ui->passEdit1->text().isEmpty();\n        break;\n    case ChangePass: // Old passphrase x1, new passphrase x2\n        acceptable = !ui->passEdit1->text().isEmpty() && !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();\n        break;\n    }\n    ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(acceptable);\n}\n\nbool AskPassphraseDialog::event(QEvent *event)\n{\n    // Detect Caps Lock key press.\n    if (event->type() == QEvent::KeyPress) {\n        QKeyEvent *ke = static_cast<QKeyEvent *>(event);\n        if (ke->key() == Qt::Key_CapsLock) {\n            fCapsLock = !fCapsLock;\n        }\n        if (fCapsLock) {\n            ui->capsLabel->setText(tr(\"Warning: The Caps Lock key is on!\"));\n        } else {\n            ui->capsLabel->clear();\n        }\n    }\n    return QWidget::event(event);\n}\n\nvoid AskPassphraseDialog::toggleShowPassword(bool show)\n{\n    ui->toggleShowPasswordButton->setDown(show);\n    const auto mode = show ? QLineEdit::Normal : QLineEdit::Password;\n    ui->passEdit1->setEchoMode(mode);\n    ui->passEdit2->setEchoMode(mode);\n    ui->passEdit3->setEchoMode(mode);\n}\n\nbool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)\n{\n    /* Detect Caps Lock.\n     * There is no good OS-independent way to check a key state in Qt, but we\n     * can detect Caps Lock by checking for the following condition:\n     * Shift key is down and the result is a lower case character, or\n     * Shift key is not down and the result is an upper case character.\n     */\n    if (event->type() == QEvent::KeyPress) {\n        QKeyEvent *ke = static_cast<QKeyEvent *>(event);\n        QString str = ke->text();\n        if (str.length() != 0) {\n            const QChar *psz = str.unicode();\n            bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0;\n            if ((fShift && *psz >= 'a' && *psz <= 'z') || (!fShift && *psz >= 'A' && *psz <= 'Z')) {\n                fCapsLock = true;\n                ui->capsLabel->setText(tr(\"Warning: The Caps Lock key is on!\"));\n            } else if (psz->isLetter()) {\n                fCapsLock = false;\n                ui->capsLabel->clear();\n            }\n        }\n    }\n    return QDialog::eventFilter(object, event);\n}\n\nstatic void SecureClearQLineEdit(QLineEdit* edit)\n{\n    // Attempt to overwrite text so that they do not linger around in memory\n    edit->setText(QString(\" \").repeated(edit->text().size()));\n    edit->clear();\n}\n\nvoid AskPassphraseDialog::secureClearPassFields()\n{\n    SecureClearQLineEdit(ui->passEdit1);\n    SecureClearQLineEdit(ui->passEdit2);\n    SecureClearQLineEdit(ui->passEdit3);\n}\n"
  },
  {
    "path": "src/qt/askpassphrasedialog.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_ASKPASSPHRASEDIALOG_H\n#define BITCOIN_QT_ASKPASSPHRASEDIALOG_H\n\n#include <QDialog>\n\nclass WalletModel;\n\nnamespace Ui {\n    class AskPassphraseDialog;\n}\n\n/** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase.\n */\nclass AskPassphraseDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    enum Mode {\n        Encrypt,    /**< Ask passphrase twice and encrypt */\n        Unlock,     /**< Ask passphrase and unlock */\n        ChangePass, /**< Ask old passphrase + new passphrase twice */\n        Decrypt     /**< Ask passphrase and decrypt wallet */\n    };\n\n    explicit AskPassphraseDialog(Mode mode, QWidget *parent);\n    ~AskPassphraseDialog();\n\n    void accept();\n\n    void setModel(WalletModel *model);\n\nprivate:\n    Ui::AskPassphraseDialog *ui;\n    Mode mode;\n    WalletModel *model;\n    bool fCapsLock;\n\nprivate Q_SLOTS:\n    void textChanged();\n    void secureClearPassFields();\n    void toggleShowPassword(bool);\n\nprotected:\n    bool event(QEvent *event);\n    bool eventFilter(QObject *object, QEvent *event);\n};\n\n#endif // BITCOIN_QT_ASKPASSPHRASEDIALOG_H\n"
  },
  {
    "path": "src/qt/bantablemodel.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/bantablemodel.h>\n\n#include <qt/clientmodel.h>\n#include <qt/guiconstants.h>\n#include <qt/guiutil.h>\n\n#include <sync.h>\n#include <utiltime.h>\n\n#include <QDebug>\n#include <QList>\n\nbool BannedNodeLessThan::operator()(const CCombinedBan& left, const CCombinedBan& right) const\n{\n    const CCombinedBan* pLeft = &left;\n    const CCombinedBan* pRight = &right;\n\n    if (order == Qt::DescendingOrder)\n        std::swap(pLeft, pRight);\n\n    switch(column)\n    {\n    case BanTableModel::Address:\n        return pLeft->subnet.ToString().compare(pRight->subnet.ToString()) < 0;\n    case BanTableModel::Bantime:\n        return pLeft->banEntry.nBanUntil < pRight->banEntry.nBanUntil;\n    }\n\n    return false;\n}\n\n// private implementation\nclass BanTablePriv\n{\npublic:\n    /** Local cache of peer information */\n    QList<CCombinedBan> cachedBanlist;\n    /** Column to sort nodes by */\n    int sortColumn;\n    /** Order (ascending or descending) to sort nodes by */\n    Qt::SortOrder sortOrder;\n\n    /** Pull a full list of banned nodes from CNode into our cache */\n    void refreshBanlist()\n    {\n        banmap_t banMap;\n        if(g_connman)\n            g_connman->GetBanned(banMap);\n\n        cachedBanlist.clear();\n#if QT_VERSION >= 0x040700\n        cachedBanlist.reserve(banMap.size());\n#endif\n        for (const auto& entry : banMap)\n        {\n            CCombinedBan banEntry;\n            banEntry.subnet = entry.first;\n            banEntry.banEntry = entry.second;\n            cachedBanlist.append(banEntry);\n        }\n\n        if (sortColumn >= 0)\n            // sort cachedBanlist (use stable sort to prevent rows jumping around unnecessarily)\n            qStableSort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder));\n    }\n\n    int size() const\n    {\n        return cachedBanlist.size();\n    }\n\n    CCombinedBan *index(int idx)\n    {\n        if (idx >= 0 && idx < cachedBanlist.size())\n            return &cachedBanlist[idx];\n\n        return 0;\n    }\n};\n\nBanTableModel::BanTableModel(ClientModel *parent) :\n    QAbstractTableModel(parent),\n    clientModel(parent)\n{\n    columns << tr(\"IP/Netmask\") << tr(\"Banned Until\");\n    priv.reset(new BanTablePriv());\n    // default to unsorted\n    priv->sortColumn = -1;\n\n    // load initial data\n    refresh();\n}\n\nBanTableModel::~BanTableModel()\n{\n    // Intentionally left empty\n}\n\nint BanTableModel::rowCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    return priv->size();\n}\n\nint BanTableModel::columnCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    return columns.length();\n}\n\nQVariant BanTableModel::data(const QModelIndex &index, int role) const\n{\n    if(!index.isValid())\n        return QVariant();\n\n    CCombinedBan *rec = static_cast<CCombinedBan*>(index.internalPointer());\n\n    if (role == Qt::DisplayRole) {\n        switch(index.column())\n        {\n        case Address:\n            return QString::fromStdString(rec->subnet.ToString());\n        case Bantime:\n            QDateTime date = QDateTime::fromMSecsSinceEpoch(0);\n            date = date.addSecs(rec->banEntry.nBanUntil);\n            return date.toString(Qt::SystemLocaleLongDate);\n        }\n    }\n\n    return QVariant();\n}\n\nQVariant BanTableModel::headerData(int section, Qt::Orientation orientation, int role) const\n{\n    if(orientation == Qt::Horizontal)\n    {\n        if(role == Qt::DisplayRole && section < columns.size())\n        {\n            return columns[section];\n        }\n    }\n    return QVariant();\n}\n\nQt::ItemFlags BanTableModel::flags(const QModelIndex &index) const\n{\n    if(!index.isValid())\n        return 0;\n\n    Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;\n    return retval;\n}\n\nQModelIndex BanTableModel::index(int row, int column, const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    CCombinedBan *data = priv->index(row);\n\n    if (data)\n        return createIndex(row, column, data);\n    return QModelIndex();\n}\n\nvoid BanTableModel::refresh()\n{\n    Q_EMIT layoutAboutToBeChanged();\n    priv->refreshBanlist();\n    Q_EMIT layoutChanged();\n}\n\nvoid BanTableModel::sort(int column, Qt::SortOrder order)\n{\n    priv->sortColumn = column;\n    priv->sortOrder = order;\n    refresh();\n}\n\nbool BanTableModel::shouldShow()\n{\n    return priv->size() > 0;\n}\n"
  },
  {
    "path": "src/qt/bantablemodel.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_BANTABLEMODEL_H\n#define BITCOIN_QT_BANTABLEMODEL_H\n\n#include <net.h>\n\n#include <memory>\n\n#include <QAbstractTableModel>\n#include <QStringList>\n\nclass ClientModel;\nclass BanTablePriv;\n\nstruct CCombinedBan {\n    CSubNet subnet;\n    CBanEntry banEntry;\n};\n\nclass BannedNodeLessThan\n{\npublic:\n    BannedNodeLessThan(int nColumn, Qt::SortOrder fOrder) :\n        column(nColumn), order(fOrder) {}\n    bool operator()(const CCombinedBan& left, const CCombinedBan& right) const;\n\nprivate:\n    int column;\n    Qt::SortOrder order;\n};\n\n/**\n   Qt model providing information about connected peers, similar to the\n   \"getpeerinfo\" RPC call. Used by the rpc console UI.\n */\nclass BanTableModel : public QAbstractTableModel\n{\n    Q_OBJECT\n\npublic:\n    explicit BanTableModel(ClientModel *parent = 0);\n    ~BanTableModel();\n    void startAutoRefresh();\n    void stopAutoRefresh();\n\n    enum ColumnIndex {\n        Address = 0,\n        Bantime = 1\n    };\n\n    /** @name Methods overridden from QAbstractTableModel\n        @{*/\n    int rowCount(const QModelIndex &parent) const;\n    int columnCount(const QModelIndex &parent) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    QVariant headerData(int section, Qt::Orientation orientation, int role) const;\n    QModelIndex index(int row, int column, const QModelIndex &parent) const;\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    void sort(int column, Qt::SortOrder order);\n    bool shouldShow();\n    /*@}*/\n\npublic Q_SLOTS:\n    void refresh();\n\nprivate:\n    ClientModel *clientModel;\n    QStringList columns;\n    std::unique_ptr<BanTablePriv> priv;\n};\n\n#endif // BITCOIN_QT_BANTABLEMODEL_H\n"
  },
  {
    "path": "src/qt/bitcoin.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <qt/bitcoingui.h>\n\n#include <chainparams.h>\n#include <qt/clientmodel.h>\n#include <fs.h>\n#include <qt/guiconstants.h>\n#include <qt/guiutil.h>\n#include <qt/intro.h>\n#include <qt/networkstyle.h>\n#include <qt/optionsmodel.h>\n#include <qt/platformstyle.h>\n#include <qt/splashscreen.h>\n#include <qt/utilitydialog.h>\n#include <qt/winshutdownmonitor.h>\n\n#ifdef ENABLE_WALLET\n#include <qt/paymentserver.h>\n#include <qt/walletmodel.h>\n#endif\n\n#include <init.h>\n#include <rpc/server.h>\n#include <ui_interface.h>\n#include <util.h>\n#include <warnings.h>\n\n#ifdef ENABLE_WALLET\n#include <wallet/wallet.h>\n#endif\n\n#include <memory>\n#include <stdint.h>\n\n#include <boost/thread.hpp>\n\n#include <QApplication>\n#include <QDebug>\n#include <QLibraryInfo>\n#include <QLocale>\n#include <QMessageBox>\n#include <QSettings>\n#include <QThread>\n#include <QTimer>\n#include <QTranslator>\n#include <QSslConfiguration>\n\n#if defined(QT_STATICPLUGIN)\n#include <QtPlugin>\n#if QT_VERSION < 0x050000\nQ_IMPORT_PLUGIN(qcncodecs)\nQ_IMPORT_PLUGIN(qjpcodecs)\nQ_IMPORT_PLUGIN(qtwcodecs)\nQ_IMPORT_PLUGIN(qkrcodecs)\nQ_IMPORT_PLUGIN(qtaccessiblewidgets)\n#else\n#if QT_VERSION < 0x050400\nQ_IMPORT_PLUGIN(AccessibleFactory)\n#endif\n#if defined(QT_QPA_PLATFORM_XCB)\nQ_IMPORT_PLUGIN(QXcbIntegrationPlugin);\n#elif defined(QT_QPA_PLATFORM_WINDOWS)\nQ_IMPORT_PLUGIN(QWindowsIntegrationPlugin);\n#elif defined(QT_QPA_PLATFORM_COCOA)\nQ_IMPORT_PLUGIN(QCocoaIntegrationPlugin);\n#endif\n#endif\n#endif\n\n#if QT_VERSION < 0x050000\n#include <QTextCodec>\n#endif\n\n// Declare meta types used for QMetaObject::invokeMethod\nQ_DECLARE_METATYPE(bool*)\nQ_DECLARE_METATYPE(CAmount)\n\nstatic void InitMessage(const std::string &message)\n{\n    LogPrintf(\"init message: %s\\n\", message);\n}\n\n/*\n   Translate string to current locale using Qt.\n */\nstatic std::string Translate(const char* psz)\n{\n    return QCoreApplication::translate(\"bitcoin-core\", psz).toStdString();\n}\n\nstatic QString GetLangTerritory()\n{\n    QSettings settings;\n    // Get desired locale (e.g. \"de_DE\")\n    // 1) System default language\n    QString lang_territory = QLocale::system().name();\n    // 2) Language from QSettings\n    QString lang_territory_qsettings = settings.value(\"language\", \"\").toString();\n    if(!lang_territory_qsettings.isEmpty())\n        lang_territory = lang_territory_qsettings;\n    // 3) -lang command line argument\n    lang_territory = QString::fromStdString(gArgs.GetArg(\"-lang\", lang_territory.toStdString()));\n    return lang_territory;\n}\n\n/** Set up translations */\nstatic void initTranslations(QTranslator &qtTranslatorBase, QTranslator &qtTranslator, QTranslator &translatorBase, QTranslator &translator)\n{\n    // Remove old translators\n    QApplication::removeTranslator(&qtTranslatorBase);\n    QApplication::removeTranslator(&qtTranslator);\n    QApplication::removeTranslator(&translatorBase);\n    QApplication::removeTranslator(&translator);\n\n    // Get desired locale (e.g. \"de_DE\")\n    // 1) System default language\n    QString lang_territory = GetLangTerritory();\n\n    // Convert to \"de\" only by truncating \"_DE\"\n    QString lang = lang_territory;\n    lang.truncate(lang_territory.lastIndexOf('_'));\n\n    // Load language files for configured locale:\n    // - First load the translator for the base language, without territory\n    // - Then load the more specific locale translator\n\n    // Load e.g. qt_de.qm\n    if (qtTranslatorBase.load(\"qt_\" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))\n        QApplication::installTranslator(&qtTranslatorBase);\n\n    // Load e.g. qt_de_DE.qm\n    if (qtTranslator.load(\"qt_\" + lang_territory, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))\n        QApplication::installTranslator(&qtTranslator);\n\n    // Load e.g. bitcoin_de.qm (shortcut \"de\" needs to be defined in bitcoin.qrc)\n    if (translatorBase.load(lang, \":/translations/\"))\n        QApplication::installTranslator(&translatorBase);\n\n    // Load e.g. bitcoin_de_DE.qm (shortcut \"de_DE\" needs to be defined in bitcoin.qrc)\n    if (translator.load(lang_territory, \":/translations/\"))\n        QApplication::installTranslator(&translator);\n}\n\n/* qDebug() message handler --> debug.log */\n#if QT_VERSION < 0x050000\nvoid DebugMessageHandler(QtMsgType type, const char *msg)\n{\n    if (type == QtDebugMsg) {\n        LogPrint(BCLog::QT, \"GUI: %s\\n\", msg);\n    } else {\n        LogPrintf(\"GUI: %s\\n\", msg);\n    }\n}\n#else\nvoid DebugMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString &msg)\n{\n    Q_UNUSED(context);\n    if (type == QtDebugMsg) {\n        LogPrint(BCLog::QT, \"GUI: %s\\n\", msg.toStdString());\n    } else {\n        LogPrintf(\"GUI: %s\\n\", msg.toStdString());\n    }\n}\n#endif\n\n/** Class encapsulating Bitcoin Core startup and shutdown.\n * Allows running startup and shutdown in a different thread from the UI thread.\n */\nclass BitcoinCore: public QObject\n{\n    Q_OBJECT\npublic:\n    explicit BitcoinCore();\n    /** Basic initialization, before starting initialization/shutdown thread.\n     * Return true on success.\n     */\n    static bool baseInitialize();\n\npublic Q_SLOTS:\n    void initialize();\n    void shutdown();\n\nQ_SIGNALS:\n    void initializeResult(bool success);\n    void shutdownResult();\n    void runawayException(const QString &message);\n\nprivate:\n\n    /// Pass fatal exception message to UI thread\n    void handleRunawayException(const std::exception *e);\n};\n\n/** Main Bitcoin application object */\nclass BitcoinApplication: public QApplication\n{\n    Q_OBJECT\npublic:\n    explicit BitcoinApplication(int &argc, char **argv);\n    ~BitcoinApplication();\n\n#ifdef ENABLE_WALLET\n    /// Create payment server\n    void createPaymentServer();\n#endif\n    /// parameter interaction/setup based on rules\n    void parameterSetup();\n    /// Create options model\n    void createOptionsModel(bool resetSettings);\n    /// Create main window\n    void createWindow(const NetworkStyle *networkStyle);\n    /// Create splash screen\n    void createSplashScreen(const NetworkStyle *networkStyle);\n\n    /// Request core initialization\n    void requestInitialize();\n    /// Request core shutdown\n    void requestShutdown();\n\n    /// Get process return value\n    int getReturnValue() const { return returnValue; }\n\n    /// Get window identifier of QMainWindow (BitcoinGUI)\n    WId getMainWinId() const;\n\npublic Q_SLOTS:\n    void initializeResult(bool success);\n    void shutdownResult();\n    /// Handle runaway exceptions. Shows a message box with the problem and quits the program.\n    void handleRunawayException(const QString &message);\n\nQ_SIGNALS:\n    void requestedInitialize();\n    void requestedShutdown();\n    void stopThread();\n    void splashFinished(QWidget *window);\n\nprivate:\n    QThread *coreThread;\n    OptionsModel *optionsModel;\n    ClientModel *clientModel;\n    BitcoinGUI *window;\n    QTimer *pollShutdownTimer;\n#ifdef ENABLE_WALLET\n    PaymentServer* paymentServer;\n    WalletModel *walletModel;\n#endif\n    int returnValue;\n    const PlatformStyle *platformStyle;\n    std::unique_ptr<QWidget> shutdownWindow;\n\n    void startThread();\n};\n\n#include <qt/bitcoin.moc>\n\nBitcoinCore::BitcoinCore():\n    QObject()\n{\n}\n\nvoid BitcoinCore::handleRunawayException(const std::exception *e)\n{\n    PrintExceptionContinue(e, \"Runaway exception\");\n    Q_EMIT runawayException(QString::fromStdString(GetWarnings(\"gui\")));\n}\n\nbool BitcoinCore::baseInitialize()\n{\n    if (!AppInitBasicSetup())\n    {\n        return false;\n    }\n    if (!AppInitParameterInteraction())\n    {\n        return false;\n    }\n    if (!AppInitSanityChecks())\n    {\n        return false;\n    }\n    if (!AppInitLockDataDirectory())\n    {\n        return false;\n    }\n    return true;\n}\n\nvoid BitcoinCore::initialize()\n{\n    try\n    {\n        qDebug() << __func__ << \": Running initialization in thread\";\n        bool rv = AppInitMain();\n        Q_EMIT initializeResult(rv);\n    } catch (const std::exception& e) {\n        handleRunawayException(&e);\n    } catch (...) {\n        handleRunawayException(nullptr);\n    }\n}\n\nvoid BitcoinCore::shutdown()\n{\n    try\n    {\n        qDebug() << __func__ << \": Running Shutdown in thread\";\n        Interrupt();\n        Shutdown();\n        qDebug() << __func__ << \": Shutdown finished\";\n        Q_EMIT shutdownResult();\n    } catch (const std::exception& e) {\n        handleRunawayException(&e);\n    } catch (...) {\n        handleRunawayException(nullptr);\n    }\n}\n\nBitcoinApplication::BitcoinApplication(int &argc, char **argv):\n    QApplication(argc, argv),\n    coreThread(0),\n    optionsModel(0),\n    clientModel(0),\n    window(0),\n    pollShutdownTimer(0),\n#ifdef ENABLE_WALLET\n    paymentServer(0),\n    walletModel(0),\n#endif\n    returnValue(0)\n{\n    setQuitOnLastWindowClosed(false);\n\n    // UI per-platform customization\n    // This must be done inside the BitcoinApplication constructor, or after it, because\n    // PlatformStyle::instantiate requires a QApplication\n    std::string platformName;\n    platformName = gArgs.GetArg(\"-uiplatform\", BitcoinGUI::DEFAULT_UIPLATFORM);\n    platformStyle = PlatformStyle::instantiate(QString::fromStdString(platformName));\n    if (!platformStyle) // Fall back to \"other\" if specified name not found\n        platformStyle = PlatformStyle::instantiate(\"other\");\n    assert(platformStyle);\n}\n\nBitcoinApplication::~BitcoinApplication()\n{\n    if(coreThread)\n    {\n        qDebug() << __func__ << \": Stopping thread\";\n        Q_EMIT stopThread();\n        coreThread->wait();\n        qDebug() << __func__ << \": Stopped thread\";\n    }\n\n    delete window;\n    window = 0;\n#ifdef ENABLE_WALLET\n    delete paymentServer;\n    paymentServer = 0;\n#endif\n    delete optionsModel;\n    optionsModel = 0;\n    delete platformStyle;\n    platformStyle = 0;\n}\n\n#ifdef ENABLE_WALLET\nvoid BitcoinApplication::createPaymentServer()\n{\n    paymentServer = new PaymentServer(this);\n}\n#endif\n\nvoid BitcoinApplication::createOptionsModel(bool resetSettings)\n{\n    optionsModel = new OptionsModel(nullptr, resetSettings);\n}\n\nvoid BitcoinApplication::createWindow(const NetworkStyle *networkStyle)\n{\n    window = new BitcoinGUI(platformStyle, networkStyle, 0);\n\n    pollShutdownTimer = new QTimer(window);\n    connect(pollShutdownTimer, SIGNAL(timeout()), window, SLOT(detectShutdown()));\n}\n\nvoid BitcoinApplication::createSplashScreen(const NetworkStyle *networkStyle)\n{\n    SplashScreen *splash = new SplashScreen(0, networkStyle);\n    // We don't hold a direct pointer to the splash screen after creation, but the splash\n    // screen will take care of deleting itself when slotFinish happens.\n    splash->show();\n    connect(this, SIGNAL(splashFinished(QWidget*)), splash, SLOT(slotFinish(QWidget*)));\n    connect(this, SIGNAL(requestedShutdown()), splash, SLOT(close()));\n}\n\nvoid BitcoinApplication::startThread()\n{\n    if(coreThread)\n        return;\n    coreThread = new QThread(this);\n    BitcoinCore *executor = new BitcoinCore();\n    executor->moveToThread(coreThread);\n\n    /*  communication to and from thread */\n    connect(executor, SIGNAL(initializeResult(bool)), this, SLOT(initializeResult(bool)));\n    connect(executor, SIGNAL(shutdownResult()), this, SLOT(shutdownResult()));\n    connect(executor, SIGNAL(runawayException(QString)), this, SLOT(handleRunawayException(QString)));\n    connect(this, SIGNAL(requestedInitialize()), executor, SLOT(initialize()));\n    connect(this, SIGNAL(requestedShutdown()), executor, SLOT(shutdown()));\n    /*  make sure executor object is deleted in its own thread */\n    connect(this, SIGNAL(stopThread()), executor, SLOT(deleteLater()));\n    connect(this, SIGNAL(stopThread()), coreThread, SLOT(quit()));\n\n    coreThread->start();\n}\n\nvoid BitcoinApplication::parameterSetup()\n{\n    InitLogging();\n    InitParameterInteraction();\n}\n\nvoid BitcoinApplication::requestInitialize()\n{\n    qDebug() << __func__ << \": Requesting initialize\";\n    startThread();\n    Q_EMIT requestedInitialize();\n}\n\nvoid BitcoinApplication::requestShutdown()\n{\n    // Show a simple window indicating shutdown status\n    // Do this first as some of the steps may take some time below,\n    // for example the RPC console may still be executing a command.\n    shutdownWindow.reset(ShutdownWindow::showShutdownWindow(window));\n\n    qDebug() << __func__ << \": Requesting shutdown\";\n    startThread();\n    window->hide();\n    window->setClientModel(0);\n    pollShutdownTimer->stop();\n\n#ifdef ENABLE_WALLET\n    window->removeAllWallets();\n    delete walletModel;\n    walletModel = 0;\n#endif\n    delete clientModel;\n    clientModel = 0;\n\n    StartShutdown();\n\n    // Request shutdown from core thread\n    Q_EMIT requestedShutdown();\n}\n\nvoid BitcoinApplication::initializeResult(bool success)\n{\n    qDebug() << __func__ << \": Initialization result: \" << success;\n    // Set exit result.\n    returnValue = success ? EXIT_SUCCESS : EXIT_FAILURE;\n    if(success)\n    {\n        // Log this only after AppInitMain finishes, as then logging setup is guaranteed complete\n        qWarning() << \"Platform customization:\" << platformStyle->getName();\n#ifdef ENABLE_WALLET\n        PaymentServer::LoadRootCAs();\n        paymentServer->setOptionsModel(optionsModel);\n#endif\n\n        clientModel = new ClientModel(optionsModel);\n        window->setClientModel(clientModel);\n\n#ifdef ENABLE_WALLET\n        // TODO: Expose secondary wallets\n        if (!vpwallets.empty())\n        {\n            walletModel = new WalletModel(platformStyle, vpwallets[0], optionsModel);\n\n            window->addWallet(BitcoinGUI::DEFAULT_WALLET, walletModel);\n            window->setCurrentWallet(BitcoinGUI::DEFAULT_WALLET);\n\n            connect(walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)),\n                             paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray)));\n        }\n#endif\n\n        // If -min option passed, start window minimized.\n        if(gArgs.GetBoolArg(\"-min\", false))\n        {\n            window->showMinimized();\n        }\n        else\n        {\n            window->show();\n        }\n        Q_EMIT splashFinished(window);\n\n#ifdef ENABLE_WALLET\n        // Now that initialization/startup is done, process any command-line\n        // bitcoin: URIs or payment requests:\n        connect(paymentServer, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)),\n                         window, SLOT(handlePaymentRequest(SendCoinsRecipient)));\n        connect(window, SIGNAL(receivedURI(QString)),\n                         paymentServer, SLOT(handleURIOrFile(QString)));\n        connect(paymentServer, SIGNAL(message(QString,QString,unsigned int)),\n                         window, SLOT(message(QString,QString,unsigned int)));\n        QTimer::singleShot(100, paymentServer, SLOT(uiReady()));\n#endif\n        pollShutdownTimer->start(200);\n    } else {\n        Q_EMIT splashFinished(window); // Make sure splash screen doesn't stick around during shutdown\n        quit(); // Exit first main loop invocation\n    }\n}\n\nvoid BitcoinApplication::shutdownResult()\n{\n    quit(); // Exit second main loop invocation after shutdown finished\n}\n\nvoid BitcoinApplication::handleRunawayException(const QString &message)\n{\n    QMessageBox::critical(0, \"Runaway exception\", BitcoinGUI::tr(\"A fatal error occurred. Sugarchain can no longer continue safely and will quit.\") + QString(\"\\n\\n\") + message);\n    ::exit(EXIT_FAILURE);\n}\n\nWId BitcoinApplication::getMainWinId() const\n{\n    if (!window)\n        return 0;\n\n    return window->winId();\n}\n\n#ifndef BITCOIN_QT_TEST\nint main(int argc, char *argv[])\n{\n    SetupEnvironment();\n\n    /// 1. Parse command-line options. These take precedence over anything else.\n    // Command-line options take precedence:\n    gArgs.ParseParameters(argc, argv);\n\n    // Do not refer to data directory yet, this can be overridden by Intro::pickDataDirectory\n\n    /// 2. Basic Qt initialization (not dependent on parameters or configuration)\n#if QT_VERSION < 0x050000\n    // Internal string conversion is all UTF-8\n    QTextCodec::setCodecForTr(QTextCodec::codecForName(\"UTF-8\"));\n    QTextCodec::setCodecForCStrings(QTextCodec::codecForTr());\n#endif\n\n    Q_INIT_RESOURCE(bitcoin);\n    Q_INIT_RESOURCE(bitcoin_locale);\n\n    BitcoinApplication app(argc, argv);\n#if QT_VERSION > 0x050100\n    // Generate high-dpi pixmaps\n    QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);\n#endif\n#if QT_VERSION >= 0x050600\n    QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);\n#endif\n#ifdef Q_OS_MAC\n    QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);\n#endif\n#if QT_VERSION >= 0x050500\n    // Because of the POODLE attack it is recommended to disable SSLv3 (https://disablessl3.com/),\n    // so set SSL protocols to TLS1.0+.\n    QSslConfiguration sslconf = QSslConfiguration::defaultConfiguration();\n    sslconf.setProtocol(QSsl::TlsV1_0OrLater);\n    QSslConfiguration::setDefaultConfiguration(sslconf);\n#endif\n\n    // Register meta types used for QMetaObject::invokeMethod\n    qRegisterMetaType< bool* >();\n    //   Need to pass name here as CAmount is a typedef (see http://qt-project.org/doc/qt-5/qmetatype.html#qRegisterMetaType)\n    //   IMPORTANT if it is no longer a typedef use the normal variant above\n    qRegisterMetaType< CAmount >(\"CAmount\");\n    qRegisterMetaType< std::function<void(void)> >(\"std::function<void(void)>\");\n\n    /// 3. Application identification\n    // must be set before OptionsModel is initialized or translations are loaded,\n    // as it is used to locate QSettings\n    QApplication::setOrganizationName(QAPP_ORG_NAME);\n    QApplication::setOrganizationDomain(QAPP_ORG_DOMAIN);\n    QApplication::setApplicationName(QAPP_APP_NAME_DEFAULT);\n    GUIUtil::SubstituteFonts(GetLangTerritory());\n\n    /// 4. Initialization of translations, so that intro dialog is in user's language\n    // Now that QSettings are accessible, initialize translations\n    QTranslator qtTranslatorBase, qtTranslator, translatorBase, translator;\n    initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator);\n    translationInterface.Translate.connect(Translate);\n\n    // Show help message immediately after parsing command-line options (for \"-lang\") and setting locale,\n    // but before showing splash screen.\n    if (gArgs.IsArgSet(\"-?\") || gArgs.IsArgSet(\"-h\") || gArgs.IsArgSet(\"-help\") || gArgs.IsArgSet(\"-version\"))\n    {\n        HelpMessageDialog help(nullptr, gArgs.IsArgSet(\"-version\"));\n        help.showOrPrint();\n        return EXIT_SUCCESS;\n    }\n\n    /// 5. Now that settings and translations are available, ask user for data directory\n    // User language is set up: pick a data directory\n    if (!Intro::pickDataDirectory())\n        return EXIT_SUCCESS;\n\n    /// 6. Determine availability of data directory and parse bitcoin.conf\n    /// - Do not call GetDataDir(true) before this step finishes\n    if (!fs::is_directory(GetDataDir(false)))\n    {\n        QMessageBox::critical(0, QObject::tr(PACKAGE_NAME),\n                              QObject::tr(\"Error: Specified data directory \\\"%1\\\" does not exist.\").arg(QString::fromStdString(gArgs.GetArg(\"-datadir\", \"\"))));\n        return EXIT_FAILURE;\n    }\n    try {\n        gArgs.ReadConfigFile(gArgs.GetArg(\"-conf\", BITCOIN_CONF_FILENAME));\n    } catch (const std::exception& e) {\n        QMessageBox::critical(0, QObject::tr(PACKAGE_NAME),\n                              QObject::tr(\"Error: Cannot parse configuration file: %1. Only use key=value syntax.\").arg(e.what()));\n        return EXIT_FAILURE;\n    }\n\n    /// 7. Determine network (and switch to network specific options)\n    // - Do not call Params() before this step\n    // - Do this after parsing the configuration file, as the network can be switched there\n    // - QSettings() will use the new application name after this, resulting in network-specific settings\n    // - Needs to be done before createOptionsModel\n\n    // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)\n    try {\n        SelectParams(ChainNameFromCommandLine());\n    } catch(std::exception &e) {\n        QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QObject::tr(\"Error: %1\").arg(e.what()));\n        return EXIT_FAILURE;\n    }\n#ifdef ENABLE_WALLET\n    // Parse URIs on command line -- this can affect Params()\n    PaymentServer::ipcParseCommandLine(argc, argv);\n#endif\n\n    QScopedPointer<const NetworkStyle> networkStyle(NetworkStyle::instantiate(QString::fromStdString(Params().NetworkIDString())));\n    assert(!networkStyle.isNull());\n    // Allow for separate UI settings for testnets\n    QApplication::setApplicationName(networkStyle->getAppName());\n    // Re-initialize translations after changing application name (language in network-specific settings can be different)\n    initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator);\n\n#ifdef ENABLE_WALLET\n    /// 8. URI IPC sending\n    // - Do this early as we don't want to bother initializing if we are just calling IPC\n    // - Do this *after* setting up the data directory, as the data directory hash is used in the name\n    // of the server.\n    // - Do this after creating app and setting up translations, so errors are\n    // translated properly.\n    if (PaymentServer::ipcSendCommandLine())\n        exit(EXIT_SUCCESS);\n\n    // Start up the payment server early, too, so impatient users that click on\n    // bitcoin: links repeatedly have their payment requests routed to this process:\n    app.createPaymentServer();\n#endif\n\n    /// 9. Main GUI initialization\n    // Install global event filter that makes sure that long tooltips can be word-wrapped\n    app.installEventFilter(new GUIUtil::ToolTipToRichTextFilter(TOOLTIP_WRAP_THRESHOLD, &app));\n#if QT_VERSION < 0x050000\n    // Install qDebug() message handler to route to debug.log\n    qInstallMsgHandler(DebugMessageHandler);\n#else\n#if defined(Q_OS_WIN)\n    // Install global event filter for processing Windows session related Windows messages (WM_QUERYENDSESSION and WM_ENDSESSION)\n    qApp->installNativeEventFilter(new WinShutdownMonitor());\n#endif\n    // Install qDebug() message handler to route to debug.log\n    qInstallMessageHandler(DebugMessageHandler);\n#endif\n    // Allow parameter interaction before we create the options model\n    app.parameterSetup();\n    // Load GUI settings from QSettings\n    app.createOptionsModel(gArgs.GetBoolArg(\"-resetguisettings\", false));\n\n    // Subscribe to global signals from core\n    uiInterface.InitMessage.connect(InitMessage);\n\n    if (gArgs.GetBoolArg(\"-splash\", DEFAULT_SPLASHSCREEN) && !gArgs.GetBoolArg(\"-min\", false))\n        app.createSplashScreen(networkStyle.data());\n\n    int rv = EXIT_SUCCESS;\n    try\n    {\n        app.createWindow(networkStyle.data());\n        // Perform base initialization before spinning up initialization/shutdown thread\n        // This is acceptable because this function only contains steps that are quick to execute,\n        // so the GUI thread won't be held up.\n        if (BitcoinCore::baseInitialize()) {\n            app.requestInitialize();\n#if defined(Q_OS_WIN) && QT_VERSION >= 0x050000\n            WinShutdownMonitor::registerShutdownBlockReason(QObject::tr(\"%1 didn't yet exit safely...\").arg(QObject::tr(PACKAGE_NAME)), (HWND)app.getMainWinId());\n#endif\n            app.exec();\n            app.requestShutdown();\n            app.exec();\n            rv = app.getReturnValue();\n        } else {\n            // A dialog with detailed error will have been shown by InitError()\n            rv = EXIT_FAILURE;\n        }\n    } catch (const std::exception& e) {\n        PrintExceptionContinue(&e, \"Runaway exception\");\n        app.handleRunawayException(QString::fromStdString(GetWarnings(\"gui\")));\n    } catch (...) {\n        PrintExceptionContinue(nullptr, \"Runaway exception\");\n        app.handleRunawayException(QString::fromStdString(GetWarnings(\"gui\")));\n    }\n    return rv;\n}\n#endif // BITCOIN_QT_TEST\n"
  },
  {
    "path": "src/qt/bitcoin.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n    <qresource prefix=\"/icons\">\n        <file alias=\"bitcoin\">res/icons/bitcoin.png</file>\n        <file alias=\"address-book\">res/icons/address-book.png</file>\n        <file alias=\"quit\">res/icons/quit.png</file>\n        <file alias=\"send\">res/icons/send.png</file>\n        <file alias=\"connect_0\">res/icons/connect0.png</file>\n        <file alias=\"connect_1\">res/icons/connect1.png</file>\n        <file alias=\"connect_2\">res/icons/connect2.png</file>\n        <file alias=\"connect_3\">res/icons/connect3.png</file>\n        <file alias=\"connect_4\">res/icons/connect4.png</file>\n        <file alias=\"transaction_0\">res/icons/transaction0.png</file>\n        <file alias=\"transaction_confirmed\">res/icons/transaction2.png</file>\n        <file alias=\"transaction_conflicted\">res/icons/transaction_conflicted.png</file>\n        <file alias=\"transaction_1\">res/icons/clock1.png</file>\n        <file alias=\"transaction_2\">res/icons/clock2.png</file>\n        <file alias=\"transaction_3\">res/icons/clock3.png</file>\n        <file alias=\"transaction_4\">res/icons/clock4.png</file>\n        <file alias=\"transaction_5\">res/icons/clock5.png</file>\n        <file alias=\"eye\">res/icons/eye.png</file>\n        <file alias=\"eye_minus\">res/icons/eye_minus.png</file>\n        <file alias=\"eye_plus\">res/icons/eye_plus.png</file>\n        <file alias=\"options\">res/icons/configure.png</file>\n        <file alias=\"receiving_addresses\">res/icons/receive.png</file>\n        <file alias=\"editpaste\">res/icons/editpaste.png</file>\n        <file alias=\"editcopy\">res/icons/editcopy.png</file>\n        <file alias=\"add\">res/icons/add.png</file>\n        <file alias=\"edit\">res/icons/edit.png</file>\n        <file alias=\"history\">res/icons/history.png</file>\n        <file alias=\"overview\">res/icons/overview.png</file>\n        <file alias=\"export\">res/icons/export.png</file>\n        <file alias=\"synced\">res/icons/synced.png</file>\n        <file alias=\"remove\">res/icons/remove.png</file>\n        <file alias=\"tx_mined\">res/icons/tx_mined.png</file>\n        <file alias=\"tx_input\">res/icons/tx_input.png</file>\n        <file alias=\"tx_output\">res/icons/tx_output.png</file>\n        <file alias=\"tx_inout\">res/icons/tx_inout.png</file>\n        <file alias=\"lock_closed\">res/icons/lock_closed.png</file>\n        <file alias=\"lock_open\">res/icons/lock_open.png</file>\n        <file alias=\"key\">res/icons/key.png</file>\n        <file alias=\"filesave\">res/icons/filesave.png</file>\n        <file alias=\"debugwindow\">res/icons/debugwindow.png</file>\n        <file alias=\"open\">res/icons/open.png</file>\n        <file alias=\"info\">res/icons/info.png</file>\n        <file alias=\"about\">res/icons/about.png</file>\n        <file alias=\"about_qt\">res/icons/about_qt.png</file>\n        <file alias=\"verify\">res/icons/verify.png</file>\n        <file alias=\"warning\">res/icons/warning.png</file>\n        <file alias=\"fontbigger\">res/icons/fontbigger.png</file>\n        <file alias=\"fontsmaller\">res/icons/fontsmaller.png</file>\n        <file alias=\"prompticon\">res/icons/chevron.png</file>\n        <file alias=\"transaction_abandoned\">res/icons/transaction_abandoned.png</file>\n        <file alias=\"hd_enabled\">res/icons/hd_enabled.png</file>\n        <file alias=\"hd_disabled\">res/icons/hd_disabled.png</file>\n        <file alias=\"network_disabled\">res/icons/network_disabled.png</file>\n    </qresource>\n    <qresource prefix=\"/movies\">\n        <file alias=\"spinner-000\">res/movies/spinner-000.png</file>\n        <file alias=\"spinner-001\">res/movies/spinner-001.png</file>\n        <file alias=\"spinner-002\">res/movies/spinner-002.png</file>\n        <file alias=\"spinner-003\">res/movies/spinner-003.png</file>\n        <file alias=\"spinner-004\">res/movies/spinner-004.png</file>\n        <file alias=\"spinner-005\">res/movies/spinner-005.png</file>\n        <file alias=\"spinner-006\">res/movies/spinner-006.png</file>\n        <file alias=\"spinner-007\">res/movies/spinner-007.png</file>\n        <file alias=\"spinner-008\">res/movies/spinner-008.png</file>\n        <file alias=\"spinner-009\">res/movies/spinner-009.png</file>\n        <file alias=\"spinner-010\">res/movies/spinner-010.png</file>\n        <file alias=\"spinner-011\">res/movies/spinner-011.png</file>\n        <file alias=\"spinner-012\">res/movies/spinner-012.png</file>\n        <file alias=\"spinner-013\">res/movies/spinner-013.png</file>\n        <file alias=\"spinner-014\">res/movies/spinner-014.png</file>\n        <file alias=\"spinner-015\">res/movies/spinner-015.png</file>\n        <file alias=\"spinner-016\">res/movies/spinner-016.png</file>\n        <file alias=\"spinner-017\">res/movies/spinner-017.png</file>\n        <file alias=\"spinner-018\">res/movies/spinner-018.png</file>\n        <file alias=\"spinner-019\">res/movies/spinner-019.png</file>\n        <file alias=\"spinner-020\">res/movies/spinner-020.png</file>\n        <file alias=\"spinner-021\">res/movies/spinner-021.png</file>\n        <file alias=\"spinner-022\">res/movies/spinner-022.png</file>\n        <file alias=\"spinner-023\">res/movies/spinner-023.png</file>\n        <file alias=\"spinner-024\">res/movies/spinner-024.png</file>\n        <file alias=\"spinner-025\">res/movies/spinner-025.png</file>\n        <file alias=\"spinner-026\">res/movies/spinner-026.png</file>\n        <file alias=\"spinner-027\">res/movies/spinner-027.png</file>\n        <file alias=\"spinner-028\">res/movies/spinner-028.png</file>\n        <file alias=\"spinner-029\">res/movies/spinner-029.png</file>\n        <file alias=\"spinner-030\">res/movies/spinner-030.png</file>\n        <file alias=\"spinner-031\">res/movies/spinner-031.png</file>\n        <file alias=\"spinner-032\">res/movies/spinner-032.png</file>\n        <file alias=\"spinner-033\">res/movies/spinner-033.png</file>\n        <file alias=\"spinner-034\">res/movies/spinner-034.png</file>\n        <file alias=\"spinner-035\">res/movies/spinner-035.png</file>\n    </qresource>\n</RCC>\n"
  },
  {
    "path": "src/qt/bitcoin_locale.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n    <qresource prefix=\"/translations\">\n        <file alias=\"af\">locale/bitcoin_af.qm</file>\n        <file alias=\"af_ZA\">locale/bitcoin_af_ZA.qm</file>\n        <file alias=\"am\">locale/bitcoin_am.qm</file>\n        <file alias=\"ar\">locale/bitcoin_ar.qm</file>\n        <file alias=\"be_BY\">locale/bitcoin_be_BY.qm</file>\n        <file alias=\"bg_BG\">locale/bitcoin_bg_BG.qm</file>\n        <file alias=\"bg\">locale/bitcoin_bg.qm</file>\n        <file alias=\"bn\">locale/bitcoin_bn.qm</file>\n        <file alias=\"bs\">locale/bitcoin_bs.qm</file>\n        <file alias=\"ca_ES\">locale/bitcoin_ca_ES.qm</file>\n        <file alias=\"ca\">locale/bitcoin_ca.qm</file>\n        <file alias=\"ca@valencia\">locale/bitcoin_ca@valencia.qm</file>\n        <file alias=\"cs_CZ\">locale/bitcoin_cs_CZ.qm</file>\n        <file alias=\"cs\">locale/bitcoin_cs.qm</file>\n        <file alias=\"cy\">locale/bitcoin_cy.qm</file>\n        <file alias=\"da\">locale/bitcoin_da.qm</file>\n        <file alias=\"de_DE\">locale/bitcoin_de_DE.qm</file>\n        <file alias=\"de\">locale/bitcoin_de.qm</file>\n        <file alias=\"el_GR\">locale/bitcoin_el_GR.qm</file>\n        <file alias=\"el\">locale/bitcoin_el.qm</file>\n        <file alias=\"en_AU\">locale/bitcoin_en_AU.qm</file>\n        <file alias=\"en_GB\">locale/bitcoin_en_GB.qm</file>\n        <file alias=\"en\">locale/bitcoin_en.qm</file>\n        <file alias=\"eo\">locale/bitcoin_eo.qm</file>\n        <file alias=\"es_419\">locale/bitcoin_es_419.qm</file>\n        <file alias=\"es_AR\">locale/bitcoin_es_AR.qm</file>\n        <file alias=\"es_CL\">locale/bitcoin_es_CL.qm</file>\n        <file alias=\"es_CO\">locale/bitcoin_es_CO.qm</file>\n        <file alias=\"es_DO\">locale/bitcoin_es_DO.qm</file>\n        <file alias=\"es_ES\">locale/bitcoin_es_ES.qm</file>\n        <file alias=\"es_MX\">locale/bitcoin_es_MX.qm</file>\n        <file alias=\"es\">locale/bitcoin_es.qm</file>\n        <file alias=\"es_UY\">locale/bitcoin_es_UY.qm</file>\n        <file alias=\"es_VE\">locale/bitcoin_es_VE.qm</file>\n        <file alias=\"et_EE\">locale/bitcoin_et_EE.qm</file>\n        <file alias=\"et\">locale/bitcoin_et.qm</file>\n        <file alias=\"eu_ES\">locale/bitcoin_eu_ES.qm</file>\n        <file alias=\"fa_IR\">locale/bitcoin_fa_IR.qm</file>\n        <file alias=\"fa\">locale/bitcoin_fa.qm</file>\n        <file alias=\"fi\">locale/bitcoin_fi.qm</file>\n        <file alias=\"fr_CA\">locale/bitcoin_fr_CA.qm</file>\n        <file alias=\"fr_FR\">locale/bitcoin_fr_FR.qm</file>\n        <file alias=\"fr\">locale/bitcoin_fr.qm</file>\n        <file alias=\"gl\">locale/bitcoin_gl.qm</file>\n        <file alias=\"he_IL\">locale/bitcoin_he_IL.qm</file>\n        <file alias=\"he\">locale/bitcoin_he.qm</file>\n        <file alias=\"hi_IN\">locale/bitcoin_hi_IN.qm</file>\n        <file alias=\"hr\">locale/bitcoin_hr.qm</file>\n        <file alias=\"hu_HU\">locale/bitcoin_hu_HU.qm</file>\n        <file alias=\"hu\">locale/bitcoin_hu.qm</file>\n        <file alias=\"id_ID\">locale/bitcoin_id_ID.qm</file>\n        <file alias=\"id\">locale/bitcoin_id.qm</file>\n        <file alias=\"is\">locale/bitcoin_is.qm</file>\n        <file alias=\"it_IT\">locale/bitcoin_it_IT.qm</file>\n        <file alias=\"it\">locale/bitcoin_it.qm</file>\n        <file alias=\"ja_JP\">locale/bitcoin_ja_JP.qm</file>\n        <file alias=\"ja\">locale/bitcoin_ja.qm</file>\n        <file alias=\"ka\">locale/bitcoin_ka.qm</file>\n        <file alias=\"kk_KZ\">locale/bitcoin_kk_KZ.qm</file>\n        <file alias=\"km_KH\">locale/bitcoin_km_KH.qm</file>\n        <file alias=\"ko_KR\">locale/bitcoin_ko_KR.qm</file>\n        <file alias=\"ko\">locale/bitcoin_ko.qm</file>\n        <file alias=\"ku_IQ\">locale/bitcoin_ku_IQ.qm</file>\n        <file alias=\"ky\">locale/bitcoin_ky.qm</file>\n        <file alias=\"la\">locale/bitcoin_la.qm</file>\n        <file alias=\"lt\">locale/bitcoin_lt.qm</file>\n        <file alias=\"lv_LV\">locale/bitcoin_lv_LV.qm</file>\n        <file alias=\"mk_MK\">locale/bitcoin_mk_MK.qm</file>\n        <file alias=\"ml\">locale/bitcoin_ml.qm</file>\n        <file alias=\"mn\">locale/bitcoin_mn.qm</file>\n        <file alias=\"mr_IN\">locale/bitcoin_mr_IN.qm</file>\n        <file alias=\"ms_MY\">locale/bitcoin_ms_MY.qm</file>\n        <file alias=\"ms\">locale/bitcoin_ms.qm</file>\n        <file alias=\"my\">locale/bitcoin_my.qm</file>\n        <file alias=\"nb_NO\">locale/bitcoin_nb_NO.qm</file>\n        <file alias=\"nb\">locale/bitcoin_nb.qm</file>\n        <file alias=\"ne\">locale/bitcoin_ne.qm</file>\n        <file alias=\"nl_NL\">locale/bitcoin_nl_NL.qm</file>\n        <file alias=\"nl\">locale/bitcoin_nl.qm</file>\n        <file alias=\"pam\">locale/bitcoin_pam.qm</file>\n        <file alias=\"pl_PL\">locale/bitcoin_pl_PL.qm</file>\n        <file alias=\"pl\">locale/bitcoin_pl.qm</file>\n        <file alias=\"pt_BR\">locale/bitcoin_pt_BR.qm</file>\n        <file alias=\"pt_PT\">locale/bitcoin_pt_PT.qm</file>\n        <file alias=\"pt\">locale/bitcoin_pt.qm</file>\n        <file alias=\"ro_RO\">locale/bitcoin_ro_RO.qm</file>\n        <file alias=\"ro\">locale/bitcoin_ro.qm</file>\n        <file alias=\"ru_RU\">locale/bitcoin_ru_RU.qm</file>\n        <file alias=\"ru\">locale/bitcoin_ru.qm</file>\n        <file alias=\"si\">locale/bitcoin_si.qm</file>\n        <file alias=\"sk\">locale/bitcoin_sk.qm</file>\n        <file alias=\"sl_SI\">locale/bitcoin_sl_SI.qm</file>\n        <file alias=\"sn\">locale/bitcoin_sn.qm</file>\n        <file alias=\"sq\">locale/bitcoin_sq.qm</file>\n        <file alias=\"sr@latin\">locale/bitcoin_sr@latin.qm</file>\n        <file alias=\"sr\">locale/bitcoin_sr.qm</file>\n        <file alias=\"sv\">locale/bitcoin_sv.qm</file>\n        <file alias=\"ta_IN\">locale/bitcoin_ta_IN.qm</file>\n        <file alias=\"ta\">locale/bitcoin_ta.qm</file>\n        <file alias=\"te\">locale/bitcoin_te.qm</file>\n        <file alias=\"th_TH\">locale/bitcoin_th_TH.qm</file>\n        <file alias=\"th\">locale/bitcoin_th.qm</file>\n        <file alias=\"tr_TR\">locale/bitcoin_tr_TR.qm</file>\n        <file alias=\"tr\">locale/bitcoin_tr.qm</file>\n        <file alias=\"uk\">locale/bitcoin_uk.qm</file>\n        <file alias=\"ur_PK\">locale/bitcoin_ur_PK.qm</file>\n        <file alias=\"uz@Cyrl\">locale/bitcoin_uz@Cyrl.qm</file>\n        <file alias=\"vi\">locale/bitcoin_vi.qm</file>\n        <file alias=\"vi_VN\">locale/bitcoin_vi_VN.qm</file>\n        <file alias=\"zh_CN\">locale/bitcoin_zh_CN.qm</file>\n        <file alias=\"zh-Hans\">locale/bitcoin_zh-Hans.qm</file>\n        <file alias=\"zh_HK\">locale/bitcoin_zh_HK.qm</file>\n        <file alias=\"zh\">locale/bitcoin_zh.qm</file>\n        <file alias=\"zh_TW\">locale/bitcoin_zh_TW.qm</file>\n    </qresource>\n</RCC>\n"
  },
  {
    "path": "src/qt/bitcoinaddressvalidator.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/bitcoinaddressvalidator.h>\n\n#include <base58.h>\n\n/* Base58 characters are:\n     \"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\"\n\n  This is:\n  - All numbers except for '0'\n  - All upper-case letters except for 'I' and 'O'\n  - All lower-case letters except for 'l'\n*/\n\nBitcoinAddressEntryValidator::BitcoinAddressEntryValidator(QObject *parent) :\n    QValidator(parent)\n{\n}\n\nQValidator::State BitcoinAddressEntryValidator::validate(QString &input, int &pos) const\n{\n    Q_UNUSED(pos);\n\n    // Empty address is \"intermediate\" input\n    if (input.isEmpty())\n        return QValidator::Intermediate;\n\n    // Correction\n    for (int idx = 0; idx < input.size();)\n    {\n        bool removeChar = false;\n        QChar ch = input.at(idx);\n        // Corrections made are very conservative on purpose, to avoid\n        // users unexpectedly getting away with typos that would normally\n        // be detected, and thus sending to the wrong address.\n        switch(ch.unicode())\n        {\n        // Qt categorizes these as \"Other_Format\" not \"Separator_Space\"\n        case 0x200B: // ZERO WIDTH SPACE\n        case 0xFEFF: // ZERO WIDTH NO-BREAK SPACE\n            removeChar = true;\n            break;\n        default:\n            break;\n        }\n\n        // Remove whitespace\n        if (ch.isSpace())\n            removeChar = true;\n\n        // To next character\n        if (removeChar)\n            input.remove(idx, 1);\n        else\n            ++idx;\n    }\n\n    // Validation\n    QValidator::State state = QValidator::Acceptable;\n    for (int idx = 0; idx < input.size(); ++idx)\n    {\n        int ch = input.at(idx).unicode();\n\n        if (((ch >= '0' && ch<='9') ||\n            (ch >= 'a' && ch<='z') ||\n            (ch >= 'A' && ch<='Z')) &&\n            ch != 'I' && ch != 'O') // Characters invalid in both Base58 and Bech32\n        {\n            // Alphanumeric and not a 'forbidden' character\n        }\n        else\n        {\n            state = QValidator::Invalid;\n        }\n    }\n\n    return state;\n}\n\nBitcoinAddressCheckValidator::BitcoinAddressCheckValidator(QObject *parent) :\n    QValidator(parent)\n{\n}\n\nQValidator::State BitcoinAddressCheckValidator::validate(QString &input, int &pos) const\n{\n    Q_UNUSED(pos);\n    // Validate the passed Bitcoin address\n    if (IsValidDestinationString(input.toStdString())) {\n        return QValidator::Acceptable;\n    }\n\n    return QValidator::Invalid;\n}\n"
  },
  {
    "path": "src/qt/bitcoinaddressvalidator.h",
    "content": "// Copyright (c) 2011-2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_BITCOINADDRESSVALIDATOR_H\n#define BITCOIN_QT_BITCOINADDRESSVALIDATOR_H\n\n#include <QValidator>\n\n/** Base58 entry widget validator, checks for valid characters and\n * removes some whitespace.\n */\nclass BitcoinAddressEntryValidator : public QValidator\n{\n    Q_OBJECT\n\npublic:\n    explicit BitcoinAddressEntryValidator(QObject *parent);\n\n    State validate(QString &input, int &pos) const;\n};\n\n/** Bitcoin address widget validator, checks for a valid bitcoin address.\n */\nclass BitcoinAddressCheckValidator : public QValidator\n{\n    Q_OBJECT\n\npublic:\n    explicit BitcoinAddressCheckValidator(QObject *parent);\n\n    State validate(QString &input, int &pos) const;\n};\n\n#endif // BITCOIN_QT_BITCOINADDRESSVALIDATOR_H\n"
  },
  {
    "path": "src/qt/bitcoinamountfield.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/bitcoinamountfield.h>\n\n#include <qt/bitcoinunits.h>\n#include <qt/guiconstants.h>\n#include <qt/qvaluecombobox.h>\n\n#include <QApplication>\n#include <QAbstractSpinBox>\n#include <QHBoxLayout>\n#include <QKeyEvent>\n#include <QLineEdit>\n\n/** QSpinBox that uses fixed-point numbers internally and uses our own\n * formatting/parsing functions.\n */\nclass AmountSpinBox: public QAbstractSpinBox\n{\n    Q_OBJECT\n\npublic:\n    explicit AmountSpinBox(QWidget *parent):\n        QAbstractSpinBox(parent),\n        currentUnit(BitcoinUnits::BTC),\n        singleStep(100000) // satoshis\n    {\n        setAlignment(Qt::AlignRight);\n\n        connect(lineEdit(), SIGNAL(textEdited(QString)), this, SIGNAL(valueChanged()));\n    }\n\n    QValidator::State validate(QString &text, int &pos) const\n    {\n        if(text.isEmpty())\n            return QValidator::Intermediate;\n        bool valid = false;\n        parse(text, &valid);\n        /* Make sure we return Intermediate so that fixup() is called on defocus */\n        return valid ? QValidator::Intermediate : QValidator::Invalid;\n    }\n\n    void fixup(QString &input) const\n    {\n        bool valid = false;\n        CAmount val = parse(input, &valid);\n        if(valid)\n        {\n            input = BitcoinUnits::format(currentUnit, val, false, BitcoinUnits::separatorAlways);\n            lineEdit()->setText(input);\n        }\n    }\n\n    CAmount value(bool *valid_out=0) const\n    {\n        return parse(text(), valid_out);\n    }\n\n    void setValue(const CAmount& value)\n    {\n        lineEdit()->setText(BitcoinUnits::format(currentUnit, value, false, BitcoinUnits::separatorAlways));\n        Q_EMIT valueChanged();\n    }\n\n    void stepBy(int steps)\n    {\n        bool valid = false;\n        CAmount val = value(&valid);\n        val = val + steps * singleStep;\n        val = qMin(qMax(val, CAmount(0)), BitcoinUnits::maxMoney());\n        setValue(val);\n    }\n\n    void setDisplayUnit(int unit)\n    {\n        bool valid = false;\n        CAmount val = value(&valid);\n\n        currentUnit = unit;\n\n        if(valid)\n            setValue(val);\n        else\n            clear();\n    }\n\n    void setSingleStep(const CAmount& step)\n    {\n        singleStep = step;\n    }\n\n    QSize minimumSizeHint() const\n    {\n        if(cachedMinimumSizeHint.isEmpty())\n        {\n            ensurePolished();\n\n            const QFontMetrics fm(fontMetrics());\n            int h = lineEdit()->minimumSizeHint().height();\n            int w = fm.width(BitcoinUnits::format(BitcoinUnits::BTC, BitcoinUnits::maxMoney(), false, BitcoinUnits::separatorAlways));\n            w += 2; // cursor blinking space\n\n            QStyleOptionSpinBox opt;\n            initStyleOption(&opt);\n            QSize hint(w, h);\n            QSize extra(35, 6);\n            opt.rect.setSize(hint + extra);\n            extra += hint - style()->subControlRect(QStyle::CC_SpinBox, &opt,\n                                                    QStyle::SC_SpinBoxEditField, this).size();\n            // get closer to final result by repeating the calculation\n            opt.rect.setSize(hint + extra);\n            extra += hint - style()->subControlRect(QStyle::CC_SpinBox, &opt,\n                                                    QStyle::SC_SpinBoxEditField, this).size();\n            hint += extra;\n            hint.setHeight(h);\n\n            opt.rect = rect();\n\n            cachedMinimumSizeHint = style()->sizeFromContents(QStyle::CT_SpinBox, &opt, hint, this)\n                                    .expandedTo(QApplication::globalStrut());\n        }\n        return cachedMinimumSizeHint;\n    }\n\nprivate:\n    int currentUnit;\n    CAmount singleStep;\n    mutable QSize cachedMinimumSizeHint;\n\n    /**\n     * Parse a string into a number of base monetary units and\n     * return validity.\n     * @note Must return 0 if !valid.\n     */\n    CAmount parse(const QString &text, bool *valid_out=0) const\n    {\n        CAmount val = 0;\n        bool valid = BitcoinUnits::parse(currentUnit, text, &val);\n        if(valid)\n        {\n            if(val < 0 || val > BitcoinUnits::maxMoney())\n                valid = false;\n        }\n        if(valid_out)\n            *valid_out = valid;\n        return valid ? val : 0;\n    }\n\nprotected:\n    bool event(QEvent *event)\n    {\n        if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)\n        {\n            QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);\n            if (keyEvent->key() == Qt::Key_Comma)\n            {\n                // Translate a comma into a period\n                QKeyEvent periodKeyEvent(event->type(), Qt::Key_Period, keyEvent->modifiers(), \".\", keyEvent->isAutoRepeat(), keyEvent->count());\n                return QAbstractSpinBox::event(&periodKeyEvent);\n            }\n        }\n        return QAbstractSpinBox::event(event);\n    }\n\n    StepEnabled stepEnabled() const\n    {\n        if (isReadOnly()) // Disable steps when AmountSpinBox is read-only\n            return StepNone;\n        if (text().isEmpty()) // Allow step-up with empty field\n            return StepUpEnabled;\n\n        StepEnabled rv = 0;\n        bool valid = false;\n        CAmount val = value(&valid);\n        if(valid)\n        {\n            if(val > 0)\n                rv |= StepDownEnabled;\n            if(val < BitcoinUnits::maxMoney())\n                rv |= StepUpEnabled;\n        }\n        return rv;\n    }\n\nQ_SIGNALS:\n    void valueChanged();\n};\n\n#include <qt/bitcoinamountfield.moc>\n\nBitcoinAmountField::BitcoinAmountField(QWidget *parent) :\n    QWidget(parent),\n    amount(0)\n{\n    amount = new AmountSpinBox(this);\n    amount->setLocale(QLocale::c());\n    amount->installEventFilter(this);\n    amount->setMaximumWidth(170);\n\n    QHBoxLayout *layout = new QHBoxLayout(this);\n    layout->addWidget(amount);\n    unit = new QValueComboBox(this);\n    unit->setModel(new BitcoinUnits(this));\n    layout->addWidget(unit);\n    layout->addStretch(1);\n    layout->setContentsMargins(0,0,0,0);\n\n    setLayout(layout);\n\n    setFocusPolicy(Qt::TabFocus);\n    setFocusProxy(amount);\n\n    // If one if the widgets changes, the combined content changes as well\n    connect(amount, SIGNAL(valueChanged()), this, SIGNAL(valueChanged()));\n    connect(unit, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged(int)));\n\n    // Set default based on configuration\n    unitChanged(unit->currentIndex());\n}\n\nvoid BitcoinAmountField::clear()\n{\n    amount->clear();\n    unit->setCurrentIndex(0);\n}\n\nvoid BitcoinAmountField::setEnabled(bool fEnabled)\n{\n    amount->setEnabled(fEnabled);\n    unit->setEnabled(fEnabled);\n}\n\nbool BitcoinAmountField::validate()\n{\n    bool valid = false;\n    value(&valid);\n    setValid(valid);\n    return valid;\n}\n\nvoid BitcoinAmountField::setValid(bool valid)\n{\n    if (valid)\n        amount->setStyleSheet(\"\");\n    else\n        amount->setStyleSheet(STYLE_INVALID);\n}\n\nbool BitcoinAmountField::eventFilter(QObject *object, QEvent *event)\n{\n    if (event->type() == QEvent::FocusIn)\n    {\n        // Clear invalid flag on focus\n        setValid(true);\n    }\n    return QWidget::eventFilter(object, event);\n}\n\nQWidget *BitcoinAmountField::setupTabChain(QWidget *prev)\n{\n    QWidget::setTabOrder(prev, amount);\n    QWidget::setTabOrder(amount, unit);\n    return unit;\n}\n\nCAmount BitcoinAmountField::value(bool *valid_out) const\n{\n    return amount->value(valid_out);\n}\n\nvoid BitcoinAmountField::setValue(const CAmount& value)\n{\n    amount->setValue(value);\n}\n\nvoid BitcoinAmountField::setReadOnly(bool fReadOnly)\n{\n    amount->setReadOnly(fReadOnly);\n}\n\nvoid BitcoinAmountField::unitChanged(int idx)\n{\n    // Use description tooltip for current unit for the combobox\n    unit->setToolTip(unit->itemData(idx, Qt::ToolTipRole).toString());\n\n    // Determine new unit ID\n    int newUnit = unit->itemData(idx, BitcoinUnits::UnitRole).toInt();\n\n    amount->setDisplayUnit(newUnit);\n}\n\nvoid BitcoinAmountField::setDisplayUnit(int newUnit)\n{\n    unit->setValue(newUnit);\n}\n\nvoid BitcoinAmountField::setSingleStep(const CAmount& step)\n{\n    amount->setSingleStep(step);\n}\n"
  },
  {
    "path": "src/qt/bitcoinamountfield.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_BITCOINAMOUNTFIELD_H\n#define BITCOIN_QT_BITCOINAMOUNTFIELD_H\n\n#include <amount.h>\n\n#include <QWidget>\n\nclass AmountSpinBox;\n\nQT_BEGIN_NAMESPACE\nclass QValueComboBox;\nQT_END_NAMESPACE\n\n/** Widget for entering bitcoin amounts.\n  */\nclass BitcoinAmountField: public QWidget\n{\n    Q_OBJECT\n\n    // ugly hack: for some unknown reason CAmount (instead of qint64) does not work here as expected\n    // discussion: https://github.com/bitcoin/bitcoin/pull/5117\n    Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY valueChanged USER true)\n\npublic:\n    explicit BitcoinAmountField(QWidget *parent = 0);\n\n    CAmount value(bool *value=0) const;\n    void setValue(const CAmount& value);\n\n    /** Set single step in satoshis **/\n    void setSingleStep(const CAmount& step);\n\n    /** Make read-only **/\n    void setReadOnly(bool fReadOnly);\n\n    /** Mark current value as invalid in UI. */\n    void setValid(bool valid);\n    /** Perform input validation, mark field as invalid if entered value is not valid. */\n    bool validate();\n\n    /** Change unit used to display amount. */\n    void setDisplayUnit(int unit);\n\n    /** Make field empty and ready for new input. */\n    void clear();\n\n    /** Enable/Disable. */\n    void setEnabled(bool fEnabled);\n\n    /** Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907),\n        in these cases we have to set it up manually.\n    */\n    QWidget *setupTabChain(QWidget *prev);\n\nQ_SIGNALS:\n    void valueChanged();\n\nprotected:\n    /** Intercept focus-in event and ',' key presses */\n    bool eventFilter(QObject *object, QEvent *event);\n\nprivate:\n    AmountSpinBox *amount;\n    QValueComboBox *unit;\n\nprivate Q_SLOTS:\n    void unitChanged(int idx);\n\n};\n\n#endif // BITCOIN_QT_BITCOINAMOUNTFIELD_H\n"
  },
  {
    "path": "src/qt/bitcoingui.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/bitcoingui.h>\n\n#include <qt/bitcoinunits.h>\n#include <qt/clientmodel.h>\n#include <qt/guiconstants.h>\n#include <qt/guiutil.h>\n#include <qt/modaloverlay.h>\n#include <qt/networkstyle.h>\n#include <qt/notificator.h>\n#include <qt/openuridialog.h>\n#include <qt/optionsdialog.h>\n#include <qt/optionsmodel.h>\n#include <qt/platformstyle.h>\n#include <qt/rpcconsole.h>\n#include <qt/utilitydialog.h>\n\n#ifdef ENABLE_WALLET\n#include <qt/walletframe.h>\n#include <qt/walletmodel.h>\n#endif // ENABLE_WALLET\n\n#ifdef Q_OS_MAC\n#include <qt/macdockiconhandler.h>\n#endif\n\n#include <chainparams.h>\n#include <init.h>\n#include <ui_interface.h>\n#include <util.h>\n\n#include <iostream>\n\n#include <QAction>\n#include <QApplication>\n#include <QDateTime>\n#include <QDesktopWidget>\n#include <QDragEnterEvent>\n#include <QListWidget>\n#include <QMenuBar>\n#include <QMessageBox>\n#include <QMimeData>\n#include <QProgressDialog>\n#include <QSettings>\n#include <QShortcut>\n#include <QStackedWidget>\n#include <QStatusBar>\n#include <QStyle>\n#include <QTimer>\n#include <QToolBar>\n#include <QVBoxLayout>\n\n#if QT_VERSION < 0x050000\n#include <QTextDocument>\n#include <QUrl>\n#else\n#include <QUrlQuery>\n#endif\n\nconst std::string BitcoinGUI::DEFAULT_UIPLATFORM =\n#if defined(Q_OS_MAC)\n        \"macosx\"\n#elif defined(Q_OS_WIN)\n        \"windows\"\n#else\n        \"other\"\n#endif\n        ;\n\n/** Display name for default wallet name. Uses tilde to avoid name\n * collisions in the future with additional wallets */\nconst QString BitcoinGUI::DEFAULT_WALLET = \"~Default\";\n\nBitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *networkStyle, QWidget *parent) :\n    QMainWindow(parent),\n    enableWallet(false),\n    clientModel(0),\n    walletFrame(0),\n    unitDisplayControl(0),\n    labelWalletEncryptionIcon(0),\n    labelWalletHDStatusIcon(0),\n    connectionsControl(0),\n    labelBlocksIcon(0),\n    progressBarLabel(0),\n    progressBar(0),\n    progressDialog(0),\n    appMenuBar(0),\n    overviewAction(0),\n    historyAction(0),\n    quitAction(0),\n    sendCoinsAction(0),\n    sendCoinsMenuAction(0),\n    usedSendingAddressesAction(0),\n    usedReceivingAddressesAction(0),\n    signMessageAction(0),\n    verifyMessageAction(0),\n    aboutAction(0),\n    receiveCoinsAction(0),\n    receiveCoinsMenuAction(0),\n    optionsAction(0),\n    toggleHideAction(0),\n    encryptWalletAction(0),\n    backupWalletAction(0),\n    changePassphraseAction(0),\n    aboutQtAction(0),\n    openRPCConsoleAction(0),\n    openAction(0),\n    showHelpMessageAction(0),\n    trayIcon(0),\n    trayIconMenu(0),\n    notificator(0),\n    rpcConsole(0),\n    helpMessageDialog(0),\n    modalOverlay(0),\n    prevBlocks(0),\n    spinnerFrame(0),\n    platformStyle(_platformStyle)\n{\n    QSettings settings;\n    if (!restoreGeometry(settings.value(\"MainWindowGeometry\").toByteArray())) {\n        // Restore failed (perhaps missing setting), center the window\n        move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center());\n    }\n\n    QString windowTitle = tr(PACKAGE_NAME) + \" - \";\n#ifdef ENABLE_WALLET\n    enableWallet = WalletModel::isWalletEnabled();\n#endif // ENABLE_WALLET\n    if(enableWallet)\n    {\n        windowTitle += tr(\"Wallet\");\n    } else {\n        windowTitle += tr(\"Node\");\n    }\n    windowTitle += \" \" + networkStyle->getTitleAddText();\n#ifndef Q_OS_MAC\n    QApplication::setWindowIcon(networkStyle->getTrayAndWindowIcon());\n    setWindowIcon(networkStyle->getTrayAndWindowIcon());\n#else\n    MacDockIconHandler::instance()->setIcon(networkStyle->getAppIcon());\n#endif\n    setWindowTitle(windowTitle);\n\n#if defined(Q_OS_MAC) && QT_VERSION < 0x050000\n    // This property is not implemented in Qt 5. Setting it has no effect.\n    // A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras.\n    setUnifiedTitleAndToolBarOnMac(true);\n#endif\n\n    rpcConsole = new RPCConsole(_platformStyle, 0);\n    helpMessageDialog = new HelpMessageDialog(this, false);\n#ifdef ENABLE_WALLET\n    if(enableWallet)\n    {\n        /** Create wallet frame and make it the central widget */\n        walletFrame = new WalletFrame(_platformStyle, this);\n        setCentralWidget(walletFrame);\n    } else\n#endif // ENABLE_WALLET\n    {\n        /* When compiled without wallet or -disablewallet is provided,\n         * the central widget is the rpc console.\n         */\n        setCentralWidget(rpcConsole);\n    }\n\n    // Accept D&D of URIs\n    setAcceptDrops(true);\n\n    // Create actions for the toolbar, menu bar and tray/dock icon\n    // Needs walletFrame to be initialized\n    createActions();\n\n    // Create application menu bar\n    createMenuBar();\n\n    // Create the toolbars\n    createToolBars();\n\n    // Create system tray icon and notification\n    createTrayIcon(networkStyle);\n\n    // Create status bar\n    statusBar();\n\n    // Disable size grip because it looks ugly and nobody needs it\n    statusBar()->setSizeGripEnabled(false);\n\n    // Status bar notification icons\n    QFrame *frameBlocks = new QFrame();\n    frameBlocks->setContentsMargins(0,0,0,0);\n    frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);\n    QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks);\n    frameBlocksLayout->setContentsMargins(3,0,3,0);\n    frameBlocksLayout->setSpacing(3);\n    unitDisplayControl = new UnitDisplayStatusBarControl(platformStyle);\n    labelWalletEncryptionIcon = new QLabel();\n    labelWalletHDStatusIcon = new QLabel();\n    connectionsControl = new GUIUtil::ClickableLabel();\n    labelBlocksIcon = new GUIUtil::ClickableLabel();\n    if(enableWallet)\n    {\n        frameBlocksLayout->addStretch();\n        frameBlocksLayout->addWidget(unitDisplayControl);\n        frameBlocksLayout->addStretch();\n        frameBlocksLayout->addWidget(labelWalletEncryptionIcon);\n        frameBlocksLayout->addWidget(labelWalletHDStatusIcon);\n    }\n    frameBlocksLayout->addStretch();\n    frameBlocksLayout->addWidget(connectionsControl);\n    frameBlocksLayout->addStretch();\n    frameBlocksLayout->addWidget(labelBlocksIcon);\n    frameBlocksLayout->addStretch();\n\n    // Progress bar and label for blocks download\n    progressBarLabel = new QLabel();\n    progressBarLabel->setVisible(false);\n    progressBar = new GUIUtil::ProgressBar();\n    progressBar->setAlignment(Qt::AlignCenter);\n    progressBar->setVisible(false);\n\n    // Override style sheet for progress bar for styles that have a segmented progress bar,\n    // as they make the text unreadable (workaround for issue #1071)\n    // See https://qt-project.org/doc/qt-4.8/gallery.html\n    QString curStyle = QApplication::style()->metaObject()->className();\n    if(curStyle == \"QWindowsStyle\" || curStyle == \"QWindowsXPStyle\")\n    {\n        progressBar->setStyleSheet(\"QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }\");\n    }\n\n    statusBar()->addWidget(progressBarLabel);\n    statusBar()->addWidget(progressBar);\n    statusBar()->addPermanentWidget(frameBlocks);\n\n    // Install event filter to be able to catch status tip events (QEvent::StatusTip)\n    this->installEventFilter(this);\n\n    // Initially wallet actions should be disabled\n    setWalletActionsEnabled(false);\n\n    // Subscribe to notifications from core\n    subscribeToCoreSignals();\n\n    connect(connectionsControl, SIGNAL(clicked(QPoint)), this, SLOT(toggleNetworkActive()));\n\n    modalOverlay = new ModalOverlay(this->centralWidget());\n#ifdef ENABLE_WALLET\n    if(enableWallet) {\n        connect(walletFrame, SIGNAL(requestedSyncWarningInfo()), this, SLOT(showModalOverlay()));\n        connect(labelBlocksIcon, SIGNAL(clicked(QPoint)), this, SLOT(showModalOverlay()));\n        connect(progressBar, SIGNAL(clicked(QPoint)), this, SLOT(showModalOverlay()));\n    }\n#endif\n}\n\nBitcoinGUI::~BitcoinGUI()\n{\n    // Unsubscribe from notifications from core\n    unsubscribeFromCoreSignals();\n\n    QSettings settings;\n    settings.setValue(\"MainWindowGeometry\", saveGeometry());\n    if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu)\n        trayIcon->hide();\n#ifdef Q_OS_MAC\n    delete appMenuBar;\n    MacDockIconHandler::cleanup();\n#endif\n\n    delete rpcConsole;\n}\n\nvoid BitcoinGUI::createActions()\n{\n    QActionGroup *tabGroup = new QActionGroup(this);\n\n    overviewAction = new QAction(platformStyle->SingleColorIcon(\":/icons/overview\"), tr(\"&Overview\"), this);\n    overviewAction->setStatusTip(tr(\"Show general overview of wallet\"));\n    overviewAction->setToolTip(overviewAction->statusTip());\n    overviewAction->setCheckable(true);\n    overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1));\n    tabGroup->addAction(overviewAction);\n\n    sendCoinsAction = new QAction(platformStyle->SingleColorIcon(\":/icons/send\"), tr(\"&Send\"), this);\n    sendCoinsAction->setStatusTip(tr(\"Send coins to a Sugarchain address\"));\n    sendCoinsAction->setToolTip(sendCoinsAction->statusTip());\n    sendCoinsAction->setCheckable(true);\n    sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));\n    tabGroup->addAction(sendCoinsAction);\n\n    sendCoinsMenuAction = new QAction(platformStyle->TextColorIcon(\":/icons/send\"), sendCoinsAction->text(), this);\n    sendCoinsMenuAction->setStatusTip(sendCoinsAction->statusTip());\n    sendCoinsMenuAction->setToolTip(sendCoinsMenuAction->statusTip());\n\n    receiveCoinsAction = new QAction(platformStyle->SingleColorIcon(\":/icons/receiving_addresses\"), tr(\"&Receive\"), this);\n    receiveCoinsAction->setStatusTip(tr(\"Request payments (generates QR codes and sugarchain: URIs)\"));\n    receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip());\n    receiveCoinsAction->setCheckable(true);\n    receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3));\n    tabGroup->addAction(receiveCoinsAction);\n\n    receiveCoinsMenuAction = new QAction(platformStyle->TextColorIcon(\":/icons/receiving_addresses\"), receiveCoinsAction->text(), this);\n    receiveCoinsMenuAction->setStatusTip(receiveCoinsAction->statusTip());\n    receiveCoinsMenuAction->setToolTip(receiveCoinsMenuAction->statusTip());\n\n    historyAction = new QAction(platformStyle->SingleColorIcon(\":/icons/history\"), tr(\"&Transactions\"), this);\n    historyAction->setStatusTip(tr(\"Browse transaction history\"));\n    historyAction->setToolTip(historyAction->statusTip());\n    historyAction->setCheckable(true);\n    historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4));\n    tabGroup->addAction(historyAction);\n\n#ifdef ENABLE_WALLET\n    // These showNormalIfMinimized are needed because Send Coins and Receive Coins\n    // can be triggered from the tray menu, and need to show the GUI to be useful.\n    connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));\n    connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));\n    connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));\n    connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));\n    connect(sendCoinsMenuAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));\n    connect(sendCoinsMenuAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));\n    connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));\n    connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));\n    connect(receiveCoinsMenuAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));\n    connect(receiveCoinsMenuAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));\n    connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));\n    connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));\n#endif // ENABLE_WALLET\n\n    quitAction = new QAction(platformStyle->TextColorIcon(\":/icons/quit\"), tr(\"E&xit\"), this);\n    quitAction->setStatusTip(tr(\"Quit application\"));\n    quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q));\n    quitAction->setMenuRole(QAction::QuitRole);\n    aboutAction = new QAction(platformStyle->TextColorIcon(\":/icons/about\"), tr(\"&About %1\").arg(tr(PACKAGE_NAME)), this);\n    aboutAction->setStatusTip(tr(\"Show information about %1\").arg(tr(PACKAGE_NAME)));\n    aboutAction->setMenuRole(QAction::AboutRole);\n    aboutAction->setEnabled(false);\n    aboutQtAction = new QAction(platformStyle->TextColorIcon(\":/icons/about_qt\"), tr(\"About &Qt\"), this);\n    aboutQtAction->setStatusTip(tr(\"Show information about Qt\"));\n    aboutQtAction->setMenuRole(QAction::AboutQtRole);\n    optionsAction = new QAction(platformStyle->TextColorIcon(\":/icons/options\"), tr(\"&Options...\"), this);\n    optionsAction->setStatusTip(tr(\"Modify configuration options for %1\").arg(tr(PACKAGE_NAME)));\n    optionsAction->setMenuRole(QAction::PreferencesRole);\n    optionsAction->setEnabled(false);\n    toggleHideAction = new QAction(platformStyle->TextColorIcon(\":/icons/about\"), tr(\"&Show / Hide\"), this);\n    toggleHideAction->setStatusTip(tr(\"Show or hide the main Window\"));\n\n    encryptWalletAction = new QAction(platformStyle->TextColorIcon(\":/icons/lock_closed\"), tr(\"&Encrypt Wallet...\"), this);\n    encryptWalletAction->setStatusTip(tr(\"Encrypt the private keys that belong to your wallet\"));\n    encryptWalletAction->setCheckable(true);\n    backupWalletAction = new QAction(platformStyle->TextColorIcon(\":/icons/filesave\"), tr(\"&Backup Wallet...\"), this);\n    backupWalletAction->setStatusTip(tr(\"Backup wallet to another location\"));\n    changePassphraseAction = new QAction(platformStyle->TextColorIcon(\":/icons/key\"), tr(\"&Change Passphrase...\"), this);\n    changePassphraseAction->setStatusTip(tr(\"Change the passphrase used for wallet encryption\"));\n    signMessageAction = new QAction(platformStyle->TextColorIcon(\":/icons/edit\"), tr(\"Sign &message...\"), this);\n    signMessageAction->setStatusTip(tr(\"Sign messages with your Sugarchain addresses to prove you own them\"));\n    verifyMessageAction = new QAction(platformStyle->TextColorIcon(\":/icons/verify\"), tr(\"&Verify message...\"), this);\n    verifyMessageAction->setStatusTip(tr(\"Verify messages to ensure they were signed with specified Sugarchain addresses\"));\n\n    openRPCConsoleAction = new QAction(platformStyle->TextColorIcon(\":/icons/debugwindow\"), tr(\"&Debug window\"), this);\n    openRPCConsoleAction->setStatusTip(tr(\"Open debugging and diagnostic console\"));\n    // initially disable the debug window menu item\n    openRPCConsoleAction->setEnabled(false);\n\n    usedSendingAddressesAction = new QAction(platformStyle->TextColorIcon(\":/icons/address-book\"), tr(\"&Sending addresses...\"), this);\n    usedSendingAddressesAction->setStatusTip(tr(\"Show the list of used sending addresses and labels\"));\n    usedReceivingAddressesAction = new QAction(platformStyle->TextColorIcon(\":/icons/address-book\"), tr(\"&Receiving addresses...\"), this);\n    usedReceivingAddressesAction->setStatusTip(tr(\"Show the list of used receiving addresses and labels\"));\n\n    openAction = new QAction(platformStyle->TextColorIcon(\":/icons/open\"), tr(\"Open &URI...\"), this);\n    openAction->setStatusTip(tr(\"Open a sugarchain: URI or payment request\"));\n\n    showHelpMessageAction = new QAction(platformStyle->TextColorIcon(\":/icons/info\"), tr(\"&Command-line options\"), this);\n    showHelpMessageAction->setMenuRole(QAction::NoRole);\n    showHelpMessageAction->setStatusTip(tr(\"Show the %1 help message to get a list with possible Sugarchain command-line options\").arg(tr(PACKAGE_NAME)));\n\n    connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));\n    connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));\n    connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));\n    connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));\n    connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden()));\n    connect(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked()));\n    connect(openRPCConsoleAction, SIGNAL(triggered()), this, SLOT(showDebugWindow()));\n    // prevents an open debug window from becoming stuck/unusable on client shutdown\n    connect(quitAction, SIGNAL(triggered()), rpcConsole, SLOT(hide()));\n\n#ifdef ENABLE_WALLET\n    if(walletFrame)\n    {\n        connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool)));\n        connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet()));\n        connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase()));\n        connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab()));\n        connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab()));\n        connect(usedSendingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedSendingAddresses()));\n        connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses()));\n        connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked()));\n    }\n#endif // ENABLE_WALLET\n\n    new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C), this, SLOT(showDebugWindowActivateConsole()));\n    new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D), this, SLOT(showDebugWindow()));\n}\n\nvoid BitcoinGUI::createMenuBar()\n{\n#ifdef Q_OS_MAC\n    // Create a decoupled menu bar on Mac which stays even if the window is closed\n    appMenuBar = new QMenuBar();\n#else\n    // Get the main window's menu bar on other platforms\n    appMenuBar = menuBar();\n#endif\n\n    // Configure the menus\n    QMenu *file = appMenuBar->addMenu(tr(\"&File\"));\n    if(walletFrame)\n    {\n        file->addAction(openAction);\n        file->addAction(backupWalletAction);\n        file->addAction(signMessageAction);\n        file->addAction(verifyMessageAction);\n        file->addSeparator();\n        file->addAction(usedSendingAddressesAction);\n        file->addAction(usedReceivingAddressesAction);\n        file->addSeparator();\n    }\n    file->addAction(quitAction);\n\n    QMenu *settings = appMenuBar->addMenu(tr(\"&Settings\"));\n    if(walletFrame)\n    {\n        settings->addAction(encryptWalletAction);\n        settings->addAction(changePassphraseAction);\n        settings->addSeparator();\n    }\n    settings->addAction(optionsAction);\n\n    QMenu *help = appMenuBar->addMenu(tr(\"&Help\"));\n    if(walletFrame)\n    {\n        help->addAction(openRPCConsoleAction);\n    }\n    help->addAction(showHelpMessageAction);\n    help->addSeparator();\n    help->addAction(aboutAction);\n    help->addAction(aboutQtAction);\n}\n\nvoid BitcoinGUI::createToolBars()\n{\n    if(walletFrame)\n    {\n        QToolBar *toolbar = addToolBar(tr(\"Tabs toolbar\"));\n        toolbar->setContextMenuPolicy(Qt::PreventContextMenu);\n        toolbar->setMovable(false);\n        toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);\n        toolbar->addAction(overviewAction);\n        toolbar->addAction(sendCoinsAction);\n        toolbar->addAction(receiveCoinsAction);\n        toolbar->addAction(historyAction);\n        overviewAction->setChecked(true);\n    }\n}\n\nvoid BitcoinGUI::setClientModel(ClientModel *_clientModel)\n{\n    this->clientModel = _clientModel;\n    if(_clientModel)\n    {\n        // Create system tray menu (or setup the dock menu) that late to prevent users from calling actions,\n        // while the client has not yet fully loaded\n        createTrayIconMenu();\n\n        // Keep up to date with client\n        updateNetworkState();\n        connect(_clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));\n        connect(_clientModel, SIGNAL(networkActiveChanged(bool)), this, SLOT(setNetworkActive(bool)));\n\n        modalOverlay->setKnownBestHeight(_clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(_clientModel->getHeaderTipTime()));\n        setNumBlocks(_clientModel->getNumBlocks(), _clientModel->getLastBlockDate(), _clientModel->getVerificationProgress(nullptr), false);\n        connect(_clientModel, SIGNAL(numBlocksChanged(int,QDateTime,double,bool)), this, SLOT(setNumBlocks(int,QDateTime,double,bool)));\n\n        // Receive and report messages from client model\n        connect(_clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int)));\n\n        // Show progress dialog\n        connect(_clientModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));\n\n        rpcConsole->setClientModel(_clientModel);\n#ifdef ENABLE_WALLET\n        if(walletFrame)\n        {\n            walletFrame->setClientModel(_clientModel);\n        }\n#endif // ENABLE_WALLET\n        unitDisplayControl->setOptionsModel(_clientModel->getOptionsModel());\n        \n        OptionsModel* optionsModel = _clientModel->getOptionsModel();\n        if(optionsModel)\n        {\n            // be aware of the tray icon disable state change reported by the OptionsModel object.\n            connect(optionsModel,SIGNAL(hideTrayIconChanged(bool)),this,SLOT(setTrayIconVisible(bool)));\n        \n            // initialize the disable state of the tray icon with the current value in the model.\n            setTrayIconVisible(optionsModel->getHideTrayIcon());\n        }\n    } else {\n        // Disable possibility to show main window via action\n        toggleHideAction->setEnabled(false);\n        if(trayIconMenu)\n        {\n            // Disable context menu on tray icon\n            trayIconMenu->clear();\n        }\n        // Propagate cleared model to child objects\n        rpcConsole->setClientModel(nullptr);\n#ifdef ENABLE_WALLET\n        if (walletFrame)\n        {\n            walletFrame->setClientModel(nullptr);\n        }\n#endif // ENABLE_WALLET\n        unitDisplayControl->setOptionsModel(nullptr);\n    }\n}\n\n#ifdef ENABLE_WALLET\nbool BitcoinGUI::addWallet(const QString& name, WalletModel *walletModel)\n{\n    if(!walletFrame)\n        return false;\n    setWalletActionsEnabled(true);\n    return walletFrame->addWallet(name, walletModel);\n}\n\nbool BitcoinGUI::setCurrentWallet(const QString& name)\n{\n    if(!walletFrame)\n        return false;\n    return walletFrame->setCurrentWallet(name);\n}\n\nvoid BitcoinGUI::removeAllWallets()\n{\n    if(!walletFrame)\n        return;\n    setWalletActionsEnabled(false);\n    walletFrame->removeAllWallets();\n}\n#endif // ENABLE_WALLET\n\nvoid BitcoinGUI::setWalletActionsEnabled(bool enabled)\n{\n    overviewAction->setEnabled(enabled);\n    sendCoinsAction->setEnabled(enabled);\n    sendCoinsMenuAction->setEnabled(enabled);\n    receiveCoinsAction->setEnabled(enabled);\n    receiveCoinsMenuAction->setEnabled(enabled);\n    historyAction->setEnabled(enabled);\n    encryptWalletAction->setEnabled(enabled);\n    backupWalletAction->setEnabled(enabled);\n    changePassphraseAction->setEnabled(enabled);\n    signMessageAction->setEnabled(enabled);\n    verifyMessageAction->setEnabled(enabled);\n    usedSendingAddressesAction->setEnabled(enabled);\n    usedReceivingAddressesAction->setEnabled(enabled);\n    openAction->setEnabled(enabled);\n}\n\nvoid BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle)\n{\n#ifndef Q_OS_MAC\n    trayIcon = new QSystemTrayIcon(this);\n    QString toolTip = tr(\"%1 client\").arg(tr(PACKAGE_NAME)) + \" \" + networkStyle->getTitleAddText();\n    trayIcon->setToolTip(toolTip);\n    trayIcon->setIcon(networkStyle->getTrayAndWindowIcon());\n    trayIcon->hide();\n#endif\n\n    notificator = new Notificator(QApplication::applicationName(), trayIcon, this);\n}\n\nvoid BitcoinGUI::createTrayIconMenu()\n{\n#ifndef Q_OS_MAC\n    // return if trayIcon is unset (only on non-Mac OSes)\n    if (!trayIcon)\n        return;\n\n    trayIconMenu = new QMenu(this);\n    trayIcon->setContextMenu(trayIconMenu);\n\n    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),\n            this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason)));\n#else\n    // Note: On Mac, the dock icon is used to provide the tray's functionality.\n    MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance();\n    dockIconHandler->setMainWindow((QMainWindow *)this);\n    trayIconMenu = dockIconHandler->dockMenu();\n#endif\n\n    // Configuration of the tray icon (or dock icon) icon menu\n    trayIconMenu->addAction(toggleHideAction);\n    trayIconMenu->addSeparator();\n    trayIconMenu->addAction(sendCoinsMenuAction);\n    trayIconMenu->addAction(receiveCoinsMenuAction);\n    trayIconMenu->addSeparator();\n    trayIconMenu->addAction(signMessageAction);\n    trayIconMenu->addAction(verifyMessageAction);\n    trayIconMenu->addSeparator();\n    trayIconMenu->addAction(optionsAction);\n    trayIconMenu->addAction(openRPCConsoleAction);\n#ifndef Q_OS_MAC // This is built-in on Mac\n    trayIconMenu->addSeparator();\n    trayIconMenu->addAction(quitAction);\n#endif\n}\n\n#ifndef Q_OS_MAC\nvoid BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)\n{\n    if(reason == QSystemTrayIcon::Trigger)\n    {\n        // Click on system tray icon triggers show/hide of the main window\n        toggleHidden();\n    }\n}\n#endif\n\nvoid BitcoinGUI::optionsClicked()\n{\n    if(!clientModel || !clientModel->getOptionsModel())\n        return;\n\n    OptionsDialog dlg(this, enableWallet);\n    dlg.setModel(clientModel->getOptionsModel());\n    dlg.exec();\n}\n\nvoid BitcoinGUI::aboutClicked()\n{\n    if(!clientModel)\n        return;\n\n    HelpMessageDialog dlg(this, true);\n    dlg.exec();\n}\n\nvoid BitcoinGUI::showDebugWindow()\n{\n    rpcConsole->showNormal();\n    rpcConsole->show();\n    rpcConsole->raise();\n    rpcConsole->activateWindow();\n}\n\nvoid BitcoinGUI::showDebugWindowActivateConsole()\n{\n    rpcConsole->setTabFocus(RPCConsole::TAB_CONSOLE);\n    showDebugWindow();\n}\n\nvoid BitcoinGUI::showHelpMessageClicked()\n{\n    helpMessageDialog->show();\n}\n\n#ifdef ENABLE_WALLET\nvoid BitcoinGUI::openClicked()\n{\n    OpenURIDialog dlg(this);\n    if(dlg.exec())\n    {\n        Q_EMIT receivedURI(dlg.getURI());\n    }\n}\n\nvoid BitcoinGUI::gotoOverviewPage()\n{\n    overviewAction->setChecked(true);\n    if (walletFrame) walletFrame->gotoOverviewPage();\n}\n\nvoid BitcoinGUI::gotoHistoryPage()\n{\n    historyAction->setChecked(true);\n    if (walletFrame) walletFrame->gotoHistoryPage();\n}\n\nvoid BitcoinGUI::gotoReceiveCoinsPage()\n{\n    receiveCoinsAction->setChecked(true);\n    if (walletFrame) walletFrame->gotoReceiveCoinsPage();\n}\n\nvoid BitcoinGUI::gotoSendCoinsPage(QString addr)\n{\n    sendCoinsAction->setChecked(true);\n    if (walletFrame) walletFrame->gotoSendCoinsPage(addr);\n}\n\nvoid BitcoinGUI::gotoSignMessageTab(QString addr)\n{\n    if (walletFrame) walletFrame->gotoSignMessageTab(addr);\n}\n\nvoid BitcoinGUI::gotoVerifyMessageTab(QString addr)\n{\n    if (walletFrame) walletFrame->gotoVerifyMessageTab(addr);\n}\n#endif // ENABLE_WALLET\n\nvoid BitcoinGUI::updateNetworkState()\n{\n    int count = clientModel->getNumConnections();\n    QString icon;\n    switch(count)\n    {\n    case 0: icon = \":/icons/connect_0\"; break;\n    case 1: case 2: case 3: icon = \":/icons/connect_1\"; break;\n    case 4: case 5: case 6: icon = \":/icons/connect_2\"; break;\n    case 7: case 8: case 9: icon = \":/icons/connect_3\"; break;\n    default: icon = \":/icons/connect_4\"; break;\n    }\n\n    QString tooltip;\n\n    if (clientModel->getNetworkActive()) {\n        tooltip = tr(\"%n active connection(s) to Sugarchain network\", \"\", count) + QString(\".<br>\") + tr(\"Click to disable network activity.\");\n    } else {\n        tooltip = tr(\"Network activity disabled.\") + QString(\"<br>\") + tr(\"Click to enable network activity again.\");\n        icon = \":/icons/network_disabled\";\n    }\n\n    // Don't word-wrap this (fixed-width) tooltip\n    tooltip = QString(\"<nobr>\") + tooltip + QString(\"</nobr>\");\n    connectionsControl->setToolTip(tooltip);\n\n    connectionsControl->setPixmap(platformStyle->SingleColorIcon(icon).pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));\n}\n\nvoid BitcoinGUI::setNumConnections(int count)\n{\n    updateNetworkState();\n}\n\nvoid BitcoinGUI::setNetworkActive(bool networkActive)\n{\n    updateNetworkState();\n}\n\nvoid BitcoinGUI::updateHeadersSyncProgressLabel()\n{\n    int64_t headersTipTime = clientModel->getHeaderTipTime();\n    int headersTipHeight = clientModel->getHeaderTipHeight();\n    int estHeadersLeft = (GetTime() - headersTipTime) / Params().GetConsensus().nPowTargetSpacing;\n    if (estHeadersLeft > HEADER_HEIGHT_DELTA_SYNC)\n        progressBarLabel->setText(tr(\"Syncing Headers (%1%)...\").arg(QString::number(100.0 / (headersTipHeight+estHeadersLeft)*headersTipHeight, 'f', 1)));\n}\n\nvoid BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header)\n{\n    if (modalOverlay)\n    {\n        if (header)\n            modalOverlay->setKnownBestHeight(count, blockDate);\n        else\n            modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);\n    }\n    if (!clientModel)\n        return;\n\n    // Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbled text)\n    statusBar()->clearMessage();\n\n    // Acquire current block source\n    enum BlockSource blockSource = clientModel->getBlockSource();\n    switch (blockSource) {\n        case BLOCK_SOURCE_NETWORK:\n            if (header) {\n                updateHeadersSyncProgressLabel();\n                return;\n            }\n            progressBarLabel->setText(tr(\"Synchronizing with network...\"));\n            updateHeadersSyncProgressLabel();\n            break;\n        case BLOCK_SOURCE_DISK:\n            if (header) {\n                progressBarLabel->setText(tr(\"Indexing blocks on disk...\"));\n            } else {\n                progressBarLabel->setText(tr(\"Processing blocks on disk...\"));\n            }\n            break;\n        case BLOCK_SOURCE_REINDEX:\n            progressBarLabel->setText(tr(\"Reindexing blocks on disk...\"));\n            break;\n        case BLOCK_SOURCE_NONE:\n            if (header) {\n                return;\n            }\n            progressBarLabel->setText(tr(\"Connecting to peers...\"));\n            break;\n    }\n\n    QString tooltip;\n\n    QDateTime currentDate = QDateTime::currentDateTime();\n    qint64 secs = blockDate.secsTo(currentDate);\n\n    tooltip = tr(\"Processed %n block(s) of transaction history.\", \"\", count);\n\n    // Set icon state: spinning if catching up, tick otherwise\n    if(secs < 90*60)\n    {\n        tooltip = tr(\"Up to date\") + QString(\".<br>\") + tooltip;\n        labelBlocksIcon->setPixmap(platformStyle->SingleColorIcon(\":/icons/synced\").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));\n\n#ifdef ENABLE_WALLET\n        if(walletFrame)\n        {\n            walletFrame->showOutOfSyncWarning(false);\n            modalOverlay->showHide(true, true);\n        }\n#endif // ENABLE_WALLET\n\n        progressBarLabel->setVisible(false);\n        progressBar->setVisible(false);\n    }\n    else\n    {\n        QString timeBehindText = GUIUtil::formatNiceTimeOffset(secs);\n\n        progressBarLabel->setVisible(true);\n        progressBar->setFormat(tr(\"%1 behind\").arg(timeBehindText));\n        progressBar->setMaximum(1000000000);\n        progressBar->setValue(nVerificationProgress * 1000000000.0 + 0.5);\n        progressBar->setVisible(true);\n\n        tooltip = tr(\"Catching up...\") + QString(\"<br>\") + tooltip;\n        if(count != prevBlocks)\n        {\n            labelBlocksIcon->setPixmap(platformStyle->SingleColorIcon(QString(\n                \":/movies/spinner-%1\").arg(spinnerFrame, 3, 10, QChar('0')))\n                .pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));\n            spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES;\n        }\n        prevBlocks = count;\n\n#ifdef ENABLE_WALLET\n        if(walletFrame)\n        {\n            walletFrame->showOutOfSyncWarning(true);\n            modalOverlay->showHide();\n        }\n#endif // ENABLE_WALLET\n\n        tooltip += QString(\"<br>\");\n        tooltip += tr(\"Last received block was generated %1 ago.\").arg(timeBehindText);\n        tooltip += QString(\"<br>\");\n        tooltip += tr(\"Transactions after this will not yet be visible.\");\n    }\n\n    // Don't word-wrap this (fixed-width) tooltip\n    tooltip = QString(\"<nobr>\") + tooltip + QString(\"</nobr>\");\n\n    labelBlocksIcon->setToolTip(tooltip);\n    progressBarLabel->setToolTip(tooltip);\n    progressBar->setToolTip(tooltip);\n}\n\nvoid BitcoinGUI::message(const QString &title, const QString &message, unsigned int style, bool *ret)\n{\n    QString strTitle = tr(\"Sugarchain\"); // default title\n    // Default to information icon\n    int nMBoxIcon = QMessageBox::Information;\n    int nNotifyIcon = Notificator::Information;\n\n    QString msgType;\n\n    // Prefer supplied title over style based title\n    if (!title.isEmpty()) {\n        msgType = title;\n    }\n    else {\n        switch (style) {\n        case CClientUIInterface::MSG_ERROR:\n            msgType = tr(\"Error\");\n            break;\n        case CClientUIInterface::MSG_WARNING:\n            msgType = tr(\"Warning\");\n            break;\n        case CClientUIInterface::MSG_INFORMATION:\n            msgType = tr(\"Information\");\n            break;\n        default:\n            break;\n        }\n    }\n    // Append title to \"Bitcoin - \"\n    if (!msgType.isEmpty())\n        strTitle += \" - \" + msgType;\n\n    // Check for error/warning icon\n    if (style & CClientUIInterface::ICON_ERROR) {\n        nMBoxIcon = QMessageBox::Critical;\n        nNotifyIcon = Notificator::Critical;\n    }\n    else if (style & CClientUIInterface::ICON_WARNING) {\n        nMBoxIcon = QMessageBox::Warning;\n        nNotifyIcon = Notificator::Warning;\n    }\n\n    // Display message\n    if (style & CClientUIInterface::MODAL) {\n        // Check for buttons, use OK as default, if none was supplied\n        QMessageBox::StandardButton buttons;\n        if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))\n            buttons = QMessageBox::Ok;\n\n        showNormalIfMinimized();\n        QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons, this);\n        mBox.setTextFormat(Qt::PlainText);\n        int r = mBox.exec();\n        if (ret != nullptr)\n            *ret = r == QMessageBox::Ok;\n    }\n    else\n        notificator->notify((Notificator::Class)nNotifyIcon, strTitle, message);\n}\n\nvoid BitcoinGUI::changeEvent(QEvent *e)\n{\n    QMainWindow::changeEvent(e);\n#ifndef Q_OS_MAC // Ignored on Mac\n    if(e->type() == QEvent::WindowStateChange)\n    {\n        if(clientModel && clientModel->getOptionsModel() && clientModel->getOptionsModel()->getMinimizeToTray())\n        {\n            QWindowStateChangeEvent *wsevt = static_cast<QWindowStateChangeEvent*>(e);\n            if(!(wsevt->oldState() & Qt::WindowMinimized) && isMinimized())\n            {\n                QTimer::singleShot(0, this, SLOT(hide()));\n                e->ignore();\n            }\n            else if((wsevt->oldState() & Qt::WindowMinimized) && !isMinimized())\n            {\n                QTimer::singleShot(0, this, SLOT(show()));\n                e->ignore();\n            }\n        }\n    }\n#endif\n}\n\nvoid BitcoinGUI::closeEvent(QCloseEvent *event)\n{\n#ifndef Q_OS_MAC // Ignored on Mac\n    if(clientModel && clientModel->getOptionsModel())\n    {\n        if(!clientModel->getOptionsModel()->getMinimizeOnClose())\n        {\n            // close rpcConsole in case it was open to make some space for the shutdown window\n            rpcConsole->close();\n\n            QApplication::quit();\n        }\n        else\n        {\n            QMainWindow::showMinimized();\n            event->ignore();\n        }\n    }\n#else\n    QMainWindow::closeEvent(event);\n#endif\n}\n\nvoid BitcoinGUI::showEvent(QShowEvent *event)\n{\n    // enable the debug window when the main window shows up\n    openRPCConsoleAction->setEnabled(true);\n    aboutAction->setEnabled(true);\n    optionsAction->setEnabled(true);\n}\n\n#ifdef ENABLE_WALLET\nvoid BitcoinGUI::incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label)\n{\n    // On new transaction, make an info balloon\n    QString msg = tr(\"Date: %1\\n\").arg(date) +\n                  tr(\"Amount: %1\\n\").arg(BitcoinUnits::formatWithUnit(unit, amount, true)) +\n                  tr(\"Type: %1\\n\").arg(type);\n    if (!label.isEmpty())\n        msg += tr(\"Label: %1\\n\").arg(label);\n    else if (!address.isEmpty())\n        msg += tr(\"Address: %1\\n\").arg(address);\n    message((amount)<0 ? tr(\"Sent transaction\") : tr(\"Incoming transaction\"),\n             msg, CClientUIInterface::MSG_INFORMATION);\n}\n#endif // ENABLE_WALLET\n\nvoid BitcoinGUI::dragEnterEvent(QDragEnterEvent *event)\n{\n    // Accept only URIs\n    if(event->mimeData()->hasUrls())\n        event->acceptProposedAction();\n}\n\nvoid BitcoinGUI::dropEvent(QDropEvent *event)\n{\n    if(event->mimeData()->hasUrls())\n    {\n        for (const QUrl &uri : event->mimeData()->urls())\n        {\n            Q_EMIT receivedURI(uri.toString());\n        }\n    }\n    event->acceptProposedAction();\n}\n\nbool BitcoinGUI::eventFilter(QObject *object, QEvent *event)\n{\n    // Catch status tip events\n    if (event->type() == QEvent::StatusTip)\n    {\n        // Prevent adding text from setStatusTip(), if we currently use the status bar for displaying other stuff\n        if (progressBarLabel->isVisible() || progressBar->isVisible())\n            return true;\n    }\n    return QMainWindow::eventFilter(object, event);\n}\n\n#ifdef ENABLE_WALLET\nbool BitcoinGUI::handlePaymentRequest(const SendCoinsRecipient& recipient)\n{\n    // URI has to be valid\n    if (walletFrame && walletFrame->handlePaymentRequest(recipient))\n    {\n        showNormalIfMinimized();\n        gotoSendCoinsPage();\n        return true;\n    }\n    return false;\n}\n\nvoid BitcoinGUI::setHDStatus(int hdEnabled)\n{\n    labelWalletHDStatusIcon->setPixmap(platformStyle->SingleColorIcon(hdEnabled ? \":/icons/hd_enabled\" : \":/icons/hd_disabled\").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));\n    labelWalletHDStatusIcon->setToolTip(hdEnabled ? tr(\"HD key generation is <b>enabled</b>\") : tr(\"HD key generation is <b>disabled</b>\"));\n\n    // eventually disable the QLabel to set its opacity to 50% \n    labelWalletHDStatusIcon->setEnabled(hdEnabled);\n}\n\nvoid BitcoinGUI::setEncryptionStatus(int status)\n{\n    switch(status)\n    {\n    case WalletModel::Unencrypted:\n        labelWalletEncryptionIcon->hide();\n        encryptWalletAction->setChecked(false);\n        changePassphraseAction->setEnabled(false);\n        encryptWalletAction->setEnabled(true);\n        break;\n    case WalletModel::Unlocked:\n        labelWalletEncryptionIcon->show();\n        labelWalletEncryptionIcon->setPixmap(platformStyle->SingleColorIcon(\":/icons/lock_open\").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));\n        labelWalletEncryptionIcon->setToolTip(tr(\"Wallet is <b>encrypted</b> and currently <b>unlocked</b>\"));\n        encryptWalletAction->setChecked(true);\n        changePassphraseAction->setEnabled(true);\n        encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported\n        break;\n    case WalletModel::Locked:\n        labelWalletEncryptionIcon->show();\n        labelWalletEncryptionIcon->setPixmap(platformStyle->SingleColorIcon(\":/icons/lock_closed\").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));\n        labelWalletEncryptionIcon->setToolTip(tr(\"Wallet is <b>encrypted</b> and currently <b>locked</b>\"));\n        encryptWalletAction->setChecked(true);\n        changePassphraseAction->setEnabled(true);\n        encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported\n        break;\n    }\n}\n#endif // ENABLE_WALLET\n\nvoid BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)\n{\n    if(!clientModel)\n        return;\n\n    // activateWindow() (sometimes) helps with keyboard focus on Windows\n    if (isHidden())\n    {\n        show();\n        activateWindow();\n    }\n    else if (isMinimized())\n    {\n        showNormal();\n        activateWindow();\n    }\n    else if (GUIUtil::isObscured(this))\n    {\n        raise();\n        activateWindow();\n    }\n    else if(fToggleHidden)\n        hide();\n}\n\nvoid BitcoinGUI::toggleHidden()\n{\n    showNormalIfMinimized(true);\n}\n\nvoid BitcoinGUI::detectShutdown()\n{\n    if (ShutdownRequested())\n    {\n        if(rpcConsole)\n            rpcConsole->hide();\n        qApp->quit();\n    }\n}\n\nvoid BitcoinGUI::showProgress(const QString &title, int nProgress)\n{\n    if (nProgress == 0)\n    {\n        progressDialog = new QProgressDialog(title, \"\", 0, 100);\n        progressDialog->setWindowModality(Qt::ApplicationModal);\n        progressDialog->setMinimumDuration(0);\n        progressDialog->setCancelButton(0);\n        progressDialog->setAutoClose(false);\n        progressDialog->setValue(0);\n    }\n    else if (nProgress == 100)\n    {\n        if (progressDialog)\n        {\n            progressDialog->close();\n            progressDialog->deleteLater();\n        }\n    }\n    else if (progressDialog)\n        progressDialog->setValue(nProgress);\n}\n\nvoid BitcoinGUI::setTrayIconVisible(bool fHideTrayIcon)\n{\n    if (trayIcon)\n    {\n        trayIcon->setVisible(!fHideTrayIcon);\n    }\n}\n\nvoid BitcoinGUI::showModalOverlay()\n{\n    if (modalOverlay && (progressBar->isVisible() || modalOverlay->isLayerVisible()))\n        modalOverlay->toggleVisibility();\n}\n\nstatic bool ThreadSafeMessageBox(BitcoinGUI *gui, const std::string& message, const std::string& caption, unsigned int style)\n{\n    bool modal = (style & CClientUIInterface::MODAL);\n    // The SECURE flag has no effect in the Qt GUI.\n    // bool secure = (style & CClientUIInterface::SECURE);\n    style &= ~CClientUIInterface::SECURE;\n    bool ret = false;\n    // In case of modal message, use blocking connection to wait for user to click a button\n    QMetaObject::invokeMethod(gui, \"message\",\n                               modal ? GUIUtil::blockingGUIThreadConnection() : Qt::QueuedConnection,\n                               Q_ARG(QString, QString::fromStdString(caption)),\n                               Q_ARG(QString, QString::fromStdString(message)),\n                               Q_ARG(unsigned int, style),\n                               Q_ARG(bool*, &ret));\n    return ret;\n}\n\nvoid BitcoinGUI::subscribeToCoreSignals()\n{\n    // Connect signals to client\n    uiInterface.ThreadSafeMessageBox.connect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3));\n    uiInterface.ThreadSafeQuestion.connect(boost::bind(ThreadSafeMessageBox, this, _1, _3, _4));\n}\n\nvoid BitcoinGUI::unsubscribeFromCoreSignals()\n{\n    // Disconnect signals from client\n    uiInterface.ThreadSafeMessageBox.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3));\n    uiInterface.ThreadSafeQuestion.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _3, _4));\n}\n\nvoid BitcoinGUI::toggleNetworkActive()\n{\n    if (clientModel) {\n        clientModel->setNetworkActive(!clientModel->getNetworkActive());\n    }\n}\n\nUnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle *platformStyle) :\n    optionsModel(0),\n    menu(0)\n{\n    createContextMenu();\n    setToolTip(tr(\"Unit to show amounts in. Click to select another unit.\"));\n    QList<BitcoinUnits::Unit> units = BitcoinUnits::availableUnits();\n    int max_width = 0;\n    const QFontMetrics fm(font());\n    for (const BitcoinUnits::Unit unit : units)\n    {\n        max_width = qMax(max_width, fm.width(BitcoinUnits::longName(unit)));\n    }\n    setMinimumSize(max_width, 0);\n    setAlignment(Qt::AlignRight | Qt::AlignVCenter);\n    setStyleSheet(QString(\"QLabel { color : %1 }\").arg(platformStyle->SingleColor().name()));\n}\n\n/** So that it responds to button clicks */\nvoid UnitDisplayStatusBarControl::mousePressEvent(QMouseEvent *event)\n{\n    onDisplayUnitsClicked(event->pos());\n}\n\n/** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */\nvoid UnitDisplayStatusBarControl::createContextMenu()\n{\n    menu = new QMenu(this);\n    for (BitcoinUnits::Unit u : BitcoinUnits::availableUnits())\n    {\n        QAction *menuAction = new QAction(QString(BitcoinUnits::longName(u)), this);\n        menuAction->setData(QVariant(u));\n        menu->addAction(menuAction);\n    }\n    connect(menu,SIGNAL(triggered(QAction*)),this,SLOT(onMenuSelection(QAction*)));\n}\n\n/** Lets the control know about the Options Model (and its signals) */\nvoid UnitDisplayStatusBarControl::setOptionsModel(OptionsModel *_optionsModel)\n{\n    if (_optionsModel)\n    {\n        this->optionsModel = _optionsModel;\n\n        // be aware of a display unit change reported by the OptionsModel object.\n        connect(_optionsModel,SIGNAL(displayUnitChanged(int)),this,SLOT(updateDisplayUnit(int)));\n\n        // initialize the display units label with the current value in the model.\n        updateDisplayUnit(_optionsModel->getDisplayUnit());\n    }\n}\n\n/** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */\nvoid UnitDisplayStatusBarControl::updateDisplayUnit(int newUnits)\n{\n    setText(BitcoinUnits::longName(newUnits));\n}\n\n/** Shows context menu with Display Unit options by the mouse coordinates */\nvoid UnitDisplayStatusBarControl::onDisplayUnitsClicked(const QPoint& point)\n{\n    QPoint globalPos = mapToGlobal(point);\n    menu->exec(globalPos);\n}\n\n/** Tells underlying optionsModel to update its current display unit. */\nvoid UnitDisplayStatusBarControl::onMenuSelection(QAction* action)\n{\n    if (action)\n    {\n        optionsModel->setDisplayUnit(action->data());\n    }\n}\n"
  },
  {
    "path": "src/qt/bitcoingui.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_BITCOINGUI_H\n#define BITCOIN_QT_BITCOINGUI_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <amount.h>\n\n#include <QLabel>\n#include <QMainWindow>\n#include <QMap>\n#include <QMenu>\n#include <QPoint>\n#include <QSystemTrayIcon>\n\nclass ClientModel;\nclass NetworkStyle;\nclass Notificator;\nclass OptionsModel;\nclass PlatformStyle;\nclass RPCConsole;\nclass SendCoinsRecipient;\nclass UnitDisplayStatusBarControl;\nclass WalletFrame;\nclass WalletModel;\nclass HelpMessageDialog;\nclass ModalOverlay;\n\nQT_BEGIN_NAMESPACE\nclass QAction;\nclass QProgressBar;\nclass QProgressDialog;\nQT_END_NAMESPACE\n\n/**\n  Bitcoin GUI main class. This class represents the main window of the Bitcoin UI. It communicates with both the client and\n  wallet models to give the user an up-to-date view of the current core state.\n*/\nclass BitcoinGUI : public QMainWindow\n{\n    Q_OBJECT\n\npublic:\n    static const QString DEFAULT_WALLET;\n    static const std::string DEFAULT_UIPLATFORM;\n\n    explicit BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent = 0);\n    ~BitcoinGUI();\n\n    /** Set the client model.\n        The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.\n    */\n    void setClientModel(ClientModel *clientModel);\n\n#ifdef ENABLE_WALLET\n    /** Set the wallet model.\n        The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending\n        functionality.\n    */\n    bool addWallet(const QString& name, WalletModel *walletModel);\n    bool setCurrentWallet(const QString& name);\n    void removeAllWallets();\n#endif // ENABLE_WALLET\n    bool enableWallet;\n\nprotected:\n    void changeEvent(QEvent *e);\n    void closeEvent(QCloseEvent *event);\n    void showEvent(QShowEvent *event);\n    void dragEnterEvent(QDragEnterEvent *event);\n    void dropEvent(QDropEvent *event);\n    bool eventFilter(QObject *object, QEvent *event);\n\nprivate:\n    ClientModel *clientModel;\n    WalletFrame *walletFrame;\n\n    UnitDisplayStatusBarControl *unitDisplayControl;\n    QLabel *labelWalletEncryptionIcon;\n    QLabel *labelWalletHDStatusIcon;\n    QLabel *connectionsControl;\n    QLabel *labelBlocksIcon;\n    QLabel *progressBarLabel;\n    QProgressBar *progressBar;\n    QProgressDialog *progressDialog;\n\n    QMenuBar *appMenuBar;\n    QAction *overviewAction;\n    QAction *historyAction;\n    QAction *quitAction;\n    QAction *sendCoinsAction;\n    QAction *sendCoinsMenuAction;\n    QAction *usedSendingAddressesAction;\n    QAction *usedReceivingAddressesAction;\n    QAction *signMessageAction;\n    QAction *verifyMessageAction;\n    QAction *aboutAction;\n    QAction *receiveCoinsAction;\n    QAction *receiveCoinsMenuAction;\n    QAction *optionsAction;\n    QAction *toggleHideAction;\n    QAction *encryptWalletAction;\n    QAction *backupWalletAction;\n    QAction *changePassphraseAction;\n    QAction *aboutQtAction;\n    QAction *openRPCConsoleAction;\n    QAction *openAction;\n    QAction *showHelpMessageAction;\n\n    QSystemTrayIcon *trayIcon;\n    QMenu *trayIconMenu;\n    Notificator *notificator;\n    RPCConsole *rpcConsole;\n    HelpMessageDialog *helpMessageDialog;\n    ModalOverlay *modalOverlay;\n\n    /** Keep track of previous number of blocks, to detect progress */\n    int prevBlocks;\n    int spinnerFrame;\n\n    const PlatformStyle *platformStyle;\n\n    /** Create the main UI actions. */\n    void createActions();\n    /** Create the menu bar and sub-menus. */\n    void createMenuBar();\n    /** Create the toolbars */\n    void createToolBars();\n    /** Create system tray icon and notification */\n    void createTrayIcon(const NetworkStyle *networkStyle);\n    /** Create system tray menu (or setup the dock menu) */\n    void createTrayIconMenu();\n\n    /** Enable or disable all wallet-related actions */\n    void setWalletActionsEnabled(bool enabled);\n\n    /** Connect core signals to GUI client */\n    void subscribeToCoreSignals();\n    /** Disconnect core signals from GUI client */\n    void unsubscribeFromCoreSignals();\n\n    /** Update UI with latest network info from model. */\n    void updateNetworkState();\n\n    void updateHeadersSyncProgressLabel();\n\nQ_SIGNALS:\n    /** Signal raised when a URI was entered or dragged to the GUI */\n    void receivedURI(const QString &uri);\n\npublic Q_SLOTS:\n    /** Set number of connections shown in the UI */\n    void setNumConnections(int count);\n    /** Set network state shown in the UI */\n    void setNetworkActive(bool networkActive);\n    /** Set number of blocks and last block date shown in the UI */\n    void setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers);\n\n    /** Notify the user of an event from the core network or transaction handling code.\n       @param[in] title     the message box / notification title\n       @param[in] message   the displayed text\n       @param[in] style     modality and style definitions (icon and used buttons - buttons only for message boxes)\n                            @see CClientUIInterface::MessageBoxFlags\n       @param[in] ret       pointer to a bool that will be modified to whether Ok was clicked (modal only)\n    */\n    void message(const QString &title, const QString &message, unsigned int style, bool *ret = nullptr);\n\n#ifdef ENABLE_WALLET\n    /** Set the encryption status as shown in the UI.\n       @param[in] status            current encryption status\n       @see WalletModel::EncryptionStatus\n    */\n    void setEncryptionStatus(int status);\n\n    /** Set the hd-enabled status as shown in the UI.\n     @param[in] status            current hd enabled status\n     @see WalletModel::EncryptionStatus\n     */\n    void setHDStatus(int hdEnabled);\n\n    bool handlePaymentRequest(const SendCoinsRecipient& recipient);\n\n    /** Show incoming transaction notification for new transactions. */\n    void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label);\n#endif // ENABLE_WALLET\n\nprivate Q_SLOTS:\n#ifdef ENABLE_WALLET\n    /** Switch to overview (home) page */\n    void gotoOverviewPage();\n    /** Switch to history (transactions) page */\n    void gotoHistoryPage();\n    /** Switch to receive coins page */\n    void gotoReceiveCoinsPage();\n    /** Switch to send coins page */\n    void gotoSendCoinsPage(QString addr = \"\");\n\n    /** Show Sign/Verify Message dialog and switch to sign message tab */\n    void gotoSignMessageTab(QString addr = \"\");\n    /** Show Sign/Verify Message dialog and switch to verify message tab */\n    void gotoVerifyMessageTab(QString addr = \"\");\n\n    /** Show open dialog */\n    void openClicked();\n#endif // ENABLE_WALLET\n    /** Show configuration dialog */\n    void optionsClicked();\n    /** Show about dialog */\n    void aboutClicked();\n    /** Show debug window */\n    void showDebugWindow();\n    /** Show debug window and set focus to the console */\n    void showDebugWindowActivateConsole();\n    /** Show help message dialog */\n    void showHelpMessageClicked();\n#ifndef Q_OS_MAC\n    /** Handle tray icon clicked */\n    void trayIconActivated(QSystemTrayIcon::ActivationReason reason);\n#endif\n\n    /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */\n    void showNormalIfMinimized(bool fToggleHidden = false);\n    /** Simply calls showNormalIfMinimized(true) for use in SLOT() macro */\n    void toggleHidden();\n\n    /** called by a timer to check if fRequestShutdown has been set **/\n    void detectShutdown();\n\n    /** Show progress dialog e.g. for verifychain */\n    void showProgress(const QString &title, int nProgress);\n    \n    /** When hideTrayIcon setting is changed in OptionsModel hide or show the icon accordingly. */\n    void setTrayIconVisible(bool);\n\n    /** Toggle networking */\n    void toggleNetworkActive();\n\n    void showModalOverlay();\n};\n\nclass UnitDisplayStatusBarControl : public QLabel\n{\n    Q_OBJECT\n\npublic:\n    explicit UnitDisplayStatusBarControl(const PlatformStyle *platformStyle);\n    /** Lets the control know about the Options Model (and its signals) */\n    void setOptionsModel(OptionsModel *optionsModel);\n\nprotected:\n    /** So that it responds to left-button clicks */\n    void mousePressEvent(QMouseEvent *event);\n\nprivate:\n    OptionsModel *optionsModel;\n    QMenu* menu;\n\n    /** Shows context menu with Display Unit options by the mouse coordinates */\n    void onDisplayUnitsClicked(const QPoint& point);\n    /** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */\n    void createContextMenu();\n\nprivate Q_SLOTS:\n    /** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */\n    void updateDisplayUnit(int newUnits);\n    /** Tells underlying optionsModel to update its current display unit. */\n    void onMenuSelection(QAction* action);\n};\n\n#endif // BITCOIN_QT_BITCOINGUI_H\n"
  },
  {
    "path": "src/qt/bitcoinstrings.cpp",
    "content": "\n\n#include <QtGlobal>\n\n// Automatically generated by extract_strings_qt.py\n#ifdef __GNUC__\n#define UNUSED __attribute__((unused))\n#else\n#define UNUSED\n#endif\nstatic const char UNUSED *bitcoin_strings[] = {\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Bitcoin Core\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"The %s developers\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"(1 = keep tx meta data e.g. account owner and payment request information, 2 \"\n\"= drop tx meta data)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"-maxtxfee is set very high! Fees this large could be paid on a single \"\n\"transaction.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"A fee rate (in %s/kB) that will be used when fee estimation has insufficient \"\n\"data (default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Accept relayed transactions received from whitelisted peers even when not \"\n\"relaying transactions (default: %d)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Add a node to connect to and attempt to keep the connection open (see the \"\n\"`addnode` RPC command help for more info)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Allow JSON-RPC connections from specified source. Valid for <ip> are a \"\n\"single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or \"\n\"a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Bind to given address and always listen on it. Use [host]:port notation for \"\n\"IPv6\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Bind to given address and whitelist peers connecting to it. Use [host]:port \"\n\"notation for IPv6\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Bind to given address to listen for JSON-RPC connections. This option is \"\n\"ignored unless -rpcallowip is also passed. Port is optional and overrides -\"\n\"rpcport. Use [host]:port notation for IPv6. This option can be specified \"\n\"multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -\"\n\"rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Cannot obtain a lock on data directory %s. %s is probably already running.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Cannot provide specific connections and have addrman find outgoing \"\n\"connections at the same.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Connect only to the specified node(s); -connect=0 disables automatic \"\n\"connections (the rules for this peer are the same as for -addnode)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Create new files with system default permissions, instead of umask 077 (only \"\n\"effective with disabled wallet functionality)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Delete all wallet transactions and only recover those parts of the \"\n\"blockchain through -rescan on startup\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Discover own IP addresses (default: 1 when listening and no -externalip or -\"\n\"proxy)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Distributed under the MIT software license, see the accompanying file %s or \"\n\"%s\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Do not keep transactions in the mempool longer than <n> hours (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Equivalent bytes per sigop in transactions for relay and mining (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Error loading %s: You can't enable HD on an already existing non-HD wallet\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Error loading wallet %s. -wallet parameter must only specify a filename (not \"\n\"a path).\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Error reading %s! All keys read correctly, but transaction data or address \"\n\"book entries might be missing or incorrect.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Error: Listening for incoming connections failed (listen returned error %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Exclude debugging information for a category. Can be used in conjunction \"\n\"with -debug=1 to output debug logs for all categories except one or more \"\n\"specified categories.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Execute command when a relevant alert is received or we see a really long \"\n\"fork (%s in cmd is replaced by message)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Execute command when a wallet transaction changes (%s in cmd is replaced by \"\n\"TxID)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Execute command when the best block changes (%s in cmd is replaced by block \"\n\"hash)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Extra transactions to keep in memory for compact block reconstructions \"\n\"(default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Fees (in %s/kB) smaller than this are considered zero fee for relaying, \"\n\"mining and transaction creation (default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Fees (in %s/kB) smaller than this are considered zero fee for transaction \"\n\"creation (default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Force relay of transactions from whitelisted peers even if they violate \"\n\"local relay policy (default: %d)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"How thorough the block verification of -checkblocks is (0-4, default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"If <category> is not supplied or if <category> = 1, output all debugging \"\n\"information.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"If paytxfee is not set, include enough fee so transactions begin \"\n\"confirmation on average within n blocks (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"If this block is in the chain assume that it and its ancestors are valid and \"\n\"potentially skip their script verification (0 to verify all, default: %s, \"\n\"testnet: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay \"\n\"fee of %s to prevent stuck transactions)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Maintain a full transaction index, used by the getrawtransaction rpc call \"\n\"(default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Maximum allowed median peer time offset adjustment. Local perspective of \"\n\"time may be influenced by peers forward or backward by this amount. \"\n\"(default: %u seconds)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Maximum size of data in data carrier transactions we relay and mine \"\n\"(default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Maximum total fees (in %s) to use in a single wallet transaction or raw \"\n\"transaction; setting this too low may abort large transactions (default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Number of seconds to keep misbehaving peers from reconnecting (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Output debugging information (default: %u, supplying <category> is optional)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Please check that your computer's date and time are correct! If your clock \"\n\"is wrong, %s will not work properly.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Please contribute if you find %s useful. Visit %s for further information \"\n\"about the software.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Prune configured below the minimum of %d MiB.  Please use a higher number.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Prune: last wallet synchronisation goes beyond pruned data. You need to -\"\n\"reindex (download the whole blockchain again in case of pruned node)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Query for peer addresses via DNS lookup, if low on addresses (default: 1 \"\n\"unless -connect used)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Randomize credentials for every proxy connection. This enables Tor stream \"\n\"isolation (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Reduce storage requirements by enabling pruning (deleting) of old blocks. \"\n\"This allows the pruneblockchain RPC to be called to delete specific blocks, \"\n\"and enables automatic pruning of old blocks if a target size in MiB is \"\n\"provided. This mode is incompatible with -txindex and -rescan. Warning: \"\n\"Reverting this setting requires re-downloading the entire blockchain. \"\n\"(default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, >%u \"\n\"= automatically prune block files to stay under the specified target size in \"\n\"MiB)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Rescans are not possible in pruned mode. You will need to use -reindex which \"\n\"will download the whole blockchain again.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Set lowest fee rate (in %s/kB) for transactions to be included in block \"\n\"creation. (default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Set the number of script verification threads (%u to %d, 0 = auto, <0 = \"\n\"leave that many cores free, default: %d)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Sets the serialization of raw transaction or block hex returned in non-\"\n\"verbose mode, non-segwit(0) or segwit(1) (default: %d)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Specify directory to hold wallets (default: <datadir>/wallets if it exists, \"\n\"otherwise <datadir>)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Specify location of debug log file: this can be an absolute path or a path \"\n\"relative to the data directory (default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Support filtering of blocks and transaction with bloom filters (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"The block database contains a block which appears to be from the future. \"\n\"This may be due to your computer's date and time being set incorrectly. Only \"\n\"rebuild the block database if you are sure that your computer's date and \"\n\"time are correct\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"The fee rate (in %s/kB) that indicates your tolerance for discarding change \"\n\"by adding it to the fee (default: %s). Note: An output is discarded if it is \"\n\"dust at this rate, but we will always discard up to the dust relay fee and a \"\n\"discard fee above that is limited by the fee estimate for the longest target\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"The transaction amount is too small to send after the fee has been deducted\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"This is a pre-release test build - use at your own risk - do not use for \"\n\"mining or merchant applications\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"This is the transaction fee you may discard if change is smaller than dust \"\n\"at this level\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"This is the transaction fee you may pay when fee estimates are not available.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"This product includes software developed by the OpenSSL Project for use in \"\n\"the OpenSSL Toolkit %s and cryptographic software written by Eric Young and \"\n\"UPnP software written by Thomas Bernard.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Total length of network version string (%i) exceeds maximum length (%i). \"\n\"Reduce the number or size of uacomments.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = \"\n\"no limit (default: %d)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Unable to replay blocks. You will need to rebuild the database using -\"\n\"reindex-chainstate.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Unable to rewind the database to a pre-fork state. You will need to \"\n\"redownload the blockchain\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Unsupported argument -socks found. Setting SOCKS version isn't possible \"\n\"anymore, only SOCKS5 proxies are supported.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/\"\n\"or -whitelistforcerelay.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Use UPnP to map the listening port (default: 1 when listening and no -proxy)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: \"\n\"%s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Username and hashed password for JSON-RPC connections. The field <userpw> \"\n\"comes in the format: <USERNAME>:<SALT>$<HASH>. A canonical python script is \"\n\"included in share/rpcuser. The client then connects normally using the \"\n\"rpcuser=<USERNAME>/rpcpassword=<PASSWORD> pair of arguments. This option can \"\n\"be specified multiple times\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Wallet will not create transactions that violate mempool chain limits \"\n\"(default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Warning: The network does not appear to fully agree! Some miners appear to \"\n\"be experiencing issues.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Warning: Unknown block versions being mined! It's possible unknown rules are \"\n\"in effect\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; \"\n\"if your balance or transactions are incorrect you should restore from a \"\n\"backup.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Warning: We do not appear to fully agree with our peers! You may need to \"\n\"upgrade, or other nodes may need to upgrade.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Whether to save the mempool on shutdown and load on restart (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR \"\n\"notated network (e.g. 1.2.3.0/24). Can be specified multiple times.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"Whitelisted peers cannot be DoS banned and their transactions are always \"\n\"relayed, even if they are already in the mempool, useful e.g. for a gateway\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"\"\n\"You need to rebuild the database using -reindex to go back to unpruned \"\n\"mode.  This will redownload the entire blockchain\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"%d of last 100 blocks have unexpected version\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"%s corrupt, salvage failed\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"%s is set very high!\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"(default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"(default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"-maxmempool must be at least %d MB\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"<category> can be:\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Accept command line and JSON-RPC commands\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Accept connections from outside (default: 1 if no -proxy or -connect)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Accept public REST requests (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Allow DNS lookups for -addnode, -seednode and -connect\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Always query for peer addresses via DNS lookup (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Append comment to the user agent string\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Attempt to recover private keys from a corrupt wallet on startup\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Automatically create Tor hidden service (default: %d)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Block creation options:\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Cannot downgrade wallet\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Cannot resolve -%s address: '%s'\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Chain selection options:\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Change index out of range\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Connect through SOCKS5 proxy\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Connect to a node to retrieve peer addresses, and disconnect\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Connection options:\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Copyright (C) %i-%i\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Corrupted block database detected\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Debugging/Testing options:\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Do not load the wallet and disable wallet RPC calls\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Do you want to rebuild the block database now?\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Done loading\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Enable publish hash block in <address>\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Enable publish hash transaction in <address>\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Enable publish raw block in <address>\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Enable publish raw transaction in <address>\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Enable transaction replacement in the memory pool (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error creating %s: You can't create non-HD wallets with this version.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error initializing block database\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error initializing wallet database environment %s!\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error loading %s\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error loading %s: Wallet corrupted\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error loading %s: Wallet requires newer version of %s\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error loading %s: You can't disable HD on an already existing HD wallet\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error loading block database\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error loading wallet %s. -wallet filename must be a regular file.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error loading wallet %s. Duplicate -wallet filename specified.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error loading wallet %s. Invalid characters in -wallet filename.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error opening block database\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error reading from database, shutting down.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error upgrading chainstate database\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error: A fatal internal error occurred, see debug.log for details\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Error: Disk space is low!\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Failed to listen on any port. Use -listen=0 if you want this.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Failed to rescan the wallet during initialization\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Fee (in %s/kB) to add to transactions you send (default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"How many blocks to check at startup (default: %u, 0 = all)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Importing...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Imports blocks from external blk000??.dat file on startup\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Include IP addresses in debug output (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Incorrect or no genesis block found. Wrong datadir for network?\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Information\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Initialization sanity check failed. %s is shutting down.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Insufficient funds\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Invalid -onion address or hostname: '%s'\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Invalid -proxy address or hostname: '%s'\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Invalid amount for -%s=<amount>: '%s'\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Invalid amount for -discardfee=<amount>: '%s'\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Invalid amount for -fallbackfee=<amount>: '%s'\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Invalid netmask specified in -whitelist: '%s'\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Keep at most <n> unconnectable transactions in memory (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Keep the transaction memory pool below <n> megabytes (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Keypool ran out, please call keypoolrefill first\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Listen for JSON-RPC connections on <port> (default: %u or testnet: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Listen for connections on <port> (default: %u or testnet: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Loading P2P addresses...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Loading banlist...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Loading block index...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Loading wallet...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Location of the auth cookie (default: data dir)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Maintain at most <n> connections to peers (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Make the wallet broadcast transactions\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Maximum per-connection send buffer, <n>*1000 bytes (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Need to specify a port with -whitebind: '%s'\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Node relay options:\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Not enough file descriptors available.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Only connect to nodes in network <net> (ipv4, ipv6 or onion)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Options:\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Password for JSON-RPC connections\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Prepend debug output with timestamp (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Print this help message and exit\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Print version and exit\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Prune cannot be configured with a negative value.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Prune mode is incompatible with -txindex.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Pruning blockstore...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"RPC server options:\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Rebuild chain state and block index from the blk*.dat files on disk\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Rebuild chain state from the currently indexed blocks\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Reducing -maxconnections from %d to %d, because of system limitations.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Relay and mine data carrier transactions (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Relay non-P2SH multisig (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Replaying blocks...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Rescan the block chain for missing wallet transactions on startup\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Rescanning...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Rewinding blocks...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Run in the background as a daemon and accept commands\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Send trace/debug info to console instead of debug.log file\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Send transactions with full-RBF opt-in enabled (RPC only, default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Set database cache size in megabytes (%d to %d, default: %d)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Set key pool size to <n> (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Set maximum BIP141 block weight (default: %d)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Set the number of threads to service RPC calls (default: %d)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Show all debugging options (usage: --help -help-debug)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Shrink debug.log file on client startup (default: 1 when no -debug)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Signing transaction failed\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Specified -walletdir \\\"%s\\\" does not exist\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Specified -walletdir \\\"%s\\\" is a relative path\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Specified -walletdir \\\"%s\\\" is not a directory\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Specify configuration file (default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Specify connection timeout in milliseconds (minimum: 1, default: %d)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Specify data directory\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Specify pid file (default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Specify wallet file (within data directory)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Specify your own public address\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Spend unconfirmed change when sending transactions (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Starting network threads...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"The source code is available from %s.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"The transaction amount is too small to pay the fee\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"The wallet will avoid paying less than the minimum relay fee.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"This is experimental software.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"This is the minimum transaction fee you pay on every transaction.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"This is the transaction fee you will pay if you send a transaction.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Threshold for disconnecting misbehaving peers (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Tor control port password (default: empty)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Tor control port to use if onion listening enabled (default: %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Transaction amount too small\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Transaction amounts must not be negative\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Transaction fee and change calculation failed\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Transaction has too long of a mempool chain\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Transaction must have at least one recipient\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Transaction too large for fee policy\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Transaction too large\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Unable to bind to %s on this computer (bind returned error %s)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Unable to bind to %s on this computer. %s is probably already running.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Unable to generate initial keys\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Unable to start HTTP server. See debug log for details.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Unknown network specified in -onlynet: '%s'\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Unsupported argument -benchmark ignored, use -debug=bench.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Unsupported argument -debugnet ignored, use -debug=net.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Unsupported argument -tor found, use -onion.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Unsupported logging category %s=%s.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Upgrade wallet to latest format on startup\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Upgrading UTXO database\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Use UPnP to map the listening port (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Use the test chain\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"User Agent comment (%s) contains unsafe characters.\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Username for JSON-RPC connections\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Verifying blocks...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Verifying wallet(s)...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Wallet %s resides outside wallet directory %s\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Wallet debugging/testing options:\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Wallet needed to be rewritten: restart %s to complete\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Wallet options:\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Warning\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Warning: unknown new rules activated (versionbit %i)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Whether to operate in a blocks only mode (default: %u)\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"You need to rebuild the database using -reindex to change -txindex\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"Zapping all transactions from wallet...\"),\nQT_TRANSLATE_NOOP(\"bitcoin-core\", \"ZeroMQ notification options:\"),\n};\n"
  },
  {
    "path": "src/qt/bitcoinunits.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/bitcoinunits.h>\n\n#include <primitives/transaction.h>\n\n#include <QStringList>\n\nBitcoinUnits::BitcoinUnits(QObject *parent):\n        QAbstractListModel(parent),\n        unitlist(availableUnits())\n{\n}\n\nQList<BitcoinUnits::Unit> BitcoinUnits::availableUnits()\n{\n    QList<BitcoinUnits::Unit> unitlist;\n    unitlist.append(BTC);\n    unitlist.append(mBTC);\n    unitlist.append(uBTC);\n    return unitlist;\n}\n\nbool BitcoinUnits::valid(int unit)\n{\n    switch(unit)\n    {\n    case BTC:\n    case mBTC:\n    case uBTC:\n        return true;\n    default:\n        return false;\n    }\n}\n\nQString BitcoinUnits::longName(int unit)\n{\n    switch(unit)\n    {\n    case BTC: return QString(\"SUGAR\");\n    case mBTC: return QString(\"mSUGAR\");\n    case uBTC: return QString::fromUtf8(\"µSUGAR (bits)\");\n    default: return QString(\"???\");\n    }\n}\n\nQString BitcoinUnits::shortName(int unit)\n{\n    switch(unit)\n    {\n    case uBTC: return QString::fromUtf8(\"bits\");\n    default:   return longName(unit);\n    }\n}\n\nQString BitcoinUnits::description(int unit)\n{\n    switch(unit)\n    {\n    case BTC: return QString(\"Sugarchains\");\n    case mBTC: return QString(\"Milli-Sugarchains (1 / 1\" THIN_SP_UTF8 \"000)\");\n    case uBTC: return QString(\"Micro-Sugarchains (bits) (1 / 1\" THIN_SP_UTF8 \"000\" THIN_SP_UTF8 \"000)\");\n    default: return QString(\"???\");\n    }\n}\n\nqint64 BitcoinUnits::factor(int unit)\n{\n    switch(unit)\n    {\n    case BTC:  return 100000000;\n    case mBTC: return 100000;\n    case uBTC: return 100;\n    default:   return 100000000;\n    }\n}\n\nint BitcoinUnits::decimals(int unit)\n{\n    switch(unit)\n    {\n    case BTC: return 8;\n    case mBTC: return 5;\n    case uBTC: return 2;\n    default: return 0;\n    }\n}\n\nQString BitcoinUnits::format(int unit, const CAmount& nIn, bool fPlus, SeparatorStyle separators)\n{\n    // Note: not using straight sprintf here because we do NOT want\n    // localized number formatting.\n    if(!valid(unit))\n        return QString(); // Refuse to format invalid unit\n    qint64 n = (qint64)nIn;\n    qint64 coin = factor(unit);\n    int num_decimals = decimals(unit);\n    qint64 n_abs = (n > 0 ? n : -n);\n    qint64 quotient = n_abs / coin;\n    qint64 remainder = n_abs % coin;\n    QString quotient_str = QString::number(quotient);\n    QString remainder_str = QString::number(remainder).rightJustified(num_decimals, '0');\n\n    // Use SI-style thin space separators as these are locale independent and can't be\n    // confused with the decimal marker.\n    QChar thin_sp(THIN_SP_CP);\n    int q_size = quotient_str.size();\n    if (separators == separatorAlways || (separators == separatorStandard && q_size > 4))\n        for (int i = 3; i < q_size; i += 3)\n            quotient_str.insert(q_size - i, thin_sp);\n\n    if (n < 0)\n        quotient_str.insert(0, '-');\n    else if (fPlus && n > 0)\n        quotient_str.insert(0, '+');\n    return quotient_str + QString(\".\") + remainder_str;\n}\n\n\n// NOTE: Using formatWithUnit in an HTML context risks wrapping\n// quantities at the thousands separator. More subtly, it also results\n// in a standard space rather than a thin space, due to a bug in Qt's\n// XML whitespace canonicalisation\n//\n// Please take care to use formatHtmlWithUnit instead, when\n// appropriate.\n\nQString BitcoinUnits::formatWithUnit(int unit, const CAmount& amount, bool plussign, SeparatorStyle separators)\n{\n    return format(unit, amount, plussign, separators) + QString(\" \") + shortName(unit);\n}\n\nQString BitcoinUnits::formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign, SeparatorStyle separators)\n{\n    QString str(formatWithUnit(unit, amount, plussign, separators));\n    str.replace(QChar(THIN_SP_CP), QString(THIN_SP_HTML));\n    return QString(\"<span style='white-space: nowrap;'>%1</span>\").arg(str);\n}\n\n\nbool BitcoinUnits::parse(int unit, const QString &value, CAmount *val_out)\n{\n    if(!valid(unit) || value.isEmpty())\n        return false; // Refuse to parse invalid unit or empty string\n    int num_decimals = decimals(unit);\n\n    // Ignore spaces and thin spaces when parsing\n    QStringList parts = removeSpaces(value).split(\".\");\n\n    if(parts.size() > 2)\n    {\n        return false; // More than one dot\n    }\n    QString whole = parts[0];\n    QString decimals;\n\n    if(parts.size() > 1)\n    {\n        decimals = parts[1];\n    }\n    if(decimals.size() > num_decimals)\n    {\n        return false; // Exceeds max precision\n    }\n    bool ok = false;\n    QString str = whole + decimals.leftJustified(num_decimals, '0');\n\n    if(str.size() > 18)\n    {\n        return false; // Longer numbers will exceed 63 bits\n    }\n    CAmount retvalue(str.toLongLong(&ok));\n    if(val_out)\n    {\n        *val_out = retvalue;\n    }\n    return ok;\n}\n\nQString BitcoinUnits::getAmountColumnTitle(int unit)\n{\n    QString amountTitle = QObject::tr(\"Amount\");\n    if (BitcoinUnits::valid(unit))\n    {\n        amountTitle += \" (\"+BitcoinUnits::shortName(unit) + \")\";\n    }\n    return amountTitle;\n}\n\nint BitcoinUnits::rowCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    return unitlist.size();\n}\n\nQVariant BitcoinUnits::data(const QModelIndex &index, int role) const\n{\n    int row = index.row();\n    if(row >= 0 && row < unitlist.size())\n    {\n        Unit unit = unitlist.at(row);\n        switch(role)\n        {\n        case Qt::EditRole:\n        case Qt::DisplayRole:\n            return QVariant(longName(unit));\n        case Qt::ToolTipRole:\n            return QVariant(description(unit));\n        case UnitRole:\n            return QVariant(static_cast<int>(unit));\n        }\n    }\n    return QVariant();\n}\n\nCAmount BitcoinUnits::maxMoney()\n{\n    return MAX_MONEY;\n}\n"
  },
  {
    "path": "src/qt/bitcoinunits.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_BITCOINUNITS_H\n#define BITCOIN_QT_BITCOINUNITS_H\n\n#include <amount.h>\n\n#include <QAbstractListModel>\n#include <QString>\n\n// U+2009 THIN SPACE = UTF-8 E2 80 89\n#define REAL_THIN_SP_CP 0x2009\n#define REAL_THIN_SP_UTF8 \"\\xE2\\x80\\x89\"\n#define REAL_THIN_SP_HTML \"&thinsp;\"\n\n// U+200A HAIR SPACE = UTF-8 E2 80 8A\n#define HAIR_SP_CP 0x200A\n#define HAIR_SP_UTF8 \"\\xE2\\x80\\x8A\"\n#define HAIR_SP_HTML \"&#8202;\"\n\n// U+2006 SIX-PER-EM SPACE = UTF-8 E2 80 86\n#define SIXPEREM_SP_CP 0x2006\n#define SIXPEREM_SP_UTF8 \"\\xE2\\x80\\x86\"\n#define SIXPEREM_SP_HTML \"&#8198;\"\n\n// U+2007 FIGURE SPACE = UTF-8 E2 80 87\n#define FIGURE_SP_CP 0x2007\n#define FIGURE_SP_UTF8 \"\\xE2\\x80\\x87\"\n#define FIGURE_SP_HTML \"&#8199;\"\n\n// QMessageBox seems to have a bug whereby it doesn't display thin/hair spaces\n// correctly.  Workaround is to display a space in a small font.  If you\n// change this, please test that it doesn't cause the parent span to start\n// wrapping.\n#define HTML_HACK_SP \"<span style='white-space: nowrap; font-size: 6pt'> </span>\"\n\n// Define THIN_SP_* variables to be our preferred type of thin space\n#define THIN_SP_CP   REAL_THIN_SP_CP\n#define THIN_SP_UTF8 REAL_THIN_SP_UTF8\n#define THIN_SP_HTML HTML_HACK_SP\n\n/** Bitcoin unit definitions. Encapsulates parsing and formatting\n   and serves as list model for drop-down selection boxes.\n*/\nclass BitcoinUnits: public QAbstractListModel\n{\n    Q_OBJECT\n\npublic:\n    explicit BitcoinUnits(QObject *parent);\n\n    /** Bitcoin units.\n      @note Source: https://en.bitcoin.it/wiki/Units . Please add only sensible ones\n     */\n    enum Unit\n    {\n        BTC,\n        mBTC,\n        uBTC\n    };\n\n    enum SeparatorStyle\n    {\n        separatorNever,\n        separatorStandard,\n        separatorAlways\n    };\n\n    //! @name Static API\n    //! Unit conversion and formatting\n    ///@{\n\n    //! Get list of units, for drop-down box\n    static QList<Unit> availableUnits();\n    //! Is unit ID valid?\n    static bool valid(int unit);\n    //! Long name\n    static QString longName(int unit);\n    //! Short name\n    static QString shortName(int unit);\n    //! Longer description\n    static QString description(int unit);\n    //! Number of Satoshis (1e-8) per unit\n    static qint64 factor(int unit);\n    //! Number of decimals left\n    static int decimals(int unit);\n    //! Format as string\n    static QString format(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);\n    //! Format as string (with unit)\n    static QString formatWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);\n    //! Format as HTML string (with unit)\n    static QString formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign=false, SeparatorStyle separators=separatorStandard);\n    //! Parse string to coin amount\n    static bool parse(int unit, const QString &value, CAmount *val_out);\n    //! Gets title for amount column including current display unit if optionsModel reference available */\n    static QString getAmountColumnTitle(int unit);\n    ///@}\n\n    //! @name AbstractListModel implementation\n    //! List model for unit drop-down selection box.\n    ///@{\n    enum RoleIndex {\n        /** Unit identifier */\n        UnitRole = Qt::UserRole\n    };\n    int rowCount(const QModelIndex &parent) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    ///@}\n\n    static QString removeSpaces(QString text)\n    {\n        text.remove(' ');\n        text.remove(QChar(THIN_SP_CP));\n#if (THIN_SP_CP != REAL_THIN_SP_CP)\n        text.remove(QChar(REAL_THIN_SP_CP));\n#endif\n        return text;\n    }\n\n    //! Return maximum number of base units (Satoshis)\n    static CAmount maxMoney();\n\nprivate:\n    QList<BitcoinUnits::Unit> unitlist;\n};\ntypedef BitcoinUnits::Unit BitcoinUnit;\n\n#endif // BITCOIN_QT_BITCOINUNITS_H\n"
  },
  {
    "path": "src/qt/callback.h",
    "content": "#ifndef BITCOIN_QT_CALLBACK_H\n#define BITCOIN_QT_CALLBACK_H\n\n#include <QObject>\n\nclass Callback : public QObject\n{\n    Q_OBJECT\npublic Q_SLOTS:\n    virtual void call() = 0;\n};\n\ntemplate <typename F>\nclass FunctionCallback : public Callback\n{\n    F f;\n\npublic:\n    explicit FunctionCallback(F f_) : f(std::move(f_)) {}\n    ~FunctionCallback() override {}\n    void call() override { f(this); }\n};\n\ntemplate <typename F>\nFunctionCallback<F>* makeCallback(F f)\n{\n    return new FunctionCallback<F>(std::move(f));\n}\n\n#endif // BITCOIN_QT_CALLBACK_H\n"
  },
  {
    "path": "src/qt/clientmodel.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/clientmodel.h>\n\n#include <qt/bantablemodel.h>\n#include <qt/guiconstants.h>\n#include <qt/guiutil.h>\n#include <qt/peertablemodel.h>\n\n#include <chain.h>\n#include <chainparams.h>\n#include <checkpoints.h>\n#include <clientversion.h>\n#include <validation.h>\n#include <net.h>\n#include <txmempool.h>\n#include <ui_interface.h>\n#include <util.h>\n#include <warnings.h>\n\n#include <stdint.h>\n\n#include <QDebug>\n#include <QTimer>\n\nclass CBlockIndex;\n\nstatic int64_t nLastHeaderTipUpdateNotification = 0;\nstatic int64_t nLastBlockTipUpdateNotification = 0;\n\nClientModel::ClientModel(OptionsModel *_optionsModel, QObject *parent) :\n    QObject(parent),\n    optionsModel(_optionsModel),\n    peerTableModel(0),\n    banTableModel(0),\n    pollTimer(0)\n{\n    cachedBestHeaderHeight = -1;\n    cachedBestHeaderTime = -1;\n    peerTableModel = new PeerTableModel(this);\n    banTableModel = new BanTableModel(this);\n    pollTimer = new QTimer(this);\n    connect(pollTimer, SIGNAL(timeout()), this, SLOT(updateTimer()));\n    pollTimer->start(MODEL_UPDATE_DELAY);\n\n    subscribeToCoreSignals();\n}\n\nClientModel::~ClientModel()\n{\n    unsubscribeFromCoreSignals();\n}\n\nint ClientModel::getNumConnections(unsigned int flags) const\n{\n    CConnman::NumConnections connections = CConnman::CONNECTIONS_NONE;\n\n    if(flags == CONNECTIONS_IN)\n        connections = CConnman::CONNECTIONS_IN;\n    else if (flags == CONNECTIONS_OUT)\n        connections = CConnman::CONNECTIONS_OUT;\n    else if (flags == CONNECTIONS_ALL)\n        connections = CConnman::CONNECTIONS_ALL;\n\n    if(g_connman)\n         return g_connman->GetNodeCount(connections);\n    return 0;\n}\n\nint ClientModel::getNumBlocks() const\n{\n    LOCK(cs_main);\n    return chainActive.Height();\n}\n\nint ClientModel::getHeaderTipHeight() const\n{\n    if (cachedBestHeaderHeight == -1) {\n        // make sure we initially populate the cache via a cs_main lock\n        // otherwise we need to wait for a tip update\n        LOCK(cs_main);\n        if (pindexBestHeader) {\n            cachedBestHeaderHeight = pindexBestHeader->nHeight;\n            cachedBestHeaderTime = pindexBestHeader->GetBlockTime();\n        }\n    }\n    return cachedBestHeaderHeight;\n}\n\nint64_t ClientModel::getHeaderTipTime() const\n{\n    if (cachedBestHeaderTime == -1) {\n        LOCK(cs_main);\n        if (pindexBestHeader) {\n            cachedBestHeaderHeight = pindexBestHeader->nHeight;\n            cachedBestHeaderTime = pindexBestHeader->GetBlockTime();\n        }\n    }\n    return cachedBestHeaderTime;\n}\n\nquint64 ClientModel::getTotalBytesRecv() const\n{\n    if(!g_connman)\n        return 0;\n    return g_connman->GetTotalBytesRecv();\n}\n\nquint64 ClientModel::getTotalBytesSent() const\n{\n    if(!g_connman)\n        return 0;\n    return g_connman->GetTotalBytesSent();\n}\n\nQDateTime ClientModel::getLastBlockDate() const\n{\n    LOCK(cs_main);\n\n    if (chainActive.Tip())\n        return QDateTime::fromTime_t(chainActive.Tip()->GetBlockTime());\n\n    return QDateTime::fromTime_t(Params().GenesisBlock().GetBlockTime()); // Genesis block's time of current network\n}\n\nlong ClientModel::getMempoolSize() const\n{\n    return mempool.size();\n}\n\nsize_t ClientModel::getMempoolDynamicUsage() const\n{\n    return mempool.DynamicMemoryUsage();\n}\n\ndouble ClientModel::getVerificationProgress(const CBlockIndex *tipIn) const\n{\n    CBlockIndex *tip = const_cast<CBlockIndex *>(tipIn);\n    if (!tip)\n    {\n        LOCK(cs_main);\n        tip = chainActive.Tip();\n    }\n    return GuessVerificationProgress(Params().TxData(), tip);\n}\n\nvoid ClientModel::updateTimer()\n{\n    // no locking required at this point\n    // the following calls will acquire the required lock\n    Q_EMIT mempoolSizeChanged(getMempoolSize(), getMempoolDynamicUsage());\n    Q_EMIT bytesChanged(getTotalBytesRecv(), getTotalBytesSent());\n}\n\nvoid ClientModel::updateNumConnections(int numConnections)\n{\n    Q_EMIT numConnectionsChanged(numConnections);\n}\n\nvoid ClientModel::updateNetworkActive(bool networkActive)\n{\n    Q_EMIT networkActiveChanged(networkActive);\n}\n\nvoid ClientModel::updateAlert()\n{\n    Q_EMIT alertsChanged(getStatusBarWarnings());\n}\n\nbool ClientModel::inInitialBlockDownload() const\n{\n    return IsInitialBlockDownload();\n}\n\nenum BlockSource ClientModel::getBlockSource() const\n{\n    if (fReindex)\n        return BLOCK_SOURCE_REINDEX;\n    else if (fImporting)\n        return BLOCK_SOURCE_DISK;\n    else if (getNumConnections() > 0)\n        return BLOCK_SOURCE_NETWORK;\n\n    return BLOCK_SOURCE_NONE;\n}\n\nvoid ClientModel::setNetworkActive(bool active)\n{\n    if (g_connman) {\n         g_connman->SetNetworkActive(active);\n    }\n}\n\nbool ClientModel::getNetworkActive() const\n{\n    if (g_connman) {\n        return g_connman->GetNetworkActive();\n    }\n    return false;\n}\n\nQString ClientModel::getStatusBarWarnings() const\n{\n    return QString::fromStdString(GetWarnings(\"gui\"));\n}\n\nOptionsModel *ClientModel::getOptionsModel()\n{\n    return optionsModel;\n}\n\nPeerTableModel *ClientModel::getPeerTableModel()\n{\n    return peerTableModel;\n}\n\nBanTableModel *ClientModel::getBanTableModel()\n{\n    return banTableModel;\n}\n\nQString ClientModel::formatFullVersion() const\n{\n    return QString::fromStdString(FormatFullVersion());\n}\n\nQString ClientModel::formatSubVersion() const\n{\n    return QString::fromStdString(strSubVersion);\n}\n\nbool ClientModel::isReleaseVersion() const\n{\n    return CLIENT_VERSION_IS_RELEASE;\n}\n\nQString ClientModel::formatClientStartupTime() const\n{\n    return QDateTime::fromTime_t(GetStartupTime()).toString();\n}\n\nQString ClientModel::dataDir() const\n{\n    return GUIUtil::boostPathToQString(GetDataDir());\n}\n\nvoid ClientModel::updateBanlist()\n{\n    banTableModel->refresh();\n}\n\n// Handlers for core signals\nstatic void ShowProgress(ClientModel *clientmodel, const std::string &title, int nProgress)\n{\n    // emits signal \"showProgress\"\n    QMetaObject::invokeMethod(clientmodel, \"showProgress\", Qt::QueuedConnection,\n                              Q_ARG(QString, QString::fromStdString(title)),\n                              Q_ARG(int, nProgress));\n}\n\nstatic void NotifyNumConnectionsChanged(ClientModel *clientmodel, int newNumConnections)\n{\n    // Too noisy: qDebug() << \"NotifyNumConnectionsChanged: \" + QString::number(newNumConnections);\n    QMetaObject::invokeMethod(clientmodel, \"updateNumConnections\", Qt::QueuedConnection,\n                              Q_ARG(int, newNumConnections));\n}\n\nstatic void NotifyNetworkActiveChanged(ClientModel *clientmodel, bool networkActive)\n{\n    QMetaObject::invokeMethod(clientmodel, \"updateNetworkActive\", Qt::QueuedConnection,\n                              Q_ARG(bool, networkActive));\n}\n\nstatic void NotifyAlertChanged(ClientModel *clientmodel)\n{\n    qDebug() << \"NotifyAlertChanged\";\n    QMetaObject::invokeMethod(clientmodel, \"updateAlert\", Qt::QueuedConnection);\n}\n\nstatic void BannedListChanged(ClientModel *clientmodel)\n{\n    qDebug() << QString(\"%1: Requesting update for peer banlist\").arg(__func__);\n    QMetaObject::invokeMethod(clientmodel, \"updateBanlist\", Qt::QueuedConnection);\n}\n\nstatic void BlockTipChanged(ClientModel *clientmodel, bool initialSync, const CBlockIndex *pIndex, bool fHeader)\n{\n    // lock free async UI updates in case we have a new block tip\n    // during initial sync, only update the UI if the last update\n    // was > 250ms (MODEL_UPDATE_DELAY) ago\n    int64_t now = 0;\n    if (initialSync)\n        now = GetTimeMillis();\n\n    int64_t& nLastUpdateNotification = fHeader ? nLastHeaderTipUpdateNotification : nLastBlockTipUpdateNotification;\n\n    if (fHeader) {\n        // cache best headers time and height to reduce future cs_main locks\n        clientmodel->cachedBestHeaderHeight = pIndex->nHeight;\n        clientmodel->cachedBestHeaderTime = pIndex->GetBlockTime();\n    }\n    // if we are in-sync, update the UI regardless of last update time\n    if (!initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {\n        //pass an async signal to the UI thread\n        QMetaObject::invokeMethod(clientmodel, \"numBlocksChanged\", Qt::QueuedConnection,\n                                  Q_ARG(int, pIndex->nHeight),\n                                  Q_ARG(QDateTime, QDateTime::fromTime_t(pIndex->GetBlockTime())),\n                                  Q_ARG(double, clientmodel->getVerificationProgress(pIndex)),\n                                  Q_ARG(bool, fHeader));\n        nLastUpdateNotification = now;\n    }\n}\n\nvoid ClientModel::subscribeToCoreSignals()\n{\n    // Connect signals to client\n    uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2));\n    uiInterface.NotifyNumConnectionsChanged.connect(boost::bind(NotifyNumConnectionsChanged, this, _1));\n    uiInterface.NotifyNetworkActiveChanged.connect(boost::bind(NotifyNetworkActiveChanged, this, _1));\n    uiInterface.NotifyAlertChanged.connect(boost::bind(NotifyAlertChanged, this));\n    uiInterface.BannedListChanged.connect(boost::bind(BannedListChanged, this));\n    uiInterface.NotifyBlockTip.connect(boost::bind(BlockTipChanged, this, _1, _2, false));\n    uiInterface.NotifyHeaderTip.connect(boost::bind(BlockTipChanged, this, _1, _2, true));\n}\n\nvoid ClientModel::unsubscribeFromCoreSignals()\n{\n    // Disconnect signals from client\n    uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2));\n    uiInterface.NotifyNumConnectionsChanged.disconnect(boost::bind(NotifyNumConnectionsChanged, this, _1));\n    uiInterface.NotifyNetworkActiveChanged.disconnect(boost::bind(NotifyNetworkActiveChanged, this, _1));\n    uiInterface.NotifyAlertChanged.disconnect(boost::bind(NotifyAlertChanged, this));\n    uiInterface.BannedListChanged.disconnect(boost::bind(BannedListChanged, this));\n    uiInterface.NotifyBlockTip.disconnect(boost::bind(BlockTipChanged, this, _1, _2, false));\n    uiInterface.NotifyHeaderTip.disconnect(boost::bind(BlockTipChanged, this, _1, _2, true));\n}\n"
  },
  {
    "path": "src/qt/clientmodel.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_CLIENTMODEL_H\n#define BITCOIN_QT_CLIENTMODEL_H\n\n#include <QObject>\n#include <QDateTime>\n\n#include <atomic>\n\nclass BanTableModel;\nclass OptionsModel;\nclass PeerTableModel;\n\nclass CBlockIndex;\n\nQT_BEGIN_NAMESPACE\nclass QTimer;\nQT_END_NAMESPACE\n\nenum BlockSource {\n    BLOCK_SOURCE_NONE,\n    BLOCK_SOURCE_REINDEX,\n    BLOCK_SOURCE_DISK,\n    BLOCK_SOURCE_NETWORK\n};\n\nenum NumConnections {\n    CONNECTIONS_NONE = 0,\n    CONNECTIONS_IN   = (1U << 0),\n    CONNECTIONS_OUT  = (1U << 1),\n    CONNECTIONS_ALL  = (CONNECTIONS_IN | CONNECTIONS_OUT),\n};\n\n/** Model for Bitcoin network client. */\nclass ClientModel : public QObject\n{\n    Q_OBJECT\n\npublic:\n    explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0);\n    ~ClientModel();\n\n    OptionsModel *getOptionsModel();\n    PeerTableModel *getPeerTableModel();\n    BanTableModel *getBanTableModel();\n\n    //! Return number of connections, default is in- and outbound (total)\n    int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const;\n    int getNumBlocks() const;\n    int getHeaderTipHeight() const;\n    int64_t getHeaderTipTime() const;\n    //! Return number of transactions in the mempool\n    long getMempoolSize() const;\n    //! Return the dynamic memory usage of the mempool\n    size_t getMempoolDynamicUsage() const;\n    \n    quint64 getTotalBytesRecv() const;\n    quint64 getTotalBytesSent() const;\n\n    double getVerificationProgress(const CBlockIndex *tip) const;\n    QDateTime getLastBlockDate() const;\n\n    //! Return true if core is doing initial block download\n    bool inInitialBlockDownload() const;\n    //! Returns enum BlockSource of the current importing/syncing state\n    enum BlockSource getBlockSource() const;\n    //! Return true if network activity in core is enabled\n    bool getNetworkActive() const;\n    //! Toggle network activity state in core\n    void setNetworkActive(bool active);\n    //! Return warnings to be displayed in status bar\n    QString getStatusBarWarnings() const;\n\n    QString formatFullVersion() const;\n    QString formatSubVersion() const;\n    bool isReleaseVersion() const;\n    QString formatClientStartupTime() const;\n    QString dataDir() const;\n\n    // caches for the best header\n    mutable std::atomic<int> cachedBestHeaderHeight;\n    mutable std::atomic<int64_t> cachedBestHeaderTime;\n\nprivate:\n    OptionsModel *optionsModel;\n    PeerTableModel *peerTableModel;\n    BanTableModel *banTableModel;\n\n    QTimer *pollTimer;\n\n    void subscribeToCoreSignals();\n    void unsubscribeFromCoreSignals();\n\nQ_SIGNALS:\n    void numConnectionsChanged(int count);\n    void numBlocksChanged(int count, const QDateTime& blockDate, double nVerificationProgress, bool header);\n    void mempoolSizeChanged(long count, size_t mempoolSizeInBytes);\n    void networkActiveChanged(bool networkActive);\n    void alertsChanged(const QString &warnings);\n    void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut);\n\n    //! Fired when a message should be reported to the user\n    void message(const QString &title, const QString &message, unsigned int style);\n\n    // Show progress dialog e.g. for verifychain\n    void showProgress(const QString &title, int nProgress);\n\npublic Q_SLOTS:\n    void updateTimer();\n    void updateNumConnections(int numConnections);\n    void updateNetworkActive(bool networkActive);\n    void updateAlert();\n    void updateBanlist();\n};\n\n#endif // BITCOIN_QT_CLIENTMODEL_H\n"
  },
  {
    "path": "src/qt/coincontroldialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/coincontroldialog.h>\n#include <qt/forms/ui_coincontroldialog.h>\n\n#include <qt/addresstablemodel.h>\n#include <qt/bitcoinunits.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n#include <qt/platformstyle.h>\n#include <txmempool.h>\n#include <qt/walletmodel.h>\n\n#include <wallet/coincontrol.h>\n#include <init.h>\n#include <policy/fees.h>\n#include <policy/policy.h>\n#include <validation.h> // For mempool\n#include <wallet/fees.h>\n#include <wallet/wallet.h>\n\n#include <QApplication>\n#include <QCheckBox>\n#include <QCursor>\n#include <QDialogButtonBox>\n#include <QFlags>\n#include <QIcon>\n#include <QSettings>\n#include <QTreeWidget>\n\nQList<CAmount> CoinControlDialog::payAmounts;\nbool CoinControlDialog::fSubtractFeeFromAmount = false;\n\nbool CCoinControlWidgetItem::operator<(const QTreeWidgetItem &other) const {\n    int column = treeWidget()->sortColumn();\n    if (column == CoinControlDialog::COLUMN_AMOUNT || column == CoinControlDialog::COLUMN_DATE || column == CoinControlDialog::COLUMN_CONFIRMATIONS)\n        return data(column, Qt::UserRole).toLongLong() < other.data(column, Qt::UserRole).toLongLong();\n    return QTreeWidgetItem::operator<(other);\n}\n\nCoinControlDialog::CoinControlDialog(const PlatformStyle *_platformStyle, QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::CoinControlDialog),\n    model(0),\n    platformStyle(_platformStyle)\n{\n    ui->setupUi(this);\n\n    // context menu actions\n    QAction *copyAddressAction = new QAction(tr(\"Copy address\"), this);\n    QAction *copyLabelAction = new QAction(tr(\"Copy label\"), this);\n    QAction *copyAmountAction = new QAction(tr(\"Copy amount\"), this);\n             copyTransactionHashAction = new QAction(tr(\"Copy transaction ID\"), this);  // we need to enable/disable this\n             lockAction = new QAction(tr(\"Lock unspent\"), this);                        // we need to enable/disable this\n             unlockAction = new QAction(tr(\"Unlock unspent\"), this);                    // we need to enable/disable this\n\n    // context menu\n    contextMenu = new QMenu(this);\n    contextMenu->addAction(copyAddressAction);\n    contextMenu->addAction(copyLabelAction);\n    contextMenu->addAction(copyAmountAction);\n    contextMenu->addAction(copyTransactionHashAction);\n    contextMenu->addSeparator();\n    contextMenu->addAction(lockAction);\n    contextMenu->addAction(unlockAction);\n\n    // context menu signals\n    connect(ui->treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showMenu(QPoint)));\n    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));\n    connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));\n    connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));\n    connect(copyTransactionHashAction, SIGNAL(triggered()), this, SLOT(copyTransactionHash()));\n    connect(lockAction, SIGNAL(triggered()), this, SLOT(lockCoin()));\n    connect(unlockAction, SIGNAL(triggered()), this, SLOT(unlockCoin()));\n\n    // clipboard actions\n    QAction *clipboardQuantityAction = new QAction(tr(\"Copy quantity\"), this);\n    QAction *clipboardAmountAction = new QAction(tr(\"Copy amount\"), this);\n    QAction *clipboardFeeAction = new QAction(tr(\"Copy fee\"), this);\n    QAction *clipboardAfterFeeAction = new QAction(tr(\"Copy after fee\"), this);\n    QAction *clipboardBytesAction = new QAction(tr(\"Copy bytes\"), this);\n    QAction *clipboardLowOutputAction = new QAction(tr(\"Copy dust\"), this);\n    QAction *clipboardChangeAction = new QAction(tr(\"Copy change\"), this);\n\n    connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(clipboardQuantity()));\n    connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(clipboardAmount()));\n    connect(clipboardFeeAction, SIGNAL(triggered()), this, SLOT(clipboardFee()));\n    connect(clipboardAfterFeeAction, SIGNAL(triggered()), this, SLOT(clipboardAfterFee()));\n    connect(clipboardBytesAction, SIGNAL(triggered()), this, SLOT(clipboardBytes()));\n    connect(clipboardLowOutputAction, SIGNAL(triggered()), this, SLOT(clipboardLowOutput()));\n    connect(clipboardChangeAction, SIGNAL(triggered()), this, SLOT(clipboardChange()));\n\n    ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);\n    ui->labelCoinControlAmount->addAction(clipboardAmountAction);\n    ui->labelCoinControlFee->addAction(clipboardFeeAction);\n    ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);\n    ui->labelCoinControlBytes->addAction(clipboardBytesAction);\n    ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);\n    ui->labelCoinControlChange->addAction(clipboardChangeAction);\n\n    // toggle tree/list mode\n    connect(ui->radioTreeMode, SIGNAL(toggled(bool)), this, SLOT(radioTreeMode(bool)));\n    connect(ui->radioListMode, SIGNAL(toggled(bool)), this, SLOT(radioListMode(bool)));\n\n    // click on checkbox\n    connect(ui->treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(viewItemChanged(QTreeWidgetItem*, int)));\n\n    // click on header\n#if QT_VERSION < 0x050000\n    ui->treeWidget->header()->setClickable(true);\n#else\n    ui->treeWidget->header()->setSectionsClickable(true);\n#endif\n    connect(ui->treeWidget->header(), SIGNAL(sectionClicked(int)), this, SLOT(headerSectionClicked(int)));\n\n    // ok button\n    connect(ui->buttonBox, SIGNAL(clicked( QAbstractButton*)), this, SLOT(buttonBoxClicked(QAbstractButton*)));\n\n    // (un)select all\n    connect(ui->pushButtonSelectAll, SIGNAL(clicked()), this, SLOT(buttonSelectAllClicked()));\n\n    // change coin control first column label due Qt4 bug.\n    // see https://github.com/bitcoin/bitcoin/issues/5716\n    ui->treeWidget->headerItem()->setText(COLUMN_CHECKBOX, QString());\n\n    ui->treeWidget->setColumnWidth(COLUMN_CHECKBOX, 84);\n    ui->treeWidget->setColumnWidth(COLUMN_AMOUNT, 110);\n    ui->treeWidget->setColumnWidth(COLUMN_LABEL, 190);\n    ui->treeWidget->setColumnWidth(COLUMN_ADDRESS, 320);\n    ui->treeWidget->setColumnWidth(COLUMN_DATE, 130);\n    ui->treeWidget->setColumnWidth(COLUMN_CONFIRMATIONS, 110);\n    ui->treeWidget->setColumnHidden(COLUMN_TXHASH, true);         // store transaction hash in this column, but don't show it\n    ui->treeWidget->setColumnHidden(COLUMN_VOUT_INDEX, true);     // store vout index in this column, but don't show it\n\n    // default view is sorted by amount desc\n    sortView(COLUMN_AMOUNT, Qt::DescendingOrder);\n\n    // restore list mode and sortorder as a convenience feature\n    QSettings settings;\n    if (settings.contains(\"nCoinControlMode\") && !settings.value(\"nCoinControlMode\").toBool())\n        ui->radioTreeMode->click();\n    if (settings.contains(\"nCoinControlSortColumn\") && settings.contains(\"nCoinControlSortOrder\"))\n        sortView(settings.value(\"nCoinControlSortColumn\").toInt(), ((Qt::SortOrder)settings.value(\"nCoinControlSortOrder\").toInt()));\n}\n\nCoinControlDialog::~CoinControlDialog()\n{\n    QSettings settings;\n    settings.setValue(\"nCoinControlMode\", ui->radioListMode->isChecked());\n    settings.setValue(\"nCoinControlSortColumn\", sortColumn);\n    settings.setValue(\"nCoinControlSortOrder\", (int)sortOrder);\n\n    delete ui;\n}\n\nvoid CoinControlDialog::setModel(WalletModel *_model)\n{\n    this->model = _model;\n\n    if(_model && _model->getOptionsModel() && _model->getAddressTableModel())\n    {\n        updateView();\n        updateLabelLocked();\n        CoinControlDialog::updateLabels(_model, this);\n    }\n}\n\n// ok button\nvoid CoinControlDialog::buttonBoxClicked(QAbstractButton* button)\n{\n    if (ui->buttonBox->buttonRole(button) == QDialogButtonBox::AcceptRole)\n        done(QDialog::Accepted); // closes the dialog\n}\n\n// (un)select all\nvoid CoinControlDialog::buttonSelectAllClicked()\n{\n    Qt::CheckState state = Qt::Checked;\n    for (int i = 0; i < ui->treeWidget->topLevelItemCount(); i++)\n    {\n        if (ui->treeWidget->topLevelItem(i)->checkState(COLUMN_CHECKBOX) != Qt::Unchecked)\n        {\n            state = Qt::Unchecked;\n            break;\n        }\n    }\n    ui->treeWidget->setEnabled(false);\n    for (int i = 0; i < ui->treeWidget->topLevelItemCount(); i++)\n            if (ui->treeWidget->topLevelItem(i)->checkState(COLUMN_CHECKBOX) != state)\n                ui->treeWidget->topLevelItem(i)->setCheckState(COLUMN_CHECKBOX, state);\n    ui->treeWidget->setEnabled(true);\n    if (state == Qt::Unchecked)\n        coinControl()->UnSelectAll(); // just to be sure\n    CoinControlDialog::updateLabels(model, this);\n}\n\n// context menu\nvoid CoinControlDialog::showMenu(const QPoint &point)\n{\n    QTreeWidgetItem *item = ui->treeWidget->itemAt(point);\n    if(item)\n    {\n        contextMenuItem = item;\n\n        // disable some items (like Copy Transaction ID, lock, unlock) for tree roots in context menu\n        if (item->text(COLUMN_TXHASH).length() == 64) // transaction hash is 64 characters (this means its a child node, so its not a parent node in tree mode)\n        {\n            copyTransactionHashAction->setEnabled(true);\n            if (model->isLockedCoin(uint256S(item->text(COLUMN_TXHASH).toStdString()), item->text(COLUMN_VOUT_INDEX).toUInt()))\n            {\n                lockAction->setEnabled(false);\n                unlockAction->setEnabled(true);\n            }\n            else\n            {\n                lockAction->setEnabled(true);\n                unlockAction->setEnabled(false);\n            }\n        }\n        else // this means click on parent node in tree mode -> disable all\n        {\n            copyTransactionHashAction->setEnabled(false);\n            lockAction->setEnabled(false);\n            unlockAction->setEnabled(false);\n        }\n\n        // show context menu\n        contextMenu->exec(QCursor::pos());\n    }\n}\n\n// context menu action: copy amount\nvoid CoinControlDialog::copyAmount()\n{\n    GUIUtil::setClipboard(BitcoinUnits::removeSpaces(contextMenuItem->text(COLUMN_AMOUNT)));\n}\n\n// context menu action: copy label\nvoid CoinControlDialog::copyLabel()\n{\n    if (ui->radioTreeMode->isChecked() && contextMenuItem->text(COLUMN_LABEL).length() == 0 && contextMenuItem->parent())\n        GUIUtil::setClipboard(contextMenuItem->parent()->text(COLUMN_LABEL));\n    else\n        GUIUtil::setClipboard(contextMenuItem->text(COLUMN_LABEL));\n}\n\n// context menu action: copy address\nvoid CoinControlDialog::copyAddress()\n{\n    if (ui->radioTreeMode->isChecked() && contextMenuItem->text(COLUMN_ADDRESS).length() == 0 && contextMenuItem->parent())\n        GUIUtil::setClipboard(contextMenuItem->parent()->text(COLUMN_ADDRESS));\n    else\n        GUIUtil::setClipboard(contextMenuItem->text(COLUMN_ADDRESS));\n}\n\n// context menu action: copy transaction id\nvoid CoinControlDialog::copyTransactionHash()\n{\n    GUIUtil::setClipboard(contextMenuItem->text(COLUMN_TXHASH));\n}\n\n// context menu action: lock coin\nvoid CoinControlDialog::lockCoin()\n{\n    if (contextMenuItem->checkState(COLUMN_CHECKBOX) == Qt::Checked)\n        contextMenuItem->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);\n\n    COutPoint outpt(uint256S(contextMenuItem->text(COLUMN_TXHASH).toStdString()), contextMenuItem->text(COLUMN_VOUT_INDEX).toUInt());\n    model->lockCoin(outpt);\n    contextMenuItem->setDisabled(true);\n    contextMenuItem->setIcon(COLUMN_CHECKBOX, platformStyle->SingleColorIcon(\":/icons/lock_closed\"));\n    updateLabelLocked();\n}\n\n// context menu action: unlock coin\nvoid CoinControlDialog::unlockCoin()\n{\n    COutPoint outpt(uint256S(contextMenuItem->text(COLUMN_TXHASH).toStdString()), contextMenuItem->text(COLUMN_VOUT_INDEX).toUInt());\n    model->unlockCoin(outpt);\n    contextMenuItem->setDisabled(false);\n    contextMenuItem->setIcon(COLUMN_CHECKBOX, QIcon());\n    updateLabelLocked();\n}\n\n// copy label \"Quantity\" to clipboard\nvoid CoinControlDialog::clipboardQuantity()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlQuantity->text());\n}\n\n// copy label \"Amount\" to clipboard\nvoid CoinControlDialog::clipboardAmount()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlAmount->text().left(ui->labelCoinControlAmount->text().indexOf(\" \")));\n}\n\n// copy label \"Fee\" to clipboard\nvoid CoinControlDialog::clipboardFee()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(\" \")).replace(ASYMP_UTF8, \"\"));\n}\n\n// copy label \"After fee\" to clipboard\nvoid CoinControlDialog::clipboardAfterFee()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlAfterFee->text().left(ui->labelCoinControlAfterFee->text().indexOf(\" \")).replace(ASYMP_UTF8, \"\"));\n}\n\n// copy label \"Bytes\" to clipboard\nvoid CoinControlDialog::clipboardBytes()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlBytes->text().replace(ASYMP_UTF8, \"\"));\n}\n\n// copy label \"Dust\" to clipboard\nvoid CoinControlDialog::clipboardLowOutput()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());\n}\n\n// copy label \"Change\" to clipboard\nvoid CoinControlDialog::clipboardChange()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlChange->text().left(ui->labelCoinControlChange->text().indexOf(\" \")).replace(ASYMP_UTF8, \"\"));\n}\n\n// treeview: sort\nvoid CoinControlDialog::sortView(int column, Qt::SortOrder order)\n{\n    sortColumn = column;\n    sortOrder = order;\n    ui->treeWidget->sortItems(column, order);\n    ui->treeWidget->header()->setSortIndicator(sortColumn, sortOrder);\n}\n\n// treeview: clicked on header\nvoid CoinControlDialog::headerSectionClicked(int logicalIndex)\n{\n    if (logicalIndex == COLUMN_CHECKBOX) // click on most left column -> do nothing\n    {\n        ui->treeWidget->header()->setSortIndicator(sortColumn, sortOrder);\n    }\n    else\n    {\n        if (sortColumn == logicalIndex)\n            sortOrder = ((sortOrder == Qt::AscendingOrder) ? Qt::DescendingOrder : Qt::AscendingOrder);\n        else\n        {\n            sortColumn = logicalIndex;\n            sortOrder = ((sortColumn == COLUMN_LABEL || sortColumn == COLUMN_ADDRESS) ? Qt::AscendingOrder : Qt::DescendingOrder); // if label or address then default => asc, else default => desc\n        }\n\n        sortView(sortColumn, sortOrder);\n    }\n}\n\n// toggle tree mode\nvoid CoinControlDialog::radioTreeMode(bool checked)\n{\n    if (checked && model)\n        updateView();\n}\n\n// toggle list mode\nvoid CoinControlDialog::radioListMode(bool checked)\n{\n    if (checked && model)\n        updateView();\n}\n\n// checkbox clicked by user\nvoid CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column)\n{\n    if (column == COLUMN_CHECKBOX && item->text(COLUMN_TXHASH).length() == 64) // transaction hash is 64 characters (this means its a child node, so its not a parent node in tree mode)\n    {\n        COutPoint outpt(uint256S(item->text(COLUMN_TXHASH).toStdString()), item->text(COLUMN_VOUT_INDEX).toUInt());\n\n        if (item->checkState(COLUMN_CHECKBOX) == Qt::Unchecked)\n            coinControl()->UnSelect(outpt);\n        else if (item->isDisabled()) // locked (this happens if \"check all\" through parent node)\n            item->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);\n        else\n            coinControl()->Select(outpt);\n\n        // selection changed -> update labels\n        if (ui->treeWidget->isEnabled()) // do not update on every click for (un)select all\n            CoinControlDialog::updateLabels(model, this);\n    }\n\n    // TODO: Remove this temporary qt5 fix after Qt5.3 and Qt5.4 are no longer used.\n    //       Fixed in Qt5.5 and above: https://bugreports.qt.io/browse/QTBUG-43473\n#if QT_VERSION >= 0x050000\n    else if (column == COLUMN_CHECKBOX && item->childCount() > 0)\n    {\n        if (item->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked && item->child(0)->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked)\n            item->setCheckState(COLUMN_CHECKBOX, Qt::Checked);\n    }\n#endif\n}\n\n// shows count of locked unspent outputs\nvoid CoinControlDialog::updateLabelLocked()\n{\n    std::vector<COutPoint> vOutpts;\n    model->listLockedCoins(vOutpts);\n    if (vOutpts.size() > 0)\n    {\n       ui->labelLocked->setText(tr(\"(%1 locked)\").arg(vOutpts.size()));\n       ui->labelLocked->setVisible(true);\n    }\n    else ui->labelLocked->setVisible(false);\n}\n\nvoid CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)\n{\n    if (!model)\n        return;\n\n    // nPayAmount\n    CAmount nPayAmount = 0;\n    bool fDust = false;\n    CMutableTransaction txDummy;\n    for (const CAmount &amount : CoinControlDialog::payAmounts)\n    {\n        nPayAmount += amount;\n\n        if (amount > 0)\n        {\n            CTxOut txout(amount, (CScript)std::vector<unsigned char>(24, 0));\n            txDummy.vout.push_back(txout);\n            fDust |= IsDust(txout, ::dustRelayFee);\n        }\n    }\n\n    CAmount nAmount             = 0;\n    CAmount nPayFee             = 0;\n    CAmount nAfterFee           = 0;\n    CAmount nChange             = 0;\n    unsigned int nBytes         = 0;\n    unsigned int nBytesInputs   = 0;\n    unsigned int nQuantity      = 0;\n    bool fWitness               = false;\n\n    std::vector<COutPoint> vCoinControl;\n    std::vector<COutput>   vOutputs;\n    coinControl()->ListSelected(vCoinControl);\n    model->getOutputs(vCoinControl, vOutputs);\n\n    for (const COutput& out : vOutputs) {\n        // unselect already spent, very unlikely scenario, this could happen\n        // when selected are spent elsewhere, like rpc or another computer\n        uint256 txhash = out.tx->GetHash();\n        COutPoint outpt(txhash, out.i);\n        if (model->isSpent(outpt))\n        {\n            coinControl()->UnSelect(outpt);\n            continue;\n        }\n\n        // Quantity\n        nQuantity++;\n\n        // Amount\n        nAmount += out.tx->tx->vout[out.i].nValue;\n\n        // Bytes\n        CTxDestination address;\n        int witnessversion = 0;\n        std::vector<unsigned char> witnessprogram;\n        if (out.tx->tx->vout[out.i].scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram))\n        {\n            nBytesInputs += (32 + 4 + 1 + (107 / WITNESS_SCALE_FACTOR) + 4);\n            fWitness = true;\n        }\n        else if(ExtractDestination(out.tx->tx->vout[out.i].scriptPubKey, address))\n        {\n            CPubKey pubkey;\n            CKeyID *keyid = boost::get<CKeyID>(&address);\n            if (keyid && model->getPubKey(*keyid, pubkey))\n            {\n                nBytesInputs += (pubkey.IsCompressed() ? 148 : 180);\n            }\n            else\n                nBytesInputs += 148; // in all error cases, simply assume 148 here\n        }\n        else nBytesInputs += 148;\n    }\n\n    // calculation\n    if (nQuantity > 0)\n    {\n        // Bytes\n        nBytes = nBytesInputs + ((CoinControlDialog::payAmounts.size() > 0 ? CoinControlDialog::payAmounts.size() + 1 : 2) * 34) + 10; // always assume +1 output for change here\n        if (fWitness)\n        {\n            // there is some fudging in these numbers related to the actual virtual transaction size calculation that will keep this estimate from being exact.\n            // usually, the result will be an overestimate within a couple of satoshis so that the confirmation dialog ends up displaying a slightly smaller fee.\n            // also, the witness stack size value is a variable sized integer. usually, the number of stack items will be well under the single byte var int limit.\n            nBytes += 2; // account for the serialized marker and flag bytes\n            nBytes += nQuantity; // account for the witness byte that holds the number of stack items for each input.\n        }\n\n        // in the subtract fee from amount case, we can tell if zero change already and subtract the bytes, so that fee calculation afterwards is accurate\n        if (CoinControlDialog::fSubtractFeeFromAmount)\n            if (nAmount - nPayAmount == 0)\n                nBytes -= 34;\n\n        // Fee\n        nPayFee = GetMinimumFee(nBytes, *coinControl(), ::mempool, ::feeEstimator, nullptr /* FeeCalculation */);\n\n        if (nPayAmount > 0)\n        {\n            nChange = nAmount - nPayAmount;\n            if (!CoinControlDialog::fSubtractFeeFromAmount)\n                nChange -= nPayFee;\n\n            // Never create dust outputs; if we would, just add the dust to the fee.\n            if (nChange > 0 && nChange < MIN_CHANGE)\n            {\n                CTxOut txout(nChange, (CScript)std::vector<unsigned char>(24, 0));\n                if (IsDust(txout, ::dustRelayFee))\n                {\n                    nPayFee += nChange;\n                    nChange = 0;\n                    if (CoinControlDialog::fSubtractFeeFromAmount)\n                        nBytes -= 34; // we didn't detect lack of change above\n                }\n            }\n\n            if (nChange == 0 && !CoinControlDialog::fSubtractFeeFromAmount)\n                nBytes -= 34;\n        }\n\n        // after fee\n        nAfterFee = std::max<CAmount>(nAmount - nPayFee, 0);\n    }\n\n    // actually update labels\n    int nDisplayUnit = BitcoinUnits::BTC;\n    if (model && model->getOptionsModel())\n        nDisplayUnit = model->getOptionsModel()->getDisplayUnit();\n\n    QLabel *l1 = dialog->findChild<QLabel *>(\"labelCoinControlQuantity\");\n    QLabel *l2 = dialog->findChild<QLabel *>(\"labelCoinControlAmount\");\n    QLabel *l3 = dialog->findChild<QLabel *>(\"labelCoinControlFee\");\n    QLabel *l4 = dialog->findChild<QLabel *>(\"labelCoinControlAfterFee\");\n    QLabel *l5 = dialog->findChild<QLabel *>(\"labelCoinControlBytes\");\n    QLabel *l7 = dialog->findChild<QLabel *>(\"labelCoinControlLowOutput\");\n    QLabel *l8 = dialog->findChild<QLabel *>(\"labelCoinControlChange\");\n\n    // enable/disable \"dust\" and \"change\"\n    dialog->findChild<QLabel *>(\"labelCoinControlLowOutputText\")->setEnabled(nPayAmount > 0);\n    dialog->findChild<QLabel *>(\"labelCoinControlLowOutput\")    ->setEnabled(nPayAmount > 0);\n    dialog->findChild<QLabel *>(\"labelCoinControlChangeText\")   ->setEnabled(nPayAmount > 0);\n    dialog->findChild<QLabel *>(\"labelCoinControlChange\")       ->setEnabled(nPayAmount > 0);\n\n    // stats\n    l1->setText(QString::number(nQuantity));                                 // Quantity\n    l2->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAmount));        // Amount\n    l3->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nPayFee));        // Fee\n    l4->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nAfterFee));      // After Fee\n    l5->setText(((nBytes > 0) ? ASYMP_UTF8 : \"\") + QString::number(nBytes));        // Bytes\n    l7->setText(fDust ? tr(\"yes\") : tr(\"no\"));                               // Dust\n    l8->setText(BitcoinUnits::formatWithUnit(nDisplayUnit, nChange));        // Change\n    if (nPayFee > 0)\n    {\n        l3->setText(ASYMP_UTF8 + l3->text());\n        l4->setText(ASYMP_UTF8 + l4->text());\n        if (nChange > 0 && !CoinControlDialog::fSubtractFeeFromAmount)\n            l8->setText(ASYMP_UTF8 + l8->text());\n    }\n\n    // turn label red when dust\n    l7->setStyleSheet((fDust) ? \"color:red;\" : \"\");\n\n    // tool tips\n    QString toolTipDust = tr(\"This label turns red if any recipient receives an amount smaller than the current dust threshold.\");\n\n    // how many satoshis the estimated fee can vary per byte we guess wrong\n    double dFeeVary = (nBytes != 0) ? (double)nPayFee / nBytes : 0;\n\n    QString toolTip4 = tr(\"Can vary +/- %1 satoshi(s) per input.\").arg(dFeeVary);\n\n    l3->setToolTip(toolTip4);\n    l4->setToolTip(toolTip4);\n    l7->setToolTip(toolTipDust);\n    l8->setToolTip(toolTip4);\n    dialog->findChild<QLabel *>(\"labelCoinControlFeeText\")      ->setToolTip(l3->toolTip());\n    dialog->findChild<QLabel *>(\"labelCoinControlAfterFeeText\") ->setToolTip(l4->toolTip());\n    dialog->findChild<QLabel *>(\"labelCoinControlBytesText\")    ->setToolTip(l5->toolTip());\n    dialog->findChild<QLabel *>(\"labelCoinControlLowOutputText\")->setToolTip(l7->toolTip());\n    dialog->findChild<QLabel *>(\"labelCoinControlChangeText\")   ->setToolTip(l8->toolTip());\n\n    // Insufficient funds\n    QLabel *label = dialog->findChild<QLabel *>(\"labelCoinControlInsuffFunds\");\n    if (label)\n        label->setVisible(nChange < 0);\n}\n\nCCoinControl* CoinControlDialog::coinControl()\n{\n    static CCoinControl coin_control;\n    return &coin_control;\n}\n\nvoid CoinControlDialog::updateView()\n{\n    if (!model || !model->getOptionsModel() || !model->getAddressTableModel())\n        return;\n\n    bool treeMode = ui->radioTreeMode->isChecked();\n\n    ui->treeWidget->clear();\n    ui->treeWidget->setEnabled(false); // performance, otherwise updateLabels would be called for every checked checkbox\n    ui->treeWidget->setAlternatingRowColors(!treeMode);\n    QFlags<Qt::ItemFlag> flgCheckbox = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;\n    QFlags<Qt::ItemFlag> flgTristate = Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsTristate;\n\n    int nDisplayUnit = model->getOptionsModel()->getDisplayUnit();\n\n    std::map<QString, std::vector<COutput> > mapCoins;\n    model->listCoins(mapCoins);\n\n    for (const std::pair<QString, std::vector<COutput>>& coins : mapCoins) {\n        CCoinControlWidgetItem *itemWalletAddress = new CCoinControlWidgetItem();\n        itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);\n        QString sWalletAddress = coins.first;\n        QString sWalletLabel = model->getAddressTableModel()->labelForAddress(sWalletAddress);\n        if (sWalletLabel.isEmpty())\n            sWalletLabel = tr(\"(no label)\");\n\n        if (treeMode)\n        {\n            // wallet address\n            ui->treeWidget->addTopLevelItem(itemWalletAddress);\n\n            itemWalletAddress->setFlags(flgTristate);\n            itemWalletAddress->setCheckState(COLUMN_CHECKBOX, Qt::Unchecked);\n\n            // label\n            itemWalletAddress->setText(COLUMN_LABEL, sWalletLabel);\n\n            // address\n            itemWalletAddress->setText(COLUMN_ADDRESS, sWalletAddress);\n        }\n\n        CAmount nSum = 0;\n        int nChildren = 0;\n        for (const COutput& out : coins.second) {\n            nSum += out.tx->tx->vout[out.i].nValue;\n            nChildren++;\n\n            CCoinControlWidgetItem *itemOutput;\n            if (treeMode)    itemOutput = new CCoinControlWidgetItem(itemWalletAddress);\n            else             itemOutput = new CCoinControlWidgetItem(ui->treeWidget);\n            itemOutput->setFlags(flgCheckbox);\n            itemOutput->setCheckState(COLUMN_CHECKBOX,Qt::Unchecked);\n\n            // address\n            CTxDestination outputAddress;\n            QString sAddress = \"\";\n            if(ExtractDestination(out.tx->tx->vout[out.i].scriptPubKey, outputAddress))\n            {\n                sAddress = QString::fromStdString(EncodeDestination(outputAddress));\n\n                // if listMode or change => show bitcoin address. In tree mode, address is not shown again for direct wallet address outputs\n                if (!treeMode || (!(sAddress == sWalletAddress)))\n                    itemOutput->setText(COLUMN_ADDRESS, sAddress);\n            }\n\n            // label\n            if (!(sAddress == sWalletAddress)) // change\n            {\n                // tooltip from where the change comes from\n                itemOutput->setToolTip(COLUMN_LABEL, tr(\"change from %1 (%2)\").arg(sWalletLabel).arg(sWalletAddress));\n                itemOutput->setText(COLUMN_LABEL, tr(\"(change)\"));\n            }\n            else if (!treeMode)\n            {\n                QString sLabel = model->getAddressTableModel()->labelForAddress(sAddress);\n                if (sLabel.isEmpty())\n                    sLabel = tr(\"(no label)\");\n                itemOutput->setText(COLUMN_LABEL, sLabel);\n            }\n\n            // amount\n            itemOutput->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, out.tx->tx->vout[out.i].nValue));\n            itemOutput->setData(COLUMN_AMOUNT, Qt::UserRole, QVariant((qlonglong)out.tx->tx->vout[out.i].nValue)); // padding so that sorting works correctly\n\n            // date\n            itemOutput->setText(COLUMN_DATE, GUIUtil::dateTimeStr(out.tx->GetTxTime()));\n            itemOutput->setData(COLUMN_DATE, Qt::UserRole, QVariant((qlonglong)out.tx->GetTxTime()));\n\n            // confirmations\n            itemOutput->setText(COLUMN_CONFIRMATIONS, QString::number(out.nDepth));\n            itemOutput->setData(COLUMN_CONFIRMATIONS, Qt::UserRole, QVariant((qlonglong)out.nDepth));\n\n            // transaction hash\n            uint256 txhash = out.tx->GetHash();\n            itemOutput->setText(COLUMN_TXHASH, QString::fromStdString(txhash.GetHex()));\n\n            // vout index\n            itemOutput->setText(COLUMN_VOUT_INDEX, QString::number(out.i));\n\n             // disable locked coins\n            if (model->isLockedCoin(txhash, out.i))\n            {\n                COutPoint outpt(txhash, out.i);\n                coinControl()->UnSelect(outpt); // just to be sure\n                itemOutput->setDisabled(true);\n                itemOutput->setIcon(COLUMN_CHECKBOX, platformStyle->SingleColorIcon(\":/icons/lock_closed\"));\n            }\n\n            // set checkbox\n            if (coinControl()->IsSelected(COutPoint(txhash, out.i)))\n                itemOutput->setCheckState(COLUMN_CHECKBOX, Qt::Checked);\n        }\n\n        // amount\n        if (treeMode)\n        {\n            itemWalletAddress->setText(COLUMN_CHECKBOX, \"(\" + QString::number(nChildren) + \")\");\n            itemWalletAddress->setText(COLUMN_AMOUNT, BitcoinUnits::format(nDisplayUnit, nSum));\n            itemWalletAddress->setData(COLUMN_AMOUNT, Qt::UserRole, QVariant((qlonglong)nSum));\n        }\n    }\n\n    // expand all partially selected\n    if (treeMode)\n    {\n        for (int i = 0; i < ui->treeWidget->topLevelItemCount(); i++)\n            if (ui->treeWidget->topLevelItem(i)->checkState(COLUMN_CHECKBOX) == Qt::PartiallyChecked)\n                ui->treeWidget->topLevelItem(i)->setExpanded(true);\n    }\n\n    // sort view\n    sortView(sortColumn, sortOrder);\n    ui->treeWidget->setEnabled(true);\n}\n"
  },
  {
    "path": "src/qt/coincontroldialog.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_COINCONTROLDIALOG_H\n#define BITCOIN_QT_COINCONTROLDIALOG_H\n\n#include <amount.h>\n\n#include <QAbstractButton>\n#include <QAction>\n#include <QDialog>\n#include <QList>\n#include <QMenu>\n#include <QPoint>\n#include <QString>\n#include <QTreeWidgetItem>\n\nclass PlatformStyle;\nclass WalletModel;\n\nclass CCoinControl;\n\nnamespace Ui {\n    class CoinControlDialog;\n}\n\n#define ASYMP_UTF8 \"\\xE2\\x89\\x88\"\n\nclass CCoinControlWidgetItem : public QTreeWidgetItem\n{\npublic:\n    explicit CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}\n    explicit CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}\n    explicit CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}\n\n    bool operator<(const QTreeWidgetItem &other) const;\n};\n\n\nclass CoinControlDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit CoinControlDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);\n    ~CoinControlDialog();\n\n    void setModel(WalletModel *model);\n\n    // static because also called from sendcoinsdialog\n    static void updateLabels(WalletModel*, QDialog*);\n\n    static QList<CAmount> payAmounts;\n    static CCoinControl *coinControl();\n    static bool fSubtractFeeFromAmount;\n\nprivate:\n    Ui::CoinControlDialog *ui;\n    WalletModel *model;\n    int sortColumn;\n    Qt::SortOrder sortOrder;\n\n    QMenu *contextMenu;\n    QTreeWidgetItem *contextMenuItem;\n    QAction *copyTransactionHashAction;\n    QAction *lockAction;\n    QAction *unlockAction;\n\n    const PlatformStyle *platformStyle;\n\n    void sortView(int, Qt::SortOrder);\n    void updateView();\n\n    enum\n    {\n        COLUMN_CHECKBOX = 0,\n        COLUMN_AMOUNT,\n        COLUMN_LABEL,\n        COLUMN_ADDRESS,\n        COLUMN_DATE,\n        COLUMN_CONFIRMATIONS,\n        COLUMN_TXHASH,\n        COLUMN_VOUT_INDEX,\n    };\n    friend class CCoinControlWidgetItem;\n\nprivate Q_SLOTS:\n    void showMenu(const QPoint &);\n    void copyAmount();\n    void copyLabel();\n    void copyAddress();\n    void copyTransactionHash();\n    void lockCoin();\n    void unlockCoin();\n    void clipboardQuantity();\n    void clipboardAmount();\n    void clipboardFee();\n    void clipboardAfterFee();\n    void clipboardBytes();\n    void clipboardLowOutput();\n    void clipboardChange();\n    void radioTreeMode(bool);\n    void radioListMode(bool);\n    void viewItemChanged(QTreeWidgetItem*, int);\n    void headerSectionClicked(int);\n    void buttonBoxClicked(QAbstractButton*);\n    void buttonSelectAllClicked();\n    void updateLabelLocked();\n};\n\n#endif // BITCOIN_QT_COINCONTROLDIALOG_H\n"
  },
  {
    "path": "src/qt/coincontroltreewidget.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/coincontroltreewidget.h>\n#include <qt/coincontroldialog.h>\n\nCoinControlTreeWidget::CoinControlTreeWidget(QWidget *parent) :\n    QTreeWidget(parent)\n{\n\n}\n\nvoid CoinControlTreeWidget::keyPressEvent(QKeyEvent *event)\n{\n    if (event->key() == Qt::Key_Space) // press spacebar -> select checkbox\n    {\n        event->ignore();\n        if (this->currentItem()) {\n            int COLUMN_CHECKBOX = 0;\n            this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked));\n        }\n    }\n    else if (event->key() == Qt::Key_Escape) // press esc -> close dialog\n    {\n        event->ignore();\n        CoinControlDialog *coinControlDialog = (CoinControlDialog*)this->parentWidget();\n        coinControlDialog->done(QDialog::Accepted);\n    }\n    else\n    {\n        this->QTreeWidget::keyPressEvent(event);\n    }\n}\n"
  },
  {
    "path": "src/qt/coincontroltreewidget.h",
    "content": "// Copyright (c) 2011-2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_COINCONTROLTREEWIDGET_H\n#define BITCOIN_QT_COINCONTROLTREEWIDGET_H\n\n#include <QKeyEvent>\n#include <QTreeWidget>\n\nclass CoinControlTreeWidget : public QTreeWidget\n{\n    Q_OBJECT\n\npublic:\n    explicit CoinControlTreeWidget(QWidget *parent = 0);\n\nprotected:\n    virtual void keyPressEvent(QKeyEvent *event);\n};\n\n#endif // BITCOIN_QT_COINCONTROLTREEWIDGET_H\n"
  },
  {
    "path": "src/qt/csvmodelwriter.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/csvmodelwriter.h>\n\n#include <QAbstractItemModel>\n#include <QFile>\n#include <QTextStream>\n\nCSVModelWriter::CSVModelWriter(const QString &_filename, QObject *parent) :\n    QObject(parent),\n    filename(_filename), model(0)\n{\n}\n\nvoid CSVModelWriter::setModel(const QAbstractItemModel *_model)\n{\n    this->model = _model;\n}\n\nvoid CSVModelWriter::addColumn(const QString &title, int column, int role)\n{\n    Column col;\n    col.title = title;\n    col.column = column;\n    col.role = role;\n\n    columns.append(col);\n}\n\nstatic void writeValue(QTextStream &f, const QString &value)\n{\n    QString escaped = value;\n    escaped.replace('\"', \"\\\"\\\"\");\n    f << \"\\\"\" << escaped << \"\\\"\";\n}\n\nstatic void writeSep(QTextStream &f)\n{\n    f << \",\";\n}\n\nstatic void writeNewline(QTextStream &f)\n{\n    f << \"\\n\";\n}\n\nbool CSVModelWriter::write()\n{\n    QFile file(filename);\n    if(!file.open(QIODevice::WriteOnly | QIODevice::Text))\n        return false;\n    QTextStream out(&file);\n\n    int numRows = 0;\n    if(model)\n    {\n        numRows = model->rowCount();\n    }\n\n    // Header row\n    for(int i=0; i<columns.size(); ++i)\n    {\n        if(i!=0)\n        {\n            writeSep(out);\n        }\n        writeValue(out, columns[i].title);\n    }\n    writeNewline(out);\n\n    // Data rows\n    for(int j=0; j<numRows; ++j)\n    {\n        for(int i=0; i<columns.size(); ++i)\n        {\n            if(i!=0)\n            {\n                writeSep(out);\n            }\n            QVariant data = model->index(j, columns[i].column).data(columns[i].role);\n            writeValue(out, data.toString());\n        }\n        writeNewline(out);\n    }\n\n    file.close();\n\n    return file.error() == QFile::NoError;\n}\n"
  },
  {
    "path": "src/qt/csvmodelwriter.h",
    "content": "// Copyright (c) 2011-2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_CSVMODELWRITER_H\n#define BITCOIN_QT_CSVMODELWRITER_H\n\n#include <QList>\n#include <QObject>\n\nQT_BEGIN_NAMESPACE\nclass QAbstractItemModel;\nQT_END_NAMESPACE\n\n/** Export a Qt table model to a CSV file. This is useful for analyzing or post-processing the data in\n    a spreadsheet.\n */\nclass CSVModelWriter : public QObject\n{\n    Q_OBJECT\n\npublic:\n    explicit CSVModelWriter(const QString &filename, QObject *parent = 0);\n\n    void setModel(const QAbstractItemModel *model);\n    void addColumn(const QString &title, int column, int role=Qt::EditRole);\n\n    /** Perform export of the model to CSV.\n        @returns true on success, false otherwise\n    */\n    bool write();\n\nprivate:\n    QString filename;\n    const QAbstractItemModel *model;\n\n    struct Column\n    {\n        QString title;\n        int column;\n        int role;\n    };\n    QList<Column> columns;\n};\n\n#endif // BITCOIN_QT_CSVMODELWRITER_H\n"
  },
  {
    "path": "src/qt/editaddressdialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/editaddressdialog.h>\n#include <qt/forms/ui_editaddressdialog.h>\n\n#include <qt/addresstablemodel.h>\n#include <qt/guiutil.h>\n\n#include <QDataWidgetMapper>\n#include <QMessageBox>\n\nextern OutputType g_address_type;\n\nEditAddressDialog::EditAddressDialog(Mode _mode, QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::EditAddressDialog),\n    mapper(0),\n    mode(_mode),\n    model(0)\n{\n    ui->setupUi(this);\n\n    GUIUtil::setupAddressWidget(ui->addressEdit, this);\n\n    switch(mode)\n    {\n    case NewReceivingAddress:\n        setWindowTitle(tr(\"New receiving address\"));\n        ui->addressEdit->setEnabled(false);\n        break;\n    case NewSendingAddress:\n        setWindowTitle(tr(\"New sending address\"));\n        break;\n    case EditReceivingAddress:\n        setWindowTitle(tr(\"Edit receiving address\"));\n        ui->addressEdit->setEnabled(false);\n        break;\n    case EditSendingAddress:\n        setWindowTitle(tr(\"Edit sending address\"));\n        break;\n    }\n\n    mapper = new QDataWidgetMapper(this);\n    mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);\n}\n\nEditAddressDialog::~EditAddressDialog()\n{\n    delete ui;\n}\n\nvoid EditAddressDialog::setModel(AddressTableModel *_model)\n{\n    this->model = _model;\n    if(!_model)\n        return;\n\n    mapper->setModel(_model);\n    mapper->addMapping(ui->labelEdit, AddressTableModel::Label);\n    mapper->addMapping(ui->addressEdit, AddressTableModel::Address);\n}\n\nvoid EditAddressDialog::loadRow(int row)\n{\n    mapper->setCurrentIndex(row);\n}\n\nbool EditAddressDialog::saveCurrentRow()\n{\n    if(!model)\n        return false;\n\n    switch(mode)\n    {\n    case NewReceivingAddress:\n    case NewSendingAddress:\n        address = model->addRow(\n                mode == NewSendingAddress ? AddressTableModel::Send : AddressTableModel::Receive,\n                ui->labelEdit->text(),\n                ui->addressEdit->text(),\n                g_address_type);\n        break;\n    case EditReceivingAddress:\n    case EditSendingAddress:\n        if(mapper->submit())\n        {\n            address = ui->addressEdit->text();\n        }\n        break;\n    }\n    return !address.isEmpty();\n}\n\nvoid EditAddressDialog::accept()\n{\n    if(!model)\n        return;\n\n    if(!saveCurrentRow())\n    {\n        switch(model->getEditStatus())\n        {\n        case AddressTableModel::OK:\n            // Failed with unknown reason. Just reject.\n            break;\n        case AddressTableModel::NO_CHANGES:\n            // No changes were made during edit operation. Just reject.\n            break;\n        case AddressTableModel::INVALID_ADDRESS:\n            QMessageBox::warning(this, windowTitle(),\n                tr(\"The entered address \\\"%1\\\" is not a valid Sugarchain address.\").arg(ui->addressEdit->text()),\n                QMessageBox::Ok, QMessageBox::Ok);\n            break;\n        case AddressTableModel::DUPLICATE_ADDRESS:\n            QMessageBox::warning(this, windowTitle(),\n                tr(\"The entered address \\\"%1\\\" is already in the address book.\").arg(ui->addressEdit->text()),\n                QMessageBox::Ok, QMessageBox::Ok);\n            break;\n        case AddressTableModel::WALLET_UNLOCK_FAILURE:\n            QMessageBox::critical(this, windowTitle(),\n                tr(\"Could not unlock wallet.\"),\n                QMessageBox::Ok, QMessageBox::Ok);\n            break;\n        case AddressTableModel::KEY_GENERATION_FAILURE:\n            QMessageBox::critical(this, windowTitle(),\n                tr(\"New key generation failed.\"),\n                QMessageBox::Ok, QMessageBox::Ok);\n            break;\n\n        }\n        return;\n    }\n    QDialog::accept();\n}\n\nQString EditAddressDialog::getAddress() const\n{\n    return address;\n}\n\nvoid EditAddressDialog::setAddress(const QString &_address)\n{\n    this->address = _address;\n    ui->addressEdit->setText(_address);\n}\n"
  },
  {
    "path": "src/qt/editaddressdialog.h",
    "content": "// Copyright (c) 2011-2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_EDITADDRESSDIALOG_H\n#define BITCOIN_QT_EDITADDRESSDIALOG_H\n\n#include <QDialog>\n\nclass AddressTableModel;\n\nnamespace Ui {\n    class EditAddressDialog;\n}\n\nQT_BEGIN_NAMESPACE\nclass QDataWidgetMapper;\nQT_END_NAMESPACE\n\n/** Dialog for editing an address and associated information.\n */\nclass EditAddressDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    enum Mode {\n        NewReceivingAddress,\n        NewSendingAddress,\n        EditReceivingAddress,\n        EditSendingAddress\n    };\n\n    explicit EditAddressDialog(Mode mode, QWidget *parent);\n    ~EditAddressDialog();\n\n    void setModel(AddressTableModel *model);\n    void loadRow(int row);\n\n    QString getAddress() const;\n    void setAddress(const QString &address);\n\npublic Q_SLOTS:\n    void accept();\n\nprivate:\n    bool saveCurrentRow();\n\n    Ui::EditAddressDialog *ui;\n    QDataWidgetMapper *mapper;\n    Mode mode;\n    AddressTableModel *model;\n\n    QString address;\n};\n\n#endif // BITCOIN_QT_EDITADDRESSDIALOG_H\n"
  },
  {
    "path": "src/qt/forms/addressbookpage.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>AddressBookPage</class>\n <widget class=\"QWidget\" name=\"AddressBookPage\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>760</width>\n    <height>380</height>\n   </rect>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <item>\n    <widget class=\"QLabel\" name=\"labelExplanation\">\n     <property name=\"textFormat\">\n      <enum>Qt::PlainText</enum>\n     </property>\n     <property name=\"wordWrap\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QTableView\" name=\"tableView\">\n     <property name=\"contextMenuPolicy\">\n      <enum>Qt::CustomContextMenu</enum>\n     </property>\n     <property name=\"toolTip\">\n      <string>Right-click to edit address or label</string>\n     </property>\n     <property name=\"tabKeyNavigation\">\n      <bool>false</bool>\n     </property>\n     <property name=\"alternatingRowColors\">\n      <bool>true</bool>\n     </property>\n     <property name=\"selectionMode\">\n      <enum>QAbstractItemView::SingleSelection</enum>\n     </property>\n     <property name=\"selectionBehavior\">\n      <enum>QAbstractItemView::SelectRows</enum>\n     </property>\n     <property name=\"sortingEnabled\">\n      <bool>true</bool>\n     </property>\n     <attribute name=\"verticalHeaderVisible\">\n      <bool>false</bool>\n     </attribute>\n    </widget>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n     <item>\n      <widget class=\"QPushButton\" name=\"newAddress\">\n       <property name=\"toolTip\">\n        <string>Create a new address</string>\n       </property>\n       <property name=\"text\">\n        <string>&amp;New</string>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"../bitcoin.qrc\">\n         <normaloff>:/icons/add</normaloff>:/icons/add</iconset>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"copyAddress\">\n       <property name=\"toolTip\">\n        <string>Copy the currently selected address to the system clipboard</string>\n       </property>\n       <property name=\"text\">\n        <string>&amp;Copy</string>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"../bitcoin.qrc\">\n         <normaloff>:/icons/editcopy</normaloff>:/icons/editcopy</iconset>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"deleteAddress\">\n       <property name=\"toolTip\">\n        <string>Delete the currently selected address from the list</string>\n       </property>\n       <property name=\"text\">\n        <string>&amp;Delete</string>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"../bitcoin.qrc\">\n         <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"exportButton\">\n       <property name=\"toolTip\">\n        <string>Export the data in the current tab to a file</string>\n       </property>\n       <property name=\"text\">\n        <string>&amp;Export</string>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"../bitcoin.qrc\">\n         <normaloff>:/icons/export</normaloff>:/icons/export</iconset>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"closeButton\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Minimum\" vsizetype=\"Minimum\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"text\">\n        <string>C&amp;lose</string>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <resources>\n  <include location=\"../bitcoin.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/askpassphrasedialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>AskPassphraseDialog</class>\n <widget class=\"QDialog\" name=\"AskPassphraseDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>598</width>\n    <height>222</height>\n   </rect>\n  </property>\n  <property name=\"sizePolicy\">\n   <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Minimum\">\n    <horstretch>0</horstretch>\n    <verstretch>0</verstretch>\n   </sizepolicy>\n  </property>\n  <property name=\"minimumSize\">\n   <size>\n    <width>550</width>\n    <height>0</height>\n   </size>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Passphrase Dialog</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <property name=\"sizeConstraint\">\n    <enum>QLayout::SetMinimumSize</enum>\n   </property>\n   <item>\n    <widget class=\"QLabel\" name=\"warningLabel\">\n     <property name=\"text\">\n      <string notr=\"true\">Placeholder text</string>\n     </property>\n     <property name=\"textFormat\">\n      <enum>Qt::RichText</enum>\n     </property>\n     <property name=\"wordWrap\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <layout class=\"QFormLayout\" name=\"formLayout\">\n     <property name=\"sizeConstraint\">\n      <enum>QLayout::SetMinimumSize</enum>\n     </property>\n     <property name=\"fieldGrowthPolicy\">\n      <enum>QFormLayout::AllNonFixedFieldsGrow</enum>\n     </property>\n     <item row=\"0\" column=\"0\">\n      <widget class=\"QLabel\" name=\"passLabel1\">\n       <property name=\"text\">\n        <string>Enter passphrase</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"1\">\n      <widget class=\"QLineEdit\" name=\"passEdit1\">\n       <property name=\"echoMode\">\n        <enum>QLineEdit::Password</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"0\">\n      <widget class=\"QLabel\" name=\"passLabel2\">\n       <property name=\"text\">\n        <string>New passphrase</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"1\">\n      <widget class=\"QLineEdit\" name=\"passEdit2\">\n       <property name=\"echoMode\">\n        <enum>QLineEdit::Password</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"0\">\n      <widget class=\"QLabel\" name=\"passLabel3\">\n       <property name=\"text\">\n        <string>Repeat new passphrase</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"2\" column=\"1\">\n      <widget class=\"QLineEdit\" name=\"passEdit3\">\n       <property name=\"echoMode\">\n        <enum>QLineEdit::Password</enum>\n       </property>\n      </widget>\n     </item>\n     <item row=\"3\" column=\"1\">\n      <widget class=\"QCheckBox\" name=\"toggleShowPasswordButton\">\n       <property name=\"text\">\n        <string>Show password</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"4\" column=\"1\">\n      <widget class=\"QLabel\" name=\"capsLabel\">\n       <property name=\"font\">\n        <font>\n         <weight>75</weight>\n         <bold>true</bold>\n        </font>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"alignment\">\n        <set>Qt::AlignCenter</set>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <widget class=\"QDialogButtonBox\" name=\"buttonBox\">\n     <property name=\"orientation\">\n      <enum>Qt::Horizontal</enum>\n     </property>\n     <property name=\"standardButtons\">\n      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <resources/>\n <connections>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>accepted()</signal>\n   <receiver>AskPassphraseDialog</receiver>\n   <slot>accept()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>rejected()</signal>\n   <receiver>AskPassphraseDialog</receiver>\n   <slot>reject()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/coincontroldialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>CoinControlDialog</class>\n <widget class=\"QDialog\" name=\"CoinControlDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>1000</width>\n    <height>500</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Coin Selection</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayoutTop\" stretch=\"0,0,0,0\">\n     <property name=\"topMargin\">\n      <number>0</number>\n     </property>\n     <property name=\"bottomMargin\">\n      <number>10</number>\n     </property>\n     <item>\n      <layout class=\"QFormLayout\" name=\"formLayoutCoinControl1\">\n       <property name=\"horizontalSpacing\">\n        <number>10</number>\n       </property>\n       <property name=\"verticalSpacing\">\n        <number>10</number>\n       </property>\n       <property name=\"leftMargin\">\n        <number>6</number>\n       </property>\n       <property name=\"rightMargin\">\n        <number>6</number>\n       </property>\n       <item row=\"0\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelCoinControlQuantityText\">\n         <property name=\"font\">\n          <font>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"text\">\n          <string>Quantity:</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"0\" column=\"1\">\n        <widget class=\"QLabel\" name=\"labelCoinControlQuantity\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"contextMenuPolicy\">\n          <enum>Qt::ActionsContextMenu</enum>\n         </property>\n         <property name=\"text\">\n          <string notr=\"true\">0</string>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"1\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelCoinControlBytesText\">\n         <property name=\"font\">\n          <font>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"text\">\n          <string>Bytes:</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"1\" column=\"1\">\n        <widget class=\"QLabel\" name=\"labelCoinControlBytes\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"contextMenuPolicy\">\n          <enum>Qt::ActionsContextMenu</enum>\n         </property>\n         <property name=\"text\">\n          <string notr=\"true\">0</string>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n     <item>\n      <layout class=\"QFormLayout\" name=\"formLayoutCoinControl2\">\n       <property name=\"horizontalSpacing\">\n        <number>10</number>\n       </property>\n       <property name=\"verticalSpacing\">\n        <number>10</number>\n       </property>\n       <property name=\"leftMargin\">\n        <number>6</number>\n       </property>\n       <property name=\"rightMargin\">\n        <number>6</number>\n       </property>\n       <item row=\"0\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelCoinControlAmountText\">\n         <property name=\"font\">\n          <font>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"text\">\n          <string>Amount:</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"0\" column=\"1\">\n        <widget class=\"QLabel\" name=\"labelCoinControlAmount\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"contextMenuPolicy\">\n          <enum>Qt::ActionsContextMenu</enum>\n         </property>\n         <property name=\"text\">\n          <string notr=\"true\">0.00 SUGAR</string>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"1\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelCoinControlLowOutputText\">\n         <property name=\"enabled\">\n          <bool>false</bool>\n         </property>\n         <property name=\"font\">\n          <font>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"text\">\n          <string>Dust:</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"1\" column=\"1\">\n        <widget class=\"QLabel\" name=\"labelCoinControlLowOutput\">\n         <property name=\"enabled\">\n          <bool>false</bool>\n         </property>\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"contextMenuPolicy\">\n          <enum>Qt::ActionsContextMenu</enum>\n         </property>\n         <property name=\"text\">\n          <string notr=\"true\">no</string>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n     <item>\n      <layout class=\"QFormLayout\" name=\"formLayoutCoinControl3\">\n       <property name=\"horizontalSpacing\">\n        <number>10</number>\n       </property>\n       <property name=\"verticalSpacing\">\n        <number>10</number>\n       </property>\n       <property name=\"leftMargin\">\n        <number>6</number>\n       </property>\n       <property name=\"rightMargin\">\n        <number>6</number>\n       </property>\n       <item row=\"0\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelCoinControlFeeText\">\n         <property name=\"font\">\n          <font>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"text\">\n          <string>Fee:</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"0\" column=\"1\">\n        <widget class=\"QLabel\" name=\"labelCoinControlFee\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"contextMenuPolicy\">\n          <enum>Qt::ActionsContextMenu</enum>\n         </property>\n         <property name=\"text\">\n          <string notr=\"true\">0.00 SUGAR</string>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n     <item>\n      <layout class=\"QFormLayout\" name=\"formLayoutCoinControl4\">\n       <property name=\"horizontalSpacing\">\n        <number>10</number>\n       </property>\n       <property name=\"verticalSpacing\">\n        <number>10</number>\n       </property>\n       <property name=\"leftMargin\">\n        <number>6</number>\n       </property>\n       <property name=\"rightMargin\">\n        <number>6</number>\n       </property>\n       <item row=\"0\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelCoinControlAfterFeeText\">\n         <property name=\"font\">\n          <font>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"text\">\n          <string>After Fee:</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"0\" column=\"1\">\n        <widget class=\"QLabel\" name=\"labelCoinControlAfterFee\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"contextMenuPolicy\">\n          <enum>Qt::ActionsContextMenu</enum>\n         </property>\n         <property name=\"text\">\n          <string notr=\"true\">0.00 SUGAR</string>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"1\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelCoinControlChangeText\">\n         <property name=\"enabled\">\n          <bool>false</bool>\n         </property>\n         <property name=\"font\">\n          <font>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"text\">\n          <string>Change:</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"1\" column=\"1\">\n        <widget class=\"QLabel\" name=\"labelCoinControlChange\">\n         <property name=\"enabled\">\n          <bool>false</bool>\n         </property>\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"contextMenuPolicy\">\n          <enum>Qt::ActionsContextMenu</enum>\n         </property>\n         <property name=\"text\">\n          <string notr=\"true\">0.00 SUGAR</string>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <widget class=\"QFrame\" name=\"frame\">\n     <property name=\"minimumSize\">\n      <size>\n       <width>0</width>\n       <height>40</height>\n      </size>\n     </property>\n     <property name=\"frameShape\">\n      <enum>QFrame::StyledPanel</enum>\n     </property>\n     <property name=\"frameShadow\">\n      <enum>QFrame::Sunken</enum>\n     </property>\n     <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n      <item>\n       <layout class=\"QHBoxLayout\" name=\"horizontalLayoutPanel\" stretch=\"0,0,0,0,0\">\n        <property name=\"spacing\">\n         <number>14</number>\n        </property>\n        <item>\n         <widget class=\"QPushButton\" name=\"pushButtonSelectAll\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Maximum\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"text\">\n           <string>(un)select all</string>\n          </property>\n          <property name=\"autoDefault\">\n           <bool>false</bool>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <widget class=\"QRadioButton\" name=\"radioTreeMode\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Maximum\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"text\">\n           <string>Tree mode</string>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <widget class=\"QRadioButton\" name=\"radioListMode\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Maximum\" vsizetype=\"Fixed\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"text\">\n           <string>List mode</string>\n          </property>\n          <property name=\"checked\">\n           <bool>true</bool>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <widget class=\"QLabel\" name=\"labelLocked\">\n          <property name=\"text\">\n           <string notr=\"true\">(1 locked)</string>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>40</width>\n            <height>20</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n       </layout>\n      </item>\n     </layout>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"CoinControlTreeWidget\" name=\"treeWidget\">\n     <property name=\"contextMenuPolicy\">\n      <enum>Qt::CustomContextMenu</enum>\n     </property>\n     <property name=\"sortingEnabled\">\n      <bool>false</bool>\n     </property>\n     <property name=\"columnCount\">\n      <number>10</number>\n     </property>\n     <attribute name=\"headerShowSortIndicator\" stdset=\"0\">\n      <bool>true</bool>\n     </attribute>\n     <attribute name=\"headerStretchLastSection\">\n      <bool>false</bool>\n     </attribute>\n     <column>\n      <property name=\"text\">\n       <string/>\n      </property>\n     </column>\n     <column>\n      <property name=\"text\">\n       <string>Amount</string>\n      </property>\n     </column>\n     <column>\n      <property name=\"text\">\n       <string>Received with label</string>\n      </property>\n     </column>\n     <column>\n      <property name=\"text\">\n       <string>Received with address</string>\n      </property>\n     </column>\n     <column>\n      <property name=\"text\">\n       <string>Date</string>\n      </property>\n     </column>\n     <column>\n      <property name=\"text\">\n       <string>Confirmations</string>\n      </property>\n      <property name=\"toolTip\">\n       <string>Confirmed</string>\n      </property>\n     </column>\n     <column>\n      <property name=\"text\">\n       <string/>\n      </property>\n     </column>\n     <column>\n      <property name=\"text\">\n       <string/>\n      </property>\n     </column>\n     <column>\n      <property name=\"text\">\n       <string/>\n      </property>\n     </column>\n     <column>\n      <property name=\"text\">\n       <string/>\n      </property>\n     </column>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QDialogButtonBox\" name=\"buttonBox\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Maximum\" vsizetype=\"Fixed\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"orientation\">\n      <enum>Qt::Horizontal</enum>\n     </property>\n     <property name=\"standardButtons\">\n      <set>QDialogButtonBox::Ok</set>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>CoinControlTreeWidget</class>\n   <extends>QTreeWidget</extends>\n   <header>qt/coincontroltreewidget.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/debugwindow.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>RPCConsole</class>\n <widget class=\"QWidget\" name=\"RPCConsole\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>740</width>\n    <height>430</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Debug window</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\">\n   <item>\n    <widget class=\"QTabWidget\" name=\"tabWidget\">\n     <property name=\"currentIndex\">\n      <number>0</number>\n     </property>\n     <widget class=\"QWidget\" name=\"tab_info\">\n      <attribute name=\"title\">\n       <string>&amp;Information</string>\n      </attribute>\n      <layout class=\"QGridLayout\" name=\"gridLayout\" columnstretch=\"0,1,0\">\n       <property name=\"horizontalSpacing\">\n        <number>12</number>\n       </property>\n       <item row=\"0\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label_9\">\n         <property name=\"font\">\n          <font>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"text\">\n          <string>General</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"1\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label_6\">\n         <property name=\"text\">\n          <string>Client version</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"1\" column=\"1\" colspan=\"2\">\n        <widget class=\"QLabel\" name=\"clientVersion\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"2\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelClientUserAgent\">\n         <property name=\"text\">\n          <string>User Agent</string>\n         </property>\n         <property name=\"indent\">\n          <number>10</number>\n         </property>\n        </widget>\n       </item>\n       <item row=\"2\" column=\"1\" colspan=\"2\">\n        <widget class=\"QLabel\" name=\"clientUserAgent\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"3\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label_berkeleyDBVersion\">\n         <property name=\"text\">\n          <string>Using BerkeleyDB version</string>\n         </property>\n         <property name=\"indent\">\n          <number>10</number>\n         </property>\n        </widget>\n       </item>\n       <item row=\"3\" column=\"1\" colspan=\"2\">\n        <widget class=\"QLabel\" name=\"berkeleyDBVersion\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"4\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label_12\">\n         <property name=\"text\">\n          <string>Datadir</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"4\" column=\"1\" colspan=\"2\">\n        <widget class=\"QLabel\" name=\"dataDir\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"wordWrap\">\n          <bool>true</bool>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"5\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label_13\">\n         <property name=\"text\">\n          <string>Startup time</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"5\" column=\"1\" colspan=\"2\">\n        <widget class=\"QLabel\" name=\"startupTime\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"6\" column=\"0\">\n           <widget class=\"QLabel\" name=\"labelNetwork\">\n               <property name=\"font\">\n                   <font>\n                       <weight>75</weight>\n                       <bold>true</bold>\n                   </font>\n               </property>\n               <property name=\"text\">\n                   <string>Network</string>\n               </property>\n           </widget>\n       </item>\n       <item row=\"7\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label_8\">\n         <property name=\"text\">\n          <string>Name</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"7\" column=\"1\" colspan=\"2\">\n        <widget class=\"QLabel\" name=\"networkName\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"8\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label_7\">\n         <property name=\"text\">\n          <string>Number of connections</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"8\" column=\"1\" colspan=\"2\">\n        <widget class=\"QLabel\" name=\"numberOfConnections\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"9\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label_10\">\n         <property name=\"font\">\n          <font>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"text\">\n          <string>Block chain</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"10\" column=\"0\">\n        <widget class=\"QLabel\" name=\"label_3\">\n         <property name=\"text\">\n          <string>Current number of blocks</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"10\" column=\"1\" colspan=\"2\">\n        <widget class=\"QLabel\" name=\"numberOfBlocks\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"11\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelLastBlockTime\">\n         <property name=\"text\">\n          <string>Last block time</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"11\" column=\"1\" colspan=\"2\">\n        <widget class=\"QLabel\" name=\"lastBlockTime\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"12\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelMempoolTitle\">\n         <property name=\"font\">\n          <font>\n           <weight>75</weight>\n           <bold>true</bold>\n          </font>\n         </property>\n         <property name=\"text\">\n          <string>Memory Pool</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"13\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelNumberOfTransactions\">\n         <property name=\"text\">\n          <string>Current number of transactions</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"13\" column=\"1\">\n        <widget class=\"QLabel\" name=\"mempoolNumberTxs\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"14\" column=\"0\">\n        <widget class=\"QLabel\" name=\"labelMemoryUsage\">\n         <property name=\"text\">\n          <string>Memory usage</string>\n         </property>\n        </widget>\n       </item>\n       <item row=\"14\" column=\"1\">\n        <widget class=\"QLabel\" name=\"mempoolSize\">\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>N/A</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"12\" column=\"2\" rowspan=\"3\">\n        <layout class=\"QVBoxLayout\" name=\"verticalLayoutDebugButton\">\n         <property name=\"spacing\">\n          <number>3</number>\n         </property>\n         <item>\n          <spacer name=\"verticalSpacer_2\">\n           <property name=\"orientation\">\n            <enum>Qt::Vertical</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>10</width>\n             <height>5</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item>\n          <widget class=\"QLabel\" name=\"labelDebugLogfile\">\n           <property name=\"text\">\n            <string>Debug log file</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"openDebugLogfileButton\">\n           <property name=\"toolTip\">\n            <string>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</string>\n           </property>\n           <property name=\"text\">\n            <string>&amp;Open</string>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item row=\"15\" column=\"0\">\n        <spacer name=\"verticalSpacer\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>40</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n      </layout>\n     </widget>\n     <widget class=\"QWidget\" name=\"tab_console\">\n      <attribute name=\"title\">\n       <string>&amp;Console</string>\n      </attribute>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_3\">\n       <property name=\"spacing\">\n        <number>3</number>\n       </property>\n       <property name=\"bottomMargin\">\n        <number>5</number>\n       </property>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n         <property name=\"spacing\">\n          <number>4</number>\n         </property>\n         <item>\n          <spacer name=\"horizontalSpacer\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"fontSmallerButton\">\n           <property name=\"maximumSize\">\n            <size>\n             <width>24</width>\n             <height>24</height>\n            </size>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"toolTip\">\n            <string>Decrease font size</string>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/fontsmaller</normaloff>:/icons/fontsmaller</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>24</width>\n             <height>16</height>\n            </size>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n           <property name=\"flat\">\n            <bool>true</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"fontBiggerButton\">\n           <property name=\"maximumSize\">\n            <size>\n             <width>24</width>\n             <height>24</height>\n            </size>\n           </property>\n           <property name=\"toolTip\">\n            <string>Increase font size</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/fontbigger</normaloff>:/icons/fontbigger</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>24</width>\n             <height>16</height>\n            </size>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n           <property name=\"flat\">\n            <bool>true</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"clearButton\">\n           <property name=\"maximumSize\">\n            <size>\n             <width>24</width>\n             <height>24</height>\n            </size>\n           </property>\n           <property name=\"toolTip\">\n            <string>Clear console</string>\n           </property>\n           <property name=\"layoutDirection\">\n            <enum>Qt::LeftToRight</enum>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>\n           </property>\n           <property name=\"shortcut\">\n            <string notr=\"true\">Ctrl+L</string>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n           <property name=\"flat\">\n            <bool>true</bool>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <widget class=\"QTextEdit\" name=\"messagesWidget\">\n         <property name=\"minimumSize\">\n          <size>\n           <width>0</width>\n           <height>100</height>\n          </size>\n         </property>\n         <property name=\"readOnly\">\n          <bool>true</bool>\n         </property>\n         <property name=\"tabKeyNavigation\" stdset=\"0\">\n          <bool>false</bool>\n         </property>\n         <property name=\"columnCount\" stdset=\"0\">\n          <number>2</number>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayoutPrompt\">\n         <property name=\"spacing\">\n          <number>3</number>\n         </property>\n         <item>\n          <widget class=\"QPushButton\" name=\"promptIcon\">\n           <property name=\"enabled\">\n            <bool>false</bool>\n           </property>\n           <property name=\"maximumSize\">\n            <size>\n             <width>16</width>\n             <height>24</height>\n            </size>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/prompticon</normaloff>\n             <disabledoff>:/icons/prompticon</disabledoff>:/icons/prompticon</iconset>\n           </property>\n           <property name=\"iconSize\">\n            <size>\n             <width>14</width>\n             <height>14</height>\n            </size>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n           <property name=\"flat\">\n            <bool>true</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QLineEdit\" name=\"lineEdit\">\n           <property name=\"placeholderText\">\n            <string/>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </widget>\n     <widget class=\"QWidget\" name=\"tab_nettraffic\">\n      <attribute name=\"title\">\n       <string>&amp;Network Traffic</string>\n      </attribute>\n      <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3\">\n       <item>\n        <layout class=\"QVBoxLayout\" name=\"verticalLayout_4\">\n         <item>\n          <widget class=\"TrafficGraphWidget\" name=\"trafficGraph\" native=\"true\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2\">\n           <item>\n            <widget class=\"QSlider\" name=\"sldGraphRange\">\n             <property name=\"minimum\">\n              <number>1</number>\n             </property>\n             <property name=\"maximum\">\n              <number>288</number>\n             </property>\n             <property name=\"pageStep\">\n              <number>12</number>\n             </property>\n             <property name=\"value\">\n              <number>6</number>\n             </property>\n             <property name=\"orientation\">\n              <enum>Qt::Horizontal</enum>\n             </property>\n            </widget>\n           </item>\n           <item>\n            <widget class=\"QLabel\" name=\"lblGraphRange\">\n             <property name=\"minimumSize\">\n              <size>\n               <width>100</width>\n               <height>0</height>\n              </size>\n             </property>\n             <property name=\"alignment\">\n              <set>Qt::AlignCenter</set>\n             </property>\n            </widget>\n           </item>\n           <item>\n            <widget class=\"QPushButton\" name=\"btnClearTrafficGraph\">\n             <property name=\"text\">\n              <string>&amp;Reset</string>\n             </property>\n             <property name=\"autoDefault\">\n              <bool>false</bool>\n             </property>\n            </widget>\n           </item>\n          </layout>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n         <item>\n          <widget class=\"QGroupBox\" name=\"groupBox\">\n           <property name=\"title\">\n            <string>Totals</string>\n           </property>\n           <layout class=\"QVBoxLayout\" name=\"verticalLayout_5\">\n            <item>\n             <layout class=\"QHBoxLayout\" name=\"horizontalLayout_4\">\n              <item>\n               <widget class=\"Line\" name=\"line\">\n                <property name=\"sizePolicy\">\n                 <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n                  <horstretch>0</horstretch>\n                  <verstretch>0</verstretch>\n                 </sizepolicy>\n                </property>\n                <property name=\"minimumSize\">\n                 <size>\n                  <width>10</width>\n                  <height>0</height>\n                 </size>\n                </property>\n                <property name=\"palette\">\n                 <palette>\n                  <active>\n                   <colorrole role=\"Light\">\n                    <brush brushstyle=\"SolidPattern\">\n                     <color alpha=\"255\">\n                      <red>0</red>\n                      <green>255</green>\n                      <blue>0</blue>\n                     </color>\n                    </brush>\n                   </colorrole>\n                  </active>\n                  <inactive>\n                   <colorrole role=\"Light\">\n                    <brush brushstyle=\"SolidPattern\">\n                     <color alpha=\"255\">\n                      <red>0</red>\n                      <green>255</green>\n                      <blue>0</blue>\n                     </color>\n                    </brush>\n                   </colorrole>\n                  </inactive>\n                  <disabled>\n                   <colorrole role=\"Light\">\n                    <brush brushstyle=\"SolidPattern\">\n                     <color alpha=\"255\">\n                      <red>0</red>\n                      <green>255</green>\n                      <blue>0</blue>\n                     </color>\n                    </brush>\n                   </colorrole>\n                  </disabled>\n                 </palette>\n                </property>\n                <property name=\"orientation\">\n                 <enum>Qt::Horizontal</enum>\n                </property>\n               </widget>\n              </item>\n              <item>\n               <widget class=\"QLabel\" name=\"label_16\">\n                <property name=\"text\">\n                 <string>Received</string>\n                </property>\n               </widget>\n              </item>\n              <item>\n               <widget class=\"QLabel\" name=\"lblBytesIn\">\n                <property name=\"minimumSize\">\n                 <size>\n                  <width>50</width>\n                  <height>0</height>\n                 </size>\n                </property>\n                <property name=\"alignment\">\n                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n                </property>\n               </widget>\n              </item>\n             </layout>\n            </item>\n            <item>\n             <layout class=\"QHBoxLayout\" name=\"horizontalLayout_5\">\n              <item>\n               <widget class=\"Line\" name=\"line_2\">\n                <property name=\"sizePolicy\">\n                 <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n                  <horstretch>0</horstretch>\n                  <verstretch>0</verstretch>\n                 </sizepolicy>\n                </property>\n                <property name=\"minimumSize\">\n                 <size>\n                  <width>10</width>\n                  <height>0</height>\n                 </size>\n                </property>\n                <property name=\"palette\">\n                 <palette>\n                  <active>\n                   <colorrole role=\"Light\">\n                    <brush brushstyle=\"SolidPattern\">\n                     <color alpha=\"255\">\n                      <red>255</red>\n                      <green>0</green>\n                      <blue>0</blue>\n                     </color>\n                    </brush>\n                   </colorrole>\n                  </active>\n                  <inactive>\n                   <colorrole role=\"Light\">\n                    <brush brushstyle=\"SolidPattern\">\n                     <color alpha=\"255\">\n                      <red>255</red>\n                      <green>0</green>\n                      <blue>0</blue>\n                     </color>\n                    </brush>\n                   </colorrole>\n                  </inactive>\n                  <disabled>\n                   <colorrole role=\"Light\">\n                    <brush brushstyle=\"SolidPattern\">\n                     <color alpha=\"255\">\n                      <red>255</red>\n                      <green>0</green>\n                      <blue>0</blue>\n                     </color>\n                    </brush>\n                   </colorrole>\n                  </disabled>\n                 </palette>\n                </property>\n                <property name=\"orientation\">\n                 <enum>Qt::Horizontal</enum>\n                </property>\n               </widget>\n              </item>\n              <item>\n               <widget class=\"QLabel\" name=\"label_17\">\n                <property name=\"text\">\n                 <string>Sent</string>\n                </property>\n               </widget>\n              </item>\n              <item>\n               <widget class=\"QLabel\" name=\"lblBytesOut\">\n                <property name=\"minimumSize\">\n                 <size>\n                  <width>50</width>\n                  <height>0</height>\n                 </size>\n                </property>\n                <property name=\"alignment\">\n                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n                </property>\n               </widget>\n              </item>\n             </layout>\n            </item>\n            <item>\n             <spacer name=\"verticalSpacer_4\">\n              <property name=\"orientation\">\n               <enum>Qt::Vertical</enum>\n              </property>\n              <property name=\"sizeHint\" stdset=\"0\">\n               <size>\n                <width>20</width>\n                <height>407</height>\n               </size>\n              </property>\n             </spacer>\n            </item>\n           </layout>\n          </widget>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </widget>\n     <widget class=\"QWidget\" name=\"tab_peers\">\n      <attribute name=\"title\">\n       <string>&amp;Peers</string>\n      </attribute>\n      <layout class=\"QGridLayout\" name=\"gridLayout_2\">\n       <item row=\"0\" column=\"0\" rowspan=\"2\">\n        <layout class=\"QVBoxLayout\" name=\"verticalLayout_101\">\n         <property name=\"spacing\">\n          <number>0</number>\n         </property>\n         <item>\n          <widget class=\"QTableView\" name=\"peerWidget\">\n           <property name=\"horizontalScrollBarPolicy\">\n            <enum>Qt::ScrollBarAsNeeded</enum>\n           </property>\n           <property name=\"tabKeyNavigation\">\n            <bool>false</bool>\n           </property>\n           <property name=\"sortingEnabled\">\n            <bool>true</bool>\n           </property>\n           <attribute name=\"horizontalHeaderHighlightSections\">\n            <bool>false</bool>\n           </attribute>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QLabel\" name=\"banHeading\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Minimum\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"minimumSize\">\n            <size>\n             <width>300</width>\n             <height>32</height>\n            </size>\n           </property>\n           <property name=\"maximumSize\">\n            <size>\n             <width>16777215</width>\n             <height>32</height>\n            </size>\n           </property>\n           <property name=\"font\">\n            <font>\n             <pointsize>12</pointsize>\n            </font>\n           </property>\n           <property name=\"cursor\">\n            <cursorShape>IBeamCursor</cursorShape>\n           </property>\n           <property name=\"text\">\n            <string>Banned peers</string>\n           </property>\n           <property name=\"alignment\">\n            <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>\n           </property>\n           <property name=\"wordWrap\">\n            <bool>true</bool>\n           </property>\n           <property name=\"textInteractionFlags\">\n            <set>Qt::NoTextInteraction</set>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QTableView\" name=\"banlistWidget\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"horizontalScrollBarPolicy\">\n            <enum>Qt::ScrollBarAsNeeded</enum>\n           </property>\n           <property name=\"tabKeyNavigation\">\n            <bool>false</bool>\n           </property>\n           <property name=\"sortingEnabled\">\n            <bool>true</bool>\n           </property>\n           <attribute name=\"horizontalHeaderHighlightSections\">\n            <bool>false</bool>\n           </attribute>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item row=\"0\" column=\"1\">\n        <widget class=\"QLabel\" name=\"peerHeading\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Minimum\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"minimumSize\">\n          <size>\n           <width>300</width>\n           <height>32</height>\n          </size>\n         </property>\n         <property name=\"font\">\n          <font>\n           <pointsize>10</pointsize>\n          </font>\n         </property>\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string>Select a peer to view detailed information.</string>\n         </property>\n         <property name=\"alignment\">\n          <set>Qt::AlignHCenter|Qt::AlignTop</set>\n         </property>\n         <property name=\"wordWrap\">\n          <bool>true</bool>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n       <item row=\"1\" column=\"1\">\n        <widget class=\"QWidget\" name=\"detailWidget\" native=\"true\">\n         <property name=\"minimumSize\">\n          <size>\n           <width>300</width>\n           <height>0</height>\n          </size>\n         </property>\n         <layout class=\"QGridLayout\" name=\"gridLayout_3\">\n          <item row=\"0\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_30\">\n            <property name=\"text\">\n             <string>Whitelisted</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"0\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerWhitelisted\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"1\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_23\">\n            <property name=\"text\">\n             <string>Direction</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"1\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerDirection\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"2\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_21\">\n            <property name=\"text\">\n             <string>Version</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"2\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerVersion\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"3\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_28\">\n            <property name=\"text\">\n             <string>User Agent</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"3\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerSubversion\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"4\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_4\">\n            <property name=\"text\">\n             <string>Services</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"4\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerServices\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"5\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_29\">\n            <property name=\"text\">\n             <string>Starting Block</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"5\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerHeight\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"6\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_27\">\n            <property name=\"text\">\n             <string>Synced Headers</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"6\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerSyncHeight\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"7\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_25\">\n            <property name=\"text\">\n             <string>Synced Blocks</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"7\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerCommonHeight\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"8\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_24\">\n            <property name=\"text\">\n             <string>Ban Score</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"8\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerBanScore\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"9\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_22\">\n            <property name=\"text\">\n             <string>Connection Time</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"9\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerConnTime\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"10\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_15\">\n            <property name=\"text\">\n             <string>Last Send</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"10\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerLastSend\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"11\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_19\">\n            <property name=\"text\">\n             <string>Last Receive</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"11\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerLastRecv\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"12\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_18\">\n            <property name=\"text\">\n             <string>Sent</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"12\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerBytesSent\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"13\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_20\">\n            <property name=\"text\">\n             <string>Received</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"13\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerBytesRecv\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"14\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_26\">\n            <property name=\"text\">\n             <string>Ping Time</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"14\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerPingTime\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"15\" column=\"0\">\n           <widget class=\"QLabel\" name=\"peerPingWaitLabel\">\n            <property name=\"toolTip\">\n             <string>The duration of a currently outstanding ping.</string>\n            </property>\n            <property name=\"text\">\n             <string>Ping Wait</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"15\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerPingWait\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"16\" column=\"0\">\n           <widget class=\"QLabel\" name=\"peerMinPingLabel\">\n            <property name=\"text\">\n             <string>Min Ping</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"16\" column=\"2\">\n           <widget class=\"QLabel\" name=\"peerMinPing\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"17\" column=\"0\">\n           <widget class=\"QLabel\" name=\"label_timeoffset\">\n            <property name=\"text\">\n             <string>Time Offset</string>\n            </property>\n           </widget>\n          </item>\n          <item row=\"17\" column=\"2\">\n           <widget class=\"QLabel\" name=\"timeoffset\">\n            <property name=\"cursor\">\n             <cursorShape>IBeamCursor</cursorShape>\n            </property>\n            <property name=\"text\">\n             <string>N/A</string>\n            </property>\n            <property name=\"textFormat\">\n             <enum>Qt::PlainText</enum>\n            </property>\n            <property name=\"textInteractionFlags\">\n             <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n            </property>\n           </widget>\n          </item>\n          <item row=\"18\" column=\"1\">\n           <spacer name=\"verticalSpacer_3\">\n            <property name=\"orientation\">\n             <enum>Qt::Vertical</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>20</width>\n              <height>40</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n         </layout>\n        </widget>\n       </item>\n      </layout>\n     </widget>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>TrafficGraphWidget</class>\n   <extends>QWidget</extends>\n   <header>qt/trafficgraphwidget.h</header>\n   <container>1</container>\n   <slots>\n    <slot>clear()</slot>\n   </slots>\n  </customwidget>\n </customwidgets>\n <resources>\n  <include location=\"../bitcoin.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/editaddressdialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>EditAddressDialog</class>\n <widget class=\"QDialog\" name=\"EditAddressDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>457</width>\n    <height>126</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Edit Address</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <item>\n    <layout class=\"QFormLayout\" name=\"formLayout\">\n     <property name=\"fieldGrowthPolicy\">\n      <enum>QFormLayout::AllNonFixedFieldsGrow</enum>\n     </property>\n     <item row=\"0\" column=\"0\">\n      <widget class=\"QLabel\" name=\"label\">\n       <property name=\"text\">\n        <string>&amp;Label</string>\n       </property>\n       <property name=\"buddy\">\n        <cstring>labelEdit</cstring>\n       </property>\n      </widget>\n     </item>\n     <item row=\"0\" column=\"1\">\n      <widget class=\"QLineEdit\" name=\"labelEdit\">\n       <property name=\"toolTip\">\n        <string>The label associated with this address list entry</string>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"0\">\n      <widget class=\"QLabel\" name=\"label_2\">\n       <property name=\"text\">\n        <string>&amp;Address</string>\n       </property>\n       <property name=\"buddy\">\n        <cstring>addressEdit</cstring>\n       </property>\n      </widget>\n     </item>\n     <item row=\"1\" column=\"1\">\n      <widget class=\"QValidatedLineEdit\" name=\"addressEdit\">\n       <property name=\"toolTip\">\n        <string>The address associated with this address list entry. This can only be modified for sending addresses.</string>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <widget class=\"QDialogButtonBox\" name=\"buttonBox\">\n     <property name=\"orientation\">\n      <enum>Qt::Horizontal</enum>\n     </property>\n     <property name=\"standardButtons\">\n      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>QValidatedLineEdit</class>\n   <extends>QLineEdit</extends>\n   <header>qt/qvalidatedlineedit.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>accepted()</signal>\n   <receiver>EditAddressDialog</receiver>\n   <slot>accept()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>rejected()</signal>\n   <receiver>EditAddressDialog</receiver>\n   <slot>reject()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/helpmessagedialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>HelpMessageDialog</class>\n <widget class=\"QDialog\" name=\"HelpMessageDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>780</width>\n    <height>440</height>\n   </rect>\n  </property>\n  <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2\">\n   <property name=\"spacing\">\n    <number>0</number>\n   </property>\n   <property name=\"leftMargin\">\n    <number>12</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>12</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>12</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>12</number>\n   </property>\n   <item>\n    <layout class=\"QVBoxLayout\" name=\"verticalLayoutLogo\" stretch=\"0,0\">\n     <property name=\"leftMargin\">\n      <number>0</number>\n     </property>\n     <property name=\"topMargin\">\n      <number>4</number>\n     </property>\n     <property name=\"rightMargin\">\n      <number>0</number>\n     </property>\n     <item>\n      <widget class=\"QLabel\" name=\"aboutLogo\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Ignored\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"maximumSize\">\n        <size>\n         <width>100</width>\n         <height>100</height>\n        </size>\n       </property>\n       <property name=\"pixmap\">\n        <pixmap resource=\"../bitcoin.qrc\">:/icons/bitcoin</pixmap>\n       </property>\n       <property name=\"scaledContents\">\n        <bool>true</bool>\n       </property>\n       <property name=\"alignment\">\n        <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QFrame\" name=\"frame\">\n       <property name=\"frameShape\">\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"frameShadow\">\n        <enum>QFrame::Raised</enum>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n     <item>\n      <widget class=\"QTextEdit\" name=\"helpMessage\">\n       <property name=\"readOnly\">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QScrollArea\" name=\"scrollArea\">\n       <property name=\"frameShape\">\n        <enum>QFrame::NoFrame</enum>\n       </property>\n       <property name=\"verticalScrollBarPolicy\">\n        <enum>Qt::ScrollBarAlwaysOn</enum>\n       </property>\n       <property name=\"widgetResizable\">\n        <bool>true</bool>\n       </property>\n       <widget class=\"QWidget\" name=\"scrollAreaWidgetContents\">\n        <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\">\n         <item>\n          <widget class=\"QLabel\" name=\"aboutMessage\">\n           <property name=\"cursor\">\n            <cursorShape>IBeamCursor</cursorShape>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n           <property name=\"alignment\">\n            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>\n           </property>\n           <property name=\"openExternalLinks\">\n            <bool>true</bool>\n           </property>\n           <property name=\"textInteractionFlags\">\n            <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </widget>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"verticalSpacer\">\n       <property name=\"orientation\">\n        <enum>Qt::Vertical</enum>\n       </property>\n       <property name=\"sizeType\">\n        <enum>QSizePolicy::Fixed</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>4</width>\n         <height>4</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QDialogButtonBox\" name=\"okButton\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"standardButtons\">\n        <set>QDialogButtonBox::Ok</set>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <resources>\n  <include location=\"../bitcoin.qrc\"/>\n </resources>\n <connections>\n  <connection>\n   <sender>okButton</sender>\n   <signal>accepted()</signal>\n   <receiver>HelpMessageDialog</receiver>\n   <slot>accept()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>okButton</sender>\n   <signal>rejected()</signal>\n   <receiver>HelpMessageDialog</receiver>\n   <slot>reject()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/intro.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>Intro</class>\n <widget class=\"QDialog\" name=\"Intro\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>674</width>\n    <height>474</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Welcome</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <item>\n    <widget class=\"QLabel\" name=\"welcomeLabel\">\n     <property name=\"styleSheet\">\n      <string notr=\"true\">QLabel { font-style:italic; }</string>\n     </property>\n     <property name=\"text\">\n      <string>Welcome to %1.</string>\n     </property>\n     <property name=\"wordWrap\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <spacer name=\"verticalSpacer_4\">\n     <property name=\"orientation\">\n      <enum>Qt::Vertical</enum>\n     </property>\n     <property name=\"sizeType\">\n      <enum>QSizePolicy::Minimum</enum>\n     </property>\n     <property name=\"sizeHint\" stdset=\"0\">\n      <size>\n       <width>20</width>\n       <height>15</height>\n      </size>\n     </property>\n    </spacer>\n   </item>\n   <item>\n    <widget class=\"QLabel\" name=\"storageLabel\">\n     <property name=\"text\">\n      <string>As this is the first time the program is launched, you can choose where %1 will store its data.</string>\n     </property>\n     <property name=\"wordWrap\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QLabel\" name=\"sizeWarningLabel\">\n     <property name=\"wordWrap\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QRadioButton\" name=\"dataDirDefault\">\n     <property name=\"text\">\n      <string>Use the default data directory</string>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QRadioButton\" name=\"dataDirCustom\">\n     <property name=\"text\">\n      <string>Use a custom data directory:</string>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n     <property name=\"spacing\">\n      <number>0</number>\n     </property>\n     <property name=\"sizeConstraint\">\n      <enum>QLayout::SetDefaultConstraint</enum>\n     </property>\n     <item>\n      <spacer name=\"horizontalSpacer\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeType\">\n        <enum>QSizePolicy::Fixed</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>60</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\">\n       <property name=\"sizeConstraint\">\n        <enum>QLayout::SetDefaultConstraint</enum>\n       </property>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2\">\n         <item>\n          <widget class=\"QLineEdit\" name=\"dataDirectory\"/>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"ellipsisButton\">\n           <property name=\"sizePolicy\">\n            <sizepolicy hsizetype=\"Minimum\" vsizetype=\"Fixed\">\n             <horstretch>0</horstretch>\n             <verstretch>0</verstretch>\n            </sizepolicy>\n           </property>\n           <property name=\"maximumSize\">\n            <size>\n             <width>30</width>\n             <height>16777215</height>\n            </size>\n           </property>\n           <property name=\"text\">\n            <string notr=\"true\">…</string>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <spacer name=\"verticalSpacer_3\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeType\">\n          <enum>QSizePolicy::Fixed</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>5</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n       <item>\n        <widget class=\"QLabel\" name=\"freeSpace\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Expanding\">\n           <horstretch>1</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"text\">\n          <string/>\n         </property>\n         <property name=\"wordWrap\">\n          <bool>true</bool>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <spacer name=\"verticalSpacer_2\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeType\">\n          <enum>QSizePolicy::Fixed</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>5</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n       <item>\n        <widget class=\"QLabel\" name=\"errorMessage\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Expanding\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::RichText</enum>\n         </property>\n         <property name=\"wordWrap\">\n          <bool>true</bool>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <widget class=\"QLabel\" name=\"lblExplanation1\">\n     <property name=\"text\">\n      <string>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</string>\n     </property>\n     <property name=\"wordWrap\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QLabel\" name=\"lblExplanation2\">\n     <property name=\"text\">\n      <string>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</string>\n     </property>\n     <property name=\"wordWrap\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QLabel\" name=\"lblExplanation3\">\n     <property name=\"text\">\n      <string>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</string>\n     </property>\n     <property name=\"wordWrap\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <spacer name=\"verticalSpacer\">\n     <property name=\"orientation\">\n      <enum>Qt::Vertical</enum>\n     </property>\n     <property name=\"sizeHint\" stdset=\"0\">\n      <size>\n       <width>20</width>\n       <height>40</height>\n      </size>\n     </property>\n    </spacer>\n   </item>\n   <item>\n    <widget class=\"QDialogButtonBox\" name=\"buttonBox\">\n     <property name=\"orientation\">\n      <enum>Qt::Horizontal</enum>\n     </property>\n     <property name=\"standardButtons\">\n      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <resources/>\n <connections>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>accepted()</signal>\n   <receiver>Intro</receiver>\n   <slot>accept()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>rejected()</signal>\n   <receiver>Intro</receiver>\n   <slot>reject()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/modaloverlay.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>ModalOverlay</class>\n <widget class=\"ModalOverlay\" name=\"ModalOverlay\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>640</width>\n    <height>385</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Form</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\" stretch=\"0\">\n   <property name=\"sizeConstraint\">\n    <enum>QLayout::SetDefaultConstraint</enum>\n   </property>\n   <property name=\"leftMargin\">\n    <number>0</number>\n   </property>\n   <property name=\"topMargin\">\n    <number>0</number>\n   </property>\n   <property name=\"rightMargin\">\n    <number>0</number>\n   </property>\n   <property name=\"bottomMargin\">\n    <number>0</number>\n   </property>\n   <item>\n    <widget class=\"QWidget\" name=\"bgWidget\" native=\"true\">\n     <property name=\"styleSheet\">\n      <string notr=\"true\">#bgWidget { background: rgba(0,0,0,220); }</string>\n     </property>\n     <layout class=\"QVBoxLayout\" name=\"verticalLayoutMain\" stretch=\"1\">\n      <property name=\"leftMargin\">\n       <number>60</number>\n      </property>\n      <property name=\"topMargin\">\n       <number>60</number>\n      </property>\n      <property name=\"rightMargin\">\n       <number>60</number>\n      </property>\n      <property name=\"bottomMargin\">\n       <number>60</number>\n      </property>\n      <item>\n       <widget class=\"QWidget\" name=\"contentWidget\" native=\"true\">\n        <property name=\"styleSheet\">\n         <string notr=\"true\">#contentWidget { background: rgba(255,255,255,240); border-radius: 6px; }\n\nQLabel { color: rgb(40,40,40);  }</string>\n        </property>\n        <layout class=\"QVBoxLayout\" name=\"verticalLayoutSub\" stretch=\"1,0,0,0\">\n         <property name=\"spacing\">\n          <number>0</number>\n         </property>\n         <property name=\"leftMargin\">\n          <number>10</number>\n         </property>\n         <property name=\"topMargin\">\n          <number>10</number>\n         </property>\n         <property name=\"rightMargin\">\n          <number>10</number>\n         </property>\n         <property name=\"bottomMargin\">\n          <number>10</number>\n         </property>\n         <item>\n          <layout class=\"QHBoxLayout\" name=\"horizontalLayoutIconText\" stretch=\"0,1\">\n           <property name=\"topMargin\">\n            <number>20</number>\n           </property>\n           <item>\n            <layout class=\"QVBoxLayout\" name=\"verticalLayoutIcon\">\n             <property name=\"leftMargin\">\n              <number>0</number>\n             </property>\n             <item>\n              <widget class=\"QPushButton\" name=\"warningIcon\">\n               <property name=\"enabled\">\n                <bool>false</bool>\n               </property>\n               <property name=\"text\">\n                <string/>\n               </property>\n               <property name=\"icon\">\n                <iconset>\n                 <normaloff>:/icons/warning</normaloff>\n                 <disabledoff>:/icons/warning</disabledoff>:/icons/warning</iconset>\n               </property>\n               <property name=\"iconSize\">\n                <size>\n                 <width>48</width>\n                 <height>48</height>\n                </size>\n               </property>\n               <property name=\"flat\">\n                <bool>true</bool>\n               </property>\n              </widget>\n             </item>\n             <item>\n              <spacer name=\"verticalSpacerWarningIcon\">\n               <property name=\"orientation\">\n                <enum>Qt::Vertical</enum>\n               </property>\n               <property name=\"sizeHint\" stdset=\"0\">\n                <size>\n                 <width>20</width>\n                 <height>40</height>\n                </size>\n               </property>\n              </spacer>\n             </item>\n            </layout>\n           </item>\n           <item>\n            <layout class=\"QVBoxLayout\" name=\"verticalLayoutInfoText\">\n             <property name=\"leftMargin\">\n              <number>0</number>\n             </property>\n             <property name=\"topMargin\">\n              <number>0</number>\n             </property>\n             <item>\n              <widget class=\"QLabel\" name=\"infoText\">\n               <property name=\"text\">\n                <string>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the sugarchain network, as detailed below.</string>\n               </property>\n               <property name=\"textFormat\">\n                <enum>Qt::RichText</enum>\n               </property>\n               <property name=\"wordWrap\">\n                <bool>true</bool>\n               </property>\n              </widget>\n             </item>\n             <item>\n              <widget class=\"QLabel\" name=\"infoTextStrong\">\n               <property name=\"font\">\n                <font>\n                 <weight>75</weight>\n                 <bold>true</bold>\n                </font>\n               </property>\n               <property name=\"text\">\n                <string>Attempting to spend sugarchains that are affected by not-yet-displayed transactions will not be accepted by the network.</string>\n               </property>\n               <property name=\"textFormat\">\n                <enum>Qt::RichText</enum>\n               </property>\n               <property name=\"wordWrap\">\n                <bool>true</bool>\n               </property>\n              </widget>\n             </item>\n             <item>\n              <spacer name=\"verticalSpacerInTextSpace\">\n               <property name=\"orientation\">\n                <enum>Qt::Vertical</enum>\n               </property>\n               <property name=\"sizeHint\" stdset=\"0\">\n                <size>\n                 <width>20</width>\n                 <height>40</height>\n                </size>\n               </property>\n              </spacer>\n             </item>\n            </layout>\n           </item>\n          </layout>\n         </item>\n         <item>\n          <spacer name=\"verticalSpacerAfterText\">\n           <property name=\"orientation\">\n            <enum>Qt::Vertical</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>20</width>\n             <height>40</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item>\n          <layout class=\"QFormLayout\" name=\"formLayout\">\n           <property name=\"fieldGrowthPolicy\">\n            <enum>QFormLayout::FieldsStayAtSizeHint</enum>\n           </property>\n           <property name=\"horizontalSpacing\">\n            <number>6</number>\n           </property>\n           <property name=\"verticalSpacing\">\n            <number>6</number>\n           </property>\n           <property name=\"topMargin\">\n            <number>10</number>\n           </property>\n           <item row=\"0\" column=\"0\">\n            <widget class=\"QLabel\" name=\"labelNumberOfBlocksLeft\">\n             <property name=\"font\">\n              <font>\n               <weight>75</weight>\n               <bold>true</bold>\n              </font>\n             </property>\n             <property name=\"text\">\n              <string>Number of blocks left</string>\n             </property>\n            </widget>\n           </item>\n           <item row=\"0\" column=\"1\">\n            <widget class=\"QLabel\" name=\"numberOfBlocksLeft\">\n             <property name=\"text\">\n              <string>Unknown...</string>\n             </property>\n            </widget>\n           </item>\n           <item row=\"1\" column=\"0\">\n            <widget class=\"QLabel\" name=\"labelLastBlockTime\">\n             <property name=\"font\">\n              <font>\n               <weight>75</weight>\n               <bold>true</bold>\n              </font>\n             </property>\n             <property name=\"text\">\n              <string>Last block time</string>\n             </property>\n            </widget>\n           </item>\n           <item row=\"1\" column=\"1\">\n            <widget class=\"QLabel\" name=\"newestBlockDate\">\n             <property name=\"sizePolicy\">\n              <sizepolicy hsizetype=\"Maximum\" vsizetype=\"Preferred\">\n               <horstretch>0</horstretch>\n               <verstretch>0</verstretch>\n              </sizepolicy>\n             </property>\n             <property name=\"text\">\n              <string>Unknown...</string>\n             </property>\n            </widget>\n           </item>\n           <item row=\"2\" column=\"0\">\n            <widget class=\"QLabel\" name=\"labelSyncDone\">\n             <property name=\"font\">\n              <font>\n               <weight>75</weight>\n               <bold>true</bold>\n              </font>\n             </property>\n             <property name=\"text\">\n              <string>Progress</string>\n             </property>\n            </widget>\n           </item>\n           <item row=\"2\" column=\"1\">\n            <layout class=\"QHBoxLayout\" name=\"horizontalLayoutSync\" stretch=\"0,1\">\n             <item>\n              <widget class=\"QLabel\" name=\"percentageProgress\">\n               <property name=\"text\">\n                <string notr=\"true\">~</string>\n               </property>\n              </widget>\n             </item>\n             <item>\n              <widget class=\"QProgressBar\" name=\"progressBar\">\n               <property name=\"value\">\n                <number>24</number>\n               </property>\n               <property name=\"format\">\n                <string/>\n               </property>\n              </widget>\n             </item>\n            </layout>\n           </item>\n           <item row=\"4\" column=\"0\">\n            <widget class=\"QLabel\" name=\"labelProgressIncrease\">\n             <property name=\"font\">\n              <font>\n               <weight>75</weight>\n               <bold>true</bold>\n              </font>\n             </property>\n             <property name=\"text\">\n              <string>Progress increase per hour</string>\n             </property>\n            </widget>\n           </item>\n           <item row=\"4\" column=\"1\">\n            <widget class=\"QLabel\" name=\"progressIncreasePerH\">\n             <property name=\"text\">\n              <string>calculating...</string>\n             </property>\n            </widget>\n           </item>\n           <item row=\"5\" column=\"0\">\n            <widget class=\"QLabel\" name=\"labelEstimatedTimeLeft\">\n             <property name=\"font\">\n              <font>\n               <weight>75</weight>\n               <bold>true</bold>\n              </font>\n             </property>\n             <property name=\"text\">\n              <string>Estimated time left until synced</string>\n             </property>\n            </widget>\n           </item>\n           <item row=\"5\" column=\"1\">\n            <widget class=\"QLabel\" name=\"expectedTimeLeft\">\n             <property name=\"text\">\n              <string>calculating...</string>\n             </property>\n            </widget>\n           </item>\n          </layout>\n         </item>\n         <item>\n          <layout class=\"QHBoxLayout\" name=\"horizontalLayoutButtons\">\n           <property name=\"leftMargin\">\n            <number>10</number>\n           </property>\n           <property name=\"topMargin\">\n            <number>10</number>\n           </property>\n           <item>\n            <spacer name=\"horizontalSpacer\">\n             <property name=\"orientation\">\n              <enum>Qt::Horizontal</enum>\n             </property>\n             <property name=\"sizeHint\" stdset=\"0\">\n              <size>\n               <width>40</width>\n               <height>20</height>\n              </size>\n             </property>\n            </spacer>\n           </item>\n           <item>\n            <widget class=\"QPushButton\" name=\"closeButton\">\n             <property name=\"text\">\n              <string>Hide</string>\n             </property>\n            </widget>\n           </item>\n          </layout>\n         </item>\n        </layout>\n       </widget>\n      </item>\n     </layout>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>ModalOverlay</class>\n   <extends>QWidget</extends>\n   <header>qt/modaloverlay.h</header>\n   <container>1</container>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/openuridialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>OpenURIDialog</class>\n <widget class=\"QDialog\" name=\"OpenURIDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>564</width>\n    <height>109</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Open URI</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <item>\n    <widget class=\"QLabel\" name=\"label_2\">\n     <property name=\"text\">\n      <string>Open payment request from URI or file</string>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n     <item>\n      <widget class=\"QLabel\" name=\"label\">\n       <property name=\"text\">\n        <string>URI:</string>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QValidatedLineEdit\" name=\"uriEdit\"/>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"selectFileButton\">\n       <property name=\"toolTip\">\n        <string>Select payment request file</string>\n       </property>\n       <property name=\"text\">\n        <string notr=\"true\">…</string>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n   <item>\n    <spacer name=\"verticalSpacer\">\n     <property name=\"orientation\">\n      <enum>Qt::Vertical</enum>\n     </property>\n     <property name=\"sizeHint\" stdset=\"0\">\n      <size>\n       <width>20</width>\n       <height>40</height>\n      </size>\n     </property>\n    </spacer>\n   </item>\n   <item>\n    <widget class=\"QDialogButtonBox\" name=\"buttonBox\">\n     <property name=\"orientation\">\n      <enum>Qt::Horizontal</enum>\n     </property>\n     <property name=\"standardButtons\">\n      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>QValidatedLineEdit</class>\n   <extends>QLineEdit</extends>\n   <header>qt/qvalidatedlineedit.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>accepted()</signal>\n   <receiver>OpenURIDialog</receiver>\n   <slot>accept()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>248</x>\n     <y>254</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>157</x>\n     <y>274</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>rejected()</signal>\n   <receiver>OpenURIDialog</receiver>\n   <slot>reject()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>316</x>\n     <y>260</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>286</x>\n     <y>274</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/optionsdialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>OptionsDialog</class>\n <widget class=\"QDialog\" name=\"OptionsDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>560</width>\n    <height>440</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Options</string>\n  </property>\n  <property name=\"modal\">\n   <bool>true</bool>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <item>\n    <widget class=\"QTabWidget\" name=\"tabWidget\">\n     <property name=\"currentIndex\">\n      <number>0</number>\n     </property>\n     <widget class=\"QWidget\" name=\"tabMain\">\n      <attribute name=\"title\">\n       <string>&amp;Main</string>\n      </attribute>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_Main\">\n       <item>\n        <widget class=\"QCheckBox\" name=\"bitcoinAtStartup\">\n         <property name=\"toolTip\">\n          <string>Automatically start %1 after logging in to the system.</string>\n         </property>\n         <property name=\"text\">\n          <string>&amp;Start %1 on system login</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2_Main\">\n         <item>\n          <widget class=\"QLabel\" name=\"databaseCacheLabel\">\n           <property name=\"text\">\n            <string>Size of &amp;database cache</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n           <property name=\"buddy\">\n            <cstring>databaseCache</cstring>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QSpinBox\" name=\"databaseCache\"/>\n         </item>\n         <item>\n          <widget class=\"QLabel\" name=\"databaseCacheUnitLabel\">\n           <property name=\"text\">\n            <string>MB</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name=\"horizontalSpacer_2_Main\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3_Main\">\n         <item>\n          <widget class=\"QLabel\" name=\"threadsScriptVerifLabel\">\n           <property name=\"text\">\n            <string>Number of script &amp;verification threads</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n           <property name=\"buddy\">\n            <cstring>threadsScriptVerif</cstring>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QSpinBox\" name=\"threadsScriptVerif\">\n           <property name=\"toolTip\">\n            <string>(0 = auto, &lt;0 = leave that many cores free)</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name=\"horizontalSpacer_3_Main\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <spacer name=\"verticalSpacer_Main\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>40</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n      </layout>\n     </widget>\n     <widget class=\"QWidget\" name=\"tabWallet\">\n      <attribute name=\"title\">\n       <string>W&amp;allet</string>\n      </attribute>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_Wallet\">\n       <item>\n        <widget class=\"QGroupBox\" name=\"groupBox\">\n         <property name=\"title\">\n          <string>Expert</string>\n         </property>\n         <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\">\n          <item>\n           <widget class=\"QCheckBox\" name=\"coinControlFeatures\">\n            <property name=\"toolTip\">\n             <string>Whether to show coin control features or not.</string>\n            </property>\n            <property name=\"text\">\n             <string>Enable coin &amp;control features</string>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QCheckBox\" name=\"spendZeroConfChange\">\n            <property name=\"toolTip\">\n             <string>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</string>\n            </property>\n            <property name=\"text\">\n             <string>&amp;Spend unconfirmed change</string>\n            </property>\n           </widget>\n          </item>\n         </layout>\n        </widget>\n       </item>\n       <item>\n        <spacer name=\"verticalSpacer_Wallet\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>40</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n      </layout>\n     </widget>\n     <widget class=\"QWidget\" name=\"tabNetwork\">\n      <attribute name=\"title\">\n       <string>&amp;Network</string>\n      </attribute>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_Network\">\n       <item>\n        <widget class=\"QCheckBox\" name=\"mapPortUpnp\">\n         <property name=\"toolTip\">\n          <string>Automatically open the Sugarchain client port on the router. This only works when your router supports UPnP and it is enabled.</string>\n         </property>\n         <property name=\"text\">\n          <string>Map port using &amp;UPnP</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QCheckBox\" name=\"allowIncoming\">\n         <property name=\"toolTip\">\n          <string>Accept connections from outside.</string>\n         </property>\n         <property name=\"text\">\n          <string>Allow incomin&amp;g connections</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QCheckBox\" name=\"connectSocks\">\n         <property name=\"toolTip\">\n          <string>Connect to the Sugarchain network through a SOCKS5 proxy.</string>\n         </property>\n         <property name=\"text\">\n          <string>&amp;Connect through SOCKS5 proxy (default proxy):</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_1_Network\">\n         <item>\n          <widget class=\"QLabel\" name=\"proxyIpLabel\">\n           <property name=\"text\">\n            <string>Proxy &amp;IP:</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n           <property name=\"buddy\">\n            <cstring>proxyIp</cstring>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QValidatedLineEdit\" name=\"proxyIp\">\n           <property name=\"minimumSize\">\n            <size>\n             <width>140</width>\n             <height>0</height>\n            </size>\n           </property>\n           <property name=\"maximumSize\">\n            <size>\n             <width>140</width>\n             <height>16777215</height>\n            </size>\n           </property>\n           <property name=\"toolTip\">\n            <string>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QLabel\" name=\"proxyPortLabel\">\n           <property name=\"text\">\n            <string>&amp;Port:</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n           <property name=\"buddy\">\n            <cstring>proxyPort</cstring>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QLineEdit\" name=\"proxyPort\">\n           <property name=\"minimumSize\">\n            <size>\n             <width>55</width>\n             <height>0</height>\n            </size>\n           </property>\n           <property name=\"maximumSize\">\n            <size>\n             <width>55</width>\n             <height>16777215</height>\n            </size>\n           </property>\n           <property name=\"toolTip\">\n            <string>Port of the proxy (e.g. 9050)</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name=\"horizontalSpacer_1_Network\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2_Network\">\n         <item>\n          <widget class=\"QLabel\" name=\"proxyActiveNets\">\n           <property name=\"text\">\n            <string>Used for reaching peers via:</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QCheckBox\" name=\"proxyReachIPv4\">\n           <property name=\"enabled\">\n            <bool>false</bool>\n           </property>\n           <property name=\"toolTip\">\n            <string>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QLabel\" name=\"proxyReachIPv4Label\">\n           <property name=\"text\">\n            <string>IPv4</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QCheckBox\" name=\"proxyReachIPv6\">\n           <property name=\"enabled\">\n            <bool>false</bool>\n           </property>\n           <property name=\"toolTip\">\n            <string>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QLabel\" name=\"proxyReachIPv6Label\">\n           <property name=\"text\">\n            <string>IPv6</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QCheckBox\" name=\"proxyReachTor\">\n           <property name=\"enabled\">\n            <bool>false</bool>\n           </property>\n           <property name=\"toolTip\">\n            <string>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QLabel\" name=\"proxyReachTorLabel\">\n           <property name=\"text\">\n            <string>Tor</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name=\"horizontalSpacer_2_Network\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <widget class=\"QCheckBox\" name=\"connectSocksTor\">\n         <property name=\"toolTip\">\n          <string>Connect to the Sugarchain network through a separate SOCKS5 proxy for Tor hidden services.</string>\n         </property>\n         <property name=\"text\">\n          <string>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3_Network\">\n         <item>\n          <widget class=\"QLabel\" name=\"proxyIpTorLabel\">\n           <property name=\"text\">\n            <string>Proxy &amp;IP:</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n           <property name=\"buddy\">\n            <cstring>proxyIpTor</cstring>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QValidatedLineEdit\" name=\"proxyIpTor\">\n           <property name=\"minimumSize\">\n            <size>\n             <width>140</width>\n             <height>0</height>\n            </size>\n           </property>\n           <property name=\"maximumSize\">\n            <size>\n             <width>140</width>\n             <height>16777215</height>\n            </size>\n           </property>\n           <property name=\"toolTip\">\n            <string>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QLabel\" name=\"proxyPortTorLabel\">\n           <property name=\"text\">\n            <string>&amp;Port:</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n           <property name=\"buddy\">\n            <cstring>proxyPortTor</cstring>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QLineEdit\" name=\"proxyPortTor\">\n           <property name=\"minimumSize\">\n            <size>\n             <width>55</width>\n             <height>0</height>\n            </size>\n           </property>\n           <property name=\"maximumSize\">\n            <size>\n             <width>55</width>\n             <height>16777215</height>\n            </size>\n           </property>\n           <property name=\"toolTip\">\n            <string>Port of the proxy (e.g. 9050)</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name=\"horizontalSpacer_4_Network\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>20</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <spacer name=\"verticalSpacer_Network\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>40</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n      </layout>\n     </widget>\n     <widget class=\"QWidget\" name=\"tabWindow\">\n      <attribute name=\"title\">\n       <string>&amp;Window</string>\n      </attribute>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_Window\">\n       <item>\n        <widget class=\"QCheckBox\" name=\"hideTrayIcon\">\n         <property name=\"toolTip\">\n          <string>Hide the icon from the system tray.</string>\n         </property>\n         <property name=\"text\">\n          <string>&amp;Hide tray icon</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QCheckBox\" name=\"minimizeToTray\">\n         <property name=\"toolTip\">\n          <string>Show only a tray icon after minimizing the window.</string>\n         </property>\n         <property name=\"text\">\n          <string>&amp;Minimize to the tray instead of the taskbar</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QCheckBox\" name=\"minimizeOnClose\">\n         <property name=\"toolTip\">\n          <string>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</string>\n         </property>\n         <property name=\"text\">\n          <string>M&amp;inimize on close</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <spacer name=\"verticalSpacer_Window\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>40</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n      </layout>\n     </widget>\n     <widget class=\"QWidget\" name=\"tabDisplay\">\n      <attribute name=\"title\">\n       <string>&amp;Display</string>\n      </attribute>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_Display\">\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_1_Display\">\n         <item>\n          <widget class=\"QLabel\" name=\"langLabel\">\n           <property name=\"text\">\n            <string>User Interface &amp;language:</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n           <property name=\"buddy\">\n            <cstring>lang</cstring>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QValueComboBox\" name=\"lang\">\n           <property name=\"toolTip\">\n            <string>The user interface language can be set here. This setting will take effect after restarting %1.</string>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2_Display\">\n         <item>\n          <widget class=\"QLabel\" name=\"unitLabel\">\n           <property name=\"text\">\n            <string>&amp;Unit to show amounts in:</string>\n           </property>\n           <property name=\"textFormat\">\n            <enum>Qt::PlainText</enum>\n           </property>\n           <property name=\"buddy\">\n            <cstring>unit</cstring>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QValueComboBox\" name=\"unit\">\n           <property name=\"toolTip\">\n            <string>Choose the default subdivision unit to show in the interface and when sending coins.</string>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3_Display\">\n         <item>\n          <widget class=\"QLabel\" name=\"thirdPartyTxUrlsLabel\">\n           <property name=\"toolTip\">\n            <string>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</string>\n           </property>\n           <property name=\"text\">\n            <string>&amp;Third party transaction URLs</string>\n           </property>\n           <property name=\"buddy\">\n            <cstring>thirdPartyTxUrls</cstring>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QLineEdit\" name=\"thirdPartyTxUrls\">\n           <property name=\"toolTip\">\n            <string>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</string>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <spacer name=\"verticalSpacer_Display\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>40</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n      </layout>\n     </widget>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QFrame\" name=\"frame\">\n     <layout class=\"QVBoxLayout\" name=\"verticalLayout_Bottom\">\n      <item>\n       <layout class=\"QHBoxLayout\" name=\"horizontalLayout_Bottom\">\n        <item>\n         <widget class=\"QLabel\" name=\"overriddenByCommandLineInfoLabel\">\n          <property name=\"text\">\n           <string>Active command-line options that override above options:</string>\n          </property>\n          <property name=\"textFormat\">\n           <enum>Qt::PlainText</enum>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_Bottom\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>40</width>\n            <height>20</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n       </layout>\n      </item>\n      <item>\n       <widget class=\"QLabel\" name=\"overriddenByCommandLineLabel\">\n        <property name=\"text\">\n         <string/>\n        </property>\n        <property name=\"textFormat\">\n         <enum>Qt::PlainText</enum>\n        </property>\n        <property name=\"wordWrap\">\n         <bool>true</bool>\n        </property>\n       </widget>\n      </item>\n     </layout>\n    </widget>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout_Buttons\">\n     <item>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_Buttons\">\n       <item>\n        <widget class=\"QPushButton\" name=\"openBitcoinConfButton\">\n         <property name=\"toolTip\">\n          <string>Open the %1 configuration file from the working directory.</string>\n         </property>\n         <property name=\"text\">\n          <string>Open Configuration File</string>\n         </property>\n         <property name=\"autoDefault\">\n          <bool>false</bool>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QPushButton\" name=\"resetButton\">\n         <property name=\"toolTip\">\n          <string>Reset all client options to default.</string>\n         </property>\n         <property name=\"text\">\n          <string>&amp;Reset Options</string>\n         </property>\n         <property name=\"autoDefault\">\n          <bool>false</bool>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_1\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>48</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QLabel\" name=\"statusLabel\">\n       <property name=\"minimumSize\">\n        <size>\n         <width>200</width>\n         <height>0</height>\n        </size>\n       </property>\n       <property name=\"font\">\n        <font>\n         <weight>75</weight>\n         <bold>true</bold>\n        </font>\n       </property>\n       <property name=\"text\">\n        <string/>\n       </property>\n       <property name=\"textFormat\">\n        <enum>Qt::PlainText</enum>\n       </property>\n       <property name=\"wordWrap\">\n        <bool>true</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_2\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>48</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_4\">\n       <item>\n        <spacer name=\"verticalSpacer\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>40</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n         <item>\n          <widget class=\"QPushButton\" name=\"okButton\">\n           <property name=\"text\">\n            <string>&amp;OK</string>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n           <property name=\"default\">\n            <bool>true</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"cancelButton\">\n           <property name=\"text\">\n            <string>&amp;Cancel</string>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>QValidatedLineEdit</class>\n   <extends>QLineEdit</extends>\n   <header>qt/qvalidatedlineedit.h</header>\n  </customwidget>\n  <customwidget>\n   <class>QValueComboBox</class>\n   <extends>QComboBox</extends>\n   <header>qt/qvaluecombobox.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/overviewpage.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>OverviewPage</class>\n <widget class=\"QWidget\" name=\"OverviewPage\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>596</width>\n    <height>342</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Form</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"topLayout\">\n   <item>\n    <widget class=\"QLabel\" name=\"labelAlerts\">\n     <property name=\"visible\">\n      <bool>false</bool>\n     </property>\n     <property name=\"styleSheet\">\n      <string notr=\"true\">QLabel { background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop:0 #F0D0A0, stop:1 #F8D488); color:#000000; }</string>\n     </property>\n     <property name=\"wordWrap\">\n      <bool>true</bool>\n     </property>\n     <property name=\"margin\">\n      <number>3</number>\n     </property>\n     <property name=\"textInteractionFlags\">\n      <set>Qt::TextSelectableByMouse</set>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout\" stretch=\"1,1\">\n     <item>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\">\n       <item>\n        <widget class=\"QFrame\" name=\"frame\">\n         <property name=\"frameShape\">\n          <enum>QFrame::StyledPanel</enum>\n         </property>\n         <property name=\"frameShadow\">\n          <enum>QFrame::Raised</enum>\n         </property>\n         <layout class=\"QVBoxLayout\" name=\"verticalLayout_4\">\n          <item>\n           <layout class=\"QHBoxLayout\" name=\"horizontalLayout_4\">\n            <item>\n             <widget class=\"QLabel\" name=\"label_5\">\n              <property name=\"font\">\n               <font>\n                <weight>75</weight>\n                <bold>true</bold>\n               </font>\n              </property>\n              <property name=\"text\">\n               <string>Balances</string>\n              </property>\n             </widget>\n            </item>\n            <item>\n             <widget class=\"QPushButton\" name=\"labelWalletStatus\">\n              <property name=\"enabled\">\n               <bool>true</bool>\n              </property>\n              <property name=\"maximumSize\">\n               <size>\n                <width>30</width>\n                <height>16777215</height>\n               </size>\n              </property>\n              <property name=\"toolTip\">\n               <string>The displayed information may be out of date. Your wallet automatically synchronizes with the Sugarchain network after a connection is established, but this process has not completed yet.</string>\n              </property>\n              <property name=\"text\">\n               <string/>\n              </property>\n              <property name=\"icon\">\n               <iconset resource=\"../bitcoin.qrc\">\n                <normaloff>:/icons/warning</normaloff>\n                <disabledoff>:/icons/warning</disabledoff>:/icons/warning</iconset>\n              </property>\n              <property name=\"iconSize\">\n               <size>\n                <width>24</width>\n                <height>24</height>\n               </size>\n              </property>\n              <property name=\"flat\">\n               <bool>true</bool>\n              </property>\n             </widget>\n            </item>\n            <item>\n             <spacer name=\"horizontalSpacer_3\">\n              <property name=\"orientation\">\n               <enum>Qt::Horizontal</enum>\n              </property>\n              <property name=\"sizeHint\" stdset=\"0\">\n               <size>\n                <width>40</width>\n                <height>20</height>\n               </size>\n              </property>\n             </spacer>\n            </item>\n           </layout>\n          </item>\n          <item>\n           <layout class=\"QGridLayout\" name=\"gridLayout\">\n            <property name=\"spacing\">\n             <number>12</number>\n            </property>\n            <item row=\"2\" column=\"2\">\n             <widget class=\"QLabel\" name=\"labelWatchPending\">\n              <property name=\"font\">\n               <font>\n                <weight>75</weight>\n                <bold>true</bold>\n               </font>\n              </property>\n              <property name=\"cursor\">\n               <cursorShape>IBeamCursor</cursorShape>\n              </property>\n              <property name=\"toolTip\">\n               <string>Unconfirmed transactions to watch-only addresses</string>\n              </property>\n              <property name=\"text\">\n               <string notr=\"true\">0.000 000 00 SUGAR</string>\n              </property>\n              <property name=\"alignment\">\n               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n              </property>\n              <property name=\"textInteractionFlags\">\n               <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n              </property>\n             </widget>\n            </item>\n            <item row=\"2\" column=\"1\">\n             <widget class=\"QLabel\" name=\"labelUnconfirmed\">\n              <property name=\"font\">\n               <font>\n                <weight>75</weight>\n                <bold>true</bold>\n               </font>\n              </property>\n              <property name=\"cursor\">\n               <cursorShape>IBeamCursor</cursorShape>\n              </property>\n              <property name=\"toolTip\">\n               <string>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</string>\n              </property>\n              <property name=\"text\">\n               <string notr=\"true\">0.000 000 00 SUGAR</string>\n              </property>\n              <property name=\"alignment\">\n               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n              </property>\n              <property name=\"textInteractionFlags\">\n               <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n              </property>\n             </widget>\n            </item>\n            <item row=\"3\" column=\"2\">\n             <widget class=\"QLabel\" name=\"labelWatchImmature\">\n              <property name=\"font\">\n               <font>\n                <weight>75</weight>\n                <bold>true</bold>\n               </font>\n              </property>\n              <property name=\"cursor\">\n               <cursorShape>IBeamCursor</cursorShape>\n              </property>\n              <property name=\"toolTip\">\n               <string>Mined balance in watch-only addresses that has not yet matured</string>\n              </property>\n              <property name=\"text\">\n               <string notr=\"true\">0.000 000 00 SUGAR</string>\n              </property>\n              <property name=\"alignment\">\n               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n              </property>\n              <property name=\"textInteractionFlags\">\n               <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n              </property>\n             </widget>\n            </item>\n            <item row=\"4\" column=\"0\" colspan=\"2\">\n             <widget class=\"Line\" name=\"line\">\n              <property name=\"orientation\">\n               <enum>Qt::Horizontal</enum>\n              </property>\n             </widget>\n            </item>\n            <item row=\"4\" column=\"2\">\n             <widget class=\"Line\" name=\"lineWatchBalance\">\n              <property name=\"sizePolicy\">\n               <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Fixed\">\n                <horstretch>0</horstretch>\n                <verstretch>0</verstretch>\n               </sizepolicy>\n              </property>\n              <property name=\"minimumSize\">\n               <size>\n                <width>140</width>\n                <height>0</height>\n               </size>\n              </property>\n              <property name=\"orientation\">\n               <enum>Qt::Horizontal</enum>\n              </property>\n             </widget>\n            </item>\n            <item row=\"5\" column=\"0\">\n             <widget class=\"QLabel\" name=\"labelTotalText\">\n              <property name=\"text\">\n               <string>Total:</string>\n              </property>\n             </widget>\n            </item>\n            <item row=\"3\" column=\"1\">\n             <widget class=\"QLabel\" name=\"labelImmature\">\n              <property name=\"font\">\n               <font>\n                <weight>75</weight>\n                <bold>true</bold>\n               </font>\n              </property>\n              <property name=\"cursor\">\n               <cursorShape>IBeamCursor</cursorShape>\n              </property>\n              <property name=\"toolTip\">\n               <string>Mined balance that has not yet matured</string>\n              </property>\n              <property name=\"text\">\n               <string notr=\"true\">0.000 000 00 SUGAR</string>\n              </property>\n              <property name=\"alignment\">\n               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n              </property>\n              <property name=\"textInteractionFlags\">\n               <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n              </property>\n             </widget>\n            </item>\n            <item row=\"2\" column=\"3\">\n             <spacer name=\"horizontalSpacer_2\">\n              <property name=\"orientation\">\n               <enum>Qt::Horizontal</enum>\n              </property>\n              <property name=\"sizeHint\" stdset=\"0\">\n               <size>\n                <width>40</width>\n                <height>20</height>\n               </size>\n              </property>\n             </spacer>\n            </item>\n            <item row=\"3\" column=\"0\">\n             <widget class=\"QLabel\" name=\"labelImmatureText\">\n              <property name=\"text\">\n               <string>Immature:</string>\n              </property>\n             </widget>\n            </item>\n            <item row=\"5\" column=\"1\">\n             <widget class=\"QLabel\" name=\"labelTotal\">\n              <property name=\"font\">\n               <font>\n                <weight>75</weight>\n                <bold>true</bold>\n               </font>\n              </property>\n              <property name=\"cursor\">\n               <cursorShape>IBeamCursor</cursorShape>\n              </property>\n              <property name=\"toolTip\">\n               <string>Your current total balance</string>\n              </property>\n              <property name=\"text\">\n               <string notr=\"true\">0.000 000 00 SUGAR</string>\n              </property>\n              <property name=\"alignment\">\n               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n              </property>\n              <property name=\"textInteractionFlags\">\n               <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n              </property>\n             </widget>\n            </item>\n            <item row=\"5\" column=\"2\">\n             <widget class=\"QLabel\" name=\"labelWatchTotal\">\n              <property name=\"font\">\n               <font>\n                <weight>75</weight>\n                <bold>true</bold>\n               </font>\n              </property>\n              <property name=\"cursor\">\n               <cursorShape>IBeamCursor</cursorShape>\n              </property>\n              <property name=\"toolTip\">\n               <string>Current total balance in watch-only addresses</string>\n              </property>\n              <property name=\"text\">\n               <string notr=\"true\">0.000 000 00 SUGAR</string>\n              </property>\n              <property name=\"alignment\">\n               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n              </property>\n              <property name=\"textInteractionFlags\">\n               <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n              </property>\n             </widget>\n            </item>\n            <item row=\"0\" column=\"2\">\n             <widget class=\"QLabel\" name=\"labelWatchonly\">\n              <property name=\"text\">\n               <string>Watch-only:</string>\n              </property>\n              <property name=\"alignment\">\n               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n              </property>\n             </widget>\n            </item>\n            <item row=\"1\" column=\"0\">\n             <widget class=\"QLabel\" name=\"labelBalanceText\">\n              <property name=\"text\">\n               <string>Available:</string>\n              </property>\n             </widget>\n            </item>\n            <item row=\"1\" column=\"1\">\n             <widget class=\"QLabel\" name=\"labelBalance\">\n              <property name=\"font\">\n               <font>\n                <weight>75</weight>\n                <bold>true</bold>\n               </font>\n              </property>\n              <property name=\"cursor\">\n               <cursorShape>IBeamCursor</cursorShape>\n              </property>\n              <property name=\"toolTip\">\n               <string>Your current spendable balance</string>\n              </property>\n              <property name=\"text\">\n               <string notr=\"true\">0.000 000 00 SUGAR</string>\n              </property>\n              <property name=\"alignment\">\n               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n              </property>\n              <property name=\"textInteractionFlags\">\n               <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n              </property>\n             </widget>\n            </item>\n            <item row=\"1\" column=\"2\">\n             <widget class=\"QLabel\" name=\"labelWatchAvailable\">\n              <property name=\"font\">\n               <font>\n                <weight>75</weight>\n                <bold>true</bold>\n               </font>\n              </property>\n              <property name=\"cursor\">\n               <cursorShape>IBeamCursor</cursorShape>\n              </property>\n              <property name=\"toolTip\">\n               <string>Your current balance in watch-only addresses</string>\n              </property>\n              <property name=\"text\">\n               <string notr=\"true\">0.000 000 00 SUGAR</string>\n              </property>\n              <property name=\"alignment\">\n               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n              </property>\n              <property name=\"textInteractionFlags\">\n               <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n              </property>\n             </widget>\n            </item>\n            <item row=\"2\" column=\"0\">\n             <widget class=\"QLabel\" name=\"labelPendingText\">\n              <property name=\"text\">\n               <string>Pending:</string>\n              </property>\n             </widget>\n            </item>\n            <item row=\"0\" column=\"1\">\n             <widget class=\"QLabel\" name=\"labelSpendable\">\n              <property name=\"text\">\n               <string>Spendable:</string>\n              </property>\n              <property name=\"alignment\">\n               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n              </property>\n             </widget>\n            </item>\n           </layout>\n          </item>\n         </layout>\n        </widget>\n       </item>\n       <item>\n        <spacer name=\"verticalSpacer\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>40</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n      </layout>\n     </item>\n     <item>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_3\">\n       <item>\n        <widget class=\"QFrame\" name=\"frame_2\">\n         <property name=\"frameShape\">\n          <enum>QFrame::StyledPanel</enum>\n         </property>\n         <property name=\"frameShadow\">\n          <enum>QFrame::Raised</enum>\n         </property>\n         <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n          <item>\n           <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2\">\n            <item>\n             <widget class=\"QLabel\" name=\"label_4\">\n              <property name=\"font\">\n               <font>\n                <weight>75</weight>\n                <bold>true</bold>\n               </font>\n              </property>\n              <property name=\"text\">\n               <string>Recent transactions</string>\n              </property>\n             </widget>\n            </item>\n            <item>\n             <widget class=\"QPushButton\" name=\"labelTransactionsStatus\">\n              <property name=\"enabled\">\n               <bool>true</bool>\n              </property>\n              <property name=\"maximumSize\">\n               <size>\n                <width>30</width>\n                <height>16777215</height>\n               </size>\n              </property>\n              <property name=\"toolTip\">\n               <string>The displayed information may be out of date. Your wallet automatically synchronizes with the Sugarchain network after a connection is established, but this process has not completed yet.</string>\n              </property>\n              <property name=\"text\">\n               <string/>\n              </property>\n              <property name=\"icon\">\n               <iconset resource=\"../bitcoin.qrc\">\n                <normaloff>:/icons/warning</normaloff>\n                <disabledoff>:/icons/warning</disabledoff>:/icons/warning</iconset>\n              </property>\n              <property name=\"iconSize\">\n               <size>\n                <width>24</width>\n                <height>24</height>\n               </size>\n              </property>\n              <property name=\"flat\">\n               <bool>true</bool>\n              </property>\n             </widget>\n            </item>\n            <item>\n             <spacer name=\"horizontalSpacer\">\n              <property name=\"orientation\">\n               <enum>Qt::Horizontal</enum>\n              </property>\n              <property name=\"sizeHint\" stdset=\"0\">\n               <size>\n                <width>40</width>\n                <height>20</height>\n               </size>\n              </property>\n             </spacer>\n            </item>\n           </layout>\n          </item>\n          <item>\n           <widget class=\"QListView\" name=\"listTransactions\">\n            <property name=\"styleSheet\">\n             <string notr=\"true\">QListView { background: transparent; }</string>\n            </property>\n            <property name=\"frameShape\">\n             <enum>QFrame::NoFrame</enum>\n            </property>\n            <property name=\"verticalScrollBarPolicy\">\n             <enum>Qt::ScrollBarAlwaysOff</enum>\n            </property>\n            <property name=\"horizontalScrollBarPolicy\">\n             <enum>Qt::ScrollBarAlwaysOff</enum>\n            </property>\n            <property name=\"selectionMode\">\n             <enum>QAbstractItemView::NoSelection</enum>\n            </property>\n           </widget>\n          </item>\n         </layout>\n        </widget>\n       </item>\n       <item>\n        <spacer name=\"verticalSpacer_2\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>40</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n      </layout>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <resources/>\n <connections/>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/receivecoinsdialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>ReceiveCoinsDialog</class>\n <widget class=\"QWidget\" name=\"ReceiveCoinsDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>776</width>\n    <height>396</height>\n   </rect>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\" stretch=\"0,0,1\">\n   <item>\n    <widget class=\"QFrame\" name=\"frame2\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Expanding\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"frameShape\">\n      <enum>QFrame::StyledPanel</enum>\n     </property>\n     <property name=\"frameShadow\">\n      <enum>QFrame::Sunken</enum>\n     </property>\n     <layout class=\"QVBoxLayout\" name=\"verticalLayout_3\">\n      <item>\n       <layout class=\"QGridLayout\" name=\"gridLayout\">\n        <item row=\"5\" column=\"0\">\n         <widget class=\"QLabel\" name=\"label\">\n          <property name=\"toolTip\">\n           <string>An optional amount to request. Leave this empty or zero to not request a specific amount.</string>\n          </property>\n          <property name=\"text\">\n           <string>&amp;Amount:</string>\n          </property>\n          <property name=\"alignment\">\n           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n          </property>\n          <property name=\"buddy\">\n           <cstring>reqAmount</cstring>\n          </property>\n         </widget>\n        </item>\n        <item row=\"6\" column=\"0\">\n         <widget class=\"QLabel\" name=\"label_3\">\n          <property name=\"toolTip\">\n           <string>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Sugarchain network.</string>\n          </property>\n          <property name=\"text\">\n           <string>&amp;Message:</string>\n          </property>\n          <property name=\"alignment\">\n           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n          </property>\n          <property name=\"buddy\">\n           <cstring>reqMessage</cstring>\n          </property>\n         </widget>\n        </item>\n        <item row=\"4\" column=\"2\">\n         <widget class=\"QLineEdit\" name=\"reqLabel\">\n          <property name=\"toolTip\">\n           <string>An optional label to associate with the new receiving address.</string>\n          </property>\n         </widget>\n        </item>\n        <item row=\"2\" column=\"2\">\n         <widget class=\"QLabel\" name=\"label_5\">\n          <property name=\"text\">\n           <string>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</string>\n          </property>\n         </widget>\n        </item>\n        <item row=\"4\" column=\"0\">\n         <widget class=\"QLabel\" name=\"label_2\">\n          <property name=\"toolTip\">\n           <string>An optional label to associate with the new receiving address.</string>\n          </property>\n          <property name=\"text\">\n           <string>&amp;Label:</string>\n          </property>\n          <property name=\"alignment\">\n           <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n          </property>\n          <property name=\"buddy\">\n           <cstring>reqLabel</cstring>\n          </property>\n         </widget>\n        </item>\n        <item row=\"6\" column=\"2\">\n         <widget class=\"QLineEdit\" name=\"reqMessage\">\n          <property name=\"toolTip\">\n           <string>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Sugarchain network.</string>\n          </property>\n         </widget>\n        </item>\n        <item row=\"7\" column=\"2\">\n         <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n          <item>\n           <widget class=\"QPushButton\" name=\"receiveButton\">\n            <property name=\"minimumSize\">\n             <size>\n              <width>150</width>\n              <height>0</height>\n             </size>\n            </property>\n            <property name=\"text\">\n             <string>&amp;Request payment</string>\n            </property>\n            <property name=\"icon\">\n             <iconset resource=\"../bitcoin.qrc\">\n              <normaloff>:/icons/receiving_addresses</normaloff>:/icons/receiving_addresses</iconset>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QPushButton\" name=\"clearButton\">\n            <property name=\"sizePolicy\">\n             <sizepolicy hsizetype=\"Minimum\" vsizetype=\"Fixed\">\n              <horstretch>0</horstretch>\n              <verstretch>0</verstretch>\n             </sizepolicy>\n            </property>\n            <property name=\"toolTip\">\n             <string>Clear all fields of the form.</string>\n            </property>\n            <property name=\"text\">\n             <string>Clear</string>\n            </property>\n            <property name=\"icon\">\n             <iconset resource=\"../bitcoin.qrc\">\n              <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>\n            </property>\n            <property name=\"autoDefault\">\n             <bool>false</bool>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <spacer name=\"horizontalSpacer\">\n            <property name=\"orientation\">\n             <enum>Qt::Horizontal</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>40</width>\n              <height>20</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n         </layout>\n        </item>\n        <item row=\"7\" column=\"0\">\n         <widget class=\"QLabel\" name=\"label_7\">\n          <property name=\"text\">\n           <string/>\n          </property>\n         </widget>\n        </item>\n        <item row=\"5\" column=\"2\">\n         <layout class=\"QHBoxLayout\" name=\"horizontalLayout_6\">\n          <item>\n           <widget class=\"BitcoinAmountField\" name=\"reqAmount\">\n            <property name=\"sizePolicy\">\n             <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n              <horstretch>0</horstretch>\n              <verstretch>0</verstretch>\n             </sizepolicy>\n            </property>\n            <property name=\"minimumSize\">\n             <size>\n              <width>80</width>\n              <height>0</height>\n             </size>\n            </property>\n            <property name=\"maximumSize\">\n             <size>\n              <width>1000</width>\n              <height>100</height>\n             </size>\n            </property>\n            <property name=\"toolTip\">\n             <string>An optional amount to request. Leave this empty or zero to not request a specific amount.</string>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QCheckBox\" name=\"useBech32\">\n            <property name=\"sizePolicy\">\n             <sizepolicy hsizetype=\"Fixed\" vsizetype=\"Fixed\">\n              <horstretch>0</horstretch>\n              <verstretch>0</verstretch>\n             </sizepolicy>\n            </property>\n            <property name=\"maximumSize\">\n             <size>\n              <width>1000</width>\n              <height>16777215</height>\n             </size>\n            </property>\n            <property name=\"focusPolicy\">\n             <enum>Qt::StrongFocus</enum>\n            </property>\n            <property name=\"toolTip\">\n             <string>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</string>\n            </property>\n            <property name=\"text\">\n             <string>Generate native segwit (Bech32) address</string>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <spacer name=\"horizontalSpacer_3\">\n            <property name=\"orientation\">\n             <enum>Qt::Horizontal</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>0</width>\n              <height>0</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n         </layout>\n        </item>\n       </layout>\n      </item>\n     </layout>\n    </widget>\n   </item>\n   <item>\n    <spacer name=\"verticalSpacer_2\">\n     <property name=\"orientation\">\n      <enum>Qt::Vertical</enum>\n     </property>\n     <property name=\"sizeHint\" stdset=\"0\">\n      <size>\n       <width>20</width>\n       <height>10</height>\n      </size>\n     </property>\n    </spacer>\n   </item>\n   <item>\n    <widget class=\"QFrame\" name=\"frame\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Expanding\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"frameShape\">\n      <enum>QFrame::StyledPanel</enum>\n     </property>\n     <property name=\"frameShadow\">\n      <enum>QFrame::Raised</enum>\n     </property>\n     <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\">\n      <item>\n       <widget class=\"QLabel\" name=\"label_6\">\n        <property name=\"font\">\n         <font>\n          <weight>75</weight>\n          <bold>true</bold>\n         </font>\n        </property>\n        <property name=\"text\">\n         <string>Requested payments history</string>\n        </property>\n       </widget>\n      </item>\n      <item>\n       <widget class=\"QTableView\" name=\"recentRequestsView\">\n        <property name=\"contextMenuPolicy\">\n         <enum>Qt::CustomContextMenu</enum>\n        </property>\n        <property name=\"tabKeyNavigation\">\n         <bool>false</bool>\n        </property>\n        <property name=\"sortingEnabled\">\n         <bool>true</bool>\n        </property>\n       </widget>\n      </item>\n      <item>\n       <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2\">\n        <item>\n         <widget class=\"QPushButton\" name=\"showRequestButton\">\n          <property name=\"enabled\">\n           <bool>false</bool>\n          </property>\n          <property name=\"toolTip\">\n           <string>Show the selected request (does the same as double clicking an entry)</string>\n          </property>\n          <property name=\"text\">\n           <string>Show</string>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"../bitcoin.qrc\">\n            <normaloff>:/icons/edit</normaloff>:/icons/edit</iconset>\n          </property>\n          <property name=\"autoDefault\">\n           <bool>false</bool>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <widget class=\"QPushButton\" name=\"removeRequestButton\">\n          <property name=\"enabled\">\n           <bool>false</bool>\n          </property>\n          <property name=\"toolTip\">\n           <string>Remove the selected entries from the list</string>\n          </property>\n          <property name=\"text\">\n           <string>Remove</string>\n          </property>\n          <property name=\"icon\">\n           <iconset resource=\"../bitcoin.qrc\">\n            <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>\n          </property>\n          <property name=\"autoDefault\">\n           <bool>false</bool>\n          </property>\n         </widget>\n        </item>\n        <item>\n         <spacer name=\"horizontalSpacer_2\">\n          <property name=\"orientation\">\n           <enum>Qt::Horizontal</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>40</width>\n            <height>20</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n       </layout>\n      </item>\n     </layout>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>BitcoinAmountField</class>\n   <extends>QLineEdit</extends>\n   <header>qt/bitcoinamountfield.h</header>\n   <container>1</container>\n  </customwidget>\n </customwidgets>\n <tabstops>\n  <tabstop>reqLabel</tabstop>\n  <tabstop>reqAmount</tabstop>\n  <tabstop>useBech32</tabstop>\n  <tabstop>reqMessage</tabstop>\n  <tabstop>receiveButton</tabstop>\n  <tabstop>clearButton</tabstop>\n  <tabstop>recentRequestsView</tabstop>\n  <tabstop>showRequestButton</tabstop>\n  <tabstop>removeRequestButton</tabstop>\n </tabstops>\n <resources>\n  <include location=\"../bitcoin.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/receiverequestdialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>ReceiveRequestDialog</class>\n <widget class=\"QDialog\" name=\"ReceiveRequestDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>487</width>\n    <height>597</height>\n   </rect>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout_3\">\n   <item>\n    <widget class=\"QRImageWidget\" name=\"lblQRCode\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Fixed\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"minimumSize\">\n      <size>\n       <width>300</width>\n       <height>320</height>\n      </size>\n     </property>\n     <property name=\"toolTip\">\n      <string>QR Code</string>\n     </property>\n     <property name=\"textFormat\">\n      <enum>Qt::PlainText</enum>\n     </property>\n     <property name=\"alignment\">\n      <set>Qt::AlignCenter</set>\n     </property>\n     <property name=\"wordWrap\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QTextEdit\" name=\"outUri\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"minimumSize\">\n      <size>\n       <width>0</width>\n       <height>50</height>\n      </size>\n     </property>\n     <property name=\"frameShape\">\n      <enum>QFrame::NoFrame</enum>\n     </property>\n     <property name=\"frameShadow\">\n      <enum>QFrame::Plain</enum>\n     </property>\n     <property name=\"tabChangesFocus\">\n      <bool>true</bool>\n     </property>\n     <property name=\"textInteractionFlags\">\n      <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n     <item>\n      <widget class=\"QPushButton\" name=\"btnCopyURI\">\n       <property name=\"text\">\n        <string>Copy &amp;URI</string>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"btnCopyAddress\">\n       <property name=\"text\">\n        <string>Copy &amp;Address</string>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"btnSaveAs\">\n       <property name=\"text\">\n        <string>&amp;Save Image...</string>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer_2\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <widget class=\"QDialogButtonBox\" name=\"buttonBox\">\n       <property name=\"standardButtons\">\n        <set>QDialogButtonBox::Close</set>\n       </property>\n      </widget>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>QRImageWidget</class>\n   <extends>QLabel</extends>\n   <header>qt/receiverequestdialog.h</header>\n  </customwidget>\n </customwidgets>\n <resources/>\n <connections>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>rejected()</signal>\n   <receiver>ReceiveRequestDialog</receiver>\n   <slot>reject()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>452</x>\n     <y>573</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>243</x>\n     <y>298</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>accepted()</signal>\n   <receiver>ReceiveRequestDialog</receiver>\n   <slot>accept()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>452</x>\n     <y>573</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>243</x>\n     <y>298</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/sendcoinsdialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>SendCoinsDialog</class>\n <widget class=\"QDialog\" name=\"SendCoinsDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>850</width>\n    <height>526</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Send Coins</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\" stretch=\"0,1,0,0\">\n   <property name=\"bottomMargin\">\n    <number>8</number>\n   </property>\n   <item>\n    <widget class=\"QFrame\" name=\"frameCoinControl\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"maximumSize\">\n      <size>\n       <width>16777215</width>\n       <height>16777215</height>\n      </size>\n     </property>\n     <property name=\"frameShape\">\n      <enum>QFrame::StyledPanel</enum>\n     </property>\n     <property name=\"frameShadow\">\n      <enum>QFrame::Sunken</enum>\n     </property>\n     <layout class=\"QVBoxLayout\" name=\"verticalLayoutCoinControl2\">\n      <property name=\"spacing\">\n       <number>0</number>\n      </property>\n      <property name=\"leftMargin\">\n       <number>0</number>\n      </property>\n      <property name=\"topMargin\">\n       <number>0</number>\n      </property>\n      <property name=\"rightMargin\">\n       <number>0</number>\n      </property>\n      <property name=\"bottomMargin\">\n       <number>6</number>\n      </property>\n      <item>\n       <layout class=\"QVBoxLayout\" name=\"verticalLayoutCoinControl\" stretch=\"0,0,0,0,1\">\n        <property name=\"spacing\">\n         <number>0</number>\n        </property>\n        <property name=\"leftMargin\">\n         <number>10</number>\n        </property>\n        <property name=\"topMargin\">\n         <number>10</number>\n        </property>\n        <item>\n         <layout class=\"QHBoxLayout\" name=\"horizontalLayoutCoinControl1\">\n          <property name=\"bottomMargin\">\n           <number>15</number>\n          </property>\n          <item>\n           <widget class=\"QLabel\" name=\"labelCoinControlFeatures\">\n            <property name=\"sizePolicy\">\n             <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Maximum\">\n              <horstretch>0</horstretch>\n              <verstretch>0</verstretch>\n             </sizepolicy>\n            </property>\n            <property name=\"font\">\n             <font>\n              <weight>75</weight>\n              <bold>true</bold>\n             </font>\n            </property>\n            <property name=\"styleSheet\">\n             <string notr=\"true\">font-weight:bold;</string>\n            </property>\n            <property name=\"text\">\n             <string>Coin Control Features</string>\n            </property>\n           </widget>\n          </item>\n         </layout>\n        </item>\n        <item>\n         <layout class=\"QHBoxLayout\" name=\"horizontalLayoutCoinControl2\" stretch=\"0,0,0,0\">\n          <property name=\"spacing\">\n           <number>8</number>\n          </property>\n          <property name=\"bottomMargin\">\n           <number>10</number>\n          </property>\n          <item>\n           <widget class=\"QPushButton\" name=\"pushButtonCoinControl\">\n            <property name=\"styleSheet\">\n             <string notr=\"true\"/>\n            </property>\n            <property name=\"text\">\n             <string>Inputs...</string>\n            </property>\n            <property name=\"autoDefault\">\n             <bool>false</bool>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QLabel\" name=\"labelCoinControlAutomaticallySelected\">\n            <property name=\"text\">\n             <string>automatically selected</string>\n            </property>\n            <property name=\"margin\">\n             <number>5</number>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QLabel\" name=\"labelCoinControlInsuffFunds\">\n            <property name=\"font\">\n             <font>\n              <weight>75</weight>\n              <bold>true</bold>\n             </font>\n            </property>\n            <property name=\"styleSheet\">\n             <string notr=\"true\">color:red;font-weight:bold;</string>\n            </property>\n            <property name=\"text\">\n             <string>Insufficient funds!</string>\n            </property>\n            <property name=\"margin\">\n             <number>5</number>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <spacer name=\"horizontalSpacerCoinControl\">\n            <property name=\"orientation\">\n             <enum>Qt::Horizontal</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>40</width>\n              <height>1</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n         </layout>\n        </item>\n        <item>\n         <widget class=\"QWidget\" name=\"widgetCoinControl\" native=\"true\">\n          <property name=\"sizePolicy\">\n           <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Preferred\">\n            <horstretch>0</horstretch>\n            <verstretch>0</verstretch>\n           </sizepolicy>\n          </property>\n          <property name=\"minimumSize\">\n           <size>\n            <width>0</width>\n            <height>0</height>\n           </size>\n          </property>\n          <property name=\"styleSheet\">\n           <string notr=\"true\"/>\n          </property>\n          <layout class=\"QHBoxLayout\" name=\"horizontalLayoutCoinControl5\">\n           <property name=\"leftMargin\">\n            <number>0</number>\n           </property>\n           <property name=\"topMargin\">\n            <number>0</number>\n           </property>\n           <property name=\"rightMargin\">\n            <number>0</number>\n           </property>\n           <property name=\"bottomMargin\">\n            <number>0</number>\n           </property>\n           <item>\n            <layout class=\"QHBoxLayout\" name=\"horizontalLayoutCoinControl3\" stretch=\"0,0,0,1\">\n             <property name=\"spacing\">\n              <number>20</number>\n             </property>\n             <property name=\"topMargin\">\n              <number>0</number>\n             </property>\n             <property name=\"bottomMargin\">\n              <number>10</number>\n             </property>\n             <item>\n              <layout class=\"QFormLayout\" name=\"formLayoutCoinControl1\">\n               <property name=\"horizontalSpacing\">\n                <number>10</number>\n               </property>\n               <property name=\"verticalSpacing\">\n                <number>14</number>\n               </property>\n               <property name=\"leftMargin\">\n                <number>10</number>\n               </property>\n               <property name=\"topMargin\">\n                <number>4</number>\n               </property>\n               <property name=\"rightMargin\">\n                <number>6</number>\n               </property>\n               <item row=\"0\" column=\"0\">\n                <widget class=\"QLabel\" name=\"labelCoinControlQuantityText\">\n                 <property name=\"font\">\n                  <font>\n                   <weight>75</weight>\n                   <bold>true</bold>\n                  </font>\n                 </property>\n                 <property name=\"text\">\n                  <string>Quantity:</string>\n                 </property>\n                 <property name=\"margin\">\n                  <number>0</number>\n                 </property>\n                </widget>\n               </item>\n               <item row=\"0\" column=\"1\">\n                <widget class=\"QLabel\" name=\"labelCoinControlQuantity\">\n                 <property name=\"cursor\">\n                  <cursorShape>IBeamCursor</cursorShape>\n                 </property>\n                 <property name=\"contextMenuPolicy\">\n                  <enum>Qt::ActionsContextMenu</enum>\n                 </property>\n                 <property name=\"text\">\n                  <string notr=\"true\">0</string>\n                 </property>\n                 <property name=\"margin\">\n                  <number>0</number>\n                 </property>\n                 <property name=\"textInteractionFlags\">\n                  <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n                 </property>\n                </widget>\n               </item>\n               <item row=\"1\" column=\"0\">\n                <widget class=\"QLabel\" name=\"labelCoinControlBytesText\">\n                 <property name=\"font\">\n                  <font>\n                   <weight>75</weight>\n                   <bold>true</bold>\n                  </font>\n                 </property>\n                 <property name=\"text\">\n                  <string>Bytes:</string>\n                 </property>\n                </widget>\n               </item>\n               <item row=\"1\" column=\"1\">\n                <widget class=\"QLabel\" name=\"labelCoinControlBytes\">\n                 <property name=\"cursor\">\n                  <cursorShape>IBeamCursor</cursorShape>\n                 </property>\n                 <property name=\"contextMenuPolicy\">\n                  <enum>Qt::ActionsContextMenu</enum>\n                 </property>\n                 <property name=\"text\">\n                  <string notr=\"true\">0</string>\n                 </property>\n                 <property name=\"textInteractionFlags\">\n                  <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n                 </property>\n                </widget>\n               </item>\n              </layout>\n             </item>\n             <item>\n              <layout class=\"QFormLayout\" name=\"formLayoutCoinControl2\">\n               <property name=\"horizontalSpacing\">\n                <number>10</number>\n               </property>\n               <property name=\"verticalSpacing\">\n                <number>14</number>\n               </property>\n               <property name=\"leftMargin\">\n                <number>6</number>\n               </property>\n               <property name=\"topMargin\">\n                <number>4</number>\n               </property>\n               <property name=\"rightMargin\">\n                <number>6</number>\n               </property>\n               <item row=\"0\" column=\"0\">\n                <widget class=\"QLabel\" name=\"labelCoinControlAmountText\">\n                 <property name=\"font\">\n                  <font>\n                   <weight>75</weight>\n                   <bold>true</bold>\n                  </font>\n                 </property>\n                 <property name=\"text\">\n                  <string>Amount:</string>\n                 </property>\n                 <property name=\"margin\">\n                  <number>0</number>\n                 </property>\n                </widget>\n               </item>\n               <item row=\"0\" column=\"1\">\n                <widget class=\"QLabel\" name=\"labelCoinControlAmount\">\n                 <property name=\"cursor\">\n                  <cursorShape>IBeamCursor</cursorShape>\n                 </property>\n                 <property name=\"contextMenuPolicy\">\n                  <enum>Qt::ActionsContextMenu</enum>\n                 </property>\n                 <property name=\"text\">\n                  <string notr=\"true\">0.00 SUGAR</string>\n                 </property>\n                 <property name=\"textInteractionFlags\">\n                  <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n                 </property>\n                </widget>\n               </item>\n               <item row=\"1\" column=\"0\">\n                <widget class=\"QLabel\" name=\"labelCoinControlLowOutputText\">\n                 <property name=\"font\">\n                  <font>\n                   <weight>75</weight>\n                   <bold>true</bold>\n                  </font>\n                 </property>\n                 <property name=\"text\">\n                  <string>Dust:</string>\n                 </property>\n                </widget>\n               </item>\n               <item row=\"1\" column=\"1\">\n                <widget class=\"QLabel\" name=\"labelCoinControlLowOutput\">\n                 <property name=\"cursor\">\n                  <cursorShape>IBeamCursor</cursorShape>\n                 </property>\n                 <property name=\"contextMenuPolicy\">\n                  <enum>Qt::ActionsContextMenu</enum>\n                 </property>\n                 <property name=\"text\">\n                  <string notr=\"true\">no</string>\n                 </property>\n                 <property name=\"textInteractionFlags\">\n                  <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n                 </property>\n                </widget>\n               </item>\n              </layout>\n             </item>\n             <item>\n              <layout class=\"QFormLayout\" name=\"formLayoutCoinControl3\">\n               <property name=\"horizontalSpacing\">\n                <number>10</number>\n               </property>\n               <property name=\"verticalSpacing\">\n                <number>14</number>\n               </property>\n               <property name=\"leftMargin\">\n                <number>6</number>\n               </property>\n               <property name=\"topMargin\">\n                <number>4</number>\n               </property>\n               <property name=\"rightMargin\">\n                <number>6</number>\n               </property>\n               <item row=\"0\" column=\"0\">\n                <widget class=\"QLabel\" name=\"labelCoinControlFeeText\">\n                 <property name=\"font\">\n                  <font>\n                   <weight>75</weight>\n                   <bold>true</bold>\n                  </font>\n                 </property>\n                 <property name=\"text\">\n                  <string>Fee:</string>\n                 </property>\n                 <property name=\"margin\">\n                  <number>0</number>\n                 </property>\n                </widget>\n               </item>\n               <item row=\"0\" column=\"1\">\n                <widget class=\"QLabel\" name=\"labelCoinControlFee\">\n                 <property name=\"cursor\">\n                  <cursorShape>IBeamCursor</cursorShape>\n                 </property>\n                 <property name=\"contextMenuPolicy\">\n                  <enum>Qt::ActionsContextMenu</enum>\n                 </property>\n                 <property name=\"text\">\n                  <string notr=\"true\">0.00 SUGAR</string>\n                 </property>\n                 <property name=\"textInteractionFlags\">\n                  <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n                 </property>\n                </widget>\n               </item>\n              </layout>\n             </item>\n             <item>\n              <layout class=\"QFormLayout\" name=\"formLayoutCoinControl4\">\n               <property name=\"horizontalSpacing\">\n                <number>10</number>\n               </property>\n               <property name=\"verticalSpacing\">\n                <number>14</number>\n               </property>\n               <property name=\"leftMargin\">\n                <number>6</number>\n               </property>\n               <property name=\"topMargin\">\n                <number>4</number>\n               </property>\n               <property name=\"rightMargin\">\n                <number>6</number>\n               </property>\n               <item row=\"0\" column=\"0\">\n                <widget class=\"QLabel\" name=\"labelCoinControlAfterFeeText\">\n                 <property name=\"font\">\n                  <font>\n                   <weight>75</weight>\n                   <bold>true</bold>\n                  </font>\n                 </property>\n                 <property name=\"text\">\n                  <string>After Fee:</string>\n                 </property>\n                 <property name=\"margin\">\n                  <number>0</number>\n                 </property>\n                </widget>\n               </item>\n               <item row=\"0\" column=\"1\">\n                <widget class=\"QLabel\" name=\"labelCoinControlAfterFee\">\n                 <property name=\"cursor\">\n                  <cursorShape>IBeamCursor</cursorShape>\n                 </property>\n                 <property name=\"contextMenuPolicy\">\n                  <enum>Qt::ActionsContextMenu</enum>\n                 </property>\n                 <property name=\"text\">\n                  <string notr=\"true\">0.00 SUGAR</string>\n                 </property>\n                 <property name=\"textInteractionFlags\">\n                  <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n                 </property>\n                </widget>\n               </item>\n               <item row=\"1\" column=\"0\">\n                <widget class=\"QLabel\" name=\"labelCoinControlChangeText\">\n                 <property name=\"font\">\n                  <font>\n                   <weight>75</weight>\n                   <bold>true</bold>\n                  </font>\n                 </property>\n                 <property name=\"text\">\n                  <string>Change:</string>\n                 </property>\n                </widget>\n               </item>\n               <item row=\"1\" column=\"1\">\n                <widget class=\"QLabel\" name=\"labelCoinControlChange\">\n                 <property name=\"cursor\">\n                  <cursorShape>IBeamCursor</cursorShape>\n                 </property>\n                 <property name=\"contextMenuPolicy\">\n                  <enum>Qt::ActionsContextMenu</enum>\n                 </property>\n                 <property name=\"text\">\n                  <string notr=\"true\">0.00 SUGAR</string>\n                 </property>\n                 <property name=\"textInteractionFlags\">\n                  <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n                 </property>\n                </widget>\n               </item>\n              </layout>\n             </item>\n            </layout>\n           </item>\n          </layout>\n         </widget>\n        </item>\n        <item>\n         <layout class=\"QHBoxLayout\" name=\"horizontalLayoutCoinControl4\" stretch=\"0,0,0\">\n          <property name=\"spacing\">\n           <number>12</number>\n          </property>\n          <property name=\"sizeConstraint\">\n           <enum>QLayout::SetDefaultConstraint</enum>\n          </property>\n          <property name=\"topMargin\">\n           <number>5</number>\n          </property>\n          <property name=\"rightMargin\">\n           <number>5</number>\n          </property>\n          <item>\n           <widget class=\"QCheckBox\" name=\"checkBoxCoinControlChange\">\n            <property name=\"toolTip\">\n             <string>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</string>\n            </property>\n            <property name=\"text\">\n             <string>Custom change address</string>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QValidatedLineEdit\" name=\"lineEditCoinControlChange\">\n            <property name=\"enabled\">\n             <bool>false</bool>\n            </property>\n            <property name=\"sizePolicy\">\n             <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Fixed\">\n              <horstretch>0</horstretch>\n              <verstretch>0</verstretch>\n             </sizepolicy>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <widget class=\"QLabel\" name=\"labelCoinControlChangeLabel\">\n            <property name=\"sizePolicy\">\n             <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Expanding\">\n              <horstretch>0</horstretch>\n              <verstretch>0</verstretch>\n             </sizepolicy>\n            </property>\n            <property name=\"minimumSize\">\n             <size>\n              <width>0</width>\n              <height>0</height>\n             </size>\n            </property>\n            <property name=\"text\">\n             <string/>\n            </property>\n            <property name=\"margin\">\n             <number>3</number>\n            </property>\n           </widget>\n          </item>\n         </layout>\n        </item>\n        <item>\n         <spacer name=\"verticalSpacerCoinControl\">\n          <property name=\"orientation\">\n           <enum>Qt::Vertical</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>800</width>\n            <height>1</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n       </layout>\n      </item>\n     </layout>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QScrollArea\" name=\"scrollArea\">\n     <property name=\"widgetResizable\">\n      <bool>true</bool>\n     </property>\n     <widget class=\"QWidget\" name=\"scrollAreaWidgetContents\">\n      <property name=\"geometry\">\n       <rect>\n        <x>0</x>\n        <y>0</y>\n        <width>830</width>\n        <height>104</height>\n       </rect>\n      </property>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\" stretch=\"0,1\">\n       <property name=\"leftMargin\">\n        <number>0</number>\n       </property>\n       <property name=\"topMargin\">\n        <number>0</number>\n       </property>\n       <property name=\"rightMargin\">\n        <number>0</number>\n       </property>\n       <property name=\"bottomMargin\">\n        <number>0</number>\n       </property>\n       <item>\n        <layout class=\"QVBoxLayout\" name=\"entries\">\n         <property name=\"spacing\">\n          <number>6</number>\n         </property>\n        </layout>\n       </item>\n       <item>\n        <spacer name=\"verticalSpacer\">\n         <property name=\"orientation\">\n          <enum>Qt::Vertical</enum>\n         </property>\n         <property name=\"sizeHint\" stdset=\"0\">\n          <size>\n           <width>20</width>\n           <height>40</height>\n          </size>\n         </property>\n        </spacer>\n       </item>\n      </layout>\n     </widget>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QFrame\" name=\"frameFee\">\n     <property name=\"sizePolicy\">\n      <sizepolicy hsizetype=\"Expanding\" vsizetype=\"Expanding\">\n       <horstretch>0</horstretch>\n       <verstretch>0</verstretch>\n      </sizepolicy>\n     </property>\n     <property name=\"maximumSize\">\n      <size>\n       <width>16777215</width>\n       <height>16777215</height>\n      </size>\n     </property>\n     <property name=\"frameShape\">\n      <enum>QFrame::StyledPanel</enum>\n     </property>\n     <property name=\"frameShadow\">\n      <enum>QFrame::Sunken</enum>\n     </property>\n     <layout class=\"QVBoxLayout\" name=\"verticalLayoutFee1\">\n      <property name=\"spacing\">\n       <number>0</number>\n      </property>\n      <property name=\"leftMargin\">\n       <number>0</number>\n      </property>\n      <property name=\"topMargin\">\n       <number>0</number>\n      </property>\n      <property name=\"rightMargin\">\n       <number>0</number>\n      </property>\n      <property name=\"bottomMargin\">\n       <number>0</number>\n      </property>\n      <item>\n       <layout class=\"QVBoxLayout\" name=\"verticalLayoutFee2\" stretch=\"0,0,0\">\n        <property name=\"spacing\">\n         <number>0</number>\n        </property>\n        <property name=\"leftMargin\">\n         <number>10</number>\n        </property>\n        <property name=\"topMargin\">\n         <number>0</number>\n        </property>\n        <item>\n         <layout class=\"QHBoxLayout\" name=\"horizontalLayoutFee1\">\n          <property name=\"bottomMargin\">\n           <number>0</number>\n          </property>\n          <item>\n           <layout class=\"QVBoxLayout\" name=\"verticalLayoutFee7\">\n            <property name=\"spacing\">\n             <number>0</number>\n            </property>\n            <item>\n             <spacer name=\"verticalSpacerSmartFee\">\n              <property name=\"orientation\">\n               <enum>Qt::Vertical</enum>\n              </property>\n              <property name=\"sizeType\">\n               <enum>QSizePolicy::Fixed</enum>\n              </property>\n              <property name=\"sizeHint\" stdset=\"0\">\n               <size>\n                <width>1</width>\n                <height>4</height>\n               </size>\n              </property>\n             </spacer>\n            </item>\n            <item>\n             <layout class=\"QHBoxLayout\" name=\"horizontalLayoutSmartFee\">\n              <property name=\"spacing\">\n               <number>10</number>\n              </property>\n              <item>\n               <widget class=\"QLabel\" name=\"labelFeeHeadline\">\n                <property name=\"sizePolicy\">\n                 <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Maximum\">\n                  <horstretch>0</horstretch>\n                  <verstretch>0</verstretch>\n                 </sizepolicy>\n                </property>\n                <property name=\"font\">\n                 <font>\n                  <weight>75</weight>\n                  <bold>true</bold>\n                 </font>\n                </property>\n                <property name=\"styleSheet\">\n                 <string notr=\"true\">font-weight:bold;</string>\n                </property>\n                <property name=\"text\">\n                 <string>Transaction Fee:</string>\n                </property>\n               </widget>\n              </item>\n              <item>\n               <widget class=\"QLabel\" name=\"labelFeeMinimized\">\n                <property name=\"text\">\n                 <string/>\n                </property>\n               </widget>\n              </item>\n              <item>\n               <widget class=\"QPushButton\" name=\"buttonChooseFee\">\n                <property name=\"text\">\n                 <string>Choose...</string>\n                </property>\n               </widget>\n              </item>\n             </layout>\n            </item>\n            <item>\n             <spacer name=\"verticalSpacer_5\">\n              <property name=\"orientation\">\n               <enum>Qt::Vertical</enum>\n              </property>\n              <property name=\"sizeHint\" stdset=\"0\">\n               <size>\n                <width>1</width>\n                <height>1</height>\n               </size>\n              </property>\n             </spacer>\n            </item>\n           </layout>\n          </item>\n          <item>\n           <widget class=\"QLabel\" name=\"fallbackFeeWarningLabel\">\n            <property name=\"toolTip\">\n             <string>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</string>\n            </property>\n            <property name=\"font\">\n            <font>\n                <weight>75</weight>\n                <bold>true</bold>\n            </font>\n            </property>\n            <property name=\"text\">\n             <string>Warning: Fee estimation is currently not possible.</string>\n            </property>\n            <property name=\"wordWrap\">\n             <bool>false</bool>\n            </property>\n           </widget>\n          </item>\n          <item>\n           <spacer name=\"horizontalSpacer_4\">\n            <property name=\"orientation\">\n             <enum>Qt::Horizontal</enum>\n            </property>\n            <property name=\"sizeType\">\n             <enum>QSizePolicy::MinimumExpanding</enum>\n            </property>\n            <property name=\"sizeHint\" stdset=\"0\">\n             <size>\n              <width>40</width>\n              <height>20</height>\n             </size>\n            </property>\n           </spacer>\n          </item>\n          <item>\n           <widget class=\"QPushButton\" name=\"buttonMinimizeFee\">\n            <property name=\"toolTip\">\n             <string>collapse fee-settings</string>\n            </property>\n            <property name=\"text\">\n             <string>Hide</string>\n            </property>\n           </widget>\n          </item>\n         </layout>\n        </item>\n        <item>\n         <widget class=\"QFrame\" name=\"frameFeeSelection\">\n          <layout class=\"QVBoxLayout\" name=\"verticalLayoutFee12\">\n           <property name=\"spacing\">\n            <number>0</number>\n           </property>\n           <property name=\"leftMargin\">\n            <number>0</number>\n           </property>\n           <property name=\"topMargin\">\n            <number>0</number>\n           </property>\n           <property name=\"rightMargin\">\n            <number>0</number>\n           </property>\n           <property name=\"bottomMargin\">\n            <number>0</number>\n           </property>\n           <item>\n            <layout class=\"QGridLayout\" name=\"gridLayoutFee\">\n             <property name=\"topMargin\">\n              <number>10</number>\n             </property>\n             <property name=\"bottomMargin\">\n              <number>4</number>\n             </property>\n             <property name=\"horizontalSpacing\">\n              <number>10</number>\n             </property>\n             <property name=\"verticalSpacing\">\n              <number>4</number>\n             </property>\n             <item row=\"1\" column=\"1\">\n              <layout class=\"QVBoxLayout\" name=\"verticalLayoutFee8\">\n               <property name=\"spacing\">\n                <number>6</number>\n               </property>\n               <item>\n                <layout class=\"QHBoxLayout\" name=\"horizontalLayoutFee13\">\n                 <item>\n                  <widget class=\"QLabel\" name=\"labelCustomPerKilobyte\">\n                   <property name=\"toolTip\">\n                    <string>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then &quot;per kilobyte&quot; only pays 250 satoshis in fee, while &quot;total at least&quot; pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</string>\n                   </property>\n                   <property name=\"text\">\n                    <string>per kilobyte</string>\n                   </property>\n                  </widget>\n                 </item>\n                 <item>\n                  <widget class=\"BitcoinAmountField\" name=\"customFee\"/>\n                 </item>\n                 <item>\n                  <spacer name=\"horizontalSpacer_6\">\n                   <property name=\"orientation\">\n                    <enum>Qt::Horizontal</enum>\n                   </property>\n                   <property name=\"sizeHint\" stdset=\"0\">\n                    <size>\n                     <width>1</width>\n                     <height>1</height>\n                    </size>\n                   </property>\n                  </spacer>\n                 </item>\n                </layout>\n               </item>\n               <item>\n                <layout class=\"QHBoxLayout\" name=\"horizontalLayoutFee8\">\n                 <item>\n                  <widget class=\"QCheckBox\" name=\"checkBoxMinimumFee\">\n                   <property name=\"toolTip\">\n                    <string>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for sugarchain transactions than the network can process.</string>\n                   </property>\n                   <property name=\"text\">\n                    <string/>\n                   </property>\n                  </widget>\n                 </item>\n                 <item>\n                  <widget class=\"QLabel\" name=\"labelMinFeeWarning\">\n                   <property name=\"enabled\">\n                    <bool>true</bool>\n                   </property>\n                   <property name=\"toolTip\">\n                    <string>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for sugarchain transactions than the network can process.</string>\n                   </property>\n                   <property name=\"text\">\n                    <string>(read the tooltip)</string>\n                   </property>\n                   <property name=\"margin\">\n                    <number>5</number>\n                   </property>\n                  </widget>\n                 </item>\n                 <item>\n                  <spacer name=\"horizontalSpacer_2\">\n                   <property name=\"orientation\">\n                    <enum>Qt::Horizontal</enum>\n                   </property>\n                   <property name=\"sizeHint\" stdset=\"0\">\n                    <size>\n                     <width>1</width>\n                     <height>1</height>\n                    </size>\n                   </property>\n                  </spacer>\n                 </item>\n                </layout>\n               </item>\n              </layout>\n             </item>\n             <item row=\"0\" column=\"0\">\n              <layout class=\"QVBoxLayout\" name=\"verticalLayoutFee4\" stretch=\"0,1\">\n               <item>\n                <widget class=\"QRadioButton\" name=\"radioSmartFee\">\n                 <property name=\"text\">\n                  <string>Recommended:</string>\n                 </property>\n                 <property name=\"checked\">\n                  <bool>true</bool>\n                 </property>\n                 <attribute name=\"buttonGroup\">\n                  <string notr=\"true\">groupFee</string>\n                 </attribute>\n                </widget>\n               </item>\n               <item>\n                <spacer name=\"verticalSpacer_2\">\n                 <property name=\"orientation\">\n                  <enum>Qt::Vertical</enum>\n                 </property>\n                 <property name=\"sizeHint\" stdset=\"0\">\n                  <size>\n                   <width>1</width>\n                   <height>1</height>\n                  </size>\n                 </property>\n                </spacer>\n               </item>\n              </layout>\n             </item>\n             <item row=\"1\" column=\"0\">\n              <layout class=\"QVBoxLayout\" name=\"verticalLayoutFee9\" stretch=\"0,1\">\n               <item>\n                <widget class=\"QRadioButton\" name=\"radioCustomFee\">\n                 <property name=\"text\">\n                  <string>Custom:</string>\n                 </property>\n                 <attribute name=\"buttonGroup\">\n                  <string notr=\"true\">groupFee</string>\n                 </attribute>\n                </widget>\n               </item>\n               <item>\n                <spacer name=\"verticalSpacer_6\">\n                 <property name=\"orientation\">\n                  <enum>Qt::Vertical</enum>\n                 </property>\n                 <property name=\"sizeHint\" stdset=\"0\">\n                  <size>\n                   <width>1</width>\n                   <height>1</height>\n                  </size>\n                 </property>\n                </spacer>\n               </item>\n              </layout>\n             </item>\n             <item row=\"0\" column=\"1\">\n              <layout class=\"QVBoxLayout\" name=\"verticalLayoutFee3\" stretch=\"0,0,1\">\n               <property name=\"spacing\">\n                <number>6</number>\n               </property>\n               <property name=\"topMargin\">\n                <number>2</number>\n               </property>\n               <item>\n                <layout class=\"QHBoxLayout\" name=\"horizontalLayoutFee12\">\n                 <item>\n                  <widget class=\"QLabel\" name=\"labelSmartFee\">\n                   <property name=\"text\">\n                    <string/>\n                   </property>\n                   <property name=\"margin\">\n                    <number>2</number>\n                   </property>\n                  </widget>\n                 </item>\n                 <item>\n                  <widget class=\"QLabel\" name=\"labelFeeEstimation\">\n                   <property name=\"text\">\n                    <string/>\n                   </property>\n                  </widget>\n                 </item>\n                 <item>\n                  <widget class=\"QLabel\" name=\"labelSmartFee2\">\n                   <property name=\"text\">\n                    <string>(Smart fee not initialized yet. This usually takes a few blocks...)</string>\n                   </property>\n                   <property name=\"margin\">\n                    <number>2</number>\n                   </property>\n                  </widget>\n                 </item>\n                 <item>\n                  <spacer name=\"horizontalSpacer_5\">\n                   <property name=\"orientation\">\n                    <enum>Qt::Horizontal</enum>\n                   </property>\n                   <property name=\"sizeHint\" stdset=\"0\">\n                    <size>\n                     <width>1</width>\n                     <height>1</height>\n                    </size>\n                   </property>\n                  </spacer>\n                 </item>\n                </layout>\n               </item>\n               <item>\n                <layout class=\"QHBoxLayout\" name=\"horizontalLayoutFee9\">\n                 <item>\n                  <layout class=\"QVBoxLayout\" name=\"verticalLayoutFee6\">\n                   <item>\n                    <widget class=\"QLabel\" name=\"labelSmartFee3\">\n                     <property name=\"text\">\n                      <string>Confirmation time target:</string>\n                     </property>\n                     <property name=\"margin\">\n                      <number>2</number>\n                     </property>\n                    </widget>\n                   </item>\n                   <item>\n                    <spacer name=\"verticalSpacer_3\">\n                     <property name=\"orientation\">\n                      <enum>Qt::Vertical</enum>\n                     </property>\n                     <property name=\"sizeHint\" stdset=\"0\">\n                      <size>\n                       <width>1</width>\n                       <height>1</height>\n                      </size>\n                     </property>\n                    </spacer>\n                   </item>\n                  </layout>\n                 </item>\n                 <item>\n                  <layout class=\"QVBoxLayout\" name=\"verticalLayoutFee5\">\n                   <property name=\"rightMargin\">\n                    <number>30</number>\n                   </property>\n                   <item>\n                    <layout class=\"QHBoxLayout\" name=\"horizontalLayoutConfTarget\">\n                     <property name=\"bottomMargin\">\n                      <number>0</number>\n                     </property>\n                     <item>\n                      <widget class=\"QComboBox\" name=\"confTargetSelector\"/>\n                     </item>\n                     <item>\n                      <spacer name=\"horizontalSpacerConfTarget\">\n                       <property name=\"orientation\">\n                        <enum>Qt::Horizontal</enum>\n                       </property>\n                       <property name=\"sizeHint\" stdset=\"0\">\n                        <size>\n                         <width>40</width>\n                         <height>20</height>\n                        </size>\n                       </property>\n                      </spacer>\n                     </item>\n                    </layout>\n                   </item>\n                  </layout>\n                 </item>\n                </layout>\n               </item>\n               <item>\n                <spacer name=\"verticalSpacer_4\">\n                 <property name=\"orientation\">\n                  <enum>Qt::Vertical</enum>\n                 </property>\n                 <property name=\"sizeHint\" stdset=\"0\">\n                  <size>\n                   <width>1</width>\n                   <height>1</height>\n                  </size>\n                 </property>\n                </spacer>\n               </item>\n              </layout>\n             </item>\n            </layout>\n           </item>\n           <item>\n            <widget class=\"QCheckBox\" name=\"optInRBF\">\n             <property name=\"text\">\n              <string>Enable Replace-By-Fee</string>\n             </property>\n             <property name=\"toolTip\">\n              <string>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</string>\n             </property>\n            </widget>\n           </item>\n          </layout>\n         </widget>\n        </item>\n        <item>\n         <spacer name=\"verticalSpacerFee\">\n          <property name=\"orientation\">\n           <enum>Qt::Vertical</enum>\n          </property>\n          <property name=\"sizeHint\" stdset=\"0\">\n           <size>\n            <width>40</width>\n            <height>5</height>\n           </size>\n          </property>\n         </spacer>\n        </item>\n       </layout>\n      </item>\n     </layout>\n    </widget>\n   </item>\n   <item>\n    <layout class=\"QHBoxLayout\" name=\"horizontalLayout\">\n     <item>\n      <widget class=\"QPushButton\" name=\"sendButton\">\n       <property name=\"minimumSize\">\n        <size>\n         <width>150</width>\n         <height>0</height>\n        </size>\n       </property>\n       <property name=\"toolTip\">\n        <string>Confirm the send action</string>\n       </property>\n       <property name=\"text\">\n        <string>S&amp;end</string>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"../bitcoin.qrc\">\n         <normaloff>:/icons/send</normaloff>:/icons/send</iconset>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n       <property name=\"default\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"clearButton\">\n       <property name=\"sizePolicy\">\n        <sizepolicy hsizetype=\"Minimum\" vsizetype=\"Fixed\">\n         <horstretch>0</horstretch>\n         <verstretch>0</verstretch>\n        </sizepolicy>\n       </property>\n       <property name=\"toolTip\">\n        <string>Clear all fields of the form.</string>\n       </property>\n       <property name=\"text\">\n        <string>Clear &amp;All</string>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"../bitcoin.qrc\">\n         <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <widget class=\"QPushButton\" name=\"addButton\">\n       <property name=\"toolTip\">\n        <string>Send to multiple recipients at once</string>\n       </property>\n       <property name=\"text\">\n        <string>Add &amp;Recipient</string>\n       </property>\n       <property name=\"icon\">\n        <iconset resource=\"../bitcoin.qrc\">\n         <normaloff>:/icons/add</normaloff>:/icons/add</iconset>\n       </property>\n       <property name=\"autoDefault\">\n        <bool>false</bool>\n       </property>\n      </widget>\n     </item>\n     <item>\n      <spacer name=\"horizontalSpacer\">\n       <property name=\"orientation\">\n        <enum>Qt::Horizontal</enum>\n       </property>\n       <property name=\"sizeHint\" stdset=\"0\">\n        <size>\n         <width>40</width>\n         <height>20</height>\n        </size>\n       </property>\n      </spacer>\n     </item>\n     <item>\n      <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2\">\n       <property name=\"spacing\">\n        <number>3</number>\n       </property>\n       <item>\n        <widget class=\"QLabel\" name=\"label\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Fixed\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"text\">\n          <string>Balance:</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QLabel\" name=\"labelBalance\">\n         <property name=\"sizePolicy\">\n          <sizepolicy hsizetype=\"Preferred\" vsizetype=\"Fixed\">\n           <horstretch>0</horstretch>\n           <verstretch>0</verstretch>\n          </sizepolicy>\n         </property>\n         <property name=\"cursor\">\n          <cursorShape>IBeamCursor</cursorShape>\n         </property>\n         <property name=\"text\">\n          <string notr=\"true\">123.456 SUGAR</string>\n         </property>\n         <property name=\"textInteractionFlags\">\n          <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n         </property>\n        </widget>\n       </item>\n      </layout>\n     </item>\n    </layout>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>QValidatedLineEdit</class>\n   <extends>QLineEdit</extends>\n   <header>qt/qvalidatedlineedit.h</header>\n  </customwidget>\n  <customwidget>\n   <class>BitcoinAmountField</class>\n   <extends>QLineEdit</extends>\n   <header>qt/bitcoinamountfield.h</header>\n   <container>1</container>\n  </customwidget>\n </customwidgets>\n <resources>\n  <include location=\"../bitcoin.qrc\"/>\n </resources>\n <connections/>\n <buttongroups>\n  <buttongroup name=\"groupFee\"/>\n </buttongroups>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/sendcoinsentry.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>SendCoinsEntry</class>\n <widget class=\"QStackedWidget\" name=\"SendCoinsEntry\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>729</width>\n    <height>150</height>\n   </rect>\n  </property>\n  <property name=\"focusPolicy\">\n   <enum>Qt::TabFocus</enum>\n  </property>\n  <property name=\"autoFillBackground\">\n   <bool>false</bool>\n  </property>\n  <widget class=\"QFrame\" name=\"SendCoins\">\n   <property name=\"toolTip\">\n    <string>This is a normal payment.</string>\n   </property>\n   <property name=\"frameShape\">\n    <enum>QFrame::NoFrame</enum>\n   </property>\n   <layout class=\"QGridLayout\" name=\"gridLayout\">\n    <property name=\"topMargin\">\n     <number>8</number>\n    </property>\n    <property name=\"bottomMargin\">\n     <number>4</number>\n    </property>\n    <property name=\"horizontalSpacing\">\n     <number>12</number>\n    </property>\n    <property name=\"verticalSpacing\">\n     <number>8</number>\n    </property>\n    <item row=\"0\" column=\"0\">\n     <widget class=\"QLabel\" name=\"payToLabel\">\n      <property name=\"text\">\n       <string>Pay &amp;To:</string>\n      </property>\n      <property name=\"alignment\">\n       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n      </property>\n      <property name=\"buddy\">\n       <cstring>payTo</cstring>\n      </property>\n     </widget>\n    </item>\n    <item row=\"0\" column=\"1\">\n     <layout class=\"QHBoxLayout\" name=\"payToLayout\">\n      <property name=\"spacing\">\n       <number>0</number>\n      </property>\n      <item>\n       <widget class=\"QValidatedLineEdit\" name=\"payTo\">\n        <property name=\"toolTip\">\n         <string>The Sugarchain address to send the payment to</string>\n        </property>\n       </widget>\n      </item>\n      <item>\n       <widget class=\"QToolButton\" name=\"addressBookButton\">\n        <property name=\"toolTip\">\n         <string>Choose previously used address</string>\n        </property>\n        <property name=\"text\">\n         <string/>\n        </property>\n        <property name=\"icon\">\n         <iconset resource=\"../bitcoin.qrc\">\n          <normaloff>:/icons/address-book</normaloff>:/icons/address-book</iconset>\n        </property>\n        <property name=\"iconSize\">\n         <size>\n          <width>22</width>\n          <height>22</height>\n         </size>\n        </property>\n        <property name=\"shortcut\">\n         <string>Alt+A</string>\n        </property>\n       </widget>\n      </item>\n      <item>\n       <widget class=\"QToolButton\" name=\"pasteButton\">\n        <property name=\"toolTip\">\n         <string>Paste address from clipboard</string>\n        </property>\n        <property name=\"text\">\n         <string/>\n        </property>\n        <property name=\"icon\">\n         <iconset resource=\"../bitcoin.qrc\">\n          <normaloff>:/icons/editpaste</normaloff>:/icons/editpaste</iconset>\n        </property>\n        <property name=\"iconSize\">\n         <size>\n          <width>22</width>\n          <height>22</height>\n         </size>\n        </property>\n        <property name=\"shortcut\">\n         <string>Alt+P</string>\n        </property>\n       </widget>\n      </item>\n      <item>\n       <widget class=\"QToolButton\" name=\"deleteButton\">\n        <property name=\"toolTip\">\n         <string>Remove this entry</string>\n        </property>\n        <property name=\"text\">\n         <string/>\n        </property>\n        <property name=\"icon\">\n         <iconset resource=\"../bitcoin.qrc\">\n          <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>\n        </property>\n        <property name=\"iconSize\">\n         <size>\n          <width>22</width>\n          <height>22</height>\n         </size>\n        </property>\n       </widget>\n      </item>\n     </layout>\n    </item>\n    <item row=\"1\" column=\"0\">\n     <widget class=\"QLabel\" name=\"labellLabel\">\n      <property name=\"text\">\n       <string>&amp;Label:</string>\n      </property>\n      <property name=\"alignment\">\n       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n      </property>\n      <property name=\"buddy\">\n       <cstring>addAsLabel</cstring>\n      </property>\n     </widget>\n    </item>\n    <item row=\"1\" column=\"1\">\n     <widget class=\"QLineEdit\" name=\"addAsLabel\">\n      <property name=\"toolTip\">\n       <string>Enter a label for this address to add it to the list of used addresses</string>\n      </property>\n     </widget>\n    </item>\n    <item row=\"2\" column=\"0\">\n     <widget class=\"QLabel\" name=\"amountLabel\">\n      <property name=\"text\">\n       <string>A&amp;mount:</string>\n      </property>\n      <property name=\"alignment\">\n       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n      </property>\n      <property name=\"buddy\">\n       <cstring>payAmount</cstring>\n      </property>\n     </widget>\n    </item>\n    <item row=\"2\" column=\"1\">\n     <layout class=\"QHBoxLayout\" name=\"horizontalLayoutAmount\" stretch=\"0,1,0\">\n      <item>\n       <widget class=\"BitcoinAmountField\" name=\"payAmount\"/>\n      </item>\n      <item>\n       <widget class=\"QCheckBox\" name=\"checkboxSubtractFeeFromAmount\">\n        <property name=\"toolTip\">\n         <string>The fee will be deducted from the amount being sent. The recipient will receive less sugarchains than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</string>\n        </property>\n        <property name=\"text\">\n         <string>S&amp;ubtract fee from amount</string>\n        </property>\n       </widget>\n      </item>\n      <item>\n       <widget class=\"QPushButton\" name=\"useAvailableBalanceButton\">\n        <property name=\"text\">\n         <string>Use available balance</string>\n        </property>\n       </widget>\n      </item>\n     </layout>\n    </item>\n    <item row=\"3\" column=\"0\">\n     <widget class=\"QLabel\" name=\"messageLabel\">\n      <property name=\"text\">\n       <string>Message:</string>\n      </property>\n      <property name=\"alignment\">\n       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n      </property>\n     </widget>\n    </item>\n    <item row=\"3\" column=\"1\">\n     <widget class=\"QLabel\" name=\"messageTextLabel\">\n      <property name=\"toolTip\">\n       <string>A message that was attached to the sugarchain: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</string>\n      </property>\n      <property name=\"textFormat\">\n       <enum>Qt::PlainText</enum>\n      </property>\n     </widget>\n    </item>\n    <item row=\"4\" column=\"0\" colspan=\"2\">\n     <widget class=\"Line\" name=\"line\">\n      <property name=\"orientation\">\n       <enum>Qt::Horizontal</enum>\n      </property>\n     </widget>\n    </item>\n   </layout>\n  </widget>\n  <widget class=\"QFrame\" name=\"SendCoins_UnauthenticatedPaymentRequest\">\n   <property name=\"palette\">\n    <palette>\n     <active>\n      <colorrole role=\"WindowText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Button\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>127</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Light\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>255</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Midlight\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>191</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Dark\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>127</red>\n         <green>127</green>\n         <blue>63</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Mid\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>170</red>\n         <green>170</green>\n         <blue>84</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Text\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"BrightText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>255</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ButtonText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Base\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>255</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Window\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>127</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Shadow\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"AlternateBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>191</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>220</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n     </active>\n     <inactive>\n      <colorrole role=\"WindowText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Button\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>127</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Light\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>255</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Midlight\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>191</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Dark\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>127</red>\n         <green>127</green>\n         <blue>63</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Mid\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>170</red>\n         <green>170</green>\n         <blue>84</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Text\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"BrightText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>255</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ButtonText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Base\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>255</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Window\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>127</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Shadow\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"AlternateBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>191</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>220</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n     </inactive>\n     <disabled>\n      <colorrole role=\"WindowText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>127</red>\n         <green>127</green>\n         <blue>63</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Button\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>127</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Light\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>255</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Midlight\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>191</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Dark\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>127</red>\n         <green>127</green>\n         <blue>63</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Mid\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>170</red>\n         <green>170</green>\n         <blue>84</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Text\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>127</red>\n         <green>127</green>\n         <blue>63</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"BrightText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>255</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ButtonText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>127</red>\n         <green>127</green>\n         <blue>63</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Base\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>127</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Window\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>127</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Shadow\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"AlternateBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>127</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>220</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n     </disabled>\n    </palette>\n   </property>\n   <property name=\"toolTip\">\n    <string>This is an unauthenticated payment request.</string>\n   </property>\n   <property name=\"autoFillBackground\">\n    <bool>true</bool>\n   </property>\n   <property name=\"frameShape\">\n    <enum>QFrame::NoFrame</enum>\n   </property>\n   <layout class=\"QGridLayout\" name=\"gridLayout_is\">\n    <property name=\"spacing\">\n     <number>12</number>\n    </property>\n    <item row=\"0\" column=\"0\">\n     <widget class=\"QLabel\" name=\"payToLabel_is\">\n      <property name=\"text\">\n       <string>Pay To:</string>\n      </property>\n      <property name=\"alignment\">\n       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n      </property>\n     </widget>\n    </item>\n    <item row=\"0\" column=\"1\">\n     <layout class=\"QHBoxLayout\" name=\"payToLayout_is\">\n      <property name=\"spacing\">\n       <number>0</number>\n      </property>\n      <item>\n       <widget class=\"QLabel\" name=\"payTo_is\"/>\n      </item>\n      <item>\n       <widget class=\"QToolButton\" name=\"deleteButton_is\">\n        <property name=\"toolTip\">\n         <string>Remove this entry</string>\n        </property>\n        <property name=\"text\">\n         <string/>\n        </property>\n        <property name=\"icon\">\n         <iconset resource=\"../bitcoin.qrc\">\n          <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>\n        </property>\n       </widget>\n      </item>\n     </layout>\n    </item>\n    <item row=\"1\" column=\"0\">\n     <widget class=\"QLabel\" name=\"memoLabel_is\">\n      <property name=\"text\">\n       <string>Memo:</string>\n      </property>\n      <property name=\"alignment\">\n       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n      </property>\n     </widget>\n    </item>\n    <item row=\"1\" column=\"1\">\n     <widget class=\"QLabel\" name=\"memoTextLabel_is\">\n      <property name=\"textFormat\">\n       <enum>Qt::PlainText</enum>\n      </property>\n     </widget>\n    </item>\n    <item row=\"2\" column=\"0\">\n     <widget class=\"QLabel\" name=\"amountLabel_is\">\n      <property name=\"text\">\n       <string>A&amp;mount:</string>\n      </property>\n      <property name=\"alignment\">\n       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n      </property>\n      <property name=\"buddy\">\n       <cstring>payAmount_is</cstring>\n      </property>\n     </widget>\n    </item>\n    <item row=\"2\" column=\"1\">\n     <widget class=\"BitcoinAmountField\" name=\"payAmount_is\">\n      <property name=\"acceptDrops\">\n       <bool>false</bool>\n      </property>\n     </widget>\n    </item>\n   </layout>\n  </widget>\n  <widget class=\"QFrame\" name=\"SendCoins_AuthenticatedPaymentRequest\">\n   <property name=\"palette\">\n    <palette>\n     <active>\n      <colorrole role=\"WindowText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Button\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>140</red>\n         <green>232</green>\n         <blue>119</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Light\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>230</red>\n         <green>255</green>\n         <blue>224</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Midlight\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>185</red>\n         <green>243</green>\n         <blue>171</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Dark\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>70</red>\n         <green>116</green>\n         <blue>59</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Mid\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>93</red>\n         <green>155</green>\n         <blue>79</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Text\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"BrightText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>155</red>\n         <green>255</green>\n         <blue>147</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ButtonText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Base\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>119</red>\n         <green>255</green>\n         <blue>233</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Window\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>140</red>\n         <green>232</green>\n         <blue>119</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Shadow\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"AlternateBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>197</red>\n         <green>243</green>\n         <blue>187</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"NoRole\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>125</red>\n         <green>194</green>\n         <blue>122</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>220</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n     </active>\n     <inactive>\n      <colorrole role=\"WindowText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Button\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>140</red>\n         <green>232</green>\n         <blue>119</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Light\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>230</red>\n         <green>255</green>\n         <blue>224</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Midlight\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>185</red>\n         <green>243</green>\n         <blue>171</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Dark\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>70</red>\n         <green>116</green>\n         <blue>59</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Mid\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>93</red>\n         <green>155</green>\n         <blue>79</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Text\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"BrightText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>155</red>\n         <green>255</green>\n         <blue>147</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ButtonText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Base\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>119</red>\n         <green>255</green>\n         <blue>233</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Window\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>140</red>\n         <green>232</green>\n         <blue>119</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Shadow\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"AlternateBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>197</red>\n         <green>243</green>\n         <blue>187</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"NoRole\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>125</red>\n         <green>194</green>\n         <blue>122</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>220</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n     </inactive>\n     <disabled>\n      <colorrole role=\"WindowText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>70</red>\n         <green>116</green>\n         <blue>59</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Button\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>140</red>\n         <green>232</green>\n         <blue>119</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Light\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>230</red>\n         <green>255</green>\n         <blue>224</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Midlight\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>185</red>\n         <green>243</green>\n         <blue>171</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Dark\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>70</red>\n         <green>116</green>\n         <blue>59</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Mid\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>93</red>\n         <green>155</green>\n         <blue>79</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Text\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>70</red>\n         <green>116</green>\n         <blue>59</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"BrightText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>155</red>\n         <green>255</green>\n         <blue>147</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ButtonText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>70</red>\n         <green>116</green>\n         <blue>59</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Base\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>140</red>\n         <green>232</green>\n         <blue>119</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Window\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>140</red>\n         <green>232</green>\n         <blue>119</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"Shadow\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"AlternateBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>140</red>\n         <green>232</green>\n         <blue>119</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"NoRole\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>125</red>\n         <green>194</green>\n         <blue>122</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipBase\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>255</red>\n         <green>255</green>\n         <blue>220</blue>\n        </color>\n       </brush>\n      </colorrole>\n      <colorrole role=\"ToolTipText\">\n       <brush brushstyle=\"SolidPattern\">\n        <color alpha=\"255\">\n         <red>0</red>\n         <green>0</green>\n         <blue>0</blue>\n        </color>\n       </brush>\n      </colorrole>\n     </disabled>\n    </palette>\n   </property>\n   <property name=\"toolTip\">\n    <string>This is an authenticated payment request.</string>\n   </property>\n   <property name=\"autoFillBackground\">\n    <bool>true</bool>\n   </property>\n   <property name=\"frameShape\">\n    <enum>QFrame::NoFrame</enum>\n   </property>\n   <layout class=\"QGridLayout\" name=\"gridLayout_s\">\n    <property name=\"spacing\">\n     <number>12</number>\n    </property>\n    <item row=\"0\" column=\"0\">\n     <widget class=\"QLabel\" name=\"payToLabel_s\">\n      <property name=\"text\">\n       <string>Pay To:</string>\n      </property>\n      <property name=\"alignment\">\n       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n      </property>\n     </widget>\n    </item>\n    <item row=\"0\" column=\"1\">\n     <layout class=\"QHBoxLayout\" name=\"payToLayout_s\">\n      <property name=\"spacing\">\n       <number>0</number>\n      </property>\n      <item>\n       <widget class=\"QLabel\" name=\"payTo_s\">\n        <property name=\"textFormat\">\n         <enum>Qt::PlainText</enum>\n        </property>\n       </widget>\n      </item>\n      <item>\n       <widget class=\"QToolButton\" name=\"deleteButton_s\">\n        <property name=\"toolTip\">\n         <string>Remove this entry</string>\n        </property>\n        <property name=\"text\">\n         <string/>\n        </property>\n        <property name=\"icon\">\n         <iconset resource=\"../bitcoin.qrc\">\n          <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>\n        </property>\n       </widget>\n      </item>\n     </layout>\n    </item>\n    <item row=\"1\" column=\"0\">\n     <widget class=\"QLabel\" name=\"memoLabel_s\">\n      <property name=\"text\">\n       <string>Memo:</string>\n      </property>\n      <property name=\"alignment\">\n       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n      </property>\n     </widget>\n    </item>\n    <item row=\"1\" column=\"1\">\n     <widget class=\"QLabel\" name=\"memoTextLabel_s\">\n      <property name=\"textFormat\">\n       <enum>Qt::PlainText</enum>\n      </property>\n     </widget>\n    </item>\n    <item row=\"2\" column=\"0\">\n     <widget class=\"QLabel\" name=\"amountLabel_s\">\n      <property name=\"text\">\n       <string>A&amp;mount:</string>\n      </property>\n      <property name=\"alignment\">\n       <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>\n      </property>\n      <property name=\"buddy\">\n       <cstring>payAmount_s</cstring>\n      </property>\n     </widget>\n    </item>\n    <item row=\"2\" column=\"1\">\n     <widget class=\"BitcoinAmountField\" name=\"payAmount_s\">\n      <property name=\"acceptDrops\">\n       <bool>false</bool>\n      </property>\n     </widget>\n    </item>\n   </layout>\n  </widget>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>QValidatedLineEdit</class>\n   <extends>QLineEdit</extends>\n   <header>qt/qvalidatedlineedit.h</header>\n  </customwidget>\n  <customwidget>\n   <class>BitcoinAmountField</class>\n   <extends>QLineEdit</extends>\n   <header>qt/bitcoinamountfield.h</header>\n  </customwidget>\n </customwidgets>\n <tabstops>\n  <tabstop>payTo</tabstop>\n  <tabstop>addressBookButton</tabstop>\n  <tabstop>pasteButton</tabstop>\n  <tabstop>deleteButton</tabstop>\n  <tabstop>addAsLabel</tabstop>\n  <tabstop>payAmount</tabstop>\n  <tabstop>payAmount_is</tabstop>\n  <tabstop>deleteButton_is</tabstop>\n  <tabstop>payAmount_s</tabstop>\n  <tabstop>deleteButton_s</tabstop>\n </tabstops>\n <resources>\n  <include location=\"../bitcoin.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/signverifymessagedialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>SignVerifyMessageDialog</class>\n <widget class=\"QDialog\" name=\"SignVerifyMessageDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>700</width>\n    <height>380</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string>Signatures - Sign / Verify a Message</string>\n  </property>\n  <property name=\"modal\">\n   <bool>true</bool>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <item>\n    <widget class=\"QTabWidget\" name=\"tabWidget\">\n     <property name=\"currentIndex\">\n      <number>0</number>\n     </property>\n     <widget class=\"QWidget\" name=\"tabSignMessage\">\n      <attribute name=\"title\">\n       <string>&amp;Sign Message</string>\n      </attribute>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_SM\">\n       <item>\n        <widget class=\"QLabel\" name=\"infoLabel_SM\">\n         <property name=\"text\">\n          <string>You can sign messages/agreements with your addresses to prove you can receive sugarchains sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"wordWrap\">\n          <bool>true</bool>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_1_SM\">\n         <property name=\"spacing\">\n          <number>0</number>\n         </property>\n         <item>\n          <widget class=\"QValidatedLineEdit\" name=\"addressIn_SM\">\n           <property name=\"toolTip\">\n            <string>The Sugarchain address to sign the message with</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"addressBookButton_SM\">\n           <property name=\"toolTip\">\n            <string>Choose previously used address</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/address-book</normaloff>:/icons/address-book</iconset>\n           </property>\n           <property name=\"shortcut\">\n            <string>Alt+A</string>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"pasteButton_SM\">\n           <property name=\"toolTip\">\n            <string>Paste address from clipboard</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/editpaste</normaloff>:/icons/editpaste</iconset>\n           </property>\n           <property name=\"shortcut\">\n            <string>Alt+P</string>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <widget class=\"QPlainTextEdit\" name=\"messageIn_SM\">\n         <property name=\"toolTip\">\n          <string>Enter the message you want to sign here</string>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <widget class=\"QLabel\" name=\"signatureLabel_SM\">\n         <property name=\"text\">\n          <string>Signature</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2_SM\">\n         <property name=\"spacing\">\n          <number>0</number>\n         </property>\n         <item>\n          <widget class=\"QLineEdit\" name=\"signatureOut_SM\">\n           <property name=\"font\">\n            <font>\n             <italic>true</italic>\n            </font>\n           </property>\n           <property name=\"readOnly\">\n            <bool>true</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"copySignatureButton_SM\">\n           <property name=\"toolTip\">\n            <string>Copy the current signature to the system clipboard</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/editcopy</normaloff>:/icons/editcopy</iconset>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_3_SM\">\n         <item>\n          <widget class=\"QPushButton\" name=\"signMessageButton_SM\">\n           <property name=\"toolTip\">\n            <string>Sign the message to prove you own this Sugarchain address</string>\n           </property>\n           <property name=\"text\">\n            <string>Sign &amp;Message</string>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/edit</normaloff>:/icons/edit</iconset>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"clearButton_SM\">\n           <property name=\"toolTip\">\n            <string>Reset all sign message fields</string>\n           </property>\n           <property name=\"text\">\n            <string>Clear &amp;All</string>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name=\"horizontalSpacer_1_SM\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>48</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item>\n          <widget class=\"QLabel\" name=\"statusLabel_SM\">\n           <property name=\"font\">\n            <font>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"wordWrap\">\n            <bool>true</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name=\"horizontalSpacer_2_SM\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>48</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </widget>\n     <widget class=\"QWidget\" name=\"tabVerifyMessage\">\n      <attribute name=\"title\">\n       <string>&amp;Verify Message</string>\n      </attribute>\n      <layout class=\"QVBoxLayout\" name=\"verticalLayout_VM\">\n       <item>\n        <widget class=\"QLabel\" name=\"infoLabel_VM\">\n         <property name=\"text\">\n          <string>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</string>\n         </property>\n         <property name=\"textFormat\">\n          <enum>Qt::PlainText</enum>\n         </property>\n         <property name=\"alignment\">\n          <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>\n         </property>\n         <property name=\"wordWrap\">\n          <bool>true</bool>\n         </property>\n        </widget>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_1_VM\">\n         <property name=\"spacing\">\n          <number>0</number>\n         </property>\n         <item>\n          <widget class=\"QValidatedLineEdit\" name=\"addressIn_VM\">\n           <property name=\"toolTip\">\n            <string>The Sugarchain address the message was signed with</string>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"addressBookButton_VM\">\n           <property name=\"toolTip\">\n            <string>Choose previously used address</string>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/address-book</normaloff>:/icons/address-book</iconset>\n           </property>\n           <property name=\"shortcut\">\n            <string>Alt+A</string>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n        </layout>\n       </item>\n       <item>\n        <widget class=\"QPlainTextEdit\" name=\"messageIn_VM\"/>\n       </item>\n       <item>\n        <widget class=\"QValidatedLineEdit\" name=\"signatureIn_VM\"/>\n       </item>\n       <item>\n        <layout class=\"QHBoxLayout\" name=\"horizontalLayout_2_VM\">\n         <item>\n          <widget class=\"QPushButton\" name=\"verifyMessageButton_VM\">\n           <property name=\"toolTip\">\n            <string>Verify the message to ensure it was signed with the specified Sugarchain address</string>\n           </property>\n           <property name=\"text\">\n            <string>Verify &amp;Message</string>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/transaction_0</normaloff>:/icons/transaction_0</iconset>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <widget class=\"QPushButton\" name=\"clearButton_VM\">\n           <property name=\"toolTip\">\n            <string>Reset all verify message fields</string>\n           </property>\n           <property name=\"text\">\n            <string>Clear &amp;All</string>\n           </property>\n           <property name=\"icon\">\n            <iconset resource=\"../bitcoin.qrc\">\n             <normaloff>:/icons/remove</normaloff>:/icons/remove</iconset>\n           </property>\n           <property name=\"autoDefault\">\n            <bool>false</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name=\"horizontalSpacer_1_VM\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>48</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n         <item>\n          <widget class=\"QLabel\" name=\"statusLabel_VM\">\n           <property name=\"font\">\n            <font>\n             <weight>75</weight>\n             <bold>true</bold>\n            </font>\n           </property>\n           <property name=\"text\">\n            <string/>\n           </property>\n           <property name=\"wordWrap\">\n            <bool>true</bool>\n           </property>\n          </widget>\n         </item>\n         <item>\n          <spacer name=\"horizontalSpacer_2_VM\">\n           <property name=\"orientation\">\n            <enum>Qt::Horizontal</enum>\n           </property>\n           <property name=\"sizeHint\" stdset=\"0\">\n            <size>\n             <width>40</width>\n             <height>48</height>\n            </size>\n           </property>\n          </spacer>\n         </item>\n        </layout>\n       </item>\n      </layout>\n     </widget>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <customwidgets>\n  <customwidget>\n   <class>QValidatedLineEdit</class>\n   <extends>QLineEdit</extends>\n   <header>qt/qvalidatedlineedit.h</header>\n  </customwidget>\n </customwidgets>\n <resources>\n  <include location=\"../bitcoin.qrc\"/>\n </resources>\n <connections/>\n</ui>\n"
  },
  {
    "path": "src/qt/forms/transactiondescdialog.ui",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>TransactionDescDialog</class>\n <widget class=\"QDialog\" name=\"TransactionDescDialog\">\n  <property name=\"geometry\">\n   <rect>\n    <x>0</x>\n    <y>0</y>\n    <width>620</width>\n    <height>250</height>\n   </rect>\n  </property>\n  <property name=\"windowTitle\">\n   <string notr=\"true\">Transaction details</string>\n  </property>\n  <layout class=\"QVBoxLayout\" name=\"verticalLayout\">\n   <item>\n    <widget class=\"QTextEdit\" name=\"detailText\">\n     <property name=\"toolTip\">\n      <string>This pane shows a detailed description of the transaction</string>\n     </property>\n     <property name=\"readOnly\">\n      <bool>true</bool>\n     </property>\n    </widget>\n   </item>\n   <item>\n    <widget class=\"QDialogButtonBox\" name=\"buttonBox\">\n     <property name=\"orientation\">\n      <enum>Qt::Horizontal</enum>\n     </property>\n     <property name=\"standardButtons\">\n      <set>QDialogButtonBox::Close</set>\n     </property>\n    </widget>\n   </item>\n  </layout>\n </widget>\n <resources/>\n <connections>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>accepted()</signal>\n   <receiver>TransactionDescDialog</receiver>\n   <slot>accept()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n   </hints>\n  </connection>\n  <connection>\n   <sender>buttonBox</sender>\n   <signal>rejected()</signal>\n   <receiver>TransactionDescDialog</receiver>\n   <slot>reject()</slot>\n   <hints>\n    <hint type=\"sourcelabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n    <hint type=\"destinationlabel\">\n     <x>20</x>\n     <y>20</y>\n    </hint>\n   </hints>\n  </connection>\n </connections>\n</ui>\n"
  },
  {
    "path": "src/qt/guiconstants.h",
    "content": "// Copyright (c) 2011-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_GUICONSTANTS_H\n#define BITCOIN_QT_GUICONSTANTS_H\n\n/* Milliseconds between model updates */\nstatic const int MODEL_UPDATE_DELAY = 250;\n\n/* AskPassphraseDialog -- Maximum passphrase length */\nstatic const int MAX_PASSPHRASE_SIZE = 1024;\n\n/* BitcoinGUI -- Size of icons in status bar */\nstatic const int STATUSBAR_ICONSIZE = 16;\n\nstatic const bool DEFAULT_SPLASHSCREEN = true;\n\n/* Invalid field background style */\n#define STYLE_INVALID \"background:#FF8080\"\n\n/* Transaction list -- unconfirmed transaction */\n#define COLOR_UNCONFIRMED QColor(128, 128, 128)\n/* Transaction list -- negative amount */\n#define COLOR_NEGATIVE QColor(255, 0, 0)\n/* Transaction list -- bare address (without label) */\n#define COLOR_BAREADDRESS QColor(140, 140, 140)\n/* Transaction list -- TX status decoration - open until date */\n#define COLOR_TX_STATUS_OPENUNTILDATE QColor(64, 64, 255)\n/* Transaction list -- TX status decoration - danger, tx needs attention */\n#define COLOR_TX_STATUS_DANGER QColor(200, 100, 100)\n/* Transaction list -- TX status decoration - default color */\n#define COLOR_BLACK QColor(0, 0, 0)\n\n/* Tooltips longer than this (in characters) are converted into rich text,\n   so that they can be word-wrapped.\n */\nstatic const int TOOLTIP_WRAP_THRESHOLD = 80;\n\n/* Maximum allowed URI length */\nstatic const int MAX_URI_LENGTH = 255;\n\n/* QRCodeDialog -- size of exported QR Code image */\n#define QR_IMAGE_SIZE 300\n\n/* Number of frames in spinner animation */\n#define SPINNER_FRAMES 36\n\n#define QAPP_ORG_NAME \"Sugarchain\"\n#define QAPP_ORG_DOMAIN \"sugarchain.org\"\n#define QAPP_APP_NAME_DEFAULT \"Sugarchain-Qt\"\n#define QAPP_APP_NAME_TESTNET \"Sugarchain-Qt-testnet\"\n\n#endif // BITCOIN_QT_GUICONSTANTS_H\n"
  },
  {
    "path": "src/qt/guiutil.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/guiutil.h>\n\n#include <qt/bitcoinaddressvalidator.h>\n#include <qt/bitcoinunits.h>\n#include <qt/qvalidatedlineedit.h>\n#include <qt/walletmodel.h>\n\n#include <primitives/transaction.h>\n#include <init.h>\n#include <policy/policy.h>\n#include <protocol.h>\n#include <script/script.h>\n#include <script/standard.h>\n#include <util.h>\n\n#ifdef WIN32\n#ifdef _WIN32_WINNT\n#undef _WIN32_WINNT\n#endif\n#define _WIN32_WINNT 0x0501\n#ifdef _WIN32_IE\n#undef _WIN32_IE\n#endif\n#define _WIN32_IE 0x0501\n#define WIN32_LEAN_AND_MEAN 1\n#ifndef NOMINMAX\n#define NOMINMAX\n#endif\n#include <shellapi.h>\n#include <shlobj.h>\n#include <shlwapi.h>\n#endif\n\n#include <boost/scoped_array.hpp>\n\n#include <QAbstractItemView>\n#include <QApplication>\n#include <QClipboard>\n#include <QDateTime>\n#include <QDesktopServices>\n#include <QDesktopWidget>\n#include <QDoubleValidator>\n#include <QFileDialog>\n#include <QFont>\n#include <QLineEdit>\n#include <QSettings>\n#include <QTextDocument> // for Qt::mightBeRichText\n#include <QThread>\n#include <QMouseEvent>\n\n#if QT_VERSION < 0x050000\n#include <QUrl>\n#else\n#include <QUrlQuery>\n#endif\n\n#if QT_VERSION >= 0x50200\n#include <QFontDatabase>\n#endif\n\n#ifdef WIN32\nstatic fs::detail::utf8_codecvt_facet utf8;\n#endif\n\n#if defined(Q_OS_MAC)\nextern double NSAppKitVersionNumber;\n#if !defined(NSAppKitVersionNumber10_8)\n#define NSAppKitVersionNumber10_8 1187\n#endif\n#if !defined(NSAppKitVersionNumber10_9)\n#define NSAppKitVersionNumber10_9 1265\n#endif\n#endif\n\nnamespace GUIUtil {\n\nQString dateTimeStr(const QDateTime &date)\n{\n    return date.date().toString(Qt::SystemLocaleShortDate) + QString(\" \") + date.toString(\"hh:mm:ss\"); // FIXME.SUGAR\n}\n\nQString dateTimeStr(qint64 nTime)\n{\n    return dateTimeStr(QDateTime::fromTime_t((qint32)nTime));\n}\n\nQFont fixedPitchFont()\n{\n#if QT_VERSION >= 0x50200\n    return QFontDatabase::systemFont(QFontDatabase::FixedFont);\n#else\n    QFont font(\"Monospace\");\n#if QT_VERSION >= 0x040800\n    font.setStyleHint(QFont::Monospace);\n#else\n    font.setStyleHint(QFont::TypeWriter);\n#endif\n    return font;\n#endif\n}\n\n// Just some dummy data to generate an convincing random-looking (but consistent) address\nstatic const uint8_t dummydata[] = {0xeb,0x15,0x23,0x1d,0xfc,0xeb,0x60,0x92,0x58,0x86,0xb6,0x7d,0x06,0x52,0x99,0x92,0x59,0x15,0xae,0xb1,0x72,0xc0,0x66,0x47};\n\n// Generate a dummy address with invalid CRC, starting with the network prefix.\nstatic std::string DummyAddress(const CChainParams &params)\n{\n    std::vector<unsigned char> sourcedata = params.Base58Prefix(CChainParams::PUBKEY_ADDRESS);\n    sourcedata.insert(sourcedata.end(), dummydata, dummydata + sizeof(dummydata));\n    for(int i=0; i<256; ++i) { // Try every trailing byte\n        std::string s = EncodeBase58(sourcedata.data(), sourcedata.data() + sourcedata.size());\n        if (!IsValidDestinationString(s)) {\n            return s;\n        }\n        sourcedata[sourcedata.size()-1] += 1;\n    }\n    return \"\";\n}\n\nvoid setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)\n{\n    parent->setFocusProxy(widget);\n\n    widget->setFont(fixedPitchFont());\n#if QT_VERSION >= 0x040700\n    // We don't want translators to use own addresses in translations\n    // and this is the only place, where this address is supplied.\n    widget->setPlaceholderText(QObject::tr(\"Enter a Sugarchain address (e.g. %1)\").arg(\n        QString::fromStdString(DummyAddress(Params()))));\n#endif\n    widget->setValidator(new BitcoinAddressEntryValidator(parent));\n    widget->setCheckValidator(new BitcoinAddressCheckValidator(parent));\n}\n\nvoid setupAmountWidget(QLineEdit *widget, QWidget *parent)\n{\n    QDoubleValidator *amountValidator = new QDoubleValidator(parent);\n    amountValidator->setDecimals(8);\n    amountValidator->setBottom(0.0);\n    widget->setValidator(amountValidator);\n    widget->setAlignment(Qt::AlignRight|Qt::AlignVCenter);\n}\n\nbool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)\n{\n    // return if URI is not valid or is no bitcoin: URI\n    if(!uri.isValid() || uri.scheme() != QString(\"sugarchain\"))\n        return false;\n\n    SendCoinsRecipient rv;\n    rv.address = uri.path();\n    // Trim any following forward slash which may have been added by the OS\n    if (rv.address.endsWith(\"/\")) {\n        rv.address.truncate(rv.address.length() - 1);\n    }\n    rv.amount = 0;\n\n#if QT_VERSION < 0x050000\n    QList<QPair<QString, QString> > items = uri.queryItems();\n#else\n    QUrlQuery uriQuery(uri);\n    QList<QPair<QString, QString> > items = uriQuery.queryItems();\n#endif\n    for (QList<QPair<QString, QString> >::iterator i = items.begin(); i != items.end(); i++)\n    {\n        bool fShouldReturnFalse = false;\n        if (i->first.startsWith(\"req-\"))\n        {\n            i->first.remove(0, 4);\n            fShouldReturnFalse = true;\n        }\n\n        if (i->first == \"label\")\n        {\n            rv.label = i->second;\n            fShouldReturnFalse = false;\n        }\n        if (i->first == \"message\")\n        {\n            rv.message = i->second;\n            fShouldReturnFalse = false;\n        }\n        else if (i->first == \"amount\")\n        {\n            if(!i->second.isEmpty())\n            {\n                if(!BitcoinUnits::parse(BitcoinUnits::BTC, i->second, &rv.amount))\n                {\n                    return false;\n                }\n            }\n            fShouldReturnFalse = false;\n        }\n\n        if (fShouldReturnFalse)\n            return false;\n    }\n    if(out)\n    {\n        *out = rv;\n    }\n    return true;\n}\n\nbool parseBitcoinURI(QString uri, SendCoinsRecipient *out)\n{\n    // Convert bitcoin:// to bitcoin:\n    //\n    //    Cannot handle this later, because bitcoin:// will cause Qt to see the part after // as host,\n    //    which will lower-case it (and thus invalidate the address).\n    if(uri.startsWith(\"sugarchain://\", Qt::CaseInsensitive))\n    {\n        // Fix Length\n        // \"bitcoin://\", 10\n        // \"litecoin://\", 11\n        // \"sugarchain://\", 13\n        uri.replace(0, 13, \"sugarchain:\");\n    }\n    QUrl uriInstance(uri);\n    return parseBitcoinURI(uriInstance, out);\n}\n\nQString formatBitcoinURI(const SendCoinsRecipient &info)\n{\n    QString ret = QString(\"sugarchain:%1\").arg(info.address);\n    int paramCount = 0;\n\n    if (info.amount)\n    {\n        ret += QString(\"?amount=%1\").arg(BitcoinUnits::format(BitcoinUnits::BTC, info.amount, false, BitcoinUnits::separatorNever));\n        paramCount++;\n    }\n\n    if (!info.label.isEmpty())\n    {\n        QString lbl(QUrl::toPercentEncoding(info.label));\n        ret += QString(\"%1label=%2\").arg(paramCount == 0 ? \"?\" : \"&\").arg(lbl);\n        paramCount++;\n    }\n\n    if (!info.message.isEmpty())\n    {\n        QString msg(QUrl::toPercentEncoding(info.message));\n        ret += QString(\"%1message=%2\").arg(paramCount == 0 ? \"?\" : \"&\").arg(msg);\n        paramCount++;\n    }\n\n    return ret;\n}\n\nbool isDust(const QString& address, const CAmount& amount)\n{\n    CTxDestination dest = DecodeDestination(address.toStdString());\n    CScript script = GetScriptForDestination(dest);\n    CTxOut txOut(amount, script);\n    return IsDust(txOut, ::dustRelayFee);\n}\n\nQString HtmlEscape(const QString& str, bool fMultiLine)\n{\n#if QT_VERSION < 0x050000\n    QString escaped = Qt::escape(str);\n#else\n    QString escaped = str.toHtmlEscaped();\n#endif\n    if(fMultiLine)\n    {\n        escaped = escaped.replace(\"\\n\", \"<br>\\n\");\n    }\n    return escaped;\n}\n\nQString HtmlEscape(const std::string& str, bool fMultiLine)\n{\n    return HtmlEscape(QString::fromStdString(str), fMultiLine);\n}\n\nvoid copyEntryData(QAbstractItemView *view, int column, int role)\n{\n    if(!view || !view->selectionModel())\n        return;\n    QModelIndexList selection = view->selectionModel()->selectedRows(column);\n\n    if(!selection.isEmpty())\n    {\n        // Copy first item\n        setClipboard(selection.at(0).data(role).toString());\n    }\n}\n\nQList<QModelIndex> getEntryData(QAbstractItemView *view, int column)\n{\n    if(!view || !view->selectionModel())\n        return QList<QModelIndex>();\n    return view->selectionModel()->selectedRows(column);\n}\n\nQString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir,\n    const QString &filter,\n    QString *selectedSuffixOut)\n{\n    QString selectedFilter;\n    QString myDir;\n    if(dir.isEmpty()) // Default to user documents location\n    {\n#if QT_VERSION < 0x050000\n        myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);\n#else\n        myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);\n#endif\n    }\n    else\n    {\n        myDir = dir;\n    }\n    /* Directly convert path to native OS path separators */\n    QString result = QDir::toNativeSeparators(QFileDialog::getSaveFileName(parent, caption, myDir, filter, &selectedFilter));\n\n    /* Extract first suffix from filter pattern \"Description (*.foo)\" or \"Description (*.foo *.bar ...) */\n    QRegExp filter_re(\".* \\\\(\\\\*\\\\.(.*)[ \\\\)]\");\n    QString selectedSuffix;\n    if(filter_re.exactMatch(selectedFilter))\n    {\n        selectedSuffix = filter_re.cap(1);\n    }\n\n    /* Add suffix if needed */\n    QFileInfo info(result);\n    if(!result.isEmpty())\n    {\n        if(info.suffix().isEmpty() && !selectedSuffix.isEmpty())\n        {\n            /* No suffix specified, add selected suffix */\n            if(!result.endsWith(\".\"))\n                result.append(\".\");\n            result.append(selectedSuffix);\n        }\n    }\n\n    /* Return selected suffix if asked to */\n    if(selectedSuffixOut)\n    {\n        *selectedSuffixOut = selectedSuffix;\n    }\n    return result;\n}\n\nQString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir,\n    const QString &filter,\n    QString *selectedSuffixOut)\n{\n    QString selectedFilter;\n    QString myDir;\n    if(dir.isEmpty()) // Default to user documents location\n    {\n#if QT_VERSION < 0x050000\n        myDir = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);\n#else\n        myDir = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);\n#endif\n    }\n    else\n    {\n        myDir = dir;\n    }\n    /* Directly convert path to native OS path separators */\n    QString result = QDir::toNativeSeparators(QFileDialog::getOpenFileName(parent, caption, myDir, filter, &selectedFilter));\n\n    if(selectedSuffixOut)\n    {\n        /* Extract first suffix from filter pattern \"Description (*.foo)\" or \"Description (*.foo *.bar ...) */\n        QRegExp filter_re(\".* \\\\(\\\\*\\\\.(.*)[ \\\\)]\");\n        QString selectedSuffix;\n        if(filter_re.exactMatch(selectedFilter))\n        {\n            selectedSuffix = filter_re.cap(1);\n        }\n        *selectedSuffixOut = selectedSuffix;\n    }\n    return result;\n}\n\nQt::ConnectionType blockingGUIThreadConnection()\n{\n    if(QThread::currentThread() != qApp->thread())\n    {\n        return Qt::BlockingQueuedConnection;\n    }\n    else\n    {\n        return Qt::DirectConnection;\n    }\n}\n\nbool checkPoint(const QPoint &p, const QWidget *w)\n{\n    QWidget *atW = QApplication::widgetAt(w->mapToGlobal(p));\n    if (!atW) return false;\n    return atW->topLevelWidget() == w;\n}\n\nbool isObscured(QWidget *w)\n{\n    return !(checkPoint(QPoint(0, 0), w)\n        && checkPoint(QPoint(w->width() - 1, 0), w)\n        && checkPoint(QPoint(0, w->height() - 1), w)\n        && checkPoint(QPoint(w->width() - 1, w->height() - 1), w)\n        && checkPoint(QPoint(w->width() / 2, w->height() / 2), w));\n}\n\nvoid openDebugLogfile()\n{\n    fs::path pathDebug = GetDataDir() / \"debug.log\";\n\n    /* Open debug.log with the associated application */\n    if (fs::exists(pathDebug))\n        QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathDebug)));\n}\n\nbool openBitcoinConf()\n{\n    boost::filesystem::path pathConfig = GetConfigFile(BITCOIN_CONF_FILENAME);\n\n    /* Create the file */\n    boost::filesystem::ofstream configFile(pathConfig, std::ios_base::app);\n    \n    if (!configFile.good())\n        return false;\n    \n    configFile.close();\n    \n    /* Open bitcoin.conf with the associated application */\n    return QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig)));\n}\n\nvoid SubstituteFonts(const QString& language)\n{\n#if defined(Q_OS_MAC)\n// Background:\n// OSX's default font changed in 10.9 and Qt is unable to find it with its\n// usual fallback methods when building against the 10.7 sdk or lower.\n// The 10.8 SDK added a function to let it find the correct fallback font.\n// If this fallback is not properly loaded, some characters may fail to\n// render correctly.\n//\n// The same thing happened with 10.10. .Helvetica Neue DeskInterface is now default.\n//\n// Solution: If building with the 10.7 SDK or lower and the user's platform\n// is 10.9 or higher at runtime, substitute the correct font. This needs to\n// happen before the QApplication is created.\n#if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8\n    if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_8)\n    {\n        if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_9)\n            /* On a 10.9 - 10.9.x system */\n            QFont::insertSubstitution(\".Lucida Grande UI\", \"Lucida Grande\");\n        else\n        {\n            /* 10.10 or later system */\n            if (language == \"zh_CN\" || language == \"zh_TW\" || language == \"zh_HK\") // traditional or simplified Chinese\n              QFont::insertSubstitution(\".Helvetica Neue DeskInterface\", \"Heiti SC\");\n            else if (language == \"ja\") // Japanese\n              QFont::insertSubstitution(\".Helvetica Neue DeskInterface\", \"Songti SC\");\n            else\n              QFont::insertSubstitution(\".Helvetica Neue DeskInterface\", \"Lucida Grande\");\n        }\n    }\n#endif\n#endif\n}\n\nToolTipToRichTextFilter::ToolTipToRichTextFilter(int _size_threshold, QObject *parent) :\n    QObject(parent),\n    size_threshold(_size_threshold)\n{\n\n}\n\nbool ToolTipToRichTextFilter::eventFilter(QObject *obj, QEvent *evt)\n{\n    if(evt->type() == QEvent::ToolTipChange)\n    {\n        QWidget *widget = static_cast<QWidget*>(obj);\n        QString tooltip = widget->toolTip();\n        if(tooltip.size() > size_threshold && !tooltip.startsWith(\"<qt\") && !Qt::mightBeRichText(tooltip))\n        {\n            // Envelop with <qt></qt> to make sure Qt detects this as rich text\n            // Escape the current message as HTML and replace \\n by <br>\n            tooltip = \"<qt>\" + HtmlEscape(tooltip, true) + \"</qt>\";\n            widget->setToolTip(tooltip);\n            return true;\n        }\n    }\n    return QObject::eventFilter(obj, evt);\n}\n\nvoid TableViewLastColumnResizingFixer::connectViewHeadersSignals()\n{\n    connect(tableView->horizontalHeader(), SIGNAL(sectionResized(int,int,int)), this, SLOT(on_sectionResized(int,int,int)));\n    connect(tableView->horizontalHeader(), SIGNAL(geometriesChanged()), this, SLOT(on_geometriesChanged()));\n}\n\n// We need to disconnect these while handling the resize events, otherwise we can enter infinite loops.\nvoid TableViewLastColumnResizingFixer::disconnectViewHeadersSignals()\n{\n    disconnect(tableView->horizontalHeader(), SIGNAL(sectionResized(int,int,int)), this, SLOT(on_sectionResized(int,int,int)));\n    disconnect(tableView->horizontalHeader(), SIGNAL(geometriesChanged()), this, SLOT(on_geometriesChanged()));\n}\n\n// Setup the resize mode, handles compatibility for Qt5 and below as the method signatures changed.\n// Refactored here for readability.\nvoid TableViewLastColumnResizingFixer::setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode)\n{\n#if QT_VERSION < 0x050000\n    tableView->horizontalHeader()->setResizeMode(logicalIndex, resizeMode);\n#else\n    tableView->horizontalHeader()->setSectionResizeMode(logicalIndex, resizeMode);\n#endif\n}\n\nvoid TableViewLastColumnResizingFixer::resizeColumn(int nColumnIndex, int width)\n{\n    tableView->setColumnWidth(nColumnIndex, width);\n    tableView->horizontalHeader()->resizeSection(nColumnIndex, width);\n}\n\nint TableViewLastColumnResizingFixer::getColumnsWidth()\n{\n    int nColumnsWidthSum = 0;\n    for (int i = 0; i < columnCount; i++)\n    {\n        nColumnsWidthSum += tableView->horizontalHeader()->sectionSize(i);\n    }\n    return nColumnsWidthSum;\n}\n\nint TableViewLastColumnResizingFixer::getAvailableWidthForColumn(int column)\n{\n    int nResult = lastColumnMinimumWidth;\n    int nTableWidth = tableView->horizontalHeader()->width();\n\n    if (nTableWidth > 0)\n    {\n        int nOtherColsWidth = getColumnsWidth() - tableView->horizontalHeader()->sectionSize(column);\n        nResult = std::max(nResult, nTableWidth - nOtherColsWidth);\n    }\n\n    return nResult;\n}\n\n// Make sure we don't make the columns wider than the table's viewport width.\nvoid TableViewLastColumnResizingFixer::adjustTableColumnsWidth()\n{\n    disconnectViewHeadersSignals();\n    resizeColumn(lastColumnIndex, getAvailableWidthForColumn(lastColumnIndex));\n    connectViewHeadersSignals();\n\n    int nTableWidth = tableView->horizontalHeader()->width();\n    int nColsWidth = getColumnsWidth();\n    if (nColsWidth > nTableWidth)\n    {\n        resizeColumn(secondToLastColumnIndex,getAvailableWidthForColumn(secondToLastColumnIndex));\n    }\n}\n\n// Make column use all the space available, useful during window resizing.\nvoid TableViewLastColumnResizingFixer::stretchColumnWidth(int column)\n{\n    disconnectViewHeadersSignals();\n    resizeColumn(column, getAvailableWidthForColumn(column));\n    connectViewHeadersSignals();\n}\n\n// When a section is resized this is a slot-proxy for ajustAmountColumnWidth().\nvoid TableViewLastColumnResizingFixer::on_sectionResized(int logicalIndex, int oldSize, int newSize)\n{\n    adjustTableColumnsWidth();\n    int remainingWidth = getAvailableWidthForColumn(logicalIndex);\n    if (newSize > remainingWidth)\n    {\n       resizeColumn(logicalIndex, remainingWidth);\n    }\n}\n\n// When the table's geometry is ready, we manually perform the stretch of the \"Message\" column,\n// as the \"Stretch\" resize mode does not allow for interactive resizing.\nvoid TableViewLastColumnResizingFixer::on_geometriesChanged()\n{\n    if ((getColumnsWidth() - this->tableView->horizontalHeader()->width()) != 0)\n    {\n        disconnectViewHeadersSignals();\n        resizeColumn(secondToLastColumnIndex, getAvailableWidthForColumn(secondToLastColumnIndex));\n        connectViewHeadersSignals();\n    }\n}\n\n/**\n * Initializes all internal variables and prepares the\n * the resize modes of the last 2 columns of the table and\n */\nTableViewLastColumnResizingFixer::TableViewLastColumnResizingFixer(QTableView* table, int lastColMinimumWidth, int allColsMinimumWidth, QObject *parent) :\n    QObject(parent),\n    tableView(table),\n    lastColumnMinimumWidth(lastColMinimumWidth),\n    allColumnsMinimumWidth(allColsMinimumWidth)\n{\n    columnCount = tableView->horizontalHeader()->count();\n    lastColumnIndex = columnCount - 1;\n    secondToLastColumnIndex = columnCount - 2;\n    tableView->horizontalHeader()->setMinimumSectionSize(allColumnsMinimumWidth);\n    setViewHeaderResizeMode(secondToLastColumnIndex, QHeaderView::Interactive);\n    setViewHeaderResizeMode(lastColumnIndex, QHeaderView::Interactive);\n}\n\n#ifdef WIN32\nfs::path static StartupShortcutPath()\n{\n    std::string chain = ChainNameFromCommandLine();\n    if (chain == CBaseChainParams::MAIN)\n        return GetSpecialFolderPath(CSIDL_STARTUP) / \"Sugarchain.lnk\";\n    if (chain == CBaseChainParams::TESTNET) // Remove this special case when CBaseChainParams::TESTNET = \"testnet5\"\n        return GetSpecialFolderPath(CSIDL_STARTUP) / \"Sugarchain (testnet).lnk\";\n    return GetSpecialFolderPath(CSIDL_STARTUP) / strprintf(\"Sugarchain (%s).lnk\", chain);\n}\n\nbool GetStartOnSystemStartup()\n{\n    // check for Bitcoin*.lnk\n    return fs::exists(StartupShortcutPath());\n}\n\nbool SetStartOnSystemStartup(bool fAutoStart)\n{\n    // If the shortcut exists already, remove it for updating\n    fs::remove(StartupShortcutPath());\n\n    if (fAutoStart)\n    {\n        CoInitialize(nullptr);\n\n        // Get a pointer to the IShellLink interface.\n        IShellLink* psl = nullptr;\n        HRESULT hres = CoCreateInstance(CLSID_ShellLink, nullptr,\n            CLSCTX_INPROC_SERVER, IID_IShellLink,\n            reinterpret_cast<void**>(&psl));\n\n        if (SUCCEEDED(hres))\n        {\n            // Get the current executable path\n            TCHAR pszExePath[MAX_PATH];\n            GetModuleFileName(nullptr, pszExePath, sizeof(pszExePath));\n\n            // Start client minimized\n            QString strArgs = \"-min\";\n            // Set -testnet /-regtest options\n            strArgs += QString::fromStdString(strprintf(\" -testnet=%d -regtest=%d\", gArgs.GetBoolArg(\"-testnet\", false), gArgs.GetBoolArg(\"-regtest\", false)));\n\n#ifdef UNICODE\n            boost::scoped_array<TCHAR> args(new TCHAR[strArgs.length() + 1]);\n            // Convert the QString to TCHAR*\n            strArgs.toWCharArray(args.get());\n            // Add missing '\\0'-termination to string\n            args[strArgs.length()] = '\\0';\n#endif\n\n            // Set the path to the shortcut target\n            psl->SetPath(pszExePath);\n            PathRemoveFileSpec(pszExePath);\n            psl->SetWorkingDirectory(pszExePath);\n            psl->SetShowCmd(SW_SHOWMINNOACTIVE);\n#ifndef UNICODE\n            psl->SetArguments(strArgs.toStdString().c_str());\n#else\n            psl->SetArguments(args.get());\n#endif\n\n            // Query IShellLink for the IPersistFile interface for\n            // saving the shortcut in persistent storage.\n            IPersistFile* ppf = nullptr;\n            hres = psl->QueryInterface(IID_IPersistFile, reinterpret_cast<void**>(&ppf));\n            if (SUCCEEDED(hres))\n            {\n                WCHAR pwsz[MAX_PATH];\n                // Ensure that the string is ANSI.\n                MultiByteToWideChar(CP_ACP, 0, StartupShortcutPath().string().c_str(), -1, pwsz, MAX_PATH);\n                // Save the link by calling IPersistFile::Save.\n                hres = ppf->Save(pwsz, TRUE);\n                ppf->Release();\n                psl->Release();\n                CoUninitialize();\n                return true;\n            }\n            psl->Release();\n        }\n        CoUninitialize();\n        return false;\n    }\n    return true;\n}\n#elif defined(Q_OS_LINUX)\n\n// Follow the Desktop Application Autostart Spec:\n// http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html\n\nfs::path static GetAutostartDir()\n{\n    char* pszConfigHome = getenv(\"XDG_CONFIG_HOME\");\n    if (pszConfigHome) return fs::path(pszConfigHome) / \"autostart\";\n    char* pszHome = getenv(\"HOME\");\n    if (pszHome) return fs::path(pszHome) / \".config\" / \"autostart\";\n    return fs::path();\n}\n\nfs::path static GetAutostartFilePath()\n{\n    std::string chain = ChainNameFromCommandLine();\n    if (chain == CBaseChainParams::MAIN)\n        return GetAutostartDir() / \"sugarchain.desktop\";\n    return GetAutostartDir() / strprintf(\"sugarchain-%s.lnk\", chain);\n}\n\nbool GetStartOnSystemStartup()\n{\n    fs::ifstream optionFile(GetAutostartFilePath());\n    if (!optionFile.good())\n        return false;\n    // Scan through file for \"Hidden=true\":\n    std::string line;\n    while (!optionFile.eof())\n    {\n        getline(optionFile, line);\n        if (line.find(\"Hidden\") != std::string::npos &&\n            line.find(\"true\") != std::string::npos)\n            return false;\n    }\n    optionFile.close();\n\n    return true;\n}\n\nbool SetStartOnSystemStartup(bool fAutoStart)\n{\n    if (!fAutoStart)\n        fs::remove(GetAutostartFilePath());\n    else\n    {\n        char pszExePath[MAX_PATH+1];\n        ssize_t r = readlink(\"/proc/self/exe\", pszExePath, sizeof(pszExePath) - 1);\n        if (r == -1)\n            return false;\n        pszExePath[r] = '\\0';\n\n        fs::create_directories(GetAutostartDir());\n\n        fs::ofstream optionFile(GetAutostartFilePath(), std::ios_base::out|std::ios_base::trunc);\n        if (!optionFile.good())\n            return false;\n        std::string chain = ChainNameFromCommandLine();\n        // Write a bitcoin.desktop file to the autostart directory:\n        optionFile << \"[Desktop Entry]\\n\";\n        optionFile << \"Type=Application\\n\";\n        if (chain == CBaseChainParams::MAIN)\n            optionFile << \"Name=Sugarchain\\n\";\n        else\n            optionFile << strprintf(\"Name=Sugarchain (%s)\\n\", chain);\n        optionFile << \"Exec=\" << pszExePath << strprintf(\" -min -testnet=%d -regtest=%d\\n\", gArgs.GetBoolArg(\"-testnet\", false), gArgs.GetBoolArg(\"-regtest\", false));\n        optionFile << \"Terminal=false\\n\";\n        optionFile << \"Hidden=false\\n\";\n        optionFile.close();\n    }\n    return true;\n}\n\n\n#elif defined(Q_OS_MAC)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"\n// based on: https://github.com/Mozketo/LaunchAtLoginController/blob/master/LaunchAtLoginController.m\n\n#include <CoreFoundation/CoreFoundation.h>\n#include <CoreServices/CoreServices.h>\n\nLSSharedFileListItemRef findStartupItemInList(LSSharedFileListRef list, CFURLRef findUrl);\nLSSharedFileListItemRef findStartupItemInList(LSSharedFileListRef list, CFURLRef findUrl)\n{\n    CFArrayRef listSnapshot = LSSharedFileListCopySnapshot(list, nullptr);\n    if (listSnapshot == nullptr) {\n        return nullptr;\n    }\n    \n    // loop through the list of startup items and try to find the bitcoin app\n    for(int i = 0; i < CFArrayGetCount(listSnapshot); i++) {\n        LSSharedFileListItemRef item = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(listSnapshot, i);\n        UInt32 resolutionFlags = kLSSharedFileListNoUserInteraction | kLSSharedFileListDoNotMountVolumes;\n        CFURLRef currentItemURL = nullptr;\n\n#if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= 10100\n        if(&LSSharedFileListItemCopyResolvedURL)\n            currentItemURL = LSSharedFileListItemCopyResolvedURL(item, resolutionFlags, nullptr);\n#if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED < 10100\n        else\n            LSSharedFileListItemResolve(item, resolutionFlags, &currentItemURL, nullptr);\n#endif\n#else\n        LSSharedFileListItemResolve(item, resolutionFlags, &currentItemURL, nullptr);\n#endif\n\n        if(currentItemURL) {\n            if (CFEqual(currentItemURL, findUrl)) {\n                // found\n                CFRelease(listSnapshot);\n                CFRelease(currentItemURL);\n                return item;\n            }\n            CFRelease(currentItemURL);\n        }\n    }\n    \n    CFRelease(listSnapshot);\n    return nullptr;\n}\n\nbool GetStartOnSystemStartup()\n{\n    CFURLRef bitcoinAppUrl = CFBundleCopyBundleURL(CFBundleGetMainBundle());\n    if (bitcoinAppUrl == nullptr) {\n        return false;\n    }\n    \n    LSSharedFileListRef loginItems = LSSharedFileListCreate(nullptr, kLSSharedFileListSessionLoginItems, nullptr);\n    LSSharedFileListItemRef foundItem = findStartupItemInList(loginItems, bitcoinAppUrl);\n\n    CFRelease(bitcoinAppUrl);\n    return !!foundItem; // return boolified object\n}\n\nbool SetStartOnSystemStartup(bool fAutoStart)\n{\n    CFURLRef bitcoinAppUrl = CFBundleCopyBundleURL(CFBundleGetMainBundle());\n    if (bitcoinAppUrl == nullptr) {\n        return false;\n    }\n    \n    LSSharedFileListRef loginItems = LSSharedFileListCreate(nullptr, kLSSharedFileListSessionLoginItems, nullptr);\n    LSSharedFileListItemRef foundItem = findStartupItemInList(loginItems, bitcoinAppUrl);\n\n    if(fAutoStart && !foundItem) {\n        // add bitcoin app to startup item list\n        LSSharedFileListInsertItemURL(loginItems, kLSSharedFileListItemBeforeFirst, nullptr, nullptr, bitcoinAppUrl, nullptr, nullptr);\n    }\n    else if(!fAutoStart && foundItem) {\n        // remove item\n        LSSharedFileListItemRemove(loginItems, foundItem);\n    }\n    \n    CFRelease(bitcoinAppUrl);\n    return true;\n}\n#pragma GCC diagnostic pop\n#else\n\nbool GetStartOnSystemStartup() { return false; }\nbool SetStartOnSystemStartup(bool fAutoStart) { return false; }\n\n#endif\n\nvoid setClipboard(const QString& str)\n{\n    QApplication::clipboard()->setText(str, QClipboard::Clipboard);\n    QApplication::clipboard()->setText(str, QClipboard::Selection);\n}\n\nfs::path qstringToBoostPath(const QString &path)\n{\n#ifdef WIN32\n    return fs::path(path.toStdString(), utf8);\n#else\n    return fs::path(path.toStdString());\n#endif\n}\n\nQString boostPathToQString(const fs::path &path)\n{\n#ifdef WIN32\n    return QString::fromStdString(path.string(utf8));\n#else\n    return QString::fromStdString(path.string());\n#endif\n}\n\nQString formatDurationStr(int secs)\n{\n    QStringList strList;\n    int days = secs / 86400;\n    int hours = (secs % 86400) / 3600;\n    int mins = (secs % 3600) / 60;\n    int seconds = secs % 60;\n\n    if (days)\n        strList.append(QString(QObject::tr(\"%1 d\")).arg(days));\n    if (hours)\n        strList.append(QString(QObject::tr(\"%1 h\")).arg(hours));\n    if (mins)\n        strList.append(QString(QObject::tr(\"%1 m\")).arg(mins));\n    if (seconds || (!days && !hours && !mins))\n        strList.append(QString(QObject::tr(\"%1 s\")).arg(seconds));\n\n    return strList.join(\" \");\n}\n\nQString formatServicesStr(quint64 mask)\n{\n    QStringList strList;\n\n    // Just scan the last 8 bits for now.\n    for (int i = 0; i < 8; i++) {\n        uint64_t check = 1 << i;\n        if (mask & check)\n        {\n            switch (check)\n            {\n            case NODE_NETWORK:\n                strList.append(\"NETWORK\");\n                break;\n            case NODE_GETUTXO:\n                strList.append(\"GETUTXO\");\n                break;\n            case NODE_BLOOM:\n                strList.append(\"BLOOM\");\n                break;\n            case NODE_WITNESS:\n                strList.append(\"WITNESS\");\n                break;\n            case NODE_XTHIN:\n                strList.append(\"XTHIN\");\n                break;\n            default:\n                strList.append(QString(\"%1[%2]\").arg(\"UNKNOWN\").arg(check));\n            }\n        }\n    }\n\n    if (strList.size())\n        return strList.join(\" & \");\n    else\n        return QObject::tr(\"None\");\n}\n\nQString formatPingTime(double dPingTime)\n{\n    return (dPingTime == std::numeric_limits<int64_t>::max()/1e6 || dPingTime == 0) ? QObject::tr(\"N/A\") : QString(QObject::tr(\"%1 ms\")).arg(QString::number((int)(dPingTime * 1000), 10));\n}\n\nQString formatTimeOffset(int64_t nTimeOffset)\n{\n  return QString(QObject::tr(\"%1 s\")).arg(QString::number((int)nTimeOffset, 10));\n}\n\nQString formatNiceTimeOffset(qint64 secs)\n{\n    // Represent time from last generated block in human readable text\n    QString timeBehindText;\n    const int HOUR_IN_SECONDS = 60*60;\n    const int DAY_IN_SECONDS = 24*60*60;\n    const int WEEK_IN_SECONDS = 7*24*60*60;\n    const int YEAR_IN_SECONDS = 31556952; // Average length of year in Gregorian calendar\n    if(secs < 60)\n    {\n        timeBehindText = QObject::tr(\"%n second(s)\",\"\",secs);\n    }\n    else if(secs < 2*HOUR_IN_SECONDS)\n    {\n        timeBehindText = QObject::tr(\"%n minute(s)\",\"\",secs/60);\n    }\n    else if(secs < 2*DAY_IN_SECONDS)\n    {\n        timeBehindText = QObject::tr(\"%n hour(s)\",\"\",secs/HOUR_IN_SECONDS);\n    }\n    else if(secs < 2*WEEK_IN_SECONDS)\n    {\n        timeBehindText = QObject::tr(\"%n day(s)\",\"\",secs/DAY_IN_SECONDS);\n    }\n    else if(secs < YEAR_IN_SECONDS)\n    {\n        timeBehindText = QObject::tr(\"%n week(s)\",\"\",secs/WEEK_IN_SECONDS);\n    }\n    else\n    {\n        qint64 years = secs / YEAR_IN_SECONDS;\n        qint64 remainder = secs % YEAR_IN_SECONDS;\n        timeBehindText = QObject::tr(\"%1 and %2\").arg(QObject::tr(\"%n year(s)\", \"\", years)).arg(QObject::tr(\"%n week(s)\",\"\", remainder/WEEK_IN_SECONDS));\n    }\n    return timeBehindText;\n}\n\nQString formatBytes(uint64_t bytes)\n{\n    if(bytes < 1024)\n        return QString(QObject::tr(\"%1 B\")).arg(bytes);\n    if(bytes < 1024 * 1024)\n        return QString(QObject::tr(\"%1 KB\")).arg(bytes / 1024);\n    if(bytes < 1024 * 1024 * 1024)\n        return QString(QObject::tr(\"%1 MB\")).arg(bytes / 1024 / 1024);\n\n    // FIXME.SUGAR\n    // Do not display in GB\n    // return QString(QObject::tr(\"%1 GB\")).arg(bytes / 1024 / 1024 / 1024);\n    return QString(QObject::tr(\"%1 MB\")).arg(bytes / 1024 / 1024);\n}\n\nqreal calculateIdealFontSize(int width, const QString& text, QFont font, qreal minPointSize, qreal font_size) {\n    while(font_size >= minPointSize) {\n        font.setPointSizeF(font_size);\n        QFontMetrics fm(font);\n        if (fm.width(text) < width) {\n            break;\n        }\n        font_size -= 0.5;\n    }\n    return font_size;\n}\n\nvoid ClickableLabel::mouseReleaseEvent(QMouseEvent *event)\n{\n    Q_EMIT clicked(event->pos());\n}\n    \nvoid ClickableProgressBar::mouseReleaseEvent(QMouseEvent *event)\n{\n    Q_EMIT clicked(event->pos());\n}\n\n} // namespace GUIUtil\n"
  },
  {
    "path": "src/qt/guiutil.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_GUIUTIL_H\n#define BITCOIN_QT_GUIUTIL_H\n\n#include <amount.h>\n#include <fs.h>\n\n#include <QEvent>\n#include <QHeaderView>\n#include <QMessageBox>\n#include <QObject>\n#include <QProgressBar>\n#include <QString>\n#include <QTableView>\n#include <QLabel>\n\nclass QValidatedLineEdit;\nclass SendCoinsRecipient;\n\nQT_BEGIN_NAMESPACE\nclass QAbstractItemView;\nclass QDateTime;\nclass QFont;\nclass QLineEdit;\nclass QUrl;\nclass QWidget;\nQT_END_NAMESPACE\n\n/** Utility functions used by the Bitcoin Qt UI.\n */\nnamespace GUIUtil\n{\n    // Create human-readable string from date\n    QString dateTimeStr(const QDateTime &datetime);\n    QString dateTimeStr(qint64 nTime);\n\n    // Return a monospace font\n    QFont fixedPitchFont();\n\n    // Set up widgets for address and amounts\n    void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent);\n    void setupAmountWidget(QLineEdit *widget, QWidget *parent);\n\n    // Parse \"bitcoin:\" URI into recipient object, return true on successful parsing\n    bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out);\n    bool parseBitcoinURI(QString uri, SendCoinsRecipient *out);\n    QString formatBitcoinURI(const SendCoinsRecipient &info);\n\n    // Returns true if given address+amount meets \"dust\" definition\n    bool isDust(const QString& address, const CAmount& amount);\n\n    // HTML escaping for rich text controls\n    QString HtmlEscape(const QString& str, bool fMultiLine=false);\n    QString HtmlEscape(const std::string& str, bool fMultiLine=false);\n\n    /** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing\n        is selected.\n       @param[in] column  Data column to extract from the model\n       @param[in] role    Data role to extract from the model\n       @see  TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress\n     */\n    void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole);\n\n    /** Return a field of the currently selected entry as a QString. Does nothing if nothing\n        is selected.\n       @param[in] column  Data column to extract from the model\n       @see  TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress\n     */\n    QList<QModelIndex> getEntryData(QAbstractItemView *view, int column);\n\n    void setClipboard(const QString& str);\n\n    /** Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix\n        when no suffix is provided by the user.\n\n      @param[in] parent  Parent window (or 0)\n      @param[in] caption Window caption (or empty, for default)\n      @param[in] dir     Starting directory (or empty, to default to documents directory)\n      @param[in] filter  Filter specification such as \"Comma Separated Files (*.csv)\"\n      @param[out] selectedSuffixOut  Pointer to return the suffix (file type) that was selected (or 0).\n                  Can be useful when choosing the save file format based on suffix.\n     */\n    QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir,\n        const QString &filter,\n        QString *selectedSuffixOut);\n\n    /** Get open filename, convenience wrapper for QFileDialog::getOpenFileName.\n\n      @param[in] parent  Parent window (or 0)\n      @param[in] caption Window caption (or empty, for default)\n      @param[in] dir     Starting directory (or empty, to default to documents directory)\n      @param[in] filter  Filter specification such as \"Comma Separated Files (*.csv)\"\n      @param[out] selectedSuffixOut  Pointer to return the suffix (file type) that was selected (or 0).\n                  Can be useful when choosing the save file format based on suffix.\n     */\n    QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir,\n        const QString &filter,\n        QString *selectedSuffixOut);\n\n    /** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking.\n\n       @returns If called from the GUI thread, return a Qt::DirectConnection.\n                If called from another thread, return a Qt::BlockingQueuedConnection.\n    */\n    Qt::ConnectionType blockingGUIThreadConnection();\n\n    // Determine whether a widget is hidden behind other windows\n    bool isObscured(QWidget *w);\n\n    // Open debug.log\n    void openDebugLogfile();\n\n    // Open the config file\n    bool openBitcoinConf();\n\n    // Replace invalid default fonts with known good ones\n    void SubstituteFonts(const QString& language);\n\n    /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text\n      representation if needed. This assures that Qt can word-wrap long tooltip messages.\n      Tooltips longer than the provided size threshold (in characters) are wrapped.\n     */\n    class ToolTipToRichTextFilter : public QObject\n    {\n        Q_OBJECT\n\n    public:\n        explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0);\n\n    protected:\n        bool eventFilter(QObject *obj, QEvent *evt);\n\n    private:\n        int size_threshold;\n    };\n\n    /**\n     * Makes a QTableView last column feel as if it was being resized from its left border.\n     * Also makes sure the column widths are never larger than the table's viewport.\n     * In Qt, all columns are resizable from the right, but it's not intuitive resizing the last column from the right.\n     * Usually our second to last columns behave as if stretched, and when on strech mode, columns aren't resizable\n     * interactively or programmatically.\n     *\n     * This helper object takes care of this issue.\n     *\n     */\n    class TableViewLastColumnResizingFixer: public QObject\n    {\n        Q_OBJECT\n\n        public:\n            TableViewLastColumnResizingFixer(QTableView* table, int lastColMinimumWidth, int allColsMinimumWidth, QObject *parent);\n            void stretchColumnWidth(int column);\n\n        private:\n            QTableView* tableView;\n            int lastColumnMinimumWidth;\n            int allColumnsMinimumWidth;\n            int lastColumnIndex;\n            int columnCount;\n            int secondToLastColumnIndex;\n\n            void adjustTableColumnsWidth();\n            int getAvailableWidthForColumn(int column);\n            int getColumnsWidth();\n            void connectViewHeadersSignals();\n            void disconnectViewHeadersSignals();\n            void setViewHeaderResizeMode(int logicalIndex, QHeaderView::ResizeMode resizeMode);\n            void resizeColumn(int nColumnIndex, int width);\n\n        private Q_SLOTS:\n            void on_sectionResized(int logicalIndex, int oldSize, int newSize);\n            void on_geometriesChanged();\n    };\n\n    bool GetStartOnSystemStartup();\n    bool SetStartOnSystemStartup(bool fAutoStart);\n\n    /* Convert QString to OS specific boost path through UTF-8 */\n    fs::path qstringToBoostPath(const QString &path);\n\n    /* Convert OS specific boost path to QString through UTF-8 */\n    QString boostPathToQString(const fs::path &path);\n\n    /* Convert seconds into a QString with days, hours, mins, secs */\n    QString formatDurationStr(int secs);\n\n    /* Format CNodeStats.nServices bitmask into a user-readable string */\n    QString formatServicesStr(quint64 mask);\n\n    /* Format a CNodeCombinedStats.dPingTime into a user-readable string or display N/A, if 0*/\n    QString formatPingTime(double dPingTime);\n\n    /* Format a CNodeCombinedStats.nTimeOffset into a user-readable string. */\n    QString formatTimeOffset(int64_t nTimeOffset);\n\n    QString formatNiceTimeOffset(qint64 secs);\n\n    QString formatBytes(uint64_t bytes);\n\n    qreal calculateIdealFontSize(int width, const QString& text, QFont font, qreal minPointSize = 4, qreal startPointSize = 14);\n\n    class ClickableLabel : public QLabel\n    {\n        Q_OBJECT\n\n    Q_SIGNALS:\n        /** Emitted when the label is clicked. The relative mouse coordinates of the click are\n         * passed to the signal.\n         */\n        void clicked(const QPoint& point);\n    protected:\n        void mouseReleaseEvent(QMouseEvent *event);\n    };\n    \n    class ClickableProgressBar : public QProgressBar\n    {\n        Q_OBJECT\n        \n    Q_SIGNALS:\n        /** Emitted when the progressbar is clicked. The relative mouse coordinates of the click are\n         * passed to the signal.\n         */\n        void clicked(const QPoint& point);\n    protected:\n        void mouseReleaseEvent(QMouseEvent *event);\n    };\n\n#if defined(Q_OS_MAC) && QT_VERSION >= 0x050000\n    // workaround for Qt OSX Bug:\n    // https://bugreports.qt-project.org/browse/QTBUG-15631\n    // QProgressBar uses around 10% CPU even when app is in background\n    class ProgressBar : public ClickableProgressBar\n    {\n        bool event(QEvent *e) {\n            return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false;\n        }\n    };\n#else\n    typedef ClickableProgressBar ProgressBar;\n#endif\n\n} // namespace GUIUtil\n\n#endif // BITCOIN_QT_GUIUTIL_H\n"
  },
  {
    "path": "src/qt/intro.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <fs.h>\n#include <qt/intro.h>\n#include <qt/forms/ui_intro.h>\n\n#include <qt/guiutil.h>\n\n#include <util.h>\n\n#include <QFileDialog>\n#include <QSettings>\n#include <QMessageBox>\n\n#include <cmath>\n\nstatic const uint64_t GB_BYTES = 1000000000LL;\n/* Minimum free space (in GB) needed for data directory */\nstatic const uint64_t BLOCK_CHAIN_SIZE = 3; // in GB as an integer // TODO.SUGAR.UPDATE\n/* Minimum free space (in GB) needed for data directory when pruned; Does not include prune target */\nstatic const uint64_t CHAIN_STATE_SIZE = 1; // in GB as an integer // TODO.SUGAR.UPDATE\n/* Total required space (in GB) depending on user choice (prune, not prune) */\nstatic uint64_t requiredSpace;\n\n/* Check free space asynchronously to prevent hanging the UI thread.\n\n   Up to one request to check a path is in flight to this thread; when the check()\n   function runs, the current path is requested from the associated Intro object.\n   The reply is sent back through a signal.\n\n   This ensures that no queue of checking requests is built up while the user is\n   still entering the path, and that always the most recently entered path is checked as\n   soon as the thread becomes available.\n*/\nclass FreespaceChecker : public QObject\n{\n    Q_OBJECT\n\npublic:\n    explicit FreespaceChecker(Intro *intro);\n\n    enum Status {\n        ST_OK,\n        ST_ERROR\n    };\n\npublic Q_SLOTS:\n    void check();\n\nQ_SIGNALS:\n    void reply(int status, const QString &message, quint64 available);\n\nprivate:\n    Intro *intro;\n};\n\n#include <qt/intro.moc>\n\nFreespaceChecker::FreespaceChecker(Intro *_intro)\n{\n    this->intro = _intro;\n}\n\nvoid FreespaceChecker::check()\n{\n    QString dataDirStr = intro->getPathToCheck();\n    fs::path dataDir = GUIUtil::qstringToBoostPath(dataDirStr);\n    uint64_t freeBytesAvailable = 0;\n    int replyStatus = ST_OK;\n    QString replyMessage = tr(\"A new data directory will be created.\");\n\n    /* Find first parent that exists, so that fs::space does not fail */\n    fs::path parentDir = dataDir;\n    fs::path parentDirOld = fs::path();\n    while(parentDir.has_parent_path() && !fs::exists(parentDir))\n    {\n        parentDir = parentDir.parent_path();\n\n        /* Check if we make any progress, break if not to prevent an infinite loop here */\n        if (parentDirOld == parentDir)\n            break;\n\n        parentDirOld = parentDir;\n    }\n\n    try {\n        freeBytesAvailable = fs::space(parentDir).available;\n        if(fs::exists(dataDir))\n        {\n            if(fs::is_directory(dataDir))\n            {\n                QString separator = \"<code>\" + QDir::toNativeSeparators(\"/\") + tr(\"name\") + \"</code>\";\n                replyStatus = ST_OK;\n                replyMessage = tr(\"Directory already exists. Add %1 if you intend to create a new directory here.\").arg(separator);\n            } else {\n                replyStatus = ST_ERROR;\n                replyMessage = tr(\"Path already exists, and is not a directory.\");\n            }\n        }\n    } catch (const fs::filesystem_error&)\n    {\n        /* Parent directory does not exist or is not accessible */\n        replyStatus = ST_ERROR;\n        replyMessage = tr(\"Cannot create data directory here.\");\n    }\n    Q_EMIT reply(replyStatus, replyMessage, freeBytesAvailable);\n}\n\n\nIntro::Intro(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::Intro),\n    thread(0),\n    signalled(false)\n{\n    ui->setupUi(this);\n    ui->welcomeLabel->setText(ui->welcomeLabel->text().arg(tr(PACKAGE_NAME)));\n    ui->storageLabel->setText(ui->storageLabel->text().arg(tr(PACKAGE_NAME)));\n\n    ui->lblExplanation1->setText(ui->lblExplanation1->text()\n        .arg(tr(PACKAGE_NAME))\n        .arg(BLOCK_CHAIN_SIZE)\n        .arg(2019)\n        .arg(tr(\"Sugarchain\"))\n    );\n    ui->lblExplanation2->setText(ui->lblExplanation2->text().arg(tr(PACKAGE_NAME)));\n\n    uint64_t pruneTarget = std::max<int64_t>(0, gArgs.GetArg(\"-prune\", 0));\n    requiredSpace = BLOCK_CHAIN_SIZE;\n    QString storageRequiresMsg = tr(\"At least %1 GB of data will be stored in this directory, and it will grow over time.\");\n    if (pruneTarget) {\n        uint64_t prunedGBs = std::ceil(pruneTarget * 1024 * 1024.0 / GB_BYTES);\n        if (prunedGBs <= requiredSpace) {\n            requiredSpace = prunedGBs;\n            storageRequiresMsg = tr(\"Approximately %1 GB of data will be stored in this directory.\");\n        }\n        ui->lblExplanation3->setVisible(true);\n    } else {\n        ui->lblExplanation3->setVisible(false);\n    }\n    requiredSpace += CHAIN_STATE_SIZE;\n    ui->sizeWarningLabel->setText(\n        tr(\"%1 will download and store a copy of the Sugarchain block chain.\").arg(tr(PACKAGE_NAME)) + \" \" +\n        storageRequiresMsg.arg(requiredSpace) + \" \" +\n        tr(\"The wallet will also be stored in this directory.\")\n    );\n    startThread();\n}\n\nIntro::~Intro()\n{\n    delete ui;\n    /* Ensure thread is finished before it is deleted */\n    Q_EMIT stopThread();\n    thread->wait();\n}\n\nQString Intro::getDataDirectory()\n{\n    return ui->dataDirectory->text();\n}\n\nvoid Intro::setDataDirectory(const QString &dataDir)\n{\n    ui->dataDirectory->setText(dataDir);\n    if(dataDir == getDefaultDataDirectory())\n    {\n        ui->dataDirDefault->setChecked(true);\n        ui->dataDirectory->setEnabled(false);\n        ui->ellipsisButton->setEnabled(false);\n    } else {\n        ui->dataDirCustom->setChecked(true);\n        ui->dataDirectory->setEnabled(true);\n        ui->ellipsisButton->setEnabled(true);\n    }\n}\n\nQString Intro::getDefaultDataDirectory()\n{\n    return GUIUtil::boostPathToQString(GetDefaultDataDir());\n}\n\nbool Intro::pickDataDirectory()\n{\n    QSettings settings;\n    /* If data directory provided on command line, no need to look at settings\n       or show a picking dialog */\n    if(!gArgs.GetArg(\"-datadir\", \"\").empty())\n        return true;\n    /* 1) Default data directory for operating system */\n    QString dataDir = getDefaultDataDirectory();\n    /* 2) Allow QSettings to override default dir */\n    dataDir = settings.value(\"strDataDir\", dataDir).toString();\n\n    if(!fs::exists(GUIUtil::qstringToBoostPath(dataDir)) || gArgs.GetBoolArg(\"-choosedatadir\", DEFAULT_CHOOSE_DATADIR) || settings.value(\"fReset\", false).toBool() || gArgs.GetBoolArg(\"-resetguisettings\", false))\n    {\n        /* If current default data directory does not exist, let the user choose one */\n        Intro intro;\n        intro.setDataDirectory(dataDir);\n        intro.setWindowIcon(QIcon(\":icons/bitcoin\"));\n\n        while(true)\n        {\n            if(!intro.exec())\n            {\n                /* Cancel clicked */\n                return false;\n            }\n            dataDir = intro.getDataDirectory();\n            try {\n                if (TryCreateDirectories(GUIUtil::qstringToBoostPath(dataDir))) {\n                    // If a new data directory has been created, make wallets subdirectory too\n                    TryCreateDirectories(GUIUtil::qstringToBoostPath(dataDir) / \"wallets\");\n                }\n                break;\n            } catch (const fs::filesystem_error&) {\n                QMessageBox::critical(0, tr(PACKAGE_NAME),\n                    tr(\"Error: Specified data directory \\\"%1\\\" cannot be created.\").arg(dataDir));\n                /* fall through, back to choosing screen */\n            }\n        }\n\n        settings.setValue(\"strDataDir\", dataDir);\n        settings.setValue(\"fReset\", false);\n    }\n    /* Only override -datadir if different from the default, to make it possible to\n     * override -datadir in the bitcoin.conf file in the default data directory\n     * (to be consistent with bitcoind behavior)\n     */\n    if(dataDir != getDefaultDataDirectory())\n        gArgs.SoftSetArg(\"-datadir\", GUIUtil::qstringToBoostPath(dataDir).string()); // use OS locale for path setting\n    return true;\n}\n\nvoid Intro::setStatus(int status, const QString &message, quint64 bytesAvailable)\n{\n    switch(status)\n    {\n    case FreespaceChecker::ST_OK:\n        ui->errorMessage->setText(message);\n        ui->errorMessage->setStyleSheet(\"\");\n        break;\n    case FreespaceChecker::ST_ERROR:\n        ui->errorMessage->setText(tr(\"Error\") + \": \" + message);\n        ui->errorMessage->setStyleSheet(\"QLabel { color: #800000 }\");\n        break;\n    }\n    /* Indicate number of bytes available */\n    if(status == FreespaceChecker::ST_ERROR)\n    {\n        ui->freeSpace->setText(\"\");\n    } else {\n        QString freeString = tr(\"%n GB of free space available\", \"\", bytesAvailable/GB_BYTES);\n        if(bytesAvailable < requiredSpace * GB_BYTES)\n        {\n            freeString += \" \" + tr(\"(of %n GB needed)\", \"\", requiredSpace);\n            ui->freeSpace->setStyleSheet(\"QLabel { color: #800000 }\");\n        } else {\n            ui->freeSpace->setStyleSheet(\"\");\n        }\n        ui->freeSpace->setText(freeString + \".\");\n    }\n    /* Don't allow confirm in ERROR state */\n    ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(status != FreespaceChecker::ST_ERROR);\n}\n\nvoid Intro::on_dataDirectory_textChanged(const QString &dataDirStr)\n{\n    /* Disable OK button until check result comes in */\n    ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);\n    checkPath(dataDirStr);\n}\n\nvoid Intro::on_ellipsisButton_clicked()\n{\n    QString dir = QDir::toNativeSeparators(QFileDialog::getExistingDirectory(0, \"Choose data directory\", ui->dataDirectory->text()));\n    if(!dir.isEmpty())\n        ui->dataDirectory->setText(dir);\n}\n\nvoid Intro::on_dataDirDefault_clicked()\n{\n    setDataDirectory(getDefaultDataDirectory());\n}\n\nvoid Intro::on_dataDirCustom_clicked()\n{\n    ui->dataDirectory->setEnabled(true);\n    ui->ellipsisButton->setEnabled(true);\n}\n\nvoid Intro::startThread()\n{\n    thread = new QThread(this);\n    FreespaceChecker *executor = new FreespaceChecker(this);\n    executor->moveToThread(thread);\n\n    connect(executor, SIGNAL(reply(int,QString,quint64)), this, SLOT(setStatus(int,QString,quint64)));\n    connect(this, SIGNAL(requestCheck()), executor, SLOT(check()));\n    /*  make sure executor object is deleted in its own thread */\n    connect(this, SIGNAL(stopThread()), executor, SLOT(deleteLater()));\n    connect(this, SIGNAL(stopThread()), thread, SLOT(quit()));\n\n    thread->start();\n}\n\nvoid Intro::checkPath(const QString &dataDir)\n{\n    mutex.lock();\n    pathToCheck = dataDir;\n    if(!signalled)\n    {\n        signalled = true;\n        Q_EMIT requestCheck();\n    }\n    mutex.unlock();\n}\n\nQString Intro::getPathToCheck()\n{\n    QString retval;\n    mutex.lock();\n    retval = pathToCheck;\n    signalled = false; /* new request can be queued now */\n    mutex.unlock();\n    return retval;\n}\n"
  },
  {
    "path": "src/qt/intro.h",
    "content": "// Copyright (c) 2011-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_INTRO_H\n#define BITCOIN_QT_INTRO_H\n\n#include <QDialog>\n#include <QMutex>\n#include <QThread>\n\nstatic const bool DEFAULT_CHOOSE_DATADIR = false;\n\nclass FreespaceChecker;\n\nnamespace Ui {\n    class Intro;\n}\n\n/** Introduction screen (pre-GUI startup).\n  Allows the user to choose a data directory,\n  in which the wallet and block chain will be stored.\n */\nclass Intro : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit Intro(QWidget *parent = 0);\n    ~Intro();\n\n    QString getDataDirectory();\n    void setDataDirectory(const QString &dataDir);\n\n    /**\n     * Determine data directory. Let the user choose if the current one doesn't exist.\n     *\n     * @returns true if a data directory was selected, false if the user cancelled the selection\n     * dialog.\n     *\n     * @note do NOT call global GetDataDir() before calling this function, this\n     * will cause the wrong path to be cached.\n     */\n    static bool pickDataDirectory();\n\n    /**\n     * Determine default data directory for operating system.\n     */\n    static QString getDefaultDataDirectory();\n\nQ_SIGNALS:\n    void requestCheck();\n    void stopThread();\n\npublic Q_SLOTS:\n    void setStatus(int status, const QString &message, quint64 bytesAvailable);\n\nprivate Q_SLOTS:\n    void on_dataDirectory_textChanged(const QString &arg1);\n    void on_ellipsisButton_clicked();\n    void on_dataDirDefault_clicked();\n    void on_dataDirCustom_clicked();\n\nprivate:\n    Ui::Intro *ui;\n    QThread *thread;\n    QMutex mutex;\n    bool signalled;\n    QString pathToCheck;\n\n    void startThread();\n    void checkPath(const QString &dataDir);\n    QString getPathToCheck();\n\n    friend class FreespaceChecker;\n};\n\n#endif // BITCOIN_QT_INTRO_H\n"
  },
  {
    "path": "src/qt/locale/bitcoin_af.ts",
    "content": "<TS language=\"af\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Regsklik om adres of etiket te verander</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Skep ’n nuwe adres</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuwe</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Dupliseer die geselekteerde adres na die sisteem se geheuebord</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Dupliseer</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>S&amp;luit</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Verwyder die adres wat u gekies het van die lys</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Voer die inligting op hierdie bladsy uit na 'n leer</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Voer uit</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Vee uit</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Kies die adres waarheen u munte wil stuur</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Kies die adres wat die munte moet ontvang</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>K&amp;ies</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Stuurders adresse</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Ontvanger adresse</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Hierdie is die adresse vanwaar u Bitcoin betalings stuur. U moet altyd die bedrag en die adres van die ontvanger nagaan voordat u enige munte stuur.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Hierdie is die adresse waar u Bitcoins sal ontvang. Ons beveel aan dat u 'n nuwe adres kies vir elke transaksie</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Dupliseer Adres</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopieer &amp;Etiket</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Verander</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Voer adreslys uit</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Uitvoer was onsuksesvol</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Die adreslys kon nie in %1  gestoor word nie.  Probeer asseblief weer.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Merk</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen etiket)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Wagwoord Dialoog</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Tik u wagwoord in</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nuwe wagwoord</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Herhaal nuwe wagwoord</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Wys wagwoord</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Tik die nuwe wagwoord vir u beursie.&lt;br/&gt;Gerbuik asseblief 'n wagwoord met &lt;b&gt;tien of meer lukrake karakters&lt;/b&gt;, of &lt;b&gt;agt of meer woorde&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Kodifiseer beursie</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>U het u beursie se wagwoord nodig om toegang tot u beursie te verkry.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Sluit beursie oop</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>U het u beursie se wagwoord nodig om u beursie se kode te ontsyfer.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Ontsleutel beursie</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Verander wagwoord</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Tik die ou en die nuwe wagwoorde vir die beursie.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Bevestig dat die beursie gekodifiseer is</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Waarskuwing: Indien u die beursie kodifiseer en u vergeet u wagwoord &lt;b&gt;VERLOOR U AL U BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Is u seker dat u die beursie wil kodifiseer?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Beursie gekodifiseer</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>BELANGRIK:  Alle vorige kopieë en rugsteun-weergawes wat u tevore van die gemaak het, moet vervang word met die jongste weergawe van u nuutste gekodifiseerde beursie.  Alle vorige weergawes en rugsteun-kopieë van u beursie sal nutteloos raak die oomblik wat u die nuut-gekodifiseerde beursie begin gebruik.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Kodifikasie was onsuksesvol</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Weens 'n interne fout het kodifikasie het nie geslaag nie.  U beursie is nie gekodifiseer nie</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Die wagwoorde stem nie ooreen nie.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Die beursie is nie oopgesluit nie</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>U het die verkeerde wagwoord ingetik.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Beursie-dekripsie het misluk</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Beursie wagwoordfrase is suksesvol verander.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>WAARSKUWING:  Outomatiese Kapitalisering is aktief op u sleutelbord!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmasker</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Verban tot</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Teken &amp;boodskap...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Netwerk-sinkronisasie...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Oorsig</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Vertoon 'n algemene oorsig van die beursie</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaksies</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Blaai deur transaksiegeskiedenis</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Sluit</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Stop en verlaat die applikasie</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Oor %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Wys inligting oor %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Oor &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Wys inligting oor Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opsies</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Verander konfigurasie-opsies vir %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Kodifiseer Beursie</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Rugsteun-kopie van Beursie</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Verander Wagwoord</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Versending adresse...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Ontvanger adresse</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Oop &amp; URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Kliek om netwerkaktiwiteit af te skakel.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Netwerkaktiwiteit gedeaktiveer.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Kliek om netwerkaktiwiteit weer aan te skakel.</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Besig met herindeksering van blokke op hardeskyf...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Stuur munte na 'n Bitcoin adres</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Maak 'n rugsteun-kopié van beursie na 'n ander stoorplek</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Verander die wagwoord wat ek vir kodifikasie van my beursie gebruik</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Ontfout venster</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Maak ontfouting en diagnostiese konsole oop</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifieer boodskap...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Beursie</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Stuur</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Ontvang</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Wys / Versteek</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Wys of versteek die hoofbladsy</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Kodifiseer die private sleutes wat aan jou beursie gekoppel is.</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Onderteken boodskappe met u Bitcoin adresse om u eienaarskap te bewys</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifieër boodskappe om seker te maak dat dit met die gespesifiseerde Bitcoin adresse</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Leër</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Verstellings</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Help</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Orebalk</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Versoek betalings (genereer QR-kodes en bitcoin: URI's)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Vertoon die lys van gebruikte versendingsadresse en etikette</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Vertoon die lys van gebruikte ontvangers-adresse en etikette</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Skep 'n bitcoin: URI of betalingsversoek</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Opdrag lyn opsies</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Blokke op skyf word geïndekseer...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Blokke op skyf word geprosesseer...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 agter</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Laaste ontvange blok is %1 gelede gegenereer.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transaksies hierna sal nog nie sigbaar wees nie.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Waarskuwing</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Inligting</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Op datum</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 kliënt</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Koppel aan eweknieë...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Word op datum gebring...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Bedrag: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipe: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etiket: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adres: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Gestuurde transaksie</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Inkomende transaksie</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>'N fatale fout het voorgekom. Bitcoin kan nie meer veilig voortgaan nie en sal nou toemaak.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Munt Seleksie</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Hoeveelheid:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Grepe:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Bedrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Fooi:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Stof:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Na Fooi:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Verander:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(de)selekteer alle</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Boom wyse</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Lysmodus</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Ontvang met etiket</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Ontvang met adres</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Bevestigings</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bevestig</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopieer adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer etiket</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopieer transaksie ID</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Sluit ongespandeer</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Ontsluit ongespandeer</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopieer hoeveelheid</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopieer fooi</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopieer na fooi</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopieer grepe</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopieer stof</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopieer verandering</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 gesluit)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ja</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nee</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Hierdie etiket raak rooi as enige ontvanger 'n bedrag kleiner as die huidige stof drempel ontvang.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Kan verskil met +/- %1 satoshi(s) per invoer.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen etiket)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>verander van %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(verander)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Wysig Adres</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiket</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Die etiket wat verband hou met hierdie adres lys inskrywing</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Die adres wat verband hou met hierdie adres lys inskrywing. Dit kan net verander word vir stuur adresse.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adres</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nuwe ontvang adres</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nuwe stuur adres</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Wysig ontvang adres</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Wysig stuur adres</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Die ingevoerde adres \"%1\" is nie 'n geldige Bitcoin adres nie.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Die ingevoerde adres \"%1\" is reeds in die adres boek.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Kon beursie nie oopsluit nie.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Nuwe sleutel generasie het misluk.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>'N Nuwe data gids sal geskep word.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>naam</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Gids bestaan reeds. Voeg %1 by indien u van plan is om 'n nuwe gids hier te skep.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Pad bestaan reeds, en is nie 'n gids nie.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Kan hier nie data gids skep nie.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>weergawe</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-stukkie)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Ongeveer %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opdrag lyn opsies</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Gebruik:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opdrag lyn opsies</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Gebruikerkoppelvlakopsies:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Kies data gids by aanvang (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Stel taal, byvoorbeeld \"de_DE\" (standaard: stelsel lokaal)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Begin geminimeer</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Stel SSL-wortelsertifikate vir betaling versoek (standaard: -stelsel-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Wys spatskerm tydens opstart (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Alle instellings wat in die grafiese gebruikerkoppelvlak gewysig is, terugstel</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Welkom</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Welkom by %1.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Gebruik die standaard data gids</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Gebruik 'n persoonlike data gids:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Die beursie sal ook in hierdie gids gestoor word.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Fout: Gespesifiseerde dataleêr \"%1\" kon nie geskep word nie.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Vorm</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Aantal blokke oor</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Onbekend...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Laaste blok tyd</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Vordering</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Vorderingstoename per uur</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>besig met bereken...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Geskatte tyd oor totdat gesinkroniseer</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Versteek</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Onbekend. Besig Met Sinchroniseer Van Hoofde (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Open URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Open betaling versoek van URI of lêer</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Kies betaling versoek lêer</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Kies betaling versoek lêer om oop te maak</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opsies</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Hoof</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Begin %1 outomaties nadat jy aangemeld is by die stelsel.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Begin %1 op stelsel aanmelding</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Grootte van &amp;databasis kas</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MG</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Aantal skrip &amp;verifikasie drade</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktiewe opdrag lyn opsies wat die boonste opsies ignoreer:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Maak die %1 konfigurasie lêer oop van die werk gids.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Open Konfigurasie Lêer</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Alle kliëntopsies na verstek terugstel.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Herstel Opsies</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Netwerk</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>B&amp;eursie</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Kenner</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Bemagtig munt &amp;beheer funksies.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Spandeer onbevestigde kleingeld</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Poort:</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Word gebruik vir die bereik van eweknieë via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Venster</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimaliseer op toemaak</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Vertoon</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Gebruikers Koppelvlak &amp;taal:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Eenheid om bedrae te toon in:</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Of om munt beheer funksies te wys of nie.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Kanselleer</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>verstek</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>geen</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Bevestig terugstel van opsies</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Kliënt moet herbegin word om veranderinge te aktiveer.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Kliënt sal toegemaak word. Wil u voortgaan?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Konfigurasie opsies</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Die konfigurasie lêer kon nie oopgemaak word nie.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Hierdie verandering sal 'n herbegin van die kliënt vereis. </translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Die verskafde volmag adres is ongeldig.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Vorm</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Kyk-net:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Beskikbaar:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>U huidige bruikbare balans</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Hangend:</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Onvolwasse:</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Balanse</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Totaal:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>U huidige totale balans</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Besteebaar:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Onlangse transaksies</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Betalings versoek fout</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI hantering</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Betalings versoek verwerp</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Betalings versoek netwerk stem nie ooreen met die kliënt netwerk nie.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Betalings versoek verstryk.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Betalings versoek is nie geïnitialiseer nie.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Ongeldige betalings versoek.</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Terugbetaling van %1</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Kommunikerings fout met %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Betalings versoek kan nie ontleed word nie!</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Netwerk versoek fout</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Gebruikeragent</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>NodusId</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Gestuur</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Ontvang</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Voer in 'n Bitcoin adres (bv. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 u</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Geen</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>n.v.t.</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 en %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: %1</source>\n        <translation>Fout: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>n.v.t.</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Kliëntweergawe</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informasie</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Algemeen</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Netwerk</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Naam</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Aantal verbindings</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blokketting</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Huidige aantal blokke</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Ontvang</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Gestuur</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Verbanne porture</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Gewitlys</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Rigting</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Weergawe</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Gebruikeragent</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Laaste blok tyd</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>In:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Uit:</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;uur</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;dag</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;week</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;jaar</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Ontkoppel</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Verbied vir</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Toegelaat</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Netwerk aktiewiteit gedeaktiveer</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(nodus id: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nooit</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Inkomende</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Uitgaande</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nee</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Onbekend</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Bedrag</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiket:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Boodslap:</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Skoonmaak</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Versoek betaling</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Wys</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Verwyder</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer etiket</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopieer boodskap</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Kode</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopieer &amp;Address</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Versoek betaling van %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Betaling informasie</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Merk</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Boodskap</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Merk</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Boodskap</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen etiket)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(geen boodskap)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(geen bedrag versoek)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Versoekte</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Stuur Munte</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Munt Beheer Kenmerke</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Insette...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>outomaties gekies</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Onvoldoende fondse!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Hoeveelheid:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Grepe:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Bedrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Fooi:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Na Fooi:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Verander:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transaksiefooi:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Kies...</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilogreep</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Versteek</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Aanbeveel:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Aangepaste:</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Voeg by &amp;Ontvanger</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Stof:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Maak skoon &amp;Alles</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balans:</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>S&amp;tuur</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopieer hoeveelheid</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopieer fooi</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopieer na fooi</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopieer grepe</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopieer stof</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopieer verandering</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blokke)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 tot %2</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Betalings versoek verstryk.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen etiket)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>B&amp;edrag:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiket:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Boodskap:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Betaal Vir:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Teken Boodskap</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Handtekening</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Maak skoon &amp;Alles</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifieer Boodskap</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifieer &amp;Boodskap</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Boodskap geteken.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Boodskap geverifieer.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>eie adres</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>kyk-net</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiket</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Krediet</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>nie geaanvaar</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debiet</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Totale debiet</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Totale crediet</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transaksie fooi</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Net bedrag</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Boodskap</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Kommentaar</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Transaksie totale grootte</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transaksie</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipe</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Merk</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Gemyn</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>kyk-net</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen etiket)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Alles</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Gemyn</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Ander</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopieer adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer etiket</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopieer transaksie ID</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bevestig</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipe</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Merk</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Uitvoer was onsuksesvol</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>na</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Stuur Munte</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nuwe fooi:</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Voer uit</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Voer die inligting op hierdie bladsy uit na 'n leer</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opsies:</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Kern</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Konneksie opsies:</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Fout met laai %s</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Besig met invoer...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Beursie opsies:</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Inligting</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Node aflos opsies:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC bediener opsies:</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Teken van transaksie het misluk</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Dié is eksperimentele sagteware.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transaksie bedrag te klein</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transaksie te groot</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Besig met verifieer van beursie(s)...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Waarskuwing</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Moenie transaksies vir langer as &lt;n&gt; ure in die geheuepoel hou nie (verstek: %u)</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s is baie hoog gestel!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(standaard: %s)</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Luister vir JSON-RPC konneksies op &lt;port&gt; (verstek: %u of testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Luister vir konneksies op &lt;port&gt; (verstek: %u of testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Handhaaf hoogstens &lt;n&gt; verbindings na portuurs (verstek: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Maak dat die beursie transaksies uitsaai</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maksimum per-konneksie ontvang buffer, &lt;n&gt;*1000 grepe (verstek: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maksimum per-konneksie stuur buffer, &lt;n&gt;*1000 grepe (verstek: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Voeg ontfout-uitset met tydstempel by (verstek: %u)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Spesifiseer konfigurasie lêer (verstek: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Spesifiseer konneksie timeout in millisekondes (minimum: 1, verstek: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Spesifiseer pid lêer (verstek: %s)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Begin tans netwerkdrade...</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Dit is die minimum transaksie fooi wat u betaal op elke transaksie.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Dit is die transaksie fooi wat u sal betaal as u 'n transaksie stuur.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Drumpel vir die ontkoppel van misdadige portuurs (verstek: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Transaksies bedrae moet nie negatief wees nie</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Transaksie se mempool ketting is te lank</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Transaksie moet ten minste een ontvanger hê</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Onbekend netwerk gespesifiseer in -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Onvoldoende fondse</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Blokindeks word gelaai...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Beursie word gelaai...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Kan nie beursie afgradeer nie</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Word herskandeer...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Klaar gelaai</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_af_ZA.ts",
    "content": "<TS language=\"af_ZA\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Regs-klik om die adres of etiket te wysig</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Skep 'n nuwe adres</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuwe</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Maak 'n kopie van die huidige adres na die stelsel klipbord</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopie</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>S&amp;luit</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Verwyder die uitgekiesde adres van die lys</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Voer inligting uit van die huidige blad na n lêer</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Uitvoer</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Verwyder</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Kies die address na wie die muntstukke gestuur moet word</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Kies die adres vir die ontvangs van betaaling</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>K&amp;ies</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Stuur adresse</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Ontvang adresse</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Dit is jou Bitcoin-adresse vir die stuur van betalings. Kontroleer altyd die bedrag en die ontvangsadres voordat u munte stuur.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Dit is jou Bitcoin-adresse vir die stuur van betalings. Kontroleer altyd die bedrag en die ontvangsadres voordat jy munte stuur.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopie Adres</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopie &amp;Etiket</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Wysig</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Voer adres lys uit</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Koma geskeide lêer (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Uitvoering Misluk</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Kon nie die adreslys stoor na %1 nie. Probeer asseblief weer.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen etiket)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Wagfrase Dialoog</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Tik wagfrase in</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nuwe wagfrase</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Herhaal nuwe wagfrase</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Wys wagwoord</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Tik die nuwe wagwoord vir die beursie in.&lt;br/&gt;Gebruik asseblief 'n wagwoord van &lt;b&gt;ten minste 10 ewekansige karakters&lt;/b&gt;, of &lt;b&gt;agt (8) of meer woorde.&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Enkripteer beursie</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Hierdie operasie benodig 'n wagwoord om die beursie oop te sluit.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Ontsluit beursie</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Hierdie operasie benodig 'n wagwoord om die beursie oop te sluit.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dekripteer beursie</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Verander wagfrase</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Tik in die ou wagfrase en die nuwe wagfrase vir die beursie.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Bevestig beursie enkripsie.</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Waarskuwing: As jy jou beursie enkripteer en jou wagwoord verloor, sal jy &lt;b&gt;AL JOU BITCOINS VERLOOR&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Is jy seker jy wil jou beursie enkripteer?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Beursie Enkripteer</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 gaan nou toe maak om die enkripsie proses klaar te maak. Onthou dat jou bitcoins nie ten volle beskerm kan word deur die beursie te enkrip teen \"malware\" wat jou rekenaar besmet.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Die beursie kon nie bewaak word nie</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Beursie bewaaking het misluk as gevolg van 'n interne fout. Die beursie is nie bewaak nie!</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Die wagfrase stem nie ooreen nie</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Beursie oopsluiting het misluk</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Die wagfrase wat ingetik was om die beursie oop te sluit, was verkeerd.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Beursie dekripsie het misluk</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Die beursie se wagfrase verandering was suksesvol.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Waarskuwing: Die Caps Lock is aan!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>Banned Until</source>\n        <translation>Verban Tot</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Teken &amp;Boodskap</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sinchroniseer met die netwerk ...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Oorsig</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Wys algemene oorsig van die beursie</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaksies</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Besoek transaksie geskiedenis</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>S&amp;luit af</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Sluit af</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Wys inligting oor %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Oor &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Wys inligting oor Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opsies</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Verander konfigurasie opsies vir %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Enkripteer Beursie...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Verander wagwoord frase...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Uitstuur adresse...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Maak &amp;URI oop...</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Netwerk aktiwiteid afgeskakel.</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifieer boodskap...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Beursie</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Stuur</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Ontvang</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Lêer</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Instellings</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Hulp</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Blad nutsbalk</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Opdrag lys opsies</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 agter</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Ontvangs van laaste blok is %1 terug.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Waarskuwing</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informasie</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Op datum</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 klient</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Besig om op te vang...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Bedrag: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipe: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adres: %1\n</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Inkomende transaksie</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD sleutel generasie is &lt;b&gt;aangesit&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD sleutel generasie is &lt;b&gt;afgesit&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Beursie is &lt;b&gt;versleutel&lt;/b&gt; en is tans &lt;b&gt;oopgesluit&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Beursie is &lt;b&gt;versleutel&lt;/b&gt; en is tans &lt;b&gt;gesluit&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Munt Keuse</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Hoeveelheid:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Grepe:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Bedrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Fooi:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Stof:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Verander:</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Boom wyse</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Lys wyse</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Ontvang met etiket</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Ontvang met adres</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Bevestigings</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bevestig</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Maak kopie van adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer etiket</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopieer transaksie ID</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Sluit ongespandeerde</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Onsluit ongespandeerde</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopieer hoeveelheid</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopieer fooi</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopieer na fooi</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopieer grepe</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopieer stof</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopieer verandering</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 gesluit)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ja</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nee</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen etiket)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>Verander vanaf %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(verander)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Wysig Adres</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiket</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adres</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nuwe ontvangende adres</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nuwe stuurende adres</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Wysig ontvangende adres</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Wysig stuurende adres</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Kon nie die beursie oopsluit nie.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Nuwe sleutel genereering het misluk.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>n Nuwe data  lêer sal geskep word.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>naam</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Lêer bestaan reeds. Voeg %1 indien u van plan is om n nuwe lêer hier te skep.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Kan nie data gids hier skep nie.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>weergawe</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-stukkie)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Oor %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opdrag lys opsies</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Gebruik:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opdrag lys opsies</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Gebruikerskoppelvlak Opsies:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Kies data gids op aanvang (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Begin verminderd</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Welkom</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Welkom by %1.</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Die beursie sal ook gestoor word in hierdie lêer.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Vorm</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Vorderering</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Steek weg</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opsies</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Netwerk</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Beursie</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Venster</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>V&amp;erminder op toemaak</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Vertoon</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Kanselleer</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>standaard</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>niks</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Konfigurasie opsies</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Vorm</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Beskikbaar:</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Balans</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Totaal:</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Geen</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>onbekend</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Informasie</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Bedrag:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Boodskap:</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer etiket</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Boodskap</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Boodskap</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen etiket)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Stuur Munstukke</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Onvoldoende fondse</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Hoeveelheid:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Grepe:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Bedrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Fooi:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Verander:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transaksie fooi:</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Steek weg</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Stuur aan vele ontvangers op eens</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Stof:</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balans:</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>S&amp;tuur</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopieer hoeveelheid</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopieer fooi</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopieer na fooi</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopieer grepe</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopieer stof</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopieer verandering</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 tot %2</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>of</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen etiket)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Bedrag:</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Boodskap:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Teken boodskap</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Handtekening</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Teken &amp;Boodskap</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Van</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>onbekend</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Na</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>eie adres</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiket</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Krediet</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>nie aanvaar nie</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debiet</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transaksie fooi</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Netto bedrag</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Boodskap</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transaksie ID</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transaksie</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>waar</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>onwaar</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipe</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Ontvang met</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Ontvang van</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Gestuur na</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Betalings Aan/na jouself</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Gemyn</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n.v.t)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen etiket)</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Datum en tyd wat die transaksie ontvang was.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipe transaksie.</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Alles</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Vandag</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Hierdie week</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Hierdie maand</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Verlede maand</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Hierdie jaar</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Reeks...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Ontvang met</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Gestuur na</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Aan/na jouself</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Gemyn</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Ander</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Min bedrag</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Maak kopie van adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer etiket</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopieer transaksie ID</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Koma geskeide lêer (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bevestig</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipe</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Uitvoering Misluk</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Reeks:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>aan</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Stuur Munstukke</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Uitvoer</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Voer inligting uit van die huidige blad na n lêer</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opsies:</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Fout: Hardeskyf spasie is baie laag!</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Invoer proses tans besig..</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informasie</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Waarskuwing</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Onvoldoende fondse</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Laai blok indeks...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Laai beursie...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Klaar gelaai</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_am.ts",
    "content": "<TS language=\"am\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>አድራሻ ወይም መለያ ስም ለመቀየር ቀኙን ጠቅ ያድርጉ</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>አዲስ አድራሻ ፍጠር</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;አዲስ</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>አሁን የተመረጠውን አድራሻ ወደ ሲስተሙ ቅንጥብ ሰሌዳ ቅዳ</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;ቅዳ</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>ዝጋ</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>አሁን የተመረጠውን አድራሻ ከዝርዝሩ ውስጥ ሰርዝ</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>በአሁኑ ማውጫ ውስጥ ያለውን መረጃ ወደ አንድ ፋይል ላክ</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;ላክ</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;ሰርዝ</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>ገንዘብ/ኮይኖች የሚልኩለትን አድራሻ ይምረጡ</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>ገንዘብ/ኮይኖች የሚቀበሉበትን አድራሻ ይምረጡ</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>ምረጥ</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>የመላኪያ አድራሻዎች</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>የመቀበያ አድራሻዎች</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>እነኚ የቢትኮይን ክፍያ የመላኪያ አድራሻዎችዎ ናቸው:: ገንዘብ/ኮይኖች ከመላክዎ በፊት መጠኑን እና የመቀበያ አድራሻውን ሁልጊዜ ያረጋግጡ::</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>እነኚ የቢትኮይን ክፍያ የመቀበያ አድራሻዎችዎ ናቸው:: ለእያንዳንዱ ግብይት አዲስ የመቀበያ አድራሻ እንዲጠቀሙ ይመከራል:: </translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;አድራሻ ቅዳ</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>ቅዳ &amp;መለያ ስም</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation> &amp;ቀይር</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>የአድራሻ ዝርዝር ላክ</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>ኮማ ሴፓሬትድ ፋይል (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>ወደ ውጪ መላክ አልተሳካም</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>የአድራሻ ዝርዝሩን ወደ %1 ለማስቀመጥ ሲሞከር ስህተት አጋጥሟል:: እባክዎ መልሰው ይሞክሩ::</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>መለያ ስም</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>አድራሻ</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(መለያ ስም የለም)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>የይለፍ-ሐረግ ንግግር</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>የይለፍ-ሐረግዎን ያስገቡ</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>አዲስ የይለፍ-ሐረግ</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>አዲስ የይለፍ-ሐረጉን ይድገሙት</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>አዲስ የይለፍ ሐረግዎን ወደ ቢትኮይን ቦርሳዎ ያስገቡ:: &lt;br/&gt;እባክዎ ለየይለፍ ሐረግዎ&lt;b&gt;አስር ወይም ከዚያ በላይ የዘፈቀደ ዓይነተ-ፊደላት&lt;/b&gt;, ወይም&lt;b&gt;ስምንት ወይም ከዚያ በላይ ቃላት&lt;/b&gt; ይጠቀሙ ::</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>የቢትኮይን ቦርሳውን አመስጥር</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>ይህ ክንዋኔ የቢትኮይን ቦርሳዎን ለመክፈት የቦርሳዎ ይለፍ-ሐረግ ያስፈልገዋል::</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>የቢትኮይን ቦርሳውን ክፈት</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>ይህ ክንዋኔ የቢትኮይን ቦርሳዎን ለመፍታት የቦርሳዎ ይለፍ-ሐረግ ያስፈልገዋል::</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>የቢትኮይን ቦርሳውን ፍታ</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>ይለፍ-ሐረግ ለውጥ</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>የድሮውን የይለፍ-ሐረግ እና አዲሱን የይለፍ-ሐረግ ወደ ቢትኮይን ቦርሳዎ ያስገቡ::</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>የቢትኮይን ቦርሳዎን ማመስጠር ያረጋግጡ</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>ማስጠንቀቂያ: የቢትኮይን ቦርሳዎን አመስጥረው የይለፍ-ሐረግዎን ካጡት&lt;b&gt;ቢትኮይኖቾን በሙሉ ያጣሉ&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>እርግጠኛ ነዎት ቦርሳዎን ማመስጠር ይፈልጋሉ?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>ቦርሳዎ ምስጢር ተደርጓል</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 የማመስጠር ሂደቱን ለመጨረስ አሁን ይዘጋል:: ያስታውሱ፣ ኮምፒተርዎ በተንኮል አዘል ሶፍትዌር ከተበከለ ቦርሳዎን ማመስጠር ቢትኮይኖቾን ሙሉበሙሉ እንዳይሰረቁ ሊከላከል አይችልም::</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>አስፈላጊ: ከ ቦርሳ ፋይልዎ ያከናወኗቸው ቀደም ያሉ ምትኬዎች በአዲስ በተፈጠረ የማመስጠሪያ ፋይል ውስጥ መተካት አለባቸው. ለደህንነት ሲባል, አዲሱን የተመሰጠ የቦርሳ ፋይል መጠቀም ሲጀመሩ ወዲያውኑ ቀደም ሲል ያልተመሰጠሩ የቦርሳ ፋይል ቅጂዎች ዋጋ ቢስ ይሆናሉ::</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>የቦርሳ ማመስጠር አልተሳካም</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>የቦርሳ ማመስጠር በውስጣዊ ስህተት ምክንያት አልተሳካም:: ቦርሳዎ አልተመሰጠረም::</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>የተሰጡት የይለፍ-ሐረግዎች አይዛመዱም::</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>ቦርሳ መክፈት አልተሳካም</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>ቦርሳ ለመፍታት ያስገቡት የይለፍ-ሐረግ ትክክል አልነበረም::</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>ቦርሳ መፍታት አልተሳካም </translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>የቦርሳ የይለፍ-ሐረግ በተሳካ ሁኔታ ተቀይሯል.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>ማስጠንቀቂያ: የ \"Caps Lock\" ቁልፍ በርቷል!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>አይፒ/ኔትማስክ  IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>ታግደዋል እስከ</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>ምልክትና መልእክት...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>ከኔትወርክ ጋራ በማመሳሰል ላይ ነው...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;አጠቃላይ እይታ</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>እትር</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>የቦርሳ አጠቃላይ እይታ ኣሳይ</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;ግብይቶች</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>የግብይት ታሪክ ያስሱ</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>ውጣ</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>አፕሊኬሽኑን አቁም</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;ስለ %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>ስለ %1 መረጃ አሳይ</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>ስለ &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>ስለ Qt መረጃ አሳይ</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;አማራጮች...</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(መለያ ስም የለም)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>አድራሻ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>መለያ ስም</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>መለያ ስም</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(መለያ ስም የለም)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(መለያ ስም የለም)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>መለያ ስም</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(መለያ ስም የለም)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>ኮማ ሴፓሬትድ ፋይል (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>መለያ ስም</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>አድራሻ</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>ወደ ውጪ መላክ አልተሳካም</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;ላክ</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>በአሁኑ ማውጫ ውስጥ ያለውን መረጃ ወደ አንድ ፋይል ላክ</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ar.ts",
    "content": "<TS language=\"ar\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>انقر بالزر الايمن لتعديل العنوان</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>انشاء عنوان جديد</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;جديد</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>قم بنسخ العنوان المختار لحافظة النظام</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;نسخ</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>ا&amp;غلاق</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>حذف العنوان المحدد من القائمة</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>تحميل البيانات في علامة التبويب الحالية إلى ملف.</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;تصدير</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;أمسح</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>اختر العنوان الذي سترسل له العملات</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>اختر العنوان الذي تستقبل عليه العملات</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;اختر</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>عناوين الإرسال</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>عناوين الاستقبال</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>هذه هي عناوين Bitcion التابعة لك من أجل إرسال الدفعات. تحقق دائما من المبلغ و عنوان المرسل المستقبل قبل إرسال العملات</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>هذه هي عناوين Bitcion التابعة لك من أجل إستقبال الدفعات. ينصح استخدام عنوان جديد من أجل كل صفقة</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>انسخ العنوان</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>نسخ &amp;الوصف</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>تعديل</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>تصدير قائمة العناوين</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>ملف مفصول بفواصل (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>فشل التصدير</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>لقد حدث خطأ أثناء  حفظ قائمة العناوين إلى %1. يرجى المحاولة مرة أخرى.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>وصف</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>عنوان</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(لا وصف)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>حوار جملة السر</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>ادخل كلمة المرور</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>كلمة مرور جديدة</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>اعد كتابة كلمة السر</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>إعرض كلمة السر</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>أدخل عبارة مرور جديدة إلى المحفظة. الرجاء استخدام عبارة مرور تتكون من10 حروف عشوائية على الاقل, أو ثمانية كلمات على الاقل.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>تشفير المحفظة</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>هذه العملية تحتاج كلمة مرور محفظتك لفتحها</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>إفتح المحفظة</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>هذه العملية تحتاج كلمة مرور محفظتك لفك تشفيرها </translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>فك تشفير المحفظة</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>تغيير كلمة المرور</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>أدخل كلمة المرور القديمة والجديدة للمحفظة.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>تأكيد تشفير المحفظة</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>تحذير: إذا قمت بتشفير محفظتك وفقدت كلمة المرور الخاص بك, ستفقد كل عملات BITCOINS الخاصة بك.</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>هل أنت متأكد من رغبتك في تشفير محفظتك ؟</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>محفظة مشفرة</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>سيتم إغلاق %1 الآن لإنهاء عملية التشفير. تذكر أن تشفير محفظتك لا يمكن أن يحمي البتكوين الخاص بك بالكامل من السرقة عبر البرامج الضارة التي بامكانها أن تصيب جهاز الكمبيوتر الخاص بك.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>هام: أي نسخة إحتياطية سابقة  قمت بها لمحفظتك يجب استبدالها  بأخرى حديثة، مشفرة. لأسباب أمنية، النسخ الاحتياطية السابقة لملفات المحفظة الغير مشفرة تصبح عديمة الفائدة مع بداية استخدام المحفظة المشفرة الجديدة.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>فشل تشفير المحفظة</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>فشل تشفير المحفظة بسبب خطأ داخلي. لم يتم تشفير محفظتك.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>كلمتي المرور ليستا متطابقتان</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>فشل فتح المحفظة</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>كلمة المرور التي تم إدخالها لفك تشفير المحفظة غير صحيحة.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>فشل   فك التشفير المحفظة</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>لقد تم تغير عبارة مرور المحفظة بنجاح</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>تحذير: مفتاح الحروف الكبيرة مفعل</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>عنوان البروتوكول/قناع</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>محظور حتى</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>التوقيع و الرسائل</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>مزامنة مع الشبكة ...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;نظرة عامة</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>جهاز</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>إظهار نظرة عامة على المحفظة</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;المعاملات</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>تصفح سجل المعاملات</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>خروج</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>الخروج من التطبيق</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>حوالي %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>أظهر المعلومات حولة %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>عن &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>اظهر المعلومات</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;خيارات ...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>تغيير خيارات الإعداد لأساس ل%1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;تشفير المحفظة</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;نسخ احتياط للمحفظة</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;تغيير كلمة المرور</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;عناوين الإرسال...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;عناوين الاستقبال...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>افتح &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>اضغط لإلغاء تفعيل الشبكه</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>تم إلغاء تفعيل الشبكه</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>اضغط لتفعيل الشبكه مره أخرى</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>مزامنة الرؤوس (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>إعادة فهرسة الكتل على القرص ...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>ارسل عملات الى عنوان بيتكوين</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>احفظ نسخة احتياطية للمحفظة في مكان آخر</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>تغيير كلمة المرور المستخدمة لتشفير المحفظة</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;نافذة المعالجة</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>إفتح وحدة التصحيح و التشخيص</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;التحقق من الرسالة...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>بتكوين</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>محفظة</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;ارسل</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;استقبل</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;عرض / اخفاء</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>عرض او اخفاء النافذة الرئيسية</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>تشفير المفتاح الخاص بمحفظتك</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>وقَع الرسائل بواسطة ال: Bitcoin الخاص بك لإثبات امتلاكك لهم</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>تحقق من الرسائل للتأكد من أنَها وُقعت برسائل Bitcoin محدَدة</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;ملف</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;الاعدادات</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;مساعدة</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>شريط أدوات علامات التبويب</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>أطلب دفعات (يولد كودات الرمز المربع وبيت كوين: العناوين المعطاة)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>عرض قائمة عناوين الإرسال المستخدمة والملصقات</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>عرض قائمة عناوين الإستقبال المستخدمة والملصقات</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>فتح URI : Bitcoin أو طلب دفع</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;خيارات سطر الأوامر</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n اتصال نشطة بشبكة بتكوين</numerusform><numerusform>%n اتصال نشطة بشبكة بتكوين</numerusform><numerusform>%n اتصال نشطة بشبكة بتكوين</numerusform><numerusform>%n اتصالات نشطة بشبكة بتكوين</numerusform><numerusform>%n اتصالات نشطة بشبكة بتكوين</numerusform><numerusform>%n اتصالات نشطة بشبكة بتكوين</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>ترتيب فهرسة الكتل على القرص...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>معالجة الكتل على القرص...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>تمت معالجة %n كتلة من محفوظات المعاملة.</numerusform><numerusform>تمت معالجة %n كتلة من محفوظات المعاملة.</numerusform><numerusform>تمت معالجة %n كتلة من محفوظات المعاملة.</numerusform><numerusform>تمت معالجة %n كتلات من محفوظات المعاملة.</numerusform><numerusform>تمت معالجة %n كتلات من محفوظات المعاملة.</numerusform><numerusform>تمت معالجة %n كتلات من محفوظات المعاملة.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>خلف %1</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>تم توليد الكتلة المستقبلة الأخيرة منذ %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>المعاملات بعد ذلك لن تكون مريئة بعد.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطأ</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>تحذير</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>معلومات</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>محدث</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>بين اشارة المساعدة %1 للحصول على قائمة من خيارات اوامر البت كوين المحتملة </translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>الزبون %1</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>اتصال إلي القرناء...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>اللحاق بالركب ...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>التاريخ %1\n\n\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>الكمية %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>نوع %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>علامه: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>عنوان %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>المعاملات  المرسلة</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>المعاملات الواردة</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>توليد المفاتيح الهرمية الحتمية HD &lt;b&gt;مفعل&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>توليد المفاتيح الهرمية الحتمية HD &lt;b&gt;معطل&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>المحفظة &lt;b&gt;مشفرة&lt;/b&gt; و &lt;b&gt;مفتوحة&lt;/b&gt; حاليا</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>المحفظة &lt;b&gt;مشفرة&lt;/b&gt; و &lt;b&gt;مقفلة&lt;/b&gt; حاليا</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>خطأ فادح حدث . لا يمكن اتمام بيتكوين بامان سيتم الخروج</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>اختيار العمله</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>الكمية :</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>بايت</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>القيمة :</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>رسوم :</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>غبار:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>بعد الرسوم :</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>تعديل :</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>عدم اختيار الجميع</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>صيغة الشجرة</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>صيغة القائمة</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>مبلغ</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>مستقبل مع ملصق</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>مستقبل مع عنوان</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>تاريخ</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>تأكيدات</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>تأكيد</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>  انسخ عنوان</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation> انسخ التسمية</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>نسخ الكمية</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>نسخ رقم العملية</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>قفل غير المنفق</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>فتح غير المنفق</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>نسخ الكمية </translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>نسخ الرسوم</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>نسخ بعد الرسوم</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>نسخ البايتات </translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>نسخ الغبار</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>نسخ التعديل</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>نعم</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>لا</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>يتحول هذا الملصق إلى اللون الأحمر إذا تلقى أي مستلم كمية أصغر من عتبة الغبار الحالية.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>يمكن أن يختلف +/- %1 من ساتوشي(s) لكل إدخال.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(لا وصف)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(تغير)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>عدل العنوان</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;وصف</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>الملصق المرتبط بقائمة العناوين المدخلة</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>العنوان المرتبط بقائمة العناوين المدخلة. و التي يمكن تعديلها فقط بواسطة ارسال العناوين</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;العنوان</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>عنوان أستلام جديد</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>عنوان إرسال جديد</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>تعديل عنوان الأستلام</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>تعديل عنوان الارسال</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>العنوان المدخل \"%1\" ليس عنوان بيت كوين صحيح.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>هدا العنوان \"%1\" موجود مسبقا في دفتر العناوين</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation> يمكن فتح المحفظة.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>فشل توليد مفتاح جديد.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>سيتم انشاء دليل بيانات جديد.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>الاسم</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>الدليل موجوج بالفعل. أضف %1 اذا نويت إنشاء دليل جديد هنا.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>المسار موجود بالفعل، وهو ليس دليلاً.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>لا يمكن انشاء دليل بيانات هنا .</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>النسخة</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-بت)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>حوالي %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>خيارات سطر الأوامر</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>المستخدم</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>خيارات سطر الأوامر</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>خيارات واجهة المستخدم</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>اختر دليل البيانات عند بدء التشغير (افتراضي: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>أضع لغة, على سبيل المثال \" de_DE \"  (افتراضي:- مكان النظام)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>البدء مصغراً</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>أضع شهادة بروتوكول الشبقة الأمنية لطلب المدفوع (افتراضي: -نظام-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>أظهر شاشة البداية عند بدء التشغيل (افتراضي: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>اعد تعديل جميع النظم المتغيرة في GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>أهلا</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation> اهلا بكم في %1</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>بما انه هذه اول مرة لانطلاق هذا البرنامج, فيمكنك ان تختار اين سيخزن %1 بياناته</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>عند النقر على \"موافق\" ، سيبدأ %1 في تنزيل ومعالجة سلسلة الكتل %4 الكاملة (%2 جيجابايت) بدءًا من المعاملات الأقدم في %3 عند تشغيل %4 في البداية.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>تُعد هذه المزامنة الأولية أمرًا شاقًا للغاية، وقد تعرض جهاز الكمبيوتر الخاص بك للمشاكل الذي لم يلاحظها أحد سابقًا. في كل مرة تقوم فيها بتشغيل %1، سيتابع التحميل من حيث تم التوقف.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>إذا كنت قد اخترت تقييد تخزين سلسلة الكتل (التجريد)، فيجب تحميل البيانات القديمة ومعالجتها، ولكن سيتم حذفها بعد ذلك للحفاظ على انخفاض استخدام القرص.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>استخدام دليل البانات الافتراضي</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>استخدام دليل بيانات مخصص:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>بتكوين</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>سيتم تخزين %1 جيجابايت على الأقل من البيانات في هذا الدليل، وستنمو مع الوقت.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>سيتم تخزين %1 جيجابايت تقريباً من البيانات في هذا الدليل.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>سيقوم %1 بتنزيل نسخة من سلسلة كتل بتكوين وتخزينها.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>سوف يتم تخزين المحفظة في هذا الدليل.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>خطأ: لا يمكن تكوين دليل بيانات مخصص ل %1</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطأ</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n جيجابايت من المساحة المتوفرة</numerusform><numerusform>%n جيجابايت من المساحة المتوفرة</numerusform><numerusform>%n جيجابايت من المساحة المتوفرة</numerusform><numerusform>%n جيجابايت من المساحة المتوفرة</numerusform><numerusform>%n جيجابايت من المساحة المتوفرة</numerusform><numerusform>%n جيجابايت من المساحة المتوفرة</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(من %n جيجابايت اللازمة)</numerusform><numerusform>(من %n جيجابايت اللازمة)</numerusform><numerusform>(من %n جيجابايت اللازمة)</numerusform><numerusform>(من %n جيجابايت اللازمة)</numerusform><numerusform>(من %n جيجابايت اللازمة)</numerusform><numerusform>(من %n جيجابايت اللازمة)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>نمودج</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>قد لا تكون المعاملات الأخيرة مرئية بعد، وبالتالي قد يكون رصيد محفظتك غير صحيح. ستكون هذه المعلومات صحيحة بمجرد الانتهاء من محفظتك مع شبكة البيتكوين، كما هو مفصل أدناه.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>لن تقبل الشبكة محاولة إنفاق البتكوين المتأثرة بالمعاملات التي لم يتم عرضها بعد.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>عدد الكتل الفاضلة</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>غير معرف</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>اخر وقت الكتلة</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>تقدم</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>تقدم يزيد بلساعة</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>تحسب الان...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>الوقت المتبقي للمزامنة</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>إخفاء</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>غير معروف. مزامنة الرؤوس (%1) ...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>افتح URL</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>حدد طلب الدفع من ملف او URI</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>العنوان:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>حدد ملف طلب الدفع</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>حدد ملف طلب الدفع لفتحه</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>خيارات ...</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;الرئيسي</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>ابدأ تلقائيًا %1 بعد تسجيل الدخول إلى النظام.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>تشغيل %1 عند الدخول إلى النظام</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>حجم ذاكرة التخزين المؤقت لقاعدة البيانات</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>م ب</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>عدد مؤشرات التحقق من البرنامج النصي</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>إظهار ما إذا كان وكيل SOCKS5 الافتراضي الموفر تم استخدامه للوصول إلى النظراء عبر نوع الشبكة هذا.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>استخدام وكيل SOCKS5 منفصل للوصول إلى الأقران عبر خدمات Tor المخفية:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>إخفاء الآيقونة من صينية النظام.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>اخفاء آيقونة الصينية</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>التصغير بدلاً من الخروج من التطبيق عند إغلاق النافذة. عند تفعيل هذا الخيار، سيتم إغلاق التطبيق فقط بعد اختيار الخروج من القائمة.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>خيارات سطر الأوامر النشطة التي تتجاوز الخيارات أعلاه:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>فتح ملف الإعدادات %1 من الدليل العامل.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>فتح ملف الإعدادات</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>إعادة تعيين كل إعدادات العميل للحالة الإفتراضية.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;استعادة الخيارات</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;الشبكة</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;محفظة</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>تصدير</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>تفعيل ميزات التحكم في العملة</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>دفع الفكة غير المؤكدة</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>ربط المنفذ باستخدام UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>قبول الاتصالات من الخارج.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>السماح بالاتصالات الواردة.</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>الاتصال بشبكة البتكوين عبر وكيل SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>الاتصال من خلال وكيل SOCKS5 (الوكيل الافتراضي):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>بروكسي &amp;اي بي:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;المنفذ:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>منفذ البروكسي (مثلا 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>مستخدم للاتصال بالاصدقاء من خلال:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>تور</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>قم بالاتصال بشبكة بتكوين عبر وكيل SOCKS5 منفصل لخدمات تور المخفية.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>نافذه</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>إظهار آيقونة الصينية فقط بعد تصغير النافذة.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>التصغير إلى صينية النظام بدلاً من شريط المهام</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>تصغير عند الإغلاق</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;عرض</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>واجهة المستخدم &amp;اللغة:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>الوحدة لإظهار المبالغ فيها:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>اختر وحدة التقسيم الفرعية الافتراضية للعرض في الواجهة وعند إرسال العملات.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>ما اذا أردت إظهار ميزات التحكم في العملة أم لا.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>العناوين (URL) لجهات خارجية</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>تم</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>الغاء</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>الافتراضي</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>لا شيء</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>تأكيد استعادة الخيارات</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>يتطلب إعادة تشغيل العميل لتفعيل التغييرات.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>سوف يتم إيقاف العميل تماماً. هل تريد الإستمرار؟</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>إعداد الخيارات</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطأ</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>لم تتمكن من فتح ملف الإعدادات.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>هذا التغيير يتطلب إعادة تشغيل العميل بشكل كامل.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>عنوان الوكيل توفيره غير صالح.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>نمودج</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>قد تكون المعلومات المعروضة قديمة. تتزامن محفظتك تلقائيًا مع شبكة البتكوين بعد إنشاء الاتصال، ولكن هذه العملية لم تكتمل بعد.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>مشاهدة فقط:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>متوفر</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>رصيدك القابل للصرف</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>معلق:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>إجمالي المعاملات التي لم يتم تأكيدها بعد ولا تحتسب ضمن الرصيد القابل للانفاق</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>غير ناضجة</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>الرصيد المعدّن الذي لم ينضج بعد</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>الأرصدة</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>المجموع:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>رصيدك الكلي الحالي</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>رصيدك الحالي في العناوين المشاهدة فقط</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>قابل للصرف:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>أحدث المعاملات</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>معاملات غير مؤكدة للعناوين المشاهدة فقط</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>الرصيد المعدّن في العناوين المشاهدة فقط التي لم تنضج بعد</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>الرصيد الإجمالي الحالي في العناوين المشاهدة فقط</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>خطأ في طلب الدفع</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>لا يمكن تشغيل بتكوين: معالج النقر للدفع</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>التعامل مع العنوان</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>عنوان الدفع غير صالح %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>لا يمكن تحليل العنوان (URI)! يمكن أن يحدث هذا بسبب عنوان بتكوين غير صالح أو معلمات عنوان (URI) غير صحيحة.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>التعامل مع ملف طلب الدفع</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>لا يمكن قراءة ملف طلب الدفع! يمكن أن يحدث هذا بسبب ملف لطلب الدفع غير صالح.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>تم رفض طلب الدفع</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>لا تتطابق شبكة طلب الدفع مع شبكة العميل.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>انتهاء صلاحية طلب الدفع.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>لم يتم تهيئة طلب الدفع.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>طلبات الدفع غير المؤكدة إلى نصوص الدفع المخصصة غير مدعومة.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>طلب دفع غير صالح.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>المبلغ المطلوب للدفع %1 صغير جداً (يعتبر غبار).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>إعادة مال من %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>طلب الدفع %1 كبير جداً (%2 بايت، المسموح به %3 بايت).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>حدث خطأ في الاتصال بـ %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>لا يمكن تحليل طلب الدفع!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>استجابة سيئة من الملقم %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>خطأ في طلب الشبكة</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>اعتراف بالدفع</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>وكيل المستخدم</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>عقدة/خدمة</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>رقم العقدة</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>رنين</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>تم الإرسال</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>إستقبل</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>مبلغ</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>ادخل عنوان محفطة البتكوين (مثال %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 يوم</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 ساعة</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 دقيقة</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 ثانية</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>لا شيء</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>غير معروف</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 جزء من الثانية</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n ثانية</numerusform><numerusform>%n ثانية</numerusform><numerusform>%n ثانية</numerusform><numerusform>%n ثواني</numerusform><numerusform>%n ثانية</numerusform><numerusform>%n ثانية</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n دقيقة</numerusform><numerusform>%n دقيقة</numerusform><numerusform>%n دقيقة</numerusform><numerusform>%n دقائق</numerusform><numerusform>%n دقيقة</numerusform><numerusform>%n دقيقة</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n ساعة</numerusform><numerusform>%n ساعة</numerusform><numerusform>%n ساعة</numerusform><numerusform>%n ساعة</numerusform><numerusform>%n ساعات</numerusform><numerusform>%n ساعة</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n يوم</numerusform><numerusform>%n يوم</numerusform><numerusform>%n يوم</numerusform><numerusform>%n أيام</numerusform><numerusform>%n يوم</numerusform><numerusform>%n يوم</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n أسبوع</numerusform><numerusform>%n أسبوع</numerusform><numerusform>%n أسبوع</numerusform><numerusform>%n أسابيع</numerusform><numerusform>%n أسابيع</numerusform><numerusform>%n أسابيع</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 و %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n يوم</numerusform><numerusform>%n يوم</numerusform><numerusform>%n يوم</numerusform><numerusform>%n أيام</numerusform><numerusform>%n أيام</numerusform><numerusform>%n أيام</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 بايت</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 كيلو بايت</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 ميقا بايت</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 قيقا بايت</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 لم يخرج بعد بأمان...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>غير معروف</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>خطأ: دليل البيانات المحدد \"%1\" غير موجود.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>خطأ: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;حفظ الصورة</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;نسخ الصورة</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>حفظ رمز الاستجابة السريعة QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>صورة PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>غير معروف</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>نسخه العميل</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>المعلومات</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>نافذة المعالجة</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>عام</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>باستخدام BerkeleyDB إصدار</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>دليل البيانات</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>وقت البدء</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>الشبكه</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>الاسم</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>عدد الاتصالات</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>سلسلة الكتل</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>عدد الكتل الحالي</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>تجمع الذاكرة</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>عدد المعاملات الحالي</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>استخدام الذاكرة</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>إعادة تعيين</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>إستقبل</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>تم الإرسال</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;اصدقاء</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>الأقران الممنوعين</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>حدد نظير لعرض معلومات مفصلة.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>اللائحة البيضاء</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>جهة</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>الإصدار</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>كتلة البداية</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>رؤوس متزامنة</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>كتل متزامنة</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>وكيل المستخدم</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>تصغير حجم الخط</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>تكبير حجم الخط</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>خدمات</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>نقاط الحظر</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>مدة الاتصال</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>آخر استقبال</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>آخر إرسال</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>وقت الرنين</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>مدة الرنين المعلقة حالياً.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>انتظار الرنين</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>أقل رنين</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>إزاحة الوقت</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>اخر وقت الكتلة</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>الفتح</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>وحدة التحكم</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;حركة مرور الشبكة</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>المجاميع</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>داخل:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>خارج:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>تصحيح ملف السجل</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>مسح وحدة التحكم</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;ساعة</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp; يوم</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp; اسبوع</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp; سنة</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>قطع الاتصال</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>حظر ل</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>رفع الحظر</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>مرحبًا بك في وحدة التحكم %1 RPC.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>استخدم السهمين لأعلى ولأسفل لتصفح السجل، و%1 لمسح الشاشة.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>اكتب %1 للحصول على نظرة عامة على الأوامر المتوفرة.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>لمزيد من المعلومات حول استخدام نوع وحدة التحكم هذه اكتب %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>تحذير: المخادعون نشطون، ويطلبون من المستخدمين كتابة الأوامر هنا، من أجل سرقة محتويات محفظتهم. لا تستخدم وحدة التحكم هذه بدون فهم تبعات الأمر بشكل كامل.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>تم تعطيل نشاط الشبكة</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(معرف العقدة: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>خلال %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>ابدا</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>داخل</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>خارجي</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>نعم</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>لا</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>غير معرف</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;القيمة</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;وصف :</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;رسالة:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>رسالة اختيارية لإرفاقها بطلب الدفع، والتي سيتم عرضها عند فتح الطلب. ملاحظة: لن يتم إرسال الرسالة مع الدفعة عبر شبكة البتكوين.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>تسمية اختيارية لربطها بعنوان المستلم الجديد.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>استخدم هذا النموذج لطلب الدفعات. جميع الحقول &lt;b&gt;اختيارية&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>مبلغ اختياري للطلب. اترك هذا فارغًا أو صفراً لعدم طلب مبلغ محدد.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>مسح كل حقول النموذج المطلوبة</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>مسح</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>سجل طلبات الدفع</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;طلب دفعة</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>إظهار الطلب المحدد (يقوم بنفس نتيجة النقر المزدوج على أي إدخال)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>عرض</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>قم بإزالة الإدخالات المحددة من القائمة</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>ازل</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>نسخ العنوان</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation> انسخ التسمية</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>انسخ الرسالة</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>نسخ الكمية</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>رمز كيو ار</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>نسخ  &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>نسخ &amp;العنوان</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;حفظ الصورة</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>طلب الدفعة إلى %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>معلومات الدفع</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation> URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>عنوان</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>مبلغ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>وصف</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>رسالة </translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>العنوان المستخدم طويل جدًا، حاول أن تقوم بتقليل نص التسمية / الرسالة.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>خطأ في ترميز العنوان إلى الرمز المربع.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>تاريخ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>وصف</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>رسالة </translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(لا وصف)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>( لا رسائل )</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(لا يوجد مبلغ مطلوب)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>تم الطلب</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>إرسال Coins</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>ميزات التحكم بالعملة</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>المدخلات...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>اختيار تلقائيا</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>الرصيد غير كافي!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>الكمية :</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>بايت</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>القيمة :</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>رسوم :</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>بعد الرسوم :</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>تعديل :</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>إذا تم تنشيط هذا، ولكن عنوان الفكة فارغ أو غير صالح، فسيتم إرسال الفكة إلى عنوان تم إنشاؤه حديثًا.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>تغيير عنوان الفكة</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>رسوم المعاملة:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>إختر …</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>تحذير: تقدير الرسوم غير ممكن في الوقت الحالي.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>خفض اعدادات الرسوم</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>لكل كيلوبايت</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>إخفاء</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>إن دفع الحد الأدنى فقط من الرسوم يجوز طالما أن حجم المعاملات أقل من المساحة الموجودة في الكتل. ولكن كن على علم بأن هذا يمكن أن ينتهي في معاملة غير مؤكدة أبداً عندما يكون هناك طلب أكبر على معاملات البتكوين مما تستطيع الشبكة معالجته.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(اقرأ تلميح الأدوات)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>موصى به:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>تخصيص:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(الرسوم الذكية لم يتم تهيئتها بعد. عادة ما يستغرق ذلك بضع كتل ...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>إرسال إلى عدة مستلمين في وقت واحد</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>أضافة &amp;مستلم</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>مسح كل حقول النموذج المطلوبة</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>غبار:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>هدف وقت التأكيد:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>تفعيل الإستبدال بواسطة الرسوم</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>مع الإستبدال بواسطة الرسوم (BIP-125) يمكنك زيادة رسوم المعاملة بعد إرسالها. وبدون ذلك، قد نوصي برسوم أعلى للتعويض عن مخاطر تأخير المعاملة المتزايدة.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>مسح الكل</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>الرصيد:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>تأكيد الإرسال</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;ارسال</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>نسخ الكمية </translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>نسخ الكمية</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>نسخ الرسوم</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>نسخ بعد الرسوم</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>نسخ البايتات </translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>نسخ الغبار</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>نسخ التعديل</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 كثلة)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 الى %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>هل أنت متأكد من أنك تريد أن ترسل؟</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>أضيفت كرسوم للمعاملة</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>إجمالي المبلغ %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>أو</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>يمكنك زيادة الرسوم لاحقًا (بإشارة الإستبدال بواسطة الرسوم، BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>لا يشير إلى الإستبدال بواسطة الرسوم، BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>تأكيد الإرسال Coins</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>عنوان المستلم غير صالح. يرجى إعادة الفحص.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>المبلغ المدفوع يجب ان يكون اكبر من 0</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>القيمة تتجاوز رصيدك</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>المجموع يتجاوز رصيدك عندما يتم اضافة %1 رسوم العملية</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>تم العثور على عنوان مكرر: يجب استخدام العناوين مرة واحدة فقط.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>فشل في إنشاء المعاملة!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>تم رفض المعاملة للسبب التالي: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>تعتبر الرسوم الأعلى من %1 رسوماً باهظة.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>انتهاء صلاحية طلب الدفع.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>دفع فقط الرسوم المطلوبة ل %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>يقدر أن يبدأ التأكيد ضمن %n من الكتل.</numerusform><numerusform>يقدر أن يبدأ التأكيد ضمن %n من الكتل.</numerusform><numerusform>يقدر أن يبدأ التأكيد ضمن %n من الكتل.</numerusform><numerusform>يقدر أن يبدأ التأكيد ضمن %n من الكتل.</numerusform><numerusform>يقدر أن يبدأ التأكيد ضمن %n من الكتل.</numerusform><numerusform>يقدر أن يبدأ التأكيد ضمن %n من الكتل.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>تحذير: عنوان بتكوين غير صالح</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>تحذير: عنوان الفكة غير معروف</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>تأكيد تغيير العنوان الفكة</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(لا وصف)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;القيمة</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>ادفع &amp;الى :</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;وصف :</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>اختر عنوانا مستخدم سابقا</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>هذا دفع اعتيادي</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>عنوان البت كوين المرسل اليه الدفع</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>انسخ العنوان من لوحة المفاتيح</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>ازل هذه المداخله</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>سيتم خصم الرسوم من المبلغ الذي يتم إرساله. لذا سوف يتلقى المستلم مبلغ أقل من البتكوين المدخل في حقل المبلغ. في حالة تحديد عدة مستلمين، يتم تقسيم الرسوم بالتساوي.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>طرح الرسوم من المبلغ</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>استخدام الرصيد المتاح</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>الرسائل</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>هذا طلب دفع لم يتم مصادقته.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>هذا طلب دفع تمت مصادقته.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>أدخل تسمية لهذا العنوان لإضافته إلى قائمة العناوين المستخدمة</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>الرسالة التي تم إرفاقها مع البتكوين: العنوان الذي سيتم تخزينه مع المعاملة للرجوع إليه. ملاحظة: لن يتم إرسال هذه الرسالة عبر شبكة البتكوين.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>ادفع &amp;الى :</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>مذكرة:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>إدخال تسمية لهذا العنوان لإضافته إلى دفتر العناوين الخاص بك</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>نعم</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>اتمام إيقاف %1...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>لا توقف عمل الكمبيوتر حتى تختفي هذه النافذة</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>التواقيع - التوقيع / التحقق من الرسالة</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;توقيع الرسالة</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>عنوان البتكوين لتوقيع الرسالة به</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>اختر عنوانا مستخدم سابقا</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>انسخ العنوان من لوحة المفاتيح</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>ادخل الرسالة التي تريد توقيعها هنا</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>التوقيع</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>نسخ التوقيع الحالي إلى حافظة النظام</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>وقع الرسالة لتثبت انك تمتلك عنوان البت كوين هذا</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>توقيع $الرسالة</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>إعادة تعيين كافة حقول رسالة التوقيع</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>مسح الكل</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;تحقق رسالة</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>عنوان البتكوين الذي تم توقيع الرسالة به</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>تحقق من الرسالة للتأكد من توقيعها مع عنوان البتكوين المحدد</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>تحقق &amp;الرسالة</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>إعادة تعيين جميع حقول التحقق من الرسالة</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>اضغط  \"توقيع الرسالة\" لتوليد التوقيع</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>العنوان المدخل غير صالح</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>الرجاء التأكد من العنوان والمحاولة مرة اخرى</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>العنوان المدخل لا يشير الى مفتاح</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>تم الغاء عملية فتح المحفظة</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>المفتاح الخاص للعنوان المدخل غير موجود.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>فشل توقيع الرسالة.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>الرسالة موقعة.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>لا يمكن فك تشفير التوقيع.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>فضلا تاكد من التوقيع وحاول مرة اخرى</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>لم يتطابق التوقيع مع ملخص الرسالة.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>فشلت عملية التأكد من الرسالة.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>تم تأكيد الرسالة.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>كيلوبايت/ث</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>مفتوح ل %n كتلة إضافية</numerusform><numerusform>مفتوح ل %n كتلة إضافية</numerusform><numerusform>مفتوح ل %n كتلة إضافية</numerusform><numerusform>مفتوح ل %n كتلات إضافية</numerusform><numerusform>مفتوح ل %n كتلة إضافية</numerusform><numerusform>مفتوح ل %n كتلة إضافية</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>مفتوح حتى %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>تعارضت مع معاملة لديها %1 تأكيدات</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1 غير متواجد</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>في تجمع الذاكرة</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>ليس في تجمع الذاكرة</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>مهجور</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>غير مؤكدة/%1</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>تأكيد %1</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>الحالة.</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>,  لم يتم حتى الآن البث بنجاح</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>تاريخ</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>المصدر</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>تم اصداره.</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>من</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>غير معروف</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>الى</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>عنوانه</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>مشاهدة فقط</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>علامة</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>رصيد</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>تنضج خلال %n كتل إضافية</numerusform><numerusform>تنضج خلال %n كتل إضافية</numerusform><numerusform>تنضج خلال %n كتل إضافية</numerusform><numerusform>تنضج خلال %n كتل إضافية</numerusform><numerusform>تنضج خلال %n كتل إضافية</numerusform><numerusform>تنضج خلال %n كتل إضافية</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>غير مقبولة</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>دين</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>إجمالي الخصم</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>إجمالي الرصيد</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>رسوم المعاملة</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>صافي المبلغ</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>رسالة </translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>تعليق</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>رقم المعاملة</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>الحجم الكلي للمعاملات</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>مؤشر المخرجات</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>تاجر</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>معلومات التصحيح</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>معاملة</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>المدخلات</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>مبلغ</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>صحيح</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>خاطئ</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>يبين هذا الجزء وصفا مفصلا لهده المعاملة</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>تفاصيل عن %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>تاريخ</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>النوع</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>وصف</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>مفتوح لـ %n كتلة إضافية</numerusform><numerusform>مفتوح لـ %n كتلة إضافية</numerusform><numerusform>مفتوح لـ %n كتلة إضافية</numerusform><numerusform>مفتوح لـ %n كتلة إضافية</numerusform><numerusform>مفتوح لـ %n كتلة إضافية</numerusform><numerusform>مفتوح لـ %n كتلة إضافية</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>مفتوح حتى %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>غير متصل</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>غير مؤكد</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>مهجور</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>قيد التأكيد (%1 من %2 تأكيد موصى به)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>يتعارض</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>غير ناضجة (تأكيدات %1 ، ستكون متوفرة بعد %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>لم يتم تلقى هذه الكتلة (Block) من قبل أي العقد الأخرى وربما لن تكون مقبولة!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>ولدت ولكن لم تقبل</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>استقبل مع</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>استقبل من</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>أرسل إلى</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>دفع لنفسك</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Mined</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>مشاهدة فقط</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>غير متوفر</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(لا وصف)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>حالة التحويل. مرر فوق هذا الحقل لعرض عدد  التأكيدات.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>التاريخ والوقت الذي تم فيه تلقي المعاملة.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>نوع المعاملات</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>ما إذا كان العنوان المشاهدة فقط متضمنًا في هذه المعاملة أم لا.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>المبلغ الذي أزيل أو أضيف الى الرصيد</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>الكل</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>اليوم</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>هدا الاسبوع</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>هدا الشهر</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>الشهر الماضي</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>هدا العام</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>المدى...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>استقبل مع</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>أرسل إلى</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>إليك</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Mined</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>اخرى</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>أدخل العنوان أو معرف المعاملة أو التصنيف للبحث</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>الحد الأدنى</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>التخلي عن المعاملة</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>زيادة رسوم المعاملة</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>  انسخ عنوان</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation> انسخ التسمية</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>نسخ الكمية</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>نسخ رقم العملية</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>نسخ المعاملة الخام</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>نسخ كامل تفاصيل المعاملة</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>عدل الوصف</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>عرض تفاصيل المعاملة</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>تصدير تفاصيل المعاملات</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>ملف مفصول بفواصل (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>تأكيد</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>مشاهدة فقط</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>تاريخ</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>النوع</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>وصف</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>عنوان</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>العنوان</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>فشل التصدير</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>حدث خطأ أثناء محاولة حفظ محفوظات المعاملة إلى %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>نجح التصدير</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>تم حفظ محفوظات المعاملة بنجاح إلى %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>المدى:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>الى</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>الوحدة لإظهار المبالغ فيها. انقر لتحديد وحدة أخرى.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>لا يوجد محفظة تم تحميلها.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>إرسال Coins</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>خطأ في زيادة الرسوم</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>فشل في زيادة رسوم المعاملة</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>هل تريد زيادة الرسوم؟</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>الأجر الحالي:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>زيادة:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>أجر جديد:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>تأكيد زيادة الرسوم</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>لا يمكن توقيع المعاملة.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>لا يمكن تنفيذ المعاملة</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;تصدير</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>تحميل البيانات في علامة التبويب الحالية إلى ملف.</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>نسخ احتياط للمحفظة</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>بيانات المحفظة (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>فشل النسخ الاحتياطي</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>نجاح  النسخ الاحتياطي</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>تم حفظ بيانات المحفظة بنجاح إلى %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>خيارات: </translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>حدد مجلد المعلومات</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>حدد العنوان العام لمحفظتك</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>قبول أوامر وحدة التحكم وأوامر JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>خطأ: حدث خطأ داخلي فادح، راجع debug.log للحصول على التفاصيل</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>تجريد مخزن الكتل...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>تشغيل في الخلفية بشكل مخفي لقبول الأوامر</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>غير قادر على بدء خادم ال HTTP. راجع سجل تصحيح الأخطاء للحصول على التفاصيل.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>جوهر بيتكوين</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>لا يمكن الحصول على قفل على دليل البيانات %s. من المحتمل أن %s يعمل بالفعل.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>لا يمكن توفير اتصالات محددة ولابد أن يكون لدى addrman اتصالات صادرة في نفس الوقت.</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>حذف جميع معاملات المحفظة واسترداد فقط تلك الأجزاء من سلسلة الكتل عبر -escan عند بدء التشغيل</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>يرجى المساهمة إذا وجدت %s مفيداً. تفضل بزيارة %s لمزيد من المعلومات حول البرنامج.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>الاستعلام عن عناوين النظراء من خلال البحث عبر ال DNS إذا كان عدد العناوين منخفضاً (القيمة الافتراضية: 1 ، إلّا في حالة استخدام -connect)</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; يمكن أن يكون</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>قبول الاتصالات من خارج</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>إلحاق تعليق إلى سلسلة وكيل المستخدم</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>محاولة استرداد المفاتيح الخاصة من المحفظة في حالة تلفها عند بدء التشغيل</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>خيارات إنشاء الكتل:</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>خيارات اختيار السلسلة:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>فهرس الفكة خارج النطاق</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>خيارات الاتصال:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>حقوق الطبع والنشر (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>تم الكشف عن قاعدة بيانات كتل تالفة</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>خيارات التصحيح / الاختبار:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>لا تقم بتحميل المحفظة وتعطيل استدعاءات RPC للمحفظة</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>هل تريد إعادة بناء قاعدة بيانات الكتل الآن؟</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>خطأ في إنشاء %s: لا يمكنك إنشاء محافظ بلا خاصية الهرمية الحتمية non-HD باستخدام هذا الإصدار.</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>خطأ في تحميل %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>خطأ في تحميل قاعدة بيانات الكتل</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>خطأ في فتح قاعدة بيانات الكتل</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>تحذير: مساحة القرص منخفضة</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>فشل في الاستماع على أي منفذ. استخدام الاستماع = 0 إذا كنت تريد هذا.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>استيراد...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>لم يتم العثور على كتلة تكوين أو لم تكون صحيحة. datadir خاطئة للشبكة؟</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>فشل بالتحقق في اختبار التعقل. تم إيقاف %s.</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>تحميل عناوين P2P...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>جاري تحميل قائمة الحظر...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>موقع ملف تعريف ارتباط المصادقة (القيمة الافتراضية: دليل البيانات)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>لا تتوفر واصفات ملفات كافية.</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>اطبع رسالة المساعدة هذه واخرج منها</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>طباعة النسخة ومن ثم الخروج</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>لا يمكن تهيئة التجريد بقيمة سالبة.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>وضع التجريد غير متوافق مع -txindex.</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>إعادة لعب الكتل...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>العودة بالكتل...</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>تحديد ملف المحفظة (داخل دليل البيانات)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>شفرة المصدر متاحة من %s.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>تم العثور على وسيطة غير مدعومة -tor ، استخدم -onion.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>ترقية قاعدة بيانات UTXO</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>إستخدم السلسلة التجريبية</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>التحقق من الكتل...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>خيارات تصحيح / اختبار المحفظة:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>يلزم إعادة كتابة المحفظة: إعادة تشغيل %s لإكمال العملية</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>خيارات المحفظة :</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>عشوائية وثائق الاعتماد لكل اتصال عبر وكيل. يتيح ذلك عزل تيار تور (القيمة الافتراضية: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>قيمة المعاملة صغيرة جدًا ولا يمكن إرسالها بعد خصم الرسوم</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>تحتاج إلى إعادة إنشاء قاعدة البيانات باستخدام -reindex للعودة إلى الوضعية الغير مجردة. هذا سوف يعيد تحميل سلسلة الكتل بأكملها</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(القيمة الافتراضية: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>قبول طلبات REST العامة (القيمة الافتراضية: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>إنشاء خدمة تور المخفية تلقائيًا (القيمة الافتراضية: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>الاتصال من خلال وكيل SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>خطأ أثناء تحميل %s: لا يمكنك تعطيل خاصية الهرمية الحتمية HD في محفظة مفعلة بخاصية الهرمية الحتمية HD مسبقاً</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>خطأ في القراءة من قاعدة البيانات ، والتوقف.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>خطأ في ترقية قاعدة بيانات chainstate</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>استيراد كتل من ملف blk000??.dat الخارجي عند بدء التشغيل</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>معلومات</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>خيارات ترحيل العقد:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>خيارات خادم RPC:</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>فشل توقيع المعاملة</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>قيمة المعاملة صغيرة جدا لدفع الأجر</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>هذا برنامج تجريبي.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>كلمة مرور منفذ تحكم تور (القيمة الافتراضية: فارغة)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>منفذ تحكم Tor لاستخدامه في حالة تفعيل الاستماع بالبصل (افتراضي: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>قيمة العملية صغيره جدا</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>قيمة المعاملة كبيرة جدا لسياسة الأجر</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>المعاملة كبيرة جدا</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>يتعذر الربط مع %s على هذا الكمبيوتر (الربط انتج خطأ %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>غير قادر على توليد مفاتيح أولية</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>ترقية المحفظة إلى التنسيق الأحدث عند بدء التشغيل</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>اسم المستخدم لاتصالات JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>التحقق من المحفظة (المحافظ)...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>تحذير</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>إزالة جميع المعاملات من المحفظة...</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>خطأ أثناء تحميل %s: لا يمكنك تفعيل خاصية الهرمية الحتمية HD في محفظة لا تملك خاصية الهرمية الحتمية non-HD مسبقاً</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>استخدام وكيل SOCKS5 منفصل للوصول إلى الأقران عبر خدمات تور المخفية (القيمة الافتراضية: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>تحذير: ملف المحفظة فاسد ، تم انقاذ البيانات! تم حفظ %s الأصلي ك %s في %s؛ إذا كان رصيدك أو كانت معاملاتك غير صحيحة، فيجب عليك الإستعادة من نسخة احتياطية.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s عالٍ جداً</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(القيمة الافتراضية: %s)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>إنتاج معاملات بث المحفظة</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>بدء مؤشرات شبكة الاتصال...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>سوف تتجنب المحفظة دفع أقل من الحد الأدنى لرسوم التتابع.</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>يجب ألا تكون قيمة المعاملة سلبية</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>يجب أن تحتوي المعاملة على مستلم واحد على الأقل</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>اموال غير كافية</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>تحميل مؤشر الكتلة</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>تحميل المحفظه</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>لا يمكن تخفيض قيمة المحفظة</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>إعادة مسح</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>انتهاء التحميل</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطأ</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_be_BY.ts",
    "content": "<TS language=\"be_BY\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Правы клік, каб рэдагаваць адрас ці метку</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Стварыць новы адрас</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>Новы</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Капіяваць пазначаны адрас у сістэмны буфер абмену</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>Капіяваць</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Зачыніць</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Выдаліць абраны адрас са спісу</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Экспартаваць гэтыя звесткі у файл</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Экспарт</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>Выдаліць</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Выбраць адрас, куды выслаць сродкі</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Выбраць адрас, на які атрымаць сродкі</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Выбраць</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>адрасы Адпраўкі</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>адрасы Прымання</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Тут знаходзяцца Біткойн-адрасы для высылання плацяжоў. Заўсёды спраўджвайце колькасць і адрас прызначэння перад здзяйсненнем транзакцыі.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Тут знаходзяцца Біткойн-адрасы для прымання плацяжоў. Пажадана выкарыстоўваць новы адрас для кожнай транзакцыі.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>Капіяваць адрас</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Капіяваць Метку</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>Рэдагаваць</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Экспартаваць Спіс Адрасоў</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Коскамі падзелены файл (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Экспартаванне няўдалае</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Адбылася памылка падчас спробы захаваць адрас у %1. Паспрабуйце зноў.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрас</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>непазначаны</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Дыялог сакрэтнай фразы</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Увядзіце кодавую фразу</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Новая кодавая фраза</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Паўтарыце новую кодавую фразу</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Увядзіце новы пароль для гаманца.&lt;br/&gt;Парольная фраза павинна складацца&lt;b&gt; не меньш чым з дзесяці сімвалаў&lt;/b&gt;, ці &lt;b&gt;больш чым з васьмі слоў&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Зашыфраваць гаманец.</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Гэтая аперацыя патрабуе кодавую фразу, каб рзблакаваць гаманец.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Разблакаваць гаманец</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Гэтая аперацыя патрабуе пароль каб расшыфраваць гаманец.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Рачшыфраваць гаманец</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Змяніць пароль</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Увядзіце стары пароль і новы пароль для гаманца.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Пацвердзіце шыфраванне гаманца</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Увага: калі вы зашыфруеце свой гаманец і страціце парольную фразу, то &lt;b&gt;СТРАЦІЦЕ ЎСЕ СВАЕ БІТКОЙНЫ&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Ці ўпэўненыя вы, што жадаеце зашыфраваць свой гаманец?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Гаманец зашыфраваны</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>ВАЖНА: Усе папярэднія копіі гаманца варта замяніць новым зашыфраваным файлам. У мэтах бяспекі папярэднія копіі незашыфраванага файла-гаманца стануць неўжывальнымі, калі вы станеце карыстацца новым зашыфраваным гаманцом.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Шыфраванне гаманца няўдалае</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Шыфраванне гаманца не адбылося з-за ўнутранай памылкі. Гаманец незашыфраваны.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Уведдзеныя паролі не супадаюць</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Разблакаванне гаманца няўдалае</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Уведзены пароль  для расшыфравання гаманца памылковы</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Расшыфраванне гаманца няўдалае</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Парольная фраза гаманца паспяхова зменена.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Увага: Caps Lock уключаны!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Падпісаць паведамленне...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Сінхранізацыя з сецівам...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>Агляд</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Вузел</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Паказвае агульныя звесткі аб гаманцы</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>Транзакцыі</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Праглядзець гісторыю транзакцый</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Выйсці</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Выйсці з праграмы</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Аб Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Паказаць інфармацыю аб Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>Опцыі...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Зашыфраваць Гаманец...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Стварыць копію гаманца...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Change Passphrase...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Адрасы дасылання...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Адрасы прымання...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Адчыниць &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Пераіндэксацыя блокаў на дыску...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Даслаць манеты на Біткойн-адрас</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Зрабіце копію гаманца ў іншае месца</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Змяніць пароль шыфравання гаманца</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Вакно адладкі</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Адкрыць кансоль дыягностыкі і адладкі</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Праверыць паведамленне...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Біткойн</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Гаманец</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>Даслаць</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>Атрымаць</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Паказаць / Схаваць</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Паказаць альбо схаваць галоўнае вакно</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Зашыфраваць прыватныя ключы, якия належаць вашаму гаманцу</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Падпісаць паведамленне з дапамогай Біткойн-адраса каб даказаць, што яно належыць вам</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Спраўдзіць паведамленне з дапамогай Біткойн-адраса каб даказаць, што яно належыць вам</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>Ф&amp;айл</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>Наладкі</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>Дапамога</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Запатрабаваць плацёж (генеруецца QR-код для біткойн URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Паказаць спіс адрасоў і метак для дасылання</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Паказаць спіс адрасоў і метак для прымання</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Адкрыць біткойн: URI ці запыт плацяжу</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Опцыі каманднага радка</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 таму</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Апошні прыняты блок генераваны %1 таму.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Транзакцыи пасля гэтай не будуць бачныя.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Памылка</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Увага</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Інфармацыя</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Сінхранізавана</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Наганяем...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Дата: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Колькасць: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Тып: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Метка: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Адрас: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Дасланыя транзакцыі</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Прынятыя транзакцыі</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Гаманец &lt;b&gt;зашыфраваны&lt;/b&gt; і зараз &lt;b&gt;разблакаваны&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Гаманец &lt;b&gt;зашыфраваны&lt;/b&gt; і зараз &lt;b&gt;заблакаваны&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Колькасць:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Байтаў:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Колькасць:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Камісія:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Пыл:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Пасля камісіі:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(не)выбраць ўсё</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Рэжым дрэва</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Рэжым спіса</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Колькасць</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Прыняць праз метку</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Прыняць праз адрас</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Пацверджанняў</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Пацверджана</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Капіяваць адрас</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Капіяваць пазнаку</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Капіяваць колькасць</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Капіяваць ID транзакцыі</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Замкнуць непатрачанае</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Адамкнуць непатрачанае</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Капіяваць колькасць</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Капіяваць камісію</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Капіяваць з выняткам камісіі</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Капіяваць байты</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Капіяваць пыл</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>так</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>не</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>непазначаны</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Рэдагаваць Адрас</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>Адрас</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Новы адрас для атрымання</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Новы адрас для дасылання</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Рэдагаваць адрас прымання</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Рэдагаваць адрас дасылання</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Уведзены адрас \"%1\" ужо ў кніге адрасоў</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Немагчыма разблакаваць гаманец</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Генерацыя новага ключа няўдалая</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Будзе створаны новы каталог з данымі.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>імя</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Каталог ужо існуе. Дадайце %1 калі вы збіраецеся стварыць тут новы каталог.</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-біт)</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Опцыі каманднага радка</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Ужыванне:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>опцыі каманднага радка</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Стартаваць ммінімізаванай</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Вітаем</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Біткойн</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Памылка</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Форма</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Адкрыць URI</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Опцыі</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>Мб</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Гаманец</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Памылка</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Форма</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Колькасць</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 і %2</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>невядома</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Інфармацыя</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Вакно адладкі</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Колькасць:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>Метка:</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Капіяваць пазнаку</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Капіяваць колькасць</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Капіяваць адрас</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрас</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Колькасць</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Паведамленне</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Паведамленне</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>непазначаны</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Даслаць Манеты</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Недастаткова сродкаў</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Колькасць:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Байтаў:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Колькасць:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Камісія:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Пасля камісіі:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Даслаць адразу некалькім атрымальнікам</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Пыл:</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Баланс:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Пацвердзіць дасыланне</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Капіяваць колькасць</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Капіяваць колькасць</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Капіяваць камісію</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Капіяваць з выняткам камісіі</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Капіяваць байты</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Капіяваць пыл</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Пацвердзіць дасыланне манет</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Велічыня плацяжу мае быць больш за 0.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>непазначаны</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Колькасць:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Заплаціць да:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>Метка:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Уставіць адрас з буферу абмена</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Паведамленне:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Заплаціць да:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Памятка:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Увядзіце пазнаку гэтаму адрасу, каб дадаць яго ў адрасную кнігу</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Уставіць адрас з буферу абмена</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>Кб/с</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/непацверджана</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 пацверджанняў</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Статус</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, пакуль не было паспяхова транслявана</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>невядома</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Паведамленне</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Каментар</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Колькасць</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Гэтая панэль паказвае дэтальнае апісанне транзакцыі</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Тып</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Пацверджана (%1 пацверджанняў)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Гэты блок не быў прыняты іншымі вузламі і магчыма не будзе ўхвалены!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Згенеравана, але не прынята</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Прынята з</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Прынята ад</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Даслана да</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Плацёж самому сабе</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Здабыта</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>непазначаны</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Статус транзакцыі. Навядзіце курсар на гэтае поле, каб паказаць колькасць пацверджанняў.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Дата і час, калі транзакцыя была прынята.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Тып транзакцыі</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Колькасць аднятая ці даданая да балансу.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Усё</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Сёння</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Гэты тыдзень</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Гэты месяц</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Мінулы месяц</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Гэты год</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Прамежак...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Прынята з</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Даслана да</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Да сябе</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Здабыта</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Іншыя</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Мін. колькасць</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Капіяваць адрас</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Капіяваць пазнаку</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Капіяваць колькасць</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Капіяваць ID транзакцыі</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Рэдагаваць пазнаку</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Коскамі падзелены файл (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Пацверджана</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Тып</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрас</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Экспартаванне няўдалае</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Прамежак:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>да</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Даслаць Манеты</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Экспарт</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Экспартаваць гэтыя звесткі у файл</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Опцыі:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Вызначыць каталог даных</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Прымаць камандны радок і JSON-RPC каманды</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Запусціць у фоне як дэман і прымаць каманды</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Ці жадаеце вы перабудаваць зараз базу звестак блокаў?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Памылка ініцыялізацыі базвы звестак блокаў</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Памалка ініцыялізацыі асяроддзя базы звестак гаманца %s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Памылка загрузкі базвы звестак блокаў</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Памылка адчынення базы звестак блокаў</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Памылка: Замала вольнага месца на дыску!</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Імпартаванне...</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Не хапае файлавых дэскрыптараў.</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Use UPnP to map the listening port (default: %u)</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Праверка блокаў...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Опцыі гаманца:</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Інфармацыя</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Опцыі RPC сервера:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Слаць trace/debug звесткі ў кансоль замест файла debug.log</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Памылка подпісу транзакцыі</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Гэта эксперыментальная праграма.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Транзакцыя занадта малая</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Транзакцыя занадта вялікая</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Імя карыстальника для JSON-RPC злучэнняў</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Увага</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Пароль для JSON-RPC злучэнняў</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Выканаць каманду калі лепшы блок зменіцца (%s замяняецца на хэш блока)</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Недастаткова сродкаў</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Загружаем індэкс блокаў...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Загружаем гаманец...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Немагчыма рэгрэсаваць гаманец</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Перасканаванне...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Загрузка выканана</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Памылка</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_bg.ts",
    "content": "<TS language=\"bg\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Десен клик за промяна на адреса или името</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Създаване на нов адрес</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>Нов</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Копиране на избрания адрес към клипборда</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>Копирай</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Затвори</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Изтрий избрания адрес от списъка</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Запишете данните от текущия раздел във файл</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Изнеси</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Изтриване</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Изберете адрес, на който ще изпращате монети</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Изберете адрес за получаване на монети</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Избери</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Адреси за изпращане</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Получаване на адреси</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Това са адресите на получателите на плащания. Винаги проверявайте размера на сумата и адреса на получателя, преди да изпратите монети.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Това са Вашите Биткойн адреси,благодарение на които ще получавате плащания.Препоръчително е да използвате нови адреси за получаване на всяка транзакция.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Копирай адрес</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Копирай &amp;име</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Редактирай</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Изнасяне на списъка с адреси</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>CSV файл (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Грешка при изнасянето</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Възникна грешка при опита за запазване на списъка с адреси в %1.Моля опитайте отново.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Име</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без име)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Диалог за паролите</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Въведете текущата парола</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Нова парола</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Въведете новата парола повторно</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Въведете новата парола към портфейла.&lt;br/&gt;Моля ползвайте парола съставена от &lt;b&gt;десет или повече произволни символа&lt;/b&gt;, или &lt;b&gt;осем или повече думи&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Шифриране на портфейла</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Тази операция изисква Вашата парола за отключване на портфейла.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Отключване на портфейла</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Тази операция изисква Вашата парола за дешифриране на портфейла.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Дешифриране на портфейла</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Смяна на паролата</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Въведете старата парола и новата прола към портфейла.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Потвърдете на шифрирането на портфейла</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>ВНИМАНИЕ: Ако шифрирате вашият портфейл и изгубите паролата си, &lt;b&gt;ЩЕ ИЗГУБИТЕ ВСИЧКИТЕ СИ БИТКОИНИ&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Наистина ли желаете да шифрирате портфейла си?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Портфейлът е шифриран</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>ВАЖНО: Всички стари запазвания, които сте направили на Вашият портфейл трябва да замените с запазване на новополучения, шифриран портфейл. От съображения за сигурност, предишните запазвания на нешифрирани портфейли ще станат неизползваеми веднага, щом започнете да използвате новият, шифриран портфейл.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Шифрирането беше неуспешно</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Шифрирането на портфейла беше неуспешно, поради софтуерен проблем. Портфейлът не е шифриран.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Паролите не съвпадат</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Неуспешно отключване на портфейла</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Паролата въведена за дешифриране на портфейла е грешна.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Дешифрирането на портфейла беше неуспешно</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Паролата на портфейла беше променена успешно.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Внимание: Caps Lock (главни букви) е включен.</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Със забранен достъп до</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Подписване на &amp;съобщение...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Синхронизиране с мрежата...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Баланс</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Сървър</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Обобщена информация за портфейла</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Транзакции</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>История на транзакциите</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Из&amp;ход</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Изход от приложението</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>Относно %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Покажи информация относно %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>За &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Покажи информация за Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Опции...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Промени настройки за %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Шифриране на портфейла...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Запазване на портфейла...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Смяна на паролата...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Изпращане на адресите...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Получаване на адресите...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Отвори &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Натиснете за деактивиране на мрежата</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Мрежата деактивирана</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Натиснете за повторно активиране на мрежата.</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Повторно индексиране на блоковете на диска...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Изпращане към Биткоин адрес</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Запазване на портфейла на друго място</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Променя паролата за портфейла</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Прозорец за отстраняване на грешки</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Отворете конзолата за диагностика и отстраняване на грешки</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Проверка на съобщение...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Биткоин</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Портфейл</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Изпращане</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Получаване</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Показване / Скриване</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Показване и скриване на основния прозорец</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Шифроване на личните ключове,които принадлежат на портфейла Ви.</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Пишете съобщения със своя Биткойн адрес за да докажете,че е ваш.</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Потвърждаване на съобщения  за да се знае,че са написани с дадените Биткойн адреси.</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Файл</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Настройки</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Помощ</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Раздели</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Изискване на плащания(генерира QR кодове и биткойн: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Показване на списъка с използвани адреси и имена</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Покажи списък с използваните адреси и имена.</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Отворете биткойн: URI  или заявка за плащане</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Налични команди</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Индексиране на блокове на диска...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Обработване на блокове на диска...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 зад</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Последния получен блок е генериран преди %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Транзакции след това няма все още да бъдат видими.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Грешка</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Предупреждение</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Информация</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Синхронизиран</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Покажи %1 помощно съобщение за да получиш лист с възможни Биткойн команди</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 клиент</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Свързване с пиъри</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Зарежда блокове...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Дата: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Сума: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Тип: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Етикет: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Адрес: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Изходяща транзакция</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Входяща транзакция</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Портфейлът е &lt;b&gt;криптиран&lt;/b&gt; и &lt;b&gt;отключен&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Портфейлът е &lt;b&gt;криптиран&lt;/b&gt; и &lt;b&gt;заключен&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Възникна фатална грешка. Биткойн не може да продължи безопасно и ще се изключи.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Избор на монета</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Количество:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Байтове:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Сума:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Такса:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Прах:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>След прилагане на ДДС</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Ресто</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(Пре)махни всички</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Дървовиден режим</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Списъчен режим</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Сума</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Получени с име</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Получени с адрес</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Потвърждения</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Потвърдени</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Копирай адрес</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копирай име</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копирай сума</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Копирай транзакция с ID</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Заключване на неизхарченото</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Отключване на неизхарченото</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Копиране на количеството</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Копиране на данък добавена стойност</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Копиране след прилагане на данък добавена стойност</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Копиране на байтовете</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Копирай прахта:</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Копирай рестото</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 заключен)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>да</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>не</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без име)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>ресто от %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(промени)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Редактиране на адрес</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Име</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Етикетът свързан с това въведение в листа с адреси</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Адресът свързан с това въведение в листа с адреси. Това може да бъде променено само за адреси за изпращане.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Адрес</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Нов адрес за получаване</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Нов адрес за изпращане</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Редактиране на адрес за получаване</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Редактиране на адрес за изпращане</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>\"%1\" не е валиден Биткоин адрес.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Вече има адрес \"%1\" в списъка с адреси.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Отключването на портфейла беше неуспешно.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Създаването на ключ беше неуспешно.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Ще се създаде нова папка за данни.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>име</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Директорията вече съществува.Добавете %1 ако желаете да добавите нова директория тук.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Пътят вече съществува и не е папка.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Не може да се създаде директория тук.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>версия</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-битов)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Относно %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Списък с команди</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Използване:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>Списък с налични команди</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Опции на интерфейс:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Избери директория за данни при стартирване (по подразбиране: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Избери език, примерно \"de_DE\" (по подразбиране: system locale)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Стартирай минимизиран</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Задай SSL root сертификат за молба за изплащане (по подразбиране: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Покажи splash екран при стартирване (по подразбиране %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Нулиране на всички настройки променени в GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Добре дошли</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Добре дошли в %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Програмата се стартира за първи път вие може да изберете къде %1 ще се запаметят данните.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Използване на директория по подразбиране</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Използване на директория ръчно</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Биткоин</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Най малко %1 GB данни ще бъдат запаметени в тази директория, и ще нарастват през времето.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Около %1 GB данни ще бъдат запаметени в тази директория.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Грешка</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Формуляр</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Време на последния блок</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>Изчисляване...</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Скрий</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Отваряне на URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Отвори молба за изплащане от URI или файл</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Опции</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Основни</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Размер на кеша в &amp;базата данни</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>Мегабайта</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Брой на скриптове и &amp;нишки за потвърждение</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP адрес на прокси (напр. за IPv4: 127.0.0.1 / за IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Възстановете всички настройки по подразбиране.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Нулирай настройките</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Мрежа</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>По&amp;ртфейл</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Експерт</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Позволяване на монетите и &amp;техните възможности</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Похарчете непотвърденото ресто</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Автоматично отваряне на входящия Bitcoin порт. Работи само с рутери поддържащи UPnP.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Отваряне на входящия порт чрез &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Свързване с Биткойн мрежата чрез SOCKS5  прокси.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Свързване чрез SOCKS5  прокси (прокси по подразбиране):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Прокси &amp; АйПи:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Порт:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Порт на прокси сървъра (пр. 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Прозорец</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>След минимизиране ще е видима само иконата в системния трей.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Минимизиране в системния трей</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>М&amp;инимизиране при затваряне</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Интерфейс</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Език:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>Мерна единица за показваните суми:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Изберете единиците, показвани по подразбиране в интерфейса.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Дали да покаже възможностите за контрол на монетите или не.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>ОК</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>Отказ</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>подразбиране</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>нищо</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Потвърдете отмяната на настройките.</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Изисква се рестартиране на клиента за активиране на извършените промени.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Грешка</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Тази промяна изисква рестартиране на клиента Ви.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Текущият прокси адрес е невалиден.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Формуляр</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Текущата информация на екрана може да не е актуална. Вашият портфейл ще се синхронизира автоматично с мрежата на Биткоин, щом поне една връзката с нея се установи; този процес все още не е приключил.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>В наблюдателен режим:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Налично:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Вашата текуща сметка за изразходване</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Изчакващо:</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Неразвит:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Миниран баланс,който все още не се е развил</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Баланс</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Общо:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Текущият ви общ баланс</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>За харчене:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Скорошни транзакции</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Възникна грешка по време назаявката за плащане</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Биткойн не можe да се стартира: click-to-pay handler</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Справяне с URI</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Невалиден адрес на плащане %1</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Файл за справяне със заявки</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Заявката за плащане беше отхвърлена</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Мрежата от която се извършва заявката за плащане не съвпада с мрежата на клиента.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Заявката за плащане е изтекла.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Невалидна заявка за плащане.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Заявената сума за плащане: %1 е твърде малка (счита се за отпадък)</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Възстановяване на сума от %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Заявката за плащане %1 е твърде голям (%2 байта, позволени %3 байта).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Грешка при комуникацията с %1: %2</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Възникна проблем при свързването със сървър %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Грешка в мрежата по време на заявката</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Плащането е прието</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Клиент на потребителя</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Изпратени</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Получени</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Сума</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Въведете Биткойн адрес (например: %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 ден</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 час</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 минута</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 секунда</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Неналичен</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Несъществуващ</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 милисекунда</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 и %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 Байт</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 Килобайт</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 Мегабайт</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 Гигабайт</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>неизвестен</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Грешка:Избраната \"%1\" директория не съществува.</translation>\n    </message>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Запиши изображение...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Копирай изображение</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Запази QR Код</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG Изображение (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Несъществуващ</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Версия на клиента</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Данни</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Прозорец с грешки</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Основни</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Използване на база данни BerkeleyDB </translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Време за стартиране</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Мрежа</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Име</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Брой връзки</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Текущ брой блокове</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Получени</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Изпратени</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Пиъри</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Избери пиър за детайлна информация.</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Посока</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Версия</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Клиент на потребителя</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Услуги</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Продължителност на връзката</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Изпратени за последно</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Получени за последно</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Време за отговор</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Време на последния блок</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Отвори</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Конзола</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Мрежов Трафик</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Общо:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Входящи:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Изходящи</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Лог файл,съдържащ грешките</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Изчисти конзолата</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>посредством %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>Никога</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Входящи</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Изходящи</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Да</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Не</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Неизвестен</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Сума</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Име:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Съобщение:</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Използвате този формуляр за заявяване на плащания. Всички полета са &lt;b&gt;незадължителни&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Незадължително заявяване на сума. Оставете полето празно или нулево, за да не заявите конкретна сума.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Изчисти всички полета от формуляра.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Изчистване</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Изискана история на плащанията</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Изискване на плащане</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Показване</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Премахване</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копирай име</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Копиране на съобщението</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копирай сума</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR код</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Копиране на &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Копирай адрес</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Запиши изображение...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Изискване на плащане от %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Данни за плащането</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Сума</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Име</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Съобщение</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Грешка при създаването на QR Code от URI.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Име</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Съобщение</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без име)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(без съобщение)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Изпращане</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Настройки за контрол на монетите</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>астоматично избран</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Нямате достатъчно налични пари!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Количество:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Байтове:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Сума:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Такса:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>След прилагане на ДДС</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Ресто</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Ако тази опция е активирана,но адресът на промяна е празен или невалиден,промяната ще бъде изпратена на новосъздаден адрес.</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Такса за транзакцията:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Избери...</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>за килобайт</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Скрий</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Препоръчителна:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>По избор:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Изпращане към повече от един получател</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Добави &amp;получател</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Изчисти всички полета от формуляра.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Прах:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Изчисти</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Баланс:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Потвърдете изпращането</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>И&amp;зпрати</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Копиране на количеството</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копирай сума</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Копиране на данък добавена стойност</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Копиране след прилагане на данък добавена стойност</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Копиране на байтовете</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Копирай прахта:</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Копирай рестото</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Наистина ли искате да изпратите?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>добавено като такса за транзакция</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>или</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Потвърждаване</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Сумата трябва да е по-голяма от 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Сумата надвишава текущия баланс</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Сумата при добавяне на данък добавена стойност по %1 транзакцията надвишава сумата по вашата сметка.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Грешка при създаването на транзакция!</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Заявката за плащане е изтекла.</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Внимание: Невалиден Биткойн адрес</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Внимание:Неизвестен адрес за промяна</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без име)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>С&amp;ума:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Плати &amp;На:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Име:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Изберете използван преди адрес</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Това е нормално плащане.</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Вмъкни от клипборда</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Премахване на този запис</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Съобщение:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Плащане на:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Бележка:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Въведете име за този адрес, за да го добавите в списъка с адреси</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Да</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Не изключвайте компютъра докато този прозорец не изчезне.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Подпиши / Провери съобщение</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Подпиши</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Изберете използван преди адрес</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Вмъкни от клипборда</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Въведете съобщението тук</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Подпис</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Копиране на текущия подпис</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Подпишете съобщение като доказателство, че притежавате определен адрес</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Подпиши &amp;съобщение</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Изчисти</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Провери</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Проверете съобщение, за да сте сигурни че е подписано с определен Биткоин адрес</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Потвърди &amp;съобщението</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Натиснете \"Подписване на съобщение\" за да създадете подпис</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Въведеният адрес е невалиден.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Моля проверете адреса и опитайте отново.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Въведеният адрес не може да се съпостави с валиден ключ.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Отключването на портфейла беше отменено.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Не е наличен частен ключ за въведеният адрес.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Подписването на съобщение беше неуспешно.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Съобщението е подписано.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Подписът не може да бъде декодиран.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Проверете подписа и опитайте отново.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Подписът не отговаря на комбинацията от съобщение и адрес.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Проверката на съобщението беше неуспешна.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Съобщението е потвърдено.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>Килобайта в секунда</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Подлежи на промяна до %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/офлайн</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/непотвърдени</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>включена в %1 блока</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Статус</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, все още не е изпратено</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Източник</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Издадени</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>От</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>неизвестен</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>За</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>собствен адрес</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>само гледане</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>име</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Кредит</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>не е приет</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Дебит</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Общ дълг</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Общ дълг</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Такса</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Нетна сума</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Съобщение</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Коментар</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Търговец</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Генерираните монети трябва да отлежат %1 блока преди да могат да бъдат похарчени. Когато генерираш блока, той се разпространява в мрежата, за да се добави в блок-веригата. Ако не успее да се добави във веригата, неговия статус  ще се стане \"неприет\" и няма да може да се похарчи. Това е възможно да се случи случайно, ако друг възел генерира блок няколко секунди след твоя.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Информация за грешките</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Транзакция</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Сума</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>true</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>false</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Описание на транзакцията</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Тип</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Име</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Подлежи на промяна до %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Извън линия</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Непотвърдено</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Потвърждаване (%1 от %2 препоръчвани потвърждения)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Потвърдени (%1 потвърждения)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Конфликтно</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Неплатим (%1 потвърждения, ще бъде платим след %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Блокът не е получен от останалите участници и най-вероятно няма да бъде одобрен.</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Генерирана, но отхвърлена от мрежата</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Получени</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Получен от</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Изпратени на</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Плащане към себе си</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Емитирани</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>само гледане</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без име)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Състояние на транзакцията. Задръжте върху това поле за брой потвърждения.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Дата и час на получаване на транзакцията.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Вид транзакция.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Сума извадена или добавена към баланса.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Всички</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Днес</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Тази седмица</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Този месец</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Предния месец</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Тази година</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>От - до...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Получени</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Изпратени на</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Собствени</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Емитирани</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Други</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Минимална сума</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Копирай адрес</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копирай име</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копирай сума</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Копирай транзакция с ID</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Редактирай име</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Подробности за транзакцията</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Изнасяне историята на транзакциите</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>CSV файл (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Потвърдени</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>само гледане</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Тип</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Име</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ИД</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Грешка при изнасянето</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Изнасянето е успешна</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Историята с транзакциите беше успешно запазена в %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>От:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>до</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Няма зареден портфейл.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Изпращане</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Изнеси</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Запишете данните от текущия раздел във файл</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Запазване на портфейла</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Информация за портфейла (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Неуспешно запазване на портфейла</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Възникна грешка при запазването на информацията за портфейла в %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Успешно запазване на портфейла</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Информацията за портфейла беше успешно запазена в %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Опции:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Определете директория за данните</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Свържете се към сървър за да можете да извлечете адресите на пиърите след което се разкачете.</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Въведете Ваш публичен адрес</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Биткойн ядро</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; може да бъде:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Приемайте връзки отвън.(по подразбиране:1 в противен случай -proxy или -connect)</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Настройки на връзката:</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Желаете ли да пресъздадете базата данни с блокове сега?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Грешка в пускането на базата данни с блокове</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Грешка: мястото на диска е малко!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Провалено \"слушане\" на всеки порт. Използвайте -listen=0 ако искате това.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Внасяне...</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Проверка на блоковете...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Настройки на портфейла:</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Свързване чрез SOCKS5  прокси</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Информация</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Изпрати локализиращата или дебъг информацията към конзолата, вместо файлът debug.log</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Това е експериментален софтуер.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Сумата на транзакцията е твърде малка</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Транзакцията е твърде голяма</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Потребителско име за JSON-RPC връзките</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Предупреждение</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Парола за  JSON-RPC връзките</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Назовете конфигурационен файл(по подразбиране %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Задайте време на изключване при проблеми със свързването в милисекунди(минимум:1, по подразбиране %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Задайте pid  файл(по подразбиране: %s)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Стартиране на мрежовите нишки...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Портфейлът няма да плаша по-малко от миналата такса за препредаване.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Това е минималната такса за транзакция, която плащате за всяка транзакция.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Това е таксата за транзакцията която ще платите ако изпратите транзакция.</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Сумите на транзакциите не могат да бъдат отрицателни</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Транзакцията трябва да има поне един получател.</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Недостатъчно средства</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Зареждане на блок индекса...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Зареждане на портфейла...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Портфейлът не може да се понижи.</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Преразглеждане на последовтелността от блокове...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Зареждането е завършено</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Грешка</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_bg_BG.ts",
    "content": "<TS language=\"bg_BG\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Клик с десен бутон на мишката за промяна на адрес или етикет</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Създай нов адрес</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>Нов</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Копирай текущо избрания адрес към клипборда</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copy</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Затвори</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Изтрий текущо избрания адрес от листа</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Изнеси данните в избрания раздел към файл</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Изнеси</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Изтрий</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Избери адреса на който да пратиш монети</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Избери адреса на който да получиш монети</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Избери</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Адрес за пращане</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Адрес за получаване</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Тези са вашите Биткойн адреси за изпращане на монети. Винаги проверявайте количеството и получаващия адрес преди изпращане. </translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Това са вашите Биткойн адреси за получаване на монети. Препоръчително е да ползвате нов адрес на всяка транзакция.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>Копирай адрес</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Копирай етикет</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>Редактирай</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Изнеси лист с адреси</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Изнасянето се провали</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Получи се грешка при запазването на листа с адреси към %1. Моля опитайте пак.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Етикет</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без етикет)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Диалог за пропуск</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Въведи парола</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Нова парола</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Повтори парола</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Криптирай портфейл</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Тази операция изисква вашата парола на портфейла за отключването на портфейла.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Отключи портфейла</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Тази операция изисква вашата парола на портфейла за декриптирането на портфейла.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Декриптирай портфейл</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Промени парола</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Потвърди криптирането на порфейла</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>портфейлa е шифрован</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Отключването не бе успешно</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Отключването не бе успешно</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Внимание:Бутонът Caps Lock е включен.</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Мрежова маска</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Блокиран до</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Подпиши съобщение...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Синхронизиране с мрежата...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>Преглед</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Възел</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Покажи общ преглед на портфейла</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>Транзакции</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Разгледай история на транзакциите</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Изход</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Излез от приложението</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>За %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Покажи информация за %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Относно Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Покажи информация отностно Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>Настройки...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Промени конфигурации за %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Криптирай портфейл</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Направи резервно копие на портфейла...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Промени паролата...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Адреси за пращане...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Адреси за получаване...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Отвори URI</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Повторно индексиране на блоковете на диска...</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>портфейл</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;изпращам</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;получавам</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Лентата с инструменти</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>грешка</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Внимание</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Информация</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Актуално</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 клиент</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Наваксвам</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Дата: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Изпратена транзакция</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Входяща транзакция</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Избор на монети</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Количество:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Количество:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Такса:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>прах:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>След такса:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Промяна:</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>списък Режим</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Количество</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>потвърждения</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Потвърдено</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Копирайте адреса</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копиране на етикета</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копиране на сумата</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Копиране на ID на транзакцията</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Заключи неусвоени</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Отключете неизползваните</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Копиране на количеството</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Копирай такса</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Копирайте след такса</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Промяна на копирането</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>да</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>не</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без етикет)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Редактирайте адреса</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Нов адрес за получаване</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Нов адрес за изпращане</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Редактиране на получаващия адрес</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Редактиране на адрес за изпращане</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Не може да отключите портфейла.</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>име</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>версия</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Добре дошли</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>грешка</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>форма</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>прогрес</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>изчисляване</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Настроики</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Отворете конфигурационния файл</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Експерт</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>нищо</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Потвърдете опциите за нулиране</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Опции за конфигуриране</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>грешка</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>форма</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Гледайте само:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>На разположение:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Текущото Ви разходоносно салдо</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>В очакване на:</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Незрялото:</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>баланс</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Обща сума:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Текущото Ви общо салдо</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Последни транзакции</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Заявката за плащане е изтекла.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Невалидна заявка за плащане.</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Потребителски агент</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>пинг</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Количество</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>нито един</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>неизвестен</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>Client version</source>\n        <translation>Клиентска версия</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Прозорец за отстраняване на грешки</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Общ</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Време за стартиране</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>мрежа</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>име</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Потребителски агент</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>Copy label</source>\n        <translation>Копиране на етикета</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копиране на сумата</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Количество</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Етикет</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Етикет</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без етикет)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Количество:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Количество:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Такса:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>След такса:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Промяна:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>прах:</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Копиране на количеството</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копиране на сумата</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Копирай такса</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Копирайте след такса</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Промяна на копирането</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Заявката за плащане е изтекла.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без етикет)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Status</source>\n        <translation>Статус</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>източник</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Генериран</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>от</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>неизвестен</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>към</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>собствен адрес</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>кредит</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Количество</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Етикет</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без етикет)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>Копирайте адреса</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копиране на етикета</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копиране на сумата</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Копиране на ID на транзакцията</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Потвърдено</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Етикет</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Изнасянето се провали</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Изнеси</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Изнеси данните в избрания раздел към файл</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Биткойн ядро</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Информация</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Внимание</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>грешка</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_bn.ts",
    "content": "<TS language=\"bn\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>ঠিকানা কিংবা লেভেল সম্পাদনার জন্য রাইট-ক্লিক করুন</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>নতুন একটি ঠিকানা তৈরি করুন</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>নূতন</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>কপি/প্রতিলিপি</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>কপি/প্রতিলিপি</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Address</source>\n        <translation>ঠিকানা </translation>\n    </message>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Warning</source>\n        <translation>সতর্কতা</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>ঠিকানা </translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>প্রবেশকৃত ঠিকানাটি শুদ্ধ নয়।</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>অনুগ্রহ করে স্বাক্ষরটি পুনরায় পরীক্ষা করে আবারও চেষ্টা করুন।</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Address</source>\n        <translation>ঠিকানা </translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Block creation options:</source>\n        <translation>ব্লক তৈরির অপশনগুলো:</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>ডিবাগিং/টেস্টিং অপশন:</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>আপনি কি পুনরায় ব্লক ডাটাবেইজ এখনই তৈরি করতে চান?</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>আরপিসি সার্ভার অপশন:</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>এটি পরীক্ষামূলক সফটওয়্যার।</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>লেনদেনের পরিমান অনেক ছোট</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>লেনদেনর অংক অনেক বড়</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>সতর্কতা</translation>\n    </message>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_bs.ts",
    "content": "<TS language=\"bs\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Sve</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Danas</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Ovaj mjesec</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Prošli mjesec</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Ove godine</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Jezrga</translation>\n    </message>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ca.ts",
    "content": "<TS language=\"ca\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Feu clic dret per a editar l'adreça o l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crea una nova adreça</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nova</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copia l'adreça seleccionada al porta-retalls del sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copia</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Tanca</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Elimina l'adreça sel·leccionada actualment de la llista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporta les dades de la pestanya actual a un fitxer</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporta</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Elimina</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Trieu l'adreça on enviar les monedes</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Trieu l'adreça on rebre les monedes</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Tria</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Adreces d'enviament</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Adreces de recepció</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Aquestes són les vostres adreces de Bitcoin per enviar els pagaments. Sempre reviseu l'import i l'adreça del destinatari abans de transferir monedes.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Aquestes són les vostres adreces Bitcoin per rebre pagaments. Es recomana utilitzar una adreça nova de recepció per a cada transacció.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copia l'adreça</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copia l'eti&amp;queta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Edita</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exporta la llista d'adreces</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fitxer separat per comes (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>L'exportació ha fallat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>S'ha produït un error en desar la llista d'adreces a %1. Torneu-ho a provar.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreça</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diàleg de contrasenya</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Introduïu una contrasenya</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nova contrasenya</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repetiu la nova contrasenya</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Ensenya la contrasenya</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Introduïu la contrasenya nova al moneder.&lt;br/&gt;Utilitzeu una contrasenya de &lt;b&gt;deu o més caràcters aleatoris&lt;/b&gt;, o &lt;b&gt;vuit o més paraules&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Encripta el moneder</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Aquesta operació requereix la contrasenya del moneder per a desbloquejar-lo.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloqueja el moneder</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Aquesta operació requereix la contrasenya del moneder per desencriptar-lo.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Desencripta el moneder</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Canvia la contrasenya</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Introduïu la contrasenya antiga i la contrasenya nova al moneder.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirma l'encriptació del moneder</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Avís: si encripteu el vostre moneder i perdeu la contrasenya, &lt;b&gt;PERDREU TOTS ELS VOSTRES BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Esteu segur que voleu encriptar el vostre moneder?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Moneder encriptat</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>Ara es tancarà el %1 per finalitzar el procés d'encriptació. Recordeu que encriptar el vostre moneder no garanteix que les vostres bitcoins no puguin ser robades per programari maliciós que infecti l'ordinador.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANT: Tota copia de seguretat que hàgiu realitzat hauria de ser reemplaçada pel, recentment generat, fitxer encriptat del moneder. Per motius de seguretat, les còpies de seguretat anteriors del fitxer de moneder no encriptat esdevindran inusables tan aviat com començar a utilitzar el nou moneder encriptat.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>L'encriptació del moneder ha fallat</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>L'encriptació del moneder ha fallat per un error intern. El moneder no ha estat encriptat.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Les contrasenyes introduïdes no coincideixen.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>El desbloqueig del moneder ha fallat</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La contrasenya introduïda per a desencriptar el moneder és incorrecta.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>La desencriptació del moneder ha fallat</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>La contrasenya del moneder ha estat modificada correctament.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Avís: Les lletres majúscules estan activades!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP / Màscara de xarxa</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Bandejat fins</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signa el &amp;missatge...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>S'està sincronitzant amb la xarxa ...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Panorama general</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostra el panorama general del moneder</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaccions</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Cerca a l'historial de transaccions</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>S&amp;urt</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Surt de l'aplicació</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>Qu&amp;ant al %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Mosta informació sobre el %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Quant a &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostra informació sobre Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opcions...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modifica les opcions de configuració de %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Encripta el moneder...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Realitza una còpia de seguretat del moneder...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Canvia la contrasenya...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Adreces d'e&amp;nviament...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Adreces de &amp;recepció...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Obre un &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Feu clic per inhabilitar l'activitat de la xarxa.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>S'ha inhabilitat l'activitat de la xarxa.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Feu clic per tornar a habilitar l'activitat de la xarxa.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Sincronitzant Capçaleres (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>S'estan reindexant els blocs al disc...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Envia monedes a una adreça Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Realitza una còpia de seguretat del moneder a una altra ubicació</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Canvia la contrasenya d'encriptació del moneder</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Finestra de depuració</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Obre la consola de diagnòstic i depuració</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifica el missatge...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Moneder</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Envia</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Rep</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mostra / Amaga</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostra o amaga la finestra principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Encripta les claus privades pertanyents al moneder</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signa el missatges amb la seva adreça de Bitcoin per provar que les poseeixes</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifiqueu els missatges per assegurar-vos que han estat signats amb una adreça Bitcoin específica.</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fitxer</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuració</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ajuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra d'eines de les pestanyes</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Sol·licita pagaments (genera codis QR i bitcoin: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostra la llista d'adreces d'enviament i etiquetes utilitzades</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Mostra la llista d'adreces de recepció i etiquetes utilitzades</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Obre una bitcoin: sol·licitud d'URI o pagament</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opcions de la &amp;línia d'ordres</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n connexions actives a la xarxa Bitcoin</numerusform><numerusform>%n connexions actives a la xarxa Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>S'estan indexant els blocs al disc...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>S'estan processant els blocs al disc...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>S'han processat %n blocs de l'historial de transacció.</numerusform><numerusform>S'han processat %n blocs de l'historial de transacció.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 darrere</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>El darrer bloc rebut ha estat generat fa %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Les transaccions a partir d'això no seran visibles.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Avís</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informació</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Al dia</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Mostra el missatge d'ajuda del %1 per obtenir una llista amb les possibles opcions de línia d'ordres de Bitcoin</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>Client de %1</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Connectant a altres nodes...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>S'està posant al dia ...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Import: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipus: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etiqueta: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adreça: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transacció enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacció entrant</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>La generació de la clau HD és &lt;b&gt;habilitada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>La generació de la clau HD és &lt;b&gt;inhabilitada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>El moneder està &lt;b&gt;encriptat&lt;/b&gt; i actualment &lt;b&gt;desbloquejat&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>El moneder està &lt;b&gt;encriptat&lt;/b&gt; i actualment &lt;b&gt;bloquejat&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>S'ha produït un error fatal. Bitcoin no pot continuar amb seguretat i finalitzarà.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selecció de moneda</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantitat:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Import:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comissió:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polsim:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Comissió posterior:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Canvi:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(des)selecciona-ho tot</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Mode arbre</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Mode llista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Rebut amb l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Rebut amb l'adreça</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmacions</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmat</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copia l'adreça</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copia l'ID de transacció</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Bloqueja sense gastar</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Desbloqueja sense gastar</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copia la quantitat</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copia la comissió</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copia la comissió posterior</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copia els bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copia el polsim</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copia el canvi</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 bloquejada)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>sí</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Aquesta etiqueta es torna vermella si cap recipient rep un import inferior al llindar de polsim actual.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Pot variar en +/- %1 satoshi(s) per entrada.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>canvia de %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(canvia)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Edita l'adreça</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>L'etiqueta associada amb aquesta entrada de llista d'adreces</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>L'adreça associada amb aquesta entrada de llista d'adreces. Només es pot modificar per a les adreces d'enviament.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adreça</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nova adreça de recepció</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nova adreça d'enviament</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Edita l'adreça de recepció</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Edita l'adreça d'enviament</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>L'adreça introduïda «%1» no és una adreça de Bitcoin vàlida.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>L'adreça introduïda «%1» ja és present a la llibreta d'adreces.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>No s'ha pogut desbloquejar el moneder.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Ha fallat la generació d'una clau nova.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Es crearà un nou directori de dades.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nom</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>El directori ja existeix. Afegeix %1 si vols crear un nou directori en aquesta ubicació.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>El camí ja existeix i no és cap directori.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>No es pot crear el directori de dades aquí.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versió</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Quant al %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opcions de línia d'ordres</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Ús:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>Opcions de la línia d'ordres</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opcions d'interfície d'usuari:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Trieu el directori de dades a l'inici (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Defineix la llengua, per exemple «de_DE» (per defecte: la definida pel sistema)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Inicia minimitzat</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Defineix els certificats arrel SSL per a la sol·licitud de pagament (per defecte: els del sistema)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Mostra la pantalla de benvinguda a l'inici (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Reinicialitza tots els canvis de configuració fets des de la interfície gràfica</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Us donem la benvinguda</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Us donem la benvinguda a %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Com és la primera vegada que s'executa el programa, podeu triar on %1 emmagatzemarà les dades.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Quan feu clic a D'acord, %1 començarà a descarregar i processar la cadena de blocs %4 completa (%2 GB) començant per les primeres transaccions de %3, any de llençament inicial de %4.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Aquesta sincronització inicial és molt exigent i pot exposar problemes de maquinari amb l'equip que anteriorment havien passat desapercebuts. Cada vegada que executeu %1, continuarà descarregant des del punt on es va deixar.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Si heu decidit limitar l'emmagatzematge de la cadena de blocs (podar), les dades històriques encara s'hauran de baixar i processar, però se suprimiran més endavant per mantenir baix l'ús del disc.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Utilitza el directori de dades per defecte</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Utilitza un directori de dades personalitzat:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Almenys %1 GB de dades s'emmagatzemaran en aquest directori, i creixerà amb el temps.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Aproximadament %1 GB de dades s'emmagatzemaran en aquest directori.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 descarregarà i emmagatzemarà una còpia de la cadena de blocs Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>El moneder també serà emmagatzemat en aquest directori.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Error: el directori de dades «%1» especificat no pot ser creat.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB d'espai lliure disponible</numerusform><numerusform>%n GB d'espai lliure disponible</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(de %n GB necessaris)</numerusform><numerusform>(de %n GB necessaris)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulari</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>És possible que les transaccions recents encara no siguin visibles i, per tant, el saldo del vostre moneder podria ser incorrecte. Aquesta informació serà correcta una vegada que el vostre moneder hagi finalitzat la sincronització amb la xarxa bitcoin, tal com es detalla més avall.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Els intents de gastar bitcoins que es veuen afectats per les transaccions que encara no s'hagin mostrat no seran acceptats per la xarxa.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Nombre de blocs pendents</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Desconegut...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Últim temps de bloc</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progrés</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Augment de progrés per hora</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>s'està calculant...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Temps estimat restant fins sincronitzat</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Amaga</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Desconegut. Sincronització de les capçaleres (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Obre un URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Obre una sol·licitud de pagament des d'un URI o un fitxer</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Selecciona un fitxer de sol·licitud de pagament</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Seleccioneu el fitxer de sol·licitud de pagament per obrir</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opcions</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Inicieu %1 automàticament després d'entrar en el sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Inicia %1 en l'entrada al sistema</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Mida de la memòria cau de la base de &amp;dades</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Nombre de fils de &amp;verificació d'scripts</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Adreça IP del proxy (p. ex. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Mostra si el proxy SOCKS5 predeterminat subministrat s'utilitza per arribar a altres nodes a través d'aquest tipus de xarxa.</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Amaga la icona de la safata del sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>Amaga la icona de la safata</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimitza en comptes de sortir de l'aplicació quan la finestra es tanca. Quan s'habilita aquesta opció l'aplicació es tancara només quan se selecciona Surt del menú. </translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL de terceres parts (p. ex. explorador de blocs) que apareix en la pestanya de transaccions com elements del menú contextual. %s en l'URL es reemplaçat pel resum de la transacció. Diferents URL estan separades per una barra vertical |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Opcions de línies d'ordre active que sobreescriuen les opcions de dalt:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Obriu el fitxer de configuració %1 des del directori de treball.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Obrir el fitxer de configuració</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Reestableix totes les opcions del client.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Reestableix les opcions</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Xarxa</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = deixa tants nuclis lliures)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Moneder</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Activa les funcions de &amp;control de les monedes</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Si inhabiliteu la despesa d'un canvi sense confirmar, el canvi d'una transacció no pot ser utilitzat fins que la transacció no tingui com a mínim una confirmació. Això també afecta com es calcula el vostre balanç.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Gasta el canvi sense confirmar</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Obre el port del client de Bitcoin al router de forma automàtica. Això només funciona quan el router implementa UPnP i l'opció està activada.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Port obert amb &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Accepta connexions de fora</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Permet connexions entrants</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Connecta a la xarxa Bitcoin a través d'un proxy SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Connecta a través d'un proxy SOCKS5 (proxy per defecte):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP del proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port del proxy (per exemple 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Utilitzat per arribar als iguals mitjançant:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Conectar a la red de Bitcoin a través de un proxy SOCKS5 per als serveis ocults de Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Finestra</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Mostra només la icona de la barra en minimitzar la finestra.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimitza a la barra d'aplicacions en comptes de la barra de tasques</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimitza en tancar</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Pantalla</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Llengua de la interfície d'usuari:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Aquí es pot definir la llengua de la interfície d'usuari. Aquest paràmetre tindrà efecte en reiniciar el %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unitats per mostrar els imports en:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Selecciona la unitat de subdivisió per defecte per mostrar en la interfície quan s'envien monedes.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Si voleu mostrar les funcions de control de monedes o no.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>URL de transaccions de tercers</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;D'acord</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancel·la</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>Per defecte</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>cap</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmeu el reestabliment de les opcions</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Cal reiniciar el client per activar els canvis.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>S'aturarà el client. Voleu procedir?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opcions de configuració</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>El fitxer de configuració s'utilitza per especificar les opcions d'usuari avançades que substitueixen la configuració de la interfície gràfica d'usuari. A més, qualsevol opció de la línia d'ordres substituirà aquest fitxer de configuració.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>No s'ha pogut obrir el fitxer de configuració.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Amb aquest canvi cal un reinici del client.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>L'adreça proxy introduïda és invalida.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulari</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Bitcoin un cop s'ha establert connexió, però aquest proces no s'ha completat encara.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Només lectura:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponible:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>El balanç que podeu gastar actualment</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pendent:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transaccions que encara han de confirmar-se i que encara no compten en el balanç que es pot gastar</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Immadur:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Balanç minat que encara no ha madurat</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Balances</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>El balanç total actual</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>El vostre balanç actual en adreces de només lectura</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Que es pot gastar:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transaccions recents</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Transaccions sense confirmar a adreces de només lectura</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Balanç minat en adreces de només lectura que encara no ha madurat</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Balanç total actual en adreces de només lectura</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Error de la sol·licitud de pagament</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>No es pot iniciar bitcoin: controlador click-to-pay</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Gestió d'URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>L'URL de recuperació de la sol·licitud de pagament no és vàlida: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Adreça de pagament no vàlida %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>L'URI no pot ser analitzat! Això pot ser a causa d'una adreça de Bitcoin no vàlida o per paràmetres URI amb mal format.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Gestió de fitxers de les sol·licituds de pagament</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>No es pot llegir el fitxer de la sol·licitud de pagament. Això pot ser causat per un fitxer de sol·licitud de pagament no vàlid.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>La sol·licitud de pagament s'ha rebutjat</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>La xarxa de la sol·licitud de pagament no coincideix amb la xarxa del client.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>La sol·licitud de pagament ha vençut.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>La sol·licitud de pagament no està inicialitzada.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>No s'accepten sol·licituds de pagament no verificades a scripts de pagament personalitzats.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Sol·licitud de pagament no vàlida.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>L'import de pagament sol·licitat %1 és massa petit (es considera polsim).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Reemborsament de %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>La sol·licitud de pagament %1 és massa gran (%2 bytes, permès %3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Error en comunicar amb %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>No es pot analitzar la sol·licitud de pagament!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Mala resposta del servidor %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Error en la sol·licitud de xarxa</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Pagament reconegut</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent d'usuari</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Node/Servei</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>NodeId</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviat</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Rebut</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Introduïu una adreça de Bitcoin (p. ex. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Cap</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n segons</numerusform><numerusform>%n segons</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minuts</numerusform><numerusform>%n minuts</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n hores</numerusform><numerusform>%n hores</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n dies</numerusform><numerusform>%n dies</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n setmanes</numerusform><numerusform>%n setmanes</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 i %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n anys</numerusform><numerusform>%n anys</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 encara no ha finalitzat de manera segura...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconegut</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Error: El directori de dades especificat «%1» no existeix.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Error: no es pot analitzar el fitxer de configuració: %1. Feu servir només la sintaxi clau=valor.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Error: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>De&amp;sa la imatge...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copia la imatge</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Desa el codi QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imatge PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versió del client</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informació</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Finestra de depuració</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Utilitzant BerkeleyDB versió</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>&amp;Temps d'inici</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Xarxa</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nom</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Nombre de connexions</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Cadena de blocs</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Nombre de blocs actuals</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Reserva de memòria</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Nombre actual de transaccions</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Us de memoria</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Reset</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Rebut</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviat</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Iguals</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Iguals bandejats</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Seleccioneu un igual per mostrar informació detallada.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>A la llista blanca</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direcció</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versió</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Bloc d'inici</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Capçaleres sincronitzades</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Blocs sincronitzats</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent d'usuari</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Obre el fitxer de registre de depuració %1 del directori de dades actual. Això pot trigar uns segons en fitxers de registre grans.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Disminueix la mida de la font</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Augmenta la mida de la font</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Serveis</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Puntuació de bandeig</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Temps de connexió</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Darrer enviament</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Darrera recepció</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Temps de ping</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>La duració d'un ping més destacat actualment.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Espera de ping</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Min Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Diferència horària</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Últim temps de bloc</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Obre</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>Trà&amp;nsit de la xarxa</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totals</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Dins:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Fora:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Fitxer de registre de depuració</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Neteja la consola</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hora</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;dia</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;setmana</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;any</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Desconnecta</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Bandeja per</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>Desbandeja per</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Benvingut a la consola RPC de %1.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Utilitzeu les fletxes amunt i avall per navegar per l'historial i %1 per netejar la pantalla.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>ADVERTIMENT: Els estafadors han estat actius, dient als usuaris que escriguin comandaments aquí, robant els contingut dels seus moneders. No utilitzeu aquesta consola sense comprendre completament les ramificacions d'un comandament.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Activitat de xarxa inhabilitada</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(id del node: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>a través de %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>mai</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Entrant</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Sortint</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Sí</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>No</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Desconegut</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Im&amp;port:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Missatge:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Un missatge opcional que s'adjuntarà a la sol·licitud de pagament, que es mostrarà quan s'obri la sol·licitud. Nota: El missatge no s'enviarà amb el pagament per la xarxa Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Una etiqueta opcional que s'associarà amb la nova adreça receptora.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Utilitzeu aquest formulari per sol·licitar pagaments. Tots els camps són &lt;b&gt;opcionals&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Un import opcional per sol·licitar. Deixeu-ho en blanc o zero per no sol·licitar cap import específic.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Esborra tots els camps del formuari.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Neteja</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historial de pagaments sol·licitats</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Sol·licitud de pagament</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Mostra la sol·licitud seleccionada (fa el mateix que el doble clic a una entrada)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostra</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Esborra les entrades seleccionades de la llista</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Esborra</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copia URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copia el missatge</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Codi QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copia l'&amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copia l'&amp;adreça</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>De&amp;sa la imatge...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Sol·licita un pagament a %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informació de pagament</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreça</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Missatge</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI resultant massa llarga, intenta reduir el text per a la etiqueta / missatge</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Error en codificar l'URI en un codi QR.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Missatge</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(sense missatge)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(no s'ha sol·licitat import)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Sol·licitat</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Envia monedes</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Característiques de control de les monedes</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Entrades...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>seleccionat automàticament</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fons insuficients!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantitat:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Import:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comissió:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Comissió posterior:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Canvi:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Si s'activa això, però l'adreça de canvi està buida o bé no és vàlida, el canvi s'enviarà a una adreça generada de nou.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Personalitza l'adreça de canvi</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Comissió de transacció</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Tria...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>L'ús de la tarifa de pagament pot provocar l'enviament d'una transacció que trigarà diverses hores o dies (o mai) a confirmar. Penseu a triar la possibilitat d'escollir la tarifa manualment o espereu fins que hagueu validat la cadena completa.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Advertència: l'estimació de tarifes no és possible actualment.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>redueix els paràmetres de comissió</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Si la comissió personalitzada es defineix a 1000 satoshis i la transacció és de només 250 bytes, llavors «per kilobyte» només es paguen 250 satoshis en una comissió, mentre que amb la de «total com a mínim» es pagarien 1000 satoshis. Per a transaccions superiors al kilobyte, en tots dos casos es paga per kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Amaga</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>No hi ha cap problema en pagar només la comissió mínima sempre que hi hagi menys volum de transacció que espai en els blocs. Però tingueu present que això pot acabar en una transacció que mai es confirmi una vegada hi hagi més demanda de transaccions de bitcoins que la xarxa pugui processar.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(llegiu l'indicador de funció)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recomanada:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Personalitzada:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(No s'ha inicialitzat encara la comissió intel·ligent. Normalment pren uns pocs blocs...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Envia a múltiples destinataris al mateix temps</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Afegeix &amp;destinatari</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Esborra tots els camps del formuari.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polsim:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Temps de confirmació objectiu:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Neteja-ho &amp;tot</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balanç:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirma l'acció d'enviament</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>E&amp;nvia</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copia la quantitat</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copia la comissió</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copia la comissió posterior</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copia els bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copia el polsim</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copia el canvi</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blocs)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 a %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Esteu segur que ho voleu enviar?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>S'ha afegit una taxa de transacció</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Import total %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>o</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirma l'enviament de monedes</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>L'adreça del destinatari no és vàlida. Torneu-la a comprovar.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>L'import a pagar ha de ser major que 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>L'import supera el vostre balanç.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>El total excedeix el vostre balanç quan s'afegeix la comissió a la transacció %1.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>S'ha trobat una adreça duplicada: les adreces només s'haurien d'utilitzar una vegada cada una.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>La creació de la transacció ha fallat!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>La transacció s'ha rebutjat amb el motiu següent: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Una comissió superior a %1 es considera una comissió absurdament alta.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>La sol·licitud de pagament ha vençut.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Paga només la comissió necessària de %1</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Avís: adreça Bitcoin no vàlida</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Avís: adreça de canvi desconeguda</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Confirma l'adreça de canvi personalitzada</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>L'adreça que heu seleccionat per al canvi no és part d'aquest moneder. Tots els fons del vostre moneder es poden enviar a aquesta adreça. Estàs segur?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Q&amp;uantitat:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Paga &amp;a:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Tria les adreces fetes servir amb anterioritat</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Això és un pagament normal.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>L'adreça Bitcoin on enviar el pagament</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alta+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Enganxar adreça del porta-retalls</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Elimina aquesta entrada</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>La comissió es deduirà de l'import que s'enviarà. El destinatari rebrà menys bitcoins que les que introduïu al camp d'import. Si se seleccionen múltiples destinataris, la comissió es dividirà per igual.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>S&amp;ubstreu la comissió de l'import</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Missatge:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Aquesta és una sol·licitud de pagament no autenticada.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Aquesta és una sol·licitud de pagament autenticada.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Introduïu una etiqueta per a aquesta adreça per afegir-la a la llista d'adreces utilitzades</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Un missatge que s'ha adjuntat al bitcoin: URI que s'emmagatzemarà amb la transacció per a la vostra referència. Nota: el missatge no s'enviarà a través de la xarxa Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Paga a:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Introduïu una etiqueta per a aquesta adreça per afegir-la a la llibreta d'adreces</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Sí</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 s'està tancant ...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>No apagueu l'ordinador fins que no desaparegui aquesta finestra.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signatures - Signa / verifica un missatge</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Signa el missatge</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Podeu signar missatges/acords amb les vostres adreces per provar que rebeu les bitcoins que s'hi envien. Aneu amb compte no signar res que sigui vague o aleatori, perquè en alguns atacs de suplantació es pot provar que hi signeu la vostra identitat. Només signeu aquelles declaracions completament detallades en què hi esteu d'acord. </translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>L'adreça Bitcoin amb què signar el missatge</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Tria les adreces fetes servir amb anterioritat</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alta+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Enganxar adreça del porta-retalls</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Introduïu aquí el missatge que voleu signar</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signatura</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copia la signatura actual al porta-retalls del sistema</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Signa el missatge per provar que ets propietari d'aquesta adreça Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Signa el &amp;missatge</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Neteja tots els camps de clau</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Neteja-ho &amp;tot</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifica el missatge</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Introduïu l'adreça del receptor, el missatge (assegureu-vos de copiar els salts de línia, espais, tabuladors, etc. exactament) i signatura de sota per verificar el missatge. Tingueu cura de no llegir més en la signatura del que està al missatge signat, per evitar ser enganyat per un atac d'home-en-el-mig. Tingueu en compte que això només demostra que la part que signa rep amb l'adreça, i no es pot provar l'enviament de qualsevol transacció!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>L'adreça Bitcoin amb què va ser signat el missatge</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verificar el missatge per assegurar-se que ha estat signat amb una adreça Bitcoin específica</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifica el &amp;missatge</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Neteja tots els camps de verificació de missatge</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Feu clic a «Signa el missatge» per a generar una signatura</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>L'adreça introduïda no és vàlida.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Comproveu l'adreça i torneu-ho a provar.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>L'adreça introduïda no referencia a cap clau.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>El desbloqueig del moneder ha estat cancelat.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>La clau privada per a la adreça introduïda no està disponible.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>La signatura del missatge ha fallat.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Missatge signat.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>La signatura no s'ha pogut descodificar.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Comproveu la signatura i torneu-ho a provar.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>La signatura no coincideix amb el resum del missatge.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Ha fallat la verificació del missatge.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Missatge verificat.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Obert fins %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>produït un conflicte amb una transacció amb %1 confirmacions</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/fora de línia</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/no confirmades, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>a la reserva de memòria</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>no a la reserva de memòria</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandonat</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/sense confirmar</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 confirmacions</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Estat</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, encara no ha estat emès correctement</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Font</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generada</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>De</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconegut</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>A</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>adreça pròpia</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>només lectura</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiqueta</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Crèdit</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>no acceptat</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Dèbit</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Dèbit total</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Crèdit total</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Comissió de transacció</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Import net</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Missatge</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comentari</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID de la transacció</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Mida total de la transacció</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Índex de resultats</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Mercader</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Les monedes generades han de madurar %1 blocs abans de poder ser gastades. Quan genereu aquest bloc, es farà saber a la xarxa per tal d'afegir-lo a la cadena de blocs. Si no pot fer-se lloc a la cadena, el seu estat canviarà a «no acceptat» i no es podrà gastar. Això pot passar ocasionalment si un altre node genera un bloc en un marge de segons respecte al vostre.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Informació de depuració</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transacció</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Entrades</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>cert</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>fals</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Aquest panell mostra una descripció detallada de la transacció</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detalls per %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Obert fins %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Fora de línia</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Sense confirmar</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandonada</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirmant (%1 de %2 confirmacions recomanades)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmat (%1 confirmacions)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>En conflicte</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Immadur (%1 confirmacions, serà disponible després de %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Aquest bloc no ha estat rebut per cap altre node i probablement no serà acceptat!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generat però no acceptat</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Rebuda amb</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Rebuda de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviada a</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pagament a un mateix</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minada</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>només lectura</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Estat de la transacció. Desplaceu-vos sobre aquest camp per mostrar el nombre de confirmacions.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Data i hora en que la transacció va ser rebuda.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipus de transacció.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Si està implicada o no una adreça només de lectura en la transacció.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Intenció/propòsit de la transacció definida per l'usuari.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Import extret o afegit del balanç.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Tot</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Avui</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Aquesta setmana</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Aquest mes</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>El mes passat</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Enguany</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Rang...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Rebuda amb</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviada a</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>A un mateix</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minada</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Altres</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Import mínim</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Abandonar transacció</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Augmenta la comissió de transacció</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copia l'adreça</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copia l'ID de transacció</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copia la transacció crua</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copieu els detalls complets de la transacció</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Editar etiqueta</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Mostra detalls de la transacció</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exporta l'historial de transacció</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fitxer separat per comes (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmat</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Només de lectura</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreça</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>L'exportació ha fallat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>S'ha produït un error en provar de desar l'historial de transacció a %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exportació amb èxit</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>L'historial de transaccions s'ha desat correctament a %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Rang:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>a</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unitat en què mostrar els imports. Feu clic per seleccionar una altra unitat.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>No s'ha carregat cap moneder.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Envia monedes</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Error de recàrrec de tarifes</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>S'ha produït un error en augmentar la tarifa de transacció</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Voleu augmentar la tarifa?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>tarifa actual:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Increment:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nova tarifa:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Confirmeu el recàrrec de tarifes</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>No es pot signar la transacció.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>No s'ha pogut confirmar la transacció</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporta</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporta les dades de la pestanya actual a un fitxer</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Còpia de seguretat del moneder</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Dades del moneder (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Ha fallat la còpia de seguretat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>S'ha produït un error en provar de desar les dades del moneder a %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>La còpia de seguretat s'ha realitzat correctament</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>S'han desat les dades del moneder correctament a %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opcions:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especifica el directori de dades</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Connecta al node per obtenir les adreces de les connexions, i desconnecta</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especifiqueu la vostra adreça pública</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Accepta la línia d'ordres i ordres JSON-RPC </translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distribuït sota la llicència del programari MIT, consulteu el fitxer d'acompanyament %s o %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Si no es proporciona &lt;category&gt; o si &lt;category&gt; = 1, treu a la sortida tota la informació de depuració.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Poda configurada per sota el mínim de %d MiB. Utilitzeu un nombre superior.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Poda: la darrera sincronització del moneder va més enllà de les dades podades. Cal que activeu -reindex (baixeu tota la cadena de blocs de nou en cas de node podat)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Els rescanejos no són possible en el mode de poda. Caldrà que utilitzeu -reindex, que tornarà a baixar la cadena de blocs sencera.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Error: s'ha produït un error intern fatal. Vegeu debug.log per a més detalls</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Comissió (en %s/kB) per afegir a les transaccions que envieu (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>S'està podant la cadena de blocs...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Executa en segon pla com a programa dimoni i accepta ordres</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>No s'ha pogut iniciar el servidor HTTP. Vegeu debug.log per a més detalls.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Els desenvolupadors %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Una taxa de tarifes (en %s / kB) que s'utilitzarà quan l'estimació de tarifes no tingui prou dades (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Acceptar les transaccions retransmeses rebudes de nodes de llista blanca, fins i tot quan no es retransmetin transaccions (per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Vincula a una adreça específica i sempre escolta-hi. Utilitza la notació [host]:port per IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>No es pot obtenir un bloqueig al directori de dades %s. %s probablement ja s'estigui executant.</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Elimina totes les transaccions del moneder i només recupera aquelles de la cadena de blocs a través de -rescan a l'inici</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>S'ha produït un error en llegir %s. Totes les claus es llegeixen correctament, però les dades de la transacció o les entrades de la llibreta d'adreces podrien faltar o ser incorrectes.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Excloeu la informació de depuració d'una categoria. Pot ser usat juntament amb -debug = 1 per generar registres de depuració per a totes les categories, excepte una o més categories especificades.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Executa una ordre quan una transacció del moneder canviï (%s en cmd es canvia per TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Transaccions addicionals a conservar en memòria per a les reconstruccions de blocs compactes (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Si aquest bloc es troba a la cadena, suposa que ell i els seus avantpassats són vàlids i que es pot saltar la seva verificació d'script (0 per verificar-ho tot, per defecte: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Màxim ajust mitjà permès per desplaçament del temps d'iguals. La perspectiva local del temps pot estar influenciada per iguals avançats o endarrerits per aquesta quantitat. (per defecte: %u segons)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Tarifes totals màximes (en %s) per utilitzar-les en una sola transacció de monedes o transaccions en brut; establir-lo massa baix pot cancel·lar grans transaccions (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Comproveu que la data i hora de l'ordinador són correctes. Si el rellotge és incorrecte, %s no funcionarà correctament.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Contribueix si trobes %s útil. Visita %s per obtenir més informació sobre el programari.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Consulta adreces d'iguals a través de la cerca del DNS, si tens poques adreces (per defecte: 1, tret que s'utilitzi la connexió)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Redueix els requisits d'emmagatzematge permetent la poda (supressió) dels blocs antics. Això permet executar la crida RPC prunblockclass per eliminar blocs específics i permet la poda automàtica de blocs antics si es proporciona una mida de destinació en MiB. Aquest mode és incompatible amb -txindex i -rescan. Advertència: si torna a iniciar aquesta configuració, cal que torneu a baixar la cadena de blocs completa. (per defecte: 0 = desactivar poda de blocs, 1 = permetre la poda manual a través de RPC,&gt;%u = poda automàticament els fitxers de bloc per quedar sota la mida de destinació especificada en MiB)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Defineix el nombre de fils de verificació d'scripts (%u a %d, 0 = auto, &lt;0 = deixa tants nuclis lliures, per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>La base de dades de blocs conté un bloc que sembla ser del futur. Això pot ser degut a que la data i l'hora del vostre ordinador s'estableix incorrectament. Només reconstruïu la base de dades de blocs si esteu segur que la data i l'hora del vostre ordinador són correctes</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Aquesta és una versió de pre-llançament - utilitza-la sota la teva responsabilitat - No usar per a minería o aplicacions de compra-venda</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Aquesta és la tarifa de transacció que podeu descartar si el canvi és menor que el polsim a aquest nivell</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>No es poden reproduir els blocs. Haureu de reconstruir la base de dades mitjançant -reindex- chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>No es pot rebobinar la base de dades a un estat de pre-bifurcament. Haureu de tornar a descarregar la cadena de blocks</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Utilitzeu UPnP per mapejar el port d'escolta (per defecte: 1 quan s'escolta i no -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Nom d'usuari i contrasenya resumida per a les connexions JSON-RPC. El camp &lt;userpw&gt; ve en el format: &lt;USERNAME&gt; : &lt;SALT&gt; $ &lt;HASH&gt; . Un script canònic python està inclòs a share / rpcuser. El client es connecta normalment utilitzant rpcuser =&lt;USERNAME&gt;/ rpcpassword =&lt;PASSWORD&gt; com a parell d'arguments. Aquesta opció es pot especificar diverses vegades</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>El moneder no crearà transaccions que infringeixin els límits de la cadena mempool (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Avís: la xarxa no sembla que hi estigui plenament d'acord. Alguns miners sembla que estan experimentant problemes.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Avís: sembla que no estem plenament d'acord amb els nostres iguals! Podria caler que actualitzar l'aplicació, o potser que ho facin altres nodes.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Si es guarda el mempool quan s'apaga i es carrega quan es reinicia (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d dels últims 100 blocs tenen una versió inesperada</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s està malmès, el rescat de les dades ha fallat</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool ha de tenir almenys %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; pot ser:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Accepta connexions de fora (per defecte: 1 si no -proxy o -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Afegiu un comentari a la cadena de l'agent d'usuari</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Intent de recuperació de claus privades d'una cartera malmesa a l'inici</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opcions de la creació de blocs:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>No es pot resoldre -%s adreça: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Opcions de selecció de cadenes:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Canvieu l'índex fora de l'abast</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opcions de connexió:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>S'ha detectat una base de dades de blocs corrupta</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opcions de depuració/proves:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>No carreguis el moneder i inhabilita les crides RPC del moneder</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Voleu reconstruir la base de dades de blocs ara?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Habiliteu publicar el bloc de hash a &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Habilita la publicació de la transacció hash a &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Habiliteu publicar el bloc cru a &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Habiliteu publicar transaccions en cru a &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Activa el reemplaçament de transaccions al grup de memòria (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error carregant la base de dades de blocs</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error inicialitzant l'entorn de la base de dades del moneder %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Error carregant %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>S'ha produït un error en carregar %s: el moneder és corrupte</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>S'ha produït un error en carregar %s: el moneder requereix una versió més nova de %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Error carregant la base de dades del bloc</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Error en obrir la base de dades de blocs</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Error: Espai al disc baix!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Ha fallat escoltar a qualsevol port. Feu servir -listen=0 si voleu fer això.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>S'està important...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>No s'ha trobat el bloc de gènesi o és incorrecte. El directori de dades de la xarxa és incorrecte?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>S'ha produït un error en la verificació de sanejament d'inicialització. S'està tancant %s.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Import invàlid per -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Import invàlid per -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Import invàlid per -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Manteniu el grup de memòria de la transacció per sota de &lt;n&gt; megabytes (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>S'estan carregant les adreces P2P ...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Carregant banlist ...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Ubicació de la cookie auth (per defecte: directori de dades)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>No hi ha suficient descriptors de fitxers disponibles.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Només connecta als nodes de la xarxa &lt;net&gt; (ipv4, ipv6 o onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Imprimiu aquest missatge d'ajuda i sortiu</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Imprimir versió i sortir</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>La poda no es pot configurar amb un valor negatiu.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>El mode de poda és incompatible amb -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Reconstrueix l'estat de la cadena i l'índex de blocs des dels fitxers blk*.dat del disc</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Reconstrueix l'estat de cadena dels blocs actualment indexats</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Reproduïnt blocs ...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Rebobinant blocs...</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Defineix la mida de la memòria cau de la base de dades en megabytes (%d a %d, per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Especifica un fitxer de moneder (dins del directori de dades)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>El codi font està disponible a %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>La tarifa de transacció i el càlcul del canvi no han funcionat</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>No es pot enllaçar a %s en aquest ordinador. %s probablement ja s'estigui executant.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>S'ha ignorat l'argument no admès -benchmark , feu servir -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>S'ha ignorat l'argument no admès -debugnet, feu servir -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>S'ha trobat un argument -tor no acceptat. Feu servir -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Categoria de registre no admesa %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Actualització de la base de dades UTXO</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Utilitza UPnP per a mapejar el port d'escolta (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Utilitza la cadena de proves</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>El comentari de l'agent d'usuari (%s) conté caràcters insegurs.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>S'estan verificant els blocs...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Opcions de depuració/proves del moneder:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Cal reescriure el moneder: reinicieu %s per a completar-ho</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opcions de moneder:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Permet les connexions JSON-RPC d'una font específica. Vàlid per a &lt;ip&gt; són una IP individual (p. ex., 1.2.3.4), una xarxa / màscara de xarxa (p. ex., 1.2.3.4/255.255.255.0) o una xarxa/CIDR (p. ex., 1.2.3.4/24). Es pot especificar aquesta opció moltes vegades</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Vincula l'adreça donada i posa a la llista blanca els iguals que s'hi connectin. Feu servir la notació [host]:port per a IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Crea fitxers nous amb els permisos per defecte del sistema, en comptes de l'umask 077 (només efectiu amb la funcionalitat de moneder inhabilitada)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Descobreix l'adreça IP pròpia (per defecte: 1 quan s'escolta i no -externalip o -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Error: ha fallat escoltar les connexions entrants (l'escoltament ha retornat l'error %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Executa l'ordre quan es rebi un avís rellevant o veiem una forquilla molt llarga (%s en cmd és reemplaçat per un missatge)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Les comissions (en %s/kB) més petites que això es consideren tarifes zero per a la retransmissió, la mineria i la creació de transaccions (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Si no s'especifica una paytxfee (comissió de transacció de pagament), inclogueu suficient comissió per tal que les transaccions comencin a confirmar-se en una mitja de n blocs (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Import no vàlid per a -maxtxfee=&lt;amount&gt;: '%s' (cal que sigui com a mínim la comissió de minrelay de %s per evitar que les comissions s'encallin)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Mida màxima de les dades en les transaccions de l'operador en què confiem i en les meves (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Genera a l'atzar credencials per a cada connexió proxy. Això habilita l'aïllament del flux de Tor (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>L'import de la transacció és massa petit per enviar-la després que se'n dedueixi la comissió</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Els iguals en la llista blanca no poden ser bandejats per DoS i es transmetran sempre llurs transaccions, fins i tot si ja són a la mempool. Això és útil, p. ex., per a una passarel·la</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Cal que torneu a construir la base de dades fent servir -reindex per tornar al mode no podat. Això tornarà a baixar la cadena de blocs sencera</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Accepta sol·licituds REST públiques (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Crea automàticament el servei ocult de Tor (per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Connecta a través del proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>S'ha produït un error en carregar %s: no es pot desactivar HD en un moneder HD ja existent</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Error en llegir la base de dades, tancant.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>S'ha produït un error en actualitzar la base de dades de chainstate</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importa blocs de fitxers externs blk000?.dat a l'inici de l'apliació</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informació</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Adreça o nom de l'ordinador -onion no vàlida: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Adreça o nom de l'ordinador -proxy no vàlida: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Import no vàlid per a -paytxfee=&lt;amount&gt;: «%s» (ha de ser com a mínim %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>S'ha especificat una màscara de xarxa no vàlida a -whitelist: «%s»</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Manté com a màxim &lt;n&gt; transaccions no connectables en memòria (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Cal especificar un port amb -whitebind: «%s»</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Opcions de transmissió del node:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opcions del servidor RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reducció de -maxconnections de %d a %d, a causa de les limitacions del sistema.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Reescaneja la cadena de blocs per a les operacions del moneder que falten a l'inici</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Envia informació de traça/depuració a la consola en comptes del fitxer debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Mostra totes les opcions de depuració (ús: --help  --help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Redueix el fitxer debug.log durant l'inici del client (per defecte: 1 quan no -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Ha fallat la signatura de la transacció</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>L'import de la transacció és massa petit per pagar-ne una comissió</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Això és programari experimental.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Contrasenya del port de control Tor (per defecte: buida)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Port de control de tor si l'escolta onion està  habilitada (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Import de la transacció massa petit</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transacció massa gran per a la política de comissions</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>La transacció és massa gran</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>No s'ha pogut vincular a %s en aquest ordinador (la vinculació ha retornat l'error %s)</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Actualitza el moneder al format més recent a l'inici de l'aplicació</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nom d'usuari per a connexions JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>S'està verificant el moneder(s) ...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Avís</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Advertència: regles noves desconegudes activades (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Si s'ha d'operar en un mode de blocs només (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Heu de reconstruir la base de dades mitjançant -reindex per canviar -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Se suprimeixen totes les transaccions del moneder...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Opcions de notificació ZeroMQ:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Contrasenya per a connexions JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Executa l'ordre quan el millor bloc canviï (%s en cmd es reemplaça per un resum de bloc)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permet consultes DNS per a -addnode, -seednode i -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = manté les metadades de les tx, p. ex., propietari del compte i informació de sol·licitud del pagament, 2 = prescindeix de les metadades de les tx)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee especificat molt alt! Comissions tan grans podrien pagar-se en una única transacció.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Enllaçar a una adreça determinada per escoltar les connexions JSON-RPC. Aquesta opció s'ignora a menys que -rpcallowip també s'especifiqui. El port és opcional i sobreescriu -rpcport. Utilitzeu la notació [host]:port per a IPv6. Aquesta opció es pot especificar diverses vegades (per defecte: 127.0.0.1 i :: 1, és a dir, localhost, o si s'ha especificat -rpcallowip, 0.0.0.0 i :: és a dir, totes les adreces)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>No mantingueu les transaccions en el mempool més de &lt;n&gt; hora (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Bytes equivalents per sigop en transaccions de relé i mineria (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>S'ha produït un error en carregar %s: no es pot activar HD en un moneder existent que no sigui HD</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>S'ha produït un error en carregar el moneder %s. El paràmetre -wallet només ha d'especificar un nom de fitxer (no una ruta d'accés).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Les comissions (en %s/kB) més petites que això es consideren comissions zero per a la creació de transaccions (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Forçar la retranmissió de les transaccions de nodes de llista blanca encara que infringeixin la política de retransmissió local (per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Com d'exhaustiva és la verificació de blocs del -checkblocks (0-4, per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Manté un índex complet de transaccions, utilitzat per la crida rpc getrawtransaction (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Nombre de segons necessaris perquè els iguals de comportament qüestionable puguin tornar a connectar-se (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Informació de sortida de la depuració (per defecte: %u, proporcionar &lt;category&gt; és opcional)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Estableix la serialització de transaccions crues o bloc hexadecimal retornat en mode no verbose, no-segwit (0) o segwit(1) (per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Suport de filtrat de blocs i transaccions amb filtres bloom (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>El tipus de tarifa (en %s/kB) que indica la vostra tolerància per descartar el canvi afegint-lo a la tarifa (per defecte: %s). Nota: Es descarta una sortida si és polsim a aquesta tarifa, però sempre anem a descartar la quota de relleu de polsim i una tarifa de descartat per sobre d'això està limitada per l'estimació de tarifes per al destí més llarg</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Aquesta és la tarifa de transacció que podeu pagar quan les estimacions de tarifes no estan disponibles.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Aquest producte inclou programari desenvolupat pel Projecte OpenSSL per al seu ús en OpenSSL Toolkit %s i programari criptogràfic escrit per Eric Young i el programari UPnP escrit per Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>La longitud total de la cadena de la versió de xarxa (%i) supera la longitud màxima (%i). Redueix el nombre o la mida de uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Intenta mantenir el trànsit sortint sota l'objectiu indicat (a MiB per 24 hores), 0 = sense límit (per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>S'ha trobat l'argument -socks no compatible. L'establiment de la versió SOCKS ja no és possible, només es permeten els servidors proxy SOCKS5.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>S'ha ignorat l'argument no acceptat -whitelistalways, utilitza -whitelistrelay i/o -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Utilitza un proxy SOCKS4 apart per a arribar als iguals a través de serveis ocults de Tor (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Advertència: s'està minant versions de blocs desconegudes. És possible que s'estiguin aplicant regles desconegudes</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Advertència: el moender està malmès, les dades es recuperen! Original %s guardat com a %s en %s; si el vostre saldo o transaccions són incorrectes, haureu de restaurar des d'una còpia de seguretat.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Nodes de llista blanca s'estan connectant des de l'adreça IP indicada (p. Ex. 1.2.3.4) o la xarxa notificada per CIDR (p. Ex. 1.2.3.0/24). Es pot especificar diverses vegades.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s està especificat molt alt!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Demana sempre les adreces dels iguals a través de consultes DNS (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>S'ha produït un error en carregar el moneder %s. El nom del fitxer -wallet ha de ser un fitxer normal.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>S'ha produït un error en carregar el moneder %s. S'ha especificat un nom de fitxer duplicat -wallet.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>S'ha produït un error en carregar el moneder %s. Caràcters no vàlids al nom del fitxer -wallet.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Quants blocs per comprovar a l'inici (per defecte: %u, 0 = tots)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Inclou l'adreça IP a la sortida de depuració (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>S'ha acabat el Keypool, si us plau, crideu a keypoolrefill primer</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escolta les connexions JSON-RPC en &lt;port&gt; (per defecte: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escolta les connexions en &lt;port&gt; (per defecte: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Manté com a màxim &lt;n&gt; connexions a iguals (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Fes que el moneder faci difusió de les transaccions</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Memòria intermèdia màxima de recepció per connexió, &lt;n&gt;*1000 bytes (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Memòria intermèdia màxima d'enviament per connexió, &lt;n&gt;*1000 bytes (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Posa davant de la sortida de depuració una marca horària (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Retransmet i mina les transaccions de l'operador (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Retransmet multisig no P2SH (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Defineix la mida clau disponible a &lt;n&gt; (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Estableix el pes màxim del bloc BIP141 (per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Defineix el nombre de fils a crides de servei RPC (per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Especifica el fitxer de configuració (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Especifica el temps d'espera de la connexió en milisegons (mínim: 1, per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Especifica el fitxer pid (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Gasta el canvi no confirmat en enviar les transaccions (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>S'estan iniciant els fils de la xarxa...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>El moneder evitarà pagar menys de la comissió de tramesa mínima</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Aquesta és la comissió mínima de transacció que paga en cada transacció.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Aquesta és la comissió de transacció que pagareu si envieu una transacció.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Llindar per a desconnectar els iguals de comportament qüestionable (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Els imports de la transacció no han de ser negatius</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>La transacció té massa temps d'una cadena de mempool</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>La transacció ha de tenir com a mínim un destinatari</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Xarxa desconeguda especificada a -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Balanç insuficient</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>S'està carregant l'índex de blocs...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>S'està carregant el moneder...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>No es pot reduir la versió del moneder</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>S'està reescanejant...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Ha acabat la càrrega</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ca@valencia.ts",
    "content": "<TS language=\"ca@valencia\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Feu clic dret per a editar l'adreça o l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crea una nova adreça</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nova</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copia l'adreça seleccionada al porta-retalls del sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copia</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Tanca</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Elimina l'adreça sel·leccionada actualment de la llista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporta les dades de la pestanya actual a un fitxer</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporta</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Elimina</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Trieu una adreça on voleu enviar monedes</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Trieu l'adreça on voleu rebre monedes</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>T&amp;ria</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>S'estan enviant les adreces</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>S'estan rebent les adreces</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estes són les vostres adreces de Bitcoin per enviar els pagaments. Sempre reviseu l'import i l'adreça del destinatari abans de transferir monedes.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Estes són les vostres adreces Bitcoin per rebre pagaments. Es recomana utilitzar una adreça nova de recepció per a cada transacció.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copia l'adreça</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copia l'&amp;etiqueta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Edita</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exporta la llista d'adreces</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fitxer de separació amb comes (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>L'exportació ha fallat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>S'ha produït un error en guardar la llista d'adreces a %1. Torneu-ho a provar.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreça</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diàleg de contrasenya</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Introduïu una contrasenya</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nova contrasenya</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repetiu la nova contrasenya</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Introduïu la contrasenya nova al moneder.&lt;br/&gt;Utilitzeu una contrasenya de &lt;b&gt;deu o més caràcters aleatoris&lt;/b&gt;, o &lt;b&gt;vuit o més paraules&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Encripta el moneder</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Esta operació requereix la contrasenya del moneder per a desbloquejar-lo.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloqueja el moneder</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Esta operació requereix la contrasenya del moneder per desencriptar-lo.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Desencripta el moneder</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Canvia la contrasenya</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Introduïu la contrasenya antiga i la contrasenya nova al moneder.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirma l'encriptació del moneder</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Avís: si encripteu el vostre moneder i perdeu la contrasenya, &lt;b&gt;PERDREU TOTS ELS VOSTRES BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Esteu segur que voleu encriptar el vostre moneder?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Moneder encriptat</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANT: Tota copia de seguretat que hàgeu realitzat hauria de ser reemplaçada pel, recentment generat, fitxer encriptat del moneder.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>L'encriptació del moneder ha fallat</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>L'encriptació del moneder ha fallat per un error intern. El moneder no ha estat encriptat.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>La contrasenya introduïda no coincideix.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>El desbloqueig del moneder ha fallat</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La contrasenya introduïda per a desencriptar el moneder és incorrecta.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>La desencriptació del moneder ha fallat</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>La contrasenya del moneder ha estat modificada correctament.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Avís: Les lletres majúscules estan activades!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signa el &amp;missatge...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>S'està sincronitzant amb la xarxa ...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Panorama general</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostra el panorama general del moneder</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaccions</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Cerca a l'historial de transaccions</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>I&amp;x</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Ix de l'aplicació</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Quant a &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostra informació sobre Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opcions...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Encripta el moneder...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Realitza una còpia de seguretat del moneder...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Canvia la contrasenya...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Adreces d'e&amp;nviament...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Adreces de &amp;recepció</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Obri un &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>S'estan reindexant els blocs al disc...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Envia monedes a una adreça Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Realitza una còpia de seguretat del moneder a una altra ubicació</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Canvia la contrasenya d'encriptació del moneder</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Finestra de depuració</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Obri la consola de diagnòstic i depuració</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifica el missatge...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Moneder</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Envia</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Rep</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mostra / Amaga</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostra o amaga la finestra principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Encripta les claus privades pertanyents al moneder</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signa el missatges amb la seua adreça de Bitcoin per provar que les poseeixes</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifiqueu els missatges per assegurar-vos que han estat signats amb una adreça Bitcoin específica.</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fitxer</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuració</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ajuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra d'eines de les pestanyes</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Sol·licita pagaments (genera codis QR i bitcoin: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostra la llista d'adreces d'enviament i etiquetes utilitzades</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Mostra la llista d'adreces de recepció i etiquetes utilitzades</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Obri una bitcoin: sol·licitud d'URI o pagament</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opcions de la &amp;línia d'ordes</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 darrere</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>El darrer bloc rebut ha estat generat fa %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Les transaccions a partir d'això no seran visibles.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Avís</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informació</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Al dia</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>S'està posant al dia ...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Import: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipus: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etiqueta: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adreça: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transacció enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacció entrant</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>El moneder està &lt;b&gt;encriptat&lt;/b&gt; i actualment &lt;b&gt;desbloquejat&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>El moneder està &lt;b&gt;encriptat&lt;/b&gt; i actualment &lt;b&gt;bloquejat&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Ha tingut lloc un error fatal. Bitcoin no pot continuar executant-se de manera segura i es tancará.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selecció de moneda</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantitat:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Import:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comissió</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polsim:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Comissió posterior:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Canvi:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(des)selecciona-ho tot</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Mode arbre</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Mode llista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Rebut amb l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Rebut amb l'adreça</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmacions</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmat</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar adreça </translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID de transacció</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Bloqueja sense gastar</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Desbloqueja sense gastar</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copia la quantitat</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copia la comissió</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copia la comissió posterior</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copia els bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copia el polsim</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copia el canvi</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 bloquejada)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>sí</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Pot variar +/- %1 satoshi(s) per entrada.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>canvia de %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(canvia)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Edita l'adreça</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>L'etiqueta associada amb esta entrada de llista d'adreces</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>L'adreça associada amb esta entrada de llista d'adreces. Només es pot modificar per a les adreces d'enviament.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adreça</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nova adreça de recepció.</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nova adreça d'enviament</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Edita les adreces de recepció</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Edita les adreces d'enviament</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>L'adreça introduïda «%1» no és una adreça de Bitcoin vàlida.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>L'adreça introduïda «%1» ja és present a la llibreta d'adreces.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>No s'ha pogut desbloquejar el moneder.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Ha fallat la generació d'una nova clau.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Es crearà un nou directori de dades.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nom</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>El directori ja existeix. Afig %1 si vols crear un nou directori en esta ubicació.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>El camí ja existeix i no és cap directori.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>No es pot crear el directori de dades ací.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versió</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opcions de línia d'ordes</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Ús:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>Opcions de la línia d'ordes</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opcions d'interfície:</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Defineix un idioma, per exemple «de_DE» (per defecte: preferències locals de sistema)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Inicia minimitzat</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Defineix certificats arrel SSL per a la sol·licitud de pagament (per defecte: -sistema-)</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Vos donem la benviguda</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Utilitza el directori de dades per defecte</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Utilitza un directori de dades personalitzat:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Error: el directori de dades «%1» especificat no pot ser creat.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulari</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Últim temps de bloc</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Amaga</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Obri un URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Obri una sol·licitud de pagament des d'un URI o un fitxer</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Selecciona un fitxer de sol·licitud de pagament</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Selecciona el fitxer de sol·licitud de pagament per obrir</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opcions</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Mida de la memòria cau de la base de &amp;dades</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Nombre de fils de &amp;verificació d'scripts</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Adreça IP del proxy (p. ex. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimitza en comptes d'eixir de l'aplicació quan la finestra es tanca. Quan s'habilita esta opció l'aplicació es tancara només quan se selecciona Ix del menú. </translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL de terceres parts (p. ex. explorador de blocs) que apareix en la pestanya de transaccions com elements del menú contextual. %s en l'URL es reemplaçat pel resum de la transacció. Diferents URL estan separades per una barra vertical |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Opcions de línies d'orde active que sobreescriuen les opcions de dalt:</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Reestableix totes les opcions del client.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Reestableix les opcions</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Xarxa</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = deixa tants nuclis lliures)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Moneder</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Activa les funcions de &amp;control de les monedes</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Si inhabiliteu la despesa d'un canvi sense confirmar, el canvi d'una transacció no pot ser utilitzat fins que la transacció no tinga com a mínim una confirmació. Això també afecta com es calcula el vostre balanç.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Gasta el canvi sense confirmar</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Obri el port del client de Bitcoin al router de forma automàtica. Això només funciona quan el router implementa UPnP i l'opció està activada.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Port obert amb &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Connecta a la xarxa Bitcoin a través d'un proxy SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Connecta a través d'un proxy SOCKS5 (proxy per defecte):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP del proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port del proxy (per exemple 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Finestra</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Mostra només la icona de la barra en minimitzar la finestra.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimitza a la barra d'aplicacions en comptes de la barra de tasques</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimitza en tancar</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Pantalla</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Llengua de la interfície d'usuari:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unitats per mostrar els imports en:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Selecciona la unitat de subdivisió per defecte per mostrar en la interfície quan s'envien monedes.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Si voleu mostrar les funcions de control de monedes o no.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;D'acord</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancel·la</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>Per defecte</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>cap</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmeu el reestabliment de les opcions</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Cal reiniciar el client per activar els canvis.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Es pararà el client. Voleu procedir?</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Amb este canvi cal un reinici del client.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>L'adreça proxy introduïda és invalida.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulari</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Bitcoin un cop s'ha establit connexió, però este proces no s'ha completat encara.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Només lectura:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponible:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>El balanç que podeu gastar actualment</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pendent:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transaccions que encara han de confirmar-se i que encara no compten en el balanç que es pot gastar</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Immadur:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Balanç minat que encara no ha madurat</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Balances</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>El balanç total actual</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>El vostre balanç actual en adreces de només lectura</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Que es pot gastar:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transaccions recents</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Transaccions sense confirmar a adreces de només lectura</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Balanç minat en adreces de només lectura que encara no ha madurat</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Balanç total actual en adreces de només lectura</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Error en la sol·licitud de pagament</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>No es pot iniciar bitcoin: gestor clica-per-pagar</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Gestió d'URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>L'URL de recuperació de la sol·licitud de pagament no és vàlida: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Adreça de pagament no vàlida %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>L'URI no pot ser analitzat! Això pot ser a causa d'una adreça de Bitcoin no vàlida o per paràmetres URI amb mal format.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Gestió de fitxers de les sol·licituds de pagament</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>No es pot llegir el fitxer de la sol·licitud de pagament. Això pot ser causat per un fitxer de sol·licitud de pagament no vàlid.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>La sol·licitud de pagament s'ha rebutjat</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>La xarxa de la sol·licitud de pagament no coincideix amb la xarxa del client.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>La sol·licitud de pagament ha vençut.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>La sol·licitud de pagament no està inicialitzada.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>No s'accepten sol·licituds de pagament no verificades a scripts de pagament personalitzats.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Sol·licitud de pagament no vàlida.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>L'import de pagament sol·licitat %1 és massa petit (es considera polsim).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Reemborsament de %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>La sol·licitud de pagament %1 és massa gran (%2 bytes, permés %3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Error en comunicar amb %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>No es pot analitzar la sol·licitud de pagament!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Mala resposta del servidor %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Error en la sol·licitud de xarxa</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Pagament reconegut</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent d'usuari</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Node/Servei</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviat</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Rebut</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Introduïu una adreça de Bitcoin (p. ex. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Cap</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 i %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconegut</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Error: El directori de dades especificat «%1» no existeix.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Error: no es pot analitzar el fitxer de configuració: %1. Feu servir només la sintaxi clau=valor.</translation>\n    </message>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Guarda la imatge...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copia la imatge</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Guarda el codi QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imatge PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versió del client</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informació</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Finestra de depuració</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Utilitzant BerkeleyDB versió</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>&amp;Temps d'inici</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Xarxa</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nom</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Nombre de connexions</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Cadena de blocs</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Nombre de blocs actuals</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Rebut</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviat</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Iguals</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Seleccioneu un igual per mostrar informació detallada.</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direcció</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versió</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent d'usuari</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Serveis</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Puntuació de bandeig</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Temps de connexió</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Darrer enviament</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Darrera recepció</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Temps de ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Diferència horària</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Últim temps de bloc</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Obri</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>Trà&amp;nsit de la xarxa</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totals</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Dins:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Fora:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Fitxer de registre de depuració</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Neteja la consola</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>a través de %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>mai</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Entrant</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Eixint</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Sí</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>No</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Desconegut</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Im&amp;port:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Missatge:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Un missatge opcional que s'adjuntarà a la sol·licitud de pagament, que es mostrarà quan s'òbriga la sol·licitud. Nota: El missatge no s'enviarà amb el pagament per la xarxa Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Una etiqueta opcional que s'associarà amb la nova adreça receptora.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Utilitzeu este formulari per sol·licitar pagaments. Tots els camps són &lt;b&gt;opcionals&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Un import opcional per sol·licitar. Deixeu-ho en blanc o zero per no sol·licitar cap import específic.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Netejar tots els camps del formulari.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Neteja</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historial de pagaments sol·licitats</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Sol·licitud de pagament</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Mostra la sol·licitud seleccionada (fa el mateix que el doble clic a una entrada)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostra</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Esborra les entrades seleccionades de la llista</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Esborra</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copia el missatge</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Codi QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copia l'&amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copia l'&amp;adreça</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Guarda la imatge...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Sol·licita un pagament a %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informació de pagament</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreça</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Missatge</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI resultant massa llarga, intenta reduir el text per a la etiqueta / missatge</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Error en codificar l'URI en un codi QR.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Missatge</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(sense missatge)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Envia monedes</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Característiques de control de les monedes</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Entrades...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>seleccionat automàticament</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fons insuficients!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantitat:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Import:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comissió</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Comissió posterior:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Canvi:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Si s'activa això, però l'adreça de canvi està buida o bé no és vàlida, el canvi s'enviarà a una adreça generada de nou.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Personalitza l'adreça de canvi</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Comissió de transacció</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Tria...</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>redueix els paràmetres de comissió</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Si la comissió personalitzada es defineix a 1000 satoshis i la transacció és de només 250 bytes, llavors «per kilobyte» només es paguen 250 satoshis en una comissió, mentre que amb la de «total com a mínim» es pagarien 1000 satoshis. Per a transaccions superiors al kilobyte, en tots dos casos es paga per kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Amaga</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>No hi ha cap problema en pagar només la comissió mínima sempre que hi haja menys volum de transacció que espai en els blocs. Però tingueu present que això pot acabar en una transacció que mai es confirme una vegada hi haja més demanda de transaccions de bitcoins que la xarxa puga processar.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(llegiu l'indicador de funció)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recomanada:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Personalitzada:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(No s'ha inicialitzat encara la comissió intel·ligent. Normalment pren uns pocs blocs...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Envia a múltiples destinataris al mateix temps</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Afig &amp;destinatari</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Netejar tots els camps del formulari.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polsim:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Neteja-ho &amp;tot</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balanç:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirma l'acció d'enviament</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>E&amp;nvia</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copia la quantitat</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copia la comissió</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copia la comissió posterior</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copia els bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copia el polsim</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copia el canvi</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 a %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Esteu segur que ho voleu enviar?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>S'ha afegit una taxa de transacció</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>o</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirma l'enviament de monedes</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>L'adreça de destinatari no és vàlida. Torneu-la a comprovar.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>L'import a pagar ha de ser major que 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>L'import supera el vostre balanç.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>El total excedeix el teu balanç quan s'afig la comissió a la transacció %1.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>S'ha trobat una adreça duplicada: cal utilitzar les adreces només un cop cada vegada.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Ha fallat la creació de la transacció!</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Una comissió superior a %1 es considera una comissió absurdament alta.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>La sol·licitud de pagament ha vençut.</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Avís: adreça Bitcoin no vàlida</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Avís: adreça de canvi desconeguda</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Q&amp;uantitat:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Paga &amp;a:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Tria les adreces fetes servir amb anterioritat</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Això és un pagament normal.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>L'adreça Bitcoin on enviar el pagament</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Apega l'adreça del porta-retalls</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Elimina esta entrada</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>La comissió es deduirà de l'import que s'enviarà. El destinatari rebrà menys bitcoins que les que introduïu al camp d'import. Si se seleccionen múltiples destinataris, la comissió es dividirà per igual.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>S&amp;ubstreu la comissió de l'import</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Missatge:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Esta és una sol·licitud de pagament no autenticada.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Esta és una sol·licitud de pagament autenticada.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Introduïu una etiqueta per a esta adreça per afegir-la a la llista d'adreces utilitzades</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Un missatge que s'ha adjuntat al bitcoin: URI que s'emmagatzemarà amb la transacció per a la vostra referència. Nota: el missatge no s'enviarà a través de la xarxa Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Paga a:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Introduïu una etiqueta per a esta adreça per afegir-la a la llibreta d'adreces</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Sí</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>No apagueu l'ordinador fins que no desaparegui esta finestra.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signatures - Signa / verifica un missatge</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Signa el missatge</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Podeu signar missatges/acords amb les vostres adreces per provar que rebeu les bitcoins que s'hi envien. Aneu amb compte no signar res que siga vague o aleatori, perquè en alguns atacs de suplantació es pot provar que hi signeu la vostra identitat. Només signeu aquelles declaracions completament detallades en què hi esteu d'acord. </translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>L'adreça Bitcoin amb què signar el missatge</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Tria les adreces fetes servir amb anterioritat</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Apega l'adreça del porta-retalls</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Introduïu ací el missatge que voleu signar</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signatura</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copia la signatura actual al porta-retalls del sistema</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Signa el missatge per provar que ets propietari d'esta adreça Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Signa el &amp;missatge</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Neteja tots els camps de clau</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Neteja-ho &amp;tot</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifica el missatge</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Introduïu l'adreça del receptor, el missatge (assegureu-vos de copiar els salts de línia, espais, tabuladors, etc. exactament) i signatura de sota per verificar el missatge. Tingueu cura de no llegir més en la signatura del que està al missatge signat, per evitar ser enganyat per un atac d'home-en-el-mig. Tingueu en compte que això només demostra que la part que signa rep amb l'adreça, i no es pot provar l'enviament de qualsevol transacció!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>L'adreça Bitcoin amb què va ser signat el missatge</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verificar el missatge per assegurar-se que ha estat signat amb una adreça Bitcoin específica</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifica el &amp;missatge</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Neteja tots els camps de verificació de missatge</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Feu clic a «Signa el missatge» per a generar una signatura</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>L'adreça introduïda no és vàlida.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Comproveu l'adreça i torneu-ho a provar.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>L'adreça introduïda no referencia a cap clau.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>El desbloqueig del moneder ha estat cancelat.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>La clau privada per a la adreça introduïda no està disponible.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>La signatura del missatge ha fallat.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Missatge signat.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>La signatura no s'ha pogut descodificar.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Comproveu la signatura i torneu-ho a provar.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>La signatura no coincideix amb el resum del missatge.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Ha fallat la verificació del missatge.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Missatge verificat.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Obert fins %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/fora de línia</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/sense confirmar</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 confirmacions</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Estat</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, encara no ha estat emés correctement</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Font</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generat</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Des de</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconegut</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>A</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>Adreça pròpia</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>només lectura</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiqueta</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Crèdit</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>no acceptat</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Dèbit</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Dèbit total</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Crèdit total</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Comissió de transacció</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Import net</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Missatge</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comentar</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID de transacció</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Mercader</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Les monedes generades han de madurar %1 blocs abans de poder ser gastades. Quan genereu este bloc, es farà saber a la xarxa per tal d'afegir-lo a la cadena de blocs. Si no pot fer-se lloc a la cadena, el seu estat canviarà a «no acceptat» i no es podrà gastar. Això pot passar ocasionalment si un altre node genera un bloc en un marge de segons respecte al vostre.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Informació de depuració</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transacció</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Entrades</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>cert</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>fals</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Este panell mostra una descripció detallada de la transacció</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Obert fins %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Fora de línia</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Sense confirmar</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirmant (%1 de %2 confirmacions recomanades)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmat (%1 confirmacions)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>En conflicte</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Immadur (%1 confirmacions, serà disponible després de %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Este bloc no ha estat rebut per cap altre node i probablement no serà acceptat!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generat però no acceptat</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Rebut amb</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Rebut de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviat a</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pagament a un mateix</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minat</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>només lectura</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Estat de la transacció. Desplaceu-vos sobre este camp per mostrar el nombre de confirmacions.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Data i hora en que la transacció va ser rebuda.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipus de transacció.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Si està implicada o no una adreça només de lectura en la transacció.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Intenció/propòsit de la transacció definida per l'usuari.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Import extret o afegit del balanç.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Tot</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Hui</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Esta setmana</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Este mes</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>El mes passat</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Enguany</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Rang...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Rebut amb</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviat a</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>A un mateix</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minat</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Altres</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Import mínim</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar adreça </translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID de transacció</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Editar etiqueta</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Mostra detalls de la transacció</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exporta l'historial de transacció</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fitxer de separació amb comes (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmat</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Només de lectura</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreça</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>L'exportació ha fallat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>S'ha produït un error en provar de guardar l'historial de transacció a %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exportació amb èxit</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>L'historial de transaccions s'ha guardat correctament a %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Rang:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>a</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unitat en què mostrar els imports. Feu clic per seleccionar una altra unitat.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>No s'ha carregat cap moneder.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Envia monedes</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporta</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporta les dades de la pestanya actual a un fitxer</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Còpia de seguretat del moneder</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Dades del moneder (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Ha fallat la còpia de seguretat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>S'ha produït un error en provar de guardar les dades del moneder a %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>La còpia de seguretat s'ha realitzat correctament</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>S'han guardat les dades del moneder correctament a %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opcions:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especifica el directori de dades</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Connecta al node per obtindre les adreces de les connexions, i desconnecta</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especifiqueu la vostra adreça pública</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Accepta la línia d'ordes i ordes JSON-RPC </translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Error: s'ha produït un error intern fatal. Vegeu debug.log per a més detalls</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>S'està podant l'emmagatzemament de blocs...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Executa en segon pla com a programa dimoni i accepta ordes</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Vincula a una adreça específica i sempre escolta-hi. Utilitza la notació [host]:port per IPv6</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Elimina totes les transaccions del moneder i només recupera aquelles de la cadena de blocs a través de -rescan a l'inici</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Executa una orde quan una transacció del moneder canvie (%s en cmd es canvia per TxID)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Defineix el nombre de fils de verificació d'scripts (%u a %d, 0 = auto, &lt;0 = deixa tants nuclis lliures, per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Esta és una versió de pre-llançament - utilitza-la sota la teva responsabilitat - No usar per a minería o aplicacions de compra-venda</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Avís: la xarxa no pareix que hi estiga plenament d'acord. Alguns miners pareix que estan experimentant problemes.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Avís: pareix que no estem plenament d'acord amb els nostres iguals! Podria caldre que actualitzar l'aplicació, o potser que ho facen altres nodes.</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; pot ser:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Accepta connexions de fora (per defecte: 1 si no -proxy o -connect)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opcions de la creació de blocs:</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opcions de connexió:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>S'ha detectat una base de dades de blocs corrupta</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opcions de depuració/proves:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>No carreguis el moneder i inhabilita les crides RPC del moneder</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Voleu reconstruir la base de dades de blocs ara?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error carregant la base de dades de blocs</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error inicialitzant l'entorn de la base de dades del moneder %s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Error carregant la base de dades del bloc</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Error en obrir la base de dades de blocs</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Error: Espai al disc baix!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Ha fallat escoltar a qualsevol port. Feu servir -listen=0 si voleu fer això.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>S'està important...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>No s'ha trobat el bloc de gènesi o és incorrecte. El directori de dades de la xarxa és incorrecte?</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>No hi ha suficient descriptors de fitxers disponibles.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Només connecta als nodes de la xarxa &lt;net&gt; (ipv4, ipv6 o onion)</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>La poda no es pot configurar amb un valor negatiu.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>El mode de poda és incompatible amb -txindex.</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Defineix la mida de la memòria cau de la base de dades en megabytes (%d a %d, per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Especifica un fitxer de moneder (dins del directori de dades)</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Utilitza UPnP per a mapejar el port d'escolta (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>S'estan verificant els blocs...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opcions de moneder:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Permet les connexions JSON-RPC d'una font específica. Vàlid per a &lt;ip&gt; són una IP individual (p. ex., 1.2.3.4), una xarxa / màscara de xarxa (p. ex., 1.2.3.4/255.255.255.0) o una xarxa/CIDR (p. ex., 1.2.3.4/24). Es pot especificar esta opció moltes vegades</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Vincula l'adreça donada i posa a la llista blanca els iguals que s'hi connecten. Feu servir la notació [host]:port per a IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Crea fitxers nous amb els permisos per defecte del sistema, en comptes de l'umask 077 (només efectiu amb la funcionalitat de moneder inhabilitada)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Descobreix l'adreça IP pròpia (per defecte: 1 quan s'escolta i no -externalip o -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Error: ha fallat escoltar les connexions entrants (l'escoltament ha retornat l'error %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Executa l'orde quan es reba un avís rellevant o veiem una forquilla molt llarga (%s en cmd és reemplaçat per un missatge)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Si no s'especifica una paytxfee (comissió de transacció de pagament), inclogueu suficient comissió per tal que les transaccions comencen a confirmar-se en una mitja de n blocs (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Import no vàlid per a -maxtxfee=&lt;amount&gt;: '%s' (cal que siga com a mínim la comissió de minrelay de %s per evitar que les comissions s'encallin)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Mida màxima de les dades en les transaccions de l'operador en què confiem i en les meues (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Genera a l'atzar credencials per a cada connexió proxy. Això habilita l'aïllament del flux de Tor (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>L'import de la transacció és massa petit per enviar-la després que se'n deduïsca la comissió</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Els iguals en la llista blanca no poden ser bandejats per DoS i es transmetran sempre llurs transaccions, fins i tot si ja són a la mempool. Això és útil, p. ex., per a una passarel·la</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Cal que torneu a construir la base de dades fent servir -reindex per tornar al mode no podat. Això tornarà a baixar la cadena de blocs sencera</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Accepta sol·licituds REST públiques (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Connecta a través del proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Error en llegir la base de dades, tancant.</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informació</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Import no vàlid per a -paytxfee=&lt;amount&gt;: «%s» (ha de ser com a mínim %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>S'ha especificat una màscara de xarxa no vàlida a -whitelist: «%s»</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Manté com a màxim &lt;n&gt; transaccions no connectables en memòria (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Cal especificar un port amb -whitebind: «%s»</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Opcions de transmissió del node:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opcions del servidor RPC:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Envia informació de traça/depuració a la consola en comptes del fitxer debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Mostra totes les opcions de depuració (ús: --help  --help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Redueix el fitxer debug.log durant l'inici del client (per defecte: 1 quan no -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Ha fallat la signatura de la transacció</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>L'import de la transacció és massa petit per pagar-ne una comissió</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Això és programari experimental.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Import de la transacció massa petit</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transacció massa gran per a la política de comissions</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>La transacció és massa gran</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>No s'ha pogut vincular a %s en este ordinador (la vinculació ha retornat l'error %s)</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nom d'usuari per a connexions JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Avís</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Cal que reconstruïu la base de dades fent servir -reindex per canviar -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Se suprimeixen totes les transaccions del moneder...</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Contrasenya per a connexions JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Executa l'orde quan el millor bloc canvie (%s en cmd es reemplaça per un resum de bloc)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permet consultes DNS per a -addnode, -seednode i -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = manté les metadades de les tx, p. ex., propietari del compte i informació de sol·licitud del pagament, 2 = prescindeix de les metadades de les tx)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Com d'exhaustiva és la verificació de blocs del -checkblocks (0-4, per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Manté un índex complet de transaccions, utilitzat per la crida rpc getrawtransaction (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Nombre de segons necessaris perquè els iguals de comportament qüestionable puguen tornar a connectar-se (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Informació d'eixida de la depuració (per defecte: %u, proporcionar &lt;category&gt; és opcional)</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Utilitza un proxy SOCKS4 apart per a arribar als iguals a través de serveis ocults de Tor (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Demana sempre les adreces dels iguals a través de consultes DNS (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Quants blocs per comprovar a l'inici (per defecte: %u, 0 = tots)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Inclou l'adreça IP a l'eixida de depuració (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escolta les connexions JSON-RPC en &lt;port&gt; (per defecte: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escolta les connexions en &lt;port&gt; (per defecte: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Manté com a màxim &lt;n&gt; connexions a iguals (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Fes que el moneder faça difusió de les transaccions</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Memòria intermèdia màxima de recepció per connexió, &lt;n&gt;*1000 bytes (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Memòria intermèdia màxima d'enviament per connexió, &lt;n&gt;*1000 bytes (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Posa davant de l'eixida de depuració una marca horària (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Retransmet i mina les transaccions de l'operador (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Retransmet multisig no P2SH (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Defineix la mida clau disponible a &lt;n&gt; (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Defineix el nombre de fils a crides de servei RPC (per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Especifica el fitxer de configuració (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Especifica el temps d'espera de la connexió en milisegons (mínim: 1, per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Especifica el fitxer pid (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Gasta el canvi no confirmat en enviar les transaccions (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Llindar per a desconnectar els iguals de comportament qüestionable (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Xarxa desconeguda especificada a -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Balanç insuficient</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>S'està carregant l'índex de blocs...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>S'està carregant el moneder...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>No es pot reduir la versió del moneder</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>S'està reescanejant...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Ha acabat la càrrega</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ca_ES.ts",
    "content": "<TS language=\"ca_ES\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Feu clic dret per a editar l'adreça o l'etiquetaccn</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crea una nueva dirección</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuevo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copia l'adreça seleccionada al porta-retalls del sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copia</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Tanca</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Elimina l'adreça sel·leccionada actualment de la llista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporta les dades de la pestanya actual a un fitxer</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporta</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Elimina</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Trieu l'adreça on enviar les monedes</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Trieu l'adreça on rebre les monedes</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Tria</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Adreces d'enviament</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Adreces de recepció</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Aquestes són les vostres adreces de Bitcoin per enviar els pagaments. Sempre reviseu l'import i l'adreça del destinatari abans de transferir monedes.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Aquestes són les vostres adreces Bitcoin per rebre pagaments. Es recomana utilitzar una adreça nova de recepció per a cada transacció.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copia l'adreça</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copia l'eti&amp;queta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Edita</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exporta la llista d'adreces</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fitxer separat per comes (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>L'exportació ha fallat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>S'ha produït un error en desar la llista d'adreces a %1. Torneu-ho a provar.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreça</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diàleg de contrasenya</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Introduïu una contrasenya</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nova contrasenya</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repetiu la nova contrasenya</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Introduïu la contrasenya nova al moneder.&lt;br/&gt;Utilitzeu una contrasenya de &lt;b&gt;deu o més caràcters aleatoris&lt;/b&gt;, o &lt;b&gt;vuit o més paraules&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Encripta el monedero</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Aquesta operació requereix la contrasenya del moneder per a desbloquejar-lo.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloquea el monedero</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Aquesta operació requereix la contrasenya del moneder per desencriptar-lo.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Desencripta el monedero</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Cambia la contraseña</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Introduïu la contrasenya antiga i la contrasenya nova al moneder.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirma l'encriptació del moneder</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Avís: si encripteu el vostre moneder i perdeu la contrasenya, &lt;b&gt;PERDREU TOTS ELS VOSTRES BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Esteu segur que voleu encriptar el vostre moneder?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Moneder encriptat</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>Ara es tancarà el %1 per finalitzar el procés d'encriptació. Recordeu que encriptar el vostre moneder no garanteix que les vostres bitcoins no puguin ser robades per programari maliciós que infecti l'ordinador.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANT: Tota copia de seguretat que hàgiu realitzat hauria de ser reemplaçada pel, recentment generat, fitxer encriptat del moneder. Per motius de seguretat, les còpies de seguretat anteriors del fitxer de moneder no encriptat esdevindran inusables tan aviat com començar a utilitzar el nou moneder encriptat.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>L'encriptació del moneder ha fallat</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>L'encriptació del moneder ha fallat per un error intern. El moneder no ha estat encriptat.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Les contrasenyes introduïdes no coincideixen.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>El desbloqueig del moneder ha fallat</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La contrasenya introduïda per a desencriptar el moneder és incorrecta.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>La desencriptació del moneder ha fallat</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>La contrasenya del moneder ha estat modificada correctament.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Avís: Les lletres majúscules estan activades!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP / Màscara de xarxa</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Bandejat fins</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signa el &amp;missatge...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>S'està sincronitzant amb la xarxa ...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Panorama general</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostra el panorama general del moneder</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaccions</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Cerca a l'historial de transaccions</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>S&amp;urt</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Surt de l'aplicació</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>Qu&amp;ant al %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Mosta informació sobre el %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Quant a &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostra informació sobre Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opcions...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modifica les opcions de configuració de %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Encripta el moneder...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Realitza una còpia de seguretat del moneder...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Canvia la contrasenya...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Adreces d'e&amp;nviament...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Adreces de &amp;recepció...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Obre un &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Feu clic per inhabilitar l'activitat de la xarxa.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>S'ha inhabilitat l'activitat de la xarxa.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Feu clic per tornar a habilitar l'activitat de la xarxa.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Sincronitzant capçaleres (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>S'estan reindexant els blocs al disc...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Envia monedes a una adreça Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Realitza una còpia de seguretat del moneder a una altra ubicació</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Canvia la contrasenya d'encriptació del moneder</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Finestra de depuració</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Obre la consola de diagnòstic i depuració</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifica el missatge...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Moneder</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Envia</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Rep</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mostra / Amaga</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostra o amaga la finestra principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Encripta les claus privades pertanyents al moneder</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signa el missatges amb la seva adreça de Bitcoin per provar que les poseeixes</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifiqueu els missatges per assegurar-vos que han estat signats amb una adreça Bitcoin específica.</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fitxer</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuració</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ajuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra d'eines de les pestanyes</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Sol·licita pagaments (genera codis QR i bitcoin: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostra la llista d'adreces d'enviament i etiquetes utilitzades</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Mostra la llista d'adreces de recepció i etiquetes utilitzades</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Obre una bitcoin: sol·licitud d'URI o pagament</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opcions de la &amp;línia d'ordres</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>S'estan indexant els blocs al disc...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>S'estan processant els blocs al disc...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 darrere</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>El darrer bloc rebut ha estat generat fa %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Les transaccions a partir d'això no seran visibles.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Avís</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>&amp;Informació</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Al dia</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Mostra el missatge d'ajuda del %1 per obtenir una llista amb les possibles opcions de línia d'ordres de Bitcoin</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>Client de %1</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Connectant als iguals...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>S'està posant al dia ...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Import: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipus: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etiqueta: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adreça: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transacció enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacció entrant</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>La generació de la clau HD és &lt;b&gt;habilitada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>La generació de la clau HD és &lt;b&gt;inhabilitada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>El moneder està &lt;b&gt;encriptat&lt;/b&gt; i actualment &lt;b&gt;desbloquejat&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>El moneder està &lt;b&gt;encriptat&lt;/b&gt; i actualment &lt;b&gt;bloquejat&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>S'ha produït un error fatal. Bitcoin no pot continuar amb seguretat i finalitzarà.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selecció de moneda</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantitat:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Import:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comissió:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polsim:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Comissió posterior:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Canvi:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(des)selecciona-ho tot</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Mode arbre</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Mode llista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Rebut amb l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Rebut amb l'adreça</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmacions</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmat</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copia l'adreça</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copia l'ID de transacció</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Bloqueja sense gastar</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Desbloqueja sense gastar</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copia la quantitat</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copia la comissió</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copia la comissió posterior</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copia els bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copia el polsim</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copia el canvi</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 bloquejada)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>sí</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Aquesta etiqueta es torna vermella si cap recipient rep un import inferior al llindar de polsim actual.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Pot variar en +/- %1 satoshi(s) per entrada.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>canvia de %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(canvia)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Edita l'adreça</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>L'etiqueta associada amb aquesta entrada de llista d'adreces</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>L'adreça associada amb aquesta entrada de llista d'adreces. Només es pot modificar per a les adreces d'enviament.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adreça</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nova adreça de recepció</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nova adreça d'enviament</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Edita l'adreça de recepció</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Edita l'adreça d'enviament</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>L'adreça introduïda «%1» no és una adreça de Bitcoin vàlida.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>L'adreça introduïda «%1» ja és present a la llibreta d'adreces.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>No s'ha pogut desbloquejar el moneder.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Ha fallat la generació d'una clau nova.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Es crearà un nou directori de dades.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nom</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>El directori ja existeix. Afegeix %1 si vols crear un nou directori en aquesta ubicació.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>El camí ja existeix i no és cap directori.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>No es pot crear el directori de dades aquí.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versió</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Quant al %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opcions de línia d'ordres</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Ús:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>Opcions de la línia d'ordres</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opcions d'interfície d'usuari:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Trieu el directori de dades a l'inici (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Defineix la llengua, per exemple «de_DE» (per defecte: la definida pel sistema)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Inicia minimitzat</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Defineix els certificats arrel SSL per a la sol·licitud de pagament (per defecte: els del sistema)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Mostra la pantalla de benvinguda a l'inici (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Reinicialitza tots els canvis de configuració fets des de la interfície gràfica</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Us donem la benvinguda</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Us donem la benvinguda a %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Com és la primera vegada que s'executa el programa, podeu triar on %1 emmagatzemarà les dades.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Utilitza el directori de dades per defecte</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Utilitza un directori de dades personalitzat:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Aproximadament %1GB de dades seran emmagetzamades en aquest directori.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>El moneder també serà emmagatzemat en aquest directori.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Error: el directori de dades «%1» especificat no pot ser creat.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulari</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Desconegut...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Últim temps de bloc</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progrés</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>s'està calculant...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Temps estimat restant fins sincronitzat</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Amaga</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Desconegut. Sincronització de les capçaleres (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Obre un URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Obre una sol·licitud de pagament des d'un URI o un fitxer</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Selecciona un fitxer de sol·licitud de pagament</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Seleccioneu el fitxer de sol·licitud de pagament per obrir</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opcions</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Inicieu %1 automàticament després d'entrar en el sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Inicia %1 en l'entrada al sistema</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Mida de la memòria cau de la base de &amp;dades</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Nombre de fils de &amp;verificació d'scripts</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Adreça IP del proxy (p. ex. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimitza en comptes de sortir de l'aplicació quan la finestra es tanca. Quan s'habilita aquesta opció l'aplicació es tancara només quan se selecciona Surt del menú. </translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL de terceres parts (p. ex. explorador de blocs) que apareix en la pestanya de transaccions com elements del menú contextual. %s en l'URL es reemplaçat pel resum de la transacció. Diferents URL estan separades per una barra vertical |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Opcions de línies d'ordre active que sobreescriuen les opcions de dalt:</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Obre el fitxer de configuració</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Reestableix totes les opcions del client.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Reestableix les opcions</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Xarxa</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = deixa tants nuclis lliures)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Moneder</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Activa les funcions de &amp;control de les monedes</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Si inhabiliteu la despesa d'un canvi sense confirmar, el canvi d'una transacció no pot ser utilitzat fins que la transacció no tingui com a mínim una confirmació. Això també afecta com es calcula el vostre balanç.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Gasta el canvi sense confirmar</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Obre el port del client de Bitcoin al router de forma automàtica. Això només funciona quan el router implementa UPnP i l'opció està activada.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Port obert amb &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Connecta a la xarxa Bitcoin a través d'un proxy SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Connecta a través d'un proxy SOCKS5 (proxy per defecte):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP del proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port del proxy (per exemple 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Utilitzat per arribar als iguals mitjançant:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Conectar a la red de Bitcoin a través de un proxy SOCKS5 per als serveis ocults de Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Finestra</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Mostra només la icona de la barra en minimitzar la finestra.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimitza a la barra d'aplicacions en comptes de la barra de tasques</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimitza en tancar</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Pantalla</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Llengua de la interfície d'usuari:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Aquí es pot definir la llengua de la interfície d'usuari. Aquest paràmetre tindrà efecte en reiniciar el %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unitats per mostrar els imports en:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Selecciona la unitat de subdivisió per defecte per mostrar en la interfície quan s'envien monedes.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Si voleu mostrar les funcions de control de monedes o no.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;D'acord</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancel·la</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>Per defecte</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>cap</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmeu el reestabliment de les opcions</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Cal reiniciar el client per activar els canvis.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>S'aturarà el client. Voleu procedir?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opcions de configuració</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>No s'ha pogut obrir el fitxer de configuració.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Amb aquest canvi cal un reinici del client.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>L'adreça proxy introduïda és invalida.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulari</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>La informació mostrada pot no estar al día. El teu moneder es sincronitza automàticament amb la xarxa Bitcoin un cop s'ha establert connexió, però aquest proces no s'ha completat encara.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Només lectura:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponible:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>El balanç que podeu gastar actualment</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pendent:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transaccions que encara han de confirmar-se i que encara no compten en el balanç que es pot gastar</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Immadur:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Balanç minat que encara no ha madurat</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Balances</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>El balanç total actual</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>El vostre balanç actual en adreces de només lectura</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Que es pot gastar:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transaccions recents</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Transaccions sense confirmar a adreces de només lectura</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Balanç minat en adreces de només lectura que encara no ha madurat</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Balanç total actual en adreces de només lectura</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Error de la sol·licitud de pagament</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>No es pot iniciar bitcoin: controlador click-to-pay</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Gestió d'URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>L'URL de recuperació de la sol·licitud de pagament no és vàlida: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Adreça de pagament no vàlida %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>L'URI no pot ser analitzat! Això pot ser a causa d'una adreça de Bitcoin no vàlida o per paràmetres URI amb mal format.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Gestió de fitxers de les sol·licituds de pagament</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>No es pot llegir el fitxer de la sol·licitud de pagament. Això pot ser causat per un fitxer de sol·licitud de pagament no vàlid.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>La sol·licitud de pagament s'ha rebutjat</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>La xarxa de la sol·licitud de pagament no coincideix amb la xarxa del client.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>La sol·licitud de pagament ha vençut.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>La sol·licitud de pagament no està inicialitzada.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>No s'accepten sol·licituds de pagament no verificades a scripts de pagament personalitzats.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Sol·licitud de pagament no vàlida.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>L'import de pagament sol·licitat %1 és massa petit (es considera polsim).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Reemborsament de %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>La sol·licitud de pagament %1 és massa gran (%2 bytes, permès %3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Error en comunicar amb %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>No es pot analitzar la sol·licitud de pagament!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Mala resposta del servidor %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Error en la sol·licitud de xarxa</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Pagament reconegut</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent d'usuari</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Node/Servei</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviat</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Rebut</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Introduïu una adreça de Bitcoin (p. ex. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Cap</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 i %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconegut</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Error: El directori de dades especificat «%1» no existeix.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Error: no es pot analitzar el fitxer de configuració: %1. Feu servir només la sintaxi clau=valor.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Avís: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>De&amp;sa la imatge...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copia la imatge</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Desa el codi QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imatge PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versió del client</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informació</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Finestra de depuració</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Utilitzant BerkeleyDB versió</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>&amp;Temps d'inici</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Xarxa</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nom</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Nombre de connexions</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Cadena de blocs</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Nombre de blocs actuals</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Reserva de memòria</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Nombre actual de transaccions</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Us de memoria</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Rebut</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviat</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Iguals</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Iguals bandejats</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Seleccioneu un igual per mostrar informació detallada.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>A la llista blanca</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direcció</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versió</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Bloc d'inici</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Capçaleres sincronitzades</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Blocs sincronitzats</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent d'usuari</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Serveis</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Puntuació de bandeig</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Temps de connexió</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Darrer enviament</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Darrera recepció</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Temps de ping</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>La duració d'un ping més destacat actualment.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Espera de ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Diferència horària</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Últim temps de bloc</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Obre</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>Trà&amp;nsit de la xarxa</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totals</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Dins:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Fora:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Fitxer de registre de depuració</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Neteja la consola</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hora</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;dia</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;setmana</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;any</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(id del node: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>a través de %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>mai</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Entrant</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Sortint</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Sí</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>No</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Desconegut</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Im&amp;port:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Missatge:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Un missatge opcional que s'adjuntarà a la sol·licitud de pagament, que es mostrarà quan s'obri la sol·licitud. Nota: El missatge no s'enviarà amb el pagament per la xarxa Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Una etiqueta opcional que s'associarà amb la nova adreça receptora.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Utilitzeu aquest formulari per sol·licitar pagaments. Tots els camps són &lt;b&gt;opcionals&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Un import opcional per sol·licitar. Deixeu-ho en blanc o zero per no sol·licitar cap import específic.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Esborra tots els camps del formuari.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Neteja</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historial de pagaments sol·licitats</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Sol·licitud de pagament</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Mostra la sol·licitud seleccionada (fa el mateix que el doble clic a una entrada)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostra</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Esborra les entrades seleccionades de la llista</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Esborra</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copia el missatge</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Codi QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copia l'&amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copia l'&amp;adreça</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>De&amp;sa la imatge...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Sol·licita un pagament a %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informació de pagament</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreça</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Missatge</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI resultant massa llarga, intenta reduir el text per a la etiqueta / missatge</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Error en codificar l'URI en un codi QR.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Missatge</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(sense missatge)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(no s'ha sol·licitat import)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Sol·licitat</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Envia monedes</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Característiques de control de les monedes</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Entrades...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>seleccionat automàticament</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fons insuficients!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantitat:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Import:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comissió:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Comissió posterior:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Canvi:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Si s'activa això, però l'adreça de canvi està buida o bé no és vàlida, el canvi s'enviarà a una adreça generada de nou.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Personalitza l'adreça de canvi</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Comissió de transacció</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Tria...</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>redueix els paràmetres de comissió</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Si la comissió personalitzada es defineix a 1000 satoshis i la transacció és de només 250 bytes, llavors «per kilobyte» només es paguen 250 satoshis en una comissió, mentre que amb la de «total com a mínim» es pagarien 1000 satoshis. Per a transaccions superiors al kilobyte, en tots dos casos es paga per kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Amaga</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>No hi ha cap problema en pagar només la comissió mínima sempre que hi hagi menys volum de transacció que espai en els blocs. Però tingueu present que això pot acabar en una transacció que mai es confirmi una vegada hi hagi més demanda de transaccions de bitcoins que la xarxa pugui processar.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(llegiu l'indicador de funció)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recomanada:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Personalitzada:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(No s'ha inicialitzat encara la comissió intel·ligent. Normalment pren uns pocs blocs...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Envia a múltiples destinataris al mateix temps</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Afegeix &amp;destinatari</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Esborra tots els camps del formuari.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polsim:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Neteja-ho &amp;tot</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balanç:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirma l'acció d'enviament</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>E&amp;nvia</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copia la quantitat</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copia la comissió</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copia la comissió posterior</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copia els bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copia el polsim</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copia el canvi</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blocs)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 a %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Esteu segur que ho voleu enviar?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>S'ha afegit una taxa de transacció</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Import total %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>o</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirma l'enviament de monedes</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>L'adreça del destinatari no és vàlida. Torneu-la a comprovar.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>L'import a pagar ha de ser major que 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>L'import supera el vostre balanç.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>El total excedeix el vostre balanç quan s'afegeix la comissió a la transacció %1.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>S'ha trobat una adreça duplicada: les adreces només s'haurien d'utilitzar una vegada cada una.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>La creació de la transacció ha fallat!</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Una comissió superior a %1 es considera una comissió absurdament alta.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>La sol·licitud de pagament ha vençut.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Paga només la comissió necessària de %1</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Avís: adreça Bitcoin no vàlida</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Avís: adreça de canvi desconeguda</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Q&amp;uantitat:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Paga &amp;a:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escull una adreça feta servir anteriorment</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Això és un pagament normal.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>L'adreça Bitcoin on enviar el pagament</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alta+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Enganxar adreça del porta-retalls</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Elimina aquesta entrada</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>La comissió es deduirà de l'import que s'enviarà. El destinatari rebrà menys bitcoins que les que introduïu al camp d'import. Si se seleccionen múltiples destinataris, la comissió es dividirà per igual.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>S&amp;ubstreu la comissió de l'import</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Missatge:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Aquesta és una sol·licitud de pagament no autenticada.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Aquesta és una sol·licitud de pagament autenticada.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Introduïu una etiqueta per a aquesta adreça per afegir-la a la llista d'adreces utilitzades</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Un missatge que s'ha adjuntat al bitcoin: URI que s'emmagatzemarà amb la transacció per a la vostra referència. Nota: el missatge no s'enviarà a través de la xarxa Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Paga a:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Introduïu una etiqueta per a aquesta adreça per afegir-la a la llibreta d'adreces</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Sí</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>No apagueu l'ordinador fins que no desaparegui aquesta finestra.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signatures - Signa / verifica un missatge</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Signa el missatge</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Podeu signar missatges/acords amb les vostres adreces per provar que rebeu les bitcoins que s'hi envien. Aneu amb compte no signar res que sigui vague o aleatori, perquè en alguns atacs de suplantació es pot provar que hi signeu la vostra identitat. Només signeu aquelles declaracions completament detallades en què hi esteu d'acord. </translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>L'adreça Bitcoin amb què signar el missatge</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escull una adreça feta servir anteriorment</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alta+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Enganxar adreça del porta-retalls</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Introduïu aquí el missatge que voleu signar</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signatura</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copia la signatura actual al porta-retalls del sistema</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Signa el missatge per provar que ets propietari d'aquesta adreça Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Signa el &amp;missatge</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Neteja tots els camps de clau</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Neteja-ho &amp;tot</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifica el missatge</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Introduïu l'adreça del receptor, el missatge (assegureu-vos de copiar els salts de línia, espais, tabuladors, etc. exactament) i signatura de sota per verificar el missatge. Tingueu cura de no llegir més en la signatura del que està al missatge signat, per evitar ser enganyat per un atac d'home-en-el-mig. Tingueu en compte que això només demostra que la part que signa rep amb l'adreça, i no es pot provar l'enviament de qualsevol transacció!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>L'adreça Bitcoin amb què va ser signat el missatge</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verificar el missatge per assegurar-se que ha estat signat amb una adreça Bitcoin específica</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifica el &amp;missatge</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Neteja tots els camps de verificació de missatge</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Feu clic a «Signa el missatge» per a generar una signatura</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>L'adreça introduïda no és vàlida.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Comproveu l'adreça i torneu-ho a provar.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>L'adreça introduïda no referencia a cap clau.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>El desbloqueig del moneder ha estat cancelat.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>La clau privada per a la adreça introduïda no està disponible.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>La signatura del missatge ha fallat.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Missatge signat.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>La signatura no s'ha pogut descodificar.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Comproveu la signatura i torneu-ho a provar.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>La signatura no coincideix amb el resum del missatge.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Ha fallat la verificació del missatge.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Missatge verificat.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Obert fins %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/fora de línia</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandonada</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/sense confirmar</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 confirmacions</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Estat</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, encara no ha estat emès correctement</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Font</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generada</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>De</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconegut</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>A</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>adreça pròpia</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>només lectura</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiqueta</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Crèdit</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>no acceptat</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Dèbit</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Dèbit total</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Crèdit total</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Comissió de transacció</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Import net</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Missatge</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comentari</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID de la transacció</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Mercader</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Les monedes generades han de madurar %1 blocs abans de poder ser gastades. Quan genereu aquest bloc, es farà saber a la xarxa per tal d'afegir-lo a la cadena de blocs. Si no pot fer-se lloc a la cadena, el seu estat canviarà a «no acceptat» i no es podrà gastar. Això pot passar ocasionalment si un altre node genera un bloc en un marge de segons respecte al vostre.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Informació de depuració</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transacció</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Entrades</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Import</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>cert</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>fals</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Aquest panell mostra una descripció detallada de la transacció</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detalls per %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Obert fins %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Fora de línia</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Sense confirmar</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandonada</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirmant (%1 de %2 confirmacions recomanades)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmat (%1 confirmacions)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>En conflicte</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Immadur (%1 confirmacions, serà disponible després de %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Aquest bloc no ha estat rebut per cap altre node i probablement no serà acceptat!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generat però no acceptat</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Rebuda amb</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Rebuda de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviada a</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pagament a un mateix</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minada</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>només lectura</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sense etiqueta)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Estat de la transacció. Desplaceu-vos sobre aquest camp per mostrar el nombre de confirmacions.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Data i hora en que la transacció va ser rebuda.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipus de transacció.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Si està implicada o no una adreça només de lectura en la transacció.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Intenció/propòsit de la transacció definida per l'usuari.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Import extret o afegit del balanç.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Tot</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Avui</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Aquesta setmana</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Aquest mes</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>El mes passat</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Enguany</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Rang...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Rebuda amb</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviada a</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>A un mateix</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minada</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Altres</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Import mínim</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copia l'adreça</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia l'etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'import</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copia l'ID de transacció</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copia la transacció crua</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copia els detalls complets de la transacció</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Editar etiqueta</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Mostra detalls de la transacció</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exporta l'historial de transacció</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fitxer separat per comes (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmat</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Només de lectura</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreça</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>L'exportació ha fallat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>S'ha produït un error en provar de desar l'historial de transacció a %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exportació amb èxit</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>L'historial de transaccions s'ha desat correctament a %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Rang:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>a</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unitat en què mostrar els imports. Feu clic per seleccionar una altra unitat.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>No s'ha carregat cap moneder.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Envia monedes</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporta</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporta les dades de la pestanya actual a un fitxer</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Còpia de seguretat del moneder</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Dades del moneder (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Ha fallat la còpia de seguretat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>S'ha produït un error en provar de desar les dades del moneder a %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>La còpia de seguretat s'ha realitzat correctament</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>S'han desat les dades del moneder correctament a %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opcions:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especifica el directori de dades</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Connecta al node per obtenir les adreces de les connexions, i desconnecta</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especifiqueu la vostra adreça pública</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Accepta la línia d'ordres i ordres JSON-RPC </translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Si no es proporciona &lt;category&gt; o si &lt;category&gt; = 1, treu a la sortida tota la informació de depuració.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Poda configurada per sota el mínim de %d MiB. Utilitzeu un nombre superior.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Poda: la darrera sincronització del moneder va més enllà de les dades podades. Cal que activeu -reindex (baixeu tota la cadena de blocs de nou en cas de node podat)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Els rescanejos no són possible en el mode de poda. Caldrà que utilitzeu -reindex, que tornarà a baixar la cadena de blocs sencera.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Error: s'ha produït un error intern fatal. Vegeu debug.log per a més detalls</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Comissió (en %s/kB) per afegir a les transaccions que envieu (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>S'està podant la cadena de blocs...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Executa en segon pla com a programa dimoni i accepta ordres</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>No s'ha pogut iniciar el servidor HTTP. Vegeu debug.log per a més detalls.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Vincula a una adreça específica i sempre escolta-hi. Utilitza la notació [host]:port per IPv6</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Elimina totes les transaccions del moneder i només recupera aquelles de la cadena de blocs a través de -rescan a l'inici</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Executa una ordre quan una transacció del moneder canviï (%s en cmd es canvia per TxID)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Defineix el nombre de fils de verificació d'scripts (%u a %d, 0 = auto, &lt;0 = deixa tants nuclis lliures, per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Aquesta és una versió de pre-llançament - utilitza-la sota la teva responsabilitat - No usar per a minería o aplicacions de compra-venda</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Avís: la xarxa no sembla que hi estigui plenament d'acord. Alguns miners sembla que estan experimentant problemes.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Avís: sembla que no estem plenament d'acord amb els nostres iguals! Podria caler que actualitzar l'aplicació, o potser que ho facin altres nodes.</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; pot ser:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Accepta connexions de fora (per defecte: 1 si no -proxy o -connect)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opcions de la creació de blocs:</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opcions de connexió:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>S'ha detectat una base de dades de blocs corrupta</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opcions de depuració/proves:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>No carreguis el moneder i inhabilita les crides RPC del moneder</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Voleu reconstruir la base de dades de blocs ara?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error carregant la base de dades de blocs</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error inicialitzant l'entorn de la base de dades del moneder %s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Error carregant la base de dades del bloc</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Error en obrir la base de dades de blocs</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Error: Espai al disc baix!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Ha fallat escoltar a qualsevol port. Feu servir -listen=0 si voleu fer això.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>S'està important...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>No s'ha trobat el bloc de gènesi o és incorrecte. El directori de dades de la xarxa és incorrecte?</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>No hi ha suficient descriptors de fitxers disponibles.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Només connecta als nodes de la xarxa &lt;net&gt; (ipv4, ipv6 o onion)</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>La poda no es pot configurar amb un valor negatiu.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>El mode de poda és incompatible amb -txindex.</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Defineix la mida de la memòria cau de la base de dades en megabytes (%d a %d, per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Especifica un fitxer de moneder (dins del directori de dades)</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Utilitza UPnP per a mapejar el port d'escolta (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Utilitza la cadena de proves</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>S'estan verificant els blocs...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Opcions de depuració/proves del moneder:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Cal reescriure el moneder: reinicieu %s per a completar-ho</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opcions de moneder:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Permet les connexions JSON-RPC d'una font específica. Vàlid per a &lt;ip&gt; són una IP individual (p. ex., 1.2.3.4), una xarxa / màscara de xarxa (p. ex., 1.2.3.4/255.255.255.0) o una xarxa/CIDR (p. ex., 1.2.3.4/24). Es pot especificar aquesta opció moltes vegades</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Vincula l'adreça donada i posa a la llista blanca els iguals que s'hi connectin. Feu servir la notació [host]:port per a IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Crea fitxers nous amb els permisos per defecte del sistema, en comptes de l'umask 077 (només efectiu amb la funcionalitat de moneder inhabilitada)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Descobreix l'adreça IP pròpia (per defecte: 1 quan s'escolta i no -externalip o -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Error: ha fallat escoltar les connexions entrants (l'escoltament ha retornat l'error %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Executa l'ordre quan es rebi un avís rellevant o veiem una forquilla molt llarga (%s en cmd és reemplaçat per un missatge)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Si no s'especifica una paytxfee (comissió de transacció de pagament), inclogueu suficient comissió per tal que les transaccions comencin a confirmar-se en una mitja de n blocs (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Import no vàlid per a -maxtxfee=&lt;amount&gt;: '%s' (cal que sigui com a mínim la comissió de minrelay de %s per evitar que les comissions s'encallin)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Mida màxima de les dades en les transaccions de l'operador en què confiem i en les meves (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Genera a l'atzar credencials per a cada connexió proxy. Això habilita l'aïllament del flux de Tor (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>L'import de la transacció és massa petit per enviar-la després que se'n dedueixi la comissió</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Els iguals en la llista blanca no poden ser bandejats per DoS i es transmetran sempre llurs transaccions, fins i tot si ja són a la mempool. Això és útil, p. ex., per a una passarel·la</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Cal que torneu a construir la base de dades fent servir -reindex per tornar al mode no podat. Això tornarà a baixar la cadena de blocs sencera</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Accepta sol·licituds REST públiques (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Connecta a través del proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Error en llegir la base de dades, tancant.</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>&amp;Informació</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Import no vàlid per a -paytxfee=&lt;amount&gt;: «%s» (ha de ser com a mínim %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>S'ha especificat una màscara de xarxa no vàlida a -whitelist: «%s»</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Manté com a màxim &lt;n&gt; transaccions no connectables en memòria (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Cal especificar un port amb -whitebind: «%s»</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Opcions de transmissió del node:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opcions del servidor RPC:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Envia informació de traça/depuració a la consola en comptes del fitxer debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Mostra totes les opcions de depuració (ús: --help  --help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Redueix el fitxer debug.log durant l'inici del client (per defecte: 1 quan no -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Ha fallat la signatura de la transacció</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>L'import de la transacció és massa petit per pagar-ne una comissió</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Això és programari experimental.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Import de la transacció massa petit</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transacció massa gran per a la política de comissions</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>La transacció és massa gran</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>No s'ha pogut vincular a %s en aquest ordinador (la vinculació ha retornat l'error %s)</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nom d'usuari per a connexions JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Avís</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Avís: regles noves desconegudes activades (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Cal que reconstruïu la base de dades fent servir -reindex per canviar -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Se suprimeixen totes les transaccions del moneder...</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Contrasenya per a connexions JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Executa l'ordre quan el millor bloc canviï (%s en cmd es reemplaça per un resum de bloc)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permet consultes DNS per a -addnode, -seednode i -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = manté les metadades de les tx, p. ex., propietari del compte i informació de sol·licitud del pagament, 2 = prescindeix de les metadades de les tx)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Com d'exhaustiva és la verificació de blocs del -checkblocks (0-4, per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Manté un índex complet de transaccions, utilitzat per la crida rpc getrawtransaction (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Nombre de segons necessaris perquè els iguals de comportament qüestionable puguin tornar a connectar-se (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Informació de sortida de la depuració (per defecte: %u, proporcionar &lt;category&gt; és opcional)</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Utilitza un proxy SOCKS4 apart per a arribar als iguals a través de serveis ocults de Tor (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Demana sempre les adreces dels iguals a través de consultes DNS (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Quants blocs per comprovar a l'inici (per defecte: %u, 0 = tots)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Inclou l'adreça IP a la sortida de depuració (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escolta les connexions JSON-RPC en &lt;port&gt; (per defecte: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escolta les connexions en &lt;port&gt; (per defecte: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Manté com a màxim &lt;n&gt; connexions a iguals (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Fes que el moneder faci difusió de les transaccions</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Memòria intermèdia màxima de recepció per connexió, &lt;n&gt;*1000 bytes (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Memòria intermèdia màxima d'enviament per connexió, &lt;n&gt;*1000 bytes (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Posa davant de la sortida de depuració una marca horària (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Retransmet i mina les transaccions de l'operador (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Retransmet multisig no P2SH (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Defineix la mida clau disponible a &lt;n&gt; (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Defineix el nombre de fils a crides de servei RPC (per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Especifica el fitxer de configuració (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Especifica el temps d'espera de la connexió en milisegons (mínim: 1, per defecte: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Especifica el fitxer pid (per defecte: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Gasta el canvi no confirmat en enviar les transaccions (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>S'estan iniciant els fils de la xarxa...</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Llindar per a desconnectar els iguals de comportament qüestionable (per defecte: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Els imports de la transacció no han de ser negatius</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>La transacció ha de tenir com a mínim un destinatari</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Xarxa desconeguda especificada a -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Balanç insuficient</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>S'està carregant l'índex de blocs...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>S'està carregant el moneder...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>No es pot reduir la versió del moneder</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>S'està reescanejant...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Ha acabat la càrrega</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_cs.ts",
    "content": "<TS language=\"cs\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Pravým tlačítkem myši můžeš upravit označení adresy</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Vytvořit novou adresu</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nová/&amp;Nový/&amp;Nové</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Zkopíruj tuto adresu do schránky</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Zkopírovat</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Zavřít</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Smazat tuto adresu ze seznamu</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportuj data z aktuálního panelu do souboru</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportovat</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Smaž</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Zvol adresu, na kterou pošleš coiny</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Zvol adresu na příjem mincí</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Zvol</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Odesílající adresy</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Přijímací adresy</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Tohle jsou tvé bitcoinové adresy pro posílání plateb. Před odesláním mincí si vždy zkontroluj částku a cílovou adresu.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Tohle jsou tvé bitcoinové adresy pro příjem plateb. Je doporučeno pro každou transakci vždy vygenerovat novou adresu.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Zkopírovat adresu</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopíruj &amp;Označ</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Upravit</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportuj seznam adres</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>CSV formát (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportování selhalo</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Při ukládání seznamu adres do %1 se přihodila nějaká chyba. Zkus to prosím znovu.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Označení</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez označení)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Změna hesla</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Zadej platné heslo</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Zadej nové heslo</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Totéž heslo ještě jednou</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Zobrazit heslo</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Zadej nové heslo k peněžence.&lt;br/&gt;Použij &lt;b&gt;alespoň deset náhodných znaků&lt;/b&gt; nebo &lt;b&gt;alespoň osm slov&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Zašifruj peněženku</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>K provedení této operace musíš zadat heslo k peněžence, aby se mohla odemknout.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Odemkni peněženku</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>K provedení této operace musíš zadat heslo k peněžence, aby se mohla dešifrovat.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dešifruj peněženku</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Změň heslo</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Zadej staré a nové heslo k peněžence.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Potvrď zašifrování peněženky</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Upozornění: Pokud si zašifruješ peněženku a ztratíš či zapomeneš heslo, &lt;b&gt;PŘIJDEŠ O VŠECHNY BITCOINY&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Jsi si jistý, že chceš peněženku zašifrovat?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Peněženka je zašifrována</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 se teď ukončí, aby dokončil zašifrování. Pamatuj však, že pouhé zašifrování peněženky nemůže zabránit krádeži tvých bitcoinů malwarem, kterým se může počítač nakazit.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>DŮLEŽITÉ: Všechny předchozí zálohy peněženky by měly být nahrazeny nově vygenerovanou, zašifrovanou peněženkou. Z bezpečnostních důvodů budou předchozí zálohy nešifrované peněženky nepoužitelné, jakmile začneš používat novou zašifrovanou peněženku.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Zašifrování peněženky selhalo</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Zašifrování peněženky selhalo kvůli vnitřní chybě. Tvá peněženka tedy nebyla zašifrována.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Zadaná hesla nejsou shodná.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Nepodařilo se odemknout peněženku</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Nezadal jsi správné heslo pro dešifrování peněženky.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Nepodařilo se dešifrovat peněženku</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Heslo k peněžence bylo v pořádku změněno.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Upozornění: Caps Lock je zapnutý!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Maska</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Blokován do</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Po&amp;depiš zprávu...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronizuji se se sítí...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Přehled</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Uzel</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Zobraz celkový přehled peněženky</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakce</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Procházej historii transakcí</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Konec</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Ukonči aplikaci</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>O &amp;%1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Zobraz informace o %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>O &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Zobraz informace o Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Možnosti...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Uprav nastavení %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Zaši&amp;fruj peněženku...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Zazálohuj peněženku...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Změň &amp;heslo...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Od&amp;esílací adresy...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Př&amp;ijímací adresy...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Načíst &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Kliknutím zařízneš spojení se sítí.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Síť je vypnutá.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Kliknutím opět umožníš spojení do sítě.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synchronizuji záhlaví bloků (%1 %)…</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Vytvářím nový index bloků na disku...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Pošli mince na bitcoinovou adresu</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Zazálohuj peněženku na jiné místo</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Změň heslo k šifrování peněženky</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Ladicí okno</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Otevři ladicí a diagnostickou konzoli</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Ověř zprávu...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Peněženka</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>P&amp;ošli</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>Při&amp;jmi</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Zobraz/Skryj</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Zobraz nebo skryj hlavní okno</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Zašifruj soukromé klíče ve své peněžence</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Podepiš zprávy svými bitcoinovými adresami, čímž prokážeš, že jsi jejich vlastníkem</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Ověř zprávy, aby ses ujistil, že byly podepsány danými bitcoinovými adresami</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Soubor</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Nastavení</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>Nápověd&amp;a</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Panel s listy</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Požaduj platby (generuje QR kódy a bitcoin: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Ukaž seznam použitých odesílacích adres a jejich označení</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Ukaž seznam použitých přijímacích adres a jejich označení</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Načti bitcoin: URI nebo platební požadavek</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Ar&amp;gumenty příkazové řádky</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktivní spojení do bitcoinové sítě</numerusform><numerusform>%n aktivní spojení do bitcoinové sítě</numerusform><numerusform>%n aktivních spojení do bitcoinové sítě</numerusform><numerusform>%n aktivních spojení do bitcoinové sítě</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Vytvářím index bloků na disku...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Zpracovávám bloky na disku...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Zpracován %n blok transakční historie.</numerusform><numerusform>Zpracovány %n bloky transakční historie.</numerusform><numerusform>Zpracováno %n bloků transakční historie.</numerusform><numerusform>Zpracováno %n bloků transakční historie.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>Stahuji ještě %1 bloků transakcí</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Poslední stažený blok byl vygenerován %1 zpátky.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Následné transakce ještě nebudou vidět.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Chyba</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Upozornění</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informace</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Aktuální</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Seznam argumentů Bitcoinu pro příkazovou řádku získáš v nápovědě %1</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 klient</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Připojuji se…</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Stahuji...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Částka: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Typ: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Označení: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresa: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Odeslané transakce</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Příchozí transakce</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD generování klíčů je &lt;b&gt;zapnuté&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD generování klíčů je &lt;b&gt;vypnuté&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Peněženka je &lt;b&gt;zašifrovaná&lt;/b&gt; a momentálně &lt;b&gt;odemčená&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Peněženka je &lt;b&gt;zašifrovaná&lt;/b&gt; a momentálně &lt;b&gt;zamčená&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Stala se fatální chyba. Bitcoin nemůže bezpečně pokračovat v činnosti, a proto skončí.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Výběr mincí</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Počet:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtů:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Částka:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Poplatek:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Prach:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Čistá částka:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Drobné:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(od)označit všechny</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Zobrazit jako strom</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Vypsat jako seznam</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Částka</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Příjem na označení</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Příjem na adrese</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Potvrzení</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potvrzeno</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopíruj adresu</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopíruj její označení</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopíruj částku</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopíruj ID transakce</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Zamkni neutracené</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Odemkni k utracení</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopíruj počet</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopíruj poplatek</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopíruj čistou částku</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopíruj bajty</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopíruj prach</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopíruj drobné</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 zamčeno)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ano</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>ne</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Popisek zčervená, pokud má některý příjemce obdržet částku menší, než je aktuální práh pro prach.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Může se lišit o +/– %1 satoshi na každý vstup.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez označení)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>drobné z %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(drobné)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Uprav adresu</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Označení</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Označení spojené s tímto záznamem v seznamu adres</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Adresa spojená s tímto záznamem v seznamu adres. Lze upravovat jen pro odesílací adresy.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresa</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nová přijímací adresa</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nová odesílací adresa</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Uprav přijímací adresu</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Uprav odesílací adresu</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Zadaná adresa „%1“ není platná bitcoinová adresa.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Zadaná adresa „%1“ už v adresáři je.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Nemohu odemknout peněženku.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Nepodařilo se mi vygenerovat nový klíč.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Vytvoří se nový adresář pro data.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>název</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Adresář už existuje. Přidej %1, pokud tady chceš vytvořit nový adresář.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Taková cesta už existuje, ale není adresářem.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Tady nemůžu vytvořit adresář pro data.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>verze</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>O %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Argumenty příkazové řádky</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Užití:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>možnosti příkazové řádky</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Možnosti UI:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Zvolit při startu adresář pro data (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Nastavit jazyk, například „de_DE“ (výchozí: systémové nastavení)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Nastartovat minimalizovaně</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Nastavit kořenové SSL certifikáty pro platební požadavky (výchozí: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Zobrazit startovací obrazovku (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Vrátit všechny volby měněné v GUI na výchozí hodnoty</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Vítej</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Vítej v %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Tohle je poprvé, co spouštíš %1, takže si můžeš zvolit, kam bude ukládat svá data.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Jakmile stiskneš OK, %1 začne stahovat a zpracovávat celá %4ová bločenka (%2 GB), počínaje nejstaršími transakcemi z roku %3, kdy byl %4 spuštěn.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Prvotní synchronizace je velice náročná, a mohou se tak díky ní začít na tvém počítači projevovat dosud skryté hardwarové problémy. Pokaždé, když spustíš %1, bude stahování pokračovat tam, kde skončilo.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Pokud jsi omezil úložný prostor pro bločenku (tj. povolil její prořezávání), tak se historická data sice stáhnou a zpracují, ale následně zase smažou, aby nezabírala na disku místo.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Použij výchozí adresář pro data</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Použij tento adresář pro data:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Bude proto potřebovat do tohoto adresáře uložit nejméně %1 GB dat – tohle číslo navíc bude v průběhu času růst.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Bude proto potřebovat do tohoto adresáře uložit přibližně %1 GB dat.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 bude stahovat kopii bločenky.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Tvá peněženka bude uložena rovněž v tomto adresáři.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Chyba: Nejde vytvořit požadovaný adresář pro data „%1“.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Chyba</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB volného místa</numerusform><numerusform>%n GB volného místa</numerusform><numerusform>%n GB volného místa</numerusform><numerusform>%n GB volného místa</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(z potřebného %n GB)</numerusform><numerusform>(z potřebných %n GB)</numerusform><numerusform>(z potřebných %n GB)</numerusform><numerusform>(z potřebných %n GB)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulář</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Nedávné transakce ještě nemusí být vidět, takže stav tvého účtu nemusí být platný. Jakmile se však tvá peněženka dosynchronizuje s bitcoinovou sítí (viz informace níže), tak už bude stav správně.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Utrácení bitcoinů, které už utratily zatím nezobrazené transakce, nebude bitcoinovou sítí umožněno.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Zbývající počet bloků</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>neznámý…</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Čas posledního bloku</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Stav</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Postup za hodinu</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>propočítávám…</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Odhadovaný zbývající čas</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Skryj</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Neznámý. Synchronizuji záhlaví bloků (%1)…</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Načíst URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Načíst platební požadavek z URI nebo ze souboru</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Vyber soubor platebního požadavku</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Vyber soubor platebního požadavku k načtení</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Možnosti</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Hlavní</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Automaticky spustí %1 po přihlášení do systému.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>S&amp;pustit %1 po přihlášení do systému</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Velikost &amp;databázové cache</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Počet vláken pro &amp;verifikaci skriptů</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP adresa proxy (např. IPv4: 127.0.0.1/IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Ukazuje, jestli se zadaná výchozí SOCKS5 proxy používá k připojování k peerům v rámci tohoto typu sítě.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Použít samostatnou SOCKS5 proxy ke spojení s protějšky přes skryté služby v Toru:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Skrýt ikonu z panelu.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Gt; Skrýt ikonu na hlavním panelu</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Zavřením se aplikace minimalizuje. Pokud je tato volba zaškrtnuta, tak se aplikace ukončí pouze zvolením Konec v menu.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL třetích stran (např. block exploreru), která se zobrazí v kontextovém menu v záložce Transakce. %s v URL se nahradí hashem transakce. Více URL odděl svislítkem |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktivní argumenty z příkazové řádky, které přetloukly tato nastavení:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Otevře konfigurační soubor %1 z pracovního adresáře.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Otevřít konfigurační soubor</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Vrátí všechny volby na výchozí hodnoty.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Obnovit nastavení</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Síť</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automaticky, &lt;0 = nechat daný počet jader volný, výchozí: 0)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>P&amp;eněženka</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Pokročilá nastavení</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Povolit ruční správu &amp;mincí</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Pokud zakážeš utrácení ještě nepotvrzených drobných, nepůjde použít drobné z transakce, dokud nebude mít alespoň jedno potvrzení. Ovlivní to také výpočet stavu účtu.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Utrácet i ještě nepotvrzené drobné</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Automaticky otevře potřebný port na routeru. Tohle funguje jen za předpokladu, že tvůj router podporuje UPnP a že je UPnP povolené.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Namapovat port přes &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Přijímat spojení z venku.</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Připojí se do bitcoinové sítě přes SOCKS5 proxy.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Připojit přes SOCKS5 proxy (výchozí proxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP adresa proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>Por&amp;t:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port proxy (např. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Použije se k připojování k protějskům přes:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Připojí se do bitcoinové sítě přes SOCKS5 proxy vyhrazenou pro skryté služby v Tor síti.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>O&amp;kno</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Po minimalizaci okna zobrazí pouze ikonu v panelu.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimalizovávat do ikony v panelu</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>Za&amp;vřením minimalizovat</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>Zobr&amp;azení</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Jazyk uživatelského rozhraní:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Tady lze nastavit jazyk uživatelského rozhraní. Nastavení se projeví až po restartování %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>Je&amp;dnotka pro částky:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Zvol výchozí podjednotku, která se bude zobrazovat v programu a při posílání mincí.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Zda ukazovat možnosti pro ruční správu mincí nebo ne.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Budiž</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Zrušit</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>výchozí</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>žádné</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Potvrzení obnovení nastavení</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>K aktivaci změn je potřeba restartovat klienta.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Klient se vypne, chceš pokračovat?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Možnosti nastavení</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Konfigurační soubor slouží k nastavování uživatelsky pokročilých možností, které mají přednost před konfigurací z GUI. Parametry z příkazové řádky však mají před konfiguračním souborem přednost.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Chyba</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Konfigurační soubor nejde otevřít.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Tahle změna bude chtít restartovat klienta.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Zadaná adresa proxy je neplatná.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulář</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Zobrazené informace nemusí být aktuální. Tvá peněženka se automaticky sesynchronizuje s bitcoinovou sítí, jakmile se s ní spojí. Zatím ale ještě není synchronizace dokončena.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Sledované:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>K dispozici:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Aktuální disponibilní stav tvého účtu</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Očekáváno:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Souhrn transakcí, které ještě nejsou potvrzené a které se ještě nezapočítávají do celkového disponibilního stavu účtu</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Nedozráno:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Vytěžené mince, které ještě nejsou zralé</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Stavy účtů</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Celkem:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Celkový stav tvého účtu</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Aktuální stav účtu sledovaných adres</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Běžné:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Poslední transakce</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Nepotvrzené transakce sledovaných adres</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Vytěžené mince na sledovaných adresách, které ještě nejsou zralé</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Aktuální stav účtu sledovaných adres</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Chyba platebního požadavku</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Nemůžu spustit bitcoin: obsluha click-to-pay</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Zpracování URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Zdrojová URL platebního požadavku není platná: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Neplatná platební adresa %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>Nepodařilo se analyzovat URI! Důvodem může být neplatná bitcoinová adresa nebo poškozené parametry URI.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Zpracování souboru platebního požadavku</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Soubor platebního požadavku nejde přečíst nebo zpracovat! Příčinou může být špatný soubor platebního požadavku.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Platební požadavek byl odmítnut</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Síť platebního požadavku neodpovídá síti klienta.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Platební požadavek vypršel.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Platební požadavek není zahájený.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Neověřené platební požadavky k uživatelským platebním skriptům nejsou podporované.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Neplatný platební požadavek.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Požadovaná platební částka %1 je příliš malá (je považována za prach).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Vrácení peněz od %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Platební požadavek %1 je moc velký (%2 bajtů, povoleno %3 bajtů).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Chyba při komunikaci s %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Platební požadavek je nečitelný!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Chybná odpověď ze serveru %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Chyba síťového požadavku</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Platba potvrzena</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Typ klienta</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Uzel/Služba</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Id uzlu</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Odezva</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Odesláno</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Přijato</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Částka</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Zadej bitcoinovou adresu (např. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Žádné</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n vteřinu</numerusform><numerusform>%n vteřiny</numerusform><numerusform>%n vteřin</numerusform><numerusform>%n vteřin</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minutu</numerusform><numerusform>%n minuty</numerusform><numerusform>%n minut</numerusform><numerusform>%n minut</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n hodinu</numerusform><numerusform>%n hodiny</numerusform><numerusform>%n hodin</numerusform><numerusform>%n hodin</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n den</numerusform><numerusform>%n dny</numerusform><numerusform>%n dnů</numerusform><numerusform>%n dnů</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n týden</numerusform><numerusform>%n týdny</numerusform><numerusform>%n týdnů</numerusform><numerusform>%n týdnů</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 a %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n rok</numerusform><numerusform>%n roky</numerusform><numerusform>%n roků</numerusform><numerusform>%n roků</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 kB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 ještě bezpečně neskončil…</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>neznámo</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Chyba: Zadaný adresář pro data „%1“ neexistuje.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Chyba: Nemohu zpracovat konfigurační soubor: %1. Používej pouze syntaxi klíč=hodnota.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Chyba: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Ulož obrázek...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Kopíruj obrázek</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Ulož QR kód</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG obrázek (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>nedostupná informace</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Verze klienta</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informace</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Ladicí okno</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Obecné</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Používaná verze BerkeleyDB</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Adresář s daty</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Čas spuštění</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Síť</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Název</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Počet spojení</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Bločenka</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Aktuální počet bloků</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Transakční zásobník</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Aktuální množství transakcí</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Obsazenost paměti</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Vynulovat</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Přijato</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Odesláno</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Protějšky</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Protějšky pod klatbou (blokované)</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Vyber protějšek a uvidíš jeho detailní informace.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Vždy vítán</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Směr</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Verze</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Počáteční blok</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Aktuálně hlaviček</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Aktuálně bloků</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Typ klienta</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Otevři soubor s ladicími záznamy %1 z aktuálního datového adresáře. U velkých žurnálů to může pár vteřin zabrat.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Zmenšit písmo</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Zvětšit písmo</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Služby</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Skóre pro klatbu</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Doba spojení</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Poslední odeslání</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Poslední příjem</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Odezva</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Jak dlouho už čekám na pong.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Doba čekání na odezvu</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Nejrychlejší odezva</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Časový posun</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Čas posledního bloku</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Otevřít</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konzole</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Síťový provoz</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Součty</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Sem:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Ven:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Soubor s ladicími záznamy</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Vyčistit konzoli</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hodinu</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;den</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;týden</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;rok</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Odpoj</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Uval klatbu na</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Odblokuj</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Vítej v RPC konzoli %1.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>V historii se pohybuješ šipkami nahoru a dolů a pomocí %1 čistíš obrazovku.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>UPOZORNĚNÍ: Podvodníci jsou aktivní a říkají uživatelům, aby sem zadávali příkazy, kterými jim pak ale vykradou jejich peněženky. Nepoužívej tuhle konzoli, pokud úplně neznáš důsledky jednotlivých příkazů.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Síť je vypnutá</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(id uzlu: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nikdy</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Sem</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Ven</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Ano</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Ne</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Neznámá</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Čás&amp;tka:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Označení:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Zpráva:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Volitelná zpráva, která se připojí k platebnímu požadavku a která se zobrazí, když se požadavek otevře. Poznámka: tahle zpráva se neposílá s platbou po bitcoinové síti.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Volitelné označení, které se má přiřadit k nové adrese.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Tímto formulářem můžeš požadovat platby. Všechna pole jsou &lt;b&gt;volitelná&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Volitelná částka, kterou požaduješ. Nech prázdné nebo nulové, pokud nepožaduješ konkrétní částku.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Promaž obsah ze všech formulářových políček.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Vyčistit</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historie vyžádaných plateb</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Vyžádat platbu</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Zobraz zvolený požadavek (stejně tak můžeš přímo na něj dvakrát poklepat)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Zobrazit</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Smaž zvolené požadavky ze seznamu</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Smazat</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Kopíruj URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopíruj její označení</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopíruj zprávu</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopíruj částku</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR kód</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>&amp;Kopíruj URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopíruj &amp;adresu</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Ulož obrázek...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Platební požadavek: %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informace o platbě</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Částka</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Označení</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Zpráva</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Výsledná URI je příliš dlouhá, zkus zkrátit text označení/zprávy.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Chyba při kódování URI do QR kódu.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Označení</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Zpráva</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez označení)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(bez zprávy)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(bez požadované částky)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Požádáno</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Pošli mince</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Možnosti ruční správy mincí</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Vstupy...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automaticky vybrané</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Nedostatek prostředků!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Počet:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtů:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Částka:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Poplatek:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Čistá částka:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Drobné:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Pokud aktivováno, ale adresa pro drobné je prázdná nebo neplatná, tak se drobné pošlou na nově vygenerovanou adresu.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Vlastní adresa pro drobné</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transakční poplatek:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Zvol...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Použití nouzového poplatku („fallbackfee“) může vyústit v transakci, které bude trvat hodiny nebo dny (případně věčnost), než bude potvrzena. Zvaž proto ruční nastavení poplatku, případně počkej, až se ti kompletně zvaliduje bločenka.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Upozornění: teď není možné poplatek odhadnout.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>sbal nastavení poplatků</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>za kilobajt</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Pokud je vlastní poplatek nastavený na 1000 satoshi a transakce má pouze 250 bajtů, tak „za kilobajt“ zaplatí poplatek jen 250 satoshi, zatímco „přinejmenším“ zaplatí 1000 satoshi. Pro transakce větší než kilobajt obě možnosti platí za kilobajt.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Skryj</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Platit jen minimální poplatek je v pořádku, pokud je zrovna méně transakcí než místa v blocích. Ale počítej s tím, že to také může skončit transakcí, která nikdy nebude potvrzena, pokud je větší poptávka po bitcoinových transakcích, než síť zvládne zpracovat.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(viz bublina)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Doporučený:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Vlastní:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Inteligentní poplatek ještě není inicializovaný. Obvykle mu to tak pár bloků trvá...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Pošli více příjemcům naráz</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Při&amp;dej příjemce</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Promaž obsah ze všech formulářových políček.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Prach:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Časové cílování potvrzení:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Všechno s&amp;maž</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Stav účtu:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Potvrď odeslání</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>Pošl&amp;i</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopíruj počet</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopíruj částku</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopíruj poplatek</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopíruj čistou částku</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopíruj bajty</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopíruj prach</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopíruj drobné</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 bloků)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 pro %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Jsi si jistý, že tuhle transakci chceš poslat?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>přidáno jakožto transakční poplatek</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Celková částka %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>nebo</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Potvrď odeslání mincí</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Adresa příjemce je neplatná – překontroluj ji prosím.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Odesílaná částka musí být větší než 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Částka překračuje stav účtu.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Celková částka při připočítání poplatku %1 překročí stav účtu.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Zaznamenána duplicitní adresa: každá adresa by ale měla být použita vždy jen jednou.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Vytvoření transakce selhalo!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Transakce byla zamítnuta s tímto odůvodněním: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Poplatek vyšší než %1 je považován za absurdně vysoký.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Platební požadavek vypršel.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Zaplatit pouze vyžadovaný poplatek %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Potvrzování by podle odhadu mělo začít během %n bloku.</numerusform><numerusform>Potvrzování by podle odhadu mělo začít během %n bloků.</numerusform><numerusform>Potvrzování by podle odhadu mělo začít během %n bloků.</numerusform><numerusform>Potvrzování by podle odhadu mělo začít během %n bloků.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Upozornění: Neplatná bitcoinová adresa</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Upozornění: Neznámá adresa pro drobné</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Potvrď vlastní adresu pro drobné</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Adresa, kterou jsi zvolil pro drobné, není součástí této peněženky. Potenciálně všechny prostředky z tvé peněženky mohou být na tuto adresu odeslány. Souhlasíš, aby se tak stalo?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez označení)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Čás&amp;tka:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Komu:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>O&amp;značení:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Vyber již použitou adresu</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Tohle je normální platba.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Bitcoinová adresa příjemce</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Vlož adresu ze schránky</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Smaž tento záznam</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Poplatek se odečte od posílané částky. Příjemce tak dostane méně bitcoinů, než zadáš do pole Částka. Pokud vybereš více příjemců, tak se poplatek rovnoměrně rozloží.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>Od&amp;ečíst poplatek od částky</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Zpráva:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Tohle je neověřený platební požadavek.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Tohle je ověřený platební požadavek.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Zadej označení této adresy; obojí se ti pak uloží do adresáře</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Zpráva, která byla připojena k bitcoin: URI a která se ti pro přehled uloží k transakci. Poznámka: Tahle zpráva se neposílá s platbou po bitcoinové síti.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Komu:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Poznámka:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Zadej označení této adresy; obojí se ti pak uloží do adresáře</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Ano</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 se ukončuje...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Nevypínej počítač, dokud toto okno nezmizí.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Podpisy - podepsat/ověřit zprávu</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Podepiš zprávu</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Podepsáním zprávy/smlouvy svými adresami můžeš prokázat, že jsi na ně schopen přijmout bitcoiny. Buď opatrný a nepodepisuj nic vágního nebo náhodného; například při phishingových útocích můžeš být lákán, abys něco takového podepsal. Podepisuj pouze naprosto úplná a detailní prohlášení, se kterými souhlasíš.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Bitcoinová adresa, kterou se zpráva podepíše</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Vyber již použitou adresu</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Vlož adresu ze schránky</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Sem vepiš zprávu, kterou chceš podepsat</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Podpis</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Zkopíruj tento podpis do schránky</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Podepiš zprávu, čímž prokážeš, že jsi vlastníkem této bitcoinové adresy</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Po&amp;depiš zprávu</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Vymaž všechna pole formuláře pro podepsání zrávy</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Všechno &amp;smaž</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Ověř zprávu</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>K ověření podpisu zprávy zadej adresu příjemce, zprávu (ověř si, že správně kopíruješ zalomení řádků, mezery, tabulátory apod.) a podpis. Dávej pozor na to, abys nezkopíroval do podpisu víc, než co je v samotné podepsané zprávě, abys nebyl napálen man-in-the-middle útokem. Poznamenejme však, že takto lze pouze prokázat, že podepisující je schopný na dané adrese přijmout platbu, ale není možnéprokázat, že odeslal jakoukoli transakci!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Bitcoinová adresa, kterou je zpráva podepsána</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Ověř zprávu, aby ses ujistil, že byla podepsána danou bitcoinovou adresou</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>O&amp;věř zprávu</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Vymaž všechna pole formuláře pro ověření zrávy</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Kliknutím na „Podepiš zprávu“ vygeneruješ podpis</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Zadaná adresa je neplatná.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Zkontroluj ji prosím a zkus to pak znovu.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Zadaná adresa nepasuje ke klíči.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Odemčení peněženky bylo zrušeno.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Soukromý klíč pro zadanou adresu není dostupný.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Nepodařilo se podepsat zprávu.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Zpráva podepsána.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Podpis nejde dekódovat.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Zkontroluj ho prosím a zkus to pak znovu.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Podpis se neshoduje s hašem zprávy.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Nepodařilo se ověřit zprávu.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Zpráva ověřena.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>kB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Otevřeno pro %n další blok</numerusform><numerusform>Otevřeno pro %n další bloky</numerusform><numerusform>Otevřeno pro %n dalších bloků</numerusform><numerusform>Otevřeno pro %n dalších bloků</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Otřevřeno dokud %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>koliduje s transakcí o %1 konfirmacích</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/nepotvrzeno, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>v transakčním zásobníku</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>není ani v transakčním zásobníku</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>zanechaná</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/nepotvrzeno</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 potvrzení</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Stav</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, ještě nebylo rozesláno</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, rozesláno přes %n uzel</numerusform><numerusform>, rozesláno přes %n uzly</numerusform><numerusform>, rozesláno přes %n uzlů</numerusform><numerusform>, rozesláno přes %n uzlů</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Zdroj</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Vygenerováno</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Od</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>neznámo</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Pro</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>vlastní adresa</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>sledovaná</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>označení</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Příjem</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>dozraje po %n bloku</numerusform><numerusform>dozraje po %n blocích</numerusform><numerusform>dozraje po %n blocích</numerusform><numerusform>dozraje po %n blocích</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>neakceptováno</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Výdaj</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Celkové výdaje</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Celkové příjmy</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transakční poplatek</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Čistá částka</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Zpráva</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Komentář</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID transakce</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Celková velikost transakce</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Pořadí výstupu</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Obchodník</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Vygenerované mince musí čekat %1 bloků, než mohou být utraceny. Když jsi vygeneroval tenhle blok, tak byl rozposlán do sítě, aby byl přidán do bločenky. Pokud se mu nepodaří dostat se do bločenky, změní se na „neakceptovaný“ a nepůjde utratit. To se občas může stát, pokud jiný uzel vygeneruje blok zhruba ve stejném okamžiku jako ty.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Ladicí informace</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transakce</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Vstupy</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Částka</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>true</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>false</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Toto okno zobrazuje detailní popis transakce</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Podrobnosti o %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Označení</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Otevřeno pro %n další blok</numerusform><numerusform>Otevřeno pro %n další bloky</numerusform><numerusform>Otevřeno pro %n dalších bloků</numerusform><numerusform>Otevřeno pro %n dalších bloků</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Otřevřeno dokud %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Nepotvrzeno</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Zanechaná</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Potvrzuje se (%1 z %2 doporučených potvrzení)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Potvrzeno (%1 potvrzení)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>V kolizi</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Nedozráno (%1 potvrzení, dozraje při %2 potvrzeních)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Tento blok nedostal žádný jiný uzel a pravděpodobně nebude akceptován!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Vygenerováno, ale neakceptováno</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Přijato do</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Přijato od</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Posláno na</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Platba sama sobě</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Vytěženo</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>sledovací</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez označení)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Stav transakce. Najetím myši na toto políčko si zobrazíš počet potvrzení.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Datum a čas přijetí transakce.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Druh transakce.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Zda tato transakce zahrnuje i některou sledovanou adresu.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Uživatelsky určený účel transakce.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Částka odečtená z nebo přičtená k účtu.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Vše</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Dnes</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Tento týden</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Tento měsíc</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Minulý měsíc</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Letos</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Rozsah...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Přijato</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Posláno</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Sám sobě</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Vytěženo</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Ostatní</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minimální částka</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Zapomenout transakci</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Navyš transakční poplatek</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopíruj adresu</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopíruj její označení</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopíruj částku</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopíruj ID transakce</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Kopíruj surovou transakci</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Kopíruj kompletní podrobnosti o transakci</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Uprav označení</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Zobraz detaily transakce</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exportuj transakční historii</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Formát CSV (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potvrzeno</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Sledovaná</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Označení</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportování selhalo</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Při ukládání transakční historie do %1 se přihodila nějaká chyba.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Úspěšně vyexportováno</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Transakční historie byla v pořádku uložena do %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Rozsah:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>až</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Jednotka pro částky. Klikni pro výběr nějaké jiné.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Žádná peněženka se nenačetla.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Pošli mince</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Chyba při navyšování poplatku</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Nepodařilo se navýšeit poplatek</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Chceš poplatek navýšit?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Momentální poplatek:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Navýšení:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nový poplatek:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Potvrď navýšení poplatku</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Nemůžu podepsat transakci.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Nemohl jsem uložit transakci do peněženky</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Export</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportuj data z tohoto panelu do souboru</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Záloha peněženky</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Data peněženky (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Zálohování selhalo</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Při ukládání peněženky do %1 se přihodila nějaká chyba.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Úspěšně zazálohováno</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Data z peněženky byla v pořádku uložena do %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Možnosti:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Adresář pro data</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Připojit se k uzlu, získat adresy jeho protějšků a odpojit se</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Udej svou veřejnou adresu</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Akceptovat příkazy z příkazové řádky a přes JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Šířen pod softwarovou licencí MIT, viz přiložený soubor %s nebo %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Pokud není &lt;category&gt; zadána nebo je &lt;category&gt; = 1, bude tisknout veškeré ladicí informace.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Prořezávání je nastaveno pod minimum %d MiB.  Použij, prosím, nějaké vyšší číslo.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Prořezávání: poslední synchronizace peněženky proběhla před už prořezanými daty. Je třeba provést -reindex (tedy v případě prořezávacího režimu stáhnout znovu celou bločenku)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>V prořezávacím režimu není možné bločenku přeskenovávat. Musíš provést -reindex, což ji znovu celou stáhne.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Chyba: Přihodila se závažná vnitřní chyba, podrobnosti viz v debug.log</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Poplatek (v %s/kB), který se přidá ke každé odeslané transakci (výchozí: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Prořezávám úložiště bloků...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Běžet na pozadí jako démon a přijímat příkazy</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Nemohu spustit HTTP server. Detaily viz v debug.log.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Vývojáři %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Sazba poplatku (v %s/kB), která se použije, pokud nebude k dispozici dostatek dat pro automatický odhad poplatku (výchozí: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Přijímat přeposílané transakce obdržené od vždy vítaných protějšků, i když transakce nepřeposíláme (výchozí: %d)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Poslouchat na zadané adrese. Pro zápis IPv6 adresy použij notaci [adresa]:port</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Nedaří se mi získat zámek na datový adresář %s. %s pravděpodobně už jednou běží.</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Smazat všechny transakce peněženky a při startu obnovit pouze relevantní části bločenky pomocí -rescan</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Nastala chyba při čtení souboru %s! Všechny klíče se přečetly správně, ale data o transakcích nebo záznamy v adresáři mohou chybět či být nesprávné.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Vyloučit ladicí informace dané kategorie. Dá se zkombinovat s -debug=1, aby se zaznamenávaly ladicí informace všech kategorií kromě jedné nebo několika zvolených.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Spustit příkaz, když se objeví transakce týkající se peněženky (%s se v příkazu nahradí za TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Počet extra transakcí, které se mají držet v paměti pro účely rekonstrukce kompaktních bloků (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Pokud je tenhle blok v bločence, tak předpokládat, že on i jeho následníci jsou platní, a potenciálně přeskočit ověřování jejich skriptů (0 = ověřovat vše, výchozí: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Maximální povolené seřizování času mediánem časů protějšků. Místní vnímání času může být ovlivněno protějšky, a to dopředu nebo dozadu až o toto množství. (výchozí: %u vteřin)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Horní hranice pro celkový poplatek (v %s) za jednu transakci z peněženky nebo jednu surovou transakci; příliš nízká hodnota může zmařit velké transakce (výchozí: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Zkontroluj, že máš v počítači správně nastavený datum a čas! Pokud jsou nastaveny špatně, %s nebude fungovat správně.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Prosíme, zapoj se nebo přispěj, pokud ti %s přijde užitečný. Více informací o programu je na %s.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Při nedostatku adres získat další protějšky z DNS (výchozí: 1, pokud není použito -connect)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Omezit nároky na úložný prostor prořezáváním (mazáním) starých bloků. Tato volba také umožní použít RPC volání pruneblockchain ke smazání konkrétních bloků a dále automatické prořezávání starých bloků, pokud je zadána cílová velikost souborů s bloky v MiB. Tento režim není slučitelný s -txindex ani -rescan. Upozornění: opětovná změna tohoto nastavení bude vyžadovat nové stažení celé bločenky. (výchozí: 0 = bloky neprořezávat, 1 = povolit ruční prořezávání skrze RPC, &gt;%u = automatické prořezávání bloků tak, aby byla udržena cílová velikost souborů s bloky, v MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Nastavit nejnižší akceptovatelný poplatek (v %s/kB) pro transakce, které mají být zahrnuty do nových bloků. (výchozí: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Nastavení počtu vláken pro verifikaci skriptů (%u až %d, 0 = automaticky, &lt;0 = nechat daný počet jader volný, výchozí: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Databáze bloků obsahuje blok, který vypadá jako z budoucnosti, což může být kvůli špatně nastavenému datu a času na tvém počítači. Nech databázi bloků přestavět pouze v případě, že si jsi jistý, že máš na počítači správný datum a čas</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Tohle je testovací verze – používej ji jen na vlastní riziko, ale rozhodně ji nepoužívej k těžbě nebo pro obchodní aplikace</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Tohle je transakční poplatek, který můžeš zrušit, pokud budou na této úrovni drobné menší než prach</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Nedaří se mi znovu aplikovat bloky. Budeš muset přestavět databázi použitím -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Nedaří se mi vrátit databázi do stavu před štěpem. Budeš muset znovu stáhnout celou bločenku</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Použít UPnP k namapování naslouchacího portu (výchozí: 1, pokud naslouchá a nepoužívá -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Uživatelské jméno a zahašované heslo pro JSON-RPC spojení. Pole &lt;userpw&gt; má formát: &lt;UŽIVATELSKÉ_JMÉNO&gt;:&lt;SŮL&gt;$&lt;HAŠ&gt;. Pomocný pythonní skript je přiložen v share/rpcuser. Klient se pak už připojuje normálně pomocí páru argumentů rpcuser=&lt;UŽIVATELSKÉ_JMÉNO&gt;/rpcpassword=&lt;HESLO&gt;. Tuto volbu lze použít i vícekrát</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Peněženka nebude vytvářet transakce, které by porušovaly limity transakčního zásobníku na řetězce (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Upozornění: Síť podle všeho není v konzistentním stavu. Někteří těžaři jsou zřejmě v potížích.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Upozornění: Nesouhlasím zcela se svými protějšky! Možná potřebuji aktualizovat nebo ostatní uzly potřebují aktualizovat.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Zda uchovat transakční zásobník mezi vypnutím a zapnutím (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d z posledních 100 bloků má neočekávanou verzi</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s je poškozen, jeho záchrana se nezdařila</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool musí být alespoň %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; může být:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Přijímat spojení zvenčí (výchozí: 1, pokud není zadáno -proxy nebo -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Připojit komentář k typu klienta</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Pokusit se při startu zachránit soukromé klíče z poškozeného souboru s klíči</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Možnosti vytváření bloku:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Nemohu přeložit -%s adresu: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Možnosti výběru bločenky:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Index drobných je mimo platný rozsah</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Možnosti připojení:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i–%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Bylo zjištěno poškození databáze bloků</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Možnosti ladění/testování:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Nenačítat peněženku a vypnout její RPC volání</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Chceš přestavět databázi bloků hned teď?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Zapnout oznamování hashů bloků na adrese &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Zapnout oznamování hashů transakcí na adrese &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Zapnout oznamování surových bloků na adrese &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Zapnout oznamování surových transakcí na adrese &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Povolit výměnu transakcí v transakčním zásobníku (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Chyba při zakládání databáze bloků</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Chyba při vytváření databázového prostředí %s pro peněženku!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Chyba při načítání %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Chyba při načítání %s: peněženka je poškozená</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Chyba při načítání %s: peněženka vyžaduje novější verzi %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Chyba při načítání databáze bloků</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Chyba při otevírání databáze bloků</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Problém: Na disku je málo místa!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Nepodařilo se naslouchat na žádném portu. Použij -listen=0, pokud to byl tvůj záměr.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importuji...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Nemám žádný nebo jen špatný genesis blok. Není špatně nastavený datadir?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Selhala úvodní zevrubná prověrka. %s se ukončuje.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Neplatná částka pro -%s=&lt;částka&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Neplatná částka pro -discardfee=&lt;částka&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Neplatná částka pro -fallbackfee=&lt;částka&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Udržovat zasobník transakcí menší než &lt;n&gt; megabajtů (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Načítám P2P adresy…</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Načítám seznam klateb...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Místo pro autentizační cookie (výchozí: adresář pro data)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Je nedostatek deskriptorů souborů.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Připojovat se pouze k uzlům v &lt;net&gt; síti (ipv4, ipv6 nebo onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Vypsat tuto nápovědu a skončit</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Vypsat verzi a skončit</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Prořezávání nemůže být zkonfigurováno s negativní hodnotou.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Prořezávací režim není kompatibilní s -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Znovu vytvořit stav a index bločenky z blk*.dat souborů na disku</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Znovu vytvořit stav bločenky z aktuálně indexovaných bloků</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Znovu aplikuji bloky…</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Vracím bloky…</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Nastavit velikost databázové vyrovnávací paměti v megabajtech (%d až %d, výchozí: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Udej název souboru s peněženkou (v rámci datového adresáře)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Zdrojový kód je dostupný na %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Selhal výpočet transakčního poplatku a drobných</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Nedaří se mi připojit na %s na tomhle počítači. %s už pravděpodobně jednou běží.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Nepodporovaný argument -benchmark se ignoruje, použij -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Nepodporovaný argument -debugnet se ignoruje, použij -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Argument -tor již není podporovaný, použij -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Nepodporovaná logovací kategorie %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Aktualizuji databázi neutracených výstupů (UTXO)</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Použít UPnP k namapování naslouchacího portu (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Použít testovací bločenku</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Komentář u typu klienta (%s) obsahuje riskantní znaky.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Ověřuji bloky…</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Možnosti ladění/testování peněženky:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Soubor s peněženkou potřeboval přepsat: restartuj %s, aby se operace dokončila</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Možnosti peněženky:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Povolit JSON-RPC spojení ze specifikovaného zdroje. Platnou hodnotou &lt;ip&gt; je jednotlivá IP adresa (např. 1.2.3.4), síť/maska (např. 1.2.3.4/255.255.255.0) nebo síť/CIDR (např. 1.2.3.4/24). Tuto volbu lze použít i vícekrát</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Obsadit zadanou adresu a vždy vítat protějšky, které se na ni připojí. Pro zápis IPv6 adresy použij notaci [adresa]:port</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Vytvářet nové soubory s výchozími systémovými právy namísto umask 077 (uplatní se, pouze pokud je vypnutá funkce peněženky)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Zjistit vlastní IP adresu (výchozí: 1, pokud naslouchá a není zadáno -externalip nebo -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Chyba: Nelze naslouchat příchozí spojení (listen vrátil chybu %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Spustit příkaz, když přijde relevantní upozornění nebo když dojde k opravdu dlouhému rozštěpení řetezce bloků (%s se v příkazu nahradí zprávou)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Poplatky (v %s/kB) menší než tato hodnota jsou považovány za nulové pro účely přeposílání, těžení a vytváření transakcí (výchozí: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Pokud paytxfee není nastaveno, platit dostatečný poplatek na to, aby začaly být transakce potvrzovány v průměru během n bloků (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Neplatná částka pro -maxtxfee=&lt;amount&gt;: '%s' (musí být alespoň jako poplatek minrelay %s, aby transakce nezůstávaly trčet)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maximální velikost dat v transakcích nesoucích data, se kterou jsme ochotni je ještě přeposílat a těžit (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Použít náhodné údaje pro každé proxy spojení. To umožní izolovat nesouvisející datové toky v Toru (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Částka v transakci po odečtení poplatku je příliš malá na odeslání</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Na vždy vítané protějšky se nevztahuje DoS klatba a jejich transakce jsou vždy přeposílány, i když už třeba jsou v transakčním zásobníku, což je užitečné např. pro bránu</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>K návratu k neprořezávacímu režimu je potřeba přestavět databázi použitím -reindex.  Také se znovu stáhne celá bločenka</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Přijímat veřejné REST požadavky (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Automaticky v Toru vytvářet skryté služby (výchozí: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Připojit se přes SOCKS5 proxy</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Chyba při načítání %s: nemůžeš vypnout HD u existující HD peněženky</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Chyba při čtení z databáze, ukončuji se.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Chyba při aktualizaci stavové databáze bločenky</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importovat při startu bloky z externího souboru blk000??.dat</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informace</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Neplatná -onion adresa či hostitel: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Neplatná -proxy adresa či hostitel: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Neplatná částka pro -paytxfee=&lt;částka&gt;: '%s' (musí být alespoň %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Ve -whitelist byla zadána neplatná podsíť: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Držet v paměti nejvýše &lt;n&gt; nespojitelných transakcí (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>V rámci -whitebind je třeba specifikovat i port: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Možnosti přeposílání:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Možnosti RPC serveru:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Omezuji -maxconnections z %d na %d kvůli systémovým omezením.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Přeskenovat při startu bločenku na chybějící transakce tvé pěněženky</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Posílat stopovací/ladicí informace do konzole místo do souboru debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Zobrazit všechny možnosti ladění (užití: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Při spuštění klienta zmenšit soubor debug.log (výchozí: 1, pokud není zadáno -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Nepodařilo se podepsat transakci</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Částka v transakci je příliš malá na pokrytí poplatku</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Tohle je experimentální program.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Heslo ovládacího portu Toru (výchozí: prázdné)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Ovládací port Toru, je-li zapnuté onion naslouchání (výchozí: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Částka v transakci je příliš malá</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transakce je na poplatkovou politiku příliš velká</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transakce je příliš velká</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Nedaří se mi připojit na %s na tomhle počítači (operace bind vrátila chybu %s)</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Převést při startu peněženku na nejnovější formát</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Uživatelské jméno pro JSON-RPC spojení</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Kontroluji peněženku/y…</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Upozornění</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Upozornění: aktivována neznámá nová pravidla (verzový bit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Zda fungovat v čistě blokovém režimu (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Je třeba přestavět databázi použitím -reindex, aby bylo možné změnit -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Vymazat všechny transakce z peněženky...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Možnosti ZeroMQ oznamování:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Heslo pro JSON-RPC spojení</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Spustit příkaz, když se změní nejlepší blok (%s se v příkazu nahradí hashem bloku)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Povolit DNS dotazy pro -addnode (přidání uzlu), -seednode a -connect (připojení)</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = ukládat transakční metadata, např. majitele účtu a informace o platebním požadavku, 2 = mazat transakční metadata)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee je nastaveno velmi vysoko! Takto vysoký poplatek může být zaplacen v jednotlivé transakci.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Čekat na zadané adrese na JSON-RPC spojení. Tato volba se ignoruje, pokud současně nezadáš i volbu -rpcallowip. Port je volitelný a má přednost před -rpcport. Pro zápis IPv6 adresy použij notaci [adresa]:port. Tuto volbu lze použít i vícekrát (výchozí: 127.0.0.1 a ::1, tzn. localhost, nebo pokud je zadáno -rpcallowip, tak 0.0.0.0 a ::, tzn. všechny adresy)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Nedržet transakce v zásobníku déle než &lt;n&gt; hodin (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Ekvivalent bajtů za každý sigop v transakcích – pro účely přeposílání a těžení (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Chyba při načítání %s: nemůžeš zapnout HD u existující ne-HD peněženky</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Chyba při načítání peněženky %s. Parametr -wallet smí uvádět pouze název souboru (nikoli cestu k němu).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Poplatky (v %s/kB) menší než tato hodnota jsou považovány za nulové pro účely vytváření transakcí (výchozí: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Vynutit přeposílání transakcí od vždy vítaných protějšků (tj. těch na bílé listině), i když porušují místní zásady pro přeposílání (výchozí: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Jak moc důkladná má být verifikace bloků -checkblocks (0-4, výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Spravovat úplný index transakcí, který je využíván rpc voláním getrawtransaction (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Doba ve vteřinách, po kterou se nebudou moci zlobivé protějšky znovu připojit (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Tisknout ladicí informace (výchozí: %u, zadání &lt;category&gt; je volitelné)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Nastaví serializaci surových transakcí nebo bloků, jak jsou vraceny v méně povídavém módu: ne-segwit (0) nebo segwit (1) (výchozí: %d)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Umožnit filtrování bloků a transakcí pomocí Bloomova filtru (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>Sazba poplatku (v %s/kB), která určuje tvou ochotu v případě potřeby proměnit drobné v poplatek (výchozí: %s). Poznámka: výstup se promění, pokud se při téhle sazbě změní v prach. Nicméně proměňovat budeme do výše poplatku pro přenos prachu a proměněný poplatek nad tuto výši bude omezený odhadem poplatku na nejdelší čas</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Toto je transakční poplatek, který se platí, pokud náhodou není k dispozici odhad poplatků.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Tento produkt zahrnuje programy vyvinuté OpenSSL Projektem pro použití v OpenSSL Toolkitu %s a kryptografický program od Erika Younga a program UPnP od Thomase Bernarda.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Celková délka síťového identifikačního řetězce (%i) překročila svůj horní limit (%i). Omez počet nebo velikost voleb uacomment.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Pokusit se udržet odchozí provoz pod stanovenou hodnotou (v MiB za 24 hodin), 0 = bez omezení (výchozí: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Byl použit nepodporovaný argument -socks. Nastavení verze SOCKS už není možné, podporovány jsou pouze SOCKS5 proxy.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Nepodporovaný argument -whitelistalwaysrelay se ignoruje, použij -whitelistrelay a/nebo -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Použít samostatnou SOCKS5 proxy ke spojení s protějšky přes skryté služby v Toru (výchozí: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Upozornění: Síť těží neznámé verze bloků! Je možné, že jsou v platnosti neznámá pravidla</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Upozornění: soubor s peněženkou je poškozený, data jsou však zachráněna! Původní soubor %s je uložený jako %s v %s. Pokud nejsou stav tvého účtu nebo transakce v pořádku, zřejmě bys měl obnovit zálohu.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Vždy vítat protějšky připojující se z dané IP adresy (např. 1.2.3.4) či podsítě (CIDR zápis, např. 1.2.3.0/24). Lze zadat i vícekrát.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s je nastaveno velmi vysoko!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(výchozí: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Vždy získávat adresy dalších protějšků přes DNS (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Chyba při načítání peněženky %s. -wallet musí být obyčejný soubor.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Chyba při načítání peněženky %s. Udán duplicitní název souboru -wallet.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Chyba při načítání peněženky %s. Neplatné znaky v názvu souboru -wallet.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Kolik bloků při startu zkontrolovat (výchozí: %u, 0 = všechny)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Zaznamenávat do ladicích výstupů i IP adresy (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Vyčerpal se zásobník klíčů, zavolej prvně, prosím, keypoolrefill</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Čekat na JSON-RPC spojení na &lt;portu&gt; (výchozí: %u nebo testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Čekat na spojení na &lt;portu&gt; (výchozí: %u nebo testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Povolit nejvýše &lt;n&gt; protějšků (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Transakce z peněženky rozesílat</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximální velikost přijímacího bufferu pro každé spojení, &lt;n&gt;*1000 bajtů (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximální velikost odesílacího bufferu pro každé spojení, &lt;n&gt;*1000 bajtů (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Připojit před ladicí výstup časové razítko (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Přeposílat a těžit transakce nesoucí data (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Přeposílat ne-P2SH multisig (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Nastavit zásobník klíčů na velikost &lt;n&gt; (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Nastavit maximální váhu bloku pro BIP141 (výchozí: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Nastavení počtu vláken pro servisní RPC volání (výchozí: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Konfigurační soubor (výchozí: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Zadej časový limit spojení v milivteřinách (minimum: 1, výchozí: %d)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Utrácet i ještě nepotvrzené drobné při posílání transakcí (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Spouštím síťová vlákna…</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Peněženka zaručí přiložení poplatku alespoň ve výši minima pro přenos transakce.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Toto je minimální poplatek, který zaplatíš za každou transakci.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Toto je poplatek, který zaplatíš za každou poslanou transakci.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Práh pro odpojování zlobivých protějšků (výchozí: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Částky v transakci nemohou být záporné</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Transakce má v transakčním zásobníku příliš dlouhý řetězec</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Transakce musí mít alespoň jednoho příjemce</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>V -onlynet byla uvedena neznámá síť: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Nedostatek prostředků</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Načítám index bloků...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Načítám peněženku...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Nemohu převést peněženku do staršího formátu</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Přeskenovávám…</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Načítání dokončeno</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Chyba</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_cs_CZ.ts",
    "content": "<TS language=\"cs_CZ\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Pravým klikem editujte adresu nebo popisek</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Vytvořit novou adresu</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nový</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopírovat aktuálně vybrané adresy do schránky</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopírovat</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Odstraní aktuálně vybrané adresy ze seznamu</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportovat aktuální pohled do souboru</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportovat</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Odstranit</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Textový soubor oddělený středníkem (*.csv)</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Popis</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez popisu)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Zadej heslo</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nové heslo</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Zopakujte nové heslo</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Zašifrovat peněženku</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Tato operace vyžaduje heslo k odemknutí peněženky.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Odemknout peněženku</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Tato operace vyžaduje heslo k dešifrování peněženky.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dešifrovat peněženku</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Změnit heslo</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Potvrďte zašifrování peněženky</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Peněženka zašifrována</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Zašifrování peněženky selhalo</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Šifrování peněženky selhalo vinou vnitřní chyby. Vaše peněženka nebyla zašifrována.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Zadaná hesla nejsou shodná.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Odemčení peněženky selhalo</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Heslo zadané k dešifrování peněženky nebylo správné</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Deěifrování peněženky selhalo</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronizuji se sítí...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Přehled</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Zobrazit základní přehled o peněžence</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakce</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Procházení historií transakcí</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Ukončit aplikaci</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Možnosti...</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Změnit heslo k šifrování peněženky</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Soubor</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Nastavení</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>Nápo&amp;věda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Panely</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Aktuální</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Zachytávám...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Odeslané transakce</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Příchozí transakce</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Peněženka je &lt;b&gt;zašifrována&lt;/b&gt; a momentálně &lt;b&gt;odemčená&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Peněženka je &lt;b&gt;zašifrována&lt;/b&gt; a momentálně &lt;b&gt;uzamčená&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>Množství:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Množství</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potvrzeno</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopírovat sdresu</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopírovat popis</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez popisu)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Upravit adresu</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Popisek</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresa</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nová adresa pro příjem</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nová adresa k odeslání</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Upravit adresu pro příjem</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Upravit adresu k odeslání</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Zadaná adresa \"%1\" se již v seznamu adres nachází.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Nemohu odemknout peněženku</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Generování nového klíče selhalo.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>Usage:</source>\n        <translation>Použití:</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Možnosti</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapovat port pomocí &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimalizovat do systémové lišty (tray) namísto do hlavního panelu</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimalizovat při zavření</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Množství</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>Name</source>\n        <translation>Jméno</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Popisek:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Zpráva:</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopírovat popis</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Množství</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Popis</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Zpráva</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Popis</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Zpráva</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez popisu)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>Množství:</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Zůstatek:</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Částka k zaplacení musí být větší než 0.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez popisu)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Popisek:</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Zpráva:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1 potvrzeno</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 potvrzení</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Stav</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Zpráva</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transakce</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Množství</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Toto podokno zobrazuje detailní popis transakce</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Popis</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Potvrzeno (%1 potvrzení)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Tento blok nebyl přijat žádným dalším uzlem a pravděpodobně nebude akceptován!</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Přijato s</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Odesláno na</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Platba sobě samému</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Vytěženo</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez popisu)</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Typ transakce.</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Vše</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Dnes</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Tento týden</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Tento měsíc</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Minulý měsíc</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Tento rok</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Rozsah...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Přijato s</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Odesláno na</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Sobě samému</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Vytěženo</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Ostatní</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Min. množství</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopírovat sdresu</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopírovat popis</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Upravit popis</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Textový soubor oddělený středníkem (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potvrzeno</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Popis</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Rozsah:</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportovat</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportovat aktuální pohled do souboru</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Možnosti:</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Načítání peněženky...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Načítání dokončeno</translation>\n    </message>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_cy.ts",
    "content": "<TS language=\"cy\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Clic-dde i olygu cyfeiriad neu label</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Creu cyfeiriad newydd</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Newydd</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copio'r cyfeiriad sydd wedi'i ddewis i'r clipfwrdd system</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copïo</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;au</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Dileu'r cyfeiriad presennol wedi ei ddewis o'r rhestr</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Allforio'r data yn y tab presennol i ffeil</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Allforio</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Dileu</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Dewis y cyfeiriad i yrru'r arian </translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Dewis y cyfeiriad i dderbyn arian</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>D&amp;ewis</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Anfon cyfeiriadau</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Derbyn cyfeiriadau</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Rhain ydi eich cyfeiriadau Bitcoin ar gyfer gyrru taliadau. Gwnewch yn sicr o'r swm a'r cyfeiriad derbyn cyn gyrru arian.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Dyma eich cyfeiriadau Bitcoin ar gyfer derbyn taliadau. Argymhellwn ddefnyddio cyfeiriad derbyn newydd ar gyfer bob trafodyn.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copïo Cyfeiriad</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copïo &amp;Label</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Golygu</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Allforio Rhestr Cyfeiriadau</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Methiant Allforio</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Roedd camgymeriad yn trïo safio'r rhestr gyfeiriadau i'r %1. Triwch eto os gwelwch yn dda.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Cyfeiriad</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(dim label)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Deialog Cyfrinair</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Teipiwch gyfrinymadrodd</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Cyfrinymadrodd newydd</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ailadroddwch gyfrinymadrodd newydd</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Ysgrifennwch y cyfrinair newydd i'r waled. &lt;br/&gt; Os gwelwch yn dda, defnyddiwch gyfrinair &lt;b&gt; deg neu fwy o gymeriadau ar hap &lt;/b&gt; , neu &lt;b&gt; wyth neu fwy o eiriau &lt;/b&gt; .</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Amgryptio'r Waled</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Mae'r weithred hon angen eich cyfrinair waled i ddatgloi'r waled.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Datgloi'r waled</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Mae'r weithred hon angen eich cyfrinair waled i ddatgryptio'r waled.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Datgryptio waled</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Newid cyfrinair</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Ysgrifennwch yr hen gyfrinair a chyfrinair newydd y waled.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Cadarnhau amgryptio'r waled</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Rhybudd: Os ydych yn amgryptio'r waled ag yn colli'r cyfrinair, byddwch yn &lt;b&gt; COLLI EICH BITCOINS I GYD &lt;b&gt; !</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Ydych yn siwr eich bod eisiau amgryptio eich waled?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Waled Wedi Amgryptio</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>Bydd %1 nawr yn gorffen y broses amgryptio. Cofiwch nad ydy amgryptio eich waled yn llawn amddiffyn eich bitcoins rhag cael eu dwyn gan afiechyd yn heintio eich cyfrifiadur.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>PWYSIG: Mi ddylai unrhyw back ups blaenorol rydych wedi ei wneud o ffeil eich waled gael ei ddiweddaru efo'r ffeil amgryptiedig newydd ei chreu. Am resymau diogelwch, bydd back ups blaenorol o ffeil y walet heb amgryptio yn ddiwerth mor fuan ac yr ydych yn dechrau defnyddio'r waled amgryptiedig newydd.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Amgryptio waled wedi methu</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Amgryptio waled wedi methu oherwydd gwall mewnol. Dydi eich waled heb amgryptio.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Nid ydi'r cyfrineiriau a gyflenwyd yn cyfateb.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Dadgloi waled wedi methu</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Mae'r cyfrinair ysgrifennwyd ar gyfer datgryptio'r waled yn anghywir.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Amgryptio waled wedi methu</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Newid cyfrinair waled yn llwyddiannus. </translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Rhybudd: Mae allwedd Caps Lock ymlaen!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Rhwydfwgwd</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Gwaharddwyd Nes</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Arwyddo &amp;neges...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Cysoni â'r rhwydwaith...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Trosolwg</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nod</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Dangos trosolwg cyffredinol y waled</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Trafodion</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Pori hanes trafodion</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>A&amp;llanfa</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Gadael rhaglen</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Ynghylch %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Dangos gwybodaeth am %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Ynghylch &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Dangos gwybodaeth am Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opsiynau</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Addasu ffurfweddiad dewisiadau ar gyfer %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Amgryptio'r waled...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Backup Waled...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Newid cyfrinymadrodd...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Cyfeiriadau anfon...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Cyfeiriadau derbyn...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Agor &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Cliciwch i anablu gweithgaredd y rhwydwaith.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Gweithgaredd rhwydwaith wedi anablu.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Cliciwch i alluogi gweithgaredd y rhwydwaith eto.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Syncio pennawdau (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Ailfynegi y blociau ar ddisg...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Anfon arian i gyfeiriad Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Bacio fyny'r waled i leoliad arall</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Newid y cyfrinair ddefnyddiwyd ar gyfer amgryptio'r waled</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Di fygio'r ffenest</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Gwirio neges...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Waled</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Anfon</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Derbyn</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Dangos / Cuddio</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Dangos neu guddio y brif Ffenest</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Amgryptio'r allweddi preifat sy'n perthyn i'ch waled</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Arwyddo negeseuon gyda eich cyfeiriadau Bitcoin i brofi mae chi sy'n berchen arnynt</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Gwirio negeseuon i sicrhau eu bod wedi eu harwyddo gyda cyfeiriadau Bitcoin penodol</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Ffeil</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Gosodiadau</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Cymorth</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Bar offer tabiau</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Gofyn taliadau (creu côd QR a bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Dangos rhestr o gyfeiriadau danfon a labelau wedi eu defnyddio</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Dangos rhestr o gyfeiriadau derbyn a labelau wedi eu defnyddio</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Agor Bitcoin: URI neu ofyn taliad</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Dewisiadau Gorchymyn-llinell</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Mynegai'r blociau ar ddisg...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Prosesu blociau ar ddisg...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 Tu ôl</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Cafodd y bloc olaf i'w dderbyn ei greu %1 yn ôl.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Ni fydd trafodion ar ôl hyn yn weledol eto.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Gwall</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Rhybudd</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Gwybodaeth</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Cyfamserol</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Cysylltu efo cyfoedion...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Dal i fyny...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Dyddiad: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Cyfanswm: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Math: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Label: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Cyfeiriad: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Trafodiad anfonwyd</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Trafodiad sy'n cyrraedd</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Cynhyrchu allweddi HD wedi ei &lt;b&gt; alluogi &lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Cynhyrchu allweddi HD wedi'w &lt;b&gt; anablu &lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Mae'r waled &lt;b&gt;wedi'i amgryptio&lt;/b&gt; ac &lt;b&gt;heb ei gloi&lt;/b&gt; ar hyn o bryd</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Mae'r waled &lt;b&gt;wedi'i amgryptio&lt;/b&gt; ac &lt;b&gt;ar glo&lt;/b&gt; ar hyn o bryd</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Mae gwall angheuol wedi digwydd. Ni all Bitcoin barhau'n ddiogel ac mae'n cau lawr.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Dewis Ceiniog</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Maint:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cyfanswm</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Ffî</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Llwch</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Ar Ôl Ffî</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Newid:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cyfanswm</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Derbynwyd gyda label</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Derbynwyd gyda chyfeiriad</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dyddiad</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Cadarnhadiadau</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Cadarnhawyd</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copïo cyfeiriad</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copïo label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copïo Cyfanswm</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(dim label)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Golygu'r cyfeiriad</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Label</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Cyfeiriad</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>enw</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>Usage:</source>\n        <translation>Cynefod:</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Croeso</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Gwall</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Ffurflen</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Agor URI</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opsiynau</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Rhwydwaith</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>W&amp;aled</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Ffenestr</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Dangos</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Gwall</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Ffurflen</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Cyfanswm</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 a %2</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Gwybodaeth</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Rhwydwaith</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Agor</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copïo label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copïo Cyfanswm</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Cyfeiriad Copi</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Cyfeiriad</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cyfanswm</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dyddiad</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(dim label)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Anfon arian</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Maint:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Maint</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Maint</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Ffi</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Ar Ôl Ffî</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Newid:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Anfon at pobl lluosog ar yr un pryd</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Llwch</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Gweddill:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Cadarnhau'r gweithrediad anfon</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copïo Cyfanswm</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(dim label)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Maint</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Gludo cyfeiriad o'r glipfwrdd</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Neges:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Gludo cyfeiriad o'r glipfwrdd</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>Dyddiad</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cyfanswm</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dyddiad</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Math</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(dim label)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Today</source>\n        <translation>Heddiw</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Yr wythnos hon</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Y mis hwn</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Mis diwethaf</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Eleni</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copïo cyfeiriad</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copïo label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copïo Cyfanswm</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Golygu label</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Cadarnhawyd</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dyddiad</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Math</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Cyfeiriad</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Methu Allforio</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Current fee:</source>\n        <translation>Ffi gyfredol</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Cynydd:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Ffi newydd:</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Allforio</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Allforio'r data yn y tab presennol i ffeil</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opsiynau:</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Craidd Bitcoin</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Gwybodaeth</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Rhybudd</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Gwall</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_da.ts",
    "content": "<TS language=\"da\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Højreklik for at redigere adresse eller mærkat</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Opret en ny adresse</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Ny</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopiér den valgte adresse til systemets udklipsholder</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopiér</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Luk</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Slet den markerede adresse fra listen</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksportér den aktuelle visning til en fil</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksportér</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Slet</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Vælg adresse at sende bitcoins til</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Vælg adresse at modtage bitcoins med</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Vælg</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Afsendelsesadresser</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Modtagelsesadresser</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Disse er dine Bitcoin-adresser til afsendelse af betalinger. Tjek altid beløb og modtagelsesadresse, inden du sender bitcoins.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Dette er dine Bitcoin-adresser til modtagelse af betalinger. Det anbefales at bruge en ny modtagelsesadresse for hver transaktion.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopiér adresse</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopiér &amp;mærkat</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Redigér</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Eksportér adresseliste</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Kommasepareret fil (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksport mislykkedes</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Der opstod en fejl under gemning af adresselisten til %1. Prøv venligst igen.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Mærkat</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen mærkat)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Adgangskodedialog</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Indtast adgangskode</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Ny adgangskode</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Gentag ny adgangskode</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Vis adgangskode</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Indtast det nye kodeord til tegnebogen.&lt;br/&gt;Brug venligst et kodeord på &lt;b&gt;ti eller flere tilfældige tegn&lt;/b&gt; eller &lt;b&gt;otte eller flere ord&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Kryptér tegnebog</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Denne funktion har brug for din tegnebogs adgangskode for at låse tegnebogen op.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Lås tegnebog op</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Denne funktion har brug for din tegnebogs adgangskode for at dekryptere tegnebogen.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dekryptér tegnebog</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Skift adgangskode</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Indtast den gamle adgangskode og en ny adgangskode til tegnebogen.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Bekræft tegnebogskryptering</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Advarsel: Hvis du krypterer din tegnebog og mister din adgangskode, vil du &lt;b&gt;MISTE ALLE DINE BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Er du sikker på, at du ønsker at kryptere din tegnebog?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Tegnebog krypteret</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 vil nu lukke for at færdiggøre krypteringsprocessen. Husk at kryptering af din tegnebog kan ikke beskytte dine bitcoin fuldt ud mod at blive stjålet af eventuel malware, der måtte have inficeret din computer.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>VIGTIGT: Enhver tidligere sikkerhedskopi, som du har lavet af tegnebogsfilen, bør blive erstattet af den nyligt genererede, krypterede tegnebogsfil. Af sikkerhedsmæssige årsager vil tidligere sikkerhedskopier af den ikke-krypterede tegnebogsfil blive ubrugelige i det øjeblik, du starter med at anvende den nye, krypterede tegnebog.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Tegnebogskryptering mislykkedes</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Tegnebogskryptering mislykkedes på grund af en intern fejl. Din tegnebog blev ikke krypteret.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>De angivne adgangskoder stemmer ikke overens.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Tegnebogsoplåsning mislykkedes</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Den angivne adgangskode for tegnebogsdekrypteringen er forkert.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Tegnebogsdekryptering mislykkedes</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Tegnebogens adgangskode blev ændret.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Advarsel: Caps Lock-tasten er aktiveret!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmaske</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Bandlyst indtil</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signér &amp;besked…</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synkroniserer med netværk…</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Oversigt</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Knude</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Vis generel oversigt over tegnebog</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaktioner</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Gennemse transaktionshistorik</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Luk</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Afslut program</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Om %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Vis informationer om %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Om &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Vis informationer om Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Indstillinger…</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Redigér konfigurationsindstillinger for %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Kryptér tegnebog…</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Sikkerhedskopiér tegnebog…</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Skift adgangskode…</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Afsendelsesadresser…</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Modtagelsesadresser…</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>&amp;Åbn URI…</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Klik for at deaktivere netværksaktivitet.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Netværksaktivitet deaktiveret.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Klik for a aktivere netværksaktivitet igen.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synkroniserer hoveder (%1%)…</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Genindekserer blokke på disken…</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Send bitcoins til en Bitcoin-adresse</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Lav sikkerhedskopi af tegnebogen til et andet sted</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Skift adgangskode anvendt til tegnebogskryptering</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Fejlsøgningsvindue</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Åbn fejlsøgnings- og diagnosticeringskonsollen</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verificér besked…</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Tegnebog</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Send</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Modtag</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Vis / skjul</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Vis eller skjul hovedvinduet</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Kryptér de private nøgler, der hører til din tegnebog</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signér beskeder med dine Bitcoin-adresser for at bevise, at de tilhører dig</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verificér beskeder for at sikre, at de er signeret med de angivne Bitcoin-adresser</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fil</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Opsætning</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Hjælp</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Faneværktøjslinje</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Anmod om betalinger (genererer QR-koder og “bitcoin:”-URI'er)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Vis listen over brugte afsendelsesadresser og -mærkater</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Vis listen over brugte modtagelsesadresser og -mærkater</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Åbn en “bitcoin:”-URI eller betalingsanmodning</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Tilvalg for &amp;kommandolinje</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktiv forbindelse til Bitcoin-netværket</numerusform><numerusform>%n aktive forbindelser til Bitcoin-netværket</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Genindekserer blokke på disken…</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Bearbejder blokke på disken…</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Bearbejdede %n blok med transaktionshistorik.</numerusform><numerusform>Bearbejdede %n blokke med transaktionshistorik.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 bagud</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Senest modtagne blok blev genereret for %1 siden.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transaktioner herefter vil endnu ikke være synlige.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fejl</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Advarsel</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Opdateret</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Vis %1 hjælpebesked for at få en liste over mulige tilvalg for Bitcoin kommandolinje</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1-klient</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Forbinder til knuder…</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Indhenter…</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Dato: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Beløb: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Type: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Mærkat: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresse: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Afsendt transaktion</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Indgående transaktion</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Generering af HD-nøgler er &lt;b&gt;aktiveret&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Generering af HD-nøgler er &lt;b&gt;deaktiveret&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Tegnebog er &lt;b&gt;krypteret&lt;/b&gt; og i øjeblikket &lt;b&gt;ulåst&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Tegnebog er &lt;b&gt;krypteret&lt;/b&gt; og i øjeblikket &lt;b&gt;låst&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Der opstod en fatal fejl. Bitcoin kan ikke længere fortsætte sikkert og vil afslutte.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Coin-styring</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Mængde:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Byte:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Beløb:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Gebyr:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Støv:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Efter gebyr:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Byttepenge:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(af)vælg alle</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Trætilstand</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Listetilstand</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Beløb</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Modtaget med mærkat</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Modtaget med adresse</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Bekræftelser</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bekræftet</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiér adresse</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiér mærkat</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiér beløb</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopiér transaktions-ID</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Fastlås ubrugte</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Lås ubrugte op</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopiér mængde</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopiér gebyr</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopiér eftergebyr</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopiér byte</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopiér støv</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopiér byttepenge</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 fastlåst)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ja</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nej</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Denne mærkat bliver rød, hvis en eller flere modtagere modtager et beløb, der er mindre end den aktuelle støvgrænse.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Kan variere med ±%1 satoshi per input.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen mærkat)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>byttepenge fra %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(byttepange)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Redigér adresse</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Mærkat</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Mærkatet, der er associeret med denne indgang i adresselisten</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Adressen, der er associeret med denne indgang i adresselisten. Denne kan kune ændres for afsendelsesadresser.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresse</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Ny modtagelsesadresse</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Ny afsendelsesadresse</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Redigér modtagelsesadresse</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Redigér afsendelsesadresse</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Den indtastede adresse “%1” er ikke en gyldig Bitcoin-adresse.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Den indtastede adresse “%1” er allerede i adressebogen.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Kunne ikke låse tegnebog op.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Ny nøglegenerering mislykkedes.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>En ny datamappe vil blive oprettet.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>navn</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Mappe eksisterer allerede. Tilføj %1, hvis du vil oprette en ny mappe her.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Sti eksisterer allerede og er ikke en mappe.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Kan ikke oprette en mappe her.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>version</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Om %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Kommandolinjetilvalg</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Anvendelse:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>kommandolinjetilvalg</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Indstillinger for brugergrænseflade:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Vælg datamappe under opstart (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Vælg sprog; fx “da_DK” (standard: systemsprog)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Start minimeret</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Opsæt SSL-rodcertifikater til betalingsadmodninger (standard: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Vis startskærm under opstart (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Nulstil alle indstillinger, der er foretaget i den grafiske brugerflade</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Velkommen</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Velkommen til %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Siden dette er første gang, programmet startes, kan du vælge, hvor %1 skal gemme sin data.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Når du klikker OK, vil %1 begynde at downloade og bearbejde den fulde %4-blokkæde (%2 GB), startende med de tidligste transaktioner i %3, da %4 først startede.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Denne indledningsvise synkronisering er meget krævende, og den kan potentielt afsløre hardwareproblemer med din computer, som du ellers ikke har lagt mærke til. Hver gang, du kører %1, vil den fortsætte med at downloade, hvor den sidst slap.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Hvis du har valgt at begrænse opbevaringen af blokkæden (beskæring/pruning), vil al historisk data stadig skulle downloades og bearbejdes men vil blive slettet efterfølgende for at holde dit diskforbrug lavt.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Brug standardmappen for data</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Brug tilpasset mappe for data:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Mindst %1 GB data vil blive gemt i denne mappe, og det vil vokse over tid.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Omtrent %1 GB data vil blive gemt i denne mappe.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 vil downloade og gemme en kopi af Bitcoin-blokkæden.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Tegnebogen vil også blive gemt i denne mappe.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Fejl: Angivet datamappe “%1” kan ikke oprettes.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fejl</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB fri plads tilgængelig</numerusform><numerusform>%n GB fri plads tilgængelig</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(ud af %n GB nødvendig)</numerusform><numerusform>(ud af %n GB nødvendig)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formular</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Nylige transaktioner er måske ikke synlige endnu, og derfor kan din tegnebogs saldo være ukorrekt. Denne information vil være korrekt, når din tegnebog er færdig med at synkronisere med bitcoin-netværket, som detaljerne herunder viser.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Forsøg på at bruge bitcoin, som er indeholdt i endnu-ikke-viste transaktioner, accepteres ikke af netværket.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Antal blokke tilbage</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Ukendt…</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Tidsstempel for seneste blok</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Fremgang</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Øgning af fremgang pr. time</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>beregner…</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Estimeret tid tilbage af synkronisering</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Skjul</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Ukendt. Synkroniserer hoveder (%1)…</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Åbn URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Åbn betalingsanmodning fra URI eller fil</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Vælg fil for betalingsanmodning</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Vælg fil for betalingsanmodning til åbning</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Indstillinger</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Generelt</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Start %1 automatisk, når der logges ind på systemet.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Start %1 ved systemlogin</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Størrelsen på &amp;databasens cache</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Antallet af script&amp;verificeringstråde</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP-adresse for proxyen (fx IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Viser om den angivne standard-SOCKS5-proxy bruges til at nå knuder via denne netværkstype.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Brug separat SOCKS&amp;5-proxy for at nå knuder via Tors skjulte tjenester:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Skjul ikonet fra statusfeltet.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Skjul statusikon</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimér i stedet for at lukke applikationen, når vinduet lukkes. Når denne indstilling er aktiveret, vil applikationen først blive lukket, når Afslut vælges i menuen.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Tredjeparts-URL'er (fx et blokhåndteringsværktøj), der vises i transaktionsfanen som genvejsmenupunkter. %s i URL'en erstattes med transaktionens hash. Flere URL'er separeres med en lodret streg |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktuelle tilvalg for kommandolinjen, der tilsidesætter ovenstående tilvalg:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Åbn konfigurationsfilen for %1 fra arbejdsmappen.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Åbn konfigurationsfil</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Nulstil alle klientindstillinger til deres standard.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Nulstil indstillinger</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Netværk</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = efterlad så mange kerner fri)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Tegnebog</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Ekspert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Aktivér egenskaber for &amp;coin-styring</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Hvis du deaktiverer brug af ubekræftede byttepenge, kan byttepengene fra en transaktion ikke bruges, før pågældende transaktion har mindst én bekræftelse. Dette påvirker også måden hvorpå din saldo beregnes.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Brug ubekræftede byttepenge</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Åbn automatisk Bitcoin-klientens port på routeren. Dette virker kun, når din router understøtter UPnP, og UPnP er aktiveret.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Konfigurér port vha. &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Acceptér forbindelser udefra.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Tillad &amp;indkommende forbindelser</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Forbind til Bitcoin-netværket gennem en SOCKS5-proxy.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Forbind gennem SOCKS5-proxy (standard-proxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy-&amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port for proxyen (fx 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Bruges til at nå knuder via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Forbind til Bitcoin-netværket gennem en separat SOCKS5-proxy for Tors skjulte tjenester.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Vindue</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Vis kun et statusikon efter minimering af vinduet.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimér til statusfeltet i stedet for proceslinjen</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimér ved lukning</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Visning</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Sprog for brugergrænseflade:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Sproget for brugerfladen kan vælges her. Denne indstilling vil træde i kraft efter genstart af %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Enhed, som beløb vises i:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Vælg standard for underopdeling af enhed, som skal vises i brugergrænsefladen og ved afsendelse af bitcoins.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Hvorvidt egenskaber for coin-styring skal vises eller ej.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;Tredjeparts-transaktions-URL'er</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Ok</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Annullér</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>standard</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>ingen</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Bekræft nulstilling af indstillinger</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Genstart af klienten er nødvendig for at aktivere ændringer.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Klienten vil lukke ned. Vil du fortsætte?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Konfigurationsindstillinger</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Konfigurationsfilen bruges til at opsætte avancerede brugerindstillinger, som tilsidesætter indstillingerne i den grafiske brugerflade. Derudover vil eventuelle kommandolinjetilvalg tilsidesætte denne konfigurationsfil.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fejl</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Konfigurationsfilen kunne ikke åbnes.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Denne ændring vil kræve en genstart af klienten.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Den angivne proxy-adresse er ugyldig.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formular</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Den viste information kan være forældet. Din tegnebog synkroniserer automatisk med Bitcoin-netværket, når en forbindelse etableres, men denne proces er ikke gennemført endnu.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Kigge:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Tilgængelig:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Din nuværende tilgængelige saldo</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Afventende:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total saldo for transaktioner, som ikke er blevet bekræftet endnu, og som ikke endnu er en del af den tilgængelige saldo</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Umodne:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Minet saldo, som endnu ikke er modnet</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldi:</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Din nuværende totale saldo</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Din nuværende saldo på kigge-adresser</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Spendérbar:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Nylige transaktioner</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Ubekræftede transaktioner til kigge-adresser</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Minet saldo på kigge-adresser, som endnu ikke er modnet</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Nuværende totalsaldo på kigge-adresser</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Fejl i betalingsanmodning</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Kan ikke starte bitcoin: click-to-pay-håndtering</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI-håndtering</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Hentnings-URL for betalingsanmodning er ugyldig: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Ugyldig betalingsadresse %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI kan ikke tolkes! Dette kan skyldes en ugyldig Bitcoin-adresse eller forkert udformede URL-parametre.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Filhåndtering for betalingsanmodninger</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Fil for betalingsanmodning kan ikke læses! Dette kan skyldes en ugyldig fil for betalingsanmodning.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Betalingsanmodning afvist</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Netværk for betalingsanmodning stemmer ikke overens med klientens netværk.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Betalingsanmodning er udløbet.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Betalingsanmodning er ikke klargjort.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Ikke-verificerede betalingsanmodninger for tilpassede betalings-scripts understøttes ikke.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Ugyldig betalingsanmodning.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Anmodet betalingsbeløb på %1 er for lille (regnes som støv).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Tilbagebetaling fra %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Betalingsanmodning %1 er for stor (%2 byte; %3 byte tilladt).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Fejl under kommunikation med %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Betalingsanmodning kan ikke tolkes!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Fejlagtigt svar fra server %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Fejl i netværksforespørgsel</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Betaling anerkendt</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Brugeragent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Knude/tjeneste</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Knude-id</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Sendt</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Modtaget</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Beløb</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Indtast en Bitcoin-adresse (fx %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 t</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Ingen</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n sekund</numerusform><numerusform>%n sekunder</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minut</numerusform><numerusform>%n minutter</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n time</numerusform><numerusform>%n timer</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n dag</numerusform><numerusform>%n dage</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n uge</numerusform><numerusform>%n uger</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 og %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n år</numerusform><numerusform>%n år</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 har endnu ikke afsluttet på sikker vis…</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ukendt</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Fejl: Angivet datamappe “%1” eksisterer ikke.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Fejl: Kan ikke fortolke konfigurationsfil: %1. Brug kun syntaksen nøgle=værdi.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Fejl: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Gem billede…</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Kopiér foto</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Gem QR-kode</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG-billede (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Klientversion</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Information</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Fejlsøgningsvindue</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Generelt</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Bruger BerkeleyDB version</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datamappe</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Opstartstidspunkt</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Netværk</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Navn</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Antal forbindelser</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blokkæde</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Nuværende antal blokke</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Hukommelsespulje</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Aktuelt antal transaktioner</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Hukommelsesforbrug</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Nulstil</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Modtaget</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Sendt</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>Andre &amp;knuder</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Bandlyste knuder</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Vælg en anden knude for at se detaljeret information.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>På hvidliste</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Retning</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Version</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Startblok</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Synkroniserede headers</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Synkroniserede blokke</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Brugeragent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Åbn %1s fejlsøgningslogfil fra den aktuelle datamappe. Dette kan tage nogle få sekunder for store logfiler.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Formindsk skrifttypestørrelse</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Forstør skrifttypestørrelse</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Tjenester</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Bandlysningsscore</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Forbindelsestid</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Seneste afsendelse</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Seneste modtagelse</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping-tid</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Varigheden af den aktuelt igangværende ping.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping-ventetid</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Minimum ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Tidsforskydning</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Tidsstempel for seneste blok</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Åbn</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsol</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Netværkstrafik</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totaler</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Indkommende:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Udgående:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Fejlsøgningslogfil</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Ryd konsol</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;time</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;dag</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;uge</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;år</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Afbryd forbindelse</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Bandlys i</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Fjern bandlysning</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Velkommen til %1s RPC-konsol.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Brug op- og nedpilene til at navigere i historikken og %1 til at rydde skærmen.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Tast %1 for en oversigt over de tilgængelige kommandoer.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>For mere information om at bruge denne konsol, tast %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>ADVARSEL: Svindlere har tidligere aktivt bedt brugere om at indtaste kommandoer her for at stjæle indholdet af deres tegnebøger. Brug ikke denne konsol uden fuldt ud at forstå følgerne af en kommando.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Netværksaktivitet deaktiveret</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(knude-id: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>aldrig</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Indkommende</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Udgående</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nej</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Ukendt</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Beløb:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Mærkat:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Besked:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>En valgfri besked, der føjes til betalingsanmodningen, og som vil vises, når anmodningen åbnes. Bemærk: Beskeden vil ikke sendes sammen med betalingen over Bitcoin-netværket.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Et valgfrit mærkat, der associeres med den nye modtagelsesadresse.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Brug denne formular for at anmode om betalinger. Alle felter er &lt;b&gt;valgfri&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Et valgfrit beløb til anmodning. Lad dette felt være tomt eller indeholde nul for at anmode om et ikke-specifikt beløb.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Ryd alle felter af formen.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Ryd</translation>\n    </message>\n    <message>\n        <source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</source>\n        <translation>Rene segwit-adresser (kendt som Bech32 eller BIP-173) reducerer dine transaktionsgebyrer i det lange løb og giver bedre beskyttelse imod tastefejl, men gamle tegnebøger understøtter dem ikke. Hvis dette ikke vælges, vil i stedet en adresse, der fungerer med ældre tegnebøger, oprettes.</translation>\n    </message>\n    <message>\n        <source>Generate native segwit (Bech32) address</source>\n        <translation>Generér rene segwit-adresser (Bech32)</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historik over betalingsanmodninger</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Anmod om betaling</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Vis den valgte anmodning (gør det samme som dobbeltklik på en indgang)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Vis</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Fjern de valgte indgange fra listen</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Fjern</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Kopiér URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiér mærkat</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopiér besked</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiér beløb</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-kode</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopiér &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopiér &amp;adresse</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Gem billede…</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Anmod om betaling til %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Betalingsinformation</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Beløb</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Mærkat</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Besked</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Resulterende URI var for lang; prøv at forkorte teksten til mærkaten/beskeden.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Fejl ved kodning fra URI til QR-kode.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Mærkat</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Besked</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen mærkat)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(ingen besked)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(intet anmodet beløb)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Anmodet</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Send bitcoins</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Egenskaber for coin-styring</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Inputs…</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>valgt automatisk</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Utilstrækkelige midler!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Mængde:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Byte:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Beløb:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Gebyr:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Efter gebyr:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Byttepenge:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Hvis dette aktiveres, men byttepengeadressen er tom eller ugyldig, vil byttepenge blive sendt til en nygenereret adresse.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Tilpasset byttepengeadresse</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transaktionsgebyr:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Vælg…</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Brug af tilbagefaldsgebyret kan resultere i en transaktion, der tager adskillige timer eller dage (eller aldrig) at bekræfte. Overvej at vælge dit gebyr manuelt eller at vente indtil du har valideret hele kæden.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Advarsel: Gebyrestimering er ikke muligt i øjeblikket.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>sammenfold gebyropsætning</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>pr. kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Hvis det brugertilpassede gebyr er sat til 1000 satoshis, og transaktionen kun fylder 250 byte, betaler “pr. kilobyte” kun 250 satoshis i gebyr, mens “total mindst” betaler 1000 satoshis. For transaktioner større end en kilobyte betaler begge pr. kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Skjul</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Det er helt fint kun at betale det minimale gebyr, så længe den totale transaktionsvolumen er mindre end den plads, der er tilgængelig i blokkene. Men vær opmærksom på, at dette kan ende ud i transaktioner, der aldrig bliver bekræftet, når der bliver større forespørgsel efter bitcoin-transaktioner, end hvad netværket kan bearbejde.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(læs værktøjstippet)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Anbefalet:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Brugertilpasset:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Smart-gebyr er ikke initialiseret endnu. Dette tager typisk nogle få blokke…)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Send til flere modtagere på en gang</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Tilføj &amp;modtager</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Ryd alle felter af formen.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Støv:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Mål for bekræftelsestid:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Aktivér erstat-med-gebyr (RBF)</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Med erstat-med-gebyr (Replace-By-Fee, BIP-125) kan du øge en transaktions gebyr, efter den er sendt. Uden dette kan et højere gebyr anbefales for at kompensere for øget risiko for at transaktionen bliver forsinket.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Ryd &amp;alle</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Bekræft afsendelsen</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Afsend</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopiér mængde</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiér beløb</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopiér gebyr</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopiér eftergebyr</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopiér byte</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopiér støv</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopiér byttepenge</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blokke)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 til %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Er du sikker på, at du vil sende?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>tilføjet som transaktionsgebyr</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Beløb i alt %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>eller</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Du kan øge gebyret senere (signalerer erstat-med-gebyr, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Signalerer ikke erstat-med-gebyr, BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Bekræft afsendelse af bitcoins</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Modtageradressen er ikke gyldig. Tjek venligst igen.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Beløbet til betaling skal være større end 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Beløbet overstiger din saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Totalen overstiger din saldo, når transaktionsgebyret på %1 er inkluderet.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Adressegenganger fundet. Adresser bør kun bruges én gang hver.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Oprettelse af transaktion mislykkedes!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Transaktionen blev afvist med følgende begrundelse: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Et gebyr højere end %1 opfattes som et absurd højt gebyr.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Betalingsanmodning er udløbet.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Betal kun det påkrævede gebyr på %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Bekræftelse estimeret til at begynde om %n blok.</numerusform><numerusform>Bekræftelse estimeret til at begynde om %n blokke.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Advarsel: Ugyldig Bitcoin-adresse</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Advarsel: Ukendt byttepengeadresse</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Bekræft tilpasset byttepengeadresse</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Den adresse, du har valgt til byttepenge, er ikke en del af denne tegnebog. Nogle af eller alle penge i din tegnebog kan blive sendt til denne adresse. Er du sikker?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen mærkat)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Beløb:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Betal &amp;til:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Mærkat:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Vælg tidligere brugt adresse</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Dette er en normal betaling.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Bitcoin-adresse, som betalingen skal sendes til</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Indsæt adresse fra udklipsholderen</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Fjern denne indgang</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Gebyret vil blive trukket fra det sendte beløb. Modtageren vil modtage færre bitcoin, end du indtaster i beløbfeltet. Hvis flere modtagere vælges, vil gebyret deles ligeligt.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>&amp;Træk gebyr fra beløb</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Brug tilgængelig saldo</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Besked:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Dette er en uautentificeret betalingsanmodning.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Dette er en autentificeret betalingsanmodning.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Indtast et mærkat for denne adresse for at føje den til listen over brugte adresser</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>En besked, som blev føjet til “bitcon:”-URI'en, som vil gemmes med transaktionen til din reference. Bemærk: Denne besked vil ikke blive sendt over Bitcoin-netværket.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Betal til:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Indtast en mærkat for denne adresse for at føje den til din adressebog</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 lukker ned…</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Luk ikke computeren ned, før dette vindue forsvinder.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signaturer – Underskriv/verificér en besked</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Singér besked</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Du kan signere beskeder/aftaler med dine adresser for at bevise, at du kan modtage bitcoin, der bliver sendt til adresserne. Vær forsigtig med ikke at signere noget vagt eller tilfældigt, da eventuelle phishing-angreb kan snyde dig til at overlade din identitet til dem. Signér kun fuldt ud detaljerede udsagn, som du er enig i.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Bitcoin-adresse, som beskeden skal signeres med</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Vælg tidligere brugt adresse</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Indsæt adresse fra udklipsholderen</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Indtast her beskeden, du ønsker at signere</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signatur</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopiér den nuværende signatur til systemets udklipsholder</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Signér denne besked for at bevise, at Bitcoin-adressen tilhører dig</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Signér &amp;besked</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Nulstil alle “signér besked”-felter</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Ryd &amp;alle</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verificér besked</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Indtast modtagerens adresse, besked (vær sikker på at kopiere linjeskift, mellemrum, tabuleringer, etc. præcist) og signatur herunder for at verificere beskeden. Vær forsigtig med ikke at læse noget ud fra signaturen, som ikke står i selve beskeden, for at undgå at blive snydt af et eventuelt man-in-the-middle-angreb. Bemærk, at dette kun beviser, at den signerende person kan modtage med adressen; det kan ikke bevise hvem der har sendt en given transaktion!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Bitcoin-adressen, som beskeden blev signeret med</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verificér beskeden for at sikre, at den er signeret med den angivne Bitcoin-adresse</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verificér &amp;besked</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Nulstil alle “verificér besked”-felter</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Klik “Signér besked” for at generere underskriften</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Den indtastede adresse er ugyldig.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Tjek venligst adressen og forsøg igen.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Den indtastede adresse henviser ikke til en nøgle.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Tegnebogsoplåsning annulleret.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Den private nøgle for den indtastede adresse er ikke tilgængelig.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Signering af besked mislykkedes.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Besked signeret.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Signaturen kunne ikke afkodes.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Tjek venligst signaturen og forsøg igen.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Signaturen passer ikke overens med beskedens indhold.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Verificering af besked mislykkedes.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Besked verificeret.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnetværk]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Åben i %n yderligere blok</numerusform><numerusform>Åben i %n yderligere blokke</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Åben indtil %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>i konflikt med en transaktion, der har %1 bekræftelser</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/ubekræftet, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>i hukommelsespulje</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>ikke i hukommelsespulje</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>opgivet</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/ubekræftet</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 bekræftelser</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, er ikke blevet transmitteret endnu</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, transmitteret igennem %n knude</numerusform><numerusform>, transmitteret igennem %n knuder</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Kilde</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Genereret</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Fra</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ukendt</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Til</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>egen adresse</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>kigge</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>mærkat</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Kredit</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>modner om %n blok</numerusform><numerusform>modner om %n blokke</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>ikke accepteret</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debet</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Total debet</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Total kredit</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transaktionsgebyr</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Nettobeløb</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Besked</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Kommentar</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transaktions-ID</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Totalstørrelse af transaktion</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Outputindeks</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Forretningsdrivende</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Minede bitcoins skal modne %1 blokke, før de kan bruges. Da du genererede denne blok, blev den transmitteret til netværket for at blive føjet til blokkæden. Hvis det ikke lykkes at få den i kæden, vil dens tilstand ændres til “ikke accepteret”, og den vil ikke kunne bruges. Dette kan ske nu og da, hvis en anden knude udvinder en blok inden for nogle få sekunder fra din.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Fejlsøgningsinformation</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transaktion</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Input</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Beløb</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>sand</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>falsk</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Denne rude viser en detaljeret beskrivelse af transaktionen</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detaljer for %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Mærkat</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Åben i %n yderligere blok</numerusform><numerusform>Åben i %n yderligere blokke</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Åben indtil %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Ubekræftet</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Opgivet</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Bekræfter (%1 af %2 anbefalede bekræftelser)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Bekræftet (%1 bekræftelser)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Konflikt</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Umoden (%1 bekræftelser; vil være tilgængelig efter %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Denne blok blev ikke modtaget af nogen andre knuder og vil formentlig ikke blive accepteret!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Genereret, men ikke accepteret</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Modtaget med</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Modtaget fra</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Sendt til</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Betaling til dig selv</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minet</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>kigge</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen mærkat)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Transaktionsstatus. Hold musen over dette felt for at vise antallet af bekræftelser.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Dato og klokkeslæt for modtagelse af transaktionen.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Transaktionstype.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Afgør hvorvidt en kigge-adresse er involveret i denne transaktion.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Brugerdefineret hensigt/formål med transaktionen.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Beløb trukket fra eller tilføjet balance.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Alle</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>I dag</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Denne uge</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Denne måned</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Sidste måned</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>I år</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Interval…</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Modtaget med</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Sendt til</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Til dig selv</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minet</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Andet</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Indtast adresse, transaktions-ID eller mærkat for at søge</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minimumsbeløb</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Opgiv transaktion</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Forøg transaktionsgebyr</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiér adresse</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiér mærkat</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiér beløb</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopiér transaktions-ID</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Kopiér rå transaktion</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Kopiér komplette transaktionsdetaljer</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Redigér mærkat</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Vis transaktionsdetaljer</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Eksportér transaktionshistorik</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Kommasepareret fil (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bekræftet</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Kigge</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Mærkat</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksport mislykkedes</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>En fejl opstod under gemning af transaktionshistorik til %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Eksport problemfri</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Transaktionshistorikken blev gemt til %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Interval:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>til</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Enhed, som beløb vises i. Klik for at vælge en anden enhed.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Ingen tegnebog er indlæst.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Send bitcoins</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Fejl ved gebyrforøgelse</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Forøgelse af transaktionsgebyr mislykkedes</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Vil du forøge gebyret?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Aktuelt gebyr:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Forøgelse:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nyt gebyr:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Bekræft gebyrforøgelse</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Kan ikke signere transaktionen.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Kunne ikke gennemføre transaktionen</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksportér</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksportér den aktuelle visning til en fil</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Sikkerhedskopiér tegnebog</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Tegnebogsdata (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Sikkerhedskopiering mislykkedes</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Der skete en fejl under gemning af tegnebogsdata til %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Sikkerhedskopiering problemfri</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Tegnebogsdata blev gemt til %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Indstillinger:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Angiv datamappe</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Forbind til en knude for at modtage adresser på andre knuder, og afbryd derefter</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Angiv din egen offentlige adresse</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Acceptér kommandolinje- og JSON-RPC-kommandoer</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distribueret under MIT-softwarelicensen; se den vedlagte fil %s eller %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Hvis &lt;category&gt; ikke angives eller hvis &lt;category&gt; = 1, udskriv al fejlretningsinformation.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Beskæring er sat under minimumsgrænsen på %d MiB. Brug venligst et større tal.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Beskæring: Seneste synkronisering rækker udover beskårne data. Du er nødt til at bruge -reindex (downloade hele blokkæden igen i fald af beskåret knude)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Genindlæsninger er ikke mulige i beskåret tilstand. Du er nødt til at bruge -reindex, hvilket vil downloade hele blokkæden igen.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Fejl: En alvorlig intern fejl er opstået. Se debug.log for detaljer</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Gebyr (i %s/kB) der skal lægges til de transaktioner du sender (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Beskærer bloklager…</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Kør i baggrunden som en service, og acceptér kommandoer</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Kunne ikke starte HTTP-server. Se fejlretningslog for detaljer.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Udviklerne af %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>En gebyrsats (i %s/kB), som vil blive brugt, hvis gebyrestimering har utilstrækkelig data (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Acceptér videresendte transaktioner, der modtages fra hvidlistede knuder, selv når transaktioner ikke videresendes (standard: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Tilføj en knude at forbinde til og forsøg at holde forbindelsen åben (se hjælp for RPC-kommandoen “addnode” for mere info)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Tildel til den givne adresse og lyt altid på den. Brug [vært]:port-notation for IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Kan ikke opnå en lås på datamappe %s. %s kører sansynligvis allerede.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Kan ikke give specifikke forbindelser og få addrman til at finde udgående forbindelser på samme tid.</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Forbind kun til de specificerede knuder; -connect=0 deaktiverer automatiske forbindelser (reglerne for denne knude er de samme som for -addnode)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Slet alle transaktioner i tegnebogen og genskab kun disse dele af blokkæden gennem -rescan under opstart</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Fejl under læsning af %s! Alle nøgler blev læst korrekt, men transaktionsdata eller indgange i adressebogen kan mangle eller være ukorrekte.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Ekskludér fejlsøgningsinformation for en kategori. Kan bruges sammen med -debug=1 for at udskrive fejlsøgningslogs for alle kategorier undtaget én eller flere specificerede kategorier.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Udfør kommando, når en transaktion i tegnebogen ændres (%s i kommandoen erstattes med TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Ekstra transaktioner, der skal beholdes i hukommelsen til kompakte blokgenopbygninger (standard: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Hvis denne blok er i kæden, så antag at den og dens forgængere er gyldige, og spring potentielt deres scriptverificering over (0 for at verificere alle, standard: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Justering af maksimalt tilladt gennemsnitlig afvigelse fra peer-tid. Den lokale opfattelse af tid kan blive påvirket frem eller tilbage af peers med denne mængde tid. (standard: %u sekunder)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Maksimalt totalgebyr (i %s) der må bruges i en enkelt tegnebogstransaktion eller rå transaktion; en for lav en værdi kan afbryde store transaktioner (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Undersøg venligst at din computers dato og klokkeslet er korrekt indstillet! Hvis der er fejl i disse, vil %s ikke fungere korrekt.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Overvej venligst at bidrage til udviklingen, hvis du finder %s brugbar. Besøg %s for yderligere information om softwaren.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Hvis beholdning af adresser er lav, forespørg da adresser på andre knuder via DNS-opslag (standard: 1 med mindre -connect bruges)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Reducér pladskravene ved at beskære (slette, “prune”) gamle blokke. Dette tillader pruneblockchain-RPC'en at blive kaldt for at slette specifikke blokke, og det aktiverer automatisk beskæring af gamle blokke, hvis en målstørrelse i MiB er angivet. Denne tilstand er ikke kompatibel med -txindex og -rescan. Advarsel: Fortrydelse af denne indstilling kræver download af hele blokkæden igen. (standard: 0 = slå beskæring af blokke fra, 1 = tillad manuel beskæring via RPC, &gt;%u = beskær automatisk blokfiler for at bliver under den angivne målstørrelse i MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Sæt den laveste gebyrsats (i %s/kB) for transaktioner, der skal inkluderes i blokoprettelse. (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Sæt antallet af scriptverificeringstråde (%u til %d, 0 = auto, &lt;0 = efterlad det antal kernet fri, standard: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Blokdatabasen indeholder en blok, som ser ud til at være fra fremtiden. Dette kan skyldes, at din computers dato og tid ikke er sat korrekt. Genopbyg kun blokdatabasen, hvis du er sikker på, at din computers dato og tid er korrekt</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Dette er en foreløbig testudgivelse – brug på eget ansvar – brug ikke til mining eller handelsprogrammer</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Dette er det transaktionsgebyr, du kan kassere, hvis byttepengene er mindre end støv på dette niveau</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Kan ikke genafspille blokke. Du er nødt til at genopbytte databasen ved hjælp af -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Kan ikke spole databasen tilbage til en tilstand inden en splitning. Du er nødt til at downloade blokkæden igen</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Brug UPnP for at konfigurere den lyttende port (standard: 1 under lytning og ingen -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Brugernavn og hashet adgangskode for JSON-RPC-forbindelser. Feltet &lt;userpw&gt; er i formatet: &lt;BRUGERNAVN&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Et kanonisk Python-skript er inkluderet i share/rpcuser. Klienten forbinder så normalt ved hjælp af argumentparret rpcuser=&lt;BRUGERNAVN&gt;/rpcpassword=&lt;ADGANGSKODE&gt;. Dette tilvalg kan angives flere gange</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Tegnebogen vil ikke oprette transaktioner, som overtræder begrænsningen for hukommelsespuljekæden (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Advarsel: Netværket ser ikke ud til at være fuldt ud enige! Enkelte minere ser ud til at opleve problemer.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Advarsel: Vi ser ikke ud til at være fuldt ud enige med andre knuder! Du kan være nødt til at opgradere, eller andre knuder kan være nødt til at opgradere.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Hvorvidt hukommelsespuljen skal gemmes under nedlukning og indlæses under genstart (standard: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d af de seneste 100 blokke har en uventet version</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s ødelagt, redning af data mislykkedes</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool skal være mindst %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;kategori&gt; kan være:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Acceptér forbindelser udefra (standard: 1 hvis hverken -proxy eller -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Føj kommentar til brugeragentstrengen</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Forsøg at genskabe private nøgler fra en ødelagt tegnebog under opstart</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Blokoprettelsestilvalg:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Kan ikke finde -%s-adressen: “%s”</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Indstillinger for kædevalg:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Ændr indeks uden for interval</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Tilvalg for forbindelser:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Ophavsret © %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Ødelagt blokdatabase opdaget</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Tilvalg for fejlfinding/test:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Indlæs ikke tegnebogen og deaktivér tegnebogs-RPC-kald</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Ønsker du at genopbygge blokdatabasen nu?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Aktivér offentliggørelse af hash-blok i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Aktivér offentliggørelse af hash-transaktion i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Aktivér offentliggørelse af rå blok i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Aktivér offentliggørelse af rå transaktion i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Aktivér transaktionserstatning i hukommelsespuljen (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Fejl under oprettelse af %s: Du kan ikke oprette ikke-HD-tegnebøger med denne version.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Klargøring af blokdatabase mislykkedes</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Klargøring af tegnebogsdatabasemiljøet %s mislykkedes!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Fejl under indlæsning af %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Fejl under indlæsning af %s: Tegnebog ødelagt</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Fejl under indlæsning af %s: Tegnebog kræver nyere version af %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Indlæsning af blokdatabase mislykkedes</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Åbning af blokdatabase mislykkedes</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Fejl: Mangel på ledig diskplads!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Lytning på enhver port mislykkedes. Brug -listen=0, hvis du ønsker dette.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Genindlæsning af tegnebogen under initialisering mislykkedes</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importerer…</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Ukorrekt eller ingen tilblivelsesblok fundet. Forkert datamappe for netværk?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Sundhedstjek under initialisering mislykkedes. %s lukker ned.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Ugyldigt beløb for -%s=&lt;beløb&gt;: “%s”</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Ugyldigt beløb for -discardfee=&lt;amount&gt;: “%s”</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Ugyldigt beløb for -fallbackfee=&lt;beløb&gt;: “%s”</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Hold hukommelsespuljen med transaktioner under &lt;n&gt; megabyte (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Indlæser P2P-adresser…</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Indlæser bandlysningsliste…</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Placering for autentificerings-cookie (standard: datamappe)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>For få tilgængelige fildeskriptorer.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Tilslut kun til knuder i netværk &lt;net&gt; (IPv4, IPv6 eller Onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Udskriv denne hjælpetekst og afslut</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Udskriv version og afslut</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Beskæring kan ikke opsættes med en negativ værdi.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Beskæringstilstand er ikke kompatibel med -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Genopbyg kædetilstand og blokindeks fra blk*.dat-filerne på disken</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Genopbyg kædetilstand ud fra de aktuelt indekserede blokke</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Genafspiller blokke…</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Spoler blokke tilbage…</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>Send transaktioner med fuld-RBF opt-in aktiveret (kun RPC, standard: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Sæt cache-størrelse for database i megabytes (%d til %d; standard: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Angiv tegnebogsfil (inden for datamappe)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Kildekoden er tilgængelig fra %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Beregning af transaktionsgebyr og byttepenge mislykkedes</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Ikke i stand til at tildele til %s på denne computer. %s kører formodentlig allerede.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Argument -benchmark understøttes ikke og ignoreres; brug -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Argument -debugnet understøttes ikke og ignoreres; brug -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Argument -tor understøttes ikke; brug -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Ikke understøttet logningskategori %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Opgraderer UTXO-database</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Brug UPnP til at konfigurere den lyttende port (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Brug testkæden</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Brugeragent-kommentar (%s) indeholder usikre tegn.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verificerer blokke…</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Tilvalg for fejlfinding/test af tegnebog:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Det var nødvendigt at genskrive tegnebogen: Genstart %s for at gennemføre</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Tilvalg for tegnebog:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Tillad JSON-RPC-forbindelser fra angivet kilde. Gyldig for &lt;ip&gt; er en enkelt IP (fx 1.2.3.4), et netværk/netmaske (fx 1.2.3.4/255.255.255.0) eller et netværk/CIDR (fx 1.2.3.4/24). Dette tilvalg kan angives flere gange</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Tildel given adresse og sæt andre knuder, der forbinder til den, på hvidliste. Brug [vært]:port notation for IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Opret nye filer med systemstandard for rettigheder i stedet for umask 077 (kun virksomt med tegnebogsfunktionalitet deaktiveret)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Opdag egne IP-adresser (standard: 1 under lytning og ingen -externalip eller -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Fejl: Lytning efter indkommende forbindelser mislykkedes (lytning resultarede i fejl %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Udfør kommando, når en relevant alarm modtages eller vi ser en virkelig lang udsplitning (%s i cmd erstattes af besked)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Gebyrer (i %s/kB) mindre end dette opfattes som intet gebyr for videresendelse, mining og oprettelse af transaktioner (standard: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Hvis paytxfee ikke er sat, inkluderes nok gebyr til at transaktioner begynder at blive bekræftet ingen for gennemsnitligt n blokke (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Ugyldigt beløb for -maxtxfee=&lt;beløb&gt;: “%s” (skal være på mindst minrelay-gebyret på %s for at undgå hængende transaktioner)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maksimal størrelse på data i transaktioner til dataoverførsel, som vi videresender og miner (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Brug tilfældige akkreditiver for hver proxy-forbindelse. Dette aktiverer strømisolation med Tor (standard: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Transaktionsbeløbet er for lille til at sende, når gebyret er trukket fra</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Andre knuder på hvidliste kan ikke DoS-bandlyses, og deres transaktioner videresendes altid, selv hvis de allerede er i hukommelsespuljen. Brugbart til fx et adgangspunkt</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Du er nødt til at genopbygge databasen ved hjælp af -reindex for at gå tilbage til ikke-beskåret tilstand. Dette vil downloade hele blokkæden igen</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(standard: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Acceptér offentlige REST-anmodninger (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Opret automatisk skjult Tor-tjeneste (standard: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Forbind gennem SOCKS5-proxy</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Fejl under indlæsning af %s: Du kan ikke slå HD fra på en allerede eksisterende HD-tegnebog</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Fejl under læsning fra database; lukker ned.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Fejl under opgradering af kædetilstandsdatabase</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importerer blokeringer fra ekstern blk000??.dat-fil under opstart</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Ugyldig -onion-adresse eller værtsnavn: “%s”</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Ugyldig -proxy-adresse eller værtsnavn: “%s”</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Ugyldigt beløb for -paytxfee=&lt;beløb&gt;: “%s” (skal være mindst %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Ugyldig netmaske angivet i -whitelist: “%s”</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Behold højest &lt;n&gt; uforbindelige transaktioner i hukommelsen (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Nødt til at angive en port med -whitebinde: “%s”</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Videresendelsesvalgmuligheder for knude:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Tilvalg for RPC-server:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reducerer -maxconnections fra %d til %d på grund af systembegrænsninger.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Genindlæs blokkæden efter manglende tegnebogstransaktioner under opstart</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Send sporings-/fejlsøgningsinformation til konsollen i stedet for debug.log filen</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Vis alle tilvalg for fejlsøgning (brug: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Formindsk debug.log filen ved klientopstart (standard: 1 hvis ikke -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Signering af transaktion mislykkedes</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Transaktionsbeløbet er for lille til at betale gebyret</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Dette er eksperimentelt software.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Adgangskode for Tor kontrolport (standard: tom)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Tor kontrolport, der skal bruges, hvis onion-lytning er aktiveret (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transaktionsbeløb er for lavt</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transaktion for stor til gebyrretningslinjer</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transaktionen er for stor</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Ikke i stand til at tildele til %s på denne computer (bind returnerede fejl %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Kan ikke generere indledningsvise nøgler</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Opgradér tegnebog til seneste format under opstart</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Brugernavn til JSON-RPC-forbindelser</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Verificerer tegnebøger…</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Tegnebog %s findes uden for tegnebogsmappen %s</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Advarsel</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Advarsel: Ukendte nye regler aktiveret (versionsbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Hvorvidt der skal arbejdes i kun-blokke-tilstand (standard: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Du er nødt til at genopbygge databasen ved hjælp af -reindex for at ændre -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Zapper alle transaktioner fra tegnebog…</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ-notifikationsindstillinger:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Adgangskode til JSON-RPC-forbindelser</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Udfør kommando, når den bedste blok ændres (%s i kommandoen erstattes med blokhash)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Tillad DNS-opslag for -addnode, -seednode og -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = behold metadata for transaktion, fx kontoindehaver og information om betalingsanmodning, 2 = drop metadata for transaktion)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee er sat meget højt! Gebyrer så store risikeres betalt på en enkelt transaktion.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Tildel til den givne adresse for at lytte efter JSON-RPC-forbindelser. Dette tilvalg ignoreres med mindre -rpcwallet også bruges. Port er valgfri og tilsidesætter -rpcport. Brug [vært]:port-notation for IPv6. Denne valgmulighed kan angives flere gange (standard: 127.0.0.1 og ::1, dvs. localhost, eller hvis -rpcallowip is angivet: 0.0.0.0 og ::, dvs. alle adresser)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Behold ikke transaktioner i hukommelsespuljen i mere end &lt;n&gt; timer (default: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Tilsvarende bytes pr. sigop i transaktioner, som videresendes og mines (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Fejl under indlæsning af %s: Du kan ikke aktivere HD på en allerede eksisterende ikke-HD-tegnebog</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Fejl under indlæsning af tegnebog %s. “-wallet”-parameteren kan kun angive et filnavn (ikke en sti).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Gebyrer (i %s/kB) mindre end dette opfattes som intet gebyr under oprettelse af transaktioner (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Gennemtving videresendelse af transaktioner fra hvidlistede knuder, selv om de overtræder lokal videresendelsespolitik (standard: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Hvor gennemarbejdet blokverificeringen for -checkblocks er (0-4; standard: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Vedligehold et komplet transaktionsindeks, der bruges af rpc-kaldet getrawtransaction (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Antal sekunder, som knuder der opfører sig upassende, skal vente før reetablering (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Udskriv fejlsøgningsinformation (standard: %u, angivelse af &lt;kategori&gt; er valgfri)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Indstiller serialiseringen af rå transaktioner eller blok-hex returneret i ikke-verbose tilstand, non-segwit(0) eller sigwit(1) (standard: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Angiv mappe, der skal indeholde tegnebøger (standard: &lt;datadir&gt;/wallets hvis den eksisterer, ellers &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Angiv placering af logfil til fejlretning: Dette kan være en absolut sti eller en sti relativ til datamappen (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Understøt filtrering af blokke og transaktioner med Bloom-filtre (standard: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>Den gebyrsats (i %s/kB), som indikerer din tolerance for at kassere byttepenge ved at føje dem til gebyret (standard: %s). Bemærk: Et output kasseres, hvis det anses som støv ved denne rate, men der vil altid kasseres op til støvvideresendelsesgebyret, og et kasseringsgebyr derover er begrænset af gebyrestimatet for det længste mål</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Dette er transaktionsgebyret, du kan betale, når gebyrestimeringer ikke er tilgængelige.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Dette produkt indeholder software, der er udviklet af OpenSSL-projektet for brug i OpenSSL-værktøjskassen %s, samt kryptografisk software, der er skrevet af Eric Young, samt UPnP-software, der er skrevet af Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Den totale længde på netværksversionsstrengen (%i) overstiger maksimallængden (%i). Reducér antaller af eller størrelsen på uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Prøver at holde udadgående traffik under det givne mål (i MiB pr. 24 timer), 0 = ingen grænse (standard: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Argument -socks understøttes ikke. Det er ikke længere muligt at sætte SOCKS-version; kun SOCKS5-proxier understøttes.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Argument -whitelistalwaysrelay understøttes ikke og ignoreres; brug -whitelistrelay og/eller -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Brug separat SOCS5-proxy for at nå knuder via Tors skjulte tjenester (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Advarsel: Ukendte blokversioner bliver minet! Det er muligt, at ukendte regler er i brug</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Advarsel: Tegnebogsfil ødelagt, data reddet! Oprindelig %s gemt som %s i %s; hvis din saldo eller dine transaktioner er forkert, bør du genskabe fra en sikkerhedskopi.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Sæt knuder på hvidliste, som forbinder fra den givne IP-adresse (fx 1.2.3.4) eller CIDR-noteret netværk (fx 1.2.3.0/24). Kan angives flere gange.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s er meget højt sat!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(standard: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Forespørg altid adresser på andre knuder via DNS-opslag (default: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Fejl under indlæsning af tegnebog %s. -wallet filnavn skal være en almindelig fil.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Fejl under indlæsning af tegnebog %s. -wallet filnavn angivet mere end én gang.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Fejl under indlæsning af tegnebog %s. Ugyldige tegn i -wallet filnavn.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Antal blokke som tjekkes ved opstart (standard: %u, 0 = alle)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Inkludér IP-adresser i fejlretningsoutput (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Nøglepulje løb tør; kald venligst keypoolrefill først</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Lyt efter JSON-RPC-forbindelser på &lt;port&gt; (standard: %u eller testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Lyt efter forbindelser på &lt;port&gt; (standard: %u eller testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Oprethold højest &lt;n&gt; forbindelser til andre knuder (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Få tegnebogen til at transmittere transaktioner</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maksimum for modtagelsesbuffer pr. forbindelse, &lt;n&gt;*1000 byte (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maksimum for afsendelsesbuffer pr. forbindelse, &lt;n&gt;*1000 byte (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Føj tidsstempel foran fejlsøgningsoutput (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Videresend og udvind databærer-transaktioner (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Videresend ikke-P2SH multisig (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Sæt nøglepuljestørrelse til &lt;n&gt; (standard: %u)\n</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Sæt maksimal BIP141-blokvægt (standard: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Angiv antallet af tråde til at håndtere RPC-kald (standard: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Angiv konfigurationsfil (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Angiv tilslutningstimeout i millisekunder (minimum: 1, standard: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Angiv pid-fil (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Brug ubekræftede byttepenge under afsendelse af transaktioner (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Starter netværkstråde…</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Tegnebogen vil undgå at betale mindre end minimum-videresendelsesgebyret.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Dette er det transaktionsgebyr, du minimum betaler for hver transaktion.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Dette er transaktionsgebyret, som betaler, når du sender en transaktion.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Grænse for afbrydelse af forbindelse til knuder, der opfører sig upassende (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Transaktionsbeløb må ikke være negative</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Transaktionen har en for lang hukommelsespuljekæde</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Transaktionen skal have mindst én modtager</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Ukendt netværk anført i -onlynet: “%s”</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Manglende dækning</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Indlæser blokindeks…</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Indlæser tegnebog…</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Kan ikke nedgradere tegnebog</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Genindlæser…</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Indlæsning gennemført</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fejl</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_de.ts",
    "content": "<TS language=\"de\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Rechtsklick zum Bearbeiten der Adresse oder der Bezeichnung</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Eine neue Adresse erstellen</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Neu</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Ausgewählte Adresse in die Zwischenablage kopieren</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopieren</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Schließen</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Ausgewählte Adresse aus der Liste entfernen</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Daten der aktuellen Ansicht in eine Datei exportieren</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>E&amp;xportieren</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Löschen</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Wählen Sie die Adresse aus, an die Sie Bitcoins senden möchten</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Wählen Sie die Adresse aus, mit der Sie Bitcoins empfangen wollen</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Auswählen</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Sender_in Addresse</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Empfangsadressen</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Dies sind ihre Bitcoin-Adressen zum Tätigen von Überweisungen. Bitte prüfen Sie den Betrag und die Adresse des Empfängers, bevor Sie Bitcoins überweisen.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Dies sind Ihre Bitcoin-Adressen zum Empfangen von Zahlungen. Es wird empfohlen, für jede Transaktion eine neue Empfangsadresse zu verwenden.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Adresse kopieren</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>&amp;Bezeichnung kopieren</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Bearbeiten</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Adressliste exportieren</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Kommagetrennte-Datei (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportieren fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Beim Speichern der Adressliste nach %1 ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Bezeichnung</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(keine Bezeichnung)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Passphrasendialog</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Passphrase eingeben</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Neue Passphrase</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Neue Passphrase bestätigen</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Zeige das Passwort</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Geben Sie die neue Passphrase für die Brieftasche ein.&lt;br&gt;Bitte benutzen Sie eine Passphrase bestehend aus &lt;b&gt;zehn oder mehr zufälligen Zeichen&lt;/b&gt; oder &lt;b&gt;acht oder mehr Wörtern&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Wallet verschlüsseln</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Dieser Vorgang benötigt ihre Passphrase, um die Brieftasche zu entsperren.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Wallet entsperren</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Dieser Vorgang benötigt Ihre Passphrase, um die Brieftasche zu entschlüsseln.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Brieftasche entschlüsseln</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Passphrase ändern</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Geben Sie die alte und neue Brieftschen-Passphrase ein.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Brieftaschen-Verschlüsselung bestätigen</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Warnung: Wenn Sie Ihre Brieftasche verschlüsseln und Ihre Passphrase verlieren, werden Sie &lt;b&gt;alle Ihre Bitcoins verlieren&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Sind Sie sich sicher, dass Sie Ihre Brieftasche verschlüsseln möchten?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Brieftasche verschlüsselt</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 wird jetzt beendet, um den Verschlüsselungsprozess abzuschließen. Bitte beachten Sie, dass die Brieftaschen-Verschlüsselung nicht vollständig vor Diebstahl Ihrer Bitcoins durch Schadprogramme schützt, die Ihren Computer befällt.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>WICHTIG: Alle vorherigen Brieftaschen-Sicherungen sollten durch die neu erzeugte, verschlüsselte Brieftasche ersetzt werden. Aus Sicherheitsgründen werden vorherige Sicherungen der unverschlüsselten Brieftasche nutzlos, sobald Sie die neue, verschlüsselte Brieftasche verwenden.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Brieftaschen-Verschlüsselung fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Die Brieftaschen-Verschlüsselung ist aufgrund eines internen Fehlers fehlgeschlagen. Ihre Brieftasche wurde nicht verschlüsselt.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Die eingegebenen Passphrasen stimmen nicht überein.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Brieftaschen-Entsperrung fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Die eingegebene Passphrase zur Brieftaschen-Entschlüsselung war nicht korrekt.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Brieftaschen-Entschlüsselung fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Die Brieftaschen-Passphrase wurde erfolgreich geändert.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Warnung: Die Feststelltaste ist aktiviert!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netzmaske</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Gesperrt bis</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Nachricht s&amp;ignieren...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronisiere mit Netzwerk...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Übersicht</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Knoten</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Allgemeine Wallet-Übersicht anzeigen</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaktionen</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Transaktionsverlauf durchsehen</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Beenden</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Anwendung beenden</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>Über %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Informationen über %1 anzeigen</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Über &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Informationen über Qt anzeigen</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Konfiguration...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Konfiguration von %1 bearbeiten</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Wallet &amp;verschlüsseln...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Wallet &amp;sichern...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Passphrase &amp;ändern...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Zahlungsadressen...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Empfangsadressen...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>&amp;URI öffnen...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Klicken zum Deaktivieren der Netzwerkaktivität.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Netzwerkaktivität deaktiviert.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Klicken zum Aktivieren der Netzwerkaktivität.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Kopfdaten werden synchronisiert (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindiziere Blöcke auf Datenträger...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Bitcoins an eine Bitcoin-Adresse überweisen</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Eine Wallet-Sicherungskopie erstellen und abspeichern</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Ändert die Passphrase, die für die Wallet-Verschlüsselung benutzt wird</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Debugfenster</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Debugging- und Diagnosekonsole öffnen</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Nachricht &amp;verifizieren...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Wallet</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Überweisen</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Empfangen</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Anzeigen / Verstecken</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Das Hauptfenster anzeigen oder verstecken</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Verschlüsselt die zu Ihrer Wallet gehörenden privaten Schlüssel</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Nachrichten signieren, um den Besitz Ihrer Bitcoin-Adressen zu beweisen</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Nachrichten verifizieren, um sicherzustellen, dass diese mit den angegebenen Bitcoin-Adressen signiert wurden</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Datei</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Einstellungen</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Hilfe</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Registerkartenleiste</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Zahlungen anfordern (erzeugt QR-Codes und \"bitcoin:\"-URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Liste verwendeter Zahlungsadressen und Bezeichnungen anzeigen</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Liste verwendeter Empfangsadressen und Bezeichnungen anzeigen</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Eine \"bitcoin:\"-URI oder Zahlungsanforderung öffnen</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Kommandozeilenoptionen</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktive Verbindung zum Bitcoin-Netzwerk</numerusform><numerusform>%n aktive Verbindungen zum Bitcoin-Netzwerk</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indiziere Blöcke auf Datenträger...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Verarbeite Blöcke auf Datenträger...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n Block des Transaktionsverlaufs verarbeitet.</numerusform><numerusform>%n Blöcke des Transaktionsverlaufs verarbeitet.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 im Rückstand</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Der letzte empfangene Block ist %1 alt.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transaktionen hiernach werden noch nicht angezeigt.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fehler</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Warnung</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Hinweis</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Auf aktuellem Stand</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Zeige den \"%1\"-Hilfetext, um eine Liste mit möglichen Kommandozeilenoptionen zu erhalten</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 Client</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Verbinde mit Netzwerk...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Hole auf...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Betrag: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Typ: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Bezeichnung: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresse: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Gesendete Transaktion</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Eingehende Transaktion</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD Schlüssel Generierung ist &lt;b&gt;aktiviert&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD Schlüssel Generierung ist &lt;b&gt;deaktiviert&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Wallet ist &lt;b&gt;verschlüsselt&lt;/b&gt; und aktuell &lt;b&gt;entsperrt&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Wallet ist &lt;b&gt;verschlüsselt&lt;/b&gt; und aktuell &lt;b&gt;gesperrt&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Ein schwerer Fehler ist aufgetreten. Bitcoin kann nicht stabil weiter ausgeführt werden und wird beendet.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Münzauswahl (\"Coin Control\")</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Anzahl:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Byte:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Betrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Gebühr:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>\"Dust\":</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Abzüglich Gebühr:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Wechselgeld:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>Alles (de)selektieren</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Baumansicht</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Listenansicht</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Betrag</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Empfangen über Bezeichnung</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Empfangen über Adresse</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Bestätigungen</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bestätigt</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Adresse kopieren</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Bezeichnung kopieren</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Betrag kopieren</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Transaktionskennung kopieren</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Nicht ausgegebenen Betrag sperren</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Nicht ausgegebenen Betrag entsperren</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Anzahl kopieren</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Gebühr kopieren</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Abzüglich Gebühr kopieren</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Byte kopieren</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>\"Staub\" kopieren</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Wechselgeld kopieren</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 gesperrt)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ja</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nein</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Diese Bezeichnung wird rot, wenn irgendein Empfänger einen Betrag kleiner als die derzeitige \"Staubgrenze\" erhält.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Kann pro Eingabe um +/- %1 Satoshi(s) abweichen.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(keine Bezeichnung)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>Wechselgeld von %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(Wechselgeld)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Adresse bearbeiten</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Bezeichnung</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Bezeichnung, die dem Adresslisteneintrag zugeordnet ist.</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Adresse, die dem Adresslisteneintrag zugeordnet ist. Diese kann nur bei Zahlungsadressen verändert werden.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresse</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Neue Empfangsadresse</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Neue Zahlungsadresse</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Empfangsadresse bearbeiten</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Zahlungsadresse bearbeiten</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Die eingegebene Adresse \"%1\" ist keine gültige Bitcoin-Adresse.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Die eingegebene Adresse \"%1\" befindet sich bereits im Adressbuch.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Brieftasche konnte nicht entsperrt werden.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Erzeugung eines neuen Schlüssels fehlgeschlagen.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Es wird ein neues Datenverzeichnis angelegt.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>Name</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Verzeichnis existiert bereits. Fügen Sie %1 an, wenn Sie beabsichtigen hier ein neues Verzeichnis anzulegen.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Pfad existiert bereits und ist kein Verzeichnis.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Datenverzeichnis kann hier nicht angelegt werden.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>Version</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-Bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Über %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Kommandozeilenoptionen</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Benutzung:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>Kommandozeilenoptionen</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>UI Einstellungen:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Datenverzeichnis beim Starten auswählen (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Sprache einstellen, zum Beispiel \"de_DE\" (Standard: Systemgebietsschema)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Minimiert starten</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>SSL-Wurzelzertifikate für Zahlungsanforderungen festlegen (Standard: Systemstandard)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Startbildschirm beim Starten anzeigen (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Setze alle Einstellungen zurück, die über die grafische Oberfläche geändert wurden.</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Willkommen</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Willkommen zu %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Da Sie das Programm gerade zum ersten Mal starten, können Sie nun auswählen wo %1 seine Daten ablegen wird.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Wenn Sie OK klicken, wird der Download %1 angestoßen und die volle %4 Blockchain (%2GB) verarbeitet. Die Verarbeitung beginnt mit den frühesten Transaktionen in %3 , wenn %4 gestartet sind.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Diese initiale Synchronisation führt zur hohen Last und kann Harewareprobleme, die bisher nicht aufgetreten sind, mit ihrem Computer verursachen. Jedes Mal, wenn Sie %1 ausführen, wird der Download zum letzten Synchronisationspunkt fortgesetzt.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Wenn Sie bewusst den Blockchainspeicher begrenzen (pruning), müssen die historischen Daten dennoch heruntergeladen und verarbeitet werden. Diese Daten werden aber zum späteren Zeitpunkt gelöscht, um die Festplattennutzung niedrig zu halten.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Standard-Datenverzeichnis verwenden</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Ein benutzerdefiniertes Datenverzeichnis verwenden:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Zuletzt werden %1 GB Daten in diesem Verzeichnis gespeichert und diese wird über die Zeit größer.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Etwa %1 GB Daten werden in diesem Verzeichnis gespeichert.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 wird heruntergeladen und als eine Kopie von dem Bitcoin Blockchain gespeichert.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Die Wallet wird ebenso in diesem Verzeichnis gespeichert werden.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Fehler: Angegebenes Datenverzeichnis \"%1\" kann nicht angelegt werden.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fehler</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB freier Speicher verfügbar</numerusform><numerusform>%n GB freier Speicher verfügbar</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(von %n GB benötigt)</numerusform><numerusform>(von %n GB benötigt)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formular</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Neueste Transaktionen werden eventuell noch nicht angezeigt, daher könnte Ihr Kontostand veraltet sein. Er wird korrigiert, sobald Ihr Wallet die Synchronisation mit dem Bitcoin-Netzwerk erfolgreich abgeschlossen hat. Details dazu finden sich weiter unten.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Versuche, Bitcoins aus noch nicht angezeigten Transaktionen auszugeben, werden vom Netzwerk nicht akzeptiert.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Anzahl verbleibender Blöcke</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Unbekannt...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Letzte Blockzeit</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Fortschritt</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Fortschritt pro Stunde</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>berechne...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Abschätzung der verbleibenden Zeit bis synchronisiert</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ausblenden</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Unbekannt. Synchronisiere Headers (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>URI öffnen</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Zahlungsanforderung über URI oder aus Datei öffnen</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Zahlungsanforderungsdatei auswählen</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Zu öffnende Zahlungsanforderungsdatei auswählen</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Konfiguration</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Allgemein</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>%1 nach der Anmeldung am System automatisch ausführen.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Starte %1 nach Systemanmeldung</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Größe des &amp;Datenbankcaches</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Anzahl an Skript-&amp;Verifizierungs-Threads</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP-Adresse des Proxies (z.B. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Zeigt an, ob der gelieferte Standard SOCKS5 Proxy verwendet wurde, um die Peers mit diesem Netzwerktyp zu erreichen.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Separaten SOCKS5-Proxy verwenden, um Gegenstellen über versteckte Tor-Dienste zu erreichen:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Verstecke das Icon von der Statusleiste.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Verstecke Statusleistensymbol</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimiert die Anwendung anstatt sie zu beenden wenn das Fenster geschlossen wird. Wenn dies aktiviert ist, müssen Sie die Anwendung über \"Beenden\" im Menü schließen.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Externe URLs (z.B. ein Block-Explorer), die im Kontextmenü des Transaktionsverlaufs eingefügt werden. In der URL wird %s durch den Transaktionshash ersetzt. Bei Angabe mehrerer URLs müssen diese durch \"|\" voneinander getrennt werden.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktive Kommandozeilenoptionen, die obige Konfiguration überschreiben:</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Konfigurationsdatei öffnen</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Setzt die Clientkonfiguration auf Standardwerte zurück.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>Konfiguration &amp;zurücksetzen</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Netzwerk</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automatisch, &lt;0 = so viele Kerne frei lassen)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>W&amp;allet</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Erweiterte Wallet-Optionen</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>\"&amp;Coin Control\"-Funktionen aktivieren</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Wenn Sie das Ausgeben von unbestätigtem Wechselgeld deaktivieren, kann das Wechselgeld einer Transaktion nicht verwendet werden, bis es mindestens eine Bestätigung erhalten hat. Dies wirkt sich auf die Berechnung des Kontostands aus.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Unbestätigtes Wechselgeld darf ausgegeben werden</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Automatisch den Bitcoin-Clientport auf dem Router öffnen. Dies funktioniert nur, wenn Ihr Router UPnP unterstützt und dies aktiviert ist.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Portweiterleitung via &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Akzeptiere Verbindungen von außerhalb.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Erlaube eingehende Verbindungen</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Über einen SOCKS5-Proxy mit dem Bitcoin-Netzwerk verbinden.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>Über einen SOCKS5-Proxy &amp;verbinden (Standardproxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy-&amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port des Proxies (z.B. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Benutzt um Gegenstellen zu erreichen über:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Über einen separaten SOCKS5 Proxy für Tor Services mit dem Bitcoin Netzwerk verbinden.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Programmfenster</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Nur ein Symbol im Infobereich anzeigen, nachdem das Programmfenster minimiert wurde.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>In den Infobereich anstatt in die Taskleiste &amp;minimieren</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>Beim Schließen m&amp;inimieren</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>Anzei&amp;ge</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Sprache der Benutzeroberfläche:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Die Benutzeroberflächensprache kann hier festgelegt werden. Diese Einstellung wird nach einem Neustart von %1 wirksam werden.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Einheit der Beträge:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Wählen Sie die standardmäßige Untereinheit, die in der Benutzeroberfläche und beim Überweisen von Bitcoins angezeigt werden soll.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Legt fest, ob die \"Coin Control\"-Funktionen angezeigt werden.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;Externe Transaktions-URLs</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>A&amp;bbrechen</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>Standard</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>keine</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Zurücksetzen der Konfiguration bestätigen</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Clientneustart nötig, um die Änderungen zu aktivieren.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Client wird beendet. Möchten Sie den Vorgang fortsetzen?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Konfigurationsoptionen</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Die Konfigurationsdatei wird verwendet, um erweiterte Benutzeroptionen festzulegen, die die GUI-Einstellungen überschreiben. Darüber hinaus werden alle Befehlszeilenoptionen diese Konfigurationsdatei überschreiben.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fehler</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Die Konfigurationsdatei konnte nicht geöffnet werden.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Diese Änderung würde einen Clientneustart benötigen.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Die eingegebene Proxyadresse ist ungültig.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formular</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Die angezeigten Informationen sind möglicherweise nicht mehr aktuell. Ihre Wallet wird automatisch synchronisiert, nachdem eine Verbindung zum Bitcoin-Netzwerk hergestellt wurde. Dieser Prozess ist jedoch derzeit noch nicht abgeschlossen.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Beobachtet:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Verfügbar:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Ihr aktuell verfügbarer Kontostand</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Ausstehend:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Betrag aus unbestätigten Transaktionen, der noch nicht im aktuell verfügbaren Kontostand enthalten ist</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Unreif:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Erarbeiteter Betrag der noch nicht gereift ist</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Kontostände</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Gesamtbetrag:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Aktueller Gesamtbetrag aus obigen Kategorien</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Ihr aktueller Kontostand beobachteter Adressen</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Verfügbar:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Letzte Transaktionen</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Unbestätigte Transaktionen von beobachteten Adressen</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Erarbeiteter Betrag in beobachteten Adressen der noch nicht gereift ist</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Aktueller Gesamtbetrag in beobachteten Adressen aus obigen Kategorien</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>fehlerhafte Zahlungsanforderung</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Kann Bitcoin nicht starten: Klicken-zum-Bezahlen-Handler</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI-Verarbeitung</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Abruf-URL der Zahlungsanforderung ist ungültig: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Ungültige Zahlungsadresse %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI kann nicht analysiert werden! Dies kann durch eine ungültige Bitcoin-Adresse oder fehlerhafte URI-Parameter verursacht werden.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Zahlungsanforderungsdatei-Verarbeitung</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Zahlungsanforderungsdatei kann nicht gelesen werden! Dies kann durch eine ungültige Zahlungsanforderungsdatei verursacht werden.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Zahlungsanforderung abgelehnt</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Netzwerk der Zahlungsanforderung stimmt nicht mit dem Client-Netzwerk überein.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Zahlungsanforderung abgelaufen.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Zahlungsanforderung ist nicht initialisiert.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Unverifizierte Zahlungsanforderungen an benutzerdefinierte Zahlungsskripte werden nicht unterstützt.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Ungültige Zahlungsanforderung.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Angeforderter Zahlungsbetrag in Höhe von %1 ist zu niedrig und wurde als \"Staub\" eingestuft.</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Rücküberweisung von %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Zahlungsanforderung %1 ist zu groß (%2 Byte, erlaubt sind %3 Byte).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Kommunikationsfehler mit %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Zahlungsanforderung kann nicht verarbeitet werden!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Fehlerhafte Antwort vom Server: %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>fehlerhafte Netzwerkanfrage</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Zahlung bestätigt</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User-Agent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Knoten/Dienst</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Knoten Identität</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Übertragen</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Empfangen</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Betrag</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Bitcoin-Adresse eingeben (z.B. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Keine</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>k.A.</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n Sekunde</numerusform><numerusform>%n Sekunden</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n Minute</numerusform><numerusform>%n Minuten</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n Stunde</numerusform><numerusform>%n Stunden</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n Tag</numerusform><numerusform>%n Tage</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n Woche</numerusform><numerusform>%n Wochen</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 und %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n Jahr</numerusform><numerusform>%n Jahre</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 wurde noch nicht sicher beendet...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>unbekannt</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Fehler: Angegebenes Datenverzeichnis \"%1\" existiert nicht.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Fehler: Konfigurationsdatei kann nicht analysiert werden: %1. Bitte nur \"Schlüssel=Wert\"-Syntax verwenden.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Fehler: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Grafik &amp;speichern...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>Grafik &amp;kopieren</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>QR-Code speichern</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG-Grafik (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>k.A.</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Clientversion</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Hinweis</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Debugfenster</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Allgemein</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Verwendete BerkeleyDB-Version</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datenverzeichnis</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Startzeit</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Netzwerk</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Name</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Anzahl Verbindungen</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blockkette</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Aktuelle Anzahl Blöcke</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Speicherpool</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Aktuelle Anzahl der Transaktionen</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Speichernutzung</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Zurücksetzen</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Empfangen</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Übertragen</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Gegenstellen</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Gesperrte Peers</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Gegenstelle auswählen, um detaillierte Informationen zu erhalten.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Zugelassene</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Richtung</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Version</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Start Block</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Synchronisierte Kopfdaten</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Synchronisierte Blöcke</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User-Agent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Öffnet die %1-Debugprotokolldatei aus dem aktuellen Datenverzeichnis. Dies kann bei großen Protokolldateien einige Sekunden dauern.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Schrift verkleinern</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Schrift vergrößern</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Dienste</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Sperrpunktzahl</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Verbindungsdauer</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Letzte Übertragung</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Letzter Empfang</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Pingzeit</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Die Laufzeit eines aktuell ausstehenden Ping.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping Wartezeit</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Minimaler Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Zeitversatz</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Letzte Blockzeit</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Öffnen</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsole</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Netzwerkauslastung</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Gesamtbetrag:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>eingehend:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>ausgehend:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Debugprotokolldatei</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Konsole zurücksetzen</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;Stunde</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;Tag</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;Woche</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;Jahr</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Trennen</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Banne für</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Node entsperren</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Willkommen in der %1 RPC Konsole.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Verwenden Sie die aufwärt- und abwärtszeigenden Pfeiltasten, um in der Historie zu navigieren. Verwenden Sie %1, um den Verlauf zu leeren.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Bitte %1 eingeben, um eine Übersicht verfügbarer Befehle zu erhalten.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Für mehr Information über die Benützung dieser Konsole %1 eingeben.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>WARNUNG: Betrüger sind aktiv gewesen, die Benutzer auffordern, hier Befehle einzugeben, um Brieftascheninhalte zu stehlen. Verwenden Sie diese Konsole nicht, ohne die Auswirkungen eines Befehls vollständig zu verstehen.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Netzwerkaktivität deaktiviert</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(Knotenkennung: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>über %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nie</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>eingehend</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>ausgehend</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nein</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Unbekannt</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Betrag:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Bezeichnung:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Nachricht:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Eine optionale Nachricht, die an die Zahlungsanforderung angehängt wird. Sie wird angezeigt, wenn die Anforderung geöffnet wird. Hinweis: Diese Nachricht wird nicht mit der Zahlung über das Bitcoin-Netzwerk gesendet.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Eine optionale Bezeichnung, die der neuen Empfangsadresse zugeordnet wird.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Verwenden Sie dieses Formular, um Zahlungen anzufordern. Alle Felder sind &lt;b&gt;optional&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Ein optional angeforderte Betrag. Lassen Sie dieses Feld leer oder setzen Sie es auf 0, um keinen spezifischen Betrag anzufordern.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Alle Formularfelder zurücksetzen.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Zurücksetzen</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Verlauf der angeforderten Zahlungen</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Zahlung anfordern</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Ausgewählte Zahlungsanforderungen anzeigen (entspricht einem Doppelklick auf einen Eintrag)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Anzeigen</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Ausgewählte Einträge aus der Liste entfernen</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Entfernen</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>&amp;URI kopieren</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Bezeichnung kopieren</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Nachricht kopieren</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Betrag kopieren</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-Code</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>&amp;URI kopieren</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Addresse kopieren</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Grafik &amp;speichern...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Zahlung anfordern an %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Zahlungsinformationen</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Betrag</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Bezeichnung</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Nachricht</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Resultierende URI ist zu lang, bitte den Text für Bezeichnung/Nachricht kürzen.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Beim Enkodieren der URI in den QR-Code ist ein Fehler aufgetreten.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Bezeichnung</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Nachricht</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(keine Bezeichnung)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(keine Nachricht)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(kein Betrag angefordert)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Angefordert</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Bitcoins überweisen</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>\"Coin Control\"-Funktionen</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Eingaben...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automatisch ausgewählt</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Unzureichender Kontostand!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Anzahl:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Byte:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Betrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Gebühr:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Abzüglich Gebühr:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Wechselgeld:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Wenn dies aktivert, und die Wechselgeld-Adresse leer oder ungültig ist, wird das Wechselgeld einer neu erzeugten Adresse gutgeschrieben.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Benutzerdefinierte Wechselgeld-Adresse</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transaktionsgebühr:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Auswählen...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Bei Benutzung der Fallbackfee kann es dazu kommen, dass es bei einer Transaktion mehrere Stunden oder Tage dauern kann, um bestätigt zu werden (oder niemals bestätigt wird). Erwägen Sie, Ihre Gebühr manuell zu wählen oder zu warten, bis Sie die komplette Kette validiert haben.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Achtung: Berechnung der Gebühr ist momentan nicht möglich.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>Transaktionsgebühreneinstellungen ausblenden</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>pro Kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Wenn die benutzerdefinierte Gebühr 1000 Satoshis beträgt und die Transaktion nur 250 Byte groß ist, wird bei Auswahl von \"pro Kilobyte\" eine Gebühr in Höhe von 250 Satoshis, bei Auswahl von \"Mindestbetrag\" eine Gebühr in Höhe von 1000 Satoshis bezahlt. Bei Transaktionen die Größer als ein Kilobyte sind, werden bei beiden Optionen die Gebühren pro Kilobyte bezahlt.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ausblenden</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Nur die minimale Gebühr zu bezahlen ist so lange in Ordnung, wie weniger Transaktionsvolumen als Platz in den Blöcken vorhanden ist. Aber Vorsicht, diese Option kann dazu führen, dass Transaktionen nicht bestätigt werden, wenn mehr Bedarf an Bitcoin-Transaktionen besteht als das Netzwerk verarbeiten kann.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(den Hinweistext lesen)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Empfehlungen:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Benutzerdefiniert:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Intelligente Gebührenlogik ist noch nicht verfügbar. Normalerweise dauert dies einige Blöcke lang...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>An mehrere Empfänger auf einmal überweisen</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Empfänger &amp;hinzufügen</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Alle Formularfelder zurücksetzen.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>\"Dust\":</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Bestätigungsziel:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Aktiviere Replace-By-Fee</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Mit Replace-By-Fee (BIP-125) kann die Transaktionsgebühr nach dem Senden erhöht werden. Ohne dies wird eine höhere Gebühr empfohlen, um das Risiko einer hohen Transaktionszeit zu reduzieren.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Zurücksetzen</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Kontostand:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Überweisung bestätigen</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Überweisen</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Anzahl kopieren</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Betrag kopieren</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Gebühr kopieren</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Abzüglich Gebühr kopieren</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Byte kopieren</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>\"Staub\" kopieren</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Wechselgeld kopieren</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 Blöcke)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 an %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Wollen Sie die Überweisung ausführen?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>als Transaktionsgebühr hinzugefügt</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Gesamtbetrag %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>oder</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Du kannst die Gebühr später erhöhen (Zeigt Replace-By-Fee, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Replace-By-Fee, BIP-125 wird nicht angezeigt.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Überweisung bestätigen</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Die Zahlungsadresse ist ungültig, bitte nochmals überprüfen.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Der zu zahlende Betrag muss größer als 0 sein.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Der angegebene Betrag übersteigt Ihren Kontostand.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Der angegebene Betrag übersteigt aufgrund der Transaktionsgebühr in Höhe von %1 Ihren Kontostand.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Doppelte Adresse entdeckt: Adressen dürfen jeweils nur einmal vorkommen.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Transaktionserstellung fehlgeschlagen!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Die Transaktion wurde aus folgendem Grund abgelehnt: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Eine höhere Gebühr als %1 wird als unsinnig hohe Gebühr angesehen.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Zahlungsanforderung abgelaufen.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Nur die notwendige Gebühr in Höhe von %1 zahlen</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Voraussichtlicher Beginn der Bestätigung innerhalb von %n Block</numerusform><numerusform>Voraussichtlicher Beginn der Bestätigung innerhalb von %n Blöcken.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Warnung: Ungültige Bitcoin-Adresse</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Warnung: Unbekannte Wechselgeld-Adresse</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Bestätige benutzerdefinierte Wechselgeld-Adresse</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Die ausgewählte Wechselgeld-Adresse ist nicht Bestandteil dieses Wallets. Einige oder alle Mittel aus Ihrem Wallet könnten an diese Adresse gesendet werden. Wollen Sie das wirklich?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(keine Bezeichnung)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Betra&amp;g:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>E&amp;mpfänger:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Bezeichnung:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Bereits verwendete Adresse auswählen</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Dies ist eine normale Überweisung.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Die Zahlungsadresse der Überweisung</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Adresse aus der Zwischenablage einfügen</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Diesen Eintrag entfernen</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Die Gebühr wird vom zu überweisenden Betrag abgezogen. Der Empfänger wird also weniger Bitcoins erhalten, als Sie im Betrags-Feld eingegeben haben. Falls mehrere Empfänger ausgewählt wurden, wird die Gebühr gleichmäßig verteilt.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>Gebühr vom Betrag ab&amp;ziehen</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Benutze verfügbaren Kontostand</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Nachricht:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Dies ist keine beglaubigte Zahlungsanforderung.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Dies ist eine beglaubigte Zahlungsanforderung.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Adressbezeichnung eingeben, die dann zusammen mit der Adresse der Liste bereits verwendeter Adressen hinzugefügt wird.</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Eine an die \"bitcoin:\"-URI angefügte Nachricht, die zusammen mit der Transaktion gespeichert wird. Hinweis: Diese Nachricht wird nicht über das Bitcoin-Netzwerk gesendet.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Empfänger:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Geben Sie eine Bezeichnung für diese Adresse ein, um sie zu Ihrem Adressbuch hinzuzufügen</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 wird beendet...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Fahren Sie den Computer nicht herunter, bevor dieses Fenster verschwindet.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signaturen - eine Nachricht signieren / verifizieren</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>Nachricht &amp;signieren</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Sie können Nachrichten/Vereinbarungen mit Hilfe Ihrer Adressen signieren, um zu beweisen, dass Sie Bitcoins empfangen können, die an diese Adressen überwiesen werden. Seien Sie vorsichtig und signieren Sie nichts Vages oder Willkürliches, um Ihre Indentität vor Phishingangriffen zu schützen. Signieren Sie nur vollständig-detaillierte Aussagen, mit denen Sie auch einverstanden sind.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Die Bitcoin-Adresse mit der die Nachricht signiert wird</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Bereits verwendete Adresse auswählen</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Adresse aus der Zwischenablage einfügen</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Zu signierende Nachricht hier eingeben</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signatur</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Aktuelle Signatur in die Zwischenablage kopieren</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Die Nachricht signieren, um den Besitz dieser Bitcoin-Adresse zu beweisen</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>&amp;Nachricht signieren</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Alle \"Nachricht signieren\"-Felder zurücksetzen</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Zurücksetzen</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>Nachricht &amp;verifizieren</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Geben Sie die Zahlungsadresse des Empfängers, Nachricht (achten Sie darauf Zeilenumbrüche, Leerzeichen, Tabulatoren usw. exakt zu kopieren) und Signatur unten ein, um die Nachricht zu verifizieren. Vorsicht, interpretieren Sie nicht mehr in die Signatur hinein, als in der signierten Nachricht selber enthalten ist, um nicht von einem Man-in-the-middle-Angriff hinters Licht geführt zu werden. Beachten Sie dass dies nur beweißt, dass die signierende Partei über diese Adresse Überweisungen empfangen kann.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Die Bitcoin-Adresse mit der die Nachricht signiert wurde</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Die Nachricht verifizieren, um sicherzustellen, dass diese mit der angegebenen Bitcoin-Adresse signiert wurde</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>&amp;Nachricht verifizieren</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Alle \"Nachricht verifizieren\"-Felder zurücksetzen</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Auf \"Nachricht signieren\" klicken, um die Signatur zu erzeugen</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Die eingegebene Adresse ist ungültig.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Bitte überprüfen Sie die Adresse und versuchen Sie es erneut.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Die eingegebene Adresse verweist nicht auf einen Schlüssel.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Wallet-Entsperrung wurde abgebrochen.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Privater Schlüssel zur eingegebenen Adresse ist nicht verfügbar.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Signierung der Nachricht fehlgeschlagen.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Nachricht signiert.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Die Signatur konnte nicht dekodiert werden.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Bitte überprüfen Sie die Signatur und versuchen Sie es erneut.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Die Signatur entspricht nicht dem \"Message Digest\".</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Verifikation der Nachricht fehlgeschlagen.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Nachricht verifiziert.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[Testnetz]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Offen für %n weiteren Block</numerusform><numerusform>Offen für %n weitere Blöcke</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Offen bis %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>steht im Konflikt mit einer Transaktion mit %1 Bestätigungen</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>%1/unbestätigt</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>im Speicherpool</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>nicht im Speicherpool</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>eingestellt</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/unbestätigt</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 Bestätigungen</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, wurde noch nicht erfolgreich übertragen</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, verteilt durch %n Knoten</numerusform><numerusform>, verteilt durch %n Knoten</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Quelle</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Erzeugt</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Von</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>unbekannt</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>An</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>eigene Adresse</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>beobachtet</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>Bezeichnung</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Gutschrift</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>reift noch %n weiteren Block</numerusform><numerusform>reift noch %n weitere Blöcke</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>nicht angenommen</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Belastung</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Gesamtbelastung</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Gesamtgutschrift</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transaktionsgebühr</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Nettobetrag</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Nachricht</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Kommentar</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transaktionskennung</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Gesamte Transaktionsgröße</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Ausgabeindex</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Händler</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Erzeugte Bitcoins müssen %1 Blöcke lang reifen, bevor sie ausgegeben werden können. Als Sie diesen Block erzeugten, wurde er an das Netzwerk übertragen, um ihn der Blockkette hinzuzufügen. Falls dies fehlschlägt wird der Status in \"nicht angenommen\" geändert und Sie werden keine Bitcoins gutgeschrieben bekommen. Das kann gelegentlich passieren, wenn ein anderer Knoten einen Block fast zeitgleich erzeugt.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Debuginformationen</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transaktion</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Eingaben</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Betrag</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>wahr</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>falsch</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Dieser Bereich zeigt eine detaillierte Beschreibung der Transaktion an</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Details für %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Bezeichnung</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Offen für %n weiteren Block</numerusform><numerusform>Offen für %n weitere Blöcke</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Offen bis %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Unbestätigt</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Eingestellt</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Wird bestätigt (%1 von %2 empfohlenen Bestätigungen)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Bestätigt (%1 Bestätigungen)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>in Konflikt stehend</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Unreif (%1 Bestätigungen, wird verfügbar sein nach %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Dieser Block wurde vom Netzwerk nicht angenommen und wird wahrscheinlich nicht bestätigt werden!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generiert, aber nicht akzeptiert</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Empfangen über</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Empfangen von</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Überwiesen an</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Eigenüberweisung</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Erarbeitet</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>beobachtet</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(k.A.)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(keine Bezeichnung)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Transaktionsstatus. Fahren Sie mit der Maus über dieses Feld, um die Anzahl der Bestätigungen zu sehen.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Datum und Zeit als die Transaktion empfangen wurde.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Art der Transaktion</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Zeigt an, ob eine beobachtete Adresse in diese Transaktion involviert ist.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Benutzerdefinierte Absicht bzw. Verwendungszweck der Transaktion</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Der Betrag, der dem Kontostand abgezogen oder hinzugefügt wurde.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Alle</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Heute</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Diese Woche</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Diesen Monat</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Letzten Monat</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Dieses Jahr</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Zeitraum...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Empfangen über</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Überwiesen an</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Eigenüberweisung</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Erarbeitet</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Andere</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Zu suchende Adresse, Transaktion oder Bezeichnung eingeben</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Mindestbetrag</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Transaktion einstellen</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Transaktionsgebühr erhöhen</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Adresse kopieren</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Bezeichnung kopieren</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Betrag kopieren</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Transaktionskennung kopieren</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Rohe Transaktion kopieren</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Vollständige Transaktionsdetails kopieren</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Bezeichnung bearbeiten</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Transaktionsdetails anzeigen</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Transaktionsverlauf exportieren</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Kommagetrennte-Datei (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bestätigt</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Nur beobachten</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Bezeichnung</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportieren fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Beim Speichern des Transaktionsverlaufs nach %1 ist ein Fehler aufgetreten.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exportieren erfolgreich</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Speichern des Transaktionsverlaufs nach %1 war erfolgreich.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Zeitraum:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>bis</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Die Einheit in der Beträge angezeigt werden. Klicken, um eine andere Einheit auszuwählen.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Es wurde keine Wallet geladen.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Bitcoins überweisen</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Fee bump Fehler</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Transaktionsgebühr-Erhöhung fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Möchten Sie die Gebühr erhöhen?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Aktuelle Gebühr:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Erhöhung:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Neue Gebühr:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Bestätigen Sie die fee bump</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Signierung der Transaktion fehlgeschlagen.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Konnte Transaktion nicht übergeben</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>E&amp;xportieren</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Daten der aktuellen Ansicht in eine Datei exportieren</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Wallet sichern</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Wallet-Daten (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Sicherung fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Beim Speichern der Wallet-Daten nach %1 ist ein Fehler aufgetreten.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Sicherung erfolgreich</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Speichern der Wallet-Daten nach %1 war erfolgreich.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Optionen:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Datenverzeichnis festlegen</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Mit dem angegebenen Knoten verbinden, um Adressen von Gegenstellen abzufragen, danach trennen</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Die eigene öffentliche Adresse angeben</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Kommandozeilen- und JSON-RPC-Befehle annehmen</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Veröffentlicht unter der MIT-Softwarelizenz, siehe beiligende Datei %s oder %s.</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Wenn &lt;category&gt; nicht angegeben wird oder &lt;category&gt;=1, jegliche Debugginginformationen ausgeben.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Kürzungsmodus wurde kleiner als das Minimum in Höhe von %d MiB konfiguriert. Bitte verwenden Sie einen größeren Wert.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Prune (Kürzung): Die letzte Syncronisation der Wallet liegt vor gekürzten (gelöschten) Blöcken. Es ist ein -reindex (download der gesamten Blockkette) notwendig.</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Rescans sind im pruned mode nicht möglich. Ein -reindex ist notwendig, welcher die gesmate Blockkette erneut herunterlädt.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Fehler: Ein schwerer interner Fehler ist aufgetreten, siehe debug.log für Details.</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Gebühr (in %s/kB), die von Ihnen gesendeten Transaktionen hinzugefügt wird (Standard: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Kürze Blockspeicher...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Als Hintergrunddienst ausführen und Befehle annehmen</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Kann HTTP Server nicht starten. Siehe debug log für Details.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Die %s-Entwickler</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Eine Transaktionsgebühr (in %s/kB) wird genutzt, wenn für die Gebührenschützung zu wenig Daten vorliegen (Standardwert: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Immer übermittelte Transaktionen von freigegebenen Peers akzeptieren, auch wenn keine Transaktionen übermittelt werden (Standard: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Mit dem angegebenen Knoten verbinden und versuchen die Verbindung aufrecht zu erhalten (Siehe die \"addnode\" RPC Kommando Hilfe für mehr Information)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>An die angegebene Adresse binden und immer abhören. Für IPv6 \"[Host]:Port\"-Notation verwenden</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Datenverzeichnis %s kann nicht gesperrt werden. Evtl. wurde %s bereits gestartet.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Kann keine Verbindungen herstellen und addrman gleichzeitig ausgehende Verbindungen suchen lassen.</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Stellt lediglich die Verbindungen zum/zu den spezifischen Knoten her; -connect=0 deaktiviert die automatische Verbindungsherstellung (Die Regel für diesen Knoten ist die selbe wie für -addnode)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Alle Wallet-Transaktionen löschen und nur diese Teilbereiche der Blockkette durch -rescan beim Starten wiederherstellen</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Lesen von %s fehlgeschlagen! Alle Schlüssel wurden korrekt gelesen, Transaktionsdaten bzw. Adressbucheinträge fehlen aber möglicherweise oder sind inkorrekt.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Debugging-Informationen für eine Kategorie ausschließen. Kann in Verbindung mit -debug = 1 verwendet werden, um Debug-Logs für alle Kategorien auszugeben, mit Ausnahme einer oder mehrerer spezifizierter Kategorien.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Befehl ausführen wenn sich eine Wallet-Transaktion verändert (%s im Befehl wird durch die Transaktions-ID ersetzt)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Zusätzliche Transaktionen für kompakten Block-Nachbau im Speicher vorhalten (default: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Sofern dieser Block Bestandteil der Blockchain ist, nehme an, dass er und seine Vorgänger gültig sind und überspringe ggf. dessen Skriptverifikation (0 um alle zu verifizieren, default: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Maximal zulässige mediane Peer-Zeit-Offset-Einstellung. Lokale Perspektive der Zeit kann von Peers vorwärts oder rückwärts um diesen Betrag beeinflusst werden. (Voreinstellung: %u Sekunden)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Maximale Gesamtgebühr (in %s) in einer Börsentransaktion; wird dies zu niedrig gesetzten können große Transaktionen abgebrochen werden (Standard: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Bitte korrigieren Sie die Datums- und Uhrzeiteinstellungen Ihres Computers, da %s ansonsten nicht ordnungsgemäß funktionieren wird.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Wenn sie %s nützlich finden, sind Helfer sehr gern gesehen. Besuchen Sie %s um mehr über das Softwareprojekt zu erfahren.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Adressen von Gegenstellen via DNS-Namensauflösung finden, falls zu wenige Adressen verfügbar sind (Standard: 1, außer bei -connect)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Speicherplatzanforderung durch Kürzen (Pruning) alter Blöcke reduzieren. Dies erlaubt das Aufrufen des sogenannten Pruneblockchain RPC zum Löschen spezifischer Blöcke und und aktiviert das automatische Pruning alter Blöcke, sofern eine Zielgröße in MIB angegeben wird. Dieser Modus ist nicht mit -txindex und -resacan kompatibel. Warnung: Das Rücksetzen dieser Einstellung erfordert das erneute Herunterladen der gesamten Blockchain. (Standard: 0 = deaktiviert das Pruning, 1 = erlaubt manuelles Pruning via RPC, &gt;%u = automatisches Pruning der Blockdateien, um angegebene Maximalgröße nicht zu überschreiten)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Niedrigste Gebühr (in %s/kB) für Transaktionen einstellen, die bei der Blockerzeugung berücksichtigt werden sollen. (default: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Maximale Anzahl an Skript-Verifizierungs-Threads festlegen (%u bis %d, 0 = automatisch, &lt;0 = so viele Kerne frei lassen, Standard: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Die Block-Datenbank enthält einen Block, der in der Zukunft auftaucht. Dies kann daran liegen, dass die Systemzeit Ihres Computers falsch eingestellt ist. Stellen Sie die Block-Datenbank nur wieder her, wenn Sie sich sicher sind, dass Ihre Systemzeit korrekt eingestellt ist.</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Dies ist eine Vorab-Testversion - Verwendung auf eigene Gefahr - nicht für Mining- oder Handelsanwendungen nutzen!</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Dies ist die Transaktionsgebühr, die ggf. abgeschrieben wird, wenn das Wechselgeld \"Staub\" ist in dieser Stufe.</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Fehler beim verarbeiten von Blöcken. Sie müssen die Datenbank mit Hilfe des Arguments '-reindex-chainstate' neuladen. </translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Sie müssen die Datenbank mit Hilfe von -reindex neu aufbauen, um zum ungekürzten Modus zurückzukehren. Dies erfordert, dass die gesamte Blockkette erneut heruntergeladen wird.</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>UPnP verwenden, um eine Portweiterleitung einzurichten (Standard: 1, wenn abgehört wird und -proxy nicht gesetzt ist)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Benutzername und gehashtes Passwort für JSON-RPC Verbindungen. Das Feld &lt;userpw&gt; kommt im Format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Ein kanonisches Pythonskript ist in share/rpcuser inbegriffen. Der client benutzt wie gehabt, die rpcuser/rpcpassword Parameter. Diese Option kann mehrere Male spezifiziert werden</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Das Wallet erzeugt keine Transaktionen, die das Mempool Chain Limit überschreiten (Standardeinstellung: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Warnung: Das Netzwerk scheint nicht vollständig übereinzustimmen! Einige Miner scheinen Probleme zu haben.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Warnung: Wir scheinen nicht vollständig mit unseren Gegenstellen übereinzustimmen! Sie oder die anderen Knoten müssen unter Umständen Ihre Client-Software aktualisieren.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Gibt an, ob der mempool beim Beenden gespeichert und beim Starten wieder geladen werden soll (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d der letzten 100 Blöcke haben eine unerwartete Version</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s beschädigt, Datenrettung fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool muss mindestens %d MB betragen</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; kann sein:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Eingehende Verbindungen annehmen (Standard: 1, wenn nicht -proxy oder -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Hänge ein Kommentar zur User Agent-Zeichenkette an</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Es wird versucht, private Schlüssel beim Starten aus einem beschädigtem Wallet wiederherzustellen</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Blockerzeugungsoptionen:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Kann Adresse in -%s nicht auflösen: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Chain Auswahloptionen:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Position des Wechselgelds außerhalb des Bereichs</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Verbindungsoptionen:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Beschädigte Blockdatenbank erkannt</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Debugging-/Testoptionen:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Die Wallet nicht laden und Wallet-RPC-Aufrufe deaktivieren</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Möchten Sie die Blockdatenbank jetzt neu aufbauen?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Aktiviere das Veröffentlichen des Hash-Blocks in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Aktiviere das Veröffentlichen der Hash-Transaktion in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Aktiviere das Veröffentlichen des Raw-Blocks in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Aktiviere das Veröffentlichen der Roh-Transaktion in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Maximal &lt;n&gt; nicht-verbindbare Transaktionen im Speicher halten (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Fehler beim Laden von %s: Sie können HD nicht aktivieren da sie derzeit eine nicht HD Brieftasche besitzen.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Fehler beim Initialisieren der Blockdatenbank</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Fehler beim Initialisieren der Wallet-Datenbankumgebung %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Fehler beim Laden von %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Fehler beim Laden von %s: Das Wallet ist beschädigt</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Fehler beim Laden von %s: Das Wallet benötigt eine neuere Version von %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Fehler beim Laden der Blockdatenbank</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Fehler beim Öffnen der Blockdatenbank</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Fehler: Zu wenig freier Speicherplatz auf dem Datenträger!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Fehler, es konnte kein Port abgehört werden. Wenn dies so gewünscht wird -listen=0 verwenden.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Durchsuchen des Wallets während der Initialisation fehlgeschlagen. </translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importiere...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Fehlerhafter oder kein Genesis-Block gefunden. Falsches Datenverzeichnis für das Netzwerk?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Initialisierungsplausibilitätsprüfung fehlgeschlagen. %s wird beendet.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Ungültiger Betrag für -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Ungültiger Betrag für -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Ungültiger Betrag für -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Halten Sie den Transaktionsspeicherpool unter &lt;n&gt; Megabytes (Voreinstellung: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Lade P2P-Adressen...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Lade Sperrliste...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Dateiort für das Auth-Cookie (Standard: Datenverzeichnis)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Nicht genügend Datei-Deskriptoren verfügbar.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Nur zu Knoten des Netzwerktyps &lt;net&gt; verbinden (ipv4, ipv6 oder onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Drucke diese Hilfemeldung und beende</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Gibt die Versionsnummer aus und beendet das Programm</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Kürzungsmodus kann nicht mit einem negativen Wert konfiguriert werden.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Kürzungsmodus ist nicht mit -txindex kompatibel.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Blockkettenindex aus aktuellen Dateien blk000??.dat beim Starten wiederaufbauen</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Blockkettenzustand aus aktuelle indizierten Blöcken wiederaufbauen</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Blöcke werden nochmal neu verarbeitet ...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Verifiziere Blöcke...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>Wähle alle zu sendenden Transaktionen als full-RBF opt-in aktiviert (Ausschließlich RPC, Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Größe des Datenbankcaches in Megabyte festlegen (%d bis %d, Standard: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Wallet-Datei angeben (innerhalb des Datenverzeichnisses)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Der Quellcode ist von %s verfügbar.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Transaktionsgebühr- und Wechselgeldberechnung fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Kann auf diesem Computer nicht an %s binden. Evtl. wurde %s bereits gestartet.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Nicht unterstütztes Argument -benchmark wurde ignoriert, bitte -debug=bench verwenden.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Nicht unterstütztes Argument -debugnet wurde ignoriert, bitte -debug=net verwenden.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Nicht unterstütztes Argument -tor gefunden, bitte -onion verwenden.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Aktualisierung der UTXO Datenbank</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>UPnP verwenden, um eine Portweiterleitung einzurichten (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Die Testchain verwenden</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Der User Agent Kommentar  (%s) enthält unsichere Zeichen.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verifiziere Blöcke...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Wallet Debugging-/Testoptionen:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Wallet musste neu geschrieben werden: starten Sie %s zur Fertigstellung neu</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Wallet-Optionen:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>JSON-RPC-Verbindungen von der angegeben Quelle erlauben. Gültig für &lt;ip&gt; ist eine einzelne IP-Adresse (z.B. 1.2.3.4), ein Netzwerk bzw. eine Netzmaske (z.B. 1.2.3.4/255.255.255.0), oder die CIDR-Notation (z.B. 1.2.3.4/24). Kann mehrmals angegeben werden.</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>An die angegebene Adresse binden und Gegenstellen, die sich dorthin verbinden, immer zulassen. Für IPv6 \"[Host]:Port\"-Notation verwenden</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Neue Dateien mit Standard-Systemrechten erzeugen, anstatt mit umask 077 (nur mit deaktivierter Walletfunktion nutzbar)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Eigene IP-Adressen ermitteln (Standard: 1, wenn abgehört wird und nicht -externalip oder -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Fehler: Abhören nach eingehenden Verbindungen fehlgeschlagen (listen meldete Fehler %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Befehl ausführen wenn ein relevanter Alarm empfangen wird oder wir einen wirklich langen Fork entdecken (%s im Befehl wird durch die Nachricht ersetzt)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Niedrigere Gebühren (in %s/Kb) als diese werden bei der Transaktionserstellung als gebührenfrei angesehen (Standard: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Wenn -paytxfee nicht festgelegt wurde Gebühren einschließen, so dass mit der Bestätigung von Transaktionen im Schnitt innerhalb von n Blöcken begonnen wird (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Ungültiger Betrag für -maxtxfee=&lt;amount&gt;: '%s' (muss mindestens die minimale Weiterleitungsgebühr in Höhe von %s sein, um zu verhindern dass Transaktionen nicht bearbeitet werden)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maximale Datengröße in \"Data Carrier\"-Transaktionen die weitergeleitet und erarbeitet werden (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Zufällige Anmeldedaten für jede Proxyverbindung verwenden. Dies aktiviert Tor-Datenflussisolation (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Der Transaktionsbetrag ist zum senden zu niedrig, nachdem die Gebühr abgezogen wurde.</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Erlaubte Gegenstellen werden nicht für DoS-Attacken gesperrt und ihre Transkationen werden immer weitergeleitet, auch wenn sie sich bereits im Speicherpool befinden, was z.B. für Gateways sinnvoll ist.</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Sie müssen die Datenbank mit Hilfe von -reindex neu aufbauen, um zum ungekürzten Modus zurückzukehren. Dies erfordert, dass die gesamte Blockkette erneut heruntergeladen wird.</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Öffentliche REST-Anfragen annehmen (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Automatisch versteckten Tor-Dienst erstellen (Standard: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Über einen SOCKS5-Proxy &amp;verbinden</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Fehler beim Laden von %s: Sie können die hierarchisch deterministische Schlüsselgeneration (HD) für eine bereits existierende HD-Brieftasche nicht deaktivieren</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Fehler beim lesen der Datenbank, Ausführung wird beendet.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Fehler bei der Aktualisierung einer Kettenstatus-Datenbank</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Blöcke beim Starten aus externer Datei blk000??.dat importieren</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Hinweis</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Ungültige Onion-Adresse oder ungültiger Hostname: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Ungültige Proxy-Adresse oder ungültiger Hostname: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Ungültiger Betrag für -paytxfee=&lt;amount&gt;: '%s' (muss mindestens %s sein)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Ungültige Netzmaske angegeben in -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Maximal &lt;n&gt; nicht-verbindbare Transaktionen im Speicher halten (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Angabe eines Ports benötigt für -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Knoten-Weiterleitungsoptionen:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC-Serveroptionen:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reduziere -maxconnections von %d zu %d, aufgrund von Systemlimitierungen.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Blockkette beim Starten erneut nach fehlenden Wallet-Transaktionen durchsuchen</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Rückverfolgungs- und Debuginformationen an die Konsole senden, anstatt sie in debug.log zu schreiben</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Zeige alle Debuggingoptionen (Benutzung: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Protokolldatei debug.log beim Starten des Clients kürzen (Standard: 1, wenn kein -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Signierung der Transaktion fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>Angegebenes Verzeichniss \"%s\" existiert nicht</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>Angegebenes Verzeichniss \"%s\" ist ein relativer Pfad</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>Angegebenes Verzeichniss \"%s\" ist kein Verzeichniss</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Der Transaktionsbetrag ist zu niedrig, um die Gebühr zu bezahlen.</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Dies ist experimentelle Software.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>TOR Kontrollport Passwort (Standard: leer)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Zu benutzender TOR Kontrollport wenn Onion Auflistung aktiv ist (Standard: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transaktionsbetrag zu niedrig</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transaktion ist für die Gebührenrichtlinie zu groß</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transaktion zu groß</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Kann auf diesem Computer nicht an %s binden (bind meldete Fehler %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Anfänglicher Schlüssel kann nicht generiert werden.</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Wallet beim Starten auf das neueste Format aktualisieren</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Benutzername für JSON-RPC-Verbindungen</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Verifiziere Wallet(s)...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Brieftasche %s liegt außerhalb des Datenverzechnisses %s</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Warnung</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Warnung: Unbekannte neue Regeln aktiviert (Versionsbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Legt fest ob nur Blöcke Modus aktiv sein soll (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Sie müssen die Datenbank mit Hilfe von -reindex neu aufbauen, um -txindex zu ändern</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Lösche alle Transaktionen aus Wallet...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ-Benachrichtigungsoptionen:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Passwort für JSON-RPC-Verbindungen</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Befehl ausführen wenn der beste Block wechselt (%s im Befehl wird durch den Hash des Blocks ersetzt)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Erlaube DNS-Abfragen für -addnode, -seednode und -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = TX-Metadaten wie z.B. Accountbesitzer und Zahlungsanforderungsinformationen behalten, 2 = TX-Metadaten verwerfen)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee ist auf einen sehr hohen Wert festgelegt! Gebühren dieser Höhe könnten für eine einzelne Transaktion bezahlt werden.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>An die angegebene Adresse binden und auf JSON-RPC-Verbindungen abhören. Diese Option wird ignoriert wenn '-rpcallowip' nicht auch angegeben ist. Die Angabe des Ports ist optional und überschreibt den Parameter '-rpcport'. Benutzen Sie die [host]:port Annotation für IPv6. Diese Option kann mehrmals angegeben werden. (Standard: 127.0.0.1 und ::1, z.B. localhost; Wenn '-rpcallowip' angegeben wurde werden alle Adressen verwendet, also 0.0.0.0 und ::)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Die Transaktion nicht länger im Speicherpool behalten als &lt;n&gt; Stunden (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Maximale Datengröße in \"Data Carrier\"-Transaktionen die weitergeleitet und erarbeitet werden (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Fehler beim Herunterladen von %s: Sie können keine hierarchisch deterministische Schlüsselgeneration (HD) auf eine bereits existierende nicht-HD Brieftasche (Wallet) aktivieren.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Fehler beim Laden der Brieftasche %s. Der Parameter -wallet darf nur ein Dateiname sein (kein Dateipfad).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Niedrigere Gebühren (in %s/Kb) als diese werden bei der Transaktionserstellung als gebührenfrei angesehen (Standard: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Leite Transaktionen von Peers auf der Positivliste auf jeden Fall weiter, auch wenn sie die lokale Weiterleitungsregeln verletzen (Standardeinstellung: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Legt fest, wie gründlich die Blockverifikation von -checkblocks ist (0-4, Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Einen vollständigen Transaktionsindex führen, der vom RPC-Befehl \"getrawtransaction\" genutzt wird (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Anzahl Sekunden, während denen sich nicht konform verhaltenden Gegenstellen die Wiederverbindung verweigert wird (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Debugginginformationen ausgeben (Standard: %u, &lt;category&gt; anzugeben ist optional)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Setzt die Serialisierung von Rohtransaktionen oder Block Hex-Daten auf non-verbose mode, nicht-Segwit(0) oder Segwit(1) (default: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Spezifiziere das Verzeichnis für das Wallet (Standard:&lt;datadir&gt;/wallets wenn es vorhanden ist, sonst &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Verzeichniss für das Debug Logfile: Es kann sich um einen absoluten oder relativen Pfad zum Datenverzeichniss handeln (Standard: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Unterstütze Blöcke und Transaktionen mit  Bloomfiltern zu filtern (default: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>Die Transaktionsgebührrate (in %s/kB), die die Toleranz anzeigt für das Abschreiben von Wechselgeld, durch deren Zufügung zur Transaktionsgebühr (Standard: %s). Hinweis: Eine Ausgabe wird abgeschrieben, wenn sie bei Höhe dieser Rate \"Staub\" ist, aber es wird immer abgeschrieben bis zur Staub-Weiterleitungsgebühr, und eine Abschreibungsgebühr darüber ist begrenzt durch die Gebührenschätzung für das längste Ziel</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Das ist die Transaktionsgebühr, welche du zahlen müsstest, wenn die Gebührenschätzungen nicht verfügbar sind.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Dieses Produkt enthält Software, die vom OpenSSL-Projekt zur Verwendung im OpenSSL-Toolkit %s entwickelt wird, von Eric Young geschriebene kryptographische Software und von Thomas Bernard geschriebene UPnP-Software.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Gesamtlänge des Netzwerkversionstrings (%i) erreicht die maximale Länge (%i). Reduzieren Sie die Nummer oder die Größe von uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Versucht ausgehenden Datenverkehr unter dem gegebenen Wert zu halten (in MiB pro 24h), 0 = kein Limit (default: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Nicht unterstützter Parameter -socks gefunden. Das Festlegen der SOCKS-Version ist nicht mehr möglich, nur noch SOCKS5-Proxies werden unterstützt.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Das Argument -whitelistalwaysrelay wird nicht unterstützt und deswegen ignoriert. Benutze -whitelistrelay und/oder -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Separaten SOCKS5-Proxy verwenden, um Gegenstellen über versteckte Tor-Dienste zu erreichen (Standard: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Warnung: Unbekannte Blockversion wird durch Mining erzeugt! Es ist möglich, dass unbekannte Regeln in Kraft sind.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Gegenstellen die sich von der angegebenen IP-Adresse (e.g. 1.2.3.4) oder CIDR Notation (eg. 1.2.3.0/24) aus verbinden immer zulassen. Kann mehrmals angegeben werden.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s wurde sehr hoch eingestellt!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(Standard: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Adressen von Gegenstellen immer über DNS-Namensauflösung abfragen (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Fehler beim Laden der Brieftasche %s. -wallet Dateiname muss eine normale Datei sein.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Fehler beim Laden der Brieftasche %s. -wallet Dateiname doppelt angegeben.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Fehler beim Laden der Brieftasche %s. -wallet Dateiname enthält ungültige Buchstaben.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Wieviele Blöcke beim Starten geprüft werden sollen (Standard: %u, 0 = alle)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>IP-Adressen in Debugausgabe einschließen (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Der Keypool ist erschöpft. Bitte rufen Sie zunächst keypoolrefill auf.</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>&lt;port&gt; nach JSON-RPC-Verbindungen abhören (Standard: %u oder Testnetz: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>&lt;port&gt; nach Verbindungen abhören (Standard: %u oder Testnetz: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Maximal &lt;n&gt; Verbindungen zu Gegenstellen aufrechterhalten (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Die Wallet soll Transaktionen übertragen/broadcasten</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximale Größe des Empfangspuffers pro Verbindung, &lt;n&gt; * 1000 Byte (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximale Größe des Sendepuffers pro Verbindung, &lt;n&gt; * 1000 Byte (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Debugausgaben einen Zeitstempel voranstellen (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>\"Data Carrier\"-Transaktionen weiterleiten und erarbeiten (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Nicht-\"P2SH-Multisig\" weiterleiten (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Größe des Schlüsselpools festlegen auf &lt;n&gt; (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Maximales BIP141 Blockgewicht festlegen (Standard: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Maximale Anzahl an Threads zur Verarbeitung von RPC-Anfragen festlegen (Standard: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Konfigurationsdatei festlegen (Standard: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Verbindungzeitüberschreitung in Millisekunden festlegen (Minimum: 1, Standard: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>PID-Datei festlegen (Standard: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Unbestätigtes Wechselgeld darf beim Senden von Transaktionen ausgegeben werden (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Netzwerk-Threads werden gestartet...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Das Wallet verhindert Zahlungen, die die Mindesttransaktionsgebühr nicht berücksichtigen.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Dies ist die kleinstmögliche Gebühr, die beim Senden einer Transaktion fällig wird.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Dies ist die Gebühr, die beim Senden einer Transaktion fällig wird.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Schwellenwert, um Verbindungen zu sich nicht konform verhaltenden Gegenstellen zu beenden (Standard: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Transaktionsbeträge dürfen nicht negativ sein.</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Die Speicherpoolkette der Transaktion ist zu lang.</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Die Transaktion muss mindestens einen Empfänger enthalten.</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Unbekannter Netztyp in -onlynet angegeben: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Unzureichender Kontostand</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Lade Blockindex...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Lade Wallet...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Wallet kann nicht auf eine ältere Version herabgestuft werden</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Durchsuche erneut...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Laden abgeschlossen</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fehler</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_de_DE.ts",
    "content": "<TS language=\"de_DE\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Rechtsklick um Adresse oder Etikett zu bearbeiten</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Eine neue Adresse erstellen</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Neu</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Aktive Adresse in die Zwischenablage kopieren</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopieren</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Schliessen</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Ausgewählte Adresse aus der Liste löschen</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Daten des aktiven Fensters exportieren</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportieren</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Löschen</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Wähle die Empfängeradresse</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Wähle die Empfangsadresse</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Auswählen</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Sendeadressen</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Empfangsadressen</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Dies sind Ihre Bitcoin-Adressen zum Senden von Zahlungen. Überprüfen Sie immer die Menge und die Empfangsadresse, bevor Sie Bitcoins senden.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Dies sind Ihre Bitcoin-Adressen für den Empfang von Zahlungen. Es wird empfohlen, für jede Transaktion eine neue Empfangsadresse zu verwenden.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopiere Adresse</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopiere &amp;Etikett</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Bearbeiten</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Export Adressliste</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Komma getrenntes Dokument (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Export fehlgeschlagen</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etikett</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(kein Etikett)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Passwort Dialog</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Passwort eingeben</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Neues Passwort</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Neues Passwort wiederholen</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Passwort anzeigen</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Geben Sie das neue Passwort Ihrer digitalen Geldbörse ein.&lt;br/&gt;Verwenden Sie bitte ein Passwort bestehend aus &lt;b&gt;zehn oder mehr zufälligen Zeichen&lt;/b&gt;, oder aus &lt;b&gt;acht oder mehr Wörtern&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Brieftasche verschlüsseln</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Diese Aktion benötigt ihr Passwort zum entsperren der Wallet.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Brieftasche entschlüsseln</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Diese Operation benötigt Ihr Wallet-Passwort zum entschlüsseln der Wallet.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Brieftasche entschlüsseln</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Passwort ändern</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Geben Sie das alte und neue Passwort Ihrer Wallet ein.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Brieftaschenverschlüsselung bestätigen</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Achtung: Wenn Sie Ihre Wallet verschlüsseln und das Passwort verlieren, gehen &lt;b&gt;alle Ihre Bitcoins verloren&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Möchten Sie Ihre Wallet wirklich verschlüsseln?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Brieftasche verschlüsselt</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>WICHTIG: Alle früheren Sicherungen, die Sie von Ihrer Wallet-Datei gemacht haben, sollten durch die neu erzeugte, verschlüsselte Wallet-Datei ersetzt werden. Sobald Sie die neue, verschlüsselte Wallet verwenden, werden frühere Sicherungen der unverschlüsselten Wallet-Datei aus Sicherheitsgründen nutzlos.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Brieftaschenverschlüsselung fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Die Wallet-Verschlüsselung ist aufgrund eines internen Fehlers fehlgeschlagen. Ihre Wallet wurde nicht verschlüsselt.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Die eingegebenen Passwörter stimmen nicht überein.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Brieftasche öffnen fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Inkorrektes Passwort um die Brieftasche zu entschlüsseln</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Brieftasche entschlüsseln fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Brieftaschen Passwort erfolgreich geändert</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Achtung: Die Umschalttaste ist eingeschaltet!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netzmaske</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Gesperrt bis</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Über das Netzwerk abgleichen</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Übersicht</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Knoten</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Generelle Übersicht der Brieftasche </translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaktionen</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Zeige Transaktionsverlauf</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Beenden</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Programm beenden</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Über %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Zeige Informationen zu %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Über &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Informationen über Qt anzeigen</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Einstellungen...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Ändern Sie die Konfigurationsoptionen für %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Brieftasche verschlüsseln...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Sicherungskopie der Brieftasche...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Passwort ändern...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Adressen senden...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Adressen empfangen...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Öffne &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Klicken Sie, um die Netzwerkaktivität zu deaktivieren.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Netzwerkaktivität wurde deaktiviert.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Klicken Sie, um die Netzwerkaktivität wieder zu aktivieren.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synchronisiere Header (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexiere Blöcke auf dem Datenträger...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Coins an eine Bitcoin-Adresse senden</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Wallet an einen anderen Ort sichern</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Ändern Sie das Passwort, das für die Wallet-Verschlüsselung verwendet wird</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Debug Fenster</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Die Debugging- und Diagnosekonsole öffnen</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Nachricht &amp;bestätigen</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Brieftasche</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Senden</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Empfangen</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;anzeigen / verstecken</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Das Hauptfenster ein- oder ausblenden</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Verschlüssele die Private Keys, die zu deiner Brieftasche gehören</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Nachrichten mit Ihrer Bitcoin-Adresse signieren, um zu beweisen, dass sie Ihnen gehören</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Überprüfen Sie Nachrichten, um sicherzustellen, dass sie mit den angegebenen Bitcoin-Adressen signiert wurden</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Datei</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Einstellungen</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Hilfe</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Registerkarten-Symbolleiste</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Liste der benutzten Sendeadressen und -etiketten</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Zeige Liste der benutzten Empfangsadressen und -etiketten</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indexiere Blöcke auf dem Datenträger...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Verarbeite Blöcke auf dem Datenträger...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 im Rückstand</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transaktionen danach sind noch nicht sichtbar.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fehler</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Achtung</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Auf dem neuesten Stand</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Aufholen...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Menge: %1</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Überweisung gesendet</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Überweisung empfangen</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Ein schwerwiegender Fehler ist aufgetreten. Bitcoin kann nicht mehr sicher fortfahren und beendet sich.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Anzahl:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Byte:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Betrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Gebühr:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Dust:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Nach Gebühr:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Betrag</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Bestätigungen</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bestätigt</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Adresse kopieren</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etikett kopieren</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Betrag kopieren</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Transaktions ID kopieren</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Menge kopieren</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>Ja</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>Nein</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(kein Etikett)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Adresse bearbeiten</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etikett</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresse</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Neue Empfangsadresse</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Neue Sendeadresse</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Empfangsadresse bearbeiten</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Sendeadresse bearbeiten</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>Name</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>Version</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Willkommen</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fehler</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formular</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Unbekannt...</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Error</source>\n        <translation>Fehler</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formular</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Betrag</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Bitcoin Adresse eingeben (z.B. %1)</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>Copy label</source>\n        <translation>Etikett kopieren</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Betrag kopieren</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Betrag</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikett</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikett</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(kein Etikett)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Anzahl:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Byte:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Betrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Gebühr:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Nach Gebühr:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Dust:</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Menge kopieren</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Betrag kopieren</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(kein Etikett)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Betrag</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikett</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(kein Etikett)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>Adresse kopieren</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etikett kopieren</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Betrag kopieren</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Transaktions ID kopieren</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Komma getrenntes Dokument (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bestätigt</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikett</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Export fehlgeschlagen</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportieren</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Daten des aktiven Fensters exportieren</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Sicherung fehlgeschlagen</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Sicherung erfolgreich</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Optionen:</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Achtung</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Starte Netzwerk-Threads...</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Das ist die Mindestgebühr für jede Transaktion</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Das ist die Gebühr für die Überweisung</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Überweisungsbetrag kann nicht negativ sein</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Überweisung muss mindestens einen Empfänger haben </translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Ungenügendes Guthaben</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Block Verzeichnis laden...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Brieftasche laden...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Neuscannen...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Laden abgeschlossen</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fehler</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_el.ts",
    "content": "<TS language=\"el\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Δημιουργία νέου λογαριασμού</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Αντιγραφή</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Εισάγετε συνθηματικό</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Νέο συνθηματικό</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Επαναλάβετε νέο συνθηματικό</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Quit application</source>\n        <translation>Κλείσιμο εφαρμογής</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Πορτοφόλι</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Σφάλμα</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Date</source>\n        <translation>Ημερομηνία</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>&amp;Label</source>\n        <translation>Ετικέτα</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>Διεύθυνση</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>έκδοση</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Καλώς Ήλθατε</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Σφάλμα</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Πορτοφόλι</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Σφάλμα</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>Services</source>\n        <translation>Υπηρεσίες</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>Remove</source>\n        <translation>Αφαίρεση</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Κεφάλαια μη επαρκή</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Συνίσταται:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>Message:</source>\n        <translation>Μήνυμα:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Κεφάλαια μη επαρκή</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Φόρτωση πορτοφολιού...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Επανάληψη σάρωσης</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Η φόρτωση ολοκληρώθηκε</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Σφάλμα</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_el_GR.ts",
    "content": "<TS language=\"el_GR\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Δεξί-κλικ για επεξεργασία της διεύθυνσης ή της ετικέτας</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Δημιουργία νέας διεύθυνσης</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Νέo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Αντέγραψε την επιλεγμένη διεύθυνση στο πρόχειρο του συστήματος</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Αντιγραφή</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Κ&amp;λείσιμο</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Διαγραφή της επιλεγμένης διεύθυνσης από τη λίστα</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Εξαγωγή δεδομένων καρτέλας σε αρχείο</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Εξαγωγή</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Διαγραφή</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Επιλέξτε διεύθυνση αποστολής των νομισμάτων σας</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Επιλέξτε διεύθυνση παραλαβής νομισμάτων</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Ε&amp;πιλογή</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Διευθύνσεις αποστολής</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Διευθύνσεις λήψης</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Αυτές είναι οι Bitcoin διευθύνσεις σας για να στέλνετε πληρωμές. Να ελέγχετε πάντα το ποσό, καθώς και τη διεύθυνση παραλήπτη πριν στείλετε νομίσματα.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Αυτές είναι οι Bitcoin διευθύνσεις σας για να λαμβάνετε πληρωμές. Προτείνετε να χρησιμοποιείτε μια νέα διεύθυνση παραλήπτη για κάθε συναλλαγή.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Αντιγραφή Διεύθυνσης</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Αντιγραφή&amp;Ετικέτα</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Διόρθωση</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Εξαγωγή Λίστας Διευθύνσεων</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Αποτυχία Εξαγωγής</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Σφάλμα κατά την προσπάθεια αποθήκευσης της λίστας διευθύνσεων στο %1. Παρακαλώ δοκιμάστε ξανά.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Ετικέτα</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Διεύθυνση</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(χωρίς ετικέτα)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Φράση πρόσβασης </translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Βάλτε κωδικό πρόσβασης</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>&amp;Αλλαγή κωδικού</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Επανέλαβε τον νέο κωδικό πρόσβασης</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Προβολή κωδικού πρόσβασης</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Εισάγετε το νέο κωδικό πρόσβασης στο πορτοφόλι. &lt;br/&gt;Παρακαλώ χρησιμοποιείστε έναν κωδικό με &lt;b&gt;δέκα ή περισσότερους τυχαίους χαρακτήρες &lt;/b&gt;, ή &lt;b&gt;οχτώ ή παραπάνω λέξεις &lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>&amp;Κρυπτογράφηση πορτοφολιού</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Αυτή η ενέργεια χρειάζεται τον κωδικό του πορτοφολιού για να ξεκλειδώσει το πορτοφόλι.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Ξεκλείδωσε το πορτοφόλι</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Αυτή η ενέργεια χρειάζεται τον κωδικό του πορτοφολιού για να αποκρυπτογραφήσει το πορτοφόλι.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Αποκρυπτογράφησε το πορτοφόλι</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Αλλάξτε Φράση Πρόσβασης</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Εισάγετε την παλιά φράση κλειδί και την νέα φράση κλειδί στο πορτοφόλι.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Επιβεβαίωσε κρυπτογράφηση πορτοφολιού</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Προσόχη! Εάν κρυπτογραφήσεις το πορτοφόλι σου και χάσεις τη φράση αποκατάστασης, θα &lt;b&gt; ΧΑΣΕΙΣ ΟΛΑ ΣΟΥ ΤΑ BITCOIN &lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Είστε σίγουρος/η ότι θέλετε να κρυπτογραφήσετε το πορτοφόλι σας;</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Πορτοφόλι κρυπτογραφήθηκε</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 θα κλείσει τώρα για να τελειώσει η διαδικασία κρυπτογράφησης. Να θυμάστε ότι κρυπτογραφόντας το πορτοφόλι σας δεν μπορείτε να προστατεύσετε πλήρως τα bitcoin σας απο κλοπή μέσω malware που μπορεί να προσβάλει τον υπολογιστή σας.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Η κρυπτογράφηση του πορτοφολιού απέτυχε</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Το ξεκλείδωμα του πορτοφολιού απέτυχε</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation> Η αποκρυπτογράφηση του πορτοφολιού απέτυχε </translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Η φράση πρόσβασης άλλαξε επιτυχώς</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Υπογραφή &amp;μηνύματος...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Συγχρονισμός με το δίκτυο...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Επισκόπηση</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Κόμβος</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Εμφάνισε τη γενική εικόνα του πορτοφολιού</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Συναλλαγές</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Περιήγηση στο ιστορικό συναλλαγών</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Έ&amp;ξοδος</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Έξοδος από την εφαρμογή</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Περί %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Σχετικά με &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Εμφάνισε πληροφορίες σχετικά με Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Επιλογές...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Κρυπτογράφησε το πορτοφόλι</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Αντίγραφο ασφαλείας του πορτοφολιού</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Άλλαξε Φράση Πρόσβασης</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Διευθύνσεις αποστολής</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Διευθύνσεις λήψης</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>'Ανοιγμα &amp;URI</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Φόρτωση ευρετηρίου μπλοκ στον σκληρό δίσκο...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Στείλε νομίσματα σε μια διεύθυνση bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Δημιουργία αντιγράφου ασφαλείας πορτοφολιού σε άλλη τοποθεσία</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Αλλαγή του κωδικού κρυπτογράφησης του πορτοφολιού</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Παράθυρο αποσφαλμάτωσης</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Άνοιγμα κονσόλας αποσφαλμάτωσης και διαγνωστικών</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Επιβεβαίωση μηνύματος</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Πορτοφόλι</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Αποστολή</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Παραλαβή </translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Εμφάνισε/Κρύψε</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Εμφάνιση ή απόκρυψη του κεντρικού παραθύρου</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Κρυπτογραφήστε τα ιδιωτικά κλειδιά που ανήκουν στο πορτοφόλι σας </translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Υπογράψτε ένα μήνυμα για να βεβαιώσετε πως είστε ο κάτοχος αυτής της διεύθυνσης</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Υπογράψτε ένα μήνυμα για ν' αποδείξετε πως ανήκει μια συγκεκριμένη διεύθυνση Bitcoin</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Αρχείο</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Ρυθμίσεις</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Βοήθεια</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Εργαλειοθήκη καρτελών</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Αίτηση πληρωμών (δημιουργεί QR codes και διευθύνσεις bitcoin: )</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Προβολή της λίστας των χρησιμοποιημένων διευθύνσεων και ετικετών αποστολής</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Προβολή της λίστας των χρησιμοποιημένων διευθύνσεων και ετικετών λήψεως</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Άνοιγμα bitcoin: URI αίτησης πληρωμής</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Επιλογές γραμμής εντολών</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 πίσω</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Το τελευταίο μπλοκ που ελήφθη δημιουργήθηκε %1 πριν.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Οι συναλλαγές μετά από αυτό δεν θα είναι ακόμη ορατές.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Σφάλμα</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Προειδοποίηση</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Πληροφορία</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Ενημερωμένο</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Ενημέρωση...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Ημερομηνία: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Ποσό: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Τύπος: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Ετικέτα: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Διεύθυνση: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Η συναλλαγή απεστάλη</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Εισερχόμενη συναλλαγή</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Το πορτοφόλι είναι &lt;b&gt;κρυπτογραφημένο&lt;/b&gt; και &lt;b&gt;ξεκλείδωτο&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Το πορτοφόλι είναι &lt;b&gt;κρυπτογραφημένο&lt;/b&gt; και &lt;b&gt;κλειδωμένο&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Επιλογή κερμάτων</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Ποσότητα:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Ποσό:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Ταρίφα:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Σκόνη:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Ταρίφα αλλαγής:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Ρέστα:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(από)επιλογή όλων</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Εμφάνιση τύπου δέντρο</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Λίστα εντολών</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Ποσό</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Παραλήφθηκε με επιγραφή</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Παραλείφθηκε με την εξής διεύθυνση</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Ημερομηνία</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Επικυρώσεις</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Επικυρωμένες</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Αντιγραφή διεύθυνσης</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Αντιγραφή ετικέτας</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Αντιγραφή ποσού</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Αντιγραφή ταυτότητας συναλλαγής</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ναι</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>όχι</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(χωρίς ετικέτα)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(αλλαγή)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Επεξεργασία Διεύθυνσης</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Επιγραφή</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Η ετικέτα που συνδέεται με αυτήν την καταχώρηση στο βιβλίο διευθύνσεων</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Η διεύθυνση σχετίζεται με αυτή την καταχώρηση του βιβλίου διευθύνσεων. Μπορεί να τροποποιηθεί μόνο για τις διευθύνσεις αποστολής.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Διεύθυνση</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Νέα Διεύθυνση Λήψης</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Νέα Διεύθυνση Αποστολής</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Διόρθωση Διεύθυνσης Λήψης</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation> Επεξεργασία διεύθυνσης αποστολής</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Θα δημιουργηθεί ένας νέος φάκελος δεδομένων.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>όνομα</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Κατάλογος ήδη υπάρχει. Προσθήκη %1, αν σκοπεύετε να δημιουργήσετε έναν νέο κατάλογο εδώ.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Η διαδρομή υπάρχει ήδη αλλά δεν είναι φάκελος</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Δεν μπορεί να δημιουργηθεί φάκελος δεδομένων εδώ.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>έκδοση</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Επιλογές γραμμής εντολών</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Χρήση:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>επιλογές γραμμής εντολών</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Καλώς ήρθατε</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Χρήση του προεπιλεγμένου φακέλου δεδομένων</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Προσαρμογή του φακέλου δεδομένων: </translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Σφάλμα: Ο καθορισμένος φάκελος δεδομένων \"%1\" δεν μπορεί να δημιουργηθεί.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Σφάλμα</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB ελεύθερου χώρου διαθέσιμα</numerusform><numerusform>%n GB ελεύθερου χώρου διαθέσιμα</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(από το %n GB που απαιτείται)</numerusform><numerusform>(από τα %n GB που απαιτούνται)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Φόρμα</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Άγνωστο...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Χρόνος τελευταίου μπλοκ</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Απόκρυψη</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Άνοιγμα &amp;URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Ανοιχτό αίτημα πληρωμής από URI ή από αρχείο</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Επιλέξτε πληρωμή αρχείου αίτησης</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Ρυθμίσεις</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Κύριο</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Μέγεθος κρυφής μνήμης βάσης δεδομένων.</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Αριθμός script και γραμμές επαλήθευσης </translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Διεύθυνση IP του διαμεσολαβητή (π.χ. 127.0.0.1  / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Ελαχιστοποίηση αντί για έξοδο κατά το κλείσιμο του παραθύρου. Όταν αυτή η επιλογή είναι ενεργοποιημένη, η εφαρμογή θα κλείνει μόνο αν επιλεχθεί η Έξοδος στο μενού.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URLs από τρίτους (π.χ. ένας εξερευνητής μπλοκ) τα οποία εμφανίζονται στην καρτέλα συναλλαγών ως στοιχεία μενού. Το %s στα URL αντικαθίσταται από την τιμή της κατατεμαχισμένης συναλλαγής.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Ενεργές επιλογές γραμμής-εντολών που παρακάμπτουν τις παραπάνω επιλογές:</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Άνοιγμα Αρχείου Ρυθμίσεων</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Επαναφορά όλων των επιλογών του πελάτη στις αρχικές.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>Επαναφορά ρυθμίσεων</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Δίκτυο</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = αυτόματο, &lt;0 = ελεύθεροι πυρήνες)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Π&amp;ορτοφόλι</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Έμπειρος</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Ενεργοποίηση δυνατοτήτων ελέγχου κερμάτων</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Εάν απενεργοποιήσετε το ξόδεμα μη επικυρωμένων ρέστων, τα ρέστα από μια συναλλαγή δεν μπορούν να χρησιμοποιηθούν έως ότου αυτή η συναλλαγή έχει έστω μια επικύρωση. Αυτό επίσης επηρεάζει το πως υπολογίζεται το υπόλοιπό σας.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Ξόδεμα μη επικυρωμένων ρέστων</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Αυτόματο άνοιγμα των θυρών Bitcoin στον δρομολογητή. Λειτουργεί μόνο αν ο δρομολογητής σας υποστηρίζει τη λειτουργία UPnP.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Απόδοση θυρών με χρήστη &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Σύνδεση στο δίκτυο Bitcoin μέσω διαμεσολαβητή SOCKS5 (π.χ. για σύνδεση μέσω Tor)</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Σύνδεση μέσω διαμεσολαβητή SOCKS5 (προεπιλεγμένος)</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP διαμεσολαβητή:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Θύρα:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Θύρα διαμεσολαβητή</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Παράθυρο</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Εμφάνιση μόνο εικονιδίου στην περιοχή ειδοποιήσεων κατά την ελαχιστοποίηση.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Ελαχιστοποίηση στην περιοχή ειδοποιήσεων αντί της γραμμής εργασιών</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>Ε&amp;λαχιστοποίηση κατά το κλείσιμο</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Απεικόνιση</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Γλώσσα περιβάλλοντος εργασίας:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Μονάδα μέτρησης:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Διαλέξτε την προεπιλεγμένη υποδιαίρεση που θα εμφανίζεται όταν στέλνετε νομίσματα.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Επιλογή κατά πόσο να αναδείχνονται οι δυνατότητες ελέγχου κερμάτων.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;ΟΚ</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Ακύρωση</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>προεπιλογή</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>κανένα</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Επιβεβαίωση των επιλογών επαναφοράς</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Χρειάζεται επανεκκίνηση του προγράμματος για να ενεργοποιηθούν οι αλλαγές.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Σφάλμα</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Η αλλαγή αυτή θα χρειαστεί επανεκκίνηση του προγράμματος</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Δεν είναι έγκυρη η διεύθυνση διαμεσολαβητή</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Φόρμα</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Οι πληροφορίες που εμφανίζονται μπορεί να είναι ξεπερασμένες. Το πορτοφόλι σας συγχρονίζεται αυτόματα με το δίκτυο Bitcoin μετά από μια σύνδεση, αλλά αυτή η διαδικασία δεν έχει ακόμη ολοκληρωθεί. </translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Επίβλεψη μόνο:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Διαθέσιμο:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Το τρέχον διαθέσιμο υπόλοιπο</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Εκκρεμούν:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Το άθροισμα των συναλλαγών που δεν έχουν ακόμα επιβεβαιωθεί και δεν προσμετρώνται στο τρέχον διαθέσιμο υπόλοιπό σας</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Ανώριμος</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Εξορυγμένο υπόλοιπο που δεν έχει ακόμα ωριμάσει</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Υπόλοιπο:</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Σύνολο:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Το τρέχον συνολικό υπόλοιπο</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Το τρέχον υπόλοιπο σας σε διευθύνσεις παρακολούθησης μόνο</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Ξοδεμένα:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Πρόσφατες συναλλαγές</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Μη επικυρωμένες συναλλαγές σε διευθύνσεις παρακολούθησης μόνο</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Εξορυγμένο υπόλοιπο σε διευθύνσεις παρακολούθησης μόνο που δεν έχει ωριμάσει ακόμα</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Το τρέχον συνολικό υπόλοιπο σε διευθύνσεις παρακολούθησης μόνο</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Σφάλμα αίτησης πληρωμής</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Δεν είναι δυνατή η εκκίνηση του bitcoin: χειριστής click-to-pay</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI χειριστής</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Επεξεργασία αρχείου αίτησης πληρωμής</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Η αίτηση πληρωμής απορρίφθηκε</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>Αποστολή</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Παραλήφθησαν</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Ποσό</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Εισάγετε μια διεύθυνση Bitcoin (π.χ. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Κανένα</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Μη διαθέσιμο</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 και %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>Άγνωστο</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Μη διαθέσιμο</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Έκδοση Πελάτη</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Πληροφορία</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Παράθυρο αποσφαλμάτωσης</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Γενικά</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Χρήση BerkeleyDB έκδοσης</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Χρόνος εκκίνησης</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Δίκτυο</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Όνομα</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Αριθμός συνδέσεων</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Αλυσίδα μπλοκ</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Τρέχον αριθμός μπλοκ</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Παραλήφθησαν</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Αποστολή</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Χρήστες</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Επιλέξτε ένα χρήστη για να δείτε αναλυτικές πληροφορίες.</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Έκδοση</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Υπηρεσίες</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Σκορ Aποκλεισμού</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Χρόνος σύνδεσης</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Τελευταία αποστολή</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Τελευταία λήψη</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Χρόνος καθυστέρησης</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Χρόνος τελευταίου μπλοκ</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Άνοιγμα</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Κονσόλα</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Κίνηση δικτύου</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Σύνολα</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Εισερχόμενα:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Εξερχόμενα:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Αρχείο καταγραφής εντοπισμού σφαλμάτων </translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Καθαρισμός κονσόλας</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>μέσω %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>ποτέ</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Εισερχόμενα</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Εξερχόμενα</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Άγνωστο(α)</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Ποσό:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Επιγραφή</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Μήνυμα:</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Καθαρισμός όλων των πεδίων της φόρμας.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Καθαρισμός</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Αίτηση πληρωμής</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Εμφάνιση</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Αφαίρεση επιλεγμένων καταχωρίσεων από τη λίστα</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Αφαίρεση</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Αντιγραφή της επιλεγμένης διεύθυνσης στο πρόχειρο του συστήματος</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Αντιγραφή ετικέτας</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Αντιγραφή ποσού</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Κώδικας QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Αντιγραφή της επιλεγμένης διεύθυνσης στο πρόχειρο του συστήματος</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Αντιγραφή &amp;Διεύθυνσης</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Αποθήκευση εικόνας...</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Διεύθυνση</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Ετικέτα</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Ημερομηνία</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Ετικέτα</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(χωρίς ετικέτα)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Αποστολή νομισμάτων</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Χαρακτηριστικά επιλογής κερμάτων</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Εισροές...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>επιλεγμένο αυτόματα</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Ανεπαρκές κεφάλαιο!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Ποσότητα:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Ποσό:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Ταρίφα:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Ταρίφα αλλαγής:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Ρέστα:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Όταν ενεργό, αλλά η διεύθυνση ρέστων είναι κενή ή άκυρη, τα ρέστα θα σταλούν σε μία πρόσφατα δημιουργημένη διεύθυνση.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Προσαρμοσμένη διεύθυνση ρέστων</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Τέλος συναλλαγής:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Επιλογή...</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>ανά kilobyte</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Απόκρυψη</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Προτεινόμενο: </translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Προσαρμογή:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Αποστολή σε πολλούς αποδέκτες ταυτόχρονα</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;Προσθήκη αποδέκτη</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Καθαρισμός όλων των πεδίων της φόρμας.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Σκόνη:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Καθαρισμός &amp;Όλων</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Υπόλοιπο:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Επιβεβαίωση αποστολής</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>Αποστολή</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Αντιγραφή ποσού</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(χωρίς ετικέτα)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Ποσό:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Πληρωμή &amp;σε:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Επιγραφή</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Επιλογή διεύθυνσης που έχει ήδη χρησιμοποιηθεί</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Αυτή είναι μια απλή πληρωμή.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Η διεύθυνση Bitcoin που θα σταλεί η πληρωμή</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Επικόλληση διεύθυνσης από το βιβλίο διευθύνσεων</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Αφαίρεση αυτής της καταχώρησης</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Μήνυμα:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Εισάγετε μία ετικέτα για αυτή την διεύθυνση για να προστεθεί στη λίστα με τις χρησιμοποιημένες διευθύνσεις</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Πληρωμή σε:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Σημείωση:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Μην απενεργοποιήσετε τον υπολογιστή μέχρι να κλείσει αυτό το παράθυρο.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Υπογραφές - Είσοδος / Επαλήθευση Mηνύματος </translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Υπογραφή Μηνύματος</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Διεύθυνση Bitcoin που θα σταλεί το μήνυμα</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Επιλογή διεύθυνσης που έχει ήδη χρησιμοποιηθεί</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Επικόλληση διεύθυνσης από το βιβλίο διευθύνσεων</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Εισάγετε εδώ το μήνυμα που θέλετε να υπογράψετε</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Υπογραφή</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Αντιγραφή της επιλεγμένης υπογραφής στο πρόχειρο του συστήματος</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Υπογράψτε το μήνυμα για να αποδείξετε πως σας ανήκει η συγκεκριμένη διεύθυνση Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Υπογραφη μήνυματος</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Επαναφορά όλων των πεδίων μήνυματος</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Καθαρισμός &amp;Όλων</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Επιβεβαίωση Mηνύματος</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Διεύθυνση Bitcoin με την οποία έχει υπογραφεί το μήνυμα</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Επαληθεύστε το μήνυμα για να αποδείξετε πως υπογράφθηκε από τη συγκεκριμένη διεύθυνση Bitcoin</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Επιβεβαίωση Mηνύματος</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Επαναφορά όλων των πεδίων επαλήθευσης μηνύματος</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Ανοιχτό μέχρι %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/αποσυνδεδεμένο</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/ανεπιβεβαίωτο, %1</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Ημερομηνία</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Πηγή</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Παράχθηκε</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Από</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>Άγνωστο</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Προς</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>δική σας διεύθυνση</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>παρακολούθηση-μόνο</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>ετικέτα</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Πίστωση</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>μη έγκυρο</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Συνολική πίστωση</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Κόστος συναλλαγής</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Αυτό το παράθυρο δείχνει μια λεπτομερή περιγραφή της συναλλαγής</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Ημερομηνία</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Ετικέτα</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Ανοιχτό μέχρι %1</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>παρακολούθηση-μόνο</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(χωρίς ετικέτα)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>Αντιγραφή διεύθυνσης</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Αντιγραφή ετικέτας</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Αντιγραφή ποσού</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Αντιγραφή ταυτότητας συναλλαγής</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Αντιγραφή ανεπεξέργαστης συναλλαγής</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Επεξεργασία ετικέτας</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Αρχείο οριοθετημένο με κόμματα (*.csv)</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Ημερομηνία</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Ετικέτα</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Διεύθυνση</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Αποτυχία Εξαγωγής</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Μονάδα μέτρησης προβολής ποσών. Κάντε κλικ για επιλογή άλλης μονάδας.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Επιλογές:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Ορισμός φακέλου δεδομένων</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Σύνδεση σε έναν κόμβο για την ανάκτηση διευθύνσεων από ομότιμους, και αποσύνδεση</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Διευκρινίστε τη δικιά σας δημόσια διεύθυνση.</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Αποδοχή εντολών κονσόλας και JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Εκτέλεση στο παρασκήνιο και αποδοχή εντολών</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Δέσμευση σε συγκεκριμένη διεύθυνση και συνεχόμενη παρακολούθηση σε αυτή. Χρησιμοποιήστε τη σημειογραφία [διακομιστή]:θύρα για IPv6</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Να δέχεσαι συνδέσεις από έξω(προεπιλογή:1)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Επιλογές δημιουργίας μπλοκ:</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Επιλογές σύνδεσης:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Εντοπίσθηκε διεφθαρμένη βάση δεδομένων των μπλοκ</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Θέλετε να δημιουργηθεί τώρα η βάση δεδομένων των μπλοκ;</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Σφάλμα κατά την ενεργοποίηση της βάσης δεδομένων των μπλοκ</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Σφάλμα κατά την ενεργοποίηση της βάσης δεδομένων πορτοφολιού %s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Σφάλμα φόρτωσης της βάσης δεδομένων των μπλοκ</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Σφάλμα φόρτωσης της βάσης δεδομένων των μπλοκ</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Σφάλμα: Χαμηλός χώρος στο δίσκο!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Αποτυχία παρακολούθησης σε οποιαδήποτε θύρα. Χρησιμοποιήστε -listen=0 αν θέλετε αυτό.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Εισαγωγή...</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Δεν υπάρχουν αρκετοί περιγραφείς αρχείων διαθέσιμοι.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Σύνδεση μόνο σε κόμβους του δικτύου &lt;net&gt; (ipv4, ipv6 ή onion)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Επιλέξτε αρχείο πορτοφολιού (μέσα από κατάλογο δεδομένων)</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Επαλήθευση των μπλοκ...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Επιλογές πορτοφολιού:</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Σύνδεση μέσω διαμεσολαβητή SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Σφάλμα ανάγνωσης από τη βάση δεδομένων, γίνεται τερματισμός.</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Πληροφορία</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Επιλογές αναμετάδοσης κόμβου:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Επιλογές διακομιστή RPC:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Αποστολή πληροφοριών εντοπισμού σφαλμάτων στην κονσόλα αντί του αρχείου debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Προβολή όλων των επιλογών εντοπισμού σφαλμάτων (χρήση: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Συρρίκνωση του αρχείου debug.log κατα την εκκίνηση του πελάτη (προεπιλογή: 1 όταν δεν είναι -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Η υπογραφή συναλλαγής απέτυχε </translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Η εφαρμογή είναι σε πειραματικό στάδιο.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Το ποσό της συναλλαγής είναι πολύ μικρό</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Η συναλλαγή είναι πολύ μεγάλη</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Όνομα χρήστη για τις συνδέσεις JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Προειδοποίηση</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Μεταφορά όλων των συναλλαγών από το πορτοφόλι</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Κωδικός για τις συνδέσεις JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Εκτέλεσε την εντολή όταν το καλύτερο μπλοκ αλλάξει(%s στην εντολή αντικαθίσταται από το hash του μπλοκ)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Να επιτρέπονται οι έλεγχοι DNS για προσθήκη και σύνδεση κόμβων</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Πόσο εξονυχιστική να είναι η επιβεβαίωση του μπλοκ (0-4, προεπιλογή: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Διατήρηση ένος πλήρους ευρετηρίου συναλλαγών (προεπιλογή: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Αριθμός δευτερολέπτων πριν επιτραπεί ξανά η σύνδεση των προβληματικών χρηστών (προεπιλογή: %u)</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Πόσα μπλοκ να ελεγχθούν κατά την εκκίνηση (προεπιλογή: %u, 0 = όλα)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Να συμπεριληφθεί η διεύθυνση IP στην αναφορά? (προεπιλογή: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Μέγιστες αριθμός συνδέσεων με τους χρήστες &lt;n&gt; (προεπιλογή: %u)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Ορίστε αρχείο ρυθμίσεων (προεπιλογή: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Ορισμός λήξης χρονικού ορίου σε χιλιοστά του δευτερολέπτου(προεπιλογή: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Ορίστε αρχείο pid (προεπιλογή: %s)</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Όριο αποσύνδεσης προβληματικών χρηστών (προεπιλογή: %u)</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Έχει οριστεί άγνωστo δίκτυο στο -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Ανεπαρκές κεφάλαιο</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Φόρτωση ευρετηρίου μπλοκ...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Φόρτωση πορτοφολιού...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Δεν μπορώ να υποβαθμίσω το πορτοφόλι</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Ανίχνευση...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Η φόρτωση ολοκληρώθηκε</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Σφάλμα</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_en.ts",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!DOCTYPE TS>\n<TS version=\"2.1\" language=\"en\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <location filename=\"../forms/addressbookpage.ui\" line=\"+30\"/>\n        <source>Right-click to edit address or label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+27\"/>\n        <source>Create a new address</source>\n        <translation>Create a new address</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;New</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copy the currently selected address to the system clipboard</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;Copy</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+67\"/>\n        <source>C&amp;lose</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-53\"/>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Delete the currently selected address from the list</translation>\n    </message>\n    <message>\n        <location line=\"+30\"/>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Export the data in the current tab to a file</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;Export</source>\n        <translation>&amp;Export</translation>\n    </message>\n    <message>\n        <location line=\"-30\"/>\n        <source>&amp;Delete</source>\n        <translation>&amp;Delete</translation>\n    </message>\n    <message>\n        <location filename=\"../addressbookpage.cpp\" line=\"+50\"/>\n        <source>Choose the address to send coins to</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Choose the address to receive coins with</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>C&amp;hoose</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Sending addresses</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Receiving addresses</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>&amp;Copy Address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy &amp;Label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>&amp;Edit</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+193\"/>\n        <source>Export Address List</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Comma separated file (*.csv)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>Exporting Failed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <location filename=\"../addresstablemodel.cpp\" line=\"+169\"/>\n        <source>Label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+36\"/>\n        <source>(no label)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <location filename=\"../forms/askpassphrasedialog.ui\" line=\"+26\"/>\n        <source>Passphrase Dialog</source>\n        <translation>Passphrase Dialog</translation>\n    </message>\n    <message>\n        <location line=\"+30\"/>\n        <source>Enter passphrase</source>\n        <translation>Enter passphrase</translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>New passphrase</source>\n        <translation>New passphrase</translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Repeat new passphrase</source>\n        <translation>Repeat new passphrase</translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Show password</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location filename=\"../askpassphrasedialog.cpp\" line=\"+46\"/>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Encrypt wallet</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Unlock wallet</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Decrypt wallet</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Change passphrase</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+45\"/>\n        <source>Confirm wallet encryption</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <location line=\"+58\"/>\n        <source>Wallet encrypted</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-56\"/>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <location line=\"+7\"/>\n        <location line=\"+42\"/>\n        <location line=\"+6\"/>\n        <source>Wallet encryption failed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-54\"/>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <location line=\"+48\"/>\n        <source>The supplied passphrases do not match.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-37\"/>\n        <source>Wallet unlock failed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <location line=\"+11\"/>\n        <location line=\"+19\"/>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-20\"/>\n        <source>Wallet decryption failed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+47\"/>\n        <location line=\"+33\"/>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <location filename=\"../bantablemodel.cpp\" line=\"+89\"/>\n        <source>IP/Netmask</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Banned Until</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <location filename=\"../bitcoingui.cpp\" line=\"+358\"/>\n        <source>Sign &amp;message...</source>\n        <translation>Sign &amp;message...</translation>\n    </message>\n    <message>\n        <location line=\"+430\"/>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronizing with network...</translation>\n    </message>\n    <message>\n        <location line=\"-508\"/>\n        <source>&amp;Overview</source>\n        <translation>&amp;Overview</translation>\n    </message>\n    <message>\n        <location line=\"-144\"/>\n        <source>Node</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+145\"/>\n        <source>Show general overview of wallet</source>\n        <translation>Show general overview of wallet</translation>\n    </message>\n    <message>\n        <location line=\"+28\"/>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transactions</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Browse transaction history</source>\n        <translation>Browse transaction history</translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>E&amp;xit</source>\n        <translation>E&amp;xit</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Quit application</source>\n        <translation>Quit application</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;About %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Show information about %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>About &amp;Qt</source>\n        <translation>About &amp;Qt</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Show information about Qt</source>\n        <translation>Show information about Qt</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>&amp;Options...</source>\n        <translation>&amp;Options...</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Modify configuration options for %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Encrypt Wallet...</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Backup Wallet...</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Change Passphrase...</translation>\n    </message>\n    <message>\n        <location line=\"+12\"/>\n        <source>&amp;Sending addresses...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>&amp;Receiving addresses...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Open &amp;URI...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+360\"/>\n        <source>Click to disable network activity.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Network activity disabled.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Click to enable network activity again.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+27\"/>\n        <source>Syncing Headers (%1%)...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+37\"/>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexing blocks on disk...</translation>\n    </message>\n    <message>\n        <location line=\"-511\"/>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Send coins to a Bitcoin address</translation>\n    </message>\n    <message>\n        <location line=\"+67\"/>\n        <source>Backup wallet to another location</source>\n        <translation>Backup wallet to another location</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Change the passphrase used for wallet encryption</translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Debug window</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Open debugging and diagnostic console</translation>\n    </message>\n    <message>\n        <location line=\"-4\"/>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verify message...</translation>\n    </message>\n    <message>\n        <location line=\"+517\"/>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <location line=\"-743\"/>\n        <source>Wallet</source>\n        <translation>Wallet</translation>\n    </message>\n    <message>\n        <location line=\"+153\"/>\n        <source>&amp;Send</source>\n        <translation>&amp;Send</translation>\n    </message>\n    <message>\n        <location line=\"+11\"/>\n        <source>&amp;Receive</source>\n        <translation>&amp;Receive</translation>\n    </message>\n    <message>\n        <location line=\"+50\"/>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Show / Hide</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Show or hide the main Window</source>\n        <translation>Show or hide the main Window</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Encrypt the private keys that belong to your wallet</translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Sign messages with your Bitcoin addresses to prove you own them</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verify messages to ensure they were signed with specified Bitcoin addresses</translation>\n    </message>\n    <message>\n        <location line=\"+58\"/>\n        <source>&amp;File</source>\n        <translation>&amp;File</translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>&amp;Settings</source>\n        <translation>&amp;Settings</translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>&amp;Help</source>\n        <translation>&amp;Help</translation>\n    </message>\n    <message>\n        <location line=\"+15\"/>\n        <source>Tabs toolbar</source>\n        <translation>Tabs toolbar</translation>\n    </message>\n    <message>\n        <location line=\"-158\"/>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+70\"/>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>&amp;Command-line options</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+357\"/>\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation>\n            <numerusform>%n active connection to Bitcoin network</numerusform>\n            <numerusform>%n active connections to Bitcoin network</numerusform>\n        </translation>\n    </message>\n    <message>\n        <location line=\"+60\"/>\n        <source>Indexing blocks on disk...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Processing blocks on disk...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+19\"/>\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation>\n            <numerusform>Processed %n block of transaction history.</numerusform>\n            <numerusform>Processed %n blocks of transaction history.</numerusform>\n        </translation>\n    </message>\n    <message>\n        <location line=\"+24\"/>\n        <source>%1 behind</source>\n        <translation>%1 behind</translation>\n    </message>\n    <message>\n        <location line=\"+24\"/>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Last received block was generated %1 ago.</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transactions after this will not yet be visible.</translation>\n    </message>\n    <message>\n        <location line=\"+27\"/>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Warning</source>\n        <translation>Warning</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <location line=\"-78\"/>\n        <source>Up to date</source>\n        <translation>Up to date</translation>\n    </message>\n    <message>\n        <location line=\"-441\"/>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+200\"/>\n        <source>%1 client</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+227\"/>\n        <source>Connecting to peers...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+38\"/>\n        <source>Catching up...</source>\n        <translation>Catching up...</translation>\n    </message>\n    <message>\n        <location line=\"+150\"/>\n        <source>Date: %1\n</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Amount: %1\n</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Type: %1\n</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Label: %1\n</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Address: %1\n</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Sent transaction</source>\n        <translation>Sent transaction</translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Incoming transaction</source>\n        <translation>Incoming transaction</translation>\n    </message>\n    <message>\n        <location line=\"+52\"/>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+19\"/>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <location filename=\"../bitcoin.cpp\" line=\"+531\"/>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <location filename=\"../forms/coincontroldialog.ui\" line=\"+14\"/>\n        <source>Coin Selection</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+34\"/>\n        <source>Quantity:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+29\"/>\n        <source>Bytes:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+45\"/>\n        <source>Amount:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+80\"/>\n        <source>Fee:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-48\"/>\n        <source>Dust:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+93\"/>\n        <source>After Fee:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+32\"/>\n        <source>Change:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+56\"/>\n        <source>(un)select all</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+16\"/>\n        <source>Tree mode</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>List mode</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+56\"/>\n        <source>Amount</source>\n        <translation type=\"unfinished\">Amount</translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Received with label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Received with address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Date</source>\n        <translation type=\"unfinished\">Date</translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Confirmations</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Confirmed</source>\n        <translation type=\"unfinished\">Confirmed</translation>\n    </message>\n    <message>\n        <location filename=\"../coincontroldialog.cpp\" line=\"+52\"/>\n        <source>Copy address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <location line=\"+26\"/>\n        <source>Copy amount</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-25\"/>\n        <source>Copy transaction ID</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Lock unspent</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Unlock unspent</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+22\"/>\n        <source>Copy quantity</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Copy fee</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy after fee</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy bytes</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy dust</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy change</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+325\"/>\n        <source>(%1 locked)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+155\"/>\n        <source>yes</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>no</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+48\"/>\n        <location line=\"+52\"/>\n        <source>(no label)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-7\"/>\n        <source>change from %1 (%2)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>(change)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <location filename=\"../forms/editaddressdialog.ui\" line=\"+14\"/>\n        <source>Edit Address</source>\n        <translation>Edit Address</translation>\n    </message>\n    <message>\n        <location line=\"+11\"/>\n        <source>&amp;Label</source>\n        <translation>&amp;Label</translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>The label associated with this address list entry</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+17\"/>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-10\"/>\n        <source>&amp;Address</source>\n        <translation>&amp;Address</translation>\n    </message>\n    <message>\n        <location filename=\"../editaddressdialog.cpp\" line=\"+30\"/>\n        <source>New receiving address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>New sending address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Edit receiving address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Edit sending address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+72\"/>\n        <source>The entered address &quot;%1&quot; is not a valid Bitcoin address.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>The entered address &quot;%1&quot; is already in the address book.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Could not unlock wallet.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>New key generation failed.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <location filename=\"../intro.cpp\" line=\"+76\"/>\n        <source>A new data directory will be created.</source>\n        <translation>A new data directory will be created.</translation>\n    </message>\n    <message>\n        <location line=\"+22\"/>\n        <source>name</source>\n        <translation>name</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Directory already exists. Add %1 if you intend to create a new directory here.</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Path already exists, and is not a directory.</translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Cannot create data directory here.</source>\n        <translation>Cannot create data directory here.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <location filename=\"../utilitydialog.cpp\" line=\"+40\"/>\n        <source>version</source>\n        <translation type=\"unfinished\">version</translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <location line=\"+2\"/>\n        <source>(%1-bit)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>About %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+19\"/>\n        <source>Command-line options</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Usage:</source>\n        <translation type=\"unfinished\">Usage:</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>command-line options</source>\n        <translation type=\"unfinished\">command-line options</translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>UI Options:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Start minimized</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Reset all settings changed in the GUI</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <location filename=\"../forms/intro.ui\" line=\"+14\"/>\n        <source>Welcome</source>\n        <translation>Welcome</translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Welcome to %1.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+26\"/>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+157\"/>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-160\"/>\n        <source>Use the default data directory</source>\n        <translation>Use the default data directory</translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Use a custom data directory:</source>\n        <translation>Use a custom data directory:</translation>\n    </message>\n    <message>\n        <location filename=\"../intro.cpp\" line=\"+20\"/>\n        <source>Bitcoin</source>\n        <translation type=\"unfinished\">Bitcoin</translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+73\"/>\n        <source>Error: Specified data directory &quot;%1&quot; cannot be created.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+26\"/>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+9\"/>\n        <source>%n GB of free space available</source>\n        <translation>\n            <numerusform>%n GB of free space available</numerusform>\n            <numerusform>%n GB of free space available</numerusform>\n        </translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+3\"/>\n        <source>(of %n GB needed)</source>\n        <translation>\n            <numerusform>(of %n GB needed)</numerusform>\n            <numerusform>(of %n GB needed)</numerusform>\n        </translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <location filename=\"../forms/modaloverlay.ui\" line=\"+14\"/>\n        <source>Form</source>\n        <translation type=\"unfinished\">Form</translation>\n    </message>\n    <message>\n        <location line=\"+119\"/>\n        <source>Recent transactions may not yet be visible, and therefore your wallet&apos;s balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+19\"/>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+63\"/>\n        <source>Number of blocks left</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <location line=\"+26\"/>\n        <location filename=\"../modaloverlay.cpp\" line=\"+140\"/>\n        <source>Unknown...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-13\"/>\n        <source>Last block time</source>\n        <translation type=\"unfinished\">Last block time</translation>\n    </message>\n    <message>\n        <location line=\"+26\"/>\n        <source>Progress</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+34\"/>\n        <source>Progress increase per hour</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <location line=\"+20\"/>\n        <source>calculating...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-7\"/>\n        <source>Estimated time left until synced</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+37\"/>\n        <source>Hide</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location filename=\"../modaloverlay.cpp\" line=\"-1\"/>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <location filename=\"../forms/openuridialog.ui\" line=\"+14\"/>\n        <source>Open URI</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Open payment request from URI or file</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>URI:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Select payment request file</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location filename=\"../openuridialog.cpp\" line=\"+47\"/>\n        <source>Select payment request file to open</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <location filename=\"../forms/optionsdialog.ui\" line=\"+14\"/>\n        <source>Options</source>\n        <translation>Options</translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>&amp;Main</source>\n        <translation>&amp;Main</translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;Start %1 on system login</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Size of &amp;database cache</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+16\"/>\n        <source>MB</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+27\"/>\n        <source>Number of script &amp;verification threads</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+161\"/>\n        <location line=\"+187\"/>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-118\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+38\"/>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+108\"/>\n        <source>Hide the icon from the system tray.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;Hide tray icon</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+17\"/>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+80\"/>\n        <location line=\"+13\"/>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+31\"/>\n        <source>Active command-line options that override above options:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+45\"/>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Open Configuration File</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Reset all client options to default.</source>\n        <translation>Reset all client options to default.</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Reset Options</translation>\n    </message>\n    <message>\n        <location line=\"-529\"/>\n        <source>&amp;Network</source>\n        <translation>&amp;Network</translation>\n    </message>\n    <message>\n        <location line=\"-85\"/>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+36\"/>\n        <source>W&amp;allet</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Expert</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Enable coin &amp;control features</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+30\"/>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Map port using &amp;UPnP</translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Accept connections from outside.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Allow incomin&amp;g connections</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <location line=\"+187\"/>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <location line=\"-155\"/>\n        <location line=\"+187\"/>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <location line=\"-162\"/>\n        <location line=\"+187\"/>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port of the proxy (e.g. 9050)</translation>\n    </message>\n    <message>\n        <location line=\"-163\"/>\n        <source>Used for reaching peers via:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>IPv4</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>IPv6</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Tor</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+25\"/>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+105\"/>\n        <source>&amp;Window</source>\n        <translation>&amp;Window</translation>\n    </message>\n    <message>\n        <location line=\"+16\"/>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Show only a tray icon after minimizing the window.</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimize to the tray instead of the taskbar</translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimize on close</translation>\n    </message>\n    <message>\n        <location line=\"+21\"/>\n        <source>&amp;Display</source>\n        <translation>&amp;Display</translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>User Interface &amp;language:</source>\n        <translation>User Interface &amp;language:</translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+11\"/>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unit to show amounts in:</translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Choose the default subdivision unit to show in the interface and when sending coins.</translation>\n    </message>\n    <message>\n        <location line=\"-450\"/>\n        <source>Whether to show coin control features or not.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+464\"/>\n        <source>&amp;Third party transaction URLs</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+182\"/>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancel</translation>\n    </message>\n    <message>\n        <location filename=\"../optionsdialog.cpp\" line=\"+82\"/>\n        <source>default</source>\n        <translation>default</translation>\n    </message>\n    <message>\n        <location line=\"+64\"/>\n        <source>none</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+72\"/>\n        <source>Confirm options reset</source>\n        <translation>Confirm options reset</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <location line=\"+55\"/>\n        <source>Client restart required to activate changes.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-55\"/>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+15\"/>\n        <source>Configuration options</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Error</source>\n        <translation type=\"unfinished\">Error</translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>The configuration file could not be opened.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+38\"/>\n        <source>This change would require a client restart.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+28\"/>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>The supplied proxy address is invalid.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <location filename=\"../forms/overviewpage.ui\" line=\"+14\"/>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <location line=\"+62\"/>\n        <location line=\"+386\"/>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</translation>\n    </message>\n    <message>\n        <location line=\"-139\"/>\n        <source>Watch-only:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Available:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+16\"/>\n        <source>Your current spendable balance</source>\n        <translation>Your current spendable balance</translation>\n    </message>\n    <message>\n        <location line=\"+41\"/>\n        <source>Pending:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-236\"/>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</translation>\n    </message>\n    <message>\n        <location line=\"+112\"/>\n        <source>Immature:</source>\n        <translation>Immature:</translation>\n    </message>\n    <message>\n        <location line=\"-29\"/>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Mined balance that has not yet matured</translation>\n    </message>\n    <message>\n        <location line=\"-177\"/>\n        <source>Balances</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+161\"/>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <location line=\"+61\"/>\n        <source>Your current total balance</source>\n        <translation>Your current total balance</translation>\n    </message>\n    <message>\n        <location line=\"+92\"/>\n        <source>Your current balance in watch-only addresses</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Spendable:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+49\"/>\n        <source>Recent transactions</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-317\"/>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+50\"/>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+128\"/>\n        <source>Current total balance in watch-only addresses</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <location filename=\"../paymentserver.cpp\" line=\"+326\"/>\n        <location line=\"+214\"/>\n        <location line=\"+42\"/>\n        <location line=\"+111\"/>\n        <location line=\"+14\"/>\n        <location line=\"+18\"/>\n        <source>Payment request error</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-398\"/>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+102\"/>\n        <location line=\"+13\"/>\n        <location line=\"+7\"/>\n        <source>URI handling</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-19\"/>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+12\"/>\n        <source>Invalid payment address %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>Payment request file handling</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+61\"/>\n        <location line=\"+9\"/>\n        <location line=\"+31\"/>\n        <location line=\"+10\"/>\n        <location line=\"+17\"/>\n        <location line=\"+86\"/>\n        <source>Payment request rejected</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-153\"/>\n        <source>Payment request network doesn&apos;t match client network.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Payment request expired.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Payment request is not initialized.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+26\"/>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <location line=\"+17\"/>\n        <source>Invalid payment request.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-10\"/>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+55\"/>\n        <source>Refund from %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+42\"/>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Error communicating with %1: %2</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+20\"/>\n        <source>Payment request cannot be parsed!</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>Bad response from server %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+22\"/>\n        <source>Network request error</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+11\"/>\n        <source>Payment acknowledged</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <location filename=\"../peertablemodel.cpp\" line=\"+121\"/>\n        <source>User Agent</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Node/Service</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>NodeId</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Ping</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Sent</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Received</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <location filename=\"../bitcoinunits.cpp\" line=\"+185\"/>\n        <source>Amount</source>\n        <translation type=\"unfinished\">Amount</translation>\n    </message>\n    <message>\n        <location filename=\"../guiutil.cpp\" line=\"+130\"/>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+760\"/>\n        <source>%1 d</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>%1 h</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>%1 m</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <location line=\"+50\"/>\n        <source>%1 s</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-10\"/>\n        <source>None</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>N/A</source>\n        <translation type=\"unfinished\">N/A</translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>%1 ms</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+18\"/>\n        <source>%n second(s)</source>\n        <translation>\n            <numerusform>%n second</numerusform>\n            <numerusform>%n seconds</numerusform>\n        </translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+4\"/>\n        <source>%n minute(s)</source>\n        <translation>\n            <numerusform>%n minute</numerusform>\n            <numerusform>%n minutes</numerusform>\n        </translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+4\"/>\n        <source>%n hour(s)</source>\n        <translation type=\"unfinished\">\n            <numerusform>%n hour</numerusform>\n            <numerusform>%n hours</numerusform>\n        </translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+4\"/>\n        <source>%n day(s)</source>\n        <translation type=\"unfinished\">\n            <numerusform>%n day</numerusform>\n            <numerusform>%n days</numerusform>\n        </translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+4\"/>\n        <location line=\"+6\"/>\n        <source>%n week(s)</source>\n        <translation type=\"unfinished\">\n            <numerusform>%n week</numerusform>\n            <numerusform>%n weeks</numerusform>\n        </translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>%1 and %2</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+0\"/>\n        <source>%n year(s)</source>\n        <translation type=\"unfinished\">\n            <numerusform>%n year</numerusform>\n            <numerusform>%n years</numerusform>\n        </translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>%1 B</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>%1 KB</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>%1 MB</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>%1 GB</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location filename=\"../bitcoin.cpp\" line=\"+178\"/>\n        <source>%1 didn&apos;t yet exit safely...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location filename=\"../modaloverlay.cpp\" line=\"-29\"/>\n        <source>unknown</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <location filename=\"../bitcoin.cpp\" line=\"-86\"/>\n        <source>Error: Specified data directory &quot;%1&quot; does not exist.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Error: %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <location filename=\"../receiverequestdialog.cpp\" line=\"+35\"/>\n        <source>&amp;Save Image...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>&amp;Copy Image</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+32\"/>\n        <source>Save QR Code</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>PNG Image (*.png)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <location filename=\"../forms/debugwindow.ui\" line=\"+56\"/>\n        <location line=\"+26\"/>\n        <location line=\"+26\"/>\n        <location line=\"+23\"/>\n        <location line=\"+26\"/>\n        <location line=\"+36\"/>\n        <location line=\"+23\"/>\n        <location line=\"+36\"/>\n        <location line=\"+23\"/>\n        <location line=\"+36\"/>\n        <location line=\"+23\"/>\n        <location line=\"+663\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <location line=\"+26\"/>\n        <location line=\"+23\"/>\n        <location line=\"+23\"/>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <location line=\"-1345\"/>\n        <source>Client version</source>\n        <translation>Client version</translation>\n    </message>\n    <message>\n        <location line=\"-22\"/>\n        <source>&amp;Information</source>\n        <translation>&amp;Information</translation>\n    </message>\n    <message>\n        <location line=\"-10\"/>\n        <source>Debug window</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+25\"/>\n        <source>General</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+56\"/>\n        <source>Using BerkeleyDB version</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+26\"/>\n        <source>Datadir</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+26\"/>\n        <source>Startup time</source>\n        <translation>Startup time</translation>\n    </message>\n    <message>\n        <location line=\"+29\"/>\n        <source>Network</source>\n        <translation>Network</translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Name</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Number of connections</source>\n        <translation>Number of connections</translation>\n    </message>\n    <message>\n        <location line=\"+29\"/>\n        <source>Block chain</source>\n        <translation>Block chain</translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Current number of blocks</source>\n        <translation>Current number of blocks</translation>\n    </message>\n    <message>\n        <location line=\"+52\"/>\n        <source>Memory Pool</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Current number of transactions</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Memory usage</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+324\"/>\n        <source>&amp;Reset</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+80\"/>\n        <location line=\"+558\"/>\n        <source>Received</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-478\"/>\n        <location line=\"+455\"/>\n        <source>Sent</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-414\"/>\n        <source>&amp;Peers</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+53\"/>\n        <source>Banned peers</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+60\"/>\n        <location filename=\"../rpcconsole.cpp\" line=\"+496\"/>\n        <location line=\"+718\"/>\n        <source>Select a peer to view detailed information.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+25\"/>\n        <source>Whitelisted</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Direction</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Version</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+69\"/>\n        <source>Starting Block</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Synced Headers</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Synced Blocks</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-1079\"/>\n        <location line=\"+987\"/>\n        <source>User Agent</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-684\"/>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+68\"/>\n        <source>Decrease font size</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+29\"/>\n        <source>Increase font size</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+610\"/>\n        <source>Services</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+92\"/>\n        <source>Ban Score</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Connection Time</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Last Send</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Last Receive</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+69\"/>\n        <source>Ping Time</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Ping Wait</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Min Ping</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Time Offset</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-1116\"/>\n        <source>Last block time</source>\n        <translation>Last block time</translation>\n    </message>\n    <message>\n        <location line=\"+110\"/>\n        <source>&amp;Open</source>\n        <translation>&amp;Open</translation>\n    </message>\n    <message>\n        <location line=\"+26\"/>\n        <source>&amp;Console</source>\n        <translation>&amp;Console</translation>\n    </message>\n    <message>\n        <location line=\"+195\"/>\n        <source>&amp;Network Traffic</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+68\"/>\n        <source>Totals</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location filename=\"../rpcconsole.cpp\" line=\"-401\"/>\n        <source>In:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Out:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location filename=\"../forms/debugwindow.ui\" line=\"-299\"/>\n        <source>Debug log file</source>\n        <translation>Debug log file</translation>\n    </message>\n    <message>\n        <location line=\"+136\"/>\n        <source>Clear console</source>\n        <translation>Clear console</translation>\n    </message>\n    <message>\n        <location filename=\"../rpcconsole.cpp\" line=\"-225\"/>\n        <source>1 &amp;hour</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>1 &amp;day</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>1 &amp;week</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>1 &amp;year</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-4\"/>\n        <source>&amp;Disconnect</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <location line=\"+1\"/>\n        <location line=\"+1\"/>\n        <location line=\"+1\"/>\n        <source>Ban for</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+48\"/>\n        <source>&amp;Unban</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+136\"/>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>For more information on using this console type %1.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+36\"/>\n        <source>Network activity disabled</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+243\"/>\n        <source>(node id: %1)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>via %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <location line=\"+1\"/>\n        <source>never</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Inbound</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Outbound</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Yes</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>No</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+12\"/>\n        <location line=\"+6\"/>\n        <source>Unknown</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <location filename=\"../forms/receivecoinsdialog.ui\" line=\"+37\"/>\n        <source>&amp;Amount:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+46\"/>\n        <source>&amp;Label:</source>\n        <translation type=\"unfinished\">&amp;Label:</translation>\n    </message>\n    <message>\n        <location line=\"-30\"/>\n        <source>&amp;Message:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-3\"/>\n        <location line=\"+46\"/>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-30\"/>\n        <location line=\"+14\"/>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-7\"/>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-39\"/>\n        <location line=\"+153\"/>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-59\"/>\n        <source>Clear all fields of the form.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Clear</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+78\"/>\n        <source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don&apos;t support them. When unchecked, an address compatible with older wallets will be created instead.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Generate native segwit (Bech32) address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+61\"/>\n        <source>Requested payments history</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-162\"/>\n        <source>&amp;Request payment</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+187\"/>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Show</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+17\"/>\n        <source>Remove the selected entries from the list</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Remove</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location filename=\"../receivecoinsdialog.cpp\" line=\"+47\"/>\n        <source>Copy URI</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy message</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy amount</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <location filename=\"../forms/receiverequestdialog.ui\" line=\"+29\"/>\n        <source>QR Code</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+46\"/>\n        <source>Copy &amp;URI</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Copy &amp;Address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>&amp;Save Image...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location filename=\"../receiverequestdialog.cpp\" line=\"+65\"/>\n        <source>Request payment to %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Payment information</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>URI</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Amount</source>\n        <translation type=\"unfinished\">Amount</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Message</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Error encoding URI into QR Code.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <location filename=\"../recentrequeststablemodel.cpp\" line=\"+28\"/>\n        <source>Date</source>\n        <translation type=\"unfinished\">Date</translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Message</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+39\"/>\n        <source>(no label)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>(no message)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>(no amount requested)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+42\"/>\n        <source>Requested</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <location filename=\"../forms/sendcoinsdialog.ui\" line=\"+14\"/>\n        <location filename=\"../sendcoinsdialog.cpp\" line=\"+578\"/>\n        <source>Send Coins</source>\n        <translation>Send Coins</translation>\n    </message>\n    <message>\n        <location line=\"+76\"/>\n        <source>Coin Control Features</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+20\"/>\n        <source>Inputs...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>automatically selected</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+19\"/>\n        <source>Insufficient funds!</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+89\"/>\n        <source>Quantity:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+35\"/>\n        <source>Bytes:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+48\"/>\n        <source>Amount:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+80\"/>\n        <source>Fee:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+51\"/>\n        <source>After Fee:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+32\"/>\n        <source>Change:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+44\"/>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Custom change address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+206\"/>\n        <source>Transaction Fee:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Choose...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+24\"/>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+26\"/>\n        <source>collapse fee-settings</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+54\"/>\n        <source>per kilobyte</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-3\"/>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then &quot;per kilobyte&quot; only pays 250 satoshis in fee, while &quot;total at least&quot; pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-48\"/>\n        <source>Hide</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+78\"/>\n        <location line=\"+13\"/>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>(read the tooltip)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+29\"/>\n        <source>Recommended:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+30\"/>\n        <source>Custom:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+52\"/>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+185\"/>\n        <source>Send to multiple recipients at once</source>\n        <translation>Send to multiple recipients at once</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Add &amp;Recipient</source>\n        <translation>Add &amp;Recipient</translation>\n    </message>\n    <message>\n        <location line=\"-20\"/>\n        <source>Clear all fields of the form.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-833\"/>\n        <source>Dust:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+694\"/>\n        <source>Confirmation time target:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+74\"/>\n        <source>Enable Replace-By-Fee</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction&apos;s fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+65\"/>\n        <source>Clear &amp;All</source>\n        <translation>Clear &amp;All</translation>\n    </message>\n    <message>\n        <location line=\"+55\"/>\n        <source>Balance:</source>\n        <translation>Balance:</translation>\n    </message>\n    <message>\n        <location line=\"-84\"/>\n        <source>Confirm the send action</source>\n        <translation>Confirm the send action</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>S&amp;end</source>\n        <translation>S&amp;end</translation>\n    </message>\n    <message>\n        <location filename=\"../sendcoinsdialog.cpp\" line=\"-494\"/>\n        <source>Copy quantity</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy amount</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy fee</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy after fee</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy bytes</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy dust</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy change</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+76\"/>\n        <source>%1 (%2 blocks)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+127\"/>\n        <location line=\"+5\"/>\n        <location line=\"+5\"/>\n        <location line=\"+4\"/>\n        <source>%1 to %2</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Are you sure you want to send?</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>added as transaction fee</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+15\"/>\n        <source>Total Amount %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>or</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Confirm send coins</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+192\"/>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>The amount exceeds your balance.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Transaction creation failed!</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Payment request expired.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+91\"/>\n        <source>Pay only the required fee of %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+42\"/>\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation>\n            <numerusform>Estimated to begin confirmation within %n block.</numerusform>\n            <numerusform>Estimated to begin confirmation within %n blocks.</numerusform>\n        </translation>\n    </message>\n    <message>\n        <location line=\"+101\"/>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Warning: Unknown change address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Confirm custom change address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+21\"/>\n        <source>(no label)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <location filename=\"../forms/sendcoinsentry.ui\" line=\"+155\"/>\n        <location line=\"+546\"/>\n        <location line=\"+533\"/>\n        <source>A&amp;mount:</source>\n        <translation>A&amp;mount:</translation>\n    </message>\n    <message>\n        <location line=\"-1192\"/>\n        <source>Pay &amp;To:</source>\n        <translation>Pay &amp;To:</translation>\n    </message>\n    <message>\n        <location line=\"+93\"/>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <location line=\"-68\"/>\n        <source>Choose previously used address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-46\"/>\n        <source>This is a normal payment.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+39\"/>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+23\"/>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Paste address from clipboard</source>\n        <translation>Paste address from clipboard</translation>\n    </message>\n    <message>\n        <location line=\"+16\"/>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <location line=\"+555\"/>\n        <location line=\"+533\"/>\n        <source>Remove this entry</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-1028\"/>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Use available balance</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Message:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+443\"/>\n        <source>This is an unauthenticated payment request.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+529\"/>\n        <source>This is an authenticated payment request.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-1016\"/>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+54\"/>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+448\"/>\n        <location line=\"+529\"/>\n        <source>Pay To:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-495\"/>\n        <location line=\"+533\"/>\n        <source>Memo:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location filename=\"../sendcoinsentry.cpp\" line=\"+36\"/>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <location filename=\"../sendcoinsdialog.cpp\" line=\"+83\"/>\n        <location line=\"+5\"/>\n        <source>Yes</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <location filename=\"../utilitydialog.cpp\" line=\"+78\"/>\n        <source>%1 is shutting down...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <location filename=\"../forms/signverifymessagedialog.ui\" line=\"+14\"/>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signatures - Sign / Verify a Message</translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Sign Message</translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+18\"/>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <location line=\"+210\"/>\n        <source>Choose previously used address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-200\"/>\n        <location line=\"+210\"/>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <location line=\"-200\"/>\n        <source>Paste address from clipboard</source>\n        <translation>Paste address from clipboard</translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <location line=\"+12\"/>\n        <source>Enter the message you want to sign here</source>\n        <translation>Enter the message you want to sign here</translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Signature</source>\n        <translation>Signature</translation>\n    </message>\n    <message>\n        <location line=\"+27\"/>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copy the current signature to the system clipboard</translation>\n    </message>\n    <message>\n        <location line=\"+21\"/>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Sign the message to prove you own this Bitcoin address</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Sign &amp;Message</source>\n        <translation>Sign &amp;Message</translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Reset all sign message fields</source>\n        <translation>Reset all sign message fields</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <location line=\"+143\"/>\n        <source>Clear &amp;All</source>\n        <translation>Clear &amp;All</translation>\n    </message>\n    <message>\n        <location line=\"-84\"/>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verify Message</translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Enter the receiver&apos;s address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+21\"/>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+37\"/>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verify the message to ensure it was signed with the specified Bitcoin address</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Verify &amp;Message</source>\n        <translation>Verify &amp;Message</translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Reset all verify message fields</source>\n        <translation>Reset all verify message fields</translation>\n    </message>\n    <message>\n        <location filename=\"../signverifymessagedialog.cpp\" line=\"+41\"/>\n        <source>Click &quot;Sign Message&quot; to generate signature</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+82\"/>\n        <location line=\"+78\"/>\n        <source>The entered address is invalid.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-78\"/>\n        <location line=\"+7\"/>\n        <location line=\"+71\"/>\n        <location line=\"+6\"/>\n        <source>Please check the address and try again.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-77\"/>\n        <location line=\"+77\"/>\n        <source>The entered address does not refer to a key.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-69\"/>\n        <source>Wallet unlock was cancelled.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>Private key for the entered address is not available.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+12\"/>\n        <source>Message signing failed.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Message signed.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+55\"/>\n        <source>The signature could not be decoded.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <location line=\"+13\"/>\n        <source>Please check the signature and try again.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>The signature did not match the message digest.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Message verification failed.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Message verified.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <location filename=\"../networkstyle.cpp\" line=\"+19\"/>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <location filename=\"../trafficgraphwidget.cpp\" line=\"+80\"/>\n        <source>KB/s</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <location filename=\"../transactiondesc.cpp\" line=\"+30\"/>\n        <source>Open for %n more block(s)</source>\n        <translation>\n            <numerusform>Open for %n more block</numerusform>\n            <numerusform>Open for %n more blocks</numerusform>\n        </translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Open until %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>%1/offline</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>0/unconfirmed, %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>in memory pool</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>not in memory pool</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>abandoned</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>%1/unconfirmed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>%1 confirmations</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+17\"/>\n        <source>Status</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>, has not been successfully broadcast yet</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+2\"/>\n        <source>, broadcast through %n node(s)</source>\n        <translation>\n            <numerusform>, broadcast through %n node</numerusform>\n            <numerusform>, broadcast through %n nodes</numerusform>\n        </translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Date</source>\n        <translation type=\"unfinished\">Date</translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Source</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Generated</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <location line=\"+12\"/>\n        <location line=\"+72\"/>\n        <source>From</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-72\"/>\n        <source>unknown</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <location line=\"+20\"/>\n        <location line=\"+69\"/>\n        <source>To</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-87\"/>\n        <source>own address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <location line=\"+69\"/>\n        <source>watch-only</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-67\"/>\n        <source>label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+34\"/>\n        <location line=\"+12\"/>\n        <location line=\"+53\"/>\n        <location line=\"+26\"/>\n        <location line=\"+55\"/>\n        <source>Credit</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"-144\"/>\n        <source>matures in %n more block(s)</source>\n        <translation>\n            <numerusform>matures in %n more block</numerusform>\n            <numerusform>matures in %n more blocks</numerusform>\n        </translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>not accepted</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+59\"/>\n        <location line=\"+25\"/>\n        <location line=\"+55\"/>\n        <source>Debit</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-70\"/>\n        <source>Total debit</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Total credit</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Transaction fee</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+16\"/>\n        <source>Net amount</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <location line=\"+11\"/>\n        <source>Message</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-9\"/>\n        <source>Comment</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Transaction ID</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Transaction total size</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Output index</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+18\"/>\n        <source>Merchant</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>Debug information</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>Transaction</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Inputs</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+20\"/>\n        <source>Amount</source>\n        <translation type=\"unfinished\">Amount</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <location line=\"+1\"/>\n        <source>true</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-1\"/>\n        <location line=\"+1\"/>\n        <source>false</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <location filename=\"../forms/transactiondescdialog.ui\" line=\"+20\"/>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>This pane shows a detailed description of the transaction</translation>\n    </message>\n    <message>\n        <location filename=\"../transactiondescdialog.cpp\" line=\"+17\"/>\n        <source>Details for %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <location filename=\"../transactiontablemodel.cpp\" line=\"+248\"/>\n        <source>Date</source>\n        <translation type=\"unfinished\">Date</translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Type</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>Label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message numerus=\"yes\">\n        <location line=\"+58\"/>\n        <source>Open for %n more block(s)</source>\n        <translation>\n            <numerusform>Open for %n more block</numerusform>\n            <numerusform>Open for %n more blocks</numerusform>\n        </translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Open until %1</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Offline</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Unconfirmed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Abandoned</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Conflicted</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Generated but not accepted</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+39\"/>\n        <source>Received with</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Received from</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Sent to</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Payment to yourself</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Mined</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+28\"/>\n        <source>watch-only</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+15\"/>\n        <source>(n/a)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+213\"/>\n        <source>(no label)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+39\"/>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Date and time that the transaction was received.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Type of transaction.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Amount removed from or added to balance.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <location filename=\"../transactionview.cpp\" line=\"+70\"/>\n        <location line=\"+16\"/>\n        <source>All</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-15\"/>\n        <source>Today</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>This week</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>This month</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Last month</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>This year</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Range...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+11\"/>\n        <source>Received with</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Sent to</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>To yourself</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Mined</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Other</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Min amount</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+48\"/>\n        <source>Abandon transaction</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Increase transaction fee</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Copy address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy amount</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy transaction ID</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy raw transaction</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copy full transaction details</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Edit label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Show transaction details</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+194\"/>\n        <source>Export Transaction History</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Comma separated file (*.csv)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Confirmed</source>\n        <translation type=\"unfinished\">Confirmed</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Watch-only</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Date</source>\n        <translation type=\"unfinished\">Date</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Type</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Label</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Address</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>ID</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Exporting Failed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Exporting Successful</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+166\"/>\n        <source>Range:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>to</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <location filename=\"../bitcoingui.cpp\" line=\"+129\"/>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <location filename=\"../walletframe.cpp\" line=\"+28\"/>\n        <source>No wallet has been loaded.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <location filename=\"../walletmodel.cpp\" line=\"+290\"/>\n        <source>Send Coins</source>\n        <translation type=\"unfinished\">Send Coins</translation>\n    </message>\n    <message>\n        <location line=\"+384\"/>\n        <location line=\"+39\"/>\n        <location line=\"+6\"/>\n        <source>Fee bump error</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-45\"/>\n        <source>Increasing transaction fee failed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Do you want to increase the fee?</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Current fee:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Increase:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>New fee:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Confirm fee bump</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+17\"/>\n        <source>Can&apos;t sign transaction.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Could not commit transaction</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <location filename=\"../walletview.cpp\" line=\"+46\"/>\n        <source>&amp;Export</source>\n        <translation type=\"unfinished\">&amp;Export</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Export the data in the current tab to a file</source>\n        <translation type=\"unfinished\">Export the data in the current tab to a file</translation>\n    </message>\n    <message>\n        <location line=\"+201\"/>\n        <source>Backup Wallet</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Wallet Data (*.dat)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Backup Failed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Backup Successful</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+0\"/>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <location filename=\"../bitcoinstrings.cpp\" line=\"+349\"/>\n        <source>Options:</source>\n        <translation>Options:</translation>\n    </message>\n    <message>\n        <location line=\"+33\"/>\n        <source>Specify data directory</source>\n        <translation>Specify data directory</translation>\n    </message>\n    <message>\n        <location line=\"-99\"/>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Connect to a node to retrieve peer addresses, and disconnect</translation>\n    </message>\n    <message>\n        <location line=\"+102\"/>\n        <source>Specify your own public address</source>\n        <translation>Specify your own public address</translation>\n    </message>\n    <message>\n        <location line=\"-116\"/>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Accept command line and JSON-RPC commands</translation>\n    </message>\n    <message>\n        <location line=\"-207\"/>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+44\"/>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+36\"/>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+18\"/>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+149\"/>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+41\"/>\n        <source>Pruning blockstore...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+11\"/>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Run in the background as a daemon and accept commands</translation>\n    </message>\n    <message>\n        <location line=\"+40\"/>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-395\"/>\n        <source>Bitcoin Core</source>\n        <translation type=\"unfinished\">Bitcoin Core</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>The %s developers</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Bind to given address and always listen on it. Use [host]:port notation for IPv6</translation>\n    </message>\n    <message>\n        <location line=\"+12\"/>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+18\"/>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+20\"/>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Please check that your computer&apos;s date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+12\"/>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer&apos;s date and time being set incorrectly. Only rebuild the block database if you are sure that your computer&apos;s date and time are correct</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+12\"/>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+15\"/>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+11\"/>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>%s corrupt, salvage failed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>&lt;category&gt; can be:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Append comment to the user agent string</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Block creation options:</source>\n        <translation>Block creation options:</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Cannot resolve -%s address: &apos;%s&apos;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Chain selection options:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Change index out of range</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Connection options:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Copyright (C) %i-%i</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Corrupted block database detected</source>\n        <translation>Corrupted block database detected</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Debugging/Testing options:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Do you want to rebuild the block database now?</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Error creating %s: You can&apos;t create non-HD wallets with this version.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Error initializing block database</source>\n        <translation>Error initializing block database</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error initializing wallet database environment %s!</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Error loading %s</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Error loading block database</source>\n        <translation>Error loading block database</translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Error opening block database</source>\n        <translation>Error opening block database</translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Error: Disk space is low!</source>\n        <translation>Error: Disk space is low!</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Failed to listen on any port. Use -listen=0 if you want this.</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Importing...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Incorrect or no genesis block found. Wrong datadir for network?</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Invalid amount for -%s=&lt;amount&gt;: &apos;%s&apos;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: &apos;%s&apos;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: &apos;%s&apos;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Loading P2P addresses...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Loading banlist...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Not enough file descriptors available.</source>\n        <translation>Not enough file descriptors available.</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Print this help message and exit</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Print version and exit</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Replaying blocks...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Rewinding blocks...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Specify wallet file (within data directory)</translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>The source code is available from %s.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+11\"/>\n        <source>Transaction fee and change calculation failed</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Upgrading UTXO database</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Use the test chain</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Verifying blocks...</source>\n        <translation>Verifying blocks...</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Wallet debugging/testing options:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Wallet options:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-395\"/>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+17\"/>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+18\"/>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</translation>\n    </message>\n    <message>\n        <location line=\"+12\"/>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: &apos;%s&apos; (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+24\"/>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+42\"/>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+64\"/>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>(default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+20\"/>\n        <source>Error loading %s: You can&apos;t disable HD on an already existing HD wallet</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Error reading from database, shutting down.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Error upgrading chainstate database</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Invalid -onion address or hostname: &apos;%s&apos;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Invalid -proxy address or hostname: &apos;%s&apos;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos; (must be at least %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Invalid netmask specified in -whitelist: &apos;%s&apos;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Need to specify a port with -whitebind: &apos;%s&apos;</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Node relay options:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+11\"/>\n        <source>RPC server options:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Send trace/debug info to console instead of debug.log file</translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Shrink debug.log file on client startup (default: 1 when no -debug)</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Signing transaction failed</source>\n        <translation>Signing transaction failed</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Specified -walletdir &quot;%s&quot; does not exist</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Specified -walletdir &quot;%s&quot; is a relative path</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Specified -walletdir &quot;%s&quot; is not a directory</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>This is experimental software.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Tor control port password (default: empty)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Transaction amount too small</source>\n        <translation>Transaction amount too small</translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Transaction too large for fee policy</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Transaction too large</source>\n        <translation>Transaction too large</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Unable to generate initial keys</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Username for JSON-RPC connections</translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Verifying wallet(s)...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Warning</source>\n        <translation>Warning</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Zapping all transactions from wallet...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>ZeroMQ notification options:</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"-80\"/>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Password for JSON-RPC connections</translation>\n    </message>\n    <message>\n        <location line=\"-261\"/>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation>\n    </message>\n    <message>\n        <location line=\"+183\"/>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Allow DNS lookups for -addnode, -seednode and -connect</translation>\n    </message>\n    <message>\n        <location line=\"-258\"/>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+22\"/>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+26\"/>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Error loading %s: You can&apos;t enable HD on an already existing non-HD wallet</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+27\"/>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+15\"/>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+37\"/>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+13\"/>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn&apos;t possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+5\"/>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+15\"/>\n        <source>Warning: Unknown block versions being mined! It&apos;s possible unknown rules are in effect</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+11\"/>\n        <source>%s is set very high!</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>(default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+8\"/>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+31\"/>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+14\"/>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+6\"/>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Make the wallet broadcast transactions</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+10\"/>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+9\"/>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Specify configuration file (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Specify pid file (default: %s)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Starting network threads...</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+3\"/>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+4\"/>\n        <source>Transaction amounts must not be negative</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+2\"/>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Transaction must have at least one recipient</source>\n        <translation type=\"unfinished\"></translation>\n    </message>\n    <message>\n        <location line=\"+7\"/>\n        <source>Unknown network specified in -onlynet: &apos;%s&apos;</source>\n        <translation>Unknown network specified in -onlynet: &apos;%s&apos;</translation>\n    </message>\n    <message>\n        <location line=\"-85\"/>\n        <source>Insufficient funds</source>\n        <translation>Insufficient funds</translation>\n    </message>\n    <message>\n        <location line=\"+15\"/>\n        <source>Loading block index...</source>\n        <translation>Loading block index...</translation>\n    </message>\n    <message>\n        <location line=\"+1\"/>\n        <source>Loading wallet...</source>\n        <translation>Loading wallet...</translation>\n    </message>\n    <message>\n        <location line=\"-61\"/>\n        <source>Cannot downgrade wallet</source>\n        <translation>Cannot downgrade wallet</translation>\n    </message>\n    <message>\n        <location line=\"+87\"/>\n        <source>Rescanning...</source>\n        <translation>Rescanning...</translation>\n    </message>\n    <message>\n        <location line=\"-75\"/>\n        <source>Done loading</source>\n        <translation>Done loading</translation>\n    </message>\n    <message>\n        <location line=\"+20\"/>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>\n"
  },
  {
    "path": "src/qt/locale/bitcoin_en_AU.ts",
    "content": "<TS language=\"en_AU\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Passphrase Dialogue</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronising with network...</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>Start minimized</source>\n        <translation>Start minimised</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronising with the bitcoin network, as detailed below.</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimise instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Show only a tray icon after minimising the window.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimise to the tray instead of the taskbar</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimise on close</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>The displayed information may be out of date. Your wallet automatically synchronises with the Bitcoin network after a connection is established, but this process has not completed yet.</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Payment request is not initialised.</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Smart fee not initialised yet. This usually takes a few blocks...)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error initialising block database</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error initialising wallet database environment %s!</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Failed to rescan the wallet during initialisation</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Initialisation sanity check failed. %s is shutting down.</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Randomise credentials for every proxy connection. This enables Tor stream isolation (default: %u)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Sets the serialisation of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</translation>\n    </message>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_en_GB.ts",
    "content": "<TS language=\"en_GB\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Right-click to edit address or label</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Create a new address</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;New</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copy the currently selected address to the system clipboard</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copy</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;lose</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Delete the currently selected address from the list</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Export the data in the current tab to a file</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Export</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Delete</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Choose the address to send coins to</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Choose the address to receive coins with</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>C&amp;hoose</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Sending addresses</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Receiving addresses</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copy Address</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copy &amp;Label</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Edit</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Export Address List</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exporting Failed</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>There was an error trying to save the address list to %1. Please try again.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Address</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(no label)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Passphrase Dialog</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Enter passphrase</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>New passphrase</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repeat new passphrase</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Show password</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Encrypt wallet</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>This operation needs your wallet passphrase to unlock the wallet.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Unlock wallet</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>This operation needs your wallet passphrase to decrypt the wallet.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Decrypt wallet</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Change passphrase</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Enter the old passphrase and new passphrase to the wallet.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirm wallet encryption</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Are you sure you wish to encrypt your wallet?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Wallet encrypted</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Wallet encryption failed</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>The supplied passphrases do not match.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Wallet unlock failed</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>The passphrase entered for the wallet decryption was incorrect.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Wallet decryption failed</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Wallet passphrase was successfully changed.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Warning: The Caps Lock key is on!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Banned Until</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Sign &amp;message...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronising with network...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Overview</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Show general overview of wallet</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transactions</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Browse transaction history</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>E&amp;xit</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Quit application</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;About %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Show information about %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>About &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Show information about Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Options...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modify configuration options for %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Encrypt Wallet...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Backup Wallet...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Change Passphrase...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Sending addresses...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Receiving addresses...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Open &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Click to disable network activity.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Network activity disabled.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Click to enable network activity again.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Syncing Headers (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexing blocks on disk...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Send coins to a Bitcoin address</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Backup wallet to another location</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Change the passphrase used for wallet encryption</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Debug window</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Open debugging and diagnostic console</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verify message...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Wallet</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Send</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Receive</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Show / Hide</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Show or hide the main Window</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Encrypt the private keys that belong to your wallet</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Sign messages with your Bitcoin addresses to prove you own them</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verify messages to ensure they were signed with specified Bitcoin addresses</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;File</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Settings</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Help</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Tabs toolbar</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Request payments (generates QR codes and bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Show the list of used sending addresses and labels</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Show the list of used receiving addresses and labels</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Open a bitcoin: URI or payment request</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Command-line options</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n active connection to Bitcoin network</numerusform><numerusform>%n active connections to Bitcoin network</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indexing blocks on disk...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Processing blocks on disk...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Processed %n block of transaction history.</numerusform><numerusform>Processed %n blocks of transaction history.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 behind</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Last received block was generated %1 ago.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transactions after this will not yet be visible.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Warning</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Up to date</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Show the %1 help message to get a list with possible Bitcoin command-line options</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 client</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Connecting to peers...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Catching up...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Date: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Amount: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Type: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Label: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Address: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Sent transaction</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Incoming transaction</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Coin Selection</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantity:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Amount:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Fee:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Dust:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>After Fee:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Change:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(un)select all</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Tree mode</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>List mode</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Amount</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Received with label</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Received with address</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmations</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmed</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copy address</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copy label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copy amount</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copy transaction ID</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Lock unspent</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Unlock unspent</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copy quantity</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copy fee</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copy after fee</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copy bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copy dust</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copy change</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 locked)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>yes</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>This label turns red if any recipient receives an amount smaller than the current dust threshold.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Can vary +/- %1 satoshi(s) per input.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(no label)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>change from %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(change)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Edit Address</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Label</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>The label associated with this address list entry</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>The address associated with this address list entry. This can only be modified for sending addresses.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Address</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>New receiving address</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>New sending address</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Edit receiving address</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Edit sending address</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>The entered address \"%1\" is not a valid Bitcoin address.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>The entered address \"%1\" is already in the address book.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Could not unlock wallet.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>New key generation failed.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>A new data directory will be created.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>name</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Directory already exists. Add %1 if you intend to create a new directory here.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Path already exists, and is not a directory.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Cannot create data directory here.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>version</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>About %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Command-line options</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Usage:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>command-line options</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>UI Options:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Choose data directory on startup (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Set language, for example \"de_DE\" (default: system locale)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Start minimised</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Set SSL root certificates for payment request (default: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Show splash screen on startup (default: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Reset all settings changed in the GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Welcome</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Welcome to %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>As this is the first time the program is launched, you can choose where %1 will store its data.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Use the default data directory</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Use a custom data directory:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>At least %1 GB of data will be stored in this directory, and it will grow over time.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Approximately %1 GB of data will be stored in this directory.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 will download and store a copy of the Bitcoin block chain.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>The wallet will also be stored in this directory.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Error: Specified data directory \"%1\" cannot be created.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB of free space available</numerusform><numerusform>%n GB of free space available</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(of %n GB needed)</numerusform><numerusform>(of %n GB needed)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronising with the Bitcoin network, as detailed below.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Attempting to spend Bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Number of blocks left</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Unknown...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Last block time</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progress</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Progress increase per hour</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>calculating...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Estimated time left until synced</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Hide</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Unknown. Syncing Headers (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Open URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Open payment request from URI or file</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Select payment request file</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Select payment request file to open</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Options</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Main</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Automatically start %1 after logging in to the system.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Start %1 on system login</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Size of &amp;database cache</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Number of script &amp;verification threads</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Hide the icon from the system tray.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Hide tray icon</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimise instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Active command-line options that override above options:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Open the %1 configuration file from the working directory.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Open Configuration File</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Reset all client options to default.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Reset Options</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Network</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = leave that many cores free)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>W&amp;allet</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Enable coin &amp;control features</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Spend unconfirmed change</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Map port using &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Accept connections from outside.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Allow incomin&amp;g connections</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Connect to the Bitcoin network through a SOCKS5 proxy.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Connect through SOCKS5 proxy (default proxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port of the proxy (e.g. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Used for reaching peers via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Window</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Show on a tray icon after minimising the window.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimise to the tray instead of the task bar</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimise on close</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Display</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>User Interface &amp;language:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>The user interface language can be set here. This setting will take effect after restarting %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unit to show amounts in:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Choose the default subdivision unit to show in the interface and when sending coins.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Whether to show coin control features or not.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;Third party transaction URLs</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancel</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>default</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>none</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirm options reset</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Client restart required to activate changes.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Client will be shut down. Do you want to proceed?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Configuration options</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>The configuration file could not be opened.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>This change would require a client restart.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>The supplied proxy address is invalid.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>The displayed information may be out of date. Your Wallet automatically synchronises with the Bitcoin Network after a connection is established, but this process has not been completed yet.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Watch-only:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Available:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Your current spendable balance</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pending:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Immature:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Mined balance that has not yet matured</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Balances</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Your current total balance</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Your current balance in watch-only addresses</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Spendable:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Recent transactions</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Unconfirmed transactions to watch-only addresses</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Mined balance in watch-only addresses that has not yet matured</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Current total balance in watch-only addresses</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Payment request error</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Cannot start Bitcoin: click-to-pay handler</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI handling</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Payment request fetch URL is invalid: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Invalid payment address %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Payment request file handling</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Payment request file cannot be read! This can be caused by an invalid payment request file.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Payment request rejected.</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Payment request network doesn't match client network.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Payment request expired.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Payment request is not initialised.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Unverified payment requests to custom payment scripts are unsupported.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Invalid payment request.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Requested payment amount of %1 is too small (considered dust).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Refund from %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Error communicating with %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Payment request cannot be parsed!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Bad response from server %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Network request error</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Payment acknowledged</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Node/Service</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>NodeId</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Sent</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Received</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Amount</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Enter a Bitcoin address (e.g. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>None</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n second</numerusform><numerusform>%n seconds</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minute</numerusform><numerusform>%n minutes</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n hour</numerusform><numerusform>%n hours</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n day</numerusform><numerusform>%n days</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n week</numerusform><numerusform>%n weeks</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 and %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n year</numerusform><numerusform>%n years</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 didn't yet exit safely...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>unknown</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Error: Specified data directory \"%1\" does not exist.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Error: Cannot parse configuration file: %1. Only use key=value syntax.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Error: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Save Image...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copy Image</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Save QR Code</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG Image (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Client version</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Information</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Debug window</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Using BerkeleyDB version</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Startup time</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Network</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Name</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Number of connections</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Block chain</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Current number of blocks</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Memory Pool</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Current number of transactions</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Memory usage</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Reset</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Received</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Sent</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Peers</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Banned peers</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Select a peer to view detailed information.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Whitelisted</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direction</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Version</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Starting Block</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Synced Headers</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Synced Blocks</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Decrease font size</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Increase font size</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Services</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Ban Score</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Connection Time</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Last Send</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Last Receive</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping Time</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>The duration of a currently outstanding ping.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping Wait</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Min Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Time Offset</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Last block time</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Open</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Console</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Network Traffic</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totals</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>In:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Out:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Debug log file</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Clear console</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hour</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;day</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;week</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;year</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Disconnect</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Ban for</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Unban</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Welcome to the %1 RPC console.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Use up and down arrows to navigate history, and %1 to clear screen.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Type %1 for an overview of available commands.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>For more information on using this console type %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>WARNING: Scammers have been active, telling users to type commands here and stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Network activity disabled</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(node id: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>never</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Inbound</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Outbound</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Yes</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>No</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Unknown</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Amount:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Message:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>An optional label to associate with the new receiving address.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>An optional amount to request. Leave this empty or zero to not request a specific amount.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Clear all fields of the form.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Clear</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Requested payments history</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Request payment</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Show the selected request (does the same as double clicking an entry)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Show</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Remove the selected entries from the list</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Remove</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copy URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copy label</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copy message</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copy amount</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Code</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copy &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copy &amp;Address</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Save Image...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Request payment to %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Payment information</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Address</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Amount</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Message</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Resulting URI too long, try to reduce the text for label / message.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Error encoding URI into QR Code.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Message</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(no label)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(no message)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(no amount requested)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Requested</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Send Coins</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Coin Control Features</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Inputs...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automatically selected</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Insufficient funds!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantity:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Amount:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Fee:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>After Fee:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Change:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Custom change address</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transaction Fee:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Choose...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Using the fallback fee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Warning: Fee estimation is currently not possible.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>collapse fee-settings</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Hide</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(read the tooltip)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recommended:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Custom:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Smart fee not initialised yet. This usually takes a few blocks...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Send to multiple recipients at once</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Add &amp;Recipient</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Clear all fields of the form.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Dust:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Confirmation time target:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Enable Replace-By-Fee</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Clear &amp;All</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balance:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirm the send action</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>S&amp;end</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copy quantity</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copy amount</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copy fee</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copy after fee</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copy bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copy dust</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copy change</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blocks)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 to %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Are you sure you want to send?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>added as transaction fee</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Total Amount %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>or</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>You can increase the fee later (signals Replace-By-Fee, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Not signalling Replace-By-Fee, BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirm send coins</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>The recipient address is not valid. Please recheck.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>The amount to pay must be larger than 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>The amount exceeds your balance.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>The total exceeds your balance when the %1 transaction fee is included.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Duplicate address found: addresses should only be used once each.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Transaction creation failed!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>The transaction was rejected with the following reason: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>A fee higher than %1 is considered an absurdly high fee.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Payment request expired.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Pay only the required fee of %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Estimated to begin confirmation within %n block.</numerusform><numerusform>Estimated to begin confirmation within %n blocks.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Warning: Invalid Bitcoin address</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Warning: Unknown change address</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Confirm custom change address</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(no label)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>A&amp;mount:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Pay &amp;To:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Choose previously used address</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>This is a normal payment.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>The Bitcoin address to send the payment to</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Paste address from clipboard</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Remove this entry</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>S&amp;ubtract fee from amount</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Use available balance</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Message:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>This is an unauthenticated payment request.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>This is an authenticated payment request.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Enter a label for this address to add it to the list of used addresses</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pay To:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Enter a label for this address to add it to your address book</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Yes</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 is shutting down...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Do not shut down the computer until this window disappears.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signatures - Sign / Verify a Message</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Sign Message</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>The Bitcoin address to sign the message with</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Choose previously used address</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Paste address from clipboard</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Enter the message you want to sign here</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signature</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copy the current signature to the system clipboard</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Sign the message to prove you own this Bitcoin address</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Sign &amp;Message</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Reset all sign message fields</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Clear &amp;All</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verify Message</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>The Bitcoin address the message was signed with</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verify the message to ensure it was signed with the specified Bitcoin address</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verify &amp;Message</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Reset all verify message fields</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Click \"Sign Message\" to generate signature</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>The entered address is invalid.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Please check the address and try again.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>The entered address does not refer to a key.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Wallet unlock was cancelled.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Private key for the entered address is not available.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Message signing failed.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Message signed.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>The signature could not be decoded.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Please check the signature and try again.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>The signature did not match the message digest.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Message verification failed.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Message verified.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Open for %n more block</numerusform><numerusform>Open for %n more blocks</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Open until %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>conflicted with a transaction with %1 confirmations</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/unconfirmed, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>in memory pool</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>not in memory pool</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandoned</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/unconfirmed</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 confirmations</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, has not been successfully broadcast yet</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, broadcast through %n node</numerusform><numerusform>, broadcast through %n nodes</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Source</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generated</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>From</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>unknown</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>To</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>own address</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>watch-only</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>label</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Credit</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>matures in %n more block</numerusform><numerusform>matures in %n more blocks</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>not accepted</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debit</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Total debit</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Total credit</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transaction fee</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Net amount</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Message</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comment</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transaction ID</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Transaction total size</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Output index</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Merchant</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Debug information</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transaction</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Inputs</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Amount</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>true</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>false</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>This pane shows a detailed description of the transaction</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Details for %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Open for %n more block</numerusform><numerusform>Open for %n more blocks</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Open until %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Unconfirmed</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandoned</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirming (%1 of %2 recommended confirmations)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmed (%1 confirmations)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Conflicted</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Immature (%1 confirmations, will be available after %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>This block was not received by any other nodes and will probably not be accepted!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generated but not accepted</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Received with</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Received from</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Sent to</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Payment to yourself</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Mined</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>watch-only</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(no label)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Transaction status. Hover over this field to show number of confirmations.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Date and time that the transaction was received.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Type of transaction.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Whether or not a watch-only address is involved in this transaction.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>User-defined intent/purpose of the transaction.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Amount removed from or added to balance.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>All</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Today</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>This week</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>This month</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Last month</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>This year</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Range...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Received with</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Sent to</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>To yourself</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Mined</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Other</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Enter address, transaction id or label to search.</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Min amount</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Abandon transaction</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Increase transaction fee</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copy address</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copy label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copy amount</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copy transaction ID</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copy raw transaction</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copy full transaction details</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Edit label</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Show transaction details</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Export Transaction History</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmed</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Watch-only</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Address</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exporting Failed</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>There was an error trying to save the transaction history to %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exporting Successful</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>The transaction history was successfully saved to %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Range:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>to</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unit to show amounts in. Click to select another unit.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>No wallet has been loaded.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Send Coins</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Fee bump error</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Increasing transaction fee failed.</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Do you want to increase the fee?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Current fee:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Increase:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>New fee:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Confirm fee bump</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Can't sign transaction.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Could not commit transaction.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Export</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Export the data in the current tab to a file</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Backup Wallet</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Wallet Data (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Backup Failed</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>There was an error trying to save the wallet data to %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Backup Successful</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>The wallet data was successfully saved to %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Options:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Specify data directory</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Connect to a node to retrieve peer addresses, and disconnect</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Specify your own public address</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Accept command line and JSON-RPC commands</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distributed under the MIT software license, see the accompanying file %s or %s.</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Prune configured below the minimum of %d MiB.  Please use a higher number.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Error: A fatal internal error occurred, see debug.log for details</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Fee (in %s/kB) to add to transactions you send (default: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Pruning blockstore...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Run in the background as a daemon and accept commands</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Unable to start HTTP server. See debug log for details.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>The %s developers</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info).</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Bind to given address and always listen on it. Use [host]:port notation for IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Cannot obtain a lock on data directory %s. %s is probably already running.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Cannot provide specific connections and have addrman find outgoing connections at the same.</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode).</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Extra transactions to keep in memory for compact block reconstructions (default: %u).</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s).</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Please contribute if you find %s useful. Visit %s for further information about the software.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used).</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Set lowest fee rate (in %s/kB) for transactions to be included in block creation (default: %s).</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>This is the transaction fee you may discard if change is smaller than dust at this level.</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Unable to rewind the database to a pre-fork state. You will need to re-download the blockchain</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times.</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Wallet will not create transactions that violate mempool chain limits (default: %u).</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Whether to save the mempool on shutdown and load on restart (default: %u).</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d of last 100 blocks have unexpected version.</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s corrupt, salvage failed</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool must be at least %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; can be:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Accept connections from outside (default: 1 if no -proxy or -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Append comment to the user agent string</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Attempt to recover private keys from a corrupt wallet on startup</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Block creation options:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Cannot resolve -%s address: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Chain selection options:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Change index out of range</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Connection options:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Corrupted block database detected</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Debugging/Testing options:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Do not load the wallet and disable wallet RPC calls</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Do you want to rebuild the block database now?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Enable publish hash block in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Enable publish hash transaction in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Enable publish raw block in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Enable publish raw transaction in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Enable transaction replacement in the memory pool (default: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Error creating %s: You can't create non-HD wallets with this version.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error initialising block database</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error initialising wallet database environment %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Error loading %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Error loading %s: Wallet corrupted</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Error loading %s: Wallet requires newer version of %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Error loading block database</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Error opening block database</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Error: Disk space is low!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Failed to listen on any port. Use -listen=0 if you want this.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Failed to rescan the wallet during initialisation.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importing...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Incorrect or no genesis block found. Wrong datadir for network?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Initialisation sanity check failed. %s is shutting down.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Invalid amount for -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Loading P2P addresses...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Loading banlist...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Location of the auth cookie (default: data dir)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Not enough file descriptors available.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Print this help message and exit</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Print version and exit</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Prune cannot be configured with a negative value.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Prune mode is incompatible with -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Rebuild chain state and block index from the blk*.dat files on disk</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Rebuild chain state from the currently indexed blocks</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Replaying blocks...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Rewinding blocks...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>Send transactions with full-RBF opt-in enabled (RPC only, default: %u).</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Set database cache size in megabytes (%d to %d, default: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Specify wallet file (within data directory)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>The source code is available from %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Transaction fee and change calculation failed.</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Unable to bind to %s on this computer. %s is probably already running.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Unsupported argument -benchmark ignored, use -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Unsupported argument -debugnet ignored, use -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Unsupported argument -tor found, use -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Unsupported logging category %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Upgrading UTXO database</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Use UPnP to map the listening port (default: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Use the test chain</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>User Agent comment (%s) contains unsafe characters.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verifying blocks...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Wallet debugging/testing options:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Wallet needed to be rewritten: restart %s to complete</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Wallet options:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Error: Listening for incoming connections failed (listen returned error %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maximum size of data in data carrier transactions we relay and mine (default: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Randomise credentials for every proxy connection. This enables Tor stream isolation (default: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>The transaction amount is too small to send after the fee has been deducted</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(default: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Accept public REST requests (default: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Automatically create Tor hidden service (default: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Connect through SOCKS5 proxy</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Error loading %s: you can't disable HD on an already existing HD wallet.</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Error reading from database, shutting down.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Error upgrading chainstate database.</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Imports blocks from external blk000??.dat file on startup</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Invalid -onion address or hostname: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Invalid -proxy address or hostname: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Invalid netmask specified in -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Need to specify a port with -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Node relay options:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC server options:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reducing -maxconnections from %d to %d, because of system limitations.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Rescan the block chain for missing wallet transactions on startup</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Send trace/debug info to console instead of debug.log file</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Show all debugging options (usage: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Shrink debug.log file on client startup (default: 1 when no -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Signing transaction failed</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>Specified -walletdir \"%s\" does not exist.</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>Specified -walletdir \"%s\" is a relative path.</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>Specified -walletdir \"%s\" is not a directory.</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>The transaction amount is too small to pay the fee</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>This is experimental software.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Tor control port password (default: empty)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Tor control port to use if onion listening enabled (default: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transaction amount too small</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transaction too large for fee policy</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transaction too large</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Unable to bind to %s on this computer (bind returned error %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Unable to generate initial keys.</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Upgrade wallet to latest format on startup</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Username for JSON-RPC connections</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Verifying wallet(s)...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Wallet %s resides outside wallet directory %s</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Warning</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Warning: unknown new rules activated (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Whether to operate in a blocks only mode (default: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>You need to rebuild the database using -reindex to change -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Zapping all transactions from wallet...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ notification options:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Password for JSON-RPC connections</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Allow DNS lookups for -addnode, -seednode and -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses).</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Error loading %s: you can't enable HD on an already existing non-HD wallet.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Error loading wallet %s. The -wallet parameter must only specify a filename (not a path).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Force relay of transactions from whitelisted peers, even if they violate local relay policy (default: %d).</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>How thorough the block verification of -checkblocks is (0-4, default: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Sets the serialisation of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d).</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;).</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s).</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Support filtering of blocks and transaction with bloom filters (default: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>This is the transaction fee you may pay when fee estimates are not available.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s is set very high!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(default: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Always query for peer addresses via DNS lookup (default: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Error loading wallet %s. The -wallet filename must be a regular file.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Error loading wallet %s. Duplicate -wallet filename specified.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Error loading wallet %s. Invalid characters in -wallet filename.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>How many blocks to check at startup (default: %u, 0 = all)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Include IP addresses in debug output (default: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Keypool ran out, please call keypoolrefill first.</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Maintain at most &lt;n&gt; connections to peers (default: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Make the wallet broadcast transactions</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Prepend debug output with timestamp (default: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Relay and mine data carrier transactions (default: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Relay non-P2SH multisig (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Set key pool size to &lt;n&gt; (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Set maximum BIP141 block weight (default: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Set the number of threads to service RPC calls (default: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Specify configuration file (default: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Specify connection timeout in milliseconds (minimum: 1, default: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Specify pid file (default: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Spend unconfirmed change when sending transactions (default: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Starting network threads...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>The wallet will avoid paying less than the minimum relay fee.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>This is the minimum transaction fee you pay on every transaction.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>This is the transaction fee you will pay if you send a transaction.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Threshold for disconnecting misbehaving peers (default: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Transaction amounts must not be negative.</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Transaction has too long of a mempool chain.</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Transaction must have at least one recipient.</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Unknown network specified in -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Insufficient funds</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Loading block index...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Loading wallet...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Cannot downgrade wallet</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Rescanning...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Done loading</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_eo.ts",
    "content": "<TS language=\"eo\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Dekstre-klaku por redakti adreson aŭ etikedon</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Krei novan adreson</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nova</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopii elektitan adreson al la tondejo</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopii</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Fermi</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Forigi la elektitan adreson el la listo</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksporti la datumojn el la aktuala langeto al dosiero</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksporti</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Forigi</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Elekti la adreson por sendi monerojn</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Elekti la adreson ricevi monerojn kun</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Elekti</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Sendaj adresoj</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Ricevaj adresoj</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Jen viaj Bitmon-adresoj por sendi pagojn. Zorge kontrolu la sumon kaj la alsendan adreson antaŭ ol sendi.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Jen viaj bitmonaj adresoj por ricevi pagojn. Estas konsilinde uzi apartan ricevan adreson por ĉiu transakcio.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopii Adreson</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopii &amp;Etikedon</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Redakti</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Eksporti Adresliston</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Perkome disigita dosiero (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>ekspotado malsukcesinta</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Okazis eraron dum konservo de adreslisto al %1. Bonvolu provi denove.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etikedo</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreso</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(neniu etikedo)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialogo pri pasfrazo</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Enigu pasfrazon</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nova pasfrazo</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ripetu la novan pasfrazon</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Enigu novan pasfrazon por la monujo.&lt;br/&gt;Bonvolu uzi pasfrazon kun &lt;b&gt;almenaŭ 10 hazardaj signoj&lt;/b&gt;, aŭ &lt;b&gt;almenaŭ ok aŭ pli vortoj&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Ĉifri la monujon</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Ĉi tiu operacio bezonas vian monujan pasfrazon, por malŝlosi la monujon.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Malŝlosi la monujon</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Ĉi tiu operacio bezonas vian monujan pasfrazon, por malĉifri la monujon.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Malĉifri la monujon</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Ŝanĝi la pasfrazon</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Tajpu la malnovan pasvorton kaj la novan pasvorton por la monujo.</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Atentu! Se vi ĉifras vian monujon kaj perdas la pasfrazon, vi &lt;b&gt;PERDOS LA TUTON DE VIA BITMONO&lt;b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Ĉu vi certas, ke vi volas ĉifri la monujon?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>La monujo estas ĉifrita</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 nun fermiĝos por fini la ĉifradon. Memoru, ke eĉ ĉifrado ne protektas kontraŭ ĉiu atako, ekz. se viruso infektus vian komputilon.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>GRAVE: antaŭaj sekur-kopioj de via monujo-dosiero estas forigindaj kiam vi havas nove kreitan ĉifritan monujo-dosieron. Pro sekureco, antaŭaj kopioj de la neĉifrita dosiero ne plu funkcios tuj kiam vi ekuzos la novan ĉifritan dosieron.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Ĉifrado de la monujo fiaskis</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Subskribi &amp;mesaĝon...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sinkronigante kun reto...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Superrigardo</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nodo</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Vidigi ĝeneralan superrigardon de la monujo</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakcioj</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Esplori historion de transakcioj</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Eliri</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Eliri la aplikaĵon</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Pri &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Vidigi informojn pri Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Agordoj...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Ĉifri &amp;Monujon...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Krei sekurkopion de la monujo...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Ŝanĝi &amp;Pasfrazon...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Sendaj adresoj...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Ricevaj adresoj...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Malfermi &amp;URI-on...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindeksado de blokoj sur disko...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Sendi monon al Bitmon-adreso</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Krei alilokan sekurkopion de monujo</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Ŝanĝi la pasfrazon por ĉifri la monujon</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Sen&amp;cimiga fenestro</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Malfermi konzolon de sencimigo kaj diagnozo</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Kontroli mesaĝon...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitmono</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Monujo</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Sendi</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Ricevi</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Montri / Kaŝi</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Montri aŭ kaŝi la ĉefan fenestron</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Ĉifri la privatajn ŝlosilojn de via monujo</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Subskribi mesaĝojn per via Bitmon-adresoj por pravigi, ke vi estas la posedanto</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Kontroli mesaĝojn por kontroli ĉu ili estas subskribitaj per specifaj Bitmon-adresoj</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Dosiero</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Agordoj</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Helpo</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Langeto-breto</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Peti pagon (kreas QR-kodojn kaj URI-ojn kun prefikso bitcoin:)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Vidigi la liston de uzitaj sendaj adresoj kaj etikedoj</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Vidigi la liston de uzitaj ricevaj adresoj kaj etikedoj</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Malfermi bitcoin:-URI-on aŭ pagpeton</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Komandliniaj agordaĵoj</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>mankas %1</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Lasta ricevita bloko kreiĝis antaŭ %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transakcioj por tio ankoraŭ ne videblas.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eraro</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Averto</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informoj</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Ĝisdata</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Ĝisdatigante...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Dato: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Sumo: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipo: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etikedo: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adreso: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Sendita transakcio</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Envenanta transakcio</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Monujo estas &lt;b&gt;ĉifrita&lt;/b&gt; kaj aktuale &lt;b&gt;malŝlosita&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Monujo estas &lt;b&gt;ĉifrita&lt;/b&gt; kaj aktuale &lt;b&gt;ŝlosita&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kvanto:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtoj:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Sumo:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Krompago:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Post krompago:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Restmono:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(mal)elekti ĉion</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Arboreĝimo</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Listreĝimo</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Sumo</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Ricevita kun etikedo</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Ricevita kun adreso</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Konfirmoj</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Konfirmita</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(neniu etikedo)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Redakti Adreson</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etikedo</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>La etikedo ligita al tiu ĉi adreslistero</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>La adreso ligita al tiu ĉi adreslistero. Eblas modifi tion nur por sendaj adresoj.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adreso</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Kreiĝos nova dosierujo por la datumoj.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nomo</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Tiu dosierujo jam ekzistas. Aldonu %1 si vi volas krei novan dosierujon ĉi tie.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Vojo jam ekzistas, kaj ne estas dosierujo.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Ne eblas krei dosierujon por datumoj ĉi tie.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versio</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Komandliniaj agordaĵoj</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uzado:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>komandliniaj agordaĵoj</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Uzantinterfaco ebloj:</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bonvenon</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Uzi la defaŭltan dosierujon por datumoj</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Uzi alian dosierujon por datumoj:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitmono</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eraro</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n gigabajto de libera loko disponeble</numerusform><numerusform>%n gigabajtoj de libera loko disponebla.</numerusform></translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formularo</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Horo de la lasta bloko</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Malfermi URI-on</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Malfermi pagpeton el URI aŭ dosiero</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Elektu la dosieron de la pagpeto</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Agordaĵoj</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>Ĉ&amp;efa</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Dosiergrando de &amp;datumbasa kaŝmemoro</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Reagordi ĉion al defaŭlataj valoroj.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Rekomenci agordadon</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Reto</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Monujo</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Fakulo</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Aŭtomate malfermi la kursilan pordon por Bitmono. Tio funkcias nur se via kursilo havas la UPnP-funkcion, kaj se tiu ĉi estas ŝaltita.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapigi pordon per &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Prokurila &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Pordo:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>la pordo de la prokurilo (ekz. 9050)</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Fenestro</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Montri nur sistempletan piktogramon post minimumigo de la fenestro.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimumigi al la sistempleto anstataŭ al la taskopleto</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimumigi je fermo</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Aspekto</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Lingvo de la fasado:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unuo por vidigi sumojn:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Elekti la defaŭltan manieron por montri bitmonajn sumojn en la interfaco, kaj kiam vi sendos bitmonon.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Ĉu montri detalan adres-regilon, aŭ ne.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Bone</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Nuligi</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>defaŭlta</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>neniu</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Konfirmi reŝargo de agordoj</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eraro</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>La prokurila adreso estas malvalida.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formularo</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Eblas, ke la informoj videblaj ĉi tie estas eksdataj. Via monujo aŭtomate sinkoniĝas kun la bitmona reto kiam ili konektiĝas, sed tiu procezo ankoraŭ ne finfariĝis.</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>via aktuala elspezebla saldo</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>la sumo de transakcioj ankoraŭ ne konfirmitaj, kiuj ankoraŭ ne elspezeblas</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Nematura:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Minita saldo, kiu ankoraŭ ne maturiĝis</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldoj</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Totalo:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>via aktuala totala saldo</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Elspezebla:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Lastaj transakcioj</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Uzanto Agento</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Sendita</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Ricevita</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Sumo</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Neniu</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>neaplikebla</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 kaj %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nekonata</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Konservi Bildon...</translation>\n    </message>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>neaplikebla</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versio de kliento</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informoj</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Sencimiga fenestro</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Ĝenerala</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Horo de lanĉo</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Reto</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nomo</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Nombro de konektoj</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blokĉeno</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Aktuala nombro de blokoj</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Ricevita</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Sendita</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Samuloj</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Malpermesita samuloj.</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versio</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Uzanto Agento</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Servoj</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Horo de la lasta bloko</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Malfermi</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konzolo</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Reta Trafiko</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totaloj</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>En:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>El:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Sencimiga protokoldosiero</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Malplenigi konzolon</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Kvanto:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etikedo:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Mesaĝo:</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Malplenigi ĉiujn kampojn de la formularo.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Forigi</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Peti pagon</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Vidigi</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Forigi</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopii etikedon</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopiu mesaĝon</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopii sumon</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-kodo</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopii &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopii &amp;Adreson</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Konservi Bildon...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Peti pagon al %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Paginformoj</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreso</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Sumo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikedo</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaĝo</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>La rezultanta URI estas tro longa. Provu malplilongigi la tekston de la etikedo / mesaĝo.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Eraro de kodigo de URI en la QR-kodon.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikedo</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaĝo</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(neniu etikedo)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(neniu mesaĝo)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Sendi Bitmonon</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Monregaj Opcioj</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Enigoj...</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Nesufiĉa mono!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kvanto:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtoj:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Sumo:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Krompago:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Post krompago:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Restmono:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Krompago:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Sendi samtempe al pluraj ricevantoj</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Aldoni &amp;Ricevonton</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Malplenigi ĉiujn kampojn de la formularo.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Forigi Ĉion</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Konfirmi la sendon</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>Ŝendi</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopii kvanton</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopii sumon</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopii krompagon</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopii post krompago</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopii bajtojn</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopii polvon</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopii restmonon</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 al %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Ĉu vi certas, ke vi volas sendi?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>aldonita kiel krompago</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Totala sumo %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>aŭ</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Konfirmi sendon de bitmono</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>La pagenda sumo devas esti pli ol 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>La sumo estas pli granda ol via saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>La sumo kun la %1 krompago estas pli granda ol via saldo.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Kreo de transakcio fiaskis!</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Averto: Nevalida Bitmon-adreso</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(neniu etikedo)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Sumo:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Ricevonto:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etikedo:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Elektu la jam uzitan adreson</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Tio estas normala pago.</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Alglui adreson de tondejo</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Forigu ĉi tiun enskribon</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mesaĝo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Tajpu etikedon por tiu ĉi adreso por aldoni ĝin al la listo de uzitaj adresoj</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pagi Al:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memorando:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Tajpu etikedon por tiu ĉi adreso kaj aldonu ĝin al via adresaro</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Ne sistemfermu ĝis ĉi tiu fenestro malaperas.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Subskriboj - Subskribi / Kontroli mesaĝon</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Subskribi Mesaĝon</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Elektu la jam uzitan adreson</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Alglui adreson de tondejo</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Tajpu la mesaĝon, kiun vi volas sendi, cîi tie</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Subskribo</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopii la aktualan subskribon al la tondejo</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Subskribi la mesaĝon por pravigi, ke vi estas la posedanto de tiu Bitmon-adreso</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Subskribi &amp;Mesaĝon</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Reagordigi ĉiujn prisubskribajn kampojn</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Forigi Ĉion</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Kontroli Mesaĝon</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Kontroli la mesaĝon por pravigi, ke ĝi ja estas subskribita per la specifa Bitmon-adreso</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Kontroli &amp;Mesaĝon</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Reagordigi ĉiujn prikontrolajn kampojn</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Klaku \"Subskribi Mesaĝon\" por krei subskribon</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>La adreso, kiun vi enmetis, estas nevalida.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Bonvolu kontroli la adreson kaj reprovi.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>La adreso, kiun vi enmetis, referencas neniun ŝlosilon.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Malŝloso de monujo estas nuligita.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>La privata ŝlosilo por la enigita adreso ne disponeblas.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Subskribo de mesaĝo fiaskis.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Mesaĝo estas subskribita.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Ne eblis malĉifri la subskribon.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Bonvolu kontroli la subskribon kaj reprovu.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>La subskribo ne kongruis kun la mesaĝ-kompilaĵo.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Kontrolo de mesaĝo malsukcesis.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Mesaĝo sukcese kontrolita.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Malferma ĝis %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/senkonekte</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/nekonfirmite</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 konfirmoj</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Stato</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, ankoraŭ ne elsendita sukcese</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Fonto</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Kreita</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>De</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nekonata</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Al</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>propra adreso</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etikedo</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Kredito</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>ne akceptita</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debeto</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Krompago</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Neta sumo</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaĝo</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Komento</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transakcia ID</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Vendisto</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Kreitaj moneroj devas esti maturaj je %1 blokoj antaŭ ol eblas elspezi ilin. Kiam vi generis tiun ĉi blokon, ĝi estis elsendita al la reto por aldono al la blokĉeno. Se tiu aldono malsukcesas, ĝia stato ŝanĝiĝos al \"neakceptita\" kaj ne eblos elspezi ĝin. Tio estas malofta, sed povas okazi se alia bloko estas kreita je preskaŭ la sama momento kiel la via.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Sencimigaj informoj</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transakcio</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Enigoj</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Sumo</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>vera</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>malvera</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Tiu ĉi panelo montras detalan priskribon de la transakcio</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikedo</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Malferma ĝis %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Senkonekte</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Nekonfirmita</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Konfirmita (%1 konfirmoj)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Tiun ĉi blokon ne ricevis ajna alia nodo, kaj ĝi verŝajne ne akceptiĝos!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Kreita sed ne akceptita</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Ricevita kun</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Ricevita de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Sendita al</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pago al vi mem</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minita</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>neaplikebla</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(neniu etikedo)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Transakcia stato. Ŝvebi super tiu ĉi kampo por montri la nombron de konfirmoj.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Dato kaj horo kiam la transakcio alvenis.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipo de transakcio.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Sumo elprenita de aŭ aldonita al la saldo.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Ĉiuj</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Hodiaŭ</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Ĉi-semajne</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Ĉi-monate</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Pasintmonate</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Ĉi-jare</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Intervalo...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Ricevita kun</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Sendita al</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Al vi mem</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minita</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Aliaj</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minimuma sumo</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopii adreson</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopii etikedon</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopii sumon</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopii transakcian ID-on</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Redakti etikedon</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Montri detalojn de transakcio</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Perkome disigita dosiero (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Konfirmita</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikedo</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adreso</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>ekspotado malsukcesinta</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Intervalo:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>al</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Sendi Bitmonon</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksporti</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksporti la datumojn el la aktuala langeto al dosiero</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Krei sekurkopion de monujo</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Monuj-datumoj (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Malsukcesis sekurkopio</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Sukcesis krei sekurkopion</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Agordoj:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Specifi dosieron por datumoj</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Konekti al nodo por ricevi adresojn de samtavolanoj, kaj malkonekti</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Specifi vian propran publikan adreson</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Akcepti komandojn JSON-RPC kaj el komandlinio</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Ruli fone kiel demono kaj akcepti komandojn</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Kerno de Bitmono</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Bindi al donita adreso kaj ĉiam aŭskulti per ĝi. Uzu la formaton [gastigo]:pordo por IPv6</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Plenumi komandon kiam monuja transakcio ŝanĝiĝas (%s en cmd anstataŭiĝas per TxID)</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Tiu ĉi estas antaŭeldona testa versio - uzu laŭ via propra risko - ne uzu por minado aŭ por aplikaĵoj por vendistoj</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Averto: La reto ne tute konsentas! Kelkaj minantoj ŝajne spertas problemojn aktuale.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Averto: ŝajne ni ne tute konsentas kun niaj samtavolanoj! Eble vi devas ĝisdatigi vian klienton, aŭ eble aliaj nodoj faru same.</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; povas esti:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Akcepti konektojn el ekstere (defaŭlte: 1 se ne estas -proxy nek -connect)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Blok-kreaj agordaĵoj:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Difektita blokdatumbazo trovita</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Ĉu vi volas rekonstrui la blokdatumbazon nun?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Eraro dum pravalorizado de blokdatumbazo</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Eraro dum pravalorizado de monuj-datumbaza ĉirkaŭaĵo %s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Eraro dum ŝargado de blokdatumbazo</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Eraro dum malfermado de blokdatumbazo</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Eraro: restas malmulte da diskospaco!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Ne sukcesis aŭskulti ajnan pordon. Uzu -listen=0 se tion vi volas.</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Geneza bloko aŭ netrovita aŭ neĝusta. Ĉu eble la datadir de la reto malĝustas?</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Nesufiĉa nombro de dosierpriskribiloj disponeblas.</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Specifi monujan dosieron (ene de dosierujo por datumoj)</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Kontrolado de blokoj...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Monujaj opcioj:</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Plenumi komandon kiam rilata alerto riceviĝas, aŭ kiam ni vidas tre longan forkon (%s en cms anstataŭiĝas per mesaĝo)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informoj</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Sendi spurajn/sencimigajn informojn al la konzolo anstataŭ al dosiero debug.log</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Malpligrandigi la sencimigan protokol-dosieron kiam kliento lanĉiĝas (defaŭlte: 1 kiam mankas -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Subskriba transakcio fiaskis</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>ĝi estas eksperimenta programo</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transakcia sumo tro malgranda</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transakcio estas tro granda</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Salutnomo por konektoj JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Averto</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Vi devas rekontrui la datumbazon kun -reindex por ŝanĝi -txindex</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Pasvorto por konektoj JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Plenumi komandon kiam plej bona bloko ŝanĝiĝas (%s en cmd anstataŭiĝas per bloka haketaĵo)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permesi DNS-elserĉojn por -addnote, -seednote kaj -connect</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Nekonata reto specifita en -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Nesufiĉa mono</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Ŝarĝante blok-indekson...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Ŝargado de monujo...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Ne eblas malpromocii monujon</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Reskanado...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Ŝargado finiĝis</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eraro</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_es.ts",
    "content": "<TS language=\"es\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Haz clic derecho para editar la dirección o etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crear una nueva dirección</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuevo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiar la dirección seleccionada al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;errar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Eliminar la dirección seleccionada de la lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar los datos en la ficha actual a un archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Eliminar</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Seleccione la dirección a la que enviar monedas</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Seleccione la dirección de la que recibir monedas</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>E&amp;scoger</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Direcciones de envío</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Direcciones de recepción</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estas son sus direcciones Bitcoin para enviar pagos. Verifique siempre la cantidad y la dirección de recepción antes de enviar bitcoins.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Estas son sus direcciones Bitcoin para recibir pagos. Se recomienda utilizar una nueva dirección de recepción para cada transacción</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copiar Dirección</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copiar &amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Editar</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportar lista de direcciones</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Archivo separado de coma (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Falló la exportación</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Había un error intentando guardar la lista de direcciones en %1. Por favor inténtelo de nuevo.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diálogo de contraseña</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Introducir contraseña</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repita la nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Mostrar contraseña</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Introduzca la nueva contraseña del monedero. &lt;br/&gt;Por favor utilice una contraseña de &lt;b&gt;diez o más carácteres aleatorios&lt;/b&gt;, o &lt;b&gt;ocho o más palabras&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Cifrar monedero</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Esta operación necesita su contraseña de monedero para desbloquear el monedero.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloquear monedero</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Esta operación necesita su contraseña para descifrar el monedero.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Descifrar monedero</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Cambiar contraseña</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Introduzca la contraseña antigua y la nueva para el monedero.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirmar cifrado del monedero</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Advertencia: Si cifra su monedero y pierde su contraseña&lt;b&gt;¡PERDERÁ TODOS SUS BITCOINS!&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>¿Seguro que desea cifrar su monedero?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Monedero cifrado</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 se cerrará ahora para terminar el proceso de cifrado. Recuerde que cifrar su monedero no puede proteger completamente su monedero de ser robado por malware que infecte su ordenador.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANTE: Cualquier copia de seguridad anterior que haya hecho en su archivo de monedero debería ser reemplazada con el archivo de monedero cifrado generado recientemente. Por razones de seguridad, las copias de seguridad anteriores del archivo de monedero descifrado serán inútiles en cuanto empiece a utilizar el nuevo monedero cifrado.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Fracasó el cifrado del monedero</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Falló el cifrado del monedero debido a un error interno. Su monedero no fue cifrado.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>La contraseña introducida no coincide.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Fracasó el desbloqueo del monedero</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La contraseña introducida para el cifrado del monedero es incorrecta.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Fracasó el cifrado del monedero</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>La contraseña del monedero se ha cambiado con éxito.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Alerta: ¡La clave de bloqueo Caps está activa!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Máscara</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Bloqueado Hasta</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Firmar &amp;mensaje...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizando con la red…</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Vista general</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nodo</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostrar vista general del monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transacciones</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Examinar el historial de transacciones</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>S&amp;alir</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Salir de la aplicación</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Acerca de %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Mostrar información acerca de %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Acerca de &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostrar información acerca de Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opciones...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modificar las opciones de configuración para %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Cifrar monedero…</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Guardar copia del monedero...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Cambiar la contraseña…</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Direcciones de &amp;envío...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Direcciones de &amp;recepción...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Abrir &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Pulsar para deshabilitar la actividad de red.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Actividad de red deshabilitada.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Pulsar para volver a habilitar la actividad de red.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Sincronizando cabeceras (%1%)</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexando bloques en disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviar bitcoins a una dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Copia de seguridad del monedero en otra ubicación</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambiar la contraseña utilizada para el cifrado del monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Ventana de depuración</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Abrir la consola de depuración y diagnóstico</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verificar mensaje...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Recibir</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mostrar / Ocultar</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostrar u ocultar la ventana principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Cifrar las claves privadas de su monedero</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Firmar mensajes con sus direcciones Bitcoin para demostrar la propiedad</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verificar mensajes comprobando que están firmados con direcciones Bitcoin concretas</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuración</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ayuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra de pestañas</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Solicitar pagos (generando códigos QR e identificadores URI \"bitcoin:\")</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostrar la lista de direcciones de envío y etiquetas</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Muestra la lista de direcciones de recepción y etiquetas</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Abrir un identificador URI \"bitcoin:\" o una petición de pago</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Opciones de consola de comandos</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n conexión activa hacia la red Bitcoin</numerusform><numerusform>%n conexiones activas hacia la red Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indexando bloques en disco...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Procesando bloques en disco...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n bloque procesado del historial de transacciones.</numerusform><numerusform>%n bloques procesados del historial de transacciones.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 atrás</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>El último bloque recibido fue generado hace %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Las transacciones posteriores aún no están visibles.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Aviso</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Actualizado</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Mostrar el mensaje de ayuda %1 para obtener una lista de los posibles comandos de linea de comandos de Bitcoin</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 cliente</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Conectando a pares...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Actualizando...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Fecha: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Amount: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipo: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etiqueta: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Dirección: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transacción enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacción entrante</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>La generación de clave HD está &lt;b&gt;habilitada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>La generación de clave HD está &lt;b&gt;deshabilitada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;desbloqueado&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;bloqueado&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Ha ocurrido un error fatal. Bitcoin no puede seguir seguro y se cerrará.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selección de la moneda</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cuantía:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Tasa:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de aplicar la comisión:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(des)marcar todos</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modo árbol</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modo lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Recibido con etiqueta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Recibido con dirección</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmaciones</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar ubicación</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID de transacción</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Bloquear lo no gastado</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Desbloquear lo no gastado</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar comisión</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar después de couta</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar polvo</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar cambio</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 bloqueado)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>sí</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Esta etiqueta se vuelve roja si algún destinatario recibe una cantidad inferior a la actual puerta polvorienta.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Puede variar +/- %1 satoshi(s) por entrada.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>cambia desde %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(cambio)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editar Dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>La etiqueta asociada con esta entrada de la lista de direcciones</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>La dirección asociada con esta entrada de la lista de direcciones. Solo puede ser modificada para direcciones de envío.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Dirección</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nueva dirección de recivimiento</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nueva dirección de envío</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Editar dirección de recivimiento</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Editar dirección de envío</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>La dirección introducida \"%1\" no es una dirección Bitcoin válida.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>La dirección introducida \"%1\" está ya en la agenda.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Podría no desbloquear el monedero.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Falló la generación de la nueva clave.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Se creará un nuevo directorio de datos.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nombre</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>El directorio ya existe. Añada %1 si pretende crear un directorio nuevo.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>La ruta ya existe y no es un directorio.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>No se puede crear un directorio de datos aquí.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versión</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Acerda de %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opciones de la línea de órdenes</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uso:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opciones de la consola de comandos</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opciones de interfaz de usuario:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Elegir directorio de datos al iniciar (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Establecer el idioma, por ejemplo, \"es_ES\" (predeterminado: configuración regional del sistema)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Arrancar minimizado</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Establecer los certificados raíz SSL para solicitudes de pago (predeterminado: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Mostrar pantalla de bienvenida en el inicio (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Reiniciar todos los ajustes modificados en el GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bienvenido</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Bienvenido a %1</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Al ser la primera vez que se ejecuta el programa, puede elegir donde %1 almacenará sus datos.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Cuando haga click en OK, %1 se empezará a descargar la %4 cadena de bloques completa (%2GB) empezando por la transacción más antigua en %3 cuando se publicó %4 originalmente.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>La sincronización inicial demanda muchos recursos y podría revelar problemas de hardware que no se han notado previamente. Cada vez que ejecuta %1, continuará descargando a partir del punto anterior.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Si ha elegido limitar el almacenamiento de la cadena de bloques (\"prunning\"), se descargarán y procesarán los datos históricos igualmente, sin embargo, estos se eliminarán después para mantener un bajo uso del disco.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Utilizar el directorio de datos predeterminado</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Utilizar un directorio de datos personalizado:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Se almacenará cuanto menos %1 GB de datos en este directorio, y crecerá con el transcurso del tiempo.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Se almacenará aproximadamente %1 GB de datos en este directorio.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 descargará y almacenará una copia de la cadena de bloques de Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>El monedero se almacenará en este directorio.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Error: no ha podido crearse el directorio de datos especificado \"%1\".</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB de espacio libre</numerusform><numerusform>%n GB de espacio disponible</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(de %n GB necesitados)</numerusform><numerusform>(de %n GB requeridos)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Las transacciones recientes aún no pueden ser visibles, y por lo tanto el saldo de su monedero podría ser incorrecto. Esta información será correcta cuando su monedero haya terminado de sincronizarse con la red de bitcoin, como se detalla abajo.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>La red no aceptará el intentar gastar bitcoins que están afectados por transacciones aún no mostradas.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Número de bloques restantes</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Desconocido...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora del último bloque</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progreso</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Avance del progreso por hora</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>calculando...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Tiempo estimado restante hasta la sincronización</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ocultar</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Desconocido. Sincronizando cabeceras (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Abrir URI...</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Abrir solicitud de pago a partir de un identificador URI o de un archivo</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Seleccionar archivo de sulicitud de pago</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Seleccionar el archivo de solicitud de pago para abrir</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Iniciar automaticamente  %1 al encender el sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Iniciar %1 al iniciar el sistema</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Tamaño del cache de la &amp;base de datos</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Número de hilos de &amp;verificación de scripts</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Dirección IP del proxy (p. ej. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Muestra si el proxy SOCKS5 predeterminado se utiliza para conectarse a pares a través de este tipo de red.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Usar proxy SOCKS&amp;5 para alcanzar nodos via servicios ocultos Tor:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Ocultar ícono de la bandeja de sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Ocultar ícono de la barra de tareas</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimizar en lugar de salir de la aplicación cuando la ventana está cerrada. Cuando se activa esta opción, la aplicación sólo se cerrará después de seleccionar Salir en el menú.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Identificadores URL de terceros (por ejemplo, un explorador de bloques) que aparecen en la pestaña de transacciones como elementos del menú contextual. El %s en la URL es reemplazado por el valor hash de la transacción. Se pueden separar URL múltiples por una barra vertical |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Opciones activas de consola de comandos que tienen preferencia sobre las opciones anteriores:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Abre el fichero de configuración %1 en el directorio de trabajo.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Abrir fichero de configuración</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Restablecer todas las opciones predeterminadas del cliente.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Restablecer opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Red</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automático, &lt;0 = dejar libres ese número de núcleos)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Monedero</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Experto</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Habilitar funcionalidad de &amp;Coin Control</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Si desactiva el gasto del cambio no confirmado, no se podrá usar el cambio de una transacción hasta que se alcance al menos una confirmación. Esto afecta también a cómo se calcula su saldo.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Gastar cambio no confirmado</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Abrir automáticamente el puerto del cliente Bitcoin en el router. Esta opción solo funciona si el router admite UPnP y está activado.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapear el puerto mediante &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Aceptar conexiones externas.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Permitir conexiones entrantes</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Conectarse a la red Bitcoin a través de un proxy SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Conectarse a través de proxy SOCKS5 (proxy predeterminado):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Dirección &amp;IP del proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Puerto:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Puerto del servidor proxy (ej. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Usado para alcanzar compañeros via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Conectar a la red Bitcoin mediante un proxy SOCKS5 por separado para los servicios ocultos de Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Ventana</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Minimizar la ventana a la bandeja de iconos del sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimizar a la bandeja en vez de a la barra de tareas</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimizar al cerrar</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Interfaz</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>I&amp;dioma de la interfaz de usuario</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>El idioma de la interfaz de usuario puede establecerse aquí. Esta configuración tendrá efecto tras reiniciar %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unidad en la cual mostrar las cantidades:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Elegir la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envían bitcoins.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Mostrar o no funcionalidad de Coin Control</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>URLs de transacciones de terceros</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Aceptar</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancelar</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>predeterminado</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>Ninguna</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirme el restablecimiento de las opciones</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Se necesita reiniciar el cliente para activar los cambios.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>El cliente se cerrará. ¿Desea continuar?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opciones de configuración</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>El fichero de configuración se utiliza para especificar opciones de usuario avanzadas que reemplazar las configuraciones de la interfaz gráfica de usuario. Adicionalmente, se reemplazará cualquier opción introducida en la línea de órdenes.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>No se pudo abrir el fichero de configuración.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Este cambio exige el reinicio del cliente.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>La dirección proxy indicada es inválida.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>La información mostrada puede estar desactualizada. Su monedero se sincroniza automáticamente con la red Bitcoin después de que se haya establecido una conexión, pero este proceso aún no se ha completado.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>De observación:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponible:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Su saldo disponible actual</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pendiente:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transacciones pendientes de confirmar y que aún no contribuye al saldo disponible</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>No madurado:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Saldo recién minado que aún no ha madurado.</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldos</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Su saldo actual total</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Su saldo actual en direcciones watch-only</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Gastable:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transacciones recientes</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Transacciones sin confirmar en direcciones watch-only</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Saldo minado en direcciones watch-only que aún no ha madurado</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Saldo total en las direcciones watch-only</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Fallo en la solicitud de pago</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>No se puede iniciar bitcoin: encargado click-para-pagar</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Manejo de URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>La búsqueda de solicitud de pago URL es válida: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Dirección de pago inválida %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI no puede ser analizado! Esto puede ser causado por una dirección Bitcoin inválida o parametros URI mal formados.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Manejo del archivo de solicitud de pago</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>¡El archivo de solicitud de pago no puede ser leído! Esto puede ser causado por un archivo de solicitud de pago inválido.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Solicitud de pago rechazada</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>La red de solicitud de pago no cimbina la red cliente.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Solicitud de pago caducada.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>La solicitud de pago no se ha iniciado.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Solicitudes de pago sin verificar a scripts de pago habitual no se soportan.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Solicitud de pago inválida.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Cantidad de pago solicitada de %1 es demasiado pequeña (considerado polvo).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Reembolsar desde %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Solicitud de pago de %1 es demasiado grande (%2 bytes, permitidos %3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Fallo al comunicar con %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>¡La solicitud de pago no puede ser analizada!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Mala respuesta desde el servidor %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Fallo de solicitud de red</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Pago declarado</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nodo/Servicio</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>ID de nodo</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Sonido</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recibido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Introducir una dirección Bitcoin (p. ej. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Ninguno</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n segundo</numerusform><numerusform>%n segundos</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minuto</numerusform><numerusform>%n minutos</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n dia</numerusform><numerusform>%n dias</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n semana</numerusform><numerusform>%n semanas</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 y %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n año</numerusform><numerusform>%n años</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 no se ha cerrado de forma segura todavía...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Error: El directorio de datos «%1» especificado no existe.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Error: No se puede analizar el archivo de configuración: %1. Utilice únicamente la sintaxis clave=valor.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Error: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Guardar imagen...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copiar imagen</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Guardar código QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imagen PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versión del cliente</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Información</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Ventana de depuración</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Utilizando la versión de BerkeleyDB</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Hora de inicio</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Red</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nombre</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Número de conexiones</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Cadena de bloques</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Número actual de bloques</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Piscina de Memoria</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Número actual de transacciones</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Uso de memoria</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Reiniciar</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recibido</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Pares</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Peers Bloqueados</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Seleccionar un par para ver su información detallada.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>En la lista blanca</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versión</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Importando bloques...</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Sincronizar Cabeceras</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Bloques Sincronizados</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Abrir el archivo de depuración %1 desde el directorio de datos actual. Puede tardar unos segundos para ficheros de gran tamaño.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Disminuir tamaño de letra</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Aumentar tamaño de letra</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Servicios</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Puntuación de bloqueo</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Duración de la conexión</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Ultimo envío</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Ultima recepción</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>La duración de un ping actualmente en proceso.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Espera de Ping</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Sonido Mínimo</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Desplazamiento de tiempo</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora del último bloque</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Abrir</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Tráfico de Red</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Entrante:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Saliente:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Archivo de registro de depuración</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Borrar consola</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hora</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;día</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;semana</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;año</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Desconectar</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Prohibir para</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Unbano</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Bienvenido a la consola RPC %1.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Utilice las teclas de navegación para revisar el historial, y %1 para limpiar la pantalla.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Presione %1 para una vista previa de los comandos disponibles.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Para mas información sobre el uso de este tipo de consola %1</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>ADVERTENCIA: Los estafadores están solicitando a los usuarios introducir ordenes aquí, lo que ocasiona que estos roben los contenidos del monedero. No utilice esta consola sin comprender completamente las implicancias de cada orden.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Actividad de red deshabilitada</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(nodo: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nunca</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Entrante</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Saliente</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Sí</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>No</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Mensaje:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Un mensaje opcional para adjuntar a la solicitud de pago, que se muestra cuando se abre la solicitud. Nota: El mensaje no se enviará con el pago por la red Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Etiqueta opcional para asociar con la nueva dirección de recepción.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Utilice este formulario para solicitar pagos. Todos los campos son &lt;b&gt;opcionales&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Para solicitar una cantidad opcional. Deje este vacío o cero para no solicitar una cantidad específica.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Vaciar todos los campos del formulario.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Vaciar</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historial de pagos solicitados</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Solicitar pago</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Muestra la petición seleccionada (También doble clic)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostrar</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Borrar de la lista las direcciónes actualmente seleccionadas</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Eliminar</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copiar URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar capa</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copiar imagen</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Código QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copiar &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copiar &amp;Dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Guardar Imagen...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Solicitar pago a %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Información de pago</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensaje</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI resultante demasiado grande, trate de reducir el texto de etiqueta / mensaje.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Fallo al codificar URI en código QR.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensaje</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(no hay mensaje)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(no hay solicitud de cantidad)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Solicitado</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar bitcoins</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Características de Coin Control</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Entradas...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>Seleccionado automáticamente</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fondos insuficientes!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cuantía:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Tasa:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de tasas:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Si se marca esta opción pero la dirección de cambio está vacía o es inválida, el cambio se enviará a una nueva dirección recién generada.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Dirección propia</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Comisión de Transacción:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Elija...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Si utilizas la comisión por defecto, la transacción puede tardar varias horas o incluso días (o nunca) en confirmarse. Considera elegir la comisión de forma manual o espera hasta que se haya validado completamente la cadena.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Advertencia: En este momento no se puede estimar la cuota.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>Colapsar ajustes de comisión.</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>por kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Si la comisión se establece en 1000 satoshis y la transacción está a sólo 250 bytes, entonces \"por kilobyte\" sólo paga 250 satoshis de cuota, mientras que \"el mínimo total\" pagaría 1.000 satoshis. Para las transacciones más grandes que un kilobyte ambos pagan por kilobyte</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ocultar</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Pagar solamente la comisión mínima es correcto, siempre y cuando haya menos volumen de transacciones que el espacio en los bloques. Pero tenga en cuenta que esto puede terminar en una transacción nunca confirmada, una vez que haya más demanda para transacciones Bitcoin que la red pueda procesar.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(leer la sugerencia)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recomendada:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Personalizada:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Aún no se ha inicializado la Comisión Inteligente. Esto generalmente tarda pocos bloques...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Enviar a múltiples destinatarios de una vez</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Añadir &amp;destinatario</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Vaciar todos los campos del formulario</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Objetivo de tiempo de confirmación</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Habilitar Replace-By-Fee</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Con Replace-By-Fee (BIP-125) puede incrementar la comisión después de haber enviado la transacción. Si no utiliza esto, se recomienda que añada una comisión mayor para compensar el riesgo adicional de que la transacción se retrase.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Vaciar &amp;todo</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirmar el envío</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar comisión</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar después de couta</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar polvo</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar cambio</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 bloques)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 a %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>¿Seguro que quiere enviar?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>añadido como comisión de transacción</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Cantidad total %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>o</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Puede incrementar la comisión más tarde (usa Replace-By-Fee, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>No usa Replace-By-Fee, BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirmar enviar monedas</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>La dirección de destinatario no es válida. Por favor revísela.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>La cantidad a pagar debe de ser mayor que 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>La cantidad excede su saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>El total excede su saldo cuando la comisión de transacción de %1 es incluida.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Dirección duplicada encontrada: la dirección sólo debería ser utilizada una vez por cada uso.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>¡Falló la creación de transacción!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Se ha rechazado la transacción por la siguiente razón: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Una comisión mayor que %1 se considera una cuota irracionalmente alta.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Solicitud de pago caducada.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Pagar únicamente la comisión solicitada de %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Estimado para empezar la confirmación dentro de %n bloque.</numerusform><numerusform>Estimado para empezar la confirmación dentro de %n bloques.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Alerta: dirección Bitcoin inválida</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Alerta: dirección cambiada desconocida</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Confirmar dirección de cambio personalizada</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>La dirección que ha seleccionado para cambiar no es parte de este monedero. ninguno o todos los fondos de su monedero pueden ser enviados a esta dirección. ¿Está seguro?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Ca&amp;ntidad:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Pagar a:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escoger direcciones previamente usadas</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Esto es un pago ordinario.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Dirección Bitcoin a la que enviar el pago</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar dirección desde portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Eliminar esta transacción</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>La comisión será deducida de la cantidad que sea mandada. El destinatario recibirá menos bitcoins de la cantidad introducida en el campo Cantidad. Si hay varios destinatarios, la comisión será distribuida a partes iguales.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>Restar comisiones de la cantidad.</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Usar balance disponible</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mensaje:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Esta es una petición de pago no autentificada.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Esta es una petición de pago autentificada.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Introduce una etiqueta para esta dirección para añadirla a la lista de direcciones utilizadas</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Un mensaje que se adjuntó a la bitcoin: URL que será almacenada con la transacción para su referencia. Nota: Este mensaje no se envía a través de la red Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Paga a:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Introduzca una etiqueta para esta dirección para añadirla a su lista de direcciones.</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Sí</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 se esta cerrando...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>No apague el equipo hasta que desaparezca esta ventana.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Firmas - Firmar / verificar un mensaje</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Firmar mensaje</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Puede firmar los mensajes con sus direcciones para demostrar que las posee. Tenga cuidado de no firmar cualquier cosa de manera vaga o aleatoria, pues los ataques de phishing pueden tratar de engañarle firmando su identidad a través de ellos. Sólo firme declaraciones totalmente detalladas con las que usted esté de acuerdo.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Dirección Bitcoin con la que firmar el mensaje</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escoger dirección previamente usada</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar dirección desde portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Introduzca el mensaje que desea firmar aquí</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Firma</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copiar la firma actual al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Firmar el mensaje para demostrar que se posee esta dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Firmar &amp;mensaje</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Vaciar todos los campos de la firma de mensaje</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Vaciar &amp;todo</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verificar mensaje</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Introduzca la dirección para la firma, el mensaje (asegurándose de copiar tal cual los saltos de línea, espacios, tabulaciones, etc.) y la firma a continuación para verificar el mensaje. Tenga cuidado de no asumir más información de lo que dice el propio mensaje firmado para evitar fraudes basados en ataques de tipo man-in-the-middle. </translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>La dirección Bitcoin con la que se firmó el mensaje</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verificar el mensaje para comprobar que fue firmado con la dirección Bitcoin indicada</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verificar &amp;mensaje</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Vaciar todos los campos de la verificación de mensaje</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Click en \"Fírmar mensaje\" para generar una firma</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>La dirección introducida no es válida.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Por favor revise la dirección e inténtelo de nuevo.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>La dirección introducida no remite a una clave.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>El desbloqueo del monedero fue cancelado.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>La clave privada de la dirección introducida no está disponible.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Falló la firma del mensaje.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Mensaje firmado.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>La firma no pudo descodificarse.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Por favor compruebe la firma y pruebe de nuevo.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>La firma no se combinó con el mensaje.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Falló la verificación del mensaje.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Mensaje verificado.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Abrir para %n bloque más</numerusform><numerusform>Abrir para %n bloques más</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Abierto hasta %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>Hay un conflicto con la traducción de las confirmaciones %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/sin conexión</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/no confirmado, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>en el equipo de memoria</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>no en el equipo de memoria</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandonado</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/no confirmado</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>confirmaciones %1</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Estado</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, no ha sido emitido con éxito aún</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, transmitir a través de %n nodo</numerusform><numerusform>, transmitir a través de %n nodos</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Fuente</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generado</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Desde</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Para</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>dirección propia</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>de observación</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiqueta</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Credito</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>disponible en %n bloque más</numerusform><numerusform>disponible en %n bloques más</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>no aceptada</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Total enviado</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Total recibido</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Comisión de transacción</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Cantidad neta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensaje</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comentario</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Identificador de transacción (ID)</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Tamaño total de transacción</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Indice de salida</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Vendedor</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Los bitcoins generados deben madurar %1 bloques antes de que puedan gastarse. Cuando generó este bloque, se transmitió a la red para que se añadiera a la cadena de bloques. Si no consigue entrar en la cadena, su estado cambiará a \"no aceptado\" y ya no se podrá gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque a pocos segundos del suyo.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Información de depuración</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transacción</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>entradas</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>verdadero</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>falso</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Esta ventana muestra información detallada sobre la transacción</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detalles para %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Abrir para %n bloque más</numerusform><numerusform>Abrir para %n bloques más</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Abierto hasta %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Sin conexion</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Sin confirmar</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandonado</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirmando (%1 de %2 confirmaciones recomendadas)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmado (%1 confirmaciones)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>En conflicto</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>No disponible (%1 confirmaciones. Estarán disponibles al cabo de %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Este bloque no ha sido recibido por otros nodos y probablemente no sea aceptado!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generado pero no aceptado</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recibido con</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Recibidos de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviado a</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pago proprio</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minado</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>de observación</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(nd)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Estado de transacción. Pasa el ratón sobre este campo para ver el número de confirmaciones.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Fecha y hora en que se recibió la transacción.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipo de transacción.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Si una dirección watch-only está involucrada en esta transacción o no.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Descripción de la transacción definido por el usuario.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Cantidad retirada o añadida al saldo.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Todo</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Hoy</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Esta semana</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Este mes</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Mes pasado</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Este año</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Rango...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recibido con</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviado a</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>A usted mismo</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minado</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Otra</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Introduzca dirección, id de transacción o etiqueta a buscar</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Cantidad mínima</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Transacción abandonada</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Incrementar cuota de transacción</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar ubicación</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar capa</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID de transacción</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copiar transacción raw</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copiar todos los detalles de la transacción</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Editar etiqueta</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Mostrar detalles de la transacción</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exportar historial de transacciones</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Archivo separado de coma (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>De observación</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Falló la exportación</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Ha habido un error al intentar guardar la transacción con %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exportación finalizada</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>La transacción ha sido guardada en %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Rango:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>para</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unidad en la que se muestran las cantidades. Haga clic para seleccionar otra unidad.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>No se ha cargado ningún monedero</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Error de incremento de cuota</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Ha fallado el incremento de la cuota de transacción.</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>¿Desea incrementar la cuota?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Cuota actual:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Incremento:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nueva cuota:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Confirmar incremento de cuota.</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>No se ha podido firmar la transacción.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>No se pudo confirmar la transacción</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar a un archivo los datos de esta pestaña</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Copia de seguridad del monedero</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Datos de monedero (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>La copia de seguridad ha fallado</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Ha habido un error al intentar guardar los datos del monedero en %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Se ha completado con éxito la copia de respaldo</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Los datos del monedero se han guardado con éxito en %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opciones:\n</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especificar directorio para los datos</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Conectar a un nodo para obtener direcciones de pares y desconectar</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especifique su propia dirección pública</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Aceptar comandos consola y JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distribuido bajo la licencia de software MIT, vea el archivo adjunto %s o %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Si &lt;category&gt; no es proporcionado o si &lt;category&gt; =1, muestra toda la información de depuración.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>La Poda se ha configurado por debajo del minimo de %d MiB. Por favor utiliza un valor mas alto.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Poda: la ultima sincronizacion del monedero sobrepasa los datos podados. Necesitas reindexar con -reindex (o descargar la cadena de bloques de nuevo en el caso de un nodo podado)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Nos es posible re-escanear en modo podado.Necesitas utilizar -reindex el cual descargara la cadena de bloques al completo de nuevo.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Un error interno fatal ocurrió, ver debug.log para detalles</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Comisión (en %s/KB) para agregar a las transacciones que envíe (por defecto: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Poda blockstore ...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Ejecutar en segundo plano como daemon y aceptar comandos\n</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>No se ha podido comenzar el servidor HTTP. Ver debug log para detalles.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Los desarrolladores de %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Una comision (en %s/kB) que sera usada cuando las estimacion de comision no disponga de suficientes datos (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Aceptar transacciones retransmitidas recibidas desde nodos en la lista blanca incluso cuando no estés retransmitiendo transacciones (predeterminado: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Agregue un nodo para conectars e intentar mantener una conexión abierta (véase el comando de ayuda RPC \"addnode\" para mas información)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Vincular a la dirección dada y escuchar siempre en ella. Utilice la notación [host]:port para IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>No se puede bloquear el directorio %s. %s ya se está ejecutando.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>No es posible mostrar las conexiones indicadas y tener addrman buscando conexiones al mismo tiempo.</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Conectar solo al nodo(s) especificado(s); -connect=0 deshabilita conexiones automáticas (las reglas para este nodo son las mismas que para -addnode)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Borrar todas las transacciones del monedero y sólo recuperar aquellas partes de la cadena de bloques por medio de -rescan on startup.</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Error leyendo %s!. Todas las claves se han leido correctamente, pero los datos de transacciones o la libreta de direcciones pueden faltar o ser incorrectos.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Descartar información de depuración para una categoría. Puede utilizarse simultáneamente con -debug=1 para escribir información de depuración de todas las categorías a excepción de una o más categorías.  </translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Ejecutar comando cuando una transacción del monedero cambia (%s en cmd se remplazará por TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Transacciones extra a mantener en la memoria para reconstrucciones de bloque compacto (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Si este bloque está en la cadena asuma que sus predecesores y él son válidos y potencialmente se saltan su script de verificación (0 para verificar todo, predeterminado: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Ajuste máximo permitido del tiempo offset medio de pares. La perspectiva local de tiempo se verá influenciada por los pares anteriores y posteriores a esta cantidad. (Por defecto: %u segundos)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Máximas comisiones totales (en %s) para utilizar en una sola transacción del monedero; establecer esto demasiado bajo puede abortar grandes transacciones (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Por favor, compruebe si la fecha y hora en su computadora son correctas! Si su reloj esta mal, %s no trabajara correctamente. </translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Contribuya si encuentra %s de utilidad. Visite %s para mas información acerca del programa.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Consultar las direcciones de pares mediante búsqueda DNS, si existen pocas direcciones (por defecto: 1 excepto si se está usando -connect)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Reducir los requerimientos de almacenamiento habilitando la poda (eliminación) de los bloques viejos. Esto permite que la cadena de bloqueo RPC sea llamada para eliminar bloques específicos, y habilita la poda automática de bloques viejos si se provee el tamaño de un objetivo en MiB. Este modo es incompatible con -txindex and -rescan. Precaución: Revertir este ajuste requiere volver a descargar la cadena de bloqueo completa. (predefinido: 0 = deshabilita bloques de poda, 1 = permite la poda manual mediante RPC, &gt;%u = elimina automáticamente los archivos de bloqueo para permanecer bajo el tamaño del objetivo especificado en MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Establecer la tasa más baja (en %s/kB) por transacciones para incluirse en la creación de bloque. (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Establecer el número de hilos (threads) de verificación de scripts (entre %u y %d, 0 = automático, &lt;0 = dejar libres ese número de núcleos; predeterminado: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>La base de datos de bloques contiene un bloque que parece ser del futuro. Esto puede ser porque la fecha y hora de tu ordenador están mal ajustados. Reconstruye la base de datos de bloques solo si estas seguro de que la fecha y hora de tu ordenador estan ajustados correctamente.</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Esta es una versión de prueba prelanzada - utilícelo a su propio riesgo - no lo utilice para aplicaciones de minería o comerciales</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Esta es la comisión de transacción que puedes descartar si el cambio es menor que el polvo a este nivel</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>No se ha podido reproducir los bloques. Deberá reconstruir la base de datos utilizando -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>No es posible reconstruir la base de datos a un estado anterior. Debe descargar de nuevo la cadena de bloques.</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Utiliza UPnP para asignar el puerto de escucha (predeterminado: 1 cuando esta escuchando sin -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Nombre de usuario y contraseña numerada para conexiones JSON-RPC. El campo &lt;userpw&gt; viene en el formato: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Un script canónico de python está incluído en compartir/usuario rpc. Entonces el cliente se conecta normalmente utilizando la pareja de argumentos usuario rpc=&lt;USERNAME&gt;/contraseña rpc=&lt;PASSWORD&gt;. Esta opción puede ser especificada múltiples veces</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>El monedero no creará transacciones que violen los límites de la cadena mempool (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Advertencia: ¡La red no parece coincidir del todo! Algunos mineros parecen estar experimentando problemas.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Advertencia: ¡No parecemos estar del todo con nuestros pares! Puede que necesite actualizarse, o puede que otros nodos necesiten actualizarse.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Indica si guardar el mempool al cerrar y cargar al reiniciar (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d de los últimos 100 bloques tienen versión no esperada</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s corrupto. Fracasó la recuperacion</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool debe ser por lo menos de %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; puede ser:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Aceptar conexiones desde el exterior (predeterminado: 1 si no -proxy o -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Adjunta un comentario a la linea de agente de usuario</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Intento de recuperar claves privadas de un monedero corrupto en arranque</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opciones de creación de bloques:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>No se puede resolver -%s direccion: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Opciones de selección en cadena:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Cambio de indice fuera de rango</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opciones de conexión:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Corrupción de base de datos de bloques detectada.</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opciones de depuración/pruebas:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>No cargar el monedero y desactivar las llamadas RPC del monedero</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>¿Quieres reconstruir la base de datos de bloques ahora?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Activar publicar bloque .hash en &lt;.Address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Activar publicar transacción .hash en &lt;.Address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Habilita la publicacion de bloques en bruto en &lt;direccion&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Habilitar publicar transacción en rama en &lt;dirección&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Habilita el reemplazamiento de transacciones en la piscina de memoria (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Error generando %s: Con esta versin no puede crear monederos no-HD.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error al inicializar la base de datos de bloques</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error al inicializar el entorno de la base de datos del monedero  %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Error cargando %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Error cargando %s: Monedero dañado</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Error cargando %s: Monedero requiere un versión mas reciente de %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Error cargando base de datos de bloques</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Error al abrir base de datos de bloques.</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Error: ¡Espacio en disco bajo!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Ha fallado la escucha en todos los puertos. Use -listen=0 si desea esto.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Fallo al escanear el monedero durante la inicialización</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importando...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Incorrecto o bloque de génesis no encontrado. Datadir equivocada para la red?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>La inicialización de la verificación de validez falló. Se está apagando %s.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Cantidad no valida para -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Cantidad inválida para -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Cantidad inválida para -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Mantener la memoria de transacciones por debajo de &lt;n&gt; megabytes (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Cargando direcciones P2P ...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Cargando banlist...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Ubicación de la cookie de autenticación (default: data dir)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>No hay suficientes descriptores de archivo disponibles. </translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Sólo conectar a nodos en redes &lt;net&gt; (ipv4, ipv6 o onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Imprimir este mensaje de ayuda y salir</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Imprimir versión y salir</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Pode no se puede configurar con un valor negativo.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>El modo recorte es incompatible con -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Reconstruir el estado de la cadena e indice de bloques a partir de los ficheros blk*.dat en disco</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Reconstruir el estado de la cadena a partir de los bloques indexados</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Reproduciendo bloques ...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Verificando bloques...</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Asignar tamaño del cache en megabytes (entre %d y %d; predeterminado: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Especificar archivo de monedero (dentro del directorio de datos)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>El código fuente esta disponible desde %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>El cálculo de la comisión de transacción y del cambio han fallado</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>No se ha podido conectar con %s en este equipo. %s es posible que este todavia en ejecución.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>El argumento -benchmark no es soportado y ha sido ignorado, utiliza -debug=bench</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Parámetros no compatibles -debugnet ignorados , use -debug = red.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Parámetros no compatibles -tor encontrados, use -onion .</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Categoría de registro no soportada %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Actualizando la base de datos UTXO</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Usar UPnP para asignar el puerto de escucha (predeterminado:: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Utilice la cadena de prueba</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>El comentario del Agente de Usuario (%s) contiene caracteres inseguros.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verificando bloques...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Opciones de depuración/pruebas de monedero:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Es necesario reescribir el monedero: reiniciar %s para completar</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opciones de monedero:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Permitir conexiones JSON-RPC de origen especificado. Válido para son una sola IP (por ejemplo 1.2.3.4), una red/máscara de red (por ejemplo 1.2.3.4/255.255.255.0) o una red/CIDR (e.g. 1.2.3.4/24). Esta opción se puede especificar varias veces</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Ligar a las direcciones especificadas y poner en lista blanca a los equipos conectados a ellas. Usar la notación para IPv6 [host]:puerto.</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Crear nuevos archivos con permisos por defecto del sistema, en lugar de umask 077 (sólo efectivo con la funcionalidad de monedero desactivada)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Descubra direcciones IP propias (por defecto: 1 cuando se escucha y nadie -externalip o -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Error: la escucha para conexiones entrantes falló (la escucha regresó el error %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Ejecutar un comando cuando se reciba una alerta importante o cuando veamos un fork demasiado largo (%s en cmd se reemplazará por el mensaje)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Las comisiones (en %s/kB) mas pequeñas que esto se consideran como cero comisión para la retransmisión, minería y creación de la transacción (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Si el pago de comisión no está establecido, incluir la cuota suficiente para que las transacciones comiencen la confirmación en una media de n bloques ( por defecto :%u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Cantidad no válida para -maxtxfee=&lt;amount&gt;: '%s' (debe ser por lo menos la comisión mínima de %s para prevenir transacciones atascadas)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>El tamaño máximo de los datos en las operaciones de transporte de datos que transmitimos y el mio (default: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Aleatorizar las credenciales para cada conexión proxy. Esto habilita la Tor stream isolation (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Monto de transacción muy pequeña luego de la deducción por comisión</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>A los equipos en lista blanca no se les pueden prohibir los ataques DoS y sus transacciones siempre son retransmitidas, incluso si ya están en el mempool, es útil por ejemplo para un gateway.</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Necesitas reconstruir la base de datos utilizando -reindex para volver al modo sin recorte. Esto volverá a descargar toda la cadena de bloques</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Aceptar solicitudes públicas en FERIADOS (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Automáticamente crea el servicio Tor oculto (por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Conectar usando SOCKS5 proxy</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Error cargando %s: No puedes deshabilitar HD en un monedero HD ya existente</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Error al leer la base de datos, cerrando.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Error actualizando la base de datos chainstate</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importa los bloques desde un archivo externo blk000?.dat</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Dirección -onion o nombre de host inválido: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Dirección -proxy o nombre de host inválido: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Cantidad inválida para -paytxfee=&lt;amount&gt;: '%s' (debe ser por lo menos %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Máscara de red inválida especificada en -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Mantener como máximo &lt;n&gt; transacciones no conectables en memoria (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Necesita especificar un puerto con -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Opciones de nodos de retransmisión:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opciones de servidor RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reduciendo -maxconnections de %d a %d, debido a limitaciones del sistema.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Rescanea la cadena de bloques para buscar transacciones perdidas del monedero</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Muestra todas las opciones de depuración (uso: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Transacción falló</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>El -walletdir indicado \"%s\" no existe</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>Indique -walletdir \"%s\" como una ruta relativa</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>El -walletdir \"%s\" indicado no es un directorio</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Cantidad de la transacción demasiado pequeña para pagar la comisión</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Este software es experimental.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Contraseña del puerto de control de Tor (predeterminado: vacio)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Puerto de control de Tor a utilizar si la escucha de onion esta activada (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Cantidad de la transacción demasiado pequeña</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Operación demasiado grande para la política de tasas</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transacción demasiado grande, intenta dividirla en varias.</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>No es posible conectar con %s en este sistema (bind ha dado el error %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>No es posible generar llaves iniciales</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Actualizar el monedero al último formato al inicio</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nombre de usuario para las conexiones JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Verificando monedero(s)...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Monedero %s situado fuera del directorio de monedero %s</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Aviso</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Advertencia: nuevas reglas desconocidas activadas (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Si se debe o no operar en un modo de solo bloques (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Necesita reconstruir las bases de datos con la opción -reindex para modificar -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Eliminando todas las transacciones del monedero...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Opciones de notificación ZeroQM:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Contraseña para las conexiones JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Ejecutar un comando cuando cambia el mejor bloque (%s en cmd se sustituye por el hash de bloque)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permitir búsquedas DNS para -addnode, -seednode y -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = mantener los meta datos de transacción, por ejemplo: propietario e información de pago, 2 = omitir los metadatos)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee tiene un ajuste muy elevado! Comisiones muy grandes podrían ser pagadas en una única transaccion.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Vincular a la dirección dada para escuchar las conexiones JSON-RPC. Esta opción se ignora a menos que también se pase -rpcallowip. El puerto es opcional y reemplaza -rpcport. Utiliza la notación [host]:puerto para IPv6. Esta opción se puede especificar varias veces (por defecto: 127.0.0.1 y :: 1 es decir, localhost o si se ha especificado -rpcallowip, 0.0.0.0 y :: es decir, todas las direcciones)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>No mantener transacciones en la memoria mas de &lt;n&gt; horas (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Bytes equivalentes por sigop en transacciones para retrasmisión y minado (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Error cargando %s: No puedes habilitar HD en un monedero no HD ya existente</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Error cargando monedero %s. El parámetro -wallet solo debe indicar un nombre de fichero (no una ruta).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Las comisiones (en %s/kB) menores que esto son consideradas de cero comision para la creacion de transacciones (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Fuerza la retransmisión de transacciones desde nodos en la lista blanca incluso si violan la política de retransmisiones local (predeterminado: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Nivel de rigor en la verificación de bloques de -checkblocks (0-4; predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Mantener el índice completo de transacciones, usado por la llamada rpc de getrawtransaction  (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Mostrar depuración (por defecto: %u, proporcionar &lt;category&gt; es opcional)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>https://www.transifex.com/joyful-world/breaking-english/\nEstablecer la serialización de las transacciones sin procesar o el bloque hex devuelto en non-verbose mode, non-segwit(O) o segwit(1) (default: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Indique directorio para guardar monederos (por defecto: &lt;datadir&gt;/monederos si existe, sino &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Indique ubicación del archivo de registro de depuración: este puede estar en un camino absoluto o un camino relativo del directorio de datos (por defecto: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Admite filtrado de bloques, y transacciones con filtros Bloom. Reduce la carga de red. ( por defecto :%u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>La comisión (en %s/kB) que indica tu tolerancia para descartar el cambio y añadirlo a la comisión (por defecto: %s). Nota: Una salida se descarta si es polvo a esa tasa, pero solo se desechará hasta la comisión de reenvío de polvo y una comisión de descarte por encima de eso está limitada por la estimación de la comisión para el objetivo más largo</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Esta es la tarifa de cuota que debe pagar cuando las estimaciones de tarifas no estén disponibles.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Este producto incluye software desarrollado por el Proyecto OpenSSL para utilizarlo en el juego de herramientas OpenSSL %s y software criptográfico escrito por Eric Young y software UPnP escrito por Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>La longitud total de la cadena de versión de red ( %i ) supera la longitud máxima ( %i ) . Reducir el número o tamaño de uacomments .</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Intenta de mantener el Tráfico de salida , bajo el Objetivo Determinado (en MiB por 24h) , 0 =  sin limite (Por Defecto :%d )</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Error:  argumento -socks encontrado. El ajuste de la versión SOCKS ya no es posible, sólo proxies SOCKS5 son compatibles.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>El argumento no soportado -whitelistalwaysrelay ha sido ignorado, utiliza -whitelistrelay  y/o -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Usar distintos proxys SOCKS5 para comunicarse vía Tor de forma anónima (Por defecto: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Advertencia: Se están minando versiones de bloques desconocidas! Es posible que normas desconocidas estén activas</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Aviso: fichero de monedero corrupto, datos recuperados! Original %s guardado como %s en %s; si su balance de transacciones es incorrecto, debe restaurar desde una copia de seguridad.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Los pares de listas blancas que se conectan desde la dirección IP dada (por ejemplo, 1.2.3.4) o la red marcada CIDR (por ejemplo, 1.2.3.0/24). Se puede especificar varias veces.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>¡%s se establece muy alto!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Siempre consultar direcciones de otros equipos por medio de DNS lookup (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Error cargando el monedero %s. El nombre de fichero -wallet debe ser un fichero normal.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Error cargando el monedero %s. Se ha especificado un nombre de fichero -wallet duplicado.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Error cargando el monedero %s. Caracteres inválidos en el nombre de fichero -wallet.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Cuántos bloques comprobar al iniciar (predeterminado: %u, 0 = todos)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Incluir direcciones IP en la salida de depuración (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Keypool se ha agotado, llame a keypoolrefill primero</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escuchar conexiones JSON-RPC en &lt;puerto&gt; (predeterminado: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escuchar conexiones en &lt;puerto&gt; (predeterminado: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Mantener como máximo &lt;n&gt; conexiones a pares (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Realiza las operaciones de difusión del monedero</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Búfer de recepción máximo por conexión, &lt;n&gt;*1000 bytes (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Búfer de recepción máximo por conexión, , &lt;n&gt;*1000 bytes (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Anteponer marca temporal a la información de depuración (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Retransmitir y minar transacciones de transporte de datos (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Relay non-P2SH multisig (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Ajustar el número de claves en reserva &lt;n&gt; (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Establecer peso máximo bloque BIP141  (predeterminado: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Establecer el número de procesos para llamadas del servicio RPC (por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Especificar archivo de configuración (por defecto: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Especificar tiempo de espera de la conexión (mínimo: 1, por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Especificar archivo pid (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Usar cambio aún no confirmado al enviar transacciones (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Iniciando funciones de red...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>El monedero evitará pagar menos que la cuota de retransmisión mínima.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Esta es la tarifa mínima de transacción que usted paga en cada transacción.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Esta es la cuota de transacción que pagará si envía una transacción.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Umbral para la desconexión de pares con mal comportamiento (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Las cantidades de transacción no deben ser negativa</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>La transacción tiene demasiado tiempo de una cadena de mempool</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>La transacción debe de tener al menos un receptor</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>La red especificada en -onlynet '%s' es desconocida</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fondos insuficientes</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Cargando el índice de bloques...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Cargando monedero...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>No se puede cambiar a una versión mas antigua el monedero</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Reexplorando...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Se terminó de cargar</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_es_419.ts",
    "content": "<TS language=\"es_419\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Haga clic para editar la dirección o etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crear una nueva dirección</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;New</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copia la dirección seleccionada al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Borrar la dirección que esta seleccionada en la lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar los datos de la actual tabla hacia un archivo</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Seleccione la dirección a la que enviará las monedas</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Seleccione la dirección con la que recibirá las monedas</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Enviando direcciones</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Recibiendo direcciones</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estas son sus direcciones de Bitcoin para enviar sus pagos. Siempre revise el monto y la dirección recibida antes de enviar monedas.</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar los datos de la actual tabla hacia un archivo</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_es_AR.ts",
    "content": "<TS language=\"es_AR\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Click derecho para editar la dirección o etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crear una nueva dirección</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuevo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiar la dirección seleccionada al portapapeles</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;errar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Borrar de la lista la dirección seleccionada</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar los datos de la pestaña actual a un archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Borrar</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Seleccione la dirección donde enviará las monedas</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Seleccione la dirección donde recibirá las monedas</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Seleccione</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Dirección origen</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Dirección destino</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estas son tus direcciones Bitcoin para enviar pagos. Chequea siempre el monto y la dirección destino antes de mandar monedas.\n</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copiar Dirección</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copiar &amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Editar</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportar lista de direcciones</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportar archivo</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección\n</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(No etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diálogo de Frase de Contraseña</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Ingresar la Frase de Contraseña</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nueva Frase de Contraseña</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repetí la nueva Frase de Contraseña</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Encriptar billetera</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloquear la billetera</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Desencriptar la billetera</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(No etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Dirección\n</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(No etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(No etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(No etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección\n</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportar archivo</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_es_CL.ts",
    "content": "<TS language=\"es_CL\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Haga clic para editar la dirección o etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crea una nueva dirección</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>y nueva</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copia la dirección seleccionada al portapapeles</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>y copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C y perder</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Eliminar la dirección seleccionada de la lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar los datos de la pestaña actual a un archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>y exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Borrar</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Selecciones la dirección para enviar monedas a</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Selecciona la dirección para recibir monedas con</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Seleccione</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Enviando direcciones</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Recibiendo direcciones</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estas son tus direcciones de Bitcoin para recibir pagos. Siempre revise el monto y la dirección de envío antes de enviar criptomonedas.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Estas son tus direcciones para recibir pagos. Es recomendable utilizar una nueva dirección para cada transacción.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>Copiar dirección</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>Editar</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportar lista de direcciones</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Archivos separados por coma (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportación fallida</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Había un error intentando guardar la lista de direcciones en %1. Por favor inténtelo de nuevo.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialogo de contraseña</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Introduce contraseña actual      </translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repite nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Mostrar contraseña</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Introduce la nueva contraseña para la billetera.&lt;br/&gt;Por favor utiliza una  contraseña de&lt;b&gt;10 o más caracteres aleatorios&lt;/b&gt;, u &lt;b&gt;ocho o más palabras&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Codificar billetera</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Esta operación necesita la contraseña para desbloquear la billetera.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloquea billetera</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Esta operación necesita la contraseña para decodificar la billetara.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Decodificar cartera</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Cambia contraseña</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Introduzca la contraseña antigua y la nueva para la billetera.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirmar cifrado del monedero</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Advertencia: Si encriptas tu billetera y pierdes tu contraseña, vas a perder&lt;b&gt;TODOS TUS BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>¿Seguro que quieres seguir codificando la billetera?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Billetera codificada</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 se cerrará para finalizar el proceso de encriptación. Recuerda que encriptar tu billetera no protege completamente a tus bitcoins de ser robados por virus y malwares en tu computadora.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANTE: Cualquier respaldo anterior que hayas hecho del archivo de tu billetera debe ser reemplazado por el nuevo archivo encriptado que has generado. Por razones de seguridad, todos los respaldos realizados anteriormente serán inutilizables al momento de que utilices tu nueva billetera encriptada.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Falló la codificación de la billetera</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>El proceso de encriptación de la billetera fallo por culpa de un problema interno. Tu billetera no fue encriptada.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>La contraseña introducida no coincide.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Ha fallado el desbloqueo de la billetera</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La contraseña introducida para el cifrado del monedero es incorrecta.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Ha fallado la decodificación de la billetera</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>La contraseña del monedero ha sido cambiada con éxito.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Precaucion: Mayúsculas Activadas</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Máscara</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Suspendido hasta</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Firmar &amp;Mensaje...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizando con la red...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Vista general</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nodo</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Muestra una vista general de la billetera</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transacciones</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Explora el historial de transacciónes</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Salir</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Salir del programa</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>S&amp;obre %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Mostrar Información sobre %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Acerca de</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostrar Información sobre Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opciones</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modificar las opciones de configuración para %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Codificar la billetera...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Respaldar billetera...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Cambiar la contraseña...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Mandando direcciones</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Recibiendo direcciones</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Abrir y url...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Click para deshabilitar la actividad de red.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Actividad de red deshabilitada</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Click para volver a habilitar la actividad de red.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Sincronizando cabeceras (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Cargando el index de bloques...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviar monedas a una dirección bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Respaldar billetera en otra ubicación</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambiar la contraseña utilizada para la codificación de la billetera</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Ventana &amp;Debug</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Abre consola de depuración y diagnóstico</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Verificar mensaje....</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Cartera</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Envía</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>y recibir</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mostrar/Ocultar</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostrar u ocultar la ventana principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Cifrar las claves privadas de su monedero</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Firmar un mensaje para provar que usted es dueño de esta dirección</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verificar mensajes comprobando que están firmados con direcciones Bitcoin concretas</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuración</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ayuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra de pestañas</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Pide pagos (genera codigos QR and bitcoin: URls)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostrar la lista de direcciones de envío y etiquetas</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Mostrar la lista de direcciones de recepción y etiquetas</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Abrir un identificador URI bitcoin o una petición de pago</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Opciones de linea de comando</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n conexión activa hacia la red Bitcoin</numerusform><numerusform>%n conexiones activas hacia la red Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indexando bloques en disco...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Procesando bloques en disco...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n bloque procesado del historial de transacciones.</numerusform><numerusform>%n bloques procesados del historial de transacciones.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 atrás</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>El último bloque recibido fue generado hace %1</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Las transacciones posteriores aún no están visibles.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Atención</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Actualizado</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Mostrar el mensaje de ayuda %1 para obtener una lista de los posibles comandos de Bitcoin</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 cliente</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Conectando a pares...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Recuperando...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Fecha: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Cantidad: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipo: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etiqueta %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Dirección %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transacción enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacción entrante</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>La generación de clave HD está &lt;b&gt;habilitada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>La generación de clave HD está &lt;b&gt;deshabilitada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>La billetera esta &lt;b&gt;codificada&lt;/b&gt; y actualmente &lt;b&gt;desbloqueda&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>La billetera esta &lt;b&gt;codificada&lt;/b&gt; y actualmente &lt;b&gt;bloqueda&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Ha ocurrido un error fatal. Bitcoin no puede seguir seguro y se cerrará.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selección de moneda</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>comisión:\n</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de aplicar la comisión:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(des)marcar todos</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modo árbol</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modo lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Recibido con etiqueta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Recibido con dirección</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmaciones</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar dirección</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar Cantidad</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID de transacción</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Bloquear lo no gastado</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Desbloquear lo no gastado</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar comisión</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar después de la comisión</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar polvo</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar cambio</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 bloqueado)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>si</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Está etiqueta se vuelve roja si algún receptor recibe una cantidad inferior al límite actual establecido para el polvo.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Puede variar +/- %1 satoshi(s) por entrada.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>cambia desde %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(cambio)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editar dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>La etiqueta asociada con esta entrada de la lista de direcciones</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>La dirección asociada con esta entrada en la libreta de direcciones. Solo puede ser modificada para direcciones de envío.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Dirección</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nueva dirección para recibir</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nueva dirección para enviar</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Editar dirección de recepción</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Editar dirección de envio</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>La dirección introducida \"%1\" no es una dirección Bitcoin valida.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>La dirección introducida \"%1\" ya esta guardada en la libreta de direcciones.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>No se pudo desbloquear la billetera.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>La generación de nueva clave falló.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Un nuevo directorio de datos será creado.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>Nombre</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>El directorio ya existe. Agrega %1 si deseas crear un nuevo directorio aquí.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Ruta de acceso existente, pero no es un directorio.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Es imposible crear la carpeta de datos aquí.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versión</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Sobre %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>opciones de linea de comando</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uso:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opciones de linea de comando</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opciones de interfaz de usuario:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Elige la carpeta de datos al iniciar (predeterminada: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Selecciona un lenguaje, por ejemplo \"es_CL\" (predeterminado: lenguaje del SO)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Iniciar minimizado</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Definir certificado fuente SSL para la solicitud de pagos (predeterminado: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Mostrar pantalla de carga al iniciar (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Restablecer toda la configuración personalizada</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>bienvenido</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Bienvenido a %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Al ser la primera vez que se ejecuta el programa, puede elegir donde %1 almacenará sus datos.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>El primer proceso de sincronización consume muchos recursos, y es posible que puedan ocurrir problemas de hardware que anteriormente no hayas notado. Cada vez que ejecutes %1 automáticamente se reiniciará el proceso de sincronización desde el punto que lo dejaste anteriormente.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Si elegiste la opción de limitar el tamaño del blockchain (pruning), de igual manera será descargada y procesada la información histórica, pero será eliminada al finalizar este proceso para disminuir el uso del disco duro.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Usar el directorio de datos predeterminado</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>usar un directorio de datos personalizado:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Al menos %1 GB de información será almacenado en este directorio, y seguirá creciendo a través del tiempo.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Aproximadamente %1 GB de información será almacenado en este directorio.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 descargará y almacenará una copia del blockchain de Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>El monedero también será almacenado en este directorio.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Error: El directorio de datos especificado \"%1\" no pudo ser creado.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB de espacio libre disponible</numerusform><numerusform>%n GB de espacio libre disponible</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(de %n GB requerido)</numerusform><numerusform>(de %n GB requeridos)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Las transacciones recientes aún no pueden ser visibles, y por lo tanto el saldo de su monedero podría ser incorrecto. Esta información será correcta cuando su monedero haya terminado de sincronizarse con la red de bitcoin, como se detalla abajo.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>La red no aceptará el intentar gastar bitcoins que están afectados por transacciones aún no mostradas.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Número de bloques restantes</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Desconocido...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora del último bloque</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progreso</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Avance del progreso por hora</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>calculando...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Tiempo estimado restante hasta la sincronización</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ocultar</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Desconocido. Sincronizando cabeceras (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Abrir URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Abrir solicitud de pago desde URI o un archivo</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>url:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Seleccionar archivo de solicitud de pago</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Seleccionar archivo de solicitud de pago para abrir</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Iniciar automáticamente %1 al inicial el sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Iniciar %1 al iniciar el sistema</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Tamaño del caché de la base de &amp;datos</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Número de hilos de &amp;verificación de scripts</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Dirección IP del proxy (Ejemplo. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Muestra si el proxy SOCKS5 por defecto se utiliza para conectarse a pares a través de este tipo de red.</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimizar en vez de salir de la aplicación cuando la ventana está cerrada. Cuando se activa esta opción, la aplicación sólo se cerrará después de seleccionar Salir en el menú.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URLs de terceros (por ejemplo, un explorador de bloques) que aparecen en la pestaña de transacciones como elementos del menú contextual. El %s en la URL es reemplazado por el valor hash de la transacción. Se pueden separar múltiples URLs por una barra vertical |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Opciones activas de la terminal que tienen preferencia sobre las opciones anteriores:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Abrir el archivo de configuración %1 en el directorio de trabajo.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Abrir archivo de configuración</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Reestablece todas las opciones.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Restablecer opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Red</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Cartera</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>experto</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Habilitar opciones de &amp;control de monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>Gastar cambio sin confirmar</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Abre automáticamente el puerto del cliente Bitcoin en el router. Esto funciona solo cuando tu router es compatible con UPnP y está habilitado.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Direcciona el puerto usando &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Aceptar conexiones externas.</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Conectar a la red de Bitcoin a través de un proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP Proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Puerto:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Puerto del servidor proxy (ej. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Usado para alcanzar compañeros vía:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Conectar a la red de Bitcoin a través de un proxy SOCKS5 diferente para los servicios anónimos de Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>y windows\n</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Muestra solo un ícono en la bandeja después de minimizar la ventana</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimiza a la bandeja en vez de la barra de tareas</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimiza a la bandeja al cerrar</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Mostrado</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Lenguaje de la interfaz:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unidad en la que mostrar cantitades:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Elige la subdivisión por defecto para mostrar cantidaded en la interfaz cuando se envien monedas</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Mostrar o no funcionalidad de Coin Control</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancela</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>predeterminado</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>Nada</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmar reestablecimiento de las opciones</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Es necesario reiniciar el cliente para activar los cambios.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>El cliente se cerrará. Desea proceder?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opciones de configuración</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>El archivo de configuración es utilizado para especificar opciones avanzadas del usuario, que invalidan los ajustes predeterminados. Adicionalmente, cualquier opción ingresada por la línea de comandos invalidará este archivo de configuración.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>El archivo de configuración no pudo ser abierto.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Estos cambios requieren el reinicio del cliente.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>El proxy ingresado es inválido. </translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>La información entregada puede estar desactualizada. Tu billetera se sincroniza automáticamente con la red de Bitcoin después de establecer una conexión, pero este proceso aún no se ha completado.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Solo observación:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponible:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Tu saldo disponible para gastar</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pendiente:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transacciones que aún no se han sido confirmadas, y que no son contabilizadas dentro del saldo disponible para gastar</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Inmaduro:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Saldo minado que no ha madurado</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldos</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Saldo total actual</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Utilizable:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transacciones recientes</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Error en la solicitud de pago</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Manejo de URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Lectura de URL para la solicitud de pagos es invalida: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Dirección de pago inválida %1</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Manejo del archivo de solicitud de pago</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Solicitud de pago rechazada</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Red de solicitud de pagos no coincide con la red del cliente.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Solicitud de pago expirada</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>La solicitud de pago no se ha iniciado.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Solicitud de pago invalida.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>El monto para la solicitud de pago de %1 es muy pequeño (considera el dust).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Reembolsar desde %1</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Fallo al comunicar con %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>La solicitud de pago no puede ser analizada!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Mala respuesta desde el servidor %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Error en petición de la red</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Pago declarado</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nodo/Servicio</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>ID del nodo</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recibido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Ingresa una dirección de Bitcoin (Ejemplo: %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Nada</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n segundo</numerusform><numerusform>%n segundos</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 y %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 aun no se ha cerrado de forma segura...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Error: El directorio de datos \"%1\" especificado no existe.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Error: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Guardar imagen...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copiar imagen</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Guardar código QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imagen PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versión del Cliente</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Información</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Ventana Debug</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Utilizando la versión de BerkeleyDB</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Tiempo de inicio</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Red</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nombre</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Número de conexiones</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Bloquea cadena</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Cantidad de bloques actual</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Memory Pool</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Numero total de transacciones</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Memoria utilizada</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Reestablecer</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recibido</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Peers</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Peers baneados</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Selecciona un peer para ver la información detallada.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>En la lista blanca</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>version\n</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Bloque de inicio</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Cabeceras sincronizadas</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Bloques sincronizados</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Disminuir tamaño de fuente</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Aumentar tamaño de fuente</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Servicios</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Puntuación de bloqueo</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Duración de la conexión</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Ultimo envío</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Ultima recepción</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Tiempo de Ping</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Espera de Ping</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Ping minimo</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Desplazamiento de tiempo</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora del último bloque</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Abrir</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Tráfico de Red</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Entrada:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Salida:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Archivo del registro de depuración</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Limpiar Consola</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hora</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;día</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 semana</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 año</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Desconectar</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Prohibir para</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Desbloquear</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Bienvenido a la consola RPC %1.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Usa las flechas (arriba y abajo) para navegar por el historial, y %1 para limpiar la consola.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>ADVERTENCIA: No uses esta consola sin comprender las consecuencias de la ejecución de cada comando.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Actividad de red desactivada</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(identificador del nodo: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nunca</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Entrante</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Saliente</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Si</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>No</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;mensaje</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Mensaje opcional adjunto a la solicitud de pago, que será mostrado cuando la solicitud sea abierta. Nota: Este mensaje no será enviado con el pago a través de la red Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Usa este formulario para solicitar un pago. Todos los campos son &lt;b&gt;opcionales&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Monto opcional a solicitar. Deja este campo vacío o en cero si no quieres definir un monto específico.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Limpiar todos los campos del formulario.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Limpiar</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historial de pagos solicitados</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>Solicitud de pago</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostrar</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Borrar de la lista las direcciones seleccionadas</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Eliminar</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copiar URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copiar mensaje</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar Cantidad</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Código QR </translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copiar &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Copia dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Guardar imagen...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Solicitar pago a %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Información del pago</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensaje</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Fallo al codificar URI en código QR.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensaje</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(sin mensaje)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(no existe monto solicitado)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Solicitado</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar monedas</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Características de Coin Control</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Entradas...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>Seleccionado automaticamente</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fondos insuficientes</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>comisión:\n</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de aplicar la comisión:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Dirección de cambio personalizada</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Comisión transacción:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Seleccione</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Advertencia: En este momento no se puede estimar la cuota.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>Colapsar ajustes de comisión.</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>por kilobyte</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ocultar</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(leer la sugerencia)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recomendado:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Personalizado:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Enviar a múltiples destinatarios</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;Agrega destinatario</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Limpiar todos los campos del formulario.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Objetivo de tiempo de confirmación</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Borra todos</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balance:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirma el envio</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Envía</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar Cantidad</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar comisión</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar después de la comisión</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar polvo</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar cambio</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 bloques)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 a %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>¿Seguro que quiere enviar?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>agregado como comisión de transacción</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Monto total %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>o</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirmar el envió de monedas</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>La dirección de envío no es válida. Por favor revisala.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>La cantidad por pagar tiene que ser mayor que 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>El monto sobrepasa tu saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>El total sobrepasa tu saldo cuando se incluyen %1 como comisión de envió.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>¡Fallo al crear la transacción!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Se ha rechazado la transacción por la siguiente razón: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Una comisión mayor que %1 se considera como una comisión absurda-mente alta.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Solicitud de pago expirada</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Pagar únicamente la comisión requerida de %1</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Peligro: Dirección de Bitcoin inválida</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Peligro: Dirección de cambio desconocida</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Confirma dirección de cambio personalizada</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>La dirección de cambio que ingresaste no es parte de tu monedero. Parte de tus fondos serán enviados a esta dirección. ¿Estás seguro?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Pagar a:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Seleccionar dirección usada anteriormente</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Este es un pago normal</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Dirección Bitcoin a enviar el pago</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pega dirección desde portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Quitar esta entrada</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>Restar comisiones del monto.</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mensaje:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Esta es una petición de pago no autentificada.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Esta es una petición de pago autentificada.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Introduce una etiqueta para esta dirección para añadirla a la lista de direcciones utilizadas</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pagar a:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Introduce una etiqueta a esta dirección para añadirla a tu guía</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Si</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 se esta cerrando...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>No apague el equipo hasta que desaparezca esta ventana.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Firmas - Firmar / verificar un mensaje</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Firmar Mensaje</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Dirección Bitcoin con la que firmar el mensaje</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Seleccionar dirección usada anteriormente</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pega dirección desde portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Escriba el mensaje que desea firmar</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Firma</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copiar la firma actual al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Firmar un mensjage para probar que usted es dueño de esta dirección</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Firmar Mensaje</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Limpiar todos los campos de la firma de mensaje</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Borra todos</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Firmar Mensaje</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>La dirección Bitcoin con la que se firmó el mensaje</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verifica el mensaje para asegurar que fue firmado con la dirección de Bitcoin especificada.</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>&amp;Firmar Mensaje</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Limpiar todos los campos de la verificación de mensaje</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Click en \"Firmar mensaje\" para generar una firma</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>La dirección ingresada es inválida</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Por favor, revisa la dirección e intenta nuevamente.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>La dirección ingresada no corresponde a una llave válida.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>El desbloqueo del monedero fue cancelado.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>La llave privada para la dirección introducida no está disponible.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Falló la firma del mensaje.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Mensaje firmado.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>La firma no pudo decodificarse.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Por favor compruebe la firma e intente de nuevo.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>La firma no se combinó con el mensaje.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Falló la verificación del mensaje.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Mensaje verificado.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[red-de-pruebas]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Abierto hasta %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>Hay un conflicto con la traducción de las confirmaciones %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/sin conexión</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/no confirmado, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>en el equipo de memoria</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>no en el equipo de memoria</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandonado</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/no confirmado</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>confirmaciones %1</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Estado</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, no ha sido emitido con éxito aún</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Fuente</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generado</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Desde</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Para</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>dirección personal</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>Solo observación</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiqueta</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Credito</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>no aceptada</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Débito</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Total enviado</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Crédito total</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Comisión de transacción</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Cantidad total</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensaje</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comentario</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Identificador de transacción (ID)</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Tamaño total de transacción</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Indice de salida</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Vendedor</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Información de depuración</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transacción</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Entradas</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>verdadero</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>falso</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Esta ventana muestra información detallada sobre la transacción</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detalles para %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Abierto hasta %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Fuera de linea</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Sin confirmar</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandonado</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirmando (%1 de %2 confirmaciones recomendadas)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmado (%1 confirmaciones)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>En conflicto</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Inmaduro (%1 confirmación(es), Estarán disponibles después de %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>¡Este bloque no ha sido recibido por otros nodos y probablemente no sea aceptado!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generado pero no aceptado</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recibido con</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Recibido de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviado a</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pago a ti mismo</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minado</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>Solo observación</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Estado de transacción. Pasa el ratón sobre este campo para ver el numero de confirmaciones.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Fecha y hora cuando se recibió la transacción</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipo de transacción.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Cantidad restada o añadida al balance</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Todo</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Hoy</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Esta semana</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Este mes</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Mes pasado</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Este año</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Rango...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recibido con</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviado a</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>A ti mismo</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minado</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Otra</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Cantidad mínima</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Transacción abandonada</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Incrementar cuota de transacción</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar dirección</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar Cantidad</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID de transacción</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copiar transacción bruta</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copiar todos los detalles de la transacción</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Editar etiqueta</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Mostrar detalles de la transacción</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exportar historial de transacciones</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Archivos separados por coma (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Archivo separado de coma (*.csv)</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Solo observación</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportación fallida</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exportación exitosa</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>La transacción ha sido guardada en %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Rango:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>para</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unidad en la que se muestran las cantidades. Haga clic para seleccionar otra unidad.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>No se ha cargado ningún monedero</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar monedas</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Error de incremento de cuota</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Ha fallado el incremento de la cuota de transacción.</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>¿Desea incrementar la cuota?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Comisión actual:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Incremento:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nueva comisión:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Confirmar incremento de comisión</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>No se ha podido firmar la transacción.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>No se pudo confirmar la transacción</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Exportar</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar los datos de la pestaña actual a un archivo</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Respaldar monedero</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Archivo de respaldo (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Ha fallado el respaldo</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Ha habido un error al intentar guardar los datos del monedero a %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Respaldo exitoso</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Los datos del monedero se han guardado con éxito en %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opciones:\n</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especifica directorio para los datos\n</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Conectar a un nodo para obtener direcciones de pares y desconectar</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especifica tu propia dirección pública</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Aceptar comandos consola y JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distribuido bajo la licencia de software MIT, vea el archivo adjunto %s o %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Si &lt;category&gt; no es proporcionado o si &lt;category&gt; = 1, muestra toda la información de depuración</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>La Poda se ha configurado por debajo del mínimo de %d MiB. Por favor utiliza un valor mas alto.</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>No es es posible re-escanear en modo prune. Debes usar -reindex el cual descargara toda la blockchain de nuevo.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Error: Un error interno fatal ha ocurrido, ver debug.log para detalles</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Poda blockstore...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Correr como demonio y acepta comandos\n</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>No se ha podido iniciar el servidor HTTP. Ver debug log para detalles.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>bitcoin core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Los desarrolladores de %s</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d de los últimos 100 bloques tienen una versión no esperada</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s corrupto. Fracasó la recuperación</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool debe ser por lo menos de %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; puede ser:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Aceptar conexiones desde el exterior (por defecto: 1 si no -proxy o -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Agrega un comentario a la linea de agente de usuario</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Intento de recuperar claves privadas de un monedero corrupto en el arranque</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opciones de creación de bloques:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>No se puede resolver -%s direccion: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Opciones de selección en cadena:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Cambio de indice fuera de rango</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opciones de conexión:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Corrupción de base de datos de bloques detectada.</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opciones de depuración/pruebas:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>No cargar el monedero y desactivar las llamadas RPC del monedero</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>¿Quieres reconstruir la base de datos de bloques ahora?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Habilitar publicar bloque hash en &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Habilitar publicar hash de transacción en &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Habilita la publicación de bloques en bruto en &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Habilitar publicar transacción en bruto en &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Habilita el re-emplazamiento de transacciones en el pool de memoria (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error al inicializar la base de datos de bloques</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error al iniciar el entorno de la base de datos del monedero %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Error cargando %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Error cargando %s: Monedero corrupto</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Error cargando %s: Monedero requiere una versión mas reciente de %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Error cargando blkindex.dat</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Error cargando base de datos de bloques</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Atención: Poco espacio en el disco duro</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Ha fallado la escucha en todos los puertos. Usa -listen=0 si desea esto.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importando...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Incorrecto o bloque de génesis no encontrado. ¿datadir equivocada para la red?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>La inicialización de la verificación de validez falló. Se está apagando %s.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Monto invalido para -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Monto invalido para -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Monto invalido para -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Mantener la memoria de transacciones por debajo de &lt;n&gt;megabytes (por defecto: %u) </translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Cargando direcciones P2P...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Cargando banlist...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Ubicación de la cookie de autenticación (por defecto: data dir)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>No hay suficientes descriptores de archivo disponibles.</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Imprimir este mensaje de ayuda y salir</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Imprimir versión y salir</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Reproduciendo bloques...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Rebobinando bloques...</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Especificar archivo de monedero (dentro del directorio de datos)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>El código fuente esta disponible desde %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>El cálculo de la comisión de transacción y del cambio han fallado</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>El argumento -benchmark no es soportado y ha sido ignorado, usa -debug=bench</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>El argumento -debugnet no es soportado, usa -debug=ned.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>El argumento -tor no es soportado, usa -onion.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Actualizando la base de datos UTXO</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Usar UPnP para asignar el puerto de escucha (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Utilice la cadena de prueba</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verificando bloques...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opciones del monedero:</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Aceptar solicitudes REST públicas (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Automáticamente crea el servicio Tor oculto (por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Conectar a través de proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Error cargando %s: No puedes deshabilitar HD en un monedero HD ya existente</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Error al leer la base de datos, cerrando aplicación.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Error actualizando la base de datos chainstate</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importar bloques desde archivo externo blk000??.dat al inicio</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Dirección de -onion o dominio '%s' inválido</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Máscara de red inválida especificada en -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Mantener como máximo &lt;n&gt;transacciones no conectables en memoria (por defecto: %u) </translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Necesita especificar un puerto con -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Opciones de nodos de retransmisión:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opciones de servidor RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reduciendo -maxconnections de %d a %d, debido a limitaciones del sistema.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Rescanea la cadena de bloques para buscar transacciones perdidas del monedero</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Enviar informacion de seguimiento a la consola en vez del archivo debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Muestra todas las opciones de depuración (uso: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Firma de transacción fallida</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>El monto a transferir es muy pequeño para pagar el impuesto</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Este es un software experimental.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Contraseña del puerto de control de Tor (predeterminado: vació)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Puerto de control de Tor a utilizar si la escucha de onion esta activada (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Monto a transferir muy pequeño</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Operación demasiado grande para la política de comision</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transacción muy grande</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>No es posible conectar con %s en este sistema (bind ha devuelto el error %s)</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Actualizar el monedero al último formato al inicio</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Usuario para las conexiones JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Verificando billetera(s)...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Atención</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Advertencia: nuevas reglas desconocidas activadas (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Si se debe o no operar en un modo de solo bloques (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Necesita reconstruir las bases de datos con la opción -reindex para cambiar -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Eliminando todas las transacciones del monedero...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Opciones de notificación ZeroQM:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Contraseña para las conexiones JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Ejecutar un comando cuando cambia el mejor bloque (%s en cmd se reemplaza por el hash de bloque)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permite búsqueda DNS para addnode y connect\n</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = mantener metadata de la transacción. Ej: información del remitente, 2 = eliminar metadata de la transacción)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee tiene un valor muy elevado! Comisiones muy grandes podrían ser pagadas en una única transacción.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Vincular a la dirección dada para escuchar las conexiones JSON-RPC. Esta opción se ignora a menos que también se pase -rpcallowip. El puerto es opcional y reemplaza -rpcport. Usa la notación [host]:puerto para IPv6. Esta opción puede ser especificada varias veces (por defecto: 127.0.0.1 y :: 1 Ej., localhost o si se ha especificado -rpcallowip, 0.0.0.0 y :: por Ej., todas las direcciones)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>No mantener transacciones en la memoria mas de &lt;n&gt;horas (predeterminado: %u) </translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Bytes equivalentes por sigop en transacciones para retrasmisión y minado (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Error cargando %s: No puedes habilitar HD en un monedero no HD ya existente</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Error cargando monedero %s. El parámetro -wallet solo debe indicar un nombre de archivo (no una ruta).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Impuestos (en %s/Kb) menores a este serán consideradas nulas en la creación de la transacción (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Fuerza la retransmisión de transacciones desde nodos en la lista blanca incluso si violan la política de retransmisiones local (por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Nivel de rigor en la verificación de bloques de -checkblocks (0-4; por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Mantener el índice completo de transacciones, usado por la llamada rpc de getrawtransaction (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Número de segundos en que se evita la re-conexión de pares con mal comportamiento (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Mostrar información de depuración (por defecto: %u, proporcionar &lt;category&gt; es opcional)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Establecer la serialización de las transacciones sin procesar o el bloque hexadecimal devuelto en non-verbose mode, non-segwit(O) o segwit(1) (por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Soporta el filtrado de bloques, y transacciones con filtros Bloom (por defecto : %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>La comisión (en %s/kB) que indica tu tolerancia para descartar el cambio y añadirlo a la comisión (por defecto: %s). Nota: Una salida se descarta si es polvo(dust) a esa comisión, pero solo se descarta hasta la comisión de reenvío de polvo(dust) y una comisión de descarte por encima de eso está limitada por la estimación de la comisión para el objetivo más largo</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Impuesto por transacción que pagarás cuando la estimación de impuesto no esté disponible.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>La longitud total de la cadena de versión de red ( %i ) supera la longitud máxima ( %i ) . Reducir el número o tamaño de uacomments .</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Intenta de mantener el tráfico de salida, bajo el umbral dado (en MiB por 24h) , 0 = sin limite (Por Defecto :%d )</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Argumento -socks no soportado. La configuración de la versión SOCKS ya no es posible, sólo los proxies SOCKS5 son compatibles.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Argumento -whitelistalwaysrelay no soportado ha sido ignorado, utiliza -whitelistrelay y/o -whitelistforcerelay</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Usar distintos proxys SOCKS5 para comunicarse vía Tor de forma anónima (Por defecto: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Advertencia: Se están minando versiones de bloques desconocidas! Es posible que reglas desconocidas estén activas</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Advertencia: Archivo de monedero corrupto, datos recuperados! Original %s guardado como %s en %s; si su balance de transacciones es incorrecto, debe restaurar desde una copia de seguridad.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Los pares de listas blancas que se conectan desde la dirección IP dada (por ejemplo, 1.2.3.4) o la red marcada CIDR (por ejemplo, 1.2.3.0/24). Se puede especificar varias veces.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>¡%s esta configurado muy alto!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Siempre consultar direcciones de otros equipos por medio de DNS lookup (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Error cargando el monedero %s. El nombre de fichero -wallet debe ser un archivo normal.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Error cargando el monedero %s. Se ha especificado un nombre de fichero -wallet duplicado.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Error cargando el monedero %s. Caracteres inválidos en el nombre de fichero -wallet.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Cuántos bloques para comprobar al iniciar (predeterminado: %u, 0 = todos)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Incluir direcciones IP en la salida de depuración (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Keypool se ha agotado, llame a keypoolrefill primero</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escuchar conexiones JSON-RPC en &lt;port&gt;(predeterminado: %u o testnet: %u) </translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escuchar conexiones en &lt;port&gt;(predeterminado: %u o testnet: %u) </translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Mantener como máximo &lt;n&gt;conexiones a pares (predeterminado: %u) </translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Realiza las operaciones de difusión del monedero</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Búfer de recepción máximo por conexión, &lt;n&gt;*1000 bytes (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Búfer de envio máximo por conexión, &lt;n&gt;1000 bytes (por defecto: %u)*</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Anteponer marca de tiempo a la información de depuración (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Retransmitir y minar transacciones de transporte de datos (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Retransmitir non-P2SH multisig (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Ajusta el numero de claves en reserva a &lt;n&gt; (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Establecer el peso máximo del bloque BIP141 (por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Número de threads para las llamadas RPC (predeterminado %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Especificar archivo de configuración (por defecto: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Especificar tiempo de espera de la conexión (mínimo: 1, por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Especificar archivo pid (por defecto: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Usar cambio aún no confirmado al enviar transacciones (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Iniciando procesos de red...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>La billetera no permitirá pagar menos que la fee de transmisión mínima (relay fee).</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Mínimo de impuesto que pagarás con cada transacción.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Impuesto por transacción a pagar si envías una transacción.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Umbral para la des-conexión de pares con mal comportamiento (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>El monto de la transacción no puede ser negativo</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>La transacción tiene demasiado tiempo de una cadena de mempool</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>La transacción debe incluir al menos un destinatario.</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>La red especificada en -onlynet: '%s' es desconocida</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fondos insuficientes</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Cargando el index de bloques...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Cargando cartera...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>No es posible desactualizar la billetera</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Rescaneando...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Carga completa</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_es_CO.ts",
    "content": "<TS language=\"es_CO\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Click derecho para editar la dirección o etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crear una nueva dirección</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuevo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiar la dirección actualmente seleccionada al sistema de portapapeles</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;errar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Borrar la dirección actualmente seleccionada de la lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>\nExportar los datos en la pestaña actual a un archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Borrar</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Elija la dirección para enviar las monedas </translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Elige la dirección para recibir las monedas </translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Escoger</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Enviando dirección</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Recibiendo dirección</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estas son sus direcciones de Bitcoin para enviar pagos. Siempre verifique el monto y la dirección de recepción antes de enviar monedas.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Estas son sus direcciones de Bitcoin para recibir pagos. Se recomienda utilizar una nueva dirección de recepción para cada transacción.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>Copiar dirección</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copiar y etiquetar</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>Editar</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportar la lista de direcciones</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Archivo separado por comas (* .csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportación fallida</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(no etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diálogo de contraseña</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Poner contraseña</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repetir nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Mostrar contraseña</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Ingrese la nueva frase de contraseña a la billetera.&lt;br/&gt; Por favor utilice una frase de contraseña&lt;b&gt;diez o más caracteres aleatorios &lt;/b&gt; o &lt;b&gt;ocho o más palabras&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Encriptar la billetera</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Esta operación necesita su contraseña de billetera para desbloquearla.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloquear la billetera</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Esta operación necesita su contraseña de billetera para descifrarla.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Descifrar la billetera</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Cambiar frase de contraseña</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Ingrese la anterior y la nueva frase de contraseña en la billetera.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirmar el cifrado de la billetera</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Advertencia: si encriptas tu billetera y pierdes tu contraseña &lt;b&gt; PIERDES TODOS TUS BITCOINS &lt;/b&gt; !</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>¿Estás seguro de que deseas encriptar tu billetera?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Billetera encriptada</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANTE: todas las copias de seguridad anteriores que haya realizado de su archivo de billetera se deben reemplazar con el archivo de monedero cifrado recién generado. Por razones de seguridad, las copias de seguridad anteriores del archivo monedero sin encriptar serán inútiles tan pronto como comience a usar el nuevo monedero cifrado.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>El cifrado de Wallet falló</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>El cifrado de Wallet falló debido a un error interno. Su billetera no estaba encriptada.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Las frases de contraseña suministradas no coinciden.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>El desbloqueo de la billetera falló</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La frase de contraseña ingresada para el descifrado de la billetera fue incorrecta.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>El descifrado de la billetera falló</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>La frase de contraseña de la billetera se cambió con éxito.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Advertencia: ¡la tecla Bloq Mayús está activada!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP / Máscara de red</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Prohibido hasta</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Firma y mensaje ...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizando con la red...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Visión de conjunto</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nodo</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostrar vista general de la billetera</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transacciones</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Examinar el historial de transacciones</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>S&amp;alir</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Salir de la aplicación</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Acerca de &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostrar información sobre Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Billetera Encriptada</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Billetera Copia de seguridad...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Cambiar contraseña...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Enviando Direcciones...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Recibiendo Direcciones...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Abrir &amp;URL...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Haga clic para deshabilitar la actividad de la red.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Actividad de red deshabilitada.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Haga clic para habilitar nuevamente la actividad de la red.</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexando bloques en el disco ...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviando monedas a una dirección de Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Monedero de respaldo a otra ubicación</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambiar la contraseña usando la encriptación de la billetera</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Ventana desarrollador</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Abrir consola de diagnóstico y desarrollo</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verificar Mensaje...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Billetera</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Recibir</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mostrar / Ocultar</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostrar u ocultar la Ventana Principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Encripta las claves privadas que pertenecen a tu billetera</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Firme mensajes con sus direcciones de Bitcoin para demostrar que los posee</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifique los mensajes para asegurarse de que fueron firmados con las direcciones de Bitcoin especificadas</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuraciones</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ayuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra de herramientas de pestañas</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Solicitar pagos (genera códigos QR y bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostrar la lista de direcciones y etiquetas de envío usadas</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Mostrar la lista de direcciones y etiquetas de recepción usadas</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Abra un bitcoin: URI o solicitud de pago</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Y opciones de línea de comando</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Bloques de indexación en el disco ...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Procesamiento de bloques en el disco ...</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Las transacciones posteriores a esto aún no estarán visibles.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Advertencia</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>A hoy</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Conectando con sus pares ...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Alcanzando...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transacción enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacción entrante</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>La generación de la clave HD está &lt;b&gt; activada &lt;/ b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>La generación de la clave HD está &lt;b&gt; desactivada &lt;/ b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>La billetera está &lt;b&gt; encriptada &lt;/ b&gt; y actualmente &lt;b&gt; desbloqueada &lt;/ b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>La billetera está &lt;b&gt; encriptada &lt;/ b&gt; y actualmente está &lt;b&gt; bloqueada &lt;/ b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Se produjo un error fatal. Bitcoin ya no puede continuar de manera segura y no continuará</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selección de monedas</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comisión:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de comisión:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(de)seleccionar todo</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modo árbol</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modo lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Recibido con etiqueta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Recibido con dirección</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmaciones</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar dirección</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID de la transacción</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Bloquear no utilizado</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Desbloquear no utilizado</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Cantidad de copia</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Tarifa de copia</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar después de la tarifa</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar polvo</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar cambio</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>si</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Está etiqueta se vuelve roja si algún receptor recibe una cantidad inferior al límite actual establecido para el polvo.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(no etiqueta)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(cambio)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editar dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>Y etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>La etiqueta asociada a esta entrada está en la lista de direcciones</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>La dirección asociada con esta entrada está en la lista de direcciones. Esto solo se puede modificar para enviar direcciones.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>Y dirección</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nueva dirección de recepción</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nueva dirección de envío</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Editar dirección de recepción</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Editar dirección de envío</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>No se pudo desbloquear la billetera.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Nueva generación de claves fallida.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Se creará un nuevo directorio de datos.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nombre</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>La ruta ya existe, y no es un directorio ...</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>No se puede crear el directorio de datos aquí.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versión</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Alrededor de %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opciones de línea de comando</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uso:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opciones de línea de comando</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opciones de UI:</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Establecer el idioma, por ejemplo \"de_DE\" (predeterminado: configuración regional del sistema)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Iniciar minimizado</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Establecer certificados raíz SSL para solicitud de pago (predeterminado: -sistema-)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Restablecer todas las configuraciones modificadas en la GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>bienvenido</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Bienvenido al %1</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Si ha elegido limitar el almacenamiento de la cadena de bloques (pruning), los datos históricos todavía se deben descargar y procesar, pero se eliminarán posteriormente para mantener el uso del disco bajo.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Use el directorio de datos predeterminado</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Use un directorio de datos personalizado:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>La billetera también se almacenará en este directorio.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formar</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Es posible que las transacciones recientes aún no estén visibles y, por lo tanto, el saldo de su billetera podría ser incorrecto. Esta información será correcta una vez que su billetera haya terminado de sincronizarse con la red bitcoin, como se detalla a continuación.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>La red no aceptará intentar gastar bitcoins que se vean afectados por transacciones aún no mostradas</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Cantidad de bloques restantes</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Desconocido...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora del último bloque</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progreso</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Aumento de progreso por hora</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>calculando...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Tiempo estimado restante hasta sincronización</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Esconder</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>URI abierto</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Abrir solicitud de pago de URI o archivo</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Seleccionar archivo de solicitud de pago</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Seleccione el archivo de solicitud de pago para abrir</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Tamaño de la memoria caché de la base de datos</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Cantidad de secuencias de comandos y verificación</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Dirección IP del proxy (por ejemplo, IPv4: 127.0.0.1 / IPv6: :: 1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Muestra si el proxy SOCKS5 suministrado se utiliza para llegar a los pares a través de este tipo de red.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Use SOCKS&amp;5 y proxy por separado para llegar a sus compañeros a través de los servicios ocultos de Tor:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Ocultar el icono de la bandeja del sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>Ocultar icono de bandeja</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimice en lugar de salir de la aplicación cuando la ventana esté cerrada. Cuando esta opción está habilitada, la aplicación se cerrará solo después de seleccionar Salir en el menú.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Opciones de línea de comando activas que anulan las opciones anteriores:</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Abrir archivo de configuración</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Restablecer todas las opciones del cliente a los valores predeterminados.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>Y Restablecer opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Red</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = deja muchos núcleos gratis)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Billetera</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Experto</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Habilite las funciones de moneda y control</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Si deshabilita el gasto de un cambio no confirmado, el cambio de una transacción no se puede usar hasta que esa transacción tenga al menos una confirmación. Esto también afecta cómo se calcula su saldo.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp; Gastar cambio no confirmado</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Abra automáticamente el puerto cliente de Bitcoin en el enrutador. Esto solo funciona cuando su enrutador admite UPnP y está habilitado.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Puerto de mapa usando &amp; UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Acepta conexiones desde afuera.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Permitir conexiones entrantes</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Conéctese a la red de Bitcoin a través de un proxy SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>Conectar a través del proxy SOCKS5 (proxy predeterminado):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>Puerto:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Puerto del proxy (por ejemplo, 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Utilizado para llegar a los compañeros a través de:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Conéctese a la red de Bitcoin a través de un proxy SOCKS5 separado para los servicios Tor ocultos.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>Ventana</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Mostrar solo un icono de bandeja después de minimizar la ventana.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>Minimice la bandeja en lugar de la barra de tareas</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>Minimice al cerrar</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>Monitor</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Interfaz de usuario e idioma:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation> Unidad para mostrar montos en:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Elija la unidad de subdivisión predeterminada para mostrar en la interfaz y al enviar monedas.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Ya sea para mostrar las funciones de control de monedas o no.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>URLs de transacciones de terceros</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>Cancelar</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>defecto</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>ninguno </translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmar restablecimiento de opciones</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Se requiere el reinicio del cliente para activar los cambios.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>El cliente será cluasurado. Quieres proceder?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opciones de configuración</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>El archivo de configuración se utiliza para especificar opciones de usuario avanzadas que anulan la configuración de la GUI. Además, cualquier opción de línea de comandos anulará este archivo de configuración.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>El archivo de configuración no se pudo abrir.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Este cambio requeriría un reinicio del cliente.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>La dirección proxy suministrada no es válida.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Configurar</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>La información mostrada puede estar desactualizada. Su billetera se sincroniza automáticamente con la red de Bitcoin después de establecer una conexión, pero este proceso aún no se ha completado.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Ver-solo:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponible</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Su saldo disponible actual</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pendiente:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transacciones que aún no se han confirmado y aún no cuentan para el saldo disponible</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Inmaduro:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Balance minero que aún no ha madurado</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Balances</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Su saldo total actual</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Tu saldo actual en solo ver direcciones</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transacciones recientes</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Transacciones no confirmadas para ver solo direcciones</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Balance minero ver solo direcciones que aún no ha madurado</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Saldo total actual en direcciones de solo reloj</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Error de solicitud de pago</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>No se puede iniciar Bitcoin: controlador de clic para pagar</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Manejo de URI</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>¡URI no puede ser analizado! Esto puede deberse a una dirección de Bitcoin no válida o a parámetros de URI mal formados.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Manejo de archivos de solicitud de pago</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>¡El archivo de solicitud de pago no se puede leer! Esto puede deberse a un archivo de solicitud de pago no válido.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Solicitud de pago rechazada</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>La red de solicitud de pago no coincide con la red del cliente.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Solicitud de pago caducada.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>La solicitud de pago no está inicializada.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Las solicitudes de pago no verificadas para los scripts de pago personalizados no son compatibles.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Solicitud de pago inválida</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>¡La solicitud de pago no se puede analizar!</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Error de solicitud de red</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Pago reconocido</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Agente de usuario</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nodo / Servicio</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>NodeId</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Expedido</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recibido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Ninguno</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n segundos</numerusform><numerusform>%n segundos</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minutos</numerusform><numerusform>%n minutos</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n horas</numerusform><numerusform>%n horas</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n días </numerusform><numerusform>%n días </numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n semanas</numerusform><numerusform>%n semanas</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 y %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n años</numerusform><numerusform>%n años</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: %1</source>\n        <translation>Error: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Guardar imagen...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>Copiar imagen</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Guardar código QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imagen PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versión cliente</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Ventana de depuración</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Usando la versión BerkeleyDB</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Tiempo de inicio</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Red</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nombre</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Número de conexiones </translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Cadena de bloques</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Número actual de bloques</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Grupo de memoria</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Número actual de transacciones</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Uso de memoria</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>Reiniciar</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recibido</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Expedido</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>Pares</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Pares prohibidos</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Seleccione un par para ver información detallada.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Incluido en la lista blanca</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versión</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Bloque de inicio</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Encabezados sincronizados</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Bloques sincronizados</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Agente de usuario</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Disminuir tamaño de letra</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Aumenta el tamaño de la fuente</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Servicios</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Puntuación Ban</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Tiempo de conexión</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Último envío</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Última recepción</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Tiempo Ping</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>La duración de un ping actualmente pendiente.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping espera</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Min Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Desplazamiento de tiempo</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora del último bloque</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>Abierto</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>Consola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>Tráfico de red</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totales </translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>En:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Fuera:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Archivo de registro de depuración</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Consola limpia</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 hora</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 día</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 semana</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 año</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>Desconectar</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Prohibición de</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>ADVERTENCIA: los estafadores han estado activos, pidiendo a los usuarios que escriban comandos aquí, robando el contenido de su billetera. No use esta consola sin entender completamente las ramificaciones de un comando</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Actividad de red deshabilitada</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nunca </translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Entrante</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Salida</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Si </translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>No</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>Etiqueta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Mensaje:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Un mensaje opcional para adjuntar a la solicitud de pago, que se mostrará cuando se abra la solicitud. Nota: El mensaje no se enviará con el pago a través de la red de Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Una etiqueta opcional para asociar con la nueva dirección de recepción</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Use este formulario para solicitar pagos. Todos los campos son &lt;b&gt; opcionales &lt;/ b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Un monto opcional para solicitar. Deje esto vacío o en cero para no solicitar una cantidad específica.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Borre todos los campos del formulario.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Aclarar</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historial de pagos solicitado</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>Solicitar pago</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Mostrar la solicitud seleccionada (hace lo mismo que hacer doble clic en una entrada)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostrar</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Eliminar las entradas seleccionadas de la lista</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Eliminar</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copiar URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copiar mensaje</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Código QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copiar URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copiar dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Guardar imagen...</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(no etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comisión:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de comisión:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Esconder</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Borre todos los campos del formulario.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Cantidad de copia</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>\nTarifa de copia</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar después de la tarifa</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar polvo</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar cambio</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Solicitud de pago caducada.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(no etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>Etiqueta:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Si </translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(no etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar dirección</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID de la transacción</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Archivo separado por comas (* .csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportación fallida</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>\nExportar los datos en la pestaña actual a un archivo</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Esta es la cuota de transacción que puede descartar si el cambio es más pequeño que el polvo a este nivel.</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Peligro.</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fondos Insuficientes</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Cargando billetera...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Reescaneando</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Listo Cargando</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_es_DO.ts",
    "content": "<TS language=\"es_DO\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crear una nueva dirección</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuevo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiar la dirección seleccionada al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Cerrar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Borrar de la lista la dirección seleccionada</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar a un archivo los datos de esta pestaña</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Eliminar</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diálogo de contraseña</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Introducir contraseña</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repita la nueva contraseña</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Firmar &amp;mensaje...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizando con la red…</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Vista general</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nodo</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostrar vista general del monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transacciones</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Examinar el historial de transacciones</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Salir</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Salir de la aplicación</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Acerca de &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostrar información acerca de Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opciones...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Cifrar monedero…</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Copia de &amp;respaldo del monedero...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Cambiar la contraseña…</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>$Enviando dirección...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Recibiendo dirección</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Abrir URI...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexando bloques en disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviar monedas a una dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Copia de seguridad del monedero en otra ubicación</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambiar la contraseña utilizada para el cifrado del monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Ventana de &amp;depuración</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Abrir la consola de depuración y diagnóstico</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verificar mensaje...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Recibir</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>Mo&amp;strar/ocultar</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostrar u ocultar la ventana principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Cifrar las claves privadas de su monedero</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Firmar mensajes con sus direcciones Bitcoin para demostrar la propiedad</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verificar mensajes comprobando que están firmados con direcciones Bitcoin concretas</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuración</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>A&amp;yuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra de pestañas</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Solicitar pagos (genera codigo QR y URL's de Bitcoin)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostrar la lista de direcciones de envío y etiquetas</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Muestra la lista de direcciones de recepción y etiquetas</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Abrir un bitcoin: URI o petición de pago</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Opciones de linea de comando</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 atrás</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>El último bloque recibido fue generado hace %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Las transacciones posteriores aún no están visibles.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Aviso</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Actualizado</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Actualizando...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transacción enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacción entrante</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;desbloqueado&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;bloqueado&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cuantía:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Tasa:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de tasas:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(des)selecciona todos</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modo arbol</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modo lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmaciones</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editar Dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>La etiqueta asociada con esta entrada de la lista de direcciones</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>La dirección asociada con esta entrada de la lista de direcciones. Solo puede ser modificada para direcciones de envío.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Dirección</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Se creará un nuevo directorio de datos.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nombre</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>El directorio ya existe. Añada %1 si pretende crear aquí un directorio nuevo.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>La ruta ya existe y no es un directorio.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>No se puede crear un directorio de datos aquí.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versión</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opciones de la línea de órdenes</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uso:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opciones de la línea de órdenes</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bienvenido</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Utilizar el directorio de datos predeterminado</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Utilice un directorio de datos personalizado:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Desde</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora del último bloque</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Abrir URI...</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>El pago requiere una URI o archivo</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Seleccione archivo de sulicitud de pago</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Dirección IP del proxy (ej. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Restablecer todas las opciones del cliente a las predeterminadas.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Restablecer opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Red</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Monedero</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Experto</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Abrir automáticamente el puerto del cliente Bitcoin en el router. Esta opción solo funciona si el router admite UPnP y está activado.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapear el puerto usando &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Dirección &amp;IP del proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Puerto:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Puerto del servidor proxy (ej. 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Ventana</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Minimizar la ventana a la bandeja de iconos del sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimizar a la bandeja en vez de a la barra de tareas</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimizar al cerrar</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Interfaz</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>I&amp;dioma de la interfaz de usuario</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>Mostrar las cantidades en la &amp;unidad:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Elegir la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envían monedas.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Mostrar o no características de control de moneda</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Aceptar</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancelar</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>predeterminado</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>ninguno</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirme el restablecimiento de las opciones</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Reinicio del cliente para activar cambios.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Este cambio requiere reinicio por parte del cliente.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>La dirección proxy indicada es inválida.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Desde</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>La información mostrada puede estar desactualizada. Su monedero se sincroniza automáticamente con la red Bitcoin después de que se haya establecido una conexión, pero este proceso aún no se ha completado.</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Su balance actual gastable</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transacciones que deben ser confirmadas, y que no cuentan con el balance gastable necesario</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>No disponible:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Saldo recién minado que aún no está disponible.</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Su balance actual total</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versión del cliente</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Ventana de depuración</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Hora de inicio</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Red</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nombre</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Número de conexiones</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Cadena de bloques</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Número actual de bloques</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora del último bloque</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Abrir</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Tráfico de Red</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Dentro:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Fuera:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Archivo de registro de depuración</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Borrar consola</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Mensaje:</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Limpiar todos los campos del formulario</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Limpiar</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Solicitar pago</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Muestra la petición seleccionada (También doble clic)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostrar</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Borrar de la lista las direcciónes actualmente seleccionadas</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Eliminar</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Código QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copiar &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copiar &amp;Dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Guardar Imagen...</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar monedas</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Características de control de la moneda</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Entradas...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>Seleccionado automaticamente</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fondos insuficientes!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cuantía:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Tasa:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de tasas:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Al activarse, si la dirección esta vacía o es inválida, las monedas serán enviadas a una nueva dirección generada.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Dirección propia</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Comisión de transacción:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Enviar a múltiples destinatarios de una vez</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Añadir &amp;destinatario</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Limpiar todos los campos del formulario</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Limpiar &amp;todo</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirmar el envío</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Ca&amp;ntidad:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Pagar a:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escoger dirección previamente usada</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Esto es un pago ordinario.</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar dirección desde portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Eliminar esta transacción</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mensaje:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Introduce una etiqueta para esta dirección para añadirla a la lista de direcciones utilizadas</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Paga a:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Firmas - Firmar / verificar un mensaje</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Firmar mensaje</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escoger dirección previamente usada</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar dirección desde portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Introduzca el mensaje que desea firmar aquí</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Firma</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copiar la firma actual al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Firmar el mensaje para demostrar que se posee esta dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Firmar &amp;mensaje</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Limpiar todos los campos de la firma de mensaje</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Limpiar &amp;todo</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verificar mensaje</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verificar el mensaje para comprobar que fue firmado con la dirección Bitcoin indicada</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verificar &amp;mensaje</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Limpiar todos los campos de la verificación de mensaje</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Esta ventana muestra información detallada sobre la transacción</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opciones:\n</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especificar directorio para los datos</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Conectar a un nodo para obtener direcciones de pares y desconectar</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especifique su propia dirección pública</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Aceptar comandos consola y JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Ejecutar en segundo plano como daemon y aceptar comandos\n</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Núcleo de Bitcoin</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Vincular a la dirección dada y escuchar siempre en ella. Utilice la notación [host]:port para IPv6</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Ejecutar comando cuando una transacción del monedero cambia (%s en cmd se remplazará por TxID)</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; puede ser:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Aceptar conexiones desde el exterior (predeterminado: 1 si no -proxy o -connect)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opciones de creación de bloques:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Corrupción de base de datos de bloques detectada.</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>¿Quieres reconstruir la base de datos de bloques ahora?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error al inicializar la base de datos de bloques</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error al inicializar el entorno de la base de datos del monedero  %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Error cargando base de datos de bloques</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Error al abrir base de datos de bloques.</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Error: ¡Espacio en disco bajo!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Ha fallado la escucha en todos los puertos. Use -listen=0 si desea esto.</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Incorrecto o bloque de génesis no encontrado. Datadir equivocada para la red?</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>No hay suficientes descriptores de archivo disponibles. </translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Especificar archivo de monedero (dentro del directorio de datos)</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verificando bloques...</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Ejecutar un comando cuando se reciba una alerta importante o cuando veamos un fork demasiado largo (%s en cmd se reemplazará por el mensaje)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opciones del sservidor RPC:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Mostrar todas las opciones de depuración (uso: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Transacción falló</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Monto de la transacción muy pequeño</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transacción demasiado grande</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nombre de usuario para las conexiones JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Aviso</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Contraseña para las conexiones JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Ejecutar un comando cuando cambia el mejor bloque (%s en cmd se sustituye por el hash de bloque)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permitir búsquedas DNS para -addnode, -seednode y -connect</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>La red especificada en -onlynet '%s' es desconocida</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fondos insuficientes</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Cargando el índice de bloques...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Cargando monedero...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>No se puede rebajar el monedero</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Reexplorando...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Generado pero no aceptado</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_es_ES.ts",
    "content": "<TS language=\"es_ES\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Haz clic derecho para editar la dirección o etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crear una nueva dirección</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuevo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiar la dirección seleccionada al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;errar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Eliminar la dirección seleccionada de la lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar los datos en la ficha actual a un archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Eliminar</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Seleccione la dirección a la que enviar monedas</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Seleccione la dirección de la que recibir monedas</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>E&amp;scoger</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Enviando direcciones</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Recibiendo direcciones</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estas son sus direcciones Bitcoin para enviar pagos. Verifique siempre la cantidad y la dirección de recibimiento antes de enviar monedas.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Estas son sus direcciones Bitcoin para recibir pagos. Se recomienda utilizar una nueva dirección de recibimiento para cada transacción</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copiar Dirección</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copiar &amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Editar</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportar lista de direcciones</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Archivo separado de coma (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Falló la exportación</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Había un error intentando guardar la lista de direcciones en %1. Por favor inténtelo de nuevo.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diálogo de contraseña</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Introducir contraseña</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repita la nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Introduzca la nueva frase clave del monedero. &lt;br/&gt;Por favor utilice una frase clave de &lt;b&gt;diez o más carácteres aleatorios&lt;/b&gt;, o &lt;b&gt;ocho o más palabras&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Cifrar cartera</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Esta operación necesita su frase clave de monedero para desbloquear el monedero.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloquear monedero</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Esta operación necesita su frase clave de cartera para desencriptar el monedero.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Desencriptar monedero</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Cambiar frase clave</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Introduzca la vieja frase clave y la nueva flase clave para el monedero.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirmar encriptación del monedero</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Advertencia: Si encripta su monedero y pierde su frase clave &lt;b&gt;PERDERÁ TODOS SUS BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>¿Seguro que desea encriptar su monedero?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Monedero encriptado</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 se cerrará ahora para terminar el proceso de encriptación. Recuerde que encriptar su monedero no puede proteger completamente su monedero de ser robado por malware que infecte su ordenador.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANTE: Cualquier copia de seguridad anterior que haya hecho en su archivo de monedero debería ser reemplazada con el archivo de monedero encriptado generado recientemente. Por razones de seguridad, las copias de seguridad anteriores del archivo de monedero desencriptado serán inútiles en cuanto empiece a utilizar el nuevo monedero encriptado.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Fracasó la encriptación de monedero</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Falló la encriptación del monedero debido a un error interno. Su monedero no fue encriptado.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>La frase clave introducida no coincide.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Fracasó el desbloqueo del monedero</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La frase clave introducida para la encriptación del monedero es incorrecta.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Fracasó la encriptación del monedero</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>La frase clave del monedero se ha cambiado con éxito.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Alerta: ¡La clave de bloqueo Caps está activa!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Máscara</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Bloqueado Hasta</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Firmar &amp;mensaje...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizando con la red…</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Vista general</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nodo</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostrar vista general del monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transacciones</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Examinar el historial de transacciones</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>S&amp;alir</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Salir de la aplicación</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Acerca de %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Mostrar información acerca de %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Acerca de &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostrar información acerca de Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opciones...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modificar las opciones de configuración para %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Cifrar monedero…</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Guardar copia del monedero...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Cambiar la contraseña…</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Direcciones de &amp;envío...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Direcciones de &amp;recepción...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Abrir &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Haz click para desactivar la actividad de red.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Actividad de red desactivada.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Haz click para reactivar la actividad de red.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Sincronizando cabeceras (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexando bloques en disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviar bitcoins a una dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Copia de seguridad del monedero en otra ubicación</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambiar la contraseña utilizada para el cifrado del monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Ventana de depuración</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Abrir la consola de depuración y diagnóstico</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verificar mensaje...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Recibir</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mostrar / Ocultar</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostrar u ocultar la ventana principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Cifrar las claves privadas de su monedero</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Firmar mensajes con sus direcciones Bitcoin para demostrar la propiedad</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verificar mensajes comprobando que están firmados con direcciones Bitcoin concretas</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuración</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ayuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra de pestañas</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Solicitar pagos (generando códigos QR e identificadores URI \"bitcoin:\")</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostrar la lista de direcciones de envío y etiquetas</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Muestra la lista de direcciones de recepción y etiquetas</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Abrir un identificador URI \"bitcoin:\" o una petición de pago</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Opciones de consola de comandos</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n conexión activa hacia la red Bitcoin</numerusform><numerusform>%n conexiones activas hacia la red Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indexando bloques en disco...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Procesando bloques en disco...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n bloque procesado del historial de transacciones.</numerusform><numerusform>%n bloques procesados del historial de transacciones.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 atrás</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>El último bloque recibido fue generado hace %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Las transacciones posteriores aún no están visibles.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Aviso</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Actualizado</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Mostrar el mensaje de ayuda %1 para obtener una lista de los posibles comandos de linea de comandos de Bitcoin</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 cliente</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Conectando a pares...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Actualizando...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Fecha: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Amount: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipo: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etiqueta: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Dirección: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transacción enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacción entrante</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>La generación de claves HD está &lt;b&gt;activada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>La generación de claves HD está &lt;b&gt;desactivada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;desbloqueado&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>El monedero está &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;bloqueado&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Ha ocurrido un error fatal. Bitcoin no puede continuar de manera segura y se cerrará.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selección de la moneda</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cuantía:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Tasa:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de aplicar la comisión:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(des)marcar todos</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modo árbol</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modo lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Recibido con etiqueta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Recibido con dirección</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmaciones</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar ubicación</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID de transacción</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Bloquear lo no gastado</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Desbloquear lo no gastado</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar cuota</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar después de couta</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar polvo</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar cambio</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 bloqueado)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>sí</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Esta etiqueta se vuelve roja si algún destinatario recibe una cantidad inferior a la actual puerta polvorienta.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Puede variar +/- %1 satoshi(s) por entrada.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>cambia desde %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(cambio)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editar Dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>La etiqueta asociada con esta entrada de la lista de direcciones</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>La dirección asociada con esta entrada de la lista de direcciones. Solo puede ser modificada para direcciones de envío.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Dirección</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nueva dirección de recivimiento</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nueva dirección de envío</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Editar dirección de recivimiento</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Editar dirección de envío</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>La dirección introducida \"%1\" no es una dirección Bitcoin válida.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>La dirección introducida \"%1\" está ya en la agenda.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Podría no desbloquear el monedero.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Falló la generación de la nueva clave.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Se creará un nuevo directorio de datos.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nombre</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>El directorio ya existe. Añada %1 si pretende crear aquí un directorio nuevo.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>La ruta ya existe y no es un directorio.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>No se puede crear un directorio de datos aquí.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versión</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Acerda de %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opciones de la línea de órdenes</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uso:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opciones de la consola de comandos</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opciones de interfaz de usuario:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Elegir directorio de datos al iniciar (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Establecer el idioma, por ejemplo, \"es_ES\" (predeterminado: configuración regional del sistema)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Arrancar minimizado</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Establecer los certificados raíz SSL para solicitudes de pago (predeterminado: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Mostrar pantalla de bienvenida en el inicio (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Reiniciar todos los ajustes modificados en el GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bienvenido</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Bienvenido a %1</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Al ser la primera vez que se ejecuta el programa, puede elegir donde %1 almacenara sus datos</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Utilizar el directorio de datos predeterminado</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Utilizar un directorio de datos personalizado:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Error: no ha podido crearse el directorio de datos especificado \"%1\".</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB de espacio libre</numerusform><numerusform>%n GB de espacio disponible</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(de %n GB necesitados)</numerusform><numerusform>(de %n GB requeridos)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Las transacciones recientes podrían no ser visibles todavía, por lo que el balance de la cartera podría ser incorrecto. Esta información será correcta una vez su cartera se haya terminado de sincronizar con la red bitcoin, como se detalla más abajo.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Número de bloques restantes</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Desconocido...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora del último bloque</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progreso</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Incremento del progreso por hora</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>calculando...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Tiempo estimado restante hasta sincronización completa</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ocultar</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Desconocido. Sincronizando cabeceras (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Abrir URI...</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Abrir solicitud de pago a partir de un identificador URI o de un archivo</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Seleccionar archivo de sulicitud de pago</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Seleccionar el archivo de solicitud de pago para abrir</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Iniciar automaticamente  %1 al encender el sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Iniciar %1 al iniciar el sistema</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Tamaño de cache de la &amp;base de datos</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Número de hilos de &amp;verificación de scripts</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Dirección IP del proxy (p. ej. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimizar en lugar de salir de la aplicación cuando la ventana está cerrada. Cuando se activa esta opción, la aplicación sólo se cerrará después de seleccionar Salir en el menú.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Identificadores URL de terceros (por ejemplo, un explorador de bloques) que aparecen en la pestaña de transacciones como elementos del menú contextual. El %s en la URL es reemplazado por el valor hash de la transacción. Se pueden separar URL múltiples por una barra vertical |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Opciones activas de consola de comandos que tienen preferencia sobre las opciones anteriores:</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Restablecer todas las opciones predeterminadas del cliente.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Restablecer opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Red</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automático, &lt;0 = dejar libres ese número de núcleos)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Monedero</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Experto</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Habilitar funcionalidad de &amp;coin control</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Si desactiva el gasto del cambio no confirmado, no se podrá usar el cambio de una transacción hasta que se alcance al menos una confirmación. Esto afecta también a cómo se calcula su saldo.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Gastar cambio no confirmado</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Abrir automáticamente el puerto del cliente Bitcoin en el router. Esta opción solo funciona si el router admite UPnP y está activado.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapear el puerto mediante &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Conectarse a la red Bitcoin a través de un proxy SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Conectarse a través de proxy SOCKS5 (proxy predeterminado):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Dirección &amp;IP del proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Puerto:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Puerto del servidor proxy (ej. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Usado para alcanzar compañeros via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Conectar a la red Bitcoin mediante un proxy SOCKS5 por separado para los servicios ocultos de Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Ventana</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Minimizar la ventana a la bandeja de iconos del sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimizar a la bandeja en vez de a la barra de tareas</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimizar al cerrar</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Interfaz</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>I&amp;dioma de la interfaz de usuario</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>El idioma de la interfaz de usuario puede establecerse aquí. Esta configuración tendrá efecto tras reiniciar %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>Mostrar las cantidades en la &amp;unidad:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Elegir la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envían bitcoins.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Mostrar o no funcionalidad de Coin Control</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Aceptar</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancelar</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>predeterminado</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>ninguna</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirme el restablecimiento de las opciones</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Se necesita reiniciar el cliente para activar los cambios.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>El cliente se cerrará. ¿Desea continuar?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opciones de configuración</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Este cambio exige el reinicio del cliente.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>La dirección proxy indicada es inválida.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>La información mostrada puede estar desactualizada. Su monedero se sincroniza automáticamente con la red Bitcoin después de que se haya establecido una conexión, pero este proceso aún no se ha completado.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>De observación:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponible:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Su saldo disponible actual</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pendiente:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transacciones pendientes de confirmar y que aún no contribuye al saldo disponible</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>No madurado:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Saldo recién minado que aún no ha madurado.</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldos</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Su saldo actual total</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Su saldo actual en direcciones watch-only</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Gastable:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transacciones recientes</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Transacciones sin confirmar en direcciones watch-only</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Saldo minado en direcciones watch-only que aún no ha madurado</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Saldo total en las direcciones watch-only</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Fallo en la solicitud de pago</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>No se puede iniciar bitcoin: encargado click-para-pagar</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Manejo de URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>La búsqueda de solicitud de pago URL es válida: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Dirección de pago inválida %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI no puede ser analizado! Esto puede ser causado por una dirección Bitcoin inválida o parametros URI mal formados.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Manejo del archivo de solicitud de pago</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>¡El archivo de solicitud de pago no puede ser leído! Esto puede ser causado por un archivo de solicitud de pago inválido.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Solicitud de pago rechazada</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>La red de solicitud de pago no cimbina la red cliente.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Solicitud de pago caducada.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>La solicitud de pago no se ha iniciado.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Solicitudes de pago sin verificar a scripts de pago habitual no se soportan.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Solicitud de pago inválida.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Cantidad de pago solicitada de %1 es demasiado pequeña (considerado polvo).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Reembolsar desde %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Solicitud de pago de %1 es demasiado grande (%2 bytes, permitidos %3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Fallo al comunicar con %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>¡La solicitud de pago no puede ser analizada!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Mala respuesta desde el servidor %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Fallo de solicitud de red</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Pago declarado</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nodo/Servicio</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>NodeId</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recibido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Introducir una dirección Bitcoin (p. ej. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Ninguno</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 y %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 aún no ha salido de manera segura...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Error: directorio especificado \"%1\" no existe.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Error: no se puede interpretar el archivo de configuración: %1. Utilize exclusivamente sintaxis clave=valor.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Error: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Guardar imagen...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copiar imagen</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Guardar código QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imagen PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versión del cliente</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Información</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Ventana de depuración</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Utilizando la versión de BerkeleyDB</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Hora de inicio</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Red</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nombre</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Número de conexiones</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Cadena de bloques</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Número actual de bloques</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Piscina de Memoria</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Número actual de transacciones</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Uso de memoria</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recibido</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Pares</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Peers Bloqueados</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Seleccionar un par para ver su información detallada.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>En la lista blanca</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versión</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Importando bloques...</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Sincronizar Cabeceras</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Bloques Sincronizados</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Abrir el archivo de depuración %1 desde el directorio de datos actual. Puede tardar unos segundos para ficheros de gran tamaño.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Disminuir tamaño de letra</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Aumentar tamaño de letra</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Servicios</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Puntuación de bloqueo</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Duración de la conexión</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Ultimo envío</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Ultima recepción</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>La duración de un ping actualmente en proceso.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Espera de Ping</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Ping mín.</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Desplazamiento de tiempo</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora del último bloque</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Abrir</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Tráfico de Red</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Entrante:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Saliente:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Archivo de registro de depuración</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Borrar consola</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hora</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;día</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;semana</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;año</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Desconectar</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Bloqueado por</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Desbanear</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Bienvenido a la consola RPC %1.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Actividad de red desactivada</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(nodo: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nunca</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Entrante</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Saliente</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Sí</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>No</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Mensaje:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Un mensaje opcional para adjuntar a la solicitud de pago, que se muestra cuando se abre la solicitud. Nota: El mensaje no se enviará con el pago por la red Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Etiqueta opcional para asociar con la nueva dirección de recepción.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Utilice este formulario para solicitar pagos. Todos los campos son &lt;b&gt;opcionales&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Para solicitar una cantidad opcional. Deje este vacío o cero para no solicitar una cantidad específica.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Vaciar todos los campos del formulario.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Vaciar</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historial de pagos solicitados</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Solicitar pago</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Muestra la petición seleccionada (También doble clic)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostrar</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Borrar de la lista las direcciónes actualmente seleccionadas</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Eliminar</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copiar URL</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar capa</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copiar imagen</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Código QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copiar &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copiar &amp;Dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Guardar Imagen...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Solicitar pago a %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Información de pago</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensaje</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI resultante demasiado grande, trate de reducir el texto de etiqueta / mensaje.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Fallo al codificar URI en código QR.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensaje</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(no hay mensaje)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(no hay solicitud de cantidad)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Solicitado</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar bitcoins</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Características de Coin Control</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Entradas...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>Seleccionado automáticamente</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fondos insuficientes!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cuantía:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Tasa:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de tasas:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Si se marca esta opción pero la dirección de cambio está vacía o es inválida, el cambio se enviará a una nueva dirección recién generada.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Dirección propia</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Comisión de Transacción:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Elija...</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>Colapsar ajustes de cuota</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>por kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Si la tarifa de aduana se establece en 1000 satoshis y la transacción está a sólo 250 bytes, entonces \"por kilobyte\" sólo paga 250 satoshis de cuota, mientras que \"el mínimo total\" pagaría 1.000 satoshis. Para las transacciones más grandes que un kilobyte ambos pagan por kilobyte</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ocultar</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Pagando solamente la cuota mínima es correcto, siempre y cuando haya menos volumen de transacciones que el espacio en los bloques. Pero tenga en cuenta que esto puede terminar en una transacción nunca confirmada, una vez que haya más demanda para transacciones Bitcoin que la red pueda procesar.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(leer la sugerencia)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recomendado:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Personalizado:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Tarifa inteligente no inicializado aún. Esto generalmente lleva a pocos bloques...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Enviar a múltiples destinatarios de una vez</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Añadir &amp;destinatario</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Vaciar todos los campos del formulario</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Tiempo objetivo de confirmación:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Vaciar &amp;todo</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirmar el envío</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar cuota</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar después de couta</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar polvo</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar cambio</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 a %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>¿Seguro que quiere enviar?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>añadido como transacción de cuota</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Cantidad total %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>o</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirmar enviar monedas</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>La dirección de destinatario no es válida. Por favor revísela.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>La cantidad a pagar debe de ser mayor que 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>La cantidad excede su saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>El total excede su saldo cuando la cuota de transacción de %1 es incluida.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Dirección duplicada encontrada: la dirección sólo debería ser utilizada una vez por cada uso.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>¡Falló la creación de transacción!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Esta transacción fue rechazada por la siguiente razón: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Una couta mayor que %1 se considera una cuota irracionalmente alta.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Solicitud de pago caducada.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Pagar únicamente la cuota solicitada de %1</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Alerta: dirección Bitcoin inválida</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Alerta: dirección cambiada desconocida</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Confirmar dirección de cambio personalizada</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>La dirección que seleccionó para el cambio no es parte de esta cartera. Parte o la totalidad de los fondos de su cartera podrían ser enviados a esta dirección. ¿Está seguro?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Ca&amp;ntidad:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Pagar a:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escoger direcciones previamente usadas</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Esto es un pago ordinario.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Dirección Bitcoin a la que enviar el pago</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar dirección desde portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Eliminar esta transacción</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>La cuota será deducida de la cantidad que sea mandada. El destinatario recibirá menos bitcoins de los que entres en el  </translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>Restar comisiones a la cantidad</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mensaje:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Esta es una petición de pago no autentificada.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Esta es una petición de pago autentificada.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Introduce una etiqueta para esta dirección para añadirla a la lista de direcciones utilizadas</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Un mensaje que se adjuntó a la bitcoin: URL que será almacenada con la transacción para su referencia. Nota: Este mensaje no se envía a través de la red Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Paga a:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Introduzca una etiqueta para esta dirección para añadirla a su  agenda</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Sí</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 se esta cerrando...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>No apague el equipo hasta que desaparezca esta ventana.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Firmas - Firmar / verificar un mensaje</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Firmar mensaje</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Puede firmar los mensajes con sus direcciones para demostrar que las posee. Tenga cuidado de no firmar cualquier cosa de manera vaga o aleatoria, pues los ataques de phishing pueden tratar de engañarle firmando su identidad a través de ellos. Sólo firme declaraciones totalmente detalladas con las que usted esté de acuerdo.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Dirección Bitcoin con la que firmar el mensaje</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escoger dirección previamente usada</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar dirección desde portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Introduzca el mensaje que desea firmar aquí</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Firma</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copiar la firma actual al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Firmar el mensaje para demostrar que se posee esta dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Firmar &amp;mensaje</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Vaciar todos los campos de la firma de mensaje</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Vaciar &amp;todo</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verificar mensaje</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Introduzca la dirección para la firma, el mensaje (asegurándose de copiar tal cual los saltos de línea, espacios, tabulaciones, etc.) y la firma a continuación para verificar el mensaje. Tenga cuidado de no asumir más información de lo que dice el propio mensaje firmado para evitar fraudes basados en ataques de tipo man-in-the-middle. </translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>La dirección Bitcoin con la que se firmó el mensaje</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verificar el mensaje para comprobar que fue firmado con la dirección Bitcoin indicada</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verificar &amp;mensaje</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Vaciar todos los campos de la verificación de mensaje</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Click en \"Fírmar mensaje\" para generar una firma</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>La dirección introducida no es válida.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Por favor revise la dirección e inténtelo de nuevo.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>La dirección introducida no remite a una clave.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>El desbloqueo del monedero fue cancelado.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>La clave privada de la dirección introducida no está disponible.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Falló la firma del mensaje.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Mensaje firmado.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>La firma no pudo descodificarse.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Por favor compruebe la firma y pruebe de nuevo.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>La firma no se combinó con el mensaje.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Falló la verificación del mensaje.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Mensaje verificado.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Abierto hasta %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>Hay un conflicto con la traducción de las confirmaciones %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/sin conexión</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/no confirmado, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>en el equipo de memoria</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>no en el equipo de memoria</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandonado</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/no confirmado</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>confirmaciones %1</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Estado</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, no ha sido emitido con éxito aún</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Fuente</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generado</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Desde</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Para</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>dirección propia</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>de observación</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiqueta</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Credito</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>no aceptada</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Total enviado</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Total recibido</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Comisión de transacción</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Cantidad neta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensaje</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comentario</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Identificador de transacción (ID)</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Tamaño total de la transacción</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Indice de salida</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Vendedor</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Los bitcoins generados deben madurar %1 bloques antes de que puedan gastarse. Cuando generó este bloque, se transmitió a la red para que se añadiera a la cadena de bloques. Si no consigue entrar en la cadena, su estado cambiará a \"no aceptado\" y ya no se podrá gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque a pocos segundos del suyo.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Información de depuración</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transacción</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>entradas</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>verdadero</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>falso</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Esta ventana muestra información detallada sobre la transacción</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detalles para %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Abierto hasta %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Sin conexion</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Sin confirmar</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandonado</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirmando (%1 de %2 confirmaciones recomendadas)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmado (%1 confirmaciones)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>En conflicto</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>No disponible (%1 confirmaciones. Estarán disponibles al cabo de %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Este bloque no ha sido recibido por otros nodos y probablemente no sea aceptado!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generado pero no aceptado</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recibido con</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Recibidos de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviado a</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pago proprio</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minado</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>de observación</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(nd)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Estado de transacción. Pasa el ratón sobre este campo para ver el número de confirmaciones.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Fecha y hora en que se recibió la transacción.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipo de transacción.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Si una dirección watch-only está involucrada en esta transacción o no.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Descripción de la transacción definido por el usuario.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Cantidad retirada o añadida al saldo.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Todo</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Hoy</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Esta semana</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Este mes</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Mes pasado</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Este año</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Rango...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recibido con</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviado a</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>A usted mismo</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minado</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Otra</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Cantidad mínima</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Transacción abandonada</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar ubicación</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar capa</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID de transacción</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copiar transacción raw</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copiar todos los detalles de la transacción</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Editar etiqueta</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Mostrar detalles de la transacción</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exportar historial de transacciones</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Archivo separado de coma (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>De observación</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Dirección</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Falló la exportación</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Ha habido un error al intentar guardar la transacción con %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exportación finalizada</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>La transacción ha sido guardada en %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Rango:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>para</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unidad en la que se muestran las cantidades. Haga clic para seleccionar otra unidad.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>No se ha cargado ningún monedero</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar a un archivo los datos de esta pestaña</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Copia de seguridad del monedero</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Datos de monedero (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>La copia de seguridad ha fallado</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Ha habido un error al intentar guardar los datos del monedero en %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Se ha completado con éxito la copia de respaldo</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Los datos del monedero se han guardado con éxito en %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opciones:\n</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especificar directorio para los datos</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Conectar a un nodo para obtener direcciones de pares y desconectar</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especifique su propia dirección pública</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Aceptar comandos consola y JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Si &lt;category&gt; no es proporcionado o si &lt;category&gt; =1, muestra toda la información de depuración.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>La Poda se ha configurado por debajo del minimo de %d MiB. Por favor utiliza un valor mas alto.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Poda:  la ultima sincronizacion de la cartera sobrepasa los datos podados. Necesitas reindexar con -reindex (o descargar la cadena de bloques de nuevo en el caso de un nodo podado)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Nos es posible re-escanear en modo podado.Necesitas utilizar -reindex el cual descargara la cadena de bloques al completo de nuevo.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Un error interno fatal ocurrió, ver debug.log para detalles</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Comisión (en %s/KB) para agregar a las transacciones que envíe (por defecto: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Poda blockstore ...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Ejecutar en segundo plano como daemon y aceptar comandos\n</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>No se ha podido comenzar el servidor HTTP. Ver debug log para detalles.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Los %s desarrolladores</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Una comision (en %s/kB) que sera usada cuando las estimacion de comision no disponga de suficientes datos (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Aceptar transacciones retransmitidas recibidas desde nodos en la lista blanca incluso cuando no estés retransmitiendo transacciones (predeterminado: %d)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Vincular a la dirección dada y escuchar siempre en ella. Utilice la notación [host]:port para IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>No se puede bloquear el directorio %s. %s ya se está ejecutando.</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Borrar todas las transacciones del monedero y sólo recuperar aquellas partes de la cadena de bloques por medio de -rescan on startup.</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Error leyendo %s!. Todas las claves se han leido correctamente, pero los datos de transacciones o la libreta de direcciones pueden faltar o ser incorrectos.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Ejecutar comando cuando una transacción del monedero cambia (%s en cmd se remplazará por TxID)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Ajuste máximo permitido del tiempo offset medio de pares. La perspectiva local de tiempo se verá influenciada por los pares anteriores y posteriores a esta cantidad. (Por defecto: %u segundos)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Máximas comisiones totales (en %s) para utilizar en una sola transacción de la cartera; establecer esto demasiado bajo puede abortar grandes transacciones (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Por favor, compruebe si la fecha y hora en su computadora son correctas! Si su reloj esta mal, %s no trabajara correctamente. </translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Contribuya si encuentra %s de utilidad. Visite %s para mas información acerca del programa.</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Establecer el número de hilos (threads) de verificación de scripts (entre %u y %d, 0 = automático, &lt;0 = dejar libres ese número de núcleos; predeterminado: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>La base de datos de bloques contiene un bloque que parece ser del futuro. Esto puede ser porque la fecha y hora de tu ordenador están mal ajustados. Reconstruye la base de datos de bloques solo si estas seguro de que la fecha y hora de tu ordenador estan ajustados correctamente.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>No es posible reconstruir la base de datos a un estado anterior. Debe descargar de nuevo la cadena de bloques.</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Utiliza UPnP para asignar el puerto de escucha (predeterminado: 1 cuando esta escuchando sin -proxy)</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>La cartera no creara transacciones que violan los limites de memoria de la cadena (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s corrupto. Fracasó la recuperacion</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool debe ser por lo menos de %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; puede ser:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Aceptar conexiones desde el exterior (predeterminado: 1 si no -proxy o -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Adjunta un comentario a la linea de agente de usuario</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Intento de recuperar claves privadas de un monedero corrupto en arranque</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opciones de creación de bloques:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>No se puede resolver -%s direccion: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Opciones de selección de cadena:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Cambio de indice fuera de rango</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opciones de conexión:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Corrupción de base de datos de bloques detectada.</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opciones de depuración/pruebas:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>No cargar el monedero y desactivar las llamadas RPC del monedero</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>¿Quieres reconstruir la base de datos de bloques ahora?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Activar publicar bloque .hash en &lt;.Address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Activar publicar transacción .hash en &lt;.Address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Habilita la publicacion de bloques en bruto en &lt;direccion&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Habilitar publicar transacción en rama en &lt;dirección&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Habilita el reemplazamiento de transacciones en la piscina de memoria (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error al inicializar la base de datos de bloques</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error al inicializar el entorno de la base de datos del monedero  %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Error cargando %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Error cargando %s: Monedero dañado</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Error cargando %s: Monedero requiere un versión mas reciente de %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Error cargando base de datos de bloques</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Error al abrir base de datos de bloques.</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Error: ¡Espacio en disco bajo!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Ha fallado la escucha en todos los puertos. Use -listen=0 si desea esto.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importando...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Incorrecto o bloque de génesis no encontrado. Datadir equivocada para la red?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>La inicialización de la verificación de validez falló. Se está apagando %s.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Cantidad no valida para -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Cantidad inválida para -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Mantener la memoria de transacciones por debajo de &lt;n&gt; megabytes (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Cargando banlist...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Ubicación de la cookie de autenticación (default: data dir)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>No hay suficientes descriptores de archivo disponibles. </translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Sólo conectar a nodos en redes &lt;net&gt; (ipv4, ipv6 o onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Imprimir este mensaje de ayuda y salir</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Imprimir versión y salir</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Pode no se puede configurar con un valor negativo.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>El modo recorte es incompatible con -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Reconstruir el estado de la cadena e indice de bloques a partir de los ficheros blk*.dat en disco</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Reconstruir el estado de la cadena a partir de los bloques indexados</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Verificando bloques...</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Asignar tamaño de cache en megabytes (entre %d y %d; predeterminado: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Especificar archivo de monedero (dentro del directorio de datos)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>El código fuente esta disponible desde %s.</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>No se ha podido conectar con %s en este equipo. %s es posible que este todavia en ejecución.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>El argumento -benchmark no es soportado y ha sido ignorado, utiliza -debug=bench</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Parámetros no compatibles -debugnet ignorados , use -debug = red.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Parámetros no compatibles -tor encontrados, use -onion .</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Usar UPnP para asignar el puerto de escucha (predeterminado:: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Utilizar la cadena de test</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>El comentario del Agente de Usuario (%s) contiene caracteres inseguros.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verificando bloques...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Opciones de depuración/pruebas de monedero:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Es necesario reescribir el monedero: reiniciar %s para completar</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opciones de monedero:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Permitir conexiones JSON-RPC de origen especificado. Válido para son una sola IP (por ejemplo 1.2.3.4), una red/máscara de red (por ejemplo 1.2.3.4/255.255.255.0) o una red/CIDR (e.g. 1.2.3.4/24). Esta opción se puede especificar varias veces</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Ligar a las direcciones especificadas y poner en lista blanca a los equipos conectados a ellas. Usar la notación para IPv6 [host]:puerto.</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Crear nuevos archivos con permisos por defecto del sistema, en lugar de umask 077 (sólo efectivo con la funcionalidad de monedero desactivada)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Descubra direcciones IP propias (por defecto: 1 cuando se escucha y nadie -externalip o -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Error: la escucha para conexiones entrantes falló (la escucha regresó el error %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Ejecutar un comando cuando se reciba una alerta importante o cuando veamos un fork demasiado largo (%s en cmd se reemplazará por el mensaje)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Las comisiones (en %s/kB) mas pequeñas que esto se consideran como cero comisión para la retransmisión, minería y creación de la transacción (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Si el pago de comisión no está establecido, incluir la cuota suficiente para que las transacciones comiencen la confirmación en una media de n bloques ( por defecto :%u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Cantidad no válida para -maxtxfee=&lt;amount&gt;: '%s' (debe ser por lo menos la cuota de comisión mínima de %s para prevenir transacciones atascadas)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>El tamaño máximo de los datos en las operaciones de transporte de datos que transmitimos y el mio (default: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Aleatorizar las credenciales para cada conexión proxy. Esto habilita la Tor stream isolation (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Monto de transacción muy pequeña luego de la deducción por comisión</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>A los equipos en lista blanca no se les pueden prohibir los ataques DoS y sus transacciones siempre son retransmitidas, incluso si ya están en el mempool, es útil por ejemplo para un gateway.</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Necesitas reconstruir la base de datos utilizando -reindex para volver al modo sin recorte. Esto volverá a descargar toda la cadena de bloques</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Aceptar solicitudes públicas en FERIADOS (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Automáticamente crea el servicio Tor oculto (por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Conectar usando SOCKS5 proxy</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Error al leer la base de datos, cerrando.</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importa los bloques desde un archivo externo blk000?.dat</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Cantidad inválida para -paytxfee=&lt;amount&gt;: '%s' (debe ser por lo menos %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Máscara de red inválida especificada en -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Mantener como máximo &lt;n&gt; transacciones no conectables en memoria (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Necesita especificar un puerto con -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Opciones de nodos de retransmisión:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opciones de servidor RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reduciendo -maxconnections de %d a %d, debido a limitaciones del sistema.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Rescanea la cadena de bloques para transacciones perdidas de la cartera</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Muestra todas las opciones de depuración (uso: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Transacción falló</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Cantidad de la transacción demasiado pequeña para pagar la comisión</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Este software es experimental.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Contraseña del puerto de control de Tor (predeterminado: vacio)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Puerto de control de Tor a utilizar si la escucha de onion esta activada (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Cantidad de la transacción demasiado pequeña</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Operación demasiado grande para la política de tasas</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transacción demasiado grande, intenta dividirla en varias.</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>No es posible conectar con %s en este sistema (bind ha dado el error %s)</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Actualizar el monedero al último formato al inicio</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nombre de usuario para las conexiones JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Aviso</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Advertencia: nuevas reglas desconocidas activadas (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Si se debe o no operar en un modo de solo bloques (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Eliminando todas las transacciones del monedero...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Opciones de notificación ZeroQM:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Contraseña para las conexiones JSON-RPC\n</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Ejecutar un comando cuando cambia el mejor bloque (%s en cmd se sustituye por el hash de bloque)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permitir búsquedas DNS para -addnode, -seednode y -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = mantener los meta datos de transacción, por ejemplo: propietario e información de pago, 2 = omitir los metadatos)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee tiene un ajuste muy elevado! Comisiones muy grandes podrían ser pagadas en una única transaccion.</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>No mantener transacciones en la memoria mas de &lt;n&gt; horas (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Bytes equivalentes por sigop en transacciones para retrasmisión y minado (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Las comisiones (en %s/kB) menores que esto son consideradas de cero comision para la creacion de transacciones (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Fuerza la retransmisión de transacciones desde nodos en la lista blanca incluso si violan la política de retransmisiones local (predeterminado: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Nivel de rigor en la verificación de bloques de -checkblocks (0-4; predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Mantener el índice completo de transacciones, usado por la llamada rpc de getrawtransaction  (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Mostrar depuración (por defecto: %u, proporcionar &lt;category&gt; es opcional)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Admite filtrado de bloques, y transacciones con filtros Bloom. Reduce la carga de red. ( por defecto :%u)</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Esta es la comisión que debe pagar cuando la estimación de comisión no esta disponible.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>La longitud total de la cadena de versión de red ( %i ) supera la longitud máxima ( %i ) . Reducir el número o tamaño de uacomments .</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Error:  argumento -socks encontrado. El ajuste de la versión SOCKS ya no es posible, sólo proxies SOCKS5 son compatibles.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>El argumento no soportado -whitelistalwaysrelay ha sido ignorado, utiliza -whitelistrelay  y/o -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Usar distintos proxys SOCKS5 para comunicarse vía Tor de forma anónima (Por defecto: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Advertencia: Se están minando versiones de bloques desconocidas! Es posible que normas desconocidas estén activas</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Aviso: fichero de monedero corrupto, datos recuperados! Original %s guardado como %s en %s; si su balance de transacciones es incorrecto, debe restaurar desde una copia de seguridad.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s es demasiado alto!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Siempre consultar direcciones de otros equipos por medio de DNS lookup (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Cuántos bloques comprobar al iniciar (predeterminado: %u, 0 = todos)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Incluir direcciones IP en la salida de depuración (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escuchar conexiones JSON-RPC en &lt;puerto&gt; (predeterminado: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escuchar conexiones en &lt;puerto&gt; (predeterminado: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Mantener como máximo &lt;n&gt; conexiones a pares (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Realiza las operaciones de difusión del monedero</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Búfer de recepción máximo por conexión, &lt;n&gt;*1000 bytes (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Búfer de recepción máximo por conexión, , &lt;n&gt;*1000 bytes (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Anteponer marca temporal a la información de depuración (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Retransmitir y minar transacciones de transporte de datos (por defecto: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Relay non-P2SH multisig (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Ajustar el número de claves en reserva &lt;n&gt; (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Establecer peso máximo bloque BIP141  (predeterminado: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Establecer el número de procesos para llamadas del servicio RPC (por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Especificar archivo de configuración (por defecto: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Especificar tiempo de espera de la conexión (mínimo: 1, por defecto: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Especificar archivo pid (predeterminado: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Usar cambio aún no confirmado al enviar transacciones (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Iniciando funciones de red...</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Esta es la comisión minima que paga en cada transacción.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Esta es la comisión que pagará si envia la transacción.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Umbral para la desconexión de pares con mal comportamiento (predeterminado: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Las cantidades de las transacciones no pueden ser negativas.</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>La transacción debe tener al menos un beneficiario</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>La red especificada en -onlynet '%s' es desconocida</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fondos insuficientes</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Cargando el índice de bloques...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Cargando monedero...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>No se puede cambiar a una versión mas antigua el monedero</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Reexplorando...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Se terminó de cargar</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_es_MX.ts",
    "content": "<TS language=\"es_MX\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Click derecho para editar tu dirección o etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crear una dirección nueva</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuevo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiar la dirección seleccionada al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Cerrar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Eliminar la dirección actualmente seleccionada de la lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar la información en la tabla actual a un archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Borrar</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Elija la direccion a donde se enviaran las monedas</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Elija la dirección para recibir monedas.</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Elija</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Direcciones de Envio</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Direcciones de recibo</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estas son tus direcciones de Bitcoin para enviar pagos. Siempre revisa el monto y la dirección de envío antes de enviar monedas.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Estas son sus direcciones de Bitcoin para recibir pagos. Se recomienda utilizar una nueva dirección de recepción para cada transacción.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copiar dirección</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>copiar y etiquetar</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>Editar</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportar lista de direcciones </translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialogo de contraseña</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Ingrese la contraseña</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repita la nueva contraseña</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Máscara de red</translation>\n    </message>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Firmar &amp;mensaje</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizando con la red...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Vista previa</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nodo</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostrar la vista previa general de la cartera</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transacciones</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Explorar el historial de transacciones</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>S&amp;alir</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Salir de la aplicación</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Acerca de &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostrar información acerca de Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Encriptar cartera</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Respaldar cartera</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Cambiar contraseña...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Direcciones de &amp;envío...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Direcciones de &amp;recepción...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Abrir &amp;URL...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexando bloques en el disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviar monedas a una dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Respaldar cartera en otra ubicación</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambiar la contraseña usada para la encriptación de la cartera</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Depurar ventana</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Abrir consola de depuración y diagnostico</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verificar mensaje...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Cartera</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Recibir</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mostrar / Ocultar</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuraciones</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ayuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Pestañas</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>opciones de la &amp;Linea de comandos</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Aviso</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información </translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Actualizado al dia </translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Recibiendo...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Enviar Transacción</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacción entrante</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>La cartera esta &lt;b&gt;encriptada&lt;/b&gt; y &lt;b&gt;desbloqueada&lt;/b&gt; actualmente </translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>La cartera esta &lt;b&gt;encriptada&lt;/b&gt; y &lt;b&gt;bloqueada&lt;/b&gt; actualmente </translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Monto:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Cuota:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de los cargos por comisión. </translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Monto</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado </translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editar dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Dirección</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>nombre</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versión</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>opciones de la Linea de comandos</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uso:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>Opciones de comando de lineas</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opciones</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Activar las opciones de linea de comando que sobre escriben las siguientes opciones:</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Cartera</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>Ninguno </translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Monto</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>Debug window</source>\n        <translation>Depurar ventana</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Monto:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Mensaje:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Mensaje opcional para agregar a la solicitud de pago, el cual será mostrado cuando la solicitud este abierta. Nota: El mensaje no se manda con el pago a travéz de la red de Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Use este formulario para la solicitud de pagos. Todos los campos son &lt;b&gt;opcionales&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Monto opcional a solicitar. Dejarlo vacion o en cero no solicita un monto especifico.</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Copiar dirección</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar monedas</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Monto:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Cuota:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Después de los cargos por comisión. </translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Enviar a múltiples receptores a la vez</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirme la acción de enviar</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>M&amp;onto</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Pagar &amp;a:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Este es un pago normal</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar dirección  del portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Quitar esta entrada</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mensaje:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pago para:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>No apague su computadora hasta que esta ventana desaparesca.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar dirección  del portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Firma</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Este panel muestras una descripción detallada de la transacción</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar monedas</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar la información en la pestaña actual a un archivo</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opciones:</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>nucleo Bitcoin</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;categoria&gt; puede ser:</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verificando bloques...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opciones de cartera:</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información </translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Aviso</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Cargando indice de bloques... </translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Cargando billetera...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Carga completa</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_es_UY.ts",
    "content": "<TS language=\"es_UY\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Clic derecho para editar dirección o etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crear una nueva dirección </translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>Nuevo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copia la dirección seleccionada al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Cerrar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Eliminar la dirección seleccionada de la lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar los datos en la pestaña actual a un archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Borrar</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Escriba la contraseña</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nueva contraseña</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repetir nueva contraseña</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizando con la red...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Vista previa</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostrar descripción general del monedero</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;transaciones </translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Buscar en el historial de transacciones</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Salida</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Salir de la aplicacion </translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostrar informacioón sobre</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opciones...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Respaldar Billetera</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Cambiar contraseña</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Enviando direcciones</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Recibiendo direcciones</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviar monedas a una dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambie la clave utilizada para el cifrado del monedero</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Billetera</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>Mostrar / Ocultar</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuracion </translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ayuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra de herramientas</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Alerta</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>A la fecha</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Ponerse al dia...</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipo: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Dirección: %1</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transaccion enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacción entrante</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>El Monedero esta &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;desbloqueado&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>El Monedero esta &lt;b&gt;cifrado&lt;/b&gt; y actualmente &lt;b&gt;bloqueado&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>AMonto:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editar dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Direccion </translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opciones</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Tamaño del cache de la &amp;base de datos</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Billetera</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>unknown</source>\n        <translation>desconocido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Información</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copiar Dirección</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar monedas</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>AMonto:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Enviar a varios destinatarios a la vez</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balance:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirmar el envío</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>A&amp;Monto:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Pagar &amp;A:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar la dirección desde el portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pagar A:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar la dirección desde el portapapeles</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[prueba_de_red]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar los datos en la pestaña actual a un archivo</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opciones:</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Alerta</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_es_VE.ts",
    "content": "<TS language=\"es_VE\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Click derecho para editar la dirección o etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crear una nueva dirección</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuevo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copie las direcciones seleccionadas actualmente al portapapeles del sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;errar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Borrar las direcciones seleccionadas recientemente de la lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar los datos en la pestaña actual a un archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Borrar</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Escoja la direccion a enviar las monedas</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Elige la dirección para recibir monedas</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Envío de direcciones</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Direcciones de recepción</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estas son tus direcciones Bitcoin para realizar pagos. Verifica siempre el monto y la dirección de recepción antes de enviar monedas. </translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Estas son tus direcciones Bitcoin para recibir pagos. Es recomendable usar una nueva dirección de recibo para cada transacción.</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copiar &amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Editar</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportar lista de direcciones</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diálogo contraseña</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Ingresa frase de contraseña</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nueva frase de contraseña</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repetir nueva frase de contraseña</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Firmar &amp;mensaje...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizando con la red...</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nodo</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostrar visión general de la billetera</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transacciones</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Buscar historial de transacciones</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>S&amp;alir</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Quitar aplicación</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opciones...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Recepción de direcciones</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexando bloques en el disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviar monedas a una dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Respaldar billetera en otra ubicación</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambiar frase secreta usada para la encriptación de la billetera</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Abre la consola de depuración y diágnostico</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Billetera</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Recibir</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mostar / Ocultar</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostar u ocultar la ventana principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Encriptar las llaves privadas que pertenecen a tu billetera</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Firma mensajes con tus direcciones Bitcoin para probar que eres dueño de ellas</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verificar mensajes para asegurar que estaban firmados con direcciones Bitcoin especificas</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Archivo</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuración</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opciones de línea de comandos</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 detrás</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>El último bloque recibido fue generado hace %1 hora(s).</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transacciones después de esta no serán visibles todavía.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Advertencia</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Al día</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Alcanzando...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transacción enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacción entrante</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>La billetera está encriptada y desbloqueada recientemente</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>La billetera está encriptada y bloqueada recientemente</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selección de moneda</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Monto:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comisión:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(de)seleccionar todo</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modo de árbol</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modo de lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Monto</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Recibido con etiqueta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Recibido con dirección</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Fecha</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmaciones</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar comisión</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar cambio</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>si</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editar dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>La etiqueta asociada con esta entrada de la lista de direcciones</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>La dirección asociada con esta entrada de la lista de direcciones. Esta puede ser modificada solo para el envío de direcciones.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Dirección</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Un nuevo directorio de datos será creado.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nombre</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>El directorio ya existe. Agrega %1 si tiene la intención de crear un nuevo directorio aquí.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>La ruta ya existe, y no es un directorio.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>No puede crear directorio de datos aquí.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versión</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opciones de línea de comandos</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uso:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opciones de línea de comandos</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bienvenido</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Bienvenido a %1.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Usar el directorio de datos por defecto</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Usa un directorio de datos personalizado:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Error: Directorio de datos especificado \"%1\" no puede ser creado.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Abrir URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Abrir solicitud de pago desde URI o archivo</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Seleccionar archivo de solicitud de pago</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opciones</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Main</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Red</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Billetera</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Experto</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>ninguno</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Available:</source>\n        <translation>Disponible:</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pendiente:</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Monto</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 y %2</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Entrada:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Salida:</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Monto:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostrar</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Copiar Dirección</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidad:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Monto:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comisión:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Polvo:</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar cantidad</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar comisión</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar cambio</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Monto:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(sin etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opciones:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especifique directorio de datos</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Conecte un nodo para recuperar direcciones pares, y desconecte</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especifique su propia dirección pública</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Aceptar linea de comando y comandos JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Correr en segundo plano como daemon y aceptar comandos</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Enlazar dirección dada y siempre escuchar en ella. Usar [host]:port notación para IPv6</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Borrar todas las transacciones de la billetera y solo recuperar aquellas partes de la cadena de bloques a través de -rescan en el inicio del sistema.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Ejecutar comando cuando una transacción de la billetera cambia (%s en cmd es reemplazado por TxID)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Fija el número de verificación de hilos de script (%u a %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transacción muy pequeña</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transacción muy grande</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Advertencia</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Esta es la tarifa mínima a pagar en cada transacción.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Esta es la tarifa a pagar si realizas una transacción.</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Los montos de la transacción no debe ser negativo</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>La transacción tiene largo tiempo en una cadena mempool</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>La transacción debe tener al menos un destinatario</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fondos insuficientes</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Cargando monedero...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>No se puede rebajar monedero</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Escaneando...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Carga lista</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_et.ts",
    "content": "<TS language=\"et\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Paremkliki aadressi või sildi muutmiseks</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Loo uus aadress</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Uus</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopeeri märgistatud aadress vahemällu</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopeeri</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>S&amp;ulge</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Kustuta märgistatud aadress loetelust</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Ekspordi kuvatava vahelehe sisu faili</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Ekspordi</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Kustuta</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Vali aadress millele mündid saata</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Vali aadress müntide vastuvõtmiseks</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>V&amp;ali</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Saatvad aadressid</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Vastuvõtvad aadressid</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Need on sinu Bitcoin aadressid maksete saatmiseks. Ennem müntide saatmist kontrolli alati summat ja makse saaja aadressi.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Need on sinu Bitcoin aadressid sisenevate maksete vastu võtmiseks. Soovitav on iga tehingu tarbeks kasutada uut aadressi.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopeeri Aadress</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopeeri &amp;Silt</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Muuda</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Ekspordi Aadresside Nimekiri</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Komadega eraldatud väärtuste fail (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksport ebaõnnestus.</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Tõrge aadressi nimekirja salvestamisel %1. Palun proovi uuesti.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Märge</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Aadress</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(märge puudub)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Salafraasi dialoog</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Sisesta salafraas</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Uus salafraas</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Korda salafraasi</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Sisesta uus salafraas rahakotti.&lt;br/&gt;Kasuta salafraasi millles on&lt;b&gt;kümme või rohkem juhuslikku sümbolit&lt;b&gt;,või&lt;b&gt;kaheksa või rohkem sõna&lt;b/&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Krüpteeri rahakott</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Antud operatsioon vajab rahakoti lahtilukustamiseks salafraasi.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Ava rahakoti lukk</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Antud operatsioon vajab rahakoti dekrüpteerimiseks salafraasi.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dekrüpteeri rahakott</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Vaheta salafraasi</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Sisesta vana salafraas ja uus salafraas rahakotti.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Kinnita rahakoti krüpteerimine.</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Hoiatus:Kui sa krüpteerid oma rahakoti ja kaotad salafraasi, siis sa&lt;b&gt;KAOTAD OMA BITCOINID&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Kas oled kindel, et soovid rahakoti krüpteerida?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Rahakott krüpteeritud</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Rahakoti krüpteerimine ebaõnnestus</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Rahakoti krüpteerimine ebaõnnestus sisemise tõrke tõttu. Sinu rahakott ei ole krüpteeritud.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Sisestatud salafraasid ei kattu.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Rahakoti lahtilukustamine ebaõnnestus</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Rahakoti dekrüpteerimiseks sisestatud salafraas ei ole õige.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Rahakoti dekrüpteerimine ebaõnnestus</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Rahakoti salafraas on edukalt vahetatud.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Hoiatus:Klaviatuuri suurtähelukk on peal.</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Võrgumask</translation>\n    </message>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signeeri &amp;sõnum</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Võrgusünkimine...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Ülevaade</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Kuva rahakoti üld-ülevaade</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Tehingud</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Sirvi tehingute ajalugu</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>V&amp;älju</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Väljumine</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Teave %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Teave &amp;Qt kohta</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Kuva Qt kohta käiv info</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Valikud...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Krüpteeri Rahakott</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Varunda Rahakott</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Salafraasi muutmine</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Ava &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Kettal olevate blokkide re-indekseerimine...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Saada münte Bitcoini aadressile</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Varunda rahakott teise asukohta</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Rahakoti krüpteerimise salafraasi muutmine</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Silumise aken</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Ava debugimise ja diagnostika konsool</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Kontrolli sõnumit...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Rahakott</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Saada</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Võta vastu</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Näita / Peida</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Näita või peida peaaken</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Krüpteeri oma rahakoti privaatvõtmed</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Omandi tõestamiseks allkirjasta sõnumid oma Bitcoini aadressiga</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Kinnita sõnumid kindlustamaks et need allkirjastati määratud Bitcoini aadressiga</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fail</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Seaded</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Abi</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Vahelehe tööriistariba</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Loo maksepäring (genereerib QR koodid ja bitcoini: URId)</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Ava bitcoini: URI või maksepäring</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Käsurea valikud</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktiivne ühendus Bitcoini võrku</numerusform><numerusform>%n aktiivset ühendust Bitcoini võrku</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Kõvakettal olevate plokkide indekseerimine...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Kõvakettal olevate plokkide töötlemine...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Töödeldud %n plokk transaktsioonide ajaloost.</numerusform><numerusform>Töödeldud %n plokki transaktsioonide ajaloost.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 maas</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Viimane saabunud blokk loodi %1 tagasi.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Peale seda ei ole tehingud veel nähtavad.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Tõrge</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Hoiatus</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informatsioon</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Ajakohane</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 klient</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Jõuan järgi...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Kuupäev: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Summa: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tüüp: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>&amp;Märgis: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Aadress: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Saadetud tehing</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Sisenev tehing</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Rahakott on &lt;b&gt;krüpteeritud&lt;/b&gt; ning hetkel &lt;b&gt;avatud&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Rahakott on &lt;b&gt;krüpteeritud&lt;/b&gt; ning hetkel &lt;b&gt;suletud&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kogus:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Baiti:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Summa:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Tasu:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Puru:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Peale tehingutasu:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Vahetusraha:</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Puu režiim</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Loetelu režiim</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kogus</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Vastuvõetud märgisega</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Vastuvõetud aadressiga</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Kuupäev</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Kinnitused</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Kinnitatud</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopeeri aadress</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopeeri märgis</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopeeri summa</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopeeri tehingu ID</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopeeri kogus</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopeeri tehingutasu</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopeeri baidid</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopeeri puru</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopeeri vahetusraha</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 lukustatud)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>jah</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>ei</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(märgis puudub)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(vahetusraha)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Muuda aadressi</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Märgis</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Aadress</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Uus vastu võttev aadress</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Uus saatev aadress</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Muuda vastuvõtvat aadressi</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Muuda saatvat aadressi</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Sisestatud aadress \"%1\" ei ole korrektne Bitcoin aadress.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Sisestatud aadress \"%1\" on juba aadressi raamatus.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Rahakoti lahtilukustamine ebaõnnestus.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Uue võtme genereerimine ebaõnnestus.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>nimi</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versioon</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Käsurea valikud</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Kasutus:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>käsurea valikud</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Kasutajaliidese Suvandid:</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Käivitamisel kuva laadimisekraani (vaikimisi %u)</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Teretulemast</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Tõrge</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Vorm</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Viimane ploki aeg</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Peida</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Ava URI</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Vali maksepäringu fail</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Vali maksepäringu fail mida avada</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Valikud</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Peamine</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Taasta kõik klientprogrammi seadete vaikeväärtused.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Lähtesta valikud</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Võrk</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>R&amp;ahakott</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Ekspert</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Bitcoini kliendi pordi automaatne avamine ruuteris. Toimib, kui sinu ruuter aktsepteerib UPnP ühendust.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Suuna port &amp;UPnP kaudu</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxi &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Proxi port (nt 9050)</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Aken</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Minimeeri systray alale.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimeeri systray alale</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimeeri sulgemisel</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Kuva</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Kasutajaliidese &amp;keel:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>Summade kuvamise &amp;Unit:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Vali liideses ning müntide saatmisel kuvatav vaikimisi alajaotus.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Katkesta</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>vaikeväärtus</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>puudub</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Kinnita valikute algseadistamine</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Tõrge</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Sisestatud kehtetu proxy aadress.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Vorm</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Kuvatav info ei pruugi olla ajakohane. Ühenduse loomisel süngitakse sinu rahakott automaatselt Bitconi võrgustikuga, kuid see toiming on hetkel lõpetamata.</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Ootel:</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Ebaküps:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Mitte aegunud mine'itud jääk</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Kokku:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Hiljutised tehingud</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Maksepäringu tõrge</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Maksepäring tagasi lükatud</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Maksepäring aegunud.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Kinnitamata maksepäringud kohandatud makse scriptidele ei ole toetatud.</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>Saadetud</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Vastuvõetud</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Kogus</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n tund</numerusform><numerusform>%n tundi</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n päev</numerusform><numerusform>%n päeva</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n nädal</numerusform><numerusform>%n nädalat</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 ja %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n aasta</numerusform><numerusform>%n aastat</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>tundmatu</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Salvesta QR Kood</translation>\n    </message>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Kliendi versioon</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informatsioon</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Debugimise aken</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Üldine</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Kasutab BerkeleyDB versiooni</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Käivitamise hetk</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Võrgustik</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nimi</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Ühenduste arv</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Ploki jada</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Plokkide hetkearv</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Mälu kasutus</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Lähtesta</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Vastuvõetud</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Saadetud</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Suund</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versioon</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Sünkroniseeritud Päised</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Sünkroniseeritud Plokid</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Teenused</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Viimane ploki aeg</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Ava</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsool</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Silumise logifail</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Puhasta konsool</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Sisenev</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Väljuv</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Jah</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Ei</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Teadmata</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Summa:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Märgis</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Sõnum:</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Puhasta kõik vormi väljad.</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Näita</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Eemalda</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopeeri märgis</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopeeri sõnum</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopeeri summa</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Kood</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Kopeeri Aadress</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Makse Informatsioon</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Aadress</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Summa</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Silt</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Sõnum</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI liiga pikk, proovi vähendada märke / sõnumi pikkust.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Tõrge URI'st QR koodi loomisel</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Kuupäev</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Silt</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Sõnum</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(märge puudub)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(sõnum puudub)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Müntide saatmine</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Sisendid...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automaatselt valitud</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Liiga suur summa</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kogus:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Baiti:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Summa:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Tasu:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Peale tehingutasu:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Vahetusraha:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Tehingu tasu:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Vali...</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>kilobaidi kohta</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Peida</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Soovitatud:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Saatmine mitmele korraga</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Lisa &amp;Saaja</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Puhasta kõik vormi väljad.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Puru:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Puhasta &amp;Kõik</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Jääk:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Saatmise kinnitamine</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>S&amp;aada</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopeeri kogus</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopeeri summa</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopeeri tehingutasu</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopeeri baidid</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopeeri puru</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopeeri vahetusraha</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Oled kindel, et soovid saata?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>lisatud kui tehingutasu</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>või</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Müntide saatmise kinnitamine</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Saaja aadress ei ole korrektne. Palun kontrolli üle.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Makstav summa peab olema suurem kui 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Summa ületab jäägi.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Summa koos tehingu tasuga %1 ületab sinu jääki.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Maksepäring aegunud.</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Hoiatus: Ebakorrektne Bitcoin aadress</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(märgis puudub)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>S&amp;umma:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Maksa &amp;:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Märgis</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Vali eelnevalt kasutatud aadress</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Kleebi aadress vahemälust</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>L&amp;ahuta tehingutasu summast</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Sõnum:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Maksa :</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Aadressiraamatusse sisestamiseks märgista aadress</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Jah</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 lülitub välja...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Ära lülita arvutit välja ennem kui see aken on kadunud.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signatuurid - Allkirjasta / Kinnita Sõnum</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Allkirjastamise teade</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Bitcoin aadress millega sõnum allkirjastada</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Vali eelnevalt kasutatud aadress</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Kleebi aadress vahemälust</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Sisesta siia allkirjastamise sõnum</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signatuur</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopeeri praegune signatuur vahemällu</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Allkirjasta sõnum Bitcoini aadressi sulle kuulumise tõestamiseks</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Allkirjasta &amp;Sõnum</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Tühjenda kõik sõnumi allkirjastamise väljad</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Puhasta &amp;Kõik</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Kinnita Sõnum</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Bitcoin aadress millega sõnum on allkirjastatud</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Kinnita sõnum tõestamaks selle allkirjastatust määratud Bitcoini aadressiga.</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Kinnita &amp;Sõnum</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Tühjenda kõik sõnumi kinnitamise väljad</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Allkirja loomiseks vajuta \"Allkirjasta Sõnum\"</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Sisestatud aadress ei ole korrektne</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Palun kontrolli aadressi ja proovi uuesti.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Sisestatud aadress ei viita võtmele.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Rahakoti lahtilukustamine on katkestatud.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Sisestatud aadressi privaatvõti pole saadaval.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Sõnumi allkirjastamine ebaõnnestus.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Sõnum allkirjastatud</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Allkirja polnud võimalik dekodeerida.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Palun kontrolli allkirja ja proovi uuesti.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Allkiri ei vastanud sõnumi krüptoräsile.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Sõnumi verifitseerimine ebaõnnestus.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Sõnum verifitseeritud.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Avatud kuni %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline'is</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/kinnitamata</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 kinnitust</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Olek</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, veel esitlemata</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Kuupäev</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Allikas</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Genereeritud</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Saatja</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>tundmatu</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Saaja</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>oma aadress</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>märgis</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Krediit</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>pole vastu võetud</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Deebet</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Tehingutasu</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Neto summa</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Sõnum</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Kommentaar</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Tehingu ID</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Kaupleja</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Debug'imise info</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Tehing</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Sisendid</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Summa</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>tõene</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>väär</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Paan kuvab tehingu detailid</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Kuupäev</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tüüp</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Silt</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Avatud kuni %1</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Kinnitamata</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Kinnitatud (%1 kinnitust)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Antud klotsi pole saanud ükski osapool ning tõenäoliselt seda ei aktsepteerita!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Loodud, kuid aktsepteerimata</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Saadud koos</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Kellelt saadud</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Saadetud</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Makse iseendale</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Mine'itud</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(silt puudub)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Tehingu staatus. Kinnituste arvu kuvamiseks liigu hiire noolega selle peale.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Tehingu saamise kuupäev ning kellaaeg.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tehingu tüüp.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Jäägile lisatud või eemaldatud summa.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Kõik</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Täna</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Käesolev nädal</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Käesolev kuu</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Eelmine kuu</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Käesolev aasta</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Vahemik...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Saadud koos</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Saadetud</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Iseendale</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Mine'itud</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Muu</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minimaalne summa</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopeeri aadress</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopeeri märgis</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopeeri summa</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopeeri tehingu ID</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Märgise muutmine</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Kuva tehingu detailid</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Komadega eraldatud väärtuste fail (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Kinnitatud</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Kuupäev</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tüüp</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Silt</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Aadress</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksport ebaõnnestus.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Ulatus:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>saaja</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Müntide saatmine</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Ekspordi</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Ekspordi kuvatava vahelehe sisu faili</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Varundatud Rahakott</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Rahakoti andmed (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Varundamine nurjus</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Varundamine õnnestus</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Valikud:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Täpsusta andmekataloog</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Peeri aadressi saamiseks ühendu korraks node'iga</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Täpsusta enda avalik aadress</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Luba käsurea ning JSON-RPC käsklusi</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Tööta taustal ning aktsepteeri käsklusi</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoini tuumik</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Määratud aadressiga sidumine ning sellelt kuulamine. IPv6 jaoks kasuta vormingut [host]:port</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Käivita käsklus, kui rahakoti tehing muutub (%s cmd's muudetakse TxID'ks)</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>See on test-versioon - kasutamine omal riisikol - ära kasuta mining'uks ega kaupmeeste programmides</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Luba välisühendusi (vaikeväärtus: 1 kui puudub -proxy või -connect)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Blokeeri loomise valikud:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Tuvastati vigane bloki andmebaas</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Kas soovid bloki andmebaasi taastada?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Tõrge bloki andmebaasi käivitamisel</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Tõrge rahakoti keskkonna %s käivitamisel!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Tõrge bloki baasi lugemisel</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Tõrge bloki andmebaasi avamisel</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Tõrge: liiga vähe kettaruumi!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Pordi kuulamine nurjus. Soovikorral kasuta -listen=0.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Kontrollin blokke...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Rahakoti valikud:</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(vaikimisi: %u)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informatsioon</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC serveri valikud:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Saada jälitus/debug, debug.log faili asemel, konsooli</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Kahanda programmi käivitamisel debug.log faili (vaikeväärtus: 1, kui ei ole -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Tehingu allkirjastamine ebaõnnestus</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Tehingu summa on tasu maksmiseks liiga väikene</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Tehingu summa liiga väikene</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Tehing liiga suur</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>JSON-RPC ühenduste kasutajatunnus</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Hoiatus</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>JSON-RPC ühenduste salasõna</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Käivita käsklus, kui parim plokk muutub (käskluse %s asendatakse ploki hash'iga)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>-addnode, -seednode ja -connect tohivad kasutada DNS lookup'i</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(vaikimisi: %s)</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Kirjeldatud tundmatu võrgustik -onlynet'is: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Liiga suur summa</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Klotside indeksi laadimine...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Rahakoti laadimine...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Rahakoti vanandamine ebaõnnestus</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Üleskaneerimine...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Laetud</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Tõrge</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_et_EE.ts",
    "content": "<TS language=\"et_EE\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Loo uus aadress</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Uus</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopeeri</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Kustuta valitud aadress nimekirjast</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Kustuta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Muuda</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Silt</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Aadress</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(silt puudub)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Sisesta parool</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Uus parool</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Korda uut parooli</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Krüpteeri rahakott</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dekrüpteeri rahakott</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Muuda parooli</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Kas oled kindel, et soovid rahakoti krüpteerida?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Rahakott krüpteeritud</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Rahakoti krüpteerimine ebaõnnestus</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Rahakoti krüpteerimine ebaõnnestus sisemise vea tõttu. Sinu rahakotti ei krüpteeritud.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Sisestatud paroolid ei kattu.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Rahakoti lahtilukustamine ebaõnnestus</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Rahakoti dekrüpteerimine ebaõnnestus</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Rahakoti parooli vahetus õnnestus.</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Võrguga sünkroniseerimine...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Ülevaade</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Välju rakendusest</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Valikud...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Ava &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Kõvakettal olevate plokkide reindekseerimine...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Rahakott</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Saada</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Näita / Peida</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fail</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Seaded</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Abi</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Käsurea valikud</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 ajast maas</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Hilisemad transaktsioonid ei ole veel nähtavad.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Viga</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Hoiatus</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informatsioon</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>Kogus</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kogus</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Kuupäev</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Kinnitused</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Kinnitatud</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopeeri aadress</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopeeri kogus</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopeeri transaktsiooni ID</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>jah</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>ei</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(silt puudub)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Aadress</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Uue võtme genereerimine ebaõnnestus.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>nimi</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versioon</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Käsurea valikud</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Kasutus:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>käsurea valikud</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Tere tulemast</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Viga</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Valikud</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Võrk</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Viga</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Pending:</source>\n        <translation>Ootel:</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Kokku:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Hiljutised transaktsioonid</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>Saadetud</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Vastu võetud</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Kogus</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Salvesta Pilt...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Kopeeri Pilt</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Salvesta QR Kood</translation>\n    </message>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informatsioon</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Üldine</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Võrk</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nimi</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Ühenduste arv</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blokiahel</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Mälu kasutus</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Vastu võetud</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Saadetud</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Suund</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versioon</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Teenused</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Pingi Aeg</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Võrgu Liiklus</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Puhasta konsool</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>mitte kunagi</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Sisenev</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Väljuv</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Jah</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Ei</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Kogus:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Sõnum:</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Eemalda</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopeeri sõnum</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopeeri kogus</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Kood</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Salvesta Pilt...</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Aadress</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kogus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Silt</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Sõnum</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Kuupäev</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Silt</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Sõnum</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(silt puudub)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>Kogus</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Vali...</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopeeri kogus</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(silt puudub)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Jah</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Allkiri</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Palun kontrolli aadressi ja proovi uuesti.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Sõnum allkirjastatud.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Allkirja ei õnnestunud dekodeerida.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Palun kontrolli allkirja ja proovi uuesti.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Sõnumi verifitseerimine ebaõnnestus.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Sõnum verifitseeritud.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[test võrk]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Status</source>\n        <translation>Olek</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Kuupäev</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Sõnum</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Kommentaar</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transaktsiooni ID</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kogus</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Kuupäev</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tüüp</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Silt</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(silt puudub)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Kõik</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Täna</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Käimasolev kuu</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Eelmine kuu</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Käimasolev aasta</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Vahemik...</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopeeri aadress</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopeeri summa</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopeeri transaktsiooni ID</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Kinnitatud</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Kuupäev</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tüüp</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Silt</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Aadress</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Vahemik:</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Varunda Rahakott</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Rahakoti Andmed (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Varundamine Ebaõnnestus</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Valikud:</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informatsioon</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Hoiatus</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Viga</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_eu_ES.ts",
    "content": "<TS language=\"eu_ES\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Klikatu eskuinean helbidea edo etiketa aldatzeko</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Sortu helbide berria</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Berria</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopiatu hautatutako helbidea sistemaren arbelean</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopiatu</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Itxi</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Ezabatu aukeratutako helbideak listatik</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Uneko fitxategian datuak esportatu</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Esportatu</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Ezabatu</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Dirua bidaltzeko helbidea hautatu</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Dirua jasotzeko helbidea hautatu</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Aukeratu</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Helbideak bidaltzen</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Helbideak jasotzen</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Hauek dira zuk dirua jaso dezaketen Bitcoin helbideak. Egiaztatu beti diru-kopurua eta dirua jasoko duen helbidea zuzen egon daitezen, txanponak bidali baino lehen.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Hauek dira zure dirua jasotzeko Bitcoin helbideak. Gomendagarria da, operazio bakoitza helbide berri batekin egitea.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Helbidea kopiatu</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Etiketa &amp;Kopiatu</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Editatu</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Helbide lista esportatu</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Komaz bereizitako artxiboa (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Esportazioak huts egin du</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Akats bat egon da helbide lista %1-ean gordetzen sahiatzean. Mesedez, saiatu berriro.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Izendapen</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Helbidea</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(izendapenik ez)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Pasahitzaren dialogoa</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Pasahitza sartu</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Pasahitz berria</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Pasahitz berria errepiikatu</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Diruzorroa enkriptatu</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Diruzorroaren pasahitza behar du eragiketa honek, diruzorroa desblokeatzeko.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Diruzorroa desblokeatu</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Eragiketa honek zure diruzorroaren pasahitza behar du, diruzorroa desenkriptatzeko.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Diruzorroa desenkriptatu</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Pasahitza aldatu</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Diruorroaren enkriptazioa berretsi</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Abisua: Diruzorroa enkriptatzen baduzu eta zure pasahitza galtzen baduzu, &lt;b&gt;BITCOIN GUZTIAK GALDUKO DITUZU&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Seguru al zaude, zure diruzorroa enkriptatu nahi duzula?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Zorroa enkriptatuta</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>GARRANTZITSUA: Diruzorroaren segurtasun-kopia, wallet.dat, erabilezina bihurtuko da enkriptazioa burutu ondoren. Ondorioz, segurtasun-kopia berriekin ordezkatu beharko zenituzke zure jada eginik dituzun diruzorroaren kopiak.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Diruzorroaren enkriptazioak huts egin du</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Diruzorroaren enkriptazioak huts egin du barne-akats baten ondorioz. Zure diruzorroa ez da enkriptatu.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Eman dituzun pasahitzak ez datoz bat.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Zorroaren desblokeoak huts egin du</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Zorroa desenkriptatzeko sartutako pasahitza okerra da.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Zorroaren desenkriptazioak huts egin du</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sarearekin sinkronizatzen...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Gainbegiratu</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Diruzorroaren begirada orokorra ikusi</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakzioak</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Ikusi transakzioen historia</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Irten</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Aplikaziotik irten</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;Qt-ri buruz</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Erakutsi Qt-ren buruzko informazioa</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Aukerak...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Helbideak jasotzen...</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Diruzorroa enkriptatzeko erabilitako pasahitza aldatu</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Artxiboa</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Ezarpenak</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Laguntza</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Fitxen tresna-barra</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Eguneratua</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Eguneratzen...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Bidalitako transakzioa</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Sartutako transakzioa</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Zorroa &lt;b&gt;enkriptatuta&lt;/b&gt; eta &lt;b&gt;desblokeatuta&lt;/b&gt; dago une honetan</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Zorroa &lt;b&gt;enkriptatuta&lt;/b&gt; eta &lt;b&gt;blokeatuta&lt;/b&gt; dago une honetan</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>Kopurua:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kopurua</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Helbidea kopiatu</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etiketa kopiatu</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(izendapenik ez)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Helbidea editatu</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiketa</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Helbidea</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Jasotzeko helbide berria</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Bidaltzeko helbide berria</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Jasotzeko helbidea editatu</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Bidaltzeko helbidea editatu</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Sartu berri den helbidea, \"%1\", helbide-liburuan dago jadanik.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Ezin da diruzorroa desblokeatu.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Giltza berriaren sorrerak huts egin du.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Inprimakia</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Aukerak</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Inprimakia</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Kopurua</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ezezaguna</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Kopurua:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiketa:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Mezua:</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etiketa kopiatu</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Helbidea kopiatu</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Helbidea</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kopurua</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Izendapen</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mezua</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Izendapen</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mezua</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(izendapenik ez)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Txanponak bidali</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Kopurua:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Hainbat jasotzaileri batera bidali</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldoa:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Bidalketa berretsi</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Txanponen bidalketa berretsi</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Ordaintzeko kopurua, 0 baino handiagoa izan behar du.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(izendapenik ez)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>K&amp;opurua:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Ordaindu &amp;honi:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiketa:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Arbeletik helbidea itsatsi</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mezua:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Honi ordaindu:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Emaiozu helbide honi izenburu bat, zure helbide-liburuan horrela ager dadin</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Arbeletik helbidea itsatsi</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Zabalik %1 arte</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/konfirmatu gabe</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 konfirmazio</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, ez da oraindik arrakastaz igorri</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ezezaguna</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mezua</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transakzioa</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kopurua</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Panel honek transakzien deskribapen xehea azaltzen du</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Mota</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Izendapen</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Zabalik %1 arte</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Konfirmatuta (%1 konfirmazio)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Bloke hau ez du beste inongo nodok jaso, eta seguruenik ez da onartuko!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Sortua, baina ez onartua</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Honekin jasoa </translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Hona bidalia</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Zure buruarentzat ordainketa</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Meatua</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(izendapenik ez)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Transakzioaren egoera. Pasatu sagua gainetik konfirmazio kopurua ikusteko.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Transakzioa jasotako data eta ordua.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Transakzio mota.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Saldoan kendu edo gehitutako kopurua.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Denak</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Gaurkoak</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Aste honetankoak</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Hil honetakoak</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Azken hilekoak</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Aurtengoak</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Muga...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Honekin jasoa </translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Hona bidalia</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Zeure buruari</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Meatua</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Beste</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Kopuru minimoa</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Helbidea kopiatu</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etiketa kopiatu</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Komaz bereizitako artxiboa (*.csv)</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Mota</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Izendapen</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Helbidea</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Esportazioak huts egin du</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Txanponak bidali</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Esportatu</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Uneko fitxategian datuak esportatu</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Aukerak:</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Birbilatzen...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Zamaketa amaitua</translation>\n    </message>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_fa.ts",
    "content": "<TS language=\"fa\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>برای تغییر آدرس و یا برچسب کلیک راست کنید</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>ایجاد آدرس جدید</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;جدید</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>کپی‌برداری از آدرس منتخب به حافظهٔ سیستم</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;کپی</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;بستن</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>حذف آدرس منتخب از لیست</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>صدور داده‌های برگهٔ فعلی به یک پرونده</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;صدور</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;حذف</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>آدرس مورد نظر برای ارسال سکه‌ها را انتخاب کنید</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>آدرس موردنظر برای دریافت سکه‌ها را انتخاب کنید</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>ان&amp;تخاب</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>آدرس‌های ارسالی</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>آدرس‌های دریافتی</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>این‌ها آدرس‌های بیتکوین برای پرداخت‌ها هستند. همیشه قبل از فرستادن سکه‌ها مقدار و آدرس دریافت‌کننده را بررسی نمایید.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>این‌ها آدرس‌های بیتکوین شما برای دریافت مبالغ می‌باشد. توصیه می‌شود برای هر تراکنش از یک آدرس جدید استفاده کنید.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>کپ&amp;ی کردن آدرس</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>کپی و برچسب‌&amp;گذاری</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;ویرایش</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>صدور لیست آدرس ها</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>فایل جدا شده با ویرگول(*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>صدور موفق نبود</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>خطا در ذخیره‌سازی لیست آدرس‌ها در %1.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>برچسب</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>آدرس</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(بدون برچسب)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>پنجرهٔ گذرواژه</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>گذرواژه را وارد کنید</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>گذرواژهٔ جدید</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>تکرار گذرواژهٔ جدید</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>نمایش گذرواژه</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>رمزنگاری کیف پول</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>این عملیات نیاز به عبارت کیف پول شما برای بازگشایی کیف پول دارد.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>باز کردن قفل کیف پول</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>این عملیات نیاز به عبارت کیف پول شما برای رمزگشایی کیف پول دارد.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>رمزگشایی کیف پول</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>تغییر گذرواژه</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>عبارت کهنه و جدید کیف پول را وارد کنید.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>تأیید رمزنگاری کیف پول</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>آیا مطمئن هستید که می‌خواهید کیف پول خود را رمزنگاری کنید؟</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>کیف پول رمزنگاری شد</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>رمزنگاری کیف پول با شکست مواجه شد</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>رمزنگاری کیف پول بنا به یک خطای داخلی با شکست مواجه شد. کیف پول شما رمزنگاری نشد.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>بازگشایی قفل کیف‌پول با شکست مواجه شد</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>رمزگشایی کیف پول با شکست مواجه شد</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>گذرواژهٔ کیف پول با موفقیت عوض شد.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>هشدار: کلید Caps Lock روشن است!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>آی‌پی/نت‌ماسک</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>مسدود شده تا</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>&amp;امضای پیام...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>همگام‌سازی با شبکه...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;بررسی اجمالی</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>گره</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>نمایش بررسی اجمالی کیف پول</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;تراکنش‌ها</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>مرور تاریخچهٔ تراکنش‌ها</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;خروج</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>خروج از برنامه</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;حدود%1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>نمایش اطلاعات دربارهٔ %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>دربارهٔ &amp;کیوت</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>نمایش اطلاعات دربارهٔ کیوت</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;تنظیمات...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>تغییر تنظیمات %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;رمزنگاری کیف پول...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;پیشتیبان‌گیری از کیف پول...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;تغییر گذرواژه...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;در حال ارسال آدرس ها...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;در حال دریافت آدرس ها...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>باز کردن &amp;آدرس</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>برای غیر فعال کردن فعالیت شبکه کلیک کنید.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>فعالیت شبکه غیر فعال شد.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>برای فعال کردن دوباره فعالیت شبکه کلیک کنید.</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>بازنشانی بلوک‌ها روی دیسک...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>ارسال وجه به نشانی بیت‌کوین</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>تهیهٔ پشتیبان از کیف پول در یک مکان دیگر</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>تغییر گذرواژهٔ مورد استفاده در رمزنگاری کیف پول</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>پنجرهٔ ا&amp;شکال‌زدایی</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>باز کردن کنسول خطایابی و اشکال‌زدایی</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>با&amp;زبینی پیام...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>بیت‌کوین</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>کیف پول</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;ارسال</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;دریافت</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;نمایش/ عدم نمایش</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>نمایش یا مخفی‌کردن پنجرهٔ اصلی</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>رمزنگاری کلیدهای خصوصی متعلق به کیف پول شما</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>برای اثبات اینکه پیام‌ها به شما تعلق دارند، آن‌ها را با نشانی بیت‌کوین خود امضا کنید</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>برای حصول اطمینان از اینکه پیام با نشانی بیت‌کوین مشخص شده امضا است یا خیر، پیام را شناسایی کنید</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;فایل</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;تنظیمات</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;کمک‌رسانی</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>نوارابزار برگه‌ها</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>درخواست پرداخت ( تولید کد کیوار و ادرس بیت کوین)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>نمایش لیست آدرس های ارسال و لیبل ها</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>نمایش لیست آدرس های دریافت و لیبل ها</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>بازکردن یک بیت کوین: آدرس یا درخواست پرداخت</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>گزینه‌های خط‌فرمان</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n ارتباط فعال با شبکهٔ بیت‌کوین</numerusform><numerusform>%n ارتباط فعال با شبکهٔ بیت‌کوین</numerusform></translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>پردازش بلوک‌ها روی دیسک...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>پردازش %n  بلاک از تاریخچه ی تراکنش ها </numerusform><numerusform>پردازش %n  بلاک از تاریخچه ی تراکنش ها </numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 عقب‌تر</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>آخرین بلاک دریافتی %1 پیش ایجاد شده است.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>تراکنش‌های بعد از این هنوز قابل مشاهده نیستند.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطا</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>هشدار</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>اطلاعات</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>وضعیت به‌روز</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>به‌روز رسانی...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>تاریخ: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>مقدار: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>نوع: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>برچسب: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>نشانی: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>تراکنش ارسال شد</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>تراکنش دریافت شد</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>کیف پول &lt;b&gt;رمزنگاری شده&lt;/b&gt; است و هم‌اکنون &lt;b&gt;باز&lt;/b&gt; است</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>کیف پول &lt;b&gt;رمزنگاری شده&lt;/b&gt; است و هم‌اکنون &lt;b&gt;قفل&lt;/b&gt; است</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>انتخاب سکه</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>تعداد:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>بایت ها:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>مبلغ:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>هزینه:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>هزینه ی پسین:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>پول خورد:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(لغو)انتخاب همه</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>مدل درختی</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>مدل لیست</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>مبلغ</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>دریافت شده با برچسب</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>دریافت شده با نشانی</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>تاریخ</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>تاییدیه ها</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>تأیید شده</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>کپی ادرس</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>کپی برچسب</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>کپی مقدار</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>کپی شناسهٔ تراکنش</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>قفل کردن خرج نشده ها</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>بازکردن قفل خرج نشده ها</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>کپی تعداد</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>رونوشت کارمزد</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>کپی کردن بایت ها</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>کپی کردن تغییر</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 قفل شده)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>بله</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>خیر</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(بدون برچسب)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(تغییر)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>ویرایش نشانی</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;برچسب</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;نشانی</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>نشانی گیرنده جدید</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>نشانی فرستنده جدید</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>ویرایش آدرس گیرنده</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>ویرایش آدرس قرستنده</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>نشانی وارد شده \"%1\" یک نشانی معتبر بیت‌کوین نیست.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>نشانی وارد شده «%1» در حال حاضر در دفترچه وجود دارد.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>نمی‌توان کیف پول را رمزگشایی کرد.</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>یک مسیر دادهٔ جدید ایجاد خواهد شد.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>نام</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>این پوشه در حال حاضر وجود دارد. اگر می‌خواهید یک دایرکتوری جدید در این‌جا ایجاد کنید، %1 را اضافه کنید.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>مسیر داده شده موجود است و به یک پوشه اشاره نمی‌کند.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>نمی‌توان پوشهٔ داده در این‌جا ایجاد کرد.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>نسخه</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-بیت)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>درباره %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>گزینه‌های خط‌فرمان</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>استفاده:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>گزینه‌های خط فرمان</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>گزینه‌های رابط کاربری:</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>زبان را تنظیم کنید؛ برای مثال «de_DE» (پیشفرض: زبان سیستم)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>شروع برنامه به صورت کوچک‌شده</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>تنظیم گواهی ریشه SSl برای درخواست پرداخت (پیشفرض: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>نمایش پنجرهٔ خوشامدگویی در ابتدای اجرای برنامه (پیش‌فرض: %u)</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>خوش‌آمدید</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>به %1 خوش‌آمدید.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>استفاده از مسیر پیش‌فرض</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>استفاده از یک مسیر سفارشی:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>بیت‌کوین</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطا</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n گیگابایت فضا موجود است</numerusform><numerusform>%n گیگابایت فضا موجود است</numerusform></translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>فرم</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>مشخص نیست</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>زمان آخرین بلوک</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>پیشروی</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>پیشروی در هر ساعت بیشتر میشود</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>در حال محاسبه...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>زمان تخمینی تا سینک شدن</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>پنهان کردن</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>بازکردن آدرس</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>بازکردن درخواست پرداخت از آدرس یا فایل</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>آدرس اینترنتی:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>انتخاب فایل درخواست پرداخت</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>گزینه‌ها</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;عمومی</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>اجرای خودکار %1 بعد زمان ورود به سیستم.</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>مگابایت</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>بازنشانی تمام تنظیمات به پیش‌فرض.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;بازنشانی تنظیمات</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;شبکه</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>کیف پول</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>استخراج</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>باز کردن خودکار درگاه شبکهٔ بیت‌کوین روی روترها. تنها زمانی کار می‌کند که روتر از پروتکل UPnP پشتیبانی کند و این پروتکل فعال باشد.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>نگاشت درگاه شبکه با استفاده از پروتکل &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>آ&amp;ی‌پی پراکسی:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;درگاه:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>درگاه پراکسی (مثال 9050)</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>آی‌پی نسخه 4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>آی‌پی نسخه 6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>تور</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;پنجره</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>تنها بعد از کوچک کردن پنجره، tray icon را نشان بده.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;کوچک کردن به سینی به‌جای نوار وظیفه</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>کوچک کردن &amp;در زمان بسته شدن</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;نمایش</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>زبان &amp;رابط کاربری:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;واحد نمایش مبالغ:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>انتخاب واحد پول مورد استفاده برای نمایش در پنجره‌ها و برای ارسال سکه.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;تأیید</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;لغو</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>پیش‌فرض</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>هیچکدام</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>تأییدِ بازنشانی گزینه‌ها</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطا</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>برای این تغییرات بازنشانی مشتری ضروری است</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>آدرس پراکسی داده شده صحیح نیست.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>فرم</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>اطلاعات نمایش‌داده شده ممکن است قدیمی باشند. بعد از این که یک اتصال با شبکه برقرار شد، کیف پول شما به‌صورت خودکار با شبکهٔ بیت‌کوین همگام‌سازی می‌شود. اما این روند هنوز کامل نشده است.</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>در دسترس:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>تراز علی‌الحساب شما</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>در انتظار:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>مجموع تراکنش‌هایی که هنوز تأیید نشده‌اند؛ و هنوز روی تراز علی‌الحساب اعمال نشده‌اند</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>نارسیده:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>تراز استخراج شده از معدن که هنوز بالغ نشده است</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>تراز ها</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>جمع کل:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>تراز کل فعلی شما</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>:قابل خرج کردن</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>تراکنش های اخیر</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>درخواست پرداخت نامعتبر.</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>ارسال شده</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>دریافتی</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>مبلغ</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>یک آدرس بیت‌کوین وارد کنید (مثلاً %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 روز</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 ساعت</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 دقیقه</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 ثانیه</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>هیچکدام</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>ناموجود</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 میلیونم ثانیه</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 و %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 بایت</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 کیلوبایت</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 مگابایت</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 گیگابایت</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ناشناس</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>ناموجود</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>نسخهٔ کلاینت</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;اطلاعات</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>پنجرهٔ اشکالزدایی</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>عمومی</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>زمان آغاز به کار</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>شبکه</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>اسم</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>تعداد ارتباطات</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>زنجیرهٔ بلوک‌ها</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>تعداد فعلی بلوک‌ها</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>استخر حافظه</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>مصرف حافظه</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>دریافتی</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>ارسال شده</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>نسخه</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>سرویس ها</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>مدت اتصال</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>ارسال شده آخرین بار</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>آخرین دریافتی</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>زمان پینگ</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>انتظار پینگ</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>زمان آخرین بلوک</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>با&amp;ز کردن</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;کنسول</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>جمع کل:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>در:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>خروجی:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>فایلِ لاگِ اشکال زدایی</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>پاکسازی کنسول</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 ساعت</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 روز</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 هفته</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 سال</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>محدود شده برای</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>هرگز</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>بله</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>خیر</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>ناشناخته</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>مبلغ:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;برچسب:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>پیام:</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>برای درخواست پرداخت از این فرم استفاده کنید.تمام قسمت ها &lt;b&gt;اختیاری&lt;b&gt; هستند.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>تمام قسمت های فرم را خالی کن.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>پاک‌کردن</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>نمایش</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>حذف ورودی های انتخاب‌شده از لیست</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>حذف کردن</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>کپی برچسب</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>کپی مقدار</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>کد QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;کپی نشانی</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;ذخیره عکس...</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>آدرس</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>برچسب</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>برچسب</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(بدون برچسب)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>ارسال سکه</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>ورودی‌ها...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>به طور خودکار انتخاب شدند</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>بود جه نا کافی </translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>تعداد:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>بایت ها:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>مبلغ:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>هزینه:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>هزینه ی پسین:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>پول خورد:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>هزینهٔ تراکنش:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>انتخاب...</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>در هر کیلوبایت</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>پنهان کردن</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>توصیه شده:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>سفارشی:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>ارسال به چند دریافت‌کنندهٔ به‌طور همزمان</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;دریافت‌کنندهٔ جدید</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>تمام قسمت های فرم را خالی کن.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>پاکسازی &amp;همه</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>تزار:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>عملیات ارسال را تأیید کنید</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;ارسال</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>کپی تعداد</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>کپی مقدار</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>رونوشت کارمزد</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>کپی کردن بایت ها</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>کپی کردن تغییر</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(بدون برچسب)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>A&amp;مبلغ :</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>پرداخ&amp;ت به:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;برچسب:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>انتخاب نشانی پیش‌تر استفاده شده</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>این یک پرداخت عادی است</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>نشانی بیت‌کوین برای ارسال پرداخت به آن</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>چسباندن نشانی از حافظهٔ سیستم</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>حذف این مدخل</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>پیام:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>پرداخت به:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>یادداشت:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 در حال خاموش شدن است...</translation>\n    </message>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>امضاها - امضا / تأیید یک پیام</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>ا&amp;مضای پیام</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>نشانی بیت‌کوین برای امضاء پیغام با آن</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>انتخاب نشانی پیشتر استفاده شده</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>چسباندن نشانی از حافظهٔ سیستم</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>پیامی را که می‌خواهید امضا کنید در اینجا وارد کنید</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>امضا</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>امضای فعلی را به حافظهٔ سیستم کپی کن</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>برای اثبات تعلق این نشانی به شما، پیام را امضا کنید</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>ا&amp;مضای پیام</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>بازنشانی تمام فیلدهای پیام</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>پاک &amp;کردن همه</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;شناسایی پیام</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>نشانی بیت‌کوین که پیغام با آن امضاء شده</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>برای حصول اطمینان از اینکه پیام با نشانی بیت‌کوین مشخص شده امضا است یا خیر، پیام را شناسایی کنید</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>&amp;شناسایی پیام</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>بازنشانی تمام فیلدهای پیام</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>آزمایش شبکه</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>کیلوبایت</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>این پانل شامل توصیف کاملی از جزئیات تراکنش است</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>برچسب</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(بدون برچسب)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>کپی ادرس</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>کپی برچسب</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>کپی مقدار</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>کپی شناسهٔ تراکنش</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>فایل جدا شده با ویرگول(*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>برچسب</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>آدرس</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>صدور موفق نبود</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>صدور داده‌های برگهٔ فعلی به یک پرونده</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>گزینه‌ها:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>مشخص کردن دایرکتوری داده‌ها</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>اتصال به یک گره برای دریافت آدرس‌های همتا و قطع اتصال پس از اتمام عملیات</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>آدرس عمومی خود را مشخص کنید</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>پذیرش دستورات خط فرمان و دستورات JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>اجرا در پشت زمینه به‌صورت یک سرویس و پذیرش دستورات</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation> هسته Bitcoin </translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>مقید به نشانی داده شده باشید و همیشه از آن پیروی کنید. از نشانه گذاری استاندار IPv6 به صورت Host]:Port] استفاده کنید.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>هنگامی که یک تراکنش در کیف پولی رخ می دهد، دستور را اجرا کن(%s در دستورات بوسیله ی TxID جایگزین می شود)</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>پذیرش اتصالات از بیرون (پیش فرض:1 بدون پراکسی یا اتصال)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>بستن گزینه ایجاد</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>گزینه‌های اتصال:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>حق تألیف (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>یک پایگاه داده ی بلوک خراب یافت شد</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>آیا مایلید که اکنون پایگاه داده ی بلوک را بازسازی کنید؟</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>خطا در آماده سازی پایگاه داده ی بلوک</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>خطا در بارگیری %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>خطا در بارگذاری پایگاه داده ها</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>خطا در بازگشایی پایگاه داده ی بلوک</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>خطا: فضای دیسک کم است!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>شنیدن هر گونه درگاه انجام پذیر نیست. ازlisten=0  برای اینکار استفاده کیند.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>در حال پیاده‌سازی...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>بارگذاری لیست‌سیاه...</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>چاپ ایت پیام کمک و خروج</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>چاپ نسخه و خروج</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>در حال بازبینی بلوک‌ها...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>گزینه‌های کیف پول:</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(پیش‌فرض %u)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>اطلاعات</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>اطلاعات ردگیری/اشکال‌زدایی را به جای فایل لاگ اشکال‌زدایی به کنسول بفرستید</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>فایل debug.log  را در startup مشتری کوچک کن (پیش فرض:1 اگر اشکال زدایی روی نداد)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>مقدار تراکنش بسیار کم است</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>تراکنش بسیار بزرگ است</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>JSON-RPC شناسه برای ارتباطات</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>هشدار</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>هشدار: قوانین جدید ناشناخته‌ای فعال شده‌اند (نسخه‌بیت %i)</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>JSON-RPC عبارت عبور برای ارتباطات</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>زمانی که بهترین بلاک تغییر کرد، دستور را اجرا کن (%s در cmd با block hash جایگزین شده است)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>به DNS اجازه بده تا برای addnode ، seednode و اتصال جستجو کند</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(پیش‌فرض %s)</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>شبکه مشخص شده غیرقابل شناسایی در onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>بود جه نا کافی </translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>بار گیری شاخص بلوک</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>بار گیری والت</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>امکان تنزل نسخه در wallet وجود ندارد</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>اسکان مجدد</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>بار گیری انجام شده است</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطا</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_fa_IR.ts",
    "content": "<TS language=\"fa_IR\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>برای ویرایش آدرس یا برچسب روی آن راست کلیک کنید</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>گشایش آدرس جدید</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>جدید</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>کپی کردن حساب انتخاب شده به حافظه سیستم - کلیپ بورد</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>کپی</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>بستن</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>حذف آدرس های انتخاب شده از لیست</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>صدور داده نوار جاری به یک فایل</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>صدور</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>حذف</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>آدرس برای ارسال کوین‌ها را انتخاب کنید</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>انتخاب آدرس جهت دریافت سکه‌ها با آن</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>انتخاب</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>آدرس‌های فرستنده</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>آدرس‌های گیرنده</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>اینها آدرس‌های شما برای ارسال وجوه هستند. همیشه قبل از ارسال، مقدار و آدرس گیرنده را بررسی کنید.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>اینها آدرس‌های بیتکوین شما برای دریافت وجوه هستند. توصیه می‌شود برای هر دریافت از یک آدرس جدید استفاده کنید.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>کپی آدرس</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>کپی برچسب</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>ویرایش</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>از فهرست آدرس خروجی گرفته شود</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>فایل سی اس وی (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>گرفتن خروجی به مشکل خورد</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>خطایی به هنگام ذخیره لیست آدرس در %1 رخ داده است. لطفا دوباره تلاش کنید.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>برچسب</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>آدرس</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(برچسب ندارد)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>دیالوگ رمزعبور</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>رمز/پَس فرِیز را وارد کنید</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>رمز/پَس فرِیز جدید را وارد کنید</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>رمز/پَس فرِیز را دوباره وارد کنید</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>رمز جدید را در کیف‌پول وارد کنید. &lt;br/&gt;لطفا از رمزی استفاده کنید که&lt;b&gt; حداقل ۱۰ کاراکتر راندوم&lt;/b&gt;یا&lt;b&gt;حداقل ۸ کلمه داشته باشد&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>رمزگذاری کیف پول</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>برای انجام این عملیات، باید رمز کیف‌پول را وارد کنید.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>بازکردن کیف‌پول</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>برای انجام این عملیات، باید رمز کیف‌پول را وارد کنید.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>رمزگشایی کیف پول</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>تغییر رمزعبور</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>رمز قدیمی و جدید کیف پول را وارد کنید.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>تایید رمزگذاری کیف پول</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>اخطار: اگر کیف‌پول خود را رمزگذاری کرده و رمز خود را فراموش کنید، شما &lt;b&gt;تمام بیت‌کوین‌های خود را از دست خواهید داد&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>آیا از رمزگذاری کیف‌پول خود اطمینان دارید؟</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>کیف پول رمزگذاری شده است</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 برای اتمام فرایند رمزگذاری بسته خواهد شد. به خاطر داشته باشید که رمزگذاری WALLET شما،  کامپیوتر شما را از آلودگی به بدافزارها مصون نمی دارد.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>مهم: هر بک‌آپ قبلی که از کیف‌پول خود گرفته‌اید، با نسخه‌ی جدید رمزنگاری‌شده جایگزین خواهد شد. به دلایل امنیتی، پس از رمزنگاری کیف‌پول، بک‌آپ‌های قدیمی شما بلااستفاده خواهد شد.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>خطا در رمزنگاری کیف‌پول</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>رمزگذاری به علت خطای داخلی تایید نشد. کیف‌پول شما رمزگذاری نشد.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>رمزهای واردشده تطابق ندارند.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>خطا در بازکردن کیف‌پول</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>رمز واردشده برای رمزگشایی کیف‌پول اشتباه است.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>خطا در رمزگشایی کیف‌پول</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>رمز کیف‌پول با موفقیت تغییر یافت.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>اخطار: کلید Caps Lock فعال است!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>Banned Until</source>\n        <translation>مسدودشده تا</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>امضا و پیام</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>به روز رسانی با شبکه...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>بازبینی</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>نمای کلی از wallet را نشان بده</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>تراکنش</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>تاریخچه تراکنش را باز کن</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>خروج</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>از \"درخواست نامه\"/ application خارج شو</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;درباره %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>نمایش اطلاعات درباره %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>درباره Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>نمایش اطلاعات درباره Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>انتخاب ها</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>اصلاح انتخاب ها برای پیکربندی %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>رمزگذاری کیف پول</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>تهیه نسخه پشتیبان از کیف پول</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>تغییر رمز/پَس فرِیز</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>درحال ارسال آدرس‌ها…</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>دریافت آدرس ها</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>برای غیرفعال‌کردن فعالیت شبکه کلیک کنید.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>فعالیت شبکه غیرفعال شد.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>برای فعال‌کردن فعالیت شبکه کلیک کنید.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>درحال همگام‌سازی هدرها (%1%)…</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>فهرست‌بندی نمایه بلاک‌ها…</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>ارسال کوین به آدرس بیت کوین</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>گرفتن نسخه پیشتیبان در آدرسی دیگر</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>رمز عبور مربوط به رمزگذاریِ کیف پول  را تغییر دهید</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>پنجره دیباگ</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>تایید پیام</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>بیت کوین</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>کیف پول</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>ارسال</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>نمایش/ عدم نمایش</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>نمایش یا عدم نمایش پنجره اصلی</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>رمزنگاری کلیدهای شخصی متعلق به کیف‌پول</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>پیام‌ها را با آدرس بیت‌کوین خود امضا کنید تا مالکیت آن‌ها را اثبات کنید</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>پیام‌ها را تائید کنید تا از امضاشدن آن‌ها با آدرس بیت‌کوین مطمئن شوید</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>فایل</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>تنظیمات</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>راهنما</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>نوار ابزار</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>درخواست پرداخت (ساخت کد QR و بیت‌کوین: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>نمایش لیست آدرس‌ها و لیبل‌های ارسالی استفاده شده</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>نمایش لیست آدرس‌ها و لیبل‌های دریافتی استفاده شده</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>بازکردن بیت‌کوین: آدرس یا درخواست پرداخت</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n ارتباط فعال به شبکه بیت‌کوین</numerusform><numerusform>%n ارتباط فعال به شبکه بیت‌کوین</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>فهرست‌بندی نمایه بلاک‌ها…</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>پردازش نمایه بلاک‌ها…</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n بلاک از تاریخچه تراکنش، پردازش شد.</numerusform><numerusform>%n بلاک از تاریخچه تراکنش، پردازش شد.</numerusform></translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطا</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>به روز</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>در حال روزآمد سازی..</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>تراکنش ارسالی</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>تراکنش دریافتی</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>wallet رمزگذاری شد و در حال حاضر از حالت قفل در آمده است</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>wallet رمزگذاری شد و در حال حاضر قفل است</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>انتخاب کوین</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>مقدار</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>میزان وجه:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>هزینه</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>تغییر</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(عدم)انتخاب همه</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>میزان</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>دریافت شده با برچسب</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>دریافت شده با آدرس</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>تاریخ</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>تاییدیه </translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>تایید شده</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>کپی آدرس</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>کپی برچسب</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>کپی مقدار</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>کپی شناسه تراکنش</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>کپی مقدار</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>کپی هزینه</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>بله</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>خیر</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(برچسب ندارد)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>ویرایش حساب</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>برچسب</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>آدرس</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>آدرس دریافتی جدید</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>آدرس ارسالی جدید</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>ویرایش آدرس دریافتی</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>ویرایش آدرس ارسالی</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>نام</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>نسخه</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>میزان استفاده:</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>خوش آمدید</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>بیت کوین</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطا</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>فرم</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>ناشناس...</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>در حال محاسبه...</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>پنهان کردن</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>گزینه ها</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>مگابایت</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>تنظیم مجدد گزینه ها</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>شبکه</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>کیف پول</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>پورت:</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>پنجره</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>نمایش</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>تایید</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>لغو</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>پیش فرض</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطا</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>فرم</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>اطلاعات نمایش داده شده ممکن است روزآمد نباشد. wallet شما به صورت خودکار بعد از برقراری اتصال با شبکه bitcoin به روز می شود اما این فرایند هنوز تکمیل نشده است.</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>در دسترس:</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>در حال انتظار:</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>کل:</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>قابل مصرف:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>تراکنش های اخیر</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>میزان</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ناشناس</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>Client version</source>\n        <translation>ویرایش کنسول RPC</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>شبکه</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>تعداد اتصال</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>زنجیره مجموعه تراکنش ها</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>تعداد زنجیره های حاضر</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>میزان وجه:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>برچسب:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>پیام:</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>حذف</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>کپی برچسب</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>کپی مقدار</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>کپی آدرس</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>آدرس</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>برچسب</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>برچسب</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(برچسب ندارد)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>سکه های ارسالی</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>وجوه ناکافی</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>مقدار</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>میزان وجه:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>هزینه</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>تغییر</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>پنهان کردن</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>ارسال همزمان به گیرنده های متعدد</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>پاک کردن همه</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>مانده حساب:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>تایید عملیات ارسال </translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>و ارسال</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>کپی مقدار</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>کپی مقدار</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>کپی هزینه</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(برچسب ندارد)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>میزان وجه</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>پرداخت به:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>برچسب:</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>استفاده از آدرس کلیپ بورد</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>پیام:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>پرداخت به:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>یادداشت:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>تا پیش از بسته شدن این پنجره کامپیوتر خود را خاموش نکنید.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>امضای پیام </translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>آدرس را بر کلیپ بورد کپی کنید</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>پیامی که می خواهید امضا کنید را اینجا وارد کنید</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>امضا</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>امضای پیام </translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>پاک کردن همه</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>تایید پیام</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>تایید پیام</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>آدرس وارد شده نامعتبر است.</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Status</source>\n        <translation>وضعیت</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>منبع</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>تولید شده</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>از</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>به</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>این بخش جزئیات تراکنش را نشان می دهد</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>برچسب</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>تایید نشده</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>دریافت شده از</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>ارسال شده به</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>استخراج شده</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(برچسب ندارد)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Sent to</source>\n        <translation>ارسال شده به</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>استخراج شده</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>کپی آدرس</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>کپی برچسب</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>کپی مقدار</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>کپی شناسه تراکنش</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>فایل سی اس وی (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>برچسب</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>آدرس</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>گرفتن خروجی به مشکل خورد</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>انتخابها:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>دایرکتوری داده را مشخص کن</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>command line  و JSON-RPC commands را قبول کنید</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>به عنوان daemon بک گراند را اجرا کنید و دستورات را قبول نمایید</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>مبلغ تراکنش کمتر از آن است که پس از کسر هزینه  تراکنش قابل ارسال باشد</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>گزینه های سرویس دهنده RPC:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>ارسال اطلاعات پیگیری/خطایابی به کنسول به جای ارسال به فایل debug.log</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>شناسه کاربری برای ارتباطاتِ JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>رمز برای ارتباطاتِ JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>دستور را وقتی بهترین بلاک تغییر کرد اجرا کن (%s در دستور توسط block hash جایگزین شده است)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>تنظیم تعداد ریسمان ها برای سرویس دهی فراخوانی های RPC (پیش فرض: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>فایل تنظیمات را مشخص کنید (پیش فرض: %s)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>فایل pid را مشخص کنید (پیش فرض: %s)</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>وجوه ناکافی</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>لود شدن نمایه بلاکها..</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>wallet در حال لود شدن است...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>قابلیت برگشت به نسخه قبلی برای wallet امکان پذیر نیست</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>اسکنِ دوباره...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>اتمام لود شدن</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>خطا</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_fi.ts",
    "content": "<TS language=\"fi\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Valitse hiiren oikealla painikkeella muokataksesi osoitetta tai nimikettä</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Luo uusi osoite</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Uusi</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopioi valittu osoite leikepöydälle</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopioi</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>S&amp;ulje</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Poista valittu osoite listalta</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Vie auki olevan välilehden tiedot tiedostoon</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Vie</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Poista</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Valitse osoite johon kolikot lähetetään</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Valitse osoite kolikoiden vastaanottamiseen</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>V&amp;alitse</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Lähetysosoitteet</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Vastaanotto-osoitteet</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Nämä ovat Bitcoin-osoitteesi maksujen lähettämistä varten. Tarkista aina määrä ja vastaanotto-osoite ennen kolikoiden lähettämistä.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Tässä ovat Bitcoin vastaanotto-osoitteesi. On suositeltavaa käyttää uutta vastaanotto-osoitetta jokaista lähetystä varten.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopioi osoite</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopioi &amp;nimike</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Muokkaa</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Vie osoitelista</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Pilkuilla erotettu tiedosto (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Vienti epäonnistui</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Virhe tallentaessa osoitelistaa kohteeseen %1. Yritä uudelleen.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Nimike</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Osoite</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ei nimikettä)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Tunnuslauseen tekstinsyöttökenttä</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Kirjoita tunnuslause</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Uusi tunnuslause</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Toista uusi tunnuslause</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Näytä salasana</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Kirjoita uusi salauslause lompakolle.&lt;br/&gt;Käytä salauslausetta jossa on joko&lt;b&gt;kymmenen tai useampi satunnainen merkki&lt;/b&gt;, tai&lt;b&gt;vähintään kahdeksan sanaa&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Salaa lompakko</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Tämä toiminto vaatii lompakkosi tunnuslauseen sen avaamiseksi</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Avaa lompakko</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Tämä toiminto vaatii lompakkosia tunnuslauseen salauksen purkuun</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Pura lompakon salaus</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Vaihda salasana</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Syötä vanha ja uusi tunnuslause lompakolle.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Vahvista lompakon salaaminen</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Varoitus: Jos salaat lompakkosi ja menetät tunnuslauseesi, &lt;b&gt;MENETÄT KAIKKI BITCOINISI&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Oletko varma että haluat salata lompakkosi?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Lompakko salattiin</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 sulkeutuu lopettaakseen salausprosessin. Muista, että salattukaan lompakko ei täysin suojaa sitä haittaohjelmien aiheuttamilta varkauksilta.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>TÄRKEÄÄ: Kaikki tekemäsi vanhan lompakon varmuuskopiot pitäisi korvata uusilla suojatuilla varmuuskopioilla. Turvallisuussyistä edelliset varmuuskopiot muuttuvat turhiksi, kun aloitat uuden suojatun lompakon käytön.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Lompakon salaaminen epäonnistui</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Lompakon salaaminen epäonnistui sisäisen virheen vuoksi. Lompakkoasi ei salattu.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Annetut salauslauseet eivät täsmää.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Lompakon lukituksen avaaminen epäonnistui</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Annettu salauslause lompakon avaamiseksi oli väärä.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Lompakon salauksen purkaminen epäonnistui</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Lompakon salasana vaihdettiin onnistuneesti.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Varoitus: Caps Lock-painike on päällä!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Verkon peite</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Estetty kunnes</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>&amp;Allekirjoita viesti...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synkronoidaan verkon kanssa...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Yleisnäkymä</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Solmu</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Lompakon tilanteen yleiskatsaus</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Rahansiirrot</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Selaa rahansiirtohistoriaa</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>L&amp;opeta</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Sulje ohjelma</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Tietoja %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Näytä tietoa aiheesta %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Tietoja &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Näytä tietoja Qt:ta</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Asetukset...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Muuta kohteen %1 kokoonpanoasetuksia</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Salaa lompakko...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Varmuuskopioi Lompakko...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Vaihda Tunnuslause...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Lähetysosoitteet...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Vastaanotto-osoitteet...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Avaa &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Paina poistaaksesi verkkoyhteysilmaisin käytöstä.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Verkkoyhteysmittari pois käytöstä</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Paina ottaaksesi verkkoyhteysilmaisin uudelleen käyttöön.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synkronoidaan Tunnisteita (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Ladataan lohkoindeksiä...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Lähetä kolikoita Bitcoin-osoitteeseen</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Varmuuskopioi lompakko toiseen sijaintiin</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Vaihda lompakon salaukseen käytettävä tunnuslause</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Testausikkuna</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Avaa debuggaus- ja diagnostiikkakonsoli</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Varmista &amp;viesti...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Lompakko</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Lähetä</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Vastaanota</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Näytä / Piilota</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Näytä tai piilota Bitcoin-ikkuna</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Suojaa yksityiset avaimet, jotka kuuluvat lompakkoosi</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Allekirjoita viestisi omalla Bitcoin -osoitteellasi todistaaksesi, että omistat ne</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Varmista, että viestisi on allekirjoitettu määritetyllä Bitcoin -osoitteella</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Tiedosto</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Asetukset</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Apua</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Välilehtipalkki</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Pyydä maksuja (Luo QR koodit ja bitcoin: URIt)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Näytä lähettämiseen käytettyjen osoitteiden ja nimien lista</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Näytä vastaanottamiseen käytettyjen osoitteiden ja nimien lista</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Avaa bitcoin: URI tai maksupyyntö</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Komentorivin valinnat</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Ladataan lohkoindeksiä...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Käsitellään lohkoja levyllä...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 jäljessä</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Viimeisin vastaanotettu lohko tuotettu %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Tämän jälkeiset rahansiirrot eivät ole vielä näkyvissä.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Virhe</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Varoitus</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Tietoa</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Rahansiirtohistoria on ajan tasalla</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Näytä %1 ohjeet saadaksesi listan mahdollisista Bitcoinin komentorivivalinnoista</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1-asiakas</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Yhdistetään vertaisiin...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Saavutetaan verkkoa...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Päivämäärä: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Määrä: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tyyppi: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Nimike: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Osoite: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Lähetetyt rahansiirrot</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Saapuva rahansiirto</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD avaimen generointi on &lt;b&gt;päällä&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD avaimen generointi on &lt;/b&gt;pois päältä&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Lompakko on &lt;b&gt;salattu&lt;/b&gt; ja tällä hetkellä &lt;b&gt;avoinna&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Lompakko on &lt;b&gt;salattu&lt;/b&gt; ja tällä hetkellä &lt;b&gt;lukittuna&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Peruuttamaton virhe on tapahtunut. Bitcoin ei voi enää jatkaa turvallisesti ja sammutetaan.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Kolikoiden valinta</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Määrä:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Tavuja:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Määrä:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Palkkio:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Tomu:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Palkkion jälkeen:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Vaihtoraha:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(epä)valitse kaikki</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Puurakenne</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Listarakenne</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Määrä</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Vastaanotettu nimikkeellä</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Vastaanotettu osoitteella</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Aika</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Vahvistuksia</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Vahvistettu</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopioi osoite</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopioi nimike</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopioi määrä</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopioi transaktion ID</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Lukitse käyttämättömät</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Avaa käyttämättömien lukitus</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopioi lukumäärä</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopioi rahansiirtokulu</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopioi rahansiirtokulun jälkeen</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopioi tavut</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopioi tomu</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopioi vaihtorahat</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 lukittu)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>kyllä</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>ei</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Tämä nimike muuttuu punaiseksi, jos jokin vastaanottajista on saamassa tämänhetkistä tomun rajaa pienemmän summan.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Saattaa vaihdella +/- %1 satoshia per syöte.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ei nimikettä)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>Vaihda %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(vaihtoraha)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Muokkaa osoitetta</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Nimi</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Tähän osoitteeseen liitetty nimi</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Osoite liitettynä tähän osoitekirjan alkioon. Tämä voidaan muokata vain lähetysosoitteissa.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Osoite</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Uusi vastaanotto-osoite</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Uusi lähetysosoite</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Muokkaa vastaanottavaa osoitetta</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Muokkaa lähettävää osoitetta</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Antamasi osoite \"%1\" ei ole kelvollinen Bitcoin-osoite.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Antamasi osoite \"%1\" on jo osoitekirjassa</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Lompakkoa ei voitu avata.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Uuden avaimen luonti epäonnistui.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Luodaan uusi kansio.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>Nimi</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Hakemisto on jo olemassa. Lisää %1 jos tarkoitus on luoda hakemisto tänne.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Polku on jo olemassa, eikä se ole kansio.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Ei voida luoda data-hakemistoa tänne.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versio</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Tietoja %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Komentorivi parametrit</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Käyttö:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>komentorivi parametrit</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Käyttöliittymän asetukset:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Valitse datahakemisto käynnistyksen yhteydessä (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Aseta kieli, esimerkiksi \"de_DE\" (oletus: järjestelmän kieli)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Käynnistä pienennettynä</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Aseta maksupyynnöille SSL-juurivarmenteet (oletus: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Näytä aloitusruutu käynnistyksen yhteydessä (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Nollaa kaikki graafisen käyttöliittymän kautta tehdyt muutokset</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Tervetuloa</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Tervetuloa %1 pariin.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Tämä on ensimmäinen kerta, kun %1 on käynnistetty, joten voit valita data-hakemiston paikan.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Kun valitset OK, %1 aloittaa lataamaan ja käsittelemään koko %4 lohkoketjua (%2GB) aloittaen ensimmäisestä siirrosta %3 jolloin %4 käynnistettiin ensimmäistä kertaa.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Tämä alustava synkronointi on erittäin vaativa ja saattaa tuoda esiin laiteongelmia, joita ei aikaisemmin ole havaittu. Aina kun ajat %1:n, jatketaan siitä kohdasta, mihin viimeksi jäätiin.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Vaikka olisitkin valinnut rajoittaa lohkoketjun tallennustilaa (karsinnalla), täytyy historiatiedot silti ladata ja käsitellä, mutta ne poistetaan jälkikäteen levytilan säästämiseksi.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Käytä oletuskansiota</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Määritä oma kansio:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Ainakin %1 GB tietoa varastoidaan tähän hakemistoon ja tarve kasvaa ajan myötä.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Noin %1 GB tietoa varastoidaan tähän hakemistoon.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 lataa ja tallentaa kopion Bitcoinin lohkoketjusta.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Lompakko tallennetaan myös tähän hakemistoon.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Virhe: Annettu datahakemistoa \"%1\" ei voida luoda.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Virhe</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Lomake</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Viimeiset tapahtumat eivät välttämättä vielä näy, joten lompakkosi saldo voi olla virheellinen. Tieto korjautuu, kunhan lompakkosi synkronointi bitcoin-verkon kanssa on päättynyt. Tiedot näkyvät alla.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Verkko ei tule hyväksymään sellaisten bitcoinien käyttämistä, jotka liittyvät vielä näkymättömissä oleviin siirtoihin.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Lohkoja jäljellä</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Tunnistamaton..</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Viimeisimmän lohkon aika</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Edistyminen</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Edistymisen kasvu tunnissa</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>lasketaan..</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Arvioitu jäljellä oleva aika, kunnes synkronoitu</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Piilota</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Tuntematon. Synkronoidaan tunnisteita (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Avaa URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Avaa maksupyyntö URI:sta tai tiedostosta</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Valitse maksupyynnön tiedosto</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Valitse maksypyynnön tiedosto avattavaksi</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Asetukset</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Yleiset</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Käynnistä %1 automaattisesti järjestelmään kirjautumisen jälkeen.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Käynnistä %1 järjestelmään kirjautuessa</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>&amp;Tietokannan välimuistin koko</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Script &amp;varmistuksen threadien määrä</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP osoite proxille (esim. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Ilmoittaa, mikäli oletetettua SOCKS5-välityspalvelinta käytetään vertaisten tavoittamiseen tämän verkkotyypin kautta.</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Piilota kuvake järjestelmäpalkista.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Piilota tehtäväpalkin kuvake</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimoi ikkuna ohjelman sulkemisen sijasta kun ikkuna suljetaan. Kun tämä asetus on käytössä, ohjelma suljetaan vain valittaessa valikosta Poistu.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Ulkopuoliset URL-osoitteet (esim. block explorer,) jotka esiintyvät siirrot-välilehdellä valikossa. %s URL-osoitteessa korvataan siirtotunnuksella. Useampi URL-osoite on eroteltu pystyviivalla |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktiiviset komentorivivalinnat jotka ohittavat ylläolevat valinnat:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Avaa %1 asetustiedosto työhakemistosta.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Avaa asetustiedosto.</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Palauta kaikki asetukset takaisin alkuperäisiksi.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Palauta asetukset</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Verkko</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = jätä näin monta ydintä vapaaksi)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Lompakko</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expertti</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Ota käytöön &amp;Kolikkokontrolli-ominaisuudet</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Jos poistat varmistamattomien vaihtorahojen käytön, rahansiirron vaihtorahaa ei voida käyttää ennen vähintään yhtä varmistusta. Tämä vaikuttaa myös kuinka taseesi lasketaan.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Käytä varmistamattomia vaihtorahoja</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Avaa Bitcoin-asiakasohjelman portti reitittimellä automaattisesti. Tämä toimii vain, jos reitittimesi tukee UPnP:tä ja se on käytössä.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Portin uudelleenohjaus &amp;UPnP:llä</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Hyväksy yhteysiä ulkopuolelta</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Hyväksy sisääntulevia yhteyksiä</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Yhdistä Bitcoin-verkkoon SOCKS5-välityspalvelimen kautta.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Yhdistä SOCKS5-välityspalvelimen kautta (oletus välityspalvelin):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxyn &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Portti</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Proxyn Portti (esim. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Vertaisten saavuttamiseen käytettävät verkkotyypit:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Yhdistä Bitcoin-verkkoon erillisen SOCKS5-välityspalvelimen kautta piilotettuja Tor-palveluja varten.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Ikkuna</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Näytä ainoastaan ilmaisinalueella ikkunan pienentämisen jälkeen.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Pienennä ilmaisinalueelle työkalurivin sijasta</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>P&amp;ienennä suljettaessa</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Käyttöliittymä</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Käyttöliittymän kieli</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Tässä voit määritellä käyttöliittymän kielen. Muutokset astuvat voimaan seuraavan kerran, kun %1 käynnistetään.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>Yksikkö jona bitcoin-määrät näytetään</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Valitse mitä yksikköä käytetään ensisijaisesti bitcoin-määrien näyttämiseen.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Näytetäänkö kolikkokontrollin ominaisuuksia vai ei</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;Kolmannen osapuolen rahansiirto URL:t</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Peruuta</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>oletus</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>ei mitään</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Varmista asetusten palautus</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Ohjelman uudelleenkäynnistys aktivoi muutokset.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Asiakasohjelma sammutetaan. Haluatko jatkaa?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Kokoonpanoasetukset</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Asetustiedostoa käytetään määrittämään kokeneen käyttäjän lisävalintoja, jotka ylikirjoittavat graafisen käyttöliittymän asetukset. Lisäksi komentokehoitteen valinnat ylikirjoittavat kyseisen asetustiedoston.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Virhe</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Asetustiedostoa ei voitu avata.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Tämä muutos vaatii ohjelman uudelleenkäynnistyksen.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Antamasi proxy-osoite on virheellinen.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Lomake</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Näytetyt tiedot eivät välttämättä ole ajantasalla. Lompakkosi synkronoituu Bitcoin-verkon kanssa automaattisesti yhteyden muodostamisen jälkeen, mutta synkronointi on vielä meneillään.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Seuranta:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Käytettävissä:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Nykyinen käytettävissä oleva tase</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Odotetaan:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Varmistamattomien rahansiirtojen summa, jota ei lasketa käytettävissä olevaan taseeseen.</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Epäkypsää:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Louhittu saldo, joka ei ole vielä kypsynyt</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldot</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Yhteensä:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Tililläsi tällä hetkellä olevien Bitcoinien määrä</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Nykyinen tase seurantaosoitetteissa</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Käytettävissä:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Viimeisimmät rahansiirrot</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Vahvistamattomat rahansiirrot vain katseltaviin osoitteisiin</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Louhittu, ei vielä kypsynyt saldo vain katseltavissa osoitteissa</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Nykyinen tase seurantaosoitetteissa</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Maksupyyntövirhe</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Bitcoinia ei voi käynnistää: klikkaa-maksaaksesi -käsittelijän virhe</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI käsittely</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Maksupyynnön haku URL on virheellinen: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Virheellinen maksuosoite %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URIa ei voitu jäsentää! Tämä voi johtua virheellisestä Bitcoin-osoitteesta tai väärin muotoilluista URI parametreista.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Maksupyynnön tiedoston käsittely</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Maksupyyntötiedostoa ei voi lukea! Tämä saattaa johtua epäkelvosta maksupyyntötiedostosta.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Maksupyyntö hylätty</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Maksupyyntoverkko ei täsmää asiakasohjelman verkon kanssa.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Maksupyyntö vanhentui.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Maksupyyntöä ei ole alustettu.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Varmistamattomia maksupyyntöjä kustomoituun maksupalveluun ei tueta.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Virheellinen maksupyyntö.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Maksupyyntö %1 on liian pieni (kohdellaan tomuna).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Maksupalautus %1:sta</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Maksupyyntö %1 on liian suuri (%2 tavua, sallittu %3 tavua).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Virhe kommunikoidessa %1n kanssa: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Maksupyyntöä ei voida jäsentää!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Virheellinen vastaus palvelimelta %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Tietoverkon pyyntövirhe</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Rahansiirto tunnistettu</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Käyttöliittymä</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Noodi/Palvelu</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>NodeId</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Vasteaika</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Lähetetyt</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Vastaanotetut</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Määrä</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Syötä Bitcoin-osoite (esim. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Ei yhtään</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Ei saatavilla</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 ja %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 ei vielä sulkeutunut turvallisesti...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>tuntematon</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Virhe: Annettua data-hakemistoa \"%1\" ei ole olemassa.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Virhe: asetustiedostoa %1 ei voida jäsentää. Käytä vain avain=arvo merkintätapaa.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Virhe: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Tallenna kuva</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Kopioi kuva</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Tallenna QR-koodi</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG kuva (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Ei saatavilla</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Pääteohjelman versio</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>T&amp;ietoa</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>&amp;Debug-ikkuna</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Yleinen</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Käyttää BerkeleyDB-versiota</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Data-hakemisto</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Käynnistysaika</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Verkko</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nimi</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Yhteyksien lukumäärä</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Lohkoketju</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Nykyinen Lohkojen määrä</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Muistiallas</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Tämänhetkinen rahansiirtojen määrä</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Muistin käyttö</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Nollaa</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Vastaanotetut</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Lähetetyt</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Vertaiset</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Estetyt vertaiset</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Valitse vertainen eriteltyjä tietoja varten.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Sallittu</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Suunta</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versio</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Alkaen lohkosta</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Synkronoidut ylätunnisteet</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Synkronoidut lohkot</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Käyttöliittymä</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Avaa %1 -debug-loki tämänhetkisestä data-hakemistosta. Tämä voi viedä muutaman sekunnin suurille lokitiedostoille.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Pienennä fontin kokoa</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Suurenna fontin kokoa</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Palvelut</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Panna-pisteytys</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Yhteysaika</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Viimeisin lähetetty</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Viimeisin vastaanotettu</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Vasteaika</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Tämänhetkisen merkittävän yhteyskokeilun kesto.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Yhteyskokeilun odotus</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Pienin vasteaika</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Ajan poikkeama</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Viimeisimmän lohkon aika</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Avaa</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsoli</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Verkkoliikenne</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Yhteensä</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Sisään:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Ulos:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Debug lokitiedosto</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Tyhjennä konsoli</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;tunti</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;päivä</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;viikko</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;vuosi</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Katkaise yhteys</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Estä </translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Poista esto</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Tervetuloa %1 RPC-konsoliin.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Käytä nuolia ylös ja alas selataksesi historiaa, sekä %1 tyhjentääkseksi ruudun.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Lisätietoja konsolin käytöstä saat kirjoittamalla %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>VAROITUS: aktiiviset huijarit neuvovat kirjoittamaan komentoja tähän komentoriviin, varastaen lompakkosi sisällön. Älä käytä komentoriviä ilman täyttä ymmärrystä kirjoittamasi komennon toiminnasta.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Verkkoliikenne pysäytetty</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(solmukohdan id: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>%1 kautta</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>ei koskaan</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Sisääntuleva</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Ulosmenevä</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Kyllä</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Ei</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Tuntematon</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Määrä</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Nimi:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Viesti:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Valinnainen viesti liitetään maksupyyntöön ja näytetään avattaessa. Viestiä ei lähetetä Bitcoin-verkkoon.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Valinnainen nimi liitetään vastaanottavaan osoitteeseen.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Käytä lomaketta maksupyyntöihin. Kaikki kentät ovat &lt;b&gt;valinnaisia&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Valinnainen pyyntömäärä. Jätä tyhjäksi tai nollaksi jos et pyydä tiettyä määrää.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Tyhjennä lomakkeen kaikki kentät.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Tyhjennä</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Pyydettyjen maksujen historia</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Vastaanota maksu</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Näytä valittu pyyntö (sama toiminta kuin alkion tuplaklikkaus)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Näytä</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Poista valitut alkiot listasta</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Poista</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Kopioi URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopioi nimike</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopioi viesti</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopioi määrä</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-koodi</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopioi &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopioi &amp;Osoite</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Tallenna kuva</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Pyydä maksua osoitteeseen %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Maksutiedot</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Osoite</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Määrä</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nimike</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Viesti</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Tuloksen URI on liian pitkä, yritä lyhentää otsikon tai viestin tekstiä.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Virhe käännettäessä URI:a QR-koodiksi.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Aika</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nimike</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Viesti</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ei nimikettä)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(ei viestiä)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(ei pyydettyä määrää)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Pyydetty</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Lähetä kolikoita</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Kolikkokontrolli ominaisuudet</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Sisääntulot...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automaattisesti valitut</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Lompakon saldo ei riitä!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Määrä:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Tavuja:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Määrä:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Palkkio:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Palkkion jälkeen:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Vaihtoraha:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Jos tämä aktivoidaan mutta vaihtorahan osoite on tyhjä tai virheellinen, vaihtoraha tullaan lähettämään uuteen luotuun osoitteeseen.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Kustomoitu vaihtorahan osoite</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Rahansiirtokulu:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Valitse...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Fallbackfeen käyttö voi johtaa useita tunteja, päiviä (tai loputtomiin) kestävän siirron lähettämiseen. Harkitse palkkion valitsemista itse tai odota kunnes koko ketju on vahvistettu.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Varoitus: Kulujen arviointi ei ole juuri nyt mahdollista.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>pudota kulujen asetukset</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilotavu</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Jos määritelty palkkio on asetettu 1000 satoshiin ja siirto on vain 250 tavua, niin \"kilotavua kohti\" maksaa vain 250 satoshin palkkion, kun \"vähintään\" maksaa 1000 satoshia. Kilotavua suuremmilla siirroilla molemmat maksavat jokaista kilotavua kohti.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Piilota</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(lue työkaluvinkki)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Suositeltu:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Muokattu:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Älykästä rahansiirtokulua ei ole vielä alustettu. Tähän kuluu yleensä aikaa muutaman lohkon verran...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Lähetä usealla vastaanottajalle samanaikaisesti</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Lisää &amp;Vastaanottaja</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Tyhjennä lomakkeen kaikki kentät.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Tomu:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Vahvistusajan tavoite:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Käytä Replace-By-Fee:tä</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Tyhjennnä Kaikki</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balanssi:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Vahvista lähetys</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Lähetä</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopioi lukumäärä</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopioi määrä</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopioi rahansiirtokulu</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopioi rahansiirtokulun jälkeen</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopioi tavut</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopioi tomu</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopioi vaihtorahat</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 lohkoa)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 to %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Oletko varma, että haluat lähettää?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>lisätty rahansiirtomaksuna</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Kokonaismäärä %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>tai</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Vahvista kolikoiden lähetys</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Vastaanottajan osoite ei ole kelvollinen. Tarkista osoite.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Maksettavan määrän täytyy olla suurempi kuin 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Määrä ylittää tilisi saldon.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Kokonaismäärä ylittää saldosi kun %1 siirtomaksu lisätään summaan.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Osoite esiintyy useaan kertaan: osoitteita tulisi käyttää vain kerran kutakin.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Rahansiirron luonti epäonnistui!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Siirto hylättiin seuraavasta syystä: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>%1:tä ja korkeampaa siirtokulua pidetään mielettömän korkeana.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Maksupyyntö vanhentui.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Maksa vain vaadittu kulu %1 </translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Varoitus: Virheellinen Bitcoin-osoite </translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Varoitus: Tuntematon vaihtorahan osoite</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Vahvista kustomoitu vaihtorahan osoite</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Valitsemasi vaihtorahan osoite ei kuulu tähän lompakkoon. Osa tai kaikki varoista lompakossasi voidaan lähettää tähän osoitteeseen. Oletko varma?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ei nimikettä)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>M&amp;äärä:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Maksun saaja:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Nimi:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Valitse aikaisemmin käytetty osoite</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Tämä on normaali maksu.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Bitcoin-osoite johon maksu lähetetään</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Liitä osoite leikepöydältä</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Poista tämä alkio</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Kulu vähennetään lähetettävästä määrästä. Saaja vastaanottaa vähemmän bitcoineja kuin merkitset Määrä-kenttään. Jos saajia on monia, kulu jaetaan tasan.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>V&amp;ähennä maksukulu määrästä</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Käytä saatavilla oleva saldo</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Viesti:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Tämä on todentamaton maksupyyntö.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Tämä on todennettu maksupyyntö.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Aseta nimi tälle osoitteelle lisätäksesi sen käytettyjen osoitteiden listalle.</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Viesti joka liitettiin bitcoin: URI:iin tallennetaan rahansiirtoon viitteeksi. Tätä viestiä ei lähetetä Bitcoin-verkkoon.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Saaja:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Muistio:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Syötä tälle osoitteelle nimi lisätäksesi sen osoitekirjaan</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Kyllä</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 sulkeutuu...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Älä sammuta tietokonetta ennenkuin tämä ikkuna katoaa.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Allekirjoitukset - Allekirjoita / Varmista viesti</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Allekirjoita viesti</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Voit allekirjoittaa viestit / sopimukset omalla osoitteellasi todistaaksesi että voit vastaanottaa siihen lähetetyt bitcoinit. Varo allekirjoittamasta mitään epämääräistä, sillä phishing-hyökkääjät voivat huijata sinua luovuttamaan henkilöllisyytesi allekirjoituksella. Allekirjoita ainoastaan täysin yksityiskohtainen selvitys siitä, mihin olet sitoutumassa.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Bitcoin-osoite jolla viesti allekirjoitetaan</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Valitse aikaisemmin käytetty osoite</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Liitä osoite leikepöydältä</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Kirjoita tähän viesti minkä haluat allekirjoittaa</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Allekirjoitus</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopioi tämänhetkinen allekirjoitus leikepöydälle</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Allekirjoita viesti todistaaksesi, että omistat tämän Bitcoin-osoitteen</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Allekirjoita &amp;viesti</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Tyhjennä kaikki allekirjoita-viesti-kentät</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Tyhjennnä Kaikki</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Varmista viesti</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Syötä vastaanottajan osoite, viesti ja allekirjoitus (varmista että kopioit rivinvaihdot, välilyönnit, sarkaimet yms. täsmälleen) alle vahvistaaksesi viestin. Varo lukemasta allekirjoitukseen enempää kuin mitä viestissä itsessään on välttääksesi man-in-the-middle -hyökkäyksiltä. Huomaa, että tämä todentaa ainoastaan allekirjoittavan vastaanottajan osoitteen, tämä ei voi todentaa minkään tapahtuman lähettäjää!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Bitcoin-osoite jolla viesti on allekirjoitettu</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Tarkista viestin allekirjoitus varmistaaksesi, että se allekirjoitettiin tietyllä Bitcoin-osoitteella</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Varmista &amp;viesti...</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Tyhjennä kaikki varmista-viesti-kentät</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Valitse \"Allekirjoita Viesti\" luodaksesi allekirjoituksen.</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Syötetty osoite on virheellinen.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Tarkista osoite ja yritä uudelleen.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Syötetty osoite ei viittaa tunnettuun avaimeen.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Lompakon avaaminen peruttiin.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Yksityistä avainta syötetylle osoitteelle ei ole saatavilla.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Viestin allekirjoitus epäonnistui.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Viesti allekirjoitettu.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Allekirjoitusta ei pystytty tulkitsemaan.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Tarkista allekirjoitus ja yritä uudelleen.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Allekirjoitus ei täsmää viestin tiivisteeseen.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Viestin varmistus epäonnistui.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Viesti varmistettu.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Avoinna %1 asti</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>ristiriidassa maksutapahtumalle, jolla on %1 varmistusta</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/ei linjalla</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/varmistamaton, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>muistialtaassa</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>ei muistialtaassa</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>hylätty</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/vahvistamaton</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 vahvistusta</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Tila</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, ei ole vielä onnistuneesti kuulutettu</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Aika</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Lähde</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generoitu</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Lähettäjä</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>tuntematon</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Saaja</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>oma osoite</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>vain katseltava</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>nimi</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Krediitti</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>ei hyväksytty</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debiitti</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Debiitti yhteensä</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Krediitti yhteensä</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Siirtokulu</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Nettomäärä</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Viesti</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Kommentti</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Maksutapahtuman tunnus</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Maksutapahtuman kokonaiskoko</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Kauppias</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Luotujen kolikoiden täytyy kypsyä vielä %1 lohkoa ennenkuin niitä voidaan käyttää. Luotuasi tämän lohkon, se kuulutettiin verkolle lohkoketjuun lisättäväksi. Mikäli lohko ei kuitenkaan pääse ketjuun, sen tilaksi vaihdetaan \"ei hyväksytty\" ja sitä ei voida käyttää. Toisinaan näin tapahtuu, jos jokin verkon toinen solmu luo lohkon lähes samanaikaisesti sinun lohkosi kanssa.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Debug tiedot</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Maksutapahtuma</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Sisääntulot</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Määrä</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>tosi</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>epätosi</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Tämä ruutu näyttää yksityiskohtaisen tiedon rahansiirrosta</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>%1:n yksityiskohdat</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Aika</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tyyppi</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nimike</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Avoinna %1 asti</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Ei yhteydessä</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Varmistamaton</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Hylätty</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Varmistetaan (%1 suositellusta %2 varmistuksesta)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Varmistettu (%1 varmistusta)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Ristiriitainen</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Epäkypsä (%1 varmistusta, saatavilla %2 jälkeen)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Tätä lohkoa ei vastaanotettu mistään muusta solmusta ja sitä ei mahdollisesti hyväksytä!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Luotu, mutta ei hyäksytty</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Vastaanotettu osoitteella</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Vastaanotettu</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Lähetetty vastaanottajalle</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Maksu itsellesi</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Louhittu</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>vain katseltava</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(ei saatavilla)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ei nimikettä)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Rahansiirron tila. Siirrä osoitin kentän päälle nähdäksesi vahvistusten lukumäärä.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Rahansiirron vastaanottamisen päivämäärä ja aika.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Maksutapahtuman tyyppi.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Onko rahansiirrossa mukana ainoastaan katseltava osoite vai ei.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Käyttäjän määrittämä käyttötarkoitus rahansiirrolle.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Saldoon lisätty tai siitä vähennetty määrä.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Kaikki</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Tänään</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Tällä viikolla</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Tässä kuussa</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Viime kuussa</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Tänä vuonna</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Alue...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Vastaanotettu osoitteella</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Lähetetty vastaanottajalle</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Itsellesi</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Louhittu</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Muu</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Kirjoita osoite, siirron tunniste tai nimiö etsiäksesi</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minimimäärä</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Hylkää siirto</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Kasvata siirtokulun määrää</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopioi osoite</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopioi nimike</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopioi määrä</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopioi transaktion ID</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Kopioi rahansiirron raakavedos</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Kopioi rahansiirron täydet yksityiskohdat</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Muokkaa nimeä</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Näytä rahansiirron yksityiskohdat</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Vie rahansiirtohistoria</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Pilkuilla erotettu tiedosto (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Vahvistettu</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Vain katseltava</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Aika</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tyyppi</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nimike</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Osoite</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Vienti epäonnistui</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Rahansiirron historian tallentamisessa tapahtui virhe paikkaan %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Vienti onnistui</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Rahansiirron historia tallennettiin onnistuneesti kohteeseen %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Alue:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>vastaanottaja</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Yksikkö jossa määrät näytetään. Klikkaa valitaksesi toisen yksikön.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Lomakkoa ei ole ladattu.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Lähetä kolikoita</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Siirtokulun nosto epäonnistui</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Haluatko nostaa siirtomaksua?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Nykyinen palkkio:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Korota:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Uusi palkkio:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Vahvista palkkion korotus</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Siirtoa ei voida allekirjoittaa.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Siirtoa ei voitu tehdä</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Vie</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Vie auki olevan välilehden tiedot tiedostoon</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Varmuuskopioi lompakko</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Lompakkodata (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Varmuuskopio epäonnistui</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Lompakon tallennuksessa tapahtui virhe %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Varmuuskopio Onnistui</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Lompakko tallennettiin onnistuneesti tiedostoon %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Asetukset:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Määritä data-hakemisto</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Yhdistä noodiin hakeaksesi naapurien osoitteet ja katkaise yhteys</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Määritä julkinen osoitteesi</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Hyväksy merkkipohjaiset- ja JSON-RPC-käskyt</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Jaettu MIT -ohjelmistolisenssin alaisuudessa, katso mukana tuleva %s tiedosto tai %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Jos &lt;category&gt; on toimittamatta tai jos &lt;category&gt; = 1, tulosta kaikki debug-tieto.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Karsinta konfiguroitu alle minimin %d MiB. Käytä surempaa numeroa.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Karsinta: viime lompakon synkronisointi menee karsitun datan taakse. Sinun tarvitsee ajaa -reindex (lataa koko lohkoketju uudelleen tapauksessa jossa karsiva noodi)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Uudelleenskannaukset eivät ole mahdollisia karsivassa tilassa. Sinun täytyy käyttää -reindex joka lataa koko lohkoketjun uudelleen.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Virhe: Kriittinen sisäinen virhe kohdattiin, katso debug.log lisätietoja varten</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Kulu (muodossa %s/kB) joka lisätään rahansiirtoihin joita lähetät (oletus: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Karsitaan lohkovarastoa...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Aja taustalla daemonina ja hyväksy komennot</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>HTTP-palvelinta ei voitu käynnistää. Katso debug-lokista lisätietoja.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin-ydin</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>%s kehittäjät</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Kulusuhde (%s/kt) jota käytetään, kun kulun arviointiin tarvittava tietomäärä ei riitä (oletus: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Hyväksy valkolistatuilta vertaisilta vastaanotetut, välitetyt siirrot silloinkin, kun siirtojen välitys ei ole käytössä (oletus: %d)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Kytkeydy annettuun osoitteeseen ja pidä linja aina auki. Käytä [host]:portin merkintätapaa IPv6:lle.</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Ei voida lukita data-hakemistoa %s. %s on luultavasti jo käynnissä.</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Poista kaikki lompakon rahasiirrot ja palauta vain määrätyt osat lohkoketjusta -rescan -valitsimella käynnistyksen yhteydessä.</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Virhe luettaessa %s! Avaimet luetttiin oikein, mutta rahansiirtotiedot tai osoitekirjan sisältö saattavat olla puutteellisia tai vääriä.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Suorita käsky kun lompakossa rahansiirto muuttuu (%s cmd on vaihdettu TxID kanssa)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Muistissa pidettävien rahansiirtojen määrä tiiviiden lohkojen muodostusta varten (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Jos tämä lohko on ketjussa, oleta lohkon sekä sen edeltäjien olevan kelvollisia ja mahdollisesti ohita niiden skriptin vahvistus (0 vahvistaa kaiken, oletus: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Tarkistathan että tietokoneesi päivämäärä ja kellonaika ovat oikeassa! Jos kellosi on väärässä, %s ei toimi oikein.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Ole hyvä ja avusta, jos %s on mielestäsi hyödyllinen. Vieraile %s saadaksesi lisää tietoa ohjelmistosta.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Pyydä vertaisten osoitteita DNS-kyselyjen avulla, mikäli osoitteita on vähän (oletus: 1, ellei -connect valitsinta käytetä)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Aseta lohkon luonnissa lisättävien siirtojen vähimmäispalkkion suhde (%s/kt) (oletus: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Aseta script varmistuksen threadien lukumäärä (%u - %d, 0= auto, &lt;0 = jätä näin monta ydintä vapaaksi, oletus: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Lohkotietokanta sisältää lohkon, joka vaikuttaa olevan tulevaisuudesta. Tämä saattaa johtua tietokoneesi virheellisesti asetetuista aika-asetuksista. Rakenna lohkotietokanta uudelleen vain jos olet varma, että tietokoneesi päivämäärä ja aika ovat oikein.</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Tämä on esi-julkaistu kokeiluversio - Käyttö omalla vastuullasi - Ethän käytä louhimiseen tai kauppasovelluksiin.</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Lohkoja ei voida uudelleenlukea. Joulut uudelleenrakentamaan tietokannan käyttämällä -reindex-chainstate -valitsinta.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Tietokantaa ei onnistuttu palauttamaan tilaan ennen haarautumista. Lohkoketju pitää ladata uudestaan.</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Käytä UPnP:ta kuuntelevan portin kartoitukseen (oletus: 1 kun kuunnellaan ja -proxy ei käytössä)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Varoitus: Tietoverkko ei ole sovussa! Luohijat näyttävät kokevan virhetilanteita.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Varoitus: Olemme ristiriidassa vertaisten kanssa! Sinun tulee päivittää tai toisten solmujen tulee päivitää.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Tallennetaanko muistivaranto sulkemisen yhteydessä ja ladataanko se käynnistyksessä (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d viimeisestä 100 lohkosta sisälsi odottamattoman versiotiedon</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s korruptoitunut, korjaaminen epäonnistui</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool on oltava vähintään %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; voi olla:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Hyväksy yhteyksiä ulkopuolelta (vakioasetus: 1 jos -proxy tai -connect ei määritelty)</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Yritä palauttaa yksityiset avaimet korruptoituneesta lompakosta käynnistyksen yhteydessä</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Lohkon luonnin asetukset:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>-%s -osoitteen '%s' selvittäminen epäonnistui</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Yhteyden valinnat:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Tekijänoikeus (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Vioittunut lohkotietokanta havaittu</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Debuggaus/Testauksen valinnat:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Älä lataa lompakkoa ja poista lompakon RPC kutsut</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Haluatko uudelleenrakentaa lohkotietokannan nyt?</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Ota rahansiirtojen raakavedosten julkaisu käyttöön osoitteessa &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Ota rahansiirron korvaaminen käyttöön muistivarannossa (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Virhe luodessa %s: Et voi luoda ei-HD lompakkoja tällä versiolla.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Virhe alustaessa lohkotietokantaa</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Virhe alustaessa lompakon tietokantaympäristöä %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Virhe ladattaessa %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Virhe ladattaessa %s: Lompakko vioittunut</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Virhe ladattaessa %s: Tarvitset uudemman %s -version</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Virhe avattaessa lohkoketjua</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Virhe avattaessa lohkoindeksiä</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Varoitus: Levytila on vähissä!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Ei onnistuttu kuuntelemaan missään portissa. Käytä -listen=0 jos haluat tätä.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Tuodaan...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Virheellinen tai olematon alkulohko löydetty. Väärä data-hakemisto verkolle?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Alustava järkevyyden tarkistus epäonnistui. %s sulkeutuu.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Virheellinen määrä -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Virheellinen määrä -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Virheellinen määrä -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Pidä siirtojen muistivaranto alle &lt;n&gt; megatavun (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Ladataan P2P-vertaisten osoitteita...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Ladataan kieltolistaa...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Todennusevästeen sijainti (oletus: datahakemisto)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Ei tarpeeksi tiedostomerkintöjä vapaana.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Yhdistä vain solmukohtiin &lt;net&gt;-verkossa (ipv4, ipv6 tai onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Näytä tämä ohjeviesti ja poistu</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Näytä versio ja poistu.</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Karsintaa ei voi toteuttaa negatiivisella arvolla.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Karsittu tila ei ole yhteensopiva -txindex:n kanssa.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Muodosta ketjun tila ja lohkoindeksi levyllä olevista blk*.dat -tiedostoista</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Muodosta ketjun tila tällä hetkellä indeksoiduista lohkoista</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Varmistetaan lohkoja...</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Aseta tietokannan välimuistin koko megatavuissa (%d - %d, oletus: %d</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Aseta lompakkotiedosto (data-hakemiston sisällä)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Lähdekoodi löytyy %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Siirtokulun ja vaihtorahan laskenta epäonnistui</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Kytkeytyminen kohteeseen %s ei onnistu tällä tietokoneella. %s on luultavasti jo käynnissä.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Argumenttia -benchmark ei tueta, käytä -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Argumenttia -debugnet ei tueta, käytä -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Argumenttia -tor ei tueta, käytä -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Lokikategoriaa %s=%s ei tueta.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Päivitetään UTXO-tietokantaa</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Käytä UPnP:ta kuuntelevan portin kartoittamiseen (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Käytä testiketjua</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Varmistetaan lohkoja...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Lompakon debug- ja testausvalinnat:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Lompakko tarvitsee uudelleenkirjoittaa: käynnistä %s uudelleen</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Lompakon valinnat:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Salli JSON-RPC-yhteydet määritetystä lähteestä. Kelvolliset arvot &lt;ip&gt; ovat yksittäinen IP (esim. 1.2.3.4), verkko/verkkomaski (esim. 1.2.3.4/255.255.255.0) tai verkko/luokaton reititys (esim. 1.2.3.4/24). Tätä valintatapaa voidaan käyttää useita kertoja</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Kytkeydy osoitteeseen ja valkolistaa siihen yhdistävät vertaiset. Käytä [isäntä]:portti -merkintätapaa IPv6:lle</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Luo uudet tiedostot järjestelmän oletusoikeuksilla, älä umask 077:llä (toimii vain, jos lompakkotoiminto on poissa käytöstä)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Paljasta omat IP-osoitteet (oletus: 1 kun kuunnellaan ja -externalip tai -proxy ei ole käytössä)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Virhe: Saapuvien yhteyksien kuuntelu epäonnistui (kuuntelu palautti virheen %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Aja komento kun olennainen hälytys vastaanotetaan tai nähdään todella pitkä haara (%s komennossa korvataan viestillä)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Tätä pienempiä palkkioita (%s/kt) kohdellaan väittäessä, louhittaessa ja siirtoja luodessa nollana (oletus: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Mikäli paytxfee -valitsinta ei ole asetettu, sisällytä riittävä maksu, jotta siirron vahvistus alkaa keskimäärin n lohkon sisällä (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Suurin tietoa kantavien rahasiirtojen tietomäärä, joita välitetään ja louhitaan (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Satunnaista tunnisteet jokaiselle välityspalvelinyhteydelle. Tämä mahdollistaa Tor -virran eristämisen (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Siirtomäärä on liian pieni lähetettäväksi kulun vähentämisen jälkeen.</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Valkolistattuja vertaisia eivät voi DoS -estää, joten niiden siirrot välitetään aina, myös silloin, kun ne ovat jo muistivarannossa. Hyödyllinen esim. yhdyskäytävälle</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Palataksesi karsimattomaan tilaan joudut uudelleenrakentamaan tietokannan -reindex -valinnalla. Tämä lataa koko lohkoketjun uudestaan.</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Hyväksy julkisia REST-pyyntöjä (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Luo Tor-salattu palvelu automaattisesti (oletus: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Yhdistä SOCKS5 proxin kautta</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Virhe ladattaessa %s: Et voi poistaa HD-ominaisuutta jo olemassa olevasta HD-lompakosta.</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Virheitä tietokantaa luettaessa, ohjelma pysäytetään.</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Tuo lohkot ulkoisesta blk000??.dat -tiedostosta käynnistettäessä</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Tietoa</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Virheellinen -onion osoite tai isäntänimi: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Virheellinen -proxy osoite tai isäntänimi: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Kelvoton määrä argumentille -paytxfee=&lt;amount&gt;: '%s' (pitää olla vähintään %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Kelvoton verkkopeite määritelty argumentissa -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Pidä enimmillään &lt;n&gt; yhdistämiskelvotonta rahansiirtoa muistissa (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Pitää määritellä portti argumentilla -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Välityssolmukohdan asetukset:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC-palvelimen valinnat:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Vähennetään -maxconnections arvoa %d:stä %d:hen järjestelmän rajoitusten vuoksi.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Uudelleenskannaa lohkoketju käynnistyksen yhteydessä puuttuvien lompakon rahansiirtojen vuoksi</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Lähetä jäljitys/debug-tieto konsoliin, debug.log-tiedoston sijaan</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Näytä kaikki debuggaus valinnat: (käyttö: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Pienennä debug.log tiedosto käynnistyksen yhteydessä (vakioasetus: 1 kun ei -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Siirron vahvistus epäonnistui</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Rahansiirron määrä on liian pieni kattaakseen maksukulun</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Tämä on ohjelmistoa kokeelliseen käyttöön.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Tor-hallintaportin salasana (oletus: tyhjä)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Tor-hallintaportti jota käytetään jos onion-kuuntelu on käytössä (oletus: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Siirtosumma liian pieni</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Rahansiirto on liian suuri maksukulukäytännölle</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Siirtosumma liian iso</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Kytkeytyminen kohteeseen %s ei onnistunut tällä tietokonella (kytkeytyminen palautti virheen %s)</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Päivitä lompakko viimeisimpään formaattiin käynnistyksen yhteydessä</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Käyttäjätunnus JSON-RPC-yhteyksille</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Varmistetaan lompakko(ja)...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Varoitus</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Varoitus: tuntemattomia uusia sääntöjä aktivoitu (versiobitti %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Toimitaanko tilassa jossa ainoastaan lohkot sallitaan (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Sinun tulee uudelleenrakentaa tietokanta -reindex -valitsimella vaihtaaksesi -txindex -arvoa</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Tyhjennetään kaikki rahansiirrot lompakosta....</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ-ilmoitusasetukset:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Salasana JSON-RPC-yhteyksille</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Suorita käsky kun paras lohko muuttuu (%s cmd on vaihdettu block hashin kanssa)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Salli DNS kyselyt -addnode, -seednode ja -connect yhteydessä</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee on asetettu erittäin suureksi! Tämänkokoisia kuluja saatetaan maksaa yhdessä rahansiirrossa.</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Älä pidä rahansiirtoja muistivarannoissa kauemmin kuin &lt;n&gt; tuntia (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Virhe ladattaessa %s: Et voi ottaa HD:ta käyttöön jo olemassa olevalle ei-HD -lompakolle.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Virhe ladattaessa lompakkoa %s. -wallet -valitsimen pitää osoittaa tiedostonimeen (ei polkuun).</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Pakota rahansiirtojen välitys valkolistatuilta vertaisilta, vaikka ne rikkoisivatkin paikallisia välitysmääräyksiä (oletus: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Kuinka läpikäyvä lohkojen -checkblocks -todennus on (0-4, oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Kuinka monta sekuntia huonosti käyttäytyviä vertaisia estetään yhdistämästä (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Tulosta debuggaustieto (oletus: %u, annettu &lt;category&gt; valinnainen)</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Pyrkii pitämään lähtevän liikenteen alle annetun tavoitetteen (megatavuina 24 tunnissa). 0 = ei rajaa (oletus: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Ei tuettu argumentti -socks löytynyt. SOCKS -version asetusta ei enää tueta, ainoastaan SOCKS5 -välityspalvelimet on tuettu.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Argumenttia -whitelistalwaysrelay ei tueta ja se ohitettiin. Käytä -whitelistrelay ja/tai -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Käytä erillistä SOCKS5-proxyä tavoittaaksesi vertaisia Tor-piilopalveluiden kautta (oletus: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Varoitus: Tuntemattomia lohkoversioita louhitaan! Tuntemattomia sääntöjä saattaa olla voimassa</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s on asetettu todella korkeaksi!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(oletus: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Pyydä vertaisten osoitteita aina DNS-kyselyjen avulla (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Virhe ladattaessa lompakkoa %s. -wallet tiedostonimen pitää osoittaa tavalliseen tiedostoon.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Virhe ladattaessa lompakkoa %s. -wallet -tiedostonimi esiintyy useaan kertaan.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Virhe ladattaessa lompakkoa %s. -wallet tiedostonimi sisältää virheellisiä merkkejä.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Kuinka monta lohkoa tarkistetaan käynnistyksessä (oletus: %u, 0 = kaikki)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Sisällytä IP-osoitteet virheenkorjauslokissa (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Avainallas tyhjentyi, ole hyvä ja kutsu keypoolrefill ensin</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Kuuntele JSON-RPC-yhteyksiä portissa &lt;port&gt; (oletus: %u tai testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Kuuntele yhteyksiä portissa &lt;port&gt; (oletus: %u tai testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Ylläpidä enimmillään &lt;n&gt; yhteyttä vertaisiin (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Aseta lompakko kuuluttamaan rahansiirtoja</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maksimi yhteyttä kohden käytettävä vastaanottopuskurin koko, &lt;n&gt;*1000 tavua (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maksimi yhteyttä kohden käytettävä lähetyspuskurin koko, &lt;n&gt;*1000 tavua (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Lisää debug-tietojen alkuun aikaleimat (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Välitä ja louhi dataa kantavia rahansiirtoja (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Välitä ei-P2SH-multisig (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Aseta avainaltaan kooksi &lt;n&gt; (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Aseta suurin BIP141-lohkopaino (oletus: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Aseta RPC-kutsujen palvelemiseen tarkoitettujen säikeiden lukumäärä (oletus: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Määritä asetustiedosto (oletus: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Määritä yhteyden aikakatkaisu millisekunneissa (minimi: 1, oletus: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Määritä pid-tiedosto (oletus: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Käytä vahvistamattomia vaihtorahoja lähetettäessä rahansiirtoja (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Käynnistetään verkkoa...</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Tämä on jokaisesta siirrosta maksettava vähimmäismaksu.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Tämä on lähetyksestä maksettava maksu jonka maksat</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Aikaväli sopimattomien vertaisten yhteyksien katkaisuun (oletus: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Lähetyksen siirtosumman tulee olla positiivinen</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Maksutapahtumalla on liian pitkä muistialtaan ketju</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Lähetyksessä tulee olla ainakin yksi vastaanottaja</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Tuntematon verkko -onlynet parametrina: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Lompakon saldo ei riitä</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Ladataan lohkoindeksiä...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Ladataan lompakkoa...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Et voi päivittää lompakkoasi vanhempaan versioon</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Skannataan uudelleen...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Lataus on valmis</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Virhe</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_fr.ts",
    "content": "<TS language=\"fr\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Cliquer à droite pour modifier l’adresse ou l’étiquette</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Créer une nouvelle adresse</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nouveau</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copier l’adresse sélectionnée actuellement dans le presse-papiers</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copier</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Fermer</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Supprimer de la liste l’adresse sélectionnée actuellement</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporter les données de l’onglet actuel vers un fichier</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporter</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Supprimer</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Choisir l’adresse à laquelle envoyer des pièces</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Choisir l’adresse avec laquelle recevoir des pîèces</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>C&amp;hoisir</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Adresses d’envoi</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Adresses de réception</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Voici vos adresses Bitcoin pour envoyer des paiements. Vérifiez toujours le montant et l’adresse du destinataire avant d’envoyer des pièces.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Voici vos adresses Bitcoin pour recevoir des paiements. Il est recommandé d’utiliser une nouvelle adresse de réception pour chaque transaction.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copier l’adresse</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copier l’é&amp;tiquette</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Modifier</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exporter la liste d’adresses</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Valeurs séparées par des virgules (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Échec d’exportation</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Une erreur est survenue lors de l’enregistrement de la liste d’adresses vers %1. Veuillez ressayer plus tard.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Étiquette</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(aucune étiquette)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Fenêtre de dialogue de la phrase de passe</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Saisir la phrase de passe</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nouvelle phrase de passe</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Répéter la phrase de passe</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Afficher le mot de passe</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Saisissez la nouvelle phrase de passe du porte-monnaie.&lt;br/&gt;Veuillez utiliser une phrase de passe composée de &lt;b&gt;dix caractères aléatoires ou plus&lt;/b&gt;, ou de &lt;b&gt;huit mots ou plus&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Chiffrer le porte-monnaie</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Cette opération nécessite votre phrase de passe pour déverrouiller le porte-monnaie.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Déverrouiller le porte-monnaie</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Cette opération nécessite votre phrase de passe pour déchiffrer le porte-monnaie.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Déchiffrer le porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Changer la phrase de passe</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Saisir l’ancienne puis la nouvelle phrase de passe du porte-monnaie.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirmer le chiffrement du porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Avertissement : si vous chiffrez votre porte-monnaie et perdez votre phrase de passe, vous &lt;b&gt;PERDREZ TOUS VOS BITCOINS&lt;/b&gt; !</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Voulez-vous vraiment chiffrer votre porte-monnaie ?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Le porte-monnaie est chiffré</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 va maintenant se fermer pour terminer le processus de chiffrement. Souvenez-vous que le chiffrement de votre porte-monnaie ne peut pas protéger entièrement vos bitcoins contre le vol par des logiciels malveillants qui infecteraient votre ordinateur.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANT : toutes les sauvegardes précédentes du fichier de votre porte-monnaie devraient être remplacées par le fichier du porte-monnaie chiffré nouvellement généré. Pour des raisons de sécurité, les sauvegardes précédentes de votre fichier de porte-monnaie non chiffré deviendront inutilisables dès que vous commencerez à utiliser le nouveau porte-monnaie chiffré.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Échec de chiffrement du porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Le chiffrement du porte-monnaie a échoué en raison d’une erreur interne. Votre porte-monnaie n’a pas été chiffré.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Les phrases de passe saisies ne correspondent pas.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Échec de déverrouillage du porte-monnaie</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La phrase de passe saisie pour déchiffrer le porte-monnaie était erronée.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Échec de déchiffrement du porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>La phrase de passe du porte-monnaie a été modifiée avec succès.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Avertissement : la touche Verr. Maj. est activée !</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/masque réseau</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Banni jusqu’au</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signer un &amp;message...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronisation avec le réseau…</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Vue d’ensemble</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nœud</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Afficher une vue d’ensemble du porte-monnaie</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transactions</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Parcourir l’historique transactionnel</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Q&amp;uitter</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Quitter l’application</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>À &amp;propos de %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Afficher des informations à propos de %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>À propos de &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Afficher des informations sur Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Options…</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modifier les options de configuration de %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Chiffrer le porte-monnaie...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Sauvegarder le &amp;porte-monnaie...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Changer la phrase de passe...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Adresses d’&amp;envoi...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Adresses de &amp;réception...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Ouvrir une &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Cliquer pour désactiver l’activité réseau.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>L’activité réseau est désactivée.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Cliquer pour réactiver l’activité réseau.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synchronisation des en-têtes (%1)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Réindexation des blocs sur le disque...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Envoyer des pièces à une adresse Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Sauvegarder le porte-monnaie vers un autre emplacement</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Modifier la phrase de passe utilisée pour le chiffrement du porte-monnaie</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Fenêtre de &amp;débogage</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Ouvrir une console de débogage et de diagnostic</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Vérifier un message...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Porte-monnaie</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Envoyer</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Recevoir</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Afficher / cacher</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Afficher ou cacher la fenêtre principale</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Chiffrer les clés privées qui appartiennent à votre porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signer les messages avec vos adresses Bitcoin pour prouver que vous les détenez</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Vérifier les messages pour s’assurer qu’ils ont été signés avec les adresses Bitcoin indiquées</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fichier</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Paramètres</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Aide</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barre d’outils des onglets</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Demander des paiements (génère des codes QR et des URI bitcoin:)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Afficher la liste d’adresses d’envoi et d’étiquettes utilisées</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Afficher la liste d’adresses de réception et d’étiquettes utilisées</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Ouvrir une URI bitcoin: ou une demande de paiement</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Options de ligne de &amp;commande</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n connexion active avec le réseau Bitcoin</numerusform><numerusform>%n connexions actives avec le réseau Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indexation des blocs sur le disque...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Traitement des blocs sur le disque...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n bloc d’historique transactionnel a été traité</numerusform><numerusform>%n blocs d’historique transactionnel ont été traités</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>en retard de %1</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Le dernier bloc reçu avait été généré il y a %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Les transactions suivantes ne seront pas déjà visibles.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erreur</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Avertissement</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>À jour</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Afficher le message d’aide de %1 pour obtenir la liste des options de ligne de commande Bitcoin possibles.</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>Client %1</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Connexion aux pairs...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Rattrapage…</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Date : %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Montant : %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Type : %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Étiquette : %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresse : %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transaction envoyée</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transaction entrante</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>La génération de clé HD est &lt;b&gt;activée&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>La génération de clé HD est &lt;b&gt;désactivée&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Le porte-monnaie est &lt;b&gt;chiffré&lt;/b&gt; et est actuellement &lt;b&gt;déverrouillé&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Le porte-monnaie est &lt;b&gt;chiffré&lt;/b&gt; et actuellement &lt;b&gt;verrouillé&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Une erreur fatale est survenue. Bitcoin ne peut plus continuer en toute sécurité et va s’arrêter.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Sélection des pièces</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantité :</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Octets :</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Montant :</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Frais :</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Poussière :</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Après les frais :</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Monnaie :</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>Tout (des)sélectionner</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Mode arborescence</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Mode liste</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Montant</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Reçu avec une étiquette</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Reçu avec une adresse</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmations</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmée</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copier l’adresse</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copier l’étiquette</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copier le montant</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copier l’ID de la transaction</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Verrouiller les transactions non dépensées</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Déverrouiller les transactions non dépensées</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copier la quantité</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copier les frais</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copier après les frais</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copier les octets</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copier la poussière</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copier la monnaie</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 verrouillée)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>oui</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>non</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Cette étiquette devient rouge si un destinataire reçoit un montant inférieur au seuil actuel de poussière.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Peut varier +/- %1 satoshi(s) par entrée.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(aucune étiquette)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>monnaie de %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(monnaie)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Modifier l’adresse</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>É&amp;tiquette</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>L’étiquette associée à cette entrée de la liste d’adresses</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>L’adresse associée à cette entrée de la liste d’adresses. Cela ne peut être modifié que pour les adresses d’envoi.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresse</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nouvelle adresse de réception</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nouvelle adresse d’envoi</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Modifier l’adresse de réception</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Modifier l’adresse d’envoi</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>L’adresse saisie « %1 » n’est pas une adresse Bitcoin valide.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>L’adresse saisie « %1 » est déjà présente dans le carnet d’adresses.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Impossible de déverrouiller le porte-monnaie.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Échec de génération de la nouvelle clé.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Un nouveau répertoire de données sera créé.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nom</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Le répertoire existe déjà. Ajouter %1 si vous comptez créer un nouveau répertoire ici.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Le chemin existe déjà et n’est pas un répertoire.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Impossible de créer un répertoire de données ici.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>version</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>À propos de %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Options de ligne de commande</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Utilisation :</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>options de ligne de commande</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Options de l’IU :</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Choisir un répertoire de données au démarrage (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Définir la langue, par exemple « fr_CH » (par défaut : la langue du système)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Démarrer minimisé</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Définir les certificats SSL racine pour les requêtes de paiement (par défaut : -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Afficher l’écran d’accueil au démarrage (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Réinitialiser tous les paramètres changés dans l’IUG</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bienvenue</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Bienvenue à %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Puisque c’est la première fois que le logiciel est lancé, vous pouvez choisir où %1 stockera ses données.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Lorsque vous cliquez sur OK, %1 commence à télécharger et à traiter l’intégralité de la chaîne de blocs %4 (%2 Go) en débutant avec les transactions les plus anciennes de %3, quand %4 a été lancé initialement.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>La synchronisation initiale est très exigeante et pourrait exposer des problèmes matériels dans votre ordinateur passés inaperçus auparavant. Chaque fois que vous exécuterez %1, le téléchargement reprendra où il s’était arrêté.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Si vous avez choisi de limiter le stockage de la chaîne de blocs (élagage), les données historiques doivent quand même être téléchargées et traitées, mais seront supprimées par la suite pour minimiser l’utilisation de votre espace disque.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Utiliser le répertoire de données par défaut</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Utiliser un répertoire de données personnalisé :</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Au moins %1 Go de données seront stockés dans ce répertoire et sa taille augmentera avec le temps.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Approximativement %1 Go de données seront stockés dans ce répertoire.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 téléchargera et stockera une copie de la chaîne de blocs Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Le porte-monnaie sera aussi stocké dans ce répertoire.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Erreur : le répertoire de données indiqué « %1 » ne peut pas être créé.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erreur</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n Go d’espace libre disponible</numerusform><numerusform>%n Go d’espace libre disponibles</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(sur %n Go requis)</numerusform><numerusform>(sur %n Go requis)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulaire</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Les transactions récentes ne sont peut-être pas encore visibles et par conséquent le solde de votre porte-monnaie est peut-être erroné. Cette information sera juste quand votre porte-monnaie aura fini de se synchroniser avec le réseau Bitcoin, comme décrit ci-dessous.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Toute tentative de dépense de bitcoins affectés par des transactions qui ne sont pas encore affichées ne sera pas acceptée par le réseau.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Nombre de blocs restants</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Inconnu...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Estampille temporelle du dernier bloc</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progression</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Avancement de la progression par heure</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>calcul en cours...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Temps estimé avant la fin de la synchronisation</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Cacher</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Inconnu. Synchronisation des en-têtes (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Ouvrir une URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Ouvrir une demande de paiement à partir d’une URI ou d’un fichier</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI :</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Choisir le fichier de demande de paiement</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Choisir le fichier de demande de paiement à ouvrir</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Options</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principaux</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Démarrer %1 automatiquement après avoir ouvert une session sur l’ordinateur.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Démarrer %1 lors de l’ouverture d’une session</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Taille du cache de la base de &amp;données</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>Mo</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Nombre de fils de &amp;vérification de script</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Adresse IP du mandataire (p. ex. IPv4 : 127.0.0.1 / IPv6 : ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Indique si le mandataire SOCKS5 par défaut fourni est utilisé pour atteindre des pairs par ce type de réseau.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Utiliser un mandataire SOCKS&amp;5 séparé pour atteindre les pairs en utilisant les services cachés de Tor.</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Masquer l'icône dans la zone de notification.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>Cac&amp;her l’icône de la zone de notification</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimiser au lieu de quitter l’application lorsque la fenêtre est fermée. Si cette option est activée, l’application ne sera fermée qu’en sélectionnant Quitter dans le menu.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL de tiers (p. ex. un explorateur de blocs) apparaissant dans l’onglet des transactions comme éléments du menu contextuel. %s dans l’URL est remplacé par le hachage de la transaction. Les URL multiples sont séparées par une barre verticale |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Options de ligne de commande actives qui remplacent les options ci-dessus :</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Ouvrir le fichier de configuration %1 du répertoire de travail.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Ouvrir le fichier de configuration</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Réinitialiser toutes les options du client aux valeurs par défaut.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Réinitialiser les options</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Réseau</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt; 0 = laisser ce nombre de cœurs inutilisés)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Activer les fonctions de &amp;contrôle des pièces</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Si vous désactivé la dépense de la monnaie non confirmée, la monnaie d’une transaction ne peut pas être utilisée tant que cette transaction n’a pas reçu au moins une confirmation. Celai affecte aussi le calcul de votre solde.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Dépenser la monnaie non confirmée</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Ouvrir automatiquement le port du client Bitcoin sur le routeur. Cela ne fonctionne que si votre routeur prend en charge l’UPnP et si la fonction est activée.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapper le port avec l’&amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Accepter les connexions provenant de l’extérieur.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Permettre les connexions e&amp;ntrantes</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Se connecter au réseau Bitcoin par un mandataire SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>Se &amp;connecter par un mandataire SOCKS5 (mandataire par défaut) :</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP du mandataire :</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port :</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port du mandataire (p. ex. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Utilisé pour rejoindre les pairs par :</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Se connecter au réseau Bitcoin au travers d’un mandataire SOCKS5 séparé pour les services cachés de Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Fenêtre</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>N’afficher qu’une icône dans la zone de notification après minimisation.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimiser dans la zone de notification au lieu de la barre des tâches</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimiser lors de la fermeture</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Affichage</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Langue de l’interface utilisateur :</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>La langue de l’interface utilisateur peut être définie ici. Ce réglage sera pris en compte après redémarrage de %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unité d’affichage des montants :</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Choisir la sous-unité par défaut d’affichage dans l’interface et lors d’envoi de pièces.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Afficher ou non les fonctions de contrôle des pièces.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>URL de transaction de &amp;tiers</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>A&amp;nnuler</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>par défaut</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>aucune</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmer la réinitialisation des options</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Le redémarrage du client est exigé pour activer les changements.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Le client sera arrêté. Voulez-vous continuer ?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Options de configuration</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Le fichier de configuration est utilisé pour indiquer aux utilisateurs experts quelles options remplacent les paramètres de l’IUG. De plus, toute option de ligne de commande modifiera ce fichier de configuration.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erreur</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Impossible d’ouvrir le fichier de configuration.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Ce changement demanderait un redémarrage du client.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>L’adresse de serveur mandataire fournie est invalide.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulaire</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Les informations affichées peuvent être obsolètes. Votre porte-monnaie est automatiquement synchronisé avec le réseau Bitcoin lorsque la connexion s’établit, or ce processus n’est pas encore terminé.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Juste-regarder :</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponible :</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Votre solde actuel disponible</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>En attente :</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total des transactions qui doivent encore être confirmées et qui ne sont pas prises en compte dans le solde disponible</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Immature :</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Le solde miné n’est pas encore mûr</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Soldes</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total :</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Votre solde total actuel</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Votre balance actuelle en adresses juste-regarder</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Disponible :</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transactions récentes</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Transactions non confirmées vers des adresses juste-regarder</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Le solde miné dans des adresses juste-regarder, qui n’est pas encore mûr</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Solde total actuel dans des adresses juste-regarder</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Erreur de demande de paiement</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Impossible de démarrer le gestionnaire de cliquer-pour-payer bitcoin:</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Gestion des URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>L’URL de récupération de la demande de paiement est invalide : %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Adresse de paiement invalide %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>L’URI ne peut pas être analysée ! Cela peut être causé par une adresse Bitcoin invalide ou par des paramètres d’URI mal formés.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Gestion des fichiers de demande de paiement</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Le fichier de demande de paiement ne peut pas être lu ! Cela peut être causé par un fichier de demande de paiement invalide.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Demande de paiement rejetée</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Le réseau de la demande de paiement ne correspond pas au réseau du client.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>La demande de paiement a expiré</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>La demande de paiement n’est pas initialisée.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Les demandes de paiements non vérifiées vers des scripts de paiement personnalisés ne sont pas prises en charge.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Demande de paiement invalide.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Le paiement demandé d’un montant de %1 est trop faible (considéré comme de la poussière).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Remboursement de %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>La demande de paiement %1 est trop grande (%2 octets, %3 octets permis).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Erreur de communication avec %1 : %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>La demande de paiement ne peut pas être analysée !</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Mauvaise réponse du serveur %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Erreur de demande réseau</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Le paiement a été confirmé</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent utilisateur</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nœud/service</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>ID de nœud</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Envoyé</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Reçu</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Montant</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Saisir une adresse Bitcoin (p. ex. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 j</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 min</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Aucun</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N.D.</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n seconde</numerusform><numerusform>%n secondes</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minute</numerusform><numerusform>%n minutes</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n heure</numerusform><numerusform>%n heures</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n jour</numerusform><numerusform>%n jours</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n semaine</numerusform><numerusform>%n semaines</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 et %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n an</numerusform><numerusform>%n ans</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 o</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 Ko</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 Mo</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 Go</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 ne s’est pas encore arrêté en toute sécurité...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>inconnue</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Erreur : le répertoire de données indiqué « %1 » n’existe pas.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Erreur : impossible d’analyser le fichier de configuration : %1. N’utiliser que la syntaxe clef=valeur.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Erreur : %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Enregistrer l’image...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copier l’image</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Enregistrer le code QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Image PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N.D.</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Version du client</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informations</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Fenêtre de débogage</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Général</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Version BerkeleyDB utilisée</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Heure de démarrage</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Réseau</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nom</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Nombre de connexions</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Chaîne de blocs</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Nombre actuel de blocs</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Réserve de mémoire</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Nombre actuel de transactions</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Utilisation de la mémoire</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Réinitialiser</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Reçu</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Envoyé</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Pairs</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Pairs bannis</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Choisir un pair pour voir l’information détaillée.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Dans la liste blanche</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direction</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Version</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Bloc de départ</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>En-têtes synchronisés</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Blocs synchronisés</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent utilisateur</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Ouvrir le fichier journal de débogage de %1 à partir du répertoire de données actuel. Cela peut prendre quelques secondes pour les fichiers journaux de grande taille.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Diminuer la taille de police</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Augmenter la taille de police</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Services</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Pointage des bannissements</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Temps de connexion</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Dernier envoi</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Dernière réception</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Temps de ping</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>La durée d’un ping en cours.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Attente du ping</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Ping min.</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Décalage temporel</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Estampille temporelle du dernier bloc</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Ouvrir</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Console</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>Trafic &amp;réseau</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totaux</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Entrant :</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Sortant :</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Fichier journal de débogage</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Effacer la console</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;heure</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;jour</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;semaine</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;an</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Déconnecter</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Bannir pendant</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Réhabiliter</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Bienvenue sur la console RPC de %1.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Utiliser les touches de déplacement pour naviguer dans l’historique et %1 pour effacer l’écran.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Taper %1 pour afficher un aperçu des commandes proposées.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Pour plus d’informations sur l’utilisation de cette console, taper %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>AVERTISSEMENT : des fraudeurs sont réputés être à l’oeuvre, demandant aux utilisateurs de taper des commandes ici, dérobant ainsi le contenu de leurs porte-monnaie. Ne pas utiliser cette console sans une compréhension parfaite des conséquences d’une commande.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>L’activité réseau est désactivée.</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(ID de nœud : %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>par %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>jamais</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Entrant</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Sortant</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Oui</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Non</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Inconnu</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Montant :</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Étiquette :</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>M&amp;essage :</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Un message facultatif à joindre à la demande de paiement et qui sera affiché à l’ouverture de celle-ci. Note : le message ne sera pas envoyé avec le paiement par le réseau Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Un étiquette facultative à associer à la nouvelle adresse de réception.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Utiliser ce formulaire pour demander des paiements. Tous les champs sont  &lt;b&gt;facultatifs&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Un montant facultatif à demander. Ne rien saisir ou un zéro pour ne pas demander de montant précis.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Effacer tous les champs du formulaire.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Effacer</translation>\n    </message>\n    <message>\n        <source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</source>\n        <translation>Les adresses SegWit natives (aussi appelées Bech32 ou BIP-173) réduisent vos frais de transaction ultérieurs et offrent une meilleure protection contre les erreurs de frappe, mais les anciens porte-monnaie ne les prennent pas en charge. Si cette option n’est pas cochée, une adresse compatible avec les anciens porte-monnaie sera plutôt créée.</translation>\n    </message>\n    <message>\n        <source>Generate native segwit (Bech32) address</source>\n        <translation>Générer une adresse SegWit native (Bech32)</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historique des paiements demandés</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Demander un paiement</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Afficher la demande choisie (comme double-cliquer sur une entrée)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Afficher</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Retirer les entrées sélectionnées de la liste</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Retirer</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copier l’URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copier l’étiquette</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copier le message</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copier le montant</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Code QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copier l’&amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copier l’&amp;adresse</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Enregistrer l’image...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Demande de paiement à %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informations de paiement</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Montant</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Étiquette</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Message</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>L’URI résultante est trop longue. Essayez de réduire le texte de l’étiquette ou du message.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Erreur d’encodage de l’URI en code QR.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Étiquette</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Message</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(aucune étiquette)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(aucun message)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(aucun montant demandé)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Demandée</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Envoyer des pièces</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Fonctions de contrôle des pièces</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Entrants...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>choisi automatiquement</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fonds insuffisants !</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantité :</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Octets :</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Montant :</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Frais :</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Après les frais :</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Monnaie :</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Si cette option est activée et l’adresse de monnaie est vide ou invalide, la monnaie sera envoyée vers une adresse nouvellement générée.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Adresse personnalisée de monnaie</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Frais de transaction :</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Choisir...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>L’utilisation de l’option « fallbackfee » (frais de repli) peut avoir comme effet d’envoyer une transaction qui prendra plusieurs heures ou jours pour être confirmée ou qui ne le sera jamais. Envisagez de choisir vos frais manuellement ou attendez d’avoir validé l’intégralité de la chaîne.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Avertissement : l’estimation des frais n’est actuellement pas possible.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>réduire les paramètres des frais</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>par kilo-octet</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Si les frais personnalisés sont définis à 1 000 satoshis et que la transaction est seulement de 250 octets, le « par kilo-octet » ne paiera donc que 250 satoshis de frais, alors que le « total au moins » paiera 1 000 satoshis. Pour des transactions supérieures à un kilo-octet, les deux paieront par kilo-octet.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Cacher</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Il est correct de payer les frais minimum tant que le volume transactionnel est inférieur à l’espace dans les blocs. Mais soyez conscient que cela pourrait résulter en une transaction n’étant jamais confirmée une fois qu’il y aura plus de transactions que le réseau ne pourra en traiter.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(lire l’infobulle)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recommandés :</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Personnalisés : </translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Les frais intelligents ne sont pas encore initialisés. Cela prend habituellement quelques blocs...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Envoyer à plusieurs destinataires à la fois</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Ajouter un &amp;destinataire</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Effacer tous les champs du formulaire.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Poussière :</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Estimation du délai de confirmation :</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Activer Remplacer-par-des-frais</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Avec Remplacer-par-des-frais (BIP-125), vous pouvez augmenter les frais de transaction après qu’elle est envoyée. Sans cela, des frais plus élevés peuvent être recommandés pour compenser le risque accru de retard transactionnel.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Tout effacer</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Solde :</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirmer l’action d’envoi</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>E&amp;nvoyer</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copier la quantité</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copier le montant</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copier les frais</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copier après les frais</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copier les octets</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copier la poussière</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copier la monnaie</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blocs)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 à %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Voulez-vous vraiment envoyer ?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>ajoutés comme frais de transaction</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Montant total %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>ou</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Vous pouvez augmenter les frais ultérieurement (signale Remplacer-par-des-frais, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Ne signale pas Remplacer-par-des-frais, BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirmer l’envoi de pièces</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>L’adresse du destinataire est invalide. Veuillez la revérifier.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Le montant à payer doit être supérieur à 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Le montant dépasse votre solde.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Le montant dépasse votre solde lorsque les frais de transaction de %1 sont inclus.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Adresse identique trouvée : chaque adresse ne devrait être utilisée qu’une fois.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Échec de création de la transaction !</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>La transaction a été rejetée pour la raison suivante : %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Des frais supérieurs à %1 sont considérés comme ridiculement élevés.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>La demande de paiement a expiré</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Payer seulement les frais exigés de %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Il est estimé que la confirmation commencera dans %n bloc.</numerusform><numerusform>Il est estimé que la confirmation commencera dans %n blocs.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Avertissement : adresse Bitcoin invalide</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Avertissement : adresse de monnaie inconnue</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Confimer l’adresse personnalisée de monnaie</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>L’adresse que vous avez sélectionnée pour la monnaie ne fait pas partie de ce porte-monnaie. Les fonds de ce porte-monnaie peuvent en partie ou en totalité être envoyés vers cette adresse. Êtes-vous certain ?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(aucune étiquette)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Montant :</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Payer à :</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>É&amp;tiquette :</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Choisir une adresse déjà utilisée</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Ceci est un paiement normal.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>L’adresse Bitcoin à laquelle envoyer le paiement</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Coller l’adresse du presse-papiers</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Retirer cette entrée</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Les frais seront déduits du montant envoyé. Le destinataire recevra moins de bitcoins que le montant saisi dans le champ de montant. Si plusieurs destinataires sont sélectionnés, les frais seront partagés également..</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>S&amp;oustraire les frais du montant</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Utiliser le solde disponible</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Message :</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Cette demande de paiement n’est pas authentifiée.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Cette demande de paiement est authentifiée.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Saisir une étiquette pour cette adresse afin de l’ajouter à la liste d’adresses utilisées</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Un message qui était joint à l’URI bitcoin: et qui sera stocké avec la transaction pour référence. Note : ce message ne sera pas envoyé par le réseau Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Payer à :</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Mémo :</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Saisir une étiquette pour cette adresse afin de l’ajouter à votre carnet d’adresses</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Oui</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>Arrêt de %1...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Ne pas éteindre l’ordinateur jusqu’à la disparition de cette fenêtre.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signatures - Signer / vérifier un message</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Signer un message</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Vous pouvez signer des messages ou des accords avec vos adresses pour prouver que vous pouvez recevoir des bitcoins à ces dernières. Faites attention de ne rien signer de vague ou au hasard, car des attaques d’hameçonnage pourraient essayer de vous faire signer avec votre identité afin de l’usurper. Ne signez que des déclarations entièrement détaillées et avec lesquelles vous êtes d’accord.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>L’adresse Bitcoin avec laquelle signer le message</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Choisir une adresse déjà utilisée</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Coller une adresse du presse-papiers</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Saisir ici le message que vous désirez signer</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signature</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copier la signature actuelle dans le presse-papiers</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Signer le message afin de prouver que vous détenez cette adresse Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Signer le &amp;message</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Réinitialiser tous les champs de signature de message</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Tout effacer</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Vérifier un message</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Saisir ci-dessous l’adresse du destinataire, le message (s’assurer de copier fidèlement les retours à la ligne, les espaces, les tabulations, etc.) et la signature pour vérifier le message. Faire attention à ne pas déduire davantage de la signature que ce qui est contenu dans le message signé même, pour éviter d’être trompé par une attaque d’homme du milieu. Prendre en compte que cela ne fait que prouver que le signataire reçoit l’adresse et ne peut pas prouver la provenance d’une transaction !</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>L’adresse Bitcoin avec laquelle le message a été signé</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Vérifier le message pour s’assurer qu’il a été signé avec l’adresse Bitcoin indiquée</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Vérifier le &amp;message</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Réinitialiser tous les champs de vérification de message</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Cliquez sur « Signer le message » pour générer la signature</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>L’adresse saisie est invalide.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Veuillez vérifier l’adresse et ressayer.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>L’adresse saisie ne fait pas référence à une clé.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Le déverrouillage du porte-monnaie a été annulé.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>La clé privée pour l’adresse saisie n’est pas disponible.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Échec de signature du message.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Le message a été signé.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>La signature n’a pu être décodée.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Veuillez vérifier la signature et ressayer.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>La signature ne correspond pas au condensé du message.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Échec de vérification du message.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Le message a été vérifié.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>Ko/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Ouvert pendant encore %n bloc</numerusform><numerusform>Ouvert pendant encore %n blocs</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Ouvert jusqu’à %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>est en conflit avec une transaction ayant %1 confirmations</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/hors ligne</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/non confirmées, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>dans la réserve de mémoire</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>pas dans la réserve de mémoire</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandonnée</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/non confirmée</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 confirmations</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>État</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, n’a pas encore été diffusée avec succès</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, diffusée par %n nœud</numerusform><numerusform>, diffusée par %n nœuds</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Source</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Générée</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>De</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>inconnue</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>À</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>votre adresse</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>juste-regarder</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>étiquette</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Crédit</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>arrivera à maturité dans %n bloc</numerusform><numerusform>arrivera à maturité dans %n blocs</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>refusée</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Débit</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Débit total</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Crédit total</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Frais de transaction</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Montant net</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Message</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Commentaire</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID de la transaction</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Taille totale de la transaction</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Index de sorties</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Marchand</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Les pièces générées doivent mûrir pendant %1 blocs avant de pouvoir être dépensées. Lorsque ce bloc a été généré, il a été diffusé sur le réseau pour être ajouté à la chaîne de blocs. Si son intégration à la chaîne échoue, son état sera modifié en « refusée » et il ne sera pas possible de le dépenser. Cela peut arriver occasionnellement si un autre nœud génère un bloc à quelques secondes du vôtre.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Informations de débogage</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transaction</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Entrées</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Montant</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>vrai</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>faux</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Ce panneau affiche une description détaillée de la transaction</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Détails de %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Étiquette</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Ouvert pendant encore %n bloc</numerusform><numerusform>Ouvert pendant encore %n blocs</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Ouvert jusqu’à %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Hors ligne</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Non confirmée</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandonnée</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirmation (%1 sur %2 confirmations recommandées)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmée (%1 confirmations)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>En conflit</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Immature (%1 confirmations, sera disponible après %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Ce bloc n’a été reçu par aucun autre nœud et ne sera probablement pas accepté !</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Générée mais refusée</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Reçue avec</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Reçue de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Envoyée à</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Paiement à vous-même</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Miné</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>juste-regarder</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n.d)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(aucune étiquette)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>État de la transaction. Survoler ce champ avec la souris pour afficher le nombre de confirmations.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Date et heure de réception de la transaction.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Type de transaction.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Une adresse juste-regarder est-elle ou non impliquée dans cette transaction.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Intention/but de la transaction défini par l’utilisateur.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Le montant a été ajouté ou soustrait du solde.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Toutes</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Aujourd’hui</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Cette semaine</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Ce mois</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Le mois dernier</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Cette année</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Plage…</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Reçue avec</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Envoyée à</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>À vous-même</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Miné </translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Autres </translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Saisir l'adresse, l’ID de transaction ou l'étiquette à chercher</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Montant min.</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Abandonner la transaction</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Augmenter les frais de transaction</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copier l’adresse</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copier l’étiquette </translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copier le montant </translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copier l’ID de la transaction</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copier la transaction brute</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copier tous les détails de la transaction</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Modifier l’étiquette </translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Afficher les détails de la transaction</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exporter l’historique transactionnel</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Valeurs séparées par des virgules (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmée</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Juste-regarder</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Date </translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type </translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Étiquette</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID </translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Échec d’exportation</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Une erreur est survenue lors de l’enregistrement de l’historique transactionnel vers %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>L’exportation est réussie</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>L’historique transactionnel a été enregistré avec succès vers %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Plage :</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>à </translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unité d’affichage des montants. Cliquer pour choisir une autre unité.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Aucun porte-monnaie n’a été chargé.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Envoyer des pièces</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Erreur d’augmentation des frais</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Échec d’augmentation des frais de transaction</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Souhaitez-vous augmenter les frais ?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Frais actuels :</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Augmentation :</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nouveaux frais :</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Confirmer l’augmentation des frais</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Impossible de signer la transaction.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Impossible de valider la transaction</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporter</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporter les données de l’onglet actuel vers un fichier</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Sauvegarder le porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Données du porte-monnaie (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Échec de la sauvegarde</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Une erreur est survenue lors de l’enregistrement des données du porte-monnaie vers %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>La sauvegarde est réussie</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Les données du porte-monnaie ont été enregistrées avec succès vers %1</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Options :</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Indiquer le répertoire de données</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Se connecter à un nœud pour obtenir des adresses de pairs puis se déconnecter</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Indiquer votre propre adresse publique</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Accepter les commandes JSON-RPC et en ligne de commande</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distribué sous la licence MIT d’utilisation d’un logiciel. Consulter le fichier joint %s ou %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Si &lt;category&gt; n’est pas indiqué ou si &lt;category&gt; = 1, extraire toutes les données de débogage.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>L’élagage est configuré au-dessous du minimum de %d Mio. Veuillez utiliser un nombre plus élevé.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Élagage : la dernière synchronisation de porte-monnaie va par-delà les données élaguées.  Vous devez -reindex (réindexer, télécharger de nouveau toute la chaîne de blocs en cas de nœud élagué)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Les rebalayages sont impossibles en mode élagage. Vous devrez utiliser -reindex, ce qui téléchargera de nouveau la chaîne de blocs en entier.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Erreur : une erreur interne fatale s’est produite. Voir debug.log pour plus de détails</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Les frais (en %s/ko) à ajouter aux transactions que vous envoyez (par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Élagage du magasin de blocs...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Fonctionner en arrière-plan en tant que démon et accepter les commandes</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Impossible de démarrer le serveur HTTP. Voir le journal de débogage pour plus de détails.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Les développeurs de %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Un taux de frais (en %s/Ko) qui sera utilisé si l’estimation de frais ne possède pas suffisamment de données (par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Accepter les transactions relayées reçues de pairs de la liste blanche même si le nœud ne relaie pas les transactions (par défaut : %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Ajouter un nœud auquel se connecter et tenter de garder la connexion ouverte (voir l’aide de la commande RPC « addnode » pour plus d’infos)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Se lier à l’adresse donnée et toujours l’écouter. Utiliser la notation [host]:port pour l’IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Impossible d’obtenir un verrou sur le répertoire de données %s. %s fonctionne probablement déjà.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Il est impossible de fournir des connexions particulières et en même temps demander à addrman de trouver les connexions sortantes.</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Se connecter seulement aux nœuds précisés ; -connect=0 désactive les connexions automatiques (les règles pour ce pair sont identiques à celles de -addnode)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Supprimer toutes les transactions du porte-monnaie et ne récupérer que ces parties de la chaîne de blocs avec -rescan au démarrage</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Erreur de lecture de %s ! Toutes les clés ont été lues correctement, mais les données transactionnelles ou les entrées du carnet d’adresses sont peut-être manquantes ou incorrectes.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Exclure les informations de débogage pour une catégorie. Peut être utilisé en combinaison avec -debug=1 pour sortir les journaux de débogage pour toutes les catégories sauf une ou plusieurs particulières.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Exécuter la commande lorsqu’une transaction de porte-monnaie change (%s dans la commande est remplacée par TxID)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Si ce bloc est dans la chaîne, supposer qu’il est valide, ainsi que ces ancêtres, et ignorer potentiellement la vérification de leur script (0 pour tout vérifier, valeur par défaut : %s, réseau de test : %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Réglage moyen maximal autorisé de décalage de l’heure d’un pair. La perspective locale du temps peut être influencée par les pairs, en avance ou en retard, de cette valeur. (Par défaut : %u secondes)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Frais totaux maximaux (en %s) à utiliser en une seule transaction de porte-monnaie ou transaction brute ; les définir trop bas pourrait interrompre les grosses transactions (par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Veuillez vérifier que l’heure et la date de votre ordinateur sont justes ! Si votre horloge n’est pas à l’heure, %s ne fonctionnera pas correctement.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Si vous trouvez %s utile, vous pouvez y contribuer. Vous trouverez davantage d’informations à propos du logiciel sur %s.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Demander les adresses de pairs par consultation DNS si l’on manque d’adresses (par défaut : 1 sauf si -connect est utilisé)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Réduire les exigences de stockage en activant l’élagage (suppression) des anciens blocs. Cela permet d’appeler le RPC « pruneblockchain » pour supprimer des blocs précis et active l’élagage automatique des anciens blocs si une taille cible en Mio est fournie. Ce mode n’est pas compatible avec -txindex et -rescan. Avertissement : ramener ce paramètre à sa valeur antérieure exige de retélécharger l’intégralité de la chaîne de blocs (par défaut : 0 = désactiver l’élagage des blocs, 1 = permettre l’élagage manuel par RPC, &gt;%u = élaguer automatiquement les fichiers de blocs pour rester en deçà de la taille cible précisée en Mio).</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Définir le taux minimal de frais (en %s/Ko) pour les transactions à inclure dans la création de blocs (par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Définir le nombre de fils de vérification des scripts (%u à %d, 0 = auto, &lt; 0 = laisser ce nombre de cœurs inutilisés, par défaut : %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>La base de données de blocs contient un bloc qui semble provenir du futur. Cela pourrait être causé par la date et l’heure erronées de votre ordinateur. Ne reconstruisez la base de données de blocs que si vous êtes certain que la date et l’heure de votre ordinateur sont justes.</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Ceci est une préversion de test - son utilisation est entièrement à vos risques - ne pas l’utiliser pour miner ou pour des applications marchandes</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Les frais de transaction que vous pouvez ignorer si la monnaie rendue est inférieure à la poussière à ce niveau</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Impossible de relire les blocs. Vous devrez reconstruire la base de données en utilisant -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Impossible de rebobiner la base de données à un état préfourche. Vous devrez retélécharger la chaîne de blocs</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Utiliser l’UPnP pour mapper le port d’écoute (par défaut : 1 en écoute et sans -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Nom d’utilisateur et mot de passe haché pour les connexions JSON-RPC. Le champ &lt;userpw&gt; est au format : &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Un script python canonique est inclus dans share/rpcuser. Le client se connecte ensuite normalement en utilisant la paire d’arguments rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt;. Cette option peut être précisée plusieurs fois.</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Un porte-monnaie ne créera aucune transaction qui enfreint les limites de chaîne de la réserve de mémoire (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Avertissement : le réseau ne semble pas totalement d’accord ! Certains mineurs semblent éprouver des problèmes.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Avertissement : nous ne semblons pas être en accord complet avec nos pairs ! Une mise à niveau pourrait être nécessaire pour vous ou pour d’autres nœuds du réseau.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Enregistrer ou non la réserve de mémoire lors de la fermeture et la charger ou non lors du redémarrage (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d des 100 derniers blocs ont une version inattendue</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s corrompu, la récupération a échoué</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool doit être d’au moins %d Mo</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; peut être :</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Accepter les connexions entrantes (par défaut : 1 si aucun -proxy ou -connect )</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Ajouter un commentaire à la chaîne d’agent utilisateur</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Tenter de récupérer les clés privées d’un porte-monnaie corrompu lors du démarrage</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Options de création de blocs :</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Impossible de résoudre l’adresse -%s : « %s »</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Options de sélection de la chaîne :</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>L’index de changement est hors échelle</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Options de connexion :</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Tous droits réservés (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Une base de données de blocs corrompue a été détectée</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Options de débogage/de test :</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Ne pas charger le porte-monnaie et désactiver les appels RPC</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Voulez-vous reconstruire la base de données de blocs maintenant ?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Activer la publication du bloc de hachage dans &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Activer la publication de la transaction de hachage dans &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Activer la publication du bloc brut dans &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Activer la publication de la transaction brute dans &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Activer le remplacement de transactions dans la réserve de mémoire (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Erreur de création de %s : vous ne pouvez pas créer de porte-monnaie non HD avec cette version.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Erreur d’initialisation de la base de données de blocs</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Erreur d’initialisation de l’environnement de la base de données du porte-monnaie %s !</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Erreur de chargement de %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Erreur de chargement de %s : porte-monnaie corrompu</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Erreur de chargement de %s : le porte-monnaie exige une version plus récente de %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Erreur de chargement de la base de données de blocs</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Erreur d’ouverture de la base de données de blocs</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Erreur : l’espace disque est faible !</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Échec d’écoute sur un port quelconque. Utiliser -listen=0 si vous le voulez.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Échec de réanalyse du porte-monnaie lors de l’initialisation</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importation...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Bloc de genèse incorrect ou introuvable. Mauvais datadir pour le réseau ?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>L’initialisation du test de cohérence a échoué. %s est en cours de fermeture. </translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Montant invalide pour -%s=&lt;amount&gt; : « %s »</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Montant invalide pour -discardfee=&lt;amount&gt; : « %s »</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Montant invalide pour -fallbackfee=&lt;amount&gt; : « %s »</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Garder la réserve de mémoire transactionnelle sous &lt;n&gt; mégaoctets (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Chargement des adresses P2P...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Chargement de la liste d’interdiction...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Emplacement du fichier témoin auth (par défaut : data dir)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Pas assez de descripteurs de fichiers proposés.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Seulement se connecter aux nœuds du réseau &lt;net&gt; (IPv4, IPv6 ou oignon)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Imprimer ce message d’aide et quitter</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Imprimer la version et quitter</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>L’élagage ne peut pas être configuré avec une valeur négative.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Le mode élagage n’est pas compatible avec -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Reconstruire l’état de la chaîne et l’index des blocs à partir des fichiers blk*.dat sur le disque</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Reconstruire l’état de la chaîne à partir des blocs indexés actuellement</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Relecture des blocs...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Rebobinage des blocs...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>Envoyer les transactions avec « full-RBF opt-in » activé (RPC seulement, par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Définir la taille du cache de la base de données en mégaoctets (%d à %d, default: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Indiquer le fichier de porte-monnaie (dans le répertoire de données)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Le code source se trouve sur %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Échec du calcul des frais de transaction et de la monnaie</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Impossible de se lier à %s sur cet ordinateur. %s fonctionne probablement déjà.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Argument non pris en charge -benchmark ignoré, utiliser -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Argument non pris en charge -debugnet ignoré, utiliser -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Argument non pris en charge -tor trouvé, utiliser -onion</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Catégorie de journalisation non prise en charge %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Mise à niveau de la base de données UTXO</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Utiliser l’UPnP pour mapper le port d’écoute (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Utiliser la chaîne de test</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Le commentaire d’agent utilisateur (%s) contient des caractères dangereux.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Vérification des blocs... </translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Options de débogage/de test du porte-monnaie :</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Le porte-monnaie devait être réécrit : redémarrer %s pour terminer l’opération.</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Options du porte-monnaie :</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Permettre les connexions JSON-RPC de sources spécifiques. Valide pour &lt;ip&gt; qui sont une IP simple (p. ex. 1.2.3.4), un réseau/masque réseau (p. ex. 1.2.3.4/255.255.255.0) ou un réseau/CIDR (p. ex. 1.2.3.4/24). Cette option peut être être précisée plusieurs fois</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Se lier à l’adresse donnée et aux pairs s’y connectant. Utiliser la notation [host]:port pour l’IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Créer de nouveaux fichiers avec les permissions système par défaut, au lieu de umask 077 (effectif seulement avec la fonction du porte-monnaie désactivée)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Découvrir ses propres adresses (par défaut : 1 en écoute et sans externalip ou -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Erreur : l’écoute des connexions entrantes a échoué (l’écoute a retourné l’erreur %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Exécuter une commande lorsqu’une alerte pertinente est reçue, ou si nous voyons une bifurcation vraiment étendue (%s dans la commande est remplacé par le message)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Les frais (en %s/Ko) inférieurs à ce seuil sont considérés comme étant nuls pour le relais, le minage et la création de transactions (par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Si paytxfee n’est pas défini, inclure suffisamment de frais afin que les transactions commencent la confirmation en moyenne avant n blocs (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Montant invalide pour -maxtxfee=&lt;amount&gt; : « %s » (doit être au moins les frais minrelay de %s pour prévenir le blocage des transactions)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Quantité maximale de données dans les transactions du porteur de données que nous relayons et minons (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Aléer les authentifiants pour chaque connexion mandataire. Cela active l’isolement de flux de Tor (par défaut : %u) </translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Le montant de la transaction est trop bas pour être envoyé une fois que les frais ont été déduits</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Les pairs de la liste blanche ne peuvent pas être bannis DoS et leurs transactions sont toujours relayées, même si elles sont déjà dans le mempool, utile p. ex. pour une passerelle</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Vous devez reconstruire la base de données en utilisant -reindex afin de revenir au mode sans élagage. Cela retéléchargera complètement la chaîne de blocs.</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Accepter les demandes REST publiques (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Créer automatiquement un service caché Tor (par défaut : %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Se connecter par un mandataire SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Erreur de chargement de %s : vous ne pouvez pas désactiver HD sur un porte-monnaie HD existant</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Erreur de lecture de la base de données, fermeture en cours.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Erreur de mise à niveau de la base de données d’état de la chaîne</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importe des blocs à partir d’un fichier blk000??.dat externe lors du démarrage</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informations</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Adresse ou nom d’hôte -onion invalide : « %s »</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Adresse ou nom d’hôte -proxy invalide : « %s »</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Montant invalide pour -paytxfee=&lt;montant&gt; : « %s » (doit être au moins %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Masque réseau invalide indiqué dans -whitelist : « %s »</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Garder au plus &lt;n&gt; transactions non connectables en mémoire (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Un port doit être précisé avec -whitebind : « %s »</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Options de relais du nœud :</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Options du serveur RPC :</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Réduction de -maxconnections de %d à %d, due aux restrictions du système</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Réanalyser la chaîne de blocs au démarrage, à la recherche de transactions de porte-monnaie manquantes</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Envoyer les infos de débogage/trace à la console au lieu du fichier debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Montrer toutes les options de débogage (utilisation : --help --help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Réduire le fichier debug.log lors du démarrage du client (par défaut : 1 sans -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Échec de signature de la transaction</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Le montant de la transaction est trop bas pour que les frais soient payés</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Ceci est un logiciel expérimental.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Mot de passe du port de contrôle Tor (par défaut : vide)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Port de contrôle Tor à utiliser si l’écoute onion est activée (par défaut :%s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Le montant de la transaction est trop bas</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>La transaction est trop grosse pour la politique de frais</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>La transaction est trop grosse</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Impossible de se lier à %s sur cet ordinateur (bind a retourné l’erreur %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Impossible de générer les clés initiales</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Mettre à niveau le porte-monnaie au démarrage vers le format le plus récent</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nom d’utilisateur pour les connexions JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Vérification des porte-monnaie...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Le porte-monnaie %s se trouve en dehors du répertoire de porte-monnaie %s</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Avertissement</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Avertissement : nouvelles règles inconnues activées (bit de version %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Fonctionner ou non en mode blocs seulement (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Vous devez reconstruire la base de données en utilisant -reindex afin de modifier -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Supprimer toutes les transactions du porte-monnaie...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Options de notification ZeroMQ</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Mot de passe pour les connexions JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Exécuter la commande lorsque le meilleur bloc change (%s dans cmd est remplacé par le hachage du bloc)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Autoriser les recherches DNS pour -addnode, -seednode et -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = conserver les métadonnées de transmission, p. ex. les informations du propriétaire du compte et de demande de paiement, 2 = abandonner les métadonnées de transmission)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>La valeur -maxtxfee est très élevée ! Des frais aussi élevés pourraient être payés en une seule transaction.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Se lier à l’adresse donnée pour écouter des connexions JSON-RPC. Cette option est ignorée à moins que -rpcallowip soit aussi passé. Le port est facultatif et remplace -rpcport. Utiliser la notation [host]:port pour l’IPv6. Cette option peut être précisée plusieurs fois (par défaut : 127.0.0.1 et ::1 c.-à-d. l’hôte local ou si -rpcallowip a été précisé, 0.0.0.0 et :: c.-à-d. toutes les adresses)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Ne pas conserver de transactions dans la réserve de mémoire plus de &lt;n&gt; heures (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Octets équivalents par sigop dans les transactions pour relayer et miner (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Erreur de chargement de %s : vous ne pouvez pas activer HD sur un porte-monnaie non HD existant</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Erreur de chargement du porte-monnaie %s. Le paramètre -wallet ne doit indiquer qu’un nom de fichier (pas un chemin).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Les frais (en %s/Ko) inférieurs à ce seuil sont considérés comme étant nuls pour la création de transactions (par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Forcer le relais de transactions des pairs de la liste blanche même s’ils transgressent la politique locale de relais (par défaut : %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Degré de profondeur de la vérification des blocs -checkblocks (0-4, par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Maintenir un index complet des transactions, utilisé par l’appel RPC getrawtransaction (obtenir la transaction brute) (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Délai en secondes de refus de reconnexion pour les pairs présentant un mauvais comportement (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Extraire les informations de débogage (par défaut : %u, fournir &lt;category&gt; est facultatif)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Définit la sérialisation de la transaction brute ou les données hexa de bloc retournées en mode non-verbose, non-segwit(0) ou segwit(1) (par défaut : %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Indiquer le répertoire où placer les porte-monnaie (par défaut : &lt;datadir&gt;/wallets s’il existe, autrement &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Indiquer l’emplacement du fichier journal de débogage : ce peut être un chemin absolu ou un chemin relatif au répertoire de données (par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Prendre en charge le filtrage des blocs et des transactions avec les filtres bloom (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>Le taux de frais (en %s/Ko) qui indique votre tolérance à renoncer à la monnaie en l’ajoutant aux frais (par défaut : %s). Note : une sortie est rejetée si elle est considérée comme poussière pour ce taux, mais nous rejetterons toujours jusqu’aux frais de relais poussière et des frais de rejet par delà cette valeur qui sont limités par l’estimation de frais pour la cible la plus longue </translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Il s’agit des frais de transaction que vous pourriez payer si aucune estimation de frais n’est proposée.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Ce produit comprend des logiciels développés par le Projet OpenSSL pour être utilisés dans la boîte à outils OpenSSL %s, et un logiciel cryptographique écrit par Eric Young, ainsi qu’un logiciel UPnP écrit par Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>La taille totale de la chaîne de version de réseau (%i) dépasse la longueur maximale (%i). Réduire le nombre ou la taille des commentaires uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Tente de garder le trafic sortant sous la cible donnée (en Mio par 24 h), 0 = sans limite (par défaut : %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>L’argument non pris en charge -socks a été trouvé. Il n’est plus possible de définir la version de SOCKS, seuls les mandataires SOCKS5 sont pris en charge.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Argument non pris charge -whitelistalwaysrelay ignoré, utiliser -whitelistrelay et/ou -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Utiliser un serveur mandataire SOCKS5 séparé pour atteindre les pairs par les services cachés de Tor (par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Avertissement : des versions de blocs inconnues sont minées ! Il est possible que des règles inconnues soient en vigueur</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Avertissement : le fichier du porte-monnaie est corrompu, les données ont été récupérées ! Le fichier %s original a été enregistré en tant que %s dans %s ; si votre solde ou vos transactions sont incorrects, vous devriez restaurer une sauvegarde.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Pairs de la liste blanche se connectant à partir de l’adresse IP donnée (p. ex. 1.2.3.4) ou du réseau noté CIDR (p. ex. 1.2.3.0/24). Peut être précisé plusieurs fois.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>La valeur %s est très élevée !</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Toujours demander les adresses des pairs par recherche DNS (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Erreur de chargement du porte-monnaie %s. Le paramètre -wallet doit être un fichier ordinaire.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Erreur de chargement du porte-monnaie %s. Le nom de fichier -wallet indiqué est un doublon.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Erreur de chargement du porte-monnaie %s. Il y a des caractères invalides dans le nom de fichier -wallet.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Nombre de blocs à vérifier au démarrage (par défaut : %u, 0 = tous)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Inclure les adresses IP à la sortie de débogage (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>La réserve de clés est épuisée, veuillez d’abord appeler « keypoolrefill »</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Écouter les connexions JSON-RPC sur &lt;port&gt; (par défaut : %u ou tesnet : %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Écouter les connexions sur &lt;port&gt; (par défaut : %u ou tesnet : %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Garder au plus &lt;n&gt; connexions avec les pairs (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Obliger le porte-monnaie à diffuser les transactions</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Tampon maximal de réception par connexion, &lt;n&gt;*1000 octets (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Tampon maximal d’envoi par connexion », &lt;n&gt;*1000 octets (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Ajouter l’estampille temporelle au début de la sortie de débogage (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Relayer et miner les transactions du porteur de données (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Relayer les multisignatures non-P2SH (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Définir la taille de la réserve de clés à &lt;n&gt; (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Définir le poids maximal de bloc BIP141 (par défaut : %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Définir le nombre de fils pour les appels RPC (par défaut : %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Indiquer le fichier de configuration (par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Indiquer le délai d’expiration de la connexion en millisecondes (minimum : 1, par défaut : %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Indiquer le fichier pid (par défaut : %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Dépenser la monnaie non confirmée lors de l’envoi de transactions (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Démarrage des processus réseau...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Le porte-monnaie évitera de payer moins que les frais minimaux de relais. </translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Il s’agit des frais minimaux que vous payez pour chaque transaction. </translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Il s’agit des frais minimaux que vous payez si vous envoyez une transaction.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Seuil de déconnexion des pairs présentant un mauvais comportement (par défaut : %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Les montants transactionnels ne doivent pas être négatifs</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>La chaîne de la réserve de mémoire de la transaction est trop longue</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>La transaction doit comporter au moins un destinataire</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Réseau inconnu précisé dans -onlynet : « %s »</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fonds insuffisants</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Chargement de l’index des blocs…</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Chargement du porte-monnaie…</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Impossible de revenir à une version inférieure du porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Nouvelle analyse…</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Chargement terminé</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erreur</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_fr_CA.ts",
    "content": "<TS language=\"fr_CA\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Créer une nouvelle adresse</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copier l'adresse surligné a votre presse-papier</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Supprimer</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Entrer Mot de Passe</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nouveau Mot de passe</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Répéter Mot de Passe</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>(un)select all</source>\n        <translation>Toute sélectionner </translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>&amp;Label</source>\n        <translation>Record</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>Addresse</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bienvenue </translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Record</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(pas de record)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>copier l'adresse </translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fichier séparé par une virgule (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Record</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Addresse</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_fr_FR.ts",
    "content": "<TS language=\"fr_FR\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Faîtes un clique droit afin de modifier l'adresse ou l'étiquette</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Créer une nouvelle adresse</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nouveau</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copier l'adresse sélectionnée dans le presse-papiers</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copie</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>F&amp;ermer</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Supprimer l'adresse sélectionnée de la liste</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporter les données de l'onglet courant vers un fichier</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporter...</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Supprimer</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Choisissez une adresse où envoyer les bitcoins</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Choisissez une adresse où recevoir les bitcoins</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>C&amp;hoisir</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Adresses d'envoi</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Adresses de réception</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Ceci sont vos addresses Bitcoin pour envoyer vos paiements. Il faut toujours verifier les montants et l'addresse de reception avant de valider la transaction.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Ceci sont vos addresses Bitcoin pour recevoir vos paiements. Il est recommandé d'utiliser une nouvelle adresse de recepetion pour chaque transaction</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copie Adresse</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copier &amp;Étiquette </translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Éditer </translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exporter la liste d'adresses</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Valeurs séparées par des virgules (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Échec de l'export</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Une erreur s'est produite en enregistrant la list d'adresses à %1. Merci de reéssayer.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Étiquette</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(aucune étiquette)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialogue mot de passe</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Entrez la phrase de passe</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nouvelle phrase de passe</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Répétez la phrase de passe</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Montrer le mot de passe</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Entrez une nouvelle phrase de passe pour le porte-monnaie.&lt;br/&gt;Veuillez utiliser une phrase de &lt;b&gt;10 caractères aléatoire ou plus&lt;/b&gt; ou bien de &lt;b&gt;huit mots ou plus&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Chiffrer le porte-monnaie</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Cette operation nécessite la phrase clé de votre porte-monnaie pour le déverouiller</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Déverrouiller le porte-monnaie</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Cette opération nécessite la phrase clé de votre porte-monnaie pour le décrypter.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Décrypter le porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Changer la phrase de passe</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Entrez l'ancien mot de passe et le nouveau mot de passe pour le portefeuille</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirmer le chiffrement du porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Attention : Si vous chiffrez votre portefeuille et que vous perdez votre mot de passe vous &lt;b&gt; PERDREZ TOUS VOS BITCOINS&lt;/b&gt; !</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Êtes-vous sûr de de vouloir crypter votre portefeuille ? </translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Portefeuille chiffré</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 va à présent se fermer pour terminer la procédure de cryptage. N'oubliez pas que le chiffrement de votre porte-monnaie ne peut pas fournir une protection totale contre le vol par des logiciels malveillants qui infecteraient votre ordinateur.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANT: Toute sauvegarde préalable de votre porte-monnais devrait être emplacée par le fichier nouvellement généré et encrypté.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Le chiffrement du porte-monnaie a échoué</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Le chiffrement du porte-monnaie a échoué en raison d'une erreur interne. Votre porte-monnaie n'a pas été chiffré.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Les phrases de passe entrées ne correspondent pas.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Le déverrouillage du porte-monnaie a échoué</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La phrase de passe entrée pour décrypter le porte-monnaie était incorrecte.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Le décryptage du porte-monnaie a échoué</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Le changement du mot de passe du portefeuille à été effectué avec succès.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Attention : La touche majuscule est enfoncé.</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Masque de sous réseau</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Banni jusque </translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signer un &amp;message...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronisation avec le réseau...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Vue d'ensemble</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nœud</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Affiche une vue d'ensemble du porte-monnaie</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transactions</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Permet de parcourir l'historique des transactions</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Qui&amp;tter</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Quitter l'application</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;À propos de %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Afficher les informations sur %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>À propos de &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Afficher des informations sur Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Options...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modifier les options de configuration pour %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Chiffrer le portefeuille </translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Sauvegarder le portefeuille</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Modifier le mot de passe</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Adresses d'envoi</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Adresses de réception</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Ouvrir &amp;URI</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Cliquez pour désactiver l'activité du réseau.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Activité réseau désactivée</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Cliquez pour réactiver l'activité réseau</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synchronisation des entêtes (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Réindexer les blocs sur le disque...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Envoyer des pièces à une adresse Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Sauvegarder le porte-monnaie à un autre emplacement</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Modifier la phrase de passe utilisée pour le cryptage du porte-monnaie</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Fenêtre de débogage</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Ouvrir la console de débogage et de diagnostic</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Vérification du message</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Portefeuille</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Envoyer</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Réception</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Montrer / Cacher</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Montrer ou cacher la fenêtre principale</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Crypter les clé privées qui appartiennent votre portefeuille</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signer vos messages avec vos adresses Bitcoin pour prouver que vous les détenez</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Vérifier les messages pour s'assurer qu'ils soient signés avec les adresses Bitcoin spécifiées</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fichier</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Réglages</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Aide</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barre d'outils des onglets</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Demander des paiements (générer QR codes et bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Montrer la liste des adresses d'envois utilisées et les étiquettes</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Afficher la liste des labels et adresses de réception utilisées</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Ouvrir un bitcoin: URI ou demande de paiement</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Options de ligne de commande</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n connexion active avec le réseau Bitcoin</numerusform><numerusform>%n connexions actives avec le réseau Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indexation des blocs sur le disque...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Traitement des blocs sur le disque</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>en retard de %1</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Le dernier bloc reçu a été généré %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Les transactions ne seront plus visible après ceci.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erreur</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Attention</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>À jour</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Afficher le %1 message d'aide pour récupérer une liste des options de ligne de commande Bitcoin</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 client</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Connexion au pairs...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Rattrapage...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Date: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Montant:%1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Type: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Étiquette: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresse: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transaction envoyée</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transaction entrante</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Génération de clé HD &lt;b&gt;activée&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Génération de clé HD &lt;b&gt;désactivée&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Le porte-monnaie est &lt;b&gt;chiffré&lt;/b&gt; et est actuellement &lt;b&gt;déverrouillé&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Le porte-monnaie est &lt;b&gt;chiffré&lt;/b&gt; et est actuellement &lt;b&gt;verrouillé&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Une erreur fatale a eu lieu. Bitcoin ne peut plus continuer en toute sécurité et va s'éteindre</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Sélection de pièce </translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantité:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Octets:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Montant :</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Frais:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Poussière: </translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Après frais:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Change:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(dé)sélectionné tout:</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Mode arbre</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Mode list</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Montant</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Reçu avec : </translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Reçue avec l'adresse</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmations</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmée</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copier l'adresse</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copier l'étiquette</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copier le montant</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copier l'ID de transaction</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Verrouiller les non dépensés</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Déverrouiller les non dépensés</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copier la quantité</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copier les frais</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copier après les frais</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copier les octets</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copier la poussière </translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copier changement </translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 verrouillé)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>oui</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>non</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Cette étiquette devient rouge si un bénéficiaire reçoit une somme plus basse que la limite actuelle de poussière.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Peut varier de +/- %1 satoshi(s) par entrée.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(aucune étiquette)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>changement de %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(changement)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Éditer l'adresse</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Étiquette</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>L'étiquette associée à cette entrée du carnet d'adresses</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>L'adresse associée avec cette entrée du carnet d'adresses. Ne peut être modifiée que pour les adresses d'envoi.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresse</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nouvelle adresse de réception</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nouvelle adresse d'envoi</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Éditer l'adresse de réception</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Éditer l'adresse d'envoi</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>L'adresse entrée \"%1\" n'est pas une adresse Bitcoin valide.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>L'adresse fournie « %1 » est déjà présente dans le carnet d'adresses.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Impossible de déverrouiller le porte-monnaie.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Échec de la génération de la nouvelle clef.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Un nouveau répertoire de données sera créé. </translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nom</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Le répertoire existe déjà. Ajouter %1 si vous voulez créer un nouveau répertoire ici.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Le chemin existe déjà et ce n'est pas un répertoire. </translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Impossible de créer un répertoire ici.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>version</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>A propos %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Options de ligne de commande</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Utilisation :</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>Options de ligne de commande</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Options interface graphique:</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Définir la langue, par exemple \"de_DE\" (défaut: locale système)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Démarrer sous forme minimisée</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Définir les certificats SSL racines pour les requêtes de paiement (défaut:-système-)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Réinitialiser tous les paramètres modifiés dans le GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bienvenue </translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Bienvenue sur %1.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Utiliser le répertoire par défaut </translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Utiliser votre propre répertoire</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Environ %1 GB de données seront stockées dans ce répertoire, et cela augmentera au cours du temps.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Environ %1 GB de données seront stockées dans ce répertoire.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Le porte-monnaie sera aussi stocké dans ce répertoire.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Erreur: Le répertoire de données \"%1\" n'a pas pu être créé. </translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erreur</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulaire</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Cacher</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Ouvrir URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Ouvrir une demande de paiement depuis une URI ou un fichier</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Sélectionner un fichier de demande de paiement</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Sélectionnez le fichier de demande de paiement à ouvrir</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Options</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Taille du cache de la base de données.</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MO</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Adresse IP du proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Réinitialiser toutes les options du client par défaut.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Options de réinitialisation </translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Réseau</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Ouvrir le port du client Bitcoin automatiquement sur le routeur. Cela ne fonctionne que si votre routeur supporte l'UPnP et si la fonctionnalité est activée.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Ouvrir le port avec l'&amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port du proxy (e.g. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Utilisé pour contacter des pairs via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Fenêtre</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimiser dans la barre système au lieu de la barre des tâches</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>Mi&amp;nimiser lors de la fermeture</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Afficher</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Interface utilisateur &amp;langage:</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Annuler </translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>defaut</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>aucun</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmer les options de réinitialisation </translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Redémarrage du client nécessaire pour activer les changements.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erreur</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Ce changement nécessiterait un redémarrage du client.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>L'adresse du proxy est invalide.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulaire</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Regarder seulement:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponible: </translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>En attente:</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Immature:</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Balances</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Votre balance totale courante</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Dépensable: </translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transactions récentes </translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Erreur lors de la requête de paiement</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Adresse de paiement invalide %1</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Requête de paiement rejetée </translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Demande de paiement expirée.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>La demande de paiement n'a pas été initialisée.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Demande de paiement invalide.</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Remboursement de %1</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Mauvaise réponse du serveur %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Erreur de demande de réseau</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent Utilisateur</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nœud/Service </translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Envoyé</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Reçu </translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Montant</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Entrer une adresse Bitcoin (e.g. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 j</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Aucun</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 et %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 O</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KO</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MO</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GO</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>inconnu</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Sauvegarder image</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copier image</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Sauvegarder QR code</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Image PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Version du client</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Information</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Fenêtre de débogage </translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Général</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Version BerkeleyDButilisée </translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Le temps de démarrage</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Réseau</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nom</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Nombre de connexions</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Chaîne de bloc </translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Nombre courant de blocs</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Mémoire du pool</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Nombre courant de transactions</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Usage de la mémoire</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Reçu </translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Envoyé</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Pairs</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Pairs bannis</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Autorisé par la liste</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direction</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Version</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Bloc de départ</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Blocs Synchronisés </translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent Utilisateur</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Services</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Score de ban</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Temps de connexion</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Dernier envoyé</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Dernier reçu</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Temps du ping</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Attente du ping</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Ouvert</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Console</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Trafic réseau</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totaux</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Entrée:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Sortie:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Fichier du journal de débogage</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Nettoyer la console</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;heure</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;jour</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;semaine</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;an</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>jamais</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Oui</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Non</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Inconnu</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Montant :</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Étiquette :</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Message :</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Nettoyer tous les champs du formulaire.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Nettoyer</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historique des demandes de paiements.</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Demande de paiement</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Montrer</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Retirer</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copier l'étiquette</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copier message</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copier le montant</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Code</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copier &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copier &amp;Adresse</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Sauvegarder image</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Demande de paiement à %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informations de paiement</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Montant</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Étiquette</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Message</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Étiquette</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Message</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(aucune étiquette)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(pas de message)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Demandé</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Envoyer des pièces</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Sorties...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>Automatiquement sélectionné </translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fonds insuffisants</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantité:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Octets:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Montant :</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Frais:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Après frais:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Change:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Frais de transaction</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Choisir...</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>par kilo octet</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Cacher</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recommandé: </translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Envoyer des pièces à plusieurs destinataires à la fois</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Nettoyer tous les champs du formulaire.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Poussière: </translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Nettoyer &amp;Tout</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Solde :</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirmer l'action d'envoi</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>E&amp;voyer</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copier la quantité</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copier le montant</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copier les frais</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copier après les frais</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copier les octets</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copier la poussière </translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copier changement </translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 à %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Êtes-vous sûr de vouloir envoyer ?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>Ajoute en tant que frais de transaction</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Montant Total %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>ou</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirmer l'envoi des pièces</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Le montant à payer doit être supérieur à 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Le montant excède votre balance. </translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Échec de la création de la transaction  </translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Demande de paiement expirée.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Payer seulement les frais obligatoire de %1</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Attention: Adresse Bitcoin Invalide</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(aucune étiquette)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Montant :</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Payer &amp;à :</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Étiquette :</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Choisir une adresse précédemment utilisée </translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>C'est un paiement normal.</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Coller une adresse depuis le presse-papiers</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Retirer cette entrée</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Message :</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Payer à :</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Entrez une étiquette pour cette adresse afin de l'ajouter à votre carnet d'adresses</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Oui</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Signer le message</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Choisir une adresse précédemment utilisée </translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Coller une adresse depuis le presse-papiers</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Entrez ici le message que vous désirez signer</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signature</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copier l'adresse courante dans le presse papier</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>&amp;Signer le message</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Nettoyer &amp;Tout</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Vérifier message</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Vérifier &amp;Message</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>L'adresse entrée est invalide. </translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Vérifiez l'adresse et réessayer. </translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Message signé. </translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Vérifiez la signature et réessayer.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Vérification du message échouée.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Message vérifié. </translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KO/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Ouvert jusqu'à %1</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandoné</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/non confirmée</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 confirmations</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>État</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, n'a pas encore été diffusée avec succès</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Source</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Généré</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>De</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>inconnu</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Á</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>Votre adresse</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>Lecture uniquement</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>Étiquette </translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Crédit</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>Pas accepté</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Débit</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Débit total</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Crédit total </translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Frais de transaction</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Montant net</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Message</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Commentaire </translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID de transaction</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Marchant</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Information de débogage </translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transaction</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Entrées </translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Montant</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>vrai</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>faux</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Ce panneau affiche une description détaillée de la transaction</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Étiquette</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Ouvert jusqu'à %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Hors ligne</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Non Confirmé</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandoné</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmée (%1 confirmations)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Ce bloc n'a été reçu par aucun autre nœud et ne sera probablement pas accepté !</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Généré mais pas accepté</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Reçues avec</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Reçue de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Envoyées à</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Paiement à vous-même</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Extraction</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>Lecture uniquement</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(indisponible)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(aucune étiquette)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>État de la transaction. Laissez le pointeur de la souris sur ce champ pour voir le nombre de confirmations.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Date et heure de réception de la transaction.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Type de transaction.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Montant ajouté au ou enlevé du solde.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Toutes</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Aujourd'hui</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Cette semaine</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Ce mois</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Mois dernier</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Cette année</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Intervalle...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Reçues avec</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Envoyées à</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>À vous-même</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Extraction</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Autres</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Montant min</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copier l'adresse</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copier l'étiquette</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copier le montant</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copier l'ID de transaction</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Éditer l'étiquette</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Afficher les détails de la transaction</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exporter l'historique des transactions</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Valeurs séparées par des virgules (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmée</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Date</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Étiquette</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Échec de l'export</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Export réalisé avec sucés </translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Intervalle :</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>à</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Aucun portefeuille a été chargé.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Envoyer des pièces</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporter...</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporter les données de l'onglet courant vers un fichier</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Sauvegarder le porte-monnaie</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Données de porte-monnaie (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>La sauvegarde a échoué</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Sauvegarde réussie</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Options :</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Spécifier le répertoire de données</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Spécifier votre adresse publique </translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Accepter les commandes de JSON-RPC et de la ligne de commande</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Fonctionner en arrière-plan en tant que démon et accepter les commandes</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Impossible de démarrer le serveur HTTP. Voir le journal de débogage pour plus de détails.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; peut être:</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Options de création de bloc:</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Options de connexion:</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Options de débogage/test </translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>\nImportation ...</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Vérifications des blocs...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Options du portefeuille:</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(défaut: %u)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Connecté au travers du proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Adresse ou nom d'hôte -onion invalide: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Adresse -proxy invalide: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Options du relais de nœud: </translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Options de serveur RPC:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Envoyer les informations de débogage/trace à la console au lieu du fichier debug.log</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Transaction signée échouée</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>C'est un logiciel expérimental.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Montant de la transaction trop bas</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Montant de la transaction trop élevé pour la politique de frais</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transaction trop grande</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nom d'utilisateur pour les connexions JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Attention</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Mot de passe pour les connexions JSON-RPC</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(défaut: %s)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Spécifier le pid du fichier (défaut: %s)</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fonds insuffisants</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Chargement de l'index des blocs...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Chargement du porte-monnaie...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Vous ne pouvez pas rétrograder votre portefeuille</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Nouvelle analyse...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Chargement terminé</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erreur</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_gl.ts",
    "content": "<TS language=\"gl\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crear unha nova dirección</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Novo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiar a dirección seleccionada ao cartafol</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Pechar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Borrar a dirección actualmente seleccionada da listaxe</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar os datos da pestaña actual a un arquivo.</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Borrar</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diálogo de Contrasinal</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Introduce contrasinal</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Novo contrasinal</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repite novo contrasinal</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>&amp;Asinar mensaxe...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizando coa rede...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Vista xeral</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Amosar vista xeral do moedeiro</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transacciones</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Navegar historial de transaccións</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Saír</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Saír da aplicación</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Acerca de &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Amosar información acerca de Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opcións...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Encriptar Moedeiro...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Copia de &amp;Seguridade do Moedeiro...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Cambiar contrasinal...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Direccións para recibir</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexando bloques no disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviar moedas a unha dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Facer copia de seguridade do moedeiro noutra localización</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambiar o contrasinal empregado para a encriptación do moedeiro</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Ventana de &amp;Depuración</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Abrir consola de depuración e diagnóstico</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verificar mensaxe...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Moedeiro</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Recibir</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Amosar/Agachar</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Amosar ou agachar a ventana principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Encriptar as claves privadas que pertencen ao teu moedeiro</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Asina mensaxes coas túas direccións Bitcoin para probar que te pertencen</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verificar mensaxes para asegurar que foron asinados con direccións Bitcoin dadas.</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Arquivo</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>Axus&amp;tes</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>A&amp;xuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra de ferramentas</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Solicitar pagos (xenera códigos QR e bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Amosar a listaxe de direccións e etiquetas para enviar empregadas</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Amosar a listaxe de etiquetas e direccións para recibir empregadas</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Abrir un bitcoin: URI ou solicitude de pago</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opcións da liña de comandos</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 detrás</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>O último bloque recibido foi xerado fai %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>As transaccións despois desta non serán todavía visibles.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Precaución</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Actualizado</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Poñendo ao día...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transacción enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transacción entrante</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>O moedeiro está &lt;b&gt;encriptado&lt;/b&gt; e actualmente &lt;b&gt;desbloqueado&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>O moedeiro está &lt;b&gt;encriptado&lt;/b&gt; e actualmente &lt;b&gt;bloqueado&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidade:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Importe:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Pago:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambiar:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(des)selecciona todo</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modo árbore</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modo lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidade</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmacións</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Modificar Dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>A etiqueta asociada con esta entrada da listaxe de direccións</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>A dirección asociada con esta entrada na listaxe de dirección. Esta so pode ser modificada por direccións para enviar.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Dirección</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Crearáse un novo directorio de datos.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nome</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>O directorio xa existe. Engade %1 se queres crear un novo directorio aquí.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>A ruta xa existe e non é un directorio.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Non se pode crear directorio de datos aquí</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versión</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opcións da liña de comandos</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Emprego:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opcións da liña de comandos</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Benvido</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Empregar o directorio de datos por defecto</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Empregar un directorio de datos personalizado</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora do último bloque</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Abrir URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Abrir solicitude de pago dende URI ou ficheiro</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Seleccionar ficheiro de solicitude de pago</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opcións</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Restaurar todas as opcións de cliente ás por defecto</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>Opcións de &amp;Restaurar</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Rede</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Moedeiro</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Abrir automáticamente o porto do cliente Bitcoin no router. Esto so funciona se o teu router soporta UPnP e está habilitado.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapear porto empregando &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP do Proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Porto:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Porto do proxy (exemplo: 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Xanela</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Amosar so un icono na bandexa tras minimiza-la xanela.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimizar á bandexa en lugar de á barra de tarefas.</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimizar ao pechar</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Visualización</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Linguaxe de interface de usuario:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unidade na que amosar as cantidades:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Escolle a unidade de subdivisión por defecto para amosar na interface e ao enviar moedas.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancelar</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>por defecto</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmar opcións de restaurar</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>A dirección de proxy suministrada é inválida.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulario</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>A información amosada por estar desactualizada. O teu moedeiro sincronízase automáticamente coa rede Bitcoin despois de que se estableza unha conexión, pero este proceso non está todavía rematado.</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>O teu balance actualmente dispoñible</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transaccións que aínda teñen que ser confirmadas, e non contan todavía dentro do balance gastable</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Inmaduro:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>O balance minado todavía non madurou</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>O teu balance actual total</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Cantidade</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>descoñecido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versión do cliente</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Información</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Ventana de Depuración</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Tempo de arranque</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Rede</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Número de conexións</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Cadea de bloques</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Número actual de bloques</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora do último bloque</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Abrir</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Tráfico de Rede</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totais</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Dentro:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Fóra:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Arquivo de log de depuración</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Limpar consola</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Cantidade:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Mensaxe:</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Limpar tódolos campos do formulario</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Limpar</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Solicitar pago</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Código QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copiar &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copiar &amp;Dirección</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Gardar Imaxe...</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Moedas Enviadas</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fondos insuficientes</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantidade:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Importe:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Pago:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambiar:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Tarifa de transacción:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Enviar a múltiples receptores á vez</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Engadir &amp;Receptor</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Limpar tódolos campos do formulario</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Limpar &amp;Todo</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balance:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirmar a acción de envío</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Cantidade:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Pagar &amp;A:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiqueta:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escoller dirección previamente empregada</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Este é un pago normal</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar dirección dende portapapeis</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Eliminar esta entrada</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mensaxe:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Introduce unha etiqueta para esta dirección para engadila á listaxe de direccións empregadas</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pagar A:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Sinaturas - Asinar / Verificar unha Mensaxe</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Asinar Mensaxe</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escoller dirección previamente empregada</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Pegar dirección dende portapapeis</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Introduce a mensaxe que queres asinar aquí</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Sinatura</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copiar a sinatura actual ao portapapeis do sistema</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Asina a mensaxe para probar que posees esta dirección Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Asinar &amp;Mensaxe</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Restaurar todos os campos de sinatura de mensaxe</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Limpar &amp;Todo</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verificar Mensaxe</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verificar a mensaxe para asegurar que foi asinada coa dirección Bitcoin especificada</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verificar &amp;Mensaxe</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Restaurar todos os campos de verificación de mensaxe</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Este panel amosa unha descripción detallada da transacción</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opcións:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especificar directorio de datos</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Conectar a nodo para recuperar direccións de pares, e desconectar</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especificar a túa propia dirección pública</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Aceptar liña de comandos e comandos JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Executar no fondo como un demo e aceptar comandos</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Core de Bitcoin</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Enlazar a unha dirección dada e escoitar sempre nela. Emprega a notación [host]:post para IPv6</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Executar comando cando unha transacción do moedeiro cambia (%s no comando é substituído por TxID)</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;categoría&gt; pode ser:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Aceptar conexións de fóra (por defecto: 1 se non -proxy ou -connect)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opcións de creación de bloque:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Detectada base de datos de bloques corrupta.</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Queres reconstruír a base de datos de bloques agora?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Erro inicializando a base de datos de bloques</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Erro inicializando entorno de base de datos de moedeiro %s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Erro cargando base de datos do bloque</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Erro abrindo base de datos de bloques</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Erro: Espacio en disco escaso!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Fallou escoitar en calquera porto. Emprega -listen=0 se queres esto.</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Bloque genesis incorrecto o no existente. Datadir erróneo para a rede?</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Non hai suficientes descritores de arquivo dispoñibles.</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Especificar arquivo do moedeiro (dentro do directorio de datos)</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verificando bloques...</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Executar comando cando se recibe unha alerta relevante ou vemos un fork realmente longo (%s no cmd é substituído pola mensaxe)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Información</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Enviar traza/información de depuración á consola en lugar de ao arquivo debug.log</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Recortar o arquivo debug.log ao arrancar o cliente (por defecto: 1 cando no-debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Fallou a sinatura da transacción</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>A cantidade da transacción é demasiado pequena</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>A transacción é demasiado grande</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nome de usuario para conexións JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Precaución</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Precisas reconstruír a base de datos empregando -reindex para cambiar -txindex</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Contrasinal para conexións JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Executar comando cando o mellor bloque cambie (%s no comando é sustituído polo hash do bloque)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permitir lookup de DNS para -addnote, -seednote e -connect</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Rede descoñecida especificada en -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fondos insuficientes</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Cargando índice de bloques...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Cargando moedeiro...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Non se pode desactualizar o moedeiro</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Rescaneando...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Carga completa</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_he.ts",
    "content": "<TS language=\"he\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>לחץ מקש ימני כדי לערוך כתובת או תווית</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>יצירת כתובת חדשה</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;חדש</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>העתקת הכתובת המסומנת ללוח הגזירים</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>ה&amp;עתקה</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>סגירה</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>מחיקת הכתובת שנבחרה מהרשימה</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>יצוא הנתונים מהלשונית הנוכחית לקובץ</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>י&amp;צוא</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>מ&amp;חיקה</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>נא לבחור את הכתובת אליה ברצונך לשלוח את המטבעות</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>נא לבחור את הכתובת לקבלת המטבעות</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;בחירה</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>כתובת לשליחה</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>כתובות לקבלה</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>אלו הן כתובות הביטקוין שלך לשליחת תשלומים. חשוב לבדוק את הסכום ואת הכתובת המקבלת לפני שליחת מטבעות.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>אלו הן כתובות הביטקוין שלך לקבלת תשלומים. מומלץ להשתמש בכתובת חדשה לכל העברה.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>ה&amp;עתקת כתובת</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>העתקת &amp;תוית</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;עריכה</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>יצוא רשימת הכתובות</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>קובץ מופרד בפסיקים (‎*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>יצוא נכשל</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>אירעה שגיאה בעת הניסיון לשמור את רשימת הכתובת אל %1. נא לנסות שוב.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>תווית</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>כתובת</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ללא תוית)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>דו־שיח מילת צופן</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>נא להזין מילת צופן</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>מילת צופן חדשה</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>נא לחזור על מילת הצופן החדשה</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>הצג סיסמא</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>נא להזין את מילת הצופן לארנק.&lt;br/&gt;נא להשתמש במילת צופן המורכבת מ&lt;b&gt;עשרה או יותר תווים אקראיים&lt;/b&gt;, או &lt;b&gt;שמונה מילים ומעלה&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>הצפנת הארנק</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>פעולה זו דורשת את מילת הצופן של הארנק שלך כדי לשחרר את הארנק.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>שחרור הארנק</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>פעולה זו דורשת את מילת הצופן של הארנק שלך כדי לפענח את הארנק.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>פענוח הארנק</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>החלפת מילת הצופן</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>נא להזין את מילת הצופן הישנה וחדשה לארנק</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>אימות הצפנת הארנק</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>אזהרה: איבוד מילת הצופן לאחר הצפנת הארנק עשויה לגרום לכך &lt;b&gt;שכל הביטקוינים שלך יאבדו&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>להצפין את הארנק?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>הארנק מוצפן</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 ייסגר כעת כדי לסיים את תהליך ההצפנה. נא לשים לב כי הצפנת הארנק שלך לא יכול להגן על הביטקוינים שלך מפני גניבה או נוזקה שתוקפת את מחשבך.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>חשוב: כל הגיבויים הקודמים שערכת לארנק שלך אמורים להתחלף עם קובץ הארנק המוצפן שנוצר כרגע. מטעמי אבטחה, הגיבויים הקודמים של קובץ הארנק שאינו מוגן הופכים לחסרי תועלת ברגע התחלת השימוש בארנק החדש והמוצפן.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>הצפנת הארנק נכשלה</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>הצפנת הארנק נכשלה עקב תקלה פנימית. הארנק שלך לא הוצפן.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>מילות הצופן שסופקו אינן תואמות.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>שחרור האנרק נכשל</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>מילת הצופן שהוזנה לצורך פענוח הארנק שגויה.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>פענוח הארנק נכשל</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>מילת הצופן של הארנק הוחלפה בהצלחה.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>אזהרה: מקש ה־Caps Lock פעיל!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/מסכת רשת</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>חסום עד</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>&amp;חתימה על הודעה…</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>בסנכרון עם הרשת…</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;סקירה</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>מפרק</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>הצגת סקירה כללית של הארנק</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>ה&amp;עברות</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>עיון בהיסטוריית ההעברות</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>י&amp;ציאה</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>יציאה מהתכנית</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>על &amp;אודות %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>הצגת מידע על %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>על אודות Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>הצגת מידע על Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;אפשרויות…</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>שינוי אפשרויות התצורה עבור %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>ה&amp;צפנת הארנק…</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;גיבוי הארנק…</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>ה&amp;חלפת מילת הצופן…</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>כתובת ה&amp;שליחה…</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>כתובות ה&amp;קבלה…</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>פתיחת &amp;כתובת משאב…</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>יש ללחוץ כדי לנטרל פעילות רשת.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>פעילות הרשת נוטרלה.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>יש ללחוץ כדי להפעיל את פעילות הרשת מחדש.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>הכותרות מתעדכנות (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>המקטעים נוספים למפתח בכונן…</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>שליחת מטבעות לכתובת ביטקוין</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>גיבוי הארנק למיקום אחר</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>החלפת מילת הצופן להצפנת הארנק</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>חלון &amp;ניפוי</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>פתיחת לוח הבקרה לאבחון ולניפוי</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;אימות הודעה…</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>ביטקוין</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>ארנק</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;שליחה</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;קבלה</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>ה&amp;צגה / הסתרה</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>הצגה או הסתרה של החלון הראשי</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>הצפנת המפתחות הפרטיים ששייכים לארנק שלך</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>חתום על הודעות עם כתובות הביטקוין שלך כדי להוכיח שהן בבעלותך</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>אמת הודעות כדי להבטיח שהן נחתמו עם כתובת ביטקוין מסוימות</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;קובץ</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>ה&amp;גדרות</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>ע&amp;זרה</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>סרגל כלים לשוניות</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>בקשת תשלומים (יצירה של קודים מסוג QR וסכימות כתובות משאב של :bitcoin)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>הצג את רשימת הכתובות לשליחה שהיו בשימוש לרבות התוויות</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>הצגת רשימת הכתובות והתוויות הנמצאות בשימוש</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>פתיחת ביטקוין: כתובת משאב או בקשת תשלום</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>אפשרויות &amp;שורת הפקודה</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>חיבור אחד פעיל לרשת ביטקוין</numerusform><numerusform>%n חיבורים פעילים לרשת ביטקוין</numerusform><numerusform>%n חיבורים פעילים לרשת ביטקוין</numerusform><numerusform>%n חיבורים פעילים לרשת ביטקוין</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>מאנדקס את הבלוקים על הכונן...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>מעבד בלוקים על הדיסק...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 מאחור</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>המקטע האחרון שהתקבל נוצר לפני %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>ההעברות שבוצעו לאחר העברה זו לא יופיעו.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>שגיאה</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>אזהרה</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>מידע</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>עדכני</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>יש להציג את הודעת העזרה של %1 כדי להציג רשימה עם אפשרויות שורת פקודה לביטקוין</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>לקוח %1</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>מתבצעת התחברות לעמיתים…</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>מתבצע עדכון…</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>תאריך: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>כמות: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>סוג: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>תווית: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>כתובת: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>העברת שליחה</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>העברת קבלה</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>ייצור מפתחות HD &lt;b&gt;מופעל&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>ייצור מפתחות HD &lt;b&gt;כבוי&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>הארנק &lt;b&gt;מוצפן&lt;/b&gt; ו&lt;b&gt;פתוח&lt;/b&gt; כרגע</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>הארנק &lt;b&gt;מוצפן&lt;/b&gt; ו&lt;b&gt;נעול&lt;/b&gt; כרגע</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>אירעה שגיאה חמורה. אין אפשרות להשתמש עוד בביטקוין באופן מאובטח והיישום ייסגר.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>בחירת מטבע</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>כמות:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>בתים:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>סכום:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>עמלה:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>אבק:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>לאחר עמלה:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>עודף:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>ביטול/אישור הבחירה</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>מצב עץ</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>מצב רשימה</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>כמות</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>התקבל עם תווית</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>התקבל עם כתובת</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>תאריך</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>אישורים</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>מאושר</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>העתקת הכתובת</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>העתקת התווית</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>העתקת הסכום</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>העתקת מזהה ההעברה</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>נעילת יתרה</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>פתיחת יתרה</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>העתקת הכמות</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>העתקת העמלה</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>העתקה אחרי העמלה</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>העתקת בתים</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>העתקת אבק</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>העתקת השינוי</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 נעולים)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>כן</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>לא</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>תווית זו הופכת לאדומה אם מישהו מהנמענים מקבל סכום נמוך יותר מסף האבק הנוכחי.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>יכול להשתנות במגמה של +/- %1 סנטושי לקלט.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ללא תווית)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>עודף מ־%1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(עודף)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>עריכת כתובת</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>ת&amp;ווית</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>התווית המשויכת לרשומה הזו ברשימת הכתובות</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>הכתובת המשויכת עם רשומה זו ברשימת הכתובות. ניתן לשנות זאת רק עבור כתובות לשליחה.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;כתובת</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>כתובת קבלה חדשה</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>כתובת שליחה חדשה</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>עריכת כתובת הקבלה</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>עריכת כתובת השליחה</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>הכתובת שהוקלדה „%1” היא אינה כתובת ביטקוין תקנית.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>הכתובת שהוקלדה „%1” כבר נמצאת בספר הכתובות.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>לא ניתן לשחרר את הארנק.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>יצירת המפתח החדש נכשלה.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>תיקיית נתונים חדשה תיווצר.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>שם</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>התיקייה כבר קיימת. ניתן להוסיף %1 אם יש ליצור תיקייה חדשה כאן.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>הנתיב כבר קיים ואינו מצביע על תיקייה.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>לא ניתן ליצור כאן תיקיית נתונים.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>גרסה</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-סיביות)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>על אודות %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>אפשרויות שורת פקודה</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>שימוש:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>אפשרויות שורת פקודה</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>אפשרויות ממשק</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>נא לבחור תיקיית נתונים עם הפתיחה (בררת מחדל: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>הגדרת השפה, לדוגמה „he_IL” (בררת מחדל: שפת העמרכת)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>התחלה במצב ממוזער</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>הגדרת אישורי בסיס SSL לבקשות תשלומים (בררת מחדל: -מערכת-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>הצגת מסך פתיחה בעת הפעלה (בררת מחדל: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>איפוס כל שינויי הגדרות התצוגה</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>ברוך בואך</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>ברוך בואך אל %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>כיוון שזו ההפעלה הראשונה של התכנית, ניתן לבחור היכן יאוחסן המידע של %1.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>בעת לחיצה על אישור, %1 יחל בהורדה ועיבוד מלאים של שרשרת המקטעים %4 (%2 ג״ב) החל מההעברות הראשונות ב־%3 עם ההשקה הראשונית של %4.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>הסינכרון הראשוני הוא תובעני ועלול לחשוף בעיות חומרה במחשב שהיו חבויות עד כה. כל פעם שתריץ %1 התהליך ימשיך בהורדה מהנקודה שבה הוא עצר לאחרונה.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>אם בחרת להגביל את שטח האחרון לשרשרת, עדיין נדרש מידע היסטורי להורדה ועיבוד אך המידע ההיסטורי יימחק לאחר מכן כדי לשמור על צריכת שטח האחסון בדיסק נמוכה.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>שימוש בבררת המחדל של תיקיית הנתונים.</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>שימוש בתיקיית נתונים מותאמת אישית:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>ביטקוין</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>מידע בנפח של לפחות %1 ג׳יגה-בייט יאוחסן בתיקייה זו, והוא יגדל עם הזמן.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>מידע בנפח של כ-%1 ג׳יגה-בייט יאוחסן בתיקייה זו.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 תוריד ותאחסן עותק של שרשרת הבלוקים של ביטקוין.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>הארנק גם מאוחסן בתיקייה הזו.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>שגיאה: לא ניתן ליצור את תיקיית הנתונים שצוינה „%1“.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>שגיאה</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>ג״ב של מקום פנוי זמין</numerusform><numerusform>%n ג״ב של מקום פנוי זמינים</numerusform><numerusform>%n ג״ב של מקום פנוי זמינים</numerusform><numerusform>%n ג״ב של מקום פנוי זמינים</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(מתוך %n ג״ב נדרשים)</numerusform><numerusform>(מתוך %n ג״ב נדרשים)</numerusform><numerusform>(מתוך %n ג״ב נדרשים)</numerusform><numerusform>(מתוך %n ג״ב נדרשים)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>טופס</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>ייתכן שהעברות שבוצעו לאחרונה לא יופיעו עדיין, ולכן המאזן בארנק שלך יהיה שגוי. המידע הנכון יוצג במלואו כאשר הארנק שלך יסיים להסתנכרן עם רשת הביטקוין, כמפורט למטה.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>הרשת תסרב לקבל הוצאת ביטקוינים במידה והם כבר נמצאים בהעברות אשר לא מוצגות עדיין.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>מספר מקטעים שנותרו</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>לא ידוע...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>זמן המקטע האחרון</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>התקדמות</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>התקדמות לפי שעה</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>נערך חישוב…</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>הזמן המוערך שנותר עד הסנכרון</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>הסתר</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>לא ידוע. הכותרות מתעדכנות (%1)…</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>פתיחת כתובת משאב</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>פתיחת בקשת תשלום מכתובת משאב או מקובץ</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>כתובת משאב:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>בחירת קובץ בקשת תשלום</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>בחירת קובץ בקשת תשלום לפתיחה</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>אפשרויות</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;ראשי</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>להפעיל את %1 אוטומטית לאחר הכניסה למערכת.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>ה&amp;פעלת %1 עם הכניסה למערכת</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>גודל מ&amp;טמון מסד הנתונים</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>מ״ב</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>מספר תהליכי ה&amp;אימות של הסקריפט</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>כתובת ה־IP של המתווך (לדוגמה IPv4: 127.0.0.1‏ / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>הסתר את סמל מגש המערכת</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>מזער ואל תצא מהאפליקציה עם סגירת החלון. כאשר אפשרות זו דלוקה, האפליקציה תיסגר רק בבחירת ״יציאה״ בתפריט.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>כתובות צד־שלישי (כגון: סייר מקטעים) שמופיעים בלשונית ההעברות בתור פריטים בתפריט ההקשר. %s בכתובת מוחלף בגיבוב ההעברה. מספר כתובות יופרדו בפס אנכי |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>אפשרויות פעילות בשורת הפקודה שדורסות את האפשרויות שלהלן:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>פתיחת קובץ התצורה של %1 מתיקיית העבודה.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>פתיחת קובץ ההגדרות</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>איפוס כל אפשרויות התכנית לבררת המחדל.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;איפוס אפשרויות</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;רשת</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = אוטומטי, &lt;0 = להשאיר כזאת כמות של ליבות חופשיות)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;ארנק</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>מומחה</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>הפעלת תכונות &amp;בקרת מטבעות</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>אם אפשרות ההשקעה של עודף בלתי מאושר תנוטרל, לא ניתן יהיה להשתמש בעודף מההעברה עד שלהעברה יהיה לפחות אישור אחד. פעולה זו גם משפיעה על חישוב המאזן שלך.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>עודף &amp;בלתי מאושר מההשקעה</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>פתיחת הפתחה של ביטקוין בנתב באופן אוטומטי. עובד רק אם UPnP מופעל ונתמך בנתב.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>מיפוי פתחה באמצעות UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>אשר חיבורים חיצוניים</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>התחבר לרשת הביטקוין דרך פרוקסי SOCKS5.</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>כתובת ה־IP של המ&amp;תווך:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;פתחה:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>הפתחה של המתווך (למשל 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>עבור הגעה לעמיתים דרך:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;חלון</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>הצג סמל מגש בלבד לאחר מזעור החלון.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>מ&amp;זעור למגש במקום לשורת המשימות</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>מ&amp;זעור עם סגירה</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>ת&amp;צוגה</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;שפת מנשק המשתמש:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>ניתן להגדיר כאן את שפת מנשק המשתמש. הגדרה זו תיכנס לתוקף לאחר הפעלה של %1 מחדש.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>י&amp;חידת מידה להצגת כמויות:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>ניתן לבחור את בררת המחדל ליחידת החלוקה שתוצג במנשק ובעת שליחת מטבעות.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>האם להציג תכונות שליטת מטבע או לא.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;אישור</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;ביטול</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>בררת מחדל</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>ללא</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>אישור איפוס האפשרויות</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>נדרשת הפעלה מחדש של הלקוח כדי להפעיל את השינויים.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>הלקוח יכבה. להמשיך?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>אפשרויות להגדרה</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>בקובץ ההגדרות ניתן לציין אפשרויות מתקדמות אשר יקבלו עדיפות על ההגדרות בממשק הגרפי. כמו כן, אפשרויות בשורת הפקודה יקבלו עדיפות על קובץ ההגדרות.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>שגיאה</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>לא ניתן לפתוח את קובץ ההגדרות</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>שינוי זה ידרוש הפעלה מחדש של תכנית הלקוח.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>כתובת המתווך שסופקה אינה תקינה.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>טופס</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>המידע המוצג עשוי להיות מיושן. הארנק שלך מסתנכרן באופן אוטומטי עם רשת הביטקוין לאחר יצירת החיבור, אך התהליך טרם הסתיים.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>צפייה בלבד:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>זמין:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>היתרה הזמינה הנוכחית</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>בהמתנה:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>הסכום הכולל של העברות שטרם אושרו ועדיין אינן נספרות בחישוב היתרה הזמינה</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>לא בשל:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>מאזן שנכרה וטרם הבשיל</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>מאזנים</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>סך הכול:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>סך כל היתרה הנוכחית שלך</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>המאזן הנוכחי שלך בכתובות לקריאה בלבד</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>ניתנים לבזבוז</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>העברות אחרונות</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>העברות בלתי מאושרות לכתובות לצפייה בלבד</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>מאזן לאחר כרייה בכתובות לצפייה בלבד שעדיין לא הבשילו</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>המאזן הכולל הנוכחי בכתובות לצפייה בלבד</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>שגיאת בקשת תשלום</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>לא ניתן להפעיל את המקשר bitcoin: click-to-pay</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>טיפול בכתובות</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>כתובת תשלום שגויה %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>לא ניתן לנתח את כתובת המשאב! מצב זה יכול לקרות עקב כתובת ביטקוין שגויה או פרמטרים שגויים בכתובת המשאב.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>טיפול בקבצי בקשות תשלום</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>לא ניתן לקרוא את קובץ בקשת התשלום! מצב כזה יכול לקרות בעקבות קובץ בקשת תשלום פגום.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>בקשת התשלום נדחתה</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>רשת בקשת התשלום אינה תואמת לרשת הלקוח.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>בקשת התשלום פגה.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>בקשת התשלום לא הופעלה.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>בקשות תשלום לתסריטי תשלום מותאמים אישית שלא עברו וידוא אינן נתמכות.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>בקשת תשלום שגויה.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>הסכום על סך %1 הנדרש לתשלום קטן מדי (נחשב לאבק)</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>זיכוי מאת %1</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>שגיאה בעת יצירת קשר עם %1:‏ %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>לא ניתן לפענח את בקשת התשלום!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>תגובה שגויה מהשרת %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>שגיאת בקשת רשת</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>התשלום אושר</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>סוכן משתמש</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>צומת/שירות</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>מזהה צומת</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>פינג</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>נשלחו</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>התקבלו</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>כמות</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>נא להזין כתובת ביטקוין (למשל: %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 ימים</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 שעות</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 דקות</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 שניות</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>ללא</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>לא זמין</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 מילישניות</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>שנייה אחת</numerusform><numerusform>%n שניות</numerusform><numerusform>%n שניות</numerusform><numerusform>%n שניות</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>דקה אחת</numerusform><numerusform>%n דקות</numerusform><numerusform>%n דקות</numerusform><numerusform>%n דקות</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>שעה אחת</numerusform><numerusform>%n שעות</numerusform><numerusform>%n שעות</numerusform><numerusform>%n שעות</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>יום אחד</numerusform><numerusform>%n ימים</numerusform><numerusform>%n ימים</numerusform><numerusform>%n ימים</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>שבוע אחד</numerusform><numerusform>%n שבועות</numerusform><numerusform>%n שבועות</numerusform><numerusform>%n שבועות</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 ו%2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>שנה אחת</numerusform><numerusform>%n שנים</numerusform><numerusform>%n שנים</numerusform><numerusform>%n שנים</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 ב׳</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 ק״ב</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 מ״ב</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 ג״ב</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>הסגירה של %1 לא הושלמה בהצלחה עדיין…</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>לא ידוע</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>שגיאה: תיקיית הנתונים שצוינה „%1” אינה קיימת.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>שגיאה: לא ניתן לפענח את התצורה: %1. יש להשתמש אך ורק בתחביר מפתח=ערך.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>שגיאה: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;שמירת תמונה…</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>העתקת ת&amp;מונה</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>שמירת קוד QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>תמונת PNG (‏‎*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>לא זמין</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>גרסת מנשק</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>מי&amp;דע</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>חלון ניפוי</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>כללי</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>שימוש ב־BerkeleyDB גרסה</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>זמן עלייה</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>רשת</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>שם</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>מספר חיבורים</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>שרשרת מקטעים</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>מספר המקטעים הנוכחי</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>מאגר זכרון</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>מספר הפעולה הנוכחי</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>שימוש בזכרון</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;איפוס</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>התקבלו</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>נשלחו</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;עמיתים</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>משתמשים חסומים</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>נא לבחור בעמית כדי להציג מידע מפורט.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>ברשימה הלבנה</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>כיוון</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>גרסה</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>בלוק התחלה</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>כותרות עדכניות</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>בלוקים מסונכרנים</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>סוכן משתמש</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>הקטן גודל גופן</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>הגדל גודל גופן</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>שירותים</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>דירוג חסימה</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>זמן החיבור</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>שליחה אחרונה</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>קבלה אחרונה</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>זמן המענה</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>פינג</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>פינג מינימלי</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>הפרש זמן</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>זמן המקטע האחרון</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;פתיחה</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>מ&amp;סוף בקרה</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;תעבורת רשת</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>סכומים</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>נכנס:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>יוצא:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>קובץ יומן ניפוי</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>ניקוי מסוף הבקרה</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>&amp;שעה אחת</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>&amp;יום אחד</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>ש&amp;בוע אחד</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>ש&amp;נה אחת</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;ניתוק</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>חסימה למשך</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;שחרור חסימה</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>ברוך בואך למסוף ה־RPC של %1.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>יש להשתמש בחצים למעלה ומלטה כדי לנווט בהסיטוריה וב־%1 כדי לנקות את המסך.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>אזהרה! ישנם רמאים הנוהגים לשכנע משתמשים להקליד פקודות כאן ועל ידי כך לגנוב את תכולת הארנק שלהם. אל תשתמש במסוף הבקרה מבלי שאתה מבין באופן מלא את המשמעות של הפקודה!</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>פעילות הרשת נוטרלה</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>דרך %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>לעולם לא</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>תעבורה נכנסת</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>תעבורה יוצאת</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>כן</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>לא</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>לא ידוע</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;סכום:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>ת&amp;ווית:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>הו&amp;דעה:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>הודעת רשות לצירוף לבקשת התשלום שתוצג בעת פתיחת הבקשה. לתשומת לבך: ההודעה לא תישלח עם התשלום ברשת ביטקוין.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>תווית רשות לשיוך עם כתובת הקבלה החדשה.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>יש להשתמש בטופס זה כדי לבקש תשלומים. כל השדות הם בגדר &lt;b&gt;רשות&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>סכום כרשות לבקשה. ניתן להשאיר זאת ריק כדי לא לבקש סכום מסוים.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>ניקוי של כל השדות בטופס.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>ניקוי</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>היסטוריית בקשות תשלום</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;בקשת תשלום</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>הצגת בקשות נבחרות (דומה ללחיצה כפולה על רשומה)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>הצגה</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>הסרת הרשומות הנבחרות מהרשימה</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>הסרה</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>העתקת כתובת</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>העתקת התווית</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>העתקת הודעה</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>העתקת הסכום</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>קוד QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>העתקת &amp;כתובת משאב</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>העתקת &amp;כתובת</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;שמירת תמונה…</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>בקשת תשלום אל %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>פרטי תשלום</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>כתובת</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>כתובת</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>סכום</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>תוית</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>הודעה</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>הכתובת שנוצרה ארוכה מדי, כדאי לנסות לקצר את הטקסט של התווית / הודעה.</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>תאריך</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>תוית</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>הודעה</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ללא תוית)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(אין הודעה)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(לא התבקש סכום)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>בקשה</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>שליחת מטבעות</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>תכונות בקרת מטבעות</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>קלטים…</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>בבחירה אוטומטית</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>אין מספיק כספים!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>כמות:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>בתים:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>סכום:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>עמלה:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>לאחר עמלה:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>עודף:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>אם אפשרות זו מופעלת אך כתובת העודף ריקה או שגויה, העודף יישלח לכתובת חדשה שתיווצר.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>כתובת לעודף מותאמת אישית</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>עמלת העברה:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>בחר...</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>אזהרה</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>צמצום הגדרות עמלה</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>עבור קילו-בית</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>הסתר</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>זה בסדר לשלם את העמלה המינימלית כל עוד נפח הטרנזקציות קטן מנפח הבלוקים. אבל יש להיזהר כיוון שבמידה והעומס ברשת גדל, העיסקה עלולה לא להיות מאושרת לעולם.</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>מומלץ:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>מותאם אישית:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>שליחה למספר מוטבים בו־זמנית</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>הוספת &amp;מוטב</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>ניקוי של כל השדות בטופס.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>אבק:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>זמן לקבלת אישור:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>אפשר ״החלפה-על ידי עמלה״</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;ניקוי הכול</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>מאזן:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>אישור פעולת השליחה</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;שליחה</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>העתקת הכמות</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>העתקת הסכום</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>העתקת העמלה</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>העתקה אחרי העמלה</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>העתקת בתים</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>העתקת אבק</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>העתקת השינוי</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>לשלוח?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>נוספה עמלת העברה</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>סכום כולל %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>או</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>אימות שליחת מטבעות</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>כתובת הנמען שגויה. נא לבדוק שוב.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>הסכום לתשלום צריך להיות גדול מ־0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>הסכום חורג מהמאזן שלך.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>נמצאה כתובת כפולה: יש להשתמש בכל כתובת פעם אחת בלבד.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>יצירת ההעברה נכשלה!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>ההעברה נדחתה מהסיבות הבאות: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>עמלה מעל לסכום של %1 נחשבת לעמלה גבוהה באופן מוגזם.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>בקשת התשלום פגה.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>תשלום של העמלה הנדרשת בלבד על סך %1</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>אזהרה: כתובת ביטקיון שגויה</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>אזהרה: כתובת החלפה בלתי ידועה</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>אימות כתובת החלפה בהתאמה אישית</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>הכתובת שבחרת עבור ההחלפה אינה חלק מארנק זה. כל ההסכום שבארנק שלך עשוי להישלח לכתובת זו. מקובל עליך?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ללא תווית)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;כמות:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>לשלם ל&amp;טובת:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>ת&amp;ווית:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>בחירת כתובת שהייתה בשימוש</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>זהו תשלום רגיל.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>כתובת הביטקוין של המוטב</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>הדבקת כתובת מלוח הגזירים</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>הסרת רשומה זו</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>העמלה תנוכה מהסכום שנשלח. הנמען יקבל פחות ביטקוינים ממה שהזנת בשדה הסכום. אם נבחרו מספר נמענים, העמלה תחולק באופן שווה.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>ה&amp;חסרת העמלה מהסכום</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>השתמש בכלל היתרה</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>הודעה:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>זוהי בקשת תשלום לא מאומתת.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>זוהי בקשה מאומתת לתשלום.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>יש להזין תווית עבור כתובת זו כדי להוסיף אותה לרשימת הכתובות בשימוש</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>הודעה שצורפה לביטקוין: כתובת שתאוחסן בהעברה לצורך מעקב מצדך. לתשומת לבך: הודעה זו לא תישלח ברשת הביטקוין.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>תשלום לטובת:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>תזכורת:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>נא להזין תווית לכתובת זו כדי להוסיף אותה לספר הכתובות שלך</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>כן</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 בתהליך כיבוי...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>אין לכבות את המחשב עד שחלון זה נעלם.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>חתימות - חתימה או אימות של הודעה</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>חתימה על הו&amp;דעה</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>באפשרותך לחתום על הודעות/הסכמים באמצעות הכתובות שלך, כדי להוכיח שאתה יכול לקבל את הביטקוינים הנשלחים אליהן. היזהר לא לחתום על תוכן עמום או אקראי, מכיוון שתקיפות פישינג עשויות לנסות לגנוב את הזהות שלך. חתום רק על הצהרות מפורטות שאתה מסכים להן.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>כתובת הביטקוין אתה לחתום אתה את ההודעה</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>בחירת כתובת שהייתה בשימוש</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>הדבקת כתובת מלוח הגזירים</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>יש להוסיף כאן את ההודעה עליה לחתום</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>חתימה</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>העתקת החתימה הנוכחית ללוח הגזירים</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>ניתן לחתום על ההודעה כדי להוכיח שכתובת הביטקוין הזו בבעלותך.</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>&amp;חתימה על הודעה</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>איפוס כל שדות החתימה על הודעה</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;ניקוי הכול</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;אימות הודעה</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>כתובת הביטקוין שאתה נחתמה ההודעה</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>ניתן לאמת את ההודעה כדי להבטיח שהיא נחתמה עם כתובת הביטקוין הנתונה</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>&amp;אימות הודעה</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>איפוס כל שדות אימות ההודעה</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>יש ללחוץ על „חתימת ההודעה“ כדי לייצר חתימה</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>הכתובת שהוזנה שגויה.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>נא לבדוק את הכתובת ולנסות שוב.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>הכתובת שהוזנה לא מתייחסת למפתח.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>שחרור הארנק בוטל.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>המפתח הפרטי לכתובת שהוכנסה אינו זמין.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>חתימת ההודעה נכשלה.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>ההודעה נחתמה.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>לא ניתן לפענח את החתימה.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>נא לבדוק את החתימה ולנסות שוב.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>החתימה לא תואמת את תקציר ההודעה.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>וידוא ההודעה נכשל.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>ההודעה עברה וידוא.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[רשת-בדיקה]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>ק״ב/ש׳</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>פתוחה עד %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>במאגר הזיכרון</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>לא במאגר הזיכרון</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>ננטש</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>מצב</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>תאריך</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>מקור</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>נוצר</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>מאת</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>לא ידוע</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>אל</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>כתובת עצמית</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>צפייה בלבד</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>תווית</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>אשראי</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>לא התקבל</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>חיוב</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>חיוב כולל</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>אשראי כול</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>עמלת העברה</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>סכום נטו</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>הודעה</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>הערה</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>מזהה העברה</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>גודל ההעברה הכללי</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>מפתח פלט</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>סוחר</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>פרטי ניפוי שגיאות</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>העברה</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>אמצעי קלט</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>סכום</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>אמת</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>שקר</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>חלונית זו מציגה תיאור מפורט של ההעברה</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>פרטים עבור %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>תאריך</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>סוג</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>תוית</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>פתוחה למשך בלוק אחד נוסף</numerusform><numerusform>פתוחה למשך %n בלוקים נוספים</numerusform><numerusform>פתוחה למשך %n בלוקים נוספים</numerusform><numerusform>פתוחה למשך %n בלוקים נוספים</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>פתוחה עד %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>לא מקוונת</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>לא מאושרת</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>ננטש</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>באישור (%1 מתוך %2 אישורים מומלצים)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>מאושרת (%1 אישורים)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>מתנגשת</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>צעירה (%1 אישורים, תהיה זמינה לאחר %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>בלוק זה לא התקבל על ידי אף צומת אחר וככל הנראה לא יאושר!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>הבלוק יוצר אך לא אושר</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>התקבל עם</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>התקבל מאת</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>נשלח אל</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>תשלום לעצמך</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>נכרו</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>צפייה בלבד</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(לא זמין)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ללא תוית)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>מצב ההעברה. יש להמתין עם הסמן מעל שדה זה כדי לראות את מספר האישורים.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>התאריך והשעה בהם העברה זו התקבלה.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>סוג ההעברה.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>סכום ירד או התווסף למאזן</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>הכול</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>היום</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>השבוע</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>החודש</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>חודש שעבר</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>השנה הזאת</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>טווח…</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>התקבל עם</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>נשלח אל</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>לעצמך</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>נכרו</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>אחר</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>הכנס כתובת, מזהה העברה, או תווית לחיפוש</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>סכום מזערי</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>נטישת העברה</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>הגדל עמלת העברה</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>העתקת הכתובת</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>העתקת התווית</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>העתקת הסכום</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>העתקת מזהה ההעברה</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>העתקת העברה גולמית</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>העתקת פרטי ההעברה המלאים</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>עריכת תווית</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>הצגת פרטי העברה</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>יצוא היסטוריית העברה</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>קובץ מופרד בפסיקים (‎*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>מאושרת</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>צפייה בלבד</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>תאריך</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>סוג</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>תוית</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>כתובת</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>מזהה</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>יצוא נכשל</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>אירעה שגיאה בעת ניסיון שמירת היסטוריית ההעברות אל %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>הייצוא נכשל</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>היסטוריית ההעברות נשמרה בהצלחה אל %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>טווח:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>עד</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>יחידת המידה להצגת הסכומים. יש ללחוץ כדי לבחור ביחידת מידה אחרת.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>לא נטען ארנק.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>שליחת מטבעות</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>להגדיל את העמלה?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>העמלה הנוכחית:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>הגדלה:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>עמלה חדשה:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>אישור הקפצת עמלה</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>אי אפשר לחתום על ההעברה.</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;יצוא</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>יצוא הנתונים בלשונית הנוכחית לקובץ</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>גיבוי הארנק</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>נתוני ארנק (‎*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>הגיבוי נכשל</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>אירעה שגיאה בעת הניסיון לשמור את נתוני הארנק אל %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>הגיבוי הצליח</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>נתוני הארנק נשמרו בהצלחה אל %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>אפשרויות:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>ציון תיקיית נתונים</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>יש להתחבר למפרק כדי לדלות כתובות עמיתים ואז להתנתק</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>נא לציין את הכתובת הפומבית שלך</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>קבלת פקודות משורת הפקודה ומ־JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>שגיאה: סניה קלמה קריטית פנימית קרטה, פנה ל debug.log לפרטים</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>ריצה כסוכן ברקע וקבלת פקודות</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>ליבת ביטקוין</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>ה %s מפתחים</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>להתאגד לכתובת נתונה להאזין לה תמיד. יש להשתמש בצורה ‎[host]:port עבור IPv6.</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>מחיקת כל העברות הארנק ולשחזר רק את החלקים המסוימים בשרשרת המקטעים באמצעות ‎-rescan עם ההפעלה</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>ביצוע פקודה כאשר העברה בארנק משתנה (%s ב־cmd יוחלף ב־TxID)</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>שימוש ב־UPnP כדי למפות את הפתחה להאזנה (בררת מחדל: 1 בעת האזנה ובלי ‎-proxy)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>אזהרה: נראה כי הרשת אינה מסכימה באופן מלא! חלק מהכורים חווים תקלות.</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>‎-maxmempool חייב להיות לפחות %d מ״ב</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;קטגוריה&gt; יכולה להיות:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>קבלת חיבורים מבחוץ (בררת מחדל: 1 ללא ‎-proxy או ‎-connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>הוספת הערה למחרוזת סוכן המשתמש</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>אפשרויות יצירת מקטע:</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>אפשרויות בחירת שרשרת:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>אינדקס העודף מחוץ לתחום</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>הגדרות חיבור:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>כל הזכויות שמורות (C) %i-‏%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>התגלה מסד נתוני מקטעים לא תקין</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>אפשרויות ניפוי/בדיקה:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>לא לטעון את הארנק ולנטרל קריאות RPC</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>האם לבנות מחדש את מסד נתוני המקטעים?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>שגיאה באתחול מסד נתוני המקטעים</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>שגיאה באתחול סביבת מסד נתוני הארנקים %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>שגיאה בטעינת %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>שגיאה בטעינת מסד נתוני המקטעים</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>שגיאה בטעינת מסד נתוני המקטעים</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>שגיאה: מעט מקום פנוי בכונן!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>האזנה נכשלה בכל פורט. השתמש ב- -listen=0 אם ברצונך בכך.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>מתבצע יבוא…</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>מקטע הפתיח הוא שגוי או לא נמצא. תיקיית נתונים שגויה עבור הרשת?</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>סכום שגוי עבור ‎-%s=&lt;amount&gt;:‏ '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>סכום שגוי עבור ‎-fallbackfee=&lt;amount&gt;:‏ '%s'</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>טוען רשימת חסומים...</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>אין מספיק מידע על הקובץ</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>תמיד להתחבר למפרקים ברשת &lt;net&gt;‏ (ipv4,‏ ipv6 או onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>להדפיס הודעת עזרה זו ולצאת</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>הדפס גירסא וצא</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>הגדרת גודל מטמון מסדי הנתונים במגה בתים (%d עד %d, בררת מחדל: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>ציון קובץ ארנק (בתוך תיקיית הנתונים)</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>החישוב עבור עמלת העיסקה והעודף נכשל</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>השתמש ברשת הבדיקה</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>המקטעים מאומתים…</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>אפשרות דיבוג/בדיקת ארנק:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>יש לכתוב את הארנק מחדש: יש להפעיל את %s כדי להמשיך</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>אפשרויות הארנק:</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>הרץ פקודה כאשר ההתראה הרלוונטית מתקבלת או כשאנחנו עדים לפיצול ארוך מאוד (%s בשורת הפקודה יוחלף ע\"י ההודעה)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>סכום העברה נמוך מדי לשליחה אחרי גביית העמלה</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(בררת מחדל: %u)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>התחברות דרך מתווך SOCKS5</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>מידע</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>כמות לא תקינה עבור ‎-paytxfee=&lt;amount&gt;‎:‏ '%s' (חייבת להיות לפחות %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>מסכת הרשת שצוינה עם ‎-whitelist שגויה: '%s'</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>עליך לציין פתחה עם ‎-whitebind:‏ '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>אפשרויות ממסר מפרק:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>הגדרות שרת RPC</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>שלח מידע דיבאג ועקבה לקונסולה במקום לקובץ debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>הצגת כל אפשרויות הניפוי (שימוש: ‎--help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>כיווץ הקובץ debug.log בהפעלת הלקוח (בררת מחדל: 1 ללא ‎-debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>החתימה על ההעברה נכשלה</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>סכום ההעברה נמוך מכדי לשלם את העמלה</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>זוהי תכנית נסיונית.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>סכום ההעברה קטן מדי</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>ההעברה גבוהה מדי עבור מדיניות העמלות</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>סכום ההעברה גדול מדי</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>לא ניתן להתאגד עם הפתחה %s במחשב זה (פעולת האיגוד החזירה את השגיאה %s)</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>עדכן ארק לפורמט העדכני בהפעלה</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>שם משתמש לחיבורי JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>אזהרה</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>ססמה לחיבורי JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>יש לבצע פקודה זו כשהמקטע הטוב ביותר משתנה (%s בפקודה יוחלף בגיבוב המקטע)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>הפעלת בדיקת DNS עבור ‎-addnode,‏ ‎-seednode ו־‎-connect</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>המשתנה ‎-socks נמצא אך אין בו תמיכה עוד. הגדרת גרסת SOCKS אינה אפשרית עוד, קיימת תמיכה רק ב־SOCKS5.</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(ברירת מחדל: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>תמיד לתשאל את כתובת העמיתים באמצעות חיפוש DNS (בררת מחדל: %u)</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>כמה מקטעים לבדוק עם ההפעלה (בררת מחדל: %u,‏ 0 = הכול)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>לכלול את כתובת ה־IP בפלט ניפוי השגיאות (בררת מחדל: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>האזנה לחיבורי JSON-RPC דרך &lt;port&gt; (בררת מחדל: %u או ברשת הבדיקה: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>האזנה לחיבורים על גבי &lt;port&gt; (בררת מחדל: %u או לרשת הבדיקה: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>לשמור על &lt;n&gt; חיבורים לעמיתים לכל היותר (בררת מחדל: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>להגדיר את הארנק להפצת העברות</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>הגדרת גודל מאגר המפתחות לכדי &lt;n&gt; (בררת מחדל: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>הגדרת משקל מרבי למקטע BIP141 (בררת מחדל: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>הגדרת קובץ תצורה (בררת מחדל: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>ציון תפוגת זמן ההמתנה לחיבור במילישניות (מינימום: 1, בררת מחדל: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>ציון קובץ pid (בררת מחדל: %s)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>תהליכי הרשת מופעלים…</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>זו עמלת ההעברה המזערית שתיגבה מכל העברה שלך.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>זו עמלת ההעברה שתיגבה ממך במידה של שליחת העברה.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>סף לניתוק עמיתים סוררים (בררת מחדל: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>סכומי ההעברה לא יכולים להיות שליליים</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>להעברה חייב להיות לפחות נמען אחד</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>רשת לא ידועה צוינה דרך ‎-onlynet:‏ '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>אין מספיק כספים</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>מפתח המקטעים נטען…</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>הארנק בטעינה…</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>לא ניתן להחזיר את גרסת הארנק</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>סריקה מחדש…</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>טעינה הושלמה</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>שגיאה</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_he_IL.ts",
    "content": "<TS language=\"he_IL\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>קליל ימני כדי לערוך כתובת או תווית</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>צור כתובת חדשה</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>וחדש</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>העתק את הכתובת הנבחרת ללוח</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>והעתק</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>וסגור</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>מחק את הכתובת הנבחרת מהרשימה</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>יצא את המידע בעמוד הנוכחי לקובץ</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>ייצוא</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>מחק</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>בחר את הכתובת כדי לשלוח אליה מטבעות</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>בחר את הכתובת כדי לקבל אליה מטבעות</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>בחר</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>שולח כתובות</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>מקבל כתובות</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>אלו הן כתובות הביטקוין שלך לשליחת תשלומים. תמיד בדוק את כתובת הארנק המקבל לפני שליחת מטבעות</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>אלו הן כתובות הביטקוין שלך לקבלת תשלומים. מומלץ להשתמש בכתובת חדשה בכל העברת מטבעות</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>ביטקוין</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>ארנק</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Copy amount</source>\n        <translation>העתק סכום</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>העתק כמות</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>ביטקוין</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>Copy amount</source>\n        <translation>העתק סכום</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Copy quantity</source>\n        <translation>העתק כמות</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>העתק סכום</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy amount</source>\n        <translation>העתק סכום</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>ייצוא</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>יצא את המידע בעמוד הנוכחי לקובץ</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_hi_IN.ts",
    "content": "<TS language=\"hi_IN\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>पते या लेबल को संपादित करने के लिए दाहिना-क्लिक करें</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>एक नया पता बनाएं</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>नया</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>चुनिन्दा पते को सिस्टम क्लिपबोर्ड पर कापी करे !</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>सूची से वर्तमान में चयनित पता हटाएं</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>डेटा को मौजूदा टैब से एक फ़ाइल में निर्यात करें</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;निर्यात</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;मिटाए !!</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>सिक्कों को भेजने के लिए पता चुनें</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>सिक्कों को प्राप्त करने के लिए पता चुनें</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>सभी पते भेज रहा है</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>पतों को प्राप्त कर रहा है</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>ये भुगतान भेजने के लिए ये आपके बिटकॉइन पते हैं। हमेशा सिक्के भेजने से पहले राशि और प्राप्तकर्ता पते की जांच करें।</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>भुगतान प्राप्त करने के लिए ये आपके बीटकोइन पते हैं प्रत्येक लेनदेन के लिए एक नया प्राप्त पता उपयोग करने की सिफारिश की जाती है।</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>पहचान शब्द/अक्षर डालिए !</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>नया पहचान शब्द/अक्षर डालिए !</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>दोबारा नया पहचान शब्द/अक्षर डालिए !</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>नेटवर्क से समकालिक (मिल) रहा है ...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;विवरण</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>वॉलेट का सामानया विवरण दिखाए !</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp; लेन-देन\n</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>देखिए पुराने लेन-देन के विवरण !</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>बाहर जायें</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>अप्लिकेशन से बाहर निकलना !</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;विकल्प</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;बैकप वॉलेट</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>पहचान शब्द/अक्षर जो वॉलेट एनक्रिपशन के लिए इस्तेमाल किया है उसे बदलिए!</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>बीटकोइन</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>वॉलेट</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;फाइल</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;सेट्टिंग्स</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;मदद</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>टैबस टूलबार</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 पीछे</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>भूल</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>चेतावनी</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>जानकारी</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>नवीनतम</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>भेजी ट्रांजक्शन</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>प्राप्त हुई ट्रांजक्शन</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>वॉलेट एन्क्रिप्टेड है तथा अभी लॉक्ड नहीं है</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>वॉलेट एन्क्रिप्टेड है तथा अभी लॉक्ड है</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>राशि :</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>राशि</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>taareek</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>पक्का</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>पता एडिट करना</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;लेबल</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;पता</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>संस्करण</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>खपत :</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>बीटकोइन</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>भूल</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>फार्म</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>विकल्प</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>वॉलेट</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;ओके</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;कैन्सल</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>भूल</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>फार्म</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>राशि</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>लागू नही\n</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>अज्ञात</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>लागू नही\n</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>जानकारी</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>राशि :</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>लेबल:</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;पता कॉपी करे</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>सिक्के भेजें|</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>राशि :</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>एक साथ कई प्राप्तकर्ताओं को भेजें</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>बाकी रकम :</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>भेजने की पुष्टि करें</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>अमाउंट:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>प्राप्तकर्ता:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>लेबल:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt-A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Clipboard से एड्रेस paste करें</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt-P</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>प्राप्तकर्ता:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt-A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Clipboard से एड्रेस paste करें</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt-P</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>हस्ताक्षर</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[टेस्टनेट]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation> ये खिड़की आपको लेन-देन का विस्तृत विवरण देगी !</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;निर्यात</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>डेटा को मौजूदा टैब से एक फ़ाइल में निर्यात करें</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>विकल्प:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>डेटा डायरेक्टरी बताएं </translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>बैकग्राउंड में डेमॉन बन कर रन करे तथा कमांड्स स्वीकार करें </translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>ब्लॉक्स जाँचे जा रहा है...</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>जानकारी</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>चेतावनी</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>ब्लॉक इंडेक्स आ रहा है...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>वॉलेट आ रहा है...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>रि-स्केनी-इंग...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>लोड हो गया|</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>भूल</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_hr.ts",
    "content": "<TS language=\"hr\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Desni klik za uređivanje adresa i oznaka</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Dodajte novu adresu</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nova</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopiraj trenutno odabranu adresu u međuspremnik</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopiraj</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Zatvori</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Brisanje trenutno odabrane adrese s popisa.</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Izvoz podataka iz trenutnog lista u datoteku</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Izvozi</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>Iz&amp;briši</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Odaberi adresu na koju šalješ novac</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Odaberi adresu na koju primaš novac</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Odaberi</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Adresa pošiljatelja</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Adresa primatelja</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Ovo su vaše Bitcoin adrese za slanje novca. Uvijek provjerite iznos i adresu primatelja prije slanja novca.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Ovo su vaše Bitcoin adrese za primanje novca. Preporučamo da koristite novu adresu za primanje za svaku transakciju.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopiraj adresu</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopiraj i označi</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>Uredi</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Izvezi listu adresa</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Datoteka podataka odvojenih zarezima (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Izvoz neuspješan</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Došlo je do pogreške kod spremanja liste adresa na %1. Molimo pokušajte ponovno.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nema oznake)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dijalog lozinke</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Unesite lozinku</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nova lozinka</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ponovite novu lozinku</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Unesite novu lozinku za novčanik. &lt;br/&gt;Molimo Vas da koristite zaporku od &lt;b&gt;deset ili više slučajnih znakova&lt;/b&gt;, ili &lt;b&gt;osam ili više riječi.&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Šifriranje novčanika</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Ova operacija treba lozinku vašeg novčanika kako bi se novčanik otključao.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Otključaj novčanik</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Ova operacija treba lozinku vašeg novčanika kako bi se novčanik dešifrirao.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dešifriranje novčanika.</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Promjena lozinke</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Unesite staru i novu lozinku za novčanik.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Potvrdi šifriranje novčanika</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Upozorenje: Ako šifrirate vaš novčanik i izgubite lozinku, &lt;b&gt;IZGUBIT ĆETE SVE SVOJE BITCOINE!&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Jeste li sigurni da želite šifrirati svoj novčanik?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Novčanik šifriran</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>VAŽNO: Sve prethodne pričuve vašeg novčanika trebale bi biti zamijenjene novo stvorenom, šifriranom datotekom novčanika. Zbog sigurnosnih razloga, prethodne pričuve nešifriranog novčanika će postati beskorisne čim počnete koristiti novi, šifrirani novčanik.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Šifriranje novčanika nije uspjelo</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Šifriranje novčanika nije uspjelo zbog interne pogreške. Vaš novčanik nije šifriran.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Priložene lozinke se ne podudaraju.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Otključavanje novčanika nije uspjelo</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Lozinka za dešifriranje novčanika nije točna.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Dešifriranje novčanika nije uspjelo</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Lozinka novčanika je uspješno promijenjena.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Upozorenje: Caps Lock je uključen!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>P&amp;otpišite poruku...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Usklađivanje s mrežom ...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Pregled</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Čvor</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Prikaži opći pregled novčanika</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakcije</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Pretraži povijest transakcija</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Izlaz</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Izlazak iz programa</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Više o %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Više o &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Prikaži informacije o Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>Pos&amp;tavke...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Ši&amp;friraj novčanik...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Spremi &amp;kopiju novčanika...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Promjena &amp;lozinke...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Adrese za &amp;slanje</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Adrese za &amp;primanje</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Otvori &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Re-indeksiranje blokova na disku...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Slanje novca na bitcoin adresu</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Napravite sigurnosnu kopiju novčanika na drugoj lokaciji</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Promijenite lozinku za šifriranje novčanika</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Konzola za dijagnostiku</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Otvori konzolu za dijagnostiku</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Potvrdite poruku...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Novčanik</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Pošalji</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>Pri&amp;mi</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>Po&amp;kaži / Sakrij</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Prikaži ili sakrij glavni prozor</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Šifriranje privatnih ključeva koji u novčaniku</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Poruku potpišemo s bitcoin adresom, kako bi dokazali vlasništvo nad tom adresom</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Provjeravanje poruke, kao dokaz, da je potpisana navedenom bitcoin adresom</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Datoteka</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Postavke</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Pomoć</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Traka kartica</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Zatraži uplatu (stvara QR kod i bitcoin: URI adresu)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Prikaži popis korištenih adresa i oznaka za slanje novca</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Prikaži popis korištenih adresa i oznaka za primanje novca</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Otvori bitcoin: URI adresu ili zahtjev za uplatu</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opcije &amp;naredbene linije</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktivna veza na Bitcoin mrežu</numerusform><numerusform>%n aktivnih veza na Bitcoin mrežu</numerusform><numerusform>%n aktivnih veza na Bitcoin mrežu</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indeksiram blokove na disku...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Procesiram blokove na disku...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Obrađen %n blok povijesti transakcije.</numerusform><numerusform>Obrađeno %n bloka povijesti transakcije.</numerusform><numerusform>Obrađeno %n blokova povijesti transakcije.</numerusform></translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Zadnji primljeni blok je bio ustvaren prije %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transakcije izvršene za tim blokom nisu još prikazane.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greška</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Upozorenje</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacija</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Ažurno</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 klijent</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Ažuriranje...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Iznos: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Vrsta: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Oznaka: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresa: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Poslana transakcija</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Dolazna transakcija</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Novčanik je &lt;b&gt;šifriran&lt;/b&gt; i trenutno &lt;b&gt;otključan&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Novčanik je &lt;b&gt;šifriran&lt;/b&gt; i trenutno &lt;b&gt;zaključan&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Izbor ulaza transakcije</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Količina:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtova:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Iznos:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Naknada:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Prah:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Vraćeno:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>Izaberi sve/ništa</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Iznos</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Primljeno pod oznakom</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Primljeno na adresu</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Broj potvrda</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potvrđeno</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiraj adresu</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiraj oznaku</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiraj iznos</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopiraj ID transakcije</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>da</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>ne</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nema oznake)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Uredi adresu</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Oznaka</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Oznaka bitcoin adrese</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Bitcoin adresa. Izmjene adrese su moguće samo za adrese za slanje.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresa</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nova adresa za primanje</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nova adresa za slanje</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Uredi adresu za primanje</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Uredi adresu za slanje</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Upisana adresa \"%1\" nije valjana bitcoin adresa.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Upisana adresa \"%1\" je već u adresaru.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Ne mogu otključati novčanik.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Stvaranje novog ključa nije uspjelo.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Stvoren će biti novi direktorij za podatke.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>ime</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Nije moguće stvoriti direktorij za podatke na tom mjestu.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>verzija</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opcije programa u naredbenoj liniji</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Upotreba:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opcije programa u naredbenoj liniji</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Pokreni minimiziran</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Dobrodošli</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greška</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Oblik</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Posljednje vrijeme bloka</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Otvori URI adresu</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Otvori zahtjev za plaćanje iz URI adrese ili datoteke</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Izaberi datoteku zahtjeva za plaćanje</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Izaberi datoteku zahtjeva za plaćanje</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Postavke</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Glavno</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Veličina predmemorije baze podataka</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Broj CPU niti za verifikaciju transakcija</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP adresa proxy servera (npr. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimizirati aplikaciju umjesto zatvoriti, kada se zatvori prozor. Kada je ova opcija omogućena, aplikacija će biti zatvorena tek nakon odabira naredbe Izlaz u izborniku.</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Nastavi sve postavke programa na početne vrijednosti.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>Po&amp;nastavi postavke</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Mreža</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Novčanik</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Trošenje nepotvrđenih vraćenih iznosa</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Automatski otvori port Bitcoin klijenta na ruteru. To radi samo ako ruter podržava UPnP i ako je omogućen.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapiraj port koristeći &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Vrata:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Proxy vrata (npr. 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Prozor</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Prikaži samo ikonu u sistemskoj traci nakon minimiziranja prozora</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimiziraj u sistemsku traku umjesto u traku programa</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimiziraj kod zatvaranja</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Prikaz</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Jezi&amp;k sučelja:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Jedinica za prikaz iznosa:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Izaberite željeni najmanji dio bitcoina koji će biti prikazan u sučelju i koji će se koristiti za plaćanje.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;U redu</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Odustani</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>standardne vrijednosti</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greška</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Priložena proxy adresa je nevažeća.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Oblik</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Prikazani podatci mogu biti zastarjeli. Vaš novčanik se automatski sinkronizira s Bitcoin mrežom kada je veza uspostavljena, ali taj proces još nije završen.</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Ukupno:</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>URI handling</source>\n        <translation>URI upravljanje</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>Poslano</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Primljeno</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Iznos</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 i %2</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nepoznato</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Spremi sliku...</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Spremi QR kod</translation>\n    </message>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Verzija klijenta</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informacije</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Konzola za dijagnostiku</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Mreža</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Ime</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Broj veza</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Lanac blokova</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Trenutni broj blokova</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Primljeno</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Poslano</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Smjer</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Verzija</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Trajanje veze</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Posljednje vrijeme bloka</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Otvori</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konzola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Mrežni promet</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Ukupno:</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Očisti konzolu</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Nepoznato</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Iznos:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Oznaka:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Poruka:</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Obriši sva polja</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Zatraži plaćanje</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Pokaži</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiraj oznaku</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiraj iznos</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR kôd</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopiraj &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopiraj &amp;adresu</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Spremi sliku...</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Iznos</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Poruka</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI je predug, probajte skratiti tekst za naslov / poruku.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Greška kod kodiranja URI adrese u QR kod.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Poruka</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nema oznake)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(bez poruke)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Slanje novca</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Nedovoljna sredstva</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Količina:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtova:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Iznos:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Naknada:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Vraćeno:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Naknada za transakciju:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Pošalji novce većem broju primatelja u jednoj transakciji</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;Dodaj primatelja</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Obriši sva polja</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Prah:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Obriši &amp;sve</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Stanje:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Potvrdi akciju slanja</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Pošalji</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiraj iznos</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>ili</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Potvrdi slanje novca</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Iznos mora biti veći od 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Iznos je veći od raspoložljivog stanja novčanika.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Iznos je veći od stanja novčanika kad se doda naknada za transakcije od %1.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nema oznake)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Iznos:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Primatelj plaćanja:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Oznaka:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Zalijepi adresu iz međuspremnika</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Poruka:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Primatelj plaćanja:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Unesite oznaku za ovu adresu kako bi ju dodali u vaš adresar</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Potpišite poruku</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Zalijepi adresu iz međuspremnika</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Upišite poruku koju želite potpisati ovdje</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Potpis</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>&amp;Potpišite poruku</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Obriši &amp;sve</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Potvrdite poruku</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>&amp;Potvrdite poruku</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Otključavanje novčanika je otkazano.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Poruka je potpisana.</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Otvoren do %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1 nije dostupan</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/nepotvrđeno</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 potvrda</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, još nije bio uspješno emitiran</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Izvor</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generiran</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Od</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nepoznato</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Za</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>vlastita adresa</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>oznaka</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Uplaćeno</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>Nije prihvaćeno</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Zaduženje</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Naknada za transakciju</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Neto iznos</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Poruka</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Komentar</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID transakcije</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transakcija</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Unosi</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Iznos</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Ovaj prozor prikazuje detaljni opis transakcije</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tip</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Otvoren do %1</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Potvrđen (%1 potvrda)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Ovaj blok nije bio primljen od strane bilo kojeg drugog čvora i vjerojatno neće biti prihvaćen!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generirano, ali nije prihvaćeno</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Primljeno s</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Primljeno od</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Poslano za</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Plaćanje samom sebi</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Rudareno</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/d)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nema oznake)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Status transakcije</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Datum i vrijeme kad je transakcija primljena</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Vrsta transakcije.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Iznos odbijen od ili dodan k saldu.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Sve</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Danas</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Ovaj tjedan</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Ovaj mjesec</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Prošli mjesec</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Ove godine</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Raspon...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Primljeno s</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Poslano za</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Samom sebi</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Rudareno</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Ostalo</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Min iznos</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiraj adresu</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiraj oznaku</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiraj iznos</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopiraj ID transakcije</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Izmjeni oznaku</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Prikaži detalje transakcije</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Datoteka podataka odvojenih zarezima (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potvrđeno</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tip</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Izvoz neuspješan</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Raspon:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>za</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Slanje novca</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Izvozi</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Izvoz podataka iz trenutnog lista u datoteku</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Arhiviranje novčanika</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Podaci novčanika (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Arhiviranje nije uspjelo</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Postavke:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Odaberi direktorij za datoteke</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Odaberi vlastitu javnu adresu</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Prihvati komande iz tekst moda i JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Izvršavaj u pozadini kao uslužnik i prihvaćaj komande</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opcije za kreiranje bloka:</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Pogreška: Nema dovoljno prostora na disku!</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacija</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Šalji trace/debug informacije na konzolu umjesto u debug.log datoteku</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Korisničko ime za JSON-RPC veze</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Upozorenje</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Lozinka za JSON-RPC veze</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Izvršite naredbu kada se najbolji blok promjeni (%s u cmd je zamjenjen sa block hash)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Dozvoli DNS upite za -addnode, -seednode i -connect</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Nedovoljna sredstva</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Učitavanje indeksa blokova...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Učitavanje novčanika...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Nije moguće novčanik vratiti na prijašnju verziju.</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Ponovno pretraživanje...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Učitavanje gotovo</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greška</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_hu.ts",
    "content": "<TS language=\"hu\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>A cím vagy címke szerkeszteséhez kattintson a jobb gombbal</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Új cím létrehozása</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Új</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>A kiválasztott cím másolása a vágólapra</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Másolás</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Bezárás</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Kiválasztott cím törlése a listából</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Jelenlegi nézet exportálása fájlba</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportálás</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Törlés</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Válassza ki a címet utaláshoz</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Válassza ki a címet jóváíráshoz</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>K&amp;iválaszt</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Küldési cím</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Fogadási cím</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Ezek a Bitcoin címeid kifizetések küldéséhez. Mindíg ellenőrizd az összeget és a fogadó címet mielőtt coinokat küldenél.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Ezek a Bitcoin címeid kifizetések fogadásához. Ajánlott új címet használni minden új fogadáshoz.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Cím másolása</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Másolás és Címkézés</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>Szerkesztés</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Címlista exportálása</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Vesszővel elválasztott adatokat tartalmazó fájl (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Hiba az exportálás során</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Címke</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Cím</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nincs címke)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Jelszó párbeszédablak</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Add meg a jelszót</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Új jelszó</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Új jelszó újra</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Gépelje be az új kulcsmondatot a pénztárcához.&lt;br/&gt;\nKérem a kulcsmondatban használjon &lt;b&gt; tíz vagy több véletlenszerű karaktert &lt;/b&gt;, vagy &lt;b&gt; nyolc vagy több szót &lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Tárca titkosítása</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Ehhez a művelethez szükség van a tárcához tartozó kulcsmondathoz, hogy kinyithassa azt.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Tárca kinyitása</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Ehhez a művelethez szükség van a tárcához tartozó kulcsmondathoz, hogy a titkosítás megszűnjön.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Tárca dekódolása</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Kulcsmondat megváltoztatása</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Gépelje be a tárcához tartozó régi, és új kulcsmondatot</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Tárca titkosításának megerősítése</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Figyelem: Ha titkosítja a tárcáját és elveszíti a jelszavát, akkor &lt;b&gt;AZ ÖSSZES BITCOINJA ELVESZIK&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Biztosan titkosítani akarja a tárcát?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Tárca titkosítva</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>A %1 most bezár, hogy befejezze a titkosítást. Ne feledje, hogy a tárca titkosítása nem nyújt teljes védelmet azzal szemben, hogy kártékony programok megfertőzzék a számítógépét és ellopják a bitcoinjait.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>FONTOS: A tárca-fájl minden korábbi biztonsági mentését cserélje le ezzel az újonnan generált, titkosított tárca-fájllal. Biztonsági okokból a tárca-fájl korábbi, titkosítás nélküli mentései használhatatlanná válnak, amint elkezdi használni az új, titkosított tárcát.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>A tárca titkosítása sikertelen.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Tárca titkosítása belső hiba miatt sikertelen. A tárcád nem lett titkosítva.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>A megadott jelszavak nem egyeznek.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Tárca megnyitása sikertelen</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>A tárca titkosításának feloldásához megadott jelszó helytelen.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Tárca titkosításának feloldása sikertelen</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Tárca jelszava sikeresen megváltoztatva.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Vigyázat: a Caps Lock be van kapcsolva!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP-cím/maszk</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Kitiltás vége</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Üzenet aláírása...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Szinkronizálás a hálózattal...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Áttekintés</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Csomópont</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Tárca általános áttekintése</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Tranzakciók</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Tranzakciós előzmények megtekintése</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Kilépés</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Kilépés az alkalmazásból</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;A %1-ról</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>%1 információ megjelenítése</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>A &amp;Qt-ról</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Információk a Qt-ról</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opciók...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>%1 beállítások módosítása</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Tárca &amp;titkosítása...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Bisztonsági másolat készítése a Tárcáról</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Jelszó &amp;megváltoztatása...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Küldési címek...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Fogadó címek...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>&amp;URI azonosító megnyitása...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Kattintson a hálózati tevékenység letiltásához.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Hálózati tevékenység letiltva.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Kattintson a hálózati tevékenység újbóli engedélyezéséhez.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Fejlécek Szinkronizálása (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Lemezen lévő blokkok újraindexelése...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Bitcoin küldése megadott címre</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Biztonsági másolat készítése a tárcáról egy másik helyre</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Tárca-titkosító jelszó megváltoztatása</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Debug ablak</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Hibakereső és diagnosztikai konzol megnyitása</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Üzenet &amp;valódiságának ellenőrzése</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Tárca</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Küldés</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Fogadás</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mutat / Elrejt</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Főablakot mutat/elrejt</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>A tárcádhoz tartozó privát kulcsok titkosítása</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Üzenetek aláírása a Bitcoin-címmeiddel, amivel bizonyítod, hogy a cím a sajátod</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Üzenetek ellenőrzése, hogy valóban a megjelölt Bitcoin-címekkel vannak-e aláírva</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fájl</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Beállítások</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Súgó</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Fül eszköztár</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Fizetési kérelem (QR-kódot és \"bitcoin:\" URI azonosítót hoz létre)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>A használt küldési címek és címkék megtekintése</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>A használt fogadó címek és címkék megtekintése</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>\"bitcoin:\" URI azonosító vagy fizetési kérelem megnyitása</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Paran&amp;cssor kapcsolók</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktív kapcsolat a Bitcoin hálózathoz</numerusform><numerusform>%n aktív kapcsolat a Bitcoin hálózathoz</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Lemezen lévő blokkok indexelése...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Lemezen lévő blokkok feldolgozása...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n blokk feldolgozva a tranzakció előzményből.</numerusform><numerusform>%n blokk feldolgozva a tranzakció előzményből.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 lemaradás</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Az utolsóként kapott blokk kora: %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Ez utáni tranzakciók még nem lesznek láthatóak. </translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hiba</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Figyelem</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Információ</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Naprakész</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>A %1 súgó megjelenítése a Bitcoin lehetséges parancssori kapcsolóinak listájával</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 kliens</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Csatlakozás párokhoz...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Frissítés...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Dátum:  %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Összeg: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Típus: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Címke: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Cím: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Tranzakció elküldve.</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Beérkező tranzakció</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD kulcs generálás &lt;b&gt;engedélyezett&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD kulcs generálás &lt;b&gt;tiltva&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>A tárca &lt;b&gt;titkosítva&lt;/b&gt; és jelenleg &lt;b&gt;nyitva&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Tárca &lt;b&gt;kódolva&lt;/b&gt; és jelenleg &lt;b&gt;zárva&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Végzetes hiba történt. A Bitcoin működése nem biztonságos és hamarosan leáll.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Érme Választás</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Mennyiség:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bájtok:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Összeg:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Díj:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Por-határ:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Utólagos díj:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Visszajáró:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>mindent kiválaszt/elvet</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Fa nézet</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Lista nézet</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Összeg</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Címkével érkezett</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Címmel érkezett</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Megerősítések</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Megerősítve</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Cím másolása</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Címke másolása</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Összeg másolása</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Tranzakció azonosító másolása</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Elköltetlen összeg zárolása</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Elköltetlen összeg zárolásának a feloldása</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Mennyiség másolása</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Díj másolása</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Utólagos díj másolása</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Byte-ok másolása </translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Porszemek másolása</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Visszajáró másolása</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 zárolva)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>igen</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nem</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Ez a címke pirosra változik, ha bármely fogadóhoz, a porszem határértéknél kevesebb összeg érkezik.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Megadott értékenként  +/- %1 satoshi-val változhat.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nincs címke)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>visszajáró %1-ből (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(visszajáró)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Cím szerkesztése</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>Cím&amp;ke</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Ehhez a listaelemhez rendelt címke </translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Ehhez a címlistaelemhez rendelt cím. Csak a küldő címek módosíthatók.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Cím</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Új fogadó cím</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Új küldő cím</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Fogadó cím szerkesztése</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Küldő cím szerkesztése</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>A megadott \"%1\" cím nem egy érvényes Bitcoin-cím.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>A megadott \"%1\" cím már szerepel a címjegyzékben.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Tárca feloldása sikertelen</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Új kulcs generálása sikertelen.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Új adatkönyvtár lesz létrehozva.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>Név</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Az elérési út létezik, de nem egy könyvtáré.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Adatkönyvtár nem hozható itt létre.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>verzió</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>A %1 -ról</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Parancssoros opciók</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Használat:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>parancssoros opciók</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Kezelőfelület beállításai:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Adatkönyvtár kiválasztása induláskor (alapértelmezett:  %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Nyelvbeállítás, például \"de_DE\" (alapértelmezett: rendszer nyelve)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Indítás lekicsinyítve</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>SLL gyökér-igazolások megadása fizetési kérelmekhez (alapértelmezett: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Indítóképernyő mutatása induláskor (alapértelmezett:  %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>A grafikus felület összes megváltoztatott beállításának a visszaállítása</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Üdvözlünk</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Üdvözlünk a %1 -ban.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Mivel ez a program első indulása, megváltoztathatja, hogy a %1 hova mentse az adatokat.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Ha az OK-ra kattint, %1 megkezdi a teljes %4 blokk lánc letöltését és feldolgozását (%2GB) a legkorábbi tranzakciókkal kezdve %3 -ben, amikor a %4 bevezetésre került.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Az első szinkronizáció nagyon erőforrás-igényes és felszínre hozhat a számítógépében eddig rejtve maradt hardver problémákat. Minden %1 indításnál a program onnan folytatja a letöltést, ahol legutóbb abbahagyta.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Ha a tárolt blokk lánc méretének korlátozását (megnyesését) választotta, akkor is le kell tölteni és feldolgozni az eddig keletkezett összes adatot, de utána ezek törlésre kerülnek, hogy ne foglaljunk sok helyet a merevlemezén.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Az alapértelmezett adat könyvtár használata</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Saját adatkönyvtár használata:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Legalább %1 GB adatot fogunk ebben a könyvtárban tárolni és idővel ez egyre több lesz.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Hozzávetőlegesen %1 GB adatot fogunk ebben a könyvtárban tárolni.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 le fog töltődni és a Bitcoin blokk lánc egy másolatát fogja tárolni.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Ebben a könyvtárban lesz a pénztárca is.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Hiba: A megadott \"%1\" adatkönyvtár nem hozható létre. </translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hiba</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB elérhető szabad hely</numerusform><numerusform>%n GB elérhető szabad hely</numerusform></translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Űrlap</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>A legutóbbi tranzakciók még lehet, hogy nem látszanak, ezért előfordulhat, hogy a pénztárca egyenlege nem a valós állapotot mutatja. Ha a pénztárca befejezte a szinkronizációt a bitcoin hálózattal, utána már az aktuális egyenleget fogja mutatni, amint alant részletesen látszik.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>A hálózat nem fogadja el azoknak a bitcoinoknak az elköltését, amelyek érintettek a még nem látszódó tranzakciókban.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Hátralévő blokkok száma</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Ismeretlen...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Utolsó blokk ideje</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Folyamat</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>A folyamat előrehaladása óránként</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>számítás folyamatban...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Hozzávetőlegesen a hátralévő idő a szinkronizáció befejezéséig</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Elrejtés</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Ismeretlen. Fejlécek szinkronizálása (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>URI megnyitása</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Fizetési kérelem megnyitása URI azonosítóból vagy fájlból</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Fizetési kérelmi fájl kiválasztása</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Válassza ki a megnyitni kívánt fizetési kérelem fájlt</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opciók</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Fő</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>%1 automatikus indítása  a rendszerbe való belépés után.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Induljon el a %1 a rendszerbe való belépéskor</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>A&amp;datbázis gyorsítótár mérete</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>A szkript &amp;igazolási szálak száma</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>A proxy IP címe (pl.: IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Megmutatja, hogy az alapértelmezett SOCKS5 proxy van-e használatban, hogy elérje a párokat ennél a hálózati típusnál.</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Az alkalmazásból való kilépés helyett az eszköztárba kicsinyíti az alkalmazást az ablak bezárásakor. Ez esetben az alkalmazás csak a Kilépés menüponttal zárható be.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Harmadik féltől származó URL-ek (pl. egy blokk felfedező) amelyek a tranzakciós fülön jelennek meg mint a környezetérzékeny menü tételei. %s az URL-ben helyettesítve a tranzakciós hash-el. Több URL esetén, függőleges vonal választja el őket.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktív parancssori beállítások, melyek felülírják a fenti beállításokat:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>A %1 konfigurációs fájl megnyitása a munkakönyvtárból.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Konfigurációs Fájl Megnyitása</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Minden kliensbeállítás alapértelmezettre állítása.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>Beállítások tö&amp;rlése</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Hálózat</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automatikus, &lt;0 = ennyi processzormagot hagyjon szabadon)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>T&amp;árca</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Szakértő</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Pénzküldés beállításainak engedélyezése</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Ha letiltja a jóváhagyatlan visszajáró elköltését, akkor egy tranzakcióból származó visszajárót nem lehet felhasználni, amíg legalább egy jóváhagyás nem történik. Ez befolyásolja az egyenlegének a kiszámítását is.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Költése a a jóváhagyatlan visszajárónak</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>A Bitcoin-kliens portjának automatikus megnyitása a routeren. Ez csak akkor működik, ha a routered támogatja az UPnP-t és az engedélyezve is van rajta.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>&amp;UPnP port-feltérképezés</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Csatlakozás a Bitcoin hálózatához SOCKS5 proxyn keresztül</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Kapcsolódás SOCKS5 proxyn keresztül (alapértelmezett proxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Proxy portja (pl.: 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Párok elérésére használjuk ezen keresztül:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Csatlakozás a Bitcoin hálózathoz külön SOCKS5 proxy használatával a Tor rejtett szolgáltatásainak eléréséhez.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Ablak</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Kicsinyítés után csak eszköztár-ikont mutass</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Kicsinyítés a tálcára az eszköztár helyett</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>K&amp;icsinyítés záráskor</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Megjelenítés</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Felhasználófelület nye&amp;lve:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>A felhasználói felület nyelvét tudja itt beállítani. Ez a beállítás csak a %1 újraindítása után lép életbe.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Mértékegység:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Válaszd ki az interfészen és érmék küldésekor megjelenítendő alapértelmezett alegységet.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Mutassa a pénzküldés beállításait vagy ne.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>Megszakítás</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>alapértelmezett</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>semmi</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Beállítások törlésének jóváhagyása.</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>A változtatások aktiválásahoz újra kell indítani a klienst.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>A kliens le fog állni. Szeretné folytatni?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Beállítási lehetőségek</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>A konfigurációs fájlt a haladó felhasználók olyan beállításokra használhatják, amelyek felülírják a grafikus felület beállításait. Azonban bármely parancssori beállítás felülírja a konfigurációs fájl beállításait.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hiba</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Nem sikerült megnyitni a konfigurációs fájlt.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Ehhez a változtatáshoz újra kellene indítani a klienst.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>A megadott proxy cím nem érvényes.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Űrlap</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>A kijelzett információ lehet, hogy elavult. A pénztárcája automatikusan szinkronizálja magát a Bitcoin hálózattal miután a kapcsolat létrejön, de ez e folyamat még nem fejeződött be.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Csak megfigyelés</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Elérhető:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Jelenlegi egyenleg</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Küldés:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Még megerősítésre váró, a jelenlegi egyenlegbe be nem számított tranzakciók</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Éretlen:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Bányászott egyenleg amely még nem érett be.</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Egyenlegek</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Összesen:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Aktuális egyenleged</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>A csak megfigyelt címeinek az egyenlege</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Elkölthető:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>A legutóbbi tranzakciók</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>A csak megfigyelt címek hitelesítetlen tranzakciói</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>A csak megfigyelt címek bányászott, még éretlen egyenlege</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>A csak megfigyelt címek jelenlegi teljes egyenlege</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Hiba történt a fizetési kérelem során</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>A bitcoin nem tud elindulni: click-to-pay kezelő</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI kezelés</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Érvénytelen fizetési cím %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>Nem sikerült az URI elemzése! Ezt okozhatja érvénytelen Bitcoin cím, vagy rossz URI paraméterezés.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Fizetés kérelmi fájl kezelése</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Nem sikerült beolvasni a fizetési kérelmi fájlt! Ezt érvénytelen fizetési kérelmi fájl okozhatja.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>A fizetési kérelem visszautasítva</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>A fizetési kérelmi hálózat nem egyezik a kliens hálózatával.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>A fizetési kérelem lejárt.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>A fizetési kérelem nem inicializálódott</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Érvénytelen fizetési kérelem</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>A %1 fizetésre kért összege túl kevés (porszemnek minősül).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Visszatérítés a %1 -tól</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>A fizetési kérelem %1 túl nagy (%2 byte, csak %3 byte engedélyezett).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Hiba a kommuniáció során %1 -el: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Nem sikerült elemezni a fizetési kérelmet!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Rossz válasz a kiszolgálótól %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Hálózati kérelem hiba</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Fizetés elfogadva</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Csomópont/Szolgáltatás</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Csomópont Azonosító</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Küldött</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Fogadott</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Összeg</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Ad meg egy Bitcoin címet (pl: %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 n</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 ó</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 p</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 mp</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Semmi</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Nem elérhető</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n másodperc</numerusform><numerusform>%n másodperc</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n perc</numerusform><numerusform>%n perc</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n óra</numerusform><numerusform>%n óra</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n nap</numerusform><numerusform>%n nap</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n hét</numerusform><numerusform>%n hét</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 és %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n év</numerusform><numerusform>%n év</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 még nem lépett ki biztonságosan...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ismeretlen</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Hiba: A megadott \"%1\" adatkönyvtár nem létezik. </translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Hiba: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Kép Mentése</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Kép Másolása</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>QR Kód Mentése</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG kép (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Nem elérhető</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Kliens verzió</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Információ</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Debug ablak</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Általános</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Használt BerkeleyDB verzió</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Adatkönyvtár</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Bekapcsolás ideje</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Hálózat</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Név</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Kapcsolatok száma</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blokklánc</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Aktuális blokkok száma</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Memória Halom</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Jelenlegi tranzakciók száma</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Memóriahasználat</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Visszaállítás</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Fogadott</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Küldött</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Peerek</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Kitiltott felek</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Peer kijelölése a részletes információkért</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Engedélyezett</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Irány</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Verzió</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Kezdő Blokk</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Szinkronizált Fejlécek</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Szinkronizált Blokkok</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>A %1 debug log fájl megnyitása a jelenlegi könyvtárból. Ez néhány másodpercig eltarthat nagyobb log fájlok esetén.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Betűméret kicsinyítése</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Betűméret növelése</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Szolgáltatások</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Csatlakozás ideje</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Legutóbbi küldés</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Legutóbbi fogadás</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping idő</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>A jelenlegi kiváló ping időtartama.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping Várakozás</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Minimum Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Idő Eltolódás</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Utolsó blokk ideje</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Megnyitás</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konzol</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Hálózati forgalom</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Összesen:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Be:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Ki:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Debug naplófájl</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Konzol törlése</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;óra</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;nap</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;hét</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;év</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Szétkapcsol</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Kitiltás oka</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Feloldja a kitiltást</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Üdv a %1 RPC konzoljában.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Használja a fel és le nyilakat az előzményekben való navigáláshoz, és %1 -et a képernyő törlésére.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>FIGYELEM: Csalók megpróbálnak felhasználókat rávenni, hogy parancsokat írjanak be ide, és ellopják a tárca tartalmát. Ne használja ezt a konzolt anélkül, hogy teljesen megértené egy parancs kiadásának a következményeit.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Hálózati tevékenység letiltva.</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(csomópont azonosító: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>%1 által</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>soha</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Bejövő</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Kimenő</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Igen</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nem</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Ismeretlen</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Összeg:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>Címke:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Üzenet:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Egy opcionális üzenet csatolása a fizetési kérelemhez, amely megjelenik a kérelem megnyitásakor. Megjegyzés: Az üzenet nem lesz elküldve a fizetséggel a Bitcoin hálózaton keresztül.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Egy opcionális címke, amit hozzá lehet rendelni az új fogadó címhez.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Használja ezt az űrlapot fizetési kérelmekhez. Minden mező &lt;b&gt;opcionális&lt;/b&gt; </translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Egy opcionálisan kérhető összeg. Hagyja üresen, vagy írjon be nullát, ha nem kívánja használni.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Minden mező törlése</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Törlés</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>A kért kifizetések története</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Fizetés kérése</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Mutassa meg a kiválasztott kérelmet (ugyanaz, mint a duplaklikk)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mutat</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>A kijelölt elemek törlése a listáról</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Eltávolítás</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>URI másolása</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Címke másolása</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Üzenet másolása</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Összeg másolása</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR kód</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>&amp;URI másolása</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Cím másolása</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Kép mentése</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Fizetés kérése a %1 -hez</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Fizetési információ</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Cím</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Összeg</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Címke</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Üzenet</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>A keletkezett URI túl hosszú, próbálja meg csökkenteni a cimke / üzenet szövegének méretét.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Hiba lépett fel az URI QR kóddá alakításakor.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Címke</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Üzenet</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nincs címke)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(nincs üzenet)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(nem kért összeget)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Kért</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Érmék küldése</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Pénzküldés beállításai</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Bemenetek...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automatikusan kiválasztva</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fedezethiány!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Mennyiség:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bájtok:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Összeg:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Díjak:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Utólagos díj:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Visszajáró:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Ha ezt a beállítást engedélyezi, de a visszajáró cím érvénytelen, a visszajáró egy újonnan generált címre lesz küldve.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Egyedi visszajáró cím</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Tranzakciós díj</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Válassz...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>A tartalék díj (failback fee) használata egy órákig vagy napokig tartó (vagy soha be nem fejeződő) tranzakciót eredményezhet. Fontolja meg, hogy Ön adja meg a díjat, vagy várjon amíg a teljes láncot érvényesíti.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Figyelem: A hozzávetőleges díjszámítás jelenleg nem lehetséges.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>díj beállítások bezárása</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>kilobájtonként</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Elrejtés</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(olvasd el a gyorstippet)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Ajánlott:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Egyéni:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Küldés több címzettnek egyszerre</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;Címzett hozzáadása</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Minden mező törlése</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Por-határ:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Mindent &amp;töröl</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Egyenleg:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Küldés megerősítése</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Küldés</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Mennyiség másolása</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Összeg másolása</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Díj másolása</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Utólagos díj másolása</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Byte-ok másolása </translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Porszemek másolása</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Visszajáró másolása</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Biztosan el akarja küldeni?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>hozzáadva, mint tranzakciós díj</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Teljes Összeg %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>vagy</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Összeg küldésének megerősítése</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>A fogadó címe érvénytelen. Kérem ellenőrizze.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>A fizetendő összegnek nagyobbnak kell lennie 0-nál.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Az összeg meghaladja az egyenlegét.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>A küldeni kívánt összeg és a %1 tranzakciós díj együtt meghaladja az egyenlegén rendelkezésre álló összeget.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Többször szerepel ugyanaz a cím: egy címet csak egyszer használjon.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Tranzakció létrehozása sikertelen!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Tranzakció visszautasítva a következő indokkal: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Magasabb díj mint %1 abszurd magas díjnak számít.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>A fizetési kérelem lejárt.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Csak a szükséges %1 díj fizetése</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Figyelmeztetés: Érvénytelen Bitcoin cím</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Figyelmeztetés: Ismeretlen visszajáró cím</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Egyedi visszajáró cím jóváhagyása</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>A cím, amelyet a visszajárónak megadott, nincs ebben a tárcában. Bármennyi vagy minden összeg elküldhető a tárcájából erre a címre. Biztos benne?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nincs címke)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Összeg:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Címzett:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>Címke:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Válassz egy korábban már használt címet</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Ez normál fizetés.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Erre a Bitcoin címre küldje az összeget</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Cím beillesztése a vágólapról</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Ez a bejegyzés eltávolítása</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>&amp;Vonja le a díjat az összegből</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Üzenet:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Adjon egy címkét ehhez a címhez, hogy bekerüljön a használt címek közé</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Címzett:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Jegyzet:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Adjon egy címkét ehhez a címhez, hogy bekerüljön a címtárába</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Igen</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>A %1 leáll...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Ne állítsd le a számítógépet amíg ez az ablak el nem tűnik.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Aláírások - üzenet aláírása/ellenőrzése</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>Üzenet aláírása...</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Bitcoin cím, amivel alá kívánja írni az üzenetet</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Válassz egy korábban már használt címet</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Cím beillesztése a vágólapról</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Ide írja az aláírandó üzenetet</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Aláírás</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>A jelenleg kiválasztott aláírás másolása a rendszer-vágólapra</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Üzenet </translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Üzenet &amp;aláírása</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Mindent &amp;töröl</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>Üzenet ellenőrzése</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Bitcoin cím, amivel aláírta az üzenetet</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Ellenőrizze az üzenetet, hogy valóban a megjelölt Bitcoin címmel van-e aláírva</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Üzenet ellenőrzése</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Klikkeljen az \"Üzenet Aláírása\" -ra, hogy aláírást generáljon</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>A megadott cím nem érvényes.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Kérem ellenőrizze a címet és próbálja meg újra.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Tárca megnyitása megszakítva</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>A megadott cím privát kulcsa nem található.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Üzenet aláírása sikertelen.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Üzenet aláírva.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Az aláírást nem sikerült dekódolni.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Kérem ellenőrizze az aláírást és próbálja újra.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Az üzenet ellenőrzése sikertelen.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Üzenet ellenőrizve.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[teszthálózat]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>%1 -ig megnyitva</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/megerősítetlen, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>a memória halomban</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>nincs a memória halomban</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>elhagyott</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/megerősítetlen</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 megerősítés</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Állapot</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, még nem sikerült közvetíteni</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Forrás</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generálva</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Küldő: </translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ismeretlen</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Címzett</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>saját cím</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>csak megfigyelés</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>címke</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Jóváírás</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>elutasítva</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Terhelés</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Teljes terhelés</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Tranzakciós díj</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Nettó összeg</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Üzenet</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Megjegyzés</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Tranzakció Azonosító</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Tranzakció teljes mérete</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Kereskedő</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Debug információ</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Tranzakció</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Bemenetek</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Összeg</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>igaz</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>hamis</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Ez a mező a tranzakció részleteit mutatja</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Típus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Címke</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>%1 -ig megnyitva</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Megerősítetlen</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Elhagyott</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Megerősítés (%1 az ajánlott %2 megerősítésből)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Megerősítve (%1 megerősítés)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Konfliktusos</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Éretlen (%1 megerősítés, %2 után lesz elérhető)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Ezt a blokkot egyetlen másik csomópont sem kapta meg, így valószínűleg nem lesz elfogadva!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generálva, de nincs elfogadva</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Erre a címre</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Fogadva innen</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Elküldve ide</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Magadnak kifizetve</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Kibányászva</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>csak megfigyelés</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(nincs adat)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nincs címke)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Tranzakció állapota. Húzza ide az egeret, hogy lássa a megerősítések számát.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Tranzakció fogadásának dátuma és időpontja.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tranzakció típusa.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Egy csak megfigyelt cím érintett vagy nem ebben a tranzakcióban.</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Mind</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Ma</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Ezen a héten</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Ebben a hónapban</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Múlt hónapban</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Ebben az évben</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Tartomány...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Erre a címre</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Elküldve ide</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Magának</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Kibányászva</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Más</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minimális összeg</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Tranzakció megszakítása</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Tranzakciós díj növelése</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Cím másolása</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Címke másolása</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Összeg másolása</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Tranzakció azonosító másolása</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Nyers tranzakció másolása</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Tranzakció részleteinek teljes másolása</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Címke szerkesztése</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Tranzakció részletesen</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Tranzakciós előzmények exportálása</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Vesszővel elválasztott adatokat tartalmazó fájl</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Megerősítve</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Csak megfigyelés</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Típus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Címke</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Cím</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>Azonosító</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Hiba az exportálás során</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Hiba történt a tranzakciós előzmények %1 helyre való mentésekor. </translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Sikeres Exportálás</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Tartomány:</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Nincs betöltve pénztárca.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Érmék Küldése</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Tranzakciós díj növelése sikertelen</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Kívánja megnövelni a díjat?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Jelenlegi díj:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Új díj:</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Tranzakció aláírása sikertelen.</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportálás</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Jelenlegi nézet adatainak exportálása fájlba</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Biztonsági másolat készítése a Tárcáról</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Tárca Fájl (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Biztonsági másolat készítése sikertelen</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Sikeres biztonsági mentés</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>A tárca adatai sikeresen elmentve %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opciók\n</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Adatkönyvtár\n</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Kapcsolódás egy csomóponthoz a peerek címeinek megszerzése miatt, majd szétkapcsolás</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Adja meg az Ön saját nyilvános címét</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Parancssoros és JSON-RPC parancsok elfogadása\n</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>MIT szoftver licenc alapján terjesztve, tekintse meg a hozzátartozó fájlt %s or %s</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Hiba: Fatális belső hiba történt, nézze meg a debug.log -ot a részletekért</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Háttérben futtatás daemonként és parancsok elfogadása\n</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>A %s fejlesztők</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Parancs, amit akkor hajt végre, amikor egy tárca-tranzakció megváltozik  (%s a parancsban lecserélődik a blokk TxID-re)</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>UPnP használata porttovábbításra (alapértelmezett: 1, amikor kiszolgál és nem használt a -proxy)</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; lehet:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Kívülről érkező kapcsolatok elfogadása (alapértelmezett: 1, ha nem használt a -proxy vagy a -connect)</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Sérült blokk-adatbázis észlelve</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Újra akarod építeni a blokk adatbázist most?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>A blokkadatbázis inicializálása nem sikerült</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>A tárca-adatbázis inicializálása nem sikerült: %s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Hiba a blokk adatbázis betöltése közben.</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Hiba a blokk adatbázis megnyitása közben.</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Hiba: kevés a hely a lemezen!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Egyik hálózati porton sem sikerül hallgatni. Használja a -listen=0 kapcsolót, ha ezt szeretné.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importálás</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Helytelen vagy nemlétező genézis blokk. Helytelen hálózati adatkönyvtár?</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Tiltólista betöltése...</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Nincs elég fájlleíró. </translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>A tranzakciós díj és a visszajáró kiszámítása nem sikerült</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Blokkok ellenőrzése...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Tárca beállítások:</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Saját IP-cím felfedezése (alapértelmezett: 1, amikor kiszolgál és nem használt a -externalip)</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>A fehérlistán szereplő felek nem lesznek automatikusan kitiltva és a tranzakcióik is mindig továbbítva lesznek, akkor is ha már a megerősítésre váró listán (mempool) vannak. Hasznos például összekötő csomópontokon (gateway).</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(alapértelmezett: %u)</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Hiba az adatbázis olvasásakor, leállítás</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Információ</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC szerver opciók:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>trace/debug információ küldése a konzolra a debog.log fájl helyett</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Tranzakció aláírása sikertelen</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Ez egy kísérleti szoftver.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Tranzakció összege túl alacsony</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Túl nagy tranzakció</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Felhasználói név JSON-RPC csatlakozásokhoz\n</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Figyelem</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Az adatbázist újra kell építeni -reindex használatával, hogy a -tindex-et módosítsd.</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Jelszó JSON-RPC csatlakozásokhoz\n</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Parancs, amit akkor hajt végre, amikor a legjobb blokk megváltozik (%s a cmd-ban lecserélődik a blokk hash-re)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>DNS-kikeresés engedélyezése az addnode-nál és a connect-nél</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Figyelem: Ismeretlen blokkokat bányásznak! Lehetséges, hogy ismeretlen szabályok érvényesek.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s étéke nagyon magas!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(alapértelmezett: %s)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Hiba a tárca betöltése közben %s. Érvénytelen karakterek a -tárca fájlnevében.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Hány blokkot ellenőrizzen induláskor (alapértelmezett: %u, 0 = mindet)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>IP-címek megjelenítése a naplóban (alapértelmezett: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Kapcsolatonkénti maximum fogadó buffer, &lt;n&gt;*1000 byte (alapértelmezett: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Kapcsolatonkénti maximum küldő buffer, &lt;n&gt;*1000 byte (alapértelmezett: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Kulcshalmaz méretének a beállítása &lt;n&gt;(alapértelmezett: %u) </translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Konfigurációs fájl megadása (alapértelmezett: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Csatlakozás időtúllépése milliszekundumban (minimum: 1, alapértelmezett: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Pid-fájl megadása (alapértelmezett: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Tranzakciók küldésekor a jóváhagyatlan visszajáró elköltése (alapértelmezés: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Hálózati szálak indítása...</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Ez a minimum tranzakciós díj, amelyet tranzakciónként kifizet.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Ez a tranzakció díja, amelyet kifizet, ha tranzakciót indít.</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Tranzakció összege nem lehet negatív</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Legalább egy címzett kell a tranzakcióhoz</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Ismeretlen hálózat lett megadva -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Nincs elég bitcoinod.</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Blokkindex betöltése...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Tárca betöltése...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Nem sikerült a Tárca visszaállítása a korábbi verzióra</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Újraszkennelés...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Betöltés befejezve.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hiba</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_hu_HU.ts",
    "content": "<TS language=\"hu_HU\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>A cím vagy a címke jobb gombbal szerkeszthető</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Új cím létrehozása</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Új</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>A jelenleg kiválasztott cím másolása a rendszer vágólapjára</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Másolás</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Bezárás</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>A jelenleg kiválasztott cím eltávolítása a listából</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>A jelenlegi fülön található adat exportálása fájlba</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Export</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Törlés</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Válasszon címet a küldéshez</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Válasszon címet a fogadáshoz</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Kiválasztás</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Küldő címek</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Fogadó címek</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Ezek az Ön kifizetéseinek küldésekor használandó Bitcoin-címek. Fizetés indítása előtt mindig ellenőrizze az összeget és a fogadó címet!</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Ezek az Ön fizetéseinek fogadásakor használandó Bitcoin-címek. Célszerű minden tranzakcióhoz új fogadó címet használni.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Cím másolása</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Címke &amp;másolása</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Szerkesztés</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Címlista exportálása</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Vesszővel elválasztott adatok (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Sikertelen export</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Hiba történt a címlista %1-re történő mentése során. Kérjük, próbálja újra!</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Címke</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Cím</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nincs címke)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Jelszóhalmaz Párbeszédablak</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Adja meg jelmondatát</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Új jelmondat</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ismételje meg jelmondatát</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Jelszó megjelenítése</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Adja meg az új jelszóhalmazt a pénztárcájához. &lt;br/&gt;Kérem a jelszóhalmaz álljon&lt;b&gt;tíz vagy több véletlenszerű karakterből&lt;/b&gt;, vagy &lt;b&gt;nyolc vagy több szóból&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Tárca kódolása</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Ehhez a művelethez szükség lesz a pénztárcájához tartozó jelszóhalmazra, hogy hozzáférjen a  pénztárcához.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Tárca feloldása</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Ehhez a művelethez szükség lesz a pénztárcájához tartozó jelszóhalmazra, hogy feloldja a pénztárca titkosítását.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Tárca dekódolása</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Jelmondat megváltoztatása</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Adja meg a régi jelszóhalmazt és az új jelszóhalmazt a pénztárcájához.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Tárca titkosításának jóváhagyása</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Figyelem: Ha titkosítja a pénztárcáját, és elveszíti a jelszóhalmazt, akkor &lt;b&gt;NEM TUD TÖBBET HOZZÁFÉRNI A BITCOINJAIHOZ&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Biztosan titkosítani kívánja a tárcáját?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Tárca titkosítva</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 Most az ablak bezáródik, amíg befejeződik a titkosítási folyamat. Kérem vegye figyelembe, hogy a pénztárca titkosítása nem jelenti a bitcoinjai teljes körű védelmét, a számítógépét esetlegesen megfertőző kártékony programoktól.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>FONTOS: A régebbi biztonsági mentéseket frissítse az új, titkosított pénztárca fájllal. Biztonsági okokból, a korábbi titkosítatlan pénztárca fájlok nem használhatóak az új titkosított pénztárcával.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Tárca titkosítása sikertelen</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>A pénztárca titkosítása programhiba miatt meghiúsult .  A pénztárca nem titkosított.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>A megadott jelszóhalmazok nem egyeznek.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Tárca feloldása sikertelen</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>A jelszóhalmaz, amelyet megadott a pénztárca titkosításának a feloldásához, helytelen.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Tárca dekódolása sikertelen</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>A tárca jelmondata sikeresen megváltozott.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Figyelmeztetés: A Caps Lock billentyű benyomva!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Kitiltva a megadott időpontig</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Üzenet &amp;aláírása</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Szinkronizálás a hálózattal...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>Á&amp;ttekintés</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Csomópont</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>A pénztárca általános áttekintése</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Tranzakciók</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Tranzakció-történet böngészése</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Ki&amp;lépés</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Alkalmazás bezárása</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Kapcsolat %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>További információ %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Kapcsolat &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>További információ Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Beállítások...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>A %1 konfigurációs beállításainak módosítása</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Tárca titkosítása</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Tárca &amp;biztonsági másolása</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Jelszóhalmaz megváltoztatása</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Címek küldése</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Címek &amp;fogadása</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>&amp;URI... Megnyitása</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Kattintson a hálózati tevékenység felfüggesztéséhez.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Hálózati tevékenység letiltva.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Kattintson a hálózati tevékenység ismételt engedélyezéséhez.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Fejlécek szinkronizálása (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>A blokkok újraindexelése folyik a merevlemezen...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Érmék küldése egy Bitcoin címre</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Tárca biztonsági mentése más helyre</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>A tárca titkosításához használt jelszóhalmaz megváltoztatása</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Hibakereső ablak</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Hibakereső és diagnosztikai konzol megnyitása</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Üzenet &amp;ellenőrzése</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Tárca</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>Küldé&amp;s</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Fogadás</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mutat/Elrejt</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Fő ablak megjelenítése vagy elrejtése</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Tárcájához tartozó privát kulcsok titkosítása</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Írja alá az üzeneteit a Bitcoin címével, hogy bizonyítsa Öntől származnak</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Ellenőrizze az üzeneteket, hogy a megadott Bitcoin címekkel lettek-e aláírva</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fájl</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Beállítások</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>Sú&amp;gó</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Ablak fülek eszköztára</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Kérjen fizetéseket (QR kódokat generál és bitcoin: URLeket)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mutassa a használt küldő címek és cimkék listáját</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Mutassa a használt fogadó címek és cimkék listáját</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Nyisson meg egy bitcoin: URI-t vagy fizetési kérelmet</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Parancssor beállításai</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktív kapcsolat a Bitcoin-hálózaton</numerusform><numerusform>%n aktív kapcsolat a Bitcoin-hálózaton</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>A blokkok indexelése folyik a merevlemezen...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>A blokkok feldolgozása a merevlemezen...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>A tranzakció-történetből %n blokk feldolgozva.</numerusform><numerusform>A tranzakció-történetből %n blokk feldolgozva.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 mögött</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Az utolsó kapott blokk %1 ideje keletkezett.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Az ez utáni tranzakciók még nem fognak látszani.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hiba</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Figyelmeztetés</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Információ</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Naprakész</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Mutassa a %1 súgó üzenetet a lehetséges Bitcoin parancssori beállítások listájáért</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 kliens</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Kapcsolatok kialakítása...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Felzárkózás...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Dátum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Összeg: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Típus: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Címke: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Cím: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Elküldött tranzakció</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Bejövő tranzakció</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD kulcs generálás &lt;b&gt;engedélyezve&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD kulcs generálás &lt;b&gt;tiltva&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Tárca &lt;b&gt;titkosítva&lt;/b&gt; és jelenleg &lt;b&gt;nyitva&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Tárca &lt;b&gt;titkosítva&lt;/b&gt; és jelenleg &lt;b&gt;zárolva&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Fatális hiba történt. A Bitcoin program nem tud tovább biztonságosan működni és be fog záródni.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Érme választó</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Mennyiség:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bájtok:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Öszeg:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Díj:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Porszem:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Eljárási díj után:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Változás:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>minden kiválasztása(kiválasztás megszüntetése)</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Fa mód</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Lista mód</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Összeg</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Címkével fogadott</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Címmel fogadott</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Jóváhagyások</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Jóváhagyva</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Cím másolása</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Címke másolása</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Összeg másolása</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Tranzakció ID másolása</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>El nem költött zárolása</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>El nem költött nyitása</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Mennyiség másolása</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Díj másolása</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Eljárási díj utáni másolás</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Bájtok másolása</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Por másolása</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Változás másolása</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 zárolva)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>igen</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nem</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Ez a címke pirosra változik, ha valamelyik fogadó fél kisebb összeget kap, mint a jelenlegi porszem határérték.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Változó +/- %1 satoshi(k) megadott értékenként.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nincs címke)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>változtatás %1 -ről (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(módosítás)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Cím szerkesztése</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Címke</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Ezzel a cím bejegyzéssel társított címke</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Ezzel a cím bejegyzéssel társított cím. Ezt csak a küldő címek esetén lehet megváltoztatni.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Cím</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Új fogadási cím</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Új küldési cím</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Fogadási cím szerkesztése</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Küldési cím szerkesztése</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>A megadott cím\"%1\" nem egy érvényes Bitcoin cím.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>A megadott cím \"%1\" már szerepel a címlistában.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>A tárca feloldása nem lehetséges</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Új kulcs létrehozása sikertelen</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Új mappa lesz létrehozva.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>név</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>A könyvtár már létezik. %1 hozzáadása, ha új könyvtárat kíván létrehozni.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Az elérési út létezik, de nem egy mappa.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Itt nem hozható létre mappa.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>verzió</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Kapcsolat %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Parancssor beállításai</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Használat:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>parancssor beállításai</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Felhasználói felület beállításai</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Adja meg az indításkor használt adat könyvtárat (alapbeállítás: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Nyelv beállítása, például \"de_DE\" (alaphelyzetben: a helyi rendszer nyelve)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Indítás rejtett ablakkal</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>A fizetési kérelmek SSL tanúsítványainak beállítása (alaphelyzetben: -a rendszer beállításai szerint-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Mutassa a kezdő képet indításkor (alaphelyzetben: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>A grafikus felület összes megváltoztatott beállításának a visszaállítása</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Üdvözöljük</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Üdvözöljük itt: %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Mivel ez a program első indulása, megváltoztathatja %1 hova mentse az adatokat.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Ha az OK-ra kattint, %1 megkezdi a teljes %4 blokk lánc letöltését és feldolgozását (%2GB) a legkorábbi tranzakciókkal kezdve %3 -ben, amikor a %4 bevezetésre került.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Az első szinkronizáció nagyon erőforrás-igényes és felszínre hozhat a számítógépében eddig rejtve maradt hardver problémákat. Minden %1 indításnál a program onnan folytatja a letöltést, ahol legutóbb abbahagyta.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Ha a tárolt blokk lánc méretének korlátozását (megnyesését) választotta, akkor is le kell tölteni és feldolgozni az eddig keletkezett összes adatot, de utána ezek törlésre kerülnek, hogy ne foglaljunk sok helyet a merevlemezen.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Alapértelmezett adatmappa használata</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Egyéni adatmappa használata:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Legalább  %1 GB adatot fogunk ebben a könyvtárban tárolni és idővel ez egyre több lesz.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Hozzávetőlegesen %1 GB adatot fogunk ebben a könyvtárban tárolni.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 le fog töltődni és a Bitcoin blokk lánc egy másolatát fogja tárolni.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Ebben a könyvtárban lesz a pénztárca is.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Hiba: A megadott könyvtárat \"%1\" nem sikerült létrehozni.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hiba</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB szabad hely áll rendelkezésre</numerusform><numerusform>%n GB szabad hely áll rendelkezésre</numerusform></translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Űrlap</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>A legutóbbi tranzakciók még lehet, hogy nem látszanak, ezért előfordulhat, hogy a pénztárca egyenlege nem a valós állapotot mutatja. Ha a pénztárca befejezte a szinkronizációt a bitcoin hálózattal, utána már az aktuális egyenleget fogja mutatni, amint alant részletesen látszik.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>A hálózat nem fogadja el azoknak a bitcoinoknak az elköltését, amelyek érintettek a még nem látszódó tranzakciókban.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Hátralévő blokkok száma</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Ismeretlen...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Utolsó blokk ideje</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Folyamat</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>A folyamat előrehaladása óránként</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>számolás...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Hozzávetőlegesen a hátralévő idő a szinkronizáció befejezéséig</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Elrejtés</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Ismeretlen. Fejlécek szinkronizálása (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>URI megnyitása</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Fizetési kérelem megnyitása URI-ból vagy fájlból</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>A fizetési kérelem fájl kiválasztása</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Válassza ki a megnyitni kívánt fizetési kérelem fájlt</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opciók</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Fő</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>%1 automatikus indítása a rendszerbe való belépés után.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Induljon el a %1 a rendszerbe való belépéskor</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Az &amp;adatbázis cache mérete</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>A szkript &amp;igazolási szálak száma</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Proxy IP címe (pl.: IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Megmutatja, hogy az alapértelmezett SOCKS5 proxy van-e használatban, hogy elérje a párokat ennél a hálózati típusnál.</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Rejtse el az ikont a rendszer tálcáról.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Tálcaikon elrejtése</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Kilépés helyett a program elrejtése az ablak bezárása után. Ha engedélyezte ezt a beállítást, akkor csak úgy tud kilépni a programból, ha a menüből a Kilépés opciót választja.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Harmadik féltől származó URL-ek (pl. egy blokk felfedező) amelyek a tranzakciós fülön jelennek meg mint a környezetérzékeny menü tételei. %s az URL-ben helyettesítve a tranzakciós hash-el. Több URL esetén, függőleges vonal választja el őket.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktív parancssori beállítások, melyek felülírják a fenti beállításokat:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>A %1 konfigurációs fájl megnyitása a munkakönyvtárból.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Konfigurációs Fájl Megnyitása</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Minden kliens beállítás visszaállítása alaphelyzetbe.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Visszaállítja a Beállításokat</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Hálózat</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automatikus, &lt;0 = ennyi processzormagot hagyjon szabadon)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>T&amp;árca</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Haladó</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Pénzküldés beállításainak engedélyezése</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Ha letiltja a jóváhagyatlan visszajáró elköltését, akkor egy tranzakcióból származó visszajárót nem lehet felhasználni, amíg legalább egy jóváhagyás nem történik. Ez befolyásolja az egyenlegének a kiszámítását is.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Költése a a jóváhagyatlan visszajárónak</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Automatikusan nyissa meg a Bitcoin kliens által használt portot a routeren. Ez csak akkor működik, ha a router támogatja a UPnP-t, és engedélyezett ez a beállítás.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Port feltérképezése &amp;UPnP használatával</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Kívülről érkező kapcsolatok fogadása.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>&amp;Bejövő kapcsolatok engedélyezése</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Csatlakozás a Bitcoin hálózathoz SOCKS5 proxy használatával.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Kapcsolódás SOCKS5 proxyn keresztül (alapértelmezett proxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Proxy portja (pl.: 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Párok elérésére használjuk ezen keresztül:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Csatlakozás a Bitcoin hálózathoz külön SOCKS5 proxy használatával a Tor rejtett szolgáltatásainak eléréséhez.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Ablak</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Csak az ablak elrejtése után mutassa a tálca ikont.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Elrejtés a tálcára ikon formában, a tálcán látható futó program helyett</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>&amp;Elrejtés bezáráskor</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Mutatás</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Felhasználói felület &amp;nyelve:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>A felhasználói felület nyelvét tudja itt beállítani. Ez a beállítás csak a %1 újraindítása után lép életbe.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Mértékegység amelyben mutassa az összegeket:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Válassza ki az alapértelmezett részmértékegységet, amely megjelenik a felhasználói felületen és pénzküldéskor.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Mutassa a pénzküldés beállításait vagy ne.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;Harmadik féltől származó tranzakciós URL-ek</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Mégse</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>alapméretezett</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>semmi</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Opciók visszaállításának megerősítése</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Újra kell indítani a programot a beállítások alkalmazásához.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>A kliens le fog állni. Szeretné folytatni?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Beállítási lehetőségek</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>A konfigurációs fájlt a haladó felhasználók olyan beállításokra használhatják, amelyek felülírják a grafikus felület beállításait. Azonban bármely parancssori beállítás felülírja a konfigurációs fájl beállításait.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hiba</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Nem sikerült megnyitni a konfigurációs fájlt.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Ehhez a változtatáshoz újra kellene indítani a klienst.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>A megadott proxy cím érvénytelen.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Űrlap</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Lehet, hogy a megjelenített információ elavult. A tárcája automatikusan szinkronizál a hálózattal kapcsolódás után, de a folyamat még nem ért véget.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Megfigyelés:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Elérhető:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Felhasználható egyenlege</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Függőben:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>A tranzakciók száma, amelyeket még hitelesíteni kell, és amelyek még nem tartoznak az elkölthető egyenlegbe.</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Éretlen:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Bányászott egyenleg, mely jelenleg még éretlen</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Egyenlegek</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Összesen:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Jelenlegi teljes egyenlege</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>A csak megfigyelt címeinek az egyenlege</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Elkölthető:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Legutóbbi tranzakciók</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>A csak megfigyelt címek hitelesítetlen tranzakciói</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>A csak megfigyelt címek bányászott, még éretlen egyenlege</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>A csak megfigyelt címek jelenlegi teljes egyenlege</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Hiba történt a fizetési kérelem során</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>A bitcoin nem tud elindulni: click-to-pay kezelő</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI kezelése</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Érvénytelen fizetési cím %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>Az URI nem dolgozható fel! Ennek oka lehet egy érvénytelen Bitcoin-cím, vagy hibás URI-paraméterek.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Fizetésikérelem-fájl kezelése</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>A fizetésikérelem-fájl nem olvasható! Lehet, hogy hibás a fájl.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Fizetési kérelem elutasítva</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>A fizetési kérelem hálózat nem egyezik a kliens hálózatával.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Fizetési kérelem lejárt</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Fizetési kérelem nincs inicializálva.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Érvénytelen fizetési kérelem</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>A %1 fizetésre kért összege túl kevés (porszemnek minősül).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Visszatérítés innen: %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>A %1 fizetési kérelem túl nagy (%2 bájt, megengedett: %3 bájt).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Hiba a kommunikáció során %1 -el: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>A fizetési kérelem nem dolgozható fel!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Rossz válasz a szervertől %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Hálózati hiba történt</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Fizetés nyugtázva</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Csomópont/Szolgáltatás</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Csomópont azonosító</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Elküldve</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Fogadva</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Összeg</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Adjon meg egy Bitcoin-címet (pl. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 n</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 ó</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 p</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 mp</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Nincs</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n másodperc</numerusform><numerusform>%n másodperc</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n perc</numerusform><numerusform>%n perc</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n óra</numerusform><numerusform>%n óra</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n nap</numerusform><numerusform>%n nap</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n hét</numerusform><numerusform>%n hét</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 és %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n év</numerusform><numerusform>%n év</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 még nem lépett ki biztonságosan...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ismeretlen</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Hiba: A megadott \"%1\" adatkönyvtár nem létezik.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Hiba: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Kép &amp;mentése</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>Kép má&amp;solása</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>QR-kód mentése</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG kép (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Kliens verzió</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Információ</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Hibakereső ablak</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Általános</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>BerkeleyDB verzió</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Adat elérési útja</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Indítás időpontja</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Hálózat</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Név</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Kapcsolatok száma</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blokklánc</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Blokkok aktuális száma</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Memória Halom</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Tranzakciók pillanatnyi száma</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Memóriahasználat</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Alaphelyzet</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Fogadva</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Elküldve</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Peer-ek</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Letiltott peer-ek</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Peer kijelölése a részletes információkért</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Engedélyezett</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Irány</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Verzió</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Kezdeti blokk</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Szikronizált fejlécek</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Szinkronizált blokkok</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>A %1 hibakeresési naplófájl megnyitása a jelenlegi könyvtárból. Ez néhány másodpercig eltarthat nagyobb naplófájlok esetén.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Betűméret csökkentése</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Betűméret növelése</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Szolgáltatások</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Csatlakozási idő</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Utolsó küldés</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Utolsó fogadás</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping idő</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>A jelenlegi kiváló ping időtartama.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Várakozás ping-re</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Minimum Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Idő Eltolódás</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Utolsó blokk ideje</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Megnyitás</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konzol</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Hálózati forgalom</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Összesen</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Be:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Ki:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Hibakeresési napló fájl</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Konzol ürítése</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;óra</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;nap</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;hét</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;év</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Szétkapcsol</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Tiltás oka</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Tiltás feloldása</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Üdv az %1 RPC konzoljában.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Az előzmények közötti navigálásához használd a fel és le nyilakat, és %1-t a képernyő törléséhez.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Írja be a %1 parancsot az elérhető utasítások áttekintéséhez.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>FIGYELEM: Csalók megpróbálnak felhasználókat rávenni, hogy parancsokat írjanak be ide, és ellopják a tárca tartalmát. Ne használja ezt a konzolt anélkül, hogy teljesen megértené egy parancs kiadásának a következményeit.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Hálózat aktivitása letiltva</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(csomópont azonosító: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>%1-n keresztül</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>soha</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Bejövő</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Kimenő</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Igen</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nem</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Ismeretlen</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Összeg:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Címke:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Üzenet:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Opciónális üzenet csatolása a fizetési kérelemhez, ami a kérelem megnyitásakor megjelenik. Megjegyzés: Az üzenet nem lesz elküldve a fizetéssel a Bitcoin hálózaton.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Opcionális címke hozzáadása az új fogadó címhez.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Használja ezt az űrlapot fizetések kérésére. Minden mező &lt;b&gt;opcionális&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Egy opcionálisan kérhető összeg. Hagyja üresen, vagy írjon be nullát, ha nem kívánja használni.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Az űrlap összes mezőjének törlése</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Törlés</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>A kért kifizetések előzménye</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Fizetési kérelem</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Mutassa meg a kiválasztott kérelmet (ugyanaz, mint a duplaklikk)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Megmutatás</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>A kijelölt elemek törlése a listáról</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Eltávolítás</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>URI másolása</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Címke másolása</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Üzenet másolása</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Összeg másolása</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-kód</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>&amp;URI másolása</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Cím másolása</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Kép &amp;mentése</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Fizetési kérelem tőle: %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Fizetési információ</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Cím</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Összeg</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Címke</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Üzenet</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>A keletkezett URI túl hosszú, próbálja meg csökkenteni a cimke / üzenet szövegének méretét.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Hiba lépett fel az URI QR kóddá alakításakor.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Címke</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Üzenet</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nincs címke)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(nincs üzenet)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(nem kért összeget)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Kért</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Érmék küldése</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Pénzküldés beállításai</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Bemenetek...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automatikusan kiválasztva</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fedezethiány!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Mennyiség:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bájtok:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Öszeg:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Díj:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Eljárási díj után:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Visszajáró:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Ha ezt a beállítást engedélyezi, de a visszajáró cím érvénytelen, a visszajáró egy újonnan generált címre lesz küldve.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Egyedi visszajáró cím</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Tranzakciós díj:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Választás...</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Figyelem: A hozzávetőleges díjszámítás jelenleg nem lehetséges.</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>kilobájtonként</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Elrejtés</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Ajánlott:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Egyedi:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Küldés egyszerre több címzettnek</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Az űrlap összes mezőjének törlése</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Porszem:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Megerősítési idő cél:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Mindent töröl</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Egyenleg:</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Küldés</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Mennyiség másolása</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Összeg másolása</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Díj másolása</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Eljárási díj utáni másolás</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Bájtok másolása</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Por másolása</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Változás másolása</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Biztosan elküldi?</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>vagy</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Az összegnek nagyobbnak kell lennie, mint 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Az összeg túlhaladja az egyenleged.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Tranzakció készítése sikertelen!</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Fizetési kérelem lejárt</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Figyelem: érvénytelen Bitcoin cím</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Egyedi visszajáró cím megerősítése</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nincs címke)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Összeg:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Címke:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Válasszon a korábban használt címek közül</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Ez egy normális fizetés.</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Cím beillesztése vágólapról</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Bejegyzés eltávolítása</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Elérhető egyenleg használata</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Üzenet:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Jegyzet:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Igen</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 leáll...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Ne kapcsold ki a számítógépet, amíg ez az üzenet el nem tűnik.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Aláírások - Aláír / Megerősít egy Üzenetet</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Válasszon a korábban használt címek közül</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Cím beillesztése vágólapról</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Aláírás</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>A pillanatnyi aláírás másolása a rendszer vágólapjára</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Mindent töröl</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Üzenet megerősítése</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>A beírt cím érvénytelen.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Ellenőrizze a címet majd próbálja újból.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>A tárca feloldása elutasítva</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Üzenet aláírása sikertelen</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Üzenet aláírva</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Ellenőrizze az aláírást majd próbálja újból</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Üzenet megerősítve.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Status</source>\n        <translation>Állapot</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Forrás</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Létrehozott</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Innen:</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ismeretlen</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Ide:</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>saját címek</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>megfigyelés</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>címke</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>nem elfogadott</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Tranzakciós díj</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Nettó összeg</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Üzenet</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Megjegyzés</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Tranzakció azonosító</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Tranzakció teljes mérete</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Kereskedő</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Hibakeresési információk</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Tranzakció</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Összeg</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>igaz</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>hamis</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Típus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Címke</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Nem megerősített</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generált de nem elfogadott</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Küldés neki</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Bányászott</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>megfigyelés</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nincs címke)</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tranzakció típusa.</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Összes</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Ma</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>E héten</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>E hónapban</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Előző hónapban</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Ez évben</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Tartomány...</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Küldés neki</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Bányászott</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Egyéb</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minimum összeg</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Cím másolása</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Címke másolása</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Összeg másolása</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Tranzakció ID másolása</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Címke szerkesztése</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Tranzakció részletei</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Vesszővel elválasztott adatok (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Jóváhagyva</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Csak megtekintés</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Típus</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Címke</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Cím</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Sikertelen export</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Sikeres exportálás</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Érmék küldése</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Növelés:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Új díj:</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Export</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>A jelenlegi fülön található adat exportálása fájlba</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Tárca biztonsági mentése</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Tárca adat (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Biztonsági mentés sikertelen</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Biztonsági mentés sikeres</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Beállítások:</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Parancssoros és JSON-RPC parancsok elfogadása</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Mag</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Hibakeresési/Tesztelési beállítások:</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Szeretnéd újra építeni a blokk adatbázist most?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Hiba a blokk adatbázis inicializálásakor</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Hiba a blokk adatbázis betöltésekor</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Hiba a blokk adatbázis megnyitásakor</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Hiba: Kicsi a lemezterület!</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importálás...</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Blokkok megerősítése...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Tárca hibakeresési/tesztelési beállítások:</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Tárca beállítások:</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Információ</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Összes hibakeresési beállítás mutatása (használat: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Tranzakció aláírása sikertelen</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Ez egy fejlesztés alatt álló szoftver.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>A tranzakció összege túl kicsi</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>A tranzakció túl nagy</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Tárca fejlesztése a legfrissebb formátumra az indításnál</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Felhasználónév a JSON-RPC kapcsolódásokhoz</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Tárca/Tárcák megerősítése</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Figyelmeztetés</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Jelszó a JSON-RPC kapcsolódásokhoz</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s túl magasra van állítva!</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Hiba a tárca betöltésekor %s. Érvénytelen karakterek a tárca fájlnévben.</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Figyelés a JSON-RPC kapcsolatokra itt: &lt;port&gt; (alapértelmezett:  %u vagy tesztnet: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Hálózati szálak indítása...</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>A tranzakciók összege nem lehet negatív</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Legalább egy címzettnek kell lennie a tranzakcióban </translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fedezethiány</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>A blokkindex betöltése ...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Tárca betöltése...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Nem lehet lemásolni a pénztárcát</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Újraszkennelés</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Betöltés kész</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hiba</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_id.ts",
    "content": "<TS language=\"id\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Klik kanan untuk mengubah alamat atau label</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Buat sebuah alamat baru</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Baru</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Salin alamat yang dipilih ke dalam clipboard sistem</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Salin</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Tutup</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Hapus alamat yang dipilih dari daftar</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Ekspor data dalam tab saat ini ke file</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Export</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Hapus</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Pilih alamat untuk mengirim koin kepada</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Pilih alamat untuk menerima koin</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>P&amp;ilih</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Alamat mengirim</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Alamat menerima</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Ini adalah alamat Bitcoin anda untuk mengirim pembayaran. Selalu periksa jumlah dan alamat penerima sebelum mengirim koin</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Ini adalah alamat Bitcoin anda untuk menerima pembayaran. Disarankan untuk menggunakan alamat penerimaan baru untuk setiap transaksi</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Salin Alamat</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copy &amp;Label</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Edit</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Export Daftar Alamat</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>File dipisahkan dengan Comma (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exporting Gagal</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Terjadi kesalahan saat menyimpan daftar alamat %1. Silahkan coba kembali.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tanpa label)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialog passphrase</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Masukan passphrase</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Passphrase baru</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ulangi passphrase baru</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Tampilkan kata sandi</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Masukkan passphrase baru ke dompet.&lt;br/&gt;Harap gunakan passphrase dari &lt;b&gt;sepuluh atau lebih karakter acak&lt;/b&gt;, or &lt;b&gt;delapan atau lebih kata&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Enkripsi wallet</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Tindakan ini memerlukan passphrase untuk membuka wallet anda</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Buka wallet</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Tindakan ini memerlukan passphrase untuk mendekripsi wallet anda</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dekripsi wallet</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Ganti passphrase</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Masukan passphrase lama dan passphrase baru ke wallet</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Konfirmasi proses enkripsi wallet</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Peringatan:  Jika anda mengenkripsi wallet anda dan lupa/hilang passphrase anda, anda akan ‭&lt;b&gt; KEHILANGAN SEMUA BITCOIN ANDA &lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Apa anda yakin ingin mengenkripsi wallet anda?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Wallet terenkripsi</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 akan ditutup sekarang untuk menyelesaikan proses enkripsi. Ingat bahwa mengenkripsi dompet Anda tidak dapat sepenuhnya melindungi bitcoin Anda dari pencurian oleh malware yang menginfeksi komputer Anda.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>PENTING: Semua cadangan sebelumnya yang Anda buat dari file dompet Anda harus diganti dengan file dompet terenkripsi yang baru dibuat. Untuk alasan keamanan, cadangan sebelumnya dari file dompet yang tidak terenkripsi akan menjadi tidak berguna segera setelah Anda mulai menggunakan dompet terenkripsi yang baru.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Enkripsi wallet gagal</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Enkripsi wallet gagal karena kesalahan internal. Wallet anda belum terenkripsi</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Passphrase yang dimasukan tidak cocok.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Gagal membuka wallet</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Passphrase yang dimasukan untuk dekripsi wallet salah</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Gagal mendekripsi wallet</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Passphrase wallet berhasil diganti</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Peringatan: Caps Lock key menyala!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Dibanned hingga</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>&amp;Verifikasi pesan...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sedang sinkronisasi dengan jaringan</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Overview</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Tampilkan gambaran umum dompet</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaksi</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Telusuri history  transaksi</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Keluar</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Tutup aplikasi</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Tentang %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Tunjukan informasi tentang %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Tentang &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Tampilkan informasi tentang Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Pilihan...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Ubah pilihan konfigurasi untuk %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Enkripsi wallet...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Backup wallet</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Ganti Passphrase...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Mengirim alamat</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Menerima alamat...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Buka &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Klik untuk menonaktifkan aktifitas network</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Aktifitas network tidak aktif</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Klik untuk mengaktifkan kembali network</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Kirim koin ke alamat Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Backup wallet ke lokasi lain</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Ganti passphrase yang digunakan untuk enkripsi wallet</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Debug window</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Buka debugging dan diagnostic console</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifikasi pesan...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Wallet</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Kirim</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Terima</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Tampilkan/ Sembunyikan</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Tampilkan atau sembunyikan tampilan utama</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Enkripsi private keys wallet anda</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Tambahkan pesan di alamat Bitcoin untuk membuktikan bahwa anda pemiliknya</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifikasi pesan untuk memastikan bahwa telah ditanda tangani dengan alamat Bitcoin tertentu</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;File</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Pengaturan</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Bantuan</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Toolbar Tabs</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Tampilkan daftar alamat kirim yg telah digunakan dan label</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Peringatan</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informasi</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Terkini</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 client</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Menghubungkan ke peers...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Catching up...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Tanggal: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Jumlah: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipe: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Label: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Alamat: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transaksi terkirim</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transaksi datang</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Pembuatan kunci HD  &lt;b&gt;diaktifkan&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Pembuatan kunci HD &lt;b&gt;dinonaktifkan&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Pemilihan koin</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Jumlah:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Jumlah:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Biaya:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Dust:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Setelah biaya:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Ganti:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(tidak)pilih semua</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Mode pohon</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Mode list</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Jumlah</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Diterima dengan label</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Diterima dengan alamat</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Tanggal</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Konfirmasi</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Telah dikonfirmasi</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Salin alamat</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Salin label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Salin jumla</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Salin ID transaksi</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Kunci yang tidak digunakan</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Buka kunci yang tidak digunakan</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Salin jumlah</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Salin biaya</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Salin setelah biaya</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>salin bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Salin dust</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Salin perubahan</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 terkunci)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>Ya</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>Tidak</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tanpa label)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(ganti)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Ubah Alamat</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Label</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Alamat penerima baru</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Alamat pengirim baru</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Ubah alamat penerima</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Ubah alamat pengieim</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Tidak bisa membuka wallet</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Pembuatan kunci baru gagal.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>nama</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versi</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Tentang %1</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Pemakaian:</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Jumlah</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>Copy label</source>\n        <translation>Salin label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Salin jumla</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Jumlah</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Tanggal</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tanpa label)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Jumlah:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Jumlah:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Biaya:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Setelah biaya:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Ganti:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Dust:</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Salin jumlah</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Salin jumla</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Salin setelah biaya</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>salin bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Salin dust</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Salin perubahan</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tanpa label)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>Tanggal</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Jumlah</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Tanggal</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tanpa label)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>Salin alamat</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Salin label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Salin jumla</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Salin ID transaksi</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>File dipisahkan dengan Comma (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Telah dikonfirmasi</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Tanggal</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exporting gagal</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Export</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Ekspor data dalam tab saat ini ke file</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Information</source>\n        <translation>Informasi</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Peringatan</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_id_ID.ts",
    "content": "<TS language=\"id_ID\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Klik-kanan untuk mengubah alamat atau label</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Buat alamat baru</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Baru</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Salin alamat yang dipilih ke clipboard</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Menyalin</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>T&amp;utup</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Hapus alamat yang sementara dipilih dari daftar</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Ekspor data dalam tab sekarang ke sebuah berkas</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Ekspor</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Hapus</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Pilih alamat untuk mengirim koin</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Piih alamat untuk menerima koin</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Pilih</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Alamat-alamat pengirim</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Alamat-alamat penerima</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Ini adalah alamat- alamat Bitcoin Anda untuk mengirimkan pembayaran. Selalu periksa jumlah dan alamat penerima sebelum mengirimkan koin.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Ini adalah alamat- alamat Bitcoin Anda untuk menerima pembayaran. Dianjurkan untuk menggunakan alamat penerima yang baru setiap melakukan transaksi.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Salin Alamat</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Salin&amp; Label</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Ubah</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Ekspor Daftar Alamat</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>File yang berformat(*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Mengekspor Gagal</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tidak ada label)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialog Kata kunci</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Masukkan kata kunci</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Kata kunci baru</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ulangi kata kunci baru</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Tampilkan password</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Masukan kata sandi baru ke dompet.&lt;br/&gt;Mohon gunakan kata sandi &lt;b&gt;sepuluh karakter acak atau lebih&lt;/b&gt;, atau &lt;b&gt; delapan atau lebih beberapa kata &lt;/​​b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Enkripsi dompet</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Operasi ini memerlukan kata sandi dompet Anda untuk membuka dompet.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Buka dompet</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Operasi ini memerlukan kata sandi dompet Anda untuk mendekripsikan dompet.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dekripsi dompet</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Ganti kata sandi</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Masukkan kata sandi lama dan kata sandi baru ke dompet.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Konfirmasi pengenkripsian dompet</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Peringatan: Jika Anda enkripsi dompet Anda dan lupa kata sandi anda, Anda akan &lt;b&gt;KEHILANGAN SEMUA BITCOIN ANDA&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Apakah Anda yakin ingin enkripsi dompet Anda?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Dompet terenkripsi</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 sekarang akan ditutup untuk menyelesaikan proses enkripsi. Ingatlah bahwa mengenkripsi dompet Anda tidak dapat sepenuhnya melindungi komputer Anda dari pencurian malware yang menginfeksi komputer Anda.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>PENTING: Backup sebelumnya yang Anda buat dari file dompet Anda harus diganti dengan file dompet terenkripsi yang baru dibuat. Demi keamanan, backup file dompet sebelumnya yang tidak dienkripsi sebelumnya akan menjadi tidak berguna begitu Anda mulai menggunakan dompet terenkripsi yang baru.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Pengenkripsian dompet gagal</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Pengenkripsian dompet gagal karena kesalahan internal. Dompet Anda tidak dienkripsi.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Kata sandi yang dimasukkan tidak cocok.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Membuka dompet gagal</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Kata sandi yang dimasukkan untuk dekripsi dompet salah.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Dekripsi dompet gagal</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Kata sandi berhasil diganti.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Peringatan: Tombol Caps Lock aktif!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Di banned sampai</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Pesan &amp;penanda...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sinkronisasi dengan jaringan...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Kilasan</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Tampilkan gambaran umum dompet Anda</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaksi</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Lihat riwayat transaksi</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>K&amp;eluar</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Keluar dari aplikasi</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Tentang%1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Tampilkan informasi perihal %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Mengenai &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Tampilkan informasi mengenai Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Pilihan...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Pengubahan opsi konfigurasi untuk %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Enkripsi Dompet...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Cadangkan Dompet...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Ubah Kata Kunci...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Alamat-alamat untuk mengirim...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Alamat-alamat untuk menerima...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Buka &amp;URI</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Klik untuk menonaktifkan aktivitas jaringan.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Aktivitas jaringan dinonaktifkan.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Klik untuk mengaktifkan aktivitas jaringan lagi.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Menyinkronkan Header (%1%) ...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Mengindex ulang blok di dalam disk...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Kirim koin ke alamat Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Cadangkan dompet ke lokasi lain</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Ubah kata kunci yang digunakan untuk enkripsi dompet</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Jendela Debug</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Buka konsol debug dan diagnosa</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifikasi pesan...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Dompet</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Kirim</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Menerima</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Tampilkan / Sembunyikan</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Tampilkan atau sembunyikan jendela utama</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Enkripsi private key yang dimiliki dompet Anda</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Tanda tangani sebuah pesan menggunakan alamat Bitcoin Anda untuk membuktikan bahwa Anda adalah pemilik alamat tersebut</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifikasi pesan untuk memastikan bahwa pesan tersebut ditanda tangani oleh suatu alamat Bitcoin tertentu</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Berkas</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Pengaturan</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Bantuan</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Baris tab</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Permintaan pembayaran (membuat kode QR dan bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Tampilkan daftar alamat dan label yang terkirim</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Tampilkan daftar alamat dan label yang diterima</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Buka URI bitcoin: atau permintaan pembayaran</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;pilihan Command-line</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n koneksi aktif ke jaringan Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Pengindeksan blok pada disk ...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Memproses blok pada disk ...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n blok dari riwayat transaksi diproses.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>kurang %1</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Blok terakhir yang diterima %1 lalu.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transaksi setelah ini belum akan terlihat.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Terjadi sebuah kesalahan</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Peringatan</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informasi</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Terbaru</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Tampilkan %1 pesan bantuan untuk mendapatkan daftar opsi baris perintah Bitcoin yang memungkinkan</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 klien</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Menghubungkan ke peer...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Menyusul...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Tanggal: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Jumlah: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipe: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Label: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Alamat: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transaksi terkirim</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transaksi diterima</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Pembuatan kunci HD &lt;b&gt;diaktifkan&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Pembuatan kunci HD &lt;b&gt;dinonaktifkan&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Dompet saat ini &lt;b&gt;terenkripsi&lt;/b&gt; dan &lt;b&gt;terbuka&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Dompet saat ini &lt;b&gt;terenkripsi&lt;/b&gt; dan &lt;b&gt;terkunci&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Terjadi Kesalahan Fatal. Bitcoin Tidak Dapat Melanjutkan Dengan Aman Dan Akan Keluar</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Pemilihan Koin</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kuantitas:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Jumlah:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Biaya:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Dust:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Dengan Biaya:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Kembalian:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(Tidak)memilih semua</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Tree mode</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Mode daftar</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Jumlah</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Diterima dengan label</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Diterima dengan alamat</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Tanggal</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Konfirmasi</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Terkonfirmasi</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Salin alamat</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Salin label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Salin Jumlah</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Salain ID Transaksi</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Kunci Yang Tidak Digunakan</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Buka Kunci Yang Tidak Digunakan</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Salin Kuantitas</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Salin biaya</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Salin Setelah Upah</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Salin bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Salin jumlah yang lebih kecil</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Salin Perubahan</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 terkunci)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>Ya</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>Tidak</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Dapat bervariasi +/- %1 satoshi per input.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tidak ada label)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Ubah Alamat</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Label</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Label yang terkait dengan daftar alamat</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Alamat yang terkait dengan daftar alamat. Hanya dapat diubah untuk alamat pengirim.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Alamat</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Alamat penerima baru</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Alamat pengirim baru</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Ubah alamat penerima</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Ubah alamat pengirim</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Alamat yang dimasukkan \"%1\" bukanlah alamat Bitcoin yang valid.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Alamat yang dimasukkan \"%1\" sudah ada di dalam buku alamat.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Tidak dapat membuka dompet.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Pembuatan kunci baru gagal.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Sebuah data direktori baru telah dibuat.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nama</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Direktori masih ada. Tambahlah %1 apabila Anda ingin membuat direktori baru disini.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Sudah ada path, dan itu bukan direktori.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Tidak bisa membuat direktori data disini.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versi</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Tentang %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Pilihan Command-line</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Penggunaan:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>pilihan command-line</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Pilihan UI:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Pilih direktori data saat memulai (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Pilih bahasa, contoh \"id_ID\" (default: system locale)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Start minimized</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Pilih sertifikat root SSL untuk permintaan pembayaran {default: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Tampilkan layar kilat saat memulai (default: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Hapus semua pengaturan pada GUI.</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Selamat Datang</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Selamat Datang di %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Karena ini adalah pertama kalinya program dijalankan, Anda dapat memilih lokasi %1 akan menyimpan data.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Gunakan direktori data default.</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Gunakan direktori pilihan Anda:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Kesalahan: Direktori data \"%1\" tidak dapat dibuat.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Kesalahan</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB ruang kosong tersedia.</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(dari %n GB yang dibutuhkan)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulir</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Waktu blok terakhir</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Buka URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Buka permintaan pembayaran dari URI atau data</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Pilih data permintaan pembayaran</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Pilihan</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Utama</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Ukuran cache &amp;database</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Jumlah script &amp;verification threads</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Alamat IP proxy (cth. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimalisasi aplikasi ketika jendela ditutup. Ketika pilihan ini dipilih, aplikasi akan menutup seluruhnya jika anda memilih Keluar di menu yang tersedia.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL pihak ketika (misalnya sebuah block explorer) yang mumcul dalam tab transaksi sebagai konteks menu. %s dalam URL diganti dengan kode transaksi. URL dipisahkan dengan tanda vertikal |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Pilihan command-line yang aktif menimpa diatas opsi: </translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Kembalikan semua pengaturan ke awal.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Reset Pilihan</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Jaringan</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = leave that many cores free)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>D&amp;ompet</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Ahli</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Perbolehkan fitur &amp;pengaturan koin</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Jika Anda menonaktifkan perubahan saldo untuk transaksi yang belum dikonfirmasi, perubahan dari transaksi tidak dapat dilakukan sampai transaksi memiliki setidaknya satu konfirmasi. Hal ini juga mempengaruhi bagaimana saldo Anda dihitung.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Perubahan saldo untuk transaksi yang belum dikonfirmasi</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Otomatis membuka port client Bitcoin di router. Hanya berjalan apabila router anda mendukung UPnP dan di-enable.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Petakan port dengan &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Hubungkan ke jaringan Bitcoin melalui SOCKS5 proxy.</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>IP Proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port proxy (cth. 9050)</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Jendela</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Hanya tampilkan ikon tray setelah meminilisasi jendela</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Meminilisasi ke tray daripada taskbar</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;eminilisasi saat tutup</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Tampilan</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Bahasa Antarmuka Pengguna:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unit untuk menunjukkan nilai:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Pilihan standar unit yang ingin ditampilkan pada layar aplikasi dan saat mengirim koin.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Ingin menunjukkan cara pengaturan koin atau tidak.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;YA</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Batal</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>standar</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>tidak satupun</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Memastikan reset pilihan</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Restart klien diperlukan untuk mengaktifkan perubahan.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Klien akan dimatikan, apakah anda hendak melanjutkan?</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Terjadi sebuah kesalahan</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Perubahan ini akan memerlukan restart klien</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Alamat proxy yang diisi tidak valid.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulir</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Informasi terlampir mungkin sudah kedaluwarsa. Dompet Anda secara otomatis mensinkronisasi dengan jaringan Bitcoin ketika sebuah hubungan terbentuk, namun proses ini belum selesai.</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Tersedia:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Jumlah yang Anda bisa keluarkan sekarang</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Ditunda</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Jumlah keseluruhan transaksi yang belum dikonfirmasi, dan belum saatnya dihitung sebagai pengeluaran saldo yang telah dibelanjakan.</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Terlalu Muda:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Saldo ditambang yang masih terlalu muda</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Jumlah:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Jumlah saldo Anda sekarang</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Agen Pengguna</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Terkirim</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Nilai</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Masukkan alamat Bitcoin (contoh %1)</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 Jam</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 menit</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>T/S</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 dan %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>tidak diketahui</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>T/S</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versi Klien</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informasi</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Jendela debug</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Umum</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Waktu nyala</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Jaringan</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nama</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Jumlah hubungan</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Rantai blok</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Jumlah blok terkini</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Terkirim</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versi</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Agen Pengguna\n\n</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Layanan</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Waktu blok terakhir</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Buka</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsol</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>Kemacetan &amp;Jaringan </translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Total</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Masuk:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Keluar:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Berkas catatan debug</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Bersihkan konsol</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;jam</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;hari</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;minggu</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;tahun</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Ya</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Tidak</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Tidak diketahui</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Nilai:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Pesan:</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Label opsional untuk mengasosiasikan dengan alamat penerima baru.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Gunakan form ini untuk meminta pembayaran. Semua bidang adalah &lt;b&gt;opsional&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Nilai permintaan opsional. Biarkan ini kosong atau nol bila tidak meminta nilai tertentu.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Hapus informasi dari form.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Hapus</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Riwayat pembayaran yang diminta Anda</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Minta pembayaran</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Menunjukkan permintaan yang dipilih (sama dengan tekan pilihan dua kali)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Menunjukkan</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Menghapus informasi terpilih dari daftar</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Menghapus</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Salin label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Salin Jumlah</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Kode QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Salin &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Salin &amp;Alamat</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Simpan Gambaran...</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Jumlah</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tidak ada label)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Kirim Koin</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Cara Pengaturan Koin</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Masukan...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>Pemilihan otomatis</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Saldo tidak mencukupi!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kuantitas:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Nilai:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Biaya:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Dengan Biaya:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Uang Kembali:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Jiki ini dipilih, tetapi alamat pengembalian uang kosong atau salah, uang kembali akan dikirim ke alamat yang baru dibuat.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Alamat uang kembali yang kustom</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Biaya Transaksi:</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Disarankan</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Kirim ke beberapa penerima sekaligus</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Tambahlah &amp;Penerima</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Hapus informasi dari form.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Dust:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Hapus &amp;Semua</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Konfirmasi aksi pengiriman</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>K&amp;irim</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Salin Kuantitas</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Salin Jumlah</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Salin biaya</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Salin Setelah Upah</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Salin bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Salin dust</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Salin Perubahan</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tidak ada label)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>J&amp;umlah:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Kirim &amp;Ke:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Pilih alamat yang telah digunakan sebelumnya</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Ini adalah pembayaran normal</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+J</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Tempel alamat dari salinan</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+B</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Hapus masukan ini</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Pesan:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Masukkan label untuk alamat ini untuk dimasukan dalam daftar alamat yang pernah digunakan</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Kirim Ke:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Catatan Peringatan:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Kamu tidak dapat mematikan komputer sebelum jendela ini tertutup sendiri.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Tanda Tangan / Verifikasi sebuah Pesan</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Tandakan Pesan</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Pilih alamat yang telah digunakan sebelumnya</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Tempel alamat dari salinan</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+B</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Masukan pesan yang ingin ditandai disini</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Tanda Tangan</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Salin tanda tangan terpilih ke sistem klipboard</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Tandai pesan untuk menyetujui kamu pemiliki alamat Bitcoin ini</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Tandakan &amp;Pesan</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Hapus semua bidang penanda pesan</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Hapus &amp;Semua</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifikasi Pesan</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifikasi &amp;Pesan</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Hapus semua bidang verifikasi pesan</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Amount</source>\n        <translation>Jumlah</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Jendela ini menampilkan deskripsi rinci dari transaksi tersebut</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tidak ada label)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>Salin alamat</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Salin label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Salin Jumlah</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Salain ID Transaksi</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Berkas yang berformat(*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Mengekspor Gagal</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Pilihan:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Tentukan direktori data</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Hubungkan ke node untuk menerima alamat peer, dan putuskan</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Tentukan alamat publik Anda sendiri</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Menerima perintah baris perintah dan JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Berjalan dibelakang sebagai daemin dan menerima perintah</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Jalankan perintah ketika perubahan transaksi dompet (%s di cmd digantikan oleh TxID)</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Terima hubungan dari luar (standar: 1 kalau -proxy atau -connect tidak dipilih)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Pilihan pembuatan blok:</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Pilih koneksi:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Menemukan database blok yang rusak </translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Jangan memuat dompet dan menonaktifkan panggilan dompet RPC</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Apakah Anda ingin coba membangun kembali database blok sekarang?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Kesalahan menginisialisasi database blok</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Kesalahan menginisialisasi dompet pada database%s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Gagal memuat database blok</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Menemukan masalah membukakan database blok</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Gagal: Hard disk hampir terisi!</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>mengimpor...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Tidak bisa cari blok pertama, atau blok pertama salah. Salah direktori untuk jaringan?</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Deskripsi berkas tidak tersedia dengan cukup.</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Tentukan arsip dompet (dalam direktori data)</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Blok-blok sedang diverifikasi...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opsi dompet:</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Hubungkan melalui proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informasi</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opsi server RPC:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Kirim info jejak/debug ke konsol bukan berkas debug.log</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Mengecilkan berkas debug.log saat klien berjalan  (Standar: 1 jika tidak -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Tandatangani transaksi tergagal</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Nilai transaksi terlalu kecil</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transaksi terlalu besar</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nama pengguna untuk hubungan JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Peringatan</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Setiap transaksi dalam dompet sedang di-'Zap'...</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Kata sandi untuk hubungan JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Menjalankan perintah ketika perubahan blok terbaik (%s dalam cmd digantikan oleh hash blok)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Izinkan peninjauan DNS untuk -addnote, -seednode dan -connect</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Jaringan tidak diketahui yang ditentukan dalam -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Saldo tidak mencukupi</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Memuat indeks blok...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Memuat dompet...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Tidak dapat menurunkan versi dompet</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Memindai ulang...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Memuat selesai</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Gagal</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_is.ts",
    "content": "<TS language=\"is\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Smelltu á hægri músatakka til að breyta færslugildi eða merkingu</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Búa til nýtt færslugildi</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nýtt</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Afrita valið færslugildi í klemmuspjald</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Afrita</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Loka</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Eyða völdu færslugildi úr listanum</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Flytja gögn í flipanum í skrá</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Flytja út</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Eyða</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Veldu færslugildi sem greiða skal til</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Veldu færslugildi sem á að taka við mynt</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Veldu</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Færslugildi sem senda frá sér</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Færslugildi sem þiggja til sín</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Þetta eru Bitcoin færslugildin sem senda greiðslur. Skoðið ævinlega vel upphæðina og færslugildin sem þiggja greiðslur áður en mynt er send.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Þetta eru Bitcoin færslugildin sem þiggja greiðslur. Mælt er með að nota aldrei sama færslugildið til að þiggja fleiri en eina greiðslu.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Afrita færslugildi</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Afrita og &amp;Merkja</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Breyta</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Flytja út færslulista</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Gildi aðskilin með kommu (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Útflutningur tókst ekki</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Ekki tókst að vista færslugildalistann á %1. Reyndu aftur.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Merking</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Færslugildi</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(engin merking)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Lykilsetning</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Skráðu lykilsetningu</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Ný lykilsetning</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Endurtaktu nýja lykilsetningu</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Skráðu nýju lykilsetninguna í veskið. &lt;br/&gt;Vinsamlegast notaðu lykilsetningu með &lt;b&gt;tíu eða fleiri slembibókstöfum&lt;/b&gt;, eða &lt;b&gt;átta eða fleiri orðum&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Dulkóða veski</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Þessi aðgerð þarf að fá lykilsetninguna þína til að opna veskið.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Opna veskið</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Þessi aðgerð þarf lykilsetninguna þína til að dulráða veskið.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dulráða veskið</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Breyta lykilsetningu</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Skráðu gömlu lykilsetninguna og þá nýju í veskið.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Staðfesta dulkóðun veskis</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Viðvörun: Ef þú dulkóðar veskið og týnir lykilsetningunn þá munt þú &lt;b&gt;TAPA ALLRI ÞINNI BITCOIN MYNT&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Ertu viss um að þú viljir dulkóða veskið þitt?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Veski dulkóðað</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 lokast núna til að dulkóðun klárist. Mundu að dulkóðun veskis kemur ekki að fullu í veg fyrir að mynt verði stolið úr tölvunni þinni með aðstoð smitforrita. </translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>MIKILVÆGT: Nýja dulkóðaða veskisskráin þarf að koma í staðinn fyrir öll fyrri afrit sem þú hefur gert af upprunalegu veskisskránni. Af öryggisástæðum munu öll fyrri afrit af ódulkóðaða veskinu verða óvirk um leið og þú byrjar að nota nýja, dulkóðaða veskið.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Dulkóðun veskis mistókst</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Dulkóðun veskis mistóks vegna innri villu. Veskið þitt var ekki dulkóðað.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Lykilsetningarnar eru ekki þær sömu.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Ekki tókst að opna veskið</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Lykilsetningin sem notuð var til að dulráða veskið var ekki rétt.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Ekki tókst að dulráða veski</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Það tókst að breyta lykilsetningu veskis.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Viðvörun: Kveikt er á HÁSTÖFUM!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netgríma</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Bannað til</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Undirrita &amp;skilaboð</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Samstilli við netið...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Yfirlit</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Hnútur</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Sýna almennt yfirlit af veski</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Færslur</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Skoða færslusögu</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Hætta</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Hætta í forriti</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Um %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Sýna upplýsingar um %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Um &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Sýna upplýsingar um Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Valkostir...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Breyta samstillingum fyrir %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Dulkóða veski...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Öryggisafrit á veski...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Breyta lykilsetningu</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Sendi færslugildi...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Tek við færslugildum...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Opna &amp;URL...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Smelltu til að loka fyrir netumferð.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Slökkt á netumferð.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Smelltu til að hefja aftur netumferð.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Samstilli hausa (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Endurraða blokkum á drifi...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Senda mynt í Bitcoin færslugildi</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Öryggisafrita veski á annan stað</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Breyta lykilsetningunni sem gildir um dulkóðun veskis</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Kembunargluggi</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Opna kembunar- og greiningarstjórnborð</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Yfirfara skilaboð...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Veski</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Senda</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Taka við</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Sýna / Fela</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Sýna eða fela megin glugga</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Dulkóða einkalyklana sem tilheyra veskinu þínu</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Kvitta undir skilaboð með Bitcoin færslugildunum þínum til að sanna að þú eigir þau</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Yfirfara skilaboð til að tryggja að kvittað hafi verið fyrir þau með tilteknum Bitcoin færslugildum</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Skrá</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Stillingar</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Hjálp</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Tólaborð flipa</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Óska eftir greiðslum (býr til QR kóða og bitcoin: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Sýna lista yfir færslugildi sem notuð hafa verið til sendingar og merkingar þeirra</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Sýna færslugildi sem notuð hafa verið til að taka við mynt og merkingar þeirra</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Opna bitcoin: URI eða greiðslubeiðni</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Raða blokkum á drifi</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Vinn úr blokkum á drifi...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 á eftir</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Síðasta viðtekna blokk var búin til fyrir %1 síðan.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Færslur á eftir þessari munu ekki sjást.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Villa</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Viðvörun</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Upplýsingar</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Uppfært</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Sýna %1 hjálparskilaboðin til að fá lista yfir valkosti Bitcoin aðgerðir í skipanalínu</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 biðlarar</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Tengist jafningjum...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Færist nær...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Dagsetning: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Upphæð: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tegund: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Merki: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Færslugildi: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Send færsla</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Móttökufærsla</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD lyklagerð er &lt;b&gt;virkjuð&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD lyklagerð er &lt;b&gt;óvirk&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Veskið er &lt;b&gt;dulkóðað&lt;/b&gt; og núna &lt;b&gt;ólæst&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Veskið er &lt;b&gt;dulkóðað&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Alvarleg villa átti sér stað. Bitcoin getur ekki haldið áfram með öruggum hætti og stoppar hér.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Myntval</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Magn:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bæti:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Upphæð:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Gjald:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Ryk:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Eftirgjald:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Skiptimynt:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(af)velja allt</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Hrísluhamur</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Listahamur</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Upphæð</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Móttekið með merkingu</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Móttekið með færslugildi</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Afrita færslugildi</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Afrita merki</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Þetta merki verður rautt ef einhver viðtakandi tekur við upphæð sem er lægri en núgildandi þröskuldur.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ekkert merki)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Breyta færslugildi</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Merki</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Merking tengd þessu færslugildi</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Færslugildið sem tengt er þessari færslu. Þessu má einungis breyta þegar sent er.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>Nýtt móttökufærslugildi</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nýtt móttökufærslugildi</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nýtt sendingarfærslugildi</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Breyta móttökufærslugildi</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Breyta sendingarfærslugildi</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Færslugildið sem slegið var inn \"%1\" er ekki leyfilegt Bitcoin færslugildi.</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Villa</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Fjöldi blokka sem eftir eru</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Tími síðustu blokkar</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP tala staðgengils (t.d. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL frá þriðja aðila (t.d. blokkarskoðari) sem birtast í færsluflipanum sem samhengisatriði. %s í URL-inu skipt út fyrir færslutvíkross. Mörg URL eru aðskilin með lóðréttu striki |.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Villa</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Uppgefið færslugildi staðgengils er ógilt.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Námuunnin innistæða sem hefur enn ekki komið fram</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Innistæða færslugilda sem eru einungis til skoðunar</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Óstaðfestar færslur til færslugilda sem eru einungis til skoðunar</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Námuunnin innistæða á færslugildum sem eru einungis til skoðunar og hafa ekki komið fram</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Innistæða á færslugildum sem eru einungis til skoðunar</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Ógilt færslugildi til greiðslu %1</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Upphæð</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>Block chain</source>\n        <translation>Blokkarkeðja</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Núverandi fjöldi blokka</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Upphafsblokk</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Samhæfðar blokkir</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Tími síðustu blokkar</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Merki:</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Valfrjálst merki sem tengist nýju móttökufærslutölunni.</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Afrita merki</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Vistfang</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Upphæð</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Merki</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI varð of langt, reyndu að minnka texta í merki / skilaboðum.</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Merki</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ekkert merki)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Magn:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bæti:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Upphæð:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Gjald:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Eftirgjald:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Skiptimynt:</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Það er í lagi að greiða einungis lágmarksupphæðina svo framarlega sem færslurúmtakið er minna en plássið í blokkunum. En gætið þess að þegar það er meiri eftirspurn eftir bitcoin færslum en netið getur unnið úr þá gæti svo farið að færslurnar verða aldrei samþykktar.</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Smart gjald er ekki gangsett ennþá. Þetta tekur venjulega nokkrar blokkir...)</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Ryk:</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ekkert merki)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Merki:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Fullgerð mynt verður að nýta %1 blokkir. Þegar þú bjóst til þessa blokk, þá var jafnóðum tilkynnt á netinu að hún eigi að bætast við blokkakeðjuna. Ef hún kemst ekki í keðjuna þá mun staða hennar breytast í \"ósamþykkt\" og ekki verður hægt að nota hana. Þetta gerist annað slagið ef annar hnútpunktur klárar blokk nokkrum sekúndum á undan þinni.</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Upphæð</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Merki</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Þessi blokk barst ekki í neinn annan hnútpunkt og verður sennilega ekki samþykkt!</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Námuunnið</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ekkert merki)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Mined</source>\n        <translation>Námuunnið</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Afrita færslugildi</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Afrita merki</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Gildi aðskilin með kommu (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Merki</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Vistfang</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Útflutningur tókst ekki</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Flytja út</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Flytja gögn í flipanum í skrá</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Villa við lestur %s! Allir lyklar fóru inn á réttan hátt, en færslugögn eða færslugildi gætu verið röng eða horfin.</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Viðvörun: Netið er ekki í fullu samræmi! Einhver námuvinnsla virðist í ólagi.</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Hámarks gagnastærð í burðarfærslum sem við tökum við til námavinnslu (sjálfgefið: %u)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Upplýsingar</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Viðvörun</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Viðvörun: Óþekkt blokkarútgáfa í námavinnslu! Það er mögulegt að óþekktum reglum sé fylgt</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Hleypa í gegn og námuvinna gagnaburðarfærslur (sjálfgefið: %u)</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Villa</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_it.ts",
    "content": "<TS language=\"it\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Fai clic con il tasto destro del mouse per modificare l'indirizzo o l'etichetta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crea un nuovo indirizzo</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nuovo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copia negli appunti l'indirizzo attualmente selezionato</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copia</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;hiudi</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Rimuovi dalla lista l'indirizzo attualmente selezionato</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Esporta su file i dati contenuti nella tabella corrente</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Esporta</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Elimina</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Scegli l'indirizzo a cui inviare bitcoin</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Scegli l'indirizzo con cui ricevere bitcoin</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Sc&amp;egli</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Indirizzi d'invio</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Indirizzi di ricezione</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Questi sono i tuoi indirizzi Bitcoin per l'invio di pagamenti. Controlla sempre l'importo e l'indirizzo del beneficiario prima di inviare bitcoin.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Questi sono i tuoi indirizzi Bitcoin per la ricezione di pagamenti. Si raccomanda di usare un nuovo indirizzo di ricezione per ogni transazione.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copia indirizzo</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copia &amp;etichetta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Modifica</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Esporta elenco indirizzi</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Testo CSV (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Esportazione fallita</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Si è verificato un errore nel salvare l'elenco degli indirizzi su %1. Provare di nuovo.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etichetta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Indirizzo</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nessuna etichetta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Finestra passphrase</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Inserisci la passphrase</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nuova passphrase</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ripeti la nuova passphrase</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Mostra password</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Inserire la nuova passphrase per il portafoglio.&lt;br/&gt;Si consiglia di utilizzare una passphrase di &lt;b&gt;almeno dieci caratteri casuali&lt;/b&gt; oppure &lt;b&gt;otto o più parole&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Cifra il portafoglio</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Questa operazione necessita della passphrase per sbloccare il portafoglio.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Sblocca il portafoglio</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Questa operazione necessita della passphrase per decifrare il portafoglio.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Decifra il portafoglio</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Cambia la passphrase</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Inserisci la vecchia e la nuova passphrase per il portafoglio.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Conferma la cifratura del portafoglio</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Attenzione: perdendo la passphrase di un portamonete cifrato &lt;b&gt;TUTTI I PROPRI BITCOIN ANDRANNO PERSI&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Cifrare veramente il portafoglio?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Portafoglio cifrato</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 verrà chiuso per completare il processo di cifratura. Ricorda che cifrare il tuo portafoglio non può proteggerlo contro potenziali furti di malware che potrebbero aver infettato il tuo computer.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANTE: qualsiasi backup del portafoglio effettuato in precedenza dovrà essere sostituito con il file del portamonete cifrato appena generato. Per ragioni di sicurezza, i precedenti backup del file del portafoglio non cifrato diventeranno inservibili non appena si inizierà ad utilizzare il nuovo portafoglio cifrato.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Cifratura portafoglio fallita</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>La cifratura del portafoglio non è riuscita a causa di un errore interno. Il portafoglio personale non è stato cifrato.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Le passphrase fornite non corrispondono.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Sbloccaggio del portafoglio fallito</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La passphrase inserita per decifrare il tuo portafoglio non è corretta.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Decrittazione del portafoglio fallita.</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>La modifica della passphrase del portafoglio è riuscita.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Attenzione: è attivo il tasto blocco maiuscole !</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Bannato fino a</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Firma &amp;messaggio...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizzazione con la rete in corso...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Sintesi</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nodo</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostra lo stato generale del portamonete</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transazioni</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Mostra la cronologia delle transazioni</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Esci</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Chiudi applicazione</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Informazioni su %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Mostra informazioni su %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Informazioni su &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostra le informazioni su Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opzioni...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modifica le opzioni di configurazione per %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Cifra portafoglio...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Backup portafoglio...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Cambia passphrase...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Indirizzi di invio...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Indirizzi di &amp;ricezione...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Apri &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Clicca per disattivare la rete.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Attività di rete disabilitata</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Clicca per abilitare nuovamente l'attività di rete</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Sincronizzazione Headers (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Re-indicizzazione blocchi su disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Invia fondi ad un indirizzo Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Effettua il backup del portamonete</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambia la passphrase utilizzata per la cifratura del portamonete</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Finestra di &amp;debug</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Apri la console di debugging e diagnostica</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifica messaggio...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Portafoglio</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Invia</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Ricevi</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Mostra / Nascondi</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostra o nascondi la Finestra principale</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Cifra le chiavi private che appartengono al tuo portamonete</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Firma messaggi con i tuoi indirizzi Bitcoin per dimostrarne il possesso</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifica che i messaggi siano stati firmati con gli indirizzi Bitcoin specificati</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;File</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Impostazioni</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Aiuto</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra degli strumenti</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Richiedi pagamenti (genera codici QR e bitcoin: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostra la lista degli indirizzi di invio utilizzati</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Mostra la lista degli indirizzi di ricezione utilizzati</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Apri un bitcoin: URI o una richiesta di pagamento</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opzioni della riga di &amp;comando</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n connessione attiva alla rete Bitcoin</numerusform><numerusform>%n connessioni alla rete Bitcoin attive</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indicizzando i blocchi su disco...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Elaborazione dei blocchi su disco...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Elaborato %n blocco dello storico transazioni.</numerusform><numerusform>Elaborati %n blocchi dello storico transazioni.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>Indietro di %1</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>L'ultimo blocco ricevuto è stato generato %1 fa.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Le transazioni effettuate successivamente non sono ancora visibili.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Errore</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Attenzione</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informazioni</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Aggiornato</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Mostra il messaggio di aiuto di %1 per ottenere una lista di opzioni di comando per Bitcoin </translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 client</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Connessione ai peers</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>In aggiornamento...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Quantità: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipo: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etichetta: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Indirizzo: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transazione inviata</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transazione ricevuta</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>La creazione della chiave HD è &lt;b&gt;abilitata&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>La creazione della chiave HD è &lt;b&gt;disabilitata&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Il portamonete è &lt;b&gt;cifrato&lt;/b&gt; ed attualmente &lt;b&gt;sbloccato&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Il portamonete è &lt;b&gt;cifrato&lt;/b&gt; ed attualmente &lt;b&gt;bloccato&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Si è verificato un errore critico. Bitcoin non può più funzionare in maniera sicura e verrà chiuso.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selezione coin</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantità:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Byte:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Importo:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Commissione:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Trascurabile:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Dopo Commissione:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Resto:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(de)seleziona tutto</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modalità Albero</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modalità Lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Importo</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Ricevuto con l'etichetta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Ricevuto con l'indirizzo</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Conferme</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confermato</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copia indirizzo</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia etichetta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'importo</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copia l'ID transazione</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Bloccare non spesi</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Sbloccare non spesi</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copia quantità</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copia commissione</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copia dopo commissione</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copia byte</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copia trascurabile</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copia resto</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 bloccato)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>sì</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Questa etichetta diventerà rossa se uno qualsiasi dei destinatari riceverà un importo inferiore alla corrente soglia minima per la movimentazione della valuta.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Può variare di +/- %1 satoshi per input.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nessuna etichetta)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>cambio da %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(resto)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Modifica l'indirizzo</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etichetta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>L'etichetta associata con questa voce della lista degli indirizzi</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>L'indirizzo associato con questa voce della lista degli indirizzi. Può essere modificato solo per gli indirizzi d'invio.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Indirizzo</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nuovo indirizzo di ricezione</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nuovo indirizzo d'invio</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Modifica indirizzo di ricezione</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Modifica indirizzo d'invio</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>L'indirizzo inserito \"%1\" non è un indirizzo bitcoin valido.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>L'indirizzo inserito \"%1\" è già in rubrica.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Impossibile sbloccare il portamonete.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Generazione della nuova chiave non riuscita.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Sarà creata una nuova cartella dati.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nome</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Cartella già esistente. Aggiungi %1 se intendi creare qui una nuova cartella.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Il percorso è già esistente e non è una cartella.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Impossibile creare una cartella dati qui.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versione</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Informazioni %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opzioni della riga di comando</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Utilizzo:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opzioni della riga di comando</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opzioni interfaccia:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Seleziona la directory dei dati all'avvio (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Imposta la lingua, ad esempio \"it_IT\" (default: locale di sistema)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Avvia ridotto a icona</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Imposta un certificato SSL root per le richieste di pagamento (default: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Mostra schermata iniziale all'avvio (default: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Reimposta tutti i campi dell'interfaccia grafica</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Benvenuto</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Benvenuto su %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Dato che questa è la prima volta che il programma viene lanciato, puoi scegliere dove %1 salverà i suoi dati.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Quando fai click su OK, %1 comincerà a scaricare e processare l'intera %4 block chain (%2GB) a partire dalla prime transazioni del %3 quando %4 venne inaugurato.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>La sincronizzazione iniziale è molto dispendiosa e potrebbe mettere in luce problemi di harware del tuo computer che erano prima passati inosservati. Ogni volta che lanci %1 continuerà a scaricare da dove l'avevi lasciato.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Se hai scelto di limitare l'immagazzinamento della block chain (operazione nota come \"pruning\" o \"potatura\"), i dati storici devono comunque essere scaricati e processati, ma verranno cancellati in seguito per mantenere basso l'utilizzo del tuo disco.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Usa la cartella dati predefinita</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Usa una cartella dati personalizzata:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Almeno %1 GB di dati verrà salvato in questa cartella e continuerà ad aumentare col tempo.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Verranno salvati circa %1 GB di dati in questa cartella.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 scaricherà e salverà una copia della block chain di Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Anche il portafoglio verrà salvato in questa cartella.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Errore: La cartella dati \"%1\" specificata non può essere creata.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Errore</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>GB di spazio libero disponibile</numerusform><numerusform>%n GB di spazio disponibile</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(di %nGB richiesti)</numerusform><numerusform>(%n GB richiesti)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Modulo</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Transazioni recenti potrebbero non essere visibili ancora, perciò il saldo del tuo portafoglio potrebbe non essere corretto. Questa informazione risulterà corretta quando il tuo portafoglio avrà terminato la sincronizzazione con la rete bitcoin, come indicato in dettaglio più sotto.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Il tentativo di spendere bitcoin legati a transazioni non ancora visualizzate non verrà accettato dalla rete.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Numero di blocchi mancanti</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Sconosciuto...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Ora del blocco più recente</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progresso</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Aumento dei progressi per ogni ora</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>calcolando...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Tempo stimato al completamento della sincronizzazione</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Nascondi</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Sconosciuto. Sincronizzazione Headers (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Apri URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Apri richiesta di pagamento da URI o file</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Seleziona il file di richiesta di pagamento</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Seleziona il file di richiesta di pagamento da aprire</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opzioni</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principale</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Avvia automaticamente %1 una volta effettuato l'accesso al sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Start %1 all'accesso al sistema</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Dimensione della cache del &amp;database.</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Numero di thread di &amp;verifica degli script </translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Indirizzo IP del proxy (ad es. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Mostra se il proxy SOCK5 di default che p stato fornito è usato per raggiungere i contatti attraverso questo tipo di rete.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Usa una SOCKS&amp;5 proxy differente per raggiungere peers usando servizi Tor hidden</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Nascondi l'icona nella barra delle applicazioni.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Nascondi l'icona della barra delle applicazioni</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Riduci ad icona invece di uscire dall'applicazione quando la finestra viene chiusa. Attivando questa opzione l'applicazione terminerà solo dopo aver selezionato Esci dal menu File.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL di terze parti (ad es. un block explorer) che appaiono nella tabella delle transazioni come voci nel menu contestuale. \"%s\" nell'URL è sostituito dall'hash della transazione.\nPer specificare più URL separarli con una barra verticale \"|\".</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Opzioni della riga di comando attive che sostituiscono i settaggi sopra elencati:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Apri il %1 file di configurazione dalla cartella attiva.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Apri il file di configurazione</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Reimposta tutte le opzioni del client allo stato predefinito.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Ripristina Opzioni</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>Rete</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automatico, &lt;0 = lascia questo numero di core liberi)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Port&amp;amonete</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Esperti</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Abilita le funzionalità di coin &amp;control</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Disabilitando l'uso di resti non confermati, il resto di una transazione non potrà essere speso fino a quando non avrà ottenuto almeno una conferma. Questa impostazione influisce inoltre sul calcolo del saldo.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Spendi resti non confermati</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Apri automaticamente la porta del client Bitcoin sul router. Il protocollo UPnP deve essere supportato da parte del router ed attivo.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mappa le porte tramite &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Accetta connessione esterne.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Accetta connessioni in entrata</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Connessione alla rete Bitcoin attraverso un proxy SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Connessione attraverso proxy SOCKS5 (proxy predefinito):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP del proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Porta:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Porta del proxy (ad es. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Utilizzata per connettersi attraverso:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Connette alla rete Bitcoin attraverso un proxy SOCKS5 separato per Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Finestra</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Mostra solo nella tray bar quando si riduce ad icona.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimizza nella tray bar invece che sulla barra delle applicazioni</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimizza alla chiusura</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Mostra</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Lingua Interfaccia Utente:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>La lingua dell'interfaccia utente può essere impostata qui. L'impostazione avrà effetto dopo il riavvio %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unità di misura con cui visualizzare gli importi:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Scegli l'unità di suddivisione predefinita da utilizzare per l'interfaccia e per l'invio di bitcoin.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Specifica se le funzionalita di coin control saranno visualizzate.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;URLs per transazioni terzi </translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancella</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>predefinito</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>nessuno</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Conferma ripristino opzioni</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>È necessario un riavvio del client per applicare le modifiche.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Il client sarà arrestato. Si desidera procedere?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opzioni di configurazione</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Il file di configurazione è utilizzato per specificare opzioni utente avanzate che aggirano le impostazioni della GUI. Inoltre qualunque opzione da linea di comando aggirerà il file di configurazione.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Errore</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Il file di configurazione non può essere aperto.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Questa modifica richiede un riavvio del client.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>L'indirizzo proxy che hai fornito non è valido.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Modulo</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Le informazioni visualizzate potrebbero non essere aggiornate. Il portamonete si sincronizza automaticamente con la rete Bitcoin una volta stabilita una connessione, ma questo processo non è ancora stato completato.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Sola lettura:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponibile:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Il tuo saldo spendibile attuale</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>In attesa:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Totale delle transazioni in corso di conferma e che non sono ancora conteggiate nel saldo spendibile</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Immaturo:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Importo generato dal mining e non ancora maturato</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldo</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Totale:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Il tuo saldo totale attuale</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Il tuo saldo attuale negli indirizzi di sola lettura</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Spendibile:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transazioni recenti</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Transazioni non confermate su indirizzi di sola lettura</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Importo generato dal mining su indirizzi di sola lettura e non ancora maturato</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Saldo corrente totale negli indirizzi di sola lettura</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Errore di richiesta di pagamento</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Impossibile avviare bitcoin: gestore click-to-pay</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Gestione URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>URL di recupero della Richiesta di pagamento non valido: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Indirizzo di pagamento non valido %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>Impossibile interpretare l'URI! I parametri dell'URI o l'indirizzo Bitcoin potrebbero non essere corretti.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Gestione del file di richiesta del pagamento</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Impossibile leggere il file della richiesta di pagamento! Il file della richiesta di pagamento potrebbe non essere valido</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Richiesta di pagamento respinta</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>La rete della richiesta di pagamento non corrisponde alla rete del client.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Richiesta di pagamento scaduta.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>La richiesta di pagamento non è stata inizializzata.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Le richieste di pagamento non verificate verso script di pagamento personalizzati non sono supportate.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Richiesta di pagamento invalida</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>L'importo di pagamento di %1 richiesto è troppo basso (considerato come trascurabile).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Rimborso da %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>La richiesta di pagamento %1 è troppo grande (%2 bytes, consentiti %3 bytes)</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Errore di comunicazione con %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>La richiesta di pagamento non può essere processata!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation> Risposta errata da parte del server %1 </translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation> Errore di richiesta di rete</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Pagamento riconosciuto</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nodo/Servizio</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Nodeld</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Inviato</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Ricevuto</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Importo</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Inserisci un indirizzo Bitcoin (ad es. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Nessuno</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n secondo</numerusform><numerusform>%n secondi</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minuto</numerusform><numerusform>%n minuti</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n ora</numerusform><numerusform>%n ore</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n giorno</numerusform><numerusform>%n giorni</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n settimana</numerusform><numerusform>%n settimane</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 e %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n anno</numerusform><numerusform>%n anni</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 non è ancora stato chiuso in modo sicuro</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>sconosciuto</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Errore: La cartella dati \"%1\" specificata non esiste.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Errore: impossibile interpretare il file di configurazione: %1. Usare esclusivamente la sintassi chiave=valore.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Errore: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Salva immagine</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copia immagine</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Salva codice QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Immagine PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versione client</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informazioni</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Finestra di debug</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Generale</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Versione BerkeleyDB in uso</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Ora di avvio</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Rete</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nome</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Numero di connessioni</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Block chain</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Numero attuale di blocchi</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Memory Pool</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Numero attuale di transazioni</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Utilizzo memoria</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Ripristina</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Ricevuto</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Inviato</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Peer</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Peers bannati</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Seleziona un peer per visualizzare informazioni più dettagliate.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Whitelisted/sicuri</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direzione</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versione</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Blocco di partenza</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Headers sincronizzati</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Blocchi sincronizzati</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Apri il file log del debug di %1 dalla cartella dati attuale. Può richiedere alcuni secondi per file di log di grandi dimensioni.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Riduci dimensioni font.</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Aumenta dimensioni font</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Servizi</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Punteggio di Ban</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Tempo di Connessione</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Ultimo Invio</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Ultima Ricezione</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Tempo di Ping</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>La durata di un ping attualmente in corso.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Attesa ping</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Ping Minimo</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Scarto Temporale</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Ora del blocco più recente</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Apri</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Console</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Traffico di Rete</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totali</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Entrata:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Uscita:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>File log del Debug</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Cancella console</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;ora</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;giorno</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;settimana</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;anno</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Disconnetti</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Bannato per</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Elimina Ban</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Benvenuto nella console RPC di %1.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Usa le flecce su e giú per navigare nella storia, e %1 per pulire lo schermo</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Digita %1 per una descrizione di comandi disponibili</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Per maggiori informazioni su come usare questa console digita %1</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>ATTENZIONE: I truffatori sono stati attivi in quest'area, cercando di convincere gli utenti a digitare linee di comando e rubando i contenuti dei loro portafogli. Non usare questa console senza la piena consapevolezza delle ramificazioni di un comando.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Attività di rete disabilitata</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(id nodo: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>mai</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>In entrata</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>In uscita</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Si</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>No</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Sconosciuto</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Importo:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etichetta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Messaggio:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Un messaggio opzionale da allegare e mostrare all'apertura della richiesta di pagamento. Nota: Il messaggio non sarà inviato con il pagamento sulla rete Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Un'etichetta opzionale da associare al nuovo indirizzo di ricezione.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Usa questo modulo per richiedere pagamenti. Tutti i campi sono &lt;b&gt;opzionali&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Un importo opzionale da associare alla richiesta. Lasciare vuoto o a zero per non richiedere un importo specifico.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Cancellare tutti i campi del modulo.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Cancella</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Cronologia pagamenti richiesti</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Richiedi pagamento</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Mostra la richiesta selezionata (produce lo stesso effetto di un doppio click su una voce)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostra</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Rimuovi le voci selezionate dalla lista</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Rimuovi</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copia URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia etichetta</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copia il messaggio</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'importo</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Codice QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copia &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copia &amp;Indirizzo</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Salva Immagine...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Richiesta di pagamento a %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informazioni di pagamento</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Indirizzo</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Importo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Messaggio</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation> L'URI risultante è troppo lungo, prova a ridurre il testo nell'etichetta / messaggio.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation> Errore nella codifica dell'URI nel codice QR.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Messaggio</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nessuna etichetta)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(nessun messaggio)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(nessun importo richiesto)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Richiesto</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Invia Bitcoin</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Funzionalità di Coin Control</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Input...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>selezionato automaticamente</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fondi insufficienti!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantità:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Byte:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Importo:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Commissione:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Dopo Commissione:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Resto:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>In caso di abilitazione con indirizzo vuoto o non valido, il resto sarà inviato ad un nuovo indirizzo generato appositamente.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Personalizza indirizzo di resto</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Commissione di Transazione:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Scegli...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>L'utilizzo della fallback fee può risultare nell'invio di una transazione che impiegherà diverse ore o giorni per essere confermata (e potrebbe non esserlo mai). Prendi in considerazione di scegliere la tua commissione manualmente o aspetta fino ad aver validato l'intera catena.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Attenzione: il calcolo delle commissioni non è attualmente disponibile.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>minimizza le impostazioni di commissione</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Se la commissione personalizzata è impostata su 1000 satoshi e la transazione è di soli 250 byte, allora \"per kilobyte\" paga solo 250 satoshi di commissione, mentre \"somma almeno\" paga 1000 satoshi. Per transazioni più grandi di un kilobyte, entrambe le opzioni pagano al kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Nascondi</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Non vi è alcuna controindicazione a pagare la commissione minima, a patto che il volume delle transazioni sia inferiore allo spazio disponibile nei blocchi. Occorre comunque essere consapevoli che ciò potrebbe impedire la conferma delle transazioni nel caso in cui la rete risultasse satura.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(leggi il suggerimento)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Raccomandata:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Personalizzata:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Commissione intelligente non ancora inizializzata. Normalmente richiede un'attesa di alcuni blocchi...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Invia simultaneamente a più beneficiari</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;Aggiungi beneficiario</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Cancellare tutti i campi del modulo.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Trascurabile:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Obiettivo del tempo di conferma:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Attiva Replace-By-Fee</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Con Replace-By-Fee (BIP-125) si puo' aumentare la commissione sulla transazione dopo averla inviata. Senza questa, una commissione piu' alta e' consigliabile per compensare l'aumento del rischio dovuto al ritardo della transazione.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Cancella &amp;tutto</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Conferma l'azione di invio</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Invia</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copia quantità</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'importo</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copia commissione</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copia dopo commissione</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copia byte</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copia trascurabile</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copia resto</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blocchi)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 a %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation> Sei sicuro di voler inviare?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation> Includi il costo della transazione</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Importo Totale %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>o</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Si puo' aumentare la commissione successivamente (segnalando Replace-By-Fee, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Senza segnalare Replace-By-Fee, BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Conferma invio coins</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation> L'indirizzo del destinatario non è valido. Si prega di ricontrollare.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation> L'importo da pagare deve essere maggiore di 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Non hai abbastanza fondi</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation> Il totale è superiore al tuo saldo attuale includendo la commissione di %1. </translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation> Rilevato un indirizzo duplicato Ciascun indirizzo dovrebbe essere utilizzato una sola volta.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Creazione della transazione fallita!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>La transazione è stata respinta per il seguente motivo: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation> Una commissione maggiore di %1 è considerata irragionevolmente elevata.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Richiesta di pagamento scaduta.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation> Paga solamente la commissione richiesta di %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Inizio delle conferme stimato entro %n blocchi.</numerusform><numerusform>Inizio delle conferme stimato entro %n blocchi.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Attenzione: Indirizzo Bitcoin non valido</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Attenzione: Indirizzo per il resto sconosciuto</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Conferma il cambio di indirizzo</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>L'indirizzo selezionato per il cambio non fa parte di questo portafoglio. Alcuni o tutti i fondi nel tuo portafoglio potrebbero essere inviati a questo indirizzo. Sei sicuro?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nessuna etichetta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Importo:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Paga &amp;a:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etichetta:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Scegli un indirizzo usato precedentemente</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Questo è un normale pagamento.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>L'indirizzo Bitcoin a cui vuoi inviare il pagamento</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Incollare l'indirizzo dagli appunti</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Rimuovi questa voce</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>La commissione sarà sottratta dall'importo che si sta inviando. Il beneficiario riceverà un totale di bitcoin inferiore al valore digitato. Nel caso in cui siano stati selezionati più beneficiari la commissione sarà suddivisa in parti uguali.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>S&amp;ottrae la commissione dall'importo</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Usa saldo disponibile</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Messaggio:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Questa è una richiesta di pagamento non autenticata.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Questa è una richiesta di pagamento autenticata.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Inserisci un'etichetta per questo indirizzo per aggiungerlo alla lista degli indirizzi utilizzati</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Messaggio incluso nel bitcoin URI e che sarà memorizzato con la transazione per vostro riferimento. Nota: Questo messaggio non sarà inviato attraverso la rete Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pagare a:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Inserisci un'etichetta per questo indirizzo per aggiungerlo alla tua rubrica</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Si</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>Arresto di %1 in corso...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Non spegnere il computer fino a quando questa finestra non si sarà chiusa.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Firme - Firma / Verifica un messaggio</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Firma Messaggio</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>È possibile firmare messaggi/accordi con i propri indirizzi in modo da dimostrare di poter ricevere bitcoin attraverso di essi. Si consiglia di prestare attenzione a non firmare dichiarazioni vaghe o casuali, attacchi di phishing potrebbero cercare di indurre ad apporre la firma su di esse. Si raccomanda di firmare esclusivamente dichiarazioni completamente dettagliate e delle quali si condivide in pieno il contenuto.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>L'indirizzo Bitcoin da utilizzare per firmare il messaggio</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Scegli un indirizzo usato precedentemente</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Incolla l'indirizzo dagli appunti</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Inserisci qui il messaggio che vuoi firmare</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Firma</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copia la firma corrente nella clipboard</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Firma un messaggio per dimostrare di possedere questo indirizzo Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Firma &amp;Messaggio</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Reimposta tutti i campi della firma messaggio</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Cancella &amp;Tutto</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifica Messaggio</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Per verificare il messaggio inserire l'indirizzo del firmatario, il messaggio e la firma nei campi sottostanti, assicurandosi di copiare esattamente anche ritorni a capo, spazi, tabulazioni, etc.. Si raccomanda di non lasciarsi fuorviare dalla firma a leggere più di quanto non sia riportato nel testo del messaggio stesso, in modo da evitare di cadere vittima di attacchi di tipo man-in-the-middle. Si ricorda che la verifica della firma dimostra soltanto che il firmatario può ricevere pagamenti con l'indirizzo corrispondente, non prova l'invio di alcuna transazione.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>L'indirizzo Bitcoin con cui è stato contrassegnato il messaggio</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verifica il messaggio per accertare che sia stato firmato con l'indirizzo specificato</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifica &amp;Messaggio</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Reimposta tutti i campi della verifica messaggio</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Clicca \"Firma Messaggio\" per generare una firma</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>L'indirizzo inserito non è valido.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Per favore controlla l'indirizzo e prova di nuovo.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>L'indirizzo bitcoin inserito non è associato a nessuna chiave.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Sblocco del portamonete annullato.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>La chiave privata per l'indirizzo inserito non è disponibile.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Firma messaggio fallita.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Messaggio firmato.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Non è stato possibile decodificare la firma.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Per favore controlla la firma e prova di nuovo.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>La firma non corrisponde al digest del messaggio.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Verifica messaggio fallita.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Messaggio verificato.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Aperto per altri %n blocchi</numerusform><numerusform>Aperto per altri %n blocchi</numerusform></translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>in conflitto con una transazione con %1 conferme</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/non confermati, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>nella riserva di memoria</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>non nella riserva di memoria</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abbandonato</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/non confermato</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 conferme</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Stato</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, non è ancora stata trasmessa con successo</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, trasmessa attraverso %n nodi</numerusform><numerusform>, trasmessa attraverso %n nodi</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Sorgente</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generato</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Da</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>sconosciuto</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>A</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>proprio indirizzo</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>sola lettura</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etichetta</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Credito</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>matura tra %n blocchi</numerusform><numerusform>matura tra %n blocchi</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>non accettate</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debito</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Debito totale</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Credito totale</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Commissione transazione</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Importo netto</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Messaggio</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Commento</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID della transazione</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Dimensione totale della transazione</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Indice di output</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Commerciante</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>I bitcoin generati devono maturare %1 blocchi prima di poter essere spesi. Quando hai generato questo blocco, è stato trasmesso alla rete per essere aggiunto alla block chain. Se l'inserimento nella catena avrà esito negativo, il suo stato cambierà a \"non accettato\" e non sarà spendibile. Talvolta ciò può accadere anche nel caso in cui un altro nodo generi un blocco entro pochi secondi dal tuo.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Informazione di debug</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transazione</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Input</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Importo</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>vero</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>falso</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Questo pannello mostra una descrizione dettagliata della transazione</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Dettagli per %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetta</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Aperto per altri %n blocchi</numerusform><numerusform>Aperto per altri %n blocchi</numerusform></translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Non confermata</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abbandonato</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>In conferma (%1 di %2 conferme raccomandate)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confermata (%1 conferme)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>In conflitto</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Immaturo (%1 conferme, sarà disponibile fra %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Questo blocco non è stato ricevuto da alcun altro nodo e probabilmente non sarà accettato!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generati, ma non accettati</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Ricevuto tramite</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Ricevuto da</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Inviato a</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pagamento a te stesso</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Ottenuto dal mining</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>sola lettura</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/d)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nessuna etichetta)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Stato della transazione. Passare con il mouse su questo campo per visualizzare il numero di conferme.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Data e ora in cui la transazione è stata ricevuta.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipo di transazione.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Indica se un indirizzo di sola lettura sia o meno coinvolto in questa transazione.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Intento/scopo della transazione definito dall'utente.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Importo rimosso o aggiunto al saldo.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Tutti</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Oggi</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Questa settimana</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Questo mese</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Il mese scorso</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Quest'anno</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Intervallo...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Ricevuto tramite</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Inviato a</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>A te stesso</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Ottenuto dal mining</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Altro</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Inserisci indirizzo, ID transazione, o etichetta per iniziare la ricerca</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Importo minimo</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Abbandona transazione </translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Aumenta la commissione di transazione</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copia indirizzo</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia etichetta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia l'importo</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copia l'ID transazione</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copia la transazione raw</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copia i dettagli dell'intera transazione</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Modifica l'etichetta</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Mostra i dettagli della transazione</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Esporta lo storico delle transazioni</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Testo CSV (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confermato</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Sola lettura</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Indirizzo</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Esportazione Fallita</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Si è verificato un errore durante il salvataggio dello storico delle transazioni in %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Esportazione Riuscita</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Lo storico delle transazioni e' stato salvato con successo in %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Intervallo:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>a</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unità con cui visualizzare gli importi. Clicca per selezionare un'altra unità.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Non è stato caricato alcun portamonete.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Invia Bitcoin</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Errore di salto di commissione</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Aumento della commissione di transazione fallito</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Vuoi aumentare la commissione?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Commissione attuale:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Aumento:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nuova commissione:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Conferma il salto di commissione</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Non è possibile firmare la transazione.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Non è stato possibile completare la transazione</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Esporta</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Esporta su file i dati contenuti nella tabella corrente</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Backup Portamonete</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Dati Portamonete (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Backup Fallito</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Si è verificato un errore durante il salvataggio dei dati del portamonete in %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Backup eseguito con successo</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Il portamonete è stato correttamente salvato in %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opzioni:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Specifica la cartella dati</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Connessione ad un nodo e successiva disconnessione per recuperare gli indirizzi dei peer</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Specifica il tuo indirizzo pubblico</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Accetta comandi da riga di comando e JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distribuito sotto la licenza software del MIT, si veda il file %s o %s incluso</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Se &lt;category&gt; non è specificato oppure se &lt;category&gt; = 1, mostra tutte le informazioni di debug.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>La modalità prune è configurata al di sotto del minimo di %d MB. Si prega di utilizzare un valore più elevato.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Prune: l'ultima sincronizzazione del wallet risulta essere oltre la riduzione dei dati. È necessario eseguire un -reindex (scaricare nuovamente la blockchain in caso di nodo pruned)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Non è possibile un Rescan in modalità pruned. Sarà necessario utilizzare -reindex che farà scaricare nuovamente tutta la blockchain.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Errore: si è presentato un errore interno fatale, consulta il file debug.log per maggiori dettagli</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Commissione (in %s/kB) da aggiungere alle transazioni inviate (default: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Pruning del blockstore...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Esegui in background come demone ed accetta i comandi</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Impossibile avviare il server HTTP. Dettagli nel log di debug.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Sviluppatori di %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Un importo (in %s/kB) che sarà utilizzato quando la stima delle commissioni non ha abbastanza dati (default: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Accetta le transazioni trasmesse ricevute da peers in whitelist anche se non si stanno trasmettendo transazioni (default: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Aggiungi un nodo al quale connettersi e prova a tenere la connessione aperta (fare riferimento al comando di aiuto `addnode` RPC per maggiori informazioni) </translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Associa all'indirizzo indicato e resta permanentemente in ascolto su di esso. Usa la notazione [host]:porta per l'IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Non è possibile ottenere i dati sulla cartella %s. Probabilmente %s è già in esecuzione.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Non e' possibile fornire connessioni specifiche e contemporaneamente usare addrman per trovare connessioni uscenti.  </translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Connettersi solamente a nodo(i) specificati; -connect=0 disattiva connessioni automatiche (le regole per questo peer sono le stesse di quelle per l' -addnode)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Elimina tutte le transazioni dal portamonete e recupera solo quelle che fanno parte della blockchain attraverso il comando -rescan all'avvio.</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Errore lettura %s! Tutte le chiavi sono state lette correttamente, ma i dati delle transazioni o della rubrica potrebbero essere mancanti o non corretti.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Esclude l'informazione di debug per una categoria. Può essere usata in congiunzione con -debug=1 per generare i log di debug per tutte le categorie eccetto una o più categorie specificate.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Esegue un comando quando lo stato di una transazione del portamonete cambia (%s in cmd è sostituito da TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Transazioni extra da mantenere in memoria per ricostruzioni compatte del blocco (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Se questo blocco è nella catena, assume che esso e i suoi predecessori siano validi e potenzialmente salta la verifica dei loro script (0 per verificarli tutti, predefinito: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Regolazione della massima differenza media di tempo dei peer consentita. L'impostazione dell'orario locale può essere impostata in avanti o indietro di questa quantità. (default %u secondi)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Totale massimo di commissioni (in %s) da usare in una transazione singola o di gruppo del wallet; valori troppo bassi possono abortire grandi transazioni (default: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Per favore controllate che la data del computer e l'ora siano corrette! Se il vostro orologio è sbagliato %s non funzionerà correttamente.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Per favore contribuite se ritenete %s utile. Visitate %s per maggiori informazioni riguardo il software.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Ottiene gli indirizzi dei peer attraverso interrogazioni DNS, in caso di scarsa disponibilità (predefinito: 1 a meno che -connect non sia specificato)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Riduce i requisiti di spazio di archiviazione abilitando la cancellazione dei vecchi blocchi (\"pruning\" o potatura). Questo consente di richiedere alla pruneblockchain RPC di cancellare specifici blocchi e abilita il pruning automatico dei vecchi blocchi se viene fornita una dimensione specifica in MiB. Questa modalità è incompatibile con -txindex e -rescan. Attenzione: Per ripristinare questa impostazione è necessario riscaricare l'intera blockchain. (predefinito: 0 = disabilita il pruning dei blocchi, 1 = permetti il pruning manuale tramite RPC, &gt;%u = pota automaticamente i file di blocco per stare sotto una dimensione specifica in MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Imposta la tariffa di commissione più bassa (in %s/kB) per transazioni da includere nella creazione del blocco. (predefinito: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Imposta il numero di thread per la verifica degli script (da %u a %d, 0 = automatico, &lt;0 = lascia questo numero di core liberi, predefinito: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Il database dei blocchi contiene un blocco che sembra provenire dal futuro. Questo può essere dovuto alla data e ora del tuo computer impostate in modo scorretto. Ricostruisci il database dei blocchi se sei certo che la data e l'ora sul tuo computer siano corrette</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Questa è una compilazione di prova pre-rilascio - usala a tuo rischio - da non utilizzare per il mining o per applicazioni commerciali</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Questa è la commissione di transazione che puoi scartare se il cambio è più piccolo della polvere a questo livello</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Impossibile ripetere i blocchi. È necessario ricostruire il database usando -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Impossibile riportare il database ad un livello pre-fork. Dovrai riscaricare tutta la blockchain</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Utilizza UPnP per mappare la porta in ascolto (default: 1 quando in ascolto e -proxy non è specificato)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Username e hash password per connessioni JSON-RPC. Il campo &lt;userpw&gt; utilizza il formato: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Uno script python standard è incluso in share/rpcuser. Il cliente quindi si connette normalmente utilizzando la coppia di argomenti rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt;. Questa opzione può essere specificata più volte</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Il portafoglio non creerà transazioni che violino i limiti della mempool chain (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Attenzione: La rete non sembra essere pienamente d'accordo! Alcuni minatori sembrano riscontrare problemi.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Attenzione: Sembra che non vi sia pieno consenso con i nostri peer! Un aggiornamento da parte tua o degli altri nodi potrebbe essere necessario.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Imposta se salvare la mempool allo spegnimento e caricarla alla riaccensione (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d degli ultimi 100 blocchi hanno una versione inaspettata</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s corrotto, recupero fallito</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool deve essere almeno %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>Valori possibili per &lt;category&gt;:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Accetta connessioni dall'esterno (predefinito: 1 se -proxy o -connect non sono utilizzati)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Aggiungi commento alla stringa dell'applicazione utente</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Prova a recuperare le chiavi private da un portafoglio corrotto all'avvio</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opzioni creazione blocco:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Impossobile risolvere l'indirizzo -%s: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Opzioni di selezione della catena:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Cambio indice fuori paramentro</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opzioni di connessione:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Rilevato database blocchi corrotto</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opzioni di Debug/Test:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Disabilita il portamonete e le relative chiamate RPC</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Vuoi ricostruire ora il database dei blocchi?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Abilita pubblicazione hash blocco in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Abilità pubblicazione hash transazione in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Abilita pubblicazione blocchi raw in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Abilita pubblicazione transazione raw in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Abilita la sostituzione della transazione nel pool della memoria (default: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Errore durante la creazione %s: non e' possibile creare portafogli non-HD con questa versione.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Errore durante l'inizializzazione del database dei blocchi</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Errore durante l'inizializzazione dell'ambiente del database del portamonete %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Errore caricamento %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Errore caricamento %s: Portafoglio corrotto</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Errore caricamento %s: il Portafoglio richiede una versione aggiornata di %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Errore durante il caricamento del database blocchi</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Errore durante l'apertura del database blocchi</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Errore: la spazio libero sul disco è insufficiente!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Nessuna porta disponibile per l'ascolto. Usa -listen=0 se vuoi procedere comunque.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Impossibile ripetere la scansione del portafoglio durante l'inizializzazione</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importazione...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Blocco genesi non corretto o non trovato. È possibile che la cartella dati appartenga ad un'altra rete.</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Test di integrità iniziale fallito. %s si arresterà.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Importo non valido per -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Importo non valido per -discardfee=&lt;amount&gt;:'%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Importo non valido per -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Mantieni la memory pool delle transazioni al di sotto di &lt;n&gt; megabytes (default: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Caricamento indirizzi P2P...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Caricamento bloccati...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Posizione del cookie di aiutorizzazione (default: data dir)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Non ci sono abbastanza descrittori di file disponibili.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Connessione ai soli nodi appartenenti alla rete &lt;net&gt; (ipv4, ipv6 o Tor)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Mostra questo messaggio di aiuto ed esci</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Mostra la versione ed esci</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>La modalità prune non può essere configurata con un valore negativo.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>La modalità prune è incompatibile con l'opzione -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Ricostruisci lo stato della catena e l'indice dei blocchi partendo dai file blk*.dat presenti sul disco</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Ricrea l'indice della catena dei blocchi partendo da quelli già indicizzati</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Ripetizione dei blocchi...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Verifica blocchi...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>Invia transazioni con full-RBF opt-in attivo (solo RPC, default: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Imposta la dimensione della cache del database in megabyte (%d a %d, predefinito: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Specifica il file del portamonete (all'interno della cartella dati)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Il codice sorgente è disponibile in %s</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Commissione di transazione e calcolo del cambio falliti</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Impossibile collegarsi a %s su questo computer. Probabilmente %s è già in esecuzione.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Ignorata opzione -benchmark non supportata, utilizzare -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Argomento -debugnet ignorato in quanto non supportato, usare -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Rilevato argomento -tor non supportato, utilizzare -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Categoria di registrazione non supportata %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Aggiornamento del database UTXO</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Usa UPnP per mappare la porta di ascolto (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Utilizza la catena di prova</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Il commento del User Agent (%s) contiene caratteri non sicuri.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verifica blocchi...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Opzioni di Debug/Test del portafoglio:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Il portamonete necessita di essere riscritto: riavviare %s per completare</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opzioni portamonete:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Permette connessioni JSON-RPC dall'origine specificata. I valori validi per &lt;ip&gt; sono un singolo IP (ad es. 1.2.3.4), una network/netmask (ad es. 1.2.3.4/255.255.255.0) oppure una network/CIDR (ad es. 1.2.3.4/24). Questa opzione può essere specificata più volte.</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Resta in ascolto sull'indirizzo indicato ed inserisce in whitelist i peer che vi si collegano. Usa la notazione [host]:porta per l'IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Crea nuovi file con i permessi di default del sistema, invece che con umask 077 (ha effetto solo con funzionalità di portamonete disabilitate)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Scopre i propri indirizzi IP (predefinito: 1 se in ascolto ed -externalip o -proxy non sono specificati)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Errore: attesa per connessioni in arrivo fallita (errore riportato %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Esegue un comando in caso di ricezione di un allarme pertinente o se si rileva un fork molto lungo (%s in cmd è sostituito dal messaggio)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Le commissioni (in %s/kB) inferiori a questo valore sono considerate pari a zero per trasmissione, mining e creazione della transazione (default: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Nel caso in cui paytxfee non sia impostato, include una commissione tale da ottenere un avvio delle conferme entro una media di n blocchi (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Importo non valido per -maxtxfee=&lt;amount&gt;: '%s' (deve essere almeno pari alla commissione 'minrelay fee' di %s per prevenire transazioni bloccate)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Dimensione massima dei dati in transazioni di trasporto dati che saranno trasmesse ed incluse nei blocchi (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Randomizza le credenziali per ogni connessione proxy. Permette la Tor stream isolation (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>L'importo della transazione risulta troppo basso per l'invio una volta dedotte le commissioni.</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>I peer inclusi in whitelist non possono subire ban per DoS e le loro transazioni saranno sempre trasmesse, anche nel caso in cui si trovino già nel mempool. Ciò è utile ad es. per i gateway</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Per ritornare alla modalità unpruned sarà necessario ricostruire il database utilizzando l'opzione -reindex. L'intera blockchain sarà riscaricata.</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(default: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Accetta richieste REST pubbliche (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Crea automaticamente il servizio Tor (default: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Connessione attraverso un proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Errore caricamento %s: Non puoi disabilitare HD in un portafoglio HD già esistente</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Errore durante lalettura del database. Arresto in corso.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Errore durante l'aggiornamento del database chainstate</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importa blocchi da un file blk000??.dat esterno all'avvio</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informazioni</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Indirizzo -onion o hostname non valido: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Indirizzo -proxy o hostname non valido: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Importo non valido per -paytxfee=&lt;amount&gt;: '%s' (deve essere almeno %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Netmask non valida specificata in -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Mantiene in memoria al massimo &lt;n&gt; transazioni non collegabili (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>È necessario specificare una porta con -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Opzioni trasmissione nodo:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opzioni server RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Riduzione -maxconnections da %d a %d a causa di limitazioni di sistema.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Ripete la scansione della block chain per individuare le transazioni che mancano dal wallet all'avvio</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Invia le informazioni di trace/debug alla console invece che al file debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Mostra tutte le opzioni di debug (utilizzo: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Riduce il file debug.log all'avvio del client (predefinito: 1 se -debug non è impostato)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Firma transazione fallita</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>-walletdir \"%s\"  specificata non esiste</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>-walletdir \"%s\" specificata e' un path relativo</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>-walletdir \"%s\" specificata non e' una directory</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>L'importo della transazione è troppo basso per pagare la commissione</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Questo è un software sperimentale.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Password porta controllo Tor (default: empty)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Porta di controllo Tor da usare se in ascolto su onion (default: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Importo transazione troppo piccolo</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transazione troppo grande in base alla policy sulle commissioni</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transazione troppo grande</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Impossibile associarsi a %s su questo computer (l'associazione ha restituito l'errore %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Impossibile generare chiave iniziale</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Aggiorna il wallet all'ultimo formato all'avvio</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nome utente per connessioni JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Verifica portafoglio/i...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Il portafoglio %s e' situato fuori dalla directory del portafoglio %s </translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Attenzione</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Attenzione: nuove regole non conosciute attivate (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Imposta se operare in modalità solo blocchi (default: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>È necessario ricostruire il database usando -reindex per cambiare -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Eliminazione dal portamonete di tutte le transazioni...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Opzioni di notifica ZeroMQ</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Password per connessioni JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Esegue un comando quando il miglior blocco cambia (%s nel cmd è sostituito dall'hash del blocco)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Consente interrogazioni DNS per -addnode, -seednode e -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = mantiene metadati tx, ad es. proprietario account ed informazioni di richiesta di pagamento, 2 = scarta metadati tx)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee è impostato molto alto! Commissioni così alte possono venir pagate anche su una singola transazione.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Resta in attesa di connessioni JSON-RPC sull'indirizzo indicato. Questa opzione viene ignorata a meno che anche -rpcallowip non sia trasmesso. Port è opzionale e prevale su -rpcport. Usa la notazione [host]:porta per IPv6. Questa opzione può essere specificata più volte (predefinito: 127.0.0.1 e ::1 ovvero localhost, o se -rpcallowip è stato specificato, 0.0.0.0 e :: ovvero tutti gli indirizzi)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Non mantenere le transazioni nella mempool più a lungo di &lt;n&gt; ore (default: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Byte equivalenti per ottimizzazione segnale dedicati a ritrasmissione ed estrazione (default: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Errore caricamento %s: Non puoi abilitare HD in un portafoglio non-HD già esistente</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Errore caricamento portafoglio %s. Il parametro -wallet deve solo specificare un nome file (non un percorso).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Le commissioni (in %s/kB) inferiori a questo valore sono considerate pari a zero per la creazione della transazione (default: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Forza la trasmissione della transazione da peer in whitelist anche se violano le regole di trasmissione locali (predefinito: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Determina quanto sarà approfondita la verifica da parte di -checkblocks (0-4, predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Mantiene l'indice completo delle transazioni usato dalla chiamata rpc getrawtransaction (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Numero di secondi di sospensione prima della riconnessione per i peer che mostrano un comportamento anomalo (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Emette informazioni di debug (predefinito: %u, fornire &lt;category&gt; è opzionale)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Imposta che la serializzazione degli hex di transazioni o blocchi grezzi sia riportata in maniere non-verbose, non-segwit(0) o segwit(1) (predefinito: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Specificare la directory dove i portafogli saranno conservati (default: 1/portafogli se esiste, altrimenti 2)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Specificare la posizione del debug log file:  questo puo' essere un percorso assoluto o un percorso relativo alla directory dei dati (default: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Supporta filtraggio di blocchi e transazioni con filtri bloom (default: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>La tariffa di commissione (in %s/kB) che indica la tua tolleranza a scartare il cambio aggiungendolo alla commissione (predefinito: %s).</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Questo è il costo di transazione che potresti pagare quando le stime della tariffa non sono disponibili.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Questo prodotto include software sviluppato dal progetto OpenSSL per l'uso del Toolkit OpenSSL %s, software crittografico scritto da Eric Young e software UPnP scritto da Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>La lunghezza totale della stringa di network version (%i) eccede la lunghezza massima (%i). Ridurre il numero o la dimensione di uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Cerca di mantenere il traffico in uscita al di sotto della soglia scelta (in MiB ogni 24h), 0 = nessun limite (default: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Argomento -socks non supportato. Non è più possibile impostare la versione SOCKS, solamente i proxy SOCKS5 sono supportati.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Argomento non supportato -whitelistalwaysrelay è stato ignorato, utilizzare -whitelistrelay e/o -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Usa un proxy SOCKS5 a parte per raggiungere i peer attraverso gli hidden services di Tor (predefinito: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Attenzione: si stanno minando versioni sconocsiute di blocchi! E' possibile che siano attive regole sconosciute</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Attenzione: file del Portafoglio corrotto, dati recuperati! %s originale salvato come %s in %s; se il saldo o le transazioni non sono corrette effettua un ripristino da un backup.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>I peer in whitelist che si connettono dal dato indirizzo IP (es. 1.2.3.4) o dalla rete annotata CIDR (es. 1.2.3.0/24). Può essere specificato più volte.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s ha un'impostazione molto alta!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(predefinito: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Interroga sempre i DNS per ottenere gli indirizzi dei peer (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Errore caricamento portafoglio %s. Il nome file -wallet deve essere un file regolare.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Errore caricamento portafoglio %s. Il nome file -wallet specificato è duplicato.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Errore caricamento portafoglio %s. Caratteri invalidi nel nome file -wallet.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Numero di blocchi da controllare all'avvio (predefinito: %u, 0 = tutti)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Include gli indirizzi IP nell'output del debug (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Keypool esaurito, prima invocare keypoolrefill</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Resta in attesa di connessioni JSON-RPC su &lt;port&gt; (predefinito: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Resta in attesa di connessioni su &lt;port&gt; (predefinito: %u o testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Mantiene al massimo &lt;n&gt; connessioni verso i peer (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Configura il portamonete per la trasmissione di transazioni</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Buffer di ricezione massimo per connessione, &lt;n&gt;*1000 byte (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Buffer di invio massimo per connessione, &lt;n&gt;*1000 byte (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Antepone un timestamp all'output del debug (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Trasmette ed include nei blocchi transazioni di trasporto dati (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Trasmette transazioni non-P2SH multisig (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Imposta la dimensione del pool di chiavi a &lt;n&gt; (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Imposta la dimensione massima del blocco BIP141 (default: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Imposta il numero di thread destinati a rispondere alle chiamate RPC (predefinito %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Specifica il file di configurazione (predefinito: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Specifica il timeout di connessione in millisecondi (minimo:1, predefinito: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Specifica il file pid (predefinito: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Abilita la spesa di resto non confermato quando si inviano transazioni (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Inizializzazione dei thread di rete...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Il portafoglio eviterà di pagare meno della tariffa minima di trasmissione.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Questo è il costo di transazione minimo che pagherai su ogni transazione.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Questo è il costo di transazione che pagherai se invii una transazione.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Soglia di disconnessione per i peer che si comportano in maniera anomala (predefinito: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Gli importi di transazione non devono essere negativi</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>La transazione ha una mempool chain troppo lunga</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>La transazione deve avere almeno un destinatario</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Rete sconosciuta specificata in -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fondi insufficienti</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Caricamento dell'indice dei blocchi...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Caricamento portamonete...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Non è possibile effettuare il downgrade del portamonete</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Ripetizione scansione...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Caricamento completato</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Errore</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_it_IT.ts",
    "content": "<TS language=\"it_IT\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Click destro per modificare indirizzo o etichetta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crea un nuovo indirizzo </translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>Nuovo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>copia l'indirizzo selezionato correntemente nella clipboard di sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>Copia</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Chiudi </translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Cancella l'indirizzo attualmente selezionato dalla lista.</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Esportare i dati nella scheda corrente in un file</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Esporta</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>Cancella</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Scegli l'indirizzo a cui inviare denaro</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Scegli l'indirizzo dove accreditare i coins</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Scegli</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Indirizzi mandanti</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Indirizzi riceventi</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Questi sono i suoi indirizzi Bitcoin per ricevere i pagamenti. Controlla sempre l'importo e gli indirizzi prima di inviare i coins.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Questi sono i tuoi indirizzi Bitcoin per ricevere i pagamenti. Si raccomanda di usare un nuovo indirizzo per ogni transazione.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>copia indirizzo </translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>copia etichetta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>Modifica</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Esporta lista indirizzi</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Esportazione Fallita</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etichetta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Indirizzo</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nessuna etichetta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Finestra Password</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Inserisci la password</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nuova password</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ripeti nuova password</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>mostra password</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Inserisci la nuova password per il portafoglio.&lt;br/&gt;Per favore usa una password di &lt;b&gt;dieci o più caratteri casuali&lt;/b&gt;, oppure &lt;b&gt;otto o più parole&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Cripta portafoglio</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Questa operazione necessita della password del tuo portafoglio per sbloccare il portafoglio.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Sblocca portafoglio</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Questa operazione necessita della password del tuo portafoglio per decriptare il portafoglio.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Decripta portafoglio</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Cambia password</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Inserisci la vecchia password e la nuova password per decriptare il portafoglio.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Conferma criptaggio portafoglio</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Attenzione: Se cripti il tuo portafoglio e perdi la password, &lt;b&gt;PERDERAI TUTTI I TUOI BITCOIN&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Sei sicuro di voler criptare il tuo portafoglio?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Portafoglio criptato</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 ora si chiuderà per concludere il processo di criptaggio. Ricorda che criptare il tuo portafoglio non può definitivamente proteggere i tuoi bitcoin da furti tramite malware che infetta il tuo computer.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANTE: Qualsiasi backup precedentemente effettuato del tuo portafoglio dovrebbe essere sostituito con il nuovo file criptato generato. Per questioni di sicurezza, backup precedenti del portafoglio non criptati diverranno inutili non appena inizi ad usare il nuovo portafoglio criptato.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Criptaggio del portafoglio fallito</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Criptaggio del portafoglio fallito per un errore interno. Il tuo portafoglio non è stato criptato.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>La password fornite non corrispondono.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Sblocco portafoglio fallito</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>La password inserita per decriptare il portafoglio è errata.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Decriptaggio portafoglio fallito</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>La password del portafoglio è stata cambiata correttamente.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Attenzione: Il tasto blocco delle maiuscole è attivo!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>bannato fino </translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Firma &amp;messaggio...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizzazione con la rete...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Panoramica</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nodo</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostra panoramica generale del portafoglio</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>Transazioni</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Esplora cronologia transazioni</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Esci</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Termina applicazione</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>Di più su %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Mostra informazioni su %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Di più su Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostra informazioni su Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>Opzioni</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modifica opzioni di configurazione per %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Cripta portafoglio</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Backup portafoglio</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Cambia Password...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Indirizzi di invio...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Indirizzi di ricezione...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Apri &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Clicca per disabilitare attività di rete.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Attività di rete disabilitata.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Clicca per riabilitare attività di rete.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Sincronizzazione Header (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindicizzazione dei blocchi sul disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Invia monete ad un indirizzo Bitcoin...</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Backup del portafoglio in un'altra posizione</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cambia la password usata per criptare il portafoglio</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Finestra di debug</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Apri console di debug e diagnosi</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Verifica messaggio...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Portafoglio</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>Invia</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>Ricevi</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>Mostra / Nascondi</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostra o nascondi la finestra principale</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Cripta le chiavi private che appartengono al tuo portafoglio</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Firma messaggi con i tuoi indirizzi Bitcoin per provare che li possiedi</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifica messaggi per accertarti che siano firmati dagli indirizzi Bitcoin specificati</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>File</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>Impostazioni</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>Aiuto</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra degli strumenti</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Richiedi pagamenti (genera codici QR e bitcoin: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostra la lista degli indirizzi di invio usati e le relative etichette</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Mostra la lista degli indirizzi di ricezione usati e le relative etichette</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Apri un bitcoin: URI o una richiesta di pagamento</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opzioni linea di comando</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indicizzazione blocchi su disco...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Elaborazione blocchi su disco...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 indietro</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Ultimo blocco ricevuto generato %1 fa.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Le transazioni dopo di questa non saranno più visibili</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Errore</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Attenzione</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informazione</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Aggiornato</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Mostra il %1 messaggio d'aiuto per ottenere una lista con le possibili opzioni per la riga di comando di Bitcoin</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Importo: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipo: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etichetta: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Indirizzo: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transazione inviata</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transazione in arrivo</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Si è verificato un errore fatale. Bitcoin non può continuare in maniera sicura e sarà chiuso.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selezione delle monete</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantità:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Importo:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Tassa:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Minimo:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(de)seleziona tutto</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modalità albero</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modalità lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Importo</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Ricevuto con etichetta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Ricevuto con indirizzo</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Conferme</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confermato</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copia indirizzo</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia etichetta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia importo</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copia ID transazione</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Blocca non spese</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Sblocca non spese</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copia quantità</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copia tassa</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copia bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copia minimo</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copia cambio</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 bloccato)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>si</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>no</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Questa etichetta diventa rossa se qualsiasi destinatario riceve un importo inferiore al limite minimo corrente.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nessuna etichetta)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(cambio)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Modifica Indirizzo</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etichetta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>L'etichetta associata con questa voce dell'elenco indirizzi</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>L'indirizzo associato con questa voce dell'elenco indirizzi. Può essere modificato per inviare indirizzi.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Indirizzo</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nuovo indirizzo di ricezione</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nuovo indirizzo di invio</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Modifica l'indirizzo di ricezione</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Modifica l'indirizzo di invio</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>L'indirizzo inserito \"%1\" non è un indirizzo Bitcoin valido.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>L'indirizzo inserito \"%1\" è già nella rubrica.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Non posso sbloccare il portafoglio.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Generazione della nuova chiave fallita.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Una nuova cartella dei dati verrà creata.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nome</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>La cartella esiste già. Aggiungi %1 se vuoi creare una nuova cartella qui.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Il percorso esiste già, e non è una cartella.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Non posso creare la cartella dei dati qui.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versione</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Circa %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opzioni linea di comando</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Utilizzo:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opzioni linea di comando</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opzioni UI</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Benvenuto</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Il portafoglio sara' </translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Errore</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Numero di blocchi rimanente</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opzioni</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opzioni di configurazione</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Errore</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Questa modifica richiede un riavvio del client</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Available:</source>\n        <translation>Disponibile:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Saldo disponibile</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transazioni recenti</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Richiesta di pagamento rifiutata</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Rimborso da %1</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>Inviato</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Importo</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>Sent</source>\n        <translation>Inviato</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia etichetta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia importo</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Indirizzo</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Importo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetta</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetta</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nessuna etichetta)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantità:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Importo:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Tassa:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Cambio:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Minimo:</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copia quantità</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia importo</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copia tassa</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copia bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copia minimo</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copia cambio</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nessuna etichetta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Importo</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetta</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(nessuna etichetta)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>Copia indirizzo</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copia etichetta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copia importo</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copia ID transazione</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confermato</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Indirizzo</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Esportazione Fallita</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Information</source>\n        <translation>Informazione</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Attenzione</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Errore</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ja.ts",
    "content": "<TS language=\"ja\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>アドレスまたはラベルを編集するにはダブルクリック</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>新規アドレスの作成</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>新規(&amp;N)</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>現在選択されているアドレスをシステムのクリップボードにコピーする</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>コピー(&amp;C)</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>閉じる(&amp;C)</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>選択されたアドレスを一覧から削除する</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>ファイルに現在のタブのデータをエクスポート</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>エクスポート (&amp;E)</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>削除(&amp;D)</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>先のアドレスを選択</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>支払いを受け取るアドレスを指定する</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>選択 (&amp;C)</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>送金用</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>受け取りアドレス</translation>\n    </message>\n    <message>\n        <source>These are your Sugarchain addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>これらは支払いを送信するためのあなたの Sugarchain アドレスです。コインを送信する前に、常に額と受信アドレスを確認してください。</translation>\n    </message>\n    <message>\n        <source>These are your Sugarchain addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>これらは支払いを受け取るためのシュガーチェーンアドレスです。トランザクションごとに新しい受け取り用アドレスを作成することが推奨されます。</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>アドレスをコピー (&amp;C)</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>ラベルをコピー (&amp;L)</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>編集 (&amp;E)</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>アドレス帳をエクスポート</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>テキスト CSV (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>エクスポートに失敗しました</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>トランザクション履歴を %1 へ保存する際にエラーが発生しました。再試行してください。</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>アドレス</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ラベル無し)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>パスフレーズ ダイアログ</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>パスフレーズを入力</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>新しいパスフレーズ</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>新しいパスフレーズをもう一度</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>パスワードを表示</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>ウォレットの新しいパスフレーズを入力してください。&lt;br/&gt;&lt;b&gt;10文字以上のランダムな文字&lt;/b&gt;で構成されたものか、&lt;b&gt;8単語以上の単語&lt;/b&gt;で構成されたパスフレーズを使用してください。</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>ウォレットを暗号化する</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>この操作はウォレットをアンロックするためにパスフレーズが必要です。</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>ウォレットをアンロックする</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>この操作はウォレットの暗号化解除のためにパスフレーズが必要です。</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>ウォレットの暗号化を解除する</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>パスフレーズの変更</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>ウォレットの古いパスフレーズおよび新しいパスフレーズを入力してください。</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>ウォレットの暗号化を確認する</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR SUGARCHAINS&lt;/b&gt;!</source>\n        <translation>警告: もしもあなたのウォレットを暗号化してパスフレーズを失ってしまったなら、&lt;b&gt;あなたの Sugarchain はすべて失われます&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>本当にウォレットを暗号化しますか?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>ウォレットは暗号化されました</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your sugarchains from being stolen by malware infecting your computer.</source>\n        <translation>暗号化処理を完了させるため %1 をいますぐ終了します。ウォレットの暗号化では、コンピュータに感染したマルウェアなどによるシュガーチェーンの盗難から完全に守ることはできないことにご注意ください。</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>重要: 過去のウォレット ファイルのバックアップは、暗号化された新しいウォレット ファイルに取り替える必要があります。セキュリティ上の理由により、暗号化された新しいウォレットを使い始めると、暗号化されていないウォレット ファイルのバックアップはすぐに使えなくなります。</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>ウォレットの暗号化に失敗しました</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>内部エラーによりウォレットの暗号化が失敗しました。ウォレットは暗号化されませんでした。</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>パスフレーズが同じではありません。</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>ウォレットのアンロックに失敗しました</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>ウォレットの暗号化解除のパスフレーズが正しくありません。</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>ウォレットの暗号化解除に失敗しました</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>ウォレットのパスフレーズの変更が成功しました。</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>警告: Caps Lock キーがオンになっています!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IPアドレス/ネットマスク</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>以下の時間までbanする:</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>メッセージの署名... (&amp;m)</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>ネットワークに同期中……</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>概要(&amp;O)</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>ノード</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>ウォレットの概要を見る</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>取引(&amp;T)</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>取引履歴を閲覧</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>終了(&amp;E)</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>アプリケーションを終了</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>%1 について (&amp;A)</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>%1 の情報を表示</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Qt について(&amp;Q)</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Qt の情報を表示</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>オプション... (&amp;O)</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>%1 の設定を変更する</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>ウォレットの暗号化... (&amp;E)</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>ウォレットのバックアップ... (&amp;B)</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>パスフレーズの変更... (&amp;C)</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>送金先アドレス一覧 (&amp;S)...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>受け取り用アドレス一覧 (&amp;R)...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>URI を開く (&amp;U)...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>クリックするとネットワーク活動を無効化します。</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>ネットワーク活動は無効化されました。</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>クリックするとネットワーク活動を再び有効化します。</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>未知。ヘッダを同期しています (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>ディスク上のブロックのインデックスを再作成中...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Sugarchain address</source>\n        <translation>Sugarchain アドレスにコインを送る</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>ウォレットを他の場所にバックアップ</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>ウォレット暗号化用パスフレーズの変更</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>デバッグ ウインドウ (&amp;D)</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>デバッグと診断コンソールを開く</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>メッセージの検証... (&amp;V)</translation>\n    </message>\n    <message>\n        <source>Sugarchain</source>\n        <translation>シュガーチェーン</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>ウォレット</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>送金 (&amp;S)</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>入金 (&amp;R)</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>見る/隠す (&amp;S)</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>メイン ウインドウを表示または非表示</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>あなたのウォレットの秘密鍵を暗号化します</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Sugarchain addresses to prove you own them</source>\n        <translation>あなたが所有していることを証明するために、あなたの Sugarchain アドレスでメッセージに署名してください</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Sugarchain addresses</source>\n        <translation>指定された Sugarchain アドレスで署名されたことを確認するためにメッセージを検証します</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>ファイル(&amp;F)</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>設定(&amp;S)</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>ヘルプ(&amp;H)</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>タブツールバー</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and sugarchain: URIs)</source>\n        <translation>支払いを要求する (QRコードとsugarchain:ではじまるURIを生成する)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>使用済みの送金用アドレスとラベルの一覧を表示する</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>支払いを受け取るアドレスとラベルのリストを表示する</translation>\n    </message>\n    <message>\n        <source>Open a sugarchain: URI or payment request</source>\n        <translation>sugarchain: URIまたは支払いリクエストを開く</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>コマンドラインオプション (&amp;C)</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Sugarchain network</source>\n        <translation><numerusform>%n の Sugarchain ネットワークへのアクティブな接続</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>ディスク上のブロックのインデックスを作成しています...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>ディスク上のブロックを処理しています...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>トランザクション履歴の %n ブロックを処理しました。</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 遅延</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>最後に受信されたブロックは %1 前に生成されました。</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>この後の取引はまだ表示されません。</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>エラー</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>情報</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>バージョンは最新です</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Sugarchain command-line options</source>\n        <translation>有効な Sugarchain のコマンドライン オプションを見るために %1 のヘルプメッセージを表示します。</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 クライアント</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>ピアに接続しています...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>追跡中...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>日付: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>総額: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>タイプ: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>ラベル: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>アドレス: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>送金取引</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>着金取引</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD鍵生成は&lt;b&gt;有効化&lt;/b&gt;されています</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD鍵生成は&lt;b&gt;無効化&lt;/b&gt;されています</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>ウォレットは&lt;b&gt;暗号化されて、アンロックされています&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>ウォレットは&lt;b&gt;暗号化されて、ロックされています&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Sugarchain can no longer continue safely and will quit.</source>\n        <translation>致命的なエラーが発生しました。Sugarchain は安全に継続することができず終了するでしょう。</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>コイン選択</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>数量:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>バイト:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>総額:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>手数料:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>ダスト：</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>手数料差引後:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>釣り銭:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>すべて選択/選択解除</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>ツリーモード</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>リストモード</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>総額</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>ラベルに対する入金一覧</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>アドレスに対する入金一覧</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日付</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>検証数</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>検証済み</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>アドレスをコピーする</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>ラベルをコピーする</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>総額のコピー</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>取引 ID をコピー</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>未使用トランザクションをロックする</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>未使用トランザクションをアンロックする</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>数量をコピーする</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>手数料をコピーする</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>手数料差引後の値をコピーする</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>バイト数をコピーする</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>ダストをコピーする</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>釣り銭をコピー</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 がロック済み)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>はい</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>いいえ</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>少なくともひとつの受取額が現在のダスト閾値を下回る場合にはこのラベルは赤くなります。</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>ひとつの入力につき %1 satoshi 前後ずれることがあります。</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>（ラベル無し）</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>%1 (%2) からのおつり</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(おつり)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>アドレスの編集</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>ラベル(&amp;L)</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>このアドレス帳項目に結びつけられているラベル</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>このアドレス帳項目に結びつけられているアドレス。この項目は送金用アドレスの場合のみ編集することができます。</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>アドレス帳 (&amp;A)</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>新しい受信アドレス</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>新しい送信アドレス</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>入金アドレスを編集</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>送信アドレスを編集</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Sugarchain address.</source>\n        <translation>入力されたアドレス \"%1\" は無効な Sugarchain アドレスです。</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>入力されたアドレス \"%1\" は既にアドレス帳にあります。</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>ウォレットをアンロックできませんでした。</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>新しいキーの生成に失敗しました。</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>新しいデータ ディレクトリが作成されます。</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>name</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>ディレクトリがもうあります。 新しいのディレクトリを作るつもりなら%1を書いてください。</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>パスが存在しますがディレクトリではありません。</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>ここにデータ ディレクトリを作成することはできません。</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>バージョン</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1ビット)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>%1 について</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>コマンドライン オプション</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>使用法:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>コマンドライン オプション</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>UIオプション:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>起動時にデータ ディレクトリを選ぶ (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>言語設定 例: \"de_DE\" (初期値: システムの言語)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>最小化された状態で起動する</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>支払いリクエスト用にSSLルート証明書を設定する (デフォルト：-system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>起動時にスプラッシュ画面を表示する (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>GUI で行われた設定の変更を全てリセット</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>ようこそ</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>%1 へようこそ。</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>これはプログラム最初の起動です。%1 がデータを保存する場所を選択して下さい。</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>OKをクリックすると、%1は完全な%4ブロックチェーン (%2GB) のダウンロードおよび処理を%4が開始された時点の%3から開始します。</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>この初期同期には多大なリソースを消費し、あなたのコンピュータにこれまで見つからなかったハードウェア上の問題を露呈させるかもしれません。%1 を実行する度に、中断された時点からダウンロードを継続します。</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>ブロックチェーンの保存容量に制限を設けることを選択した場合 (剪定) にも、過去のデータのダウンロードおよび処理が必要になります。しかしこれらのデータはディスク使用量を低く抑えるためにその後削除されるでしょう</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>初期値のデータ ディレクトリを使用</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>任意のデータ ディレクトリを使用:</translation>\n    </message>\n    <message>\n        <source>Sugarchain</source>\n        <translation>シュガーチェーン</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>少なくとも%1GBのデータをこのディレクトリに保存する必要があります。またこのデータは時間とともに増加していきます。</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>おおむね%1GBのデータがこのディレクトリに保存されます。</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Sugarchain block chain.</source>\n        <translation>%1はSugarchainのブロックチェーンの複製をダウンロードし保存します。</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>ウォレットもこのディレクトリに保存されます。</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>エラー: 指定のデータディレクトリ \"%1\" を作成できません。</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>エラー</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GBの空き容量が利用可能</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(%n GB必要)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>フォーム</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the sugarchain network, as detailed below.</source>\n        <translation>確認できない最近のトランザクションがあるかもしれません。これによりウォレットの残高は不正確なものである可能性があります。この情報はウォレットが一度シュガーチェーンネットワークへの同期が完了すると正確なものとなります。詳細は下記を参照してください。</translation>\n    </message>\n    <message>\n        <source>Attempting to spend sugarchains that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>まだ表示されていないトランザクションが影響するシュガーチェーンを使用しようとすると、ネットワークから認証がなされないでしょう。</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>残りのブロック数</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>未知...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>最終ブロックの日時</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>進捗</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>一時間あたりの進捗増加</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>計算しています...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>同期完了までの推定残り時間</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>隠す</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>未知。ヘッダを同期しています (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>URI を開く</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>URI またはファイルから支払いリクエストを開く</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>支払いリクエストファイルを選択してください</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>開きたい支払いリクエストファイルを選択してください</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>設定</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>メイン (&amp;M)</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>システムにログインした際、自動的に %1 を起動する。</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>システムにログインした時に %1 を起動 (&amp;S)</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>データベースキャッシュのサイズ (&amp;D)</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>スクリプト検証用スレッド数 (&amp;V)</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>プロキシのIPアドレス (例えば IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>このネットワークタイプ経由で、与えられたデフォルトのSOCKS5プロキシを使用してピアに到達した場合に表示する。</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Tor秘匿サービス経由でピアに接続するために専用のSOCKS5プロキシを利用する:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>システムトレイのアイコンを隠す</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>トレイアイコンを隠す(&amp;H)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>ウィンドウを閉じる際にアプリケーションを終了するのではなく、最小化します。このオプションが有効化された場合、メニューから終了を選択した場合にのみアプリケーションは閉じられます。</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>トランザクションタブのコンテキストメニュー項目に表示する、サードパーティURL (例えばブロックエクスプローラ)。URL中の%sはトランザクションのハッシュ値に置き換えられます。垂直バー | で区切ることで、複数のURLを指定できます。</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>上のオプションを置き換えることのできる、有効なコマンドラインオプションの一覧:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>%1の設定ファイルをワーキングディレクトリから開く。</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>設定ファイルを開く</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>すべてのオプションを初期値に戻します。</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>オプションをリセット (&amp;R)</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>ネットワーク (&amp;N)</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = 自動、0以上 = 指定した数のコアをフリーにする)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>ウォレット (&amp;A)</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>エクスポート</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>コインコントロール機能を有効化する (&amp;C)</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>未検証のおつりの使用を無効化すると、トランザクションが少なくとも1検証を獲得するまではそのトランザクションのおつりは利用できなくなります。これは残高の計算方法にも影響します。</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>未検証のおつりを使用する (&amp;S)</translation>\n    </message>\n    <message>\n        <source>Automatically open the Sugarchain client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>自動的にルーター上の Sugarchain クライアントのポートを開きます。あなたのルーターが UPnP に対応していて、それが有効になっている場合に作動します。</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>UPnP を使ってポートを割り当てる (&amp;U)</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>外部からの接続を許可する</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>外部からの接続を許可する (&amp;G)</translation>\n    </message>\n    <message>\n        <source>Connect to the Sugarchain network through a SOCKS5 proxy.</source>\n        <translation>SOCKS5 プロキシ経由でSugarchainネットワークに接続する</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>SOCKS5 プロキシ経由で接続する (デフォルトプロキシ): (&amp;C)</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>プロキシの IP (&amp;I) :</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>ポート (&amp;P) :</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>プロキシのポート番号 (例 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>ピアへ到達するために使われた方法:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Sugarchain network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Tor秘匿サービスを利用するため、独立なSOCKS5プロキシ経由でSugarchainネットワークに接続する</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>ウインドウ (&amp;W)</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>ウインドウを最小化したあとトレイ アイコンだけを表示する。</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>タスクバーの代わりにトレイに最小化 (&amp;M)</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>閉じる時に最小化 (&amp;i)</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>表示 (&amp;D)</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>ユーザインターフェースの言語 (&amp;l) :</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>ここでユーザインターフェースの言語を設定できます。設定を反映するには %1 を再起動します。</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>額を表示する単位 (&amp;U) :</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>インターフェース上の表示とコインの送信で使用する単位を選択します。</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>コインコントロール機能を表示するかどうか。</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>サードパーティのトランザクションURL (&amp;T)</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>キャンセル (&amp;C)</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>初期値</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>なし</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>オプションのリセットの確認</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>変更を有効化するにはクライアントを再起動する必要があります。</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>クライアントを終了します。続行してもよろしいですか？</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>設定オプション</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>設定ファイルは高度なユーザオプションを指定するために利用され、GUI での設定をオーバーライドします。また、コマンドラインオプションはこの設定ファイルの内容をオーバーライドします</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>エラー</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>設定ファイルを開くことができませんでした。</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>この変更はクライアントの再起動が必要です。</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>プロキシアドレスが無効です。</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>フォーム</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Sugarchain network after a connection is established, but this process has not completed yet.</source>\n        <translation>表示された情報は古いかもしれません。接続が確立されると、あなたのウォレットは Sugarchain ネットワークと自動的に同期しますが、このプロセスはまだ完了していません。</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>監視限定:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>利用可能:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>あなたの利用可能残高</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>検証待ち:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>未検証の取引で利用可能残高に反映されていない数</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>未完成:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>完成していない採掘された残高</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>残高</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>合計:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>あなたの現在の残高</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>監視限定アドレス内の現在の残高</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>使用可能:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>最近のトランザクション</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>監視限定アドレスに対する未検証のトランザクション</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>ウォッチオンリーアドレスの採掘された残高のうち、成熟していないもの</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>監視限定アドレス内の現在の全残高</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>支払いのリクエストのエラーです</translation>\n    </message>\n    <message>\n        <source>Cannot start sugarchain: click-to-pay handler</source>\n        <translation>Sugarchain を起動できません: click-to-pay handler</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI の操作</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>支払い要求の取得先URLが無効です: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>支払いのアドレス「%1」は無効です</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Sugarchain address or malformed URI parameters.</source>\n        <translation>URI を解析できません! これは無効な Sugarchain アドレスあるいは不正な形式の URI パラメーターによって引き起こされる場合があります。</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>支払いリクエストファイルを処理しています</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>支払いリクエストファイルを読み込めませんでした！無効な支払いリクエストファイルにより引き起こされた可能性があります。</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>支払い要求は拒否されました</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>支払いリクエストのネットワークは現在のクライアントのネットワークに一致しません。</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>支払いリクエストの期限が切れました。</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>支払いリクエストは開始されていません。</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>カスタム支払いスクリプトに対する、検証されていない支払いリクエストはサポートされていません。</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>無効な支払いリクエスト。</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>要求された支払額 %1 は少なすぎます (ダストとみなされてしまいます)。</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>%1 からの返金</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>支払リクエスト %1 は大きすぎます（%2バイトですが、%3バイトまでが許されています）。</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>%1: %2とコミュニケーション・エラーです</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>支払リクエストを読み込めませんでした！</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>サーバーの返事は無効 %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>ネットワーク・リクエストのエラーです</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>支払いは確認しました</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>ユーザエージェント</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>ノード・サービス</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>ノードID</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>送信</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>受信</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>総額</translation>\n    </message>\n    <message>\n        <source>Enter a Sugarchain address (e.g. %1)</source>\n        <translation>Sugarchainアドレスを入力してください (例 %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1日</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1秒</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>なし</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1ミリ秒</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n 秒</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n 分</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n 時間</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n 日</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n 週間</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 と %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n 年</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 はまだ安全に終了していません...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>未確認</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>エラー: 指定のデータ ディレクトリ \"%1\" は存在しません。</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>エラー: 設定ファイルをパースできません: %1。key=value という記法のみを利用してください。</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>エラー: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>画像を保存(&amp;S)</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>画像をコピー(&amp;C)</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>QR コードの保存</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG画像ファイル(*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>クライアントのバージョン</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>情報 (&amp;I)</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>デバッグ ウインドウ</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>一般</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>使用中のBerkleyDBバージョン</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>データディレクトリ</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>起動した日時</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>ネットワーク</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>名前</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>接続数</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>ブロック チェーン</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>現在のブロック数</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>メモリ・プール</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>現在のトランザクション数</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>メモリ使用量</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>リセット (&amp;R)</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>受信</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>送信</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>ピア (&amp;P)</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Banされたピア</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>詳しい情報を見たいピアを選択してください。</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>ホワイトリスト</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>方向</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>バージョン</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>開始ブロック</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>同期済みヘッダ</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>同期済みブロック</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>ユーザエージェント</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>現在のデータディレクトリから %1 のデバッグ用ログファイルを開きます。ログファイルが巨大な場合、数秒かかることがあります。</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>文字サイズを縮小</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>文字サイズを拡大</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>サービス</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Banスコア</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>接続時間</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>最終送信</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>最終受信</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping時間</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>現在実行中のpingにかかっている時間。</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping待ち</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>最小 Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>時間オフセット</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>最終ブロックの日時</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>開く (&amp;O)</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>コンソール (&amp;C)</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>ネットワーク (&amp;N)</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>合計</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>入力:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>出力:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>デバッグ用ログファイル</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>コンソールをクリア</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1時間 (&amp;H)</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1日 (&amp;D)</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1週間 (&amp;W)</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1年 (&amp;Y)</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>切断 (&amp;D)</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Banする:</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>Banを解除する (&amp;U)</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>%1 のRPCコンソールへようこそ。</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>上下の矢印で履歴をたどれます。%1でスクリーンを消去できます。</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>使用可能なコマンドを見るには %1 と入力します。</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>さらに情報を得たい方は、コンソールで  %1 を入力してください。</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>警告: 詐欺師が活動しており、ユーザに対してここにコマンドを入力させることでウォレットの中身を盗もうとしています。コマンドの結果を完全に理解していない限り、このコンソールは利用しないでください。</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>ネットワーク活動は無効化されました</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(ノードID: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>%1経由</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>一度もなし</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>内向き</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>外向き</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>はい</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>いいえ</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>未知</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>総額:(&amp;A)</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>ラベル(&amp;L):</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>メッセージ (&amp;M):</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Sugarchain network.</source>\n        <translation>支払リクエストが開始された時に表示される、支払リクエストに添える任意のメッセージです。注意：メッセージはSugarchainネットワークを通じて、支払と共に送られるわけではありません。</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>受取用アドレスに紐づく任意のラベル。</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>このフォームを使用して支払のリクエストを行いましょう。すべての項目は&lt;b&gt;任意入力&lt;/b&gt;です。</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>リクエストする任意の金額。特定の金額をリクエストするのでない場合には、この欄は空白のままかゼロにしてください。</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>全ての入力項目をクリア</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>クリア</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>支払リクエスト履歴</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>支払をリクエストする (&amp;R)</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>選択されたリクエストを表示する（項目をダブルクリックすることでも表示できます）</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>表示</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>リストから選択項目を削除</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>削除</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>URI をコピーする</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>ラベルをコピーする</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>メッセージをコピーする</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>総額のコピー</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR コード</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>URI をコピーする (&amp;U)</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>アドレスをコピーする (&amp;A)</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>画像を保存(&amp;S)</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>%1 への支払いリクエストを行う</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>支払い情報</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>アドレス</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>総額</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>メッセージ</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI が長くなり過ぎます。ラベルやメッセージのテキストを短くしてください。</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>QR コード用の URI エンコードでエラー。</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>日付</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>メッセージ</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>（ラベル無し）</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>（メッセージなし）</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(金額指定なし)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>要求</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>コインを送る</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>コインコントロール機能</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>入力...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>自動選択</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>残高不足です！</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>数量:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>バイト:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>総額:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>手数料:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>手数料差引後:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>釣り銭:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>これが有効にもかかわらずおつりアドレスが空欄であったり無効であった場合には、おつりは新しく生成されたアドレスへ送金されます。</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>カスタムおつりアドレス</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>トランザクション手数料：</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>選択……</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation> 代替料金を利用することで、承認されるまでに数時間または数日 (ないし一生承認されない) トランザクションを送信してしまう可能性があります。手動にて手数料を選択するか、完全なブロックチェーンの検証が終わるまで待つことを検討しましょう</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>警告: 手数料推定機能は現在利用できません。</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>手数料設定を折りたたむ</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>1キロバイトあたり手数料</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>カスタム手数料が1000satoshiに設定されている場合、トランザクションサイズが250バイトとすると、「1キロバイトあたり手数料」では250satoshiの手数料のみを支払いますが、「最小手数料」では1000satoshiを支払います。1キロバイトを超えるトランザクションの場合には、どちらの方法を選択したとしても1キロバイトあたりで支払われます。</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>隠す</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for sugarchain transactions than the network can process.</source>\n        <translation>ブロックの容量に比べてトランザクション流量が少ないうちは最小手数料のみの支払で十分です。しかしながらネットワークが処理しきれないほどsugarchainトランザクションの需要がひとたび生まれてしまった場合には、永遠に検証がされないトランザクションになってしまう可能性があることに注意してください。</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>（ツールチップをお読みください）</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>推奨：</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>カスタム：</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>（スマート手数料はまだ初期化されていません。これにはおおよそ数ブロックほどかかります……）</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>一度に複数の人に送る</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>受取人を追加 (&amp;R)</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>全ての入力項目をクリア</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>ダスト：</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>検証時間のターゲット:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Replace-By-Fee を有効</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>手数料の上乗せ(Replace-By-Fee: BIP-125を参照)によってトランザクションを送信した後でも手数料を上乗せすることができます。この機能を利用しない場合、予め手数料を多めに見積もっておかないと送金が遅れる可能性があります。</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>すべてクリア (&amp;A)</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>残高:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>送る操作を確認する</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>送金 (&amp;E)</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>数量をコピーする</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>総額のコピー</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>手数料をコピーする</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>手数料差引後の値をコピーする</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>バイト数をコピーする</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>ダストをコピーする</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>釣り銭をコピー</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 ブロック)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 から %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>送ってよろしいですか？</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>取引手数料として追加された</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>合計：　%1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>または</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>手数料は後から上乗せすることができます(Replace-By-Feeのシグナル: BIP-125を参照)。</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>BIP-125による手数料上乗せ機能を利用していません。</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>コインを送る確認</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>受取アドレスが不正です。再チェックしてください。</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>支払額は0より大きくないといけません。</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>額が残高を超えています。</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>%1 の取引手数料を含めると額が残高を超えています。</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>重複したアドレスが見つかりました: アドレスはそれぞれ一度のみ使用することができます。</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>トラザクションの作成に失敗しました!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>トランザクションは以下の理由により拒絶されました: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>%1 よりも高い手数料の場合、手数料が高すぎると判断されます。</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>支払いリクエストの期限が切れました。</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>要求手数料 %1 のみを支払う</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>%n ブロック以内に検証が開始されると予想されます。</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Sugarchain address</source>\n        <translation>警告：無効なSugarchainアドレスです</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>警告：未知のおつりアドレスです</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>カスタムおつりアドレスを確認</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>おつりとして指定されたアドレスはこのウォレットに属さないもののようです。このウォレットの一部またはすべての資産がこのアドレスへ送金されます。よろしいですか？</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>（ラベル無し）</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>金額(&amp;A):</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>送り先(&amp;T):</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>ラベル(&amp;L):</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>前に使用したアドレスを選ぶ</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>これは通常の支払です。</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address to send the payment to</source>\n        <translation>支払の送金先Sugarchainアドレス</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>クリップボードからアドレスを貼付ける</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>この項目を削除する</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less sugarchains than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>送金する金額から手数料が差し引かれます。受取人は数量フィールドで指定した量よりも少ないシュガーチェーンを受け取ります。受取人が複数いる場合には、手数料は均等割されます。</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>送金額から手数料を差し引く (&amp;U)</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>利用可能な残額を使用</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>メッセージ:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>これは未認証の支払いリクエストです。</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>これは認証済みの支払いリクエストです。</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>このアドレスに対するラベルを入力することで、使用済みアドレスの一覧に追加することができます</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the sugarchain: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Sugarchain network.</source>\n        <translation>sugarchain: URIに添付されていたメッセージです。これは参照用としてトランザクションとともに保存されます。注意：このメッセージはSugarchainネットワークを通して送信されるわけではありません。</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>支払先:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>メモ：</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>アドレス帳に追加するには、このアドレスのラベルを入力します</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>はい</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 をシャットダウンしています...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>このウィンドウが消えるまでコンピュータをシャットダウンしないで下さい。</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>署名 - メッセージの署名/検証</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>メッセージの署名 (&amp;S)</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive sugarchains sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>あなたの所有しているアドレスによりメッセージや合意書に署名をすることで、それらアドレスに対して送られたシュガーチェーンを受け取ることができることを証明できます。フィッシング攻撃により不正にあなたの識別情報を署名させられてしまうことを防ぐために、不明確なものやランダムなものに対して署名しないよう注意してください。合意することが可能な、よく詳細の記された文言にのみ署名するようにしてください。</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address to sign the message with</source>\n        <translation>メッセージを署名するSugarchainアドレス</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>前に使用したアドレスを選ぶ</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>クリップボードからアドレスを貼付ける</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>ここにあなたが署名するメッセージを入力します</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>署名</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>現在の署名をシステムのクリップボードにコピーする</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Sugarchain address</source>\n        <translation>この Sugarchain アドレスを所有していることを証明するためにメッセージに署名</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>メッセージの署名 (&amp;M)</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>入力項目の内容をすべて消去します</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>すべてクリア (&amp;A)</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>メッセージの検証 (&amp;V)</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>受取人のアドレスとメッセージ（改行やスペース、タブなども完全に一致するよう注意してください）および署名を以下に入力し、メッセージの署名を検証してください。中間者攻撃により騙されるのを防ぐため、署名対象のメッセージに書かれていること以上の意味を署名から読み取ろうとしないよう注意してください。これは署名作成者がこのアドレスで受け取ったことを証明するだけであり、トランザクションの送信権限を証明するものではないことに注意してください！</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address the message was signed with</source>\n        <translation>メッセージの署名に使われたSugarchainアドレス</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Sugarchain address</source>\n        <translation>指定された Sugarchain アドレスで署名されたことを保証するメッセージを検証</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>メッセージの検証 (&amp;M)</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>入力項目の内容をすべて消去します</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>署名を作成するには\"メッセージの署名\"をクリック</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>不正なアドレスが入力されました。</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>アドレスを確かめてからもう一度試してください。</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>入力されたアドレスに関連するキーがありません。</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>ウォレットのアンロックはキャンセルされました。</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>入力されたアドレスのプライベート キーが無効です。</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>メッセージの署名に失敗しました。</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>メッセージに署名しました。</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>署名がデコードできません。</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>署名を確認してからもう一度試してください。</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>署名はメッセージ ダイジェストと一致しませんでした。</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>メッセージの検証に失敗しました。</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>メッセージは検証されました。</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>%n 以上のブロックを開く</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>ユニット %1 を開く</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>%1 検証のトランザクションと衝突</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/オフライン</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/未検証, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>メモリプール内</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>メモリプール外</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>中止</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/未検証</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 確認</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>ステータス</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>まだブロードキャストが成功していません</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>%n ノードにブロードキャスト</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日付</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>ソース</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>生成された</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>送信</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>未確認</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>受信</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>自分のアドレス</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>監視限定</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>クレジット</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>あと %n ブロックで成熟します</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>承認されなかった</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>引き落とし額</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>総出金額</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>総入金額</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>取引手数料</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>正味金額</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>メッセージ</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>コメント</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>取引 ID</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>トランザクションの全体サイズ</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>出力インデックス</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>商人</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>生成されたコインは使う前に%1のブロックを完成させる必要があります。あなたが生成した時、このブロックはブロック チェーンに追加されるネットワークにブロードキャストされました。チェーンに追加されるのが失敗した場合、状態が\"不承認\"に変更されて使えなくなるでしょう。これは、別のノードがあなたの数秒前にブロックを生成する場合に時々起こるかもしれません。</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>デバッグ情報</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>取引</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>入力</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>総額</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>正しい</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>正しくない</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>ここでは取引の詳細を表示しています</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>%1 の詳細</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>日付</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>タイプ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>%n 以上のブロックを開く</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>ユニット %1 を開く</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>オフライン</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>未検証</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>中止</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>検証中（%2の推奨検証数のうち、%1検証が完了）</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>検証されました (%1 検証済み)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>衝突</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>未成熟（%1検証。%2検証完了後に使用可能となります）</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>このブロックは他のどのノードによっても受け取られないで、多分受け入れられないでしょう！</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>生成されましたが承認されませんでした</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>送り主</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>送り主</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>送り先</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>自分自身への支払い</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>発掘した</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>監視限定</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>（ラベル無し）</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>取引の状況。このフィールドの上にカーソルを置くと検証の数を表示します。</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>取引を受信した日時。</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>取引の種類。</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>監視限定アドレスがこのトランザクションに含まれているかどうか</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>ユーザ定義のトランザクションの意図や目的。</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>残高に追加または削除された総額。</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>すべて</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>今日</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>今週</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>今月</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>先月</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>今年</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>期間...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>送り主</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>送り先</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>自分自身</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>発掘した</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>その他</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>検索するアドレス、トランザクションID、またはラベルを入力してください</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>最小の額</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>取引の中止</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>トランザクション手数料を増額する</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>アドレスをコピーする</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>ラベルをコピーする</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>総額のコピー</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>取引 ID をコピー</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>生トランザクションをコピー</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>トランザクションの詳細すべてをコピー</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>ラベルの編集</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>取引の詳細を表示</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>トランザクション履歴をエクスポートする</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>テキスト CSV (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>検証済み</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>監視限定</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日付</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>タイプ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>アドレス</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>エクスポートに失敗しました</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>トランザクション履歴を %1 へ保存する際にエラーが発生しました。</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>エクスポートに成功しました</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>トランザクション履歴は正常に%1に保存されました。</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>期間:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>から</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>金額を表示する際の単位。クリックすることで他の単位を選択します。</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>ウォレットがロードされていません</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>コインを送る</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>手数料の引き上げエラー</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>トランザクション手数料の増額に失敗しました</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>手数料を増額してもよろしいですか？</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>現在の手数料:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>増加:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>新しい手数料:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>手数料の引き上げ確認</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>トランザクションを署名できませんでした。</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>トランザクションのコミットに失敗しました</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>エクスポート (&amp;E)</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>ファイルに現在のタブのデータをエクスポート</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>ウォレットのバックアップ</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>ウォレット データ (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>バックアップに失敗しました</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>ウォレットデータを%1へ保存する際にエラーが発生しました。</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>バックアップ成功</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>ウォレット データは正常に%1に保存されました。</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>オプション:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>データ ディレクトリの指定</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>ピア アドレスを取得するためにノードに接続し、そして切断します</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>あなた自身のパブリックなアドレスを指定</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>コマンドラインと JSON-RPC コマンドを許可</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>MITソフトウェアライセンスのもとで配布されています。付属のファイル %s または %s を参照してください</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>&lt;category&gt; が与えられなかった場合や &lt;category&gt; = 1 の場合には、すべてのデバッグ情報が出力されます。</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>剪定が最小値の %d MiB以下に設定されています。もっと大きな値を使用してください。</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>剪定: 最後のウォレット同期ポイントは、選定されたデータよりも過去のものとなっています。-reindexをする必要があります (剪定されたノードの場合、ブロックチェイン全体をダウンロードします)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>剪定モードでは再スキャンを行うことはできません。-reindexを指定し、ブロックチェイン全体を再ダウンロードする必要があります。</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>エラー：致命的な内部エラーが発生しました。詳細はdebug.logを参照してください</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>送信するトランザクションに付加する手数料 (%s/kB単位) (初期値: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>ブロックデータを剪定しています……</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>デーモンとしてバックグランドで実行しコマンドを許可</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>HTTPサーバを開始できませんでした。詳細はデバッグログをご確認ください。</translation>\n    </message>\n    <message>\n        <source>Sugarchain Yumekawa</source>\n        <translation>シュガーチェーンユメカワ</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>%s の開発者</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>十分なデータが蓄積されていない場合に手数料推定機能が利用する手数料レート (%s/kB) (デフォルト: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>トランザクションの中継を行っていない場合でも、ホワイトリストのピアから受け取った中継トランザクションは受け取るようにする (デフォルト: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>ネットワークとの接続を開始・維持するためにノードを手動で追加する(addnodeのRPCコマンドヘルプを参照)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>指定のアドレスへバインドし、その上で常にリッスンします。IPv6 は [ホスト名]:ポート番号 と表記します</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>データ ディレクトリ %s のロックを取得することができません。おそらく %s は実行中です。</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>特定の接続が利用できず、またaddrmanは外向き接続を見つけられませんでした。</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>特定のノードにのみ接続します: -connect=0オプションで自動接続を無効化します(このノードに対する接続ルールは-addnodeオプションで指定されるものと同様です)。</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>ウォレットの全トランザクションを削除し、これらを-rescanオプションを用いることで起動時にブロックチェインのデータのみからリカバリします。</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>%s の読み込みエラー! すべてのキーは正しく読み取れますが、取引データやアドレス帳のエントリが失われたか、正しくない可能性があります。</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>カテゴリに対してデバッグ情報を除外する。-debug=1 とともに用いることで、一つ以上の指定されたカテゴリを除くすべてのカテゴリのデバッグログを出力できる。</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>ウォレットの取引を変更する際にコマンドを実行 (cmd の %s は TxID に置換される)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>コンパクトブロック再構成のために追加のトランザクションをメモリ内に保管しておく (デフォルト: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>このブロックがブロックチェーン内に含まれていた場合には、このブロックおよびそれ以前のすべてのブロックを有効であるとみなし、スクリプトの検証を省略する (0ならすべてを検証、デフォルト: %s、テストネット: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>時間オフセット調整値のピア中央値に対する最大の許容値。ローカル時間の見込み値は、接続するピアにより前方ないし後方へ影響されます。(初期値: %u 秒)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>ひとつのウォレットトランザクションまたは生トランザクションで使用する合計手数料の最大値 (%s 単位)。低すぎる値を指定すると巨大なトランザクションの作成ができなくなります (規定値: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>あなたのPCの日付と時刻が正しいことを確認して下さい！ もしあなたの時計が正しくなければ %s が正確に動作しません。</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>%s が有用だと感じられた方はぜひプロジェクトへの貢献をお願いします。ソフトウェアのより詳細な情報については %s をご覧ください。</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>保有するピアアドレスが少ない場合、DNS ルックアップによりピアアドレスを問い合わせる (-connect を使っていない場合の初期値: 1)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>古いブロックの剪定 (削除) を有効にすることでストレージの必要量を削減する。これにより pruneblockchain RPC を呼び出すことで指定されたブロックを削除することができます。またターゲットサイズが MiB 単位で指定された場合には古いブロックの自動剪定が有効となります。このモードは -txindex および -rescan オプションと互換性がありません。警告: この設定を最有効化するにはすべてのブロックチェーンの再ダウンロードが必要となります。(デフォルト: 0 = ブロックの剪定を無効化する, 1 = RPC 経由での手動剪定を許可する, &gt;%u = MiB 単位で指定されたターゲットサイズを常に下回るようにブロックファイルを自動的に剪定する)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>ブロック生成時に取り込まれるトランザクションの最低手数料率 (%s/kB 単位)。(デフォルト: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>スクリプト検証スレッドを設定 (%uから%dの間, 0 = 自動, &lt;0 = たくさんのコアを自由にしておく, 初期値: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>ブロックのデータベースに未来の時刻のブロックが含まれています。これはおそらくお使いのコンピュータに設定されている日時が間違っていることを示しています。お使いのコンピュータの日時が本当に正しい場合にのみ、ブロックのデータベースの再構築を行ってください。</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>これはリリース前のテストビルドです - 各自の責任で利用すること - 採掘や商取引に使用しないでください</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>これは、このレベルにおいてダストよりもおつりが小さい場合に捨てられるトランザクション手数料です。</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>ブロックのリプレイができませんでした。-reindex-chainstate を用いてデータベースを再構築する必要があります。</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>データベースをフォーク前の状態に巻き戻せませんでした。ブロックチェーンを再ダウンロードする必要があります</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>リッスン ポートの割当に UPnP を使用 (初期値: リッスン中および-proxy が指定されていない場合は1)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>JSON-RPC 接続時のユーザ名とハッシュ化されたパスワード。&lt;userpw&gt; フィールドのフォーマットは &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;。標準的な Python スクリプトが share/rpcuser 内に含まれています。クライアントは通常の場合には rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; を利用して接続を行います。このオプションは複数回指定できます。</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>ウォレットがmempoolチェーン制限数を超えてトランザクションを作らないようにする (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>警告: ネットワークは完全に合意が取れていないようです。幾人かのマイナーに何らかの障害が発生しているようです。</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>警告: ピアと完全に合意が取れていないようです！このノードまたは他のノードのアップグレードが必要なようです。</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>シャットダウン時に mempool を保存し、再起動時にロードするかどうか (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>直近の100ブロックの内%dが予期しないバージョンを含んでいます</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s が壊れています。復旧にも失敗しました</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempoolは最低でも %d MB必要です</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt;は以下の値を指定できます：</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>外部からの接続を許可 (初期値:  -proxy または -connect を使用していない場合は1)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>ユーザエージェント文字列にコメントを</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>起動時に壊れたウォレットから秘密鍵を復旧することを試す</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>ブロック作成オプション:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>-%s アドレス '%s' を解決できません</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>チェイン選択オプション:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>おつりのインデックスが範囲外です</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>接続オプション：</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>破損したブロック データベースが見つかりました\n</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>デバッグ／テスト用オプション:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>ウォレットは読み込まず、ウォレットRPCコールを無効化する</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>ブロック データベースを今すぐ再構築しますか?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>&lt;address&gt;に対し、ハッシュブロックの公開を有効にする</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>&lt;address&gt; に対し、ハッシュトランザクションの公開を有効にする</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>&lt;address&gt; に対し、生ブロックの公開を有効にする</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>&lt;address&gt; に対し、生トランザクションの公開を有効にする</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>メモリプール内のトランザクションの置換を有効化する (デフォルト: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>%sの作成に失敗しました。このバージョンではHDウォレット以外を作成することはできません。</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>ブロック データベースの初期化中にエラー</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>ウォレットのデータベース環境 %s 初期化エラー!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>%s 読み込みエラー</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>%s 読み込みエラー: ウォレットが壊れました</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>%s の読み込みに失敗しました: ウォレットの読み込みにはより新しいバージョンの %s が必要です</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>ブロック データベースの読み込みエラー</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>ブロック データベースの開始エラー</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>エラー: ディスク容量不足!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>ポートのリッスンに失敗しました。必要であれば -listen=0 を使用してください。</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>初期化の途中でウォレットの再スキャンに失敗しました</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>インポートしています……</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>不正なブロックあるいは、生成されていないブロックが見つかりました。ネットワークの datadir が間違っていませんか?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>初期化時の健全性チェックに失敗しました。%s を終了します。</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>-%s=&lt;数量&gt; に対する不正な額: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>-discardfee=&lt;amount&gt; に対する不正な数量: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>不正な額 -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>トランザクションのメモリ・プールの総量を &lt;n&gt; メガバイト以下に維持する (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>P2Pアドレスを読み込んでいます...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>banリストを読み込んでいます...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>認証クッキーの場所 (デフォルト: )</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>使用可能なファイルディスクリプタが不足しています。</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>&lt;net&gt; (ipv4, ipv6 または onion) ネットワーク内のノードだけに接続する</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>このヘルプメッセージを表示し終了する</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>バージョンを表示し終了</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>剪定値は負の値に設定できません。</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>剪定モードは-txindexと互換性がありません。</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>チェイン状態およびブロックインデックスをディスク上の blk*.dat ファイルから再構築する</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>既にインデックスされたブロックからチェイン状態を再構築する</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>ブロックをリプレイしています...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>ブロックを巻き戻しています...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>手数料上乗せ(RBF)がオプトイン形式で有効化されているときRBFを利用してトランザクションを送信する (RPCコマンドのみ。初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>データベースのキャッシュサイズをメガバイトで設定 (%dから%d。初期値: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>ウォレットのファイルを指定　(データ・ディレクトリの中に)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>ソースコードは %s より入手可能です。</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>トランザクション手数料およびおつりの計算に失敗しました</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>このコンピュータの %s にバインドすることができません。おそらく %s は既に実行されています。</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>サポートされていない引数 -benchmark は無視されました。-debug=bench を使用してください。</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>サポートされていない引数 -debugnet は無視されました。-debug=net を使用してください。</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>サポートされていない引数 -tor が見つかりました。-onion を使用してください。</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>サポートされていないログカテゴリ %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>UTXOデータベースを更新しています</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>リッスンポートの割当に UPnP を使用 (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>テストチェインを利用する</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>ユーザエージェントのコメント (%s) には安全でない文字が含まれています。</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>ブロックの検証中...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>ウォレットのデバッグ・テスト用オプション:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>ウォレットが書き直される必要がありました: 完了するために %s を再起動します</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>ウォレットオプション：</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>指定したアクセス元からのJSON-RPC接続を許可する。有効な&lt;ip&gt;は、単一のIP (例 1.2.3.4)、ネットワーク/ネットマスク (1.2.3.4/255.255.255.0)、またはネットワーク/CIDR (1.2.3.4/24)です。このオプションは複数回指定できます。</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>指定されたアドレスおよび、そこに接続を行ってきたホワイトリストのピアに対してバインドを行います。IPv6の場合には [host]:port 表記を使用してください</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>umask 077 ではなく、システムのデフォルトパーミッションで新規ファイルを作成する (ウォレット機能が無効化されていた場合にのみ有効)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>自分のIPアドレスを解決する (規定値: リッスンをしており、-externalipまたは-proxyオプションが指定されていない場合は1)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>エラー: 内向きの接続をリッスンするのに失敗しました (エラー %s が返却されました)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>関連のアラートをもらってもすごく長いのフォークを見てもコマンドを実行 (コマンドの中にあるの%sはメッセージから置き換えさせる)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>トランザクションの中継、採掘および作成の際には、この値未満の手数料 (%s/kB単位) はゼロであるとみなす (デフォルト: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>paytxfee が設定されていなかった場合、平均して n ブロック以内にトランザクションが検証され始めるのに十分な手数料を含める (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>-maxtxfee=&lt;amount&gt; の数量の指定が不正です: '%s' (トランザクションが詰まってしまうのを防ぐため、少なくとも %s の最小中継手数料を指定しなければいけません)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>中継および採掘を行う際の、データ運送トランザクションの中のデータの最大サイズ (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>認証情報をプロキシー接続ごとにランダム化する。これによりTorストリーム分離をすることができます (規定値: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>手数料差引後のトランザクションの金額が小さすぎるため、送金できません。</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>ホワイトリストのピアはDoSによるアクセス禁止処理が無効化され、トランザクションは例えmempool内に既に存在していたとしても常にリレーされます。これは例えばゲートウェイに対して有用です</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>非剪定モードに戻るためには-reindexオプションを使用してデータベースを再構築する必要があります。これによりブロックチェイン全体の再ダウンロードが行われます。</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(規定値: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>公開 REST リクエストを許可する (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Tor秘匿サービスを自動的に作成する (初期値: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>SOCKS5 プロキシ経由で接続する</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>%s の読み込みエラー: HDウォレットが既に存在するため、HDウォレットを無効化できません</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>データベースの読み込みエラー。シャットダウンします。</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>チェインステートデータベースの更新エラー</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>起動時に外部の blk000??.dat ファイルからブロックをインポート</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>情報</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>無効な -onion アドレスまたはホスト名: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>無効な -proxy アドレスまたはホスト名: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>-paytxfee=&lt;amount&gt; に対する無効な数量です: '%s' (少なくとも %s でなければいけません)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>-whitelist に対する無効なネットマスクです: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>最大で &lt;n&gt; 個の孤立したトランザクションをメモリの中に保持する (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>-whitebind を用いてポートを指定する必要があります: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>ノード中継オプション:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPCサーバのオプション:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>システム上の制約から、-maxconnections を %d から %d に削減しました。</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>起動時に失ったウォレットの取引のブロック チェーンを再スキャン</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>トレース/デバッグ情報を debug.log ファイルの代わりにコンソールへ送る</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>すべてのデバッグオプションを表示する (使い方: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>クライアント起動時に debug.log ファイルを縮小 (初期値: -debug オプションを指定しない場合は1)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>取引の署名に失敗しました</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>トランザクションの金額が小さすぎて手数料を支払えません</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>これは実験的なソフトウェアです。</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Tor管理ポートのパスワード (初期値: 空文字)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Onion のリッスンが有効になっている場合に使用するTor管理ポート (初期値: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>取引の額が小さ過ぎます</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>手数料ポリシーに対してトランザクションが大きすぎます</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>取引が大き過ぎます</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>このコンピュータの %s にバインドすることができません (バインドが返したエラーは %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>初期化キーを生成できません</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>起動時にウォレットを最新のフォーマットにアップグレード</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>JSON-RPC 接続のユーザー名</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>ウォレットの確認中...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>ウォレット「%s」がウォレットフォルダ「%s」の外に存在します</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>警告: 未知の新しいルールが有効化されました (バージョンビット %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>ブロック限定モードにおいて動作を行うかどうか (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>-txindex を変更するには -reindex を使用してデータベースを再構築する必要があります</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>ウォレットからすべてのトランザクションを消去しています...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ通知オプション:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>JSON-RPC 接続のパスワード</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>最良のブロックに変更する際にコマンドを実行 (cmd の %s はブロック ハッシュに置換される)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>-addnode, -seednode と -connect で DNS ルックアップを許可する</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = トランザクションのメタデータ、例えばアカウントの所有者や支払リクエストの内容を保持する, 2 = トランザクションのメタデータを破棄する)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee が非常に高く設定されています！ひとつのトランザクションでこの量の手数料が支払われてしまうことがあります。</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>指定されたアドレスに対して JSON-RPC 接続をリッスンしするようバインドします。このオプションは -rpcallowip も指定されている場合以外には無視されます。ポートはオプションであり -rpcport をオーバーライドします。IPv6の場合には [host]:port 表記を使用してください。このオプションは複数回指定することが可能です (初期値: 127.0.0.1 および ::1、すなわち localhost または -rpcallowip が指定されている場合には 0.0.0.0 および ::、すなわちすべてのアドレス)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>mempool内でトランザクションを &lt;n&gt; 時間以上保持しない (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>中継や採掘を行う際のトランザクション内の、sigopあたりバイト数の相当量 (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>%s の読み込みエラー: 非HDウォレットが既に存在するため、HDウォレットを有効化できません</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>ウォレット %s の読み込みエラー。-wallet パラメータはファイル名だけを指定してください (パス名ではありません)。</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>トランザクション作成の際、この値未満の手数料 (%s/kB単位) はゼロであるとみなす (デフォルト: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>ホワイトリストのピアから受け取ったトランザクションに関しては、たとえローカルの中継ポリシーに違反しているとしても中継を行うようにする (デフォルト: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>-checkblocks のブロックの検証レベル (0-4, 初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>getrawtransaction rpc 呼び出し時に用いる、完全なトランザクションインデックスを保持する (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>不正なピアを再接続するまでの秒数 (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>デバッグ情報を出力する (初期値: %u, &lt;category&gt; の指定は任意です)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>非冗長モードで返却する生トランザクションやブロックの16進数表現のシリアライゼーションフォーマットを非 segwit (0) または segwit (1) のものに設定する (デフォルト: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>ウォレットを保持するディレクトリの指定 (初期値: &lt;datadir&gt;/wallets 存在する場合、その他の場合 &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>デバッグログファイルの位置の指定: 絶対パスまたはデータディレクトリからの相対パス (初期値: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Bloomフィルタによる、ブロックおよびトランザクションのフィルタリングを有効化する (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>おつりを捨てて手数料 (初期値: %s) に追加する場合に許容される手数料レート (%s/kB 単位)。注記: このレートで出力がダストだった場合には出力は捨てられますが、最も長いターゲットの手数料見積額で制限される、ダスト中継手数料および上記の放棄手数料までは常に捨てられます。</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>これは手数料の推定機能が利用できない場合に支払うトランザクション手数料です。</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>この製品はOpenSSLプロジェクトにより開発されたソフトウェアをOpenSSLツールキット %s として利用しています &lt;https://www.openssl.org/&gt;。また、Eric Young氏により開発された暗号ソフトウェア、Thomas Bernard氏により書かれたUPnPソフトウェアを用いています。</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>ネットワークバージョン文字 (%i) の長さが最大の長さ (%i) を超えています。UAコメントの数や長さを削減してください。</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>送信転送量を与えられた目標値以下に維持するようにする (24時間あたり何MiBかで指定)。0 の場合は無制限 (初期値: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>サポートされていない引数 -socks が見つかりました。SOCKSバージョンの設定はできないようになりました。SOCKS5プロキシのみがサポートされています。</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>サポートされていない引数 -whitelistalwaysrelay は無視されました。-whitelistrelay または -whitelistforcerelay を利用してください</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Tor 秘匿サービスを通し、別々の SOCKS5 プロキシを用いることでピアに到達する (初期値: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>警告: 未知のバージョンのブロックが採掘されました。未知のルールが導入された可能性があります</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>警告: ウォレットファイルが破損していましたのでデータを復旧しました！元の %s は %s として %s に保存されました; 残高やトランザクションが正しくない場合にはバックアップから復元してください。</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>ホワイトリストとして登録するピアノ、接続元の IP アドレス (例: 1.2.3.4) または CIDR 表現のネットワーク (例: 1.2.3.0/24)。複数回指定することもできる</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s の設定値は高すぎます</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(デフォルト: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>DNS ルックアップを通してピアアドレスを常に問い合わせる (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>ウォレット %s の読み込みエラー。-wallet のファイル名は通常のファイルでなければいけません。</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>ウォレット %s の読み込みエラー。重複する -wallet ファイル名が指定されました。</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>ウォレット %s の読み込みエラー。-walletファイル名内に無効な文字が含まれています。</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>起動時に点検するブロック数 (初期値: %u, 0=すべて)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>デバッグ出力にIPアドレスを含める (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>鍵プールが枯渇しました。まずはじめに keypoolrefill を呼び出してください</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>&lt;port&gt; で JSON-RPC 接続をリッスン (初期値: %u、testnet は %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>接続のリッスンを &lt;port&gt; で行う (初期値: %u、testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>ピアの接続数を最大でも &lt;n&gt; 個に維持する (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>ウォレットのトランザクションをブロードキャストする</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>接続毎の最大受信バッファ &lt;n&gt;*1000 バイト (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>接続毎の最大送信バッファ &lt;n&gt;*1000 バイト (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>デバッグ出力にタイムスタンプを付ける (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>データ運送トランザクションのリレーおよび採掘を行う (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>P2SHでないマルチシグトランザクションをリレーする (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>key pool のサイズを &lt;n&gt; (初期値: %u) にセット</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>BIP141ブロック重みの最大値を設定 (初期値: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>RPC サービスのスレッド数を設定 (初期値: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>設定ファイルの指定 (初期値: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>接続のタイムアウトをミリセコンドで指定 (最小値: 1, 初期値: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>pid ファイルの指定 (初期値: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>トランザクション送信時に未検証のおつりを使用する (デフォルト: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>ネットワークのスレッドを起動しています...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>ウォレットは最小中継手数料を下回る額の支払を拒否します。</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>これはすべてのトランザクションに対して最低限支払うべき手数料です。</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>これは取引を送信する場合に支払う取引手数料です。</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>不正なピアを切断するためのしきい値 (初期値: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>取引の額は負であってはいけません</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>トランザクションのmempoolチェインが長過ぎます</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>トランザクションは最低ひとつの受取先が必要です</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>-onlynet で指定された '%s' は未知のネットワークです</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>残高不足</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>ブロック インデックスを読み込んでいます...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>ウォレットを読み込んでいます...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>ウォレットのダウングレードはできません</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>再スキャン中...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>読み込み完了</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>エラー</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ja_JP.ts",
    "content": "<TS language=\"ja_JP\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>編集するためにアドレスもしくはラベルを右クリックします</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>新しいアドレスを作成します</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>新規</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>クリップボードに現在選択されているアドレスをコピーします</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;コピー</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;失敗</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>リストから現在選択中のアドレスを削除します</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>ファイルの現在のタブを出力します</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;出力</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;削除</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>送付するコインのアドレスを選択</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>受け取るコインのアドレスを選択</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>C&amp;選択</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>アドレス送信</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>アドレス受信</translation>\n    </message>\n    <message>\n        <source>These are your Sugarchain addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>支払送信するためのシュガーチェーンアドレスです。コインを送付する前に、いつも残高と受信アドレスの確認をしてください。</translation>\n    </message>\n    <message>\n        <source>These are your Sugarchain addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>支払の受信をするためのシュガーチェーンアドレスです。それぞれの処理に新規に受信アドレスを使用することを推奨します。</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;アドレスのコピー</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>コピー&amp;ラベル</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;編集</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>アドレス一覧の出力</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>カンマ区切りのファイル(*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>出力の失敗</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>%1のため、アドレス一覧の保存中のエラーが発生しました。もう一度、実行してください。</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>アドレス</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ラベルなし)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>パスフレーズダイヤログ</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>パスフレーズの入力</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>新規のパスフレーズ</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>新規パスフレーズの繰り返し</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>財布に新規パスフレーズの入力をします。&lt;br/&gt;パスフレーズを使ってください &lt;b&gt;10以上のランダム文字列&lt;/b&gt;もしくは &lt;b&gt;8以上の単語&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>財布を暗号化します</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>この操作は、財布のロックを解除するために財布のパスフレーズが必要です。</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>財布のロック解除</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>この操作は、財布を複合化するために財布のパスフレーズが必要です。</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>財布の復号化</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>パスフレーズの変更</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>財布に古いパスフレーズと新規パスフレーズを入力します。</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>財布の暗号化を確認します</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR SUGARCHAINS&lt;/b&gt;!</source>\n        <translation>注意: 財布の暗号化やパスフレーズを忘れた場合、 &lt;b&gt;あなたのシュガーチェーンはすべて失われます。&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>財布を暗号化してもよろしいですか？</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>暗号化された財布</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your sugarchains from being stolen by malware infecting your computer.</source>\n        <translation>暗号化処理を終了させるために、すぐに%1を閉じるでしょう。あなたのコンピュータに感染したマルウェアによって、盗まれたシュガーチェーンは暗号化をしていても完全に守ることができないことを覚えておいてください。</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>重要: 以前の財布ファイルのバックアップは、新しく作成された暗号化された財布ファイルに置き換えられるべきです。セキュリティの観点から、暗号化されていない以前の財布ファイルは、新しく暗号化された財布が利用開始になり次第、間もなく使用できなくなります。</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>財布の暗号化に失敗しました。</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>内部エラーにより財布の暗号化に失敗しました。財布は暗号化されていません。</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>提供されたパスフレーズは一致しません。</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>財布のロック解除に失敗しました。</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>財布の復号化のために入力されたパスフレーズが間違っています。</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>財布の復号化に失敗しました。</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>財布パスフレーズの変更に成功しました。</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>注意: CapsLockキーが有効になっています!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IPアドレス/ネットマスク</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>まで禁止</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>サイン &amp;メッセージ...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>ネットワークで同期中...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;概要</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>ノード</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>財布の一般概要を表示</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;処理</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>処理の履歴を見る</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>退出</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>アプリケーションを終了</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;%1について</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>%1についての情報を見る</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;Qtについて</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Qtについての情報を見る</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;オプション...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>%1のオプション設定を変更する</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;財布の暗号化...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;財布のバックアップ...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;パスフレーズの変更...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;アドレスの送信...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;アドレスの受信...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>オープン&amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>ネットワーク処理を無効にするためにクリックする</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>無効化されたネットワーク</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>再度、ネットワーク処理を有効化するために、クリック</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>ヘッダーを同期中 (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>ディスクのブロックの再インデックス中...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Sugarchain address</source>\n        <translation>シュガーチェーンアドレスにコインを送信</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>他の場所に財布をバックアップ</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>財布の暗号化に使用するパスフレーズを変更</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;デバッグ用ウィンドウ</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>デバッグと診断のコンソールを開く</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;メッセージの確認...</translation>\n    </message>\n    <message>\n        <source>Sugarchain</source>\n        <translation>シュガーチェーン</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>財布</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;送信</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;受信</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;表示/ 非表示</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>メインウィンドウの表示もしくは非表示</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>財布に属するプライベートキーの暗号化</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Sugarchain addresses to prove you own them</source>\n        <translation>所有者であることを証明するためにシュガーチェーンアドレスのメッセージにサイン</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Sugarchain addresses</source>\n        <translation>署名された特定のシュガーチェーンアドレスを確認するために、メッセージを確認</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;ファイル</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;設定</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;ヘルプ</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>ツールバータブ</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and sugarchain: URIs)</source>\n        <translation>支払の要求 (QRコードとシュガーチェーンのURIを作成)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>送信に使用したアドレスとラベルの一覧を表示</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>受信に使用したアドレスとラベルの一覧を表示</translation>\n    </message>\n    <message>\n        <source>Open a sugarchain: URI or payment request</source>\n        <translation>シュガーチェーンのURIまたは支払要求を開く</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;コマンドラインのオプション</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>ディスクのブロックのインデックス化中...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>ディスクのブロックの処理中...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1残り</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>最後の受信ブロックは%1前に生成されました。</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>トランザクション後も、これらは見えることはありません。</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>エラー</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>情報</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>更新日</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Sugarchain command-line options</source>\n        <translation>シュガーチェーンのコマンドラインオプションとして可能なリストの取得の%1ヘルプメッセージを表示</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>クライアント%1</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>ピアに接続中...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>追いつき中...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>日付: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>残高: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>タイプ: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>ラベル: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>アドレス: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>処理送信</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>処理受信</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HDキー世代は&lt;b&gt;有効化&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HDキー世代は&lt;b&gt;無効化&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>財布は&lt;b&gt;暗号化された&lt;/b&gt; そして現在 &lt;b&gt;ロック解除されています&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>財布は &lt;b&gt;暗号化され&lt;/b&gt; そして現在 &lt;b&gt;ロックされています&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Sugarchain can no longer continue safely and will quit.</source>\n        <translation>致命的なエラーが発生しました。シュガーチェーンは安全に終了することができません。</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>コイン選択</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>量:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>バイト:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>残高:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>手数料:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>ごみ:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>後の料金:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>変更:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>全て選択する（しない）</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>ツリー型</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>リストモード</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>残高</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>受信されたラベル</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>受信されたアドレス</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日付</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>確認</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>確認済み</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>アドレスのコピー</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>ラベルのコピー</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>残高のコピー</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>トランザクションIDのコピー</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>未消費のロック</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>未消費のロック解除</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>量をコピー</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>料金をコピー</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>後料金をこぴー</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>バイトをコピー</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>ゴミをコピー</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>変更をコピー</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 ロック済み)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>はい</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>いいえ</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>受信したレシピが現在のダスト閾値よりも残高が少ない場合、ラベルは赤になります。</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>入力ごとにsatoshiの+/- %1に変更できます。</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ラベルなし)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>%1 (%2)から変更</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(変更)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>アドレス編集</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;ラベル</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>ラベルに結合されたアドレスのリストエントリー</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>アドレスに結合されたアドレスリストのエントリーです。これは送信アドレスのみによって変更されます。</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;アドレス</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>新規の受信アドレス</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>新規の送信アドレス</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>受信アドレスを編集</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>送信アドレスの編集</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Sugarchain address.</source>\n        <translation>入寮されたアドレス \"%1\" は正当なシュガーチェーンアドレスではありません。</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>入浴されたアドレス \"%1\" はすでにアドレス帳にあります。</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>財布をロック解除できませんでした。</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>新規のキー生成に失敗しました。</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>新しい日付の辞書が作成されるでしょう。</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>名前</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>辞書はすでに存在しています。新しい辞書を作成する場合は、%1を追加してください。</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>パスはすでに存在しており、辞書ではありません。</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>ここに日付辞書を作成することはできません。</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>バージョン</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-ビット)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>%1について</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>コマンドラインオプション</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>使用方法:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>コマンドラインオプション:</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>UIオプション:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>起動の日付辞書の選択 (デフォルト: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>言語設定, 例 \"de_DE\" (デフォルト: システムロケール)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>最小化起動</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>支払要求のSSLルート証明の設定 (デフォルト: -システム-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>起動スクリーンを表示 (デフォルト: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>GUIのすべての設定をリセット</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>ようこそ</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>ようこそ  %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>プログラムの初回起動時なので、データの保存場所 %1を選択してください。</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>デフォルトデータ辞書を使用</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>カスタムデータ辞書を使用</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>エラー: 特定の辞書%1の作成に失敗しました。</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>エラー</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>フォーム</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the sugarchain network, as detailed below.</source>\n        <translation>最近のトランザクションが表示できない可能性があります。従って、ウォレットの残高が正しくない可能性があります。この情報はシュガーチェーンネットワークに接続し、同期処理を完了させると正しくなります。詳細は以下になります。</translation>\n    </message>\n    <message>\n        <source>Attempting to spend sugarchains that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>使用したシュガーチェーンで、未処理となっているものは、ネットワークによって受領されません。</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>残りのブロック数</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>不明...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>最後のブロック時間</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>実行</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>時間ごとの実行増加</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>計算中...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>同期化完了までの予測時間</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>隠す</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>不明. ヘッダーの同期中 (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>オープンURI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>URLもしくはファイルからの支払い要求を開く</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>支払い要求ファイルの選択</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>開く支払い要求ファイルを選択</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>オプション</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;メイン</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>システムログイン時に%1を自動的に開始</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;システムログインで%1を開始</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>&amp;データベース喝取のサイズ</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>メガバイト</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>&amp;認証スレッドスクリプトの数</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside</source>\n        <translation>外部からの接続承認</translation>\n    </message>\n    <message>\n        <source>Allow incoming connections</source>\n        <translation>内部接続の許可</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP プロキシのアドレス (例 IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>ウィンドウが閉じられた時、アプリケーションを終了せずに最小化します。オプションボタンが有効な時は、アプリケーションはメニューの終了が選択されら時のみ、終了します。</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>サードパーティのURL(例 a block explorer)はコンテキストメニューアイテムの処理タブに表示されます。YRLの%sは処理ハッシュによって置き換えられます。複数URLは水平バー | によって区切られます。</translation>\n    </message>\n    <message>\n        <source>Third party transaction URLs</source>\n        <translation>サードパティ処理URL</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>オプション上書きのコマンドラインオプションの有効化</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>全てのクライアントオプションをデフォルトにリセット</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;リセットオプション</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;ネットワーク</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = 自動, &lt;0 = 使用しないコア数)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>ウォレット</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>専門家</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>コインと制御機能の有効化</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>認証されていない変更の支出を無効化した場合、その変更を含む処理はすべての認証が完了するまで、使用することはできません。また、これは残高の計算にも影響します。</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;認証されていない変更の支払い</translation>\n    </message>\n    <message>\n        <source>Automatically open the Sugarchain client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>自動絵的にルータのシュガーチェーンのクライアントポートが開きます。この機能はルータがUPnPをサポートし、有効であるときに動作します。</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>&amp;UPnPを使用してポート配置します。</translation>\n    </message>\n    <message>\n        <source>Connect to the Sugarchain network through a SOCKS5 proxy.</source>\n        <translation>SOCKS5プロキシを使用してシュガーチェーンネットワークへ接続</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;SOCKS5プロキシを使用して接続 (デフォルト プロキシ):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>プロキシ &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;ポート:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>プロキシのポート (例 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>ピア経由での使用:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Sugarchain network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Tor秘匿ネットワークのための区切られたSOCKS5を経由して、シュガーチェーンネットワークに接続</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Tor匿名サービスを経由して到達ピアへ、区切られたSOCKS5 プロキシを使用:</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;画面</translation>\n    </message>\n    <message>\n        <source>&amp;Hide the icon from the system tray.</source>\n        <translation>&amp;システムトレイのアイコンを非表示.</translation>\n    </message>\n    <message>\n        <source>Hide tray icon</source>\n        <translation>トレイアイコンを非表示</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>画面最小化時にトレイアイコンを表示する。</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;ツールバーの代わりにトレイへ最小化</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>クローズで最小化</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;画面</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>ユーザインターフェース &amp;言語:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>ユーザインタフェースの言語はここで設定されます。設定は%1を再起動後、有効になります。</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;残高表示の単位:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>コイン送付時のインターフェースに表示するデフォルトの除算単位の選択</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>コイン制御機能を表示するかどうか。</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;キャンセル</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>デフォルト</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>なし</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>オプションリセットの確認</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>変更を有効にするため、クライアントの再起動が必要です。</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>クライアントは停止します。継続してもよろしいでしょうか？</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>変更は、クライアントの再起動が必要になる場合があります。</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>提供されたプロキシアドレスは無効です。</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>フォーム</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Sugarchain network after a connection is established, but this process has not completed yet.</source>\n        <translation>表示されている情報は、期限切れの可能性があります。ウォレットは自動的にシュガーチェーンネットワークへの接続が確立した後に同期化されます。しかし、処理はまだ、完了していません。</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>読み取り専用:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>有効:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>現在の支払い可能な残高</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>未決定:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>全てのトランザクションはまだ、確認されておらず、支払い可能な残高も数えられていません。</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>未完成:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>まだ、完成していない、採掘された残高</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>残高</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>合計:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>現在の合計残高</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>読み取り専用アドレス内の現在の残高</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>支払い可能:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>最近の処理</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>読み取り専用アドレスへの未確認の処理</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>まだ、完成していない、読み取り専用アドレスの中の発掘された残高</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>読み取り専用アドレス内の現在の合計残高</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>支払い要求エラー</translation>\n    </message>\n    <message>\n        <source>Cannot start sugarchain: click-to-pay handler</source>\n        <translation>シュガーチェーンを開始できません: click-to-pay handler</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI ハンドリング</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>取得した支払要求は無効です: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>無効な支払アドレス %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Sugarchain address or malformed URI parameters.</source>\n        <translation>URLはパースできませんでした! 原因はシュガーチェーンアドレスが無効であるか、URIパラメータの形式が間違っている可能性があります。</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>支払要求ファイル操作</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>支払要求ファイルが読み込めませんでした! 支払要求ファイルが無効である可能性があります。</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>支払要求却下</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>支払要求ネットワークはクライアントネットワークと一致しませんでした。</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>支払要求期限切れ</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>支払要求は初期化されていません。</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>カスタム支払スクリプトへの未検証の支払要求は、サポートされていません。</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>無効な支払要求:</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>要求支払額%1は小さすぎます (ダストを検討してください).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>%1からの払い戻し</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>支払要求 %1 は大きすぎます (%2 バイト, %3 バイトまで許可).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>通信エラー:%1 :%2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>支払要求は解析できませんでした!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>サーバ%1からの不正なレスポンス</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>ネットワーク要求エラー</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>認証済み支払</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>ユーザエージェント</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>ノード/サービス</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>ノードID</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>残高</translation>\n    </message>\n    <message>\n        <source>Enter a Sugarchain address (e.g. %1)</source>\n        <translation>シュガーチェーンアドレスの入力 (例 %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>なし</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>該当なし</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 と %2</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 は安全に終了できませんでした...</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>エラー: 特定の日付辞書 \"%1\" は存在しません。</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>エラー: 構成ファイルが解析できませんでした: %1. キー=値の構文のみが使用できます。</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>エラー: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;イメージ保存...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;イメージコピー</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>QRコード保存</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNGイメージ(*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>該当なし</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>クライアントバージョン</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;情報</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>デバッグ画面</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>一般</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>BerkeleyDBバージョンの使用</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>データディレクトリ</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>開始時間</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>ネットワーク</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>名前</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>接続数</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>ブロックチェーン</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>現在のブロック数</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>メモリプール</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>現在の処理数</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>メモリ使用量</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>受信済み</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>送信済み</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;ピア</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>禁止ピア</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>詳細情報を表示するピアの選択</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>ホワイトリスト済み</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>方向</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>バージョン</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>ブロック開始中</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>同期化されたヘッダー</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>同期化されたブロック</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>ユーザエージェント</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>現在のデータ辞書から%1デバッグログファイルを開きます。ログファイルが大きいため、数秒かかります。</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>フォントサイズの縮小</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>フォントサイズの拡大</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>サービス</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>禁止スコア</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>接続時間</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>最後の送信</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>最終受信</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping時間</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>現在の異常なpingの間隔</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>ping待ち</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>ping最小時間</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>時間オフセット</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>最後のブロック時間</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;開く</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;コンソール</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;ネットワークトラヒック</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>合計</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>入力:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>出力:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>デバッグログファイル</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>コンソールのクリア</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;時</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;日</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;週</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;年</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;切断</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>禁止の</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;禁止しない</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>%1 RPCコンソールへようこそ</translation>\n    </message>\n    <message>\n        <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source>\n        <translation>&lt;b&gt;help&lt;/b&gt; と入力すると有効なコマンドが表示されます。</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>無効化されたネットワーク利用</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 バイト</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 キロバイト</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 メガバイト</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 Gギガバイト</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(ノードid: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation> %1経由</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>いままでない</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>流入</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>流出</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>はい</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>いいえ</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>未知</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;残高:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;ラベル:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;メッセージ:</translation>\n    </message>\n    <message>\n        <source>Reuse one of the previously used receiving addresses. Reusing addresses has security and privacy issues. Do not use this unless re-generating a payment request made before.</source>\n        <translation>前回使用された受信アドレスを再利用します。再度アドレスを使用することは、セキュリティとプライバシーの問題になります。再度支払要求を事前に再生成しない限り、これを使用しないようにしてください。</translation>\n    </message>\n    <message>\n        <source>R&amp;euse an existing receiving address (not recommended)</source>\n        <translation>&amp;再度存在している受信アドレスを死闘する(非推奨)</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Sugarchain network.</source>\n        <translation>支払要求に添付されたオプションメッセージは、要求を開いたときに表示されます。メモ: メッセージは、シュガーチェーンネットワーク上で支払と一緒に送信されません。</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>新規受信アドレスと関連するオプションラベル</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>支払要求のための形式を使用してください。すべてのフィールドは&lt;b&gt;オプション&lt;/b&gt; です。</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>要求のためのオプション残高。特定の金額の要求をしないときは空か0を入力します。</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>入力形式の全てのフィールドをクリア</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>クリア</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>支払要求履歴</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;支払要求</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>選択された要求の表示。(空をダブルクリックしたときと同じ)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>表示</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>リストから選択されたエントリの削除</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>削除</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>コピーURI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>ラベルのコピー</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>メッセージコピー</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>残高のコピー</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QRコード</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>&amp;URIコピー</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;アドレスコピー</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;イメージ保存...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>%1のための支払要求</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>支払情報</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>アドレス</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>残高</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>メッセージ</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URIが長すぎるので、ラベルまたはメッセージを短くしてください。</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>QRコードのURIのコード化エラー</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>日付</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>メッセージ</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ラベルなし)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(メッセージなし)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(料金要求なし)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>要求済み</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>コイン送付</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>コイン制御機能</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>入力...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>自動的に選択される</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>残高不十分!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>量:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>バイト:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>残高:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>手数料:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>後の料金:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>変更:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>これが有効化されていて変更アドレスが空または無効でない時、変更は新しく生成されたアドレスへ送信されます。</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>カスタム変更アドレス</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>処理費用:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>選択...</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>料金設定を折りたたむ</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>キロバイトごと</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>カスタム料金が1000 satoshiで処理が250バイトのみの場合、料金はキロバイトあたりは250 satoshiのみとなり、最新の合計は1000 satoshiまで支払います。処理が1キロバイトよりも大きい場合、キロバイトごとに支払いが行われます。</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>隠す</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for sugarchain transactions than the network can process.</source>\n        <translation>最小の料金のみ支払いは、ブロック内の処理容量よりも小さい場合に限り、問題ありません。しかし、ネットワークの処理できる量よりも、シュガーチェーン処理のほうが需要があり、最終的にその確認処理が実行されないことに注意する必要があります。</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(ツールチップを読む)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>推奨:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>カスタム:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(スマート料金は初期化されていません。通常であれば数ブロックかかります...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>一度に複数の受信者に送信します</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>追加&amp;受信者</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>入力形式の全てのフィールドをクリア</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>ごみ:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>目標時間の確認:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>クリア&amp;全て</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>残高:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>送信実行の確認</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;送信</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>量をコピー</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>残高のコピー</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>料金をコピー</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>後料金をこぴー</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>バイトをコピー</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>ゴミをコピー</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>変更をコピー</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%2から%1</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>送信してもよろしいですか？</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>処理料金として追加済み</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>合計残高: %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>もしくは</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>送信コイン確認</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>受信者アドレスは無効です。再度確認してください。</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>支払料金は0より大きい必要があります。</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>料金が残高を超えています。</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>%1の処理料金を含めると、合計が残高を超えます。</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>重複アドレスの発見: アドレスはそれぞれ一つずつ使用される必要があります。</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>処理の作成に失敗しました!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>処理は次の理由により却下されました: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>料金が%1より高い場合、非常識に高い料金として考えられます。</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>支払要求期限切れ</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>%1の必須料金のみ支払う</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Sugarchain address</source>\n        <translation>注意: 無効なシュガーチェーンアドレス</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>注意: 未知の変更アドレス</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>カスタム変更アドレスの確認</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>変更のために選択したアドレスは、ウォレットの一部ではありません。ウォレット内の一部またはすべて料金はこのアドレスで送付される必要があります。実行してもよろしいでしょうか？</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ラベルなし)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;残高:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>支払&amp;宛先:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;ラベル:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>前回使用したアドレスの選択</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>これは通常の支払です。</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address to send the payment to</source>\n        <translation>支払に送信するシュガーチェーンアドレス</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>クリップボードからアドレスを貼り付ける</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>入力の削除</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less sugarchains than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>料金は送信料金から控除されます。受信者は入力された料金よりも低い金額を受け取ります。複数の受信者を選択した場合、この料金は同額に分けられます。</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>&amp;残高から料金を差し引く</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>メッセージ:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>これは未証明の支払要求です。</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>これは証明済みの支払要求です。</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>使用されたアドレス一覧のために、このアドレスのラベルを入力します。</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the sugarchain: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Sugarchain network.</source>\n        <translation>参考資料に保存された処理のシュガーチェーンURIは、メッセージに添付されます。メモ: このメッセージはシュガーチェーン上で送信されません。</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>支払先:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>メモ:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>アドレス帳にアドレスを追加すためのラベルの入力</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>はい</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1は停止中です...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>この画面が消えるまで、コンピュータを停止しないでください。</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>署名 - サイン / メッセージの確認</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;署名メッセージ</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive sugarchains sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>送信されたシュガーチェーンを受信できることを証明するために、アドレスのメッセージや同意事項に署名できます。フィッシング攻撃が署名を利用する可能性があるので、署名が曖昧やランダムでないことに注意してください。詳細な明細のみに署名されます。</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address to sign the message with</source>\n        <translation>メッセージ署名するためのシュガーチェーンアドレス</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>前回使用したアドレスの選択</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>クリップボードからアドレスを貼り付ける</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>ここに署名をするメッセージを入力</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>署名</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>システムのクリップボードへ現在の署名をコピー</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Sugarchain address</source>\n        <translation>シュガーチェーンアドレスを証明するために、メッセージに署名</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>署名&amp;メッセージ</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>全ての署名フィールドをリセット</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>クリア&amp;全て</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;メッセージ確認</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>以下のメッセージを確認して、受信者のアドレス、メッセージ（タブやすスペースなどを正確にこぴーしてください）、署名を入力してください。中間の攻撃者からのアタックを避けるために、署名されていないメッセージを読まないように注意してください。署名はアドレスと受信を証明することはできますが、送信者の処理を証明できないことに注意してください。</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address the message was signed with</source>\n        <translation>メッセージのシュガーチェーンアドレスはサインされています</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Sugarchain address</source>\n        <translation>特定のシュガーチェーンアドレスと署名されているメッセージであることを確認してください。</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>確認&amp;メッセージ</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>全ての確認フィールドをリセット</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>署名を生成するため、\"署名メッセージ\"をクリック</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>入力されたアドレスは無効です。</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>アドレスを確認して、再実行してください。</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>入力されたアドレスは鍵と関連がありません。</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>ウォレットのロック解除は中断されました。</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>入力されたプライベートキーは無効です。</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>メッセージの署名は失敗しました。</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>メッセージに署名しました。</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>署名は復号化できませんでした。</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>署名を確認して、再実行してください。</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>署名は、メッセージダイジェストと一致しませんでした。</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>メッセージ確認は失敗しました。</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>メッセージは確認されました。</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>キロバイト/秒</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>%1まで開く</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>処理と%1確認が矛盾しています。</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/オフライン</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/未確認, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>メモリプール中</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>メモリプール外</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>放棄</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/未確認</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 確認</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>状態</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>まだ、散布に成功していません</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日付</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>ソース</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>生成済み</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>送信元</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>不明</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>送信先</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>自アドレス</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>読み取り専用</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>信用</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>承認拒否</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>デビット</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>デビットの合計</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>合計クレジット</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>処理料金</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>ネット残高</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>メッセージ</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>コメント</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>処理ID</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>処理合計サイズ</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>出力インデックス</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>商人</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>残高</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>日付</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>%1まで開く</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>読み取り専用</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ラベルなし)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>アドレスのコピー</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>ラベルのコピー</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>残高のコピー</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>トランザクションIDのコピー</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>カンマ区切りのファイル(*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>確認済み</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日付</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ラベル</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>アドレス</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>出力の失敗</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>コイン送付</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;出力</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>ファイルの現在のタブを出力します</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Information</source>\n        <translation>情報</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>エラー</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ka.ts",
    "content": "<TS language=\"ka\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>დააჭირეთ მარჯვენა ღილაკს მისამართის ან იარლიყის ჩასასწორებლად</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>ახალი მისამართის შექმნა</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>შექმ&amp;ნა</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>მონიშნული მისამართის კოპირება სისტემურ კლიპბორდში</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;კოპირება</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;დახურვა</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>მონიშნული მისამართის წაშლა სიიდან</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>ამ ბარათიდან მონაცემების ექსპორტი ფაილში</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;ექსპორტი</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;წაშლა</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>აირჩიეთ კოინების გამგზავნი მისამართი</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>აირჩიეთ კოინების მიმღები მისამართი</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;არჩევა</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>გამმგზავნი მისამართ</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>მიმღები მისამართი</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>ეს არის თქვენი ბიტკოინ-მისამართები, რომელთაგანაც შეგიძლიათ გადახდა. აუცილებლად შეამოწმეთ თანხა და მიმღები მისამართი გაგზავნამდე.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>ეს არის თქვენი ბიტკოინ-მისამართები, რომლებზეც შეგიძლიათ მიიღოთ თანხები. რეკომენდებულია ყოველი ტრანსაქციისათვის ახალი მიმღები მისამართის გამოყენება.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>მისამართის კოპირება</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>ნიშნულის კოპირება</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;რედაქტირება</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>მისამართების სიის ექსპორტი</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>CSV ფორმატის ფაილი (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>ექპორტი ვერ განხორციელდა</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>მისამართების სიის %1 შენახვა ვერ მოხერხდა. გაიმეორეთ მცდელობა.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ნიშნული</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>მისამართი</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ნიშნული არ არის)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>ფრაზა-პაროლის დიალოგი</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>შეიყვანეთ ფრაზა-პაროლი</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>ახალი ფრაზა-პაროლი</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>გაიმეორეთ ახალი ფრაზა-პაროლი</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>აკრიფეთ ახალი პასფრაზა საფულისათვის.&lt;br/&gt; გამოიყენეთ &lt;b&gt;ათი ან მეტი შემთხვევითი სიმბოლოსაგან &lt;/b&gt;, ან &lt;b&gt;რვა ან მეტი სიტყვისაგან&lt;/b&gt; შემდგარი პასფრაზა.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>საფულის დაშიფრვა</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>ამ ოპერაციის შესასრულებლად საჭიროა თქვენი საფულის განბლოკვა პასფრაზით.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>საფულის განბლოკვა</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>ამ ოპერაციის შესასრულებლად საჭიროა თქვენი საფულის განშიფრვა პასფრაზით.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>საფულის განბლოკვა</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>პაროლის შეცვლა</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>აკრიფეთ ძველი და ახალი პასფრაზები საფულისათვის.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>საფულის დაშიფრვის დადასტურება</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>გაფრთხილება: თუ თქვენ დაშიფრავთ თქვენს საფულეს და ამის შემდეგ დაკარგავთ გასაშიფრ ფრაზას, &lt;b&gt;თქვენ დაკარგავთ ყველა ბიტკოინს!&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>დარწმუნებული ხარ რომ საფულის დაშიფვრა გსურს?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>საფულე დაშიფრულია</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>საფულის დაშიფვრა წარუმატებით დამთვრდა</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>საფულის გახსნა წარუმატებლად შესრულდა</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>საფულის გაშიფვრა ვერ შესრულდა</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>ხელ&amp;მოწერა</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>ქსელთან სინქრონიზება...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>მიმ&amp;ოხილვა</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>კვანძი</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>საფულის ზოგადი მიმოხილვა</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;ტრანსაქციები</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>ტრანსაქციების ისტორიის დათვალიერება</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;გასვლა</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>გასვლა</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>%1-ის &amp;შესახებ</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>%1-ის შესახებ ინფორმაციის ჩვენება</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;Qt-ს შესახებ</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>ინფორმაცია Qt-ს შესახებ</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;ოპციები</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>%1-ის კონფიგურირების პარამეტრების რედაქტირება</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>საფულის &amp;დაშიფრვა</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>საფულის &amp;არქივირება</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>ფრაზა-პაროლის შე&amp;ცვლა</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>გაგზავნის მი&amp;სამართი</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>მიღების მისამა&amp;რთი</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>&amp;URI-ის გახსნა...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>დისკზე ბლოკების რეინდექსაცია...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>მონეტების გაგზავნა Bitcoin-მისამართზე</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>საფულის არქივირება სხვა ადგილზე</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>საფულის დაშიფრვის ფრაზა-პაროლის შეცვლა</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>და&amp;ხვეწის ფანჯარა</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>დახვეწისა და გიაგნოსტიკის კონსოლის გაშვება</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;ვერიფიკაცია</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>საფულე</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;გაგზავნა</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;მიღება</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;ჩვენება/დაფარვა</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>მთავარი ფანჯრის ჩვენება/დაფარვა</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>თქვენი საფულის პირადი გასაღებების დაშიფრვა</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>მესიჯებზე ხელმოწერა თქვენი Bitcoin-მისამართებით იმის დასტურად, რომ ის თქვენია</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>შეამოწმეთ, რომ მესიჯები ხელმოწერილია მითითებული Bitcoin-მისამართით</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;ფაილი</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;პარამეტრები</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;დახმარება</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>ბარათების პანელი</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>გადახდის მოთხოვნა (შეიქმნება QR-კოდები და bitcoin: ბმულები)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>გამოყენებული გაგზავნის მისამართებისა და ნიშნულების სიის ჩვენება</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>გამოყენებული მიღების მისამართებისა და ნიშნულების სიის ჩვენება</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>bitcoin: URI-ის ან გადახდის მოთხოვნის გახსნა</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>საკომანდო სტრიქონის ოპ&amp;ციები</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 გავლილია</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>ბოლო მიღებული ბლოკის გენერირებიდან გასულია %1</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>შემდგომი ტრანსაქციები ნაჩვენები ჯერ არ იქნება.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>შეცდომა</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>გაფრთხილება</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>ინფორმაცია</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>განახლებულია</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 კლიენტი</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>შეერთება ქსელთან...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>ჩართვა...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>თარიღი: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>რაოდენობა^ %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>ტიპი: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>ლეიბლი: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>მისამართი: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>გაგზავნილი ტრანსაქციები</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>მიღებული ტრანსაქციები</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>საფულე &lt;b&gt;დაშიფრულია&lt;/b&gt; და ამჟამად &lt;b&gt;განბლოკილია&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>საფულე &lt;b&gt;დაშიფრულია&lt;/b&gt; და ამჟამად &lt;b&gt;დაბლოკილია&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>რაოდენობა:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>ბაიტები:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>თანხა:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>საკომისიო:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>მტვერი:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>დამატებითი საკომისიო:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>ხურდა:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>ყველას მონიშვნა/(მოხსნა)</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>განტოტვილი</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>სია</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>თანხა</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>თარიღი</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>დადასტურება</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>დადასტურებულია</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>მისამართის კოპირება</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>ლეიბლის კოპირება</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>რაოდენობის კოპირება</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>დაუხარჯავის ჩაკეტვა</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>დიახ</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>არა</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ნიშნული არ არის)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(ხურდა)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>მისამართის შეცვლა</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>ნიშნუ&amp;ლი</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>მისამართების სიის ამ ჩანაწერთან ასოცირებული ნიშნული</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>მისამართების სიის ამ ჩანაწერთან მისამართი ასოცირებული. მისი შეცვლა შეიძლება მხოლოდ გაგზავნის მისამართის შემთხვევაში.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>მის&amp;ამართი</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>შეიქმნება ახალი მონაცემთა კატალოგი.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>სახელი</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>კატალოგი უკვე არსებობს. დაამატეთ %1 თუ გინდათ ახალი კატალოგის აქვე შექმნა.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>მისამართი უკვე არსებობს და არ წარმოადგენს კატალოგს.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>კატალოგის აქ შექმნა შეუძლებელია.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>ვერსია</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-ბიტი)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>%1-ის შესახებ</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>კომანდების ზოლის ოპციები</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>გამოყენება:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>კომანდების ზოლის ოპციები</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>მომხმარებლის ინტერფეისის ოპციები:</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>მოგესალმებით</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>კეთილი იყოს თქვენი მობრძანება %1-ში.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>ნაგულისხმევი კატალოგის გამოყენება</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>მითითებული კატალოგის გამოყენება:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>შეცდომა</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>ფორმა</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>უცნობი...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>ბოლო ბლოკის დრო</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>პროგრესი</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>მიმდინარეობს გამოთვლა...</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>დამალვა</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>URI-ის გახსნა</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>გადახდის მოთხოვნის შექმნა URI-იდან ან ფაილიდან</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>გადახდის მოთხოვნის ფაილის არჩევა</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>ოპციები</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;მთავარი</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>მონაცემთა ბაზის კეშის სი&amp;დიდე</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>სკრიპტის &amp;ვერიფიცირების ნაკადების რაოდენობა</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>პროქსის IP-მისამართი (მაგ.: IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>საკომანდო სტრიქონის აქტიური ოპციები, რომლებიც გადაფარავენ ზემოთნაჩვენებს:</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>კლიენტის ყველა პარამეტრის დაბრუნება ნაგულისხმევ მნიშვნელობებზე.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>დაბ&amp;რუნების ოპციები</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;ქსელი</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>ს&amp;აფულე</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>ექსპერტი</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>დაუდასტურებელი ხურდის გამოყენების აკრძალვის შემდეგ მათი გამოყენება შეუძლებელი იქნება, სანამ ტრანსაქციას არ ექნება ერთი დასტური მაინც. ეს აისახება თქვენი ნაშთის დათვლაზეც.</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>როუტერში Bitcoin-კლიენტის პორტის ავტომატური გახსნა. მუშაობს, თუ თქვენს როუტერს ჩართული აქვს UPnP.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>პორტის გადამისამართება &amp;UPnP-ით</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>პროქსის &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;პორტი</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>პროქსის პორტი (მაგ.: 9050)</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;ფანჯარა</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>ფანჯრის მინიმიზებისას მხოლოდ იკონა სისტემურ ზონაში</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;მინიმიზება სისტემურ ზონაში პროგრამების პანელის ნაცვლად</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>მ&amp;ინიმიზება დახურვისას</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;ჩვენება</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>სამომხმარებ&amp;ლო ენა:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>ერთეუ&amp;ლი:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>აირჩიეთ გასაგზავნი თანხის ნაგულისხმევი ერთეული.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>ვაჩვენოთ თუ არა მონეტების მართვის პარამეტრები.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;გაუქმება</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>ნაგულისხმევი</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>ცარიელი</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>დაადასტურეთ პარამეტრების დაბრუნება ნაგულისხმევზე</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>ცვლილებები ძალაში შევა კლიენტის ხელახალი გაშვების შემდეგ.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>შეცდომა</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>ამ ცვლილებების ძალაში შესასვლელად საჭიროა კლიენტის დახურვა და ხელახალი გაშვება.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>პროქსის მისამართი არასწორია.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>ფორმა</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>ნაჩვენები ინფორმაცია შეიძლება მოძველებული იყოს. თქვენი საფულე ავტომატურად სინქრონიზდება Bitcoin-ის ქსელთან კავშირის დამყარების შემდეგ, ეს პროცესი ჯერ არ არის დასრულებული.</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>ხელმისაწვდომია:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>თქვენი ხელმისაწვდომი ნაშთი</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>იგზავნება:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>დასადასტურებელი ტრანსაქციების საერთო რაოდენობა, რომლებიც ჯერ არ არის ასახული ბალანსში</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>მოუმზადებელია:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>მოპოვებული თანხა, რომელიც ჯერ არ არის მზადყოფნაში</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>სულ:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>თქვენი სრული მიმდინარე ბალანსი</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>თანხა</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 სთ</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 წთ</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>მიუწვდ.</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 და %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>უცნობია</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>მიუწვდ.</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>კლიენტის ვერსია</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;ინფორმაცია</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>დახვეწის ფანჯარა</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>საერთო</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>სტარტის დრო</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>ქსელი</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>სახელი</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>შეერთებების რაოდენობა</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>ბლოკთა ჯაჭვი</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>ბლოკების მიმდინარე რაოდენობა</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>ბოლო ბლოკის დრო</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;შექმნა</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;კონსოლი</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;ქსელის ტრაფიკი</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>სულ:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>შემომავალი:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>გამავალი:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>დახვეწის ლოგ-ფაილი</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>კონსოლის გასუფთავება</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>თ&amp;ანხა:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>ნიშნუ&amp;ლი:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;მესიჯი:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>არააუცილებელი მესიჯი, რომელიც ერთვის გადახდის მოთხოვნას და ნაჩვენები იქნება მოთხოვნის გახსნისას. შენიშვნა: მესიჯი არ გაყვება გადახდას ბითქოინის ქსელში.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>არააუცილებელი ნიშნული ახალ მიღების მისამართთან ასოცირებისათვის.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>გამოიყენეთ ეს ფორმა გადახდის მოთხოვნისათვის. ყველა ველი &lt;b&gt;არააუცილებელია&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>მოთხოვნის მოცულობა. არააუცილებელია. ჩაწერეთ 0 ან დატოვეთ ცარიელი, თუ არ მოითხოვება კონკრეტული მოცულობა.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>ფორმის ყველა ველის წაშლა</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>წაშლა</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>მოთხოვნილი გადახდების ისტორია</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;გადახდის მოთხოვნა</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>არჩეული მოთხოვნის ჩვენება (იგივეა, რაც ჩანაწერზე ორჯერ ჩხვლეტა)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>ჩვენება</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>მონიშნული ჩანაწერების წაშლა სიიდან</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>წაშლა</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>ლეიბლის კოპირება</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>რაოდენობის კოპირება</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-კოდი</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>&amp;URI-ის კოპირება</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>მის&amp;ამართის კოპირება</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>გამო&amp;სახულების შენახვა...</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>მისამართი</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ნიშნული</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ნიშნული</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ნიშნული არ არის)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>მონეტების გაგზავნა</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>მონეტების კონტროლის პარამეტრები</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>ხარჯები...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>არჩეულია ავტომატურად</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>არ არის საკმარისი თანხა!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>რაოდენობა:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>ბაიტები:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>თანხა:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>საკომისიო:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>დამატებითი საკომისიო:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>ხურდა:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>ამის გააქტიურებისას თუ ხურდის მისამართი ცარიელია ან არასწორია, ხურდა გაიგზავნება ახლად გენერირებულ მისამართებზე.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>ხურდის მისამართი</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>ტრანსაქციის საფასური - საკომისიო:</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>დამალვა</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>გაგზავნა რამდენიმე რეციპიენტთან ერთდროულად</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;რეციპიენტის დამატება</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>ფორმის ყველა ველის წაშლა</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>მტვერი:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>გ&amp;ასუფთავება</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>ბალანსი:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>გაგზავნის დადასტურება</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>გაგ&amp;ზავნა</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>რაოდენობის კოპირება</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ნიშნული არ არის)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;რაოდენობა</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>ადრესა&amp;ტი:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>ნიშნუ&amp;ლი:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>აირჩიეთ ადრე გამოყენებული მისამართი</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>ეს არის ჩვეულებრივი გადახდა.</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>მისამართის ჩასმა კლიპბორდიდან</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>ჩანაწერის წაშლა</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>მესიჯი:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>შეიყვანეთ ამ მისამართის ნიშნული გამოყენებული მისამართების სიაში დასამატებლად</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>მესიჯი, რომელიც თან ერთვის მონეტებს:  URI, რომელიც შეინახება ტრანსაქციასთან ერთად თქვენთვის. შენიშვნა: მესიჯი არ გაყვება გადახდას ბითქოინის ქსელში.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>ადრესატი:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>შენიშვნა:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>არ გამორთოთ კომპიუტერი ამ ფანჯრის გაქრობამდე.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>ხელმოწერები - მესიჯის ხელმოწერა/ვერიფიკაცია</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>მე&amp;სიჯის ხელმოწერა</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>აირჩიეთ ადრე გამოყენებული მისამართი</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>მისამართის ჩასმა კლიპბორდიდან</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>აკრიფეთ ხელმოსაწერი მესიჯი</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>ხელმოწერა</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>მიმდინარე ხელმოწერის კოპირება კლიპბორდში</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>მოაწერეთ ხელი იმის დასადასტურებლად, რომ ეს მისამართი თქვენია</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>&amp;მესიჯის ხელმოწერა</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>ხელმოწერის ყველა ველის წაშლა</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>გ&amp;ასუფთავება</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>მესიჯის &amp;ვერიფიკაცია</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>შეამოწმეთ, რომ მესიჯი ხელმოწერილია მითითებული Bitcoin-მისამართით</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>&amp;მესიჯის ვერიფიკაცია</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>ვერიფიკაციის ყველა ველის წაშლა</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>ტრანსაქციის დაწვრილებითი აღწერილობა</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ნიშნული</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ნიშნული არ არის)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>მისამართის კოპირება</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>ლეიბლის კოპირება</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>რაოდენობის კოპირება</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>CSV ფორმატის ფაილი (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ნიშნული</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>მისამართი</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>ექპორტი ვერ განხორციელდა</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>ოპციები:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>მიუთითეთ მონაცემთა კატალოგი</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>მიერთება კვანძთან, პირების მისამართების მიღება და გათიშვა</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>მიუთითეთ თქვენი საჯარო მისამართი</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>საკომანდო სტრიქონისა და JSON-RPC-კომამდების ნებართვა</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>რეზიდენტულად გაშვება და კომანდების მიღება</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>მოცემულ მისამართზე მიჯაჭვა მუდმივად მასზე მიყურადებით. გამოიყენეთ [host]:port ფორმა IPv6-სათვის</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>კომანდის შესრულება საფულის ტრანსაქციის ცვლილებისას (%s კომანდაში ჩანაცვლდება TxID-ით)</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; შეიძლება იყოს:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>გარედან შეერთებების დაშვება (ნაგულისხმევი: 1 თუ არ გამოიყენება -proxy ან -connect)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>ბლოკის შექმნის ოპციები:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>შენიშნულია ბლოკთა ბაზის დაზიანება</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>არ ჩაიტვირთოს საფულე და აიკრძალოს საფულისადმი RPC-მიმართვები</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>გავუშვათ ბლოკთა ბაზის ხელახლა აგება ეხლა?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>ვერ ინიციალიზდება ბლოკების ბაზა</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>ვერ ინიციალიზდება საფულის ბაზის გარემო %s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>არ იტვირთება ბლოკების ბაზა</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>ბლოკთა ბაზის შექმნა ვერ მოხერხდა</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>შეცდომა: დისზე არ არის ადგილი!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>ვერ ხერხდება პორტების მიყურადება. თუ გსურთ, გამოიყენეთ -listen=0.</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>საწყისი ბლოკი არ არსებობს ან არასწორია. ქსელის მონაცემთა კატალოგი datadir ხომ არის არასწორი?</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>არ არის საკმარისი ფაილ-დესკრიპტორები.</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>მიუთითეთ საფულის ფაილი (კატალოგში)</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>ბლოკების ვერიფიკაცია...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>სფულის ოპციები:</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>ბრძანების შესრულება შესაბამისი უწყების მიღებისას ან როცა შეინიშნება საგრძნობი გახლეჩა (cmd-ში %s შეიცვლება მესიჯით)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>ინფორმაცია</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>ტრასირების/დახვეწის ინფოს გაგზავნა კონსოლზე debug.log ფაილის ნაცვლად</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>debug.log ფაილის შეკუმშვა გაშვებისას (ნაგულისხმევია: 1 როცა არ აყენია -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>ტრანსაქციების ხელმოწერა ვერ მოხერხდა</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>ტრანსაქციების რაოდენობა ძალიან ცოტაა</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>ტრანსაქცია ძალიან დიდია</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>მომხმარებლის სახელი JSON-RPC-შეერთებისათვის</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>გაფრთხილება</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>საჭიროა ბაზის ხელახალი აგება, გამოიყენეთ -reindex რათა შეცვალოთ -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>ტრანსაქციების ჩახსნა საფულიდან...</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>პაროლი JSON-RPC-შეერთებისათვის</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>კომანდის შესრულება უკეთესი ბლოკის გამოჩენისას (%s კომანდაში ჩანაცვლდება ბლოკის ჰეშით)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>DNS-ძებნის დაშვება -addnode, -seednode და -connect-სათვის</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>-onlynet-ში მითითებულია უცნობი ქსელი: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>არ არის საკმარისი თანხა</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>ბლოკების ინდექსის ჩატვირთვა...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>საფულის ჩატვირთვა...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>საფულის ძველ ვერსიაზე გადაყვანა შეუძლებელია</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>სკანირება...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>ჩატვირთვა დასრულებულია</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>შეცდომა</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_kk_KZ.ts",
    "content": "<TS language=\"kk_KZ\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Жаңа адрес енгізу</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>Жаңа</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Таңдаған адресті тізімнен жою</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Жабу</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Экспорт</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>Жою</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Құпия сөзді енгізу</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Жаңа құпия сөзі</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Жаңа құпия сөзді қайта енгізу</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Транзакциялар</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Шығу</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>Параметрлері</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Әмиянды жасыру</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Құпия сөзді өзгерту</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Биткоин</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Әмиян</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>Жіберу</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>Алу</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>Файл</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>Көмек</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 қалмады</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>қате</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Ескерту</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Информация</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Жаңартылған</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>Саны</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Комиссия</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Шаң</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Комиссия алу кейін</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Саны</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Күні</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Растау саны</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Растық</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>&amp;Label</source>\n        <translation>таңба</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>Адрес</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Биткоин</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>қате</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Әмиян</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>қате</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Саны</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 немесе %2</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Информация</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Саны</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>Саны</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Комиссия:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Комиссия алу кейін:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Шаң</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Саны</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Information</source>\n        <translation>Информация</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Транзакция өте кішкентай</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Транзакция өте үлкен</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Ескерту</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>қате</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_km_KH.ts",
    "content": "<TS language=\"km_KH\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>ចុចខាងស្តាំដើម្បីកែអាស្រយដ្ឋាន​ ឬ ស្លាក</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>  បង្កើតអាស្រយដ្ឋានថ្មីមួយ</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;ថ្មី</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>ចម្លងអាសយដ្ឋានដែលបានរើស</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;ចម្លង</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;បិទ</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>លុប​អាសយដ្ឋានដែល​បាន​រើស​ពី​បញ្ជី</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;នាំចេញ</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;លុប</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>អាសយដ្ឋានផ្ញើ</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>អាសយដ្ឋានទទួួល</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Address</source>\n        <translation>អាសយដ្ឋាន</translation>\n    </message>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>បញ្ចូលពាក្យសម្ងាត់</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>ពាក្យសម្ងាត់ថ្មី</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>វាយពាក្យសម្ងាត់ម្ដងទៀត</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>ដោះសោរកាបូបលុយ</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>ប្ដូរពាក្យសម្ងាត់</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>បរាជ័យដោះសោរកាបូប</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>Banned Until</source>\n        <translation>ផ្អាកដល់</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>ផ្ញើកាក់ទៅកាន់ អាសយដ្ឋាន Bitcoin មួយ</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>កាបូប</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>អាសយដ្ឋាន</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Address</source>\n        <translation>អាសយដ្ឋាន</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;នាំចេញ</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ko.ts",
    "content": "<TS language=\"ko\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>마우스 오른쪽 클릭을 해서 라벨이나 주소를 편집할 수 있습니다</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>새로운 주소 발급받기</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>선택된 주소 클립보드에 붙여넣기</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;복사</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>선택한 주소 리스트에서 삭제</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>현재 탭의 데이터를 파일로 내보냅니다</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;내보내기</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;삭제하기</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>코인을 보낼 주소를 선택하세요</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>코인을 받을 주소를 선택하세요</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>보낼 주소</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>받을 주소</translation>\n    </message>\n    <message>\n        <source>These are your Sugarchain addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>이것은 슈가체인 전송을 위한 주소입니다. 코인을 보내기 전에 항상 받는 주소와 수량을 확인하세요</translation>\n    </message>\n    <message>\n        <source>These are your Sugarchain addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>이것은 슈가체인 수신을 위한 주소입니다. 코인을 받을 때 마다 항상 다른 주소를 사용 하시는 것을 권장합니다.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;주소 복사</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;편집</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>주소 목록 내보내기</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>내보내기 실패</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>주소 목록을 %1 로 저장하는 작업이 실패했습니다. 다시 시도해 주세요.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>암호문 입력</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>새 암호문</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>비밀번호 보이기</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>새 암호문을 지갑에 입력합니다. &lt;br/&gt;이러한 형식의 암호문을 사용해 주십시요.&lt;b&gt;10개 이상의 임의 문자&lt;/b&gt; 또는 &lt;b&gt;8개 이상의 단어&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>지갑 암호화</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>이 작업을 수행하려면 지갑을 잠금 해제 할 암호문이 필요합니다.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>지갑 잠금 해제</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>이 작업을 수행하려면 지갑을 복호화할 암호문이 필요합니다.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>지갑 복호화</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>암호문 변경</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>예전 암호문과 변경할 암호문을 입력하십시요.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>지갑 암호화 확인</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR SUGARCHAINS&lt;/b&gt;!</source>\n        <translation>경고: 지갑이 암호화된 상태로 당신의 암호문을 잃어버리셨다면, 당신은 &lt;b&gt;모든 슈가체인을 잃게됩니다&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>진짜로 지갑을 암호화 할까요?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>지갑 암호화</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your sugarchains from being stolen by malware infecting your computer.</source>\n        <translation>%1 이(가) 암호화 작업을 위해 종료됩니다. 이 암호화 작업이 바이러스로부터 슈가체인을 완전히 지키지 못한다는 점을 기억하십시요.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>중요: 예전에 만들었던 모든 백업 파일은 새로 만들어진 암호화된 지갑 파일으로 교체됩니다. 보안을 위해서 예전에 만들었던 암호화 되지 않은 백업 파일은 당신이 새로 암호화된 지갑을 사용하고 사용할 수 없게 됩니다. </translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>지갑 암호화 실패</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>내부 오류로 인해 지갑 암호화가 실패했습니다. 지갑이 암호화 되지 않았습니다.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>입력한 암호문이 일치하지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>지갑 잠금 해제 실패</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>지갑 복호화를 위한 암호문이 일치하지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>지갑 복호화 실패</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>지갑 암호문이 성공적으로 변경되었습니다.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>주의: Caps Lock이 켜져있습니다!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>네트워크와 동기화중...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;개요</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>노드</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>지갑의 일반적인 개요 표시</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;거래</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>거래 기록 보기</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>애플리케이션 종료</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;%1에 대해</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>%1에 대한 정보 표시</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;Qt에 대해</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Qt에 대한 정보 표시</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;설정...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>%1에 대한 구성 수정</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;지갑 암호화...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;지갑 백업...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;암호문 변경...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;보낼 주소...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;받을 주소...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>클릭해서 네트워크 활동 중지</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>네트워크 활동 중지</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>클릭해서 네트워크 활동 활성화</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>헤더 동기화 (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>디스크에서 블럭 불러오는 중</translation>\n    </message>\n    <message>\n        <source>Send coins to a Sugarchain address</source>\n        <translation>슈가체인 주소로 코인 보내기</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>이 지갑을 다른 곳으로 백업</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>내보내기 실패</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;내보내기</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>현재 탭의 데이터를 파일로 내보냅니다</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>송금액은 마이너스가 될 수 없습니다</translation>\n    </message>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ko_KR.ts",
    "content": "<TS language=\"ko_KR\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>지갑 주소나 라벨을 수정하시려면 우클릭하세요.</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>새 주소 만들기</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>새 항목(&amp;N)</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>현재 선택한 주소를 시스템 클립보드로 복사하기</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>복사(&amp;C)</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>닫기(&amp;L)</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>현재 목록에 선택한 주소 삭제</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>현재 탭에 있는 데이터를 파일로 내보내기</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>내보내기(&amp;E)</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>삭제(&amp;D)</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>코인을 보내실 주소를 선택하세요</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>코인을 받으실 주소를 선택하세요</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>선택 (&amp;H)</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>보내는 주소들</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>받은 주소들</translation>\n    </message>\n    <message>\n        <source>These are your Sugarchain addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>슈가체인을 보내는 계좌 주소입니다. 코인을 보내기 전에 잔고와 받는 주소를 항상 확인하세요.</translation>\n    </message>\n    <message>\n        <source>These are your Sugarchain addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>슈가체인을 받을 수 있는 계좌 주소입니다. 매 거래마다 새로운 주소 사용을 권장합니다. </translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>계좌 복사(&amp;C)</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>라벨 복사(&amp;L)</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>편집 (&amp;E)</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>주소 목록 내보내기</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>쉼표로 구분된 파일 (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>내보내기 실패</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>%1으로 주소 리스트를 저장하는 동안 오류가 발생했습니다. 다시 시도해주세요.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>라벨</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>주소</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(라벨 없음)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>암호문 대화상자</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>암호 입력하기</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>새로운 암호</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>새로운 암호 재확인</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>비밀번호 표시</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>지갑에 새로운 비밀문구를 입력하세요.&lt;br/&gt;비밀문구를 &lt;b&gt;열 개 이상의 무작위 글자&lt;/b&gt; 혹은 &lt;b&gt;여덟개 이상의 단어로&lt;b&gt; 정하세요.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>지갑 암호화</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>이 작업을 실행하려면 사용자 지갑의 암호가 필요합니다.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>지갑 잠금해제</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>이 작업은 지갑을 해독하기 위해 사용자 지갑의 암호가 필요합니다.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>지갑 복호화</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>암호 변경</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>지갑의 기존 암호와 새로운 암호를 입력해주세요.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>지갑 암호화 승인</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR SUGARCHAINS&lt;/b&gt;!</source>\n        <translation>경고: 만약 암호화 된 지갑의 비밀번호를 잃어버릴 경우, &lt;b&gt;모든 슈가체인들을 잃어버릴 수 있습니다&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>지갑 암호화를 정말로 하시겠습니까?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>지갑 암호화 완료</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your sugarchains from being stolen by malware infecting your computer.</source>\n        <translation>암호화 처리 과정을 끝내기 위해 %1을 종료합니다. 지갑 암호화는 컴퓨터의 멀웨어 감염으로 인한 슈가체인 도난을 완전히 방지할 수는 없습니다.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>중요: 본인 지갑 파일에서 만든 예전 백업들은 새로 생성한 암호화된 지갑 파일로 교체됩니다. 보안상 이유로 이전에 암호화하지 않은 지갑 파일 백업은 사용할 수 없게 되니 이른 시일 내로 새로 암호화된 지갑을 사용하시기 바랍니다.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>지갑 암호화 실패</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>지갑 암호화는 내부 에러로 인해 실패했습니다. 당신의 지갑은 암호화 되지 않았습니다.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>지정한 암호가 일치하지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>지갑 잠금해제 실패</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>지갑 해독을 위한 암호가 틀렸습니다.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>지갑 복호화 실패</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>지갑 비밀번호가 성공적으로 변경되었습니다.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>경고: Caps Lock키가 켜져있습니다!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP주소/넷마스크</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>다음과 같은 상황이 될 때까지 차단됩니다.</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>메시지 서명(&amp;M)...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>네트워크와 동기화중...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>개요(&amp;O)</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>노드</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>지갑의 일반적 개요를 보여줍니다.</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>거래(&amp;T)</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>거래내역을 검색합니다.</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>나가기(&amp;X)</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>어플리케이션 종료</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>%1 정보(&amp;A)</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>%1 정보를 표시합니다</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;Qt 정보</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Qt 정보를 표시합니다</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>옵션(&amp;O)</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>%1 설정 옵션 수정</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>지갑 암호화(&amp;E)...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>지갑 백업(&amp;B)...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>암호문 변경(&amp;C)...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>보내는 주소(&amp;S)</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>받는 주소(&amp;R)</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>&amp;URI 열기...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>네트워크 활동을 중지하려면 클릭.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>네트워크 활동이 정지됨.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>네트워크 활동을 다시 시작하려면 클릭.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>헤더 동기화중 (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>디스크에서 블록 다시 색인중...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Sugarchain address</source>\n        <translation>슈가체인 주소로 코인 전송</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>지갑을 다른장소에 백업</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>지갑 암호화에 사용되는 암호를 변경합니다</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>디버그 창(&amp;D)</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>디버깅 및 진단 콘솔을 엽니다</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>메시지 확인(&amp;V)...</translation>\n    </message>\n    <message>\n        <source>Sugarchain</source>\n        <translation>슈가체인</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>지갑</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>보내기(&amp;S)</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>받기(&amp;R)</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>보이기/숨기기(&amp;S)</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>메인창 보이기 또는 숨기기</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>지갑에 포함된 개인키 암호화하기</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Sugarchain addresses to prove you own them</source>\n        <translation>지갑 주소가 본인 소유인지 증명하기 위해 슈가체인 주소에 서명할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Sugarchain addresses</source>\n        <translation>슈가체인 주소의 전자 서명 확인을 위해 첨부된 메시지가 있을 경우 이를 검증할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>파일(&amp;F)</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>설정(&amp;S)</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>도움말(&amp;H)</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>툴바 색인표</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and sugarchain: URIs)</source>\n        <translation>지불 요청하기 (QR코드와 슈가체인이 생성됩니다: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>한번 이상 사용된 보내는 주소와 주소 제목의 목록을 보여줍니다.</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>한번 이상 사용된 받는 주소와 주소 제목의 목록을 보여줍니다.</translation>\n    </message>\n    <message>\n        <source>Open a sugarchain: URI or payment request</source>\n        <translation>sugarchain: URI 또는 지불요청 열기</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>명령줄 옵션(&amp;C)</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Sugarchain network</source>\n        <translation><numerusform>슈가체인 네트워크에 %n개의 연결이 활성화되어 있습니다.</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>디스크에서 블록 색인중...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>디스크에서 블록 처리중...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n 블록 만큼의 거래 기록이 처리됨.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 뒤에</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>최근에 받은 블록은 %1 전에 생성되었습니다.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>이 후의 거래들은 아직 보이지 않을 것입니다.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>오류</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>경고</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>정보</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>현재까지</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Sugarchain command-line options</source>\n        <translation>사용할 수 있는 슈가체인 명령줄 옵션 목록을 가져오기 위해 %1 도움말 메시지를 표시합니다.</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 클라이언트</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>피어에 연결중...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>블록 따라잡기...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>날짜: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>금액: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>종류: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>라벨: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>주소: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>거래 보내기</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>들어오고 있는 거래</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD 키 생성이 &lt;b&gt;활성화되었습니다&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD 키 생성이 &lt;b&gt;비활성화되었습니다&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>지갑이 &lt;b&gt;암호화&lt;/b&gt; 되었고 현재 &lt;b&gt;잠금해제&lt;/b&gt; 되었습니다</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>지갑이 &lt;b&gt;암호화&lt;/b&gt; 되었고 현재 &lt;b&gt;잠겨져&lt;/b&gt; 있습니다</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Sugarchain can no longer continue safely and will quit.</source>\n        <translation>치명적인 오류가 발생했습니다. 슈가체인을 더이상 안전하게 진행할 수 없어 곧 종료합니다.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>코인 선택</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>수량:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>바이트:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>금액:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>수수료:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>더스트:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>수수료 이후:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>잔돈:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>모두 선택(하지 않음)</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>트리 모드</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>리스트 모드</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>거래액</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>입금과 함께 수신된 라벨</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>입금과 함께 수신된 주소</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>날짜</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>확인</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>확인됨</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>주소 복사</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>라벨 복사</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>거래액 복사</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>거래 아이디 복사</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>사용되지 않은 주소를 잠금 처리합니다.</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>사용되지 않은 주소를 잠금 해제합니다. </translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>수량 복사</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>수수료 복사</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>수수료 이후 복사</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>bytes 복사</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>더스트 복사</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>잔돈 복사</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 잠금)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>예</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>아니요</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>수령인이 현재 더스트 임계값보다 작은 양을 수신하면 이 라벨이 빨간색으로 변합니다.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>입력마다 +/- %1 사토시(s)가 변할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(라벨 없음)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>%1로부터 변경 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(잔돈)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>주소 편집</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>라벨(&amp;L)</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>현재 선택된 주소 필드의 제목입니다. </translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>본 주소록 입력은 주소와 연계되었습니다.  이것은 보내는 주소들에서만 변경될수 있습니다.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>주소(&amp;A)</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>새 받는 주소</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>새 보내는 주소</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>받는 주소 편집</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>보내는 주소 편집</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Sugarchain address.</source>\n        <translation>입력한 \"%1\" 주소는 올바른 슈가체인 주소가 아닙니다.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>입력된 주소는\"%1\" 이미 주소록에 있습니다.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>지갑을 잠금해제 할 수 없습니다.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>새로운 키 생성이 실패하였습니다.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>새로운 데이터 폴더가 생성됩니다.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>이름</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>폴더가 이미 존재합니다. 새로운 폴더 생성을 원한다면 %1 명령어를 추가하세요. </translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>경로가 이미 존재합니다. 그리고 그것은 폴더가 아닙니다.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>데이터 폴더를 여기 생성할 수 없습니다.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>버전</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-비트)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>%1 정보(&amp;A)</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>명령줄 옵션</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>사용법:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>명령줄 옵션</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>UI 옵션:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>실행시 데이터 폴더 선택하기 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>\"ko_KR\"와 같이 언어를 설정하십시오 (기본값: 시스템 로컬)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>최소화된 상태에서 시작</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>지불 요청을 위한 SSL 루트 인증서 설정 (기본값: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>실행시 시작화면 보기 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>GUI를 통해 수정된 모든 설정을 초기화</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>환영합니다</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>%1를 설치해 주셔서 감사합니다.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>프로그램이 처음으로 실행되고 있습니다. %1가 어디에 데이터를 저장할지 선택할 수 있습니다. </translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>확인을 클릭하면 %1은 모든 %4 블록 체인 (%2GB) 장부를 다운로드하고 검증하기 시작합니다. 이는 %3년에 %4이 시작될 때 생성된 가장 오래된 트랜잭션부터 시작합니다.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>초기 동기화는 매우 오래 걸리며 이전에는 본 적 없는  하드웨어 문제가 발생할 수 있습니다. %1을 실행할 때마다 중단 된 곳에서 다시 계속 다운로드 됩니다.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>블록 체인 저장 영역 (블록축소)을 제한하도록 선택한 경우, 이력 데이터는 계속해서 다운로드 및 처리 되어야 하지만 차후 디스크 용량을 줄이기 위해 삭제됩니다.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>기본 데이터 폴더를 사용하기</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>커스텀 데이터 폴더 사용:</translation>\n    </message>\n    <message>\n        <source>Sugarchain</source>\n        <translation>슈가체인</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>최소 %1GB의 데이터가 이 디렉토리에 저장되며 시간이 지남에 따라 증가 할 것입니다.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>약 %1GB의 데이터가 이 디렉토리에 저장됩니다.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Sugarchain block chain.</source>\n        <translation>%1은 Sugarchain 블록 체인의 사본을 다운로드하여 저장합니다.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>지갑도 이 디렉토리에 저장됩니다.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>오류: \"%1\" 지정한 데이터 디렉토리를 생성할 수 없습니다.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>오류</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB 사용가능</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(%n GB가 필요)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>유형</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the sugarchain network, as detailed below.</source>\n        <translation>최근 거래는 아직 보이지 않을 것입니다, 그러므로 당신의 지갑의 잔액이 틀릴 수도 있습니다. 이 정보는 슈가체인 네트워크와 완전한 동기화가 완료되면 아래의 설명과 같이 정확해집니다.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend sugarchains that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>아직 표시되지 않은 거래의 영향을 받는 슈가체인을 사용하려고 하는 것은 네트워크에서 허가되지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>남은 블록의 수</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>알수없음...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>최종 블록 시각</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>진행</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>시간당 진행 증가율</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>계산중...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>동기화 완료까지 예상 시간</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>숨기기</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>알수없음. 헤더 동기화중 (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>URI 열기</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>지급 요청 URI 또는 파일 열기</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>지불 요청 파일을 선택하세요</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>지불 요청 파일을 열기 위해서 선택하세요</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>환경설정</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>메인(&amp;M)</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>시스템 로그인후에 %1을 자동으로 시작합니다.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>시스템 로그인시 %1 시작(&amp;S)</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>데이터베이스 캐시 크기(&amp;D)</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>메가바이트</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>스크립트 인증 쓰레드의 개수(&amp;V)</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>프록시 아이피 주소 (예. IPv4:127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>제공된 기본 SOCKS5 프록시가 이 네트워크 유형을 통해 피어에 도달하는 경우 표시됩니다.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Tor 서비스를 이용하여 피어에게 연결하기 위해 분리된 SOCKS5 프록시 사용:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>시스템 트레이 로 부터 아이콘 숨기기</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;트레이 아이콘 숨기기</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>창을 닫으면 종료 대신 트레이로 보내기. 이 옵션을 활성화하면 메뉴에서 종료를 선택한 후에만 어플리케이션이 종료됩니다.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>서드-파티 URLs (예. 블록 탐색기)는 거래 탭의 컨텍스트 메뉴에 나타납니다. URL의 %s는 거래 해시값으로 대체됩니다. 여러 URLs는 수직 바 | 에서 나누어 집니다.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>명령줄 옵션 활성화는 위의 옵션들을 대체합니다:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>작업 디렉토리에서 %1 구성 파일을 엽니다.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>설정 파일 열기</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>모든 클라이언트 옵션을 기본값으로 재설정</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>옵션 재설정(&amp;R)</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>네트워크(&amp;N)</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = 자동, &lt;0 = 지정된 코어 개수만큼 사용 안함)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>지갑(&amp;A)</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>전문가</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>코인 상세 제어기능을 활성화합니다 (&amp;C)</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>검증되지 않은 잔돈 쓰기를 비활성화하면 거래가 적어도 1회 이상 검증되기 전까지 그 거래의 거스름돈은 사용할 수 없습니다. 이는 잔액 계산 방법에도 영향을 미칩니다.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>검증되지 않은 잔돈 쓰기 (&amp;S)</translation>\n    </message>\n    <message>\n        <source>Automatically open the Sugarchain client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>라우터에서 Sugarchain 클라이언트 포트를 자동적으로 엽니다. 라우터에서 UPnP를 지원하고 활성화 했을 경우에만 동작합니다.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>사용중인 &amp;UPnP 포트 매핑</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>외부로부터의 연결을 승인합니다.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>연결 요청을 허용합니다.</translation>\n    </message>\n    <message>\n        <source>Connect to the Sugarchain network through a SOCKS5 proxy.</source>\n        <translation>SOCKS5 프록시를 통해 슈가체인 네트워크 연결</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>SOCKS5 프록시를 거쳐 연결합니다(&amp;C) (기본 프록시):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>프록시 &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>포트(&amp;P):</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>프록시의 포트번호입니다 (예: 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>피어에 연결하기 위해 사용된 방법:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Sugarchain network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Tor 서비스를 경유하여 슈가체인 네트워크에 연결하기 위해 분리된 SOCKS5 프록시를 사용.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>창(&amp;W)</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>창을 최소화 하면 트레이에 아이콘만 표시합니다.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>작업 표시줄 대신 트레이로 최소화(&amp;M)</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>닫을때 최소화(&amp;I)</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>표시(&amp;D)</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>사용자 인터페이스 언어(&amp;L):</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>사용자 인터페이스 언어를 여기서 설정할 수 있습니다. 이 설정은 %1을 다시 시작할때 적용됩니다.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>거래액을 표시할 단위(&amp;U):</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>인터페이스에 표시하고 코인을 보낼때 사용할 기본 최소화 단위를 선택하십시오.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>코인 상세 제어기능에 대한 표시 여부를 선택할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;서드-파티 거래 URL들</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>확인(&amp;O)</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>취소(&amp;C)</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>기본값</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>없음</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>옵션 초기화를 확인</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>변경 사항을 적용하기 위해서는 프로그램이 종료 후 재시작되어야 합니다.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>클라이언트가 종료됩니다, 계속 진행하시겠습니까?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>설정 옵션</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>구성 파일은 GUI 설정을 무시하는 고급 사용자 옵션을 지정하는 데 사용됩니다. 또한 모든 명령 줄 옵션이 구성 파일보다 우선합니다.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>오류</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>구성 파일을 열 수 없습니다.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>이 변경 사항 적용을 위해 프로그램 재시작이 필요합니다. </translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>지정한 프록시 주소가 잘못되었습니다.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>유형</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Sugarchain network after a connection is established, but this process has not completed yet.</source>\n        <translation>표시된 정보가 오래된 것 같습니다. 슈가체인 네트워크에 연결하고 난 다음에 지갑을 자동으로 동기화 하지만, 아직 과정이 끝나지는 않았습니다.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>조회전용:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>사용가능</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>당신의 현재 사용 가능한 잔액</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>미확정</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>전체 거래들은 아직 확인되지 않았고, 그리고 현재 잔액에 아직 반영되지 않았습니다.</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>아직 사용 불가능:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>아직 사용 가능하지 않은 채굴된 잔액</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>잔액</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>총액:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>당신의 현재 총액</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>조회전용 주소의 현재 잔액</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>사용가능:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>최근거래</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>조회전용 주소의 검증되지 않은 거래</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>조회전용 주소의 채굴된 잔액 중 숙성되지 않은 것</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>조회전용 주소의 현재 잔액</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>지불 요청 오류</translation>\n    </message>\n    <message>\n        <source>Cannot start sugarchain: click-to-pay handler</source>\n        <translation>슈가체인을 시작할 수 없습니다: 지급제어기를 클릭하세요</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI 핸들링</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>지불 요청의 URL이 올바르지 않습니다: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>잘못된 지불 주소입니다 %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Sugarchain address or malformed URI parameters.</source>\n        <translation>URI의 파싱에 문제가 발생했습니다. 잘못된 슈가체인 주소나 URI 파라미터 구성에 오류가 존재할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>지불이 파일 처리를 요청합니다</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>지불 요청 파일을 읽을 수 없습니다. 이것은 잘못된 지불 요청 파일에 의해 발생하는 오류일 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>지불 요청이 거부됨</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>지급 요청 네트워크가 클라이언트 네트워크와 일치되지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>지불 요청이 만료됨.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>지불 요청이 초기화 되지 않았습니다.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>임의로 변경한 결제 스크립트 기반의 지불 요청 양식은 검증되기 전까지는 지원되지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>잘못된 지불 요청.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>요청한 금액 %1의 양이 너무 적습니다. (스팸성 거래로 간주)</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>%1 으로부터의 환불</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>지불 요청 %1은 너무 큽니다 (%2 바이트, %3 바이트까지 허용됩니다).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>%1과 연결하는데 에러: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>지불요청을 파싱할 수 없습니다!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>서버로 부터 잘못된 반응 %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>네트워크 요청 에러</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>지불이 승인됨</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>유저 에이전트</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>노드/서비스</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>노드 ID</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>핑</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>보냄</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>받음</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>거래액</translation>\n    </message>\n    <message>\n        <source>Enter a Sugarchain address (e.g. %1)</source>\n        <translation>슈가체인 주소를 입력하기 (예. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 일</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 시간</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 분</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 초</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>없음</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>없음</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n 초</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n 분</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n 시간</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>&amp;n 일</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n 주</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 그리고 %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n 년</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 바이트</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 킬로바이트</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 메가바이트</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 기가바이트</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1가 아직 안전하게 종료되지 않았습니다...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>알수없음</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>에러: 지정한 데이터 폴더 \"%1\"은 존재하지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>에러: 설정파일을 파싱할수 없습니다: %1. key=value syntax만 사용가능합니다.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>에러: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>이미지 저장(&amp;S)...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>이미지 복사(&amp;C)</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>QR코드 저장</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG 이미지(*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>없음</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>클라이언트 버전</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>정보(&amp;I)</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>디버그 창</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>일반</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>사용 중인 BerkeleyDB 버전</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>데이터 폴더</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>시작 시간</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>네트워크</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>이름</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>연결 수</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>블록 체인</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>현재 블록 수</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>메모리 풀</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>현재 거래 수</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>메모리 사용량</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>리셋(&amp;R)</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>받음</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>보냄</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>피어(&amp;P)</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>차단된 피어</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>자세한 정보를 보려면 피어를 선택하세요.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>화이트리스트에 포함</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>방향</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>버전</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>시작된 블록</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>동기화된 헤더</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>동기화된 블록</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>유저 에이전트</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>%1 디버그 로그파일을 현재 데이터 폴더에서 엽니다. 용량이 큰 로그 파일들은 몇 초가 걸릴 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>글자 크기 축소</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>글자 크기 확대</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>서비스</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>밴 스코어</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>접속 시간</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>마지막으로 보낸 시간</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>마지막으로 받은 시간</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping 시간</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>현재 진행중인 PING에 걸린 시간.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping 대기</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>최소 핑</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>시간 오프셋</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>최종 블록 시각</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>열기(&amp;O)</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>콘솔(&amp;C)</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>네트워크 트래픽(&amp;N)</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>총액</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>In:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Out:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>로그 파일 디버그</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>콘솔 초기화</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1시간(&amp;H)</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1일(&amp;D)</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1주(&amp;W)</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1년(&amp;Y)</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>접속 끊기(&amp;D)</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>추방</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>노드 추방 취소(&amp;U)</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>%1 RPC 콘솔에 오신걸 환영합니다</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>기록을 탐색하려면 위 / 아래 화살표를 사용하고 화면을 지우려면 %1을 사용하십시오.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>사용할 수 있는 명령을 둘러보려면 %1 를 입력하십시요.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>더 많은 정보를 보기 위해선 콘솔에 %1를 치세요.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>경고: 사기꾼이 사용자에게 여기에 명령을 입력하게 하여 지갑 내용을 훔칠수 있다는 사실을 알려드립니다. 명령어를 완전히 이해하지 못한다면 콘솔을 사용하지 마십시오.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>네트워크 활동이 정지됨</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(노드 ID: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>%1 경유</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>없음</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>인바운드</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>아웃바운드</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>예</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>아니오</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>알수없음</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>거래액(&amp;A):</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>라벨(&amp;L):</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>메시지(&amp;M):</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Sugarchain network.</source>\n        <translation>지불 요청에 첨부되는 선택가능한 메시지 입니다. 이 메세지는 요청이 열릴 때 표시될 것 입니다. 메모: 이 메시지는 슈가체인 네트워크로 전송되지 않습니다.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>임의의 라벨이 새로운 받기 주소와 결합</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>지급을 요청하기 위해 아래 형식을 사용하세요. 입력값은 &lt;b&gt;선택 사항&lt;/b&gt; 입니다.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>요청할 금액 입력칸으로 선택 사항입니다. 빈 칸으로 두거나 특정 금액이 필요하지 않는 경우 0을 입력하세요. </translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>양식의 모든 필드를 지웁니다</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>지우기</translation>\n    </message>\n    <message>\n        <source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</source>\n        <translation>Bech32 주소 (BIP-173)는 더 적은 수수료와 오입금으로부터 방지해 줍니다. Bech32가 비활성화 되어있으면 P2SH 기반의 세그윗 주소가 대신 생성됩니다.</translation>\n    </message>\n    <message>\n        <source>Generate native segwit (Bech32) address</source>\n        <translation>네이티브 세그윗 (Bech32) 주소 생성</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>지출기록 확인</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>지불 요청(&amp;R)</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>선택된 요청을 표시하기 (더블 클릭으로 항목을 표시할 수 있습니다)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>보기</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>목록에서 삭제할 항목을 선택하시오</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>삭제</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>URI 복사</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>라벨 복사</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>메시지 복사</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>거래액 복사</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR 코드</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>URI 복사(&amp;U)</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>주소 복사(&amp;A)</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>이미지 저장(&amp;S)...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>%1에 지불을 요청했습니다</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>지불 정보</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>주소</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>거래액</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>라벨</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>메시지</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI 결과가 너무 길음, 라벨/메세지의 글을 줄이도록 하세요.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>URI를 QR 코드로 인코딩하는 중 오류가 발생했습니다.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>날짜</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>라벨</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>메시지</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(라벨 없음)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(메세지가 없습니다)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(요청한 거래액 없음)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>요청됨</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>코인 보내기</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>코인 컨트롤 기능들</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>입력...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>자동 선택</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>자금이 부족합니다!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>수량:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>바이트:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>거래액:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>수수료:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>수수료 이후:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>잔돈:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>이 기능이 활성화되면 거스름돈 주소가 공란이거나 무효인 경우, 거스름돈은 새롭게 생성된 주소로 송금됩니다.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>주소변경</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>거래 수수료:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>선택 하기...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Fallbackfee를 사용하게 될 경우 보낸 거래가 승인이 완료 될 때까지 몇 시간 혹은 몇 일 (혹은 영원히) 이 걸릴 수 있습니다. 수동으로 수수료를 선택하거나 전체 체인의 유효성이 검증될 때까지 기다리십시오.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>경고: 지금은 수수료 예측이 불가능합니다.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>수수료 설정 접기</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>킬로바이트 당</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>사용자 정의 수수료가 1000사토시로 지정된 경우 거래의 크기가 250바이트 일 경우 1킬로바이트당 250사토시만 지불되지만 \"최소 수수료\"에선 1000사토시가 지불됩니다. 1킬로바이트가 넘는 거래인 경우 어떠한 경우에든 1킬로바이트 기준으로 지불됩니다.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>숨기기</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for sugarchain transactions than the network can process.</source>\n        <translation>블록의 용량보다 거래의 용량이 작은 경우에는 최소한의 수수료만으로도 충분합니다. 그러나 슈가체인 네트워크의 처리량보다 더 많은 거래 요구는 영원히 검증이 안 될 수도 있습니다.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(툴팁을 꼭 읽어보세요)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>권장:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>사용자 정의:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Smart fee가 아직 초기화 되지 않았습니다. 블록 분석이 완전하게 끝날 때 까지 기다려주십시오...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>다수의 수령인들에게 한번에 보내기</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>수령인 추가하기(&amp;R)</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>양식의 모든 필드를 지웁니다</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>더스트:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>승인 시간 목표:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Replace-By-Fee 옵션 활성화</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Replace-By-Fee (BIP-125) 옵션은 보낸 거래의 수수료 상향을 지원해 줍니다. 이 옵션이 없을 경우 거래 지연을 방지하기 위해 더 높은 수수료가 요구됩니다.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>모두 지우기(&amp;A)</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>잔액:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>전송 기능 확인</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>보내기(&amp;E)</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>수량 복사</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>거래액 복사</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>수수료 복사</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>수수료 이후 복사</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>bytes 복사</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>더스트 복사</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>잔돈 복사</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1(%2 블록)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1을(를) %2(으)로</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>정말로 보내시겠습니까?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>거래 수수료로 추가됨</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>총 액수 %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>또는</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>추후에 거래 수수료를 올릴 수 있습니다 (Replace-By-Fee, BIP-125 지원)</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Replace-By-Fee, BIP-125 지원 안함.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>코인 전송을 확인</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>수령인 주소가 정확하지 않습니다. 재확인 바랍니다.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>지불하는 금액은 0 보다 커야 합니다.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>잔고를 초과하였습니다.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>%1 의 거래수수료를 포함하면 잔고를 초과합니다.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>중복된 주소 발견: 한번에 하나의 주소에만 작업할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>거래를 생성하는 것을 실패하였습니다!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>거래가 다음과 같은 이유로 거부되었습니다: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>%1 보다 높은 수수료는 너무 높은 수수료 입니다.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>지불 요청이 만료됨.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>오직 %1 만의 수수료를 지불하기</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>%n 블록 안에 승인이 시작될 것으로 추정됩니다.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Sugarchain address</source>\n        <translation>경고: 잘못된 슈가체인 주소 입니다</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>경고: 알려지지 않은 주소변경입니다</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>맞춤 주소 변경 확인</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>변경하기 위해 선택한 주소는 이 지갑의 일부가 아닙니다. 지갑에 있는 일부 또는 모든 금액을 이 주소로 보낼 수 있습니다. 확실합니까?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(라벨 없음)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>금액(&amp;M):</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>송금할 대상(&amp;T):</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>라벨(&amp;L):</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>이전에 사용한 주소를 선택하십시오</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>이것은 정상적인 지불입니다.</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address to send the payment to</source>\n        <translation>이 슈가체인 주소로 송금됩니다</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>클립보드로 부터 주소 붙여넣기</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>항목을 지웁니다</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less sugarchains than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>수수료가 송금되는 금액에서 공제됩니다. 수령자는 금액 필드에서 입력한 금액보다 적은 금액을 전송받게 됩니다. 받는 사람이 여러 명인 경우 수수료는 균등하게 나누어집니다.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>송금액에서 수수료 공제(&amp;U)</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>사용 가능한 잔고 사용</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>메시지:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>인증 되지 않은 지급 요청입니다.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>인증 된 지급 요청 입니다.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>사용된 주소 목록에 새 주소를 추가하기 위해 라벨 이름을 입력해 주세요. </translation>\n    </message>\n    <message>\n        <source>A message that was attached to the sugarchain: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Sugarchain network.</source>\n        <translation>슈가체인에 첨부된 메시지: 참고용으로 거래와 함께 저장될 URI. 메모: 이 메시지는 슈가체인 네트워크로 전송되지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>송금할 대상:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>메모:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>주소록에 추가하려면 라벨을 입력하세요</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>예</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1이 종료 중입니다...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>이 창이 사라지기 전까지 컴퓨터를 끄지 마세요.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>서명 - 싸인 / 메시지 확인</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>메시지 서명(&amp;S)</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive sugarchains sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>여러분 자신을 증명하기 위해 주소를 첨가하고 서명할 수 있습니다. 피싱 공격으로 말미암아 여러분의 서명을 통해 속아 넘어가게 할 수 있으므로, 서명하지 않은 모든 모호한 요소를 주의하십시오. 조항들이 완전 무결한지 확인 후 동의하는 경우에만 서명하십시오.</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address to sign the message with</source>\n        <translation>메세지를 서명한 슈가체인 주소</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>이전에 사용한 주소를 선택하십시오</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>클립보드로 부터 주소를 복사하기</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>여기에 서명하려는 메시지를 입력하십시오</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>서명</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>현재 서명을 시스템 클립보드에 복사</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Sugarchain address</source>\n        <translation>여러분의 슈가체인 주소를 증명하려면 메시지 서명하십시오</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>메시지에 서명(&amp;M)</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>메시지 필드의 모든 서명 재설정</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>모두 지우기(&amp;A)</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>메시지 검증(&amp;V)</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>메시지를 검증하기 위해 아래 칸에 각각 지갑 주소와 메시지, 전자서명을 입력하세요. (메시지 원본의 띄어쓰기, 들여쓰기, 행 나눔 등이 정확하게 입력되어야 하므로 원본을 복사해서 입력하세요) 이 기능은 메시지 검증이 주 목적이며, 네트워크 침입자에 의해 변조되지 않도록 전자서명 해독에 불필요한 시간을 소모하지 마세요. </translation>\n    </message>\n    <message>\n        <source>The Sugarchain address the message was signed with</source>\n        <translation>메세지의 서명에 사용된 슈가체인 주소</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Sugarchain address</source>\n        <translation>정확한 슈가체인주소가 입력됬는지 메시지를 확인하시오</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>메시지 검증(&amp;M)</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>모든 검증 메시지 필드 재설정</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>서명을 만들려면 \"메시지 서명\"을 누르십시오</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>입력한 주소가 잘못되었습니다.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>주소를 확인하고 다시 시도하십시오.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>입력한 주소는 키에서 참조하지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>지갑 잠금 해제를 취소했습니다.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>입력한 주소에 대한 개인키가 없습니다.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>메시지 서명에 실패했습니다.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>메시지를 서명했습니다.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>서명을 해독할 수 없습니다.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>서명을 확인하고 다시 시도하십시오.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>메시지 다이제스트와 서명이 일치하지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>메시지 검증에 실패했습니다.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>메시지를 검증했습니다.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[테스트넷]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>%n개의 더 많은 블록 열기</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>%1 까지 열림</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>%1 승인이 있는 거래와 충돌 함</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/오프라인</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/미승인, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>메모리 풀 안에 있음</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>메모리 풀 안에 없음</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>버려진</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/미확인</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 확인됨</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>상태</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>. 아직 성공적으로 통보하지 않음</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, %n개 노드를 통해 전파</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>날짜</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>소스</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>생성됨</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>으로부터</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>알수없음</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>에게</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>자신의 주소</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>조회전용</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>라벨</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>입금액</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>%n개의 더 많은 블록을 숙성</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>허용되지 않음</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>출금액</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>총 출금액</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>총 입금액</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>거래 수수료</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>총 거래액</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>메시지</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>설명</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>거래 ID</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>거래 총 크기</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>출력 인덱스</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>상인</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>신규 채굴된 코인이 사용되기 위해서는 %1 개의 블록이 경과되어야 합니다. 블록을 생성할 때 블록체인에 추가되도록 네트워크에 전파되는 과정을 거치는데, 블록체인에 포함되지 못하고 실패한다면 해당 블록의 상태는 '미승인'으로 표현되고 슈가체인 또한 사용될 수 없습니다. 이 현상은 다른 노드가 비슷한 시간대에 동시에 블록을 생성할 때 종종 발생할 수 있습니다. </translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>디버깅 정보</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>거래</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>입력</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>거래액</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>참</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>거짓</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>이 창은 거래의 세부내역을 보여줍니다</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>%1에 대한 세부 정보</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>날짜</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>형식</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>라벨</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>%n개의 더 많은 블록 열기</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>%1 까지 열림</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>오프라인</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>미확인</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>버려진</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>승인 중 (권장되는 승인 회수 %2 대비 현재 승인 수 %1)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>승인됨 (%1 확인됨)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>충돌</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>충분히 숙성되지 않은 상태 (%1 승인, %2 후에 사용 가능합니다)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>이 블록은 다른 노드로부터 받지 않아 허용되지 않을 것임!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>생성되었으나 거절됨</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>받은 주소</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>보낸 주소</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>보낸 주소</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>자신에게 지불</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>채굴</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>조회전용</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(없음)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(라벨 없음)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>거래상황. 마우스를 올리면 검증횟수가 표시됩니다.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>거래가 이루어진 날짜와 시각.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>거래의 종류.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>조회전용 주소가 이 거래에 참여하는지 여부입니다.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>거래에 대한 사용자 정의 intent/purpose</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>변경된 잔고.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>전체</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>오늘</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>이번주</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>이번 달</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>지난 달</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>올 해</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>범위...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>받은 주소</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>보낸 주소</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>자기거래</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>채굴</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>기타</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>검색하기 위한 주소, 거래 아이디 또는 라벨 입력</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>최소 거래액</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>버려진 거래</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>거래 수수료 증가</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>주소 복사</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>라벨 복사</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>거래액 복사</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>거래 ID 복사</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>원시 거래 복사</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>거래 세부 내역 복사</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>라벨 수정</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>거래 세부 내역 보기</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>거래 기록 내보내기</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>쉼표로 구분된 파일 (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>확인됨</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>조회전용</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>날짜</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>형식</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>라벨</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>주소</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>아이디</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>내보내기 실패</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>%1으로 거래 기록을 저장하는데 에러가 있었습니다.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>내보내기 성공</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>거래 기록이 성공적으로 %1에 저장되었습니다.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>범위:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>상대방</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>거래액을 표시하는 단위. 클릭해서 다른 단위를 선택할 수 있습니다.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>지갑 불러오기가 안됩니다.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>코인 보내기</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>수수료 상향 오류</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>거래 수수료 상향 실패</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>수수료를 올리시겠습니까?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>현재 수수료:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>증가:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>새로운 수수료:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>수수료 상향 승인</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>거래에 서명 할 수 없습니다.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>트랜잭션을 커밋 할 수 없습니다</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>내보내기 (&amp;E)</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>현재 탭에 있는 데이터를 파일로 내보내기</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>지갑 백업</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>지갑 데이터 (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>백업 실패</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>지갑 데이터를 %1 폴더에 저장하는 동안 오류가 발생했습니다. </translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>백업 성공</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>지갑 정보가 %1에 성공적으로 저장되었습니다.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>옵션:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>데이터 폴더 지정</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>피어 주소를 받기 위해 노드에 연결하고, 받은 후에 연결을 끊습니다</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>공개 주소를 지정하십시오</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>명령줄과 JSON-RPC 명령 수락</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>MIT 소프트웨어 라이센스에 따라 배포 됨, 첨부 파일 %s 또는 %s을 참조하십시오.</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>&lt;category&gt;가 제공되지 않거나 &lt;category&gt; = 1 인 경우, 모든 디버깅 정보를 출력</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>블록 축소가 최소치의 %d MiB 밑으로 설정되어 있습니다. 더 높은 값을 사용해 보세요.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>블록 축소: 마지막 지갑 동기화 지점이 축소된 데이터보다 과거의 것 입니다. -reindex가 필요합니다 (정지된 노드의 경우 모든 블록체인을 재다운로드합니다)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>블록 축소 모드에서는 재검색이 불가능 합니다. -reindex 명령을 사용해서 모든 블록체인을 다시 다운로드 해야 합니다.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>에러: 치명적인 내부 오류가 발생했습니다, 자세한 내용은 debug.log 를 확인해주세요.</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>송금 거래시 추가되는 수수료 (%s/kB) (기본값: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>블록 데이터를 축소 중입니다..</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>데몬으로 백그라운드에서 실행하고 명령을 허용</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>HTTP 서버를 시작할 수 없습니다. 자세한 사항은 디버그 로그를 확인 하세요.</translation>\n    </message>\n    <message>\n        <source>Sugarchain Yumekawa</source>\n        <translation>슈가체인 유메카와</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>%s 디벨로퍼스</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>충분한 데이터가 축적되지 않은 상태에서의 수수료 추정 기능이 사용하는 수수료 비율(%s/kB) (기본값: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>거래의 중계를 하지 않더라도 화이트 리스트에 포함된 피어에서 받은 트랜잭션은 중계하기 (기본값: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>노드를 추가하여 연결을 지속합니다 ('addnode' RPC 명령어 도움말을 참고하세요)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>선택된 주소로 고정하며 항상 리슨(Listen)합니다. IPv6 프로토콜인 경우  [host]:port 방식의 명령어 표기법을 사용합니다.</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>%s 데이터 디렉토리에 락을 걸 수 없었습니다. %s가 이미 실행 중인 것으로 보입니다.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>특정 연결을 제공 할 수없고 addrman이 나가는 연결을 찾을 수 없습니다.</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>지정된 노드에만 연결하십시오. -connect = 0은 자동 연결을 비활성화합니다 (이 피어의 규칙은 -addnode의 규칙과 동일합니다)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>시작시 모든 지갑 거래를 삭제하고 -rescan을 통하여 블록체인만 복구합니다.</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>%s 불러오기 오류: 주소 키는 모두 정확하게 로드되었으나 거래 데이터와 주소록 필드에서 누락이나 오류가 존재할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>카테고리에 대한 디버깅 정보를 제외하십시오. -debug=1 과 함께 사용하여 하나 이상의 지정된 범주를 제외한 모든 범주의 디버그 로그를 출력 할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>지갑 거래가 바뀌면 명령을 실행합니다.(%s 안의 명령어가 TxID로 바뀝니다)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>압축 블록 재구성을 위해 메모리에 보관해야하는 추가 거래 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>이 블록이 체인에 있으면 해당 블록과 그 조상이 유효하며 잠재적으로 스크립트 확인을 건너 뜁니다 (0은 모두 확인, 기본값: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>허용 된 최대 중간 피어 시간 오프셋 조정. 시간에 대한 지역적 전망치는 전방 또는 후방의 피어에 의해 영향을 받을 수 있습니다. (기본값: %u 초)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>컴퓨터의 날짜와 시간이 올바른지 확인하십시오! 시간이 잘못되면 %s은 제대로 동작하지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>%s가 유용하다고 생각한다면 프로젝트에 공헌해주세요. 이 소프트웨어에 대한 보다 자세한 정보는 %s를 방문해주십시오.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>DNS lookup를 통해 피어 주소에 대한 쿼리 보내기 (기본값: 1 -connect 예외)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>블록 생성시 거래가 포함되도록 최저 수수료율을 설정하십시오 (%s/kB 단위). (기본값: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>스크립트 인증 스레드의 갯수 설정 (%u-%d, 0 = 자동, &lt;0 = 지정된 코어 개수만큼 사용 안함, 기본값: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>블록 데이터베이스에 미래의 블록이 포함되어 있습니다. 이것은 사용자의 컴퓨터의 날짜와 시간이 올바르게 설정되어 있지 않을때 나타날 수 있습니다. 만약 사용자의 컴퓨터의 날짜와 시간이 올바르다고 확신할 때에만 블록 데이터 베이스의 재구성을 하십시오</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>출시 전의 테스트 빌드 입니다. - 스스로의 책임하에 사용하십시오 - 채굴이나 상업적 용도로 프로그램으로 사용하지 마십시오</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>이것은 수수료 견적을 이용할 수 없을 때 지불 할 수 있는 거래 수수료입니다.</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>블록을 재생할 수 없습니다. -reindex-chainstate 를 사용하여 데이터베이스를 다시 빌드 해야 합니다.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>데이터베이스를 포크 전 상태로 돌리지 못했습니다. 블록체인을 다시 다운로드 해주십시오.</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>리슨(Listen) 포트를 할당하기 위해 UPnP 사용 (기본값: 열려있거나 -proxy 옵션을 사용하지 않을 시 1)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>클라이언트JSON-RPC 연결시 사용자 이름과 해시화된 암호문. &lt;userpw&gt; 필드는 &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt; 포멧으로 구성되어 있습니다. 전형적 파이썬 스크립트에선 share/rpcuser가 포함되어 있습니다. 그런 다음 클라이언트는 rpcuser=&lt;USERNAME&gt;/ rpcpassword=&lt;PASSWORD&gt; 쌍의 인수를 사용하여 정상적으로 연결합니다. 이 옵션은 여러번 지정할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>지갑은 mempool chain limit (기본값: %u) 을 위반하는 거래를 생성하지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>경고 : 모든 네트워크가 동의해야 하나, 일부 채굴자들에게 문제가 있는 것으로 보입니다. </translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>경고: 현재 슈가체인 버전이 다른 네트워크 참여자들과 동일하지 않은 것 같습니다. 당신 또는 다른 참여자들이 동일한 슈가체인 버전으로 업그레이드 할 필요가 있습니다.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>종료시 mempool 저장과 재시작시 로드 여부 (기본 : %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>지난 100개의 블록 중 %d개에 예상치 못한 버전이 있습니다.</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s 손상되었고 복구가 실패하였습니다</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool은 최소한 %d MB가 필요합니다</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; 지정 가능:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>외부 접속을 승인합니다</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>사용자 에이전트 문자열에 코멘트 첨부</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>시작시 망가진 wallet.dat에서 개인키 복원을 시도합니다</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>블록 생성 옵션:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>%s 주소를 확인할 수 없습니다: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>체인 선택 옵션:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>범위 밖의 인덱스 변경</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>연결 설정 : </translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>손상된 블록 데이터베이스가 감지되었습니다</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>디버그 및 테스트 설정</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>지갑 불러오기를 하지마시오 또한 지갑 RPC 연결을 차단하십시오</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>블록 데이터베이스를 다시 생성하시겠습니까?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>&lt;address&gt;에 대한 해시 블록 공개 활성화</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>&lt;address&gt;에 대한 해시 거래 공개 활성화</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>&lt;address&gt;에 대한 원시 블록 공개 활성화</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>&lt;address&gt;에 대한 원시 거래 공개 활성화</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>메모리 풀(pool) 내의 거래 치환(replacement) 활성화 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>블록 데이터베이스를 초기화하는데 오류</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>지갑 데이터베이스 환경 초기화하는데 오류 %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>%s 불러오기 오류</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>%s 불러오기 오류: 지갑 오류</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>%s 불러오기 에러: 지갑은 새 버전의 %s이 필요합니다</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>블록 데이터베이스를 불러오는데 오류</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>블록 데이터베이스를 여는데 오류</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>오류: 디스크 공간이 부족합니다!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>어떤 포트도 반응하지 않습니다. 원한다면 -listen=0 를 사용하세요.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>초기화 중 지갑 스캔 오류</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>들여오기 중...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>올바르지 않거나 생성된 블록을 찾을 수 없습니다. 잘못된 네트워크 자료 디렉토리?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>무결성 확인 초기화가 실패했습니다. %s가 종료됩니다.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>유효하지 않은 금액 -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>-discardfee=&lt;amount&gt;에 대한 양이 잘못되었습니다: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>유효하지 않은 금액 -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>거래 메모리 풀의 용량을 &lt;n&gt;메가바이트 아래로 유지하기 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>P2P 주소 불러오는 중...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>추방리스트를 불러오는 중...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>인증 쿠키의 위치 (기본값: data dir)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>사용 가능한 파일 디스크립터-File Descriptor-가 부족합니다. </translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>오직 &lt;net&gt; 네트워크로 로만 접속 (IPv4, IPv6 혹은 onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>도움말 메시지 출력 후 종료</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>버전 출력후 종료</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>블록 축소는 음수로 설정할 수 없습니다.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>블록 축소 모드는 -txindex 와 호환되지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>현재의 blk*.dat 파일들로부터 블록체인 색인을 재구성합니다.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>현재 색인 된 블록들로부터 블록체인을 재구성합니다.</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>블록 재생중...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>블록 되감는중...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>full-RBF opt-in 이 활성화 된 거래을 전송합니다. (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>데이터베이스 케시 크기를 메가바이트로 설정(%d 부터 %d, 기본값: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>데이터 폴더 안에 지갑 파일을 선택하세요.</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>소스코드는 %s 에서 확인하실 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>거래 수수료 및 잔돈 계산에 실패했습니다.</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>이 컴퓨터의 %s에 바인딩 할 수 없습니다. 아마도 %s이 실행중인 것 같습니다.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>지원하지 않는 인수 -benchmark 은 무시됩니다, -debug=bench 형태로 사용하세요.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>지원하지 않는 인수 -debugnet 은 무시됩니다, -debug=net 형태로 사용하세요.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>지원하지 않는 인수 -tor를 찾았습니다. -onion 를 사용해주세요.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>지원되지 않는 로깅 카테고리 %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>UTXO 데이터베이스 업그레이드</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>리슨(Listen) 포트를 할당하기 위해 UPnP 사용 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>테스트 체인 사용</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>사용자 정의 코멘트 (%s)에 안전하지 못한 글자가 포함되어 있습니다.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>블록 검증중...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>지갑 디버깅/테스트 옵션:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>지갑을 새로 써야 합니다: 완성하기 위하여 %s을 다시 시작하십시오.</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>지갑 옵션:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>특정 소스에서의 JSON-RPC 연결 허가. 유효한 &lt;ip&gt; 같은 하나의 IP주소 (예 1.2.3.4), 네트워크/넷마스크 (예 1.2.3.4/255.255.255.0) 혹은 네트워크/CIDR (예 1.2.3.4/24). 이 옵션은 복수로 설정 할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>선택된 주소로 고정하여 화이트리스트에 포함된 피어에 접속합니다. IPv6 프로토콜인 경우 [host]:port 방식의 명령어 표기법을 사용합니다.</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>umask 077 대신 시스템 기본 퍼미션으로 새 파일을 만듭니다 (지갑 기능이 비활성화 상태에서만 유효합니다)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>자신의 주소를 탐색 (기본값: 열려있거나 -externalip 나 -proxy 옵션이 없으면 1)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>오류: 들어오는 연결을 리스닝(Listening)하는데 실패했습니다 (오류 리턴 %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>이 사항과 관련있는 경고가 발생하거나 아주 긴 포크가 발생했을 때 명령어를 실행해 주세요. (cmd 명령어 목록에서 %s는 메시지로 대체됩니다) </translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>해당 금액(%s/kB) 보다 적은 수수료는 중계, 채굴, 거래 생성에서 수수료 면제로 간주됩니다 (기본값: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>paytxfee가 설정되어 있지 않다면 평균 n 블록안에 승인이 이루어지도록 충분한 수수료가 포함됩니다 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>유효하지 않은 금액 -maxtxfee=&lt;amount&gt;: '%s' (거래가 막히는 상황을 방지하게 위해 적어도 %s 의 중계 수수료를 지정해야 합니다)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>중계 및 채굴을 할 때 데이터 운송 거래에서 데이터의 최대 크기 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>인증정보를 프록시 연결마다 무작위로 합니다. 이는 Tor 스트림을 격리시킬 수 있습니다 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>거래액이 수수료를 지불하기엔 너무 작습니다</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>화이트리스트에 포함된 피어는 이미 메모리풀에 포함되어 있어도 DoS 추방이 되지 않으며 그들의 거래가 항상 중계됩니다, 이는 예를 들면 게이트웨이에서 유용합니다.</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>축소 모드를 해제하고 데이터베이스를 재구성 하기 위해 -reindex를 사용해야 합니다. 이 명령은 모든 블록체인을 다시 다운로드 할 것 입니다.</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>공개 REST 요청을 허가 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Tor 숨김 서비스를 자동적으로 생성 (기본값: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>SOCK5 프록시를 통해 연결</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>%s 불러오기 오류: 이미 HD 지갑이 존재하는 상태에서 HD 지갑을 비활성화 할 수 없습니다</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>블록 데이터베이스를 불러오는데 오류가 발생하였습니다, 종료됩니다.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>체인 상태 데이터베이스 업그레이드 중 오류가 발생했습니다.</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>외부 blk000??.dat 파일에서 블록을 가져오기</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>정보</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>올바르지 않은 -onion 주소 또는 호스트 이름: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>올바르지 않은 -proxy 주소 또는 호스트 이름: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>유효하지 않은 금액 -paytxfee=&lt;amount&gt;: \"%s\" (최소 %s 이상이어야 됨)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>유효하지 않은 넷마스크가 -whitelist: '%s\" 를 통해 지정됨</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>최대 &lt;n&gt;개의 연결할 수 없는 거래를 메모리에 저장 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>-whitebind를 이용하여 포트를 지정해야 합니다: '%s\"</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Node 중계 옵션:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC 서버 설정</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>시스템 한계로 인하여 -maxconnections 를 %d 에서 %d로 줄였습니다.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>시작시 누락된 지갑 거래에 대해 블록 체인을 다시 검색 합니다</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>추적오류 정보를 degug.log 자료로 보내는 대신 콘솔로 보내기</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>모든 디버그 설정 보기 (사용법: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>클라이언트 시작시 debug.log 파일 비우기 (기본값: -debug 아닐 때 1)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>거래를 서명하는것을 실패하였습니다.</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>애러: 지정한 지갑 폴더 \"%s\"은 존재하지 않습니다.</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>애러: 지정한 지갑 폴더 \"%s\"은 상대 경로입니다.</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>애러: 지정한 지갑 폴더 \"%s\"은 디렉토리가 아닙니다.</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>거래액이 수수료를 지불하기엔 너무 작습니다</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>이 소프트웨어는 시험적입니다.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Tor 관리 포트 암호 (기본값: 없음)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>onion 열림이 활성화시 Tor 관리 포트 사용 (기본값: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>거래액이 너무 적습니다</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>수수료 정책에 비해 거래가 너무 큽니다</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>너무 큰 거래 (금액을 낮춰야 합니다)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>초기 키값 생성 불가</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>시작시 지갑 포멧을 최신으로 업그레이드 합니다</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>JSON-RPC 연결에 사용할 사용자 이름</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>지갑(들) 검증중...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>지갑 %s는 데이터 디렉토리 %s 밖에 위치합니다.</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>경고</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>경고: 알려지지 않은 새로운 규칙이 활성화되었습니다. (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>블록 전용 모드로 동작할지 여부 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>-txindex를 바꾸기 위해서는 -reindex 를 사용해서 데이터베이스를 재구성해야 합니다. </translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>지갑의 모든거래내역 건너뛰기...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ 알림 옵션:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>JSON-RPC 연결에 사용할 암호</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>최고의 블록이 변하면 명령을 실행 (cmd 에 있는 %s 는 블록 해시에 의해 대체됨)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>-addnode, -seednode, -connect 옵션에 대해 DNS 탐색 허용</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = 거래의 메타 데이터를 유지함 예. 계좌정보 와 지불 요구 정보, 2 = 거래 메타 데이터 파기)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee 값이 너무 큽니다! 하나의 거래에 너무 큰 수수료가 지불 됩니다.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>주어진 주소에 바인드하여 JSON-RPC 연결을 기다립니다. 이 옵션은 -rpcallowip 도 전달되지 않으면 무시됩니다. 포트는 옵션이며 -rpcport 를 대체합니다. IPv6의 경우 [host]:port 표기법을 사용하십시오. 이 옵션은 여러 번 지정 할 수 있습니다 (기본값 : 127.0.0.1 및 ::1 즉, localhost 또는 -rpcallowip 이 지정되면 0.0.0.0 및 모든 주소).</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>메모리 풀에 있는 거래 기록을 &lt;n&gt;시간 후 부터는 유지하지 않기 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>릴레이 및 마이닝 거래의 sigop 당 동등한 바이트 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>%s 불러오기 오류: 비-HD 지갑이 존재하는 상태에서 HD 지갑을 활성화 할 수 없습니다</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>지갑 %s 로딩 에러, -wallet 매개변수는 파일 이름만 지정 해야 합니다 (경로가 아님).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>해당 금액(%s/kB) 보다 적은 수수료는 수수료 면제로 간주됩니다.(기본값: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>피어들이 로컬 중계 정책을 위반하더라도 화이트 리스트에 포함된 피어인경우 강제로 중계하기 (기본값: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>-checkblocks을 통한 블록 점검 (0-4, 기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>getrawtransaction를 RPC CALL를 통해 완전한 거래 인덱스 유지 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>이상행동을 하는 네트워크 참여자들을 다시 연결시키는데 걸리는 시간 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>디버그 정보 출력 (기본값: %u, &lt;category&gt; 제공은 선택입니다)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>non-segwit(0) 또는 segwit(1) (기본값: %d) 가 아닌 자세한 정보 표시 모드로 반환 된 원시 거래 또는 블록 hex의 직렬화를 설정합니다.</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>지갑 파일을 저장하기 위한 폴더를 설정하세요 (기본값: &lt;datadir&gt;/wallets 또는  &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>디버그 로그 파일의 저장 위치를 지정하세요: 이것은 별도의 위치나 블록체인 저장위치와 동일할 수 있습니다 (기본값: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>블룸필터를 통해 블록과 거래 필터링 지원 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>이것은 수수료 견적을 이용할 수 없을 때 지불 할 수 있는 거래 수수료입니다.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>이 제품에는 OpenSSL Project에서 OpenSSL Toolkit %s으로 사용하기 위해 개발 한 소프트웨어와 Eric Young이 작성한 암호화 소프트웨어 및 Thomas Bernard가 작성한 UPnP 소프트웨어가 포함되어 있습니다.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>네트워크 버전 문자 (%i)의 길이가 최대길이 (%i)를 초과합니다. uacomment 의 갯수나 길이를 줄이세요.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>아웃바운드 트래픽을 설정된 목표치 이하로 유지하기 (24시간당 MiB기준), 0 = 무제한 (기본값: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>지원하지 않는 인수 -socks를 찾았습니다. 설정된 SOCKS의 버전은 더이상 사용할 수 없으며, SOCK5 프록시만을 지원합니다.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>지원하지 않는 인수 -whitelistalwaysrelay 는 무시됩니다,  -whitelistrelay 나 -whitelistforcerelay 를 사용해 주세요.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Tor 서비스를 이용하여 피어에게 연결하기 위해 분리된 SOCKS5 프록시를 사용 (기본값: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>경고: 알려지지 않은 버전의 블록이 채굴되었습니다! 알려지지 않은 규칙이 적용되었을 가능성이 있습니다</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>경고 : 지갑파일이 손상되어 데이터가 복구되었습니다! 원래의 %s 파일은 %s 후에 %s 이름으로 저장됩니다. 잔액과 거래 내역이 정확하지 않다면 백업 파일로 부터 복원해야 합니다. </translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>설정된 IP주소 (보기 1.2.3.4) 혹은 CIDR로 작성된 네트워크 (보기 1.2.3.0/24)로 화이트리스트에 포함된 피어에 접속합니다. 이 설정은 복수로 지정 할 수 있습니다.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s가 매우 높게 설정되었습니다!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(기본값: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>DNS lookup을 통해 항상 피어주소에 대한 쿼리 보내기 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>지갑 %s 로딩 에러, -wallet 파일 이름은 일반 파일이어야합니다.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>지갑 %s 로딩 에러,  중복된 -wallet 파일이름을 입력했습니다.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>지갑 %s 로딩 에러,  -wallet 파일이름에 잘못된 문자가 있습니다.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>시작시 점검할 블록 갯수 (기본값: %u, 0 = 모두)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>디버그 출력에 IP주소 포함하기 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Keypool이 종료되었습니다. 먼저 keypoolrefill을 호출하십시오.</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>JSON-RPC 연결을 &lt;port&gt;포트로 받기 (기본값: %u 혹은 테스트넷: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>&lt;port&gt;포트로 연결 받기 (기본값: %u 혹은 테스트넷: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>피어 연결수를 &lt;n&gt;개로 유지 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>지갑 브로드캐스트 거래를 만들기</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>접속별 최대 수신 버퍼. &lt;n&gt; × 1000바이트 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>접속별 최대 전송 버퍼. &lt;n&gt; × 1000바이트 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>디버그 출력에 타임 스탬프 포함하기 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>데이터 운송 거래를 중계 및 채굴 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>비 P2SH 다중서명을 중계 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>키 풀 사이즈를 &lt;n&gt; 로 설정 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>최대 BIP141 블록 무게 설정 (기본값: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>RPC 호출 서비스를 위한 쓰레드 개수를 설정 (기본값: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>설정파일 지정 (기본값: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>밀리초 단위로 연결 제한시간을 설정 (최소값: 1, 기본값: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>pid 파일 지정 (기본값: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>거래를 보낼 때 검증되지 않은 잔돈 쓰기 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>네트워크 스레드 시작중...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>지갑은 최소 중계 수수료보다 적은 금액을 지불하는 것을 피할 것입니다.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>이것은 모든 거래에서 지불하는 최소 거래 수수료입니다.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>이것은 거래를 보낼 경우 지불 할 거래 수수료입니다.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>비정상적인 피어의 연결을 차단시키기 위한 임계값 (기본값: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>거래액은 절대로 음수가 아니어야 합니다</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>거래가 너무 긴 mempool 체인을 갖고 있습니다</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>거래에는 최소한 한명의 수령인이 있어야 합니다.</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>-onlynet에 지정한 네트워크를 알 수 없습니다: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>자금이 부족합니다!</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>블록 인덱스를 불러오는 중...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>지갑을 불러오는 중...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>지갑을 다운그레이드 할 수 없습니다</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>재검색 중...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>로딩 완료</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>오류</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ku_IQ.ts",
    "content": "<TS language=\"ku_IQ\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>ناوونیشانێکی نوێ دروست بکە</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;نوێ</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;ڕوونووس</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;داخستن</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;هەناردن</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;سڕینەوە</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Address</source>\n        <translation>ناوونیشان</translation>\n    </message>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;ناردن</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;پەرگە</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;سازکارییەکان</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;یارمەتی</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>هەڵە</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>ئاگاداری</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>زانیاری</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>کۆ:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>تێچوون:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>سەرجەم</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>رێکەت</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>بەڵێ</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>نەخێر</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>ناو</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>وەشان</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>بەخێربێن</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>هەڵە</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>هەڵبژاردنەکان</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>هەڵە</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Total:</source>\n        <translation>گشتی</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>نێدرا</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>سەرجەم</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;زانیاری</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>گشتی</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>تۆڕ</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>ناو</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>نێدرا</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>وەشان</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>خزمەتگوزاریەکان</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;کردنەوە</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>گشتییەکان</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>لە ناو</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>لەدەرەوە</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1&amp;سات</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1&amp;ڕۆژ</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1&amp;هەفتە</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1&amp;ساڵ</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>هەرگیز</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>بەڵێ</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>نەخێر</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;سەرجەم:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;پەیام:</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>پاککردنەوە</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>پیشاندان</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>سڕینەوە</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>ناوونیشان</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>سەرجەم</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>رێکەت</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>کۆ:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>تێچوون:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>Message:</source>\n        <translation>پەیام:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>بەڵێ</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>رێکەت</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>سەرجەم</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>رێکەت</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Date</source>\n        <translation>رێکەت</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>ناوونیشان</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;هەناردن</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>هەڵبژاردنەکان:</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>زانیاری</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>ئاگاداری</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>هەڵە</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ky.ts",
    "content": "<TS language=\"ky\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Жаң даректи жасоо</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>Ө&amp;чүрүү</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Address</source>\n        <translation>Дарек</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(аты жок)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Транзакциялар</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Билдирүүнү &amp;текшерүү...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Капчык</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Файл</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Жардам</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Ката</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Эскертүү</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Маалымат</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Жаңыланган</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(аты жок)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Дарек</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>версия</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Ката</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>MB</source>\n        <translation>МБ</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Тармак</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Капчык</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Порт:</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Терезе</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Жарайт</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Жокко чыгаруу</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>жарыяланбаган</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>жок</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Ката</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Маалымат</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Жалпы</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>&amp;Тармак</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Аты</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Ачуу</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Консоль</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Консолду тазалоо</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Билдирүү:</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Дарек</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Билдирүү</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Билдирүү</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(аты жок)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Бардыгын тазалоо</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Жөнөтүү</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(аты жок)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Даректи алмашуу буферинен коюу</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Билдирүү:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Даректи алмашуу буферинен коюу</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Бардыгын тазалоо</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/тармакта эмес</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Билдирүү</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(аты жок)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Дарек</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Information</source>\n        <translation>Маалымат</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Эскертүү</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Ката</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_la.ts",
    "content": "<TS language=\"la\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crea novam inscriptionem</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copia inscriptionem iam selectam in latibulum systematis</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Dele active selectam inscriptionem ex enumeratione</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporta data in hac tabella in plicam</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporta</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Dele</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialogus Tesserae</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Insere tesseram</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nova tessera</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Itera novam tesseram</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signa &amp;nuntium...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronizans cum rete...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Summarium</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Monstra generale summarium cassidilis</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transactiones</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Inspicio historiam transactionum</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>E&amp;xi</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Exi applicatione</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Informatio de &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Monstra informationem de Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Optiones</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Cifra Cassidile...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Conserva Cassidile...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Muta tesseram...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Recreans indicem frustorum in disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Mitte nummos ad inscriptionem Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Conserva cassidile in locum alium</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Muta tesseram utam pro cassidilis cifrando</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Fenestra &amp;Debug</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Aperi terminalem debug et diagnosticalem</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifica nuntium...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Cassidile</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Mitte</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Accipe</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Monstra/Occulta</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Monstra vel occulta Fenestram principem</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Cifra claves privatas quae cassidili tui sunt</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signa nuntios cum tuis inscriptionibus Bitcoin ut demonstres te eas possidere</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifica nuntios ut certus sis eos signatos esse cum specificatis inscriptionibus Bitcoin</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Plica</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configuratio</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Auxilium</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Tabella instrumentorum \"Tabs\"</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Optiones mandati initiantis</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 post</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Postremum acceptum frustum generatum est %1 abhinc.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transactiones post hoc nondum visibiles erunt.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Monitio</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informatio</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Recentissimo</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Persequens...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transactio missa</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transactio incipiens</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Cassidile &lt;b&gt;cifratum&lt;/b&gt; est et iam nunc &lt;b&gt;reseratum&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Cassidile &lt;b&gt;cifratum&lt;/b&gt; est et iam nunc &lt;b&gt;seratum&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>Quantitas:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Quantitas</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dies</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmatum</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Muta Inscriptionem</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Titulus</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Inscriptio</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versio</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Optiones mandati initiantis</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Usus:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>Optiones mandati intiantis</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Schema</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora postremi frusti</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Optiones</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Princeps</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Reconstitue omnes optiones clientis ad praedefinita.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Reconstitue Optiones</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Rete</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Cassidile</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Aperi per se portam clientis Bitcoin in itineratore.  Hoc tantum effectivum est si itineratrum tuum supportat UPnP et id activum est.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Designa portam utendo &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP vicarii:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Porta:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Porta vicarii (e.g. 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Fenestra</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Monstra tantum iconem in tabella systematis postquam fenestram minifactam est.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minifac in tabellam systematis potius quam applicationum</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inifac ad claudendum</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;UI</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Lingua monstranda utenti:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unita qua quantitates monstrare:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Selige praedefinitam unitam subdivisionis monstrare in interfacie et quando nummos mittere</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancella</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>praedefinitum</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirma optionum reconstituere</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Inscriptio vicarii tradita non valida est.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Schema</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Monstrata informatio fortasse non recentissima est.  Tuum cassidile per se synchronizat cum rete Bitcoin postquam conexio constabilita est, sed hoc actio nondum perfecta est.</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Immatura:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Fossum pendendum quod nondum maturum est</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Quantitas</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ignotum</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versio clientis</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informatio</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Fenestra Debug</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Tempus initiandi</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Rete</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Numerus conexionum</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Catena frustorum</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Numerus frustorum iam nunc</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Hora postremi frusti</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Aperi</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Terminale</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Debug catalogi plica</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Vacuefac terminale</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Quantitas:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Titulus:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Nuntius:</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Copia Inscriptionem</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Mitte Nummos</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Inopia nummorum</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Quantitas:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transactionis merces:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Mitte pluribus accipientibus simul</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Adde &amp;Accipientem</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Vacuefac &amp;Omnia</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Pendendum:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirma actionem mittendi</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Mitte</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Quantitas:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Pensa &amp;Ad:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Titulus:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Glutina inscriptionem ex latibulo</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Nuntius:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pensa Ad:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signationes - Signa / Verifica nuntium</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Signa Nuntium</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Glutina inscriptionem ex latibulo</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Insere hic nuntium quod vis signare</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signatio</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copia signationem in latibulum systematis</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Signa nuntium ut demonstres hanc inscriptionem Bitcoin a te possessa esse</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Signa &amp;Nuntium</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Reconstitue omnes campos signandi nuntii</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Vacuefac &amp;Omnia</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifica Nuntium</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verifica nuntium ut cures signatum esse cum specifica inscriptione Bitcoin</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifica &amp;Nuntium</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Reconstitue omnes campos verificandi nuntii</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Haec tabula monstrat descriptionem verbosam transactionis</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Optiones:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Specifica indicem datorum</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Conecta ad nodum acceptare inscriptiones parium, et disconecte</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Specifica tuam propriam publicam inscriptionem</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Accipe terminalis et JSON-RPC mandata.</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Operare infere sicut daemon et mandata accipe</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Nucleus</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Conglutina ad inscriptionem datam et semper in eam ausculta.  Utere [moderatrum]:porta notationem pro IPv6</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Facere mandatum quotiescumque cassidilis transactio mutet (%s in mandato sbstituitur ab TxID)</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Accipe conexiones externas (praedefinitum: 1 nisi -proxy neque -connect)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Optiones creandi frustorum:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Corruptum databasum frustorum invenitur</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Visne reficere databasum frustorum iam?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error initiando databasem frustorum</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error initiando systematem databasi cassidilis %s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Error legendo frustorum databasem</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Error aperiendo databasum frustorum</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Error: Inopia spatii disci!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Non potuisse auscultare in ulla porta.  Utere -listen=0 si hoc vis.</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Inopia descriptorum plicarum.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verificante frusta...</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informatio</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Mitte informationem vestigii/debug ad terminale potius quam plicam debug.log</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Diminue plicam debug.log ad initium clientis (praedefinitum: 1 nisi -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Signandum transactionis abortum est</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Magnitudo transactionis nimis parva</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transactio nimis magna</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nomen utentis pro conexionibus JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Monitio</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Tessera pro conexionibus JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Pelle mandatum quando optissimum frustum mutat (%s in mandato substituitur ab hash frusti)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permitte quaerenda DNS pro -addnode, -seednode, et -connect</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Ignotum rete specificatum in -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Inopia nummorum</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Legens indicem frustorum...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Legens cassidile...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Non posse cassidile regredi</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Iterum perlegens...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Completo lengendi</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Error</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_lt.ts",
    "content": "<TS language=\"lt\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Spustelėkite dešinįjį klavišą norint keisti adresą arba etiketę</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Sukurti naują adresą</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Naujas</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopijuoti esamą adresą į mainų atmintį</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopijuoti</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Užverti</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Ištrinti pasirinktą adresą iš sąrašo</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksportuoti informaciją iš dabartinės lentelės į failą</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksportuoti</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Trinti</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Address</source>\n        <translation>Adresas</translation>\n    </message>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Slaptafrazės dialogas</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Įvesti slaptafrazę</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nauja slaptafrazė</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Pakartokite naują slaptafrazę</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>Banned Until</source>\n        <translation>Užblokuotas iki</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Pasirašyti ži&amp;nutę...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sinchronizavimas su tinklu ...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Apžvalga</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Taškas</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Rodyti piniginės bendrą apžvalgą</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Sandoriai</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Apžvelgti sandorių istoriją</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Išeiti</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Išjungti programą</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Apie %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Rodyti informaciją apie %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Apie &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Rodyti informaciją apie Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Parinktys...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Užšifruoti piniginę...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Backup piniginę...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Keisti slaptafrazę...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Siunčiami adresai...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Gaunami adresai...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Atidaryti &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Blokai iš naujo indeksuojami...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Siųsti monetas Bitcoin adresui</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Daryti piniginės atsarginę kopiją</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Pakeisti slaptafrazę naudojamą piniginės užšifravimui</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Derinimo langas</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Atverti derinimo ir diagnostikos konsolę</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Tikrinti žinutę...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Piniginė</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Siųsti</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Gauti</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Rodyti / Slėpti</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Rodyti arba slėpti pagrindinį langą</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Užšifruoti privačius raktus, kurie priklauso jūsų piniginei</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Failas</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Nustatymai</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Pagalba</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Kortelių įrankinė</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Komandinės eilutės parametrai</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Klaida</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Įspėjimas</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacija</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Atnaujinta</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Vejamasi...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Sandoris nusiųstas</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Ateinantis sandoris</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Piniginė &lt;b&gt;užšifruota&lt;/b&gt; ir šiuo metu &lt;b&gt;atrakinta&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Piniginė &lt;b&gt;užšifruota&lt;/b&gt; ir šiuo metu &lt;b&gt;užrakinta&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Monetų pasirinkimas</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kiekis:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Baitai:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Suma:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Mokestis:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Po mokesčio:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Graža:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(ne)pasirinkti viską</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Medžio režimas</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Sąrašo režimas</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Suma</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Patvirtinimai</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Patvirtintas</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Keisti adresą</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>Ž&amp;ymė</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresas</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>pavadinimas</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versija</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Komandinės eilutės parametrai</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Naudojimas:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>komandinės eilutės parametrai</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Sveiki</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Klaida</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Forma</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Paskutinio bloko laikas</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Parinktys</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Pagrindinės</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Proxy IP adresas (Pvz. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Atstatyti Parinktis</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Tinklas</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Piniginė</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Automatiškai atidaryti Bitcoin kliento prievadą maršrutizatoriuje. Tai veikia tik tada, kai jūsų maršrutizatorius palaiko UPnP ir ji įjungta.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Persiųsti prievadą naudojant &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Tarpinio serverio &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Prievadas:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Tarpinio serverio preivadas (pvz, 9050)</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Langas</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Po programos lango sumažinimo rodyti tik programos ikoną.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;M sumažinti langą bet ne užduočių juostą</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>&amp;Sumažinti uždarant</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Rodymas</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Naudotojo sąsajos &amp;kalba:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Vienetai, kuriais rodyti sumas:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Rodomų ir siunčiamų monetų kiekio matavimo vienetai</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Gerai</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Atšaukti</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>numatyta</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>niekas</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Patvirtinti nustatymų atstatymą</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Kliento perkrovimas reikalingas nustatymų aktyvavimui</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Klaida</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Šis pakeitimas reikalautų kliento perkrovimo</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Nurodytas tarpinio serverio adresas negalioja.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Forma</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Galimi:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Jūsų dabartinis išleidžiamas balansas</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Laukiantys:</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Nepribrendę:</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Viso:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Jūsų balansas</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Received</source>\n        <translation>Gauta</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Suma</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>nėra</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nežinomas</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>nėra</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Kliento versija</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informacija</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Derinimo langas</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Paleidimo laikas</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Tinklas</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Pavadinimas</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Prisijungimų kiekis</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blokų grandinė</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Dabartinis blokų skaičius</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Gauta</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Kryptis</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versija</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Paskutinio bloko laikas</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Atverti</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsolė</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Viso:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Derinimo žurnalo failas</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Išvalyti konsolę</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>Niekada</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Taip</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Ne</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Suma:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>Ž&amp;ymė:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Žinutė:</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Išvalyti</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR kodas</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Kopijuoti adresą</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresas</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Siųsti monetas</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Nepakanka lėšų</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kiekis:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Baitai:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Suma:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Mokestis:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Po mokesčio:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Graža:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Sandorio mokestis:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Siųsti keliems gavėjams vienu metu</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;A Pridėti gavėją</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Išvalyti &amp;viską</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balansas:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Patvirtinti siuntimo veiksmą</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Siųsti</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Su&amp;ma:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Mokėti &amp;gavėjui:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>Ž&amp;ymė:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Įvesti adresą iš mainų atminties</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Žinutė:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Mokėti gavėjui:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Pasirašyti žinutę</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Įvesti adresą iš mainų atminties</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Įveskite pranešimą, kurį norite pasirašyti čia</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Registruotis žinute įrodymuii, kad turite šį adresą</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Registruoti praneši&amp;mą</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Išvalyti &amp;viską</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Patikrinti žinutę</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Patikrinkite žinutę, jog įsitikintumėte, kad ją pasirašė nurodytas Bitcoin adresas</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>&amp;Patikrinti žinutę</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testavimotinklas]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Šis langas sandorio detalų aprašymą</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Address</source>\n        <translation>Adresas</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Parinktys:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Nustatyti duomenų aplanką</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Nurodykite savo nuosavą viešą adresą</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Priimti komandinę eilutę ir JSON-RPC komandas</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Dirbti fone kaip šešėlyje ir priimti komandas</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin branduolys</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Klaida atveriant blokų duombazę</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Tikrinami blokai...</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacija</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Siųsti atsekimo/derinimo info į konsolę vietoj debug.log failo</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Vartotojo vardas JSON-RPC jungimuisi</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Įspėjimas</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Slaptažodis JSON-RPC sujungimams</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Leisti DNS paiešką sujungimui ir mazgo pridėjimui</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Nepakanka lėšų</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Įkeliamas blokų indeksas...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Užkraunama piniginė...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Peržiūra</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Įkėlimas baigtas</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Klaida</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_lv_LV.ts",
    "content": "<TS language=\"lv_LV\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Izveidot jaunu adresi</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Jauns</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopēt iezīmēto adresi uz starpliktuvi</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopēt</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Aizvērt</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Izdzēst iezīmētās adreses no saraksta</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Datus no tekošā ieliktņa eksportēt uz failu</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksportēt</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Dzēst</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Izvēlies adresi uz kuru sūtīt bitcoins</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Izvēlies adresi ar kuru saņemt bitcoins</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopēt adresi</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Rediģēt</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Eksportēt Adrešu Sarakstu</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksportēšana Neizdevās</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Nosaukums</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adrese</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez nosaukuma)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Paroles dialogs</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Ierakstiet paroli</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Jauna parole</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Jaunā parole vēlreiz</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Šifrēt maciņu</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Atslēgt maciņu</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Atšifrēt maciņu</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Apstiprināt maciņa šifrēšanu</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Vai tu tiešām vēlies šifrēt savu maciņu?</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Maciņa šifrēšana neizdevās</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Parakstīt &amp;ziņojumu...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sinhronizācija ar tīklu...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Pārskats</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Rādīt vispārēju maciņa pārskatu</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakcijas</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Skatīt transakciju vēsturi</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Iziet</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Aizvērt programmu</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Par &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Parādīt informāciju par Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Iespējas...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Šifrēt &amp;maciņu...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Maciņa Rezerves Kopija...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Mainīt &amp;Paroli...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Sūtīšanas adreses...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Saņemšanas &amp;adreses...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Atvērt &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Bloku reindeksēšana no diska...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Nosūtīt bitkoinus uz Bitcoin adresi</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Izveidot maciņa rezerves kopiju citur</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Mainīt maciņa šifrēšanas paroli</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Atkļūdošanas logs</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Atvērt atkļūdošanas un diagnostikas konsoli</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Pārbaudīt ziņojumu...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Maciņš</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Sūtīt</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Saņemt</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Rādīt / Paslēpt</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Parādīt vai paslēpt galveno Logu</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Šifrēt privātās atslēgas kuras pieder tavam maciņam</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Parakstīt ziņojumus ar savām Bitcoin adresēm lai pierādītu ka tās pieder tev</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Pārbaudīt ziņojumus lai pārliecinātos, ka tie tika parakstīti ar norādītajām Bitcoin adresēm</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fails</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Uzstādījumi</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Palīdzība</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Ciļņu rīkjosla</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Pieprasīt maksājumus (izveido QR kodu un bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Atvērt bitcoin URI vai maksājuma pieprasījumu</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Komandrindas iespējas</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 aizmugurē</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transakcijas pēc šī vel nebūs redzamas</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Kļūda</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Brīdinājums</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informācija</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Sinhronizēts</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Sinhronizējos...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transakcija nosūtīta</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Ienākoša transakcija</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Maciņš ir &lt;b&gt;šifrēts&lt;/b&gt; un pašlaik &lt;b&gt;atslēgts&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Maciņš ir &lt;b&gt;šifrēts&lt;/b&gt; un pašlaik &lt;b&gt;slēgts&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Daudzums:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Baiti:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Daudzums:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Maksa:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Pēc Maksas:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Atlikums:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>iezīmēt visus</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Koka režīms</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Saraksta režīms</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Daudzums</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datums</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Apstiprinājumi</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Apstiprināts</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez nosaukuma)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Mainīt adrese</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Nosaukums</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adrese</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Tiks izveidota jauna datu mape.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>vārds</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Šāds ceļš jau pastāv un tā nav mape.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Šeit nevar izveidot datu mapi.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versija</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-biti)</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Komandrindas iespējas</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Lietojums:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>komandrindas izvēles</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Sveiciens</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Izmantot noklusēto datu mapi</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Izmantot pielāgotu datu mapi:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Kļūda</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Forma</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Pēdējā bloka laiks</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Atvērt URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Atvērt maksājuma pieprasījumu no URI vai datnes</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Izvēlies maksājuma pieprasījuma datni</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Iespējas</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Galvenais</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>&amp;Datubāzes kešatmiņas izmērs</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Skriptu &amp;pārbaudes pavedienu skaits</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Starpniekservera IP adrese (piem. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimizēt nevis aizvērt aplikāciju, kad logs tiek aizvērts. Kad šī iespēja ir ieslēgta, aplikācija tiks aizvērta, izvēloties Aizvērt izvēlnē.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktīvās komandrindas opcijas, kuras pārspēko šos iestatījumus:</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Atiestatīt visus klienta iestatījumus uz noklusējumu.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Atiestatīt Iestatījumus.</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Tīkls</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Maciņš</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Eksperts</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Ieslēgt bitcoin &amp;kontroles funkcijas</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Tērēt neapstiprinātu atlikumu</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Uz rūtera automātiski atvērt Bitcoin klienta portu. Tas strādā tikai tad, ja rūteris atbalsta UPnP un tas ir ieslēgts.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Kartēt portu, izmantojot &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Starpniekservera &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Ports:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Starpniekservera ports (piem. 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Logs</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Pēc loga minimizācijas rādīt tikai ikonu sistēmas teknē.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimizēt uz sistēmas tekni, nevis rīkjoslu</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimizēt aizverot</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Izskats</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Lietotāja interfeiss un &amp;valoda:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Vienības, kurās attēlot daudzumus:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Izvēlēties dalījuma vienību pēc noklusēšanas, ko izmantot interfeisā un nosūtot bitkoinus.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Vai rādīt Bitcoin kontroles funkcijas vai nē.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Labi</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Atcelt</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>pēc noklusēšanas</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>neviena</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Apstiprināt iestatījumu atiestatīšanu</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Kļūda</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Norādītā starpniekservera adrese nav derīga.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Forma</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Attēlotā informācija var būt novecojusi. Jūsu maciņš pēc savienojuma izveides automātiski sinhronizējas ar Bitcoin tīklu, taču šis process vēl nav beidzies.</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Pieejams:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Tava pašreizējā tērējamā bilance</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Neizšķirts:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Kopējā apstiprināmo transakciju vērtība, vēl nav ieskaitīta tērējamajā bilancē</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Nenobriedušu:</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Kopsumma:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Jūsu kopējā tekošā bilance</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Daudzums</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 st</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 un %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nav zināms</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Klienta versija</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informācija</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Atkļūdošanas logs</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Vispārējs</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Sākuma laiks</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Tīkls</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Vārds</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Savienojumu skaits</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Bloku virkne</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Pašreizējais bloku skaits</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Pēdējā bloka laiks</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Atvērt</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsole</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Tīkla Satiksme</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Kopsummas</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Ie.:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Iz.:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Atkļūdošanas žurnāla datne</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Notīrīt konsoli</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Daudzums:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Nosaukums:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Ziņojums:</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Notīrīt visus laukus formā.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Notīrīt</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Pieprasīto maksājumu vēsture</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Pieprasīt maksājumu</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Parādīt atlasītos pieprasījumus (tas pats, kas dubultklikšķis uz ieraksta)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Rādīt</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Noņemt atlasītos ierakstus no saraksta.</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Noņemt</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Kods</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopēt &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopēt &amp;Adresi</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Saglabāt Attēlu...</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adrese</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nosaukums</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Nosaukums</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez nosaukuma)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Sūtīt Bitkoinus</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Bitcoin Kontroles Funkcijas</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Ieejas...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automātiski atlasīts</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Nepietiekami līdzekļi!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Daudzums:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Baiti:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Daudzums:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Maksa:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Pēc Maksas:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Atlikums:</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Pielāgota atlikuma adrese</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transakcijas maksa:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Sūtīt vairākiem saņēmējiem uzreiz</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;Pievienot Saņēmēju</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Notīrīt visus laukus formā.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Notīrīt visu</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Bilance:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Apstiprināt nosūtīšanu</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Sūtīt</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez nosaukuma)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Apjo&amp;ms</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Saņēmējs:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Nosaukums:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Izvēlies iepriekš izmantoto adresi</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Šis ir parasts maksājums.</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>ielīmēt adresi no starpliktuves</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Noņem šo ierakstu</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Ziņojums:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Maksāt:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Neizslēdziet datoru kamēr šis logs nepazūd.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Paraksti - Parakstīt / Pabaudīt Ziņojumu</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>Parakstīt &amp;Ziņojumu</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Izvēlies iepriekš izmantoto adresi</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>ielīmēt adresi no starpliktuves</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Šeit ievadi ziņojumu kuru vēlies parakstīt</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Paraksts</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopēt parakstu uz sistēmas starpliktuvi</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Parakstīt ziņojumu lai pierādītu, ka esi šīs Bitcoin adreses īpašnieks.</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Parakstīt &amp;Ziņojumu</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Atiestatīt visus laukus</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Notīrīt visu</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Pārbaudīt Ziņojumu</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>&amp;Pārbaudīt Ziņojumu</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Atiestatīt visus laukus</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnets]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Šis panelis parāda transakcijas detaļas</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Nosaukums</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez nosaukuma)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Label</source>\n        <translation>Nosaukums</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adrese</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksportēšana Neizdevās</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Iespējas:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Norādiet datu direktoriju</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Pievienoties mezglam, lai iegūtu citu mezglu adreses, un atvienoties</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Norādiet savu publisko adresi</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Pieņemt komandrindas un JSON-RPC komandas</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Darbināt fonā kā servisu un pieņemt komandas</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; var būt:</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Bloka izveidošanas iestatījumi:</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Savienojuma iestatījumi:</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Atkļūdošanas/Testēšanas iestatījumi:</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Kļūda ielādējot bloku datubāzi</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Kļūda: Zema diska vieta!</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importē...</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Pārbauda blokus...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Maciņa iespējas:</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informācija</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC servera iestatījumi:</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Debug/trace informāciju izvadīt konsolē, nevis debug.log failā</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Transakcijas parakstīšana neizdevās</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transakcijas summa ir pārāk maza</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transakcija ir pārāk liela</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>JSON-RPC savienojumu lietotājvārds</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Brīdinājums</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>JSON-RPC savienojumu parole</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Izpildīt komandu, kad labāk atbilstošais bloks izmainās (%s cmd aizvieto ar bloka hešu)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Atļaut DNS uzmeklēšanu priekš -addnode, -seednode un -connect</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>-onlynet komandā norādīts nepazīstams tīkls: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Nepietiek bitkoinu</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Ielādē bloku indeksu...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Ielādē maciņu...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Nevar maciņa formātu padarīt vecāku</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Skanēju no jauna...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Ielāde pabeigta</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Kļūda</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_mk_MK.ts",
    "content": "<TS language=\"mk_MK\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Десен клик за уредување на адреса или етикета</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Креирај нова адреса</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Нова</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Копирај ја избраната адреса на системскиот клипборд</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Копирај</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>З&amp;атвори</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Избриши ја избраната адреса од листата</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Експортирај ги податоците од активното јазиче во датотека</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Експорт</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Избриши</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Внеси тајна фраза</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Нова тајна фраза</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Повторете ја новата тајна фраза</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Потпиши &amp;порака...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Синхронизација со мрежата...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Преглед</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Јазол</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Трансакции</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Преглед на историјата на трансакции</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>И&amp;злез</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Напушти ја апликацијата</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>За &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Прикажи информации за Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Опции...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Криптирање на Паричник...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Бекап на Паричник...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Измени Тајна Фраза...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Адреси за Испраќање...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Адреси за Примање...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Отвори &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Повторно индексирање на блокови од дискот...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Испрати биткоини на Биткоин адреса</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Потврди порака...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Биткоин</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Паричник</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Испрати</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Прими</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Прикажи / Сокриј</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Криптирај ги приватните клучеви кои припаѓаат на твојот паричник</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Подесувања</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Помош</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Обработен %n блок од историјата на трансакции.</numerusform><numerusform>Обработени %n блокови од историјата на трансакции.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 позади</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Грешка</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Предупредување</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Во тек</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Дата: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Сума: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Тип: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Етикета: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Адреса: %1\n</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Bytes:</source>\n        <translation>Бајти:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Сума:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Провизија:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Прашина:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>После Провизија:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Кусур:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Сума</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Измени Адреса</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Етикета</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Адреса</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>име</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>верзија</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-бит)</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Биткоин</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Грешка</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Отвори URI</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Опции</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>МБ</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Мрежа</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>П&amp;аричник</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Прозорец</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;ОК</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Откажи</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>нема</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Грешка</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Total:</source>\n        <translation>Вкупно:</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>Испратени</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Сума</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 д</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 ч</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 м</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 с</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 мс</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 и %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 Б</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 КБ</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 МБ</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 ГБ</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>Network</source>\n        <translation>Мрежа</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Име</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Број на конекции</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Block chain</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Испратени</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Верзија</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Конзола</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Сума:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Етикета:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Порака:</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Прикажи</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Код</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Копирај &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Копирај &amp;Адреса</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Сними Слика...</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Bytes:</source>\n        <translation>Бајти:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Сума:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Провизија:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>После Провизија:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Кусур:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Прашина:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Сума:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Етикета:</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Порака:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Опции:</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Биткоин Core</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Предупредување</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Грешка</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ml.ts",
    "content": "<TS language=\"ml\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>വിലാസം അല്ലെങ്കിൽ ലേബൽ എഡിറ്റുചെയ്യാൻ വലത് ക്ലിക്കുചെയ്യുക</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>ഒരു പുതിയ വിലാസം സൃഷ്ടിക്കുക</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;പുതിയത്</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>നിലവിൽ തിരഞ്ഞെടുത്ത വിലാസം സിസ്റ്റം ക്ലിപ്പ്ബോർഡിലേക്ക് പകർത്തുക</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp; പകർത്തുക\n</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>അ&amp;ടയ്ക്കുക</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>പട്ടികയിൽ നിന്ന് നിലവിൽ തിരഞ്ഞെടുത്ത വിലാസം ഇല്ലാതാക്കുക</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>നിലവിലെ ടാബിൽ ഒരു ഫയലിൽ ഡാറ്റ എക്സ്പോർട്ട് ചെയ്യുക</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp; കയറ്റുമതി ചെയ്യുക</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;ഇല്ലാതാക്കുക</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>നാണയങ്ങൾ അയയ്ക്കാനുള്ള വിലാസം തിരഞ്ഞെടുക്കുക</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>നാണയങ്ങൾ സ്വീകരിക്കാൻ വിലാസം തിരഞ്ഞെടുക്കുക</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>തി&amp;രഞ്ഞെടുക്കുക</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>വിലാസങ്ങൾ അയയ്ക്കുന്നു</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>സ്വീകരിക്കുന്ന വിലാസങ്ങൾ</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>പേയ്മെന്റുകൾ അയയ്ക്കുന്നതിനുള്ള നിങ്ങളുടെ ബിറ്റ്കോയിൻ വിലാസങ്ങളാണ് ഇവ. നാണയങ്ങൾ അയയ്ക്കുന്നതിനുമുമ്പ് എല്ലായ്പ്പോഴും തുകയും സ്വീകരിക്കുന്ന വിലാസവും പരിശോധിക്കുക.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>പേയ്മെന്റ് സ്വീകരിക്കുന്നതിന് നിങ്ങളുടെ ബിറ്റ്കോയിൻ വിലാസങ്ങളാണ് ഇവ. ഓരോ ഇടപാടിനും പുതിയ സ്വീകരിക്കുന്ന വിലാസം ഉപയോഗിക്കുന്നതാണ് ഉചിതം.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;വിലാസം പകർത്തുക</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>പകർത്തുക &amp;ലേബൽ</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;ചിട്ടപ്പെടുത്തുക</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>കയറ്റുമതി വിലാസ ലിസ്റ്റ്</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>കോമയാൽ വേർതിരിച്ച ഫയൽ (* .csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>കയറ്റുമതി പരാജയപ്പെട്ടു</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ലേബൽ</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>വിലാസം</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ലേബൽ ഇല്ല)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>രഹസ്യപദപ്രയോഗ സംഭാഷണം</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>രഹസ്യപദപ്രയോഗം നൽകുക</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>പുതിയ രഹസ്യപദപ്രയോഗം</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>പുതിയ രഹസ്യപദപ്രയോഗം ആവർത്തിക്കുക</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>വാലറ്റിൽ പുതിയ രഹസ്യപദപ്രയോഗം നൽകുക. &lt;br/&gt; &lt;b&gt; പത്തോ അതിലധികമോ റാൻഡം പ്രതീകങ്ങൾ &lt;/ b&gt; അല്ലെങ്കിൽ &lt;b&gt; എട്ട് അല്ലെങ്കിൽ അതിൽ കൂടുതൽ വാക്കുകൾ &lt;/ b&gt; ഒരു രഹസ്യപദപ്രയോഗം ഉപയോഗിക്കുക.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>വാലറ്റ് എൻക്രിപ്റ്റ് ചെയ്യുക</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>നിങ്ങളുടെ വാലറ്റ് അൺലോക്കുചെയ്യാൻ ഈ പ്രവർത്തനത്തിന് നിങ്ങളുടെ വാലറ്റ് രഹസ്യപദപ്രയോഗം ആവശ്യമാണ്.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>വാലറ്റ് അൺലോക്ക് ചെയ്യുക</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>ഈ പ്രവർത്തനത്തിന് വാലറ്റ് ഡീക്രിപ്റ്റ് ചെയ്യുന്നതിന് നിങ്ങളുടെ വാലറ്റ് പാസ്ഫ്രെയ്സ് ആവശ്യമാണ്.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>വാലറ്റ് ഡീക്രിപ്റ്റ് ചെയ്യുക</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>പാസ്ഫ്രെയ്സ് മാറ്റുക</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>പഴയ രഹസ്യപദപ്രയോഗം പുതിയ രഹസ്യപദപ്രയോഗം വാലറ്റിൽ നൽകുക.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>വാലറ്റ് എൻക്രിപ്ഷൻ സ്ഥിരീകരിക്കുക</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>മുന്നറിയിപ്പ്: നിങ്ങളുടെ വാലറ്റ് എൻക്രിപ്റ്റ് ചെയ്ത് പാസ്ഫ്രെയ്സ് നഷ്ടപ്പെടുകയാണെങ്കിൽ, നിങ്ങളുടെ എല്ലാ ബിറ്റ്കൊയിനുകളും നഷ്ടപ്പെടും!</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(ലേബൽ ഇല്ല)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>വിലാസം</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ലേബൽ</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ലേബൽ</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ലേബൽ ഇല്ല)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(ലേബൽ ഇല്ല)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ലേബൽ</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ലേബൽ ഇല്ല)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>കോമയാൽ വേർതിരിച്ച ഫയൽ (* .csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ലേബൽ</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>വിലാസം</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>കയറ്റുമതി പരാജയപ്പെട്ടു</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp; കയറ്റുമതി ചെയ്യുക</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>നിലവിലെ ടാബിൽ ഒരു ഫയലിൽ ഡാറ്റ എക്സ്പോർട്ട് ചെയ്യുക</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_mn.ts",
    "content": "<TS language=\"mn\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Шинэ хаяг нээх</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Шинэ</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Одоогоор сонгогдсон байгаа хаягуудыг сануулах</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Хуулах</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Хаах</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Одоо сонгогдсон байгаа хаягуудыг жагсаалтаас устгах</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Сонгогдсон таб дээрхи дата-г экспортлох</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Экспортдлох</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Устгах</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Нууц үгийг оруул</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Шинэ нууц үг</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Шинэ нууц үгийг давтана уу</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>&amp;Зурвас хавсаргах...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Сүлжээтэй тааруулж байна...</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Нод</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>Гүйлгээнүүд</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Гүйлгээнүүдийн түүхийг харах</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Гарах</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Програмаас Гарах</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;Клиентийн тухай</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Клиентийн тухай мэдээллийг харуул</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Сонголтууд...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Түрүйвчийг цоожлох...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Түрүйвчийг Жоорлох...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Нууц Үгийг Солих...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Хүлээн авах хаяг</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Түрүйвчийг цоожлох нууц үгийг солих</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Оношилгоо ба засварын консолыг онгойлго</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Биткойн</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Түрүйвч</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Харуул / Нуу</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Файл</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Тохиргоо</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Тусламж</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Алдаа</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Мэдээллэл</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Шинэчлэгдсэн</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Гадагшаа гүйлгээ</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Дотогшоо гүйлгээ</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Түрүйвч &lt;b&gt;цоожтой&lt;/b&gt; ба одоогоор цоож &lt;b&gt;онгорхой&lt;/b&gt; байна</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Түрүйвч &lt;b&gt;цоожтой&lt;/b&gt; ба одоогоор цоож &lt;b&gt;хаалттай&lt;/b&gt; байна</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>Хэмжээ:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Тѳлбѳр:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Хэмжээ</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Огноо</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Баталгаажлаа</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Хаягийг ѳѳрчлѳх</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Шошго</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Хаяг</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>хувилбар</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Хэрэглээ:</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Биткойн</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Алдаа</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Last block time</source>\n        <translation>Сүүлийн блокийн хугацаа</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Сонголтууд</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>МБ</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>проксигийн IP хаяг (жишээ нь: IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>Сүлжээ</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Түрүйвч</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Ѳѳрчлѳлтүүдийг идэвхижүүлхийн тулд клиентийг ахин эхлүүлэх шаардлагтай</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Алдаа</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Энэ ѳѳрчлѳлтийг оруулахын тулд кли1нт програмыг ахин эхлүүлэх шаардлагтай</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Available:</source>\n        <translation>Хэрэглэж болох хэмжээ:</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Хэмжээ</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Алга Байна</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>үл мэдэгдэх</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Алга Байна</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Клиентийн хувилбар</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Мэдээллэл</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Ерѳнхий</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Сүлжээ</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Нэр</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Холболтын тоо</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Блокийн цуваа</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Одоогийн блокийн тоо</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Сүүлийн блокийн хугацаа</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Нээх</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Консол</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Консолыг цэвэрлэх</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Хэмжээ:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Шошго:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Зурвас:</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Харуул</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Сонгогдсон ѳгѳгдлүүдийг устгах</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Устгах</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Хаягийг &amp;Хуулбарлах</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Зоос явуулах</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>автоматаар сонгогдсон</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Таны дансны үлдэгдэл хүрэлцэхгүй байна!</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Хэмжээ:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Тѳлбѳр:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Нэгэн зэрэг олон хүлээн авагчруу явуулах</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;Хүлээн авагчийг Нэмэх</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Бүгдийг Цэвэрлэ</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Баланс:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Явуулах үйлдлийг баталгаажуулна уу</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>Яв&amp;уул</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Дүн:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Тѳлѳх &amp;хаяг:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Шошго:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Копидсон хаягийг буулгах</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Зурвас:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Тѳлѳх хаяг:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Энэ цонхыг хаагдтал компьютерээ бүү унтраагаарай</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Копидсон хаягийг буулгах</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Бүгдийг Цэвэрлэ</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Гүйлгээний дэлгэрэнгүйг энэ бичил цонх харуулж байна</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Сонголтууд:</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Түрүйвчийн сонголтууд:</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Мэдээллэл</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Таны дансны үлдэгдэл хүрэлцэхгүй байна</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Блокийн индексүүдийг ачааллаж байна...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Түрүйвчийг ачааллаж байна...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Ахин уншиж байна...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Ачааллаж дууслаа</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Алдаа</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_mr_IN.ts",
    "content": "<TS language=\"mr_IN\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>पत्ता किंवा लेबल संपादित करण्यासाठी उजवे बटण क्लिक करा.</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>एक नवीन पत्ता तयार करा</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;नवा</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>सध्याचा निवडलेला पत्ता सिस्टीम क्लिपबोर्डावर कॉपी करा</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;कॉपी</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;बंद करा</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>सध्याचा निवडलेला पत्ता यादीमधून काढून टाका</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>सध्याच्या टॅबमधील डेटा एका फाईलमध्ये एक्स्पोर्ट करा</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;एक्स्पोर्ट</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;काढून टाका</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>ज्या पत्त्यावर नाणी पाठवायची आहेत तो निवडा</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>ज्या पत्त्यावर नाणी प्राप्त करायची आहेत तो </translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;निवडा</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>प्रेषक पत्ते</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>स्वीकृती पत्ते</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>पैसे पाठविण्यासाठीचे हे तुमचे बिटकॉईन पत्त्ते आहेत. नाणी पाठविण्यापूर्वी नेहमी रक्कम आणि प्राप्त होणारा पत्ता तपासून पहा.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>पैसे प्राप्त करण्यासाठीचे हे तुमचे बिटकॉईन पत्त्ते आहेत. प्रत्येक व्यवहारासाठी एक नवा स्वीकृती पत्ता वापरण्याची शिफारस सहसा केली जाते.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;पत्ता कॉपी करा</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>&amp;लेबल कॉपी करा</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;संपादित</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>सध्याच्या टॅबमधील डेटा एका फाईलमध्ये एक्स्पोर्ट करा</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ms.ts",
    "content": "<TS language=\"ms\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Baru</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksport maklumat dalam halaman sekarang kepada fail</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Pilih alamat untuk menghantar koin kepada</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Pilih alamat untuk menerima koin</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Alamat koin penghantaran</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Alamat penerima</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Eksport senarai alamat</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksport gagal</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialog Katalaluan</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Masukkan Katalaluan</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Katalaluan baru</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ulang katalaluan baru</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Menyulitkan wallet</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Operasi ini memerlukan katalaluan wallet untuk menyahsulitkan wallet</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Menyahsulitkan wallet</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksport gagal</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksport maklumat dalam halaman sekarang kepada fail</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ms_MY.ts",
    "content": "<TS language=\"ms_MY\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Klik-kanan untuk edit alamat ataupun label</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Cipta alamat baru</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Baru</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Salin alamat terpilih ke dalam sistem papan klip</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Salin</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Tutup</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Padam alamat semasa yang dipilih dari senaraiyang dipilih dari senarai</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>\nAlihkan fail data ke dalam tab semasa</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksport</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Padam</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Pilih alamat untuk hantar koin kepada</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Pilih alamat untuk menerima koin dengan</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Pilih</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>alamat-alamat penghantaran</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>alamat-alamat penerimaan</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Ini adalah alamat Bitcoin anda untuk pembayaran. Periksa jumlah dan alamat penerima sebelum membuat penghantaran koin sentiasa.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Ini adalah alamat Bitcoin anda untuk menerima pembayaraan.  Anda disyorkan untuk menguna alamat menerima untuk setiap transaksi.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Salin Aamat</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Salin &amp; Label</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Edit</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Eskport Senarai Alamat</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fail dibahagi oleh koma(*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Mengeksport Gagal</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Terdapat ralat semasa cubaan menyimpan senarai alamat kepada %1. Sila cuba lagi.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tiada label)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialog frasa laluan</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>memasukkan frasa laluan</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Frasa laluan baru</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ulangi frasa laluan baru</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Memasukkan frasa laluan baru kepada dompet.&lt;br/&gt;Sila mengunakkan frasa laluan yang&lt;b&gt;mengandungi 10 atau lebih aksara rawak&lt;/b&gt;,ataupun&lt;b&gt;lapan atau lebih perkataan.&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Dompet encrypt</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Operasi ini perlukan frasa laluan dompet anda untuk membuka kunci dompet.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Membuka kunci dompet</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Operasi ini memerlukan frasa laluan dompet anda untuk menyahsulit dompet.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Menyahsulit dompet</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Menukar frasa laluan</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Memasukkan frasa laluan lama dan frasa laluan baru untuk.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Mengesahkan enkripsi dompet</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Amaran: Jika anda enkripkan dompet anda dan hilangkan frasa laluan, anda akan &lt;b&gt;ANDA AKAN HILANGKAN SEMUA BITCOIN ANDA&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Anda pasti untuk membuat enkripsi dompet anda?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Dompet dienkripsi</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 akan tutup untuk menyelesaikan proses enkripsi. Ingat bahawa enkripsi tidak boleh melidungi sepenuhnya bitcoins anda daripada dicuri oleh malware yang menjangkiti komputer anda.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>PENTING: Apa-apa sandaran yang anda buat sebelum ini untuk fail dompet anda hendaklah digantikan dengan fail dompet enkripsi yang dijana baru. Untuk sebab-sebab keselamatan , sandaran fail dompet yang belum dibuat enkripsi sebelum ini akan menjadi tidak berguna secepat anda mula guna dompet enkripsi baru.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Enkripsi dompet gagal</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Enkripsi dompet gagal kerana ralat dalaman. Dompet anda tidak dienkripkan.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Frasa laluan yang dibekalkan tidak sepadan.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Pembukaan kunci dompet gagal</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Frasa laluan dimasukki untuk dekripsi dompet adalah tidak betul.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Dekripsi dompet gagal</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Frasa laluan dompet berjaya ditukar.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Amaran: Kunci Caps Lock buka!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Diharamkan sehingga</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Tandatangan &amp; mesej...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Penyegerakan dengan rangkaian...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Gambaran Keseluruhan</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nod</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Tunjuk gambaran keseluruhan umum dompet</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaksi</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Menyemak imbas sejarah transaksi </translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Keluar</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Berhenti aplikasi</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Mengenai%1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Menunjuk informasi mengenai%1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Mengenai &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Menunjuk informasi megenai Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>Pilihan</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Mengubah suai pilihan konfigurasi untuk %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Enkripsi Dompet</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Dompet Sandaran...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Menukar frasa-laluan</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Menghantar frasa-laluan</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Menerima frasa-laluan...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Buka &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Tekan untuk lumpuhkan rangkaian</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Aktiviti rangkaian dilumpuhkan</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Tekan untuk mengaktifkan rangkain semula</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Penyelarasn tajuk (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexi blok pada cakera...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Menghantar koin kepada alamat Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Wallet sandaran ke lokasi lain</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Tukar kata laluan untuk dompet disulitkan</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Tetingkap windows</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>buka debug dan konsol diagnostik</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>sahkan mesej</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>dompet</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>hantar</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>terima</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;tunjuk/sembunyi</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>tunjuk atau sembunyi tetingkap utama</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>sulitkan kata laluan milik peribadi anda </translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>sahkan mesej bersama alamat bitcoin anda untuk menunjukkan alamat ini anda punya</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Sahkan mesej untuk memastikan mereka telah ditandatangani dengan alamat Bitcoin yang ditentukan</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>fail</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>tetapan</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>tolong</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(tiada label)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>Alamat</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Salin Alamat</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tiada label)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Balance:</source>\n        <translation>Baki</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tiada label)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(tiada label)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fail dibahagi oleh koma(*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Alamat</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Mengeksport Gagal</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>\nAlihkan fail data ke dalam tab semasa</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_my.ts",
    "content": "<TS language=\"my\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>လိပ်စာ သို့မဟုတ် ခေါင်းစဉ်တပ်ရန် Right-click နှိပ်ပါ။</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>လိပ်စာအသစ်ယူမယ်။</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;အသစ်</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>လက်ရှိရွေးထားတဲ့ လိပ်စာကို clipboard ပေါ်တင်မယ်။</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;ကူးမယ်</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>လက်ရှိရွေးထားတဲ့ လိပ်စာကို ဖျက်မယ်။</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>လက်ရှိ tab မှာရှိတဲ့ဒေတာတွေကို ဖိုင်လ်မှာသိမ်းမယ်။</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;ထုတ်ယူသိမ်းဆည်း</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;ဖျက်</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;ထုတ်ယူသိမ်းဆည်း</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>လက်ရှိ tab မှာရှိတဲ့ဒေတာတွေကို ဖိုင်လ်မှာသိမ်းမယ်။</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_nb.ts",
    "content": "<TS language=\"nb\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Høyreklikk for å redigere adressen eller merkelappen</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Opprett en ny addresse</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Ny</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopier den valgte adressen til systemets utklippstavle</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopier</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Lukk</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Slett den valgte adressen fra listen.</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksporter data fra nåværende fane til fil</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksporter</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Slett</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Velg adressen å sende mynter til</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Velg adressen til å motta mynter med</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>V&amp;elg</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Utsendingsadresser</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Mottaksadresser</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Dette er dine Bitcoin-adresser for sending av betalinger. Sjekk alltid beløpet og mottakeradressen før sending av mynter.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Dette er dine Bitcoin-adresser for å sende betalinger med. Det er anbefalt å bruke en ny mottaksadresse for hver transaksjon.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopier Adresse</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopier &amp;Merkelapp</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Rediger</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Eksporter adresseliste</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Kommaseparert fil (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksportering feilet</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Det oppstod en feil under lagring av adresselisten til %1. Vennligst prøv på nytt.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Merkelapp</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen merkelapp)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialog for Adgangsfrase</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Angi adgangsfrase</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Ny adgangsfrase</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Gjenta ny adgangsfrase</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Vis passord</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Oppgi adgangsfrasen til lommeboken.&lt;br/&gt;Vennligst bruk en adgangsfrase med &lt;b&gt;ti eller flere tilfeldige tegn&lt;/b&gt;, eller &lt;b&gt;åtte eller flere ord&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Krypter lommebok</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Denne operasjonen krever adgangsfrasen til lommeboken for å låse den opp.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Lås opp lommebok</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Denne operasjonen krever adgangsfrasen til lommeboken for å dekryptere den.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dekrypter lommebok</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Endre adgangsfrase</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Angi den gamle og en ny adgangsfrase til lommeboken.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Bekreft kryptering av lommebok</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Advarsel: Hvis du krypterer lommeboken og mister adgangsfrasen, så vil du &lt;b&gt;MISTE ALLE DINE BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Er du sikker på at du vil kryptere lommeboken?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Lommebok kryptert</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 vil nå lukkes for å fullføre krypteringsprosessen. Husk at kryptering av lommeboken ikke fullt ut kan beskytte dine bitcoins fra å bli stjålet om skadevare infiserer datamaskinen din.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>VIKTIG: Tidligere sikkerhetskopier av din lommebokfil bør erstattes med den nylig genererte og krypterte filen, da de blir ugyldiggjort av sikkerhetshensyn så snart du begynner å bruke den nye krypterte lommeboken.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Kryptering av lommebok feilet</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Kryptering av lommebok feilet på grunn av en intern feil. Din lommebok ble ikke kryptert.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>De angitte adgangsfrasene er ulike.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Opplåsing av lommebok feilet</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Adgangsfrasen angitt for dekryptering av lommeboken var feil.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Dekryptering av lommebok feilet</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Adgangsfrase for lommebok er endret.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Advarsel: Caps Lock er på!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Nettmaske</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Utestengt til</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signer &amp;melding...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synkroniserer med nettverk...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Oversikt</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Vis generell oversikt over lommeboken</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaksjoner</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Vis transaksjonshistorikk</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Avslutt</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Avslutt applikasjonen</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation> &amp;Om %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Vis informasjon om %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Om &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Vis informasjon om Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Innstillinger...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Endre innstilinger for %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Krypter Lommebok...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Lag &amp;Sikkerhetskopi av Lommebok...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Endre Adgangsfrase...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Utsendingsadresser...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Mottaksadresser...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Åpne &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Klikk for å deaktivere nettverksaktivitet.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Nettverksaktivitet deaktivert.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Klikk for å aktivere nettverksaktivitet igjen.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synkroniserer blokkhoder (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindekserer blokker på harddisk...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Send til en Bitcoin-adresse</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Sikkerhetskopier lommebok til annet sted</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Endre adgangsfrasen brukt for kryptering av lommebok</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Feilsøkingsvindu</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Åpne konsoll for feilsøk og diagnostikk</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifiser melding...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Lommebok</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Send</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Motta</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Vis / Skjul</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Vis eller skjul hovedvinduet</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Krypter de private nøklene som tilhører lommeboken din</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signer en melding med Bitcoin-adressene dine for å bevise at du eier dem</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Bekreft meldinger for å være sikker på at de ble signert av en angitt Bitcoin-adresse</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fil</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Innstillinger</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Hjelp</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Verktøylinje for faner</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Forespør betalinger (genererer QR-koder og bitcoin: URIer)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Vis listen av brukte utsendingsadresser og merkelapper</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Vis listen over bruke mottaksadresser og merkelapper</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Åpne en Bitcoin: URI eller betalingsetterspørring</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Kommandolinjevalg</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktiv forbindelse til Bitcoin-nettverket</numerusform><numerusform>%n aktive forbindelser til Bitcoin-nettverket</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indekserer blokker på disk...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Prosesserer blokker på disk...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Lastet %n blokk med transaksjonshistorikk.</numerusform><numerusform>Lastet %n blokker med transaksjonshistorikk.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 bak</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Siste mottatte blokk ble generert for %1 siden.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transaksjoner etter dette vil ikke være synlige enda.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Feil</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Advarsel</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informasjon</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Oppdatert</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Vis %1 hjelpemeldingen for å få en liste med mulige Bitcoin kommandolinjevalg.</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 klient</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Kobler til likemannsnettverket...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Laster ned...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Dato: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Beløp: %1:\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Type: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Merkelapp: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresse: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Sendt transaksjon</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Innkommende transaksjon</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD nøkkelgenerering er &lt;b&gt;aktivert&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD nøkkelgenerering er&lt;b&gt;deaktivert&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Lommeboken er &lt;b&gt;kryptert&lt;/b&gt; og for tiden &lt;b&gt;låst opp&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Lommeboken er &lt;b&gt;kryptert&lt;/b&gt; og for tiden &lt;b&gt;låst&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>En fatal feil har inntruffet. Bitcoin kan ikke lenger trygt fortsette, og må derfor avslutte.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Mynt Valg</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Mengde:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Beløp:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Avgift:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Støv:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Totalt:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Veksel:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>velg (fjern) alle</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Trevisning</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Listevisning</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Beløp</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Mottatt med merkelapp</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Mottatt med adresse</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Bekreftelser</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bekreftet</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiér adresse</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiér merkelapp</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiér beløp</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopier transaksjons-ID</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Lås ubrukte</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Lås opp ubrukte</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopiér mengde</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopiér gebyr</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopiér totalt</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopiér bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopiér støv</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopier veksel</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 låst)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ja</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nei</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Denne merkelappen blir rød hvis en mottaker får mindre enn gjeldende støvterskel.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Kan variere +/- %1 satoshi(er) per input.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen merkelapp)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>veksel fra %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(veksel)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Rediger adresse</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Merkelapp</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Merkelappen koblet til denne adresseliste oppføringen</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Adressen til denne oppføringen i adresseboken. Denne kan kun endres for utsendingsadresser.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresse</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Ny mottaksadresse</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Ny utsendingsadresse</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Rediger mottaksadresse</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Rediger utsendingsadresse</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Den angitte adressen \"%1\" er ikke en gyldig Bitcoin-adresse.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Den angitte adressen \"%1\" er allerede i adresseboken.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Kunne ikke låse opp lommebok.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Generering av ny nøkkel feilet.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>En ny datamappe vil bli laget.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>navn</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Mappe finnes allerede. Legg til %1 hvis du vil lage en ny mappe her.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Snarvei finnes allerede, og er ikke en mappe.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Kan ikke lage datamappe her.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versjon</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation> (%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Om %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Kommandolinjevalg</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Bruk:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>kommandolinjevalg</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Grensesnittvalg:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Velg datakatalog for oppstart (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Sett språk, for eksempel \"nb_NO\" (default: system-«locale»)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Begynn minimert</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Sett SSL-rootsertifikat for betalingshenvendelser (default: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Vis velkomstbilde ved oppstart (default: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Nullstill alle innstillinger endret i det grafiske brukergrensesnittet</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Velkommen</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Velkommen til %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Siden dette er første gang programmet starter, kan du nå velge hvor %1 skal lagre sine data.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Når du klikker OK, vil %1 starte nedlasting og behandle hele den %4 blokkjeden (%2GB) fra de eldste transaksjonene i %3 når %4 først startet.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Den initielle synkroniseringen er svært krevende, og kan forårsake problemer med maskinvaren i datamaskinen din som du tidligere ikke merket. Hver gang du kjører %1 vil den fortsette nedlastingen der den sluttet. </translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Hvis du har valgt å begrense blokkjedelagring (beskjæring), må historiske data fortsatt lastes ned og behandles, men de vil bli slettet etterpå for å holde bruken av lagringsplass lav. </translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Bruk standard datamappe</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Bruk en egendefinert datamappe:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Minst %1 GB data vil bli lagret i denne mappen og den vil vokse over tid.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Omtrent %1GB data vil bli lagret i denne mappen.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 vil laste ned og lagre en kopi av Bitcoin blokkjeden.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Lommeboken vil også bli lagret i denne mappen.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Feil: Den oppgitte datamappen \"%1\" kan ikke opprettes.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Feil</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB med ledig lagringsplass</numerusform><numerusform>%n GB med ledig lagringsplass</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(av %n GB som trengs)</numerusform><numerusform>(av %n GB som trengs)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Skjema</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Det kan hende nylige transaksjoner ikke vises enda, og at lommeboksaldoen dermed blir uriktig. Denne informasjonen vil rette seg når synkronisering av lommeboka mot bitcoin-nettverket er fullført, som anvist nedenfor.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Forsøk på å bruke bitcoin som er påvirket av transaksjoner som ikke er vist enda godtas ikke av nettverket.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Antall gjenværende blokker</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Ukjent...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Tidspunkt for siste blokk</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Fremgang</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Fremgangen stiger hver time</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>kalkulerer...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Estimert gjenstående tid før ferdig synkronisert</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Skjul</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Ukjent. Synkroniserer hoder (%1)…</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Åpne URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Åpne betalingsetterspørring fra URI eller fil</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Velg fil for betalingsetterspørring</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Velg betalingsforespørselsfil å åpne</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Innstillinger</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Hoved</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Start %1 automatisk etter å ha logget inn på systemet.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Start %1 ved systeminnlogging</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Størrelse på &amp;database hurtigbuffer</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Antall script &amp;verifikasjonstråder</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP-adressen til proxyen (f.eks. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Viser hvorvidt angitt SOCKS5-mellomtjener blir brukt for å nå noder via denne nettverkstypen.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Bruk egen SOCKS&amp;5-proxy for å nå noder via Tor hidden services:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Skjul ikonet fra systemkurven.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Skjul systemkurvsikon</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimer i stedet for å avslutte applikasjonen når vinduet lukkes. Når dette er valgt, vil applikasjonen avsluttes kun etter at Avslutte er valgt i menyen.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Tredjepart URLer (f. eks. en blokkutforsker) som dukker opp i transaksjonsfanen som kontekst meny elementer. %s i URLen er erstattet med transaksjonen sin hash. Flere URLer er separert av en vertikal linje |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktive kommandolinjevalg som overstyrer valgene ovenfor:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Åpne %1-oppsettsfila fra arbeidsmappen.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Åpne oppsettsfil</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Tilbakestill alle klient valg til standard</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Tilbakestill Instillinger</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Nettverk</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automatisk, &lt;0 = la så mange kjerner være ledig)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>L&amp;ommebok</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Ekspert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Aktiver &amp;myntkontroll funksjoner</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Hvis du sperrer for bruk av ubekreftet veksel, kan ikke vekselen fra transaksjonen bli brukt før transaksjonen har minimum en bekreftelse. Dette påvirker også hvordan balansen din blir beregnet.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Bruk ubekreftet veksel</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Åpne automatisk Bitcoin klientporten på ruteren. Dette virker kun om din ruter støtter UPnP og dette er påslått.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Sett opp port ved hjelp av &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Tillat tilkoblinger fra utsiden</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Tillatt innkommend&amp;e tilkoblinger</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Koble til Bitcoin-nettverket gjennom en SOCKS5 proxy.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Koble til gjennom SOCKS5 proxy (standardvalg proxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Proxyens port (f.eks. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Brukt for å nå noder via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Koble til Bitcoin-nettverket gjennom en separat SOCKS5 mellomtjener for Tor skjulte tjenester.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Vindu</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Vis kun ikon i systemkurv etter minimering av vinduet.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimer til systemkurv istedenfor oppgavelinjen</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimer ved lukking</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Visning</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Språk for brukergrensesnitt</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Brukergrensesnittspråket kan endres her. Denne innstillingen trer i kraft etter omstart av %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Enhet for visning av beløper:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Velg standard delt enhet for visning i grensesnittet og for sending av bitcoins.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Skal myntkontroll funksjoner vises eller ikke.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>Tredjepart transaksjon URLer</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Avbryt</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>standardverdi</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>ingen</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Bekreft tilbakestilling av innstillinger</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Omstart av klienten er nødvendig for å aktivere endringene.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Klienten vil bli lukket. Ønsker du å gå videre?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Oppsettsvalg</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Oppsettsfil brukt for å angi avanserte brukervalg som overstyrer innstillinger gjort i grafisk brukergrensesnitt. I tillegg vil enhver handling utført på kommandolinjen overstyre denne oppsettsfila.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Feil</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Kunne ikke åpne oppsettsfila.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Denne endringen krever omstart av klienten.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Angitt proxyadresse er ugyldig.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Skjema</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Informasjonen som vises kan være foreldet. Din lommebok synkroniseres automatisk med Bitcoin-nettverket etter at tilkobling er opprettet, men denne prosessen er ikke ferdig enda.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Kun observerbar:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Tilgjengelig:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Din nåværende saldo</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Under behandling:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Totalt antall ubekreftede transaksjoner som ikke teller med i saldo</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Umoden:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Minet saldo har ikke modnet enda</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldoer</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Totalt:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Din nåværende saldo</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Din nåværende balanse i kun observerbare adresser</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Kan brukes:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Nylige transaksjoner</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Ubekreftede transaksjoner til kun observerbare adresser</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Utvunnet balanse i kun observerbare adresser som ennå ikke har modnet</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Nåværende totale balanse i kun observerbare adresser</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Feil ved betalingsforespørsel</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Kan ikke starte bitcoin: Klikk-og-betal håndterer</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI-håndtering</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Nettadressen for betalingsforespørselshenting er ugyldig: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Ugyldig betalingsadresse %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI kan ikke fortolkes! Dette kan være forårsaket av en ugyldig bitcoin-adresse eller feilformede URI-parametre.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Håndtering av betalingsforespørselsfil</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Betalingsforespørselsfila kan ikke leses! Dette kan ha sitt opphav i at den er ugyldig.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Betalingsforespørsel avslått</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Betalingsforespørselsnettverket samsvarer ikke med klientnettverket.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Tidsavbrudd for betalingsforespørsel</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Betalingsforespørselen er ikke igangsatt.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Uverifiserte betalingsforespørsler til egentilpassede betalingsskript støttes ikke.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Ugyldig betalingsforespørsel.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Forespurt betalingsbeløp på %1 er for lite (betraktet som støv).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Tilbakebetaling fra %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Betalingsforespørsel %1 er for stor (%2 byte, %3 byte tillatt).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Feil under kommunikasjon med %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Betalingsforespørselen kan ikke tolkes!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Feilaktig svar fra tjeneren %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Nettverksforespørselsfeil</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Betaling anerkjent</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Brukeragent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Node/Tjeneste</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>NodeId</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Nettverkssvarkall</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Sendt</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Mottatt</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Beløp</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Oppgi en Bitcoin-adresse (f.eks. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 t</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Ingen</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>-</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n sekund</numerusform><numerusform>%n sekunder</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minutt</numerusform><numerusform>%n minutter</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n time</numerusform><numerusform>%n timer</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n dag</numerusform><numerusform>%n dager</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n uke</numerusform><numerusform>%n uker</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 og %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n år</numerusform><numerusform>%n år</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 har ikke avsluttet trygt enda…</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ukjent</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Feil: Den spesifiserte datamappen \"%1\" finnes ikke.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Feil: Kan ikke lese oppsettsfil: %1. Bruk kun syntaksen nøkkel=verdi.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Feil: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Lagre bilde...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Kopier bilde</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Lagre QR-kode</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG-bilde (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>-</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Klientversjon</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informasjon</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Feilsøkingsvindu</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Generelt</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Bruker BerkeleyDB versjon</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datamappe</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Oppstartstidspunkt</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Nettverk</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Navn</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Antall tilkoblinger</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blokkjeden</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Nåværende antall blokker</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Hukommelsespulje</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Nåværende antall transaksjoner</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Minnebruk</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Tilbakestill</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Mottatt</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Sendt</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Noder</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Utestengte noder</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Velg en node for å vise detaljert informasjon.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Hvitelistet</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Retning</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versjon</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Startblokk</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Synkroniserte Blokkhoder</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Synkroniserte Blokker</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Brukeragent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Åpne %1-feilrettingsloggfila fra gjeldende datamappe. Dette kan ta et par sekunder for store loggfiler.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Forminsk font størrelsen</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Forstørr font størrelse</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Tjenester</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Ban Poengsum</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Tilkoblingstid</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Siste Sendte</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Siste Mottatte</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping-tid</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Tidsforløp for utestående ping.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping Tid</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Minimalt nettverkssvarkall</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Tidsforskyvning</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Tidspunkt for siste blokk</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Åpne</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsoll</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Nettverkstrafikk</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totalt</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Inn:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Ut:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Loggfil for feilsøk</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Tøm konsoll</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;time</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;dag</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;uke</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;år</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Koble fra</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Bannlys i</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Opphev bannlysning</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Velkommen til %1 RPC-konsoll.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Bruk ↑ og ↓ til å navigere historikk, og %1 for å tømme skjermen.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Skriv %1 for en oversikt over tilgjengelige kommandoer.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>For mer informasjon om hvordan konsollet brukes skriv %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>Advarsel: Svindlere har vært på ferde, i oppfordringen om å skrive kommandoer her, for å stjele lommebokinnhold. Ikke bruk konsollen uten at du forstår alle ringvirkningene av en kommando.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Nettverksaktivitet avskrudd</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(node id: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>aldri</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Innkommende</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Utgående</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nei</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Ukjent</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Beløp:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Merkelapp:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Melding:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>En valgfri melding å tilknytte betalingsetterspørringen, som vil bli vist når forespørselen er åpnet. Meldingen vil ikke bli sendt med betalingen over Bitcoin-nettverket.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>En valgfri merkelapp å tilknytte den nye mottakeradressen.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Bruk dette skjemaet til betalingsforespørsler. Alle felt er &lt;b&gt;valgfrie&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Et valgfritt beløp å etterspørre. La stå tomt eller null for ikke å etterspørre et spesifikt beløp.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Fjern alle felter fra skjemaet.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Fjern</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Etterspurt betalingshistorikk</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Etterspør betaling</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Vis den valgte etterspørringen (gjør det samme som å dobbelklikke på en oppføring)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Vis</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Fjern de valgte oppføringene fra listen</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Fjern</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Kopier URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiér merkelapp</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopier melding</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopier beløp</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-kode</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopier &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopier &amp;Adresse</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Lagre Bilde...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Forespør betaling til %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Betalingsinformasjon</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Beløp</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Merkelapp</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Melding</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Resulterende URI er for lang, prøv å redusere teksten for merkelapp / melding.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Feil ved koding av URI til QR-kode.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Merkelapp</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Melding</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen merkelapp)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(ingen melding)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(inget beløp forespurt)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Forespurt</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Send Bitcoins</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Myntkontroll Funksjoner</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Inndata...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automatisk valgte</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Utilstrekkelige midler!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Mengde:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Beløp:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Gebyr:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Etter Gebyr:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Veksel:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Hvis dette er aktivert, men adressen for veksel er tom eller ugyldig, vil veksel bli sendt til en nylig generert adresse.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Egendefinert adresse for veksel</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transaksjonsgebyr:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Velg...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Bruk av tilbakefallsgebyr kan medføre at en transaksjon tar flere timer eller dager, å fullføre, eller aldri gjør det. Overvei å velge et gebyr manuelt, eller vent til du har bekreftet hele kjeden.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Advarsel: Gebyroverslag er ikke tilgjengelig for tiden.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>Legg ned gebyrinnstillinger</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Hvis den egendefinerte avgiften er satt til 1000 satoshis og transaksjonen bare er 250 bytes, da vil \"per kilobyte\" bare betale 250 satoshis i gebyr, mens \"minstebeløp\" betaler 1000 satoshis. For transaksjoner større enn en kilobyte vil begge betale for antall kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Skjul</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Betaling av bare minimumsavgiften går helt fint så lenge det er mindre transaksjonsvolum enn plass i blokkene. Men vær klar over at dette kan ende opp i en transaksjon som aldri blir bekreftet når det er mer etterspørsel etter Bitcoin-transaksjoner enn nettverket kan behandle.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(les verktøytipset)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Anbefalt:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Egendefinert:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Smartgebyr ikke innført ennå. Dette tar vanligvis noen blokker...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Send til flere enn en mottaker</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Legg til &amp;Mottaker</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Fjern alle felter fra skjemaet.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Støv:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Bekreftelsestidsmål:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Aktiver Replace-By-Fee</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Med Replace-By-Fee (BIP-125) kan du øke transaksjonens gebyr etter at den er sendt. Uten dette aktivert anbefales et høyere gebyr for å kompensere for risikoen for at transaksjonen blir forsinket. </translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Fjern &amp;Alt</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Bekreft sending</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>S&amp;end</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopier mengde</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopier beløp</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopier gebyr</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopiér totalt</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopiér bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopiér støv</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopier veksel</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blokker)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 til %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Er du sikker på at du vil sende?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>lagt til som transaksjonsgebyr</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Totalt beløp %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>eller</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Du kan øke gebyret senere (signaliserer Replace-By-Fee, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Signaliserer ikke Replace-By-Fee, BIP-125</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Bekreft forsendelse av mynter</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Mottakeradressen er ikke gyldig. Sjekk den igjen.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Betalingsbeløpet må være høyere enn 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Beløper overstiger saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Totalbeløpet overstiger saldo etter at %1-transaksjonsgebyret er lagt til.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Gjenbruk av adresse funnet: Adresser skal kun brukes én gang hver.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Opprettelse av transaksjon mislyktes!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Transaksjonen ble avslått av følgende grunn: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Et gebyr høyere enn %1 anses som absurd høyt.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Tidsavbrudd for betalingsforespørsel</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Kun betal påkrevd gebyr på %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Antatt bekreftelsesbegynnelse innen %n blokk.</numerusform><numerusform>Antatt bekreftelsesbegynnelse innen %n blokker.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Advarsel Ugyldig bitcoin-adresse</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Advarsel: Ukjent vekslingsadresse</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Bekreft egendefinert vekslingsadresse</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Adressen du valgte for veksling er ikke en del av denne lommeboka. Alle verdiene i din lommebok vil bli sendt til denne adressen. Er du sikker?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen merkelapp)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Beløp:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Betal &amp;Til:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Merkelapp:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Velg tidligere brukt adresse</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Dette er en normal betaling.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Bitcoin-adressen betalingen skal sendes til</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Lim inn adresse fra utklippstavlen</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Fjern denne oppføringen</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Gebyret vil bli trukket fra beløpet som blir sendt. Mottakeren vil motta mindre bitcoins enn det du skriver inn i beløpsfeltet. Hvis det er valgt flere mottakere, deles gebyret likt.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>T&amp;rekk fra gebyr fra beløp</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Bruk tilgjengelig saldo</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Melding:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Dette er en uautorisert betalingsetterspørring.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Dette er en autorisert betalingsetterspørring.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Skriv inn en merkelapp for denne adressen for å legge den til listen av brukte adresser</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>En melding som var tilknyttet bitcoinen: URI vil bli lagret med transaksjonen for din oversikt. Denne meldingen vil ikke bli sendt over Bitcoin-nettverket.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Betal Til:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Skriv inn en merkelapp for denne adressen for å legge den til i din adressebok</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 lukker...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Slå ikke av datamaskinen før dette vinduet forsvinner.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signaturer - Signer / Verifiser en Melding</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Signer Melding</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Du kan signere meldinger/avtaler med adresser for å bevise at du kan motta bitcoins sendt til dem. Vær forsiktig med å signere noe vagt eller tilfeldig, siden phishing-angrep kan prøve å lure deg til å signere din identitet over til dem. Bare signer fullt detaljerte utsagn som du er enig i.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Bitcoin-adressen meldingen skal signeres med</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Velg tidligere brukt adresse</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Lim inn adresse fra utklippstavlen</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Skriv inn meldingen du vil signere her</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signatur</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopier valgt signatur til utklippstavle</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Signer meldingen for å bevise at du eier denne Bitcoin-adressen</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Signer &amp;Melding</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Tilbakestill alle felter for meldingssignering</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Fjern &amp;Alt</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifiser Melding</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Skriv inn mottakerens adresse, melding (forsikre deg om at du kopier linjeskift, mellomrom, faner osv. nøyaktig) og underskrift nedenfor for å bekrefte meldingen. Vær forsiktig så du ikke leser mer ut av signaturen enn hva som er i den signerte meldingen i seg selv, for å unngå å bli lurt av et man-in-the-middle-angrep. Merk at dette bare beviser at den som signerer kan motta med adressen, dette beviser ikke hvem som har sendt transaksjoner!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Bitcoin-adressen meldingen ble signert med</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verifiser meldingen for å være sikker på at den ble signert av den angitte Bitcoin-adressen</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifiser &amp;Melding</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Tilbakestill alle felter for meldingsverifikasjon</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Klikk \"Signer melding\" for å generere signatur</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Innskrevet adresse er ugyldig.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Sjekk adressen og prøv igjen.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Innskrevet adresse refererer ikke til noen nøkkel.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Opplåsning av lommebok ble avbrutt.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Privat nøkkel for den angitte adressen er ikke tilgjengelig.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Signering av melding feilet.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Melding signert.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Signaturen kunne ikke dekodes.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Sjekk signaturen og prøv igjen.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Signaturen samsvarer ikke med meldingsporteføljen.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Meldingsverifiseringen mislyktes.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Melding bekreftet.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnett]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Åpen for %n blokk til</numerusform><numerusform>Åpen for %n flere blokker</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Åpen til %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>gikk ikke overens med en transaksjon med %1 bekreftelser</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/frakoblet</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/ubekreftet, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>i hukommelsespulje</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>ikke i hukommelsespulje</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>forlatt</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/ubekreftet</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 bekreftelser</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, har ikke blitt kringkastet enda</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, kringkast gjennom %n node</numerusform><numerusform>, kringkast gjennom %n noder</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Kilde</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generert</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Fra</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>ukjent</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Til</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>egen adresse</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>kun oppsyn</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>merkelapp</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Kreditt</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>modner om %n blokk</numerusform><numerusform>modner om %n blokker</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>ikke akseptert</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debet</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Total debet</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Total kreditt</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transaksjonsgebyr</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Nettobeløp</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Melding</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Kommentar</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transaksjons-ID</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Total transaksjonsstørrelse</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Utdatainndeks</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Forretningsdrivende</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Genererte bitcoins må modne %1 blokker før de kan brukes. Da du genererte denne blokken ble den kringkastet på nettverket for å bli lagt til i kjeden av blokker. Hvis den ikke kommer med i kjeden vil den endre seg til \"ikke akseptert\", og vil ikke kunne brukes. Dette vil noen ganger skje hvis en annen node genererer en blokk innen noen sekunder av din.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Feilrettingsinformasjon</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transaksjon</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Inndata</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Beløp</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>sant</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>usant</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Her vises en detaljert beskrivelse av transaksjonen</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detaljer for %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Merkelapp</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Åpen for én blokk til</numerusform><numerusform>Åpen for %n blokker til</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Åpen til %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Frakoblet</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Ubekreftet</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Forlatt</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Bekrefter (%1 av %2 anbefalte bekreftelser)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Bekreftet (%1 bekreftelser)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Gikk ikke overens</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Umoden (%1 bekreftelser, vil være tilgjengelig etter %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Denne blokken har ikke blitt mottatt av noen andre noder og vil sannsynligvis ikke bli akseptert!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generert, men ikke akseptert</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Mottatt med</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Mottatt fra</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Sendt til</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Betaling til deg selv</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Utvunnet</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>kun oppsyn</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(i/t)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen merkelapp)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Transaksjonsstatus. Hold pekeren over dette feltet for å se antall bekreftelser.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Dato og tid for mottak av transaksjonen.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Transaksjonstype.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Hvorvidt en oppsynsadresse er involvert i denne transaksjonen.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Brukerdefinert intensjon/hensikt med transaksjonen.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Beløp fjernet eller lagt til saldo.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Alt</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>I dag</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Denne uka</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Denne måneden</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Forrige måned</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Dette året</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Rekkevidde…</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Mottatt med</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Sendt til</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Til deg selv</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Utvunnet</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Andre</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Oppgi adresse, transaksjons-ID eller merkelapp for å søke</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minimumsbeløp</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Avbryt transaksjon</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Øk overføringsgebyret</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopier adresse</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiér merkelapp</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopier beløp</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopier transaksjons-ID</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Kopier råtransaksjon</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Kopier helhetlig transaksjonsdetaljering</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Rediger merkelapp</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Vis transaksjonsdetaljer</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Eksporter transaksjonshistorikk</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Kommaseparert fil (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bekreftet</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Kun oppsyn</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dato</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Merkelapp</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksportering feilet</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>En feil oppstod ved lagring av transaksjonshistorikk til %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Eksportert</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Transaksjonshistorikken ble lagret til %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Rekkevidde:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>til</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Enhet å vise beløper i. Klikk for å velge en annen enhet.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Ingen lommebok har blitt lastet inn.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Send mynter</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Gebyrforhøyelsesfeil</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Økning av transaksjonsgebyr mislyktes</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Ønsker du å øke gebyret?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Nåværede gebyr:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Økning:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nytt gebyr:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Bekreft gebyrøkning</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Kan ikke signere transaksjon</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Kunne ikke sende inn transaksjon</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksporter</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksporter data fra nåværende fane til fil</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Sikkerhetskopier lommebok</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Lommeboksdata (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Sikkerhetskopiering mislyktes</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Feil under forsøk på lagring av lommebokdata til %1</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Sikkerhetskopiert</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Lommebokdata lagret til %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Innstillinger:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Angi mappe for datafiler</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Koble til node for å hente adresser til andre noder, koble så fra igjen</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Angi din egen offentlige adresse</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Ta imot kommandolinje- og JSON-RPC-kommandoer</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Lisensiert MIT. Se tilhørende fil %s eller %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Hvis &lt;category&gt; ikke er oppgitt eller hvis &lt;category&gt; = 1, ta ut all informasjon for feilsøking.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Beskjæringsmodus er konfigurert under minimum på %d MiB. Vennligst bruk et høyere nummer.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Beskjæring: siste lommeboksynkronisering går utenfor beskjærte data. Du må bruke -reindex (laster ned hele blokkjeden igjen for beskjærte noder)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Omsøk er ikke mulig i beskjært modus. Du vil måtte bruke -reindex som vil laste nede hele blokkjeden på nytt.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Feil: En fatal intern feil oppstod, se debug.log for detaljer</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Gebyr (i %s/kB) for å legge til i transaksjoner du sender (standardverdi: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Beskjærer blokklageret...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Kjør i bakgrunnen som daemon og ta imot kommandoer</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Kunne ikke starte HTTP-tjener. Se feilrettingslogg for detaljer.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>%s-utviklerne</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>En gebyrsats (i %s(kB) som bil bli brukt når gebyrvurdering har utilstrekkelig data (forvalg: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Godta stafettransaksjoner mottatt fra hvitlistede likemenn, selv når transaksjoner ikke stafettsendes (forvalg: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Legg til node for tilkobling og forsøk å holde forbindelsen åpen (se 'addnode' RPC kommandoen for mer informasjon)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Bind til angitt adresse. Bruk [vertsmaskin]:port notasjon for IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Kan ikke låse datamappen %s. %s kjører antagelig allerede.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Kan ikke angi spesifikke tilkoblinger og ha addrman til å finne utgående tilkoblinger samtidig. </translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Slett alle transaksjoner i lommeboken og gjenopprett kun de delene av blokkjeden gjennom -rescan ved oppstart</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Feil under lesing av %s! Alle nøkler har blitt lest rett, men transaksjonsdata eller adressebokoppføringer kan mangle eller være uriktige.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Ekskluder feilrettingsinformasjon for en kategori. Kan brukes i sammenheng med -debug=1 til utdatafeilrettingslogger for alle kategorier, unntatt én eller flere angitte kategorier.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Kjør kommando når en lommeboktransaksjon endres (%s i kommando er erstattet med TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Ekstra transaksjoner å beholde i minne for rekonstruksjoner av kompakte blokker (forvalg: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Hvis denne blokken er i kjeden, anta at den og dens opphav er gyldig, og alternativt hopp over deres skriptbekreftelse (0 for å bekrefte alle, forvalg: %s, testnett: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Maksimalt tillatt justering av mediantid av likemenn. Lokalt tidsperspektiv kan påvirkes av likemenn fremover og bakover med denne mengden. (forvalg: %u sekunder)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Maksimalt totalgebyr (i %s) å bruke i én lommebokstransaksjon eller råtransaksjon; en for lav verdi kan avbryte store transaksjoner (forvalg: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Sjekk at din datamaskins dato og klokke er stilt rett! Hvis klokka er feil, vil ikke %s fungere ordentlig.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Bidra hvis du finner %s nyttig. Besøk %s for mer informasjon om programvaren.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Spørring om likemannsadresser via DNS-oppslag, hvis adressemengden er lav (forvalg: 1 om ikke -connect brukes)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Reduser lagringskrav ved å skru på beskjæring (sletting) av gamle blokker. Dette tillater pruneblockchain RPC å bli påkalt for sletting av spesifikke blokker, og skrur på automatisk beskjæring av gamle blokker hvis målstørrelsen i MiB oppgis. Dette moduset er inkompatibelt med -txindex og -rescan. Advarsel: Tilbakestilling av dette krever ny nedlasting av hele blokkjeden. (forvalg: 0 = skru av beskjæring av blokker, 1 = tillat manuell beskjæring via RPC, &gt;%u = automatisk beskjæring av blokkfiler for å ikke overstige angitt målstørrelse, i MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Sett laveste gebyrtakst (i %s/kB) for transaksjoner som skal inkluderes i blokkopprettelse. (forvalg: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Angi antall tråder for skriptverifisering (%u til %d, 0 = auto, &lt;0 = la det antallet kjerner være ledig, standard: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Blokkdatabasen inneholder en blokk som ser ut til å være fra fremtiden. Dette kan være fordi dato og tid på din datamaskin er satt feil. Gjenopprett kun blokkdatabasen når du er sikker på at dato og tid er satt riktig.</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Dette er en testversjon i påvente av utgivelse - bruk på egen risiko - ikke for bruk til blokkutvinning eller i forretningsøyemed</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Dette er transaksjonsgebyret du kan se bort fra hvis vekslepengene utgjør mindre enn støv på dette nivået</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Kan ikke spille av blokker igjen. Du må bygge opp igjen databasen ved bruk av -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Kan ikke spole tilbake databasen til en tilstand før forgreiningen. Du må laste ned blokkjeden igjen</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Bruk UPnP for lytteport (standardverdi: 1 ved lytting og uten -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Brukernavn og sjekksummert JSON-RPC-tilkoblinger. Dette feltet &lt;userpw&gt; kommer i formatet: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Et kanonisk Python-skript er inkludert i share/rpcuser. Klienten kobler så til bed bruk av rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; argumentpar. Dette valget kan angis flere ganger</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Lommeboka vil ikke opprette transaksjoner som forgriper seg på grenser for hukommelsespuljekjeder (forvalg: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Advarsel: Nettverket ser ikke ut til å være i overenstemmelse! Noen utvinnere ser ut til å ha problemer.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Advarsel: Vi ser ikke ut til å være i full overenstemmelse med våre likemenn! Du kan trenge å oppgradere, eller andre noder kan trenge å oppgradere.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Hvorvidt hukommelsespuljen skal lagres ved avstengning og lastes inn ved omstart (forvalg: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d av minst 100 blokker har uventet versjon</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s skadet, berging mislyktes</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool må være minst %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; kan være:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Ta imot tilkoblinger fra utsiden (standardverdi: 1 hvis uten -proxy eller -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Legg til kommentarer i brukeragent-strengen</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Forsøk å gjenopprette private nøkler fra ei skadet lommebok ved oppstart</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Valg for opprettelse av blokker:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Kunne ikke slå opp -%s-adresse: \"%s\"</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Kjedeutvelgelsesinnstillinger:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Kjedeindeks utenfor rekkevidde</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Innstillinger for tilkobling:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Kopirett © %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Oppdaget korrupt blokkdatabase</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Valg for feilsøking/testing:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Ikke last inn lommeboken og deaktiver RPC-kall</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Ønsker du å gjenopprette blokkdatabasen nå?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Slå på publish hash block i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Slå på publish hash transaction i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Slå på publisering av råblokk i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Slå på publisering av råtransaksjon i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Aktiver transaksjonserstatning i hukommelsespuljen (forvalg: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Feil under oppretting av %s: Du kan ikke lage en lommebok uten HD med denne versjonen.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Feil under initialisering av blokkdatabase</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Feil under oppstart av lommeboken sitt databasemiljø %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Feil ved lasting av %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Feil under innlasting av %s: Skadet lommebok</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Feil under innlasting av %s: Lommeboka krever nyere versjon av %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Feil ved lasting av blokkdatabase</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Feil under åpning av blokkdatabase</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Feil: Lite ledig lagringsplass!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Kunne ikke lytte på noen port. Bruk -listen=0 hvis det er dette du vil.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Klarte ikke gå igjennom lommeboken under oppstart</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importerer...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Ugyldig eller ingen skaperblokk funnet. Feil datamappe for nettverk?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Sunnhetssjekk ved oppstart mislyktes. %s skrus av.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Ugyldig beløp for -%s=&lt;amount&gt;: \"%s\"</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Ugyldig beløp for -discardfee=&lt;amount&gt;: \"%s\"</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Ugyldig beløp for -fallbackfee=&lt;amount&gt;: \"%s\"</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Hold transaksjonspuljen under &lt;n&gt; megabyte (forvalg: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Laster maskin-til-maskin -adresser…</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Laster inn bannlysningsliste…</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Plassering for autentiseringskake (forvalg: datamappe)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>For få fildeskriptorer tilgjengelig.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Bare koble til noder i nettverket &lt;net&gt; (IPv4, IPv6 eller onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Skriv ut denne hjelpemeldingen og avslutt</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Skriv ut denne versjonen og avslutt</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Beskjæringsmodus kan ikke konfigureres med en negativ verdi.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Beskjæringsmodus er ikke kompatibel med -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Bygg opp igjen kjedetilstand og blokkindeks fra blk*.dat-filer på disk</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Bygg opp igjen kjedetilstand fra blokker som er indeksert nå</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Spiller av blokker igjen…</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Spoler tilbake blokker…</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Sett databasen sin størrelse på hurtigbufferen i megabytes (%d til %d, standardverdi: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Angi lommebokfil (inne i datamappe)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Kildekoden er tilgjengelig fra %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Transaksjonsgebyr og vekslingsutregning mislyktes</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Kan ikke binde til %s på denne datamaskinen. Sannsynligvis kjører %s allerede.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Ustøttet argument -benchmark ble ignorert, bruk -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Advarsel: Argumentet -debugnet er ikke støttet og ble ignorert, bruk -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Feil: Argumentet -tor er ikke støttet, bruk -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Ustøttet loggingskategori %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Oppgraderer UTXO-database</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Bruk UPnP for å sette opp lytteport (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Bruk testkjede</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>User Agent kommentar (%s) inneholder utrygge tegn.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verifiserer blokker...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Lommebok-feilretting/-testinnstillinger</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Lommeboka må skrives om: Start %s på nytt for å fullføre</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Valg for lommebok:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Tillat JSON-RPC-tilkoblinger fra angitt kilde. Gyldig for &lt;ip&gt; er en enkelt IP (f. eks. 1.2.3.4), et nettverk/nettmaske (f. eks. 1.2.3.4/255.255.255.0) eller et nettverk/CIDR (f. eks. 1.2.3.4/24). Dette alternativet kan angis flere ganger</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Bind til gitt adresse og hvitlist peers som kobler seg til den. Bruk [host]:port notasjon for IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Opprett nye filer med standardtillatelser i systemet, i stedet for umask 077 (kun virksom med lommebokfunksjonalitet slått av)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Oppdag egne IP-adresser (standardverdi: 1 ved lytting og ingen -externalip eller -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Feil: Lytting etter innkommende tilkoblinger feilet (lytting returnerte feil %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Utfør kommando når et relevant varsel er mottatt eller vi ser en veldig lang gaffel (%s i kommando er erstattet med melding)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Gebyrer (i %s/kB) mindre enn dette anses som null gebyr for videresending, graving og laging av transaksjoner (standardverdi: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Hvis paytxfee ikke er angitt, inkluderer da nok i gebyr til at transaksjoner gjennomsnittligt bekreftes innen n blokker (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Ugyldig beløp for -maxtxfee=&lt;amount&gt;: '%s' (må være minst minimum relé gebyr på %s for å hindre fastlåste transaksjoner)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maksimal størrelse på data i databærende transaksjoner vi videresender og ufører graving på (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Bruk tilfeldig identitet for hver proxytilkobling. Dette muliggjør TOR stream isolasjon (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Transaksjonsbeløpet er for lite til å sendes etter at gebyret er fratrukket</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Hvitlistede noder kan ikke DoS-blokkeres, og deres transaksjoner videresendes alltid, selv om de allerede er i hukommelsespuljen. Nyttig f.eks. for en portner.</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Du må gjenoppbygge databasen ved hjelp av -reindex for å gå tilbake til ubeskåret modus. Dette vil laste ned hele blokkjeden på nytt.</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Godta offentlige REST forespørsler (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Automatisk opprette Tor skjult tjeneste (standardverdi: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Koble til via SOCKS5-proxy</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Feil ved innlasting av %s: Du kan ikke skru av HD på ei HD-lommebok som allerede finnes</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Feil ved lesing fra database, stenger ned.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Feil ved oppgradering av kjedetilstandsdatabase</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importerer blokker fra ekstern fil blk000??.dat ved oppstart</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informasjon</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Ugyldig -onion adresse eller vertsnavn: \"%s\"</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Ugyldig -mellomtjeneradresse eller vertsnavn: \"%s\"</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Ugyldig beløp for -paytxfee=&lt;amount&gt;: '%s' (må være minst %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Ugyldig nettmaske spesifisert i -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Hold på det meste &lt;n&gt; transaksjoner som ikke kobles i minnet (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Må oppgi en port med -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Node alternativer for videresending:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Innstillinger for RPC-tjener:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reduserer -maxconnections fra %d til %d, pga. systembegrensninger.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Se gjennom blokkjeden etter manglende lommeboktransaksjoner ved oppstart</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Send spor-/feilsøkingsinformasjon til konsollen istedenfor filen debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Vis alle feilsøkingsvalg (bruk: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Krymp filen debug.log når klienten starter (standardverdi: 1 hvis uten -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Signering av transaksjon feilet</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>Oppgitt -walletdir \"%s\" eksisterer ikke</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>Oppgitt -walletdir \"%s\" er en relativ sti</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>Oppgitt -walletdir \"%s\" er ikke en katalog</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Transaksjonsbeløpet er for lite til å betale gebyr</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Dette er eksperimentell programvare.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Passord for Tor-kontrollport (standardverdi: tom)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Tor-kontrollport å bruke hvis onion-lytting er aktivert (standardverdi: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transaksjonen er for liten</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transaksjon for stor for gebyrpolitikken</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transaksjonen er for stor</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Kan ikke binde til %s på denne datamaskinen (binding returnerte feilen %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Klarte ikke lage første nøkkel</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Oppgrader lommebok til nyeste format ved oppstart</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Brukernavn for JSON-RPC forbindelser</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Lommebokbekreftelse pågår…</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Lommebok %s befinner seg utenfor lommebokkatalog %s</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Advarsel</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Advarsel: Ukjente nye regler aktivert (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Hvorvidt å operere i modus med kun blokker (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Du må bygge opp igjen databasen ved bruk av -reindex for å endre -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Zapper alle transaksjoner fra lommeboken...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Valg for ZeroMQ-meldinger:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Passord for JSON-RPC forbindelser</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Utfør kommando når beste blokk endrer seg (%s i kommandoen erstattes med blokkens hash)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Tillat oppslag i DNS for -addnode, -seednode og -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = behold metadata for transaksjon som f. eks. kontoeier og informasjon om betalingsanmodning, 2 = dropp metadata for transaksjon)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee er satt veldig høyt! Så stort gebyr kan bli betalt ved en enkelt transaksjon.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Bind til angitt adresse for lytting til JSON-RPC-tilkoblinger. Dette valget ses bort fra om ikke -rcpallowip også sendes. Port er valgfritt og overstyrer -rpcport. Bruk notasjon i formatet [host]:port for IPv6. Dette valget kan angis flere ganger (forvalg: 127.0.0.1 og ::1 ,altså, lokalvert, eller hvis -rpcallowip har blitt angitt, 0.0.0.0 og :: ,altså, alle adresser)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Ikke hold transaksjoner i minnet lenger enn &lt;n&gt; timer (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Overenstemmende byte per sigop i transaksjoner for stafett og utvinning (forvalg: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Feil ved innlasting av %s: Du kan ikke skru på HD på ei ikke-HD-lommebok som allerede finnes</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Feil under innlasting av lommeboka %s. -wallet parameter må kun angi et filnavn (ikke en sti).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Gebyrer (i %s/Kb) mindre enn dette anses som null gebyr for laging av transaksjoner (standardverdi: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Tving igjennom stafettransaksjoner av hvitlistede likemenn, selv når de ikke overholder lokal stafettpraksis (forvalg: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Hvor grundig blokkverifiseringen til -checkblocks er (0-4, standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Oppretthold en full transaksjonsindeks, brukt av getrawtransaction RPC-kall (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Antall sekunder noder med dårlig oppførsel hindres fra å koble til på nytt (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Ta ut feilsøkingsinformasjon (standardverdi: %u, bruk av &lt;category&gt; er valgfritt)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Setter serialisering av råtransaksjon eller heksadesimal verdi for blokk returnert i ikke-ordrikt modus, non-segwit(0) eller segwit(1) (forvalg: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Oppgi katalog som inneholder lommebøker (standard: &lt;datadir&gt;/wallets hvis den eksisterer, ellers &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Oppgi sted for feilsøkingsloggfil: Dette kan være en absolutt sti eler en sti relativt til datakatalogen (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Støtte filtrering av blokker og transaksjoner med bloomfiltre (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>Gebyrtakst (i %s(kB) som indikerer din toleranse for å avslå veksel ved å legge det til gebyret (forvalg: %s). Merk: Otdata avslås hvis det er støv på dette nivået, men det vil alltid bli avslått opptil hva støv-nivået er for stafettoppsettet, og gebyravslag uver det begrenses av gebyroverslaget for det lengste målet</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Dette er transaksjonsgebyret du kan betale når gebyranslag ikke er tilgjengelige.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Dette produktet inneholder programmet utviklet av OpenSSL-prosjektet for bruk i OpenSSL-verktøyssettet %s og kryptografisk programvare skrevet av Eric Young og UPnP-programvare skrevet av Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Total lengde av nettverks-versionstreng (%i) er over maks lengde (%i). Reduser tallet eller størrelsen av uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Prøv å holde utgående trafikk under angitt mål (i MB per 24t), 0 = ingen grense (standard: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Argumentet -socks er ikke støttet. Det er ikke lenger mulig å sette SOCKS-versjon; bare SOCKS5-proxyer er støttet.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Argumentet -whitelistalwaysrelay støttes ikke, og blir ignorert, bruk -whitelistrelay og/eller -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Bruk separate SOCKS5 proxyer for å nå noder via Tor skjulte tjenester (standardverdi: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Advarsel: Ukjente blokkversjoner blir utvunnet! Det er mulig ukjente regler er i spill</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Advarsel: Lommeboksfil skadet, data berget! Original %s lagret som %s i %s; hvis din saldo eller transaksjoner er uriktige, bør du gjenopprette fra sikkerhetskopi.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Hvitlist brukere som kobler til fra en gitt IP-adresse (e.g. 1.2.3.4) eller nettverk med CIDR-notasjon (f.eks. 1.2.3.0/24). Kan angis mange ganger.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s er satt veldig høyt!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(standardverdi: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Alltid søk etter nodeadresser via DNS-oppslag (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Feil under innlasting av lommeboka %s. -lommebokfilnavn må være ei vanlig fil.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Feil ved innlasting av lommeboka %s. Duplisert -wallet -filnavn angitt.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Feil ved innlasting av lommeboka %s. Ugyldige tegn i -wallet filename.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Hvor mange blokker skal sjekkes ved oppstart (standardverdi: %u, 0 = alle)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Inkludere IP-adresser i feilsøkingslogg (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Nøkkelpuljen gikk tom, kall keypoolrefill først</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Lytt etter JSON-RPC tilkoblinger på &lt;port&gt; (standardverdi: %u eller testnett: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Lytt etter tilkoblinger på &lt;port&gt; (standardverdi: %u eller testnett: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Hold maks &lt;n&gt; koblinger åpne til andre noder (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Få lommeboken til å kringkaste transaksjoner</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maks mottaksbuffer per forbindelse, &lt;n&gt;*1000 bytes (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maks sendebuffer per forbindelse, &lt;n&gt;*1000 bytes (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Sett inn tidsstempel i front av feilsøkingsdata (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Videresend og ufør graving av databærende transaksjoner (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Videresend ikke-P2SH multisig (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Angi størrelse på nøkkel-lager til &lt;n&gt; (forvalg: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Sett maksimal BIP141-blokkvekt (forvalg: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Sett antall tråder til betjening av RPC-kall (standardverdi: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Angi konfigurasjonsfil (standardverdi: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Angi tidsavbrudd for forbindelse i millisekunder (minimum: 1, standardverdi: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Angi pid-fil (standardverdi: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Bruk ubekreftet veksel ved sending av transaksjoner (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Starter nettverkstråder…</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Lommeboka vil unngå å betale mindre enn minimumsstafettgebyret.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Dette er minimumsgebyret du betaler for hver transaksjon.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Dette er transaksjonsgebyret du betaler som forsender av transaksjon.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Grenseverdi for å koble fra noder med dårlig oppførsel (standardverdi: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Transaksjonsbeløpet kan ikke være negativt</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Transaksjonen har for lang hukommelsespuljekjede</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Transaksjonen må ha minst én mottaker</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Ukjent nettverk angitt i -onlynet '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Utilstrekkelige midler</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Laster blokkindeks...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Laster lommebok...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Kan ikke nedgradere lommebok</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Leser gjennom...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Ferdig med lasting</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Feil</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_nb_NO.ts",
    "content": "<TS language=\"nb_NO\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Høyreklikk for å redigere adresse, eller beskrivelse</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Opprett en ny adresse</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Ny</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopier den valgte adressen til utklippstavlen</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopier</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Lukk</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Slett den valgte adressen fra listen</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksporter data i den valgte fliken til en fil</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksport</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Slett</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Velg en adresse å sende mynter til</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Velg adressen som skal motta myntene</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Velg</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Avsender adresser</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Mottager adresser</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Dette er dine Bitcoin adresser for å sende  å sende betalinger. Husk å sjekke beløp og mottager adresser før du sender mynter.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Dette er dine Bitcoin adresse for å motta betalinger. Det er anbefalt å bruke en ny mottager adresse for hver transaksjon.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopier adresse</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopier &amp;beskrivelse</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>R&amp;ediger</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Eksporter adresse listen</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Komma separert fil (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksporten feilet</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Fet oppstod en feil ved lagring av adresselisten til %1. Vennligst prøv igjen.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Beskrivelse</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen beskrivelse)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Passord dialog</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Oppgi passord setning</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Ny passord setning</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repeter passorsetningen</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Oppgi passordsetningen for lommeboken. &lt;br/&gt;Vennligst bruk en passordsetninge med &lt;b&gt;ti, eller flere tilfeldige tegn &lt;/b&gt;, eller &lt;b&gt;åtte, eller flere ord&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Krypter lommeboken</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Denne operasjonen krever passordsetningen for å låse opp lommeboken.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Lås opp lommeboken</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Denne operasjonen krever passordsetningen for å dekryptere lommeboken.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dekrypter lommeboken</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Endre passordsetningen</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Oppgi den gamle og den nye passordsetningen for lommeboken.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Bekreft kryptering av lommeboken</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Advarsel: Dersom du krypterer lommeboken og mister passordsetningen vil du &lt;b&gt;MISTE ALLE DINE BITCOIN&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Er du sikker på at du vil kryptere lommeboken?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Lommeboken er kryptert</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 vil nå lukkes for å fullføre krypteringsprosessen. Husk at å kryptere lommeboken ikke kan beskytte dine bitcoin fullstendig fra å bli stjålet av skadelig programvare som har infisert datamaskinen din.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>VIKTIG: Alle tidligere sikkerhetskopier du har tatt av lommebokfilen bør erstattes med den nye krypterte lommebokfilen. Av sikkerhetsgrunner vil tidligere sikkerhetskopier av lommebokfilen bli ubrukelige når du begynner å bruke den ny kypterte lommeboken.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Kryptering av lommeboken feilet</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Lommebokkrypteringen feilet pga. en intern feil. Lommeboken din ble ikke kryptert.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>De oppgitte passordsetningene er forskjellige.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Opplåsing av lommeboken feilet</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Passordsetningen som ble oppgitt for å dekryptere lommeboken var feil.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Dekryptering av lommeboken feilet</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Passordsetningen for lommeboken ble endret</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Advarsel: Caps Lock er på!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Nettmaske</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Utestengt Til</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signer &amp;melding</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synkroniserer med nettverket</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Oversikt</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Vis generell oversikt over lommeboken</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaksjoner</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Bla gjennom transaksjoner</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Avslutt</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Avslutt program</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Om %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Vis informasjon om %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Om &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Vis informasjon om Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Alternativer</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Endre konfigurasjonsalternativer for %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Krypter lommebok...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Sikkerhetskopier lommebok</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Endre passordsetning</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Avsender adresser</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Mottager adresser</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Åpne &amp;URI</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Klikk for å slå av nettverksaktivitet.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Nettverksaktivitet er slått av</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Klikk for å slå på nettverksaktivitet igjen.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synkroniserer Headers (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindekserer blokker på disken</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Send mynter til en Bitcoin adresse</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Sikkerhetskopier lommeboken til en annen lokasjon</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Endre passordsetningen for kryptering av lommeboken</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Feilsøkingsvindu</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Åpne konsoll for feilsøking og diagnostisering</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifiser meldingen...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Lommebok</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Sende</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Motta</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>Vi&amp;s / Skjul</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Vis, eller skjul, hovedvinduet</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Krypter de private nøklene som tilhører lommeboken din</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signer meldingene med Bitcoin adresse for å bevise at diu eier dem</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifiser meldinger for å sikre at de ble signert med en angitt Bitcoin adresse</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fil</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>Inn&amp;stillinger</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Hjelp</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Hjelpelinje for fliker</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Be om betalinger (genererer QR-koder og bitcoin-URIer)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Vis lista over brukte sendeadresser og merkelapper</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Vis lista over brukte mottakeradresser og merkelapper</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Åpne en bitcoin: URI eller betalingsforespørsel</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Kommandolinjealternativer</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Behandler blokker på disken…</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 bak</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Siste mottatte blokk ble generert for %1 siden.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transaksjoner etter dette vil ikke være synlige ennå.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Feilmelding</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Advarsel</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informasjon</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Oppdatert</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Vis %1-hjelpemeldingen for å få en liste over mulige Bitcoin-kommandolinjealternativer</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1-klient</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Tar igjen…</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Dato: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Mengde: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Type: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Merkelapp: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresse: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Sendt transaksjon</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Innkommende transaksjon</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen beskrivelse)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Feilmelding</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Error</source>\n        <translation>Feilmelding</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Beskrivelse</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Beskrivelse</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen beskrivelse)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen beskrivelse)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Beskrivelse</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen beskrivelse)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Komma separert fil (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Beskrivelse</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresse</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksporten feilet</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksport</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksporter data i den valgte fliken til en fil</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Information</source>\n        <translation>Informasjon</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Advarsel</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Feilmelding</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ne.ts",
    "content": "<TS language=\"ne\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>ठेगाना वा लेबल सम्पादन गर्न दायाँ-क्लिक गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>नयाँ ठेगाना सिर्जना गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;amp;नयाँ</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>भर्खरै चयन गरेको ठेगाना प्रणाली क्लिपबोर्डमा कपी गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;amp;कपी गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>बन्द गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>भर्खरै चयन गरेको ठेगाना सूचीबाट मेटाउनुहोस्</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>वर्तमान ट्याबको डाटालाई फाइलमा निर्यात गर्नुहोस् </translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;amp;निर्यात गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;amp;मेटाउनुहोस्</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>छनौट गर्नुहोस्...</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>पठाउने ठेगानाहरू...</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>प्राप्त गर्ने ठेगानाहरू...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>ठेगाना कपी गर्नुहोस्\n</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>पासफ्रेज संवाद</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>पासफ्रेज प्रवेश गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>नयाँ पासफ्रेज</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>नयाँ पासफ्रेज दोहोर्याउनुहोस्</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/नेटमास्क</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>प्रतिबन्धित समय</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>सन्देशमा &amp;amp;हस्ताक्षर  गर्नुहोस्...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>नेटवर्कमा समिकरण हुँदै...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>शारांश</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>नोड</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>वालेटको साधारण शारांश देखाउनुहोस्</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;amp;कारोबार</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>कारोबारको इतिहास हेर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>बाहिर निस्कनुहोस्</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>एप्लिकेसन बन्द गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;amp;बारेमा %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>%1 को बारेमा सूचना देखाउनुहोस्</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Qt को बारेमा सूचना देखाउनुहोस्</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;amp;विकल्प...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>%1 का लागि कन्फिगुरेसनको विकल्प परिमार्जन गर्नुहोस</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;amp;वालेटलाई इन्क्रिप्ट गर्नुहोस्...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;amp;वालेटलाई ब्याकअप गर्नुहोस्...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;amp;पासफ्रेज परिवर्तन गर्नुहोस्...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;amp;पठाउने ठेगानाहरू...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;amp;प्राप्त गर्ने ठेगानाहरू...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>URI &amp;amp;खोल्नुहोस्...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>डिस्कमा ब्लकलाई पुनः सूचीकरण गरिँदै...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>बिटकोइन ठेगानामा सिक्का पठाउनुहोस्</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>वालेटलाई अर्को ठेगानामा ब्याकअप गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>वालेट इन्क्रिप्सनमा प्रयोग हुने इन्क्रिप्सन पासफ्रेज परिवर्तन गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;amp;डिबग विन्डो</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>डिबगिङ र डायाग्नोस्टिक कन्सोल खोल्नुहोस्</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount</source>\n        <translation>रकम</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>ठेगाना कपी गर्नुहोस्\n</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>इन्टरफेसमा र सिक्का पठाउँदा देखिने डिफल्ट उपविभाजन एकाइ चयन गर्नुहोस् ।</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>देखाइएको सूचना पूरानो हुन सक्छ । कनेक्सन स्थापित भएपछि, तपाईंको वालेट बिटकोइन नेटवर्कमा स्वचालित रूपमा समिकरण हुन्छ , तर यो प्रक्रिया अहिले सम्म पूरा भएको छैन ।</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>हेर्ने-मात्र:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>उपलब्ध:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>तपाईंको खर्च गर्न मिल्ने ब्यालेन्स</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>विचाराधिन:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>अझै पुष्टि हुन बाँकी र खर्च गर्न मिल्ने ब्यालेन्समा गणना गर्न नमिल्ने जम्मा कारोबार</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>अपरिपक्व:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>अझै परिपक्व नभएको खनन गरिएको ब्यालेन्स</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>ब्यालेन्स</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>अहिलेसम्म परिपक्व नभएको खनन गरिएको, हेर्ने-मात्र ठेगानामा रहेको ब्यालेन्स</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>हेर्ने-मात्र ठेगानामा रहेको हालको जम्मा ब्यालेन्स</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>प्रयोगकर्ता एजेन्ट</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>नोड/सेव</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>रकम</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>कृपया बिटकोइन ठेगाना प्रवेश गर्नुहोस् (उदाहरण %1)</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>User Agent</source>\n        <translation>प्रयोगकर्ता एजेन्ट</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>पिङ समय</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Choose...</source>\n        <translation>छनौट गर्नुहोस्...</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>पहिला प्रयोग गरिएको ठेगाना प्रयोग गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>पठाइँदै गरेको रकमबाट शुल्क कटौती गरिनेछ । प्राप्तकर्ताले तपाईंले रकम क्षेत्रमा प्रवेष गरेको भन्दा थोरै बिटकोइन प्राप्त गर्ने छन् । धेरै प्राप्तकर्ता चयन गरिएको छ भने समान रूपमा शुल्क विभाजित गरिनेछ ।</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>यो ठेगानालाई प्रयोग गरिएको ठेगानाको सूचीमा थप्न एउटा लेबल प्रविष्ट गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>बिटकोइनमा संलग्न गरिएको सन्देश: तपाईंको मध्यस्थको लागि कारोबारको साथमा भण्डारण गरिने URI । नोट: यो सन्देश बिटकोइन नेटवर्क मार्फत पठाइने छैन ।</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>आफ्नो ठेगानामा पठाइएको बिटकोइन प्राप्त गर्न सकिन्छ भनेर प्रमाणित गर्न तपाईंले ती ठेगानाले सन्देश/सम्झौताहरूमा हस्ताक्षर गर्न सक्नुहुन्छ । फिसिङ आक्रमणले तपाईंलाई छक्याएर अरूका लागि तपाईंको परिचयमा हस्ताक्षर गराउने प्रयास गर्न सक्ने भएकाले अस्पष्ट वा जथाभावीमा हस्ताक्षर गर्दा ध्यान दिनुहोस् । आफू सहमत भएको पूर्ण विस्तृत-कथनमा मात्र हस्ताक्षर गर्नुहोस् ।</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>पहिला प्रयोग गरिएको ठेगाना प्रयोग गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>वर्तमान हस्ताक्षरलाई प्रणाली क्लिपबोर्डमा कपी गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>सन्देश प्रमाणित गर्न, तल दिइएको स्थानमा प्राप्तकर्ता ठेगाना, सन्देश (लाइन ब्रेक, स्पेस, ट्याब, आदि उस्तै गरी कपी गर्ने कुरा सुनिश्चित गर्नुहोस्) र हस्ताक्षर &amp;apos;s प्रविष्ट गर्नुहोस् । बीचमा-मानिसको-आक्रमणबाट बच्न हस्ताक्षर पढ्दा हस्ताक्षर गरिएको सन्देशमा जे छ त्यो भन्दा धेरै कुरामा ध्यान नदिनुहोस् । यो कार्यले हस्ताक्षर गर्ने पक्षले मात्र यो ठेगानाले प्राप्त गर्छ भन्ने कुरा प्रमाणित गर्छ, यसले कुनै पनि कारोबारको प्रेषककर्तालाई प्रमाणित गर्न सक्दैन भन्ने कुरा याद गर्नुहोस्!</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>ठेगाना कपी गर्नुहोस्\n</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;amp;निर्यात गर्नुहोस्\n</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>वर्तमान ट्याबको डाटालाई फाइलमा निर्यात गर्नुहोस्</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>वालेटको सबै कारोबार मेटाउनुहोस् र -स्टार्टअपको पुनः स्क्यान मार्फत ब्लकचेनका ती भागहरूलाई मात्र पुनः प्राप्त गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>ब्लक डाटाबेसमा भविष्यबाट आए जस्तो देखिने एउटा ब्लक हुन्छ । तपाईंको कम्प्युटरको मिति र समय गलत तरिकाले सेट गरिएकाले यस्तो हुन सक्छ । तपाईं आफ्नो कम्प्युटरको मिति र समय सही छ भनेर पक्का हुनुहुन्छ भने मात्र ब्लक डाटाबेस पुनर्निर्माण गर्नुहोस् ।</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>प्रि-फर्क अवस्थामा डाटाबेस रिवाइन्ड गर्न सकिएन । तपाईंले फेरि ब्लकचेन डाउनलोड गर्नु पर्ने हुन्छ</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>UPnP प्रयोग गरेर सुन्ने पोर्टलाई म्याप गर्नुहोस् (सुन्दा र -प्रोक्सी नहुँदा डिफल्ट: 1)</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s मा क्षति, बचाव विफल भयो</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool कम्तिमा %d MB को हुनुपर्छ ।</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&amp;lt;वर्ग&amp;gt; निम्न आकारको हुनसक्छ:</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>प्रयोगकर्ता एजेन्ट स्ट्रिङमा टिप्पणी जोड्नुहोस्</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>स्टार्टअपमा क्षति पूगेको वालेटबाट निजी की प्राप्त गर्न प्रयास गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>ब्लक सिर्जनाको बिकल्प:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>-%s ठेगाना: &amp;apos;%s&amp;apos; निश्चय गर्न सकिँदैन</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>सूचकांक परिवर्तन सीमा भन्दा बाहर</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>कनेक्सनको विकल्प:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>सर्वाधिकार (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>क्षति पुगेको ब्लक डाटाबेस फेला पर</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>डिबगिङ/परीक्षणका विकल्पहरू:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>वालेट लोड नगर्नुहोस् र वालेट RPC कलहरू अक्षम गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>तपाईं अहिले ब्लक डेटाबेस पुनर्निर्माण गर्न चाहनुहुन्छ ?</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>यो कम्प्युटरको %s मा बाँध्न सकिएन । %s सम्भवित रूपमा पहिलैबाट चलिरहेको छ ।</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>असमर्थित तर्क -बेन्चमार्कलाई बेवास्ता गरियो, -डिबग=बेन्च प्रयोग गर्नुहोस् ।</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>असमर्थित तर्क -डिबगनेटलाई बेवास्ता गरियो, -डिबग=नेट प्रयोग गर्नुहोस् । </translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>असमर्थित तर्क -टोर फेला पर्यो, -ओनियन प्रयोग गर्नुहोस् । </translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>UPnP प्रयोग गरेर सुन्ने पोर्ट म्याप गर्नुहोस् (डिफल्ट: %u) </translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>ब्लक प्रमाणित गरिँदै...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>वालेट डिबगिङ/परीक्षणका विकल्पहरू:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>वालेट फेरि लेख्नु आवश्यक छ: पूरा गर्न %s लाई पुन: सुरु गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>वालेटका विकल्पहरू:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>निर्दिष्ट गरिएको स्रोतबाट आएको JSON-RPC कनेक्सनलाई अनुमति दिनुहोस् । एकल IP (e.g. 1.2.3.4), नेटवर्क/नेटमास्क (उदाहरण 1.2.3.4/255.255.255.0) वा नेटवर्क/CIDR (उदाहरण 1.2.3.4/24) &amp;lt;ip&amp;gt; का लागि मान्य छन् । यो विकल्पलाई धेरै पटक निर्दिष्ट गर्न सकिन्छ</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>दिइएको ठेगानामा बाँध्नुहोस् र यसमा कनेक्ट गर्ने सहकर्मीलाई श्वेतसूचीमा राख्नुहोस् । IPv6 लागि [होस्ट]:पोर्ट संकेतन प्रयोग गर्नुहोस्</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>umask 077 को सट्टामा प्रणालीको डिफल्ट अनुमतिको साथमा नयाँ फाइलहरू सिर्जना गर्नुहोस् । (असक्षम गरिएको वालेट कार्यक्षमतामा मात्र प्रभावकारी हुने)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>आफ्नै IP ठेगाना पत्ता लगाउनुहोस् (सुन्दा र -बाहिरीआइपी वा -प्रोक्सी नहुँदा डिफल्ट: 1 )</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>त्रुटि: आगमन कनेक्सनमा सुन्ने कार्य असफल भयो (सुन्ने कार्यले त्रुटि %s फर्कायो)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>सान्दर्भिक चेतावनी प्राप्त गर्दा आदेश कार्यान्वयन गर्नुहोस् नभए धेरै लामो फोर्क देखा पर्न सक्छ । (cmd को %s लाई सन्देशले प्रतिस्थापन गर्छ)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>रिले, खनन वा कारोबारको सिर्जनाको लागि यो भन्दा कम शुल्क (%s/kB मा) लाई शून्य शुल्कको रूपमा लिइन्छ । (डिफल्ट: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>paytxfee सेट गरिएको छैन भने, औसतमा n ब्लक भित्र कारोबार पुष्टिकरण सुरु होस् भन्नका लागि पर्याप्त शुल्क समावेश गर्नुहोस् (डिफल्ट: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>maxtxfee=&amp;lt;रकम&amp;gt;: का लागि अमान्य रकम &amp;apos;%s&amp;apos; (कारोबारलाई अड्कन नदिन अनिवार्य रूपमा कम्तिमा %s को न्यूनतम रिले शुल्क हुनु पर्छ)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>हामीले रिले र खनन गर्ने डाटा वाहक कारोबारको डाटाको अधिकतम आकार (डिफल्ट: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>हरेक प्रोक्सी कनेक्सनका लागि क्रेडिन्सियल अनियमित बनाउनुहोस् । यसले टोर स्ट्रिमको अलगावलाई सक्षम पार्छ (डिफल्ट: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>कारोबार रकम शुल्क कटौती गरेपछि पठाउँदा धेरै नै सानो हुन्छ</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>श्वेतसूचीका सहकर्मी पहिलैबाट मेमपूल, उपयोगीमा भए पनि उनीहरूलाई DoS banned गर्न सकिँदैन र उनीहरूको कारोबार सधैं रिले हुन्छ, उदाहरण, गेटवेको लाग</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>तपाईंले काटछाँट नगरेको मोडमा जान पुनः सूचकांक प्रयोग गरेर डाटाबेस पुनर्निर्माण गर्नु पर्ने हुन्छ । यसले सम्पूर्ण ब्लकचेनलाई फेरि डाउनलोड गर्नेछ</translation>\n    </message>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_nl.ts",
    "content": "<TS language=\"nl\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Rechtermuisklik om het adres of label te wijzigen</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Maak een nieuw adres aan</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nieuw</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopieer het geselecteerde adres naar het klembord</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopieer</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>S&amp;luiten</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Verwijder het geselecteerde adres van de lijst</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporteer de data in de huidige tab naar een bestand</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporteer</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Verwijder</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Kies het adres om munten naar te versturen</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Kies het adres om munten op te ontvangen</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>K&amp;iezen</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Verzendadressen</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Ontvangstadressen</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Dit zijn uw Bitcoinadressen om betalingen mee te verzenden. Controleer altijd het bedrag en het ontvangstadres voordat u uw bitcoins verzendt.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Dit zijn uw Bitcoin-adressen waarmee u betalingen kunt ontvangen. We raden u aan om een nieuw ontvangstadres voor elke transactie te gebruiken.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopiëer adres</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopieer &amp;label</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Bewerk</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exporteer adreslijst</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Kommagescheiden bestand (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exporteren mislukt</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Een fout is opgetreden tijdens het opslaan van deze adreslijst naar %1. Probeer het nogmaals.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen label)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Wachtwoordzindialoog</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Voer wachtwoordzin in</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nieuwe wachtwoordzin</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Herhaal nieuwe wachtwoordzin</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Laat wachtwoord zien</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Voer een nieuw wachtwoord in voor uw portemonnee.&lt;br/&gt;Gebruik een wachtwoord van &lt;b&gt;tien of meer willekeurige karakters&lt;/b&gt;, of &lt;b&gt;acht of meer woorden&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Versleutel portemonnee</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Deze operatie vereist uw portemonneewachtwoord om de portemonnee te openen.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Open portemonnee</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Deze operatie vereist uw portemonneewachtwoord om de portemonnee te ontsleutelen</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Ontsleutel portemonnee</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Wijzig wachtwoord</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Voer het oude en nieuwe wachtwoord in voor uw portemonnee.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Bevestig versleuteling van de portemonnee</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Waarschuwing: Als u uw portemonnee versleutelt en uw wachtwoord vergeet, zult u &lt;b&gt;AL UW BITCOINS VERLIEZEN&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Weet u zeker dat u uw portemonnee wilt versleutelen?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Portemonnee versleuteld</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 zal nu afsluiten om het versleutelingsproces te voltooien. Onthoud dat het versleutelen van uw portemonnee u niet volledig kan beschermen: Malware kan uw computer infecteren en uw bitcoins stelen.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>BELANGRIJK: Elke eerder gemaakte backup van uw portemonneebestand dient u te vervangen door het nieuw gegenereerde, versleutelde portemonneebestand. Om veiligheidsredenen zullen eerdere backups van het niet-versleutelde portemonneebestand onbruikbaar worden zodra u uw nieuwe, versleutelde, portemonnee begint te gebruiken.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Portemonneeversleuteling mislukt</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Portemonneeversleuteling mislukt door een interne fout. Uw portemonnee is niet versleuteld.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>De opgegeven wachtwoorden komen niet overeen</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Portemonnee openen mislukt</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Het opgegeven wachtwoord voor de portemonnee-ontsleuteling is niet correct.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Portemonnee-ontsleuteling mislukt</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Portemonneewachtwoord is met succes gewijzigd.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Waarschuwing: De Caps-Lock-toets staat aan!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmasker</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Geband tot</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>&amp;Onderteken bericht...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchroniseren met netwerk...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Overzicht</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Toon algemeen overzicht van uw portemonnee</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transacties</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Blader door transactiegescheidenis</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>A&amp;fsluiten</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Programma afsluiten</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Over %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Toon informatie over %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Over &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Toon informatie over Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opties...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Wijzig configuratieopties voor %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Versleutel portemonnee...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Backup portemonnee...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Wijzig Wachtwoord</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Verstuuradressen...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Ontvangstadressen...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Open &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Klik om de netwerkactiviteit te stoppen.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Netwerkactiviteit gestopt.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Klik om de netwerkactiviteit opnieuw te starten.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Blokhoofden synchroniseren (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Bezig met herindexeren van blokken op harde schijf...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Verstuur munten naar een Bitcoinadres</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Backup portemonnee naar een andere locatie</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Wijzig het wachtwoord voor uw portemonneversleuteling</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Debugscherm</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Open debugging en diagnostische console</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifiëer bericht...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Portemonnee</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Verstuur</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Ontvangen</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Toon / verberg</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Toon of verberg het hoofdvenster</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Versleutel de geheime sleutels die bij uw portemonnee horen</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Onderteken berichten met uw Bitcoinadressen om te bewijzen dat u deze adressen bezit</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifiëer handtekeningen om zeker te zijn dat de berichten zijn ondertekend met de gespecificeerde Bitcoinadressen</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Bestand</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Instellingen</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Hulp</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Tab-werkbalk</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Vraag betaling aan (genereert QR-codes en bitcoin: URI's)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Toon de lijst met gebruikte verstuuradressen en -labels</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Toon de lijst met gebruikte ontvangstadressen en labels</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Open een bitcoin: URI of betalingsverzoek</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Opdrachtregelopties</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n actieve verbinding met Bitcoinnetwerk</numerusform><numerusform>%n actieve verbindingen met Bitcoinnetwerk</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Bezig met indexeren van blokken op harde schijf...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Bezig met verwerken van blokken op harde schijf...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n blok aan transactiegeschiedenis verwerkt.</numerusform><numerusform>%n blokken aan transactiegeschiedenis verwerkt.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 achter</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Laatst ontvangen blok was %1 geleden gegenereerd.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transacties na dit moment zullen nu nog niet zichtbaar zijn.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Waarschuwing</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informatie</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Bijgewerkt</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Toon het %1 hulpbericht om een lijst te krijgen met mogelijke Bitcoin commandoregelopties</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 client</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Verbinden met peers...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Aan het bijwerken...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Aantal: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Type: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Label: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adres: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Verstuurde transactie</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Binnenkomende transactie</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD-sleutel voortbrenging is &lt;b&gt;ingeschakeld&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD-sleutel voortbrenging is &lt;b&gt;uitgeschakeld&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Portemonnee is &lt;b&gt;versleuteld&lt;/b&gt; en momenteel &lt;b&gt;geopend&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Portemonnee is &lt;b&gt;versleuteld&lt;/b&gt; en momenteel &lt;b&gt;gesloten&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Een fatale fout heeft zich voorgedaan. Bitcoin kan niet veilig worden verdergezet en wordt afgesloten.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Munt Selectie</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kwantiteit</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Bedrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Vergoeding:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Stof:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Naheffing:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Wisselgeld:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(de)selecteer alles</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Boom modus</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Lijst modus</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Ontvangen met label</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Ontvangen met adres</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Bevestigingen</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bevestigd</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopieer adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopieer transactie-ID</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Blokeer ongebruikte</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Deblokkeer ongebruikte</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopieer aantal</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopieer vergoeding</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopieer na vergoeding</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopieer bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopieër stof</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopieer wijziging</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 geblokkeerd)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ja</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nee</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Dit label wordt rood, als een ontvanger een bedrag van minder dan de huidige dust-drempel gekregen heeft.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Kan per input +/- %1 satoshi(s)  variëren.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen label)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>wijzig van %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(wijzig)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Bewerk adres</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Label</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Het label dat bij dit adres item hoort</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Het adres dat bij dit adresitem hoort. Dit kan alleen bewerkt worden voor verstuuradressen.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adres</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nieuw ontvangstadres</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nieuw verzendadres</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Bewerk ontvangstadres</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Bewerk verzendadres</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Het opgegeven adres \"%1\" is een ongeldig Bitcoinadres.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Het opgegeven adres \"%1\" bestaat al in uw adresboek.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Kon de portemonnee niet openen.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Genereren nieuwe sleutel mislukt.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Een nieuwe gegevensmap wordt aangemaakt.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>naam</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Map bestaat al. Voeg %1 toe als u van plan bent hier een nieuwe map aan te maken.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Pad bestaat al en is geen map.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Kan hier geen gegevensmap aanmaken.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versie</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Over %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opdrachtregelopties</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Gebruik:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opdrachtregelopties</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>UI-opties:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Kies gegevensmap bij opstarten (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Stel taal in, bijvoorbeeld \"nl_NL\" (standaard: systeemlocale)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Geminimaliseerd starten</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Zet SSL-rootcertificaat voor betalingsverzoeken (standaard: -systeem-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Toon opstartscherm bij opstarten (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Reset alle wijzigingen aan instellingen gedaan in de GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Welkom</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Welkom bij %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Omdat dit de eerste keer is dat het programma gestart is, kunt u nu kiezen waar %1 de data moet opslaan.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Als u op OK klikt, dan zal %1 beginnen met downloaden en verwerken van de volledige %4 blokketen (%2GB) startend met de eerste transacties in %3 toen %4 initeel werd gestart.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Deze initiële synchronisatie is heel veeleisend, en kan hardware problemen met uw computer blootleggen die voorheen onopgemerkt bleven. Elke keer dat %1 gebruikt word, zal verdergegaan worden waar gebleven is.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Als u gekozen heeft om de blokketenopslag te beperken (pruning), dan moet de historische data nog steeds gedownload en verwerkt worden, maar zal verwijderd worden naderhand om schijf gebruik zo laag mogelijk te houden.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Gebruik de standaard gegevensmap</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Gebruik een aangepaste gegevensmap:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Tenminste %1 GB aan data zal worden opgeslagen in deze map, en dit zal naarmate de tijd voortschrijdt groeien.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Gemiddeld %1 GB aan data zal worden opgeslagen in deze map.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 zal een kopie van de blokketen van Bitcoin downloaden en opslaan.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>De portemonnee wordt ook in deze map opgeslagen.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Fout: De gespecificeerde map \"%1\" kan niet worden gecreëerd.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB aan vrije opslagruimte beschikbaar</numerusform><numerusform>%n GB aan vrije opslagruimte beschikbaar</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(van %n GB nodig)</numerusform><numerusform>(van %n GB nodig)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Vorm</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Recente transacties zijn mogelijk nog niet zichtbaar. De balans van de portemonnee is daarom mogelijk niet correct. Deze informatie is correct van zodra de synchronisatie met het Bitcoin-netwerk werd voltooid, zoals onderaan beschreven.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Poging om bitcoins te besteden die door \"nog niet weergegeven\" transacties worden beïnvloed, worden niet door het netwerk geaccepteerd.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Aantal blokken resterend.</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Onbekend...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Tijd laatste blok</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Vooruitgang</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Vooruitgang per uur</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>Berekenen...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Geschatte tijd tot volledig synchroon</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Verbergen</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Onbekend. Blokhoofden synchroniseren (%1%)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Open URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Open betalingsverzoek via URI of bestand</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Selecteer betalingsverzoek bestand</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Selecteer betalingsverzoekbestand om te openen</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opties</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Algemeen</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Start %1 automatisch na inloggen in het systeem.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Start %1 bij het inloggen op het systeem</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Grootte van de &amp;databasecache</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Aantal threads voor &amp;scriptverificatie</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP-adres van de proxy (bijv. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Toont aan of de aangeleverde standaard SOCKS5 proxy gebruikt word om peers te bereiken via dit netwerktype.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Gebruik aparte SOCKS&amp;5-proxy om peers te bereiken via verborgen Tor-diensten:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Verberg het icoon van de systeembalk.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Verberg systeembalkicoon</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimaliseren in plaats van de applicatie af te sluiten wanneer het venster is afgesloten. Als deze optie is ingeschakeld, zal de toepassing pas worden afgesloten na het selecteren van Exit in het menu.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL's van derden (bijvoorbeeld blokexplorer) die in de transacties tab verschijnen als contextmenuelementen. %s in de URL is vervangen door transactiehash. Verscheidene URL's zijn gescheiden door een verticale streep |.  </translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Actieve opdrachtregelopties die bovenstaande opties overschrijven:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Open het %1 configuratiebestand van de werkmap.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Open configuratiebestand</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Reset alle clientopties naar de standaardinstellingen.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Reset opties</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Netwerk</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = laat dit aantal kernen vrij)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>W&amp;allet</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Coin &amp;control activeren</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Indien het uitgeven van onbevestigd wisselgeld uitgeschakeld wordt dan kan het wisselgeld van een transactie niet worden gebruikt totdat de transactie ten minste een bevestiging heeft. Dit heeft ook invloed op de manier waarop uw saldo wordt berekend.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Spendeer onbevestigd wisselgeld</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Open de Bitcoinpoort automatisch op de router. Dit werkt alleen als de router UPnP ondersteunt en het aanstaat.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Portmapping via &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Accepteer verbindingen van buiten.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Sta inkomende verbindingen toe</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Verbind met het Bitcoinnetwerk via een SOCKS5 proxy.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Verbind via een SOCKS5-proxy (standaardproxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Poort:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Poort van de proxy (bijv. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Gebruikt om peers te bereiken via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Maak verbinding met Bitcoinnetwerk door een aparte SOCKS5-proxy voor verborgen diensten van Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Scherm</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Laat alleen een systeemvakicoon zien wanneer het venster geminimaliseerd is</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimaliseer naar het systeemvak in plaats van de taakbalk</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimaliseer bij sluiten van het venster</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Interface</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Taal &amp;gebruikersinterface:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>De taal van de gebruikersinterface kan hier ingesteld worden. Deze instelling zal pas van kracht worden nadat %1 herstart wordt.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Eenheid om bedrag in te tonen:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Kies de standaardonderverdelingseenheid om weer te geven in uw programma, en voor het versturen van munten</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Munt controle functies weergeven of niet.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>Transactie-URL's van &amp;derden</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Oké</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Annuleren</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>standaard</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>geen</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Bevestig reset opties</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Herstart van de client is vereist om veranderingen door te voeren.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Applicatie zal worden afgesloten. Wilt u doorgaan?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Configuratieopties</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Het configuratiebestand wordt gebruikt om geavanceerde gebruikersopties te specificeren welke de GUI instellingen overschrijd. Daarnaast, zullen alle command-line opties dit configuratiebestand overschrijven.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Het configuratiebestand kon niet worden geopend.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Om dit aan te passen moet de client opnieuw gestart worden.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Het opgegeven proxyadres is ongeldig.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Vorm</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>De weergegeven informatie kan verouderd zijn. Uw portemonnee synchroniseert automatisch met het Bitcoinnetwerk nadat een verbinding is gelegd, maar dit proces is nog niet voltooid.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Alleen-bekijkbaar:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Beschikbaar:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Uw beschikbare saldo</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Afwachtend:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>De som van de transacties die nog bevestigd moeten worden, en nog niet meetellen in uw beschikbare saldo</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Immatuur:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Gedolven saldo dat nog niet tot wasdom is gekomen</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldi</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Totaal:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Uw totale saldo</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Uw huidige balans in alleen-bekijkbare adressen</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Besteedbaar:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Recente transacties</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Onbevestigde transacties naar alleen-bekijkbare adressen</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Ontgonnen saldo dat nog niet tot wasdom is gekomen</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Huidige balans in alleen-bekijkbare adressen.</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Fout bij betalingsverzoek</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Kan bitcoin niet starten: click-to-pay handler</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI-behandeling</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>URL om betalingsverzoek te verkrijgen is ongeldig: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Ongeldig betalingsadres %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI kan niet verwerkt worden! Dit kan het gevolg zijn van een ongeldig Bitcoin adres of misvormde URI parameters.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Betalingsverzoek bestandsafhandeling</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Betalingsverzoekbestand kan niet gelezen of verwerkt worden! Dit kan veroorzaakt worden door een ongeldig betalingsverzoekbestand.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Betalingsverzoek geweigerd</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Betalingsaanvraagnetwerk komt niet overeen met klantennetwerk.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Betalingsverzoek verlopen.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Betalingsaanvraag is niet geïnitialiseerd.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Niet-geverifieerde betalingsverzoeken naar aangepaste betalingsscripts worden niet ondersteund.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Ongeldig betalingsverzoek.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Het gevraagde betalingsbedrag van %1 is te weinig (beschouwd als stof).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Restitutie van %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Betalingsverzoek %1 is te groot (%2 bytes, toegestaan ​​%3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Fout bij communiceren met %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Betalingsverzoek kan niet worden verwerkt!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Ongeldige respons van server %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Fout bij netwerkverzoek</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Betaling bevestigd</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Node/Dienst</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Node ID</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Verstuurd</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Ontvangen</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Voer een Bitcoinadres in (bijv. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 uur</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Geen</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N.v.t.</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n seconde</numerusform><numerusform>%n seconden</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minuut</numerusform><numerusform>%n minuten</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n uur</numerusform><numerusform>%n uren</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n dag</numerusform><numerusform>%n dagen</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n week</numerusform><numerusform>%n weken</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 en %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n jaar</numerusform><numerusform>%n jaren</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 Kb</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 Gb</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 sloot nog niet veilig af...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>onbekend</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Fout: Opgegeven gegevensmap \"%1\" bestaat niet.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Fout: Kan configuratiebestand niet verwerken: %1. Gebruik enkel de key=value syntax.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Fout: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Sla afbeelding op...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Afbeelding kopiëren</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Sla QR-code op</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG afbeelding (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N.v.t.</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Clientversie</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informatie</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Debug venster</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Algemeen</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Gebruikt BerkeleyDB versie</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Gegevensmap</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Opstarttijd</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Netwerk</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Naam</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Aantal connecties</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blokketen</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Huidig aantal blokken</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Geheugenpoel</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Huidig aantal transacties</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Geheugengebruik</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Reset</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Ontvangen</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Verstuurd</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Peers</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Gebande peers</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Selecteer een peer om gedetailleerde informatie te bekijken.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Toegestaan</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Directie</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versie</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Start Blok</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Gesynchroniseerde headers</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Gesynchroniseerde blokken</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Open het %1 debug-logbestand van de huidige gegevensmap. Dit kan een aantal seconden duren voor grote logbestanden.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Verklein lettergrootte</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Vergroot lettergrootte</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Diensten</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Ban score</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Connectie tijd</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Laatst verstuurd</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Laatst ontvangen</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping Tijd</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>De tijdsduur van een op het moment openstaande ping.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Pingwachttijd</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Min Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Tijdcompensatie</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Tijd laatste blok</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Open</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Console</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Netwerkverkeer</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totalen</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>In:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Uit:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Debuglogbestand</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Maak console leeg</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;uur</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;dag</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;week</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;jaar</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Verbreek verbinding</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Ban Node voor</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Maak ban voor node ongedaan</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Welkom bij de %1 RPC-console.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Gebruik pijltjes omhoog en omlaag om door de geschiedenis te navigeren en %1 om het scherm te wissen.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Typ %1  voor een overzicht van de beschikbare commando's.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Typ %1 voor meer informatie over het gebruik van deze console.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>WAARSCHUWING: Er zijn Scammers actief geweest, die gebruikers vragen om hier commando's te typen, waardoor de inhoud van hun portemonnee werd gestolen. Gebruik deze console niet zonder de gevolgen van een commando volledig te begrijpen.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Netwerkactiviteit uitgeschakeld</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(node id: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nooit</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Inkomend</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Uitgaand</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nee</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Onbekend</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Bedrag</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Bericht</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Een optioneel bericht om bij te voegen aan het betalingsverzoek, welke zal getoond worden wanneer het verzoek is geopend. Opmerking: Het bericht zal niet worden verzonden met de betaling over het Bitcoinnetwerk.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Een optioneel label om te associëren met het nieuwe ontvangstadres</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Gebruik dit formulier om te verzoeken tot betaling. Alle velden zijn &lt;b&gt;optioneel&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Een optioneel te verzoeken bedrag. Laat dit leeg, of nul, om geen specifiek bedrag aan te vragen.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Wis alle velden op het formulier.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Wissen</translation>\n    </message>\n    <message>\n        <source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</source>\n        <translation>Native segwit-adressen (Bech32 of BIP-173) reduceren later je transactiekosten en bieden een betere bescherming tegen typefouten, maar oude portemonnees ondersteunen deze niet. Een adres dat is compatibel met oudere portemonnees zal worden gecreëerd indien dit niet is aangevinkt.</translation>\n    </message>\n    <message>\n        <source>Generate native segwit (Bech32) address</source>\n        <translation>Genereer native segwit-adres (Bech32)</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Geschiedenis van de betalingsverzoeken</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Betalingsverzoek</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Toon het geselecteerde verzoek (doet hetzelfde als dubbelklikken)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Toon</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Verwijder de geselecteerde items van de lijst</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Verwijder</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Kopieer URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer label</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopieer bericht</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-code</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopieer &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopieer &amp;adres</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Sla afbeelding op...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Betalingsverzoek tot %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Betalingsinformatie</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Bericht</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Resulterende URI te lang, probeer de tekst korter te maken voor het label/bericht.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Fout tijdens encoderen URI in QR-code</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Bericht</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen label)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(geen bericht)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(geen bedrag aangevraagd)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Verzoek ingediend</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Verstuurde munten</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Coin controle opties</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Invoer...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automatisch geselecteerd</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Onvoldoende fonds!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kwantiteit</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Bedrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Vergoeding:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Naheffing:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Wisselgeld:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Als dit is geactiveerd, maar het wisselgeldadres is leeg of ongeldig, dan wordt het wisselgeld verstuurd naar een nieuw gegenereerd adres.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Aangepast wisselgeldadres</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transactievergoeding:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Kies...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Gebruik van de terugvalkosten kan resulteren in het verzenden van een transactie die meerdere uren of dagen (of nooit) zal duren om bevestigd te worden. Overweeg om handmatig de vergoeding in te geven of wacht totdat je de volledige keten hebt gevalideerd.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Waarschuwing: Schatting van de vergoeding is momenteel niet mogelijk.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>verberg vergoeding-instellingen</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Als de aangepaste toeslag is ingesteld op 1000 satoshis en de transactie is maar 250 bytes, dan wordt bij \"per kilobyte\" 250 satoshis aan toeslag berekend, terwijl er bij \"totaal tenminste\" 1000 satoshis worden berekend. Voor transacties die groter zijn dan een kilobyte, wordt in beide gevallen per kilobyte de toeslag berekend.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Verbergen</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>De minimale toeslag betalen is prima mits het transactievolume kleiner is dan de ruimte in de blokken. Let wel op dat dit tot gevolg kan hebben dat een transactie nooit wordt bevestigd als er meer vraag is naar bitcointransacties dan het netwerk kan verwerken.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(lees de tooltip)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Aanbevolen:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Aangepast:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Slimme transactiekosten is nog niet geïnitialiseerd. Dit duurt meestal een paar blokken...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Verstuur in een keer aan verschillende ontvangers</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Voeg &amp;ontvanger toe</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Wis alle velden van het formulier.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Stof:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Bevestigingstijddoel:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Activeer Replace-By-Fee</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Met Replace-By-Fee (BIP-125) kun je de vergoeding voor een transactie verhogen na dat deze verstuurd is. Zonder dit kan een hogere vergoeding aangeraden worden om te compenseren voor de hogere kans op transactie vertragingen.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Verwijder &amp;alles</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Bevestig de verstuuractie</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>V&amp;erstuur</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopieer aantal</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopieer vergoeding</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopieer na vergoeding</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopieer bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopieër stof</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopieer wijziging</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blokken)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 tot %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Weet u zeker dat u wilt verzenden?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>toegevoegd als transactie vergoeding</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Totaalbedrag %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>of</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Je kunt de vergoeding later verhogen (signaleert Replace-By-Fee, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Signaleert geen Replace-By-Fee, BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Bevestig versturen munten</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Het adres van de ontvanger is niet geldig. Gelieve opnieuw te controleren.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Het ingevoerde bedrag moet groter zijn dan 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Het bedrag is hoger dan uw huidige saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Het totaal overschrijdt uw huidige saldo wanneer de %1 transactie vergoeding wordt meegerekend.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Dubbel adres gevonden: adressen mogen maar één keer worden gebruikt worden.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Transactiecreatie mislukt</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>De transactie werd afgewezen om de volgende reden: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Een vergoeding van meer dan %1 wordt beschouwd als een absurd hoge vergoeding.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Betalingsverzoek verlopen.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Betaal alleen de verplichte transactie vergoeding van %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Schatting is dat bevestiging begint over %n blok.</numerusform><numerusform>Schatting is dat bevestiging begint over %n blokken.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Waarschuwing: Ongeldig Bitcoinadres</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Waarschuwing: Onbekend wisselgeldadres</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Bevestig aangepast wisselgeldadres</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Het wisselgeldadres dat u heeft geselecteerd maakt geen deel uit van deze portemonnee. Een deel of zelfs alle geld in uw portemonnee kan mogelijk naar dit adres worden verzonden. Weet je het zeker?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen label)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>B&amp;edrag:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Betaal &amp;aan:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Kies een eerder gebruikt adres</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Dit is een normale betaling.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Het Bitcoinadres om betaling aan te versturen</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Plak adres vanuit klembord</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Verwijder deze toevoeging</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>De transactiekosten zal worden afgetrokken van het bedrag dat verstuurd wordt. De ontvangers zullen minder bitcoins ontvangen dan ingevoerd is in het hoeveelheidsveld. Als er meerdere ontvangers geselecteerd zijn, dan worden de transactiekosten gelijk verdeeld.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>Trek de transactiekosten a&amp;f van het bedrag.</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Gebruik beschikbaar saldo</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Bericht:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Dit is een niet-geverifieerd betalingsverzoek.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Dit is een geverifieerd betalingsverzoek.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Vul een label voor dit adres in om het aan de lijst met gebruikte adressen toe te voegen</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Een bericht dat werd toegevoegd aan de bitcoin: URI welke wordt opgeslagen met de transactie ter referentie. Opmerking: Dit bericht zal niet worden verzonden over het Bitcoinnetwerk.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Betaal Aan:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Vul een label in voor dit adres om het toe te voegen aan uw adresboek</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 is aan het afsluiten...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Sluit de computer niet af totdat dit venster verdwenen is.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Handtekeningen – Onderteken een bericht / Verifiëer een handtekening</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Onderteken bericht</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>U kunt berichten/overeenkomsten ondertekenen met uw adres om te bewijzen dat u Bitcoins kunt versturen. Wees voorzichtig met het ondertekenen van iets vaags of willekeurigs, omdat phishingaanvallen u kunnen proberen te misleiden tot het ondertekenen van overeenkomsten om uw identiteit aan hen toe te vertrouwen. Onderteken alleen volledig gedetailleerde verklaringen voordat u akkoord gaat.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Het Bitcoinadres om bericht mee te ondertekenen</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Kies een eerder gebruikt adres</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Plak adres vanuit klembord</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Typ hier het bericht dat u wilt ondertekenen</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Handtekening</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopieer de huidige handtekening naar het systeemklembord</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Onderteken een bericht om te bewijzen dat u een bepaald Bitcoinadres bezit</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Onderteken &amp;bericht</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Verwijder alles in de invulvelden</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Verwijder &amp;alles</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifiëer bericht</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Voer het adres van de ontvanger in, bericht (zorg ervoor dat de regeleinden, spaties, tabs etc. precies kloppen) en onderteken onderaan om het bericht te verifiëren. Wees voorzicht om niet meer in de ondertekening te lezen dan in het getekende bericht zelf, om te voorkomen dat je wordt aangevallen met een man-in-the-middle attack. Houd er mee rekening dat dit alleen de ondertekende partij bewijst met het ontvangen adres, er kan niet bewezen worden dat er een transactie heeft plaatsgevonden!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Het Bitcoinadres waarmee het bericht ondertekend is</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Controleer een bericht om te verifiëren dat het gespecificeerde Bitcoinadres het bericht heeft ondertekend.</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifiëer &amp;bericht</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Verwijder alles in de invulvelden</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Klik op \"Onderteken Bericht\" om de handtekening te genereren</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Het opgegeven adres is ongeldig.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Controleer het adres en probeer het opnieuw.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Het opgegeven adres verwijst niet naar een sleutel.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Portemonnee-ontsleuteling is geannuleerd.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Geheime sleutel voor het ingevoerde adres is niet beschikbaar.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Ondertekenen van het bericht is mislukt.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Bericht ondertekend.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>De handtekening kon niet worden gedecodeerd.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Controleer de handtekening en probeer het opnieuw.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>De handtekening hoort niet bij het bericht.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Berichtverificatie mislukt.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Bericht geverifiëerd.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnetwerk]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Open voor nog %n blok</numerusform><numerusform>Open voor nog %n blokken</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Open tot %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>geconflicteerd met een transactie met %1 confirmaties</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/onbevestigd, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>in geheugenpoel</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>niet in geheugenpoel</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>opgegeven</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/onbevestigd</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 bevestigingen</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, is nog niet met succes uitgezonden</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Bron</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Gegenereerd</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Van</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>onbekend</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Aan</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>eigen adres</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>alleen-bekijkbaar</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>label</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Credit</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>komt beschikbaar na %n nieuwe blok</numerusform><numerusform>komt beschikbaar na %n nieuwe blokken</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>niet geaccepteerd</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debet</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Totaal debit</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Totaal credit</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transactiekosten</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Netto bedrag</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Bericht</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Opmerking</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transactie-ID</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Transactie totale grootte</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Output index</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Handelaar</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Gegenereerde munten moeten %1 blokken rijpen voordat ze kunnen worden besteed. Toen dit blok gegenereerd werd, werd het uitgezonden naar het netwerk om aan de blokketen toegevoegd te worden. Als het niet lukt om in de keten toegevoegd te worden, zal de status te veranderen naar \"niet geaccepteerd\" en zal het niet besteedbaar zijn. Dit kan soms gebeuren als een ander node een blok genereert binnen een paar seconden na die van u.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Debug-informatie</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transactie</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Inputs</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>waar</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>onwaar</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Dit venster laat een uitgebreide beschrijving van de transactie zien</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Details voor %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Open voor nog %n blok</numerusform><numerusform>Open voor nog %n blokken</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Open tot %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Onbevestigd</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Opgegeven</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Bevestigen (%1 van %2 aanbevolen bevestigingen)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Bevestigd (%1 bevestigingen)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Conflicterend</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Niet beschikbaar (%1 bevestigingen, zal beschikbaar zijn na %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Dit blok is niet ontvangen bij andere nodes en zal waarschijnlijk niet worden geaccepteerd!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Gegenereerd maar niet geaccepteerd</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Ontvangen met</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Ontvangen van</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Verzonden aan</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Betaling aan uzelf</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Gedolven</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>alleen-bekijkbaar</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(nvt)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen label)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Transactiestatus. Houd de cursor boven dit veld om het aantal bevestigingen te laten zien.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Datum en tijd waarop deze transactie is ontvangen.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Type transactie.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Of er een alleen-bekijken-adres is betrokken bij deze transactie.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Door gebruiker gedefinieerde intentie/doel van de transactie.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Bedrag verwijderd van of toegevoegd aan saldo.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Alles</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Vandaag</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Deze week</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Deze maand</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Vorige maand</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Dit jaar</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Bereik...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Ontvangen met</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Verzonden aan</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Aan uzelf</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Gedolven</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Anders</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Voer adres, transactie-ID of etiket in om te zoeken</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Min. bedrag</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Doe afstand van transactie</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Toename transactiekosten</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopieer adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopieer transactie-ID</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Kopieer ruwe transactie</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Kopieer volledige transactiedetials</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Bewerk label</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Toon transactiedetails</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exporteer transactiegeschiedenis</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Kommagescheiden bestand (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bevestigd</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Alleen-bekijkbaar</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Export mislukt</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Er is een fout opgetreden bij het opslaan van de transactiegeschiedenis naar %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Export succesvol</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>De transactiegeschiedenis was succesvol bewaard in %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Bereik:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>naar</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Eenheid om bedragen uit te drukken. Klik om een andere eenheid te selecteren.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Er is geen portemonnee geladen.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Verstuur munten</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Vergoedingsverhoging fout</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Verhogen transactie vergoeding is mislukt</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Wil je de vergoeding verhogen?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Huidige vergoeding:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Toename:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nieuwe vergoeding:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Bevestig vergoedingsaanpassing</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Kan transactie niet ondertekenen.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Kon de transactie niet voltooien</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporteer</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporteer de data in de huidige tab naar een bestand</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Portemonnee backuppen</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Portemonneedata (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Backup mislukt</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Er is een fout opgetreden bij het wegschrijven van de portemonneedata naar %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Backup succesvol</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>De portemonneedata is succesvol opgeslagen in %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opties:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Stel gegevensmap in</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Verbind naar een node om adressen van anderen op te halen, en verbreek vervolgens de verbinding</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Specificeer uw eigen publieke adres</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Aanvaard opdrachtregel- en JSON-RPC-opdrachten</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Uitgegeven onder de MIT software licentie, zie het bijgevoegde bestand %s of %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Als er geen &lt;categorie&gt; is opgegeven of als de &lt;categorie&gt; 1 is, laat dan alle debugginginformatie zien.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Prune is ingesteld op minder dan het minimum van %d MiB. Gebruik a.u.b. een hoger aantal.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Prune: laatste wallet synchronisatie gaat verder terug dan de middels -prune beperkte data. U moet -reindex gebruiken (downloadt opnieuw de gehele blokketen voor een pruned node)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Herscannen is niet mogelijk i.c.m. -prune. U moet -reindex gebruiken dat de hele blokketen opnieuw zal downloaden.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Fout: er is een fout opgetreden,  zie debug.log voor details</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Transactievergoeding (in %s/kB) toevoegen aan transacties die u doet (standaard: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Blokopslag prunen...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Draai in de achtergrond als daemon en aanvaard opdrachten</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Niet mogelijk ok HTTP-server te starten. Zie debuglogboek voor details.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>De %s ontwikkelaars</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Een transactietarief (in %s/kB) dat gebruikt wordt als de transactiekosten schatting niet genoeg data heeft. (normaal: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Accepteer doorgestuurde transacties ontvangen van goedgekeurde peers, ook wanneer je zelf geen transacties doorstuurt (standaard: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Voeg een node toe om mee te verbinden en probeer de verbinding open te houden (zie bij help voor het `addnode` RPC commando voor meer info)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Bind aan opgegeven adres en luister er altijd op. Gebruik [host]:port notatie voor IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Kan geen lock verkrijgen op gegevensmap %s. %s draait waarschijnlijk al.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Kan niet specifieke verbindingen voorzien en tegelijk addrman uitgaande verbindingen laten vinden.</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Verbind enkel met de opgegeven node(s); -connect=0 schakelt automatische verbindingen uit (de regels voor deze peer zijn dezelfde als voor -addnode)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Verwijder alle transacties van de portemonnee en herstel alleen de delen van de blokketen door -rescan tijdens het opstarten</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Waarschuwing: Fout bij het lezen van %s! Alle sleutels zijn in goede orde uitgelezen, maar transactiedata of adresboeklemma's zouden kunnen ontbreken of fouten bevatten.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Sluit debugging informatie uit van een categorie. Dit kan samen gebruikt worden met -debug=1 om uitvoer debug logboeken te creëren voor alle categorieën, behalve één of meerdere categorieën.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Voer opdracht uit zodra een portemonneetransactie verandert (%s in cmd wordt vervangen door TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Extra transacties wordt bijgehouden voor compacte blokreconstructie (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Als dit blok in de keten staat, gaat het ervan uit dat dit blok en zijn voorouders geldig zijn en mogelijk hun script verificatie overslaan (0 om alles te verifiëren, standaard:%s, testnet:%s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Maximum toegestane peer tijd compensatie. Lokaal perspectief van tijd mag worden beinvloed door peers die met deze hoeveelheid voor of achter lopen. (standaard: %u seconden)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Maximum totale transactiekosten (in %s) om te gebruiken in een enkele portemonneetransactie; als dit te laag is ingesteld kunnen grote transacties worden verhinderd (standaard: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Waarschuwing: Controleer dat de datum en tijd van uw computer correct zijn ingesteld! Bij een onjuist ingestelde klok zal %s niet goed werken.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Gelieve bij te dragen als je %s nuttig vindt. Bezoek %s voor meer informatie over de software.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Query voor peer adressen via DNS-lookup, als er weinig adressen zijn (standaard: 1 tenzij -connect gebruikt word)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Beperk benodigde opslag door het prunen (verwijderen) van oude blokken in te schakelen. Dit maakt het mogelijk om het pruneblockchain RPC commando aan te roepen om specifieke bloks te verwijderen, en maakt het automatische prunen van oude bloks mogelijk wanneer een doelgrootte in MiB is ingesteld. Deze modus is niet compatibel met -txindex en -rescan. Waarschuwing: ongedaan maken van deze instellingen vereist het opnieuw downloaden van gehele de blokketen. (standaard:0 = uitschakelen prunen, 1 = handmatig prunen via RPC toestaan, &gt;%u = automatisch blokketen bestanden prunen om beneden de gespecificeerde doelgrootte in MiB te blijven)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Specificeer het laagste tarief (in %s/kB) voor transacties die bij het maken van een blok moeten worden in rekening worden gebracht (standaard: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Kies het aantal scriptverificatie processen (%u tot %d, 0 = auto, &lt;0 = laat dit aantal kernen vrij, standaard: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>De blokdatabase bevat een blok dat lijkt uit de toekomst te komen. Dit kan gebeuren omdat de datum en tijd van uw computer niet goed staat. Herbouw de blokdatabase pas nadat u de datum en tijd van uw computer correct heeft ingesteld.</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Dit is een pre-release testversie - gebruik op eigen risico! Gebruik deze niet voor het delven van munten of handelsdoeleinden</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Dit is de transactievergoeding die u mag afleggen als het wisselgeld kleiner is dan stof op dit niveau</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Onmogelijk om blokken opnieuw af te spelen. U dient de database opnieuw op te bouwen met behulp van -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Niet mogelijk om de databank terug te draaien naar een staat voor de vork. Je zal je blokketen opnieuw moeten downloaden</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Gebruik UPnP om de luisterende poort te mappen (standaard: 1 als er geluisterd worden en geen -proxy is meegegeven)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Gebruikersnaam en gehasht wachtwoord voor JSON-RPC-verbindingen. Het veld &lt;userpw&gt; is in het formaat: &lt;GEBRUIKERSNAAM&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Een kanoniek Pythonscript is inbegrepen in share/rpcuser. De client verbindt dan normaal via de rpcuser=&lt;GEBRUIKERSNAAM&gt;/rpcpassword=&lt;PASWOORD&gt; argumenten. Deze optie kan meerdere keren worden meegegeven</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Portemonnee creëert geen transacties die mempool-ketenlimieten schenden (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Waarschuwing: Het lijkt erop dat het netwerk geen consensus kan vinden! Sommige delvers lijken problemen te ondervinden.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Waarschuwing: Het lijkt erop dat we geen consensus kunnen vinden met onze peers! Mogelijk dient u te upgraden, of andere nodes moeten wellicht upgraden.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Of de mempool opgeslagen moet worden bij afsluiten en ingeladen moet worden tijdens herstarten (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d van de laatste 100 blokken hebben een onverwachte versie</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s corrupt, veiligstellen mislukt</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool moet minstens %d MB zijn</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;categorie&gt; kan zijn:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Accepteer verbindingen van buitenaf (standaard: 1 als geen -proxy of -connect is opgegeven)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Voeg commentaar toe aan de user agent string</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Probeer privésleutels te herstellen van een corrupte wallet bij opstarten</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Blokcreatie-opties:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Kan -%s adres niet herleiden: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Keten selectie opties:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Wijzigingsindex buiten bereik</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Verbindingsopties:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Auteursrecht (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Corrupte blokkendatabase gedetecteerd</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Foutopsporing/Testopties:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Laad de wallet niet en schakel wallet RPC oproepen uit</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Wilt u de blokkendatabase nu herbouwen?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Sta toe om hashblok te publiceren in &lt;adres&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Sta toe om hashtransactie te publiceren in &lt;adres&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Sta toe rauw blok te publiceren in &lt;adres&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Sta toe ruwe transacties te publiceren in &lt;adres&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Transactie vervanging inschakelen in het geheugen (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Fout bij het maken van %s: Je kunt geen niet-HD portemonnees maken met deze versie.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Fout bij intialisatie blokkendatabase</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Probleem met initializeren van de database-omgeving %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Fout bij het laden van %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Fout bij het laden van %s: Portomonnee corrupt</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Fout bij laden %s: Portemonnee vereist een nieuwere versie van %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Fout bij het laden van blokkendatabase</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Fout bij openen blokkendatabase</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Fout: Weinig vrije diskruimte!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Mislukt om op welke poort dan ook te luisteren. Gebruik -listen=0 as u dit wilt.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Portemonnee herscannen tijdens initialisatie mislukt</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importeren...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Incorrect of geen genesisblok gevonden. Verkeerde gegevensmap voor het netwerk?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Initialisatie sanity check mislukt. %s is aan het afsluiten.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Ongeldig bedrag voor -%s=&lt;bedrag&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Ongeldig bedrag for -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Ongeldig bedrag voor -fallbackfee=&lt;bedrag&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>De transactiegeheugenpool moet onder de &lt;n&gt; megabytes blijven (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>P2P-adressen aan het laden...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Verbanningslijst aan het laden...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Locatie van de auth cookie (standaard: data dir)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Niet genoeg file descriptors beschikbaar.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Verbind alleen met nodes in netwerk &lt;net&gt; (ipv4, ipv6 of onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Print dit helpbericht en sluit af</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Laat versie zien en sluit af</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Prune kan niet worden geconfigureerd met een negatieve waarde.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Prune-modus is niet compatible met -txindex</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Herbouw ketenstaat en blokindex met behulp van de blk*.dat bestanden op de harde schijf</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Herbouw ketenstaat vanuit de huidige geindexeerde blokken</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Blokken opnieuw aan het afspelen...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Blokken aan het terugdraaien...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>Verstuur transacties met full-RBF opt-in ingeschakeld (enkel RPC, standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Zet database cache grootte in megabytes (%d tot %d, standaard: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Specificeer het portemonnee bestand (vanuit de gegevensmap)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>De broncode is beschikbaar van %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Transactievergoeding en wisselgeldberekening mislukt</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Niet in staat om %s te verbinden op deze computer. %s draait waarschijnlijk al.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Niet-ondersteund argument -benchmark genegeerd, gebruik -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Niet-ondersteund argument -debugnet genegeerd, gebruik -debug=net</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Niet-ondersteund argument -tor gevonden, gebruik -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Niet-ondersteunde logcategorie %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Upgraden UTXO-database</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Gebruik UPnP om de luisterende poort te mappen (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Gebruik de test keten</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>User Agentcommentaar (%s) bevat onveilige karakters.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Blokken aan het controleren...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Portemonee debugging/testing opties:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Portemonnee moest herschreven worden: Herstart %s om te voltooien</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Portemonnee instellingen:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Sta JSON-RPC verbindingen toe vanuit een gespecificeerde bron. Geldig voor &lt;ip&gt; zijn een enkel IP (bijv. 1.2.3.4), een netwerk/netmask (bijv. 1.2.3.4/255.255.255.0) of een netwerk/CIDR (bijv. 1.2.3.4/24). Deze optie kan meerdere keren gespecificeerd worden.</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Bind aan opgegeven adres en keur peers die ermee verbinden goed. Gebruik [host]:poort notatie voor IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Creër nieuwe bestanden met standaard systeem bestandsrechten in plaats van umask 077 (alleen effectief met uitgeschakelde portemonnee functionaliteit)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Ontdek eigen IP-adressen (standaard: 1 voor luisteren en geen -externalip of -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Fout: luisteren naar binnenkomende verbindingen mislukt (luisteren gaf foutmelding %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Voer opdracht uit zodra een waarschuwing is ontvangen of wanneer we een erg lange fork detecteren (%s in opdracht wordt vervangen door bericht)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Vergoedingen (in %s/kB) kleiner dan dit worden beschouwd als nul-vergoeding voor doorgeven, mijnen en transactiecreatie (standaard: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Als paytxfee niet is ingesteld, voeg voldoende vergoeding toe zodat transacties starten met bevestigingen binnen n blokken (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>ongeldig bedrag voor -maxtxfee=&lt;bedrag&gt;: '%s' (moet ten minste de minimale doorgeefvergoeding van %s zijn om vastgelopen transacties te voorkomen)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maximale grootte van de gegevens in gegevensdragertransacties die we doorgeven en mijnen (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Gebruik willekeurige inloggegevens voor elke proxyverbinding. Dit maakt streamisolatie voor Tor mogelijk (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Het transactiebedrag is te klein om te versturen nadat de transactievergoeding in mindering is gebracht</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Goedgekeurde peers kunnen niet ge-DoS-banned worden en hun transacties worden altijd doorgegeven, zelfs als ze reeds in de mempool aanwezig zijn, nuttig voor bijv. een gateway</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>U moet de database herbouwen met -reindex om terug te gaan naar de niet-prune modus. Dit zal de gehele blokketen opnieuw downloaden.</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Accepteer publieke REST-verzoeken (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Creëer automatisch verborgen dienst van Tor (standaard:%d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Verbind door SOCKS5 proxy</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Fout bij het laden van %s: Je kan HD niet deactiveren voor een reeds bestaande niet-HD-portemonnee</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Fout bij het lezen van de database, afsluiten. </translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Fout bij het upgraden van de ketenstaat database</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importeer blokken van externe blk000??.dat-bestand bij opstarten</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informatie</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Ongeldig -onion adress of hostnaam: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Ongeldig -proxy adress of hostnaam: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Ongeldig bedrag voor -paytxfee=&lt;bedrag&gt;: '%s' (Minimum %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Ongeldig netmask gespecificeerd in -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Houd maximaal &lt;n&gt; onverbonden transacties in geheugen (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Verplicht een poort met -whitebind op te geven: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Node doorgeefopties:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC server opties:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Verminder -maxconnections van %d naar %d, vanwege systeembeperkingen.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Herscan de blokketen voor missende portemonneetransacties bij opstarten</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Verzend trace/debug-info naar de console in plaats van het debug.log-bestand</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Toon alle foutopsporingsopties (gebruik: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Verklein debug.log-bestand bij het opstarten van de client (standaard: 1 als geen -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Ondertekenen van transactie mislukt</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>Opgegeven -walletdir \"%s\" bestaat niet</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>Opgegeven -walletdir \"%s\" is een relatief pad</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>Opgegeven -walletdir \"%s\" is geen map</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Het transactiebedrag is te klein om transactiekosten in rekening te brengen</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Dit is experimentele software.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Tor bepaalt poortwachtwoord (standaard: empty)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Tor bepaalt welke poort te gebruiken als luisteren naar onion wordt gebruikt (standaard: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transactiebedrag te klein</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>De transactie is te groot voor het transactiekostenbeleid</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transactie te groot</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Niet in staat om aan %s te binden op deze computer (bind gaf error %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Niet mogelijk initiële sleutels te genereren</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Upgrade portemonee naar laatste formaat bij opstarten</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Gebruikersnaam voor JSON-RPC-verbindingen</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Portomenee(n) aan het verifiëren...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Portemonnee %s begeeft zich buiten portemoneemap %s</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Waarschuwing</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Waarschuwing: onbekende nieuwe regels geactiveerd (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Om in alleen een blokmodus te opereren (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>De database moet opnieuw opgebouwd worden met behulp van -reindex om -txindex te veranderen</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Bezig met het zappen van alle transacties van de portemonnee...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ notificatieopties:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Wachtwoord voor JSON-RPC-verbindingen</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Voer opdracht uit zodra het beste blok verandert (%s in cmd wordt vervangen door blokhash)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Sta DNS-naslag toe voor -addnode, -seednode en -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = behoudt tx meta data bijv. account eigenaar en betalingsverzoek informatie, 2. sla tx meta data niet op)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee staat zeer hoog! Transactiekosten van deze grootte kunnen worden gebruikt in een enkele transactie.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Bind aan gegeven adres om te luisteren voor JSON-RPC verbindingen. Deze optie zal genegeerd worden tenzij -rpcallowip ook aangegeven wordt. Port is optioneel en overschrijft -rpcport. Gebruik [host]:poort notatie voor IPv6. Deze optie kan meerdere keren gebruikt worden (standaard: 127.0.0.1 en ::1 i.e., localhost, of als -rpcallowip gespecificeerd is, 0.0.0.0 en :: i.e., alle adressen)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Bewaar transactie niet langer dan &lt;n&gt; uren in de geheugenpool (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Equivalent bytes per sigop in transacties voor doorsturen en mijnen (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Fout bij het laden van %s: Je kan HD niet activeren voor een reeds bestaande niet-HD-portemonnee</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Fout laden portemonnee %s. -wallet parameter mag alleen een bestandsnaam zijn (geen pad).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Transactiekosten (in %s/kB) kleiner dan dit worden beschouwd dat geen transactiekosten in rekening worden gebracht voor transactiecreatie (standaard: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Forceer het doorsturen van transacties van goedgekeurde peers, zelfs wanneer deze niet voldoen aan de lokale doorstuurregels (standaard: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Hoe grondig de blokverificatie van -checkblocks is (0-4, standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Onderhoud een volledige transactieindex, gebruikt door de getrawtransaction rpc call (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Aantal seconden dat zich misdragende peers niet opnieuw kunnen verbinden (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Output extra debugginginformatie (standaard: %u, het leveren van &lt;categorie&gt; is optioneel)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Geef map op om portemonnees in te bewaren (standaard: &lt;datadir&gt;/wallets indien dit bestaat, anders &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Geef locatie op voor debug log bestand: dit kan een absoluut pad zijn of een relatief pad vanaf de gegevensmap (standaard: %s) </translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Ondersteun filtering van blokken en transacties met bloomfilters (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>Het vergoedingstarief (in %s/kB) dat de toelating van afdanken van wisselgeld aangeeft door het toe te voegen aan de vergoeding (standaard: %s). Notitie: Een output zal afgedankt worden als het stof is in dit tarief, maar we zullen altijd afdanken tot aan de stof doorstuur vergoeding en een afdank tarief boven wat is gelimiteerd door de vergoeding inschatting voor het langste doel</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Dit is de transactievergoeding die je mogelijk betaalt indien geschatte tarief niet beschikbaar is</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Dit product bevat software dat ontwikkeld is door het OpenSSL Project voor gebruik in de OpenSSL Toolkit %s en cryptografische software geschreven door Eric Young en UPnP software geschreven door Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Totale lengte van netwerkversiestring (%i) overschrijdt maximale lengte (%i). Verminder het aantal of grootte van uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Pogingen om uitgaand verkeer onder een bepaald doel te houden (in MiB per 24u), 0 = geen limiet (standaard: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Niet-ondersteund argument -socks gevonden. Instellen van SOCKS-versie is niet meer mogelijk, alleen SOCKS5-proxies worden ondersteund.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Niet ondersteund argument -whitelistalwaysrelay genegeerd, gebruik -whitelistrelay en/of -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Gebruik een aparte SOCKS5 proxy om verborgen diensten van Tor te bereiken (standaard: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Waarschuwing: Onbekende blok versies worden gemined! Er zijn mogelijk onbekende regels in werking getreden</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Waarschuwing: portemonnee bestand is corrupt, data is veiliggesteld! Originele %s is opgeslagen als %s in %s; als uw balans of transacties incorrect zijn dient u een backup terug te zetten.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Goedgekeurde peers die verbinden vanaf een bepaald IP adres (vb. 1.2.3.4) of CIDR genoteerd netwerk (vb. 1.2.3.0/24). Kan meerdere keren worden gespecificeerd.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s is zeer hoog ingesteld!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(standaard: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Vind anderen door middel van een DNS-naslag (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Fout bij laden van portemonnee %s. -wallet bestandsnaam met een regulier bestand zijn.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Fout bij laden van portemonnee %s. Duplicaat -wallet bestandsnaam opgegeven.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Fout bij laden van portemonnee %s. Ongeldige tekens in -wallet bestandsnaam.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Aantal te checken blokken bij het opstarten (standaard: %u, 0 = allemaal)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>IP-adressen toevoegen in de debuguitvoer (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Keypool op geraakt, roep alsjeblieft eerst keypoolrefill functie aan</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Luister naar JSON-RPC-verbindingen op &lt;poort&gt; (standaard: %u of testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Luister naar verbindingen op &lt;poort&gt; (standaard: %u of testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Onderhoud maximaal &lt;n&gt; verbindingen naar peers (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Laat de portemonnee transacties uitsturen</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximum per-connectie ontvangstbuffer, &lt;n&gt;*1000 bytes (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximum per-connectie verstuurbuffer, &lt;n&gt;*1000 bytes (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Begin debug output met tijdstempel (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Geef gegevensdragertransacties door en mijn ze ook (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Geef non-P2SH multisig door (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Stel sleutelpoelgrootte in op &lt;n&gt; (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Zet het BIP141 maximum gewicht van een blok (standaard: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Stel het aantal threads in om RPC-aanvragen mee te bedienen (standaard: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Specificeer configuratiebestand (standaard: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Specificeer de time-out tijd in milliseconden (minimum: 1, standaard: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Specificeer pid-bestand (standaard: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Besteed onbevestigd wisselgeld bij het doen van transacties (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Netwerkthread starten...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>De portemonnee vermijdt minder te betalen dan de minimale doorgeef vergoeding.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Dit is de minimum transactievergoeding dat je betaalt op elke transactie.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Dit is de transactievergoeding dat je betaalt wanneer je een transactie verstuurt.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Drempel om verbinding te verbreken naar zich misdragende peers (standaard: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Transactiebedragen moeten positief zijn</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Transactie heeft een te lange mempoolketen</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Transactie moet ten minste één ontvanger hebben</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Onbekend netwerk gespecificeerd in -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Ontoereikend saldo</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Blokindex aan het laden...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Portemonnee aan het laden...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Kan portemonnee niet downgraden</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Blokketen aan het herscannen...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Klaar met laden</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_nl_NL.ts",
    "content": "<TS language=\"nl_NL\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Klik met de rechter muisknop om dit adres of label te veranderen</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Maak een nieuw adres aan</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nieuw</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopieer het geselecteerde adres naar het klembord</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopieren</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>S&amp;luiten</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Verwijder het geselecteerde adres uit de lijst</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporteer de data in dit tab naar een bestand</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporteer</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Verwijderen</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Selecteer het adres om munten naar toe te sturen.</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Selecteer het adres om munten mee te ontvangen.</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>S&amp;electeren</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Verzendadres</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Ontvangstadres</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Dit zijn uw Bitcoin adressen voor het versturen van betalingen. Controleer altijd het bedrag en het ontvangstadres voordat u munten verstuurd.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Dit zijn uw Bitcoin adressen voor het ontvangen van betalingen. Het wordt aanbevolen om voor elke transactie een nieuw ontvangstadres te gebruiken.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Adres Kopiëren</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>&amp;Label Kopieren</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Bewerken</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Adreslijst Exporteren</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Komma gescheiden bestand (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exporteren Mislukt</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Er was een fout bij het opslaan van de adreslijst naar %1. Probeer het opnieuw.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen label)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Wachtwoord scherm</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Voer wachtwoord in</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nieuw wachtwoord</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Herhaal nieuw wachtwoord</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Voer je nieuwe wachtwoord in je portemonnee in.&lt;br/&gt;Gebruik een wachtwoord van &lt;b&gt;tien of meer willekeurige karakters&lt;/b&gt;, of &lt;b&gt;acht of meer woorden&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Versleutel portemonnee</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Deze actie heeft je wachtwoord nodig om je portemonnee te ontgrendelen</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Ontgrendel portemonnee</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Deze actie heeft je wachtwoord nodig om je portemonnee te decoderen.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Decodeer portemonnee</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Verander wachtwoord</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Voer het oude en nieuwe wachtwoord in voor de portemonnee.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Bevestig portemonnee versleuteling</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Waarschuwing: Als je je portemonnee versleutelt en je wachtwoord kwijtraakt, raak je &lt;b&gt;AL JE BITCOINS KWIJT&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Weet je zeker dat je je portemonnee wilt versleutelen?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Portemonnee versleuteld</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 zal nu sluiten om het versleutel proces te voltooien. Onthoudt dat het versleutelen van je portemonnee jouw bitcoins niet volledig van diefstal via malware kan beschermen.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>BELANGRIJK: Alle vorige backups die je hebt gemaakt van het portemonnee bestand moeten vervangen worden door het nieuwe gemaakte versleutelde portemonnee bestand. Voor beveiligingsredenen zullen vorige backups van het niet versleutelde portemonnee bestand niet meer werken zodra je gebruik maakt van de nieuwe versleutelde portemonnee.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Portemonnee versleutelen mislukt</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Portemonnee versleutelen mislukt vanwege een interne fout. Je portemonnee is niet versleuteld.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>De opgegeven wachtwoorden zijn niet identiek.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Portemonnee ontgrendelen mislukt</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Het ingevulde wachtwoord voor het ontsleutelen van de portemonnee is niet correct.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Ontgrendelen van de portemonnee mislukt</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Portemonnee wachtwoord met succes veranderd.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Waarschuwing: Caps Lock staat aan!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Geblokkeerd Tot</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signeer &amp;bericht</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchroniseren met het netwerk...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Overzicht</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Toon algemeen overzicht van portemonnee</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transacties</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Door transactiegeschiedenis bladeren</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Exit</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Applicatie sluiten</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Over %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Toon informatie over %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Over &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Toon informatie over Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opties...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Configuratieopties aanpassen voor%1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Portemonnee Versleutelen...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Portemonnee Backuppen</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Wachtwoord Veranderen</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Verzendadressen</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Ontvangadressen</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Open &amp;URL...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Klik om netwerk activiteit uit te zetten.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Netwerk activiteit uitgeschakeld.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Klik om netwerk activiteit aan te zetten.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Headers synchroniseren (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Blokken op schijf herindexeren...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Verstuur coins naar een Bitcoin adres</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Back-up portemonnee naar een andere locatie</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Verander het wachtwoord die gebruikt wordt voor de portemonnee versleuteling</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Debug scherm</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Open debugging en diagnostisch console</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Bericht verifiëren</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Portemonnee</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Versturen</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Ontvangen</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Tonen / Verbergen</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Toon of verberg het hoofd scherm</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Versleutel de privé sleutels die bij je portemonnee horen</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signeer berichten met je Bitcoin adres om te bewijzen dat ze van jou zijn</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifieer berichten om er zeker van te zijn dat ze met specifieke Bitcoin adressen ondertekent zijn</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Bestand</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Instellingen</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Help</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Tabs taakbalk</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Betalingen aanvragen (genereert QR codes en bitcoin: URI's)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Toon de lijst van gebruikte verzend adressen en labels</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Toon de lijst van gebruikte ontvangst adressen en labels</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Open een bitcoin: URI of betaalverzoek</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Commando-regel opties</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Blokken op schijf indexeren</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Blokken op schijf verwerken</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 achter</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Laatst ontvangen blok is gegenereert %1 geleden</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transacties hierna zullen niet zichtbaar zijn.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Waarschuwing</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informatie</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Up to date</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Open het %1 help bericht om een lijst met Bitcoin commando-regel opties te krijgen</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 client</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Verbinding maken met peers...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Inhalen...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Bedrag: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Type: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Label: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adres: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transactie verzonden</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Binnenkomende transactie</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD sleutel generatie &lt;b&gt;geactiveerd&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD sleutel generatie &lt;b&gt;gedeactiveerd&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Portemonnee is &lt;b&gt;versleuteld&lt;/b&gt; en op dit moment &lt;b&gt;ontgrendeld&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Portemonnee is &lt;b&gt;versleuteld&lt;/b&gt; op dit moment &lt;b&gt;vergrendeld&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Een fatale error is voorgekomen. Bitcoin kan niet langer veilig verder gaan en sluit daardoor af.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Coin Selectie</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Hoeveelheid:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Bedrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Fooi:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Dust:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Na Fooi:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Wisselgeld:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(de)selecteer alles</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Tree modus</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Lijst modus</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Ontvangen met label</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Ontvangen met adres</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Bevestigingen</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bevestigd</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopieer adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopieer transactie ID</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Vergrendel niet uitgegeven</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Ontgrendel niet uitgegeven</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopieer hoeveelheid</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopieer fooi</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopieer na fooi</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopieer bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopieer dust</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopieer wisselgeld</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 vergrendeld)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ja</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nee</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen label)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 en %2</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen label)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Hoeveelheid:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Bedrag:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Fooi:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Na Fooi:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Wisselgeld:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Dust:</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopieer hoeveelheid</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopieer fooi</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopieer na fooi</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopieer bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopieer dust</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopieer wisselgeld</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen label)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Bedrag</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(geen label)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopieer adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopieer label</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopieer bedrag</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopieer transactie ID</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Komma gescheiden bestand (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bevestigd</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Label</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exporteren Mislukt</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exporteer</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exporteer de data in dit tab naar een bestand</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Information</source>\n        <translation>Informatie</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Waarschuwing</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fout</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_pam.ts",
    "content": "<TS language=\"pam\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>I-right click ban alilan ing address o libel</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Maglalang kang bayung address</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Bayu</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopyan me ing salukuyan at makipiling address keng system clipboard</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopyan</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>I&amp;sara</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Ilako ya ing kasalungsungan makapiling address keng listahan</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Ilako</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialogo ning Passphrase</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Mamalub kang passphrase</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Panibayung passphrase</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Pasibayuan ya ing bayung passphrase</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>I-sign ing &amp;mensayi</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Mag-sychronize ne king network...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Overview</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Ipakit ing kabuuang lawe ning wallet</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaksion</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Lawan ing kasalesayan ning transaksion</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>L&amp;umwal</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Tuknangan ing aplikasyon</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Tungkul &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Magpakit impormasion tungkul king Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Pipamilian...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>I-&amp;Encrypt in Wallet...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>I-&amp;Backup ing Wallet...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Alilan ing Passphrase...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Address king pamag-Tanggap</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Magpadalang barya king Bitcoin address</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>I-backup ing wallet king aliwang lugal</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Alilan ya ing passphrase a gagamitan para king wallet encryption</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>I-&amp;Debug ing awang</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Ibuklat ing debugging at diagnostic console</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Beripikan ing message...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Wallet</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Ipalto / Isalikut</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Ipalto o isalikut ing pun a awang</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;File</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Pamag-ayus</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Saup</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Gamit para king Tabs</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Pipamilian command-line</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Ing tatauling block a metanggap,  me-generate ya %1 ing milabas</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Ing transaksion kaibat na nini ali yapa magsilbing ipakit.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Mali</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Kapabaluan</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>&amp;Impormasion</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Makatuki ya king aldo</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Catching up...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Mipadalang transaksion</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Paparatang a transaksion</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Maka-&lt;b&gt;encrypt&lt;/b&gt; ya ing wallet at kasalukuyan yang maka-&lt;b&gt;unlocked&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Maka-&lt;b&gt;encrypt&lt;/b&gt; ya ing wallet at kasalukuyan yang maka-&lt;b&gt;locked&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>Alaga:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Alaga</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Kaaldauan</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Me-kumpirma</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Alilan ing Address</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Label</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Address</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>bersion</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Pipamilian command-line</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Pamanggamit:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>pipamilian command-line</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Malaus ka</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Mali</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Tatauling oras na ning block</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Pipamilian</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Pun</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Network</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Ibuklat yang antimanu ing Bitcoin client port king router. Gagana yamu ini istung ing router mu susuporta yang UPnP at magsilbi ya.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapa ng ning port gamit ing &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port na ning proxy(e.g. 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Awang</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Ipakit mu ing tray icon kaibat meng pelatian ing awang.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Latian ya ing tray kesa king taskbar</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>P&amp;alatian istung isara</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Ipalto</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Amanu na ning user interface:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>Ing &amp;Unit a ipakit king alaga ning:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Pilinan ing default subdivision unit a ipalto o ipakit king interface at istung magpadala kang barya.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>I-&amp;Cancel</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>default</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Mali</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Ing milageng proxy address eya katanggap-tanggap.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Ing makaltong impormasion mapalyaring luma ne. Ing kekang wallet otomatiku yang mag-synchronize keng Bitcoin network istung mekakonekta ne king network, oneng ing prosesung ini ali ya pa kumpletu.</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Ing kekang kasalungsungan balanse a malyari mung gastusan</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Ing kabuuan dareng transaksion a kasalungsungan ali pa me-kumpirma, at kasalungsungan ali pa mebilang kareng kekang balanseng malyari mung gastusan</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Immature:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Reng me-minang balanse a epa meg-matured</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Kabuuan:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Ing kekang kasalungsungan kabuuang balanse</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Alaga</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>e miya balu</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Bersion ning Cliente</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Impormasion</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>I-Debug ing awang</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Oras ning umpisa</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Network</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Bilang dareng koneksion</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Block chain</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Kasalungsungan bilang dareng blocks</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Tatauling oras na ning block</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Ibuklat</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Console</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Kabuuan:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Debug log file</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>I-Clear ing console</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Kopyan ing address</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Magpadalang Barya</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Kulang a pondo</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Alaga:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Bayad king Transaksion:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Misanang magpadala kareng alialiuang tumanggap</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Maglage &amp;Tumanggap</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>I-Clear &amp;Eganagana</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balanse:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Kumpirman ing aksion king pamagpadala</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>Ipadala</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>A&amp;laga:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Ibayad &amp;kang:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Idikit ing address menibat king clipboard</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mensayi:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Ibayad kang:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Pirma - Pirman / I-beripika ing mensayi</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Pirman ing Mensayi</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Idikit ing address menibat king clipboard</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Ipalub ing mensayi a buri mung pirman keni</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Pirma</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopyan ing kasalungsungan pirma king system clipboard</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Pirman ing mensayi ban patune na keka ya ining Bitcoin address</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Pirman ing &amp;Mensayi</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Ibalik keng dati reng ngan fields keng pamamirmang mensayi</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>I-Clear &amp;Eganagana</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Beripikan ing Mensayi</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Beripikan ing mensayi ban asiguradu a me pirma ya ini gamit ing mepiling Bitcoin address</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Beripikan ing &amp;Mensayi</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Ibalik king dati reng ngan fields na ning pamag beripikang mensayi</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Ining pane a ini magpakit yang detalyadung description ning transaksion</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Pipamilian:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Pilinan ing data directory</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Kumunekta king note ban ayakua mula reng peer address, at mako king panga konekta</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Sabyan me ing kekang pampublikong address</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Tumanggap command line at JSON-RPC commands</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Gumana king gulut bilang daemon at tumanggap commands</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Kapilubluban ning Bitcoin</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Tumanggap koneksion menibat king kilwal (default: 1 if no -proxy or -connect)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Pipamilian king pamag-gawang block:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Mekapansin lang me-corrupt a block database</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Buri meng buuan pasibayu ing block database ngene?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Kamalian king pamag-initialize king block na ning database</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Kamalian king pamag buklat king block database</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Kamalian: Mababa ne ing espasyu king disk!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Memali ya ing pamakiramdam kareng gang nanung port. Gamita me ini -listen=0 nung buri me ini.</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>&amp;Impormasion</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Magpadalang trace/debug info okeng console kesa keng debug.log file</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Maragul yang masiadu ing transaksion</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Username para king JSON-RPC koneksion</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Kapabaluan</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Password para king JSON-RPC koneksion</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>I-execute ing command istung mialilan ya ing best block (%s in cmd is replaced by block hash)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Payagan ing pamaglawe DNS para king -addnode, -seednode and -connect</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>E kilalang network ing mepili king -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Kulang a pondo</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Lo-load dane ing block index...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Lo-load dane ing wallet...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Ali ya magsilbing i-downgrade ing wallet</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>I-scan deng pasibayu...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Yari ne ing pamag-load</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Mali</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_pl.ts",
    "content": "<TS language=\"pl\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Kliknij prawy przycisk myszy, aby edytować adres lub etykietę</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Utwórz nowy adres</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nowy</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Skopiuj aktualnie wybrany adres do schowka</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopiuj</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Z&amp;amknij</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Usuń zaznaczony adres z listy</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksportuj dane z aktywnej karty do pliku</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksportuj</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Usuń</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Wybierz adres, na który chcesz wysłać monety</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Wybierz adres, na który chcesz otrzymać monety</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>W&amp;ybierz</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Adresy wysyłania</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Adresy odbioru</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Tutaj znajdują się adresy Bitcoin na które wysyłasz płatności. Zawsze sprawdzaj ilość i adres odbiorcy przed wysyłką monet.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>To są twoje adresy Bitcoin do odbierania płatności. Zaleca się używanie nowych adresów odbiorczych dla każdej transakcji.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopiuj adres</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopiuj &amp;Etykietę</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Edytuj</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Eksportuj listę adresów</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Plik *.CSV (dane rozdzielane przecinkami)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksportowanie nie powiodło się</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Wystąpił błąd podczas próby zapisu listy adresów do %1. Proszę spróbować ponownie.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etykieta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(brak etykiety)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Okienko Hasła</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Wpisz hasło</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nowe hasło</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Powtórz nowe hasło</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Pokaż hasło</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Wprowadź nowe hasło do portfela.&lt;br/&gt;Proszę używać hasła złożonego z &lt;b&gt;10 lub więcej losowych znaków&lt;/b&gt; albo &lt;b&gt;8 lub więcej słów.&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Zaszyfruj portfel</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Ta operacja wymaga hasła do portfela aby odblokować portfel.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Odblokuj portfel</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Ta operacja wymaga hasła portfela, aby go odszyfrować.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Odszyfruj portfel</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Zmień hasło</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Podaj stare i nowe hasło do portfela.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Potwierdź szyfrowanie portfela</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Uwaga: jeśli zaszyfrujesz swój portfel i zgubisz hasło &lt;b&gt;STRACISZ WSZYSTKIE SWOJE BITCOINY&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Jesteś pewien, że chcesz zaszyfrować swój portfel?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Portfel zaszyfrowany</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 zamknie się aby dokończyć proces szyfrowania. Pamiętaj, że szyfrowanie portfela nie zabezpiecza w pełni Twoich bitcoinów przed kradzieżą przez wirusy lub trojany mogące zainfekować Twój komputer.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>WAŻNE: Wszystkie wykonane wcześniej kopie pliku portfela powinny być zamienione na nowe, szyfrowane pliki. Z powodów bezpieczeństwa, poprzednie kopie nieszyfrowanych plików portfela staną się bezużyteczne jak tylko zaczniesz korzystać z nowego, szyfrowanego portfela.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Szyfrowanie portfela nie powiodło się</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Szyfrowanie portfela nie powiodło się z powodu wewnętrznego błędu. Twój portfel nie został zaszyfrowany.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Podane hasła nie są takie same.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Odblokowanie portfela nie powiodło się</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Wprowadzone hasło do odszyfrowania portfela jest niepoprawne.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Odszyfrowanie portfela nie powiodło się</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Hasło do portfela zostało pomyślnie zmienione.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Ostrzeżenie: Caps Lock jest włączony!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP / maska podsieci</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Blokada do</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Podpisz wiado&amp;mość...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronizacja z siecią...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>P&amp;odsumowanie</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Węzeł</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Pokazuje ogólny widok portfela</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakcje</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Przeglądaj historię transakcji</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Zakończ</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Zamknij program</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;O %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Pokaż informacje o %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>O &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Pokazuje informacje o Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opcje...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Zmień opcje konfiguracji dla %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Zaszyfruj Portf&amp;el</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Wykonaj kopię zapasową...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Zmień hasło...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Adresy wysyłania...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Adresy odbioru...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Otwórz URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Kliknij aby wyłączyć aktywność sieciową.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Aktywność sieciowa została wyłączona.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Kliknij, aby ponownie włączyć aktywności sieciową.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synchronizowanie headerów (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Ponowne indeksowanie bloków na dysku...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Wyślij monety na adres bitcoinowy</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Zapasowy portfel w innej lokalizacji</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Zmień hasło użyte do szyfrowania portfela</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Okno debugowania</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Otwórz konsolę debugowania i diagnostyki</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Zweryfikuj wiadomość...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Portfel</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>Wyślij</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>Odbie&amp;rz</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Pokaż / Ukryj</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Pokazuje lub ukrywa główne okno</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Szyfruj klucze prywatne, które są w twoim portfelu</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Podpisz wiadomości swoim adresem aby udowodnić jego posiadanie</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Zweryfikuj wiadomość,  aby upewnić się, że została podpisana podanym adresem bitcoinowym.</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Plik</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>P&amp;referencje</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>Pomo&amp;c</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Pasek zakładek</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Żądaj płatności (generuje kod QR oraz bitcoinowe URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Pokaż listę adresów i etykiet użytych do wysyłania</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Pokaż listę adresów i etykiet użytych do odbierania</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Otwórz URI bitcoin: lub żądanie zapłaty</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Opcje linii komend</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktywnych połączeń do sieci Bitcoin</numerusform><numerusform>%n aktywnych połączeń do sieci Bitcoin</numerusform><numerusform>%n aktywnych połączeń do sieci Bitcoin</numerusform><numerusform>%n aktywnych połączeń do sieci Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indeksowanie bloków na dysku...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Przetwarzanie blocks on disk...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Przetworzono %n bloków historii transakcji.</numerusform><numerusform>Przetworzono %n bloków historii transakcji.</numerusform><numerusform>Przetworzono %n bloków historii transakcji.</numerusform><numerusform>Przetworzono %n bloków historii transakcji.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 za</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Ostatni otrzymany blok został wygenerowany %1 temu.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transakcje po tym momencie nie będą jeszcze widoczne.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Błąd</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Ostrzeżenie</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacja</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Aktualny</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Pokaż pomoc %1 aby zobaczyć listę wszystkich opcji lnii poleceń.</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 klient</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Łączenie z peerami...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Trwa synchronizacja…</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Kwota: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Typ: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etykieta: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adres: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transakcja wysłana</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transakcja przychodząca</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Generowanie kluczy HD jest &lt;b&gt;włączone&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Generowanie kluczy HD jest &lt;b&gt;wyłączone&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Portfel jest &lt;b&gt;zaszyfrowany&lt;/b&gt; i obecnie &lt;b&gt;odblokowany&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Portfel jest &lt;b&gt;zaszyfrowany&lt;/b&gt; i obecnie &lt;b&gt;zablokowany&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Wystąpił krytyczny błąd. Bitcoin nie jest w stanie kontynuować bezpiecznie i zostanie zamknięty.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Wybór monet</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Ilość:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtów:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Kwota:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Opłata:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Pył:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Po opłacie:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Reszta:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>Zaznacz/Odznacz wszystko</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Widok drzewa</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Widok listy</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kwota</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Otrzymano z opisem</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Otrzymano z adresem</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Potwierdzenia</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potwierdzony</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiuj adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiuj etykietę</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiuj kwotę</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Skopiuj ID transakcji</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Zablokuj niewydane</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Odblokuj niewydane</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Skopiuj ilość</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Skopiuj prowizję</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Skopiuj ilość po opłacie</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Skopiuj ilość bajtów</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopiuj pył</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Skopiuj resztę</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 zablokowane)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>tak</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nie</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Ta etykieta staje się czerwona jeżeli którykolwiek odbiorca otrzymuje kwotę mniejszą niż obecny próg pyłu.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Waha się +/- %1 satoshi na wejście.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(brak etykiety)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>reszta z %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(reszta)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Zmień adres</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etykieta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Etykieta skojarzona z tym wpisem na liście adresów</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Ten adres jest skojarzony z wpisem na liście adresów. Może być zmodyfikowany jedynie dla adresów wysyłających.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adres</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nowy adres odbiorczy</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nowy adres wysyłania</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Zmień adres odbioru</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Zmień adres wysyłania</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Wprowadzony adres \"%1\" nie jest prawidłowym adresem Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Wprowadzony adres \"%1\" znajduje się już w książce adresowej.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Nie można było odblokować portfela.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Generowanie nowego klucza nie powiodło się.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Będzie utworzony nowy folder danych.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nazwa</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Katalog już istnieje. Dodaj %1 jeśli masz zamiar utworzyć tutaj nowy katalog.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Ścieżka już istnieje i nie jest katalogiem.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Nie można było tutaj utworzyć folderu.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>wersja</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Informacje o %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opcje konsoli</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Użycie:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opcje konsoli</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opcje interfejsu</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Katalog danych używany podczas uruchamiania programu (domyślny: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Wybierz język, na przykład «de_DE» (domyślnie: język systemowy)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Uruchom zminimalizowany</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Ustaw certyfikaty główne SSL dla żądań płatności (domyślnie: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Wyświetl okno powitalne podczas uruchamiania (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Zresetuj wszystkie ustawienia zmienione w GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Witaj</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Witaj w %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Ponieważ jest to pierwsze uruchomienie programu, możesz wybrać gdzie %1 będzie przechowywał swoje dane.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Gdy naciśniesz OK, %1 zacznie się pobieranie i przetwarzanie całego %4 łańcucha bloków (%2GB) zaczynając od najwcześniejszych transakcji w %3 gdy %4 został uruchomiony. </translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Wstępna synchronizacja jest bardzo wymagająca i może ujawnić wcześniej niezauważone problemy sprzętowe. Za każdym uruchomieniem %1 pobieranie będzie kontynuowane od miejsca w którym zostało zatrzymane.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Jeśli wybrałeś opcję ograniczenia przechowywania łańcucha bloków (przycinanie) dane historyczne cały czas będą musiały być pobrane i przetworzone, jednak po tym zostaną usunięte aby ograniczyć użycie dysku.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Użyj domyślnego folderu danych</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Użyj wybranego folderu dla danych</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Co najmniej %1 GB danych, zostanie zapisane w tym katalogu, dane te będą przyrastały w czasie.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Około %1 GB danych zostanie zapisane w tym katalogu.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 pobierze i zapisze lokalnie kopię łańcucha bloków Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Portfel również zostanie zapisany w tym katalogu.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Błąd: podany folder danych «%1» nie mógł zostać utworzony.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Błąd</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB dostępnego wolnego miejsca</numerusform><numerusform>%n GB dostępnego wolnego miejsca</numerusform><numerusform>%n GB dostępnego wolnego miejsca</numerusform><numerusform>%n GB dostępnego wolnego miejsca</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(z %n GB potrzebnych)</numerusform><numerusform>(z %n GB potrzebnych)</numerusform><numerusform>(z %n GB potrzebnych)</numerusform><numerusform>(z %n GB potrzebnych)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formularz</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Świeże transakcje mogą nie być jeszcze widoczne, a zatem saldo portfela może być nieprawidłowe. Te detale będą poprawne, gdy portfel zakończy synchronizację z siecią bitcoin, zgodnie z poniższym opisem.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Próba wydania bitcoinów które nie są jeszcze wyświetlone jako transakcja zostanie odrzucona przez sieć. </translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Pozostało bloków</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Nienznane...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Czas ostatniego bloku</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Postęp</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Przyrost postępu na godzinę</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>obliczanie...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Przewidywany czas zakończenia synchronizacji</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ukryj</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Nieznane. Synchronizowanie nagłówków (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Otwórz URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Otwórz żądanie zapłaty z URI lub pliku</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Otwórz żądanie zapłaty z pliku</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Wybierz plik żądania zapłaty do otwarcia</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opcje</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>Główne</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Automatycznie uruchom %1 po zalogowaniu do systemu.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>Uruchamiaj %1 wraz z zalogowaniem do &amp;systemu</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Wielkość bufora bazy &amp;danych</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Liczba wątków &amp;weryfikacji skryptu</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Adres IP serwera proxy (np. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Pakazuje czy dostarczone domyślne SOCKS5 proxy jest użyte do połączenia z węzłami przez sieć tego typu.</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Ukryj ikonę z zasobnika systemowego.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Ukryj ikonę z zasobnika</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimalizuje zamiast zakończyć działanie programu przy zamykaniu okna. Kiedy ta opcja jest włączona, program zakończy działanie po wybieraniu Zamknij w menu.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Zewnętrzne URL podglądu transakcji (np. eksplorator bloków), które będą wyświetlały się w menu kontekstowym, w zakładce transakcji. %s będzie zamieniany w adresie na hash transakcji. Oddziel wiele adresów pionową kreską |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktywne opcje linii komend, które nadpisują powyższe opcje:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Otwiera %1 plik konfiguracyjny z czynnego katalogu.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Otwórz plik konfiguracyjny</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Przywróć wszystkie domyślne ustawienia klienta.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>Z&amp;resetuj ustawienia</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Sieć</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automatycznie, &lt;0 = zostaw tyle wolnych rdzeni)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Portfel</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Ekspert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Włącz funk&amp;cje kontoli monet</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Jeżeli wyłączysz możliwość wydania niezatwierdzonej wydanej reszty, reszta z transakcji nie będzie mogła zostać wykorzystana, dopóki ta transakcja nie będzie miała przynajmniej jednego potwierdzenia. To także ma wpływ na obliczanie Twojego salda.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>Wydaj niepotwierdzoną re&amp;sztę</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Automatycznie otwiera port klienta Bitcoin na routerze. Ta opcja dzieła tylko jeśli twój router wspiera UPnP i jest ono włączone.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapuj port używając &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Akceptuj połączenia z zewnątrz.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Zezwól na &amp;połączenia przychodzące</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Połącz się z siecią Bitcoin poprzez proxy SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>Połącz przez proxy SO&amp;CKS5 (domyślne proxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP proxy: </translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port proxy (np. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Użyto do połączenia z peerami przy pomocy:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Połącz się z siecią Bitcoin przy pomocy oddzielnego SOCKS5 proxy dla sieci TOR</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Okno</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Pokazuj tylko ikonę przy zegarku po zminimalizowaniu okna.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimalizuj do zasobnika systemowego zamiast do paska zadań</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimalizuj przy zamknięciu</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Wyświetlanie</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Język &amp;użytkownika:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Można tu ustawić język interfejsu uzytkownika. Ustawienie przyniesie skutek po ponownym uruchomieniu %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Jednostka pokazywana przy kwocie:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Wybierz podział jednostki pokazywany w interfejsie  oraz podczas wysyłania monet</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Wybierz pokazywanie lub nie funkcji kontroli monet.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;Zewnętrzny URL podglądu transakcji</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Anuluj</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>domyślny</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>żaden</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Potwierdź reset ustawień</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Wymagany restart programu, aby uaktywnić zmiany.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Program zostanie wyłączony. Czy chcesz kontynuować?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opcje konfiguracji</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Plik konfiguracyjny jest używany celem zdefiniowania zaawansowanych opcji nadpisujących ustawienia aplikacji okienkowej (GUI). Parametry zdefiniowane z poziomu linii poleceń nadpisują parametry określone w tym pliku.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Błąd</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Plik z konfiguracją nie mógł być otworzony.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Ta zmiana może wymagać ponownego uruchomienia klienta.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Adres podanego proxy jest nieprawidłowy</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formularz</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Wyświetlana informacja może być nieaktualna. Twój portfel synchronizuje się automatycznie z siecią bitcoin, zaraz po tym jak uzyskano połączenie, ale proces ten nie został jeszcze ukończony.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Tylko podglądaj:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Dostępne:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Twoje obecne saldo</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>W toku:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Suma transakcji, które nie zostały jeszcze potwierdzone, a które nie zostały wliczone do twojego obecnego salda</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Niedojrzały: </translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Balans wydobytych monet, które jeszcze nie dojrzały</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Salda</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Ogółem:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Twoje obecne saldo</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Twoje obecne saldo na podglądanym adresie </translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Możliwe do wydania:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Ostatnie transakcje</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Niepotwierdzone transakcje na podglądanych adresach</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Wykopane monety na podglądanych adresach które jeszcze nie dojrzały</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Łączna kwota na podglądanych adresach</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Błąd żądania płatności</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Nie można uruchomić protokołu bitcoin: kliknij-by-zapłacić</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Obsługa URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>URL pobrania żądania zapłaty jest nieprawidłowy: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>błędny adres płatności %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>Nie można przeanalizować identyfikatora URI! Może to być spowodowane nieważnym adresem Bitcoin lub nieprawidłowymi parametrami URI.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Przechwytywanie plików żądania płatności</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Plik z żądaniem płatności nie mógł zostać otwarty. Może być to spowodowane nieprawidłowym plikiem.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Żądanie płatności odrzucone</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Sieć żądania zapłaty nie odpowiada sieci klienta.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Żądanie płatności upłynęło.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Żądanie płatności nie jest zainicjowane.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Niezweryfikowane żądania płatności do własnych skryptów płatności są niewspierane.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Nieprawidłowe żądanie płatności</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Żądana kwota %1 jest za niska (uznano za kurz).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Zwrot z %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Żądanie płatności %1 jest zbyt duże (%2 bajtów, dozwolone %3 bajtów).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Błąd komunikacji z %1 : %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Żądanie płatności nie może zostać przetworzone.</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Błędna odpowiedź z serwera %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Błąd żądania sieci</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Płatność potwierdzona</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Aplikacja kliencka</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Węzeł/Usługi</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Identyfikator węzła</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Wysłane</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Otrzymane</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Kwota</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Wprowadź adres bitcoinowy (np. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Żaden</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>NIEDOSTĘPNE</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n sekunda</numerusform><numerusform>%n sekund</numerusform><numerusform>%n sekund</numerusform><numerusform>%n sekund</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minuta</numerusform><numerusform>%n minut</numerusform><numerusform>%n minut</numerusform><numerusform>%n minut</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n godzina</numerusform><numerusform>%n godziny</numerusform><numerusform>%n godzin</numerusform><numerusform>%n godzin</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n dzień</numerusform><numerusform>%n dni</numerusform><numerusform>%n dni</numerusform><numerusform>%n dni</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n tydzień</numerusform><numerusform>%n tygodnie</numerusform><numerusform>%n tygodni</numerusform><numerusform>%n tygodni</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 i %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n rok</numerusform><numerusform>%n lata</numerusform><numerusform>%n lat</numerusform><numerusform>%n lat</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 jeszcze się bezpiecznie nie zamknął...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nieznane</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Błąd: Określony folder danych \"%1\" nie istnieje.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Błąd: Nie można przetworzyć pliku konfiguracyjnego: %1. Używaj tylko składni klucz=wartość.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Błąd: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Zapisz obraz...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Kopiuj obraz</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Zapisz Kod QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Obraz PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>NIEDOSTĘPNE</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Wersja klienta</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informacje</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Okno debugowania</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Ogólne</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Używana wersja BerkeleyDB </translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Katalog danych</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Czas uruchomienia</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Sieć</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nazwa</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Liczba połączeń</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Łańcuch bloków</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Aktualna liczba bloków</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Memory Pool (obszar pamięci)</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Obecna liczba transakcji</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Zużycie pamięci</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Reset</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Otrzymane</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Wysłane</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Węzły</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Blokowane węzły</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Wybierz węzeł żeby zobaczyć szczegóły.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Biała lista</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Kierunek</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Wersja</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Blok startowy</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Zsynchronizowane nagłówki</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Zsynchronizowane bloki</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Aplikacja kliencka</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Otwórz plik dziennika debugowania %1 z obecnego katalogu z danymi. Może to potrwać kilka sekund przy większych plikach.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Zmniejsz rozmiar czcionki</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Zwiększ rozmiar czcionki</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Usługi</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Punkty karne</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Czas połączenia</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Ostatnio wysłano</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Ostatnio odebrano</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Czas odpowiedzi</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Czas trwania nadmiarowego pingu</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Czas odpowiedzi</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Minimalny czas odpowiedzi</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Przesunięcie czasu</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Czas ostatniego bloku</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Otwórz</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>$Ruch sieci</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Kwota ogólna</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Wejście:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Wyjście:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Plik logowania debugowania</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Wyczyść konsolę</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;godzina</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;dzień</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;tydzień</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;rok</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Rozłącz</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Zbanuj na</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Odblokuj</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Witaj w konsoli %1 RPC.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Użyj strzałek do przewijania historii i %1 aby wyczyścić ekran</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Wpisz %1 aby uzyskać listę dostępnych komend.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Aby uzyskać więcej informacji jak używać tej konsoli wpisz %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>UWAGA: Oszuści nakłaniają do wpisywania tutaj różnych poleceń aby ukraść portfel. Nie używaj tej konsoli bez pełnego zrozumienia wpisywanych poleceń.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Aktywność sieciowa wyłączona</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(id węzła: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>przez %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nigdy</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Wejściowy</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Wyjściowy</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Tak</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nie</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Nieznany</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Ilość:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etykieta:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Wiadomość:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Opcjonalna wiadomość do dołączenia do żądania płatności, która będzie wyświetlana, gdy żądanie zostanie otwarte. Uwaga: wiadomość ta nie zostanie wysłana wraz z płatnością w sieci Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Opcjonalna etykieta do skojarzenia z nowym adresem odbiorczym.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Użyj tego formularza do zażądania płatności. Wszystkie pola są &lt;b&gt;opcjonalne&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Opcjonalna kwota by zażądać. Zostaw puste lub zero by nie zażądać konkretnej kwoty.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Wyczyść wszystkie pola formularza.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Wyczyść</translation>\n    </message>\n    <message>\n        <source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</source>\n        <translation>Natywne adresy segwit (aka Bech32 lub BIP-173) zmniejszają później twoje opłaty transakcyjne i dają lepsze zabezpieczenie przed literówkami, ale stare portfele ich nie obsługują. Jeżeli odznaczone, stworzony zostanie adres kompatybilny ze starszymi portfelami.</translation>\n    </message>\n    <message>\n        <source>Generate native segwit (Bech32) address</source>\n        <translation>Wygeneruj natywny adres segwit (Bech32)</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Żądanie historii płatności</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Żądaj płatności</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Pokaż wybrane żądanie (robi to samo co dwukrotne kliknięcie pozycji)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Pokaż</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Usuń zaznaczone z listy</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Usuń</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Kopiuj URI:</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiuj etykietę</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopiuj wiadomość</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiuj kwotę</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Kod QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopiuj &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopiuj &amp;adres</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Zapisz obraz...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Zażądaj płatności do %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informacje o płatności</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kwota</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etykieta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Wiadomość</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Wynikowy URI jest zbyt długi, spróbuj zmniejszyć tekst etykiety / wiadomości</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Błąd kodowania URI w kod QR</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etykieta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Wiadomość</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(brak etykiety)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(brak wiadomości)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(brak kwoty)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Zażądano</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Wyślij monety</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Funkcje kontroli monet</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Wejścia...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>zaznaczone automatycznie</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Niewystarczające środki!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Ilość:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtów:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Kwota:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Opłata:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Po opłacie:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Reszta:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Kiedy ta opcja jest wybrana, to jeżeli adres reszty jest pusty lub nieprawidłowy, to reszta będzie wysyłana na nowo wygenerowany adres, </translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Niestandardowe zmiany adresu</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Opłata transakcyjna:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Wybierz...</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Uwaga: Oszacowanie opłaty za transakcje jest aktualnie niemożliwe.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>zwiń opcje opłaty</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>za kilobajt</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Jeżeli własna opłata zostanie ustawiona na 1000 satoshi, a transakcja będzie miała tylko 250 bajtów, to \"za kilobajt\" płaci tylko 250 satoshi, podczas gdy, \"razem przynajmniej\" płaci 1000 satoshi. Przy transakcjach większych niż kilobajt, w obu przypadkach płaci za każdy kilobajt.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ukryj</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Zapłacenie tylko minimalnej opłaty jest nadal wystarczające, dopóki jest mniejszy wolumen transakcji niż miejsca w blokach. Należy jednak mieć świadomość, że może skończyć się to niezatwierdzeniem nigdy transakcji, gdy jest większe zapotrzebowanie na transakcje bitcoina niż sieć może przetworzyć.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(przeczytaj podpowiedź)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Zalecane:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Własna:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Sprytne opłaty nie są jeszcze zainicjowane. Trwa to zwykle kilka bloków...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Wyślij do wielu odbiorców na raz</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Dodaj Odbio&amp;rcę</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Wyczyść wszystkie pola formularza.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Pył:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Docelowy czas potwierdzenia:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Włącz RBF (podmiana transakcji przez podniesienie opłaty)</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Wyczyść &amp;wszystko</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Potwierdź akcję wysyłania</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>Wy&amp;syłka</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Skopiuj ilość</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiuj kwotę</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Skopiuj prowizję</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Skopiuj ilość po opłacie</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Skopiuj ilość bajtów</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopiuj pył</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Skopiuj resztę</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 bloków)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 do %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Czy na pewno chcesz wysłać?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>dodano jako opłata transakcyjna</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Łączna kwota %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>lub</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Potwierdź wysyłanie monet</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Adres odbiorcy jest nieprawidłowy, proszę sprawić ponownie.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Kwota do zapłacenia musi być większa od 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Kwota przekracza twoje saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Suma przekracza twoje saldo, gdy doliczymy %1 prowizji transakcyjnej.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Duplikat adres-u znaleziony: adresy powinny zostać użyte tylko raz.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Utworzenie transakcji nie powiodło się!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Transakcja została odrzucona z następującym powodem: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Opłata wyższa niż %1 jest uznawana za absurdalnie dużą.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Żądanie płatności upłynęło.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Zapłać tylko wymaganą opłatę w wysokości %1</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Ostrzeżenie: nieprawidłowy adres Bitcoin</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Ostrzeżenie: Nieznany adres reszty</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Potwierdź zmianę adresu własnego</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(brak etykiety)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Su&amp;ma:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Zapłać &amp;dla:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etykieta:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Wybierz wcześniej użyty adres</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>To jest standardowa płatność</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Adres Bitcoin gdzie wysłać płatność</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Wklej adres ze schowka</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Usuń ten wpis</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Opłata zostanie odjęta od kwoty wysyłane.Odbiorca otrzyma mniej niż bitcoins wpisz w polu kwoty. Jeśli wybrano kilku odbiorców, opłata jest podzielona równo.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>Odejmij od wysokości opłaty</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Wiadomość:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>To żądanie zapłaty nie zostało zweryfikowane.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>To żądanie zapłaty jest zweryfikowane.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Wprowadź etykietę dla tego adresu by dodać go do listy użytych adresów</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Wiadomość, która została dołączona do URI bitcoin:, która będzie przechowywana wraz z transakcją w celach informacyjnych. Uwaga: Ta wiadomość nie będzie rozsyłana w sieci Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Wpłać do:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Notatka:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Wprowadź etykietę dla tego adresu by dodać go do książki adresowej</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Tak</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 się zamyka...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Nie wyłączaj komputera dopóki to okno nie zniknie.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Podpisy - Podpisz / zweryfikuj wiadomość</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>Podpi&amp;sz Wiadomość</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Możesz podpisywać wiadomości swoimi adresami aby udowodnić, że jesteś ich właścicielem. Uważaj, aby nie podpisywać niczego co wzbudza Twoje podejrzenia, ponieważ ktoś może stosować phishing próbując nakłonić Cię do ich podpisania. Akceptuj i podpisuj tylko w pełni zrozumiałe komunikaty i wiadomości.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Adres Bitcoin, za pomocą którego podpisać wiadomość</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Wybierz wcześniej użyty adres</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Wklej adres ze schowka</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Tutaj wprowadź wiadomość, którą chcesz podpisać</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Podpis</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopiuje aktualny podpis do schowka systemowego</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Podpisz wiadomość aby dowieść, że ten adres jest twój</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Podpisz Wiado&amp;mość</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Zresetuj wszystkie pola podpisanej wiadomości</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Wyczyść &amp;wszystko</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Zweryfikuj wiadomość</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Wpisz adres, wiadomość oraz sygnaturę (podpis) odbiorcy (upewnij się, że dokładnie skopiujesz wszystkie zakończenia linii, spacje, tabulacje itp.).  Uważaj by nie dodać więcej do podpisu niż do samej podpisywanej wiadomości by uniknąć ataku man-in-the-middle. \nZwróć uwagę, że poprawnie zweryfikowana wiadomość potwierdza to, że nadawca posiada klucz do adresu, natomiast nie potwierdza to, że poprawne wysłanie jakiejkolwiek transakcji! </translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Adres Bitcoin, którym została podpisana wiadomość</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Zweryfikuj wiadomość,  aby upewnić się, że została podpisana odpowiednim adresem Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Zweryfikuj Wiado&amp;mość</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Resetuje wszystkie pola weryfikacji wiadomości</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Kliknij \"Podpisz Wiadomość\" żeby uzyskać podpis</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Podany adres jest nieprawidłowy.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Proszę sprawdzić adres i spróbować ponownie.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Wprowadzony adres nie odnosi się do klucza.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Odblokowanie portfela zostało anulowane.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Klucz prywatny dla podanego adresu nie jest dostępny.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Podpisanie wiadomości nie powiodło się.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Wiadomość podpisana.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Podpis nie może zostać zdekodowany.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Sprawdź podpis i spróbuj ponownie.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Podpis nie odpowiada skrótowi wiadomości.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Weryfikacja wiadomości nie powiodła się.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Wiadomość zweryfikowana.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Otwórz dla %n kolejnego bloku</numerusform><numerusform>Otwórz dla %n kolejnych bloków</numerusform><numerusform>Otwórz dla %n kolejnych bloków</numerusform><numerusform>Otwórz dla %n kolejnych bloków</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Otwórz do %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>sprzeczny z transakcją posiadającą %1 potwierdzeń</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/niezatwierdzone, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>w obszarze pamięci</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>nie w obszarze pamięci</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>porzucone</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/niezatwierdzone</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 potwierdzeń</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, nie został jeszcze pomyślnie rozesłany</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, przekazywany przez %n węzeł</numerusform><numerusform>, przekazywany przez %n węzły</numerusform><numerusform>, przekazywany przez %n węzłów</numerusform><numerusform>, przekazywany przez %n węzłów</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Źródło</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Wygenerowano</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Od</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nieznane</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Do</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>własny adres</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>tylko-obserwowany</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etykieta</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Uznanie</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>niezaakceptowane</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debet</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Opłata transakcyjna</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Kwota netto</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Wiadomość</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Komentarz</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID transakcji</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Rozmiar transakcji</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Indeks wyjściowy</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Kupiec</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Informacje debugowania</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transakcja</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Wejścia</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kwota</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>prawda</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>fałsz</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Ten panel pokazuje szczegółowy opis transakcji</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Szczegóły %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etykieta</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Otwórz dla %n kolejny blok</numerusform><numerusform>Otwórz dla %n kolejne bloki</numerusform><numerusform>Otwórz dla %n kolejnych bloków</numerusform><numerusform>Otwórz dla %n kolejnych bloków</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Otwórz do %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Niepotwierdzone</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Porzucone</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Potwierdzanie (%1 z %2 rekomendowanych potwierdzeń)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Potwierdzono (%1 potwierdzeń)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Skonfliktowane</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Niedojrzała (%1 potwierdzeń, będzie dostępna po %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Ten blok nie został odebrany przez jakikolwiek inny węzeł i prawdopodobnie nie zostanie zaakceptowany!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Wygenerowane ale nie zaakceptowane</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Otrzymane przez</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Odebrano od</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Wysłane do</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Płatność do siebie</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Wydobyto</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>tylko-obserwowany</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(brak)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(brak etykiety)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Status transakcji. Najedź na pole, aby zobaczyć liczbę potwierdzeń.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Data i czas odebrania transakcji.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Rodzaj transakcji.</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Wszystko</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Dzisiaj</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>W tym tygodniu</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>W tym miesiącu</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>W zeszłym miesiącu</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>W tym roku</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Zakres...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Otrzymane przez</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Wysłane do</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Do siebie</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Wydobyto</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Inne</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minimalna kwota</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Porzuć transakcję</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Zwiększ prowizję</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiuj adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiuj etykietę</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiuj kwotę</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Skopiuj ID transakcji</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Skopiuj surowe dane transakcji</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Skopiuj pełne informacje o transakcji</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Zmień etykietę</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Pokaż szczegóły transakcji</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Eksport historii transakcji</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Plik *.CSV (dane rozdzielane przecinkami)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potwierdzony</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etykieta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksportowanie nie powiodło się</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Wystąpił błąd przy próbie zapisu historii transakcji do %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Eksport powiódł się</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Historia transakcji została zapisana do %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Zakres:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>do</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Jednostka w jakiej pokazywane są kwoty. Kliknij aby wybrać inną.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Nie załadowano żadnego portfela.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Wyślij płatność</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Błąd zwiększenia prowizji</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Nieudane zwiększenie prowizji</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Czy chcesz zwiększyć prowizję?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Aktualna opłata:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Zwiększ:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nowa opłata:</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Nie można podpisać transakcji.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Nie można zatwierdzić transakcji</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksportuj</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksportuj dane z aktywnej karty do pliku</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Kopia zapasowa portfela</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Dane Portfela (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Nie udało się wykonać kopii zapasowej</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Wystąpił błąd przy próbie zapisu pliku portfela do %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Wykonano kopię zapasową</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Dane portfela zostały poprawnie zapisane w %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opcje:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Wskaż folder danych</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Podłącz się do węzła aby otrzymać adresy peerów i rozłącz</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Podaj swój publiczny adres</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Akceptuj linię poleceń oraz polecenia JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Rozprowadzane na licencji MIT, zobacz dołączony plik %s lub %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Jeżeli &lt;category&gt; nie zostanie określona lub &lt;category&gt; = 1, wyświetl wszystkie informacje debugowania.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Przycinanie skonfigurowano poniżej minimalnych %d MiB. Proszę użyć wyższej liczby.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Prune: ostatnia synchronizacja portfela jest za danymi. Muszisz -reindexować (pobrać cały ciąg bloków ponownie w przypadku przyciętego węzła)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Ponowne skanowanie nie jest możliwe w trybie przycinania. Będzie trzeba użyć -reindex, co pobierze ponownie cały łańcuch bloków.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Błąd: Wystąpił fatalny błąd wewnętrzny, sprawdź szczegóły w debug.log</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Prowizja (w %s/kB) dodawana do wysyłanych transakcji (domyślnie: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Przycinanie zapisu bloków...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Uruchom w tle jako daemon i przyjmuj polecenia</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Uruchomienie serwera HTTP nie powiodło się. Zobacz dziennik debugowania, aby uzyskać więcej szczegółów.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Deweloperzy %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Stawka prowizji (w %s/kB), która będzie użyta, gdy oszacowane dane o prowizjach nie będą wystarczające (domyślnie: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Skojarz z podanym adresem i nasłuchuj na nim. Użyj formatu [host]:port dla IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Nie można uzyskać blokady na katalogu z danymi %s. %s najprawdopodobniej jest już uruchomiony.</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Usuwa wszystkie transakcje w portfelu i tylko odtwarza te części z łańcucha bloków poprzez -rescan przy starcie</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Błąd odczytu %s! Wszystkie klucze zostały odczytane poprawnie, ale może brakować  danych transakcji lub wpisów w książce adresowej, lub mogą one być nieprawidłowe.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Wykonaj polecenie, kiedy transakcja portfela ulegnie zmianie (%s w poleceniu zostanie zastąpione przez TxID)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Proszę sprawdzić czy data i czas na Twoim komputerze są poprawne! Jeżeli ustawienia zegara będą złe, %s nie będzie działał prawidłowo.</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Ustaw liczbę wątków skryptu weryfikacyjnego (%u do %d, 0 = auto, &lt;0 = zostaw tyle rdzeni wolnych, domyślnie: %d)</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Użyj UPnP do mapowania portu nasłuchu (domyślnie: 1 gdy nasłuchuje i brak -proxy)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Ostrzeżenie: Sieć nie wydaje się w pełni zgodna! Niektórzy górnicy wydają się doświadczać problemów.</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s uszkodzony, odtworzenie się nie powiodło</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool musi być przynajmniej %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; mogą być:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Akceptuj połączenia z zewnątrz (domyślnie: 1 jeśli nie ustawiono -proxy lub -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Dodaj komentarz do pola user agent</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Próbuj odzyskać klucze prywatne z uszkodzonego portfela podczas uruchamiania.</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opcje tworzenia bloku:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Nie można rozpoznać -%s adresu: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Opcje zmiany łańcucha.</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Index zmian poza zasięgiem.</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opcje połączenia:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Prawa autorskie (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Wykryto uszkodzoną bazę bloków</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opcje debugowania/testowania:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Nie ładuj portfela i wyłącz wywołania RPC portfela</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Czy chcesz teraz przebudować bazę bloków?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Włącz wyświetlanie hasha bloku w &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Umożliw publikacje tranzakcji haszowej w &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Włącz wyświetlanie hasha bloku w &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Umożliw publikację transakcji haszowej w &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Błąd inicjowania bazy danych bloków</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Błąd inicjowania środowiska bazy portfela %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Błąd ładowania %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Błąd ładowania %s: Uszkodzony portfel</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Błąd ładowania %s: Portfel wymaga nowszej wersji %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Błąd ładowania bazy bloków</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Błąd otwierania bazy bloków</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Błąd: Mało miejsca na dysku!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Próba nasłuchiwania na jakimkolwiek porcie nie powiodła się. Użyj -listen=0 jeśli tego chcesz.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importowanie…</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Nieprawidłowy lub brak bloku genezy. Błędny folder_danych dla sieci?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Wstępna kontrola poprawności nie powiodła się. %s wyłącza się.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Nieprawidłowa kwota dla -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Nieprawidłowa kwota dla -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Nieprawidłowa kwota dla -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Utrzymuj obszar pamięci dla transakcji poniżej &lt;n&gt; MB (default: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Wczytywanie adresów P2P...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Ładowanie listy zablokowanych...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Lokalizacja autoryzacyjnego pliku cookie (domyślnie: ścieżka danych)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Brak wystarczającej liczby deskryptorów plików. </translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Łącz z węzłami tylko w sieci &lt;net&gt; (ipv4, piv6 lub onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Wyświetl ten tekst pomocy i wyjdź</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Wyświetl wersję i wyjdź</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Przycinanie nie może być skonfigurowane z negatywną wartością.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Tryb ograniczony jest niekompatybilny z -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Odbuduj stan lańcucha i indeks bloków z obecnych na dysku plików blk*.dat</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Odbuduj stan łańcucha z aktualnie zindeksowanych bloków</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Weryfikacja bloków...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Przewijanie bloków...</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Ustaw wielkość pamięci podręcznej w megabajtach (%d do %d, domyślnie: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Określ plik portfela (w obrębie folderu danych)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Kod źródłowy dostępny jest z %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Opłaty za transakcję i przeliczenie zmian nie powiodło się.</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Nie można przywiązać do %s na tym komputerze. %s prawdopodobnie jest już uruchomiony.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Niewspierany argument -benchmark zignorowany, użyj -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Niewspierany argument -debugnet zignorowany, użyj -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Znaleziono nieprawidłowy argument -tor, użyj -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Nieobsługiwana kategoria rejestrowania %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Aktualizowanie bazy danych UTXO</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Użyj UPnP do przekazania portu nasłuchu (domyślnie : %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Użyj łańcucha testowego</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Komentarz User Agent (%s) zawiera niebezpieczne znaki.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Weryfikacja bloków...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Opcje debugowania/testowania portfela:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Portfel wymaga przepisania: zrestartuj %s aby ukończyć</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opcje portfela:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Pozwól na połączenia JSON-RPC z podanego źródła. Jako &lt;ip&gt; prawidłowe jest pojedyncze IP (np. 1.2.3.4), podsieć/maska (np. 1.2.3.4/255.255.255.0) lub sieć/CIDR (np. 1.2.3.4/24). Opcja ta może być użyta wiele razy.</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Podepnij się do podanego adresu i dodawaj do białej listy węzły łączące się z nim. Użyj notacji [host]:port dla IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Twórz nowe pliki z domyślnymi dla systemu uprawnieniami, zamiast umask 077 (skuteczne tylko przy wyłączonej funkcjonalności portfela)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Odkryj własny adres IP (domyślnie: 1 kiedy w trybie nasłuchu i brak -externalip lub -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Błąd: Nasłuchiwanie połączeń przychodzących nie powiodło się (nasłuch zwrócił błąd %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Uruchom polecenie przy otrzymaniu odpowiedniego powiadomienia lub gdy zobaczymy naprawdę długie rozgałęzienie (%s w poleceniu jest podstawiane za komunikat)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Opłaty (w %s/Kb) mniejsze niż ta, będą traktowane jako zerowe przy tworzeniu, przesyłaniu i zatwierdzaniu transakcji (domyślnie: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Jeżeli nie ustawiono paytxfee, dołącz wystarczająca opłatę, aby transakcja mogła zostać zatwierdzona w ciągu średniej ilości n bloków (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Niewłaściwa ilość dla -maxtxfee=&lt;ilość&gt;: '%s' (musi wynosić przynajmniej minimalną wielkość %s aby zapobiec utknięciu transakcji)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maksymalny rozmiar danych w transakcji przekazującej dane które przekazujemy i wydobywamy (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Zbyt niska kwota transakcji do wysłania po odjęciu opłaty</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Węzły z białej listy nie mogą zostać zbanowane za ataki DoS, a ich transakcje będą zawsze przekazywane, nawet jeżeli będą znajdywać się już w pamięci, przydatne np. dla bramek płatniczych</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Akceptuj publiczne żądania REST (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Stwórz automatycznie ukrytą usługę Tora (domyślnie: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Połącz przez SOCKS5 proxy</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Błąd odczytu z bazy danych, wyłączam się.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Błąd ładowania bazy bloków</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importuj bloki z zewnętrznego pliku blk000??.dat podczas uruchamiania programu</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacja</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Nieprawidłowy adres -proxy lub nazwa hosta: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Nieprawidłowa kwota dla -paytxfee=&lt;amount&gt;: '%s' (musi być co najmniej %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Nieprawidłowa maska sieci określona w -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Przechowuj w pamięci maksymalnie &lt;n&gt; transakcji nie możliwych do połączenia (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Musisz określić port z -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Opcje przekaźnikowe węzła:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opcje serwera RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Zmniejszanie -maxconnections z %d do %d z powodu ograniczeń systemu.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Przeskanuj podczas ładowania programu łańcuch bloków w poszukiwaniu zaginionych transakcji portfela</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Wyślij informację/raport do konsoli zamiast do pliku debug.log.</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Pokaż wszystkie opcje odpluskwiania (użycie: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Zmniejsz plik debug.log przy starcie programu (domyślnie: 1 jeśli nie użyto -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Podpisywanie transakcji nie powiodło się</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Zbyt niska kwota transakcji by zapłacić opłatę</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>To oprogramowanie eksperymentalne.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Hasło zabezpieczające portu kontrolnego Tora (domyślnie: puste)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Port kontrolny sieci Tor jeśli onion listening jest włączone (domyślnie: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Zbyt niska kwota transakcji </translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transakcja jest zbyt duża dla tej opłaty</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transakcja zbyt duża</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Nie można przywiązać do %s na tym komputerze (bind zwrócił błąd %s)</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Zaktualizuj portfel do najnowszego formatu podczas ładowania programu</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nazwa użytkownika dla połączeń JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Weryfikacja portfela...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Ostrzeżenie</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Usuwam wszystkie transakcje z portfela...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Opcje powiadomień ZeroMQ:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Hasło do połączeń JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Wykonaj polecenie kiedy najlepszy blok ulegnie zmianie (%s w komendzie zastanie zastąpione przez hash bloku)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Zezwól -addnode, -seednode i -connect na łączenie się z serwerem DNS</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = zachowaj wysłane metadane np. właściciel konta i informacje o żądaniach płatności, 2 = porzuć wysłane metadane)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee ma ustawioną badzo dużą wartość! Tak wysokie opłaty mogą być zapłacone w jednej transakcji.</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Nie trzymaj w pamięci transakcji starszych niż &lt;n&gt; godz. (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Opłaty (w %s/Kb) mniejsze niż ta będą traktowane jako bez opłaty przy tworzeniu transakcji (domyślnie: %s)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Jak dokładna jest weryfikacja bloków przy -checkblocks (0-4, domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Utrzymuj pełny indeks transakcji, używany przy wywołaniu RPC getrawtransaction (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Czas w sekundach, przez jaki nietrzymające się zasad węzły nie będą mogły ponownie się podłączyć (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Wypuść informacje debugowania (domyślnie: %u, podanie &lt;category&gt; jest opcjonalne)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Wspieraj filtrowanie bloków i transakcji używając Filtrów Blooma (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Produkt zawiera oprogramowanie stworzone przez OpenSSL Project do użycia w OpensSSL Toolkit %s, oprogramowanie kryptograficzne napisane przez Eric Young oraz oprogramowanie UPnP napisane przez Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Całkowita długość łańcucha wersji (%i) przekracza maksymalną dopuszczalną długość (%i). Zmniejsz ilość lub rozmiar parametru uacomment.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Próbuje utrzymać ruch wychodzący poniżej zadanego (w MiB na 24h), 0 = bez limitu (domyślnie: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Znaleziono niewspierany argument -socks. Wybieranie wersji SOCKS nie jest już możliwe, wsparcie programu obejmuje tylko proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Niewspierany argument -whitelistalwaysrelay zignorowany, użyj -whitelistrelay i/lub -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Użyj oddzielnego prozy SOCKS5 aby osiągnąć węzły w ukrytych usługach Tor (domyślnie: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Ostrzeżenie: Odtworzono dane z uszkodzonego pliku portfela! Oryginalny %s został zapisany jako %s w %s; jeśli twoje saldo lub transakcje są niepoprawne powinieneś odtworzyć kopię zapasową.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s jest ustawione bardzo wysoko!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(domyślnie: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Zawsze wypytuj o adresy węzłów poprzez podejrzenie DNS (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Błąd wczytywania portfela %s. Nieprawidłowe znaki w pliku -wallet</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Ile bloków sprawdzić przy starcie (domyślnie: %u, 0 = wszystkie)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Dołącz adresy IP do logowania (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Nasłuchuj połączeń JSON-RPC na &lt;port&gt; (domyślnie: %u lub testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Nasłuchuj połączeń na &lt;port&gt; (domyślnie: %u lub testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Utrzymuj maksymalnie &lt;n&gt; połączeń z węzłami (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Spraw by portfel dokonał transmisji transakcji</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maksymalny bufor odbioru na połączenie, &lt;n&gt;*1000 bajtów (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maksymalny bufor wysyłania na połączenie, &lt;n&gt;*1000 bajtów (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Dołączaj znacznik czasu do logowania (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Przekazuj i wydobywaj transakcje zawierające dane (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Przekazuj transakcje multisig inne niż P2SH (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Ustaw rozmiar puli kluczy na &lt;n&gt; (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>ustawienie maksymalnego rozmiaru bloku BIP141 (domyślnie: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Ustaw liczbę wątków do obsługi RPC (domyślnie: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Wskaż plik konfiguracyjny (domyślnie: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Wskaż czas oczekiwania na połączenie w milisekundach (minimum: 1, domyślnie: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Wskaż plik pid (domyślnie: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Wydawaj niepotwierdzoną resztę podczas wysyłania transakcji (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Uruchamianie wątków sieciowych...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Portfel będzie unikał płacenia mniejszej niż przekazana opłaty.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Minimalna opłata transakcyjna którą płacisz przy każdej transakcji.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>To jest opłata transakcyjna którą zapłacisz jeśli wyślesz transakcję. </translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Próg, po którym nastąpi rozłączenie węzłów nietrzymających się zasad (domyślnie: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Kwota transakcji musi być dodatnia</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Transakcja posiada zbyt długi łańcuch pamięci</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Transakcja wymaga co najmniej jednego odbiorcy</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Nieznana sieć w -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Niewystarczające środki</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Ładowanie indeksu bloku...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Wczytywanie portfela...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Nie można dezaktualizować portfela</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Ponowne skanowanie...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Wczytywanie zakończone</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Błąd</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_pl_PL.ts",
    "content": "<TS language=\"pl_PL\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Kliknij prawy przycisk myszy, aby edytować adres lub etykietę</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Utwórz nowy adres</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nowy</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Skopiuj aktualnie wybrany adres do schowka</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopiuj</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Z&amp;amknij</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Usuń zaznaczony adres z listy</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksportuj dane z aktywnej karty do pliku</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksportuj</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Usuń</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Wybierz adres do wysłania monet</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Wybierz adres, na który chcesz otrzymać monety</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Wybierz</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Adresy do wysyłania</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Adresy do odbierania</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>To są Twoje adresy Bitcoin do wysyłania płatności. Zawsze sprawdzaj kwotę oraz adres odbioru zanim prześlesz monety.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>To są Twoje adresy Bitcoin do otrzymywania płatności. Zalecane jest używać nowego adresu do każdej transakcji. </translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopiuj Adres</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopiuj &amp;Etykietę</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Edytuj</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Eksportuj listę adresów</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Plik oddzielony przecinkiem (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksport nie powiódł się</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Wystąpił błąd podczas zapisywania listy adresów do %1. Proszę spróbować ponownie.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etykieta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez etykiety)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Okno dialogowe hasła</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Wprowadź passphrase</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nowe hasło</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Wprowadź ponownie hasło</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Wpisz nowe hasło do portfela. Proszę użyć hasła składającego się z 10 lub więcej różnych znaków albo ośmiu lub więcej słów. </translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Zaszyfruj portfel</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Ta operacja wymaga Twojego hasła do portfela by odblokować portfel.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Odblokować portfel</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Ta operacja wymaga Twojego hasła do portfela by odszyfrować portfel.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Odszyfruj portfel</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Zmień hasło</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Wpisz stare a następnie nowe hasło do portfela.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Potwierdź zaszyfrowanie portfela.</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Uwaga: Jeśli zaszyfrujesz portfel i utracisz do niego hasło, stracisz wszystkie swoje Bitcoiny. </translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Czy na pewno chcesz zaszyfrować portfel?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Portfel zaszyfrowany</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 zamknie się teraz aby zakończyć proces szyfrowania. Pamiętaj że zaszyfrowanie portfela nie może w pełni zabezpieczyć Twoich bitcoinów od próby kradzieży lub poprzez zainfekowanie Twojego komputera.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>WAŻNE: Wszystkie wcześniejsze kopie zapasowe jakie stworzyłeś powinny być zastąpione świeżo wygenerowanymi, zaszyfrowanymi plikami portfela. Dla bezpieczeństwa, wcześniejsze kopie niezaszyfrowanego portfela będą nieużyteczne jak tylko zaczniesz używać nowego zaszyfrowanego portfela. </translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Szyfrowanie portfela się nie powiodło</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Szyfrowanie portfela się nie powiodło z powodu wewnętrznego błędu. Twój portfel nie został zaszyfrowany.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Wpisane hasło nie pasuje. </translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Odblokowanie portfela nie powiodło się.</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Hasło wprowadzone by odkodować portfel jest niepoprawne.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Odszyfrowanie portfela nie powiodło się.</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Hasło do portfela zostało prawidłowo zmienione.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Uwaga, masz włączonego CAPSlocka!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Maska sieci</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Zablokowany do</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Stopka</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronizuję się z siecią</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Przegląd</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Węzeł</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Pokaż podsumowanie portfela</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakcje</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Przeglądaj historię transakcji</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>W&amp;yjście</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Opuść aplikację</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;O aplikacji %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Pokaż szczegóły o %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>O aplikacji &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Pokaż informacje na temat Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opcje...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Zmodyfikuj opcje konfiguracji dla %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Zaszyfruj Portfel...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Utwórz kopię zapasową portfela...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Zmień Hasło...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Wysyłanie adresów...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Otrzymywanie adresów...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Otwórz &amp;URl...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Kliknij żeby zablokować aktywność sieciową.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Aktywność sieciowa zablokowana.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Kliknij żeby aktywować aktywność sieciową ponownie.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synchronizowanie nagłówków (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindeksowanie bloków na dysku...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Wyślij monety na adres Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Utwórz kopię zapasową portfela w innej lokalizacji</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Zmień hasło wykorzystywane do szyfrowania portfela</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Okno debugowania</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Otwórz konsole diagnostyki i debugowania</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Zweryfikuj wiadomość...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Portfel</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Wyślij</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Odbierz</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Pokaż / Ukryj</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Ukryj lub pokaż główne okno</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Zaszyfruj prywatne klucze które należą do Twojego portfela</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Podpisz wiadomość z Twoimi adresami Bitcoin żeby udowodnić że je posiadasz</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Zweryfikuj wiadomość żeby się upewnić że zostały podpisane ze specyficznym adresem Bitcoin</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Plik</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Ustawienia</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Pomoc</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Pasek zakładek</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Zażądaj płatności (generuje kod QR oraz bitcoin: URls)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Pokaż liste użytych adresów do wysyłania oraz ich etykiety</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Pokaż liste użytych adresów do odbioru oraz ich etykiety</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Otwórz bitcoin: URl lub żądanie płatności</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Wiersz-poleceń opcje</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indeksowanie bloków na dysku...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Przetwarzanie bloków na dysku...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 za</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Ostatni otrzymany blok został wygenerowany %1 temu.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Błąd</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Ostrzeżenie</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacja</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 klient</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Ilość: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Typ: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adres: %1\n</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transakcja przychodząca.</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Ilość:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtów:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Ilość:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Opłata:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Po odliczeniu opłaty:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Zmiana:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Ilość</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiuj adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiuj etykietę</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiuj ilość</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopiuj ilość</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopiuj koszt</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopiuj po opłacie</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopiuj bajty</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopiuj pył</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopiuj zmianę</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>tak</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nie</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez etykiety)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etykieta</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>command-line options</source>\n        <translation>Opcje wierszu poleceń</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>UI Opcje:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Wybierz katalog danych podczas uruchomienia (domyślna: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Wybierz język, na przykład \"de_DE\" (domyślny: system lokalny)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Uruchom zminimalizowany</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Pokaż ekran powitalny podczas startu (domyślny: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Przywróć wszystkie ustawienia zmienione w GUI.</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Witaj!</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Witaj w %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Ponieważ to Twoje pierwsze użycie programu, możesz wybrać gdzie %1 będzie przechowywać swoje dane.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Kiedy klikniesz OK, %1 zacznie proces ściągania i przetwarzania pełnego łańcuchu bloków (%2GB) zaczynając od najwcześniejszych transakcji w %3 kiedy %4 wstępnie się uruchomi.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Wstępna synchronizacja jest dość wymagająca i może odsłonić pewne problemy z komputerem które wcześniej nie zostały zauważone. Za każdym razem jak uruchomisz %1, będzie kontynuować ściąganie tam gdzie się wcześniej skończyło.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Jeśli wybrałeś opcje ograniczenia rozmiaru łańcucha bloków (przycinanie), to historyczne dane muszą najpierw zostać ściągnięte i przetworzone, ale zostaną potem skasowane żeby zaoszczędzić miejsce na dysku.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Użyj domyślnego katalogu danych</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Użyj wybranego katalogu danych:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Przynajmniej %1 GB danych będzie przechowywane w następującym katalogu danych i będzie z czasem rosnąć.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>W przybliżeniu %1 GB danych będzie przechowywanych w tym katalogu. </translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 ściągnie i przechowa kopie łańcucha bloków Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Portfel również będzie przechowywany w tym katalogu.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Błąd: Określony katalog danych \"%1\" nie może zostać stworzony.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Błąd</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formularz</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Niedawne transakcje mogą być jeszcze nie widoczne i z tego powodu saldo Twojego portfela może być nieprawidłowe. Te informacje zostaną poprawione kiedy Twój portfel skończy się synchronizować z siecią Bitcoin, w sposób opisany poniżej. </translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Próby przesłania Bitcoinów które nie zostały jeszcze wyświetlone w transakcjach nie zostaną zaakceptowane przez sieć.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Pozostały numer bloków</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Nieznany...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Czas ostatniego bloku...</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Postęp</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Wzrost postępu na godzinę</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>obliczanie...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Szacowany pozostały czas do skończenia synchronizacji</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ukryj</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Nieznany. Synchronizowanie nagłówków (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Otwórz URl</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Otwórz żądanie płatności z URl lub pliku</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URl:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Otwórz plik z żądaniem płatności</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Wybierz plik do otwarcia z żądaniem płatności </translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opcje</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Główny</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Automatycznie zacznij %1 po zalogowaniu do systemu.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Zacznij %1 podczas logowania do systemu</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Numer skryptów &amp; wątków weryfikacji</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Potwierdź opcje resetu.</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Program wymaga ponownego uruchomienia by zapisać zmiany.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Program zostanie zamknięty. Czy chcesz kontynuować?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opcje konfiguracji.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Błąd</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Plik konfiguracji nie mógł zostać otwarty poprawnie.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Aby zapisać zmianę należy ponownie uruchomić program.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Wprowadzony adres proxy jest nieprawidłowy.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formularz</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Tylko do odczytu:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Dostępne:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Twoje obecne środki do wydania</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>W trakcie:</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Niedojrzały</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldo</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>W sumie:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Twoje obecne saldo:</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Dostępne:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Ostatnie transakcje</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Błąd żądania płatności</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Obsługa URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>adres URL żądania zapłaty jest nieprawidłowy: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Nieprawidłowy adres płatności %1</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Żądanie płatności odrzucone.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Żądanie płatności wygasło.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Żądanie płatności nie zostało rozpoczęte.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Nieprawidłowe żądanie płatności.</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent użytkownika</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Wysłane</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Otrzymane</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Ilość</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nieznany</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Zapisz obraz...</translation>\n    </message>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Wersja klienta</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informacje</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Debuguj okno</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Ogólny</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Używasz BerkeleyDB wersji</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Czas rozpoczęcia</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Sieć</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nazwa</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Liczba połączeń</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Łańcuch bloku</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Obecna liczba bloków</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Pula pamięci</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Obecna liczba transakcji</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Użycie pamięci</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Reset</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Otrzymane</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Wysłane</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;członkowie</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Zablokowani członkowie</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Wybierz użytkownika by zobaczyć wiecej informacji</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Dopuszczeni</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Kierunek</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Wersja</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Start bloku</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Nagłówki</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Synchronizowane bloki</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent użytkownika</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>zmniejsz rozmiar fonta</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>zwiększ rozmiar fonta</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Usługi</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Liczba blokad</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Czas połączenia</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Ostatnio wysłane</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Ostatnio otrzymane</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Czas pinga</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Oczekiwanie pinga</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Min ping</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Czas ostatniego bloku...</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;otwarte</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;konsola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;traffic sieci</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>W sumie</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Tak</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nie</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Nieznane</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Ilość</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etykieta</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Wiadomość</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Wyczyść wszystkie pola formularza.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Wyczyść</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historia żądań płatności.</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Zażądaj płatności</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Pokaż</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Wykasuj z listy zaznaczone wejścia.</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Usuń</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Kopiuj URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiuj etykietę</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopiuj wiadomość</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiuj ilość</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Kod QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopiuj &amp;URl</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopiuj &amp;Adres</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Zapisz obraz...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Zażądaj płatności do %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informacje o płatności</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Ilość</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etykieta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Wiadomość</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Błąd podczas zmiany URI w QR kod.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etykieta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Wiadomość</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez etykiety)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(brak wiadomości)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(bez ilości)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Żądane</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Wyślij moniaki</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Funkcje kontroli moniaków</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Wejścia...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>Automatycznie wybrane</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Za mało środków</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Ilość:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtów:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Ilość:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Opłata:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Po odliczeniu opłaty:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Zmiana:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Koszt transakcji:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Wybierz...</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Ostrzeżenie: obecnie brak możliwości estymacji kosztu.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>Załamanie ustawienia kosztu</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>na kilobajt.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ukryj</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Rekomendowany</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Zwyczaj:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Smart koszt nie został zainicjowany. Zwykle trwa to kilka bloków...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Wyślij do wielu odbiorców naraz</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Dodaj &amp;Odbiorcę</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Wyczyść wszystkie pola formularza.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Wyczyść &amp;wszystko</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Potwierdź wysyłkę</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>W&amp;yślij</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopiuj ilość</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiuj ilość</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopiuj koszt</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopiuj po opłacie</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopiuj bajty</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopiuj pył</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopiuj zmianę</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Czy na pewno jesteś pewien że chcesz wysłać?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>Dodane jako koszt transakcji.</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Wartość w sumie %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>lub</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Potwierdź wysyłkę moniaków</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Adres odbiorcy jest nieprawidłowy. Sprawdź ponownie.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Wartość do zapłaty musi być większa od 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Wartość przekracza Twoje saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Wliczając opłatę za transakcję %1, Twoje saldo zostałoby przekroczone.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Znaleziono zduplikowany adres. Adresy powinny być użyte jednokrotnie.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Utworzenie transakcji nie doszło do skutku.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Żądanie płatności wygasło.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez etykiety)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etykieta</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Wiadomość:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Tak</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Sygnatura</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Wyczyść &amp;wszystko</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Wprowadzony adres jest nieprawidłowy.</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Źródło</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Od</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nieznany</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Do</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>własny adres</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etykieta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Wiadomość</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Komentarz</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Tranzakcja</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Ilość</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>prawda</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>fałsz</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etykieta</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Otrzymane on</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Wyślij do</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez etykiety)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Sent to</source>\n        <translation>Wyślij do</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiuj adres</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiuj etykietę</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiuj ilość</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Plik oddzielony przecinkiem (*.csv)</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etykieta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksport nie powiódł się</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Wyślij coiny</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Eksportuj</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksportuj dane z aktywnej karty do pliku</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Ładuję banlistę...</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacja</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Ostrzeżenie</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Za mało środków</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Ładuję listę bloków</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Ładuję portfel...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Nie można zmniejszyć portfela</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Ponowne skanowanie...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Zakończono ładowanie</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Błąd</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_pt.ts",
    "content": "<TS language=\"pt\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Clique Esquerdo para editar o endereço ou etiqueta </translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Criar novo endereço</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Novo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiar o endereço selecionado para a clipboard do sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>F&amp;echar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Deletar o endereço selecionado da lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar as informações da aba para um arquivo</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Enviando informações</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Recebendo informações</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estas são suas informações para o envio de pagamentos por Bitcoins. Sempre cheque a quantia enviada e as informações do destinatário, antes de enviar os Bitcoins.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Estas são suas informações para o recebimento de pagamentos por Bitcoins. É recomendado que seja feito o uso de um novo conjunto de informações para cada transação.</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportar lista de endereços</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Ficheiro separado por vírgula (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Falha na Exportação</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Ocorreu um erro ao tentar guardar a lista em %1. Por favor, tente novamente.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Endereço</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Diálogo senha</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Insira a senha</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nova senha</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Digite a nova senha novamente</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Insira a nova senha para a carteira.\nPor favor, utilize uma senha com dez ou mais caracteres, ou com oito ou mais palavras.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Criptografar wallet</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Para esta operação se faz necessário o uso da sua senha da wallet para desbloquear a mesma.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloquear a wallet</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Para esta operação se faz necessário o uso de sua senha wallet para descriptografar a mesma</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Descriptografar wallet</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Trocar senha</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Insira a antiga e nova senha na wallet, respectivamente.</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Você tem certeza que deseja criptografar a sua wallet?</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Falha ao criptografar a wallet</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar o ID de transação</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Endereço</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem etiqueta)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar o ID de transação</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Ficheiro separado por vírgula (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Endereço</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Falha na Exportação</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar as informações da aba para um arquivo</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_pt_BR.ts",
    "content": "<TS language=\"pt_BR\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Clique com o botão direito para editar o endereço ou rótulo</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Criar um novo endereço</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Novo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copie o endereço selecionado para a área de transferência do sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Fe&amp;char</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Excluir os endereços selecionados da lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar os dados na aba atual para um arquivo</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Excluir</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Escolha o endereço para enviar moedas</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Escolha o endereço para receber moedas</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>E&amp;scolha</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Endereços de envio</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Endereços de recebimento</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estes são os seus endereços para enviar pagamentos. Sempre cheque a quantia e o endereço do destinatário antes de enviar moedas.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Estes são os seus endereços para receber pagamentos. É recomendado usar um novo para cada transação.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copiar endereço</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copiar &amp;rótulo</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Editar</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportar lista de endereços</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Arquivo separado por virgula (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Falha na exportação</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Erro ao salvar a lista de endereço para %1. Tente novamente.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Rótulo</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Endereço</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem rótulo)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Janela da Frase de Segurança</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Digite a frase de segurança</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nova frase de segurança</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repita a nova frase de segurança</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Mostrar senha</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Insira a nova senha para a carteira.&lt;br/&gt;Favor usar uma senha com &lt;b&gt;dez ou mais caracteres aleatórios&lt;/b&gt;, ou &lt;b&gt;oito ou mais palavras&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Criptografar carteira</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Esta operação precisa da sua senha para desbloquear a carteira.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloquear carteira</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Esta operação precisa da sua senha para descriptografar a carteira</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Descriptografar carteira</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Alterar senha</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Insira a senha antiga e a nova para a carteira.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirmar criptografia da carteira</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Aviso: Se você criptografar sua carteira e perder sua senha, você vai &lt;b&gt;PERDER TODOS OS SEUS BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Tem certeza que deseja criptografar a carteira?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Carteira criptografada</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANTE: Qualquer backup prévio que você tenha feito da sua carteira deve ser substituído pelo novo e encriptado arquivo gerado. Por razões de segurança, qualquer backup do arquivo não criptografado se tornará inútil assim que você começar a usar uma nova carteira criptografada.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Falha ao criptografar carteira</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Falha na criptografia devido a um erro interno. Sua carteira não foi criptografada.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>As senhas não conferem.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Falha ao desbloquear carteira</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>A senha inserida para descriptografar a carteira está incorreta.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Falha ao descriptografar a carteira</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>A senha da carteira foi alterada com êxito.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Aviso: Tecla Caps Lock ativa!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Máscara</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Banido até</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Assinar &amp;mensagem...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Sincronizando com a rede...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Visão geral</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nó</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostrar visão geral da carteira</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transações</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Navegar pelo histórico de transações</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>S&amp;air</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Sair da aplicação</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Sobre %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Mostrar informações sobre %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Sobre &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostrar informações sobre o Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opções...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modificar opções de configuração para o %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Criptografar Carteira...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Backup da carteira...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Mudar frase de segurança...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Endereço&amp;s de envio...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Endereços de &amp;recebimento...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Abrir &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Clique para desativar a atividade de rede.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Atividade de rede desativada.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Clique para ativar a atividade de rede.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Sincronizando cabeçalhos (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Reindexando blocos no disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviar moedas para um endereço bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Fazer cópia de segurança da carteira para uma outra localização</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Mudar a frase de segurança utilizada na criptografia da carteira</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Janela de &amp;depuração</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Abrir console de depuração e diagnóstico</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verificar mensagem...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Carteira</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Receber</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Exibir / Ocultar</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostrar ou esconder a Janela Principal.</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Criptografar as chaves privadas que pertencem à sua carteira</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Assine mensagens com seus endereços Bitcoin para provar que você é dono delas</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verificar mensagens para se assegurar que elas foram assinadas pelo dono de Endereços Bitcoin específicos</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Arquivo</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Definições</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>A&amp;juda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra de ferramentas</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Solicitações de pagamentos (gera códigos QR e bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostrar a lista de endereços de envio e rótulos usados</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Mostrar a lista de endereços de recebimento usados ​​e rótulos</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Abrir um bitcoin: URI ou cobrança</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opções de linha de &amp;comando</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n conexão ativa na rede Bitcoin</numerusform><numerusform>%n conexões ativas na rede Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indexando blocos no disco...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Processando blocos no disco...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n bloco processado do histórico de transações.</numerusform><numerusform>%n blocos processados do histórico de transações.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 atrás</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Último bloco recebido foi gerado %1 atrás.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transações após isso ainda não estão visíveis.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Atenção</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informação</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Atualizado</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Mostrar a mensagem de ajuda do %1 para obter uma lista com possíveis opções de linha de comando Bitcoin</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 cliente</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Conectando...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Recuperando o atraso...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Quantidade: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipo: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Rótulo: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Endereço: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transação enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transação recebida</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Geração de chave HD está &lt;b&gt;ativada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Geração de chave HD está &lt;b&gt;desativada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Carteira está &lt;b&gt;criptografada&lt;/b&gt; e atualmente &lt;b&gt;desbloqueada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Carteira está &lt;b&gt;criptografada&lt;/b&gt; e atualmente &lt;b&gt;bloqueada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Um erro fatal ocorreu. Bitcoin não pode continuar em segurança e irá fechar.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selecionar Moeda</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantidade:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Quantia:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Taxa:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Poeira:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Depois da taxa:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Troco:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(de)selecionar tudo</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modo árvore</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modo lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Quantidade</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Rótulo</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Endereço </translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmações</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar endereço</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar rótulo</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar quantia</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID da transação</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Bloquear não-gasto</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Desbloquear não-gasto</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar quantia</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar taxa</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar pós taxa</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar poeira</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar troco</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 bloqueada)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>sim</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>não</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Este texto fica vermelho se qualquer destinatário receber uma quantidade menor que o limite atual para poeira.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Pode variar +/- %1 satoshi(s) por entrada</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem rótulo)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>troco de %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(troco)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editar Endereço</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Rótulo</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>O rótulo associado a esta entrada na lista de endereços</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>O endereço associado a esta entrada na lista de endereços. Isso só pode ser modificado para endereços de envio.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Endereço</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Novo endereço de recebimento</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Novo endereço de envio</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Editar endereço de recebimento</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Editar endereço de envio</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>O endereço digitado \"%1\" não é um endereço válido.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>O endereço digitado \"%1\" já se encontra no catálogo de endereços.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Não foi possível desbloquear a carteira.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Falha ao gerar nova chave.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Um novo diretório de dados será criado.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nome</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>O diretório já existe. Adicione %1 se você pretende criar um novo diretório aqui.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Esta pasta já existe, e não é um diretório.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Não é possível criar um diretório de dados aqui.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versão</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Sobre %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opções da linha de comando</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uso:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opções da linha de comando</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opções de Interface:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Escolher diretório de dados na inicialização (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Definir idioma, por exemplo \"de_DE\" (padrão: idioma do sistema)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Iniciar minimizado</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Definir a raíz de certificados SSL para requisições de pagamento (padrão: -sistema-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Exibir tela de abertura na inicialização (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Resetar todas as configurações do GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bem-vindo</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Bem vindo ao %1</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Como essa é a primeira vez que o programa é executado, você pode escolher onde %1 armazenará seus dados.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Esta sincronização inicial é muito exigente e pode expor problemas de hardware com o computador que passaram despercebidos anteriormente. Cada vez que você executar o %1, irá continuar baixando de onde parou.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Se você escolheu limitar o armazenamento da block chain (prunando), os dados históricos ainda devem ser baixados e processados, mas serão apagados no final para manter o uso de disco baixo.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Use o diretório de dados padrão</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Use um diretório de dados personalizado:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>No mínimo %1 GB de dados serão armazenados neste diretório, e isso irá crescer com o tempo.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Aproximadamente %1 GB de dados serão armazenados neste diretório.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 irá baixar e armazenar uma cópia da block chain do Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>A carteira também será armazenada neste diretório.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Erro: Diretório de dados \"%1\" não pode ser criado.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB de espaço livre disponível</numerusform><numerusform>%n GB de espaço livre disponível</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(de %n GB necessário)</numerusform><numerusform>(de %n GB necessário)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulário</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Transações recentes podem não estar visíveis ainda, portanto o seu saldo pode estar incorreto. Esta informação será corrigida assim que sua carteira for sincronizada com a rede, como detalhado abaixo.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Tentar gastar bitcoins que estão em transações ainda não exibidas, não vão ser aceitos pela rede.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Número de blocos restantes</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Desconhecido...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Horário do último bloco</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progresso</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Aumento do progresso por hora</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>calculando...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Tempo estimado para sincronizar</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ocultar</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Desconhecido. Sincronizando cabeçalhos (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Abrir URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Abrir requisição de cobrança por URI ou arquivo</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Selecione o arquivo de cobrança</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Selecione o arquivo de cobrança para ser aberto</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opções</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>Principal</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Executar o %1 automaticamente ao iniciar o sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Iniciar %1 ao fazer login no sistema</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Tamanho do banco de &amp;dados do cache</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Número de threads do script de &amp;verificação</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Endereço de IP do proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Mostra se o proxy padrão fornecido SOCKS5 é utilizado para encontrar participantes por este tipo de rede.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Use um proxy SOCKS&amp;5 separado para alcançar participantes via serviços ocultos Tor: </translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Esconder ícone da bandeja do sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Oculte o ícone</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimizar em vez de fechar o programa quando a janela for fechada. Quando essa opção estiver ativa, o programa só será fechado somente pela opção Sair no menu Arquivo.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URLs de terceiros (exemplo: explorador de blocos) que aparecem na aba de transações como itens do menu de contexto. %s na URL é substituido pela hash da transação. Múltiplas URLs são separadas pela barra vertical |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Opções de linha de comando ativas que sobrescrevem as opções acima:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Abrir o arquivo de configuração %1 apartir do diretório trabalho.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Abrir Arquivo de Configuração</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Redefinir todas as opções do cliente para opções padrão.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Redefinir opções</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>Rede</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automático, &lt;0 = número de núcleos deixados livres)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>C&amp;arteira</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Avançado</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Habilitar opções de &amp;controle de moedas</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Se você desabilitar o gasto de um troco não confirmado, o troco da transação não poderá ser utilizado até a transação ter pelo menos uma confirmação. Isso também afeta seu saldo computado.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>Ga&amp;star troco não confirmado</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Abrir as portas do cliente Bitcoin automaticamente no roteador. Isto só funcionará se seu roteador suportar UPnP e esta função estiver habilitada.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapear porta usando &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Aceitar conexões externas.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Permitir conexões de entrada</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Conectar na rede Bitcoin através de um proxy SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Conectar usando proxy SOCKS5 (proxy pradrão):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP do proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Porta:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Porta do serviço de proxy (ex. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Usado para alcançar pares via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Conecte-se à rede Bitcoin através de um proxy SOCKS5 separado para utilizar serviços ocultos Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Janela</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Mostrar apenas um ícone na bandeja ao minimizar a janela.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimizar para a bandeja em vez da barra de tarefas.</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimizar ao sair</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Mostrar</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Idioma da interface:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>O idioma da interface pode ser definido aqui. Essa configuração terá efeito após reiniciar o %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unidade usada para mostrar quantidades:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Escolha a unidade de subdivisão padrão para exibição na interface ou quando enviando moedas.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Mostrar ou não opções de controle da moeda.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;URLs de transação de terceiros</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancelar</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>padrão</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>nenhum</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmar redefinição de opções</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Reinicialização do aplicativo necessária para efetivar alterações.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>O programa será encerrado. Deseja continuar?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opções de configuração</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>O arquivo de configuração é usado para especificar opções de usuário avançadas que substituem as configurações de GUI. Além disso, quaisquer opções de linha de comando substituirão esse arquivo de configuração.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>O arquivo de configuração não pode ser aberto.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Essa mudança requer uma reinicialização do aplicativo.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>O endereço proxy fornecido é inválido.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulário</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>A informação mostrada pode estar desatualizada. Sua carteira sincroniza automaticamente com a rede Bitcoin depois que a conexão é estabelecida, mas este processo ainda não está completo.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Monitorados:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponível:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Seu saldo atual disponível para gasto</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pendente:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transações que ainda têm de ser confirmados, e ainda não estão disponíveis para gasto</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Imaturo:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Saldo minerado que ainda não está maduro</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldos</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Seu saldo total atual</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Seu saldo atual em endereços monitorados</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Disponível: </translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Transações recentes</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Transações não confirmadas de um endereço monitorado</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Saldo minerado de endereço monitorado que ainda não está maduro</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Balanço total em endereços monitorados</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Erro no pedido de pagamento</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Não foi possível iniciar bitcoin: manipulador click-to-pay</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Manipulação de URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>URL de cobrança é inválida: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Endereço de pagamento %1 inválido</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>A URI não pode ser analisada! Isto pode ser causado por um endereço inválido ou um parâmetro URI malformado.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Manipulação de arquivo de cobrança</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Arquivo de pedido de pagamento não pode ser lido! Isto pode ser causado por uma requisição de pagamento inválida.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Pedido de pagamento rejeitado</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Rede do pedido de pagamento não corresponde rede do cliente.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Pedido de pagamento expirado.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Pedido de pagamento não inicializado.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Pedidos de pagamento não verificados para scripts de pagamento personalizados não são suportados.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Pedido de pagamento inválido</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Valor do pagamento solicitado de %1 é muito pequeno (considerado poeira).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Reembolso de %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Pedido de pagamento %1 é muito grande (%2 bytes, permitido %3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Erro na comunicação com %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Pedido de pagamento não pode ser analisado!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Erro na resposta do servidor: %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Erro de solicitação de rede</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Pagamento reconhecido</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nó/Serviço</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>ID do nó</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recebido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Quantidade</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Informe um endereço Bitcoin (ex: %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Nenhum</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n segundo</numerusform><numerusform>%n segundos</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minuto</numerusform><numerusform>%n minutos</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n dia</numerusform><numerusform>%n dias</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n semana</numerusform><numerusform>%n semanas</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 e %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n ano</numerusform><numerusform>%n anos</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 ainda não terminou com segurança...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconhecido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Erro: Diretório de dados especificado \"%1\" não existe.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Erro: Não foi possível interpretar arquivo de configuração: %1. Utilize apenas a sintaxe chave=valor.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Erro: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Salvar imagem...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copiar imagem</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Salvar código QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imagem PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versão do cliente</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informação</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Janela de depuração</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Geral</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Versão do BerkeleyDB</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Horário de inicialização</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Rede</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nome</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Número de conexões</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Corrente de blocos</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Quantidade atual de blocos</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Pool de Memória</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Número atual de transações</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Uso de memória</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Limpar</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recebido</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Pares</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Nós banidos</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Selecione um nó para ver informações detalhadas.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Lista branca</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direção</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versão</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Bloco inicial</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Cabeçalhos Sincronizados</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Blocos Sincronizados</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Abrir o arquivo de log de depuração do %1 localizado no diretório atual de dados. Isso pode levar alguns segundos para arquivos de log grandes.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Diminuir o tamanho da fonte</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Aumentar o tamanho da fonte</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Serviços</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Pontuação de Banimento</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Tempo de conexão </translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Ultimo Envio</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Ultimo Recebido</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>A duração atual de um ping excepcional.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Espera de ping</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Ping minímo</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Offset de tempo</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Horário do último bloco</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Abrir</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Console</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Tráfico de Rede</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totais</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Entrada:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Saída:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Arquivo de log de depuração</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Limpar console</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hora</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;dia</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;semana</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;ano</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Desconectar</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Banir por</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Desbanir</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Bem-vindo ao console RPC do %1.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Use as setas para cima e para baixo para navegar pelo histórico, e %1 para limpar a tela.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Digite %1 para obter uma visão geral dos comandos disponíveis.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Para maiores informações sobre como utilizar este console, digite %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>ATENÇÃO: Fraudadores tem solicitado a usuários que digitem comandos aqui, e assim roubando o conteúdo de suas carteiras. Não utilize este console sem antes conhecer os comandos e seus efeitos.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Atividade da rede disativada</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(id do nó: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>por %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nunca</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Entrada</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Saída</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Sim</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Não</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Desconhecido</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Qu&amp;antia:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Rótulo:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Mensagem:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Uma mensagem opcional que será anexada na cobrança e será mostrada quando ela for aberta. Nota: A mensagem não será enviada com o pagamento pela rede Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Um rótulo opcional para associar ao novo endereço de recebimento.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Use esse formulário para fazer cobranças. Todos os campos são &lt;b&gt;opcionais&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Uma quantia opcional para cobrar. Deixe vazio ou zero para não cobrar uma quantia específica.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Limpa todos os campos do formulário.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Limpar</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Histórico de cobranças</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Requisitar Pagamento</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Mostra a cobrança selecionada (o mesmo que clicar duas vezes em um registro)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostrar</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Remove o registro selecionado da lista</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Remover</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copiar URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar rótulo</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copiar mensagem</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar quantia</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Código QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copiar &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Copiar Endereço</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Salvar Imagem...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Pedido de pagamento para %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informação do pagamento</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Endereço</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Quantia</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Rótulo</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensagem</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI resultante muito longa. Tente reduzir o texto do rótulo ou da mensagem.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Erro ao codificar o URI em código QR</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Rótulo</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensagem</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem rótulo)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(sem mensagem)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(nenhuma quantia solicitada)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Solicitado</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar moedas</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Opções de controle de moeda</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Entradas...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automaticamente selecionado</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Saldo insuficiente!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantidade:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Quantia:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Taxa:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Depois da taxa:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Troco:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Se essa opção for ativada e o endereço de troco estiver vazio ou inválido, o troco será enviado a um novo endereço gerado na hora.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Endereço específico de troco</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Taxa de transação: </translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Escolher...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>O uso da taxa de retorno pode resultar no envio de uma transação que levará várias horas ou dias (ou nunca) para confirmar. Considere escolher sua taxa manualmente ou aguarde até que você tenha validado a cadeia completa.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Atenção: Estimativa de taxa não disponível no momento</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>Ocultar painel</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>por kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Se a taxa personalizada for definida em 1000 satoshis e a transação tiver somente 250 bytes, então \"por kilobyte\" somente paga 250 satoshis de taxa, enquanto \"pelo menos\" paga 1000 satoshis. Se a transação for maior que 1 kilobyte, ambos pagam por kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ocultar</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Pagando apenas a taxa mínima é bom, desde que haja pouco volume de transações. Mas esteja ciente de que isso pode acabar em uma transação nunca confirmanda uma vez que há mais demanda por transações do que a rede pode processar.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(Leia o popup)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recomendado:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Personalizado:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(SmartFee não iniciado. Isso requer alguns blocos...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Enviar para vários destinatários de uma só vez</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Adicionar &amp;Destinatário</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Limpar todos os campos do formulário.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Poeira:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Tempo alvo de confirmação:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Habilitar Replace-By-Fee</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Com Replace-By-Fee (BIP-125) você pode aumentar a taxa da transação após ela ser enviada. Sem isso, uma taxa maior pode ser recomendada para compensar por risco de alto atraso na transação.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Limpar &amp;Tudo</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirmar o envio</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar quantia</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar quantia</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar taxa</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar após taxa</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar poeira</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar troco</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blocos)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 a %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Tem certeza que deseja enviar?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>adicionado como taxa da transação </translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Quantia tota %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>ou</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Você pode aumentar a taxa depois (sinaliza Replace-By-Fee, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Não sinalizar Replace-By-Fee, BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirme o envio de moedas</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Endereço de envio inváido. Favor checar.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>A quantia à pagar deve ser maior que 0</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>A quantia excede o seu saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>O total excede o seu saldo quando a taxa da transação %1 é incluída.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Endereço duplicado encontrado: Endereços devem ser usados somente uma vez cada.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Falha na criação da transação!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>A transação foi rejeitada com a seguinte razão: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Uma taxa maior que %1 é considerada uma taxa absurdamente alta.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Pedido de pagamento expirado.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Pagar somente a taxa requerida de %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Confirmação em %n bloco.</numerusform><numerusform>Início estimado para confirmação em %n blocos.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Aviso: Endereço Bitcoin inválido</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Aviso: Endereço de troco desconhecido</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Confirmar endereço de troco personalizado</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>O endereço selecionado para o troco não pertence a esta carteira. Alguns ou todos os fundos da sua carteira modem ser mandados para esse endereço. Tem certeza?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem rótulo)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Q&amp;uantidade:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Pagar &amp;Para:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Rótulo:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escolher endereço usado anteriormente</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Este é um pagamento normal.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>O endereço Bitcoin para enviar o pagamento</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Colar o endereço da área de transferência</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Remover esta entrada</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>A taxa será deduzida da quantia que está sendo enviada. O destinatário receberá menos bitcoins do que você colocou no campo de quantidade. Se vários destinatários estão selecionados, a taxa é dividida igualmente.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>&amp;Retirar taxa da quantia</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Use o saldo disponível</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mensagem:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Esta é uma cobrança não autenticada.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Esta é uma cobrança autenticada.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Digite um rótulo para este endereço para adicioná-lo no catálogo</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>A mensagem que foi anexada ao bitcoin: URI na qual será gravada na transação para sua referência. Nota: Essa mensagem não será gravada publicamente na rede Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pague Para:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memorizar:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Digite um rótulo para este endereço para adicioná-lo ao catálogo de endereços</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Sim</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 está desligando...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Não desligue o computador até que esta janela desapareça.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Assinaturas - Assinar / Verificar uma mensagem</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Assinar mensagem</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Você pode assinar mensagens com seus endereços para provar que você pode receber bitcoins enviados por alguém. Cuidado para não assinar nada vago ou aleatório, pois ataques phishing podem tentar te enganar para assinar coisas para eles como se fosse você. Somente assine termos bem detalhados que você concorde.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>O endereço Bitcoin que assinará a mensagem</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escolha um endereço usado anteriormente</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Colar o endereço da área de transferência</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Digite a mensagem que você quer assinar aqui</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Assinatura</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copiar a assinatura para a área de transferência do sistema</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Assinar mensagem para provar que você é dono deste endereço Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Assinar &amp;Mensagem</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Limpar todos os campos de assinatura da mensagem</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Limpar &amp;Tudo</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verificar Mensagem</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Coloque o endereço do autor, a mensagem (certifique-se de copiar toda a mensagem, incluindo quebras de linha, espaços, tabulações, etc.) e a assinatura abaixo para verificar a mensagem. Cuidado para não compreender mais da assinatura do que está na mensagem assinada de fato, para evitar ser enganado por um ataque man-in-the-middle. Note que isso somente prova que o signatário recebe com este endereço, não pode provar que é o remetente de nenhuma transação!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>O endereço Bitcoin que foi usado para assinar a mensagem</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verificar mensagem para se assegurar que ela foi assinada pelo dono de um endereço Bitcoin específico</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verificar &amp;Mensagem</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Limpar todos os campos da verificação de mensagem</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Clique em \"Assinar mensagem\" para gerar a assinatura</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>O endereço digitado é inválido.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Por gentileza, cheque o endereço e tente novamente.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>O endereço fornecido não se refere a uma chave.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>O desbloqueio da carteira foi cancelado.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>A chave privada do endereço inserido não está disponível.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>A assinatura da mensagem falhou.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Mensagem assinada.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>A assinatura não pode ser decodificada.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Por gentileza, cheque a assinatura e tente novamente.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>A assinatura não corresponde a mensagem.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Falha na verificação da mensagem.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Mensagem verificada.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Abrir para mais %n bloco</numerusform><numerusform>Abrir para mais %n blocos</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Aberto até %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>conflitado com uma transação com %1 confirmações</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/não confirmado, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>no pool de memória</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>não está no pool de memóra</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandonado</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/não confirmado</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 confirmações</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, ainda não foi propagada na rede com êxito</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, transmitido aravés de %n nó</numerusform><numerusform>, transmitido aravés de %n nós</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Fonte</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Gerado</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>De</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconhecido</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Para</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>endereço próprio</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>monitorado</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>rótulo</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Crédito</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>maduro em mais %n bloco</numerusform><numerusform>maduro em mais %n blocos</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>não aceito</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Débito</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Débito total</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Crédito total</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Taxa da transação</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Valor líquido</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensagem</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comentário</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID da transação</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Tamanho tota da transação</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Index da saída</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Mercador</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Moedas recém minerados precisam aguardar %1 blocos antes de serem gastos. Quando o bloco foi gerado, ele foi disseminado pela rede para ser adicionado à blockchain. Se ele falhar em ser inserido na cadeia, seu estado será modificado para \"não aceito\" e ele não poderá ser gasto. Isso pode acontecer eventualmente quando blocos são gerados quase que simultaneamente.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Informações de depuração</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transação</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Entradas</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Quantia</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>verdadeiro</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>falso</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Este painel mostra uma descrição detalhada da transação</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detalhes para %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Rótulo</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Aberto por mais %n bloco</numerusform><numerusform>Aberto por mais %n blocos</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Aberto até %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Não confirmado</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandonado</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirmando (%1 de %2 confirmações recomendadas)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmado (%1 confirmações)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Conflitado</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Recém-criado (%1 confirmações, disponível somente após %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Este bloco não foi recebido por nenhum outro participante da rede e provavelmente não será aceito!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Gerado mas não aceito</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recebido com</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Recebido de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviado para</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pagamento para você mesmo</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minerado</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>monitorado</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem rótulo)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Status da transação. Passe o mouse sobre este campo para mostrar o número de confirmações.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Data e hora em que a transação foi recebida.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipo de transação.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Mostrar ou não endereços monitorados na lista de transações.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Intenção/Propósito definido pelo usuário para a transação.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Quantidade debitada ou creditada ao saldo.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Todos</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Hoje</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Essa semana</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Esse mês</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Último mês</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Este ano</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Intervalo...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recebido com</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviado para</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Para você mesmo</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minerado</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Outro</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Digite o endereço, o ID da transação ou o rótulo para pesquisar</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Quantia mínima</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Transação abandonada</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Aumentar taxa da transação</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar endereço</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar rótulo</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar quantia</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar ID da transação</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copiar o raw da transação</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copiar dados completos da transação</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Editar rótulo</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Mostrar detalhes da transação</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exportar histórico de transações</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmado</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Monitorado</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Rótulo</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Endereço</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Falha na exportação</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Ocorreu um erro ao tentar salvar o histórico de transações em %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exportação feita com êxito</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>O histórico de transação foi gravado com êxito em %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Intervalo: </translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>para</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unidade para mostrar quantidades. Clique para selecionar outra unidade.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Nenhuma carteira carregada.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar moedas</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Erro no aumento de taxa</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Aumento na taxa de transação falhou</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Deseja aumentar a taxa?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Taxa atual:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Aumento:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nova taxa:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Confirmação no aumento de taxa</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Não é possível assinar a transação.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Não foi possível mandar a transação</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar os dados da guia atual para um arquivo</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Backup da carteira</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Carteira (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Falha no backup</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Ocorreu um erro ao tentar salvar os dados da carteira em %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Êxito no backup</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Os dados da carteira foram salvos com êxito em %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opções:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especificar o diretório de dados</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Conectar a um nó para receber endereços de pares e desconectar</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especificar seu próprio endereço público</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Aceitar comandos de linha de comando e JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distribuído sob a licença de software MIT, veja o arquivo %s ou %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Se &lt;category&gt; não for suprida ou se &lt;category&gt; = 1, mostrar toda informação de depuração.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Configuração de prune abaixo do mínimo de %d MiB.Por gentileza use um número mais alto.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Prune: A ultima sincronização da carteira foi além dos dados podados. Você precisa usar -reindex (fazer o download de toda a blockchain novamente no caso de nós com prune)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Rescans não são possíveis no modo prune. Você precisa usar -reindex, que irá fazer o download de toda a blockchain novamente.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Erro: Um erro interno fatal ocorreu, veja debug.log para detalhes</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Taxa (em %s/kB) a ser adicionada às transações que você mandar (padrão: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Podando os blocos existentes...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Rodar em segundo plano como serviço e aceitar comandos</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Não foi possível iniciar o servidor HTTP. Veja o log de depuração para detaihes.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Desenvolvedores do %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>A variação da taxa (em %s/kB) que será usada quando não houver dados suficientes para se estimar a taxa (default: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Aceita transações retransmitidas advindas de pares em lista branca, mesmo quando não estiver retransmitindo transações (padrão: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Adicione um node para se conectar e tentar manter a conexão aberta (consulte a ajuda do comando `addnode` RPC para obter mais informações)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Vincular ao endereço fornecido e sempre escutar nele. Use a notação [host]:port para IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Não foi possível obter exclusividade de escrita no endereço %s. O %s provavelmente já está sendo executado.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Não é possível fornecer conexões específicas e ter addrman procurando conexões ao mesmo tempo. </translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Conecta somente ao nó especificado(s); -connect=0 desabilita conexões automáticas (a regra para este par é a mesma de -addnode)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Apaga todas as transações da carteira e somente recupera essas partes da blockchain usando o comando -rescan na inicialização</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Erro ao ler arquivo %s! Todas as chaves privadas foram lidas corretamente, mas os dados de transação ou o livro de endereços podem estar faltando ou incorretos.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Excluir informações de depuração para uma categoria. Pode ser usado em conjunto com -debug=1 para exibir logs de depuração para todas as categorias, exceto uma ou mais categorias especificadas.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Executa um comando quando uma transação da carteira mudar (%s no comando será substituído por TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Transações extras para manter na memória para reconstruções de blocos compactos (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Se este bloco está na blockchain, assume-se que ele e seus ancestrais são válidos e pode-se potencialmente pular a verificação de seus scripts (0 para verificar todos, padrão: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Ajuste da média máxima permitida do time offset para um par. A perspectiva local de horário pode ser influenciada por pares à frente ou atrás neste montante. (padrão: %u segundos)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Total máximo de taxas (em %s) para usar em uma única transação de carteira ou transação crua; especificar um valor muito baixo pode abortar grandes transações (padrão: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Por favor verifique se a data e o horário de seu computador estão corretos. Se o relógio de seu computador estiver incorreto, %s não funcionará corretamente.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Por favor contribua se você entender que %s é útil. Visite %s para mais informações sobre o software.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Buscar por endereços de pares via sementes DNS, se estiver baixo em endereços (padrão: 1 a não ser que -connect seja usado)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Reduz o requerimente de espaço habiitando a poda (apagando) de blocos antigos. Isso permite chamar o comando pruneblockchain via RPC para apagar blocos específicos, e habiita o poda automático de blocos antigos se o tamanho em MiB for atingido. Esse modo é incompatível com -txindex e -rescan. Aviso: Reverter essa configuração requer baixar novamente o blockchain inteiro. (padrão: 0 = desabilitado, 1 = permite a poda manual via RPC, &gt;%u = poda os blocos para ficar abaixo do especificado, em MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Especificar a taxa miníma (em %s/KiB) para transações para ser incluída na criação de blocos. (padrão: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Define o número de threads de verificação de script (%u a %d, 0 = automático, &lt;0 = número de núcleos deixados livres, padrão: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>O banco de dados de blocos contém um bloco que parece ser do futuro. Isso pode ser devido à data e hora do seu computador estarem configuradas incorretamente. Apenas reconstrua o banco de dados de blocos se você estiver certo de que a data e hora de seu computador estão corretas.</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Este é um build de teste pré-lançamento - use por sua conta e risco - não use para mineração ou comércio</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Essa é a taxa de transação que você pode descartar se o troco a esse ponto for menor que poeira</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Não é possível reproduzir blocos. Você precisará reconstruir o banco de dados usando -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Não foi possível rebobinar o banco de dados para um estado pre-fork. Você precisa fazer o re-download da blockchain</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Use UPnP para mapear a porta em escuta (padrão: 1 quando escutando e sem -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Nome de usuário e hash da senha para conexões JSON-RPC. O campo &lt;userpw&gt; vem com o formato: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Um script python canônico é incluído em share/rpcuser. O cliente pode conectar normalmente usando o rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt;. Esta opção pode ser especificado multiplas vezes</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>A carteira não irá criar transações que violem o limite da mempool chain (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Atenção: A rede não parecem concordar plenamente! Alguns mineiros parecem estar enfrentando problemas.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Atenção: Nós não parecemos concordar plenamente com nossos pares! Você pode precisar atualizar ou outros pares podem precisar atualizar.</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d dos últimos 100 blocos possuem versão inesperada.</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s corrompido, recuperação falhou</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool deve ser pelo menos %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; pode ser:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Aceitar conexões externas (padrão: 1 se opções -proxy ou -connect não estiverem presentes)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Acrescenta comentários ao valor do user agent</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Tenta recuperar as chaves privadas de uma carteira corrompida ao inicializar</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opções de criação de blocos:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Não foi possível encontrar o endereço de -%s: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Opções de seleção de chain:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Índice de mudança fora do intervalo</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opções de conexão:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Detectado Banco de dados de blocos corrompido</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opções de depuração/teste:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Não carrega a carteira e desabilita as chamadas RPC para a carteira</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Você quer reconstruir o banco de dados de blocos agora?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Habilitar a publicação da hash do block em &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Habilitar a publicação da hash da transação em &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Habilitar a publicação do bloco cru em &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Habilitar a publicação da transação crua em &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Habilita substituição de transação no pool de memória (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Erro ao criar %s: Você não pode criar carteiras não-HD com esta versão.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Erro ao inicializar banco de dados de blocos</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Erro ao inicializar ambiente de banco de dados de carteira %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Erro ao carregar %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Erro ao carregar %s Carteira corrompida</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Erro ao carregar %s A carteira requer a versão mais nova do %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Erro ao carregar banco de dados de blocos</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Erro ao abrir banco de dados de blocos</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Erro: Espaço em disco insuficiente!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Falha ao escutar em qualquer porta. Use -listen=0 se você quiser isso.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Falha ao escanear novamente a carteira durante a inicialização</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importando...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Bloco gênese incorreto ou não encontrado. Datadir errado para a rede?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>O teste de integridade de inicialização falhou. O %s está sendo desligado.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Quantidade inválida para -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Quantidade inválida para -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Quantidade inválida para -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Mantenha a mempool de transações abaixo de &lt;n&gt; megabytes (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Carregando endereços P2P...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Carregando lista de banidos...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Localização do cookie de autenticação (padrão: diretório de dados)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Não há file descriptors suficientes disponíveis.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Somente conectar a clientes na rede &lt;net&gt; (ipv4, ipv6 ou onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Mostra essa mensagem de ajuda e sai</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Mostra a versão e fecha</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>O modo prune não pode ser configurado com um valor negativo.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>O modo prune é incompatível com -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Reconstruir estado da corrente e o índice de blocos a partir dos arquivos blk*.dat no disco</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Reconstruir estado a partir dos blocos indexados</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Reverificando blocos...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Reanalizando blocos...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>Enviar transações com opção full-RBF ativada (RPC somente, padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Define o tamanho do cache do banco de dados em megabytes (%d para %d, padrão: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Especifique o arquivo da carteira (dentro do diretório de dados)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>O código fonte está disponível pelo %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Taxa de transação e cálculo de troco falharam</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Impossível vincular a %s neste computador. O %s provavelmente já está rodando.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Argumento não suportado -benchmark ignorado, use -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Argumento não suportado -debugnet ignorado, use -debug=net</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Argumento não suportado encontrado: -tor. Use -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Categoria de log desconhecida %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Atualizando banco de dados UTXO</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Use UPnP para mapear a porta de entrada (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Usar a rede de testes</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Comentário do Agente de Usuário (%s) contém caracteres inseguros.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verificando blocos...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Opções de depuração/teste da Carteira</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>A Carteira precisa ser reescrita: reinicie o %s para completar</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opções da carteira:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Permitir conexões JSON-RPC de uma fonte específica. Válido para &lt;ip&gt; são, um único IP (ex. 1.2.3.4), uma rede/máscara (ex. 1.2.3.4/255.255.255.0) ou uma rede/CIDR (ex. 1.2.3.4/24). Esta opção pode ser usada múltiplas vezes</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Vincular ao endereço fornecido e atribuir lista branca para pares conectando através dele. Use a notação [host]:port para IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Criar novos arquivos com permissões padrão do sistema, em vez de umask 077 (apenas efetivo com funcionalidade de carteira desabilitada)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Descobrir o próprio IP (padrão: 1 enquanto aguardando conexões e sem -externalip ou -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Erro: Escutar conexões de entrada falhou (vincular retornou erro %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Executa um comando quando um alerta relevante é recebido ou vemos uma longa bifurcação (%s no comando é substituído pela mensagem)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Taxas (em %s/kB) menores que isso serão consideradas como taxa zero para relaying, mineração e criação de transação (padrão %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Se paytxfee não estiver definida, incluir comissão suficiente para que as transações comecem a ter confirmações em média dentro de N blocos (padrão %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Valor inválido para -maxtxfee=&lt;valor&gt;: '%s' (precisa ser pelo menos a taxa de minrelay de %s para prevenir que a transação nunca seja confirmada)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Tamanho máximo de dados em transações de operadores de dados que nós fazemos relay e mineramos (padrão %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Gerar credenciais aleatórias para cada conexão por proxy. Isto habilita o isolamento de stream do Tor (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>A quantia da transação é muito pequena para mandar depois de deduzida a taxa</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Pares na lista branca não podem ser banidos por DoS e suas transações sempre são retransmitidas, até mesmo se eles já estão no pool de memória, útil por exemplo, para um gateway</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Você precisa reconstruir o banco de dados usando -reindex para sair do modo prune. Isso irá causar o download de todo o blockchain novamente.</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Aceitar requisições REST públicas (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Criar automaticamente serviços ocultos do Tor (padrão: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Connecte-se através de um proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Erro carregando %s: Você não pode desabilitar o HD em uma carteira HD existente</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Erro ao ler o banco de dados. Encerrando.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Erro ao atualizar banco de dados do chainstate</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importar blocos a partir de arquivo externo blk000??.dat durante a inicialização</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informação</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Endereço -onion ou nome do servidor inválido: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Endereço -proxy ou nome do servidor inválido: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Valor inválido para -paytxfee=&lt;amount&gt;: '%s' (precisa ser no mínimo %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Máscara de rede especificada em -whitelist: '%s' é inválida</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Manter ao máximo &lt;n&gt; transações inconectáveis na memória (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Necessário informar uma porta com -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Opções de relay do nó :</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opções do servidor RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reduzindo -maxconnections de %d para %d, devido a limitações do sistema.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Re-escanear a block chain por transações faltantes na carteira durante a inicialização</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Mandar informação de trace/debug para o console em vez de para o arquivo debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Exibir todas opções de depuração (uso: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Encolher arquivo debug.log ao iniciar o cliente (padrão 1 se opção -debug não estiver presente)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Assinatura de transação falhou</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>O -walletdir \"%s\" especificado não existe</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>O -walletdir \"%s\" especificado é um caminho relativo</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>O -walletdir \"%s\" especificado não é um diretório</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>A quantidade da transação é pequena demais para  pagar a taxa</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Este é um software experimental.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Senha da porta de controle do Tor (padrão: vazio)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Porta de controle Tor a ser usada se escuta na onion estiver habilitado (padrão: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Quantidade da transação muito pequena</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transação muito grande para política de taxa</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transação muito grande</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Erro ao vincular em %s neste computador (bind retornou erro %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Não foi possível gerar as chaves iniciais</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Atualizar a carteira para o último formato na inicialização</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nome de usuário para conexões JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Verificando carteira(s)...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Carteira %s reside fora do diretório da carteira %s</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Atenção</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Aviso: Novas regras desconhecidas foram ativadas (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Quando operar em modo de blocos somente (padrãp: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Você precisa reconstruir o banco de dados usando -reindex para alterar -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Aniquilando todas as transações da carteira...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Opções de notificação ZeroMQ:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Senha para conexões JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Executa um comando quando o melhor bloco mudar (%s no comando será substituído pelo hash do bloco)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permitir consultas DNS para -addnode, -seednode e -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = manter metadados tx e.g. informação do dono da conta e requisição de pagamente, 2 = descartar metadados tx)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>A valor especificado de -maxtxfee está muito alto! Taxas grandes assim podem ser atribuidas numa transação única.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Vincular o endereço especificado para escutar conexões JSON-RPC. Esta opção é ignorada a menos que -rpcallowip também seja especificada. A porta é opcional e sobrepõe -rpcport. Use a notação [host]:port para IPv6. Essa opção pode ser especificada múltiplas vezes (Padrão: 127.0.0.1 e ::1 apenas localhost, ou se -rpcallowip for especificado, 0.0.0.0 e :: todos os endereços)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Não manter transações na mempool por mais que &lt;n&gt; horas (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Bytes por sigop em transações para relay e mineração (default: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Erro carregando %s: Não é permitido habilitar HD em uma carteira não-HD já existente</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Erro ao carregar carteira %s. O parâmetro -wallet deve somente especificar um nome de arquivo (não um caminho).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Taxas (em %s/kB) menores que isso serão consideradas como taxa zero para criação de transação (padrão %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Força a retransmissão de transações de pares da lista branca, mesmo quando violam a política local de retransmissão (default: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Quão completa a verificação de blocos do -checkblocks é (0-4, padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Mantém um índice completo de transações, usado pela chamada rpc getrawtransaction (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Número de segundos que pares mal comportados serão impedidos de reconectarem (padrão %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Informação de saída de debug (padrão: %u, definir &lt;category&gt; é opcional)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Define o retorno da serialização de transações cruas ou hex de bloco em modo não verbal, não segwit (0) ou segwit (1) (padrão: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Define diretório para guardar carteiras (padrão: &lt;datadir&gt;/wallets se existir, do contrário &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Especificar local do arquivo do log de depuração: pode ser um caminho absoluto ou um caminho relativo ao diretório de dados (padrão: \"%s\")</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Suportar filtragem de blocos e transações com filtros bloom (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>A taxa de imposto (em %s/kB) que indica sua tolerância para descartar trocos, adicionando-a na taxa (padrão: %s). Nota: Uma saída é descartada se for considerada poeira nesta taxa, mas sempre descartaremos no máximo até a taxa de retransmissão de poeira e descartar uma taxa acima disso, será limitada pela estimativa da taxa para o destino mais longo.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Esta é a taxa que você deve pagar quando a taxa estimada não está disponível.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Esse produto inclui um software desenvolvido pelo OpenSSL Project para uso na OpenSSL Toolkit %s e software criptográfico escrito por Eric Young e software UPnP escrito por Thomas Bernard. </translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>O tamanho total da string de versão da rede (%i) excede o tamanho máximo (%i). Reduza o número ou tamanho de uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Tenta manter tráfego de saída nos limites do alvo especificado (em MiB por 24h), 0 = sem limite (padrão: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Argumento inválido -socks encontrado. Definir a versão do SOCKS não é mais possível, somente proxys SOCK5 são suportados.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Argumento não suportado -whitelistalwaysrelay foi ignorado, utilize -whitelistrelay e/ou -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Use um proxy SOCKS5 separado para alcançar participantes da rede via serviços ocultos Tor (padrão: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Aviso: Versões de bloco desconhecidas sendo mineradas! É possível que regras desconhecidas estejam ativas</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Atenção: Arquivo da carteira corrompido, dados recuperados! Original %s salvo como %s em %s; se seu saldo ou transações estiverem incorretos, você deve restaurar o backup.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Inclui na lista branca pares conectando do dado endereço IP (ex: 1.2.3.4) ou rede em notação CIDR (ex: 1.2.3.0/24). Pode ser especificado várias vezes.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s está muito alto!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(padrão: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Sempre pergunte pelo endereço de peer via pesquisa DNS (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Erro ao carregar carteira %s. Nome do arquivo de -wallet deve ser um arquivo regular.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Erro ao carregar carteira %s. Duplicado o nome do arquivo de -wallet.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Erro ao carregar carteira %s. Caracteres inválidos no nome do arquivo de -wallet.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Quantos blocos devem ser checados ao iniciar (padrão: %u, 0 = todos)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Incluir endereço IP na saída de depuração (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Keypool exaurida, por gentileza execute keypoolrefill primeiro</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escutar por conexões JSON-RPC na porta &lt;port&gt; (padrão: %u ou testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Aguardar por conexões na porta &lt;port&gt; (padrão: %u ou testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Manter, no máximo, &lt;n&gt; conexões com pares (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Fazer a carteira transmitir transações</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Buffer máximo de recebimento por conexão, &lt;n&gt;*1000 bytes (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Buffer máximo de envio por conexão, &lt;n&gt;*1000 bytes (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Adiciona timestamp como prefixo no debug (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Minere e faça retransmição de transações de operadores de dados (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Retransmitir P2SH não multisig (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Defina o tamanho do keypool &lt;n&gt; (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Define a altura máxima do bloco para o BIP141 (padrão: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Defina o número de threads para chamadas do serviço RPC (padrão: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Especificar arquivo de configuração (padrão: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Especificar tempo para desistência de conexões, em milissegundos (mínimo: 1, padrão: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Especificar arquivo pid (padrão: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Gastar troco não confirmado quando enviar transações (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Iniciando threads de rede...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>A carteira irá evitar pagar menos que a taxa mínima de retransmissão.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Esta é a taxa mínima que você paga em todas as transação.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Esta é a taxa que você irá pagar se enviar uma transação.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Limite para desconectar pares mal comportados (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>As quantidades nas transações não podem ser negativas.</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>A transação demorou muito na memória</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>A transação deve ter ao menos um destinatário</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Rede desconhecida especificada em -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Saldo insuficiente</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Carregando índice de blocos...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Carregando carteira...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Não é possível fazer downgrade da carteira</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Re-escaneando...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Carregamento terminado!</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_pt_PT.ts",
    "content": "<TS language=\"pt_PT\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Clique com o botão direito para editar o endereço ou etiqueta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Criar um novo endereço</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Novo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiar o endereço selecionado para a área de transferência do sistema</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiar</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>F&amp;echar</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Eliminar o endereço selecionado da lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar os dados no separador atual para um ficheiro</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Eliminar</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Escolha o endereço para enviar as moedas</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Escolha o endereço para receber as moedas</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Escol&amp;her</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>A enviar endereços</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>A receber endereços</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Estes são os seus endereços Bitcoin para enviar pagamentos. Verifique sempre o valor e o endereço de envio antes de enviar moedas.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Estes são os seus endereços Bitcoin para receber pagamentos. É recomendado que utilize um endereço novo para cada transacção.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copiar Endereço</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copiar &amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Editar</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportar Lista de Endereços</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Ficheiro separado por vírgulas (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportação Falhou</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Ocorreu um erro ao tentar guardar a lista de endereços para %1. Por favor, tente novamente.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Endereço</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Janela da Frase de Segurança</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Insira a frase de segurança</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nova frase de frase de segurança</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repita a nova frase de frase de segurança</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Mostrar palavra-passe</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Insira a nova frase de segurança para a carteira. &lt;br/&gt; Por favor, utilize uma frase de segurança de &lt;b&gt;10 ou mais carateres aleatórios,&lt;/b&gt; ou &lt;b&gt;oito ou mais palavras&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Encriptar carteira</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Esta operação precisa da sua frase de segurança da carteira para desbloquear a mesma.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Desbloquear carteira</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Esta operação precisa da sua frase de segurança da carteira para desencriptar a mesma.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Desencriptar carteira</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Alterar frase de segurança</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Insira a frase de segurança antiga e a nova frase de segurança para a carteira.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirmar encriptação da carteira</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Aviso: se encriptar a sua carteira e perder a sua frase de segurnça, &lt;b&gt;PERDERÁ TODOS OS SEUS BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Tem a certeza que deseja encriptar a sua carteira?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Carteira encriptada</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 irá agora ser fechado para terminar o processo de encriptação. Recorde que a encriptação da sua carteira não protegerá totalmente os seus bitcoins de serem roubados por programas maliciosos que infectem o seu computador.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANTE: Qualquer cópia de segurança da carteira anterior deverá ser substituída com o novo ficheiro de carteira, agora encriptado. Por razões de segurança, cópias de segurança não encriptadas tornar-se-ão inúteis assim que começar a usar a nova carteira encriptada.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Encriptação da carteira falhou</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>A encriptação da carteira falhou devido a um erro interno. A carteira não foi encriptada.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>As frases de segurança fornecidas não coincidem.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Desbloqueio da carteira falhou</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>A frase de segurança introduzida para a desencriptação da carteira estava incorreta.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Desencriptação da carteira falhou</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>A frase de segurança da carteira foi alterada com sucesso.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Aviso: a tecla Caps Lock está ligada!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Máscara de Rede</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Banido Até</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Assinar &amp;mensagem...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>A sincronizar com a rede...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Resumo</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nó</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Mostrar resumo geral da carteira</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transações</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Explorar histórico das transações</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Fec&amp;har</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Sair da aplicação</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Sobre o %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Mostrar informação sobre o %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Sobre o &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Mostrar informação sobre o Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opções...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modificar opções de configuração para %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>E&amp;ncriptar Carteira...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Efetuar &amp;Cópia de Segurança da Carteira...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Alterar &amp;Frase de Segurança...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>A &amp;enviar os endereços...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>A &amp;receber os endereços...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Abrir &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Clique para desativar a atividade de rede.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Atividade de rede desativada.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Clique para ativar novamente a atividade de rede.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>A sincronizar cabeçalhos (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>A reindexar os blocos no disco...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Enviar moedas para um endereço Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Efetue uma cópia de segurança da carteira para outra localização</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Alterar a frase de segurança utilizada na encriptação da carteira</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Janela de &amp;Depuração</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Abrir consola de diagnóstico e depuração</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verificar mensagem...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Carteira</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Enviar</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Receber</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>Mo&amp;strar / Ocultar</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Mostrar ou ocultar a janela principal</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Encriptar as chaves privadas que pertencem à sua carteira</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Assine as mensagens com os seus endereços Bitcoin para provar que é o proprietário dos mesmos</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifique mensagens para assegurar que foram assinadas com o endereço Bitcoin especificado</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Ficheiro</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Configurações</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ajuda</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Barra de ferramentas dos separadores</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Solicitar pagamentos (gera códigos QR e bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Mostrar a lista de rótulos e endereços de envio usados</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Mostrar a lista de rótulos e endereços de receção usados</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Abrir URI bitcoin: ou pedido de pagamento</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Opções da linha de &amp;comando</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n ligação ativa à rede Bitcoin</numerusform><numerusform>%n ligações ativas à rede Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>A indexar blocos no disco...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>A processar blocos no disco...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Processado %n bloco do histórico de transações.</numerusform><numerusform>Processados %n blocos do histórico de transações.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 em atraso</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>O último bloco recebido foi gerado há %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>As transações depois de isto ainda não serão visíveis.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Aviso</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informação</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Atualizado</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Mostrar a mensagem de ajuda %1 para obter uma lista com possíveis opções a usar na linha de comandos.</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>Cliente %1</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>A ligar aos pontos...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Recuperando o atraso...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Valor: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tipo: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etiqueta: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Endereço: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transação enviada</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transação recebida</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Criação de chave HD está &lt;b&gt;ativada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Criação de chave HD está &lt;b&gt;desativada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>A carteira está &lt;b&gt;encriptada&lt;/b&gt; e atualmente &lt;b&gt;desbloqueada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>A carteira está &lt;b&gt;encriptada&lt;/b&gt; e atualmente &lt;b&gt;bloqueada&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Ocorreu um erro fatal. O Bitcoin não pode continuar com segurança e irá fechar.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Seleção de Moeda</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantidade:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Valor:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Taxa:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Lixo:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Depois da taxa:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Troco:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(des)selecionar todos</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Modo de árvore</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Modo de lista</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Valor</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Recebido com etiqueta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Recebido com endereço</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmações</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmada</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar endereço</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar valor</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar Id. da transação</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Bloquear não gasto</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Desbloquear não gasto</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar quantidade</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar taxa</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar depois da taxa</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar poeira</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar troco</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 bloqueado)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>sim</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>não</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Esta etiqueta fica vermelha se qualquer destinatário recebe um valor menor que o limite de dinheiro.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Pode variar +/- %1 satoshi(s) por input.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem etiqueta)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>troco de %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(troco)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editar Endereço</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiqueta</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>A etiqueta associada com esta entrada da lista de endereços</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>O endereço associado com o esta entrada da lista de endereços. Isto só pode ser modificado para os endereços de envio.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>E&amp;ndereço</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Novo endereço de depósito</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Novo endereço de envio</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Editar o endereço de depósito</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Editar o endereço de envio</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>O endereço introduzido \"%1\" não é um endereço bitcoin válido.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>O endereço introduzido \"%1\" já se encontra no livro de endereços.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Não foi possível desbloquear a carteira.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>A criação da nova chave falhou.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Será criada uma nova diretoria de dados.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nome</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>A pasta já existe. Adicione %1 se pretender criar aqui uma nova pasta.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>O caminho já existe, e este não é uma pasta.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Não é possível criar aqui uma diretoria de dados.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versão</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Sobre o %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opções da linha de comando</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Utilização:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>opções da linha de comando</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opções da IU:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Escolher a pasta de dados no arranque (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Definir idioma, por exemplo \"pt_PT\" (predefinição: idioma do sistema)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Iniciar minimizado</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Definir certificados de raiz SSL para pedidos de pagamento (predefinição: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Mostrar o ecrã de abertura no arranque (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Redefinir todas as definições alteradas na GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bem-vindo</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Bem-vindo ao %1.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Utilizar a pasta de dados predefinida</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Utilizar uma pasta de dados personalizada:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Aproximadamente %1 GB de dados irão ser guardados nesta directoria. </translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>A carteira também será guardada nesta directoria.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Erro: não pode ser criada a pasta de dados especificada como \"%1.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB de espaço livre disponível</numerusform><numerusform>%n GB de espaço livre disponível</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(de %n GB necessários)</numerusform><numerusform>(de %n GB necessário)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulário</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Transações recentes podem não ser visíveis por agora, portanto o saldo da sua carteira pode estar incorreto. Esta informação será corrigida quando a sua carteira acabar de sincronizar com a rede, como está explicado em baixo.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Tentar enviar bitcoins que estão afetadas por transações ainda não exibidas não será aceite pela rede.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Número de blocos restantes</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Desconhecido...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Data do último bloco</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progresso</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Aumento horário do progresso</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>a calcular...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>tempo restante estimado até à sincronização</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ocultar</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Desconhecido. Sincronização de Cabeçalhos (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Abir URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Abrir pedido de pagamento de um URI ou ficheiro</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Selecione o ficheiro de pedido de pagamento</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Selecione o ficheiro de pedido de pagamento para abrir</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opções</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Principal</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Iniciar automaticamente o %1 depois de iniciar a sessão no sistema.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Iniciar o %1 no início de sessão do sistema</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Tamanho da cache da base de &amp;dados</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Número de processos de &amp;verificação de scripts</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Endereço de IP do proxy (exemplo, IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Esconder o ícone da barra de ferramentas.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Ocultar ícone da bandeja</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimize ao invés de sair da aplicação quando a janela é fechada. Com esta  opção selecionada, a aplicação apenas será encerrada quando escolher Sair da aplicação no menú.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URLs de outrem (ex. um explorador de blocos) que aparece no separador de transações como itens do menu de contexto.\n%s do URL é substituído por hash de transação. Vários URLs são separados por barra vertical |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Ativar as opções da linha de comando que se sobrepõem às opções acima:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Abrir o ficheiro de configuração %1 do diretório aberto.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Abrir Ficheiro de Configuração</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Repor todas as opções de cliente para a predefinição.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Repor Opções</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Rede</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automático, &lt;0 = deixar essa quantidade de núcleos livre)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>C&amp;arteira</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation> Técnicos</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Ativar as funcionalidades de &amp;controlo de moedas</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Se desativar o gasto de troco não confirmado, o troco de uma transação não pode ser utilizado até que essa transação tenha pelo menos uma confirmação. Isto também afeta o cálculo do seu saldo.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Gastar troco não confirmado</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Abrir a porta do cliente bitcoin automaticamente no seu router. Isto apenas funciona se o seu router suportar UPnP e este se encontrar ligado.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapear porta, utilizando &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Aceitar ligações externas.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Permitir ligações de \"a receber\"</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Conectar à rede da Bitcoin através dum proxy SOCLS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Ligar através dum proxy SOCKS5 (proxy por defeito):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP do proxy:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Porto:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Porto do proxy (p.ex. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Utilizado para alcançar pontos via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Ligar à rede Bitcoin através de um proxy SOCKS5 separado para utilizar os serviços ocultos do Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Janela</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Apenas mostrar o ícone da bandeja de sistema após minimizar a janela.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimizar para a bandeja de sistema e não para a barra de ferramentas</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimizar ao fechar</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Visualização</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Linguagem da interface de utilizador:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>A linguagem da interface do utilizador pode ser definida aqui. Esta definição entrará em efeito após reiniciar %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unidade para mostrar quantias:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Escolha a unidade da subdivisão predefinida para ser mostrada na interface e quando enviar as moedas.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Escolha se deve mostrar as funcionalidades de controlo de moedas ou não.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>URLs de transação de &amp;terceiros</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Cancelar</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>predefinição</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>nenhum</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirme a reposição das opções</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>É necessário reiniciar o cliente para ativar as alterações.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>O cliente será desligado. Deseja continuar?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Opções da configuração</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Não foi possível abrir o ficheiro de configuração.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Esta alteração obrigará a um reinício do cliente.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>O endereço de proxy introduzido é inválido. </translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulário</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>A informação mostrada poderá estar desatualizada. A sua carteira sincroniza automaticamente com a rede Bitcoin depois de estabelecer ligação, mas este processo ainda não está completo.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Modo-verificação:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponível:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>O seu saldo (gastável) disponível</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pendente:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Total de transações por confirmar, que ainda não estão contabilizadas no seu saldo gastável</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Imaturo:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>O saldo minado ainda não amadureceu</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Balanços</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>O seu saldo total actual</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>O seu balanço atual em endereços de apenas observação</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Dispensável:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>transações recentes</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Transações não confirmadas para endereços modo-verificação</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Saldo minado ainda não disponivél de endereços modo-verificação</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Saldo disponivél em enderços modo-verificação</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Erro do pedido de pagamento</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Impossível iniciar o controlador de bitcoin: click-to-pay</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Manuseamento de URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>O URL do pedido de pagamento é inválido: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Endereço de pagamento inválido %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI não foi lido correctamente! Isto pode ser causado por um endereço Bitcoin inválido ou por parâmetros URI malformados.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Controlo de pedidos de pagamento.</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>O ficheiro de pedido de pagamento não pôde ser lido! Isto pode ter sido causado por um ficheiro de pedido de pagamento inválido.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Pedido de pagamento rejeitado</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Rede de requisição de pagamento não corresponde com a rede do cliente.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Pedido de pagamento expirado.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>O pedido de pagamento não foi inicializado.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Pedidos de pagamento não-verificados para scripts de pagamento personalizados não são suportados.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Pedido de pagamento inválido.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Quantia solicitada para pagamento de %1 é muito pequena (considerada \"pó\").</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Reembolso de %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Pedido de pagamento %1 é demasiado grande (%2 bytes, permitido %3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Erro ao comunicar com %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>O pedido de pagamento não pode ser lido ou processado!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Má resposta do servidor %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Erro de pedido de rede</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Pagamento confirmado</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Agente Usuário</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nó/Serviço</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>NodeId</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Latência</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recebido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Quantia</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Entre um endereço Bitcoin (ex. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Nenhum</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n segundo</numerusform><numerusform>%n segundos</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minuto</numerusform><numerusform>%n minutos</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n dia</numerusform><numerusform>%n dias</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n semana</numerusform><numerusform>%n semanas</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 e %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n anos</numerusform><numerusform>%n anos</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 ainda não foi fechado em segurança...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconhecido</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Erro: Pasta de dados especificada \"%1\" não existe.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Erro: não é possível analisar o ficheiro de configuração: %1. Utilize apenas a sintaxe key=value.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Erro: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Guardar Imagem...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copiar Imagem</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Guardar o código QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imagem PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/D</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versão do Cliente</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informação</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Janela de depuração</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Geral</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Versão BerkeleyDB em uso</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Hora de Arranque</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Rede</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nome</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Número de ligações</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Cadeia de blocos</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Número actual de blocos</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Banco de Memória</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Número actual de transacções</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Utilização de memória</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Reiniciar</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recebido</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Enviado</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Pontos</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Pontos banidos</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Selecione um ponto para ver informação detalhada.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Permitido por si</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direcção</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versão</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Bloco Inicial</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Cabeçalhos Sincronizados</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Blocos Sincronizados</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Agente Usuário</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Abrir o ficheiro de registo de depuração %1 da pasta de dados actual. Isto pode demorar alguns segundos para ficheiros de registo maiores.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Diminuir tamanho da letra</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Aumentar tamanho da letra</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Serviços</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Resultado da Suspensão</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Tempo de Ligação</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Ultimo Envio</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Ultimo Recebimento</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Tempo de Latência</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>A duração de um ping atualmente pendente.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Espera do Ping</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Latência mínima</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Fuso Horário</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Data do último bloco</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Abrir</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Tráfego de Rede</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totais</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Entrada:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Saída:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Ficheiro de registo de depuração</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Limpar consola</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hora</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;dia</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;semana</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;ano</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Banir para</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Desbanir</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Bem-vindo à consola RPC da %1.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Para mais informação em como utilizar esta consola, digite %1.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Atividade de rede desativada</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(id nó: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nunca</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Entrada</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Saída</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Sim</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Não</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Desconhecido</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Quantia:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Rótulo:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Mensagem:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Uma mensagem opcional para anexar ao pedido de pagamento, que será exibida quando o pedido for aberto. Nota: A mensagem não será enviada com o pagamento através da rede Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Um rótulo opcional a associar ao novo endereço de receção.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Utilize este formulário para solicitar pagamentos. Todos os campos são &lt;b&gt;opcionais&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Uma quantia opcional a solicitar. Deixe em branco ou zero para não solicitar uma quantidade específica.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Limpar todos os campos do formulário.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Limpar</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Histórico de pagamentos solicitados</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Requisitar Pagamento</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Mostrar o pedido seleccionado (faz o mesmo que clicar 2 vezes numa entrada)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Mostrar</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Remover as entradas seleccionadas da lista</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Remover</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copiar URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copiar mensagem</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar valor</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Código QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copiar &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copi&amp;ar Endereço</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Salvar Imagem...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Requisitar Pagamento para %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informação de Pagamento</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Endereço</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Valor</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensagem</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI resultante muito longo. Tente reduzir o texto do rótulo / mensagem.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Erro ao codificar URI em Código QR.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensagem </translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem etiqueta)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(sem mensagem)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(sem quantia pedida)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Solicitado</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar Moedas</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Funcionalidades do Controlo de Moedas:</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Entradas...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>selecionadas automáticamente</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fundos insuficientes!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Quantidade:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Quantia:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Taxa:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Depois da taxa:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Troco:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Se isto estiver ativo, mas o endereço de troco estiver vazio ou for inválido, o troco será enviado para um novo endereço gerado.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Endereço de troco personalizado</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Taxa da transação:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Escolher...</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Aviso: atualmente, não é possível a estimativa da taxa.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>ocultar definições de taxa</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>por kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Se a taxa personalizada estiver definida para 1.000 satoshis e a transação é de apenas 250 bytes, então paga apenas 250 satoshis \"por kilobyte\" na taxa, enquanto em \"total pelo menos\" paga 1.000 satoshis. Para transações superiores a um kilobyte ambos pagam por kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Esconder</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Pode pagar somente a taxa minima desde que haja um volume de transações inferior ao espaço nos blocos. No entanto tenha em atenção que esta opção poderá acabar em uma transação nunca confirmada assim que os pedidos de transações excedam a capacidade de processamento da rede.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(leia a dica)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recomendado:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Uso:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(A taxa inteligente ainda não foi inicializada. Isto normalmente demora alguns blocos...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Enviar para múltiplos destinatários de uma vez</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Adicionar &amp;Destinatário</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Limpar todos os campos do formulário.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Lixo:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Tempo de confirmação:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Limpar &amp;Tudo</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirme ação de envio</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>E&amp;nviar</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiar quantidade</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar valor</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiar taxa</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiar depois da taxa</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiar bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiar pó</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiar troco</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 para %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Tem a certeza que deseja enviar?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>adicionado como taxa de transação</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Quantia Total %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>ou</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirme envio de moedas</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>O endereço do destinatário é inválido. Por favor, reverifique.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>O valor a pagar dever maior que 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>O valor excede o seu saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>O total excede o seu saldo quando a taxa de transação %1 está incluída.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Endereço duplicado encontrado: os endereços devem ser usados ​​apenas uma vez.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>A criação da transação falhou!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>A transação foi rejeitada pelo seguinte motivo: %1\n</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Uma taxa superior a %1 é considerada uma taxa altamente absurda.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Pedido de pagamento expirado.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Pague apenas a taxa obrigatória de %1</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Aviso: endereço Bitcoin inválido</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Aviso: endereço de troco desconhecido</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Confirmar endereço de troco personalizado</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>O endereço que você selecionou para alterar não faz parte desta carteira. Qualquer ou todos os fundos em sua carteira podem ser enviados para este endereço. Você tem certeza?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem etiqueta)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Qu&amp;antia:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Pagar A:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>Rótu&amp;lo:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escolha o endereço utilizado anteriormente</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Este é um pagamento normal.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>O endereço Bitcoin para enviar o pagamento</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Cole endereço da área de transferência</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Remover esta entrada</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>A taxa será deduzida ao valor que está a ser enviado. O destinatário irá receber menos bitcoins do que as que inseridas no campo do valor. Se estiverem selecionados múltiplos destinatários, a taxa será repartida equitativamente.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>S&amp;ubtrair a taxa ao montante</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Utilizar saldo disponível</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mensagem:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Pedido de pagamento não autenticado.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Pedido de pagamento autenticado.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Introduza um rótulo para este endereço para o adicionar à sua lista de endereços usados</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Uma mensagem que estava anexada ao URI bitcoin: que será armazenada com a transação para sua referência. Nota: Esta mensagem não será enviada através da rede Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pagar a:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memorando:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Digite um rótulo para este endereço para adicioná-lo ao seu catálogo de endereços</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Sim</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 está a encerrar...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Não desligue o computador enquanto esta janela não desaparecer.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Assinaturas - Assinar / Verificar uma Mensagem</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Assinar Mensagem</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Pode assinar mensagens com os seus endereços para provar que são seus. Tenha atenção ao assinar mensagens ambíguas, pois ataques de phishing podem tentar enganá-lo de modo a assinar a sua identidade para os atacantes. Apenas assine declarações detalhadas com as quais concorde.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>O endereço Bitcoin para designar a mensagem</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Escolha o endereço utilizado anteriormente</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Colar endereço da área de transferência</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Escreva aqui a mensagem que deseja assinar</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Assinatura</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copiar a assinatura actual para a área de transferência</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Assine uma mensagem para provar que é dono deste endereço Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Assinar &amp;Mensagem</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Repor todos os campos de assinatura de mensagem</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Limpar &amp;Tudo</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verificar Mensagem</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Introduza o endereço de assinatura, mensagem (assegure-se que copia quebras de linha, espaços, tabulações, etc. exactamente) e assinatura abaixo para verificar a mensagem. Tenha atenção para não ler mais na assinatura do que o que estiver na mensagem assinada, para evitar ser enganado por um atacante que se encontre entre si e quem assinou a mensagem.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>O endereço Bitcoin com que a mensagem foi designada</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verifique a mensagem para assegurar que foi assinada com o endereço Bitcoin especificado</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verificar &amp;Mensagem</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Repor todos os campos de verificação de mensagem</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Clique \"Assinar Mensagem\" para gerar a assinatura</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>O endereço introduzido é inválido.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Por favor, verifique o endereço e tente novamente.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>O endereço introduzido não refere-se a nenhuma chave.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>O desbloqueio da carteira foi cancelado.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>A chave privada para o endereço introduzido não está disponível.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Assinatura da mensagem falhou.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Mensagem assinada.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Não foi possível descodificar a assinatura.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Por favor, verifique a assinatura e tente novamente.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>A assinatura não corresponde com o conteúdo da mensagem.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Verificação da mensagem falhou.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Mensagem verificada.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[rede de testes]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Aberto até %1</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/off-line</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/não confirmada, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>no banco de memória</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>não está no banco de memória</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandonada</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/não confirmada</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 confirmações</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Estado</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, ainda não foi transmitido com sucesso</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Origem</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Gerado</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>De</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>desconhecido</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Para</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>endereço próprio</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>vigiar apenas</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiqueta</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Crédito</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>não aceite</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Débito</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Débito total</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Crédito total</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Taxa de transação</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Valor líquido</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mensagem</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comentário</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Id. da Transação</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Tamanho total da transição</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Índex de saída</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Comerciante</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Informação de depuração</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transação</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Entradas</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Valor</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>verdadeiro</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>falso</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Esta janela mostra uma descrição detalhada da transação</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detalhes para %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Aberto para mais %n bloco</numerusform><numerusform>Aberto para mais %n blocos</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Aberto até %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Off-line</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Não confirmado</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandonada</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmada (%1 confirmações)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Incompatível</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Este bloco não foi recepcionado por outro nó e provavelente não será aceite!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Gerada mas não aceite</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recebido com</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Recebido de</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviado para</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pagamento para si mesmo</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minada</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>vigiar apenas</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/d)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(sem etiqueta)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Estado da transação. Passar o cursor por cima deste campo para mostrar o número de confirmações.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Data e hora em que a transação foi recebida.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipo de transação.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Montante retirado ou adicionado ao saldo</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Todas</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Hoje</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Esta semana</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Este mês</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Mês passado</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Este ano</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Período...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recebido com</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Enviado para</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Para si mesmo</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minada</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Outras</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Valor mín.</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Abandonar transação</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Aumentar taxa da transação</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiar endereço</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiar etiqueta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiar valor</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiar Id. da transação</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copiar transação em bruto</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copiar detalhes completos da transação</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Editar etiqueta</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Mostrar detalhes da transação</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exportar Histórico de Transações</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Ficheiro separado por vírgulas (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmada</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Vigiar apenas</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tipo</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiqueta</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Endereço</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>Id.</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportação Falhou</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exportação Bem Sucedida</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Período:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>até</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unidade de valores recebidos. Clique para selecionar outra unidade.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Nenhuma carteira foi carregada</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Enviar Moedas</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Taxa atual:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Aumentar:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nova taxa:</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Não é possível assinar a transação.</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportar</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportar os dados no separador atual para um ficheiro</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Cópia de Segurança da Carteira</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Dados da Carteira (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Cópia de Segurança Falhou</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Ocorreu um erro ao tentar guardar os dados da carteira em %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Cópia de Segurança Bem Sucedida</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opções:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Especificar pasta de dados</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Ligar a um nó para recuperar endereços de pontos, e desligar</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Especifique o seu endereço público</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Aceitar comandos de linha de comandos e JSON-RPC</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Se &lt;category&gt; não é fornecida ou &lt;category&gt; = 1, imprimir toda a informação de depuração.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Poda configurada abaixo do mínimo de %d MiB.  Por favor, utilize um valor mais elevado.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Suprimir: a última sincronização da carteira vai além dos dados suprimidos. O que precisa para -reindex (transferir novamente toda a cadeia de blocos, no caso de nó suprimido)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Reanálises não são possíveis no modo de suprimir. Para isso terá de utilizar -reindex que irá transferir novamente toda a cadeia de blocos.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Erro: Um erro fatal interno ocorreu, verificar debug.log para mais informação</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Taxa (em %s/kB) para adicionar às transações que envia (predefinição: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>A podar a blockstore...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Correr o processo em segundo plano e aceitar comandos</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Não é possível iniciar o servidor HTTP. Verifique o debug.log para detalhes.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Os programadores de %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Uma percentagem da taxa (em %s/kB) que será utilizada quando a estimativa da taxa tiver dados insuficientes (predefinição: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Aceitar as transações retransmitidas recebidas dos pontos na lista branca, mesmo quando não retransmitir as transações (predefinição: %d)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Associar a endereço específico e escutar sempre nele. Use a notação [anfitrião]:porta para IPv6</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Apague todas as transações da carteira e somente restore aquelas que façam parte do blockchain através de re-scan ao reiniciar o programa</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Executar o comando quando uma transação da carteira muda (no comando, %s é substituído pela Id. da Transação)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Por favor verifique que a data e hora do seu computador estão certos! Se o relógio não estiver certo, o %s não funcionará corretamente.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Consultar por endereços de ponto via procura de DNS, se tiver poucos endereços (predefinição: 1, a menos que use -connect)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Defina o número de processos de verificação (%u até %d, 0 = automático, &lt;0 = ldisponibiliza esse número de núcleos livres, por defeito: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>A base de dados de blocos contém um bloco que aparenta ser do futuro. Isto pode ser causado por uma data incorrecta definida no seu computador. Reconstrua apenas a base de dados de blocos caso tenha a certeza de que a data e hora do seu computador estão correctos.</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Utilizar UPnP para mapear a porta de escuta (predefinição: 1 quando escutar e sem -proxy)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Aviso: a rede não parece estar completamente de acordo! Parece que alguns mineiros estão com dificuldades técnicas.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Aviso: parece que nós não estamos de acordo com os nossos pontos! Poderá ter que atualizar, ou outros pontos podem ter que ser atualizados.</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d dos últimos 100 blocos têm uma versão inesperada</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>- máximo do banco de memória deverá ser pelo menos %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;categoria&gt; pode ser:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Aceitar ligações externas (padrão: 1 sem -proxy ou -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Anexar um comentário para a entrada de agente do utilizador</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Tentar reuperar as chaves privadas de um \"wallet\" ao iniciar</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opções da criação de bloco:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Não é possível resolver -%s endereço '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Opções de seleção da cadeia:</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opções de ligação:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Direitos de Autor (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Cadeia de blocos corrompida detectada</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opções de Depuração/Teste:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Não carregar a carteira e desativar as chamadas de RPC da carteira.</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Deseja reconstruir agora a base de dados de blocos.</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Activar publicação do hash do bloco em &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Activar publicação do hash da transacção em &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Activar publicação de dados brutos do bloco em &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Activar publicação de dados brutos da transacção em &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Ativar substituição da transação no banco de memória (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Erro ao inicializar a cadeia de blocos</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Erro ao inicializar o ambiente %s da base de dados da carteira</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Erro ao carregar %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Erro ao carregar %s: carteira corrompida</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Erro ao carregar %s: a carteira requer a nova versão de %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Erro ao carregar base de dados de blocos</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Erro ao abrir a base de dados de blocos</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Erro: Pouco espaço em disco!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Falhou a escutar em qualquer porta. Use -listen=0 se quiser isto.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>A importar...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Bloco génese incorreto ou nenhum bloco génese encontrado. Pasta de dados errada para a rede?</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Valor inválido para -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Valor inválido para -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Manter o banco de memória da transação abaixo de &lt;n&gt; megabytes (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>A carregar endereços de P2P...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>A carregar a lista de banir...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Localização de cookie de autorização (predefinição: diretoria de dados)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Os descritores de ficheiros disponíveis são insuficientes.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Somente conectar aos nodes na rede &lt;net&gt; (ipv4, ipv6 ou onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Imprimir esta mensagem de ajuda e sair</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Imprimir versão e sair</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Poda não pode ser configurada com um valor negativo.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Modo poda é incompatível com -txindex.</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Definir o tamanho da cache de base de dados em megabytes (%d a %d, padrão: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Especifique ficheiro de carteira (dentro da pasta de dados)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Argumento não suportado -benchmark ignorado, use -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Argumento não suportado -debugnet ignorado, use -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Argumento não suportado -tor encontrado, use -onion.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>A atualizar a base de dados UTXO</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Utilizar UPnP para mapear a porta de escuta (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Utilize a cadeia de testes</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Comentário no User Agent (%s) contém caracteres inseguros.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>A verificar blocos...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Opções de depuração/testes da carteira:</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opções da carteira:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Permitir conexções JSON-RPC de fontes especificas. Valido para &lt;ip&gt; um unico IP (ex. 1.2.3.4), uma rede/netmask (ex. 1.2.3.4/255.255.255.0) ou uma rede/CIDR (ex. 1.2.3.4/24). Esta opção pode ser especificada varias vezes</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Associar ao endereço indicado e pontos da lista branca ligando-se a ele. Utilize a notação [anfitrião]:porta para IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Crie ficheiros novos com as permisões predefinidas do sistema, em vez de umask 077 (apenas eficaz caso a funcionalidade carteira esteja desactivada)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Descobrir o próprio endereço IP (padrão: 1 ao escutar e sem -externalip ou -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Erro: A escuta de ligações de entrada falhou (escuta devolveu erro %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Executar comando quando um alerta relevante for recebido ou em caso de uma divisão longa da cadeia de blocos (no comando, %s é substituído pela mensagem)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Taxas (em %s/kB) inferiores a este valor são consideradas nulas para propagação, mineração e criação de transações (predefinição: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Caso o paytxfee não seja definido, inclua uma taxa suficiente para que as transacções comecem a ser confirmadas, em média, dentro de n blocos (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Montante inválido para -maxtxfee=&lt;amount&gt;: '%s' (deverá ser, no mínimo , a taxa mínima de propagação de %s, de modo a evitar transações bloqueadas)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Tamanho máximo dos dados em transacções que incluem dados que propagamos e mineramos (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Usar credenciais aleatórias por cada ligação proxy. Permite que o Tor use stream isolation (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>O montante da transacção é demasiado baixo após a dedução da taxa</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Os pontos enviados para a lista branca não podem ser DoS banidos e as suas transações são sempre retransmitidas, mesmo que já estejam no banco de memória, útil, por exemplo, para um acesso</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>É necessário reconstruir a base de dados, utilizando -reindex para voltar ao modo de suprimir. Isto irá transferir novamente a cadeia de blocos completa</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Aceitar pedidos REST públicos (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Criar automaticamente o serviço Tor oculto (predefinição: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Ligar através de um proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Erro ao ler da base de dados, encerrando.</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importar blocos de um ficheiro blk000??.dat externo ao iniciar</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informação</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Endereço -onion ou hostname inválido: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Montante inválido para -paytxfee=&lt;amount&gt;: '%s' (deverá ser no mínimo %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Máscara de rede inválida especificada em -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Manter no máximo &lt;n&gt; transacções órfãs em memória (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Necessário especificar uma porta com -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Opções da transmissão de nós:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opções do servidor RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reduzindo -maxconnections de %d para %d, devido a limitações no sistema.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Procurar transacções em falta na cadeia de blocos ao iniciar</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Enviar informação de rastreio/depuração para a consola e não para o ficheiro debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Mostrar todas as opções de depuração (utilização: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Encolher ficheiro debug.log ao iniciar o cliente (por defeito: 1 sem -debug definido)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Falhou assinatura da transação</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>O montante da transacção é demasiado baixo para pagar a taxa</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Isto é software experimental.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Palavra-passe da porta de controlo Tor (predefinição: vazio)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Porta de controlo Tor a utilizar se a escuta cebola estiver ativada (predefinição: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Quantia da transação é muito baixa</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transacção demasiado grande para a política de taxas</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transação grande demais</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Incapaz de vincular à porta %s neste computador (vínculo retornou erro %s)</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Actualizar carteira para o formato mais recente ao iniciar</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Nome de utilizador para ligações JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>A verificar a(s) carteira(s)...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Aviso</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Aviso: ativadas novas regras desconhecidas (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Se operar apenas num modo de blocos (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>A limpar todas as transações da carteira...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Opções de notificação ZeroMQ:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Palavra-passe para ligações JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Executar o comando quando o melhor bloco muda (no comando, %s é substituído pela hash do bloco)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permitir procuras DNS para -addnode, -seednode e -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = guardar metadados da transacção ex: proprietário da conta e informação do pedido de pagamento, 2 = descartar metadados da transacção)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee está definido com um valor muito alto! Taxas desta magnitude podem ser pagas numa única transacção.</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Não guardar transações no banco de memória por mais de &lt;n&gt; horas (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Taxas (em %s/kB) abaixo deste valor são consideradas nulas para a criação de transacções (padrão: %s)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Minuciosidade da verificação de blocos para -checkblocks é (0-4, padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Manter um índice de transacções completo, usado pela chamada RPC getrawtransaction (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Número de segundos a impedir que os pontos com mau comportamento se religuem (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Informação de depuração (padrão: %u, fornecer uma &lt;category&gt; é opcional)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Suportar filtragem de blocos e transacções com fitros bloom (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Esta é a taxa de transação que poderá pagar quando as estimativas da taxa não estão disponíveis.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Este produto inclui software desenvolvido pelo Projeto de OpenSSL para utilização no OpenSSL Toolkit %s e software criptográfico escrito por Eric Young e software UPnP escrito por Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Comprimento total da entrada da versão de rede (%i) excede o comprimento máximo (%i). Reduzir o número ou o tamanho de uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Tenta manter o tráfego externo abaixo do limite especificado (em MiB por 24h), 0 = sem limite (padrão: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Encontrado um argumento não suportado -socks. Definir a versão do SOCKS já não é possível, apenas proxies SOCKS5 são suportados.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Argumento não suportado -whitelistalwaysrelay ignorado, utilize -whitelistrelay e/ou -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Utilize um proxy SOCKS5 separado para alcançar os pontos via serviços ocultos do Tor (predefinição: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Atenção: Versões desconhecidas de blocos estão a ser mineradas! É possível que regras desconhecias estão a ser efetuadas</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s está demasiado elevado!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(predefinição: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Consultar sempre os endereços de ponto via procura de DNS (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Quantos blocos para verificar no arranque (predefinição: %u, 0 = todos)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Incluir endereços de IP na informação de depuração (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escutar por ligações JSON-RPC na porta &lt;port&gt; (predefinição: %u ou rede de testes: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Escute ligações na porta &lt;port&gt; (por defeito: %u ou testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Manter no máximo &lt;n&gt; ligações para os pontos (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Colocar a carteira a transmitir transacções</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximo armazenamento intermédio de recepção por ligação, &lt;n&gt;*1000 bytes (por defeito: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximo armazenamento intermédio de envio por ligação, &lt;n&gt;*1000 bytes (por defeito: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Adicionar data e hora à informação de depuração (por defeito: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Propagar e minerar transacções que incluem dados (padrão: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Propagar não P2SH multisig (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Definir tamanho do banco de memória da chave para &lt;n&gt; (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Defina o número de processos para servir as chamadas RPC (por defeito: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Especificar ficheiro de configuração (por defeito: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Especificar tempo de espera da ligação em milissegundos (mínimo 1, por defeito: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Especificar ficheiro pid (padrão: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Gastar o troco não confirmado quando enviar transações (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>É a taxa de transação mínima que paga em cada transação.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Esta é a taxa de transação que irá pagar se enviar uma transação.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Tolerância para desligar pontos com mau comportamento (predefinição: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Os valores da transação não devem ser negativos</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>A transação é muito grande de uma cadeia do banco de memória</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>A transação dever pelo menos um destinatário</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Rede desconhecida especificada em -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fundos insuficientes</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>A carregar o índice de blocos...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>A carregar a carteira...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Impossível mudar a carteira para uma versão anterior</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Reexaminando...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Carregamento concluído</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Erro</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ro.ts",
    "content": "<TS language=\"ro\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Click dreapta pentru a modifica adresa sau eticheta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Crează o adresă nouă</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>Nou</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiază în notițe adresa selectată în prezent</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>Copiază</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Închide</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Șterge adresa curentă selectata din listă</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportă datele din tabul curent in fisier</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Exportă</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>Șterge</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Alege adresa căreia să îi trimiți monedele:</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Alege adresa de primire a monedelor</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Alege</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Adresele de trimitere</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Adresele de primire</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Acestea sunt adresele tale Bitcoin pentru trimiterea plății. Verifică mereu suma și adresa de primire înainte de trimiterea monedelor.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Acestea sunt adresele tale Bitcoin pentru primirea plăților. Este recomandată folosirea de noi adrese de primire pentru fiecare tranzacție.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>Copiază Adresa</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copiază Eticheta</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>Editare</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exporta lista de adrese</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fisier text separat prin virgule (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportul a eșuat</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etichetă</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresă</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(fără etichetă)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Secventa de cuvinte a parolei</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Introduceti parola</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Noua parolă</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repetati noua parolă</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Introduceti o parola noua pentru portofel.&lt;br/&gt;Va rugam sa folositi o parola de  &lt;b&gt; zece sau mai multe caractere&lt;/b&gt;, sau &lt;b&gt;mai mult de opt cuvinte&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Incripteaza portofelul</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Această operație cere parola portofelului pentru a debloca portofelul.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Deblochează portofelul</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Aceastea procedură necesită parola partofelului pentru a decripta portofelul</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Decriptează portofelul</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Schimbă parola</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Introdu parola veche si parola nouă pentru portofel</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirmă criptarea portofelului</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Atenție: Dacă îți criptezi portofelul și uiți parola, îți vei &lt;b&gt; PIERDE TOȚI BITCOINS&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Ești sigur că vrei să criptezi portofelul?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Portofel criptat</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Criptarea portofelului a eșuat</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Parola furnizată nu se potrivește.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Deblocarea portofelului a eșuat</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Decriptarea portofelului a eșuat</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Parola portofelului a fost schimbată cu succes</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Atenție: Caps Lock este activat!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Blocat până</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Semnează &amp;mesajul...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Se sincronizează cu rețeaua</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>Vizualizare de ansamblu</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nod</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Arată o prezentare generală a portofelului.</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Tranzacții</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Navighează în istoricul tranzacțiilor</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Părăsește aplicația</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Despre &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Arată informații despre Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opțiuni...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Criptează portofelul...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Backup portofel</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Schimbă parola...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Trimite adresele...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Primește adresele...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Deschide &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Click pentru a permite, din nou, activitate rețelei.</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Trimite monedele către o adresă Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Fă o copie de rezervă a portofelului într-o altă locație</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Schimbă parola folosită pentru criptarea portofelului</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Fereastra pentru depanare</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Pornește consola pentru depanare si diagnoză</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifică mesajul...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Portofel</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Trimite</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Primește</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Arată/Ascunde</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Arată sau ascunde fereastra principală</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Criptează cheile private care aparțin portofelului tău.</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Semnează mesajele cu adresa ta de Bitcoin pentru a face dovada că îți aparțin.</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifică mesajele cu scopul de a asigura faptul că au fost semnate cu adresa de Bitcoin specificată.</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fișier</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Setări</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ajutor</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Cerere plată (generează coduri QR și bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Afișează lista adreselor de livrare utilizate și etichetele.</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Afișează lista adreselor de primire utilizate și etichetele.</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Deschide un bitcoin: URI sau cerere de plată</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Linie de comandă Setări</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 în urmă</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Ultimul bloc primit a fost generat acum %1</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eroare</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Atenționare</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informație</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Actual</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Cantitate: %1</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tip: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etichetă: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresa: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Trimite tranzacția</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Portofelul este &lt;b&gt;criptat&lt;/b&gt; și în prezent &lt;b&gt;deblocat&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Portofelul este &lt;b&gt;criptat&lt;/b&gt; și în prezent &lt;b&gt;blocat&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selecția monedelor</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantitatea:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Biți:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cantitate:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Taxa:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>După taxă:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Schimbă:</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Mod arbore</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Mod listă</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantitate</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Primit cu adresa</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmări</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmat</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiază adresa</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiază eticheta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiază cantitatea</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiază ID-ul tranzacției</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiază taxa</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>da</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nu</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(fără etichetă)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Modifică adresa</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresa</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Adresă de primire nouă</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Adresă nouă de livrare</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Modifică adresa de primire</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Modifică adresa de livrare</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Portofelul nu a putut fi deblocat.</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>Nume</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Directoriul există deja. Adaugă %1 dacă ai intenționat să creezi aici un directoriu nou.</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versiune</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Utilizare:</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Pornește minimalizat</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Resetează toate setările modificate în Interfața Grafică.</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bine ai venit!</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Folosește directoriul pentru date din modul implicit.</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Alege un folder/director personalizat</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Cel puțin %1 GB va fi stocat în acest folder și va crește în timp.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Portofelul va fi, de asemenea, stocat în acest folder/director.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Eroare: Folderul specificat \"%1\" nu poate fi creat.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eroare</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB de spațiu liber disponibil</numerusform><numerusform>%n GB de spațiu liber disponibil</numerusform><numerusform>%n GB de spațiu liber disponibil</numerusform></translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>formular</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Posibil ca tranzacțiile recente să nu fie vizibile, încă, astfel bilanțul portofelului tău poate fi incorect. Aceste informații vor fi corecte o dată ce portofelul tău a încheiat sincronizarea cu rețeaua bitcoin, conform descrierii de mai jos.</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Necunoscut...</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>Se calculează...</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ascunde</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Deschide URI</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opțiuni</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Adresa IP a proxy-ului (ex. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Deschide fișierul de Configurare</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Resetează opțiunile</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Rețea</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Portul pentru proxy (ex.: 9050)</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Fereastra</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Anulează</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>inițial</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>fără</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmă resetarea opțiunilor</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Repornirea clientului este necesară pentru ca schimbările să fie activate</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Clientul va fi oprit. Dorești sa continui?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Optiuni de configuratie</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eroare</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Această schimbare necesită repornirea clientului.</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>formular</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponibil:</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Tranzacții recente</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Cererea de plată a expirat.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Cererea de plată nu este inițializată.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Cerere de plată invalidă.</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>Trimis</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Primit</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Cantitate</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 și %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Salvează codul QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imagine PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>Client version</source>\n        <translation>Versiunea clientului</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informații</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Fereastra pentru depanare</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Rețea</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nume</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Numărul de conexiuni</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Primit</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Trimis</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direcția</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versiune</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Durata conexiunii</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Deschide</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consolă</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;ore</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;zi</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;săptămână</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;an</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Da</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nu</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Necunoscut</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Mesaj:</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Arată</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Elimină</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiază eticheta</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copiază mesajul</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiază cantitatea</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Salvează codul QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copiază Adresa</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Salvează imaginea...</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresă</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantitate</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetă</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaj</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etichetă</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaj</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(fără etichetă)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantitatea:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Biți:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Cantitate:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Taxa:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>După taxă:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Schimbă:</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ascunde</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiază cantitatea</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiază taxa</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Cererea de plată a expirat.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(fără etichetă)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Message verified.</source>\n        <translation>Mesaj verificat.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Generated</source>\n        <translation>Generat</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>De la</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>La</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Credit</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Credit total</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaj</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comentariu</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transactiune ID</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transactiune</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantitate</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>Adevarat</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>Fals</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Type</source>\n        <translation>tip</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetă</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Obtinut cu</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(fără etichetă)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Tot</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Astazi</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Saptamana aceasta</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Luna aceasta</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Luna trecuta</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Anul acesta</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Obtinut cu</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Pentru tine</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Altru</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiază adresa</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiază eticheta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiază cantitatea</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiază ID-ul tranzacției</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fisier text separat prin virgule (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmat</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>tip</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetă</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresă</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportul a eșuat</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportă</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Optiuni:</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Actualizarea bazei de date UTXO</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informație</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Atenționare</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Portofelul se încarcă...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Rescanare...</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eroare</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ro_RO.ts",
    "content": "<TS language=\"ro_RO\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Click-dreapta pentru a edita adresa sau eticheta</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Creează o adresă nouă</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nou</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copiază adresa selectată în clipboard</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copiază</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Închide</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Şterge adresa selectată din listă</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportă datele din tab-ul curent într-un fişier</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportă</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Şterge</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Alege $adresa unde să trimiteţi monede</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Alege adresa la care sa primesti monedele cu</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>A&amp;lege</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Adresa de trimitere</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Adresa de primire</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Acestea sunt adresele tale Bitcoin pentru efectuarea platilor. Intotdeauna verifica atent suma de plata si adresa beneficiarului inainte de a trimite monede.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Acestea sunt adresele tale Bitcoin pentru receptionarea platilor. Este recomandat sa folosesti mereu o adresa noua pentru primirea platilor.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copiază Adresa</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copiaza si eticheteaza</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Editare</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportă listă de adrese</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fisier cu separator virgulă (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Export nereusit</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>A apărut o eroare la salvarea listei de adrese la %1. Vă rugăm să încercaţi din nou.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etichetă</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresă</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(fără etichetă)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialogul pentru fraza de acces</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Introduceţi fraza de acces</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Frază de acces nouă</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Repetaţi noua frază de acces</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Arata parola</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Introduceţi noua parolă a portofelului electronic.&lt;br/&gt;Vă rugăm să folosiţi o parolă de&lt;b&gt;minimum 10 caractere aleatoare&lt;/b&gt;, sau &lt;b&gt;minimum 8 cuvinte&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Criptare portofel</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Această acţiune necesită introducerea parolei de acces pentru deblocarea portofelului.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Deblocare portofel</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Această acţiune necesită introducerea parolei de acces pentru decriptarea portofelului.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Decriptare portofel</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Schimbă parola</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Introduceţi vechea şi noua parolă pentru portofel.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Confirmaţi criptarea portofelului</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Atenţie: Dacă va criptati portofelul si ulterior pierdeti parola, &lt;b&gt;VEŢI PIERDE TOTI BITCOINII&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Sigur doriţi să criptaţi portofelul dvs.?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Portofel criptat</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 se va închide acum pentru a termina procesul de criptare. Ţineţi minte că criptarea portofelului nu vă poate proteja în totalitate de furtul monedelor de către programe malware care vă infectează calculatorul.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>IMPORTANT: Orice copie de siguranţă făcută anterior portofelului dumneavoastră ar trebui înlocuită cu cea generată cel mai recent, fişier criptat al portofelului. Pentru siguranţă, copiile de siguranţă vechi ale portofelului ne-criptat vor deveni inutile imediat ce veţi începe folosirea noului fişier criptat al portofelului.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Criptarea portofelului a eşuat.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Criptarea portofelului nu a reuşit din cauza unei erori interne. Portofelul dvs. nu a fost criptat.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Parolele furnizate nu se potrivesc.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Deblocarea portofelului a esuat.</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Parola introdusă pentru decriptarea portofelului a fost incorectă.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Decriptarea portofelului a esuat.</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Parola portofelului a fost schimbata.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Atenţie! Caps Lock este pornit!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Banat până la</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Semnează &amp;mesaj...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Se sincronizează cu reţeaua...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Imagine de ansamblu</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nod</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Arată o stare generală de ansamblu a portofelului</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Tranzacţii</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Răsfoire istoric tranzacţii</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Ieşire</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Închide aplicaţia</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Despre %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Arată informaţii despre %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Despre &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Arată informaţii despre Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opţiuni...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Modifică opţiunile de configurare pentru %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Cript&amp;ează portofelul...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Face o copie de siguranţă a portofelului...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>S&amp;chimbă parola...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Adrese de trimitere...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Adrese de p&amp;rimire...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Deschide &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Click pentru a opri activitatea retelei.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Activitatea retelei a fost oprita.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Click pentu a porni activitatea retelei.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Se sincronizeaza Header-ele (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Se reindexează blocurile pe disc...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Trimite monede către o adresă Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Creează o copie de rezervă a portofelului într-o locaţie diferită</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Schimbă fraza de acces folosită pentru criptarea portofelului</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>Fereastra de &amp;depanare</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Deschide consola de depanare şi diagnosticare</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifică mesaj...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Portofel</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>Trimite</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>P&amp;rimeşte</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>Arată/Ascunde</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Arată sau ascunde fereastra principală</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Criptează cheile private ale portofelului dvs.</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Semnaţi mesaje cu adresa dvs. Bitcoin pentru a dovedi că vă aparţin</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verificaţi mesaje pentru a vă asigura că au fost semnate cu adresa Bitcoin specificată</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fişier</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Setări</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>A&amp;jutor</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Bara de unelte</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Cereţi plăţi (generează coduri QR şi bitcoin-uri: URls)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Arată lista de adrese trimise şi etichetele folosite.</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Arată lista de adrese pentru primire şi etichetele</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Deschidere bitcoin: o adresa URI sau o cerere de plată</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opţiuni linie de &amp;comandă</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n conexiune activă către reţeaua Bitcoin</numerusform><numerusform>%n conexiuni active către reţeaua Bitcoin</numerusform><numerusform>%n de conexiuni active către reţeaua Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Se indexează blocurile pe disc...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Se proceseaza blocurile pe disc...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>S-a procesat %n bloc din istoricul tranzacţiilor.</numerusform><numerusform>S-au procesat %n blocuri din istoricul tranzacţiilor.</numerusform><numerusform>S-au procesat %n de blocuri din istoricul tranzacţiilor.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 în urmă</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Ultimul bloc recepţionat a fost generat acum %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Tranzacţiile după aceasta nu vor fi vizibile încă.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eroare</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Avertisment</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informaţie</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Actualizat</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Arată mesajul de ajutor %1 pentru a obţine o listă cu opţiunile posibile de linii de comandă Bitcoin</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>Client %1</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Se conecteaza cu alte noduri...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Se actualizează...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Data: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Sumă: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tip: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etichetă: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresă: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Tranzacţie expediată</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Tranzacţie recepţionată</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Generarea de chei HD este &lt;b&gt;activata&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Generarea de chei HD este &lt;b&gt;dezactivata&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Portofelul este &lt;b&gt;criptat&lt;/b&gt; iar în momentul de faţă este &lt;b&gt;deblocat&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Portofelul este &lt;b&gt;criptat&lt;/b&gt; iar în momentul de faţă este &lt;b&gt;blocat&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>A survenit o eroare fatală. Bitcoin nu mai poate continua în siguranţă şi se va opri.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Selectarea monedei</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantitate:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Octeţi:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Sumă:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Taxă:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Praf:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>După taxă:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Schimb:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(de)selectare tot</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Mod arbore</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Mod listă</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Sumă</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Primite cu eticheta</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Primite cu adresa</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Confirmări</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmat</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiază adresa</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiază eticheta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiază suma</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiază ID tranzacţie</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Blocare necheltuiţi</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Deblocare necheltuiţi</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiază cantitea</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiază taxa</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiază după taxă</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiază octeţi</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiază praf</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiază rest</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>da</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nu</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Această etichetă devine roşie, dacă orice beneficiar primeşte o sumă mai mică decât pragul curent pentru praf.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Poate varia +/- %1 satoshi pentru fiecare intrare.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(fără etichetă)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>restul de la %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(rest)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Editează adresa</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etichetă</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Eticheta asociată cu această intrare din listă.</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Adresa asociată cu această adresă din listă. Aceasta poate fi modificată doar pentru adresele de trimitere.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresă</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Noua adresă de primire</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Noua adresă de trimitere</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Editează adresa de primire</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Editează adresa de trimitere</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Adresa introdusă \"%1\" nu este o adresă Bitcoin validă.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Adresa introdusă \"%1\" se află deja în lista de adrese.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Portofelul nu a putut fi deblocat.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Generarea noii chei nu a reuşit.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Va fi creat un nou dosar de date.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>nume</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Dosarul deja există. Adaugă %1 dacă intenţionaţi să creaţi un nou dosar aici.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Calea deja există şi nu este un dosar.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Nu se poate crea un dosar de date aici.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versiunea</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Despre %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Opţiuni linie de comandă</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uz:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>Opţiuni linie de comandă</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Opţiuni UI:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Alege dosarul de date la pornire (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Setează limba, de exemplu: \"ro_RO\" (implicit: sistem local)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Porniţi minimizat</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Setare rădăcină certificat SSL pentru cerere de plată (implicit: -sistem- )</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Afişează ecran splash la pornire (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Resetează toate schimbările făcute în GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Bun venit</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Bun venit la %1!</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Deoarece este prima lansare a programului poți alege unde %1 va stoca datele sale.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Cand apasati OK, %1 va incepe descarcarea si procesarea intregului %4 blockchain (%2GB) incepand cu cele mai vechi tranzactii din %3 de la lansarea initiala a %4.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Sincronizarea initiala necesita foarte multe resurse, si poate releva probleme de hardware ale computerului care anterior au trecut neobservate. De fiecare data cand rulati %1, descarcarea va continua de unde a fost intrerupta.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Daca ati ales o limita pentru capacitatea de stocare a blockchainului (pruning), datele mai vechi tot trebuie sa fie descarcate si procesate, insa vor fi sterse ulterior pentru a reduce utilizarea harddiskului.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Foloseşte dosarul de date implicit</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Foloseşte un dosar de date personalizat:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Cel putin %1GB de date vor fi stocate in acest director, si aceasta valoare va creste in timp.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Aproximativ %1 GB de date vor fi stocate in acest director.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 va descarca si stoca o copie a blockchainului Bitcoin</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Portofelul va fi de asemeni stocat in acest director.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Eroare: Directorul datelor specificate \"%1\" nu poate fi creat.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eroare</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB de spaţiu liber disponibil</numerusform><numerusform>%n GB de spaţiu liber disponibil</numerusform><numerusform>%n GB de spaţiu liber disponibil</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(din %n GB necesar)</numerusform><numerusform>(din %n GB necesari)</numerusform><numerusform>(din %n GB necesari)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Tranzactiile recente pot sa nu fie inca vizibile, de aceea balanta portofelului poate fi incorecta. Aceasta informatie va fi corecta de indata ce portofelul va fi complet sincronizat cu reteaua Bitcoin, asa cum este detaliat mai jos.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Incercarea de a cheltui bitcoini care sunt afectati de tranzactii ce inca nu sunt afisate nu va fi acceptata de retea.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Numarul de blocuri ramase</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Necunoscut...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Data ultimului bloc</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Progres</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Cresterea progresului per ora</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>calculeaza...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Timp estimat pana la sincronizare</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ascunde</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Necunoscut. Se sincronizeaza headerele (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Deschide URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Deschideţi cerere de plată prin intermediul adresei URI sau a fişierului</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Selectaţi fişierul cerere de plată</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Selectati care fisier de cerere de plata va fi deschis</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opţiuni</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>Principal</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Porneşte automat %1 după logarea in sistem.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Porneste %1 la logarea in sistem.</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Mărimea bazei de &amp;date cache</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Numărul de thread-uri de &amp;verificare</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Adresa IP a serverului proxy (de exemplu: IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Arata daca proxy-ul SOCKS5 furnizat implicit este folosit pentru a gasi parteneri via acest tip de retea.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Foloseste un proxy SOCKS&amp;5 separat pentru a gasi parteneri via servicii TOR ascunse</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Ascunde icon-ul din system tray.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Ascunde icon-ul din system tray.</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimizează fereastra în locul părăsirii programului în momentul închiderii ferestrei. Cînd acestă opţiune e activă, aplicaţia se va opri doar în momentul selectării comenzii 'Închide aplicaţia' din menu.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL-uri terţe părţi (de exemplu, un explorator de bloc), care apar în tab-ul tranzacţiilor ca elemente de meniu contextual. %s în URL este înlocuit cu hash de tranzacţie. URL-urile multiple sînt separate prin bară verticală |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Opţiuni linie de comandă active care oprimă opţiunile de mai sus:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Deschide fisierul de configurare %1 din directorul curent.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Deschide fisierul de configurare.</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Resetează toate setările clientului la valorile implicite.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Resetează opţiunile</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>Reţea</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = automat, &lt;0 = lasă atîtea nuclee libere)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Portofel</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Activare caracteristici de control ale monedei</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Dacă dezactivaţi cheltuirea restului neconfirmat, restul dintr-o tranzacţie nu poate fi folosit pînă cînd tranzacţia are cel puţin o confirmare. Aceasta afectează de asemenea calcularea soldului.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>Cheltuire rest neconfirmat</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Deschide automat în router portul aferent clientului Bitcoin. Funcţionează doar dacă routerul duportă UPnP şi e activat.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapare port folosind &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Acceptă conexiuni din exterior</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Permite conexiuni de intrar&amp;e</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Conectare la reţeaua Bitcoin printr-un proxy SOCKS.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Conectare printr-un proxy SOCKS (implicit proxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Portul proxy (de exemplu: 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Folosit pentru a gasi parteneri via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Conectare la reteaua Bitcoin printr-un proxy SOCKS5 separat pentru serviciile TOR ascunse.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Fereastră</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Arată doar un icon în tray la ascunderea ferestrei</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimizare în tray în loc de taskbar</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimizare fereastră în locul închiderii programului</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Afişare</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Limbă interfaţă utilizator</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Limba interfeţei utilizatorului poate fi setată aici. Această setare va avea efect după repornirea %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unitatea de măsură pentru afişarea sumelor:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Alegeţi subdiviziunea folosită la afişarea interfeţei şi la trimiterea de bitcoin.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Arată controlul caracteristicilor monedei sau nu.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>URL-uri tranzacţii &amp;terţe părţi</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>Renunţă</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>iniţial</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>nimic</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirmă resetarea opţiunilor</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Este necesară repornirea clientului pentru a activa schimbările.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Clientul va fi închis. Doriţi să continuaţi?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Optiuni de configurare</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Fisierul de configurare e folosit pentru a specifica optiuni utilizator avansate care modifica setarile din GUI. In plus orice optiune din linia de comanda va modifica acest fisier de configurare. </translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eroare</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Fisierul de configurare nu a putut fi deschis.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Această schimbare necesită o repornire a clientului.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Adresa bitcoin pe care aţi specificat-o nu este validă.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Informaţiile afişate pot fi neactualizate. Portofelul dvs. se sincronizează automat cu reţeaua Bitcoin după ce o conexiune este stabilită, dar acest proces nu a fost finalizat încă.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Doar-supraveghere:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponibil:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Balanţa dvs. curentă de cheltuieli</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>În aşteptare:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Totalul tranzacţiilor care nu sunt confirmate încă şi care nu sunt încă adunate la balanţa de cheltuieli</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Nematurizat:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Balanţa minata ce nu s-a maturizat încă</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Balanţă</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Total:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Balanţa totală curentă</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Soldul dvs. curent în adresele doar-supraveghere</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Cheltuibil:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Tranzacţii recente</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Tranzacţii neconfirmate la adresele doar-supraveghere</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Balanţă minată în adresele doar-supraveghere care nu s-a maturizat încă</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Soldul dvs. total în adresele doar-supraveghere</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Eroare la cererea de plată</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Bitcoin nu poate porni: click-to-pay handler</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Gestionare URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>URL-ul cererii de plată preluat nu este valid: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Adresă pentru plată invalidă %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI nu poate fi analizat! Acest lucru poate fi cauzat de o adresă Bitcoin invalidă sau parametri URI deformaţi.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Manipulare fişier cerere de plată</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Fişierul cerere de plată nu poate fi citit! Cauza poate fi un fişier cerere de plată nevalid.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Cerere de plată refuzată</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Cererea de plată din reţea nu se potriveşte cu clientul din reţea</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Cerere de plată expirata</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Cererea de plată nu este iniţializată.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Cererile nesecurizate către scripturi personalizate de plăți nu sunt suportate</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Cerere de plată invalidă.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Suma cerută de plată de %1 este prea mică (considerată praf).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Rambursare de la %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Cererea de plată %1 este prea mare (%2 octeţi, permis %3 octeţi).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Eroare la comunicarea cu %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Cererea de plată nu poate fi analizată!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Răspuns greşit de la server %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Eroare în cererea de reţea</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Plată acceptată</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent utilizator</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nod/Serviciu</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>NodeID</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Expediat</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recepţionat</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Cantitate</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Introduceţi o adresă Bitcoin (de exemplu %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 z</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Niciuna</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n secunda</numerusform><numerusform>%n secunde</numerusform><numerusform>%n secunde</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minut</numerusform><numerusform>%n minute</numerusform><numerusform>%n minute</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n ora</numerusform><numerusform>%n ore</numerusform><numerusform>%n ore</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n zi</numerusform><numerusform>%n zile</numerusform><numerusform>%n zile</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n saptamana</numerusform><numerusform>%n saptamani</numerusform><numerusform>%n saptamani</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 şi %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n an</numerusform><numerusform>%n ani</numerusform><numerusform>%n ani</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 nu a fost inchis in siguranta...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>necunoscut</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Eroare: Directorul de date specificat \"%1\" nu există.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Eroare: Nu se poate procesa fişierul de configuraţie: %1. Folosiţi doar sintaxa cheie=valoare.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Eroare: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Salvează Imaginea...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Copiaza Imaginea</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Salvează codul QR</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Imagine de tip PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Nespecificat</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Versiune client</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informaţii</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Fereastra de depanare</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>General</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Foloseşte BerkeleyDB versiunea</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Dirdate</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Ora de pornire</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Reţea</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Nume</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Numărul de conexiuni</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Lanţ de blocuri</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Numărul curent de blocuri</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Pool Memorie</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Numărul curent de tranzacţii</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Memorie folosită</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Resetare</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Recepţionat</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Expediat</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Parteneri</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Terti banati</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Selectaţi un partener pentru a vedea informaţiile detaliate.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Whitelisted</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direcţie</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versiune</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Bloc de început</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Headere Sincronizate</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Blocuri Sincronizate</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Agent utilizator</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Deschide fişierul jurnal depanare %1 din directorul curent. Aceasta poate dura cateva secunde pentru fişierele mai mari.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Micsoreaza fontul</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Mareste fontul</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Servicii</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Scor Ban</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Timp conexiune</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Ultima trimitere</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Ultima primire</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Timp ping</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Durata ping-ului intarziat.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Asteptare ping</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Min Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Diferenta timp</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Data ultimului bloc</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Deschide</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Consolă</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>Trafic reţea</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totaluri</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Intrare:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Ieşire:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Fişier jurnal depanare</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Curăţă consola</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;oră</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;zi</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;săptămână</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;an</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Deconectare</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Interzicere pentru</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Unban</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Bun venit la consola %1 RPC.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Folosiţi săgetile sus şi jos pentru a naviga în istoric şi %1 pentru a curăţa ecranul.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Tastati %1 pentru o recapitulare a comenzilor disponibile.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Pentru mai multe informatii despre folosirea acestei console tastati %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>ATENTIONARE: Sunt excroci care instruiesc userii sa introduca aici comenzi, pentru a le fura continutul portofelelor. Nu folositi aceasta consolă fara a intelege pe deplin ramificatiile unei comenzi.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Activitatea retelei a fost oprita.</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(node id: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>niciodată</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Intrare</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Ieşire</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Da</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nu</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Necunoscut</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Sum&amp;a:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etichetă:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Mesaj:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Un mesaj opţional de ataşat la cererea de plată, care va fi afişat cînd cererea este deschisă. Notă: Acest mesaj nu va fi trimis cu plata către reţeaua Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>O etichetă opţională de asociat cu adresa de primire.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Foloseşte acest formular pentru a solicita plăţi. Toate cîmpurile sînt &lt;b&gt;opţionale&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>O sumă opţională de cerut. Lăsaţi gol sau zero pentru a nu cere o sumă anume.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Curăţă toate cîmpurile formularului.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Curăţă</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Istoricul plăţilor cerute</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Cerere plată</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Arată cererea selectată (acelaşi lucru ca şi dublu-clic pe o înregistrare)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Arată</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Înlătură intrările selectate din listă</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Înlătură</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Copiază URl</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiază eticheta</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copiază mesajul</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiază suma</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>Cod QR</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copiază &amp;URl</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Copiază &amp;adresa</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Salvează imaginea...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Cere plata pentru %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informaţiile plată</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresă</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantitate</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetă</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaj</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI rezultat este prea lung, încearcă să reduci textul pentru etichetă / mesaj.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Eroare la codarea URl-ului în cod QR.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetă</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaj</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(fără etichetă)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(nici un mesaj)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(nici o sumă solicitată)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Ceruta</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Trimite monede</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Caracteristici de control ale monedei</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Intrări...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>selecţie automată</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fonduri insuficiente!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Cantitate:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Octeţi:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Sumă:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Comision:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>După taxă:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Rest:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Dacă este activat, dar adresa de rest este goală sau nevalidă, restul va fi trimis la o adresă nou generată.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Adresă personalizată de rest</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Taxă tranzacţie:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Alegeţi...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Folosirea taxei implicite poate rezulta in trimiterea unei tranzactii care va dura cateva ore sau zile (sau niciodata) pentru a fi confirmata. Luati in considerare sa setati manual taxa sau asteptati pana ati validat complet lantul.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Avertisment: Estimarea comisionului nu s-a putut efectua.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>inchide setarile de taxare</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilooctet</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Daca taxa personalizata este setata la 1000 satoshi si tranzactia este doar de 250 bytes, atunci \"per kilobyte\" plateste o taxa de doar 250 satoshi, in timp ce \"total minim\" plateste 1000 satoshi. Pentru tranzactii mai mari de un kilobyte ambele platesc per kilobyte. </translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ascunde</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Plata unei taxe minime de tranzactie este in regula atata timp cat exista mai mult spatiu in blocuri dacat sunt tranzactii. Insa trebuie sa fiti constienti ca acest lucru poate conduce la tranzactii care nu vor fi niciodata confirmate in cazul in care exista cerere de tranzactii mai mare decat poate procesa reteaua.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(citeste tooltip)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Recomandat:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Personalizat:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Taxa smart nu este inca initializata. Aceasta poate dura cateva blocuri...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Trimite simultan către mai mulţi destinatari</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Adaugă destinata&amp;r</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Şterge toate câmpurile formularului.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Praf:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Timp confirmare tinta:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Autorizeaza Replace-By-Fee</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Cu Replace-By-Fee (BIP-125) se poate creste taxa unei tranzactii dupa ce a fost trimisa. Fara aceasta optiune, o taxa mai mare e posibil sa fie recomandata pentru a compensa riscul crescut de intarziere a tranzactiei.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Curăţă to&amp;ate</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balanţă:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirmă operaţiunea de trimitere</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>Trimit&amp;e</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Copiază cantitea</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiază suma</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Copiază taxa</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Copiază după taxă</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Copiază octeţi</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Copiază praf</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Copiază rest</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1(%2 blocuri)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 la %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Sigur doriţi să trimiteţi?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>adăugat ca taxă de tranzacţie</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Suma totală %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>sau</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Puteti creste taxa mai tarziu (semnaleaza Replace-By-Fee, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Nu se semnalizeaza Replace-By-Fee, BIP-125</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirmă trimiterea monedelor</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Adresa destinatarului nu este validă. Rugăm să reverificaţi.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Suma de plată trebuie să fie mai mare decît 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Suma depăşeşte soldul contului.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Totalul depăşeşte soldul contului dacă se include şi plata taxei de %1.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Adresă duplicat găsită: fiecare adresă ar trebui folosită o singură dată.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Creare tranzacţie nereuşită!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Tranzactia a fost refuzata pentru urmatorul motiv: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation> O taxă mai mare de %1 este considerată o taxă absurd de mare </translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Cerere de plată expirata</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Plăteşte doar taxa solicitata de %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Se estimeaza inceperea confirmarii in %n bloc.</numerusform><numerusform>Se estimeaza inceperea confirmarii in %n blocuri.</numerusform><numerusform>Se estimeaza inceperea confirmarii in %n blocuri.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Atenţie: Adresa bitcoin nevalidă!</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Atenţie: Adresă de rest necunoscută</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Confirmati adresa personalizata de rest</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Adresa selectata pentru rest nu face parte din acest portofel. Orice suma, sau intreaga suma din portofel poate fi trimisa la aceasta adresa. Sunteti sigur?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(fără etichetă)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Su&amp;mă:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Plăteşte că&amp;tre:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etichetă:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Alegeţi adrese folosite anterior</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Aceasta este o tranzacţie normală.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Adresa bitcoin către care se face plata</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Lipeşte adresa din clipboard</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Înlătură această intrare</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Taxa va fi scazuta in suma trimisa. Destinatarul va primi mai putini bitcoin decat ati specificat in campul sumei trimise. Daca au fost selectati mai multi destinatari, taxa se va imparti in mod egal.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>S&amp;cade taxa din suma</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Folosește balanța disponibilă</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mesaj:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Aceasta este o cerere de plata neautentificata.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Aceasta este o cerere de plata autentificata.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Introduceţi eticheta pentru ca această adresa să fie introdusă în lista de adrese folosite</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>un mesaj a fost ataşat la bitcoin: URI care va fi stocat cu tranzacţia pentru referinţa dvs. Notă: Acest mesaj nu va fi trimis către reţeaua bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Plăteşte către:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Memo:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Introduceţi o etichetă pentru această adresă pentru a fi adăugată în lista dvs. de adrese</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Da</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 se închide</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Nu închide calculatorul pînă ce această fereastră nu dispare.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Semnaturi - Semnează/verifică un mesaj</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Semnează mesaj</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Puteţi semna mesaje/contracte cu adresele dvs. pentru a demostra ca puteti primi bitcoini trimisi la ele. Aveţi grijă să nu semnaţi nimic vag sau aleator, deoarece atacurile de tip phishing vă pot păcăli să le transferaţi identitatea. Semnaţi numai declaraţiile detaliate cu care sînteti de acord.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Adresa cu care semnaţi mesajul</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Alegeţi adrese folosite anterior</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Lipeşte adresa copiată din clipboard</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Introduceţi mesajul pe care vreţi să-l semnaţi, aici</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Semnătură</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copiază semnatura curentă în clipboard-ul sistemului</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Semnează mesajul pentru a dovedi ca deţineţi acestă adresă Bitcoin</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Semnează &amp;mesaj</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Resetează toate cîmpurile mesajelor semnate</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Curăţă to&amp;ate</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifică mesaj</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Introduceţi adresa de semnatură, mesajul (asiguraţi-vă că aţi copiat spaţiile, taburile etc. exact) şi semnatura dedesubt pentru a verifica mesajul. Aveţi grijă să nu citiţi mai mult în semnatură decît mesajul în sine, pentru a evita să fiţi păcăliţi de un atac de tip man-in-the-middle. De notat ca aceasta dovedeste doar ca semnatarul primeste odata cu adresa, nu dovedesta insa trimiterea vreunei tranzactii.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Introduceţi o adresă Bitcoin</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verificaţi mesajul pentru a vă asigura că a fost semnat cu adresa Bitcoin specificată</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifică &amp;mesaj</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Resetează toate cîmpurile mesajelor semnate</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Faceţi clic pe \"Semneaza msaj\" pentru a genera semnătura</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Adresa introdusă este invalidă.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Vă rugăm verificaţi adresa şi încercaţi din nou.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Adresa introdusă nu se referă la o cheie.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Deblocarea portofelului a fost anulata.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Cheia privată pentru adresa introdusă nu este disponibila.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Semnarea mesajului nu a reuşit.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Mesaj semnat.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Semnatura nu a putut fi decodată.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Vă rugăm verificaţi semnătura şi încercaţi din nou.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Semnatura nu se potriveşte cu mesajul.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Verificarea mesajului nu a reuşit.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Mesaj verificat. </translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Deschis pentru inca un bloc</numerusform><numerusform>Deschis pentru inca %n blocuri</numerusform><numerusform>Deschis pentru inca %n blocuri</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Deschis pînă la %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>in conflict cu o tranzactie cu %1 confirmari</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/neconfirmat, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>in memory pool</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>nu e in memory pool</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandonat</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/neconfirmat</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 confirmări</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Stare</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, nu a fost încă publicată</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, difuzare printr-un nod</numerusform><numerusform>, difuzare prin %n noduri</numerusform><numerusform>, difuzare prin %n noduri</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Sursa</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generat</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>De la</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>necunoscut</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Către</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>adresa proprie</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>doar-supraveghere</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etichetă</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Credit</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>se matureaza intr-un bloc</numerusform><numerusform>se matureaza in %n blocuri</numerusform><numerusform>se matureaza in %n blocuri</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>neacceptat</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debit</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Total debit</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Total credit</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Taxă tranzacţie</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Suma netă</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaj</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comentariu</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID tranzacţie</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Dimensiune totala tranzacţie</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Index debit</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Comerciant</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Monedele generate se pot cheltui doar dupa inca %1 blocuri.  După ce a fost generat, s-a propagat în reţea, urmând să fie adăugat in blockchain.  Dacă nu poate fi inclus in lanţ, starea sa va deveni \"neacceptat\" si nu va putea fi folosit la tranzacţii.  Acest fenomen se întâmplă atunci cand un alt nod a generat un bloc la o diferenţa de câteva secunde.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Informaţii pentru depanare</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Tranzacţie</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Intrări</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Cantitate</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>adevărat</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>fals</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Acest panou arată o descriere detaliată a tranzacţiei</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detalii pentru %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tip</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetă</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Deschis pînă la %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Deconectat</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Neconfirmat</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandonat</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirmare (%1 din %2 confirmari recomandate)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmat (%1 confirmari)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>În conflict</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Imatur (%1 confirmari, va fi disponibil după %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Acest bloc nu a fost recepţionat de nici un alt nod şi probabil nu va fi acceptat!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generat dar neacceptat</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recepţionat cu</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Primit de la</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Trimis către</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Plată către dvs.</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minat</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>doar-supraveghere</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(indisponibil)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(fără etichetă)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Starea tranzacţiei. Treceţi cu mouse-ul peste acest cîmp pentru afişarea numărului de confirmari.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Data şi ora la care a fost recepţionată tranzacţia.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Tipul tranzacţiei.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Indiferent dacă sau nu o adresa doar-suăpraveghere este implicată în această tranzacţie.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Intentie/scop al tranzactie definit de user.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Suma extrasă sau adăugată la sold.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Toate</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Astăzi</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Saptamana aceasta</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Luna aceasta</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Luna trecuta</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Anul acesta</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Interval...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Recepţionat cu</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Trimis către</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Către dvs.</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minat</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Altele</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Introduceți adresa, ID-ul tranzacției, sau eticheta pentru a căuta</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Suma minimă</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Abandoneaza tranzacţia</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Cresteti comisionul pentru tranzacţie</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copiază adresa</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Copiază eticheta</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Copiază suma</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Copiază ID tranzacţie</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copiază tranzacţia bruta</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copiaza toate detaliile tranzacţiei</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Editează eticheta</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Arată detaliile tranzacţiei</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Export istoric tranzacţii</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Fisier .csv cu separator - virgula</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Confirmat</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Doar-supraveghere</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tip</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etichetă</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresă</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Exportarea a eșuat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>S-a produs o eroare la salvarea istoricului tranzacţiilor la %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Export reuşit</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Istoricul tranzacţiilor a fost salvat cu succes la %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Interval:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>către</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unitatea în care sînt arătate sumele. Faceţi clic pentru a selecta o altă unitate.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Nu a fost încărcat nici un portofel.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Trimite monede</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Eroare in cresterea taxei</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Cresterea comisionului pentru tranzactie a esuat.</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Doriti sa cresteti taxa de tranzactie?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Comision curent:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Crestere:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Noul comision:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Confirma cresterea comisionului</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Nu s-a reuşit semnarea tranzacţiei</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Tranzactia nu a putut fi consemnata.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Export</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportă datele din tab-ul curent într-un fişier</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Backup portofelul electronic</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Date portofel (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Backup esuat</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>S-a produs o eroare la salvarea datelor portofelului la %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Backup efectuat cu succes</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Datele portofelului s-au salvat cu succes la %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opţiuni:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Specificaţi dosarul de date</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Se conectează la un nod pentru a obţine adresele partenerilor, şi apoi se deconectează</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Specificaţi adresa dvs. publică</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Acceptă comenzi din linia de comandă şi comenzi JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distribuit sub licenţa de programe MIT, vezi fişierul însoţitor %s sau %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Dacă &lt;category&gt; nu este furnizat sau &lt;category&gt;=1, produce toate informaţiile de depanare.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Reductia e configurata sub minimul de %d MiB. Rugam folositi un numar mai mare.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Reductie: ultima sincronizare merge dincolo de datele reductiei. Trebuie sa faceti -reindex (sa descarcati din nou intregul blockchain in cazul unui nod redus)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Rescanarile nu sunt posibile in modul redus. Va trebui sa folositi -reindex, ceea ce va descarca din nou intregul blockchain.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Eroare: S-a produs o eroare interna fatala, vedeti debug.log pentru detalii</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Taxa (în %s/kB) de adăugat la tranzacţiile pe care le trimiteţi(implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Reductie blockstore...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Rulează în fundal ca un demon şi acceptă comenzi</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Imposibil de pornit serverul HTTP. Pentru detalii vezi logul de depanare.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Nucleul Bitcoin</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Dezvoltatorii %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>O rata de taxare (in %s/kB) ce va fi folosita atunci cand estimarea taxei are date insuficiente (implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Accepta retransmiterea tranzactiilor primite de la parteneri din whitelist chiar si atunci cand nu se retransmit tranzactii (implicit: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Adaugă un nod la care te poţi conecta pentru a menţine conexiunea deschisă (vezi ajutorul de comanda RPC 'addnode' pentru mai multe informatii)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Ataşaţi adresei date şi ascultaţi totdeauna pe ea. Folosiţi notaţia [host]:port pentru IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Nu se poate obține o blocare a directorului de date %s. %s probabil rulează deja.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Nu se pot furniza conexiuni specifice in acelasi timp in care addrman este folosit pentru a gasi conexiuni de iesire.</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Conectare doar la nodul(rile) specificate; -connect=0 dezactiveaza conexiuni automate (regula pentru aceasta pereche este aceiasi ca pentru -addnode)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Sterge toate tranzactiile din portofel si recupereaza doar acele parti din blockchain prin -rescan la startup</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Eroare la citirea %s! Toate cheile sînt citite corect, dar datele tranzactiei sau anumite intrări din agenda sînt incorecte sau lipsesc.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Exclude informatia de depanare pentru o categorie. Poate fi folosit impreuna cu -debug=1 pentru a produce loguri de depanare pentru toate categoriile mai ptin una sau mai multe categorii specificate.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Execută comanda cînd o tranzacţie a portofelului se schimbă (%s în cmd este înlocuit de TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Extra tranzactii de tinut in memorie pentru reconstructia compacta a blocurilor (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Daca acest bloc este in lant se asuma ca el si predecesorii sai sunt valizi si potential se sare peste verificarea scriptului (0 pentru a verifica tot, implicit %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Timpul mediu maxim permis pentru ajustarea intarzierii partenerilor din retea. Perspectiva temporala locala poate fi influentata de parteneri aflati inainte sau inapoi cu aceasta valoare. (implicit: %u secunde)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Valoarea maxima totala a taxelor (in %s) care va fi folosita intr-o singura tranzactie din portofel sau tranzactie bruta; daca valoarea este prea mica poate conduce la esuarea tranzactiilor mari (implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Vă rugăm verificaţi dacă data/timpul calculatorului dvs. sînt corecte! Dacă ceasul calcultorului este gresit, %s nu va funcţiona corect.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Va rugam sa contribuiti daca apreciati ca %s va este util. Vizitati %s pentru mai multe informatii despre software.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Găseşte parteneri folosind căutarea DNS, daca adresele sunt reduse (implicit: 1 doar dacă nu s-a folosit -connect)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Micsorarea cerintelor de stocare prin activarea reductiei (stergerii) blocurilor vechi. Aceasta permite RPC pruneblockchain sa fie solicitata pentru a sterge anumite blocuri, si permite reductia automata a blocurilor vechi daca este furnizata o valoare anume in MiB. Acest mod este incompatibil cu -txindex si -rescan. Atentie: Inversarea acestei setari necesita re-descarcarea intregului blockchain. (implicit: 0 = dezactiveaza reductia blocurilor, 1 = permite reductia manuala via RPC, &gt;%u = reductie automata a fisierelor blocurilor pentru a ramane sub valoarea specificata in MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Seteaza cea mai mica taxa (în %s/kB) pentru tranzactiile de adăugat la crearea blocului (implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Setează numărul de thread-uri de verificare a script-urilor (%u la %d, 0 = auto, &lt;0 = lasă atîtea nuclee libere, implicit: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Baza de date a blocurilor contine un bloc ce pare a fi din viitor. Acest lucru poate fi cauzat de setarea incorecta a datei si orei in computerul dvs. Reconstruiti baza de date a blocurilor doar daca sunteti sigur ca data si ora calculatorului dvs sunt corecte.</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Aceasta este o versiune de test preliminară - vă asumaţi riscul folosind-o - nu folosiţi pentru minerit sau aplicaţiile comercianţilor</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Aceasta este taxa de tranzactie la care puteti renunta daca restul este mai mic decat praful la acest nivel.</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Imposibil de refacut blocurile. Va trebui sa reconstruiti baza de date folosind -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Imposibil de a readuce baza de date la statusul pre-fork. Va trebui redescarcat blockchainul.</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Foloseşte UPnP pentru a vedea porturile (implicit: 1 cînd ascultă si fara -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Nume utilizator si hash al parolei pentru conexiuni JSON-RPC. Campul &lt;userpw&gt;vine in formatul: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Un script python canonic este inclus in share/rpcuser. Clientul se conecteaza normal folosind perechea de argumente rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt;. Aceasta optiune poate fi specificata de mai multe ori</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Portofelul nu va crea tranzactii care violeaza limitele mempool chain (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Atenţie: Reţeaua nu pare să fie de acord în totalitate! Aparent nişte mineri au probleme.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Atenţie: Aparent, nu sîntem de acord cu toţi partenerii noştri! Va trebui să faceţi o actualizare, sau alte noduri necesită actualizare.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Daca se salveaza mempool la shutdown si se incarca la restart (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d din ultimele 100 blocuri a o versiune neasteptata</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s corupt, salvare nereuşită</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool trebuie sa fie macar %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; poate fi:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Acceptă conexiuni din afară (implicit: 1 dacă nu se foloseşte -proxy sau -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Ataseaza comentariul la string-ul agentului utilizator</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Încercare de recuperare a cheilor private dintr-un portofel corupt la initiere</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Opţiuni creare bloc:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Nu se poate rezolva adresa -%s: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Optiuni de selectie a chain-ului:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Indexul de schimbare este iesit din parametrii</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Opţiuni conexiune:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Bloc defect din baza de date detectat</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Opţiuni Depanare/Test:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Nu încarcă portofelul şi dezactivează solicitările portofel RPC</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Doriţi să reconstruiţi baza de date blocuri acum?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Activeaza publicarea hashului blocului in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Activeaza publicarea hashului tranzactiei in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Activeaza publicarea blocului brut in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Activeaza publicarea tranzactiei brute in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Activeaza inlocuirea tranzactiei in mempool (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Eroare la crearea %s: Nu se pot crea portofele non-HD cu aceasta versiune.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Eroare la iniţializarea bazei de date de blocuri</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Eroare la iniţializarea mediului de bază de date a portofelului %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Eroare la încărcarea %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Eroare la încărcarea %s: Portofel corupt</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Eroare la încărcarea %s: Portofelul are nevoie de o versiune %s mai nouă</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Eroare la încărcarea bazei de date de blocuri</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Eroare la deschiderea bazei de date de blocuri</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Eroare: Spaţiu pe disc redus!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Nu s-a reuşit ascultarea pe orice port. Folosiţi -listen=0 dacă vreţi asta.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Rescanarea portofelului in timpul initializarii a esuat.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Import...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Incorect sau nici un bloc de geneza găsit. Directorul de retea greşit?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Nu s-a reuşit iniţierea verificării sănătăţii. %s se inchide.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Sumă nevalidă pentru -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Sumă nevalidă pentru -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Suma nevalidă pentru -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Pastreaza tranzactia in mempool sub &lt;n&gt; megaocteti (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Încărcare adrese P2P...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Încărcare banlist...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Locatia cookie-ului auth (implicit: data dir)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Nu sînt destule descriptoare disponibile.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Se conectează doar la noduri în reţeaua &lt;net&gt; (ipv4, ipv6 sau onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Tipareste acest mesaj de ajutor si iesi</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Tipareste versiunea si iesi</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Reductia nu poate fi configurata cu o valoare negativa.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Modul redus este incompatibil cu -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Reconstruieste statusul chainului si indexul blocurilor din fisierele blk*.dat de pe disc.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Reconstruieste statusul chainului din blocurile indexate in acest moment.</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Se reiau blocurile...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Se deruleaza blocurile...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>Trimite tranzactii cu optiunea full-RBF activata (doar RPC, implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Setează mărimea bazei de date cache în megaocteţi (%d la %d, implicit: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Specifică fişierul portofel (în dosarul de date)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Codul sursa este disponibil la %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Calcului taxei de tranzactie si a restului a esuat.</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Nu se poate efectua legatura la %s pe acest computer. %s probabil ruleaza deja.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Argumentul nesuportat -benchmark este ignorat, folositi debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Argument nesuportat -debugnet ignorat, folosiţi -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Argument nesuportat -tor găsit, folosiţi -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Categoria de logging %s=%s nu este suportata.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Actualizarea bazei de date UTXO</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Foloseşte mapare UPnP pentru asculatere port (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Utilizează reţeaua de test</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Comentariul (%s) al Agentului Utilizator contine caractere nesigure.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Se verifică blocurile...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Opţiuni depanare/testare portofel:</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Opţiuni portofel:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Permite conexiunile JSON-RPC din sursa specificată. Valid pentru &lt;ip&gt; sînt IP singulare (ex. 1.2.3.4), o reţea/mască-reţea (ex. 1.2.3.4/255.255.255.0) sau o reţea/CIDR (ex. 1.2.3.4/24). Această opţiune poate fi specificată de mai multe ori</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Legare la o adresa anume si whitelisting pentru toti partenerii conectati la ea. Folositi notatia [host]:port pentru IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Creare de fisiere noi cu permisiunile implicite de sistem, in loc de umask 077 (in efect doar cu dezactivarea functionalitatii portofelului)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Descoperă propriile adrese IP (inţial: 1 cand asculta si fara -proxy sau -externalip)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Eroare: Ascultarea conexiunilor de intrare nu a reuşit (ascultarea a reurnat eroarea %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Execută comanda cînd o alertă relevantă este primită sau vedem o bifurcaţie foarte lungă (%s în cmd este înlocuit de mesaj)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Taxe (in %s/kB) mai mici decît aceasta sumă sînt considerate taxe nule pentru transmiterea, minarea si crearea tranzacţiilor (implicit: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Daca nu este stabilita paytxfee, includeti o taxa suficienta pentru ca tranzactiile sa inceapa sa fie confirmate in medie in n blocuri (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Sumă nevalidă pentru -maxtxfee=&lt;amount&gt;: '%s' (trebuie să fie cel puţin taxa minrelay de %s pentru a preveni blocarea tranzactiilor)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Marimea maxima a datelor in operațiunile de transport de date de tranzactii pe care le retransmitem si le minam (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Randomizati acreditarile pentru fiecare conexiune proxy. Aceasta permite izolarea fluxului Tor (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Suma tranzactiei este prea mica pentru a fi trimisa dupa ce se scade taxa.</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Partenerii din whitelist nu pot fi interzisi DoS si tranzactiile lor sunt intotdeauna retransmise, chiar daca sunt deja in mempool, folositor spre exemplu pentru un gateway</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Trebuie reconstruita intreaga baza de date folosind -reindex pentru a va intoarce la modul non-redus. Aceasta va determina descarcarea din nou a intregului blockchain</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Acceptă cererile publice REST (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Crează automat un serviciu Tor ascuns (implicit: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Conectare prin proxy SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Eroare la incarcarea %s: Nu se poate dezactiva HD la un portofel care este deja HD.</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Eroare la citirea bazei de date. Oprire.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Eroare la actualizarea bazei de date chainstate</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importa blocuri de la un fisier extern blk000??.dat la pornire</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informaţie</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Adresa sau hostname -onion invalide: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Adresa sau hostname -proxy invalide: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Sumă nevalidă pentru -paytxfee=&lt;suma&gt;: '%s' (trebuie să fie cel puţin %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Mască reţea nevalidă specificată în -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Menţine cel mult &lt;n&gt; tranzactii neconectabile in memorie (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Trebuie să specificaţi un port cu -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Optiuni de releu pentru nod</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Opţiuni server RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Se micsoreaza -maxconnections de la %d la %d, datorita limitarilor de sistem.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Rescanează lanţul de blocuri pentru tranzacţiile lipsa la pornire</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Trimite informaţiile trace/debug la consolă în locul fişierului debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Arată toate opţiunile de depanare (uz: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Micşorează fişierul debug.log la pornirea clientului (implicit: 1 cînd nu se foloseşte -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Nu s-a reuşit semnarea tranzacţiei</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>Nu exista -walletdir \"%s\" specificat</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>-walletdir \"%s\" specificat este o cale relativa</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Suma tranzactiei este prea mica pentru plata taxei</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Acesta este un program experimental.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Parola portului de control Tor (implicit: fara parola)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Portul de control Tor de folosit daca se activeaza ascultarea onion (implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Suma tranzacţionată este prea mică</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Tranzacţia are suma prea mare pentru a beneficia de gratuitate</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Tranzacţie prea mare</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Nu se poate lega la %s pe acest calculator. (Legarea a întors eroarea %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Nu s-au putut genera cheile initiale</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Actualizează portofelul la ultimul format la pornire</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Utilizator pentru conexiunile JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Se verifică portofelul(ele)...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Portofelul %s se află în afara directorului portofelului %s</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Avertisment</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Atentie: se activeaza reguli noi necunoscute (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Setare daca se opereaza in modul exclusiv blocuri (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Trebuie să reconstruiţi baza de date folosind -reindex pentru a schimba -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Şterge toate tranzacţiile din portofel...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Optiuni de notificare ZeroMQ:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Parola pentru conexiunile JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Execută comanda cînd cel mai bun bloc se modifică (%s în cmd este înlocuit cu hash-ul blocului)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Permite căutări DNS pentru -addnode, -seednode şi -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = pastreaza tx meta data ex. detinator cont si informatie cerere plata, 2 = elimina tx meta data)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee este setata foarte sus! Se pot plati taxe de aceasta marime pe o singura tranzactie.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Legarre la o anumita adresa pentru a asculta dupa conexiuni JSON-RPC. Aceasta actiune este ignorata, mai putin cand -rpcallowip e si el trecut. Portul este optional si nu tine cont de -rpcport. Foloseste notatia pentru IPv6 [host]:port. Aceasta optiune poate fi folosita de mai multe ori (implicit:127.0.0.1 si ::1 adica localhost, sau daca -rpcallowip a fost specificat, 0.0.0.0 si :: adica toate adresele)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Nu pastra in mempool tranzactii mai mult de &lt;n&gt;ore (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Echivalent octeti per sigop in tranzactii pentru retransmitere si minat (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Eroare la incarcarea %s: Nu se poate activa HD la un portofel care este deja non-HD.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Eroare la incarcarea portofelului %s. Parametrul -wallet trebuie sa specifice doar un nume de fisier (nu o cale)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Taxe (in %s/kB) mai mici decît aceasta sumă sînt considerate taxe nule pentru crearea tranzacţiilor (implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Forteaza retransmiterea tranzactiilor primite de la parteneri din whitelist chiar si atunci cand violeaza politica locala de restransmitere (implicit: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Cît de minuţioasă este verificatea blocurilor prin -checkblocks (0-4, implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Păstrează un index complet al tranzacţiilor folosite de functia rpc getrawtransaction (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Numărul de secunde pentru a preveni reconectarea partenerilor care nu se comporta corect (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Produce toate informaţiile de depanare (implicit: %u &lt;category&gt; furnizată este opţională)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Stabileste serializarea tranzactiilor brute sau hexul blocurile returnate in mod non-verbose, non-segwit(0) sau segwit(1) (implicit: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Specifica directorul in care vor fi tinute portofelele (implicit:&lt;datadir&gt;/wallets daca exista, alternativ &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Specifica locatia fisierului de log pentru depanare: aceasta poate fi o cale absoluta sau o cale relativa la directorul de date (implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Suport pentru filtrarea blocurilor si tranzactiilor cu filtre bloom (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>Nivelul taxei (in %s/kB) care indica toleranta personala pentru renuntarea la rest prin adaugarea restului la taxa (implicit: %s). Nota: o tranzactie este inlaturata daca este praf la acest nivel, dar vom inlatura intotdeauna suma pana la taxa de retransmitere a prafului si o taxa de inlaturare peste aceasta valoare este limitata de estimarea taxei pentru tinta cea mai indepartata.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Aceasta este taxa de tranzactie pe care este posibil sa o platiti daca estimarile de taxe nu sunt disponibile.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Acest produs include software dezvoltat de OpenSSL Project pentru a fi folosit in Toolkitul OpenSSL %s, software criptografic scris de Eric Young si software UPnP scris de Thomas Bernard. </translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Lungimea totala a sirului versiunii retelei (%i) depaseste lungimea maxima (%i). Reduceti numarul sa dimensiunea uacomments. </translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Incearca sa mentina traficul de iesire sub tinta stabilita (in MiB per 24h), 0 = no limit (implicit: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>S-a gasit un argument -socks nesuportat. Setarea versiunii SOCKS nu mai este posibila, sunt suportate doar proxiurile SOCKS5.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Se ignora argumentul nesuportat -whitelistalwaysrelay, folositi -whitelistrelay si/sau -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Foloseste un proxy SOCKS5 separat pentru a gasi parteneri via servicii TOR ascunse (implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Atentie: se mineaza blocuri cu versiune necunoscuta! Este posibil sa fie in vigoare reguli necunoscute.</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Atenţie: fişierul portofelului este corupt, date salvate! Fişierul %s a fost salvat ca %s in %s; dacă balanta sau tranzactiile sunt incorecte ar trebui să restauraţi dintr-o copie de siguranţă.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Parteneri din whitelist ce se conecteaza de la adresa IP specificata (ex. 1.2.3.4) sau o retea cu notatia CIDR (ex. 1.2.3.0/24). Poate fi specificat de mai multe ori.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s este setata foarte sus!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Cauta intotdeauna adrese de parteneri via cautare DNS (implicit:%u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Eroare la incarcarea portofelului %s. Fisierul cu numele -wallet trebuie sa fie un fisier normal. </translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Eroare la incarcarea portofelului %s. Este specificat un fisier -wallet duplicat.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Eroare la incarcarea portofelului %s. Sunt caractere invalide in numele fisierului -wallet.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Cîte blocuri verifică la pornire (implicit: %u, 0 = toate)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Include adresele IP in rezultatul depanarii (default: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Keypool epuizat, folositi intai functia keypoolrefill</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Ascultă pentru conexiuni JSON-RPC pe &lt;port&gt; (implicit: %u sau testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Ascultă pentru conexiuni pe &lt;port&gt; (implicit: %u sau testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Menţine cel mult &lt;n&gt; conexiuni cu partenerii (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Seteaza portofelul sa difuzeze tranzactii</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Tampon maxim pentru recepţie per conexiune, &lt;n&gt;*1000 octeti (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Tampon maxim pentru transmitere per conexiune, &lt;n&gt;*1000 octeti (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Prefixeaza rezultatul depanarii cu marcaj de timp (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Retransmitere si minare a tranzactiilor de transport de date (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Retransmite multisig non-P2SH (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Setează mărimea keypool la &lt;n&gt; (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Seteaza greutatea maxima a blocurilor BIP141 (implicit: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Seteaza numarul de thread-uri care deservesc functii RPC (implicit: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Specificaţi fişierul configuraţie (implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Specificati expirarea timpului conexiunii in milisecunde (minim: 1, implicit %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Specifică fişierul pid (implicit: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Cheltuie restul neconfirmat la trimiterea tranzacţiilor (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Se pornesc threadurile retelei...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Portofelul va evita sa plateasca mai putin decat minimul taxei de retransmisie.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Acesta este minimum de taxa de tranzactie care va fi platit la fiecare tranzactie.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Aceasta este taxa de tranzactie pe care o platiti cand trimiteti o tranzactie.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Prag pentru deconectarea partenerilor care nu se comporta corect (implicit: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Sumele tranzactionate nu pot fi negative</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Tranzacţia are o  lungime prea mare in lantul mempool</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Tranzactia trebuie sa aiba cel putin un destinatar</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Reţeaua specificată în -onlynet este necunoscută: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fonduri insuficiente</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Încărcare index bloc...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Încărcare portofel...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Nu se poate retrograda portofelul</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Rescanare...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Încărcare terminată</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Eroare</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ru.ts",
    "content": "<TS language=\"ru\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Кликните правой кнопкой для редактирования адреса или метки</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Создать новый адрес</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Новый</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Копировать текущий выделенный адрес в буфер обмена</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Копировать</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Закрыть</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Удалить текущий выбранный адрес из списка</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Экспортировать данные текущей вкладки в файл</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Экспорт</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Удалить</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Выберите адрес для отправки перевода</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Выберите адрес для получения перевода</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Выбрать</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Адреса отправки</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Адреса получения</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Это ваши адреса Bitcoin для отправки платежей. Всегда проверяйте количество и адрес получателя перед отправкой перевода.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Это ваши адреса Bitcoin для приёма платежей. Рекомендуется использовать новый адрес получения для каждой транзакции.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>Копировать &amp;адрес</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Копировать &amp;метку</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Правка</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Экспортировать список адресов</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Текст, разделённый запятыми (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Экспорт не удался</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Произошла ошибка сохранения списка адресов в %1. Пожалуйста, повторите попытку.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(нет метки)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Пароль</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Введите пароль</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Новый пароль</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Повторите новый пароль</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Показать пароль</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Зашифровать электронный кошелёк</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Для выполнения операции требуется пароль от вашего кошелька.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Разблокировать бумажник</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Расшифровать бумажник</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Изменить пароль</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Введите старый и новый пароль для кошелька.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Подтвердить шифрование кошелька</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Вы уверены, что хотите зашифровать ваш кошелёк?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Кошелёк зашифрован</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Расшифровка кошелька не удалась</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Маска подсети</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Заблокировано до</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Подписать &amp;сообщение...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Синхронизация с сетью...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Обзор</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Узел</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Транзакции</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Просмотр истории транзакций</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>В&amp;ыход</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Закрыть приложение</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Около %1</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Параметры</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Изменить параметры конфигурации для %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Зашифровать кошелёк...</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(нет метки)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(нет метки)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(нет метки)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(нет метки)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Текст, разделённый запятыми (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Экспорт не удался</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Экспорт</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Экспортировать данные текущей вкладки в файл</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Кошелёк постарается не платить меньше, чем минимальная комиссия передачи.</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Сумма транзакции не должна быть отрицательной</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Недостаточно средств</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Загрузка электронного кошелька...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Не удаётся понизить версию электронного кошелька</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Загрузка завершена</translation>\n    </message>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ru_RU.ts",
    "content": "<TS language=\"ru_RU\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>$Right-click to edit address or label</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Создать новый адрес</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>Новый</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Скопировать текущий выбранный адрес в буфер обмена системы</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>Копировать</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Закрыть</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Удалить выбранный адрес из списка</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Экспортировать данные текущей вкладки в файл</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Экспортировать</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>Удалить</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Выбрать адрес для отправки монет</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Выбрать адрес для получения монет</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>В&amp;ыбрать</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Адреса отправки</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Адреса получения</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Это ваши биткойн адреса для отправки платежа. Всегда проверяйте сумму и адрес получателя перед отправкой платежа.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Это ваши биткойн адреса для получения платежей. Настоятельно рекомендуем использовать новые адреса для получения каждой транзакции.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Копировать адрес</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Копировать &amp;метку</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Редактировать</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Экспортировать список адресов</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Экспорт не удался</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Произошла ошибка при попытке сохранения списка адресов в %1. Пожалуйста попробуйте позже.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(нет метки)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Ввод пароля</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Введите пароль</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Новый пароль</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Повторите новый пароль</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Отобразить пароль</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Введите новый пароль для кошелька.&lt;br/&gt; Пожалуйста используйте пароль из &lt;b&gt; десяти или более произвольных символов&lt;/b&gt;, или &lt;b&gt;восемь или боле слов&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Зашифровать бумажник</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Эта операция требует вашего пароля для разблокировки бумажника</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Разблокировать бумажник</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Эта операция требует пароль от вашего кошелька для его расшифровки.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Расшифровать бумажник</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Изменить пароль</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Введите старый и новый пароль для кошелька.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Подтвердите шифрование бумажника</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Внимание: если вы зашифруете ваш кошелек и потеряете ваш пароль, то вы &lt;b&gt;ПОТЕРЯЕТЕ ВСЕ ВАШИ БИТКОЙНЫ&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Вы уверены, что вы хотите зашифровать ваш кошелек?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Бумажник зашифрован</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 закроется сейчас для завершения процесса шифрования. Запомните что шифрование вашего кошелька не сможет полностью защитить ваши биткойны от кражи при помощи вредоносного ПО, заразившего ваш компьютер.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>ВАЖНО: любые предыдущие резервные копия вашего кошелька, выполненные вами, необходимо заменить новым сгенерированным, зашифрованным файлом кошелька. В целях безопасности, предыдущие резервные копии незашифрованного файла кошелька утратят пригодность после начала использования нового зашифрованного кошелька.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Шифрование кошелька завершилось неудачно.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Шифрование кошелька завершилось неудачно из-за внутренней ошибки. Ваш кошелек не был зашифрован.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Ошибка разблокировки кошелька</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Пароль, введенный при шифровании кошелька, некорректен.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Расшифровка кошелька завершилась неудачно.</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Пароль для кошелька был успешно изменен.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Внимание: клавиша CapsLock включена!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP / маска подсети</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Заблокировано до</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Подписать &amp;сообщение...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Синхронизация с сетью...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Обзор</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Узел</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Отобразить общий обзор кошелька</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Транзакции</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Просмотр истории транзакций</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>В&amp;ыход</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Выйти</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;О программе %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Показать информацию о %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>О библиотеке &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Показать информацию о библиотеке Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Опции...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Изменить опции конфигурации для %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Зашифровать кошелёк</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Создать резервную копию бумажника</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Изменить пароль...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Адреса для отправки...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Адреса для получения...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Открыть &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Нажмите для отключения взаимодействия с сетью.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Взаимодействие с сетью отключено.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Нажмите для включения взаимодействия с сетью.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Синхронизация заголовков (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Реиндексация блоков на диске...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Послать средства на биткойн адрес</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Выполнить резервное копирование кошелька в другом месте расположения</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Изменить пароль, используемый для шифрования кошелька</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Окно отладки</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Открыть консоль отладки и диагностики</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Проверить сообщение...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Кошелек</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Отправить</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Получить</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Показать / Спрятать</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Показать или скрыть главное окно</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Зашифровать приватные ключи, принадлежащие вашему кошельку</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Файл</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Настройки</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Помощь</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Опции командной строки</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Выполняется индексирование блоков на диске...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Выполняется обработка блоков на диске...</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>Выполнено %1</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Последний полученный блок был сгенерирован %1 назад.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Ошибка</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Предупреждение</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Информация</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Готов</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Подключение к пирам...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Дата: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Объем: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Тип: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Ярлык: %1\n</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Входящая транзакция</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Кошелек &lt;b&gt;зашифрован&lt;/b&gt; и сейчас &lt;b&gt;разблокирован&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Кошелек &lt;b&gt;зашифрован&lt;/b&gt; и сейчас &lt;b&gt;заблокирован&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Произошла критическая ошибка. Bitcoin больше не может продолжать безопасную работу и будет закрыт.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Количество:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Байтов:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Количество:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Комиссия:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>После комиссии:</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Подтверждения</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Подтвержденные</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Копировать адрес</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копировать метку</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копировать сумму</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Копировать ID транзакции</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Копировать количество</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>да</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>нет</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(нет метки)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Изменить адрес</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Адрес</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Новый адрес получения</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Новый адрес отправки</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Изменить адрес получения</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Изменить адрес отправки</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Невозможно разблокировать кошелек.</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Будет создана новая директория данных.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Невозможно создать директорию данных здесь.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>версия</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Около %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Опции командной строки</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Использование:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>Опции командной строки</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Выбрать директорию данных при запуске (по умолчанию: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Задать язык, к примеру, \"de_DE\" (по умолчанию: язык системы)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Запускать свернутым</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Отображать начальный экран во время запуска (значение по умолчанию: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Выполнить сброс всех измененных настроек в GUI-интерфейсе</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Добро пожаловать</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Добро пожаловать в %1.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Использовать стандартную директорию данных</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Использовать пользовательскую директорию данных</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Как минимум %1 ГБ данных будет сохранен в эту директорию. Со временем размер будет увеличиваться.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Приблизительно %1 ГБ данных будет сохранено в эту директорию.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Кошелек также будет сохранен в эту директорию.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Ошибка: невозможно создать указанную директорию данных \"%1\".</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Ошибка</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Количество оставшихся блоков</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Неизвестно...</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Прогресс</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>выполняется вычисление...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Расчетное время, оставшееся до синхронизации</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Спрятать</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Открыть URI</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Опции</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Автоматически запускать %1 после входа в систему.</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Размер кеша &amp;базы данных</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>МБ</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP-адрес прокси-сервера (к примеру, IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Убрать значок с области уведомлений.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Спрятать иконку в трее</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Открыть файл конфигурации</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Сбросить все опции клиента к значениям по умолчанию.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Сбросить опции</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Сеть</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>К&amp;ошелёк</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Эксперт</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Пробросить порт через &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Подключится к сети Bitcoin через SOCKS5 прокси.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Выполнить подключение через прокси-сервер SOCKS5 (прокси-сервер по умолчанию):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>IP прокси:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Порт:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Порт прокси: (напр. 9050)</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Окно</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Отобразить только значок в области уведомлений после сворачивания окна.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;ОК</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Отмена</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Подтвердить сброс опций</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Для активации изменений необходим перезапуск клиента.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Клиент будет закрыт. Продолжить далее?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Опции конфигурации</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Ошибка</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Невозможно открыть файл конфигурации.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Это изменение потребует перезапуск клиента.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Введенный адрес прокси-сервера недействителен.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Immature:</source>\n        <translation>Незрелые:</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Балансы</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Всего:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Ваш текущий баланс:</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Ваш текущий баланс (только чтение):</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Последние транзакции</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Ошибка связи с %1: %2</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Неправильный ответ от сервера %1</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Оплата подтверждена</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Node/Service</source>\n        <translation>Узел/служба</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Отправлено</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Получено</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Введите биткоин-адрес (напр. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 д</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 ч</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 м</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 с</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Н/Д</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 и %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1  Б</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1  КБ</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1  МБ</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 ГБ</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>неизвестно</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Ошибка: указанная директория данных \"%1\" не существует.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Ошибка: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Сохранить изображение...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Копировать изображение</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Сохранить QR-код</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG Картинка (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Н/Д</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Версия клиента</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Информация</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Окно отладки</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Сеть</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Название</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Количество соединений</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Текущее количество блоков</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Пул памяти</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Текущее количество транзакций</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Использование памяти</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Сбросить</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Получено</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Отправлено</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Пиры</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Заблокированные пиры</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Версия</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Уменьшить размер шрифта</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Увеличить размер шрифта</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Открыть</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Консоль</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;час</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;день</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;неделя</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;год</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Ввести %1 для обзора доступных команд.</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>никогда</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Да</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Нет</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Неизвестно</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Очистить все поля формы.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Отчистить</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Отобразить выбранный запрос (выполняет то же, что и двойной щелчок на записи)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Показать</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Удалить выбранные записи со списка</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Удалить</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Копировать URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копировать метку</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Копировать сообщение</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копировать сумму</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-код</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Сохранить изображение...</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Информация о платеже</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Сообщение</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Ошибка преобразования URI в QR-код.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Сообщение</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(нет метки)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(нет сообщений)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Отправить монеты</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>выбрано автоматически</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Количество:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Байтов:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Количество:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Комиссия:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>После комиссии:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Комиссия за транзакцию:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Выбрать...</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Спрятать</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Рекомендованное значение:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Пользовательское значение:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Отправить нескольким получателям сразу</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Очистить все поля формы.</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Баланс:</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Копировать количество</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копировать сумму</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Вы действительно хотите выполнить отправку?</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>или</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Подтвердить отправку монет</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Сумма оплаты должна быть больше 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Количество превышает ваш баланс.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Создание транзакции завершилось неудачей!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Транзакция была отменена по следующей причине: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Комиссия более чем в %1 считается абсурдно высокой.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(нет метки)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Выбрать предыдущий использованный адрес</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Вставить адрес из буфера обмена</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Удалить эту запись</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Использовать доступный баланс</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Сообщение:</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Выполнить оплату в пользу:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Да</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 завершает работу...</translation>\n    </message>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Выбрать предыдущий использованный адрес</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Вставить адрес из буфера обмена</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Подпись</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Скопировать текущую подпись в буфер обмена системы</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Введенный адрес недействителен.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Необходимо проверить адрес и выполнить повторную попытку.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Разблокирование кошелька было отменено.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Сообщение подписано.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Невозможно расшифровать подпись.</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Status</source>\n        <translation>Статус</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Источник</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>От</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>неизвестно</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Сообщение</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>Details for %1</source>\n        <translation>Детальная информация по %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Тип</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(нет метки)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Статус транзакции. Для отображения количества подтверждений необходимо навести курсор на это поле.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Дата и время получения транзакции.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Тип транзакции.</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Увеличить комиссию за транзакцию</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Копировать адрес</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копировать метку</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копировать сумму</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Копировать ID транзакции</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Копировать все детали транзакции</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Отобразить детали транзакции</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Тип</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Метка</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адрес</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ИН</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Экспорт не удался</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>При попытке сохранения истории транзакций в %1 произошла ошибка.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Экспорт выполнен успешно</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Историю транзакций было успешно сохранено в %1.</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Отправить монеты</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Увеличение комиссии за транзакцию завершилось неудачей</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Желаете увеличить комиссию?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Текущее значение комиссии</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Увеличить</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Новое значение комиссии:</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Невозможно подписать транзакцию</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Не удалось выполнить транзакцию</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>Экспортировать</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Экспортировать данные в текущей вкладке в файл</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Создать резервную копию кошелька</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Данные кошелька (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Создание резервной копии кошелька завершилось неудачей</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>При попытке сохранения данных кошелька в %1 произошла ошибка.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Резервное копирование выполнено успешно</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Данные кошелька были успешно сохранены в %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Опции:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Указать директорию данных</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Ошибка: произошла критическая внутренняя ошибка, для получения деталей см. debug.log</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Невозможно запустить HTTP-сервер. Для получения более детальной информации необходимо обратиться к журналу отладки.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Разработчики %s</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d из последних 100 блоков имеют неожиданную версию</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Опции соединения:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Авторское право (©) %i-%i</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Ошибка загрузки %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Ошибка загрузки %s: кошелек поврежден</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Ошибка загрузки %s: кошелек требует более поздней версии %s</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Ошибка: место на диске заканчивается!</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Выполняется импорт...</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Выполняется загрузка P2P-адресов...</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Недоступно достаточного количества дескрипторов файла.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Подключаться только к узлам в сети &lt;net&gt; (ipv4, ipv6 или onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Распечатать это сообщение справки и выйти</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Распечатать версию и выйти</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Указать файл кошелька (в пределах директории данных)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Неподдерживаемый аргумент -debugnet пропущен, необходимо использовать -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Обнаружен неподдерживаемый аргумент -tor, необходимо использовать -onion.</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Опции кошелька:</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>bitcoin-core</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(значение по умолчанию: %u)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Выполнить подключение через прокси-сервер SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Ошибка чтения с базы данных, выполняется закрытие.</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Информация</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Подписание транзакции завершилось неудачей</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Предупреждение</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(значение по умолчанию: %s)</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Выполняется загрузка кошелька...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Невозможно выполнить переход на более раннюю версию кошелька</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Выполняется повторное сканирование...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Загрузка завершена</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Ошибка</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_si.ts",
    "content": "<TS language=\"si\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>නව ලිපිනයක් සාදන්න</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>කාසි යැවිය යුතු ලිපිනය තෝරන්න</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>කාසි ලැබිය යුතු ලිපිනය තෝරන්න</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>යවන ලිපින</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>ලබන ලිපින</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ලේබලය</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>ලිපිනය</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ලේබලයක් නැත)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Warning</source>\n        <translation>අවවාදය</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>තොරතුර</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>ප්‍රමාණය:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>බයිට්ස්:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>අගය:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>ගාස්තුව:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>අගය</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>දිනය</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ඔව්</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>නැත</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ලේබලයක් නැත)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(වෙනස)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>නම</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>ආයුබෝවන්</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>calculating...</source>\n        <translation>ගණනනය කරමින්...</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>අගය</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>ලිපිනය</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>අගය</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ලේබලය</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>දිනය</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ලේබලය</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ලේබලයක් නැත)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>ප්‍රමාණය:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>බයිට්ස්:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>අගය:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>ගාස්තුව:</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ලේබලයක් නැත)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>දිනය</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>අගය</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>දිනය</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ලේබලය</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ලේබලයක් නැත)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Date</source>\n        <translation>දිනය</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ලේබලය</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>ලිපිනය</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Information</source>\n        <translation>තොරතුර</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>අවවාදය</translation>\n    </message>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_sk.ts",
    "content": "<TS language=\"sk\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Kliknutím pravým tlačidlom upraviť adresu alebo popis</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Vytvoriť novú adresu</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Nový</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Zkopírovať práve zvolenú adresu</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopírovať</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Z&amp;atvoriť</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Vymaž vybranú adresu zo zoznamu</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportovať tento náhľad do súboru</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportovať...</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Zmazať</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Zvoľte adresu kam poslať mince</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Zvoľte adresu na ktorú chcete prijať mince</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Vy&amp;brať</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Odosielajúce adresy</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Prijímajúce adresy</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Toto sú Vaše Bitcoin adresy pre posielanie platieb. Vždy skontrolujte sumu a prijímaciu adresu pred poslaním mincí.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Toto sú vaše Bitcoin adresy pre prijímanie platieb. Odporúča sa použiť vždy novú prijímaciu adresu pre každú transakciu.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopírovať adresu</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopírovať &amp;popis</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Upraviť</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportovať zoznam adries</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Čiarkou oddelovaný súbor (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Export zlyhal</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Nastala chyba pri pokuse uložiť zoznam adries do %1. Skúste znovu.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Popis</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez popisu)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialóg hesla</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Zadajte heslo</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nové heslo</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Zopakujte nové heslo</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Ukázať heslo</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Zadajte nové heslo k peňaženke.&lt;br/&gt;Prosím použite heslo s dĺžkou &lt;b&gt;desať alebo viac náhodných znakov&lt;/b&gt;, prípadne &lt;b&gt;osem alebo viac slov&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Zašifrovať peňaženku</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Táto operácia potrebuje heslo k vašej peňaženke aby ju mohla odomknúť.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Odomknúť peňaženku</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Táto operácia potrebuje heslo k vašej peňaženke na dešifrovanie peňaženky.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dešifrovať peňaženku</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Zmena hesla</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Zadajte staré heslo a nové heslo k peňaženke.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Potvrďte zašifrovanie peňaženky</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Varovanie: Ak zašifrujete peňaženku a stratíte heslo, &lt;b&gt;STRATÍTE VŠETKY VAŠE BITCOINY&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Ste si istí, že si želáte zašifrovať peňaženku?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Peňaženka zašifrovaná</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 sa teraz zavrie, aby sa ukončil proces šifrovania. Zašifrovanie peňaženky neochráni úplne pred krádežou bitcoinov škodlivými programami, ktoré prenikli do vášho počítača.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>DÔLEŽITÉ: Všetky predchádzajúce zálohy vašej peňaženky, ktoré ste vykonali by mali byť nahradené novo vytvorenou, zašifrovanou peňaženkou. Z bezpečnostných dôvodov bude predchádzajúca záloha nezašifrovanej peňaženky k ničomu, akonáhle začnete používať novú, zašifrovanú peňaženku.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Šifrovanie peňaženky zlyhalo</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Šifrovanie peňaženky zlyhalo kôli internej chybe. Vaša peňaženka nebola zašifrovaná.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Zadané heslá nesúhlasia.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Odomykanie peňaženky zlyhalo</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Zadané heslo pre dešifrovanie peňaženky bolo nesprávne.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Zlyhalo šifrovanie peňaženky.</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Heslo k peňaženke bolo úspešne zmenené.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Upozornenie: Máte zapnutý Caps Lock!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Maska stiete</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Blokovaný do</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Podpísať &amp;správu...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synchronizácia so sieťou...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Prehľad</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Uzol</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Zobraziť celkový prehľad o peňaženke</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakcie</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Prechádzať históriu transakcií</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>U&amp;končiť</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Ukončiť program</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;O %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Ukázať informácie o %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>O &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Zobrazit informácie o Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Možnosti...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Upraviť nastavenia pre %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Zašifrovať Peňaženku...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Zálohovať peňaženku...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Zmena Hesla...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Odosielajúce adresy ...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Prijímajúce adresy...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Otvoriť &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Kliknite pre zakázanie sieťovej aktivity.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Sieťová aktivita zakázaná.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Kliknite pre povolenie sieťovej aktivity.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synchronizujú sa hlavičky (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Preindexúvam bloky na disku...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Poslať bitcoins na adresu</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Zálohovať peňaženku na iné miesto</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Zmeniť heslo použité na šifrovanie peňaženky</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Okno pre ladenie</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Otvor konzolu pre ladenie a diagnostiku</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>O&amp;veriť správu...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Peňaženka</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Odoslať</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Prijať</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Zobraziť / Skryť</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Zobraziť alebo skryť hlavné okno</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Zašifruj súkromné kľúče ktoré patria do vašej peňaženky</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Podpísať správu s vašou adresou Bitcoin aby ste preukázali že ju vlastníte</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Overiť či správa bola podpísaná uvedenou Bitcoin adresou</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Súbor</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Nastavenia</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Pomoc</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Lišta záložiek</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Vyžiadať platby (vygeneruje QR kódy a bitcoin: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Zobraziť zoznam použitých adries odosielateľa a ich popisy</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Zobraziť zoznam použitých prijímacích adries a ich popisov</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Otvoriť bitcoin URI alebo výzvu k platbe</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Možnosti príkazového riadku</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktívne pripojenie do siete Bitcoin</numerusform><numerusform>%n aktívne pripojenia do siete Bitcoin</numerusform><numerusform>%n aktívnych pripojení do siete Bitcoin</numerusform><numerusform>%n aktívnych pripojení do siete Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indexujem bloky na disku...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Spracovávam bloky na disku...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Spracovaných %n blok transakčnej histórie.</numerusform><numerusform>Spracovaných %n bloky transakčnej histórie.</numerusform><numerusform>Spracovaných %n blokov transakčnej histórie.</numerusform><numerusform>Spracovaných %n blokov transakčnej histórie.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 pozadu</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Posledný prijatý blok bol vygenerovaný pred: %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transakcie po tomto čase ešte nebudú viditeľné.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Chyba</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Upozornenie</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informácia</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Aktualizovaný</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Ukáž %1 zoznam možných nastavení Bitcoinu pomocou príkazového riadku</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 klient</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Pripája sa k partnerom...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Sťahujem...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Dátum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Suma: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Typ: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Popis: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresa: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Odoslané transakcie</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Prijatá transakcia</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Generovanie HD kľúčov je &lt;b&gt;zapnuté&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Generovanie HD kľúčov je &lt;b&gt;vypnuté&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Peňaženka je &lt;b&gt;zašifrovaná&lt;/b&gt; a momentálne &lt;b&gt;odomknutá&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Peňaženka je &lt;b&gt;zašifrovaná&lt;/b&gt; a momentálne &lt;b&gt;zamknutá&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Vyskytla sa kritická chyba. Bitcoin nemôže ďalej bezpečne pokračovať a ukončí sa.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Výber mince</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Množstvo:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtov:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Suma:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Poplatok:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Prach:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Po poplatku:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Zmena:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(ne)vybrať všetko</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Stromový režim</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Zoznamový režim</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Suma</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Prijaté s označením</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Prijaté s adresou</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Potvrdenia</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potvrdené</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopírovať adresu</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopírovať popis</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopírovať sumu</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopírovať ID transakcie</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Uzamknúť neminuté</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Odomknúť neminuté</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopírovať množstvo</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopírovať poplatok</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopírovať po poplatkoch</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopírovať bajty</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopírovať prach</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopírovať zmenu</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 zamknutých)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>áno</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nie</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Tento popis sčervenie ak ktorýkoľvek príjemca dostane sumu menšiu ako súčasný limit pre \"prach\".</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Môže sa líšiť o +/- %1 satoshi pre každý vstup.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez popisu)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>zmena od %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(zmena)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Upraviť adresu</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Popis</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Popis tejto položký v zozname adries je prázdny</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Adresa spojená s týmto záznamom v adresári. Možno upravovať len pre odosielajúce adresy.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresa</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Nová adresa pre prijímanie</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Nová adresa pre odoslanie</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Upraviť prijímajúcu adresu</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Upraviť odosielaciu adresu</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Vložená adresa \"%1\" nieje platnou adresou Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Vložená adresa \"%1\" sa už nachádza v adresári.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Nepodarilo sa odomknúť peňaženku.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Generovanie nového kľúča zlyhalo.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Bude vytvorený nový dátový adresár.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>názov</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Priečinok už existuje. Pridajte \"%1\" ak chcete vytvoriť nový priečinok tu.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Cesta už existuje a nie je to adresár.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Tu nemôžem vytvoriť dátový adresár.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>verzia</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>O %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Voľby príkazového riadku</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Použitie:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>voľby príkazového riadku</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Možnosti používateľského rozhrania:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Vyberte dátový priečinok pri štarte (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Nastavte jazyk, napríklad \"de_DE\" (predvolené: podľa systému)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Spustiť minimalizované</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Nastaviť SSL root certifikáty pre vyžiadanie platby (predvolené: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Zobraziť uvítaciu obrazovku pri štarte (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Zrušiť všetky zmeny v GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Vitajte</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Vitajte v %1</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Keďže toto je prvé spustenie programu, môžete si vybrať, kam %1 bude ukladať vaše údaje.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Hneď po stlačení OK, začne %1 stťahovať a spracovávať celý %4 reťazec blokov (%2 GB), začínajúc nejstaršími transakcemi z roku %3, kdey bol %4 spustený.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Prvá synchronizácia je veľmi náročná a môžu sa tak vďaka nej začat na Vašom počítači projavovať doteraz skryté hárdwarové problémy. Vždy, keď spustíte %1, bude sťahovanie pokračovať tam, kde skončilo.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Ak ste ombedzili úložný priestor pre reťazec blokov (tj. povolil prepezávanie), tak sa historické dáta sice stiahnu a zpracujú, ale následne sa zasa zzažú, aby nezaberala na disku miesto.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Použiť predvolený dátový adresár</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Použiť vlastný dátový adresár:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Aspoň %1 GB dát bude uložených v tejto zložke a postupom času bude narastať.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Približne %1 GB dát bude uložených v tejto zložke.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 bude sťahovať kopiu reťazca blokov.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Tvoja peňaženka bude uložena tiež v tomto adresári.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Chyba: Zadaný priečinok pre dáta \"%1\" nemôže byť vytvorený.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Chyba</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB voľného miesta</numerusform><numerusform>%n GB voľného miesta</numerusform><numerusform>%n GB voľného miesta</numerusform><numerusform>%n GB voľného miesta</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(z %n GB potrebného)</numerusform><numerusform>(z %n GB potrebných)</numerusform><numerusform>(z %n GB potrebných)</numerusform><numerusform>(z %n GB potrebných)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Forma</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Nedávne transakcie nemusia byť ešte viditeľné preto môže byť zostatok vo vašej peňaženke nesprávny. Táto informácia bude správna keď sa dokončí synchronizovanie peňaženky so sieťou bitcoin, ako je rozpísané nižšie.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Pokus o minutie bitcoinov, ktoré sú ovplyvnené ešte nezobrazenými transakciami, nebude sieťou akceptovaný.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Počet zostávajúcich blokov</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Neznáme...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Čas posledného bloku</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Postup synchronizácie</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Prírastok postupu za hodinu</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>počíta sa...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Odhadovaný čas do ukončenia synchronizácie</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Skryť</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Neznámy. Synchronizujú sa hlavičky (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Otvoriť URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Otvoriť požiadavku na zaplatenie z URI alebo súboru</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Vyberte súbor s výzvou k platbe</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Vyberte ktorý súbor s výzvou na platbu otvoriť</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Možnosti</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Hlavné</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Automaticky spustiť %1 pri spustení systému.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Spustiť %1 pri prihlásení</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Veľkosť vyrovnávacej pamäti &amp;databázy</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Počet &amp;vlákien overujúcich skript</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP adresy proxy (napr. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Ukazuje, či se zadaná východzia SOCKS5 proxy používá k pripojovaniu k peerom v rámci tohoto typu siete.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Použiť samostatný SOCKS&amp;5 proxy server na dosiahnutie počítačov cez skryté služby Tor:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Skryť ikonu zo systémovej lišty.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Skryť ikonu v oblasti oznámení</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimalizovať namiesto ukončenia aplikácie keď sa okno zavrie. Keď je zvolená táto možnosť, aplikácia sa zavrie len po zvolení Ukončiť v menu.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL tretích strán (napr. prehliadač blockchain) ktoré sa zobrazujú v záložke transakcií ako položky kontextového menu. %s v URL je nahradené hash-om transakcie. Viaceré URL sú oddelené zvislou čiarou |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktívne možnosti príkazového riadku ktoré prepíšu možnosti vyššie:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Otvorte konfiguračný súbor %1 s pracovného adresára.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Otvoriť konfiguračný súbor </translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Vynulovať všetky voľby klienta na predvolené.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Vynulovať voľby</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Sieť</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = nechať toľko jadier voľných)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Peňaženka</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Povoliť možnosti \"&amp;coin control\"</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Ak vypnete míňanie nepotvrdeného výdavku tak výdavok z transakcie bude možné použiť až keď daná transakcia bude mať aspoň jedno potvrdenie. Toto má vplyv aj na výpočet vášho zostatku.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Minúť nepotvrdený výdavok</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Automaticky otvorit port pre Bitcoin na routeri. Toto funguje len ak router podporuje UPnP a je táto podpora aktivovaná.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Mapovať port pomocou &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Prijať spojenia zvonku.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Povoliť prichá&amp;dzajúce spojenia</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Pripojiť do siete Bitcoin cez proxy server SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Pripojiť cez proxy server SOCKS5 (predvolený proxy).</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port proxy (napr. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Použité pre získavanie peerov cez:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Pripojiť k Bitcoinovej sieti cez separované SOCKS5 proxy pre skrytú službu Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Okno</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Zobraziť len ikonu na lište po minimalizovaní okna.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Zobraziť len ikonu na lište po minimalizovaní okna.</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimalizovať pri zavretí</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Zobrazenie</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Jazyk užívateľského rozhrania:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Jazyk uživateľského rozhrania sa dá nastaviť tu. Toto nastavenie sa uplatní až po reštarte %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Zobrazovať hodnoty v jednotkách:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Zvoľte ako deliť bitcoin pri zobrazovaní pri platbách a užívateľskom rozhraní.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Či zobrazovať možnosti \"Coin control\" alebo nie.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>URL transakcií tretích strán</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Zrušiť</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>predvolené</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>žiadne</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Potvrdiť obnovenie možností</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Reštart klienta potrebný pre aktivovanie zmien.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Klient bude vypnutý, chcete pokračovať?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Možnosti nastavenia</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Konfiguračný súbor slúží k nastavovaniu užívateľsky pokročilých možností, ktoré majú prednosť pred konfiguráciou z GUI. Parametre z príkazovej riadky však majú pred konfiguračným súborom prednosť.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Chyba</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Konfiguračný súbor nejde otvoriť.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Táto zmena by vyžadovala reštart klienta.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Zadaná proxy adresa je neplatná.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Forma</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Zobrazené informácie môžu byť neaktuálne. Vaša peňaženka sa automaticky synchronizuje so sieťou Bitcoin po nadviazaní spojenia, ale tento proces ešte nie je ukončený.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Iba sledované:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Disponibilné:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Váš aktuálny disponibilný zostatok</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Čakajúce potvrdenie:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Suma transakcií ktoré ešte neboli potvrdené a ešte sa nepočítajú do disponibilného zostatku</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Nezrelé:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Vytvorený zostatok ktorý ešte nedosiahol zrelosť</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Stav účtu</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Celkovo:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Váš súčasný celkový zostatok</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Váš celkový zostatok pre adresy ktoré sa iba sledujú</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Použiteľné:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Nedávne transakcie</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Nepotvrdené transakcie pre adresy ktoré sa iba sledujú</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Vyťažená suma pre adresy ktoré sa iba sledujú ale ešte nie je dozretá</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Aktuálny celkový zostatok pre adries ktoré sa iba sledujú</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Chyba pri vyžiadaní platby</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Nemôžeme spustiť Bitcoin: obsluha click-to-pay</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI manipulácia</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>URL pre stiahnutie výzvy na zaplatenie je neplatné: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Neplatná adresa platby %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI sa nedá analyzovať! To môže byť spôsobené neplatnou Bitcoin adresou alebo zle nastavenými vlastnosťami URI.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Obsluha súboru s požiadavkou na platbu</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Súbor s výzvou na zaplatenie sa nedá čítať! To môže byť spôsobené aj neplatným súborom s výzvou.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Požiadavka na platbu zamietnutá</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Sieť požiadavky na platbu nie je zhodná so sieťou klienta.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Vypršala platnosť požiadavky na platbu.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Požiadavka na platbu nie je inicializovaná</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Program nepodporuje neoverené platobné požiadavky na vlastné skripty.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Chybná požiadavka na platbu.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Požadovaná suma platby %1 je príliš nízka (považovaná za prach).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Vrátenie z  %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Požiadavka na platbu %1 je príliš veľká (%2 bajtov, povolené je %3 bajtov).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Chyba komunikácie s %1: %2 </translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Požiadavka na platbu nemôže byť analyzovaná!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Zlá odpoveď zo servera %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Chyba požiadavky siete</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Platba potvrdená</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Aplikácia</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Uzol/Služba</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>ID uzlu</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Odozva</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Odoslané</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Prijaté</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Suma</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Zadajte bitcoin adresu (napr. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Žiadne</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>nie je k dispozícii</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n sekunda</numerusform><numerusform>%n sekundy</numerusform><numerusform>%n sekúnd</numerusform><numerusform>%n sekúnd</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minúta</numerusform><numerusform>%n minúty</numerusform><numerusform>%n minút</numerusform><numerusform>%n minút</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n hodina</numerusform><numerusform>%n hodiny</numerusform><numerusform>%n hodín</numerusform><numerusform>%n hodín</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n deň</numerusform><numerusform>%n dni</numerusform><numerusform>%n dní</numerusform><numerusform>%n dní</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n týždeň</numerusform><numerusform>%n týždne</numerusform><numerusform>%n týždňov</numerusform><numerusform>%n týždňov</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation> %1 a  %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n rok</numerusform><numerusform>%n roky</numerusform><numerusform>%n rokov</numerusform><numerusform>%n rokov</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 ešte nebol bezpečne ukončený...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>neznámy</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Chyba: Zadaný adresár pre dáta „%1“ neexistuje.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Chyba: Nemôžem spracovať konfiguračný súbor: %1. Používajte iba syntax klúč=hodnota.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Chyba: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Uložiť obrázok...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Kopírovať obrázok</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Uložiť QR Code</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG obrázok (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>nie je k dispozícii</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Verzia klienta</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informácia</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Okno pre ladenie</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Všeobecné</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Používa verziu BerkeleyDB</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Priečinok s dátami</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Čas spustenia</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Sieť</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Názov</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Počet pripojení</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Reťazec blokov</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Aktuálny počet blokov</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Pamäť Poolu</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Aktuálny počet transakcií</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Využitie pamäte</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Vynulovať</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Prijaté</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Odoslané</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Partneri</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Zablokované spojenia</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Vyberte počítač pre zobrazenie podrobností.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Povolené</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Smer</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Verzia</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Počiatočný blok</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Synchronizované hlavičky\n</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Synchronizované bloky</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Aplikácia</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Otvoriť %1 ladiaci výpis z aktuálnej zložky. Pre veľké súbory to môže chvíľu trvať.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Zmenšiť písmo</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Zväčšiť písmo</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Služby</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Skóre zákazu</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Dĺžka spojenia</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Posledné odoslanie</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Posledné prijatie</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Čas odozvy</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Trvanie aktuálnej požiadavky na odozvu.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Čakanie na odozvu</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Minimálna odozva</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Časový posun</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Čas posledného bloku</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Otvoriť</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konzola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Sieťová prevádzka</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Celkovo:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Dnu:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Von:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Súbor záznamu ladenia</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Vymazať konzolu</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hodinu</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;deň</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;týždeň</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;rok</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Odpojiť</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Zakázať na</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Zrušiť zákaz</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Vitajte v %1 RPC konzole</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>V histórii sa pohybujete šípkami hore a dole a pomocou %1 čistíte obrazovku.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Napíš %1 pre prehľad dostupných príkazov.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Pre viac informácií ako používať túto konzolu napíšte %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>UPOZORNENIE: Podvodníci sú aktívni a hovoria používateľom, aby sem zadávali príkazy, ktorými im ale následne vykradnú ich peňaženky. Nepoužívajte túto konzolu, ak plne nepoynáte dôsledky jednotlivých príkazov.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Sieťová aktivita zakázaná</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(ID uzlu: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>cez %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nikdy</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Prichádzajúce</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Odchádzajúce</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Áno</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nie</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>neznámy</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Suma:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Popis:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Správa:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Pridať voliteľnú správu k výzve na zaplatenie, ktorá sa zobrazí keď bude výzva otvorená. Poznámka: Správa nebude poslaná s platbou cez sieť Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Voliteľný popis ktorý sa pridá k tejto novej prijímajúcej adrese.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Použite tento formulár pre vyžiadanie platby. Všetky polia sú &lt;b&gt;voliteľné&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Voliteľná požadovaná suma. Nechajte prázdne alebo nulu ak nepožadujete určitú sumu.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Vyčistiť všetky polia formulára.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Vyčistiť</translation>\n    </message>\n    <message>\n        <source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</source>\n        <translation>Natívne segwit adresy (Bech32 or BIP-173) znižujú Vaše budúce transakčné poplatky and ponúkajú lepšiu ochranu pred preklepmi, avšak staré peňaženky ich nepodporujú. Ak je toto pole nezaškrtnuté, bude vytvorená adresa kompatibilná so staršími peňaženkami.</translation>\n    </message>\n    <message>\n        <source>Generate native segwit (Bech32) address</source>\n        <translation>Generovať natívnu segwit adresu (Bech32)</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>História vyžiadaných platieb</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Vyžiadať platbu</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Zobraz zvolenú požiadavku (urobí to isté ako dvoj-klik na záznam)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Zobraziť</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Odstrániť zvolené záznamy zo zoznamu</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Odstrániť</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Kopírovať URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopírovať popis</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopírovať správu</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopírovať sumu</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR kód</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopírovať &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopírovať &amp;adresu</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Uložiť obrázok...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Vyžiadať platbu pre %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Informácia o platbe</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Suma</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Popis</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Správa</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Výsledné URI je príliš dlhé, skúste skrátiť text pre popis alebo správu.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Chyba kódovania URI do QR Code.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Popis</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Správa</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez popisu)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(žiadna správa)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(nepožadovaná žiadna suma)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Požadované</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Poslať Bitcoins</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Možnosti \"Coin Control\"</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Vstupy...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automaticky vybrané</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Nedostatok prostriedkov!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Množstvo:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bajtov:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Suma:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Poplatok:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Po poplatku:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Zmena:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Ak aktivované ale adresa pre výdavok je prázdna alebo neplatná, výdavok bude poslaný na novovytvorenú adresu.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Vlastná adresa zmeny</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Poplatok za transakciu:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Zvoliť...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Použitie núdzového poplatku („fallbackfee“) môže vyústiť v transakciu, ktoré bude trvat hodiny nebo dny (prípadne večnosť), kým bude potvrdená. Zvážte preto ručné nastaveníe poplatku, prípadne počkajte, až sa Vám kompletne zvaliduje reťazec blokov.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Upozornenie: teraz nie je možné poplatok odhadnúť.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>zbaliť nastavenia poplatkov</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>za kilobajt</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Ak je poplatok nastavený na 1000 satoshi a transakcia je veľká len 250 bajtov, potom \"za kilobajt\" zaplatí poplatok 250 satoshi, ale \"spolu aspoň\" zaplatí 1000 satoshi. Pre transakcie väčšie ako kilobajt platia oba spôsoby za každý kilobajt.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Skryť</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Zaplatenie len minimálneho poplatku je v poriadku, pokiaľ existuje menej transakcií ako miesta v blokoch. Uvedomte si však, že ak bude vyšší dopyt po transakciách ako dokáže sieť spracovať, môže byť vaša transakcia odsúvaná a nepotvrdená donekonečna.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(prečítajte si nápovedu pod kurzorom)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Odporúčaný:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Vlastný:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Automatický poplatok ešte nebol vypočítaný. Toto zvyčajne trvá niekoľko blokov...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Poslať viacerým príjemcom naraz</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;Pridať príjemcu</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Vyčistiť všetky polia formulára.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Prach:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Cieľový čas potvrdenia:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Povoliť dodatočné navýšenie poplatku (tzv. „Replace-By-Fee“)</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>S dodatočným navýšením poplatku (BIP-125, tzv. „Replace-By-Fee“), môžete zvýšiť poplatok aj po odoslaní. Bez toho, by mohol byť navrhnutý väčší transakčný poplatok, aby kompenzoval zvýšené riziko omeškania transakcie.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Zmazať všetko</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Zostatok:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Potvrďte odoslanie</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Odoslať</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopírovať množstvo</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopírovať sumu</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopírovať poplatok</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopírovať po poplatkoch</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopírovať bajty</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopírovať prach</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopírovať zmenu</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blokov)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 do %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Určite chcete odoslať transakciu?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>pridané ako poplatok za transakciu</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Celková suma %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>alebo</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Poplatok môžete navýšiť neskôr (vysiela sa \"Replace-By-Fee\" - nahradenie poplatkom, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Nevysiela sa \"Replace-By-Fee\" - nahradenie poplatkom, BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Potvrďte odoslanie mincí</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Adresa príjemcu je neplatná. Prosím, overte ju.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Suma na úhradu musí byť väčšia ako 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Suma je vyššia ako Váš zostatok.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Celková suma prevyšuje Váš zostatok ak sú započítané aj transakčné poplatky %1.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Našla sa duplicitná adresa: každá adresa by sa mala použiť len raz.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Vytvorenie transakcie zlyhalo!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Transakcia bola odmietnutá z nasledujúceho dôvodu: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Poplatok vyšší ako %1 sa považuje za neprimerane vysoký.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Vypršala platnosť požiadavky na platbu.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Zaplatiť iba požadovaný poplatok %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Odhadovaný začiatok potvrdzovania po %n bloku.</numerusform><numerusform>Odhadovaný začiatok potvrdzovania po %n blokoch.</numerusform><numerusform>Odhadovaný začiatok potvrdzovania po %n blokoch.</numerusform><numerusform>Odhadovaný začiatok potvrdzovania po %n blokoch.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Varovanie: Neplatná Bitcoin adresa</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>UPOZORNENIE: Neznáma zmena adresy</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Potvrďte zmenu adresy</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Zadaná adresa nie je súčasťou tejto peňaženky. Časť alebo všetky peniaze z peňaženky môžu byť odoslané na túto adresu. Ste si istý?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez popisu)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Su&amp;ma:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Zapla&amp;tiť:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Popis:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Vybrať predtým použitú adresu</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Toto je normálna platba.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Zvoľte adresu kam poslať platbu</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Vložiť adresu zo schránky</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Odstrániť túto položku</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Poplatok sa odpočíta od čiastky, ktorú odosielate. Príjemca dostane menej bitcoinov ako zadáte. Ak je vybraných viacero príjemcov, poplatok je rozdelený rovným dielom.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>Odpočítať poplatok od s&amp;umy</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Použiť dostupné zdroje</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Správa:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Toto je neoverená výzva k platbe.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Toto je overená výzva k platbe.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Vložte popis pre túto adresu aby sa uložila do zoznamu použitých adries</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Správa ktorá bola pripojená k bitcoin: URI a ktorá bude uložená s transakcou pre Vaše potreby. Poznámka: Táto správa nebude poslaná cez sieť Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Platba pre:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Poznámka:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Zadajte popis pre túto adresu pre pridanie do adresára</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>áno</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 sa vypína...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Nevypínajte počítač kým toto okno nezmizne.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Podpisy - Podpísať / Overiť správu</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Podpísať Správu</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Môžete podpísať správy svojou adresou a dokázať, že viete prijímať mince zaslané na túto adresu. Buďte však opatrní a podpíšte len podrobné prehlásenia, s ktorými plne súhlasíte, nakoľko útoky typu \"phishing\" Vás môžu lákať k podpísaniu nejasných alebo príliš všeobecných tvrdení čím prevezmú vašu identitu.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Bitcoin adresa pre podpísanie správy s</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Vybrať predtým použitú adresu</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Vložiť adresu zo schránky</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Sem vložte správu ktorú chcete podpísať</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Podpis</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopírovať tento podpis do systémovej schránky</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Podpíšte správu aby ste dokázali že vlastníte túto adresu</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Podpísať &amp;správu</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Vynulovať všetky polia podpisu správy</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>&amp;Zmazať všetko</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>O&amp;veriť správu...</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Vložte adresu príjemcu, správu (uistite sa, že presne kopírujete ukončenia riadkov, medzery, odrážky, atď.) a podpis pre potvrdenie správy. Buďte opatrní a nedomýšľajte si viac než je uvedené v samotnej podpísanej správe a môžete sa tak vyhnúť podvodu MITM útokom. Toto len potvrdzuje, že podpisujúca strana môže prijímať na tejto adrese, nepotvrdzuje to vlastníctvo žiadnej transakcie!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Adresa Bitcoin, ktorou bola podpísaná správa</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Overím správy sa uistiť že bola podpísaná označenou Bitcoin adresou</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>&amp;Overiť správu</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Obnoviť všetky polia v overiť správu</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Kliknite \"Podpísať správu\" pre vytvorenie podpisu</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Zadaná adresa je neplatná.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Prosím skontrolujte adresu a skúste znova.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Vložená adresa nezodpovedá žiadnemu kľúču.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Odomknutie peňaženky bolo zrušené.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Súkromný kľúč pre zadanú adresu nieje k dispozícii.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Podpísanie správy zlyhalo.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Správa podpísaná.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Podpis nie je možné dekódovať.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Prosím skontrolujte podpis a skúste znova.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Podpis sa nezhoduje so zhrnutím správy.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Overenie správy zlyhalo.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Správa overená.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testovacia sieť]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Otvoriť pre %n ďalší blok</numerusform><numerusform>Otvoriť pre %n ďalšie bloky</numerusform><numerusform>Otvoriť pre %n ďalších blokov</numerusform><numerusform>Otvoriť pre %n ďalších blokov</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Otvorené do %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>koliduje s transakciou s %1 potvrdeniami</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/nepotvrdené, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>v transakčnom zásobníku</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>nie je v transakčnom zásobníku</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>zanechaná</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/nepotvrdené</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 potvrdení</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Stav</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, ešte nebola úspešne odoslaná</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, vysielať cez %n uzol</numerusform><numerusform>, vysielať cez %n uzle </numerusform><numerusform>, vysielať cez %n uzolov</numerusform><numerusform>, vysielať cez %n uzolov</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Zdroj</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Vygenerované</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Od</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>neznámy</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>do</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>vlastná adresa</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>Iba sledovanie</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>popis</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Kredit</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>dozreje za %n ďalší blok</numerusform><numerusform>dozreje za %n ďalšie bloky</numerusform><numerusform>dozreje za %n ďalších blokov</numerusform><numerusform>dozreje za %n ďalších blokov</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>neprijaté</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debet</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Celkový debet</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Celkový kredit</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transakčný poplatok</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Suma netto</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Správa</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Komentár</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID transakcie</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Celková veľkosť transakcie</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Index výstupu</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Kupec</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Vytvorené coins musia dospieť %1 blokov kým môžu byť minuté. Keď vytvoríte tento blok, bude rozoslaný do siete aby bol akceptovaný do reťaze blokov. Ak sa nedostane reťaze, jeho stav sa zmení na \"zamietnutý\" a nebude sa dať minúť. Toto sa môže občas stať ak iná nóda vytvorí blok približne v tom istom čase.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Ladiace informácie</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transakcie</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Vstupy</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Suma</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>pravda</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>nepravda</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Táto časť obrazovky zobrazuje detailný popis transakcie</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Podrobnosti pre %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Popis</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Otvoriť pre %n ďalší blok</numerusform><numerusform>Otvoriť pre %n ďalšie bloky</numerusform><numerusform>Otvoriť pre %n ďalších blokov</numerusform><numerusform>Otvoriť pre %n ďalších blokov</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Otvorené do %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Nepotvrdené</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Zanechaná</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Potvrdzujem (%1 z %2 odporúčaných potvrdení)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Potvrdené (%1 potvrdení)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>V rozpore</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Nezrelé (%1 potvrdení, bude dostupné po %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Ten blok nebol prijatý žiadnym iným uzlom a pravdepodobne nebude akceptovaný!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Vypočítané ale neakceptované</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Prijaté s</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Prijaté od</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Odoslané na</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Platba sebe samému</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Vyťažené</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>Iba sledovanie</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez popisu)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Stav transakcie. Prejdite ponad toto pole pre zobrazenie počtu potvrdení.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Dátum a čas prijatia transakcie.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Typ transakcie.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Či je v tejto transakcii adresy iba na sledovanie.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Užívateľsky určený účel transakcie.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Suma pridaná alebo odobraná k zostatku.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Všetky</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Dnes</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Tento týždeň</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Tento mesiac</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Minulý mesiac</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Tento rok</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Rozsah...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Prijaté s</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Odoslané na</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Ku mne</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Vyťažené</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Iné</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Pre vyhľadávanie vložte adresu, id transakcie, alebo popis.</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minimálna suma</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Zabudnúť transakciu</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Navíš transakčný poplatok</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopírovať adresu</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopírovať popis</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopírovať sumu</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopírovať ID transakcie</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Skopírovať neupravenú transakciu</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Kopírovať všetky podrobnosti o transakcii</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Upraviť popis</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Zobraziť podrobnosti transakcie</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exportovať históriu transakcií</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Čiarkou oddelovaný súbor (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potvrdené</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Iba sledovanie</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Dátum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Popis</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Export zlyhal</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Vyskytla sa chyba pri pokuse o uloženie histórie transakcií do %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Export úspešný</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>História transakciá bola úspešne uložená do %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Rozsah:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>do</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Jednotka pre zobrazovanie súm. Kliknite pre zvolenie inej jednotky.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Nie je načítaná peňaženka.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Poslať mince</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Chyba pri navyšovaní poplatku</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Nepodarilo sa navýšiť poplatok</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Chceš poplatok navýšiť?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Momentálny poplatok:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Navýšenie:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Nový poplatok:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Potvrď navýšenie poplatku</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Nemôzeme podpíaať transakciu.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Nemôzeme uložiť transakciu do peňaženky</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportovať...</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportovať dáta v aktuálnej karte do súboru</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Zálohovanie peňaženky</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Dáta peňaženky (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Zálohovanie zlyhalo</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Vyskytla sa chyba pri pokuse o uloženie dát peňaženky do %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Záloha úspešná</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Dáta peňaženky boli úspešne uložené do %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Možnosti:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Určiť priečinok s dátami</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Pripojiť sa k uzlu, získať adresy ďalších počítačov v sieti a odpojiť sa</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Určite vašu vlastnú verejnú adresu</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Prijímať príkazy z príkazového riadku a JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distribuované pod softvérovou licenciou MIT, viď sprievodný súbor %s alebo %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Pokiaľ &lt;category&gt; nie je nastavená, alebo &lt;category&gt; = 1, vypíš všetky informácie pre ladenie.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Redukcia nastavená pod minimálnu hodnotu %d MiB. Prosím použite vyššiu hodnotu.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Prerezávanie: posledná synchronizácia peňaženky prebehla pred už prerezanými dátami. Je treba previesť -reindex (v prípade prerezávacieho režimu stiahne znovu celý reťazec blokov)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>V prerezávaciom režime nie je možné reťazec blokov preskenovať. Musíte vykonať -reindex, čo znova stiahne celý reťaec blokov.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Chyba: Vyskytla sa interná chyba, pre viac informácií zobrazte debug.log</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Poplatok (za %s/kB) pridaný do transakcie, ktorú posielate (predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Redukovanie blockstore...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Bežať na pozadí ako démon a prijímať príkazy</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Nepodarilo sa spustiť HTTP server. Pre viac detailov zobrazte debug log.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Vývojári %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Sadzba poplatku (v %s/kB), ktorá sa použije, ak nebude k dispozícii dostatok dát pre automatický odhad poplatku (predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Akceptovať postúpené transakcie od povolených partnerov aj keď normálne nepostupujete transakcie (predvolené: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Pridať uzol na pripojenie a pokus o udržanie otvoreného pripojenia (pre viac informácií si pozrite nápovedu pre RPC príkaz \"addnode\")</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Spojiť s danou adresou a vždy na nej počúvať. Použite zápis [host]:port pre IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Nemožné uzamknúť zložku %s. %s pravdepodobne už beží.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Nemôžete zadať konkrétne spojenia a zároveň mať nastavený addrman pre hľadanie odchádzajúcich spojení.</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Pripojiť sa iba k určenému uzlu(om); -connect=0 zakáže automatické pripojovanie (pravidlá pre tento uzol sú rovnaké ako pre -addnode)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Vymazať všetky transakcie z peňaženky a pri spustení znova získať z reťazca blokov iba tie získané pomocou -rescan</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Nastala chyba pri čítaní súboru %s! Všetkz kľúče sa prečítali správne, ale dáta o transakcíách alebo záznamy v adresári môžu chýbať alebo byť nesprávne.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Vylúčiť ladiacu informáciu danej kategórie. Dá se zkombinovať s -debug=1, aby sa zaznamenávali ladice informácie všetkých kategórií pkrem jednej alebo niekolkých zvolených.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Vykonaj príkaz keď sa zmení transakcia peňaženky (%s v príkaze je nahradená TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Počet extra transakcíí, ktoré sa majú držať v pamäti pre účely rekonštrukcie kompaktných blokov (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Pokiaľ je tento blok v reťazci blokov, tak predpokladať, že on i jeho následníci sú platní, a potenciálne preskočiť overovanie ich skriptov (0 = overovať všetko, predvolené: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Maximálne povolené upravovanie času mediánom časov peerov. Miestne vnímanie času môže byť ovplivnené peerami, a to dopredu alebo dozadu až o toto množstvo. (predvolené: %u sekund)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Horná hranica pre celkový poplatok (v %s) za jednu transakciu z peňaženky alebo jednu nespracovanú transakciu. Príliš nízká hodnota môže zmariť velké transakcie (predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Prosím skontrolujte systémový čas a dátum. Keď je váš čas nesprávny, %s nebude fungovať správne.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Keď si myslíte, že %s je užitočný, podporte nás. Pre viac informácií o software navštívte %s.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Pri nedostatku adries získať ďalších peerov z DNS (predvolené: 1, ak nie je použité -connect)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Obmedziť nároky na úložný priestor prerezáváním (mazaním) starých blokov. Táto volba tiež umožní použiť RPC volanie pruneblockchain na zmazanie konkrétnych blokov a ďalej automatické prerezávanie starých blokov, ak je zadána cieľová velikosť súborov z blokmi v MiB. Tento režim nie je zlúčiteľný s -txindex ani -rescan. Upozornenie: opätovná zmena tohoto nastavenia bude vyžadovať nové stiahnutie celého reťazca blokov. (predvolené: 0 = bloky neprerezávať, 1 = povoliť ručné prerezávanie cez RPC, &gt;%u = automatické prerezávanie blokov tak, aby bola udržaná cieľová velikosť súborov s blokmi v MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Nastaviť nejnižší akceptovateľný poplatok (v %s/kB) pre transakcie, ktoré majú byť zahrnutý do nových blokov. (predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Nastaviť počeť vlákien overujúcich skripty (%u až %d, 0 = auto, &lt;0 = nechať toľkoto jadier voľných, prednastavené: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Databáza blokov obsahuje blok, ktorý vyzerá byť z budúcnosti. Toto môže byť spôsobené nesprávnym systémovým časom vášho počítača. Obnovujte databázu blokov len keď ste si istý, že systémový čas je nastavený správne.</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Toto je predbežná testovacia zostava - používate na vlastné riziko - nepoužívajte na ťaženie alebo obchodné aplikácie</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Toto je transakčný poplatok, ktorý môžete škrtnúť, ak je zmena na tejto úrovni menšia ako prach</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Nedarí sa znovu aplikovať bloky. Budete musieť prestavať databázu použitím -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Nedará sa vrátiť databázu do stavu pred rozdelením. Budete musieť znovu stiahnuť celý reťaztec blokov</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Skúsiť použiť UPnP pre mapovanie počúvajúceho portu (predvolené: 1 počas počúvania a bez -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Užívateľské meno a zahašované heslo pre JSON-RPC spojenie. Pole &lt;userpw&gt;  má formát: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Pomocný python skript je priložený v share/rpcuser. Klient sa potom už pripojuje normálne pomocou páru argumentov rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt;. Túto voľbu môžete použiť i viackrát</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Peňaženka nebude vytvárať transakcie, ktoré by porušovali limity transakčného zásobníku reťazcov (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Varovanie: Javí sa že sieť sieť úplne nesúhlasí! Niektorí mineri zjavne majú ťažkosti.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Varovanie: Zjavne sa úplne nezhodujeme s našimi peer-mi! Možno potrebujete prejsť na novšiu verziu alebo ostatné uzly potrebujú vyššiu verziu.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Či uchovať transakčný zásobník medzi vypnutím a zapnutím (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d z poslednźých 100 blokov má neočakávanú verziu</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s je poškodený, záchrana zlyhala</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool musí byť najmenej %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; môže byť:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Prijať spojenia zvonku (predvolené: 1 ak žiadne -proxy alebo -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Pripojiť komentár k typu klienta</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Pokúsiť sa o obnovenie privátnych kľúčov z poškodenej peňaženky pri spustení</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Voľby vytvorenia bloku:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Nedá preložiť -%s adresu: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Možnosti výberu reťzca blokov:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Menný index mimo rozsah</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Možnosti pripojenia:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Zistená poškodená databáza blokov</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Možnosti ladenia/testovania:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Nenahrat peňaženku a zablokovať volania RPC.</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Chcete znovu zostaviť databázu blokov?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Povoliť zverejneneie hash blokov pre &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Povoliť zverejnenie hash transakcií pre &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Povoliť zverejnenie raw bloku pre &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Povoliť publikovať hrubý prevod v &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Povoliť výmenu transakcií v transakčnom zásobníku (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Chyba počas vytvárania %s: S touto verziou nemôžete vytvoriť ne-HD peňaženky.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Chyba inicializácie databázy blokov</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Chyba spustenia databázového prostredia peňaženky %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Chyba načítania %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Chyba načítania %s: Peňaženka je poškodená</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Chyba načítania %s: Peňaženka vyžaduje novšiu verziu %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Chyba načítania databázy blokov</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Chyba otvárania databázy blokov</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Chyba: Málo miesta na disku!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Chyba počúvania na ktoromkoľvek porte. Použi -listen=0 ak toto chcete.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Počas inicializácie sa nepodarila pre-skenovať peňaženka</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Prebieha import ...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Nesprávny alebo žiadny genesis blok nájdený. Nesprávny dátový priečinok alebo sieť?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Kontrola čistoty pri inicializácií zlyhala. %s sa vypína.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Neplatná suma pre -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Neplatná čiastka pre -discardfee=&lt;čiastka&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Neplatná suma pre -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Udržovať zasobník transakcií menší než &lt;n&gt; megabajtov (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Načítavam P2P adresy…</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Načítavam banlist...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Umiestnenie overovacieho cookie súboru (predvolená: Priečinok s dátami)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Nedostatok kľúčových slov súboru.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Pripojiť iba k uzlom v sieti &lt;net&gt; (ipv4, ipv6, alebo onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Vytlačiť túto pomocnú správu a ukončiť</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Vytlačiť verziu a ukončiť</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Redukovanie nemôže byť nastavené na zápornú hodnotu.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Redukovanie je nekompatibilné s -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Obnoviť stav reťazca a index blokov zo súborov blk*.dat na disku.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Obnoviť stav reťazca z aktuálne indexovaných blokov.</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Znovu sa aplikujú bloky…</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Vracajú sa bloky dozadu…</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>Posielať transakcie so zapnutým plným RBF (Replace-By-Fee) (iba RPC, predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Nastaviť veľkosť pomocnej pamäti databázy v megabajtoch (%d do %d, prednastavené: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Označ súbor peňaženky (v priečinku s dátami)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Zdrojový kód je dostupný z %s</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Zlyhal výpočet transakčného poplatku a drobných</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Nemožné pripojiť k %s na tomto počíťači. %s už pravdepodobne beží.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Nepodporovaný parameter -benchmark bol ignorovaný, použite -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Nepodporovaný argument -debugnet bol ignorovaný, použite -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Nepodporovaný argument -tor, použite -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Nepodporovaná logovacia kategória %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Vylepšuje sa databáza neminutých výstupov (UTXO)</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Použiť UPnP pre mapovanie počúvajúceho portu (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Použiť testovaciu sieť</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Komentár u typu klienta (%s) obsahuje riskantné znaky.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Overujem bloky...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Ladiace / testovacie možnosti peňaženky.</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Peňaženka musí byť prepísaná: pre dokončenie reštartujte %s</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Voľby peňaženky:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Povoliť JSON-RPC pripojenia zo zadaného zdroja. Pre &lt;ip&gt; sú platné jednoduché IP (napr. 1.2.3.4), sieť/netmask (napr. 1.2.3.4/255.255.255.0) alebo sieť/CIDR (napr. 1.2.3.4/24). Táto možnosť môže byť zadaná niekoľko krát</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Spojiť s danou adresou a povolenými partnerskými zariadeniami ktoré sa tam pripájajú. Použite zápis [host]:port pre IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Vytvoriť nové súbory z predvolenými systémovými právami, namiesto umask 077 (funguje iba z vypnutou funkcionalitou peňaženky)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Zisti vlastnú IP adresu (predvolené: 1 pre listen a -externalip alebo -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Chyba: Počúvanie prichádzajúcich spojení zlyhalo (vrátená chyba je %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Vykonať príkaz po prijatí patričného varovania alebo uvidíme veľmi dlhé rozdvojenie siete (%s v cmd je nahradené správou)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Poplatky (v %s/kB) menšie ako toto, sú považované za nulový transakčný poplatok (predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Ak nie je nastavené paytxfee, pridať dostatočný poplatok aby sa transakcia začala potvrdzovať priemerne v rámci bloku (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Neplatná suma pre -maxtxfee=&lt;amount&gt;: '%s' (aby sa transakcia nezasekla, minimálny prenosový poplatok musí byť aspoň %s)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maximálna veľkosť dát v transakciách nosných dát, ktoré prenášame a ťažíme (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Suma je príliš malá pre odoslanie transakcie</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Uzle na zoznam povolených nemôžu byť DoS zakázané a ich transakcie vždy postúpené ďalej, aj v prípade, ak sú už pamäťovej fronte. Užitočné napr. pre brány</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>K návratu k neprerezávaciemu režimu je treba prestavať databázu použitím -reindex. Tiež sa znova stiahne celý reťazec blokov</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Akceptovať verejné REST žiadosti (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Automaticky vytvoriť skrytú službu Tor (predvolené: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Pripojiť cez proxy server SOCKS5</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Chyba pri načítání %s: nemôžeš vypnúť HD u existujúcej HD peňaženky</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Chyba pri načítaní z databázy, ukončuje sa.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Chyba pri vylepšení databáze reťzcov blokov</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importovať bloky z externého súboru blk000??.dat pri štarte</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informácia</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Neplatná -onion adresa alebo hostiteľ: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Neplatná -proxy adresa alebo hostiteľ: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Neplatná suma pre -paytxfee=&lt;amount&gt;: '%s' (musí byť aspoň %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Nadaná neplatná netmask vo -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>V pamäti udržiavať najviac &lt;n&gt; nepotvrdených transakcií (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Je potrebné zadať port s -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Prenosové možnosti uzla:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Možnosti servra RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Obmedzuje sa -maxconnections z %d na %d kvôli systémovým obmedzeniam.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Pri spustení skontrolovať reťaz blokov pre chýbajúce transakcie peňaženky</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Odoslať trace/debug informácie na konzolu namiesto debug.info žurnálu</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Zobraziť všetky možnosti ladenia (použitie: --help --help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Zmenšiť debug.log pri spustení klienta (predvolené: 1 ak bez -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Podpísanie správy zlyhalo</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>Uvedená -walletdir \"%s\" neexistuje</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>Uvedená -walletdir \"%s\" je relatívna cesta</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>Uvedený -walletdir \"%s\" nie je priečinok</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Suma transakcie je príliš malá na zaplatenie poplatku</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Toto je experimentálny softvér.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Heslo na kontrolu portu pre Tor (predvolené: žiadne)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Ovládací port Toru, ak je zapnuté onion počúvanie (predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Suma transakcie príliš malá</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transakcia je príliš veľká pre aktuálne podmienky poplatkov</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transakcia príliš veľká</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Na tomto počítači sa nedá vytvoriť väzba %s (vytvorenie väzby vrátilo chybu %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Nepodarilo sa vygenerovať úvodné kľúče</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Aktualizovať peňaženku na posledný formát pri štarte</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Užívateľské meno pre JSON-RPC spojenia</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Kontrolujem peňaženku(y)…</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Peňaženka %s sa nachádza mimo priečinku pre peňaženky %s </translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Upozornenie</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Upozornenie: aktivovaná neznáme nové pravidlá (verzový bit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Či fungovat iba v čistom blokovom režime (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Je teeba prestavať databázu použitím -reindex, aby bolo možné zmeniť -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Zmazať všetky transakcie z peňaženky...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Možnosti pripojenia ZeroMQ:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Heslo pre JSON-rPC spojenia</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Vykonaj príkaz, ak zmeny v najlepšom bloku (%s v príkaze nahradí blok hash)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Povoliť vyhľadávanie DNS pre pridanie nódy a spojenie</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = zachovať metaúdaje tx napr. vlastníka účtu a informácie o platobných príkazoch, 2 = zahodiť metaúdaje tx)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee je nastavené veľmi vysoko! Takto vysoký poplatok môže byť zaplatebý v jednej transakcii.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Čakať na zadanej adrese na JSON-RPC spojenie. Táto volba sa ignoruje, ak súčastne nezadáš aj volbu -rpcallowip. Port je voliteľný a má prednosť pred -rpcport. Pre zápis IPv6 adresy použite notáciu [adresa]:port. Túto volbu je možné použiť i viackrát (predvolené: 127.0.0.1 a ::1, tzn. localhost, alebo ak je zadané -rpcallowip, tak 0.0.0.0 a ::, tzn. všetky adresy)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Nedržať transakcie v zásobníku dlhšie ako &lt;n&gt; hodín (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Ekvivalent bajtov za každý sigop v transakciach pre účely preposielania a ťaženia (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Chyba pri načítaní %s: nemôžeš zapnúť HD u existujúcej nie-HD peňaženky</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Chyba pri načítaní peňaženky %s. Parameter -wallet môže obsahovať iba názov súboru (nie cestu k nemu).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Poplatky (v %s/kB) menšie ako toto, sú považované za nulový transakčný poplatok (predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Vynútiť preposíelanie transakcií od vždy vítaných peerov, aj keď porušujú míestne zásady pre preposielanie (predvolené: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Ako dôkladné je -checkblocks overenie blokov (0-4, predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Udržiavať kompletný transakčný index, využíva getrawtransaction rpc volanie (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Počet sekúnd, počas ktorých nepripájať zle správajúce sa uzle (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Výstupné ladiace informácie (predvolené: %u, dodanie &lt;category&gt; je voliteľné)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Nastaví serializáciu nespracovaných transakcií alebo bloov, ak sú vrátené v nehovoriacom móde: nie-segwit (0) alebo segwit (1) (predvolené: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Určiť cestu pre peňaženky (predvolená: &lt;datadir&gt;/wallets ak existuje, inak &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Zadajte cestu k súboru debug.log: tá môže byť buď absolútna alebo relatívna ku priečinku s dátami (predvolená: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Umožniť filtrovanie blokov a transakcií pomocou Bloom filtra (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>Sadzba poplatku (v %s/kB), ktorá určuje Vašu ochotu v prípade potreby premeniť drobné v poplatok (predvolené: %s). Poznámka: výstup sa premení, ak sa pri tejto sadzbe zmení v prach. Každopádne meniť budeme do výške poplatku pre prenos prachu a premenený poplatok nad túto výšku bude obmedzený odhadom poplatku na nejdlhší čas</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Toto je poplatok za transakciu keď odhad poplatkov ešte nie je k dispozícii.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Tento produkt zahrňuje programy vyvinuté projektom OpenSSL pre použití v OpenSSL Toolkite %s a kryptografický program od Erika Younga a program UPnP od Thomasa Bernarda.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Celková dĺžka verzie sieťového reťazca (%i) prekračuje maximálnu dĺžku (%i). Znížte počet a veľkosť komentárov.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Sa snaží držať odchádzajúce prevádzku v rámci daného cieľa (v MB za 24h), 0 = žiadny limit (predvolený: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Nepodporovaný argument -socks nájdený. Nastavenie SOCKS verzie už nie je viac moźné, iba SOCKS5 proxies sú podporované.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Nepodporovaný argument -whitelistalwaysrelay ignorovaný, použite -whitelistrelay a/alebo -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Použiť samostatný SOCKS5 proxy server na dosiahnutie počítačov cez skryté služby Tor (predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Varovanie: Neznáma verzia blokov sa doluje! Je možné, že neznáme pravidlá majú efekt</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Varovanie: Peňaženka poškodená, dáta boli zachránené! Originálna %s ako %s v %s; ak váš zostatok alebo transakcie sú nesprávne, mali by ste obnoviť zálohu.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Povoliť partnerov pripájajúcich sa z danej IP adresy (napr. 1.2.3.4) alebo zo siete vo formáte CIDR (napr. 1.2.3.0/24). Môže byť zadané viackrát.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>Hodnota %s je nastavená veľmi vysoko!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Vždy sa dotazovať adresy partnerských uzlov cez vyhľadávanie DNS (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Chyba pri načítaní peňaženky %s. -wallet musí byť obyčajný súbor.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Chyba pri načítaní peňaženky %s. Zadaný duplicitný názov súboru -wallet.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Chyba pri načítaní peňaženky %s. Neplatné znaky v názvu souboru -wallet.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Koľko blokov overiť pri spustení (predvolené: %u, 0 = všetky)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Zahrnúť IP adresy v ladiacom výstupe (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Vyčerpal sa zásobník kľúčov, zavolať najskôr keypoolrefill</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Počúvať JSON-RPC pripojenia na &lt;port&gt; (predvolené: %u alebo testovacia sieť: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Počúvať pripojenia na &lt;port&gt; (predvolené: %u alebo testovacia sieť: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Udržiavať najviac &lt;n&gt; spojení s inými počítačmi (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Vysielať transakcie z peňaženky</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximálna prijímajúca medzipamäť pre pripojenie, &lt;n&gt;*1000 bajtov (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximálna odosielajúca medzipamäť pre pripojenie, &lt;n&gt;*1000 bajtov (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Na začiatok pripojiť časovú známku k ladiacemu výstupu (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Prenášať a ťažiť transakcie nosných dát (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Prenášať non-P2SH multi-podpis (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Nastaviť veľkosť kľúča fronty na &lt;n&gt; (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Nastaviť maximálnu váhu bloku pre BIP141 (predvolené: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Nastaviť počet vlákien na obsluhu RPC volaní (predvolené: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Zadať konfiguračný súbor (predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Zadajte časový limit pripojenia v milisekundách (minimum: 1, predvolené: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Zadať pid súbor (predvolené: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Minúť nepotvrdené zmenu pri posielaní transakcií (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Spúšťajú sa sieťové vlákna...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Peňaženka zabráni zaplateniu menšej sumy ako je minimálny poplatok.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Toto je minimálny poplatok za transakciu pri každej transakcii.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Toto je poplatok za transakciu pri odoslaní transakcie.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Hranica pre odpájanie zle sa správajúcim partnerským uzlom (predvolené: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Sumy transakcií nesmú byť záporné</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Transakcia má v transakčnom zásobníku príliš dlhý reťazec</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Transakcia musí mať aspoň jedného príjemcu</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Neznáma sieť upresnená v -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Nedostatok prostriedkov</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Načítavanie zoznamu blokov...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Načítavam peňaženku...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Nie je možné prejsť na nižšiu verziu peňaženky</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Nové prehľadávanie...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Dokončené načítavanie</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Chyba</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_sl_SI.ts",
    "content": "<TS language=\"sl_SI\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Desni klik za urejanje naslovov ali oznak</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Ustvari nov naslov</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Novo</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopiraj trenutno izbrani naslov v odložišče</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopiraj</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Zapri</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Izbriši trenutno označeni naslov  iz seznama</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Izvozi podatke v trenutnem zavihku v datoteko</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Izvozi</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>I&amp;zbriši</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Izberi naslov prejemnika kovancev</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Izberi naslov, na katerega želiš prejeti kovance</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Izberi</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Imenik naslovov za pošiljanje</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Imenik naslovov za prejemanje</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>To so vaši Bitcoin naslovi za pošiljanje. Pred pošiljanjem vedno preverite količino in prejemnikov naslov.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>To so vaši Bitcoin naslovi za prejemanje. Priporočeno je, da za vsako transakcijo uporabite nov naslov.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopiraj naslov</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopiraj &amp;oznako</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Uredi</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Izvozi seznam naslovov</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Podatki ločenimi z vejico (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Podatkov ni bilo mogoče izvoziti.</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Naslov</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(brez oznake)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Vnos gesla</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Vnesite geslo</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Novo geslo</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ponovite novo geslo</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Pokaži geslo</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Vnesite novo geslo za dostop do denarnice. Prosimo, da uporabite geslo sestavljeno iz &lt;b&gt;desetih ali več&lt;/b&gt; naključnih znakov ali &lt;b&gt;osmih ali večih&lt;/b&gt; besed.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Šifriraj denarnico</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>To dejanje zahteva geslo za odklepanje vaše denarnice.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Odkleni denarnico</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>To dejanje zahteva geslo za dešifriranje vaše denarnice.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Odšifriraj denarnico</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Spremeni geslo</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Vnesite staro in novo geslo denarnice.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Potrdi šifriranje denarnice</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Opozorilo: V primeru izgube gesla šifrirane denarnice, boste &lt;b&gt;IZGUBILI VSE SVOJE BITCOINE&lt;/b&gt;!</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmaska</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Prepoved do</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Podpiši &amp;sporočilo ...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Dohitevam omrežje ...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>Pre&amp;gled</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Vozlišče</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Oglejte si splošne informacije o vaši denarnici</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakcije</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Brskajte po zgodovini transakcij</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>I&amp;zhod</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Ustavite program</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>O &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Oglejte si informacije o Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Možnosti ...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Šifriraj denarnico ...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Shrani &amp;varnostno kopijo denarnice ...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Spremeni geslo ...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Naslovi za po&amp;šiljanje ...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Naslovi za &amp;prejemanje...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Odpri &amp;URI ...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Poustvarjam kazalo blokov na disku ...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Izvedite plačilo na naslov Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Shranite varnostno kopijo svoje denarnice na drugo lokacijo</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Spremenite geslo za šifriranje denarnice</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Razhroščevalno okno</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Odprite razhroščevalno in diagnostično konzolo</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Preveri sporočilo ...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Denarnica</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Pošlji</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>P&amp;rejmi</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Prikaži / Skrij</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Prikaži ali skrij glavno okno</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Šifrirajte zasebne ključe, ki se nahajajo v denarnici</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Podpišite poljubno sporočilo z enim svojih naslovov Bitcoin, da prejemniku sporočila dokažete, da je ta naslov v vaši lasti.</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Preverite, če je bilo prejeto sporočilo podpisano z določenim naslovom Bitcoin</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Datoteka</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Nastavitve</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Pomoč</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Orodna vrstica zavihkov</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Zahtevajte plačilo (ustvarite zahtevek s kodo QR in URI tipa bitcoin:)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Preglejte in uredite seznam naslovov, na katere ste kdaj poslali plačila</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Preglejte in uredite seznam naslovov, na katere ste kdaj prejeli plačila</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Izvedite plačilo iz zahtevka v datoteki ali iz URI tipa bitcoin:</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Opcije &amp;ukazne vrstice</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktivna povezava v omrežje Bitcoin</numerusform><numerusform>%n aktivni povezavi v omrežje Bitcoin</numerusform><numerusform>%n aktivne povezave v omrežje Bitcoin</numerusform><numerusform>%n aktivnih povezav v omrežje Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indeksirani bloki na disku ...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Obdelava blokov na disku ...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n obdelan blok zgodovine transakcij.</numerusform><numerusform>%n obdelana bloka zgodovine transakcij.</numerusform><numerusform>%n obdelani bloki zgodovine transakcij.</numerusform><numerusform>%n obdelanih blokov zgodovine transakcij.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>imam še %1 zaostanka</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Zadnji prejeti blok je star %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Novejše transakcije še ne bodo vidne.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Napaka</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Opozorilo</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacije</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Posodobljeno</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 odjemalec</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Dohitevam omrežje ...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Znesek: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Vrsta: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Oznaka: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Naslov: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Odlivi</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Prilivi</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Denarnica je &lt;b&gt;šifrirana&lt;/b&gt; in trenutno &lt;b&gt;odklenjena&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Denarnica je &lt;b&gt;šifrirana&lt;/b&gt; in trenutno &lt;b&gt;zaklenjena&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Izbira vhodnih kovancev</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Št.vhodov:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Št.bajtov:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Znesek:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Provizija:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Prah:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Po proviziji:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Vračilo:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>izberi vse/nič</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Drevesni prikaz</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Seznam</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Znesek</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Oznaka priliva</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Naslov priliva</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Potrditve</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potrjeno</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(brez oznake)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Uredi naslov</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Oznaka</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Oznaka, pod katero je spodnji naslov naveden v vašem imeniku naslovov.</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Naslov tega vnosa v imeniku. Spremeniti ga je mogoče le pri vnosih iz imenika naslovov za pošiljanje.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Naslov</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Ustvarjena bo nova podatkovna mapa.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>ime</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Mapa že obstaja. Dodajte %1, če tu želite ustvariti novo mapo.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Pot že obstaja, vendar ni mapa.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Na tem mestu ni mogoče ustvariti nove mape.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>različica</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>O %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Možnosti ukazne vrstice</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Uporaba:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>možnosti ukazne vrstice</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>UI možnosti:</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Nastavi jezik, na primer \"sl_SI\" (privzeto: sistemsko)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Začni minimizirano</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Dobrodošli</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Dobrodošli v %1</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Uporabi privzeto podatkovno mapo</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Uporabi to podatkovno mapo:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Napaka: Ni mogoče ustvariti mape \"%1\".</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Napaka</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GiB prostega prostora na voljo</numerusform><numerusform>%n GiB prostega prostora na voljo</numerusform><numerusform>%n GiB prostega prostora na voljo</numerusform><numerusform>%n GiB prostega prostora na voljo</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(od potrebnih %n GiB)</numerusform><numerusform>(od potrebnih %n GiB)</numerusform><numerusform>(od potrebnih %n GiB)</numerusform><numerusform>(od potrebnih %n GiB)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Oblika</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Čas zadnjega bloka</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Skrij</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Odpri URl</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Vnesite zahtevek za plačilo iz URI ali pa ga naložite iz datoteke</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Izbiranje datoteke z zahtevkom za plačilo</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Možnosti</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Glavno</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Velikost &amp;predpomnilnika podatkovne baze</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MiB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Število programskih &amp;niti za preverjanje</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Naslov IP posredniškega strežnika (npr. IPv4: 127.0.0.1 ali IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Ko zaprete glavno okno programa, bo program tekel še naprej, okno pa bo zgolj minimirano. Program v tem primeru ustavite tako, da v meniju izberete ukaz Izhod.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Naslovi URL tretjih oseb (npr. raziskovalec blokov), ki bodo navedeni v kontekstnem meniju seznama transakcij. Niz %s iz naslova URL je nadomeščen s hash vrednostjo transakcije. Več zaporednih naslovov URL je med seboj ločenih z znakom |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktivne opcije iz ukazne vrstice, ki preglasijo zgornje opcije:</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Ponastavi vse nastavitve programa na privzete vrednosti.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Ponastavi nastavitve</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Omrežje</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = samodejno, &lt;0 = toliko procesorskih jeder naj ostane prostih)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Denarnica</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Napredne možnosti</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Omogoči upravljanje s kovanci</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Če onemogočite trošenje drobiža iz še nepotrjenih transakcij, potem vrnjenega drobiža ne morete uporabiti, dokler plačilo ni vsaj enkrat potrjeno. Ta opcija vpliva tudi na izračun stanja sredstev.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>Omogoči &amp;trošenje drobiža iz še nepotrjenih plačil</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Program samodejno odpre ustrezna vrata na usmerjevalniku. To deluje samo, če vaš usmerjevalnik podpira in ima omogočen UPnP.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Preslikaj vrata z uporabo &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Poveži se v omrežje Bitcoin preko posredniškega strežnika SOCKS5.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Poveži se preko posredniškega strežnika SOCKS5 (privzeti strežnik):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Naslov &amp;IP posredniškega strežnika:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Vrata:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Vrata posredniškega strežnika (npr. 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>O&amp;kno</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Po minimiranju okna samo prikaži ikono programa v pladnju.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimiraj na pladenj namesto na opravilno vrstico</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>Ob zapiranju okno zgolj m&amp;inimiraj</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Prikaz</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>&amp;Jezik uporabniškega vmesnika:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Enota za prikaz zneskov:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Izberite privzeto mersko enoto za prikaz v uporabniškem vmesniku in pri pošiljanju kovancev.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Omogoči dodatno možnost podrobnega nadzora nad posameznimi kovanci v transakcijah.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Potrdi</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Prekliči</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>privzeto</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>nič</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Potrditev ponastavitve</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Za uveljavitev sprememb je potreben ponoven zagon programa.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Program bo zaustavljen. Želite nadaljevati z izhodom?</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Napaka</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Ta sprememba zahteva ponoven zagon programa.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Vnešeni naslov posredniškega strežnika ni veljaven.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Oblika</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Prikazani podatki so morda zastareli. Program ob vzpostavitvi povezave samodejno sinhronizira denarnico z omrežjem Bitcoin, a trenutno ta proces še ni zaključen.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Opazovano:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Na voljo:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Skupni znesek vaših sredstev, s katerimi lahko prosto razpolagate</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Nepotrjeno:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Skupni znesek sredstev s katerimi še ne razpolagate prosto, ker so del še nepotrjenih transakcij.</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Nedozorelo:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Nedozorel narudarjeni znesek</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Stanje sredstev</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Skupaj:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Trenutna vsota vseh vaših sredstev</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Trenutno stanje vaših sredstev na opazovanih naslovih</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Na voljo:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Nedavne transakcije</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Nepotrjene transakcije na opazovanih naslovih</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Nedozoreli narudarjeni znesek na opazovanih naslovih</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Trenutno skupno stanje sredstev na opazovanih naslovih</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Ime agenta</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Naslov</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Oddano</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Prejeto</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Znesek</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Vnesite naslov Bitcoin (npr. %1):</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Nič</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Neznano</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 in %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KiB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MiB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GiB</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>neznano</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Neznano</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Različica odjemalca</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Informacije</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Razhroščevalno okno</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Splošno</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>BerkeleyDB različica v rabi</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Čas zagona</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Omrežje</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Ime</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Število povezav</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Veriga blokov</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Trenutno število blokov</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Prejeto</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Oddano</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Soležniki</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Izberite soležnika, o katerem si želite ogledati podrobnejše informacije.</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Smer povezave</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Različica</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Ime agenta</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Storitve</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Kazenske točke</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Trajanje povezave</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Nazadje oddano</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Nazadnje prejeto</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Odzivni čas</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Časovni odklon</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Čas zadnjega bloka</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Odpri</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konzola</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Omrežni promet</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Promet</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Dohodnih:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Odhodnih:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Razhroščevalni dnevnik</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Počisti konzolo</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>preko %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>nikoli</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Dohodna</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Odhodna</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Da</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Ne</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Neznano</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Znesek:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Oznaka:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Sporočilo:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Neobvezno sporočilo kot priponka zahtevku za plačilo, ki bo prikazano, ko bo zahtevek odprt. Opomba: Opravljeno plačilo.prek omrežja Bitcoin tega sporočila ne bo vsebovalo.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Oznaka novega sprejemnega naslova.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>S tem obrazcem ustvarite nov zahtevek za plačilo. Vsa polja so &lt;b&gt;neobvezna&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Zahtevani znesek. Če ne zahtevate določenega zneska, pustite prazno ali nastavite vrednost na 0.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Počisti vsa polja.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Počisti</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Zgodovina zahtevkov za plačilo</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Zahtevaj plačilo</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Prikaz izbranega zahtevka. (Isto funkcijo opravi dvojni klik na zapis.)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Pokaži</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Odstrani označene vnose iz seznama</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Odstrani</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Koda</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopiraj &amp;URl</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopiraj &amp;naslov</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Shrani sliko ...</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Naslov</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(brez oznake)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Pošlji</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Upravljanje s kovanci</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Vhodi ...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>samodejno izbrani</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Premalo sredstev!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Št.vhodov:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Št.bajtov:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Znesek:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Provizija:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Po proviziji:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Vračilo:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Če to vključite, nato pa vnesete neveljaven naslov, ali pa pustite polje prazno, bo vrnjen drobiž poslan na novo ustvarjen naslov.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Naslov za vračilo drobiža po meri</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Provizija:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Izberi ...</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>Skrije nastavitve provizije</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>na KiB</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Če je nastavitev zneska provizije po meri enaka 1000 satoshijev, transakcija pa je velika samo 250 bajtov, je obračunani znesek provizije pri nastavitvi \"za KiB\" samo 250 satoshijev, medtem ko je pri nastavitvi \"skupno vsaj\" ta znesek 1000 satoshijev. Za transakcije, večje od 1 KiB, se končni znesek pri obeh nastavitvah obračuna na KiB.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Skrij</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Dokler bo v blokih še dovolj prostora za vse nastajajoče transakcije, zadostuje, če plačate samo minimalno provizijo. Ko pa se bo količina vseh transakcij povečala do meja zmogljivosti omrežja, se lahko zgodi, da vaša transakcija brez večje provizije nikoli ne bo potrjena.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(oglejte si namig)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Priporočena:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Po meri:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Samodejni obračun provizije še ni pripravljen. Po navadi izračun traja nekaj blokov ...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Pošlji več prejemnikom hkrati</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Dodaj &amp;prejemnika</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Počisti vsa polja.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Prah:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Počisti &amp;vse </translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Stanje:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Potrdi pošiljanje</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Pošlji</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(brez oznake)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Znesek:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Prejemnik &amp;plačila:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Oznaka:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Izberite enega od že uporabljenih naslovov</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Plačilo je navadne vrste.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Naslov Bitcoin, na katerega bo plačilo poslano</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Prilepite naslov iz odložišča</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Izpraznite vsebino polja</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Znesek plačila bo zmanjšan za znesek provizije. Prejemnik bo prejel manjše število kovancev, kot je bil vnešeni znesek. Če je prejemnikov več, bo provizija med njih enakomerno porazdeljena.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>O&amp;dštej provizijo od zneska</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Sporočilo:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Zahtevek za plačilo je neoverjen.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Zahtevek za plačilo je overjen.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Če vnesete oznako za zgornji naslov, se bo skupaj z naslovom shranila v imenk že uporabljenih naslovov</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Sporočilo, ki ste ga pripeli na URI tipa bitcoin:. Shranjeno bo skupaj s podatki o transakciji. Opomba: Sporočilo ne bo poslano preko omrežja Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Prejemnik:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Opomba:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Dokler to okno ne izgine, ne zaustavljajte računalnika.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Podpiši / preveri sporočilo</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Podpiši sporočilo</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>S svojimi naslovi lahko podpisujete sporočila ali pogodbe in s tem dokazujete, da na teh naslovih lahko prejemate kovance. Bodite previdni in ne podpisujte ničesar nejasnega ali naključnega, ker vas zlikovci preko ribarjenja (phishing) lahko prelisičijo, da na njih prepišete svojo identiteto. Podpisujte samo podrobno opisane izjave, s katerimi se strinjate.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Naslov Bitcoin, s katerim podpisujete sporočilo</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Izberite enega od že uporabljenih naslovov</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Prilepite naslov iz odložišča</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Vnesite sporočilo, ki ga želite podpisati</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Podpis</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopiranje trenutnega podpisa na sistemsko odložišče.</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Podpišite sporočilo, da dokažete lastništvo nad zgornjim naslovom.</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Podpiši &amp;sporočilo</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Počisti vsa polja za vnos v oknu za podpisovanje</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Počisti &amp;vse </translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Preveri sporočilo</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Da preverite verodostojnost sporočila, spodaj vnesite: prejemnikov naslov, prejeto sporočilo (pazljivo skopirajte vse prelome vrstic, presledke, tabulatorje ipd.,) in prejeti podpis. Da se izognete napadom tipa man-in-the-middle, vedite, da iz veljavnega podpisa ne sledi nič drugega, kot tisto, kar je navedeno v sporočilu. Podpis samo potrjuje dejstvo, da ima podpisnik v lasti prejemni naslov, ne more pa dokazati vira nobene transakcije!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Naslov Bitcoin, s katerim je bilo sporočilo podpisano</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Preverite, ali je bilo sporočilo v resnici podpisano z navedenim naslovom Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Preveri &amp;sporočilo</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Počisti vsa polja za vnos v oknu za preverjanje</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KiB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>V tem podoknu so prikazane podrobnosti o transakciji</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(brez oznake)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Podatki ločenimi z vejico (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Naslov</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Podatkov ni bilo mogoče izvoziti.</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Merska enota za prikaz zneskov. Kliknite za izbiro druge enote.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Izvozi podatke v trenutnem zavihku v datoteko</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Možnosti:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Izberite podatkovno mapo</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Povežite se z vozliščem za pridobitev naslovov soležnikov in nato prekinite povezavo.</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Določite vaš lasten javni naslov</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Sprejemaj ukaze iz ukazne vrstice in preko JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Teci v ozadju in sprejemaj ukaze</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Veži dani naslov in tam vedno poslušaj. Za naslove protokola IPv6 uporabite zapis [gostitelj]:vrata.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Izvedi ukaz, ko bo transakcija denarnice se spremenila (V cmd je bil TxID zamenjan za %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Nastavi število niti za preverjanje skript (%u do %d, 0 = samodejno, &lt;0 toliko procesorskih jeder naj ostane prostih, privzeto: %d)</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; je lahko:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Sprejemaj zunanje povezave (privzeto: 1, razen če ste vklopili opciji -proxy ali -connect)</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Možnosti ustvarjanja blokov:</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Izbire povezave:</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Podatkovna baza blokov je okvarjena</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Možnosti razhroščevanja in testiranja:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Ne naloži denarnice in onemogoči s tem povezane klice RPC</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Želite zdaj obnoviti podatkovno bazo blokov?</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Napaka pri inicializaciji podatkovne baze blokov</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Napaka pri inicializaciji okolja podatkovne baze denarnice %s!</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Napaka pri nalaganju podatkovne baze blokov</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Napaka pri odpiranju podatkovne baze blokov</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Opozorilo: Premalo prostora na disku!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Ni mogoče poslušati na nobenih vratih. Če to zares želite, uporabite opcijo -listen=0.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Uvažam ...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Izvornega bloka ni mogoče najti ali pa je neveljaven. Preverite, če ste izbrali pravo podatkovno mapo za izbrano omrežje.</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Na voljo ni dovolj deskriptorjev datotek.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Povezuj se samo z vozlišči na omrežju tipa &lt;net&gt; (IPv4, IPv6 ali onion)</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Negativne vrednosti parametra funkcije obrezovanja niso sprejemljive.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Funkcija obrezovanja ni združljiva z opcijo -txindex.</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Nastavitev velikosti predpomnilnik podatkovne baze v MiB (%d do %d, privzeto: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Ime datoteke z denarnico (znotraj podatkovne mape)</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Uporabi protokol UPnP za preslikavo vrat za poslušanje (privzeto: %u)</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Preverjam celovitost blokov ...</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Izbire denarnice:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Iz navedenega vira dovoli povezave na JSON-RPC. Veljavne oblike vrednosti parametra &lt;ip&gt; so: edinstven naslov IP (npr.: 1.2.3.4), kombinacija omrežje/netmask (npr.: 1.2.3.4/255.255.255.0), ali pa kombinacija omrežje/CIDR (1.2.3.4/24). To opcijo lahko navedete večkrat.</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Veži dani naslov in sprejemaj povezave samo od navedenih soležnikov. Za naslove protokola IPv6 uporabite zapis [gostitelj]:vrata.</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Ustvarjaj nove datoteke s privzetimi sistemskimi dovoljenji, namesto z umask 077. (To pride v poštev samo, kadar imate izklopljeno funkcijo denarnice.)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Odkrij svoj naslov IP (privzeto: 1, če poslušate in sta opciji -externalip in -proxy neaktivni)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Napaka: Ni mogoče sprejemati dohodnih povezav (vrnjena napaka: %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Ko bo prejeto ustrezno opozorilo, ali ko bo opažena zelo dolga razvejitev, izvedi navedeni ukazni niz. (Niz %s bo nadomeščen z vsebino sporočila.)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Če opcija -paytxfee ni nastavljena, nastavi znesek provizije tako visoko, da bodo transakcije potrjene v povprečno n blokih. (privzeto: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Na vsak posredniški strežnik se prijavi z drugimi naključnimi podatki. Tako je omogočena osamitev tokov v omrežju Tor (privzeto: %u)</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(privzeto: %u)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Poveži se preko posredniškega strežnika SOCKS5</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacije</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Pri opciji -whitebind morate navesti vrata: %s</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Pošilja sledilne/razhroščevalne informacije na konzolo namesto v datoteko debug.log</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Ob zagonu skrajšaj datoteko debug.log (privzeto: 1, če ni vklopljena opcija -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Transakcije ni bilo mogoče podpisati.</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Program je eksperimentalne narave.</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Znesek je pramajhen</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transkacija je prevelika</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Na tem računalniku ni bilo mogoče vezati naslova %s (vrnjena napaka: %s)</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Uporabniško ime za povezave na JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Opozorilo</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Brišem vse transakcije iz denarnice ...</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Geslo za povezave na JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Izvedi ukaz, ko je najden najboljši blok (niz %s v ukazu bo zamenjan s hash vrednostjo bloka)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Omogoči poizvedbe DNS za opcije -addnode, -seednode in -connect.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Za dostop do soležnikov preko skritih storitev Tor uporabi drug posredniški strežnik SOCKS5 (privzeto: %s)</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(privzeto: %s)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Posreduj transakcije tipa multisig, ki niso hkrati tipa P2SH. (privzeto: %u)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Za shranjevanje konfiguracije uporabi navedeno datoteko. (privzeto: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Vzpostavljanje nove povezave poteče po navedenem št. pretečenih milisekund. (najmanj: 1, privzeto: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Za shranjevanje PID uporabi navedeno datoteko. (privzeto: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Pri odlivnih transakcijah omogoči trošenje drobiža iz še nepotrjenih plačil (privzeto: %u)</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Prekini povezavo s soležnikom, ko št. njegovih kazenskih točk preseže navedeni prag. (privzeto: %u)</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Neznano omrežje določeno v -onlynet: '%s'.</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Premalo sredstev</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Nalagam kazalo blokov ...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Nalagam denarnico ...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Ne morem </translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Ponovno pregledujem verigo ...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Nalaganje končano</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Napaka</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_sn.ts",
    "content": "<TS language=\"sn\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>Gadzira Kero Itsva</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>Itsva</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopera</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Vhara</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>Dzima</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Makero ekutumira</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Makero ekutambira</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>Kopera Kero</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Gadzirisa</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Zita</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Kero</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(hapana zita)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>Banned Until</source>\n        <translation>Wakavharirwa Kusvika</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Buda</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Vhara Application</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Kuma %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Taridza ruzivo rwekuma %1</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Taridza ruzivo rwe Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Makero ekutumira nawo</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Makero ekutambira nawo</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Vhura &amp;URI</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Chikwama</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Tumira</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Tambira</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Taridza/Usataridza</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Faira</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Rubatsiro</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 kumashure</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Hokoyo</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Ruzivo</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount</source>\n        <translation>Marii </translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Zuva</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(hapana zita)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Marii </translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Nyora kero ye Bitcoin (sekuti %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Hapana</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Hapana </translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Hapana </translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Kero</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Marii </translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Zita</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Zuva</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Zita</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(hapana zita)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(hapana zita)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>Zuva</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Marii </translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Zuva</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Zita</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(hapana zita)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Date</source>\n        <translation>Zuva</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Zita</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Kero</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Information</source>\n        <translation>Ruzivo</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Hokoyo</translation>\n    </message>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_sq.ts",
    "content": "<TS language=\"sq\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Kliko me të djathtën për të ndryshuar adresën ose etiketen.</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Krijo një adresë të re</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;E re</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopjo adresën e zgjedhur në memorjen e sistemit </translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopjo</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Fshi adresen e selektuar nga lista</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksporto të dhënat e skedës korrente në një skedar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Fshi</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Zgjidh adresen ku do te dergoni monedhat</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Zgjidh adresën ku do të merrni monedhat</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Zgjidh</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Duke derguar adresen</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Duke marr adresen</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Këto janë Bitcoin adresat e juaja për të dërguar pagesa. Gjithmon kontrolloni shumën dhe adresën pranuese para se të dërgoni monedha.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Këto janë Bitcoin adresat e juaja për të pranuar pagesa. Rekomandohet që gjithmon të përdorni një adresë të re për çdo transaksion.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopjo adresen</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopjo &amp;Etiketë</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Ndrysho</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Eksporto listën e adresave</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Skedar i ndarë me pikëpresje(*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksportimi dështoj</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Gabim gjatë ruajtjes së listës së adresave në %1. Ju lutem provoni prapë.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiketë</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresë</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(pa etiketë)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Futni fjalëkalimin</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Fjalëkalimi i ri</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Përsërisni fjalëkalimin e ri</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Trego fjalëkalimin</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Kripto portofolin</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Ky veprim ka nevojë per fjalëkalimin e portofolit tuaj që të hapë portofolin.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Hap portofolin.</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Ky veprim kërkon frazkalimin e portofolit tuaj që të dekriptoj portofolin.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dekripto portofolin</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Ndrysho fjalëkalimin</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Fusni fjalëkalimin e vjetër dhe fjalëkalimin e ri që të hapni portofolin.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Konfirmoni enkriptimin e portofolit</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Jeni te sigurt te enkriptoni portofolin tuaj?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Portofoli u enkriptua</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Enkriptimi i portofolit dështoi</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Enkriptimi i portofolit dështoi për shkak të një gabimi të brëndshëm. portofoli juaj nuk u enkriptua.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Frazkalimet e plotësuara nuk përputhen.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>ç'kyçja e portofolit dështoi</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Frazkalimi i futur për dekriptimin e portofolit nuk ishte i saktë.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Dekriptimi i portofolit dështoi</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Duke u sinkronizuar me rrjetin...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Përmbledhje</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Trego një përmbledhje te përgjithshme të portofolit</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaksionet</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Shfleto historinë e transaksioneve</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Mbyllni aplikacionin</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opsione</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Duke marr adresen</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Ndrysho frazkalimin e përdorur per enkriptimin e portofolit</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Portofol</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Dergo</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Merr</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Shfaq / Fsheh</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Skedar</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Konfigurimet</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ndihmë</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Shiriti i mjeteve</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 Pas</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Problem</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacion</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>I azhornuar</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Duke u azhornuar...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Dërgo transaksionin</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Transaksion në ardhje</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Portofoli po &lt;b&gt; enkriptohet&lt;/b&gt; dhe është &lt;b&gt; i ç'kyçur&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Portofoli po &lt;b&gt; enkriptohet&lt;/b&gt; dhe është &lt;b&gt; i kyçur&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Zgjedhja e monedhes</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Shuma:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Sasia</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopjo adresën</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>po</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>jo</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(pa etiketë)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Ndrysho Adresën</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiketë</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresa</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Adresë e re pritëse</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Adresë e re dërgimi</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Ndrysho adresën pritëse</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>ndrysho adresën dërguese</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Adresa e dhënë \"%1\" është e zënë në librin e adresave. </translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Nuk mund të ç'kyçet portofoli.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Krijimi i çelësit të ri dështoi.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>emri</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versioni</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Miresevini</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Problem</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formilarë</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Opsionet</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Portofol</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Problem</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formilarë</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Sasia</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 dhe %2</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>i/e panjohur</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Informacion</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Hap</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>asnjehere</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>i/e panjohur</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Shuma:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiketë:</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Pastro</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Kopjo adresen</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresë</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Sasia</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiketë</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiketë</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(pa etiketë)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Dërgo Monedha</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Fonde te pamjaftueshme</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Shuma:</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Dërgo marrësve të ndryshëm njëkohësisht</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Balanca:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Konfirmo veprimin e dërgimit</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>konfirmo dërgimin e monedhave</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Shuma e paguar duhet të jetë më e madhe se 0.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(pa etiketë)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Sh&amp;uma:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Paguaj &amp;drejt:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiketë:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Ngjit nga memorja e sistemit</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Paguaj drejt:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Krijoni një etiketë për këtë adresë që t'ja shtoni librit të adresave</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Ngjit nga memorja e sistemit</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testo rrjetin]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>Hapur deri më %1</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/I pakonfirmuar</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 konfirmimet</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, nuk është transmetuar me sukses deri tani</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>i/e panjohur</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>transaksionit</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Sasia</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Ky panel tregon një përshkrim të detajuar të transaksionit</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Lloji</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiketë</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Hapur deri më %1</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>I/E konfirmuar(%1 konfirmime)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Ky bllok është marrë nga ndonjë nyje dhe ka shumë mundësi të mos pranohet! </translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>I krijuar por i papranuar</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Marrë me</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Dërguar drejt</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Pagesë ndaj vetvetes</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minuar</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(p/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(pa etiketë)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Received with</source>\n        <translation>Marrë me</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Dërguar drejt</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Minuar</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopjo adresën</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Skedar i ndarë me pikëpresje(*.csv)</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Data</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Lloji</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiketë</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresë</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Eksportimi dështoj</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Dërgo Monedha</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Eksporto të dhënat e skedës korrente në një skedar</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opsionet:</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Berthama Bitcoin</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacion</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Fonde te pamjaftueshme</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Rikerkim</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Problem</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_sr.ts",
    "content": "<TS language=\"sr\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Десни клик за измену адресе или ознаке</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Направите нову адресу</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Ново</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Копирај тренутно одабрану адресу</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Копирај</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Затвори</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Обришите тренутно одабрану адресу са листе</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Извези податке из одабране картице у фајлj</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Извези</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Обриши</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Изаберите адресу за слање</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Изаберите адресу за примање</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>&amp;Изабери</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Адресе за слање</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Адресе за примање</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Ово су ваше Биткоин адресе за слање уплата. Увек добро проверите износ и адресу на коју шаљете пре него што пошаљете уплату.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Ово су ваше Биткоин адресе за примање уплате. Препоручује се да се за сваку трансакцију користи нова адреса.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Копирај Адресу</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Копирај &amp; Обележи</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Измени</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Извези Листу Адреса</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Зарезом одвојене вредности (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Извоз Неуспешан</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Десила се грешка приликом покушаја да се листа адреса упамти на  %1. Молимо покушајте поново.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Етикета</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адреса</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без етикете)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Прозор за унос лозинке</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Унесите лозинку</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Нова лозинка</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Поновите нову лозинку</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Прикажи лозинку</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Унесите нову лозинку за приступ новчанику. &lt;br/&gt;Молимо да користите лозинку од &lt;b&gt;десет или више насумично одабраних карактера, или &lt;b&gt;осам или више речи&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Шифрирај новчаник</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Ова операција захтева да унесете лозинку новчаника како би откључали новчаник.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Откључај новчаник</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Ова операција захтева да унесете лозинку новчаника како би дешифровали новчаник.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Дешифруј новчаник</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Измену лозинку</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Унеси стару лозинку и нову лозинку новчаника.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Потврди шифрирање новчаника</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Упозорење: Уколико шифрирате новчаник и изгубите своју лозинку, &lt;b&gt;ИЗГУБИЋЕТЕ СВЕ СВОЈЕ БИТКОИНЕ&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Да ли сте сигурни да желите да шифрирате свој новчаник?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Новчаник шифриран</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 ће се сада затворити како би се завршио процес шифрирања.  Запамтите да шифрирањем свог новчаника не можете у потпуности заштити своје биткоине од крађе од стране злоћудних програма и компјутерских инфекција.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>ВАЖНО: Свакa претходнa резерва новчаника коју сте имали треба да се замени новим, шифрираним фајлом новчаника. Из сигурносних разлога, свака претходна резерва нешифрираног фајла новчаника постаће сувишна, чим почнете да користите нови, шифрирани новчаник.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Шифрирање новчаника неуспешно.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Шифрирање новчаника није успело због интерне грешке. Ваш новчаник није шифриран.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Лозинке које сте унели нису исте.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Отључавање новчаника није успело.</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Лозинка коју сте унели за дешифровање новчаника је погрешна.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Дешифровање новчаника неуспешно.</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Лозинка новчаника успешно је промењена.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Упозорање Caps Lock дугме укључено.</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>ИП/Нетмаск</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Забрањен до</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Потпиши &amp;поруку...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Синхронизација са мрежом у току...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Општи преглед</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Ноде</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Погледајте општи преглед новчаника</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Трансакције</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Претражите историјат трансакција</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>И&amp;злаз</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Напустите програм</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;О %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Прикажи информације о %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>О &amp;Qt-у</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Прегледајте информације о Qt-у</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>П&amp;оставке...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Измени конфигурацију поставки за %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Шифровање новчаника...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Резерна копија новчаника</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Промени &amp;лозинку...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Адресе за слање...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Адресе за пријем</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Отвори &amp;УРИ...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Кликни да искључиш активност на мрежи.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Активност на мрежи искључена.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Кликни да поново омогућиш активност на мрежи.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Синхронизовање Заглавља (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Поново идексирање блокова на диску.</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Пошаљите новац на Биткоин адресу</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Направите резервну копију новчаника на другој локацији</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Мењање лозинке којом се шифрује новчаник</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Прозор за отклањање грешке</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Отвори конзолу за отклањање грешака и дијагностику</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Верификовање поруке...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Биткоин</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Новчаник</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Пошаљи</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Прими</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Прикажи / Сакриј</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Прикажи или сакрији главни прозор</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Шифрирај приватни клуљ који припада новчанику.</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Потписуј поруку са своје Биткоин адресе као доказ да си њихов власник</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Верификуј поруке и утврди да ли су потписане од стране спецификованих Биткоин адреса</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Фајл</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Подешавања</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Помоћ</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Трака са картицама</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Затражи плаћање (генерише QR кодове и биткоин: URI-е)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Прегледајте листу коришћених адреса и етикета за слање уплата</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Прегледајте листу коришћених адреса и етикета за пријем уплата</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Отворите биткоин: URI или захтев за плаћање</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Опције командне линије</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Идексирање блокова на диску...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Обрада блокова на диску...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Обрађенo %n блокова историјата трансакција.</numerusform><numerusform>Обрађенo %n блокова историјата трансакција.</numerusform><numerusform>Обрађенo је %n блокова историјата трансакција.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 уназад</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Последњи примљени блок је направљен пре %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Трансакције након овога још неће бити видљиве.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greška</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Упозорење</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Информације</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Ажурно</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 клијент</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Ажурирање у току...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Датум: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Износ: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Тип: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Етикета: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Адреса: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Послана трансакција</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Придошла трансакција</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Генерисање ХД кључа је &lt;b&gt;омогућено&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Генерисање ХД кључа је &lt;b&gt;онеомогућено&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Новчаник јс &lt;b&gt;шифрован&lt;/b&gt; и тренутно &lt;b&gt;откључан&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Новчаник јс &lt;b&gt;шифрован&lt;/b&gt; и тренутно &lt;b&gt;закључан&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Дошло је до критичне грешке. Биткоин не може безбедно да настави са радом и искључиће се.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Избор новчића</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Количина:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Бајта:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Износ:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Накнада:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Прашина:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Након накнаде:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Промени:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>изаберите / поништите све\n</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Износ</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Примљено са етикетом</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Примљено са адресом</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Потврде</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Potvrdjen</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Копирај адресу</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копирај налепницу</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копирај износ</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Копирај идентификациони број трансакције</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Закључај непотрошено</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Откључај непотрошено</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Копирај количину</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Копирај провизију</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Копирај након провизије</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Копирај бајтове</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Копирај прашину</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Копирај промену</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 закључан)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>да</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>не</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без налепнице)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(промени)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Измени адресу</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Етикета</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Етикета повезана са овом ставком из листе адреса</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Адреса повезана са овом ставком из листе адреса. Ово можете променити једини у случају адреса за плаћање.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Адреса</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Нова адреса за пријем</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Нова адреса за слање</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Измени адресу за примање</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Измени адресу за слање</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Унета адреса \"%1\" се већ налази у адресару.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Новчаник није могуће откључати.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Генерисање новог кључа није успело.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Нови директоријум података ће бити креиран.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>име</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Директоријум већ постоји. Додајте %1 ако намеравате да креирате нови директоријум овде.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Путања већ постоји и није директоријум.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Не можете креирати директоријум података овде.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>верзија</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Приближно %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Опције командне линије</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Korišćenje:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>опције командне линије</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Изаберите директоријум података при покретању (подразумевано: %u)</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Добродошли</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Добродошли на  %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Пошто је ово први пут да је програм покренут, можете изабрати где ће %1 чувати своје податке.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Када кликнете на ОК, %1 ће почети с преузимањем и процесирањем целокупног ланца блокова %4 (%2GB), почевши од најранијих трансакција у %3 када је %4 покренут.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Ова иницијална синхронизација је веома захтевна и може изложити ваш рачунар хардверским проблемима који раније нису били примећени. Сваки пут када покренете %1, преузимање ће се наставити тамо где је било прекинуто.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Ако сте одлучили да ограничите складиштење ланаца блокова (тримовање), историјски подаци се ипак морају преузети и обрадити, али ће након тога бити избрисани како би се ограничила употреба диска.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Користите подразумевани директоријум података</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Користите прилагођени директоријум података:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Биткоин</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greška</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Форма</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Остала количина блокова</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Непознато...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Време последњег блока</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Напредак</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>Рачунање</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Сакриј</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Поставке</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Отвори Конфигурациону Датотеку</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>новчаник</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Експерт</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Тор</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Јединица за приказивање износа:</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Уреду</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Откажи</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greška</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Форма</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Доступно:</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>На чекању:</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Укупно:</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>iznos</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nepoznato</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>Last block time</source>\n        <translation>Време последњег блока</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Da</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Ne</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Iznos:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Етикета</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>Poruka:</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Prikaži</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копирај налепницу\n</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>к</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopirajte adresu</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Износ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Налепница</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Налепница</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без налепнице)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Слање новца</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Количина:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Бајта:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Iznos:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Накнада:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Након накнаде:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Промени:</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Сакриј</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Прашина:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Потврди акцију слања</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Пошаљи</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Копирај количину</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>к</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Копирај провизију</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Копирај бајтове</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Копирај прашину</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Копирај промену</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без налепнице)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Iznos:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Етикета</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+П</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Poruka:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Da</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+П</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Amount</source>\n        <translation>Износ</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Ovaj odeljak pokazuje detaljan opis transakcije</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Налепница</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(без налепнице)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Copy address</source>\n        <translation>Копирај адресу</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копирај налепницу\n</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>к</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Копирај идентификациони број трансакције</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Фајл раздојен тачком (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Налепница</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Извоз Неуспешан</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Izvedi</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Извези податке из одабране картице у фајлj</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Opcije</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Gde je konkretni data direktorijum </translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Prihvati komandnu liniju i JSON-RPC komande</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Radi u pozadini kao daemon servis i prihvati komande</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Информације</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Korisničko ime za JSON-RPC konekcije</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Упозорење</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Lozinka za JSON-RPC konekcije</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Nedovoljno sredstava</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Učitavam blok indeksa...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Новчаник се учитава...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Ponovo skeniram...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Završeno učitavanje</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greška</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_sr@latin.ts",
    "content": "<TS language=\"sr@latin\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Klikni desnim tasterom za uređivanje adrese ili oznake</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Kreiraj novu adresu</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Novi</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopiraj selektovanu adresu u sistemski klipbord</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopiraj</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Zatvori</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Briše trenutno izabranu adresu sa liste</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Izvoz podataka iz trenutne kartice u datoteku</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Izvoz</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Izbrisati</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Izaberite adresu za slanje novčića</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Izaberite adresu za prijem novčića</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>I&amp;zaberi</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Adresa na koju se šalje</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Adresa na koju se prima</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Ovo su Vaše Bitcoin adrese na koju se vrše uplate. Uvek proverite iznos i prijemnu adresu pre slanja novčića.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Ovo su Vaše Bitcoin adrese za primanje uplata. Preporučuje se upotreba nove adrese za svaku transakciju.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopiraj Adresu</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopiranje &amp;Oznaka</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Izmena</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Izvezi Listu Adresa</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Zarezom odvojena datoteka (*.csv) </translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Izvoz Neuspeo</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Desila se greška prilikom čuvanja liste adresa u %1. Molimo pokusajte ponovo.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez oznake)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Dialog pristupne fraze</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Unesi pristupnu frazu</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nova pristupna fraza</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Ponovo unesite pristupnu frazu</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Unesite novu pristupnu frazu u novčanik. &lt;br/&gt;Molimo, koristite pristupnu frazu koja ima &lt;b&gt; deset ili više nasumičnih znakova&lt;/b&gt;, ili &lt;b&gt;osam ili više reči&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Šifrujte novčanik</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Da biste otključali novčanik potrebno je da unesete svoju pristupnu frazu.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Otključajte novčanik</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Da biste dešifrovali novčanik, potrebno je da unesete svoju pristupnu frazu.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dešifrujte novčanik</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Promenite pristupnu frazu</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Unesite u novčanik staru pristupnu frazu i novu pristupnu frazu.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Potvrdite šifrovanje novčanika</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Upozorenje: Ako šifrujete svoj novčanik, i potom izgubite svoju pristupnu frazu &lt;b&gt;IZGUBIĆETE SVE SVOJE BITKOINE&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Da li ste sigurni da želite da šifrujete svoj novčanik?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Novčanik je šifrovan</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 će se ugasiti da bi dovršio proces enkriptovanja. Imajte u vidu da enkripcija novčanika ne garantuje potpunu zaštitu bitcoina od krađe od strane nekog virusa koji bi zarazio vaš kompjuter.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>VAŽNO: Ranije rezervne kopije wallet datoteke trebate zameniti sa novo-kreiranom, enkriptovanom wallet datotekom. Iz sigurnosnih razloga, ranije ne-enkriptovane wallet datoteke će postati neupotrebljive čim počnete koristiti novi, enkriptovani novčanik.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Enkripcija novčanika neuspešna</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Enkripcija novčanika nije uspela zbog greške u programu. Vaš novčanik nije enkriptovan.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Unete pristupne fraze nisu tačne.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Otključavanje novčanika neuspešno</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Pristupna fraza za dekriptovanje novčanika nije tačna.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Dekriptovanje novčanika neuspešno</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Pristupna fraza novčanika je uspešno promenjena.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Upozorenje: Caps Lock je uključen!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Banovani ste do</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Potpišite &amp;poruka...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Usklađivanje sa mrežom...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Pregled</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Čvor</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Prikaži opšti pregled novčanika</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transakcije</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Pregled istorije transakcija</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>I&amp;zađi</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Isključi aplikaciju</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Otprilike %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Prikaži informacije za otprilike %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>O &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Prikaži informacije o Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Opcije...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Izmeni podešavanja za %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Enkriptuj Novčanik...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Rezervna Kopija Novčanika...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Izmeni pristupnu frazu...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Slanje adresa...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Primanje adresa...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Otvori &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Odaberite za prekid aktivnosti na mreži.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Aktivnost na mreži je prekinuta.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Odaberite da ponovo dozvolite aktivnost na mreži.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Sinhronizujem Najnovije Blokove (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Ponovo obeležavam blokove na disku...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Pošalji novčiće na Bitcoin adresu</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Napravite rezervnu kopiju novčanika na drugom mestu</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Promenite pristupnu frazu za enkiptovanje novčanika</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Prozor za otklanjanje grešaka</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Otvori konzolu za dijagnostiku i otklanjanje grešaka</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Proveri poruku...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Novčanik</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Pošalji</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Primi</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Prikazati / Sakriti</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Prikaži ili sakrij glavni prozor</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Enkriptuj privatne ključeve novčanika</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Potpišite poruke sa svojim Bitcoin adresama da biste dokazali njihovo vlasništvo</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Proverite poruke da biste utvrdili sa kojim Bitcoin adresama su potpisane</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Fajl</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Podešavanja</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Pomoć</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Alatke za tabove</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Zatražite plaćanje (generiše QR kodove i bitcoin: URI-e)</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greska</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Upozorenje</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacije</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 klijent</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Iznos: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tip: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Oznaka: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adresa: %1\n</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Količina:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Iznos:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Naknada:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Nakon Naknade:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Kolicina</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez oznake)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Izmeni Adresu</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Oznaka</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adresa</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greska</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Error</source>\n        <translation>Greska</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Kolicina</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>nepoznato</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez oznake)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Količina:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Iznos:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Naknada:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Nakon Naknade:</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez oznake)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(bez oznake)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Zarezom odvojena datoteka (*.csv) </translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Oznaka</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adresa</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Izvoz Neuspeo</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Informacije</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Upozorenje</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Nedovoljno sredstava</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Ucitavanje indeksa bloka...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Ucitavanje novcanika...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Ponovno skeniranje...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Zavrseno ucitavanje</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Greska</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_sv.ts",
    "content": "<TS language=\"sv\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Högerklicka för att redigera adressen eller etiketten.</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Skapa ny adress</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Ny</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Kopiera den markerade adressen till systemets Urklipp</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopiera</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>S&amp;täng</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Ta bort den valda adressen från listan</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportera informationen i aktuell flik till en fil</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportera</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Radera</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Välj en adress att skicka transaktionen till</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Välj en adress att ta emot transaktionen med</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>V&amp;älj</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Avsändaradresser</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Mottagaradresser</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Detta är dina Bitcoin-adresser för att skicka betalningar. Kontrollera alltid summan och den mottagande adressen innan du skickar bitcoin.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Detta är dina Bitcoin-adresser för att ta emot betalningar. Det rekommenderas att använda en ny mottagningsadress för varje transaktion.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Kopiera adress</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopiera &amp;etikett</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Redigera</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Exportera adresslista</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Kommaseparerad fil (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Export misslyckades</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Ett fel inträffade när adresslistan skulle sparas till %1.\nVar vänlig och försök igen.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etikett</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adress</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(Ingen etikett)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Lösenordsdialog</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Ange lösenord</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Nytt lösenord</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Upprepa nytt lösenord</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Visa lösenord</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Ange plånbokens nya lösenord. &lt;br/&gt; Använd ett lösenord på &lt;b&gt;tio eller fler slumpmässiga tecken,&lt;/b&gt; eller &lt;b&gt;åtta eller fler ord.&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Kryptera plånbok</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Denna operation behöver din plånboks lösenord för att låsa upp plånboken.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Lås upp plånbok</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Denna operation behöver din plånboks lösenord för att dekryptera plånboken.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Dekryptera plånbok</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Ändra lösenord</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Ge det gamla lösenordet och det nya lösenordet för plånboken.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Bekräfta kryptering av plånbok</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>VARNING: Om du krypterar din plånbok och glömmer ditt lösenord, kommer du att &lt;b&gt;FÖRLORA ALLA DINA BITCOIN&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Är du säker på att du vill kryptera din plånbok?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Plånbok krypterad</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 kommer nu att stänga ner för att slutföra krypteringen. Tänk på att en krypterad plånbok inte skyddar mot stöld om din dator är infekterad med en keylogger.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>VIKTIGT: Alla tidigare säkerhetskopior du har skapat av plånboksfilen ska ersättas med den nyss skapade, krypterade plånboksfilen. Av säkerhetsskäl kommer tidigare säkerhetskopior av den okrypterade plånboksfilen att bli oanvändbara när du börjar använda den nya, krypterade plånboken.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Kryptering av plånbok misslyckades</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Kryptering av plånbok misslyckades på grund av ett internt fel. Din plånbok krypterades inte.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>De angivna lösenorden överensstämmer inte.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Misslyckades låsa upp plånboken</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Lösenordet för dekryptering av plånboken var felaktigt.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Dekryptering av plånbok misslyckades</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Plånbokens lösenord ändrades.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Varning: Caps Lock är påslaget!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/nätmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Bannad tills</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Signera &amp;meddelande...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Synkroniserar med nätverk...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Översikt</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Nod</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Visa generell översikt av plånboken</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Transaktioner</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Bläddra i transaktionshistorik</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Avsluta</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Avsluta programmet</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Om %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Visa information om %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Om &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Visa information om Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Alternativ...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Ändra konfigurationsalternativ för %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Kryptera plånbok...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Säkerhetskopiera plånbok...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Ändra lösenord...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Av&amp;sändaradresser...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Mottaga&amp;radresser...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Öppna &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Klicka för att inaktivera nätverksaktivitet.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Nätverksaktivitet inaktiverad.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Klicka för att aktivera nätverksaktivitet igen.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Synkar huvuden (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Återindexerar block på disken...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Skicka bitcoin till en Bitcoin-adress</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Säkerhetskopiera plånboken till en annan plats</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Byt lösenfras för kryptering av plånbok</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Debug-fönster</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Öppna debug- och diagnostikkonsolen</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Verifiera meddelande...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Plånbok</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Skicka</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Ta emot</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Visa / Göm</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Visa eller göm huvudfönstret</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Kryptera de privata nycklar som tillhör din plånbok</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Signera meddelanden med dina Bitcoin-adresser för att bevisa att du äger dem</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Verifiera meddelanden för att vara säker på att de signerades med angivna Bitcoin-adresser</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Arkiv</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Inställningar</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Hjälp</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Verktygsfält för tabbar</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Begär betalningar (skapar QR-koder och bitcoin: -URIer)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Visa listan med använda avsändaradresser och etiketter</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Visa listan med använda mottagningsadresser och etiketter</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Öppna en bitcoin: URI eller betalningsbegäran</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Kommandoradsalternativ</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n aktiva anslutningar till Bitcoin-nätverket.</numerusform><numerusform>%n aktiva anslutningar till Bitcoin-nätverket.</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Indexerar block på disken...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Bearbetar block på disken...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Bearbetade %n block av transaktionshistoriken.</numerusform><numerusform>Bearbetade %n block av transaktionshistoriken.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 efter</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Senast mottagna block skapades för %1 sedan.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Transaktioner efter denna kommer inte ännu vara synliga.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fel</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Varning</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Uppdaterad</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Visa %1 hjälpmeddelande för att få en lista med möjliga Bitcoin kommandoradsalternativ.</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1-klient</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Ansluter till noder...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Hämtar senaste...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Datum: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Belopp: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Typ: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etikett: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adress: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Transaktion skickad</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Inkommande transaktion</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD-nyckelgenerering är &lt;b&gt;aktiverad&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD-nyckelgenerering är &lt;b&gt;inaktiverad&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Denna plånbok är &lt;b&gt;krypterad&lt;/b&gt; och för närvarande &lt;b&gt;olåst&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Denna plånbok är &lt;b&gt;krypterad&lt;/b&gt; och för närvarande &lt;b&gt;låst&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Ett kritiskt fel uppstod. Bitcoin kan inte fortsätta att köra säkert och kommer att avslutas.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Myntval</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kvantitet:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Antal byte:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Belopp:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Avgift:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Damm:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Efter avgift:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Växel:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(av)markera allt</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Trädvy</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Listvy</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Mängd</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Mottagen med etikett</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Mottagen med adress</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Bekräftelser</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bekräftad</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiera adress</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiera etikett</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiera belopp</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopiera transaktions-ID</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Lås ospenderat</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Lås upp ospenderat</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopiera kvantitet</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopiera avgift</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopiera efter avgift</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopiera byte</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopiera damm</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopiera växel</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 låst)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>ja</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>nej</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Denna etikett blir röd om någon mottagare får en betalning som är mindre än aktuell dammtröskel.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Kan variera +/- %1 satoshi per inmatning.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(Ingen etikett)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>växel från %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(växel)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Redigera adress</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etikett</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Etiketten associerad med denna post i adresslistan</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Adressen associerad med denna post i adresslistan. Den kan bara ändras för sändningsadresser.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adress</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Ny mottagaradress</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Ny avsändaradress</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Redigera mottagaradress</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Redigera avsändaradress</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Den angivna adressen \"%1\" är inte en giltig Bitcoin-adress.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Den angivna adressen \"%1\" finns redan i adressboken.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Kunde inte låsa upp plånboken.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Misslyckades med generering av ny nyckel.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>En ny datakatalog kommer att skapas.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>namn</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Katalogen finns redan. Lägg till %1 om du vill skapa en ny katalog här.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Sökvägen finns redan, och är inte en katalog.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Kan inte skapa datakatalog här.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>version</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Om %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Kommandoradsalternativ</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Användning:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>kommandoradsalternativ</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>UI-inställningar:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Välj datakatalog vid uppstart (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Ange språk, till exempel \"de_DE\" (standard: systemspråk)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Starta minimerad</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Ange SSL-rotcertifikat för betalningsbegäran (standard: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Visa startbild vid uppstart (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Återställ alla inställningar som gjorts i GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Välkommen</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Välkommen till %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Eftersom detta är första gången programmet startas får du välja var %1 skall lagra sitt data.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Denna första synkronisering är väldigt krävande, och kan påvisa hårdvaruproblem med din dator som tidigare inte visats sig. Varje gång du kör %1, kommer nerladdningen att fortsätta där den avslutades.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Använd den förvalda datakatalogen</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Använd en anpassad datakatalog:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Minst %1 GB data kommer att lagras i den här katalogen, och den växer över tiden.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Ungefär %1 GB data kommer att lagras i den här katalogen.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 kommer att ladda ner och lagra en kopia av Bitcoin-blockkedjan.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Plånboken lagras också i den här katalogen.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Fel: Angiven datakatalog \"%1\" kan inte skapas.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fel</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB fritt utrymme kvar</numerusform><numerusform>%n GB fritt utrymme kvar</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(av %n GB behövs)</numerusform><numerusform>(av %n GB behövs)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulär</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Nyligen gjorda transaktioner visas inte korrekt och därför kan din plånboks saldo visas felaktigt. Denna information kommer att visas korrekt så snart din plånbok har synkroniserat klart med Bitcoin-nätverket enligt detaljer nedan.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Att försöka spendera bitcoin som påverkas av transaktioner som ännu inte visas kommer inte accepteras av nätverket. </translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Antal block kvar</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Okänt...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Sista blocktid</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Förlopp</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Framstegssökning per timme</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>beräknar...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Beräknad tid kvar tills synkroniserad</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Göm</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Okänd. Synkar huvuden (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Öppna URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Öppna betalningsbegäran från URI eller fil</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Välj betalningsbegäransfil</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Välj betalningsbegäransfil som ska öppnas</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Alternativ</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Allmänt</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Starta %1 automatiskt efter inloggningen.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Starta %1 vid systemlogin</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Storleken på &amp;databascache</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Antalet skript&amp;verifikationstrådar</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Proxyns IP-adress (t.ex.  IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Visas, om den angivna standard-SOCKS5-proxyn används för att nå noder via den här nätverkstypen.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Använd separata SOCKS&amp;5-proxy för att nå noder via Tors dolda tjänster:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Göm ikonen från aktivitetsfältet.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Göm ikonen</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimera istället för att stänga programmet när fönstret stängs. När detta alternativ är aktiverat stängs programmet endast genom att välja Stäng i menyn.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Tredjeparts URL:er (t.ex. en blockutforskare) som finns i transaktionstabben som ett menyval i sammanhanget. %s i URL:en ersätts med tansaktionshashen. Flera URL:er är separerade med vertikala streck |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Aktiva kommandoradsalternativ som ersätter alternativen ovan:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Öppna konfigurationsfilen %1 från arbetskatalogen.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Öppna Konfigurationsfil</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Återställ alla klientinställningar till förvalen.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Återställ alternativ</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Nätverk</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = lämna så många kärnor lediga)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Plånbok</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Aktivera mynt&amp;kontrollfunktioner</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Om du avaktiverar spendering av obekräftad växel, kan inte växeln från en transaktion användas förrän transaktionen har minst en bekräftelse. Detta påverkar också hur ditt saldo beräknas.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Spendera obekräftad växel</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Öppna automatiskt Bitcoin-klientens port på routern. Detta fungerar endast om din router stödjer UPnP och det är är aktiverat.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Tilldela port med hjälp av &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Acceptera anslutningar utifrån.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Tillåt ankommande anslutningar</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Anslut till Bitcoin-nätverket genom en SOCKS5-proxy.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Anslut genom SOCKS5-proxy (förvald proxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy-&amp;IP: </translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port: </translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Proxyns port (t.ex. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Används för att nå noder via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Anslut till Bitcoin-nätverket genom en separat SOCKS5-proxy för dolda tjänster i Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Fönster</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Visa endast en systemfältsikon vid minimering.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimera till systemfältet istället för aktivitetsfältet</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimera vid stängning</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Visa</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Användargränssnittets &amp;språk: </translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Användargränssnittets språk kan ställas in här. Denna inställning träder i kraft efter en omstart av %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Måttenhet att visa belopp i: </translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Välj en måttenhet att visa i gränssnittet och när du skickar mynt.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Om myntkontrollfunktioner skall visas eller inte</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;URL:er för tredjepartstransaktioner</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Avbryt</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>standard</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>ingen</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Bekräfta att alternativen ska återställs</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Klientomstart är nödvändig för att aktivera ändringarna.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Programmet kommer att stängas. Vill du fortsätta?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Konfigurationsalternativ</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Konfigurationsfilen används för att ange avancerade användaralternativ som överskrider GUI-inställningarna. Dessutom kommer alla kommandoradsalternativ att överskrida denna konfigurationsfil.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fel</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Konfigurationsfilen kunde inte öppnas.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Denna ändring kräver en klientomstart.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Den angivna proxy-adressen är ogiltig.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Formulär</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Den visade informationen kan vara inaktuell. Plånboken synkroniseras automatiskt med Bitcoin-nätverket efter att anslutningen är upprättad, men denna process har inte slutförts ännu.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Granska-bara:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Tillgängligt:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Ditt tillgängliga saldo</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Pågående:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Totalt antal transaktioner som ännu inte bekräftats, och som ännu inte räknas med i aktuellt saldo</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Omogen:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Genererat saldo som ännu inte har mognat</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Saldon</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Totalt:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Ditt aktuella totala saldo</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Ditt aktuella saldo i granska-bara adresser</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Spenderbar:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Nyligen genomförda transaktioner</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Obekräftade transaktioner till granska-bara adresser</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Genererat saldo i granska-bara adresser som ännu inte har mognat</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Aktuellt totalt saldo i granska-bara adresser</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Fel vid betalningsbegäran</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Kan inte starta bitcoin: klicka-och-betala hanteraren</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI-hantering</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Hämtningsadressen för betalningsbegäran är ogiltig: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Ogiltig betalningsadress %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI kan inte parsas! Detta kan orsakas av en ogiltig Bitcoin-adress eller felaktiga URI-parametrar.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Hantering av betalningsbegäransfil</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Betalningsbegäransfilen kan inte läsas! Detta kan orsakas av en ogiltig betalningsbegäransfil.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Betalningsbegäran avslogs</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Betalningsbegärans nätverk matchar inte klientens nätverk.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Betalningsbegäran löpte ut.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Betalningsbegäran är inte initierad.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Overifierade betalningsbegäranden till anpassade betalningsskript stöds inte.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Ogiltig betalningsbegäran.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Begärd betalning av %1 är för liten (betraktas som damm).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Återbetalning från %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Betalningsbegäran %1 är för stor (%2 bytes, tillåten %3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Kommunikationsfel med %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Betalningsbegäran kan inte parsas!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Felaktigt svar från server %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Fel vid nätverksbegäran</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Betalningen bekräftad</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Användaragent</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Nod/Tjänst</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Nod-ID</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Skickad</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Mottagen</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Mängd</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Ange en Bitcoin-adress (t.ex. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 m</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Ingen</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>ej tillgänglig</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n sekund</numerusform><numerusform>%n sekunder</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n minut</numerusform><numerusform>%n minuter</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n timme</numerusform><numerusform>%n timmar</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n dag</numerusform><numerusform>%n dagar</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n vecka</numerusform><numerusform>%n veckor</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 och %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n år</numerusform><numerusform>%n år</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 avslutades inte ännu säkert...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>okänd</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Fel: Angiven datakatalog \"%1\" finns inte.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Fel: Kan inte läsa konfigurationsfilen: %1. Använd bara nyckel=värde formatet.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Fel: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Spara Bild...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Kopiera Bild</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Spara QR-kod</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG-bild (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>ej tillgänglig</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Klient-version</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Information</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Debug fönster</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Generell</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Använder BerkeleyDB versionen</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datakatalog</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Uppstartstid</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Nätverk</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Namn</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Antalet anslutningar</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blockkedja</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Aktuellt antal block</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Minnespool</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Aktuellt antal transaktioner</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Minnesåtgång</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Återställ</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Mottagen</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Skickad</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Klienter</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Bannade noder</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Välj en klient för att se detaljerad information.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Vitlistad</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Riktning</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Version</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Startblock</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Synkade huvuden</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Synkade block</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Användaragent</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Öppna %1 debug-loggfilen från aktuell datakatalog. Detta kan ta några sekunder för stora loggfiler.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Minska fontstorleken</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Öka fontstorleken</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Tjänster</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Banpoäng</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Anslutningstid</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Senast sänt</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Senast mottagen</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Pingtid</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Tidsåtgången för en aktuell utestående ping.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Pingväntetid</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Min Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Tidsförskjutning</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Sista blocktid</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Öppna</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsol</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Nätverkstrafik</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totalt:</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>In:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Ut:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Debugloggfil</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Rensa konsollen</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;timme</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;dag</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;vecka</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;år</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Koppla ner</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Blockera i</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Ta bort blockering</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Välkommen till %1 RPC-konsolen.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Använd upp- och ner-pilarna för att navigera i historiken, och %1 för att rensa skärmen.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Skriv %1 för att få en överblick över tillgängliga kommandon.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>För mer information om att använda denna konsol, skriv %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>VARNING: Bedragare är kända för att be användare skriva olika kommandon här, varpå de stjäl plånböckernas innehåll. Använd inte konsolen utan att fullt ut förstå konsekvenserna av ett visst kommando.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Nätverksaktivitet inaktiverad</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(nod-id: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>aldrig</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Inkommande</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Utgående</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Nej</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Okänd</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Belopp:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etikett:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Meddelande:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Ett valfritt meddelande att bifoga betalningsbegäran, vilket visas när begäran öppnas. Obs: Meddelandet kommer inte att sändas med betalningen över Bitcoin-nätverket.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>En valfri etikett att associera med den nya mottagningsadressen.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Använd detta formulär för att begära betalningar. Alla fält är  &lt;b&gt;valfria&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>En valfri summa att begära. Lämna denna tom eller noll för att inte begära en specifik summa.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Rensa alla formulärfälten</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Rensa</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Historik för begärda betalningar</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>Begä&amp;r betalning</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Visa valda begäranden (gör samma som att dubbelklicka på en post)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Visa</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Ta bort valda poster från listan</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Ta bort</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Kopiera URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiera etikett</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Kopiera meddelande</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiera belopp</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-kod</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Kopiera &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Kopiera &amp;Adress</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Spara Bild...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Begär betalning till %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Betalinformaton</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adress</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Belopp</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikett</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Meddelande</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI:n är för lång, försöka minska texten för etikett / meddelande.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Fel vid skapande av QR-kod från URI.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikett</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Meddelande</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(Ingen etikett)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(inget meddelande)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(inget belopp begärt)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Begärt</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Skicka pengar</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Myntkontrollfunktioner</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Inmatningar...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>automatiskt vald</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Otillräckliga medel!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Kvantitet:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Antal Byte:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Belopp:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Avgift:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Efter avgift:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Växel:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Om denna är aktiverad men växeladressen är tom eller ogiltig kommer växeln att sändas till en nyss skapad adress.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Anpassad växeladress</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transaktionsavgift:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Välj...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Med standardavgiften riskerar en transaktion ta timmar eller dagar för att bekräftas, om den ens gör det. Överväg att själv välja avgift alternativt vänta tills du har validerat hela kedjan.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Varning: Avgiftsberäkning är för närvarande inte möjlig.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>Fäll ihop avgiftsinställningarna</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>per kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Om den anpassade avgiften är satt till 1000 satoshi och transaktionen bara är 250 byte, betalar \"per kilobyte\" bara 250 satoshi i avgift, medan \"totalt minst\" betalar 1000 satoshi. För transaktioner större än en kilobyte betalar båda per kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Göm</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Att bara betala den minsta avgiften är helt ok så länge transaktionsvolymen är mindre än ledigt utrymme i blocken. Men tänk på att det kan bli en en transaktion som aldrig bekräftas om efterfrågan på bitcoin-transaktioner är större än vad nätverket kan hantera.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(läs verktygstips)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Rekommenderad:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Anpassad:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Smartavgiften är inte initierad än. Detta tar vanligen några block...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Skicka till flera mottagare samtidigt</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Lägg till &amp;mottagare</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Rensa alla formulärfälten</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Damm:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Bekräftelsestidsmål:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Möjliggör ersättande avgift</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>Med ersättande avgift (BIP-125) kan du höja transaktionsavgiften efter att transaktionen redan skickats. Om du väljer bort det kan en högre avgift rekommenderas för att kompensera för ökad risk för förhöjd transaktionstid.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Rensa &amp;alla</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Saldo:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Bekräfta sändåtgärden</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Skicka</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Kopiera kvantitet</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiera belopp</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Kopiera avgift</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Kopiera efter avgift</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Kopiera byte</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Kopiera damm</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Kopiera växel</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 block)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 till %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Är du säker på att du vill skicka?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>adderad som transaktionsavgift</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Totalt belopp %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>eller</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Du kan välja att höja avgiften senare (med ersättande avgift, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Använder inte ersättande avgift, BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Bekräfta att mynt ska skickas</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Mottagarens adress är ogiltig. Kontrollera igen.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Det betalade beloppet måste vara större än 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Beloppet överstiger ditt saldo.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Totalbeloppet överstiger ditt saldo när transaktionsavgiften %1 är pålagd.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Dubblettadress hittades: adresser skall endast användas en gång var.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Transaktionen gick inte att skapa!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Transaktionen avvisades med följande orsak: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>En avgift högre än %1 anses vara en absurd hög avgift.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Betalningsbegäran löpte ut.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Betala endast den nödvändiga avgiften på %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Uppskattas till att påbörja bekräftelse inom %n block.</numerusform><numerusform>Uppskattas till att påbörja bekräftelse inom %n block.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Varning: Ogiltig Bitcoin-adress</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Varning: Okänd växeladress</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Bekräfta anpassad växeladress</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Den adress du valt för växel ingår inte i denna plånbok. Eventuella eller alla pengar i din plånbok kan komma att skickas till den här adressen. Är du säker?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen etikett)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Belopp:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Betala &amp;Till:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etikett:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Välj tidigare använda adresser</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Detta är en normal betalning.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Bitcoin-adress att sända betalning till</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Klistra in adress från Urklipp</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Radera denna post</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Avgiften dras från beloppet som skickas. Mottagaren kommer att ta emot mindre bitcoin än du angivit i beloppsfältet. Om flera mottagare valts kommer avgiften att fördelas jämt.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>S&amp;ubtrahera avgiften från beloppet</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Använd tillgängligt saldo</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Meddelande:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Detta är en oautentiserad betalningsbegäran.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Detta är en autentiserad betalningsbegäran.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Ange en etikett för denna adress för att lägga till den i listan med använda adresser</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Ett meddelande som bifogades bitcoin: -URIn och som lagras med transaktionen som referens. NB: Meddelandet kommer inte att sändas över Bitcoin-nätverket.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Betala Till:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>PM:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Ange en etikett för denna adress för att lägga till den i din adressbok</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Ja</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 stängs av...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Stäng inte av datorn förrän denna ruta försvinner.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Signaturer - Signera / Verifiera ett Meddelande</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Signera Meddelande</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Du kan signera meddelanden/avtal med dina adresser för att bevisa att du kan ta emot bitcoin som skickats till dem. Var försiktig så du inte signerar något oklart eller konstigt, eftersom phishing-angrepp kan försöka få dig att signera över din identitet till dem. Signera endast väldetaljerade meddelanden som du godkänner.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Bitcoin-adress att signera meddelandet med</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Välj tidigare använda adresser</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Klistra in adress från Urklipp</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Skriv in meddelandet du vill signera här</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signatur</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Kopiera signaturen till systemets Urklipp</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Signera meddelandet för att bevisa att du äger denna Bitcoin-adress</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Signera &amp;Meddelande</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Rensa alla fält</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Rensa &amp;alla</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verifiera Meddelande</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Ange mottagarens adress, meddelande (kopiera radbrytningar, mellanslag, TAB-tecken, osv. exakt) och signatur nedan, för att verifiera meddelandet. Undvik att läsa in mera information i signaturen än vad som stod i själva det signerade meddelandet, för att undvika ett man-in-the-middle-angrepp. Notera att detta endast bevisar att den signerande parten tar emot med adressen, det bevisar inte vem som skickat transaktionen!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Bitcoin-adress som meddelandet signerades med</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verifiera meddelandet för att vara säker på att det signerades med angiven Bitcoin-adress</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verifiera &amp;Meddelande</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Rensa alla fält</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Klicka \"Signera Meddelande\" för att skapa en signatur</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Den angivna adressen är ogiltig.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Vad god kontrollera adressen och försök igen.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Den angivna adressen refererar inte till en nyckel.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Upplåsningen av plånboken avbröts.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Den privata nyckeln för den angivna adressen är inte tillgänglig.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Signeringen av meddelandet misslyckades.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Meddelande signerat.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Signaturen kunde inte avkodas.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Kontrollera signaturen och försök igen.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Signaturen matchade inte meddelandesammanfattningen.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Meddelandeverifikation misslyckades.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Meddelande verifierat.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Öppet för %n mer block</numerusform><numerusform>Öppet för %n mer block</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Öppet till %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>konflikt med en transaktion med %1 konfirmationer</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/nedkopplad</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/obekräftade, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>i minnespoolen</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>ej i minnespoolen</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>övergiven</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/obekräftade</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 bekräftelser</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>,har inte lyckats sända än</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, sänd genom %n nod</numerusform><numerusform>, sänd genom %n noder</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Källa</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Genererad</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Från</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>okänd</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Till</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>egen adress</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>granska-bara</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etikett</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Kredit</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>mognar om %n mer block</numerusform><numerusform>mognar om %n fler block</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>inte accepterad</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Belasta</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Total debet</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Total kredit</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transaktionsavgift</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Nettobelopp</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Meddelande</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Kommentar</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transaktions-ID</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Transaktionens totala storlek</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Utmatningsindex</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Handlare</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Skapade mynt måste mogna i %1 block innan de kan spenderas. När du skapade detta block sändes det till nätverket för att läggas till i blockkedjan. Om blocket inte kommer in i kedjan kommer dess status att ändras till \"ej accepterat\" och går inte att spendera. Detta kan ibland hända om en annan nod skapar ett block nästan samtidigt som dig.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Debug information</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transaktion</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Inmatningar</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Belopp:</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>sant</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>falsk</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Den här panelen visar en detaljerad beskrivning av transaktionen</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Detaljer för %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikett</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Öppet för %n mer block</numerusform><numerusform>Öppet för %n fler block</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Öppet till %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Nerkopplad</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Obekräftade</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Övergiven</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Bekräftar (%1 av %2 rekommenderade bekräftelser)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Bekräftad (%1 bekräftelser)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Konflikt</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Omogen (%1 bekräftelser, blir tillgänglig efter %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Det här blocket togs inte emot av några andra noder och kommer antagligen inte att accepteras!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Skapad men inte accepterad</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Mottagen med</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Mottaget från</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Skickad till</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Betalning till dig själv</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Genererade</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>granska-bara</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ingen etikett)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Transaktionsstatus. Håll muspekaren över för att se antal bekräftelser.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Datum och tid då transaktionen mottogs.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Transaktionstyp.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Anger om en granska-bara--adress är involverad i denna transaktion.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Användardefinierat syfte/ändamål för transaktionen.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Belopp draget eller tillagt till saldo.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Alla</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Idag</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Denna vecka</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Denna månad</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Föregående månad</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Det här året</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Period...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Mottagen med</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Skickad till</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Till dig själv</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Genererade</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Övriga</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Ange adress, transaktions-id eller etikett för att söka</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Minsta belopp</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Avbryt transaktionen</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Öka transaktionsavgift</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Kopiera adress</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Kopiera etikett</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Kopiera belopp</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Kopiera transaktions-ID</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Kopiera rå transaktion</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Kopiera alla transaktionsdetaljerna</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Redigera etikett</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Visa transaktionsdetaljer</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Exportera Transaktionshistoriken</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Kommaseparerad fil (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Bekräftad</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Enbart granskning</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Datum</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Typ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etikett</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adress</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Export misslyckades</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Ett fel inträffade när transaktionshistoriken skulle sparas till %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exporteringen lyckades</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Transaktionshistoriken sparades till %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Räckvidd:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>till</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>&amp;Enhet att visa belopp i. Klicka för att välja annan enhet.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Ingen plånbok har lästs in.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Skicka Bitcoins</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Ökning av avgiften lyckades inte</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Vill du öka avgiften?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Aktuell avgift:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Öka:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Ny avgift:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Bekräfta avgiftshöjning</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Kan ej signera transaktion.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Kunde inte skicka transaktion</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Exportera</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Exportera informationen i aktuell flik till en fil</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Säkerhetskopiera Plånbok</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Plånboks-data (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Säkerhetskopiering misslyckades</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Ett fel inträffade när plånbokens data skulle sparas till %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Säkerhetskopiering lyckades</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Plånbokens data sparades till %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Inställningar:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Ange katalog för data</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Anslut till en nod för att hämta peer-adresser, och koppla från</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Ange din egen publika adress</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Tillåt kommandon från kommandotolken och JSON-RPC-kommandon</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distribuerad under MIT mjukvarulicens, se den bifogade filen %s eller %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Om &lt;kategori&gt; inte anges eller om &lt;category&gt; = 1, visa all avlusningsinformation.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Beskärning konfigurerad under miniminivån %d MiB. Vänligen använd ett högre värde.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Beskärning: sista plånbokssynkroniseringen ligger utanför beskuren data. Du måste använda -reindex (ladda ner hela blockkedjan igen eftersom noden beskurits)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Omskanningar kan inte göras i beskuret läge. Du måste använda -reindex vilket kommer ladda ner hela blockkedjan igen.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Fel: Ett kritiskt internt fel uppstod, se debug.log för detaljer</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Avgift (i %s/kB) att lägga till på transaktioner du skickar (förvalt: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Rensar blockstore...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Kör i bakgrunden som tjänst och acceptera kommandon</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Kunde inte starta HTTP-server. Se avlusningsloggen för detaljer.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>%s-utvecklarna</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>En avgiftskurs (i %s/kB) som används när det inte finns tillräcklig data för att uppskatta avgiften (förvalt: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Acceptera vidarebefodrade transaktioner från vitlistade noder även när transaktioner inte vidarebefodras (förvalt: %d)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Bind till given adress och lyssna alltid på den. Använd [värd]:port notation för IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Kan inte låsa data-mappen %s. %s körs förmodligen redan.</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Ta bort alla plånbokstransaktioner och återskapa bara dom som är en del av blockkedjan genom att ange -rescan vid uppstart</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Fel vid läsning av %s! Alla nycklar lästes korrekt, men transaktionsdata eller poster i adressboken kanske saknas eller är felaktiga.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Exekvera kommando när en plånbokstransaktion ändras (%s i cmd är ersatt av TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Extra transaktioner att hålla i minnet för kompakta blockrekonstruktioner (standard: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Maximalt tillåten median-peer tidsoffset justering. Lokalt perspektiv av tiden kan bli påverkad av partners, framåt eller bakåt denna tidsrymd. (förvalt: %u sekunder)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Maximal total avgift (i %s) att använda i en plånbokstransaktion eller råa transaktioner. Sätts denna för lågt kan stora transaktioner avbrytas (förvalt: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Vänligen kolla så att din dators datum och tid är korrekt! Om din klocka går fel kommer %s inte att fungera korrekt.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Var snäll och bidra om du finner %s användbar. Besök %s för mer information om mjukvaran.</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Ange antalet skriptkontrolltrådar (%u till %d, 0 = auto, &lt;0 = lämna så många kärnor lediga, förval: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Blockdatabasen innehåller ett block som verkar vara från framtiden. Detta kan vara på grund av att din dators datum och tid är felaktiga. Bygg bara om blockdatabasen om du är säker på att datorns datum och tid är korrekt</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Detta är ett förhandstestbygge - använd på egen risk - använd inte för brytning eller handelsapplikationer</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Kunde inte spela om block. Du kommer att behöva bygga om databasen med -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Kan inte spola tillbaka databasen till obeskärt läge. Du måste ladda ner blockkedjan igen</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Använd UPnP för att mappa den lyssnande porten (förvalt: 1 när lyssning aktiverat och utan -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Användarnamn och hashat lösenord för JSON-RPC-anslutningar. Fältet &lt;userpw&gt; kommer i formatet: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Ett kanoniskt pythonskript finns inkluderat i share/rpcuser. Klienten kopplas sedan normalt med rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; par argument. Detta alternativ kan anges flera gånger</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Plånboken skapar inte transaktioner som bryter mot mempools kedjegränser (förval: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Varning: Nätverket verkar inte vara helt överens! Några brytare verkar ha problem.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Varning: Vi verkar inte helt överens med våra peers! Du kan behöva uppgradera, eller andra noder kan behöva uppgradera.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Hurvida mempoolen ska sparas vid avstängning och läsas in vid omstart (förval: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d av de senaste 100 blocken har oväntad version</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s är korrupt, räddning misslyckades</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool måste vara minst %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; Kan vara:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Acceptera anslutningar utifrån (förvalt: 1 om ingen -proxy eller -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Lägg till kommentar till user-agent-strängen</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Försök att rädda privata nycklar från en korrupt plånbok vid uppstart</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Block skapande inställningar:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Kan inte matcha -%s adress: '%s'</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Förändringsindexet utanför tillåtet intervall</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Anslutningsalternativ:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Korrupt blockdatabas har upptäckts</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Avlusnings/Test-alternativ:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Läs inte in plånboken och stäng av RPC-anrop till plånboken</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Vill du bygga om blockdatabasen nu?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Aktivera publicering av hashblock i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Aktivera publicering av hashtransaktion i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Aktivera publicering av råa block i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Aktivera publicering av råa transaktioner i &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Aktivera byte av transaktioner i minnespoolen (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Fel vid initiering av blockdatabasen</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Fel vid initiering av plånbokens databasmiljö %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Fel vid inläsning av %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Fel vid inläsning av %s: Plånboken är korrupt</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Fel vid inläsning av %s: Plånboken kräver en senare version av %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Fel vid inläsning av blockdatabasen</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Fel vid öppning av blockdatabasen</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Fel: Hårddiskutrymme är lågt!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Misslyckades att lyssna på någon port. Använd -listen=0 om du vill detta.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Misslyckades med att skanna om plånboken under initiering.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importerar...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Felaktig eller inget genesisblock hittades. Fel datadir för nätverket?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Initieringschecken fallerade. %s stängs av.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Ogiltigt belopp för -%s=&lt;amount&gt;:'%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Ogiltigt belopp för -discardfee=&lt;amount&gt;:'%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Ogiltigt belopp för -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Håll minnespoolen över transaktioner under &lt;n&gt; megabyte (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Läser in P2P-adresser...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Läser in svarta listan...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Plats för authcookie (förvalt: datamapp)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Inte tillräckligt med filbeskrivningar tillgängliga.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Anslut enbart till noder i nätverket &lt;net&gt; (IPv4, IPv6 eller onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Visa denna hjälptext och avsluta</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Visa version och avsluta</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Beskärning kan inte konfigureras med ett negativt värde.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Beskärningsläge är inkompatibel med -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Återskapa blockkedjans status och index från blk*.dat filer på disken</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Återskapa blockkedjans status från aktuella indexerade block</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Spelar om block...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Spolar tillbaka blocken...</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Sätt databasens cachestorlek i megabyte (%d till %d, förvalt: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Ange plånboksfil (inom datakatalogen)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Källkoden är tillgänglig från %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Beräkning av transaktionsavgift och växel mislyckades</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Det går inte att binda till %s på den här datorn. %s är förmodligen redan igång.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Argumentet -benchmark stöds inte och ignoreras, använd -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Argumentet -debugnet stöds inte och ignoreras, använd -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Argumentet -tor hittades men stöds inte, använd -onion.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Uppgraderar UTXO-databasen</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Använd UPnP för att mappa den lyssnande porten (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Använd testkedjan</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Kommentaren i användaragent (%s) innehåller osäkra tecken.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verifierar block...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Plånbokens Avlusnings/Testnings optioner:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Plånboken behöver sparas om: Starta om %s för att fullfölja</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Plånboksinställningar:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Tillåt JSON-RPC-anslutningar från angiven källa. Tillåtna &lt;ip&gt; är en IP (t.ex 1.2.3.4), ett nätverk/nätmask (t.ex. 1.2.3.4/255.255.255.0) eller ett nätverk/CIDR (t.ex. 1.2.3.4/24). Detta alternativ kan anges flera gånger</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Bind till given adress och vitlista klienter som ansluter till den. Använd [värd]:port notation för IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Skapa nya filer med systemets förvalda rättigheter, istället för umask 077 (bara effektivt med avaktiverad plånboks funktionalitet)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Upptäck egna IP adresser (standard: 1 vid lyssning och ingen -externalip eller -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Fel: Avlyssning av inkommande anslutningar misslyckades (Avlyssningen returnerade felkod %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Exekvera kommando när ett relevant meddelande är mottagen eller när vi ser en väldigt lång förgrening (%s i cmd är utbytt med ett meddelande)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Avgifter (i %s/kB) mindre än detta betraktas som nollavgift för vidarebefordran, brytning och transaktionsskapande (förvalt: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Om paytxfee inte har angivits, inkludera tillräcklig avgift så att transaktioner börjar bekräftas inom n blocks(förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Ogiltigt belopp för -maxtxfee=&lt;amount&gt;: '%s' (måste vara åtminstone minrelay avgift %s för att förhindra stoppade transaktioner)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maximal storlek på data i databärartransaktioner som vi reläar och bryter (förvalt: %u) </translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Slumpa autentiseringen för varje proxyanslutning. Detta möjliggör Tor ström-isolering (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Transaktionen är för liten att skicka efter det att avgiften har dragits</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Vitlistade klienter kan inte bli DoS-bannade och deras transaktioner reläas alltid, även om dom redan är i mempoolen, användbart för t.ex en gateway  </translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Du måste bygga om databasen genom att använda -reindex för att återgå till obeskärt läge. Detta kommer att ladda ner hela blockkedjan på nytt.</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Acceptera publika REST förfrågningar (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Skapa automatiskt dold tjänst i Tor (förval: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Anslut genom SOCKS5 proxy</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Fel vid inläsning av %s: Du kan inte avaktivera HD på en redan existerande HD-plånbok</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Fel vid läsning från databas, avslutar.</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Importera block från extern blk000??.dat-fil vid uppstart</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Information</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Ogiltig -onion adress eller värdnamn: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Ogiltig -proxy adress eller värdnamn: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Ogiltigt belopp för -paytxfee=&lt;amount&gt;:'%s' (måste vara minst %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Ogiltig nätmask angiven i -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Håll som mest &lt;n&gt; oanslutningsbara transaktioner i minnet (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Port måste anges med -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Nodreläalternativ:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC-serveralternativ:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Minskar -maxconnections från %d till %d, på grund av systembegränsningar.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Sök i blockkedjan efter saknade plånbokstransaktioner vid uppstart</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Skicka trace-/debuginformation till terminalen istället för till debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Visa alla avlusningsalternativ (använd: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Krymp debug.log filen vid klient start (förvalt: 1 vid ingen -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Signering av transaktion misslyckades</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>Angiven -walletdir \"%s\" finns inte</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>Angiven -walletdir \"%s\" är en relativ sökväg</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>Angiven -walletdir \"%s\" är inte en katalog</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Transaktionen är för liten för att betala avgiften</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Detta är experimentmjukvara.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Lösenord för Tor-kontrollport (förval: inget)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Tor-kontrollport att använda om onion är aktiverat (förval: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transaktions belopp för liten</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transaktionen är för stor för avgiftspolicyn</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transaktionen är för stor</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Det går inte att binda till %s på den här datorn (bind returnerade felmeddelande %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Det gick inte att skapa ursprungliga nycklar</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Uppgradera plånbok till senaste formatet vid uppstart</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Användarnamn för JSON-RPC-anslutningar</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Verifierar plånbok(er)...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Varning</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Varning: okända nya regler aktiverade (versionsbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Ska allt göras i endast block-läge (förval: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Du måste återskapa databasen med -reindex för att ändra -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Töm plånboken på alla transaktioner...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ-alternativ för notiser:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Lösenord för JSON-RPC-anslutningar</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Exekvera kommando när det bästa blocket ändras (%s i cmd är utbytt av blockhash)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Tillåt DNS-sökningar för -addnode, -seednode och -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = spara tx metadata t.ex. kontoägare och betalningsbegäransinformation, 2 = släng tx metadata)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee är väldigt högt satt! Så höga avgifter kan komma att betalas för en enstaka transaktion.</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Håll inte transaktioner i minnespoolen längre än &lt;n&gt; timmar (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Samma antal byte per sigop i transaktioner som vi reläar och bryter (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Fel vid inläsning av %s: Du kan inte aktivera HD på en existerande icke-HD plånbok</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Fel vid inläsningen av plånbok %s. -wallet parametern kan bara innehålla ett filnamn (inte en sökväg).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Avgifter (i %s/kB) mindre än detta anses vara nollavgifter vid skapande av transaktion (standard: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Vidarebefordra alltid transaktioner från vitlistade noder även om de bryter mot den lokala reläpolicyn (förvalt: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Hur grundlig blockverifikationen vid -checkblocks är (0-4, förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Upprätthåll ett fullständigt transaktionsindex, som används av getrawtransaction rpc-anrop (förval: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Antal sekunder att hindra klienter som missköter sig från att ansluta (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Skriv ut avlusningsinformation (förvalt: %u, att ange &lt;category&gt; är valfritt)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Stöd filtrering av block och transaktioner med bloomfilter (standard: %u)</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Detta är transaktionsavgiften du kan komma att betala om uppskattad avgift inte finns tillgänglig.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Denna produkten innehåller mjukvara utvecklad av OpenSSL Project för användning i OpenSSL Toolkit %s och kryptografisk mjukvara utvecklad av Eric Young samt UPnP-mjukvara skriven av Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Total längd på strängen för nätverksversion (%i) överskrider maxlängden (%i). Minska numret eller storleken på uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Försöker hålla utgående trafik under givet mål (i MiB per 24 timmar), 0 = ingen gräns (förvalt: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Argumentet -socks hittades och stöds inte. Det är inte längre möjligt att sätta SOCKS-version längre, bara SOCKS5-proxy stöds.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Argumentet -whitelistalwaysrelay stöds inte utan ignoreras, använd -whitelistrelay och/eller -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Använd separat SOCKS5 proxy för att nå kollegor via dolda tjänster i Tor (förvalt: -%s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Varning: Okända blockversioner bryts! Det är möjligt att okända regler används</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Varning: Plånboksfilen var korrupt, data har räddats! Den ursprungliga %s har sparas som %s i %s. Om ditt saldo eller transaktioner är felaktiga bör du återställa från en säkerhetskopia.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s är satt väldigt högt!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(förvalt: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Fråga alltid efter klientadresser med DNS-sökning (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Fel vid inläsningen av plånbok %s. -wallet filnamn måste var en vanlig fil.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Fel vid inläsningen av plånbok %s. Dublett -wallet filnamn angavs.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Fel vid inläsningen av plånbok %s. Ogiltiga tecken i -wallet filnamn.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Hur många block att kontrollera vid uppstart (förvalt: %u, 0 = alla)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Inkludera IP-adresser i debugutskrift (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Lyssna på JSON-RPC-anslutningar på &lt;port&gt; (förval: %u eller testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Lyssna efter anslutningar på &lt;port&gt; (förvalt: %u eller testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Ha som mest &lt;n&gt; anslutningar till andra klienter (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Gör så att plånboken sänder ut transaktionerna</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximal mottagningsbuffert per anslutning, &lt;n&gt;*1000 byte (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximal sändningsbuffert per anslutning, &lt;n&gt;*1000 byte (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Skriv ut tidsstämpel i avlusningsinformationen (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Reläa och bryta databärartransaktioner (förvalt: %u) </translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Reläa icke-P2SH multisig (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Sätt storleken på nyckelpoolen till &lt;n&gt; (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Sätt maximal BIP141 blockvikt (förvalt: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Ange antalet trådar för att hantera RPC anrop (förvalt: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Ange konfigurationsfil (förvalt: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Ange timeout för uppkoppling i millisekunder (minimum:1, förvalt: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Ange pid-fil (förvalt: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Spendera obekräftad växel när transaktioner sänds (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Startar nätverkstrådar...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Plånboken undviker att betala mindre än lägsta reläavgift.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Det här är minimum avgiften du kommer betala för varje transaktion. </translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Det här är transaktionsavgiften du kommer betala om du skickar en transaktion. </translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Tröskelvärde för att koppla ifrån klienter som missköter sig (förvalt: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Transaktionens belopp får ej vara negativ</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Transaktionen har för lång mempool-kedja</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Transaktionen måste ha minst en mottagare</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Okänt nätverk angavs i -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Otillräckligt med bitcoins</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Laddar blockindex...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Laddar plånbok...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Kan inte nedgradera plånboken</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Söker igen...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Klar med laddning</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Fel</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ta.ts",
    "content": "<TS language=\"ta\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>ஒரு புதிய முகவரியை உருவாக்கு</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;புதிய</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;நகல்</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;மூடு</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;ஏற்றுமதி</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;அழி</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>முகவரிகள் அனுப்பப்படுகின்றன</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>முகவரிகள் பெறப்படுகின்றன</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Address</source>\n        <translation>முகவரி</translation>\n    </message>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;கண்ணோட்டம்</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;பரிவர்த்தனைகள்</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;வெளியேறு</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>விலகு</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;Qt-ஐ பற்றி</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;விருப்பங்கள்...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;என்க்ரிப்ட் பணப்பை...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>&amp;URI-ஐ திற</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;செய்தியை சரிசெய்...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>பணப்பை</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;அனுப்பு</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;பெறு</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;காட்டு/மறை</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;கோப்பு</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;அமைப்பு</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;உதவி</translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 பின்னால்</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>தவறு</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>எச்சரிக்கை</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>தகவல்</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>தேதி: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>தொகை: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>வகை: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>முகவரி: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>அனுப்பிய பரிவர்த்தனை</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>அளவு</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>விலை:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>கட்டணம்:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>கட்டணத்திறகுப் பின்:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>மாற்று:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>விலை</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>தேதி</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>உறுதிப்படுத்தல்கள்</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>உறுதியாக</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>பெயர்</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>நல்வரவு</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>தவறு</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>படிவம்</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>மறை</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>URI-ஐ திற</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>விருப்பத்தேர்வு</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;தலைமை</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;பிணையம்</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;பணப்பை</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>வல்லுநர்</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;சாளரம்</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;காட்டு</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;சரி</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;ரத்து</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>இயல்புநிலை</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>none</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>தவறு</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>படிவம்</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>கிடைக்ககூடிய:</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>நிலுவையில்:</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>முதிராத:</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>மீதி</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>மொத்தம்:</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>பயனர் முகவர்</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>அனுப்பிய</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>விலை</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 h</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 மற்றும் %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>வாடிக்கையாளர் பதிப்பு</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;தகவல்</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>பிணையம்</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>பெயர்</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>நினைவக குளம்</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>நினைவக பயன்பாடு</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>அனுப்பிய</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>திசை</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>பதிப்பு</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>பயனர் முகவர்</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>பிங் நேரம்</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;திற</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;பணியகம்</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>மொத்தம்</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>உள்ளே:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>வெளியே:</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;மணி</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;நாள்</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;வாரம்</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;ஆண்டு</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>ஒருபோதும்</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>உள்வரும்</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>வெளி செல்லும்</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>ஆம்</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>மறு</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>அறியப்படாத</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;தொகை:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;சிட்டை:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;செய்தி:</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>நீக்கு</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>காண்பி</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>நீக்கு</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR குறியீடு</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>நகலை &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>நகலை விலாசம்</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;படத்தை சேமி...</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>முகவரி</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>அளவு</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>விலை</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>கட்டணம்:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>கட்டணத்திறகுப் பின்:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>மாற்று:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>தேர்ந்தெடு...</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>மறை</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>மீதி:</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;அனுப்பு</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;தொகை:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;சிட்டை:</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>செய்தி:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>கையொப்பம்</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Address</source>\n        <translation>முகவரி</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin மையம்</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(default: %u)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>தகவல்</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>எச்சரிக்கை</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(default: %s)</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>தவறு</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ta_IN.ts",
    "content": "<TS language=\"ta_IN\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Create a new address</source>\n        <translation>புதிய முகவரியை உருவாக்கவும்</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>பட்டியலிலிருந்து தற்போது தேர்ந்தெடுக்கப்பட்ட முகவரி நீக்கவும்</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>கடவுச்சொல் உரையாடல் </translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>புதிய கடவுச்சொல்</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>குறியாக்க பணப்பையை</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>பணப்பை திறக்க</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>பணப்பை குறியாக்க</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>கடுவு சொற்றொடரை மாற்று</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Error</source>\n        <translation>பிழை</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Error</source>\n        <translation>பிழை</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Error</source>\n        <translation>பிழை</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>கட்டணம் ஒப்புக் கொண்டது</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>unknown</source>\n        <translation>தெரியாத</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>Requested payments history</source>\n        <translation>பணம் செலுத்திய வரலாறு கோரப்பட்டது</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Payment information</source>\n        <translation>கொடுப்பனவு தகவல்</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Balance:</source>\n        <translation>இருப்பு:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>unknown</source>\n        <translation>தெரியாத</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Today</source>\n        <translation>இன்று</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>போதுமான பணம் இல்லை</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>பிழை</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_te.ts",
    "content": "<TS language=\"te\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>చిరునామా లేదా లేబుల్ సవరించడానికి రైట్-క్లిక్ చేయండి</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>క్రొత్త చిరునామా సృష్టించండి</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;క్రొత్త</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>ప్రస్తుతం ఎంచుకున్న చిరునామాను సిస్టం క్లిప్ బోర్డుకు కాపీ చేయండి</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;కాపి</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>C&amp;కోల్పోవు</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>ప్రస్తుతం ఎంచుకున్న చిరునామా ను జాబితా నుండి తీసివేయండి</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>ఎగుమతి చేయండి</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>తొలగించండి</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>కోయిన్స్ పంపుటకు చిరునామా ను ఎంచుకోండి</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>ఎంచుకోండి</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>పంపించే చిరునామాలు</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>అందుకునే చిరునామాలు</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>ఇవి మీరు పంపే చెల్లింపుల బిట్‌కాయిన్ చిరునామాలు. నాణేలు పంపే ముందు ప్రతిసారి అందుకునే చిరునామా మరియు చెల్లింపు మొత్తం సరిచూసుకోండి.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>ఇవి మీరు అందుకునే చెల్లింపుల బిట్‌కాయిన్ చిరునామాలు. ప్రతీ లావాదేవీకి క్రొత్త అందుకునే చిరునామా వాడటం మంచిది.</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>సవరించు</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>చిరునామా జాబితాను ఎగుమతి చేయండి</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>ఎగుమతి విఫలమయ్యింది</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ఉల్లాకు</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>చిరునామా</translation>\n    </message>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>సంకేతపదము డైలాగ్</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>సంకేతపదము చేర్చండి</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>క్రొత్త సంకేతపదము</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>క్రొత్త సంకేతపదము మరలా ఇవ్వండి</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>జోలెకు క్రొత్త సంకేతపదము ఇవ్వండి.&lt;br/&gt; &lt;b&gt;పది లేదా ఎక్కువ యాదృచ్ఛిక అక్షరాలు&lt;/b&gt;, లేక &lt;b&gt;ఎనిమిది కంటే ఎక్కువ పదాలు&lt;/b&gt; కలిగి ఉన్న సంకేతపదము దయచేసి వాడండి.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>వాలెట్ అన్లాక్</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>హెచ్చరిక: మీ జోలెని సంకేతపరిచి మీ సంకేతపదము కోల్పోతే, &lt;b&gt;మీ బిట్‌కాయిన్లు అన్నీ కోల్పోతారు&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>మీరు ఖచ్చితంగా మీ జోలెని సంకేతపరచాలని కోరుకుంటున్నారా?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>జోలె సంకేతపరబడింది</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>జోలె సంకేతపరచడం విఫలమయ్యింది</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>నిష్క్రమించు</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>బిట్కోయిన్</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>వాలెట్</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>పంపు</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>లోపం</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>హెచ్చరిక</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>వర్తమానము</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>తాజాగా ఉంది</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>తోటివాళ్లతో అనుసంధానం కుదురుస్తుంది</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>నాణెం ఎంపిక</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>పరిమాణం</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>తేదీ</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>బిట్కోయిన్</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>లోపం</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Error</source>\n        <translation>లోపం</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>unknown</source>\n        <translation>తెలియదు</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>చిరునామా</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ఉల్లాకు</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>సందేశం</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>తేదీ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ఉల్లాకు</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>సందేశం</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>పరిమాణం</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Status</source>\n        <translation>స్థితి</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>తేదీ</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>నుండి</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>తెలియదు</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>కు</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>సందేశం</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>వర్తకుడు</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>తేదీ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ఉల్లాకు</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Date</source>\n        <translation>తేదీ</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ఉల్లాకు</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>చిరునామా</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>గుర్తింపు</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>ఎగుమతి విఫలమయ్యింది</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>ఎగుమతి చేయండి</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>బిట్కోయిన్ కోర్</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>వర్తమానము</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>హెచ్చరిక</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>లోపం</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_th.ts",
    "content": "<TS language=\"th\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>คลิกขวาเพื่อแก้ไขที่อยู่หรือชื่อ</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>สร้างที่อยู่ใหม่</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>ใหม่</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>คัดลอกที่อยู่ที่เลือกอยู่ไปยังคลิบบอร์ดของระบบ</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>คัดลอก</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>ปิด</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>ลบที่อยู่ที่เลือกไว้ออกจากรายการ</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>ส่งออกข้อมูลที่อยู่ในแถบนี้ไปในไฟล์</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>ส่งออก</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>ลบ</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>เลือกที่อยู่ที่จะส่งเหรียญ</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>เลือกที่อยู่ที่จะรับเหรียญ</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>เลือก</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>ที่อยู่ในการส่ง</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>ที่อยู่ในการรับ</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>ที่อยู่ Bitcoin ของคุณสำหรับการส่งการชำระเงิน โปรดตรวจสอบจำนวนเงินและที่อยู่รับก่อนที่จะส่งเหรียญ</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>ที่อยู่ Bitcoin ของคุณสำหรับการรับเงิน แนะนำให้ใช้ที่อยู่รับใหม่สำหรับแต่ละธุรกรรม</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>คัดลอกที่อยู่</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>คัดลอกชื่อ</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>แก้ไข</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>ส่งออกรายการที่อยู่</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>ไฟล์ที่คั่นด้วยจุลภาค (* .csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>การส่งออกล้มเหลว</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ฉลาก, ป้าย,</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>ที่อยู่</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ไม่มีฉลาก)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>กล่องโต้ตอบวลีรหัสผ่าน</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>ป้อนวลีรหัสผ่าน</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>วลีรหัสผ่านใหม่</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>ทำซ้ำข้อความรหัสใหม่</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>กระเป๋าสตางค์ เข้ารหัส</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>การดำเนินการนี้ต้องการกระเป๋าสตางค์กระเป๋าสตางค์ของคุณเพื่อปลดล็อกกระเป๋าสตางค์</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>ปลดล็อค กระเป๋าสตางค์ </translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>การดำเนินการนี้ ต้องการ รหัสผ่าน กระเป๋าสตางค์ ของคุณ เพื่อ ถอดรหัส กระเป๋าสตางค์</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>ถอดรหัส กระเป๋าสตางค์</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>เปลี่ยน ข้อความรหัสผ่าน</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(ไม่มีฉลาก)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>ที่อยู่</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ฉลาก, ป้าย,</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ฉลาก, ป้าย,</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ไม่มีฉลาก)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(ไม่มีฉลาก)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>ฉลาก, ป้าย,</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(ไม่มีฉลาก)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>ไฟล์ที่คั่นด้วยจุลภาค (* .csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>ฉลาก, ป้าย,</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>ที่อยู่</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>การส่งออกล้มเหลว</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>ส่งออก</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>ส่งออกข้อมูลที่อยู่ในแถบนี้ไปในไฟล์</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_th_TH.ts",
    "content": "<TS language=\"th_TH\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>คลิกขวาเพื่อแก้ไขที่อยู่ หรือป้ายชื่อ</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>สร้างที่อยู่ใหม่</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;สร้างใหม่</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>คัดลอกที่อยู่ที่ถูกเลือกไปยัง คลิปบอร์ดของระบบ</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;คัดลอก</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;ปิด</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>ลบที่อยู่ที่เลือกไว้ในขณะนี้จากรายการ</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>ส่งออกข้อมูลที่อยู่ในแท็บไปที่ไฟล์</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;ส่งออก</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;ลบ</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>เลือกที่อยู่เพื่อส่งเหรียญไปไว้</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>เลือกที่อยู่เพื่อส่งเหรียญไปไว้</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>ส่งที่อยู่</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>ช่องสำหรับ รหัสผ่าน</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>ใส่รหัสผ่าน</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>รหัสผา่นใหม่</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>กรุณากรอกรหัสผ่านใหม่อีกครั้งหนึ่ง</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask (ตัวกรอง IP)</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>ห้าม จนถึง</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>เซ็นต์ชื่อด้วย &amp;ข้อความ...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>กำลังทำข้อมูลให้ตรงกันกับเครือข่าย ...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;ภาพรวม</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node/โหนด</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>แสดงภาพรวมทั่วไปของกระเป๋าเงิน</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;การทำรายการ</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>เรียกดูประวัติการทำธุรกรรม</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;ออก</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>ออกจากโปรแกรม</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;เกี่ยวกับ %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>แสดงข้อมูล เกี่ยวกับ %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>เกี่ยวกับ &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>แสดงข้อมูล เกี่ยวกับ Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;ตัวเลือก...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>ปรับปรุง ข้อมูลการตั้งค่าตัวเลือก สำหรับ %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;กระเป๋าเงินเข้ารหัส</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;สำรองกระเป๋าเงิน...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;เปลี่ยนรหัสผ่าน...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;ที่เก็บเงิน ที่จะส่ง bitcoin</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;ที่เก็บเงิน ที่จะรับ bitcoin</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>เปิด &amp;URI</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>กำลังทำดัชนี ที่เก็บบล็อก ใหม่ ในดิสก์...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>ส่ง coins ไปยัง ที่เก็บ Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>สำรอง กระเป๋าเงินไปยัง ที่เก็บอื่น</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>เปลี่ยนรหัสผ่านที่ใช้สำหรับการเข้ารหัสกระเป๋าเงิน</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;หน้าต่าง Debug</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>เปิด แผลงควบคุม debugging และ diagnostic</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;ยืนยันข้อความ...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>กระเป๋าเงิน</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;ส่ง</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;รับ</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;แสดง / ซ่อน</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>แสดง หรือ ซ่อน หน้าหลัก</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>เข้ารหัส private keys/ รหัสส่วนตัว สำหรับกระเป๋าเงินของท่าน</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>เซ็นชื่อด้วยข้อความ ที่เก็บ Bitcoin เพื่อแสดงว่าท่านเป็นเจ้าของ bitcoin นี้จริง</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>ตรวจสอบ ข้อความ เพื่อให้แน่ใจว่า การเซ็นต์ชื่อ ด้วยที่เก็บ Bitcoin แล้ว</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;ไฟล์</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;การตั้งค่า</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;ช่วยเหลือ</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>แถบเครื่องมือ</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>เรียกเก็บ การชำระเงิน (สร้าง QR codes และ bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>แสดงรายการ ที่เก็บเงินที่จะส่ง bitcoin ออก และป้ายชื่อ ที่ใช้ไปแล้ว</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>แสดงรายการ ที่เก็บเงินที่จะรับ bitcoin เข้า และป้ายชื่อ ที่ใช้ไปแล้ว</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>เปิด bitcoin: URI หรือ การเรียกเก็บเงิน (การเรียกให้ชำระเงิน)</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;ตัวเลือก Command-line</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n ช่องการเชื่อมต่อที่ใช้งานได้ เพื่อเชื่อมกับเครือข่าย Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>การกำลังสร้างดัชนีของบล็อก ในดิสก์...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>กำลังดำเนินการกับบล็อกในดิสก์...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>%n บล็อกในประวัติรายการ ได้รับการดำเนินการเรียบร้อยแล้ว</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 ตามหลัง</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>บล็อกสุดท้ายที่ได้รับ สร้างขึ้นเมื่อ %1 มาแล้ว</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>รายการหลังจากนี้ จะไม่แสดงให้เห็น</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>ข้อผิดพลาด</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>คำเตือน</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>ข้อมูล</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>ทันสมัย</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>แสดง %1 ข้อความช่วยเหลือ เพื่อแสดงรายการ ตัวเลือกที่เป็นไปได้สำหรับ Bitcoin command-line</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 ลูกค้า</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>กำลังตามให้ทัน...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>วันที่: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>จำนวน: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>ชนิด: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>ป้ายชื่อ: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>ที่อยู่: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>รายการที่ส่ง</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>การทำรายการขาเข้า</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>ระเป๋าเงินถูก &lt;b&gt;เข้ารหัส&lt;/b&gt; และในขณะนี้ &lt;b&gt;ปลดล็อคแล้ว&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>กระเป๋าเงินถูก &lt;b&gt;เข้ารหัส&lt;/b&gt; และในปัจจุบัน &lt;b&gt;ล็อค &lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>การเลือก Coin</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>จำนวน:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>ไบต์:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>จำนวน:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>ค่าธรรมเนียม:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>เศษ:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>ส่วนที่เหลือจากค่าธรรมเนียม:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>เงินทอน:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(ไม่)เลือกทั้งหมด</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>โหมดแบบต้นไม้</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>โหมดแบบรายการ</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>จำนวน</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>รับโดยป้ายชื่อ (label)</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>รับโดยที่เก็บ</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>วันที่</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>การยืนยัน</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>ยืนยันแล้ว</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>แก้ไขที่อยู่</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;ป้ายชื่อ</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>รายการแสดง ป้ายชื่อที่เกี่ยวข้องกับที่เก็บนี้</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>ที่เก็บที่เกี่ยวข้องกับ ที่เก็บที่แสดงรายการนี้ การปรับปรุงนี้ทำได้สำหรับ ที่เก็บเงินที่จะใช่ส่งเงิน เท่านั้น</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;ที่เก็บ</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>ไดเร็กทอรี่ใหม่ที่ใช้เก็บข้อมูลจะถูกสร้างขึ้นมา</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>ชื่อ</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>ไดเร็กทอรี่มีอยู่แล้ว ใส่เพิ่ม %1 หากท่านต้องการสร้างไดเร็กทอรี่ใหม่ที่นี่</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>พาธ มีอยู่แล้ว พาธนี่ไม่ใช่ไดเร็กทอรี่</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>ไม่สามารถสร้างไดเร็กทอรี่ข้อมูลที่นี่</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>เวอร์ชั่น</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-บิท)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>เกี่ยวกับ %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>ตัวเลือก Command-line</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>วิธีใช้งาน:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>ตัวเลือก command-line</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>ตัวเลือก UI:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>เลือกไดเร็กทอรี่ข้อมูลตั้งแต่เริ่มต้นสตาร์ทอัพ (ค่าเริ่มต้น: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>ตั้งค่าภาษา ยกตัวอย่าง \"de_DE\" (ค่าเริ่มต้น: ภาษาท้องถิ่นของระบบ)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>เริ่มต้นมินิไมซ์</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>ตั้งค่า SSL root certificates สำหรับเรียกการชำระเงิน (ค่าเริ่มต้น: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>แสดง splash screen ตอนเริ่มต้น (ค่าเริ่มต้น: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>รีเซตการเปลี่ยนการตั้งค่าทั้งหมดใน GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>ยินดีต้อนรับ</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>ยินดีต้องรับสู่ %1</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>นี่เป็นการรันโปรแกรมครั้งแรก ท่านสามารถเลือก ว่าจะเก็บข้อมูลไว้ที่ %1</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>ใช้ไดเร็กทอรี่ข้อมูล ที่เป็นค่าเริ่มต้น</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>ใช้ไดเร็กทอรี่ข้อมูลที่ตั้งค่าเอง:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>ข้อผิดพลาด: ไดเร็กทอรี่ข้อมูลที่ต้องการ \"%1\" ไม่สามารถสร้างได้</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>ข้อผิดพลาด</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB พื้นที่ว่างบนดิสก์ที่ใช้ได้</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(ต้องการพื้นที่ %n GB)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>รูป</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>เปิด URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>เปิด การเรียกการชำระเงิน จาก URI หรือ ไฟล์</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>เลือก ไฟล์การเรียกการชำระเงิน</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>ตัวเลือก</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;หลัก</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>เริ่มต้นอัตโนมัติ %1 หลังจาก ล็อกอิน เข้าสู่ระบบแล้ว</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;เริ่ม %1 ในการล็อกอินระบบ</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>ขนาดของ &amp;database cache</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>จำนวนของสคริปท์ &amp;verification threads</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP แอดเดส ของ proxy (เช่น IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>มินิไมซ์แอพ แทนการออกจากแอพพลิเคชั่น เมื่อวินโดว์ได้รับการปิด เมื่อเลือกตัวเลือกนี้ แอพพลิเคชั่น จะถูกปิด ก็ต่อเมื่อ มีการเลือกเมนู Exit/ออกจากระบบ เท่านั้น</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>URL แบบอื่น (ยกตัวอย่าง เอ็กพลอเลอร์บล็อก) ที่อยู่ใน เมนูรายการ ลำดับ %s ใน URL จะถูกเปลี่ยนด้วย รายการแฮช URL ที่เป็นแบบหลายๆอัน จะถูกแยก โดย เครื่องหมายเส้นบาร์ตั้ง |</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>ตัวเลือก command-line แอกทีฟอยู่นี้ จะแทนที่ ตัวเลือกด้านบนนี้:</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>รีเซต ไคลเอ็นออพชั่น กลับไปเป็นค่าเริ่มต้น</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;รีเซต ออพชั่น</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;เน็ตเวิร์ก</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = อัตโนมัติ, &lt;0 = ปล่อย คอร์ อิสระ)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>กระเ&amp;ป๋าเงิน</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>ผู้เชี่ยวชาญ</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>เปิดใช้ coin &amp; รูปแบบการควบคุม</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>หากท่านไม่เปิดใช้ การใช้เงินทอนที่ยังไม่ยืนยัน เงินทอนจากการทำรายการจะไม่สามารถใช้ได้ จนกว่ารายการที่ทำการ จะได้รับการยืนยันหนึ่งครั้ง และจะกระทบการคำนวณยอดคงเหลือของท่านด้วย</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;ใช้เงินทอนที่ยังไม่ยืนยัน</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>เปิด Bitcoin ไคล์เอ็นท์พอร์ต/client port บน router โดยอัตโนมัติ วิธีนี้ใช้ได้เมื่อ router สนับสนุน UPnP และสถานะเปิดใช้งาน</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>จองพอร์ต โดยใช้ &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>เชื่อมต่อกับ Bitcoin เน็ตเวิร์ก ผ่านพร็อกซี่แบบ SOCKS5</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;เชื่อมต่อผ่าน พร็อกซี่ SOCKS5 (พร็อกซี่เริ่มต้น):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>พร็อกซี่ &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;พอร์ต</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>พอร์ตของพร็อกซี่ (ตัวอย่าง 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>ใช้ในการเข้าถึงอีกฝ่ายหนึ่ง peer โดย:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>เชื่อมต่อกับ เครือข่าย Bitcoin ผ่านทาง พร้อกซี่ SOCKS5 แยกต่างหาก สำหรับ Tor เซอร์วิส</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;วันโดว์</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>แสดงเทรย์ไอคอน หลังมืนิไมส์วินโดว์ เท่านั้น</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>ข้อผิดพลาด</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>รูป</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>จำนวน</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 และ %2</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;ชื่อ:</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>ส่งเหรียญ</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>จำนวน:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>ไบต์:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>จำนวน:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>ค่าธรรมเนียม:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>ส่วนที่เหลือจากค่าธรรมเนียม:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>เงินทอน:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>เศษ:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;ชื่อ:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>ตัวเลือก:</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>ข้อมูล</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>คำเตือน</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>ข้อผิดพลาด</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_tr.ts",
    "content": "<TS language=\"tr\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Adres veya etiketi düzenlemek için sağ tıklayınız.</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Yeni bir adres oluştur</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Yeni</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Seçili adresi panoya kopyala</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopyala</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>K&amp;apat</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Seçili adresi listeden sil</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Açık olan sekmedeki verileri bir dosyaya aktar</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Dışarı aktar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Sil</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Parayı göndermek istediğiniz adresi seçiniz</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Parayı almak istediğiniz adresi seçiniz</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>S&amp;eçiniz</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Gönderilen adresler</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Alım adresleri</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Bunlar ödemeleri göndermek için kullanacağınız Bitcoin adreslerinizdir. Bitcoin yollamadan önce tutarı ve alıcının alım adresini her zaman kontrol ediniz.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Bunlar ödemeleri almak için kullanacağınız Bitcoin adreslerinizdir. Her işlem için yeni bir alım adresi kullanmanız tavsiye edilir.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Adresi Kopyala</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>&amp;Etiketi Kopyala</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Değiştir</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Adres Listesini Dışarı Aktar</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Virgülle ayrılmış değerler dosyası (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Dışarı Aktarım Başarısız Oldu</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Adres listesinin %1 konumuna kaydedilmesi sırasında bir hata meydana geldi. Lütfen tekrar deneyin.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(etiket yok)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Parola Diyaloğu</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Parolayı giriniz</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Yeni parola</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Yeni parolayı tekrarlayınız</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Parolayı göster</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Cüzdan için yeni parolayı giriniz.&lt;br/&gt;Lütfen &lt;b&gt;on ya da daha fazla rastgele karakter&lt;/b&gt; veya &lt;b&gt;sekiz ya da daha fazla kelime&lt;/b&gt; içeren bir parola kullanınız.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Cüzdanı şifrele</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Bu eylem cüzdan kilidini açmak için cüzdan parolanızı gerektirir.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Cüzdan kilidini kaldır</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Bu eylem, cüzdan şifresini çözmek için cüzdan parolanıza ihtiyaç duyuyor.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Cüzdanın şifrelemesini aç</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Parola değiştir</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Eski ve yeni parolanızı cüzdana giriniz.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Cüzdan şifrelemesini onayla</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Uyarı: Eğer cüzdanınızı şifreler ve parolanızı kaybederseniz &lt;b&gt;TÜM BİTCOİNLERİNİZİ KAYBEDECEKSİNİZ&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Cüzdanınızı şifrelemek istediğinizden emin misiniz?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Cüzdan şifrelendi</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>Şifreleme işleminin bitirilmesi için %1 kapatılacak. Her ne kadar cüzdanınızı şifreleseniz de şifrelemenin bitcoinlerinizi bilgisayarınıza bulaşan zararlılardan tam olarak koruyamayacağını unutmayın.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>ÖNEMLİ: Önceden yapmış olduğunuz cüzdan dosyası yedeklemelerinin yeni oluşturulan şifrelenmiş cüzdan dosyası ile değiştirilmeleri gerekir. Güvenlik nedenleriyle yeni, şifrelenmiş cüzdanı kullanmaya başladığınızda eski şifrelenmemiş cüzdan dosyaları işe yaramaz hale gelecektir.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Cüzdan şifreleme başarısız</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Dahili bir hata yüzünden cüzdan şifrelemesi başarısız oldu. Cüzdanın şifrelenmedi.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Girilen parolalar birbiriyle eşleşmiyor.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Cüzdan kilidini kaldırma başarısız oldu</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Cüzdan şifresinin açılması için girilen parola yanlıştı.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Cüzdan şifresinin açılması başarısız oldu</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Cüzdan parolası başarılı bir şekilde değiştirildi.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Uyarı: Caps Lock tuşu etkin durumda!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Ağ Maskesi</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Şu zamana kadar yasaklı:</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>&amp;İleti imzala...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Ağ ile senkronize ediliyor...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Genel bakış</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Düğüm</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Cüzdana genel bakışı göster</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;İşlemler</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>İşlem geçmişine gözat</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Ç&amp;ık</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Uygulamadan çık</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>%1 &amp;Hakkında</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>%1 hakkında bilgi göster</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;Qt Hakkında</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Qt hakkında bilgi göster</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Seçenekler...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>%1 için yapılandırma ayarlarını değiştir</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Cüzdanı Şifrele...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Cüzdanı Yedekle...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Parolayı Değiştir...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Gönderme adresleri...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Alma adresleri...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>&amp;URI Aç...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Ağ etkinliğini devre dışı bırakmak için tıklayın.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Ağ etkinliği devre dışı bırakılmış.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Ağ etkinliğini yeniden etkinleştirmek için tıklayın.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Üstbilgiler Senkronize Ediliyor (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Diskteki bloklar yeniden indeksleniyor...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Bir bitcoin adresine bitcoin gönder</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Cüzdanı diğer bir konumda yedekle</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Cüzdan şifrelemesi için kullanılan parolayı değiştir</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Hata ayıklama penceresi</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Hata ayıklama ve teşhis penceresini aç</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>İletiyi &amp;kontrol et...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Cüzdan</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Gönder</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Al</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Göster / Gizle</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Ana pencereyi göster ya da gizle</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Cüzdanınıza ait özel anahtarları şifreleyin</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>İletileri adreslerin size ait olduğunu ispatlamak için Bitcoin adresleri ile imzala</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Belirtilen Bitcoin adresleri ile imzalandıklarından emin olmak için iletileri kontrol et</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Dosya</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Ayarlar</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Yardım</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Sekme araç çubuğu</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Ödeme talep et (QR kodu ve bitcoin URI'si oluşturur)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Kullanılmış gönderme adresleri ve etiketlerin listesini göster</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Kullanılmış alım adresleri ve etiketlerin listesini göster</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Bir bitcoin: bağlantısı ya da ödeme talebi aç</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Komut satırı seçenekleri</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>Bitcoin şebekesine %n faal bağlantı</numerusform><numerusform>Bitcoin ağına %n etkin bağlantı var</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Bloklar diske indeksleniyor...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Bloklar diske işleniyor...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Muamele tarihçesinden %n blok işlendi.</numerusform><numerusform>İşlem tarihçesinden %n blok işlendi</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 geride</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Son alınan blok %1 önce oluşturulmuştu.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Bundan sonraki işlemler henüz görüntülenemez.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hata</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Uyarı</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Bilgi</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Güncel</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Olası Bitcoin komut satırı seçeneklerinin listesini görmek için %1 yardım mesajını göster</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 istemci</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Eşlere bağlanılıyor...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Aralık kapatılıyor...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Tarih: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Tutar: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Tür: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Etiket: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Adres: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>İşlem gönderildi</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Gelen işlem</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD anahtar oluşturma &lt;b&gt;etkin&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD anahtar oluşturma &lt;b&gt;devre dışı&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Cüzdan &lt;b&gt;şifrelenmiştir&lt;/b&gt; ve şu anda &lt;b&gt;kilidi açıktır&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Cüzdan &lt;b&gt;şifrelenmiştir&lt;/b&gt; ve şu anda &lt;b&gt;kilitlidir&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Ölümcül bir hata oluştu. Bitcoin yazılımı artık güvenli bir şekilde çalışmaya devam edemediği için kapatılacaktır.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Bitcoin Seçimi</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Miktar:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bayt:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Tutar:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Ücret:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Toz:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Ücretten sonra:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Para üstü:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>tümünü seç(me)</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Ağaç kipi</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Liste kipi</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Tutar</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Şu etiketle alındı</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Şu adresle alındı</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Tarih</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Doğrulamalar</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Doğrulandı</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Adres kopyala</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etiket kopyala</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Tutarı kopyala</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>İşlem ID'sini kopyala</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Harcanmamışı kilitle</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Harcanmamışın kilidini aç</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Miktarı kopyala</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Ücreti kopyala</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Ücretten sonrasını kopyala</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Baytları kopyala</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Tozu kopyala</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Para üstünü kopyala</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 kilitlendi)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>evet</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>hayır</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Eğer herhangi bir alıcı mevcut toz eşiğinden daha düşük bir tutar alırsa bu etiket kırmızıya dönüşür.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Girdi başına +/- %1 satoshi değişebilir.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(etiket yok)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>%1 ögesinden para üstü (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(para üstü)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Adresi düzenle</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Etiket</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Bu adres listesi girdisi ile ilişkili etiket</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Bu adres listesi girdisi ile ilişkili adres. Sadece gönderme adresleri için değiştirilebilir.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Adres</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Yeni alım adresi</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Yeni gönderi adresi</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Alım adresini düzenle</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Gönderi adresini düzenle</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Girilen \"%1\" adresi geçerli bir Bitcoin adresi değildir.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Girilen \"%1\" adresi zaten adres defterinde mevcuttur.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Cüzdan kilidi açılamadı.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Yeni anahtar oluşturulması başarısız oldu.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Yeni bir veri klasörü oluşturulacaktır.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>isim</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Klasör zaten mevcuttur. Burada yeni bir klasör oluşturmak istiyorsanız, %1 ekleyiniz.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Erişim yolu zaten mevcuttur ve klasör değildir.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Burada veri klasörü oluşturulamaz.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>sürüm</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>%1 Hakkında</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Komut satırı seçenekleri</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Kullanım:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>komut satırı seçenekleri</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Arayüz Seçenekleri:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Başlangıçta veri klasörü seç (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Lisan belirt, mesela \"de_De\" (varsayılan: sistem dili)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Küçültülmüş olarak başlat</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Ödeme talebi için SSL kök sertifikalarını belirle (varsayılan: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Başlatıldığında başlangıç ekranını göster (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Grafik arayüzde yapılan tüm seçenek değişikliklerini sıfırla</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Hoş geldiniz</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>%1'a hoş geldiniz.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Bu programın ilk kez başlatılmasından dolayı %1 yazılımının verilerini nerede saklayacağını seçebilirsiniz.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Blok zinciri saklamayı sınırlamayı seçtiyseniz (budama), geçmiş veriler yine de indirilmeli ve işlenmelidir, ancak disk kullanımınızı düşük tutmak için daha sonra silinmelidir.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Varsayılan veri klasörünü kullan</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Özel bir veri klasörü kullan:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Yaklaşık %1 GB veri bu dizinde depolanacak.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Cüzdan da bu dizinde depolanacaktır.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Hata: belirtilen \"%1\" veri klasörü oluşturulamaz.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hata</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB boş alan mevcuttur</numerusform><numerusform>%n GB boş alan mevcuttur</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(gereken %n GB alandan)</numerusform><numerusform>(gereken %n GB alandan)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Son işlemler henüz görünmeyebilir ve bu nedenle cüzdanınızın bakiyesi yanlış olabilir. Bu bilgiler, aşağıda detaylandırıldığı gibi, cüzdanınız bitcoin ağı ile senkronizasyonunu tamamladığında doğru olacaktır. </translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Henüz görüntülenmeyen işlemlerden etkilenen bitcoinleri harcama girişiminde bulunmak ağ tarafından kabul edilmeyecektir.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Kalan blok sayısı</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Bilinmiyor...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Son blok zamanı</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>İlerleme</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Saat başı ilerleme artışı</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>hesaplanıyor...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Senkronize edilene kadar kalan tahmini süre</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Gizle</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Bilinmeyen. Üstbilgiler Senkronize Ediliyor (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>URI Aç</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Dosyadan veya URI'den ödeme talebi aç</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Ödeme talebi dosyasını seç</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Açılacak ödeme talebi dosyasını seç</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Seçenekler</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Genel</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Sistemde oturum açıldığında %1 programını otomatik olarak başlat.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Açılışta %1 açılsın</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>&amp;Veritabanı önbelleğinin boyutu</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>İş parçacıklarını &amp;denetleme betiği sayısı</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Vekil sunucusunun IP adresi (mesela IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Bu şebeke türü yoluyla eşlere bağlanmak için belirtilen varsayılan SOCKS5 vekil sunucusunun kullanılıp kullanılmadığını gösterir.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Tor gizli servisleri aracılığıyla eşlere ulaşmak için ayrı SOCKS&amp;5 proksi kullanın:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Simgeyi sistem tepsisinden gizleyin.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Simgeyi gizle</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Pencere kapatıldığında uygulamadan çıkmak yerine uygulamayı küçültür. Bu seçenek etkinleştirildiğinde, uygulama sadece menüden çıkış seçildiğinde kapanacaktır.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>İşlemler sekmesinde bağlam menüsü unsurları olarak görünen üçüncü taraf bağlantıları (mesela bir blok tarayıcısı). URL'deki %s, işlem hash değeri ile değiştirilecektir. Birden çok bağlantılar düşey çubuklar | ile ayrılacaktır.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Yukarıdaki seçeneklerin yerine geçen etkin komut satırı seçenekleri:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Çalışma dizininden %1  yapılandırma dosyasını aç.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Yapılandırma Dosyasını Aç</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>İstemcinin tüm seçeneklerini varsayılan değerlere geri al.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>Seçenekleri &amp;Sıfırla</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Ağ</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = otomatik, &lt;0 = bu kadar çekirdeği kullanma)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>&amp;Cüzdan</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Gelişmiş</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Para &amp;kontrolü özelliklerini etkinleştir</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Doğrulanmamış para üstünü harcamayı devre dışı bırakırsanız, bir işlemin para üstü bu işlem için en az bir doğrulama olana dek harcanamaz. Bu, aynı zamanda bakiyenizin nasıl hesaplandığını da etkiler.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>Doğrulanmamış para üstünü &amp;harca</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Yönlendiricide Bitcoin istemci portlarını otomatik olarak açar. Bu, sadece yönlendiricinizin UPnP desteği bulunuyorsa ve etkinse çalışabilir.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Portları &amp;UPnP kullanarak haritala</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Dışarıdan bağlantıları kabul et.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Gelen bağlantılara izin ver</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Bitcoin ağına bir SOCKS5 vekil sunucusu aracılığıyla bağlan.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>SOCKS5 vekil sunucusu aracılığıyla &amp;bağlan (varsayılan vekil sunucusu):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Vekil &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Vekil sunucunun portu (mesela 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Eşlere ulaşmak için kullanılır, şu üzerinden:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Bitcoin ağına gizli Tor servisleri için ayrı bir SOCKS5 vekil sunucusu aracılığıyla bağlan.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Pencere</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Küçültüldükten sonra sadece tepsi simgesi göster.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>İşlem çubuğu yerine sistem çekmecesine &amp;küçült</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>Kapatma sırasında k&amp;üçült</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Görünüm</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Kullanıcı arayüzü &amp;lisanı:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Kullanıcı arayüzünün dili burada belirtilebilir. Bu ayar %1 tekrar başlatıldığında etkinleşecektir.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>Tutarı göstermek için &amp;birim:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Bitcoin gönderildiğinde arayüzde gösterilecek varsayılan alt birimi seçiniz.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Para kontrol özelliklerinin gösterilip gösterilmeyeceğini ayarlar.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;Üçüncü parti işlem URL'leri</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Tamam</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;İptal</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>varsayılan</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>boş</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Seçeneklerin sıfırlanmasını teyit et</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Değişikliklerin uygulanması için istemcinin yeniden başlatılması lazımdır.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>İstemci kapanacaktır. Devam etmek istiyor musunuz?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Yapılandırma seçenekleri</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Yapılandırma dosyası, grafik arayüzü ayarlarını geçersiz kılacak gelişmiş kullanıcı seçeneklerini belirtmek için kullanılır. Ayrıca, herhangi bir komut satırı seçeneği bu yapılandırma dosyasını geçersiz kılacaktır.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hata</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Yapılandırma dosyası açılamadı.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Bu değişiklik istemcinin tekrar başlatılmasını gerektirir.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Girilen vekil sunucu adresi geçersizdir.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Görüntülenen bilgiler güncel olmayabilir. Bağlantı kurulduğunda cüzdanınız otomatik olarak Bitcoin ağı ile senkronize olur ancak bu işlem henüz tamamlanmamıştır.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Sadece-izlenen:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Mevcut:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Güncel harcanabilir bakiyeniz</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Beklemede:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Henüz doğrulanmamış ve harcanabilir bakiyeye eklenmemiş işlemlerin toplamı</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Olgunlaşmamış:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Oluşturulan bakiye henüz olgunlaşmamıştır</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Bakiyeler</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Toplam:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Güncel toplam bakiyeniz</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Sadece izlenen adreslerdeki güncel bakiyeniz</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Harcanabilir:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Son işlemler</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Sadece izlenen adreslere gelen doğrulanmamış işlemler</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Sadece izlenen adreslerin henüz olgunlaşmamış oluşturulan bakiyeleri</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Sadece izlenen adreslerdeki güncel toplam bakiye</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Ödeme talebi hatası</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Bitcoin başlatılamadı: tıkla-ve-öde yöneticisi</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI yönetimi</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Ödeme talebini alma URL'i geçersiz: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>%1 ödeme adresi geçersizdir</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI ayrıştırılamıyor! Bunun nedeni geçersiz bir Bitcoin adresi veya hatalı biçimlendirilmiş URI değişkenleri olabilir.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Ödeme talebi dosyası yönetimi</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Ödeme talebi dosyası okunamıyor! Bunun nedeni geçersiz bir ödeme talebi dosyası olabilir.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Ödeme talebi reddedildi</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Ödeme talebi ağı, istemci ağıyla eşleşmiyor.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Ödeme talebinin geçerlilik süresi bitti.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Ödeme talebi başlatılmadı.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Özel ödeme betiklerine, doğrulanmamış ödeme talepleri desteklenmez.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Geçersiz ödeme talebi.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Talep edilen %1 ödeme tutarı çok küçüktür (toz olarak kabul edilir).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>%1 adresinden geri ödeme</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>%1 ödeme talebi çok büyük (%2 bayt, üst sınır %3 bayt).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>%1 ile iletişimde hata: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Ödeme talebi ayrıştırılamaz!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>%1 sunucusundan hatalı yanıt</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Ağ talebi hatası</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Ödeme kabul edildi</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Kullanıcı Yazılımı</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Düğüm/Servis</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Düğüm ID'si</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Yollanan</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Alınan</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Tutar</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Bir Bitcoin adresi giriniz (mesela %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 g</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 s</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Boş</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Mevcut değil</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n saniye</numerusform><numerusform>%n saniye</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n dakika</numerusform><numerusform>%n dakika</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n saat</numerusform><numerusform>%n saat</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n gün</numerusform><numerusform>%n gün</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n hafta</numerusform><numerusform>%n hafta</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 ve %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n yıl</numerusform><numerusform>%n yıl</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1  henüz güvenli bir şekilde çıkış yapmamıştır...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>bilinmiyor</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Hata: Belirtilen \"%1\" veri klasörü yoktur.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Hata: %1 yapılandırma dosyası ayrıştırılamadı. Sadece anahtar=değer dizimini kullanınız.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Hata: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Resmi ka&amp;ydet...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>Resmi &amp;Kopyala</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>QR Kodu Kaydet</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG Resim (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Mevcut değil</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>İstemci sürümü</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Bilgi</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Hata ayıklama penceresi</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Genel</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Kullanılan BerkeleyDB sürümü</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Veri konumu</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Başlama zamanı</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Ağ</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>İsim</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Bağlantı sayısı</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blok zinciri</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Güncel blok sayısı</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Bellek Alanı</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Güncel işlem sayısı</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Bellek kullanımı</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Sıfırla</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Alınan</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Yollanan</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Eşler</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Yasaklı eşler</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Ayrıntılı bilgi görmek için bir eş seçin.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Beyaz listedekiler</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Yön</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Sürüm</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Başlangıç Bloku</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Eşleşmiş Üstbilgiler</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Eşleşmiş Bloklar</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Kullanıcı Yazılımı</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Güncel veri klasöründen %1 hata ayıklama kütük dosyasını açar. Büyük kütük dosyaları için bu birkaç saniye alabilir.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Font boyutunu küçült</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Yazıtipi boyutunu büyült</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Servisler</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Yasaklama Skoru</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Bağlantı Süresi</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Son Gönderme</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Son Alma</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping Süresi</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Güncel olarak göze çarpan bir ping'in süresi.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping Beklemesi</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>En Düşük Ping</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Saat Farkı</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Son blok zamanı</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Aç</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsol</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Ağ trafiği</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Toplamlar</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>İçeri:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Dışarı:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Hata ayıklama kütük dosyası</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Konsolu temizle</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;saat</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;gün</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;hafta</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;yıl</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Bağlantıyı Kes</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Yasakla</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Yasaklamayı Kaldır</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>%1 RPC konsoluna hoş geldiniz.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Geçmişte gezinmek için yukarı ve aşağı oklarını kullanın ve ekranı temizlemek için %1 kullanın.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Mevcut komutlara göz atmak için %1 yazın.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Bu konsolun kullanımı hakkında daha fazla bilgi için %1 yazın.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>UYARI: Bitcoin dolandırıcılarının çok fazla etkin olduğu zamanlarda, dolandırıcılar bazı kullanıcılara buraya komutlar yazmalarını söylerek onların cüzdanlarındaki bitcoinleri çalmışlardır. Bir komutun sonuçlarını tam olarak anlamadan bu konsolu kullanmayın.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Ağ etkinliği devre dışı bırakıldı</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(düğüm kimliği: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>%1 vasıtasıyla</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>asla</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Gelen</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Giden</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Evet</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Hayır</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Bilinmiyor</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Tutar:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiket:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;İleti:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Talep açıldığında gösterilecek, isteğinize dayalı, ödeme talebi ile ilişkilendirilecek bir ileti. Not: Bu ileti ödeme ile birlikte Bitcoin ağı üzerinden gönderilmeyecektir.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Yeni alım adresi ile ilişkili, seçiminize dayalı etiket.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Ödeme talep etmek için bu formu kullanın. Tüm alanlar &lt;b&gt;seçime dayalıdır&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Seçiminize dayalı talep edilecek tutar. Belli bir tutar talep etmemek için bunu boş bırakın veya sıfır değerini kullanın.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Formdaki tüm alanları temizle.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Temizle</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Talep edilen ödemelerin tarihçesi</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>Ödeme &amp;talep et</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Seçilen talebi göster (bir unsura çift tıklamakla aynı anlama gelir)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Göster</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Seçilen unsurları listeden kaldır</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Kaldır</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>URI'yi kopyala</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etiket kopyala</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>İletiyi kopyala</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Tutarı kopyala</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Kodu</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>&amp;URI'yi kopyala</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Adresi kopyala</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Resmi ka&amp;ydet...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>%1 unsuruna ödeme talep et</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Ödeme bilgisi</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Tutar</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>İleti</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Sonuç URI çok uzun, etiket ya da ileti metnini kısaltmayı deneyiniz.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>URI'nin QR koduna kodlanmasında hata oluştu.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Tarih</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>İleti</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(etiket yok)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(ileti yok)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(tutar talep edilmedi)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Talep edilen</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Bitcoin yolla</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Para kontrolü özellikleri</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Girdiler...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>otomatik seçilmiş</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Yetersiz fon!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Miktar:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bayt:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Tutar:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Ücret:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Ücretten sonra:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Para üstü:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Bu etkinleştirildiyse fakat para üstü adresi boş ya da geçersizse para üstü yeni oluşturulan bir adrese gönderilecektir.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Özel para üstü adresi</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>İşlem ücreti:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Seç...</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Uyarı: Ücret tahmini şu anda mümkün değildir.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>ücret-ayarlarını-küçült</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>kilobayt başı</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Eğer özel ücret 1000 satoşi olarak ayarlandıysa ve işlem sadece 250 baytsa, \"kilobayt başı\" ücret olarak sadece 250 satoşi öder ve \"toplam asgari\" 1000 satoşi öder. Bir kilobayttan yüksek işlemler için ikisi de kilobayt başı ödeme yapar.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Gizle</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Gerekli olan en az ücreti ödemek, bloklarda boşluktan daha az işlem hacmi olduğu sürece bir sorun çıkarmaz. Fakat ağın işleyecebileceğinden daha çok bitcoin işlemi talebi olduğunda bunun asla doğrulanmayan bir işlem olabileceğinin farkında olmalısınız.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(bilgi balonunu oku)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Tavsiye edilen:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Özel:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Zeki ücret henüz başlatılmadı. Bu genelde birkaç blok alır...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Birçok alıcıya aynı anda gönder</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>&amp;Alıcı ekle</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Formdaki tüm alanları temizle.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Toz:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Doğrulama süresi hedefi:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Tümünü &amp;temizle</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Bakiye:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Yollama etkinliğini teyit ediniz</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>G&amp;önder</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Miktarı kopyala</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Tutarı kopyala</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Ücreti kopyala</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Ücretten sonrasını kopyala</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Baytları kopyala</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Tozu kopyala</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Para üstünü kopyala</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1(%2 blok)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 ögesinden %2 unsuruna</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Göndermek istediğinizden emin misiniz?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>işlem ücreti olarak eklendi</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Toplam Tutar %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>veya</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Bitcoin gönderimini onaylayın</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Alıcı adresi geçerli değildir. Lütfen tekrar kontrol ediniz.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Ödeyeceğiniz tutarın 0'dan yüksek olması gerekir.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Tutar bakiyenizden yüksektir.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Toplam, %1 işlem ücreti eklendiğinde bakiyenizi geçmektedir.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Tekrarlayan adres bulundu: adresler sadece bir kez kullanılmalıdır.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>İşlem oluşturma başarısız!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>İşlem şu nedenden dolayı reddedildi: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>%1 tutarından yüksek bir ücret saçma derecede yüksek bir ücret olarak kabul edilir.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Ödeme talebinin geçerlilik süresi bitti.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Sadece asgari ücret olan %1 tutarını öde</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Uyarı: geçersiz Bitcoin adresi</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Uyarı: Bilinmeyen para üstü adresi</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Özel para üstü adresini onayla</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Para üstü için seçtiğiniz adres bu cüzdanın bir parçası değil. Cüzdanınızdaki bir miktar veya tüm para bu adrese gönderilebilir. Emin misiniz?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(etiket yok)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>T&amp;utar:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Şu adrese öde:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiket:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Önceden kullanılmış adres seç</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Bu, normal bir ödemedir.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Ödemenin yollanacağı Bitcoin adresi</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Panodan adres yapıştır</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Bu ögeyi kaldır</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Ücret yollanan tutardan alınacaktır. Alıcı tutar alanına girdiğinizden daha az bitcoin alacaktır. Eğer birden çok alıcı seçiliyse ücret eşit olarak bölünecektir.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>Ücreti tutardan düş</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Mevcut bakiyeyi kullan</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>İleti:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Bu, kimliği doğrulanmamış bir ödeme talebidir.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Bu, kimliği doğrulanmış bir ödeme talebidir.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Kullanılmış adres listesine eklemek için bu adrese bir etiket girin</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Referans için bitcoin: URI'siyle iliştirilmiş işlemle birlikte depolanacak bir ileti. Not: Bu mesaj Bitcoin ağı üzerinden gönderilmeyecektir.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Şu adrese öde:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Not:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Adres defterinize eklemek için bu adrese bir etiket giriniz</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Evet</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 kapanıyor...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Bu pencere kalkıncaya dek bilgisayarı kapatmayınız.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>İmzalar - İleti İmzala / Kontrol et</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>İleti &amp;imzala</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Adreslerinize yollanan bitcoinleri alabileceğiniz ispatlamak için adreslerinizle iletiler/anlaşmalar imzalayabilirsiniz. Oltalama saldırılarının kimliğinizi imzanızla elde etmeyi deneyebilecekleri için belirsiz ya da rastgele hiçbir şey imzalamamaya dikkat ediniz. Sadece ayrıntılı açıklaması olan ve tümüne katıldığınız ifadeleri imzalayınız.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>İletinin imzalanmasında kullanılacak Bitcoin adresi</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Önceden kullanılmış adres seç</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Panodan adres yapıştır</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>İmzalamak istediğiniz iletiyi burada giriniz</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>İmza</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Güncel imzayı sistem panosuna kopyala</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Bu Bitcoin adresinin sizin olduğunu ispatlamak için iletiyi imzalayın</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>&amp;İletiyi imzala</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Tüm ileti alanlarını sıfırla</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Tümünü &amp;temizle</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>İletiyi &amp;kontrol et</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Alıcının adresini, iletiyi (satır sonları, boşluklar, sekmeler vs. karakterleri tam olarak kopyaladığınızdan emin olunuz) ve imzayı aşağıya giriniz. Bir ortadaki adam saldırısı tarafından kandırılmaya engel olmak için imzadan, imzalı iletinin içeriğini aşan bir anlam çıkarmamaya dikkat ediniz. Bunun sadece imzalayan tarafın adres ile alım yapabildiğini ispatladığını ve herhangi bir işlemin gönderi tarafını kanıtlayamayacağını unutmayınız!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>İletinin imzalanmasında kullanılan Bitcoin adresi</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Belirtilen Bitcoin adresi ile imzalandığını doğrulamak için iletiyi kontrol et</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>&amp;İletiyi kontrol et</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Tüm ileti kontrolü alanlarını sıfırla</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>İmzayı oluşturmak için \"İletiyi İmzala\"ya tıklayın</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Girilen adres geçersizdir.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Lütfen adresi kontrol edip tekrar deneyiniz.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Girilen adres herhangi bir anahtara işaret etmemektedir.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Cüzdan kilidinin açılması iptal edildi.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Girilen adres için özel anahtar mevcut değildir.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>İleti imzalaması başarısız oldu.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>İleti imzalandı.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>İmzanın kodu çözülemedi.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Lütfen imzayı kontrol edip tekrar deneyiniz.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>İmza iletinin özeti ile eşleşmedi.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>İleti doğrulaması başarısız oldu.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>İleti doğrulandı.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>%n taneden daha fazla blok için açık</numerusform><numerusform>%n taneden daha fazla blok için açık</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>%1 değerine dek açık</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>%1 doğrulamalı bir işlem ile çelişti</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/çevrim dışı</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/doğrulanmamış, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>bellek alanında</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>bellek alanında değil</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>terk edilmiş</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/doğrulanmadı</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 doğrulama</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Durum</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, henüz başarılı bir şekilde yayınlanmadı</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, %n düğüm aracılığıyla yayınlandı</numerusform><numerusform>, %n düğüm aracılığıyla yayınlandı</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Tarih</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Kaynak</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Oluşturuldu</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Gönderen</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>bilinmiyor</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Alıcı</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>kendi adresiniz</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>sadece-izlenen</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiket</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Alınan Tutar</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>%n ek blok sonrasında olgunlaşacak</numerusform><numerusform>%n ek blok sonrasında olgunlaşacak</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>kabul edilmedi</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Çekilen Tutar</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Toplam çekilen tutar</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Toplam alınan tutar</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>İşlem ücreti</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Net tutar</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>İleti</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Yorum</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>İşlem ID'si</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>İşlemin toplam boyutu</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Çıktı indeksi</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Tüccar</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Oluşturulan bitcoin'lerin harcanabilmelerinden önce %1 blok beklemeleri gerekmektedir. Bu blok, oluşturduğunuzda, blok zincirine eklenmesi için ağda yayınlandı. Zincire eklenmesi başarısız olursa, durumu \"kabul edilmedi\" olarak değiştirilecek ve harcanamayacaktır. Bu, bazen başka bir düğüm sizden birkaç saniye önce ya da sonra blok oluşturursa meydana gelebilir.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Hata ayıklama bilgisi</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>İşlem</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Girdiler</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Tutar</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>doğru</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>yanlış</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Bu pano işlemin ayrıntılı açıklamasını gösterir</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>%1 için ayrıntılar</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Tarih</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tür</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>%n taneden daha fazla blok için açık</numerusform><numerusform>%n taneden daha fazla blok için açık</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>%1 değerine dek açık</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Çevrim dışı</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Doğrulanmamış</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Terk edilmiş</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Doğrulanıyor (%1 kere doğrulandı, önerilen doğrulama sayısı %2)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Doğrulandı (%1 doğrulama)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Uyuşmadı</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Olgunlaşmamış (%1 doğrulama, %2 doğrulama sonra kullanılabilir olacaktır)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Bu blok başka hiçbir düğüm tarafından alınmamıştır ve muhtemelen kabul edilmeyecektir!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Oluşturuldu ama kabul edilmedi</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Şununla alındı</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Alındığı kişi</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Gönderildiği adres</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Kendinize ödeme</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Madenden çıkarılan</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>sadece-izlenen</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(mevcut değil)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(etiket yok)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>İşlem durumu. Doğrulama sayısını görüntülemek için fare imlecini bu alanın üzerinde tutunuz.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>İşlemin alındığı tarih ve zaman.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>İşlemin türü.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Bu işleme sadece-izlenen bir adresin dahil edilip, edilmediği.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>İşlemin kullanıcı tanımlı amacı.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Bakiyeden kaldırılan ya da bakiyeye eklenen tutar.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Hepsi</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Bugün</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Bu hafta</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Bu ay</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Geçen ay</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Bu yıl</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Tarih Aralığı</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Şununla alındı</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Gönderildiği adres</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Kendinize</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Madenden çıkarılan</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Diğer</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Aramak için adres, gönderim numarası ya da etiket yazınız</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>En düşük tutar</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>İşlemden vazgeç</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>İşlem ücretini artır</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Adres kopyala</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etiket kopyala</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Tutarı kopyala</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>İşlem ID'sini kopyala</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Ham işlemi kopyala</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Tüm işlem ayrıntılarını kopyala</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Etiketi düzenle</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>İşlem ayrıntılarını göster</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>İşlem Tarihçesini Dışarı Aktar</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Virgülle ayrılmış değerler dosyası (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Doğrulandı</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Sadece izlenen</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Tarih</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tür</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Dışarı aktarmada hata</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>İşlem tarihçesinin %1 konumuna kaydedilmeye çalışıldığı sırada bir hata meydana geldi.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Dışarı Aktarma Başarılı</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>İşlem tarihçesi %1 konumuna başarıyla kaydedildi.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Tarih Aralığı:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>Alıcı</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Tutarı göstermek için birim. Başka bir birim seçmek için tıklayınız.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Hiçbir cüzdan yüklenmedi.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Bitcoini Gönder</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>İşlem ücreti artırma başarısız oldu</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Ücreti artırmak istiyor musunuz?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Şimdiki ücret:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Artış:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Yeni ücret:</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>İşlem imzalanamıyor.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Alışveriş taahüt edilemedi.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Dışarı aktar</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Mevcut sekmedeki verileri bir dosyaya aktar</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Cüzdanı Yedekle</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Cüzdan Verileri (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Yedekleme Başarısız Oldu</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Cüzdan verilerinin %1 konumuna kaydedilmesi sırasında bir hata meydana geldi.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Yedekleme Başarılı</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Cüzdan verileri %1 konumuna başarıyla kaydedildi.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Seçenekler:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Veri dizinini belirt</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Eş adresleri elde etmek için bir düğüme bağlan ve ardından bağlantıyı kes</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Kendi genel adresinizi tanımlayın</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Komut satırı ve JSON-RPC komutlarını kabul et</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>MIT yazılım lisansı altında dağıtılmıştır, beraberindeki %s ya da %s dosyasına bakınız.</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Eğer &lt;category&gt; belirtilmemişse ya da &lt;category&gt; = 1 ise, tüm hata ayıklama verilerini çıktı al.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Budama, en düşük değer olan %d MiB'den düşük olarak ayarlanmıştır. Lütfen daha yüksek bir sayı kullanınız.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Budama: son cüzdan eşleşmesi budanmış verilerin ötesine gitmektedir. -reindex kullanmanız gerekmektedir (Budanmış düğüm ise tüm blok zincirini tekrar indirmeniz gerekir.)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Tekrar taramalar budanmış kipte mümkün değildir. Tüm blok zincirini tekrar indirecek olan -reindex seçeneğini kullanmanız gerekecektir.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Hata: Ölümcül dahili bir hata meydana geldi, ayrıntılar için debug.log dosyasına bakınız</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Yolladığınız işlemlere eklenecek ücret (%s/kB olarak) (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Blockstore budanıyor...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Arka planda daemon (servis) olarak çalış ve komutları kabul et</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>HTTP sunucusu başlatılamadı. Ayrıntılar için debug.log dosyasına bakınız.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Çekirdeği</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>%s geliştiricileri</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Ücret tahmini için yetersiz veri bulunduğunda kullanılacak ücret oranı (%s/kB olarak) (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>İşlemler aktarılmadığında dahi beyaz listedeki eşlerden aktarılan işlemleri kabul et (varsayılan: %d)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Belirtilen adrese bağlan ve daima ondan dinle. IPv6 için [makine]:port yazımını kullanınız</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>%s veri dizininde kilit elde edilemedi. %s muhtemelen hâlihazırda çalışmaktadır.</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Tüm cüzdan işlemlerini sil ve başlangıçta -rescan ile sadece blok zincirinin parçası olanları geri getir</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>%s dosyasının okunması sırasında bir hata meydana geldi! Tüm anahtarlar doğru bir şekilde okundu, ancak işlem verileri ya da adres defteri ögeleri hatalı veya eksik olabilir.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Bir cüzdan işlemi değiştiğinde komutu çalıştır (komuttaki %s işlem kimliği ile değiştirilecektir)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Daha küçük boyutlu blok yeniden yapılandırması için fazladan işlemleri bellekte tut. (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Eğer bu blok zincirde yer alıyorsa onun ve atalarının geçerli olduğunu varsay ve potansiyel olarak onların betik doğrulamasını atla.  (Tümünü doğrulamak için 0, varsayılan %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>İzin verilen edilen en yüksek medyan eş zamanı değişiklik sınırının ayarlaması. Zamanın yerel perspektifi bu miktar kadar ileri ya da geri eşler tarafından etkilenebilir. (Varsayılan %u saniye)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Tek bir cüzdan işleminde ya da ham işlemde kullanılacak en yüksek toplam ücret (%s olarak); bunu çok düşük olarak ayarlamak büyük işlemleri iptal edebilir (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Lütfen bilgisayarınızın saat ve tarihinin doğru olduğunu kontrol ediniz! Saatinizde gecikme varsa %s doğru şekilde çalışamaz.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>%s programını faydalı buluyorsanız lütfen katkıda bulununuz. Yazılım hakkında daha fazla bilgi için %s adresini ziyaret ediniz.</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Eski blokları budamayı (silme) etkinleştirerek depolama gereksinimlerini azaltın. Bu belirli blokları silmek için pruneblockchain uzak yordam çağrısına (RPC) izin verir. Eğer bloklar hedef mebibyte boyutuna ulaşırsa eski blokların otomatik olarak budanmasını sağlar. Bu kip, -txindex ve -rescan ile uyumsuzdur. Uyarı: Bu ayarı geri almak, blok zincirinin tamamını yeniden yüklemeyi gerektirir. (varsayılan: 0 = blok budaması devre dışı, 1 = RPC üzerinden manuel budamaya izin verir, &gt;%u = mebibyte olarak belirtilen hedef boyutun altında kalması için blok dosyalarını otomatik olarak budar)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Blok oluşturmaya dahil olan işlemler için en düşük ücret oranını (%s/kB olarak) ayarla. (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Betik kontrolü iş parçacıklarının sayısını belirler (%u ilâ %d, 0 = otomatik, &lt;0 = bu sayıda çekirdeği kullanma, varsayılan: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Blok veritabanı gelecekten gibi görünen bir blok içermektedir. Bu, bilgisayarınızın saat ve tarihinin yanlış ayarlanmış olmasından kaynaklanabilir. Blok veritabanını sadece bilgisayarınızın tarih ve saatinin doğru olduğundan eminseniz yeniden derleyin.</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Bu kararlı sürümden önceki bir deneme sürümüdür. - risklerini bilerek kullanma sorumluluğu sizdedir - bitcoin oluşturmak ya da ticari uygulamalar için kullanmayınız</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Veritabanını çatallama öncesi duruma geri sarmak mümkün değil. Blok zincirini tekrar indirmeniz gerekmektedir</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Dinlenecek portu haritalamak için UPnP kullan (varsayılan: dinlenildiğinde ve -proxy olmadığında 1)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>JSON-RPC bağlantıları için kullanıcı adı ve karmalanmış parola. &lt;userpw&gt; alanı şu biçimdedir: &lt;KULLANICI ADI&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Kanonik bir Python betiği share/rpcuser klasöründe bulunabilir. Ardından istemci normal şekilde rpcuser=&lt;KULLANICI ADI&gt;/rpcpassword=&lt;PAROLA&gt; argüman çiftini kullanarak bağlanabilir. Bu seçenek birden çok kez belirtilebilir.</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Cüzdan, zincir bellek alanı limitlerini ihlal eden işlem oluşturmayacak. (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Uyarı: Ağ üyeleri aralarında tamamen anlaşmış gibi gözükmüyor! Bazı madenciler sorun yaşıyor gibi görünmektedir.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Uyarı: Ağ eşlerimizle tamamen anlaşamamışız gibi görünüyor! Güncelleme yapmanız gerekebilir ya da diğer düğümlerin güncelleme yapmaları gerekebilir.</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>son 100 bloğun %d kadarı beklenmeyen versiyona sahip</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s bozuk, geri kazanım başarısız oldu</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool en az %d MB olmalıdır</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;kategori&gt; şunlar olabilir:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Dışarıdan gelen bağlantıları kabul et (varsayılan: -proxy veya -connect yoksa 1)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Kullanıcı aracı zincirine yorumu ekle</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Başlangıçta bozuk bir cüzdandan özel anahtarları geri kazanmayı dene</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Blok oluşturma seçenekleri:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Çözümlenemedi - %s adres: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Blok zinciri seçim ayarları:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Aralık dışında değişiklik indeksi</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Bağlantı seçenekleri:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Telif hakkı (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Bozuk blok veritabanı tespit edildi</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Hata ayıklama/deneme seçenekleri:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Cüzdanı yükleme ve cüzdan RPC çağrılarını devre dışı bırak</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Blok veritabanını şimdi yeniden inşa etmek istiyor musunuz?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Blok karma değerinin &lt;adres&gt;te yayınlanmasını etkinleştir</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Karma değer işleminin &lt;adres&gt;te yayınlanmasını etkinleştir</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Ham blokun &lt;adres&gt;te yayınlanmasını etkinleştir</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Ham işlemin &lt;adres&gt;te yayınlanmasını etkinleştir</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Bellek alanında işlem değiştirmeyi etkinleştir (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Blok veritabanını başlatılırken bir hata meydana geldi</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>%s cüzdan veritabanı ortamının başlatılmasında hata meydana geldi!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>%s unsurunun yüklenmesinde hata oluştu</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>%s unsurunun yüklenmesinde hata oluştu: bozuk cüzdan</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>%s unsurunun yüklenmesinde hata oluştu: cüzdan %s programının yeni bir sürümüne ihtiyaç duyuyor</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Blok veritabanının yüklenmesinde hata</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Blok veritabanının açılışı sırasında hata</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Hata: Disk alanı düşük!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Herhangi bir portun dinlenmesi başarısız oldu. Bunu istiyorsanız -listen=0 seçeneğini kullanınız.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Başlatma sırasında cüzdanı yeniden tarama işlemi başarısız oldu</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>İçe aktarılıyor...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Yanlış ya da bulunamamış doğuş bloğu. Ağ için yanlış veri klasörü mü?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Başlatma sınaması başarısız oldu. %s kapatılıyor.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>-%s=&lt;tutar&gt; için geçersiz tutar: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Geçersiz miktarda -discardfee=&lt;amount&gt;:'%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation> -fallbackfee=&lt;tutar&gt; için geçersiz tutar: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>İşlem bellek alanını &lt;n&gt; megabayttan düşük tut (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>P2P adresleri yükleniyor...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Yasaklama listesi yükleniyor...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>auth çerezinin konumu (varsayılan: veri klasörü)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Kafi derecede dosya tanımlayıcıları mevcut değil.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Sadece &lt;net&gt; ağındaki düğümlere bağlan (ipv4, ipv6 veya onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Bu yardım mesajını yaz ve çık</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Sürümü yaz ve çık</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Budama negatif bir değerle yapılandırılamaz.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Budama kipi -txindex ile uyumsuzdur.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Zincir durumu ve blok indeksini diskteki blk*.dat dosyalarından yeniden derle</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Zincir durumunu güncel olarak indekslenen bloklardan yeniden derle</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Bloklar tekrar işleniyor...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Bloklar geri sarılıyor...</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Veritabanı önbellek boyutunu megabayt olarak belirt (%d ilâ %d, varsayılan: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Cüzdan dosyası belirtiniz (veri klasörünün içinde)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Kaynak kod şuradan elde edilebilir: %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>İşlem ücreti ve para üstü hesaplamasında hata meydana geldi.</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Bu bilgisayarda %s unsuruna bağlanılamadı. %s muhtemelen hâlihazırda çalışmaktadır.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Desteklenmeyen -benchmark argümanı görmezden gelindi, -debug=bench kullanınız.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Desteklenmeyen -debugnet argümanı görmezden gelindi, debug=net kullanınız.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Deskteklenmeyen -tor argümanı bulundu, -onion kullanınız.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Desteklenmeyen günlük kategorisi %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>UTXO veritabanı yükseltiliyor</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Dinleme portunu haritalamak için UPnP kullan (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Test blok zincirini kullan</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Kullanıcı Aracı açıklaması (%s) güvensiz karakterler içermektedir.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Bloklar kontrol ediliyor...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Cüzdan hata ayıklama/test etme seçenekleri:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Cüzdanın tekrar yazılması gerekiyordu: işlemi tamamlamak için %s programını yeniden başlatınız</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Cüzdan seçenekleri:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Belirtilen kaynaktan JSON-RPC bağlantılarını kabul et. Bir &lt;ip&gt; için geçerli olanlar şunlardır: IP adresi (mesela 1.2.3.4), bir ağ/ağ maskesi (örneğin 1.2.3.4/255.255.255.0) ya da bir ağ/CIDR (mesela 1.2.3.4/24). Bu seçenek birden fazla kez belirtilebilir</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Belirtilen adrese bağlan ve ona bağlanan eşleri beyaz listeye al. IPv6 için [makine]:port imlasını kullanınız</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Yeni dosyaları umask 077 yerine varsayılan izinlerle oluştur (sadece devre dışı cüzdan işlevselliği ile etkilidir)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Kendi IP adreslerini keşfet (varsayılan: dinlenildiğinde ve -externalip ya da -proxy yoksa 1)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Hata: İçeri gelen bağlantıların dinlenmesi başarısız oldu (dinleme %s hatasını verdi)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>İlgili bir uyarı alındığında ya da gerçekten uzun bir çatallama gördüğümüzde komutu çalıştır (komuttaki %s mesaj ile değiştirilir)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Bundan düşük ücretler (%s/kB olarak) aktarma, oluşturma ve işlem yaratma için sıfır değerinde ücret olarak kabul edilir (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Eğer paytxfee ayarlanmadıysa kafi derecede ücret ekleyin ki işlemler teyite vasati n blok içinde başlasın (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>-maxtxfee=&lt;tutar&gt; için geçersiz tutar: '%s' (Sıkışmış işlemleri önlemek için en az %s değerinde en düşük aktarım ücretine eşit olmalıdır)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Aktardığımız ve oluşturduğumuz veri taşıyıcı işlemlerindeki en yüksek veri boyutu (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Her vekil bağlantısı için kimlik verilerini rastgele yap. Bu, Tor akış izolasyonunu etkinleştirir (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Bu işlem, tutar düşüldükten sonra göndermek için çok düşük</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Beyaz listeye alınan eşler DoS yasaklamasına uğramazlar ve işlemleri zaten mempool'da olsalar da daima aktarılır, bu mesela bir geçit için kullanışlıdır</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Budama olmayan kipe dönmek için veritabanını -reindex ile tekrar derlemeniz gerekir. Bu, tüm blok zincirini tekrar indirecektir</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Herkese açık REST taleplerini kabul et (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Otomatik olarak gizli Tor servisi oluştur (varsayılan: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>SOCKS5 vekil sunucusu vasıtasıyla bağlan</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>%s yüklemesinde hata: Zaten HD olan bir cüzdanda HD devre dışı bırakılamaz </translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Veritabanından okumada hata, kapatılıyor.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Zincirdurumu veritabanı yükseltme hatası</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Başlangıçta harici blk000??.dat dosyasından blokları içe aktarır</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Bilgi</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Geçersiz -onion adresi veya ana makine adı: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Geçersiz -proxy adresi veya ana makine adı: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>-paytxfee=&lt;tutar&gt;:'%s' unsurunda geçersiz tutar (asgari %s olması lazımdır)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>-whitelist: '%s' unsurunda geçersiz bir ağ maskesi belirtildi</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Hafızada en çok &lt;n&gt; bağlanılamaz işlem tut (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>-whitebind: '%s' ile bir port belirtilmesi lazımdır</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Düğüm aktarma seçenekleri:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC sunucu seçenekleri:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Sistem sınırlamaları sebebiyle -maxconnections %d değerinden %d değerine düşürülmüştür.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Başlangıçta blok zincirini eksik cüzdan işlemleri için tekrar tara</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>İzleme/hata ayıklama verilerini debug.log dosyası yerine konsola gönder</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Tüm hata ayıklama seçeneklerini göster (kullanımı: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>İstemci başlatıldığında debug.log dosyasını küçült (varsayılan: -debug bulunmadığında 1)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>İşlemin imzalanması başarısız oldu</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>Belirtilen -walletdir \"%s\" mevcut değil</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>Belirtilen -walletdir \"%s\" göreceli bir yoldur</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>Belirtilen -walletdir \"%s\" bir dizin değildir</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>İşlemdeki bitcoin tutarı ücreti ödemek için çok düşük</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Bu, deneysel bir yazılımdır.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Tor kontrol portu parolası (varsayılan: boş)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Eğer onion dinlemesi etkinse kullanılacak Tor kontrol portu (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>İşlem tutarı çok düşük</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Ücret politikası için işlem çok büyük</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>İşlem çok büyük</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Bu bilgisayarda %s ögesine bağlanılamadı (bağlanma %s hatasını verdi)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Başlangıç anahtarları üretilemiyor</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Başlangıçta cüzdanı en yeni biçime güncelle</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>JSON-RPC bağlantıları için kullanıcı ismi</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Cüzdan(lar) kontrol ediliyor...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Uyarı</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Uyarı: bilinmeyen yeni kurallar etkinleştirilmiştir (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Sadece blok kipinde çalışılıp çalışılmayacağı (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Veritabanını -txindex değerini değiştirmek için -reindex kullanarak tekrar oluşturmanız gerekiyor</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Cüzdandaki tüm işlemler kaldırılıyor...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ bildirim seçenekleri:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>JSON-RPC bağlantıları için parola</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>En iyi blok değiştiğinde komutu çalıştır (komut için %s parametresi blok hash değeri ile değiştirilecektir)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>-addnode, -seednode ve -connect için DNS aramalarına izin ver</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = tx meta verilerini tut mesela hesap sahibi ve ödeme talebi bilgileri, 2 = tx meta verilerini at)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee çok yüksek bir değere ayarlanmış! Bu denli yüksek ücretler tek bir işlemde ödenebilir.</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>İşlemleri bellek alanında &lt;n&gt; saatten fazla tutma (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Oluşturma ve aktarma işlemlerinde sigop başına eşdeğer bayt (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>%s yüklenmesinde hata: zaten var olan ve HD olmayan bir cüzdanda HD etkinleştirilemez.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>%s cüzdanı yüklenirken hata oluştu. -wallet değişkeni sadece belirli bir dosya adını belirtmelidir (bir dizini değil).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Bundan düşük ücretler (%s/kB olarak) işlem oluşturulması için sıfır değerinde ücret olarak kabul edilir (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Yerel aktarma politikasını ihlal etseler bile beyaz listedeki eşlerden gelen işlemlerin aktarılmasını zorla (varsayılan: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>-checkblocks'un blok kontrolünün ne kadar kapsamlı olacağı (0 ilâ 4, varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>İşlemlerin tamamının indeksini tut, getrawtransaction rpc çağrısı tarafından kullanılır (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Aksaklık gösteren eşlerle terkar bağlantıyı engelleme süresi, saniye olarak (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Hata ayıklama bilgisini dök (varsayılan: %u, &lt;category&gt; sağlanması seçime dayalıdır)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Ham işlemin serileştirilmesini ayarlar veya blok non-verbose, non-segwit(0) veya segwit(1) kipinde onaltılık değeri döndürür (default: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Cüzdanları tutmak için bir dizin belirtin (eğer varsa varsayılan: &lt;datadir&gt;/wallets, yoksa &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Blokların ve işlemlerin bloom filtreleri ile süzülmesini destekle (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>İşlem ücret tahminleri mevcut olmadığında ödeyebileceğiniz işlem ücreti budur.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Bu ürün OpenSSL Projesi tarafından geliştirilen OpenSSL araç takımınında kullanılmak üzere yazılan yazılımları %s Eric Young  tarafından yazılmış şifreleme yazılımını ve Thomas Bernard tarafından yazılmış UPnP yazılımını içerir.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Ağ sürümü zincirinin toplam boyutu (%i) en yüksek boyutu geçmektedir (%i). Kullanıcı aracı açıklamasının sayısı veya boyutunu azaltınız.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Giden trafiği belirtilen hedefin altında tutmaya çalışır (24 saat başı MiB olarak), 0 = sınırsız (varsayılan: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Desteklenmeyen -socks argümanı bulundu. SOCKS sürümünün ayarlanması artık mümkün değildir, sadece SOCKS5 vekilleri desteklenmektedir.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Desteklenmeyen argüman -whitelistalwaysrelay görmezden gelindi, -whitelistrelay ve/veya -whitelistforcerelay kullanın.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Eşlere gizli Tor servisleri ile ulaşmak için ayrı SOCKS5 vekil sunucusu kullan (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Uyarı: Bilinmeyen blok sürümü oluşturulmaya çalışılıyor. Bilinmeyen kuralların işlemesi mümkündür.</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Uyarı: wallet.dat bozuk, veriler geri kazanıldı! Özgün %s, %s olarak %s klasörüne kaydedildi; bakiyeniz ya da işlemleriniz yanlışsa bir yedeklemeden tekrar yüklemeniz gerekir.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Beyaz listeye eklenen eşler verilen IP adresinden (ör. 1.2.3.4) veya CIDR ağından (ör. 1.2.3.0/24) bağlanabilir. Değerler birden çok kez kullanılabilir.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s çok yüksek ayarlanmış!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Eş adresleri sorgulaması için daima DNS aramasını kullan (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>%s cüzdanı yüklenirken hata oluştu. -wallet dosya adı normal bir dosya adı olmalıdır.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>%s cüzdanı yüklenirken hata oluştu. Belirtilen -wallet dosya adında başka bir kopya daha var.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>%s cüzdanı yüklenirken hata oluştu. -wallet dosya adında geçersiz karakterler var.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Başlangıçta kontrol edilecek blok sayısı (varsayılan: %u, 0 = hepsi)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Hata ayıklama çıktısına IP adreslerini dahil et (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Keypool tükendi, lütfen önce keypoolrefill'i çağırın</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>JSON-RPC bağlantılarını &lt;port&gt; üzerinde dinle (varsayılan: %u veya tesnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Bağlantılar için dinlenecek &lt;port&gt; (varsayılan: %u ya da testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Eşler ile en çok &lt;n&gt; adet bağlantı kur (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Cüzdanın işlemleri yayınlamasını sağla</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Her bağlantı için en yüksek alım tamponu, &lt;n&gt;*1000 bayt (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Her bağlantı için çok gönderme tamponu, &lt;n&gt;*1000 bayt (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Hata ayıklama verilerinin önüne zaman damgası ekle (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Veri taşıyıcı işlemleri oluştur ve aktar (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>P2SH olmayan çoklu imzaları aktar (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Anahtar alan boyutunu &lt;n&gt; değerine ayarla (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>En yüksek BIP141 blok ağırlığını ayarla (varsayılan: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Hizmet RCP aramaları iş parçacığı sayısını belirle (varsayılan: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Yapılandırma dosyası belirtiniz (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Bağlantı zaman aşım süresini milisaniye olarak belirt (en düşüki: 1, varsayılan: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Pid dosyası belirtiniz (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Gönderme işlemlerinde doğrulanmamış para üstünü harca (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Ağ iş parçacıkları başlatılıyor...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Cüzdan en az aktarma ücretinden daha az ödeme yapmaktan sakınacaktır.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Bu her işlemde ödeceğiniz en düşük işlem ücretidir.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Eğer bir gönderme işlemi yaparsanız bu ödeyeceğiniz işlem ücretidir.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Aksaklık gösteren eşlerle bağlantıyı kesme sınırı (varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>İşlem tutarı negatif olmamalıdır</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>İşlem çok uzun bir mempool zincirine sahip</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>İşlemin en az bir alıcısı olması gerekir</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>-onlynet için bilinmeyen bir ağ belirtildi: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Yetersiz bakiye</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Blok indeksi yükleniyor...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Cüzdan yükleniyor...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Cüzdan eski biçime geri alınamaz</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Yeniden taranıyor...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Yükleme tamamlandı</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hata</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_tr_TR.ts",
    "content": "<TS language=\"tr_TR\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Adresi veya etiketi düzenlemek için sağ tıklayın</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Yeni adres oluştur</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Yeni</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Seçili adresi panoya kopyala</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Kopyala</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>K&amp;apat</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Seçili adresi listeden sil</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Seçili sekmedeki veriyi dosya olarak dışa aktar</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Dışa Aktar</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Sil</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>koinlerin gönderileceği adresi seçin</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Alıcı adresi seçiniz</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Seçim</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Gönderilen Adresler</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Alınan Adresler</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Bunlar ödeme göndermek için gereken Bitcoin adreslerinizdir. Para göndermeden önce her zaman miktarı ve alıcı adresi kontrol edin.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Bunlar ödeme almak için kullanılacak Bitcoin adreslerinizdir. Her işlem için yeni bir ödeme alma adresi kullanılması tavsiye edilir.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>Adresi Kopyala</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Kopyala ve Etiketle</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>Düzenle</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Adres Listesini Dışar Aktar</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Virgül ile ayrılmış dosya (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Dışa Aktarma Başarısız</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Adres listesini %1'e kaydederken bir hata oluştu. Lütfen tekrar deneyin.</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>etiket</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>adres</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(etiket yok)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Parola Diyaloğu</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Parolayı girin</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Yeni parola</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Yeni parolayı tekrarla</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Yeni parolayı cüzdana girin.&lt;br/&gt;Lütfen &lt;b&gt;on yada daha fazla karakter&lt;/b&gt; veya &lt;b&gt;sekiz yada daha fazla kelime&lt;/b&gt;içeren bir parola kullanın. </translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Cüzdanı Şifrele</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Bu işlem, cüzdan kilidinizi açmak için parolanıza ihtiyaç duyuyor</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Cüzdanı Kilitle</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Bu işlem, cüzdan kilidinizi açmak için parolanıza ihtiyaç duyuyor</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Cüzdanın Şifresini Çöz</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Parolayı değiştir</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Eski ve yeni parolanızı cüzdana girin.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Cüzdan Şifrelemesini Onaylayın</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Uyarı: Eğer cüzdanınızı şifreleyip parolanızı kaybederseniz (unutursanız) , &lt;b&gt;BÜTÜN BITCOIN'LERINIZI KAYBEDECEKSINIZ&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Cüzdanınızı şifrelemek istediğinizden emin misiniz?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Cüzdan Şifrelendi</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 Şifreleme işlemini bitirmek için kapatılacak. Şunu unutmayın ki şampiyon galatasaray ve şifrelemek, bitcoinlerinizin bilgisayarınıza bulaşan malware yazılımları tarafından çalınmasını tamamen engelleyemez.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>ÖNEMLİ: Yeni oluşturduğunuz şifrelenmiş cüzdan dosyasını önceki yedeklenmiş cüzdan dosyasıyla değiştirmeniz gerekmektedir. Güvenlik sebeplerinden dolayı yeni, şifrelenmiş cüzdanınızı kullanmaya başlar başlamaz önceki şifrelenmemiş cüzdan yedekleri kullanılmaz hale gelecektir.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Cüzdan şifreleme başarısız oldu</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Girilen parolalar eşleşmiyor.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Cüzdan Kilidi Açma Hatası</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Dikkat! Caps Lock tuşunuz açık!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>İmza &amp;mesaj</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Ağ ile bağlantı kuruluyor...</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;‮‮‭İşlemler</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>İşlem geçmişinize göz atın</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Çıkış</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Başvuruyu iptal edin</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>Hakkında%1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>%1 hakkındaki bilgileri görüntüle</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Qt Hakkında</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Qt hakkındaki bilgileri görüntüleyin</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Seçenekler</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Cüzdan Şifreleme</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Cüzdan Yedekleme</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Gönderme adresleri</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Alış adresleri</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>URI'yi aç</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Ağ etkinliği devre dışı.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Ağ aktivitesini tekrar başlatmak için tıklayın.</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Bloklar disk üzerinde yeniden indeksleniyor...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Bitcoin adresine madeni para gönderin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Cüzdanınızı başka bir lokasyona yedekleyin</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Hata giderme konsolunu aç</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Onay mesajı...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin\n</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Cüzdan</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>Gönder</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>Al</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>Göster / Gizle</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Ayarlar</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Kullanılan gönderim adreslerinin ve etiketlerinin listesini göster</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Kullanılan alış adreslerinin ve etiketlerinin listesini göster</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>Komut satırı ayarları</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Bloklar disk üzerinde indeksleniyor...</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hata</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Uyarı</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Bilgi</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Tarih %1</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD anahtar üretimi&lt;b&gt;aktif&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD anahtar üretimi &lt;b&gt;pasif&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bayt</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Ücret:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Ücretten sonra kalan:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Değişen:</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Listeleme modu</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Tarih</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Onaylamalar</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Kabul edilen</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Adresi kopyala</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etiketi kopyala</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Ücreti kopyala</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 kilitli)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>Evet</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>Hayır</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(etiket yok)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Adresi Düzenle</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>Etiket</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>Adres</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Yeni alış adresi</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Yeni gönderim adresi</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Alış adresini düzenleyin</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Gönderim adresini düzenleyin</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Girilen adres \"%1\" Bitcoin adresiyle eşleşmiyor.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Girilen adres \"%1\" adres defterinde zaten kayıtlı.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Yeni anahtar üretimi başarısız.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>isim</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>versiyon</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Hakkında %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Komut satırı ayarları</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Kullanım:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>komut satırı ayarları</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>UI Ayarları:</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Bir dil seçin, örneğin \"de_DE\" (seçilen: Sistem dili)</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Hoş geldiniz</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin\n</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hata</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Kalan blokların sayısı</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Bilinmiyor...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Son blok zamanı</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>hesaplanıyor...</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Gizle</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Ayarlar</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Ana Menü</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Veritabanı önbelleğinin boyutu</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Proxy bağlantısı IP adresleri (örneğin IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Konfigürasyon dosyasını aç</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Bütün ayarları varsayılana çevir</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>Ağ</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Cüzdan</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Proxy portu (örneğin 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>Pencere</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Kullanıcı arayüzü dili</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>Tamam</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>İptal</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>Varsayılan</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Değişikliklerin aktif edilebilmesi için yeniden başlatma gerekiyor.</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Konfigürasyon ayarları</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Konfigürasyon dosyası GUI ayarlarını geçersiz kılmak için gelişmiş kullanıcı ayarlarını değiştirir. Ek olarak, herhangi bir komut satırı seçeneği konfigürasyon dosyasını geçersiz kılar.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hata</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Konfigürasyon dosyası açılamadı.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Bu değişiklik istemcinin yeniden başlatılmasını gerektirir.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Sağlanan proxy adresi geçerli değil.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Gösterilen bilgi geçerli olmayabilir. Bağlantı tekrar sağlandıktan sonra cüzdanınız otomatik olarak senkronize olacaktır. Henüz senkronize olma işlemi tamamlanmadı.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Sadece görüntülenebilir:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Kullanılabilir:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Mevcut harcanabilir tutarınız</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Bekleyen:</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Toplam:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Toplam mevcut miktarınız</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Sadece görüntülenebilir adreslerdeki mevcut miktarınız</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Harcanabilir:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Yakın zamanda yapılmış işlemler</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Sadece görüntülenebilir adreslerdeki doğrulanmamış işlemler</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Sadece görüntülenebilir adreslerdeki mevcut toplam miktar</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Ödeme isteği hatası</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Ödeme isteği URL'si hatalı: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Hatalı ödeme adresi %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Ağ hatası</translation>\n    </message>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>Gönder</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Alındı</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Bitcoin adresinizi girin (örneğin %1)</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Yok</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 ve %2</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>bilinmiyor</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: %1</source>\n        <translation>Hata: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Görüntüyü kaydet</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Görüntüyü kopyala</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>QR kodu kaydet</translation>\n    </message>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Yok</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Arayüz versiyonu</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Bilgi</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Hata giderme penceresi</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Genel</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Kullanılan BerkeleyDB versiyonu</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Başlangıç zamanı</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Ağ</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>İsim</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Bağlantı sayısı</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Blok zinciri</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Bellek kullanımı</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Yeniden başlat</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Alındı</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Gönder</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Beyaz listede</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Versiyon</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Servisler</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Bağlantı süresi</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Son gönderim</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Son alış</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping süresi</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping bekliyor</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Son blok zamanı</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Aç</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Konsol</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Ağ trafiği</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Toplam</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Konsolu temizle</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;saat</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;gün</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;hafta</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;yıl</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Bağlantı kesildi</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Ağ aktivitesi pasif</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>asla</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Gelen</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Giden</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Evet</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Hayır</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Bilinmiyor</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiket</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Mesaj</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Temizle</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Göster</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Sil</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>URI'yi kopyala</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etiketi kopyala</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Mesajı kopyala</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR kod</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>URI'yi kopyala</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Adresi Kopyala</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Görüntüyü kaydet</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Ödeme bilgisi</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>adres</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>etiket</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaj</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Tarih</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>etiket</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaj</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(etiket yok)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(mesaj yok)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Coin gönder</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>Otomatik seçildi</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bayt</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Ücret:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Ücretten sonra kalan:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Değişen:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Gönderim ücreti:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Seçiniz...</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>kilobyte başına</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Gizle</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Önerilen:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Hepsini sil</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Ücreti kopyala</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blok)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1'den %2'e</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Göndermek istediğinize emin misiniz?</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>ya da</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Coin gönderimini onaylayın</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Uyarı: Hatalı Bitcoin adresi</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(etiket yok)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Etiket</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Panodaki adresi yapıştırın</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Mesaj:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Evet</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Panodaki adresi yapıştırın</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>İmza</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>İmza &amp;Mesaj</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Hepsini sil</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Girilen adres hatalı.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Adresi kontrol ettikten sonra lütfen tekrar deneyin.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>İmzanızı kontrol ettikten sonra lütfen tekrar deneyin.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Mesaj onayı hatalı.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Mesaj onaylandı.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Status</source>\n        <translation>Durum</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Tarih</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Kaynak</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Oluşturuldu</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>bilinmiyor</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>etiket</translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>kabul edilmedi</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Gönderim ücreti</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Mesaj</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Yorum</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Gönderimin toplam boyutu</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Hata giderme bilgisi</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>doğru</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>anlış</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Tarih</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tip</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>etiket</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Onaylandı (%1 onaylanan)</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Oluşturuldu fakat kabul edilmedi</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>ile alındı</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Kazıldı</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(yok)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(etiket yok)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Hepsi</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Bugün</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Bu hafta</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Bu Ay</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Son ay</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Bu yıl</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>ile alındı</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Kazıldı</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Diğerleri</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Adresi kopyala</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Etiketi kopyala</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Virgül ile ayrılmış dosya (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Kabul edilen</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Tarih</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Tip</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>etiket</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>adres</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Dışa Aktarma Başarısız</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Coin gönder</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Yeni ücret:</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Çıkar</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Cüzdanı yedekle</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Yedekleme başarısız</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Yedekleme tamamlandı</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Ayarlar:</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>JSON-RPC komutları ile komut satırını onaylayın</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Çekirdeği</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; can be:</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Blok oluşturma ayarları:</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Bağlantı ayarları:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Hata giderme/test ayarları:</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Hata: Disk boyutu düşük!</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>P2P adresleri yükleniyor...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Ban listesi yükleniyor...</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Bu yardım mesajını yazdır ve çıkış yap</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Versiyonu yazdır ve çıkış yap</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Bloklar Onaylanıyor...</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>%s tamamlanması için cüzdanın yeniden başlatılması gerekiyor</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Cüzdan Ayarları</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Veritabanı okuma hatası, kapatıldı.</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Bilgi</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Hatalı -onion adresi ya da host adı: '%s'</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC sunucu ayarları</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Bu deneysel bir yazılımdır.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Tor kontrolü portu şifresi (varsayılan: boş bırakınız)</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>İşlem çok büyük</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>JSON-RPC bağlantıları için kullanıcı adı</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Cüzdan(lar) onaylanıyor...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Uyarı</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>JSON-RPC bağlantıları için şifre</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Yapılandırma dosyasını belirle (varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Milisaniyelik zaman aşımına uğramış bağlantıyı belirle (minimum: 1, varsayılan: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Pid dosyasını belirle (Varsayılan: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>İşlem gönderiminde onaylanmamış değişimi öde (Varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Bağlantı konuları başlıyor</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Cüzdan minimum değişim ücretinden daha düşük olan ödemeyi önleyecektir</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Her işlem için minimum işlem ücretiniz budur</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Bir işlem göndermeniz durumunda işlem ücretiniz budur</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Sorunlu emsalleri koparma eşiği (Varsayılan: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>İşlem miktarı negatif olmamalı</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>İşlem çok uzun bir bellek havuzu zincirine sahip</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>İşlemin en az bir alıcıya sahip olmalı</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Belirsiz ağ belirtildi -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Yetersiz Bakiye</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Blok indeksi yükleniyor</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Cüzdan Bekleniyor...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Cüzdan indirgenememektedir</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Tekrar taranıyor...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Yükleme tamamlandı</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Hata</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_uk.ts",
    "content": "<TS language=\"uk\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Клікніть правою кнопкою для редагування адреси або мітки</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Створити нову адресу</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Нова</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Копіювати виділену адресу в буфер обміну</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Копіювати</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>З&amp;акрити</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Вилучити вибрані адреси з переліку</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Експортувати дані з поточної вкладки в файл</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Експорт...</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Видалити</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Оберіть адресу для відправки монет</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Оберіть адресу для отримання монет</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>О&amp;брати</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Адреса відправлення</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Адреса отримання</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Це ваші адреси Bitcoin для надсилання платежів. Завжди перевіряйте суму та адресу одержувача перед відправленням монет.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Це ваші адреси Bitcoin для отримання платежів. Для кожної транзакції рекомендується використовувати нову адресу одержувача.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Скопіювати адресу гаманця</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Зкопіювати&amp;Створити мітку</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Редагувати</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Експортувати список адрес</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Файли (*.csv) розділеі комами</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Експортування пройшло не успішно</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>Виникла помилка при спрбі збереження списку адрес %1. Будь-ласка, спробувати пізніше. </translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Мітка</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адреса</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(немає мітки)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Діалог введення паролю</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Введіть пароль</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Новий пароль</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Повторіть пароль</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Показати пароль</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Введіть нову кодову фразу для гаманця.&lt;br/&gt;Будь ласка, використовуйте кодові фрази що містять &lt;b&gt; щонайменше десять випадкових символів &lt;/b&gt; або &lt;b&gt; щонайменше вісім слів &lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Зашифрувати гаманець</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Ця операція потребує пароль для розблокування гаманця.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Розблокувати гаманець</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Ця операція потребує пароль від гаманця для його розблокування.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Дешифрувати гаманець</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Змінити пароль</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Введіть старий пароль та новий пароль до гаманця.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Підтвердіть шифрування гаманця</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>УВАГА: Якщо ви зашифруєте гаманець і забудете пароль, ви &lt;b&gt;ВТРАТИТЕ ВСІ СВОЇ БІТКОІНИ&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Ви дійсно хочете зашифрувати свій гаманець?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Гаманець зашифровано</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 буде закрито зараз, щоб завершити процес шифрування. Пам'ятайте, що шифрування гаманця не може повністю захистити ваші біткойни від крадіжки шкідливими програмами, у випадку якщо ваш комп'ютер буде інфіковано.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>ВАЖЛИВО: Всі попередні резервні копії, які ви зробили з вашого файлу гаманця повинні бути замінені новоствореним, зашифрованим файлом гаманця. З міркувань безпеки, попередні резервні копії незашифрованого файла гаманця стануть непридатними одразу ж, як тільки ви почнете використовувати новий, зашифрований гаманець.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Не вдалося зашифрувати гаманець</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Виникла помилка під час шифрування гаманця. Ваш гаманець не було зашифровано.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Введені паролі не співпадають.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Не вдалося розблокувати гаманець</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Введений пароль є невірним.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Не вдалося розшифрувати гаманець</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Пароль було успішно змінено.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Увага: Ввімкнено Caps Lock!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Маска підмережі</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Заблоковано До</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>&amp;Підписати повідомлення...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Синхронізація з мережею...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Огляд</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Вузол</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Показати стан гаманця</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Транзакції</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Переглянути історію транзакцій</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>&amp;Вихід</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Вийти</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>П&amp;ро %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Показати інформацію про %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;Про Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Показати інформацію про Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Параметри...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Редагувати параметри для %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Шифрування гаманця...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Резервне копіювання гаманця...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Змінити парол&amp;ь...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>Адреси для &amp;відправлення...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Адреси для &amp;отримання...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Відкрити &amp;URI</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Натисніть, щоб вимкнути активність мережі.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Мережева активність вимкнена.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Натисніть, щоб знову активувати мережеву активність.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Синхронізація заголовків (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Переіндексація блоків на диску ...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Відправити монети на вказану адресу</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Резервне копіювання гаманця в інше місце</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Змінити пароль, який використовується для шифрування гаманця</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>В&amp;ікно зневадження</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Відкрити консоль зневадження і діагностики</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>П&amp;еревірити повідомлення...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Гаманець</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Відправити</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Отримати</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>Показа&amp;ти / Приховати</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Показує або приховує головне вікно</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Зашифрувати закриті ключі, що знаходяться у вашому гаманці</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Підтвердіть, що Ви є власником повідомлення підписавши його Вашою Bitcoin-адресою </translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Перевірте повідомлення для впевненості, що воно підписано вказаною Bitcoin-адресою</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Файл</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Налаштування</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Довідка</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Панель вкладок</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Створити запит платежу (генерує QR-код та bitcoin: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Показати список адрес і міток, що були використані для відправлення</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Показати список адрес і міток, що були використані для отримання</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Відкрити bitcoin: URI чи запит платежу</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>П&amp;араметри командного рядка</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n активне з'єднання з мережею Bitcoin</numerusform><numerusform>%n активні з'єднання з мережею Bitcoin</numerusform><numerusform>%n активних з'єднань з мережею Bitcoin</numerusform><numerusform>%n активних з'єднань з мережею Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Індексація блоків на диску ...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Обробка блоків на диску...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Оброблено %n блок історії транзакцій.</numerusform><numerusform>Оброблено %n блоки історії транзакцій.</numerusform><numerusform>Оброблено %n блоків історії транзакцій.</numerusform><numerusform>Оброблено %n блоків історії транзакцій.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 тому</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Останній отриманий блок було згенеровано %1 тому.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Пізніші транзакції не буде видно.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Помилка</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Попередження</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Інформація</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Синхронізовано</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Показати довідку %1 для отримання переліку можливих параметрів командного рядка.</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 клієнт</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Підключення до вузлів...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Синхронізується...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Дата: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Кількість: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Тип: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Мітка: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Адреса: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Надіслані транзакції</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Отримані транзакції</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Генерація HD ключа &lt;b&gt;увімкнена&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Генерація HD ключа&lt;b&gt;вимкнена&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>&lt;b&gt;Зашифрований&lt;/b&gt; гаманець &lt;b&gt;розблоковано&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>&lt;b&gt;Зашифрований&lt;/b&gt; гаманець &lt;b&gt;заблоковано&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Сталася фатальна помилка. Гаманець буде закрито.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Вибір Монет</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Кількість:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Байтів:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Сума:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Комісія:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Пил:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Після комісії:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Решта:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>Вибрати/зняти всі</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Деревом</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Списком</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Кількість</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Отримано з позначкою</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Отримано з адресою</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Підтверджень</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Підтверджені</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Копіювати адресу</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Копіювати мітку</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копіювати суму</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Копіювати ID транзакції </translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Заблокувати</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Розблокувати</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Скопіювати кількість</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Скопіювати комісію</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Скопіювати після комісії</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Скопіювати байти</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Скопіювати інше</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Скопіювати решту</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 заблоковано)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>так</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>ні</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Може відрізнятися на +/- %1 сатоші за введені</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>немає мітки</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>решта з %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(решта)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Редагувати адресу</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Мітка</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Мітка, пов'язана з цим записом списку адрес</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Адреса, пов'язана з цим записом списку адрес. Це поле може бути модифіковане лише для адрес відправлення.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Адреса</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Нова адреса для отримання</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Нова адреса для відправлення</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Редагувати адресу для отримання</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Редагувати адресу для відправлення</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Введена адреса \"%1\" не є адресою в мережі Bitcoin.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Введена адреса \"%1\" вже присутня в адресній книзі.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Неможливо розблокувати гаманець.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Не вдалося згенерувати нові ключі.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Буде створено новий каталог даних.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>назва</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Каталог вже існує. Додайте %1, якщо ви мали намір створити там новий каталог.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Шлях вже існує і не є каталогом.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Тут неможливо створити каталог даних.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>версії</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-бітний)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>Про %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Параметри командного рядка</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Використання:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>параметри командного рядка</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Параметри інтерфейсу:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Обирати каталог даних під час запуску (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Встановити мову (наприклад: \"de_DE\") (типово: системна)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Запускати згорнутим</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Вказати кореневі SSL-сертифікати для запиту платежу (типово: -системні-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Показувати заставку під час запуску (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Скинути налаштування, які було змінено через графічний інтерфейс користувача</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Ласкаво просимо</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Ласкаво просимо до %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Оскільки це перший запуск програми, ви можете обрати де %1 буде зберігати дані.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Після натискання кнопки «OK» %1 почне завантажувати та обробляти повний ланцюжок блоків %4 (%2 Гб), починаючи з найбільш ранніх транзакцій у %3, коли було запущено %4.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Якщо ви вирішили обмежити збереження ланцюжка блоків (відсікання), історичні дані повинні бути завантажені та оброблені, але потім можуть бути видалені, щоб зберегти потрібний простір диска.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Використовувати типовий каталог даних</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Використовувати свій каталог даних:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Принаймні, %1 ГБ даних буде збережено в цьому каталозі, і воно з часом зростатиме.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Близько %1 Гб даних буде збережено в цьому каталозі.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 буде завантажувати та зберігати копію ланцюжка блоків біткінів.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Гаманець також зберігатиметься в цьому каталозі.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Помилка: неможливо створити обраний каталог даних «%1».</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Помилка</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>Доступно %n ГБ вільного простору</numerusform><numerusform>Доступно %n ГБ вільного простору</numerusform><numerusform>Доступно %n ГБ вільного простору</numerusform><numerusform>Доступно %n ГБ вільного простору</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(в той час, як необхідно %n ГБ)</numerusform><numerusform>(в той час, як необхідно %n ГБ)</numerusform><numerusform>(в той час, як необхідно %n ГБ)</numerusform><numerusform>(в той час, як необхідно %n ГБ)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Форма</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Нещодавні транзакції ще не відображаються, тому баланс вашого гаманця може бути неточним. Ця інформація буде вірною після того, як ваш гаманець завершить синхронізацію з мережею біткойн, врахровуйте показники нижче.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Спроба видправити біткойни, які ще не відображаються, не буде прийнята мережею.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Залишилося блоків</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Невідомо...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Час останнього блоку</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Прогрес</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Прогрес за годину</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>рахування...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Орієнтовний час до кінця синхронізації</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Приховати</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Невідомо. Синхронізація заголовків (%1%)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Відкрити URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Відкрити запит платежу з URI або файлу</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Виберіть файл запиту платежу</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Виберіть файл запиту платежу</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Параметри</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Головні</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Розмір &amp;кешу бази даних</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>МБ</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Кількість потоків &amp;сценарію перевірки</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP-адреса проксі-сервера (наприклад IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Показує, чи типово використовується проксі SOCKS5 для досягнення рівної участі для цього типу мережі.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>Використовуйте окремі проксі-сервери SOCKS&amp;5 для підключення до вузлів через приховані сервіси Tor:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>Приховати значок із системного лотка.</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>&amp;Приховати піктограму з лотка</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Згортати замість закриття. Якщо ця опція включена, програма закриється лише після вибору відповідного пункту в меню.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Сторонні URL (наприклад, block explorer), що з'являться на вкладці транзакцій у вигляді пункту контекстного меню. %s в URL буде замінено на хеш транзакції. Для відокремлення URLів використовуйте вертикальну риску |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Активовані параметри командного рядка, що перекривають вищевказані параметри:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Відкрийте %1 файл конфігурації з робочого каталогу.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Відкрити файл конфігурації</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Скинути всі параметри клієнта на типові.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>С&amp;кинути параметри</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Мережа</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = автоматично, &lt;0 = вказує кількість вільних ядер)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Г&amp;аманець</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Експерт</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Ввімкнути &amp;керування входами</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>Якщо вимкнути витрату непідтвердженої решти, то решту від транзакції не можна буде використати, допоки ця транзакція не матиме хоча б одне підтвердження. Це також впливає на розрахунок балансу.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Витрачати непідтверджену решту</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Автоматично відкривати порт для клієнту біткоін на роутері. Працює лише якщо ваш роутер підтримує UPnP і ця функція увімкнена.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Відображення порту через &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>Приймати з'єднання ззовні.</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>Дозволити вхідні з'єднання</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Підключення до мережі Bitcoin через SOCKS5 проксі.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Підключення через SOCKS5 проксі (проксі за замовчуванням):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>&amp;IP проксі:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Порт:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Порт проксі-сервера (наприклад 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Приєднуватися до учасників через:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Підключатися до мережі Bitcoin через окремий SOCKS5 проксі для прихованих сервісів Tor.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Вікно</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Показувати лише іконку в треї після згортання вікна.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>Мінімізувати &amp;у трей</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>Згортати замість закритт&amp;я</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Відображення</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Мов&amp;а інтерфейсу користувача:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Встановлює мову інтерфейсу. Зміни набудуть чинності після перезапуску %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>В&amp;имірювати монети в:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Виберіть одиницю вимірювання монет, яка буде відображатись в гаманці та при відправленні.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Показати або сховати керування входами.</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>&amp;URL-адреси транзакцій сторонніх розробників</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;Гаразд</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Скасувати</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>типово</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>відсутні</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Підтвердження скидання параметрів</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Для застосування змін необхідно перезапустити клієнта.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Клієнт буде вимкнено. Продовжити?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Редагувати параметри</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>Файл конфігурації використовується для вказування додаткових параметрів користувача, що перекривають настройки графічного інтерфейсу користувача. Крім того, будь-які параметри командного рядка замінять цей конфігураційний файл.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Помилка</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Файл конфігурції не можливо відкрити</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Ця зміна вступить в силу після перезапуску клієнта</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Невірно вказано адресу проксі.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Форма</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Показана інформація вже може бути застарілою. Ваш гаманець буде автоматично синхронізовано з мережею Bitcoin після встановлення підключення, але цей процес ще не завершено.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Тільки спостереження:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Наявно:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Ваш поточний підтверджений баланс</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Очікується:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Сума монет у непідтверджених транзакціях</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Незрілі:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Баланс видобутих та ще недозрілих монет</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Баланси</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Всього:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Ваш поточний сукупний баланс</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Ваш поточний баланс в адресах для спостереження</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Доступно:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Останні транзакції</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Непідтверджені транзакції на адреси для спостереження</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Баланс видобутих та ще недозрілих монет на адресах для спостереження</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Поточний сукупний баланс в адресах для спостереження</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Помилка запиту платежу</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Не вдається запустити біткойн: обробник клацни-плати</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>Обробка URI</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>URL запиту платежу є некоректним: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Помилка в адресі платежу %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>Неможливо обробити URI! Причиною цього може бути некоректна Біткойн-адреса або неправильні параметри URI.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Обробка файлу запиту платежу</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Неможливо прочитати файл запиту платежу! Ймовірно, файл пошкоджено.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Запит платежу відхилено</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Мережа запиту платежу не є мережею клієнта.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Запит платежу прострочено.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Запит платежу не ініціалізовано.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>\n70/5000\nНеперевірені запити на оплату до індивідуальних платіжних скриптів не підтримуються.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Помилка в запиті платежу.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Сума запиту платежу для %1 занадто мала (вважається пилом)</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Відшкодування з %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Запит платежу %1 занадто великий (%2 байт, дозволено %3 байт).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Помилка зв'язку з %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Неможливо розпізнати запит платежу!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Погана відповідь від сервера %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Помилка мережевого запиту</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Платіж підтверджено</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Клієнт користувача</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Вузол/Сервіс</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>Ідентифікатор вузла</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Затримка</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Відправлено</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Отримано</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Кількість</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Введіть адресу Bitcoin (наприклад %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 д</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 г</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 х</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 с</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Відсутні</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Н/Д</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 мс</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n секунда</numerusform><numerusform>%n секунд</numerusform><numerusform>%n секунд</numerusform><numerusform>%n секунд</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n хвилина</numerusform><numerusform>%n хвилин</numerusform><numerusform>%n хвилин</numerusform><numerusform>%n хвилин</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n година</numerusform><numerusform>%n годин</numerusform><numerusform>%n годин</numerusform><numerusform>%n годин</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n день</numerusform><numerusform>%n днів</numerusform><numerusform>%n днів</numerusform><numerusform>%n днів</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n тиждень</numerusform><numerusform>%n тижнів</numerusform><numerusform>%n тижнів</numerusform><numerusform>%n тижнів</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 та %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n рік</numerusform><numerusform>%n років</numerusform><numerusform>%n років</numerusform><numerusform>%n років</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 Б</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 КБ</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 МБ</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 ГБ</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 безпечний вихід ще не виконано...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>невідомо</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Помилка: Вказаного каталогу даних «%1» не існує.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Помилка: Неможливо обробити файл конфігурації: %1. Використовуйте синтаксис: ключ=значення.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Помилка: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Зберегти зображення...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Копіювати зображення</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Зберегти QR-код</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>Зображення PNG (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Н/Д</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Версія клієнту</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Інформація</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Вікно зневадження</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Загальна</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Використовується BerkeleyDB версії</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Каталог даних</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Час запуску</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Мережа</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Ім’я</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Кількість підключень</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Ланцюг блоків</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Поточне число блоків</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Пул пам'яті</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Поточне число транзакцій</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Використання пам'яті</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Скинути</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Отримано</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Відправлено</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Учасники</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Заблоковані вузли</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Виберіть учасника для перегляду детальнішої інформації</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>В білому списку</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Напрямок</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Версія</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Початковий Блок</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Синхронізовані Заголовки</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Синхронізовані Блоки</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Клієнт користувача</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Відкрийте файл журналу налагодження %1 з поточного каталогу даних. Це може зайняти кілька секунд для файлів великого розміру.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Зменшити розмір шрифту</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Збільшити розмір шрифту</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Сервіси</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Очки бану</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Час з'єднання</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Востаннє відправлено</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Востаннє отримано</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Затримка</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Тривалість поточної затримки.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Поточна Затримка</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Мін Пінг</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Різниця часу</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Час останнього блоку</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Відкрити</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Консоль</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Мережевий трафік</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Всього</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Вхідних:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Вихідних:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Файл звіту зневадження</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Очистити консоль</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;годину</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;день</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;тиждень</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;рік</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Від'єднати</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Заблокувати на</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Розблокувати</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Ласкаво просимо до консолі RPC %1.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Використовуйте стрілки вгору та вниз для навігації історії та %1 для очищення екрана.</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>Введіть %1 для перегляду доступних команд.</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>Щоб отримати додаткові відомості про використання консолі введіть %1.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>ПОПЕРЕДЖЕННЯ. Шахраї активно вказували вводити тут команди і отримували доступ до вмісту гаманця користувачів. Не використовуйте цю консоль без повного розуміння наслідків виконання команд.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Мережева активність вимкнена.</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(ІД вузла: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>через %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>ніколи</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Вхідний</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Вихідний</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Так</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Ні</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Невідома</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Кількість:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Мітка:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Повідомлення:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Необов'язкове повідомлення на додаток до запиту платежу, котре буде показане під час відкриття запиту. Примітка: Це повідомлення не буде відправлено з платежем через мережу Bitcoin.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Необов'язкове поле для мітки нової адреси отримувача.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Використовуйте цю форму, щоб отримати платежі. Всі поля є &lt;b&gt;необов'язковими&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Необов'язкове поле для суми запиту. Залиште це поле пустим або впишіть нуль, щоб не надсилати у запиті конкретної суми.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Очистити всі поля в формі</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Очистити</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Історія запитів платежу</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>Н&amp;адіслати запит платежу</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Показати вибраний запит (робить те ж саме, що й подвійний клік по запису)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Показати</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Вилучити вибрані записи зі списку</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Вилучити</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Скопіювати адресу</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Скопіювати мітку</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Скопіювати повідомлення</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копіювати суму</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR-Код</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>&amp;Скопіювати URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Скопіювати &amp;адресу</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Зберегти зображення...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Запит платежу на %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Інформація про платіж</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адреса</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Сума</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Мітка</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Повідомлення</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Кінцевий URI занадто довгий, спробуйте зменшити текст для мітки / повідомлення.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Помилка кодування URI в QR-код.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Мітка</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Повідомлення</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>немає мітки</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(без повідомлення)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(без суми)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Запрошено</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Відправити</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Керування монетами</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Входи...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>вибираються автоматично</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Недостатньо коштів!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Кількість:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Байтів:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Сума:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Комісія:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Після комісії:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Решта:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Якщо це поле активовано, але адреса для решти відсутня або некоректна, то решта буде відправлена на новостворену адресу.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Вказати адресу для решти</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Комісія за передачу:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Виберіть...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Використання зарезервованої комісії може призвести до виконання транзакції, підтвердження котрої займе години, або дні, або ніколи не буде підтверджено. Обміркуйте можливість вибору комісії вручну, або зачекайте завершення валідації повного ланцюгу.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Попередження: оцінка розміру комісії наразі неможлива.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>згорнути налаштування оплат</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>за кілобайт</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Якщо комісія встановлюється в 1000 сатоші і розмір транзакції лише 250 байтів, то опція \"за кілобайт\" встановлює комісію в 250 сатоші, в той час, як \"всього щонайменше\" - в 1000 сатоші. Для транзакцій більших за кілобайт в обох випадках буде знято комісію за кілобайт.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Приховати</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Оплата тільки мінімальної комісії є прийнятною, допоки обсяг транзакцій є меншим простору в блоках. Але майте на увазі, що це може анулювати транзакцію, якщо попит на Bitcoin транзакції стане більшим, ніж мережа зможе обробити.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(читати підказки)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Рекомендовано:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Змінено:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Розумну оплату ще не ініціалізовано. Це, зазвичай, триває кілька блоків...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Відправити на декілька адрес</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Дод&amp;ати одержувача</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Очистити всі поля в формі</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Пил:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Час підтвердження:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>Увімкнути Заміна-Через-Комісію</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>З опцією Заміна-Через-Комісію (BIP-125) ви можете збільшити комісію за транзакцію після її надсилання. Інакше може бути рекомендоване збільшення розміру комісії для компенсації підвищеного ризику затримки транзакції.</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Очистити &amp;все</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Баланс:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Підтвердити відправлення</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>&amp;Відправити</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Копіювати кількість</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Копіювати суму</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Комісія</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Скопіювати після комісії</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Копіювати байти</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Скопіювати інше</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Скопіювати решту</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 блоків)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 до %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Ви впевнені, що хочете відправити?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>додано як комісія за транзакцію</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Загальна сума %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>або</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>Ви можете збільшити комісію пізніше (сигналізує Заміна-Через-Комісію, BIP-125).</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>Не сигналізує Заміна-Через-Комісію, BIP-125.</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Підтвердьте надсилання монет</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Неприпустима адреса отримувача. Будь ласка, перевірте.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Сума платні повинна бути більше 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Сума перевищує ваш баланс.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Після додавання комісії %1, сума перевищить ваш баланс.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Знайдено адресу, що дублюється: кожна адреса має бути вказана тільки один раз.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Транзакцію не виконано!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>Транзакцію відхилено з наступної причини: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Комісія більша, ніж %1, вважається абсурдно високою.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Запит платежу прострочено.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Сплатіть лише обов'язкову комісію у розмірі %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Очікуваний початок підтвердження через %n блок.</numerusform><numerusform>Очікуваний початок підтвердження протягом %n блоків.</numerusform><numerusform>Очікуваний початок підтвердження протягом %n блоків.</numerusform><numerusform>Очікуваний початок підтвердження протягом %n блоків.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Увага: Неприпустима Біткойн-адреса.</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Увага: Невідома адреса для решти</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Підтвердити індивідуальну адресу для решти</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>Адреса, яку ви обрали для решти, не є частиною цього гаманця. Будь-які або всі кошти з вашого гаманця можуть бути надіслані на цю адресу. Ви впевнені?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>немає мітки</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Кількість:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Отримувач:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Мітка:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Обрати ранiш використовувану адресу</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Це звичайний платіж.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>Адреса Bitcoin для відправлення платежу</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Вставити адресу</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Видалити цей запис</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>Комісію буде знято зі вказаної суми. До отримувача надійде менше біткоінів, ніж було вказано в полі кількості. Якщо ж отримувачів декілька - комісію буде розподілено між ними.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>В&amp;ідняти комісію від суми</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>Використати наявний баланс</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Повідомлення:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Цей запит платежу не є автентифікованим.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Цей запит платежу є автентифікованим.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Введіть мітку для цієї адреси для додавання її в список використаних адрес</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Повідомлення, що було додане до bitcoin:URI та буде збережено разом з транзакцією для довідки. Примітка: Це повідомлення не буде відправлено в мережу Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Отримувач:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Нотатка:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Введіть мітку для цієї адреси для додавання її в адресну книгу</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Так</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 припиняє роботу...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Не вимикайте комп’ютер до зникнення цього вікна.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Підписи - Підпис / Перевірка повідомлення</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Підписати повідомлення</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Ви можете підписувати повідомлення/угоди своїми адресами, щоб довести можливість отримання біткоінів, що будуть надіслані на них. Остерігайтеся підписувати будь-що нечітке чи неочікуване, так як за допомогою фішинг-атаки вас можуть спробувати ввести в оману для отримання вашого підпису під чужими словами. Підписуйте лише чіткі твердження, з якими ви повністю згодні.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>Адреса Bitcoin для підпису цього повідомлення</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Обрати ранiш використовувану адресу</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Вставити адресу</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Введіть повідомлення, яке ви хочете підписати тут</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Підпис</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Копіювати поточну сигнатуру до системного буферу обміну</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Підпишіть повідомлення щоб довести, що ви є власником цієї адреси</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>&amp;Підписати повідомлення</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Скинути всі поля підпису повідомлення</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Очистити &amp;все</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>П&amp;еревірити повідомлення</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Введіть нижче адресу отримувача, повідомлення (впевніться, що ви точно скопіювали символи завершення рядка, табуляцію, пробіли тощо) та підпис для перевірки повідомлення. Впевніться, що в підпис не було додано зайвих символів: це допоможе уникнути атак типу «людина посередині». Зауважте, що це лише засвідчує можливість отримання транзакцій підписувачем, але не в стані підтвердити джерело жодної транзакції!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>Адреса Bitcoin, якою було підписано це повідомлення</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Перевірте повідомлення для впевненості, що воно підписано вказаною Bitcoin-адресою</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Пере&amp;вірити повідомлення</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Скинути всі поля перевірки повідомлення</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Натисніть кнопку «Підписати повідомлення», для отримання підпису</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Введена адреса не співпадає.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Будь ласка, перевірте адресу та спробуйте ще.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Введена адреса не відноситься до ключа.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Розблокування гаманця було скасоване.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Приватний ключ для введеної адреси недоступний. </translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Не вдалося підписати повідомлення.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Повідомлення підписано.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>Підпис не можливо декодувати.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Будь ласка, перевірте підпис та спробуйте ще.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>Підпис не збігається з хешем повідомлення.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Не вдалося перевірити повідомлення.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Повідомлення перевірено.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[тестова мережа]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>КБ/с</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Відкрито на %n блок</numerusform><numerusform>Відкрито на %n блоків</numerusform><numerusform>Відкрито на %n блоків</numerusform><numerusform>Відкрито на %n блоків</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Відкрито до %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>конфліктує з транзакцією із %1 підтвердженнями</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/вимкнено</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/не підтверджено, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>в пулі пам'яті</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>не в пулі пам'яті</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>відкинуто</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/не підтверджено</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 підтверджень</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Статут</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, ще не було успішно розіслано</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, транслюється через %n вузол</numerusform><numerusform>, транслюється через %n вузлів</numerusform><numerusform>, транслюється через %n вузлів</numerusform><numerusform>, транслюється через %n вузлів</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Джерело</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Згенеровано</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>Від</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>невідомо</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>Отримувач</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>Власна адреса</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>тільки спостереження</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>мітка</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Кредит</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>дозріє через %n блок</numerusform><numerusform>дозріє через %n блоків</numerusform><numerusform>дозріє через %n блоків</numerusform><numerusform>дозріє через %n блоків</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>не прийнято</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Дебет</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Загальний дебет</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Загальний кредит</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Комісія за транзакцію</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Загальна сума</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Повідомлення</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Коментар</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>ID транзакції</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Розмір транзакції</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Вихідний індекс</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Продавець</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Згенеровані монети стануть доступні для використання після %1 підтверджень. Коли ви згенерували цей блок, його було відправлено в мережу для внесення до ланцюжку блоків. Якщо блок не буде додано до ланцюжку блоків, його статус зміниться на «не підтверджено», і згенеровані монети неможливо буде витратити. Таке часом трапляється, якщо хтось згенерував інший блок на декілька секунд раніше.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Налагоджувальна інформація</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Транзакція</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Входи</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Кількість</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>вірний</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>хибний</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Даний діалог показує детальну статистику по вибраній транзакції</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Інформація по %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Тип</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Мітка</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Відкрито на %n блок</numerusform><numerusform>Відкрито на %n блоків</numerusform><numerusform>Відкрито на %n блоків</numerusform><numerusform>Відкрито на %n блоків</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Відкрито до %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Поза мережею</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Не підтверджено</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Відкинуті</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Підтверджується (%1 з %2 рекомендованих підтверджень)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Підтверджено (%1 підтверджень)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Суперечить</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Повністтю не підтверджено (%1 підтверджень, будуть доступні після %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>Цей блок не був отриманий жодними іншими вузлами і, ймовірно, не буде прийнятий!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Згенеровано (не підтверджено)</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Отримано з</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Отримано від</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Відправлені на</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Відправлено собі</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Добуто</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>тільки спостереження</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(н/д)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>немає мітки</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Статус транзакції. Наведіть вказівник на це поле, щоб показати кількість підтверджень.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Дата і час, коли транзакцію було отримано.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Тип транзакції.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Чи було залучено адресу для спостереження в цій транзакції.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>Визначений користувачем намір чи мета транзакції.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Сума, додана чи знята з балансу.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Всі</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Сьогодні</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>На цьому тижні</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Цього місяця</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Минулого місяця</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Цього року</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Діапазон від:</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Отримано з</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Відправлені на</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>Відправлені собі</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Добуті</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Інше</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>Введіть адресу, ідентифікатор транзакції або мітку для пошуку</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Мінімальна сума</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Відмовитися від транзакції</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Збільшить плату за транзакцію</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Скопіювати адресу</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Скопіювати мітку</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Скопіювати суму</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Скопіювати ID транзакції </translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Скопіювати RAW транзакцію</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Скопіювати повні деталі транзакції</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Редагувати мітку</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Показати деталі транзакції</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Експортувати історію транзакцій</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Файли (*.csv) розділеі комами</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Підтверджено</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Тільки спостереження:</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Дата</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Тип</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Мітка</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Адреса</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>Ідентифікатор</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Експортування пройшло не успішно</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>Виникла помилка при спробі зберегти історію транзакцій до %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Експортовано успішно</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>Історію транзакцій було успішно збережено до %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Діапазон:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>до</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Одиниця виміру монет. Натисніть для вибору іншої.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>Жоден гаманець не завантажено.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Відправити Монети</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Помилка штурхання комісії</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Підвищення комісії за транзакцію не виконано</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Ви бажаєте збільшити комісію?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Поточна комісія:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Збільшити:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>Нова комісія:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Підтвердити штурхання комісії</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Не можливо підписати транзакцію.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Не вдалось виконати транзакцію</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Експорт</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Експортувати дані з поточної вкладки в файл</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Зробити резервне копіювання гаманця</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Данi гаманця (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Помилка резервного копіювання</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>Виникла помилка при спробі зберегти дані гаманця до %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Резервну копію створено успішно</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>Дані гаманця успішно збережено в %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Параметри:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Вкажіть робочий каталог</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Підключитись до вузла, щоб отримати список адрес інших учасників та від'єднатись</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Вкажіть вашу власну публічну адресу</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Приймати команди із командного рядка та команди JSON-RPC</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Розповсюджується за ліцензією на програмне забезпечення MIT, дивіться супровідний файл %s або %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>Якщо &lt;category&gt; не задано, або ж якщо &lt;category&gt; = 1, виводить всю налагоджувальну інформацію.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Встановлений розмір ланцюжка блоків є замалим (меншим за %d МіБ). Будь ласка, виберіть більше число.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Операція відсікання: остання синхронізація вмісту гаманцю не обмежується діями над скороченими данними. Вам необхідно зробити переіндексацію -reindex (заново завантажити веcь ланцюжок блоків в разі появи скороченого ланцюга)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Неможливо провести повторне сканування зі скороченим ланцюжком. Вам необхідно використати -reindex для завантаження повного ланцюжка блоків.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Помилка: Сталася фатальна помилка (детальніший опис наведено в debug.log)</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Комісія (в %s/КБ), що додаватиметься до вихідних транзакцій (типово: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Скорочення кількості блоків...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Запустити в фоновому режимі (як демон) та приймати команди</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Неможливо запустити HTTP-сервер. Детальніший опис наведено в журналі зневадження.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>Розробники %s</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>Розмір комісії (у %s/kB), який буде використано при нестачі даних для оцінювання комісії (типово: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Прийняти ретрансльовані транзакції, отримані від вузлів у білому списку, навіть коли подальша ретрансляція транзакцій не виконується (типово: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>Додайте вузол для підключення та утримання відкритого з'єднання (дивіться команду `addnode` RPC для отримання додаткової інформації).</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Прив'язатися до даної адреси та прослуховувати її. Використовуйте запис виду [хост]:порт для IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Неможливо блокувати каталог даних %s. %s, ймовірно, вже працює.</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>Неможливо встановити визначені з'єднання і одночасно використовувати addrman для встановлення вихідних з'єднань.</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>Підключення тільки до вказаного(-их) вузла(-ів); -connect = 0 вимикає автоматичні з'єднання (правила для цього вузла такі ж, як для -addnode)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Видалити всі транзакції гаманця та відновити ті, що будуть знайдені під час запуску за допомогою -rescan</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Помилка читання %s! Всі ключі зчитано правильно, але записи в адресній книзі, або дані транзакцій можуть бути відсутніми чи невірними.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Виключити налагоджувальну інформацію для категорії. Може використовуватися разом з -debug = 1 для виведення журналів налагодження для всіх категорій за винятком однієї або декількох зазначених категорій.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Виконати команду, коли транзакція гаманця зміниться (замість %s в команді буде підставлено ідентифікатор транзакції)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Додаткові транзакції для збереження в пам'яті компактних реконструкцій блоку (типово: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>Якщо цей блок знаходиться в ланцюжку, можна припустити, що він та його предки є дійсними і потенційно можна пропустити перевірку їх скриптів (0 для перевірки всіх, типово: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Максимально допустиме середне відхилення часу вузла. Локальне значення часу може коригуватись вузлами на цей показник вперед або назад. (типово : %u секунд)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Максимальна загальна сума комісії (у %s) для використання в одній транзакції гаманця або необоротній транзакції; встановлення занадто низького значення призведе до скасування великих транзакцій (типово: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Перевірте правильність дати та часу комп'ютера. Якщо ваш годинник  налаштовано невірно, %s не буде працювати належним чином.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Будь ласка, зробіть внесок, якщо ви знаходите %s корисним. Відвідайте %s для отримання додаткової інформації про програмне забезпечення.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Запит адреси вузла за допомогою DNS-пошуку, якщо замала кількість адрес (за замовчанням: 1, якщо -connect не використовується)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Знизити вимоги до зберігання, дозволяючи скоротити (видалити) старі блоки. Це дозволяє викликати RPC pruneblockchain, щоб видалити певні блоки, а також дозволяє автоматично обрізати старі блоки, якщо вказано цільовий розмір в MiB. Цей режим несумісний з -txindex і -rescan. Попередження: для відновлення цього параметра потрібно повторно завантажити весь ланцюжок блоків. (типово: 0 = вимкнути видалення блоків, 1 = дозволити ручне обрізання за допомогою RPC, &gt;%u = автоматично обрізати файли блоків, щоб вони не перевищували вказаного розміру у МіБ).</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Встановіть найнижчу ставку (у %s/kB) для транзакцій, щоб долукчити їх до блоку. (типово: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Встановити кількість потоків скрипту перевірки (від %u до %d, 0 = автоматично, &lt;0 = вказує кількість вільних ядер, типово: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>Схоже, що база даних блоків містить блок з майбутнього. Це може статися із-за некоректно встановленої дати та/або часу. Перебудовуйте базу даних блоків лише тоді, коли ви переконані, що встановлено правильну дату і час</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>Це перед-релізна тестова збірка - використовуйте на свій власний ризик - не використовуйте для майнінгу або в торговельних додатках</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>Це комісія за транзакцію, яку ви можете відкинути, якщо решта менша, ніж пил на цьому рівні</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Неможливо відтворити блоки. Вам потрібно буде перебудувати базу даних, використовуючи -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Неможливо повернути базу даних в стан до розвилки. Вам потрібно буде перезавантажити ланцюжок блоків</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Використовувати UPnP для відображення порту, що прослуховується (типово: 1 при прослуховуванні та за відсутності -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Ім'я користувача та хешований пароль для підключень JSON-RPC. Поле &lt;userpw&gt; у форматі: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. Канонічний сценарій python входить до складу share/rpcuser. Після цього кліент з'єднується в нормальному режимі з використанням пари аргументів rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt;. Цей параметр можна вказати кілька разів</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Гаманець не створить транзакції, які порушують обмеження для ланцюжка в пам'яті (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Увага: Мережа, здається, не повністю погоджується! Деякі добувачі напевно зазнають проблем.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Попередження: неможливо досягти консенсусу з підключеними вузлами! Вам, або іншим вузлам необхідно оновити програмне забезпечення.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Чи зберігати пул пам'яті при вимкненні та завантажувати при перезавантаженні (типово: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d з останніх 100 блоків мають неочікувану версію</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s пошкоджено, відновлення невдале</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool має бути не менше %d МБ</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; може бути:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Приймати підключення ззовні (типово: 1 за відсутності -proxy чи -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Додайте коментар до рядка агента користувача</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Спроба відновити приватні ключі з пошкодженого гаманця під час запуску</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Опції створення блоку:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Не можу вирішити -%s адресу: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Параметри вибору ланцюжка:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Індекс решти за межами діапазону</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Параметри з'єднання:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Всі права збережено. %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Виявлено пошкоджений блок бази даних</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Параметри тестування/налагодження:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Не завантажувати гаманець та вимкнути звернення до нього через RPC</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Ви хочете перебудувати базу даних блоків зараз?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Дозволено введення хеш блоку в рядок &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Дозволено введення хеш транзакції в рядок &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Дозволено введення RAW блоку в рядок &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Дозволено введення RAW транзакції в рядок &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Увімкнути заміну транзакції у пулі пам'яті (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>Помилка створення %s: Ви не можете створювати не-HD гаманці з цією версією.</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Помилка ініціалізації бази даних блоків</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Помилка ініціалізації середовища бази даних гаманця %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Помилка завантаження %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Помилка завантаження %s: Гаманець пошкоджено</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Помилка завантаження %s: Гаманець потребує новішої версії %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Помилка завантаження бази даних блоків</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Помилка відкриття блоку бази даних </translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Помилка: Мало вільного місця на диску!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Не вдалося слухати на жодному порту. Використовуйте -listen=0, якщо ви хочете цього.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>Помилка пересканування гаманця під час ініціалізації</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Імпорт...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Початковий блок некоректний/відсутній. Чи правильно вказано каталог даних для обраної мережі?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Невдала перевірка правильності ініціалізації. %s закривається.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Невірна сума -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Невірна сума для -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Невірна сума для зарезервованої комісії -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Утримувати розмір пам'яті для пулу транзакцій меншим за &lt;n&gt; мегабайтів (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Завантаження P2P адрес...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Завантаження бан-списку...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Місце знаходження куки авторизації (типово: каталог даних)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Бракує доступних дескрипторів файлів.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Підключатися тільки до вузлів в мережі &lt;net&gt; (ipv4, ipv6 або onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Надрукувати це довідкове повідомлення та вийти</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Версія для друку і виходу</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Розмір скороченого ланцюжка блоків не може бути від'ємним. </translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Використання скороченого ланцюжка блоків несумісне з параметром -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Відновити стан ланцюжка та індексу блоків з файлів blk*.dat на диску</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Відновити стан ланцюжка з щойно проіндексованих блоків</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Відтворення блоків...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Перетворювання блоків...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>Надсилання транзакцій з увімкненням опції повноцінного RBF (лише для RPC, типово: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Встановити розмір кешу бази даних в мегабайтах (від %d до %d, типово: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Вкажіть файл гаманця (в межах каталогу даних)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>Вихідний код доступний з %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Не вдалось розрахувати обсяг комісії за транзакцію та решти</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Неможливо прив'язати %s на цьому комп'ютері. %s, ймовірно, вже працює.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Параметр -benchmark не підтримується та буде проігноровано; використовуйте -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Параметр -debugnet не підтримується та буде проігноровано; використовуйте -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Параметр -tor не підтримується; використовуйте -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Непідтримувана категорія ведення журналу %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Оновлення бази даних UTXO</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Використовувати UPnP для відображення порту, що прослуховується (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Використовувати тестовий ланцюжок</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>Коментар до Клієнта Користувача (%s) містить небезпечні символи.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Перевірка блоків...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Параметри налагодження та тестування гаманця:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Гаманець вимагав перезапису: перезавантажте %s для завершення</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Параметри гаманця:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Дозволити підключення по протоколу JSON-RPC зі вказаного джерела. Правильною для &lt;ip&gt; є окрема IP-адреса (наприклад, 1.2.3.4), IP-адреса та маска підмережі (наприклад, 1.2.3.4/255.255.255.0) або CIDR-адреса (наприклад, 1.2.3.4/24). Цей параметр можна вказувати декілька разів.</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Прив'язатися до даної адреси та вносити до білого списку учасників, що під'єднуються до неї. Використовуйте запис виду [хост]:порт для IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Створювати нові файли з типовими для системи атрибутами доступу замість маски 077 (діє тільки при вимкненому гаманці)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Визначити власні IP-адреси (типово: 1 при прослуховуванні та за відсутності -externalip або -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Помилка: Не вдалося налаштувати прослуховування вхідних підключень (listen повернув помилку: %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Виконати команду при надходженні важливого сповіщення або при спостереженні тривалого розгалуження ланцюжка (замість %s буде підставлено повідомлення)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Комісії (в %s/kB), що менші за вказану, вважатимуться нульовими для зміни, аналізу та створення транзакцій (типово: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>Якщо параметр paytxfee не встановлено, включити комісію для отримання перших підтверджень транзакцій протягом n блоків (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Неприпустима сума для -maxtxfee = &lt;amount&gt;: «%s» ( плата повинна бути, принаймні %s, щоб запобігти зависанню транзакцій)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Максимальний розмір даних в транзакціях носіїв даних, що ми передаємо і добуваємо (за замовчуванням: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Надавати випадкові дані доступу для кожного проксі-з'єднання. Це дозволяє ввімкнути ізоляцію потоків Tor'у (типово: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>Залишок від суми транзакції зі сплатою комісії занадто малий </translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Учасники, що знаходяться в білому списку, не можуть бути заблоковані за DoS та їхні транзакції завжди ретранслюватимуться (навіть якщо вони є в пам'яті), що може бути корисним, наприклад, для шлюзу</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>Вам необхідно перебудувати базу даних з використанням -reindex для завантаження повного ланцюжка блоків.</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(типово: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Приймати публічні REST-запити (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Автоматичне з'єднання з прихованим сервісом Tor (типово: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Підключитись через SOCKS5-проксі</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Помилка завантаження %s: Ви не можете відключити режим HD в існуючому HD-гаманці</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Помилка читання бази даних, припиняю роботу.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Помилка оновлення бази даних стану ланцюжка</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Спочатку імпортує блоки з зовнішнього файлу blk000??.dat </translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Інформація</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Невірна -onion адреса або ім'я хоста: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Невірна -proxy адреса або ім'я хоста: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Вказано некоректну суму для параметру -paytxfee: «%s» (повинно бути щонайменше %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Вказано неправильну маску підмережі для -whitelist: «%s»</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Утримувати в пам'яті щонайбільше &lt;n&gt; транзакцій, що споживають невідомі входи (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Необхідно вказати порт для -whitebind: «%s»</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Параметри вузла ретрансляції:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>Параметри сервера RPC:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Зменшення значення -maxconnections з %d до %d із-за обмежень системи.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Спочатку переглянте ланцюжок блоків на наявність втрачених транзакцій гаманця</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Відсилати налагоджувальну інформацію на консоль, а не у файл debug.log</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Показати всі налагоджувальні параметри (використання: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Стискати файл debug.log під час старту клієнта (типово: 1 коли відсутній параметр -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Підписання транзакції не вдалося</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>Вказаний каталог гаманця -walletdir \"%s\" не існує</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>Вказаний каталог гаманця -walletdir \"%s\" є відносним шляхом</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>Вказаний шлях -walletdir \"%s\" не є каталогом</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>Неможливо сплатити комісію із-за малої суми транзакції</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>Це програмне забезпечення є експериментальним.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Пароль управління порт протоколом Tor (типово: empty)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Скористайтесь управлінням порт протоколом Tor, в разі перехоплення обміну цибулевої маршрутизації (типово: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Сума транзакції занадто мала</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Транзакція занадто велика для правил комісії</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Транзакція занадто велика</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Неможливо прив'язатися до %s на цьому комп'ютері (bind повернув помилку: %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>Не вдається створити початкові ключі</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Спочатку оновіть гаманець до останньої версії</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Ім'я користувача для JSON-RPC-з'єднань</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Перевірка гаманця(ців)... </translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>Гаманець %s знаходиться поза каталогом гаманця %s</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Попередження</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Попередження: активовано невідомі нові правила (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Чи слід працювати в режимі тільки блоки (типово: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>Для зміни -txindex потрібно перебудувати базу даних за допомогою -reindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Видалення всіх транзакцій з гаманця...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>Параметри сповіщень ZeroMQ:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Пароль для JSON-RPC-з'єднань</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Виконати команду, коли з'явиться новий блок (%s в команді змінюється на хеш блоку)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Дозволити пошук в DNS для команд -addnode, -seednode та -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = утримувати метадані транзакцій (до яких відноситься інформація про власника рахунку та запити платежів), 2 - відкинути)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>Встановлено дуже велике значення -maxtxfee! Такі великі комісії можуть бути сплачені окремою транзакцією.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Прив'язати до вказаної адреси, щоб слухати з'єднання JSON-RPC. Цей параметр ігнорується, крім випадків, коли -rpcallowip також встановлено. Порт необов'язковий, для перевизначення необхідно вказати -rpcport. Використовуйте [хост]:порт визначення для IPv6. Цей параметр може бути вказано кілька разів (типово: 127.0.0.1 та ::1, тобто localhost, або якщо вказано -rpcallowip, 0.0.0.0 та ::, тобто всі адреси)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Не тримати транзакції в пам'яті довше &lt;n&gt; годин (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Еквівалент байт-за-sigop у транзакціях для ретрансляції та видобутку (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Помилка завантаження %s: Ви не можете ввімкнути режим HD в існуючому не-HD гаманці</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Помилка завантаження гаманця %s. Параметр -wallet повинен вказувати лише назву файлу (не шлях).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Комісії (в %s/kB), що менші за вказану, вважатимуться нульовими для створення транзакцій (типово: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Примусово ретранслювати транзакції вузлів з білого списку, навіть якщо вони порушують політику локального ретранслятора (типово: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>Рівень ретельності перевірки блоків (0-4, типово: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Утримувати повний індекс транзакцій (використовується RPC-викликом getrawtransaction) (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Час в секундах, протягом якого відключені учасники з поганою поведінкою не зможуть підключитися (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Виводити налагоджувальну інформацію (типово: %u, вказання &lt;category&gt; необов'язкове)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Встановлює серіалізацію необробленої транзакції або повертає шістнадцяткове значення блоку у не-докладному режимі, non-segwit(0) або segwit(1) (типово: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>Вкажіть каталог для збереження гаманців (типово: &lt;datadir&gt;/wallets якщо шлях існує, інакше &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>Вкажіть місце розташування файлу журналу налагодження: це може бути абсолютний шлях або шлях до каталогу даних (типово: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Фільтрація блоків та транзакцій з допомогою фільтрів Блума (типово: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>Ставка комісії (у %s/kB), яка вказує вашу толерантність до відмови від решти, додаючи її до суми комісії (типово: %s). Примітка: Вихідна транзакція відхиляється, якщо вона є пилом за такої ставки, але ми завжди будемо відхиляти вихід аж до комісії за ретрансляцію пилу, а плата за відмову над цією ставкою обмежуватиметься оцінюваною платою за найдовшу ціль</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>Це комісія за транзакцію, яку ви можете сплатити, коли кошторисна вартість недоступна.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>Цей продукт включає в себе програмне забезпечення, розроблене проектом OpenSSL для використання в OpenSSL Toolkit %s та криптографічне програмне забезпечення, написане Еріком Янгом та програмне забезпечення UPnP, написане Томасом Бернардом.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Загальна довжина рядку мережевої версії (%i) перевищує максимально допустиму (%i). Зменшіть число чи розмір коментарів клієнта користувача.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Намагається зберегти вихідний трафік відповідно до зданого значення (в MIB за 24 години), 0 = без обмежень (типово: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Параметр -socks не підтримується. Можливість вказувати версію SOCKS було видалено, так як підтримується лише SOCKS5.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Непідтримуваний аргумент -whitelistalwaysrelay ігнорується, використовуйте -whitelistrelay та/або -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Використовувати окремий SOCKS5-проксі для з'єднання з учасниками через приховані сервіси Tor (типово: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Попередження: видобуваються невідомі версії блоків! Можливо активовано невідомі правила</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Попередження: файл гаманця пошкоджено, дані врятовано! Оригінальний %s збережено як %s в %s; якщо ваш баланс або транзакції некорректно відображаються, ви повинні відновити його з резервної копії.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Занести в білий список вузли з заданою IP-адресою (наприклад, 1.2.3.4), або мережею з позначкою CIDR (наприклад, 1.2.3.0/24). Можна вказати кілька разів.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s встановлено дуже високо!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(типово: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Завжди дізнаватися адреси учасників через DNS (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Помилка завантаження гаманця %s. Значення -wallet має бути звичайним файлом.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Помилка завантаження гаманця %s. Значення параметра -wallet дублюється.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Помилка завантаження гаманця %s. Недійсні символи в імені файлу -wallet.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>Скільки блоків перевіряти під час запуску (типово: %u, 0 = всі)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Включити IP-адреси до налагоджувального виводу (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Пул ключів скінчився, потрібно викликати keypoolrefill</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Прослуховувати &lt;port&gt; для JSON-RPC з'єднань (типово: %u, для тестової мережі: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Чекати на з'єднання на &lt;port&gt; (типово: %u, для тестової мережі: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Підтримувати щонайбільше &lt;n&gt; з'єднань з учасниками (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Дозволити гаманцю розповсюджувати транзакції</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Максимальний розмір вхідного буферу на одне з'єднання, &lt;n&gt;*1000 байтів (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Максимальний розмір вихідного буферу на одне з'єднання, &lt;n&gt;*1000 байтів (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Доповнювати налагоджувальний вивід відміткою часу (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Ретранслювати та створювати транзакції носіїв даних (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Ретранслювати не-P2SH транзакції з мультипідписом (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Встановити розмір пулу ключів &lt;n&gt; (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Встановити максимальний розмір блоку BIP141 (за замовчуванням: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Встановити число потоків для обслуговування викликів RPC (типово: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Вказати файл конфігурації (типово: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Вказати тайм-аут підключення в мілісекундах (щонайменше: 1, типово: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Вказати pid-файл (типово: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Витрачати непідтверджену решту при відправленні транзакцій (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Запуск мережевих потоків...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Гаманець не не переведе кошти якщо комісія менше мінімальної плати за транзакцію.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Це мінімальна плата за транзакцію, яку ви сплачуєте за кожну операцію.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Це транзакційна комісія, яку ви сплатите, якщо будете надсилати транзакцію.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Поріг відключення учасників з поганою поведінкою (типово: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Сума транзакції занадто мала (зменьшіть комісію, якщо можливо)</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>У транзакції занадто довгий ланцюг</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>У транзакції повинен бути щонайменше один одержувач</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Невідома мережа вказана в -onlynet: «%s»</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Недостатньо коштів</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Завантаження індексу блоків...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Завантаження гаманця...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Не вдається понизити версію гаманця</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Сканування...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Завантаження завершене</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Помилка</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_ur_PK.ts",
    "content": "<TS language=\"ur_PK\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>پتہ تبدیل کرے کے لیے دائیاں کلک کریں</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>نیا ایڈریس بنائیں</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>نیا</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>سلیکٹڈ پتے کو کمپوٹر کی عارضی جگہ رکھیں</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>نقل</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>بند</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>سلیکٹڈ پتے کو مٹائیں</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>موجودہ ڈیٹا کو فائیل میں محفوظ کریں</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>برآمد</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>مٹا</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>کوئین وصول کرنے والے کا پتہ</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>کوئین وصول کرنے والے کا پتہ</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>چننا</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Address</source>\n        <translation> پتہ</translation>\n    </message>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>پاس فریز داخل کریں</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>نیا پاس فریز</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>نیا پاس فریز دہرائیں</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Error</source>\n        <translation>نقص</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Amount:</source>\n        <translation>رقم:</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>رقم</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>تاریخ</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>&amp;Label</source>\n        <translation>چٹ</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation> پتہ</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Error</source>\n        <translation>نقص</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Error</source>\n        <translation>نقص</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>رقم</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>کاپی پتہ</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation> پتہ</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>ناکافی فنڈز</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>رقم:</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>بیلنس:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Address</source>\n        <translation> پتہ</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>ناکافی فنڈز</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>نقص</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_uz@Cyrl.ts",
    "content": "<TS language=\"uz@Cyrl\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Манзил ёки ёрлиқни таҳрирлаш учун икки марта босинг</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Янги манзил яратинг</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Янги</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Жорий танланган манзилни тизим вақтинчалик хотирасига нусха кўчиринг</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Нусха олиш</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>&amp;Ёпиш</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Жорий танланган манзилни рўйхатдан ўчириш</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Жорий ички ойна ичидаги маълумотларни файлга экспорт қилиш</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Экспорт</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Ўчириш</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Махфий сўз ойнаси</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Махфий сузни киритинг</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Янги махфий суз</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Янги махфий сузни такрорланг</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>&amp;Хабар ёзиш...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Тармоқ билан синхронланмоқда...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Кўриб чиқиш</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Улам</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Ҳамённинг умумий кўринишини кўрсатиш</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Пул ўтказмалари</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Пул ўтказмалари тарихини кўриш</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>Ч&amp;иқиш</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Иловадан чиқиш</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>&amp;Qt ҳақида</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Qt ҳақидаги маълумотларни кўрсатиш</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Мосламалар...</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>Ҳамённи &amp;кодлаш...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>Ҳамённи &amp;заҳиралаш...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>Махфий сўзни &amp;ўзгартириш...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Жўнатилувчи манзиллар...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Қабул қилувчи манзиллар...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Интернет манзилни очиш</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Дискдаги блоклар қайта индексланмоқда...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Тангаларни Bitcoin манзилига жўнатиш</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Ҳамённи бошқа манзилга заҳиралаш</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Паролни ўзгартириш ҳамённи кодлашда фойдаланилади</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Носозликни ҳал қилиш ойнаси</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Носозликни ҳал қилиш ва ташхис терминали</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>Хабарни &amp;тасдиқлаш...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Ҳамён</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Жўнатиш</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Қабул қилиш</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Кўрсатиш / Яшириш</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Асосий ойнани кўрсатиш ёки яшириш</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Ҳамёнингизга тегишли махфий калитларни кодлаш</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Bitcoin манзилидан унинг эгаси эканлигингизни исботлаш учун хабарлар ёзинг</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Хабарларни махсус Bitcoin манзилларингиз билан ёзилганлигига ишонч ҳосил қилиш учун уларни тасдиқланг</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;Файл</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp; Созламалар</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Ёрдам</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Ички ойналар асбоблар панели</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Тўловлар (QR кодлари ва bitcoin ёрдамида яратишлар: URI’лар) сўраш</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Фойдаланилган жўнатилган манзиллар ва ёрлиқлар рўйхатини кўрсатиш</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Фойдаланилган қабул қилинган манзиллар ва ёрлиқлар рўйхатини кўрсатиш</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Bitcoin’ни очиш: URI ёки тўлов сўрови</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Буйруқлар сатри мосламалари</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n та Bitcoin тармоғига фаол уланиш мавжуд</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 орқада</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Сўнги қабул қилинган блок %1 олдин яратилган.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Бундан кейинги пул ўтказмалари кўринмайдиган бўлади.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Хатолик</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Диққат</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Маълумот</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Янгиланган</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Банд қилинмоқда...</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Жўнатилган операция</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Кирувчи операция</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Ҳамён &lt;b&gt;кодланган&lt;/b&gt; ва вақтинча &lt;b&gt;қулфдан чиқарилган&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Ҳамён &lt;b&gt;кодланган&lt;/b&gt; ва вақтинча &lt;b&gt;қулфланган&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Сони:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Байт:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Миқдори:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Солиқ:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Ахлат қутиси:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Солиқдан сўнг:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Ўзгартириш:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>барчасини танаш (бекор қилиш)</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Дарахт усулида</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Рўйхат усулида</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Миқдори</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Сана</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Тасдиқлашлар</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Тасдиқланди</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Манзилларни таҳрирлаш</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>&amp;Ёрлик</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Ёрлиқ ушбу манзилар рўйхати ёзуви билан боғланган</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Манзил ушбу манзиллар рўйхати ёзуви билан боғланган. Уни фақат жўнатиладиган манзиллар учун ўзгартирса бўлади.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>&amp;Манзил</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Янги маълумотлар директорияси яратилади.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>номи</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Директория аллақачон мавжуд. Агар бу ерда янги директория яратмоқчи бўлсангиз, %1 қўшинг.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Йўл аллақачон мавжуд. У директория эмас.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Маълумотлар директориясини бу ерда яратиб бўлмайди..</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>версияси</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Буйруқлар сатри мосламалари</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Фойдаланиш:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>буйруқлар қатори орқали мослаш</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Хуш келибсиз</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Стандарт маълумотлар директориясидан фойдаланиш</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Бошқа маълумотлар директориясида фойдаланинг:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Хато: кўрсатилган \"%1\" маълумотлар директориясини яратиб бўлмайди.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Хатолик</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Шакл</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Сўнгги блок вақти</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>URI ни очиш</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>URL файлдан тўлов сўровларини очиш</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Тўлов сўрови файлини танлаш</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Танламалар</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Асосий</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>&amp;Маълумотлар базаси кеши</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>МБ</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Мавзуларни &amp;тўғрилаш скрипти миқдори</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Прокси IP манзили (масалан: IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>Тармоқ</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Ҳамён</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Прокси &amp;IP рақами:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Порт:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Прокси порти (e.g. 9050)</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Ойна</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Ойна йиғилгандан сўнг фақат трэй нишончаси кўрсатилсин.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>Манзиллар панели ўрнига трэйни &amp;йиғиш</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>Ёпишда й&amp;иғиш</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Кўрсатиш</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Фойдаланувчи интерфейси &amp;тили:</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>Миқдорларни кўрсатиш учун &amp;қисм:</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Бекор қилиш</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>стандарт</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>йўқ</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Тасдиқлаш танловларини рад қилиш</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Ўзгаришлар амалга ошиши учун мижозни қайта ишга тушириш талаб қилинади.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Хатолик</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Ушбу ўзгариш мижозни қайтадан ишга туширишни талаб қилади.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Келтирилган прокси манзили ишламайди.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Шакл</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Кўрсатилган маълумот эскирган бўлиши мумкин. Ҳамёнингиз алоқа ўрнатилгандан сўнг Bitcoin тармоқ билан автоматик тарзда синхронланади, аммо жараён ҳалигача тугалланмади.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Фақат кўришга</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Мавжуд:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Жорий сарфланадиган балансингиз</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Кутилмоқда:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Жами ўтказмалар ҳозиргача тасдиқланган ва сафланадиган баланс томонга ҳали ҳам ҳисобланмади</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Тайёр эмас:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Миналаштирилган баланс ҳалигача тайёр эмас</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Баланслар</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Жами:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Жорий умумий балансингиз</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Жорий балансингиз фақат кўринадиган манзилларда</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Сарфланадиган:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Сўнгги пул ўтказмалари</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Тасдиқланмаган ўтказмалар-фақат манзилларини кўриш</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Жорий умумий баланс фақат кўринадиган манзилларда</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>Фойдаланувчи вакил</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Миқдори</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Bitcoin манзилини киритинг (масалан.  %1)</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 д</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 с</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>Йўқ</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>Тўғри келмайди</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 мс</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 ва %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 Б</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 КБ</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 МБ</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 ГБ</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>Номаълум</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>Тўғри келмайди</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Мижоз номи</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Маълумот</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Тузатиш ойнаси</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Асосий</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Фойдаланилаётган BerkeleyDB версияси</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Бошланиш вақти</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Тармоқ</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Ном</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Уламлар</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Батафсил маълумотларни кўриш учун уламни танланг.</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Йўналиш</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Версия</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>Фойдаланувчи вакил</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Хизматлар</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Тезликни бан қилиш</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Уланиш вақти</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Сўнгги жўнатилган</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Сўнгги қабул қилинган</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping вақти</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Сўнгги блок вақти</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Очиш</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;Терминал</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Тармоқ трафиги</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Жами</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>Ичига:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Ташқарига:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Тузатиш журнали файли</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Терминални тозалаш</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>%1 орқали</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>ҳеч қачон</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Ички йўналиш</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Ташқи йўналиш</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Ҳа</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Йўқ</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Номаълум</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Миқдор:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Ёрлиқ:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Хабар:</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Янги қабул қилинаётган манзил билан боғланган танланадиган ёрлиқ.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Ушбу сўровдан тўловларни сўраш учун фойдаланинг. Барча майдонлар &lt;b&gt;мажбурий эмас&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Хоҳланган миқдор сўрови. Кўрсатилган миқдорни сўраш учун буни бўш ёки ноль қолдиринг.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Шаклнинг барча майдончаларини тозалаш</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Тозалаш</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Сўралган тўлов тарихи</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>Тўловни &amp;сўраш</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Танланган сўровни кўрсатиш (икки марта босилганда ҳам бир хил амал бажарилсин)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Кўрсатиш</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Танланганларни рўйхатдан ўчириш</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Ўчириш</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Коди</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Нусҳалаш &amp; Манзил</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>Расмни &amp;сақлаш</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Тангаларни жунат</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Танга бошқаруви ҳусусиятлари</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>автоматик тарзда танланган</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Кам миқдор</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Сони:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Байт:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Миқдори:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Солиқ:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Солиқдан сўнг:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Ўзгартириш:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Агар бу фаоллаштирилса, аммо ўзгартирилган манзил бўл ёки нотўғри бўлса, ўзгариш янги яратилган манзилга жўнатилади.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Бошқа ўзгартирилган манзил</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Ўтказма тўлови</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Танлов</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>Хар килобайтига</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Тавсия этилган</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Бирданига бир нечта қабул қилувчиларга жўнатиш</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Шаклнинг барча майдончаларини тозалаш</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Ахлат қутиси:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Барчасини &amp; Тозалаш</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Баланс</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Жўнатиш амалини тасдиқлаш</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>Жў&amp;натиш</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>&amp;Миқдори:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>&amp;Тўлов олувчи:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Ёрлиқ:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Олдин фойдаланилган манзилни танла</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Бу нормал тўлов.</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Клипбоарддан манзилни қўйиш</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Хабар</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Тўлов олувчи:</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Олдин фойдаланилган манзилни танла</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Клипбоарддан манзилни қўйиш</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Имзо</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Барчасини &amp; Тозалаш</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>Ушбу ойна операциянинг батафсил таърифини кўрсатади</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    </context>\n<context>\n    <name>TransactionView</name>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Танламалар:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Маълумотлар директориясини кўрсатинг</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Буйруқлар сатри ва JSON-RPC буйруқларига рози бўлинг</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Демон сифатида орқа фонда ишга туширинг ва буйруқларга рози бўлинг</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Уланиш кўрсаткичлари:</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Маълумот</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>JSON-RPC уланишлари учун фойдаланувчи номи</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Диққат</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>JSON-RPC уланишлари учун парол</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Кам миқдор</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Тўсиқ индекси юкланмоқда...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Ҳамён юкланмоқда...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Қайта текшириб чиқилмоқда...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Юклаш тайёр</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Хатолик</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_vi.ts",
    "content": "<TS language=\"vi\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Phải chuột để edit address hoặc label</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Create một address mới</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Tạo mới</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Sao chép các địa chỉ đã được chọn vào bộ nhớ tạm thời của hệ thống</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Sao chép</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Đ&amp;óng lại</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Xóa địa chỉ đang chọn từ danh sách</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Xuất dữ liệu trong thẻ hiện tại ra file</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Xuất</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Xóa</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Chọn địa chỉ để gửi coins đến</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Chọn địa chỉ để nhận coins với</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>C&amp;họn</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Địa chỉ đang gửi</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Địa chỉ đang nhận</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Đây là những địa chỉ đang thực hiện thanh toán. Luôn kiểm tra số lượng và địa chỉ nhận trước khi gửi coins.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Đây là địa chỉ Bitcoin của bạn để nhận thanh toán. Khuyến cáo nên sử dụng địa chỉ mới cho mỗi giao dịch.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Copy Địa Chỉ</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Copy &amp;Nhãn</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Edit</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Xuất List Địa Chỉ</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Xuất Thất Bại</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Địa chỉ</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(không nhãn)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Log Cụm Mật Khẩu</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Nhập cụm mật khẩu</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Cụm mật khẩu mới</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Lặp lại cụm mật khẩu mới</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Gõ cụm mật khẩu mới cho ví.&lt;br/&gt;Vui lòng dùng cụm mật khẩu của&lt;b&gt;mười hoặc hơn ký tự ngẫu nhiên&lt;/b&gt;, hoặc &lt;b&gt;tám hoặc nhiều từ hơn&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Ví mã hóa</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Quá trình này cần cụm mật khẩu của bạn để mở khóa ví.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Mở khóa ví</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Quá trình này cần cụm mật khẩu của bạn để giải mã ví.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Giải mã ví</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Đổi cụm mật khẩu</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Nhập cụm mật khẩu cũ và cụm mật khẩu mới cho ví.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Xác nhận mã hóa ví</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>Cảnh báo: Nếu bạn mã hóa ví và mất cụm mật khẩu, bạn sẽ &lt;b&gt;MẤT TẤT CẢ BITCOIN&lt;/b&gt;!</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Bạn có chắc bạn muốn mã hóa ví của mình?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Ví đã được mã hóa</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 sẽ đóng lúc này để kết thúc quá trình mã hóa. Nhớ rằng việc mã hóa ví không thể bảo vệ hoàn toàn số bitcoins khỏi việc Malware lây nhiễm đến computer của bạn.</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>QUAN TRỌNG: Bất cứ backup nào bạn từng làm trước đây từ ví của bạn nên được thay thế tạo mới, file mã hóa ví. Vì lý do bảo mật, các backup trước đây của các ví chưa mã hóa sẽ bị vô tác dụng ngay khi bạn bắt đầu sử dụng mới, ví đã được mã hóa.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Quá trình mã hóa ví thất bại</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Quá trình mã hóa ví thất bại do một lỗi nội tại. Ví của bạn vẫn chưa được mã hóa.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Cụm mật khẩu được cung cấp không đúng.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Mở khóa ví thất bại</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Cụm mật khẩu đã nhập để giải mã ví không đúng.</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Giải mã ví thất bại</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Cụm mật khẩu thay đổi thành công.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Cảnh báo: chữ Viết Hoa đang bật!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Cấm Đến</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Chữ ký &amp;lời nhắn...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Đồng bộ hóa với network...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Tổng quan</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Hiển thị tổng quan ví</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Các Giao Dịch</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Trình duyệt lịch sử giao dịch</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>T&amp;hoát</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Đóng ứng dụng</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Khoảng %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Hiện thông tin khoảng %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Về &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Hiện thông tin về Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Tùy chọn...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Sửa đổi tùy chỉnh cấu hình cho %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Mã Hóa Ví...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Backup Ví...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Thay Đổi Cụm Mật Khẩu...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Địa chỉ đang gửi...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>&amp;Địa chỉ đang nhận...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Mở &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Click để vô hiệu hoạt động mạng.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Hoạt động mạng được vô hiệu.</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Click để mở hoạt động mạng trở lại.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Đồng bộ hóa tiêu đề (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Khôi phục các khối trên ổ đĩa...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Gửi coin đến một địa chỉ Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Backup ví đến một địa chỉ khác</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Thay đổi cụm mật khẩu cho ví đã mã hóa</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Debug window</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Mở trình gỡ lỗi và giao diện điều chỉnh chẩn đoán</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Lời nhắn xác nhận...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Ví</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Gửi</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Nhận</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>&amp;Hiển thị / Ẩn</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Hiện hoặc ẩn cửa sổ chính</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Mã hóa private key thuộc về ví của bạn</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Đăng ký lời nhắn với địa chỉ Bitcoin của bạn để chứng minh quyền sở hữu chúng</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Xác minh lời nhắn để chắc chắn đã được đăng ký với địa chỉ Bitcoin xác định</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;File</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Settings</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>&amp;Help</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Các thanh công cụ</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Yêu cầu thanh toán (tạo QR code và bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Hiển thị danh sách các địa chỉ và nhãn đã dùng để gửi</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Hiển thị danh sách các địa chỉ và nhãn đã dùng để nhận</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Mở một bitcoin: URI hoặc yêu cầu thanh toán</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>&amp;Tùy chỉnh Command-line </translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n kết nối đến Bitcoin network</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Khối đang được ghi nhận trên đĩa...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Khối đang được xử lý trên đĩa...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Hoàn thành %n khối của lịch sử giao dịch.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 phia sau</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Khối nhận cuối cùng đã được tạo %1.</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Các giao dịch sau giao dịch này sẽ không được hiển thị.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Lỗi</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Cảnh báo</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Thông tin</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Đã cập nhật</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Hiển thị %1 tin nhắn hỗ trợ để nhận được danh sách Bitcoin command-line khả dụng</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 khách</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Đang kết nối đến peers...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Đang bắt kịp...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Ngày %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Số lượng: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Loại: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Nhãn: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Địa chỉ: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Giao dịch đã gửi</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Giao dịch đang nhận</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>Khởi tạo HD key &lt;b&gt;enabled&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>Khởi tạo HD key &lt;b&gt;disabled&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Ví thì &lt;b&gt;encrypted&lt;/b&gt; và hiện tại &lt;b&gt;unlocked&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Ví thì &lt;b&gt;encrypted&lt;/b&gt; và hiện tại &lt;b&gt;locked&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>Một lỗi nghiêm trọng vừa xảy ra. Bitcoin có thể không còn tiếp tục an toàn và sẽ bị bỏ.</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>Lựa chọn Coin</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Số lượng:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Số lượng:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Phí:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Rác:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Sau Phí:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Thay đổi:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(không)chọn tất cả</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Tree mode</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>List mode</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Số lượng</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>Đã nhận với nhãn</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>Đã nhận với địa chỉ</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Ngày</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Xác nhận</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Đã xác nhận</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Sao chép địa chỉ</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Sao chép nhãn</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Sao chép số lượng</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Sao chép ID giao dịch</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>Khóa unspent</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>Mở khóa unspent</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Sao chép số lượng</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Sao chép phí</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Sao chép sau phí</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Sao chép bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Sao chép rác</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Sao chép thay đổi</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(%1 đã khóa)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>có</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>không</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>Label này chuyển sang đỏ nếu bất cứ giao dịch nhận nào có số lượng nhỏ hơn ngưỡng dust.</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>Có thể thay đổi +/-%1 satoshi(s) trên input.</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(không nhãn)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>change từ %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(change)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Edit Address</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>Nhãn dữ liệu</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>Label liên kết với list address ban đầu này</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>Label liên kết với list address ban đầu này. Điều này chỉ được điều chỉnh cho địa chỉ gửi.</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>Địa chỉ</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>Address đang nhận mới</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>Address đang gửi mới</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>Edit address đang nhận</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>Edit address đang gửi</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>Address đã nhập \"%1\" không valid Bitcoin address.</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>Address đã nhập \"%1\" đã có trong address book.</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>Không thể unlock wallet.</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>Khởi tạo key mới thất bại.</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>Một danh mục dữ liệu mới sẽ được tạo.</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>tên</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>Danh mục đã tồn tại. Thêm %1 nếu bạn dự định creat một danh mục mới ở đây.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>Path đã tồn tại, và không là danh mục.</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>Không thể create dữ liệu danh mục tại đây.</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>phiên bản</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>About %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>Command-line options</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Usage:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>command-line options</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>Tùy chỉnh UI:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>Chọn dữ liệu danh mục trên startup (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Cài đặt ngôn ngữ, ví dụ \"de_DE\" (default: system locale)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>Khởi tạo tối thiểu</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Đặt chứng chỉ SSL root certificates cho payment request (default: -system-)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>Hiển thị splash screen trên startup (default: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>Reset tất cả cài đặt thay đổi trong GUI</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Welcome</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>Welcome to %1.</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>Đây là lần đầu chương trình khởi chạy, bạn có thể chọn nơi %1 sẽ lưu trữ data.</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>Khi bạn click OK, %1 sẽ bắt đầu download và process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>Đồng bộ hóa ban đầu này rất đòi hỏi, và có thể phơi bày các sự cố về phần cứng với máy tính của bạn trước đó đã không được chú ý. Mỗi khi bạn chạy %1, nó sẽ tiếp tục tải về nơi nó dừng lại.</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>Nếu bạn đã chọn giới hạn block chain lưu trữ (pruning),dữ liệu lịch sử vẫn phải được tải xuống và xử lý, nhưng sẽ bị xóa sau đó để giữ cho việc sử dụng đĩa của bạn ở mức usage thấp.</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Sử dụng default danh mục đa ta</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>Sử dụng custom danh mục data:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>Ít nhất %1 GB data sẽ được trữ tại danh mục này, và nó sẽ lớn theo thời gian.</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>Gần đúng %1 GB of data sẽ được lưu giữ trong danh mục này.</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 sẽ download và lưu trữ một bản copy của Bitcoin block chain.</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>Wallet sẽ cùng được lưu giữ trong danh mục này.</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>Error: Danh mục data xác định \"%1\" không thể được tạo.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Lỗi</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>%n GB of free space available</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(of %n GB cần thiết)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>Giao dịch gần đây có thể chưa được hiển thị, và vì vậy số dư wallet của bạn có thể không dúng. Thông tin này sẽ được làm đúng khi wallet hoàn thành đồng bộ với bitcoin network, như chi tiết bên dưới.</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>Cố gắng spend các bitcoins bị ảnh hưởng bởi các giao dịch chưa được hiển thị sẽ không được chấp nhận bởi mạng.</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>Số của blocks còn lại</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>Unknown...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Thời gian block cuối cùng</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>Tiến độ</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>Tiến độ tăng mỗi giờ</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>Đang tính...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>Ước tính thời gian còn lại đến khi đồng bộ</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ẩn</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>Unknown. Đang đồng bộ Headers (%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Mở URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>Mở payment request từ URI hoặc file</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>Chọn payment request file</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>Chọn file payment request để mở</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Tùy chỉnh</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Chính</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>Tự động bắt đầu %1 sau khi đăng nhập vào system.</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>&amp;Bắt đầu %1 trên đăng nhập system</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>Size of &amp;database cache</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>Number of script &amp;verification threads</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>Hiển thị nếu cung cấp default SOCKS5 proxy is used to reach peers via this network type.</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>Minimize thay vì thoát khỏi ứng dụng khi cửa sổ đóng lại. Khi bật tùy chọn này, ứng dụng sẽ chỉ được đóng sau khi chọn Exit trong menu.</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>Bên thứ ba URLs (e.g. a block explorer) xuất hiện trong thẻ giao dịch như context menu items. %s in the URL thì được thay thế bởi transaction hash. Multiple URLs are separated by vertical bar |.</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>Bật tùy chọn command-line ghi đè các tùy chọn ở trên:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>Mở %1 configuration file từ danh mục làm việc working directory.</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>Mở File cấu hình</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>Reset tất cả client options to default.</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>&amp;Reset Tùy chọn</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>&amp;Network</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = auto, &lt;0 = leave that many cores free)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>W&amp;allet</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>Expert</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>Enable coin &amp;control features</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>&amp;Spend unconfirmed change</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>Map port using &amp;UPnP</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Kết nối đến Bitcoin network qua một SOCKS5 proxy.</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>&amp;Connect qua SOCKS5 proxy (default proxy):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Port:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Port of the proxy (e.g. 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>Sử dụng reaching peers via:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>Kết nối đến Bitcoin network qua một nhánh rời SOCKS5 proxy của Tor hidden services.</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>&amp;Window</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>Hiển thị chỉ thẻ icon sau khi thu nhỏ cửa sổ.</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>&amp;Minimize đến thẻ thay vì taskbar</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>M&amp;inimize on close</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Display</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Giao diện người dùng &amp;language:</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>Giao diện ngôn ngữ người dùng có thể được thiết lập tại đây. Tùy chọn này sẽ có hiệu lực sau khi khởi động lại %1.</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>&amp;Unit để hiện số lượng tại đây:</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>Chọn default đơn vị phân chia để hiện giao diện và đang gửi coins.</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>Cho hiển thị tính năng coin control hoặc không.</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Hủy</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>default</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>không có gì</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>Confirm tùy chọn reset</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>Client yêu cầu khởi động lại để thay đổi có hiệu lực.</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>Client sẽ đóng lại. Tiếp tục chứ?</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>Tùy chọn cấu hình</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>File cấu hình được sử dụng để chỉ định các tùy chọn nâng cao của người dùng mà ghi đè GUI settings. Ngoài ra, bất kỳ tùy chọn dòng lệnh sẽ ghi đè lên tập tin cấu hình này.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Lỗi</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>Không thẻ mở tệp cấu hình.</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>Việc change này sẽ cần một client restart.</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>Cung cấp proxy address thì invalid.</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>Thông tin được hiển thị có thể đã lỗi thời. Cái wallet tự động đồng bộ với Bitcoin network sau một connection được thiết lập, nhưng quá trình này vẫn chưa completed yet.</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>Chỉ-xem:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Có hiệu lực:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>Số dư khả dụng:</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Đang xử lý:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>Tất cả giao dịch vẫn chưa được confirmed, và chưa tính vào số dư có thể chi tiêu</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>Chưa hoàn thiện:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>Mined balance chưa matured hẳn</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>Số dư</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Tổng cộng:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>Tổng số dư hiện tại</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>Số dư hiện tại trong địa chỉ watch-only</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>Có thể sử dụng</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>Giao dịch gần đây</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>Giao dịch chưa được xác nhận đến watch-only addresses</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>Mined số dư trong watch-only address chưa matured hẳn</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>Tổng số dư hiện tại trong watch-only addresses</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>Payment request error</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>Không thể khởi tạo bitcoin: click-to-pay handler</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI handling</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>Payment request dẫn đến URL thì invalid: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>Invalid payment address %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>URI không thể phân tích cú pháp! Đây có thể gây nên bởi invalid Bitcoin address hoặc URI không đúng định dạng tham số.</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>Payment request file đang xử lý</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>Payment request file không thể đọc! Đây có thể gây ra bởi một invalid payment request file.</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>Payment request bị từ chối</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>Payment request network chưa đúng với client network.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Payment request hết hạn.</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>Payment request đã không được khởi tạo.</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>Chưa xác nhận payment request đến custom payment scripts không được hỗ trợ.</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>Invalid payment request.</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>Yêu cầu payment với lượng của %1 thì quá nhỏ (xem như dust).</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>Refund từ %1</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>Payment request %1 thì quá lớn (%2 bytes, cho phép %3 bytes).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>Error giao thức với %1: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>Payment request không thể giải!</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>Phản hồi xấu từ server %1</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>Mạng request error</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>Payment được thừa nhận</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Đặc Vụ</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>Node/Dịch vụ</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>NodeID</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Gửi</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Nhận</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Số lượng</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>Nhập một Bitcoin address (e.g. %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 d</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 giờ</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 phút</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 giây</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>None</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 ms</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n giây</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n phút</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n giờ</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n ngày</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n tuần</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 và %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n năm</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 vẫn chưa thoát an toàn...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>unknown</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>Error: Xác định data directory \"%1\" không tồn tại.</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>Error: Không thể parse configuration file: %1. Chỉ dùng key=value syntax.</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>Error: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Lưu ảnh...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>&amp;Sao chép ảnh</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>Lưu QR Code</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG Image (*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>Client version</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>&amp;Thông tin</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>Debug window</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Tổng thể</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>Sử dụng phiên bản BerkeleyDB</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>Datadir</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>Startup lúc</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>Mạng</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Tên</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>Số lượng connections</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Block chain</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>Số blocks hiện tại</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>Pool Bộ Nhớ</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>Số giao dịch hiện tại</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>Bộ nhớ usage</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;Reset</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>Nhận</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Gửi</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>&amp;Peers</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>Bị khóa peers</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>Chọn một peer để xem thông tin chi tiết.</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>Whitelisted</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>Direction</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>Phiên bản</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>Block Bắt Đầu</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>Headers đã được đồng bộ</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>Blocks đã được đồng bộ</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User đặc vụ</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>Mở cái %1 debug log file từ danh mục dữ liệu hiện tại. Điều này cần vài giây cho large log files.</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>Giảm font size</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>Tăng font size</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>Dịch vụ</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>Cấm Score</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>Connection Thời Gian</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>Gửi Sau Cùng</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>Nhận Sau Cùng</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping Time</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>Thời hạn của một ping hiện đang nổi trội.</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping Chờ</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Ping Nhỏ Nhất</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>Thời gian Offset</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>Thời gian block cuối cùng</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>&amp;Open</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>&amp;BangDieuKhien</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>&amp;Network Traffic</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>Totals</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>In:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>Out:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>Debug file log</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>Xóa console</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 &amp;hour</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 &amp;day</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 &amp;week</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 &amp;year</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>&amp;Disconnect</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>Ban for</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>&amp;Unban</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>Welcome to the %1 RPC console.</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>Use up and down arrows to navigate history, and %1 to clear screen.</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>Network activity disabled</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(node id: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>via %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>không bao giờ</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>Inbound</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>Outbound</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Yes</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>No</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>Không biết</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>&amp;Amount:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Message:</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>Một optional lời nhắn để đính kèm đến payment request, cái mà sẽ được hiển thị khi mà request đang mở. Lưu ý: Tin nhắn này sẽ không được gửi với payment over the Bitcoin network.</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>Một optional label để liên kết với address đang nhận mới.</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Sử dụng form cho request thanh toán. Tất cả chỗ trống là &lt;b&gt;optional&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>Một optional giá trị để request. Để lại đây khoảng trống hoặc zero để không request một giá trị xác định.</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Xóa hết các khoảng trống của form.</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Xóa</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Yêu cầu lịch sử giao dịch</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Request payment</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>Hiển thị request đã chọn (does the same as double clicking an entry)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Hiển thị</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Xóa bỏ mục đang chọn từ danh sách</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Gỡ bỏ</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>Sao chép URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Sao chép nhãn</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Sao chép tin nhắn</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Sao chép số lượng</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Code</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Sao chép &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>Sao chép địa chỉ</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>&amp;Lưu ảnh...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Request payment đến %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Payment thông tin</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Địa chỉ</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Số lượng</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Tin nhắn</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>Đang tính toán URI quá dài, cố gắng giảm text cho label / message.</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Error đang mã hóa URI đến QR Code.</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Ngày</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Tin nhắn</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(không nhãn)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(no tin nhắn)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(không amount yêu cầu)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>Đã yêu cầu</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Gửi Coins</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Coin Control Tính-năng</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Đang nhập...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>được chọn một cách hoàn toàn tự động</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Không đủ tiền kìa!</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Số lượng:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Số lượng:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Phí:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Sau Phí:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Thay đổi:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>Nếu cái này được bật, nhưng việc change address thì trống hoặc invalid, change sẽ được gửi cho một address vừa được tạo mới.</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>Custom change address</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Transaction Fee:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Chọn...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>Sử dụng fallbackfee có thể dẫn đến hết quả đang gửi một transaction mà nó sẽ mất hàng giờ hoặc ngày (hoặc chẳng bao giờ) được confirm. Suy nghĩ chọn fee của bạn bình thường hoặc chờ cho đến khi validated hoàn thành chain.</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>Warning: Fee ước tính hiện tại không khả thi.</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>gộp fee-settings</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>trên mỗi kilobyte</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>Nếu the custom fee được đặt 1000 satoshis và the transaction chỉ 250 bytes, nên \"per kilobyte\" chỉ trả 250 satoshis trong fee, trong khi \"total at least\" trả 1000 satoshis. Để các giao dịch lớn hơn a kilobyte both pay by kilobyte.</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ẩn</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>Chi trả chỉ số nhỏ nhất fee thì ổn cho tới khi có ít transaction volume hơn khoảng trống trong blocks. Nhưng nhận ra rằng điều này kết thúc trong việc chẳng bao giờ xác nhận transaction trừ khi có nhiều nhu cầu cho giao dịch bitcoin hơn so với mạng có thể xử lý.</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(đọc cái tooltip)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>Khuyên dùng:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>Custom:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(Thông minh fee vẫn chưa được khởi tạo. Điều này thường mất vài blocks...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Gửi đến tập thể người nhận một lần</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Add &amp;Recipient</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Xóa hết các khoảng trống của form.</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>Rác:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>Thời gian xác nhận đối tượng:</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Clear &amp;All</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Số dư:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Confirm hành động gửi</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>S&amp;end</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>Sao chép số lượng</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Sao chép số lượng</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>Sao chép phí</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>Sao chép sau phí</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>Sao chép bytes</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>Sao chép rác</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>Sao chép thay đổi</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 blocks)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 đến%2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>Bạn chắc chắn muốn gửi chứ?</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>đã thêm transaction fee</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Tổng Số lượng %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>hoặc</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Confirm gửi coins</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>Địa chỉ người nhận address thì không valid. Kiểm tra lại đi.</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>Giả trị để pay cần phải lớn hơn 0.</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>Số tiền vượt quá số dư của bạn.</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>Tổng số lớn hơn số dư của bạn khi %1 transaction fee được tính vào.</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>Trùng address được tìm thấy: địa chỉ chỉ nên được dùng một lần.</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>Transaction khởi tạo thất bại!</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>The transaction đã bị từ chối với lý do sau: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>Một fee lớn hơn %1 được coi là ngớ ngẩn cao fee.</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>Payment request hết hạn.</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>Pay chỉ yêu cầu fee of %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>Dự kiến bắt đầu xác nhận trong vòng %n blocks.</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>Warning: Invalid Bitcoin address</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>Warning: Không biết change address</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>Confirm custom change address</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>The address bạn đã chọn dành cho change thì không phải part of this wallet. Bất kỳ hay tất cả funds in your wallet có thể được gửi đến address này. Bạn chắc chứ?</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(không nhãn)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>A&amp;mount:</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>Pay &amp;To:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Label:</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Chọn mới thì address</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>Đây là một thông thường payment.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>The Bitcoin address để gửi the payment đến</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Paste address từ clipboard</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>Xóa bỏ entry này</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>The fee sẽ được khấu trừ từ số tiền đang gửi. Người nhận sẽ receive ít bitcoins hơn bạn gõ vào khoảng trống. Nếu nhiều người gửi được chọn, fee sẽ được chia đều.</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>S&amp;ubtract fee từ amount</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>Tin nhắn:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>Đây là một chưa được chứng thực payment request.</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>Đây là một chưa được chứng thực payment request.</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>Nhập một label cho cái address này để thêm vào danh sách địa chỉ đã sử dụng</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>Một tin nhắn được đính kèm với số bitcoin: URI mà sẽ được lưu giữ với transaction dành cho tài liệu tham khảo. Lưu ý: Tin nhắn này sẽ không được gửi thông qua Bitcoin network.</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>Pay Đến:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>Bản ghi nhớ:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>Nhập một label cho address này để thêm vào address book</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Yes</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>%1 đang shutting down...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>Đừng tắt máy tính đến khi cửa sổ này đóng.</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>Chữ ký - Sign / Verify a Message</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>&amp;Sign Tin nhắn</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>Bạn có thể ký/đồng ý với địa chỉ chứng minh bạn có thể receive bitcoins đã gửi đến chúng. Cẩn thận không ký bất cứ không rõ hay random, như các cuộc tấn công lừa đảo có thể cố lừa bạn ký tên vào danh tính của bạn.. Chỉ ký các bản tuyên bố hoàn chỉnh mà bạn đồng ý.</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>The Bitcoin address để ký với tin nhắn</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>Chọn mới thì address</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>Paste address từ clipboard</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>Nhập tin nhắn bạn muốn ký tại đây</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>Signature</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>Copy hiện tại signature tới system clipboard</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>Ký tin nhắn để chứng minh bạn sở hữu Bitcoin address này</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>Sign &amp;Message</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>Reset tất cả khoảng chữ ký nhắn</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Clear &amp;All</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>&amp;Verify Tin nhắn</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>Nhập vào address người nhận, tin nhắn (chắc rằng bạn copy line breaks, khoảng trống, tabs, etc. chính xác) và signature bên dưới verify tin nhắn. Cẩn thận không đọc nhiều hơn từ signature so với cái được ký trong bản thân tin nhắn, để tránh bị lừa bới man-in-the-middle tấn công. Lưu ý rằng điều này chỉ chứng nhận nhóm những người nhân với address, nó không thể chứng minh bên gửi có bất kỳ transaction!</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>The Bitcoin address tin nhắn đã ký với</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>Verify tin nhắn để chắc rằng nó đã được ký với xác định Bitcoin address</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>Verify &amp;Message</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>Reset tất cả verify khoảng trống nhắn</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>Click \"Sign Message\" để generate signature</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>Đã nhập address thì invalid.</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>Vui lòng kiểm tra address và thử lại.</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>Đã nhập address không refer to a key.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>Wallet unlock đã được hủy.</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>Private key cho address đã nhập thì không có sẵn.</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>Message signing failed.</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>Message signed.</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>The signature could not be decoded.</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>Please check the signature and try again.</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>The signature did not match the message digest.</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>Message verification failed.</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>Message verified.</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Mở cho %n nhiều hơn blocks</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Open until %1</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>conflicted with a transaction with %1 confirmations</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1/offline</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/unconfirmed, %1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>in memory pool</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>not in memory pool</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>abandoned</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/unconfirmed</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 confirmations</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>Status</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>, has not been successfully broadcast yet</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>, broadcast qua %n nodes</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Ngày</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>Source</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>Generated</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>From</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>unknown</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>To</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>own address</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>watch-only</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>label</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>Credit</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>Hoàn thiện trong %n nhiều hơn blocks</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>not accepted</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>Debit</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>Total debit</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>Total credit</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>Transaction fee</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>Net amount</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Tin nhắn</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>Comment</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>Transaction ID</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>Transaction total size</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>Output index</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>Merchant</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>Debug information</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>Transaction</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>Inputs</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Giá trị</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>true</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>false</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>This pane shows a detailed description of the transaction</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>Details for %1</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>Ngày</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>Mở cho %n nhiều hơn blocks</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>Open until %1</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>Offline</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>Unconfirmed</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>Abandoned</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>Confirming (%1 of %2 recommended confirmations)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>Confirmed (%1 confirmations)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>Xung đột</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>Immature (%1 confirmations, will be available after %2)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>This block was not received by any other nodes and will probably not be accepted!</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>Generated but not accepted</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Received with</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>Received from</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Sent to</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>Payment to yourself</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Mined</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>watch-only</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(n/a)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(không nhãn)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>Transaction status. Hover over this field to show number of confirmations.</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>Date and time that the transaction was received.</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>Type of transaction.</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>Whether or not a watch-only address is involved in this transaction.</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>User-defined intent/purpose of the transaction.</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>Amount removed from or added to balance.</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>Tất cả</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>Hôm nay</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>Tuần này</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>Tháng này</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>Tháng trước</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>Năm nay</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>Range...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>Received with</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>Sent to</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>To yourself</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>Mined</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>Other</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>Min amount</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>Abandon transaction</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>Increase transaction fee</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>Copy address</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>Sao chép nhãn</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>Sao chép số lượng</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>Sao chép ID giao dịch</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>Copy raw transaction</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>Copy full transaction details</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>Edit label</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>Show transaction details</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>Export Transaction History</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Comma separated file (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Đã xác nhận</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>Watch-only</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Ngày</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>Type</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Địa chỉ</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Xuất Thất Bại</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>There was an error trying to save the transaction history to %1.</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>Exporting Successful</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>The transaction history was successfully saved to %1.</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>Range:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>to</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>Unit to show amounts in. Click to select another unit.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>No wallet has been loaded.</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Gửi Coins</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>Fee bơm error</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>Increasing transaction fee failed</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>Do you want to increase the fee?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>Current fee:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>Increase:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>New fee:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>Confirm fee bump</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>Can't sign transaction.</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>Could not commit transaction</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Xuất</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Xuất dữ liệu trong thẻ hiện tại ra file</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>Backup Wallet</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>Wallet Data (*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>Backup Failed</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>There was an error trying to save the wallet data to %1.</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>Backup Successful</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>The wallet data was successfully saved to %1.</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Options:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>Specify data directory</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>Connect to a node to retrieve peer addresses, and disconnect</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>Specify your own public address</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>Accept command line and JSON-RPC commands</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>Distributed under the MIT software license, see the accompanying file %s or %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>Prune configured below the minimum of %d MiB.  Please use a higher number.</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>Error: A fatal internal error occurred, see debug.log for details</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>Fee (in %s/kB) to add to transactions you send (default: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>Pruning blockstore...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>Run in the background as a daemon and accept commands</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>Unable to start HTTP server. See debug log for details.</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>The %s developers</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>Bind to given address and always listen on it. Use [host]:port notation for IPv6</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>Cannot obtain a lock on data directory %s. %s is probably already running.</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>Extra transactions to keep in memory for compact block reconstructions (default: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>Please contribute if you find %s useful. Visit %s for further information about the software.</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>This is the transaction fee you may discard if change is smaller than dust at this level</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>Wallet will not create transactions that violate mempool chain limits (default: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>Whether to save the mempool on shutdown and load on restart (default: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>%d of last 100 blocks have unexpected version</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s corrupt, salvage failed</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool must be at least %d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; can be:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>Accept connections from outside (default: 1 if no -proxy or -connect)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>Append comment to the user agent string</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>Attempt to recover private keys from a corrupt wallet on startup</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>Block creation options:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>Cannot resolve -%s address: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>Chain selection options:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>Change index out of range</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>Connection options:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>Copyright (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>Corrupted block database detected</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>Debugging/Testing options:</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>Do not load the wallet and disable wallet RPC calls</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>Do you want to rebuild the block database now?</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>Enable publish hash block in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>Enable publish hash transaction in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>Enable publish raw block in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>Enable publish raw transaction in &lt;address&gt;</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>Enable transaction replacement in the memory pool (default: %u)</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>Error initializing block database</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>Error initializing wallet database environment %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>Error loading %s</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>Error loading %s: Wallet corrupted</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>Error loading %s: Wallet requires newer version of %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>Error loading block database</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>Error opening block database</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>Error: Disk space is low!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>Failed to listen on any port. Use -listen=0 if you want this.</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>Importing...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>Incorrect or no genesis block found. Wrong datadir for network?</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>Initialization sanity check failed. %s is shutting down.</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>Invalid amount for -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>Loading P2P addresses...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>Loading banlist...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>Location of the auth cookie (default: data dir)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>Not enough file descriptors available.</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>Print this help message and exit</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>Print version and exit</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>Prune cannot be configured with a negative value.</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>Prune mode is incompatible with -txindex.</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>Rebuild chain state and block index from the blk*.dat files on disk</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>Rebuild chain state from the currently indexed blocks</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>Replaying blocks...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>Rewinding blocks...</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>Set database cache size in megabytes (%d to %d, default: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>Specify wallet file (within data directory)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>The source code is available from %s.</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>Transaction fee and change calculation failed</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>Unable to bind to %s on this computer. %s is probably already running.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>Unsupported argument -benchmark ignored, use -debug=bench.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>Unsupported argument -debugnet ignored, use -debug=net.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>Unsupported argument -tor found, use -onion.</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>Unsupported logging category %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>Upgrading UTXO database</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>Use UPnP to map the listening port (default: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>Use the test chain</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>User Agent comment (%s) contains unsafe characters.</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>Verifying blocks...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>Wallet debugging/testing options:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>Wallet needed to be rewritten: restart %s to complete</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>Wallet options:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>Error: Listening for incoming connections failed (listen returned error %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maximum size of data in data carrier transactions we relay and mine (default: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>The transaction amount is too small to send after the fee has been deducted</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(default: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>Accept public REST requests (default: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>Automatically create Tor hidden service (default: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>Connect through SOCKS5 proxy</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>Error loading %s: You can't disable HD on an already existing HD wallet</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>Error reading from database, shutting down.</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>Error upgrading chainstate database</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>Imports blocks from external blk000??.dat file on startup</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Thông tin</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>Invalid -onion address or hostname: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>Invalid -proxy address or hostname: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>Invalid netmask specified in -whitelist: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>Need to specify a port with -whitebind: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>Node relay options:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC server options:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>Reducing -maxconnections from %d to %d, because of system limitations.</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>Rescan the block chain for missing wallet transactions on startup</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>Send trace/debug info to console instead of debug.log file</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>Show all debugging options (usage: --help -help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>Shrink debug.log file on client startup (default: 1 when no -debug)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>Signing transaction failed</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>The transaction amount is too small to pay the fee</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>This is experimental software.</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Tor control port password (default: empty)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>Tor control port to use if onion listening enabled (default: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>Transaction amount too small</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>Transaction too large for fee policy</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Transaction too large</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>Unable to bind to %s on this computer (bind returned error %s)</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>Upgrade wallet to latest format on startup</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>Username for JSON-RPC connections</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>Verifying wallet(s)...</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Cảnh báo</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>Warning: unknown new rules activated (versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>Whether to operate in a blocks only mode (default: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>You need to rebuild the database using -reindex to change -txindex</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>Zapping all transactions from wallet...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ notification options:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>Password for JSON-RPC connections</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>Execute command when the best block changes (%s in cmd is replaced by block hash)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>Allow DNS lookups for -addnode, -seednode and -connect</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>Error loading %s: You can't enable HD on an already existing non-HD wallet</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>How thorough the block verification of -checkblocks is (0-4, default: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>Support filtering of blocks and transaction with bloom filters (default: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>This is the transaction fee you may pay when fee estimates are not available.</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s is set very high!</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(default: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>Always query for peer addresses via DNS lookup (default: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>Error loading wallet %s. -wallet filename must be a regular file.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>Error loading wallet %s. Duplicate -wallet filename specified.</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>Error loading wallet %s. Invalid characters in -wallet filename.</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>How many blocks to check at startup (default: %u, 0 = all)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>Include IP addresses in debug output (default: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>Keypool ran out, please call keypoolrefill first</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>Maintain at most &lt;n&gt; connections to peers (default: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>Make the wallet broadcast transactions</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>Prepend debug output with timestamp (default: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Relay and mine data carrier transactions (default: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>Relay non-P2SH multisig (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>Set key pool size to &lt;n&gt; (default: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>Set maximum BIP141 block weight (default: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>Set the number of threads to service RPC calls (default: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>Specify configuration file (default: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>Specify connection timeout in milliseconds (minimum: 1, default: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>Specify pid file (default: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>Spend unconfirmed change khi đang gửi transactions (default: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>Starting network threads...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>Wallet sẽ hủy thanh toán nhỏ hơn phí relay.</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>Đây là minimum transaction fee bạn pay cho mỗi transaction.</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>Đây là transaction fee bạn sẽ pay nếu gửi transaction.</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>Ngường ngắt kết nối không hoạt động peers (default: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>Transaction amounts phải không âm</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>Transaction có chuỗi mempool chain quá dài</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>Transaction phải có ít nhất một người nhận</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>Unknown network được xác định trong -onlynet: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Không đủ tiền</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Đang tải block index...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Loading wallet...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Không thể downgrade wallet</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Rescanning...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Done loading</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Lỗi</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_vi_VN.ts",
    "content": "<TS language=\"vi_VN\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>Nhấn chuột phải để sửa địa chỉ hoặc nhãn</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>Tạo một địa chỉ mới</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>&amp;Tạo mới</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>Copy địa chỉ được chọn vào clipboard</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>&amp;Copy</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>Đó&amp;ng</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>Xóa địa chỉ hiện tại từ danh sách</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>Xuất dữ liệu trong mục hiện tại ra file</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Xuất</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>&amp;Xóa</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>Chọn địa chỉ để gửi coin đến</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>Chọn địa chỉ để nhận coin</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>Chọn</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>Địa chỉ gửi đến</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>Địa chỉ nhận</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>Đây là các địa chỉ Bitcoin để gửi bạn gửi tiền. Trước khi gửi bạn nên kiểm tra lại số tiền bạn muốn gửi và địa chỉ bitcoin của người nhận.</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>Đây là các địa chỉ Bitcoin để bạn nhận tiền. Với mỗi giao dịch, bạn nên dùng một địa chỉ Bitcoin mới để nhận tiền.</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>&amp;Chép Địa chỉ</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>Chép &amp;Nhãn</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>&amp;Sửa</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>Xuất Danh Sách Địa Chỉ</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Các tệp tác nhau bằng đấu phẩy (* .csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Xuất không thành công</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Địa chỉ</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(không nhãn)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>Hội thoại Passphrase</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>Điền passphrase</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>Passphrase mới</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>Điền lại passphrase</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>Hiện mật khẩu</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>Nhập passphrase mới cho Ví của bạn.&lt;br/&gt;Vui long dùng  passphrase gồm&lt;b&gt;ít nhất 10 ký tự bất kỳ &lt;/b&gt;, hoặc &lt;b&gt;ít nhất 8 chữ&lt;/b&gt;.</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>Mã hóa ví</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>Thao tác này cần cụm từ mật khẩu để mở khóa ví.</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>Mở khóa ví</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>Thao tác này cần cụm mật khẩu ví của bạn để giải mã ví.</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>Giải mã ví</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>Đổi cụm mật khẩu</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>Nhập cụm từ mật khẩu cũ và cụm mật khẩu mới vào ví.</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>Xác nhận mã hóa ví</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>Bạn có chắc chắn muốn mã hóa ví của bạn?</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>Ví đã được mã hóa</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>QUAN TRỌNG: Bất kỳ bản sao lưu trước nào bạn đã làm từ tệp ví tiền của bạn phải được thay thế bằng tệp ví tiền mới được tạo và mã hóa. Vì lý do bảo mật, các bản sao lưu trước đó của tệp ví tiền không được mã hóa sẽ trở nên vô dụng ngay khi bạn bắt đầu sử dụng ví đã được mã hóa.</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>Mã hóa ví không thành công</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>Mã hóa ví không thành công do có lỗi bên trong.\nVí của bạn chưa được mã hóa.</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>Cụm mật khẩu được cung cấp không khớp.</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>Mở khóa ví không thành công</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>Cụm từ mật mã nhập vào không đúng</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>Giải mã ví không thành công</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>Cụm từ mật khẩu mã hóa của ví đã được thay đổi.</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>Chú ý: Caps Lock đang được bật!</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/Netmask</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>Bị cấm đến</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>Chứ ký &amp; Tin nhắn...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>Đồng bộ hóa với mạng</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>&amp;Tổng quan</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>Node</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>Hiện thỉ thông tin sơ lược chung về Ví</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>&amp;Giao dịch</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>Duyệt tìm lịch sử giao dịch</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>T&amp;hoát</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>Thoát chương trình</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>&amp;Thông tin về %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>Hiện thông tin về %1</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>Về &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>Xem thông tin về Qt</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>&amp;Tùy chọn...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>Chỉnh sửa thiết đặt tùy chọn cho %1</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>&amp;Mã hóa ví tiền</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>&amp;Sao lưu ví tiền...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>&amp;Thay đổi mật khẩu...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>&amp;Địa chỉ gửi</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>Địa chỉ nhận</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>Mở &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>Nhấp để vô hiệu hóa kết nối mạng.</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>Kết nối mạng đã bị ngắt</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>Nhấp để kết nối lại mạng.</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>Đồng bộ hóa các Headers (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>Đánh chỉ số (indexing) lại các khối (blocks) trên ổ đĩa ...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>Gửi coins đến tài khoản Bitcoin</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>Sao lưu ví tiền ở vị trí khác</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>Thay đổi cụm mật mã dùng cho mã hoá Ví</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>&amp;Cửa sổ xử lý lỗi (debug)</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>Mở trình gỡ lỗi và bảng lệnh chuẩn đoán</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>&amp;Tin nhắn xác thực</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>Ví</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>&amp;Gửi</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>&amp;Nhận</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>Ẩn / H&amp;iện</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>Hiện hoặc ẩn cửa sổ chính</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>Mã hoá các khoá bí mật trong Ví của bạn.</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>Dùng địa chỉ Bitcoin của bạn ký các tin nhắn để xác minh những nội dung tin nhắn đó là của bạn.</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>Kiểm tra các tin nhắn để chắc chắn rằng chúng được ký bằng các địa chỉ Bitcoin xác định.</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>&amp;File</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>&amp;Thiết lập</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>Trợ &amp;giúp</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>Thanh công cụ (toolbar)</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>Yêu cầu thanh toán(tạo mã QR và địa chỉ Bitcoin: URLs)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>Hiện thỉ danh sách các địa chỉ và nhãn đã dùng để gửi.</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>Hiện thỉ danh sách các địa chỉ và nhãn đã dùng để nhận.</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>Mở bitcoin:URL hoặc yêu cầu thanh toán</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>7Tùy chọn dòng lệnh</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n liên kết hoạt động với mạng lưới Bitcoin</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>Đang lập chỉ mục các khối trên ổ đĩa</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>Đang xử lý các khối trên ổ đĩa...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>Đã xử lý %n khối của lịch sử giao dịch.</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>%1 chậm trễ</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>Khối (block) cuối cùng nhận được cách đây %1</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>Những giao dịch sau đó sẽ không hiện thị.</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Lỗi</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Chú ý</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Thông tin</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>Đã cập nhật</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>Hiển thị tin nhắn trợ giúp %1 để có được danh sách với các tùy chọn dòng lệnh Bitcoin.</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>Kết nối với các máy ngang hàng...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>Bắt kịp...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>Ngày: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>Số lượng: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>Loại: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>Nhãn hiệu: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>Địa chỉ: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>Giao dịch đã gửi</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>Giao dịch đang tới</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>Ví tiền &lt;b&gt; đã được mã hóa&lt;/b&gt;và hiện &lt;b&gt;đang mở&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>Ví tiền &lt;b&gt; đã được mã hóa&lt;/b&gt;và hiện &lt;b&gt;đang khóa&lt;/b&gt;</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Quantity:</source>\n        <translation>Lượng:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Lượng:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Phí:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Sau thuế, phí:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Thay đổi:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(bỏ)chọn tất cả</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>Chế độ cây</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>Chế độ danh sách</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Lượng</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>Ngày tháng</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>Lần xác nhận</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>Đã xác nhận</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(không nhãn)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>Thay đổi địa chỉ</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>Địa chỉ</translation>\n    </message>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>name</source>\n        <translation>tên</translation>\n    </message>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>version</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1-bit)</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>&amp;Tùy chọn dòng lệnh</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>Mức sử dụng</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>tùy chọn dòng lệnh</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>Chọn ngôn ngữ, ví dụ \"de_DE\" (mặc định: Vị trí hệ thống)</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>Đặt chứng nhận SSL gốc cho yêu cầu giao dịch (mặc định: -hệ thống-)</translation>\n    </message>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>Chào mừng</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>Sử dụng vị trí dữ liệu mặc định</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Lỗi</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ẩn</translation>\n    </message>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>Mở URI</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>Lựa chọn</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>&amp;Chính</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>Địa chỉ IP của proxy (ví dụ IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>Ví</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>Kết nối đến máy chủ Bitcoin thông qua SOCKS5 proxy.</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>Proxy &amp;IP:</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>&amp;Cổng:</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>Cổng proxy (e.g. 9050) </translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>&amp;Hiển thị</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>Giao diện người dùng &amp; ngôn ngữ</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>&amp;OK</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>&amp;Từ chối</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>mặc định</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>Trống</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Lỗi</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>Form</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>Khả dụng</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>Đang chờ</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>Tổng:</translation>\n    </message>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Đã gửi</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>Lượng</translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 và %2</translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>$Lưu hình ảnh...</translation>\n    </message>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>&amp;Information</source>\n        <translation>Thông tin</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>Nhìn Chung</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>Tên</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>Block chain</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>Đã gửi</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>User Agent</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1&amp;giờ</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1&amp;ngày</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1&amp;tuần</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1&amp;năm</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>không bao giờ</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>Đồng ý</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>Không</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>Lượng:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Nhãn</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>&amp;Tin nhắn:</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>Sử dụng form này để yêu cầu thanh toán. Tất cả các trường &lt;b&gt;không bắt buộc&lt;b&gt;</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Xóa tất cả các trường trong biểu mẫu</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>Xóa</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>Lịch sử yêu cầu thanh toán</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>&amp;Yêu cầu thanh toán</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>Hiển thị</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>Xóa khỏi danh sách</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>Xóa</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>Copy tin nhắn</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Code</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>Copy &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>&amp;Copy Địa Chỉ</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>$Lưu hình ảnh...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>Yêu cầu thanh toán cho %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>Thông tin thanh toán</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Địa chỉ</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Lượng</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Tin nhắn</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>Lỗi khi encode từ URI thành QR Code</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>Tin nhắn</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(không nhãn)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(không tin nhắn)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Gửi Coins</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>Tính năng Control Coin</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>Nhập...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>Tự động chọn</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>Không đủ tiền</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>Lượng:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>Bytes:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>Lượng:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>Phí:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>Sau thuế, phí:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>Thay đổi:</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>Phí giao dịch</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>Chọn...</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>Thu gọn fee-settings</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>trên KB</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>Ẩn</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(Đọc hướng dẫn)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>Gửi đến nhiều người nhận trong một lần</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>Thêm &amp;Người nhận</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>Xóa tất cả các trường trong biểu mẫu</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Xóa &amp;Tất cả</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>Tài khoản</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>Xác nhận sự gửi</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 đến %2</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>Tổng cộng %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>hoặc</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>Xác nhận gửi coins</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(không nhãn)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>Lượng:</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>&amp;Nhãn</translation>\n    </message>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>Đồng ý</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>Xóa &amp;Tất cả</translation>\n    </message>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Message</source>\n        <translation>Tin nhắn</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>Lượng</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(không nhãn)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>Các tệp tác nhau bằng đấu phẩy (* .csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>Nhãn</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>Địa chỉ</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>Xuất không thành công</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>Gửi Coins</translation>\n    </message>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>&amp;Xuất</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>Lựa chọn:</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(mặc định: %u)</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>Thông tin</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>Giao dịch quá lớn</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>Chú ý</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(mặc định: %s)</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>Không đủ tiền</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>Đang đọc block index...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>Đang đọc ví...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>Không downgrade được ví</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>Đang quét lại...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>Đã nạp xong</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>Lỗi</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_zh-Hans.ts",
    "content": "<TS language=\"zh-Hans\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>右击编辑地址或标签</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>创建一个新的地址</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>新建</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>复制选定的地址到系统剪切板</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>复制</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>关闭</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>从列表删除选定的地址</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>导出当前数据到文件</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>导出</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>删除</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>选择发送比特币地址</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>选择接收比特币地址</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>选择</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>发送地址</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>接收地址</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>这是你的比特币发币地址。发送前请确认发送数量和接收地址</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>这是你的比特币接收地址。建议每次交易都使用新地址</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>复制地址</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>复制标签</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>编辑</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>导出地址列表</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>逗号分隔文件(*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>导出失败</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>保存地址列表至%1时发生错误，请重试。</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>标签</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(无标签)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>加密钱包</translation>\n    </message>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(无标签)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Label</source>\n        <translation>标签</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>标签</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(无标签)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(无标签)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>标签</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(无标签)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>逗号分隔文件(*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>标签</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>导出失败</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>导出</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>导出当前数据到文件</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    </context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_zh.ts",
    "content": "<TS language=\"zh\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>右键单击来编辑地址或者标签</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>创建一个新地址</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>复制当前已选地址到系统剪切板</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>从列表中删除当前已选地址</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>将当前选项卡中的数据导出到文件</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>选择想要发送币的地址</translation>\n    </message>\n    </context>\n<context>\n    <name>AddressTableModel</name>\n    </context>\n<context>\n    <name>AskPassphraseDialog</name>\n    </context>\n<context>\n    <name>BanTableModel</name>\n    </context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Error</source>\n        <translation>错误</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Error</source>\n        <translation>错误</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Error</source>\n        <translation>错误</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    </context>\n<context>\n    <name>QObject</name>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    </context>\n<context>\n    <name>RPCConsole</name>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>余额不足</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>选择...</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>收款人地址无效，请再次确认。</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>仅支付全额的%1</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Sugarchain address</source>\n        <translation>警告：糖链地址无效</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>将当前选项卡中的数据导出到文件</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>根据费率标准，本次转账超额</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>超额转账</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>余额不足</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>正在载入钱包...</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>再次扫描...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>载入完成</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>错误</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_zh_CN.ts",
    "content": "<TS language=\"zh_CN\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>鼠标右击编辑地址或标签</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>创建新地址</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>新建(&amp;N)</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>复制当前选中的地址到系统剪贴板</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>复制(&amp;C)</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>关闭(&amp;l)</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>从列表中删除选中的地址</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>将当前标签页数据导出到文件</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>导出(&amp;E)</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>删除(&amp;D)</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>选择要付钱过去的地址</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>选择要收钱进来的地址</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>选择</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>付款地址</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>收款地址</translation>\n    </message>\n    <message>\n        <source>These are your Sugarchain addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>这些是你要付款过去的糖链地址。在付钱之前，务必要检查金额和收款地址是否正确。</translation>\n    </message>\n    <message>\n        <source>These are your Sugarchain addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>这些是你用来收款的糖链地址。建议在每次交易时，都使用一个新的收款地址。</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>复制地址</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>复制标签</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>编辑</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>导出地址列表</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>逗号分隔文件 (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>导出失败</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>存储地址列表到 %1 时发生错误。请再试一次。</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>标签</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>地址</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(无标签)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>密码对话框</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>输入密码</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>新密码</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>重复新密码</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>显示密码</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>输入钱包的新密码。&lt;br/&gt;密码请用&lt;b&gt;10 个以上的随机字符&lt;/b&gt;，或是&lt;b&gt;8 个以上的字词&lt;/b&gt;。</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>加密钱包</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>这个操作需要你的钱包密码来解锁钱包。</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>解锁钱包</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>这个操作需要你的钱包密码来把钱包解密。</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>解密钱包</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>修改密码</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>请输入钱包的旧密码和新密码。</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>确认钱包加密</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR SUGARCHAINS&lt;/b&gt;!</source>\n        <translation>警告: 如果把钱包加密后又忘记密码，你就会从此&lt;b&gt;失去其中所有的糖链了&lt;/b&gt;！</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>你确定要把钱包加密吗？</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>钱包已加密</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your sugarchains from being stolen by malware infecting your computer.</source>\n        <translation>%1 现在要关闭，以完成加密过程。请注意，加密钱包不能完全防止入侵你的电脑的恶意程序偷取钱币。</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>重要: 请改用新产生的有加密的钱包文件，来取代旧钱包文件的备份。为了安全性，当你开始使用新的有加密的钱包后，旧钱包文件的备份就不能再使用了。</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>钱包加密失败</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>因为内部错误导致钱包加密失败。你的钱包还是没加密。</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>提供的密码不一致。</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>钱包解锁失败</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>输入用来解密钱包的密码不正确。</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>钱包解密失败</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>钱包密码修改成功。</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>警告: 大写字母锁定已开启！</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP/网络掩码</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>在此之前禁止：</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>消息签名(&amp;M)...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>正在与网络同步...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>概况(&amp;O)</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>节点</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>显示钱包概况</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>交易记录(&amp;T)</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>查看交易历史</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>退出(&amp;X)</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>退出程序</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>关于 %1</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>显示 %1 相关信息</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>关于Qt(&amp;Q)</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>显示 Qt 相关信息</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>选项(&amp;O)...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>修改%1配置选项</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>加密钱包(&amp;E)...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>备份钱包(&amp;B)...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>更改密码(&amp;C)...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>正在发送地址(&amp;S)...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>正在接收地址(&amp;R)...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>打开 &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>点击禁用网络活动。</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>网络活动已禁用。</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>点击重新开启网络活动。</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>同步区块头 (%1%)...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>正在为数据块重建索引...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Sugarchain address</source>\n        <translation>向一个糖链地址发送糖链</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>备份钱包到其他文件夹</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>更改钱包加密口令</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>调试窗口(&amp;D)</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>打开调试和诊断控制台</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>验证消息(&amp;V)...</translation>\n    </message>\n    <message>\n        <source>Sugarchain</source>\n        <translation>糖链</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>钱包</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>发送(&amp;S)</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>接收(&amp;R)</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>显示 / 隐藏(&amp;S)</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>显示或隐藏主窗口</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>对钱包中的私钥加密</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Sugarchain addresses to prove you own them</source>\n        <translation>用糖链地址关联的私钥为消息签名，以证明您拥有这个糖链地址</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Sugarchain addresses</source>\n        <translation>校验消息，确保该消息是由指定的糖链地址所有者签名的</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>文件(&amp;F)</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>设置(&amp;S)</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>帮助(&amp;H)</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>分页工具栏</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and sugarchain: URIs)</source>\n        <translation>请求支付 (生成二维码和 sugarchain: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>显示用过的发送地址和标签的列表</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>显示用过的接收地址和标签的列表</translation>\n    </message>\n    <message>\n        <source>Open a sugarchain: URI or payment request</source>\n        <translation>打开一个 sugarchain: URI 或支付请求</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>命令行选项(&amp;C)</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Sugarchain network</source>\n        <translation><numerusform>%n 个到糖链网络的活动连接</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>正在为数据块建立索引...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>正在处理数据块...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>已处理 %n 个交易历史区块。</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>落后 %1 </translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>最新收到的区块产生于 %1。</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>在此之后的交易尚未可见</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>错误</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>信息</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>已是最新</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Sugarchain command-line options</source>\n        <translation>显示 %1 帮助信息，获取可用命令行选项列表</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 客戶</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>正在连接到节点……</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>更新中...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>日期: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>金额: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>类型: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>标签: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>地址: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>发送交易</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>流入交易</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>HD密钥生成&lt;b&gt;启用&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>HD密钥生成&lt;b&gt;禁用&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>钱包已被&lt;b&gt;加密&lt;/b&gt;，当前为&lt;b&gt;解锁&lt;/b&gt;状态</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>钱包已被&lt;b&gt;加密&lt;/b&gt;，当前为&lt;b&gt;锁定&lt;/b&gt;状态</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Sugarchain can no longer continue safely and will quit.</source>\n        <translation>发生严重错误。客户端无法安全地继续运行，即将退出。</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>选择钱币</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>总量：</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>字节：</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>金额：</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>费用：</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>小额：</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>加上交易费用后:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>变更 : </translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>(不)全选</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>树状模式</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>列表模式</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>金额</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>按标签收款</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>按地址收款</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>确认</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>已确认</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>复制地址</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>复制标签</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>复制金额</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>复制交易识别码</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>锁定未花费</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>解锁未花费</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>复制数目</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>复制手续费</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>复制计费后金额</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>复制字节数</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>复制零散金额</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>复制找零金额</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(锁定 %1 枚)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>是</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>否</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>当任何一个收款金额小于目前的零散金额上限时，文字会变红色。</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>每组输入可能有 +/- %1 个 satoshi 的误差。</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(无标签)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>找零前是 %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(找零)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>编辑地址</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>标签(&amp;L)</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>与此地址相关的标签项</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>该地址已与地址列表中的条目关联，只能被发送地址修改。</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>地址(&amp;A)</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>新建收款地址</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>新建付款地址</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>编辑收款地址</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>编辑付款地址</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Sugarchain address.</source>\n        <translation>输入的地址 %1 并不是有效的糖链地址。</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>输入的地址 %1 已经存在地址簿。</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>无法将钱包解锁。</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>产生新的密钥失败了。</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>一个新的数据目录将被创建。</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>名称</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>目录已存在。如果您打算在这里创建一个新目录，添加 %1。</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>路径已存在，并且不是一个目录。</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>无法在此创建数据目录。</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>版本</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1 位)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>關於 %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>命令行选项</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>使用：</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>命令行选项</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>界面选项：</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>在启动时选择目录（默认%u）</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>设置语言, 例如“zh-CN”（默认：系统语言）</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>启动时最小化</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>设置付款请求的SSL根证书（默认：-系统-）</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>显示启动画面（默认：%u）</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>重置图形界面所有的变更设置</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>欢迎</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>欢迎使用 %1</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>由于这是第一次启动此程序，您可以选择%1的数据所存储的位置</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>当你点击确认后，%1 将会在 %4 启动时从  %3 中最早的交易开始，下载并处理完整的 %4 区块链 (%2GB)。</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>如果你选择限制区块链存储大小（区块链裁剪模式），程序依然会下载并处理全部历史数据，此后才会删除不必须的部分，占用最少的存储空间。</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>使用默认的数据目录</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>使用自定义的数据目录：</translation>\n    </message>\n    <message>\n        <source>Sugarchain</source>\n        <translation>糖链</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>此目录中至少会保存 %1 GB 的数据，并且尺寸还会随着时间增长。</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>会在此目录中存储约 %1 GB 的数据。</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Sugarchain block chain.</source>\n        <translation>%1 将会下载并存储糖链区块链。</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>钱包也会被保存在这个目录中。</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>错误：无法创建 指定的数据目录 \"%1\" </translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>错误</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>有 %n GB 空闲空间</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(需要%n GB空间)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>表单</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the sugarchain network, as detailed below.</source>\n        <translation>近期交易可能尚未显示，因此当前余额可能不准确。以上信息将在与糖链网络完全同步后更正。详情如下</translation>\n    </message>\n    <message>\n        <source>Attempting to spend sugarchains that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>尝试使用受未可见交易影响的余额将不被网络接受。</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>剩余区块数量</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>未知</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>上一数据块时间</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>进度</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>每小时进度增加</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>正在计算</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>预计剩余同步时间</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>隐藏</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>未知状态。同步区块头(%1)...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>打开 URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>打开来自URI或文件的付款请求 </translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI: </translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>选择付款请求文件 </translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>选择要打开的付款请求文件</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>选项</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>主要(&amp;M)</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>在登入系统后自动启动 %1</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>系统登入时启动 %1</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>数据库缓存大小(&amp;D)</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>脚本验证线程数(&amp;V)</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>代理的 IP 地址 (例如 IPv4: 127.0.0.1 / IPv6: ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>显示默认的SOCKS5代理是否被用于在该类型的网络下连接同伴</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>通过Tor隐藏服务连接节点时使用不同的SOCKS&amp;5代理：</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>隐藏系统通知区图标</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>隐藏通知区图标(&amp;H)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>窗口被关闭时最小化而不是退出应用程序。当此选项启用时，应用程序只会在菜单中选择退出时退出。</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>出现在交易的选项卡的上下文菜单项的第三方网址 (例如：区块链接查询) 。 %s的URL被替换为交易哈希。多个的URL需要竖线 | 分隔。</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>有效的命令行参数覆盖上述选项:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>从工作目录下打开配置文件 %1。</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>打开配置文件</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>恢复客户端的缺省设置</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>恢复缺省设置(&amp;R)</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>网络(&amp;N)</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 = 自动, &lt;0 = 保持指定数量的CPU核心空闲)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>钱包(&amp;A)</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>专家</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>启动货币控制功能(&amp;C)</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>如果禁用未确认的零钱，则零钱至少需要1个确认才能使用。同时账户余额计算会受到影响。</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>使用未经确认的零钱(&amp;S)</translation>\n    </message>\n    <message>\n        <source>Automatically open the Sugarchain client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>自动在路由器中打开糖链端口。只有当您的路由器开启了 UPnP 选项时此功能才有效。</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>使用 &amp;UPnP 映射端口</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>接收外部连接。</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>允许流入连接(&amp;G)</translation>\n    </message>\n    <message>\n        <source>Connect to the Sugarchain network through a SOCKS5 proxy.</source>\n        <translation>通过 SOCKS5 代理连接糖链网络。</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>通过 SO&amp;CKS5 代理连接(默认代理)：</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>代理服务器 &amp;IP：</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>端口(&amp;P)：</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>代理端口（例如 9050）</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>连接到同伴的方式：</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Sugarchain network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>在 Tor 匿名网络下通过不同的 SOCKS5 代理连接糖链网络</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>窗口(&amp;W)</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>最小化窗口后仅显示托盘图标</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>最小化到托盘(&amp;M)</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>单击关闭按钮最小化(&amp;I)</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>显示(&amp;D)</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>用户界面语言(&amp;L)：</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>可以在这里设定用户界面的语言。这个设定在重启 %1 后才会生效。</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>糖链金额单位(&amp;U)：</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>选择糖链单位。</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>是否需要交易源地址控制功能。</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>第三方交易网址(&amp;T)</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>确定(&amp;O)</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>取消(&amp;C)</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>默认</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>无</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>确认恢复缺省设置</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>更改生效需要重启客户端。</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>客户端即将关闭，您想继续吗？</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>配置选项</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>配置文件可以用来设置高级选项。配置文件会覆盖设置界面窗口中的选项。此外，命令行会覆盖配置文件指定的选项。</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>错误</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>配置文件无法打开。</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>此更改需要重启客户端。</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>提供的代理服务器地址无效。</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>表单</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Sugarchain network after a connection is established, but this process has not completed yet.</source>\n        <translation>现在显示的消息可能是过期的。在连接上糖链网络节点后，您的钱包将自动与网络同步，但是这个过程还没有完成。</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>仅观察:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>可使用的余额：</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>您当前可使用的余额</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>等待中的余额：</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>尚未确认的交易总额，未计入当前余额</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>未成熟的：</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>尚未成熟的挖矿收入余额</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>余额</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>总额：</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>您当前的总余额</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>您当前 观察地址(watch-only address)的余额 </translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>可使用：</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>最近交易记录</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>观察地址(watch-only address)的未确认交易记录 </translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>观察地址(watch-only address)中尚未成熟(matured)的挖矿收入余额：</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>观察地址(watch-only address)中的当前总余额 </translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>要求付款时发生错误</translation>\n    </message>\n    <message>\n        <source>Cannot start sugarchain: click-to-pay handler</source>\n        <translation>无法启动 sugarchain 协议的“\n一键支付”处理器</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI 处理</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>取得付款请求的 URL 无效: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>无效的付款地址 %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Sugarchain address or malformed URI parameters.</source>\n        <translation>无法解析 URI 地址！可能是因为糖链地址无效，或是 URI 参数格式错误。</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>处理付款请求文件</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>无法读取付款请求文件！可能是文件无效造成的。</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>付款请求已被拒绝</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>付款请求的网络类型跟客户端不符。</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>付款请求已过期。</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>不支持到自定义付款脚本的未验证付款请求。</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>无效的支付请求。</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>请求支付的金额 %1 太小 (可被忽略)。</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>来自 %1 的退款</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>支付请求 %1 太大 (%2 字节。只允许 %3 字节)。</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>与 %1 通信出错: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>无法解析付款请求！</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>来自服务器 %1 的响应无效</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>网络请求出错</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>付款已确认</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>用户代理</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>节点/服务</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>节点ID</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation> </translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>发送</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>收到</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>金额</translation>\n    </message>\n    <message>\n        <source>Enter a Sugarchain address (e.g. %1)</source>\n        <translation>请输入一个糖链地址 (例如 %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 天</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 小时</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 分钟</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 秒</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>无</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>不可用</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 毫秒</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n 秒</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n 分钟</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n 小时</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n 天</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n 周</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 和 %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n 年</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 字节</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 尚未安全退出</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>未知</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>错误：指定的数据目录“%1”不存在。</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>错误：无法解析配置文件：%1。只接受 key=value语法。</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>错误：%1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>保存图片(&amp;S)...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>复制图片</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>保存二维码</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG 图像(*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>不可用</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>客户端版本</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>信息</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>调试窗口</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>常规</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>使用的 BerkeleyDB 版本</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>数据目录</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>启动时间</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>网络</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>姓名</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>连接数</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>数据链</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>当前数据块数量</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>资金池</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>当前交易数量</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>内存使用</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>&amp;重启</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>收到</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>发送</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>同伴(&amp;P)</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>节点黑名单</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>选择节点查看详细信息。</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>白名单</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>方向</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>版本</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>正在启动数据块</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>同步区块头</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>同步区块链</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>用户代理</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>缩小文字</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>放大文字</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>服务</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>禁止得分</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>连接时间</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>最后发送</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>最后接收</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping 时间</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>目前这一次 ping 已经过去的时间。</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping等待</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>最小Ping值</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>时间偏移</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>上一数据块时间</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>打开(&amp;O)</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>控制台(&amp;C)</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>网络流量(&amp;N)</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>总数</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>输入:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>输出：</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>调试日志文件</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>清空控制台</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 小时(&amp;H)</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 天(&amp;D)</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 周(&amp;W)</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 年(&amp;Y)</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>(&amp;D)断开</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>禁止</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>重新允许</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>欢迎使用 %1 的 RPC 控制台。</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>使用上下方向键浏览历史,  以及 %1 清除屏幕。</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>输入%1命令显示可用命令信息。</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>输入%1来取得使用这个控制台的更多信息。</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>警告： 已有骗子通过要求用户在此输入指令以盗取钱包。不要在没有完全理解命令规范时使用控制台。</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>网络活动已禁用</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(节点ID: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>通过 %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>从未</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>传入</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>传出</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>是</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>否</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>未知</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>总额(&amp;A)：</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>标签(&amp;L)：</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>消息(&amp;M)：</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Sugarchain network.</source>\n        <translation>可在付款请求上备注一条信息，在打开付款请求时可以看到。注意：该消息不是通过糖链网络传送。</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>可为新建的收款地址添加一个标签。</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>使用此表单要求付款。所有字段都是&lt;b&gt;可选&lt;/b&gt;。</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>可选的请求金额。留空或填零为不要求具体金额。</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>清除此表单的所有字段。</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>清除</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>请求付款的历史</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>请求付款(&amp;R)</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>显示选中的请求 (双击也可以显示)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>显示</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>从列表中移除选中的条目</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>移除</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>复制URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>复制标签</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>复制消息</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>复制金额</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>二维码</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>复制 URI(&amp;U)</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>复制地址(&amp;A)</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>保存图片(&amp;S)...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>请求付款到 %1</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>付款信息</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>地址</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>金额</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>标签</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>消息</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>URI 太长，请试着精简标签或消息文本。</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>把 URI 编码成二维码时发生错误。</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>标签</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>消息</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(无标签)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(无消息)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>（无请求金额）</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>总额</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>发送</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>交易源地址控制功能</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>输入...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>自动选择</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>存款不足！</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>总量：</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>字节：</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>金额：</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>费用：</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>加上交易费用后:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>变更 : </translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>如果激活该选项，但是零钱地址用光或者非法，将会新生成零钱地址，转入零钱。</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>自定义零钱地址</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>交易费用:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>选择... </translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>如果使用备用交易费设置，有可能会导致交易经过几个小时、几天（甚至永远）无法被确认。请考虑手动选择交易费，或等待整个链完成验证。</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>警告: 目前无法进行交易费估计。</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>收起  费用设置 </translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>每kb</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>如果自定义交易费设置为 1000聪而交易大小只有250字节，则“每千字节\" 模式只支付250聪交易费， 而\"最少\"模式则支付1000聪。 大于1000字节的交易按每千字节付费。</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>隐藏</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for sugarchain transactions than the network can process.</source>\n        <translation>交易量小时允许只支付最小交易费。但是请注意，当交易量大到超出网络可处理时您的交易可能永远无法确认。</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(请注意提示信息)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>推荐：</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>自定义：</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(智能交易费用 尚未初始化。 需要再下载一些数据块...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>一次发送给多个接收者</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>添加收款人(&amp;R)</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>清除此表单的所有字段。</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>小额：</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>确认时间目标：</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>启用手续费追加</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>手续费追加（Replace-By-Fee，BIP-125）可以让你在送出交易后才来提高手续费。不用这个功能的话，建议付比较高的手续费来降低交易延迟的风险。</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>清除所有(&amp;A)</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>余额：</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>确认发送货币</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>发送(&amp;E)</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>复制数目</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>复制金额</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>复制手续费</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>复制计费后金额</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>复制字节数</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>复制零散金额</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>复制找零金额</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2个块)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 到 %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>您确定要发出吗？</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>已添加交易费</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>总金额 %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>或</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>你可以之后再提高手续费（有BIP-125手续费追加的标记）</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>没有BIP-125手续费追加的标记。</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>确认发送</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>接收人地址无效。请重新检查。</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>支付金额必须大于0。</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>金额超出您的余额。</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>计入 %1 交易费后的金额超出您的余额。</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>发现重复地址：每个地址应该只使用一次。</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>交易创建失败！</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>交易因以下原因拒绝：%1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>交易费一般不应超过 %1。</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>付款请求已过期。</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>只支付必要费用 %1</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Estimated to begin confirmation within %n block(s).</source>\n        <translation><numerusform>预计可在%n个区块内开始确认。</numerusform></translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Sugarchain address</source>\n        <translation>警告: 糖链地址无效</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>警告：未知的更改地址</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>确认用户找零地址</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>你选择的找零地址未被包含在本钱包中，你钱包中的部分或全部金额将被发送至该地址。你确定要这样做吗？</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(无标签)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>金额(&amp;M)</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>付给(&amp;T)：</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>标签(&amp;L)：</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>选择以前用过的地址</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>这是笔正常的支付。</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address to send the payment to</source>\n        <translation>付款目的地址</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>从剪贴板粘贴地址</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>移除此项</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less sugarchains than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>交易费将从发送总额中扣除。接收人将收到比您在金额框中输入的更少的糖链。如果选中了多个收件人，交易费平分。</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>从金额中减去交易费(&amp;U)</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>使用全部可用余额</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>消息：</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>这是一个未经验证的支付请求。</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>这是一个已经验证的支付请求。</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>请为此地址输入一个标签以将它加入用过的地址列表</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the sugarchain: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Sugarchain network.</source>\n        <translation>sugarchain:URI 附带的备注信息，将会和交易一起存储，备查。 注意：该消息不会通过糖链网络传输。</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>支付给:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>便条：</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>为这个地址输入一个标签，以便将它添加到您的地址簿</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>是</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>正在关闭 %1 ...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation>在此窗口消失前不要关闭计算机。</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>签名 - 为消息签名/验证签名消息</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>签名消息(&amp;S)</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive sugarchains sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>您可以用你的地址对消息/协议进行签名，以证明您可以接收发送到该地址的糖链。注意不要对任何模棱两可或者随机的消息进行签名，以免遭受钓鱼式攻击。请确保消息内容准确的表达了您的真实意愿。</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address to sign the message with</source>\n        <translation>用来对消息签名的地址 </translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>选择以前用过的地址</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>从剪贴板粘贴地址</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>请输入您要发送的签名消息</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>签名</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>复制当前签名至剪切板</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Sugarchain address</source>\n        <translation>签名消息，证明这个地址属于您。</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>消息签名(&amp;M)</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>清空所有签名消息栏</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>清除所有(&amp;A)</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>验证消息(&amp;V)</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>请在下面输入接收者地址、消息（确保换行符、空格符、制表符等完全相同）和签名以验证消息。请仔细核对签名信息，以提防中间人攻击。请注意，这只是证明接收方签名的地址，它不能证明任何交易！</translation>\n    </message>\n    <message>\n        <source>The Sugarchain address the message was signed with</source>\n        <translation>消息使用的签名地址</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Sugarchain address</source>\n        <translation>验证消息，确保消息是由指定的糖链地址签名过的。</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>验证消息签名(&amp;M)</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>清空所有验证消息栏</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>单击“签名消息“产生签名。</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>输入的地址无效。</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>请检查地址后重试。</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>输入的地址没有关联的公私钥对。</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>钱包解锁动作取消。</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>找不到输入地址关联的私钥。</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>消息签名失败。</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>消息已签名。</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>签名无法解码。</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>请检查签名后重试。</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>签名与消息摘要不匹配。</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>消息验证失败。</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>消息验证成功。</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[测试网络]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>到下%n个区块产生出来前可修改</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>至 %1 个数据块时开启</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>与一个有 %1 个确认的交易冲突</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1 / 离线</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0/未确认，%1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>在内存池中</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>不在内存池中</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>已抛弃</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1/未确认</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>%1 个确认</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>状态</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>，未被成功广播</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>，通过 %n 个节点广播</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>源</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>生成</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>来自</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>未知</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>到</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>自己的地址</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>观察地址(watch-only) </translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>标签</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>收入</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>再等%n个区块产生出来后成熟</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>未被接受</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>支出</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>总收入</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>总支出</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>交易费用</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>净额</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>消息</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>备注</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>交易 ID</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>交易总大小</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>输出索引</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>商家</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>生成的糖链在可以使用前必须有 %1 个成熟的区块。当您生成了此区块后，它将被广播到网络中以加入区块链。如果它未成功进入区块链，其状态将变更为“不接受”并且不可使用。这可能偶尔会发生，如果另一个节点比你早几秒钟成功生成一个区块。</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>调试信息</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>交易</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>输入</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>金额</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>是</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>否</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>当前面板显示了交易的详细信息</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>%1 详情</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>种类</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>标签</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>到下%n个区块产生出来前可修改</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>至 %1 个数据块时开启</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>离线</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>未确认</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>已丢弃</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>确认中 (推荐 %2个确认，已经有 %1个确认)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>已确认 (%1 条确认信息)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>冲突的</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>未成熟 (%1 个确认，将在 %2 个后可用)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>此数据块未被任何其他节点接收，可能不被接受！</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>已生成但未被接受</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>收款</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>收款来自</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>付款</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>付款给自己</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>挖矿所得</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>观察地址(watch-only) </translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>（不可用）</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(无标签)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>交易状态。 鼠标移到此区域可显示确认项数量。</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>交易被接收的时间和日期。</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>交易类型。</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>该交易中是否涉及  观察地址(watch-only address)。</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>用户定义的该交易的意图/目的。</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>从余额添加或移除的金额。</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>全部</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>今天</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>这星期</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>这个月</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>上个月</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>今年</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>指定范围...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>收款</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>付款</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>给自己</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>挖矿所得</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>其它</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>输入地址、交易识别码或标签进行搜索</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>最小金额</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>放弃交易</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>增加交易费</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>复制地址</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>复制标签</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>复制金额</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>复制交易识别码</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>拷贝原始交易</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>复制所有交易详情</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>编辑标签</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>显示交易详情</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>导出交易历史</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>逗号分隔文件 (*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>已确认</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>观察地址(Watch-only) </translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>种类</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>标签</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>地址</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>ID</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>导出失败</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>尝试保存交易历史 %1 时发生了错误。</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>导出成功</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>交易历史已成功保存到 %1。</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>范围：</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>到</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>金额单位。单击选择别的单位。</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>没有载入钱包。</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>发送</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>手续费提升失败</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>增加交易费失败</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>你是否愿意增加交易费?</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>当前交易费:</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>增加量:</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>新交易费:</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>确认手续费提升</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>无法签署交易。</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>无法提交交易</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>导出(&amp;E)</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>将当前标签页数据导出到文件</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>备份钱包</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>钱包文件(*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>备份失败</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>尝试保存钱包数据至 %1 时发生了错误。</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>备份成功</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>钱包数据成功保存至 %1。</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>选项：\n</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>指定数据目录\n</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>连接一个节点并获取对端地址，然后断开连接</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>指定您的公共地址</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>接受命令行和 JSON-RPC 命令\n</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>在MIT协议下分发，参见附带的 %s 文件或 %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>如果&lt;category&gt;未提供或&lt;category&gt; = 1，输出所有调试信息。</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>修剪值被设置为低于最小值%d MiB，请使用更大的数值。</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>修剪：最后的钱包同步超过了修剪的数据。你需要通过 -reindex (重新下载整个区块链以防修剪节点)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>无法在开启修剪的状态下重扫描，请使用 -reindex重新下载完整的区块链。</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>错误：发生了致命的内部错误，详情见 debug.log 文件</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>为付款交易添加交易费 (%s/kB) (默认: %s) </translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>正在修剪区块存储...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>在后台运行并接受命令\n\n</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>无法启动HTTP服务，查看日志获取更多信息</translation>\n    </message>\n    <message>\n        <source>Sugarchain Yumekawa</source>\n        <translation>糖链梦川</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>%s 开发人员</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>当费用估计数据(default: %s)不足时将会启用的费率 (in %s/kB) </translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>即使在无关联交易(默认: %d)时也接受来自白名单同行的关联交易</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>添加节点并与其保持连接（详情请见RPC命令addnode的说明）</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>绑定指定的IP地址开始监听。IPv6地址请使用[host]:port 格式</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>无法锁定数据目录 %s。%s 可能已经在运行。</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>无法同时指定特定连接地址以及自动寻找连接。</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>只连接到指定的节点。用-connect=0可以关闭自动连接。（应用于这个节点的规则与-addnode相同）</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>删除钱包的所有交易记录，且只有用 -rescan参数启动客户端才能重新取回交易记录 </translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>读取 %s 时发生错误！所有的密钥都可以正确读取，但是交易记录或地址簿数据可能已经丢失或出错。</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>排除某一类Debug信息。可以与 -debug=1 一起使用，以输出除了指定类别以外的Debug日志。</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>当最佳区块变化时执行命令 (命令行中的 %s 会被替换成区块哈希值)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>为了将摘要区块完整重组而额外保留在內存中的交易数量（默认：%u）</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>假设已经在区块链中的区块以及其先前的区块都合法，因此对它们略过脚本验证（0表示一律要验证，默认：%s，测试网络：%s）</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>跟其他节点的时间差最高可接受的中位数值。本机所认为的时间可能会被其他节点影响，往前或往后在这个值之内。（默认：%u秒）</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>最大的单次钱包或原始转账费用(%s)，设置太低可能导致大尺寸交易失败(默认：%s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>请检查电脑的日期时间设置是否正确！时间错误可能会导致 %s 运行异常。</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>如果你认为%s对你比较有用的话，请对我们进行一些捐赠支持。请访问%s网站来获取有关这个软件的更多信息。</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>是否允许在节点地址数量不足时，使用DNS查询来搜寻节点（默认：当没用-connect时为1）</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>修剪（删除）掉老旧区块以降低需要的储存空间。这样会增加一个RPC指令pruneblockchain，可以使用它来删除指定的区块；也可以指定目标储存空间大小，以启用对老旧内存块的自动修剪功能。这个模式跟-txindex和-rescan参数不兼容。警告：还原回不修剪模式会需要重新下载整个区块链。（默认：0表示不修剪内存块，1表示允许使用RPC指令做修剪，&gt;%u的值表示为区块数据的目标大小，单位是百万字节，MiB）</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>设定生成区块时，所要包含交易每千字节的最低手续费（单位是%s）。（默认：%s）</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>设置脚本验证的程序 (%u 到 %d, 0 = 自动, &lt;0 = 保留自由的核心, 默认值: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>区块数据库包含未来的交易，这可能是由本机错误的日期时间引起。若确认本机日期时间正确，请重新建立区块数据库。</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>这是测试用的预发布版本 - 请谨慎使用 - 不要用来挖矿，或者在正式商用环境下使用</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>如果对你的交易量来说，消耗的手续费微乎其微，那么这笔手续费你或许可以忽略它。</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>没办法重算区块。你需要先用-reindex-chainstate参数来重建数据库。</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>没办法将数据库倒转回分叉前的状态。必须要重新下载区块链。</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>使用UPnP暴露本机监听端口（默认：1 当正在监听且不使用代理）</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>JSON-RPC 连接要使用的用户名和散列密码。&lt;userpw&gt; 的格式是：&lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;。在 share/rpcuser 目录下有一个示范的 python 脚本。之后客户端程序就可以用这对参数正常连接：rpcuser=&lt;USERNAME&gt;和rpcpassword=&lt;PASSWORD&gt;。这个选项可以被多次指定。</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>钱包软件不会产生违反内存池交易链限制的交易（默认：%u）</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>警告：网络似乎并不完全同意！有些矿工似乎遇到了问题。</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>警告：我们的同行似乎不完全同意！您可能需要升级，或者其他节点可能需要升级。</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>是否在退出时保存内存池，并在启动时重新载入(默认值: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>最后100个区块中的%d个包含未知的版本号</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>%s 已损坏，抢救备份失败</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>-maxmempool 最小为%d MB</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; 可能是：</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>接受来自外部的连接 (缺省: 如果不带 -proxy or -connect 参数设置为1)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>为用户代理字符串附加说明</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>启动时尝试从已损坏的钱包文件中恢复私钥</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>数据块创建选项：</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>无法解析 - %s 地址： '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>区块链选择选项:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>修改索引超过范围</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>连接选项：</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>版权所有 (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>检测发现数据块数据库损坏。请使用 -reindex参数重启客户端。</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>调试/测试选项：</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>不要加载钱包和禁用钱包的 RPC 调用</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>你想现在就重建块数据库吗？</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>允许在&lt;address&gt;广播哈希区块</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>允许在&lt;address&gt;广播哈希交易</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>允许在&lt;address&gt;广播原始区块</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>允许在&lt;address&gt;广播原始交易</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>保证内存池中的交易更换(默认：%u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>生成%s发生错误：这个版本不能用来产生非HD钱包。</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>初始化数据块数据库出错</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>初始化钱包数据库环境错误 %s!</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>载入 %s 时发生错误</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>%s 加载出错：钱包损坏</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>%s 加载错误：请升级到最新版 %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>导入数据块数据库出错</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>导入数据块数据库出错</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>错误：磁盘剩余空间低!</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>监听端口失败。请使用 -listen=0 参数。</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>初始化时重新扫描钱包失败了</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>导入中...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>不正确或没有找到起源区块。网络错误？</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>无效的金额 -%s=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>无效的金额 -discardfee=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>-fallbackfee 的无效数额=&lt;amount&gt;: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>保持交易内存池大小低于&lt;n&gt;MB（默认：%u）</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>正在加载P2P地址...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>正在加载黑名单...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>认证Cookie的位置 (默认: data目录)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>没有足够的文件描述符可用。</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>只连接 &lt;net&gt;网络中的节点 (ipv4, ipv6 或 onion) </translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>打印出这段帮助信息并退出</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>打印版本信息并退出</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>修剪不能配置一个负数。</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>修剪模式与 -txindex 不兼容。</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>从硬盘里的区块文件blk*.dat重建区块链状态和区块索引</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>从当前索引的区块中重建链状态</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>正在对区块进行重算…</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>回退区块</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>送出允许提高手续费（full-RBF）的交易（仅适用于RPC指令，默认：%u）</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>设置以MB为单位的数据库缓存大小(%d 到 %d, 默认值: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>指定钱包文件（数据目录内）</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>源代码可以在 %s 获得。</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>计算交易手续费和找零失败了</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>无法在本机绑定 %s 端口。%s 可能已经在运行。</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>忽略不支持的选项 -benchmark，使用 -debug=bench</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>忽略不支持的选项 -debugnet，使用 -debug=net。</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>忽略不支持的选项 -tor，使用 -oinon</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>不支持的日志分类 %s=%s.</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>升级UTXO数据库</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>使用UPnp映射监听端口 (默认: %u) </translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>使用测试链</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>用户代理评论(%s)包含不安全的字符。</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>正在验证区块...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>钱包调试/测试选项：</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>钱包需要被重写：请重新启动%s来完成</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>钱包选项:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>允许来自指定地址的 JSON-RPC 连接。 &lt;ip&gt;为单一IP (如: 1.2.3.4), 网络/掩码 (如: 1.2.3.4/255.255.255.0), 网络/CIDR (如:  1.2.3.4/24)。该选项可多次指定。</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>绑定到指定地址和连接的白名单节点。 IPv6使用  [主机]:端口 格式 </translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>创建系统默认权限的文件，而不是 umask 077 (只在关闭钱包功能时有效) </translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>发现自己的 IP 地址（默认: 监听并且无 -externalip 或 -proxy 时为 1）</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>错误：监听外部连接失败 (监听返回错误 %s) </translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>当收到相关提醒或者我们看到一个长分叉时执行命令（%s 将替换为消息）</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>交易费(in %s/kB)比这更小的在关联、挖掘和生成交易时将被视为零费交易 (默认: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>如果未设置交易费用，自动添加足够的交易费以确保交易在平均n个数据块内被确认 (默认: %u) </translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>-maxtxfee=&lt;amount&gt;: '%s' 的金额无效（交易费至少为 %s，以免交易滞留过久）</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>Maximum size of data in data carrier transactions we relay and mine (default: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>为每个代理连接随机化凭据。这将启用 Tor 流隔离 (默认: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>在交易费被扣除后发送的交易金额太小</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>白名单节点不能被DoS banned ，且转发所有来自他们的交易(即便这些交易已经存在于mempool中)，常用于网关 </translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>您需要使用 -reindex 重新构建数据库以返回未修剪的模式。这将重新下载整个区块链</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(默认: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>接受公共 REST 请求 (默认: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>自动建立Tor隐藏服务 (默认:%d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>通过 SOCKS5 代理连接</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>加载%s发生错误：不能对已存在的HD钱包停用HD功能。</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>读取数据库出错，关闭中。</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>升级链状态数据库出错</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>启动时从其他来源的  blk000??.dat 文件导入区块</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>信息</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>无效的 -onion 地址: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>无效的 -proxy 地址: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>无效的金额 -paytxfee=&lt;amount&gt;: '%s' (必须至少为 %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>-whitelist: '%s' 指定的网络掩码无效</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>内存中最多保留 &lt;n&gt; 笔孤立的交易 (默认: %u) </translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>-whitebind: '%s' 需要指定一个端口</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>节点中继选项:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC 服务器选项：</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>因为系统的限制，将 -maxconnections 参数从 %d 降到了 %d</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>重新扫描区块链以查找遗漏的钱包交易</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>跟踪/调试信息输出到控制台，不输出到 debug.log 文件</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>显示所有调试选项 (用法: --帮助 -帮助调试)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>客户端启动时压缩debug.log文件(缺省：no-debug模式时为1)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>签署交易失败</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>以-walletdir指定的路径“%s”不存在</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>以-walletdir指定的路径“%s”是相对路径</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>以-walletdir指定的路径“%s”不是个目录</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>交易金额太小，不足以支付交易费</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>这是实验性的软件。</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Tor 控制端口密码 (默认值: 空白)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>开启监听 onion 连接时的 Tor 控制端口号 (默认值: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>交易量太小</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>费用策略的交易太大</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>交易太大</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>无法在此计算机上绑定 %s (绑定返回错误 %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>无法产生初始的密钥</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>程序启动时升级钱包到最新格式</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>JSON-RPC 连接用户名</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>正在检测钱包的完整性...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>钱包文件%s没有在钱包目录%s里面</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>警告: 不明的交易规则被启用了(versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>是否用块方进行 (%u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>您需要用 -reindex 重建数据库，从而令 -txindex 的变动生效</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>正在消除錢包中的所有交易...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ 通知选项：</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>JSON-RPC 连接密码\n</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>当最佳数据块变化时执行命令 (命令行中的 %s 会被替换成数据块哈希值)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>使用 -addnode, -seednode 和 -connect 选项时允许查询DNS</translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 = 保留 tx meta data , 如 account owner 和 payment request information, 2 = 不保留 tx meta data) </translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>参数 -maxtxfee 设定了很高的金额！这是你一次交易就有可能付出的最高手续费。</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>和指定的地址绑定以监听JSON-RPC连接。必须同时指定-rpcallowip这项设定才有作用。不一定要指定端口号，指定的话会覆盖掉-rpcport设定。IPv6请用[主机]：通信端口这种格式。这个选项可以设定多次。（默认：127.0.0.1和::1，也就是localhost。当有指定-rpcallowip时，预设值为0.0.0.0和::，也就是所有位址）</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>不要让交易留在内存池中超过 &lt;n&gt; 个小时 (默认值: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>转发和采矿时，交易数据中每个sigop的等效字节数（默认：%u）</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>加载%s发生错误：不能对已存在的非HD钱包启用HD功能</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>加载钱包出错 %s. -wallet参数必需指定为文件名(而不是目录路径)。</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>当产生交易时，如果每千字节 (kB) 的手续费比这个值 (单位是 %s) 低，就视为没支付手续费 (默认值: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>强制转发从白名点节点收到的交易，即使它们违反了本机的转发准则（默认：%d）</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>数据块验证 严密级别  -checkblocks (0-4, 默认: %u) </translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>维护一份完整的交易索引, 用于 getrawtransaction RPC调用 (默认: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>限制 非礼节点 若干秒内不能连接 (默认: %u) </translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>输出调试信息 (默认: %u, 提供 &lt;category&gt; 是可选项)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>设定非冗余模式时，返回的交易原始数据或区块hex的序列化形式：无segwit为0，或是有segwit为1（默认：%d）</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>指定用来放钱包文件的目录（默认：如果存在的话就用&lt;datadir&gt;/wallets，否则为&lt;datadir&gt;）</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>指定调试日志文件：可以用绝对路径，也可以用相对于数据目录的相对路径（默认：%s）</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>支持用 Bloom 过滤器来过滤区块和交易(默认值: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>容许自动免找零成为手续费的交易手续费率（单位：%s/kB，默认：%s）。注意：如果在该费率下，找零的零钱会成为零散钱，则自动弃掉成为手续费。但弃掉的零钱费率永远不会大于零散钱的转发费率，金额也不会大于最长预估确认时间所需的手续费</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>这是在费用估计不可用时你可能会支付的交易费。</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>此产品包含了由OpenSSL Project所开发的OpenSSL Toolkit软件%s，由Eric Young撰写的加解密软件，以及由Thomas Bernard所撰写的UPnP软件。</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>网络版本字符串的总长度 (%i) 超过最大长度 (%i) 了。请减少 uacomment 参数的数目或长度。</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>尝试保持上传带宽低于（MiB/24h），0=无限制（默认：%d）</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>找到不再支持的 -socks 参数。现在只支持 SOCKS5 协议的代理服务器，因此不可以指定 SOCKS 协议版本。</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>一个不被支持的参数 -whitelistalwaysrelay 被忽略了。请使用 -whitelistrelay 或者 -whitelistforcerelay.</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>通过 Tor 隐藏服务连接节点时使用不同的 SOCKS5 代理 (默认: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>警告: 未知的区块版本被挖掘！未知规则可能已生效</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>警告：钱包文件损坏，但数据被救回！原始的钱包文件%s已经重命名为%s并存储到%s目录下 。如果您的账户余额或者交易记录不正确，请使用您的钱包备份文件恢复。</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>把来自指定地址（例如：1.2.3.4）或CIDR格式网段（例如：1.2.3.0/24）的节点放进白名单。这个选项可以设定多次。</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s非常高！</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(默认: %s) </translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>始终通过 DNS 查询节点地址 (默认: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>加载钱包 %s 出错。 -wallet 必须是正规文件名。</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>加载钱包 %s 出错。 重复的 -wallet 文件名。</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>加载钱包 %s 出错。 -wallet 文件名中包含无效字符。</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>启动时检测多少个数据块(默认: %u, 0=所有)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>在调试输出中包含IP地址 (默认: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>密钥池已经耗尽，请先执行keypoolrefill</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>使用 &lt;port&gt;端口监听 JSON-RPC 连接 (默认: %u ; testnet: %u) </translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>使用端口 &lt;port&gt; 监听连接 (默认: %u ; testnet: %u) </translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>保留最多 &lt;n&gt; 条节点连接 (默认: %u) </translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>钱包广播事务处理</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>每个连接的最大接收缓存，&lt;n&gt;*1000 字节 (默认: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>每个连接的最大发送缓存，&lt;n&gt;*1000 字节 (默认: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>输出调试信息时，前面加上时间戳 (默认: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>Relay and mine data carrier transactions (default: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>是否转发 非P2SH格式的多签名交易 (默认: %u) </translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>设置私钥池大小为 &lt;n&gt; (默认：%u) </translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>设置BIP141最大区块权重 (默认: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>设置RPC服务线程数 (默认: %d) </translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>指定配置文件 (默认: %s) </translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>指定连接超时毫秒数 (最小: 1, 默认: %d) </translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>指定 pid 文件 (默认: %s) </translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>付款时允许使用未确认的零钱 (默认: %u) </translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>正在启动网络线程...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>钱包避免低于最小交易费的支付</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>这是你每次交易付款时最少要付的手续费。</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>如果发送交易，这将是你要支付的交易费。</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>断开 非礼节点的阀值 (默认: %u) </translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>交易金额不不可为负数</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>交易造成内存池中的交易链太长</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>交易必须包含至少一个接收人</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>-onlynet 指定的是未知网络：%s</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>金额不足</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>正在加载区块索引...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>正在加载钱包...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>无法降级钱包</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>正在重新扫描...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>加载完成</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>错误</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_zh_HK.ts",
    "content": "<TS language=\"zh_HK\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>按右擊修改位址或標記</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>新增一個位址</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>新增 &amp;N</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>複製目前選擇的位址到系統剪貼簿</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>複製 &amp;C</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>關閉 &amp;l</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>把目前選擇的位址從列表中刪除</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>把目前分頁的資料匯出至檔案</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>匯出 &amp;E</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>刪除 &amp;D</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>選擇要付錢過去的地址</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>選擇要收錢的地址</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>選擇 &amp;h</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>付款地址</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>收款地址</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>這些是你要付款過去的 Bitcoin 位址。在付款之前，務必要檢查金額和收款位址是否正確。</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>這些是你用來收款的 Bitcoin 位址。建議在每次交易時，都使用一個新的收款位址。</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>複製地址 &amp;C</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>複製標記 &amp;L</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>編輯 &amp;E</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>匯出地址清單</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>逗號分隔檔 (*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>匯出失敗</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>儲存地址列表到 %1 時發生錯誤。請再試一次。</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>標記</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>地址</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(無標記)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>複雜密碼對話方塊</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>請輸入密碼</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>新密碼</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>重複新密碼</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>輸入錢包的新密碼。&lt;br/&gt;密碼請用&lt;b&gt;10 個或以上的隨機字元&lt;/b&gt;，或是&lt;b&gt;8 個或以上的字詞&lt;/b&gt;。</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>加密錢包</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>這個動作需要你的錢包密碼來將錢包解鎖。</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>解鎖錢包</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>這個動作需要你的錢包密碼來將錢包解密。</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>解密錢包</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>更改密碼</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>輸入舊密碼和新密碼至錢包。</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>確認錢包加密</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>警告: 如果你將錢包加密後又忘記密碼，你就會&lt;b&gt;失去所有 Bitcoin 了&lt;/b&gt;！</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>你確定要把錢包加密嗎？</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>錢包已加密</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 現在要關閉來完成加密程序。請記得將錢包加密不能完全防止你的 Bitcoins 經被入侵電腦的惡意程式偷取。</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>重要: 請改用新產生的加密錢包檔，來取代所以舊錢包檔的備份。為安全計，當你開始使用新的加密錢包檔後，舊錢包檔的備份就不能再使用了。</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>錢包加密失敗</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>因內部錯誤導致錢包加密失敗，你的錢包尚未加密。</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>提供的密碼不一致。</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>錢包解鎖失敗</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>用來解密錢包的密碼不對。</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>錢包解密失敗</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>錢包密碼已成功更改。</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>警告: Caps Lock 已啟用！</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>IP位址/遮罩</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>封鎖至</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>簽署訊息... &amp;m</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>與網絡同步中...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>總覽 &amp;O</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>節點</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>顯示錢包一般總覽</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>交易 &amp;T</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>瀏覽交易紀錄</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>結束 &amp;x</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>結束應用程式</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>關於 %1 &amp;A</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>顯示 %1 的相關資訊</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>關於 Qt &amp;Q</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>顯示 Qt 相關資訊</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>選項... &amp;O</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>修正 %1 的設定選項</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>加密錢包... &amp;E</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>備份錢包... &amp;B</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>改變密碼... &amp;C</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>付款位址... &amp;S</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>收款位址... &amp;R</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>開啓網址... &amp;U</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>正在為磁碟區塊重建索引...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>付款至一個 Bitcoin 位址</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>把錢包備份到其它地方</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>改變錢包加密用的密碼</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>除錯視窗 &amp;D</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>開啓除錯和診斷主控台</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>驗證訊息... &amp;V</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>錢包</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>付款 &amp;S</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>收款 &amp;R</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>顯示 / 隱藏 &amp;S</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>顯示或隱藏主視窗</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>檔案 &amp;F</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>設定 &amp;S</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>說明 &amp;H</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>要求付款 (產生QR碼 bitcoin: URIs)</translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>正在為磁碟區塊建立索引...</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>錯誤</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>資訊</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>日期: %1\n</translation>\n    </message>\n    </context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(無標記)</translation>\n    </message>\n    </context>\n<context>\n    <name>EditAddressDialog</name>\n    </context>\n<context>\n    <name>FreespaceChecker</name>\n    </context>\n<context>\n    <name>HelpMessageDialog</name>\n    </context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>錯誤</translation>\n    </message>\n    </context>\n<context>\n    <name>ModalOverlay</name>\n    </context>\n<context>\n    <name>OpenURIDialog</name>\n    </context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Error</source>\n        <translation>錯誤</translation>\n    </message>\n    </context>\n<context>\n    <name>OverviewPage</name>\n    </context>\n<context>\n    <name>PaymentServer</name>\n    </context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>Sent</source>\n        <translation>已送出</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>已接收</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>輸入一個 Bitcoin 位址 (例如 %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 日</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 小時</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 分</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 秒</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>沒有</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 亳秒</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n 秒</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n 分鐘</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n 小時</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n 日</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n 星期</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1 和 %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n 年</numerusform></translation>\n    </message>\n    </context>\n<context>\n    <name>QObject::QObject</name>\n    </context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>Save QR Code</source>\n        <translation>儲存 QR 碼</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG 影像(*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>N/A</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>資訊 &amp;I</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>除錯視窗</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>一般</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>已接收</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>已送出</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>版本</translation>\n    </message>\n    </context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    </context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>Address</source>\n        <translation>地址</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>標記</translation>\n    </message>\n    </context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>標記</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(無標記)</translation>\n    </message>\n    </context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>(no label)</source>\n        <translation>(無標記)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    </context>\n<context>\n    <name>SendConfirmationDialog</name>\n    </context>\n<context>\n    <name>ShutdownWindow</name>\n    </context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    </context>\n<context>\n    <name>SplashScreen</name>\n    </context>\n<context>\n    <name>TrafficGraphWidget</name>\n    </context>\n<context>\n    <name>TransactionDesc</name>\n    <message>\n        <source>Open until %1</source>\n        <translation>開放至 %1</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionDescDialog</name>\n    </context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>標記</translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>開放至 %1</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(無標記)</translation>\n    </message>\n    </context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>逗號分隔檔 (*.csv)</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>標記</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>地址</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>匯出失敗</translation>\n    </message>\n    </context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    </context>\n<context>\n    <name>WalletFrame</name>\n    </context>\n<context>\n    <name>WalletModel</name>\n    </context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>匯出 &amp;E</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>把目前分頁的資料匯出至檔案</translation>\n    </message>\n    </context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Information</source>\n        <translation>資訊</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>錯誤</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/locale/bitcoin_zh_TW.ts",
    "content": "<TS language=\"zh_TW\" version=\"2.1\">\n<context>\n    <name>AddressBookPage</name>\n    <message>\n        <source>Right-click to edit address or label</source>\n        <translation>右鍵點一下來修改位址或標記</translation>\n    </message>\n    <message>\n        <source>Create a new address</source>\n        <translation>產生一個新位址</translation>\n    </message>\n    <message>\n        <source>&amp;New</source>\n        <translation>新增(&amp;N)</translation>\n    </message>\n    <message>\n        <source>Copy the currently selected address to the system clipboard</source>\n        <translation>複製目前選擇的位址到系統剪貼簿</translation>\n    </message>\n    <message>\n        <source>&amp;Copy</source>\n        <translation>複製(&amp;C)</translation>\n    </message>\n    <message>\n        <source>C&amp;lose</source>\n        <translation>關閉(&amp;L)</translation>\n    </message>\n    <message>\n        <source>Delete the currently selected address from the list</source>\n        <translation>把目前選擇的位址從列表中刪掉</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>把目前分頁的資料匯出存成檔案</translation>\n    </message>\n    <message>\n        <source>&amp;Export</source>\n        <translation>匯出(&amp;E)</translation>\n    </message>\n    <message>\n        <source>&amp;Delete</source>\n        <translation>刪掉(&amp;D)</translation>\n    </message>\n    <message>\n        <source>Choose the address to send coins to</source>\n        <translation>選擇要付錢過去的位址</translation>\n    </message>\n    <message>\n        <source>Choose the address to receive coins with</source>\n        <translation>選擇要收錢進來的位址</translation>\n    </message>\n    <message>\n        <source>C&amp;hoose</source>\n        <translation>選取(&amp;H)</translation>\n    </message>\n    <message>\n        <source>Sending addresses</source>\n        <translation>付款位址</translation>\n    </message>\n    <message>\n        <source>Receiving addresses</source>\n        <translation>收款位址</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>\n        <translation>這些是你要付款過去的 Bitcoin 位址。在付錢之前，務必要檢查金額和收款位址是否正確。</translation>\n    </message>\n    <message>\n        <source>These are your Bitcoin addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>\n        <translation>這些是你用來收款的 Bitcoin 位址。建議在每次交易時，都使用一個新的收款位址。</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Address</source>\n        <translation>複製位址(&amp;C)</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Label</source>\n        <translation>複製標記(&amp;L)</translation>\n    </message>\n    <message>\n        <source>&amp;Edit</source>\n        <translation>編輯(&amp;E)</translation>\n    </message>\n    <message>\n        <source>Export Address List</source>\n        <translation>匯出位址清單</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>逗點分隔資料檔(*.csv)</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>匯出失敗</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the address list to %1. Please try again.</source>\n        <translation>儲存位址列表到 %1 時發生錯誤。請重試一次。</translation>\n    </message>\n</context>\n<context>\n    <name>AddressTableModel</name>\n    <message>\n        <source>Label</source>\n        <translation>標記</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>位址</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(無標記)</translation>\n    </message>\n</context>\n<context>\n    <name>AskPassphraseDialog</name>\n    <message>\n        <source>Passphrase Dialog</source>\n        <translation>密碼對話視窗</translation>\n    </message>\n    <message>\n        <source>Enter passphrase</source>\n        <translation>請輸入密碼</translation>\n    </message>\n    <message>\n        <source>New passphrase</source>\n        <translation>新密碼</translation>\n    </message>\n    <message>\n        <source>Repeat new passphrase</source>\n        <translation>重複新密碼</translation>\n    </message>\n    <message>\n        <source>Show password</source>\n        <translation>顯示密碼</translation>\n    </message>\n    <message>\n        <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source>\n        <translation>輸入錢包的新密碼。&lt;br/&gt;密碼請用&lt;b&gt;10 個以上的隨機字元&lt;/b&gt;，或是&lt;b&gt;8 個以上的字詞&lt;/b&gt;。</translation>\n    </message>\n    <message>\n        <source>Encrypt wallet</source>\n        <translation>加密錢包</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to unlock the wallet.</source>\n        <translation>這個動作需要你的錢包密碼來解鎖錢包。</translation>\n    </message>\n    <message>\n        <source>Unlock wallet</source>\n        <translation>解鎖錢包</translation>\n    </message>\n    <message>\n        <source>This operation needs your wallet passphrase to decrypt the wallet.</source>\n        <translation>這個動作需要你的錢包密碼來把錢包解密。</translation>\n    </message>\n    <message>\n        <source>Decrypt wallet</source>\n        <translation>解密錢包</translation>\n    </message>\n    <message>\n        <source>Change passphrase</source>\n        <translation>改變密碼</translation>\n    </message>\n    <message>\n        <source>Enter the old passphrase and new passphrase to the wallet.</source>\n        <translation>請輸入錢包的舊密碼和新密碼。</translation>\n    </message>\n    <message>\n        <source>Confirm wallet encryption</source>\n        <translation>確認錢包加密</translation>\n    </message>\n    <message>\n        <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR BITCOINS&lt;/b&gt;!</source>\n        <translation>警告: 如果把錢包加密後又忘記密碼，你就會從此&lt;b&gt;失去其中所有的 Bitcoin 了&lt;/b&gt;！</translation>\n    </message>\n    <message>\n        <source>Are you sure you wish to encrypt your wallet?</source>\n        <translation>你確定要把錢包加密嗎？</translation>\n    </message>\n    <message>\n        <source>Wallet encrypted</source>\n        <translation>錢包已加密</translation>\n    </message>\n    <message>\n        <source>%1 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your bitcoins from being stolen by malware infecting your computer.</source>\n        <translation>%1 現在要關閉，好完成加密程序。請注意，加密錢包不能完全防止入侵你的電腦的惡意程式偷取錢幣。</translation>\n    </message>\n    <message>\n        <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>\n        <translation>重要: 請改用新產生有加密的錢包檔，來取代舊錢包檔的備份。為了安全性的理由，當你開始使用新的有加密的錢包後，舊錢包檔的備份就不能再使用了。</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed</source>\n        <translation>錢包加密失敗</translation>\n    </message>\n    <message>\n        <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>\n        <translation>因為內部錯誤導致錢包加密失敗。你的錢包還是沒加密。</translation>\n    </message>\n    <message>\n        <source>The supplied passphrases do not match.</source>\n        <translation>提供的密碼不一樣。</translation>\n    </message>\n    <message>\n        <source>Wallet unlock failed</source>\n        <translation>錢包解鎖失敗</translation>\n    </message>\n    <message>\n        <source>The passphrase entered for the wallet decryption was incorrect.</source>\n        <translation>輸入要用來解密錢包的密碼不對。</translation>\n    </message>\n    <message>\n        <source>Wallet decryption failed</source>\n        <translation>錢包解密失敗</translation>\n    </message>\n    <message>\n        <source>Wallet passphrase was successfully changed.</source>\n        <translation>錢包密碼改成功了。</translation>\n    </message>\n    <message>\n        <source>Warning: The Caps Lock key is on!</source>\n        <translation>警告: 大寫字母鎖定作用中！</translation>\n    </message>\n</context>\n<context>\n    <name>BanTableModel</name>\n    <message>\n        <source>IP/Netmask</source>\n        <translation>網路位址/遮罩</translation>\n    </message>\n    <message>\n        <source>Banned Until</source>\n        <translation>禁止期限</translation>\n    </message>\n</context>\n<context>\n    <name>BitcoinGUI</name>\n    <message>\n        <source>Sign &amp;message...</source>\n        <translation>簽署訊息(&amp;M)...</translation>\n    </message>\n    <message>\n        <source>Synchronizing with network...</source>\n        <translation>正在跟網路進行同步...</translation>\n    </message>\n    <message>\n        <source>&amp;Overview</source>\n        <translation>總覽(&amp;O)</translation>\n    </message>\n    <message>\n        <source>Node</source>\n        <translation>節點</translation>\n    </message>\n    <message>\n        <source>Show general overview of wallet</source>\n        <translation>顯示錢包一般總覽</translation>\n    </message>\n    <message>\n        <source>&amp;Transactions</source>\n        <translation>交易(&amp;T)</translation>\n    </message>\n    <message>\n        <source>Browse transaction history</source>\n        <translation>瀏覽交易紀錄</translation>\n    </message>\n    <message>\n        <source>E&amp;xit</source>\n        <translation>結束(&amp;X)</translation>\n    </message>\n    <message>\n        <source>Quit application</source>\n        <translation>結束應用程式</translation>\n    </message>\n    <message>\n        <source>&amp;About %1</source>\n        <translation>關於%1(&amp;A)</translation>\n    </message>\n    <message>\n        <source>Show information about %1</source>\n        <translation>顯示 %1 的相關資訊</translation>\n    </message>\n    <message>\n        <source>About &amp;Qt</source>\n        <translation>關於 &amp;Qt</translation>\n    </message>\n    <message>\n        <source>Show information about Qt</source>\n        <translation>顯示 Qt 相關資訊</translation>\n    </message>\n    <message>\n        <source>&amp;Options...</source>\n        <translation>選項(&amp;O)...</translation>\n    </message>\n    <message>\n        <source>Modify configuration options for %1</source>\n        <translation>修改 %1 的設定選項</translation>\n    </message>\n    <message>\n        <source>&amp;Encrypt Wallet...</source>\n        <translation>加密錢包(&amp;E)...</translation>\n    </message>\n    <message>\n        <source>&amp;Backup Wallet...</source>\n        <translation>備份錢包(&amp;B)...</translation>\n    </message>\n    <message>\n        <source>&amp;Change Passphrase...</source>\n        <translation>改變密碼(&amp;C)...</translation>\n    </message>\n    <message>\n        <source>&amp;Sending addresses...</source>\n        <translation>付款位址(&amp;S)...</translation>\n    </message>\n    <message>\n        <source>&amp;Receiving addresses...</source>\n        <translation>收款位址(&amp;R)...</translation>\n    </message>\n    <message>\n        <source>Open &amp;URI...</source>\n        <translation>開啓 &amp;URI...</translation>\n    </message>\n    <message>\n        <source>Click to disable network activity.</source>\n        <translation>按一下就會不使用網路。</translation>\n    </message>\n    <message>\n        <source>Network activity disabled.</source>\n        <translation>網路活動關閉了。</translation>\n    </message>\n    <message>\n        <source>Click to enable network activity again.</source>\n        <translation>按一下就又會使用網路。</translation>\n    </message>\n    <message>\n        <source>Syncing Headers (%1%)...</source>\n        <translation>正在同步前導資料(%1%)中...</translation>\n    </message>\n    <message>\n        <source>Reindexing blocks on disk...</source>\n        <translation>正在為磁碟裡的區塊重建索引...</translation>\n    </message>\n    <message>\n        <source>Send coins to a Bitcoin address</source>\n        <translation>付錢給一個 Bitcoin 位址</translation>\n    </message>\n    <message>\n        <source>Backup wallet to another location</source>\n        <translation>把錢包備份到其它地方</translation>\n    </message>\n    <message>\n        <source>Change the passphrase used for wallet encryption</source>\n        <translation>改變錢包加密用的密碼</translation>\n    </message>\n    <message>\n        <source>&amp;Debug window</source>\n        <translation>除錯視窗(&amp;D)</translation>\n    </message>\n    <message>\n        <source>Open debugging and diagnostic console</source>\n        <translation>開啓除錯和診斷主控台</translation>\n    </message>\n    <message>\n        <source>&amp;Verify message...</source>\n        <translation>驗證訊息(&amp;V)...</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>Wallet</source>\n        <translation>錢包</translation>\n    </message>\n    <message>\n        <source>&amp;Send</source>\n        <translation>付款(&amp;S)</translation>\n    </message>\n    <message>\n        <source>&amp;Receive</source>\n        <translation>收款(&amp;R)</translation>\n    </message>\n    <message>\n        <source>&amp;Show / Hide</source>\n        <translation>顯示或隱藏(&amp;S)</translation>\n    </message>\n    <message>\n        <source>Show or hide the main Window</source>\n        <translation>顯示或隱藏主視窗</translation>\n    </message>\n    <message>\n        <source>Encrypt the private keys that belong to your wallet</source>\n        <translation>把錢包中的密鑰加密</translation>\n    </message>\n    <message>\n        <source>Sign messages with your Bitcoin addresses to prove you own them</source>\n        <translation>用 Bitcoin 位址簽署訊息來證明位址是你的</translation>\n    </message>\n    <message>\n        <source>Verify messages to ensure they were signed with specified Bitcoin addresses</source>\n        <translation>驗證訊息是用來確定訊息是用指定的 Bitcoin 位址簽署的</translation>\n    </message>\n    <message>\n        <source>&amp;File</source>\n        <translation>檔案(&amp;F)</translation>\n    </message>\n    <message>\n        <source>&amp;Settings</source>\n        <translation>設定(&amp;S)</translation>\n    </message>\n    <message>\n        <source>&amp;Help</source>\n        <translation>說明(&amp;H)</translation>\n    </message>\n    <message>\n        <source>Tabs toolbar</source>\n        <translation>分頁工具列</translation>\n    </message>\n    <message>\n        <source>Request payments (generates QR codes and bitcoin: URIs)</source>\n        <translation>要求付款(產生 QR Code 和 bitcoin 付款協議的資源識別碼: URI)</translation>\n    </message>\n    <message>\n        <source>Show the list of used sending addresses and labels</source>\n        <translation>顯示已使用過的付款位址和標記的清單</translation>\n    </message>\n    <message>\n        <source>Show the list of used receiving addresses and labels</source>\n        <translation>顯示已使用過的收款位址和標記的清單</translation>\n    </message>\n    <message>\n        <source>Open a bitcoin: URI or payment request</source>\n        <translation>開啓 bitcoin 協議的資源識別碼(URI)或付款要求</translation>\n    </message>\n    <message>\n        <source>&amp;Command-line options</source>\n        <translation>命令列選項(&amp;C)</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n active connection(s) to Bitcoin network</source>\n        <translation><numerusform>%n 個運作中的 Bitcoin 網路連線</numerusform></translation>\n    </message>\n    <message>\n        <source>Indexing blocks on disk...</source>\n        <translation>正在為磁碟裡的區塊建立索引...</translation>\n    </message>\n    <message>\n        <source>Processing blocks on disk...</source>\n        <translation>正在處理磁碟裡的區塊資料...</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Processed %n block(s) of transaction history.</source>\n        <translation><numerusform>已經處理了 %n 個區塊的交易紀錄。</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 behind</source>\n        <translation>落後 %1</translation>\n    </message>\n    <message>\n        <source>Last received block was generated %1 ago.</source>\n        <translation>最近收到的區塊是在 %1 以前生出來的。</translation>\n    </message>\n    <message>\n        <source>Transactions after this will not yet be visible.</source>\n        <translation>暫時會看不到在這之後的交易。</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>錯誤</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>資訊</translation>\n    </message>\n    <message>\n        <source>Up to date</source>\n        <translation>最新狀態</translation>\n    </message>\n    <message>\n        <source>Show the %1 help message to get a list with possible Bitcoin command-line options</source>\n        <translation>顯示 %1 的說明訊息，來取得可用命令列選項的列表</translation>\n    </message>\n    <message>\n        <source>%1 client</source>\n        <translation>%1 客戶端軟體</translation>\n    </message>\n    <message>\n        <source>Connecting to peers...</source>\n        <translation>正在跟其他節點連線中...</translation>\n    </message>\n    <message>\n        <source>Catching up...</source>\n        <translation>正在趕進度...</translation>\n    </message>\n    <message>\n        <source>Date: %1\n</source>\n        <translation>日期: %1\n</translation>\n    </message>\n    <message>\n        <source>Amount: %1\n</source>\n        <translation>金額: %1\n</translation>\n    </message>\n    <message>\n        <source>Type: %1\n</source>\n        <translation>種類: %1\n</translation>\n    </message>\n    <message>\n        <source>Label: %1\n</source>\n        <translation>標記: %1\n</translation>\n    </message>\n    <message>\n        <source>Address: %1\n</source>\n        <translation>位址: %1\n</translation>\n    </message>\n    <message>\n        <source>Sent transaction</source>\n        <translation>付款交易</translation>\n    </message>\n    <message>\n        <source>Incoming transaction</source>\n        <translation>收款交易</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;enabled&lt;/b&gt;</source>\n        <translation>產生 HD 金鑰&lt;b&gt;已經啟用&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>HD key generation is &lt;b&gt;disabled&lt;/b&gt;</source>\n        <translation>產生 HD 金鑰&lt;b&gt;已經停用&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source>\n        <translation>錢包&lt;b&gt;已加密&lt;/b&gt;並且&lt;b&gt;解鎖中&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source>\n        <translation>錢包&lt;b&gt;已加密&lt;/b&gt;並且&lt;b&gt;上鎖中&lt;/b&gt;</translation>\n    </message>\n    <message>\n        <source>A fatal error occurred. Bitcoin can no longer continue safely and will quit.</source>\n        <translation>發生了致命的錯誤。Bitcoin 軟體沒辦法再繼續安全執行，只好結束。</translation>\n    </message>\n</context>\n<context>\n    <name>CoinControlDialog</name>\n    <message>\n        <source>Coin Selection</source>\n        <translation>選擇錢幣</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>數目:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>位元組數:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>金額:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>手續費:</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>零散錢:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>計費後金額:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>找零金額:</translation>\n    </message>\n    <message>\n        <source>(un)select all</source>\n        <translation>全選或全不選</translation>\n    </message>\n    <message>\n        <source>Tree mode</source>\n        <translation>樹狀模式</translation>\n    </message>\n    <message>\n        <source>List mode</source>\n        <translation>列表模式</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>金額</translation>\n    </message>\n    <message>\n        <source>Received with label</source>\n        <translation>收款標記</translation>\n    </message>\n    <message>\n        <source>Received with address</source>\n        <translation>收款位址</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    <message>\n        <source>Confirmations</source>\n        <translation>確認次數</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>已確認</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>複製位址</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>複製標記</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>複製金額</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>複製交易識別碼</translation>\n    </message>\n    <message>\n        <source>Lock unspent</source>\n        <translation>鎖定不用</translation>\n    </message>\n    <message>\n        <source>Unlock unspent</source>\n        <translation>解鎖可用</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>複製數目</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>複製手續費</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>複製計費後金額</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>複製位元組數</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>複製零散金額</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>複製找零金額</translation>\n    </message>\n    <message>\n        <source>(%1 locked)</source>\n        <translation>(鎖定 %1 枚)</translation>\n    </message>\n    <message>\n        <source>yes</source>\n        <translation>是</translation>\n    </message>\n    <message>\n        <source>no</source>\n        <translation>否</translation>\n    </message>\n    <message>\n        <source>This label turns red if any recipient receives an amount smaller than the current dust threshold.</source>\n        <translation>當任何一個收款金額小於目前的零散金額上限時，文字會變紅色。</translation>\n    </message>\n    <message>\n        <source>Can vary +/- %1 satoshi(s) per input.</source>\n        <translation>每組輸入可能有 +/- %1 個 satoshi 的誤差。</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(無標記)</translation>\n    </message>\n    <message>\n        <source>change from %1 (%2)</source>\n        <translation>找零前是 %1 (%2)</translation>\n    </message>\n    <message>\n        <source>(change)</source>\n        <translation>(找零)</translation>\n    </message>\n</context>\n<context>\n    <name>EditAddressDialog</name>\n    <message>\n        <source>Edit Address</source>\n        <translation>編輯位址</translation>\n    </message>\n    <message>\n        <source>&amp;Label</source>\n        <translation>標記(&amp;L)</translation>\n    </message>\n    <message>\n        <source>The label associated with this address list entry</source>\n        <translation>跟這個位址簿項目關聯的標記</translation>\n    </message>\n    <message>\n        <source>The address associated with this address list entry. This can only be modified for sending addresses.</source>\n        <translation>跟這個位址簿項目關聯的位址。只有付款位址能被修改。</translation>\n    </message>\n    <message>\n        <source>&amp;Address</source>\n        <translation>位址(&amp;A)</translation>\n    </message>\n    <message>\n        <source>New receiving address</source>\n        <translation>造新的收款位址</translation>\n    </message>\n    <message>\n        <source>New sending address</source>\n        <translation>造新的付款位址</translation>\n    </message>\n    <message>\n        <source>Edit receiving address</source>\n        <translation>編輯收款位址</translation>\n    </message>\n    <message>\n        <source>Edit sending address</source>\n        <translation>編輯付款位址</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is not a valid Bitcoin address.</source>\n        <translation>輸入的位址 %1 並不是有效的 Bitcoin 位址。</translation>\n    </message>\n    <message>\n        <source>The entered address \"%1\" is already in the address book.</source>\n        <translation>輸入的位址 %1 在位址簿中已經有了。</translation>\n    </message>\n    <message>\n        <source>Could not unlock wallet.</source>\n        <translation>沒辦法把錢包解鎖。</translation>\n    </message>\n    <message>\n        <source>New key generation failed.</source>\n        <translation>產生新的密鑰失敗了。</translation>\n    </message>\n</context>\n<context>\n    <name>FreespaceChecker</name>\n    <message>\n        <source>A new data directory will be created.</source>\n        <translation>就要產生新的資料目錄。</translation>\n    </message>\n    <message>\n        <source>name</source>\n        <translation>名稱</translation>\n    </message>\n    <message>\n        <source>Directory already exists. Add %1 if you intend to create a new directory here.</source>\n        <translation>已經有這個目錄了。如果你要在裡面造出新的目錄的話，請加上 %1.</translation>\n    </message>\n    <message>\n        <source>Path already exists, and is not a directory.</source>\n        <translation>已經有指定的路徑了，並且不是一個目錄。</translation>\n    </message>\n    <message>\n        <source>Cannot create data directory here.</source>\n        <translation>沒辦法在這裡造出資料目錄。</translation>\n    </message>\n</context>\n<context>\n    <name>HelpMessageDialog</name>\n    <message>\n        <source>version</source>\n        <translation>版本</translation>\n    </message>\n    <message>\n        <source>(%1-bit)</source>\n        <translation>(%1 位元)</translation>\n    </message>\n    <message>\n        <source>About %1</source>\n        <translation>關於 %1</translation>\n    </message>\n    <message>\n        <source>Command-line options</source>\n        <translation>命令列選項</translation>\n    </message>\n    <message>\n        <source>Usage:</source>\n        <translation>用法:</translation>\n    </message>\n    <message>\n        <source>command-line options</source>\n        <translation>命令列選項</translation>\n    </message>\n    <message>\n        <source>UI Options:</source>\n        <translation>使用介面選項:</translation>\n    </message>\n    <message>\n        <source>Choose data directory on startup (default: %u)</source>\n        <translation>啓動時選擇資料目錄(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Set language, for example \"de_DE\" (default: system locale)</source>\n        <translation>設定語言，比如說 de_DE (預設值: 系統語系)</translation>\n    </message>\n    <message>\n        <source>Start minimized</source>\n        <translation>啓動時縮到最小</translation>\n    </message>\n    <message>\n        <source>Set SSL root certificates for payment request (default: -system-)</source>\n        <translation>設定付款請求時所使用的 SSL 根憑證(預設值: 系統憑證庫)</translation>\n    </message>\n    <message>\n        <source>Show splash screen on startup (default: %u)</source>\n        <translation>顯示啓動畫面(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Reset all settings changed in the GUI</source>\n        <translation>重置所有在使用界面更改的設定</translation>\n    </message>\n</context>\n<context>\n    <name>Intro</name>\n    <message>\n        <source>Welcome</source>\n        <translation>歡迎</translation>\n    </message>\n    <message>\n        <source>Welcome to %1.</source>\n        <translation>歡迎使用 %1。</translation>\n    </message>\n    <message>\n        <source>As this is the first time the program is launched, you can choose where %1 will store its data.</source>\n        <translation>因為這是程式第一次啓動，你可以選擇 %1 儲存資料的地方。</translation>\n    </message>\n    <message>\n        <source>When you click OK, %1 will begin to download and process the full %4 block chain (%2GB) starting with the earliest transactions in %3 when %4 initially launched.</source>\n        <translation>在你按下「好」之後，%1 就會開始下載並處理整個 %4 區塊鏈(大小是  %2GB)，也就是從 %3 年 %4 剛剛起步時的最初交易開始。</translation>\n    </message>\n    <message>\n        <source>This initial synchronisation is very demanding, and may expose hardware problems with your computer that had previously gone unnoticed. Each time you run %1, it will continue downloading where it left off.</source>\n        <translation>一開始的同步作業非常的耗費資源，並且可能會暴露出之前沒被發現的電腦硬體問題。每次執行 %1 的時候都會繼續先前未完成的下載。</translation>\n    </message>\n    <message>\n        <source>If you have chosen to limit block chain storage (pruning), the historical data must still be downloaded and processed, but will be deleted afterward to keep your disk usage low.</source>\n        <translation>如果你選擇要限制區塊鏈儲存空間的大小(修剪模式)，還是需要下載和處理過去的歷史資料被，但是之後就會把它刪掉來節省磁碟使用量。</translation>\n    </message>\n    <message>\n        <source>Use the default data directory</source>\n        <translation>使用預設的資料目錄</translation>\n    </message>\n    <message>\n        <source>Use a custom data directory:</source>\n        <translation>使用自訂的資料目錄:</translation>\n    </message>\n    <message>\n        <source>Bitcoin</source>\n        <translation>Bitcoin</translation>\n    </message>\n    <message>\n        <source>At least %1 GB of data will be stored in this directory, and it will grow over time.</source>\n        <translation>在這個目錄中至少會存放 %1 GB 的資料，並且還會隨時間增加。</translation>\n    </message>\n    <message>\n        <source>Approximately %1 GB of data will be stored in this directory.</source>\n        <translation>在這個目錄中大約會存放 %1 GB 的資料。</translation>\n    </message>\n    <message>\n        <source>%1 will download and store a copy of the Bitcoin block chain.</source>\n        <translation>%1 會下載 Bitcoin 區塊鏈並且儲存一份副本。</translation>\n    </message>\n    <message>\n        <source>The wallet will also be stored in this directory.</source>\n        <translation>錢包檔也會存放在這個目錄中。</translation>\n    </message>\n    <message>\n        <source>Error: Specified data directory \"%1\" cannot be created.</source>\n        <translation>錯誤: 無法新增指定的資料目錄: %1</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>錯誤</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n GB of free space available</source>\n        <translation><numerusform>可用空間尚存 %n GB</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>(of %n GB needed)</source>\n        <translation><numerusform>(需要 %n GB)</numerusform></translation>\n    </message>\n</context>\n<context>\n    <name>ModalOverlay</name>\n    <message>\n        <source>Form</source>\n        <translation>表單</translation>\n    </message>\n    <message>\n        <source>Recent transactions may not yet be visible, and therefore your wallet's balance might be incorrect. This information will be correct once your wallet has finished synchronizing with the bitcoin network, as detailed below.</source>\n        <translation>最近的交易可能還看不到，因此錢包餘額可能不正確。在錢包軟體完成跟 bitcoin 網路的同步後，這裡的資訊就會正確。詳情請見下面。</translation>\n    </message>\n    <message>\n        <source>Attempting to spend bitcoins that are affected by not-yet-displayed transactions will not be accepted by the network.</source>\n        <translation>使用還沒顯示出來的交易所影響到的 bitcoin 可能會不被網路所接受。</translation>\n    </message>\n    <message>\n        <source>Number of blocks left</source>\n        <translation>剩餘區塊數</translation>\n    </message>\n    <message>\n        <source>Unknown...</source>\n        <translation>不明...</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>最近區塊時間</translation>\n    </message>\n    <message>\n        <source>Progress</source>\n        <translation>進度</translation>\n    </message>\n    <message>\n        <source>Progress increase per hour</source>\n        <translation>每小時進度</translation>\n    </message>\n    <message>\n        <source>calculating...</source>\n        <translation>正在計算中...</translation>\n    </message>\n    <message>\n        <source>Estimated time left until synced</source>\n        <translation>預估完成同步所需時間</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>隱藏</translation>\n    </message>\n    <message>\n        <source>Unknown. Syncing Headers (%1)...</source>\n        <translation>不明。正在同步前導資料(%1)中...</translation>\n    </message>\n</context>\n<context>\n    <name>OpenURIDialog</name>\n    <message>\n        <source>Open URI</source>\n        <translation>開啓 URI</translation>\n    </message>\n    <message>\n        <source>Open payment request from URI or file</source>\n        <translation>從 URI 或檔案開啟付款要求</translation>\n    </message>\n    <message>\n        <source>URI:</source>\n        <translation>URI:</translation>\n    </message>\n    <message>\n        <source>Select payment request file</source>\n        <translation>選擇付款要求資料檔</translation>\n    </message>\n    <message>\n        <source>Select payment request file to open</source>\n        <translation>選擇要開啟的付款要求資料檔</translation>\n    </message>\n</context>\n<context>\n    <name>OptionsDialog</name>\n    <message>\n        <source>Options</source>\n        <translation>選項</translation>\n    </message>\n    <message>\n        <source>&amp;Main</source>\n        <translation>主要(&amp;M)</translation>\n    </message>\n    <message>\n        <source>Automatically start %1 after logging in to the system.</source>\n        <translation>在登入系統後自動啓動 %1。</translation>\n    </message>\n    <message>\n        <source>&amp;Start %1 on system login</source>\n        <translation>系統登入時啟動 %1 (&amp;S)</translation>\n    </message>\n    <message>\n        <source>Size of &amp;database cache</source>\n        <translation>資料庫快取大小(&amp;D)</translation>\n    </message>\n    <message>\n        <source>MB</source>\n        <translation>MB (百萬位元組)</translation>\n    </message>\n    <message>\n        <source>Number of script &amp;verification threads</source>\n        <translation>指令碼驗證執行緒數目(&amp;V)</translation>\n    </message>\n    <message>\n        <source>IP address of the proxy (e.g. IPv4: 127.0.0.1 / IPv6: ::1)</source>\n        <translation>代理伺服器的網際網路位址(像是 IPv4 的 127.0.0.1 或 IPv6 的 ::1)</translation>\n    </message>\n    <message>\n        <source>Shows if the supplied default SOCKS5 proxy is used to reach peers via this network type.</source>\n        <translation>如果對這種網路類型，有指定用來跟其他節點聯絡的 SOCKS5 代理伺服器的話，就會顯示在這裡。</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS&amp;5 proxy to reach peers via Tor hidden services:</source>\n        <translation>透過另外的 SOCKS&amp;5 代理伺服器來連線到 Bitcoin 網路中的 Tor 隱藏服務:</translation>\n    </message>\n    <message>\n        <source>Hide the icon from the system tray.</source>\n        <translation>隱藏系統通知區圖示</translation>\n    </message>\n    <message>\n        <source>&amp;Hide tray icon</source>\n        <translation>隱藏通知區圖示(&amp;H)</translation>\n    </message>\n    <message>\n        <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Exit in the menu.</source>\n        <translation>當視窗關閉時，把應用程式縮到最小，而不是結束。當勾選這個選項時，只能夠用選單中的結束來關掉應用程式。</translation>\n    </message>\n    <message>\n        <source>Third party URLs (e.g. a block explorer) that appear in the transactions tab as context menu items. %s in the URL is replaced by transaction hash. Multiple URLs are separated by vertical bar |.</source>\n        <translation>在交易頁籤的情境選單出現的第三方網址連結(URL)，比如說區塊探索網站。網址中的 %s 會被取代為交易的雜湊值。可以用直線符號 | 來分隔多個連結。</translation>\n    </message>\n    <message>\n        <source>Active command-line options that override above options:</source>\n        <translation>從命令列取代掉以上設定的選項有:</translation>\n    </message>\n    <message>\n        <source>Open the %1 configuration file from the working directory.</source>\n        <translation>從工作目錄開啟設定檔 %1。</translation>\n    </message>\n    <message>\n        <source>Open Configuration File</source>\n        <translation>開啟設定檔</translation>\n    </message>\n    <message>\n        <source>Reset all client options to default.</source>\n        <translation>重設所有客戶端軟體選項成預設值。</translation>\n    </message>\n    <message>\n        <source>&amp;Reset Options</source>\n        <translation>重設選項(&amp;R)</translation>\n    </message>\n    <message>\n        <source>&amp;Network</source>\n        <translation>網路(&amp;N)</translation>\n    </message>\n    <message>\n        <source>(0 = auto, &lt;0 = leave that many cores free)</source>\n        <translation>(0 表示程式自動決定，小於 0 表示保留處理器核心不用的數目)</translation>\n    </message>\n    <message>\n        <source>W&amp;allet</source>\n        <translation>錢包(&amp;A)</translation>\n    </message>\n    <message>\n        <source>Expert</source>\n        <translation>專家</translation>\n    </message>\n    <message>\n        <source>Enable coin &amp;control features</source>\n        <translation>開啟錢幣控制功能(&amp;C)</translation>\n    </message>\n    <message>\n        <source>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</source>\n        <translation>如果你關掉「可以花還沒確認的零錢」，那麼交易中找零的零錢就必須要等交易至少有一次確認後，才能夠使用。這也會影響餘額的計算方式。</translation>\n    </message>\n    <message>\n        <source>&amp;Spend unconfirmed change</source>\n        <translation>可以花還沒確認的零錢(&amp;S)</translation>\n    </message>\n    <message>\n        <source>Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>\n        <translation>自動在路由器上開放 Bitcoin 的客戶端通訊埠。只有在你的路由器支援且開啓「通用即插即用」協定(UPnP)時才有作用。</translation>\n    </message>\n    <message>\n        <source>Map port using &amp;UPnP</source>\n        <translation>用 &amp;UPnP 設定通訊埠對應</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside.</source>\n        <translation>接受外來連線</translation>\n    </message>\n    <message>\n        <source>Allow incomin&amp;g connections</source>\n        <translation>接受外來連線(&amp;G)</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a SOCKS5 proxy.</source>\n        <translation>透過 SOCKS5 代理伺服器來連線到 Bitcoin 網路。</translation>\n    </message>\n    <message>\n        <source>&amp;Connect through SOCKS5 proxy (default proxy):</source>\n        <translation>透過 SOCKS5 代理伺服器連線(預設代理伺服器 &amp;C):</translation>\n    </message>\n    <message>\n        <source>Proxy &amp;IP:</source>\n        <translation>代理位址(&amp;I):</translation>\n    </message>\n    <message>\n        <source>&amp;Port:</source>\n        <translation>埠號(&amp;P):</translation>\n    </message>\n    <message>\n        <source>Port of the proxy (e.g. 9050)</source>\n        <translation>代理伺服器的通訊埠(像是 9050)</translation>\n    </message>\n    <message>\n        <source>Used for reaching peers via:</source>\n        <translation>用來跟其他節點聯絡的中介:</translation>\n    </message>\n    <message>\n        <source>IPv4</source>\n        <translation>IPv4</translation>\n    </message>\n    <message>\n        <source>IPv6</source>\n        <translation>IPv6</translation>\n    </message>\n    <message>\n        <source>Tor</source>\n        <translation>Tor</translation>\n    </message>\n    <message>\n        <source>Connect to the Bitcoin network through a separate SOCKS5 proxy for Tor hidden services.</source>\n        <translation>透過另外的 SOCKS5 代理伺服器來連線到 Bitcoin 網路中的 Tor 隱藏服務。</translation>\n    </message>\n    <message>\n        <source>&amp;Window</source>\n        <translation>視窗(&amp;W)</translation>\n    </message>\n    <message>\n        <source>Show only a tray icon after minimizing the window.</source>\n        <translation>視窗縮到最小後只在通知區顯示圖示。</translation>\n    </message>\n    <message>\n        <source>&amp;Minimize to the tray instead of the taskbar</source>\n        <translation>縮到最小到通知區而不是工作列(&amp;M)</translation>\n    </message>\n    <message>\n        <source>M&amp;inimize on close</source>\n        <translation>關閉時縮到最小(&amp;I)</translation>\n    </message>\n    <message>\n        <source>&amp;Display</source>\n        <translation>顯示(&amp;D)</translation>\n    </message>\n    <message>\n        <source>User Interface &amp;language:</source>\n        <translation>使用界面語言(&amp;L):</translation>\n    </message>\n    <message>\n        <source>The user interface language can be set here. This setting will take effect after restarting %1.</source>\n        <translation>可以在這裡設定使用者介面的語言。這個設定在重啓 %1 後才會生效。</translation>\n    </message>\n    <message>\n        <source>&amp;Unit to show amounts in:</source>\n        <translation>金額顯示單位(&amp;U):</translation>\n    </message>\n    <message>\n        <source>Choose the default subdivision unit to show in the interface and when sending coins.</source>\n        <translation>選擇操作界面和付款時，預設顯示金額的細分單位。</translation>\n    </message>\n    <message>\n        <source>Whether to show coin control features or not.</source>\n        <translation>是否要顯示錢幣控制功能。</translation>\n    </message>\n    <message>\n        <source>&amp;Third party transaction URLs</source>\n        <translation>第三方交易網址連結(&amp;T)</translation>\n    </message>\n    <message>\n        <source>&amp;OK</source>\n        <translation>好(&amp;O)</translation>\n    </message>\n    <message>\n        <source>&amp;Cancel</source>\n        <translation>取消(&amp;C)</translation>\n    </message>\n    <message>\n        <source>default</source>\n        <translation>預設值</translation>\n    </message>\n    <message>\n        <source>none</source>\n        <translation>無</translation>\n    </message>\n    <message>\n        <source>Confirm options reset</source>\n        <translation>確認重設選項</translation>\n    </message>\n    <message>\n        <source>Client restart required to activate changes.</source>\n        <translation>需要重新啟動客戶端軟體來讓改變生效。</translation>\n    </message>\n    <message>\n        <source>Client will be shut down. Do you want to proceed?</source>\n        <translation>客戶端軟體就要關掉了。繼續做下去嗎？</translation>\n    </message>\n    <message>\n        <source>Configuration options</source>\n        <translation>設定選項</translation>\n    </message>\n    <message>\n        <source>The configuration file is used to specify advanced user options which override GUI settings. Additionally, any command-line options will override this configuration file.</source>\n        <translation>設定檔可以用來指定進階的使用選項，並且會覆蓋掉圖形介面的設定。不過，命令列的選項也會覆蓋掉設定檔中的選項。</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>錯誤</translation>\n    </message>\n    <message>\n        <source>The configuration file could not be opened.</source>\n        <translation>沒辦法開啟設定檔。</translation>\n    </message>\n    <message>\n        <source>This change would require a client restart.</source>\n        <translation>這項改變需要重新啟動客戶端軟體。</translation>\n    </message>\n    <message>\n        <source>The supplied proxy address is invalid.</source>\n        <translation>提供的代理伺服器位址無效。</translation>\n    </message>\n</context>\n<context>\n    <name>OverviewPage</name>\n    <message>\n        <source>Form</source>\n        <translation>表單</translation>\n    </message>\n    <message>\n        <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Bitcoin network after a connection is established, but this process has not completed yet.</source>\n        <translation>顯示的資訊可能是過期的。跟 Bitcoin 網路的連線建立後，你的錢包會自動和網路同步，但是這個步驟還沒完成。</translation>\n    </message>\n    <message>\n        <source>Watch-only:</source>\n        <translation>只能看:</translation>\n    </message>\n    <message>\n        <source>Available:</source>\n        <translation>可用金額:</translation>\n    </message>\n    <message>\n        <source>Your current spendable balance</source>\n        <translation>目前可用餘額</translation>\n    </message>\n    <message>\n        <source>Pending:</source>\n        <translation>未定金額:</translation>\n    </message>\n    <message>\n        <source>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</source>\n        <translation>還沒被確認的交易的總金額，可用餘額不包含這些金額</translation>\n    </message>\n    <message>\n        <source>Immature:</source>\n        <translation>未成熟金額:</translation>\n    </message>\n    <message>\n        <source>Mined balance that has not yet matured</source>\n        <translation>還沒成熟的開採金額</translation>\n    </message>\n    <message>\n        <source>Balances</source>\n        <translation>餘額</translation>\n    </message>\n    <message>\n        <source>Total:</source>\n        <translation>總金額:</translation>\n    </message>\n    <message>\n        <source>Your current total balance</source>\n        <translation>目前全部餘額</translation>\n    </message>\n    <message>\n        <source>Your current balance in watch-only addresses</source>\n        <translation>所有只能看位址的目前餘額</translation>\n    </message>\n    <message>\n        <source>Spendable:</source>\n        <translation>可支配:</translation>\n    </message>\n    <message>\n        <source>Recent transactions</source>\n        <translation>最近的交易</translation>\n    </message>\n    <message>\n        <source>Unconfirmed transactions to watch-only addresses</source>\n        <translation>所有只能看位址還沒確認的交易</translation>\n    </message>\n    <message>\n        <source>Mined balance in watch-only addresses that has not yet matured</source>\n        <translation>所有只能看位址還沒成熟的開採金額</translation>\n    </message>\n    <message>\n        <source>Current total balance in watch-only addresses</source>\n        <translation>所有只能看位址的目前全部餘額</translation>\n    </message>\n</context>\n<context>\n    <name>PaymentServer</name>\n    <message>\n        <source>Payment request error</source>\n        <translation>要求付款時發生錯誤</translation>\n    </message>\n    <message>\n        <source>Cannot start bitcoin: click-to-pay handler</source>\n        <translation>沒辦法啟動 bitcoin 協議的「按就付」處理器</translation>\n    </message>\n    <message>\n        <source>URI handling</source>\n        <translation>URI 處理</translation>\n    </message>\n    <message>\n        <source>Payment request fetch URL is invalid: %1</source>\n        <translation>取得付款要求的 URL 無效: %1</translation>\n    </message>\n    <message>\n        <source>Invalid payment address %1</source>\n        <translation>無效的付款位址 %1</translation>\n    </message>\n    <message>\n        <source>URI cannot be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters.</source>\n        <translation>沒辦法解析 URI 位址！可能是因為 Bitcoin 位址無效，或是 URI 參數格式錯誤。</translation>\n    </message>\n    <message>\n        <source>Payment request file handling</source>\n        <translation>處理付款要求檔案</translation>\n    </message>\n    <message>\n        <source>Payment request file cannot be read! This can be caused by an invalid payment request file.</source>\n        <translation>沒辦法讀取付款要求檔案！可能是無效的檔案造成的。</translation>\n    </message>\n    <message>\n        <source>Payment request rejected</source>\n        <translation>付款的要求被拒絕了</translation>\n    </message>\n    <message>\n        <source>Payment request network doesn't match client network.</source>\n        <translation>付款要求的網路類型跟客戶端不符。</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>付款的要求過期了。</translation>\n    </message>\n    <message>\n        <source>Payment request is not initialized.</source>\n        <translation>付款的要求沒有完成初始化。</translation>\n    </message>\n    <message>\n        <source>Unverified payment requests to custom payment scripts are unsupported.</source>\n        <translation>不支援含有自訂付款指令碼，且沒驗證過的付款要求。</translation>\n    </message>\n    <message>\n        <source>Invalid payment request.</source>\n        <translation>付款的要求無效。</translation>\n    </message>\n    <message>\n        <source>Requested payment amount of %1 is too small (considered dust).</source>\n        <translation>要求付款的金額 %1 太少(會被網路認為是沒必要的零散錢)。</translation>\n    </message>\n    <message>\n        <source>Refund from %1</source>\n        <translation>來自 %1 的退款</translation>\n    </message>\n    <message>\n        <source>Payment request %1 is too large (%2 bytes, allowed %3 bytes).</source>\n        <translation>付款要求 %1 過大 (%2 位元組, 上限 %3 位元組).</translation>\n    </message>\n    <message>\n        <source>Error communicating with %1: %2</source>\n        <translation>跟 %1 通訊時發生錯誤: %2</translation>\n    </message>\n    <message>\n        <source>Payment request cannot be parsed!</source>\n        <translation>沒辦法解析付款要求內容！</translation>\n    </message>\n    <message>\n        <source>Bad response from server %1</source>\n        <translation>伺服器 %1 的回應有誤</translation>\n    </message>\n    <message>\n        <source>Network request error</source>\n        <translation>發出要求時發生網路錯誤</translation>\n    </message>\n    <message>\n        <source>Payment acknowledged</source>\n        <translation>付款已確認</translation>\n    </message>\n</context>\n<context>\n    <name>PeerTableModel</name>\n    <message>\n        <source>User Agent</source>\n        <translation>使用者代理</translation>\n    </message>\n    <message>\n        <source>Node/Service</source>\n        <translation>節點/服務</translation>\n    </message>\n    <message>\n        <source>NodeId</source>\n        <translation>節點識別碼</translation>\n    </message>\n    <message>\n        <source>Ping</source>\n        <translation>Ping  時間</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>送出</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>收到</translation>\n    </message>\n</context>\n<context>\n    <name>QObject</name>\n    <message>\n        <source>Amount</source>\n        <translation>金額</translation>\n    </message>\n    <message>\n        <source>Enter a Bitcoin address (e.g. %1)</source>\n        <translation>輸入 Bitcoin 位址 (比如說 %1)</translation>\n    </message>\n    <message>\n        <source>%1 d</source>\n        <translation>%1 天</translation>\n    </message>\n    <message>\n        <source>%1 h</source>\n        <translation>%1 小時</translation>\n    </message>\n    <message>\n        <source>%1 m</source>\n        <translation>%1 分鐘</translation>\n    </message>\n    <message>\n        <source>%1 s</source>\n        <translation>%1 秒</translation>\n    </message>\n    <message>\n        <source>None</source>\n        <translation>無</translation>\n    </message>\n    <message>\n        <source>N/A</source>\n        <translation>未知</translation>\n    </message>\n    <message>\n        <source>%1 ms</source>\n        <translation>%1 毫秒</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n second(s)</source>\n        <translation><numerusform>%n 秒鐘</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n minute(s)</source>\n        <translation><numerusform>%n 分鐘</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n hour(s)</source>\n        <translation><numerusform>%n 小時</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n day(s)</source>\n        <translation><numerusform>%n 天</numerusform></translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n week(s)</source>\n        <translation><numerusform>%n 星期</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 and %2</source>\n        <translation>%1又 %2</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>%n year(s)</source>\n        <translation><numerusform>%n 年</numerusform></translation>\n    </message>\n    <message>\n        <source>%1 B</source>\n        <translation>%1 B (位元組)</translation>\n    </message>\n    <message>\n        <source>%1 KB</source>\n        <translation>%1 KB (千位元組)</translation>\n    </message>\n    <message>\n        <source>%1 MB</source>\n        <translation>%1 MB (百萬位元組)</translation>\n    </message>\n    <message>\n        <source>%1 GB</source>\n        <translation>%1 GB (十億位元組)</translation>\n    </message>\n    <message>\n        <source>%1 didn't yet exit safely...</source>\n        <translation>%1 還沒有安全地結束...</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>未知</translation>\n    </message>\n</context>\n<context>\n    <name>QObject::QObject</name>\n    <message>\n        <source>Error: Specified data directory \"%1\" does not exist.</source>\n        <translation>錯誤: 不存在指定的資料目錄 \"%1\" 。</translation>\n    </message>\n    <message>\n        <source>Error: Cannot parse configuration file: %1. Only use key=value syntax.</source>\n        <translation>錯誤: 沒辦法解析設定檔: %1。只能用「名稱=設定值」這種語法。</translation>\n    </message>\n    <message>\n        <source>Error: %1</source>\n        <translation>錯誤: %1</translation>\n    </message>\n</context>\n<context>\n    <name>QRImageWidget</name>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>儲存圖片(&amp;S)...</translation>\n    </message>\n    <message>\n        <source>&amp;Copy Image</source>\n        <translation>複製圖片(&amp;C)</translation>\n    </message>\n    <message>\n        <source>Save QR Code</source>\n        <translation>儲存 QR Code</translation>\n    </message>\n    <message>\n        <source>PNG Image (*.png)</source>\n        <translation>PNG 圖檔(*.png)</translation>\n    </message>\n</context>\n<context>\n    <name>RPCConsole</name>\n    <message>\n        <source>N/A</source>\n        <translation>未知</translation>\n    </message>\n    <message>\n        <source>Client version</source>\n        <translation>客戶端軟體版本</translation>\n    </message>\n    <message>\n        <source>&amp;Information</source>\n        <translation>資訊(&amp;I)</translation>\n    </message>\n    <message>\n        <source>Debug window</source>\n        <translation>除錯視窗</translation>\n    </message>\n    <message>\n        <source>General</source>\n        <translation>普通</translation>\n    </message>\n    <message>\n        <source>Using BerkeleyDB version</source>\n        <translation>使用 BerkeleyDB 版本</translation>\n    </message>\n    <message>\n        <source>Datadir</source>\n        <translation>資料目錄</translation>\n    </message>\n    <message>\n        <source>Startup time</source>\n        <translation>啓動時間</translation>\n    </message>\n    <message>\n        <source>Network</source>\n        <translation>網路</translation>\n    </message>\n    <message>\n        <source>Name</source>\n        <translation>名稱</translation>\n    </message>\n    <message>\n        <source>Number of connections</source>\n        <translation>連線數</translation>\n    </message>\n    <message>\n        <source>Block chain</source>\n        <translation>區塊鏈</translation>\n    </message>\n    <message>\n        <source>Current number of blocks</source>\n        <translation>目前區塊數</translation>\n    </message>\n    <message>\n        <source>Memory Pool</source>\n        <translation>記憶體暫存池</translation>\n    </message>\n    <message>\n        <source>Current number of transactions</source>\n        <translation>目前交易數目</translation>\n    </message>\n    <message>\n        <source>Memory usage</source>\n        <translation>記憶體使用量</translation>\n    </message>\n    <message>\n        <source>&amp;Reset</source>\n        <translation>重置(&amp;R)</translation>\n    </message>\n    <message>\n        <source>Received</source>\n        <translation>收到</translation>\n    </message>\n    <message>\n        <source>Sent</source>\n        <translation>送出</translation>\n    </message>\n    <message>\n        <source>&amp;Peers</source>\n        <translation>節點(&amp;P)</translation>\n    </message>\n    <message>\n        <source>Banned peers</source>\n        <translation>被禁節點</translation>\n    </message>\n    <message>\n        <source>Select a peer to view detailed information.</source>\n        <translation>選一個節點來看詳細資訊</translation>\n    </message>\n    <message>\n        <source>Whitelisted</source>\n        <translation>列在白名單</translation>\n    </message>\n    <message>\n        <source>Direction</source>\n        <translation>方向</translation>\n    </message>\n    <message>\n        <source>Version</source>\n        <translation>版本</translation>\n    </message>\n    <message>\n        <source>Starting Block</source>\n        <translation>起始區塊</translation>\n    </message>\n    <message>\n        <source>Synced Headers</source>\n        <translation>已同步前導資料</translation>\n    </message>\n    <message>\n        <source>Synced Blocks</source>\n        <translation>已同步區塊</translation>\n    </message>\n    <message>\n        <source>User Agent</source>\n        <translation>使用者代理</translation>\n    </message>\n    <message>\n        <source>Open the %1 debug log file from the current data directory. This can take a few seconds for large log files.</source>\n        <translation>從目前的資料目錄下開啓 %1 的除錯紀錄檔。當紀錄檔很大時，可能會花好幾秒的時間。</translation>\n    </message>\n    <message>\n        <source>Decrease font size</source>\n        <translation>縮小文字</translation>\n    </message>\n    <message>\n        <source>Increase font size</source>\n        <translation>放大文字</translation>\n    </message>\n    <message>\n        <source>Services</source>\n        <translation>服務</translation>\n    </message>\n    <message>\n        <source>Ban Score</source>\n        <translation>惡劣分數</translation>\n    </message>\n    <message>\n        <source>Connection Time</source>\n        <translation>連線時間</translation>\n    </message>\n    <message>\n        <source>Last Send</source>\n        <translation>最近送出</translation>\n    </message>\n    <message>\n        <source>Last Receive</source>\n        <translation>最近收到</translation>\n    </message>\n    <message>\n        <source>Ping Time</source>\n        <translation>Ping 時間</translation>\n    </message>\n    <message>\n        <source>The duration of a currently outstanding ping.</source>\n        <translation>目前這一次 ping 已經過去的時間。</translation>\n    </message>\n    <message>\n        <source>Ping Wait</source>\n        <translation>Ping 等待時間</translation>\n    </message>\n    <message>\n        <source>Min Ping</source>\n        <translation>Ping 最短時間</translation>\n    </message>\n    <message>\n        <source>Time Offset</source>\n        <translation>時間差</translation>\n    </message>\n    <message>\n        <source>Last block time</source>\n        <translation>最近區塊時間</translation>\n    </message>\n    <message>\n        <source>&amp;Open</source>\n        <translation>開啓(&amp;O)</translation>\n    </message>\n    <message>\n        <source>&amp;Console</source>\n        <translation>主控台(&amp;C)</translation>\n    </message>\n    <message>\n        <source>&amp;Network Traffic</source>\n        <translation>網路流量(&amp;N)</translation>\n    </message>\n    <message>\n        <source>Totals</source>\n        <translation>總計</translation>\n    </message>\n    <message>\n        <source>In:</source>\n        <translation>來:</translation>\n    </message>\n    <message>\n        <source>Out:</source>\n        <translation>去:</translation>\n    </message>\n    <message>\n        <source>Debug log file</source>\n        <translation>除錯紀錄檔</translation>\n    </message>\n    <message>\n        <source>Clear console</source>\n        <translation>清主控台</translation>\n    </message>\n    <message>\n        <source>1 &amp;hour</source>\n        <translation>1 小時(&amp;H)</translation>\n    </message>\n    <message>\n        <source>1 &amp;day</source>\n        <translation>1 天(&amp;D)</translation>\n    </message>\n    <message>\n        <source>1 &amp;week</source>\n        <translation>1 星期(&amp;W)</translation>\n    </message>\n    <message>\n        <source>1 &amp;year</source>\n        <translation>1 年(&amp;Y)</translation>\n    </message>\n    <message>\n        <source>&amp;Disconnect</source>\n        <translation>斷線(&amp;D)</translation>\n    </message>\n    <message>\n        <source>Ban for</source>\n        <translation>禁止連線</translation>\n    </message>\n    <message>\n        <source>&amp;Unban</source>\n        <translation>連線解禁(&amp;U)</translation>\n    </message>\n    <message>\n        <source>Welcome to the %1 RPC console.</source>\n        <translation>歡迎使用 %1 的 RPC 主控台。</translation>\n    </message>\n    <message>\n        <source>Use up and down arrows to navigate history, and %1 to clear screen.</source>\n        <translation>請用游標上下鍵來瀏覽先前指令的紀錄，並用 %1 來清畫面。</translation>\n    </message>\n    <message>\n        <source>Type %1 for an overview of available commands.</source>\n        <translation>請打 %1 來看所有可用指令的簡介。</translation>\n    </message>\n    <message>\n        <source>For more information on using this console type %1.</source>\n        <translation>請打 %1 來取得使用這個主控台的更多資訊。</translation>\n    </message>\n    <message>\n        <source>WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.</source>\n        <translation>警告:  已知有詐騙集團會叫人在這個畫面輸入指令，以偷取他們錢包的內容物。如果你沒有充分理解指令可能造成的後果，請不要使用主控台。</translation>\n    </message>\n    <message>\n        <source>Network activity disabled</source>\n        <translation>網路活動已關閉</translation>\n    </message>\n    <message>\n        <source>(node id: %1)</source>\n        <translation>(節點識別碼: %1)</translation>\n    </message>\n    <message>\n        <source>via %1</source>\n        <translation>經由 %1</translation>\n    </message>\n    <message>\n        <source>never</source>\n        <translation>沒有過</translation>\n    </message>\n    <message>\n        <source>Inbound</source>\n        <translation>進來</translation>\n    </message>\n    <message>\n        <source>Outbound</source>\n        <translation>出去</translation>\n    </message>\n    <message>\n        <source>Yes</source>\n        <translation>是</translation>\n    </message>\n    <message>\n        <source>No</source>\n        <translation>否</translation>\n    </message>\n    <message>\n        <source>Unknown</source>\n        <translation>不明</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveCoinsDialog</name>\n    <message>\n        <source>&amp;Amount:</source>\n        <translation>金額(&amp;A):</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>標記(&amp;L):</translation>\n    </message>\n    <message>\n        <source>&amp;Message:</source>\n        <translation>訊息(&amp;M):</translation>\n    </message>\n    <message>\n        <source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Bitcoin network.</source>\n        <translation>附加在付款要求中的訊息，可以不填，打開要求內容時會顯示。注意: 這個訊息不會隨著付款送到 Bitcoin 網路上。</translation>\n    </message>\n    <message>\n        <source>An optional label to associate with the new receiving address.</source>\n        <translation>跟新收款位址關聯的標記，可以不填。</translation>\n    </message>\n    <message>\n        <source>Use this form to request payments. All fields are &lt;b&gt;optional&lt;/b&gt;.</source>\n        <translation>請用這份表單來要求付款。所有欄位都&lt;b&gt;可以不填&lt;/b&gt;。</translation>\n    </message>\n    <message>\n        <source>An optional amount to request. Leave this empty or zero to not request a specific amount.</source>\n        <translation>要求付款的金額，可以不填。不確定金額時可以留白或是填零。</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>把表單中的所有欄位清空。</translation>\n    </message>\n    <message>\n        <source>Clear</source>\n        <translation>清空</translation>\n    </message>\n    <message>\n        <source>Native segwit addresses (aka Bech32 or BIP-173) reduce your transaction fees later on and offer better protection against typos, but old wallets don't support them. When unchecked, an address compatible with older wallets will be created instead.</source>\n        <translation>使用 segwit 原生位址(也叫做 Bech32 或 BIP-173)可以減少日後的交易手續費，也比較不容易打錯字，不過會跟舊版的錢包軟體不相容。如果沒有勾選的話，會改產生與舊版錢包軟體相容的位址。</translation>\n    </message>\n    <message>\n        <source>Generate native segwit (Bech32) address</source>\n        <translation>產生 segwit 原生位址(Bech32)</translation>\n    </message>\n    <message>\n        <source>Requested payments history</source>\n        <translation>先前要求付款的記錄</translation>\n    </message>\n    <message>\n        <source>&amp;Request payment</source>\n        <translation>要求付款(&amp;R)</translation>\n    </message>\n    <message>\n        <source>Show the selected request (does the same as double clicking an entry)</source>\n        <translation>顯示選擇的要求內容(效果跟按它兩下一樣)</translation>\n    </message>\n    <message>\n        <source>Show</source>\n        <translation>顯示</translation>\n    </message>\n    <message>\n        <source>Remove the selected entries from the list</source>\n        <translation>從列表中刪掉選擇的項目</translation>\n    </message>\n    <message>\n        <source>Remove</source>\n        <translation>刪掉</translation>\n    </message>\n    <message>\n        <source>Copy URI</source>\n        <translation>複製 URI</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>複製標記</translation>\n    </message>\n    <message>\n        <source>Copy message</source>\n        <translation>複製訊息</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>複製金額</translation>\n    </message>\n</context>\n<context>\n    <name>ReceiveRequestDialog</name>\n    <message>\n        <source>QR Code</source>\n        <translation>QR Code</translation>\n    </message>\n    <message>\n        <source>Copy &amp;URI</source>\n        <translation>複製 &amp;URI</translation>\n    </message>\n    <message>\n        <source>Copy &amp;Address</source>\n        <translation>複製位址(&amp;A)</translation>\n    </message>\n    <message>\n        <source>&amp;Save Image...</source>\n        <translation>儲存圖片(&amp;S)...</translation>\n    </message>\n    <message>\n        <source>Request payment to %1</source>\n        <translation>付款給 %1 的要求</translation>\n    </message>\n    <message>\n        <source>Payment information</source>\n        <translation>付款資訊</translation>\n    </message>\n    <message>\n        <source>URI</source>\n        <translation>URI</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>位址</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>金額</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>標記:</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>訊息</translation>\n    </message>\n    <message>\n        <source>Resulting URI too long, try to reduce the text for label / message.</source>\n        <translation>產生的 URI 過長，請試著縮短標記或訊息的文字內容。</translation>\n    </message>\n    <message>\n        <source>Error encoding URI into QR Code.</source>\n        <translation>把 URI 編碼成 QR Code 時發生錯誤。</translation>\n    </message>\n</context>\n<context>\n    <name>RecentRequestsTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>標記:</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>訊息</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(無標記)</translation>\n    </message>\n    <message>\n        <source>(no message)</source>\n        <translation>(無訊息)</translation>\n    </message>\n    <message>\n        <source>(no amount requested)</source>\n        <translation>(無要求金額)</translation>\n    </message>\n    <message>\n        <source>Requested</source>\n        <translation>要求金額</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsDialog</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>付款</translation>\n    </message>\n    <message>\n        <source>Coin Control Features</source>\n        <translation>錢幣控制功能</translation>\n    </message>\n    <message>\n        <source>Inputs...</source>\n        <translation>輸入...</translation>\n    </message>\n    <message>\n        <source>automatically selected</source>\n        <translation>自動選擇</translation>\n    </message>\n    <message>\n        <source>Insufficient funds!</source>\n        <translation>累計金額不足！</translation>\n    </message>\n    <message>\n        <source>Quantity:</source>\n        <translation>數目:</translation>\n    </message>\n    <message>\n        <source>Bytes:</source>\n        <translation>位元組數:</translation>\n    </message>\n    <message>\n        <source>Amount:</source>\n        <translation>金額:</translation>\n    </message>\n    <message>\n        <source>Fee:</source>\n        <translation>手續費:</translation>\n    </message>\n    <message>\n        <source>After Fee:</source>\n        <translation>計費後金額:</translation>\n    </message>\n    <message>\n        <source>Change:</source>\n        <translation>找零金額:</translation>\n    </message>\n    <message>\n        <source>If this is activated, but the change address is empty or invalid, change will be sent to a newly generated address.</source>\n        <translation>如果這項有打開，但是找零位址是空的或無效，那麼找零的錢會送到一個新產生的位址去。</translation>\n    </message>\n    <message>\n        <source>Custom change address</source>\n        <translation>自訂找零位址</translation>\n    </message>\n    <message>\n        <source>Transaction Fee:</source>\n        <translation>交易手續費:</translation>\n    </message>\n    <message>\n        <source>Choose...</source>\n        <translation>選項...</translation>\n    </message>\n    <message>\n        <source>Using the fallbackfee can result in sending a transaction that will take several hours or days (or never) to confirm. Consider choosing your fee manually or wait until you have validated the complete chain.</source>\n        <translation>以備用手續費金額(fallbackfee)來付手續費可能會造成交易確認時間長達數小時、數天、或是永遠不會確認。請考慮自行指定金額，或是等到完全驗證區塊鏈後，再進行交易。</translation>\n    </message>\n    <message>\n        <source>Warning: Fee estimation is currently not possible.</source>\n        <translation>警告：目前無法計算預估手續費。</translation>\n    </message>\n    <message>\n        <source>collapse fee-settings</source>\n        <translation>展開手續費設定</translation>\n    </message>\n    <message>\n        <source>per kilobyte</source>\n        <translation>每千位元組</translation>\n    </message>\n    <message>\n        <source>If the custom fee is set to 1000 satoshis and the transaction is only 250 bytes, then \"per kilobyte\" only pays 250 satoshis in fee, while \"total at least\" pays 1000 satoshis. For transactions bigger than a kilobyte both pay by kilobyte.</source>\n        <translation>如果自訂手續費設定為 1000 satoshi, 而交易資料大小只有 250 個位元組的話，那麽選擇「每千位元組」就只會付 250 satoshi 的手續費，換做選「總共至少」就會付 1000 satoshi. 但是如果交易資料大小超過一千個位元組，那麽兩者都是每千位元組的費用。</translation>\n    </message>\n    <message>\n        <source>Hide</source>\n        <translation>隱藏</translation>\n    </message>\n    <message>\n        <source>Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for bitcoin transactions than the network can process.</source>\n        <translation>當交易量少於區塊可容納的空間時，只付最低手續費不會有什麽問題。但是當交易量的需求成長到超過整體網路可以處理的量時，可能會造成一筆一直不會被確認的交易。</translation>\n    </message>\n    <message>\n        <source>(read the tooltip)</source>\n        <translation>(請看提示)</translation>\n    </message>\n    <message>\n        <source>Recommended:</source>\n        <translation>建議值:</translation>\n    </message>\n    <message>\n        <source>Custom:</source>\n        <translation>自訂:</translation>\n    </message>\n    <message>\n        <source>(Smart fee not initialized yet. This usually takes a few blocks...)</source>\n        <translation>(手續費智慧演算法還沒準備好。通常都要等幾個區塊才行...)</translation>\n    </message>\n    <message>\n        <source>Send to multiple recipients at once</source>\n        <translation>一次付給多個收款人</translation>\n    </message>\n    <message>\n        <source>Add &amp;Recipient</source>\n        <translation>增加收款人(&amp;R)</translation>\n    </message>\n    <message>\n        <source>Clear all fields of the form.</source>\n        <translation>把表單中的所有欄位清空。</translation>\n    </message>\n    <message>\n        <source>Dust:</source>\n        <translation>零散錢:</translation>\n    </message>\n    <message>\n        <source>Confirmation time target:</source>\n        <translation>目標確認時間:</translation>\n    </message>\n    <message>\n        <source>Enable Replace-By-Fee</source>\n        <translation>啟用手續費追加</translation>\n    </message>\n    <message>\n        <source>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</source>\n        <translation>手續費追加(Replace-By-Fee, BIP-125)可以讓你在送出交易後才來提高手續費。不用這個功能的話，建議付比較高的手續費來降低交易延遲的風險。</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>全部清掉(&amp;A)</translation>\n    </message>\n    <message>\n        <source>Balance:</source>\n        <translation>餘額:</translation>\n    </message>\n    <message>\n        <source>Confirm the send action</source>\n        <translation>確認付款動作</translation>\n    </message>\n    <message>\n        <source>S&amp;end</source>\n        <translation>付款(&amp;E)</translation>\n    </message>\n    <message>\n        <source>Copy quantity</source>\n        <translation>複製數目</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>複製金額</translation>\n    </message>\n    <message>\n        <source>Copy fee</source>\n        <translation>複製手續費</translation>\n    </message>\n    <message>\n        <source>Copy after fee</source>\n        <translation>複製計費後金額</translation>\n    </message>\n    <message>\n        <source>Copy bytes</source>\n        <translation>複製位元組數</translation>\n    </message>\n    <message>\n        <source>Copy dust</source>\n        <translation>複製零散金額</translation>\n    </message>\n    <message>\n        <source>Copy change</source>\n        <translation>複製找零金額</translation>\n    </message>\n    <message>\n        <source>%1 (%2 blocks)</source>\n        <translation>%1 (%2 個區塊)</translation>\n    </message>\n    <message>\n        <source>%1 to %2</source>\n        <translation>%1 給 %2</translation>\n    </message>\n    <message>\n        <source>Are you sure you want to send?</source>\n        <translation>你確定要付錢出去嗎？</translation>\n    </message>\n    <message>\n        <source>added as transaction fee</source>\n        <translation>加做交易手續費</translation>\n    </message>\n    <message>\n        <source>Total Amount %1</source>\n        <translation>總金額 %1</translation>\n    </message>\n    <message>\n        <source>or</source>\n        <translation>或</translation>\n    </message>\n    <message>\n        <source>You can increase the fee later (signals Replace-By-Fee, BIP-125).</source>\n        <translation>你可以之後再提高手續費(有 BIP-125 手續費追加的標記)</translation>\n    </message>\n    <message>\n        <source>Not signalling Replace-By-Fee, BIP-125.</source>\n        <translation>沒有 BIP-125 手續費追加的標記。</translation>\n    </message>\n    <message>\n        <source>Confirm send coins</source>\n        <translation>確認付款金額</translation>\n    </message>\n    <message>\n        <source>The recipient address is not valid. Please recheck.</source>\n        <translation>收款位址無效。請再檢查看看。</translation>\n    </message>\n    <message>\n        <source>The amount to pay must be larger than 0.</source>\n        <translation>付款金額必須大於零。</translation>\n    </message>\n    <message>\n        <source>The amount exceeds your balance.</source>\n        <translation>金額超過餘額了。</translation>\n    </message>\n    <message>\n        <source>The total exceeds your balance when the %1 transaction fee is included.</source>\n        <translation>包含 %1 的交易手續費後，總金額超過你的餘額了。</translation>\n    </message>\n    <message>\n        <source>Duplicate address found: addresses should only be used once each.</source>\n        <translation>發現有重複的位址: 每個位址只能出現一次。</translation>\n    </message>\n    <message>\n        <source>Transaction creation failed!</source>\n        <translation>製造交易失敗了！</translation>\n    </message>\n    <message>\n        <source>The transaction was rejected with the following reason: %1</source>\n        <translation>交易因為以下原因被拒絕了: %1</translation>\n    </message>\n    <message>\n        <source>A fee higher than %1 is considered an absurdly high fee.</source>\n        <translation>高於 %1 的手續費會被認為是不合理。</translation>\n    </message>\n    <message>\n        <source>Payment request expired.</source>\n        <translation>付款的要求過期了。</translation>\n    </message>\n    <message>\n        <source>Pay only the required fee of %1</source>\n        <translation>只付必要的手續費 %1</translation>\n    </message>\n    <message>\n        <source>Warning: Invalid Bitcoin address</source>\n        <translation>警告: Bitcoin 位址無效</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown change address</source>\n        <translation>警告: 不明的找零位址</translation>\n    </message>\n    <message>\n        <source>Confirm custom change address</source>\n        <translation>自定找零位址確認</translation>\n    </message>\n    <message>\n        <source>The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?</source>\n        <translation>選擇的找零位址並不屬於這個錢包。部份或是全部的錢會被送到這個位址去。你確定嗎？</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(無標記)</translation>\n    </message>\n</context>\n<context>\n    <name>SendCoinsEntry</name>\n    <message>\n        <source>A&amp;mount:</source>\n        <translation>金額(&amp;M):</translation>\n    </message>\n    <message>\n        <source>Pay &amp;To:</source>\n        <translation>付給(&amp;T):</translation>\n    </message>\n    <message>\n        <source>&amp;Label:</source>\n        <translation>標記(&amp;L):</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>選擇先前使用過的位址</translation>\n    </message>\n    <message>\n        <source>This is a normal payment.</source>\n        <translation>這是一筆正常的付款。</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to send the payment to</source>\n        <translation>接收付款的 Bitcoin 位址</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>貼上剪貼簿裡的位址</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Remove this entry</source>\n        <translation>刪掉這個項目</translation>\n    </message>\n    <message>\n        <source>The fee will be deducted from the amount being sent. The recipient will receive less bitcoins than you enter in the amount field. If multiple recipients are selected, the fee is split equally.</source>\n        <translation>手續費會從要付款出去的金額中扣掉。因此收款人會收到比輸入的金額還要少的 bitcoin。如果有多個收款人的話，手續費會平均分配來扣除。</translation>\n    </message>\n    <message>\n        <source>S&amp;ubtract fee from amount</source>\n        <translation>從付款金額減去手續費(&amp;U)</translation>\n    </message>\n    <message>\n        <source>Use available balance</source>\n        <translation>使用全部可用餘額</translation>\n    </message>\n    <message>\n        <source>Message:</source>\n        <translation>訊息:</translation>\n    </message>\n    <message>\n        <source>This is an unauthenticated payment request.</source>\n        <translation>這是個沒有驗證過身份的付款要求。</translation>\n    </message>\n    <message>\n        <source>This is an authenticated payment request.</source>\n        <translation>這是個已經驗證過身份的付款要求。</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to the list of used addresses</source>\n        <translation>請輸入這個位址的標記，來把它加進去已使用過位址的清單。</translation>\n    </message>\n    <message>\n        <source>A message that was attached to the bitcoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Bitcoin network.</source>\n        <translation>附加在 Bitcoin 付款協議的資源識別碼(URI)中的訊息，會和交易內容一起存起來，給你自己做參考。注意: 這個訊息不會送到 Bitcoin 網路上。</translation>\n    </message>\n    <message>\n        <source>Pay To:</source>\n        <translation>付給:</translation>\n    </message>\n    <message>\n        <source>Memo:</source>\n        <translation>備註:</translation>\n    </message>\n    <message>\n        <source>Enter a label for this address to add it to your address book</source>\n        <translation>請輸入這個位址的標記來把它加進位址簿中</translation>\n    </message>\n</context>\n<context>\n    <name>SendConfirmationDialog</name>\n    <message>\n        <source>Yes</source>\n        <translation>是</translation>\n    </message>\n</context>\n<context>\n    <name>ShutdownWindow</name>\n    <message>\n        <source>%1 is shutting down...</source>\n        <translation>正在關閉 %1 中...</translation>\n    </message>\n    <message>\n        <source>Do not shut down the computer until this window disappears.</source>\n        <translation> 在這個視窗不見以前，請不要關掉電腦。</translation>\n    </message>\n</context>\n<context>\n    <name>SignVerifyMessageDialog</name>\n    <message>\n        <source>Signatures - Sign / Verify a Message</source>\n        <translation>簽章 - 簽署或驗證訊息</translation>\n    </message>\n    <message>\n        <source>&amp;Sign Message</source>\n        <translation>簽署訊息(&amp;S)</translation>\n    </message>\n    <message>\n        <source>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>\n        <translation>你可以用自己的位址簽署訊息或合約，來證明你可以從該位址收款。但是請小心，不要簽署語意含糊不清，或隨機產生的內容，因為釣魚式詐騙可能會用騙你簽署的手法來冒充是你。只有在語句中的細節你都同意時才簽署。</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address to sign the message with</source>\n        <translation>用來簽署訊息的 Bitcoin 位址</translation>\n    </message>\n    <message>\n        <source>Choose previously used address</source>\n        <translation>選擇先前使用過的位址</translation>\n    </message>\n    <message>\n        <source>Alt+A</source>\n        <translation>Alt+A</translation>\n    </message>\n    <message>\n        <source>Paste address from clipboard</source>\n        <translation>貼上剪貼簿裡的位址</translation>\n    </message>\n    <message>\n        <source>Alt+P</source>\n        <translation>Alt+P</translation>\n    </message>\n    <message>\n        <source>Enter the message you want to sign here</source>\n        <translation>請在這裡輸入你想簽署的訊息</translation>\n    </message>\n    <message>\n        <source>Signature</source>\n        <translation>簽章</translation>\n    </message>\n    <message>\n        <source>Copy the current signature to the system clipboard</source>\n        <translation>複製目前的簽章到系統剪貼簿</translation>\n    </message>\n    <message>\n        <source>Sign the message to prove you own this Bitcoin address</source>\n        <translation>簽署這個訊息來證明這個 Bitcoin 位址是你的</translation>\n    </message>\n    <message>\n        <source>Sign &amp;Message</source>\n        <translation>簽署訊息(&amp;M)</translation>\n    </message>\n    <message>\n        <source>Reset all sign message fields</source>\n        <translation>重設所有訊息簽署欄位</translation>\n    </message>\n    <message>\n        <source>Clear &amp;All</source>\n        <translation>全部清掉(&amp;A)</translation>\n    </message>\n    <message>\n        <source>&amp;Verify Message</source>\n        <translation>驗證訊息(&amp;V)</translation>\n    </message>\n    <message>\n        <source>Enter the receiver's address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack. Note that this only proves the signing party receives with the address, it cannot prove sendership of any transaction!</source>\n        <translation>請在下面輸入收款人的位址，訊息(請確定完整複製了所包含的換行，空格，跳位符號等等)，以及簽章，來驗證這個訊息。請小心，除了訊息內容以外，不要對簽章本身過度解讀，以避免被用「中間人攻擊法」詐騙。請注意，通過驗證的簽章只能證明簽章人確實可以從該位址收款，不能證明任何交易中的付款人身份！</translation>\n    </message>\n    <message>\n        <source>The Bitcoin address the message was signed with</source>\n        <translation>簽署這個訊息的 Bitcoin 位址</translation>\n    </message>\n    <message>\n        <source>Verify the message to ensure it was signed with the specified Bitcoin address</source>\n        <translation>驗證這個訊息來確定是用指定的 Bitcoin 位址簽署的</translation>\n    </message>\n    <message>\n        <source>Verify &amp;Message</source>\n        <translation>驗證訊息(&amp;M)</translation>\n    </message>\n    <message>\n        <source>Reset all verify message fields</source>\n        <translation>重設所有訊息驗證欄位</translation>\n    </message>\n    <message>\n        <source>Click \"Sign Message\" to generate signature</source>\n        <translation>請按一下「簽署訊息」來產生簽章</translation>\n    </message>\n    <message>\n        <source>The entered address is invalid.</source>\n        <translation>輸入的位址無效。</translation>\n    </message>\n    <message>\n        <source>Please check the address and try again.</source>\n        <translation>請檢查位址是否正確後再試一次。</translation>\n    </message>\n    <message>\n        <source>The entered address does not refer to a key.</source>\n        <translation>輸入的位址沒有對應到你的任何密鑰。</translation>\n    </message>\n    <message>\n        <source>Wallet unlock was cancelled.</source>\n        <translation>錢包解鎖已取消。</translation>\n    </message>\n    <message>\n        <source>Private key for the entered address is not available.</source>\n        <translation>沒有對應輸入位址的密鑰。</translation>\n    </message>\n    <message>\n        <source>Message signing failed.</source>\n        <translation>訊息簽署失敗。</translation>\n    </message>\n    <message>\n        <source>Message signed.</source>\n        <translation>訊息簽署好了。</translation>\n    </message>\n    <message>\n        <source>The signature could not be decoded.</source>\n        <translation>沒辦法把這個簽章解碼。</translation>\n    </message>\n    <message>\n        <source>Please check the signature and try again.</source>\n        <translation>請檢查簽章是否正確後再試一次。</translation>\n    </message>\n    <message>\n        <source>The signature did not match the message digest.</source>\n        <translation>這個簽章跟訊息的數位摘要不符。</translation>\n    </message>\n    <message>\n        <source>Message verification failed.</source>\n        <translation>訊息驗證失敗。</translation>\n    </message>\n    <message>\n        <source>Message verified.</source>\n        <translation>訊息驗證沒錯。</translation>\n    </message>\n</context>\n<context>\n    <name>SplashScreen</name>\n    <message>\n        <source>[testnet]</source>\n        <translation>[testnet]</translation>\n    </message>\n</context>\n<context>\n    <name>TrafficGraphWidget</name>\n    <message>\n        <source>KB/s</source>\n        <translation>KB/s</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDesc</name>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>到下 %n 個區塊生出來前可修改</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>到 %1 前可修改</translation>\n    </message>\n    <message>\n        <source>conflicted with a transaction with %1 confirmations</source>\n        <translation>跟一個目前確認 %1 次的交易互相衝突</translation>\n    </message>\n    <message>\n        <source>%1/offline</source>\n        <translation>%1 次/離線中</translation>\n    </message>\n    <message>\n        <source>0/unconfirmed, %1</source>\n        <translation>0 次/未確認，%1</translation>\n    </message>\n    <message>\n        <source>in memory pool</source>\n        <translation>在記憶池中</translation>\n    </message>\n    <message>\n        <source>not in memory pool</source>\n        <translation>不在記憶池中</translation>\n    </message>\n    <message>\n        <source>abandoned</source>\n        <translation>已中止</translation>\n    </message>\n    <message>\n        <source>%1/unconfirmed</source>\n        <translation>%1 次/未確認</translation>\n    </message>\n    <message>\n        <source>%1 confirmations</source>\n        <translation>確認 %1 次</translation>\n    </message>\n    <message>\n        <source>Status</source>\n        <translation>狀態</translation>\n    </message>\n    <message>\n        <source>, has not been successfully broadcast yet</source>\n        <translation>，還沒成功公告出去</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>, broadcast through %n node(s)</source>\n        <translation><numerusform>，已公告給 %n 個節點</numerusform></translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    <message>\n        <source>Source</source>\n        <translation>來源</translation>\n    </message>\n    <message>\n        <source>Generated</source>\n        <translation>生產出來</translation>\n    </message>\n    <message>\n        <source>From</source>\n        <translation>來源</translation>\n    </message>\n    <message>\n        <source>unknown</source>\n        <translation>未知</translation>\n    </message>\n    <message>\n        <source>To</source>\n        <translation>目的</translation>\n    </message>\n    <message>\n        <source>own address</source>\n        <translation>自己的位址</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>只能看</translation>\n    </message>\n    <message>\n        <source>label</source>\n        <translation>標記</translation>\n    </message>\n    <message>\n        <source>Credit</source>\n        <translation>入帳</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>matures in %n more block(s)</source>\n        <translation><numerusform>再等 %n 個區塊生出來後成熟</numerusform></translation>\n    </message>\n    <message>\n        <source>not accepted</source>\n        <translation>不被接受</translation>\n    </message>\n    <message>\n        <source>Debit</source>\n        <translation>出帳</translation>\n    </message>\n    <message>\n        <source>Total debit</source>\n        <translation>出帳總額</translation>\n    </message>\n    <message>\n        <source>Total credit</source>\n        <translation>入帳總額</translation>\n    </message>\n    <message>\n        <source>Transaction fee</source>\n        <translation>交易手續費</translation>\n    </message>\n    <message>\n        <source>Net amount</source>\n        <translation>淨額</translation>\n    </message>\n    <message>\n        <source>Message</source>\n        <translation>訊息</translation>\n    </message>\n    <message>\n        <source>Comment</source>\n        <translation>附註</translation>\n    </message>\n    <message>\n        <source>Transaction ID</source>\n        <translation>交易識別碼</translation>\n    </message>\n    <message>\n        <source>Transaction total size</source>\n        <translation>交易總大小</translation>\n    </message>\n    <message>\n        <source>Output index</source>\n        <translation>輸出索引</translation>\n    </message>\n    <message>\n        <source>Merchant</source>\n        <translation>商家</translation>\n    </message>\n    <message>\n        <source>Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>\n        <translation>生產出來的錢要再等 %1 個區塊生出來後才成熟可以用。當區塊生產出來時會公布到網路上，來被加進區塊鏈。如果加失敗了，狀態就會變成「不被接受」，而且不能夠花。如果在你生產出區塊的幾秒鐘內，也有其他節點生產出來的話，就有可能會發生這種情形。</translation>\n    </message>\n    <message>\n        <source>Debug information</source>\n        <translation>除錯資訊</translation>\n    </message>\n    <message>\n        <source>Transaction</source>\n        <translation>交易</translation>\n    </message>\n    <message>\n        <source>Inputs</source>\n        <translation>輸入</translation>\n    </message>\n    <message>\n        <source>Amount</source>\n        <translation>金額</translation>\n    </message>\n    <message>\n        <source>true</source>\n        <translation>是</translation>\n    </message>\n    <message>\n        <source>false</source>\n        <translation>否</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionDescDialog</name>\n    <message>\n        <source>This pane shows a detailed description of the transaction</source>\n        <translation>這個版面顯示這次交易的詳細說明</translation>\n    </message>\n    <message>\n        <source>Details for %1</source>\n        <translation>交易 %1 的明細</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionTableModel</name>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>種類</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>標記:</translation>\n    </message>\n    <message numerus=\"yes\">\n        <source>Open for %n more block(s)</source>\n        <translation><numerusform>到下 %n 個區塊生出來前可修改</numerusform></translation>\n    </message>\n    <message>\n        <source>Open until %1</source>\n        <translation>到 %1 前可修改</translation>\n    </message>\n    <message>\n        <source>Offline</source>\n        <translation>離線中</translation>\n    </message>\n    <message>\n        <source>Unconfirmed</source>\n        <translation>未確認</translation>\n    </message>\n    <message>\n        <source>Abandoned</source>\n        <translation>已中止</translation>\n    </message>\n    <message>\n        <source>Confirming (%1 of %2 recommended confirmations)</source>\n        <translation>確認中(已經 %1 次，建議至少 %2 次)</translation>\n    </message>\n    <message>\n        <source>Confirmed (%1 confirmations)</source>\n        <translation>已確認(%1 次)</translation>\n    </message>\n    <message>\n        <source>Conflicted</source>\n        <translation>有衝突</translation>\n    </message>\n    <message>\n        <source>Immature (%1 confirmations, will be available after %2)</source>\n        <translation>未成熟(確認 %1 次，會在 %2 次後可用)</translation>\n    </message>\n    <message>\n        <source>This block was not received by any other nodes and will probably not be accepted!</source>\n        <translation>沒有其他節點收到這個區塊，也許它不會被接受！</translation>\n    </message>\n    <message>\n        <source>Generated but not accepted</source>\n        <translation>生產出來但是不被接受</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>收款</translation>\n    </message>\n    <message>\n        <source>Received from</source>\n        <translation>收款自</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>付款</translation>\n    </message>\n    <message>\n        <source>Payment to yourself</source>\n        <translation>付給自己</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>開採所得</translation>\n    </message>\n    <message>\n        <source>watch-only</source>\n        <translation>只能看</translation>\n    </message>\n    <message>\n        <source>(n/a)</source>\n        <translation>(不適用)</translation>\n    </message>\n    <message>\n        <source>(no label)</source>\n        <translation>(無標記)</translation>\n    </message>\n    <message>\n        <source>Transaction status. Hover over this field to show number of confirmations.</source>\n        <translation>交易狀態。把游標停在欄位上會顯示確認次數。</translation>\n    </message>\n    <message>\n        <source>Date and time that the transaction was received.</source>\n        <translation>收到交易的日期和時間。</translation>\n    </message>\n    <message>\n        <source>Type of transaction.</source>\n        <translation>交易的種類。</translation>\n    </message>\n    <message>\n        <source>Whether or not a watch-only address is involved in this transaction.</source>\n        <translation>不論如何有一個只能觀看的地只有參與這次的交易</translation>\n    </message>\n    <message>\n        <source>User-defined intent/purpose of the transaction.</source>\n        <translation>使用者定義的交易動機或理由。</translation>\n    </message>\n    <message>\n        <source>Amount removed from or added to balance.</source>\n        <translation>要減掉或加進餘額的金額。</translation>\n    </message>\n</context>\n<context>\n    <name>TransactionView</name>\n    <message>\n        <source>All</source>\n        <translation>全部</translation>\n    </message>\n    <message>\n        <source>Today</source>\n        <translation>今天</translation>\n    </message>\n    <message>\n        <source>This week</source>\n        <translation>這星期</translation>\n    </message>\n    <message>\n        <source>This month</source>\n        <translation>這個月</translation>\n    </message>\n    <message>\n        <source>Last month</source>\n        <translation>上個月</translation>\n    </message>\n    <message>\n        <source>This year</source>\n        <translation>今年</translation>\n    </message>\n    <message>\n        <source>Range...</source>\n        <translation>指定範圍...</translation>\n    </message>\n    <message>\n        <source>Received with</source>\n        <translation>收款</translation>\n    </message>\n    <message>\n        <source>Sent to</source>\n        <translation>付款</translation>\n    </message>\n    <message>\n        <source>To yourself</source>\n        <translation>給自己</translation>\n    </message>\n    <message>\n        <source>Mined</source>\n        <translation>開採所得</translation>\n    </message>\n    <message>\n        <source>Other</source>\n        <translation>其它</translation>\n    </message>\n    <message>\n        <source>Enter address, transaction id, or label to search</source>\n        <translation>請輸入要搜尋的位址、交易識別碼、或是標記</translation>\n    </message>\n    <message>\n        <source>Min amount</source>\n        <translation>最小金額</translation>\n    </message>\n    <message>\n        <source>Abandon transaction</source>\n        <translation>中止交易</translation>\n    </message>\n    <message>\n        <source>Increase transaction fee</source>\n        <translation>提高手續費</translation>\n    </message>\n    <message>\n        <source>Copy address</source>\n        <translation>複製位址</translation>\n    </message>\n    <message>\n        <source>Copy label</source>\n        <translation>複製標記</translation>\n    </message>\n    <message>\n        <source>Copy amount</source>\n        <translation>複製金額</translation>\n    </message>\n    <message>\n        <source>Copy transaction ID</source>\n        <translation>複製交易識別碼</translation>\n    </message>\n    <message>\n        <source>Copy raw transaction</source>\n        <translation>複製交易原始資料</translation>\n    </message>\n    <message>\n        <source>Copy full transaction details</source>\n        <translation>複製完整交易明細</translation>\n    </message>\n    <message>\n        <source>Edit label</source>\n        <translation>編輯標記</translation>\n    </message>\n    <message>\n        <source>Show transaction details</source>\n        <translation>顯示交易明細</translation>\n    </message>\n    <message>\n        <source>Export Transaction History</source>\n        <translation>匯出交易記錄</translation>\n    </message>\n    <message>\n        <source>Comma separated file (*.csv)</source>\n        <translation>逗點分隔資料檔(*.csv)</translation>\n    </message>\n    <message>\n        <source>Confirmed</source>\n        <translation>已確認</translation>\n    </message>\n    <message>\n        <source>Watch-only</source>\n        <translation>只能觀看的</translation>\n    </message>\n    <message>\n        <source>Date</source>\n        <translation>日期</translation>\n    </message>\n    <message>\n        <source>Type</source>\n        <translation>種類</translation>\n    </message>\n    <message>\n        <source>Label</source>\n        <translation>標記:</translation>\n    </message>\n    <message>\n        <source>Address</source>\n        <translation>位址</translation>\n    </message>\n    <message>\n        <source>ID</source>\n        <translation>識別碼</translation>\n    </message>\n    <message>\n        <source>Exporting Failed</source>\n        <translation>匯出失敗</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the transaction history to %1.</source>\n        <translation>儲存交易記錄到 %1 時發生錯誤。</translation>\n    </message>\n    <message>\n        <source>Exporting Successful</source>\n        <translation>匯出成功</translation>\n    </message>\n    <message>\n        <source>The transaction history was successfully saved to %1.</source>\n        <translation>交易記錄已經成功儲存到 %1 了。</translation>\n    </message>\n    <message>\n        <source>Range:</source>\n        <translation>範圍:</translation>\n    </message>\n    <message>\n        <source>to</source>\n        <translation>到</translation>\n    </message>\n</context>\n<context>\n    <name>UnitDisplayStatusBarControl</name>\n    <message>\n        <source>Unit to show amounts in. Click to select another unit.</source>\n        <translation>金額顯示單位。可以點選其他單位。</translation>\n    </message>\n</context>\n<context>\n    <name>WalletFrame</name>\n    <message>\n        <source>No wallet has been loaded.</source>\n        <translation>沒有載入錢包。</translation>\n    </message>\n</context>\n<context>\n    <name>WalletModel</name>\n    <message>\n        <source>Send Coins</source>\n        <translation>付款</translation>\n    </message>\n    <message>\n        <source>Fee bump error</source>\n        <translation>手續費提升失敗</translation>\n    </message>\n    <message>\n        <source>Increasing transaction fee failed</source>\n        <translation>手續費提高失敗了</translation>\n    </message>\n    <message>\n        <source>Do you want to increase the fee?</source>\n        <translation>想要提高手續費嗎？</translation>\n    </message>\n    <message>\n        <source>Current fee:</source>\n        <translation>目前費用：</translation>\n    </message>\n    <message>\n        <source>Increase:</source>\n        <translation>增加：</translation>\n    </message>\n    <message>\n        <source>New fee:</source>\n        <translation>新的費用：</translation>\n    </message>\n    <message>\n        <source>Confirm fee bump</source>\n        <translation>確認手續費提升</translation>\n    </message>\n    <message>\n        <source>Can't sign transaction.</source>\n        <translation>沒辦法簽署交易。</translation>\n    </message>\n    <message>\n        <source>Could not commit transaction</source>\n        <translation>沒辦法提交交易</translation>\n    </message>\n</context>\n<context>\n    <name>WalletView</name>\n    <message>\n        <source>&amp;Export</source>\n        <translation>匯出(&amp;E)</translation>\n    </message>\n    <message>\n        <source>Export the data in the current tab to a file</source>\n        <translation>將目前分頁的資料匯出存成檔案</translation>\n    </message>\n    <message>\n        <source>Backup Wallet</source>\n        <translation>備份錢包</translation>\n    </message>\n    <message>\n        <source>Wallet Data (*.dat)</source>\n        <translation>錢包資料檔(*.dat)</translation>\n    </message>\n    <message>\n        <source>Backup Failed</source>\n        <translation>備份失敗</translation>\n    </message>\n    <message>\n        <source>There was an error trying to save the wallet data to %1.</source>\n        <translation>儲存錢包資料到 %1 時發生錯誤。</translation>\n    </message>\n    <message>\n        <source>Backup Successful</source>\n        <translation>備份成功</translation>\n    </message>\n    <message>\n        <source>The wallet data was successfully saved to %1.</source>\n        <translation>錢包的資料已經成功儲存到 %1 了。</translation>\n    </message>\n</context>\n<context>\n    <name>bitcoin-core</name>\n    <message>\n        <source>Options:</source>\n        <translation>選項:</translation>\n    </message>\n    <message>\n        <source>Specify data directory</source>\n        <translation>指定資料目錄</translation>\n    </message>\n    <message>\n        <source>Connect to a node to retrieve peer addresses, and disconnect</source>\n        <translation>連線到某個節點來取得其它節點的位址，然後斷線</translation>\n    </message>\n    <message>\n        <source>Specify your own public address</source>\n        <translation>指定自己的公開位址</translation>\n    </message>\n    <message>\n        <source>Accept command line and JSON-RPC commands</source>\n        <translation>接受指令列和 JSON-RPC 指令\n</translation>\n    </message>\n    <message>\n        <source>Distributed under the MIT software license, see the accompanying file %s or %s</source>\n        <translation>依據 MIT 軟體授權條款散布，詳情請見附帶的 %s 檔案或是 %s</translation>\n    </message>\n    <message>\n        <source>If &lt;category&gt; is not supplied or if &lt;category&gt; = 1, output all debugging information.</source>\n        <translation>如果沒有提供 &lt;category&gt; 或是值為 1 就會輸出所有的除錯資訊。</translation>\n    </message>\n    <message>\n        <source>Prune configured below the minimum of %d MiB.  Please use a higher number.</source>\n        <translation>設定的修剪值小於最小需求的 %d 百萬位元組(MiB)。請指定大一點的數字。</translation>\n    </message>\n    <message>\n        <source>Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)</source>\n        <translation>修剪模式：錢包的最後同步狀態是在被修剪掉的區塊資料中。你需要用 -reindex 參數執行(會重新下載整個區塊鏈)</translation>\n    </message>\n    <message>\n        <source>Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.</source>\n        <translation>在修剪模式下沒辦法重新掃描區塊鏈。你需要配合使用 -reindex 參數來重新下載整個區塊鏈。</translation>\n    </message>\n    <message>\n        <source>Error: A fatal internal error occurred, see debug.log for details</source>\n        <translation>錯誤: 發生了致命的內部錯誤，詳情請看 debug.log</translation>\n    </message>\n    <message>\n        <source>Fee (in %s/kB) to add to transactions you send (default: %s)</source>\n        <translation>交易付款時每千位元組(kB)的交易手續費(單位是 %s，預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Pruning blockstore...</source>\n        <translation>正在修剪區塊資料庫中...</translation>\n    </message>\n    <message>\n        <source>Run in the background as a daemon and accept commands</source>\n        <translation>用護靈模式在背景執行並接受指令</translation>\n    </message>\n    <message>\n        <source>Unable to start HTTP server. See debug log for details.</source>\n        <translation>無法啟動 HTTP 伺服器。詳情請看除錯紀錄。</translation>\n    </message>\n    <message>\n        <source>Bitcoin Core</source>\n        <translation>Bitcoin Core</translation>\n    </message>\n    <message>\n        <source>The %s developers</source>\n        <translation>%s 開發人員</translation>\n    </message>\n    <message>\n        <source>A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)</source>\n        <translation>當沒有足夠的資料計算預估手續費時，所使用的手續費費率(單位是 %s/kB, 預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Accept relayed transactions received from whitelisted peers even when not relaying transactions (default: %d)</source>\n        <translation>接受從白名點節點收到的轉發交易，即使沒有(符合準則)轉發出去(預設值: %d)</translation>\n    </message>\n    <message>\n        <source>Add a node to connect to and attempt to keep the connection open (see the `addnode` RPC command help for more info)</source>\n        <translation>增加一個要連線的節線，並試著保持對它的連線不斷(詳情請見 RPC 指令 addnode 的說明)</translation>\n    </message>\n    <message>\n        <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>\n        <translation>和指定的位址繫結，並且一直在指定位址聽候連線。IPv6 請用 [主機]:通訊埠 這種格式</translation>\n    </message>\n    <message>\n        <source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>\n        <translation>沒辦法鎖定資料目錄 %s。%s 可能已經在執行了。</translation>\n    </message>\n    <message>\n        <source>Cannot provide specific connections and have addrman find outgoing connections at the same.</source>\n        <translation>無法同時指定特定連線位址以及自動尋找連線。</translation>\n    </message>\n    <message>\n        <source>Connect only to the specified node(s); -connect=0 disables automatic connections (the rules for this peer are the same as for -addnode)</source>\n        <translation>只連線到指定的節點。用 -connect=0 可以關閉自動連線。(套用於這個節點的規則與 -addnode 相同)</translation>\n    </message>\n    <message>\n        <source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>\n        <translation>清掉錢包裡的所有交易，並且在下次啟動時，使用 -rescan 來從區塊鏈中復原回來。</translation>\n    </message>\n    <message>\n        <source>Error reading %s! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>\n        <translation>讀取錢包檔 %s 時發生錯誤！所有的密鑰都正確讀取了，但是交易資料或位址簿資料可能會缺少或不正確。</translation>\n    </message>\n    <message>\n        <source>Exclude debugging information for a category. Can be used in conjunction with -debug=1 to output debug logs for all categories except one or more specified categories.</source>\n        <translation>不要對一種類別紀錄除錯資訊。可以和 -debug=1 配合，用來輸入除了指定的一種或多種類別外的所有除錯紀錄。</translation>\n    </message>\n    <message>\n        <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>\n        <translation>當錢包有交易改變時要執行的指令(指令中的 %s 會被取代成交易識別碼)</translation>\n    </message>\n    <message>\n        <source>Extra transactions to keep in memory for compact block reconstructions (default: %u)</source>\n        <translation>為了將摘要區塊完整回組而額外保留在記憶體中的交易數量(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>If this block is in the chain assume that it and its ancestors are valid and potentially skip their script verification (0 to verify all, default: %s, testnet: %s)</source>\n        <translation>假設已經在區塊鏈中的區塊以及其先前的區塊都合法，因此對它們略過指令碼驗證(0 表示一律要驗證，預設值: %s, 測試網路: %s)</translation>\n    </message>\n    <message>\n        <source>Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by peers forward or backward by this amount. (default: %u seconds)</source>\n        <translation>跟其他節點的時間差最高可接受的中位數值。本機所認為的時間可能會被其他節點影響，往前或往後在這個值之內。(預設值: %u 秒)</translation>\n    </message>\n    <message>\n        <source>Maximum total fees (in %s) to use in a single wallet transaction or raw transaction; setting this too low may abort large transactions (default: %s)</source>\n        <translation>允許一次錢包交易或未加工交易付出的最高總手續費(單位是 %s)；設定太低的話，可能會無法進行資料量大的交易(預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.</source>\n        <translation>請檢查電腦日期和時間是否正確！%s 沒辦法在時鐘不準的情況下正常運作。</translation>\n    </message>\n    <message>\n        <source>Please contribute if you find %s useful. Visit %s for further information about the software.</source>\n        <translation>如果你覺得 %s 有用，可以幫助我們。關於這個軟體的更多資訊請見 %s。</translation>\n    </message>\n    <message>\n        <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect used)</source>\n        <translation>是否允許在節點位址數目不足時，使用域名查詢來搜尋節點 (預設值: 當沒用 -connect 時為 1)</translation>\n    </message>\n    <message>\n        <source>Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, &gt;%u = automatically prune block files to stay under the specified target size in MiB)</source>\n        <translation>修剪(刪除)掉老舊區塊以降低需要的儲存空間。這樣會增加一個 RPC 指令 pruneblockchain，可以使用它來刪除指定的區塊；也可以指定目標儲存空間大小，以啟用對老舊區塊的自動修剪功能。這個模式跟 -txindex 和 -rescan 參數不相容。警告: 還原回不修剪模式會需要重新下載一整個區塊鏈。(預設值: 0 表示不修剪區塊，1 表示允許使用 RPC 指令做修剪，&gt;%u 的值表示為區塊資料的目標大小，單位是百萬位元組，MiB)</translation>\n    </message>\n    <message>\n        <source>Set lowest fee rate (in %s/kB) for transactions to be included in block creation. (default: %s)</source>\n        <translation>設定製造區塊時，所要包含交易每千位元組的最低手續費(單位是 %s)。(預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Set the number of script verification threads (%u to %d, 0 = auto, &lt;0 = leave that many cores free, default: %d)</source>\n        <translation>設定指令碼驗證的執行緒數目 (%u 到 %d，0 表示程式自動決定，小於 0 表示保留處理器核心不用的數目，預設值: %d)</translation>\n    </message>\n    <message>\n        <source>The block database contains a block which appears to be from the future. This may be due to your computer's date and time being set incorrectly. Only rebuild the block database if you are sure that your computer's date and time are correct</source>\n        <translation>區塊資料庫中有來自未來的區塊。可能是你電腦的日期時間不對。如果確定電腦日期時間沒錯的話，就重建區塊資料庫看看。</translation>\n    </message>\n    <message>\n        <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>\n        <translation>這是個還沒發表的測試版本 - 使用請自負風險 - 請不要用來開採或做商業應用</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may discard if change is smaller than dust at this level</source>\n        <translation>在該交易手續費率下，找零的零錢會因為少於零散錢的金額，而自動棄掉變成手續費</translation>\n    </message>\n    <message>\n        <source>Unable to replay blocks. You will need to rebuild the database using -reindex-chainstate.</source>\n        <translation>沒辦法重算區塊。你需要先用 -reindex-chainstate 參數來重建資料庫。</translation>\n    </message>\n    <message>\n        <source>Unable to rewind the database to a pre-fork state. You will need to redownload the blockchain</source>\n        <translation>沒辦法將資料庫倒轉回分岔前的狀態。必須要重新下載區塊鍊。</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: 1 when listening and no -proxy)</source>\n        <translation>是否要使用「通用即插即用」協定(UPnP)，來設定聽候連線的通訊埠的對應(預設值: 當有聽候連線且沒有指定 -proxy 參數時為 1)</translation>\n    </message>\n    <message>\n        <source>Username and hashed password for JSON-RPC connections. The field &lt;userpw&gt; comes in the format: &lt;USERNAME&gt;:&lt;SALT&gt;$&lt;HASH&gt;. A canonical python script is included in share/rpcuser. The client then connects normally using the rpcuser=&lt;USERNAME&gt;/rpcpassword=&lt;PASSWORD&gt; pair of arguments. This option can be specified multiple times</source>\n        <translation>JSON-RPC 連線要用的使用者名稱和雜湊密碼。&lt;userpw&gt; 的格式是：&lt;使用者名稱&gt;:&lt;調味值&gt;$&lt;雜湊值&gt;。在 share/rpcuser 目錄下有一個示範的 python 程式。之後客戶端程式就可以用這對參數正常連線：rpcuser=&lt;使用者名稱&gt; 和 rpcpassword=&lt;密碼&gt;。這個選項可以給很多次。</translation>\n    </message>\n    <message>\n        <source>Wallet will not create transactions that violate mempool chain limits (default: %u)</source>\n        <translation>錢包軟體不會產生違反記憶池交易鏈限制的交易(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>\n        <translation>警告: 位元幣網路對於區塊鏈結的決定目前有分歧！有些礦工看來會有問題。</translation>\n    </message>\n    <message>\n        <source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>\n        <translation>警告: 我們和某些連線的節點對於區塊鏈結的決定不同！你可能需要升級，或是需要等其它的節點升級。</translation>\n    </message>\n    <message>\n        <source>Whether to save the mempool on shutdown and load on restart (default: %u)</source>\n        <translation>是否要在結束時儲存記憶池，並在下次重起時載入(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>%d of last 100 blocks have unexpected version</source>\n        <translation>最近的 100 個區塊中有 %d 個意料之外的區塊版本</translation>\n    </message>\n    <message>\n        <source>%s corrupt, salvage failed</source>\n        <translation>錢包檔 %s 壞掉了，搶救失敗</translation>\n    </message>\n    <message>\n        <source>-maxmempool must be at least %d MB</source>\n        <translation>參數 -maxmempool 至少要給 %d 百萬位元組(MB)</translation>\n    </message>\n    <message>\n        <source>&lt;category&gt; can be:</source>\n        <translation>&lt;category&gt; 可以是:</translation>\n    </message>\n    <message>\n        <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>\n        <translation>是否接受外來連線(預設值: 當沒有 -proxy 或 -connect 時為 1)</translation>\n    </message>\n    <message>\n        <source>Append comment to the user agent string</source>\n        <translation>對使用者代理字串添加註解</translation>\n    </message>\n    <message>\n        <source>Attempt to recover private keys from a corrupt wallet on startup</source>\n        <translation>啟動時嘗試從壞掉的錢包檔復原密鑰</translation>\n    </message>\n    <message>\n        <source>Block creation options:</source>\n        <translation>區塊製造選項:</translation>\n    </message>\n    <message>\n        <source>Cannot resolve -%s address: '%s'</source>\n        <translation>沒辦法解析 -%s 參數指定的位址: '%s'</translation>\n    </message>\n    <message>\n        <source>Chain selection options:</source>\n        <translation>區塊鏈選項:</translation>\n    </message>\n    <message>\n        <source>Change index out of range</source>\n        <translation>找零的索引值超出範圍</translation>\n    </message>\n    <message>\n        <source>Connection options:</source>\n        <translation>連線選項:</translation>\n    </message>\n    <message>\n        <source>Copyright (C) %i-%i</source>\n        <translation>版權所有 (C) %i-%i</translation>\n    </message>\n    <message>\n        <source>Corrupted block database detected</source>\n        <translation>發現區塊資料庫壞掉了</translation>\n    </message>\n    <message>\n        <source>Debugging/Testing options:</source>\n        <translation>除錯與測試選項</translation>\n    </message>\n    <message>\n        <source>Do not load the wallet and disable wallet RPC calls</source>\n        <translation>不要載入錢包，並且拿掉錢包相關的 RPC 功能請求。</translation>\n    </message>\n    <message>\n        <source>Do you want to rebuild the block database now?</source>\n        <translation>你想要現在重建區塊資料庫嗎？</translation>\n    </message>\n    <message>\n        <source>Enable publish hash block in &lt;address&gt;</source>\n        <translation>開啟傳送區塊雜湊值到目標 ZeroMQ 位址 &lt;address&gt; 去</translation>\n    </message>\n    <message>\n        <source>Enable publish hash transaction in &lt;address&gt;</source>\n        <translation>開啟傳送交易雜湊值到目標 ZeroMQ 位址 &lt;address&gt; 去</translation>\n    </message>\n    <message>\n        <source>Enable publish raw block in &lt;address&gt;</source>\n        <translation>開啟傳送區塊原始資料到目標 ZeroMQ 位址 &lt;address&gt; 去</translation>\n    </message>\n    <message>\n        <source>Enable publish raw transaction in &lt;address&gt;</source>\n        <translation>開啟傳送交易原始資料到目標 ZeroMQ 位址 &lt;address&gt; 去</translation>\n    </message>\n    <message>\n        <source>Enable transaction replacement in the memory pool (default: %u)</source>\n        <translation>對交易暫存池啟用替代交易(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Error creating %s: You can't create non-HD wallets with this version.</source>\n        <translation>產生 %s 發生錯誤：這個版本不能用來產生非 HD 錢包。</translation>\n    </message>\n    <message>\n        <source>Error initializing block database</source>\n        <translation>初始化區塊資料庫時發生錯誤</translation>\n    </message>\n    <message>\n        <source>Error initializing wallet database environment %s!</source>\n        <translation>初始化錢包資料庫環境 %s 時發生錯誤！</translation>\n    </message>\n    <message>\n        <source>Error loading %s</source>\n        <translation>載入檔案 %s 時發生錯誤</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet corrupted</source>\n        <translation>載入檔案 %s 時發生錯誤: 錢包損毀了</translation>\n    </message>\n    <message>\n        <source>Error loading %s: Wallet requires newer version of %s</source>\n        <translation>載入檔案 %s 時發生錯誤: 這個錢包需要新版的 %s</translation>\n    </message>\n    <message>\n        <source>Error loading block database</source>\n        <translation>載入區塊資料庫時發生錯誤</translation>\n    </message>\n    <message>\n        <source>Error opening block database</source>\n        <translation>打開區塊資料庫時發生錯誤</translation>\n    </message>\n    <message>\n        <source>Error: Disk space is low!</source>\n        <translation>錯誤: 磁碟空間很少！</translation>\n    </message>\n    <message>\n        <source>Failed to listen on any port. Use -listen=0 if you want this.</source>\n        <translation>在任意的通訊埠聽候失敗。如果你希望這樣的話，可以設定 -listen=0.</translation>\n    </message>\n    <message>\n        <source>Failed to rescan the wallet during initialization</source>\n        <translation>初始化時重新掃描錢包失敗了</translation>\n    </message>\n    <message>\n        <source>Importing...</source>\n        <translation>正在匯入中...</translation>\n    </message>\n    <message>\n        <source>Incorrect or no genesis block found. Wrong datadir for network?</source>\n        <translation>創世區塊不正確或找不到。資料目錄錯了嗎？</translation>\n    </message>\n    <message>\n        <source>Initialization sanity check failed. %s is shutting down.</source>\n        <translation>初始化時的基本檢查失敗了。%s 就要關閉了。</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -%s=&lt;amount&gt;: '%s'</source>\n        <translation>參數 -%s=&lt;金額&gt; 指定的金額無效: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -discardfee=&lt;amount&gt;: '%s'</source>\n        <translation>設定 -discardfee=&lt;金額&gt; 的金額無效: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -fallbackfee=&lt;amount&gt;: '%s'</source>\n        <translation>設定 -fallbackfee=&lt;金額&gt; 的金額無效: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep the transaction memory pool below &lt;n&gt; megabytes (default: %u)</source>\n        <translation>在記憶體暫存池中保持最多 &lt;n&gt; 個百萬位元組的交易(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Loading P2P addresses...</source>\n        <translation>正在載入 P2P 位址資料...</translation>\n    </message>\n    <message>\n        <source>Loading banlist...</source>\n        <translation>正在載入禁止連線名單中...</translation>\n    </message>\n    <message>\n        <source>Location of the auth cookie (default: data dir)</source>\n        <translation>認證 cookie 資料的位置(預設值: 同資料目錄)</translation>\n    </message>\n    <message>\n        <source>Not enough file descriptors available.</source>\n        <translation>檔案描述元不足。</translation>\n    </message>\n    <message>\n        <source>Only connect to nodes in network &lt;net&gt; (ipv4, ipv6 or onion)</source>\n        <translation>只和 &lt;net&gt; 網路上的節點連線(ipv4, ipv6, 或 onion)</translation>\n    </message>\n    <message>\n        <source>Print this help message and exit</source>\n        <translation>顯示說明訊息後結束</translation>\n    </message>\n    <message>\n        <source>Print version and exit</source>\n        <translation>顯示版本後結束</translation>\n    </message>\n    <message>\n        <source>Prune cannot be configured with a negative value.</source>\n        <translation>修剪值不能設定為負的。</translation>\n    </message>\n    <message>\n        <source>Prune mode is incompatible with -txindex.</source>\n        <translation>修剪模式和 -txindex 參數不相容。</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state and block index from the blk*.dat files on disk</source>\n        <translation>從磁碟裡的區塊檔 blk*.dat 重建區塊鏈狀態和區塊索引</translation>\n    </message>\n    <message>\n        <source>Rebuild chain state from the currently indexed blocks</source>\n        <translation>從目前已編索引的區塊資料重建區塊鏈狀態</translation>\n    </message>\n    <message>\n        <source>Replaying blocks...</source>\n        <translation>正在對區塊進行重算...</translation>\n    </message>\n    <message>\n        <source>Rewinding blocks...</source>\n        <translation>正在倒轉回區塊鏈之前的狀態...</translation>\n    </message>\n    <message>\n        <source>Send transactions with full-RBF opt-in enabled (RPC only, default: %u)</source>\n        <translation>送出允許提高手續費(full-RBF)的交易(僅適用於 RPC 指令，預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Set database cache size in megabytes (%d to %d, default: %d)</source>\n        <translation>設定資料庫快取大小是多少百萬位元組(MB，範圍: %d 到 %d，預設值: %d)</translation>\n    </message>\n    <message>\n        <source>Specify wallet file (within data directory)</source>\n        <translation>指定錢包檔(會在資料目錄中)</translation>\n    </message>\n    <message>\n        <source>The source code is available from %s.</source>\n        <translation>原始碼可以在 %s 取得。</translation>\n    </message>\n    <message>\n        <source>Transaction fee and change calculation failed</source>\n        <translation>計算交易手續費和找零失敗了</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer. %s is probably already running.</source>\n        <translation>沒辦法繫結在這台電腦上的 %s 。%s 可能已經在執行了。</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -benchmark ignored, use -debug=bench.</source>\n        <translation>忽略了不再支援的 -benchmark 參數，請改用 -debug=bench</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -debugnet ignored, use -debug=net.</source>\n        <translation>忽略了不再支援的 -debugnet 參數，請改用 -debug=net</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -tor found, use -onion.</source>\n        <translation>找到不再支援的 -tor 參數，請改用 -onion 參數。</translation>\n    </message>\n    <message>\n        <source>Unsupported logging category %s=%s.</source>\n        <translation>不支援的紀錄類別 %s=%s。</translation>\n    </message>\n    <message>\n        <source>Upgrading UTXO database</source>\n        <translation>正在升級 UTXO 資料庫</translation>\n    </message>\n    <message>\n        <source>Use UPnP to map the listening port (default: %u)</source>\n        <translation>使用通用隨插即用 (UPnP) 協定來設定對應的服務連接埠(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Use the test chain</source>\n        <translation>使用測試區塊鏈</translation>\n    </message>\n    <message>\n        <source>User Agent comment (%s) contains unsafe characters.</source>\n        <translation>使用者代理註解(%s)中含有不安全的字元。</translation>\n    </message>\n    <message>\n        <source>Verifying blocks...</source>\n        <translation>正在驗證區塊資料...</translation>\n    </message>\n    <message>\n        <source>Wallet debugging/testing options:</source>\n        <translation>錢包除錯與測試選項:</translation>\n    </message>\n    <message>\n        <source>Wallet needed to be rewritten: restart %s to complete</source>\n        <translation>錢包需要重寫: 請重新啓動 %s 來完成</translation>\n    </message>\n    <message>\n        <source>Wallet options:</source>\n        <translation>錢包選項:</translation>\n    </message>\n    <message>\n        <source>Allow JSON-RPC connections from specified source. Valid for &lt;ip&gt; are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times</source>\n        <translation>允許指定的來源建立 JSON-RPC 連線。&lt;ip&gt; 的有效值可以是一個單獨位址(像是 1.2.3.4)，一個網段/網段罩遮值(像是 1.2.3.4/255.255.255.0)，或是網段/CIDR值(像是 1.2.3.4/24)。這個選項可以設定多次。</translation>\n    </message>\n    <message>\n        <source>Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6</source>\n        <translation>和指定的位址繫結，並且把連線過來的節點放進白名單。IPv6 請用 [主機]:通訊埠 這種格式</translation>\n    </message>\n    <message>\n        <source>Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)</source>\n        <translation>用系統預設權限來造出新的檔案，而不是用使用者權限罩遮(umask)值 077 (只有在關掉錢包功能時才有作用)。</translation>\n    </message>\n    <message>\n        <source>Discover own IP addresses (default: 1 when listening and no -externalip or -proxy)</source>\n        <translation>找出自己的網際網路位址(預設值: 當有聽候連線且沒有指定 -externalip 或 -proxy 時為 1)</translation>\n    </message>\n    <message>\n        <source>Error: Listening for incoming connections failed (listen returned error %s)</source>\n        <translation>錯誤: 聽候外來連線失敗(回傳錯誤 %s)</translation>\n    </message>\n    <message>\n        <source>Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)</source>\n        <translation>當收到相關警示，或發現相當長的分支時，所要執行的指令(指令中的 %s 會被取代成警示訊息)</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)</source>\n        <translation>當處理轉發的交易、挖礦、或製造交易時，如果每千位元組(kB)的手續費比這個值(單位是 %s)低，就視為沒付手續費(預設值: %s)</translation>\n    </message>\n    <message>\n        <source>If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)</source>\n        <translation>當沒有設定 paytxfee 時，自動包含可以讓交易能在平均 n 個區塊內開始確認的手續費(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -maxtxfee=&lt;amount&gt;: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)</source>\n        <translation>-maxtxfee=&lt;amount&gt;: '%s' 的金額無效 (必須大於最低轉發手續費 %s 以避免交易無法確認)</translation>\n    </message>\n    <message>\n        <source>Maximum size of data in data carrier transactions we relay and mine (default: %u)</source>\n        <translation>轉發和開採時，對只帶資料的交易的大小上限(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)</source>\n        <translation>對每個代理連線使用隨機產生的憑證。這個選項會開啟 Tor 的串流隔離(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to send after the fee has been deducted</source>\n        <translation>扣除手續費後的交易金額太少而不能傳送</translation>\n    </message>\n    <message>\n        <source>Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway</source>\n        <translation>在白名單中的節點不會因為偵測到阻斷服務攻擊(DoS)而被停用。來自這些節點的交易也一定會被轉發，即使說交易本來就在記憶池裡了也一樣。適用於像是閘道伺服器。</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to go back to unpruned mode.  This will redownload the entire blockchain</source>\n        <translation>回到非修剪的模式需要用 -reindex 參數來重建資料庫。這會導致重新下載整個區塊鏈。</translation>\n    </message>\n    <message>\n        <source>(default: %u)</source>\n        <translation>(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Accept public REST requests (default: %u)</source>\n        <translation>接受公開的REST請求 (預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Automatically create Tor hidden service (default: %d)</source>\n        <translation>自動產生 Tor 隱藏服務(預設值: %d)</translation>\n    </message>\n    <message>\n        <source>Connect through SOCKS5 proxy</source>\n        <translation>透過 SOCKS5 代理伺服器連線</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't disable HD on an already existing HD wallet</source>\n        <translation>載入 %s 發生錯誤：不能對已存在的 HD 錢包停用 HD 功能。</translation>\n    </message>\n    <message>\n        <source>Error reading from database, shutting down.</source>\n        <translation>讀取資料庫時發生錯誤，要關閉了。</translation>\n    </message>\n    <message>\n        <source>Error upgrading chainstate database</source>\n        <translation>升級區塊鏈狀態資料庫時發生錯誤</translation>\n    </message>\n    <message>\n        <source>Imports blocks from external blk000??.dat file on startup</source>\n        <translation>啟動時從其它來源的 blk000??.dat 檔匯入區塊</translation>\n    </message>\n    <message>\n        <source>Information</source>\n        <translation>資訊</translation>\n    </message>\n    <message>\n        <source>Invalid -onion address or hostname: '%s'</source>\n        <translation>無效的 -onion 位址或主機名稱: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid -proxy address or hostname: '%s'</source>\n        <translation>無效的 -proxy 位址或主機名稱: '%s'</translation>\n    </message>\n    <message>\n        <source>Invalid amount for -paytxfee=&lt;amount&gt;: '%s' (must be at least %s)</source>\n        <translation>設定 -paytxfee=&lt;金額&gt; 的金額無效: '%s' (至少要有 %s)</translation>\n    </message>\n    <message>\n        <source>Invalid netmask specified in -whitelist: '%s'</source>\n        <translation>指定在 -whitelist 的網段無效: '%s'</translation>\n    </message>\n    <message>\n        <source>Keep at most &lt;n&gt; unconnectable transactions in memory (default: %u)</source>\n        <translation>保持最多 &lt;n&gt; 無法連結的交易在記憶體 (預設: %u)</translation>\n    </message>\n    <message>\n        <source>Need to specify a port with -whitebind: '%s'</source>\n        <translation>指定 -whitebind 時必須包含通訊埠: '%s'</translation>\n    </message>\n    <message>\n        <source>Node relay options:</source>\n        <translation>節點轉發選項:</translation>\n    </message>\n    <message>\n        <source>RPC server options:</source>\n        <translation>RPC 伺服器選項:</translation>\n    </message>\n    <message>\n        <source>Reducing -maxconnections from %d to %d, because of system limitations.</source>\n        <translation>因為系統的限制，將 -maxconnections 參數從 %d 降到了 %d</translation>\n    </message>\n    <message>\n        <source>Rescan the block chain for missing wallet transactions on startup</source>\n        <translation>啟動時重新掃描區塊鏈，來尋找錢包可能漏掉的交易。</translation>\n    </message>\n    <message>\n        <source>Send trace/debug info to console instead of debug.log file</source>\n        <translation>在終端機顯示追蹤或除錯資訊，而不是寫到檔案 debug.log 中</translation>\n    </message>\n    <message>\n        <source>Show all debugging options (usage: --help -help-debug)</source>\n        <translation>顯示所有的除錯選項 (用法: --help --help-debug)</translation>\n    </message>\n    <message>\n        <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>\n        <translation>客戶端軟體啓動時把 debug.log 檔縮小(預設值: 當沒有 -debug 時為 1)</translation>\n    </message>\n    <message>\n        <source>Signing transaction failed</source>\n        <translation>簽署交易失敗</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" does not exist</source>\n        <translation>以 -walletdir 指定的路徑 \"%s\" 不存在</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is a relative path</source>\n        <translation>以 -walletdir 指定的路徑 \"%s\" 是相對路徑</translation>\n    </message>\n    <message>\n        <source>Specified -walletdir \"%s\" is not a directory</source>\n        <translation>以 -walletdir 指定的路徑 \"%s\" 不是個目錄</translation>\n    </message>\n    <message>\n        <source>The transaction amount is too small to pay the fee</source>\n        <translation>交易金額太少而付不起手續費</translation>\n    </message>\n    <message>\n        <source>This is experimental software.</source>\n        <translation>這套軟體屬於實驗性質。</translation>\n    </message>\n    <message>\n        <source>Tor control port password (default: empty)</source>\n        <translation>Tor 控制埠密碼(預設值: 空白)</translation>\n    </message>\n    <message>\n        <source>Tor control port to use if onion listening enabled (default: %s)</source>\n        <translation>開啟聽候 onion 連線時的 Tor 控制埠號碼(預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Transaction amount too small</source>\n        <translation>交易金額太小</translation>\n    </message>\n    <message>\n        <source>Transaction too large for fee policy</source>\n        <translation>根據交易手續費準則，本交易的位元量過大</translation>\n    </message>\n    <message>\n        <source>Transaction too large</source>\n        <translation>交易位元量太大</translation>\n    </message>\n    <message>\n        <source>Unable to bind to %s on this computer (bind returned error %s)</source>\n        <translation>無法和這台電腦上的 %s 繫結(回傳錯誤 %s)</translation>\n    </message>\n    <message>\n        <source>Unable to generate initial keys</source>\n        <translation>無法產生初始的金鑰</translation>\n    </message>\n    <message>\n        <source>Upgrade wallet to latest format on startup</source>\n        <translation>啟動時把錢包檔案升級成最新的格式</translation>\n    </message>\n    <message>\n        <source>Username for JSON-RPC connections</source>\n        <translation>JSON-RPC 連線使用者名稱</translation>\n    </message>\n    <message>\n        <source>Verifying wallet(s)...</source>\n        <translation>正在驗證錢包資料...</translation>\n    </message>\n    <message>\n        <source>Wallet %s resides outside wallet directory %s</source>\n        <translation>錢包檔 %s 沒有在錢包目錄 %s 裡面</translation>\n    </message>\n    <message>\n        <source>Warning</source>\n        <translation>警告</translation>\n    </message>\n    <message>\n        <source>Warning: unknown new rules activated (versionbit %i)</source>\n        <translation>警告: 不明的交易規則被啟用了(versionbit %i)</translation>\n    </message>\n    <message>\n        <source>Whether to operate in a blocks only mode (default: %u)</source>\n        <translation>是否要用只要區塊模式運作(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>You need to rebuild the database using -reindex to change -txindex</source>\n        <translation>改變 -txindex 參數後，必須要用 -reindex 參數來重建資料庫</translation>\n    </message>\n    <message>\n        <source>Zapping all transactions from wallet...</source>\n        <translation>正在砍掉錢包中的所有交易...</translation>\n    </message>\n    <message>\n        <source>ZeroMQ notification options:</source>\n        <translation>ZeroMQ 通知選項:</translation>\n    </message>\n    <message>\n        <source>Password for JSON-RPC connections</source>\n        <translation>JSON-RPC 連線密碼</translation>\n    </message>\n    <message>\n        <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>\n        <translation>當最新區塊改變時要執行的指令(指令中的 %s 會被取代成區塊雜湊值)</translation>\n    </message>\n    <message>\n        <source>Allow DNS lookups for -addnode, -seednode and -connect</source>\n        <translation>允許對 -addnode, -seednode, -connect 的參數使用域名查詢 </translation>\n    </message>\n    <message>\n        <source>(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)</source>\n        <translation>(1 表示保留交易描述資料，像是帳戶使用者和付款請求資訊；2 表示丟掉交易描述資料)</translation>\n    </message>\n    <message>\n        <source>-maxtxfee is set very high! Fees this large could be paid on a single transaction.</source>\n        <translation>參數 -maxtxfee 設定了很高的金額！這可是你一次交易就有可能付出的最高手續費。</translation>\n    </message>\n    <message>\n        <source>Bind to given address to listen for JSON-RPC connections. This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -rpcport. Use [host]:port notation for IPv6. This option can be specified multiple times (default: 127.0.0.1 and ::1 i.e., localhost, or if -rpcallowip has been specified, 0.0.0.0 and :: i.e., all addresses)</source>\n        <translation>和指定的位址繫結以聽候 JSON-RPC 連線。必須同時指定 -rpcallowip 這項設定才有作用。不一定要指定埠號，指定的話會覆蓋掉 -rpcport 設定。IPv6 請用 [主機]:通訊埠 這種格式。這個選項可以設定多次。(預設值: 127.0.0.1 和 ::1，也就是 localhost。當有指定 -rpcallowip 時，預設值為 0.0.0.0 和 ::，也就是所有位址)</translation>\n    </message>\n    <message>\n        <source>Do not keep transactions in the mempool longer than &lt;n&gt; hours (default: %u)</source>\n        <translation>不要讓交易留在記憶池中超過 &lt;n&gt; 個小時(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Equivalent bytes per sigop in transactions for relay and mining (default: %u)</source>\n        <translation>轉發和開採時，交易資料中每個 sigop 的等同位元組數(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading %s: You can't enable HD on an already existing non-HD wallet</source>\n        <translation>載入 %s 發生錯誤：不能對已存在的非 HD 錢包啟用 HD 功能。</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet parameter must only specify a filename (not a path).</source>\n        <translation>載入錢包檔 %s 失敗。-wallet 參數只能指定檔案名稱(不包含路徑)。</translation>\n    </message>\n    <message>\n        <source>Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)</source>\n        <translation>當製造交易時，如果每千位元組(kB)的手續費比這個值(單位是 %s)低，就視為沒付手續費(預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Force relay of transactions from whitelisted peers even if they violate local relay policy (default: %d)</source>\n        <translation>強制轉發從白名點節點收到的交易，即使它們違反了本機的轉發準則(預設值: %d)</translation>\n    </message>\n    <message>\n        <source>How thorough the block verification of -checkblocks is (0-4, default: %u)</source>\n        <translation>使用 -checkblocks 檢查區塊的仔細程度(0 到 4，預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain a full transaction index, used by the getrawtransaction rpc call (default: %u)</source>\n        <translation>維護全部交易的索引，用在 getrawtransaction 這個 RPC 請求(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Number of seconds to keep misbehaving peers from reconnecting (default: %u)</source>\n        <translation>避免與亂搞的節點連線的秒數(預設: %u)</translation>\n    </message>\n    <message>\n        <source>Output debugging information (default: %u, supplying &lt;category&gt; is optional)</source>\n        <translation>輸出除錯資訊(預設值: %u, 不一定要指定 &lt;category&gt;)</translation>\n    </message>\n    <message>\n        <source>Sets the serialization of raw transaction or block hex returned in non-verbose mode, non-segwit(0) or segwit(1) (default: %d)</source>\n        <translation>設定非冗長模式時，回傳的交易原始資料或區塊位元值的序列化形式：無 segwit 為 0，或是有 segwit 為 1 (預設值: %d)</translation>\n    </message>\n    <message>\n        <source>Specify directory to hold wallets (default: &lt;datadir&gt;/wallets if it exists, otherwise &lt;datadir&gt;)</source>\n        <translation>指定用來放錢包檔的目錄(預設值: 如果存在的話就用 &lt;datadir&gt;/wallets, 否則為 &lt;datadir&gt;)</translation>\n    </message>\n    <message>\n        <source>Specify location of debug log file: this can be an absolute path or a path relative to the data directory (default: %s)</source>\n        <translation>指定除錯紀錄檔的位址: 可以用絕對路徑，也可以用相對於資料路徑的相對路徑(預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Support filtering of blocks and transaction with bloom filters (default: %u)</source>\n        <translation>支援用布倫過濾器來過濾區塊和交易(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target</source>\n        <translation>容許自動免找零成為手續費的交易手續費率(單位: %s/kB, 預設值: %s)。注意: 如果在該費率下，找零的零錢會成為零散錢，則自動棄掉成為手續費。但棄掉的零錢費率永遠不會大於零散錢的轉發費率，金額也不會大於最長預估確認時間所需的手續費</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you may pay when fee estimates are not available.</source>\n        <translation>這是當預估手續費還沒計算出來時，付款交易預設會付的手續費。</translation>\n    </message>\n    <message>\n        <source>This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit %s and cryptographic software written by Eric Young and UPnP software written by Thomas Bernard.</source>\n        <translation>此產品包含了由 OpenSSL Project 所開發的 OpenSSL Toolkit 軟體 %s, 由 Eric Young 撰寫的加解密軟體，以及由 Thomas Bernard 所撰寫的 UPnP 軟體。</translation>\n    </message>\n    <message>\n        <source>Total length of network version string (%i) exceeds maximum length (%i). Reduce the number or size of uacomments.</source>\n        <translation>網路版本字串的總長度(%i)超過最大長度(%i)了。請減少 uacomment 參數的數目或長度。</translation>\n    </message>\n    <message>\n        <source>Tries to keep outbound traffic under the given target (in MiB per 24h), 0 = no limit (default: %d)</source>\n        <translation>試著保持輸出流量在目標值以下，單位是每 24 小時的百萬位元組(MiB)數，0 表示沒有限制(預設值: %d)</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -socks found. Setting SOCKS version isn't possible anymore, only SOCKS5 proxies are supported.</source>\n        <translation>找到不再支援的 -socks 參數。現在只支援 SOCKS5 協定的代理伺服器，因此不可以指定 SOCKS 協定版本了。</translation>\n    </message>\n    <message>\n        <source>Unsupported argument -whitelistalwaysrelay ignored, use -whitelistrelay and/or -whitelistforcerelay.</source>\n        <translation>忽略不支援的參數 -whitelistalwaysrelay，請改用 -whitelistrelay 和 -whitelistforcerelay​ 的組合。</translation>\n    </message>\n    <message>\n        <source>Use separate SOCKS5 proxy to reach peers via Tor hidden services (default: %s)</source>\n        <translation>使用另外的 SOCK5 代理伺服器，來透過 Tor 隱藏服務跟其他節點聯絡(預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Warning: Unknown block versions being mined! It's possible unknown rules are in effect</source>\n        <translation>警告: 有礦工正在開採不明版本的區塊！這表示有不明的交易規則正在作用中</translation>\n    </message>\n    <message>\n        <source>Warning: Wallet file corrupt, data salvaged! Original %s saved as %s in %s; if your balance or transactions are incorrect you should restore from a backup.</source>\n        <translation>警告: 錢包檔壞掉，但資料被救回來了！原來的檔案 %s 改儲存為 %s，在目錄 %s 下。 如果餘額或交易資料有誤的話，你應該要從備份資料復原回來。</translation>\n    </message>\n    <message>\n        <source>Whitelist peers connecting from the given IP address (e.g. 1.2.3.4) or CIDR notated network (e.g. 1.2.3.0/24). Can be specified multiple times.</source>\n        <translation>把來自指定位址(例如：1.2.3.4)或 CIDR 格式網段(例如：1.2.3.0/24)的節點放進白名單。這個選項可以設定多次。</translation>\n    </message>\n    <message>\n        <source>%s is set very high!</source>\n        <translation>%s 的設定值異常大！</translation>\n    </message>\n    <message>\n        <source>(default: %s)</source>\n        <translation>(預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Always query for peer addresses via DNS lookup (default: %u)</source>\n        <translation>是否一定要用域名查詢來搜尋節點(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. -wallet filename must be a regular file.</source>\n        <translation>載入錢包檔 %s 失敗。-wallet 參數檔名的檔案必須是一般檔案。</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Duplicate -wallet filename specified.</source>\n        <translation>載入錢包檔 %s 失敗。-wallet 參數指定了重複的檔名。</translation>\n    </message>\n    <message>\n        <source>Error loading wallet %s. Invalid characters in -wallet filename.</source>\n        <translation>載入錢包檔 %s 失敗。-wallet 參數檔名含有無效的字元。</translation>\n    </message>\n    <message>\n        <source>How many blocks to check at startup (default: %u, 0 = all)</source>\n        <translation>啓動時檢查的區塊數(預設值: %u, 指定 0 表示全部)</translation>\n    </message>\n    <message>\n        <source>Include IP addresses in debug output (default: %u)</source>\n        <translation>在除錯輸出內容中包含網際網路位址(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Keypool ran out, please call keypoolrefill first</source>\n        <translation>密鑰池已經乾了，請先執行 keypoolrefill</translation>\n    </message>\n    <message>\n        <source>Listen for JSON-RPC connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>在通訊埠 &lt;port&gt; 聽候 JSON-RPC 連線(預設值: %u, 或若為測試網路: %u)</translation>\n    </message>\n    <message>\n        <source>Listen for connections on &lt;port&gt; (default: %u or testnet: %u)</source>\n        <translation>在通訊埠 &lt;port&gt; 聽候連線(預設值: %u, 或若為測試網路: %u)</translation>\n    </message>\n    <message>\n        <source>Maintain at most &lt;n&gt; connections to peers (default: %u)</source>\n        <translation>維持與節點連線數的上限為 &lt;n&gt; 個(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Make the wallet broadcast transactions</source>\n        <translation>讓錢包能公告交易</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>每個連線的接收緩衝區大小上限為 &lt;n&gt;*1000 個位元組(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: %u)</source>\n        <translation>每個連線的傳送緩衝區大小上限為 &lt;n&gt;*1000 個位元組(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Prepend debug output with timestamp (default: %u)</source>\n        <translation>在除錯輸出內容前附加時間(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Relay and mine data carrier transactions (default: %u)</source>\n        <translation>允許轉發和開採只帶資料的交易(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Relay non-P2SH multisig (default: %u)</source>\n        <translation>允許轉發非 P2SH 的多簽章交易(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Set key pool size to &lt;n&gt; (default: %u)</source>\n        <translation>設定密鑰池大小為 &lt;n&gt; (預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Set maximum BIP141 block weight (default: %d)</source>\n        <translation>設定 BIP141 區塊重量的最大值(預設值: %d)</translation>\n    </message>\n    <message>\n        <source>Set the number of threads to service RPC calls (default: %d)</source>\n        <translation>設定處理 RPC 服務請求的執行緒數目(預設值: %d)</translation>\n    </message>\n    <message>\n        <source>Specify configuration file (default: %s)</source>\n        <translation>指定設定檔(預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Specify connection timeout in milliseconds (minimum: 1, default: %d)</source>\n        <translation>指定連線在幾毫秒後逾時 (最少值: 1, 預設值: %d)</translation>\n    </message>\n    <message>\n        <source>Specify pid file (default: %s)</source>\n        <translation>指定行程識別碼檔案(預設值: %s)</translation>\n    </message>\n    <message>\n        <source>Spend unconfirmed change when sending transactions (default: %u)</source>\n        <translation>傳送交易時可以花還沒確認的零錢(預設值: %u)</translation>\n    </message>\n    <message>\n        <source>Starting network threads...</source>\n        <translation>正在啟動網路執行緒...</translation>\n    </message>\n    <message>\n        <source>The wallet will avoid paying less than the minimum relay fee.</source>\n        <translation>錢包軟體會付多於最小轉發費用的手續費。</translation>\n    </message>\n    <message>\n        <source>This is the minimum transaction fee you pay on every transaction.</source>\n        <translation>這是你每次交易付款時最少要付的手續費。</translation>\n    </message>\n    <message>\n        <source>This is the transaction fee you will pay if you send a transaction.</source>\n        <translation>這是你交易付款時所要付的手續費。</translation>\n    </message>\n    <message>\n        <source>Threshold for disconnecting misbehaving peers (default: %u)</source>\n        <translation>與亂搞的節點斷線的臨界值 (預設: %u)</translation>\n    </message>\n    <message>\n        <source>Transaction amounts must not be negative</source>\n        <translation>交易金額不能是負的</translation>\n    </message>\n    <message>\n        <source>Transaction has too long of a mempool chain</source>\n        <translation>交易造成記憶池中的交易鏈太長</translation>\n    </message>\n    <message>\n        <source>Transaction must have at least one recipient</source>\n        <translation>交易必須至少要有一個收款人</translation>\n    </message>\n    <message>\n        <source>Unknown network specified in -onlynet: '%s'</source>\n        <translation>在 -onlynet 指定了不明的網路別: '%s'</translation>\n    </message>\n    <message>\n        <source>Insufficient funds</source>\n        <translation>累積金額不足</translation>\n    </message>\n    <message>\n        <source>Loading block index...</source>\n        <translation>正在載入區塊索引...</translation>\n    </message>\n    <message>\n        <source>Loading wallet...</source>\n        <translation>正在載入錢包資料...</translation>\n    </message>\n    <message>\n        <source>Cannot downgrade wallet</source>\n        <translation>沒辦法把錢包格式降級</translation>\n    </message>\n    <message>\n        <source>Rescanning...</source>\n        <translation>正在重新掃描...</translation>\n    </message>\n    <message>\n        <source>Done loading</source>\n        <translation>載入完成</translation>\n    </message>\n    <message>\n        <source>Error</source>\n        <translation>錯誤</translation>\n    </message>\n</context>\n</TS>"
  },
  {
    "path": "src/qt/macdockiconhandler.h",
    "content": "// Copyright (c) 2011-2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_MACDOCKICONHANDLER_H\n#define BITCOIN_QT_MACDOCKICONHANDLER_H\n\n#include <QMainWindow>\n#include <QObject>\n\nQT_BEGIN_NAMESPACE\nclass QIcon;\nclass QMenu;\nclass QWidget;\nQT_END_NAMESPACE\n\n/** Macintosh-specific dock icon handler.\n */\nclass MacDockIconHandler : public QObject\n{\n    Q_OBJECT\n\npublic:\n    ~MacDockIconHandler();\n\n    QMenu *dockMenu();\n    void setIcon(const QIcon &icon);\n    void setMainWindow(QMainWindow *window);\n    static MacDockIconHandler *instance();\n    static void cleanup();\n    void handleDockIconClickEvent();\n\nQ_SIGNALS:\n    void dockIconClicked();\n\nprivate:\n    MacDockIconHandler();\n\n    QWidget *m_dummyWidget;\n    QMenu *m_dockMenu;\n    QMainWindow *mainWindow;\n};\n\n#endif // BITCOIN_QT_MACDOCKICONHANDLER_H\n"
  },
  {
    "path": "src/qt/macdockiconhandler.mm",
    "content": "// Copyright (c) 2011-2013 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include \"macdockiconhandler.h\"\n\n#include <QImageWriter>\n#include <QMenu>\n#include <QBuffer>\n#include <QWidget>\n\n#undef slots\n#include <Cocoa/Cocoa.h>\n#include <objc/objc.h>\n#include <objc/message.h>\n\n#if QT_VERSION < 0x050000\nextern void qt_mac_set_dock_menu(QMenu *);\n#endif\n\nstatic MacDockIconHandler *s_instance = nullptr;\n\nbool dockClickHandler(id self,SEL _cmd,...) {\n    Q_UNUSED(self)\n    Q_UNUSED(_cmd)\n    \n    s_instance->handleDockIconClickEvent();\n    \n    // Return NO (false) to suppress the default OS X actions\n    return false;\n}\n\nvoid setupDockClickHandler() {\n    Class cls = objc_getClass(\"NSApplication\");\n    id appInst = objc_msgSend((id)cls, sel_registerName(\"sharedApplication\"));\n    \n    if (appInst != nullptr) {\n        id delegate = objc_msgSend(appInst, sel_registerName(\"delegate\"));\n        Class delClass = (Class)objc_msgSend(delegate,  sel_registerName(\"class\"));\n        SEL shouldHandle = sel_registerName(\"applicationShouldHandleReopen:hasVisibleWindows:\");\n        if (class_getInstanceMethod(delClass, shouldHandle))\n            class_replaceMethod(delClass, shouldHandle, (IMP)dockClickHandler, \"B@:\");\n        else\n            class_addMethod(delClass, shouldHandle, (IMP)dockClickHandler,\"B@:\");\n    }\n}\n\n\nMacDockIconHandler::MacDockIconHandler() : QObject()\n{\n    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n\n    setupDockClickHandler();\n    this->m_dummyWidget = new QWidget();\n    this->m_dockMenu = new QMenu(this->m_dummyWidget);\n    this->setMainWindow(nullptr);\n#if QT_VERSION < 0x050000\n    qt_mac_set_dock_menu(this->m_dockMenu);\n#elif QT_VERSION >= 0x050200\n    this->m_dockMenu->setAsDockMenu();\n#endif\n    [pool release];\n}\n\nvoid MacDockIconHandler::setMainWindow(QMainWindow *window) {\n    this->mainWindow = window;\n}\n\nMacDockIconHandler::~MacDockIconHandler()\n{\n    delete this->m_dummyWidget;\n    this->setMainWindow(nullptr);\n}\n\nQMenu *MacDockIconHandler::dockMenu()\n{\n    return this->m_dockMenu;\n}\n\nvoid MacDockIconHandler::setIcon(const QIcon &icon)\n{\n    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];\n    NSImage *image = nil;\n    if (icon.isNull())\n        image = [[NSImage imageNamed:@\"NSApplicationIcon\"] retain];\n    else {\n        // generate NSImage from QIcon and use this as dock icon.\n        QSize size = icon.actualSize(QSize(128, 128));\n        QPixmap pixmap = icon.pixmap(size);\n\n        // Write image into a R/W buffer from raw pixmap, then save the image.\n        QBuffer notificationBuffer;\n        if (!pixmap.isNull() && notificationBuffer.open(QIODevice::ReadWrite)) {\n            QImageWriter writer(&notificationBuffer, \"PNG\");\n            if (writer.write(pixmap.toImage())) {\n                NSData* macImgData = [NSData dataWithBytes:notificationBuffer.buffer().data()\n                                             length:notificationBuffer.buffer().size()];\n                image =  [[NSImage alloc] initWithData:macImgData];\n            }\n        }\n\n        if(!image) {\n            // if testnet image could not be created, load std. app icon\n            image = [[NSImage imageNamed:@\"NSApplicationIcon\"] retain];\n        }\n    }\n\n    [NSApp setApplicationIconImage:image];\n    [image release];\n    [pool release];\n}\n\nMacDockIconHandler *MacDockIconHandler::instance()\n{\n    if (!s_instance)\n        s_instance = new MacDockIconHandler();\n    return s_instance;\n}\n\nvoid MacDockIconHandler::cleanup()\n{\n    delete s_instance;\n}\n\nvoid MacDockIconHandler::handleDockIconClickEvent()\n{\n    if (this->mainWindow)\n    {\n        this->mainWindow->activateWindow();\n        this->mainWindow->show();\n    }\n\n    Q_EMIT this->dockIconClicked();\n}\n"
  },
  {
    "path": "src/qt/macnotificationhandler.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_MACNOTIFICATIONHANDLER_H\n#define BITCOIN_QT_MACNOTIFICATIONHANDLER_H\n\n#include <QObject>\n\n/** Macintosh-specific notification handler (supports UserNotificationCenter).\n */\nclass MacNotificationHandler : public QObject\n{\n    Q_OBJECT\n\npublic:\n    /** shows a macOS 10.8+ UserNotification in the UserNotificationCenter\n     */\n    void showNotification(const QString &title, const QString &text);\n\n    /** check if OS can handle UserNotifications */\n    bool hasUserNotificationCenterSupport(void);\n    static MacNotificationHandler *instance();\n};\n\n\n#endif // BITCOIN_QT_MACNOTIFICATIONHANDLER_H\n"
  },
  {
    "path": "src/qt/macnotificationhandler.mm",
    "content": "// Copyright (c) 2011-2013 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include \"macnotificationhandler.h\"\n\n#undef slots\n#import <objc/runtime.h>\n#include <Cocoa/Cocoa.h>\n\n// Add an obj-c category (extension) to return the expected bundle identifier\n@implementation NSBundle(returnCorrectIdentifier)\n- (NSString *)__bundleIdentifier\n{\n    if (self == [NSBundle mainBundle]) {\n        return @\"org.sugarchainfoundation.Sugarchain-Qt\";\n    } else {\n        return [self __bundleIdentifier];\n    }\n}\n@end\n\nvoid MacNotificationHandler::showNotification(const QString &title, const QString &text)\n{\n    // check if users OS has support for NSUserNotification\n    if(this->hasUserNotificationCenterSupport()) {\n        // okay, seems like 10.8+\n        QByteArray utf8 = title.toUtf8();\n        char* cString = (char *)utf8.constData();\n        NSString *titleMac = [[NSString alloc] initWithUTF8String:cString];\n\n        utf8 = text.toUtf8();\n        cString = (char *)utf8.constData();\n        NSString *textMac = [[NSString alloc] initWithUTF8String:cString];\n\n        // do everything weak linked (because we will keep <10.8 compatibility)\n        id userNotification = [[NSClassFromString(@\"NSUserNotification\") alloc] init];\n        [userNotification performSelector:@selector(setTitle:) withObject:titleMac];\n        [userNotification performSelector:@selector(setInformativeText:) withObject:textMac];\n\n        id notificationCenterInstance = [NSClassFromString(@\"NSUserNotificationCenter\") performSelector:@selector(defaultUserNotificationCenter)];\n        [notificationCenterInstance performSelector:@selector(deliverNotification:) withObject:userNotification];\n\n        [titleMac release];\n        [textMac release];\n        [userNotification release];\n    }\n}\n\nbool MacNotificationHandler::hasUserNotificationCenterSupport(void)\n{\n    Class possibleClass = NSClassFromString(@\"NSUserNotificationCenter\");\n\n    // check if users OS has support for NSUserNotification\n    if(possibleClass!=nil) {\n        return true;\n    }\n    return false;\n}\n\n\nMacNotificationHandler *MacNotificationHandler::instance()\n{\n    static MacNotificationHandler *s_instance = nullptr;\n    if (!s_instance) {\n        s_instance = new MacNotificationHandler();\n        \n        Class aPossibleClass = objc_getClass(\"NSBundle\");\n        if (aPossibleClass) {\n            // change NSBundle -bundleIdentifier method to return a correct bundle identifier\n            // a bundle identifier is required to use OSXs User Notification Center\n            method_exchangeImplementations(class_getInstanceMethod(aPossibleClass, @selector(bundleIdentifier)),\n                                           class_getInstanceMethod(aPossibleClass, @selector(__bundleIdentifier)));\n        }\n    }\n    return s_instance;\n}\n"
  },
  {
    "path": "src/qt/modaloverlay.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/modaloverlay.h>\n#include <qt/forms/ui_modaloverlay.h>\n\n#include <qt/guiutil.h>\n\n#include <chainparams.h>\n\n#include <QResizeEvent>\n#include <QPropertyAnimation>\n\nModalOverlay::ModalOverlay(QWidget *parent) :\nQWidget(parent),\nui(new Ui::ModalOverlay),\nbestHeaderHeight(0),\nbestHeaderDate(QDateTime()),\nlayerIsVisible(false),\nuserClosed(false)\n{\n    ui->setupUi(this);\n    connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));\n    if (parent) {\n        parent->installEventFilter(this);\n        raise();\n    }\n\n    blockProcessTime.clear();\n    setVisible(false);\n}\n\nModalOverlay::~ModalOverlay()\n{\n    delete ui;\n}\n\nbool ModalOverlay::eventFilter(QObject * obj, QEvent * ev) {\n    if (obj == parent()) {\n        if (ev->type() == QEvent::Resize) {\n            QResizeEvent * rev = static_cast<QResizeEvent*>(ev);\n            resize(rev->size());\n            if (!layerIsVisible)\n                setGeometry(0, height(), width(), height());\n\n        }\n        else if (ev->type() == QEvent::ChildAdded) {\n            raise();\n        }\n    }\n    return QWidget::eventFilter(obj, ev);\n}\n\n//! Tracks parent widget changes\nbool ModalOverlay::event(QEvent* ev) {\n    if (ev->type() == QEvent::ParentAboutToChange) {\n        if (parent()) parent()->removeEventFilter(this);\n    }\n    else if (ev->type() == QEvent::ParentChange) {\n        if (parent()) {\n            parent()->installEventFilter(this);\n            raise();\n        }\n    }\n    return QWidget::event(ev);\n}\n\nvoid ModalOverlay::setKnownBestHeight(int count, const QDateTime& blockDate)\n{\n    if (count > bestHeaderHeight) {\n        bestHeaderHeight = count;\n        bestHeaderDate = blockDate;\n    }\n}\n\nvoid ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVerificationProgress)\n{\n    QDateTime currentDate = QDateTime::currentDateTime();\n\n    // keep a vector of samples of verification progress at height\n    blockProcessTime.push_front(qMakePair(currentDate.toMSecsSinceEpoch(), nVerificationProgress));\n\n    // show progress speed if we have more then one sample\n    if (blockProcessTime.size() >= 2) {\n        double progressDelta = 0;\n        double progressPerHour = 0;\n        qint64 timeDelta = 0;\n        qint64 remainingMSecs = 0;\n        double remainingProgress = 1.0 - nVerificationProgress;\n        for (int i = 1; i < blockProcessTime.size(); i++) {\n            QPair<qint64, double> sample = blockProcessTime[i];\n\n            // take first sample after 500 seconds or last available one\n            if (sample.first < (currentDate.toMSecsSinceEpoch() - 500 * 1000) || i == blockProcessTime.size() - 1) {\n                progressDelta = blockProcessTime[0].second - sample.second;\n                timeDelta = blockProcessTime[0].first - sample.first;\n                progressPerHour = progressDelta / (double) timeDelta * 1000 * 3600;\n                remainingMSecs = (progressDelta > 0) ? remainingProgress / progressDelta * timeDelta : -1;\n                break;\n            }\n        }\n        // show progress increase per hour\n        ui->progressIncreasePerH->setText(QString::number(progressPerHour * 100, 'f', 2)+\"%\");\n\n        // show expected remaining time\n        if(remainingMSecs >= 0) {\t\n            ui->expectedTimeLeft->setText(GUIUtil::formatNiceTimeOffset(remainingMSecs / 1000.0));\n        } else {\n            ui->expectedTimeLeft->setText(QObject::tr(\"unknown\"));\n        }\n\n        static const int MAX_SAMPLES = 5000;\n        if (blockProcessTime.count() > MAX_SAMPLES) {\n            blockProcessTime.remove(MAX_SAMPLES, blockProcessTime.count() - MAX_SAMPLES);\n        }\n    }\n\n    // show the last block date\n    ui->newestBlockDate->setText(blockDate.toString());\n\n    // show the percentage done according to nVerificationProgress\n    ui->percentageProgress->setText(QString::number(nVerificationProgress*100, 'f', 2)+\"%\");\n    ui->progressBar->setValue(nVerificationProgress*100);\n\n    if (!bestHeaderDate.isValid())\n        // not syncing\n        return;\n\n    // estimate the number of headers left based on nPowTargetSpacing\n    // and check if the gui is not aware of the best header (happens rarely)\n    int estimateNumHeadersLeft = bestHeaderDate.secsTo(currentDate) / Params().GetConsensus().nPowTargetSpacing;\n    bool hasBestHeader = bestHeaderHeight >= count;\n\n    // show remaining number of blocks\n    if (estimateNumHeadersLeft < HEADER_HEIGHT_DELTA_SYNC && hasBestHeader) {\n        ui->numberOfBlocksLeft->setText(QString::number(bestHeaderHeight - count));\n    } else {\n        ui->numberOfBlocksLeft->setText(tr(\"Unknown. Syncing Headers (%1)...\").arg(bestHeaderHeight));\n        ui->expectedTimeLeft->setText(tr(\"Unknown...\"));\n    }\n}\n\nvoid ModalOverlay::toggleVisibility()\n{\n    showHide(layerIsVisible, true);\n    if (!layerIsVisible)\n        userClosed = true;\n}\n\nvoid ModalOverlay::showHide(bool hide, bool userRequested)\n{\n    if ( (layerIsVisible && !hide) || (!layerIsVisible && hide) || (!hide && userClosed && !userRequested))\n        return;\n\n    if (!isVisible() && !hide)\n        setVisible(true);\n\n    setGeometry(0, hide ? 0 : height(), width(), height());\n\n    QPropertyAnimation* animation = new QPropertyAnimation(this, \"pos\");\n    animation->setDuration(300);\n    animation->setStartValue(QPoint(0, hide ? 0 : this->height()));\n    animation->setEndValue(QPoint(0, hide ? this->height() : 0));\n    animation->setEasingCurve(QEasingCurve::OutQuad);\n    animation->start(QAbstractAnimation::DeleteWhenStopped);\n    layerIsVisible = !hide;\n}\n\nvoid ModalOverlay::closeClicked()\n{\n    showHide(true);\n    userClosed = true;\n}\n"
  },
  {
    "path": "src/qt/modaloverlay.h",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_MODALOVERLAY_H\n#define BITCOIN_QT_MODALOVERLAY_H\n\n#include <QDateTime>\n#include <QWidget>\n\n//! The required delta of headers to the estimated number of available headers until we show the IBD progress\nstatic constexpr int HEADER_HEIGHT_DELTA_SYNC = 24;\n\nnamespace Ui {\n    class ModalOverlay;\n}\n\n/** Modal overlay to display information about the chain-sync state */\nclass ModalOverlay : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    explicit ModalOverlay(QWidget *parent);\n    ~ModalOverlay();\n\npublic Q_SLOTS:\n    void tipUpdate(int count, const QDateTime& blockDate, double nVerificationProgress);\n    void setKnownBestHeight(int count, const QDateTime& blockDate);\n\n    void toggleVisibility();\n    // will show or hide the modal layer\n    void showHide(bool hide = false, bool userRequested = false);\n    void closeClicked();\n    bool isLayerVisible() const { return layerIsVisible; }\n\nprotected:\n    bool eventFilter(QObject * obj, QEvent * ev);\n    bool event(QEvent* ev);\n\nprivate:\n    Ui::ModalOverlay *ui;\n    int bestHeaderHeight; //best known height (based on the headers)\n    QDateTime bestHeaderDate;\n    QVector<QPair<qint64, double> > blockProcessTime;\n    bool layerIsVisible;\n    bool userClosed;\n};\n\n#endif // BITCOIN_QT_MODALOVERLAY_H\n"
  },
  {
    "path": "src/qt/networkstyle.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/networkstyle.h>\n\n#include <qt/guiconstants.h>\n\n#include <QApplication>\n\nstatic const struct {\n    const char *networkId;\n    const char *appName;\n    const int iconColorHueShift;\n    const int iconColorSaturationReduction;\n    const char *titleAddText;\n} network_styles[] = {\n    {\"main\", QAPP_APP_NAME_DEFAULT, 0, 0, \"\"},\n    {\"test\", QAPP_APP_NAME_TESTNET, 70, 30, QT_TRANSLATE_NOOP(\"SplashScreen\", \"[testnet]\")},\n    {\"regtest\", QAPP_APP_NAME_TESTNET, 160, 30, \"[regtest]\"}\n};\nstatic const unsigned network_styles_count = sizeof(network_styles)/sizeof(*network_styles);\n\n// titleAddText needs to be const char* for tr()\nNetworkStyle::NetworkStyle(const QString &_appName, const int iconColorHueShift, const int iconColorSaturationReduction, const char *_titleAddText):\n    appName(_appName),\n    titleAddText(qApp->translate(\"SplashScreen\", _titleAddText))\n{\n    // load pixmap\n    QPixmap pixmap(\":/icons/bitcoin\");\n\n    if(iconColorHueShift != 0 && iconColorSaturationReduction != 0)\n    {\n        // generate QImage from QPixmap\n        QImage img = pixmap.toImage();\n\n        int h,s,l,a;\n\n        // traverse though lines\n        for(int y=0;y<img.height();y++)\n        {\n            QRgb *scL = reinterpret_cast< QRgb *>( img.scanLine( y ) );\n\n            // loop through pixels\n            for(int x=0;x<img.width();x++)\n            {\n                // preserve alpha because QColor::getHsl doesn't return the alpha value\n                a = qAlpha(scL[x]);\n                QColor col(scL[x]);\n\n                // get hue value\n                col.getHsl(&h,&s,&l);\n\n                // rotate color on RGB color circle\n                // 70° should end up with the typical \"testnet\" green\n                h+=iconColorHueShift;\n\n                // change saturation value\n                if(s>iconColorSaturationReduction)\n                {\n                    s -= iconColorSaturationReduction;\n                }\n                col.setHsl(h,s,l,a);\n\n                // set the pixel\n                scL[x] = col.rgba();\n            }\n        }\n\n        //convert back to QPixmap\n#if QT_VERSION >= 0x040700\n        pixmap.convertFromImage(img);\n#else\n        pixmap = QPixmap::fromImage(img);\n#endif\n    }\n\n    appIcon             = QIcon(pixmap);\n    trayAndWindowIcon   = QIcon(pixmap.scaled(QSize(256,256)));\n}\n\nconst NetworkStyle *NetworkStyle::instantiate(const QString &networkId)\n{\n    for (unsigned x=0; x<network_styles_count; ++x)\n    {\n        if (networkId == network_styles[x].networkId)\n        {\n            return new NetworkStyle(\n                    network_styles[x].appName,\n                    network_styles[x].iconColorHueShift,\n                    network_styles[x].iconColorSaturationReduction,\n                    network_styles[x].titleAddText);\n        }\n    }\n    return 0;\n}\n"
  },
  {
    "path": "src/qt/networkstyle.h",
    "content": "// Copyright (c) 2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_NETWORKSTYLE_H\n#define BITCOIN_QT_NETWORKSTYLE_H\n\n#include <QIcon>\n#include <QPixmap>\n#include <QString>\n\n/* Coin network-specific GUI style information */\nclass NetworkStyle\n{\npublic:\n    /** Get style associated with provided BIP70 network id, or 0 if not known */\n    static const NetworkStyle *instantiate(const QString &networkId);\n\n    const QString &getAppName() const { return appName; }\n    const QIcon &getAppIcon() const { return appIcon; }\n    const QIcon &getTrayAndWindowIcon() const { return trayAndWindowIcon; }\n    const QString &getTitleAddText() const { return titleAddText; }\n\nprivate:\n    NetworkStyle(const QString &appName, const int iconColorHueShift, const int iconColorSaturationReduction, const char *titleAddText);\n\n    QString appName;\n    QIcon appIcon;\n    QIcon trayAndWindowIcon;\n    QString titleAddText;\n};\n\n#endif // BITCOIN_QT_NETWORKSTYLE_H\n"
  },
  {
    "path": "src/qt/notificator.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/notificator.h>\n\n#include <QApplication>\n#include <QByteArray>\n#include <QImageWriter>\n#include <QMessageBox>\n#include <QMetaType>\n#include <QStyle>\n#include <QSystemTrayIcon>\n#include <QTemporaryFile>\n#include <QVariant>\n#ifdef USE_DBUS\n#include <stdint.h>\n#include <QtDBus>\n#endif\n// Include ApplicationServices.h after QtDbus to avoid redefinition of check().\n// This affects at least OSX 10.6. See /usr/include/AssertMacros.h for details.\n// Note: This could also be worked around using:\n// #define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0\n#ifdef Q_OS_MAC\n#include <ApplicationServices/ApplicationServices.h>\n#include <qt/macnotificationhandler.h>\n#endif\n\n\n#ifdef USE_DBUS\n// https://wiki.ubuntu.com/NotificationDevelopmentGuidelines recommends at least 128\nconst int FREEDESKTOP_NOTIFICATION_ICON_SIZE = 128;\n#endif\n\nNotificator::Notificator(const QString &_programName, QSystemTrayIcon *_trayIcon, QWidget *_parent) :\n    QObject(_parent),\n    parent(_parent),\n    programName(_programName),\n    mode(None),\n    trayIcon(_trayIcon)\n#ifdef USE_DBUS\n    ,interface(0)\n#endif\n{\n    if(_trayIcon && _trayIcon->supportsMessages())\n    {\n        mode = QSystemTray;\n    }\n#ifdef USE_DBUS\n    interface = new QDBusInterface(\"org.freedesktop.Notifications\",\n        \"/org/freedesktop/Notifications\", \"org.freedesktop.Notifications\");\n    if(interface->isValid())\n    {\n        mode = Freedesktop;\n    }\n#endif\n#ifdef Q_OS_MAC\n    // check if users OS has support for NSUserNotification\n    if( MacNotificationHandler::instance()->hasUserNotificationCenterSupport()) {\n        mode = UserNotificationCenter;\n    }\n#endif\n}\n\nNotificator::~Notificator()\n{\n#ifdef USE_DBUS\n    delete interface;\n#endif\n}\n\n#ifdef USE_DBUS\n\n// Loosely based on http://www.qtcentre.org/archive/index.php/t-25879.html\nclass FreedesktopImage\n{\npublic:\n    FreedesktopImage() {}\n    explicit FreedesktopImage(const QImage &img);\n\n    static int metaType();\n\n    // Image to variant that can be marshalled over DBus\n    static QVariant toVariant(const QImage &img);\n\nprivate:\n    int width, height, stride;\n    bool hasAlpha;\n    int channels;\n    int bitsPerSample;\n    QByteArray image;\n\n    friend QDBusArgument &operator<<(QDBusArgument &a, const FreedesktopImage &i);\n    friend const QDBusArgument &operator>>(const QDBusArgument &a, FreedesktopImage &i);\n};\n\nQ_DECLARE_METATYPE(FreedesktopImage);\n\n// Image configuration settings\nconst int CHANNELS = 4;\nconst int BYTES_PER_PIXEL = 4;\nconst int BITS_PER_SAMPLE = 8;\n\nFreedesktopImage::FreedesktopImage(const QImage &img):\n    width(img.width()),\n    height(img.height()),\n    stride(img.width() * BYTES_PER_PIXEL),\n    hasAlpha(true),\n    channels(CHANNELS),\n    bitsPerSample(BITS_PER_SAMPLE)\n{\n    // Convert 00xAARRGGBB to RGBA bytewise (endian-independent) format\n    QImage tmp = img.convertToFormat(QImage::Format_ARGB32);\n    const uint32_t *data = reinterpret_cast<const uint32_t*>(tmp.bits());\n\n    unsigned int num_pixels = width * height;\n    image.resize(num_pixels * BYTES_PER_PIXEL);\n\n    for(unsigned int ptr = 0; ptr < num_pixels; ++ptr)\n    {\n        image[ptr*BYTES_PER_PIXEL+0] = data[ptr] >> 16; // R\n        image[ptr*BYTES_PER_PIXEL+1] = data[ptr] >> 8;  // G\n        image[ptr*BYTES_PER_PIXEL+2] = data[ptr];       // B\n        image[ptr*BYTES_PER_PIXEL+3] = data[ptr] >> 24; // A\n    }\n}\n\nQDBusArgument &operator<<(QDBusArgument &a, const FreedesktopImage &i)\n{\n    a.beginStructure();\n    a << i.width << i.height << i.stride << i.hasAlpha << i.bitsPerSample << i.channels << i.image;\n    a.endStructure();\n    return a;\n}\n\nconst QDBusArgument &operator>>(const QDBusArgument &a, FreedesktopImage &i)\n{\n    a.beginStructure();\n    a >> i.width >> i.height >> i.stride >> i.hasAlpha >> i.bitsPerSample >> i.channels >> i.image;\n    a.endStructure();\n    return a;\n}\n\nint FreedesktopImage::metaType()\n{\n    return qDBusRegisterMetaType<FreedesktopImage>();\n}\n\nQVariant FreedesktopImage::toVariant(const QImage &img)\n{\n    FreedesktopImage fimg(img);\n    return QVariant(FreedesktopImage::metaType(), &fimg);\n}\n\nvoid Notificator::notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)\n{\n    Q_UNUSED(cls);\n    // Arguments for DBus call:\n    QList<QVariant> args;\n\n    // Program Name:\n    args.append(programName);\n\n    // Unique ID of this notification type:\n    args.append(0U);\n\n    // Application Icon, empty string\n    args.append(QString());\n\n    // Summary\n    args.append(title);\n\n    // Body\n    args.append(text);\n\n    // Actions (none, actions are deprecated)\n    QStringList actions;\n    args.append(actions);\n\n    // Hints\n    QVariantMap hints;\n\n    // If no icon specified, set icon based on class\n    QIcon tmpicon;\n    if(icon.isNull())\n    {\n        QStyle::StandardPixmap sicon = QStyle::SP_MessageBoxQuestion;\n        switch(cls)\n        {\n        case Information: sicon = QStyle::SP_MessageBoxInformation; break;\n        case Warning: sicon = QStyle::SP_MessageBoxWarning; break;\n        case Critical: sicon = QStyle::SP_MessageBoxCritical; break;\n        default: break;\n        }\n        tmpicon = QApplication::style()->standardIcon(sicon);\n    }\n    else\n    {\n        tmpicon = icon;\n    }\n    hints[\"icon_data\"] = FreedesktopImage::toVariant(tmpicon.pixmap(FREEDESKTOP_NOTIFICATION_ICON_SIZE).toImage());\n    args.append(hints);\n\n    // Timeout (in msec)\n    args.append(millisTimeout);\n\n    // \"Fire and forget\"\n    interface->callWithArgumentList(QDBus::NoBlock, \"Notify\", args);\n}\n#endif\n\nvoid Notificator::notifySystray(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)\n{\n    Q_UNUSED(icon);\n    QSystemTrayIcon::MessageIcon sicon = QSystemTrayIcon::NoIcon;\n    switch(cls) // Set icon based on class\n    {\n    case Information: sicon = QSystemTrayIcon::Information; break;\n    case Warning: sicon = QSystemTrayIcon::Warning; break;\n    case Critical: sicon = QSystemTrayIcon::Critical; break;\n    }\n    trayIcon->showMessage(title, text, sicon, millisTimeout);\n}\n\n// Based on Qt's tray icon implementation\n#ifdef Q_OS_MAC\nvoid Notificator::notifyMacUserNotificationCenter(Class cls, const QString &title, const QString &text, const QIcon &icon) {\n    // icon is not supported by the user notification center yet. OSX will use the app icon.\n    MacNotificationHandler::instance()->showNotification(title, text);\n}\n\n#endif\n\nvoid Notificator::notify(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)\n{\n    switch(mode)\n    {\n#ifdef USE_DBUS\n    case Freedesktop:\n        notifyDBus(cls, title, text, icon, millisTimeout);\n        break;\n#endif\n    case QSystemTray:\n        notifySystray(cls, title, text, icon, millisTimeout);\n        break;\n#ifdef Q_OS_MAC\n    case UserNotificationCenter:\n        notifyMacUserNotificationCenter(cls, title, text, icon);\n        break;\n#endif\n    default:\n        if(cls == Critical)\n        {\n            // Fall back to old fashioned pop-up dialog if critical and no other notification available\n            QMessageBox::critical(parent, title, text, QMessageBox::Ok, QMessageBox::Ok);\n        }\n        break;\n    }\n}\n"
  },
  {
    "path": "src/qt/notificator.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_NOTIFICATOR_H\n#define BITCOIN_QT_NOTIFICATOR_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <QIcon>\n#include <QObject>\n\nQT_BEGIN_NAMESPACE\nclass QSystemTrayIcon;\n\n#ifdef USE_DBUS\nclass QDBusInterface;\n#endif\nQT_END_NAMESPACE\n\n/** Cross-platform desktop notification client. */\nclass Notificator: public QObject\n{\n    Q_OBJECT\n\npublic:\n    /** Create a new notificator.\n       @note Ownership of trayIcon is not transferred to this object.\n    */\n    Notificator(const QString &programName, QSystemTrayIcon *trayIcon, QWidget *parent);\n    ~Notificator();\n\n    // Message class\n    enum Class\n    {\n        Information,    /**< Informational message */\n        Warning,        /**< Notify user of potential problem */\n        Critical        /**< An error occurred */\n    };\n\npublic Q_SLOTS:\n    /** Show notification message.\n       @param[in] cls    general message class\n       @param[in] title  title shown with message\n       @param[in] text   message content\n       @param[in] icon   optional icon to show with message\n       @param[in] millisTimeout notification timeout in milliseconds (defaults to 10 seconds)\n       @note Platform implementations are free to ignore any of the provided fields except for \\a text.\n     */\n    void notify(Class cls, const QString &title, const QString &text,\n                const QIcon &icon = QIcon(), int millisTimeout = 10000);\n\nprivate:\n    QWidget *parent;\n    enum Mode {\n        None,                       /**< Ignore informational notifications, and show a modal pop-up dialog for Critical notifications. */\n        Freedesktop,                /**< Use DBus org.freedesktop.Notifications */\n        QSystemTray,                /**< Use QSystemTray::showMessage */\n        UserNotificationCenter      /**< Use the 10.8+ User Notification Center (Mac only) */\n    };\n    QString programName;\n    Mode mode;\n    QSystemTrayIcon *trayIcon;\n#ifdef USE_DBUS\n    QDBusInterface *interface;\n\n    void notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout);\n#endif\n    void notifySystray(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout);\n#ifdef Q_OS_MAC\n    void notifyMacUserNotificationCenter(Class cls, const QString &title, const QString &text, const QIcon &icon);\n#endif\n};\n\n#endif // BITCOIN_QT_NOTIFICATOR_H\n"
  },
  {
    "path": "src/qt/openuridialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/openuridialog.h>\n#include <qt/forms/ui_openuridialog.h>\n\n#include <qt/guiutil.h>\n#include <qt/walletmodel.h>\n\n#include <QUrl>\n\nOpenURIDialog::OpenURIDialog(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::OpenURIDialog)\n{\n    ui->setupUi(this);\n#if QT_VERSION >= 0x040700\n    ui->uriEdit->setPlaceholderText(\"sugarchain:\");\n#endif\n}\n\nOpenURIDialog::~OpenURIDialog()\n{\n    delete ui;\n}\n\nQString OpenURIDialog::getURI()\n{\n    return ui->uriEdit->text();\n}\n\nvoid OpenURIDialog::accept()\n{\n    SendCoinsRecipient rcp;\n    if(GUIUtil::parseBitcoinURI(getURI(), &rcp))\n    {\n        /* Only accept value URIs */\n        QDialog::accept();\n    } else {\n        ui->uriEdit->setValid(false);\n    }\n}\n\nvoid OpenURIDialog::on_selectFileButton_clicked()\n{\n    QString filename = GUIUtil::getOpenFileName(this, tr(\"Select payment request file to open\"), \"\", \"\", nullptr);\n    if(filename.isEmpty())\n        return;\n    QUrl fileUri = QUrl::fromLocalFile(filename);\n    ui->uriEdit->setText(\"sugarchain:?r=\" + QUrl::toPercentEncoding(fileUri.toString()));\n}\n"
  },
  {
    "path": "src/qt/openuridialog.h",
    "content": "// Copyright (c) 2011-2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_OPENURIDIALOG_H\n#define BITCOIN_QT_OPENURIDIALOG_H\n\n#include <QDialog>\n\nnamespace Ui {\n    class OpenURIDialog;\n}\n\nclass OpenURIDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit OpenURIDialog(QWidget *parent);\n    ~OpenURIDialog();\n\n    QString getURI();\n\nprotected Q_SLOTS:\n    void accept();\n\nprivate Q_SLOTS:\n    void on_selectFileButton_clicked();\n\nprivate:\n    Ui::OpenURIDialog *ui;\n};\n\n#endif // BITCOIN_QT_OPENURIDIALOG_H\n"
  },
  {
    "path": "src/qt/optionsdialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <qt/optionsdialog.h>\n#include <qt/forms/ui_optionsdialog.h>\n\n#include <qt/bitcoinunits.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n\n#include <validation.h> // for DEFAULT_SCRIPTCHECK_THREADS and MAX_SCRIPTCHECK_THREADS\n#include <netbase.h>\n#include <txdb.h> // for -dbcache defaults\n\n#include <QDataWidgetMapper>\n#include <QDir>\n#include <QIntValidator>\n#include <QLocale>\n#include <QMessageBox>\n#include <QTimer>\n\nOptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :\n    QDialog(parent),\n    ui(new Ui::OptionsDialog),\n    model(0),\n    mapper(0)\n{\n    ui->setupUi(this);\n\n    /* Main elements init */\n    ui->databaseCache->setMinimum(nMinDbCache);\n    ui->databaseCache->setMaximum(nMaxDbCache);\n    ui->threadsScriptVerif->setMinimum(-GetNumCores());\n    ui->threadsScriptVerif->setMaximum(MAX_SCRIPTCHECK_THREADS);\n\n    /* Network elements init */\n#ifndef USE_UPNP\n    ui->mapPortUpnp->setEnabled(false);\n#endif\n\n    ui->proxyIp->setEnabled(false);\n    ui->proxyPort->setEnabled(false);\n    ui->proxyPort->setValidator(new QIntValidator(1, 65535, this));\n\n    ui->proxyIpTor->setEnabled(false);\n    ui->proxyPortTor->setEnabled(false);\n    ui->proxyPortTor->setValidator(new QIntValidator(1, 65535, this));\n\n    connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyIp, SLOT(setEnabled(bool)));\n    connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyPort, SLOT(setEnabled(bool)));\n    connect(ui->connectSocks, SIGNAL(toggled(bool)), this, SLOT(updateProxyValidationState()));\n\n    connect(ui->connectSocksTor, SIGNAL(toggled(bool)), ui->proxyIpTor, SLOT(setEnabled(bool)));\n    connect(ui->connectSocksTor, SIGNAL(toggled(bool)), ui->proxyPortTor, SLOT(setEnabled(bool)));\n    connect(ui->connectSocksTor, SIGNAL(toggled(bool)), this, SLOT(updateProxyValidationState()));\n\n    /* Window elements init */\n#ifdef Q_OS_MAC\n    /* remove Window tab on Mac */\n    ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWindow));\n#endif\n\n    /* remove Wallet tab in case of -disablewallet */\n    if (!enableWallet) {\n        ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWallet));\n    }\n\n    /* Display elements init */\n    QDir translations(\":translations\");\n\n    ui->bitcoinAtStartup->setToolTip(ui->bitcoinAtStartup->toolTip().arg(tr(PACKAGE_NAME)));\n    ui->bitcoinAtStartup->setText(ui->bitcoinAtStartup->text().arg(tr(PACKAGE_NAME)));\n\n    ui->openBitcoinConfButton->setToolTip(ui->openBitcoinConfButton->toolTip().arg(tr(PACKAGE_NAME)));\n\n    ui->lang->setToolTip(ui->lang->toolTip().arg(tr(PACKAGE_NAME)));\n    ui->lang->addItem(QString(\"(\") + tr(\"default\") + QString(\")\"), QVariant(\"\"));\n    for (const QString &langStr : translations.entryList())\n    {\n        QLocale locale(langStr);\n\n        /** check if the locale name consists of 2 parts (language_country) */\n        if(langStr.contains(\"_\"))\n        {\n#if QT_VERSION >= 0x040800\n            /** display language strings as \"native language - native country (locale name)\", e.g. \"Deutsch - Deutschland (de)\" */\n            ui->lang->addItem(locale.nativeLanguageName() + QString(\" - \") + locale.nativeCountryName() + QString(\" (\") + langStr + QString(\")\"), QVariant(langStr));\n#else\n            /** display language strings as \"language - country (locale name)\", e.g. \"German - Germany (de)\" */\n            ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(\" - \") + QLocale::countryToString(locale.country()) + QString(\" (\") + langStr + QString(\")\"), QVariant(langStr));\n#endif\n        }\n        else\n        {\n#if QT_VERSION >= 0x040800\n            /** display language strings as \"native language (locale name)\", e.g. \"Deutsch (de)\" */\n            ui->lang->addItem(locale.nativeLanguageName() + QString(\" (\") + langStr + QString(\")\"), QVariant(langStr));\n#else\n            /** display language strings as \"language (locale name)\", e.g. \"German (de)\" */\n            ui->lang->addItem(QLocale::languageToString(locale.language()) + QString(\" (\") + langStr + QString(\")\"), QVariant(langStr));\n#endif\n        }\n    }\n#if QT_VERSION >= 0x040700\n    ui->thirdPartyTxUrls->setPlaceholderText(\"https://example.com/tx/%s\");\n#endif\n\n    ui->unit->setModel(new BitcoinUnits(this));\n\n    /* Widget-to-option mapper */\n    mapper = new QDataWidgetMapper(this);\n    mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);\n    mapper->setOrientation(Qt::Vertical);\n\n    /* setup/change UI elements when proxy IPs are invalid/valid */\n    ui->proxyIp->setCheckValidator(new ProxyAddressValidator(parent));\n    ui->proxyIpTor->setCheckValidator(new ProxyAddressValidator(parent));\n    connect(ui->proxyIp, SIGNAL(validationDidChange(QValidatedLineEdit *)), this, SLOT(updateProxyValidationState()));\n    connect(ui->proxyIpTor, SIGNAL(validationDidChange(QValidatedLineEdit *)), this, SLOT(updateProxyValidationState()));\n    connect(ui->proxyPort, SIGNAL(textChanged(const QString&)), this, SLOT(updateProxyValidationState()));\n    connect(ui->proxyPortTor, SIGNAL(textChanged(const QString&)), this, SLOT(updateProxyValidationState()));\n}\n\nOptionsDialog::~OptionsDialog()\n{\n    delete ui;\n}\n\nvoid OptionsDialog::setModel(OptionsModel *_model)\n{\n    this->model = _model;\n\n    if(_model)\n    {\n        /* check if client restart is needed and show persistent message */\n        if (_model->isRestartRequired())\n            showRestartWarning(true);\n\n        QString strLabel = _model->getOverriddenByCommandLine();\n        if (strLabel.isEmpty())\n            strLabel = tr(\"none\");\n        ui->overriddenByCommandLineLabel->setText(strLabel);\n\n        mapper->setModel(_model);\n        setMapper();\n        mapper->toFirst();\n\n        updateDefaultProxyNets();\n    }\n\n    /* warn when one of the following settings changes by user action (placed here so init via mapper doesn't trigger them) */\n\n    /* Main */\n    connect(ui->databaseCache, SIGNAL(valueChanged(int)), this, SLOT(showRestartWarning()));\n    connect(ui->threadsScriptVerif, SIGNAL(valueChanged(int)), this, SLOT(showRestartWarning()));\n    /* Wallet */\n    connect(ui->spendZeroConfChange, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning()));\n    /* Network */\n    connect(ui->allowIncoming, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning()));\n    connect(ui->connectSocks, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning()));\n    connect(ui->connectSocksTor, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning()));\n    /* Display */\n    connect(ui->lang, SIGNAL(valueChanged()), this, SLOT(showRestartWarning()));\n    connect(ui->thirdPartyTxUrls, SIGNAL(textChanged(const QString &)), this, SLOT(showRestartWarning()));\n}\n\nvoid OptionsDialog::setMapper()\n{\n    /* Main */\n    mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);\n    mapper->addMapping(ui->threadsScriptVerif, OptionsModel::ThreadsScriptVerif);\n    mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache);\n\n    /* Wallet */\n    mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange);\n    mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);\n\n    /* Network */\n    mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);\n    mapper->addMapping(ui->allowIncoming, OptionsModel::Listen);\n\n    mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse);\n    mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP);\n    mapper->addMapping(ui->proxyPort, OptionsModel::ProxyPort);\n\n    mapper->addMapping(ui->connectSocksTor, OptionsModel::ProxyUseTor);\n    mapper->addMapping(ui->proxyIpTor, OptionsModel::ProxyIPTor);\n    mapper->addMapping(ui->proxyPortTor, OptionsModel::ProxyPortTor);\n\n    /* Window */\n#ifndef Q_OS_MAC\n    mapper->addMapping(ui->hideTrayIcon, OptionsModel::HideTrayIcon);\n    mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray);\n    mapper->addMapping(ui->minimizeOnClose, OptionsModel::MinimizeOnClose);\n#endif\n\n    /* Display */\n    mapper->addMapping(ui->lang, OptionsModel::Language);\n    mapper->addMapping(ui->unit, OptionsModel::DisplayUnit);\n    mapper->addMapping(ui->thirdPartyTxUrls, OptionsModel::ThirdPartyTxUrls);\n}\n\nvoid OptionsDialog::setOkButtonState(bool fState)\n{\n    ui->okButton->setEnabled(fState);\n}\n\nvoid OptionsDialog::on_resetButton_clicked()\n{\n    if(model)\n    {\n        // confirmation dialog\n        QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr(\"Confirm options reset\"),\n            tr(\"Client restart required to activate changes.\") + \"<br><br>\" + tr(\"Client will be shut down. Do you want to proceed?\"),\n            QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);\n\n        if(btnRetVal == QMessageBox::Cancel)\n            return;\n\n        /* reset all options and close GUI */\n        model->Reset();\n        QApplication::quit();\n    }\n}\n\nvoid OptionsDialog::on_openBitcoinConfButton_clicked()\n{\n    /* explain the purpose of the config file */\n    QMessageBox::information(this, tr(\"Configuration options\"),\n        tr(\"The configuration file is used to specify advanced user options which override GUI settings. \"\n           \"Additionally, any command-line options will override this configuration file.\"));\n\n    /* show an error if there was some problem opening the file */\n    if (!GUIUtil::openBitcoinConf())\n        QMessageBox::critical(this, tr(\"Error\"), tr(\"The configuration file could not be opened.\"));\n}\n\nvoid OptionsDialog::on_okButton_clicked()\n{\n    mapper->submit();\n    accept();\n    updateDefaultProxyNets();\n}\n\nvoid OptionsDialog::on_cancelButton_clicked()\n{\n    reject();\n}\n\nvoid OptionsDialog::on_hideTrayIcon_stateChanged(int fState)\n{\n    if(fState)\n    {\n        ui->minimizeToTray->setChecked(false);\n        ui->minimizeToTray->setEnabled(false);\n    }\n    else\n    {\n        ui->minimizeToTray->setEnabled(true);\n    }\n}\n\nvoid OptionsDialog::showRestartWarning(bool fPersistent)\n{\n    ui->statusLabel->setStyleSheet(\"QLabel { color: red; }\");\n\n    if(fPersistent)\n    {\n        ui->statusLabel->setText(tr(\"Client restart required to activate changes.\"));\n    }\n    else\n    {\n        ui->statusLabel->setText(tr(\"This change would require a client restart.\"));\n        // clear non-persistent status label after 10 seconds\n        // Todo: should perhaps be a class attribute, if we extend the use of statusLabel\n        QTimer::singleShot(10000, this, SLOT(clearStatusLabel()));\n    }\n}\n\nvoid OptionsDialog::clearStatusLabel()\n{\n    ui->statusLabel->clear();\n    if (model && model->isRestartRequired()) {\n        showRestartWarning(true);\n    }\n}\n\nvoid OptionsDialog::updateProxyValidationState()\n{\n    QValidatedLineEdit *pUiProxyIp = ui->proxyIp;\n    QValidatedLineEdit *otherProxyWidget = (pUiProxyIp == ui->proxyIpTor) ? ui->proxyIp : ui->proxyIpTor;\n    if (pUiProxyIp->isValid() && (!ui->proxyPort->isEnabled() || ui->proxyPort->text().toInt() > 0) && (!ui->proxyPortTor->isEnabled() || ui->proxyPortTor->text().toInt() > 0))\n    {\n        setOkButtonState(otherProxyWidget->isValid()); //only enable ok button if both proxys are valid\n        clearStatusLabel();\n    }\n    else\n    {\n        setOkButtonState(false);\n        ui->statusLabel->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel->setText(tr(\"The supplied proxy address is invalid.\"));\n    }\n}\n\nvoid OptionsDialog::updateDefaultProxyNets()\n{\n    proxyType proxy;\n    std::string strProxy;\n    QString strDefaultProxyGUI;\n\n    GetProxy(NET_IPV4, proxy);\n    strProxy = proxy.proxy.ToStringIP() + \":\" + proxy.proxy.ToStringPort();\n    strDefaultProxyGUI = ui->proxyIp->text() + \":\" + ui->proxyPort->text();\n    (strProxy == strDefaultProxyGUI.toStdString()) ? ui->proxyReachIPv4->setChecked(true) : ui->proxyReachIPv4->setChecked(false);\n\n    GetProxy(NET_IPV6, proxy);\n    strProxy = proxy.proxy.ToStringIP() + \":\" + proxy.proxy.ToStringPort();\n    strDefaultProxyGUI = ui->proxyIp->text() + \":\" + ui->proxyPort->text();\n    (strProxy == strDefaultProxyGUI.toStdString()) ? ui->proxyReachIPv6->setChecked(true) : ui->proxyReachIPv6->setChecked(false);\n\n    GetProxy(NET_TOR, proxy);\n    strProxy = proxy.proxy.ToStringIP() + \":\" + proxy.proxy.ToStringPort();\n    strDefaultProxyGUI = ui->proxyIp->text() + \":\" + ui->proxyPort->text();\n    (strProxy == strDefaultProxyGUI.toStdString()) ? ui->proxyReachTor->setChecked(true) : ui->proxyReachTor->setChecked(false);\n}\n\nProxyAddressValidator::ProxyAddressValidator(QObject *parent) :\nQValidator(parent)\n{\n}\n\nQValidator::State ProxyAddressValidator::validate(QString &input, int &pos) const\n{\n    Q_UNUSED(pos);\n    // Validate the proxy\n    CService serv(LookupNumeric(input.toStdString().c_str(), DEFAULT_GUI_PROXY_PORT));\n    proxyType addrProxy = proxyType(serv, true);\n    if (addrProxy.IsValid())\n        return QValidator::Acceptable;\n\n    return QValidator::Invalid;\n}\n"
  },
  {
    "path": "src/qt/optionsdialog.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_OPTIONSDIALOG_H\n#define BITCOIN_QT_OPTIONSDIALOG_H\n\n#include <QDialog>\n#include <QValidator>\n\nclass OptionsModel;\nclass QValidatedLineEdit;\n\nQT_BEGIN_NAMESPACE\nclass QDataWidgetMapper;\nQT_END_NAMESPACE\n\nnamespace Ui {\nclass OptionsDialog;\n}\n\n/** Proxy address widget validator, checks for a valid proxy address.\n */\nclass ProxyAddressValidator : public QValidator\n{\n    Q_OBJECT\n\npublic:\n    explicit ProxyAddressValidator(QObject *parent);\n\n    State validate(QString &input, int &pos) const;\n};\n\n/** Preferences dialog. */\nclass OptionsDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit OptionsDialog(QWidget *parent, bool enableWallet);\n    ~OptionsDialog();\n\n    void setModel(OptionsModel *model);\n    void setMapper();\n\nprivate Q_SLOTS:\n    /* set OK button state (enabled / disabled) */\n    void setOkButtonState(bool fState);\n    void on_resetButton_clicked();\n    void on_openBitcoinConfButton_clicked();\n    void on_okButton_clicked();\n    void on_cancelButton_clicked();\n    \n    void on_hideTrayIcon_stateChanged(int fState);\n\n    void showRestartWarning(bool fPersistent = false);\n    void clearStatusLabel();\n    void updateProxyValidationState();\n    /* query the networks, for which the default proxy is used */\n    void updateDefaultProxyNets();\n\nQ_SIGNALS:\n    void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort);\n\nprivate:\n    Ui::OptionsDialog *ui;\n    OptionsModel *model;\n    QDataWidgetMapper *mapper;\n};\n\n#endif // BITCOIN_QT_OPTIONSDIALOG_H\n"
  },
  {
    "path": "src/qt/optionsmodel.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <qt/optionsmodel.h>\n\n#include <qt/bitcoinunits.h>\n#include <qt/guiutil.h>\n\n#include <init.h>\n#include <validation.h> // For DEFAULT_SCRIPTCHECK_THREADS\n#include <net.h>\n#include <netbase.h>\n#include <txdb.h> // for -dbcache defaults\n#include <qt/intro.h>\n\n#ifdef ENABLE_WALLET\n#include <wallet/wallet.h>\n#include <wallet/walletdb.h>\n#endif\n\n#include <QNetworkProxy>\n#include <QSettings>\n#include <QStringList>\n\nconst char *DEFAULT_GUI_PROXY_HOST = \"127.0.0.1\";\n\nstatic const QString GetDefaultProxyAddress();\n\nOptionsModel::OptionsModel(QObject *parent, bool resetSettings) :\n    QAbstractListModel(parent)\n{\n    Init(resetSettings);\n}\n\nvoid OptionsModel::addOverriddenOption(const std::string &option)\n{\n    strOverriddenByCommandLine += QString::fromStdString(option) + \"=\" + QString::fromStdString(gArgs.GetArg(option, \"\")) + \" \";\n}\n\n// Writes all missing QSettings with their default values\nvoid OptionsModel::Init(bool resetSettings)\n{\n    if (resetSettings)\n        Reset();\n\n    checkAndMigrate();\n\n    QSettings settings;\n\n    // Ensure restart flag is unset on client startup\n    setRestartRequired(false);\n\n    // These are Qt-only settings:\n\n    // Window\n    if (!settings.contains(\"fHideTrayIcon\"))\n        settings.setValue(\"fHideTrayIcon\", false);\n    fHideTrayIcon = settings.value(\"fHideTrayIcon\").toBool();\n    Q_EMIT hideTrayIconChanged(fHideTrayIcon);\n    \n    if (!settings.contains(\"fMinimizeToTray\"))\n        settings.setValue(\"fMinimizeToTray\", false);\n    fMinimizeToTray = settings.value(\"fMinimizeToTray\").toBool() && !fHideTrayIcon;\n\n    if (!settings.contains(\"fMinimizeOnClose\"))\n        settings.setValue(\"fMinimizeOnClose\", false);\n    fMinimizeOnClose = settings.value(\"fMinimizeOnClose\").toBool();\n\n    // Display\n    if (!settings.contains(\"nDisplayUnit\"))\n        settings.setValue(\"nDisplayUnit\", BitcoinUnits::BTC);\n    nDisplayUnit = settings.value(\"nDisplayUnit\").toInt();\n\n    if (!settings.contains(\"strThirdPartyTxUrls\"))\n        settings.setValue(\"strThirdPartyTxUrls\", \"\");\n    strThirdPartyTxUrls = settings.value(\"strThirdPartyTxUrls\", \"\").toString();\n\n    if (!settings.contains(\"fCoinControlFeatures\"))\n        settings.setValue(\"fCoinControlFeatures\", false);\n    fCoinControlFeatures = settings.value(\"fCoinControlFeatures\", false).toBool();\n\n    // These are shared with the core or have a command-line parameter\n    // and we want command-line parameters to overwrite the GUI settings.\n    //\n    // If setting doesn't exist create it with defaults.\n    //\n    // If gArgs.SoftSetArg() or gArgs.SoftSetBoolArg() return false we were overridden\n    // by command-line and show this in the UI.\n\n    // Main\n    if (!settings.contains(\"nDatabaseCache\"))\n        settings.setValue(\"nDatabaseCache\", (qint64)nDefaultDbCache);\n    if (!gArgs.SoftSetArg(\"-dbcache\", settings.value(\"nDatabaseCache\").toString().toStdString()))\n        addOverriddenOption(\"-dbcache\");\n\n    if (!settings.contains(\"nThreadsScriptVerif\"))\n        settings.setValue(\"nThreadsScriptVerif\", DEFAULT_SCRIPTCHECK_THREADS);\n    if (!gArgs.SoftSetArg(\"-par\", settings.value(\"nThreadsScriptVerif\").toString().toStdString()))\n        addOverriddenOption(\"-par\");\n\n    if (!settings.contains(\"strDataDir\"))\n        settings.setValue(\"strDataDir\", Intro::getDefaultDataDirectory());\n\n    // Wallet\n#ifdef ENABLE_WALLET\n    if (!settings.contains(\"bSpendZeroConfChange\"))\n        settings.setValue(\"bSpendZeroConfChange\", true);\n    if (!gArgs.SoftSetBoolArg(\"-spendzeroconfchange\", settings.value(\"bSpendZeroConfChange\").toBool()))\n        addOverriddenOption(\"-spendzeroconfchange\");\n#endif\n\n    // Network\n    if (!settings.contains(\"fUseUPnP\"))\n        settings.setValue(\"fUseUPnP\", DEFAULT_UPNP);\n    if (!gArgs.SoftSetBoolArg(\"-upnp\", settings.value(\"fUseUPnP\").toBool()))\n        addOverriddenOption(\"-upnp\");\n\n    if (!settings.contains(\"fListen\"))\n        settings.setValue(\"fListen\", DEFAULT_LISTEN);\n    if (!gArgs.SoftSetBoolArg(\"-listen\", settings.value(\"fListen\").toBool()))\n        addOverriddenOption(\"-listen\");\n\n    if (!settings.contains(\"fUseProxy\"))\n        settings.setValue(\"fUseProxy\", false);\n    if (!settings.contains(\"addrProxy\"))\n        settings.setValue(\"addrProxy\", GetDefaultProxyAddress());\n    // Only try to set -proxy, if user has enabled fUseProxy\n    if (settings.value(\"fUseProxy\").toBool() && !gArgs.SoftSetArg(\"-proxy\", settings.value(\"addrProxy\").toString().toStdString()))\n        addOverriddenOption(\"-proxy\");\n    else if(!settings.value(\"fUseProxy\").toBool() && !gArgs.GetArg(\"-proxy\", \"\").empty())\n        addOverriddenOption(\"-proxy\");\n\n    if (!settings.contains(\"fUseSeparateProxyTor\"))\n        settings.setValue(\"fUseSeparateProxyTor\", false);\n    if (!settings.contains(\"addrSeparateProxyTor\"))\n        settings.setValue(\"addrSeparateProxyTor\", GetDefaultProxyAddress());\n    // Only try to set -onion, if user has enabled fUseSeparateProxyTor\n    if (settings.value(\"fUseSeparateProxyTor\").toBool() && !gArgs.SoftSetArg(\"-onion\", settings.value(\"addrSeparateProxyTor\").toString().toStdString()))\n        addOverriddenOption(\"-onion\");\n    else if(!settings.value(\"fUseSeparateProxyTor\").toBool() && !gArgs.GetArg(\"-onion\", \"\").empty())\n        addOverriddenOption(\"-onion\");\n\n    // Display\n    if (!settings.contains(\"language\"))\n        settings.setValue(\"language\", \"\");\n    if (!gArgs.SoftSetArg(\"-lang\", settings.value(\"language\").toString().toStdString()))\n        addOverriddenOption(\"-lang\");\n\n    language = settings.value(\"language\").toString();\n}\n\n/** Helper function to copy contents from one QSettings to another.\n * By using allKeys this also covers nested settings in a hierarchy.\n */\nstatic void CopySettings(QSettings& dst, const QSettings& src)\n{\n    for (const QString& key : src.allKeys()) {\n        dst.setValue(key, src.value(key));\n    }\n}\n\n/** Back up a QSettings to an ini-formatted file. */\nstatic void BackupSettings(const fs::path& filename, const QSettings& src)\n{\n    qWarning() << \"Backing up GUI settings to\" << GUIUtil::boostPathToQString(filename);\n    QSettings dst(GUIUtil::boostPathToQString(filename), QSettings::IniFormat);\n    dst.clear();\n    CopySettings(dst, src);\n}\n\nvoid OptionsModel::Reset()\n{\n    QSettings settings;\n\n    // Backup old settings to chain-specific datadir for troubleshooting\n    BackupSettings(GetDataDir(true) / \"guisettings.ini.bak\", settings);\n\n    // Save the strDataDir setting\n    QString dataDir = Intro::getDefaultDataDirectory();\n    dataDir = settings.value(\"strDataDir\", dataDir).toString();\n\n    // Remove all entries from our QSettings object\n    settings.clear();\n\n    // Set strDataDir\n    settings.setValue(\"strDataDir\", dataDir);\n\n    // Set that this was reset\n    settings.setValue(\"fReset\", true);\n\n    // default setting for OptionsModel::StartAtStartup - disabled\n    if (GUIUtil::GetStartOnSystemStartup())\n        GUIUtil::SetStartOnSystemStartup(false);\n}\n\nint OptionsModel::rowCount(const QModelIndex & parent) const\n{\n    return OptionIDRowCount;\n}\n\nstruct ProxySetting {\n    bool is_set;\n    QString ip;\n    QString port;\n};\n\nstatic ProxySetting GetProxySetting(QSettings &settings, const QString &name)\n{\n    static const ProxySetting default_val = {false, DEFAULT_GUI_PROXY_HOST, QString(\"%1\").arg(DEFAULT_GUI_PROXY_PORT)};\n    // Handle the case that the setting is not set at all\n    if (!settings.contains(name)) {\n        return default_val;\n    }\n    // contains IP at index 0 and port at index 1\n    QStringList ip_port = settings.value(name).toString().split(\":\", QString::SkipEmptyParts);\n    if (ip_port.size() == 2) {\n        return {true, ip_port.at(0), ip_port.at(1)};\n    } else { // Invalid: return default\n        return default_val;\n    }\n}\n\nstatic void SetProxySetting(QSettings &settings, const QString &name, const ProxySetting &ip_port)\n{\n    settings.setValue(name, ip_port.ip + \":\" + ip_port.port);\n}\n\nstatic const QString GetDefaultProxyAddress()\n{\n    return QString(\"%1:%2\").arg(DEFAULT_GUI_PROXY_HOST).arg(DEFAULT_GUI_PROXY_PORT);\n}\n\n// read QSettings values and return them\nQVariant OptionsModel::data(const QModelIndex & index, int role) const\n{\n    if(role == Qt::EditRole)\n    {\n        QSettings settings;\n        switch(index.row())\n        {\n        case StartAtStartup:\n            return GUIUtil::GetStartOnSystemStartup();\n        case HideTrayIcon:\n            return fHideTrayIcon;\n        case MinimizeToTray:\n            return fMinimizeToTray;\n        case MapPortUPnP:\n#ifdef USE_UPNP\n            return settings.value(\"fUseUPnP\");\n#else\n            return false;\n#endif\n        case MinimizeOnClose:\n            return fMinimizeOnClose;\n\n        // default proxy\n        case ProxyUse:\n            return settings.value(\"fUseProxy\", false);\n        case ProxyIP:\n            return GetProxySetting(settings, \"addrProxy\").ip;\n        case ProxyPort:\n            return GetProxySetting(settings, \"addrProxy\").port;\n\n        // separate Tor proxy\n        case ProxyUseTor:\n            return settings.value(\"fUseSeparateProxyTor\", false);\n        case ProxyIPTor:\n            return GetProxySetting(settings, \"addrSeparateProxyTor\").ip;\n        case ProxyPortTor:\n            return GetProxySetting(settings, \"addrSeparateProxyTor\").port;\n\n#ifdef ENABLE_WALLET\n        case SpendZeroConfChange:\n            return settings.value(\"bSpendZeroConfChange\");\n#endif\n        case DisplayUnit:\n            return nDisplayUnit;\n        case ThirdPartyTxUrls:\n            return strThirdPartyTxUrls;\n        case Language:\n            return settings.value(\"language\");\n        case CoinControlFeatures:\n            return fCoinControlFeatures;\n        case DatabaseCache:\n            return settings.value(\"nDatabaseCache\");\n        case ThreadsScriptVerif:\n            return settings.value(\"nThreadsScriptVerif\");\n        case Listen:\n            return settings.value(\"fListen\");\n        default:\n            return QVariant();\n        }\n    }\n    return QVariant();\n}\n\n// write QSettings values\nbool OptionsModel::setData(const QModelIndex & index, const QVariant & value, int role)\n{\n    bool successful = true; /* set to false on parse error */\n    if(role == Qt::EditRole)\n    {\n        QSettings settings;\n        switch(index.row())\n        {\n        case StartAtStartup:\n            successful = GUIUtil::SetStartOnSystemStartup(value.toBool());\n            break;\n        case HideTrayIcon:\n            fHideTrayIcon = value.toBool();\n            settings.setValue(\"fHideTrayIcon\", fHideTrayIcon);\n    \t\tQ_EMIT hideTrayIconChanged(fHideTrayIcon);\n            break;\n        case MinimizeToTray:\n            fMinimizeToTray = value.toBool();\n            settings.setValue(\"fMinimizeToTray\", fMinimizeToTray);\n            break;\n        case MapPortUPnP: // core option - can be changed on-the-fly\n            settings.setValue(\"fUseUPnP\", value.toBool());\n            MapPort(value.toBool());\n            break;\n        case MinimizeOnClose:\n            fMinimizeOnClose = value.toBool();\n            settings.setValue(\"fMinimizeOnClose\", fMinimizeOnClose);\n            break;\n\n        // default proxy\n        case ProxyUse:\n            if (settings.value(\"fUseProxy\") != value) {\n                settings.setValue(\"fUseProxy\", value.toBool());\n                setRestartRequired(true);\n            }\n            break;\n        case ProxyIP: {\n            auto ip_port = GetProxySetting(settings, \"addrProxy\");\n            if (!ip_port.is_set || ip_port.ip != value.toString()) {\n                ip_port.ip = value.toString();\n                SetProxySetting(settings, \"addrProxy\", ip_port);\n                setRestartRequired(true);\n            }\n        }\n        break;\n        case ProxyPort: {\n            auto ip_port = GetProxySetting(settings, \"addrProxy\");\n            if (!ip_port.is_set || ip_port.port != value.toString()) {\n                ip_port.port = value.toString();\n                SetProxySetting(settings, \"addrProxy\", ip_port);\n                setRestartRequired(true);\n            }\n        }\n        break;\n\n        // separate Tor proxy\n        case ProxyUseTor:\n            if (settings.value(\"fUseSeparateProxyTor\") != value) {\n                settings.setValue(\"fUseSeparateProxyTor\", value.toBool());\n                setRestartRequired(true);\n            }\n            break;\n        case ProxyIPTor: {\n            auto ip_port = GetProxySetting(settings, \"addrSeparateProxyTor\");\n            if (!ip_port.is_set || ip_port.ip != value.toString()) {\n                ip_port.ip = value.toString();\n                SetProxySetting(settings, \"addrSeparateProxyTor\", ip_port);\n                setRestartRequired(true);\n            }\n        }\n        break;\n        case ProxyPortTor: {\n            auto ip_port = GetProxySetting(settings, \"addrSeparateProxyTor\");\n            if (!ip_port.is_set || ip_port.port != value.toString()) {\n                ip_port.port = value.toString();\n                SetProxySetting(settings, \"addrSeparateProxyTor\", ip_port);\n                setRestartRequired(true);\n            }\n        }\n        break;\n\n#ifdef ENABLE_WALLET\n        case SpendZeroConfChange:\n            if (settings.value(\"bSpendZeroConfChange\") != value) {\n                settings.setValue(\"bSpendZeroConfChange\", value);\n                setRestartRequired(true);\n            }\n            break;\n#endif\n        case DisplayUnit:\n            setDisplayUnit(value);\n            break;\n        case ThirdPartyTxUrls:\n            if (strThirdPartyTxUrls != value.toString()) {\n                strThirdPartyTxUrls = value.toString();\n                settings.setValue(\"strThirdPartyTxUrls\", strThirdPartyTxUrls);\n                setRestartRequired(true);\n            }\n            break;\n        case Language:\n            if (settings.value(\"language\") != value) {\n                settings.setValue(\"language\", value);\n                setRestartRequired(true);\n            }\n            break;\n        case CoinControlFeatures:\n            fCoinControlFeatures = value.toBool();\n            settings.setValue(\"fCoinControlFeatures\", fCoinControlFeatures);\n            Q_EMIT coinControlFeaturesChanged(fCoinControlFeatures);\n            break;\n        case DatabaseCache:\n            if (settings.value(\"nDatabaseCache\") != value) {\n                settings.setValue(\"nDatabaseCache\", value);\n                setRestartRequired(true);\n            }\n            break;\n        case ThreadsScriptVerif:\n            if (settings.value(\"nThreadsScriptVerif\") != value) {\n                settings.setValue(\"nThreadsScriptVerif\", value);\n                setRestartRequired(true);\n            }\n            break;\n        case Listen:\n            if (settings.value(\"fListen\") != value) {\n                settings.setValue(\"fListen\", value);\n                setRestartRequired(true);\n            }\n            break;\n        default:\n            break;\n        }\n    }\n\n    Q_EMIT dataChanged(index, index);\n\n    return successful;\n}\n\n/** Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal */\nvoid OptionsModel::setDisplayUnit(const QVariant &value)\n{\n    if (!value.isNull())\n    {\n        QSettings settings;\n        nDisplayUnit = value.toInt();\n        settings.setValue(\"nDisplayUnit\", nDisplayUnit);\n        Q_EMIT displayUnitChanged(nDisplayUnit);\n    }\n}\n\nbool OptionsModel::getProxySettings(QNetworkProxy& proxy) const\n{\n    // Directly query current base proxy, because\n    // GUI settings can be overridden with -proxy.\n    proxyType curProxy;\n    if (GetProxy(NET_IPV4, curProxy)) {\n        proxy.setType(QNetworkProxy::Socks5Proxy);\n        proxy.setHostName(QString::fromStdString(curProxy.proxy.ToStringIP()));\n        proxy.setPort(curProxy.proxy.GetPort());\n\n        return true;\n    }\n    else\n        proxy.setType(QNetworkProxy::NoProxy);\n\n    return false;\n}\n\nvoid OptionsModel::setRestartRequired(bool fRequired)\n{\n    QSettings settings;\n    return settings.setValue(\"fRestartRequired\", fRequired);\n}\n\nbool OptionsModel::isRestartRequired() const\n{\n    QSettings settings;\n    return settings.value(\"fRestartRequired\", false).toBool();\n}\n\nvoid OptionsModel::checkAndMigrate()\n{\n    // Migration of default values\n    // Check if the QSettings container was already loaded with this client version\n    QSettings settings;\n    static const char strSettingsVersionKey[] = \"nSettingsVersion\";\n    int settingsVersion = settings.contains(strSettingsVersionKey) ? settings.value(strSettingsVersionKey).toInt() : 0;\n    if (settingsVersion < CLIENT_VERSION)\n    {\n        // -dbcache was bumped from 100 to 300 in 0.13\n        // see https://github.com/bitcoin/bitcoin/pull/8273\n        // force people to upgrade to the new value if they are using 100MB\n        if (settingsVersion < 130000 && settings.contains(\"nDatabaseCache\") && settings.value(\"nDatabaseCache\").toLongLong() == 100)\n            settings.setValue(\"nDatabaseCache\", (qint64)nDefaultDbCache);\n\n        settings.setValue(strSettingsVersionKey, CLIENT_VERSION);\n    }\n\n    // Overwrite the 'addrProxy' setting in case it has been set to an illegal\n    // default value (see issue #12623; PR #12650).\n    if (settings.contains(\"addrProxy\") && settings.value(\"addrProxy\").toString().endsWith(\"%2\")) {\n        settings.setValue(\"addrProxy\", GetDefaultProxyAddress());\n    }\n\n    // Overwrite the 'addrSeparateProxyTor' setting in case it has been set to an illegal\n    // default value (see issue #12623; PR #12650).\n    if (settings.contains(\"addrSeparateProxyTor\") && settings.value(\"addrSeparateProxyTor\").toString().endsWith(\"%2\")) {\n        settings.setValue(\"addrSeparateProxyTor\", GetDefaultProxyAddress());\n    }\n}\n"
  },
  {
    "path": "src/qt/optionsmodel.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_OPTIONSMODEL_H\n#define BITCOIN_QT_OPTIONSMODEL_H\n\n#include <amount.h>\n\n#include <QAbstractListModel>\n\nQT_BEGIN_NAMESPACE\nclass QNetworkProxy;\nQT_END_NAMESPACE\n\nextern const char *DEFAULT_GUI_PROXY_HOST;\nstatic constexpr unsigned short DEFAULT_GUI_PROXY_PORT = 9050;\n\n/** Interface from Qt to configuration data structure for Bitcoin client.\n   To Qt, the options are presented as a list with the different options\n   laid out vertically.\n   This can be changed to a tree once the settings become sufficiently\n   complex.\n */\nclass OptionsModel : public QAbstractListModel\n{\n    Q_OBJECT\n\npublic:\n    explicit OptionsModel(QObject *parent = 0, bool resetSettings = false);\n\n    enum OptionID {\n        StartAtStartup,         // bool\n        HideTrayIcon,           // bool\n        MinimizeToTray,         // bool\n        MapPortUPnP,            // bool\n        MinimizeOnClose,        // bool\n        ProxyUse,               // bool\n        ProxyIP,                // QString\n        ProxyPort,              // int\n        ProxyUseTor,            // bool\n        ProxyIPTor,             // QString\n        ProxyPortTor,           // int\n        DisplayUnit,            // BitcoinUnits::Unit\n        ThirdPartyTxUrls,       // QString\n        Language,               // QString\n        CoinControlFeatures,    // bool\n        ThreadsScriptVerif,     // int\n        DatabaseCache,          // int\n        SpendZeroConfChange,    // bool\n        Listen,                 // bool\n        OptionIDRowCount,\n    };\n\n    void Init(bool resetSettings = false);\n    void Reset();\n\n    int rowCount(const QModelIndex & parent = QModelIndex()) const;\n    QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;\n    bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);\n    /** Updates current unit in memory, settings and emits displayUnitChanged(newUnit) signal */\n    void setDisplayUnit(const QVariant &value);\n\n    /* Explicit getters */\n    bool getHideTrayIcon() const { return fHideTrayIcon; }\n    bool getMinimizeToTray() const { return fMinimizeToTray; }\n    bool getMinimizeOnClose() const { return fMinimizeOnClose; }\n    int getDisplayUnit() const { return nDisplayUnit; }\n    QString getThirdPartyTxUrls() const { return strThirdPartyTxUrls; }\n    bool getProxySettings(QNetworkProxy& proxy) const;\n    bool getCoinControlFeatures() const { return fCoinControlFeatures; }\n    const QString& getOverriddenByCommandLine() { return strOverriddenByCommandLine; }\n\n    /* Restart flag helper */\n    void setRestartRequired(bool fRequired);\n    bool isRestartRequired() const;\n\nprivate:\n    /* Qt-only settings */\n    bool fHideTrayIcon;\n    bool fMinimizeToTray;\n    bool fMinimizeOnClose;\n    QString language;\n    int nDisplayUnit;\n    QString strThirdPartyTxUrls;\n    bool fCoinControlFeatures;\n    /* settings that were overridden by command-line */\n    QString strOverriddenByCommandLine;\n\n    // Add option to list of GUI options overridden through command line/config file\n    void addOverriddenOption(const std::string &option);\n\n    // Check settings version and upgrade default values if required\n    void checkAndMigrate();\nQ_SIGNALS:\n    void displayUnitChanged(int unit);\n    void coinControlFeaturesChanged(bool);\n    void hideTrayIconChanged(bool);\n};\n\n#endif // BITCOIN_QT_OPTIONSMODEL_H\n"
  },
  {
    "path": "src/qt/overviewpage.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/overviewpage.h>\n#include <qt/forms/ui_overviewpage.h>\n\n#include <qt/bitcoinunits.h>\n#include <qt/clientmodel.h>\n#include <qt/guiconstants.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n#include <qt/platformstyle.h>\n#include <qt/transactionfilterproxy.h>\n#include <qt/transactiontablemodel.h>\n#include <qt/walletmodel.h>\n\n#include <QAbstractItemDelegate>\n#include <QPainter>\n\n#define DECORATION_SIZE 54\n#define NUM_ITEMS 5\n\nclass TxViewDelegate : public QAbstractItemDelegate\n{\n    Q_OBJECT\npublic:\n    explicit TxViewDelegate(const PlatformStyle *_platformStyle, QObject *parent=nullptr):\n        QAbstractItemDelegate(parent), unit(BitcoinUnits::BTC),\n        platformStyle(_platformStyle)\n    {\n\n    }\n\n    inline void paint(QPainter *painter, const QStyleOptionViewItem &option,\n                      const QModelIndex &index ) const\n    {\n        painter->save();\n\n        QIcon icon = qvariant_cast<QIcon>(index.data(TransactionTableModel::RawDecorationRole));\n        QRect mainRect = option.rect;\n        QRect decorationRect(mainRect.topLeft(), QSize(DECORATION_SIZE, DECORATION_SIZE));\n        int xspace = DECORATION_SIZE + 8;\n        int ypad = 6;\n        int halfheight = (mainRect.height() - 2*ypad)/2;\n        QRect amountRect(mainRect.left() + xspace, mainRect.top()+ypad, mainRect.width() - xspace, halfheight);\n        QRect addressRect(mainRect.left() + xspace, mainRect.top()+ypad+halfheight, mainRect.width() - xspace, halfheight);\n        icon = platformStyle->SingleColorIcon(icon);\n        icon.paint(painter, decorationRect);\n\n        QDateTime date = index.data(TransactionTableModel::DateRole).toDateTime();\n        QString address = index.data(Qt::DisplayRole).toString();\n        qint64 amount = index.data(TransactionTableModel::AmountRole).toLongLong();\n        bool confirmed = index.data(TransactionTableModel::ConfirmedRole).toBool();\n        QVariant value = index.data(Qt::ForegroundRole);\n        QColor foreground = option.palette.color(QPalette::Text);\n        if(value.canConvert<QBrush>())\n        {\n            QBrush brush = qvariant_cast<QBrush>(value);\n            foreground = brush.color();\n        }\n\n        painter->setPen(foreground);\n        QRect boundingRect;\n        painter->drawText(addressRect, Qt::AlignLeft|Qt::AlignVCenter, address, &boundingRect);\n\n        if (index.data(TransactionTableModel::WatchonlyRole).toBool())\n        {\n            QIcon iconWatchonly = qvariant_cast<QIcon>(index.data(TransactionTableModel::WatchonlyDecorationRole));\n            QRect watchonlyRect(boundingRect.right() + 5, mainRect.top()+ypad+halfheight, 16, halfheight);\n            iconWatchonly.paint(painter, watchonlyRect);\n        }\n\n        if(amount < 0)\n        {\n            foreground = COLOR_NEGATIVE;\n        }\n        else if(!confirmed)\n        {\n            foreground = COLOR_UNCONFIRMED;\n        }\n        else\n        {\n            foreground = option.palette.color(QPalette::Text);\n        }\n        painter->setPen(foreground);\n        QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true, BitcoinUnits::separatorAlways);\n        if(!confirmed)\n        {\n            amountText = QString(\"[\") + amountText + QString(\"]\");\n        }\n        painter->drawText(amountRect, Qt::AlignRight|Qt::AlignVCenter, amountText);\n\n        painter->setPen(option.palette.color(QPalette::Text));\n        painter->drawText(amountRect, Qt::AlignLeft|Qt::AlignVCenter, GUIUtil::dateTimeStr(date));\n\n        painter->restore();\n    }\n\n    inline QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const\n    {\n        return QSize(DECORATION_SIZE, DECORATION_SIZE);\n    }\n\n    int unit;\n    const PlatformStyle *platformStyle;\n\n};\n#include <qt/overviewpage.moc>\n\nOverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent) :\n    QWidget(parent),\n    ui(new Ui::OverviewPage),\n    clientModel(0),\n    walletModel(0),\n    currentBalance(-1),\n    currentUnconfirmedBalance(-1),\n    currentImmatureBalance(-1),\n    currentWatchOnlyBalance(-1),\n    currentWatchUnconfBalance(-1),\n    currentWatchImmatureBalance(-1),\n    txdelegate(new TxViewDelegate(platformStyle, this))\n{\n    ui->setupUi(this);\n\n    // use a SingleColorIcon for the \"out of sync warning\" icon\n    QIcon icon = platformStyle->SingleColorIcon(\":/icons/warning\");\n    icon.addPixmap(icon.pixmap(QSize(64,64), QIcon::Normal), QIcon::Disabled); // also set the disabled icon because we are using a disabled QPushButton to work around missing HiDPI support of QLabel (https://bugreports.qt.io/browse/QTBUG-42503)\n    ui->labelTransactionsStatus->setIcon(icon);\n    ui->labelWalletStatus->setIcon(icon);\n\n    // Recent transactions\n    ui->listTransactions->setItemDelegate(txdelegate);\n    ui->listTransactions->setIconSize(QSize(DECORATION_SIZE, DECORATION_SIZE));\n    ui->listTransactions->setMinimumHeight(NUM_ITEMS * (DECORATION_SIZE + 2));\n    ui->listTransactions->setAttribute(Qt::WA_MacShowFocusRect, false);\n\n    connect(ui->listTransactions, SIGNAL(clicked(QModelIndex)), this, SLOT(handleTransactionClicked(QModelIndex)));\n\n    // start with displaying the \"out of sync\" warnings\n    showOutOfSyncWarning(true);\n    connect(ui->labelWalletStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));\n    connect(ui->labelTransactionsStatus, SIGNAL(clicked()), this, SLOT(handleOutOfSyncWarningClicks()));\n}\n\nvoid OverviewPage::handleTransactionClicked(const QModelIndex &index)\n{\n    if(filter)\n        Q_EMIT transactionClicked(filter->mapToSource(index));\n}\n\nvoid OverviewPage::handleOutOfSyncWarningClicks()\n{\n    Q_EMIT outOfSyncWarningClicked();\n}\n\nOverviewPage::~OverviewPage()\n{\n    delete ui;\n}\n\nvoid OverviewPage::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance, const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance)\n{\n    int unit = walletModel->getOptionsModel()->getDisplayUnit();\n    currentBalance = balance;\n    currentUnconfirmedBalance = unconfirmedBalance;\n    currentImmatureBalance = immatureBalance;\n    currentWatchOnlyBalance = watchOnlyBalance;\n    currentWatchUnconfBalance = watchUnconfBalance;\n    currentWatchImmatureBalance = watchImmatureBalance;\n    ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::separatorAlways));\n    ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance, false, BitcoinUnits::separatorAlways));\n    ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance, false, BitcoinUnits::separatorAlways));\n    ui->labelTotal->setText(BitcoinUnits::formatWithUnit(unit, balance + unconfirmedBalance + immatureBalance, false, BitcoinUnits::separatorAlways));\n    ui->labelWatchAvailable->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance, false, BitcoinUnits::separatorAlways));\n    ui->labelWatchPending->setText(BitcoinUnits::formatWithUnit(unit, watchUnconfBalance, false, BitcoinUnits::separatorAlways));\n    ui->labelWatchImmature->setText(BitcoinUnits::formatWithUnit(unit, watchImmatureBalance, false, BitcoinUnits::separatorAlways));\n    ui->labelWatchTotal->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance + watchUnconfBalance + watchImmatureBalance, false, BitcoinUnits::separatorAlways));\n\n    // only show immature (newly mined) balance if it's non-zero, so as not to complicate things\n    // for the non-mining users\n    bool showImmature = immatureBalance != 0;\n    bool showWatchOnlyImmature = watchImmatureBalance != 0;\n\n    // for symmetry reasons also show immature label when the watch-only one is shown\n    ui->labelImmature->setVisible(showImmature || showWatchOnlyImmature);\n    ui->labelImmatureText->setVisible(showImmature || showWatchOnlyImmature);\n    ui->labelWatchImmature->setVisible(showWatchOnlyImmature); // show watch-only immature balance\n}\n\n// show/hide watch-only labels\nvoid OverviewPage::updateWatchOnlyLabels(bool showWatchOnly)\n{\n    ui->labelSpendable->setVisible(showWatchOnly);      // show spendable label (only when watch-only is active)\n    ui->labelWatchonly->setVisible(showWatchOnly);      // show watch-only label\n    ui->lineWatchBalance->setVisible(showWatchOnly);    // show watch-only balance separator line\n    ui->labelWatchAvailable->setVisible(showWatchOnly); // show watch-only available balance\n    ui->labelWatchPending->setVisible(showWatchOnly);   // show watch-only pending balance\n    ui->labelWatchTotal->setVisible(showWatchOnly);     // show watch-only total balance\n\n    if (!showWatchOnly)\n        ui->labelWatchImmature->hide();\n}\n\nvoid OverviewPage::setClientModel(ClientModel *model)\n{\n    this->clientModel = model;\n    if(model)\n    {\n        // Show warning if this is a prerelease version\n        connect(model, SIGNAL(alertsChanged(QString)), this, SLOT(updateAlerts(QString)));\n        updateAlerts(model->getStatusBarWarnings());\n    }\n}\n\nvoid OverviewPage::setWalletModel(WalletModel *model)\n{\n    this->walletModel = model;\n    if(model && model->getOptionsModel())\n    {\n        // Set up transaction list\n        filter.reset(new TransactionFilterProxy());\n        filter->setSourceModel(model->getTransactionTableModel());\n        filter->setLimit(NUM_ITEMS);\n        filter->setDynamicSortFilter(true);\n        filter->setSortRole(Qt::EditRole);\n        filter->setShowInactive(false);\n        filter->sort(TransactionTableModel::Date, Qt::DescendingOrder);\n\n        ui->listTransactions->setModel(filter.get());\n        ui->listTransactions->setModelColumn(TransactionTableModel::ToAddress);\n\n        // Keep up to date with wallet\n        setBalance(model->getBalance(), model->getUnconfirmedBalance(), model->getImmatureBalance(),\n                   model->getWatchBalance(), model->getWatchUnconfirmedBalance(), model->getWatchImmatureBalance());\n        connect(model, SIGNAL(balanceChanged(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)), this, SLOT(setBalance(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)));\n\n        connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));\n\n        updateWatchOnlyLabels(model->haveWatchOnly());\n        connect(model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyLabels(bool)));\n    }\n\n    // update the display unit, to not use the default (\"BTC\")\n    updateDisplayUnit();\n}\n\nvoid OverviewPage::updateDisplayUnit()\n{\n    if(walletModel && walletModel->getOptionsModel())\n    {\n        if(currentBalance != -1)\n            setBalance(currentBalance, currentUnconfirmedBalance, currentImmatureBalance,\n                       currentWatchOnlyBalance, currentWatchUnconfBalance, currentWatchImmatureBalance);\n\n        // Update txdelegate->unit with the current unit\n        txdelegate->unit = walletModel->getOptionsModel()->getDisplayUnit();\n\n        ui->listTransactions->update();\n    }\n}\n\nvoid OverviewPage::updateAlerts(const QString &warnings)\n{\n    this->ui->labelAlerts->setVisible(!warnings.isEmpty());\n    this->ui->labelAlerts->setText(warnings);\n}\n\nvoid OverviewPage::showOutOfSyncWarning(bool fShow)\n{\n    ui->labelWalletStatus->setVisible(fShow);\n    ui->labelTransactionsStatus->setVisible(fShow);\n}\n"
  },
  {
    "path": "src/qt/overviewpage.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_OVERVIEWPAGE_H\n#define BITCOIN_QT_OVERVIEWPAGE_H\n\n#include <amount.h>\n\n#include <QWidget>\n#include <memory>\n\nclass ClientModel;\nclass TransactionFilterProxy;\nclass TxViewDelegate;\nclass PlatformStyle;\nclass WalletModel;\n\nnamespace Ui {\n    class OverviewPage;\n}\n\nQT_BEGIN_NAMESPACE\nclass QModelIndex;\nQT_END_NAMESPACE\n\n/** Overview (\"home\") page widget */\nclass OverviewPage : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    explicit OverviewPage(const PlatformStyle *platformStyle, QWidget *parent = 0);\n    ~OverviewPage();\n\n    void setClientModel(ClientModel *clientModel);\n    void setWalletModel(WalletModel *walletModel);\n    void showOutOfSyncWarning(bool fShow);\n\npublic Q_SLOTS:\n    void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,\n                    const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);\n\nQ_SIGNALS:\n    void transactionClicked(const QModelIndex &index);\n    void outOfSyncWarningClicked();\n\nprivate:\n    Ui::OverviewPage *ui;\n    ClientModel *clientModel;\n    WalletModel *walletModel;\n    CAmount currentBalance;\n    CAmount currentUnconfirmedBalance;\n    CAmount currentImmatureBalance;\n    CAmount currentWatchOnlyBalance;\n    CAmount currentWatchUnconfBalance;\n    CAmount currentWatchImmatureBalance;\n\n    TxViewDelegate *txdelegate;\n    std::unique_ptr<TransactionFilterProxy> filter;\n\nprivate Q_SLOTS:\n    void updateDisplayUnit();\n    void handleTransactionClicked(const QModelIndex &index);\n    void updateAlerts(const QString &warnings);\n    void updateWatchOnlyLabels(bool showWatchOnly);\n    void handleOutOfSyncWarningClicks();\n};\n\n#endif // BITCOIN_QT_OVERVIEWPAGE_H\n"
  },
  {
    "path": "src/qt/paymentrequest.proto",
    "content": "//\n// Simple Bitcoin Payment Protocol messages\n//\n// Use fields 100+ for extensions;\n// to avoid conflicts, register extensions at:\n// https://en.bitcoin.it/wiki/Payment_Request\n//\n\nsyntax = \"proto2\";\n\npackage payments;\noption java_package = \"org.sugarchain.protocols.payments\";\noption java_outer_classname = \"Protos\";\n\n// Generalized form of \"send payment to this/these bitcoin addresses\"\nmessage Output {\n\toptional uint64 amount = 1 [default = 0]; // amount is integer-number-of-satoshis\n\trequired bytes script = 2; // usually one of the standard Script forms\n}\nmessage PaymentDetails {\n        optional string network = 1 [default = \"main\"]; // \"main\" or \"test\"\n        repeated Output outputs = 2;        // Where payment should be sent\n        required uint64 time = 3;           // Timestamp; when payment request created\n        optional uint64 expires = 4;        // Timestamp; when this request should be considered invalid\n        optional string memo = 5;           // Human-readable description of request for the customer\n        optional string payment_url = 6;    // URL to send Payment and get PaymentACK\n        optional bytes merchant_data = 7;   // Arbitrary data to include in the Payment message\n}\nmessage PaymentRequest {\n        optional uint32 payment_details_version = 1 [default = 1];\n        optional string pki_type = 2 [default = \"none\"];  // none / x509+sha256 / x509+sha1\n        optional bytes pki_data = 3;                      // depends on pki_type\n        required bytes serialized_payment_details = 4;    // PaymentDetails\n        optional bytes signature = 5;                     // pki-dependent signature\n}\nmessage X509Certificates {\n        repeated bytes certificate = 1;    // DER-encoded X.509 certificate chain\n}\nmessage Payment {\n        optional bytes merchant_data = 1;  // From PaymentDetails.merchant_data\n        repeated bytes transactions = 2;   // Signed transactions that satisfy PaymentDetails.outputs\n        repeated Output refund_to = 3;     // Where to send refunds, if a refund is necessary\n        optional string memo = 4;          // Human-readable message for the merchant\n}\nmessage PaymentACK {\n        required Payment payment = 1;      // Payment message that triggered this ACK\n        optional string memo = 2;          // human-readable message for customer\n}\n"
  },
  {
    "path": "src/qt/paymentrequestplus.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n//\n// Wraps dumb protocol buffer paymentRequest\n// with some extra methods\n//\n\n#include <qt/paymentrequestplus.h>\n\n#include <util.h>\n\n#include <stdexcept>\n\n#include <openssl/x509_vfy.h>\n\n#include <QDateTime>\n#include <QDebug>\n#include <QSslCertificate>\n\nclass SSLVerifyError : public std::runtime_error\n{\npublic:\n    explicit SSLVerifyError(std::string err) : std::runtime_error(err) { }\n};\n\nbool PaymentRequestPlus::parse(const QByteArray& data)\n{\n    bool parseOK = paymentRequest.ParseFromArray(data.data(), data.size());\n    if (!parseOK) {\n        qWarning() << \"PaymentRequestPlus::parse: Error parsing payment request\";\n        return false;\n    }\n    if (paymentRequest.payment_details_version() > 1) {\n        qWarning() << \"PaymentRequestPlus::parse: Received up-version payment details, version=\" << paymentRequest.payment_details_version();\n        return false;\n    }\n\n    parseOK = details.ParseFromString(paymentRequest.serialized_payment_details());\n    if (!parseOK)\n    {\n        qWarning() << \"PaymentRequestPlus::parse: Error parsing payment details\";\n        paymentRequest.Clear();\n        return false;\n    }\n    return true;\n}\n\nbool PaymentRequestPlus::SerializeToString(std::string* output) const\n{\n    return paymentRequest.SerializeToString(output);\n}\n\nbool PaymentRequestPlus::IsInitialized() const\n{\n    return paymentRequest.IsInitialized();\n}\n\nbool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) const\n{\n    merchant.clear();\n\n    if (!IsInitialized())\n        return false;\n\n    // One day we'll support more PKI types, but just\n    // x509 for now:\n    const EVP_MD* digestAlgorithm = nullptr;\n    if (paymentRequest.pki_type() == \"x509+sha256\") {\n        digestAlgorithm = EVP_sha256();\n    }\n    else if (paymentRequest.pki_type() == \"x509+sha1\") {\n        digestAlgorithm = EVP_sha1();\n    }\n    else if (paymentRequest.pki_type() == \"none\") {\n        qWarning() << \"PaymentRequestPlus::getMerchant: Payment request: pki_type == none\";\n        return false;\n    }\n    else {\n        qWarning() << \"PaymentRequestPlus::getMerchant: Payment request: unknown pki_type \" << QString::fromStdString(paymentRequest.pki_type());\n        return false;\n    }\n\n    payments::X509Certificates certChain;\n    if (!certChain.ParseFromString(paymentRequest.pki_data())) {\n        qWarning() << \"PaymentRequestPlus::getMerchant: Payment request: error parsing pki_data\";\n        return false;\n    }\n\n    std::vector<X509*> certs;\n    const QDateTime currentTime = QDateTime::currentDateTime();\n    for (int i = 0; i < certChain.certificate_size(); i++) {\n        QByteArray certData(certChain.certificate(i).data(), certChain.certificate(i).size());\n        QSslCertificate qCert(certData, QSsl::Der);\n        if (currentTime < qCert.effectiveDate() || currentTime > qCert.expiryDate()) {\n            qWarning() << \"PaymentRequestPlus::getMerchant: Payment request: certificate expired or not yet active: \" << qCert;\n            return false;\n        }\n#if QT_VERSION >= 0x050000\n        if (qCert.isBlacklisted()) {\n            qWarning() << \"PaymentRequestPlus::getMerchant: Payment request: certificate blacklisted: \" << qCert;\n            return false;\n        }\n#endif\n        const unsigned char *data = (const unsigned char *)certChain.certificate(i).data();\n        X509 *cert = d2i_X509(nullptr, &data, certChain.certificate(i).size());\n        if (cert)\n            certs.push_back(cert);\n    }\n    if (certs.empty()) {\n        qWarning() << \"PaymentRequestPlus::getMerchant: Payment request: empty certificate chain\";\n        return false;\n    }\n\n    // The first cert is the signing cert, the rest are untrusted certs that chain\n    // to a valid root authority. OpenSSL needs them separately.\n    STACK_OF(X509) *chain = sk_X509_new_null();\n    for (int i = certs.size() - 1; i > 0; i--) {\n        sk_X509_push(chain, certs[i]);\n    }\n    X509 *signing_cert = certs[0];\n\n    // Now create a \"store context\", which is a single use object for checking,\n    // load the signing cert into it and verify.\n    X509_STORE_CTX *store_ctx = X509_STORE_CTX_new();\n    if (!store_ctx) {\n        qWarning() << \"PaymentRequestPlus::getMerchant: Payment request: error creating X509_STORE_CTX\";\n        return false;\n    }\n\n    char *website = nullptr;\n    bool fResult = true;\n    try\n    {\n        if (!X509_STORE_CTX_init(store_ctx, certStore, signing_cert, chain))\n        {\n            int error = X509_STORE_CTX_get_error(store_ctx);\n            throw SSLVerifyError(X509_verify_cert_error_string(error));\n        }\n\n        // Now do the verification!\n        int result = X509_verify_cert(store_ctx);\n        if (result != 1) {\n            int error = X509_STORE_CTX_get_error(store_ctx);\n            // For testing payment requests, we allow self signed root certs!\n            // This option is just shown in the UI options, if -help-debug is enabled.\n            if (!(error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT && gArgs.GetBoolArg(\"-allowselfsignedrootcertificates\", DEFAULT_SELFSIGNED_ROOTCERTS))) {\n                throw SSLVerifyError(X509_verify_cert_error_string(error));\n            } else {\n               qDebug() << \"PaymentRequestPlus::getMerchant: Allowing self signed root certificate, because -allowselfsignedrootcertificates is true.\";\n            }\n        }\n        X509_NAME *certname = X509_get_subject_name(signing_cert);\n\n        // Valid cert; check signature:\n        payments::PaymentRequest rcopy(paymentRequest); // Copy\n        rcopy.set_signature(std::string(\"\"));\n        std::string data_to_verify;                     // Everything but the signature\n        rcopy.SerializeToString(&data_to_verify);\n\n#if HAVE_DECL_EVP_MD_CTX_NEW\n        EVP_MD_CTX *ctx = EVP_MD_CTX_new();\n        if (!ctx) throw SSLVerifyError(\"Error allocating OpenSSL context.\");\n#else\n        EVP_MD_CTX _ctx;\n        EVP_MD_CTX *ctx;\n        ctx = &_ctx;\n#endif\n        EVP_PKEY *pubkey = X509_get_pubkey(signing_cert);\n        EVP_MD_CTX_init(ctx);\n        if (!EVP_VerifyInit_ex(ctx, digestAlgorithm, nullptr) ||\n            !EVP_VerifyUpdate(ctx, data_to_verify.data(), data_to_verify.size()) ||\n            !EVP_VerifyFinal(ctx, (const unsigned char*)paymentRequest.signature().data(), (unsigned int)paymentRequest.signature().size(), pubkey)) {\n            throw SSLVerifyError(\"Bad signature, invalid payment request.\");\n        }\n#if HAVE_DECL_EVP_MD_CTX_NEW\n        EVP_MD_CTX_free(ctx);\n#endif\n\n        // OpenSSL API for getting human printable strings from certs is baroque.\n        int textlen = X509_NAME_get_text_by_NID(certname, NID_commonName, nullptr, 0);\n        website = new char[textlen + 1];\n        if (X509_NAME_get_text_by_NID(certname, NID_commonName, website, textlen + 1) == textlen && textlen > 0) {\n            merchant = website;\n        }\n        else {\n            throw SSLVerifyError(\"Bad certificate, missing common name.\");\n        }\n        // TODO: detect EV certificates and set merchant = business name instead of unfriendly NID_commonName ?\n    }\n    catch (const SSLVerifyError& err) {\n        fResult = false;\n        qWarning() << \"PaymentRequestPlus::getMerchant: SSL error: \" << err.what();\n    }\n\n    delete[] website;\n    X509_STORE_CTX_free(store_ctx);\n    for (unsigned int i = 0; i < certs.size(); i++)\n        X509_free(certs[i]);\n\n    return fResult;\n}\n\nQList<std::pair<CScript,CAmount> > PaymentRequestPlus::getPayTo() const\n{\n    QList<std::pair<CScript,CAmount> > result;\n    for (int i = 0; i < details.outputs_size(); i++)\n    {\n        const unsigned char* scriptStr = (const unsigned char*)details.outputs(i).script().data();\n        CScript s(scriptStr, scriptStr+details.outputs(i).script().size());\n\n        result.append(std::make_pair(s, details.outputs(i).amount()));\n    }\n    return result;\n}\n"
  },
  {
    "path": "src/qt/paymentrequestplus.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_PAYMENTREQUESTPLUS_H\n#define BITCOIN_QT_PAYMENTREQUESTPLUS_H\n\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wdeprecated-declarations\"\n#include <qt/paymentrequest.pb.h>\n#pragma GCC diagnostic pop\n\n#include <base58.h>\n\n#include <openssl/x509.h>\n\n#include <QByteArray>\n#include <QList>\n#include <QString>\n\nstatic const bool DEFAULT_SELFSIGNED_ROOTCERTS = false;\n\n//\n// Wraps dumb protocol buffer paymentRequest\n// with extra methods\n//\n\nclass PaymentRequestPlus\n{\npublic:\n    PaymentRequestPlus() { }\n\n    bool parse(const QByteArray& data);\n    bool SerializeToString(std::string* output) const;\n\n    bool IsInitialized() const;\n    // Returns true if merchant's identity is authenticated, and\n    // returns human-readable merchant identity in merchant\n    bool getMerchant(X509_STORE* certStore, QString& merchant) const;\n\n    // Returns list of outputs, amount\n    QList<std::pair<CScript,CAmount> > getPayTo() const;\n\n    const payments::PaymentDetails& getDetails() const { return details; }\n\nprivate:\n    payments::PaymentRequest paymentRequest;\n    payments::PaymentDetails details;\n};\n\n#endif // BITCOIN_QT_PAYMENTREQUESTPLUS_H\n"
  },
  {
    "path": "src/qt/paymentserver.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/paymentserver.h>\n\n#include <qt/bitcoinunits.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n\n#include <base58.h>\n#include <chainparams.h>\n#include <policy/policy.h>\n#include <ui_interface.h>\n#include <util.h>\n#include <wallet/wallet.h>\n\n#include <cstdlib>\n#include <memory>\n\n#include <openssl/x509_vfy.h>\n\n#include <QApplication>\n#include <QByteArray>\n#include <QDataStream>\n#include <QDateTime>\n#include <QDebug>\n#include <QFile>\n#include <QFileOpenEvent>\n#include <QHash>\n#include <QList>\n#include <QLocalServer>\n#include <QLocalSocket>\n#include <QNetworkAccessManager>\n#include <QNetworkProxy>\n#include <QNetworkReply>\n#include <QNetworkRequest>\n#include <QSslCertificate>\n#include <QSslError>\n#include <QSslSocket>\n#include <QStringList>\n#include <QTextDocument>\n\n#if QT_VERSION < 0x050000\n#include <QUrl>\n#else\n#include <QUrlQuery>\n#endif\n\nconst int BITCOIN_IPC_CONNECT_TIMEOUT = 1000; // milliseconds\nconst QString BITCOIN_IPC_PREFIX(\"sugarchain:\");\n// BIP70 payment protocol messages\nconst char* BIP70_MESSAGE_PAYMENTACK = \"PaymentACK\";\nconst char* BIP70_MESSAGE_PAYMENTREQUEST = \"PaymentRequest\";\n// BIP71 payment protocol media types\nconst char* BIP71_MIMETYPE_PAYMENT = \"application/sugarchain-payment\";\nconst char* BIP71_MIMETYPE_PAYMENTACK = \"application/sugarchain-paymentack\";\nconst char* BIP71_MIMETYPE_PAYMENTREQUEST = \"application/sugarchain-paymentrequest\";\n\nstruct X509StoreDeleter {\n      void operator()(X509_STORE* b) {\n          X509_STORE_free(b);\n      }\n};\n\nstruct X509Deleter {\n      void operator()(X509* b) { X509_free(b); }\n};\n\nnamespace // Anon namespace\n{\n    std::unique_ptr<X509_STORE, X509StoreDeleter> certStore;\n}\n\n//\n// Create a name that is unique for:\n//  testnet / non-testnet\n//  data directory\n//\nstatic QString ipcServerName()\n{\n    QString name(\"SugarchainQt\");\n\n    // Append a simple hash of the datadir\n    // Note that GetDataDir(true) returns a different path\n    // for -testnet versus main net\n    QString ddir(GUIUtil::boostPathToQString(GetDataDir(true)));\n    name.append(QString::number(qHash(ddir)));\n\n    return name;\n}\n\n//\n// We store payment URIs and requests received before\n// the main GUI window is up and ready to ask the user\n// to send payment.\n\nstatic QList<QString> savedPaymentRequests;\n\nstatic void ReportInvalidCertificate(const QSslCertificate& cert)\n{\n#if QT_VERSION < 0x050000\n    qDebug() << QString(\"%1: Payment server found an invalid certificate: \").arg(__func__) << cert.serialNumber() << cert.subjectInfo(QSslCertificate::CommonName) << cert.subjectInfo(QSslCertificate::OrganizationalUnitName);\n#else\n    qDebug() << QString(\"%1: Payment server found an invalid certificate: \").arg(__func__) << cert.serialNumber() << cert.subjectInfo(QSslCertificate::CommonName) << cert.subjectInfo(QSslCertificate::DistinguishedNameQualifier) << cert.subjectInfo(QSslCertificate::OrganizationalUnitName);\n#endif\n}\n\n//\n// Load OpenSSL's list of root certificate authorities\n//\nvoid PaymentServer::LoadRootCAs(X509_STORE* _store)\n{\n    // Unit tests mostly use this, to pass in fake root CAs:\n    if (_store)\n    {\n        certStore.reset(_store);\n        return;\n    }\n\n    // Normal execution, use either -rootcertificates or system certs:\n    certStore.reset(X509_STORE_new());\n\n    // Note: use \"-system-\" default here so that users can pass -rootcertificates=\"\"\n    // and get 'I don't like X.509 certificates, don't trust anybody' behavior:\n    QString certFile = QString::fromStdString(gArgs.GetArg(\"-rootcertificates\", \"-system-\"));\n\n    // Empty store\n    if (certFile.isEmpty()) {\n        qDebug() << QString(\"PaymentServer::%1: Payment request authentication via X.509 certificates disabled.\").arg(__func__);\n        return;\n    }\n\n    QList<QSslCertificate> certList;\n\n    if (certFile != \"-system-\") {\n            qDebug() << QString(\"PaymentServer::%1: Using \\\"%2\\\" as trusted root certificate.\").arg(__func__).arg(certFile);\n\n        certList = QSslCertificate::fromPath(certFile);\n        // Use those certificates when fetching payment requests, too:\n        QSslSocket::setDefaultCaCertificates(certList);\n    } else\n        certList = QSslSocket::systemCaCertificates();\n\n    int nRootCerts = 0;\n    const QDateTime currentTime = QDateTime::currentDateTime();\n\n    for (const QSslCertificate& cert : certList) {\n        // Don't log NULL certificates\n        if (cert.isNull())\n            continue;\n\n        // Not yet active/valid, or expired certificate\n        if (currentTime < cert.effectiveDate() || currentTime > cert.expiryDate()) {\n            ReportInvalidCertificate(cert);\n            continue;\n        }\n\n#if QT_VERSION >= 0x050000\n        // Blacklisted certificate\n        if (cert.isBlacklisted()) {\n            ReportInvalidCertificate(cert);\n            continue;\n        }\n#endif\n        QByteArray certData = cert.toDer();\n        const unsigned char *data = (const unsigned char *)certData.data();\n\n        std::unique_ptr<X509, X509Deleter> x509(d2i_X509(0, &data, certData.size()));\n        if (x509 && X509_STORE_add_cert(certStore.get(), x509.get()))\n        {\n            // Note: X509_STORE increases the reference count to the X509 object,\n            // we still have to release our reference to it.\n            ++nRootCerts;\n        }\n        else\n        {\n            ReportInvalidCertificate(cert);\n            continue;\n        }\n    }\n    qWarning() << \"PaymentServer::LoadRootCAs: Loaded \" << nRootCerts << \" root certificates\";\n\n    // Project for another day:\n    // Fetch certificate revocation lists, and add them to certStore.\n    // Issues to consider:\n    //   performance (start a thread to fetch in background?)\n    //   privacy (fetch through tor/proxy so IP address isn't revealed)\n    //   would it be easier to just use a compiled-in blacklist?\n    //    or use Qt's blacklist?\n    //   \"certificate stapling\" with server-side caching is more efficient\n}\n\n//\n// Sending to the server is done synchronously, at startup.\n// If the server isn't already running, startup continues,\n// and the items in savedPaymentRequest will be handled\n// when uiReady() is called.\n//\n// Warning: ipcSendCommandLine() is called early in init,\n// so don't use \"Q_EMIT message()\", but \"QMessageBox::\"!\n//\nvoid PaymentServer::ipcParseCommandLine(int argc, char* argv[])\n{\n    for (int i = 1; i < argc; i++)\n    {\n        QString arg(argv[i]);\n        if (arg.startsWith(\"-\"))\n            continue;\n\n        // If the bitcoin: URI contains a payment request, we are not able to detect the\n        // network as that would require fetching and parsing the payment request.\n        // That means clicking such an URI which contains a testnet payment request\n        // will start a mainnet instance and throw a \"wrong network\" error.\n        if (arg.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // bitcoin: URI\n        {\n            savedPaymentRequests.append(arg);\n\n            SendCoinsRecipient r;\n            if (GUIUtil::parseBitcoinURI(arg, &r) && !r.address.isEmpty())\n            {\n                auto tempChainParams = CreateChainParams(CBaseChainParams::MAIN);\n\n                if (IsValidDestinationString(r.address.toStdString(), *tempChainParams)) {\n                    SelectParams(CBaseChainParams::MAIN);\n                } else {\n                    tempChainParams = CreateChainParams(CBaseChainParams::TESTNET);\n                    if (IsValidDestinationString(r.address.toStdString(), *tempChainParams)) {\n                        SelectParams(CBaseChainParams::TESTNET);\n                    }\n                }\n            }\n        }\n        else if (QFile::exists(arg)) // Filename\n        {\n            savedPaymentRequests.append(arg);\n\n            PaymentRequestPlus request;\n            if (readPaymentRequestFromFile(arg, request))\n            {\n                if (request.getDetails().network() == \"main\")\n                {\n                    SelectParams(CBaseChainParams::MAIN);\n                }\n                else if (request.getDetails().network() == \"test\")\n                {\n                    SelectParams(CBaseChainParams::TESTNET);\n                }\n            }\n        }\n        else\n        {\n            // Printing to debug.log is about the best we can do here, the\n            // GUI hasn't started yet so we can't pop up a message box.\n            qWarning() << \"PaymentServer::ipcSendCommandLine: Payment request file does not exist: \" << arg;\n        }\n    }\n}\n\n//\n// Sending to the server is done synchronously, at startup.\n// If the server isn't already running, startup continues,\n// and the items in savedPaymentRequest will be handled\n// when uiReady() is called.\n//\nbool PaymentServer::ipcSendCommandLine()\n{\n    bool fResult = false;\n    for (const QString& r : savedPaymentRequests)\n    {\n        QLocalSocket* socket = new QLocalSocket();\n        socket->connectToServer(ipcServerName(), QIODevice::WriteOnly);\n        if (!socket->waitForConnected(BITCOIN_IPC_CONNECT_TIMEOUT))\n        {\n            delete socket;\n            socket = nullptr;\n            return false;\n        }\n\n        QByteArray block;\n        QDataStream out(&block, QIODevice::WriteOnly);\n        out.setVersion(QDataStream::Qt_4_0);\n        out << r;\n        out.device()->seek(0);\n\n        socket->write(block);\n        socket->flush();\n        socket->waitForBytesWritten(BITCOIN_IPC_CONNECT_TIMEOUT);\n        socket->disconnectFromServer();\n\n        delete socket;\n        socket = nullptr;\n        fResult = true;\n    }\n\n    return fResult;\n}\n\nPaymentServer::PaymentServer(QObject* parent, bool startLocalServer) :\n    QObject(parent),\n    saveURIs(true),\n    uriServer(0),\n    netManager(0),\n    optionsModel(0)\n{\n    // Verify that the version of the library that we linked against is\n    // compatible with the version of the headers we compiled against.\n    GOOGLE_PROTOBUF_VERIFY_VERSION;\n\n    // Install global event filter to catch QFileOpenEvents\n    // on Mac: sent when you click bitcoin: links\n    // other OSes: helpful when dealing with payment request files\n    if (parent)\n        parent->installEventFilter(this);\n\n    QString name = ipcServerName();\n\n    // Clean up old socket leftover from a crash:\n    QLocalServer::removeServer(name);\n\n    if (startLocalServer)\n    {\n        uriServer = new QLocalServer(this);\n\n        if (!uriServer->listen(name)) {\n            // constructor is called early in init, so don't use \"Q_EMIT message()\" here\n            QMessageBox::critical(0, tr(\"Payment request error\"),\n                tr(\"Cannot start sugarchain: click-to-pay handler\"));\n        }\n        else {\n            connect(uriServer, SIGNAL(newConnection()), this, SLOT(handleURIConnection()));\n            connect(this, SIGNAL(receivedPaymentACK(QString)), this, SLOT(handlePaymentACK(QString)));\n        }\n    }\n}\n\nPaymentServer::~PaymentServer()\n{\n    google::protobuf::ShutdownProtobufLibrary();\n}\n\n//\n// OSX-specific way of handling bitcoin: URIs and PaymentRequest mime types.\n// Also used by paymentservertests.cpp and when opening a payment request file\n// via \"Open URI...\" menu entry.\n//\nbool PaymentServer::eventFilter(QObject *object, QEvent *event)\n{\n    if (event->type() == QEvent::FileOpen) {\n        QFileOpenEvent *fileEvent = static_cast<QFileOpenEvent*>(event);\n        if (!fileEvent->file().isEmpty())\n            handleURIOrFile(fileEvent->file());\n        else if (!fileEvent->url().isEmpty())\n            handleURIOrFile(fileEvent->url().toString());\n\n        return true;\n    }\n\n    return QObject::eventFilter(object, event);\n}\n\nvoid PaymentServer::initNetManager()\n{\n    if (!optionsModel)\n        return;\n    delete netManager;\n\n    // netManager is used to fetch paymentrequests given in bitcoin: URIs\n    netManager = new QNetworkAccessManager(this);\n\n    QNetworkProxy proxy;\n\n    // Query active SOCKS5 proxy\n    if (optionsModel->getProxySettings(proxy)) {\n        netManager->setProxy(proxy);\n\n        qDebug() << \"PaymentServer::initNetManager: Using SOCKS5 proxy\" << proxy.hostName() << \":\" << proxy.port();\n    }\n    else\n        qDebug() << \"PaymentServer::initNetManager: No active proxy server found.\";\n\n    connect(netManager, SIGNAL(finished(QNetworkReply*)),\n            this, SLOT(netRequestFinished(QNetworkReply*)));\n    connect(netManager, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError> &)),\n            this, SLOT(reportSslErrors(QNetworkReply*, const QList<QSslError> &)));\n}\n\nvoid PaymentServer::uiReady()\n{\n    initNetManager();\n\n    saveURIs = false;\n    for (const QString& s : savedPaymentRequests)\n    {\n        handleURIOrFile(s);\n    }\n    savedPaymentRequests.clear();\n}\n\nvoid PaymentServer::handleURIOrFile(const QString& s)\n{\n    if (saveURIs)\n    {\n        savedPaymentRequests.append(s);\n        return;\n    }\n\n    if (s.startsWith(BITCOIN_IPC_PREFIX, Qt::CaseInsensitive)) // bitcoin: URI\n    {\n#if QT_VERSION < 0x050000\n        QUrl uri(s);\n#else\n        QUrlQuery uri((QUrl(s)));\n#endif\n        if (uri.hasQueryItem(\"r\")) // payment request URI\n        {\n            QByteArray temp;\n            temp.append(uri.queryItemValue(\"r\"));\n            QString decoded = QUrl::fromPercentEncoding(temp);\n            QUrl fetchUrl(decoded, QUrl::StrictMode);\n\n            if (fetchUrl.isValid())\n            {\n                qDebug() << \"PaymentServer::handleURIOrFile: fetchRequest(\" << fetchUrl << \")\";\n                fetchRequest(fetchUrl);\n            }\n            else\n            {\n                qWarning() << \"PaymentServer::handleURIOrFile: Invalid URL: \" << fetchUrl;\n                Q_EMIT message(tr(\"URI handling\"),\n                    tr(\"Payment request fetch URL is invalid: %1\").arg(fetchUrl.toString()),\n                    CClientUIInterface::ICON_WARNING);\n            }\n\n            return;\n        }\n        else // normal URI\n        {\n            SendCoinsRecipient recipient;\n            if (GUIUtil::parseBitcoinURI(s, &recipient))\n            {\n                if (!IsValidDestinationString(recipient.address.toStdString())) {\n                    Q_EMIT message(tr(\"URI handling\"), tr(\"Invalid payment address %1\").arg(recipient.address),\n                        CClientUIInterface::MSG_ERROR);\n                }\n                else\n                    Q_EMIT receivedPaymentRequest(recipient);\n            }\n            else\n                Q_EMIT message(tr(\"URI handling\"),\n                    tr(\"URI cannot be parsed! This can be caused by an invalid Sugarchain address or malformed URI parameters.\"),\n                    CClientUIInterface::ICON_WARNING);\n\n            return;\n        }\n    }\n\n    if (QFile::exists(s)) // payment request file\n    {\n        PaymentRequestPlus request;\n        SendCoinsRecipient recipient;\n        if (!readPaymentRequestFromFile(s, request))\n        {\n            Q_EMIT message(tr(\"Payment request file handling\"),\n                tr(\"Payment request file cannot be read! This can be caused by an invalid payment request file.\"),\n                CClientUIInterface::ICON_WARNING);\n        }\n        else if (processPaymentRequest(request, recipient))\n            Q_EMIT receivedPaymentRequest(recipient);\n\n        return;\n    }\n}\n\nvoid PaymentServer::handleURIConnection()\n{\n    QLocalSocket *clientConnection = uriServer->nextPendingConnection();\n\n    while (clientConnection->bytesAvailable() < (int)sizeof(quint32))\n        clientConnection->waitForReadyRead();\n\n    connect(clientConnection, SIGNAL(disconnected()),\n            clientConnection, SLOT(deleteLater()));\n\n    QDataStream in(clientConnection);\n    in.setVersion(QDataStream::Qt_4_0);\n    if (clientConnection->bytesAvailable() < (int)sizeof(quint16)) {\n        return;\n    }\n    QString msg;\n    in >> msg;\n\n    handleURIOrFile(msg);\n}\n\n//\n// Warning: readPaymentRequestFromFile() is used in ipcSendCommandLine()\n// so don't use \"Q_EMIT message()\", but \"QMessageBox::\"!\n//\nbool PaymentServer::readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request)\n{\n    QFile f(filename);\n    if (!f.open(QIODevice::ReadOnly)) {\n        qWarning() << QString(\"PaymentServer::%1: Failed to open %2\").arg(__func__).arg(filename);\n        return false;\n    }\n\n    // BIP70 DoS protection\n    if (!verifySize(f.size())) {\n        return false;\n    }\n\n    QByteArray data = f.readAll();\n\n    return request.parse(data);\n}\n\nbool PaymentServer::processPaymentRequest(const PaymentRequestPlus& request, SendCoinsRecipient& recipient)\n{\n    if (!optionsModel)\n        return false;\n\n    if (request.IsInitialized()) {\n        // Payment request network matches client network?\n        if (!verifyNetwork(request.getDetails())) {\n            Q_EMIT message(tr(\"Payment request rejected\"), tr(\"Payment request network doesn't match client network.\"),\n                CClientUIInterface::MSG_ERROR);\n\n            return false;\n        }\n\n        // Make sure any payment requests involved are still valid.\n        // This is re-checked just before sending coins in WalletModel::sendCoins().\n        if (verifyExpired(request.getDetails())) {\n            Q_EMIT message(tr(\"Payment request rejected\"), tr(\"Payment request expired.\"),\n                CClientUIInterface::MSG_ERROR);\n\n            return false;\n        }\n    } else {\n        Q_EMIT message(tr(\"Payment request error\"), tr(\"Payment request is not initialized.\"),\n            CClientUIInterface::MSG_ERROR);\n\n        return false;\n    }\n\n    recipient.paymentRequest = request;\n    recipient.message = GUIUtil::HtmlEscape(request.getDetails().memo());\n\n    request.getMerchant(certStore.get(), recipient.authenticatedMerchant);\n\n    QList<std::pair<CScript, CAmount> > sendingTos = request.getPayTo();\n    QStringList addresses;\n\n    for (const std::pair<CScript, CAmount>& sendingTo : sendingTos) {\n        // Extract and check destination addresses\n        CTxDestination dest;\n        if (ExtractDestination(sendingTo.first, dest)) {\n            // Append destination address\n            addresses.append(QString::fromStdString(EncodeDestination(dest)));\n        }\n        else if (!recipient.authenticatedMerchant.isEmpty()) {\n            // Unauthenticated payment requests to custom bitcoin addresses are not supported\n            // (there is no good way to tell the user where they are paying in a way they'd\n            // have a chance of understanding).\n            Q_EMIT message(tr(\"Payment request rejected\"),\n                tr(\"Unverified payment requests to custom payment scripts are unsupported.\"),\n                CClientUIInterface::MSG_ERROR);\n            return false;\n        }\n\n        // Bitcoin amounts are stored as (optional) uint64 in the protobuf messages (see paymentrequest.proto),\n        // but CAmount is defined as int64_t. Because of that we need to verify that amounts are in a valid range\n        // and no overflow has happened.\n        if (!verifyAmount(sendingTo.second)) {\n            Q_EMIT message(tr(\"Payment request rejected\"), tr(\"Invalid payment request.\"), CClientUIInterface::MSG_ERROR);\n            return false;\n        }\n\n        // Extract and check amounts\n        CTxOut txOut(sendingTo.second, sendingTo.first);\n        if (IsDust(txOut, ::dustRelayFee)) {\n            Q_EMIT message(tr(\"Payment request error\"), tr(\"Requested payment amount of %1 is too small (considered dust).\")\n                .arg(BitcoinUnits::formatWithUnit(optionsModel->getDisplayUnit(), sendingTo.second)),\n                CClientUIInterface::MSG_ERROR);\n\n            return false;\n        }\n\n        recipient.amount += sendingTo.second;\n        // Also verify that the final amount is still in a valid range after adding additional amounts.\n        if (!verifyAmount(recipient.amount)) {\n            Q_EMIT message(tr(\"Payment request rejected\"), tr(\"Invalid payment request.\"), CClientUIInterface::MSG_ERROR);\n            return false;\n        }\n    }\n    // Store addresses and format them to fit nicely into the GUI\n    recipient.address = addresses.join(\"<br />\");\n\n    if (!recipient.authenticatedMerchant.isEmpty()) {\n        qDebug() << \"PaymentServer::processPaymentRequest: Secure payment request from \" << recipient.authenticatedMerchant;\n    }\n    else {\n        qDebug() << \"PaymentServer::processPaymentRequest: Insecure payment request to \" << addresses.join(\", \");\n    }\n\n    return true;\n}\n\nvoid PaymentServer::fetchRequest(const QUrl& url)\n{\n    QNetworkRequest netRequest;\n    netRequest.setAttribute(QNetworkRequest::User, BIP70_MESSAGE_PAYMENTREQUEST);\n    netRequest.setUrl(url);\n    netRequest.setRawHeader(\"User-Agent\", CLIENT_NAME.c_str());\n    netRequest.setRawHeader(\"Accept\", BIP71_MIMETYPE_PAYMENTREQUEST);\n    netManager->get(netRequest);\n}\n\nvoid PaymentServer::fetchPaymentACK(CWallet* wallet, const SendCoinsRecipient& recipient, QByteArray transaction)\n{\n    const payments::PaymentDetails& details = recipient.paymentRequest.getDetails();\n    if (!details.has_payment_url())\n        return;\n\n    QNetworkRequest netRequest;\n    netRequest.setAttribute(QNetworkRequest::User, BIP70_MESSAGE_PAYMENTACK);\n    netRequest.setUrl(QString::fromStdString(details.payment_url()));\n    netRequest.setHeader(QNetworkRequest::ContentTypeHeader, BIP71_MIMETYPE_PAYMENT);\n    netRequest.setRawHeader(\"User-Agent\", CLIENT_NAME.c_str());\n    netRequest.setRawHeader(\"Accept\", BIP71_MIMETYPE_PAYMENTACK);\n\n    payments::Payment payment;\n    payment.set_merchant_data(details.merchant_data());\n    payment.add_transactions(transaction.data(), transaction.size());\n\n    // Create a new refund address, or re-use:\n    QString account = tr(\"Refund from %1\").arg(recipient.authenticatedMerchant);\n    std::string strAccount = account.toStdString();\n    CPubKey newKey;\n    if (wallet->GetKeyFromPool(newKey)) {\n        // BIP70 requests encode the scriptPubKey directly, so we are not restricted to address\n        // types supported by the receiver. As a result, we choose the address format we also\n        // use for change. Despite an actual payment and not change, this is a close match:\n        // it's the output type we use subject to privacy issues, but not restricted by what\n        // other software supports.\n        const OutputType change_type = g_change_type != OUTPUT_TYPE_NONE ? g_change_type : g_address_type;\n        wallet->LearnRelatedScripts(newKey, change_type);\n        CTxDestination dest = GetDestinationForKey(newKey, change_type);\n        wallet->SetAddressBook(dest, strAccount, \"refund\");\n\n        CScript s = GetScriptForDestination(dest);\n        payments::Output* refund_to = payment.add_refund_to();\n        refund_to->set_script(&s[0], s.size());\n    } else {\n        // This should never happen, because sending coins should have\n        // just unlocked the wallet and refilled the keypool.\n        qWarning() << \"PaymentServer::fetchPaymentACK: Error getting refund key, refund_to not set\";\n    }\n\n    int length = payment.ByteSize();\n    netRequest.setHeader(QNetworkRequest::ContentLengthHeader, length);\n    QByteArray serData(length, '\\0');\n    if (payment.SerializeToArray(serData.data(), length)) {\n        netManager->post(netRequest, serData);\n    }\n    else {\n        // This should never happen, either.\n        qWarning() << \"PaymentServer::fetchPaymentACK: Error serializing payment message\";\n    }\n}\n\nvoid PaymentServer::netRequestFinished(QNetworkReply* reply)\n{\n    reply->deleteLater();\n\n    // BIP70 DoS protection\n    if (!verifySize(reply->size())) {\n        Q_EMIT message(tr(\"Payment request rejected\"),\n            tr(\"Payment request %1 is too large (%2 bytes, allowed %3 bytes).\")\n                .arg(reply->request().url().toString())\n                .arg(reply->size())\n                .arg(BIP70_MAX_PAYMENTREQUEST_SIZE),\n            CClientUIInterface::MSG_ERROR);\n        return;\n    }\n\n    if (reply->error() != QNetworkReply::NoError) {\n        QString msg = tr(\"Error communicating with %1: %2\")\n            .arg(reply->request().url().toString())\n            .arg(reply->errorString());\n\n        qWarning() << \"PaymentServer::netRequestFinished: \" << msg;\n        Q_EMIT message(tr(\"Payment request error\"), msg, CClientUIInterface::MSG_ERROR);\n        return;\n    }\n\n    QByteArray data = reply->readAll();\n\n    QString requestType = reply->request().attribute(QNetworkRequest::User).toString();\n    if (requestType == BIP70_MESSAGE_PAYMENTREQUEST)\n    {\n        PaymentRequestPlus request;\n        SendCoinsRecipient recipient;\n        if (!request.parse(data))\n        {\n            qWarning() << \"PaymentServer::netRequestFinished: Error parsing payment request\";\n            Q_EMIT message(tr(\"Payment request error\"),\n                tr(\"Payment request cannot be parsed!\"),\n                CClientUIInterface::MSG_ERROR);\n        }\n        else if (processPaymentRequest(request, recipient))\n            Q_EMIT receivedPaymentRequest(recipient);\n\n        return;\n    }\n    else if (requestType == BIP70_MESSAGE_PAYMENTACK)\n    {\n        payments::PaymentACK paymentACK;\n        if (!paymentACK.ParseFromArray(data.data(), data.size()))\n        {\n            QString msg = tr(\"Bad response from server %1\")\n                .arg(reply->request().url().toString());\n\n            qWarning() << \"PaymentServer::netRequestFinished: \" << msg;\n            Q_EMIT message(tr(\"Payment request error\"), msg, CClientUIInterface::MSG_ERROR);\n        }\n        else\n        {\n            Q_EMIT receivedPaymentACK(GUIUtil::HtmlEscape(paymentACK.memo()));\n        }\n    }\n}\n\nvoid PaymentServer::reportSslErrors(QNetworkReply* reply, const QList<QSslError> &errs)\n{\n    Q_UNUSED(reply);\n\n    QString errString;\n    for (const QSslError& err : errs) {\n        qWarning() << \"PaymentServer::reportSslErrors: \" << err;\n        errString += err.errorString() + \"\\n\";\n    }\n    Q_EMIT message(tr(\"Network request error\"), errString, CClientUIInterface::MSG_ERROR);\n}\n\nvoid PaymentServer::setOptionsModel(OptionsModel *_optionsModel)\n{\n    this->optionsModel = _optionsModel;\n}\n\nvoid PaymentServer::handlePaymentACK(const QString& paymentACKMsg)\n{\n    // currently we don't further process or store the paymentACK message\n    Q_EMIT message(tr(\"Payment acknowledged\"), paymentACKMsg, CClientUIInterface::ICON_INFORMATION | CClientUIInterface::MODAL);\n}\n\nbool PaymentServer::verifyNetwork(const payments::PaymentDetails& requestDetails)\n{\n    bool fVerified = requestDetails.network() == Params().NetworkIDString();\n    if (!fVerified) {\n        qWarning() << QString(\"PaymentServer::%1: Payment request network \\\"%2\\\" doesn't match client network \\\"%3\\\".\")\n            .arg(__func__)\n            .arg(QString::fromStdString(requestDetails.network()))\n            .arg(QString::fromStdString(Params().NetworkIDString()));\n    }\n    return fVerified;\n}\n\nbool PaymentServer::verifyExpired(const payments::PaymentDetails& requestDetails)\n{\n    bool fVerified = (requestDetails.has_expires() && (int64_t)requestDetails.expires() < GetTime());\n    if (fVerified) {\n        const QString requestExpires = QString::fromStdString(DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", (int64_t)requestDetails.expires()));\n        qWarning() << QString(\"PaymentServer::%1: Payment request expired \\\"%2\\\".\")\n            .arg(__func__)\n            .arg(requestExpires);\n    }\n    return fVerified;\n}\n\nbool PaymentServer::verifySize(qint64 requestSize)\n{\n    bool fVerified = (requestSize <= BIP70_MAX_PAYMENTREQUEST_SIZE);\n    if (!fVerified) {\n        qWarning() << QString(\"PaymentServer::%1: Payment request too large (%2 bytes, allowed %3 bytes).\")\n            .arg(__func__)\n            .arg(requestSize)\n            .arg(BIP70_MAX_PAYMENTREQUEST_SIZE);\n    }\n    return fVerified;\n}\n\nbool PaymentServer::verifyAmount(const CAmount& requestAmount)\n{\n    bool fVerified = MoneyRange(requestAmount);\n    if (!fVerified) {\n        qWarning() << QString(\"PaymentServer::%1: Payment request amount out of allowed range (%2, allowed 0 - %3).\")\n            .arg(__func__)\n            .arg(requestAmount)\n            .arg(MAX_MONEY);\n    }\n    return fVerified;\n}\n\nX509_STORE* PaymentServer::getCertStore()\n{\n    return certStore.get();\n}\n"
  },
  {
    "path": "src/qt/paymentserver.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_PAYMENTSERVER_H\n#define BITCOIN_QT_PAYMENTSERVER_H\n\n// This class handles payment requests from clicking on\n// bitcoin: URIs\n//\n// This is somewhat tricky, because we have to deal with\n// the situation where the user clicks on a link during\n// startup/initialization, when the splash-screen is up\n// but the main window (and the Send Coins tab) is not.\n//\n// So, the strategy is:\n//\n// Create the server, and register the event handler,\n// when the application is created. Save any URIs\n// received at or during startup in a list.\n//\n// When startup is finished and the main window is\n// shown, a signal is sent to slot uiReady(), which\n// emits a receivedURI() signal for any payment\n// requests that happened during startup.\n//\n// After startup, receivedURI() happens as usual.\n//\n// This class has one more feature: a static\n// method that finds URIs passed in the command line\n// and, if a server is running in another process,\n// sends them to the server.\n//\n\n#include <qt/paymentrequestplus.h>\n#include <qt/walletmodel.h>\n\n#include <QObject>\n#include <QString>\n\nclass OptionsModel;\n\nclass CWallet;\n\nQT_BEGIN_NAMESPACE\nclass QApplication;\nclass QByteArray;\nclass QLocalServer;\nclass QNetworkAccessManager;\nclass QNetworkReply;\nclass QSslError;\nclass QUrl;\nQT_END_NAMESPACE\n\n// BIP70 max payment request size in bytes (DoS protection)\nstatic const qint64 BIP70_MAX_PAYMENTREQUEST_SIZE = 50000;\n\nclass PaymentServer : public QObject\n{\n    Q_OBJECT\n\npublic:\n    // Parse URIs on command line\n    // Returns false on error\n    static void ipcParseCommandLine(int argc, char *argv[]);\n\n    // Returns true if there were URIs on the command line\n    // which were successfully sent to an already-running\n    // process.\n    // Note: if a payment request is given, SelectParams(MAIN/TESTNET)\n    // will be called so we startup in the right mode.\n    static bool ipcSendCommandLine();\n\n    // parent should be QApplication object\n    explicit PaymentServer(QObject* parent, bool startLocalServer = true);\n    ~PaymentServer();\n\n    // Load root certificate authorities. Pass nullptr (default)\n    // to read from the file specified in the -rootcertificates setting,\n    // or, if that's not set, to use the system default root certificates.\n    // If you pass in a store, you should not X509_STORE_free it: it will be\n    // freed either at exit or when another set of CAs are loaded.\n    static void LoadRootCAs(X509_STORE* store = nullptr);\n\n    // Return certificate store\n    static X509_STORE* getCertStore();\n\n    // OptionsModel is used for getting proxy settings and display unit\n    void setOptionsModel(OptionsModel *optionsModel);\n\n    // Verify that the payment request network matches the client network\n    static bool verifyNetwork(const payments::PaymentDetails& requestDetails);\n    // Verify if the payment request is expired\n    static bool verifyExpired(const payments::PaymentDetails& requestDetails);\n    // Verify the payment request size is valid as per BIP70\n    static bool verifySize(qint64 requestSize);\n    // Verify the payment request amount is valid\n    static bool verifyAmount(const CAmount& requestAmount);\n\nQ_SIGNALS:\n    // Fired when a valid payment request is received\n    void receivedPaymentRequest(SendCoinsRecipient);\n\n    // Fired when a valid PaymentACK is received\n    void receivedPaymentACK(const QString &paymentACKMsg);\n\n    // Fired when a message should be reported to the user\n    void message(const QString &title, const QString &message, unsigned int style);\n\npublic Q_SLOTS:\n    // Signal this when the main window's UI is ready\n    // to display payment requests to the user\n    void uiReady();\n\n    // Submit Payment message to a merchant, get back PaymentACK:\n    void fetchPaymentACK(CWallet* wallet, const SendCoinsRecipient& recipient, QByteArray transaction);\n\n    // Handle an incoming URI, URI with local file scheme or file\n    void handleURIOrFile(const QString& s);\n\nprivate Q_SLOTS:\n    void handleURIConnection();\n    void netRequestFinished(QNetworkReply*);\n    void reportSslErrors(QNetworkReply*, const QList<QSslError> &);\n    void handlePaymentACK(const QString& paymentACKMsg);\n\nprotected:\n    // Constructor registers this on the parent QApplication to\n    // receive QEvent::FileOpen and QEvent:Drop events\n    bool eventFilter(QObject *object, QEvent *event);\n\nprivate:\n    static bool readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request);\n    bool processPaymentRequest(const PaymentRequestPlus& request, SendCoinsRecipient& recipient);\n    void fetchRequest(const QUrl& url);\n\n    // Setup networking\n    void initNetManager();\n\n    bool saveURIs;                      // true during startup\n    QLocalServer* uriServer;\n\n    QNetworkAccessManager* netManager;  // Used to fetch payment requests\n\n    OptionsModel *optionsModel;\n};\n\n#endif // BITCOIN_QT_PAYMENTSERVER_H\n"
  },
  {
    "path": "src/qt/peertablemodel.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/peertablemodel.h>\n\n#include <qt/clientmodel.h>\n#include <qt/guiconstants.h>\n#include <qt/guiutil.h>\n\n#include <validation.h> // for cs_main\n#include <sync.h>\n\n#include <QDebug>\n#include <QList>\n#include <QTimer>\n\nbool NodeLessThan::operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const\n{\n    const CNodeStats *pLeft = &(left.nodeStats);\n    const CNodeStats *pRight = &(right.nodeStats);\n\n    if (order == Qt::DescendingOrder)\n        std::swap(pLeft, pRight);\n\n    switch(column)\n    {\n    case PeerTableModel::NetNodeId:\n        return pLeft->nodeid < pRight->nodeid;\n    case PeerTableModel::Address:\n        return pLeft->addrName.compare(pRight->addrName) < 0;\n    case PeerTableModel::Subversion:\n        return pLeft->cleanSubVer.compare(pRight->cleanSubVer) < 0;\n    case PeerTableModel::Ping:\n        return pLeft->dMinPing < pRight->dMinPing;\n    case PeerTableModel::Sent:\n        return pLeft->nSendBytes < pRight->nSendBytes;\n    case PeerTableModel::Received:\n        return pLeft->nRecvBytes < pRight->nRecvBytes;\n    }\n\n    return false;\n}\n\n// private implementation\nclass PeerTablePriv\n{\npublic:\n    /** Local cache of peer information */\n    QList<CNodeCombinedStats> cachedNodeStats;\n    /** Column to sort nodes by */\n    int sortColumn;\n    /** Order (ascending or descending) to sort nodes by */\n    Qt::SortOrder sortOrder;\n    /** Index of rows by node ID */\n    std::map<NodeId, int> mapNodeRows;\n\n    /** Pull a full list of peers from vNodes into our cache */\n    void refreshPeers()\n    {\n        {\n            cachedNodeStats.clear();\n            std::vector<CNodeStats> vstats;\n            if(g_connman)\n                g_connman->GetNodeStats(vstats);\n#if QT_VERSION >= 0x040700\n            cachedNodeStats.reserve(vstats.size());\n#endif\n            for (const CNodeStats& nodestats : vstats)\n            {\n                CNodeCombinedStats stats;\n                stats.nodeStateStats.nMisbehavior = 0;\n                stats.nodeStateStats.nSyncHeight = -1;\n                stats.nodeStateStats.nCommonHeight = -1;\n                stats.fNodeStateStatsAvailable = false;\n                stats.nodeStats = nodestats;\n                cachedNodeStats.append(stats);\n            }\n        }\n\n        // Try to retrieve the CNodeStateStats for each node.\n        {\n            TRY_LOCK(cs_main, lockMain);\n            if (lockMain)\n            {\n                for (CNodeCombinedStats &stats : cachedNodeStats)\n                    stats.fNodeStateStatsAvailable = GetNodeStateStats(stats.nodeStats.nodeid, stats.nodeStateStats);\n            }\n        }\n\n        if (sortColumn >= 0)\n            // sort cacheNodeStats (use stable sort to prevent rows jumping around unnecessarily)\n            qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder));\n\n        // build index map\n        mapNodeRows.clear();\n        int row = 0;\n        for (const CNodeCombinedStats& stats : cachedNodeStats)\n            mapNodeRows.insert(std::pair<NodeId, int>(stats.nodeStats.nodeid, row++));\n    }\n\n    int size() const\n    {\n        return cachedNodeStats.size();\n    }\n\n    CNodeCombinedStats *index(int idx)\n    {\n        if (idx >= 0 && idx < cachedNodeStats.size())\n            return &cachedNodeStats[idx];\n\n        return 0;\n    }\n};\n\nPeerTableModel::PeerTableModel(ClientModel *parent) :\n    QAbstractTableModel(parent),\n    clientModel(parent),\n    timer(0)\n{\n    columns << tr(\"NodeId\") << tr(\"Node/Service\") << tr(\"Ping\") << tr(\"Sent\") << tr(\"Received\") << tr(\"User Agent\");\n    priv.reset(new PeerTablePriv());\n    // default to unsorted\n    priv->sortColumn = -1;\n\n    // set up timer for auto refresh\n    timer = new QTimer(this);\n    connect(timer, SIGNAL(timeout()), SLOT(refresh()));\n    timer->setInterval(MODEL_UPDATE_DELAY);\n\n    // load initial data\n    refresh();\n}\n\nPeerTableModel::~PeerTableModel()\n{\n    // Intentionally left empty\n}\n\nvoid PeerTableModel::startAutoRefresh()\n{\n    timer->start();\n}\n\nvoid PeerTableModel::stopAutoRefresh()\n{\n    timer->stop();\n}\n\nint PeerTableModel::rowCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    return priv->size();\n}\n\nint PeerTableModel::columnCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    return columns.length();\n}\n\nQVariant PeerTableModel::data(const QModelIndex &index, int role) const\n{\n    if(!index.isValid())\n        return QVariant();\n\n    CNodeCombinedStats *rec = static_cast<CNodeCombinedStats*>(index.internalPointer());\n\n    if (role == Qt::DisplayRole) {\n        switch(index.column())\n        {\n        case NetNodeId:\n            return (qint64)rec->nodeStats.nodeid;\n        case Address:\n            return QString::fromStdString(rec->nodeStats.addrName);\n        case Subversion:\n            return QString::fromStdString(rec->nodeStats.cleanSubVer);\n        case Ping:\n            return GUIUtil::formatPingTime(rec->nodeStats.dMinPing);\n        case Sent:\n            return GUIUtil::formatBytes(rec->nodeStats.nSendBytes);\n        case Received:\n            return GUIUtil::formatBytes(rec->nodeStats.nRecvBytes);\n        }\n    } else if (role == Qt::TextAlignmentRole) {\n        switch (index.column()) {\n            case Ping:\n            case Sent:\n            case Received:\n                return QVariant(Qt::AlignRight | Qt::AlignVCenter);\n            default:\n                return QVariant();\n        }\n    }\n\n    return QVariant();\n}\n\nQVariant PeerTableModel::headerData(int section, Qt::Orientation orientation, int role) const\n{\n    if(orientation == Qt::Horizontal)\n    {\n        if(role == Qt::DisplayRole && section < columns.size())\n        {\n            return columns[section];\n        }\n    }\n    return QVariant();\n}\n\nQt::ItemFlags PeerTableModel::flags(const QModelIndex &index) const\n{\n    if(!index.isValid())\n        return 0;\n\n    Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;\n    return retval;\n}\n\nQModelIndex PeerTableModel::index(int row, int column, const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    CNodeCombinedStats *data = priv->index(row);\n\n    if (data)\n        return createIndex(row, column, data);\n    return QModelIndex();\n}\n\nconst CNodeCombinedStats *PeerTableModel::getNodeStats(int idx)\n{\n    return priv->index(idx);\n}\n\nvoid PeerTableModel::refresh()\n{\n    Q_EMIT layoutAboutToBeChanged();\n    priv->refreshPeers();\n    Q_EMIT layoutChanged();\n}\n\nint PeerTableModel::getRowByNodeId(NodeId nodeid)\n{\n    std::map<NodeId, int>::iterator it = priv->mapNodeRows.find(nodeid);\n    if (it == priv->mapNodeRows.end())\n        return -1;\n\n    return it->second;\n}\n\nvoid PeerTableModel::sort(int column, Qt::SortOrder order)\n{\n    priv->sortColumn = column;\n    priv->sortOrder = order;\n    refresh();\n}\n"
  },
  {
    "path": "src/qt/peertablemodel.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_PEERTABLEMODEL_H\n#define BITCOIN_QT_PEERTABLEMODEL_H\n\n#include <net_processing.h> // For CNodeStateStats\n#include <net.h>\n\n#include <memory>\n\n#include <QAbstractTableModel>\n#include <QStringList>\n\nclass ClientModel;\nclass PeerTablePriv;\n\nQT_BEGIN_NAMESPACE\nclass QTimer;\nQT_END_NAMESPACE\n\nstruct CNodeCombinedStats {\n    CNodeStats nodeStats;\n    CNodeStateStats nodeStateStats;\n    bool fNodeStateStatsAvailable;\n};\n\nclass NodeLessThan\n{\npublic:\n    NodeLessThan(int nColumn, Qt::SortOrder fOrder) :\n        column(nColumn), order(fOrder) {}\n    bool operator()(const CNodeCombinedStats &left, const CNodeCombinedStats &right) const;\n\nprivate:\n    int column;\n    Qt::SortOrder order;\n};\n\n/**\n   Qt model providing information about connected peers, similar to the\n   \"getpeerinfo\" RPC call. Used by the rpc console UI.\n */\nclass PeerTableModel : public QAbstractTableModel\n{\n    Q_OBJECT\n\npublic:\n    explicit PeerTableModel(ClientModel *parent = 0);\n    ~PeerTableModel();\n    const CNodeCombinedStats *getNodeStats(int idx);\n    int getRowByNodeId(NodeId nodeid);\n    void startAutoRefresh();\n    void stopAutoRefresh();\n\n    enum ColumnIndex {\n        NetNodeId = 0,\n        Address = 1,\n        Ping = 2,\n        Sent = 3,\n        Received = 4,\n        Subversion = 5\n    };\n\n    /** @name Methods overridden from QAbstractTableModel\n        @{*/\n    int rowCount(const QModelIndex &parent) const;\n    int columnCount(const QModelIndex &parent) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    QVariant headerData(int section, Qt::Orientation orientation, int role) const;\n    QModelIndex index(int row, int column, const QModelIndex &parent) const;\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    void sort(int column, Qt::SortOrder order);\n    /*@}*/\n\npublic Q_SLOTS:\n    void refresh();\n\nprivate:\n    ClientModel *clientModel;\n    QStringList columns;\n    std::unique_ptr<PeerTablePriv> priv;\n    QTimer *timer;\n};\n\n#endif // BITCOIN_QT_PEERTABLEMODEL_H\n"
  },
  {
    "path": "src/qt/platformstyle.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/platformstyle.h>\n\n#include <qt/guiconstants.h>\n\n#include <QApplication>\n#include <QColor>\n#include <QImage>\n#include <QPalette>\n\nstatic const struct {\n    const char *platformId;\n    /** Show images on push buttons */\n    const bool imagesOnButtons;\n    /** Colorize single-color icons */\n    const bool colorizeIcons;\n    /** Extra padding/spacing in transactionview */\n    const bool useExtraSpacing;\n} platform_styles[] = {\n    {\"macosx\", false, false, true},\n    {\"windows\", true, false, false},\n    /* Other: linux, unix, ... */\n    {\"other\", true, true, false}\n};\nstatic const unsigned platform_styles_count = sizeof(platform_styles)/sizeof(*platform_styles);\n\nnamespace {\n/* Local functions for colorizing single-color images */\n\nvoid MakeSingleColorImage(QImage& img, const QColor& colorbase)\n{\n    img = img.convertToFormat(QImage::Format_ARGB32);\n    for (int x = img.width(); x--; )\n    {\n        for (int y = img.height(); y--; )\n        {\n            const QRgb rgb = img.pixel(x, y);\n            img.setPixel(x, y, qRgba(colorbase.red(), colorbase.green(), colorbase.blue(), qAlpha(rgb)));\n        }\n    }\n}\n\nQIcon ColorizeIcon(const QIcon& ico, const QColor& colorbase)\n{\n    QIcon new_ico;\n    for (const QSize sz : ico.availableSizes())\n    {\n        QImage img(ico.pixmap(sz).toImage());\n        MakeSingleColorImage(img, colorbase);\n        new_ico.addPixmap(QPixmap::fromImage(img));\n    }\n    return new_ico;\n}\n\nQImage ColorizeImage(const QString& filename, const QColor& colorbase)\n{\n    QImage img(filename);\n    MakeSingleColorImage(img, colorbase);\n    return img;\n}\n\nQIcon ColorizeIcon(const QString& filename, const QColor& colorbase)\n{\n    return QIcon(QPixmap::fromImage(ColorizeImage(filename, colorbase)));\n}\n\n}\n\n\nPlatformStyle::PlatformStyle(const QString &_name, bool _imagesOnButtons, bool _colorizeIcons, bool _useExtraSpacing):\n    name(_name),\n    imagesOnButtons(_imagesOnButtons),\n    colorizeIcons(_colorizeIcons),\n    useExtraSpacing(_useExtraSpacing),\n    singleColor(0,0,0),\n    textColor(0,0,0)\n{\n    // Determine icon highlighting color\n    if (colorizeIcons) {\n        const QColor colorHighlightBg(QApplication::palette().color(QPalette::Highlight));\n        const QColor colorHighlightFg(QApplication::palette().color(QPalette::HighlightedText));\n        const QColor colorText(QApplication::palette().color(QPalette::WindowText));\n        const int colorTextLightness = colorText.lightness();\n        QColor colorbase;\n        if (abs(colorHighlightBg.lightness() - colorTextLightness) < abs(colorHighlightFg.lightness() - colorTextLightness))\n            colorbase = colorHighlightBg;\n        else\n            colorbase = colorHighlightFg;\n        singleColor = colorbase;\n    }\n    // Determine text color\n    textColor = QColor(QApplication::palette().color(QPalette::WindowText));\n}\n\nQImage PlatformStyle::SingleColorImage(const QString& filename) const\n{\n    if (!colorizeIcons)\n        return QImage(filename);\n    return ColorizeImage(filename, SingleColor());\n}\n\nQIcon PlatformStyle::SingleColorIcon(const QString& filename) const\n{\n    if (!colorizeIcons)\n        return QIcon(filename);\n    return ColorizeIcon(filename, SingleColor());\n}\n\nQIcon PlatformStyle::SingleColorIcon(const QIcon& icon) const\n{\n    if (!colorizeIcons)\n        return icon;\n    return ColorizeIcon(icon, SingleColor());\n}\n\nQIcon PlatformStyle::TextColorIcon(const QString& filename) const\n{\n    return ColorizeIcon(filename, TextColor());\n}\n\nQIcon PlatformStyle::TextColorIcon(const QIcon& icon) const\n{\n    return ColorizeIcon(icon, TextColor());\n}\n\nconst PlatformStyle *PlatformStyle::instantiate(const QString &platformId)\n{\n    for (unsigned x=0; x<platform_styles_count; ++x)\n    {\n        if (platformId == platform_styles[x].platformId)\n        {\n            return new PlatformStyle(\n                    platform_styles[x].platformId,\n                    platform_styles[x].imagesOnButtons,\n                    platform_styles[x].colorizeIcons,\n                    platform_styles[x].useExtraSpacing);\n        }\n    }\n    return 0;\n}\n\n"
  },
  {
    "path": "src/qt/platformstyle.h",
    "content": "// Copyright (c) 2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_PLATFORMSTYLE_H\n#define BITCOIN_QT_PLATFORMSTYLE_H\n\n#include <QIcon>\n#include <QPixmap>\n#include <QString>\n\n/* Coin network-specific GUI style information */\nclass PlatformStyle\n{\npublic:\n    /** Get style associated with provided platform name, or 0 if not known */\n    static const PlatformStyle *instantiate(const QString &platformId);\n\n    const QString &getName() const { return name; }\n\n    bool getImagesOnButtons() const { return imagesOnButtons; }\n    bool getUseExtraSpacing() const { return useExtraSpacing; }\n\n    QColor TextColor() const { return textColor; }\n    QColor SingleColor() const { return singleColor; }\n\n    /** Colorize an image (given filename) with the icon color */\n    QImage SingleColorImage(const QString& filename) const;\n\n    /** Colorize an icon (given filename) with the icon color */\n    QIcon SingleColorIcon(const QString& filename) const;\n\n    /** Colorize an icon (given object) with the icon color */\n    QIcon SingleColorIcon(const QIcon& icon) const;\n\n    /** Colorize an icon (given filename) with the text color */\n    QIcon TextColorIcon(const QString& filename) const;\n\n    /** Colorize an icon (given object) with the text color */\n    QIcon TextColorIcon(const QIcon& icon) const;\n\nprivate:\n    PlatformStyle(const QString &name, bool imagesOnButtons, bool colorizeIcons, bool useExtraSpacing);\n\n    QString name;\n    bool imagesOnButtons;\n    bool colorizeIcons;\n    bool useExtraSpacing;\n    QColor singleColor;\n    QColor textColor;\n    /* ... more to come later */\n};\n\n#endif // BITCOIN_QT_PLATFORMSTYLE_H\n\n"
  },
  {
    "path": "src/qt/qvalidatedlineedit.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/qvalidatedlineedit.h>\n\n#include <qt/bitcoinaddressvalidator.h>\n#include <qt/guiconstants.h>\n\nQValidatedLineEdit::QValidatedLineEdit(QWidget *parent) :\n    QLineEdit(parent),\n    valid(true),\n    checkValidator(0)\n{\n    connect(this, SIGNAL(textChanged(QString)), this, SLOT(markValid()));\n}\n\nvoid QValidatedLineEdit::setValid(bool _valid)\n{\n    if(_valid == this->valid)\n    {\n        return;\n    }\n\n    if(_valid)\n    {\n        setStyleSheet(\"\");\n    }\n    else\n    {\n        setStyleSheet(STYLE_INVALID);\n    }\n    this->valid = _valid;\n}\n\nvoid QValidatedLineEdit::focusInEvent(QFocusEvent *evt)\n{\n    // Clear invalid flag on focus\n    setValid(true);\n\n    QLineEdit::focusInEvent(evt);\n}\n\nvoid QValidatedLineEdit::focusOutEvent(QFocusEvent *evt)\n{\n    checkValidity();\n\n    QLineEdit::focusOutEvent(evt);\n}\n\nvoid QValidatedLineEdit::markValid()\n{\n    // As long as a user is typing ensure we display state as valid\n    setValid(true);\n}\n\nvoid QValidatedLineEdit::clear()\n{\n    setValid(true);\n    QLineEdit::clear();\n}\n\nvoid QValidatedLineEdit::setEnabled(bool enabled)\n{\n    if (!enabled)\n    {\n        // A disabled QValidatedLineEdit should be marked valid\n        setValid(true);\n    }\n    else\n    {\n        // Recheck validity when QValidatedLineEdit gets enabled\n        checkValidity();\n    }\n\n    QLineEdit::setEnabled(enabled);\n}\n\nvoid QValidatedLineEdit::checkValidity()\n{\n    if (text().isEmpty())\n    {\n        setValid(true);\n    }\n    else if (hasAcceptableInput())\n    {\n        setValid(true);\n\n        // Check contents on focus out\n        if (checkValidator)\n        {\n            QString address = text();\n            int pos = 0;\n            if (checkValidator->validate(address, pos) == QValidator::Acceptable)\n                setValid(true);\n            else\n                setValid(false);\n        }\n    }\n    else\n        setValid(false);\n\n    Q_EMIT validationDidChange(this);\n}\n\nvoid QValidatedLineEdit::setCheckValidator(const QValidator *v)\n{\n    checkValidator = v;\n}\n\nbool QValidatedLineEdit::isValid()\n{\n    // use checkValidator in case the QValidatedLineEdit is disabled\n    if (checkValidator)\n    {\n        QString address = text();\n        int pos = 0;\n        if (checkValidator->validate(address, pos) == QValidator::Acceptable)\n            return true;\n    }\n\n    return valid;\n}\n"
  },
  {
    "path": "src/qt/qvalidatedlineedit.h",
    "content": "// Copyright (c) 2011-2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_QVALIDATEDLINEEDIT_H\n#define BITCOIN_QT_QVALIDATEDLINEEDIT_H\n\n#include <QLineEdit>\n\n/** Line edit that can be marked as \"invalid\" to show input validation feedback. When marked as invalid,\n   it will get a red background until it is focused.\n */\nclass QValidatedLineEdit : public QLineEdit\n{\n    Q_OBJECT\n\npublic:\n    explicit QValidatedLineEdit(QWidget *parent);\n    void clear();\n    void setCheckValidator(const QValidator *v);\n    bool isValid();\n\nprotected:\n    void focusInEvent(QFocusEvent *evt);\n    void focusOutEvent(QFocusEvent *evt);\n\nprivate:\n    bool valid;\n    const QValidator *checkValidator;\n\npublic Q_SLOTS:\n    void setValid(bool valid);\n    void setEnabled(bool enabled);\n\nQ_SIGNALS:\n    void validationDidChange(QValidatedLineEdit *validatedLineEdit);\n    \nprivate Q_SLOTS:\n    void markValid();\n    void checkValidity();\n};\n\n#endif // BITCOIN_QT_QVALIDATEDLINEEDIT_H\n"
  },
  {
    "path": "src/qt/qvaluecombobox.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/qvaluecombobox.h>\n\nQValueComboBox::QValueComboBox(QWidget *parent) :\n        QComboBox(parent), role(Qt::UserRole)\n{\n    connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int)));\n}\n\nQVariant QValueComboBox::value() const\n{\n    return itemData(currentIndex(), role);\n}\n\nvoid QValueComboBox::setValue(const QVariant &value)\n{\n    setCurrentIndex(findData(value, role));\n}\n\nvoid QValueComboBox::setRole(int _role)\n{\n    this->role = _role;\n}\n\nvoid QValueComboBox::handleSelectionChanged(int idx)\n{\n    Q_EMIT valueChanged();\n}\n"
  },
  {
    "path": "src/qt/qvaluecombobox.h",
    "content": "// Copyright (c) 2011-2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_QVALUECOMBOBOX_H\n#define BITCOIN_QT_QVALUECOMBOBOX_H\n\n#include <QComboBox>\n#include <QVariant>\n\n/* QComboBox that can be used with QDataWidgetMapper to select ordinal values from a model. */\nclass QValueComboBox : public QComboBox\n{\n    Q_OBJECT\n\n    Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged USER true)\n\npublic:\n    explicit QValueComboBox(QWidget *parent = 0);\n\n    QVariant value() const;\n    void setValue(const QVariant &value);\n\n    /** Specify model role to use as ordinal value (defaults to Qt::UserRole) */\n    void setRole(int role);\n\nQ_SIGNALS:\n    void valueChanged();\n\nprivate:\n    int role;\n\nprivate Q_SLOTS:\n    void handleSelectionChanged(int idx);\n};\n\n#endif // BITCOIN_QT_QVALUECOMBOBOX_H\n"
  },
  {
    "path": "src/qt/receivecoinsdialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/wallet.h>\n\n#include <qt/receivecoinsdialog.h>\n#include <qt/forms/ui_receivecoinsdialog.h>\n\n#include <qt/addressbookpage.h>\n#include <qt/addresstablemodel.h>\n#include <qt/bitcoinunits.h>\n#include <qt/optionsmodel.h>\n#include <qt/platformstyle.h>\n#include <qt/receiverequestdialog.h>\n#include <qt/recentrequeststablemodel.h>\n#include <qt/walletmodel.h>\n\n#include <QAction>\n#include <QCursor>\n#include <QMessageBox>\n#include <QScrollBar>\n#include <QTextDocument>\n\nReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::ReceiveCoinsDialog),\n    columnResizingFixer(0),\n    model(0),\n    platformStyle(_platformStyle)\n{\n    ui->setupUi(this);\n\n    if (!_platformStyle->getImagesOnButtons()) {\n        ui->clearButton->setIcon(QIcon());\n        ui->receiveButton->setIcon(QIcon());\n        ui->showRequestButton->setIcon(QIcon());\n        ui->removeRequestButton->setIcon(QIcon());\n    } else {\n        ui->clearButton->setIcon(_platformStyle->SingleColorIcon(\":/icons/remove\"));\n        ui->receiveButton->setIcon(_platformStyle->SingleColorIcon(\":/icons/receiving_addresses\"));\n        ui->showRequestButton->setIcon(_platformStyle->SingleColorIcon(\":/icons/edit\"));\n        ui->removeRequestButton->setIcon(_platformStyle->SingleColorIcon(\":/icons/remove\"));\n    }\n\n    // context menu actions\n    QAction *copyURIAction = new QAction(tr(\"Copy URI\"), this);\n    QAction *copyLabelAction = new QAction(tr(\"Copy label\"), this);\n    QAction *copyMessageAction = new QAction(tr(\"Copy message\"), this);\n    QAction *copyAmountAction = new QAction(tr(\"Copy amount\"), this);\n\n    // context menu\n    contextMenu = new QMenu(this);\n    contextMenu->addAction(copyURIAction);\n    contextMenu->addAction(copyLabelAction);\n    contextMenu->addAction(copyMessageAction);\n    contextMenu->addAction(copyAmountAction);\n\n    // context menu signals\n    connect(ui->recentRequestsView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showMenu(QPoint)));\n    connect(copyURIAction, SIGNAL(triggered()), this, SLOT(copyURI()));\n    connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));\n    connect(copyMessageAction, SIGNAL(triggered()), this, SLOT(copyMessage()));\n    connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));\n\n    connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear()));\n}\n\nvoid ReceiveCoinsDialog::setModel(WalletModel *_model)\n{\n    this->model = _model;\n\n    if(_model && _model->getOptionsModel())\n    {\n        _model->getRecentRequestsTableModel()->sort(RecentRequestsTableModel::Date, Qt::DescendingOrder);\n        connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));\n        updateDisplayUnit();\n\n        QTableView* tableView = ui->recentRequestsView;\n\n        tableView->verticalHeader()->hide();\n        tableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);\n        tableView->setModel(_model->getRecentRequestsTableModel());\n        tableView->setAlternatingRowColors(true);\n        tableView->setSelectionBehavior(QAbstractItemView::SelectRows);\n        tableView->setSelectionMode(QAbstractItemView::ContiguousSelection);\n        tableView->setColumnWidth(RecentRequestsTableModel::Date, DATE_COLUMN_WIDTH);\n        tableView->setColumnWidth(RecentRequestsTableModel::Label, LABEL_COLUMN_WIDTH);\n        tableView->setColumnWidth(RecentRequestsTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);\n\n        connect(tableView->selectionModel(),\n            SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this,\n            SLOT(recentRequestsView_selectionChanged(QItemSelection, QItemSelection)));\n        // Last 2 columns are set by the columnResizingFixer, when the table geometry is ready.\n        columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(tableView, AMOUNT_MINIMUM_COLUMN_WIDTH, DATE_COLUMN_WIDTH, this);\n\n        if (model->getDefaultAddressType() == OUTPUT_TYPE_BECH32) {\n            ui->useBech32->setCheckState(Qt::Checked);\n        } else {\n            ui->useBech32->setCheckState(Qt::Unchecked);\n        }\n    }\n}\n\nReceiveCoinsDialog::~ReceiveCoinsDialog()\n{\n    delete ui;\n}\n\nvoid ReceiveCoinsDialog::clear()\n{\n    ui->reqAmount->clear();\n    ui->reqLabel->setText(\"\");\n    ui->reqMessage->setText(\"\");\n    updateDisplayUnit();\n}\n\nvoid ReceiveCoinsDialog::reject()\n{\n    clear();\n}\n\nvoid ReceiveCoinsDialog::accept()\n{\n    clear();\n}\n\nvoid ReceiveCoinsDialog::updateDisplayUnit()\n{\n    if(model && model->getOptionsModel())\n    {\n        ui->reqAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());\n    }\n}\n\nvoid ReceiveCoinsDialog::on_receiveButton_clicked()\n{\n    if(!model || !model->getOptionsModel() || !model->getAddressTableModel() || !model->getRecentRequestsTableModel())\n        return;\n\n    QString address;\n    QString label = ui->reqLabel->text();\n    /* Generate new receiving address */\n    OutputType address_type;\n    if (ui->useBech32->isChecked()) {\n        address_type = OUTPUT_TYPE_BECH32;\n    } else {\n        address_type = model->getDefaultAddressType();\n        if (address_type == OUTPUT_TYPE_BECH32) {\n            address_type = OUTPUT_TYPE_P2SH_SEGWIT;\n        }\n    }\n    address = model->getAddressTableModel()->addRow(AddressTableModel::Receive, label, \"\", address_type);\n    SendCoinsRecipient info(address, label,\n        ui->reqAmount->value(), ui->reqMessage->text());\n    ReceiveRequestDialog *dialog = new ReceiveRequestDialog(this);\n    dialog->setAttribute(Qt::WA_DeleteOnClose);\n    dialog->setModel(model->getOptionsModel());\n    dialog->setInfo(info);\n    dialog->show();\n    clear();\n\n    /* Store request for later reference */\n    model->getRecentRequestsTableModel()->addNewRequest(info);\n}\n\nvoid ReceiveCoinsDialog::on_recentRequestsView_doubleClicked(const QModelIndex &index)\n{\n    const RecentRequestsTableModel *submodel = model->getRecentRequestsTableModel();\n    ReceiveRequestDialog *dialog = new ReceiveRequestDialog(this);\n    dialog->setModel(model->getOptionsModel());\n    dialog->setInfo(submodel->entry(index.row()).recipient);\n    dialog->setAttribute(Qt::WA_DeleteOnClose);\n    dialog->show();\n}\n\nvoid ReceiveCoinsDialog::recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)\n{\n    // Enable Show/Remove buttons only if anything is selected.\n    bool enable = !ui->recentRequestsView->selectionModel()->selectedRows().isEmpty();\n    ui->showRequestButton->setEnabled(enable);\n    ui->removeRequestButton->setEnabled(enable);\n}\n\nvoid ReceiveCoinsDialog::on_showRequestButton_clicked()\n{\n    if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())\n        return;\n    QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();\n\n    for (const QModelIndex& index : selection) {\n        on_recentRequestsView_doubleClicked(index);\n    }\n}\n\nvoid ReceiveCoinsDialog::on_removeRequestButton_clicked()\n{\n    if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())\n        return;\n    QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();\n    if(selection.empty())\n        return;\n    // correct for selection mode ContiguousSelection\n    QModelIndex firstIndex = selection.at(0);\n    model->getRecentRequestsTableModel()->removeRows(firstIndex.row(), selection.length(), firstIndex.parent());\n}\n\n// We override the virtual resizeEvent of the QWidget to adjust tables column\n// sizes as the tables width is proportional to the dialogs width.\nvoid ReceiveCoinsDialog::resizeEvent(QResizeEvent *event)\n{\n    QWidget::resizeEvent(event);\n    columnResizingFixer->stretchColumnWidth(RecentRequestsTableModel::Message);\n}\n\nvoid ReceiveCoinsDialog::keyPressEvent(QKeyEvent *event)\n{\n    if (event->key() == Qt::Key_Return)\n    {\n        // press return -> submit form\n        if (ui->reqLabel->hasFocus() || ui->reqAmount->hasFocus() || ui->reqMessage->hasFocus())\n        {\n            event->ignore();\n            on_receiveButton_clicked();\n            return;\n        }\n    }\n\n    this->QDialog::keyPressEvent(event);\n}\n\nQModelIndex ReceiveCoinsDialog::selectedRow()\n{\n    if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())\n        return QModelIndex();\n    QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();\n    if(selection.empty())\n        return QModelIndex();\n    // correct for selection mode ContiguousSelection\n    QModelIndex firstIndex = selection.at(0);\n    return firstIndex;\n}\n\n// copy column of selected row to clipboard\nvoid ReceiveCoinsDialog::copyColumnToClipboard(int column)\n{\n    QModelIndex firstIndex = selectedRow();\n    if (!firstIndex.isValid()) {\n        return;\n    }\n    GUIUtil::setClipboard(model->getRecentRequestsTableModel()->data(firstIndex.child(firstIndex.row(), column), Qt::EditRole).toString());\n}\n\n// context menu\nvoid ReceiveCoinsDialog::showMenu(const QPoint &point)\n{\n    if (!selectedRow().isValid()) {\n        return;\n    }\n    contextMenu->exec(QCursor::pos());\n}\n\n// context menu action: copy URI\nvoid ReceiveCoinsDialog::copyURI()\n{\n    QModelIndex sel = selectedRow();\n    if (!sel.isValid()) {\n        return;\n    }\n\n    const RecentRequestsTableModel * const submodel = model->getRecentRequestsTableModel();\n    const QString uri = GUIUtil::formatBitcoinURI(submodel->entry(sel.row()).recipient);\n    GUIUtil::setClipboard(uri);\n}\n\n// context menu action: copy label\nvoid ReceiveCoinsDialog::copyLabel()\n{\n    copyColumnToClipboard(RecentRequestsTableModel::Label);\n}\n\n// context menu action: copy message\nvoid ReceiveCoinsDialog::copyMessage()\n{\n    copyColumnToClipboard(RecentRequestsTableModel::Message);\n}\n\n// context menu action: copy amount\nvoid ReceiveCoinsDialog::copyAmount()\n{\n    copyColumnToClipboard(RecentRequestsTableModel::Amount);\n}\n"
  },
  {
    "path": "src/qt/receivecoinsdialog.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_RECEIVECOINSDIALOG_H\n#define BITCOIN_QT_RECEIVECOINSDIALOG_H\n\n#include <qt/guiutil.h>\n\n#include <QDialog>\n#include <QHeaderView>\n#include <QItemSelection>\n#include <QKeyEvent>\n#include <QMenu>\n#include <QPoint>\n#include <QVariant>\n\nclass PlatformStyle;\nclass WalletModel;\n\nnamespace Ui {\n    class ReceiveCoinsDialog;\n}\n\nQT_BEGIN_NAMESPACE\nclass QModelIndex;\nQT_END_NAMESPACE\n\n/** Dialog for requesting payment of bitcoins */\nclass ReceiveCoinsDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    enum ColumnWidths {\n        DATE_COLUMN_WIDTH = 139, // FIXME.SUGAR // was 130\n        LABEL_COLUMN_WIDTH = 120,\n        AMOUNT_MINIMUM_COLUMN_WIDTH = 180,\n        MINIMUM_COLUMN_WIDTH = 130\n    };\n\n    explicit ReceiveCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);\n    ~ReceiveCoinsDialog();\n\n    void setModel(WalletModel *model);\n\npublic Q_SLOTS:\n    void clear();\n    void reject();\n    void accept();\n\nprotected:\n    virtual void keyPressEvent(QKeyEvent *event);\n\nprivate:\n    Ui::ReceiveCoinsDialog *ui;\n    GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;\n    WalletModel *model;\n    QMenu *contextMenu;\n    const PlatformStyle *platformStyle;\n\n    QModelIndex selectedRow();\n    void copyColumnToClipboard(int column);\n    virtual void resizeEvent(QResizeEvent *event);\n\nprivate Q_SLOTS:\n    void on_receiveButton_clicked();\n    void on_showRequestButton_clicked();\n    void on_removeRequestButton_clicked();\n    void on_recentRequestsView_doubleClicked(const QModelIndex &index);\n    void recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);\n    void updateDisplayUnit();\n    void showMenu(const QPoint &point);\n    void copyURI();\n    void copyLabel();\n    void copyMessage();\n    void copyAmount();\n};\n\n#endif // BITCOIN_QT_RECEIVECOINSDIALOG_H\n"
  },
  {
    "path": "src/qt/receiverequestdialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/receiverequestdialog.h>\n#include <qt/forms/ui_receiverequestdialog.h>\n\n#include <qt/bitcoinunits.h>\n#include <qt/guiconstants.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n\n#include <QClipboard>\n#include <QDrag>\n#include <QMenu>\n#include <QMimeData>\n#include <QMouseEvent>\n#include <QPixmap>\n#if QT_VERSION < 0x050000\n#include <QUrl>\n#endif\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h> /* for USE_QRCODE */\n#endif\n\n#ifdef USE_QRCODE\n#include <qrencode.h>\n#endif\n\nQRImageWidget::QRImageWidget(QWidget *parent):\n    QLabel(parent), contextMenu(0)\n{\n    contextMenu = new QMenu(this);\n    QAction *saveImageAction = new QAction(tr(\"&Save Image...\"), this);\n    connect(saveImageAction, SIGNAL(triggered()), this, SLOT(saveImage()));\n    contextMenu->addAction(saveImageAction);\n    QAction *copyImageAction = new QAction(tr(\"&Copy Image\"), this);\n    connect(copyImageAction, SIGNAL(triggered()), this, SLOT(copyImage()));\n    contextMenu->addAction(copyImageAction);\n}\n\nQImage QRImageWidget::exportImage()\n{\n    if(!pixmap())\n        return QImage();\n    return pixmap()->toImage();\n}\n\nvoid QRImageWidget::mousePressEvent(QMouseEvent *event)\n{\n    if(event->button() == Qt::LeftButton && pixmap())\n    {\n        event->accept();\n        QMimeData *mimeData = new QMimeData;\n        mimeData->setImageData(exportImage());\n\n        QDrag *drag = new QDrag(this);\n        drag->setMimeData(mimeData);\n        drag->exec();\n    } else {\n        QLabel::mousePressEvent(event);\n    }\n}\n\nvoid QRImageWidget::saveImage()\n{\n    if(!pixmap())\n        return;\n    QString fn = GUIUtil::getSaveFileName(this, tr(\"Save QR Code\"), QString(), tr(\"PNG Image (*.png)\"), nullptr);\n    if (!fn.isEmpty())\n    {\n        exportImage().save(fn);\n    }\n}\n\nvoid QRImageWidget::copyImage()\n{\n    if(!pixmap())\n        return;\n    QApplication::clipboard()->setImage(exportImage());\n}\n\nvoid QRImageWidget::contextMenuEvent(QContextMenuEvent *event)\n{\n    if(!pixmap())\n        return;\n    contextMenu->exec(event->globalPos());\n}\n\nReceiveRequestDialog::ReceiveRequestDialog(QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::ReceiveRequestDialog),\n    model(0)\n{\n    ui->setupUi(this);\n\n#ifndef USE_QRCODE\n    ui->btnSaveAs->setVisible(false);\n    ui->lblQRCode->setVisible(false);\n#endif\n\n    connect(ui->btnSaveAs, SIGNAL(clicked()), ui->lblQRCode, SLOT(saveImage()));\n}\n\nReceiveRequestDialog::~ReceiveRequestDialog()\n{\n    delete ui;\n}\n\nvoid ReceiveRequestDialog::setModel(OptionsModel *_model)\n{\n    this->model = _model;\n\n    if (_model)\n        connect(_model, SIGNAL(displayUnitChanged(int)), this, SLOT(update()));\n\n    // update the display unit if necessary\n    update();\n}\n\nvoid ReceiveRequestDialog::setInfo(const SendCoinsRecipient &_info)\n{\n    this->info = _info;\n    update();\n}\n\nvoid ReceiveRequestDialog::update()\n{\n    if(!model)\n        return;\n    QString target = info.label;\n    if(target.isEmpty())\n        target = info.address;\n    setWindowTitle(tr(\"Request payment to %1\").arg(target));\n\n    QString uri = GUIUtil::formatBitcoinURI(info);\n    ui->btnSaveAs->setEnabled(false);\n    QString html;\n    html += \"<html><font face='verdana, arial, helvetica, sans-serif'>\";\n    html += \"<b>\"+tr(\"Payment information\")+\"</b><br>\";\n    html += \"<b>\"+tr(\"URI\")+\"</b>: \";\n    html += \"<a href=\\\"\"+uri+\"\\\">\" + GUIUtil::HtmlEscape(uri) + \"</a><br>\";\n    html += \"<b>\"+tr(\"Address\")+\"</b>: \" + GUIUtil::HtmlEscape(info.address) + \"<br>\";\n    if(info.amount)\n        html += \"<b>\"+tr(\"Amount\")+\"</b>: \" + BitcoinUnits::formatHtmlWithUnit(model->getDisplayUnit(), info.amount) + \"<br>\";\n    if(!info.label.isEmpty())\n        html += \"<b>\"+tr(\"Label\")+\"</b>: \" + GUIUtil::HtmlEscape(info.label) + \"<br>\";\n    if(!info.message.isEmpty())\n        html += \"<b>\"+tr(\"Message\")+\"</b>: \" + GUIUtil::HtmlEscape(info.message) + \"<br>\";\n    ui->outUri->setText(html);\n\n#ifdef USE_QRCODE\n    ui->lblQRCode->setText(\"\");\n    if(!uri.isEmpty())\n    {\n        // limit URI length\n        if (uri.length() > MAX_URI_LENGTH)\n        {\n            ui->lblQRCode->setText(tr(\"Resulting URI too long, try to reduce the text for label / message.\"));\n        } else {\n            QRcode *code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1);\n            if (!code)\n            {\n                ui->lblQRCode->setText(tr(\"Error encoding URI into QR Code.\"));\n                return;\n            }\n            QImage qrImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32);\n            qrImage.fill(0xffffff);\n            unsigned char *p = code->data;\n            for (int y = 0; y < code->width; y++)\n            {\n                for (int x = 0; x < code->width; x++)\n                {\n                    qrImage.setPixel(x + 4, y + 4, ((*p & 1) ? 0x0 : 0xffffff));\n                    p++;\n                }\n            }\n            QRcode_free(code);\n\n            QImage qrAddrImage = QImage(QR_IMAGE_SIZE, QR_IMAGE_SIZE+20, QImage::Format_RGB32);\n            qrAddrImage.fill(0xffffff);\n            QPainter painter(&qrAddrImage);\n            painter.drawImage(0, 0, qrImage.scaled(QR_IMAGE_SIZE, QR_IMAGE_SIZE));\n            QFont font = GUIUtil::fixedPitchFont();\n            QRect paddedRect = qrAddrImage.rect();\n\n            // calculate ideal font size\n            qreal font_size = GUIUtil::calculateIdealFontSize(paddedRect.width() - 20, info.address, font);\n            font.setPointSizeF(font_size);\n\n            painter.setFont(font);\n            paddedRect.setHeight(QR_IMAGE_SIZE+12);\n            painter.drawText(paddedRect, Qt::AlignBottom|Qt::AlignCenter, info.address);\n            painter.end();\n\n            ui->lblQRCode->setPixmap(QPixmap::fromImage(qrAddrImage));\n            ui->btnSaveAs->setEnabled(true);\n        }\n    }\n#endif\n}\n\nvoid ReceiveRequestDialog::on_btnCopyURI_clicked()\n{\n    GUIUtil::setClipboard(GUIUtil::formatBitcoinURI(info));\n}\n\nvoid ReceiveRequestDialog::on_btnCopyAddress_clicked()\n{\n    GUIUtil::setClipboard(info.address);\n}\n"
  },
  {
    "path": "src/qt/receiverequestdialog.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_RECEIVEREQUESTDIALOG_H\n#define BITCOIN_QT_RECEIVEREQUESTDIALOG_H\n\n#include <qt/walletmodel.h>\n\n#include <QDialog>\n#include <QImage>\n#include <QLabel>\n#include <QPainter>\n\nclass OptionsModel;\n\nnamespace Ui {\n    class ReceiveRequestDialog;\n}\n\nQT_BEGIN_NAMESPACE\nclass QMenu;\nQT_END_NAMESPACE\n\n/* Label widget for QR code. This image can be dragged, dropped, copied and saved\n * to disk.\n */\nclass QRImageWidget : public QLabel\n{\n    Q_OBJECT\n\npublic:\n    explicit QRImageWidget(QWidget *parent = 0);\n    QImage exportImage();\n\npublic Q_SLOTS:\n    void saveImage();\n    void copyImage();\n\nprotected:\n    virtual void mousePressEvent(QMouseEvent *event);\n    virtual void contextMenuEvent(QContextMenuEvent *event);\n\nprivate:\n    QMenu *contextMenu;\n};\n\nclass ReceiveRequestDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit ReceiveRequestDialog(QWidget *parent = 0);\n    ~ReceiveRequestDialog();\n\n    void setModel(OptionsModel *model);\n    void setInfo(const SendCoinsRecipient &info);\n\nprivate Q_SLOTS:\n    void on_btnCopyURI_clicked();\n    void on_btnCopyAddress_clicked();\n\n    void update();\n\nprivate:\n    Ui::ReceiveRequestDialog *ui;\n    OptionsModel *model;\n    SendCoinsRecipient info;\n};\n\n#endif // BITCOIN_QT_RECEIVEREQUESTDIALOG_H\n"
  },
  {
    "path": "src/qt/recentrequeststablemodel.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/recentrequeststablemodel.h>\n\n#include <qt/bitcoinunits.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n\n#include <clientversion.h>\n#include <streams.h>\n\n\nRecentRequestsTableModel::RecentRequestsTableModel(CWallet *wallet, WalletModel *parent) :\n    QAbstractTableModel(parent), walletModel(parent)\n{\n    Q_UNUSED(wallet);\n    nReceiveRequestsMaxId = 0;\n\n    // Load entries from wallet\n    std::vector<std::string> vReceiveRequests;\n    parent->loadReceiveRequests(vReceiveRequests);\n    for (const std::string& request : vReceiveRequests)\n        addNewRequest(request);\n\n    /* These columns must match the indices in the ColumnIndex enumeration */\n    columns << tr(\"Date\") << tr(\"Label\") << tr(\"Message\") << getAmountTitle();\n\n    connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));\n}\n\nRecentRequestsTableModel::~RecentRequestsTableModel()\n{\n    /* Intentionally left empty */\n}\n\nint RecentRequestsTableModel::rowCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n\n    return list.length();\n}\n\nint RecentRequestsTableModel::columnCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n\n    return columns.length();\n}\n\nQVariant RecentRequestsTableModel::data(const QModelIndex &index, int role) const\n{\n    if(!index.isValid() || index.row() >= list.length())\n        return QVariant();\n\n    if(role == Qt::DisplayRole || role == Qt::EditRole)\n    {\n        const RecentRequestEntry *rec = &list[index.row()];\n        switch(index.column())\n        {\n        case Date:\n            return GUIUtil::dateTimeStr(rec->date);\n        case Label:\n            if(rec->recipient.label.isEmpty() && role == Qt::DisplayRole)\n            {\n                return tr(\"(no label)\");\n            }\n            else\n            {\n                return rec->recipient.label;\n            }\n        case Message:\n            if(rec->recipient.message.isEmpty() && role == Qt::DisplayRole)\n            {\n                return tr(\"(no message)\");\n            }\n            else\n            {\n                return rec->recipient.message;\n            }\n        case Amount:\n            if (rec->recipient.amount == 0 && role == Qt::DisplayRole)\n                return tr(\"(no amount requested)\");\n            else if (role == Qt::EditRole)\n                return BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), rec->recipient.amount, false, BitcoinUnits::separatorNever);\n            else\n                return BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), rec->recipient.amount);\n        }\n    }\n    else if (role == Qt::TextAlignmentRole)\n    {\n        if (index.column() == Amount)\n            return (int)(Qt::AlignRight|Qt::AlignVCenter);\n    }\n    return QVariant();\n}\n\nbool RecentRequestsTableModel::setData(const QModelIndex &index, const QVariant &value, int role)\n{\n    return true;\n}\n\nQVariant RecentRequestsTableModel::headerData(int section, Qt::Orientation orientation, int role) const\n{\n    if(orientation == Qt::Horizontal)\n    {\n        if(role == Qt::DisplayRole && section < columns.size())\n        {\n            return columns[section];\n        }\n    }\n    return QVariant();\n}\n\n/** Updates the column title to \"Amount (DisplayUnit)\" and emits headerDataChanged() signal for table headers to react. */\nvoid RecentRequestsTableModel::updateAmountColumnTitle()\n{\n    columns[Amount] = getAmountTitle();\n    Q_EMIT headerDataChanged(Qt::Horizontal,Amount,Amount);\n}\n\n/** Gets title for amount column including current display unit if optionsModel reference available. */\nQString RecentRequestsTableModel::getAmountTitle()\n{\n    return (this->walletModel->getOptionsModel() != nullptr) ? tr(\"Requested\") + \" (\"+BitcoinUnits::shortName(this->walletModel->getOptionsModel()->getDisplayUnit()) + \")\" : \"\";\n}\n\nQModelIndex RecentRequestsTableModel::index(int row, int column, const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n\n    return createIndex(row, column);\n}\n\nbool RecentRequestsTableModel::removeRows(int row, int count, const QModelIndex &parent)\n{\n    Q_UNUSED(parent);\n\n    if(count > 0 && row >= 0 && (row+count) <= list.size())\n    {\n        const RecentRequestEntry *rec;\n        for (int i = 0; i < count; ++i)\n        {\n            rec = &list[row+i];\n            if (!walletModel->saveReceiveRequest(rec->recipient.address.toStdString(), rec->id, \"\"))\n                return false;\n        }\n\n        beginRemoveRows(parent, row, row + count - 1);\n        list.erase(list.begin() + row, list.begin() + row + count);\n        endRemoveRows();\n        return true;\n    } else {\n        return false;\n    }\n}\n\nQt::ItemFlags RecentRequestsTableModel::flags(const QModelIndex &index) const\n{\n    return Qt::ItemIsSelectable | Qt::ItemIsEnabled;\n}\n\n// called when adding a request from the GUI\nvoid RecentRequestsTableModel::addNewRequest(const SendCoinsRecipient &recipient)\n{\n    RecentRequestEntry newEntry;\n    newEntry.id = ++nReceiveRequestsMaxId;\n    newEntry.date = QDateTime::currentDateTime();\n    newEntry.recipient = recipient;\n\n    CDataStream ss(SER_DISK, CLIENT_VERSION);\n    ss << newEntry;\n\n    if (!walletModel->saveReceiveRequest(recipient.address.toStdString(), newEntry.id, ss.str()))\n        return;\n\n    addNewRequest(newEntry);\n}\n\n// called from ctor when loading from wallet\nvoid RecentRequestsTableModel::addNewRequest(const std::string &recipient)\n{\n    std::vector<char> data(recipient.begin(), recipient.end());\n    CDataStream ss(data, SER_DISK, CLIENT_VERSION);\n\n    RecentRequestEntry entry;\n    ss >> entry;\n\n    if (entry.id == 0) // should not happen\n        return;\n\n    if (entry.id > nReceiveRequestsMaxId)\n        nReceiveRequestsMaxId = entry.id;\n\n    addNewRequest(entry);\n}\n\n// actually add to table in GUI\nvoid RecentRequestsTableModel::addNewRequest(RecentRequestEntry &recipient)\n{\n    beginInsertRows(QModelIndex(), 0, 0);\n    list.prepend(recipient);\n    endInsertRows();\n}\n\nvoid RecentRequestsTableModel::sort(int column, Qt::SortOrder order)\n{\n    qSort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order));\n    Q_EMIT dataChanged(index(0, 0, QModelIndex()), index(list.size() - 1, NUMBER_OF_COLUMNS - 1, QModelIndex()));\n}\n\nvoid RecentRequestsTableModel::updateDisplayUnit()\n{\n    updateAmountColumnTitle();\n}\n\nbool RecentRequestEntryLessThan::operator()(RecentRequestEntry &left, RecentRequestEntry &right) const\n{\n    RecentRequestEntry *pLeft = &left;\n    RecentRequestEntry *pRight = &right;\n    if (order == Qt::DescendingOrder)\n        std::swap(pLeft, pRight);\n\n    switch(column)\n    {\n    case RecentRequestsTableModel::Date:\n        return pLeft->date.toTime_t() < pRight->date.toTime_t();\n    case RecentRequestsTableModel::Label:\n        return pLeft->recipient.label < pRight->recipient.label;\n    case RecentRequestsTableModel::Message:\n        return pLeft->recipient.message < pRight->recipient.message;\n    case RecentRequestsTableModel::Amount:\n        return pLeft->recipient.amount < pRight->recipient.amount;\n    default:\n        return pLeft->id < pRight->id;\n    }\n}\n"
  },
  {
    "path": "src/qt/recentrequeststablemodel.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_RECENTREQUESTSTABLEMODEL_H\n#define BITCOIN_QT_RECENTREQUESTSTABLEMODEL_H\n\n#include <qt/walletmodel.h>\n\n#include <QAbstractTableModel>\n#include <QStringList>\n#include <QDateTime>\n\nclass CWallet;\n\nclass RecentRequestEntry\n{\npublic:\n    RecentRequestEntry() : nVersion(RecentRequestEntry::CURRENT_VERSION), id(0) { }\n\n    static const int CURRENT_VERSION = 1;\n    int nVersion;\n    int64_t id;\n    QDateTime date;\n    SendCoinsRecipient recipient;\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        unsigned int nDate = date.toTime_t();\n\n        READWRITE(this->nVersion);\n        READWRITE(id);\n        READWRITE(nDate);\n        READWRITE(recipient);\n\n        if (ser_action.ForRead())\n            date = QDateTime::fromTime_t(nDate);\n    }\n};\n\nclass RecentRequestEntryLessThan\n{\npublic:\n    RecentRequestEntryLessThan(int nColumn, Qt::SortOrder fOrder):\n        column(nColumn), order(fOrder) {}\n    bool operator()(RecentRequestEntry &left, RecentRequestEntry &right) const;\n\nprivate:\n    int column;\n    Qt::SortOrder order;\n};\n\n/** Model for list of recently generated payment requests / bitcoin: URIs.\n * Part of wallet model.\n */\nclass RecentRequestsTableModel: public QAbstractTableModel\n{\n    Q_OBJECT\n\npublic:\n    explicit RecentRequestsTableModel(CWallet *wallet, WalletModel *parent);\n    ~RecentRequestsTableModel();\n\n    enum ColumnIndex {\n        Date = 0,\n        Label = 1,\n        Message = 2,\n        Amount = 3,\n        NUMBER_OF_COLUMNS\n    };\n\n    /** @name Methods overridden from QAbstractTableModel\n        @{*/\n    int rowCount(const QModelIndex &parent) const;\n    int columnCount(const QModelIndex &parent) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    bool setData(const QModelIndex &index, const QVariant &value, int role);\n    QVariant headerData(int section, Qt::Orientation orientation, int role) const;\n    QModelIndex index(int row, int column, const QModelIndex &parent) const;\n    bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());\n    Qt::ItemFlags flags(const QModelIndex &index) const;\n    /*@}*/\n\n    const RecentRequestEntry &entry(int row) const { return list[row]; }\n    void addNewRequest(const SendCoinsRecipient &recipient);\n    void addNewRequest(const std::string &recipient);\n    void addNewRequest(RecentRequestEntry &recipient);\n\npublic Q_SLOTS:\n    void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);\n    void updateDisplayUnit();\n\nprivate:\n    WalletModel *walletModel;\n    QStringList columns;\n    QList<RecentRequestEntry> list;\n    int64_t nReceiveRequestsMaxId;\n\n    /** Updates the column title to \"Amount (DisplayUnit)\" and emits headerDataChanged() signal for table headers to react. */\n    void updateAmountColumnTitle();\n    /** Gets title for amount column including current display unit if optionsModel reference available. */\n    QString getAmountTitle();\n};\n\n#endif // BITCOIN_QT_RECENTREQUESTSTABLEMODEL_H\n"
  },
  {
    "path": "src/qt/res/bitcoin-qt-res.rc",
    "content": "IDI_ICON1 ICON DISCARDABLE \"icons/bitcoin.ico\"\nIDI_ICON2 ICON DISCARDABLE \"icons/bitcoin_testnet.ico\"\n\n#include <windows.h>             // needed for VERSIONINFO\n#include \"../../clientversion.h\" // holds the needed client version information\n\n#define VER_PRODUCTVERSION     CLIENT_VERSION_MAJOR,CLIENT_VERSION_MINOR,CLIENT_VERSION_REVISION,CLIENT_VERSION_BUILD\n#define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) \".\" STRINGIZE(CLIENT_VERSION_MINOR) \".\" STRINGIZE(CLIENT_VERSION_REVISION) \".\" STRINGIZE(CLIENT_VERSION_BUILD)\n#define VER_FILEVERSION        VER_PRODUCTVERSION\n#define VER_FILEVERSION_STR    VER_PRODUCTVERSION_STR\n\nVS_VERSION_INFO VERSIONINFO\nFILEVERSION     VER_FILEVERSION\nPRODUCTVERSION  VER_PRODUCTVERSION\nFILEOS          VOS_NT_WINDOWS32\nFILETYPE        VFT_APP\nBEGIN\n    BLOCK \"StringFileInfo\"\n    BEGIN\n        BLOCK \"040904E4\" // U.S. English - multilingual (hex)\n        BEGIN\n            VALUE \"CompanyName\",        \"Sugarchain\"\n            VALUE \"FileDescription\",    PACKAGE_NAME \" (GUI node for Sugarchain)\"\n            VALUE \"FileVersion\",        VER_FILEVERSION_STR\n            VALUE \"InternalName\",       \"sugarchain-qt\"\n            VALUE \"LegalCopyright\",     COPYRIGHT_STR\n            VALUE \"LegalTrademarks1\",   \"Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.\"\n            VALUE \"OriginalFilename\",   \"sugarchain-qt.exe\"\n            VALUE \"ProductName\",        PACKAGE_NAME\n            VALUE \"ProductVersion\",     VER_PRODUCTVERSION_STR\n        END\n    END\n\n    BLOCK \"VarFileInfo\"\n    BEGIN\n        VALUE \"Translation\", 0x0, 1252 // language neutral - multilingual (decimal)\n    END\nEND\n"
  },
  {
    "path": "src/qt/res/movies/makespinner.sh",
    "content": "# Copyright (c) 2014-2015 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nFRAMEDIR=$(dirname $0)\nfor i in {0..35}\ndo\n    frame=$(printf \"%03d\" $i)\n    angle=$(($i * 10))\n    convert $FRAMEDIR/../src/spinner.png -background \"rgba(0,0,0,0.0)\" -distort SRT $angle $FRAMEDIR/spinner-$frame.png\ndone\n"
  },
  {
    "path": "src/qt/rpcconsole.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <qt/rpcconsole.h>\n#include <qt/forms/ui_debugwindow.h>\n\n#include <qt/bantablemodel.h>\n#include <qt/clientmodel.h>\n#include <qt/platformstyle.h>\n#include <chainparams.h>\n#include <netbase.h>\n#include <rpc/server.h>\n#include <rpc/client.h>\n#include <util.h>\n\n#include <openssl/crypto.h>\n\n#include <univalue.h>\n\n#ifdef ENABLE_WALLET\n#include <db_cxx.h>\n#include <wallet/wallet.h>\n#endif\n\n#include <QDesktopWidget>\n#include <QKeyEvent>\n#include <QMenu>\n#include <QMessageBox>\n#include <QScrollBar>\n#include <QSettings>\n#include <QSignalMapper>\n#include <QTime>\n#include <QTimer>\n#include <QStringList>\n\n#if QT_VERSION < 0x050000\n#include <QUrl>\n#endif\n\n// TODO: add a scrollback limit, as there is currently none\n// TODO: make it possible to filter out categories (esp debug messages when implemented)\n// TODO: receive errors and debug messages through ClientModel\n\nconst int CONSOLE_HISTORY = 50;\nconst int INITIAL_TRAFFIC_GRAPH_MINS = 30;\nconst QSize FONT_RANGE(4, 40);\nconst char fontSizeSettingsKey[] = \"consoleFontSize\";\n\nconst struct {\n    const char *url;\n    const char *source;\n} ICON_MAPPING[] = {\n    {\"cmd-request\", \":/icons/tx_input\"},\n    {\"cmd-reply\", \":/icons/tx_output\"},\n    {\"cmd-error\", \":/icons/tx_output\"},\n    {\"misc\", \":/icons/tx_inout\"},\n    {nullptr, nullptr}\n};\n\nnamespace {\n\n// don't add private key handling cmd's to the history\nconst QStringList historyFilter = QStringList()\n    << \"importprivkey\"\n    << \"importmulti\"\n    << \"signmessagewithprivkey\"\n    << \"signrawtransaction\"\n    << \"walletpassphrase\"\n    << \"walletpassphrasechange\"\n    << \"encryptwallet\";\n\n}\n\n/* Object for executing console RPC commands in a separate thread.\n*/\nclass RPCExecutor : public QObject\n{\n    Q_OBJECT\n\npublic Q_SLOTS:\n    void request(const QString &command);\n\nQ_SIGNALS:\n    void reply(int category, const QString &command);\n};\n\n/** Class for handling RPC timers\n * (used for e.g. re-locking the wallet after a timeout)\n */\nclass QtRPCTimerBase: public QObject, public RPCTimerBase\n{\n    Q_OBJECT\npublic:\n    QtRPCTimerBase(std::function<void(void)>& _func, int64_t millis):\n        func(_func)\n    {\n        timer.setSingleShot(true);\n        connect(&timer, SIGNAL(timeout()), this, SLOT(timeout()));\n        timer.start(millis);\n    }\n    ~QtRPCTimerBase() {}\nprivate Q_SLOTS:\n    void timeout() { func(); }\nprivate:\n    QTimer timer;\n    std::function<void(void)> func;\n};\n\nclass QtRPCTimerInterface: public RPCTimerInterface\n{\npublic:\n    ~QtRPCTimerInterface() {}\n    const char *Name() { return \"Qt\"; }\n    RPCTimerBase* NewTimer(std::function<void(void)>& func, int64_t millis)\n    {\n        return new QtRPCTimerBase(func, millis);\n    }\n};\n\n\n#include <qt/rpcconsole.moc>\n\n/**\n * Split shell command line into a list of arguments and optionally execute the command(s).\n * Aims to emulate \\c bash and friends.\n *\n * - Command nesting is possible with parenthesis; for example: validateaddress(getnewaddress())\n * - Arguments are delimited with whitespace or comma\n * - Extra whitespace at the beginning and end and between arguments will be ignored\n * - Text can be \"double\" or 'single' quoted\n * - The backslash \\c \\ is used as escape character\n *   - Outside quotes, any character can be escaped\n *   - Within double quotes, only escape \\c \" and backslashes before a \\c \" or another backslash\n *   - Within single quotes, no escaping is possible and no special interpretation takes place\n *\n * @param[out]   result      stringified Result from the executed command(chain)\n * @param[in]    strCommand  Command line to split\n * @param[in]    fExecute    set true if you want the command to be executed\n * @param[out]   pstrFilteredOut  Command line, filtered to remove any sensitive data\n */\n\nbool RPCConsole::RPCParseCommandLine(std::string &strResult, const std::string &strCommand, const bool fExecute, std::string * const pstrFilteredOut)\n{\n    std::vector< std::vector<std::string> > stack;\n    stack.push_back(std::vector<std::string>());\n\n    enum CmdParseState\n    {\n        STATE_EATING_SPACES,\n        STATE_EATING_SPACES_IN_ARG,\n        STATE_EATING_SPACES_IN_BRACKETS,\n        STATE_ARGUMENT,\n        STATE_SINGLEQUOTED,\n        STATE_DOUBLEQUOTED,\n        STATE_ESCAPE_OUTER,\n        STATE_ESCAPE_DOUBLEQUOTED,\n        STATE_COMMAND_EXECUTED,\n        STATE_COMMAND_EXECUTED_INNER\n    } state = STATE_EATING_SPACES;\n    std::string curarg;\n    UniValue lastResult;\n    unsigned nDepthInsideSensitive = 0;\n    size_t filter_begin_pos = 0, chpos;\n    std::vector<std::pair<size_t, size_t>> filter_ranges;\n\n    auto add_to_current_stack = [&](const std::string& strArg) {\n        if (stack.back().empty() && (!nDepthInsideSensitive) && historyFilter.contains(QString::fromStdString(strArg), Qt::CaseInsensitive)) {\n            nDepthInsideSensitive = 1;\n            filter_begin_pos = chpos;\n        }\n        // Make sure stack is not empty before adding something\n        if (stack.empty()) {\n            stack.push_back(std::vector<std::string>());\n        }\n        stack.back().push_back(strArg);\n    };\n\n    auto close_out_params = [&]() {\n        if (nDepthInsideSensitive) {\n            if (!--nDepthInsideSensitive) {\n                assert(filter_begin_pos);\n                filter_ranges.push_back(std::make_pair(filter_begin_pos, chpos));\n                filter_begin_pos = 0;\n            }\n        }\n        stack.pop_back();\n    };\n\n    std::string strCommandTerminated = strCommand;\n    if (strCommandTerminated.back() != '\\n')\n        strCommandTerminated += \"\\n\";\n    for (chpos = 0; chpos < strCommandTerminated.size(); ++chpos)\n    {\n        char ch = strCommandTerminated[chpos];\n        switch(state)\n        {\n            case STATE_COMMAND_EXECUTED_INNER:\n            case STATE_COMMAND_EXECUTED:\n            {\n                bool breakParsing = true;\n                switch(ch)\n                {\n                    case '[': curarg.clear(); state = STATE_COMMAND_EXECUTED_INNER; break;\n                    default:\n                        if (state == STATE_COMMAND_EXECUTED_INNER)\n                        {\n                            if (ch != ']')\n                            {\n                                // append char to the current argument (which is also used for the query command)\n                                curarg += ch;\n                                break;\n                            }\n                            if (curarg.size() && fExecute)\n                            {\n                                // if we have a value query, query arrays with index and objects with a string key\n                                UniValue subelement;\n                                if (lastResult.isArray())\n                                {\n                                    for(char argch: curarg)\n                                        if (!std::isdigit(argch))\n                                            throw std::runtime_error(\"Invalid result query\");\n                                    subelement = lastResult[atoi(curarg.c_str())];\n                                }\n                                else if (lastResult.isObject())\n                                    subelement = find_value(lastResult, curarg);\n                                else\n                                    throw std::runtime_error(\"Invalid result query\"); //no array or object: abort\n                                lastResult = subelement;\n                            }\n\n                            state = STATE_COMMAND_EXECUTED;\n                            break;\n                        }\n                        // don't break parsing when the char is required for the next argument\n                        breakParsing = false;\n\n                        // pop the stack and return the result to the current command arguments\n                        close_out_params();\n\n                        // don't stringify the json in case of a string to avoid doublequotes\n                        if (lastResult.isStr())\n                            curarg = lastResult.get_str();\n                        else\n                            curarg = lastResult.write(2);\n\n                        // if we have a non empty result, use it as stack argument otherwise as general result\n                        if (curarg.size())\n                        {\n                            if (stack.size())\n                                add_to_current_stack(curarg);\n                            else\n                                strResult = curarg;\n                        }\n                        curarg.clear();\n                        // assume eating space state\n                        state = STATE_EATING_SPACES;\n                }\n                if (breakParsing)\n                    break;\n            }\n            case STATE_ARGUMENT: // In or after argument\n            case STATE_EATING_SPACES_IN_ARG:\n            case STATE_EATING_SPACES_IN_BRACKETS:\n            case STATE_EATING_SPACES: // Handle runs of whitespace\n                switch(ch)\n            {\n                case '\"': state = STATE_DOUBLEQUOTED; break;\n                case '\\'': state = STATE_SINGLEQUOTED; break;\n                case '\\\\': state = STATE_ESCAPE_OUTER; break;\n                case '(': case ')': case '\\n':\n                    if (state == STATE_EATING_SPACES_IN_ARG)\n                        throw std::runtime_error(\"Invalid Syntax\");\n                    if (state == STATE_ARGUMENT)\n                    {\n                        if (ch == '(' && stack.size() && stack.back().size() > 0)\n                        {\n                            if (nDepthInsideSensitive) {\n                                ++nDepthInsideSensitive;\n                            }\n                            stack.push_back(std::vector<std::string>());\n                        }\n\n                        // don't allow commands after executed commands on baselevel\n                        if (!stack.size())\n                            throw std::runtime_error(\"Invalid Syntax\");\n\n                        add_to_current_stack(curarg);\n                        curarg.clear();\n                        state = STATE_EATING_SPACES_IN_BRACKETS;\n                    }\n                    if ((ch == ')' || ch == '\\n') && stack.size() > 0)\n                    {\n                        if (fExecute) {\n                            // Convert argument list to JSON objects in method-dependent way,\n                            // and pass it along with the method name to the dispatcher.\n                            JSONRPCRequest req;\n                            req.params = RPCConvertValues(stack.back()[0], std::vector<std::string>(stack.back().begin() + 1, stack.back().end()));\n                            req.strMethod = stack.back()[0];\n#ifdef ENABLE_WALLET\n                            // TODO: Move this logic to WalletModel\n                            if (!vpwallets.empty()) {\n                                // in Qt, use always the wallet with index 0 when running with multiple wallets\n                                QByteArray encodedName = QUrl::toPercentEncoding(QString::fromStdString(vpwallets[0]->GetName()));\n                                req.URI = \"/wallet/\"+std::string(encodedName.constData(), encodedName.length());\n                            }\n#endif\n                            lastResult = tableRPC.execute(req);\n                        }\n\n                        state = STATE_COMMAND_EXECUTED;\n                        curarg.clear();\n                    }\n                    break;\n                case ' ': case ',': case '\\t':\n                    if(state == STATE_EATING_SPACES_IN_ARG && curarg.empty() && ch == ',')\n                        throw std::runtime_error(\"Invalid Syntax\");\n\n                    else if(state == STATE_ARGUMENT) // Space ends argument\n                    {\n                        add_to_current_stack(curarg);\n                        curarg.clear();\n                    }\n                    if ((state == STATE_EATING_SPACES_IN_BRACKETS || state == STATE_ARGUMENT) && ch == ',')\n                    {\n                        state = STATE_EATING_SPACES_IN_ARG;\n                        break;\n                    }\n                    state = STATE_EATING_SPACES;\n                    break;\n                default: curarg += ch; state = STATE_ARGUMENT;\n            }\n                break;\n            case STATE_SINGLEQUOTED: // Single-quoted string\n                switch(ch)\n            {\n                case '\\'': state = STATE_ARGUMENT; break;\n                default: curarg += ch;\n            }\n                break;\n            case STATE_DOUBLEQUOTED: // Double-quoted string\n                switch(ch)\n            {\n                case '\"': state = STATE_ARGUMENT; break;\n                case '\\\\': state = STATE_ESCAPE_DOUBLEQUOTED; break;\n                default: curarg += ch;\n            }\n                break;\n            case STATE_ESCAPE_OUTER: // '\\' outside quotes\n                curarg += ch; state = STATE_ARGUMENT;\n                break;\n            case STATE_ESCAPE_DOUBLEQUOTED: // '\\' in double-quoted text\n                if(ch != '\"' && ch != '\\\\') curarg += '\\\\'; // keep '\\' for everything but the quote and '\\' itself\n                curarg += ch; state = STATE_DOUBLEQUOTED;\n                break;\n        }\n    }\n    if (pstrFilteredOut) {\n        if (STATE_COMMAND_EXECUTED == state) {\n            assert(!stack.empty());\n            close_out_params();\n        }\n        *pstrFilteredOut = strCommand;\n        for (auto i = filter_ranges.rbegin(); i != filter_ranges.rend(); ++i) {\n            pstrFilteredOut->replace(i->first, i->second - i->first, \"(…)\");\n        }\n    }\n    switch(state) // final state\n    {\n        case STATE_COMMAND_EXECUTED:\n            if (lastResult.isStr())\n                strResult = lastResult.get_str();\n            else\n                strResult = lastResult.write(2);\n        case STATE_ARGUMENT:\n        case STATE_EATING_SPACES:\n            return true;\n        default: // ERROR to end in one of the other states\n            return false;\n    }\n}\n\nvoid RPCExecutor::request(const QString &command)\n{\n    try\n    {\n        std::string result;\n        std::string executableCommand = command.toStdString() + \"\\n\";\n\n        // Catch the console-only-help command before RPC call is executed and reply with help text as-if a RPC reply.\n        if(executableCommand == \"help-console\\n\")\n        {\n            Q_EMIT reply(RPCConsole::CMD_REPLY, QString((\"\\n\"\n                \"This console accepts RPC commands using the standard syntax.\\n\"\n                \"   example:    getblockhash 0\\n\\n\"\n\n                \"This console can also accept RPC commands using parenthesized syntax.\\n\"\n                \"   example:    getblockhash(0)\\n\\n\"\n\n                \"Commands may be nested when specified with the parenthesized syntax.\\n\"\n                \"   example:    getblock(getblockhash(0) 1)\\n\\n\"\n\n                \"A space or a comma can be used to delimit arguments for either syntax.\\n\"\n                \"   example:    getblockhash 0\\n\"\n                \"               getblockhash,0\\n\\n\"\n\n                \"Named results can be queried with a non-quoted key string in brackets.\\n\"\n                \"   example:    getblock(getblockhash(0) true)[tx]\\n\\n\"\n\n                \"Results without keys can be queried using an integer in brackets.\\n\"\n                \"   example:    getblock(getblockhash(0),true)[tx][0]\\n\\n\")));\n            return;\n        }\n        if(!RPCConsole::RPCExecuteCommandLine(result, executableCommand))\n        {\n            Q_EMIT reply(RPCConsole::CMD_ERROR, QString(\"Parse error: unbalanced ' or \\\"\"));\n            return;\n        }\n\n        Q_EMIT reply(RPCConsole::CMD_REPLY, QString::fromStdString(result));\n    }\n    catch (UniValue& objError)\n    {\n        try // Nice formatting for standard-format error\n        {\n            int code = find_value(objError, \"code\").get_int();\n            std::string message = find_value(objError, \"message\").get_str();\n            Q_EMIT reply(RPCConsole::CMD_ERROR, QString::fromStdString(message) + \" (code \" + QString::number(code) + \")\");\n        }\n        catch (const std::runtime_error&) // raised when converting to invalid type, i.e. missing code or message\n        {   // Show raw JSON object\n            Q_EMIT reply(RPCConsole::CMD_ERROR, QString::fromStdString(objError.write()));\n        }\n    }\n    catch (const std::exception& e)\n    {\n        Q_EMIT reply(RPCConsole::CMD_ERROR, QString(\"Error: \") + QString::fromStdString(e.what()));\n    }\n}\n\nRPCConsole::RPCConsole(const PlatformStyle *_platformStyle, QWidget *parent) :\n    QWidget(parent),\n    ui(new Ui::RPCConsole),\n    clientModel(0),\n    historyPtr(0),\n    platformStyle(_platformStyle),\n    peersTableContextMenu(0),\n    banTableContextMenu(0),\n    consoleFontSize(0)\n{\n    ui->setupUi(this);\n    QSettings settings;\n    if (!restoreGeometry(settings.value(\"RPCConsoleWindowGeometry\").toByteArray())) {\n        // Restore failed (perhaps missing setting), center the window\n        move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center());\n    }\n\n    ui->openDebugLogfileButton->setToolTip(ui->openDebugLogfileButton->toolTip().arg(tr(PACKAGE_NAME)));\n\n    if (platformStyle->getImagesOnButtons()) {\n        ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(\":/icons/export\"));\n    }\n    ui->clearButton->setIcon(platformStyle->SingleColorIcon(\":/icons/remove\"));\n    ui->fontBiggerButton->setIcon(platformStyle->SingleColorIcon(\":/icons/fontbigger\"));\n    ui->fontSmallerButton->setIcon(platformStyle->SingleColorIcon(\":/icons/fontsmaller\"));\n\n    // Install event filter for up and down arrow\n    ui->lineEdit->installEventFilter(this);\n    ui->messagesWidget->installEventFilter(this);\n\n    connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear()));\n    connect(ui->fontBiggerButton, SIGNAL(clicked()), this, SLOT(fontBigger()));\n    connect(ui->fontSmallerButton, SIGNAL(clicked()), this, SLOT(fontSmaller()));\n    connect(ui->btnClearTrafficGraph, SIGNAL(clicked()), ui->trafficGraph, SLOT(clear()));\n\n    // set library version labels\n#ifdef ENABLE_WALLET\n    ui->berkeleyDBVersion->setText(DbEnv::version(0, 0, 0));\n#else\n    ui->label_berkeleyDBVersion->hide();\n    ui->berkeleyDBVersion->hide();\n#endif\n    // Register RPC timer interface\n    rpcTimerInterface = new QtRPCTimerInterface();\n    // avoid accidentally overwriting an existing, non QTThread\n    // based timer interface\n    RPCSetTimerInterfaceIfUnset(rpcTimerInterface);\n\n    setTrafficGraphRange(INITIAL_TRAFFIC_GRAPH_MINS);\n\n    ui->detailWidget->hide();\n    ui->peerHeading->setText(tr(\"Select a peer to view detailed information.\"));\n\n    consoleFontSize = settings.value(fontSizeSettingsKey, QFontInfo(QFont()).pointSize()).toInt();\n    clear();\n}\n\nRPCConsole::~RPCConsole()\n{\n    QSettings settings;\n    settings.setValue(\"RPCConsoleWindowGeometry\", saveGeometry());\n    RPCUnsetTimerInterface(rpcTimerInterface);\n    delete rpcTimerInterface;\n    delete ui;\n}\n\nbool RPCConsole::eventFilter(QObject* obj, QEvent *event)\n{\n    if(event->type() == QEvent::KeyPress) // Special key handling\n    {\n        QKeyEvent *keyevt = static_cast<QKeyEvent*>(event);\n        int key = keyevt->key();\n        Qt::KeyboardModifiers mod = keyevt->modifiers();\n        switch(key)\n        {\n        case Qt::Key_Up: if(obj == ui->lineEdit) { browseHistory(-1); return true; } break;\n        case Qt::Key_Down: if(obj == ui->lineEdit) { browseHistory(1); return true; } break;\n        case Qt::Key_PageUp: /* pass paging keys to messages widget */\n        case Qt::Key_PageDown:\n            if(obj == ui->lineEdit)\n            {\n                QApplication::postEvent(ui->messagesWidget, new QKeyEvent(*keyevt));\n                return true;\n            }\n            break;\n        case Qt::Key_Return:\n        case Qt::Key_Enter:\n            // forward these events to lineEdit\n            if(obj == autoCompleter->popup()) {\n                QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt));\n                return true;\n            }\n            break;\n        default:\n            // Typing in messages widget brings focus to line edit, and redirects key there\n            // Exclude most combinations and keys that emit no text, except paste shortcuts\n            if(obj == ui->messagesWidget && (\n                  (!mod && !keyevt->text().isEmpty() && key != Qt::Key_Tab) ||\n                  ((mod & Qt::ControlModifier) && key == Qt::Key_V) ||\n                  ((mod & Qt::ShiftModifier) && key == Qt::Key_Insert)))\n            {\n                ui->lineEdit->setFocus();\n                QApplication::postEvent(ui->lineEdit, new QKeyEvent(*keyevt));\n                return true;\n            }\n        }\n    }\n    return QWidget::eventFilter(obj, event);\n}\n\nvoid RPCConsole::setClientModel(ClientModel *model)\n{\n    clientModel = model;\n    ui->trafficGraph->setClientModel(model);\n    if (model && clientModel->getPeerTableModel() && clientModel->getBanTableModel()) {\n        // Keep up to date with client\n        setNumConnections(model->getNumConnections());\n        connect(model, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));\n\n        setNumBlocks(model->getNumBlocks(), model->getLastBlockDate(), model->getVerificationProgress(nullptr), false);\n        connect(model, SIGNAL(numBlocksChanged(int,QDateTime,double,bool)), this, SLOT(setNumBlocks(int,QDateTime,double,bool)));\n\n        updateNetworkState();\n        connect(model, SIGNAL(networkActiveChanged(bool)), this, SLOT(setNetworkActive(bool)));\n\n        updateTrafficStats(model->getTotalBytesRecv(), model->getTotalBytesSent());\n        connect(model, SIGNAL(bytesChanged(quint64,quint64)), this, SLOT(updateTrafficStats(quint64, quint64)));\n\n        connect(model, SIGNAL(mempoolSizeChanged(long,size_t)), this, SLOT(setMempoolSize(long,size_t)));\n\n        // set up peer table\n        ui->peerWidget->setModel(model->getPeerTableModel());\n        ui->peerWidget->verticalHeader()->hide();\n        ui->peerWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);\n        ui->peerWidget->setSelectionBehavior(QAbstractItemView::SelectRows);\n        ui->peerWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);\n        ui->peerWidget->setContextMenuPolicy(Qt::CustomContextMenu);\n        ui->peerWidget->setColumnWidth(PeerTableModel::Address, ADDRESS_COLUMN_WIDTH);\n        ui->peerWidget->setColumnWidth(PeerTableModel::Subversion, SUBVERSION_COLUMN_WIDTH);\n        ui->peerWidget->setColumnWidth(PeerTableModel::Ping, PING_COLUMN_WIDTH);\n        ui->peerWidget->horizontalHeader()->setStretchLastSection(true);\n\n        // create peer table context menu actions\n        QAction* disconnectAction = new QAction(tr(\"&Disconnect\"), this);\n        QAction* banAction1h      = new QAction(tr(\"Ban for\") + \" \" + tr(\"1 &hour\"), this);\n        QAction* banAction24h     = new QAction(tr(\"Ban for\") + \" \" + tr(\"1 &day\"), this);\n        QAction* banAction7d      = new QAction(tr(\"Ban for\") + \" \" + tr(\"1 &week\"), this);\n        QAction* banAction365d    = new QAction(tr(\"Ban for\") + \" \" + tr(\"1 &year\"), this);\n\n        // create peer table context menu\n        peersTableContextMenu = new QMenu(this);\n        peersTableContextMenu->addAction(disconnectAction);\n        peersTableContextMenu->addAction(banAction1h);\n        peersTableContextMenu->addAction(banAction24h);\n        peersTableContextMenu->addAction(banAction7d);\n        peersTableContextMenu->addAction(banAction365d);\n\n        // Add a signal mapping to allow dynamic context menu arguments.\n        // We need to use int (instead of int64_t), because signal mapper only supports\n        // int or objects, which is okay because max bantime (1 year) is < int_max.\n        QSignalMapper* signalMapper = new QSignalMapper(this);\n        signalMapper->setMapping(banAction1h, 60*60);\n        signalMapper->setMapping(banAction24h, 60*60*24);\n        signalMapper->setMapping(banAction7d, 60*60*24*7);\n        signalMapper->setMapping(banAction365d, 60*60*24*365);\n        connect(banAction1h, SIGNAL(triggered()), signalMapper, SLOT(map()));\n        connect(banAction24h, SIGNAL(triggered()), signalMapper, SLOT(map()));\n        connect(banAction7d, SIGNAL(triggered()), signalMapper, SLOT(map()));\n        connect(banAction365d, SIGNAL(triggered()), signalMapper, SLOT(map()));\n        connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(banSelectedNode(int)));\n\n        // peer table context menu signals\n        connect(ui->peerWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showPeersTableContextMenu(const QPoint&)));\n        connect(disconnectAction, SIGNAL(triggered()), this, SLOT(disconnectSelectedNode()));\n\n        // peer table signal handling - update peer details when selecting new node\n        connect(ui->peerWidget->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),\n            this, SLOT(peerSelected(const QItemSelection &, const QItemSelection &)));\n        // peer table signal handling - update peer details when new nodes are added to the model\n        connect(model->getPeerTableModel(), SIGNAL(layoutChanged()), this, SLOT(peerLayoutChanged()));\n        // peer table signal handling - cache selected node ids\n        connect(model->getPeerTableModel(), SIGNAL(layoutAboutToBeChanged()), this, SLOT(peerLayoutAboutToChange()));\n        \n        // set up ban table\n        ui->banlistWidget->setModel(model->getBanTableModel());\n        ui->banlistWidget->verticalHeader()->hide();\n        ui->banlistWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);\n        ui->banlistWidget->setSelectionBehavior(QAbstractItemView::SelectRows);\n        ui->banlistWidget->setSelectionMode(QAbstractItemView::SingleSelection);\n        ui->banlistWidget->setContextMenuPolicy(Qt::CustomContextMenu);\n        ui->banlistWidget->setColumnWidth(BanTableModel::Address, BANSUBNET_COLUMN_WIDTH);\n        ui->banlistWidget->setColumnWidth(BanTableModel::Bantime, BANTIME_COLUMN_WIDTH);\n        ui->banlistWidget->horizontalHeader()->setStretchLastSection(true);\n\n        // create ban table context menu action\n        QAction* unbanAction = new QAction(tr(\"&Unban\"), this);\n\n        // create ban table context menu\n        banTableContextMenu = new QMenu(this);\n        banTableContextMenu->addAction(unbanAction);\n\n        // ban table context menu signals\n        connect(ui->banlistWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(showBanTableContextMenu(const QPoint&)));\n        connect(unbanAction, SIGNAL(triggered()), this, SLOT(unbanSelectedNode()));\n\n        // ban table signal handling - clear peer details when clicking a peer in the ban table\n        connect(ui->banlistWidget, SIGNAL(clicked(const QModelIndex&)), this, SLOT(clearSelectedNode()));\n        // ban table signal handling - ensure ban table is shown or hidden (if empty)\n        connect(model->getBanTableModel(), SIGNAL(layoutChanged()), this, SLOT(showOrHideBanTableIfRequired()));\n        showOrHideBanTableIfRequired();\n\n        // Provide initial values\n        ui->clientVersion->setText(model->formatFullVersion());\n        ui->clientUserAgent->setText(model->formatSubVersion());\n        ui->dataDir->setText(model->dataDir());\n        ui->startupTime->setText(model->formatClientStartupTime());\n        ui->networkName->setText(QString::fromStdString(Params().NetworkIDString()));\n\n        //Setup autocomplete and attach it\n        QStringList wordList;\n        std::vector<std::string> commandList = tableRPC.listCommands();\n        for (size_t i = 0; i < commandList.size(); ++i)\n        {\n            wordList << commandList[i].c_str();\n            wordList << (\"help \" + commandList[i]).c_str();\n        }\n\n        wordList << \"help-console\";\n        wordList.sort();\n        autoCompleter = new QCompleter(wordList, this);\n        autoCompleter->setModelSorting(QCompleter::CaseSensitivelySortedModel);\n        ui->lineEdit->setCompleter(autoCompleter);\n        autoCompleter->popup()->installEventFilter(this);\n        // Start thread to execute RPC commands.\n        startExecutor();\n    }\n    if (!model) {\n        // Client model is being set to 0, this means shutdown() is about to be called.\n        // Make sure we clean up the executor thread\n        Q_EMIT stopExecutor();\n        thread.wait();\n    }\n}\n\nstatic QString categoryClass(int category)\n{\n    switch(category)\n    {\n    case RPCConsole::CMD_REQUEST:  return \"cmd-request\"; break;\n    case RPCConsole::CMD_REPLY:    return \"cmd-reply\"; break;\n    case RPCConsole::CMD_ERROR:    return \"cmd-error\"; break;\n    default:                       return \"misc\";\n    }\n}\n\nvoid RPCConsole::fontBigger()\n{\n    setFontSize(consoleFontSize+1);\n}\n\nvoid RPCConsole::fontSmaller()\n{\n    setFontSize(consoleFontSize-1);\n}\n\nvoid RPCConsole::setFontSize(int newSize)\n{\n    QSettings settings;\n\n    //don't allow an insane font size\n    if (newSize < FONT_RANGE.width() || newSize > FONT_RANGE.height())\n        return;\n\n    // temp. store the console content\n    QString str = ui->messagesWidget->toHtml();\n\n    // replace font tags size in current content\n    str.replace(QString(\"font-size:%1pt\").arg(consoleFontSize), QString(\"font-size:%1pt\").arg(newSize));\n\n    // store the new font size\n    consoleFontSize = newSize;\n    settings.setValue(fontSizeSettingsKey, consoleFontSize);\n\n    // clear console (reset icon sizes, default stylesheet) and re-add the content\n    float oldPosFactor = 1.0 / ui->messagesWidget->verticalScrollBar()->maximum() * ui->messagesWidget->verticalScrollBar()->value();\n    clear(false);\n    ui->messagesWidget->setHtml(str);\n    ui->messagesWidget->verticalScrollBar()->setValue(oldPosFactor * ui->messagesWidget->verticalScrollBar()->maximum());\n}\n\nvoid RPCConsole::clear(bool clearHistory)\n{\n    ui->messagesWidget->clear();\n    if(clearHistory)\n    {\n        history.clear();\n        historyPtr = 0;\n    }\n    ui->lineEdit->clear();\n    ui->lineEdit->setFocus();\n\n    // Add smoothly scaled icon images.\n    // (when using width/height on an img, Qt uses nearest instead of linear interpolation)\n    for(int i=0; ICON_MAPPING[i].url; ++i)\n    {\n        ui->messagesWidget->document()->addResource(\n                    QTextDocument::ImageResource,\n                    QUrl(ICON_MAPPING[i].url),\n                    platformStyle->SingleColorImage(ICON_MAPPING[i].source).scaled(QSize(consoleFontSize*2, consoleFontSize*2), Qt::IgnoreAspectRatio, Qt::SmoothTransformation));\n    }\n\n    // Set default style sheet\n    QFontInfo fixedFontInfo(GUIUtil::fixedPitchFont());\n    ui->messagesWidget->document()->setDefaultStyleSheet(\n        QString(\n                \"table { }\"\n                \"td.time { color: #808080; font-size: %2; padding-top: 3px; } \"\n                \"td.message { font-family: %1; font-size: %2; white-space:pre-wrap; } \"\n                \"td.cmd-request { color: #006060; } \"\n                \"td.cmd-error { color: red; } \"\n                \".secwarning { color: red; }\"\n                \"b { color: #006060; } \"\n            ).arg(fixedFontInfo.family(), QString(\"%1pt\").arg(consoleFontSize))\n        );\n\n#ifdef Q_OS_MAC\n    QString clsKey = \"(⌘)-L\";\n#else\n    QString clsKey = \"Ctrl-L\";\n#endif\n\t \n    message(CMD_REPLY, (tr(\"Welcome to the %1 RPC console.\").arg(tr(PACKAGE_NAME)) + \"<br>\" +\n                        tr(\"Use up and down arrows to navigate history, and %1 to clear screen.\").arg(\"<b>\"+clsKey+\"</b>\") + \"<br>\" +\n                        tr(\"Type %1 for an overview of available commands.\").arg(\"<b>help</b>\") + \"<br>\" +\n                        tr(\"For more information on using this console type %1.\").arg(\"<b>help-console</b>\") +\n                        \"<br><span class=\\\"secwarning\\\"><br>\" +\n                        tr(\"WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.\") +\n                        \"</span>\"),\n                        true);\n}\n\nvoid RPCConsole::keyPressEvent(QKeyEvent *event)\n{\n    if(windowType() != Qt::Widget && event->key() == Qt::Key_Escape)\n    {\n        close();\n    }\n}\n\nvoid RPCConsole::message(int category, const QString &message, bool html)\n{\n    QTime time = QTime::currentTime();\n    QString timeString = time.toString();\n    QString out;\n    out += \"<table><tr><td class=\\\"time\\\" width=\\\"65\\\">\" + timeString + \"</td>\";\n    out += \"<td class=\\\"icon\\\" width=\\\"32\\\"><img src=\\\"\" + categoryClass(category) + \"\\\"></td>\";\n    out += \"<td class=\\\"message \" + categoryClass(category) + \"\\\" valign=\\\"middle\\\">\";\n    if(html)\n        out += message;\n    else\n        out += GUIUtil::HtmlEscape(message, false);\n    out += \"</td></tr></table>\";\n    ui->messagesWidget->append(out);\n}\n\nvoid RPCConsole::updateNetworkState()\n{\n    QString connections = QString::number(clientModel->getNumConnections()) + \" (\";\n    connections += tr(\"In:\") + \" \" + QString::number(clientModel->getNumConnections(CONNECTIONS_IN)) + \" / \";\n    connections += tr(\"Out:\") + \" \" + QString::number(clientModel->getNumConnections(CONNECTIONS_OUT)) + \")\";\n\n    if(!clientModel->getNetworkActive()) {\n        connections += \" (\" + tr(\"Network activity disabled\") + \")\";\n    }\n\n    ui->numberOfConnections->setText(connections);\n}\n\nvoid RPCConsole::setNumConnections(int count)\n{\n    if (!clientModel)\n        return;\n\n    updateNetworkState();\n}\n\nvoid RPCConsole::setNetworkActive(bool networkActive)\n{\n    updateNetworkState();\n}\n\nvoid RPCConsole::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers)\n{\n    if (!headers) {\n        ui->numberOfBlocks->setText(QString::number(count));\n        ui->lastBlockTime->setText(blockDate.toString());\n    }\n}\n\nvoid RPCConsole::setMempoolSize(long numberOfTxs, size_t dynUsage)\n{\n    ui->mempoolNumberTxs->setText(QString::number(numberOfTxs));\n\n    if (dynUsage < 1000000)\n        ui->mempoolSize->setText(QString::number(dynUsage/1000.0, 'f', 2) + \" KB\");\n    else\n        ui->mempoolSize->setText(QString::number(dynUsage/1000000.0, 'f', 2) + \" MB\");\n}\n\nvoid RPCConsole::on_lineEdit_returnPressed()\n{\n    QString cmd = ui->lineEdit->text();\n\n    if(!cmd.isEmpty())\n    {\n        std::string strFilteredCmd;\n        try {\n            std::string dummy;\n            if (!RPCParseCommandLine(dummy, cmd.toStdString(), false, &strFilteredCmd)) {\n                // Failed to parse command, so we cannot even filter it for the history\n                throw std::runtime_error(\"Invalid command line\");\n            }\n        } catch (const std::exception& e) {\n            QMessageBox::critical(this, \"Error\", QString(\"Error: \") + QString::fromStdString(e.what()));\n            return;\n        }\n\n        ui->lineEdit->clear();\n\n        cmdBeforeBrowsing = QString();\n\n        message(CMD_REQUEST, QString::fromStdString(strFilteredCmd));\n        Q_EMIT cmdRequest(cmd);\n\n        cmd = QString::fromStdString(strFilteredCmd);\n\n        // Remove command, if already in history\n        history.removeOne(cmd);\n        // Append command to history\n        history.append(cmd);\n        // Enforce maximum history size\n        while(history.size() > CONSOLE_HISTORY)\n            history.removeFirst();\n        // Set pointer to end of history\n        historyPtr = history.size();\n\n        // Scroll console view to end\n        scrollToEnd();\n    }\n}\n\nvoid RPCConsole::browseHistory(int offset)\n{\n    // store current text when start browsing through the history\n    if (historyPtr == history.size()) {\n        cmdBeforeBrowsing = ui->lineEdit->text();\n    }\n\n    historyPtr += offset;\n    if(historyPtr < 0)\n        historyPtr = 0;\n    if(historyPtr > history.size())\n        historyPtr = history.size();\n    QString cmd;\n    if(historyPtr < history.size())\n        cmd = history.at(historyPtr);\n    else if (!cmdBeforeBrowsing.isNull()) {\n        cmd = cmdBeforeBrowsing;\n    }\n    ui->lineEdit->setText(cmd);\n}\n\nvoid RPCConsole::startExecutor()\n{\n    RPCExecutor *executor = new RPCExecutor();\n    executor->moveToThread(&thread);\n\n    // Replies from executor object must go to this object\n    connect(executor, SIGNAL(reply(int,QString)), this, SLOT(message(int,QString)));\n    // Requests from this object must go to executor\n    connect(this, SIGNAL(cmdRequest(QString)), executor, SLOT(request(QString)));\n\n    // On stopExecutor signal\n    // - quit the Qt event loop in the execution thread\n    connect(this, SIGNAL(stopExecutor()), &thread, SLOT(quit()));\n    // - queue executor for deletion (in execution thread)\n    connect(&thread, SIGNAL(finished()), executor, SLOT(deleteLater()), Qt::DirectConnection);\n\n    // Default implementation of QThread::run() simply spins up an event loop in the thread,\n    // which is what we want.\n    thread.start();\n}\n\nvoid RPCConsole::on_tabWidget_currentChanged(int index)\n{\n    if (ui->tabWidget->widget(index) == ui->tab_console)\n        ui->lineEdit->setFocus();\n    else if (ui->tabWidget->widget(index) != ui->tab_peers)\n        clearSelectedNode();\n}\n\nvoid RPCConsole::on_openDebugLogfileButton_clicked()\n{\n    GUIUtil::openDebugLogfile();\n}\n\nvoid RPCConsole::scrollToEnd()\n{\n    QScrollBar *scrollbar = ui->messagesWidget->verticalScrollBar();\n    scrollbar->setValue(scrollbar->maximum());\n}\n\nvoid RPCConsole::on_sldGraphRange_valueChanged(int value)\n{\n    const int multiplier = 5; // each position on the slider represents 5 min\n    int mins = value * multiplier;\n    setTrafficGraphRange(mins);\n}\n\nvoid RPCConsole::setTrafficGraphRange(int mins)\n{\n    ui->trafficGraph->setGraphRangeMins(mins);\n    ui->lblGraphRange->setText(GUIUtil::formatDurationStr(mins * 60));\n}\n\nvoid RPCConsole::updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut)\n{\n    ui->lblBytesIn->setText(GUIUtil::formatBytes(totalBytesIn));\n    ui->lblBytesOut->setText(GUIUtil::formatBytes(totalBytesOut));\n}\n\nvoid RPCConsole::peerSelected(const QItemSelection &selected, const QItemSelection &deselected)\n{\n    Q_UNUSED(deselected);\n\n    if (!clientModel || !clientModel->getPeerTableModel() || selected.indexes().isEmpty())\n        return;\n\n    const CNodeCombinedStats *stats = clientModel->getPeerTableModel()->getNodeStats(selected.indexes().first().row());\n    if (stats)\n        updateNodeDetail(stats);\n}\n\nvoid RPCConsole::peerLayoutAboutToChange()\n{\n    QModelIndexList selected = ui->peerWidget->selectionModel()->selectedIndexes();\n    cachedNodeids.clear();\n    for(int i = 0; i < selected.size(); i++)\n    {\n        const CNodeCombinedStats *stats = clientModel->getPeerTableModel()->getNodeStats(selected.at(i).row());\n        cachedNodeids.append(stats->nodeStats.nodeid);\n    }\n}\n\nvoid RPCConsole::peerLayoutChanged()\n{\n    if (!clientModel || !clientModel->getPeerTableModel())\n        return;\n\n    const CNodeCombinedStats *stats = nullptr;\n    bool fUnselect = false;\n    bool fReselect = false;\n\n    if (cachedNodeids.empty()) // no node selected yet\n        return;\n\n    // find the currently selected row\n    int selectedRow = -1;\n    QModelIndexList selectedModelIndex = ui->peerWidget->selectionModel()->selectedIndexes();\n    if (!selectedModelIndex.isEmpty()) {\n        selectedRow = selectedModelIndex.first().row();\n    }\n\n    // check if our detail node has a row in the table (it may not necessarily\n    // be at selectedRow since its position can change after a layout change)\n    int detailNodeRow = clientModel->getPeerTableModel()->getRowByNodeId(cachedNodeids.first());\n\n    if (detailNodeRow < 0)\n    {\n        // detail node disappeared from table (node disconnected)\n        fUnselect = true;\n    }\n    else\n    {\n        if (detailNodeRow != selectedRow)\n        {\n            // detail node moved position\n            fUnselect = true;\n            fReselect = true;\n        }\n\n        // get fresh stats on the detail node.\n        stats = clientModel->getPeerTableModel()->getNodeStats(detailNodeRow);\n    }\n\n    if (fUnselect && selectedRow >= 0) {\n        clearSelectedNode();\n    }\n\n    if (fReselect)\n    {\n        for(int i = 0; i < cachedNodeids.size(); i++)\n        {\n            ui->peerWidget->selectRow(clientModel->getPeerTableModel()->getRowByNodeId(cachedNodeids.at(i)));\n        }\n    }\n\n    if (stats)\n        updateNodeDetail(stats);\n}\n\nvoid RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats)\n{\n    // update the detail ui with latest node information\n    QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName) + \" \");\n    peerAddrDetails += tr(\"(node id: %1)\").arg(QString::number(stats->nodeStats.nodeid));\n    if (!stats->nodeStats.addrLocal.empty())\n        peerAddrDetails += \"<br />\" + tr(\"via %1\").arg(QString::fromStdString(stats->nodeStats.addrLocal));\n    ui->peerHeading->setText(peerAddrDetails);\n    ui->peerServices->setText(GUIUtil::formatServicesStr(stats->nodeStats.nServices));\n    ui->peerLastSend->setText(stats->nodeStats.nLastSend ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastSend) : tr(\"never\"));\n    ui->peerLastRecv->setText(stats->nodeStats.nLastRecv ? GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nLastRecv) : tr(\"never\"));\n    ui->peerBytesSent->setText(GUIUtil::formatBytes(stats->nodeStats.nSendBytes));\n    ui->peerBytesRecv->setText(GUIUtil::formatBytes(stats->nodeStats.nRecvBytes));\n    ui->peerConnTime->setText(GUIUtil::formatDurationStr(GetSystemTimeInSeconds() - stats->nodeStats.nTimeConnected));\n    ui->peerPingTime->setText(GUIUtil::formatPingTime(stats->nodeStats.dPingTime));\n    ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStats.dPingWait));\n    ui->peerMinPing->setText(GUIUtil::formatPingTime(stats->nodeStats.dMinPing));\n    ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset));\n    ui->peerVersion->setText(QString(\"%1\").arg(QString::number(stats->nodeStats.nVersion)));\n    ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer));\n    ui->peerDirection->setText(stats->nodeStats.fInbound ? tr(\"Inbound\") : tr(\"Outbound\"));\n    ui->peerHeight->setText(QString(\"%1\").arg(QString::number(stats->nodeStats.nStartingHeight)));\n    ui->peerWhitelisted->setText(stats->nodeStats.fWhitelisted ? tr(\"Yes\") : tr(\"No\"));\n\n    // This check fails for example if the lock was busy and\n    // nodeStateStats couldn't be fetched.\n    if (stats->fNodeStateStatsAvailable) {\n        // Ban score is init to 0\n        ui->peerBanScore->setText(QString(\"%1\").arg(stats->nodeStateStats.nMisbehavior));\n\n        // Sync height is init to -1\n        if (stats->nodeStateStats.nSyncHeight > -1)\n            ui->peerSyncHeight->setText(QString(\"%1\").arg(stats->nodeStateStats.nSyncHeight));\n        else\n            ui->peerSyncHeight->setText(tr(\"Unknown\"));\n\n        // Common height is init to -1\n        if (stats->nodeStateStats.nCommonHeight > -1)\n            ui->peerCommonHeight->setText(QString(\"%1\").arg(stats->nodeStateStats.nCommonHeight));\n        else\n            ui->peerCommonHeight->setText(tr(\"Unknown\"));\n    }\n\n    ui->detailWidget->show();\n}\n\nvoid RPCConsole::resizeEvent(QResizeEvent *event)\n{\n    QWidget::resizeEvent(event);\n}\n\nvoid RPCConsole::showEvent(QShowEvent *event)\n{\n    QWidget::showEvent(event);\n\n    if (!clientModel || !clientModel->getPeerTableModel())\n        return;\n\n    // start PeerTableModel auto refresh\n    clientModel->getPeerTableModel()->startAutoRefresh();\n}\n\nvoid RPCConsole::hideEvent(QHideEvent *event)\n{\n    QWidget::hideEvent(event);\n\n    if (!clientModel || !clientModel->getPeerTableModel())\n        return;\n\n    // stop PeerTableModel auto refresh\n    clientModel->getPeerTableModel()->stopAutoRefresh();\n}\n\nvoid RPCConsole::showPeersTableContextMenu(const QPoint& point)\n{\n    QModelIndex index = ui->peerWidget->indexAt(point);\n    if (index.isValid())\n        peersTableContextMenu->exec(QCursor::pos());\n}\n\nvoid RPCConsole::showBanTableContextMenu(const QPoint& point)\n{\n    QModelIndex index = ui->banlistWidget->indexAt(point);\n    if (index.isValid())\n        banTableContextMenu->exec(QCursor::pos());\n}\n\nvoid RPCConsole::disconnectSelectedNode()\n{\n    if(!g_connman)\n        return;\n    \n    // Get selected peer addresses\n    QList<QModelIndex> nodes = GUIUtil::getEntryData(ui->peerWidget, PeerTableModel::NetNodeId);\n    for(int i = 0; i < nodes.count(); i++)\n    {\n        // Get currently selected peer address\n        NodeId id = nodes.at(i).data().toLongLong();\n        // Find the node, disconnect it and clear the selected node\n        if(g_connman->DisconnectNode(id))\n            clearSelectedNode();\n    }\n}\n\nvoid RPCConsole::banSelectedNode(int bantime)\n{\n    if (!clientModel || !g_connman)\n        return;\n    \n    // Get selected peer addresses\n    QList<QModelIndex> nodes = GUIUtil::getEntryData(ui->peerWidget, PeerTableModel::NetNodeId);\n    for(int i = 0; i < nodes.count(); i++)\n    {\n        // Get currently selected peer address\n        NodeId id = nodes.at(i).data().toLongLong();\n\n\t// Get currently selected peer address\n\tint detailNodeRow = clientModel->getPeerTableModel()->getRowByNodeId(id);\n\tif(detailNodeRow < 0)\n\t    return;\n\n\t// Find possible nodes, ban it and clear the selected node\n\tconst CNodeCombinedStats *stats = clientModel->getPeerTableModel()->getNodeStats(detailNodeRow);\n\tif(stats) {\n\t    g_connman->Ban(stats->nodeStats.addr, BanReasonManuallyAdded, bantime);\n\t}\n    }\n    clearSelectedNode();\n    clientModel->getBanTableModel()->refresh();\n}\n\nvoid RPCConsole::unbanSelectedNode()\n{\n    if (!clientModel)\n        return;\n\n    // Get selected ban addresses\n    QList<QModelIndex> nodes = GUIUtil::getEntryData(ui->banlistWidget, BanTableModel::Address);\n    for(int i = 0; i < nodes.count(); i++)\n    {\n        // Get currently selected ban address\n        QString strNode = nodes.at(i).data().toString();\n        CSubNet possibleSubnet;\n\n        LookupSubNet(strNode.toStdString().c_str(), possibleSubnet);\n        if (possibleSubnet.IsValid() && g_connman)\n        {\n            g_connman->Unban(possibleSubnet);\n            clientModel->getBanTableModel()->refresh();\n        }\n    }\n}\n\nvoid RPCConsole::clearSelectedNode()\n{\n    ui->peerWidget->selectionModel()->clearSelection();\n    cachedNodeids.clear();\n    ui->detailWidget->hide();\n    ui->peerHeading->setText(tr(\"Select a peer to view detailed information.\"));\n}\n\nvoid RPCConsole::showOrHideBanTableIfRequired()\n{\n    if (!clientModel)\n        return;\n\n    bool visible = clientModel->getBanTableModel()->shouldShow();\n    ui->banlistWidget->setVisible(visible);\n    ui->banHeading->setVisible(visible);\n}\n\nvoid RPCConsole::setTabFocus(enum TabTypes tabType)\n{\n    ui->tabWidget->setCurrentIndex(tabType);\n}\n"
  },
  {
    "path": "src/qt/rpcconsole.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_RPCCONSOLE_H\n#define BITCOIN_QT_RPCCONSOLE_H\n\n#include <qt/guiutil.h>\n#include <qt/peertablemodel.h>\n\n#include <net.h>\n\n#include <QWidget>\n#include <QCompleter>\n#include <QThread>\n\nclass ClientModel;\nclass PlatformStyle;\nclass RPCTimerInterface;\n\nnamespace Ui {\n    class RPCConsole;\n}\n\nQT_BEGIN_NAMESPACE\nclass QMenu;\nclass QItemSelection;\nQT_END_NAMESPACE\n\n/** Local Bitcoin RPC console. */\nclass RPCConsole: public QWidget\n{\n    Q_OBJECT\n\npublic:\n    explicit RPCConsole(const PlatformStyle *platformStyle, QWidget *parent);\n    ~RPCConsole();\n\n    static bool RPCParseCommandLine(std::string &strResult, const std::string &strCommand, bool fExecute, std::string * const pstrFilteredOut = nullptr);\n    static bool RPCExecuteCommandLine(std::string &strResult, const std::string &strCommand, std::string * const pstrFilteredOut = nullptr) {\n        return RPCParseCommandLine(strResult, strCommand, true, pstrFilteredOut);\n    }\n\n    void setClientModel(ClientModel *model);\n\n    enum MessageClass {\n        MC_ERROR,\n        MC_DEBUG,\n        CMD_REQUEST,\n        CMD_REPLY,\n        CMD_ERROR\n    };\n\n    enum TabTypes {\n        TAB_INFO = 0,\n        TAB_CONSOLE = 1,\n        TAB_GRAPH = 2,\n        TAB_PEERS = 3\n    };\n\nprotected:\n    virtual bool eventFilter(QObject* obj, QEvent *event);\n    void keyPressEvent(QKeyEvent *);\n\nprivate Q_SLOTS:\n    void on_lineEdit_returnPressed();\n    void on_tabWidget_currentChanged(int index);\n    /** open the debug.log from the current datadir */\n    void on_openDebugLogfileButton_clicked();\n    /** change the time range of the network traffic graph */\n    void on_sldGraphRange_valueChanged(int value);\n    /** update traffic statistics */\n    void updateTrafficStats(quint64 totalBytesIn, quint64 totalBytesOut);\n    void resizeEvent(QResizeEvent *event);\n    void showEvent(QShowEvent *event);\n    void hideEvent(QHideEvent *event);\n    /** Show custom context menu on Peers tab */\n    void showPeersTableContextMenu(const QPoint& point);\n    /** Show custom context menu on Bans tab */\n    void showBanTableContextMenu(const QPoint& point);\n    /** Hides ban table if no bans are present */\n    void showOrHideBanTableIfRequired();\n    /** clear the selected node */\n    void clearSelectedNode();\n\npublic Q_SLOTS:\n    void clear(bool clearHistory = true);\n    void fontBigger();\n    void fontSmaller();\n    void setFontSize(int newSize);\n    /** Append the message to the message widget */\n    void message(int category, const QString &message, bool html = false);\n    /** Set number of connections shown in the UI */\n    void setNumConnections(int count);\n    /** Set network state shown in the UI */\n    void setNetworkActive(bool networkActive);\n    /** Set number of blocks and last block date shown in the UI */\n    void setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers);\n    /** Set size (number of transactions and memory usage) of the mempool in the UI */\n    void setMempoolSize(long numberOfTxs, size_t dynUsage);\n    /** Go forward or back in history */\n    void browseHistory(int offset);\n    /** Scroll console view to end */\n    void scrollToEnd();\n    /** Handle selection of peer in peers list */\n    void peerSelected(const QItemSelection &selected, const QItemSelection &deselected);\n    /** Handle selection caching before update */\n    void peerLayoutAboutToChange();\n    /** Handle updated peer information */\n    void peerLayoutChanged();\n    /** Disconnect a selected node on the Peers tab */\n    void disconnectSelectedNode();\n    /** Ban a selected node on the Peers tab */\n    void banSelectedNode(int bantime);\n    /** Unban a selected node on the Bans tab */\n    void unbanSelectedNode();\n    /** set which tab has the focus (is visible) */\n    void setTabFocus(enum TabTypes tabType);\n\nQ_SIGNALS:\n    // For RPC command executor\n    void stopExecutor();\n    void cmdRequest(const QString &command);\n\nprivate:\n    void startExecutor();\n    void setTrafficGraphRange(int mins);\n    /** show detailed information on ui about selected node */\n    void updateNodeDetail(const CNodeCombinedStats *stats);\n\n    enum ColumnWidths\n    {\n        ADDRESS_COLUMN_WIDTH = 200,\n        SUBVERSION_COLUMN_WIDTH = 150,\n        PING_COLUMN_WIDTH = 80,\n        BANSUBNET_COLUMN_WIDTH = 200,\n        BANTIME_COLUMN_WIDTH = 250\n\n    };\n\n    Ui::RPCConsole *ui;\n    ClientModel *clientModel;\n    QStringList history;\n    int historyPtr;\n    QString cmdBeforeBrowsing;\n    QList<NodeId> cachedNodeids;\n    const PlatformStyle *platformStyle;\n    RPCTimerInterface *rpcTimerInterface;\n    QMenu *peersTableContextMenu;\n    QMenu *banTableContextMenu;\n    int consoleFontSize;\n    QCompleter *autoCompleter;\n    QThread thread;\n\n    /** Update UI with latest network info from model. */\n    void updateNetworkState();\n};\n\n#endif // BITCOIN_QT_RPCCONSOLE_H\n"
  },
  {
    "path": "src/qt/sendcoinsdialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/sendcoinsdialog.h>\n#include <qt/forms/ui_sendcoinsdialog.h>\n\n#include <qt/addresstablemodel.h>\n#include <qt/bitcoinunits.h>\n#include <qt/clientmodel.h>\n#include <qt/coincontroldialog.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n#include <qt/platformstyle.h>\n#include <qt/sendcoinsentry.h>\n\n#include <base58.h>\n#include <chainparams.h>\n#include <wallet/coincontrol.h>\n#include <validation.h> // mempool and minRelayTxFee\n#include <ui_interface.h>\n#include <txmempool.h>\n#include <policy/fees.h>\n#include <wallet/fees.h>\n\n#include <QFontMetrics>\n#include <QScrollBar>\n#include <QSettings>\n#include <QTextDocument>\n\nstatic const std::array<int, 9> confTargets = { {2, 4, 6, 12, 24, 48, 144, 504, 1008} };\nint getConfTargetForIndex(int index) {\n    if (index+1 > static_cast<int>(confTargets.size())) {\n        return confTargets.back();\n    }\n    if (index < 0) {\n        return confTargets[0];\n    }\n    return confTargets[index];\n}\nint getIndexForConfTarget(int target) {\n    for (unsigned int i = 0; i < confTargets.size(); i++) {\n        if (confTargets[i] >= target) {\n            return i;\n        }\n    }\n    return confTargets.size() - 1;\n}\n\nSendCoinsDialog::SendCoinsDialog(const PlatformStyle *_platformStyle, QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::SendCoinsDialog),\n    clientModel(0),\n    model(0),\n    fNewRecipientAllowed(true),\n    fFeeMinimized(true),\n    platformStyle(_platformStyle)\n{\n    ui->setupUi(this);\n\n    if (!_platformStyle->getImagesOnButtons()) {\n        ui->addButton->setIcon(QIcon());\n        ui->clearButton->setIcon(QIcon());\n        ui->sendButton->setIcon(QIcon());\n    } else {\n        ui->addButton->setIcon(_platformStyle->SingleColorIcon(\":/icons/add\"));\n        ui->clearButton->setIcon(_platformStyle->SingleColorIcon(\":/icons/remove\"));\n        ui->sendButton->setIcon(_platformStyle->SingleColorIcon(\":/icons/send\"));\n    }\n\n    GUIUtil::setupAddressWidget(ui->lineEditCoinControlChange, this);\n\n    addEntry();\n\n    connect(ui->addButton, SIGNAL(clicked()), this, SLOT(addEntry()));\n    connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear()));\n\n    // Coin Control\n    connect(ui->pushButtonCoinControl, SIGNAL(clicked()), this, SLOT(coinControlButtonClicked()));\n    connect(ui->checkBoxCoinControlChange, SIGNAL(stateChanged(int)), this, SLOT(coinControlChangeChecked(int)));\n    connect(ui->lineEditCoinControlChange, SIGNAL(textEdited(const QString &)), this, SLOT(coinControlChangeEdited(const QString &)));\n\n    // Coin Control: clipboard actions\n    QAction *clipboardQuantityAction = new QAction(tr(\"Copy quantity\"), this);\n    QAction *clipboardAmountAction = new QAction(tr(\"Copy amount\"), this);\n    QAction *clipboardFeeAction = new QAction(tr(\"Copy fee\"), this);\n    QAction *clipboardAfterFeeAction = new QAction(tr(\"Copy after fee\"), this);\n    QAction *clipboardBytesAction = new QAction(tr(\"Copy bytes\"), this);\n    QAction *clipboardLowOutputAction = new QAction(tr(\"Copy dust\"), this);\n    QAction *clipboardChangeAction = new QAction(tr(\"Copy change\"), this);\n    connect(clipboardQuantityAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardQuantity()));\n    connect(clipboardAmountAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAmount()));\n    connect(clipboardFeeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardFee()));\n    connect(clipboardAfterFeeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardAfterFee()));\n    connect(clipboardBytesAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardBytes()));\n    connect(clipboardLowOutputAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardLowOutput()));\n    connect(clipboardChangeAction, SIGNAL(triggered()), this, SLOT(coinControlClipboardChange()));\n    ui->labelCoinControlQuantity->addAction(clipboardQuantityAction);\n    ui->labelCoinControlAmount->addAction(clipboardAmountAction);\n    ui->labelCoinControlFee->addAction(clipboardFeeAction);\n    ui->labelCoinControlAfterFee->addAction(clipboardAfterFeeAction);\n    ui->labelCoinControlBytes->addAction(clipboardBytesAction);\n    ui->labelCoinControlLowOutput->addAction(clipboardLowOutputAction);\n    ui->labelCoinControlChange->addAction(clipboardChangeAction);\n\n    // init transaction fee section\n    QSettings settings;\n    if (!settings.contains(\"fFeeSectionMinimized\"))\n        settings.setValue(\"fFeeSectionMinimized\", true);\n    if (!settings.contains(\"nFeeRadio\") && settings.contains(\"nTransactionFee\") && settings.value(\"nTransactionFee\").toLongLong() > 0) // compatibility\n        settings.setValue(\"nFeeRadio\", 1); // custom\n    if (!settings.contains(\"nFeeRadio\"))\n        settings.setValue(\"nFeeRadio\", 0); // recommended\n    if (!settings.contains(\"nSmartFeeSliderPosition\"))\n        settings.setValue(\"nSmartFeeSliderPosition\", 0);\n    if (!settings.contains(\"nTransactionFee\"))\n        settings.setValue(\"nTransactionFee\", (qint64)DEFAULT_TRANSACTION_FEE);\n    if (!settings.contains(\"fPayOnlyMinFee\"))\n        settings.setValue(\"fPayOnlyMinFee\", false);\n    ui->groupFee->setId(ui->radioSmartFee, 0);\n    ui->groupFee->setId(ui->radioCustomFee, 1);\n    ui->groupFee->button((int)std::max(0, std::min(1, settings.value(\"nFeeRadio\").toInt())))->setChecked(true);\n    ui->customFee->setValue(settings.value(\"nTransactionFee\").toLongLong());\n    ui->checkBoxMinimumFee->setChecked(settings.value(\"fPayOnlyMinFee\").toBool());\n    minimizeFeeSection(settings.value(\"fFeeSectionMinimized\").toBool());\n}\n\nvoid SendCoinsDialog::setClientModel(ClientModel *_clientModel)\n{\n    this->clientModel = _clientModel;\n\n    if (_clientModel) {\n        connect(_clientModel, SIGNAL(numBlocksChanged(int,QDateTime,double,bool)), this, SLOT(updateSmartFeeLabel()));\n    }\n}\n\nvoid SendCoinsDialog::setModel(WalletModel *_model)\n{\n    this->model = _model;\n\n    if(_model && _model->getOptionsModel())\n    {\n        for(int i = 0; i < ui->entries->count(); ++i)\n        {\n            SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());\n            if(entry)\n            {\n                entry->setModel(_model);\n            }\n        }\n\n        setBalance(_model->getBalance(), _model->getUnconfirmedBalance(), _model->getImmatureBalance(),\n                   _model->getWatchBalance(), _model->getWatchUnconfirmedBalance(), _model->getWatchImmatureBalance());\n        connect(_model, SIGNAL(balanceChanged(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)), this, SLOT(setBalance(CAmount,CAmount,CAmount,CAmount,CAmount,CAmount)));\n        connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));\n        updateDisplayUnit();\n\n        // Coin Control\n        connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(coinControlUpdateLabels()));\n        connect(_model->getOptionsModel(), SIGNAL(coinControlFeaturesChanged(bool)), this, SLOT(coinControlFeatureChanged(bool)));\n        ui->frameCoinControl->setVisible(_model->getOptionsModel()->getCoinControlFeatures());\n        coinControlUpdateLabels();\n\n        // fee section\n        for (const int n : confTargets) {\n            ui->confTargetSelector->addItem(tr(\"%1 (%2 blocks)\").arg(GUIUtil::formatNiceTimeOffset(n*Params().GetConsensus().nPowTargetSpacing)).arg(n));\n        }\n        connect(ui->confTargetSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(updateSmartFeeLabel()));\n        connect(ui->confTargetSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(coinControlUpdateLabels()));\n        connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(updateFeeSectionControls()));\n        connect(ui->groupFee, SIGNAL(buttonClicked(int)), this, SLOT(coinControlUpdateLabels()));\n        connect(ui->customFee, SIGNAL(valueChanged()), this, SLOT(coinControlUpdateLabels()));\n        connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(setMinimumFee()));\n        connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls()));\n        connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels()));\n        connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(updateSmartFeeLabel()));\n        connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels()));\n        ui->customFee->setSingleStep(GetRequiredFee(1000));\n        updateFeeSectionControls();\n        updateMinFeeLabel();\n        updateSmartFeeLabel();\n\n        // set default rbf checkbox state\n        ui->optInRBF->setCheckState(Qt::Checked);\n\n        // set the smartfee-sliders default value (wallets default conf.target or last stored value)\n        QSettings settings;\n        if (settings.value(\"nSmartFeeSliderPosition\").toInt() != 0) {\n            // migrate nSmartFeeSliderPosition to nConfTarget\n            // nConfTarget is available since 0.15 (replaced nSmartFeeSliderPosition)\n            int nConfirmTarget = 25 - settings.value(\"nSmartFeeSliderPosition\").toInt(); // 25 == old slider range\n            settings.setValue(\"nConfTarget\", nConfirmTarget);\n            settings.remove(\"nSmartFeeSliderPosition\");\n        }\n        if (settings.value(\"nConfTarget\").toInt() == 0)\n            ui->confTargetSelector->setCurrentIndex(getIndexForConfTarget(model->getDefaultConfirmTarget()));\n        else\n            ui->confTargetSelector->setCurrentIndex(getIndexForConfTarget(settings.value(\"nConfTarget\").toInt()));\n    }\n}\n\nSendCoinsDialog::~SendCoinsDialog()\n{\n    QSettings settings;\n    settings.setValue(\"fFeeSectionMinimized\", fFeeMinimized);\n    settings.setValue(\"nFeeRadio\", ui->groupFee->checkedId());\n    settings.setValue(\"nConfTarget\", getConfTargetForIndex(ui->confTargetSelector->currentIndex()));\n    settings.setValue(\"nTransactionFee\", (qint64)ui->customFee->value());\n    settings.setValue(\"fPayOnlyMinFee\", ui->checkBoxMinimumFee->isChecked());\n\n    delete ui;\n}\n\nvoid SendCoinsDialog::on_sendButton_clicked()\n{\n    if(!model || !model->getOptionsModel())\n        return;\n\n    QList<SendCoinsRecipient> recipients;\n    bool valid = true;\n\n    for(int i = 0; i < ui->entries->count(); ++i)\n    {\n        SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());\n        if(entry)\n        {\n            if(entry->validate())\n            {\n                recipients.append(entry->getValue());\n            }\n            else\n            {\n                valid = false;\n            }\n        }\n    }\n\n    if(!valid || recipients.isEmpty())\n    {\n        return;\n    }\n\n    fNewRecipientAllowed = false;\n    WalletModel::UnlockContext ctx(model->requestUnlock());\n    if(!ctx.isValid())\n    {\n        // Unlock wallet was cancelled\n        fNewRecipientAllowed = true;\n        return;\n    }\n\n    // prepare transaction for getting txFee earlier\n    WalletModelTransaction currentTransaction(recipients);\n    WalletModel::SendCoinsReturn prepareStatus;\n\n    // Always use a CCoinControl instance, use the CoinControlDialog instance if CoinControl has been enabled\n    CCoinControl ctrl;\n    if (model->getOptionsModel()->getCoinControlFeatures())\n        ctrl = *CoinControlDialog::coinControl();\n\n    updateCoinControlState(ctrl);\n\n    prepareStatus = model->prepareTransaction(currentTransaction, ctrl);\n\n    // process prepareStatus and on error generate message shown to user\n    processSendCoinsReturn(prepareStatus,\n        BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), currentTransaction.getTransactionFee()));\n\n    if(prepareStatus.status != WalletModel::OK) {\n        fNewRecipientAllowed = true;\n        return;\n    }\n\n    CAmount txFee = currentTransaction.getTransactionFee();\n\n    // Format confirmation message\n    QStringList formatted;\n    for (const SendCoinsRecipient &rcp : currentTransaction.getRecipients())\n    {\n        // generate bold amount string\n        QString amount = \"<b>\" + BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount);\n        amount.append(\"</b>\");\n        // generate monospace address string\n        QString address = \"<span style='font-family: monospace;'>\" + rcp.address;\n        address.append(\"</span>\");\n\n        QString recipientElement;\n\n        if (!rcp.paymentRequest.IsInitialized()) // normal payment\n        {\n            if(rcp.label.length() > 0) // label with address\n            {\n                recipientElement = tr(\"%1 to %2\").arg(amount, GUIUtil::HtmlEscape(rcp.label));\n                recipientElement.append(QString(\" (%1)\").arg(address));\n            }\n            else // just address\n            {\n                recipientElement = tr(\"%1 to %2\").arg(amount, address);\n            }\n        }\n        else if(!rcp.authenticatedMerchant.isEmpty()) // authenticated payment request\n        {\n            recipientElement = tr(\"%1 to %2\").arg(amount, GUIUtil::HtmlEscape(rcp.authenticatedMerchant));\n        }\n        else // unauthenticated payment request\n        {\n            recipientElement = tr(\"%1 to %2\").arg(amount, address);\n        }\n\n        formatted.append(recipientElement);\n    }\n\n    QString questionString = tr(\"Are you sure you want to send?\");\n    questionString.append(\"<br /><br />%1\");\n\n    if(txFee > 0)\n    {\n        // append fee string if a fee is required\n        questionString.append(\"<hr /><span style='color:#aa0000;'>\");\n        questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));\n        questionString.append(\"</span> \");\n        questionString.append(tr(\"added as transaction fee\"));\n\n        // append transaction size\n        questionString.append(\" (\" + QString::number((double)currentTransaction.getTransactionSize() / 1000) + \" kB)\");\n    }\n\n    // add total amount in all subdivision units\n    questionString.append(\"<hr />\");\n    CAmount totalAmount = currentTransaction.getTotalTransactionAmount() + txFee;\n    QStringList alternativeUnits;\n    for (BitcoinUnits::Unit u : BitcoinUnits::availableUnits())\n    {\n        if(u != model->getOptionsModel()->getDisplayUnit())\n            alternativeUnits.append(BitcoinUnits::formatHtmlWithUnit(u, totalAmount));\n    }\n    questionString.append(tr(\"Total Amount %1\")\n        .arg(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount)));\n    questionString.append(QString(\"<span style='font-size:10pt;font-weight:normal;'><br />(=%1)</span>\")\n        .arg(alternativeUnits.join(\" \" + tr(\"or\") + \"<br />\")));\n\n    questionString.append(\"<hr /><span>\");\n    if (ui->optInRBF->isChecked()) {\n        questionString.append(tr(\"You can increase the fee later (signals Replace-By-Fee, BIP-125).\"));\n    } else {\n        questionString.append(tr(\"Not signalling Replace-By-Fee, BIP-125.\"));\n    }\n    questionString.append(\"</span>\");\n\n\n    SendConfirmationDialog confirmationDialog(tr(\"Confirm send coins\"),\n        questionString.arg(formatted.join(\"<br />\")), SEND_CONFIRM_DELAY, this);\n    confirmationDialog.exec();\n    QMessageBox::StandardButton retval = (QMessageBox::StandardButton)confirmationDialog.result();\n\n    if(retval != QMessageBox::Yes)\n    {\n        fNewRecipientAllowed = true;\n        return;\n    }\n\n    // now send the prepared transaction\n    WalletModel::SendCoinsReturn sendStatus = model->sendCoins(currentTransaction);\n    // process sendStatus and on error generate message shown to user\n    processSendCoinsReturn(sendStatus);\n\n    if (sendStatus.status == WalletModel::OK)\n    {\n        accept();\n        CoinControlDialog::coinControl()->UnSelectAll();\n        coinControlUpdateLabels();\n    }\n    fNewRecipientAllowed = true;\n}\n\nvoid SendCoinsDialog::clear()\n{\n    // Clear coin control settings\n    CoinControlDialog::coinControl()->UnSelectAll();\n    ui->checkBoxCoinControlChange->setChecked(false);\n    ui->lineEditCoinControlChange->clear();\n    coinControlUpdateLabels();\n\n    // Remove entries until only one left\n    while(ui->entries->count())\n    {\n        ui->entries->takeAt(0)->widget()->deleteLater();\n    }\n    addEntry();\n\n    updateTabsAndLabels();\n}\n\nvoid SendCoinsDialog::reject()\n{\n    clear();\n}\n\nvoid SendCoinsDialog::accept()\n{\n    clear();\n}\n\nSendCoinsEntry *SendCoinsDialog::addEntry()\n{\n    SendCoinsEntry *entry = new SendCoinsEntry(platformStyle, this);\n    entry->setModel(model);\n    ui->entries->addWidget(entry);\n    connect(entry, SIGNAL(removeEntry(SendCoinsEntry*)), this, SLOT(removeEntry(SendCoinsEntry*)));\n    connect(entry, SIGNAL(useAvailableBalance(SendCoinsEntry*)), this, SLOT(useAvailableBalance(SendCoinsEntry*)));\n    connect(entry, SIGNAL(payAmountChanged()), this, SLOT(coinControlUpdateLabels()));\n    connect(entry, SIGNAL(subtractFeeFromAmountChanged()), this, SLOT(coinControlUpdateLabels()));\n\n    // Focus the field, so that entry can start immediately\n    entry->clear();\n    entry->setFocus();\n    ui->scrollAreaWidgetContents->resize(ui->scrollAreaWidgetContents->sizeHint());\n    qApp->processEvents();\n    QScrollBar* bar = ui->scrollArea->verticalScrollBar();\n    if(bar)\n        bar->setSliderPosition(bar->maximum());\n\n    updateTabsAndLabels();\n    return entry;\n}\n\nvoid SendCoinsDialog::updateTabsAndLabels()\n{\n    setupTabChain(0);\n    coinControlUpdateLabels();\n}\n\nvoid SendCoinsDialog::removeEntry(SendCoinsEntry* entry)\n{\n    entry->hide();\n\n    // If the last entry is about to be removed add an empty one\n    if (ui->entries->count() == 1)\n        addEntry();\n\n    entry->deleteLater();\n\n    updateTabsAndLabels();\n}\n\nQWidget *SendCoinsDialog::setupTabChain(QWidget *prev)\n{\n    for(int i = 0; i < ui->entries->count(); ++i)\n    {\n        SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());\n        if(entry)\n        {\n            prev = entry->setupTabChain(prev);\n        }\n    }\n    QWidget::setTabOrder(prev, ui->sendButton);\n    QWidget::setTabOrder(ui->sendButton, ui->clearButton);\n    QWidget::setTabOrder(ui->clearButton, ui->addButton);\n    return ui->addButton;\n}\n\nvoid SendCoinsDialog::setAddress(const QString &address)\n{\n    SendCoinsEntry *entry = 0;\n    // Replace the first entry if it is still unused\n    if(ui->entries->count() == 1)\n    {\n        SendCoinsEntry *first = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(0)->widget());\n        if(first->isClear())\n        {\n            entry = first;\n        }\n    }\n    if(!entry)\n    {\n        entry = addEntry();\n    }\n\n    entry->setAddress(address);\n}\n\nvoid SendCoinsDialog::pasteEntry(const SendCoinsRecipient &rv)\n{\n    if(!fNewRecipientAllowed)\n        return;\n\n    SendCoinsEntry *entry = 0;\n    // Replace the first entry if it is still unused\n    if(ui->entries->count() == 1)\n    {\n        SendCoinsEntry *first = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(0)->widget());\n        if(first->isClear())\n        {\n            entry = first;\n        }\n    }\n    if(!entry)\n    {\n        entry = addEntry();\n    }\n\n    entry->setValue(rv);\n    updateTabsAndLabels();\n}\n\nbool SendCoinsDialog::handlePaymentRequest(const SendCoinsRecipient &rv)\n{\n    // Just paste the entry, all pre-checks\n    // are done in paymentserver.cpp.\n    pasteEntry(rv);\n    return true;\n}\n\nvoid SendCoinsDialog::setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,\n                                 const CAmount& watchBalance, const CAmount& watchUnconfirmedBalance, const CAmount& watchImmatureBalance)\n{\n    Q_UNUSED(unconfirmedBalance);\n    Q_UNUSED(immatureBalance);\n    Q_UNUSED(watchBalance);\n    Q_UNUSED(watchUnconfirmedBalance);\n    Q_UNUSED(watchImmatureBalance);\n\n    if(model && model->getOptionsModel())\n    {\n        ui->labelBalance->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), balance));\n    }\n}\n\nvoid SendCoinsDialog::updateDisplayUnit()\n{\n    setBalance(model->getBalance(), 0, 0, 0, 0, 0);\n    ui->customFee->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());\n    updateMinFeeLabel();\n    updateSmartFeeLabel();\n}\n\nvoid SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg)\n{\n    QPair<QString, CClientUIInterface::MessageBoxFlags> msgParams;\n    // Default to a warning message, override if error message is needed\n    msgParams.second = CClientUIInterface::MSG_WARNING;\n\n    // This comment is specific to SendCoinsDialog usage of WalletModel::SendCoinsReturn.\n    // WalletModel::TransactionCommitFailed is used only in WalletModel::sendCoins()\n    // all others are used only in WalletModel::prepareTransaction()\n    switch(sendCoinsReturn.status)\n    {\n    case WalletModel::InvalidAddress:\n        msgParams.first = tr(\"The recipient address is not valid. Please recheck.\");\n        break;\n    case WalletModel::InvalidAmount:\n        msgParams.first = tr(\"The amount to pay must be larger than 0.\");\n        break;\n    case WalletModel::AmountExceedsBalance:\n        msgParams.first = tr(\"The amount exceeds your balance.\");\n        break;\n    case WalletModel::AmountWithFeeExceedsBalance:\n        msgParams.first = tr(\"The total exceeds your balance when the %1 transaction fee is included.\").arg(msgArg);\n        break;\n    case WalletModel::DuplicateAddress:\n        msgParams.first = tr(\"Duplicate address found: addresses should only be used once each.\");\n        break;\n    case WalletModel::TransactionCreationFailed:\n        msgParams.first = tr(\"Transaction creation failed!\");\n        msgParams.second = CClientUIInterface::MSG_ERROR;\n        break;\n    case WalletModel::TransactionCommitFailed:\n        msgParams.first = tr(\"The transaction was rejected with the following reason: %1\").arg(sendCoinsReturn.reasonCommitFailed);\n        msgParams.second = CClientUIInterface::MSG_ERROR;\n        break;\n    case WalletModel::AbsurdFee:\n        msgParams.first = tr(\"A fee higher than %1 is considered an absurdly high fee.\").arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), maxTxFee));\n        break;\n    case WalletModel::PaymentRequestExpired:\n        msgParams.first = tr(\"Payment request expired.\");\n        msgParams.second = CClientUIInterface::MSG_ERROR;\n        break;\n    // included to prevent a compiler warning.\n    case WalletModel::OK:\n    default:\n        return;\n    }\n\n    Q_EMIT message(tr(\"Send Coins\"), msgParams.first, msgParams.second);\n}\n\nvoid SendCoinsDialog::minimizeFeeSection(bool fMinimize)\n{\n    ui->labelFeeMinimized->setVisible(fMinimize);\n    ui->buttonChooseFee  ->setVisible(fMinimize);\n    ui->buttonMinimizeFee->setVisible(!fMinimize);\n    ui->frameFeeSelection->setVisible(!fMinimize);\n    ui->horizontalLayoutSmartFee->setContentsMargins(0, (fMinimize ? 0 : 6), 0, 0);\n    fFeeMinimized = fMinimize;\n}\n\nvoid SendCoinsDialog::on_buttonChooseFee_clicked()\n{\n    minimizeFeeSection(false);\n}\n\nvoid SendCoinsDialog::on_buttonMinimizeFee_clicked()\n{\n    updateFeeMinimizedLabel();\n    minimizeFeeSection(true);\n}\n\nvoid SendCoinsDialog::useAvailableBalance(SendCoinsEntry* entry)\n{\n    // Get CCoinControl instance if CoinControl is enabled or create a new one.\n    CCoinControl coin_control;\n    if (model->getOptionsModel()->getCoinControlFeatures()) {\n        coin_control = *CoinControlDialog::coinControl();\n    }\n\n    // Calculate available amount to send.\n    CAmount amount = model->getBalance(&coin_control);\n    for (int i = 0; i < ui->entries->count(); ++i) {\n        SendCoinsEntry* e = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());\n        if (e && !e->isHidden() && e != entry) {\n            amount -= e->getValue().amount;\n        }\n    }\n\n    if (amount > 0) {\n      entry->checkSubtractFeeFromAmount();\n      entry->setAmount(amount);\n    } else {\n      entry->setAmount(0);\n    }\n}\n\nvoid SendCoinsDialog::setMinimumFee()\n{\n    ui->customFee->setValue(GetRequiredFee(1000));\n}\n\nvoid SendCoinsDialog::updateFeeSectionControls()\n{\n    ui->confTargetSelector      ->setEnabled(ui->radioSmartFee->isChecked());\n    ui->labelSmartFee           ->setEnabled(ui->radioSmartFee->isChecked());\n    ui->labelSmartFee2          ->setEnabled(ui->radioSmartFee->isChecked());\n    ui->labelSmartFee3          ->setEnabled(ui->radioSmartFee->isChecked());\n    ui->labelFeeEstimation      ->setEnabled(ui->radioSmartFee->isChecked());\n    ui->checkBoxMinimumFee      ->setEnabled(ui->radioCustomFee->isChecked());\n    ui->labelMinFeeWarning      ->setEnabled(ui->radioCustomFee->isChecked());\n    ui->labelCustomPerKilobyte  ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());\n    ui->customFee               ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());\n}\n\nvoid SendCoinsDialog::updateFeeMinimizedLabel()\n{\n    if(!model || !model->getOptionsModel())\n        return;\n\n    if (ui->radioSmartFee->isChecked())\n        ui->labelFeeMinimized->setText(ui->labelSmartFee->text());\n    else {\n        ui->labelFeeMinimized->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), ui->customFee->value()) + \"/kB\");\n    }\n}\n\nvoid SendCoinsDialog::updateMinFeeLabel()\n{\n    if (model && model->getOptionsModel())\n        ui->checkBoxMinimumFee->setText(tr(\"Pay only the required fee of %1\").arg(\n            BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), GetRequiredFee(1000)) + \"/kB\")\n        );\n}\n\nvoid SendCoinsDialog::updateCoinControlState(CCoinControl& ctrl)\n{\n    if (ui->radioCustomFee->isChecked()) {\n        ctrl.m_feerate = CFeeRate(ui->customFee->value());\n    } else {\n        ctrl.m_feerate.reset();\n    }\n    // Avoid using global defaults when sending money from the GUI\n    // Either custom fee will be used or if not selected, the confirmation target from dropdown box\n    ctrl.m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());\n    ctrl.signalRbf = ui->optInRBF->isChecked();\n}\n\nvoid SendCoinsDialog::updateSmartFeeLabel()\n{\n    if(!model || !model->getOptionsModel())\n        return;\n    CCoinControl coin_control;\n    updateCoinControlState(coin_control);\n    coin_control.m_feerate.reset(); // Explicitly use only fee estimation rate for smart fee labels\n    FeeCalculation feeCalc;\n    CFeeRate feeRate = CFeeRate(GetMinimumFee(1000, coin_control, ::mempool, ::feeEstimator, &feeCalc));\n\n    ui->labelSmartFee->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), feeRate.GetFeePerK()) + \"/kB\");\n\n    if (feeCalc.reason == FeeReason::FALLBACK) {\n        ui->labelSmartFee2->show(); // (Smart fee not initialized yet. This usually takes a few blocks...)\n        ui->labelFeeEstimation->setText(\"\");\n        ui->fallbackFeeWarningLabel->setVisible(true);\n        int lightness = ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness();\n        QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14));\n        ui->fallbackFeeWarningLabel->setStyleSheet(\"QLabel { color: \" + warning_colour.name() + \"; }\");\n        ui->fallbackFeeWarningLabel->setIndent(QFontMetrics(ui->fallbackFeeWarningLabel->font()).width(\"x\"));\n    }\n    else\n    {\n        ui->labelSmartFee2->hide();\n        ui->labelFeeEstimation->setText(tr(\"Estimated to begin confirmation within %n block(s).\", \"\", feeCalc.returnedTarget));\n        ui->fallbackFeeWarningLabel->setVisible(false);\n    }\n\n    updateFeeMinimizedLabel();\n}\n\n// Coin Control: copy label \"Quantity\" to clipboard\nvoid SendCoinsDialog::coinControlClipboardQuantity()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlQuantity->text());\n}\n\n// Coin Control: copy label \"Amount\" to clipboard\nvoid SendCoinsDialog::coinControlClipboardAmount()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlAmount->text().left(ui->labelCoinControlAmount->text().indexOf(\" \")));\n}\n\n// Coin Control: copy label \"Fee\" to clipboard\nvoid SendCoinsDialog::coinControlClipboardFee()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(\" \")).replace(ASYMP_UTF8, \"\"));\n}\n\n// Coin Control: copy label \"After fee\" to clipboard\nvoid SendCoinsDialog::coinControlClipboardAfterFee()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlAfterFee->text().left(ui->labelCoinControlAfterFee->text().indexOf(\" \")).replace(ASYMP_UTF8, \"\"));\n}\n\n// Coin Control: copy label \"Bytes\" to clipboard\nvoid SendCoinsDialog::coinControlClipboardBytes()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlBytes->text().replace(ASYMP_UTF8, \"\"));\n}\n\n// Coin Control: copy label \"Dust\" to clipboard\nvoid SendCoinsDialog::coinControlClipboardLowOutput()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlLowOutput->text());\n}\n\n// Coin Control: copy label \"Change\" to clipboard\nvoid SendCoinsDialog::coinControlClipboardChange()\n{\n    GUIUtil::setClipboard(ui->labelCoinControlChange->text().left(ui->labelCoinControlChange->text().indexOf(\" \")).replace(ASYMP_UTF8, \"\"));\n}\n\n// Coin Control: settings menu - coin control enabled/disabled by user\nvoid SendCoinsDialog::coinControlFeatureChanged(bool checked)\n{\n    ui->frameCoinControl->setVisible(checked);\n\n    if (!checked && model) // coin control features disabled\n        CoinControlDialog::coinControl()->SetNull();\n\n    coinControlUpdateLabels();\n}\n\n// Coin Control: button inputs -> show actual coin control dialog\nvoid SendCoinsDialog::coinControlButtonClicked()\n{\n    CoinControlDialog dlg(platformStyle);\n    dlg.setModel(model);\n    dlg.exec();\n    coinControlUpdateLabels();\n}\n\n// Coin Control: checkbox custom change address\nvoid SendCoinsDialog::coinControlChangeChecked(int state)\n{\n    if (state == Qt::Unchecked)\n    {\n        CoinControlDialog::coinControl()->destChange = CNoDestination();\n        ui->labelCoinControlChangeLabel->clear();\n    }\n    else\n        // use this to re-validate an already entered address\n        coinControlChangeEdited(ui->lineEditCoinControlChange->text());\n\n    ui->lineEditCoinControlChange->setEnabled((state == Qt::Checked));\n}\n\n// Coin Control: custom change address changed\nvoid SendCoinsDialog::coinControlChangeEdited(const QString& text)\n{\n    if (model && model->getAddressTableModel())\n    {\n        // Default to no change address until verified\n        CoinControlDialog::coinControl()->destChange = CNoDestination();\n        ui->labelCoinControlChangeLabel->setStyleSheet(\"QLabel{color:red;}\");\n\n        const CTxDestination dest = DecodeDestination(text.toStdString());\n\n        if (text.isEmpty()) // Nothing entered\n        {\n            ui->labelCoinControlChangeLabel->setText(\"\");\n        }\n        else if (!IsValidDestination(dest)) // Invalid address\n        {\n            ui->labelCoinControlChangeLabel->setText(tr(\"Warning: Invalid Sugarchain address\"));\n        }\n        else // Valid address\n        {\n            if (!model->IsSpendable(dest)) {\n                ui->labelCoinControlChangeLabel->setText(tr(\"Warning: Unknown change address\"));\n\n                // confirmation dialog\n                QMessageBox::StandardButton btnRetVal = QMessageBox::question(this, tr(\"Confirm custom change address\"), tr(\"The address you selected for change is not part of this wallet. Any or all funds in your wallet may be sent to this address. Are you sure?\"),\n                    QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);\n\n                if(btnRetVal == QMessageBox::Yes)\n                    CoinControlDialog::coinControl()->destChange = dest;\n                else\n                {\n                    ui->lineEditCoinControlChange->setText(\"\");\n                    ui->labelCoinControlChangeLabel->setStyleSheet(\"QLabel{color:black;}\");\n                    ui->labelCoinControlChangeLabel->setText(\"\");\n                }\n            }\n            else // Known change address\n            {\n                ui->labelCoinControlChangeLabel->setStyleSheet(\"QLabel{color:black;}\");\n\n                // Query label\n                QString associatedLabel = model->getAddressTableModel()->labelForAddress(text);\n                if (!associatedLabel.isEmpty())\n                    ui->labelCoinControlChangeLabel->setText(associatedLabel);\n                else\n                    ui->labelCoinControlChangeLabel->setText(tr(\"(no label)\"));\n\n                CoinControlDialog::coinControl()->destChange = dest;\n            }\n        }\n    }\n}\n\n// Coin Control: update labels\nvoid SendCoinsDialog::coinControlUpdateLabels()\n{\n    if (!model || !model->getOptionsModel())\n        return;\n\n    updateCoinControlState(*CoinControlDialog::coinControl());\n\n    // set pay amounts\n    CoinControlDialog::payAmounts.clear();\n    CoinControlDialog::fSubtractFeeFromAmount = false;\n\n    for(int i = 0; i < ui->entries->count(); ++i)\n    {\n        SendCoinsEntry *entry = qobject_cast<SendCoinsEntry*>(ui->entries->itemAt(i)->widget());\n        if(entry && !entry->isHidden())\n        {\n            SendCoinsRecipient rcp = entry->getValue();\n            CoinControlDialog::payAmounts.append(rcp.amount);\n            if (rcp.fSubtractFeeFromAmount)\n                CoinControlDialog::fSubtractFeeFromAmount = true;\n        }\n    }\n\n    if (CoinControlDialog::coinControl()->HasSelected())\n    {\n        // actual coin control calculation\n        CoinControlDialog::updateLabels(model, this);\n\n        // show coin control stats\n        ui->labelCoinControlAutomaticallySelected->hide();\n        ui->widgetCoinControl->show();\n    }\n    else\n    {\n        // hide coin control stats\n        ui->labelCoinControlAutomaticallySelected->show();\n        ui->widgetCoinControl->hide();\n        ui->labelCoinControlInsuffFunds->hide();\n    }\n}\n\nSendConfirmationDialog::SendConfirmationDialog(const QString &title, const QString &text, int _secDelay,\n    QWidget *parent) :\n    QMessageBox(QMessageBox::Question, title, text, QMessageBox::Yes | QMessageBox::Cancel, parent), secDelay(_secDelay)\n{\n    setDefaultButton(QMessageBox::Cancel);\n    yesButton = button(QMessageBox::Yes);\n    updateYesButton();\n    connect(&countDownTimer, SIGNAL(timeout()), this, SLOT(countDown()));\n}\n\nint SendConfirmationDialog::exec()\n{\n    updateYesButton();\n    countDownTimer.start(1000);\n    return QMessageBox::exec();\n}\n\nvoid SendConfirmationDialog::countDown()\n{\n    secDelay--;\n    updateYesButton();\n\n    if(secDelay <= 0)\n    {\n        countDownTimer.stop();\n    }\n}\n\nvoid SendConfirmationDialog::updateYesButton()\n{\n    if(secDelay > 0)\n    {\n        yesButton->setEnabled(false);\n        yesButton->setText(tr(\"Yes\") + \" (\" + QString::number(secDelay) + \")\");\n    }\n    else\n    {\n        yesButton->setEnabled(true);\n        yesButton->setText(tr(\"Yes\"));\n    }\n}\n"
  },
  {
    "path": "src/qt/sendcoinsdialog.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_SENDCOINSDIALOG_H\n#define BITCOIN_QT_SENDCOINSDIALOG_H\n\n#include <qt/walletmodel.h>\n\n#include <QDialog>\n#include <QMessageBox>\n#include <QString>\n#include <QTimer>\n\nclass ClientModel;\nclass PlatformStyle;\nclass SendCoinsEntry;\nclass SendCoinsRecipient;\n\nnamespace Ui {\n    class SendCoinsDialog;\n}\n\nQT_BEGIN_NAMESPACE\nclass QUrl;\nQT_END_NAMESPACE\n\n/** Dialog for sending bitcoins */\nclass SendCoinsDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);\n    ~SendCoinsDialog();\n\n    void setClientModel(ClientModel *clientModel);\n    void setModel(WalletModel *model);\n\n    /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907).\n     */\n    QWidget *setupTabChain(QWidget *prev);\n\n    void setAddress(const QString &address);\n    void pasteEntry(const SendCoinsRecipient &rv);\n    bool handlePaymentRequest(const SendCoinsRecipient &recipient);\n\npublic Q_SLOTS:\n    void clear();\n    void reject();\n    void accept();\n    SendCoinsEntry *addEntry();\n    void updateTabsAndLabels();\n    void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,\n                    const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);\n\nprivate:\n    Ui::SendCoinsDialog *ui;\n    ClientModel *clientModel;\n    WalletModel *model;\n    bool fNewRecipientAllowed;\n    bool fFeeMinimized;\n    const PlatformStyle *platformStyle;\n\n    // Process WalletModel::SendCoinsReturn and generate a pair consisting\n    // of a message and message flags for use in Q_EMIT message().\n    // Additional parameter msgArg can be used via .arg(msgArg).\n    void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString());\n    void minimizeFeeSection(bool fMinimize);\n    void updateFeeMinimizedLabel();\n    // Update the passed in CCoinControl with state from the GUI\n    void updateCoinControlState(CCoinControl& ctrl);\n\nprivate Q_SLOTS:\n    void on_sendButton_clicked();\n    void on_buttonChooseFee_clicked();\n    void on_buttonMinimizeFee_clicked();\n    void removeEntry(SendCoinsEntry* entry);\n    void useAvailableBalance(SendCoinsEntry* entry);\n    void updateDisplayUnit();\n    void coinControlFeatureChanged(bool);\n    void coinControlButtonClicked();\n    void coinControlChangeChecked(int);\n    void coinControlChangeEdited(const QString &);\n    void coinControlUpdateLabels();\n    void coinControlClipboardQuantity();\n    void coinControlClipboardAmount();\n    void coinControlClipboardFee();\n    void coinControlClipboardAfterFee();\n    void coinControlClipboardBytes();\n    void coinControlClipboardLowOutput();\n    void coinControlClipboardChange();\n    void setMinimumFee();\n    void updateFeeSectionControls();\n    void updateMinFeeLabel();\n    void updateSmartFeeLabel();\n\nQ_SIGNALS:\n    // Fired when a message should be reported to the user\n    void message(const QString &title, const QString &message, unsigned int style);\n};\n\n\n#define SEND_CONFIRM_DELAY   3\n\nclass SendConfirmationDialog : public QMessageBox\n{\n    Q_OBJECT\n\npublic:\n    SendConfirmationDialog(const QString &title, const QString &text, int secDelay = SEND_CONFIRM_DELAY, QWidget *parent = 0);\n    int exec();\n\nprivate Q_SLOTS:\n    void countDown();\n    void updateYesButton();\n\nprivate:\n    QAbstractButton *yesButton;\n    QTimer countDownTimer;\n    int secDelay;\n};\n\n#endif // BITCOIN_QT_SENDCOINSDIALOG_H\n"
  },
  {
    "path": "src/qt/sendcoinsentry.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/sendcoinsentry.h>\n#include <qt/forms/ui_sendcoinsentry.h>\n\n#include <qt/addressbookpage.h>\n#include <qt/addresstablemodel.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n#include <qt/platformstyle.h>\n\n#include <QApplication>\n#include <QClipboard>\n\nSendCoinsEntry::SendCoinsEntry(const PlatformStyle *_platformStyle, QWidget *parent) :\n    QStackedWidget(parent),\n    ui(new Ui::SendCoinsEntry),\n    model(0),\n    platformStyle(_platformStyle)\n{\n    ui->setupUi(this);\n\n    ui->addressBookButton->setIcon(platformStyle->SingleColorIcon(\":/icons/address-book\"));\n    ui->pasteButton->setIcon(platformStyle->SingleColorIcon(\":/icons/editpaste\"));\n    ui->deleteButton->setIcon(platformStyle->SingleColorIcon(\":/icons/remove\"));\n    ui->deleteButton_is->setIcon(platformStyle->SingleColorIcon(\":/icons/remove\"));\n    ui->deleteButton_s->setIcon(platformStyle->SingleColorIcon(\":/icons/remove\"));\n\n    setCurrentWidget(ui->SendCoins);\n\n    if (platformStyle->getUseExtraSpacing())\n        ui->payToLayout->setSpacing(4);\n#if QT_VERSION >= 0x040700\n    ui->addAsLabel->setPlaceholderText(tr(\"Enter a label for this address to add it to your address book\"));\n#endif\n\n    // normal bitcoin address field\n    GUIUtil::setupAddressWidget(ui->payTo, this);\n    // just a label for displaying bitcoin address(es)\n    ui->payTo_is->setFont(GUIUtil::fixedPitchFont());\n\n    // Connect signals\n    connect(ui->payAmount, SIGNAL(valueChanged()), this, SIGNAL(payAmountChanged()));\n    connect(ui->checkboxSubtractFeeFromAmount, SIGNAL(toggled(bool)), this, SIGNAL(subtractFeeFromAmountChanged()));\n    connect(ui->deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));\n    connect(ui->deleteButton_is, SIGNAL(clicked()), this, SLOT(deleteClicked()));\n    connect(ui->deleteButton_s, SIGNAL(clicked()), this, SLOT(deleteClicked()));\n    connect(ui->useAvailableBalanceButton, SIGNAL(clicked()), this, SLOT(useAvailableBalanceClicked()));\n}\n\nSendCoinsEntry::~SendCoinsEntry()\n{\n    delete ui;\n}\n\nvoid SendCoinsEntry::on_pasteButton_clicked()\n{\n    // Paste text from clipboard into recipient field\n    ui->payTo->setText(QApplication::clipboard()->text());\n}\n\nvoid SendCoinsEntry::on_addressBookButton_clicked()\n{\n    if(!model)\n        return;\n    AddressBookPage dlg(platformStyle, AddressBookPage::ForSelection, AddressBookPage::SendingTab, this);\n    dlg.setModel(model->getAddressTableModel());\n    if(dlg.exec())\n    {\n        ui->payTo->setText(dlg.getReturnValue());\n        ui->payAmount->setFocus();\n    }\n}\n\nvoid SendCoinsEntry::on_payTo_textChanged(const QString &address)\n{\n    updateLabel(address);\n}\n\nvoid SendCoinsEntry::setModel(WalletModel *_model)\n{\n    this->model = _model;\n\n    if (_model && _model->getOptionsModel())\n        connect(_model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));\n\n    clear();\n}\n\nvoid SendCoinsEntry::clear()\n{\n    // clear UI elements for normal payment\n    ui->payTo->clear();\n    ui->addAsLabel->clear();\n    ui->payAmount->clear();\n    ui->checkboxSubtractFeeFromAmount->setCheckState(Qt::Unchecked);\n    ui->messageTextLabel->clear();\n    ui->messageTextLabel->hide();\n    ui->messageLabel->hide();\n    // clear UI elements for unauthenticated payment request\n    ui->payTo_is->clear();\n    ui->memoTextLabel_is->clear();\n    ui->payAmount_is->clear();\n    // clear UI elements for authenticated payment request\n    ui->payTo_s->clear();\n    ui->memoTextLabel_s->clear();\n    ui->payAmount_s->clear();\n\n    // update the display unit, to not use the default (\"BTC\")\n    updateDisplayUnit();\n}\n\nvoid SendCoinsEntry::checkSubtractFeeFromAmount()\n{\n    ui->checkboxSubtractFeeFromAmount->setChecked(true);\n}\n\nvoid SendCoinsEntry::deleteClicked()\n{\n    Q_EMIT removeEntry(this);\n}\n\nvoid SendCoinsEntry::useAvailableBalanceClicked()\n{\n    Q_EMIT useAvailableBalance(this);\n}\n\nbool SendCoinsEntry::validate()\n{\n    if (!model)\n        return false;\n\n    // Check input validity\n    bool retval = true;\n\n    // Skip checks for payment request\n    if (recipient.paymentRequest.IsInitialized())\n        return retval;\n\n    if (!model->validateAddress(ui->payTo->text()))\n    {\n        ui->payTo->setValid(false);\n        retval = false;\n    }\n\n    if (!ui->payAmount->validate())\n    {\n        retval = false;\n    }\n\n    // Sending a zero amount is invalid\n    if (ui->payAmount->value(0) <= 0)\n    {\n        ui->payAmount->setValid(false);\n        retval = false;\n    }\n\n    // Reject dust outputs:\n    if (retval && GUIUtil::isDust(ui->payTo->text(), ui->payAmount->value())) {\n        ui->payAmount->setValid(false);\n        retval = false;\n    }\n\n    return retval;\n}\n\nSendCoinsRecipient SendCoinsEntry::getValue()\n{\n    // Payment request\n    if (recipient.paymentRequest.IsInitialized())\n        return recipient;\n\n    // Normal payment\n    recipient.address = ui->payTo->text();\n    recipient.label = ui->addAsLabel->text();\n    recipient.amount = ui->payAmount->value();\n    recipient.message = ui->messageTextLabel->text();\n    recipient.fSubtractFeeFromAmount = (ui->checkboxSubtractFeeFromAmount->checkState() == Qt::Checked);\n\n    return recipient;\n}\n\nQWidget *SendCoinsEntry::setupTabChain(QWidget *prev)\n{\n    QWidget::setTabOrder(prev, ui->payTo);\n    QWidget::setTabOrder(ui->payTo, ui->addAsLabel);\n    QWidget *w = ui->payAmount->setupTabChain(ui->addAsLabel);\n    QWidget::setTabOrder(w, ui->checkboxSubtractFeeFromAmount);\n    QWidget::setTabOrder(ui->checkboxSubtractFeeFromAmount, ui->addressBookButton);\n    QWidget::setTabOrder(ui->addressBookButton, ui->pasteButton);\n    QWidget::setTabOrder(ui->pasteButton, ui->deleteButton);\n    return ui->deleteButton;\n}\n\nvoid SendCoinsEntry::setValue(const SendCoinsRecipient &value)\n{\n    recipient = value;\n\n    if (recipient.paymentRequest.IsInitialized()) // payment request\n    {\n        if (recipient.authenticatedMerchant.isEmpty()) // unauthenticated\n        {\n            ui->payTo_is->setText(recipient.address);\n            ui->memoTextLabel_is->setText(recipient.message);\n            ui->payAmount_is->setValue(recipient.amount);\n            ui->payAmount_is->setReadOnly(true);\n            setCurrentWidget(ui->SendCoins_UnauthenticatedPaymentRequest);\n        }\n        else // authenticated\n        {\n            ui->payTo_s->setText(recipient.authenticatedMerchant);\n            ui->memoTextLabel_s->setText(recipient.message);\n            ui->payAmount_s->setValue(recipient.amount);\n            ui->payAmount_s->setReadOnly(true);\n            setCurrentWidget(ui->SendCoins_AuthenticatedPaymentRequest);\n        }\n    }\n    else // normal payment\n    {\n        // message\n        ui->messageTextLabel->setText(recipient.message);\n        ui->messageTextLabel->setVisible(!recipient.message.isEmpty());\n        ui->messageLabel->setVisible(!recipient.message.isEmpty());\n\n        ui->addAsLabel->clear();\n        ui->payTo->setText(recipient.address); // this may set a label from addressbook\n        if (!recipient.label.isEmpty()) // if a label had been set from the addressbook, don't overwrite with an empty label\n            ui->addAsLabel->setText(recipient.label);\n        ui->payAmount->setValue(recipient.amount);\n    }\n}\n\nvoid SendCoinsEntry::setAddress(const QString &address)\n{\n    ui->payTo->setText(address);\n    ui->payAmount->setFocus();\n}\n\nvoid SendCoinsEntry::setAmount(const CAmount &amount)\n{\n    ui->payAmount->setValue(amount);\n}\n\nbool SendCoinsEntry::isClear()\n{\n    return ui->payTo->text().isEmpty() && ui->payTo_is->text().isEmpty() && ui->payTo_s->text().isEmpty();\n}\n\nvoid SendCoinsEntry::setFocus()\n{\n    ui->payTo->setFocus();\n}\n\nvoid SendCoinsEntry::updateDisplayUnit()\n{\n    if(model && model->getOptionsModel())\n    {\n        // Update payAmount with the current unit\n        ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());\n        ui->payAmount_is->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());\n        ui->payAmount_s->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());\n    }\n}\n\nbool SendCoinsEntry::updateLabel(const QString &address)\n{\n    if(!model)\n        return false;\n\n    // Fill in label from address book, if address has an associated label\n    QString associatedLabel = model->getAddressTableModel()->labelForAddress(address);\n    if(!associatedLabel.isEmpty())\n    {\n        ui->addAsLabel->setText(associatedLabel);\n        return true;\n    }\n\n    return false;\n}\n"
  },
  {
    "path": "src/qt/sendcoinsentry.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_SENDCOINSENTRY_H\n#define BITCOIN_QT_SENDCOINSENTRY_H\n\n#include <qt/walletmodel.h>\n\n#include <QStackedWidget>\n\nclass WalletModel;\nclass PlatformStyle;\n\nnamespace Ui {\n    class SendCoinsEntry;\n}\n\n/**\n * A single entry in the dialog for sending bitcoins.\n * Stacked widget, with different UIs for payment requests\n * with a strong payee identity.\n */\nclass SendCoinsEntry : public QStackedWidget\n{\n    Q_OBJECT\n\npublic:\n    explicit SendCoinsEntry(const PlatformStyle *platformStyle, QWidget *parent = 0);\n    ~SendCoinsEntry();\n\n    void setModel(WalletModel *model);\n    bool validate();\n    SendCoinsRecipient getValue();\n\n    /** Return whether the entry is still empty and unedited */\n    bool isClear();\n\n    void setValue(const SendCoinsRecipient &value);\n    void setAddress(const QString &address);\n    void setAmount(const CAmount &amount);\n\n    /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases\n     *  (issue https://bugreports.qt-project.org/browse/QTBUG-10907).\n     */\n    QWidget *setupTabChain(QWidget *prev);\n\n    void setFocus();\n\npublic Q_SLOTS:\n    void clear();\n    void checkSubtractFeeFromAmount();\n\nQ_SIGNALS:\n    void removeEntry(SendCoinsEntry *entry);\n    void useAvailableBalance(SendCoinsEntry* entry);\n    void payAmountChanged();\n    void subtractFeeFromAmountChanged();\n\nprivate Q_SLOTS:\n    void deleteClicked();\n    void useAvailableBalanceClicked();\n    void on_payTo_textChanged(const QString &address);\n    void on_addressBookButton_clicked();\n    void on_pasteButton_clicked();\n    void updateDisplayUnit();\n\nprivate:\n    SendCoinsRecipient recipient;\n    Ui::SendCoinsEntry *ui;\n    WalletModel *model;\n    const PlatformStyle *platformStyle;\n\n    bool updateLabel(const QString &address);\n};\n\n#endif // BITCOIN_QT_SENDCOINSENTRY_H\n"
  },
  {
    "path": "src/qt/signverifymessagedialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/signverifymessagedialog.h>\n#include <qt/forms/ui_signverifymessagedialog.h>\n\n#include <qt/addressbookpage.h>\n#include <qt/guiutil.h>\n#include <qt/platformstyle.h>\n#include <qt/walletmodel.h>\n\n#include <base58.h>\n#include <init.h>\n#include <validation.h> // For strMessageMagic\n#include <wallet/wallet.h>\n\n#include <string>\n#include <vector>\n\n#include <QClipboard>\n\nSignVerifyMessageDialog::SignVerifyMessageDialog(const PlatformStyle *_platformStyle, QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::SignVerifyMessageDialog),\n    model(0),\n    platformStyle(_platformStyle)\n{\n    ui->setupUi(this);\n\n    ui->addressBookButton_SM->setIcon(platformStyle->SingleColorIcon(\":/icons/address-book\"));\n    ui->pasteButton_SM->setIcon(platformStyle->SingleColorIcon(\":/icons/editpaste\"));\n    ui->copySignatureButton_SM->setIcon(platformStyle->SingleColorIcon(\":/icons/editcopy\"));\n    ui->signMessageButton_SM->setIcon(platformStyle->SingleColorIcon(\":/icons/edit\"));\n    ui->clearButton_SM->setIcon(platformStyle->SingleColorIcon(\":/icons/remove\"));\n    ui->addressBookButton_VM->setIcon(platformStyle->SingleColorIcon(\":/icons/address-book\"));\n    ui->verifyMessageButton_VM->setIcon(platformStyle->SingleColorIcon(\":/icons/transaction_0\"));\n    ui->clearButton_VM->setIcon(platformStyle->SingleColorIcon(\":/icons/remove\"));\n\n#if QT_VERSION >= 0x040700\n    ui->signatureOut_SM->setPlaceholderText(tr(\"Click \\\"Sign Message\\\" to generate signature\"));\n#endif\n\n    GUIUtil::setupAddressWidget(ui->addressIn_SM, this);\n    GUIUtil::setupAddressWidget(ui->addressIn_VM, this);\n\n    ui->addressIn_SM->installEventFilter(this);\n    ui->messageIn_SM->installEventFilter(this);\n    ui->signatureOut_SM->installEventFilter(this);\n    ui->addressIn_VM->installEventFilter(this);\n    ui->messageIn_VM->installEventFilter(this);\n    ui->signatureIn_VM->installEventFilter(this);\n\n    ui->signatureOut_SM->setFont(GUIUtil::fixedPitchFont());\n    ui->signatureIn_VM->setFont(GUIUtil::fixedPitchFont());\n}\n\nSignVerifyMessageDialog::~SignVerifyMessageDialog()\n{\n    delete ui;\n}\n\nvoid SignVerifyMessageDialog::setModel(WalletModel *_model)\n{\n    this->model = _model;\n}\n\nvoid SignVerifyMessageDialog::setAddress_SM(const QString &address)\n{\n    ui->addressIn_SM->setText(address);\n    ui->messageIn_SM->setFocus();\n}\n\nvoid SignVerifyMessageDialog::setAddress_VM(const QString &address)\n{\n    ui->addressIn_VM->setText(address);\n    ui->messageIn_VM->setFocus();\n}\n\nvoid SignVerifyMessageDialog::showTab_SM(bool fShow)\n{\n    ui->tabWidget->setCurrentIndex(0);\n    if (fShow)\n        this->show();\n}\n\nvoid SignVerifyMessageDialog::showTab_VM(bool fShow)\n{\n    ui->tabWidget->setCurrentIndex(1);\n    if (fShow)\n        this->show();\n}\n\nvoid SignVerifyMessageDialog::on_addressBookButton_SM_clicked()\n{\n    if (model && model->getAddressTableModel())\n    {\n        AddressBookPage dlg(platformStyle, AddressBookPage::ForSelection, AddressBookPage::ReceivingTab, this);\n        dlg.setModel(model->getAddressTableModel());\n        if (dlg.exec())\n        {\n            setAddress_SM(dlg.getReturnValue());\n        }\n    }\n}\n\nvoid SignVerifyMessageDialog::on_pasteButton_SM_clicked()\n{\n    setAddress_SM(QApplication::clipboard()->text());\n}\n\nvoid SignVerifyMessageDialog::on_signMessageButton_SM_clicked()\n{\n    if (!model)\n        return;\n\n    /* Clear old signature to ensure users don't get confused on error with an old signature displayed */\n    ui->signatureOut_SM->clear();\n\n    CTxDestination destination = DecodeDestination(ui->addressIn_SM->text().toStdString());\n    if (!IsValidDestination(destination)) {\n        ui->statusLabel_SM->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel_SM->setText(tr(\"The entered address is invalid.\") + QString(\" \") + tr(\"Please check the address and try again.\"));\n        return;\n    }\n    const CKeyID* keyID = boost::get<CKeyID>(&destination);\n    if (!keyID) {\n        ui->addressIn_SM->setValid(false);\n        ui->statusLabel_SM->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel_SM->setText(tr(\"The entered address does not refer to a key.\") + QString(\" \") + tr(\"Please check the address and try again.\"));\n        return;\n    }\n\n    WalletModel::UnlockContext ctx(model->requestUnlock());\n    if (!ctx.isValid())\n    {\n        ui->statusLabel_SM->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel_SM->setText(tr(\"Wallet unlock was cancelled.\"));\n        return;\n    }\n\n    CKey key;\n    if (!model->getPrivKey(*keyID, key))\n    {\n        ui->statusLabel_SM->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel_SM->setText(tr(\"Private key for the entered address is not available.\"));\n        return;\n    }\n\n    CHashWriter ss(SER_GETHASH, 0);\n    ss << strMessageMagic;\n    ss << ui->messageIn_SM->document()->toPlainText().toStdString();\n\n    std::vector<unsigned char> vchSig;\n    if (!key.SignCompact(ss.GetHash(), vchSig))\n    {\n        ui->statusLabel_SM->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel_SM->setText(QString(\"<nobr>\") + tr(\"Message signing failed.\") + QString(\"</nobr>\"));\n        return;\n    }\n\n    ui->statusLabel_SM->setStyleSheet(\"QLabel { color: green; }\");\n    ui->statusLabel_SM->setText(QString(\"<nobr>\") + tr(\"Message signed.\") + QString(\"</nobr>\"));\n\n    ui->signatureOut_SM->setText(QString::fromStdString(EncodeBase64(vchSig.data(), vchSig.size())));\n}\n\nvoid SignVerifyMessageDialog::on_copySignatureButton_SM_clicked()\n{\n    GUIUtil::setClipboard(ui->signatureOut_SM->text());\n}\n\nvoid SignVerifyMessageDialog::on_clearButton_SM_clicked()\n{\n    ui->addressIn_SM->clear();\n    ui->messageIn_SM->clear();\n    ui->signatureOut_SM->clear();\n    ui->statusLabel_SM->clear();\n\n    ui->addressIn_SM->setFocus();\n}\n\nvoid SignVerifyMessageDialog::on_addressBookButton_VM_clicked()\n{\n    if (model && model->getAddressTableModel())\n    {\n        AddressBookPage dlg(platformStyle, AddressBookPage::ForSelection, AddressBookPage::SendingTab, this);\n        dlg.setModel(model->getAddressTableModel());\n        if (dlg.exec())\n        {\n            setAddress_VM(dlg.getReturnValue());\n        }\n    }\n}\n\nvoid SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked()\n{\n    CTxDestination destination = DecodeDestination(ui->addressIn_VM->text().toStdString());\n    if (!IsValidDestination(destination)) {\n        ui->statusLabel_VM->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel_VM->setText(tr(\"The entered address is invalid.\") + QString(\" \") + tr(\"Please check the address and try again.\"));\n        return;\n    }\n    if (!boost::get<CKeyID>(&destination)) {\n        ui->addressIn_VM->setValid(false);\n        ui->statusLabel_VM->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel_VM->setText(tr(\"The entered address does not refer to a key.\") + QString(\" \") + tr(\"Please check the address and try again.\"));\n        return;\n    }\n\n    bool fInvalid = false;\n    std::vector<unsigned char> vchSig = DecodeBase64(ui->signatureIn_VM->text().toStdString().c_str(), &fInvalid);\n\n    if (fInvalid)\n    {\n        ui->signatureIn_VM->setValid(false);\n        ui->statusLabel_VM->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel_VM->setText(tr(\"The signature could not be decoded.\") + QString(\" \") + tr(\"Please check the signature and try again.\"));\n        return;\n    }\n\n    CHashWriter ss(SER_GETHASH, 0);\n    ss << strMessageMagic;\n    ss << ui->messageIn_VM->document()->toPlainText().toStdString();\n\n    CPubKey pubkey;\n    if (!pubkey.RecoverCompact(ss.GetHash(), vchSig))\n    {\n        ui->signatureIn_VM->setValid(false);\n        ui->statusLabel_VM->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel_VM->setText(tr(\"The signature did not match the message digest.\") + QString(\" \") + tr(\"Please check the signature and try again.\"));\n        return;\n    }\n\n    if (!(CTxDestination(pubkey.GetID()) == destination)) {\n        ui->statusLabel_VM->setStyleSheet(\"QLabel { color: red; }\");\n        ui->statusLabel_VM->setText(QString(\"<nobr>\") + tr(\"Message verification failed.\") + QString(\"</nobr>\"));\n        return;\n    }\n\n    ui->statusLabel_VM->setStyleSheet(\"QLabel { color: green; }\");\n    ui->statusLabel_VM->setText(QString(\"<nobr>\") + tr(\"Message verified.\") + QString(\"</nobr>\"));\n}\n\nvoid SignVerifyMessageDialog::on_clearButton_VM_clicked()\n{\n    ui->addressIn_VM->clear();\n    ui->signatureIn_VM->clear();\n    ui->messageIn_VM->clear();\n    ui->statusLabel_VM->clear();\n\n    ui->addressIn_VM->setFocus();\n}\n\nbool SignVerifyMessageDialog::eventFilter(QObject *object, QEvent *event)\n{\n    if (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::FocusIn)\n    {\n        if (ui->tabWidget->currentIndex() == 0)\n        {\n            /* Clear status message on focus change */\n            ui->statusLabel_SM->clear();\n\n            /* Select generated signature */\n            if (object == ui->signatureOut_SM)\n            {\n                ui->signatureOut_SM->selectAll();\n                return true;\n            }\n        }\n        else if (ui->tabWidget->currentIndex() == 1)\n        {\n            /* Clear status message on focus change */\n            ui->statusLabel_VM->clear();\n        }\n    }\n    return QDialog::eventFilter(object, event);\n}\n"
  },
  {
    "path": "src/qt/signverifymessagedialog.h",
    "content": "// Copyright (c) 2011-2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_SIGNVERIFYMESSAGEDIALOG_H\n#define BITCOIN_QT_SIGNVERIFYMESSAGEDIALOG_H\n\n#include <QDialog>\n\nclass PlatformStyle;\nclass WalletModel;\n\nnamespace Ui {\n    class SignVerifyMessageDialog;\n}\n\nclass SignVerifyMessageDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit SignVerifyMessageDialog(const PlatformStyle *platformStyle, QWidget *parent);\n    ~SignVerifyMessageDialog();\n\n    void setModel(WalletModel *model);\n    void setAddress_SM(const QString &address);\n    void setAddress_VM(const QString &address);\n\n    void showTab_SM(bool fShow);\n    void showTab_VM(bool fShow);\n\nprotected:\n    bool eventFilter(QObject *object, QEvent *event);\n\nprivate:\n    Ui::SignVerifyMessageDialog *ui;\n    WalletModel *model;\n    const PlatformStyle *platformStyle;\n\nprivate Q_SLOTS:\n    /* sign message */\n    void on_addressBookButton_SM_clicked();\n    void on_pasteButton_SM_clicked();\n    void on_signMessageButton_SM_clicked();\n    void on_copySignatureButton_SM_clicked();\n    void on_clearButton_SM_clicked();\n    /* verify message */\n    void on_addressBookButton_VM_clicked();\n    void on_verifyMessageButton_VM_clicked();\n    void on_clearButton_VM_clicked();\n};\n\n#endif // BITCOIN_QT_SIGNVERIFYMESSAGEDIALOG_H\n"
  },
  {
    "path": "src/qt/splashscreen.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <qt/splashscreen.h>\n\n#include <qt/networkstyle.h>\n\n#include <clientversion.h>\n#include <init.h>\n#include <util.h>\n#include <ui_interface.h>\n#include <version.h>\n\n#ifdef ENABLE_WALLET\n#include <wallet/wallet.h>\n#endif\n\n#include <QApplication>\n#include <QCloseEvent>\n#include <QDesktopWidget>\n#include <QPainter>\n#include <QRadialGradient>\n\n// FIXME.SUGAR\n// QT SplashScreen Sugarchain\nSplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) :\n    QWidget(0, f), curAlignment(0)\n{\n    // set reference point, paddings\n    int paddingRight            = 50*3.0+1;\n    int paddingTop              = 50*1.0;\n    int titleVersionVSpace      = 17;\n    int titleCopyrightVSpace    = 40;\n\n    float fontFactor            = 1.0;\n    float devicePixelRatio      = 1.0;\n#if QT_VERSION > 0x050100\n    devicePixelRatio = ((QGuiApplication*)QCoreApplication::instance())->devicePixelRatio();\n#endif\n\n    // define text to place\n    QString titleText       = tr(PACKAGE_NAME);\n    QString versionText     = QString(\"Version %1\").arg(QString::fromStdString(FormatFullVersion()));\n\n    // BEGIN - Adding Additional CopyrightHolders (2/2)\n    // Duplicated <init.cpp> but little bit different\n    const std::string Copyright_1 = strprintf(_(\"\\xc2\\xA9 %u-%u \"), 2009, 2010) + \"Satoshi Nakamoto\";\n    const std::string Copyright_2 = strprintf(_(\"\\xc2\\xA9 %u-%u \"), 2009, 2018) + \"The Bitcoin Core developers\";\n    const std::string Copyright_3 = strprintf(_(\"\\xc2\\xA9 %u-%u \"), 2013, 2019) + \"Alexander Peslyak - Yespower 1.0.1\";\n    const std::string Copyright_4 = strprintf(_(\"\\xc2\\xA9 %u-%u \"), 2016, 2018) + \"The Zcash developers - DigiShieldZEC\";\n    // END - Adding Additional CopyrightHolders (2/2)\n\n    // BEGIN - Placing Additional CopyrightHolders\n    QString copyrightText   = QString::fromUtf8(\n        (\n            Copyright_1 + \"\\n\" +\n            Copyright_2 + \"\\n\" +\n            Copyright_3 + \"\\n\" +\n            Copyright_4 + \"\\n\" +\n            CopyrightHolders(strprintf(\"\\xc2\\xA9 %u-%u \", 2018, COPYRIGHT_YEAR))\n        ).c_str()\n    );\n    // END - Placing Additional CopyrightHolders\n\n    QString titleAddText    = networkStyle->getTitleAddText();\n\n    QString font            = QApplication::font().toString();\n\n    // create a bitmap according to device pixelratio\n    QSize splashSize(480*devicePixelRatio,320*devicePixelRatio);\n    pixmap = QPixmap(splashSize);\n\n#if QT_VERSION > 0x050100\n    // change to HiDPI if it makes sense\n    pixmap.setDevicePixelRatio(devicePixelRatio);\n#endif\n\n    QPainter pixPaint(&pixmap);\n    pixPaint.setPen(QColor(100,100,100));\n\n    // draw a slightly radial gradient\n    QRadialGradient gradient(QPoint(0,0), splashSize.width()/devicePixelRatio);\n    gradient.setColorAt(0, Qt::white);\n    gradient.setColorAt(1, QColor(247,247,247));\n    QRect rGradient(QPoint(0,0), splashSize);\n    pixPaint.fillRect(rGradient, gradient);\n\n    // draw the bitcoin icon, expected size of PNG: 1024x1024\n    // QRect rectIcon(QPoint(-150,-122), QSize(430,430));\n    QRect rectIcon(QPoint(120,40), QSize(480,480));\n\n    const QSize requiredSize(1024,1024);\n    QPixmap icon(networkStyle->getAppIcon().pixmap(requiredSize));\n\n    pixPaint.drawPixmap(rectIcon, icon);\n\n    // check font size and drawing with\n    pixPaint.setFont(QFont(font, 33*fontFactor));\n    QFontMetrics fm = pixPaint.fontMetrics();\n    int titleTextWidth = fm.width(titleText);\n    if (titleTextWidth > 176*1.75) {\n        fontFactor = fontFactor * 176*1.75 / titleTextWidth;\n    }\n\n    pixPaint.setFont(QFont(font, 33*fontFactor));\n    fm = pixPaint.fontMetrics();\n    titleTextWidth  = fm.width(titleText);\n    pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight,paddingTop,titleText);\n\n    pixPaint.setFont(QFont(font, 15*fontFactor));\n\n    // if the version string is to long, reduce size\n    fm = pixPaint.fontMetrics();\n    int versionTextWidth  = fm.width(versionText);\n    if(versionTextWidth > titleTextWidth+paddingRight-10) {\n        pixPaint.setFont(QFont(font, 10*fontFactor));\n        titleVersionVSpace -= 5;\n    }\n    pixPaint.drawText(pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight+2,paddingTop+titleVersionVSpace,versionText);\n\n    // draw copyright stuff\n    {\n        pixPaint.setFont(QFont(font, 13*fontFactor));\n        const int x = pixmap.width()/devicePixelRatio-titleTextWidth-paddingRight;\n        const int y = paddingTop+titleCopyrightVSpace;\n        QRect copyrightRect(x, y, pixmap.width() - x - paddingRight, pixmap.height() - y);\n        pixPaint.drawText(copyrightRect, Qt::AlignLeft | Qt::AlignTop | Qt::TextWordWrap, copyrightText);\n    }\n\n    // draw additional text if special network\n    if(!titleAddText.isEmpty()) {\n        QFont boldFont = QFont(font, 10*fontFactor);\n        boldFont.setWeight(QFont::Bold);\n        pixPaint.setFont(boldFont);\n        fm = pixPaint.fontMetrics();\n        int titleAddTextWidth  = fm.width(titleAddText);\n        pixPaint.drawText(pixmap.width()/devicePixelRatio-titleAddTextWidth-10,15,titleAddText);\n    }\n\n    pixPaint.end();\n\n    // Set window title\n    setWindowTitle(titleText + \" \" + titleAddText);\n\n    // Resize window and move to center of desktop, disallow resizing\n    QRect r(QPoint(), QSize(pixmap.size().width()/devicePixelRatio,pixmap.size().height()/devicePixelRatio));\n    resize(r.size());\n    setFixedSize(r.size());\n    move(QApplication::desktop()->screenGeometry().center() - r.center());\n\n    subscribeToCoreSignals();\n    installEventFilter(this);\n}\n\nSplashScreen::~SplashScreen()\n{\n    unsubscribeFromCoreSignals();\n}\n\nbool SplashScreen::eventFilter(QObject * obj, QEvent * ev) {\n    if (ev->type() == QEvent::KeyPress) {\n        QKeyEvent *keyEvent = static_cast<QKeyEvent *>(ev);\n        if(keyEvent->text()[0] == 'q') {\n            StartShutdown();\n        }\n    }\n    return QObject::eventFilter(obj, ev);\n}\n\nvoid SplashScreen::slotFinish(QWidget *mainWin)\n{\n    Q_UNUSED(mainWin);\n\n    /* If the window is minimized, hide() will be ignored. */\n    /* Make sure we de-minimize the splashscreen window before hiding */\n    if (isMinimized())\n        showNormal();\n    hide();\n    deleteLater(); // No more need for this\n}\n\nstatic void InitMessage(SplashScreen *splash, const std::string &message)\n{\n    QMetaObject::invokeMethod(splash, \"showMessage\",\n        Qt::QueuedConnection,\n        Q_ARG(QString, QString::fromStdString(message)),\n        Q_ARG(int, Qt::AlignBottom|Qt::AlignHCenter),\n        Q_ARG(QColor, QColor(255,255,255)));\n}\n\nstatic void ShowProgress(SplashScreen *splash, const std::string &title, int nProgress, bool resume_possible)\n{\n    InitMessage(splash, title + std::string(\"\\n\") +\n            (resume_possible ? _(\"(press q to shutdown and continue later)\")\n                                : _(\"press q to shutdown\")) +\n            strprintf(\"\\n%d\", nProgress) + \"%\");\n}\n\n#ifdef ENABLE_WALLET\nvoid SplashScreen::ConnectWallet(CWallet* wallet)\n{\n    wallet->ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2, false));\n    connectedWallets.push_back(wallet);\n}\n#endif\n\nvoid SplashScreen::subscribeToCoreSignals()\n{\n    // Connect signals to client\n    uiInterface.InitMessage.connect(boost::bind(InitMessage, this, _1));\n    uiInterface.ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2, _3));\n#ifdef ENABLE_WALLET\n    uiInterface.LoadWallet.connect(boost::bind(&SplashScreen::ConnectWallet, this, _1));\n#endif\n}\n\nvoid SplashScreen::unsubscribeFromCoreSignals()\n{\n    // Disconnect signals from client\n    uiInterface.InitMessage.disconnect(boost::bind(InitMessage, this, _1));\n    uiInterface.ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2, _3));\n#ifdef ENABLE_WALLET\n    for (CWallet* const & pwallet : connectedWallets) {\n        pwallet->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2, false));\n    }\n#endif\n}\n\nvoid SplashScreen::showMessage(const QString &message, int alignment, const QColor &color)\n{\n    curMessage = message;\n    curAlignment = alignment;\n    curColor = color;\n    update();\n}\n\nvoid SplashScreen::paintEvent(QPaintEvent *event)\n{\n    QPainter painter(this);\n    painter.drawPixmap(0, 0, pixmap);\n    QRect r = rect().adjusted(5, 5, -5, -5);\n    painter.setPen(curColor);\n    painter.drawText(r, curAlignment, curMessage);\n}\n\nvoid SplashScreen::closeEvent(QCloseEvent *event)\n{\n    StartShutdown(); // allows an \"emergency\" shutdown during startup\n    event->ignore();\n}\n"
  },
  {
    "path": "src/qt/splashscreen.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_SPLASHSCREEN_H\n#define BITCOIN_QT_SPLASHSCREEN_H\n\n#include <functional>\n#include <QSplashScreen>\n\nclass CWallet;\nclass NetworkStyle;\n\n/** Class for the splashscreen with information of the running client.\n *\n * @note this is intentionally not a QSplashScreen. Bitcoin Core initialization\n * can take a long time, and in that case a progress window that cannot be\n * moved around and minimized has turned out to be frustrating to the user.\n */\nclass SplashScreen : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    explicit SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle);\n    ~SplashScreen();\n\nprotected:\n    void paintEvent(QPaintEvent *event);\n    void closeEvent(QCloseEvent *event);\n\npublic Q_SLOTS:\n    /** Slot to call finish() method as it's not defined as slot */\n    void slotFinish(QWidget *mainWin);\n\n    /** Show message and progress */\n    void showMessage(const QString &message, int alignment, const QColor &color);\n\nprotected:\n    bool eventFilter(QObject * obj, QEvent * ev);\n\nprivate:\n    /** Connect core signals to splash screen */\n    void subscribeToCoreSignals();\n    /** Disconnect core signals to splash screen */\n    void unsubscribeFromCoreSignals();\n    /** Connect wallet signals to splash screen */\n    void ConnectWallet(CWallet*);\n\n    QPixmap pixmap;\n    QString curMessage;\n    QColor curColor;\n    int curAlignment;\n\n    QList<CWallet*> connectedWallets;\n};\n\n#endif // BITCOIN_QT_SPLASHSCREEN_H\n"
  },
  {
    "path": "src/qt/test/compattests.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/paymentrequestplus.h> // this includes protobuf's port.h which defines its own bswap macos\n\n#include <qt/test/compattests.h>\n\n#include <compat/byteswap.h>\n\nvoid CompatTests::bswapTests()\n{\n\t// Sibling in bitcoin/src/test/bswap_tests.cpp\n\tuint16_t u1 = 0x1234;\n\tuint32_t u2 = 0x56789abc;\n\tuint64_t u3 = 0xdef0123456789abc;\n\tuint16_t e1 = 0x3412;\n\tuint32_t e2 = 0xbc9a7856;\n\tuint64_t e3 = 0xbc9a78563412f0de;\n\tQVERIFY(bswap_16(u1) == e1);\n\tQVERIFY(bswap_32(u2) == e2);\n\tQVERIFY(bswap_64(u3) == e3);\n}\n"
  },
  {
    "path": "src/qt/test/compattests.h",
    "content": "// Copyright (c) 2009-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TEST_COMPATTESTS_H\n#define BITCOIN_QT_TEST_COMPATTESTS_H\n\n#include <QObject>\n#include <QTest>\n\nclass CompatTests : public QObject\n{\n    Q_OBJECT\n\nprivate Q_SLOTS:\n    void bswapTests();\n};\n\n#endif // BITCOIN_QT_TEST_COMPATTESTS_H\n"
  },
  {
    "path": "src/qt/test/paymentrequestdata.h",
    "content": "// Copyright (c) 2009-2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n//\n// Data for paymentservertests.cpp\n//\n\n// Base64/DER-encoded fake certificate authority certificates.\n// Convert pem to base64/der with:\n// openssl x509 -in cert.pem -inform PEM -outform DER | openssl enc -base64\n\n// Serial Number: 10302349811211485352 (0x8ef94c91b112c0a8)\n// Issuer: CN=PaymentRequest Test CA\n// Subject: CN=PaymentRequest Test CA\n// Not Valid After : Dec  8 16:37:24 2022 GMT\n//\nconst char* caCert1_BASE64 =\n\"\\\nMIIB0DCCATmgAwIBAgIJAI75TJGxEsCoMA0GCSqGSIb3DQEBCwUAMCExHzAdBgNV\\\nBAMTFlBheW1lbnRSZXF1ZXN0IFRlc3QgQ0EwHhcNMTIxMjEwMTYzNzI0WhcNMjIx\\\nMjA4MTYzNzI0WjAhMR8wHQYDVQQDExZQYXltZW50UmVxdWVzdCBUZXN0IENBMIGf\\\nMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCvua59nX9radoqDYyplcns5qdVDTN1\\\n7tmcGixmMYOYU3UYMU55VSsJs0dWKnMm3COQDY+N63c0XSbRqarBcsLTkaNASuPX\\\nFCv1VWuEKSyy5xe4zeoDU7CVSzlxtQD9wbZW/s3ISjgaXBpwn6eVmntb0JwYxxPc\\\nM1u/hrMD8BDbSQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUA\\\nA4GBADSaRgK5xe47XxycXBhHhr0Wgl4pAsFsufqA9aB9r8KNEHJ0yUvvbD/jaJJM\\\nRtQcf0AJ9olzUMY4syehxbzUJP6aeXhZEYiMvdvcv9D55clq6+WLLlNT3jBgAaVn\\\np3waRjPD4bUX3nv+ojz5s4puw7Qq5QUZlhGsMzPvwDGCmZkL\\\n\";\n\n// Serial Number: f0:da:97:e4:38:d7:64:16\n// Issuer: CN=PaymentRequest Test CA\n// Subject: CN=PaymentRequest Test CA\n// Not Valid After : Jan  8 18:21:06 2025 GMT\n//\nconst char* caCert2_BASE64 =\n\"\\\nMIIC1TCCAb2gAwIBAgIJAPDal+Q412QWMA0GCSqGSIb3DQEBCwUAMCExHzAdBgNV\\\nBAMMFlBheW1lbnRSZXF1ZXN0IFRlc3QgQ0EwHhcNMTUwMTExMTgyMTA2WhcNMjUw\\\nMTA4MTgyMTA2WjAhMR8wHQYDVQQDDBZQYXltZW50UmVxdWVzdCBUZXN0IENBMIIB\\\nIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1S9wVLfTplJuT/1OaaBgl/Mb\\\nI392v8S9kHbzYz7B4OTMslaO7piz0v3SO3TKMh0dswjiRdHrIgpO7XdIUQiU/ugg\\\nxDw0kuNehfz1ycaGedlFFtFHTNXqLyIUF3dlwHhQwaomM6RXoJmxLny5BhYHEcmk\\\nyWwr3Cdjd9gAZpblugVJB9C1e40uyL8ao4PHdLzOqO27iSe6riP8SwwisJZEbMaz\\\nAZpgNEEMbIXPJEFvm5HTRXSMtQCOTSZYMFF0M2yrtmlECnz7hWP19b9bcoDzZQB4\\\nylIsFG/7q2jV7MC/e2STZv+niJiHL08RUdoFpAgzaxMgqj63C7B55HgNDNHJYQID\\\nAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBGejPxLxj9\\\n+crv6gUeEBMZPiUx7pUgcI22Wm5yymP96B4fwI3Y0DBehq20d76vbWGPN17Z6pH3\\\nge7PVY1SYqXtS6hXTo4olCm/BZADli+2Bs2xCiaa+Ltve4ufVej+bKJXN/YnrhvO\\\nKq+klQkuuHywU+GJV/NQeBqToIrSOBgi477NgLFCCCmmx2QWsxHoCFGfuRCBVseT\\\nz2k/tMuALCDXGeZBRPTsGHu1y4cj84swAeoDK5QSQcI+Ub7GKc+zkoj02sdDLiMo\\\n3wokYPcIy47oclhmb4xubHc+y7nF610yZBoC/zgbhbawnZ65hDDWkdQ/SVAnWZD7\\\n9PFfmNnYPTQH\\\n\";\n\n//\n// This payment request validates directly against the\n// caCert1 certificate authority.\n//\nconst char* paymentrequest1_cert1_BASE64 =\n\"\\\nEgt4NTA5K3NoYTI1NhrxAwruAzCCAeowggFToAMCAQICAQEwDQYJKoZIhvcNAQEL\\\nBQAwITEfMB0GA1UEAxMWUGF5bWVudFJlcXVlc3QgVGVzdCBDQTAeFw0xMjEyMTAx\\\nNjM3MjRaFw0yMjEyMDgxNjM3MjRaMEMxGTAXBgNVBAMMEHRlc3RtZXJjaGFudC5v\\\ncmcxJjAkBgNVBAoMHVBheW1lbnQgUmVxdWVzdCBUZXN0IE1lcmNoYW50MIGfMA0G\\\nCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHkMy8W1u6HsWlSqdWTmMKf54gICxNfxbY\\\n+rcMtAftr62hCYx2d2QiSRd1pCUzmo12IiSX3WxSHwaTnT3MFD6jRx6+zM6XdGar\\\nI2zpYle11ANzu4gAthN17uRQHV2O5QxVtzNaMdKeJLXT2L9tfEdyL++9ZUqoQmdA\\\nYG9ix330hQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GB\\\nAIkyO99KC68bi9PFRyQQ7nvn5GlQEb3Ca1bRG5+AKN9N5vc8rZ9G2hejtM8wEXni\\\neGBP+chVMsbTPEHKLrwREn7IvcyCcbAStaklPC3w0B/2idQSHskb6P3X13OR2bTH\\\na2+6wuhsOZRUrVNr24rM95DKx/eCC6JN1VW+qRPU6fqzIjQSHwiw2wYSGXapFJVg\\\nigPI+6XpExtNLO/i1WFV8ZmoiKwYsuHFiwUqC1VuaXRUZXN0T25lKoABS0j59iMU\\\nUc9MdIfwsO1BskIET0eJSGNZ7eXb9N62u+qf831PMpEHkmlGpk8rHy92nPcgua/U\\\nYt8oZMn3QaTZ5A6HjJbc3A73eLylp1a0SwCl+KDMEvDQhqMn1jAVu2v92AH3uB7n\\\nSiWVbw0tX/68iSQEGGfh9n6ee/8Myb3ICdw=\\\n\";\n\n//\n// Signed, but expired, merchant cert in the request\n//\nconst char* paymentrequest2_cert1_BASE64 =\n\"\\\nEgt4NTA5K3NoYTI1NhrsAwrpAzCCAeUwggFOoAMCAQICAQMwDQYJKoZIhvcNAQEL\\\nBQAwITEfMB0GA1UEAxMWUGF5bWVudFJlcXVlc3QgVGVzdCBDQTAeFw0xMzAyMjMy\\\nMTI2NDNaFw0xMzAyMjQyMTI2NDNaMD4xHDAaBgNVBAMME2V4cGlyZWRtZXJjaGFu\\\ndC5vcmcxHjAcBgNVBAoMFUV4cGlyZWQgVGVzdCBNZXJjaGFudDCBnzANBgkqhkiG\\\n9w0BAQEFAAOBjQAwgYkCgYEAx5DMvFtbuh7FpUqnVk5jCn+eICAsTX8W2Pq3DLQH\\\n7a+toQmMdndkIkkXdaQlM5qNdiIkl91sUh8Gk509zBQ+o0cevszOl3RmqyNs6WJX\\\ntdQDc7uIALYTde7kUB1djuUMVbczWjHSniS109i/bXxHci/vvWVKqEJnQGBvYsd9\\\n9IUCAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQAaU137\\\nj53rvSjlmYZpZ4RWTP7EdD6fl5ZxBeXHytN6DQL33H0eD7OFHt+ofc7E6D7keubl\\\nUfCu+jOvt/MvvPUmtCI9yXZ0dNC4sjyETv+wQpxO0UNZwOM4uegdCzlo6Bi3pD4/\\\nKKLdMkWuUfuPBmoammny74lZaOVr5deKXztTuCI0Eh8IsNsGEhl2qRSVYIoDyPul\\\n6RMbTSzv4tVhVfGZqIisGLLhxYsFKgtVbml0VGVzdFR3byqAAXHuo4nZEPniLpkd\\\ny30TkwBxVgprWJ18a9z/7Py35Qss/JMbOXbnBhJtmJCdIowHRI0aa+zqt3KKKAXi\\\nmm+V4seMgxTcxMS+eDDkiTcB/RtWWSyRcS2ANjFeY0T4SLMwiCL9qWPi03hr8j96\\\ntejrSPOBNSJ3Mi/q5u2Yl4gJZY2b\\\n\";\n\n//\n// 10-long certificate chain, all intermediates valid\n//\nconst char* paymentrequest3_cert1_BASE64 =\n\"\\\nEgt4NTA5K3NoYTI1Nhq8JAr/AzCCAfswggFkoAMCAQICAQEwDQYJKoZIhvcNAQEL\\\nBQAwPzEUMBIGA1UEAwwLdGVzdGNhOC5vcmcxJzAlBgNVBAoMHlBheW1lbnQgUmVx\\\ndWVzdCBJbnRlcm1lZGlhdGUgODAeFw0xMzAyMjMyMjQyMzFaFw0yMzAyMjEyMjQy\\\nMzFaMDYxGjAYBgNVBAMMEXRlc3RtZXJjaGFudDgub3JnMRgwFgYDVQQKDA9UZXN0\\\nIE1lcmNoYW50IDgwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMMCHA3hiHbS\\\nTKZ5K9jHRwE8NxkGp3IOx56PDB2diNkldG8XweTcRq7bBm7pdiBt4IVggtfs+6hE\\\nhDYIOecyoAnVzPFTdvQ7KQdQ/fD9YLe6lk+o0edOqutPMyrxLFjSluXxEQyk7fdt\\\nURloMMYfp3p1/hFCboA1rAsQ2RW38hR5AgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8w\\\nDQYJKoZIhvcNAQELBQADgYEAPsdFatnc2RJSpvZsw+nCiPVsllycw5ELglq9vfJz\\\nnJJucRxgzmqI2iuas1ugwbXn0BEIRLK7vMF/qBzQR6M/nTxttah+KEu+okjps9vJ\\\ncIyhfTyGPC5xkHaHZ7sG+UHOFhPw0/kXn0x+pbVgBZ5315axqcp1R+DTSj/whMAr\\\nn0AKiAQwggIEMIIBbaADAgECAgECMA0GCSqGSIb3DQEBCwUAMD8xFDASBgNVBAMM\\\nC3Rlc3RjYTcub3JnMScwJQYDVQQKDB5QYXltZW50IFJlcXVlc3QgSW50ZXJtZWRp\\\nYXRlIDcwHhcNMTMwMjIzMjI0MjMxWhcNMjMwMjIxMjI0MjMxWjA/MRQwEgYDVQQD\\\nDAt0ZXN0Y2E4Lm9yZzEnMCUGA1UECgweUGF5bWVudCBSZXF1ZXN0IEludGVybWVk\\\naWF0ZSA4MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDexUFfxb1sThvabp7u\\\ndZz59ciThGmmAW0nP4tjrgEACgvWIInr2dZpTHbiQNF34ycsk0le1JD93D7Qb8rd\\\n25OrpaO8XS2Li2zjR9cleixXjSLwV/zv8zJ8yPl/27XL++PDTKBXVpJ8/Syp+9Ty\\\nplV1BqDhqtIHb/QSHEkTQXjeYQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqG\\\nSIb3DQEBCwUAA4GBACMooQVbkbIZ2DaPwHDc4ULwguG3VI2Kzj50UdExmHtzm2S4\\\nMQei+n+HEPjtJAx5OY520+10nfuP+12H2DRLQmWmdvDpeQ/Cv0yavlw4ZRejRFo7\\\nKS83C0wo5rd+qTvvOmAN4UTArWkzYcEUulPdiXnRamb0WQHTeVdIbHVkMormCogE\\\nMIICBDCCAW2gAwIBAgIBAjANBgkqhkiG9w0BAQsFADA/MRQwEgYDVQQDDAt0ZXN0\\\nY2E2Lm9yZzEnMCUGA1UECgweUGF5bWVudCBSZXF1ZXN0IEludGVybWVkaWF0ZSA2\\\nMB4XDTEzMDIyMzIyNDIzMVoXDTIzMDIyMTIyNDIzMVowPzEUMBIGA1UEAwwLdGVz\\\ndGNhNy5vcmcxJzAlBgNVBAoMHlBheW1lbnQgUmVxdWVzdCBJbnRlcm1lZGlhdGUg\\\nNzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtjBRazrkebXAhXsbjimrMIRm\\\nW/f9SwAHwXfc042keNtl0t2z6XE6UPcR2v/KrssXuCZgodeYxz6IM6lWosCM1xot\\\nC3ChKKFBfVO30reuKBRUxXfKAFqxaG0YOAEzdZkkY9AGhqWloeSmgxpIfhInU0EF\\\nJjCwrJ6IkijBatGoAAECAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B\\\nAQsFAAOBgQDBRTi1MolmOA0niHYX0A2lN5QWHkCfX0A7GwyoMA3dvM45m/NYd4WB\\\nX+HwfnfYcI6X9jOgNo5OWmc4GGsld0HlxwMYEKISBS9PbSHPBrb3TBOlw5ztQpXZ\\\n91+bOhLux52Fr03sK7v9qExmBM12M8UR2ltpzAMiUgLLMHyPfiWkvQqIBDCCAgQw\\\nggFtoAMCAQICAQIwDQYJKoZIhvcNAQELBQAwPzEUMBIGA1UEAwwLdGVzdGNhNS5v\\\ncmcxJzAlBgNVBAoMHlBheW1lbnQgUmVxdWVzdCBJbnRlcm1lZGlhdGUgNTAeFw0x\\\nMzAyMjMyMjQyMzBaFw0yMzAyMjEyMjQyMzBaMD8xFDASBgNVBAMMC3Rlc3RjYTYu\\\nb3JnMScwJQYDVQQKDB5QYXltZW50IFJlcXVlc3QgSW50ZXJtZWRpYXRlIDYwgZ8w\\\nDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANJSH3xivX1t9olIdHsznI1aE9SD7t9i\\\nSZJsIB0otoETHZRVv9M9LvyzBNK98ZV+kTOlST7PJgC0d9BQM9sgYApSRq5oqKDM\\\n9FXbOm/yaReAbU3mkFNFw5roTlJ5ThEy0yOGT/DS0YBRaGIvRPRj2DiqDVdCZZ+w\\\n4jo1IYHkZt4FAgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQAD\\\ngYEATm6+J1OmbrothO60xALKonWMBKr6hudb4amkFBqKbA9wMeM3jl+I/yKfz/Uf\\\nxWuJ071IhiNv6Gxx5YwNvhUe1xMhUqHv0gpyK1Z47bD+kYS2se5sWNPNo3Y9qZDG\\\nIXiGQxwHmrzaFk79Uy1xsmvsEz42w6hr25Yaw7HkIgrFveoKiAQwggIEMIIBbaAD\\\nAgECAgECMA0GCSqGSIb3DQEBCwUAMD8xFDASBgNVBAMMC3Rlc3RjYTQub3JnMScw\\\nJQYDVQQKDB5QYXltZW50IFJlcXVlc3QgSW50ZXJtZWRpYXRlIDQwHhcNMTMwMjIz\\\nMjI0MjMwWhcNMjMwMjIxMjI0MjMwWjA/MRQwEgYDVQQDDAt0ZXN0Y2E1Lm9yZzEn\\\nMCUGA1UECgweUGF5bWVudCBSZXF1ZXN0IEludGVybWVkaWF0ZSA1MIGfMA0GCSqG\\\nSIb3DQEBAQUAA4GNADCBiQKBgQC7vVUFpxHzz2Tr/xij3k58s8d/BPA0R6D5RXTV\\\nvmhAzc1Zuin4zUKRFs/aCj/0yED8Wu/COfNGF4tVlRNMdl9EcFsxa8XGEL4eAZa+\\\nH/rOHH+7/1EINrrVWhZlUecyhilN8jmCZmqEM3ecuD0NAViqyMrgmaiFmsLoQZpE\\\nGepDUQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GBAEdJ\\\nSs8jWiooja3WZzHXeF95QkBJNjIlpDLGcpl4opOYLSuEl9Uxp//LaQQiXuzpj4/I\\\npkWGQmMy5HOyH1lqDyiMgXpcG8PE0jEQAoEUGZ0QEqB1mZ6BCrYvmUuf/5aSVd8Y\\\n6lKMR3WzFDYU9Zy0nzuHB/3nvp6MeDRQeRMtYvz4CogEMIICBDCCAW2gAwIBAgIB\\\nAjANBgkqhkiG9w0BAQsFADA/MRQwEgYDVQQDDAt0ZXN0Y2EzLm9yZzEnMCUGA1UE\\\nCgweUGF5bWVudCBSZXF1ZXN0IEludGVybWVkaWF0ZSAzMB4XDTEzMDIyMzIyNDIy\\\nOVoXDTIzMDIyMTIyNDIyOVowPzEUMBIGA1UEAwwLdGVzdGNhNC5vcmcxJzAlBgNV\\\nBAoMHlBheW1lbnQgUmVxdWVzdCBJbnRlcm1lZGlhdGUgNDCBnzANBgkqhkiG9w0B\\\nAQEFAAOBjQAwgYkCgYEAxYYo3w2UXiYg6O8b4QgwN/vgreTkiW122Ep/z2TiDrhV\\\nMhfOOiKdwYESPflfnXnVaQQzCGexYTQqsvqvzHSyna5hL0zPTRJxSKmTVrXRsWtp\\\ndCRhjxCGipS3tlQBDi7vb+7SNRIBK4dBjjGzALNk7gMCpy+yM8f6I043jTlmGb0C\\\nAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQDU+IQxt3Oh\\\nKqaUYWC23+cB2gekvWqwMBnrCNrX/Dp+kjoJKUoR2Fs3qw53raHES4SIhpGT9l9l\\\nrppNQgFe/JMHeYqOZMZO+6kuU0olJanBJ14tPIc7zlMTQ9OfmZ6v07IpyFbsQDtR\\\nhpe80DpuvSFPfJ4fh0WrQf6kn3KDVpGDnAqIBDCCAgQwggFtoAMCAQICAQIwDQYJ\\\nKoZIhvcNAQELBQAwPzEUMBIGA1UEAwwLdGVzdGNhMi5vcmcxJzAlBgNVBAoMHlBh\\\neW1lbnQgUmVxdWVzdCBJbnRlcm1lZGlhdGUgMjAeFw0xMzAyMjMyMjQyMjlaFw0y\\\nMzAyMjEyMjQyMjlaMD8xFDASBgNVBAMMC3Rlc3RjYTMub3JnMScwJQYDVQQKDB5Q\\\nYXltZW50IFJlcXVlc3QgSW50ZXJtZWRpYXRlIDMwgZ8wDQYJKoZIhvcNAQEBBQAD\\\ngY0AMIGJAoGBANzgVP99Qg98e6NsKEz1v5KqRB7NTBRRsYnBvb/TSWipvMQaCYuE\\\nyk1xG57x++QuASKeR3QHRQJOoAhQaj9JLUhSSv9GQ5PrFLLsOFv7L1tpzXHh2dOB\\\nIW92X2yFRW2s39q+Q21yvN+N8uoKdqXhzRA+dDoXh3cavaVeHX1G+IrlAgMBAAGj\\\nEDAOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADgYEASTwg84cX+1UhOG9s\\\nejFV3m34QuI1hPZ+qhqVJlRYUtego8Wng1BburDSwqVAv4ch2wi3c2s4e8J7AXyL\\\ntzSbSQG4RN0oZi0mR8EtTTN+Mix/hBIk79dMZg85+I29uFA6Zj2d9oAhQv2qkHhc\\\n6tcaheNvkQRlCyH68k3iF1Fqf+4KiAQwggIEMIIBbaADAgECAgECMA0GCSqGSIb3\\\nDQEBCwUAMD8xFDASBgNVBAMMC3Rlc3RjYTEub3JnMScwJQYDVQQKDB5QYXltZW50\\\nIFJlcXVlc3QgSW50ZXJtZWRpYXRlIDEwHhcNMTMwMjIzMjI0MjI5WhcNMjMwMjIx\\\nMjI0MjI5WjA/MRQwEgYDVQQDDAt0ZXN0Y2EyLm9yZzEnMCUGA1UECgweUGF5bWVu\\\ndCBSZXF1ZXN0IEludGVybWVkaWF0ZSAyMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\\\niQKBgQDaV8zhfyQuSf/f+fauMfgs3g/RnWy9yxxUkvQneQQPH3uZzCyk3A6q72ip\\\nTtwNqiibG9455L9A7SaUjGtnpUz0NKT/VWUdqbfCl1PqXjEZbDobbAQ5hxLGOTyL\\\nRQhLIcgeq2/BnmeCqHsC4md04nUp+nBo1HwKyygvK+9sMbCp/wIDAQABoxAwDjAM\\\nBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GBACvYyE+PPmWFkbjyRu9LAt8D\\\ncrtyYYLRClKSg6tVvutwukLG2l//kDOohYkJtgTqr6LnCIIIwYdXN+4wxugmw4cn\\\nPIZmP6kovxjhhVM95okilor1zniTAo3RN7JDIfTGNgxLdGu1btt7DOFL4zTbeSJM\\\nb8M1JpPftehH+x/VLyuUCuoDMIIB5jCCAU+gAwIBAgIBBTANBgkqhkiG9w0BAQsF\\\nADAhMR8wHQYDVQQDExZQYXltZW50UmVxdWVzdCBUZXN0IENBMB4XDTEzMDIyMzIy\\\nNDIyOFoXDTIzMDIyMTIyNDIyOFowPzEUMBIGA1UEAwwLdGVzdGNhMS5vcmcxJzAl\\\nBgNVBAoMHlBheW1lbnQgUmVxdWVzdCBJbnRlcm1lZGlhdGUgMTCBnzANBgkqhkiG\\\n9w0BAQEFAAOBjQAwgYkCgYEAo5Vy9H3nA/OOkF5Ap89yfVNSiTay/LYCaB0eALpc\\\nU690U75O9Q3w2M+2AN8wpbbHsJHZMIjEeBRoQfjlYXW1ucQTxWKyT+liu0D25mGX\\\nX27CBXBd4iXTxVII/iX+u3lcjORjoHOBy7QgeIDIIS9y0vYu8eArpjh7m4thrVgI\\\nRtMCAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQB9LKcV\\\nJK9sjASNzpQlpUp7nCiw5FSjVY+XMRIKK/kavzlKjZ+InsmmyRVGjDoZi9GrqG9P\\\nVHgLBxi2VtVjmokZoNPqao3OfhqORAubC+JR/JLepM7aDaxDdTHVhSUk4lgNAvi2\\\n6dGY7nZMsnHlPQ2tPp/HvRRiMq1oDjlylc8VTCI2Eh8IsNsGEhl2qRSVYIoDyPul\\\n6RMbTSzv4tVhVfGZqIisGLLhxYsFKg1Vbml0VGVzdFRocmVlKoABn2HTsUQtMNI4\\\nyNvkfkFNka3pRvTUTydJrvyfmEeLzImfM1BWddZjnywku9RToNFZZNgow5QnljmF\\\nchhR/aHOuEMTxmc12K4rNlgYtHCsxLP9zd+6u0cva3TucZ6EzS8PKEib/+r12/52\\\n664NuWA9WtsK7QCFrK2K95PnVCRmWl0=\\\n\";\n\n//\n// Long certificate chain, with an expired certificate in the middle\n//\nconst char* paymentrequest4_cert1_BASE64 =\n\"\\\nEgt4NTA5K3NoYTI1NhqeJAr/AzCCAfswggFkoAMCAQICAQEwDQYJKoZIhvcNAQEL\\\nBQAwPzEUMBIGA1UEAwwLdGVzdGNhOC5vcmcxJzAlBgNVBAoMHlBheW1lbnQgUmVx\\\ndWVzdCBJbnRlcm1lZGlhdGUgODAeFw0xMzAyMjMyMjQyMzFaFw0yMzAyMjEyMjQy\\\nMzFaMDYxGjAYBgNVBAMMEXRlc3RtZXJjaGFudDgub3JnMRgwFgYDVQQKDA9UZXN0\\\nIE1lcmNoYW50IDgwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMMCHA3hiHbS\\\nTKZ5K9jHRwE8NxkGp3IOx56PDB2diNkldG8XweTcRq7bBm7pdiBt4IVggtfs+6hE\\\nhDYIOecyoAnVzPFTdvQ7KQdQ/fD9YLe6lk+o0edOqutPMyrxLFjSluXxEQyk7fdt\\\nURloMMYfp3p1/hFCboA1rAsQ2RW38hR5AgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8w\\\nDQYJKoZIhvcNAQELBQADgYEAPsdFatnc2RJSpvZsw+nCiPVsllycw5ELglq9vfJz\\\nnJJucRxgzmqI2iuas1ugwbXn0BEIRLK7vMF/qBzQR6M/nTxttah+KEu+okjps9vJ\\\ncIyhfTyGPC5xkHaHZ7sG+UHOFhPw0/kXn0x+pbVgBZ5315axqcp1R+DTSj/whMAr\\\nn0AKiAQwggIEMIIBbaADAgECAgECMA0GCSqGSIb3DQEBCwUAMD8xFDASBgNVBAMM\\\nC3Rlc3RjYTcub3JnMScwJQYDVQQKDB5QYXltZW50IFJlcXVlc3QgSW50ZXJtZWRp\\\nYXRlIDcwHhcNMTMwMjIzMjI0MjMxWhcNMjMwMjIxMjI0MjMxWjA/MRQwEgYDVQQD\\\nDAt0ZXN0Y2E4Lm9yZzEnMCUGA1UECgweUGF5bWVudCBSZXF1ZXN0IEludGVybWVk\\\naWF0ZSA4MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDexUFfxb1sThvabp7u\\\ndZz59ciThGmmAW0nP4tjrgEACgvWIInr2dZpTHbiQNF34ycsk0le1JD93D7Qb8rd\\\n25OrpaO8XS2Li2zjR9cleixXjSLwV/zv8zJ8yPl/27XL++PDTKBXVpJ8/Syp+9Ty\\\nplV1BqDhqtIHb/QSHEkTQXjeYQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqG\\\nSIb3DQEBCwUAA4GBACMooQVbkbIZ2DaPwHDc4ULwguG3VI2Kzj50UdExmHtzm2S4\\\nMQei+n+HEPjtJAx5OY520+10nfuP+12H2DRLQmWmdvDpeQ/Cv0yavlw4ZRejRFo7\\\nKS83C0wo5rd+qTvvOmAN4UTArWkzYcEUulPdiXnRamb0WQHTeVdIbHVkMormCogE\\\nMIICBDCCAW2gAwIBAgIBAjANBgkqhkiG9w0BAQsFADA/MRQwEgYDVQQDDAt0ZXN0\\\nY2E2Lm9yZzEnMCUGA1UECgweUGF5bWVudCBSZXF1ZXN0IEludGVybWVkaWF0ZSA2\\\nMB4XDTEzMDIyMzIyNDIzMVoXDTIzMDIyMTIyNDIzMVowPzEUMBIGA1UEAwwLdGVz\\\ndGNhNy5vcmcxJzAlBgNVBAoMHlBheW1lbnQgUmVxdWVzdCBJbnRlcm1lZGlhdGUg\\\nNzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAtjBRazrkebXAhXsbjimrMIRm\\\nW/f9SwAHwXfc042keNtl0t2z6XE6UPcR2v/KrssXuCZgodeYxz6IM6lWosCM1xot\\\nC3ChKKFBfVO30reuKBRUxXfKAFqxaG0YOAEzdZkkY9AGhqWloeSmgxpIfhInU0EF\\\nJjCwrJ6IkijBatGoAAECAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0B\\\nAQsFAAOBgQDBRTi1MolmOA0niHYX0A2lN5QWHkCfX0A7GwyoMA3dvM45m/NYd4WB\\\nX+HwfnfYcI6X9jOgNo5OWmc4GGsld0HlxwMYEKISBS9PbSHPBrb3TBOlw5ztQpXZ\\\n91+bOhLux52Fr03sK7v9qExmBM12M8UR2ltpzAMiUgLLMHyPfiWkvQqIBDCCAgQw\\\nggFtoAMCAQICAQIwDQYJKoZIhvcNAQELBQAwPzEUMBIGA1UEAwwLdGVzdGNhNS5v\\\ncmcxJzAlBgNVBAoMHlBheW1lbnQgUmVxdWVzdCBJbnRlcm1lZGlhdGUgNTAeFw0x\\\nMzAyMjMyMjQyMzBaFw0yMzAyMjEyMjQyMzBaMD8xFDASBgNVBAMMC3Rlc3RjYTYu\\\nb3JnMScwJQYDVQQKDB5QYXltZW50IFJlcXVlc3QgSW50ZXJtZWRpYXRlIDYwgZ8w\\\nDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANJSH3xivX1t9olIdHsznI1aE9SD7t9i\\\nSZJsIB0otoETHZRVv9M9LvyzBNK98ZV+kTOlST7PJgC0d9BQM9sgYApSRq5oqKDM\\\n9FXbOm/yaReAbU3mkFNFw5roTlJ5ThEy0yOGT/DS0YBRaGIvRPRj2DiqDVdCZZ+w\\\n4jo1IYHkZt4FAgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQAD\\\ngYEATm6+J1OmbrothO60xALKonWMBKr6hudb4amkFBqKbA9wMeM3jl+I/yKfz/Uf\\\nxWuJ071IhiNv6Gxx5YwNvhUe1xMhUqHv0gpyK1Z47bD+kYS2se5sWNPNo3Y9qZDG\\\nIXiGQxwHmrzaFk79Uy1xsmvsEz42w6hr25Yaw7HkIgrFveoK6gMwggHmMIIBT6AD\\\nAgECAgEGMA0GCSqGSIb3DQEBCwUAMCExHzAdBgNVBAMTFlBheW1lbnRSZXF1ZXN0\\\nIFRlc3QgQ0EwHhcNMTMwMjIzMjI1OTUxWhcNMTMwMjI0MjI1OTUxWjA/MRQwEgYD\\\nVQQDDAt0ZXN0Y2E1Lm9yZzEnMCUGA1UECgweUGF5bWVudCBSZXF1ZXN0IEludGVy\\\nbWVkaWF0ZSA1MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7vVUFpxHzz2Tr\\\n/xij3k58s8d/BPA0R6D5RXTVvmhAzc1Zuin4zUKRFs/aCj/0yED8Wu/COfNGF4tV\\\nlRNMdl9EcFsxa8XGEL4eAZa+H/rOHH+7/1EINrrVWhZlUecyhilN8jmCZmqEM3ec\\\nuD0NAViqyMrgmaiFmsLoQZpEGepDUQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0G\\\nCSqGSIb3DQEBCwUAA4GBAEmcUEnhua/oiXy1fwScLgMqt+jk9mHRpE6SVsIop23Q\\\nCY2JfpG6RxhMMzzzhGklEGN6cxG0HCi6B3HJx6PYrFEfTB0rW4K6m0Tvx3WpS9mN\\\nuoEuJHLy18ausI/sYAPDHCL+SfBVcqorpaIG2sSpZouRBjRHAyqFAYlwlW87uq5n\\\nCogEMIICBDCCAW2gAwIBAgIBAjANBgkqhkiG9w0BAQsFADA/MRQwEgYDVQQDDAt0\\\nZXN0Y2EzLm9yZzEnMCUGA1UECgweUGF5bWVudCBSZXF1ZXN0IEludGVybWVkaWF0\\\nZSAzMB4XDTEzMDIyMzIyNDIyOVoXDTIzMDIyMTIyNDIyOVowPzEUMBIGA1UEAwwL\\\ndGVzdGNhNC5vcmcxJzAlBgNVBAoMHlBheW1lbnQgUmVxdWVzdCBJbnRlcm1lZGlh\\\ndGUgNDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxYYo3w2UXiYg6O8b4Qgw\\\nN/vgreTkiW122Ep/z2TiDrhVMhfOOiKdwYESPflfnXnVaQQzCGexYTQqsvqvzHSy\\\nna5hL0zPTRJxSKmTVrXRsWtpdCRhjxCGipS3tlQBDi7vb+7SNRIBK4dBjjGzALNk\\\n7gMCpy+yM8f6I043jTlmGb0CAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkqhkiG\\\n9w0BAQsFAAOBgQDU+IQxt3OhKqaUYWC23+cB2gekvWqwMBnrCNrX/Dp+kjoJKUoR\\\n2Fs3qw53raHES4SIhpGT9l9lrppNQgFe/JMHeYqOZMZO+6kuU0olJanBJ14tPIc7\\\nzlMTQ9OfmZ6v07IpyFbsQDtRhpe80DpuvSFPfJ4fh0WrQf6kn3KDVpGDnAqIBDCC\\\nAgQwggFtoAMCAQICAQIwDQYJKoZIhvcNAQELBQAwPzEUMBIGA1UEAwwLdGVzdGNh\\\nMi5vcmcxJzAlBgNVBAoMHlBheW1lbnQgUmVxdWVzdCBJbnRlcm1lZGlhdGUgMjAe\\\nFw0xMzAyMjMyMjQyMjlaFw0yMzAyMjEyMjQyMjlaMD8xFDASBgNVBAMMC3Rlc3Rj\\\nYTMub3JnMScwJQYDVQQKDB5QYXltZW50IFJlcXVlc3QgSW50ZXJtZWRpYXRlIDMw\\\ngZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANzgVP99Qg98e6NsKEz1v5KqRB7N\\\nTBRRsYnBvb/TSWipvMQaCYuEyk1xG57x++QuASKeR3QHRQJOoAhQaj9JLUhSSv9G\\\nQ5PrFLLsOFv7L1tpzXHh2dOBIW92X2yFRW2s39q+Q21yvN+N8uoKdqXhzRA+dDoX\\\nh3cavaVeHX1G+IrlAgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEL\\\nBQADgYEASTwg84cX+1UhOG9sejFV3m34QuI1hPZ+qhqVJlRYUtego8Wng1BburDS\\\nwqVAv4ch2wi3c2s4e8J7AXyLtzSbSQG4RN0oZi0mR8EtTTN+Mix/hBIk79dMZg85\\\n+I29uFA6Zj2d9oAhQv2qkHhc6tcaheNvkQRlCyH68k3iF1Fqf+4KiAQwggIEMIIB\\\nbaADAgECAgECMA0GCSqGSIb3DQEBCwUAMD8xFDASBgNVBAMMC3Rlc3RjYTEub3Jn\\\nMScwJQYDVQQKDB5QYXltZW50IFJlcXVlc3QgSW50ZXJtZWRpYXRlIDEwHhcNMTMw\\\nMjIzMjI0MjI5WhcNMjMwMjIxMjI0MjI5WjA/MRQwEgYDVQQDDAt0ZXN0Y2EyLm9y\\\nZzEnMCUGA1UECgweUGF5bWVudCBSZXF1ZXN0IEludGVybWVkaWF0ZSAyMIGfMA0G\\\nCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDaV8zhfyQuSf/f+fauMfgs3g/RnWy9yxxU\\\nkvQneQQPH3uZzCyk3A6q72ipTtwNqiibG9455L9A7SaUjGtnpUz0NKT/VWUdqbfC\\\nl1PqXjEZbDobbAQ5hxLGOTyLRQhLIcgeq2/BnmeCqHsC4md04nUp+nBo1HwKyygv\\\nK+9sMbCp/wIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GB\\\nACvYyE+PPmWFkbjyRu9LAt8DcrtyYYLRClKSg6tVvutwukLG2l//kDOohYkJtgTq\\\nr6LnCIIIwYdXN+4wxugmw4cnPIZmP6kovxjhhVM95okilor1zniTAo3RN7JDIfTG\\\nNgxLdGu1btt7DOFL4zTbeSJMb8M1JpPftehH+x/VLyuUCuoDMIIB5jCCAU+gAwIB\\\nAgIBBTANBgkqhkiG9w0BAQsFADAhMR8wHQYDVQQDExZQYXltZW50UmVxdWVzdCBU\\\nZXN0IENBMB4XDTEzMDIyMzIyNDIyOFoXDTIzMDIyMTIyNDIyOFowPzEUMBIGA1UE\\\nAwwLdGVzdGNhMS5vcmcxJzAlBgNVBAoMHlBheW1lbnQgUmVxdWVzdCBJbnRlcm1l\\\nZGlhdGUgMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAo5Vy9H3nA/OOkF5A\\\np89yfVNSiTay/LYCaB0eALpcU690U75O9Q3w2M+2AN8wpbbHsJHZMIjEeBRoQfjl\\\nYXW1ucQTxWKyT+liu0D25mGXX27CBXBd4iXTxVII/iX+u3lcjORjoHOBy7QgeIDI\\\nIS9y0vYu8eArpjh7m4thrVgIRtMCAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkq\\\nhkiG9w0BAQsFAAOBgQB9LKcVJK9sjASNzpQlpUp7nCiw5FSjVY+XMRIKK/kavzlK\\\njZ+InsmmyRVGjDoZi9GrqG9PVHgLBxi2VtVjmokZoNPqao3OfhqORAubC+JR/JLe\\\npM7aDaxDdTHVhSUk4lgNAvi26dGY7nZMsnHlPQ2tPp/HvRRiMq1oDjlylc8VTCI1\\\nEh8IsNsGEhl2qRSVYIoDyPul6RMbTSzv4tVhVfGZqIisGLLhxYsFKgxVbml0VGVz\\\ndEZvdXIqgAEBE1PP93Tkpif35F+dYmXn9kLA/1djcPjCs2o2rwRMM4Uk356O5dgu\\\nHXQjsfdR58qZQS9CS5DAtRUf0R8+43/wijO/hb49VNaNXmY+/cPHMkahP2aV3tZi\\\nFAyZblLik9A7ZvF+UsjeFQiHB5wzWQvbqk5wQ4yabHIXoYv/E0q+eQ==\\\n\";\n\n//\n// Validly signed, but by a CA not in our root CA list\n//\nconst char* paymentrequest5_cert1_BASE64 =\n\"\\\nEgt4NTA5K3NoYTI1NhrxAwruAzCCAeowggFToAMCAQICAQEwDQYJKoZIhvcNAQEL\\\nBQAwITEfMB0GA1UEAxMWUGF5bWVudFJlcXVlc3QgVGVzdCBDQTAeFw0xMzA0MTkx\\\nNzIwMDZaFw0yMzA0MTcxNzIwMDZaMEMxGTAXBgNVBAMMEHRlc3RtZXJjaGFudC5v\\\ncmcxJjAkBgNVBAoMHVBheW1lbnQgUmVxdWVzdCBUZXN0IE1lcmNoYW50MIGfMA0G\\\nCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDhV6Yn47aEEmbl50YLvXoqGEJA51I/40wr\\\nZ6VQGdXYaRqYktagrWDlgYY9h0JQ1bQhm8HgW7ju0R4NaDTXUqxg4HjprF0z3Mfm\\\n/6mmebkLOOptfkVD7ceAteNI7cyuqWGIAZA7D9mV97mXoCAtTlBUycvkmoiClCCS\\\nh0EpF/UTaQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4GB\\\nAGIRwW7I0QvLga+RnJoJSZNZQbtu4rQW3xmoz8WfZMBYXX3QBYg5ftycbdK+/IbP\\\nqozfjGW2AS6DNArvpveSPDTK9+GJBNo1paiNtVqwXkC3Ddscv5AIms1eZGiIOQNC\\\nmUvdLkpoXo48WAer3EGsZ3B15GyNEELc0q9W5yUebba1IjUSHwiw2wYSGXapFJVg\\\nigPI+6XpExtNLO/i1WFV8ZmoiKwYuPvFiwUqDFVuaXRUZXN0Rml2ZSqAAXdsMgdG\\\nssymvca1S/1KeM3n8Ydi2fi1JUzAAr59xPvNJRUeqCLP9upHn5z7br3P12Oz9A20\\\n5/4wL4ClPRPVnOHgij0bEg+y0tGESqmF1rfOfXDszlo2U92wCxS07kq79YAZJ1Zo\\\nXYh860/Q4wvc7lfiTe+dXBzPKAKhMy91yETY\\\n\";\n\n//\n// Contains a testnet paytoaddress, so payment request network doesn't match client network\n//\nconst char* paymentrequest1_cert2_BASE64 =\n\"\\\nEgt4NTA5K3NoYTI1NhrQBArNBDCCAkkwggExoAMCAQICAQEwDQYJKoZIhvcNAQEL\\\nBQAwITEfMB0GA1UEAwwWUGF5bWVudFJlcXVlc3QgVGVzdCBDQTAeFw0xNTAxMTEx\\\nODIxMDhaFw0yNTAxMDgxODIxMDhaMCExHzAdBgNVBAMMFlBheW1lbnRSZXF1ZXN0\\\nIFRlc3QgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMsZqzkzeBGo+i2N\\\nmUak3Ciodr1V7S062VOy7N0OQYNDQHYkgDFAUET7cEb5VJaHPv5m3ppTBpU9xBcf\\\nwbHHUt4VjA+mhRmYrl1khjvZM+X8kEqvWn20BtcM9R6r0yIYec8UERDDHBleL/P8\\\nRkxEnVLjYTV9zigCXfMsgYb3EQShAgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJ\\\nKoZIhvcNAQELBQADggEBABUJpl3QCqsoDSxAsQdV6zKT4VGV76AzoGj7etQsQY+r\\\n+S26VfWh/fMobEzuxFChr0USgLJ6FoK78hAtoZvt1lrye9yqFv/ig3WLWsJKWHHb\\\n3RT6oR03CIwZXFSUasi08QDVLxafwsU5OMcPLucF3a1lRL1ccYrNgVCCx1+X7Bos\\\ntIgDGRQQ4AyoHTcfVd2hEGeUv7k14mOxFsAp6851yosHq9Q2kwmdH+rHEJbjof87\\\nyyKLagc4owyXBZYkQmkeHWCNqnuRmO5vUsfVb0UUrkD64o7Th/NjwooA7SCiUXl6\\\ndfygT1b7ggpx7GC+sP2DsIM47IAZ55drjqX5u2f+Ba0iPQoEdGVzdBIhCIDWwowE\\\nEhl2qRQErGqUUwSsaMpDvWIaGnJGNQqi8oisGNeMy6UFKgxKdXN0IFRlc3Rpbmcq\\\ngAFwThsozZxkZxzCn4R8WxNiLFV6m0ye9fEtSbolfaW+EjBMpO03lr/dwNnrclhg\\\new+A05xfZztrAt16XKEY7qKJ/eY2nLd0fVAIu/nIt+7/VYVXT83zLrWc150aRS7W\\\nAdJbL3JOJLs6Eyp5zrPbfI8faRttFAdONKDrJgIpuW1E3g==\\\n\";\n\n//\n// Expired payment request (expires is set to 1 = 1970-01-01 00:00:01)\n//\nconst char* paymentrequest2_cert2_BASE64 =\n\"\\\nEgt4NTA5K3NoYTI1NhrQBArNBDCCAkkwggExoAMCAQICAQEwDQYJKoZIhvcNAQEL\\\nBQAwITEfMB0GA1UEAwwWUGF5bWVudFJlcXVlc3QgVGVzdCBDQTAeFw0xNTAxMTEx\\\nODIxMDhaFw0yNTAxMDgxODIxMDhaMCExHzAdBgNVBAMMFlBheW1lbnRSZXF1ZXN0\\\nIFRlc3QgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMsZqzkzeBGo+i2N\\\nmUak3Ciodr1V7S062VOy7N0OQYNDQHYkgDFAUET7cEb5VJaHPv5m3ppTBpU9xBcf\\\nwbHHUt4VjA+mhRmYrl1khjvZM+X8kEqvWn20BtcM9R6r0yIYec8UERDDHBleL/P8\\\nRkxEnVLjYTV9zigCXfMsgYb3EQShAgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJ\\\nKoZIhvcNAQELBQADggEBABUJpl3QCqsoDSxAsQdV6zKT4VGV76AzoGj7etQsQY+r\\\n+S26VfWh/fMobEzuxFChr0USgLJ6FoK78hAtoZvt1lrye9yqFv/ig3WLWsJKWHHb\\\n3RT6oR03CIwZXFSUasi08QDVLxafwsU5OMcPLucF3a1lRL1ccYrNgVCCx1+X7Bos\\\ntIgDGRQQ4AyoHTcfVd2hEGeUv7k14mOxFsAp6851yosHq9Q2kwmdH+rHEJbjof87\\\nyyKLagc4owyXBZYkQmkeHWCNqnuRmO5vUsfVb0UUrkD64o7Th/NjwooA7SCiUXl6\\\ndfygT1b7ggpx7GC+sP2DsIM47IAZ55drjqX5u2f+Ba0iQgoEdGVzdBIgCICt4gQS\\\nGXapFASsapRTBKxoykO9YhoackY1CqLyiKwYiNLUpQUgASoQVGVzdGluZyB0ZXN0\\\nbmV0ISqAATXq9A5nmJgtmee/bQTeHeif4w1YYFPBlKghwx6qbVgXTWnwBJtOQhhV\\\nsZdzbTl95ENR7/Y7VJupW9kDWobCK7zUUhLAzUlwmLlcx6itHw8LTUF5HK+AwsZm\\\nZs85lISGvOS0NZW/ENa6l+oQRnL87oqVZr/EDGiuqjz6T0ThQi0l\\\n\";\n\n//\n// Unexpired payment request (expires is set to 0x7FFFFFFFFFFFFFFF = max. int64_t)\n//\nconst char* paymentrequest3_cert2_BASE64 =\n\"\\\nEgt4NTA5K3NoYTI1NhrQBArNBDCCAkkwggExoAMCAQICAQEwDQYJKoZIhvcNAQEL\\\nBQAwITEfMB0GA1UEAwwWUGF5bWVudFJlcXVlc3QgVGVzdCBDQTAeFw0xNTAxMTEx\\\nODIxMDhaFw0yNTAxMDgxODIxMDhaMCExHzAdBgNVBAMMFlBheW1lbnRSZXF1ZXN0\\\nIFRlc3QgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMsZqzkzeBGo+i2N\\\nmUak3Ciodr1V7S062VOy7N0OQYNDQHYkgDFAUET7cEb5VJaHPv5m3ppTBpU9xBcf\\\nwbHHUt4VjA+mhRmYrl1khjvZM+X8kEqvWn20BtcM9R6r0yIYec8UERDDHBleL/P8\\\nRkxEnVLjYTV9zigCXfMsgYb3EQShAgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJ\\\nKoZIhvcNAQELBQADggEBABUJpl3QCqsoDSxAsQdV6zKT4VGV76AzoGj7etQsQY+r\\\n+S26VfWh/fMobEzuxFChr0USgLJ6FoK78hAtoZvt1lrye9yqFv/ig3WLWsJKWHHb\\\n3RT6oR03CIwZXFSUasi08QDVLxafwsU5OMcPLucF3a1lRL1ccYrNgVCCx1+X7Bos\\\ntIgDGRQQ4AyoHTcfVd2hEGeUv7k14mOxFsAp6851yosHq9Q2kwmdH+rHEJbjof87\\\nyyKLagc4owyXBZYkQmkeHWCNqnuRmO5vUsfVb0UUrkD64o7Th/NjwooA7SCiUXl6\\\ndfygT1b7ggpx7GC+sP2DsIM47IAZ55drjqX5u2f+Ba0iSgoEdGVzdBIgCICt4gQS\\\nGXapFASsapRTBKxoykO9YhoackY1CqLyiKwYyNfZpQUg//////////9/KhBUZXN0\\\naW5nIHRlc3RuZXQhKoABNwi8WnMW4aMvbmvorTiiWJLFhofLFnsoWCJnj3rWLnLh\\\nn3w6q/fZ26p50ERL/noxdTUfeFsKnlECkUu/fOcOrqyYDiwvxI0SZ034DleVyFU1\\\nZ3T+X0zcL8oe7bX01Yf+s2V+5JXQXarKnKBrZCGgv2ARjFNSZe7E7vGg5K4Q6Q8=\\\n\";\n\n//\n// Unexpired payment request (expires is set to 0x8000000000000000 > max. int64_t, allowed uint64)\n//\nconst char* paymentrequest4_cert2_BASE64 =\n\"\\\nEgt4NTA5K3NoYTI1NhrQBArNBDCCAkkwggExoAMCAQICAQEwDQYJKoZIhvcNAQEL\\\nBQAwITEfMB0GA1UEAwwWUGF5bWVudFJlcXVlc3QgVGVzdCBDQTAeFw0xNTAxMTEx\\\nODIxMDhaFw0yNTAxMDgxODIxMDhaMCExHzAdBgNVBAMMFlBheW1lbnRSZXF1ZXN0\\\nIFRlc3QgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMsZqzkzeBGo+i2N\\\nmUak3Ciodr1V7S062VOy7N0OQYNDQHYkgDFAUET7cEb5VJaHPv5m3ppTBpU9xBcf\\\nwbHHUt4VjA+mhRmYrl1khjvZM+X8kEqvWn20BtcM9R6r0yIYec8UERDDHBleL/P8\\\nRkxEnVLjYTV9zigCXfMsgYb3EQShAgMBAAGjEDAOMAwGA1UdEwQFMAMBAf8wDQYJ\\\nKoZIhvcNAQELBQADggEBABUJpl3QCqsoDSxAsQdV6zKT4VGV76AzoGj7etQsQY+r\\\n+S26VfWh/fMobEzuxFChr0USgLJ6FoK78hAtoZvt1lrye9yqFv/ig3WLWsJKWHHb\\\n3RT6oR03CIwZXFSUasi08QDVLxafwsU5OMcPLucF3a1lRL1ccYrNgVCCx1+X7Bos\\\ntIgDGRQQ4AyoHTcfVd2hEGeUv7k14mOxFsAp6851yosHq9Q2kwmdH+rHEJbjof87\\\nyyKLagc4owyXBZYkQmkeHWCNqnuRmO5vUsfVb0UUrkD64o7Th/NjwooA7SCiUXl6\\\ndfygT1b7ggpx7GC+sP2DsIM47IAZ55drjqX5u2f+Ba0iSwoEdGVzdBIgCICt4gQS\\\nGXapFASsapRTBKxoykO9YhoackY1CqLyiKwYt+HZpQUggICAgICAgICAASoQVGVz\\\ndGluZyB0ZXN0bmV0ISqAAXSQG8+GFA18VaKarlYrOz293rNMIub0swKGcQm8jAGX\\\nHSLaRgHfUDeEPr4hydy4dtfu59KNwe2xsHOHu/SpO4L8SrA4Dm9A7SlNBVWdcLbw\\\nd2hj739GDLz0b5KuJ2SG6VknMRQM976w/m2qlq0ccVGaaZ2zMIGfpzL3p6adwx/5\\\n\";\n\n//\n// SUGAR-HALVING\n// Payment request with amount overflow (amount is set to \"(1073741824 * 100000000) + 1\" Satoshis)\n// Total Supply in COINs (in theory):\t1073741824\n// Total Supply in COINs (in actual):\t1073741823.87500000\n// Difference: 0.125\n//\nconst char* paymentrequest5_cert2_BASE64 =\n\"\\\nEgRub25lGuQGCuEGMIIDXTCCAkWgAwIBAgIJALjLAxShzsomMA0GCSqGSIb3DQEBCwUAMEUxCzAJ\\\nBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRz\\\nIFB0eSBMdGQwHhcNMTkwMTAzMTg1OTE3WhcNMjgxMjMxMTg1OTE3WjBFMQswCQYDVQQGEwJBVTET\\\nMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIB\\\nIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1sS6KFHLHHpMdc0w8Mjboql3HNr47egI6RYC\\\nr0EVs53xp9FjFoxme/sIFgVVr95iudaxN+ghqnCcDUxJXM+3wqZmepZC9NwHbwFRHty4nb6isPDB\\\nlu3ItfLZx52u+NLo9cCtsUB5bk+VKbz9fxzW6BYnHXUc+PzdfbksIqtsZ0CRFXOOJlzU2dlCmWD6\\\nBAI4leVkNQ4205NW/Twe9VLySHqvYVxr1hwhIh0gycoDkRsCpjE/6k9ysPNIU2GSyz/2oCbReQPf\\\nVNa88JQQrcBhmX7fYWnmP8IkvspQGTHrufC7vh1giCsSgmyxjEO+9iGCIGubCB55vx6fFYaCu3g4\\\n3QIDAQABo1AwTjAdBgNVHQ4EFgQUs9Hwxcu7a1/vrhffkKP4Iay6JEMwHwYDVR0jBBgwFoAUs9Hw\\\nxcu7a1/vrhffkKP4Iay6JEMwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAzjZpsDCC\\\nkzw23c4WAETQItqy5Z1p0k8k3gf/Uq6MZfPYo+kqJMDdKN2R+BFtc4aX6plCyh2YzO1K9sfO4WbU\\\nE4BKWVQ9q9XVMkZDLo2qkLRrNrxAYJknY76FQ9QbVpW+QpXGnzoWci3M6mapTRQFW//U+j2C54k+\\\n/8PwIA1cXrkIE9f/ctQSM5iZZhNH8CYZmajeojwsipXbtQ7DQExdCl1mj14vLqrxmdGcfNhEQlnz\\\nxi4RwCU2TvHDzK3TVhcWf04U89KO2jm/tF4yNR74RzUYq6j0zcH62sVXyZu86eHzT2kqunzoZSc8\\\nvX+vNhJaYcOe4vTYg1H7TS9BpmuW7CJhCgRtYWluEiUIgYCAgICI3r4BEhl2qRQrFJULjTFiDGzJ\\\nI8VAinAbHsCgIIisGLWhmOYFII2mmOYFKgZfbWVtb18yDV9wYXltZW50X3VybF86D19tZXJjaGFu\\\ndF9kYXRhXyqAAiDZ+2ZrUy4h3sJXdEgMN0tsx0jSHovfbQtfJkOE4wiu89DxgH+XSpzYNia7kr/k\\\nb4WZwsTYP4+swxyzg7vHAmiiuqJ26efPQYCNr08foozO2Jn8HlG/82QZuS4tsH86r4du9pVW/rML\\\nONC+CducUKVGEVYKK3FSDZ0dXxZAEd+GAAAVS4Z8kiSbL79Ije6p67H/Pz4of20U2oLMZbcl5ks9\\\nZABQKVGpsvAp7scqYT9tkC/cYt3rE+q/H0vOfwGQZ7I101i7u5Wvo2dRL7SlCnZsIlvbxkH2vi8X\\\nuVY9+dDPS6HMLMPQLWgEjLPrOsw+A7jCskhy/HuYE7JnlVFD8VI=\\\n\";\n"
  },
  {
    "path": "src/qt/test/paymentservertests.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/test/paymentservertests.h>\n\n#include <qt/optionsmodel.h>\n#include <qt/test/paymentrequestdata.h>\n\n#include <amount.h>\n#include <random.h>\n#include <script/script.h>\n#include <script/standard.h>\n#include <util.h>\n#include <utilstrencodings.h>\n\n#include <openssl/x509.h>\n#include <openssl/x509_vfy.h>\n\n#include <QFileOpenEvent>\n#include <QTemporaryFile>\n\nX509 *parse_b64der_cert(const char* cert_data)\n{\n    std::vector<unsigned char> data = DecodeBase64(cert_data);\n    assert(data.size() > 0);\n    const unsigned char* dptr = data.data();\n    X509 *cert = d2i_X509(nullptr, &dptr, data.size());\n    assert(cert);\n    return cert;\n}\n\n//\n// Test payment request handling\n//\n\nstatic SendCoinsRecipient handleRequest(PaymentServer* server, std::vector<unsigned char>& data)\n{\n    RecipientCatcher sigCatcher;\n    QObject::connect(server, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)),\n        &sigCatcher, SLOT(getRecipient(SendCoinsRecipient)));\n\n    // Write data to a temp file:\n    QTemporaryFile f;\n    f.open();\n    f.write((const char*)data.data(), data.size());\n    f.close();\n\n    // Create a QObject, install event filter from PaymentServer\n    // and send a file open event to the object\n    QObject object;\n    object.installEventFilter(server);\n    QFileOpenEvent event(f.fileName());\n    // If sending the event fails, this will cause sigCatcher to be empty,\n    // which will lead to a test failure anyway.\n    QCoreApplication::sendEvent(&object, &event);\n\n    QObject::disconnect(server, SIGNAL(receivedPaymentRequest(SendCoinsRecipient)),\n        &sigCatcher, SLOT(getRecipient(SendCoinsRecipient)));\n\n    // Return results from sigCatcher\n    return sigCatcher.recipient;\n}\n\nvoid PaymentServerTests::paymentServerTests()\n{\n    SelectParams(CBaseChainParams::MAIN);\n    OptionsModel optionsModel;\n    PaymentServer* server = new PaymentServer(nullptr, false);\n    X509_STORE* caStore = X509_STORE_new();\n    X509_STORE_add_cert(caStore, parse_b64der_cert(caCert1_BASE64));\n    PaymentServer::LoadRootCAs(caStore);\n    server->setOptionsModel(&optionsModel);\n    server->uiReady();\n\n    std::vector<unsigned char> data;\n    SendCoinsRecipient r;\n    QString merchant;\n\n    // Now feed PaymentRequests to server, and observe signals it produces\n\n    // This payment request validates directly against the\n    // caCert1 certificate authority:\n    data = DecodeBase64(paymentrequest1_cert1_BASE64);\n    r = handleRequest(server, data);\n    r.paymentRequest.getMerchant(caStore, merchant);\n    QCOMPARE(merchant, QString(\"testmerchant.org\"));\n\n    // Signed, but expired, merchant cert in the request:\n    data = DecodeBase64(paymentrequest2_cert1_BASE64);\n    r = handleRequest(server, data);\n    r.paymentRequest.getMerchant(caStore, merchant);\n    QCOMPARE(merchant, QString(\"\"));\n\n    // 10-long certificate chain, all intermediates valid:\n    data = DecodeBase64(paymentrequest3_cert1_BASE64);\n    r = handleRequest(server, data);\n    r.paymentRequest.getMerchant(caStore, merchant);\n    QCOMPARE(merchant, QString(\"testmerchant8.org\"));\n\n    // Long certificate chain, with an expired certificate in the middle:\n    data = DecodeBase64(paymentrequest4_cert1_BASE64);\n    r = handleRequest(server, data);\n    r.paymentRequest.getMerchant(caStore, merchant);\n    QCOMPARE(merchant, QString(\"\"));\n\n    // Validly signed, but by a CA not in our root CA list:\n    data = DecodeBase64(paymentrequest5_cert1_BASE64);\n    r = handleRequest(server, data);\n    r.paymentRequest.getMerchant(caStore, merchant);\n    QCOMPARE(merchant, QString(\"\"));\n\n    // Try again with no root CA's, verifiedMerchant should be empty:\n    caStore = X509_STORE_new();\n    PaymentServer::LoadRootCAs(caStore);\n    data = DecodeBase64(paymentrequest1_cert1_BASE64);\n    r = handleRequest(server, data);\n    r.paymentRequest.getMerchant(caStore, merchant);\n    QCOMPARE(merchant, QString(\"\"));\n\n    // Load second root certificate\n    caStore = X509_STORE_new();\n    X509_STORE_add_cert(caStore, parse_b64der_cert(caCert2_BASE64));\n    PaymentServer::LoadRootCAs(caStore);\n\n    QByteArray byteArray;\n\n    // For the tests below we just need the payment request data from\n    // paymentrequestdata.h parsed + stored in r.paymentRequest.\n    //\n    // These tests require us to bypass the following normal client execution flow\n    // shown below to be able to explicitly just trigger a certain condition!\n    //\n    // handleRequest()\n    // -> PaymentServer::eventFilter()\n    //   -> PaymentServer::handleURIOrFile()\n    //     -> PaymentServer::readPaymentRequestFromFile()\n    //       -> PaymentServer::processPaymentRequest()\n\n    // Contains a testnet paytoaddress, so payment request network doesn't match client network:\n    data = DecodeBase64(paymentrequest1_cert2_BASE64);\n    byteArray = QByteArray((const char*)data.data(), data.size());\n    r.paymentRequest.parse(byteArray);\n    // Ensure the request is initialized, because network \"main\" is default, even for\n    // uninitialized payment requests and that will fail our test here.\n    QVERIFY(r.paymentRequest.IsInitialized());\n    QCOMPARE(PaymentServer::verifyNetwork(r.paymentRequest.getDetails()), false);\n\n    // Expired payment request (expires is set to 1 = 1970-01-01 00:00:01):\n    data = DecodeBase64(paymentrequest2_cert2_BASE64);\n    byteArray = QByteArray((const char*)data.data(), data.size());\n    r.paymentRequest.parse(byteArray);\n    // Ensure the request is initialized\n    QVERIFY(r.paymentRequest.IsInitialized());\n    // compares 1 < GetTime() == false (treated as expired payment request)\n    QCOMPARE(PaymentServer::verifyExpired(r.paymentRequest.getDetails()), true);\n\n    // Unexpired payment request (expires is set to 0x7FFFFFFFFFFFFFFF = max. int64_t):\n    // 9223372036854775807 (uint64), 9223372036854775807 (int64_t) and -1 (int32_t)\n    // -1 is 1969-12-31 23:59:59 (for a 32 bit time values)\n    data = DecodeBase64(paymentrequest3_cert2_BASE64);\n    byteArray = QByteArray((const char*)data.data(), data.size());\n    r.paymentRequest.parse(byteArray);\n    // Ensure the request is initialized\n    QVERIFY(r.paymentRequest.IsInitialized());\n    // compares 9223372036854775807 < GetTime() == false (treated as unexpired payment request)\n    QCOMPARE(PaymentServer::verifyExpired(r.paymentRequest.getDetails()), false);\n\n    // Unexpired payment request (expires is set to 0x8000000000000000 > max. int64_t, allowed uint64):\n    // 9223372036854775808 (uint64), -9223372036854775808 (int64_t) and 0 (int32_t)\n    // 0 is 1970-01-01 00:00:00 (for a 32 bit time values)\n    data = DecodeBase64(paymentrequest4_cert2_BASE64);\n    byteArray = QByteArray((const char*)data.data(), data.size());\n    r.paymentRequest.parse(byteArray);\n    // Ensure the request is initialized\n    QVERIFY(r.paymentRequest.IsInitialized());\n    // compares -9223372036854775808 < GetTime() == true (treated as expired payment request)\n    QCOMPARE(PaymentServer::verifyExpired(r.paymentRequest.getDetails()), true);\n\n    // Test BIP70 DoS protection:\n    unsigned char randData[BIP70_MAX_PAYMENTREQUEST_SIZE + 1];\n    GetRandBytes(randData, sizeof(randData));\n    // Write data to a temp file:\n    QTemporaryFile tempFile;\n    tempFile.open();\n    tempFile.write((const char*)randData, sizeof(randData));\n    tempFile.close();\n    // compares 50001 <= BIP70_MAX_PAYMENTREQUEST_SIZE == false\n    QCOMPARE(PaymentServer::verifySize(tempFile.size()), false);\n\n    // Payment request with amount overflow (amount is set to 21000001 BTC):\n    data = DecodeBase64(paymentrequest5_cert2_BASE64);\n    byteArray = QByteArray((const char*)data.data(), data.size());\n    r.paymentRequest.parse(byteArray);\n    // Ensure the request is initialized\n    QVERIFY(r.paymentRequest.IsInitialized());\n    // Extract address and amount from the request\n    QList<std::pair<CScript, CAmount> > sendingTos = r.paymentRequest.getPayTo();\n\n    // FIXME.SUGAR\n    // BEGIN - DEBUG\n    printf( \"\\n\\n\\n\" );\n    printf( \"%s =\\n\", \"src/qt/test/paymentrequestdata.h/paymentrequest5_cert2_BASE64\" );\n    printf( \"***\\n\" );\n    printf( \"%s\\n\", paymentrequest5_cert2_BASE64 );\n    printf( \"***\\n\" );\n    printf( \"\\n\\n\\n\" );\n    // END - DEBUG\n\n    for (const std::pair<CScript, CAmount>& sendingTo : sendingTos) {\n        CTxDestination dest;\n        if (ExtractDestination(sendingTo.first, dest))\n            QCOMPARE(PaymentServer::verifyAmount(sendingTo.second), false);\n    }\n\n    delete server;\n}\n\nvoid RecipientCatcher::getRecipient(const SendCoinsRecipient& r)\n{\n    recipient = r;\n}\n"
  },
  {
    "path": "src/qt/test/paymentservertests.h",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TEST_PAYMENTSERVERTESTS_H\n#define BITCOIN_QT_TEST_PAYMENTSERVERTESTS_H\n\n#include <qt/paymentserver.h>\n\n#include <QObject>\n#include <QTest>\n\nclass PaymentServerTests : public QObject\n{\n    Q_OBJECT\n\nprivate Q_SLOTS:\n    void paymentServerTests();\n};\n\n// Dummy class to receive paymentserver signals.\n// If SendCoinsRecipient was a proper QObject, then\n// we could use QSignalSpy... but it's not.\nclass RecipientCatcher : public QObject\n{\n    Q_OBJECT\n\npublic Q_SLOTS:\n    void getRecipient(const SendCoinsRecipient& r);\n\npublic:\n    SendCoinsRecipient recipient;\n};\n\n#endif // BITCOIN_QT_TEST_PAYMENTSERVERTESTS_H\n"
  },
  {
    "path": "src/qt/test/rpcnestedtests.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/test/rpcnestedtests.h>\n\n#include <chainparams.h>\n#include <consensus/validation.h>\n#include <fs.h>\n#include <validation.h>\n#include <rpc/register.h>\n#include <rpc/server.h>\n#include <qt/rpcconsole.h>\n#include <test/test_bitcoin.h>\n#include <univalue.h>\n#include <util.h>\n\n#include <QDir>\n#include <QtGlobal>\n\nstatic UniValue rpcNestedTest_rpc(const JSONRPCRequest& request)\n{\n    if (request.fHelp) {\n        return \"help message\";\n    }\n    return request.params.write(0, 0);\n}\n\nstatic const CRPCCommand vRPCCommands[] =\n{\n    { \"test\", \"rpcNestedTest\", &rpcNestedTest_rpc, {} },\n};\n\nvoid RPCNestedTests::rpcNestedTests()\n{\n    // do some test setup\n    // could be moved to a more generic place when we add more tests on QT level\n    tableRPC.appendCommand(\"rpcNestedTest\", &vRPCCommands[0]);\n    //mempool.setSanityCheck(1.0);\n\n    TestingSetup test;\n\n    SetRPCWarmupFinished();\n\n    std::string result;\n    std::string result2;\n    std::string filtered;\n    RPCConsole::RPCExecuteCommandLine(result, \"getblockchaininfo()[chain]\", &filtered); //simple result filtering with path\n    QVERIFY(result==\"main\");\n    QVERIFY(filtered == \"getblockchaininfo()[chain]\");\n\n    RPCConsole::RPCExecuteCommandLine(result, \"getblock(getbestblockhash())\"); //simple 2 level nesting\n    RPCConsole::RPCExecuteCommandLine(result, \"getblock(getblock(getbestblockhash())[hash], true)\");\n\n    RPCConsole::RPCExecuteCommandLine(result, \"getblock( getblock( getblock(getbestblockhash())[hash] )[hash], true)\"); //4 level nesting with whitespace, filtering path and boolean parameter\n\n    RPCConsole::RPCExecuteCommandLine(result, \"getblockchaininfo\");\n    QVERIFY(result.substr(0,1) == \"{\");\n\n    RPCConsole::RPCExecuteCommandLine(result, \"getblockchaininfo()\");\n    QVERIFY(result.substr(0,1) == \"{\");\n\n    RPCConsole::RPCExecuteCommandLine(result, \"getblockchaininfo \"); //whitespace at the end will be tolerated\n    QVERIFY(result.substr(0,1) == \"{\");\n\n    (RPCConsole::RPCExecuteCommandLine(result, \"getblockchaininfo()[\\\"chain\\\"]\")); //Quote path identifier are allowed, but look after a child containing the quotes in the key\n    QVERIFY(result == \"null\");\n\n    (RPCConsole::RPCExecuteCommandLine(result, \"createrawtransaction [] {} 0\")); //parameter not in brackets are allowed\n    (RPCConsole::RPCExecuteCommandLine(result2, \"createrawtransaction([],{},0)\")); //parameter in brackets are allowed\n    QVERIFY(result == result2);\n    (RPCConsole::RPCExecuteCommandLine(result2, \"createrawtransaction( [],  {} , 0   )\")); //whitespace between parameters is allowed\n    QVERIFY(result == result2);\n\n    RPCConsole::RPCExecuteCommandLine(result, \"getblock(getbestblockhash())[tx][0]\", &filtered);\n    QVERIFY(result == \"7677ce2a579cb0411d1c9e6b1e9072b8f537f1e59cb387dacac2daac56e150b0\");  // FIXME.SUGAR // genesis.hashMerkleRoot\n    QVERIFY(filtered == \"getblock(getbestblockhash())[tx][0]\");\n\n    RPCConsole::RPCParseCommandLine(result, \"importprivkey\", false, &filtered);\n    QVERIFY(filtered == \"importprivkey(…)\");\n    RPCConsole::RPCParseCommandLine(result, \"signmessagewithprivkey abc\", false, &filtered);\n    QVERIFY(filtered == \"signmessagewithprivkey(…)\");\n    RPCConsole::RPCParseCommandLine(result, \"signmessagewithprivkey abc,def\", false, &filtered);\n    QVERIFY(filtered == \"signmessagewithprivkey(…)\");\n    RPCConsole::RPCParseCommandLine(result, \"signrawtransaction(abc)\", false, &filtered);\n    QVERIFY(filtered == \"signrawtransaction(…)\");\n    RPCConsole::RPCParseCommandLine(result, \"walletpassphrase(help())\", false, &filtered);\n    QVERIFY(filtered == \"walletpassphrase(…)\");\n    RPCConsole::RPCParseCommandLine(result, \"walletpassphrasechange(help(walletpassphrasechange(abc)))\", false, &filtered);\n    QVERIFY(filtered == \"walletpassphrasechange(…)\");\n    RPCConsole::RPCParseCommandLine(result, \"help(encryptwallet(abc, def))\", false, &filtered);\n    QVERIFY(filtered == \"help(encryptwallet(…))\");\n    RPCConsole::RPCParseCommandLine(result, \"help(importprivkey())\", false, &filtered);\n    QVERIFY(filtered == \"help(importprivkey(…))\");\n    RPCConsole::RPCParseCommandLine(result, \"help(importprivkey(help()))\", false, &filtered);\n    QVERIFY(filtered == \"help(importprivkey(…))\");\n    RPCConsole::RPCParseCommandLine(result, \"help(importprivkey(abc), walletpassphrase(def))\", false, &filtered);\n    QVERIFY(filtered == \"help(importprivkey(…), walletpassphrase(…))\");\n\n    RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest\");\n    QVERIFY(result == \"[]\");\n    RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest ''\");\n    QVERIFY(result == \"[\\\"\\\"]\");\n    RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest \\\"\\\"\");\n    QVERIFY(result == \"[\\\"\\\"]\");\n    RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest '' abc\");\n    QVERIFY(result == \"[\\\"\\\",\\\"abc\\\"]\");\n    RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest abc '' abc\");\n    QVERIFY(result == \"[\\\"abc\\\",\\\"\\\",\\\"abc\\\"]\");\n    RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest abc  abc\");\n    QVERIFY(result == \"[\\\"abc\\\",\\\"abc\\\"]\");\n    RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest abc\\t\\tabc\");\n    QVERIFY(result == \"[\\\"abc\\\",\\\"abc\\\"]\");\n    RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest(abc )\");\n    QVERIFY(result == \"[\\\"abc\\\"]\");\n    RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest( abc )\");\n    QVERIFY(result == \"[\\\"abc\\\"]\");\n    RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest(   abc   ,   cba )\");\n    QVERIFY(result == \"[\\\"abc\\\",\\\"cba\\\"]\");\n\n#if QT_VERSION >= 0x050300\n    // do the QVERIFY_EXCEPTION_THROWN checks only with Qt5.3 and higher (QVERIFY_EXCEPTION_THROWN was introduced in Qt5.3)\n    QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(result, \"getblockchaininfo() .\\n\"), std::runtime_error); //invalid syntax\n    QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(result, \"getblockchaininfo() getblockchaininfo()\"), std::runtime_error); //invalid syntax\n    (RPCConsole::RPCExecuteCommandLine(result, \"getblockchaininfo(\")); //tolerate non closing brackets if we have no arguments\n    (RPCConsole::RPCExecuteCommandLine(result, \"getblockchaininfo()()()\")); //tolerate non command brackts\n    QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(result, \"getblockchaininfo(True)\"), UniValue); //invalid argument\n    QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(result, \"a(getblockchaininfo(True))\"), UniValue); //method not found\n    QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest abc,,abc\"), std::runtime_error); //don't tollerate empty arguments when using ,\n    QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest(abc,,abc)\"), std::runtime_error); //don't tollerate empty arguments when using ,\n    QVERIFY_EXCEPTION_THROWN(RPCConsole::RPCExecuteCommandLine(result, \"rpcNestedTest(abc,,)\"), std::runtime_error); //don't tollerate empty arguments when using ,\n#endif\n}\n"
  },
  {
    "path": "src/qt/test/rpcnestedtests.h",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TEST_RPC_NESTED_TESTS_H\n#define BITCOIN_QT_TEST_RPC_NESTED_TESTS_H\n\n#include <QObject>\n#include <QTest>\n\n#include <txdb.h>\n#include <txmempool.h>\n\nclass RPCNestedTests : public QObject\n{\n    Q_OBJECT\n\n    private Q_SLOTS:\n    void rpcNestedTests();\n};\n\n#endif // BITCOIN_QT_TEST_RPC_NESTED_TESTS_H\n"
  },
  {
    "path": "src/qt/test/test_main.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <chainparams.h>\n#include <qt/test/rpcnestedtests.h>\n#include <util.h>\n#include <qt/test/uritests.h>\n#include <qt/test/compattests.h>\n\n#ifdef ENABLE_WALLET\n#include <qt/test/paymentservertests.h>\n#include <qt/test/wallettests.h>\n#endif\n\n#include <QApplication>\n#include <QObject>\n#include <QTest>\n\n#include <openssl/ssl.h>\n\n#if defined(QT_STATICPLUGIN)\n#include <QtPlugin>\n#if QT_VERSION < 0x050000\nQ_IMPORT_PLUGIN(qcncodecs)\nQ_IMPORT_PLUGIN(qjpcodecs)\nQ_IMPORT_PLUGIN(qtwcodecs)\nQ_IMPORT_PLUGIN(qkrcodecs)\n#else\n#if defined(QT_QPA_PLATFORM_MINIMAL)\nQ_IMPORT_PLUGIN(QMinimalIntegrationPlugin);\n#endif\n#if defined(QT_QPA_PLATFORM_XCB)\nQ_IMPORT_PLUGIN(QXcbIntegrationPlugin);\n#elif defined(QT_QPA_PLATFORM_WINDOWS)\nQ_IMPORT_PLUGIN(QWindowsIntegrationPlugin);\n#elif defined(QT_QPA_PLATFORM_COCOA)\nQ_IMPORT_PLUGIN(QCocoaIntegrationPlugin);\n#endif\n#endif\n#endif\n\nextern void noui_connect();\n\n// This is all you need to run all the tests\nint main(int argc, char *argv[])\n{\n    SetupEnvironment();\n    SetupNetworking();\n    SelectParams(CBaseChainParams::MAIN);\n    noui_connect();\n    ClearDatadirCache();\n    fs::path pathTemp = fs::temp_directory_path() / strprintf(\"test_sugarchain-qt_%lu_%i\", (unsigned long)GetTime(), (int)GetRand(100000));\n    fs::create_directories(pathTemp);\n    gArgs.ForceSetArg(\"-datadir\", pathTemp.string());\n\n    bool fInvalid = false;\n\n    // Prefer the \"minimal\" platform for the test instead of the normal default\n    // platform (\"xcb\", \"windows\", or \"cocoa\") so tests can't unintentionally\n    // interfere with any background GUIs and don't require extra resources.\n    #if defined(WIN32)\n        _putenv_s(\"QT_QPA_PLATFORM\", \"minimal\");\n    #else\n        setenv(\"QT_QPA_PLATFORM\", \"minimal\", 0);\n    #endif\n\n    // Don't remove this, it's needed to access\n    // QApplication:: and QCoreApplication:: in the tests\n    QApplication app(argc, argv);\n    app.setApplicationName(\"Sugarchain-Qt-test\");\n\n    SSL_library_init();\n\n    URITests test1;\n    if (QTest::qExec(&test1) != 0) {\n        fInvalid = true;\n    }\n#ifdef ENABLE_WALLET\n    PaymentServerTests test2;\n    if (QTest::qExec(&test2) != 0) {\n        fInvalid = true;\n    }\n#endif\n    RPCNestedTests test3;\n    if (QTest::qExec(&test3) != 0) {\n        fInvalid = true;\n    }\n    CompatTests test4;\n    if (QTest::qExec(&test4) != 0) {\n        fInvalid = true;\n    }\n#ifdef ENABLE_WALLET\n    WalletTests test5;\n    if (QTest::qExec(&test5) != 0) {\n        fInvalid = true;\n    }\n#endif\n\n    fs::remove_all(pathTemp);\n\n    return fInvalid;\n}\n"
  },
  {
    "path": "src/qt/test/uritests.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/test/uritests.h>\n\n#include <qt/guiutil.h>\n#include <qt/walletmodel.h>\n\n#include <QUrl>\n\nvoid URITests::uriTests()\n{\n    SendCoinsRecipient rv;\n    QUrl uri;\n    uri.setUrl(QString(\"sugarchain:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?req-dontexist=\"));\n    QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));\n\n    uri.setUrl(QString(\"sugarchain:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?dontexist=\"));\n    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));\n    QVERIFY(rv.address == QString(\"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"));\n    QVERIFY(rv.label == QString());\n    QVERIFY(rv.amount == 0);\n\n    uri.setUrl(QString(\"sugarchain:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?label=Wikipedia Example Address\"));\n    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));\n    QVERIFY(rv.address == QString(\"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"));\n    QVERIFY(rv.label == QString(\"Wikipedia Example Address\"));\n    QVERIFY(rv.amount == 0);\n\n    uri.setUrl(QString(\"sugarchain:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?amount=0.001\"));\n    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));\n    QVERIFY(rv.address == QString(\"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"));\n    QVERIFY(rv.label == QString());\n    QVERIFY(rv.amount == 100000);\n\n    uri.setUrl(QString(\"sugarchain:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?amount=1.001\"));\n    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));\n    QVERIFY(rv.address == QString(\"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"));\n    QVERIFY(rv.label == QString());\n    QVERIFY(rv.amount == 100100000);\n\n    uri.setUrl(QString(\"sugarchain:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?amount=100&label=Wikipedia Example\"));\n    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));\n    QVERIFY(rv.address == QString(\"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"));\n    QVERIFY(rv.amount == 10000000000LL);\n    QVERIFY(rv.label == QString(\"Wikipedia Example\"));\n\n    uri.setUrl(QString(\"sugarchain:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?message=Wikipedia Example Address\"));\n    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));\n    QVERIFY(rv.address == QString(\"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"));\n    QVERIFY(rv.label == QString());\n\n    QVERIFY(GUIUtil::parseBitcoinURI(\"sugarchain://SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?message=Wikipedia Example Address\", &rv));\n    QVERIFY(rv.address == QString(\"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"));\n    QVERIFY(rv.label == QString());\n\n    uri.setUrl(QString(\"sugarchain:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?req-message=Wikipedia Example Address\"));\n    QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));\n\n    uri.setUrl(QString(\"sugarchain:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?amount=1,000&label=Wikipedia Example\"));\n    QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));\n\n    uri.setUrl(QString(\"sugarchain:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma?amount=1,000.0&label=Wikipedia Example\"));\n    QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));\n}\n"
  },
  {
    "path": "src/qt/test/uritests.h",
    "content": "// Copyright (c) 2009-2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TEST_URITESTS_H\n#define BITCOIN_QT_TEST_URITESTS_H\n\n#include <QObject>\n#include <QTest>\n\nclass URITests : public QObject\n{\n    Q_OBJECT\n\nprivate Q_SLOTS:\n    void uriTests();\n};\n\n#endif // BITCOIN_QT_TEST_URITESTS_H\n"
  },
  {
    "path": "src/qt/test/wallettests.cpp",
    "content": "#include <qt/test/wallettests.h>\n\n#include <qt/bitcoinamountfield.h>\n#include <qt/callback.h>\n#include <qt/optionsmodel.h>\n#include <qt/platformstyle.h>\n#include <qt/qvalidatedlineedit.h>\n#include <qt/sendcoinsdialog.h>\n#include <qt/sendcoinsentry.h>\n#include <qt/transactiontablemodel.h>\n#include <qt/transactionview.h>\n#include <qt/walletmodel.h>\n#include <test/test_bitcoin.h>\n#include <validation.h>\n#include <wallet/wallet.h>\n#include <qt/overviewpage.h>\n#include <qt/receivecoinsdialog.h>\n#include <qt/recentrequeststablemodel.h>\n#include <qt/receiverequestdialog.h>\n\n#include <memory>\n\n#include <QAbstractButton>\n#include <QAction>\n#include <QApplication>\n#include <QCheckBox>\n#include <QPushButton>\n#include <QTimer>\n#include <QVBoxLayout>\n#include <QTextEdit>\n#include <QListView>\n#include <QDialogButtonBox>\n\nnamespace\n{\n//! Press \"Ok\" button in message box dialog.\nvoid ConfirmMessage(QString* text = nullptr)\n{\n    QTimer::singleShot(0, makeCallback([text](Callback* callback) {\n        for (QWidget* widget : QApplication::topLevelWidgets()) {\n            if (widget->inherits(\"QMessageBox\")) {\n                QMessageBox* messageBox = qobject_cast<QMessageBox*>(widget);\n                if (text) *text = messageBox->text();\n                messageBox->defaultButton()->click();\n            }\n        }\n        delete callback;\n    }), SLOT(call()));\n}\n\n//! Press \"Yes\" or \"Cancel\" buttons in modal send confirmation dialog.\nvoid ConfirmSend(QString* text = nullptr, bool cancel = false)\n{\n    QTimer::singleShot(0, makeCallback([text, cancel](Callback* callback) {\n        for (QWidget* widget : QApplication::topLevelWidgets()) {\n            if (widget->inherits(\"SendConfirmationDialog\")) {\n                SendConfirmationDialog* dialog = qobject_cast<SendConfirmationDialog*>(widget);\n                if (text) *text = dialog->text();\n                QAbstractButton* button = dialog->button(cancel ? QMessageBox::Cancel : QMessageBox::Yes);\n                button->setEnabled(true);\n                button->click();\n            }\n        }\n        delete callback;\n    }), SLOT(call()));\n}\n\n//! Send coins to address and return txid.\nuint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CTxDestination& address, CAmount amount, bool rbf)\n{\n    QVBoxLayout* entries = sendCoinsDialog.findChild<QVBoxLayout*>(\"entries\");\n    SendCoinsEntry* entry = qobject_cast<SendCoinsEntry*>(entries->itemAt(0)->widget());\n    entry->findChild<QValidatedLineEdit*>(\"payTo\")->setText(QString::fromStdString(EncodeDestination(address)));\n    entry->findChild<BitcoinAmountField*>(\"payAmount\")->setValue(amount);\n    sendCoinsDialog.findChild<QFrame*>(\"frameFee\")\n        ->findChild<QFrame*>(\"frameFeeSelection\")\n        ->findChild<QCheckBox*>(\"optInRBF\")\n        ->setCheckState(rbf ? Qt::Checked : Qt::Unchecked);\n    uint256 txid;\n    boost::signals2::scoped_connection c(wallet.NotifyTransactionChanged.connect([&txid](CWallet*, const uint256& hash, ChangeType status) {\n        if (status == CT_NEW) txid = hash;\n    }));\n    ConfirmSend();\n    QMetaObject::invokeMethod(&sendCoinsDialog, \"on_sendButton_clicked\");\n    return txid;\n}\n\n//! Find index of txid in transaction list.\nQModelIndex FindTx(const QAbstractItemModel& model, const uint256& txid)\n{\n    QString hash = QString::fromStdString(txid.ToString());\n    int rows = model.rowCount({});\n    for (int row = 0; row < rows; ++row) {\n        QModelIndex index = model.index(row, 0, {});\n        if (model.data(index, TransactionTableModel::TxHashRole) == hash) {\n            return index;\n        }\n    }\n    return {};\n}\n\n//! Request context menu (call method that is public in qt5, but protected in qt4).\nvoid RequestContextMenu(QWidget* widget)\n{\n    class Qt4Hack : public QWidget\n    {\n    public:\n        using QWidget::customContextMenuRequested;\n    };\n    static_cast<Qt4Hack*>(widget)->customContextMenuRequested({});\n}\n\n//! Invoke bumpfee on txid and check results.\nvoid BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, std::string expectError, bool cancel)\n{\n    QTableView* table = view.findChild<QTableView*>(\"transactionView\");\n    QModelIndex index = FindTx(*table->selectionModel()->model(), txid);\n    QVERIFY2(index.isValid(), \"Could not find BumpFee txid\");\n\n    // Select row in table, invoke context menu, and make sure bumpfee action is\n    // enabled or disabled as expected.\n    QAction* action = view.findChild<QAction*>(\"bumpFeeAction\");\n    table->selectionModel()->select(index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);\n    action->setEnabled(expectDisabled);\n    RequestContextMenu(table);\n    QCOMPARE(action->isEnabled(), !expectDisabled);\n\n    action->setEnabled(true);\n    QString text;\n    if (expectError.empty()) {\n        ConfirmSend(&text, cancel);\n    } else {\n        ConfirmMessage(&text);\n    }\n    action->trigger();\n    QVERIFY(text.indexOf(QString::fromStdString(expectError)) != -1);\n}\n\n//! Simple qt wallet tests.\n//\n// Test widgets can be debugged interactively calling show() on them and\n// manually running the event loop, e.g.:\n//\n//     sendCoinsDialog.show();\n//     QEventLoop().exec();\n//\n// This also requires overriding the default minimal Qt platform:\n//\n//     src/qt/test/test_bitcoin-qt -platform xcb      # Linux\n//     src/qt/test/test_bitcoin-qt -platform windows  # Windows\n//     src/qt/test/test_bitcoin-qt -platform cocoa    # macOS\nvoid TestGUI()\n{\n    g_address_type = OUTPUT_TYPE_P2SH_SEGWIT;\n    g_change_type = OUTPUT_TYPE_P2SH_SEGWIT;\n\n    // Set up wallet and chain with 105 blocks (5 mature blocks for spending).\n    TestChain100Setup test;\n    for (int i = 0; i < 5; ++i) {\n        test.CreateAndProcessBlock({}, GetScriptForRawPubKey(test.coinbaseKey.GetPubKey()));\n    }\n    bitdb.MakeMock();\n    std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, \"wallet_test.dat\"));\n    CWallet wallet(std::move(dbw));\n    bool firstRun;\n    wallet.LoadWallet(firstRun);\n    {\n        LOCK(wallet.cs_wallet);\n        wallet.SetAddressBook(GetDestinationForKey(test.coinbaseKey.GetPubKey(), g_address_type), \"\", \"receive\");\n        wallet.AddKeyPubKey(test.coinbaseKey, test.coinbaseKey.GetPubKey());\n    }\n    {\n        LOCK(cs_main);\n        WalletRescanReserver reserver(&wallet);\n        reserver.reserve();\n        wallet.ScanForWalletTransactions(chainActive.Genesis(), nullptr, reserver, true);\n    }\n    wallet.SetBroadcastTransactions(true);\n\n    // Create widgets for sending coins and listing transactions.\n    std::unique_ptr<const PlatformStyle> platformStyle(PlatformStyle::instantiate(\"other\"));\n    SendCoinsDialog sendCoinsDialog(platformStyle.get());\n    TransactionView transactionView(platformStyle.get());\n    OptionsModel optionsModel;\n    WalletModel walletModel(platformStyle.get(), &wallet, &optionsModel);\n    sendCoinsDialog.setModel(&walletModel);\n    transactionView.setModel(&walletModel);\n\n    // Send two transactions, and verify they are added to transaction list.\n    TransactionTableModel* transactionTableModel = walletModel.getTransactionTableModel();\n    QCOMPARE(transactionTableModel->rowCount({}), 105);\n    uint256 txid1 = SendCoins(wallet, sendCoinsDialog, CKeyID(), 5 * COIN, false /* rbf */);\n    uint256 txid2 = SendCoins(wallet, sendCoinsDialog, CKeyID(), 10 * COIN, true /* rbf */);\n    QCOMPARE(transactionTableModel->rowCount({}), 107);\n    QVERIFY(FindTx(*transactionTableModel, txid1).isValid());\n    QVERIFY(FindTx(*transactionTableModel, txid2).isValid());\n\n    // Call bumpfee. Test disabled, canceled, enabled, then failing cases.\n    BumpFee(transactionView, txid1, true /* expect disabled */, \"not BIP 125 replaceable\" /* expected error */, false /* cancel */);\n    BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, true /* cancel */);\n    BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, false /* cancel */);\n    BumpFee(transactionView, txid2, true /* expect disabled */, \"already bumped\" /* expected error */, false /* cancel */);\n\n    // Check current balance on OverviewPage\n    OverviewPage overviewPage(platformStyle.get());\n    overviewPage.setWalletModel(&walletModel);\n    QLabel* balanceLabel = overviewPage.findChild<QLabel*>(\"labelBalance\");\n    QString balanceText = balanceLabel->text();\n    int unit = walletModel.getOptionsModel()->getDisplayUnit();\n    CAmount balance = walletModel.getBalance();\n    QString balanceComparison = BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::separatorAlways);\n    QCOMPARE(balanceText, balanceComparison);\n\n    // Check Request Payment button\n    ReceiveCoinsDialog receiveCoinsDialog(platformStyle.get());\n    receiveCoinsDialog.setModel(&walletModel);\n    RecentRequestsTableModel* requestTableModel = walletModel.getRecentRequestsTableModel();\n\n    // Label input\n    QLineEdit* labelInput = receiveCoinsDialog.findChild<QLineEdit*>(\"reqLabel\");\n    labelInput->setText(\"TEST_LABEL_1\");\n\n    // Amount input\n    BitcoinAmountField* amountInput = receiveCoinsDialog.findChild<BitcoinAmountField*>(\"reqAmount\");\n    amountInput->setValue(1);\n\n    // Message input\n    QLineEdit* messageInput = receiveCoinsDialog.findChild<QLineEdit*>(\"reqMessage\");\n    messageInput->setText(\"TEST_MESSAGE_1\");\n    int initialRowCount = requestTableModel->rowCount({});\n    QPushButton* requestPaymentButton = receiveCoinsDialog.findChild<QPushButton*>(\"receiveButton\");\n    requestPaymentButton->click();\n    for (QWidget* widget : QApplication::topLevelWidgets()) {\n        if (widget->inherits(\"ReceiveRequestDialog\")) {\n            ReceiveRequestDialog* receiveRequestDialog = qobject_cast<ReceiveRequestDialog*>(widget);\n            QTextEdit* rlist = receiveRequestDialog->QObject::findChild<QTextEdit*>(\"outUri\");\n            QString paymentText = rlist->toPlainText();\n            QStringList paymentTextList = paymentText.split('\\n');\n            QCOMPARE(paymentTextList.at(0), QString(\"Payment information\"));\n            QVERIFY(paymentTextList.at(1).indexOf(QString(\"URI: sugarchain:\")) != -1);\n            QVERIFY(paymentTextList.at(2).indexOf(QString(\"Address:\")) != -1);\n            QCOMPARE(paymentTextList.at(3), QString(\"Amount: 0.00000001 \") + QString::fromStdString(CURRENCY_UNIT));\n            QCOMPARE(paymentTextList.at(4), QString(\"Label: TEST_LABEL_1\"));\n            QCOMPARE(paymentTextList.at(5), QString(\"Message: TEST_MESSAGE_1\"));\n        }\n    }\n\n    // Clear button\n    QPushButton* clearButton = receiveCoinsDialog.findChild<QPushButton*>(\"clearButton\");\n    clearButton->click();\n    QCOMPARE(labelInput->text(), QString(\"\"));\n    QCOMPARE(amountInput->value(), CAmount(0));\n    QCOMPARE(messageInput->text(), QString(\"\"));\n\n    // Check addition to history\n    int currentRowCount = requestTableModel->rowCount({});\n    QCOMPARE(currentRowCount, initialRowCount+1);\n\n    // Check Remove button\n    QTableView* table = receiveCoinsDialog.findChild<QTableView*>(\"recentRequestsView\");\n    table->selectRow(currentRowCount-1);\n    QPushButton* removeRequestButton = receiveCoinsDialog.findChild<QPushButton*>(\"removeRequestButton\");\n    removeRequestButton->click();\n    QCOMPARE(requestTableModel->rowCount({}), currentRowCount-1);\n\n    bitdb.Flush(true);\n    bitdb.Reset();\n}\n\n}\n\nvoid WalletTests::walletTests()\n{\n    TestGUI();\n}\n"
  },
  {
    "path": "src/qt/test/wallettests.h",
    "content": "#ifndef BITCOIN_QT_TEST_WALLETTESTS_H\n#define BITCOIN_QT_TEST_WALLETTESTS_H\n\n#include <QObject>\n#include <QTest>\n\nclass WalletTests : public QObject\n{\n    Q_OBJECT\n\nprivate Q_SLOTS:\n    void walletTests();\n};\n\n#endif // BITCOIN_QT_TEST_WALLETTESTS_H\n"
  },
  {
    "path": "src/qt/trafficgraphwidget.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/trafficgraphwidget.h>\n#include <qt/clientmodel.h>\n\n#include <QPainter>\n#include <QColor>\n#include <QTimer>\n\n#include <cmath>\n\n#define DESIRED_SAMPLES         800\n\n#define XMARGIN                 10\n#define YMARGIN                 10\n\nTrafficGraphWidget::TrafficGraphWidget(QWidget *parent) :\n    QWidget(parent),\n    timer(0),\n    fMax(0.0f),\n    nMins(0),\n    vSamplesIn(),\n    vSamplesOut(),\n    nLastBytesIn(0),\n    nLastBytesOut(0),\n    clientModel(0)\n{\n    timer = new QTimer(this);\n    connect(timer, SIGNAL(timeout()), SLOT(updateRates()));\n}\n\nvoid TrafficGraphWidget::setClientModel(ClientModel *model)\n{\n    clientModel = model;\n    if(model) {\n        nLastBytesIn = model->getTotalBytesRecv();\n        nLastBytesOut = model->getTotalBytesSent();\n    }\n}\n\nint TrafficGraphWidget::getGraphRangeMins() const\n{\n    return nMins;\n}\n\nvoid TrafficGraphWidget::paintPath(QPainterPath &path, QQueue<float> &samples)\n{\n    int sampleCount = samples.size();\n    if(sampleCount > 0) {\n        int h = height() - YMARGIN * 2, w = width() - XMARGIN * 2;\n        int x = XMARGIN + w;\n        path.moveTo(x, YMARGIN + h);\n        for(int i = 0; i < sampleCount; ++i) {\n            x = XMARGIN + w - w * i / DESIRED_SAMPLES;\n            int y = YMARGIN + h - (int)(h * samples.at(i) / fMax);\n            path.lineTo(x, y);\n        }\n        path.lineTo(x, YMARGIN + h);\n    }\n}\n\nvoid TrafficGraphWidget::paintEvent(QPaintEvent *)\n{\n    QPainter painter(this);\n    painter.fillRect(rect(), Qt::black);\n\n    if(fMax <= 0.0f) return;\n\n    QColor axisCol(Qt::gray);\n    int h = height() - YMARGIN * 2;\n    painter.setPen(axisCol);\n    painter.drawLine(XMARGIN, YMARGIN + h, width() - XMARGIN, YMARGIN + h);\n\n    // decide what order of magnitude we are\n    int base = floor(log10(fMax));\n    float val = pow(10.0f, base);\n\n    const QString units     = tr(\"KB/s\");\n    const float yMarginText = 2.0;\n    \n    // draw lines\n    painter.setPen(axisCol);\n    painter.drawText(XMARGIN, YMARGIN + h - h * val / fMax-yMarginText, QString(\"%1 %2\").arg(val).arg(units));\n    for(float y = val; y < fMax; y += val) {\n        int yy = YMARGIN + h - h * y / fMax;\n        painter.drawLine(XMARGIN, yy, width() - XMARGIN, yy);\n    }\n    // if we drew 3 or fewer lines, break them up at the next lower order of magnitude\n    if(fMax / val <= 3.0f) {\n        axisCol = axisCol.darker();\n        val = pow(10.0f, base - 1);\n        painter.setPen(axisCol);\n        painter.drawText(XMARGIN, YMARGIN + h - h * val / fMax-yMarginText, QString(\"%1 %2\").arg(val).arg(units));\n        int count = 1;\n        for(float y = val; y < fMax; y += val, count++) {\n            // don't overwrite lines drawn above\n            if(count % 10 == 0)\n                continue;\n            int yy = YMARGIN + h - h * y / fMax;\n            painter.drawLine(XMARGIN, yy, width() - XMARGIN, yy);\n        }\n    }\n\n    if(!vSamplesIn.empty()) {\n        QPainterPath p;\n        paintPath(p, vSamplesIn);\n        painter.fillPath(p, QColor(0, 255, 0, 128));\n        painter.setPen(Qt::green);\n        painter.drawPath(p);\n    }\n    if(!vSamplesOut.empty()) {\n        QPainterPath p;\n        paintPath(p, vSamplesOut);\n        painter.fillPath(p, QColor(255, 0, 0, 128));\n        painter.setPen(Qt::red);\n        painter.drawPath(p);\n    }\n}\n\nvoid TrafficGraphWidget::updateRates()\n{\n    if(!clientModel) return;\n\n    quint64 bytesIn = clientModel->getTotalBytesRecv(),\n            bytesOut = clientModel->getTotalBytesSent();\n    float inRate = (bytesIn - nLastBytesIn) / 1024.0f * 1000 / timer->interval();\n    float outRate = (bytesOut - nLastBytesOut) / 1024.0f * 1000 / timer->interval();\n    vSamplesIn.push_front(inRate);\n    vSamplesOut.push_front(outRate);\n    nLastBytesIn = bytesIn;\n    nLastBytesOut = bytesOut;\n\n    while(vSamplesIn.size() > DESIRED_SAMPLES) {\n        vSamplesIn.pop_back();\n    }\n    while(vSamplesOut.size() > DESIRED_SAMPLES) {\n        vSamplesOut.pop_back();\n    }\n\n    float tmax = 0.0f;\n    for (float f : vSamplesIn) {\n        if(f > tmax) tmax = f;\n    }\n    for (float f : vSamplesOut) {\n        if(f > tmax) tmax = f;\n    }\n    fMax = tmax;\n    update();\n}\n\nvoid TrafficGraphWidget::setGraphRangeMins(int mins)\n{\n    nMins = mins;\n    int msecsPerSample = nMins * 60 * 1000 / DESIRED_SAMPLES;\n    timer->stop();\n    timer->setInterval(msecsPerSample);\n\n    clear();\n}\n\nvoid TrafficGraphWidget::clear()\n{\n    timer->stop();\n\n    vSamplesOut.clear();\n    vSamplesIn.clear();\n    fMax = 0.0f;\n\n    if(clientModel) {\n        nLastBytesIn = clientModel->getTotalBytesRecv();\n        nLastBytesOut = clientModel->getTotalBytesSent();\n    }\n    timer->start();\n}\n"
  },
  {
    "path": "src/qt/trafficgraphwidget.h",
    "content": "// Copyright (c) 2011-2015 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TRAFFICGRAPHWIDGET_H\n#define BITCOIN_QT_TRAFFICGRAPHWIDGET_H\n\n#include <QWidget>\n#include <QQueue>\n\nclass ClientModel;\n\nQT_BEGIN_NAMESPACE\nclass QPaintEvent;\nclass QTimer;\nQT_END_NAMESPACE\n\nclass TrafficGraphWidget : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    explicit TrafficGraphWidget(QWidget *parent = 0);\n    void setClientModel(ClientModel *model);\n    int getGraphRangeMins() const;\n\nprotected:\n    void paintEvent(QPaintEvent *);\n\npublic Q_SLOTS:\n    void updateRates();\n    void setGraphRangeMins(int mins);\n    void clear();\n\nprivate:\n    void paintPath(QPainterPath &path, QQueue<float> &samples);\n\n    QTimer *timer;\n    float fMax;\n    int nMins;\n    QQueue<float> vSamplesIn;\n    QQueue<float> vSamplesOut;\n    quint64 nLastBytesIn;\n    quint64 nLastBytesOut;\n    ClientModel *clientModel;\n};\n\n#endif // BITCOIN_QT_TRAFFICGRAPHWIDGET_H\n"
  },
  {
    "path": "src/qt/transactiondesc.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/transactiondesc.h>\n\n#include <qt/bitcoinunits.h>\n#include <qt/guiutil.h>\n#include <qt/paymentserver.h>\n#include <qt/transactionrecord.h>\n\n#include <base58.h>\n#include <consensus/consensus.h>\n#include <validation.h>\n#include <script/script.h>\n#include <timedata.h>\n#include <util.h>\n#include <wallet/db.h>\n#include <wallet/wallet.h>\n\n#include <stdint.h>\n#include <string>\n\nQString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)\n{\n    AssertLockHeld(cs_main);\n    if (!CheckFinalTx(*wtx.tx))\n    {\n        if (wtx.tx->nLockTime < LOCKTIME_THRESHOLD)\n            return tr(\"Open for %n more block(s)\", \"\", wtx.tx->nLockTime - chainActive.Height());\n        else\n            return tr(\"Open until %1\").arg(GUIUtil::dateTimeStr(wtx.tx->nLockTime));\n    }\n    else\n    {\n        int nDepth = wtx.GetDepthInMainChain();\n        if (nDepth < 0)\n            return tr(\"conflicted with a transaction with %1 confirmations\").arg(-nDepth);\n        else if (nDepth == 0)\n            return tr(\"0/unconfirmed, %1\").arg((wtx.InMempool() ? tr(\"in memory pool\") : tr(\"not in memory pool\"))) + (wtx.isAbandoned() ? \", \"+tr(\"abandoned\") : \"\");\n        else if (nDepth < 6)\n            return tr(\"%1/unconfirmed\").arg(nDepth);\n        else\n            return tr(\"%1 confirmations\").arg(nDepth);\n    }\n}\n\nQString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionRecord *rec, int unit)\n{\n    QString strHTML;\n\n    LOCK2(cs_main, wallet->cs_wallet);\n    strHTML.reserve(4000);\n    strHTML += \"<html><font face='verdana, arial, helvetica, sans-serif'>\";\n\n    int64_t nTime = wtx.GetTxTime();\n    CAmount nCredit = wtx.GetCredit(ISMINE_ALL);\n    CAmount nDebit = wtx.GetDebit(ISMINE_ALL);\n    CAmount nNet = nCredit - nDebit;\n\n    strHTML += \"<b>\" + tr(\"Status\") + \":</b> \" + FormatTxStatus(wtx);\n    strHTML += \"<br>\";\n\n    strHTML += \"<b>\" + tr(\"Date\") + \":</b> \" + (nTime ? GUIUtil::dateTimeStr(nTime) : \"\") + \"<br>\";\n\n    //\n    // From\n    //\n    if (wtx.IsCoinBase())\n    {\n        strHTML += \"<b>\" + tr(\"Source\") + \":</b> \" + tr(\"Generated\") + \"<br>\";\n    }\n    else if (wtx.mapValue.count(\"from\") && !wtx.mapValue[\"from\"].empty())\n    {\n        // Online transaction\n        strHTML += \"<b>\" + tr(\"From\") + \":</b> \" + GUIUtil::HtmlEscape(wtx.mapValue[\"from\"]) + \"<br>\";\n    }\n    else\n    {\n        // Offline transaction\n        if (nNet > 0)\n        {\n            // Credit\n            CTxDestination address = DecodeDestination(rec->address);\n            if (IsValidDestination(address)) {\n                if (wallet->mapAddressBook.count(address))\n                {\n                    strHTML += \"<b>\" + tr(\"From\") + \":</b> \" + tr(\"unknown\") + \"<br>\";\n                    strHTML += \"<b>\" + tr(\"To\") + \":</b> \";\n                    strHTML += GUIUtil::HtmlEscape(rec->address);\n                    QString addressOwned = (::IsMine(*wallet, address) == ISMINE_SPENDABLE) ? tr(\"own address\") : tr(\"watch-only\");\n                    if (!wallet->mapAddressBook[address].name.empty())\n                        strHTML += \" (\" + addressOwned + \", \" + tr(\"label\") + \": \" + GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + \")\";\n                    else\n                        strHTML += \" (\" + addressOwned + \")\";\n                    strHTML += \"<br>\";\n                }\n            }\n        }\n    }\n\n    //\n    // To\n    //\n    if (wtx.mapValue.count(\"to\") && !wtx.mapValue[\"to\"].empty())\n    {\n        // Online transaction\n        std::string strAddress = wtx.mapValue[\"to\"];\n        strHTML += \"<b>\" + tr(\"To\") + \":</b> \";\n        CTxDestination dest = DecodeDestination(strAddress);\n        if (wallet->mapAddressBook.count(dest) && !wallet->mapAddressBook[dest].name.empty())\n            strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[dest].name) + \" \";\n        strHTML += GUIUtil::HtmlEscape(strAddress) + \"<br>\";\n    }\n\n    //\n    // Amount\n    //\n    if (wtx.IsCoinBase() && nCredit == 0)\n    {\n        //\n        // Coinbase\n        //\n        CAmount nUnmatured = 0;\n        for (const CTxOut& txout : wtx.tx->vout)\n            nUnmatured += wallet->GetCredit(txout, ISMINE_ALL);\n        strHTML += \"<b>\" + tr(\"Credit\") + \":</b> \";\n        if (wtx.IsInMainChain())\n            strHTML += BitcoinUnits::formatHtmlWithUnit(unit, nUnmatured)+ \" (\" + tr(\"matures in %n more block(s)\", \"\", wtx.GetBlocksToMaturity()) + \")\";\n        else\n            strHTML += \"(\" + tr(\"not accepted\") + \")\";\n        strHTML += \"<br>\";\n    }\n    else if (nNet > 0)\n    {\n        //\n        // Credit\n        //\n        strHTML += \"<b>\" + tr(\"Credit\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, nNet) + \"<br>\";\n    }\n    else\n    {\n        isminetype fAllFromMe = ISMINE_SPENDABLE;\n        for (const CTxIn& txin : wtx.tx->vin)\n        {\n            isminetype mine = wallet->IsMine(txin);\n            if(fAllFromMe > mine) fAllFromMe = mine;\n        }\n\n        isminetype fAllToMe = ISMINE_SPENDABLE;\n        for (const CTxOut& txout : wtx.tx->vout)\n        {\n            isminetype mine = wallet->IsMine(txout);\n            if(fAllToMe > mine) fAllToMe = mine;\n        }\n\n        if (fAllFromMe)\n        {\n            if(fAllFromMe & ISMINE_WATCH_ONLY)\n                strHTML += \"<b>\" + tr(\"From\") + \":</b> \" + tr(\"watch-only\") + \"<br>\";\n\n            //\n            // Debit\n            //\n            for (const CTxOut& txout : wtx.tx->vout)\n            {\n                // Ignore change\n                isminetype toSelf = wallet->IsMine(txout);\n                if ((toSelf == ISMINE_SPENDABLE) && (fAllFromMe == ISMINE_SPENDABLE))\n                    continue;\n\n                if (!wtx.mapValue.count(\"to\") || wtx.mapValue[\"to\"].empty())\n                {\n                    // Offline transaction\n                    CTxDestination address;\n                    if (ExtractDestination(txout.scriptPubKey, address))\n                    {\n                        strHTML += \"<b>\" + tr(\"To\") + \":</b> \";\n                        if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].name.empty())\n                            strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + \" \";\n                        strHTML += GUIUtil::HtmlEscape(EncodeDestination(address));\n                        if(toSelf == ISMINE_SPENDABLE)\n                            strHTML += \" (own address)\";\n                        else if(toSelf & ISMINE_WATCH_ONLY)\n                            strHTML += \" (watch-only)\";\n                        strHTML += \"<br>\";\n                    }\n                }\n\n                strHTML += \"<b>\" + tr(\"Debit\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, -txout.nValue) + \"<br>\";\n                if(toSelf)\n                    strHTML += \"<b>\" + tr(\"Credit\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, txout.nValue) + \"<br>\";\n            }\n\n            if (fAllToMe)\n            {\n                // Payment to self\n                CAmount nChange = wtx.GetChange();\n                CAmount nValue = nCredit - nChange;\n                strHTML += \"<b>\" + tr(\"Total debit\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, -nValue) + \"<br>\";\n                strHTML += \"<b>\" + tr(\"Total credit\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, nValue) + \"<br>\";\n            }\n\n            CAmount nTxFee = nDebit - wtx.tx->GetValueOut();\n            if (nTxFee > 0)\n                strHTML += \"<b>\" + tr(\"Transaction fee\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, -nTxFee) + \"<br>\";\n        }\n        else\n        {\n            //\n            // Mixed debit transaction\n            //\n            for (const CTxIn& txin : wtx.tx->vin)\n                if (wallet->IsMine(txin))\n                    strHTML += \"<b>\" + tr(\"Debit\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, -wallet->GetDebit(txin, ISMINE_ALL)) + \"<br>\";\n            for (const CTxOut& txout : wtx.tx->vout)\n                if (wallet->IsMine(txout))\n                    strHTML += \"<b>\" + tr(\"Credit\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, wallet->GetCredit(txout, ISMINE_ALL)) + \"<br>\";\n        }\n    }\n\n    strHTML += \"<b>\" + tr(\"Net amount\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, nNet, true) + \"<br>\";\n\n    //\n    // Message\n    //\n    if (wtx.mapValue.count(\"message\") && !wtx.mapValue[\"message\"].empty())\n        strHTML += \"<br><b>\" + tr(\"Message\") + \":</b><br>\" + GUIUtil::HtmlEscape(wtx.mapValue[\"message\"], true) + \"<br>\";\n    if (wtx.mapValue.count(\"comment\") && !wtx.mapValue[\"comment\"].empty())\n        strHTML += \"<br><b>\" + tr(\"Comment\") + \":</b><br>\" + GUIUtil::HtmlEscape(wtx.mapValue[\"comment\"], true) + \"<br>\";\n\n    strHTML += \"<b>\" + tr(\"Transaction ID\") + \":</b> \" + rec->getTxID() + \"<br>\";\n    strHTML += \"<b>\" + tr(\"Transaction total size\") + \":</b> \" + QString::number(wtx.tx->GetTotalSize()) + \" bytes<br>\";\n    strHTML += \"<b>\" + tr(\"Output index\") + \":</b> \" + QString::number(rec->getOutputIndex()) + \"<br>\";\n\n    // Message from normal bitcoin:URI (bitcoin:123...?message=example)\n    for (const std::pair<std::string, std::string>& r : wtx.vOrderForm)\n        if (r.first == \"Message\")\n            strHTML += \"<br><b>\" + tr(\"Message\") + \":</b><br>\" + GUIUtil::HtmlEscape(r.second, true) + \"<br>\";\n\n    //\n    // PaymentRequest info:\n    //\n    for (const std::pair<std::string, std::string>& r : wtx.vOrderForm)\n    {\n        if (r.first == \"PaymentRequest\")\n        {\n            PaymentRequestPlus req;\n            req.parse(QByteArray::fromRawData(r.second.data(), r.second.size()));\n            QString merchant;\n            if (req.getMerchant(PaymentServer::getCertStore(), merchant))\n                strHTML += \"<b>\" + tr(\"Merchant\") + \":</b> \" + GUIUtil::HtmlEscape(merchant) + \"<br>\";\n        }\n    }\n\n    if (wtx.IsCoinBase())\n    {\n        quint32 numBlocksToMaturity = COINBASE_MATURITY +  1;\n        strHTML += \"<br>\" + tr(\"Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \\\"not accepted\\\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.\").arg(QString::number(numBlocksToMaturity)) + \"<br>\";\n    }\n\n    //\n    // Debug view\n    //\n    if (logCategories != BCLog::NONE)\n    {\n        strHTML += \"<hr><br>\" + tr(\"Debug information\") + \"<br><br>\";\n        for (const CTxIn& txin : wtx.tx->vin)\n            if(wallet->IsMine(txin))\n                strHTML += \"<b>\" + tr(\"Debit\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, -wallet->GetDebit(txin, ISMINE_ALL)) + \"<br>\";\n        for (const CTxOut& txout : wtx.tx->vout)\n            if(wallet->IsMine(txout))\n                strHTML += \"<b>\" + tr(\"Credit\") + \":</b> \" + BitcoinUnits::formatHtmlWithUnit(unit, wallet->GetCredit(txout, ISMINE_ALL)) + \"<br>\";\n\n        strHTML += \"<br><b>\" + tr(\"Transaction\") + \":</b><br>\";\n        strHTML += GUIUtil::HtmlEscape(wtx.tx->ToString(), true);\n\n        strHTML += \"<br><b>\" + tr(\"Inputs\") + \":</b>\";\n        strHTML += \"<ul>\";\n\n        for (const CTxIn& txin : wtx.tx->vin)\n        {\n            COutPoint prevout = txin.prevout;\n\n            Coin prev;\n            if(pcoinsTip->GetCoin(prevout, prev))\n            {\n                {\n                    strHTML += \"<li>\";\n                    const CTxOut &vout = prev.out;\n                    CTxDestination address;\n                    if (ExtractDestination(vout.scriptPubKey, address))\n                    {\n                        if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].name.empty())\n                            strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + \" \";\n                        strHTML += QString::fromStdString(EncodeDestination(address));\n                    }\n                    strHTML = strHTML + \" \" + tr(\"Amount\") + \"=\" + BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue);\n                    strHTML = strHTML + \" IsMine=\" + (wallet->IsMine(vout) & ISMINE_SPENDABLE ? tr(\"true\") : tr(\"false\")) + \"</li>\";\n                    strHTML = strHTML + \" IsWatchOnly=\" + (wallet->IsMine(vout) & ISMINE_WATCH_ONLY ? tr(\"true\") : tr(\"false\")) + \"</li>\";\n                }\n            }\n        }\n\n        strHTML += \"</ul>\";\n    }\n\n    strHTML += \"</font></html>\";\n    return strHTML;\n}\n"
  },
  {
    "path": "src/qt/transactiondesc.h",
    "content": "// Copyright (c) 2011-2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TRANSACTIONDESC_H\n#define BITCOIN_QT_TRANSACTIONDESC_H\n\n#include <QObject>\n#include <QString>\n\nclass TransactionRecord;\n\nclass CWallet;\nclass CWalletTx;\n\n/** Provide a human-readable extended HTML description of a transaction.\n */\nclass TransactionDesc: public QObject\n{\n    Q_OBJECT\n\npublic:\n    static QString toHTML(CWallet *wallet, CWalletTx &wtx, TransactionRecord *rec, int unit);\n\nprivate:\n    TransactionDesc() {}\n\n    static QString FormatTxStatus(const CWalletTx& wtx);\n};\n\n#endif // BITCOIN_QT_TRANSACTIONDESC_H\n"
  },
  {
    "path": "src/qt/transactiondescdialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/transactiondescdialog.h>\n#include <qt/forms/ui_transactiondescdialog.h>\n\n#include <qt/transactiontablemodel.h>\n\n#include <QModelIndex>\n\nTransactionDescDialog::TransactionDescDialog(const QModelIndex &idx, QWidget *parent) :\n    QDialog(parent),\n    ui(new Ui::TransactionDescDialog)\n{\n    ui->setupUi(this);\n    setWindowTitle(tr(\"Details for %1\").arg(idx.data(TransactionTableModel::TxIDRole).toString()));\n    QString desc = idx.data(TransactionTableModel::LongDescriptionRole).toString();\n    ui->detailText->setHtml(desc);\n}\n\nTransactionDescDialog::~TransactionDescDialog()\n{\n    delete ui;\n}\n"
  },
  {
    "path": "src/qt/transactiondescdialog.h",
    "content": "// Copyright (c) 2011-2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TRANSACTIONDESCDIALOG_H\n#define BITCOIN_QT_TRANSACTIONDESCDIALOG_H\n\n#include <QDialog>\n\nnamespace Ui {\n    class TransactionDescDialog;\n}\n\nQT_BEGIN_NAMESPACE\nclass QModelIndex;\nQT_END_NAMESPACE\n\n/** Dialog showing transaction details. */\nclass TransactionDescDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit TransactionDescDialog(const QModelIndex &idx, QWidget *parent = 0);\n    ~TransactionDescDialog();\n\nprivate:\n    Ui::TransactionDescDialog *ui;\n};\n\n#endif // BITCOIN_QT_TRANSACTIONDESCDIALOG_H\n"
  },
  {
    "path": "src/qt/transactionfilterproxy.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/transactionfilterproxy.h>\n\n#include <qt/transactiontablemodel.h>\n#include <qt/transactionrecord.h>\n\n#include <cstdlib>\n\n// Earliest date that can be represented (far in the past)\nconst QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromTime_t(0);\n// Last date that can be represented (far in the future)\nconst QDateTime TransactionFilterProxy::MAX_DATE = QDateTime::fromTime_t(0xFFFFFFFF);\n\nTransactionFilterProxy::TransactionFilterProxy(QObject *parent) :\n    QSortFilterProxyModel(parent),\n    dateFrom(MIN_DATE),\n    dateTo(MAX_DATE),\n    m_search_string(),\n    typeFilter(ALL_TYPES),\n    watchOnlyFilter(WatchOnlyFilter_All),\n    minAmount(0),\n    limitRows(-1),\n    showInactive(true)\n{\n}\n\nbool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const\n{\n    QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);\n\n    int type = index.data(TransactionTableModel::TypeRole).toInt();\n    QDateTime datetime = index.data(TransactionTableModel::DateRole).toDateTime();\n    bool involvesWatchAddress = index.data(TransactionTableModel::WatchonlyRole).toBool();\n    QString address = index.data(TransactionTableModel::AddressRole).toString();\n    QString label = index.data(TransactionTableModel::LabelRole).toString();\n    QString txid = index.data(TransactionTableModel::TxIDRole).toString();\n    qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong());\n    int status = index.data(TransactionTableModel::StatusRole).toInt();\n\n    if(!showInactive && status == TransactionStatus::Conflicted)\n        return false;\n    if(!(TYPE(type) & typeFilter))\n        return false;\n    if (involvesWatchAddress && watchOnlyFilter == WatchOnlyFilter_No)\n        return false;\n    if (!involvesWatchAddress && watchOnlyFilter == WatchOnlyFilter_Yes)\n        return false;\n    if(datetime < dateFrom || datetime > dateTo)\n        return false;\n    if (!address.contains(m_search_string, Qt::CaseInsensitive) &&\n        !  label.contains(m_search_string, Qt::CaseInsensitive) &&\n        !   txid.contains(m_search_string, Qt::CaseInsensitive)) {\n        return false;\n    }\n    if(amount < minAmount)\n        return false;\n\n    return true;\n}\n\nvoid TransactionFilterProxy::setDateRange(const QDateTime &from, const QDateTime &to)\n{\n    this->dateFrom = from;\n    this->dateTo = to;\n    invalidateFilter();\n}\n\nvoid TransactionFilterProxy::setSearchString(const QString &search_string)\n{\n    if (m_search_string == search_string) return;\n    m_search_string = search_string;\n    invalidateFilter();\n}\n\nvoid TransactionFilterProxy::setTypeFilter(quint32 modes)\n{\n    this->typeFilter = modes;\n    invalidateFilter();\n}\n\nvoid TransactionFilterProxy::setMinAmount(const CAmount& minimum)\n{\n    this->minAmount = minimum;\n    invalidateFilter();\n}\n\nvoid TransactionFilterProxy::setWatchOnlyFilter(WatchOnlyFilter filter)\n{\n    this->watchOnlyFilter = filter;\n    invalidateFilter();\n}\n\nvoid TransactionFilterProxy::setLimit(int limit)\n{\n    this->limitRows = limit;\n}\n\nvoid TransactionFilterProxy::setShowInactive(bool _showInactive)\n{\n    this->showInactive = _showInactive;\n    invalidateFilter();\n}\n\nint TransactionFilterProxy::rowCount(const QModelIndex &parent) const\n{\n    if(limitRows != -1)\n    {\n        return std::min(QSortFilterProxyModel::rowCount(parent), limitRows);\n    }\n    else\n    {\n        return QSortFilterProxyModel::rowCount(parent);\n    }\n}\n"
  },
  {
    "path": "src/qt/transactionfilterproxy.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TRANSACTIONFILTERPROXY_H\n#define BITCOIN_QT_TRANSACTIONFILTERPROXY_H\n\n#include <amount.h>\n\n#include <QDateTime>\n#include <QSortFilterProxyModel>\n\n/** Filter the transaction list according to pre-specified rules. */\nclass TransactionFilterProxy : public QSortFilterProxyModel\n{\n    Q_OBJECT\n\npublic:\n    explicit TransactionFilterProxy(QObject *parent = 0);\n\n    /** Earliest date that can be represented (far in the past) */\n    static const QDateTime MIN_DATE;\n    /** Last date that can be represented (far in the future) */\n    static const QDateTime MAX_DATE;\n    /** Type filter bit field (all types) */\n    static const quint32 ALL_TYPES = 0xFFFFFFFF;\n\n    static quint32 TYPE(int type) { return 1<<type; }\n\n    enum WatchOnlyFilter\n    {\n        WatchOnlyFilter_All,\n        WatchOnlyFilter_Yes,\n        WatchOnlyFilter_No\n    };\n\n    void setDateRange(const QDateTime &from, const QDateTime &to);\n    void setSearchString(const QString &);\n    /**\n      @note Type filter takes a bit field created with TYPE() or ALL_TYPES\n     */\n    void setTypeFilter(quint32 modes);\n    void setMinAmount(const CAmount& minimum);\n    void setWatchOnlyFilter(WatchOnlyFilter filter);\n\n    /** Set maximum number of rows returned, -1 if unlimited. */\n    void setLimit(int limit);\n\n    /** Set whether to show conflicted transactions. */\n    void setShowInactive(bool showInactive);\n\n    int rowCount(const QModelIndex &parent = QModelIndex()) const;\n\nprotected:\n    bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;\n\nprivate:\n    QDateTime dateFrom;\n    QDateTime dateTo;\n    QString m_search_string;\n    quint32 typeFilter;\n    WatchOnlyFilter watchOnlyFilter;\n    CAmount minAmount;\n    int limitRows;\n    bool showInactive;\n};\n\n#endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H\n"
  },
  {
    "path": "src/qt/transactionrecord.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/transactionrecord.h>\n\n#include <base58.h>\n#include <consensus/consensus.h>\n#include <validation.h>\n#include <timedata.h>\n#include <wallet/wallet.h>\n\n#include <stdint.h>\n\n\n/* Return positive answer if transaction should be shown in list.\n */\nbool TransactionRecord::showTransaction(const CWalletTx &wtx)\n{\n    // There are currently no cases where we hide transactions, but\n    // we may want to use this in the future for things like RBF.\n    return true;\n}\n\n/*\n * Decompose CWallet transaction to model transaction records.\n */\nQList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx)\n{\n    QList<TransactionRecord> parts;\n    int64_t nTime = wtx.GetTxTime();\n    CAmount nCredit = wtx.GetCredit(ISMINE_ALL);\n    CAmount nDebit = wtx.GetDebit(ISMINE_ALL);\n    CAmount nNet = nCredit - nDebit;\n    uint256 hash = wtx.GetHash();\n    std::map<std::string, std::string> mapValue = wtx.mapValue;\n\n    if (nNet > 0 || wtx.IsCoinBase())\n    {\n        //\n        // Credit\n        //\n        for(unsigned int i = 0; i < wtx.tx->vout.size(); i++)\n        {\n            const CTxOut& txout = wtx.tx->vout[i];\n            isminetype mine = wallet->IsMine(txout);\n            if(mine)\n            {\n                TransactionRecord sub(hash, nTime);\n                CTxDestination address;\n                sub.idx = i; // vout index\n                sub.credit = txout.nValue;\n                sub.involvesWatchAddress = mine & ISMINE_WATCH_ONLY;\n                if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address))\n                {\n                    // Received by Bitcoin Address\n                    sub.type = TransactionRecord::RecvWithAddress;\n                    sub.address = EncodeDestination(address);\n                }\n                else\n                {\n                    // Received by IP connection (deprecated features), or a multisignature or other non-simple transaction\n                    sub.type = TransactionRecord::RecvFromOther;\n                    sub.address = mapValue[\"from\"];\n                }\n                if (wtx.IsCoinBase())\n                {\n                    // Generated\n                    sub.type = TransactionRecord::Generated;\n                }\n\n                parts.append(sub);\n            }\n        }\n    }\n    else\n    {\n        bool involvesWatchAddress = false;\n        isminetype fAllFromMe = ISMINE_SPENDABLE;\n        for (const CTxIn& txin : wtx.tx->vin)\n        {\n            isminetype mine = wallet->IsMine(txin);\n            if(mine & ISMINE_WATCH_ONLY) involvesWatchAddress = true;\n            if(fAllFromMe > mine) fAllFromMe = mine;\n        }\n\n        isminetype fAllToMe = ISMINE_SPENDABLE;\n        for (const CTxOut& txout : wtx.tx->vout)\n        {\n            isminetype mine = wallet->IsMine(txout);\n            if(mine & ISMINE_WATCH_ONLY) involvesWatchAddress = true;\n            if(fAllToMe > mine) fAllToMe = mine;\n        }\n\n        if (fAllFromMe && fAllToMe)\n        {\n            // Payment to self\n            CAmount nChange = wtx.GetChange();\n\n            parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, \"\",\n                            -(nDebit - nChange), nCredit - nChange));\n            parts.last().involvesWatchAddress = involvesWatchAddress;   // maybe pass to TransactionRecord as constructor argument\n        }\n        else if (fAllFromMe)\n        {\n            //\n            // Debit\n            //\n            CAmount nTxFee = nDebit - wtx.tx->GetValueOut();\n\n            for (unsigned int nOut = 0; nOut < wtx.tx->vout.size(); nOut++)\n            {\n                const CTxOut& txout = wtx.tx->vout[nOut];\n                TransactionRecord sub(hash, nTime);\n                sub.idx = nOut;\n                sub.involvesWatchAddress = involvesWatchAddress;\n\n                if(wallet->IsMine(txout))\n                {\n                    // Ignore parts sent to self, as this is usually the change\n                    // from a transaction sent back to our own address.\n                    continue;\n                }\n\n                CTxDestination address;\n                if (ExtractDestination(txout.scriptPubKey, address))\n                {\n                    // Sent to Bitcoin Address\n                    sub.type = TransactionRecord::SendToAddress;\n                    sub.address = EncodeDestination(address);\n                }\n                else\n                {\n                    // Sent to IP, or other non-address transaction like OP_EVAL\n                    sub.type = TransactionRecord::SendToOther;\n                    sub.address = mapValue[\"to\"];\n                }\n\n                CAmount nValue = txout.nValue;\n                /* Add fee to first output */\n                if (nTxFee > 0)\n                {\n                    nValue += nTxFee;\n                    nTxFee = 0;\n                }\n                sub.debit = -nValue;\n\n                parts.append(sub);\n            }\n        }\n        else\n        {\n            //\n            // Mixed debit transaction, can't break down payees\n            //\n            parts.append(TransactionRecord(hash, nTime, TransactionRecord::Other, \"\", nNet, 0));\n            parts.last().involvesWatchAddress = involvesWatchAddress;\n        }\n    }\n\n    return parts;\n}\n\nvoid TransactionRecord::updateStatus(const CWalletTx &wtx)\n{\n    AssertLockHeld(cs_main);\n    // Determine transaction status\n\n    // Find the block the tx is in\n    CBlockIndex* pindex = nullptr;\n    BlockMap::iterator mi = mapBlockIndex.find(wtx.hashBlock);\n    if (mi != mapBlockIndex.end())\n        pindex = (*mi).second;\n\n    // Sort order, unrecorded transactions sort to the top\n    status.sortKey = strprintf(\"%010d-%01d-%010u-%03d\",\n        (pindex ? pindex->nHeight : std::numeric_limits<int>::max()),\n        (wtx.IsCoinBase() ? 1 : 0),\n        wtx.nTimeReceived,\n        idx);\n    status.countsForBalance = wtx.IsTrusted() && !(wtx.GetBlocksToMaturity() > 0);\n    status.depth = wtx.GetDepthInMainChain();\n    status.cur_num_blocks = chainActive.Height();\n\n    if (!CheckFinalTx(*wtx.tx))\n    {\n        if (wtx.tx->nLockTime < LOCKTIME_THRESHOLD)\n        {\n            status.status = TransactionStatus::OpenUntilBlock;\n            status.open_for = wtx.tx->nLockTime - chainActive.Height();\n        }\n        else\n        {\n            status.status = TransactionStatus::OpenUntilDate;\n            status.open_for = wtx.tx->nLockTime;\n        }\n    }\n    // For generated transactions, determine maturity\n    else if(type == TransactionRecord::Generated)\n    {\n        if (wtx.GetBlocksToMaturity() > 0)\n        {\n            status.status = TransactionStatus::Immature;\n\n            if (wtx.IsInMainChain())\n            {\n                status.matures_in = wtx.GetBlocksToMaturity();\n            }\n            else\n            {\n                status.status = TransactionStatus::NotAccepted;\n            }\n        }\n        else\n        {\n            status.status = TransactionStatus::Confirmed;\n        }\n    }\n    else\n    {\n        if (status.depth < 0)\n        {\n            status.status = TransactionStatus::Conflicted;\n        }\n        else if (status.depth == 0)\n        {\n            status.status = TransactionStatus::Unconfirmed;\n            if (wtx.isAbandoned())\n                status.status = TransactionStatus::Abandoned;\n        }\n        else if (status.depth < RecommendedNumConfirmations)\n        {\n            status.status = TransactionStatus::Confirming;\n        }\n        else\n        {\n            status.status = TransactionStatus::Confirmed;\n        }\n    }\n    status.needsUpdate = false;\n}\n\nbool TransactionRecord::statusUpdateNeeded() const\n{\n    AssertLockHeld(cs_main);\n    return status.cur_num_blocks != chainActive.Height() || status.needsUpdate;\n}\n\nQString TransactionRecord::getTxID() const\n{\n    return QString::fromStdString(hash.ToString());\n}\n\nint TransactionRecord::getOutputIndex() const\n{\n    return idx;\n}\n"
  },
  {
    "path": "src/qt/transactionrecord.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TRANSACTIONRECORD_H\n#define BITCOIN_QT_TRANSACTIONRECORD_H\n\n#include <amount.h>\n#include <uint256.h>\n\n#include <QList>\n#include <QString>\n\nclass CWallet;\nclass CWalletTx;\n\n/** UI model for transaction status. The transaction status is the part of a transaction that will change over time.\n */\nclass TransactionStatus\n{\npublic:\n    TransactionStatus():\n        countsForBalance(false), sortKey(\"\"),\n        matures_in(0), status(Unconfirmed), depth(0), open_for(0), cur_num_blocks(-1)\n    { }\n\n    enum Status {\n        Confirmed,          /**< Have 6 or more confirmations (normal tx) or fully mature (mined tx) **/\n        /// Normal (sent/received) transactions\n        OpenUntilDate,      /**< Transaction not yet final, waiting for date */\n        OpenUntilBlock,     /**< Transaction not yet final, waiting for block */\n        Unconfirmed,        /**< Not yet mined into a block **/\n        Confirming,         /**< Confirmed, but waiting for the recommended number of confirmations **/\n        Conflicted,         /**< Conflicts with other transaction or mempool **/\n        Abandoned,          /**< Abandoned from the wallet **/\n        /// Generated (mined) transactions\n        Immature,           /**< Mined but waiting for maturity */\n        NotAccepted         /**< Mined but not accepted */\n    };\n\n    /// Transaction counts towards available balance\n    bool countsForBalance;\n    /// Sorting key based on status\n    std::string sortKey;\n\n    /** @name Generated (mined) transactions\n       @{*/\n    int matures_in;\n    /**@}*/\n\n    /** @name Reported status\n       @{*/\n    Status status;\n    qint64 depth;\n    qint64 open_for; /**< Timestamp if status==OpenUntilDate, otherwise number\n                      of additional blocks that need to be mined before\n                      finalization */\n    /**@}*/\n\n    /** Current number of blocks (to know whether cached status is still valid) */\n    int cur_num_blocks;\n\n    bool needsUpdate;\n};\n\n/** UI model for a transaction. A core transaction can be represented by multiple UI transactions if it has\n    multiple outputs.\n */\nclass TransactionRecord\n{\npublic:\n    enum Type\n    {\n        Other,\n        Generated,\n        SendToAddress,\n        SendToOther,\n        RecvWithAddress,\n        RecvFromOther,\n        SendToSelf\n    };\n\n    /** Number of confirmation recommended for accepting a transaction */\n    static const int RecommendedNumConfirmations = 6;\n\n    TransactionRecord():\n            hash(), time(0), type(Other), address(\"\"), debit(0), credit(0), idx(0)\n    {\n    }\n\n    TransactionRecord(uint256 _hash, qint64 _time):\n            hash(_hash), time(_time), type(Other), address(\"\"), debit(0),\n            credit(0), idx(0)\n    {\n    }\n\n    TransactionRecord(uint256 _hash, qint64 _time,\n                Type _type, const std::string &_address,\n                const CAmount& _debit, const CAmount& _credit):\n            hash(_hash), time(_time), type(_type), address(_address), debit(_debit), credit(_credit),\n            idx(0)\n    {\n    }\n\n    /** Decompose CWallet transaction to model transaction records.\n     */\n    static bool showTransaction(const CWalletTx &wtx);\n    static QList<TransactionRecord> decomposeTransaction(const CWallet *wallet, const CWalletTx &wtx);\n\n    /** @name Immutable transaction attributes\n      @{*/\n    uint256 hash;\n    qint64 time;\n    Type type;\n    std::string address;\n    CAmount debit;\n    CAmount credit;\n    /**@}*/\n\n    /** Subtransaction index, for sort key */\n    int idx;\n\n    /** Status: can change with block chain update */\n    TransactionStatus status;\n\n    /** Whether the transaction was sent/received with a watch-only address */\n    bool involvesWatchAddress;\n\n    /** Return the unique identifier for this transaction (part) */\n    QString getTxID() const;\n\n    /** Return the output index of the subtransaction  */\n    int getOutputIndex() const;\n\n    /** Update status from core wallet tx.\n     */\n    void updateStatus(const CWalletTx &wtx);\n\n    /** Return whether a status update is needed.\n     */\n    bool statusUpdateNeeded() const;\n};\n\n#endif // BITCOIN_QT_TRANSACTIONRECORD_H\n"
  },
  {
    "path": "src/qt/transactiontablemodel.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/transactiontablemodel.h>\n\n#include <qt/addresstablemodel.h>\n#include <qt/guiconstants.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n#include <qt/platformstyle.h>\n#include <qt/transactiondesc.h>\n#include <qt/transactionrecord.h>\n#include <qt/walletmodel.h>\n\n#include <core_io.h>\n#include <validation.h>\n#include <sync.h>\n#include <uint256.h>\n#include <util.h>\n#include <wallet/wallet.h>\n\n#include <QColor>\n#include <QDateTime>\n#include <QDebug>\n#include <QIcon>\n#include <QList>\n\n// Amount column is right-aligned it contains numbers\nstatic int column_alignments[] = {\n        Qt::AlignLeft|Qt::AlignVCenter, /* status */\n        Qt::AlignLeft|Qt::AlignVCenter, /* watchonly */\n        Qt::AlignLeft|Qt::AlignVCenter, /* date */\n        Qt::AlignLeft|Qt::AlignVCenter, /* type */\n        Qt::AlignLeft|Qt::AlignVCenter, /* address */\n        Qt::AlignRight|Qt::AlignVCenter /* amount */\n    };\n\n// Comparison operator for sort/binary search of model tx list\nstruct TxLessThan\n{\n    bool operator()(const TransactionRecord &a, const TransactionRecord &b) const\n    {\n        return a.hash < b.hash;\n    }\n    bool operator()(const TransactionRecord &a, const uint256 &b) const\n    {\n        return a.hash < b;\n    }\n    bool operator()(const uint256 &a, const TransactionRecord &b) const\n    {\n        return a < b.hash;\n    }\n};\n\n// Private implementation\nclass TransactionTablePriv\n{\npublic:\n    TransactionTablePriv(CWallet *_wallet, TransactionTableModel *_parent) :\n        wallet(_wallet),\n        parent(_parent)\n    {\n    }\n\n    CWallet *wallet;\n    TransactionTableModel *parent;\n\n    /* Local cache of wallet.\n     * As it is in the same order as the CWallet, by definition\n     * this is sorted by sha256.\n     */\n    QList<TransactionRecord> cachedWallet;\n\n    /* Query entire wallet anew from core.\n     */\n    void refreshWallet()\n    {\n        qDebug() << \"TransactionTablePriv::refreshWallet\";\n        cachedWallet.clear();\n        {\n            LOCK2(cs_main, wallet->cs_wallet);\n            for (const auto& entry : wallet->mapWallet)\n            {\n                if (TransactionRecord::showTransaction(entry.second))\n                    cachedWallet.append(TransactionRecord::decomposeTransaction(wallet, entry.second));\n            }\n        }\n    }\n\n    /* Update our model of the wallet incrementally, to synchronize our model of the wallet\n       with that of the core.\n\n       Call with transaction that was added, removed or changed.\n     */\n    void updateWallet(const uint256 &hash, int status, bool showTransaction)\n    {\n        qDebug() << \"TransactionTablePriv::updateWallet: \" + QString::fromStdString(hash.ToString()) + \" \" + QString::number(status);\n\n        // Find bounds of this transaction in model\n        QList<TransactionRecord>::iterator lower = qLowerBound(\n            cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan());\n        QList<TransactionRecord>::iterator upper = qUpperBound(\n            cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan());\n        int lowerIndex = (lower - cachedWallet.begin());\n        int upperIndex = (upper - cachedWallet.begin());\n        bool inModel = (lower != upper);\n\n        if(status == CT_UPDATED)\n        {\n            if(showTransaction && !inModel)\n                status = CT_NEW; /* Not in model, but want to show, treat as new */\n            if(!showTransaction && inModel)\n                status = CT_DELETED; /* In model, but want to hide, treat as deleted */\n        }\n\n        qDebug() << \"    inModel=\" + QString::number(inModel) +\n                    \" Index=\" + QString::number(lowerIndex) + \"-\" + QString::number(upperIndex) +\n                    \" showTransaction=\" + QString::number(showTransaction) + \" derivedStatus=\" + QString::number(status);\n\n        switch(status)\n        {\n        case CT_NEW:\n            if(inModel)\n            {\n                qWarning() << \"TransactionTablePriv::updateWallet: Warning: Got CT_NEW, but transaction is already in model\";\n                break;\n            }\n            if(showTransaction)\n            {\n                LOCK2(cs_main, wallet->cs_wallet);\n                // Find transaction in wallet\n                std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(hash);\n                if(mi == wallet->mapWallet.end())\n                {\n                    qWarning() << \"TransactionTablePriv::updateWallet: Warning: Got CT_NEW, but transaction is not in wallet\";\n                    break;\n                }\n                // Added -- insert at the right position\n                QList<TransactionRecord> toInsert =\n                        TransactionRecord::decomposeTransaction(wallet, mi->second);\n                if(!toInsert.isEmpty()) /* only if something to insert */\n                {\n                    parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex+toInsert.size()-1);\n                    int insert_idx = lowerIndex;\n                    for (const TransactionRecord &rec : toInsert)\n                    {\n                        cachedWallet.insert(insert_idx, rec);\n                        insert_idx += 1;\n                    }\n                    parent->endInsertRows();\n                }\n            }\n            break;\n        case CT_DELETED:\n            if(!inModel)\n            {\n                qWarning() << \"TransactionTablePriv::updateWallet: Warning: Got CT_DELETED, but transaction is not in model\";\n                break;\n            }\n            // Removed -- remove entire transaction from table\n            parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);\n            cachedWallet.erase(lower, upper);\n            parent->endRemoveRows();\n            break;\n        case CT_UPDATED:\n            // Miscellaneous updates -- nothing to do, status update will take care of this, and is only computed for\n            // visible transactions.\n            for (int i = lowerIndex; i < upperIndex; i++) {\n                TransactionRecord *rec = &cachedWallet[i];\n                rec->status.needsUpdate = true;\n            }\n            break;\n        }\n    }\n\n    int size()\n    {\n        return cachedWallet.size();\n    }\n\n    TransactionRecord *index(int idx)\n    {\n        if(idx >= 0 && idx < cachedWallet.size())\n        {\n            TransactionRecord *rec = &cachedWallet[idx];\n\n            // Get required locks upfront. This avoids the GUI from getting\n            // stuck if the core is holding the locks for a longer time - for\n            // example, during a wallet rescan.\n            //\n            // If a status update is needed (blocks came in since last check),\n            //  update the status of this transaction from the wallet. Otherwise,\n            // simply re-use the cached status.\n            TRY_LOCK(cs_main, lockMain);\n            if(lockMain)\n            {\n                TRY_LOCK(wallet->cs_wallet, lockWallet);\n                if(lockWallet && rec->statusUpdateNeeded())\n                {\n                    std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(rec->hash);\n\n                    if(mi != wallet->mapWallet.end())\n                    {\n                        rec->updateStatus(mi->second);\n                    }\n                }\n            }\n            return rec;\n        }\n        return 0;\n    }\n\n    QString describe(TransactionRecord *rec, int unit)\n    {\n        {\n            LOCK2(cs_main, wallet->cs_wallet);\n            std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(rec->hash);\n            if(mi != wallet->mapWallet.end())\n            {\n                return TransactionDesc::toHTML(wallet, mi->second, rec, unit);\n            }\n        }\n        return QString();\n    }\n\n    QString getTxHex(TransactionRecord *rec)\n    {\n        LOCK2(cs_main, wallet->cs_wallet);\n        std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(rec->hash);\n        if(mi != wallet->mapWallet.end())\n        {\n            std::string strHex = EncodeHexTx(*mi->second.tx);\n            return QString::fromStdString(strHex);\n        }\n        return QString();\n    }\n};\n\nTransactionTableModel::TransactionTableModel(const PlatformStyle *_platformStyle, CWallet* _wallet, WalletModel *parent):\n        QAbstractTableModel(parent),\n        wallet(_wallet),\n        walletModel(parent),\n        priv(new TransactionTablePriv(_wallet, this)),\n        fProcessingQueuedTransactions(false),\n        platformStyle(_platformStyle)\n{\n    columns << QString() << QString() << tr(\"Date\") << tr(\"Type\") << tr(\"Label\") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());\n    priv->refreshWallet();\n\n    connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));\n\n    subscribeToCoreSignals();\n}\n\nTransactionTableModel::~TransactionTableModel()\n{\n    unsubscribeFromCoreSignals();\n    delete priv;\n}\n\n/** Updates the column title to \"Amount (DisplayUnit)\" and emits headerDataChanged() signal for table headers to react. */\nvoid TransactionTableModel::updateAmountColumnTitle()\n{\n    columns[Amount] = BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit());\n    Q_EMIT headerDataChanged(Qt::Horizontal,Amount,Amount);\n}\n\nvoid TransactionTableModel::updateTransaction(const QString &hash, int status, bool showTransaction)\n{\n    uint256 updated;\n    updated.SetHex(hash.toStdString());\n\n    priv->updateWallet(updated, status, showTransaction);\n}\n\nvoid TransactionTableModel::updateConfirmations()\n{\n    // Blocks came in since last poll.\n    // Invalidate status (number of confirmations) and (possibly) description\n    //  for all rows. Qt is smart enough to only actually request the data for the\n    //  visible rows.\n    Q_EMIT dataChanged(index(0, Status), index(priv->size()-1, Status));\n    Q_EMIT dataChanged(index(0, ToAddress), index(priv->size()-1, ToAddress));\n}\n\nint TransactionTableModel::rowCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    return priv->size();\n}\n\nint TransactionTableModel::columnCount(const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    return columns.length();\n}\n\nQString TransactionTableModel::formatTxStatus(const TransactionRecord *wtx) const\n{\n    QString status;\n\n    switch(wtx->status.status)\n    {\n    case TransactionStatus::OpenUntilBlock:\n        status = tr(\"Open for %n more block(s)\",\"\",wtx->status.open_for);\n        break;\n    case TransactionStatus::OpenUntilDate:\n        status = tr(\"Open until %1\").arg(GUIUtil::dateTimeStr(wtx->status.open_for));\n        break;\n    case TransactionStatus::Unconfirmed:\n        status = tr(\"Unconfirmed\");\n        break;\n    case TransactionStatus::Abandoned:\n        status = tr(\"Abandoned\");\n        break;\n    case TransactionStatus::Confirming:\n        status = tr(\"Confirming (%1 of %2 recommended confirmations)\").arg(wtx->status.depth).arg(TransactionRecord::RecommendedNumConfirmations);\n        break;\n    case TransactionStatus::Confirmed:\n        status = tr(\"Confirmed (%1 confirmations)\").arg(wtx->status.depth);\n        break;\n    case TransactionStatus::Conflicted:\n        status = tr(\"Conflicted\");\n        break;\n    case TransactionStatus::Immature:\n        status = tr(\"Immature (%1 confirmations, will be available after %2)\").arg(wtx->status.depth).arg(wtx->status.depth + wtx->status.matures_in);\n        break;\n    case TransactionStatus::NotAccepted:\n        status = tr(\"Generated but not accepted\");\n        break;\n    }\n\n    return status;\n}\n\nQString TransactionTableModel::formatTxDate(const TransactionRecord *wtx) const\n{\n    if(wtx->time)\n    {\n        return GUIUtil::dateTimeStr(wtx->time);\n    }\n    return QString();\n}\n\n/* Look up address in address book, if found return label (address)\n   otherwise just return (address)\n */\nQString TransactionTableModel::lookupAddress(const std::string &address, bool tooltip) const\n{\n    QString label = walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(address));\n    QString description;\n    if(!label.isEmpty())\n    {\n        description += label;\n    }\n    if(label.isEmpty() || tooltip)\n    {\n        description += QString(\" (\") + QString::fromStdString(address) + QString(\")\");\n    }\n    return description;\n}\n\nQString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const\n{\n    switch(wtx->type)\n    {\n    case TransactionRecord::RecvWithAddress:\n        return tr(\"Received with\");\n    case TransactionRecord::RecvFromOther:\n        return tr(\"Received from\");\n    case TransactionRecord::SendToAddress:\n    case TransactionRecord::SendToOther:\n        return tr(\"Sent to\");\n    case TransactionRecord::SendToSelf:\n        return tr(\"Payment to yourself\");\n    case TransactionRecord::Generated:\n        return tr(\"Mined\");\n    default:\n        return QString();\n    }\n}\n\nQVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx) const\n{\n    switch(wtx->type)\n    {\n    case TransactionRecord::Generated:\n        return QIcon(\":/icons/tx_mined\");\n    case TransactionRecord::RecvWithAddress:\n    case TransactionRecord::RecvFromOther:\n        return QIcon(\":/icons/tx_input\");\n    case TransactionRecord::SendToAddress:\n    case TransactionRecord::SendToOther:\n        return QIcon(\":/icons/tx_output\");\n    default:\n        return QIcon(\":/icons/tx_inout\");\n    }\n}\n\nQString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const\n{\n    QString watchAddress;\n    if (tooltip) {\n        // Mark transactions involving watch-only addresses by adding \" (watch-only)\"\n        watchAddress = wtx->involvesWatchAddress ? QString(\" (\") + tr(\"watch-only\") + QString(\")\") : \"\";\n    }\n\n    switch(wtx->type)\n    {\n    case TransactionRecord::RecvFromOther:\n        return QString::fromStdString(wtx->address) + watchAddress;\n    case TransactionRecord::RecvWithAddress:\n    case TransactionRecord::SendToAddress:\n    case TransactionRecord::Generated:\n        return lookupAddress(wtx->address, tooltip) + watchAddress;\n    case TransactionRecord::SendToOther:\n        return QString::fromStdString(wtx->address) + watchAddress;\n    case TransactionRecord::SendToSelf:\n    default:\n        return tr(\"(n/a)\") + watchAddress;\n    }\n}\n\nQVariant TransactionTableModel::addressColor(const TransactionRecord *wtx) const\n{\n    // Show addresses without label in a less visible color\n    switch(wtx->type)\n    {\n    case TransactionRecord::RecvWithAddress:\n    case TransactionRecord::SendToAddress:\n    case TransactionRecord::Generated:\n        {\n        QString label = walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(wtx->address));\n        if(label.isEmpty())\n            return COLOR_BAREADDRESS;\n        } break;\n    case TransactionRecord::SendToSelf:\n        return COLOR_BAREADDRESS;\n    default:\n        break;\n    }\n    return QVariant();\n}\n\nQString TransactionTableModel::formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed, BitcoinUnits::SeparatorStyle separators) const\n{\n    QString str = BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), wtx->credit + wtx->debit, false, separators);\n    if(showUnconfirmed)\n    {\n        if(!wtx->status.countsForBalance)\n        {\n            str = QString(\"[\") + str + QString(\"]\");\n        }\n    }\n    return QString(str);\n}\n\nQVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx) const\n{\n    switch(wtx->status.status)\n    {\n    case TransactionStatus::OpenUntilBlock:\n    case TransactionStatus::OpenUntilDate:\n        return COLOR_TX_STATUS_OPENUNTILDATE;\n    case TransactionStatus::Unconfirmed:\n        return QIcon(\":/icons/transaction_0\");\n    case TransactionStatus::Abandoned:\n        return QIcon(\":/icons/transaction_abandoned\");\n    case TransactionStatus::Confirming:\n        switch(wtx->status.depth)\n        {\n        case 1: return QIcon(\":/icons/transaction_1\");\n        case 2: return QIcon(\":/icons/transaction_2\");\n        case 3: return QIcon(\":/icons/transaction_3\");\n        case 4: return QIcon(\":/icons/transaction_4\");\n        default: return QIcon(\":/icons/transaction_5\");\n        };\n    case TransactionStatus::Confirmed:\n        return QIcon(\":/icons/transaction_confirmed\");\n    case TransactionStatus::Conflicted:\n        return QIcon(\":/icons/transaction_conflicted\");\n    case TransactionStatus::Immature: {\n        int total = wtx->status.depth + wtx->status.matures_in;\n        int part = (wtx->status.depth * 4 / total) + 1;\n        return QIcon(QString(\":/icons/transaction_%1\").arg(part));\n        }\n    case TransactionStatus::NotAccepted:\n        return QIcon(\":/icons/transaction_0\");\n    default:\n        return COLOR_BLACK;\n    }\n}\n\nQVariant TransactionTableModel::txWatchonlyDecoration(const TransactionRecord *wtx) const\n{\n    if (wtx->involvesWatchAddress)\n        return QIcon(\":/icons/eye\");\n    else\n        return QVariant();\n}\n\nQString TransactionTableModel::formatTooltip(const TransactionRecord *rec) const\n{\n    QString tooltip = formatTxStatus(rec) + QString(\"\\n\") + formatTxType(rec);\n    if(rec->type==TransactionRecord::RecvFromOther || rec->type==TransactionRecord::SendToOther ||\n       rec->type==TransactionRecord::SendToAddress || rec->type==TransactionRecord::RecvWithAddress)\n    {\n        tooltip += QString(\" \") + formatTxToAddress(rec, true);\n    }\n    return tooltip;\n}\n\nQVariant TransactionTableModel::data(const QModelIndex &index, int role) const\n{\n    if(!index.isValid())\n        return QVariant();\n    TransactionRecord *rec = static_cast<TransactionRecord*>(index.internalPointer());\n\n    switch(role)\n    {\n    case RawDecorationRole:\n        switch(index.column())\n        {\n        case Status:\n            return txStatusDecoration(rec);\n        case Watchonly:\n            return txWatchonlyDecoration(rec);\n        case ToAddress:\n            return txAddressDecoration(rec);\n        }\n        break;\n    case Qt::DecorationRole:\n    {\n        QIcon icon = qvariant_cast<QIcon>(index.data(RawDecorationRole));\n        return platformStyle->TextColorIcon(icon);\n    }\n    case Qt::DisplayRole:\n        switch(index.column())\n        {\n        case Date:\n            return formatTxDate(rec);\n        case Type:\n            return formatTxType(rec);\n        case ToAddress:\n            return formatTxToAddress(rec, false);\n        case Amount:\n            return formatTxAmount(rec, true, BitcoinUnits::separatorAlways);\n        }\n        break;\n    case Qt::EditRole:\n        // Edit role is used for sorting, so return the unformatted values\n        switch(index.column())\n        {\n        case Status:\n            return QString::fromStdString(rec->status.sortKey);\n        case Date:\n            return rec->time;\n        case Type:\n            return formatTxType(rec);\n        case Watchonly:\n            return (rec->involvesWatchAddress ? 1 : 0);\n        case ToAddress:\n            return formatTxToAddress(rec, true);\n        case Amount:\n            return qint64(rec->credit + rec->debit);\n        }\n        break;\n    case Qt::ToolTipRole:\n        return formatTooltip(rec);\n    case Qt::TextAlignmentRole:\n        return column_alignments[index.column()];\n    case Qt::ForegroundRole:\n        // Use the \"danger\" color for abandoned transactions\n        if(rec->status.status == TransactionStatus::Abandoned)\n        {\n            return COLOR_TX_STATUS_DANGER;\n        }\n        // Non-confirmed (but not immature) as transactions are grey\n        if(!rec->status.countsForBalance && rec->status.status != TransactionStatus::Immature)\n        {\n            return COLOR_UNCONFIRMED;\n        }\n        if(index.column() == Amount && (rec->credit+rec->debit) < 0)\n        {\n            return COLOR_NEGATIVE;\n        }\n        if(index.column() == ToAddress)\n        {\n            return addressColor(rec);\n        }\n        break;\n    case TypeRole:\n        return rec->type;\n    case DateRole:\n        return QDateTime::fromTime_t(static_cast<uint>(rec->time));\n    case WatchonlyRole:\n        return rec->involvesWatchAddress;\n    case WatchonlyDecorationRole:\n        return txWatchonlyDecoration(rec);\n    case LongDescriptionRole:\n        return priv->describe(rec, walletModel->getOptionsModel()->getDisplayUnit());\n    case AddressRole:\n        return QString::fromStdString(rec->address);\n    case LabelRole:\n        return walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(rec->address));\n    case AmountRole:\n        return qint64(rec->credit + rec->debit);\n    case TxIDRole:\n        return rec->getTxID();\n    case TxHashRole:\n        return QString::fromStdString(rec->hash.ToString());\n    case TxHexRole:\n        return priv->getTxHex(rec);\n    case TxPlainTextRole:\n        {\n            QString details;\n            QDateTime date = QDateTime::fromTime_t(static_cast<uint>(rec->time));\n            QString txLabel = walletModel->getAddressTableModel()->labelForAddress(QString::fromStdString(rec->address));\n\n            details.append(date.toString(\"M/d/yy HH:mm\"));\n            details.append(\" \");\n            details.append(formatTxStatus(rec));\n            details.append(\". \");\n            if(!formatTxType(rec).isEmpty()) {\n                details.append(formatTxType(rec));\n                details.append(\" \");\n            }\n            if(!rec->address.empty()) {\n                if(txLabel.isEmpty())\n                    details.append(tr(\"(no label)\") + \" \");\n                else {\n                    details.append(\"(\");\n                    details.append(txLabel);\n                    details.append(\") \");\n                }\n                details.append(QString::fromStdString(rec->address));\n                details.append(\" \");\n            }\n            details.append(formatTxAmount(rec, false, BitcoinUnits::separatorNever));\n            return details;\n        }\n    case ConfirmedRole:\n        return rec->status.countsForBalance;\n    case FormattedAmountRole:\n        // Used for copy/export, so don't include separators\n        return formatTxAmount(rec, false, BitcoinUnits::separatorNever);\n    case StatusRole:\n        return rec->status.status;\n    }\n    return QVariant();\n}\n\nQVariant TransactionTableModel::headerData(int section, Qt::Orientation orientation, int role) const\n{\n    if(orientation == Qt::Horizontal)\n    {\n        if(role == Qt::DisplayRole)\n        {\n            return columns[section];\n        }\n        else if (role == Qt::TextAlignmentRole)\n        {\n            return column_alignments[section];\n        } else if (role == Qt::ToolTipRole)\n        {\n            switch(section)\n            {\n            case Status:\n                return tr(\"Transaction status. Hover over this field to show number of confirmations.\");\n            case Date:\n                return tr(\"Date and time that the transaction was received.\");\n            case Type:\n                return tr(\"Type of transaction.\");\n            case Watchonly:\n                return tr(\"Whether or not a watch-only address is involved in this transaction.\");\n            case ToAddress:\n                return tr(\"User-defined intent/purpose of the transaction.\");\n            case Amount:\n                return tr(\"Amount removed from or added to balance.\");\n            }\n        }\n    }\n    return QVariant();\n}\n\nQModelIndex TransactionTableModel::index(int row, int column, const QModelIndex &parent) const\n{\n    Q_UNUSED(parent);\n    TransactionRecord *data = priv->index(row);\n    if(data)\n    {\n        return createIndex(row, column, priv->index(row));\n    }\n    return QModelIndex();\n}\n\nvoid TransactionTableModel::updateDisplayUnit()\n{\n    // emit dataChanged to update Amount column with the current unit\n    updateAmountColumnTitle();\n    Q_EMIT dataChanged(index(0, Amount), index(priv->size()-1, Amount));\n}\n\n// queue notifications to show a non freezing progress dialog e.g. for rescan\nstruct TransactionNotification\n{\npublic:\n    TransactionNotification() {}\n    TransactionNotification(uint256 _hash, ChangeType _status, bool _showTransaction):\n        hash(_hash), status(_status), showTransaction(_showTransaction) {}\n\n    void invoke(QObject *ttm)\n    {\n        QString strHash = QString::fromStdString(hash.GetHex());\n        qDebug() << \"NotifyTransactionChanged: \" + strHash + \" status= \" + QString::number(status);\n        QMetaObject::invokeMethod(ttm, \"updateTransaction\", Qt::QueuedConnection,\n                                  Q_ARG(QString, strHash),\n                                  Q_ARG(int, status),\n                                  Q_ARG(bool, showTransaction));\n    }\nprivate:\n    uint256 hash;\n    ChangeType status;\n    bool showTransaction;\n};\n\nstatic bool fQueueNotifications = false;\nstatic std::vector< TransactionNotification > vQueueNotifications;\n\nstatic void NotifyTransactionChanged(TransactionTableModel *ttm, CWallet *wallet, const uint256 &hash, ChangeType status)\n{\n    // Find transaction in wallet\n    std::map<uint256, CWalletTx>::iterator mi = wallet->mapWallet.find(hash);\n    // Determine whether to show transaction or not (determine this here so that no relocking is needed in GUI thread)\n    bool inWallet = mi != wallet->mapWallet.end();\n    bool showTransaction = (inWallet && TransactionRecord::showTransaction(mi->second));\n\n    TransactionNotification notification(hash, status, showTransaction);\n\n    if (fQueueNotifications)\n    {\n        vQueueNotifications.push_back(notification);\n        return;\n    }\n    notification.invoke(ttm);\n}\n\nstatic void ShowProgress(TransactionTableModel *ttm, const std::string &title, int nProgress)\n{\n    if (nProgress == 0)\n        fQueueNotifications = true;\n\n    if (nProgress == 100)\n    {\n        fQueueNotifications = false;\n        if (vQueueNotifications.size() > 10) // prevent balloon spam, show maximum 10 balloons\n            QMetaObject::invokeMethod(ttm, \"setProcessingQueuedTransactions\", Qt::QueuedConnection, Q_ARG(bool, true));\n        for (unsigned int i = 0; i < vQueueNotifications.size(); ++i)\n        {\n            if (vQueueNotifications.size() - i <= 10)\n                QMetaObject::invokeMethod(ttm, \"setProcessingQueuedTransactions\", Qt::QueuedConnection, Q_ARG(bool, false));\n\n            vQueueNotifications[i].invoke(ttm);\n        }\n        std::vector<TransactionNotification >().swap(vQueueNotifications); // clear\n    }\n}\n\nvoid TransactionTableModel::subscribeToCoreSignals()\n{\n    // Connect signals to wallet\n    wallet->NotifyTransactionChanged.connect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3));\n    wallet->ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2));\n}\n\nvoid TransactionTableModel::unsubscribeFromCoreSignals()\n{\n    // Disconnect signals from wallet\n    wallet->NotifyTransactionChanged.disconnect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3));\n    wallet->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2));\n}\n"
  },
  {
    "path": "src/qt/transactiontablemodel.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TRANSACTIONTABLEMODEL_H\n#define BITCOIN_QT_TRANSACTIONTABLEMODEL_H\n\n#include <qt/bitcoinunits.h>\n\n#include <QAbstractTableModel>\n#include <QStringList>\n\nclass PlatformStyle;\nclass TransactionRecord;\nclass TransactionTablePriv;\nclass WalletModel;\n\nclass CWallet;\n\n/** UI model for the transaction table of a wallet.\n */\nclass TransactionTableModel : public QAbstractTableModel\n{\n    Q_OBJECT\n\npublic:\n    explicit TransactionTableModel(const PlatformStyle *platformStyle, CWallet* wallet, WalletModel *parent = 0);\n    ~TransactionTableModel();\n\n    enum ColumnIndex {\n        Status = 0,\n        Watchonly = 1,\n        Date = 2,\n        Type = 3,\n        ToAddress = 4,\n        Amount = 5\n    };\n\n    /** Roles to get specific information from a transaction row.\n        These are independent of column.\n    */\n    enum RoleIndex {\n        /** Type of transaction */\n        TypeRole = Qt::UserRole,\n        /** Date and time this transaction was created */\n        DateRole,\n        /** Watch-only boolean */\n        WatchonlyRole,\n        /** Watch-only icon */\n        WatchonlyDecorationRole,\n        /** Long description (HTML format) */\n        LongDescriptionRole,\n        /** Address of transaction */\n        AddressRole,\n        /** Label of address related to transaction */\n        LabelRole,\n        /** Net amount of transaction */\n        AmountRole,\n        /** Unique identifier */\n        TxIDRole,\n        /** Transaction hash */\n        TxHashRole,\n        /** Transaction data, hex-encoded */\n        TxHexRole,\n        /** Whole transaction as plain text */\n        TxPlainTextRole,\n        /** Is transaction confirmed? */\n        ConfirmedRole,\n        /** Formatted amount, without brackets when unconfirmed */\n        FormattedAmountRole,\n        /** Transaction status (TransactionRecord::Status) */\n        StatusRole,\n        /** Unprocessed icon */\n        RawDecorationRole,\n    };\n\n    int rowCount(const QModelIndex &parent) const;\n    int columnCount(const QModelIndex &parent) const;\n    QVariant data(const QModelIndex &index, int role) const;\n    QVariant headerData(int section, Qt::Orientation orientation, int role) const;\n    QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;\n    bool processingQueuedTransactions() const { return fProcessingQueuedTransactions; }\n\nprivate:\n    CWallet* wallet;\n    WalletModel *walletModel;\n    QStringList columns;\n    TransactionTablePriv *priv;\n    bool fProcessingQueuedTransactions;\n    const PlatformStyle *platformStyle;\n\n    void subscribeToCoreSignals();\n    void unsubscribeFromCoreSignals();\n\n    QString lookupAddress(const std::string &address, bool tooltip) const;\n    QVariant addressColor(const TransactionRecord *wtx) const;\n    QString formatTxStatus(const TransactionRecord *wtx) const;\n    QString formatTxDate(const TransactionRecord *wtx) const;\n    QString formatTxType(const TransactionRecord *wtx) const;\n    QString formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const;\n    QString formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true, BitcoinUnits::SeparatorStyle separators=BitcoinUnits::separatorStandard) const;\n    QString formatTooltip(const TransactionRecord *rec) const;\n    QVariant txStatusDecoration(const TransactionRecord *wtx) const;\n    QVariant txWatchonlyDecoration(const TransactionRecord *wtx) const;\n    QVariant txAddressDecoration(const TransactionRecord *wtx) const;\n\npublic Q_SLOTS:\n    /* New transaction, or transaction changed status */\n    void updateTransaction(const QString &hash, int status, bool showTransaction);\n    void updateConfirmations();\n    void updateDisplayUnit();\n    /** Updates the column title to \"Amount (DisplayUnit)\" and emits headerDataChanged() signal for table headers to react. */\n    void updateAmountColumnTitle();\n    /* Needed to update fProcessingQueuedTransactions through a QueuedConnection */\n    void setProcessingQueuedTransactions(bool value) { fProcessingQueuedTransactions = value; }\n\n    friend class TransactionTablePriv;\n};\n\n#endif // BITCOIN_QT_TRANSACTIONTABLEMODEL_H\n"
  },
  {
    "path": "src/qt/transactionview.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/transactionview.h>\n\n#include <qt/addresstablemodel.h>\n#include <qt/bitcoinunits.h>\n#include <qt/csvmodelwriter.h>\n#include <qt/editaddressdialog.h>\n#include <qt/optionsmodel.h>\n#include <qt/platformstyle.h>\n#include <qt/sendcoinsdialog.h>\n#include <qt/transactiondescdialog.h>\n#include <qt/transactionfilterproxy.h>\n#include <qt/transactionrecord.h>\n#include <qt/transactiontablemodel.h>\n#include <qt/walletmodel.h>\n\n#include <ui_interface.h>\n\n#include <QComboBox>\n#include <QDateTimeEdit>\n#include <QDesktopServices>\n#include <QDoubleValidator>\n#include <QHBoxLayout>\n#include <QHeaderView>\n#include <QLabel>\n#include <QLineEdit>\n#include <QMenu>\n#include <QPoint>\n#include <QScrollBar>\n#include <QSignalMapper>\n#include <QTableView>\n#include <QTimer>\n#include <QUrl>\n#include <QVBoxLayout>\n\nTransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent) :\n    QWidget(parent), model(0), transactionProxyModel(0),\n    transactionView(0), abandonAction(0), bumpFeeAction(0), columnResizingFixer(0)\n{\n    // Build filter row\n    setContentsMargins(0,0,0,0);\n\n    QHBoxLayout *hlayout = new QHBoxLayout();\n    hlayout->setContentsMargins(0,0,0,0);\n\n    if (platformStyle->getUseExtraSpacing()) {\n        hlayout->setSpacing(5);\n        hlayout->addSpacing(26);\n    } else {\n        hlayout->setSpacing(0);\n        hlayout->addSpacing(23);\n    }\n\n    watchOnlyWidget = new QComboBox(this);\n    watchOnlyWidget->setFixedWidth(24);\n    watchOnlyWidget->addItem(\"\", TransactionFilterProxy::WatchOnlyFilter_All);\n    watchOnlyWidget->addItem(platformStyle->SingleColorIcon(\":/icons/eye_plus\"), \"\", TransactionFilterProxy::WatchOnlyFilter_Yes);\n    watchOnlyWidget->addItem(platformStyle->SingleColorIcon(\":/icons/eye_minus\"), \"\", TransactionFilterProxy::WatchOnlyFilter_No);\n    hlayout->addWidget(watchOnlyWidget);\n\n    dateWidget = new QComboBox(this);\n    if (platformStyle->getUseExtraSpacing()) {\n        dateWidget->setFixedWidth(121);\n    } else {\n        dateWidget->setFixedWidth(120);\n    }\n    dateWidget->addItem(tr(\"All\"), All);\n    dateWidget->addItem(tr(\"Today\"), Today);\n    dateWidget->addItem(tr(\"This week\"), ThisWeek);\n    dateWidget->addItem(tr(\"This month\"), ThisMonth);\n    dateWidget->addItem(tr(\"Last month\"), LastMonth);\n    dateWidget->addItem(tr(\"This year\"), ThisYear);\n    dateWidget->addItem(tr(\"Range...\"), Range);\n    hlayout->addWidget(dateWidget);\n\n    typeWidget = new QComboBox(this);\n    if (platformStyle->getUseExtraSpacing()) {\n        typeWidget->setFixedWidth(121);\n    } else {\n        typeWidget->setFixedWidth(120);\n    }\n\n    typeWidget->addItem(tr(\"All\"), TransactionFilterProxy::ALL_TYPES);\n    typeWidget->addItem(tr(\"Received with\"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |\n                                        TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther));\n    typeWidget->addItem(tr(\"Sent to\"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |\n                                  TransactionFilterProxy::TYPE(TransactionRecord::SendToOther));\n    typeWidget->addItem(tr(\"To yourself\"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));\n    typeWidget->addItem(tr(\"Mined\"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));\n    typeWidget->addItem(tr(\"Other\"), TransactionFilterProxy::TYPE(TransactionRecord::Other));\n\n    hlayout->addWidget(typeWidget);\n\n    search_widget = new QLineEdit(this);\n#if QT_VERSION >= 0x040700\n    search_widget->setPlaceholderText(tr(\"Enter address, transaction id, or label to search\"));\n#endif\n    hlayout->addWidget(search_widget);\n\n    amountWidget = new QLineEdit(this);\n#if QT_VERSION >= 0x040700\n    amountWidget->setPlaceholderText(tr(\"Min amount\"));\n#endif\n    if (platformStyle->getUseExtraSpacing()) {\n        amountWidget->setFixedWidth(97);\n    } else {\n        amountWidget->setFixedWidth(100);\n    }\n    amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));\n    hlayout->addWidget(amountWidget);\n\n    // Delay before filtering transactions in ms\n    static const int input_filter_delay = 200;\n\n    QTimer* amount_typing_delay = new QTimer(this);\n    amount_typing_delay->setSingleShot(true);\n    amount_typing_delay->setInterval(input_filter_delay);\n\n    QTimer* prefix_typing_delay = new QTimer(this);\n    prefix_typing_delay->setSingleShot(true);\n    prefix_typing_delay->setInterval(input_filter_delay);\n\n    QVBoxLayout *vlayout = new QVBoxLayout(this);\n    vlayout->setContentsMargins(0,0,0,0);\n    vlayout->setSpacing(0);\n\n    QTableView *view = new QTableView(this);\n    vlayout->addLayout(hlayout);\n    vlayout->addWidget(createDateRangeWidget());\n    vlayout->addWidget(view);\n    vlayout->setSpacing(0);\n    int width = view->verticalScrollBar()->sizeHint().width();\n    // Cover scroll bar width with spacing\n    if (platformStyle->getUseExtraSpacing()) {\n        hlayout->addSpacing(width+2);\n    } else {\n        hlayout->addSpacing(width);\n    }\n    // Always show scroll bar\n    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);\n    view->setTabKeyNavigation(false);\n    view->setContextMenuPolicy(Qt::CustomContextMenu);\n\n    view->installEventFilter(this);\n\n    transactionView = view;\n    transactionView->setObjectName(\"transactionView\");\n\n    // Actions\n    abandonAction = new QAction(tr(\"Abandon transaction\"), this);\n    bumpFeeAction = new QAction(tr(\"Increase transaction fee\"), this);\n    bumpFeeAction->setObjectName(\"bumpFeeAction\");\n    QAction *copyAddressAction = new QAction(tr(\"Copy address\"), this);\n    QAction *copyLabelAction = new QAction(tr(\"Copy label\"), this);\n    QAction *copyAmountAction = new QAction(tr(\"Copy amount\"), this);\n    QAction *copyTxIDAction = new QAction(tr(\"Copy transaction ID\"), this);\n    QAction *copyTxHexAction = new QAction(tr(\"Copy raw transaction\"), this);\n    QAction *copyTxPlainText = new QAction(tr(\"Copy full transaction details\"), this);\n    QAction *editLabelAction = new QAction(tr(\"Edit label\"), this);\n    QAction *showDetailsAction = new QAction(tr(\"Show transaction details\"), this);\n\n    contextMenu = new QMenu(this);\n    contextMenu->setObjectName(\"contextMenu\");\n    contextMenu->addAction(copyAddressAction);\n    contextMenu->addAction(copyLabelAction);\n    contextMenu->addAction(copyAmountAction);\n    contextMenu->addAction(copyTxIDAction);\n    contextMenu->addAction(copyTxHexAction);\n    contextMenu->addAction(copyTxPlainText);\n    contextMenu->addAction(showDetailsAction);\n    contextMenu->addSeparator();\n    contextMenu->addAction(bumpFeeAction);\n    contextMenu->addAction(abandonAction);\n    contextMenu->addAction(editLabelAction);\n\n    mapperThirdPartyTxUrls = new QSignalMapper(this);\n\n    // Connect actions\n    connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this, SLOT(openThirdPartyTxUrl(QString)));\n\n    connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int)));\n    connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int)));\n    connect(watchOnlyWidget, SIGNAL(activated(int)), this, SLOT(chooseWatchonly(int)));\n    connect(amountWidget, SIGNAL(textChanged(QString)), amount_typing_delay, SLOT(start()));\n    connect(amount_typing_delay, SIGNAL(timeout()), this, SLOT(changedAmount()));\n    connect(search_widget, SIGNAL(textChanged(QString)), prefix_typing_delay, SLOT(start()));\n    connect(prefix_typing_delay, SIGNAL(timeout()), this, SLOT(changedSearch()));\n\n    connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex)));\n    connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));\n\n    connect(bumpFeeAction, SIGNAL(triggered()), this, SLOT(bumpFee()));\n    connect(abandonAction, SIGNAL(triggered()), this, SLOT(abandonTx()));\n    connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));\n    connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));\n    connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));\n    connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));\n    connect(copyTxHexAction, SIGNAL(triggered()), this, SLOT(copyTxHex()));\n    connect(copyTxPlainText, SIGNAL(triggered()), this, SLOT(copyTxPlainText()));\n    connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));\n    connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));\n}\n\nvoid TransactionView::setModel(WalletModel *_model)\n{\n    this->model = _model;\n    if(_model)\n    {\n        transactionProxyModel = new TransactionFilterProxy(this);\n        transactionProxyModel->setSourceModel(_model->getTransactionTableModel());\n        transactionProxyModel->setDynamicSortFilter(true);\n        transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);\n        transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);\n\n        transactionProxyModel->setSortRole(Qt::EditRole);\n\n        transactionView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);\n        transactionView->setModel(transactionProxyModel);\n        transactionView->setAlternatingRowColors(true);\n        transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);\n        transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);\n        transactionView->setSortingEnabled(true);\n        transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder);\n        transactionView->verticalHeader()->hide();\n\n        transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH);\n        transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH);\n        transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH);\n        transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH);\n        transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);\n\n        columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(transactionView, AMOUNT_MINIMUM_COLUMN_WIDTH, MINIMUM_COLUMN_WIDTH, this);\n\n        if (_model->getOptionsModel())\n        {\n            // Add third party transaction URLs to context menu\n            QStringList listUrls = _model->getOptionsModel()->getThirdPartyTxUrls().split(\"|\", QString::SkipEmptyParts);\n            for (int i = 0; i < listUrls.size(); ++i)\n            {\n                QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host();\n                if (!host.isEmpty())\n                {\n                    QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label\n                    if (i == 0)\n                        contextMenu->addSeparator();\n                    contextMenu->addAction(thirdPartyTxUrlAction);\n                    connect(thirdPartyTxUrlAction, SIGNAL(triggered()), mapperThirdPartyTxUrls, SLOT(map()));\n                    mapperThirdPartyTxUrls->setMapping(thirdPartyTxUrlAction, listUrls[i].trimmed());\n                }\n            }\n        }\n\n        // show/hide column Watch-only\n        updateWatchOnlyColumn(_model->haveWatchOnly());\n\n        // Watch-only signal\n        connect(_model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyColumn(bool)));\n    }\n}\n\nvoid TransactionView::chooseDate(int idx)\n{\n    if(!transactionProxyModel)\n        return;\n    QDate current = QDate::currentDate();\n    dateRangeWidget->setVisible(false);\n    switch(dateWidget->itemData(idx).toInt())\n    {\n    case All:\n        transactionProxyModel->setDateRange(\n                TransactionFilterProxy::MIN_DATE,\n                TransactionFilterProxy::MAX_DATE);\n        break;\n    case Today:\n        transactionProxyModel->setDateRange(\n                QDateTime(current),\n                TransactionFilterProxy::MAX_DATE);\n        break;\n    case ThisWeek: {\n        // Find last Monday\n        QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));\n        transactionProxyModel->setDateRange(\n                QDateTime(startOfWeek),\n                TransactionFilterProxy::MAX_DATE);\n\n        } break;\n    case ThisMonth:\n        transactionProxyModel->setDateRange(\n                QDateTime(QDate(current.year(), current.month(), 1)),\n                TransactionFilterProxy::MAX_DATE);\n        break;\n    case LastMonth:\n        transactionProxyModel->setDateRange(\n                QDateTime(QDate(current.year(), current.month(), 1).addMonths(-1)),\n                QDateTime(QDate(current.year(), current.month(), 1)));\n        break;\n    case ThisYear:\n        transactionProxyModel->setDateRange(\n                QDateTime(QDate(current.year(), 1, 1)),\n                TransactionFilterProxy::MAX_DATE);\n        break;\n    case Range:\n        dateRangeWidget->setVisible(true);\n        dateRangeChanged();\n        break;\n    }\n}\n\nvoid TransactionView::chooseType(int idx)\n{\n    if(!transactionProxyModel)\n        return;\n    transactionProxyModel->setTypeFilter(\n        typeWidget->itemData(idx).toInt());\n}\n\nvoid TransactionView::chooseWatchonly(int idx)\n{\n    if(!transactionProxyModel)\n        return;\n    transactionProxyModel->setWatchOnlyFilter(\n        (TransactionFilterProxy::WatchOnlyFilter)watchOnlyWidget->itemData(idx).toInt());\n}\n\nvoid TransactionView::changedSearch()\n{\n    if(!transactionProxyModel)\n        return;\n    transactionProxyModel->setSearchString(search_widget->text());\n}\n\nvoid TransactionView::changedAmount()\n{\n    if(!transactionProxyModel)\n        return;\n    CAmount amount_parsed = 0;\n    if (BitcoinUnits::parse(model->getOptionsModel()->getDisplayUnit(), amountWidget->text(), &amount_parsed)) {\n        transactionProxyModel->setMinAmount(amount_parsed);\n    }\n    else\n    {\n        transactionProxyModel->setMinAmount(0);\n    }\n}\n\nvoid TransactionView::exportClicked()\n{\n    if (!model || !model->getOptionsModel()) {\n        return;\n    }\n\n    // CSV is currently the only supported format\n    QString filename = GUIUtil::getSaveFileName(this,\n        tr(\"Export Transaction History\"), QString(),\n        tr(\"Comma separated file (*.csv)\"), nullptr);\n\n    if (filename.isNull())\n        return;\n\n    CSVModelWriter writer(filename);\n\n    // name, column, role\n    writer.setModel(transactionProxyModel);\n    writer.addColumn(tr(\"Confirmed\"), 0, TransactionTableModel::ConfirmedRole);\n    if (model->haveWatchOnly())\n        writer.addColumn(tr(\"Watch-only\"), TransactionTableModel::Watchonly);\n    writer.addColumn(tr(\"Date\"), 0, TransactionTableModel::DateRole);\n    writer.addColumn(tr(\"Type\"), TransactionTableModel::Type, Qt::EditRole);\n    writer.addColumn(tr(\"Label\"), 0, TransactionTableModel::LabelRole);\n    writer.addColumn(tr(\"Address\"), 0, TransactionTableModel::AddressRole);\n    writer.addColumn(BitcoinUnits::getAmountColumnTitle(model->getOptionsModel()->getDisplayUnit()), 0, TransactionTableModel::FormattedAmountRole);\n    writer.addColumn(tr(\"ID\"), 0, TransactionTableModel::TxIDRole);\n\n    if(!writer.write()) {\n        Q_EMIT message(tr(\"Exporting Failed\"), tr(\"There was an error trying to save the transaction history to %1.\").arg(filename),\n            CClientUIInterface::MSG_ERROR);\n    }\n    else {\n        Q_EMIT message(tr(\"Exporting Successful\"), tr(\"The transaction history was successfully saved to %1.\").arg(filename),\n            CClientUIInterface::MSG_INFORMATION);\n    }\n}\n\nvoid TransactionView::contextualMenu(const QPoint &point)\n{\n    QModelIndex index = transactionView->indexAt(point);\n    QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);\n    if (selection.empty())\n        return;\n\n    // check if transaction can be abandoned, disable context menu action in case it doesn't\n    uint256 hash;\n    hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());\n    abandonAction->setEnabled(model->transactionCanBeAbandoned(hash));\n    bumpFeeAction->setEnabled(model->transactionCanBeBumped(hash));\n\n    if(index.isValid())\n    {\n        contextMenu->popup(transactionView->viewport()->mapToGlobal(point));\n    }\n}\n\nvoid TransactionView::abandonTx()\n{\n    if(!transactionView || !transactionView->selectionModel())\n        return;\n    QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);\n\n    // get the hash from the TxHashRole (QVariant / QString)\n    uint256 hash;\n    QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();\n    hash.SetHex(hashQStr.toStdString());\n\n    // Abandon the wallet transaction over the walletModel\n    model->abandonTransaction(hash);\n\n    // Update the table\n    model->getTransactionTableModel()->updateTransaction(hashQStr, CT_UPDATED, false);\n}\n\nvoid TransactionView::bumpFee()\n{\n    if(!transactionView || !transactionView->selectionModel())\n        return;\n    QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);\n\n    // get the hash from the TxHashRole (QVariant / QString)\n    uint256 hash;\n    QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();\n    hash.SetHex(hashQStr.toStdString());\n\n    // Bump tx fee over the walletModel\n    if (model->bumpFee(hash)) {\n        // Update the table\n        model->getTransactionTableModel()->updateTransaction(hashQStr, CT_UPDATED, true);\n    }\n}\n\nvoid TransactionView::copyAddress()\n{\n    GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::AddressRole);\n}\n\nvoid TransactionView::copyLabel()\n{\n    GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::LabelRole);\n}\n\nvoid TransactionView::copyAmount()\n{\n    GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::FormattedAmountRole);\n}\n\nvoid TransactionView::copyTxID()\n{\n    GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxIDRole);\n}\n\nvoid TransactionView::copyTxHex()\n{\n    GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxHexRole);\n}\n\nvoid TransactionView::copyTxPlainText()\n{\n    GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxPlainTextRole);\n}\n\nvoid TransactionView::editLabel()\n{\n    if(!transactionView->selectionModel() ||!model)\n        return;\n    QModelIndexList selection = transactionView->selectionModel()->selectedRows();\n    if(!selection.isEmpty())\n    {\n        AddressTableModel *addressBook = model->getAddressTableModel();\n        if(!addressBook)\n            return;\n        QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();\n        if(address.isEmpty())\n        {\n            // If this transaction has no associated address, exit\n            return;\n        }\n        // Is address in address book? Address book can miss address when a transaction is\n        // sent from outside the UI.\n        int idx = addressBook->lookupAddress(address);\n        if(idx != -1)\n        {\n            // Edit sending / receiving address\n            QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());\n            // Determine type of address, launch appropriate editor dialog type\n            QString type = modelIdx.data(AddressTableModel::TypeRole).toString();\n\n            EditAddressDialog dlg(\n                type == AddressTableModel::Receive\n                ? EditAddressDialog::EditReceivingAddress\n                : EditAddressDialog::EditSendingAddress, this);\n            dlg.setModel(addressBook);\n            dlg.loadRow(idx);\n            dlg.exec();\n        }\n        else\n        {\n            // Add sending address\n            EditAddressDialog dlg(EditAddressDialog::NewSendingAddress,\n                this);\n            dlg.setModel(addressBook);\n            dlg.setAddress(address);\n            dlg.exec();\n        }\n    }\n}\n\nvoid TransactionView::showDetails()\n{\n    if(!transactionView->selectionModel())\n        return;\n    QModelIndexList selection = transactionView->selectionModel()->selectedRows();\n    if(!selection.isEmpty())\n    {\n        TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));\n        dlg->setAttribute(Qt::WA_DeleteOnClose);\n        dlg->show();\n    }\n}\n\nvoid TransactionView::openThirdPartyTxUrl(QString url)\n{\n    if(!transactionView || !transactionView->selectionModel())\n        return;\n    QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);\n    if(!selection.isEmpty())\n         QDesktopServices::openUrl(QUrl::fromUserInput(url.replace(\"%s\", selection.at(0).data(TransactionTableModel::TxHashRole).toString())));\n}\n\nQWidget *TransactionView::createDateRangeWidget()\n{\n    dateRangeWidget = new QFrame();\n    dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);\n    dateRangeWidget->setContentsMargins(1,1,1,1);\n    QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);\n    layout->setContentsMargins(0,0,0,0);\n    layout->addSpacing(23);\n    layout->addWidget(new QLabel(tr(\"Range:\")));\n\n    dateFrom = new QDateTimeEdit(this);\n    dateFrom->setDisplayFormat(\"dd/MM/yy\");\n    dateFrom->setCalendarPopup(true);\n    dateFrom->setMinimumWidth(100);\n    dateFrom->setDate(QDate::currentDate().addDays(-7));\n    layout->addWidget(dateFrom);\n    layout->addWidget(new QLabel(tr(\"to\")));\n\n    dateTo = new QDateTimeEdit(this);\n    dateTo->setDisplayFormat(\"dd/MM/yy\");\n    dateTo->setCalendarPopup(true);\n    dateTo->setMinimumWidth(100);\n    dateTo->setDate(QDate::currentDate());\n    layout->addWidget(dateTo);\n    layout->addStretch();\n\n    // Hide by default\n    dateRangeWidget->setVisible(false);\n\n    // Notify on change\n    connect(dateFrom, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged()));\n    connect(dateTo, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged()));\n\n    return dateRangeWidget;\n}\n\nvoid TransactionView::dateRangeChanged()\n{\n    if(!transactionProxyModel)\n        return;\n    transactionProxyModel->setDateRange(\n            QDateTime(dateFrom->date()),\n            QDateTime(dateTo->date()).addDays(1));\n}\n\nvoid TransactionView::focusTransaction(const QModelIndex &idx)\n{\n    if(!transactionProxyModel)\n        return;\n    QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx);\n    transactionView->scrollTo(targetIdx);\n    transactionView->setCurrentIndex(targetIdx);\n    transactionView->setFocus();\n}\n\n// We override the virtual resizeEvent of the QWidget to adjust tables column\n// sizes as the tables width is proportional to the dialogs width.\nvoid TransactionView::resizeEvent(QResizeEvent* event)\n{\n    QWidget::resizeEvent(event);\n    columnResizingFixer->stretchColumnWidth(TransactionTableModel::ToAddress);\n}\n\n// Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text\nbool TransactionView::eventFilter(QObject *obj, QEvent *event)\n{\n    if (event->type() == QEvent::KeyPress)\n    {\n        QKeyEvent *ke = static_cast<QKeyEvent *>(event);\n        if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier))\n        {\n             GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxPlainTextRole);\n             return true;\n        }\n    }\n    return QWidget::eventFilter(obj, event);\n}\n\n// show/hide column Watch-only\nvoid TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly)\n{\n    watchOnlyWidget->setVisible(fHaveWatchOnly);\n    transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly);\n}\n"
  },
  {
    "path": "src/qt/transactionview.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_TRANSACTIONVIEW_H\n#define BITCOIN_QT_TRANSACTIONVIEW_H\n\n#include <qt/guiutil.h>\n\n#include <QWidget>\n#include <QKeyEvent>\n\nclass PlatformStyle;\nclass TransactionFilterProxy;\nclass WalletModel;\n\nQT_BEGIN_NAMESPACE\nclass QComboBox;\nclass QDateTimeEdit;\nclass QFrame;\nclass QLineEdit;\nclass QMenu;\nclass QModelIndex;\nclass QSignalMapper;\nclass QTableView;\nQT_END_NAMESPACE\n\n/** Widget showing the transaction list for a wallet, including a filter row.\n    Using the filter row, the user can view or export a subset of the transactions.\n  */\nclass TransactionView : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    explicit TransactionView(const PlatformStyle *platformStyle, QWidget *parent = 0);\n\n    void setModel(WalletModel *model);\n\n    // Date ranges for filter\n    enum DateEnum\n    {\n        All,\n        Today,\n        ThisWeek,\n        ThisMonth,\n        LastMonth,\n        ThisYear,\n        Range\n    };\n\n    enum ColumnWidths {\n        STATUS_COLUMN_WIDTH = 30,\n        WATCHONLY_COLUMN_WIDTH = 23,\n        DATE_COLUMN_WIDTH = 139, // FIXME.SUGAR // was 120\n        TYPE_COLUMN_WIDTH = 113,\n        AMOUNT_MINIMUM_COLUMN_WIDTH = 139, // FIXME.SUGAR // was 120\n        MINIMUM_COLUMN_WIDTH = 23\n    };\n\nprivate:\n    WalletModel *model;\n    TransactionFilterProxy *transactionProxyModel;\n    QTableView *transactionView;\n\n    QComboBox *dateWidget;\n    QComboBox *typeWidget;\n    QComboBox *watchOnlyWidget;\n    QLineEdit *search_widget;\n    QLineEdit *amountWidget;\n\n    QMenu *contextMenu;\n    QSignalMapper *mapperThirdPartyTxUrls;\n\n    QFrame *dateRangeWidget;\n    QDateTimeEdit *dateFrom;\n    QDateTimeEdit *dateTo;\n    QAction *abandonAction;\n    QAction *bumpFeeAction;\n\n    QWidget *createDateRangeWidget();\n\n    GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;\n\n    virtual void resizeEvent(QResizeEvent* event);\n\n    bool eventFilter(QObject *obj, QEvent *event);\n\nprivate Q_SLOTS:\n    void contextualMenu(const QPoint &);\n    void dateRangeChanged();\n    void showDetails();\n    void copyAddress();\n    void editLabel();\n    void copyLabel();\n    void copyAmount();\n    void copyTxID();\n    void copyTxHex();\n    void copyTxPlainText();\n    void openThirdPartyTxUrl(QString url);\n    void updateWatchOnlyColumn(bool fHaveWatchOnly);\n    void abandonTx();\n    void bumpFee();\n\nQ_SIGNALS:\n    void doubleClicked(const QModelIndex&);\n\n    /**  Fired when a message should be reported to the user */\n    void message(const QString &title, const QString &message, unsigned int style);\n\npublic Q_SLOTS:\n    void chooseDate(int idx);\n    void chooseType(int idx);\n    void chooseWatchonly(int idx);\n    void changedAmount();\n    void changedSearch();\n    void exportClicked();\n    void focusTransaction(const QModelIndex&);\n\n};\n\n#endif // BITCOIN_QT_TRANSACTIONVIEW_H\n"
  },
  {
    "path": "src/qt/utilitydialog.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <qt/utilitydialog.h>\n\n#include <qt/forms/ui_helpmessagedialog.h>\n\n#include <qt/bitcoingui.h>\n#include <qt/clientmodel.h>\n#include <qt/guiconstants.h>\n#include <qt/intro.h>\n#include <qt/paymentrequestplus.h>\n#include <qt/guiutil.h>\n\n#include <clientversion.h>\n#include <init.h>\n#include <util.h>\n\n#include <stdio.h>\n\n#include <QCloseEvent>\n#include <QLabel>\n#include <QRegExp>\n#include <QTextTable>\n#include <QTextCursor>\n#include <QVBoxLayout>\n\n/** \"Help message\" or \"About\" dialog box */\nHelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :\n    QDialog(parent),\n    ui(new Ui::HelpMessageDialog)\n{\n    ui->setupUi(this);\n\n    QString version = tr(PACKAGE_NAME) + \" \" + tr(\"version\") + \" \" + QString::fromStdString(FormatFullVersion());\n    /* On x86 add a bit specifier to the version so that users can distinguish between\n     * 32 and 64 bit builds. On other architectures, 32/64 bit may be more ambiguous.\n     */\n#if defined(__x86_64__)\n    version += \" \" + tr(\"(%1-bit)\").arg(64);\n#elif defined(__i386__ )\n    version += \" \" + tr(\"(%1-bit)\").arg(32);\n#endif\n\n    if (about)\n    {\n        setWindowTitle(tr(\"About %1\").arg(tr(PACKAGE_NAME)));\n\n        /// HTML-format the license message from the core\n        QString licenseInfo = QString::fromStdString(LicenseInfo());\n        QString licenseInfoHTML = licenseInfo;\n        // Make URLs clickable\n        QRegExp uri(\"<(.*)>\", Qt::CaseSensitive, QRegExp::RegExp2);\n        uri.setMinimal(true); // use non-greedy matching\n        licenseInfoHTML.replace(uri, \"<a href=\\\"\\\\1\\\">\\\\1</a>\");\n        // Replace newlines with HTML breaks\n        licenseInfoHTML.replace(\"\\n\", \"<br>\");\n\n        ui->aboutMessage->setTextFormat(Qt::RichText);\n        ui->scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);\n        text = version + \"\\n\" + licenseInfo;\n        ui->aboutMessage->setText(version + \"<br><br>\" + licenseInfoHTML);\n        ui->aboutMessage->setWordWrap(true);\n        ui->helpMessage->setVisible(false);\n    } else {\n        setWindowTitle(tr(\"Command-line options\"));\n        QString header = tr(\"Usage:\") + \"\\n\" +\n            \"  sugarchain-qt [\" + tr(\"command-line options\") + \"]                     \" + \"\\n\";\n        QTextCursor cursor(ui->helpMessage->document());\n        cursor.insertText(version);\n        cursor.insertBlock();\n        cursor.insertText(header);\n        cursor.insertBlock();\n\n        std::string strUsage = HelpMessage(HMM_BITCOIN_QT);\n        const bool showDebug = gArgs.GetBoolArg(\"-help-debug\", false);\n        strUsage += HelpMessageGroup(tr(\"UI Options:\").toStdString());\n        if (showDebug) {\n            strUsage += HelpMessageOpt(\"-allowselfsignedrootcertificates\", strprintf(\"Allow self signed root certificates (default: %u)\", DEFAULT_SELFSIGNED_ROOTCERTS));\n        }\n        strUsage += HelpMessageOpt(\"-choosedatadir\", strprintf(tr(\"Choose data directory on startup (default: %u)\").toStdString(), DEFAULT_CHOOSE_DATADIR));\n        strUsage += HelpMessageOpt(\"-lang=<lang>\", tr(\"Set language, for example \\\"de_DE\\\" (default: system locale)\").toStdString());\n        strUsage += HelpMessageOpt(\"-min\", tr(\"Start minimized\").toStdString());\n        strUsage += HelpMessageOpt(\"-rootcertificates=<file>\", tr(\"Set SSL root certificates for payment request (default: -system-)\").toStdString());\n        strUsage += HelpMessageOpt(\"-splash\", strprintf(tr(\"Show splash screen on startup (default: %u)\").toStdString(), DEFAULT_SPLASHSCREEN));\n        strUsage += HelpMessageOpt(\"-resetguisettings\", tr(\"Reset all settings changed in the GUI\").toStdString());\n        if (showDebug) {\n            strUsage += HelpMessageOpt(\"-uiplatform\", strprintf(\"Select platform to customize UI for (one of windows, macosx, other; default: %s)\", BitcoinGUI::DEFAULT_UIPLATFORM));\n        }\n        QString coreOptions = QString::fromStdString(strUsage);\n        text = version + \"\\n\" + header + \"\\n\" + coreOptions;\n\n        QTextTableFormat tf;\n        tf.setBorderStyle(QTextFrameFormat::BorderStyle_None);\n        tf.setCellPadding(2);\n        QVector<QTextLength> widths;\n        widths << QTextLength(QTextLength::PercentageLength, 35);\n        widths << QTextLength(QTextLength::PercentageLength, 65);\n        tf.setColumnWidthConstraints(widths);\n\n        QTextCharFormat bold;\n        bold.setFontWeight(QFont::Bold);\n\n        for (const QString &line : coreOptions.split(\"\\n\")) {\n            if (line.startsWith(\"  -\"))\n            {\n                cursor.currentTable()->appendRows(1);\n                cursor.movePosition(QTextCursor::PreviousCell);\n                cursor.movePosition(QTextCursor::NextRow);\n                cursor.insertText(line.trimmed());\n                cursor.movePosition(QTextCursor::NextCell);\n            } else if (line.startsWith(\"   \")) {\n                cursor.insertText(line.trimmed()+' ');\n            } else if (line.size() > 0) {\n                //Title of a group\n                if (cursor.currentTable())\n                    cursor.currentTable()->appendRows(1);\n                cursor.movePosition(QTextCursor::Down);\n                cursor.insertText(line.trimmed(), bold);\n                cursor.insertTable(1, 2, tf);\n            }\n        }\n\n        ui->helpMessage->moveCursor(QTextCursor::Start);\n        ui->scrollArea->setVisible(false);\n        ui->aboutLogo->setVisible(false);\n    }\n}\n\nHelpMessageDialog::~HelpMessageDialog()\n{\n    delete ui;\n}\n\nvoid HelpMessageDialog::printToConsole()\n{\n    // On other operating systems, the expected action is to print the message to the console.\n    fprintf(stdout, \"%s\\n\", qPrintable(text));\n}\n\nvoid HelpMessageDialog::showOrPrint()\n{\n#if defined(WIN32)\n    // On Windows, show a message box, as there is no stderr/stdout in windowed applications\n    exec();\n#else\n    // On other operating systems, print help text to console\n    printToConsole();\n#endif\n}\n\nvoid HelpMessageDialog::on_okButton_accepted()\n{\n    close();\n}\n\n\n/** \"Shutdown\" window */\nShutdownWindow::ShutdownWindow(QWidget *parent, Qt::WindowFlags f):\n    QWidget(parent, f)\n{\n    QVBoxLayout *layout = new QVBoxLayout();\n    layout->addWidget(new QLabel(\n        tr(\"%1 is shutting down...\").arg(tr(PACKAGE_NAME)) + \"<br /><br />\" +\n        tr(\"Do not shut down the computer until this window disappears.\")));\n    setLayout(layout);\n}\n\nQWidget *ShutdownWindow::showShutdownWindow(BitcoinGUI *window)\n{\n    if (!window)\n        return nullptr;\n\n    // Show a simple window indicating shutdown status\n    QWidget *shutdownWindow = new ShutdownWindow();\n    shutdownWindow->setWindowTitle(window->windowTitle());\n\n    // Center shutdown window at where main window was\n    const QPoint global = window->mapToGlobal(window->rect().center());\n    shutdownWindow->move(global.x() - shutdownWindow->width() / 2, global.y() - shutdownWindow->height() / 2);\n    shutdownWindow->show();\n    return shutdownWindow;\n}\n\nvoid ShutdownWindow::closeEvent(QCloseEvent *event)\n{\n    event->ignore();\n}\n"
  },
  {
    "path": "src/qt/utilitydialog.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_UTILITYDIALOG_H\n#define BITCOIN_QT_UTILITYDIALOG_H\n\n#include <QDialog>\n#include <QObject>\n\nclass BitcoinGUI;\n\nnamespace Ui {\n    class HelpMessageDialog;\n}\n\n/** \"Help message\" dialog box */\nclass HelpMessageDialog : public QDialog\n{\n    Q_OBJECT\n\npublic:\n    explicit HelpMessageDialog(QWidget *parent, bool about);\n    ~HelpMessageDialog();\n\n    void printToConsole();\n    void showOrPrint();\n\nprivate:\n    Ui::HelpMessageDialog *ui;\n    QString text;\n\nprivate Q_SLOTS:\n    void on_okButton_accepted();\n};\n\n\n/** \"Shutdown\" window */\nclass ShutdownWindow : public QWidget\n{\n    Q_OBJECT\n\npublic:\n    explicit ShutdownWindow(QWidget *parent=0, Qt::WindowFlags f=0);\n    static QWidget *showShutdownWindow(BitcoinGUI *window);\n\nprotected:\n    void closeEvent(QCloseEvent *event);\n};\n\n#endif // BITCOIN_QT_UTILITYDIALOG_H\n"
  },
  {
    "path": "src/qt/walletframe.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/walletframe.h>\n\n#include <qt/bitcoingui.h>\n#include <qt/walletview.h>\n\n#include <cassert>\n#include <cstdio>\n\n#include <QHBoxLayout>\n#include <QLabel>\n\nWalletFrame::WalletFrame(const PlatformStyle *_platformStyle, BitcoinGUI *_gui) :\n    QFrame(_gui),\n    gui(_gui),\n    platformStyle(_platformStyle)\n{\n    // Leave HBox hook for adding a list view later\n    QHBoxLayout *walletFrameLayout = new QHBoxLayout(this);\n    setContentsMargins(0,0,0,0);\n    walletStack = new QStackedWidget(this);\n    walletFrameLayout->setContentsMargins(0,0,0,0);\n    walletFrameLayout->addWidget(walletStack);\n\n    QLabel *noWallet = new QLabel(tr(\"No wallet has been loaded.\"));\n    noWallet->setAlignment(Qt::AlignCenter);\n    walletStack->addWidget(noWallet);\n}\n\nWalletFrame::~WalletFrame()\n{\n}\n\nvoid WalletFrame::setClientModel(ClientModel *_clientModel)\n{\n    this->clientModel = _clientModel;\n}\n\nbool WalletFrame::addWallet(const QString& name, WalletModel *walletModel)\n{\n    if (!gui || !clientModel || !walletModel || mapWalletViews.count(name) > 0)\n        return false;\n\n    WalletView *walletView = new WalletView(platformStyle, this);\n    walletView->setBitcoinGUI(gui);\n    walletView->setClientModel(clientModel);\n    walletView->setWalletModel(walletModel);\n    walletView->showOutOfSyncWarning(bOutOfSync);\n\n     /* TODO we should goto the currently selected page once dynamically adding wallets is supported */\n    walletView->gotoOverviewPage();\n    walletStack->addWidget(walletView);\n    mapWalletViews[name] = walletView;\n\n    // Ensure a walletView is able to show the main window\n    connect(walletView, SIGNAL(showNormalIfMinimized()), gui, SLOT(showNormalIfMinimized()));\n\n    connect(walletView, SIGNAL(outOfSyncWarningClicked()), this, SLOT(outOfSyncWarningClicked()));\n\n    return true;\n}\n\nbool WalletFrame::setCurrentWallet(const QString& name)\n{\n    if (mapWalletViews.count(name) == 0)\n        return false;\n\n    WalletView *walletView = mapWalletViews.value(name);\n    walletStack->setCurrentWidget(walletView);\n    assert(walletView);\n    walletView->updateEncryptionStatus();\n    return true;\n}\n\nbool WalletFrame::removeWallet(const QString &name)\n{\n    if (mapWalletViews.count(name) == 0)\n        return false;\n\n    WalletView *walletView = mapWalletViews.take(name);\n    walletStack->removeWidget(walletView);\n    return true;\n}\n\nvoid WalletFrame::removeAllWallets()\n{\n    QMap<QString, WalletView*>::const_iterator i;\n    for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i)\n        walletStack->removeWidget(i.value());\n    mapWalletViews.clear();\n}\n\nbool WalletFrame::handlePaymentRequest(const SendCoinsRecipient &recipient)\n{\n    WalletView *walletView = currentWalletView();\n    if (!walletView)\n        return false;\n\n    return walletView->handlePaymentRequest(recipient);\n}\n\nvoid WalletFrame::showOutOfSyncWarning(bool fShow)\n{\n    bOutOfSync = fShow;\n    QMap<QString, WalletView*>::const_iterator i;\n    for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i)\n        i.value()->showOutOfSyncWarning(fShow);\n}\n\nvoid WalletFrame::gotoOverviewPage()\n{\n    QMap<QString, WalletView*>::const_iterator i;\n    for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i)\n        i.value()->gotoOverviewPage();\n}\n\nvoid WalletFrame::gotoHistoryPage()\n{\n    QMap<QString, WalletView*>::const_iterator i;\n    for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i)\n        i.value()->gotoHistoryPage();\n}\n\nvoid WalletFrame::gotoReceiveCoinsPage()\n{\n    QMap<QString, WalletView*>::const_iterator i;\n    for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i)\n        i.value()->gotoReceiveCoinsPage();\n}\n\nvoid WalletFrame::gotoSendCoinsPage(QString addr)\n{\n    QMap<QString, WalletView*>::const_iterator i;\n    for (i = mapWalletViews.constBegin(); i != mapWalletViews.constEnd(); ++i)\n        i.value()->gotoSendCoinsPage(addr);\n}\n\nvoid WalletFrame::gotoSignMessageTab(QString addr)\n{\n    WalletView *walletView = currentWalletView();\n    if (walletView)\n        walletView->gotoSignMessageTab(addr);\n}\n\nvoid WalletFrame::gotoVerifyMessageTab(QString addr)\n{\n    WalletView *walletView = currentWalletView();\n    if (walletView)\n        walletView->gotoVerifyMessageTab(addr);\n}\n\nvoid WalletFrame::encryptWallet(bool status)\n{\n    WalletView *walletView = currentWalletView();\n    if (walletView)\n        walletView->encryptWallet(status);\n}\n\nvoid WalletFrame::backupWallet()\n{\n    WalletView *walletView = currentWalletView();\n    if (walletView)\n        walletView->backupWallet();\n}\n\nvoid WalletFrame::changePassphrase()\n{\n    WalletView *walletView = currentWalletView();\n    if (walletView)\n        walletView->changePassphrase();\n}\n\nvoid WalletFrame::unlockWallet()\n{\n    WalletView *walletView = currentWalletView();\n    if (walletView)\n        walletView->unlockWallet();\n}\n\nvoid WalletFrame::usedSendingAddresses()\n{\n    WalletView *walletView = currentWalletView();\n    if (walletView)\n        walletView->usedSendingAddresses();\n}\n\nvoid WalletFrame::usedReceivingAddresses()\n{\n    WalletView *walletView = currentWalletView();\n    if (walletView)\n        walletView->usedReceivingAddresses();\n}\n\nWalletView *WalletFrame::currentWalletView()\n{\n    return qobject_cast<WalletView*>(walletStack->currentWidget());\n}\n\nvoid WalletFrame::outOfSyncWarningClicked()\n{\n    Q_EMIT requestedSyncWarningInfo();\n}\n"
  },
  {
    "path": "src/qt/walletframe.h",
    "content": "// Copyright (c) 2011-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_WALLETFRAME_H\n#define BITCOIN_QT_WALLETFRAME_H\n\n#include <QFrame>\n#include <QMap>\n\nclass BitcoinGUI;\nclass ClientModel;\nclass PlatformStyle;\nclass SendCoinsRecipient;\nclass WalletModel;\nclass WalletView;\n\nQT_BEGIN_NAMESPACE\nclass QStackedWidget;\nQT_END_NAMESPACE\n\n/**\n * A container for embedding all wallet-related\n * controls into BitcoinGUI. The purpose of this class is to allow future\n * refinements of the wallet controls with minimal need for further\n * modifications to BitcoinGUI, thus greatly simplifying merges while\n * reducing the risk of breaking top-level stuff.\n */\nclass WalletFrame : public QFrame\n{\n    Q_OBJECT\n\npublic:\n    explicit WalletFrame(const PlatformStyle *platformStyle, BitcoinGUI *_gui = 0);\n    ~WalletFrame();\n\n    void setClientModel(ClientModel *clientModel);\n\n    bool addWallet(const QString& name, WalletModel *walletModel);\n    bool setCurrentWallet(const QString& name);\n    bool removeWallet(const QString &name);\n    void removeAllWallets();\n\n    bool handlePaymentRequest(const SendCoinsRecipient& recipient);\n\n    void showOutOfSyncWarning(bool fShow);\n\nQ_SIGNALS:\n    /** Notify that the user has requested more information about the out-of-sync warning */\n    void requestedSyncWarningInfo();\n\nprivate:\n    QStackedWidget *walletStack;\n    BitcoinGUI *gui;\n    ClientModel *clientModel;\n    QMap<QString, WalletView*> mapWalletViews;\n\n    bool bOutOfSync;\n\n    const PlatformStyle *platformStyle;\n\n    WalletView *currentWalletView();\n\npublic Q_SLOTS:\n    /** Switch to overview (home) page */\n    void gotoOverviewPage();\n    /** Switch to history (transactions) page */\n    void gotoHistoryPage();\n    /** Switch to receive coins page */\n    void gotoReceiveCoinsPage();\n    /** Switch to send coins page */\n    void gotoSendCoinsPage(QString addr = \"\");\n\n    /** Show Sign/Verify Message dialog and switch to sign message tab */\n    void gotoSignMessageTab(QString addr = \"\");\n    /** Show Sign/Verify Message dialog and switch to verify message tab */\n    void gotoVerifyMessageTab(QString addr = \"\");\n\n    /** Encrypt the wallet */\n    void encryptWallet(bool status);\n    /** Backup the wallet */\n    void backupWallet();\n    /** Change encrypted wallet passphrase */\n    void changePassphrase();\n    /** Ask for passphrase to unlock wallet temporarily */\n    void unlockWallet();\n\n    /** Show used sending addresses */\n    void usedSendingAddresses();\n    /** Show used receiving addresses */\n    void usedReceivingAddresses();\n    /** Pass on signal over requested out-of-sync-warning information */\n    void outOfSyncWarningClicked();\n};\n\n#endif // BITCOIN_QT_WALLETFRAME_H\n"
  },
  {
    "path": "src/qt/walletmodel.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/walletmodel.h>\n\n#include <qt/addresstablemodel.h>\n#include <consensus/validation.h>\n#include <qt/guiconstants.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n#include <qt/paymentserver.h>\n#include <qt/recentrequeststablemodel.h>\n#include <qt/sendcoinsdialog.h>\n#include <qt/transactiontablemodel.h>\n\n#include <base58.h>\n#include <chain.h>\n#include <keystore.h>\n#include <validation.h>\n#include <net.h> // for g_connman\n#include <policy/fees.h>\n#include <policy/rbf.h>\n#include <sync.h>\n#include <ui_interface.h>\n#include <util.h> // for GetBoolArg\n#include <wallet/coincontrol.h>\n#include <wallet/feebumper.h>\n#include <wallet/wallet.h>\n#include <wallet/walletdb.h> // for BackupWallet\n\n#include <stdint.h>\n\n#include <QDebug>\n#include <QMessageBox>\n#include <QSet>\n#include <QTimer>\n\n\nWalletModel::WalletModel(const PlatformStyle *platformStyle, CWallet *_wallet, OptionsModel *_optionsModel, QObject *parent) :\n    QObject(parent), wallet(_wallet), optionsModel(_optionsModel), addressTableModel(0),\n    transactionTableModel(0),\n    recentRequestsTableModel(0),\n    cachedBalance(0), cachedUnconfirmedBalance(0), cachedImmatureBalance(0),\n    cachedEncryptionStatus(Unencrypted),\n    cachedNumBlocks(0)\n{\n    fHaveWatchOnly = wallet->HaveWatchOnly();\n    fForceCheckBalanceChanged = false;\n\n    addressTableModel = new AddressTableModel(wallet, this);\n    transactionTableModel = new TransactionTableModel(platformStyle, wallet, this);\n    recentRequestsTableModel = new RecentRequestsTableModel(wallet, this);\n\n    // This timer will be fired repeatedly to update the balance\n    pollTimer = new QTimer(this);\n    connect(pollTimer, SIGNAL(timeout()), this, SLOT(pollBalanceChanged()));\n    pollTimer->start(MODEL_UPDATE_DELAY);\n\n    subscribeToCoreSignals();\n}\n\nWalletModel::~WalletModel()\n{\n    unsubscribeFromCoreSignals();\n}\n\nCAmount WalletModel::getBalance(const CCoinControl *coinControl) const\n{\n    if (coinControl)\n    {\n        return wallet->GetAvailableBalance(coinControl);\n    }\n\n    return wallet->GetBalance();\n}\n\nCAmount WalletModel::getUnconfirmedBalance() const\n{\n    return wallet->GetUnconfirmedBalance();\n}\n\nCAmount WalletModel::getImmatureBalance() const\n{\n    return wallet->GetImmatureBalance();\n}\n\nbool WalletModel::haveWatchOnly() const\n{\n    return fHaveWatchOnly;\n}\n\nCAmount WalletModel::getWatchBalance() const\n{\n    return wallet->GetWatchOnlyBalance();\n}\n\nCAmount WalletModel::getWatchUnconfirmedBalance() const\n{\n    return wallet->GetUnconfirmedWatchOnlyBalance();\n}\n\nCAmount WalletModel::getWatchImmatureBalance() const\n{\n    return wallet->GetImmatureWatchOnlyBalance();\n}\n\nvoid WalletModel::updateStatus()\n{\n    EncryptionStatus newEncryptionStatus = getEncryptionStatus();\n\n    if(cachedEncryptionStatus != newEncryptionStatus)\n        Q_EMIT encryptionStatusChanged(newEncryptionStatus);\n}\n\n// FIXME.SUGAR // SURE?\n// 120x faster than bitcoin\nvoid WalletModel::pollBalanceChanged()\n{\n    // Get required locks upfront. This avoids the GUI from getting stuck on\n    // periodical polls if the core is holding the locks for a longer time -\n    // for example, during a wallet rescan.\n    TRY_LOCK(cs_main, lockMain);\n    if(!lockMain)\n        return;\n    TRY_LOCK(wallet->cs_wallet, lockWallet);\n    if(!lockWallet)\n        return;\n\n    if(fForceCheckBalanceChanged || chainActive.Height() != cachedNumBlocks)\n    {\n        fForceCheckBalanceChanged = false;\n\n        // BEGIN - DEBUG for checking height?\n        /*\n        LogPrint(BCLog::QT, \"GUI:   %d = height \\n\", chainActive.Height());\n        LogPrint(BCLog::QT, \"GUI:   %d = cached \\n\", cachedNumBlocks);\n        LogPrint(BCLog::QT, \"GUI: height - cached = %d \\n\", (int)(chainActive.Height() - cachedNumBlocks));\n        */\n        // END - DEBUG for checking height?\n\n        // FIXME.SUGAR // SURE?\n        // update every blocks >> 12 blocks // 5*12 = 60s\n        if(chainActive.Height() - cachedNumBlocks >= 12)\n        {\n            // BEGIN - DEBUG for checking polled?\n            /*\n            LogPrint(BCLog::QT, \"GUI: \\033[0;31m  pollBalanceChanged:  \\033[0m \\n\"); // red\n            LogPrint(BCLog::QT, \"GUI: height - cached = %d \\n\", (int)(chainActive.Height() - cachedNumBlocks));\n            */\n            // END - DEBUG for checking polled?\n\n            // Balance and number of transactions might have changed\n            cachedNumBlocks = chainActive.Height();\n\n            checkBalanceChanged();\n            if(transactionTableModel)\n                transactionTableModel->updateConfirmations();\n        }\n    }\n}\n\nvoid WalletModel::checkBalanceChanged()\n{\n    CAmount newBalance = getBalance();\n    CAmount newUnconfirmedBalance = getUnconfirmedBalance();\n    CAmount newImmatureBalance = getImmatureBalance();\n    CAmount newWatchOnlyBalance = 0;\n    CAmount newWatchUnconfBalance = 0;\n    CAmount newWatchImmatureBalance = 0;\n    if (haveWatchOnly())\n    {\n        newWatchOnlyBalance = getWatchBalance();\n        newWatchUnconfBalance = getWatchUnconfirmedBalance();\n        newWatchImmatureBalance = getWatchImmatureBalance();\n    }\n\n    if(cachedBalance != newBalance || cachedUnconfirmedBalance != newUnconfirmedBalance || cachedImmatureBalance != newImmatureBalance ||\n        cachedWatchOnlyBalance != newWatchOnlyBalance || cachedWatchUnconfBalance != newWatchUnconfBalance || cachedWatchImmatureBalance != newWatchImmatureBalance)\n    {\n        cachedBalance = newBalance;\n        cachedUnconfirmedBalance = newUnconfirmedBalance;\n        cachedImmatureBalance = newImmatureBalance;\n        cachedWatchOnlyBalance = newWatchOnlyBalance;\n        cachedWatchUnconfBalance = newWatchUnconfBalance;\n        cachedWatchImmatureBalance = newWatchImmatureBalance;\n        Q_EMIT balanceChanged(newBalance, newUnconfirmedBalance, newImmatureBalance,\n                            newWatchOnlyBalance, newWatchUnconfBalance, newWatchImmatureBalance);\n    }\n}\n\nvoid WalletModel::updateTransaction()\n{\n    // Balance and number of transactions might have changed\n    fForceCheckBalanceChanged = true;\n}\n\nvoid WalletModel::updateAddressBook(const QString &address, const QString &label,\n        bool isMine, const QString &purpose, int status)\n{\n    if(addressTableModel)\n        addressTableModel->updateEntry(address, label, isMine, purpose, status);\n}\n\nvoid WalletModel::updateWatchOnlyFlag(bool fHaveWatchonly)\n{\n    fHaveWatchOnly = fHaveWatchonly;\n    Q_EMIT notifyWatchonlyChanged(fHaveWatchonly);\n}\n\nbool WalletModel::validateAddress(const QString &address)\n{\n    return IsValidDestinationString(address.toStdString());\n}\n\nWalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransaction &transaction, const CCoinControl& coinControl)\n{\n    CAmount total = 0;\n    bool fSubtractFeeFromAmount = false;\n    QList<SendCoinsRecipient> recipients = transaction.getRecipients();\n    std::vector<CRecipient> vecSend;\n\n    if(recipients.empty())\n    {\n        return OK;\n    }\n\n    QSet<QString> setAddress; // Used to detect duplicates\n    int nAddresses = 0;\n\n    // Pre-check input data for validity\n    for (const SendCoinsRecipient &rcp : recipients)\n    {\n        if (rcp.fSubtractFeeFromAmount)\n            fSubtractFeeFromAmount = true;\n\n        if (rcp.paymentRequest.IsInitialized())\n        {   // PaymentRequest...\n            CAmount subtotal = 0;\n            const payments::PaymentDetails& details = rcp.paymentRequest.getDetails();\n            for (int i = 0; i < details.outputs_size(); i++)\n            {\n                const payments::Output& out = details.outputs(i);\n                if (out.amount() <= 0) continue;\n                subtotal += out.amount();\n                const unsigned char* scriptStr = (const unsigned char*)out.script().data();\n                CScript scriptPubKey(scriptStr, scriptStr+out.script().size());\n                CAmount nAmount = out.amount();\n                CRecipient recipient = {scriptPubKey, nAmount, rcp.fSubtractFeeFromAmount};\n                vecSend.push_back(recipient);\n            }\n            if (subtotal <= 0)\n            {\n                return InvalidAmount;\n            }\n            total += subtotal;\n        }\n        else\n        {   // User-entered bitcoin address / amount:\n            if(!validateAddress(rcp.address))\n            {\n                return InvalidAddress;\n            }\n            if(rcp.amount <= 0)\n            {\n                return InvalidAmount;\n            }\n            setAddress.insert(rcp.address);\n            ++nAddresses;\n\n            CScript scriptPubKey = GetScriptForDestination(DecodeDestination(rcp.address.toStdString()));\n            CRecipient recipient = {scriptPubKey, rcp.amount, rcp.fSubtractFeeFromAmount};\n            vecSend.push_back(recipient);\n\n            total += rcp.amount;\n        }\n    }\n    if(setAddress.size() != nAddresses)\n    {\n        return DuplicateAddress;\n    }\n\n    CAmount nBalance = getBalance(&coinControl);\n\n    if(total > nBalance)\n    {\n        return AmountExceedsBalance;\n    }\n\n    {\n        LOCK2(cs_main, wallet->cs_wallet);\n\n        transaction.newPossibleKeyChange(wallet);\n\n        CAmount nFeeRequired = 0;\n        int nChangePosRet = -1;\n        std::string strFailReason;\n\n        CWalletTx *newTx = transaction.getTransaction();\n        CReserveKey *keyChange = transaction.getPossibleKeyChange();\n        bool fCreated = wallet->CreateTransaction(vecSend, *newTx, *keyChange, nFeeRequired, nChangePosRet, strFailReason, coinControl);\n        transaction.setTransactionFee(nFeeRequired);\n        if (fSubtractFeeFromAmount && fCreated)\n            transaction.reassignAmounts(nChangePosRet);\n\n        if(!fCreated)\n        {\n            if(!fSubtractFeeFromAmount && (total + nFeeRequired) > nBalance)\n            {\n                return SendCoinsReturn(AmountWithFeeExceedsBalance);\n            }\n            Q_EMIT message(tr(\"Send Coins\"), QString::fromStdString(strFailReason),\n                         CClientUIInterface::MSG_ERROR);\n            return TransactionCreationFailed;\n        }\n\n        // reject absurdly high fee. (This can never happen because the\n        // wallet caps the fee at maxTxFee. This merely serves as a\n        // belt-and-suspenders check)\n        if (nFeeRequired > maxTxFee)\n            return AbsurdFee;\n    }\n\n    return SendCoinsReturn(OK);\n}\n\nWalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction &transaction)\n{\n    QByteArray transaction_array; /* store serialized transaction */\n\n    {\n        LOCK2(cs_main, wallet->cs_wallet);\n        CWalletTx *newTx = transaction.getTransaction();\n\n        for (const SendCoinsRecipient &rcp : transaction.getRecipients())\n        {\n            if (rcp.paymentRequest.IsInitialized())\n            {\n                // Make sure any payment requests involved are still valid.\n                if (PaymentServer::verifyExpired(rcp.paymentRequest.getDetails())) {\n                    return PaymentRequestExpired;\n                }\n\n                // Store PaymentRequests in wtx.vOrderForm in wallet.\n                std::string key(\"PaymentRequest\");\n                std::string value;\n                rcp.paymentRequest.SerializeToString(&value);\n                newTx->vOrderForm.push_back(make_pair(key, value));\n            }\n            else if (!rcp.message.isEmpty()) // Message from normal bitcoin:URI (bitcoin:123...?message=example)\n                newTx->vOrderForm.push_back(make_pair(\"Message\", rcp.message.toStdString()));\n        }\n\n        CReserveKey *keyChange = transaction.getPossibleKeyChange();\n        CValidationState state;\n        if(!wallet->CommitTransaction(*newTx, *keyChange, g_connman.get(), state))\n            return SendCoinsReturn(TransactionCommitFailed, QString::fromStdString(state.GetRejectReason()));\n\n        CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);\n        ssTx << *newTx->tx;\n        transaction_array.append(&(ssTx[0]), ssTx.size());\n    }\n\n    // Add addresses / update labels that we've sent to the address book,\n    // and emit coinsSent signal for each recipient\n    for (const SendCoinsRecipient &rcp : transaction.getRecipients())\n    {\n        // Don't touch the address book when we have a payment request\n        if (!rcp.paymentRequest.IsInitialized())\n        {\n            std::string strAddress = rcp.address.toStdString();\n            CTxDestination dest = DecodeDestination(strAddress);\n            std::string strLabel = rcp.label.toStdString();\n            {\n                LOCK(wallet->cs_wallet);\n\n                std::map<CTxDestination, CAddressBookData>::iterator mi = wallet->mapAddressBook.find(dest);\n\n                // Check if we have a new address or an updated label\n                if (mi == wallet->mapAddressBook.end())\n                {\n                    wallet->SetAddressBook(dest, strLabel, \"send\");\n                }\n                else if (mi->second.name != strLabel)\n                {\n                    wallet->SetAddressBook(dest, strLabel, \"\"); // \"\" means don't change purpose\n                }\n            }\n        }\n        Q_EMIT coinsSent(wallet, rcp, transaction_array);\n    }\n    checkBalanceChanged(); // update balance immediately, otherwise there could be a short noticeable delay until pollBalanceChanged hits\n\n    return SendCoinsReturn(OK);\n}\n\nOptionsModel *WalletModel::getOptionsModel()\n{\n    return optionsModel;\n}\n\nAddressTableModel *WalletModel::getAddressTableModel()\n{\n    return addressTableModel;\n}\n\nTransactionTableModel *WalletModel::getTransactionTableModel()\n{\n    return transactionTableModel;\n}\n\nRecentRequestsTableModel *WalletModel::getRecentRequestsTableModel()\n{\n    return recentRequestsTableModel;\n}\n\nWalletModel::EncryptionStatus WalletModel::getEncryptionStatus() const\n{\n    if(!wallet->IsCrypted())\n    {\n        return Unencrypted;\n    }\n    else if(wallet->IsLocked())\n    {\n        return Locked;\n    }\n    else\n    {\n        return Unlocked;\n    }\n}\n\nbool WalletModel::setWalletEncrypted(bool encrypted, const SecureString &passphrase)\n{\n    if(encrypted)\n    {\n        // Encrypt\n        return wallet->EncryptWallet(passphrase);\n    }\n    else\n    {\n        // Decrypt -- TODO; not supported yet\n        return false;\n    }\n}\n\nbool WalletModel::setWalletLocked(bool locked, const SecureString &passPhrase)\n{\n    if(locked)\n    {\n        // Lock\n        return wallet->Lock();\n    }\n    else\n    {\n        // Unlock\n        return wallet->Unlock(passPhrase);\n    }\n}\n\nbool WalletModel::changePassphrase(const SecureString &oldPass, const SecureString &newPass)\n{\n    bool retval;\n    {\n        LOCK(wallet->cs_wallet);\n        wallet->Lock(); // Make sure wallet is locked before attempting pass change\n        retval = wallet->ChangeWalletPassphrase(oldPass, newPass);\n    }\n    return retval;\n}\n\nbool WalletModel::backupWallet(const QString &filename)\n{\n    return wallet->BackupWallet(filename.toLocal8Bit().data());\n}\n\n// Handlers for core signals\nstatic void NotifyKeyStoreStatusChanged(WalletModel *walletmodel, CCryptoKeyStore *wallet)\n{\n    qDebug() << \"NotifyKeyStoreStatusChanged\";\n    QMetaObject::invokeMethod(walletmodel, \"updateStatus\", Qt::QueuedConnection);\n}\n\nstatic void NotifyAddressBookChanged(WalletModel *walletmodel, CWallet *wallet,\n        const CTxDestination &address, const std::string &label, bool isMine,\n        const std::string &purpose, ChangeType status)\n{\n    QString strAddress = QString::fromStdString(EncodeDestination(address));\n    QString strLabel = QString::fromStdString(label);\n    QString strPurpose = QString::fromStdString(purpose);\n\n    qDebug() << \"NotifyAddressBookChanged: \" + strAddress + \" \" + strLabel + \" isMine=\" + QString::number(isMine) + \" purpose=\" + strPurpose + \" status=\" + QString::number(status);\n    QMetaObject::invokeMethod(walletmodel, \"updateAddressBook\", Qt::QueuedConnection,\n                              Q_ARG(QString, strAddress),\n                              Q_ARG(QString, strLabel),\n                              Q_ARG(bool, isMine),\n                              Q_ARG(QString, strPurpose),\n                              Q_ARG(int, status));\n}\n\nstatic void NotifyTransactionChanged(WalletModel *walletmodel, CWallet *wallet, const uint256 &hash, ChangeType status)\n{\n    Q_UNUSED(wallet);\n    Q_UNUSED(hash);\n    Q_UNUSED(status);\n    QMetaObject::invokeMethod(walletmodel, \"updateTransaction\", Qt::QueuedConnection);\n}\n\nstatic void ShowProgress(WalletModel *walletmodel, const std::string &title, int nProgress)\n{\n    // emits signal \"showProgress\"\n    QMetaObject::invokeMethod(walletmodel, \"showProgress\", Qt::QueuedConnection,\n                              Q_ARG(QString, QString::fromStdString(title)),\n                              Q_ARG(int, nProgress));\n}\n\nstatic void NotifyWatchonlyChanged(WalletModel *walletmodel, bool fHaveWatchonly)\n{\n    QMetaObject::invokeMethod(walletmodel, \"updateWatchOnlyFlag\", Qt::QueuedConnection,\n                              Q_ARG(bool, fHaveWatchonly));\n}\n\nvoid WalletModel::subscribeToCoreSignals()\n{\n    // Connect signals to wallet\n    wallet->NotifyStatusChanged.connect(boost::bind(&NotifyKeyStoreStatusChanged, this, _1));\n    wallet->NotifyAddressBookChanged.connect(boost::bind(NotifyAddressBookChanged, this, _1, _2, _3, _4, _5, _6));\n    wallet->NotifyTransactionChanged.connect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3));\n    wallet->ShowProgress.connect(boost::bind(ShowProgress, this, _1, _2));\n    wallet->NotifyWatchonlyChanged.connect(boost::bind(NotifyWatchonlyChanged, this, _1));\n}\n\nvoid WalletModel::unsubscribeFromCoreSignals()\n{\n    // Disconnect signals from wallet\n    wallet->NotifyStatusChanged.disconnect(boost::bind(&NotifyKeyStoreStatusChanged, this, _1));\n    wallet->NotifyAddressBookChanged.disconnect(boost::bind(NotifyAddressBookChanged, this, _1, _2, _3, _4, _5, _6));\n    wallet->NotifyTransactionChanged.disconnect(boost::bind(NotifyTransactionChanged, this, _1, _2, _3));\n    wallet->ShowProgress.disconnect(boost::bind(ShowProgress, this, _1, _2));\n    wallet->NotifyWatchonlyChanged.disconnect(boost::bind(NotifyWatchonlyChanged, this, _1));\n}\n\n// WalletModel::UnlockContext implementation\nWalletModel::UnlockContext WalletModel::requestUnlock()\n{\n    bool was_locked = getEncryptionStatus() == Locked;\n    if(was_locked)\n    {\n        // Request UI to unlock wallet\n        Q_EMIT requireUnlock();\n    }\n    // If wallet is still locked, unlock was failed or cancelled, mark context as invalid\n    bool valid = getEncryptionStatus() != Locked;\n\n    return UnlockContext(this, valid, was_locked);\n}\n\nWalletModel::UnlockContext::UnlockContext(WalletModel *_wallet, bool _valid, bool _relock):\n        wallet(_wallet),\n        valid(_valid),\n        relock(_relock)\n{\n}\n\nWalletModel::UnlockContext::~UnlockContext()\n{\n    if(valid && relock)\n    {\n        wallet->setWalletLocked(true);\n    }\n}\n\nvoid WalletModel::UnlockContext::CopyFrom(const UnlockContext& rhs)\n{\n    // Transfer context; old object no longer relocks wallet\n    *this = rhs;\n    rhs.relock = false;\n}\n\nbool WalletModel::getPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const\n{\n    return wallet->GetPubKey(address, vchPubKeyOut);\n}\n\nbool WalletModel::IsSpendable(const CTxDestination& dest) const\n{\n    return IsMine(*wallet, dest) & ISMINE_SPENDABLE;\n}\n\nbool WalletModel::getPrivKey(const CKeyID &address, CKey& vchPrivKeyOut) const\n{\n    return wallet->GetKey(address, vchPrivKeyOut);\n}\n\n// returns a list of COutputs from COutPoints\nvoid WalletModel::getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs)\n{\n    LOCK2(cs_main, wallet->cs_wallet);\n    for (const COutPoint& outpoint : vOutpoints)\n    {\n        auto it = wallet->mapWallet.find(outpoint.hash);\n        if (it == wallet->mapWallet.end()) continue;\n        int nDepth = it->second.GetDepthInMainChain();\n        if (nDepth < 0) continue;\n        COutput out(&it->second, outpoint.n, nDepth, true /* spendable */, true /* solvable */, true /* safe */);\n        vOutputs.push_back(out);\n    }\n}\n\nbool WalletModel::isSpent(const COutPoint& outpoint) const\n{\n    LOCK2(cs_main, wallet->cs_wallet);\n    return wallet->IsSpent(outpoint.hash, outpoint.n);\n}\n\n// AvailableCoins + LockedCoins grouped by wallet address (put change in one group with wallet address)\nvoid WalletModel::listCoins(std::map<QString, std::vector<COutput> >& mapCoins) const\n{\n    for (auto& group : wallet->ListCoins()) {\n        auto& resultGroup = mapCoins[QString::fromStdString(EncodeDestination(group.first))];\n        for (auto& coin : group.second) {\n            resultGroup.emplace_back(std::move(coin));\n        }\n    }\n}\n\nbool WalletModel::isLockedCoin(uint256 hash, unsigned int n) const\n{\n    LOCK2(cs_main, wallet->cs_wallet);\n    return wallet->IsLockedCoin(hash, n);\n}\n\nvoid WalletModel::lockCoin(COutPoint& output)\n{\n    LOCK2(cs_main, wallet->cs_wallet);\n    wallet->LockCoin(output);\n}\n\nvoid WalletModel::unlockCoin(COutPoint& output)\n{\n    LOCK2(cs_main, wallet->cs_wallet);\n    wallet->UnlockCoin(output);\n}\n\nvoid WalletModel::listLockedCoins(std::vector<COutPoint>& vOutpts)\n{\n    LOCK2(cs_main, wallet->cs_wallet);\n    wallet->ListLockedCoins(vOutpts);\n}\n\nvoid WalletModel::loadReceiveRequests(std::vector<std::string>& vReceiveRequests)\n{\n    vReceiveRequests = wallet->GetDestValues(\"rr\"); // receive request\n}\n\nbool WalletModel::saveReceiveRequest(const std::string &sAddress, const int64_t nId, const std::string &sRequest)\n{\n    CTxDestination dest = DecodeDestination(sAddress);\n\n    std::stringstream ss;\n    ss << nId;\n    std::string key = \"rr\" + ss.str(); // \"rr\" prefix = \"receive request\" in destdata\n\n    LOCK(wallet->cs_wallet);\n    if (sRequest.empty())\n        return wallet->EraseDestData(dest, key);\n    else\n        return wallet->AddDestData(dest, key, sRequest);\n}\n\nbool WalletModel::transactionCanBeAbandoned(uint256 hash) const\n{\n    return wallet->TransactionCanBeAbandoned(hash);\n}\n\nbool WalletModel::abandonTransaction(uint256 hash) const\n{\n    LOCK2(cs_main, wallet->cs_wallet);\n    return wallet->AbandonTransaction(hash);\n}\n\nbool WalletModel::transactionCanBeBumped(uint256 hash) const\n{\n    return feebumper::TransactionCanBeBumped(wallet, hash);\n}\n\nbool WalletModel::bumpFee(uint256 hash)\n{\n    CCoinControl coin_control;\n    coin_control.signalRbf = true;\n    std::vector<std::string> errors;\n    CAmount old_fee;\n    CAmount new_fee;\n    CMutableTransaction mtx;\n    if (feebumper::CreateTransaction(wallet, hash, coin_control, 0 /* totalFee */, errors, old_fee, new_fee, mtx) != feebumper::Result::OK) {\n        QMessageBox::critical(0, tr(\"Fee bump error\"), tr(\"Increasing transaction fee failed\") + \"<br />(\" +\n            (errors.size() ? QString::fromStdString(errors[0]) : \"\") +\")\");\n         return false;\n    }\n\n    // allow a user based fee verification\n    QString questionString = tr(\"Do you want to increase the fee?\");\n    questionString.append(\"<br />\");\n    questionString.append(\"<table style=\\\"text-align: left;\\\">\");\n    questionString.append(\"<tr><td>\");\n    questionString.append(tr(\"Current fee:\"));\n    questionString.append(\"</td><td>\");\n    questionString.append(BitcoinUnits::formatHtmlWithUnit(getOptionsModel()->getDisplayUnit(), old_fee));\n    questionString.append(\"</td></tr><tr><td>\");\n    questionString.append(tr(\"Increase:\"));\n    questionString.append(\"</td><td>\");\n    questionString.append(BitcoinUnits::formatHtmlWithUnit(getOptionsModel()->getDisplayUnit(), new_fee - old_fee));\n    questionString.append(\"</td></tr><tr><td>\");\n    questionString.append(tr(\"New fee:\"));\n    questionString.append(\"</td><td>\");\n    questionString.append(BitcoinUnits::formatHtmlWithUnit(getOptionsModel()->getDisplayUnit(), new_fee));\n    questionString.append(\"</td></tr></table>\");\n    SendConfirmationDialog confirmationDialog(tr(\"Confirm fee bump\"), questionString);\n    confirmationDialog.exec();\n    QMessageBox::StandardButton retval = (QMessageBox::StandardButton)confirmationDialog.result();\n\n    // cancel sign&broadcast if users doesn't want to bump the fee\n    if (retval != QMessageBox::Yes) {\n        return false;\n    }\n\n    WalletModel::UnlockContext ctx(requestUnlock());\n    if(!ctx.isValid())\n    {\n        return false;\n    }\n\n    // sign bumped transaction\n    if (!feebumper::SignTransaction(wallet, mtx)) {\n        QMessageBox::critical(0, tr(\"Fee bump error\"), tr(\"Can't sign transaction.\"));\n        return false;\n    }\n    // commit the bumped transaction\n    uint256 txid;\n    if (feebumper::CommitTransaction(wallet, hash, std::move(mtx), errors, txid) != feebumper::Result::OK) {\n        QMessageBox::critical(0, tr(\"Fee bump error\"), tr(\"Could not commit transaction\") + \"<br />(\" +\n            QString::fromStdString(errors[0])+\")\");\n         return false;\n    }\n    return true;\n}\n\nbool WalletModel::isWalletEnabled()\n{\n   return !gArgs.GetBoolArg(\"-disablewallet\", DEFAULT_DISABLE_WALLET);\n}\n\nbool WalletModel::hdEnabled() const\n{\n    return wallet->IsHDEnabled();\n}\n\nOutputType WalletModel::getDefaultAddressType() const\n{\n    return g_address_type;\n}\n\nint WalletModel::getDefaultConfirmTarget() const\n{\n    return nTxConfirmTarget;\n}\n"
  },
  {
    "path": "src/qt/walletmodel.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_WALLETMODEL_H\n#define BITCOIN_QT_WALLETMODEL_H\n\n#include <qt/paymentrequestplus.h>\n#include <qt/walletmodeltransaction.h>\n\n#include <support/allocators/secure.h>\n\n#include <map>\n#include <vector>\n\n#include <QObject>\n\nenum OutputType : int;\n\nclass AddressTableModel;\nclass OptionsModel;\nclass PlatformStyle;\nclass RecentRequestsTableModel;\nclass TransactionTableModel;\nclass WalletModelTransaction;\n\nclass CCoinControl;\nclass CKeyID;\nclass COutPoint;\nclass COutput;\nclass CPubKey;\nclass CWallet;\nclass uint256;\n\nQT_BEGIN_NAMESPACE\nclass QTimer;\nQT_END_NAMESPACE\n\nclass SendCoinsRecipient\n{\npublic:\n    explicit SendCoinsRecipient() : amount(0), fSubtractFeeFromAmount(false), nVersion(SendCoinsRecipient::CURRENT_VERSION) { }\n    explicit SendCoinsRecipient(const QString &addr, const QString &_label, const CAmount& _amount, const QString &_message):\n        address(addr), label(_label), amount(_amount), message(_message), fSubtractFeeFromAmount(false), nVersion(SendCoinsRecipient::CURRENT_VERSION) {}\n\n    // If from an unauthenticated payment request, this is used for storing\n    // the addresses, e.g. address-A<br />address-B<br />address-C.\n    // Info: As we don't need to process addresses in here when using\n    // payment requests, we can abuse it for displaying an address list.\n    // Todo: This is a hack, should be replaced with a cleaner solution!\n    QString address;\n    QString label;\n    CAmount amount;\n    // If from a payment request, this is used for storing the memo\n    QString message;\n\n    // If from a payment request, paymentRequest.IsInitialized() will be true\n    PaymentRequestPlus paymentRequest;\n    // Empty if no authentication or invalid signature/cert/etc.\n    QString authenticatedMerchant;\n\n    bool fSubtractFeeFromAmount; // memory only\n\n    static const int CURRENT_VERSION = 1;\n    int nVersion;\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        std::string sAddress = address.toStdString();\n        std::string sLabel = label.toStdString();\n        std::string sMessage = message.toStdString();\n        std::string sPaymentRequest;\n        if (!ser_action.ForRead() && paymentRequest.IsInitialized())\n            paymentRequest.SerializeToString(&sPaymentRequest);\n        std::string sAuthenticatedMerchant = authenticatedMerchant.toStdString();\n\n        READWRITE(this->nVersion);\n        READWRITE(sAddress);\n        READWRITE(sLabel);\n        READWRITE(amount);\n        READWRITE(sMessage);\n        READWRITE(sPaymentRequest);\n        READWRITE(sAuthenticatedMerchant);\n\n        if (ser_action.ForRead())\n        {\n            address = QString::fromStdString(sAddress);\n            label = QString::fromStdString(sLabel);\n            message = QString::fromStdString(sMessage);\n            if (!sPaymentRequest.empty())\n                paymentRequest.parse(QByteArray::fromRawData(sPaymentRequest.data(), sPaymentRequest.size()));\n            authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant);\n        }\n    }\n};\n\n/** Interface to Bitcoin wallet from Qt view code. */\nclass WalletModel : public QObject\n{\n    Q_OBJECT\n\npublic:\n    explicit WalletModel(const PlatformStyle *platformStyle, CWallet *wallet, OptionsModel *optionsModel, QObject *parent = 0);\n    ~WalletModel();\n\n    enum StatusCode // Returned by sendCoins\n    {\n        OK,\n        InvalidAmount,\n        InvalidAddress,\n        AmountExceedsBalance,\n        AmountWithFeeExceedsBalance,\n        DuplicateAddress,\n        TransactionCreationFailed, // Error returned when wallet is still locked\n        TransactionCommitFailed,\n        AbsurdFee,\n        PaymentRequestExpired\n    };\n\n    enum EncryptionStatus\n    {\n        Unencrypted,  // !wallet->IsCrypted()\n        Locked,       // wallet->IsCrypted() && wallet->IsLocked()\n        Unlocked      // wallet->IsCrypted() && !wallet->IsLocked()\n    };\n\n    OptionsModel *getOptionsModel();\n    AddressTableModel *getAddressTableModel();\n    TransactionTableModel *getTransactionTableModel();\n    RecentRequestsTableModel *getRecentRequestsTableModel();\n\n    CAmount getBalance(const CCoinControl *coinControl = nullptr) const;\n    CAmount getUnconfirmedBalance() const;\n    CAmount getImmatureBalance() const;\n    bool haveWatchOnly() const;\n    CAmount getWatchBalance() const;\n    CAmount getWatchUnconfirmedBalance() const;\n    CAmount getWatchImmatureBalance() const;\n    EncryptionStatus getEncryptionStatus() const;\n\n    // Check address for validity\n    bool validateAddress(const QString &address);\n\n    // Return status record for SendCoins, contains error id + information\n    struct SendCoinsReturn\n    {\n        SendCoinsReturn(StatusCode _status = OK, QString _reasonCommitFailed = \"\")\n            : status(_status),\n              reasonCommitFailed(_reasonCommitFailed)\n        {\n        }\n        StatusCode status;\n        QString reasonCommitFailed;\n    };\n\n    // prepare transaction for getting txfee before sending coins\n    SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl& coinControl);\n\n    // Send coins to a list of recipients\n    SendCoinsReturn sendCoins(WalletModelTransaction &transaction);\n\n    // Wallet encryption\n    bool setWalletEncrypted(bool encrypted, const SecureString &passphrase);\n    // Passphrase only needed when unlocking\n    bool setWalletLocked(bool locked, const SecureString &passPhrase=SecureString());\n    bool changePassphrase(const SecureString &oldPass, const SecureString &newPass);\n    // Wallet backup\n    bool backupWallet(const QString &filename);\n\n    // RAI object for unlocking wallet, returned by requestUnlock()\n    class UnlockContext\n    {\n    public:\n        UnlockContext(WalletModel *wallet, bool valid, bool relock);\n        ~UnlockContext();\n\n        bool isValid() const { return valid; }\n\n        // Copy operator and constructor transfer the context\n        UnlockContext(const UnlockContext& obj) { CopyFrom(obj); }\n        UnlockContext& operator=(const UnlockContext& rhs) { CopyFrom(rhs); return *this; }\n    private:\n        WalletModel *wallet;\n        bool valid;\n        mutable bool relock; // mutable, as it can be set to false by copying\n\n        void CopyFrom(const UnlockContext& rhs);\n    };\n\n    UnlockContext requestUnlock();\n\n    bool getPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const;\n    bool IsSpendable(const CTxDestination& dest) const;\n    bool getPrivKey(const CKeyID &address, CKey& vchPrivKeyOut) const;\n    void getOutputs(const std::vector<COutPoint>& vOutpoints, std::vector<COutput>& vOutputs);\n    bool isSpent(const COutPoint& outpoint) const;\n    void listCoins(std::map<QString, std::vector<COutput> >& mapCoins) const;\n\n    bool isLockedCoin(uint256 hash, unsigned int n) const;\n    void lockCoin(COutPoint& output);\n    void unlockCoin(COutPoint& output);\n    void listLockedCoins(std::vector<COutPoint>& vOutpts);\n\n    void loadReceiveRequests(std::vector<std::string>& vReceiveRequests);\n    bool saveReceiveRequest(const std::string &sAddress, const int64_t nId, const std::string &sRequest);\n\n    bool transactionCanBeAbandoned(uint256 hash) const;\n    bool abandonTransaction(uint256 hash) const;\n\n    bool transactionCanBeBumped(uint256 hash) const;\n    bool bumpFee(uint256 hash);\n\n    static bool isWalletEnabled();\n\n    bool hdEnabled() const;\n\n    OutputType getDefaultAddressType() const;\n\n    int getDefaultConfirmTarget() const;\n\nprivate:\n    CWallet *wallet;\n    bool fHaveWatchOnly;\n    bool fForceCheckBalanceChanged;\n\n    // Wallet has an options model for wallet-specific options\n    // (transaction fee, for example)\n    OptionsModel *optionsModel;\n\n    AddressTableModel *addressTableModel;\n    TransactionTableModel *transactionTableModel;\n    RecentRequestsTableModel *recentRequestsTableModel;\n\n    // Cache some values to be able to detect changes\n    CAmount cachedBalance;\n    CAmount cachedUnconfirmedBalance;\n    CAmount cachedImmatureBalance;\n    CAmount cachedWatchOnlyBalance;\n    CAmount cachedWatchUnconfBalance;\n    CAmount cachedWatchImmatureBalance;\n    EncryptionStatus cachedEncryptionStatus;\n    int cachedNumBlocks;\n\n    QTimer *pollTimer;\n\n    void subscribeToCoreSignals();\n    void unsubscribeFromCoreSignals();\n    void checkBalanceChanged();\n\nQ_SIGNALS:\n    // Signal that balance in wallet changed\n    void balanceChanged(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,\n                        const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);\n\n    // Encryption status of wallet changed\n    void encryptionStatusChanged(int status);\n\n    // Signal emitted when wallet needs to be unlocked\n    // It is valid behaviour for listeners to keep the wallet locked after this signal;\n    // this means that the unlocking failed or was cancelled.\n    void requireUnlock();\n\n    // Fired when a message should be reported to the user\n    void message(const QString &title, const QString &message, unsigned int style);\n\n    // Coins sent: from wallet, to recipient, in (serialized) transaction:\n    void coinsSent(CWallet* wallet, SendCoinsRecipient recipient, QByteArray transaction);\n\n    // Show progress dialog e.g. for rescan\n    void showProgress(const QString &title, int nProgress);\n\n    // Watch-only address added\n    void notifyWatchonlyChanged(bool fHaveWatchonly);\n\npublic Q_SLOTS:\n    /* Wallet status might have changed */\n    void updateStatus();\n    /* New transaction, or transaction changed status */\n    void updateTransaction();\n    /* New, updated or removed address book entry */\n    void updateAddressBook(const QString &address, const QString &label, bool isMine, const QString &purpose, int status);\n    /* Watch-only added */\n    void updateWatchOnlyFlag(bool fHaveWatchonly);\n    /* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */\n    void pollBalanceChanged();\n};\n\n#endif // BITCOIN_QT_WALLETMODEL_H\n"
  },
  {
    "path": "src/qt/walletmodeltransaction.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/walletmodeltransaction.h>\n\n#include <policy/policy.h>\n#include <wallet/wallet.h>\n\nWalletModelTransaction::WalletModelTransaction(const QList<SendCoinsRecipient> &_recipients) :\n    recipients(_recipients),\n    walletTransaction(0),\n    fee(0)\n{\n    walletTransaction = new CWalletTx();\n}\n\nWalletModelTransaction::~WalletModelTransaction()\n{\n    delete walletTransaction;\n}\n\nQList<SendCoinsRecipient> WalletModelTransaction::getRecipients() const\n{\n    return recipients;\n}\n\nCWalletTx *WalletModelTransaction::getTransaction() const\n{\n    return walletTransaction;\n}\n\nunsigned int WalletModelTransaction::getTransactionSize()\n{\n    return (!walletTransaction ? 0 : ::GetVirtualTransactionSize(*walletTransaction->tx));\n}\n\nCAmount WalletModelTransaction::getTransactionFee() const\n{\n    return fee;\n}\n\nvoid WalletModelTransaction::setTransactionFee(const CAmount& newFee)\n{\n    fee = newFee;\n}\n\nvoid WalletModelTransaction::reassignAmounts(int nChangePosRet)\n{\n    int i = 0;\n    for (QList<SendCoinsRecipient>::iterator it = recipients.begin(); it != recipients.end(); ++it)\n    {\n        SendCoinsRecipient& rcp = (*it);\n\n        if (rcp.paymentRequest.IsInitialized())\n        {\n            CAmount subtotal = 0;\n            const payments::PaymentDetails& details = rcp.paymentRequest.getDetails();\n            for (int j = 0; j < details.outputs_size(); j++)\n            {\n                const payments::Output& out = details.outputs(j);\n                if (out.amount() <= 0) continue;\n                if (i == nChangePosRet)\n                    i++;\n                subtotal += walletTransaction->tx->vout[i].nValue;\n                i++;\n            }\n            rcp.amount = subtotal;\n        }\n        else // normal recipient (no payment request)\n        {\n            if (i == nChangePosRet)\n                i++;\n            rcp.amount = walletTransaction->tx->vout[i].nValue;\n            i++;\n        }\n    }\n}\n\nCAmount WalletModelTransaction::getTotalTransactionAmount() const\n{\n    CAmount totalTransactionAmount = 0;\n    for (const SendCoinsRecipient &rcp : recipients)\n    {\n        totalTransactionAmount += rcp.amount;\n    }\n    return totalTransactionAmount;\n}\n\nvoid WalletModelTransaction::newPossibleKeyChange(CWallet *wallet)\n{\n    keyChange.reset(new CReserveKey(wallet));\n}\n\nCReserveKey *WalletModelTransaction::getPossibleKeyChange()\n{\n    return keyChange.get();\n}\n"
  },
  {
    "path": "src/qt/walletmodeltransaction.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_WALLETMODELTRANSACTION_H\n#define BITCOIN_QT_WALLETMODELTRANSACTION_H\n\n#include <qt/walletmodel.h>\n\n#include <memory>\n\n#include <QObject>\n\nclass SendCoinsRecipient;\n\nclass CReserveKey;\nclass CWallet;\nclass CWalletTx;\n\n/** Data model for a walletmodel transaction. */\nclass WalletModelTransaction\n{\npublic:\n    explicit WalletModelTransaction(const QList<SendCoinsRecipient> &recipients);\n    ~WalletModelTransaction();\n\n    QList<SendCoinsRecipient> getRecipients() const;\n\n    CWalletTx *getTransaction() const;\n    unsigned int getTransactionSize();\n\n    void setTransactionFee(const CAmount& newFee);\n    CAmount getTransactionFee() const;\n\n    CAmount getTotalTransactionAmount() const;\n\n    void newPossibleKeyChange(CWallet *wallet);\n    CReserveKey *getPossibleKeyChange();\n\n    void reassignAmounts(int nChangePosRet); // needed for the subtract-fee-from-amount feature\n\nprivate:\n    QList<SendCoinsRecipient> recipients;\n    CWalletTx *walletTransaction;\n    std::unique_ptr<CReserveKey> keyChange;\n    CAmount fee;\n};\n\n#endif // BITCOIN_QT_WALLETMODELTRANSACTION_H\n"
  },
  {
    "path": "src/qt/walletview.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/walletview.h>\n\n#include <qt/addressbookpage.h>\n#include <qt/askpassphrasedialog.h>\n#include <qt/bitcoingui.h>\n#include <qt/clientmodel.h>\n#include <qt/guiutil.h>\n#include <qt/optionsmodel.h>\n#include <qt/overviewpage.h>\n#include <qt/platformstyle.h>\n#include <qt/receivecoinsdialog.h>\n#include <qt/sendcoinsdialog.h>\n#include <qt/signverifymessagedialog.h>\n#include <qt/transactiontablemodel.h>\n#include <qt/transactionview.h>\n#include <qt/walletmodel.h>\n\n#include <ui_interface.h>\n\n#include <QAction>\n#include <QActionGroup>\n#include <QFileDialog>\n#include <QHBoxLayout>\n#include <QProgressDialog>\n#include <QPushButton>\n#include <QVBoxLayout>\n\nWalletView::WalletView(const PlatformStyle *_platformStyle, QWidget *parent):\n    QStackedWidget(parent),\n    clientModel(0),\n    walletModel(0),\n    platformStyle(_platformStyle)\n{\n    // Create tabs\n    overviewPage = new OverviewPage(platformStyle);\n\n    transactionsPage = new QWidget(this);\n    QVBoxLayout *vbox = new QVBoxLayout();\n    QHBoxLayout *hbox_buttons = new QHBoxLayout();\n    transactionView = new TransactionView(platformStyle, this);\n    vbox->addWidget(transactionView);\n    QPushButton *exportButton = new QPushButton(tr(\"&Export\"), this);\n    exportButton->setToolTip(tr(\"Export the data in the current tab to a file\"));\n    if (platformStyle->getImagesOnButtons()) {\n        exportButton->setIcon(platformStyle->SingleColorIcon(\":/icons/export\"));\n    }\n    hbox_buttons->addStretch();\n    hbox_buttons->addWidget(exportButton);\n    vbox->addLayout(hbox_buttons);\n    transactionsPage->setLayout(vbox);\n\n    receiveCoinsPage = new ReceiveCoinsDialog(platformStyle);\n    sendCoinsPage = new SendCoinsDialog(platformStyle);\n\n    usedSendingAddressesPage = new AddressBookPage(platformStyle, AddressBookPage::ForEditing, AddressBookPage::SendingTab, this);\n    usedReceivingAddressesPage = new AddressBookPage(platformStyle, AddressBookPage::ForEditing, AddressBookPage::ReceivingTab, this);\n\n    addWidget(overviewPage);\n    addWidget(transactionsPage);\n    addWidget(receiveCoinsPage);\n    addWidget(sendCoinsPage);\n\n    // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page\n    connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));\n    connect(overviewPage, SIGNAL(outOfSyncWarningClicked()), this, SLOT(requestedSyncWarningInfo()));\n\n    // Double-clicking on a transaction on the transaction history page shows details\n    connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));\n\n    // Clicking on \"Export\" allows to export the transaction list\n    connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked()));\n\n    // Pass through messages from sendCoinsPage\n    connect(sendCoinsPage, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));\n    // Pass through messages from transactionView\n    connect(transactionView, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));\n}\n\nWalletView::~WalletView()\n{\n}\n\nvoid WalletView::setBitcoinGUI(BitcoinGUI *gui)\n{\n    if (gui)\n    {\n        // Clicking on a transaction on the overview page simply sends you to transaction history page\n        connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), gui, SLOT(gotoHistoryPage()));\n\n        // Receive and report messages\n        connect(this, SIGNAL(message(QString,QString,unsigned int)), gui, SLOT(message(QString,QString,unsigned int)));\n\n        // Pass through encryption status changed signals\n        connect(this, SIGNAL(encryptionStatusChanged(int)), gui, SLOT(setEncryptionStatus(int)));\n\n        // Pass through transaction notifications\n        connect(this, SIGNAL(incomingTransaction(QString,int,CAmount,QString,QString,QString)), gui, SLOT(incomingTransaction(QString,int,CAmount,QString,QString,QString)));\n\n        // Connect HD enabled state signal \n        connect(this, SIGNAL(hdEnabledStatusChanged(int)), gui, SLOT(setHDStatus(int)));\n    }\n}\n\nvoid WalletView::setClientModel(ClientModel *_clientModel)\n{\n    this->clientModel = _clientModel;\n\n    overviewPage->setClientModel(_clientModel);\n    sendCoinsPage->setClientModel(_clientModel);\n}\n\nvoid WalletView::setWalletModel(WalletModel *_walletModel)\n{\n    this->walletModel = _walletModel;\n\n    // Put transaction list in tabs\n    transactionView->setModel(_walletModel);\n    overviewPage->setWalletModel(_walletModel);\n    receiveCoinsPage->setModel(_walletModel);\n    sendCoinsPage->setModel(_walletModel);\n    usedReceivingAddressesPage->setModel(_walletModel ? _walletModel->getAddressTableModel() : nullptr);\n    usedSendingAddressesPage->setModel(_walletModel ? _walletModel->getAddressTableModel() : nullptr);\n\n    if (_walletModel)\n    {\n        // Receive and pass through messages from wallet model\n        connect(_walletModel, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));\n\n        // Handle changes in encryption status\n        connect(_walletModel, SIGNAL(encryptionStatusChanged(int)), this, SIGNAL(encryptionStatusChanged(int)));\n        updateEncryptionStatus();\n\n        // update HD status\n        Q_EMIT hdEnabledStatusChanged(_walletModel->hdEnabled());\n\n        // Balloon pop-up for new transaction\n        connect(_walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),\n                this, SLOT(processNewTransaction(QModelIndex,int,int)));\n\n        // Ask for passphrase if needed\n        connect(_walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));\n\n        // Show progress dialog\n        connect(_walletModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));\n    }\n}\n\nvoid WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/)\n{\n    // Prevent balloon-spam when initial block download is in progress\n    if (!walletModel || !clientModel || clientModel->inInitialBlockDownload())\n        return;\n\n    TransactionTableModel *ttm = walletModel->getTransactionTableModel();\n    if (!ttm || ttm->processingQueuedTransactions())\n        return;\n\n    QString date = ttm->index(start, TransactionTableModel::Date, parent).data().toString();\n    qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent).data(Qt::EditRole).toULongLong();\n    QString type = ttm->index(start, TransactionTableModel::Type, parent).data().toString();\n    QModelIndex index = ttm->index(start, 0, parent);\n    QString address = ttm->data(index, TransactionTableModel::AddressRole).toString();\n    QString label = ttm->data(index, TransactionTableModel::LabelRole).toString();\n\n    Q_EMIT incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address, label);\n}\n\nvoid WalletView::gotoOverviewPage()\n{\n    setCurrentWidget(overviewPage);\n}\n\nvoid WalletView::gotoHistoryPage()\n{\n    setCurrentWidget(transactionsPage);\n}\n\nvoid WalletView::gotoReceiveCoinsPage()\n{\n    setCurrentWidget(receiveCoinsPage);\n}\n\nvoid WalletView::gotoSendCoinsPage(QString addr)\n{\n    setCurrentWidget(sendCoinsPage);\n\n    if (!addr.isEmpty())\n        sendCoinsPage->setAddress(addr);\n}\n\nvoid WalletView::gotoSignMessageTab(QString addr)\n{\n    // calls show() in showTab_SM()\n    SignVerifyMessageDialog *signVerifyMessageDialog = new SignVerifyMessageDialog(platformStyle, this);\n    signVerifyMessageDialog->setAttribute(Qt::WA_DeleteOnClose);\n    signVerifyMessageDialog->setModel(walletModel);\n    signVerifyMessageDialog->showTab_SM(true);\n\n    if (!addr.isEmpty())\n        signVerifyMessageDialog->setAddress_SM(addr);\n}\n\nvoid WalletView::gotoVerifyMessageTab(QString addr)\n{\n    // calls show() in showTab_VM()\n    SignVerifyMessageDialog *signVerifyMessageDialog = new SignVerifyMessageDialog(platformStyle, this);\n    signVerifyMessageDialog->setAttribute(Qt::WA_DeleteOnClose);\n    signVerifyMessageDialog->setModel(walletModel);\n    signVerifyMessageDialog->showTab_VM(true);\n\n    if (!addr.isEmpty())\n        signVerifyMessageDialog->setAddress_VM(addr);\n}\n\nbool WalletView::handlePaymentRequest(const SendCoinsRecipient& recipient)\n{\n    return sendCoinsPage->handlePaymentRequest(recipient);\n}\n\nvoid WalletView::showOutOfSyncWarning(bool fShow)\n{\n    overviewPage->showOutOfSyncWarning(fShow);\n}\n\nvoid WalletView::updateEncryptionStatus()\n{\n    Q_EMIT encryptionStatusChanged(walletModel->getEncryptionStatus());\n}\n\nvoid WalletView::encryptWallet(bool status)\n{\n    if(!walletModel)\n        return;\n    AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt : AskPassphraseDialog::Decrypt, this);\n    dlg.setModel(walletModel);\n    dlg.exec();\n\n    updateEncryptionStatus();\n}\n\nvoid WalletView::backupWallet()\n{\n    QString filename = GUIUtil::getSaveFileName(this,\n        tr(\"Backup Wallet\"), QString(),\n        tr(\"Wallet Data (*.dat)\"), nullptr);\n\n    if (filename.isEmpty())\n        return;\n\n    if (!walletModel->backupWallet(filename)) {\n        Q_EMIT message(tr(\"Backup Failed\"), tr(\"There was an error trying to save the wallet data to %1.\").arg(filename),\n            CClientUIInterface::MSG_ERROR);\n        }\n    else {\n        Q_EMIT message(tr(\"Backup Successful\"), tr(\"The wallet data was successfully saved to %1.\").arg(filename),\n            CClientUIInterface::MSG_INFORMATION);\n    }\n}\n\nvoid WalletView::changePassphrase()\n{\n    AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this);\n    dlg.setModel(walletModel);\n    dlg.exec();\n}\n\nvoid WalletView::unlockWallet()\n{\n    if(!walletModel)\n        return;\n    // Unlock wallet when requested by wallet model\n    if (walletModel->getEncryptionStatus() == WalletModel::Locked)\n    {\n        AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this);\n        dlg.setModel(walletModel);\n        dlg.exec();\n    }\n}\n\nvoid WalletView::usedSendingAddresses()\n{\n    if(!walletModel)\n        return;\n\n    usedSendingAddressesPage->show();\n    usedSendingAddressesPage->raise();\n    usedSendingAddressesPage->activateWindow();\n}\n\nvoid WalletView::usedReceivingAddresses()\n{\n    if(!walletModel)\n        return;\n\n    usedReceivingAddressesPage->show();\n    usedReceivingAddressesPage->raise();\n    usedReceivingAddressesPage->activateWindow();\n}\n\nvoid WalletView::showProgress(const QString &title, int nProgress)\n{\n    if (nProgress == 0)\n    {\n        progressDialog = new QProgressDialog(title, \"\", 0, 100);\n        progressDialog->setWindowModality(Qt::ApplicationModal);\n        progressDialog->setMinimumDuration(0);\n        progressDialog->setCancelButton(0);\n        progressDialog->setAutoClose(false);\n        progressDialog->setValue(0);\n    }\n    else if (nProgress == 100)\n    {\n        if (progressDialog)\n        {\n            progressDialog->close();\n            progressDialog->deleteLater();\n        }\n    }\n    else if (progressDialog)\n        progressDialog->setValue(nProgress);\n}\n\nvoid WalletView::requestedSyncWarningInfo()\n{\n    Q_EMIT outOfSyncWarningClicked();\n}\n"
  },
  {
    "path": "src/qt/walletview.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_WALLETVIEW_H\n#define BITCOIN_QT_WALLETVIEW_H\n\n#include <amount.h>\n\n#include <QStackedWidget>\n\nclass BitcoinGUI;\nclass ClientModel;\nclass OverviewPage;\nclass PlatformStyle;\nclass ReceiveCoinsDialog;\nclass SendCoinsDialog;\nclass SendCoinsRecipient;\nclass TransactionView;\nclass WalletModel;\nclass AddressBookPage;\n\nQT_BEGIN_NAMESPACE\nclass QModelIndex;\nclass QProgressDialog;\nQT_END_NAMESPACE\n\n/*\n  WalletView class. This class represents the view to a single wallet.\n  It was added to support multiple wallet functionality. Each wallet gets its own WalletView instance.\n  It communicates with both the client and the wallet models to give the user an up-to-date view of the\n  current core state.\n*/\nclass WalletView : public QStackedWidget\n{\n    Q_OBJECT\n\npublic:\n    explicit WalletView(const PlatformStyle *platformStyle, QWidget *parent);\n    ~WalletView();\n\n    void setBitcoinGUI(BitcoinGUI *gui);\n    /** Set the client model.\n        The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.\n    */\n    void setClientModel(ClientModel *clientModel);\n    /** Set the wallet model.\n        The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending\n        functionality.\n    */\n    void setWalletModel(WalletModel *walletModel);\n\n    bool handlePaymentRequest(const SendCoinsRecipient& recipient);\n\n    void showOutOfSyncWarning(bool fShow);\n\nprivate:\n    ClientModel *clientModel;\n    WalletModel *walletModel;\n\n    OverviewPage *overviewPage;\n    QWidget *transactionsPage;\n    ReceiveCoinsDialog *receiveCoinsPage;\n    SendCoinsDialog *sendCoinsPage;\n    AddressBookPage *usedSendingAddressesPage;\n    AddressBookPage *usedReceivingAddressesPage;\n\n    TransactionView *transactionView;\n\n    QProgressDialog *progressDialog;\n    const PlatformStyle *platformStyle;\n\npublic Q_SLOTS:\n    /** Switch to overview (home) page */\n    void gotoOverviewPage();\n    /** Switch to history (transactions) page */\n    void gotoHistoryPage();\n    /** Switch to receive coins page */\n    void gotoReceiveCoinsPage();\n    /** Switch to send coins page */\n    void gotoSendCoinsPage(QString addr = \"\");\n\n    /** Show Sign/Verify Message dialog and switch to sign message tab */\n    void gotoSignMessageTab(QString addr = \"\");\n    /** Show Sign/Verify Message dialog and switch to verify message tab */\n    void gotoVerifyMessageTab(QString addr = \"\");\n\n    /** Show incoming transaction notification for new transactions.\n\n        The new items are those between start and end inclusive, under the given parent item.\n    */\n    void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);\n    /** Encrypt the wallet */\n    void encryptWallet(bool status);\n    /** Backup the wallet */\n    void backupWallet();\n    /** Change encrypted wallet passphrase */\n    void changePassphrase();\n    /** Ask for passphrase to unlock wallet temporarily */\n    void unlockWallet();\n\n    /** Show used sending addresses */\n    void usedSendingAddresses();\n    /** Show used receiving addresses */\n    void usedReceivingAddresses();\n\n    /** Re-emit encryption status signal */\n    void updateEncryptionStatus();\n\n    /** Show progress dialog e.g. for rescan */\n    void showProgress(const QString &title, int nProgress);\n\n    /** User has requested more information about the out of sync state */\n    void requestedSyncWarningInfo();\n\nQ_SIGNALS:\n    /** Signal that we want to show the main window */\n    void showNormalIfMinimized();\n    /**  Fired when a message should be reported to the user */\n    void message(const QString &title, const QString &message, unsigned int style);\n    /** Encryption status of wallet changed */\n    void encryptionStatusChanged(int status);\n    /** HD-Enabled status of wallet changed (only possible during startup) */\n    void hdEnabledStatusChanged(int hdEnabled);\n    /** Notify that a new transaction appeared */\n    void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label);\n    /** Notify that the out of sync warning icon has been pressed */\n    void outOfSyncWarningClicked();\n};\n\n#endif // BITCOIN_QT_WALLETVIEW_H\n"
  },
  {
    "path": "src/qt/winshutdownmonitor.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <qt/winshutdownmonitor.h>\n\n#if defined(Q_OS_WIN) && QT_VERSION >= 0x050000\n#include <init.h>\n#include <util.h>\n\n#include <windows.h>\n\n#include <QDebug>\n\n#include <openssl/rand.h>\n\n// If we don't want a message to be processed by Qt, return true and set result to\n// the value that the window procedure should return. Otherwise return false.\nbool WinShutdownMonitor::nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult)\n{\n       Q_UNUSED(eventType);\n\n       MSG *pMsg = static_cast<MSG *>(pMessage);\n\n       // Seed OpenSSL PRNG with Windows event data (e.g.  mouse movements and other user interactions)\n       if (RAND_event(pMsg->message, pMsg->wParam, pMsg->lParam) == 0) {\n            // Warn only once as this is performance-critical\n            static bool warned = false;\n            if (!warned) {\n                LogPrintf(\"%s: OpenSSL RAND_event() failed to seed OpenSSL PRNG with enough data.\\n\", __func__);\n                warned = true;\n            }\n       }\n\n       switch(pMsg->message)\n       {\n           case WM_QUERYENDSESSION:\n           {\n               // Initiate a client shutdown after receiving a WM_QUERYENDSESSION and block\n               // Windows session end until we have finished client shutdown.\n               StartShutdown();\n               *pnResult = FALSE;\n               return true;\n           }\n\n           case WM_ENDSESSION:\n           {\n               *pnResult = FALSE;\n               return true;\n           }\n       }\n\n       return false;\n}\n\nvoid WinShutdownMonitor::registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId)\n{\n    typedef BOOL (WINAPI *PSHUTDOWNBRCREATE)(HWND, LPCWSTR);\n    PSHUTDOWNBRCREATE shutdownBRCreate = (PSHUTDOWNBRCREATE)GetProcAddress(GetModuleHandleA(\"User32.dll\"), \"ShutdownBlockReasonCreate\");\n    if (shutdownBRCreate == nullptr) {\n        qWarning() << \"registerShutdownBlockReason: GetProcAddress for ShutdownBlockReasonCreate failed\";\n        return;\n    }\n\n    if (shutdownBRCreate(mainWinId, strReason.toStdWString().c_str()))\n        qWarning() << \"registerShutdownBlockReason: Successfully registered: \" + strReason;\n    else\n        qWarning() << \"registerShutdownBlockReason: Failed to register: \" + strReason;\n}\n#endif\n"
  },
  {
    "path": "src/qt/winshutdownmonitor.h",
    "content": "// Copyright (c) 2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_QT_WINSHUTDOWNMONITOR_H\n#define BITCOIN_QT_WINSHUTDOWNMONITOR_H\n\n#ifdef WIN32\n#include <QByteArray>\n#include <QString>\n\n#if QT_VERSION >= 0x050000\n#include <windef.h> // for HWND\n\n#include <QAbstractNativeEventFilter>\n\nclass WinShutdownMonitor : public QAbstractNativeEventFilter\n{\npublic:\n    /** Implements QAbstractNativeEventFilter interface for processing Windows messages */\n    bool nativeEventFilter(const QByteArray &eventType, void *pMessage, long *pnResult);\n\n    /** Register the reason for blocking shutdown on Windows to allow clean client exit */\n    static void registerShutdownBlockReason(const QString& strReason, const HWND& mainWinId);\n};\n#endif\n#endif\n\n#endif // BITCOIN_QT_WINSHUTDOWNMONITOR_H\n"
  },
  {
    "path": "src/random.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <random.h>\n\n#include <crypto/sha512.h>\n#include <support/cleanse.h>\n#ifdef WIN32\n#include <compat.h> // for Windows API\n#include <wincrypt.h>\n#endif\n#include <util.h>             // for LogPrint()\n#include <utilstrencodings.h> // for GetTime()\n\n#include <stdlib.h>\n#include <limits>\n#include <chrono>\n#include <thread>\n\n#ifndef WIN32\n#include <sys/time.h>\n#endif\n\n#ifdef HAVE_SYS_GETRANDOM\n#include <sys/syscall.h>\n#include <linux/random.h>\n#endif\n#if defined(HAVE_GETENTROPY) || (defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX))\n#include <unistd.h>\n#endif\n#if defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)\n#include <sys/random.h>\n#endif\n#ifdef HAVE_SYSCTL_ARND\n#include <sys/sysctl.h>\n#endif\n\n#include <mutex>\n\n#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)\n#include <cpuid.h>\n#endif\n\n#include <openssl/err.h>\n#include <openssl/rand.h>\n\n[[noreturn]] static void RandFailure()\n{\n    LogPrintf(\"Failed to read randomness, aborting\\n\");\n    std::abort();\n}\n\nstatic inline int64_t GetPerformanceCounter()\n{\n    // Read the hardware time stamp counter when available.\n    // See https://en.wikipedia.org/wiki/Time_Stamp_Counter for more information.\n#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))\n    return __rdtsc();\n#elif !defined(_MSC_VER) && defined(__i386__)\n    uint64_t r = 0;\n    __asm__ volatile (\"rdtsc\" : \"=A\"(r)); // Constrain the r variable to the eax:edx pair.\n    return r;\n#elif !defined(_MSC_VER) && (defined(__x86_64__) || defined(__amd64__))\n    uint64_t r1 = 0, r2 = 0;\n    __asm__ volatile (\"rdtsc\" : \"=a\"(r1), \"=d\"(r2)); // Constrain r1 to rax and r2 to rdx.\n    return (r2 << 32) | r1;\n#else\n    // Fall back to using C++11 clock (usually microsecond or nanosecond precision)\n    return std::chrono::high_resolution_clock::now().time_since_epoch().count();\n#endif\n}\n\n\n#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)\nstatic std::atomic<bool> hwrand_initialized{false};\nstatic bool rdrand_supported = false;\nstatic constexpr uint32_t CPUID_F1_ECX_RDRAND = 0x40000000;\nstatic void RDRandInit()\n{\n    uint32_t eax, ebx, ecx, edx;\n    if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) && (ecx & CPUID_F1_ECX_RDRAND)) {\n        LogPrintf(\"Using RdRand as an additional entropy source\\n\");\n        rdrand_supported = true;\n    }\n    hwrand_initialized.store(true);\n}\n#else\nstatic void RDRandInit() {}\n#endif\n\nstatic bool GetHWRand(unsigned char* ent32) {\n#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)\n    assert(hwrand_initialized.load(std::memory_order_relaxed));\n    if (rdrand_supported) {\n        uint8_t ok;\n        // Not all assemblers support the rdrand instruction, write it in hex.\n#ifdef __i386__\n        for (int iter = 0; iter < 4; ++iter) {\n            uint32_t r1, r2;\n            __asm__ volatile (\".byte 0x0f, 0xc7, 0xf0;\" // rdrand %eax\n                              \".byte 0x0f, 0xc7, 0xf2;\" // rdrand %edx\n                              \"setc %2\" :\n                              \"=a\"(r1), \"=d\"(r2), \"=q\"(ok) :: \"cc\");\n            if (!ok) return false;\n            WriteLE32(ent32 + 8 * iter, r1);\n            WriteLE32(ent32 + 8 * iter + 4, r2);\n        }\n#else\n        uint64_t r1, r2, r3, r4;\n        __asm__ volatile (\".byte 0x48, 0x0f, 0xc7, 0xf0, \" // rdrand %rax\n                                \"0x48, 0x0f, 0xc7, 0xf3, \" // rdrand %rbx\n                                \"0x48, 0x0f, 0xc7, 0xf1, \" // rdrand %rcx\n                                \"0x48, 0x0f, 0xc7, 0xf2; \" // rdrand %rdx\n                          \"setc %4\" :\n                          \"=a\"(r1), \"=b\"(r2), \"=c\"(r3), \"=d\"(r4), \"=q\"(ok) :: \"cc\");\n        if (!ok) return false;\n        WriteLE64(ent32, r1);\n        WriteLE64(ent32 + 8, r2);\n        WriteLE64(ent32 + 16, r3);\n        WriteLE64(ent32 + 24, r4);\n#endif\n        return true;\n    }\n#endif\n    return false;\n}\n\nvoid RandAddSeed()\n{\n    // Seed with CPU performance counter\n    int64_t nCounter = GetPerformanceCounter();\n    RAND_add(&nCounter, sizeof(nCounter), 1.5);\n    memory_cleanse((void*)&nCounter, sizeof(nCounter));\n}\n\nstatic void RandAddSeedPerfmon()\n{\n    RandAddSeed();\n\n#ifdef WIN32\n    // Don't need this on Linux, OpenSSL automatically uses /dev/urandom\n    // Seed with the entire set of perfmon data\n\n    // This can take up to 2 seconds, so only do it every 10 minutes\n    static int64_t nLastPerfmon;\n    if (GetTime() < nLastPerfmon + 10 * 60)\n        return;\n    nLastPerfmon = GetTime();\n\n    std::vector<unsigned char> vData(250000, 0);\n    long ret = 0;\n    unsigned long nSize = 0;\n    const size_t nMaxSize = 10000000; // Bail out at more than 10MB of performance data\n    while (true) {\n        nSize = vData.size();\n        ret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, \"Global\", nullptr, nullptr, vData.data(), &nSize);\n        if (ret != ERROR_MORE_DATA || vData.size() >= nMaxSize)\n            break;\n        vData.resize(std::max((vData.size() * 3) / 2, nMaxSize)); // Grow size of buffer exponentially\n    }\n    RegCloseKey(HKEY_PERFORMANCE_DATA);\n    if (ret == ERROR_SUCCESS) {\n        RAND_add(vData.data(), nSize, nSize / 100.0);\n        memory_cleanse(vData.data(), nSize);\n        LogPrint(BCLog::RAND, \"%s: %lu bytes\\n\", __func__, nSize);\n    } else {\n        static bool warned = false; // Warn only once\n        if (!warned) {\n            LogPrintf(\"%s: Warning: RegQueryValueExA(HKEY_PERFORMANCE_DATA) failed with code %i\\n\", __func__, ret);\n            warned = true;\n        }\n    }\n#endif\n}\n\n#ifndef WIN32\n/** Fallback: get 32 bytes of system entropy from /dev/urandom. The most\n * compatible way to get cryptographic randomness on UNIX-ish platforms.\n */\nvoid GetDevURandom(unsigned char *ent32)\n{\n    int f = open(\"/dev/urandom\", O_RDONLY);\n    if (f == -1) {\n        RandFailure();\n    }\n    int have = 0;\n    do {\n        ssize_t n = read(f, ent32 + have, NUM_OS_RANDOM_BYTES - have);\n        if (n <= 0 || n + have > NUM_OS_RANDOM_BYTES) {\n            close(f);\n            RandFailure();\n        }\n        have += n;\n    } while (have < NUM_OS_RANDOM_BYTES);\n    close(f);\n}\n#endif\n\n/** Get 32 bytes of system entropy. */\nvoid GetOSRand(unsigned char *ent32)\n{\n#if defined(WIN32)\n    HCRYPTPROV hProvider;\n    int ret = CryptAcquireContextW(&hProvider, nullptr, nullptr, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);\n    if (!ret) {\n        RandFailure();\n    }\n    ret = CryptGenRandom(hProvider, NUM_OS_RANDOM_BYTES, ent32);\n    if (!ret) {\n        RandFailure();\n    }\n    CryptReleaseContext(hProvider, 0);\n#elif defined(HAVE_SYS_GETRANDOM)\n    /* Linux. From the getrandom(2) man page:\n     * \"If the urandom source has been initialized, reads of up to 256 bytes\n     * will always return as many bytes as requested and will not be\n     * interrupted by signals.\"\n     */\n    int rv = syscall(SYS_getrandom, ent32, NUM_OS_RANDOM_BYTES, 0);\n    if (rv != NUM_OS_RANDOM_BYTES) {\n        if (rv < 0 && errno == ENOSYS) {\n            /* Fallback for kernel <3.17: the return value will be -1 and errno\n             * ENOSYS if the syscall is not available, in that case fall back\n             * to /dev/urandom.\n             */\n            GetDevURandom(ent32);\n        } else {\n            RandFailure();\n        }\n    }\n#elif defined(HAVE_GETENTROPY) && defined(__OpenBSD__)\n    /* On OpenBSD this can return up to 256 bytes of entropy, will return an\n     * error if more are requested.\n     * The call cannot return less than the requested number of bytes.\n       getentropy is explicitly limited to openbsd here, as a similar (but not\n       the same) function may exist on other platforms via glibc.\n     */\n    if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {\n        RandFailure();\n    }\n#elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)\n    // We need a fallback for OSX < 10.12\n    if (&getentropy != nullptr) {\n        if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {\n            RandFailure();\n        }\n    } else {\n        GetDevURandom(ent32);\n    }\n#elif defined(HAVE_SYSCTL_ARND)\n    /* FreeBSD and similar. It is possible for the call to return less\n     * bytes than requested, so need to read in a loop.\n     */\n    static const int name[2] = {CTL_KERN, KERN_ARND};\n    int have = 0;\n    do {\n        size_t len = NUM_OS_RANDOM_BYTES - have;\n        if (sysctl(name, ARRAYLEN(name), ent32 + have, &len, nullptr, 0) != 0) {\n            RandFailure();\n        }\n        have += len;\n    } while (have < NUM_OS_RANDOM_BYTES);\n#else\n    /* Fall back to /dev/urandom if there is no specific method implemented to\n     * get system entropy for this OS.\n     */\n    GetDevURandom(ent32);\n#endif\n}\n\nvoid GetRandBytes(unsigned char* buf, int num)\n{\n    if (RAND_bytes(buf, num) != 1) {\n        RandFailure();\n    }\n}\n\nstatic void AddDataToRng(void* data, size_t len);\n\nvoid RandAddSeedSleep()\n{\n    int64_t nPerfCounter1 = GetPerformanceCounter();\n    std::this_thread::sleep_for(std::chrono::milliseconds(1));\n    int64_t nPerfCounter2 = GetPerformanceCounter();\n\n    // Combine with and update state\n    AddDataToRng(&nPerfCounter1, sizeof(nPerfCounter1));\n    AddDataToRng(&nPerfCounter2, sizeof(nPerfCounter2));\n\n    memory_cleanse(&nPerfCounter1, sizeof(nPerfCounter1));\n    memory_cleanse(&nPerfCounter2, sizeof(nPerfCounter2));\n}\n\n\nstatic std::mutex cs_rng_state;\nstatic unsigned char rng_state[32] = {0};\nstatic uint64_t rng_counter = 0;\n\nstatic void AddDataToRng(void* data, size_t len) {\n    CSHA512 hasher;\n    hasher.Write((const unsigned char*)&len, sizeof(len));\n    hasher.Write((const unsigned char*)data, len);\n    unsigned char buf[64];\n    {\n        std::unique_lock<std::mutex> lock(cs_rng_state);\n        hasher.Write(rng_state, sizeof(rng_state));\n        hasher.Write((const unsigned char*)&rng_counter, sizeof(rng_counter));\n        ++rng_counter;\n        hasher.Finalize(buf);\n        memcpy(rng_state, buf + 32, 32);\n    }\n    memory_cleanse(buf, 64);\n}\n\nvoid GetStrongRandBytes(unsigned char* out, int num)\n{\n    assert(num <= 32);\n    CSHA512 hasher;\n    unsigned char buf[64];\n\n    // First source: OpenSSL's RNG\n    RandAddSeedPerfmon();\n    GetRandBytes(buf, 32);\n    hasher.Write(buf, 32);\n\n    // Second source: OS RNG\n    GetOSRand(buf);\n    hasher.Write(buf, 32);\n\n    // Third source: HW RNG, if available.\n    if (GetHWRand(buf)) {\n        hasher.Write(buf, 32);\n    }\n\n    // Combine with and update state\n    {\n        std::unique_lock<std::mutex> lock(cs_rng_state);\n        hasher.Write(rng_state, sizeof(rng_state));\n        hasher.Write((const unsigned char*)&rng_counter, sizeof(rng_counter));\n        ++rng_counter;\n        hasher.Finalize(buf);\n        memcpy(rng_state, buf + 32, 32);\n    }\n\n    // Produce output\n    memcpy(out, buf, num);\n    memory_cleanse(buf, 64);\n}\n\nuint64_t GetRand(uint64_t nMax)\n{\n    if (nMax == 0)\n        return 0;\n\n    // The range of the random source must be a multiple of the modulus\n    // to give every possible output value an equal possibility\n    uint64_t nRange = (std::numeric_limits<uint64_t>::max() / nMax) * nMax;\n    uint64_t nRand = 0;\n    do {\n        GetRandBytes((unsigned char*)&nRand, sizeof(nRand));\n    } while (nRand >= nRange);\n    return (nRand % nMax);\n}\n\nint GetRandInt(int nMax)\n{\n    return GetRand(nMax);\n}\n\nuint256 GetRandHash()\n{\n    uint256 hash;\n    GetRandBytes((unsigned char*)&hash, sizeof(hash));\n    return hash;\n}\n\nvoid FastRandomContext::RandomSeed()\n{\n    uint256 seed = GetRandHash();\n    rng.SetKey(seed.begin(), 32);\n    requires_seed = false;\n}\n\nuint256 FastRandomContext::rand256()\n{\n    if (bytebuf_size < 32) {\n        FillByteBuffer();\n    }\n    uint256 ret;\n    memcpy(ret.begin(), bytebuf + 64 - bytebuf_size, 32);\n    bytebuf_size -= 32;\n    return ret;\n}\n\nstd::vector<unsigned char> FastRandomContext::randbytes(size_t len)\n{\n    std::vector<unsigned char> ret(len);\n    if (len > 0) {\n        rng.Output(&ret[0], len);\n    }\n    return ret;\n}\n\nFastRandomContext::FastRandomContext(const uint256& seed) : requires_seed(false), bytebuf_size(0), bitbuf_size(0)\n{\n    rng.SetKey(seed.begin(), 32);\n}\n\nbool Random_SanityCheck()\n{\n    uint64_t start = GetPerformanceCounter();\n\n    /* This does not measure the quality of randomness, but it does test that\n     * OSRandom() overwrites all 32 bytes of the output given a maximum\n     * number of tries.\n     */\n    static const ssize_t MAX_TRIES = 1024;\n    uint8_t data[NUM_OS_RANDOM_BYTES];\n    bool overwritten[NUM_OS_RANDOM_BYTES] = {}; /* Tracks which bytes have been overwritten at least once */\n    int num_overwritten;\n    int tries = 0;\n    /* Loop until all bytes have been overwritten at least once, or max number tries reached */\n    do {\n        memset(data, 0, NUM_OS_RANDOM_BYTES);\n        GetOSRand(data);\n        for (int x=0; x < NUM_OS_RANDOM_BYTES; ++x) {\n            overwritten[x] |= (data[x] != 0);\n        }\n\n        num_overwritten = 0;\n        for (int x=0; x < NUM_OS_RANDOM_BYTES; ++x) {\n            if (overwritten[x]) {\n                num_overwritten += 1;\n            }\n        }\n\n        tries += 1;\n    } while (num_overwritten < NUM_OS_RANDOM_BYTES && tries < MAX_TRIES);\n    if (num_overwritten != NUM_OS_RANDOM_BYTES) return false; /* If this failed, bailed out after too many tries */\n\n    // Check that GetPerformanceCounter increases at least during a GetOSRand() call + 1ms sleep.\n    std::this_thread::sleep_for(std::chrono::milliseconds(1));\n    uint64_t stop = GetPerformanceCounter();\n    if (stop == start) return false;\n\n    // We called GetPerformanceCounter. Use it as entropy.\n    RAND_add((const unsigned char*)&start, sizeof(start), 1);\n    RAND_add((const unsigned char*)&stop, sizeof(stop), 1);\n\n    return true;\n}\n\nFastRandomContext::FastRandomContext(bool fDeterministic) : requires_seed(!fDeterministic), bytebuf_size(0), bitbuf_size(0)\n{\n    if (!fDeterministic) {\n        return;\n    }\n    uint256 seed;\n    rng.SetKey(seed.begin(), 32);\n}\n\nvoid RandomInit()\n{\n    RDRandInit();\n}\n"
  },
  {
    "path": "src/random.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_RANDOM_H\n#define BITCOIN_RANDOM_H\n\n#include <crypto/chacha20.h>\n#include <crypto/common.h>\n#include <uint256.h>\n\n#include <stdint.h>\n\n/* Seed OpenSSL PRNG with additional entropy data */\nvoid RandAddSeed();\n\n/**\n * Functions to gather random data via the OpenSSL PRNG\n */\nvoid GetRandBytes(unsigned char* buf, int num);\nuint64_t GetRand(uint64_t nMax);\nint GetRandInt(int nMax);\nuint256 GetRandHash();\n\n/**\n * Add a little bit of randomness to the output of GetStrongRangBytes.\n * This sleeps for a millisecond, so should only be called when there is\n * no other work to be done.\n */\nvoid RandAddSeedSleep();\n\n/**\n * Function to gather random data from multiple sources, failing whenever any\n * of those source fail to provide a result.\n */\nvoid GetStrongRandBytes(unsigned char* buf, int num);\n\n/**\n * Fast randomness source. This is seeded once with secure random data, but\n * is completely deterministic and insecure after that.\n * This class is not thread-safe.\n */\nclass FastRandomContext {\nprivate:\n    bool requires_seed;\n    ChaCha20 rng;\n\n    unsigned char bytebuf[64];\n    int bytebuf_size;\n\n    uint64_t bitbuf;\n    int bitbuf_size;\n\n    void RandomSeed();\n\n    void FillByteBuffer()\n    {\n        if (requires_seed) {\n            RandomSeed();\n        }\n        rng.Output(bytebuf, sizeof(bytebuf));\n        bytebuf_size = sizeof(bytebuf);\n    }\n\n    void FillBitBuffer()\n    {\n        bitbuf = rand64();\n        bitbuf_size = 64;\n    }\n\npublic:\n    explicit FastRandomContext(bool fDeterministic = false);\n\n    /** Initialize with explicit seed (only for testing) */\n    explicit FastRandomContext(const uint256& seed);\n\n    /** Generate a random 64-bit integer. */\n    uint64_t rand64()\n    {\n        if (bytebuf_size < 8) FillByteBuffer();\n        uint64_t ret = ReadLE64(bytebuf + 64 - bytebuf_size);\n        bytebuf_size -= 8;\n        return ret;\n    }\n\n    /** Generate a random (bits)-bit integer. */\n    uint64_t randbits(int bits) {\n        if (bits == 0) {\n            return 0;\n        } else if (bits > 32) {\n            return rand64() >> (64 - bits);\n        } else {\n            if (bitbuf_size < bits) FillBitBuffer();\n            uint64_t ret = bitbuf & (~(uint64_t)0 >> (64 - bits));\n            bitbuf >>= bits;\n            bitbuf_size -= bits;\n            return ret;\n        }\n    }\n\n    /** Generate a random integer in the range [0..range). */\n    uint64_t randrange(uint64_t range)\n    {\n        --range;\n        int bits = CountBits(range);\n        while (true) {\n            uint64_t ret = randbits(bits);\n            if (ret <= range) return ret;\n        }\n    }\n\n    /** Generate random bytes. */\n    std::vector<unsigned char> randbytes(size_t len);\n\n    /** Generate a random 32-bit integer. */\n    uint32_t rand32() { return randbits(32); }\n\n    /** generate a random uint256. */\n    uint256 rand256();\n\n    /** Generate a random boolean. */\n    bool randbool() { return randbits(1); }\n};\n\n/* Number of random bytes returned by GetOSRand.\n * When changing this constant make sure to change all call sites, and make\n * sure that the underlying OS APIs for all platforms support the number.\n * (many cap out at 256 bytes).\n */\nstatic const int NUM_OS_RANDOM_BYTES = 32;\n\n/** Get 32 bytes of system entropy. Do not use this in application code: use\n * GetStrongRandBytes instead.\n */\nvoid GetOSRand(unsigned char *ent32);\n\n/** Check that OS randomness is available and returning the requested number\n * of bytes.\n */\nbool Random_SanityCheck();\n\n/** Initialize the RNG. */\nvoid RandomInit();\n\n#endif // BITCOIN_RANDOM_H\n"
  },
  {
    "path": "src/rest.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <chain.h>\n#include <chainparams.h>\n#include <core_io.h>\n#include <primitives/block.h>\n#include <primitives/transaction.h>\n#include <validation.h>\n#include <httpserver.h>\n#include <rpc/blockchain.h>\n#include <rpc/server.h>\n#include <streams.h>\n#include <sync.h>\n#include <txmempool.h>\n#include <utilstrencodings.h>\n#include <version.h>\n\n#include <boost/algorithm/string.hpp>\n\n#include <univalue.h>\n\nstatic const size_t MAX_GETUTXOS_OUTPOINTS = 15; //allow a max of 15 outpoints to be queried at once\n\nenum RetFormat {\n    RF_UNDEF,\n    RF_BINARY,\n    RF_HEX,\n    RF_JSON,\n};\n\nstatic const struct {\n    enum RetFormat rf;\n    const char* name;\n} rf_names[] = {\n      {RF_UNDEF, \"\"},\n      {RF_BINARY, \"bin\"},\n      {RF_HEX, \"hex\"},\n      {RF_JSON, \"json\"},\n};\n\nstruct CCoin {\n    uint32_t nHeight;\n    CTxOut out;\n\n    ADD_SERIALIZE_METHODS;\n\n    CCoin() : nHeight(0) {}\n    explicit CCoin(Coin&& in) : nHeight(in.nHeight), out(std::move(in.out)) {}\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action)\n    {\n        uint32_t nTxVerDummy = 0;\n        READWRITE(nTxVerDummy);\n        READWRITE(nHeight);\n        READWRITE(out);\n    }\n};\n\nstatic bool RESTERR(HTTPRequest* req, enum HTTPStatusCode status, std::string message)\n{\n    req->WriteHeader(\"Content-Type\", \"text/plain\");\n    req->WriteReply(status, message + \"\\r\\n\");\n    return false;\n}\n\nstatic enum RetFormat ParseDataFormat(std::string& param, const std::string& strReq)\n{\n    const std::string::size_type pos = strReq.rfind('.');\n    if (pos == std::string::npos)\n    {\n        param = strReq;\n        return rf_names[0].rf;\n    }\n\n    param = strReq.substr(0, pos);\n    const std::string suff(strReq, pos + 1);\n\n    for (unsigned int i = 0; i < ARRAYLEN(rf_names); i++)\n        if (suff == rf_names[i].name)\n            return rf_names[i].rf;\n\n    /* If no suffix is found, return original string.  */\n    param = strReq;\n    return rf_names[0].rf;\n}\n\nstatic std::string AvailableDataFormatsString()\n{\n    std::string formats = \"\";\n    for (unsigned int i = 0; i < ARRAYLEN(rf_names); i++)\n        if (strlen(rf_names[i].name) > 0) {\n            formats.append(\".\");\n            formats.append(rf_names[i].name);\n            formats.append(\", \");\n        }\n\n    if (formats.length() > 0)\n        return formats.substr(0, formats.length() - 2);\n\n    return formats;\n}\n\nstatic bool ParseHashStr(const std::string& strReq, uint256& v)\n{\n    if (!IsHex(strReq) || (strReq.size() != 64))\n        return false;\n\n    v.SetHex(strReq);\n    return true;\n}\n\nstatic bool CheckWarmup(HTTPRequest* req)\n{\n    std::string statusmessage;\n    if (RPCIsInWarmup(&statusmessage))\n         return RESTERR(req, HTTP_SERVICE_UNAVAILABLE, \"Service temporarily unavailable: \" + statusmessage);\n    return true;\n}\n\nstatic bool rest_headers(HTTPRequest* req,\n                         const std::string& strURIPart)\n{\n    if (!CheckWarmup(req))\n        return false;\n    std::string param;\n    const RetFormat rf = ParseDataFormat(param, strURIPart);\n    std::vector<std::string> path;\n    boost::split(path, param, boost::is_any_of(\"/\"));\n\n    if (path.size() != 2)\n        return RESTERR(req, HTTP_BAD_REQUEST, \"No header count specified. Use /rest/headers/<count>/<hash>.<ext>.\");\n\n    long count = strtol(path[0].c_str(), nullptr, 10);\n    if (count < 1 || count > 2000)\n        return RESTERR(req, HTTP_BAD_REQUEST, \"Header count out of range: \" + path[0]);\n\n    std::string hashStr = path[1];\n    uint256 hash;\n    if (!ParseHashStr(hashStr, hash))\n        return RESTERR(req, HTTP_BAD_REQUEST, \"Invalid hash: \" + hashStr);\n\n    std::vector<const CBlockIndex *> headers;\n    headers.reserve(count);\n    {\n        LOCK(cs_main);\n        BlockMap::const_iterator it = mapBlockIndex.find(hash);\n        const CBlockIndex *pindex = (it != mapBlockIndex.end()) ? it->second : nullptr;\n        while (pindex != nullptr && chainActive.Contains(pindex)) {\n            headers.push_back(pindex);\n            if (headers.size() == (unsigned long)count)\n                break;\n            pindex = chainActive.Next(pindex);\n        }\n    }\n\n    CDataStream ssHeader(SER_NETWORK, PROTOCOL_VERSION);\n    for (const CBlockIndex *pindex : headers) {\n        ssHeader << pindex->GetBlockHeader();\n    }\n\n    switch (rf) {\n    case RF_BINARY: {\n        std::string binaryHeader = ssHeader.str();\n        req->WriteHeader(\"Content-Type\", \"application/octet-stream\");\n        req->WriteReply(HTTP_OK, binaryHeader);\n        return true;\n    }\n\n    case RF_HEX: {\n        std::string strHex = HexStr(ssHeader.begin(), ssHeader.end()) + \"\\n\";\n        req->WriteHeader(\"Content-Type\", \"text/plain\");\n        req->WriteReply(HTTP_OK, strHex);\n        return true;\n    }\n    case RF_JSON: {\n        UniValue jsonHeaders(UniValue::VARR);\n        {\n            LOCK(cs_main);\n            for (const CBlockIndex *pindex : headers) {\n                jsonHeaders.push_back(blockheaderToJSON(pindex));\n            }\n        }\n        std::string strJSON = jsonHeaders.write() + \"\\n\";\n        req->WriteHeader(\"Content-Type\", \"application/json\");\n        req->WriteReply(HTTP_OK, strJSON);\n        return true;\n    }\n    default: {\n        return RESTERR(req, HTTP_NOT_FOUND, \"output format not found (available: .bin, .hex)\");\n    }\n    }\n}\n\nstatic bool rest_block(HTTPRequest* req,\n                       const std::string& strURIPart,\n                       bool showTxDetails)\n{\n    if (!CheckWarmup(req))\n        return false;\n    std::string hashStr;\n    const RetFormat rf = ParseDataFormat(hashStr, strURIPart);\n\n    uint256 hash;\n    if (!ParseHashStr(hashStr, hash))\n        return RESTERR(req, HTTP_BAD_REQUEST, \"Invalid hash: \" + hashStr);\n\n    CBlock block;\n    CBlockIndex* pblockindex = nullptr;\n    {\n        LOCK(cs_main);\n        if (mapBlockIndex.count(hash) == 0)\n            return RESTERR(req, HTTP_NOT_FOUND, hashStr + \" not found\");\n\n        pblockindex = mapBlockIndex[hash];\n        if (fHavePruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0)\n            return RESTERR(req, HTTP_NOT_FOUND, hashStr + \" not available (pruned data)\");\n\n        if (!ReadBlockFromDisk(block, pblockindex, Params().GetConsensus()))\n            return RESTERR(req, HTTP_NOT_FOUND, hashStr + \" not found\");\n    }\n\n    CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());\n    ssBlock << block;\n\n    switch (rf) {\n    case RF_BINARY: {\n        std::string binaryBlock = ssBlock.str();\n        req->WriteHeader(\"Content-Type\", \"application/octet-stream\");\n        req->WriteReply(HTTP_OK, binaryBlock);\n        return true;\n    }\n\n    case RF_HEX: {\n        std::string strHex = HexStr(ssBlock.begin(), ssBlock.end()) + \"\\n\";\n        req->WriteHeader(\"Content-Type\", \"text/plain\");\n        req->WriteReply(HTTP_OK, strHex);\n        return true;\n    }\n\n    case RF_JSON: {\n        UniValue objBlock;\n        {\n            LOCK(cs_main);\n            objBlock = blockToJSON(block, pblockindex, showTxDetails);\n        }\n        std::string strJSON = objBlock.write() + \"\\n\";\n        req->WriteHeader(\"Content-Type\", \"application/json\");\n        req->WriteReply(HTTP_OK, strJSON);\n        return true;\n    }\n\n    default: {\n        return RESTERR(req, HTTP_NOT_FOUND, \"output format not found (available: \" + AvailableDataFormatsString() + \")\");\n    }\n    }\n}\n\nstatic bool rest_block_extended(HTTPRequest* req, const std::string& strURIPart)\n{\n    return rest_block(req, strURIPart, true);\n}\n\nstatic bool rest_block_notxdetails(HTTPRequest* req, const std::string& strURIPart)\n{\n    return rest_block(req, strURIPart, false);\n}\n\n// A bit of a hack - dependency on a function defined in rpc/blockchain.cpp\nUniValue getblockchaininfo(const JSONRPCRequest& request);\n\nstatic bool rest_chaininfo(HTTPRequest* req, const std::string& strURIPart)\n{\n    if (!CheckWarmup(req))\n        return false;\n    std::string param;\n    const RetFormat rf = ParseDataFormat(param, strURIPart);\n\n    switch (rf) {\n    case RF_JSON: {\n        JSONRPCRequest jsonRequest;\n        jsonRequest.params = UniValue(UniValue::VARR);\n        UniValue chainInfoObject = getblockchaininfo(jsonRequest);\n        std::string strJSON = chainInfoObject.write() + \"\\n\";\n        req->WriteHeader(\"Content-Type\", \"application/json\");\n        req->WriteReply(HTTP_OK, strJSON);\n        return true;\n    }\n    default: {\n        return RESTERR(req, HTTP_NOT_FOUND, \"output format not found (available: json)\");\n    }\n    }\n}\n\nstatic bool rest_mempool_info(HTTPRequest* req, const std::string& strURIPart)\n{\n    if (!CheckWarmup(req))\n        return false;\n    std::string param;\n    const RetFormat rf = ParseDataFormat(param, strURIPart);\n\n    switch (rf) {\n    case RF_JSON: {\n        UniValue mempoolInfoObject = mempoolInfoToJSON();\n\n        std::string strJSON = mempoolInfoObject.write() + \"\\n\";\n        req->WriteHeader(\"Content-Type\", \"application/json\");\n        req->WriteReply(HTTP_OK, strJSON);\n        return true;\n    }\n    default: {\n        return RESTERR(req, HTTP_NOT_FOUND, \"output format not found (available: json)\");\n    }\n    }\n}\n\nstatic bool rest_mempool_contents(HTTPRequest* req, const std::string& strURIPart)\n{\n    if (!CheckWarmup(req))\n        return false;\n    std::string param;\n    const RetFormat rf = ParseDataFormat(param, strURIPart);\n\n    switch (rf) {\n    case RF_JSON: {\n        UniValue mempoolObject = mempoolToJSON(true);\n\n        std::string strJSON = mempoolObject.write() + \"\\n\";\n        req->WriteHeader(\"Content-Type\", \"application/json\");\n        req->WriteReply(HTTP_OK, strJSON);\n        return true;\n    }\n    default: {\n        return RESTERR(req, HTTP_NOT_FOUND, \"output format not found (available: json)\");\n    }\n    }\n}\n\nstatic bool rest_tx(HTTPRequest* req, const std::string& strURIPart)\n{\n    if (!CheckWarmup(req))\n        return false;\n    std::string hashStr;\n    const RetFormat rf = ParseDataFormat(hashStr, strURIPart);\n\n    uint256 hash;\n    if (!ParseHashStr(hashStr, hash))\n        return RESTERR(req, HTTP_BAD_REQUEST, \"Invalid hash: \" + hashStr);\n\n    CTransactionRef tx;\n    uint256 hashBlock = uint256();\n    if (!GetTransaction(hash, tx, Params().GetConsensus(), hashBlock, true))\n        return RESTERR(req, HTTP_NOT_FOUND, hashStr + \" not found\");\n\n    CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());\n    ssTx << tx;\n\n    switch (rf) {\n    case RF_BINARY: {\n        std::string binaryTx = ssTx.str();\n        req->WriteHeader(\"Content-Type\", \"application/octet-stream\");\n        req->WriteReply(HTTP_OK, binaryTx);\n        return true;\n    }\n\n    case RF_HEX: {\n        std::string strHex = HexStr(ssTx.begin(), ssTx.end()) + \"\\n\";\n        req->WriteHeader(\"Content-Type\", \"text/plain\");\n        req->WriteReply(HTTP_OK, strHex);\n        return true;\n    }\n\n    case RF_JSON: {\n        UniValue objTx(UniValue::VOBJ);\n        TxToUniv(*tx, hashBlock, objTx);\n        std::string strJSON = objTx.write() + \"\\n\";\n        req->WriteHeader(\"Content-Type\", \"application/json\");\n        req->WriteReply(HTTP_OK, strJSON);\n        return true;\n    }\n\n    default: {\n        return RESTERR(req, HTTP_NOT_FOUND, \"output format not found (available: \" + AvailableDataFormatsString() + \")\");\n    }\n    }\n}\n\nstatic bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)\n{\n    if (!CheckWarmup(req))\n        return false;\n    std::string param;\n    const RetFormat rf = ParseDataFormat(param, strURIPart);\n\n    std::vector<std::string> uriParts;\n    if (param.length() > 1)\n    {\n        std::string strUriParams = param.substr(1);\n        boost::split(uriParts, strUriParams, boost::is_any_of(\"/\"));\n    }\n\n    // throw exception in case of an empty request\n    std::string strRequestMutable = req->ReadBody();\n    if (strRequestMutable.length() == 0 && uriParts.size() == 0)\n        return RESTERR(req, HTTP_BAD_REQUEST, \"Error: empty request\");\n\n    bool fInputParsed = false;\n    bool fCheckMemPool = false;\n    std::vector<COutPoint> vOutPoints;\n\n    // parse/deserialize input\n    // input-format = output-format, rest/getutxos/bin requires binary input, gives binary output, ...\n\n    if (uriParts.size() > 0)\n    {\n        //inputs is sent over URI scheme (/rest/getutxos/checkmempool/txid1-n/txid2-n/...)\n        if (uriParts[0] == \"checkmempool\") fCheckMemPool = true;\n\n        for (size_t i = (fCheckMemPool) ? 1 : 0; i < uriParts.size(); i++)\n        {\n            uint256 txid;\n            int32_t nOutput;\n            std::string strTxid = uriParts[i].substr(0, uriParts[i].find('-'));\n            std::string strOutput = uriParts[i].substr(uriParts[i].find('-')+1);\n\n            if (!ParseInt32(strOutput, &nOutput) || !IsHex(strTxid))\n                return RESTERR(req, HTTP_BAD_REQUEST, \"Parse error\");\n\n            txid.SetHex(strTxid);\n            vOutPoints.push_back(COutPoint(txid, (uint32_t)nOutput));\n        }\n\n        if (vOutPoints.size() > 0)\n            fInputParsed = true;\n        else\n            return RESTERR(req, HTTP_BAD_REQUEST, \"Error: empty request\");\n    }\n\n    switch (rf) {\n    case RF_HEX: {\n        // convert hex to bin, continue then with bin part\n        std::vector<unsigned char> strRequestV = ParseHex(strRequestMutable);\n        strRequestMutable.assign(strRequestV.begin(), strRequestV.end());\n    }\n\n    case RF_BINARY: {\n        try {\n            //deserialize only if user sent a request\n            if (strRequestMutable.size() > 0)\n            {\n                if (fInputParsed) //don't allow sending input over URI and HTTP RAW DATA\n                    return RESTERR(req, HTTP_BAD_REQUEST, \"Combination of URI scheme inputs and raw post data is not allowed\");\n\n                CDataStream oss(SER_NETWORK, PROTOCOL_VERSION);\n                oss << strRequestMutable;\n                oss >> fCheckMemPool;\n                oss >> vOutPoints;\n            }\n        } catch (const std::ios_base::failure& e) {\n            // abort in case of unreadable binary data\n            return RESTERR(req, HTTP_BAD_REQUEST, \"Parse error\");\n        }\n        break;\n    }\n\n    case RF_JSON: {\n        if (!fInputParsed)\n            return RESTERR(req, HTTP_BAD_REQUEST, \"Error: empty request\");\n        break;\n    }\n    default: {\n        return RESTERR(req, HTTP_NOT_FOUND, \"output format not found (available: \" + AvailableDataFormatsString() + \")\");\n    }\n    }\n\n    // limit max outpoints\n    if (vOutPoints.size() > MAX_GETUTXOS_OUTPOINTS)\n        return RESTERR(req, HTTP_BAD_REQUEST, strprintf(\"Error: max outpoints exceeded (max: %d, tried: %d)\", MAX_GETUTXOS_OUTPOINTS, vOutPoints.size()));\n\n    // check spentness and form a bitmap (as well as a JSON capable human-readable string representation)\n    std::vector<unsigned char> bitmap;\n    std::vector<CCoin> outs;\n    std::string bitmapStringRepresentation;\n    std::vector<bool> hits;\n    bitmap.resize((vOutPoints.size() + 7) / 8);\n    {\n        LOCK2(cs_main, mempool.cs);\n\n        CCoinsView viewDummy;\n        CCoinsViewCache view(&viewDummy);\n\n        CCoinsViewCache& viewChain = *pcoinsTip;\n        CCoinsViewMemPool viewMempool(&viewChain, mempool);\n\n        if (fCheckMemPool)\n            view.SetBackend(viewMempool); // switch cache backend to db+mempool in case user likes to query mempool\n\n        for (size_t i = 0; i < vOutPoints.size(); i++) {\n            bool hit = false;\n            Coin coin;\n            if (view.GetCoin(vOutPoints[i], coin) && !mempool.isSpent(vOutPoints[i])) {\n                hit = true;\n                outs.emplace_back(std::move(coin));\n            }\n\n            hits.push_back(hit);\n            bitmapStringRepresentation.append(hit ? \"1\" : \"0\"); // form a binary string representation (human-readable for json output)\n            bitmap[i / 8] |= ((uint8_t)hit) << (i % 8);\n        }\n    }\n\n    switch (rf) {\n    case RF_BINARY: {\n        // serialize data\n        // use exact same output as mentioned in Bip64\n        CDataStream ssGetUTXOResponse(SER_NETWORK, PROTOCOL_VERSION);\n        ssGetUTXOResponse << chainActive.Height() << chainActive.Tip()->GetBlockHash() << bitmap << outs;\n        std::string ssGetUTXOResponseString = ssGetUTXOResponse.str();\n\n        req->WriteHeader(\"Content-Type\", \"application/octet-stream\");\n        req->WriteReply(HTTP_OK, ssGetUTXOResponseString);\n        return true;\n    }\n\n    case RF_HEX: {\n        CDataStream ssGetUTXOResponse(SER_NETWORK, PROTOCOL_VERSION);\n        ssGetUTXOResponse << chainActive.Height() << chainActive.Tip()->GetBlockHash() << bitmap << outs;\n        std::string strHex = HexStr(ssGetUTXOResponse.begin(), ssGetUTXOResponse.end()) + \"\\n\";\n\n        req->WriteHeader(\"Content-Type\", \"text/plain\");\n        req->WriteReply(HTTP_OK, strHex);\n        return true;\n    }\n\n    case RF_JSON: {\n        UniValue objGetUTXOResponse(UniValue::VOBJ);\n\n        // pack in some essentials\n        // use more or less the same output as mentioned in Bip64\n        objGetUTXOResponse.push_back(Pair(\"chainHeight\", chainActive.Height()));\n        objGetUTXOResponse.push_back(Pair(\"chaintipHash\", chainActive.Tip()->GetBlockHash().GetHex()));\n        objGetUTXOResponse.push_back(Pair(\"bitmap\", bitmapStringRepresentation));\n\n        UniValue utxos(UniValue::VARR);\n        for (const CCoin& coin : outs) {\n            UniValue utxo(UniValue::VOBJ);\n            utxo.push_back(Pair(\"height\", (int32_t)coin.nHeight));\n            utxo.push_back(Pair(\"value\", ValueFromAmount(coin.out.nValue)));\n\n            // include the script in a json output\n            UniValue o(UniValue::VOBJ);\n            ScriptPubKeyToUniv(coin.out.scriptPubKey, o, true);\n            utxo.push_back(Pair(\"scriptPubKey\", o));\n            utxos.push_back(utxo);\n        }\n        objGetUTXOResponse.push_back(Pair(\"utxos\", utxos));\n\n        // return json string\n        std::string strJSON = objGetUTXOResponse.write() + \"\\n\";\n        req->WriteHeader(\"Content-Type\", \"application/json\");\n        req->WriteReply(HTTP_OK, strJSON);\n        return true;\n    }\n    default: {\n        return RESTERR(req, HTTP_NOT_FOUND, \"output format not found (available: \" + AvailableDataFormatsString() + \")\");\n    }\n    }\n}\n\nstatic const struct {\n    const char* prefix;\n    bool (*handler)(HTTPRequest* req, const std::string& strReq);\n} uri_prefixes[] = {\n      {\"/rest/tx/\", rest_tx},\n      {\"/rest/block/notxdetails/\", rest_block_notxdetails},\n      {\"/rest/block/\", rest_block_extended},\n      {\"/rest/chaininfo\", rest_chaininfo},\n      {\"/rest/mempool/info\", rest_mempool_info},\n      {\"/rest/mempool/contents\", rest_mempool_contents},\n      {\"/rest/headers/\", rest_headers},\n      {\"/rest/getutxos\", rest_getutxos},\n};\n\nbool StartREST()\n{\n    for (unsigned int i = 0; i < ARRAYLEN(uri_prefixes); i++)\n        RegisterHTTPHandler(uri_prefixes[i].prefix, false, uri_prefixes[i].handler);\n    return true;\n}\n\nvoid InterruptREST()\n{\n}\n\nvoid StopREST()\n{\n    for (unsigned int i = 0; i < ARRAYLEN(uri_prefixes); i++)\n        UnregisterHTTPHandler(uri_prefixes[i].prefix, false);\n}\n"
  },
  {
    "path": "src/reverse_iterator.h",
    "content": "// Taken from https://gist.github.com/arvidsson/7231973\n\n#ifndef BITCOIN_REVERSE_ITERATOR_H\n#define BITCOIN_REVERSE_ITERATOR_H\n\n/**\n * Template used for reverse iteration in C++11 range-based for loops.\n * \n *   std::vector<int> v = {1, 2, 3, 4, 5};\n *   for (auto x : reverse_iterate(v))\n *       std::cout << x << \" \";\n */\n\ntemplate <typename T>\nclass reverse_range\n{\n    T &m_x;\n    \npublic:\n    explicit reverse_range(T &x) : m_x(x) {}\n    \n    auto begin() const -> decltype(this->m_x.rbegin())\n    {\n        return m_x.rbegin();\n    }\n    \n    auto end() const -> decltype(this->m_x.rend())\n    {\n        return m_x.rend();\n    }\n};\n \ntemplate <typename T>\nreverse_range<T> reverse_iterate(T &x)\n{\n    return reverse_range<T>(x);\n}\n\n#endif // BITCOIN_REVERSE_ITERATOR_H\n"
  },
  {
    "path": "src/reverselock.h",
    "content": "// Copyright (c) 2015-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_REVERSELOCK_H\n#define BITCOIN_REVERSELOCK_H\n\n/**\n * An RAII-style reverse lock. Unlocks on construction and locks on destruction.\n */\ntemplate<typename Lock>\nclass reverse_lock\n{\npublic:\n\n    explicit reverse_lock(Lock& _lock) : lock(_lock) {\n        _lock.unlock();\n        _lock.swap(templock);\n    }\n\n    ~reverse_lock() {\n        templock.lock();\n        templock.swap(lock);\n    }\n\nprivate:\n    reverse_lock(reverse_lock const&);\n    reverse_lock& operator=(reverse_lock const&);\n\n    Lock& lock;\n    Lock templock;\n};\n\n#endif // BITCOIN_REVERSELOCK_H\n"
  },
  {
    "path": "src/rpc/blockchain.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <rpc/blockchain.h>\n\n#include <amount.h>\n#include <chain.h>\n#include <chainparams.h>\n#include <checkpoints.h>\n#include <coins.h>\n#include <consensus/validation.h>\n#include <validation.h>\n#include <core_io.h>\n#include <policy/feerate.h>\n#include <policy/policy.h>\n#include <primitives/transaction.h>\n#include <rpc/server.h>\n#include <streams.h>\n#include <sync.h>\n#include <txdb.h>\n#include <txmempool.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <hash.h>\n#include <validationinterface.h>\n#include <warnings.h>\n\n#include <stdint.h>\n\n#include <univalue.h>\n\n#include <boost/thread/thread.hpp> // boost::thread::interrupt\n\n#include <memory>\n#include <mutex>\n#include <condition_variable>\n\nstruct CUpdatedBlock\n{\n    uint256 hash;\n    int height;\n};\n\nstatic std::mutex cs_blockchange;\nstatic std::condition_variable cond_blockchange;\nstatic CUpdatedBlock latestblock;\n\nextern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry);\n\n/* Calculate the difficulty for a given block index,\n * or the block index of the given chain.\n */\ndouble GetDifficulty(const CChain& chain, const CBlockIndex* blockindex)\n{\n    if (blockindex == nullptr)\n    {\n        if (chain.Tip() == nullptr)\n            return 1.0;\n        else\n            blockindex = chain.Tip();\n    }\n\n    int nShift = (blockindex->nBits >> 24) & 0xff;\n    double dDiff =\n        (double)0x0000ffff / (double)(blockindex->nBits & 0x00ffffff);\n\n    while (nShift < 29)\n    {\n        dDiff *= 256.0;\n        nShift++;\n    }\n    while (nShift > 29)\n    {\n        dDiff /= 256.0;\n        nShift--;\n    }\n\n    return dDiff;\n}\n\ndouble GetDifficulty(const CBlockIndex* blockindex)\n{\n    return GetDifficulty(chainActive, blockindex);\n}\n\nUniValue blockheaderToJSON(const CBlockIndex* blockindex)\n{\n    AssertLockHeld(cs_main);\n    UniValue result(UniValue::VOBJ);\n    result.push_back(Pair(\"hash\", blockindex->GetBlockHash().GetHex()));\n    int confirmations = -1;\n    // Only report confirmations if the block is on the main chain\n    if (chainActive.Contains(blockindex))\n        confirmations = chainActive.Height() - blockindex->nHeight + 1;\n    result.push_back(Pair(\"confirmations\", confirmations));\n    result.push_back(Pair(\"height\", blockindex->nHeight));\n    result.push_back(Pair(\"version\", blockindex->nVersion));\n    result.push_back(Pair(\"versionHex\", strprintf(\"%08x\", blockindex->nVersion)));\n    result.push_back(Pair(\"merkleroot\", blockindex->hashMerkleRoot.GetHex()));\n    result.push_back(Pair(\"time\", (int64_t)blockindex->nTime));\n    result.push_back(Pair(\"mediantime\", (int64_t)blockindex->GetMedianTimePast()));\n    result.push_back(Pair(\"nonce\", (uint64_t)blockindex->nNonce));\n    result.push_back(Pair(\"bits\", strprintf(\"%08x\", blockindex->nBits)));\n    result.push_back(Pair(\"difficulty\", GetDifficulty(blockindex)));\n    result.push_back(Pair(\"chainwork\", blockindex->nChainWork.GetHex()));\n    result.push_back(Pair(\"nTx\", (uint64_t)blockindex->nTx));\n\n    if (blockindex->pprev)\n        result.push_back(Pair(\"previousblockhash\", blockindex->pprev->GetBlockHash().GetHex()));\n    CBlockIndex *pnext = chainActive.Next(blockindex);\n    if (pnext)\n        result.push_back(Pair(\"nextblockhash\", pnext->GetBlockHash().GetHex()));\n    return result;\n}\n\nUniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails)\n{\n    AssertLockHeld(cs_main);\n    UniValue result(UniValue::VOBJ);\n    result.push_back(Pair(\"hash\", blockindex->GetBlockHash().GetHex()));\n    int confirmations = -1;\n    // Only report confirmations if the block is on the main chain\n    if (chainActive.Contains(blockindex))\n        confirmations = chainActive.Height() - blockindex->nHeight + 1;\n    result.push_back(Pair(\"confirmations\", confirmations));\n    result.push_back(Pair(\"strippedsize\", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS)));\n    result.push_back(Pair(\"size\", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION)));\n    result.push_back(Pair(\"weight\", (int)::GetBlockWeight(block)));\n    result.push_back(Pair(\"height\", blockindex->nHeight));\n    result.push_back(Pair(\"version\", block.nVersion));\n    result.push_back(Pair(\"versionHex\", strprintf(\"%08x\", block.nVersion)));\n    result.push_back(Pair(\"merkleroot\", block.hashMerkleRoot.GetHex()));\n    UniValue txs(UniValue::VARR);\n    for(const auto& tx : block.vtx)\n    {\n        if(txDetails)\n        {\n            UniValue objTx(UniValue::VOBJ);\n            TxToUniv(*tx, uint256(), objTx, true, RPCSerializationFlags());\n            txs.push_back(objTx);\n        }\n        else\n            txs.push_back(tx->GetHash().GetHex());\n    }\n    result.push_back(Pair(\"tx\", txs));\n    result.push_back(Pair(\"time\", block.GetBlockTime()));\n    result.push_back(Pair(\"mediantime\", (int64_t)blockindex->GetMedianTimePast()));\n    result.push_back(Pair(\"nonce\", (uint64_t)block.nNonce));\n    result.push_back(Pair(\"bits\", strprintf(\"%08x\", block.nBits)));\n    result.push_back(Pair(\"difficulty\", GetDifficulty(blockindex)));\n    result.push_back(Pair(\"chainwork\", blockindex->nChainWork.GetHex()));\n    result.push_back(Pair(\"nTx\", (uint64_t)blockindex->nTx));\n\n    if (blockindex->pprev)\n        result.push_back(Pair(\"previousblockhash\", blockindex->pprev->GetBlockHash().GetHex()));\n    CBlockIndex *pnext = chainActive.Next(blockindex);\n    if (pnext)\n        result.push_back(Pair(\"nextblockhash\", pnext->GetBlockHash().GetHex()));\n    return result;\n}\n\nUniValue getblockcount(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getblockcount\\n\"\n            \"\\nReturns the number of blocks in the longest blockchain.\\n\"\n            \"\\nResult:\\n\"\n            \"n    (numeric) The current block count\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getblockcount\", \"\")\n            + HelpExampleRpc(\"getblockcount\", \"\")\n        );\n\n    LOCK(cs_main);\n    return chainActive.Height();\n}\n\nUniValue getbestblockhash(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getbestblockhash\\n\"\n            \"\\nReturns the hash of the best (tip) block in the longest blockchain.\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"hex\\\"      (string) the block hash hex encoded\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getbestblockhash\", \"\")\n            + HelpExampleRpc(\"getbestblockhash\", \"\")\n        );\n\n    LOCK(cs_main);\n    return chainActive.Tip()->GetBlockHash().GetHex();\n}\n\nvoid RPCNotifyBlockChange(bool ibd, const CBlockIndex * pindex)\n{\n    if(pindex) {\n        std::lock_guard<std::mutex> lock(cs_blockchange);\n        latestblock.hash = pindex->GetBlockHash();\n        latestblock.height = pindex->nHeight;\n    }\n    cond_blockchange.notify_all();\n}\n\nUniValue waitfornewblock(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() > 1)\n        throw std::runtime_error(\n            \"waitfornewblock (timeout)\\n\"\n            \"\\nWaits for a specific new block and returns useful info about it.\\n\"\n            \"\\nReturns the current block on timeout or exit.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. timeout (int, optional, default=0) Time in milliseconds to wait for a response. 0 indicates no timeout.\\n\"\n            \"\\nResult:\\n\"\n            \"{                           (json object)\\n\"\n            \"  \\\"hash\\\" : {       (string) The blockhash\\n\"\n            \"  \\\"height\\\" : {     (int) Block height\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"waitfornewblock\", \"1000\")\n            + HelpExampleRpc(\"waitfornewblock\", \"1000\")\n        );\n    int timeout = 0;\n    if (!request.params[0].isNull())\n        timeout = request.params[0].get_int();\n\n    CUpdatedBlock block;\n    {\n        std::unique_lock<std::mutex> lock(cs_blockchange);\n        block = latestblock;\n        if(timeout)\n            cond_blockchange.wait_for(lock, std::chrono::milliseconds(timeout), [&block]{return latestblock.height != block.height || latestblock.hash != block.hash || !IsRPCRunning(); });\n        else\n            cond_blockchange.wait(lock, [&block]{return latestblock.height != block.height || latestblock.hash != block.hash || !IsRPCRunning(); });\n        block = latestblock;\n    }\n    UniValue ret(UniValue::VOBJ);\n    ret.push_back(Pair(\"hash\", block.hash.GetHex()));\n    ret.push_back(Pair(\"height\", block.height));\n    return ret;\n}\n\nUniValue waitforblock(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"waitforblock <blockhash> (timeout)\\n\"\n            \"\\nWaits for a specific new block and returns useful info about it.\\n\"\n            \"\\nReturns the current block on timeout or exit.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"blockhash\\\" (required, string) Block hash to wait for.\\n\"\n            \"2. timeout       (int, optional, default=0) Time in milliseconds to wait for a response. 0 indicates no timeout.\\n\"\n            \"\\nResult:\\n\"\n            \"{                           (json object)\\n\"\n            \"  \\\"hash\\\" : {       (string) The blockhash\\n\"\n            \"  \\\"height\\\" : {     (int) Block height\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"waitforblock\", \"\\\"0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862\\\", 1000\")\n            + HelpExampleRpc(\"waitforblock\", \"\\\"0000000000079f8ef3d2c688c244eb7a4570b24c9ed7b4a8c619eb02596f8862\\\", 1000\")\n        );\n    int timeout = 0;\n\n    uint256 hash = uint256S(request.params[0].get_str());\n\n    if (!request.params[1].isNull())\n        timeout = request.params[1].get_int();\n\n    CUpdatedBlock block;\n    {\n        std::unique_lock<std::mutex> lock(cs_blockchange);\n        if(timeout)\n            cond_blockchange.wait_for(lock, std::chrono::milliseconds(timeout), [&hash]{return latestblock.hash == hash || !IsRPCRunning();});\n        else\n            cond_blockchange.wait(lock, [&hash]{return latestblock.hash == hash || !IsRPCRunning(); });\n        block = latestblock;\n    }\n\n    UniValue ret(UniValue::VOBJ);\n    ret.push_back(Pair(\"hash\", block.hash.GetHex()));\n    ret.push_back(Pair(\"height\", block.height));\n    return ret;\n}\n\nUniValue waitforblockheight(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"waitforblockheight <height> (timeout)\\n\"\n            \"\\nWaits for (at least) block height and returns the height and hash\\n\"\n            \"of the current tip.\\n\"\n            \"\\nReturns the current block on timeout or exit.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. height  (required, int) Block height to wait for (int)\\n\"\n            \"2. timeout (int, optional, default=0) Time in milliseconds to wait for a response. 0 indicates no timeout.\\n\"\n            \"\\nResult:\\n\"\n            \"{                           (json object)\\n\"\n            \"  \\\"hash\\\" : {       (string) The blockhash\\n\"\n            \"  \\\"height\\\" : {     (int) Block height\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"waitforblockheight\", \"\\\"100\\\", 1000\")\n            + HelpExampleRpc(\"waitforblockheight\", \"\\\"100\\\", 1000\")\n        );\n    int timeout = 0;\n\n    int height = request.params[0].get_int();\n\n    if (!request.params[1].isNull())\n        timeout = request.params[1].get_int();\n\n    CUpdatedBlock block;\n    {\n        std::unique_lock<std::mutex> lock(cs_blockchange);\n        if(timeout)\n            cond_blockchange.wait_for(lock, std::chrono::milliseconds(timeout), [&height]{return latestblock.height >= height || !IsRPCRunning();});\n        else\n            cond_blockchange.wait(lock, [&height]{return latestblock.height >= height || !IsRPCRunning(); });\n        block = latestblock;\n    }\n    UniValue ret(UniValue::VOBJ);\n    ret.push_back(Pair(\"hash\", block.hash.GetHex()));\n    ret.push_back(Pair(\"height\", block.height));\n    return ret;\n}\n\nUniValue syncwithvalidationinterfacequeue(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() > 0) {\n        throw std::runtime_error(\n            \"syncwithvalidationinterfacequeue\\n\"\n            \"\\nWaits for the validation interface queue to catch up on everything that was there when we entered this function.\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"syncwithvalidationinterfacequeue\",\"\")\n            + HelpExampleRpc(\"syncwithvalidationinterfacequeue\",\"\")\n        );\n    }\n    SyncWithValidationInterfaceQueue();\n    return NullUniValue;\n}\n\nUniValue getdifficulty(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getdifficulty\\n\"\n            \"\\nReturns the proof-of-work difficulty as a multiple of the minimum difficulty.\\n\"\n            \"\\nResult:\\n\"\n            \"n.nnn       (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getdifficulty\", \"\")\n            + HelpExampleRpc(\"getdifficulty\", \"\")\n        );\n\n    LOCK(cs_main);\n    return GetDifficulty();\n}\n\nstd::string EntryDescriptionString()\n{\n    return \"    \\\"size\\\" : n,             (numeric) virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted.\\n\"\n           \"    \\\"fee\\\" : n,              (numeric) transaction fee in \" + CURRENCY_UNIT + \"\\n\"\n           \"    \\\"modifiedfee\\\" : n,      (numeric) transaction fee with fee deltas used for mining priority\\n\"\n           \"    \\\"time\\\" : n,             (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\\n\"\n           \"    \\\"height\\\" : n,           (numeric) block height when transaction entered pool\\n\"\n           \"    \\\"descendantcount\\\" : n,  (numeric) number of in-mempool descendant transactions (including this one)\\n\"\n           \"    \\\"descendantsize\\\" : n,   (numeric) virtual transaction size of in-mempool descendants (including this one)\\n\"\n           \"    \\\"descendantfees\\\" : n,   (numeric) modified fees (see above) of in-mempool descendants (including this one)\\n\"\n           \"    \\\"ancestorcount\\\" : n,    (numeric) number of in-mempool ancestor transactions (including this one)\\n\"\n           \"    \\\"ancestorsize\\\" : n,     (numeric) virtual transaction size of in-mempool ancestors (including this one)\\n\"\n           \"    \\\"ancestorfees\\\" : n,     (numeric) modified fees (see above) of in-mempool ancestors (including this one)\\n\"\n           \"    \\\"wtxid\\\" : hash,         (string) hash of serialized transaction, including witness data\\n\"\n           \"    \\\"depends\\\" : [           (array) unconfirmed transactions used as inputs for this transaction\\n\"\n           \"        \\\"transactionid\\\",    (string) parent transaction id\\n\"\n           \"       ... ]\\n\";\n}\n\nvoid entryToJSON(UniValue &info, const CTxMemPoolEntry &e)\n{\n    AssertLockHeld(mempool.cs);\n\n    info.push_back(Pair(\"size\", (int)e.GetTxSize()));\n    info.push_back(Pair(\"fee\", ValueFromAmount(e.GetFee())));\n    info.push_back(Pair(\"modifiedfee\", ValueFromAmount(e.GetModifiedFee())));\n    info.push_back(Pair(\"time\", e.GetTime()));\n    info.push_back(Pair(\"height\", (int)e.GetHeight()));\n    info.push_back(Pair(\"descendantcount\", e.GetCountWithDescendants()));\n    info.push_back(Pair(\"descendantsize\", e.GetSizeWithDescendants()));\n    info.push_back(Pair(\"descendantfees\", e.GetModFeesWithDescendants()));\n    info.push_back(Pair(\"ancestorcount\", e.GetCountWithAncestors()));\n    info.push_back(Pair(\"ancestorsize\", e.GetSizeWithAncestors()));\n    info.push_back(Pair(\"ancestorfees\", e.GetModFeesWithAncestors()));\n    info.push_back(Pair(\"wtxid\", mempool.vTxHashes[e.vTxHashesIdx].first.ToString()));\n    const CTransaction& tx = e.GetTx();\n    std::set<std::string> setDepends;\n    for (const CTxIn& txin : tx.vin)\n    {\n        if (mempool.exists(txin.prevout.hash))\n            setDepends.insert(txin.prevout.hash.ToString());\n    }\n\n    UniValue depends(UniValue::VARR);\n    for (const std::string& dep : setDepends)\n    {\n        depends.push_back(dep);\n    }\n\n    info.push_back(Pair(\"depends\", depends));\n}\n\nUniValue mempoolToJSON(bool fVerbose)\n{\n    if (fVerbose)\n    {\n        LOCK(mempool.cs);\n        UniValue o(UniValue::VOBJ);\n        for (const CTxMemPoolEntry& e : mempool.mapTx)\n        {\n            const uint256& hash = e.GetTx().GetHash();\n            UniValue info(UniValue::VOBJ);\n            entryToJSON(info, e);\n            o.push_back(Pair(hash.ToString(), info));\n        }\n        return o;\n    }\n    else\n    {\n        std::vector<uint256> vtxid;\n        mempool.queryHashes(vtxid);\n\n        UniValue a(UniValue::VARR);\n        for (const uint256& hash : vtxid)\n            a.push_back(hash.ToString());\n\n        return a;\n    }\n}\n\nUniValue getrawmempool(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() > 1)\n        throw std::runtime_error(\n            \"getrawmempool ( verbose )\\n\"\n            \"\\nReturns all transaction ids in memory pool as a json array of string transaction ids.\\n\"\n            \"\\nHint: use getmempoolentry to fetch a specific transaction from the mempool.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids\\n\"\n            \"\\nResult: (for verbose = false):\\n\"\n            \"[                     (json array of string)\\n\"\n            \"  \\\"transactionid\\\"     (string) The transaction id\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n            \"\\nResult: (for verbose = true):\\n\"\n            \"{                           (json object)\\n\"\n            \"  \\\"transactionid\\\" : {       (json object)\\n\"\n            + EntryDescriptionString()\n            + \"  }, ...\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getrawmempool\", \"true\")\n            + HelpExampleRpc(\"getrawmempool\", \"true\")\n        );\n\n    bool fVerbose = false;\n    if (!request.params[0].isNull())\n        fVerbose = request.params[0].get_bool();\n\n    return mempoolToJSON(fVerbose);\n}\n\nUniValue getmempoolancestors(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) {\n        throw std::runtime_error(\n            \"getmempoolancestors txid (verbose)\\n\"\n            \"\\nIf txid is in the mempool, returns all in-mempool ancestors.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"txid\\\"                 (string, required) The transaction id (must be in mempool)\\n\"\n            \"2. verbose                  (boolean, optional, default=false) True for a json object, false for array of transaction ids\\n\"\n            \"\\nResult (for verbose=false):\\n\"\n            \"[                       (json array of strings)\\n\"\n            \"  \\\"transactionid\\\"           (string) The transaction id of an in-mempool ancestor transaction\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n            \"\\nResult (for verbose=true):\\n\"\n            \"{                           (json object)\\n\"\n            \"  \\\"transactionid\\\" : {       (json object)\\n\"\n            + EntryDescriptionString()\n            + \"  }, ...\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getmempoolancestors\", \"\\\"mytxid\\\"\")\n            + HelpExampleRpc(\"getmempoolancestors\", \"\\\"mytxid\\\"\")\n            );\n    }\n\n    bool fVerbose = false;\n    if (!request.params[1].isNull())\n        fVerbose = request.params[1].get_bool();\n\n    uint256 hash = ParseHashV(request.params[0], \"parameter 1\");\n\n    LOCK(mempool.cs);\n\n    CTxMemPool::txiter it = mempool.mapTx.find(hash);\n    if (it == mempool.mapTx.end()) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Transaction not in mempool\");\n    }\n\n    CTxMemPool::setEntries setAncestors;\n    uint64_t noLimit = std::numeric_limits<uint64_t>::max();\n    std::string dummy;\n    mempool.CalculateMemPoolAncestors(*it, setAncestors, noLimit, noLimit, noLimit, noLimit, dummy, false);\n\n    if (!fVerbose) {\n        UniValue o(UniValue::VARR);\n        for (CTxMemPool::txiter ancestorIt : setAncestors) {\n            o.push_back(ancestorIt->GetTx().GetHash().ToString());\n        }\n\n        return o;\n    } else {\n        UniValue o(UniValue::VOBJ);\n        for (CTxMemPool::txiter ancestorIt : setAncestors) {\n            const CTxMemPoolEntry &e = *ancestorIt;\n            const uint256& _hash = e.GetTx().GetHash();\n            UniValue info(UniValue::VOBJ);\n            entryToJSON(info, e);\n            o.push_back(Pair(_hash.ToString(), info));\n        }\n        return o;\n    }\n}\n\nUniValue getmempooldescendants(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) {\n        throw std::runtime_error(\n            \"getmempooldescendants txid (verbose)\\n\"\n            \"\\nIf txid is in the mempool, returns all in-mempool descendants.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"txid\\\"                 (string, required) The transaction id (must be in mempool)\\n\"\n            \"2. verbose                  (boolean, optional, default=false) True for a json object, false for array of transaction ids\\n\"\n            \"\\nResult (for verbose=false):\\n\"\n            \"[                       (json array of strings)\\n\"\n            \"  \\\"transactionid\\\"           (string) The transaction id of an in-mempool descendant transaction\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n            \"\\nResult (for verbose=true):\\n\"\n            \"{                           (json object)\\n\"\n            \"  \\\"transactionid\\\" : {       (json object)\\n\"\n            + EntryDescriptionString()\n            + \"  }, ...\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getmempooldescendants\", \"\\\"mytxid\\\"\")\n            + HelpExampleRpc(\"getmempooldescendants\", \"\\\"mytxid\\\"\")\n            );\n    }\n\n    bool fVerbose = false;\n    if (!request.params[1].isNull())\n        fVerbose = request.params[1].get_bool();\n\n    uint256 hash = ParseHashV(request.params[0], \"parameter 1\");\n\n    LOCK(mempool.cs);\n\n    CTxMemPool::txiter it = mempool.mapTx.find(hash);\n    if (it == mempool.mapTx.end()) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Transaction not in mempool\");\n    }\n\n    CTxMemPool::setEntries setDescendants;\n    mempool.CalculateDescendants(it, setDescendants);\n    // CTxMemPool::CalculateDescendants will include the given tx\n    setDescendants.erase(it);\n\n    if (!fVerbose) {\n        UniValue o(UniValue::VARR);\n        for (CTxMemPool::txiter descendantIt : setDescendants) {\n            o.push_back(descendantIt->GetTx().GetHash().ToString());\n        }\n\n        return o;\n    } else {\n        UniValue o(UniValue::VOBJ);\n        for (CTxMemPool::txiter descendantIt : setDescendants) {\n            const CTxMemPoolEntry &e = *descendantIt;\n            const uint256& _hash = e.GetTx().GetHash();\n            UniValue info(UniValue::VOBJ);\n            entryToJSON(info, e);\n            o.push_back(Pair(_hash.ToString(), info));\n        }\n        return o;\n    }\n}\n\nUniValue getmempoolentry(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1) {\n        throw std::runtime_error(\n            \"getmempoolentry txid\\n\"\n            \"\\nReturns mempool data for given transaction\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"txid\\\"                   (string, required) The transaction id (must be in mempool)\\n\"\n            \"\\nResult:\\n\"\n            \"{                           (json object)\\n\"\n            + EntryDescriptionString()\n            + \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getmempoolentry\", \"\\\"mytxid\\\"\")\n            + HelpExampleRpc(\"getmempoolentry\", \"\\\"mytxid\\\"\")\n        );\n    }\n\n    uint256 hash = ParseHashV(request.params[0], \"parameter 1\");\n\n    LOCK(mempool.cs);\n\n    CTxMemPool::txiter it = mempool.mapTx.find(hash);\n    if (it == mempool.mapTx.end()) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Transaction not in mempool\");\n    }\n\n    const CTxMemPoolEntry &e = *it;\n    UniValue info(UniValue::VOBJ);\n    entryToJSON(info, e);\n    return info;\n}\n\nUniValue getblockhash(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"getblockhash height\\n\"\n            \"\\nReturns hash of block in best-block-chain at height provided.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. height         (numeric, required) The height index\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"hash\\\"         (string) The block hash\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getblockhash\", \"1000\")\n            + HelpExampleRpc(\"getblockhash\", \"1000\")\n        );\n\n    LOCK(cs_main);\n\n    int nHeight = request.params[0].get_int();\n    if (nHeight < 0 || nHeight > chainActive.Height())\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Block height out of range\");\n\n    CBlockIndex* pblockindex = chainActive[nHeight];\n    return pblockindex->GetBlockHash().GetHex();\n}\n\nUniValue getblockheader(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"getblockheader \\\"hash\\\" ( verbose )\\n\"\n            \"\\nIf verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.\\n\"\n            \"If verbose is true, returns an Object with information about blockheader <hash>.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"hash\\\"          (string, required) The block hash\\n\"\n            \"2. verbose           (boolean, optional, default=true) true for a json object, false for the hex encoded data\\n\"\n            \"\\nResult (for verbose = true):\\n\"\n            \"{\\n\"\n            \"  \\\"hash\\\" : \\\"hash\\\",     (string) the block hash (same as provided)\\n\"\n            \"  \\\"confirmations\\\" : n,   (numeric) The number of confirmations, or -1 if the block is not on the main chain\\n\"\n            \"  \\\"height\\\" : n,          (numeric) The block height or index\\n\"\n            \"  \\\"version\\\" : n,         (numeric) The block version\\n\"\n            \"  \\\"versionHex\\\" : \\\"00000000\\\", (string) The block version formatted in hexadecimal\\n\"\n            \"  \\\"merkleroot\\\" : \\\"xxxx\\\", (string) The merkle root\\n\"\n            \"  \\\"time\\\" : ttt,          (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\\n\"\n            \"  \\\"mediantime\\\" : ttt,    (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)\\n\"\n            \"  \\\"nonce\\\" : n,           (numeric) The nonce\\n\"\n            \"  \\\"bits\\\" : \\\"1d00ffff\\\", (string) The bits\\n\"\n            \"  \\\"difficulty\\\" : x.xxx,  (numeric) The difficulty\\n\"\n            \"  \\\"chainwork\\\" : \\\"0000...1f3\\\"     (string) Expected number of hashes required to produce the current chain (in hex)\\n\"\n            \"  \\\"nTx\\\" : n,             (numeric) The number of transactions in the block.\\n\"\n            \"  \\\"previousblockhash\\\" : \\\"hash\\\",  (string) The hash of the previous block\\n\"\n            \"  \\\"nextblockhash\\\" : \\\"hash\\\",      (string) The hash of the next block\\n\"\n            \"}\\n\"\n            \"\\nResult (for verbose=false):\\n\"\n            \"\\\"data\\\"             (string) A string that is serialized, hex-encoded data for block 'hash'.\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getblockheader\", \"\\\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\\\"\")\n            + HelpExampleRpc(\"getblockheader\", \"\\\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\\\"\")\n        );\n\n    LOCK(cs_main);\n\n    std::string strHash = request.params[0].get_str();\n    uint256 hash(uint256S(strHash));\n\n    bool fVerbose = true;\n    if (!request.params[1].isNull())\n        fVerbose = request.params[1].get_bool();\n\n    if (mapBlockIndex.count(hash) == 0)\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block not found\");\n\n    CBlockIndex* pblockindex = mapBlockIndex[hash];\n\n    if (!fVerbose)\n    {\n        CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION);\n        ssBlock << pblockindex->GetBlockHeader();\n        std::string strHex = HexStr(ssBlock.begin(), ssBlock.end());\n        return strHex;\n    }\n\n    return blockheaderToJSON(pblockindex);\n}\n\nUniValue getblock(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"getblock \\\"blockhash\\\" ( verbosity ) \\n\"\n            \"\\nIf verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.\\n\"\n            \"If verbosity is 1, returns an Object with information about block <hash>.\\n\"\n            \"If verbosity is 2, returns an Object with information about block <hash> and information about each transaction. \\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"blockhash\\\"          (string, required) The block hash\\n\"\n            \"2. verbosity              (numeric, optional, default=1) 0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data\\n\"\n            \"\\nResult (for verbosity = 0):\\n\"\n            \"\\\"data\\\"             (string) A string that is serialized, hex-encoded data for block 'hash'.\\n\"\n            \"\\nResult (for verbosity = 1):\\n\"\n            \"{\\n\"\n            \"  \\\"hash\\\" : \\\"hash\\\",     (string) the block hash (same as provided)\\n\"\n            \"  \\\"confirmations\\\" : n,   (numeric) The number of confirmations, or -1 if the block is not on the main chain\\n\"\n            \"  \\\"size\\\" : n,            (numeric) The block size\\n\"\n            \"  \\\"strippedsize\\\" : n,    (numeric) The block size excluding witness data\\n\"\n            \"  \\\"weight\\\" : n           (numeric) The block weight as defined in BIP 141\\n\"\n            \"  \\\"height\\\" : n,          (numeric) The block height or index\\n\"\n            \"  \\\"version\\\" : n,         (numeric) The block version\\n\"\n            \"  \\\"versionHex\\\" : \\\"00000000\\\", (string) The block version formatted in hexadecimal\\n\"\n            \"  \\\"merkleroot\\\" : \\\"xxxx\\\", (string) The merkle root\\n\"\n            \"  \\\"tx\\\" : [               (array of string) The transaction ids\\n\"\n            \"     \\\"transactionid\\\"     (string) The transaction id\\n\"\n            \"     ,...\\n\"\n            \"  ],\\n\"\n            \"  \\\"time\\\" : ttt,          (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\\n\"\n            \"  \\\"mediantime\\\" : ttt,    (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)\\n\"\n            \"  \\\"nonce\\\" : n,           (numeric) The nonce\\n\"\n            \"  \\\"bits\\\" : \\\"1d00ffff\\\", (string) The bits\\n\"\n            \"  \\\"difficulty\\\" : x.xxx,  (numeric) The difficulty\\n\"\n            \"  \\\"chainwork\\\" : \\\"xxxx\\\",  (string) Expected number of hashes required to produce the chain up to this block (in hex)\\n\"\n            \"  \\\"nTx\\\" : n,             (numeric) The number of transactions in the block.\\n\"\n            \"  \\\"previousblockhash\\\" : \\\"hash\\\",  (string) The hash of the previous block\\n\"\n            \"  \\\"nextblockhash\\\" : \\\"hash\\\"       (string) The hash of the next block\\n\"\n            \"}\\n\"\n            \"\\nResult (for verbosity = 2):\\n\"\n            \"{\\n\"\n            \"  ...,                     Same output as verbosity = 1.\\n\"\n            \"  \\\"tx\\\" : [               (array of Objects) The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 \\\"tx\\\" result.\\n\"\n            \"         ,...\\n\"\n            \"  ],\\n\"\n            \"  ,...                     Same output as verbosity = 1.\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getblock\", \"\\\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\\\"\")\n            + HelpExampleRpc(\"getblock\", \"\\\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\\\"\")\n        );\n\n    LOCK(cs_main);\n\n    std::string strHash = request.params[0].get_str();\n    uint256 hash(uint256S(strHash));\n\n    int verbosity = 1;\n    if (!request.params[1].isNull()) {\n        if(request.params[1].isNum())\n            verbosity = request.params[1].get_int();\n        else\n            verbosity = request.params[1].get_bool() ? 1 : 0;\n    }\n\n    if (mapBlockIndex.count(hash) == 0)\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block not found\");\n\n    CBlock block;\n    CBlockIndex* pblockindex = mapBlockIndex[hash];\n\n    if (fHavePruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0)\n        throw JSONRPCError(RPC_MISC_ERROR, \"Block not available (pruned data)\");\n\n    if (!ReadBlockFromDisk(block, pblockindex, Params().GetConsensus()))\n        // Block not found on disk. This could be because we have the block\n        // header in our index but don't have the block (for example if a\n        // non-whitelisted node sends us an unrequested long chain of valid\n        // blocks, we add the headers to our index, but don't accept the\n        // block).\n        throw JSONRPCError(RPC_MISC_ERROR, \"Block not found on disk\");\n\n    if (verbosity <= 0)\n    {\n        CDataStream ssBlock(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());\n        ssBlock << block;\n        std::string strHex = HexStr(ssBlock.begin(), ssBlock.end());\n        return strHex;\n    }\n\n    return blockToJSON(block, pblockindex, verbosity >= 2);\n}\n\nstruct CCoinsStats\n{\n    int nHeight;\n    uint256 hashBlock;\n    uint64_t nTransactions;\n    uint64_t nTransactionOutputs;\n    uint64_t nBogoSize;\n    uint256 hashSerialized;\n    uint64_t nDiskSize;\n    CAmount nTotalAmount;\n\n    CCoinsStats() : nHeight(0), nTransactions(0), nTransactionOutputs(0), nBogoSize(0), nDiskSize(0), nTotalAmount(0) {}\n};\n\nstatic void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash, const std::map<uint32_t, Coin>& outputs)\n{\n    assert(!outputs.empty());\n    ss << hash;\n    ss << VARINT(outputs.begin()->second.nHeight * 2 + outputs.begin()->second.fCoinBase);\n    stats.nTransactions++;\n    for (const auto output : outputs) {\n        ss << VARINT(output.first + 1);\n        ss << output.second.out.scriptPubKey;\n        ss << VARINT(output.second.out.nValue);\n        stats.nTransactionOutputs++;\n        stats.nTotalAmount += output.second.out.nValue;\n        stats.nBogoSize += 32 /* txid */ + 4 /* vout index */ + 4 /* height + coinbase */ + 8 /* amount */ +\n                           2 /* scriptPubKey len */ + output.second.out.scriptPubKey.size() /* scriptPubKey */;\n    }\n    ss << VARINT(0);\n}\n\n//! Calculate statistics about the unspent transaction output set\nstatic bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats)\n{\n    std::unique_ptr<CCoinsViewCursor> pcursor(view->Cursor());\n    assert(pcursor);\n\n    CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);\n    stats.hashBlock = pcursor->GetBestBlock();\n    {\n        LOCK(cs_main);\n        stats.nHeight = mapBlockIndex.find(stats.hashBlock)->second->nHeight;\n    }\n    ss << stats.hashBlock;\n    uint256 prevkey;\n    std::map<uint32_t, Coin> outputs;\n    while (pcursor->Valid()) {\n        boost::this_thread::interruption_point();\n        COutPoint key;\n        Coin coin;\n        if (pcursor->GetKey(key) && pcursor->GetValue(coin)) {\n            if (!outputs.empty() && key.hash != prevkey) {\n                ApplyStats(stats, ss, prevkey, outputs);\n                outputs.clear();\n            }\n            prevkey = key.hash;\n            outputs[key.n] = std::move(coin);\n        } else {\n            return error(\"%s: unable to read value\", __func__);\n        }\n        pcursor->Next();\n    }\n    if (!outputs.empty()) {\n        ApplyStats(stats, ss, prevkey, outputs);\n    }\n    stats.hashSerialized = ss.GetHash();\n    stats.nDiskSize = view->EstimateSize();\n    return true;\n}\n\nUniValue pruneblockchain(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"pruneblockchain\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"height\\\"       (numeric, required) The block height to prune up to. May be set to a discrete height, or a unix timestamp\\n\"\n            \"                  to prune blocks whose block time is at least 2 hours older than the provided timestamp.\\n\"\n            \"\\nResult:\\n\"\n            \"n    (numeric) Height of the last block pruned.\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"pruneblockchain\", \"1000\")\n            + HelpExampleRpc(\"pruneblockchain\", \"1000\"));\n\n    if (!fPruneMode)\n        throw JSONRPCError(RPC_MISC_ERROR, \"Cannot prune blocks because node is not in prune mode.\");\n\n    LOCK(cs_main);\n\n    int heightParam = request.params[0].get_int();\n    if (heightParam < 0)\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Negative block height.\");\n\n    // Height value more than a billion is too high to be a block height, and\n    // too low to be a block time (corresponds to timestamp from Sep 2001).\n    if (heightParam > 1000000000) {\n        // Add a 2 hour buffer to include blocks which might have had old timestamps\n        CBlockIndex* pindex = chainActive.FindEarliestAtLeast(heightParam - TIMESTAMP_WINDOW);\n        if (!pindex) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Could not find block with at least the specified timestamp.\");\n        }\n        heightParam = pindex->nHeight;\n    }\n\n    unsigned int height = (unsigned int) heightParam;\n    unsigned int chainHeight = (unsigned int) chainActive.Height();\n    if (chainHeight < Params().PruneAfterHeight())\n        throw JSONRPCError(RPC_MISC_ERROR, \"Blockchain is too short for pruning.\");\n    else if (height > chainHeight)\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Blockchain is shorter than the attempted prune height.\");\n    else if (height > chainHeight - MIN_BLOCKS_TO_KEEP) {\n        LogPrint(BCLog::RPC, \"Attempt to prune blocks close to the tip.  Retaining the minimum number of blocks.\");\n        height = chainHeight - MIN_BLOCKS_TO_KEEP;\n    }\n\n    PruneBlockFilesManual(height);\n    return uint64_t(height);\n}\n\nUniValue gettxoutsetinfo(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"gettxoutsetinfo\\n\"\n            \"\\nReturns statistics about the unspent transaction output set.\\n\"\n            \"Note this call may take some time.\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"height\\\":n,     (numeric) The current block height (index)\\n\"\n            \"  \\\"bestblock\\\": \\\"hex\\\",   (string) The hash of the block at the tip of the chain\\n\"\n            \"  \\\"transactions\\\": n,      (numeric) The number of transactions with unspent outputs\\n\"\n            \"  \\\"txouts\\\": n,            (numeric) The number of unspent transaction outputs\\n\"\n            \"  \\\"bogosize\\\": n,          (numeric) A meaningless metric for UTXO set size\\n\"\n            \"  \\\"hash_serialized_2\\\": \\\"hash\\\", (string) The serialized hash\\n\"\n            \"  \\\"disk_size\\\": n,         (numeric) The estimated size of the chainstate on disk\\n\"\n            \"  \\\"total_amount\\\": x.xxx          (numeric) The total amount\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"gettxoutsetinfo\", \"\")\n            + HelpExampleRpc(\"gettxoutsetinfo\", \"\")\n        );\n\n    UniValue ret(UniValue::VOBJ);\n\n    CCoinsStats stats;\n    FlushStateToDisk();\n    if (GetUTXOStats(pcoinsdbview.get(), stats)) {\n        ret.push_back(Pair(\"height\", (int64_t)stats.nHeight));\n        ret.push_back(Pair(\"bestblock\", stats.hashBlock.GetHex()));\n        ret.push_back(Pair(\"transactions\", (int64_t)stats.nTransactions));\n        ret.push_back(Pair(\"txouts\", (int64_t)stats.nTransactionOutputs));\n        ret.push_back(Pair(\"bogosize\", (int64_t)stats.nBogoSize));\n        ret.push_back(Pair(\"hash_serialized_2\", stats.hashSerialized.GetHex()));\n        ret.push_back(Pair(\"disk_size\", stats.nDiskSize));\n        ret.push_back(Pair(\"total_amount\", ValueFromAmount(stats.nTotalAmount)));\n    } else {\n        throw JSONRPCError(RPC_INTERNAL_ERROR, \"Unable to read UTXO set\");\n    }\n    return ret;\n}\n\nUniValue gettxout(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 2 || request.params.size() > 3)\n        throw std::runtime_error(\n            \"gettxout \\\"txid\\\" n ( include_mempool )\\n\"\n            \"\\nReturns details about an unspent transaction output.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"txid\\\"             (string, required) The transaction id\\n\"\n            \"2. \\\"n\\\"                (numeric, required) vout number\\n\"\n            \"3. \\\"include_mempool\\\"  (boolean, optional) Whether to include the mempool. Default: true.\"\n            \"     Note that an unspent output that is spent in the mempool won't appear.\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"bestblock\\\":  \\\"hash\\\",    (string) The hash of the block at the tip of the chain\\n\"\n            \"  \\\"confirmations\\\" : n,       (numeric) The number of confirmations\\n\"\n            \"  \\\"value\\\" : x.xxx,           (numeric) The transaction value in \" + CURRENCY_UNIT + \"\\n\"\n            \"  \\\"scriptPubKey\\\" : {         (json object)\\n\"\n            \"     \\\"asm\\\" : \\\"code\\\",       (string) \\n\"\n            \"     \\\"hex\\\" : \\\"hex\\\",        (string) \\n\"\n            \"     \\\"reqSigs\\\" : n,          (numeric) Number of required signatures\\n\"\n            \"     \\\"type\\\" : \\\"pubkeyhash\\\", (string) The type, eg pubkeyhash\\n\"\n            \"     \\\"addresses\\\" : [          (array of string) array of sugarchain addresses\\n\"\n            \"        \\\"address\\\"     (string) sugarchain address\\n\"\n            \"        ,...\\n\"\n            \"     ]\\n\"\n            \"  },\\n\"\n            \"  \\\"coinbase\\\" : true|false   (boolean) Coinbase or not\\n\"\n            \"}\\n\"\n\n            \"\\nExamples:\\n\"\n            \"\\nGet unspent transactions\\n\"\n            + HelpExampleCli(\"listunspent\", \"\") +\n            \"\\nView the details\\n\"\n            + HelpExampleCli(\"gettxout\", \"\\\"txid\\\" 1\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"gettxout\", \"\\\"txid\\\", 1\")\n        );\n\n    LOCK(cs_main);\n\n    UniValue ret(UniValue::VOBJ);\n\n    std::string strHash = request.params[0].get_str();\n    uint256 hash(uint256S(strHash));\n    int n = request.params[1].get_int();\n    COutPoint out(hash, n);\n    bool fMempool = true;\n    if (!request.params[2].isNull())\n        fMempool = request.params[2].get_bool();\n\n    Coin coin;\n    if (fMempool) {\n        LOCK(mempool.cs);\n        CCoinsViewMemPool view(pcoinsTip.get(), mempool);\n        if (!view.GetCoin(out, coin) || mempool.isSpent(out)) {\n            return NullUniValue;\n        }\n    } else {\n        if (!pcoinsTip->GetCoin(out, coin)) {\n            return NullUniValue;\n        }\n    }\n\n    BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());\n    CBlockIndex *pindex = it->second;\n    ret.push_back(Pair(\"bestblock\", pindex->GetBlockHash().GetHex()));\n    if (coin.nHeight == MEMPOOL_HEIGHT) {\n        ret.push_back(Pair(\"confirmations\", 0));\n    } else {\n        ret.push_back(Pair(\"confirmations\", (int64_t)(pindex->nHeight - coin.nHeight + 1)));\n    }\n    ret.push_back(Pair(\"value\", ValueFromAmount(coin.out.nValue)));\n    UniValue o(UniValue::VOBJ);\n    ScriptPubKeyToUniv(coin.out.scriptPubKey, o, true);\n    ret.push_back(Pair(\"scriptPubKey\", o));\n    ret.push_back(Pair(\"coinbase\", (bool)coin.fCoinBase));\n\n    return ret;\n}\n\nUniValue verifychain(const JSONRPCRequest& request)\n{\n    int nCheckLevel = gArgs.GetArg(\"-checklevel\", DEFAULT_CHECKLEVEL);\n    int nCheckDepth = gArgs.GetArg(\"-checkblocks\", DEFAULT_CHECKBLOCKS);\n    if (request.fHelp || request.params.size() > 2)\n        throw std::runtime_error(\n            \"verifychain ( checklevel nblocks )\\n\"\n            \"\\nVerifies blockchain database.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. checklevel   (numeric, optional, 0-4, default=\" + strprintf(\"%d\", nCheckLevel) + \") How thorough the block verification is.\\n\"\n            \"2. nblocks      (numeric, optional, default=\" + strprintf(\"%d\", nCheckDepth) + \", 0=all) The number of blocks to check.\\n\"\n            \"\\nResult:\\n\"\n            \"true|false       (boolean) Verified or not\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"verifychain\", \"\")\n            + HelpExampleRpc(\"verifychain\", \"\")\n        );\n\n    LOCK(cs_main);\n\n    if (!request.params[0].isNull())\n        nCheckLevel = request.params[0].get_int();\n    if (!request.params[1].isNull())\n        nCheckDepth = request.params[1].get_int();\n\n    return CVerifyDB().VerifyDB(Params(), pcoinsTip.get(), nCheckLevel, nCheckDepth);\n}\n\n/** Implementation of IsSuperMajority with better feedback */\nstatic UniValue SoftForkMajorityDesc(int version, CBlockIndex* pindex, const Consensus::Params& consensusParams)\n{\n    UniValue rv(UniValue::VOBJ);\n    bool activated = false;\n    switch(version)\n    {\n        case 2:\n            activated = pindex->nHeight >= consensusParams.BIP34Height;\n            break;\n        case 3:\n            activated = pindex->nHeight >= consensusParams.BIP66Height;\n            break;\n        case 4:\n            activated = pindex->nHeight >= consensusParams.BIP65Height;\n            break;\n    }\n    rv.push_back(Pair(\"status\", activated));\n    return rv;\n}\n\nstatic UniValue SoftForkDesc(const std::string &name, int version, CBlockIndex* pindex, const Consensus::Params& consensusParams)\n{\n    UniValue rv(UniValue::VOBJ);\n    rv.push_back(Pair(\"id\", name));\n    rv.push_back(Pair(\"version\", version));\n    rv.push_back(Pair(\"reject\", SoftForkMajorityDesc(version, pindex, consensusParams)));\n    return rv;\n}\n\nstatic UniValue BIP9SoftForkDesc(const Consensus::Params& consensusParams, Consensus::DeploymentPos id)\n{\n    UniValue rv(UniValue::VOBJ);\n    const ThresholdState thresholdState = VersionBitsTipState(consensusParams, id);\n    switch (thresholdState) {\n    case THRESHOLD_DEFINED: rv.push_back(Pair(\"status\", \"defined\")); break;\n    case THRESHOLD_STARTED: rv.push_back(Pair(\"status\", \"started\")); break;\n    case THRESHOLD_LOCKED_IN: rv.push_back(Pair(\"status\", \"locked_in\")); break;\n    case THRESHOLD_ACTIVE: rv.push_back(Pair(\"status\", \"active\")); break;\n    case THRESHOLD_FAILED: rv.push_back(Pair(\"status\", \"failed\")); break;\n    }\n    if (THRESHOLD_STARTED == thresholdState)\n    {\n        rv.push_back(Pair(\"bit\", consensusParams.vDeployments[id].bit));\n    }\n    rv.push_back(Pair(\"startTime\", consensusParams.vDeployments[id].nStartTime));\n    rv.push_back(Pair(\"timeout\", consensusParams.vDeployments[id].nTimeout));\n    rv.push_back(Pair(\"since\", VersionBitsTipStateSinceHeight(consensusParams, id)));\n    if (THRESHOLD_STARTED == thresholdState)\n    {\n        UniValue statsUV(UniValue::VOBJ);\n        BIP9Stats statsStruct = VersionBitsTipStatistics(consensusParams, id);\n        statsUV.push_back(Pair(\"period\", statsStruct.period));\n        statsUV.push_back(Pair(\"threshold\", statsStruct.threshold));\n        statsUV.push_back(Pair(\"elapsed\", statsStruct.elapsed));\n        statsUV.push_back(Pair(\"count\", statsStruct.count));\n        statsUV.push_back(Pair(\"possible\", statsStruct.possible));\n        rv.push_back(Pair(\"statistics\", statsUV));\n    }\n    return rv;\n}\n\nvoid BIP9SoftForkDescPushBack(UniValue& bip9_softforks, const Consensus::Params& consensusParams, Consensus::DeploymentPos id)\n{\n    // Deployments with timeout value of 0 are hidden.\n    // A timeout value of 0 guarantees a softfork will never be activated.\n    // This is used when softfork codes are merged without specifying the deployment schedule.\n    if (consensusParams.vDeployments[id].nTimeout > 0)\n        bip9_softforks.push_back(Pair(VersionBitsDeploymentInfo[id].name, BIP9SoftForkDesc(consensusParams, id)));\n}\n\nUniValue getblockchaininfo(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getblockchaininfo\\n\"\n            \"Returns an object containing various state info regarding blockchain processing.\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"chain\\\": \\\"xxxx\\\",              (string) current network name as defined in BIP70 (main, test, regtest)\\n\"\n            \"  \\\"blocks\\\": xxxxxx,             (numeric) the current number of blocks processed in the server\\n\"\n            \"  \\\"headers\\\": xxxxxx,            (numeric) the current number of headers we have validated\\n\"\n            \"  \\\"bestblockhash\\\": \\\"...\\\",       (string) the hash of the currently best block\\n\"\n            \"  \\\"difficulty\\\": xxxxxx,         (numeric) the current difficulty\\n\"\n            \"  \\\"mediantime\\\": xxxxxx,         (numeric) median time for the current best block\\n\"\n            \"  \\\"verificationprogress\\\": xxxx, (numeric) estimate of verification progress [0..1]\\n\"\n            \"  \\\"initialblockdownload\\\": xxxx, (bool) (debug information) estimate of whether this node is in Initial Block Download mode.\\n\"\n            \"  \\\"chainwork\\\": \\\"xxxx\\\"           (string) total amount of work in active chain, in hexadecimal\\n\"\n            \"  \\\"size_on_disk\\\": xxxxxx,       (numeric) the estimated size of the block and undo files on disk\\n\"\n            \"  \\\"pruned\\\": xx,                 (boolean) if the blocks are subject to pruning\\n\"\n            \"  \\\"pruneheight\\\": xxxxxx,        (numeric) lowest-height complete block stored (only present if pruning is enabled)\\n\"\n            \"  \\\"automatic_pruning\\\": xx,      (boolean) whether automatic pruning is enabled (only present if pruning is enabled)\\n\"\n            \"  \\\"prune_target_size\\\": xxxxxx,  (numeric) the target size used by pruning (only present if automatic pruning is enabled)\\n\"\n            \"  \\\"softforks\\\": [                (array) status of softforks in progress\\n\"\n            \"     {\\n\"\n            \"        \\\"id\\\": \\\"xxxx\\\",           (string) name of softfork\\n\"\n            \"        \\\"version\\\": xx,          (numeric) block version\\n\"\n            \"        \\\"reject\\\": {             (object) progress toward rejecting pre-softfork blocks\\n\"\n            \"           \\\"status\\\": xx,        (boolean) true if threshold reached\\n\"\n            \"        },\\n\"\n            \"     }, ...\\n\"\n            \"  ],\\n\"\n            \"  \\\"bip9_softforks\\\": {           (object) status of BIP9 softforks in progress\\n\"\n            \"     \\\"xxxx\\\" : {                 (string) name of the softfork\\n\"\n            \"        \\\"status\\\": \\\"xxxx\\\",       (string) one of \\\"defined\\\", \\\"started\\\", \\\"locked_in\\\", \\\"active\\\", \\\"failed\\\"\\n\"\n            \"        \\\"bit\\\": xx,              (numeric) the bit (0-28) in the block version field used to signal this softfork (only for \\\"started\\\" status)\\n\"\n            \"        \\\"startTime\\\": xx,        (numeric) the minimum median time past of a block at which the bit gains its meaning\\n\"\n            \"        \\\"timeout\\\": xx,          (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in\\n\"\n            \"        \\\"since\\\": xx,            (numeric) height of the first block to which the status applies\\n\"\n            \"        \\\"statistics\\\": {         (object) numeric statistics about BIP9 signalling for a softfork (only for \\\"started\\\" status)\\n\"\n            \"           \\\"period\\\": xx,        (numeric) the length in blocks of the BIP9 signalling period \\n\"\n            \"           \\\"threshold\\\": xx,     (numeric) the number of blocks with the version bit set required to activate the feature \\n\"\n            \"           \\\"elapsed\\\": xx,       (numeric) the number of blocks elapsed since the beginning of the current period \\n\"\n            \"           \\\"count\\\": xx,         (numeric) the number of blocks with the version bit set in the current period \\n\"\n            \"           \\\"possible\\\": xx       (boolean) returns false if there are not enough blocks left in this period to pass activation threshold \\n\"\n            \"        }\\n\"\n            \"     }\\n\"\n            \"  }\\n\"\n            \"  \\\"warnings\\\" : \\\"...\\\",           (string) any network and blockchain warnings.\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getblockchaininfo\", \"\")\n            + HelpExampleRpc(\"getblockchaininfo\", \"\")\n        );\n\n    LOCK(cs_main);\n\n    UniValue obj(UniValue::VOBJ);\n    obj.push_back(Pair(\"chain\",                 Params().NetworkIDString()));\n    obj.push_back(Pair(\"blocks\",                (int)chainActive.Height()));\n    obj.push_back(Pair(\"headers\",               pindexBestHeader ? pindexBestHeader->nHeight : -1));\n    obj.push_back(Pair(\"bestblockhash\",         chainActive.Tip()->GetBlockHash().GetHex()));\n    obj.push_back(Pair(\"difficulty\",            (double)GetDifficulty()));\n    obj.push_back(Pair(\"mediantime\",            (int64_t)chainActive.Tip()->GetMedianTimePast()));\n    obj.push_back(Pair(\"verificationprogress\",  GuessVerificationProgress(Params().TxData(), chainActive.Tip())));\n    obj.push_back(Pair(\"initialblockdownload\",  IsInitialBlockDownload()));\n    obj.push_back(Pair(\"chainwork\",             chainActive.Tip()->nChainWork.GetHex()));\n    obj.push_back(Pair(\"size_on_disk\",          CalculateCurrentUsage()));\n    obj.push_back(Pair(\"pruned\",                fPruneMode));\n    if (fPruneMode) {\n        CBlockIndex* block = chainActive.Tip();\n        assert(block);\n        while (block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA)) {\n            block = block->pprev;\n        }\n\n        obj.push_back(Pair(\"pruneheight\",        block->nHeight));\n\n        // if 0, execution bypasses the whole if block.\n        bool automatic_pruning = (gArgs.GetArg(\"-prune\", 0) != 1);\n        obj.push_back(Pair(\"automatic_pruning\",  automatic_pruning));\n        if (automatic_pruning) {\n            obj.push_back(Pair(\"prune_target_size\",  nPruneTarget));\n        }\n    }\n\n    const Consensus::Params& consensusParams = Params().GetConsensus();\n    CBlockIndex* tip = chainActive.Tip();\n    UniValue softforks(UniValue::VARR);\n    UniValue bip9_softforks(UniValue::VOBJ);\n    softforks.push_back(SoftForkDesc(\"bip34\", 2, tip, consensusParams));\n    softforks.push_back(SoftForkDesc(\"bip66\", 3, tip, consensusParams));\n    softforks.push_back(SoftForkDesc(\"bip65\", 4, tip, consensusParams));\n    for (int pos = Consensus::DEPLOYMENT_CSV; pos != Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++pos) {\n        BIP9SoftForkDescPushBack(bip9_softforks, consensusParams, static_cast<Consensus::DeploymentPos>(pos));\n    }\n    obj.push_back(Pair(\"softforks\",             softforks));\n    obj.push_back(Pair(\"bip9_softforks\", bip9_softforks));\n\n    obj.push_back(Pair(\"warnings\", GetWarnings(\"statusbar\")));\n    return obj;\n}\n\n/** Comparison function for sorting the getchaintips heads.  */\nstruct CompareBlocksByHeight\n{\n    bool operator()(const CBlockIndex* a, const CBlockIndex* b) const\n    {\n        /* Make sure that unequal blocks with the same height do not compare\n           equal. Use the pointers themselves to make a distinction. */\n\n        if (a->nHeight != b->nHeight)\n          return (a->nHeight > b->nHeight);\n\n        return a < b;\n    }\n};\n\nUniValue getchaintips(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getchaintips\\n\"\n            \"Return information about all known tips in the block tree,\"\n            \" including the main chain as well as orphaned branches.\\n\"\n            \"\\nResult:\\n\"\n            \"[\\n\"\n            \"  {\\n\"\n            \"    \\\"height\\\": xxxx,         (numeric) height of the chain tip\\n\"\n            \"    \\\"hash\\\": \\\"xxxx\\\",         (string) block hash of the tip\\n\"\n            \"    \\\"branchlen\\\": 0          (numeric) zero for main chain\\n\"\n            \"    \\\"status\\\": \\\"active\\\"      (string) \\\"active\\\" for the main chain\\n\"\n            \"  },\\n\"\n            \"  {\\n\"\n            \"    \\\"height\\\": xxxx,\\n\"\n            \"    \\\"hash\\\": \\\"xxxx\\\",\\n\"\n            \"    \\\"branchlen\\\": 1          (numeric) length of branch connecting the tip to the main chain\\n\"\n            \"    \\\"status\\\": \\\"xxxx\\\"        (string) status of the chain (active, valid-fork, valid-headers, headers-only, invalid)\\n\"\n            \"  }\\n\"\n            \"]\\n\"\n            \"Possible values for status:\\n\"\n            \"1.  \\\"invalid\\\"               This branch contains at least one invalid block\\n\"\n            \"2.  \\\"headers-only\\\"          Not all blocks for this branch are available, but the headers are valid\\n\"\n            \"3.  \\\"valid-headers\\\"         All blocks are available for this branch, but they were never fully validated\\n\"\n            \"4.  \\\"valid-fork\\\"            This branch is not part of the active chain, but is fully validated\\n\"\n            \"5.  \\\"active\\\"                This is the tip of the active main chain, which is certainly valid\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getchaintips\", \"\")\n            + HelpExampleRpc(\"getchaintips\", \"\")\n        );\n\n    LOCK(cs_main);\n\n    /*\n     * Idea:  the set of chain tips is chainActive.tip, plus orphan blocks which do not have another orphan building off of them.\n     * Algorithm:\n     *  - Make one pass through mapBlockIndex, picking out the orphan blocks, and also storing a set of the orphan block's pprev pointers.\n     *  - Iterate through the orphan blocks. If the block isn't pointed to by another orphan, it is a chain tip.\n     *  - add chainActive.Tip()\n     */\n    std::set<const CBlockIndex*, CompareBlocksByHeight> setTips;\n    std::set<const CBlockIndex*> setOrphans;\n    std::set<const CBlockIndex*> setPrevs;\n\n    for (const std::pair<const uint256, CBlockIndex*>& item : mapBlockIndex)\n    {\n        if (!chainActive.Contains(item.second)) {\n            setOrphans.insert(item.second);\n            setPrevs.insert(item.second->pprev);\n        }\n    }\n\n    for (std::set<const CBlockIndex*>::iterator it = setOrphans.begin(); it != setOrphans.end(); ++it)\n    {\n        if (setPrevs.erase(*it) == 0) {\n            setTips.insert(*it);\n        }\n    }\n\n    // Always report the currently active tip.\n    setTips.insert(chainActive.Tip());\n\n    /* Construct the output array.  */\n    UniValue res(UniValue::VARR);\n    for (const CBlockIndex* block : setTips)\n    {\n        UniValue obj(UniValue::VOBJ);\n        obj.push_back(Pair(\"height\", block->nHeight));\n        obj.push_back(Pair(\"hash\", block->phashBlock->GetHex()));\n\n        const int branchLen = block->nHeight - chainActive.FindFork(block)->nHeight;\n        obj.push_back(Pair(\"branchlen\", branchLen));\n\n        std::string status;\n        if (chainActive.Contains(block)) {\n            // This block is part of the currently active chain.\n            status = \"active\";\n        } else if (block->nStatus & BLOCK_FAILED_MASK) {\n            // This block or one of its ancestors is invalid.\n            status = \"invalid\";\n        } else if (block->nChainTx == 0) {\n            // This block cannot be connected because full block data for it or one of its parents is missing.\n            status = \"headers-only\";\n        } else if (block->IsValid(BLOCK_VALID_SCRIPTS)) {\n            // This block is fully validated, but no longer part of the active chain. It was probably the active block once, but was reorganized.\n            status = \"valid-fork\";\n        } else if (block->IsValid(BLOCK_VALID_TREE)) {\n            // The headers for this block are valid, but it has not been validated. It was probably never part of the most-work chain.\n            status = \"valid-headers\";\n        } else {\n            // No clue.\n            status = \"unknown\";\n        }\n        obj.push_back(Pair(\"status\", status));\n\n        res.push_back(obj);\n    }\n\n    return res;\n}\n\nUniValue mempoolInfoToJSON()\n{\n    UniValue ret(UniValue::VOBJ);\n    ret.push_back(Pair(\"size\", (int64_t) mempool.size()));\n    ret.push_back(Pair(\"bytes\", (int64_t) mempool.GetTotalTxSize()));\n    ret.push_back(Pair(\"usage\", (int64_t) mempool.DynamicMemoryUsage()));\n    size_t maxmempool = gArgs.GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;\n    ret.push_back(Pair(\"maxmempool\", (int64_t) maxmempool));\n    ret.push_back(Pair(\"mempoolminfee\", ValueFromAmount(std::max(mempool.GetMinFee(maxmempool), ::minRelayTxFee).GetFeePerK())));\n    ret.push_back(Pair(\"minrelaytxfee\", ValueFromAmount(::minRelayTxFee.GetFeePerK())));\n\n    return ret;\n}\n\nUniValue getmempoolinfo(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getmempoolinfo\\n\"\n            \"\\nReturns details on the active state of the TX memory pool.\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"size\\\": xxxxx,               (numeric) Current tx count\\n\"\n            \"  \\\"bytes\\\": xxxxx,              (numeric) Sum of all virtual transaction sizes as defined in BIP 141. Differs from actual serialized size because witness data is discounted\\n\"\n            \"  \\\"usage\\\": xxxxx,              (numeric) Total memory usage for the mempool\\n\"\n            \"  \\\"maxmempool\\\": xxxxx,         (numeric) Maximum memory usage for the mempool\\n\"\n            \"  \\\"mempoolminfee\\\": xxxxx       (numeric) Minimum fee rate in \" + CURRENCY_UNIT + \"/kB for tx to be accepted. Is the maximum of minrelaytxfee and minimum mempool fee\\n\"\n            \"  \\\"minrelaytxfee\\\": xxxxx       (numeric) Current minimum relay fee for transactions\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getmempoolinfo\", \"\")\n            + HelpExampleRpc(\"getmempoolinfo\", \"\")\n        );\n\n    return mempoolInfoToJSON();\n}\n\nUniValue preciousblock(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"preciousblock \\\"blockhash\\\"\\n\"\n            \"\\nTreats a block as if it were received before others with the same work.\\n\"\n            \"\\nA later preciousblock call can override the effect of an earlier one.\\n\"\n            \"\\nThe effects of preciousblock are not retained across restarts.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"blockhash\\\"   (string, required) the hash of the block to mark as precious\\n\"\n            \"\\nResult:\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"preciousblock\", \"\\\"blockhash\\\"\")\n            + HelpExampleRpc(\"preciousblock\", \"\\\"blockhash\\\"\")\n        );\n\n    std::string strHash = request.params[0].get_str();\n    uint256 hash(uint256S(strHash));\n    CBlockIndex* pblockindex;\n\n    {\n        LOCK(cs_main);\n        if (mapBlockIndex.count(hash) == 0)\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block not found\");\n\n        pblockindex = mapBlockIndex[hash];\n    }\n\n    CValidationState state;\n    PreciousBlock(state, Params(), pblockindex);\n\n    if (!state.IsValid()) {\n        throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason());\n    }\n\n    return NullUniValue;\n}\n\nUniValue invalidateblock(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"invalidateblock \\\"blockhash\\\"\\n\"\n            \"\\nPermanently marks a block as invalid, as if it violated a consensus rule.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"blockhash\\\"   (string, required) the hash of the block to mark as invalid\\n\"\n            \"\\nResult:\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"invalidateblock\", \"\\\"blockhash\\\"\")\n            + HelpExampleRpc(\"invalidateblock\", \"\\\"blockhash\\\"\")\n        );\n\n    std::string strHash = request.params[0].get_str();\n    uint256 hash(uint256S(strHash));\n    CValidationState state;\n\n    {\n        LOCK(cs_main);\n        if (mapBlockIndex.count(hash) == 0)\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block not found\");\n\n        CBlockIndex* pblockindex = mapBlockIndex[hash];\n        InvalidateBlock(state, Params(), pblockindex);\n    }\n\n    if (state.IsValid()) {\n        ActivateBestChain(state, Params());\n    }\n\n    if (!state.IsValid()) {\n        throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason());\n    }\n\n    return NullUniValue;\n}\n\nUniValue reconsiderblock(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"reconsiderblock \\\"blockhash\\\"\\n\"\n            \"\\nRemoves invalidity status of a block and its descendants, reconsider them for activation.\\n\"\n            \"This can be used to undo the effects of invalidateblock.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"blockhash\\\"   (string, required) the hash of the block to reconsider\\n\"\n            \"\\nResult:\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"reconsiderblock\", \"\\\"blockhash\\\"\")\n            + HelpExampleRpc(\"reconsiderblock\", \"\\\"blockhash\\\"\")\n        );\n\n    std::string strHash = request.params[0].get_str();\n    uint256 hash(uint256S(strHash));\n\n    {\n        LOCK(cs_main);\n        if (mapBlockIndex.count(hash) == 0)\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block not found\");\n\n        CBlockIndex* pblockindex = mapBlockIndex[hash];\n        ResetBlockFailureFlags(pblockindex);\n    }\n\n    CValidationState state;\n    ActivateBestChain(state, Params());\n\n    if (!state.IsValid()) {\n        throw JSONRPCError(RPC_DATABASE_ERROR, state.GetRejectReason());\n    }\n\n    return NullUniValue;\n}\n\nUniValue getchaintxstats(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() > 2)\n        throw std::runtime_error(\n            \"getchaintxstats ( nblocks blockhash )\\n\"\n            \"\\nCompute statistics about the total number and rate of transactions in the chain.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. nblocks      (numeric, optional) Size of the window in number of blocks (default: one month).\\n\"\n            \"2. \\\"blockhash\\\"  (string, optional) The hash of the block that ends the window.\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"time\\\": xxxxx,                (numeric) The timestamp for the final block in the window in UNIX format.\\n\"\n            \"  \\\"txcount\\\": xxxxx,             (numeric) The total number of transactions in the chain up to that point.\\n\"\n            \"  \\\"window_block_count\\\": xxxxx,  (numeric) Size of the window in number of blocks.\\n\"\n            \"  \\\"window_tx_count\\\": xxxxx,     (numeric) The number of transactions in the window. Only returned if \\\"window_block_count\\\" is > 0.\\n\"\n            \"  \\\"window_interval\\\": xxxxx,     (numeric) The elapsed time in the window in seconds. Only returned if \\\"window_block_count\\\" is > 0.\\n\"\n            \"  \\\"txrate\\\": x.xx,               (numeric) The average rate of transactions per second in the window. Only returned if \\\"window_interval\\\" is > 0.\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getchaintxstats\", \"\")\n            + HelpExampleRpc(\"getchaintxstats\", \"2016\")\n        );\n\n    const CBlockIndex* pindex;\n    int blockcount = 30 * 24 * 60 * 60 / Params().GetConsensus().nPowTargetSpacing; // By default: 1 month\n\n    bool havehash = !request.params[1].isNull();\n    uint256 hash;\n    if (havehash) {\n        hash = uint256S(request.params[1].get_str());\n    }\n\n    {\n        LOCK(cs_main);\n        if (havehash) {\n            auto it = mapBlockIndex.find(hash);\n            if (it == mapBlockIndex.end()) {\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block not found\");\n            }\n            pindex = it->second;\n            if (!chainActive.Contains(pindex)) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, \"Block is not in main chain\");\n            }\n        } else {\n            pindex = chainActive.Tip();\n        }\n    }\n    \n    assert(pindex != nullptr);\n\n    if (request.params[0].isNull()) {\n        blockcount = std::max(0, std::min(blockcount, pindex->nHeight - 1));\n    } else {\n        blockcount = request.params[0].get_int();\n\n        if (blockcount < 0 || (blockcount > 0 && blockcount >= pindex->nHeight)) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid block count: should be between 0 and the block's height - 1\");\n        }\n    }\n\n    const CBlockIndex* pindexPast = pindex->GetAncestor(pindex->nHeight - blockcount);\n    int nTimeDiff = pindex->GetMedianTimePast() - pindexPast->GetMedianTimePast();\n    int nTxDiff = pindex->nChainTx - pindexPast->nChainTx;\n\n    UniValue ret(UniValue::VOBJ);\n    ret.push_back(Pair(\"time\", (int64_t)pindex->nTime));\n    ret.push_back(Pair(\"txcount\", (int64_t)pindex->nChainTx));\n    ret.push_back(Pair(\"window_block_count\", blockcount));\n    if (blockcount > 0) {\n        ret.push_back(Pair(\"window_tx_count\", nTxDiff));\n        ret.push_back(Pair(\"window_interval\", nTimeDiff));\n        if (nTimeDiff > 0) {\n            ret.push_back(Pair(\"txrate\", ((double)nTxDiff) / nTimeDiff));\n        }\n    }\n\n    return ret;\n}\n\nUniValue savemempool(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0) {\n        throw std::runtime_error(\n            \"savemempool\\n\"\n            \"\\nDumps the mempool to disk.\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"savemempool\", \"\")\n            + HelpExampleRpc(\"savemempool\", \"\")\n        );\n    }\n\n    if (!DumpMempool()) {\n        throw JSONRPCError(RPC_MISC_ERROR, \"Unable to dump mempool to disk\");\n    }\n\n    return NullUniValue;\n}\n\nstatic const CRPCCommand commands[] =\n{ //  category              name                      actor (function)         argNames\n  //  --------------------- ------------------------  -----------------------  ----------\n    { \"blockchain\",         \"getblockchaininfo\",      &getblockchaininfo,      {} },\n    { \"blockchain\",         \"getchaintxstats\",        &getchaintxstats,        {\"nblocks\", \"blockhash\"} },\n    { \"blockchain\",         \"getbestblockhash\",       &getbestblockhash,       {} },\n    { \"blockchain\",         \"getblockcount\",          &getblockcount,          {} },\n    { \"blockchain\",         \"getblock\",               &getblock,               {\"blockhash\",\"verbosity|verbose\"} },\n    { \"blockchain\",         \"getblockhash\",           &getblockhash,           {\"height\"} },\n    { \"blockchain\",         \"getblockheader\",         &getblockheader,         {\"blockhash\",\"verbose\"} },\n    { \"blockchain\",         \"getchaintips\",           &getchaintips,           {} },\n    { \"blockchain\",         \"getdifficulty\",          &getdifficulty,          {} },\n    { \"blockchain\",         \"getmempoolancestors\",    &getmempoolancestors,    {\"txid\",\"verbose\"} },\n    { \"blockchain\",         \"getmempooldescendants\",  &getmempooldescendants,  {\"txid\",\"verbose\"} },\n    { \"blockchain\",         \"getmempoolentry\",        &getmempoolentry,        {\"txid\"} },\n    { \"blockchain\",         \"getmempoolinfo\",         &getmempoolinfo,         {} },\n    { \"blockchain\",         \"getrawmempool\",          &getrawmempool,          {\"verbose\"} },\n    { \"blockchain\",         \"gettxout\",               &gettxout,               {\"txid\",\"n\",\"include_mempool\"} },\n    { \"blockchain\",         \"gettxoutsetinfo\",        &gettxoutsetinfo,        {} },\n    { \"blockchain\",         \"pruneblockchain\",        &pruneblockchain,        {\"height\"} },\n    { \"blockchain\",         \"savemempool\",            &savemempool,            {} },\n    { \"blockchain\",         \"verifychain\",            &verifychain,            {\"checklevel\",\"nblocks\"} },\n\n    { \"blockchain\",         \"preciousblock\",          &preciousblock,          {\"blockhash\"} },\n\n    /* Not shown in help */\n    { \"hidden\",             \"invalidateblock\",        &invalidateblock,        {\"blockhash\"} },\n    { \"hidden\",             \"reconsiderblock\",        &reconsiderblock,        {\"blockhash\"} },\n    { \"hidden\",             \"waitfornewblock\",        &waitfornewblock,        {\"timeout\"} },\n    { \"hidden\",             \"waitforblock\",           &waitforblock,           {\"blockhash\",\"timeout\"} },\n    { \"hidden\",             \"waitforblockheight\",     &waitforblockheight,     {\"height\",\"timeout\"} },\n    { \"hidden\",             \"syncwithvalidationinterfacequeue\", &syncwithvalidationinterfacequeue, {} },\n};\n\nvoid RegisterBlockchainRPCCommands(CRPCTable &t)\n{\n    for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)\n        t.appendCommand(commands[vcidx].name, &commands[vcidx]);\n}\n"
  },
  {
    "path": "src/rpc/blockchain.h",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_RPC_BLOCKCHAIN_H\n#define BITCOIN_RPC_BLOCKCHAIN_H\n\nclass CBlock;\nclass CBlockIndex;\nclass UniValue;\n\n/**\n * Get the difficulty of the net wrt to the given block index, or the chain tip if\n * not provided.\n *\n * @return A floating point number that is a multiple of the main net minimum\n * difficulty (4295032833 hashes).\n */\ndouble GetDifficulty(const CBlockIndex* blockindex = nullptr);\n\n/** Callback for when block tip changed. */\nvoid RPCNotifyBlockChange(bool ibd, const CBlockIndex *);\n\n/** Block description to JSON */\nUniValue blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDetails = false);\n\n/** Mempool information to JSON */\nUniValue mempoolInfoToJSON();\n\n/** Mempool to JSON */\nUniValue mempoolToJSON(bool fVerbose = false);\n\n/** Block header to JSON */\nUniValue blockheaderToJSON(const CBlockIndex* blockindex);\n\n#endif\n\n"
  },
  {
    "path": "src/rpc/client.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <rpc/client.h>\n#include <rpc/protocol.h>\n#include <util.h>\n\n#include <set>\n#include <stdint.h>\n\nclass CRPCConvertParam\n{\npublic:\n    std::string methodName; //!< method whose params want conversion\n    int paramIdx;           //!< 0-based idx of param to convert\n    std::string paramName;  //!< parameter name\n};\n\n/**\n * Specify a (method, idx, name) here if the argument is a non-string RPC\n * argument and needs to be converted from JSON.\n *\n * @note Parameter indexes start from 0.\n */\nstatic const CRPCConvertParam vRPCConvertParams[] =\n{\n    { \"setmocktime\", 0, \"timestamp\" },\n    { \"generate\", 0, \"nblocks\" },\n    { \"generate\", 1, \"maxtries\" },\n    { \"generatetoaddress\", 0, \"nblocks\" },\n    { \"generatetoaddress\", 2, \"maxtries\" },\n    { \"getnetworkhashps\", 0, \"nblocks\" },\n    { \"getnetworkhashps\", 1, \"height\" },\n    { \"sendtoaddress\", 1, \"amount\" },\n    { \"sendtoaddress\", 4, \"subtractfeefromamount\" },\n    { \"sendtoaddress\", 5 , \"replaceable\" },\n    { \"sendtoaddress\", 6 , \"conf_target\" },\n    { \"settxfee\", 0, \"amount\" },\n    { \"getreceivedbyaddress\", 1, \"minconf\" },\n    { \"getreceivedbyaccount\", 1, \"minconf\" },\n    { \"listreceivedbyaddress\", 0, \"minconf\" },\n    { \"listreceivedbyaddress\", 1, \"include_empty\" },\n    { \"listreceivedbyaddress\", 2, \"include_watchonly\" },\n    { \"listreceivedbyaccount\", 0, \"minconf\" },\n    { \"listreceivedbyaccount\", 1, \"include_empty\" },\n    { \"listreceivedbyaccount\", 2, \"include_watchonly\" },\n    { \"getbalance\", 1, \"minconf\" },\n    { \"getbalance\", 2, \"include_watchonly\" },\n    { \"getblockhash\", 0, \"height\" },\n    { \"waitforblockheight\", 0, \"height\" },\n    { \"waitforblockheight\", 1, \"timeout\" },\n    { \"waitforblock\", 1, \"timeout\" },\n    { \"waitfornewblock\", 0, \"timeout\" },\n    { \"move\", 2, \"amount\" },\n    { \"move\", 3, \"minconf\" },\n    { \"sendfrom\", 2, \"amount\" },\n    { \"sendfrom\", 3, \"minconf\" },\n    { \"listtransactions\", 1, \"count\" },\n    { \"listtransactions\", 2, \"skip\" },\n    { \"listtransactions\", 3, \"include_watchonly\" },\n    { \"listaccounts\", 0, \"minconf\" },\n    { \"listaccounts\", 1, \"include_watchonly\" },\n    { \"walletpassphrase\", 1, \"timeout\" },\n    { \"getblocktemplate\", 0, \"template_request\" },\n    { \"listsinceblock\", 1, \"target_confirmations\" },\n    { \"listsinceblock\", 2, \"include_watchonly\" },\n    { \"listsinceblock\", 3, \"include_removed\" },\n    { \"sendmany\", 1, \"amounts\" },\n    { \"sendmany\", 2, \"minconf\" },\n    { \"sendmany\", 4, \"subtractfeefrom\" },\n    { \"sendmany\", 5 , \"replaceable\" },\n    { \"sendmany\", 6 , \"conf_target\" },\n    { \"addmultisigaddress\", 0, \"nrequired\" },\n    { \"addmultisigaddress\", 1, \"keys\" },\n    { \"createmultisig\", 0, \"nrequired\" },\n    { \"createmultisig\", 1, \"keys\" },\n    { \"listunspent\", 0, \"minconf\" },\n    { \"listunspent\", 1, \"maxconf\" },\n    { \"listunspent\", 2, \"addresses\" },\n    { \"listunspent\", 3, \"include_unsafe\" },\n    { \"listunspent\", 4, \"query_options\" },\n    { \"getblock\", 1, \"verbosity\" },\n    { \"getblock\", 1, \"verbose\" },\n    { \"getblockheader\", 1, \"verbose\" },\n    { \"getchaintxstats\", 0, \"nblocks\" },\n    { \"gettransaction\", 1, \"include_watchonly\" },\n    { \"getrawtransaction\", 1, \"verbose\" },\n    { \"createrawtransaction\", 0, \"inputs\" },\n    { \"createrawtransaction\", 1, \"outputs\" },\n    { \"createrawtransaction\", 2, \"locktime\" },\n    { \"createrawtransaction\", 3, \"replaceable\" },\n    { \"decoderawtransaction\", 1, \"iswitness\" },\n    { \"signrawtransaction\", 1, \"prevtxs\" },\n    { \"signrawtransaction\", 2, \"privkeys\" },\n    { \"sendrawtransaction\", 1, \"allowhighfees\" },\n    { \"combinerawtransaction\", 0, \"txs\" },\n    { \"fundrawtransaction\", 1, \"options\" },\n    { \"fundrawtransaction\", 2, \"iswitness\" },\n    { \"gettxout\", 1, \"n\" },\n    { \"gettxout\", 2, \"include_mempool\" },\n    { \"gettxoutproof\", 0, \"txids\" },\n    { \"lockunspent\", 0, \"unlock\" },\n    { \"lockunspent\", 1, \"transactions\" },\n    { \"importprivkey\", 2, \"rescan\" },\n    { \"importaddress\", 2, \"rescan\" },\n    { \"importaddress\", 3, \"p2sh\" },\n    { \"importpubkey\", 2, \"rescan\" },\n    { \"importmulti\", 0, \"requests\" },\n    { \"importmulti\", 1, \"options\" },\n    { \"verifychain\", 0, \"checklevel\" },\n    { \"verifychain\", 1, \"nblocks\" },\n    { \"pruneblockchain\", 0, \"height\" },\n    { \"keypoolrefill\", 0, \"newsize\" },\n    { \"getrawmempool\", 0, \"verbose\" },\n    { \"estimatefee\", 0, \"nblocks\" },\n    { \"estimatesmartfee\", 0, \"conf_target\" },\n    { \"estimaterawfee\", 0, \"conf_target\" },\n    { \"estimaterawfee\", 1, \"threshold\" },\n    { \"prioritisetransaction\", 1, \"dummy\" },\n    { \"prioritisetransaction\", 2, \"fee_delta\" },\n    { \"setban\", 2, \"bantime\" },\n    { \"setban\", 3, \"absolute\" },\n    { \"setnetworkactive\", 0, \"state\" },\n    { \"getmempoolancestors\", 1, \"verbose\" },\n    { \"getmempooldescendants\", 1, \"verbose\" },\n    { \"bumpfee\", 1, \"options\" },\n    { \"logging\", 0, \"include\" },\n    { \"logging\", 1, \"exclude\" },\n    { \"disconnectnode\", 1, \"nodeid\" },\n    { \"addwitnessaddress\", 1, \"p2sh\" },\n    // Echo with conversion (For testing only)\n    { \"echojson\", 0, \"arg0\" },\n    { \"echojson\", 1, \"arg1\" },\n    { \"echojson\", 2, \"arg2\" },\n    { \"echojson\", 3, \"arg3\" },\n    { \"echojson\", 4, \"arg4\" },\n    { \"echojson\", 5, \"arg5\" },\n    { \"echojson\", 6, \"arg6\" },\n    { \"echojson\", 7, \"arg7\" },\n    { \"echojson\", 8, \"arg8\" },\n    { \"echojson\", 9, \"arg9\" },\n    { \"rescanblockchain\", 0, \"start_height\"},\n    { \"rescanblockchain\", 1, \"stop_height\"},\n};\n\nclass CRPCConvertTable\n{\nprivate:\n    std::set<std::pair<std::string, int>> members;\n    std::set<std::pair<std::string, std::string>> membersByName;\n\npublic:\n    CRPCConvertTable();\n\n    bool convert(const std::string& method, int idx) {\n        return (members.count(std::make_pair(method, idx)) > 0);\n    }\n    bool convert(const std::string& method, const std::string& name) {\n        return (membersByName.count(std::make_pair(method, name)) > 0);\n    }\n};\n\nCRPCConvertTable::CRPCConvertTable()\n{\n    const unsigned int n_elem =\n        (sizeof(vRPCConvertParams) / sizeof(vRPCConvertParams[0]));\n\n    for (unsigned int i = 0; i < n_elem; i++) {\n        members.insert(std::make_pair(vRPCConvertParams[i].methodName,\n                                      vRPCConvertParams[i].paramIdx));\n        membersByName.insert(std::make_pair(vRPCConvertParams[i].methodName,\n                                            vRPCConvertParams[i].paramName));\n    }\n}\n\nstatic CRPCConvertTable rpcCvtTable;\n\n/** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null)\n * as well as objects and arrays.\n */\nUniValue ParseNonRFCJSONValue(const std::string& strVal)\n{\n    UniValue jVal;\n    if (!jVal.read(std::string(\"[\")+strVal+std::string(\"]\")) ||\n        !jVal.isArray() || jVal.size()!=1)\n        throw std::runtime_error(std::string(\"Error parsing JSON:\")+strVal);\n    return jVal[0];\n}\n\nUniValue RPCConvertValues(const std::string &strMethod, const std::vector<std::string> &strParams)\n{\n    UniValue params(UniValue::VARR);\n\n    for (unsigned int idx = 0; idx < strParams.size(); idx++) {\n        const std::string& strVal = strParams[idx];\n\n        if (!rpcCvtTable.convert(strMethod, idx)) {\n            // insert string value directly\n            params.push_back(strVal);\n        } else {\n            // parse string as JSON, insert bool/number/object/etc. value\n            params.push_back(ParseNonRFCJSONValue(strVal));\n        }\n    }\n\n    return params;\n}\n\nUniValue RPCConvertNamedValues(const std::string &strMethod, const std::vector<std::string> &strParams)\n{\n    UniValue params(UniValue::VOBJ);\n\n    for (const std::string &s: strParams) {\n        size_t pos = s.find('=');\n        if (pos == std::string::npos) {\n            throw(std::runtime_error(\"No '=' in named argument '\"+s+\"', this needs to be present for every argument (even if it is empty)\"));\n        }\n\n        std::string name = s.substr(0, pos);\n        std::string value = s.substr(pos+1);\n\n        if (!rpcCvtTable.convert(strMethod, name)) {\n            // insert string value directly\n            params.pushKV(name, value);\n        } else {\n            // parse string as JSON, insert bool/number/object/etc. value\n            params.pushKV(name, ParseNonRFCJSONValue(value));\n        }\n    }\n\n    return params;\n}\n"
  },
  {
    "path": "src/rpc/client.h",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_RPCCLIENT_H\n#define BITCOIN_RPCCLIENT_H\n\n#include <univalue.h>\n\n/** Convert positional arguments to command-specific RPC representation */\nUniValue RPCConvertValues(const std::string& strMethod, const std::vector<std::string>& strParams);\n\n/** Convert named arguments to command-specific RPC representation */\nUniValue RPCConvertNamedValues(const std::string& strMethod, const std::vector<std::string>& strParams);\n\n/** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null)\n * as well as objects and arrays.\n */\nUniValue ParseNonRFCJSONValue(const std::string& strVal);\n\n#endif // BITCOIN_RPCCLIENT_H\n"
  },
  {
    "path": "src/rpc/mining.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <base58.h>\n#include <amount.h>\n#include <chain.h>\n#include <chainparams.h>\n#include <consensus/consensus.h>\n#include <consensus/params.h>\n#include <consensus/validation.h>\n#include <core_io.h>\n#include <init.h>\n#include <validation.h>\n#include <miner.h>\n#include <net.h>\n#include <policy/fees.h>\n#include <pow.h>\n#include <rpc/blockchain.h>\n#include <rpc/mining.h>\n#include <rpc/server.h>\n#include <txmempool.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <validationinterface.h>\n#include <warnings.h>\n\n#include <memory>\n#include <stdint.h>\n\nunsigned int ParseConfirmTarget(const UniValue& value)\n{\n    int target = value.get_int();\n    unsigned int max_target = ::feeEstimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);\n    if (target < 1 || (unsigned int)target > max_target) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf(\"Invalid conf_target, must be between %u - %u\", 1, max_target));\n    }\n    return (unsigned int)target;\n}\n\n/**\n * Return average network hashes per second based on the last 'lookup' blocks,\n * or from the last difficulty change if 'lookup' is nonpositive.\n * If 'height' is nonnegative, compute the estimate at the time when a given block was found.\n */\nUniValue GetNetworkHashPS(int lookup, int height) {\n    CBlockIndex *pb = chainActive.Tip();\n\n    if (height >= 0 && height < chainActive.Height())\n        pb = chainActive[height];\n\n    if (pb == nullptr || !pb->nHeight)\n        return 0;\n\n    // If lookup is -1, then use blocks since last difficulty change.\n    if (lookup <= 0)\n        lookup = pb->nHeight % Params().GetConsensus().DifficultyAdjustmentInterval() + 1;\n\n    // If lookup is larger than chain, then set it to chain length.\n    if (lookup > pb->nHeight)\n        lookup = pb->nHeight;\n\n    CBlockIndex *pb0 = pb;\n    int64_t minTime = pb0->GetBlockTime();\n    int64_t maxTime = minTime;\n    for (int i = 0; i < lookup; i++) {\n        pb0 = pb0->pprev;\n        int64_t time = pb0->GetBlockTime();\n        minTime = std::min(time, minTime);\n        maxTime = std::max(time, maxTime);\n    }\n\n    // In case there's a situation where minTime == maxTime, we don't want a divide by zero exception.\n    if (minTime == maxTime)\n        return 0;\n\n    arith_uint256 workDiff = pb->nChainWork - pb0->nChainWork;\n    int64_t timeDiff = maxTime - minTime;\n\n    return workDiff.getdouble() / timeDiff;\n}\n\nUniValue getnetworkhashps(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() > 2)\n        throw std::runtime_error(\n            \"getnetworkhashps ( nblocks height )\\n\"\n            \"\\nReturns the estimated network hashes per second based on the last n blocks.\\n\"\n            \"Pass in [blocks] to override # of blocks, -1 specifies since last difficulty change.\\n\"\n            \"Pass in [height] to estimate the network speed at the time when a certain block was found.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. nblocks     (numeric, optional, default=120) The number of blocks, or -1 for blocks since last difficulty change.\\n\"\n            \"2. height      (numeric, optional, default=-1) To estimate at the time of the given height.\\n\"\n            \"\\nResult:\\n\"\n            \"x             (numeric) Hashes per second estimated\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getnetworkhashps\", \"\")\n            + HelpExampleRpc(\"getnetworkhashps\", \"\")\n       );\n\n    LOCK(cs_main);\n    return GetNetworkHashPS(!request.params[0].isNull() ? request.params[0].get_int() : 120, !request.params[1].isNull() ? request.params[1].get_int() : -1);\n}\n\nUniValue generateBlocks(std::shared_ptr<CReserveScript> coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript)\n{\n    static const int nInnerLoopCount = 0x10000;\n    int nHeightEnd = 0;\n    int nHeight = 0;\n\n    {   // Don't keep cs_main locked\n        LOCK(cs_main);\n        nHeight = chainActive.Height();\n        nHeightEnd = nHeight+nGenerate;\n    }\n    unsigned int nExtraNonce = 0;\n    UniValue blockHashes(UniValue::VARR);\n    while (nHeight < nHeightEnd)\n    {\n        std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(Params()).CreateNewBlock(coinbaseScript->reserveScript));\n        if (!pblocktemplate.get())\n            throw JSONRPCError(RPC_INTERNAL_ERROR, \"Couldn't create new block\");\n        CBlock *pblock = &pblocktemplate->block;\n        {\n            LOCK(cs_main);\n            IncrementExtraNonce(pblock, chainActive.Tip(), nExtraNonce);\n        }\n        while (nMaxTries > 0 && pblock->nNonce < nInnerLoopCount && !CheckProofOfWork(pblock->GetPoWHash(), pblock->nBits, Params().GetConsensus())) {\n            ++pblock->nNonce;\n            --nMaxTries;\n        }\n        if (nMaxTries == 0) {\n            break;\n        }\n        if (pblock->nNonce == nInnerLoopCount) {\n            continue;\n        }\n        std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(*pblock);\n        if (!ProcessNewBlock(Params(), shared_pblock, true, nullptr))\n            throw JSONRPCError(RPC_INTERNAL_ERROR, \"ProcessNewBlock, block not accepted\");\n        ++nHeight;\n        blockHashes.push_back(pblock->GetHash().GetHex());\n\n        //mark script as important because it was used at least for one coinbase output if the script came from the wallet\n        if (keepScript)\n        {\n            coinbaseScript->KeepScript();\n        }\n    }\n    return blockHashes;\n}\n\nUniValue generatetoaddress(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 2 || request.params.size() > 3)\n        throw std::runtime_error(\n            \"generatetoaddress nblocks address (maxtries)\\n\"\n            \"\\nMine blocks immediately to a specified address (before the RPC call returns)\\n\"\n            \"\\nArguments:\\n\"\n            \"1. nblocks      (numeric, required) How many blocks are generated immediately.\\n\"\n            \"2. address      (string, required) The address to send the newly generated sugarchain to.\\n\"\n            \"3. maxtries     (numeric, optional) How many iterations to try (default = 1000000).\\n\"\n            \"\\nResult:\\n\"\n            \"[ blockhashes ]     (array) hashes of blocks generated\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nGenerate 11 blocks to myaddress\\n\"\n            + HelpExampleCli(\"generatetoaddress\", \"11 \\\"myaddress\\\"\")\n        );\n\n    int nGenerate = request.params[0].get_int();\n    uint64_t nMaxTries = 1000000;\n    if (!request.params[2].isNull()) {\n        nMaxTries = request.params[2].get_int();\n    }\n\n    CTxDestination destination = DecodeDestination(request.params[1].get_str());\n    if (!IsValidDestination(destination)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Error: Invalid address\");\n    }\n\n    std::shared_ptr<CReserveScript> coinbaseScript = std::make_shared<CReserveScript>();\n    coinbaseScript->reserveScript = GetScriptForDestination(destination);\n\n    return generateBlocks(coinbaseScript, nGenerate, nMaxTries, false);\n}\n\nUniValue getmininginfo(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getmininginfo\\n\"\n            \"\\nReturns a json object containing mining-related information.\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"blocks\\\": nnn,             (numeric) The current block\\n\"\n            \"  \\\"currentblockweight\\\": nnn, (numeric) The last block weight\\n\"\n            \"  \\\"currentblocktx\\\": nnn,     (numeric) The last block transaction\\n\"\n            \"  \\\"difficulty\\\": xxx.xxxxx    (numeric) The current difficulty\\n\"\n            \"  \\\"networkhashps\\\": nnn,      (numeric) The network hashes per second\\n\"\n            \"  \\\"pooledtx\\\": n              (numeric) The size of the mempool\\n\"\n            \"  \\\"chain\\\": \\\"xxxx\\\",           (string) current network name as defined in BIP70 (main, test, regtest)\\n\"\n            \"  \\\"warnings\\\": \\\"...\\\"          (string) any network and blockchain warnings\\n\"\n            \"  \\\"errors\\\": \\\"...\\\"            (string) DEPRECATED. Same as warnings. Only shown when sugarchaind is started with -deprecatedrpc=getmininginfo\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getmininginfo\", \"\")\n            + HelpExampleRpc(\"getmininginfo\", \"\")\n        );\n\n\n    LOCK(cs_main);\n\n    UniValue obj(UniValue::VOBJ);\n    obj.push_back(Pair(\"blocks\",           (int)chainActive.Height()));\n    obj.push_back(Pair(\"currentblockweight\", (uint64_t)nLastBlockWeight));\n    obj.push_back(Pair(\"currentblocktx\",   (uint64_t)nLastBlockTx));\n    obj.push_back(Pair(\"difficulty\",       (double)GetDifficulty()));\n    obj.push_back(Pair(\"networkhashps\",    getnetworkhashps(request)));\n    obj.push_back(Pair(\"pooledtx\",         (uint64_t)mempool.size()));\n    obj.push_back(Pair(\"chain\",            Params().NetworkIDString()));\n    if (IsDeprecatedRPCEnabled(\"getmininginfo\")) {\n        obj.push_back(Pair(\"errors\",       GetWarnings(\"statusbar\")));\n    } else {\n        obj.push_back(Pair(\"warnings\",     GetWarnings(\"statusbar\")));\n    }\n    return obj;\n}\n\n\n// NOTE: Unlike wallet RPC (which use BTC values), mining RPCs follow GBT (BIP 22) in using satoshi amounts\nUniValue prioritisetransaction(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 3)\n        throw std::runtime_error(\n            \"prioritisetransaction <txid> <dummy value> <fee delta>\\n\"\n            \"Accepts the transaction into mined blocks at a higher (or lower) priority\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"txid\\\"       (string, required) The transaction id.\\n\"\n            \"2. dummy          (numeric, optional) API-Compatibility for previous API. Must be zero or null.\\n\"\n            \"                  DEPRECATED. For forward compatibility use named arguments and omit this parameter.\\n\"\n            \"3. fee_delta      (numeric, required) The fee value (in satoshis) to add (or subtract, if negative).\\n\"\n            \"                  The fee is not actually paid, only the algorithm for selecting transactions into a block\\n\"\n            \"                  considers the transaction as it would have paid a higher (or lower) fee.\\n\"\n            \"\\nResult:\\n\"\n            \"true              (boolean) Returns true\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"prioritisetransaction\", \"\\\"txid\\\" 0.0 10000\")\n            + HelpExampleRpc(\"prioritisetransaction\", \"\\\"txid\\\", 0.0, 10000\")\n        );\n\n    LOCK(cs_main);\n\n    uint256 hash = ParseHashStr(request.params[0].get_str(), \"txid\");\n    CAmount nAmount = request.params[2].get_int64();\n\n    if (!(request.params[1].isNull() || request.params[1].get_real() == 0)) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Priority is no longer supported, dummy argument to prioritisetransaction must be 0.\");\n    }\n\n    mempool.PrioritiseTransaction(hash, nAmount);\n    return true;\n}\n\n\n// NOTE: Assumes a conclusive result; if result is inconclusive, it must be handled by caller\nstatic UniValue BIP22ValidationResult(const CValidationState& state)\n{\n    if (state.IsValid())\n        return NullUniValue;\n\n    std::string strRejectReason = state.GetRejectReason();\n    if (state.IsError())\n        throw JSONRPCError(RPC_VERIFY_ERROR, strRejectReason);\n    if (state.IsInvalid())\n    {\n        if (strRejectReason.empty())\n            return \"rejected\";\n        return strRejectReason;\n    }\n    // Should be impossible\n    return \"valid?\";\n}\n\nstd::string gbt_vb_name(const Consensus::DeploymentPos pos) {\n    const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];\n    std::string s = vbinfo.name;\n    if (!vbinfo.gbt_force) {\n        s.insert(s.begin(), '!');\n    }\n    return s;\n}\n\nUniValue getblocktemplate(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() > 1)\n        throw std::runtime_error(\n            \"getblocktemplate ( TemplateRequest )\\n\"\n            \"\\nIf the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\\n\"\n            \"It returns data needed to construct a block to work on.\\n\"\n            \"For full specification, see BIPs 22, 23, 9, and 145:\\n\"\n            \"    https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki\\n\"\n            \"    https://github.com/bitcoin/bips/blob/master/bip-0023.mediawiki\\n\"\n            \"    https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki#getblocktemplate_changes\\n\"\n            \"    https://github.com/bitcoin/bips/blob/master/bip-0145.mediawiki\\n\"\n\n            \"\\nArguments:\\n\"\n            \"1. template_request         (json object, optional) A json object in the following spec\\n\"\n            \"     {\\n\"\n            \"       \\\"mode\\\":\\\"template\\\"    (string, optional) This must be set to \\\"template\\\", \\\"proposal\\\" (see BIP 23), or omitted\\n\"\n            \"       \\\"capabilities\\\":[     (array, optional) A list of strings\\n\"\n            \"           \\\"support\\\"          (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\\n\"\n            \"           ,...\\n\"\n            \"       ],\\n\"\n            \"       \\\"rules\\\":[            (array, optional) A list of strings\\n\"\n            \"           \\\"support\\\"          (string) client side supported softfork deployment\\n\"\n            \"           ,...\\n\"\n            \"       ]\\n\"\n            \"     }\\n\"\n            \"\\n\"\n\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"version\\\" : n,                    (numeric) The preferred block version\\n\"\n            \"  \\\"rules\\\" : [ \\\"rulename\\\", ... ],    (array of strings) specific block rules that are to be enforced\\n\"\n            \"  \\\"vbavailable\\\" : {                 (json object) set of pending, supported versionbit (BIP 9) softfork deployments\\n\"\n            \"      \\\"rulename\\\" : bitnumber          (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule\\n\"\n            \"      ,...\\n\"\n            \"  },\\n\"\n            \"  \\\"vbrequired\\\" : n,                 (numeric) bit mask of versionbits the server requires set in submissions\\n\"\n            \"  \\\"previousblockhash\\\" : \\\"xxxx\\\",     (string) The hash of current highest block\\n\"\n            \"  \\\"transactions\\\" : [                (array) contents of non-coinbase transactions that should be included in the next block\\n\"\n            \"      {\\n\"\n            \"         \\\"data\\\" : \\\"xxxx\\\",             (string) transaction data encoded in hexadecimal (byte-for-byte)\\n\"\n            \"         \\\"txid\\\" : \\\"xxxx\\\",             (string) transaction id encoded in little-endian hexadecimal\\n\"\n            \"         \\\"hash\\\" : \\\"xxxx\\\",             (string) hash encoded in little-endian hexadecimal (including witness data)\\n\"\n            \"         \\\"depends\\\" : [                (array) array of numbers \\n\"\n            \"             n                          (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\\n\"\n            \"             ,...\\n\"\n            \"         ],\\n\"\n            \"         \\\"fee\\\": n,                    (numeric) difference in value between transaction inputs and outputs (in satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\\n\"\n            \"         \\\"sigops\\\" : n,                (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero\\n\"\n            \"         \\\"weight\\\" : n,                (numeric) total transaction weight, as counted for purposes of block limits\\n\"\n            \"         \\\"required\\\" : true|false      (boolean) if provided and true, this transaction must be in the final block\\n\"\n            \"      }\\n\"\n            \"      ,...\\n\"\n            \"  ],\\n\"\n            \"  \\\"coinbaseaux\\\" : {                 (json object) data that should be included in the coinbase's scriptSig content\\n\"\n            \"      \\\"flags\\\" : \\\"xx\\\"                  (string) key name is to be ignored, and value included in scriptSig\\n\"\n            \"  },\\n\"\n            \"  \\\"coinbasevalue\\\" : n,              (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)\\n\"\n            \"  \\\"coinbasetxn\\\" : { ... },          (json object) information for coinbase transaction\\n\"\n            \"  \\\"target\\\" : \\\"xxxx\\\",                (string) The hash target\\n\"\n            \"  \\\"mintime\\\" : xxx,                  (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\\n\"\n            \"  \\\"mutable\\\" : [                     (array of string) list of ways the block template may be changed \\n\"\n            \"     \\\"value\\\"                          (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\\n\"\n            \"     ,...\\n\"\n            \"  ],\\n\"\n            \"  \\\"noncerange\\\" : \\\"00000000ffffffff\\\",(string) A range of valid nonces\\n\"\n            \"  \\\"sigoplimit\\\" : n,                 (numeric) limit of sigops in blocks\\n\"\n            \"  \\\"sizelimit\\\" : n,                  (numeric) limit of block size\\n\"\n            \"  \\\"weightlimit\\\" : n,                (numeric) limit of block weight\\n\"\n            \"  \\\"curtime\\\" : ttt,                  (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\\n\"\n            \"  \\\"bits\\\" : \\\"xxxxxxxx\\\",              (string) compressed target of next block\\n\"\n            \"  \\\"height\\\" : n                      (numeric) The height of the next block\\n\"\n            \"}\\n\"\n\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getblocktemplate\", \"\")\n            + HelpExampleRpc(\"getblocktemplate\", \"\")\n         );\n\n    LOCK(cs_main);\n\n    std::string strMode = \"template\";\n    UniValue lpval = NullUniValue;\n    std::set<std::string> setClientRules;\n    int64_t nMaxVersionPreVB = -1;\n    if (!request.params[0].isNull())\n    {\n        const UniValue& oparam = request.params[0].get_obj();\n        const UniValue& modeval = find_value(oparam, \"mode\");\n        if (modeval.isStr())\n            strMode = modeval.get_str();\n        else if (modeval.isNull())\n        {\n            /* Do nothing */\n        }\n        else\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid mode\");\n        lpval = find_value(oparam, \"longpollid\");\n\n        if (strMode == \"proposal\")\n        {\n            const UniValue& dataval = find_value(oparam, \"data\");\n            if (!dataval.isStr())\n                throw JSONRPCError(RPC_TYPE_ERROR, \"Missing data String key for proposal\");\n\n            CBlock block;\n            if (!DecodeHexBlk(block, dataval.get_str()))\n                throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"Block decode failed\");\n\n            uint256 hash = block.GetHash();\n            BlockMap::iterator mi = mapBlockIndex.find(hash);\n            if (mi != mapBlockIndex.end()) {\n                CBlockIndex *pindex = mi->second;\n                if (pindex->IsValid(BLOCK_VALID_SCRIPTS))\n                    return \"duplicate\";\n                if (pindex->nStatus & BLOCK_FAILED_MASK)\n                    return \"duplicate-invalid\";\n                return \"duplicate-inconclusive\";\n            }\n\n            CBlockIndex* const pindexPrev = chainActive.Tip();\n            // TestBlockValidity only supports blocks built on the current Tip\n            if (block.hashPrevBlock != pindexPrev->GetBlockHash())\n                return \"inconclusive-not-best-prevblk\";\n            CValidationState state;\n            TestBlockValidity(state, Params(), block, pindexPrev, false, true);\n            return BIP22ValidationResult(state);\n        }\n\n        const UniValue& aClientRules = find_value(oparam, \"rules\");\n        if (aClientRules.isArray()) {\n            for (unsigned int i = 0; i < aClientRules.size(); ++i) {\n                const UniValue& v = aClientRules[i];\n                setClientRules.insert(v.get_str());\n            }\n        } else {\n            // NOTE: It is important that this NOT be read if versionbits is supported\n            const UniValue& uvMaxVersion = find_value(oparam, \"maxversion\");\n            if (uvMaxVersion.isNum()) {\n                nMaxVersionPreVB = uvMaxVersion.get_int64();\n            }\n        }\n    }\n\n    if (strMode != \"template\")\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid mode\");\n\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0)\n        throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, \"Sugarchain is not connected!\");\n\n    if (IsInitialBlockDownload())\n        throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, \"Sugarchain is downloading blocks...\");\n\n    static unsigned int nTransactionsUpdatedLast;\n\n    if (!lpval.isNull())\n    {\n        // Wait to respond until either the best block changes, OR a minute has passed and there are more transactions\n        uint256 hashWatchedChain;\n        std::chrono::steady_clock::time_point checktxtime;\n        unsigned int nTransactionsUpdatedLastLP;\n\n        if (lpval.isStr())\n        {\n            // Format: <hashBestChain><nTransactionsUpdatedLast>\n            std::string lpstr = lpval.get_str();\n\n            hashWatchedChain.SetHex(lpstr.substr(0, 64));\n            nTransactionsUpdatedLastLP = atoi64(lpstr.substr(64));\n        }\n        else\n        {\n            // NOTE: Spec does not specify behaviour for non-string longpollid, but this makes testing easier\n            hashWatchedChain = chainActive.Tip()->GetBlockHash();\n            nTransactionsUpdatedLastLP = nTransactionsUpdatedLast;\n        }\n\n        // Release the wallet and main lock while waiting\n        LEAVE_CRITICAL_SECTION(cs_main);\n        {\n            checktxtime = std::chrono::steady_clock::now() + std::chrono::minutes(1);\n\n            WaitableLock lock(csBestBlock);\n            while (hashBestBlock == hashWatchedChain && IsRPCRunning())\n            {\n                if (cvBlockChange.wait_until(lock, checktxtime) == std::cv_status::timeout)\n                {\n                    // Timeout: Check transactions for update\n                    if (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLastLP)\n                        break;\n                    checktxtime += std::chrono::seconds(10);\n                }\n            }\n        }\n        ENTER_CRITICAL_SECTION(cs_main);\n\n        if (!IsRPCRunning())\n            throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, \"Shutting down\");\n        // TODO: Maybe recheck connections/IBD and (if something wrong) send an expires-immediately template to stop miners?\n    }\n\n    const struct VBDeploymentInfo& segwit_info = VersionBitsDeploymentInfo[Consensus::DEPLOYMENT_SEGWIT];\n    // If the caller is indicating segwit support, then allow CreateNewBlock()\n    // to select witness transactions, after segwit activates (otherwise\n    // don't).\n    bool fSupportsSegwit = setClientRules.find(segwit_info.name) != setClientRules.end();\n\n    // Update block\n    static CBlockIndex* pindexPrev;\n    static int64_t nStart;\n    static std::unique_ptr<CBlockTemplate> pblocktemplate;\n    // Cache whether the last invocation was with segwit support, to avoid returning\n    // a segwit-block to a non-segwit caller.\n    static bool fLastTemplateSupportsSegwit = true;\n    if (pindexPrev != chainActive.Tip() ||\n        (mempool.GetTransactionsUpdated() != nTransactionsUpdatedLast && GetTime() - nStart > 5) ||\n        fLastTemplateSupportsSegwit != fSupportsSegwit)\n    {\n        // Clear pindexPrev so future calls make a new block, despite any failures from here on\n        pindexPrev = nullptr;\n\n        // Store the pindexBest used before CreateNewBlock, to avoid races\n        nTransactionsUpdatedLast = mempool.GetTransactionsUpdated();\n        CBlockIndex* pindexPrevNew = chainActive.Tip();\n        nStart = GetTime();\n        fLastTemplateSupportsSegwit = fSupportsSegwit;\n\n        // Create new block\n        CScript scriptDummy = CScript() << OP_TRUE;\n        pblocktemplate = BlockAssembler(Params()).CreateNewBlock(scriptDummy, fSupportsSegwit);\n        if (!pblocktemplate)\n            throw JSONRPCError(RPC_OUT_OF_MEMORY, \"Out of memory\");\n\n        // Need to update only after we know CreateNewBlock succeeded\n        pindexPrev = pindexPrevNew;\n    }\n    CBlock* pblock = &pblocktemplate->block; // pointer for convenience\n    const Consensus::Params& consensusParams = Params().GetConsensus();\n\n    // Update nTime\n    UpdateTime(pblock, consensusParams, pindexPrev);\n    pblock->nNonce = 0;\n\n    // NOTE: If at some point we support pre-segwit miners post-segwit-activation, this needs to take segwit support into consideration\n    const bool fPreSegWit = (THRESHOLD_ACTIVE != VersionBitsState(pindexPrev, consensusParams, Consensus::DEPLOYMENT_SEGWIT, versionbitscache));\n\n    UniValue aCaps(UniValue::VARR); aCaps.push_back(\"proposal\");\n\n    UniValue transactions(UniValue::VARR);\n    std::map<uint256, int64_t> setTxIndex;\n    int i = 0;\n    for (const auto& it : pblock->vtx) {\n        const CTransaction& tx = *it;\n        uint256 txHash = tx.GetHash();\n        setTxIndex[txHash] = i++;\n\n        if (tx.IsCoinBase())\n            continue;\n\n        UniValue entry(UniValue::VOBJ);\n\n        entry.push_back(Pair(\"data\", EncodeHexTx(tx)));\n        entry.push_back(Pair(\"txid\", txHash.GetHex()));\n        entry.push_back(Pair(\"hash\", tx.GetWitnessHash().GetHex()));\n\n        UniValue deps(UniValue::VARR);\n        for (const CTxIn &in : tx.vin)\n        {\n            if (setTxIndex.count(in.prevout.hash))\n                deps.push_back(setTxIndex[in.prevout.hash]);\n        }\n        entry.push_back(Pair(\"depends\", deps));\n\n        int index_in_template = i - 1;\n        entry.push_back(Pair(\"fee\", pblocktemplate->vTxFees[index_in_template]));\n        int64_t nTxSigOps = pblocktemplate->vTxSigOpsCost[index_in_template];\n        if (fPreSegWit) {\n            assert(nTxSigOps % WITNESS_SCALE_FACTOR == 0);\n            nTxSigOps /= WITNESS_SCALE_FACTOR;\n        }\n        entry.push_back(Pair(\"sigops\", nTxSigOps));\n        entry.push_back(Pair(\"weight\", GetTransactionWeight(tx)));\n\n        transactions.push_back(entry);\n    }\n\n    UniValue aux(UniValue::VOBJ);\n    aux.push_back(Pair(\"flags\", HexStr(COINBASE_FLAGS.begin(), COINBASE_FLAGS.end())));\n\n    arith_uint256 hashTarget = arith_uint256().SetCompact(pblock->nBits);\n\n    UniValue aMutable(UniValue::VARR);\n    aMutable.push_back(\"time\");\n    aMutable.push_back(\"transactions\");\n    aMutable.push_back(\"prevblock\");\n\n    UniValue result(UniValue::VOBJ);\n    result.push_back(Pair(\"capabilities\", aCaps));\n\n    UniValue aRules(UniValue::VARR);\n    UniValue vbavailable(UniValue::VOBJ);\n    for (int j = 0; j < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; ++j) {\n        Consensus::DeploymentPos pos = Consensus::DeploymentPos(j);\n        ThresholdState state = VersionBitsState(pindexPrev, consensusParams, pos, versionbitscache);\n        switch (state) {\n            case THRESHOLD_DEFINED:\n            case THRESHOLD_FAILED:\n                // Not exposed to GBT at all\n                break;\n            case THRESHOLD_LOCKED_IN:\n                // Ensure bit is set in block version\n                pblock->nVersion |= VersionBitsMask(consensusParams, pos);\n                // FALL THROUGH to get vbavailable set...\n            case THRESHOLD_STARTED:\n            {\n                const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];\n                vbavailable.push_back(Pair(gbt_vb_name(pos), consensusParams.vDeployments[pos].bit));\n                if (setClientRules.find(vbinfo.name) == setClientRules.end()) {\n                    if (!vbinfo.gbt_force) {\n                        // If the client doesn't support this, don't indicate it in the [default] version\n                        pblock->nVersion &= ~VersionBitsMask(consensusParams, pos);\n                    }\n                }\n                break;\n            }\n            case THRESHOLD_ACTIVE:\n            {\n                // Add to rules only\n                const struct VBDeploymentInfo& vbinfo = VersionBitsDeploymentInfo[pos];\n                aRules.push_back(gbt_vb_name(pos));\n                if (setClientRules.find(vbinfo.name) == setClientRules.end()) {\n                    // Not supported by the client; make sure it's safe to proceed\n                    if (!vbinfo.gbt_force) {\n                        // If we do anything other than throw an exception here, be sure version/force isn't sent to old clients\n                        throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf(\"Support for '%s' rule requires explicit client support\", vbinfo.name));\n                    }\n                }\n                break;\n            }\n        }\n    }\n    result.push_back(Pair(\"version\", pblock->nVersion));\n    result.push_back(Pair(\"rules\", aRules));\n    result.push_back(Pair(\"vbavailable\", vbavailable));\n    result.push_back(Pair(\"vbrequired\", int(0)));\n\n    if (nMaxVersionPreVB >= 2) {\n        // If VB is supported by the client, nMaxVersionPreVB is -1, so we won't get here\n        // Because BIP 34 changed how the generation transaction is serialized, we can only use version/force back to v2 blocks\n        // This is safe to do [otherwise-]unconditionally only because we are throwing an exception above if a non-force deployment gets activated\n        // Note that this can probably also be removed entirely after the first BIP9 non-force deployment (ie, probably segwit) gets activated\n        aMutable.push_back(\"version/force\");\n    }\n\n    result.push_back(Pair(\"previousblockhash\", pblock->hashPrevBlock.GetHex()));\n    result.push_back(Pair(\"transactions\", transactions));\n    result.push_back(Pair(\"coinbaseaux\", aux));\n    result.push_back(Pair(\"coinbasevalue\", (int64_t)pblock->vtx[0]->vout[0].nValue));\n    result.push_back(Pair(\"longpollid\", chainActive.Tip()->GetBlockHash().GetHex() + i64tostr(nTransactionsUpdatedLast)));\n    result.push_back(Pair(\"target\", hashTarget.GetHex()));\n    result.push_back(Pair(\"mintime\", (int64_t)pindexPrev->GetMedianTimePast()+1));\n    result.push_back(Pair(\"mutable\", aMutable));\n    result.push_back(Pair(\"noncerange\", \"00000000ffffffff\"));\n    int64_t nSigOpLimit = MAX_BLOCK_SIGOPS_COST;\n    int64_t nSizeLimit = MAX_BLOCK_SERIALIZED_SIZE;\n    if (fPreSegWit) {\n        assert(nSigOpLimit % WITNESS_SCALE_FACTOR == 0);\n        nSigOpLimit /= WITNESS_SCALE_FACTOR;\n        assert(nSizeLimit % WITNESS_SCALE_FACTOR == 0);\n        nSizeLimit /= WITNESS_SCALE_FACTOR;\n    }\n    result.push_back(Pair(\"sigoplimit\", nSigOpLimit));\n    result.push_back(Pair(\"sizelimit\", nSizeLimit));\n    if (!fPreSegWit) {\n        result.push_back(Pair(\"weightlimit\", (int64_t)MAX_BLOCK_WEIGHT));\n    }\n    result.push_back(Pair(\"curtime\", pblock->GetBlockTime()));\n    result.push_back(Pair(\"bits\", strprintf(\"%08x\", pblock->nBits)));\n    result.push_back(Pair(\"height\", (int64_t)(pindexPrev->nHeight+1)));\n\n    if (!pblocktemplate->vchCoinbaseCommitment.empty() && fSupportsSegwit) {\n        result.push_back(Pair(\"default_witness_commitment\", HexStr(pblocktemplate->vchCoinbaseCommitment.begin(), pblocktemplate->vchCoinbaseCommitment.end())));\n    }\n\n    return result;\n}\n\nclass submitblock_StateCatcher : public CValidationInterface\n{\npublic:\n    uint256 hash;\n    bool found;\n    CValidationState state;\n\n    explicit submitblock_StateCatcher(const uint256 &hashIn) : hash(hashIn), found(false), state() {}\n\nprotected:\n    void BlockChecked(const CBlock& block, const CValidationState& stateIn) override {\n        if (block.GetHash() != hash)\n            return;\n        found = true;\n        state = stateIn;\n    }\n};\n\nUniValue submitblock(const JSONRPCRequest& request)\n{\n    // We allow 2 arguments for compliance with BIP22. Argument 2 is ignored.\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) {\n        throw std::runtime_error(\n            \"submitblock \\\"hexdata\\\"  ( \\\"dummy\\\" )\\n\"\n            \"\\nAttempts to submit new block to network.\\n\"\n            \"See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\\n\"\n\n            \"\\nArguments\\n\"\n            \"1. \\\"hexdata\\\"        (string, required) the hex-encoded block data to submit\\n\"\n            \"2. \\\"dummy\\\"          (optional) dummy value, for compatibility with BIP22. This value is ignored.\\n\"\n            \"\\nResult:\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"submitblock\", \"\\\"mydata\\\"\")\n            + HelpExampleRpc(\"submitblock\", \"\\\"mydata\\\"\")\n        );\n    }\n\n    std::shared_ptr<CBlock> blockptr = std::make_shared<CBlock>();\n    CBlock& block = *blockptr;\n    if (!DecodeHexBlk(block, request.params[0].get_str())) {\n        throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"Block decode failed\");\n    }\n\n    if (block.vtx.empty() || !block.vtx[0]->IsCoinBase()) {\n        throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"Block does not start with a coinbase\");\n    }\n\n    uint256 hash = block.GetHash();\n    bool fBlockPresent = false;\n    {\n        LOCK(cs_main);\n        BlockMap::iterator mi = mapBlockIndex.find(hash);\n        if (mi != mapBlockIndex.end()) {\n            CBlockIndex *pindex = mi->second;\n            if (pindex->IsValid(BLOCK_VALID_SCRIPTS)) {\n                return \"duplicate\";\n            }\n            if (pindex->nStatus & BLOCK_FAILED_MASK) {\n                return \"duplicate-invalid\";\n            }\n            // Otherwise, we might only have the header - process the block before returning\n            fBlockPresent = true;\n        }\n    }\n\n    {\n        LOCK(cs_main);\n        BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock);\n        if (mi != mapBlockIndex.end()) {\n            UpdateUncommittedBlockStructures(block, mi->second, Params().GetConsensus());\n        }\n    }\n\n    submitblock_StateCatcher sc(block.GetHash());\n    RegisterValidationInterface(&sc);\n    bool fAccepted = ProcessNewBlock(Params(), blockptr, true, nullptr);\n    UnregisterValidationInterface(&sc);\n    if (fBlockPresent) {\n        if (fAccepted && !sc.found) {\n            return \"duplicate-inconclusive\";\n        }\n        return \"duplicate\";\n    }\n    if (!sc.found) {\n        return \"inconclusive\";\n    }\n    return BIP22ValidationResult(sc.state);\n}\n\nUniValue estimatefee(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"estimatefee nblocks\\n\"\n            \"\\nDEPRECATED. Please use estimatesmartfee for more intelligent estimates.\"\n            \"\\nEstimates the approximate fee per kilobyte needed for a transaction to begin\\n\"\n            \"confirmation within nblocks blocks. Uses virtual transaction size of transaction\\n\"\n            \"as defined in BIP 141 (witness data is discounted).\\n\"\n            \"\\nArguments:\\n\"\n            \"1. nblocks     (numeric, required)\\n\"\n            \"\\nResult:\\n\"\n            \"n              (numeric) estimated fee-per-kilobyte\\n\"\n            \"\\n\"\n            \"A negative value is returned if not enough transactions and blocks\\n\"\n            \"have been observed to make an estimate.\\n\"\n            \"-1 is always returned for nblocks == 1 as it is impossible to calculate\\n\"\n            \"a fee that is high enough to get reliably included in the next block.\\n\"\n            \"\\nExample:\\n\"\n            + HelpExampleCli(\"estimatefee\", \"6\")\n            );\n\n    if (!IsDeprecatedRPCEnabled(\"estimatefee\")) {\n        throw JSONRPCError(RPC_METHOD_DEPRECATED, \"estimatefee is deprecated and will be fully removed in v0.17. \"\n            \"To use estimatefee in v0.16, restart sugarchaind with -deprecatedrpc=estimatefee.\\n\"\n            \"Projects should transition to using estimatesmartfee before upgrading to v0.17\");\n    }\n\n    RPCTypeCheck(request.params, {UniValue::VNUM});\n\n    int nBlocks = request.params[0].get_int();\n    if (nBlocks < 1)\n        nBlocks = 1;\n\n    CFeeRate feeRate = ::feeEstimator.estimateFee(nBlocks);\n    if (feeRate == CFeeRate(0))\n        return -1.0;\n\n    return ValueFromAmount(feeRate.GetFeePerK());\n}\n\nUniValue estimatesmartfee(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"estimatesmartfee conf_target (\\\"estimate_mode\\\")\\n\"\n            \"\\nEstimates the approximate fee per kilobyte needed for a transaction to begin\\n\"\n            \"confirmation within conf_target blocks if possible and return the number of blocks\\n\"\n            \"for which the estimate is valid. Uses virtual transaction size as defined\\n\"\n            \"in BIP 141 (witness data is discounted).\\n\"\n            \"\\nArguments:\\n\"\n            \"1. conf_target     (numeric) Confirmation target in blocks (1 - 1008)\\n\"\n            \"2. \\\"estimate_mode\\\" (string, optional, default=CONSERVATIVE) The fee estimate mode.\\n\"\n            \"                   Whether to return a more conservative estimate which also satisfies\\n\"\n            \"                   a longer history. A conservative estimate potentially returns a\\n\"\n            \"                   higher feerate and is more likely to be sufficient for the desired\\n\"\n            \"                   target, but is not as responsive to short term drops in the\\n\"\n            \"                   prevailing fee market.  Must be one of:\\n\"\n            \"       \\\"UNSET\\\" (defaults to CONSERVATIVE)\\n\"\n            \"       \\\"ECONOMICAL\\\"\\n\"\n            \"       \\\"CONSERVATIVE\\\"\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"feerate\\\" : x.x,     (numeric, optional) estimate fee rate in \" + CURRENCY_UNIT + \"/kB\\n\"\n            \"  \\\"errors\\\": [ str... ] (json array of strings, optional) Errors encountered during processing\\n\"\n            \"  \\\"blocks\\\" : n         (numeric) block number where estimate was found\\n\"\n            \"}\\n\"\n            \"\\n\"\n            \"The request target will be clamped between 2 and the highest target\\n\"\n            \"fee estimation is able to return based on how long it has been running.\\n\"\n            \"An error is returned if not enough transactions and blocks\\n\"\n            \"have been observed to make an estimate for any number of blocks.\\n\"\n            \"\\nExample:\\n\"\n            + HelpExampleCli(\"estimatesmartfee\", \"6\")\n            );\n\n    RPCTypeCheck(request.params, {UniValue::VNUM, UniValue::VSTR});\n    RPCTypeCheckArgument(request.params[0], UniValue::VNUM);\n    unsigned int conf_target = ParseConfirmTarget(request.params[0]);\n    bool conservative = true;\n    if (!request.params[1].isNull()) {\n        FeeEstimateMode fee_mode;\n        if (!FeeModeFromString(request.params[1].get_str(), fee_mode)) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid estimate_mode parameter\");\n        }\n        if (fee_mode == FeeEstimateMode::ECONOMICAL) conservative = false;\n    }\n\n    UniValue result(UniValue::VOBJ);\n    UniValue errors(UniValue::VARR);\n    FeeCalculation feeCalc;\n    CFeeRate feeRate = ::feeEstimator.estimateSmartFee(conf_target, &feeCalc, conservative);\n    if (feeRate != CFeeRate(0)) {\n        result.push_back(Pair(\"feerate\", ValueFromAmount(feeRate.GetFeePerK())));\n    } else {\n        errors.push_back(\"Insufficient data or no feerate found\");\n        result.push_back(Pair(\"errors\", errors));\n    }\n    result.push_back(Pair(\"blocks\", feeCalc.returnedTarget));\n    return result;\n}\n\nUniValue estimaterawfee(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"estimaterawfee conf_target (threshold)\\n\"\n            \"\\nWARNING: This interface is unstable and may disappear or change!\\n\"\n            \"\\nWARNING: This is an advanced API call that is tightly coupled to the specific\\n\"\n            \"         implementation of fee estimation. The parameters it can be called with\\n\"\n            \"         and the results it returns will change if the internal implementation changes.\\n\"\n            \"\\nEstimates the approximate fee per kilobyte needed for a transaction to begin\\n\"\n            \"confirmation within conf_target blocks if possible. Uses virtual transaction size as\\n\"\n            \"defined in BIP 141 (witness data is discounted).\\n\"\n            \"\\nArguments:\\n\"\n            \"1. conf_target (numeric) Confirmation target in blocks (1 - 1008)\\n\"\n            \"2. threshold   (numeric, optional) The proportion of transactions in a given feerate range that must have been\\n\"\n            \"               confirmed within conf_target in order to consider those feerates as high enough and proceed to check\\n\"\n            \"               lower buckets.  Default: 0.95\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"short\\\" : {            (json object, optional) estimate for short time horizon\\n\"\n            \"      \\\"feerate\\\" : x.x,        (numeric, optional) estimate fee rate in \" + CURRENCY_UNIT + \"/kB\\n\"\n            \"      \\\"decay\\\" : x.x,          (numeric) exponential decay (per block) for historical moving average of confirmation data\\n\"\n            \"      \\\"scale\\\" : x,            (numeric) The resolution of confirmation targets at this time horizon\\n\"\n            \"      \\\"pass\\\" : {              (json object, optional) information about the lowest range of feerates to succeed in meeting the threshold\\n\"\n            \"          \\\"startrange\\\" : x.x,     (numeric) start of feerate range\\n\"\n            \"          \\\"endrange\\\" : x.x,       (numeric) end of feerate range\\n\"\n            \"          \\\"withintarget\\\" : x.x,   (numeric) number of txs over history horizon in the feerate range that were confirmed within target\\n\"\n            \"          \\\"totalconfirmed\\\" : x.x, (numeric) number of txs over history horizon in the feerate range that were confirmed at any point\\n\"\n            \"          \\\"inmempool\\\" : x.x,      (numeric) current number of txs in mempool in the feerate range unconfirmed for at least target blocks\\n\"\n            \"          \\\"leftmempool\\\" : x.x,    (numeric) number of txs over history horizon in the feerate range that left mempool unconfirmed after target\\n\"\n            \"      },\\n\"\n            \"      \\\"fail\\\" : { ... },       (json object, optional) information about the highest range of feerates to fail to meet the threshold\\n\"\n            \"      \\\"errors\\\":  [ str... ]   (json array of strings, optional) Errors encountered during processing\\n\"\n            \"  },\\n\"\n            \"  \\\"medium\\\" : { ... },    (json object, optional) estimate for medium time horizon\\n\"\n            \"  \\\"long\\\" : { ... }       (json object) estimate for long time horizon\\n\"\n            \"}\\n\"\n            \"\\n\"\n            \"Results are returned for any horizon which tracks blocks up to the confirmation target.\\n\"\n            \"\\nExample:\\n\"\n            + HelpExampleCli(\"estimaterawfee\", \"6 0.9\")\n            );\n\n    RPCTypeCheck(request.params, {UniValue::VNUM, UniValue::VNUM}, true);\n    RPCTypeCheckArgument(request.params[0], UniValue::VNUM);\n    unsigned int conf_target = ParseConfirmTarget(request.params[0]);\n    double threshold = 0.95;\n    if (!request.params[1].isNull()) {\n        threshold = request.params[1].get_real();\n    }\n    if (threshold < 0 || threshold > 1) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid threshold\");\n    }\n\n    UniValue result(UniValue::VOBJ);\n\n    for (FeeEstimateHorizon horizon : {FeeEstimateHorizon::SHORT_HALFLIFE, FeeEstimateHorizon::MED_HALFLIFE, FeeEstimateHorizon::LONG_HALFLIFE}) {\n        CFeeRate feeRate;\n        EstimationResult buckets;\n\n        // Only output results for horizons which track the target\n        if (conf_target > ::feeEstimator.HighestTargetTracked(horizon)) continue;\n\n        feeRate = ::feeEstimator.estimateRawFee(conf_target, threshold, horizon, &buckets);\n        UniValue horizon_result(UniValue::VOBJ);\n        UniValue errors(UniValue::VARR);\n        UniValue passbucket(UniValue::VOBJ);\n        passbucket.push_back(Pair(\"startrange\", round(buckets.pass.start)));\n        passbucket.push_back(Pair(\"endrange\", round(buckets.pass.end)));\n        passbucket.push_back(Pair(\"withintarget\", round(buckets.pass.withinTarget * 100.0) / 100.0));\n        passbucket.push_back(Pair(\"totalconfirmed\", round(buckets.pass.totalConfirmed * 100.0) / 100.0));\n        passbucket.push_back(Pair(\"inmempool\", round(buckets.pass.inMempool * 100.0) / 100.0));\n        passbucket.push_back(Pair(\"leftmempool\", round(buckets.pass.leftMempool * 100.0) / 100.0));\n        UniValue failbucket(UniValue::VOBJ);\n        failbucket.push_back(Pair(\"startrange\", round(buckets.fail.start)));\n        failbucket.push_back(Pair(\"endrange\", round(buckets.fail.end)));\n        failbucket.push_back(Pair(\"withintarget\", round(buckets.fail.withinTarget * 100.0) / 100.0));\n        failbucket.push_back(Pair(\"totalconfirmed\", round(buckets.fail.totalConfirmed * 100.0) / 100.0));\n        failbucket.push_back(Pair(\"inmempool\", round(buckets.fail.inMempool * 100.0) / 100.0));\n        failbucket.push_back(Pair(\"leftmempool\", round(buckets.fail.leftMempool * 100.0) / 100.0));\n\n        // CFeeRate(0) is used to indicate error as a return value from estimateRawFee\n        if (feeRate != CFeeRate(0)) {\n            horizon_result.push_back(Pair(\"feerate\", ValueFromAmount(feeRate.GetFeePerK())));\n            horizon_result.push_back(Pair(\"decay\", buckets.decay));\n            horizon_result.push_back(Pair(\"scale\", (int)buckets.scale));\n            horizon_result.push_back(Pair(\"pass\", passbucket));\n            // buckets.fail.start == -1 indicates that all buckets passed, there is no fail bucket to output\n            if (buckets.fail.start != -1) horizon_result.push_back(Pair(\"fail\", failbucket));\n        } else {\n            // Output only information that is still meaningful in the event of error\n            horizon_result.push_back(Pair(\"decay\", buckets.decay));\n            horizon_result.push_back(Pair(\"scale\", (int)buckets.scale));\n            horizon_result.push_back(Pair(\"fail\", failbucket));\n            errors.push_back(\"Insufficient data or no feerate found which meets threshold\");\n            horizon_result.push_back(Pair(\"errors\",errors));\n        }\n        result.push_back(Pair(StringForFeeEstimateHorizon(horizon), horizon_result));\n    }\n    return result;\n}\n\nstatic const CRPCCommand commands[] =\n{ //  category              name                      actor (function)         argNames\n  //  --------------------- ------------------------  -----------------------  ----------\n    { \"mining\",             \"getnetworkhashps\",       &getnetworkhashps,       {\"nblocks\",\"height\"} },\n    { \"mining\",             \"getmininginfo\",          &getmininginfo,          {} },\n    { \"mining\",             \"prioritisetransaction\",  &prioritisetransaction,  {\"txid\",\"dummy\",\"fee_delta\"} },\n    { \"mining\",             \"getblocktemplate\",       &getblocktemplate,       {\"template_request\"} },\n    { \"mining\",             \"submitblock\",            &submitblock,            {\"hexdata\",\"dummy\"} },\n\n\n    { \"generating\",         \"generatetoaddress\",      &generatetoaddress,      {\"nblocks\",\"address\",\"maxtries\"} },\n\n    { \"util\",               \"estimatefee\",            &estimatefee,            {\"nblocks\"} },\n    { \"util\",               \"estimatesmartfee\",       &estimatesmartfee,       {\"conf_target\", \"estimate_mode\"} },\n\n    { \"hidden\",             \"estimaterawfee\",         &estimaterawfee,         {\"conf_target\", \"threshold\"} },\n};\n\nvoid RegisterMiningRPCCommands(CRPCTable &t)\n{\n    for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)\n        t.appendCommand(commands[vcidx].name, &commands[vcidx]);\n}\n"
  },
  {
    "path": "src/rpc/mining.h",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_RPC_MINING_H\n#define BITCOIN_RPC_MINING_H\n\n#include <script/script.h>\n\n#include <univalue.h>\n\n/** Generate blocks (mine) */\nUniValue generateBlocks(std::shared_ptr<CReserveScript> coinbaseScript, int nGenerate, uint64_t nMaxTries, bool keepScript);\n\n/** Check bounds on a command line confirm target */\nunsigned int ParseConfirmTarget(const UniValue& value);\n\n#endif\n"
  },
  {
    "path": "src/rpc/misc.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <base58.h>\n#include <chain.h>\n#include <clientversion.h>\n#include <core_io.h>\n#include <crypto/ripemd160.h>\n#include <init.h>\n#include <validation.h>\n#include <httpserver.h>\n#include <net.h>\n#include <netbase.h>\n#include <rpc/blockchain.h>\n#include <rpc/server.h>\n#include <rpc/util.h>\n#include <timedata.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#ifdef ENABLE_WALLET\n#include <wallet/rpcwallet.h>\n#include <wallet/wallet.h>\n#include <wallet/walletdb.h>\n#endif\n#include <warnings.h>\n\n#include <stdint.h>\n#ifdef HAVE_MALLOC_INFO\n#include <malloc.h>\n#endif\n\n#include <univalue.h>\n\n#ifdef ENABLE_WALLET\nclass DescribeAddressVisitor : public boost::static_visitor<UniValue>\n{\npublic:\n    CWallet * const pwallet;\n\n    explicit DescribeAddressVisitor(CWallet *_pwallet) : pwallet(_pwallet) {}\n\n    void ProcessSubScript(const CScript& subscript, UniValue& obj, bool include_addresses = false) const\n    {\n        // Always present: script type and redeemscript\n        txnouttype which_type;\n        std::vector<std::vector<unsigned char>> solutions_data;\n        Solver(subscript, which_type, solutions_data);\n        obj.pushKV(\"script\", GetTxnOutputType(which_type));\n        obj.pushKV(\"hex\", HexStr(subscript.begin(), subscript.end()));\n\n        CTxDestination embedded;\n        UniValue a(UniValue::VARR);\n        if (ExtractDestination(subscript, embedded)) {\n            // Only when the script corresponds to an address.\n            UniValue subobj = boost::apply_visitor(*this, embedded);\n            subobj.pushKV(\"address\", EncodeDestination(embedded));\n            subobj.pushKV(\"scriptPubKey\", HexStr(subscript.begin(), subscript.end()));\n            // Always report the pubkey at the top level, so that `getnewaddress()['pubkey']` always works.\n            if (subobj.exists(\"pubkey\")) obj.pushKV(\"pubkey\", subobj[\"pubkey\"]);\n            obj.pushKV(\"embedded\", std::move(subobj));\n            if (include_addresses) a.push_back(EncodeDestination(embedded));\n        } else if (which_type == TX_MULTISIG) {\n            // Also report some information on multisig scripts (which do not have a corresponding address).\n            // TODO: abstract out the common functionality between this logic and ExtractDestinations.\n            obj.pushKV(\"sigsrequired\", solutions_data[0][0]);\n            UniValue pubkeys(UniValue::VARR);\n            for (size_t i = 1; i < solutions_data.size() - 1; ++i) {\n                CPubKey key(solutions_data[i].begin(), solutions_data[i].end());\n                if (include_addresses) a.push_back(EncodeDestination(key.GetID()));\n                pubkeys.push_back(HexStr(key.begin(), key.end()));\n            }\n            obj.pushKV(\"pubkeys\", std::move(pubkeys));\n        }\n\n        // The \"addresses\" field is confusing because it refers to public keys using their P2PKH address.\n        // For that reason, only add the 'addresses' field when needed for backward compatibility. New applications\n        // can use the 'embedded'->'address' field for P2SH or P2WSH wrapped addresses, and 'pubkeys' for\n        // inspecting multisig participants.\n        if (include_addresses) obj.pushKV(\"addresses\", std::move(a));\n    }\n\n    UniValue operator()(const CNoDestination &dest) const { return UniValue(UniValue::VOBJ); }\n\n    UniValue operator()(const CKeyID &keyID) const {\n        UniValue obj(UniValue::VOBJ);\n        CPubKey vchPubKey;\n        obj.push_back(Pair(\"isscript\", false));\n        obj.push_back(Pair(\"iswitness\", false));\n        if (pwallet && pwallet->GetPubKey(keyID, vchPubKey)) {\n            obj.push_back(Pair(\"pubkey\", HexStr(vchPubKey)));\n            obj.push_back(Pair(\"iscompressed\", vchPubKey.IsCompressed()));\n        }\n        return obj;\n    }\n\n    UniValue operator()(const CScriptID &scriptID) const {\n        UniValue obj(UniValue::VOBJ);\n        CScript subscript;\n        obj.push_back(Pair(\"isscript\", true));\n        obj.push_back(Pair(\"iswitness\", false));\n        if (pwallet && pwallet->GetCScript(scriptID, subscript)) {\n            ProcessSubScript(subscript, obj, true);\n        }\n        return obj;\n    }\n\n    UniValue operator()(const WitnessV0KeyHash& id) const\n    {\n        UniValue obj(UniValue::VOBJ);\n        CPubKey pubkey;\n        obj.push_back(Pair(\"isscript\", false));\n        obj.push_back(Pair(\"iswitness\", true));\n        obj.push_back(Pair(\"witness_version\", 0));\n        obj.push_back(Pair(\"witness_program\", HexStr(id.begin(), id.end())));\n        if (pwallet && pwallet->GetPubKey(CKeyID(id), pubkey)) {\n            obj.push_back(Pair(\"pubkey\", HexStr(pubkey)));\n        }\n        return obj;\n    }\n\n    UniValue operator()(const WitnessV0ScriptHash& id) const\n    {\n        UniValue obj(UniValue::VOBJ);\n        CScript subscript;\n        obj.push_back(Pair(\"isscript\", true));\n        obj.push_back(Pair(\"iswitness\", true));\n        obj.push_back(Pair(\"witness_version\", 0));\n        obj.push_back(Pair(\"witness_program\", HexStr(id.begin(), id.end())));\n        CRIPEMD160 hasher;\n        uint160 hash;\n        hasher.Write(id.begin(), 32).Finalize(hash.begin());\n        if (pwallet && pwallet->GetCScript(CScriptID(hash), subscript)) {\n            ProcessSubScript(subscript, obj);\n        }\n        return obj;\n    }\n\n    UniValue operator()(const WitnessUnknown& id) const\n    {\n        UniValue obj(UniValue::VOBJ);\n        CScript subscript;\n        obj.push_back(Pair(\"iswitness\", true));\n        obj.push_back(Pair(\"witness_version\", (int)id.version));\n        obj.push_back(Pair(\"witness_program\", HexStr(id.program, id.program + id.length)));\n        return obj;\n    }\n};\n#endif\n\nUniValue validateaddress(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"validateaddress \\\"address\\\"\\n\"\n            \"\\nReturn information about the given sugarchain address.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"address\\\"     (string, required) The sugarchain address to validate\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"isvalid\\\" : true|false,       (boolean) If the address is valid or not. If not, this is the only property returned.\\n\"\n            \"  \\\"address\\\" : \\\"address\\\",        (string) The sugarchain address validated\\n\"\n            \"  \\\"scriptPubKey\\\" : \\\"hex\\\",       (string) The hex encoded scriptPubKey generated by the address\\n\"\n            \"  \\\"ismine\\\" : true|false,        (boolean) If the address is yours or not\\n\"\n            \"  \\\"iswatchonly\\\" : true|false,   (boolean) If the address is watchonly\\n\"\n            \"  \\\"isscript\\\" : true|false,      (boolean, optional) If the address is P2SH or P2WSH. Not included for unknown witness types.\\n\"\n            \"  \\\"iswitness\\\" : true|false,     (boolean) If the address is P2WPKH, P2WSH, or an unknown witness version\\n\"\n            \"  \\\"witness_version\\\" : version   (number, optional) For all witness output types, gives the version number.\\n\"\n            \"  \\\"witness_program\\\" : \\\"hex\\\"     (string, optional) For all witness output types, gives the script or key hash present in the address.\\n\"\n            \"  \\\"script\\\" : \\\"type\\\"             (string, optional) The output script type. Only if \\\"isscript\\\" is true and the redeemscript is known. Possible types: nonstandard, pubkey, pubkeyhash, scripthash, multisig, nulldata, witness_v0_keyhash, witness_v0_scripthash, witness_unknown\\n\"\n            \"  \\\"hex\\\" : \\\"hex\\\",                (string, optional) The redeemscript for the P2SH or P2WSH address\\n\"\n            \"  \\\"addresses\\\"                   (string, optional) Array of addresses associated with the known redeemscript (only if \\\"iswitness\\\" is false). This field is superseded by the \\\"pubkeys\\\" field and the address inside \\\"embedded\\\".\\n\"\n            \"    [\\n\"\n            \"      \\\"address\\\"\\n\"\n            \"      ,...\\n\"\n            \"    ]\\n\"\n            \"  \\\"pubkeys\\\"                     (string, optional) Array of pubkeys associated with the known redeemscript (only if \\\"script\\\" is \\\"multisig\\\")\\n\"\n            \"    [\\n\"\n            \"      \\\"pubkey\\\"\\n\"\n            \"      ,...\\n\"\n            \"    ]\\n\"\n            \"  \\\"sigsrequired\\\" : xxxxx        (numeric, optional) Number of signatures required to spend multisig output (only if \\\"script\\\" is \\\"multisig\\\")\\n\"\n            \"  \\\"pubkey\\\" : \\\"publickeyhex\\\",    (string, optional) The hex value of the raw public key, for single-key addresses (possibly embedded in P2SH or P2WSH)\\n\"\n            \"  \\\"embedded\\\" : {...},           (object, optional) information about the address embedded in P2SH or P2WSH, if relevant and known. It includes all validateaddress output fields for the embedded address, excluding \\\"isvalid\\\", metadata (\\\"timestamp\\\", \\\"hdkeypath\\\", \\\"hdmasterkeyid\\\") and relation to the wallet (\\\"ismine\\\", \\\"iswatchonly\\\", \\\"account\\\").\\n\"\n            \"  \\\"iscompressed\\\" : true|false,  (boolean) If the address is compressed\\n\"\n            \"  \\\"account\\\" : \\\"account\\\"         (string) DEPRECATED. The account associated with the address, \\\"\\\" is the default account\\n\"\n            \"  \\\"timestamp\\\" : timestamp,      (number, optional) The creation time of the key if available in seconds since epoch (Jan 1 1970 GMT)\\n\"\n            \"  \\\"hdkeypath\\\" : \\\"keypath\\\"       (string, optional) The HD keypath if the key is HD and available\\n\"\n            \"  \\\"hdmasterkeyid\\\" : \\\"<hash160>\\\" (string, optional) The Hash160 of the HD master pubkey\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"validateaddress\", \"\\\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\\\"\")\n            + HelpExampleRpc(\"validateaddress\", \"\\\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\\\"\")\n        );\n\n#ifdef ENABLE_WALLET\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n\n    LOCK2(cs_main, pwallet ? &pwallet->cs_wallet : nullptr);\n#else\n    LOCK(cs_main);\n#endif\n\n    CTxDestination dest = DecodeDestination(request.params[0].get_str());\n    bool isValid = IsValidDestination(dest);\n\n    UniValue ret(UniValue::VOBJ);\n    ret.push_back(Pair(\"isvalid\", isValid));\n    if (isValid)\n    {\n        std::string currentAddress = EncodeDestination(dest);\n        ret.push_back(Pair(\"address\", currentAddress));\n\n        CScript scriptPubKey = GetScriptForDestination(dest);\n        ret.push_back(Pair(\"scriptPubKey\", HexStr(scriptPubKey.begin(), scriptPubKey.end())));\n\n#ifdef ENABLE_WALLET\n        isminetype mine = pwallet ? IsMine(*pwallet, dest) : ISMINE_NO;\n        ret.push_back(Pair(\"ismine\", bool(mine & ISMINE_SPENDABLE)));\n        ret.push_back(Pair(\"iswatchonly\", bool(mine & ISMINE_WATCH_ONLY)));\n        UniValue detail = boost::apply_visitor(DescribeAddressVisitor(pwallet), dest);\n        ret.pushKVs(detail);\n        if (pwallet && pwallet->mapAddressBook.count(dest)) {\n            ret.push_back(Pair(\"account\", pwallet->mapAddressBook[dest].name));\n        }\n        if (pwallet) {\n            const CKeyMetadata* meta = nullptr;\n            CKeyID key_id = GetKeyForDestination(*pwallet, dest);\n            if (!key_id.IsNull()) {\n                auto it = pwallet->mapKeyMetadata.find(key_id);\n                if (it != pwallet->mapKeyMetadata.end()) {\n                    meta = &it->second;\n                }\n            }\n            if (!meta) {\n                auto it = pwallet->m_script_metadata.find(CScriptID(scriptPubKey));\n                if (it != pwallet->m_script_metadata.end()) {\n                    meta = &it->second;\n                }\n            }\n            if (meta) {\n                ret.push_back(Pair(\"timestamp\", meta->nCreateTime));\n                if (!meta->hdKeypath.empty()) {\n                    ret.push_back(Pair(\"hdkeypath\", meta->hdKeypath));\n                    ret.push_back(Pair(\"hdmasterkeyid\", meta->hdMasterKeyID.GetHex()));\n                }\n            }\n        }\n#endif\n    }\n    return ret;\n}\n\n// Needed even with !ENABLE_WALLET, to pass (ignored) pointers around\nclass CWallet;\n\nUniValue createmultisig(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 2 || request.params.size() > 2)\n    {\n        std::string msg = \"createmultisig nrequired [\\\"key\\\",...]\\n\"\n            \"\\nCreates a multi-signature address with n signature of m keys required.\\n\"\n            \"It returns a json object with the address and redeemScript.\\n\"\n            \"DEPRECATION WARNING: Using addresses with createmultisig is deprecated. Clients must\\n\"\n            \"transition to using addmultisigaddress to create multisig addresses with addresses known\\n\"\n            \"to the wallet before upgrading to v0.17. To use the deprecated functionality, start sugarchaind with -deprecatedrpc=createmultisig\\n\"\n            \"\\nArguments:\\n\"\n            \"1. nrequired                    (numeric, required) The number of required signatures out of the n keys or addresses.\\n\"\n            \"2. \\\"keys\\\"                       (string, required) A json array of hex-encoded public keys\\n\"\n            \"     [\\n\"\n            \"       \\\"key\\\"                    (string) The hex-encoded public key\\n\"\n            \"       ,...\\n\"\n            \"     ]\\n\"\n\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"address\\\":\\\"multisigaddress\\\",  (string) The value of the new multisig address.\\n\"\n            \"  \\\"redeemScript\\\":\\\"script\\\"       (string) The string value of the hex-encoded redemption script.\\n\"\n            \"}\\n\"\n\n            \"\\nExamples:\\n\"\n            \"\\nCreate a multisig address from 2 public keys\\n\"\n            + HelpExampleCli(\"createmultisig\", \"2 \\\"[\\\\\\\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\\\\\\\",\\\\\\\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\\\\\\\"]\\\"\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"createmultisig\", \"2, \\\"[\\\\\\\"03789ed0bb717d88f7d321a368d905e7430207ebbd82bd342cf11ae157a7ace5fd\\\\\\\",\\\\\\\"03dbc6764b8884a92e871274b87583e6d5c2a58819473e17e107ef3f6aa5a61626\\\\\\\"]\\\"\")\n        ;\n        throw std::runtime_error(msg);\n    }\n\n    int required = request.params[0].get_int();\n\n    // Get the public keys\n    const UniValue& keys = request.params[1].get_array();\n    std::vector<CPubKey> pubkeys;\n    for (unsigned int i = 0; i < keys.size(); ++i) {\n        if (IsHex(keys[i].get_str()) && (keys[i].get_str().length() == 66 || keys[i].get_str().length() == 130)) {\n            pubkeys.push_back(HexToPubKey(keys[i].get_str()));\n        } else {\n#ifdef ENABLE_WALLET\n            CWallet* const pwallet = GetWalletForJSONRPCRequest(request);\n            if (IsDeprecatedRPCEnabled(\"createmultisig\") && EnsureWalletIsAvailable(pwallet, false)) {\n                pubkeys.push_back(AddrToPubKey(pwallet, keys[i].get_str()));\n            } else\n#endif\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf(\"Invalid public key: %s\\nNote that from v0.16, createmultisig no longer accepts addresses.\"\n            \" Clients must transition to using addmultisigaddress to create multisig addresses with addresses known to the wallet before upgrading to v0.17.\"\n            \" To use the deprecated functionality, start sugarchaind with -deprecatedrpc=createmultisig\", keys[i].get_str()));\n        }\n    }\n\n    // Construct using pay-to-script-hash:\n    CScript inner = CreateMultisigRedeemscript(required, pubkeys);\n    CScriptID innerID(inner);\n\n    UniValue result(UniValue::VOBJ);\n    result.push_back(Pair(\"address\", EncodeDestination(innerID)));\n    result.push_back(Pair(\"redeemScript\", HexStr(inner.begin(), inner.end())));\n\n    return result;\n}\n\nUniValue verifymessage(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 3)\n        throw std::runtime_error(\n            \"verifymessage \\\"address\\\" \\\"signature\\\" \\\"message\\\"\\n\"\n            \"\\nVerify a signed message\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"address\\\"         (string, required) The sugarchain address to use for the signature.\\n\"\n            \"2. \\\"signature\\\"       (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\\n\"\n            \"3. \\\"message\\\"         (string, required) The message that was signed.\\n\"\n            \"\\nResult:\\n\"\n            \"true|false   (boolean) If the signature is verified or not.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nUnlock the wallet for 30 seconds\\n\"\n            + HelpExampleCli(\"walletpassphrase\", \"\\\"mypassphrase\\\" 30\") +\n            \"\\nCreate the signature\\n\"\n            + HelpExampleCli(\"signmessage\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\" \\\"my message\\\"\") +\n            \"\\nVerify the signature\\n\"\n            + HelpExampleCli(\"verifymessage\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\" \\\"signature\\\" \\\"my message\\\"\") +\n            \"\\nAs json rpc\\n\"\n            + HelpExampleRpc(\"verifymessage\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\", \\\"signature\\\", \\\"my message\\\"\")\n        );\n\n    LOCK(cs_main);\n\n    std::string strAddress  = request.params[0].get_str();\n    std::string strSign     = request.params[1].get_str();\n    std::string strMessage  = request.params[2].get_str();\n\n    CTxDestination destination = DecodeDestination(strAddress);\n    if (!IsValidDestination(destination)) {\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Invalid address\");\n    }\n\n    const CKeyID *keyID = boost::get<CKeyID>(&destination);\n    if (!keyID) {\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Address does not refer to key\");\n    }\n\n    bool fInvalid = false;\n    std::vector<unsigned char> vchSig = DecodeBase64(strSign.c_str(), &fInvalid);\n\n    if (fInvalid)\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Malformed base64 encoding\");\n\n    CHashWriter ss(SER_GETHASH, 0);\n    ss << strMessageMagic;\n    ss << strMessage;\n\n    CPubKey pubkey;\n    if (!pubkey.RecoverCompact(ss.GetHash(), vchSig))\n        return false;\n\n    return (pubkey.GetID() == *keyID);\n}\n\nUniValue signmessagewithprivkey(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 2)\n        throw std::runtime_error(\n            \"signmessagewithprivkey \\\"privkey\\\" \\\"message\\\"\\n\"\n            \"\\nSign a message with the private key of an address\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"privkey\\\"         (string, required) The private key to sign the message with.\\n\"\n            \"2. \\\"message\\\"         (string, required) The message to create a signature of.\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"signature\\\"          (string) The signature of the message encoded in base 64\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nCreate the signature\\n\"\n            + HelpExampleCli(\"signmessagewithprivkey\", \"\\\"privkey\\\" \\\"my message\\\"\") +\n            \"\\nVerify the signature\\n\"\n            + HelpExampleCli(\"verifymessage\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\" \\\"signature\\\" \\\"my message\\\"\") +\n            \"\\nAs json rpc\\n\"\n            + HelpExampleRpc(\"signmessagewithprivkey\", \"\\\"privkey\\\", \\\"my message\\\"\")\n        );\n\n    std::string strPrivkey = request.params[0].get_str();\n    std::string strMessage = request.params[1].get_str();\n\n    CBitcoinSecret vchSecret;\n    bool fGood = vchSecret.SetString(strPrivkey);\n    if (!fGood)\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid private key\");\n    CKey key = vchSecret.GetKey();\n    if (!key.IsValid())\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Private key outside allowed range\");\n\n    CHashWriter ss(SER_GETHASH, 0);\n    ss << strMessageMagic;\n    ss << strMessage;\n\n    std::vector<unsigned char> vchSig;\n    if (!key.SignCompact(ss.GetHash(), vchSig))\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Sign failed\");\n\n    return EncodeBase64(vchSig.data(), vchSig.size());\n}\n\nUniValue setmocktime(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"setmocktime timestamp\\n\"\n            \"\\nSet the local time to given timestamp (-regtest only)\\n\"\n            \"\\nArguments:\\n\"\n            \"1. timestamp  (integer, required) Unix seconds-since-epoch timestamp\\n\"\n            \"   Pass 0 to go back to using the system time.\"\n        );\n\n    if (!Params().MineBlocksOnDemand())\n        throw std::runtime_error(\"setmocktime for regression testing (-regtest mode) only\");\n\n    // For now, don't change mocktime if we're in the middle of validation, as\n    // this could have an effect on mempool time-based eviction, as well as\n    // IsCurrentForFeeEstimation() and IsInitialBlockDownload().\n    // TODO: figure out the right way to synchronize around mocktime, and\n    // ensure all call sites of GetTime() are accessing this safely.\n    LOCK(cs_main);\n\n    RPCTypeCheck(request.params, {UniValue::VNUM});\n    SetMockTime(request.params[0].get_int64());\n\n    return NullUniValue;\n}\n\nstatic UniValue RPCLockedMemoryInfo()\n{\n    LockedPool::Stats stats = LockedPoolManager::Instance().stats();\n    UniValue obj(UniValue::VOBJ);\n    obj.push_back(Pair(\"used\", uint64_t(stats.used)));\n    obj.push_back(Pair(\"free\", uint64_t(stats.free)));\n    obj.push_back(Pair(\"total\", uint64_t(stats.total)));\n    obj.push_back(Pair(\"locked\", uint64_t(stats.locked)));\n    obj.push_back(Pair(\"chunks_used\", uint64_t(stats.chunks_used)));\n    obj.push_back(Pair(\"chunks_free\", uint64_t(stats.chunks_free)));\n    return obj;\n}\n\n#ifdef HAVE_MALLOC_INFO\nstatic std::string RPCMallocInfo()\n{\n    char *ptr = nullptr;\n    size_t size = 0;\n    FILE *f = open_memstream(&ptr, &size);\n    if (f) {\n        malloc_info(0, f);\n        fclose(f);\n        if (ptr) {\n            std::string rv(ptr, size);\n            free(ptr);\n            return rv;\n        }\n    }\n    return \"\";\n}\n#endif\n\nUniValue getmemoryinfo(const JSONRPCRequest& request)\n{\n    /* Please, avoid using the word \"pool\" here in the RPC interface or help,\n     * as users will undoubtedly confuse it with the other \"memory pool\"\n     */\n    if (request.fHelp || request.params.size() > 1)\n        throw std::runtime_error(\n            \"getmemoryinfo (\\\"mode\\\")\\n\"\n            \"Returns an object containing information about memory usage.\\n\"\n            \"Arguments:\\n\"\n            \"1. \\\"mode\\\" determines what kind of information is returned. This argument is optional, the default mode is \\\"stats\\\".\\n\"\n            \"  - \\\"stats\\\" returns general statistics about memory usage in the daemon.\\n\"\n            \"  - \\\"mallocinfo\\\" returns an XML string describing low-level heap state (only available if compiled with glibc 2.10+).\\n\"\n            \"\\nResult (mode \\\"stats\\\"):\\n\"\n            \"{\\n\"\n            \"  \\\"locked\\\": {               (json object) Information about locked memory manager\\n\"\n            \"    \\\"used\\\": xxxxx,          (numeric) Number of bytes used\\n\"\n            \"    \\\"free\\\": xxxxx,          (numeric) Number of bytes available in current arenas\\n\"\n            \"    \\\"total\\\": xxxxxxx,       (numeric) Total number of bytes managed\\n\"\n            \"    \\\"locked\\\": xxxxxx,       (numeric) Amount of bytes that succeeded locking. If this number is smaller than total, locking pages failed at some point and key data could be swapped to disk.\\n\"\n            \"    \\\"chunks_used\\\": xxxxx,   (numeric) Number allocated chunks\\n\"\n            \"    \\\"chunks_free\\\": xxxxx,   (numeric) Number unused chunks\\n\"\n            \"  }\\n\"\n            \"}\\n\"\n            \"\\nResult (mode \\\"mallocinfo\\\"):\\n\"\n            \"\\\"<malloc version=\\\"1\\\">...\\\"\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getmemoryinfo\", \"\")\n            + HelpExampleRpc(\"getmemoryinfo\", \"\")\n        );\n\n    std::string mode = request.params[0].isNull() ? \"stats\" : request.params[0].get_str();\n    if (mode == \"stats\") {\n        UniValue obj(UniValue::VOBJ);\n        obj.push_back(Pair(\"locked\", RPCLockedMemoryInfo()));\n        return obj;\n    } else if (mode == \"mallocinfo\") {\n#ifdef HAVE_MALLOC_INFO\n        return RPCMallocInfo();\n#else\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"mallocinfo is only available when compiled with glibc 2.10+\");\n#endif\n    } else {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"unknown mode \" + mode);\n    }\n}\n\nuint32_t getCategoryMask(UniValue cats) {\n    cats = cats.get_array();\n    uint32_t mask = 0;\n    for (unsigned int i = 0; i < cats.size(); ++i) {\n        uint32_t flag = 0;\n        std::string cat = cats[i].get_str();\n        if (!GetLogCategory(&flag, &cat)) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"unknown logging category \" + cat);\n        }\n        if (flag == BCLog::NONE) {\n            return 0;\n        }\n        mask |= flag;\n    }\n    return mask;\n}\n\nUniValue logging(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() > 2) {\n        throw std::runtime_error(\n            \"logging ( <include> <exclude> )\\n\"\n            \"Gets and sets the logging configuration.\\n\"\n            \"When called without an argument, returns the list of categories with status that are currently being debug logged or not.\\n\"\n            \"When called with arguments, adds or removes categories from debug logging and return the lists above.\\n\"\n            \"The arguments are evaluated in order \\\"include\\\", \\\"exclude\\\".\\n\"\n            \"If an item is both included and excluded, it will thus end up being excluded.\\n\"\n            \"The valid logging categories are: \" + ListLogCategories() + \"\\n\"\n            \"In addition, the following are available as category names with special meanings:\\n\"\n            \"  - \\\"all\\\",  \\\"1\\\" : represent all logging categories.\\n\"\n            \"  - \\\"none\\\", \\\"0\\\" : even if other logging categories are specified, ignore all of them.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"include\\\"        (array of strings, optional) A json array of categories to add debug logging\\n\"\n            \"     [\\n\"\n            \"       \\\"category\\\"   (string) the valid logging category\\n\"\n            \"       ,...\\n\"\n            \"     ]\\n\"\n            \"2. \\\"exclude\\\"        (array of strings, optional) A json array of categories to remove debug logging\\n\"\n            \"     [\\n\"\n            \"       \\\"category\\\"   (string) the valid logging category\\n\"\n            \"       ,...\\n\"\n            \"     ]\\n\"\n            \"\\nResult:\\n\"\n            \"{                   (json object where keys are the logging categories, and values indicates its status\\n\"\n            \"  \\\"category\\\": 0|1,  (numeric) if being debug logged or not. 0:inactive, 1:active\\n\"\n            \"  ...\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"logging\", \"\\\"[\\\\\\\"all\\\\\\\"]\\\" \\\"[\\\\\\\"http\\\\\\\"]\\\"\")\n            + HelpExampleRpc(\"logging\", \"[\\\"all\\\"], \\\"[libevent]\\\"\")\n        );\n    }\n\n    uint32_t originalLogCategories = logCategories;\n    if (request.params[0].isArray()) {\n        logCategories |= getCategoryMask(request.params[0]);\n    }\n\n    if (request.params[1].isArray()) {\n        logCategories &= ~getCategoryMask(request.params[1]);\n    }\n\n    // Update libevent logging if BCLog::LIBEVENT has changed.\n    // If the library version doesn't allow it, UpdateHTTPServerLogging() returns false,\n    // in which case we should clear the BCLog::LIBEVENT flag.\n    // Throw an error if the user has explicitly asked to change only the libevent\n    // flag and it failed.\n    uint32_t changedLogCategories = originalLogCategories ^ logCategories;\n    if (changedLogCategories & BCLog::LIBEVENT) {\n        if (!UpdateHTTPServerLogging(logCategories & BCLog::LIBEVENT)) {\n            logCategories &= ~BCLog::LIBEVENT;\n            if (changedLogCategories == BCLog::LIBEVENT) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"libevent logging cannot be updated when using libevent before v2.1.1.\");\n            }\n        }\n    }\n\n    UniValue result(UniValue::VOBJ);\n    std::vector<CLogCategoryActive> vLogCatActive = ListActiveLogCategories();\n    for (const auto& logCatActive : vLogCatActive) {\n        result.pushKV(logCatActive.category, logCatActive.active);\n    }\n\n    return result;\n}\n\nUniValue echo(const JSONRPCRequest& request)\n{\n    if (request.fHelp)\n        throw std::runtime_error(\n            \"echo|echojson \\\"message\\\" ...\\n\"\n            \"\\nSimply echo back the input arguments. This command is for testing.\\n\"\n            \"\\nThe difference between echo and echojson is that echojson has argument conversion enabled in the client-side table in\"\n            \"sugarchain-cli and the GUI. There is no server-side difference.\"\n        );\n\n    return request.params;\n}\n\nstatic UniValue getinfo_deprecated(const JSONRPCRequest& request)\n{\n    throw JSONRPCError(RPC_METHOD_NOT_FOUND,\n        \"getinfo\\n\"\n        \"\\nThis call was removed in version 0.16.0. Use the appropriate fields from:\\n\"\n        \"- getblockchaininfo: blocks, difficulty, chain\\n\"\n        \"- getnetworkinfo: version, protocolversion, timeoffset, connections, proxy, relayfee, warnings\\n\"\n        \"- getwalletinfo: balance, keypoololdest, keypoolsize, paytxfee, unlocked_until, walletversion\\n\"\n        \"\\nsugarchain-cli has the option -getinfo to collect and format these in the old format.\"\n    );\n}\n\nstatic const CRPCCommand commands[] =\n{ //  category              name                      actor (function)         argNames\n  //  --------------------- ------------------------  -----------------------  ----------\n    { \"control\",            \"getmemoryinfo\",          &getmemoryinfo,          {\"mode\"} },\n    { \"control\",            \"logging\",                &logging,                {\"include\", \"exclude\"}},\n    { \"util\",               \"validateaddress\",        &validateaddress,        {\"address\"} }, /* uses wallet if enabled */\n    { \"util\",               \"createmultisig\",         &createmultisig,         {\"nrequired\",\"keys\"} },\n    { \"util\",               \"verifymessage\",          &verifymessage,          {\"address\",\"signature\",\"message\"} },\n    { \"util\",               \"signmessagewithprivkey\", &signmessagewithprivkey, {\"privkey\",\"message\"} },\n\n    /* Not shown in help */\n    { \"hidden\",             \"setmocktime\",            &setmocktime,            {\"timestamp\"}},\n    { \"hidden\",             \"echo\",                   &echo,                   {\"arg0\",\"arg1\",\"arg2\",\"arg3\",\"arg4\",\"arg5\",\"arg6\",\"arg7\",\"arg8\",\"arg9\"}},\n    { \"hidden\",             \"echojson\",               &echo,                   {\"arg0\",\"arg1\",\"arg2\",\"arg3\",\"arg4\",\"arg5\",\"arg6\",\"arg7\",\"arg8\",\"arg9\"}},\n    { \"hidden\",             \"getinfo\",                &getinfo_deprecated,     {}},\n};\n\nvoid RegisterMiscRPCCommands(CRPCTable &t)\n{\n    for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)\n        t.appendCommand(commands[vcidx].name, &commands[vcidx]);\n}\n"
  },
  {
    "path": "src/rpc/net.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <rpc/server.h>\n\n#include <chainparams.h>\n#include <clientversion.h>\n#include <core_io.h>\n#include <validation.h>\n#include <net.h>\n#include <net_processing.h>\n#include <netbase.h>\n#include <policy/policy.h>\n#include <rpc/protocol.h>\n#include <sync.h>\n#include <timedata.h>\n#include <ui_interface.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <version.h>\n#include <warnings.h>\n\n#include <univalue.h>\n\nUniValue getconnectioncount(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getconnectioncount\\n\"\n            \"\\nReturns the number of connections to other nodes.\\n\"\n            \"\\nResult:\\n\"\n            \"n          (numeric) The connection count\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getconnectioncount\", \"\")\n            + HelpExampleRpc(\"getconnectioncount\", \"\")\n        );\n\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    return (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL);\n}\n\nUniValue ping(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"ping\\n\"\n            \"\\nRequests that a ping be sent to all other nodes, to measure ping time.\\n\"\n            \"Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.\\n\"\n            \"Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"ping\", \"\")\n            + HelpExampleRpc(\"ping\", \"\")\n        );\n\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    // Request that each node send a ping during next message processing pass\n    g_connman->ForEachNode([](CNode* pnode) {\n        pnode->fPingQueued = true;\n    });\n    return NullUniValue;\n}\n\nUniValue getpeerinfo(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getpeerinfo\\n\"\n            \"\\nReturns data about each connected network node as a json array of objects.\\n\"\n            \"\\nResult:\\n\"\n            \"[\\n\"\n            \"  {\\n\"\n            \"    \\\"id\\\": n,                   (numeric) Peer index\\n\"\n            \"    \\\"addr\\\":\\\"host:port\\\",      (string) The IP address and port of the peer\\n\"\n            \"    \\\"addrbind\\\":\\\"ip:port\\\",    (string) Bind address of the connection to the peer\\n\"\n            \"    \\\"addrlocal\\\":\\\"ip:port\\\",   (string) Local address as reported by the peer\\n\"\n            \"    \\\"services\\\":\\\"xxxxxxxxxxxxxxxx\\\",   (string) The services offered\\n\"\n            \"    \\\"relaytxes\\\":true|false,    (boolean) Whether peer has asked us to relay transactions to it\\n\"\n            \"    \\\"lastsend\\\": ttt,           (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\\n\"\n            \"    \\\"lastrecv\\\": ttt,           (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\\n\"\n            \"    \\\"bytessent\\\": n,            (numeric) The total bytes sent\\n\"\n            \"    \\\"bytesrecv\\\": n,            (numeric) The total bytes received\\n\"\n            \"    \\\"conntime\\\": ttt,           (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT)\\n\"\n            \"    \\\"timeoffset\\\": ttt,         (numeric) The time offset in seconds\\n\"\n            \"    \\\"pingtime\\\": n,             (numeric) ping time (if available)\\n\"\n            \"    \\\"minping\\\": n,              (numeric) minimum observed ping time (if any at all)\\n\"\n            \"    \\\"pingwait\\\": n,             (numeric) ping wait (if non-zero)\\n\"\n            \"    \\\"version\\\": v,              (numeric) The peer version, such as 70001\\n\"\n            \"    \\\"subver\\\": \\\"/Satoshi:0.8.5/\\\",  (string) The string version\\n\"\n            \"    \\\"inbound\\\": true|false,     (boolean) Inbound (true) or Outbound (false)\\n\"\n            \"    \\\"addnode\\\": true|false,     (boolean) Whether connection was due to addnode/-connect or if it was an automatic/inbound connection\\n\"\n            \"    \\\"startingheight\\\": n,       (numeric) The starting height (block) of the peer\\n\"\n            \"    \\\"banscore\\\": n,             (numeric) The ban score\\n\"\n            \"    \\\"synced_headers\\\": n,       (numeric) The last header we have in common with this peer\\n\"\n            \"    \\\"synced_blocks\\\": n,        (numeric) The last block we have in common with this peer\\n\"\n            \"    \\\"inflight\\\": [\\n\"\n            \"       n,                        (numeric) The heights of blocks we're currently asking from this peer\\n\"\n            \"       ...\\n\"\n            \"    ],\\n\"\n            \"    \\\"whitelisted\\\": true|false, (boolean) Whether the peer is whitelisted\\n\"\n            \"    \\\"bytessent_per_msg\\\": {\\n\"\n            \"       \\\"addr\\\": n,              (numeric) The total bytes sent aggregated by message type\\n\"\n            \"       ...\\n\"\n            \"    },\\n\"\n            \"    \\\"bytesrecv_per_msg\\\": {\\n\"\n            \"       \\\"addr\\\": n,              (numeric) The total bytes received aggregated by message type\\n\"\n            \"       ...\\n\"\n            \"    }\\n\"\n            \"  }\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getpeerinfo\", \"\")\n            + HelpExampleRpc(\"getpeerinfo\", \"\")\n        );\n\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    std::vector<CNodeStats> vstats;\n    g_connman->GetNodeStats(vstats);\n\n    UniValue ret(UniValue::VARR);\n\n    for (const CNodeStats& stats : vstats) {\n        UniValue obj(UniValue::VOBJ);\n        CNodeStateStats statestats;\n        bool fStateStats = GetNodeStateStats(stats.nodeid, statestats);\n        obj.push_back(Pair(\"id\", stats.nodeid));\n        obj.push_back(Pair(\"addr\", stats.addrName));\n        if (!(stats.addrLocal.empty()))\n            obj.push_back(Pair(\"addrlocal\", stats.addrLocal));\n        if (stats.addrBind.IsValid())\n            obj.push_back(Pair(\"addrbind\", stats.addrBind.ToString()));\n        obj.push_back(Pair(\"services\", strprintf(\"%016x\", stats.nServices)));\n        obj.push_back(Pair(\"relaytxes\", stats.fRelayTxes));\n        obj.push_back(Pair(\"lastsend\", stats.nLastSend));\n        obj.push_back(Pair(\"lastrecv\", stats.nLastRecv));\n        obj.push_back(Pair(\"bytessent\", stats.nSendBytes));\n        obj.push_back(Pair(\"bytesrecv\", stats.nRecvBytes));\n        obj.push_back(Pair(\"conntime\", stats.nTimeConnected));\n        obj.push_back(Pair(\"timeoffset\", stats.nTimeOffset));\n        if (stats.dPingTime > 0.0)\n            obj.push_back(Pair(\"pingtime\", stats.dPingTime));\n        if (stats.dMinPing < static_cast<double>(std::numeric_limits<int64_t>::max())/1e6)\n            obj.push_back(Pair(\"minping\", stats.dMinPing));\n        if (stats.dPingWait > 0.0)\n            obj.push_back(Pair(\"pingwait\", stats.dPingWait));\n        obj.push_back(Pair(\"version\", stats.nVersion));\n        // Use the sanitized form of subver here, to avoid tricksy remote peers from\n        // corrupting or modifying the JSON output by putting special characters in\n        // their ver message.\n        obj.push_back(Pair(\"subver\", stats.cleanSubVer));\n        obj.push_back(Pair(\"inbound\", stats.fInbound));\n        obj.push_back(Pair(\"addnode\", stats.m_manual_connection));\n        obj.push_back(Pair(\"startingheight\", stats.nStartingHeight));\n        if (fStateStats) {\n            obj.push_back(Pair(\"banscore\", statestats.nMisbehavior));\n            obj.push_back(Pair(\"synced_headers\", statestats.nSyncHeight));\n            obj.push_back(Pair(\"synced_blocks\", statestats.nCommonHeight));\n            UniValue heights(UniValue::VARR);\n            for (int height : statestats.vHeightInFlight) {\n                heights.push_back(height);\n            }\n            obj.push_back(Pair(\"inflight\", heights));\n        }\n        obj.push_back(Pair(\"whitelisted\", stats.fWhitelisted));\n\n        UniValue sendPerMsgCmd(UniValue::VOBJ);\n        for (const mapMsgCmdSize::value_type &i : stats.mapSendBytesPerMsgCmd) {\n            if (i.second > 0)\n                sendPerMsgCmd.push_back(Pair(i.first, i.second));\n        }\n        obj.push_back(Pair(\"bytessent_per_msg\", sendPerMsgCmd));\n\n        UniValue recvPerMsgCmd(UniValue::VOBJ);\n        for (const mapMsgCmdSize::value_type &i : stats.mapRecvBytesPerMsgCmd) {\n            if (i.second > 0)\n                recvPerMsgCmd.push_back(Pair(i.first, i.second));\n        }\n        obj.push_back(Pair(\"bytesrecv_per_msg\", recvPerMsgCmd));\n\n        ret.push_back(obj);\n    }\n\n    return ret;\n}\n\nUniValue addnode(const JSONRPCRequest& request)\n{\n    std::string strCommand;\n    if (!request.params[1].isNull())\n        strCommand = request.params[1].get_str();\n    if (request.fHelp || request.params.size() != 2 ||\n        (strCommand != \"onetry\" && strCommand != \"add\" && strCommand != \"remove\"))\n        throw std::runtime_error(\n            \"addnode \\\"node\\\" \\\"add|remove|onetry\\\"\\n\"\n            \"\\nAttempts to add or remove a node from the addnode list.\\n\"\n            \"Or try a connection to a node once.\\n\"\n            \"Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be\\n\"\n            \"full nodes/support SegWit as other outbound peers are (though such peers will not be synced from).\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"node\\\"     (string, required) The node (see getpeerinfo for nodes)\\n\"\n            \"2. \\\"command\\\"  (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"addnode\", \"\\\"192.168.0.6:34230\\\" \\\"onetry\\\"\")\n            + HelpExampleRpc(\"addnode\", \"\\\"192.168.0.6:34230\\\", \\\"onetry\\\"\")\n        );\n\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    std::string strNode = request.params[0].get_str();\n\n    if (strCommand == \"onetry\")\n    {\n        CAddress addr;\n        g_connman->OpenNetworkConnection(addr, false, nullptr, strNode.c_str(), false, false, true);\n        return NullUniValue;\n    }\n\n    if (strCommand == \"add\")\n    {\n        if(!g_connman->AddNode(strNode))\n            throw JSONRPCError(RPC_CLIENT_NODE_ALREADY_ADDED, \"Error: Node already added\");\n    }\n    else if(strCommand == \"remove\")\n    {\n        if(!g_connman->RemoveAddedNode(strNode))\n            throw JSONRPCError(RPC_CLIENT_NODE_NOT_ADDED, \"Error: Node has not been added.\");\n    }\n\n    return NullUniValue;\n}\n\nUniValue disconnectnode(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() == 0 || request.params.size() >= 3)\n        throw std::runtime_error(\n            \"disconnectnode \\\"[address]\\\" [nodeid]\\n\"\n            \"\\nImmediately disconnects from the specified peer node.\\n\"\n            \"\\nStrictly one out of 'address' and 'nodeid' can be provided to identify the node.\\n\"\n            \"\\nTo disconnect by nodeid, either set 'address' to the empty string, or call using the named 'nodeid' argument only.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"address\\\"     (string, optional) The IP address/port of the node\\n\"\n            \"2. \\\"nodeid\\\"      (number, optional) The node ID (see getpeerinfo for node IDs)\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"disconnectnode\", \"\\\"192.168.0.6:34230\\\"\")\n            + HelpExampleCli(\"disconnectnode\", \"\\\"\\\" 1\")\n            + HelpExampleRpc(\"disconnectnode\", \"\\\"192.168.0.6:34230\\\"\")\n            + HelpExampleRpc(\"disconnectnode\", \"\\\"\\\", 1\")\n        );\n\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    bool success;\n    const UniValue &address_arg = request.params[0];\n    const UniValue &id_arg = request.params[1];\n\n    if (!address_arg.isNull() && id_arg.isNull()) {\n        /* handle disconnect-by-address */\n        success = g_connman->DisconnectNode(address_arg.get_str());\n    } else if (!id_arg.isNull() && (address_arg.isNull() || (address_arg.isStr() && address_arg.get_str().empty()))) {\n        /* handle disconnect-by-id */\n        NodeId nodeid = (NodeId) id_arg.get_int64();\n        success = g_connman->DisconnectNode(nodeid);\n    } else {\n        throw JSONRPCError(RPC_INVALID_PARAMS, \"Only one of address and nodeid should be provided.\");\n    }\n\n    if (!success) {\n        throw JSONRPCError(RPC_CLIENT_NODE_NOT_CONNECTED, \"Node not found in connected nodes\");\n    }\n\n    return NullUniValue;\n}\n\nUniValue getaddednodeinfo(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() > 1)\n        throw std::runtime_error(\n            \"getaddednodeinfo ( \\\"node\\\" )\\n\"\n            \"\\nReturns information about the given added node, or all added nodes\\n\"\n            \"(note that onetry addnodes are not listed here)\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"node\\\"   (string, optional) If provided, return information about this specific node, otherwise all nodes are returned.\\n\"\n            \"\\nResult:\\n\"\n            \"[\\n\"\n            \"  {\\n\"\n            \"    \\\"addednode\\\" : \\\"192.168.0.201\\\",   (string) The node IP address or name (as provided to addnode)\\n\"\n            \"    \\\"connected\\\" : true|false,          (boolean) If connected\\n\"\n            \"    \\\"addresses\\\" : [                    (list of objects) Only when connected = true\\n\"\n            \"       {\\n\"\n            \"         \\\"address\\\" : \\\"192.168.0.201:34230\\\",  (string) The sugarchain server IP and port we're connected to\\n\"\n            \"         \\\"connected\\\" : \\\"outbound\\\"           (string) connection, inbound or outbound\\n\"\n            \"       }\\n\"\n            \"     ]\\n\"\n            \"  }\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getaddednodeinfo\", \"\\\"192.168.0.201\\\"\")\n            + HelpExampleRpc(\"getaddednodeinfo\", \"\\\"192.168.0.201\\\"\")\n        );\n\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    std::vector<AddedNodeInfo> vInfo = g_connman->GetAddedNodeInfo();\n\n    if (!request.params[0].isNull()) {\n        bool found = false;\n        for (const AddedNodeInfo& info : vInfo) {\n            if (info.strAddedNode == request.params[0].get_str()) {\n                vInfo.assign(1, info);\n                found = true;\n                break;\n            }\n        }\n        if (!found) {\n            throw JSONRPCError(RPC_CLIENT_NODE_NOT_ADDED, \"Error: Node has not been added.\");\n        }\n    }\n\n    UniValue ret(UniValue::VARR);\n\n    for (const AddedNodeInfo& info : vInfo) {\n        UniValue obj(UniValue::VOBJ);\n        obj.push_back(Pair(\"addednode\", info.strAddedNode));\n        obj.push_back(Pair(\"connected\", info.fConnected));\n        UniValue addresses(UniValue::VARR);\n        if (info.fConnected) {\n            UniValue address(UniValue::VOBJ);\n            address.push_back(Pair(\"address\", info.resolvedAddress.ToString()));\n            address.push_back(Pair(\"connected\", info.fInbound ? \"inbound\" : \"outbound\"));\n            addresses.push_back(address);\n        }\n        obj.push_back(Pair(\"addresses\", addresses));\n        ret.push_back(obj);\n    }\n\n    return ret;\n}\n\nUniValue getnettotals(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() > 0)\n        throw std::runtime_error(\n            \"getnettotals\\n\"\n            \"\\nReturns information about network traffic, including bytes in, bytes out,\\n\"\n            \"and current time.\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"totalbytesrecv\\\": n,   (numeric) Total bytes received\\n\"\n            \"  \\\"totalbytessent\\\": n,   (numeric) Total bytes sent\\n\"\n            \"  \\\"timemillis\\\": t,       (numeric) Current UNIX time in milliseconds\\n\"\n            \"  \\\"uploadtarget\\\":\\n\"\n            \"  {\\n\"\n            \"    \\\"timeframe\\\": n,                         (numeric) Length of the measuring timeframe in seconds\\n\"\n            \"    \\\"target\\\": n,                            (numeric) Target in bytes\\n\"\n            \"    \\\"target_reached\\\": true|false,           (boolean) True if target is reached\\n\"\n            \"    \\\"serve_historical_blocks\\\": true|false,  (boolean) True if serving historical blocks\\n\"\n            \"    \\\"bytes_left_in_cycle\\\": t,               (numeric) Bytes left in current time cycle\\n\"\n            \"    \\\"time_left_in_cycle\\\": t                 (numeric) Seconds left in current time cycle\\n\"\n            \"  }\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getnettotals\", \"\")\n            + HelpExampleRpc(\"getnettotals\", \"\")\n       );\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    UniValue obj(UniValue::VOBJ);\n    obj.push_back(Pair(\"totalbytesrecv\", g_connman->GetTotalBytesRecv()));\n    obj.push_back(Pair(\"totalbytessent\", g_connman->GetTotalBytesSent()));\n    obj.push_back(Pair(\"timemillis\", GetTimeMillis()));\n\n    UniValue outboundLimit(UniValue::VOBJ);\n    outboundLimit.push_back(Pair(\"timeframe\", g_connman->GetMaxOutboundTimeframe()));\n    outboundLimit.push_back(Pair(\"target\", g_connman->GetMaxOutboundTarget()));\n    outboundLimit.push_back(Pair(\"target_reached\", g_connman->OutboundTargetReached(false)));\n    outboundLimit.push_back(Pair(\"serve_historical_blocks\", !g_connman->OutboundTargetReached(true)));\n    outboundLimit.push_back(Pair(\"bytes_left_in_cycle\", g_connman->GetOutboundTargetBytesLeft()));\n    outboundLimit.push_back(Pair(\"time_left_in_cycle\", g_connman->GetMaxOutboundTimeLeftInCycle()));\n    obj.push_back(Pair(\"uploadtarget\", outboundLimit));\n    return obj;\n}\n\nstatic UniValue GetNetworksInfo()\n{\n    UniValue networks(UniValue::VARR);\n    for(int n=0; n<NET_MAX; ++n)\n    {\n        enum Network network = static_cast<enum Network>(n);\n        if(network == NET_UNROUTABLE || network == NET_INTERNAL)\n            continue;\n        proxyType proxy;\n        UniValue obj(UniValue::VOBJ);\n        GetProxy(network, proxy);\n        obj.push_back(Pair(\"name\", GetNetworkName(network)));\n        obj.push_back(Pair(\"limited\", IsLimited(network)));\n        obj.push_back(Pair(\"reachable\", IsReachable(network)));\n        obj.push_back(Pair(\"proxy\", proxy.IsValid() ? proxy.proxy.ToStringIPPort() : std::string()));\n        obj.push_back(Pair(\"proxy_randomize_credentials\", proxy.randomize_credentials));\n        networks.push_back(obj);\n    }\n    return networks;\n}\n\nUniValue getnetworkinfo(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getnetworkinfo\\n\"\n            \"Returns an object containing various state info regarding P2P networking.\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"version\\\": xxxxx,                      (numeric) the server version\\n\"\n            \"  \\\"subversion\\\": \\\"/Satoshi:x.x.x/\\\",     (string) the server subversion string\\n\"\n            \"  \\\"protocolversion\\\": xxxxx,              (numeric) the protocol version\\n\"\n            \"  \\\"localservices\\\": \\\"xxxxxxxxxxxxxxxx\\\", (string) the services we offer to the network\\n\"\n            \"  \\\"localrelay\\\": true|false,              (bool) true if transaction relay is requested from peers\\n\"\n            \"  \\\"timeoffset\\\": xxxxx,                   (numeric) the time offset\\n\"\n            \"  \\\"connections\\\": xxxxx,                  (numeric) the number of connections\\n\"\n            \"  \\\"networkactive\\\": true|false,           (bool) whether p2p networking is enabled\\n\"\n            \"  \\\"networks\\\": [                          (array) information per network\\n\"\n            \"  {\\n\"\n            \"    \\\"name\\\": \\\"xxx\\\",                     (string) network (ipv4, ipv6 or onion)\\n\"\n            \"    \\\"limited\\\": true|false,               (boolean) is the network limited using -onlynet?\\n\"\n            \"    \\\"reachable\\\": true|false,             (boolean) is the network reachable?\\n\"\n            \"    \\\"proxy\\\": \\\"host:port\\\"               (string) the proxy that is used for this network, or empty if none\\n\"\n            \"    \\\"proxy_randomize_credentials\\\": true|false,  (string) Whether randomized credentials are used\\n\"\n            \"  }\\n\"\n            \"  ,...\\n\"\n            \"  ],\\n\"\n            \"  \\\"relayfee\\\": x.xxxxxxxx,                (numeric) minimum relay fee for transactions in \" + CURRENCY_UNIT + \"/kB\\n\"\n            \"  \\\"incrementalfee\\\": x.xxxxxxxx,          (numeric) minimum fee increment for mempool limiting or BIP 125 replacement in \" + CURRENCY_UNIT + \"/kB\\n\"\n            \"  \\\"localaddresses\\\": [                    (array) list of local addresses\\n\"\n            \"  {\\n\"\n            \"    \\\"address\\\": \\\"xxxx\\\",                 (string) network address\\n\"\n            \"    \\\"port\\\": xxx,                         (numeric) network port\\n\"\n            \"    \\\"score\\\": xxx                         (numeric) relative score\\n\"\n            \"  }\\n\"\n            \"  ,...\\n\"\n            \"  ]\\n\"\n            \"  \\\"warnings\\\": \\\"...\\\"                    (string) any network and blockchain warnings\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getnetworkinfo\", \"\")\n            + HelpExampleRpc(\"getnetworkinfo\", \"\")\n        );\n\n    LOCK(cs_main);\n    UniValue obj(UniValue::VOBJ);\n    obj.push_back(Pair(\"version\",       CLIENT_VERSION));\n    obj.push_back(Pair(\"subversion\",    strSubVersion));\n    obj.push_back(Pair(\"protocolversion\",PROTOCOL_VERSION));\n    if(g_connman)\n        obj.push_back(Pair(\"localservices\", strprintf(\"%016x\", g_connman->GetLocalServices())));\n    obj.push_back(Pair(\"localrelay\",     fRelayTxes));\n    obj.push_back(Pair(\"timeoffset\",    GetTimeOffset()));\n    if (g_connman) {\n        obj.push_back(Pair(\"networkactive\", g_connman->GetNetworkActive()));\n        obj.push_back(Pair(\"connections\",   (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL)));\n    }\n    obj.push_back(Pair(\"networks\",      GetNetworksInfo()));\n    obj.push_back(Pair(\"relayfee\",      ValueFromAmount(::minRelayTxFee.GetFeePerK())));\n    obj.push_back(Pair(\"incrementalfee\", ValueFromAmount(::incrementalRelayFee.GetFeePerK())));\n    UniValue localAddresses(UniValue::VARR);\n    {\n        LOCK(cs_mapLocalHost);\n        for (const std::pair<CNetAddr, LocalServiceInfo> &item : mapLocalHost)\n        {\n            UniValue rec(UniValue::VOBJ);\n            rec.push_back(Pair(\"address\", item.first.ToString()));\n            rec.push_back(Pair(\"port\", item.second.nPort));\n            rec.push_back(Pair(\"score\", item.second.nScore));\n            localAddresses.push_back(rec);\n        }\n    }\n    obj.push_back(Pair(\"localaddresses\", localAddresses));\n    obj.push_back(Pair(\"warnings\",       GetWarnings(\"statusbar\")));\n    return obj;\n}\n\nUniValue setban(const JSONRPCRequest& request)\n{\n    std::string strCommand;\n    if (!request.params[1].isNull())\n        strCommand = request.params[1].get_str();\n    if (request.fHelp || request.params.size() < 2 ||\n        (strCommand != \"add\" && strCommand != \"remove\"))\n        throw std::runtime_error(\n                            \"setban \\\"subnet\\\" \\\"add|remove\\\" (bantime) (absolute)\\n\"\n                            \"\\nAttempts to add or remove an IP/Subnet from the banned list.\\n\"\n                            \"\\nArguments:\\n\"\n                            \"1. \\\"subnet\\\"       (string, required) The IP/Subnet (see getpeerinfo for nodes IP) with an optional netmask (default is /32 = single IP)\\n\"\n                            \"2. \\\"command\\\"      (string, required) 'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list\\n\"\n                            \"3. \\\"bantime\\\"      (numeric, optional) time in seconds how long (or until when if [absolute] is set) the IP is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)\\n\"\n                            \"4. \\\"absolute\\\"     (boolean, optional) If set, the bantime must be an absolute timestamp in seconds since epoch (Jan 1 1970 GMT)\\n\"\n                            \"\\nExamples:\\n\"\n                            + HelpExampleCli(\"setban\", \"\\\"192.168.0.6\\\" \\\"add\\\" 86400\")\n                            + HelpExampleCli(\"setban\", \"\\\"192.168.0.0/24\\\" \\\"add\\\"\")\n                            + HelpExampleRpc(\"setban\", \"\\\"192.168.0.6\\\", \\\"add\\\", 86400\")\n                            );\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    CSubNet subNet;\n    CNetAddr netAddr;\n    bool isSubnet = false;\n\n    if (request.params[0].get_str().find('/') != std::string::npos)\n        isSubnet = true;\n\n    if (!isSubnet) {\n        CNetAddr resolved;\n        LookupHost(request.params[0].get_str().c_str(), resolved, false);\n        netAddr = resolved;\n    }\n    else\n        LookupSubNet(request.params[0].get_str().c_str(), subNet);\n\n    if (! (isSubnet ? subNet.IsValid() : netAddr.IsValid()) )\n        throw JSONRPCError(RPC_CLIENT_INVALID_IP_OR_SUBNET, \"Error: Invalid IP/Subnet\");\n\n    if (strCommand == \"add\")\n    {\n        if (isSubnet ? g_connman->IsBanned(subNet) : g_connman->IsBanned(netAddr))\n            throw JSONRPCError(RPC_CLIENT_NODE_ALREADY_ADDED, \"Error: IP/Subnet already banned\");\n\n        int64_t banTime = 0; //use standard bantime if not specified\n        if (!request.params[2].isNull())\n            banTime = request.params[2].get_int64();\n\n        bool absolute = false;\n        if (request.params[3].isTrue())\n            absolute = true;\n\n        isSubnet ? g_connman->Ban(subNet, BanReasonManuallyAdded, banTime, absolute) : g_connman->Ban(netAddr, BanReasonManuallyAdded, banTime, absolute);\n    }\n    else if(strCommand == \"remove\")\n    {\n        if (!( isSubnet ? g_connman->Unban(subNet) : g_connman->Unban(netAddr) ))\n            throw JSONRPCError(RPC_CLIENT_INVALID_IP_OR_SUBNET, \"Error: Unban failed. Requested address/subnet was not previously banned.\");\n    }\n    return NullUniValue;\n}\n\nUniValue listbanned(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n                            \"listbanned\\n\"\n                            \"\\nList all banned IPs/Subnets.\\n\"\n                            \"\\nExamples:\\n\"\n                            + HelpExampleCli(\"listbanned\", \"\")\n                            + HelpExampleRpc(\"listbanned\", \"\")\n                            );\n\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    banmap_t banMap;\n    g_connman->GetBanned(banMap);\n\n    UniValue bannedAddresses(UniValue::VARR);\n    for (const auto& entry : banMap)\n    {\n        const CBanEntry& banEntry = entry.second;\n        UniValue rec(UniValue::VOBJ);\n        rec.push_back(Pair(\"address\", entry.first.ToString()));\n        rec.push_back(Pair(\"banned_until\", banEntry.nBanUntil));\n        rec.push_back(Pair(\"ban_created\", banEntry.nCreateTime));\n        rec.push_back(Pair(\"ban_reason\", banEntry.banReasonToString()));\n\n        bannedAddresses.push_back(rec);\n    }\n\n    return bannedAddresses;\n}\n\nUniValue clearbanned(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n                            \"clearbanned\\n\"\n                            \"\\nClear all banned IPs.\\n\"\n                            \"\\nExamples:\\n\"\n                            + HelpExampleCli(\"clearbanned\", \"\")\n                            + HelpExampleRpc(\"clearbanned\", \"\")\n                            );\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    g_connman->ClearBanned();\n\n    return NullUniValue;\n}\n\nUniValue setnetworkactive(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1) {\n        throw std::runtime_error(\n            \"setnetworkactive true|false\\n\"\n            \"\\nDisable/enable all p2p network activity.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"state\\\"        (boolean, required) true to enable networking, false to disable\\n\"\n        );\n    }\n\n    if (!g_connman) {\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n    }\n\n    g_connman->SetNetworkActive(request.params[0].get_bool());\n\n    return g_connman->GetNetworkActive();\n}\n\nstatic const CRPCCommand commands[] =\n{ //  category              name                      actor (function)         argNames\n  //  --------------------- ------------------------  -----------------------  ----------\n    { \"network\",            \"getconnectioncount\",     &getconnectioncount,     {} },\n    { \"network\",            \"ping\",                   &ping,                   {} },\n    { \"network\",            \"getpeerinfo\",            &getpeerinfo,            {} },\n    { \"network\",            \"addnode\",                &addnode,                {\"node\",\"command\"} },\n    { \"network\",            \"disconnectnode\",         &disconnectnode,         {\"address\", \"nodeid\"} },\n    { \"network\",            \"getaddednodeinfo\",       &getaddednodeinfo,       {\"node\"} },\n    { \"network\",            \"getnettotals\",           &getnettotals,           {} },\n    { \"network\",            \"getnetworkinfo\",         &getnetworkinfo,         {} },\n    { \"network\",            \"setban\",                 &setban,                 {\"subnet\", \"command\", \"bantime\", \"absolute\"} },\n    { \"network\",            \"listbanned\",             &listbanned,             {} },\n    { \"network\",            \"clearbanned\",            &clearbanned,            {} },\n    { \"network\",            \"setnetworkactive\",       &setnetworkactive,       {\"state\"} },\n};\n\nvoid RegisterNetRPCCommands(CRPCTable &t)\n{\n    for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)\n        t.appendCommand(commands[vcidx].name, &commands[vcidx]);\n}\n"
  },
  {
    "path": "src/rpc/protocol.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <rpc/protocol.h>\n\n#include <random.h>\n#include <tinyformat.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <utiltime.h>\n#include <version.h>\n\n#include <fstream>\n\n/**\n * JSON-RPC protocol.  Bitcoin speaks version 1.0 for maximum compatibility,\n * but uses JSON-RPC 1.1/2.0 standards for parts of the 1.0 standard that were\n * unspecified (HTTP errors and contents of 'error').\n *\n * 1.0 spec: http://json-rpc.org/wiki/specification\n * 1.2 spec: http://jsonrpc.org/historical/json-rpc-over-http.html\n */\n\nUniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id)\n{\n    UniValue request(UniValue::VOBJ);\n    request.push_back(Pair(\"method\", strMethod));\n    request.push_back(Pair(\"params\", params));\n    request.push_back(Pair(\"id\", id));\n    return request;\n}\n\nUniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const UniValue& id)\n{\n    UniValue reply(UniValue::VOBJ);\n    if (!error.isNull())\n        reply.push_back(Pair(\"result\", NullUniValue));\n    else\n        reply.push_back(Pair(\"result\", result));\n    reply.push_back(Pair(\"error\", error));\n    reply.push_back(Pair(\"id\", id));\n    return reply;\n}\n\nstd::string JSONRPCReply(const UniValue& result, const UniValue& error, const UniValue& id)\n{\n    UniValue reply = JSONRPCReplyObj(result, error, id);\n    return reply.write() + \"\\n\";\n}\n\nUniValue JSONRPCError(int code, const std::string& message)\n{\n    UniValue error(UniValue::VOBJ);\n    error.push_back(Pair(\"code\", code));\n    error.push_back(Pair(\"message\", message));\n    return error;\n}\n\n/** Username used when cookie authentication is in use (arbitrary, only for\n * recognizability in debugging/logging purposes)\n */\nstatic const std::string COOKIEAUTH_USER = \"__cookie__\";\n/** Default name for auth cookie file */\nstatic const std::string COOKIEAUTH_FILE = \".cookie\";\n\n/** Get name of RPC authentication cookie file */\nstatic fs::path GetAuthCookieFile(bool temp=false)\n{\n    std::string arg = gArgs.GetArg(\"-rpccookiefile\", COOKIEAUTH_FILE);\n    if (temp) {\n        arg += \".tmp\";\n    }\n    fs::path path(arg);\n    if (!path.is_complete()) path = GetDataDir() / path;\n    return path;\n}\n\nbool GenerateAuthCookie(std::string *cookie_out)\n{\n    const size_t COOKIE_SIZE = 32;\n    unsigned char rand_pwd[COOKIE_SIZE];\n    GetRandBytes(rand_pwd, COOKIE_SIZE);\n    std::string cookie = COOKIEAUTH_USER + \":\" + HexStr(rand_pwd, rand_pwd+COOKIE_SIZE);\n\n    /** the umask determines what permissions are used to create this file -\n     * these are set to 077 in init.cpp unless overridden with -sysperms.\n     */\n    std::ofstream file;\n    fs::path filepath_tmp = GetAuthCookieFile(true);\n    file.open(filepath_tmp.string().c_str());\n    if (!file.is_open()) {\n        LogPrintf(\"Unable to open cookie authentication file %s for writing\\n\", filepath_tmp.string());\n        return false;\n    }\n    file << cookie;\n    file.close();\n\n    fs::path filepath = GetAuthCookieFile(false);\n    if (!RenameOver(filepath_tmp, filepath)) {\n        LogPrintf(\"Unable to rename cookie authentication file %s to %s\\n\", filepath_tmp.string(), filepath.string());\n        return false;\n    }\n    LogPrintf(\"Generated RPC authentication cookie %s\\n\", filepath.string());\n\n    if (cookie_out)\n        *cookie_out = cookie;\n    return true;\n}\n\nbool GetAuthCookie(std::string *cookie_out)\n{\n    std::ifstream file;\n    std::string cookie;\n    fs::path filepath = GetAuthCookieFile();\n    file.open(filepath.string().c_str());\n    if (!file.is_open())\n        return false;\n    std::getline(file, cookie);\n    file.close();\n\n    if (cookie_out)\n        *cookie_out = cookie;\n    return true;\n}\n\nvoid DeleteAuthCookie()\n{\n    try {\n        fs::remove(GetAuthCookieFile());\n    } catch (const fs::filesystem_error& e) {\n        LogPrintf(\"%s: Unable to remove random auth cookie file: %s\\n\", __func__, e.what());\n    }\n}\n\nstd::vector<UniValue> JSONRPCProcessBatchReply(const UniValue &in, size_t num)\n{\n    if (!in.isArray()) {\n        throw std::runtime_error(\"Batch must be an array\");\n    }\n    std::vector<UniValue> batch(num);\n    for (size_t i=0; i<in.size(); ++i) {\n        const UniValue &rec = in[i];\n        if (!rec.isObject()) {\n            throw std::runtime_error(\"Batch member must be object\");\n        }\n        size_t id = rec[\"id\"].get_int();\n        if (id >= num) {\n            throw std::runtime_error(\"Batch member id larger than size\");\n        }\n        batch[id] = rec;\n    }\n    return batch;\n}\n"
  },
  {
    "path": "src/rpc/protocol.h",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_RPCPROTOCOL_H\n#define BITCOIN_RPCPROTOCOL_H\n\n#include <fs.h>\n\n#include <list>\n#include <map>\n#include <stdint.h>\n#include <string>\n\n#include <univalue.h>\n\n//! HTTP status codes\nenum HTTPStatusCode\n{\n    HTTP_OK                    = 200,\n    HTTP_BAD_REQUEST           = 400,\n    HTTP_UNAUTHORIZED          = 401,\n    HTTP_FORBIDDEN             = 403,\n    HTTP_NOT_FOUND             = 404,\n    HTTP_BAD_METHOD            = 405,\n    HTTP_INTERNAL_SERVER_ERROR = 500,\n    HTTP_SERVICE_UNAVAILABLE   = 503,\n};\n\n//! Bitcoin RPC error codes\nenum RPCErrorCode\n{\n    //! Standard JSON-RPC 2.0 errors\n    // RPC_INVALID_REQUEST is internally mapped to HTTP_BAD_REQUEST (400).\n    // It should not be used for application-layer errors.\n    RPC_INVALID_REQUEST  = -32600,\n    // RPC_METHOD_NOT_FOUND is internally mapped to HTTP_NOT_FOUND (404).\n    // It should not be used for application-layer errors.\n    RPC_METHOD_NOT_FOUND = -32601,\n    RPC_INVALID_PARAMS   = -32602,\n    // RPC_INTERNAL_ERROR should only be used for genuine errors in bitcoind\n    // (for example datadir corruption).\n    RPC_INTERNAL_ERROR   = -32603,\n    RPC_PARSE_ERROR      = -32700,\n\n    //! General application defined errors\n    RPC_MISC_ERROR                  = -1,  //!< std::exception thrown in command handling\n    RPC_FORBIDDEN_BY_SAFE_MODE      = -2,  //!< Server is in safe mode, and command is not allowed in safe mode\n    RPC_TYPE_ERROR                  = -3,  //!< Unexpected type was passed as parameter\n    RPC_INVALID_ADDRESS_OR_KEY      = -5,  //!< Invalid address or key\n    RPC_OUT_OF_MEMORY               = -7,  //!< Ran out of memory during operation\n    RPC_INVALID_PARAMETER           = -8,  //!< Invalid, missing or duplicate parameter\n    RPC_DATABASE_ERROR              = -20, //!< Database error\n    RPC_DESERIALIZATION_ERROR       = -22, //!< Error parsing or validating structure in raw format\n    RPC_VERIFY_ERROR                = -25, //!< General error during transaction or block submission\n    RPC_VERIFY_REJECTED             = -26, //!< Transaction or block was rejected by network rules\n    RPC_VERIFY_ALREADY_IN_CHAIN     = -27, //!< Transaction already in chain\n    RPC_IN_WARMUP                   = -28, //!< Client still warming up\n    RPC_METHOD_DEPRECATED           = -32, //!< RPC method is deprecated\n\n    //! Aliases for backward compatibility\n    RPC_TRANSACTION_ERROR           = RPC_VERIFY_ERROR,\n    RPC_TRANSACTION_REJECTED        = RPC_VERIFY_REJECTED,\n    RPC_TRANSACTION_ALREADY_IN_CHAIN= RPC_VERIFY_ALREADY_IN_CHAIN,\n\n    //! P2P client errors\n    RPC_CLIENT_NOT_CONNECTED        = -9,  //!< Bitcoin is not connected\n    RPC_CLIENT_IN_INITIAL_DOWNLOAD  = -10, //!< Still downloading initial blocks\n    RPC_CLIENT_NODE_ALREADY_ADDED   = -23, //!< Node is already added\n    RPC_CLIENT_NODE_NOT_ADDED       = -24, //!< Node has not been added before\n    RPC_CLIENT_NODE_NOT_CONNECTED   = -29, //!< Node to disconnect not found in connected nodes\n    RPC_CLIENT_INVALID_IP_OR_SUBNET = -30, //!< Invalid IP/Subnet\n    RPC_CLIENT_P2P_DISABLED         = -31, //!< No valid connection manager instance found\n\n    //! Wallet errors\n    RPC_WALLET_ERROR                = -4,  //!< Unspecified problem with wallet (key not found etc.)\n    RPC_WALLET_INSUFFICIENT_FUNDS   = -6,  //!< Not enough funds in wallet or account\n    RPC_WALLET_INVALID_ACCOUNT_NAME = -11, //!< Invalid account name\n    RPC_WALLET_KEYPOOL_RAN_OUT      = -12, //!< Keypool ran out, call keypoolrefill first\n    RPC_WALLET_UNLOCK_NEEDED        = -13, //!< Enter the wallet passphrase with walletpassphrase first\n    RPC_WALLET_PASSPHRASE_INCORRECT = -14, //!< The wallet passphrase entered was incorrect\n    RPC_WALLET_WRONG_ENC_STATE      = -15, //!< Command given in wrong wallet encryption state (encrypting an encrypted wallet etc.)\n    RPC_WALLET_ENCRYPTION_FAILED    = -16, //!< Failed to encrypt the wallet\n    RPC_WALLET_ALREADY_UNLOCKED     = -17, //!< Wallet is already unlocked\n    RPC_WALLET_NOT_FOUND            = -18, //!< Invalid wallet specified\n    RPC_WALLET_NOT_SPECIFIED        = -19, //!< No wallet specified (error when there are multiple wallets loaded)\n};\n\nUniValue JSONRPCRequestObj(const std::string& strMethod, const UniValue& params, const UniValue& id);\nUniValue JSONRPCReplyObj(const UniValue& result, const UniValue& error, const UniValue& id);\nstd::string JSONRPCReply(const UniValue& result, const UniValue& error, const UniValue& id);\nUniValue JSONRPCError(int code, const std::string& message);\n\n/** Generate a new RPC authentication cookie and write it to disk */\nbool GenerateAuthCookie(std::string *cookie_out);\n/** Read the RPC authentication cookie from disk */\nbool GetAuthCookie(std::string *cookie_out);\n/** Delete RPC authentication cookie from disk */\nvoid DeleteAuthCookie();\n/** Parse JSON-RPC batch reply into a vector */\nstd::vector<UniValue> JSONRPCProcessBatchReply(const UniValue &in, size_t num);\n\n#endif // BITCOIN_RPCPROTOCOL_H\n"
  },
  {
    "path": "src/rpc/rawtransaction.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <base58.h>\n#include <chain.h>\n#include <coins.h>\n#include <consensus/validation.h>\n#include <core_io.h>\n#include <init.h>\n#include <keystore.h>\n#include <validation.h>\n#include <validationinterface.h>\n#include <merkleblock.h>\n#include <net.h>\n#include <policy/policy.h>\n#include <policy/rbf.h>\n#include <primitives/transaction.h>\n#include <rpc/safemode.h>\n#include <rpc/server.h>\n#include <script/script.h>\n#include <script/script_error.h>\n#include <script/sign.h>\n#include <script/standard.h>\n#include <txmempool.h>\n#include <uint256.h>\n#include <utilstrencodings.h>\n#ifdef ENABLE_WALLET\n#include <wallet/rpcwallet.h>\n#include <wallet/wallet.h>\n#endif\n\n#include <future>\n#include <stdint.h>\n\n#include <univalue.h>\n\n\nvoid TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry)\n{\n    // Call into TxToUniv() in bitcoin-common to decode the transaction hex.\n    //\n    // Blockchain contextual information (confirmations and blocktime) is not\n    // available to code in bitcoin-common, so we query them here and push the\n    // data into the returned UniValue.\n    TxToUniv(tx, uint256(), entry, true, RPCSerializationFlags());\n\n    if (!hashBlock.IsNull()) {\n        entry.push_back(Pair(\"blockhash\", hashBlock.GetHex()));\n        BlockMap::iterator mi = mapBlockIndex.find(hashBlock);\n        if (mi != mapBlockIndex.end() && (*mi).second) {\n            CBlockIndex* pindex = (*mi).second;\n            if (chainActive.Contains(pindex)) {\n                entry.push_back(Pair(\"confirmations\", 1 + chainActive.Height() - pindex->nHeight));\n                entry.push_back(Pair(\"time\", pindex->GetBlockTime()));\n                entry.push_back(Pair(\"blocktime\", pindex->GetBlockTime()));\n            }\n            else\n                entry.push_back(Pair(\"confirmations\", 0));\n        }\n    }\n}\n\nUniValue getrawtransaction(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)\n        throw std::runtime_error(\n            \"getrawtransaction \\\"txid\\\" ( verbose \\\"blockhash\\\" )\\n\"\n\n            \"\\nNOTE: By default this function only works for mempool transactions. If the -txindex option is\\n\"\n            \"enabled, it also works for blockchain transactions. If the block which contains the transaction\\n\"\n            \"is known, its hash can be provided even for nodes without -txindex. Note that if a blockhash is\\n\"\n            \"provided, only that block will be searched and if the transaction is in the mempool or other\\n\"\n            \"blocks, or if this node does not have the given block available, the transaction will not be found.\\n\"\n            \"DEPRECATED: for now, it also works for transactions with unspent outputs.\\n\"\n\n            \"\\nReturn the raw transaction data.\\n\"\n            \"\\nIf verbose is 'true', returns an Object with information about 'txid'.\\n\"\n            \"If verbose is 'false' or omitted, returns a string that is serialized, hex-encoded data for 'txid'.\\n\"\n\n            \"\\nArguments:\\n\"\n            \"1. \\\"txid\\\"      (string, required) The transaction id\\n\"\n            \"2. verbose     (bool, optional, default=false) If false, return a string, otherwise return a json object\\n\"\n            \"3. \\\"blockhash\\\" (string, optional) The block in which to look for the transaction\\n\"\n\n            \"\\nResult (if verbose is not set or set to false):\\n\"\n            \"\\\"data\\\"      (string) The serialized, hex-encoded data for 'txid'\\n\"\n\n            \"\\nResult (if verbose is set to true):\\n\"\n            \"{\\n\"\n            \"  \\\"in_active_chain\\\": b, (bool) Whether specified block is in the active chain or not (only present with explicit \\\"blockhash\\\" argument)\\n\"\n            \"  \\\"hex\\\" : \\\"data\\\",       (string) The serialized, hex-encoded data for 'txid'\\n\"\n            \"  \\\"txid\\\" : \\\"id\\\",        (string) The transaction id (same as provided)\\n\"\n            \"  \\\"hash\\\" : \\\"id\\\",        (string) The transaction hash (differs from txid for witness transactions)\\n\"\n            \"  \\\"size\\\" : n,             (numeric) The serialized transaction size\\n\"\n            \"  \\\"vsize\\\" : n,            (numeric) The virtual transaction size (differs from size for witness transactions)\\n\"\n            \"  \\\"version\\\" : n,          (numeric) The version\\n\"\n            \"  \\\"locktime\\\" : ttt,       (numeric) The lock time\\n\"\n            \"  \\\"vin\\\" : [               (array of json objects)\\n\"\n            \"     {\\n\"\n            \"       \\\"txid\\\": \\\"id\\\",    (string) The transaction id\\n\"\n            \"       \\\"vout\\\": n,         (numeric) \\n\"\n            \"       \\\"scriptSig\\\": {     (json object) The script\\n\"\n            \"         \\\"asm\\\": \\\"asm\\\",  (string) asm\\n\"\n            \"         \\\"hex\\\": \\\"hex\\\"   (string) hex\\n\"\n            \"       },\\n\"\n            \"       \\\"sequence\\\": n      (numeric) The script sequence number\\n\"\n            \"       \\\"txinwitness\\\": [\\\"hex\\\", ...] (array of string) hex-encoded witness data (if any)\\n\"\n            \"     }\\n\"\n            \"     ,...\\n\"\n            \"  ],\\n\"\n            \"  \\\"vout\\\" : [              (array of json objects)\\n\"\n            \"     {\\n\"\n            \"       \\\"value\\\" : x.xxx,            (numeric) The value in \" + CURRENCY_UNIT + \"\\n\"\n            \"       \\\"n\\\" : n,                    (numeric) index\\n\"\n            \"       \\\"scriptPubKey\\\" : {          (json object)\\n\"\n            \"         \\\"asm\\\" : \\\"asm\\\",          (string) the asm\\n\"\n            \"         \\\"hex\\\" : \\\"hex\\\",          (string) the hex\\n\"\n            \"         \\\"reqSigs\\\" : n,            (numeric) The required sigs\\n\"\n            \"         \\\"type\\\" : \\\"pubkeyhash\\\",  (string) The type, eg 'pubkeyhash'\\n\"\n            \"         \\\"addresses\\\" : [           (json array of string)\\n\"\n            \"           \\\"address\\\"        (string) sugarchain address\\n\"\n            \"           ,...\\n\"\n            \"         ]\\n\"\n            \"       }\\n\"\n            \"     }\\n\"\n            \"     ,...\\n\"\n            \"  ],\\n\"\n            \"  \\\"blockhash\\\" : \\\"hash\\\",   (string) the block hash\\n\"\n            \"  \\\"confirmations\\\" : n,      (numeric) The confirmations\\n\"\n            \"  \\\"time\\\" : ttt,             (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\\n\"\n            \"  \\\"blocktime\\\" : ttt         (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\\n\"\n            \"}\\n\"\n\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getrawtransaction\", \"\\\"mytxid\\\"\")\n            + HelpExampleCli(\"getrawtransaction\", \"\\\"mytxid\\\" true\")\n            + HelpExampleRpc(\"getrawtransaction\", \"\\\"mytxid\\\", true\")\n            + HelpExampleCli(\"getrawtransaction\", \"\\\"mytxid\\\" false \\\"myblockhash\\\"\")\n            + HelpExampleCli(\"getrawtransaction\", \"\\\"mytxid\\\" true \\\"myblockhash\\\"\")\n        );\n\n    LOCK(cs_main);\n\n    bool in_active_chain = true;\n    uint256 hash = ParseHashV(request.params[0], \"parameter 1\");\n    CBlockIndex* blockindex = nullptr;\n\n    if (hash == Params().GenesisBlock().hashMerkleRoot) {\n        // Special exception for the genesis block coinbase transaction\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"The genesis block coinbase is not considered an ordinary transaction and cannot be retrieved\");\n    }\n\n    // Accept either a bool (true) or a num (>=1) to indicate verbose output.\n    bool fVerbose = false;\n    if (!request.params[1].isNull()) {\n        fVerbose = request.params[1].isNum() ? (request.params[1].get_int() != 0) : request.params[1].get_bool();\n    }\n\n    if (!request.params[2].isNull()) {\n        uint256 blockhash = ParseHashV(request.params[2], \"parameter 3\");\n        BlockMap::iterator it = mapBlockIndex.find(blockhash);\n        if (it == mapBlockIndex.end()) {\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block hash not found\");\n        }\n        blockindex = it->second;\n        in_active_chain = chainActive.Contains(blockindex);\n    }\n\n    CTransactionRef tx;\n    uint256 hash_block;\n    if (!GetTransaction(hash, tx, Params().GetConsensus(), hash_block, true, blockindex)) {\n        std::string errmsg;\n        if (blockindex) {\n            if (!(blockindex->nStatus & BLOCK_HAVE_DATA)) {\n                throw JSONRPCError(RPC_MISC_ERROR, \"Block not available\");\n            }\n            errmsg = \"No such transaction found in the provided block\";\n        } else {\n            errmsg = fTxIndex\n              ? \"No such mempool or blockchain transaction\"\n              : \"No such mempool transaction. Use -txindex to enable blockchain transaction queries\";\n        }\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, errmsg + \". Use gettransaction for wallet transactions.\");\n    }\n\n    if (!fVerbose) {\n        return EncodeHexTx(*tx, RPCSerializationFlags());\n    }\n\n    UniValue result(UniValue::VOBJ);\n    if (blockindex) result.push_back(Pair(\"in_active_chain\", in_active_chain));\n    TxToJSON(*tx, hash_block, result);\n    return result;\n}\n\nUniValue gettxoutproof(const JSONRPCRequest& request)\n{\n    if (request.fHelp || (request.params.size() != 1 && request.params.size() != 2))\n        throw std::runtime_error(\n            \"gettxoutproof [\\\"txid\\\",...] ( blockhash )\\n\"\n            \"\\nReturns a hex-encoded proof that \\\"txid\\\" was included in a block.\\n\"\n            \"\\nNOTE: By default this function only works sometimes. This is when there is an\\n\"\n            \"unspent output in the utxo for this transaction. To make it always work,\\n\"\n            \"you need to maintain a transaction index, using the -txindex command line option or\\n\"\n            \"specify the block in which the transaction is included manually (by blockhash).\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"txids\\\"       (string) A json array of txids to filter\\n\"\n            \"    [\\n\"\n            \"      \\\"txid\\\"     (string) A transaction hash\\n\"\n            \"      ,...\\n\"\n            \"    ]\\n\"\n            \"2. \\\"blockhash\\\"   (string, optional) If specified, looks for txid in the block with this hash\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"data\\\"           (string) A string that is a serialized, hex-encoded data for the proof.\\n\"\n        );\n\n    std::set<uint256> setTxids;\n    uint256 oneTxid;\n    UniValue txids = request.params[0].get_array();\n    for (unsigned int idx = 0; idx < txids.size(); idx++) {\n        const UniValue& txid = txids[idx];\n        if (txid.get_str().length() != 64 || !IsHex(txid.get_str()))\n            throw JSONRPCError(RPC_INVALID_PARAMETER, std::string(\"Invalid txid \")+txid.get_str());\n        uint256 hash(uint256S(txid.get_str()));\n        if (setTxids.count(hash))\n            throw JSONRPCError(RPC_INVALID_PARAMETER, std::string(\"Invalid parameter, duplicated txid: \")+txid.get_str());\n       setTxids.insert(hash);\n       oneTxid = hash;\n    }\n\n    LOCK(cs_main);\n\n    CBlockIndex* pblockindex = nullptr;\n\n    uint256 hashBlock;\n    if (!request.params[1].isNull())\n    {\n        hashBlock = uint256S(request.params[1].get_str());\n        if (!mapBlockIndex.count(hashBlock))\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block not found\");\n        pblockindex = mapBlockIndex[hashBlock];\n    } else {\n        // Loop through txids and try to find which block they're in. Exit loop once a block is found.\n        for (const auto& tx : setTxids) {\n            const Coin& coin = AccessByTxid(*pcoinsTip, tx);\n            if (!coin.IsSpent()) {\n                pblockindex = chainActive[coin.nHeight];\n                break;\n            }\n        }\n    }\n\n    if (pblockindex == nullptr)\n    {\n        CTransactionRef tx;\n        if (!GetTransaction(oneTxid, tx, Params().GetConsensus(), hashBlock, false) || hashBlock.IsNull())\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Transaction not yet in block\");\n        if (!mapBlockIndex.count(hashBlock))\n            throw JSONRPCError(RPC_INTERNAL_ERROR, \"Transaction index corrupt\");\n        pblockindex = mapBlockIndex[hashBlock];\n    }\n\n    CBlock block;\n    if(!ReadBlockFromDisk(block, pblockindex, Params().GetConsensus()))\n        throw JSONRPCError(RPC_INTERNAL_ERROR, \"Can't read block from disk\");\n\n    unsigned int ntxFound = 0;\n    for (const auto& tx : block.vtx)\n        if (setTxids.count(tx->GetHash()))\n            ntxFound++;\n    if (ntxFound != setTxids.size())\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Not all transactions found in specified or retrieved block\");\n\n    CDataStream ssMB(SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS);\n    CMerkleBlock mb(block, setTxids);\n    ssMB << mb;\n    std::string strHex = HexStr(ssMB.begin(), ssMB.end());\n    return strHex;\n}\n\nUniValue verifytxoutproof(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"verifytxoutproof \\\"proof\\\"\\n\"\n            \"\\nVerifies that a proof points to a transaction in a block, returning the transaction it commits to\\n\"\n            \"and throwing an RPC error if the block is not in our best chain\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"proof\\\"    (string, required) The hex-encoded proof generated by gettxoutproof\\n\"\n            \"\\nResult:\\n\"\n            \"[\\\"txid\\\"]      (array, strings) The txid(s) which the proof commits to, or empty array if the proof can not be validated.\\n\"\n        );\n\n    CDataStream ssMB(ParseHexV(request.params[0], \"proof\"), SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS);\n    CMerkleBlock merkleBlock;\n    ssMB >> merkleBlock;\n\n    UniValue res(UniValue::VARR);\n\n    std::vector<uint256> vMatch;\n    std::vector<unsigned int> vIndex;\n    if (merkleBlock.txn.ExtractMatches(vMatch, vIndex) != merkleBlock.header.hashMerkleRoot)\n        return res;\n\n    LOCK(cs_main);\n\n    if (!mapBlockIndex.count(merkleBlock.header.GetHash()) || !chainActive.Contains(mapBlockIndex[merkleBlock.header.GetHash()]) || mapBlockIndex[merkleBlock.header.GetHash()]->nTx == 0)\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block not found in chain\");\n\n    // Check if proof is valid, only add results if so\n    if (mapBlockIndex[merkleBlock.header.GetHash()]->nTx == merkleBlock.txn.GetNumTransactions()) {\n        for (const uint256& hash : vMatch) {\n            res.push_back(hash.GetHex());\n        }\n    }\n\n    return res;\n}\n\nUniValue createrawtransaction(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 2 || request.params.size() > 4)\n        throw std::runtime_error(\n            \"createrawtransaction [{\\\"txid\\\":\\\"id\\\",\\\"vout\\\":n},...] {\\\"address\\\":amount,\\\"data\\\":\\\"hex\\\",...} ( locktime ) ( replaceable )\\n\"\n            \"\\nCreate a transaction spending the given inputs and creating new outputs.\\n\"\n            \"Outputs can be addresses or data.\\n\"\n            \"Returns hex-encoded raw transaction.\\n\"\n            \"Note that the transaction's inputs are not signed, and\\n\"\n            \"it is not stored in the wallet or transmitted to the network.\\n\"\n\n            \"\\nArguments:\\n\"\n            \"1. \\\"inputs\\\"                (array, required) A json array of json objects\\n\"\n            \"     [\\n\"\n            \"       {\\n\"\n            \"         \\\"txid\\\":\\\"id\\\",    (string, required) The transaction id\\n\"\n            \"         \\\"vout\\\":n,         (numeric, required) The output number\\n\"\n            \"         \\\"sequence\\\":n      (numeric, optional) The sequence number\\n\"\n            \"       } \\n\"\n            \"       ,...\\n\"\n            \"     ]\\n\"\n            \"2. \\\"outputs\\\"               (object, required) a json object with outputs\\n\"\n            \"    {\\n\"\n            \"      \\\"address\\\": x.xxx,    (numeric or string, required) The key is the sugarchain address, the numeric value (can be string) is the \" + CURRENCY_UNIT + \" amount\\n\"\n            \"      \\\"data\\\": \\\"hex\\\"      (string, required) The key is \\\"data\\\", the value is hex encoded data\\n\"\n            \"      ,...\\n\"\n            \"    }\\n\"\n            \"3. locktime                  (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs\\n\"\n            \"4. replaceable               (boolean, optional, default=false) Marks this transaction as BIP125 replaceable.\\n\"\n            \"                             Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible.\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"transaction\\\"              (string) hex string of the transaction\\n\"\n\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"createrawtransaction\", \"\\\"[{\\\\\\\"txid\\\\\\\":\\\\\\\"myid\\\\\\\",\\\\\\\"vout\\\\\\\":0}]\\\" \\\"{\\\\\\\"address\\\\\\\":0.01}\\\"\")\n            + HelpExampleCli(\"createrawtransaction\", \"\\\"[{\\\\\\\"txid\\\\\\\":\\\\\\\"myid\\\\\\\",\\\\\\\"vout\\\\\\\":0}]\\\" \\\"{\\\\\\\"data\\\\\\\":\\\\\\\"00010203\\\\\\\"}\\\"\")\n            + HelpExampleRpc(\"createrawtransaction\", \"\\\"[{\\\\\\\"txid\\\\\\\":\\\\\\\"myid\\\\\\\",\\\\\\\"vout\\\\\\\":0}]\\\", \\\"{\\\\\\\"address\\\\\\\":0.01}\\\"\")\n            + HelpExampleRpc(\"createrawtransaction\", \"\\\"[{\\\\\\\"txid\\\\\\\":\\\\\\\"myid\\\\\\\",\\\\\\\"vout\\\\\\\":0}]\\\", \\\"{\\\\\\\"data\\\\\\\":\\\\\\\"00010203\\\\\\\"}\\\"\")\n        );\n\n    RPCTypeCheck(request.params, {UniValue::VARR, UniValue::VOBJ, UniValue::VNUM, UniValue::VBOOL}, true);\n    if (request.params[0].isNull() || request.params[1].isNull())\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, arguments 1 and 2 must be non-null\");\n\n    UniValue inputs = request.params[0].get_array();\n    UniValue sendTo = request.params[1].get_obj();\n\n    CMutableTransaction rawTx;\n\n    if (!request.params[2].isNull()) {\n        int64_t nLockTime = request.params[2].get_int64();\n        if (nLockTime < 0 || nLockTime > std::numeric_limits<uint32_t>::max())\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, locktime out of range\");\n        rawTx.nLockTime = nLockTime;\n    }\n\n    bool rbfOptIn = request.params[3].isTrue();\n\n    for (unsigned int idx = 0; idx < inputs.size(); idx++) {\n        const UniValue& input = inputs[idx];\n        const UniValue& o = input.get_obj();\n\n        uint256 txid = ParseHashO(o, \"txid\");\n\n        const UniValue& vout_v = find_value(o, \"vout\");\n        if (!vout_v.isNum())\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, missing vout key\");\n        int nOutput = vout_v.get_int();\n        if (nOutput < 0)\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, vout must be positive\");\n\n        uint32_t nSequence;\n        if (rbfOptIn) {\n            nSequence = MAX_BIP125_RBF_SEQUENCE;\n        } else if (rawTx.nLockTime) {\n            nSequence = std::numeric_limits<uint32_t>::max() - 1;\n        } else {\n            nSequence = std::numeric_limits<uint32_t>::max();\n        }\n\n        // set the sequence number if passed in the parameters object\n        const UniValue& sequenceObj = find_value(o, \"sequence\");\n        if (sequenceObj.isNum()) {\n            int64_t seqNr64 = sequenceObj.get_int64();\n            if (seqNr64 < 0 || seqNr64 > std::numeric_limits<uint32_t>::max()) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, sequence number is out of range\");\n            } else {\n                nSequence = (uint32_t)seqNr64;\n            }\n        }\n\n        CTxIn in(COutPoint(txid, nOutput), CScript(), nSequence);\n\n        rawTx.vin.push_back(in);\n    }\n\n    std::set<CTxDestination> destinations;\n    std::vector<std::string> addrList = sendTo.getKeys();\n    for (const std::string& name_ : addrList) {\n\n        if (name_ == \"data\") {\n            std::vector<unsigned char> data = ParseHexV(sendTo[name_].getValStr(),\"Data\");\n\n            CTxOut out(0, CScript() << OP_RETURN << data);\n            rawTx.vout.push_back(out);\n        } else {\n            CTxDestination destination = DecodeDestination(name_);\n            if (!IsValidDestination(destination)) {\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, std::string(\"Invalid Sugarchain address: \") + name_);\n            }\n\n            if (!destinations.insert(destination).second) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, std::string(\"Invalid parameter, duplicated address: \") + name_);\n            }\n\n            CScript scriptPubKey = GetScriptForDestination(destination);\n            CAmount nAmount = AmountFromValue(sendTo[name_]);\n\n            CTxOut out(nAmount, scriptPubKey);\n            rawTx.vout.push_back(out);\n        }\n    }\n\n    if (!request.params[3].isNull() && rbfOptIn != SignalsOptInRBF(rawTx)) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter combination: Sequence number(s) contradict replaceable option\");\n    }\n\n    return EncodeHexTx(rawTx);\n}\n\nUniValue decoderawtransaction(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"decoderawtransaction \\\"hexstring\\\" ( iswitness )\\n\"\n            \"\\nReturn a JSON object representing the serialized, hex-encoded transaction.\\n\"\n\n            \"\\nArguments:\\n\"\n            \"1. \\\"hexstring\\\"      (string, required) The transaction hex string\\n\"\n            \"2. iswitness          (boolean, optional) Whether the transaction hex is a serialized witness transaction\\n\"\n            \"                         If iswitness is not present, heuristic tests will be used in decoding\\n\"\n\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"txid\\\" : \\\"id\\\",        (string) The transaction id\\n\"\n            \"  \\\"hash\\\" : \\\"id\\\",        (string) The transaction hash (differs from txid for witness transactions)\\n\"\n            \"  \\\"size\\\" : n,             (numeric) The transaction size\\n\"\n            \"  \\\"vsize\\\" : n,            (numeric) The virtual transaction size (differs from size for witness transactions)\\n\"\n            \"  \\\"version\\\" : n,          (numeric) The version\\n\"\n            \"  \\\"locktime\\\" : ttt,       (numeric) The lock time\\n\"\n            \"  \\\"vin\\\" : [               (array of json objects)\\n\"\n            \"     {\\n\"\n            \"       \\\"txid\\\": \\\"id\\\",    (string) The transaction id\\n\"\n            \"       \\\"vout\\\": n,         (numeric) The output number\\n\"\n            \"       \\\"scriptSig\\\": {     (json object) The script\\n\"\n            \"         \\\"asm\\\": \\\"asm\\\",  (string) asm\\n\"\n            \"         \\\"hex\\\": \\\"hex\\\"   (string) hex\\n\"\n            \"       },\\n\"\n            \"       \\\"txinwitness\\\": [\\\"hex\\\", ...] (array of string) hex-encoded witness data (if any)\\n\"\n            \"       \\\"sequence\\\": n     (numeric) The script sequence number\\n\"\n            \"     }\\n\"\n            \"     ,...\\n\"\n            \"  ],\\n\"\n            \"  \\\"vout\\\" : [             (array of json objects)\\n\"\n            \"     {\\n\"\n            \"       \\\"value\\\" : x.xxx,            (numeric) The value in \" + CURRENCY_UNIT + \"\\n\"\n            \"       \\\"n\\\" : n,                    (numeric) index\\n\"\n            \"       \\\"scriptPubKey\\\" : {          (json object)\\n\"\n            \"         \\\"asm\\\" : \\\"asm\\\",          (string) the asm\\n\"\n            \"         \\\"hex\\\" : \\\"hex\\\",          (string) the hex\\n\"\n            \"         \\\"reqSigs\\\" : n,            (numeric) The required sigs\\n\"\n            \"         \\\"type\\\" : \\\"pubkeyhash\\\",  (string) The type, eg 'pubkeyhash'\\n\"\n            \"         \\\"addresses\\\" : [           (json array of string)\\n\"\n            \"           \\\"12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\\\"   (string) sugarchain address\\n\"\n            \"           ,...\\n\"\n            \"         ]\\n\"\n            \"       }\\n\"\n            \"     }\\n\"\n            \"     ,...\\n\"\n            \"  ],\\n\"\n            \"}\\n\"\n\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"decoderawtransaction\", \"\\\"hexstring\\\"\")\n            + HelpExampleRpc(\"decoderawtransaction\", \"\\\"hexstring\\\"\")\n        );\n\n    LOCK(cs_main);\n    RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VBOOL});\n\n    CMutableTransaction mtx;\n\n    bool try_witness = request.params[1].isNull() ? true : request.params[1].get_bool();\n    bool try_no_witness = request.params[1].isNull() ? true : !request.params[1].get_bool();\n\n    if (!DecodeHexTx(mtx, request.params[0].get_str(), try_no_witness, try_witness)) {\n        throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"TX decode failed\");\n    }\n\n    UniValue result(UniValue::VOBJ);\n    TxToUniv(CTransaction(std::move(mtx)), uint256(), result, false);\n\n    return result;\n}\n\nUniValue decodescript(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"decodescript \\\"hexstring\\\"\\n\"\n            \"\\nDecode a hex-encoded script.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"hexstring\\\"     (string) the hex encoded script\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"asm\\\":\\\"asm\\\",   (string) Script public key\\n\"\n            \"  \\\"hex\\\":\\\"hex\\\",   (string) hex encoded public key\\n\"\n            \"  \\\"type\\\":\\\"type\\\", (string) The output type\\n\"\n            \"  \\\"reqSigs\\\": n,    (numeric) The required signatures\\n\"\n            \"  \\\"addresses\\\": [   (json array of string)\\n\"\n            \"     \\\"address\\\"     (string) sugarchain address\\n\"\n            \"     ,...\\n\"\n            \"  ],\\n\"\n            \"  \\\"p2sh\\\",\\\"address\\\" (string) address of P2SH script wrapping this redeem script (not returned if the script is already a P2SH).\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"decodescript\", \"\\\"hexstring\\\"\")\n            + HelpExampleRpc(\"decodescript\", \"\\\"hexstring\\\"\")\n        );\n\n    RPCTypeCheck(request.params, {UniValue::VSTR});\n\n    UniValue r(UniValue::VOBJ);\n    CScript script;\n    if (request.params[0].get_str().size() > 0){\n        std::vector<unsigned char> scriptData(ParseHexV(request.params[0], \"argument\"));\n        script = CScript(scriptData.begin(), scriptData.end());\n    } else {\n        // Empty scripts are valid\n    }\n    ScriptPubKeyToUniv(script, r, false);\n\n    UniValue type;\n    type = find_value(r, \"type\");\n\n    if (type.isStr() && type.get_str() != \"scripthash\") {\n        // P2SH cannot be wrapped in a P2SH. If this script is already a P2SH,\n        // don't return the address for a P2SH of the P2SH.\n        r.push_back(Pair(\"p2sh\", EncodeDestination(CScriptID(script))));\n    }\n\n    return r;\n}\n\n/** Pushes a JSON object for script verification or signing errors to vErrorsRet. */\nstatic void TxInErrorToJSON(const CTxIn& txin, UniValue& vErrorsRet, const std::string& strMessage)\n{\n    UniValue entry(UniValue::VOBJ);\n    entry.push_back(Pair(\"txid\", txin.prevout.hash.ToString()));\n    entry.push_back(Pair(\"vout\", (uint64_t)txin.prevout.n));\n    UniValue witness(UniValue::VARR);\n    for (unsigned int i = 0; i < txin.scriptWitness.stack.size(); i++) {\n        witness.push_back(HexStr(txin.scriptWitness.stack[i].begin(), txin.scriptWitness.stack[i].end()));\n    }\n    entry.push_back(Pair(\"witness\", witness));\n    entry.push_back(Pair(\"scriptSig\", HexStr(txin.scriptSig.begin(), txin.scriptSig.end())));\n    entry.push_back(Pair(\"sequence\", (uint64_t)txin.nSequence));\n    entry.push_back(Pair(\"error\", strMessage));\n    vErrorsRet.push_back(entry);\n}\n\nUniValue combinerawtransaction(const JSONRPCRequest& request)\n{\n\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"combinerawtransaction [\\\"hexstring\\\",...]\\n\"\n            \"\\nCombine multiple partially signed transactions into one transaction.\\n\"\n            \"The combined transaction may be another partially signed transaction or a \\n\"\n            \"fully signed transaction.\"\n\n            \"\\nArguments:\\n\"\n            \"1. \\\"txs\\\"         (string) A json array of hex strings of partially signed transactions\\n\"\n            \"    [\\n\"\n            \"      \\\"hexstring\\\"     (string) A transaction hash\\n\"\n            \"      ,...\\n\"\n            \"    ]\\n\"\n\n            \"\\nResult:\\n\"\n            \"\\\"hex\\\"            (string) The hex-encoded raw transaction with signature(s)\\n\"\n\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"combinerawtransaction\", \"[\\\"myhex1\\\", \\\"myhex2\\\", \\\"myhex3\\\"]\")\n        );\n\n\n    UniValue txs = request.params[0].get_array();\n    std::vector<CMutableTransaction> txVariants(txs.size());\n\n    for (unsigned int idx = 0; idx < txs.size(); idx++) {\n        if (!DecodeHexTx(txVariants[idx], txs[idx].get_str(), true)) {\n            throw JSONRPCError(RPC_DESERIALIZATION_ERROR, strprintf(\"TX decode failed for tx %d\", idx));\n        }\n    }\n\n    if (txVariants.empty()) {\n        throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"Missing transactions\");\n    }\n\n    // mergedTx will end up with all the signatures; it\n    // starts as a clone of the rawtx:\n    CMutableTransaction mergedTx(txVariants[0]);\n\n    // Fetch previous transactions (inputs):\n    CCoinsView viewDummy;\n    CCoinsViewCache view(&viewDummy);\n    {\n        LOCK(cs_main);\n        LOCK(mempool.cs);\n        CCoinsViewCache &viewChain = *pcoinsTip;\n        CCoinsViewMemPool viewMempool(&viewChain, mempool);\n        view.SetBackend(viewMempool); // temporarily switch cache backend to db+mempool view\n\n        for (const CTxIn& txin : mergedTx.vin) {\n            view.AccessCoin(txin.prevout); // Load entries from viewChain into view; can fail.\n        }\n\n        view.SetBackend(viewDummy); // switch back to avoid locking mempool for too long\n    }\n\n    // Use CTransaction for the constant parts of the\n    // transaction to avoid rehashing.\n    const CTransaction txConst(mergedTx);\n    // Sign what we can:\n    for (unsigned int i = 0; i < mergedTx.vin.size(); i++) {\n        CTxIn& txin = mergedTx.vin[i];\n        const Coin& coin = view.AccessCoin(txin.prevout);\n        if (coin.IsSpent()) {\n            throw JSONRPCError(RPC_VERIFY_ERROR, \"Input not found or already spent\");\n        }\n        const CScript& prevPubKey = coin.out.scriptPubKey;\n        const CAmount& amount = coin.out.nValue;\n\n        SignatureData sigdata;\n\n        // ... and merge in other signatures:\n        for (const CMutableTransaction& txv : txVariants) {\n            if (txv.vin.size() > i) {\n                sigdata = CombineSignatures(prevPubKey, TransactionSignatureChecker(&txConst, i, amount), sigdata, DataFromTransaction(txv, i));\n            }\n        }\n\n        UpdateTransaction(mergedTx, i, sigdata);\n    }\n\n    return EncodeHexTx(mergedTx);\n}\n\nUniValue signrawtransaction(const JSONRPCRequest& request)\n{\n#ifdef ENABLE_WALLET\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n#endif\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 4)\n        throw std::runtime_error(\n            \"signrawtransaction \\\"hexstring\\\" ( [{\\\"txid\\\":\\\"id\\\",\\\"vout\\\":n,\\\"scriptPubKey\\\":\\\"hex\\\",\\\"redeemScript\\\":\\\"hex\\\"},...] [\\\"privatekey1\\\",...] sighashtype )\\n\"\n            \"\\nSign inputs for raw transaction (serialized, hex-encoded).\\n\"\n            \"The second optional argument (may be null) is an array of previous transaction outputs that\\n\"\n            \"this transaction depends on but may not yet be in the block chain.\\n\"\n            \"The third optional argument (may be null) is an array of base58-encoded private\\n\"\n            \"keys that, if given, will be the only keys used to sign the transaction.\\n\"\n#ifdef ENABLE_WALLET\n            + HelpRequiringPassphrase(pwallet) + \"\\n\"\n#endif\n\n            \"\\nArguments:\\n\"\n            \"1. \\\"hexstring\\\"     (string, required) The transaction hex string\\n\"\n            \"2. \\\"prevtxs\\\"       (string, optional) An json array of previous dependent transaction outputs\\n\"\n            \"     [               (json array of json objects, or 'null' if none provided)\\n\"\n            \"       {\\n\"\n            \"         \\\"txid\\\":\\\"id\\\",             (string, required) The transaction id\\n\"\n            \"         \\\"vout\\\":n,                  (numeric, required) The output number\\n\"\n            \"         \\\"scriptPubKey\\\": \\\"hex\\\",   (string, required) script key\\n\"\n            \"         \\\"redeemScript\\\": \\\"hex\\\",   (string, required for P2SH or P2WSH) redeem script\\n\"\n            \"         \\\"amount\\\": value            (numeric, required) The amount spent\\n\"\n            \"       }\\n\"\n            \"       ,...\\n\"\n            \"    ]\\n\"\n            \"3. \\\"privkeys\\\"     (string, optional) A json array of base58-encoded private keys for signing\\n\"\n            \"    [                  (json array of strings, or 'null' if none provided)\\n\"\n            \"      \\\"privatekey\\\"   (string) private key in base58-encoding\\n\"\n            \"      ,...\\n\"\n            \"    ]\\n\"\n            \"4. \\\"sighashtype\\\"     (string, optional, default=ALL) The signature hash type. Must be one of\\n\"\n            \"       \\\"ALL\\\"\\n\"\n            \"       \\\"NONE\\\"\\n\"\n            \"       \\\"SINGLE\\\"\\n\"\n            \"       \\\"ALL|ANYONECANPAY\\\"\\n\"\n            \"       \\\"NONE|ANYONECANPAY\\\"\\n\"\n            \"       \\\"SINGLE|ANYONECANPAY\\\"\\n\"\n\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"hex\\\" : \\\"value\\\",           (string) The hex-encoded raw transaction with signature(s)\\n\"\n            \"  \\\"complete\\\" : true|false,   (boolean) If the transaction has a complete set of signatures\\n\"\n            \"  \\\"errors\\\" : [                 (json array of objects) Script verification errors (if there are any)\\n\"\n            \"    {\\n\"\n            \"      \\\"txid\\\" : \\\"hash\\\",           (string) The hash of the referenced, previous transaction\\n\"\n            \"      \\\"vout\\\" : n,                (numeric) The index of the output to spent and used as input\\n\"\n            \"      \\\"scriptSig\\\" : \\\"hex\\\",       (string) The hex-encoded signature script\\n\"\n            \"      \\\"sequence\\\" : n,            (numeric) Script sequence number\\n\"\n            \"      \\\"error\\\" : \\\"text\\\"           (string) Verification or signing error related to the input\\n\"\n            \"    }\\n\"\n            \"    ,...\\n\"\n            \"  ]\\n\"\n            \"}\\n\"\n\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"signrawtransaction\", \"\\\"myhex\\\"\")\n            + HelpExampleRpc(\"signrawtransaction\", \"\\\"myhex\\\"\")\n        );\n\n    ObserveSafeMode();\n#ifdef ENABLE_WALLET\n    LOCK2(cs_main, pwallet ? &pwallet->cs_wallet : nullptr);\n#else\n    LOCK(cs_main);\n#endif\n    RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR, UniValue::VARR, UniValue::VSTR}, true);\n\n    CMutableTransaction mtx;\n    if (!DecodeHexTx(mtx, request.params[0].get_str(), true))\n        throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"TX decode failed\");\n\n    // Fetch previous transactions (inputs):\n    CCoinsView viewDummy;\n    CCoinsViewCache view(&viewDummy);\n    {\n        LOCK(mempool.cs);\n        CCoinsViewCache &viewChain = *pcoinsTip;\n        CCoinsViewMemPool viewMempool(&viewChain, mempool);\n        view.SetBackend(viewMempool); // temporarily switch cache backend to db+mempool view\n\n        for (const CTxIn& txin : mtx.vin) {\n            view.AccessCoin(txin.prevout); // Load entries from viewChain into view; can fail.\n        }\n\n        view.SetBackend(viewDummy); // switch back to avoid locking mempool for too long\n    }\n\n    bool fGivenKeys = false;\n    CBasicKeyStore tempKeystore;\n    if (!request.params[2].isNull()) {\n        fGivenKeys = true;\n        UniValue keys = request.params[2].get_array();\n        for (unsigned int idx = 0; idx < keys.size(); idx++) {\n            UniValue k = keys[idx];\n            CBitcoinSecret vchSecret;\n            bool fGood = vchSecret.SetString(k.get_str());\n            if (!fGood)\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid private key\");\n            CKey key = vchSecret.GetKey();\n            if (!key.IsValid())\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Private key outside allowed range\");\n            tempKeystore.AddKey(key);\n        }\n    }\n#ifdef ENABLE_WALLET\n    else if (pwallet) {\n        EnsureWalletIsUnlocked(pwallet);\n    }\n#endif\n\n    // Add previous txouts given in the RPC call:\n    if (!request.params[1].isNull()) {\n        UniValue prevTxs = request.params[1].get_array();\n        for (unsigned int idx = 0; idx < prevTxs.size(); idx++) {\n            const UniValue& p = prevTxs[idx];\n            if (!p.isObject())\n                throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"expected object with {\\\"txid'\\\",\\\"vout\\\",\\\"scriptPubKey\\\"}\");\n\n            UniValue prevOut = p.get_obj();\n\n            RPCTypeCheckObj(prevOut,\n                {\n                    {\"txid\", UniValueType(UniValue::VSTR)},\n                    {\"vout\", UniValueType(UniValue::VNUM)},\n                    {\"scriptPubKey\", UniValueType(UniValue::VSTR)},\n                });\n\n            uint256 txid = ParseHashO(prevOut, \"txid\");\n\n            int nOut = find_value(prevOut, \"vout\").get_int();\n            if (nOut < 0)\n                throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"vout must be positive\");\n\n            COutPoint out(txid, nOut);\n            std::vector<unsigned char> pkData(ParseHexO(prevOut, \"scriptPubKey\"));\n            CScript scriptPubKey(pkData.begin(), pkData.end());\n\n            {\n                const Coin& coin = view.AccessCoin(out);\n                if (!coin.IsSpent() && coin.out.scriptPubKey != scriptPubKey) {\n                    std::string err(\"Previous output scriptPubKey mismatch:\\n\");\n                    err = err + ScriptToAsmStr(coin.out.scriptPubKey) + \"\\nvs:\\n\"+\n                        ScriptToAsmStr(scriptPubKey);\n                    throw JSONRPCError(RPC_DESERIALIZATION_ERROR, err);\n                }\n                Coin newcoin;\n                newcoin.out.scriptPubKey = scriptPubKey;\n                newcoin.out.nValue = MAX_MONEY;\n                if (prevOut.exists(\"amount\")) {\n                    newcoin.out.nValue = AmountFromValue(find_value(prevOut, \"amount\"));\n                }\n                newcoin.nHeight = 1;\n                view.AddCoin(out, std::move(newcoin), true);\n            }\n\n            // if redeemScript given and not using the local wallet (private keys\n            // given), add redeemScript to the tempKeystore so it can be signed:\n            if (fGivenKeys && (scriptPubKey.IsPayToScriptHash() || scriptPubKey.IsPayToWitnessScriptHash())) {\n                RPCTypeCheckObj(prevOut,\n                    {\n                        {\"txid\", UniValueType(UniValue::VSTR)},\n                        {\"vout\", UniValueType(UniValue::VNUM)},\n                        {\"scriptPubKey\", UniValueType(UniValue::VSTR)},\n                        {\"redeemScript\", UniValueType(UniValue::VSTR)},\n                    });\n                UniValue v = find_value(prevOut, \"redeemScript\");\n                if (!v.isNull()) {\n                    std::vector<unsigned char> rsData(ParseHexV(v, \"redeemScript\"));\n                    CScript redeemScript(rsData.begin(), rsData.end());\n                    tempKeystore.AddCScript(redeemScript);\n                    // Automatically also add the P2WSH wrapped version of the script (to deal with P2SH-P2WSH).\n                    tempKeystore.AddCScript(GetScriptForWitness(redeemScript));\n                }\n            }\n        }\n    }\n\n#ifdef ENABLE_WALLET\n    const CKeyStore& keystore = ((fGivenKeys || !pwallet) ? tempKeystore : *pwallet);\n#else\n    const CKeyStore& keystore = tempKeystore;\n#endif\n\n    int nHashType = SIGHASH_ALL;\n    if (!request.params[3].isNull()) {\n        static std::map<std::string, int> mapSigHashValues = {\n            {std::string(\"ALL\"), int(SIGHASH_ALL)},\n            {std::string(\"ALL|ANYONECANPAY\"), int(SIGHASH_ALL|SIGHASH_ANYONECANPAY)},\n            {std::string(\"NONE\"), int(SIGHASH_NONE)},\n            {std::string(\"NONE|ANYONECANPAY\"), int(SIGHASH_NONE|SIGHASH_ANYONECANPAY)},\n            {std::string(\"SINGLE\"), int(SIGHASH_SINGLE)},\n            {std::string(\"SINGLE|ANYONECANPAY\"), int(SIGHASH_SINGLE|SIGHASH_ANYONECANPAY)},\n        };\n        std::string strHashType = request.params[3].get_str();\n        if (mapSigHashValues.count(strHashType))\n            nHashType = mapSigHashValues[strHashType];\n        else\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid sighash param\");\n    }\n\n    bool fHashSingle = ((nHashType & ~SIGHASH_ANYONECANPAY) == SIGHASH_SINGLE);\n\n    // Script verification errors\n    UniValue vErrors(UniValue::VARR);\n\n    // Use CTransaction for the constant parts of the\n    // transaction to avoid rehashing.\n    const CTransaction txConst(mtx);\n    // Sign what we can:\n    for (unsigned int i = 0; i < mtx.vin.size(); i++) {\n        CTxIn& txin = mtx.vin[i];\n        const Coin& coin = view.AccessCoin(txin.prevout);\n        if (coin.IsSpent()) {\n            TxInErrorToJSON(txin, vErrors, \"Input not found or already spent\");\n            continue;\n        }\n        const CScript& prevPubKey = coin.out.scriptPubKey;\n        const CAmount& amount = coin.out.nValue;\n\n        SignatureData sigdata;\n        // Only sign SIGHASH_SINGLE if there's a corresponding output:\n        if (!fHashSingle || (i < mtx.vout.size()))\n            ProduceSignature(MutableTransactionSignatureCreator(&keystore, &mtx, i, amount, nHashType), prevPubKey, sigdata);\n        sigdata = CombineSignatures(prevPubKey, TransactionSignatureChecker(&txConst, i, amount), sigdata, DataFromTransaction(mtx, i));\n\n        UpdateTransaction(mtx, i, sigdata);\n\n        // amount must be specified for valid segwit signature\n        if (amount == MAX_MONEY && !txin.scriptWitness.IsNull()) {\n            throw JSONRPCError(RPC_TYPE_ERROR, strprintf(\"Missing amount for %s\", coin.out.ToString()));\n        }\n\n        ScriptError serror = SCRIPT_ERR_OK;\n        if (!VerifyScript(txin.scriptSig, prevPubKey, &txin.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, TransactionSignatureChecker(&txConst, i, amount), &serror)) {\n            if (serror == SCRIPT_ERR_INVALID_STACK_OPERATION) {\n                // Unable to sign input and verification failed (possible attempt to partially sign).\n                TxInErrorToJSON(txin, vErrors, \"Unable to sign input, invalid stack size (possibly missing key)\");\n            } else {\n                TxInErrorToJSON(txin, vErrors, ScriptErrorString(serror));\n            }\n        }\n    }\n    bool fComplete = vErrors.empty();\n\n    UniValue result(UniValue::VOBJ);\n    result.push_back(Pair(\"hex\", EncodeHexTx(mtx)));\n    result.push_back(Pair(\"complete\", fComplete));\n    if (!vErrors.empty()) {\n        result.push_back(Pair(\"errors\", vErrors));\n    }\n\n    return result;\n}\n\nUniValue sendrawtransaction(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"sendrawtransaction \\\"hexstring\\\" ( allowhighfees )\\n\"\n            \"\\nSubmits raw transaction (serialized, hex-encoded) to local node and network.\\n\"\n            \"\\nAlso see createrawtransaction and signrawtransaction calls.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"hexstring\\\"    (string, required) The hex string of the raw transaction)\\n\"\n            \"2. allowhighfees    (boolean, optional, default=false) Allow high fees\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"hex\\\"             (string) The transaction hash in hex\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nCreate a transaction\\n\"\n            + HelpExampleCli(\"createrawtransaction\", \"\\\"[{\\\\\\\"txid\\\\\\\" : \\\\\\\"mytxid\\\\\\\",\\\\\\\"vout\\\\\\\":0}]\\\" \\\"{\\\\\\\"myaddress\\\\\\\":0.01}\\\"\") +\n            \"Sign the transaction, and get back the hex\\n\"\n            + HelpExampleCli(\"signrawtransaction\", \"\\\"myhex\\\"\") +\n            \"\\nSend the transaction (signed hex)\\n\"\n            + HelpExampleCli(\"sendrawtransaction\", \"\\\"signedhex\\\"\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"sendrawtransaction\", \"\\\"signedhex\\\"\")\n        );\n\n    ObserveSafeMode();\n\n    std::promise<void> promise;\n\n    RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VBOOL});\n\n    // parse hex string from parameter\n    CMutableTransaction mtx;\n    if (!DecodeHexTx(mtx, request.params[0].get_str()))\n        throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"TX decode failed\");\n    CTransactionRef tx(MakeTransactionRef(std::move(mtx)));\n    const uint256& hashTx = tx->GetHash();\n\n    CAmount nMaxRawTxFee = maxTxFee;\n    if (!request.params[1].isNull() && request.params[1].get_bool())\n        nMaxRawTxFee = 0;\n\n    { // cs_main scope\n    LOCK(cs_main);\n    CCoinsViewCache &view = *pcoinsTip;\n    bool fHaveChain = false;\n    for (size_t o = 0; !fHaveChain && o < tx->vout.size(); o++) {\n        const Coin& existingCoin = view.AccessCoin(COutPoint(hashTx, o));\n        fHaveChain = !existingCoin.IsSpent();\n    }\n    bool fHaveMempool = mempool.exists(hashTx);\n    if (!fHaveMempool && !fHaveChain) {\n        // push to local node and sync with wallets\n        CValidationState state;\n        bool fMissingInputs;\n        if (!AcceptToMemoryPool(mempool, state, std::move(tx), &fMissingInputs,\n                                nullptr /* plTxnReplaced */, false /* bypass_limits */, nMaxRawTxFee)) {\n            if (state.IsInvalid()) {\n                throw JSONRPCError(RPC_TRANSACTION_REJECTED, strprintf(\"%i: %s\", state.GetRejectCode(), state.GetRejectReason()));\n            } else {\n                if (fMissingInputs) {\n                    throw JSONRPCError(RPC_TRANSACTION_ERROR, \"Missing inputs\");\n                }\n                throw JSONRPCError(RPC_TRANSACTION_ERROR, state.GetRejectReason());\n            }\n        } else {\n            // If wallet is enabled, ensure that the wallet has been made aware\n            // of the new transaction prior to returning. This prevents a race\n            // where a user might call sendrawtransaction with a transaction\n            // to/from their wallet, immediately call some wallet RPC, and get\n            // a stale result because callbacks have not yet been processed.\n            CallFunctionInValidationInterfaceQueue([&promise] {\n                promise.set_value();\n            });\n        }\n    } else if (fHaveChain) {\n        throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, \"transaction already in block chain\");\n    } else {\n        // Make sure we don't block forever if re-sending\n        // a transaction already in mempool.\n        promise.set_value();\n    }\n\n    } // cs_main\n\n    promise.get_future().wait();\n\n    if(!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    CInv inv(MSG_TX, hashTx);\n    g_connman->ForEachNode([&inv](CNode* pnode)\n    {\n        pnode->PushInventory(inv);\n    });\n\n    return hashTx.GetHex();\n}\n\nstatic const CRPCCommand commands[] =\n{ //  category              name                      actor (function)         argNames\n  //  --------------------- ------------------------  -----------------------  ----------\n    { \"rawtransactions\",    \"getrawtransaction\",      &getrawtransaction,      {\"txid\",\"verbose\",\"blockhash\"} },\n    { \"rawtransactions\",    \"createrawtransaction\",   &createrawtransaction,   {\"inputs\",\"outputs\",\"locktime\",\"replaceable\"} },\n    { \"rawtransactions\",    \"decoderawtransaction\",   &decoderawtransaction,   {\"hexstring\",\"iswitness\"} },\n    { \"rawtransactions\",    \"decodescript\",           &decodescript,           {\"hexstring\"} },\n    { \"rawtransactions\",    \"sendrawtransaction\",     &sendrawtransaction,     {\"hexstring\",\"allowhighfees\"} },\n    { \"rawtransactions\",    \"combinerawtransaction\",  &combinerawtransaction,  {\"txs\"} },\n    { \"rawtransactions\",    \"signrawtransaction\",     &signrawtransaction,     {\"hexstring\",\"prevtxs\",\"privkeys\",\"sighashtype\"} }, /* uses wallet if enabled */\n\n    { \"blockchain\",         \"gettxoutproof\",          &gettxoutproof,          {\"txids\", \"blockhash\"} },\n    { \"blockchain\",         \"verifytxoutproof\",       &verifytxoutproof,       {\"proof\"} },\n};\n\nvoid RegisterRawTransactionRPCCommands(CRPCTable &t)\n{\n    for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)\n        t.appendCommand(commands[vcidx].name, &commands[vcidx]);\n}\n"
  },
  {
    "path": "src/rpc/register.h",
    "content": "// Copyright (c) 2009-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_RPCREGISTER_H\n#define BITCOIN_RPCREGISTER_H\n\n/** These are in one header file to avoid creating tons of single-function\n * headers for everything under src/rpc/ */\nclass CRPCTable;\n\n/** Register block chain RPC commands */\nvoid RegisterBlockchainRPCCommands(CRPCTable &tableRPC);\n/** Register P2P networking RPC commands */\nvoid RegisterNetRPCCommands(CRPCTable &tableRPC);\n/** Register miscellaneous RPC commands */\nvoid RegisterMiscRPCCommands(CRPCTable &tableRPC);\n/** Register mining RPC commands */\nvoid RegisterMiningRPCCommands(CRPCTable &tableRPC);\n/** Register raw transaction RPC commands */\nvoid RegisterRawTransactionRPCCommands(CRPCTable &tableRPC);\n\nstatic inline void RegisterAllCoreRPCCommands(CRPCTable &t)\n{\n    RegisterBlockchainRPCCommands(t);\n    RegisterNetRPCCommands(t);\n    RegisterMiscRPCCommands(t);\n    RegisterMiningRPCCommands(t);\n    RegisterRawTransactionRPCCommands(t);\n}\n\n#endif\n"
  },
  {
    "path": "src/rpc/safemode.cpp",
    "content": "#include <rpc/safemode.h>\n\n#include <rpc/protocol.h>\n#include <util.h>\n#include <warnings.h>\n\nvoid ObserveSafeMode()\n{\n    std::string warning = GetWarnings(\"rpc\");\n    if (warning != \"\" && !gArgs.GetBoolArg(\"-disablesafemode\", DEFAULT_DISABLE_SAFEMODE)) {\n        throw JSONRPCError(RPC_FORBIDDEN_BY_SAFE_MODE, std::string(\"Safe mode: \") + warning);\n    }\n}\n\n"
  },
  {
    "path": "src/rpc/safemode.h",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_RPC_SAFEMODE_H\n#define BITCOIN_RPC_SAFEMODE_H\n\nstatic const bool DEFAULT_DISABLE_SAFEMODE = true;\n\nvoid ObserveSafeMode();\n\n#endif // BITCOIN_RPC_SAFEMODE_H\n"
  },
  {
    "path": "src/rpc/server.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <rpc/server.h>\n\n#include <base58.h>\n#include <fs.h>\n#include <init.h>\n#include <random.h>\n#include <sync.h>\n#include <ui_interface.h>\n#include <util.h>\n#include <utilstrencodings.h>\n\n#include <boost/bind.hpp>\n#include <boost/signals2/signal.hpp>\n#include <boost/algorithm/string/case_conv.hpp> // for to_upper()\n#include <boost/algorithm/string/classification.hpp>\n#include <boost/algorithm/string/split.hpp>\n\n#include <memory> // for unique_ptr\n#include <unordered_map>\n\nstatic bool fRPCRunning = false;\nstatic bool fRPCInWarmup = true;\nstatic std::string rpcWarmupStatus(\"RPC server started\");\nstatic CCriticalSection cs_rpcWarmup;\n/* Timer-creating functions */\nstatic RPCTimerInterface* timerInterface = nullptr;\n/* Map of name to timer. */\nstatic std::map<std::string, std::unique_ptr<RPCTimerBase> > deadlineTimers;\n\nstatic struct CRPCSignals\n{\n    boost::signals2::signal<void ()> Started;\n    boost::signals2::signal<void ()> Stopped;\n    boost::signals2::signal<void (const CRPCCommand&)> PreCommand;\n} g_rpcSignals;\n\nvoid RPCServer::OnStarted(std::function<void ()> slot)\n{\n    g_rpcSignals.Started.connect(slot);\n}\n\nvoid RPCServer::OnStopped(std::function<void ()> slot)\n{\n    g_rpcSignals.Stopped.connect(slot);\n}\n\nvoid RPCTypeCheck(const UniValue& params,\n                  const std::list<UniValue::VType>& typesExpected,\n                  bool fAllowNull)\n{\n    unsigned int i = 0;\n    for (UniValue::VType t : typesExpected)\n    {\n        if (params.size() <= i)\n            break;\n\n        const UniValue& v = params[i];\n        if (!(fAllowNull && v.isNull())) {\n            RPCTypeCheckArgument(v, t);\n        }\n        i++;\n    }\n}\n\nvoid RPCTypeCheckArgument(const UniValue& value, UniValue::VType typeExpected)\n{\n    if (value.type() != typeExpected) {\n        throw JSONRPCError(RPC_TYPE_ERROR, strprintf(\"Expected type %s, got %s\", uvTypeName(typeExpected), uvTypeName(value.type())));\n    }\n}\n\nvoid RPCTypeCheckObj(const UniValue& o,\n    const std::map<std::string, UniValueType>& typesExpected,\n    bool fAllowNull,\n    bool fStrict)\n{\n    for (const auto& t : typesExpected) {\n        const UniValue& v = find_value(o, t.first);\n        if (!fAllowNull && v.isNull())\n            throw JSONRPCError(RPC_TYPE_ERROR, strprintf(\"Missing %s\", t.first));\n\n        if (!(t.second.typeAny || v.type() == t.second.type || (fAllowNull && v.isNull()))) {\n            std::string err = strprintf(\"Expected type %s for %s, got %s\",\n                uvTypeName(t.second.type), t.first, uvTypeName(v.type()));\n            throw JSONRPCError(RPC_TYPE_ERROR, err);\n        }\n    }\n\n    if (fStrict)\n    {\n        for (const std::string& k : o.getKeys())\n        {\n            if (typesExpected.count(k) == 0)\n            {\n                std::string err = strprintf(\"Unexpected key %s\", k);\n                throw JSONRPCError(RPC_TYPE_ERROR, err);\n            }\n        }\n    }\n}\n\nCAmount AmountFromValue(const UniValue& value)\n{\n    if (!value.isNum() && !value.isStr())\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Amount is not a number or string\");\n    CAmount amount;\n    if (!ParseFixedPoint(value.getValStr(), 8, &amount))\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Invalid amount\");\n    if (!MoneyRange(amount))\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Amount out of range\");\n    return amount;\n}\n\nuint256 ParseHashV(const UniValue& v, std::string strName)\n{\n    std::string strHex;\n    if (v.isStr())\n        strHex = v.get_str();\n    if (!IsHex(strHex)) // Note: IsHex(\"\") is false\n        throw JSONRPCError(RPC_INVALID_PARAMETER, strName+\" must be hexadecimal string (not '\"+strHex+\"')\");\n    if (64 != strHex.length())\n        throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf(\"%s must be of length %d (not %d)\", strName, 64, strHex.length()));\n    uint256 result;\n    result.SetHex(strHex);\n    return result;\n}\nuint256 ParseHashO(const UniValue& o, std::string strKey)\n{\n    return ParseHashV(find_value(o, strKey), strKey);\n}\nstd::vector<unsigned char> ParseHexV(const UniValue& v, std::string strName)\n{\n    std::string strHex;\n    if (v.isStr())\n        strHex = v.get_str();\n    if (!IsHex(strHex))\n        throw JSONRPCError(RPC_INVALID_PARAMETER, strName+\" must be hexadecimal string (not '\"+strHex+\"')\");\n    return ParseHex(strHex);\n}\nstd::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKey)\n{\n    return ParseHexV(find_value(o, strKey), strKey);\n}\n\n/**\n * Note: This interface may still be subject to change.\n */\n\nstd::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest& helpreq) const\n{\n    std::string strRet;\n    std::string category;\n    std::set<rpcfn_type> setDone;\n    std::vector<std::pair<std::string, const CRPCCommand*> > vCommands;\n\n    for (const auto& entry : mapCommands)\n        vCommands.push_back(make_pair(entry.second->category + entry.first, entry.second));\n    sort(vCommands.begin(), vCommands.end());\n\n    JSONRPCRequest jreq(helpreq);\n    jreq.fHelp = true;\n    jreq.params = UniValue();\n\n    for (const std::pair<std::string, const CRPCCommand*>& command : vCommands)\n    {\n        const CRPCCommand *pcmd = command.second;\n        std::string strMethod = pcmd->name;\n        if ((strCommand != \"\" || pcmd->category == \"hidden\") && strMethod != strCommand)\n            continue;\n        jreq.strMethod = strMethod;\n        try\n        {\n            rpcfn_type pfn = pcmd->actor;\n            if (setDone.insert(pfn).second)\n                (*pfn)(jreq);\n        }\n        catch (const std::exception& e)\n        {\n            // Help text is returned in an exception\n            std::string strHelp = std::string(e.what());\n            if (strCommand == \"\")\n            {\n                if (strHelp.find('\\n') != std::string::npos)\n                    strHelp = strHelp.substr(0, strHelp.find('\\n'));\n\n                if (category != pcmd->category)\n                {\n                    if (!category.empty())\n                        strRet += \"\\n\";\n                    category = pcmd->category;\n                    std::string firstLetter = category.substr(0,1);\n                    boost::to_upper(firstLetter);\n                    strRet += \"== \" + firstLetter + category.substr(1) + \" ==\\n\";\n                }\n            }\n            strRet += strHelp + \"\\n\";\n        }\n    }\n    if (strRet == \"\")\n        strRet = strprintf(\"help: unknown command: %s\\n\", strCommand);\n    strRet = strRet.substr(0,strRet.size()-1);\n    return strRet;\n}\n\nUniValue help(const JSONRPCRequest& jsonRequest)\n{\n    if (jsonRequest.fHelp || jsonRequest.params.size() > 1)\n        throw std::runtime_error(\n            \"help ( \\\"command\\\" )\\n\"\n            \"\\nList all commands, or get help for a specified command.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"command\\\"     (string, optional) The command to get help on\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"text\\\"     (string) The help text\\n\"\n        );\n\n    std::string strCommand;\n    if (jsonRequest.params.size() > 0)\n        strCommand = jsonRequest.params[0].get_str();\n\n    return tableRPC.help(strCommand, jsonRequest);\n}\n\n\nUniValue stop(const JSONRPCRequest& jsonRequest)\n{\n    // Accept the deprecated and ignored 'detach' boolean argument\n    if (jsonRequest.fHelp || jsonRequest.params.size() > 1)\n        throw std::runtime_error(\n            \"stop\\n\"\n            \"\\nStop Sugarchain server.\");\n    // Event loop will exit after current HTTP requests have been handled, so\n    // this reply will get back to the client.\n    StartShutdown();\n    return \"Sugarchain server stopping\";\n}\n\nUniValue uptime(const JSONRPCRequest& jsonRequest)\n{\n    if (jsonRequest.fHelp || jsonRequest.params.size() > 1)\n        throw std::runtime_error(\n                \"uptime\\n\"\n                        \"\\nReturns the total uptime of the server.\\n\"\n                        \"\\nResult:\\n\"\n                        \"ttt        (numeric) The number of seconds that the server has been running\\n\"\n                        \"\\nExamples:\\n\"\n                + HelpExampleCli(\"uptime\", \"\")\n                + HelpExampleRpc(\"uptime\", \"\")\n        );\n\n    return GetTime() - GetStartupTime();\n}\n\n/**\n * Call Table\n */\nstatic const CRPCCommand vRPCCommands[] =\n{ //  category              name                      actor (function)         argNames\n  //  --------------------- ------------------------  -----------------------  ----------\n    /* Overall control/query calls */\n    { \"control\",            \"help\",                   &help,                   {\"command\"}  },\n    { \"control\",            \"stop\",                   &stop,                   {}  },\n    { \"control\",            \"uptime\",                 &uptime,                 {}  },\n};\n\nCRPCTable::CRPCTable()\n{\n    unsigned int vcidx;\n    for (vcidx = 0; vcidx < (sizeof(vRPCCommands) / sizeof(vRPCCommands[0])); vcidx++)\n    {\n        const CRPCCommand *pcmd;\n\n        pcmd = &vRPCCommands[vcidx];\n        mapCommands[pcmd->name] = pcmd;\n    }\n}\n\nconst CRPCCommand *CRPCTable::operator[](const std::string &name) const\n{\n    std::map<std::string, const CRPCCommand*>::const_iterator it = mapCommands.find(name);\n    if (it == mapCommands.end())\n        return nullptr;\n    return (*it).second;\n}\n\nbool CRPCTable::appendCommand(const std::string& name, const CRPCCommand* pcmd)\n{\n    if (IsRPCRunning())\n        return false;\n\n    // don't allow overwriting for now\n    std::map<std::string, const CRPCCommand*>::const_iterator it = mapCommands.find(name);\n    if (it != mapCommands.end())\n        return false;\n\n    mapCommands[name] = pcmd;\n    return true;\n}\n\nbool StartRPC()\n{\n    LogPrint(BCLog::RPC, \"Starting RPC\\n\");\n    fRPCRunning = true;\n    g_rpcSignals.Started();\n    return true;\n}\n\nvoid InterruptRPC()\n{\n    LogPrint(BCLog::RPC, \"Interrupting RPC\\n\");\n    // Interrupt e.g. running longpolls\n    fRPCRunning = false;\n}\n\nvoid StopRPC()\n{\n    LogPrint(BCLog::RPC, \"Stopping RPC\\n\");\n    deadlineTimers.clear();\n    DeleteAuthCookie();\n    g_rpcSignals.Stopped();\n}\n\nbool IsRPCRunning()\n{\n    return fRPCRunning;\n}\n\nvoid SetRPCWarmupStatus(const std::string& newStatus)\n{\n    LOCK(cs_rpcWarmup);\n    rpcWarmupStatus = newStatus;\n}\n\nvoid SetRPCWarmupFinished()\n{\n    LOCK(cs_rpcWarmup);\n    assert(fRPCInWarmup);\n    fRPCInWarmup = false;\n}\n\nbool RPCIsInWarmup(std::string *outStatus)\n{\n    LOCK(cs_rpcWarmup);\n    if (outStatus)\n        *outStatus = rpcWarmupStatus;\n    return fRPCInWarmup;\n}\n\nvoid JSONRPCRequest::parse(const UniValue& valRequest)\n{\n    // Parse request\n    if (!valRequest.isObject())\n        throw JSONRPCError(RPC_INVALID_REQUEST, \"Invalid Request object\");\n    const UniValue& request = valRequest.get_obj();\n\n    // Parse id now so errors from here on will have the id\n    id = find_value(request, \"id\");\n\n    // Parse method\n    UniValue valMethod = find_value(request, \"method\");\n    if (valMethod.isNull())\n        throw JSONRPCError(RPC_INVALID_REQUEST, \"Missing method\");\n    if (!valMethod.isStr())\n        throw JSONRPCError(RPC_INVALID_REQUEST, \"Method must be a string\");\n    strMethod = valMethod.get_str();\n    LogPrint(BCLog::RPC, \"ThreadRPCServer method=%s\\n\", SanitizeString(strMethod));\n\n    // Parse params\n    UniValue valParams = find_value(request, \"params\");\n    if (valParams.isArray() || valParams.isObject())\n        params = valParams;\n    else if (valParams.isNull())\n        params = UniValue(UniValue::VARR);\n    else\n        throw JSONRPCError(RPC_INVALID_REQUEST, \"Params must be an array or object\");\n}\n\nbool IsDeprecatedRPCEnabled(const std::string& method)\n{\n    const std::vector<std::string> enabled_methods = gArgs.GetArgs(\"-deprecatedrpc\");\n\n    return find(enabled_methods.begin(), enabled_methods.end(), method) != enabled_methods.end();\n}\n\nstatic UniValue JSONRPCExecOne(JSONRPCRequest jreq, const UniValue& req)\n{\n    UniValue rpc_result(UniValue::VOBJ);\n\n    try {\n        jreq.parse(req);\n\n        UniValue result = tableRPC.execute(jreq);\n        rpc_result = JSONRPCReplyObj(result, NullUniValue, jreq.id);\n    }\n    catch (const UniValue& objError)\n    {\n        rpc_result = JSONRPCReplyObj(NullUniValue, objError, jreq.id);\n    }\n    catch (const std::exception& e)\n    {\n        rpc_result = JSONRPCReplyObj(NullUniValue,\n                                     JSONRPCError(RPC_PARSE_ERROR, e.what()), jreq.id);\n    }\n\n    return rpc_result;\n}\n\nstd::string JSONRPCExecBatch(const JSONRPCRequest& jreq, const UniValue& vReq)\n{\n    UniValue ret(UniValue::VARR);\n    for (unsigned int reqIdx = 0; reqIdx < vReq.size(); reqIdx++)\n        ret.push_back(JSONRPCExecOne(jreq, vReq[reqIdx]));\n\n    return ret.write() + \"\\n\";\n}\n\n/**\n * Process named arguments into a vector of positional arguments, based on the\n * passed-in specification for the RPC call's arguments.\n */\nstatic inline JSONRPCRequest transformNamedArguments(const JSONRPCRequest& in, const std::vector<std::string>& argNames)\n{\n    JSONRPCRequest out = in;\n    out.params = UniValue(UniValue::VARR);\n    // Build a map of parameters, and remove ones that have been processed, so that we can throw a focused error if\n    // there is an unknown one.\n    const std::vector<std::string>& keys = in.params.getKeys();\n    const std::vector<UniValue>& values = in.params.getValues();\n    std::unordered_map<std::string, const UniValue*> argsIn;\n    for (size_t i=0; i<keys.size(); ++i) {\n        argsIn[keys[i]] = &values[i];\n    }\n    // Process expected parameters.\n    int hole = 0;\n    for (const std::string &argNamePattern: argNames) {\n        std::vector<std::string> vargNames;\n        boost::algorithm::split(vargNames, argNamePattern, boost::algorithm::is_any_of(\"|\"));\n        auto fr = argsIn.end();\n        for (const std::string & argName : vargNames) {\n            fr = argsIn.find(argName);\n            if (fr != argsIn.end()) {\n                break;\n            }\n        }\n        if (fr != argsIn.end()) {\n            for (int i = 0; i < hole; ++i) {\n                // Fill hole between specified parameters with JSON nulls,\n                // but not at the end (for backwards compatibility with calls\n                // that act based on number of specified parameters).\n                out.params.push_back(UniValue());\n            }\n            hole = 0;\n            out.params.push_back(*fr->second);\n            argsIn.erase(fr);\n        } else {\n            hole += 1;\n        }\n    }\n    // If there are still arguments in the argsIn map, this is an error.\n    if (!argsIn.empty()) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Unknown named parameter \" + argsIn.begin()->first);\n    }\n    // Return request with named arguments transformed to positional arguments\n    return out;\n}\n\nUniValue CRPCTable::execute(const JSONRPCRequest &request) const\n{\n    // Return immediately if in warmup\n    {\n        LOCK(cs_rpcWarmup);\n        if (fRPCInWarmup)\n            throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);\n    }\n\n    // Find method\n    const CRPCCommand *pcmd = tableRPC[request.strMethod];\n    if (!pcmd)\n        throw JSONRPCError(RPC_METHOD_NOT_FOUND, \"Method not found\");\n\n    g_rpcSignals.PreCommand(*pcmd);\n\n    try\n    {\n        // Execute, convert arguments to array if necessary\n        if (request.params.isObject()) {\n            return pcmd->actor(transformNamedArguments(request, pcmd->argNames));\n        } else {\n            return pcmd->actor(request);\n        }\n    }\n    catch (const std::exception& e)\n    {\n        throw JSONRPCError(RPC_MISC_ERROR, e.what());\n    }\n}\n\nstd::vector<std::string> CRPCTable::listCommands() const\n{\n    std::vector<std::string> commandList;\n    typedef std::map<std::string, const CRPCCommand*> commandMap;\n\n    std::transform( mapCommands.begin(), mapCommands.end(),\n                   std::back_inserter(commandList),\n                   boost::bind(&commandMap::value_type::first,_1) );\n    return commandList;\n}\n\nstd::string HelpExampleCli(const std::string& methodname, const std::string& args)\n{\n    return \"> sugarchain-cli \" + methodname + \" \" + args + \"\\n\";\n}\n\nstd::string HelpExampleRpc(const std::string& methodname, const std::string& args)\n{\n    return \"> curl --user myusername --data-binary '{\\\"jsonrpc\\\": \\\"1.0\\\", \\\"id\\\":\\\"curltest\\\", \"\n        \"\\\"method\\\": \\\"\" + methodname + \"\\\", \\\"params\\\": [\" + args + \"] }' -H 'content-type: text/plain;' http://127.0.0.1:34229/\\n\";\n}\n\nvoid RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface)\n{\n    if (!timerInterface)\n        timerInterface = iface;\n}\n\nvoid RPCSetTimerInterface(RPCTimerInterface *iface)\n{\n    timerInterface = iface;\n}\n\nvoid RPCUnsetTimerInterface(RPCTimerInterface *iface)\n{\n    if (timerInterface == iface)\n        timerInterface = nullptr;\n}\n\nvoid RPCRunLater(const std::string& name, std::function<void(void)> func, int64_t nSeconds)\n{\n    if (!timerInterface)\n        throw JSONRPCError(RPC_INTERNAL_ERROR, \"No timer handler registered for RPC\");\n    deadlineTimers.erase(name);\n    LogPrint(BCLog::RPC, \"queue run of timer %s in %i seconds (using %s)\\n\", name, nSeconds, timerInterface->Name());\n    deadlineTimers.emplace(name, std::unique_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000)));\n}\n\nint RPCSerializationFlags()\n{\n    int flag = 0;\n    if (gArgs.GetArg(\"-rpcserialversion\", DEFAULT_RPC_SERIALIZE_VERSION) == 0)\n        flag |= SERIALIZE_TRANSACTION_NO_WITNESS;\n    return flag;\n}\n\nCRPCTable tableRPC;\n"
  },
  {
    "path": "src/rpc/server.h",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_RPCSERVER_H\n#define BITCOIN_RPCSERVER_H\n\n#include <amount.h>\n#include <rpc/protocol.h>\n#include <uint256.h>\n\n#include <list>\n#include <map>\n#include <stdint.h>\n#include <string>\n\n#include <univalue.h>\n\nstatic const unsigned int DEFAULT_RPC_SERIALIZE_VERSION = 1;\n\nclass CRPCCommand;\n\nnamespace RPCServer\n{\n    void OnStarted(std::function<void ()> slot);\n    void OnStopped(std::function<void ()> slot);\n}\n\n/** Wrapper for UniValue::VType, which includes typeAny:\n * Used to denote don't care type. Only used by RPCTypeCheckObj */\nstruct UniValueType {\n    explicit UniValueType(UniValue::VType _type) : typeAny(false), type(_type) {}\n    UniValueType() : typeAny(true) {}\n    bool typeAny;\n    UniValue::VType type;\n};\n\nclass JSONRPCRequest\n{\npublic:\n    UniValue id;\n    std::string strMethod;\n    UniValue params;\n    bool fHelp;\n    std::string URI;\n    std::string authUser;\n\n    JSONRPCRequest() : id(NullUniValue), params(NullUniValue), fHelp(false) {}\n    void parse(const UniValue& valRequest);\n};\n\n/** Query whether RPC is running */\nbool IsRPCRunning();\n\n/**\n * Set the RPC warmup status.  When this is done, all RPC calls will error out\n * immediately with RPC_IN_WARMUP.\n */\nvoid SetRPCWarmupStatus(const std::string& newStatus);\n/* Mark warmup as done.  RPC calls will be processed from now on.  */\nvoid SetRPCWarmupFinished();\n\n/* returns the current warmup state.  */\nbool RPCIsInWarmup(std::string *outStatus);\n\n/**\n * Type-check arguments; throws JSONRPCError if wrong type given. Does not check that\n * the right number of arguments are passed, just that any passed are the correct type.\n */\nvoid RPCTypeCheck(const UniValue& params,\n                  const std::list<UniValue::VType>& typesExpected, bool fAllowNull=false);\n\n/**\n * Type-check one argument; throws JSONRPCError if wrong type given.\n */\nvoid RPCTypeCheckArgument(const UniValue& value, UniValue::VType typeExpected);\n\n/*\n  Check for expected keys/value types in an Object.\n*/\nvoid RPCTypeCheckObj(const UniValue& o,\n    const std::map<std::string, UniValueType>& typesExpected,\n    bool fAllowNull = false,\n    bool fStrict = false);\n\n/** Opaque base class for timers returned by NewTimerFunc.\n * This provides no methods at the moment, but makes sure that delete\n * cleans up the whole state.\n */\nclass RPCTimerBase\n{\npublic:\n    virtual ~RPCTimerBase() {}\n};\n\n/**\n * RPC timer \"driver\".\n */\nclass RPCTimerInterface\n{\npublic:\n    virtual ~RPCTimerInterface() {}\n    /** Implementation name */\n    virtual const char *Name() = 0;\n    /** Factory function for timers.\n     * RPC will call the function to create a timer that will call func in *millis* milliseconds.\n     * @note As the RPC mechanism is backend-neutral, it can use different implementations of timers.\n     * This is needed to cope with the case in which there is no HTTP server, but\n     * only GUI RPC console, and to break the dependency of pcserver on httprpc.\n     */\n    virtual RPCTimerBase* NewTimer(std::function<void(void)>& func, int64_t millis) = 0;\n};\n\n/** Set the factory function for timers */\nvoid RPCSetTimerInterface(RPCTimerInterface *iface);\n/** Set the factory function for timer, but only, if unset */\nvoid RPCSetTimerInterfaceIfUnset(RPCTimerInterface *iface);\n/** Unset factory function for timers */\nvoid RPCUnsetTimerInterface(RPCTimerInterface *iface);\n\n/**\n * Run func nSeconds from now.\n * Overrides previous timer <name> (if any).\n */\nvoid RPCRunLater(const std::string& name, std::function<void(void)> func, int64_t nSeconds);\n\ntypedef UniValue(*rpcfn_type)(const JSONRPCRequest& jsonRequest);\n\nclass CRPCCommand\n{\npublic:\n    std::string category;\n    std::string name;\n    rpcfn_type actor;\n    std::vector<std::string> argNames;\n};\n\n/**\n * Bitcoin RPC command dispatcher.\n */\nclass CRPCTable\n{\nprivate:\n    std::map<std::string, const CRPCCommand*> mapCommands;\npublic:\n    CRPCTable();\n    const CRPCCommand* operator[](const std::string& name) const;\n    std::string help(const std::string& name, const JSONRPCRequest& helpreq) const;\n\n    /**\n     * Execute a method.\n     * @param request The JSONRPCRequest to execute\n     * @returns Result of the call.\n     * @throws an exception (UniValue) when an error happens.\n     */\n    UniValue execute(const JSONRPCRequest &request) const;\n\n    /**\n    * Returns a list of registered commands\n    * @returns List of registered commands.\n    */\n    std::vector<std::string> listCommands() const;\n\n\n    /**\n     * Appends a CRPCCommand to the dispatch table.\n     * Returns false if RPC server is already running (dump concurrency protection).\n     * Commands cannot be overwritten (returns false).\n     */\n    bool appendCommand(const std::string& name, const CRPCCommand* pcmd);\n};\n\nbool IsDeprecatedRPCEnabled(const std::string& method);\n\nextern CRPCTable tableRPC;\n\n/**\n * Utilities: convert hex-encoded Values\n * (throws error if not hex).\n */\nextern uint256 ParseHashV(const UniValue& v, std::string strName);\nextern uint256 ParseHashO(const UniValue& o, std::string strKey);\nextern std::vector<unsigned char> ParseHexV(const UniValue& v, std::string strName);\nextern std::vector<unsigned char> ParseHexO(const UniValue& o, std::string strKey);\n\nextern CAmount AmountFromValue(const UniValue& value);\nextern std::string HelpExampleCli(const std::string& methodname, const std::string& args);\nextern std::string HelpExampleRpc(const std::string& methodname, const std::string& args);\n\nbool StartRPC();\nvoid InterruptRPC();\nvoid StopRPC();\nstd::string JSONRPCExecBatch(const JSONRPCRequest& jreq, const UniValue& vReq);\n\n// Retrieves any serialization flags requested in command line argument\nint RPCSerializationFlags();\n\n#endif // BITCOIN_RPCSERVER_H\n"
  },
  {
    "path": "src/rpc/util.cpp",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <base58.h>\n#include <keystore.h>\n#include <pubkey.h>\n#include <rpc/protocol.h>\n#include <rpc/util.h>\n#include <tinyformat.h>\n#include <utilstrencodings.h>\n\n// Converts a hex string to a public key if possible\nCPubKey HexToPubKey(const std::string& hex_in)\n{\n    if (!IsHex(hex_in)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid public key: \" + hex_in);\n    }\n    CPubKey vchPubKey(ParseHex(hex_in));\n    if (!vchPubKey.IsFullyValid()) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid public key: \" + hex_in);\n    }\n    return vchPubKey;\n}\n\n// Retrieves a public key for an address from the given CKeyStore\nCPubKey AddrToPubKey(CKeyStore* const keystore, const std::string& addr_in)\n{\n    CTxDestination dest = DecodeDestination(addr_in);\n    if (!IsValidDestination(dest)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid address: \" + addr_in);\n    }\n    CKeyID key = GetKeyForDestination(*keystore, dest);\n    if (key.IsNull()) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf(\"%s does not refer to a key\", addr_in));\n    }\n    CPubKey vchPubKey;\n    if (!keystore->GetPubKey(key, vchPubKey)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf(\"no full public key for address %s\", addr_in));\n    }\n    if (!vchPubKey.IsFullyValid()) {\n       throw JSONRPCError(RPC_INTERNAL_ERROR, \"Wallet contains an invalid public key\");\n    }\n    return vchPubKey;\n}\n\n// Creates a multisig redeemscript from a given list of public keys and number required.\nCScript CreateMultisigRedeemscript(const int required, const std::vector<CPubKey>& pubkeys)\n{\n    // Gather public keys\n    if (required < 1) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"a multisignature address must require at least one key to redeem\");\n    }\n    if ((int)pubkeys.size() < required) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf(\"not enough keys supplied (got %u keys, but need at least %d to redeem)\", pubkeys.size(), required));\n    }\n    if (pubkeys.size() > 16) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Number of keys involved in the multisignature address creation > 16\\nReduce the number\");\n    }\n\n    CScript result = GetScriptForMultisig(required, pubkeys);\n\n    if (result.size() > MAX_SCRIPT_ELEMENT_SIZE) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, (strprintf(\"redeemScript exceeds size limit: %d > %d\", result.size(), MAX_SCRIPT_ELEMENT_SIZE)));\n    }\n\n    return result;\n}\n"
  },
  {
    "path": "src/rpc/util.h",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_RPC_UTIL_H\n#define BITCOIN_RPC_UTIL_H\n\n#include <string>\n#include <vector>\n\nclass CKeyStore;\nclass CPubKey;\nclass CScript;\n\nCPubKey HexToPubKey(const std::string& hex_in);\nCPubKey AddrToPubKey(CKeyStore* const keystore, const std::string& addr_in);\nCScript CreateMultisigRedeemscript(const int required, const std::vector<CPubKey>& pubkeys);\n\n#endif // BITCOIN_RPC_UTIL_H\n"
  },
  {
    "path": "src/scheduler.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <scheduler.h>\n\n#include <random.h>\n#include <reverselock.h>\n\n#include <assert.h>\n#include <boost/bind.hpp>\n#include <utility>\n\nCScheduler::CScheduler() : nThreadsServicingQueue(0), stopRequested(false), stopWhenEmpty(false)\n{\n}\n\nCScheduler::~CScheduler()\n{\n    assert(nThreadsServicingQueue == 0);\n}\n\n\n#if BOOST_VERSION < 105000\nstatic boost::system_time toPosixTime(const boost::chrono::system_clock::time_point& t)\n{\n    // Creating the posix_time using from_time_t loses sub-second precision. So rather than exporting the time_point to time_t,\n    // start with a posix_time at the epoch (0) and add the milliseconds that have passed since then.\n    return boost::posix_time::from_time_t(0) + boost::posix_time::milliseconds(boost::chrono::duration_cast<boost::chrono::milliseconds>(t.time_since_epoch()).count());\n}\n#endif\n\nvoid CScheduler::serviceQueue()\n{\n    boost::unique_lock<boost::mutex> lock(newTaskMutex);\n    ++nThreadsServicingQueue;\n\n    // newTaskMutex is locked throughout this loop EXCEPT\n    // when the thread is waiting or when the user's function\n    // is called.\n    while (!shouldStop()) {\n        try {\n            if (!shouldStop() && taskQueue.empty()) {\n                reverse_lock<boost::unique_lock<boost::mutex> > rlock(lock);\n                // Use this chance to get a tiny bit more entropy\n                RandAddSeedSleep();\n            }\n            while (!shouldStop() && taskQueue.empty()) {\n                // Wait until there is something to do.\n                newTaskScheduled.wait(lock);\n            }\n\n            // Wait until either there is a new task, or until\n            // the time of the first item on the queue:\n\n// wait_until needs boost 1.50 or later; older versions have timed_wait:\n#if BOOST_VERSION < 105000\n            while (!shouldStop() && !taskQueue.empty() &&\n                   newTaskScheduled.timed_wait(lock, toPosixTime(taskQueue.begin()->first))) {\n                // Keep waiting until timeout\n            }\n#else\n            // Some boost versions have a conflicting overload of wait_until that returns void.\n            // Explicitly use a template here to avoid hitting that overload.\n            while (!shouldStop() && !taskQueue.empty()) {\n                boost::chrono::system_clock::time_point timeToWaitFor = taskQueue.begin()->first;\n                if (newTaskScheduled.wait_until<>(lock, timeToWaitFor) == boost::cv_status::timeout)\n                    break; // Exit loop after timeout, it means we reached the time of the event\n            }\n#endif\n            // If there are multiple threads, the queue can empty while we're waiting (another\n            // thread may service the task we were waiting on).\n            if (shouldStop() || taskQueue.empty())\n                continue;\n\n            Function f = taskQueue.begin()->second;\n            taskQueue.erase(taskQueue.begin());\n\n            {\n                // Unlock before calling f, so it can reschedule itself or another task\n                // without deadlocking:\n                reverse_lock<boost::unique_lock<boost::mutex> > rlock(lock);\n                f();\n            }\n        } catch (...) {\n            --nThreadsServicingQueue;\n            throw;\n        }\n    }\n    --nThreadsServicingQueue;\n    newTaskScheduled.notify_one();\n}\n\nvoid CScheduler::stop(bool drain)\n{\n    {\n        boost::unique_lock<boost::mutex> lock(newTaskMutex);\n        if (drain)\n            stopWhenEmpty = true;\n        else\n            stopRequested = true;\n    }\n    newTaskScheduled.notify_all();\n}\n\nvoid CScheduler::schedule(CScheduler::Function f, boost::chrono::system_clock::time_point t)\n{\n    {\n        boost::unique_lock<boost::mutex> lock(newTaskMutex);\n        taskQueue.insert(std::make_pair(t, f));\n    }\n    newTaskScheduled.notify_one();\n}\n\nvoid CScheduler::scheduleFromNow(CScheduler::Function f, int64_t deltaMilliSeconds)\n{\n    schedule(f, boost::chrono::system_clock::now() + boost::chrono::milliseconds(deltaMilliSeconds));\n}\n\nstatic void Repeat(CScheduler* s, CScheduler::Function f, int64_t deltaMilliSeconds)\n{\n    f();\n    s->scheduleFromNow(boost::bind(&Repeat, s, f, deltaMilliSeconds), deltaMilliSeconds);\n}\n\nvoid CScheduler::scheduleEvery(CScheduler::Function f, int64_t deltaMilliSeconds)\n{\n    scheduleFromNow(boost::bind(&Repeat, this, f, deltaMilliSeconds), deltaMilliSeconds);\n}\n\nsize_t CScheduler::getQueueInfo(boost::chrono::system_clock::time_point &first,\n                             boost::chrono::system_clock::time_point &last) const\n{\n    boost::unique_lock<boost::mutex> lock(newTaskMutex);\n    size_t result = taskQueue.size();\n    if (!taskQueue.empty()) {\n        first = taskQueue.begin()->first;\n        last = taskQueue.rbegin()->first;\n    }\n    return result;\n}\n\nbool CScheduler::AreThreadsServicingQueue() const {\n    boost::unique_lock<boost::mutex> lock(newTaskMutex);\n    return nThreadsServicingQueue;\n}\n\n\nvoid SingleThreadedSchedulerClient::MaybeScheduleProcessQueue() {\n    {\n        LOCK(m_cs_callbacks_pending);\n        // Try to avoid scheduling too many copies here, but if we\n        // accidentally have two ProcessQueue's scheduled at once its\n        // not a big deal.\n        if (m_are_callbacks_running) return;\n        if (m_callbacks_pending.empty()) return;\n    }\n    m_pscheduler->schedule(std::bind(&SingleThreadedSchedulerClient::ProcessQueue, this));\n}\n\nvoid SingleThreadedSchedulerClient::ProcessQueue() {\n    std::function<void (void)> callback;\n    {\n        LOCK(m_cs_callbacks_pending);\n        if (m_are_callbacks_running) return;\n        if (m_callbacks_pending.empty()) return;\n        m_are_callbacks_running = true;\n\n        callback = std::move(m_callbacks_pending.front());\n        m_callbacks_pending.pop_front();\n    }\n\n    // RAII the setting of fCallbacksRunning and calling MaybeScheduleProcessQueue\n    // to ensure both happen safely even if callback() throws.\n    struct RAIICallbacksRunning {\n        SingleThreadedSchedulerClient* instance;\n        explicit RAIICallbacksRunning(SingleThreadedSchedulerClient* _instance) : instance(_instance) {}\n        ~RAIICallbacksRunning() {\n            {\n                LOCK(instance->m_cs_callbacks_pending);\n                instance->m_are_callbacks_running = false;\n            }\n            instance->MaybeScheduleProcessQueue();\n        }\n    } raiicallbacksrunning(this);\n\n    callback();\n}\n\nvoid SingleThreadedSchedulerClient::AddToProcessQueue(std::function<void (void)> func) {\n    assert(m_pscheduler);\n\n    {\n        LOCK(m_cs_callbacks_pending);\n        m_callbacks_pending.emplace_back(std::move(func));\n    }\n    MaybeScheduleProcessQueue();\n}\n\nvoid SingleThreadedSchedulerClient::EmptyQueue() {\n    assert(!m_pscheduler->AreThreadsServicingQueue());\n    bool should_continue = true;\n    while (should_continue) {\n        ProcessQueue();\n        LOCK(m_cs_callbacks_pending);\n        should_continue = !m_callbacks_pending.empty();\n    }\n}\n\nsize_t SingleThreadedSchedulerClient::CallbacksPending() {\n    LOCK(m_cs_callbacks_pending);\n    return m_callbacks_pending.size();\n}\n"
  },
  {
    "path": "src/scheduler.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SCHEDULER_H\n#define BITCOIN_SCHEDULER_H\n\n//\n// NOTE:\n// boost::thread / boost::chrono should be ported to std::thread / std::chrono\n// when we support C++11.\n//\n#include <boost/chrono/chrono.hpp>\n#include <boost/thread.hpp>\n#include <map>\n\n#include <sync.h>\n\n//\n// Simple class for background tasks that should be run\n// periodically or once \"after a while\"\n//\n// Usage:\n//\n// CScheduler* s = new CScheduler();\n// s->scheduleFromNow(doSomething, 11); // Assuming a: void doSomething() { }\n// s->scheduleFromNow(std::bind(Class::func, this, argument), 3);\n// boost::thread* t = new boost::thread(boost::bind(CScheduler::serviceQueue, s));\n//\n// ... then at program shutdown, clean up the thread running serviceQueue:\n// t->interrupt();\n// t->join();\n// delete t;\n// delete s; // Must be done after thread is interrupted/joined.\n//\n\nclass CScheduler\n{\npublic:\n    CScheduler();\n    ~CScheduler();\n\n    typedef std::function<void(void)> Function;\n\n    // Call func at/after time t\n    void schedule(Function f, boost::chrono::system_clock::time_point t=boost::chrono::system_clock::now());\n\n    // Convenience method: call f once deltaSeconds from now\n    void scheduleFromNow(Function f, int64_t deltaMilliSeconds);\n\n    // Another convenience method: call f approximately\n    // every deltaSeconds forever, starting deltaSeconds from now.\n    // To be more precise: every time f is finished, it\n    // is rescheduled to run deltaSeconds later. If you\n    // need more accurate scheduling, don't use this method.\n    void scheduleEvery(Function f, int64_t deltaMilliSeconds);\n\n    // To keep things as simple as possible, there is no unschedule.\n\n    // Services the queue 'forever'. Should be run in a thread,\n    // and interrupted using boost::interrupt_thread\n    void serviceQueue();\n\n    // Tell any threads running serviceQueue to stop as soon as they're\n    // done servicing whatever task they're currently servicing (drain=false)\n    // or when there is no work left to be done (drain=true)\n    void stop(bool drain=false);\n\n    // Returns number of tasks waiting to be serviced,\n    // and first and last task times\n    size_t getQueueInfo(boost::chrono::system_clock::time_point &first,\n                        boost::chrono::system_clock::time_point &last) const;\n\n    // Returns true if there are threads actively running in serviceQueue()\n    bool AreThreadsServicingQueue() const;\n\nprivate:\n    std::multimap<boost::chrono::system_clock::time_point, Function> taskQueue;\n    boost::condition_variable newTaskScheduled;\n    mutable boost::mutex newTaskMutex;\n    int nThreadsServicingQueue;\n    bool stopRequested;\n    bool stopWhenEmpty;\n    bool shouldStop() const { return stopRequested || (stopWhenEmpty && taskQueue.empty()); }\n};\n\n/**\n * Class used by CScheduler clients which may schedule multiple jobs\n * which are required to be run serially. Does not require such jobs\n * to be executed on the same thread, but no two jobs will be executed\n * at the same time.\n */\nclass SingleThreadedSchedulerClient {\nprivate:\n    CScheduler *m_pscheduler;\n\n    CCriticalSection m_cs_callbacks_pending;\n    std::list<std::function<void (void)>> m_callbacks_pending;\n    bool m_are_callbacks_running = false;\n\n    void MaybeScheduleProcessQueue();\n    void ProcessQueue();\n\npublic:\n    explicit SingleThreadedSchedulerClient(CScheduler *pschedulerIn) : m_pscheduler(pschedulerIn) {}\n    void AddToProcessQueue(std::function<void (void)> func);\n\n    // Processes all remaining queue members on the calling thread, blocking until queue is empty\n    // Must be called after the CScheduler has no remaining processing threads!\n    void EmptyQueue();\n\n    size_t CallbacksPending();\n};\n\n#endif\n"
  },
  {
    "path": "src/script/bitcoinconsensus.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <script/bitcoinconsensus.h>\n\n#include <primitives/transaction.h>\n#include <pubkey.h>\n#include <script/interpreter.h>\n#include <version.h>\n\nnamespace {\n\n/** A class that deserializes a single CTransaction one time. */\nclass TxInputStream\n{\npublic:\n    TxInputStream(int nTypeIn, int nVersionIn, const unsigned char *txTo, size_t txToLen) :\n    m_type(nTypeIn),\n    m_version(nVersionIn),\n    m_data(txTo),\n    m_remaining(txToLen)\n    {}\n\n    void read(char* pch, size_t nSize)\n    {\n        if (nSize > m_remaining)\n            throw std::ios_base::failure(std::string(__func__) + \": end of data\");\n\n        if (pch == nullptr)\n            throw std::ios_base::failure(std::string(__func__) + \": bad destination buffer\");\n\n        if (m_data == nullptr)\n            throw std::ios_base::failure(std::string(__func__) + \": bad source buffer\");\n\n        memcpy(pch, m_data, nSize);\n        m_remaining -= nSize;\n        m_data += nSize;\n    }\n\n    template<typename T>\n    TxInputStream& operator>>(T& obj)\n    {\n        ::Unserialize(*this, obj);\n        return *this;\n    }\n\n    int GetVersion() const { return m_version; }\n    int GetType() const { return m_type; }\nprivate:\n    const int m_type;\n    const int m_version;\n    const unsigned char* m_data;\n    size_t m_remaining;\n};\n\ninline int set_error(bitcoinconsensus_error* ret, bitcoinconsensus_error serror)\n{\n    if (ret)\n        *ret = serror;\n    return 0;\n}\n\nstruct ECCryptoClosure\n{\n    ECCVerifyHandle handle;\n};\n\nECCryptoClosure instance_of_eccryptoclosure;\n} // namespace\n\n/** Check that all specified flags are part of the libconsensus interface. */\nstatic bool verify_flags(unsigned int flags)\n{\n    return (flags & ~(bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL)) == 0;\n}\n\nstatic int verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, CAmount amount,\n                                    const unsigned char *txTo        , unsigned int txToLen,\n                                    unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err)\n{\n    if (!verify_flags(flags)) {\n        return set_error(err, bitcoinconsensus_ERR_INVALID_FLAGS);\n    }\n    try {\n        TxInputStream stream(SER_NETWORK, PROTOCOL_VERSION, txTo, txToLen);\n        CTransaction tx(deserialize, stream);\n        if (nIn >= tx.vin.size())\n            return set_error(err, bitcoinconsensus_ERR_TX_INDEX);\n        if (GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) != txToLen)\n            return set_error(err, bitcoinconsensus_ERR_TX_SIZE_MISMATCH);\n\n        // Regardless of the verification result, the tx did not error.\n        set_error(err, bitcoinconsensus_ERR_OK);\n\n        PrecomputedTransactionData txdata(tx);\n        return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), &tx.vin[nIn].scriptWitness, flags, TransactionSignatureChecker(&tx, nIn, amount, txdata), nullptr);\n    } catch (const std::exception&) {\n        return set_error(err, bitcoinconsensus_ERR_TX_DESERIALIZE); // Error deserializing\n    }\n}\n\nint bitcoinconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount,\n                                    const unsigned char *txTo        , unsigned int txToLen,\n                                    unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err)\n{\n    CAmount am(amount);\n    return ::verify_script(scriptPubKey, scriptPubKeyLen, am, txTo, txToLen, nIn, flags, err);\n}\n\n\nint bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen,\n                                   const unsigned char *txTo        , unsigned int txToLen,\n                                   unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err)\n{\n    if (flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS) {\n        return set_error(err, bitcoinconsensus_ERR_AMOUNT_REQUIRED);\n    }\n\n    CAmount am(0);\n    return ::verify_script(scriptPubKey, scriptPubKeyLen, am, txTo, txToLen, nIn, flags, err);\n}\n\nunsigned int bitcoinconsensus_version()\n{\n    // Just use the API version for now\n    return BITCOINCONSENSUS_API_VER;\n}\n"
  },
  {
    "path": "src/script/bitcoinconsensus.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_BITCOINCONSENSUS_H\n#define BITCOIN_BITCOINCONSENSUS_H\n\n#include <stdint.h>\n\n#if defined(BUILD_BITCOIN_INTERNAL) && defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n  #if defined(_WIN32)\n    #if defined(DLL_EXPORT)\n      #if defined(HAVE_FUNC_ATTRIBUTE_DLLEXPORT)\n        #define EXPORT_SYMBOL __declspec(dllexport)\n      #else\n        #define EXPORT_SYMBOL\n      #endif\n    #endif\n  #elif defined(HAVE_FUNC_ATTRIBUTE_VISIBILITY)\n    #define EXPORT_SYMBOL __attribute__ ((visibility (\"default\")))\n  #endif\n#elif defined(MSC_VER) && !defined(STATIC_LIBBITCOINCONSENSUS)\n  #define EXPORT_SYMBOL __declspec(dllimport)\n#endif\n\n#ifndef EXPORT_SYMBOL\n  #define EXPORT_SYMBOL\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define BITCOINCONSENSUS_API_VER 1\n\ntypedef enum bitcoinconsensus_error_t\n{\n    bitcoinconsensus_ERR_OK = 0,\n    bitcoinconsensus_ERR_TX_INDEX,\n    bitcoinconsensus_ERR_TX_SIZE_MISMATCH,\n    bitcoinconsensus_ERR_TX_DESERIALIZE,\n    bitcoinconsensus_ERR_AMOUNT_REQUIRED,\n    bitcoinconsensus_ERR_INVALID_FLAGS,\n} bitcoinconsensus_error;\n\n/** Script verification flags */\nenum\n{\n    bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NONE                = 0,\n    bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH                = (1U << 0), // evaluate P2SH (BIP16) subscripts\n    bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG              = (1U << 2), // enforce strict DER (BIP66) compliance\n    bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY           = (1U << 4), // enforce NULLDUMMY (BIP147)\n    bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9), // enable CHECKLOCKTIMEVERIFY (BIP65)\n    bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY = (1U << 10), // enable CHECKSEQUENCEVERIFY (BIP112)\n    bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS             = (1U << 11), // enable WITNESS (BIP141)\n    bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL                 = bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH | bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG |\n                                                               bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY | bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY |\n                                                               bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY | bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS\n};\n\n/// Returns 1 if the input nIn of the serialized transaction pointed to by\n/// txTo correctly spends the scriptPubKey pointed to by scriptPubKey under\n/// the additional constraints specified by flags.\n/// If not nullptr, err will contain an error/success code for the operation\nEXPORT_SYMBOL int bitcoinconsensus_verify_script(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen,\n                                                 const unsigned char *txTo        , unsigned int txToLen,\n                                                 unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err);\n\nEXPORT_SYMBOL int bitcoinconsensus_verify_script_with_amount(const unsigned char *scriptPubKey, unsigned int scriptPubKeyLen, int64_t amount,\n                                    const unsigned char *txTo        , unsigned int txToLen,\n                                    unsigned int nIn, unsigned int flags, bitcoinconsensus_error* err);\n\nEXPORT_SYMBOL unsigned int bitcoinconsensus_version();\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n#undef EXPORT_SYMBOL\n\n#endif // BITCOIN_BITCOINCONSENSUS_H\n"
  },
  {
    "path": "src/script/interpreter.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <script/interpreter.h>\n\n#include <crypto/ripemd160.h>\n#include <crypto/sha1.h>\n#include <crypto/sha256.h>\n#include <pubkey.h>\n#include <script/script.h>\n#include <uint256.h>\n\ntypedef std::vector<unsigned char> valtype;\n\nnamespace {\n\ninline bool set_success(ScriptError* ret)\n{\n    if (ret)\n        *ret = SCRIPT_ERR_OK;\n    return true;\n}\n\ninline bool set_error(ScriptError* ret, const ScriptError serror)\n{\n    if (ret)\n        *ret = serror;\n    return false;\n}\n\n} // namespace\n\nbool CastToBool(const valtype& vch)\n{\n    for (unsigned int i = 0; i < vch.size(); i++)\n    {\n        if (vch[i] != 0)\n        {\n            // Can be negative zero\n            if (i == vch.size()-1 && vch[i] == 0x80)\n                return false;\n            return true;\n        }\n    }\n    return false;\n}\n\n/**\n * Script is a stack machine (like Forth) that evaluates a predicate\n * returning a bool indicating valid or not.  There are no loops.\n */\n#define stacktop(i)  (stack.at(stack.size()+(i)))\n#define altstacktop(i)  (altstack.at(altstack.size()+(i)))\nstatic inline void popstack(std::vector<valtype>& stack)\n{\n    if (stack.empty())\n        throw std::runtime_error(\"popstack(): stack empty\");\n    stack.pop_back();\n}\n\nbool static IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) {\n    if (vchPubKey.size() < 33) {\n        //  Non-canonical public key: too short\n        return false;\n    }\n    if (vchPubKey[0] == 0x04) {\n        if (vchPubKey.size() != 65) {\n            //  Non-canonical public key: invalid length for uncompressed key\n            return false;\n        }\n    } else if (vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03) {\n        if (vchPubKey.size() != 33) {\n            //  Non-canonical public key: invalid length for compressed key\n            return false;\n        }\n    } else {\n        //  Non-canonical public key: neither compressed nor uncompressed\n        return false;\n    }\n    return true;\n}\n\nbool static IsCompressedPubKey(const valtype &vchPubKey) {\n    if (vchPubKey.size() != 33) {\n        //  Non-canonical public key: invalid length for compressed key\n        return false;\n    }\n    if (vchPubKey[0] != 0x02 && vchPubKey[0] != 0x03) {\n        //  Non-canonical public key: invalid prefix for compressed key\n        return false;\n    }\n    return true;\n}\n\n/**\n * A canonical signature exists of: <30> <total len> <02> <len R> <R> <02> <len S> <S> <hashtype>\n * Where R and S are not negative (their first byte has its highest bit not set), and not\n * excessively padded (do not start with a 0 byte, unless an otherwise negative number follows,\n * in which case a single 0 byte is necessary and even required).\n * \n * See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623\n *\n * This function is consensus-critical since BIP66.\n */\nbool static IsValidSignatureEncoding(const std::vector<unsigned char> &sig) {\n    // Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] [sighash]\n    // * total-length: 1-byte length descriptor of everything that follows,\n    //   excluding the sighash byte.\n    // * R-length: 1-byte length descriptor of the R value that follows.\n    // * R: arbitrary-length big-endian encoded R value. It must use the shortest\n    //   possible encoding for a positive integers (which means no null bytes at\n    //   the start, except a single one when the next byte has its highest bit set).\n    // * S-length: 1-byte length descriptor of the S value that follows.\n    // * S: arbitrary-length big-endian encoded S value. The same rules apply.\n    // * sighash: 1-byte value indicating what data is hashed (not part of the DER\n    //   signature)\n\n    // Minimum and maximum size constraints.\n    if (sig.size() < 9) return false;\n    if (sig.size() > 73) return false;\n\n    // A signature is of type 0x30 (compound).\n    if (sig[0] != 0x30) return false;\n\n    // Make sure the length covers the entire signature.\n    if (sig[1] != sig.size() - 3) return false;\n\n    // Extract the length of the R element.\n    unsigned int lenR = sig[3];\n\n    // Make sure the length of the S element is still inside the signature.\n    if (5 + lenR >= sig.size()) return false;\n\n    // Extract the length of the S element.\n    unsigned int lenS = sig[5 + lenR];\n\n    // Verify that the length of the signature matches the sum of the length\n    // of the elements.\n    if ((size_t)(lenR + lenS + 7) != sig.size()) return false;\n \n    // Check whether the R element is an integer.\n    if (sig[2] != 0x02) return false;\n\n    // Zero-length integers are not allowed for R.\n    if (lenR == 0) return false;\n\n    // Negative numbers are not allowed for R.\n    if (sig[4] & 0x80) return false;\n\n    // Null bytes at the start of R are not allowed, unless R would\n    // otherwise be interpreted as a negative number.\n    if (lenR > 1 && (sig[4] == 0x00) && !(sig[5] & 0x80)) return false;\n\n    // Check whether the S element is an integer.\n    if (sig[lenR + 4] != 0x02) return false;\n\n    // Zero-length integers are not allowed for S.\n    if (lenS == 0) return false;\n\n    // Negative numbers are not allowed for S.\n    if (sig[lenR + 6] & 0x80) return false;\n\n    // Null bytes at the start of S are not allowed, unless S would otherwise be\n    // interpreted as a negative number.\n    if (lenS > 1 && (sig[lenR + 6] == 0x00) && !(sig[lenR + 7] & 0x80)) return false;\n\n    return true;\n}\n\nbool static IsLowDERSignature(const valtype &vchSig, ScriptError* serror) {\n    if (!IsValidSignatureEncoding(vchSig)) {\n        return set_error(serror, SCRIPT_ERR_SIG_DER);\n    }\n    // https://bitcoin.stackexchange.com/a/12556:\n    //     Also note that inside transaction signatures, an extra hashtype byte\n    //     follows the actual signature data.\n    std::vector<unsigned char> vchSigCopy(vchSig.begin(), vchSig.begin() + vchSig.size() - 1);\n    // If the S value is above the order of the curve divided by two, its\n    // complement modulo the order could have been used instead, which is\n    // one byte shorter when encoded correctly.\n    if (!CPubKey::CheckLowS(vchSigCopy)) {\n        return set_error(serror, SCRIPT_ERR_SIG_HIGH_S);\n    }\n    return true;\n}\n\nbool static IsDefinedHashtypeSignature(const valtype &vchSig) {\n    if (vchSig.size() == 0) {\n        return false;\n    }\n    unsigned char nHashType = vchSig[vchSig.size() - 1] & (~(SIGHASH_ANYONECANPAY));\n    if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE)\n        return false;\n\n    return true;\n}\n\nbool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, unsigned int flags, ScriptError* serror) {\n    // Empty signature. Not strictly DER encoded, but allowed to provide a\n    // compact way to provide an invalid signature for use with CHECK(MULTI)SIG\n    if (vchSig.size() == 0) {\n        return true;\n    }\n    if ((flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC)) != 0 && !IsValidSignatureEncoding(vchSig)) {\n        return set_error(serror, SCRIPT_ERR_SIG_DER);\n    } else if ((flags & SCRIPT_VERIFY_LOW_S) != 0 && !IsLowDERSignature(vchSig, serror)) {\n        // serror is set\n        return false;\n    } else if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsDefinedHashtypeSignature(vchSig)) {\n        return set_error(serror, SCRIPT_ERR_SIG_HASHTYPE);\n    }\n    return true;\n}\n\nbool static CheckPubKeyEncoding(const valtype &vchPubKey, unsigned int flags, const SigVersion &sigversion, ScriptError* serror) {\n    if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsCompressedOrUncompressedPubKey(vchPubKey)) {\n        return set_error(serror, SCRIPT_ERR_PUBKEYTYPE);\n    }\n    // Only compressed keys are accepted in segwit\n    if ((flags & SCRIPT_VERIFY_WITNESS_PUBKEYTYPE) != 0 && sigversion == SIGVERSION_WITNESS_V0 && !IsCompressedPubKey(vchPubKey)) {\n        return set_error(serror, SCRIPT_ERR_WITNESS_PUBKEYTYPE);\n    }\n    return true;\n}\n\nbool static CheckMinimalPush(const valtype& data, opcodetype opcode) {\n    if (data.size() == 0) {\n        // Could have used OP_0.\n        return opcode == OP_0;\n    } else if (data.size() == 1 && data[0] >= 1 && data[0] <= 16) {\n        // Could have used OP_1 .. OP_16.\n        return opcode == OP_1 + (data[0] - 1);\n    } else if (data.size() == 1 && data[0] == 0x81) {\n        // Could have used OP_1NEGATE.\n        return opcode == OP_1NEGATE;\n    } else if (data.size() <= 75) {\n        // Could have used a direct push (opcode indicating number of bytes pushed + those bytes).\n        return opcode == data.size();\n    } else if (data.size() <= 255) {\n        // Could have used OP_PUSHDATA.\n        return opcode == OP_PUSHDATA1;\n    } else if (data.size() <= 65535) {\n        // Could have used OP_PUSHDATA2.\n        return opcode == OP_PUSHDATA2;\n    }\n    return true;\n}\n\nbool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, SigVersion sigversion, ScriptError* serror)\n{\n    static const CScriptNum bnZero(0);\n    static const CScriptNum bnOne(1);\n    // static const CScriptNum bnFalse(0);\n    // static const CScriptNum bnTrue(1);\n    static const valtype vchFalse(0);\n    // static const valtype vchZero(0);\n    static const valtype vchTrue(1, 1);\n\n    CScript::const_iterator pc = script.begin();\n    CScript::const_iterator pend = script.end();\n    CScript::const_iterator pbegincodehash = script.begin();\n    opcodetype opcode;\n    valtype vchPushValue;\n    std::vector<bool> vfExec;\n    std::vector<valtype> altstack;\n    set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR);\n    if (script.size() > MAX_SCRIPT_SIZE)\n        return set_error(serror, SCRIPT_ERR_SCRIPT_SIZE);\n    int nOpCount = 0;\n    bool fRequireMinimal = (flags & SCRIPT_VERIFY_MINIMALDATA) != 0;\n\n    try\n    {\n        while (pc < pend)\n        {\n            bool fExec = !count(vfExec.begin(), vfExec.end(), false);\n\n            //\n            // Read instruction\n            //\n            if (!script.GetOp(pc, opcode, vchPushValue))\n                return set_error(serror, SCRIPT_ERR_BAD_OPCODE);\n            if (vchPushValue.size() > MAX_SCRIPT_ELEMENT_SIZE)\n                return set_error(serror, SCRIPT_ERR_PUSH_SIZE);\n\n            // Note how OP_RESERVED does not count towards the opcode limit.\n            if (opcode > OP_16 && ++nOpCount > MAX_OPS_PER_SCRIPT)\n                return set_error(serror, SCRIPT_ERR_OP_COUNT);\n\n            if (opcode == OP_CAT ||\n                opcode == OP_SUBSTR ||\n                opcode == OP_LEFT ||\n                opcode == OP_RIGHT ||\n                opcode == OP_INVERT ||\n                opcode == OP_AND ||\n                opcode == OP_OR ||\n                opcode == OP_XOR ||\n                opcode == OP_2MUL ||\n                opcode == OP_2DIV ||\n                opcode == OP_MUL ||\n                opcode == OP_DIV ||\n                opcode == OP_MOD ||\n                opcode == OP_LSHIFT ||\n                opcode == OP_RSHIFT)\n                return set_error(serror, SCRIPT_ERR_DISABLED_OPCODE); // Disabled opcodes.\n\n            // With SCRIPT_VERIFY_CONST_SCRIPTCODE, OP_CODESEPARATOR in non-segwit script is rejected even in an unexecuted branch\n            if (opcode == OP_CODESEPARATOR && sigversion == SIGVERSION_BASE && (flags & SCRIPT_VERIFY_CONST_SCRIPTCODE))\n                return set_error(serror, SCRIPT_ERR_OP_CODESEPARATOR);\n\n            if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4) {\n                if (fRequireMinimal && !CheckMinimalPush(vchPushValue, opcode)) {\n                    return set_error(serror, SCRIPT_ERR_MINIMALDATA);\n                }\n                stack.push_back(vchPushValue);\n            } else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))\n            switch (opcode)\n            {\n                //\n                // Push value\n                //\n                case OP_1NEGATE:\n                case OP_1:\n                case OP_2:\n                case OP_3:\n                case OP_4:\n                case OP_5:\n                case OP_6:\n                case OP_7:\n                case OP_8:\n                case OP_9:\n                case OP_10:\n                case OP_11:\n                case OP_12:\n                case OP_13:\n                case OP_14:\n                case OP_15:\n                case OP_16:\n                {\n                    // ( -- value)\n                    CScriptNum bn((int)opcode - (int)(OP_1 - 1));\n                    stack.push_back(bn.getvch());\n                    // The result of these opcodes should always be the minimal way to push the data\n                    // they push, so no need for a CheckMinimalPush here.\n                }\n                break;\n\n\n                //\n                // Control\n                //\n                case OP_NOP:\n                    break;\n\n                case OP_CHECKLOCKTIMEVERIFY:\n                {\n                    if (!(flags & SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)) {\n                        // not enabled; treat as a NOP2\n                        break;\n                    }\n\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n\n                    // Note that elsewhere numeric opcodes are limited to\n                    // operands in the range -2**31+1 to 2**31-1, however it is\n                    // legal for opcodes to produce results exceeding that\n                    // range. This limitation is implemented by CScriptNum's\n                    // default 4-byte limit.\n                    //\n                    // If we kept to that limit we'd have a year 2038 problem,\n                    // even though the nLockTime field in transactions\n                    // themselves is uint32 which only becomes meaningless\n                    // after the year 2106.\n                    //\n                    // Thus as a special case we tell CScriptNum to accept up\n                    // to 5-byte bignums, which are good until 2**39-1, well\n                    // beyond the 2**32-1 limit of the nLockTime field itself.\n                    const CScriptNum nLockTime(stacktop(-1), fRequireMinimal, 5);\n\n                    // In the rare event that the argument may be < 0 due to\n                    // some arithmetic being done first, you can always use\n                    // 0 MAX CHECKLOCKTIMEVERIFY.\n                    if (nLockTime < 0)\n                        return set_error(serror, SCRIPT_ERR_NEGATIVE_LOCKTIME);\n\n                    // Actually compare the specified lock time with the transaction.\n                    if (!checker.CheckLockTime(nLockTime))\n                        return set_error(serror, SCRIPT_ERR_UNSATISFIED_LOCKTIME);\n\n                    break;\n                }\n\n                case OP_CHECKSEQUENCEVERIFY:\n                {\n                    if (!(flags & SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)) {\n                        // not enabled; treat as a NOP3\n                        break;\n                    }\n\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n\n                    // nSequence, like nLockTime, is a 32-bit unsigned integer\n                    // field. See the comment in CHECKLOCKTIMEVERIFY regarding\n                    // 5-byte numeric operands.\n                    const CScriptNum nSequence(stacktop(-1), fRequireMinimal, 5);\n\n                    // In the rare event that the argument may be < 0 due to\n                    // some arithmetic being done first, you can always use\n                    // 0 MAX CHECKSEQUENCEVERIFY.\n                    if (nSequence < 0)\n                        return set_error(serror, SCRIPT_ERR_NEGATIVE_LOCKTIME);\n\n                    // To provide for future soft-fork extensibility, if the\n                    // operand has the disabled lock-time flag set,\n                    // CHECKSEQUENCEVERIFY behaves as a NOP.\n                    if ((nSequence & CTxIn::SEQUENCE_LOCKTIME_DISABLE_FLAG) != 0)\n                        break;\n\n                    // Compare the specified sequence number with the input.\n                    if (!checker.CheckSequence(nSequence))\n                        return set_error(serror, SCRIPT_ERR_UNSATISFIED_LOCKTIME);\n\n                    break;\n                }\n\n                case OP_NOP1: case OP_NOP4: case OP_NOP5:\n                case OP_NOP6: case OP_NOP7: case OP_NOP8: case OP_NOP9: case OP_NOP10:\n                {\n                    if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)\n                        return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS);\n                }\n                break;\n\n                case OP_IF:\n                case OP_NOTIF:\n                {\n                    // <expression> if [statements] [else [statements]] endif\n                    bool fValue = false;\n                    if (fExec)\n                    {\n                        if (stack.size() < 1)\n                            return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL);\n                        valtype& vch = stacktop(-1);\n                        if (sigversion == SIGVERSION_WITNESS_V0 && (flags & SCRIPT_VERIFY_MINIMALIF)) {\n                            if (vch.size() > 1)\n                                return set_error(serror, SCRIPT_ERR_MINIMALIF);\n                            if (vch.size() == 1 && vch[0] != 1)\n                                return set_error(serror, SCRIPT_ERR_MINIMALIF);\n                        }\n                        fValue = CastToBool(vch);\n                        if (opcode == OP_NOTIF)\n                            fValue = !fValue;\n                        popstack(stack);\n                    }\n                    vfExec.push_back(fValue);\n                }\n                break;\n\n                case OP_ELSE:\n                {\n                    if (vfExec.empty())\n                        return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL);\n                    vfExec.back() = !vfExec.back();\n                }\n                break;\n\n                case OP_ENDIF:\n                {\n                    if (vfExec.empty())\n                        return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL);\n                    vfExec.pop_back();\n                }\n                break;\n\n                case OP_VERIFY:\n                {\n                    // (true -- ) or\n                    // (false -- false) and return\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    bool fValue = CastToBool(stacktop(-1));\n                    if (fValue)\n                        popstack(stack);\n                    else\n                        return set_error(serror, SCRIPT_ERR_VERIFY);\n                }\n                break;\n\n                case OP_RETURN:\n                {\n                    return set_error(serror, SCRIPT_ERR_OP_RETURN);\n                }\n                break;\n\n\n                //\n                // Stack ops\n                //\n                case OP_TOALTSTACK:\n                {\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    altstack.push_back(stacktop(-1));\n                    popstack(stack);\n                }\n                break;\n\n                case OP_FROMALTSTACK:\n                {\n                    if (altstack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_ALTSTACK_OPERATION);\n                    stack.push_back(altstacktop(-1));\n                    popstack(altstack);\n                }\n                break;\n\n                case OP_2DROP:\n                {\n                    // (x1 x2 -- )\n                    if (stack.size() < 2)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    popstack(stack);\n                    popstack(stack);\n                }\n                break;\n\n                case OP_2DUP:\n                {\n                    // (x1 x2 -- x1 x2 x1 x2)\n                    if (stack.size() < 2)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype vch1 = stacktop(-2);\n                    valtype vch2 = stacktop(-1);\n                    stack.push_back(vch1);\n                    stack.push_back(vch2);\n                }\n                break;\n\n                case OP_3DUP:\n                {\n                    // (x1 x2 x3 -- x1 x2 x3 x1 x2 x3)\n                    if (stack.size() < 3)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype vch1 = stacktop(-3);\n                    valtype vch2 = stacktop(-2);\n                    valtype vch3 = stacktop(-1);\n                    stack.push_back(vch1);\n                    stack.push_back(vch2);\n                    stack.push_back(vch3);\n                }\n                break;\n\n                case OP_2OVER:\n                {\n                    // (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2)\n                    if (stack.size() < 4)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype vch1 = stacktop(-4);\n                    valtype vch2 = stacktop(-3);\n                    stack.push_back(vch1);\n                    stack.push_back(vch2);\n                }\n                break;\n\n                case OP_2ROT:\n                {\n                    // (x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2)\n                    if (stack.size() < 6)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype vch1 = stacktop(-6);\n                    valtype vch2 = stacktop(-5);\n                    stack.erase(stack.end()-6, stack.end()-4);\n                    stack.push_back(vch1);\n                    stack.push_back(vch2);\n                }\n                break;\n\n                case OP_2SWAP:\n                {\n                    // (x1 x2 x3 x4 -- x3 x4 x1 x2)\n                    if (stack.size() < 4)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    swap(stacktop(-4), stacktop(-2));\n                    swap(stacktop(-3), stacktop(-1));\n                }\n                break;\n\n                case OP_IFDUP:\n                {\n                    // (x - 0 | x x)\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype vch = stacktop(-1);\n                    if (CastToBool(vch))\n                        stack.push_back(vch);\n                }\n                break;\n\n                case OP_DEPTH:\n                {\n                    // -- stacksize\n                    CScriptNum bn(stack.size());\n                    stack.push_back(bn.getvch());\n                }\n                break;\n\n                case OP_DROP:\n                {\n                    // (x -- )\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    popstack(stack);\n                }\n                break;\n\n                case OP_DUP:\n                {\n                    // (x -- x x)\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype vch = stacktop(-1);\n                    stack.push_back(vch);\n                }\n                break;\n\n                case OP_NIP:\n                {\n                    // (x1 x2 -- x2)\n                    if (stack.size() < 2)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    stack.erase(stack.end() - 2);\n                }\n                break;\n\n                case OP_OVER:\n                {\n                    // (x1 x2 -- x1 x2 x1)\n                    if (stack.size() < 2)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype vch = stacktop(-2);\n                    stack.push_back(vch);\n                }\n                break;\n\n                case OP_PICK:\n                case OP_ROLL:\n                {\n                    // (xn ... x2 x1 x0 n - xn ... x2 x1 x0 xn)\n                    // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn)\n                    if (stack.size() < 2)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    int n = CScriptNum(stacktop(-1), fRequireMinimal).getint();\n                    popstack(stack);\n                    if (n < 0 || n >= (int)stack.size())\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype vch = stacktop(-n-1);\n                    if (opcode == OP_ROLL)\n                        stack.erase(stack.end()-n-1);\n                    stack.push_back(vch);\n                }\n                break;\n\n                case OP_ROT:\n                {\n                    // (x1 x2 x3 -- x2 x3 x1)\n                    //  x2 x1 x3  after first swap\n                    //  x2 x3 x1  after second swap\n                    if (stack.size() < 3)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    swap(stacktop(-3), stacktop(-2));\n                    swap(stacktop(-2), stacktop(-1));\n                }\n                break;\n\n                case OP_SWAP:\n                {\n                    // (x1 x2 -- x2 x1)\n                    if (stack.size() < 2)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    swap(stacktop(-2), stacktop(-1));\n                }\n                break;\n\n                case OP_TUCK:\n                {\n                    // (x1 x2 -- x2 x1 x2)\n                    if (stack.size() < 2)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype vch = stacktop(-1);\n                    stack.insert(stack.end()-2, vch);\n                }\n                break;\n\n\n                case OP_SIZE:\n                {\n                    // (in -- in size)\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    CScriptNum bn(stacktop(-1).size());\n                    stack.push_back(bn.getvch());\n                }\n                break;\n\n\n                //\n                // Bitwise logic\n                //\n                case OP_EQUAL:\n                case OP_EQUALVERIFY:\n                //case OP_NOTEQUAL: // use OP_NUMNOTEQUAL\n                {\n                    // (x1 x2 - bool)\n                    if (stack.size() < 2)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype& vch1 = stacktop(-2);\n                    valtype& vch2 = stacktop(-1);\n                    bool fEqual = (vch1 == vch2);\n                    // OP_NOTEQUAL is disabled because it would be too easy to say\n                    // something like n != 1 and have some wiseguy pass in 1 with extra\n                    // zero bytes after it (numerically, 0x01 == 0x0001 == 0x000001)\n                    //if (opcode == OP_NOTEQUAL)\n                    //    fEqual = !fEqual;\n                    popstack(stack);\n                    popstack(stack);\n                    stack.push_back(fEqual ? vchTrue : vchFalse);\n                    if (opcode == OP_EQUALVERIFY)\n                    {\n                        if (fEqual)\n                            popstack(stack);\n                        else\n                            return set_error(serror, SCRIPT_ERR_EQUALVERIFY);\n                    }\n                }\n                break;\n\n\n                //\n                // Numeric\n                //\n                case OP_1ADD:\n                case OP_1SUB:\n                case OP_NEGATE:\n                case OP_ABS:\n                case OP_NOT:\n                case OP_0NOTEQUAL:\n                {\n                    // (in -- out)\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    CScriptNum bn(stacktop(-1), fRequireMinimal);\n                    switch (opcode)\n                    {\n                    case OP_1ADD:       bn += bnOne; break;\n                    case OP_1SUB:       bn -= bnOne; break;\n                    case OP_NEGATE:     bn = -bn; break;\n                    case OP_ABS:        if (bn < bnZero) bn = -bn; break;\n                    case OP_NOT:        bn = (bn == bnZero); break;\n                    case OP_0NOTEQUAL:  bn = (bn != bnZero); break;\n                    default:            assert(!\"invalid opcode\"); break;\n                    }\n                    popstack(stack);\n                    stack.push_back(bn.getvch());\n                }\n                break;\n\n                case OP_ADD:\n                case OP_SUB:\n                case OP_BOOLAND:\n                case OP_BOOLOR:\n                case OP_NUMEQUAL:\n                case OP_NUMEQUALVERIFY:\n                case OP_NUMNOTEQUAL:\n                case OP_LESSTHAN:\n                case OP_GREATERTHAN:\n                case OP_LESSTHANOREQUAL:\n                case OP_GREATERTHANOREQUAL:\n                case OP_MIN:\n                case OP_MAX:\n                {\n                    // (x1 x2 -- out)\n                    if (stack.size() < 2)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    CScriptNum bn1(stacktop(-2), fRequireMinimal);\n                    CScriptNum bn2(stacktop(-1), fRequireMinimal);\n                    CScriptNum bn(0);\n                    switch (opcode)\n                    {\n                    case OP_ADD:\n                        bn = bn1 + bn2;\n                        break;\n\n                    case OP_SUB:\n                        bn = bn1 - bn2;\n                        break;\n\n                    case OP_BOOLAND:             bn = (bn1 != bnZero && bn2 != bnZero); break;\n                    case OP_BOOLOR:              bn = (bn1 != bnZero || bn2 != bnZero); break;\n                    case OP_NUMEQUAL:            bn = (bn1 == bn2); break;\n                    case OP_NUMEQUALVERIFY:      bn = (bn1 == bn2); break;\n                    case OP_NUMNOTEQUAL:         bn = (bn1 != bn2); break;\n                    case OP_LESSTHAN:            bn = (bn1 < bn2); break;\n                    case OP_GREATERTHAN:         bn = (bn1 > bn2); break;\n                    case OP_LESSTHANOREQUAL:     bn = (bn1 <= bn2); break;\n                    case OP_GREATERTHANOREQUAL:  bn = (bn1 >= bn2); break;\n                    case OP_MIN:                 bn = (bn1 < bn2 ? bn1 : bn2); break;\n                    case OP_MAX:                 bn = (bn1 > bn2 ? bn1 : bn2); break;\n                    default:                     assert(!\"invalid opcode\"); break;\n                    }\n                    popstack(stack);\n                    popstack(stack);\n                    stack.push_back(bn.getvch());\n\n                    if (opcode == OP_NUMEQUALVERIFY)\n                    {\n                        if (CastToBool(stacktop(-1)))\n                            popstack(stack);\n                        else\n                            return set_error(serror, SCRIPT_ERR_NUMEQUALVERIFY);\n                    }\n                }\n                break;\n\n                case OP_WITHIN:\n                {\n                    // (x min max -- out)\n                    if (stack.size() < 3)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    CScriptNum bn1(stacktop(-3), fRequireMinimal);\n                    CScriptNum bn2(stacktop(-2), fRequireMinimal);\n                    CScriptNum bn3(stacktop(-1), fRequireMinimal);\n                    bool fValue = (bn2 <= bn1 && bn1 < bn3);\n                    popstack(stack);\n                    popstack(stack);\n                    popstack(stack);\n                    stack.push_back(fValue ? vchTrue : vchFalse);\n                }\n                break;\n\n\n                //\n                // Crypto\n                //\n                case OP_RIPEMD160:\n                case OP_SHA1:\n                case OP_SHA256:\n                case OP_HASH160:\n                case OP_HASH256:\n                {\n                    // (in -- hash)\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    valtype& vch = stacktop(-1);\n                    valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32);\n                    if (opcode == OP_RIPEMD160)\n                        CRIPEMD160().Write(vch.data(), vch.size()).Finalize(vchHash.data());\n                    else if (opcode == OP_SHA1)\n                        CSHA1().Write(vch.data(), vch.size()).Finalize(vchHash.data());\n                    else if (opcode == OP_SHA256)\n                        CSHA256().Write(vch.data(), vch.size()).Finalize(vchHash.data());\n                    else if (opcode == OP_HASH160)\n                        CHash160().Write(vch.data(), vch.size()).Finalize(vchHash.data());\n                    else if (opcode == OP_HASH256)\n                        CHash256().Write(vch.data(), vch.size()).Finalize(vchHash.data());\n                    popstack(stack);\n                    stack.push_back(vchHash);\n                }\n                break;                                   \n\n                case OP_CODESEPARATOR:\n                {\n                    // If SCRIPT_VERIFY_CONST_SCRIPTCODE flag is set, use of OP_CODESEPARATOR is rejected in pre-segwit\n                    // script, even in an unexecuted branch (this is checked above the opcode case statement).\n\n                    // Hash starts after the code separator\n                    pbegincodehash = pc;\n                }\n                break;\n\n                case OP_CHECKSIG:\n                case OP_CHECKSIGVERIFY:\n                {\n                    // (sig pubkey -- bool)\n                    if (stack.size() < 2)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n\n                    valtype& vchSig    = stacktop(-2);\n                    valtype& vchPubKey = stacktop(-1);\n\n                    // Subset of script starting at the most recent codeseparator\n                    CScript scriptCode(pbegincodehash, pend);\n\n                    // Drop the signature in pre-segwit scripts but not segwit scripts\n                    if (sigversion == SIGVERSION_BASE) {\n                        int found = scriptCode.FindAndDelete(CScript(vchSig));\n                        if (found > 0 && (flags & SCRIPT_VERIFY_CONST_SCRIPTCODE))\n                            return set_error(serror, SCRIPT_ERR_SIG_FINDANDDELETE);\n                    }\n\n                    if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, sigversion, serror)) {\n                        //serror is set\n                        return false;\n                    }\n                    bool fSuccess = checker.CheckSig(vchSig, vchPubKey, scriptCode, sigversion);\n\n                    if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL) && vchSig.size())\n                        return set_error(serror, SCRIPT_ERR_SIG_NULLFAIL);\n\n                    popstack(stack);\n                    popstack(stack);\n                    stack.push_back(fSuccess ? vchTrue : vchFalse);\n                    if (opcode == OP_CHECKSIGVERIFY)\n                    {\n                        if (fSuccess)\n                            popstack(stack);\n                        else\n                            return set_error(serror, SCRIPT_ERR_CHECKSIGVERIFY);\n                    }\n                }\n                break;\n\n                case OP_CHECKMULTISIG:\n                case OP_CHECKMULTISIGVERIFY:\n                {\n                    // ([sig ...] num_of_signatures [pubkey ...] num_of_pubkeys -- bool)\n\n                    int i = 1;\n                    if ((int)stack.size() < i)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n\n                    int nKeysCount = CScriptNum(stacktop(-i), fRequireMinimal).getint();\n                    if (nKeysCount < 0 || nKeysCount > MAX_PUBKEYS_PER_MULTISIG)\n                        return set_error(serror, SCRIPT_ERR_PUBKEY_COUNT);\n                    nOpCount += nKeysCount;\n                    if (nOpCount > MAX_OPS_PER_SCRIPT)\n                        return set_error(serror, SCRIPT_ERR_OP_COUNT);\n                    int ikey = ++i;\n                    // ikey2 is the position of last non-signature item in the stack. Top stack item = 1.\n                    // With SCRIPT_VERIFY_NULLFAIL, this is used for cleanup if operation fails.\n                    int ikey2 = nKeysCount + 2;\n                    i += nKeysCount;\n                    if ((int)stack.size() < i)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n\n                    int nSigsCount = CScriptNum(stacktop(-i), fRequireMinimal).getint();\n                    if (nSigsCount < 0 || nSigsCount > nKeysCount)\n                        return set_error(serror, SCRIPT_ERR_SIG_COUNT);\n                    int isig = ++i;\n                    i += nSigsCount;\n                    if ((int)stack.size() < i)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n\n                    // Subset of script starting at the most recent codeseparator\n                    CScript scriptCode(pbegincodehash, pend);\n\n                    // Drop the signature in pre-segwit scripts but not segwit scripts\n                    for (int k = 0; k < nSigsCount; k++)\n                    {\n                        valtype& vchSig = stacktop(-isig-k);\n                        if (sigversion == SIGVERSION_BASE) {\n                            int found = scriptCode.FindAndDelete(CScript(vchSig));\n                            if (found > 0 && (flags & SCRIPT_VERIFY_CONST_SCRIPTCODE))\n                                return set_error(serror, SCRIPT_ERR_SIG_FINDANDDELETE);\n                        }\n                    }\n\n                    bool fSuccess = true;\n                    while (fSuccess && nSigsCount > 0)\n                    {\n                        valtype& vchSig    = stacktop(-isig);\n                        valtype& vchPubKey = stacktop(-ikey);\n\n                        // Note how this makes the exact order of pubkey/signature evaluation\n                        // distinguishable by CHECKMULTISIG NOT if the STRICTENC flag is set.\n                        // See the script_(in)valid tests for details.\n                        if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, sigversion, serror)) {\n                            // serror is set\n                            return false;\n                        }\n\n                        // Check signature\n                        bool fOk = checker.CheckSig(vchSig, vchPubKey, scriptCode, sigversion);\n\n                        if (fOk) {\n                            isig++;\n                            nSigsCount--;\n                        }\n                        ikey++;\n                        nKeysCount--;\n\n                        // If there are more signatures left than keys left,\n                        // then too many signatures have failed. Exit early,\n                        // without checking any further signatures.\n                        if (nSigsCount > nKeysCount)\n                            fSuccess = false;\n                    }\n\n                    // Clean up stack of actual arguments\n                    while (i-- > 1) {\n                        // If the operation failed, we require that all signatures must be empty vector\n                        if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL) && !ikey2 && stacktop(-1).size())\n                            return set_error(serror, SCRIPT_ERR_SIG_NULLFAIL);\n                        if (ikey2 > 0)\n                            ikey2--;\n                        popstack(stack);\n                    }\n\n                    // A bug causes CHECKMULTISIG to consume one extra argument\n                    // whose contents were not checked in any way.\n                    //\n                    // Unfortunately this is a potential source of mutability,\n                    // so optionally verify it is exactly equal to zero prior\n                    // to removing it from the stack.\n                    if (stack.size() < 1)\n                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);\n                    if ((flags & SCRIPT_VERIFY_NULLDUMMY) && stacktop(-1).size())\n                        return set_error(serror, SCRIPT_ERR_SIG_NULLDUMMY);\n                    popstack(stack);\n\n                    stack.push_back(fSuccess ? vchTrue : vchFalse);\n\n                    if (opcode == OP_CHECKMULTISIGVERIFY)\n                    {\n                        if (fSuccess)\n                            popstack(stack);\n                        else\n                            return set_error(serror, SCRIPT_ERR_CHECKMULTISIGVERIFY);\n                    }\n                }\n                break;\n\n                default:\n                    return set_error(serror, SCRIPT_ERR_BAD_OPCODE);\n            }\n\n            // Size limits\n            if (stack.size() + altstack.size() > MAX_STACK_SIZE)\n                return set_error(serror, SCRIPT_ERR_STACK_SIZE);\n        }\n    }\n    catch (...)\n    {\n        return set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR);\n    }\n\n    if (!vfExec.empty())\n        return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL);\n\n    return set_success(serror);\n}\n\nnamespace {\n\n/**\n * Wrapper that serializes like CTransaction, but with the modifications\n *  required for the signature hash done in-place\n */\nclass CTransactionSignatureSerializer {\nprivate:\n    const CTransaction& txTo;  //!< reference to the spending transaction (the one being serialized)\n    const CScript& scriptCode; //!< output script being consumed\n    const unsigned int nIn;    //!< input index of txTo being signed\n    const bool fAnyoneCanPay;  //!< whether the hashtype has the SIGHASH_ANYONECANPAY flag set\n    const bool fHashSingle;    //!< whether the hashtype is SIGHASH_SINGLE\n    const bool fHashNone;      //!< whether the hashtype is SIGHASH_NONE\n\npublic:\n    CTransactionSignatureSerializer(const CTransaction &txToIn, const CScript &scriptCodeIn, unsigned int nInIn, int nHashTypeIn) :\n        txTo(txToIn), scriptCode(scriptCodeIn), nIn(nInIn),\n        fAnyoneCanPay(!!(nHashTypeIn & SIGHASH_ANYONECANPAY)),\n        fHashSingle((nHashTypeIn & 0x1f) == SIGHASH_SINGLE),\n        fHashNone((nHashTypeIn & 0x1f) == SIGHASH_NONE) {}\n\n    /** Serialize the passed scriptCode, skipping OP_CODESEPARATORs */\n    template<typename S>\n    void SerializeScriptCode(S &s) const {\n        CScript::const_iterator it = scriptCode.begin();\n        CScript::const_iterator itBegin = it;\n        opcodetype opcode;\n        unsigned int nCodeSeparators = 0;\n        while (scriptCode.GetOp(it, opcode)) {\n            if (opcode == OP_CODESEPARATOR)\n                nCodeSeparators++;\n        }\n        ::WriteCompactSize(s, scriptCode.size() - nCodeSeparators);\n        it = itBegin;\n        while (scriptCode.GetOp(it, opcode)) {\n            if (opcode == OP_CODESEPARATOR) {\n                s.write((char*)&itBegin[0], it-itBegin-1);\n                itBegin = it;\n            }\n        }\n        if (itBegin != scriptCode.end())\n            s.write((char*)&itBegin[0], it-itBegin);\n    }\n\n    /** Serialize an input of txTo */\n    template<typename S>\n    void SerializeInput(S &s, unsigned int nInput) const {\n        // In case of SIGHASH_ANYONECANPAY, only the input being signed is serialized\n        if (fAnyoneCanPay)\n            nInput = nIn;\n        // Serialize the prevout\n        ::Serialize(s, txTo.vin[nInput].prevout);\n        // Serialize the script\n        if (nInput != nIn)\n            // Blank out other inputs' signatures\n            ::Serialize(s, CScript());\n        else\n            SerializeScriptCode(s);\n        // Serialize the nSequence\n        if (nInput != nIn && (fHashSingle || fHashNone))\n            // let the others update at will\n            ::Serialize(s, (int)0);\n        else\n            ::Serialize(s, txTo.vin[nInput].nSequence);\n    }\n\n    /** Serialize an output of txTo */\n    template<typename S>\n    void SerializeOutput(S &s, unsigned int nOutput) const {\n        if (fHashSingle && nOutput != nIn)\n            // Do not lock-in the txout payee at other indices as txin\n            ::Serialize(s, CTxOut());\n        else\n            ::Serialize(s, txTo.vout[nOutput]);\n    }\n\n    /** Serialize txTo */\n    template<typename S>\n    void Serialize(S &s) const {\n        // Serialize nVersion\n        ::Serialize(s, txTo.nVersion);\n        // Serialize vin\n        unsigned int nInputs = fAnyoneCanPay ? 1 : txTo.vin.size();\n        ::WriteCompactSize(s, nInputs);\n        for (unsigned int nInput = 0; nInput < nInputs; nInput++)\n             SerializeInput(s, nInput);\n        // Serialize vout\n        unsigned int nOutputs = fHashNone ? 0 : (fHashSingle ? nIn+1 : txTo.vout.size());\n        ::WriteCompactSize(s, nOutputs);\n        for (unsigned int nOutput = 0; nOutput < nOutputs; nOutput++)\n             SerializeOutput(s, nOutput);\n        // Serialize nLockTime\n        ::Serialize(s, txTo.nLockTime);\n    }\n};\n\nuint256 GetPrevoutHash(const CTransaction& txTo) {\n    CHashWriter ss(SER_GETHASH, 0);\n    for (const auto& txin : txTo.vin) {\n        ss << txin.prevout;\n    }\n    return ss.GetHash();\n}\n\nuint256 GetSequenceHash(const CTransaction& txTo) {\n    CHashWriter ss(SER_GETHASH, 0);\n    for (const auto& txin : txTo.vin) {\n        ss << txin.nSequence;\n    }\n    return ss.GetHash();\n}\n\nuint256 GetOutputsHash(const CTransaction& txTo) {\n    CHashWriter ss(SER_GETHASH, 0);\n    for (const auto& txout : txTo.vout) {\n        ss << txout;\n    }\n    return ss.GetHash();\n}\n\n} // namespace\n\nPrecomputedTransactionData::PrecomputedTransactionData(const CTransaction& txTo)\n{\n    // Cache is calculated only for transactions with witness\n    if (txTo.HasWitness()) {\n        hashPrevouts = GetPrevoutHash(txTo);\n        hashSequence = GetSequenceHash(txTo);\n        hashOutputs = GetOutputsHash(txTo);\n        ready = true;\n    }\n}\n\nuint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, const CAmount& amount, SigVersion sigversion, const PrecomputedTransactionData* cache)\n{\n    assert(nIn < txTo.vin.size());\n\n    if (sigversion == SIGVERSION_WITNESS_V0) {\n        uint256 hashPrevouts;\n        uint256 hashSequence;\n        uint256 hashOutputs;\n        const bool cacheready = cache && cache->ready;\n\n        if (!(nHashType & SIGHASH_ANYONECANPAY)) {\n            hashPrevouts = cacheready ? cache->hashPrevouts : GetPrevoutHash(txTo);\n        }\n\n        if (!(nHashType & SIGHASH_ANYONECANPAY) && (nHashType & 0x1f) != SIGHASH_SINGLE && (nHashType & 0x1f) != SIGHASH_NONE) {\n            hashSequence = cacheready ? cache->hashSequence : GetSequenceHash(txTo);\n        }\n\n\n        if ((nHashType & 0x1f) != SIGHASH_SINGLE && (nHashType & 0x1f) != SIGHASH_NONE) {\n            hashOutputs = cacheready ? cache->hashOutputs : GetOutputsHash(txTo);\n        } else if ((nHashType & 0x1f) == SIGHASH_SINGLE && nIn < txTo.vout.size()) {\n            CHashWriter ss(SER_GETHASH, 0);\n            ss << txTo.vout[nIn];\n            hashOutputs = ss.GetHash();\n        }\n\n        CHashWriter ss(SER_GETHASH, 0);\n        // Version\n        ss << txTo.nVersion;\n        // Input prevouts/nSequence (none/all, depending on flags)\n        ss << hashPrevouts;\n        ss << hashSequence;\n        // The input being signed (replacing the scriptSig with scriptCode + amount)\n        // The prevout may already be contained in hashPrevout, and the nSequence\n        // may already be contain in hashSequence.\n        ss << txTo.vin[nIn].prevout;\n        ss << scriptCode;\n        ss << amount;\n        ss << txTo.vin[nIn].nSequence;\n        // Outputs (none/one/all, depending on flags)\n        ss << hashOutputs;\n        // Locktime\n        ss << txTo.nLockTime;\n        // Sighash type\n        ss << nHashType;\n\n        return ss.GetHash();\n    }\n\n    static const uint256 one(uint256S(\"0000000000000000000000000000000000000000000000000000000000000001\"));\n\n    // Check for invalid use of SIGHASH_SINGLE\n    if ((nHashType & 0x1f) == SIGHASH_SINGLE) {\n        if (nIn >= txTo.vout.size()) {\n            //  nOut out of range\n            return one;\n        }\n    }\n\n    // Wrapper to serialize only the necessary parts of the transaction being signed\n    CTransactionSignatureSerializer txTmp(txTo, scriptCode, nIn, nHashType);\n\n    // Serialize and hash\n    CHashWriter ss(SER_GETHASH, 0);\n    ss << txTmp << nHashType;\n    return ss.GetHash();\n}\n\nbool TransactionSignatureChecker::VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& pubkey, const uint256& sighash) const\n{\n    return pubkey.Verify(sighash, vchSig);\n}\n\nbool TransactionSignatureChecker::CheckSig(const std::vector<unsigned char>& vchSigIn, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const\n{\n    CPubKey pubkey(vchPubKey);\n    if (!pubkey.IsValid())\n        return false;\n\n    // Hash type is one byte tacked on to the end of the signature\n    std::vector<unsigned char> vchSig(vchSigIn);\n    if (vchSig.empty())\n        return false;\n    int nHashType = vchSig.back();\n    vchSig.pop_back();\n\n    uint256 sighash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, sigversion, this->txdata);\n\n    if (!VerifySignature(vchSig, pubkey, sighash))\n        return false;\n\n    return true;\n}\n\nbool TransactionSignatureChecker::CheckLockTime(const CScriptNum& nLockTime) const\n{\n    // There are two kinds of nLockTime: lock-by-blockheight\n    // and lock-by-blocktime, distinguished by whether\n    // nLockTime < LOCKTIME_THRESHOLD.\n    //\n    // We want to compare apples to apples, so fail the script\n    // unless the type of nLockTime being tested is the same as\n    // the nLockTime in the transaction.\n    if (!(\n        (txTo->nLockTime <  LOCKTIME_THRESHOLD && nLockTime <  LOCKTIME_THRESHOLD) ||\n        (txTo->nLockTime >= LOCKTIME_THRESHOLD && nLockTime >= LOCKTIME_THRESHOLD)\n    ))\n        return false;\n\n    // Now that we know we're comparing apples-to-apples, the\n    // comparison is a simple numeric one.\n    if (nLockTime > (int64_t)txTo->nLockTime)\n        return false;\n\n    // Finally the nLockTime feature can be disabled and thus\n    // CHECKLOCKTIMEVERIFY bypassed if every txin has been\n    // finalized by setting nSequence to maxint. The\n    // transaction would be allowed into the blockchain, making\n    // the opcode ineffective.\n    //\n    // Testing if this vin is not final is sufficient to\n    // prevent this condition. Alternatively we could test all\n    // inputs, but testing just this input minimizes the data\n    // required to prove correct CHECKLOCKTIMEVERIFY execution.\n    if (CTxIn::SEQUENCE_FINAL == txTo->vin[nIn].nSequence)\n        return false;\n\n    return true;\n}\n\nbool TransactionSignatureChecker::CheckSequence(const CScriptNum& nSequence) const\n{\n    // Relative lock times are supported by comparing the passed\n    // in operand to the sequence number of the input.\n    const int64_t txToSequence = (int64_t)txTo->vin[nIn].nSequence;\n\n    // Fail if the transaction's version number is not set high\n    // enough to trigger BIP 68 rules.\n    if (static_cast<uint32_t>(txTo->nVersion) < 2)\n        return false;\n\n    // Sequence numbers with their most significant bit set are not\n    // consensus constrained. Testing that the transaction's sequence\n    // number do not have this bit set prevents using this property\n    // to get around a CHECKSEQUENCEVERIFY check.\n    if (txToSequence & CTxIn::SEQUENCE_LOCKTIME_DISABLE_FLAG)\n        return false;\n\n    // Mask off any bits that do not have consensus-enforced meaning\n    // before doing the integer comparisons\n    const uint32_t nLockTimeMask = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG | CTxIn::SEQUENCE_LOCKTIME_MASK;\n    const int64_t txToSequenceMasked = txToSequence & nLockTimeMask;\n    const CScriptNum nSequenceMasked = nSequence & nLockTimeMask;\n\n    // There are two kinds of nSequence: lock-by-blockheight\n    // and lock-by-blocktime, distinguished by whether\n    // nSequenceMasked < CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG.\n    //\n    // We want to compare apples to apples, so fail the script\n    // unless the type of nSequenceMasked being tested is the same as\n    // the nSequenceMasked in the transaction.\n    if (!(\n        (txToSequenceMasked <  CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG && nSequenceMasked <  CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) ||\n        (txToSequenceMasked >= CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG && nSequenceMasked >= CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG)\n    )) {\n        return false;\n    }\n\n    // Now that we know we're comparing apples-to-apples, the\n    // comparison is a simple numeric one.\n    if (nSequenceMasked > txToSequenceMasked)\n        return false;\n\n    return true;\n}\n\nstatic bool VerifyWitnessProgram(const CScriptWitness& witness, int witversion, const std::vector<unsigned char>& program, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror)\n{\n    std::vector<std::vector<unsigned char> > stack;\n    CScript scriptPubKey;\n\n    if (witversion == 0) {\n        if (program.size() == 32) {\n            // Version 0 segregated witness program: SHA256(CScript) inside the program, CScript + inputs in witness\n            if (witness.stack.size() == 0) {\n                return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY);\n            }\n            scriptPubKey = CScript(witness.stack.back().begin(), witness.stack.back().end());\n            stack = std::vector<std::vector<unsigned char> >(witness.stack.begin(), witness.stack.end() - 1);\n            uint256 hashScriptPubKey;\n            CSHA256().Write(&scriptPubKey[0], scriptPubKey.size()).Finalize(hashScriptPubKey.begin());\n            if (memcmp(hashScriptPubKey.begin(), program.data(), 32)) {\n                return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH);\n            }\n        } else if (program.size() == 20) {\n            // Special case for pay-to-pubkeyhash; signature + pubkey in witness\n            if (witness.stack.size() != 2) {\n                return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH); // 2 items in witness\n            }\n            scriptPubKey << OP_DUP << OP_HASH160 << program << OP_EQUALVERIFY << OP_CHECKSIG;\n            stack = witness.stack;\n        } else {\n            return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH);\n        }\n    } else if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM) {\n        return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM);\n    } else {\n        // Higher version witness scripts return true for future softfork compatibility\n        return set_success(serror);\n    }\n\n    // Disallow stack item size > MAX_SCRIPT_ELEMENT_SIZE in witness stack\n    for (unsigned int i = 0; i < stack.size(); i++) {\n        if (stack.at(i).size() > MAX_SCRIPT_ELEMENT_SIZE)\n            return set_error(serror, SCRIPT_ERR_PUSH_SIZE);\n    }\n\n    if (!EvalScript(stack, scriptPubKey, flags, checker, SIGVERSION_WITNESS_V0, serror)) {\n        return false;\n    }\n\n    // Scripts inside witness implicitly require cleanstack behaviour\n    if (stack.size() != 1)\n        return set_error(serror, SCRIPT_ERR_EVAL_FALSE);\n    if (!CastToBool(stack.back()))\n        return set_error(serror, SCRIPT_ERR_EVAL_FALSE);\n    return true;\n}\n\nbool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CScriptWitness* witness, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror)\n{\n    static const CScriptWitness emptyWitness;\n    if (witness == nullptr) {\n        witness = &emptyWitness;\n    }\n    bool hadWitness = false;\n\n    set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR);\n\n    if ((flags & SCRIPT_VERIFY_SIGPUSHONLY) != 0 && !scriptSig.IsPushOnly()) {\n        return set_error(serror, SCRIPT_ERR_SIG_PUSHONLY);\n    }\n\n    std::vector<std::vector<unsigned char> > stack, stackCopy;\n    if (!EvalScript(stack, scriptSig, flags, checker, SIGVERSION_BASE, serror))\n        // serror is set\n        return false;\n    if (flags & SCRIPT_VERIFY_P2SH)\n        stackCopy = stack;\n    if (!EvalScript(stack, scriptPubKey, flags, checker, SIGVERSION_BASE, serror))\n        // serror is set\n        return false;\n    if (stack.empty())\n        return set_error(serror, SCRIPT_ERR_EVAL_FALSE);\n    if (CastToBool(stack.back()) == false)\n        return set_error(serror, SCRIPT_ERR_EVAL_FALSE);\n\n    // Bare witness programs\n    int witnessversion;\n    std::vector<unsigned char> witnessprogram;\n    if (flags & SCRIPT_VERIFY_WITNESS) {\n        if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {\n            hadWitness = true;\n            if (scriptSig.size() != 0) {\n                // The scriptSig must be _exactly_ CScript(), otherwise we reintroduce malleability.\n                return set_error(serror, SCRIPT_ERR_WITNESS_MALLEATED);\n            }\n            if (!VerifyWitnessProgram(*witness, witnessversion, witnessprogram, flags, checker, serror)) {\n                return false;\n            }\n            // Bypass the cleanstack check at the end. The actual stack is obviously not clean\n            // for witness programs.\n            stack.resize(1);\n        }\n    }\n\n    // Additional validation for spend-to-script-hash transactions:\n    if ((flags & SCRIPT_VERIFY_P2SH) && scriptPubKey.IsPayToScriptHash())\n    {\n        // scriptSig must be literals-only or validation fails\n        if (!scriptSig.IsPushOnly())\n            return set_error(serror, SCRIPT_ERR_SIG_PUSHONLY);\n\n        // Restore stack.\n        swap(stack, stackCopy);\n\n        // stack cannot be empty here, because if it was the\n        // P2SH  HASH <> EQUAL  scriptPubKey would be evaluated with\n        // an empty stack and the EvalScript above would return false.\n        assert(!stack.empty());\n\n        const valtype& pubKeySerialized = stack.back();\n        CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end());\n        popstack(stack);\n\n        if (!EvalScript(stack, pubKey2, flags, checker, SIGVERSION_BASE, serror))\n            // serror is set\n            return false;\n        if (stack.empty())\n            return set_error(serror, SCRIPT_ERR_EVAL_FALSE);\n        if (!CastToBool(stack.back()))\n            return set_error(serror, SCRIPT_ERR_EVAL_FALSE);\n\n        // P2SH witness program\n        if (flags & SCRIPT_VERIFY_WITNESS) {\n            if (pubKey2.IsWitnessProgram(witnessversion, witnessprogram)) {\n                hadWitness = true;\n                if (scriptSig != CScript() << std::vector<unsigned char>(pubKey2.begin(), pubKey2.end())) {\n                    // The scriptSig must be _exactly_ a single push of the redeemScript. Otherwise we\n                    // reintroduce malleability.\n                    return set_error(serror, SCRIPT_ERR_WITNESS_MALLEATED_P2SH);\n                }\n                if (!VerifyWitnessProgram(*witness, witnessversion, witnessprogram, flags, checker, serror)) {\n                    return false;\n                }\n                // Bypass the cleanstack check at the end. The actual stack is obviously not clean\n                // for witness programs.\n                stack.resize(1);\n            }\n        }\n    }\n\n    // The CLEANSTACK check is only performed after potential P2SH evaluation,\n    // as the non-P2SH evaluation of a P2SH script will obviously not result in\n    // a clean stack (the P2SH inputs remain). The same holds for witness evaluation.\n    if ((flags & SCRIPT_VERIFY_CLEANSTACK) != 0) {\n        // Disallow CLEANSTACK without P2SH, as otherwise a switch CLEANSTACK->P2SH+CLEANSTACK\n        // would be possible, which is not a softfork (and P2SH should be one).\n        assert((flags & SCRIPT_VERIFY_P2SH) != 0);\n        assert((flags & SCRIPT_VERIFY_WITNESS) != 0);\n        if (stack.size() != 1) {\n            return set_error(serror, SCRIPT_ERR_CLEANSTACK);\n        }\n    }\n\n    if (flags & SCRIPT_VERIFY_WITNESS) {\n        // We can't check for correct unexpected witness data if P2SH was off, so require\n        // that WITNESS implies P2SH. Otherwise, going from WITNESS->P2SH+WITNESS would be\n        // possible, which is not a softfork.\n        assert((flags & SCRIPT_VERIFY_P2SH) != 0);\n        if (!hadWitness && !witness->IsNull()) {\n            return set_error(serror, SCRIPT_ERR_WITNESS_UNEXPECTED);\n        }\n    }\n\n    return set_success(serror);\n}\n\nsize_t static WitnessSigOps(int witversion, const std::vector<unsigned char>& witprogram, const CScriptWitness& witness, int flags)\n{\n    if (witversion == 0) {\n        if (witprogram.size() == 20)\n            return 1;\n\n        if (witprogram.size() == 32 && witness.stack.size() > 0) {\n            CScript subscript(witness.stack.back().begin(), witness.stack.back().end());\n            return subscript.GetSigOpCount(true);\n        }\n    }\n\n    // Future flags may be implemented here.\n    return 0;\n}\n\nsize_t CountWitnessSigOps(const CScript& scriptSig, const CScript& scriptPubKey, const CScriptWitness* witness, unsigned int flags)\n{\n    static const CScriptWitness witnessEmpty;\n\n    if ((flags & SCRIPT_VERIFY_WITNESS) == 0) {\n        return 0;\n    }\n    assert((flags & SCRIPT_VERIFY_P2SH) != 0);\n\n    int witnessversion;\n    std::vector<unsigned char> witnessprogram;\n    if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {\n        return WitnessSigOps(witnessversion, witnessprogram, witness ? *witness : witnessEmpty, flags);\n    }\n\n    if (scriptPubKey.IsPayToScriptHash() && scriptSig.IsPushOnly()) {\n        CScript::const_iterator pc = scriptSig.begin();\n        std::vector<unsigned char> data;\n        while (pc < scriptSig.end()) {\n            opcodetype opcode;\n            scriptSig.GetOp(pc, opcode, data);\n        }\n        CScript subscript(data.begin(), data.end());\n        if (subscript.IsWitnessProgram(witnessversion, witnessprogram)) {\n            return WitnessSigOps(witnessversion, witnessprogram, witness ? *witness : witnessEmpty, flags);\n        }\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "src/script/interpreter.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SCRIPT_INTERPRETER_H\n#define BITCOIN_SCRIPT_INTERPRETER_H\n\n#include <script/script_error.h>\n#include <primitives/transaction.h>\n\n#include <vector>\n#include <stdint.h>\n#include <string>\n\nclass CPubKey;\nclass CScript;\nclass CTransaction;\nclass uint256;\n\n/** Signature hash types/flags */\nenum\n{\n    SIGHASH_ALL = 1,\n    SIGHASH_NONE = 2,\n    SIGHASH_SINGLE = 3,\n    SIGHASH_ANYONECANPAY = 0x80,\n};\n\n/** Script verification flags.\n *\n *  All flags are intended to be soft forks: the set of acceptable scripts under\n *  flags (A | B) is a subset of the acceptable scripts under flag (A).\n */\nenum\n{\n    SCRIPT_VERIFY_NONE      = 0,\n\n    // Evaluate P2SH subscripts (BIP16).\n    SCRIPT_VERIFY_P2SH      = (1U << 0),\n\n    // Passing a non-strict-DER signature or one with undefined hashtype to a checksig operation causes script failure.\n    // Evaluating a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) by checksig causes script failure.\n    // (not used or intended as a consensus rule).\n    SCRIPT_VERIFY_STRICTENC = (1U << 1),\n\n    // Passing a non-strict-DER signature to a checksig operation causes script failure (BIP62 rule 1)\n    SCRIPT_VERIFY_DERSIG    = (1U << 2),\n\n    // Passing a non-strict-DER signature or one with S > order/2 to a checksig operation causes script failure\n    // (BIP62 rule 5).\n    SCRIPT_VERIFY_LOW_S     = (1U << 3),\n\n    // verify dummy stack item consumed by CHECKMULTISIG is of zero-length (BIP62 rule 7).\n    SCRIPT_VERIFY_NULLDUMMY = (1U << 4),\n\n    // Using a non-push operator in the scriptSig causes script failure (BIP62 rule 2).\n    SCRIPT_VERIFY_SIGPUSHONLY = (1U << 5),\n\n    // Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct\n    // pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating\n    // any other push causes the script to fail (BIP62 rule 3).\n    // In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4).\n    SCRIPT_VERIFY_MINIMALDATA = (1U << 6),\n\n    // Discourage use of NOPs reserved for upgrades (NOP1-10)\n    //\n    // Provided so that nodes can avoid accepting or mining transactions\n    // containing executed NOP's whose meaning may change after a soft-fork,\n    // thus rendering the script invalid; with this flag set executing\n    // discouraged NOPs fails the script. This verification flag will never be\n    // a mandatory flag applied to scripts in a block. NOPs that are not\n    // executed, e.g.  within an unexecuted IF ENDIF block, are *not* rejected.\n    // NOPs that have associated forks to give them new meaning (CLTV, CSV)\n    // are not subject to this rule.\n    SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS  = (1U << 7),\n\n    // Require that only a single stack element remains after evaluation. This changes the success criterion from\n    // \"At least one stack element must remain, and when interpreted as a boolean, it must be true\" to\n    // \"Exactly one stack element must remain, and when interpreted as a boolean, it must be true\".\n    // (BIP62 rule 6)\n    // Note: CLEANSTACK should never be used without P2SH or WITNESS.\n    SCRIPT_VERIFY_CLEANSTACK = (1U << 8),\n\n    // Verify CHECKLOCKTIMEVERIFY\n    //\n    // See BIP65 for details.\n    SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY = (1U << 9),\n\n    // support CHECKSEQUENCEVERIFY opcode\n    //\n    // See BIP112 for details\n    SCRIPT_VERIFY_CHECKSEQUENCEVERIFY = (1U << 10),\n\n    // Support segregated witness\n    //\n    SCRIPT_VERIFY_WITNESS = (1U << 11),\n\n    // Making v1-v16 witness program non-standard\n    //\n    SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM = (1U << 12),\n\n    // Segwit script only: Require the argument of OP_IF/NOTIF to be exactly 0x01 or empty vector\n    //\n    SCRIPT_VERIFY_MINIMALIF = (1U << 13),\n\n    // Signature(s) must be empty vector if an CHECK(MULTI)SIG operation failed\n    //\n    SCRIPT_VERIFY_NULLFAIL = (1U << 14),\n\n    // Public keys in segregated witness scripts must be compressed\n    //\n    SCRIPT_VERIFY_WITNESS_PUBKEYTYPE = (1U << 15),\n\n    // Making OP_CODESEPARATOR and FindAndDelete fail any non-segwit scripts\n    //\n    SCRIPT_VERIFY_CONST_SCRIPTCODE = (1U << 16),\n};\n\nbool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, unsigned int flags, ScriptError* serror);\n\nstruct PrecomputedTransactionData\n{\n    uint256 hashPrevouts, hashSequence, hashOutputs;\n    bool ready = false;\n\n    explicit PrecomputedTransactionData(const CTransaction& tx);\n};\n\nenum SigVersion\n{\n    SIGVERSION_BASE = 0,\n    SIGVERSION_WITNESS_V0 = 1,\n};\n\nuint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType, const CAmount& amount, SigVersion sigversion, const PrecomputedTransactionData* cache = nullptr);\n\nclass BaseSignatureChecker\n{\npublic:\n    virtual bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const\n    {\n        return false;\n    }\n\n    virtual bool CheckLockTime(const CScriptNum& nLockTime) const\n    {\n         return false;\n    }\n\n    virtual bool CheckSequence(const CScriptNum& nSequence) const\n    {\n         return false;\n    }\n\n    virtual ~BaseSignatureChecker() {}\n};\n\nclass TransactionSignatureChecker : public BaseSignatureChecker\n{\nprivate:\n    const CTransaction* txTo;\n    unsigned int nIn;\n    const CAmount amount;\n    const PrecomputedTransactionData* txdata;\n\nprotected:\n    virtual bool VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const;\n\npublic:\n    TransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn) : txTo(txToIn), nIn(nInIn), amount(amountIn), txdata(nullptr) {}\n    TransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, const PrecomputedTransactionData& txdataIn) : txTo(txToIn), nIn(nInIn), amount(amountIn), txdata(&txdataIn) {}\n    bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const override;\n    bool CheckLockTime(const CScriptNum& nLockTime) const override;\n    bool CheckSequence(const CScriptNum& nSequence) const override;\n};\n\nclass MutableTransactionSignatureChecker : public TransactionSignatureChecker\n{\nprivate:\n    const CTransaction txTo;\n\npublic:\n    MutableTransactionSignatureChecker(const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn) : TransactionSignatureChecker(&txTo, nInIn, amountIn), txTo(*txToIn) {}\n};\n\nbool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript& script, unsigned int flags, const BaseSignatureChecker& checker, SigVersion sigversion, ScriptError* error = nullptr);\nbool VerifyScript(const CScript& scriptSig, const CScript& scriptPubKey, const CScriptWitness* witness, unsigned int flags, const BaseSignatureChecker& checker, ScriptError* serror = nullptr);\n\nsize_t CountWitnessSigOps(const CScript& scriptSig, const CScript& scriptPubKey, const CScriptWitness* witness, unsigned int flags);\n\n#endif // BITCOIN_SCRIPT_INTERPRETER_H\n"
  },
  {
    "path": "src/script/ismine.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <script/ismine.h>\n\n#include <key.h>\n#include <keystore.h>\n#include <script/script.h>\n#include <script/sign.h>\n\n\ntypedef std::vector<unsigned char> valtype;\n\nunsigned int HaveKeys(const std::vector<valtype>& pubkeys, const CKeyStore& keystore)\n{\n    unsigned int nResult = 0;\n    for (const valtype& pubkey : pubkeys)\n    {\n        CKeyID keyID = CPubKey(pubkey).GetID();\n        if (keystore.HaveKey(keyID))\n            ++nResult;\n    }\n    return nResult;\n}\n\nisminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey, SigVersion sigversion)\n{\n    bool isInvalid = false;\n    return IsMine(keystore, scriptPubKey, isInvalid, sigversion);\n}\n\nisminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest, SigVersion sigversion)\n{\n    bool isInvalid = false;\n    return IsMine(keystore, dest, isInvalid, sigversion);\n}\n\nisminetype IsMine(const CKeyStore &keystore, const CTxDestination& dest, bool& isInvalid, SigVersion sigversion)\n{\n    CScript script = GetScriptForDestination(dest);\n    return IsMine(keystore, script, isInvalid, sigversion);\n}\n\nisminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey, bool& isInvalid, SigVersion sigversion)\n{\n    isInvalid = false;\n\n    std::vector<valtype> vSolutions;\n    txnouttype whichType;\n    if (!Solver(scriptPubKey, whichType, vSolutions)) {\n        if (keystore.HaveWatchOnly(scriptPubKey))\n            return ISMINE_WATCH_UNSOLVABLE;\n        return ISMINE_NO;\n    }\n\n    CKeyID keyID;\n    switch (whichType)\n    {\n    case TX_NONSTANDARD:\n    case TX_NULL_DATA:\n    case TX_WITNESS_UNKNOWN:\n        break;\n    case TX_PUBKEY:\n        keyID = CPubKey(vSolutions[0]).GetID();\n        if (sigversion != SIGVERSION_BASE && vSolutions[0].size() != 33) {\n            isInvalid = true;\n            return ISMINE_NO;\n        }\n        if (keystore.HaveKey(keyID))\n            return ISMINE_SPENDABLE;\n        break;\n    case TX_WITNESS_V0_KEYHASH:\n    {\n        if (!keystore.HaveCScript(CScriptID(CScript() << OP_0 << vSolutions[0]))) {\n            // We do not support bare witness outputs unless the P2SH version of it would be\n            // acceptable as well. This protects against matching before segwit activates.\n            // This also applies to the P2WSH case.\n            break;\n        }\n        isminetype ret = ::IsMine(keystore, GetScriptForDestination(CKeyID(uint160(vSolutions[0]))), isInvalid, SIGVERSION_WITNESS_V0);\n        if (ret == ISMINE_SPENDABLE || ret == ISMINE_WATCH_SOLVABLE || (ret == ISMINE_NO && isInvalid))\n            return ret;\n        break;\n    }\n    case TX_PUBKEYHASH:\n        keyID = CKeyID(uint160(vSolutions[0]));\n        if (sigversion != SIGVERSION_BASE) {\n            CPubKey pubkey;\n            if (keystore.GetPubKey(keyID, pubkey) && !pubkey.IsCompressed()) {\n                isInvalid = true;\n                return ISMINE_NO;\n            }\n        }\n        if (keystore.HaveKey(keyID))\n            return ISMINE_SPENDABLE;\n        break;\n    case TX_SCRIPTHASH:\n    {\n        CScriptID scriptID = CScriptID(uint160(vSolutions[0]));\n        CScript subscript;\n        if (keystore.GetCScript(scriptID, subscript)) {\n            isminetype ret = IsMine(keystore, subscript, isInvalid);\n            if (ret == ISMINE_SPENDABLE || ret == ISMINE_WATCH_SOLVABLE || (ret == ISMINE_NO && isInvalid))\n                return ret;\n        }\n        break;\n    }\n    case TX_WITNESS_V0_SCRIPTHASH:\n    {\n        if (!keystore.HaveCScript(CScriptID(CScript() << OP_0 << vSolutions[0]))) {\n            break;\n        }\n        uint160 hash;\n        CRIPEMD160().Write(&vSolutions[0][0], vSolutions[0].size()).Finalize(hash.begin());\n        CScriptID scriptID = CScriptID(hash);\n        CScript subscript;\n        if (keystore.GetCScript(scriptID, subscript)) {\n            isminetype ret = IsMine(keystore, subscript, isInvalid, SIGVERSION_WITNESS_V0);\n            if (ret == ISMINE_SPENDABLE || ret == ISMINE_WATCH_SOLVABLE || (ret == ISMINE_NO && isInvalid))\n                return ret;\n        }\n        break;\n    }\n\n    case TX_MULTISIG:\n    {\n        // Only consider transactions \"mine\" if we own ALL the\n        // keys involved. Multi-signature transactions that are\n        // partially owned (somebody else has a key that can spend\n        // them) enable spend-out-from-under-you attacks, especially\n        // in shared-wallet situations.\n        std::vector<valtype> keys(vSolutions.begin()+1, vSolutions.begin()+vSolutions.size()-1);\n        if (sigversion != SIGVERSION_BASE) {\n            for (size_t i = 0; i < keys.size(); i++) {\n                if (keys[i].size() != 33) {\n                    isInvalid = true;\n                    return ISMINE_NO;\n                }\n            }\n        }\n        if (HaveKeys(keys, keystore) == keys.size())\n            return ISMINE_SPENDABLE;\n        break;\n    }\n    }\n\n    if (keystore.HaveWatchOnly(scriptPubKey)) {\n        // TODO: This could be optimized some by doing some work after the above solver\n        SignatureData sigs;\n        return ProduceSignature(DummySignatureCreator(&keystore), scriptPubKey, sigs) ? ISMINE_WATCH_SOLVABLE : ISMINE_WATCH_UNSOLVABLE;\n    }\n    return ISMINE_NO;\n}\n"
  },
  {
    "path": "src/script/ismine.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SCRIPT_ISMINE_H\n#define BITCOIN_SCRIPT_ISMINE_H\n\n#include <script/standard.h>\n\n#include <stdint.h>\n\nclass CKeyStore;\nclass CScript;\n\n/** IsMine() return codes */\nenum isminetype\n{\n    ISMINE_NO = 0,\n    //! Indicates that we don't know how to create a scriptSig that would solve this if we were given the appropriate private keys\n    ISMINE_WATCH_UNSOLVABLE = 1,\n    //! Indicates that we know how to create a scriptSig that would solve this if we were given the appropriate private keys\n    ISMINE_WATCH_SOLVABLE = 2,\n    ISMINE_WATCH_ONLY = ISMINE_WATCH_SOLVABLE | ISMINE_WATCH_UNSOLVABLE,\n    ISMINE_SPENDABLE = 4,\n    ISMINE_ALL = ISMINE_WATCH_ONLY | ISMINE_SPENDABLE\n};\n/** used for bitflags of isminetype */\ntypedef uint8_t isminefilter;\n\n/* isInvalid becomes true when the script is found invalid by consensus or policy. This will terminate the recursion\n * and return a ISMINE_NO immediately, as an invalid script should never be considered as \"mine\". This is needed as\n * different SIGVERSION may have different network rules. Currently the only use of isInvalid is indicate uncompressed\n * keys in SIGVERSION_WITNESS_V0 script, but could also be used in similar cases in the future\n */\nisminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey, bool& isInvalid, SigVersion = SIGVERSION_BASE);\nisminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey, SigVersion = SIGVERSION_BASE);\nisminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest, bool& isInvalid, SigVersion = SIGVERSION_BASE);\nisminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest, SigVersion = SIGVERSION_BASE);\n\n#endif // BITCOIN_SCRIPT_ISMINE_H\n"
  },
  {
    "path": "src/script/script.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <script/script.h>\n\n#include <tinyformat.h>\n#include <utilstrencodings.h>\n\nconst char* GetOpName(opcodetype opcode)\n{\n    switch (opcode)\n    {\n    // push value\n    case OP_0                      : return \"0\";\n    case OP_PUSHDATA1              : return \"OP_PUSHDATA1\";\n    case OP_PUSHDATA2              : return \"OP_PUSHDATA2\";\n    case OP_PUSHDATA4              : return \"OP_PUSHDATA4\";\n    case OP_1NEGATE                : return \"-1\";\n    case OP_RESERVED               : return \"OP_RESERVED\";\n    case OP_1                      : return \"1\";\n    case OP_2                      : return \"2\";\n    case OP_3                      : return \"3\";\n    case OP_4                      : return \"4\";\n    case OP_5                      : return \"5\";\n    case OP_6                      : return \"6\";\n    case OP_7                      : return \"7\";\n    case OP_8                      : return \"8\";\n    case OP_9                      : return \"9\";\n    case OP_10                     : return \"10\";\n    case OP_11                     : return \"11\";\n    case OP_12                     : return \"12\";\n    case OP_13                     : return \"13\";\n    case OP_14                     : return \"14\";\n    case OP_15                     : return \"15\";\n    case OP_16                     : return \"16\";\n\n    // control\n    case OP_NOP                    : return \"OP_NOP\";\n    case OP_VER                    : return \"OP_VER\";\n    case OP_IF                     : return \"OP_IF\";\n    case OP_NOTIF                  : return \"OP_NOTIF\";\n    case OP_VERIF                  : return \"OP_VERIF\";\n    case OP_VERNOTIF               : return \"OP_VERNOTIF\";\n    case OP_ELSE                   : return \"OP_ELSE\";\n    case OP_ENDIF                  : return \"OP_ENDIF\";\n    case OP_VERIFY                 : return \"OP_VERIFY\";\n    case OP_RETURN                 : return \"OP_RETURN\";\n\n    // stack ops\n    case OP_TOALTSTACK             : return \"OP_TOALTSTACK\";\n    case OP_FROMALTSTACK           : return \"OP_FROMALTSTACK\";\n    case OP_2DROP                  : return \"OP_2DROP\";\n    case OP_2DUP                   : return \"OP_2DUP\";\n    case OP_3DUP                   : return \"OP_3DUP\";\n    case OP_2OVER                  : return \"OP_2OVER\";\n    case OP_2ROT                   : return \"OP_2ROT\";\n    case OP_2SWAP                  : return \"OP_2SWAP\";\n    case OP_IFDUP                  : return \"OP_IFDUP\";\n    case OP_DEPTH                  : return \"OP_DEPTH\";\n    case OP_DROP                   : return \"OP_DROP\";\n    case OP_DUP                    : return \"OP_DUP\";\n    case OP_NIP                    : return \"OP_NIP\";\n    case OP_OVER                   : return \"OP_OVER\";\n    case OP_PICK                   : return \"OP_PICK\";\n    case OP_ROLL                   : return \"OP_ROLL\";\n    case OP_ROT                    : return \"OP_ROT\";\n    case OP_SWAP                   : return \"OP_SWAP\";\n    case OP_TUCK                   : return \"OP_TUCK\";\n\n    // splice ops\n    case OP_CAT                    : return \"OP_CAT\";\n    case OP_SUBSTR                 : return \"OP_SUBSTR\";\n    case OP_LEFT                   : return \"OP_LEFT\";\n    case OP_RIGHT                  : return \"OP_RIGHT\";\n    case OP_SIZE                   : return \"OP_SIZE\";\n\n    // bit logic\n    case OP_INVERT                 : return \"OP_INVERT\";\n    case OP_AND                    : return \"OP_AND\";\n    case OP_OR                     : return \"OP_OR\";\n    case OP_XOR                    : return \"OP_XOR\";\n    case OP_EQUAL                  : return \"OP_EQUAL\";\n    case OP_EQUALVERIFY            : return \"OP_EQUALVERIFY\";\n    case OP_RESERVED1              : return \"OP_RESERVED1\";\n    case OP_RESERVED2              : return \"OP_RESERVED2\";\n\n    // numeric\n    case OP_1ADD                   : return \"OP_1ADD\";\n    case OP_1SUB                   : return \"OP_1SUB\";\n    case OP_2MUL                   : return \"OP_2MUL\";\n    case OP_2DIV                   : return \"OP_2DIV\";\n    case OP_NEGATE                 : return \"OP_NEGATE\";\n    case OP_ABS                    : return \"OP_ABS\";\n    case OP_NOT                    : return \"OP_NOT\";\n    case OP_0NOTEQUAL              : return \"OP_0NOTEQUAL\";\n    case OP_ADD                    : return \"OP_ADD\";\n    case OP_SUB                    : return \"OP_SUB\";\n    case OP_MUL                    : return \"OP_MUL\";\n    case OP_DIV                    : return \"OP_DIV\";\n    case OP_MOD                    : return \"OP_MOD\";\n    case OP_LSHIFT                 : return \"OP_LSHIFT\";\n    case OP_RSHIFT                 : return \"OP_RSHIFT\";\n    case OP_BOOLAND                : return \"OP_BOOLAND\";\n    case OP_BOOLOR                 : return \"OP_BOOLOR\";\n    case OP_NUMEQUAL               : return \"OP_NUMEQUAL\";\n    case OP_NUMEQUALVERIFY         : return \"OP_NUMEQUALVERIFY\";\n    case OP_NUMNOTEQUAL            : return \"OP_NUMNOTEQUAL\";\n    case OP_LESSTHAN               : return \"OP_LESSTHAN\";\n    case OP_GREATERTHAN            : return \"OP_GREATERTHAN\";\n    case OP_LESSTHANOREQUAL        : return \"OP_LESSTHANOREQUAL\";\n    case OP_GREATERTHANOREQUAL     : return \"OP_GREATERTHANOREQUAL\";\n    case OP_MIN                    : return \"OP_MIN\";\n    case OP_MAX                    : return \"OP_MAX\";\n    case OP_WITHIN                 : return \"OP_WITHIN\";\n\n    // crypto\n    case OP_RIPEMD160              : return \"OP_RIPEMD160\";\n    case OP_SHA1                   : return \"OP_SHA1\";\n    case OP_SHA256                 : return \"OP_SHA256\";\n    case OP_HASH160                : return \"OP_HASH160\";\n    case OP_HASH256                : return \"OP_HASH256\";\n    case OP_CODESEPARATOR          : return \"OP_CODESEPARATOR\";\n    case OP_CHECKSIG               : return \"OP_CHECKSIG\";\n    case OP_CHECKSIGVERIFY         : return \"OP_CHECKSIGVERIFY\";\n    case OP_CHECKMULTISIG          : return \"OP_CHECKMULTISIG\";\n    case OP_CHECKMULTISIGVERIFY    : return \"OP_CHECKMULTISIGVERIFY\";\n\n    // expansion\n    case OP_NOP1                   : return \"OP_NOP1\";\n    case OP_CHECKLOCKTIMEVERIFY    : return \"OP_CHECKLOCKTIMEVERIFY\";\n    case OP_CHECKSEQUENCEVERIFY    : return \"OP_CHECKSEQUENCEVERIFY\";\n    case OP_NOP4                   : return \"OP_NOP4\";\n    case OP_NOP5                   : return \"OP_NOP5\";\n    case OP_NOP6                   : return \"OP_NOP6\";\n    case OP_NOP7                   : return \"OP_NOP7\";\n    case OP_NOP8                   : return \"OP_NOP8\";\n    case OP_NOP9                   : return \"OP_NOP9\";\n    case OP_NOP10                  : return \"OP_NOP10\";\n\n    case OP_INVALIDOPCODE          : return \"OP_INVALIDOPCODE\";\n\n    // Note:\n    //  The template matching params OP_SMALLINTEGER/etc are defined in opcodetype enum\n    //  as kind of implementation hack, they are *NOT* real opcodes.  If found in real\n    //  Script, just let the default: case deal with them.\n\n    default:\n        return \"OP_UNKNOWN\";\n    }\n}\n\nunsigned int CScript::GetSigOpCount(bool fAccurate) const\n{\n    unsigned int n = 0;\n    const_iterator pc = begin();\n    opcodetype lastOpcode = OP_INVALIDOPCODE;\n    while (pc < end())\n    {\n        opcodetype opcode;\n        if (!GetOp(pc, opcode))\n            break;\n        if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY)\n            n++;\n        else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY)\n        {\n            if (fAccurate && lastOpcode >= OP_1 && lastOpcode <= OP_16)\n                n += DecodeOP_N(lastOpcode);\n            else\n                n += MAX_PUBKEYS_PER_MULTISIG;\n        }\n        lastOpcode = opcode;\n    }\n    return n;\n}\n\nunsigned int CScript::GetSigOpCount(const CScript& scriptSig) const\n{\n    if (!IsPayToScriptHash())\n        return GetSigOpCount(true);\n\n    // This is a pay-to-script-hash scriptPubKey;\n    // get the last item that the scriptSig\n    // pushes onto the stack:\n    const_iterator pc = scriptSig.begin();\n    std::vector<unsigned char> vData;\n    while (pc < scriptSig.end())\n    {\n        opcodetype opcode;\n        if (!scriptSig.GetOp(pc, opcode, vData))\n            return 0;\n        if (opcode > OP_16)\n            return 0;\n    }\n\n    /// ... and return its opcount:\n    CScript subscript(vData.begin(), vData.end());\n    return subscript.GetSigOpCount(true);\n}\n\nbool CScript::IsPayToScriptHash() const\n{\n    // Extra-fast test for pay-to-script-hash CScripts:\n    return (this->size() == 23 &&\n            (*this)[0] == OP_HASH160 &&\n            (*this)[1] == 0x14 &&\n            (*this)[22] == OP_EQUAL);\n}\n\nbool CScript::IsPayToWitnessScriptHash() const\n{\n    // Extra-fast test for pay-to-witness-script-hash CScripts:\n    return (this->size() == 34 &&\n            (*this)[0] == OP_0 &&\n            (*this)[1] == 0x20);\n}\n\n// A witness program is any valid CScript that consists of a 1-byte push opcode\n// followed by a data push between 2 and 40 bytes.\nbool CScript::IsWitnessProgram(int& version, std::vector<unsigned char>& program) const\n{\n    if (this->size() < 4 || this->size() > 42) {\n        return false;\n    }\n    if ((*this)[0] != OP_0 && ((*this)[0] < OP_1 || (*this)[0] > OP_16)) {\n        return false;\n    }\n    if ((size_t)((*this)[1] + 2) == this->size()) {\n        version = DecodeOP_N((opcodetype)(*this)[0]);\n        program = std::vector<unsigned char>(this->begin() + 2, this->end());\n        return true;\n    }\n    return false;\n}\n\nbool CScript::IsPushOnly(const_iterator pc) const\n{\n    while (pc < end())\n    {\n        opcodetype opcode;\n        if (!GetOp(pc, opcode))\n            return false;\n        // Note that IsPushOnly() *does* consider OP_RESERVED to be a\n        // push-type opcode, however execution of OP_RESERVED fails, so\n        // it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to\n        // the P2SH special validation code being executed.\n        if (opcode > OP_16)\n            return false;\n    }\n    return true;\n}\n\nbool CScript::IsPushOnly() const\n{\n    return this->IsPushOnly(begin());\n}\n\nstd::string CScriptWitness::ToString() const\n{\n    std::string ret = \"CScriptWitness(\";\n    for (unsigned int i = 0; i < stack.size(); i++) {\n        if (i) {\n            ret += \", \";\n        }\n        ret += HexStr(stack[i]);\n    }\n    return ret + \")\";\n}\n\nbool CScript::HasValidOps() const\n{\n    CScript::const_iterator it = begin();\n    while (it < end()) {\n        opcodetype opcode;\n        std::vector<unsigned char> item;\n        if (!GetOp(it, opcode, item) || opcode > MAX_OPCODE || item.size() > MAX_SCRIPT_ELEMENT_SIZE) {\n            return false;\n        }\n    }\n    return true;\n}\n"
  },
  {
    "path": "src/script/script.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SCRIPT_SCRIPT_H\n#define BITCOIN_SCRIPT_SCRIPT_H\n\n#include <crypto/common.h>\n#include <prevector.h>\n#include <serialize.h>\n\n#include <assert.h>\n#include <climits>\n#include <limits>\n#include <stdexcept>\n#include <stdint.h>\n#include <string.h>\n#include <string>\n#include <vector>\n\n// Maximum number of bytes pushable to the stack\nstatic const unsigned int MAX_SCRIPT_ELEMENT_SIZE = 520;\n\n// Maximum number of non-push operations per script\nstatic const int MAX_OPS_PER_SCRIPT = 201;\n\n// Maximum number of public keys per multisig\nstatic const int MAX_PUBKEYS_PER_MULTISIG = 20;\n\n// Maximum script length in bytes\nstatic const int MAX_SCRIPT_SIZE = 10000;\n\n// Maximum number of values on script interpreter stack\nstatic const int MAX_STACK_SIZE = 1000;\n\n// Threshold for nLockTime: below this value it is interpreted as block number,\n// otherwise as UNIX timestamp.\nstatic const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov  5 00:53:20 1985 UTC\n\ntemplate <typename T>\nstd::vector<unsigned char> ToByteVector(const T& in)\n{\n    return std::vector<unsigned char>(in.begin(), in.end());\n}\n\n/** Script opcodes */\nenum opcodetype\n{\n    // push value\n    OP_0 = 0x00,\n    OP_FALSE = OP_0,\n    OP_PUSHDATA1 = 0x4c,\n    OP_PUSHDATA2 = 0x4d,\n    OP_PUSHDATA4 = 0x4e,\n    OP_1NEGATE = 0x4f,\n    OP_RESERVED = 0x50,\n    OP_1 = 0x51,\n    OP_TRUE=OP_1,\n    OP_2 = 0x52,\n    OP_3 = 0x53,\n    OP_4 = 0x54,\n    OP_5 = 0x55,\n    OP_6 = 0x56,\n    OP_7 = 0x57,\n    OP_8 = 0x58,\n    OP_9 = 0x59,\n    OP_10 = 0x5a,\n    OP_11 = 0x5b,\n    OP_12 = 0x5c,\n    OP_13 = 0x5d,\n    OP_14 = 0x5e,\n    OP_15 = 0x5f,\n    OP_16 = 0x60,\n\n    // control\n    OP_NOP = 0x61,\n    OP_VER = 0x62,\n    OP_IF = 0x63,\n    OP_NOTIF = 0x64,\n    OP_VERIF = 0x65,\n    OP_VERNOTIF = 0x66,\n    OP_ELSE = 0x67,\n    OP_ENDIF = 0x68,\n    OP_VERIFY = 0x69,\n    OP_RETURN = 0x6a,\n\n    // stack ops\n    OP_TOALTSTACK = 0x6b,\n    OP_FROMALTSTACK = 0x6c,\n    OP_2DROP = 0x6d,\n    OP_2DUP = 0x6e,\n    OP_3DUP = 0x6f,\n    OP_2OVER = 0x70,\n    OP_2ROT = 0x71,\n    OP_2SWAP = 0x72,\n    OP_IFDUP = 0x73,\n    OP_DEPTH = 0x74,\n    OP_DROP = 0x75,\n    OP_DUP = 0x76,\n    OP_NIP = 0x77,\n    OP_OVER = 0x78,\n    OP_PICK = 0x79,\n    OP_ROLL = 0x7a,\n    OP_ROT = 0x7b,\n    OP_SWAP = 0x7c,\n    OP_TUCK = 0x7d,\n\n    // splice ops\n    OP_CAT = 0x7e,\n    OP_SUBSTR = 0x7f,\n    OP_LEFT = 0x80,\n    OP_RIGHT = 0x81,\n    OP_SIZE = 0x82,\n\n    // bit logic\n    OP_INVERT = 0x83,\n    OP_AND = 0x84,\n    OP_OR = 0x85,\n    OP_XOR = 0x86,\n    OP_EQUAL = 0x87,\n    OP_EQUALVERIFY = 0x88,\n    OP_RESERVED1 = 0x89,\n    OP_RESERVED2 = 0x8a,\n\n    // numeric\n    OP_1ADD = 0x8b,\n    OP_1SUB = 0x8c,\n    OP_2MUL = 0x8d,\n    OP_2DIV = 0x8e,\n    OP_NEGATE = 0x8f,\n    OP_ABS = 0x90,\n    OP_NOT = 0x91,\n    OP_0NOTEQUAL = 0x92,\n\n    OP_ADD = 0x93,\n    OP_SUB = 0x94,\n    OP_MUL = 0x95,\n    OP_DIV = 0x96,\n    OP_MOD = 0x97,\n    OP_LSHIFT = 0x98,\n    OP_RSHIFT = 0x99,\n\n    OP_BOOLAND = 0x9a,\n    OP_BOOLOR = 0x9b,\n    OP_NUMEQUAL = 0x9c,\n    OP_NUMEQUALVERIFY = 0x9d,\n    OP_NUMNOTEQUAL = 0x9e,\n    OP_LESSTHAN = 0x9f,\n    OP_GREATERTHAN = 0xa0,\n    OP_LESSTHANOREQUAL = 0xa1,\n    OP_GREATERTHANOREQUAL = 0xa2,\n    OP_MIN = 0xa3,\n    OP_MAX = 0xa4,\n\n    OP_WITHIN = 0xa5,\n\n    // crypto\n    OP_RIPEMD160 = 0xa6,\n    OP_SHA1 = 0xa7,\n    OP_SHA256 = 0xa8,\n    OP_HASH160 = 0xa9,\n    OP_HASH256 = 0xaa,\n    OP_CODESEPARATOR = 0xab,\n    OP_CHECKSIG = 0xac,\n    OP_CHECKSIGVERIFY = 0xad,\n    OP_CHECKMULTISIG = 0xae,\n    OP_CHECKMULTISIGVERIFY = 0xaf,\n\n    // expansion\n    OP_NOP1 = 0xb0,\n    OP_CHECKLOCKTIMEVERIFY = 0xb1,\n    OP_NOP2 = OP_CHECKLOCKTIMEVERIFY,\n    OP_CHECKSEQUENCEVERIFY = 0xb2,\n    OP_NOP3 = OP_CHECKSEQUENCEVERIFY,\n    OP_NOP4 = 0xb3,\n    OP_NOP5 = 0xb4,\n    OP_NOP6 = 0xb5,\n    OP_NOP7 = 0xb6,\n    OP_NOP8 = 0xb7,\n    OP_NOP9 = 0xb8,\n    OP_NOP10 = 0xb9,\n\n\n    // template matching params\n    OP_SMALLINTEGER = 0xfa,\n    OP_PUBKEYS = 0xfb,\n    OP_PUBKEYHASH = 0xfd,\n    OP_PUBKEY = 0xfe,\n\n    OP_INVALIDOPCODE = 0xff,\n};\n\n// Maximum value that an opcode can be\nstatic const unsigned int MAX_OPCODE = OP_NOP10;\n\nconst char* GetOpName(opcodetype opcode);\n\nclass scriptnum_error : public std::runtime_error\n{\npublic:\n    explicit scriptnum_error(const std::string& str) : std::runtime_error(str) {}\n};\n\nclass CScriptNum\n{\n/**\n * Numeric opcodes (OP_1ADD, etc) are restricted to operating on 4-byte integers.\n * The semantics are subtle, though: operands must be in the range [-2^31 +1...2^31 -1],\n * but results may overflow (and are valid as long as they are not used in a subsequent\n * numeric operation). CScriptNum enforces those semantics by storing results as\n * an int64 and allowing out-of-range values to be returned as a vector of bytes but\n * throwing an exception if arithmetic is done or the result is interpreted as an integer.\n */\npublic:\n\n    explicit CScriptNum(const int64_t& n)\n    {\n        m_value = n;\n    }\n\n    static const size_t nDefaultMaxNumSize = 4;\n\n    explicit CScriptNum(const std::vector<unsigned char>& vch, bool fRequireMinimal,\n                        const size_t nMaxNumSize = nDefaultMaxNumSize)\n    {\n        if (vch.size() > nMaxNumSize) {\n            throw scriptnum_error(\"script number overflow\");\n        }\n        if (fRequireMinimal && vch.size() > 0) {\n            // Check that the number is encoded with the minimum possible\n            // number of bytes.\n            //\n            // If the most-significant-byte - excluding the sign bit - is zero\n            // then we're not minimal. Note how this test also rejects the\n            // negative-zero encoding, 0x80.\n            if ((vch.back() & 0x7f) == 0) {\n                // One exception: if there's more than one byte and the most\n                // significant bit of the second-most-significant-byte is set\n                // it would conflict with the sign bit. An example of this case\n                // is +-255, which encode to 0xff00 and 0xff80 respectively.\n                // (big-endian).\n                if (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0) {\n                    throw scriptnum_error(\"non-minimally encoded script number\");\n                }\n            }\n        }\n        m_value = set_vch(vch);\n    }\n\n    inline bool operator==(const int64_t& rhs) const    { return m_value == rhs; }\n    inline bool operator!=(const int64_t& rhs) const    { return m_value != rhs; }\n    inline bool operator<=(const int64_t& rhs) const    { return m_value <= rhs; }\n    inline bool operator< (const int64_t& rhs) const    { return m_value <  rhs; }\n    inline bool operator>=(const int64_t& rhs) const    { return m_value >= rhs; }\n    inline bool operator> (const int64_t& rhs) const    { return m_value >  rhs; }\n\n    inline bool operator==(const CScriptNum& rhs) const { return operator==(rhs.m_value); }\n    inline bool operator!=(const CScriptNum& rhs) const { return operator!=(rhs.m_value); }\n    inline bool operator<=(const CScriptNum& rhs) const { return operator<=(rhs.m_value); }\n    inline bool operator< (const CScriptNum& rhs) const { return operator< (rhs.m_value); }\n    inline bool operator>=(const CScriptNum& rhs) const { return operator>=(rhs.m_value); }\n    inline bool operator> (const CScriptNum& rhs) const { return operator> (rhs.m_value); }\n\n    inline CScriptNum operator+(   const int64_t& rhs)    const { return CScriptNum(m_value + rhs);}\n    inline CScriptNum operator-(   const int64_t& rhs)    const { return CScriptNum(m_value - rhs);}\n    inline CScriptNum operator+(   const CScriptNum& rhs) const { return operator+(rhs.m_value);   }\n    inline CScriptNum operator-(   const CScriptNum& rhs) const { return operator-(rhs.m_value);   }\n\n    inline CScriptNum& operator+=( const CScriptNum& rhs)       { return operator+=(rhs.m_value);  }\n    inline CScriptNum& operator-=( const CScriptNum& rhs)       { return operator-=(rhs.m_value);  }\n\n    inline CScriptNum operator&(   const int64_t& rhs)    const { return CScriptNum(m_value & rhs);}\n    inline CScriptNum operator&(   const CScriptNum& rhs) const { return operator&(rhs.m_value);   }\n\n    inline CScriptNum& operator&=( const CScriptNum& rhs)       { return operator&=(rhs.m_value);  }\n\n    inline CScriptNum operator-()                         const\n    {\n        assert(m_value != std::numeric_limits<int64_t>::min());\n        return CScriptNum(-m_value);\n    }\n\n    inline CScriptNum& operator=( const int64_t& rhs)\n    {\n        m_value = rhs;\n        return *this;\n    }\n\n    inline CScriptNum& operator+=( const int64_t& rhs)\n    {\n        assert(rhs == 0 || (rhs > 0 && m_value <= std::numeric_limits<int64_t>::max() - rhs) ||\n                           (rhs < 0 && m_value >= std::numeric_limits<int64_t>::min() - rhs));\n        m_value += rhs;\n        return *this;\n    }\n\n    inline CScriptNum& operator-=( const int64_t& rhs)\n    {\n        assert(rhs == 0 || (rhs > 0 && m_value >= std::numeric_limits<int64_t>::min() + rhs) ||\n                           (rhs < 0 && m_value <= std::numeric_limits<int64_t>::max() + rhs));\n        m_value -= rhs;\n        return *this;\n    }\n\n    inline CScriptNum& operator&=( const int64_t& rhs)\n    {\n        m_value &= rhs;\n        return *this;\n    }\n\n    int getint() const\n    {\n        if (m_value > std::numeric_limits<int>::max())\n            return std::numeric_limits<int>::max();\n        else if (m_value < std::numeric_limits<int>::min())\n            return std::numeric_limits<int>::min();\n        return m_value;\n    }\n\n    std::vector<unsigned char> getvch() const\n    {\n        return serialize(m_value);\n    }\n\n    static std::vector<unsigned char> serialize(const int64_t& value)\n    {\n        if(value == 0)\n            return std::vector<unsigned char>();\n\n        std::vector<unsigned char> result;\n        const bool neg = value < 0;\n        uint64_t absvalue = neg ? -value : value;\n\n        while(absvalue)\n        {\n            result.push_back(absvalue & 0xff);\n            absvalue >>= 8;\n        }\n\n//    - If the most significant byte is >= 0x80 and the value is positive, push a\n//    new zero-byte to make the significant byte < 0x80 again.\n\n//    - If the most significant byte is >= 0x80 and the value is negative, push a\n//    new 0x80 byte that will be popped off when converting to an integral.\n\n//    - If the most significant byte is < 0x80 and the value is negative, add\n//    0x80 to it, since it will be subtracted and interpreted as a negative when\n//    converting to an integral.\n\n        if (result.back() & 0x80)\n            result.push_back(neg ? 0x80 : 0);\n        else if (neg)\n            result.back() |= 0x80;\n\n        return result;\n    }\n\nprivate:\n    static int64_t set_vch(const std::vector<unsigned char>& vch)\n    {\n      if (vch.empty())\n          return 0;\n\n      int64_t result = 0;\n      for (size_t i = 0; i != vch.size(); ++i)\n          result |= static_cast<int64_t>(vch[i]) << 8*i;\n\n      // If the input vector's most significant byte is 0x80, remove it from\n      // the result's msb and return a negative.\n      if (vch.back() & 0x80)\n          return -((int64_t)(result & ~(0x80ULL << (8 * (vch.size() - 1)))));\n\n      return result;\n    }\n\n    int64_t m_value;\n};\n\n/**\n * We use a prevector for the script to reduce the considerable memory overhead\n *  of vectors in cases where they normally contain a small number of small elements.\n * Tests in October 2015 showed use of this reduced dbcache memory usage by 23%\n *  and made an initial sync 13% faster.\n */\ntypedef prevector<28, unsigned char> CScriptBase;\n\n/** Serialized script, used inside transaction inputs and outputs */\nclass CScript : public CScriptBase\n{\nprotected:\n    CScript& push_int64(int64_t n)\n    {\n        if (n == -1 || (n >= 1 && n <= 16))\n        {\n            push_back(n + (OP_1 - 1));\n        }\n        else if (n == 0)\n        {\n            push_back(OP_0);\n        }\n        else\n        {\n            *this << CScriptNum::serialize(n);\n        }\n        return *this;\n    }\npublic:\n    CScript() { }\n    CScript(const_iterator pbegin, const_iterator pend) : CScriptBase(pbegin, pend) { }\n    CScript(std::vector<unsigned char>::const_iterator pbegin, std::vector<unsigned char>::const_iterator pend) : CScriptBase(pbegin, pend) { }\n    CScript(const unsigned char* pbegin, const unsigned char* pend) : CScriptBase(pbegin, pend) { }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(static_cast<CScriptBase&>(*this));\n    }\n\n    CScript& operator+=(const CScript& b)\n    {\n        reserve(size() + b.size());\n        insert(end(), b.begin(), b.end());\n        return *this;\n    }\n\n    friend CScript operator+(const CScript& a, const CScript& b)\n    {\n        CScript ret = a;\n        ret += b;\n        return ret;\n    }\n\n    CScript(int64_t b)        { operator<<(b); }\n\n    explicit CScript(opcodetype b)     { operator<<(b); }\n    explicit CScript(const CScriptNum& b) { operator<<(b); }\n    explicit CScript(const std::vector<unsigned char>& b) { operator<<(b); }\n\n\n    CScript& operator<<(int64_t b) { return push_int64(b); }\n\n    CScript& operator<<(opcodetype opcode)\n    {\n        if (opcode < 0 || opcode > 0xff)\n            throw std::runtime_error(\"CScript::operator<<(): invalid opcode\");\n        insert(end(), (unsigned char)opcode);\n        return *this;\n    }\n\n    CScript& operator<<(const CScriptNum& b)\n    {\n        *this << b.getvch();\n        return *this;\n    }\n\n    CScript& operator<<(const std::vector<unsigned char>& b)\n    {\n        if (b.size() < OP_PUSHDATA1)\n        {\n            insert(end(), (unsigned char)b.size());\n        }\n        else if (b.size() <= 0xff)\n        {\n            insert(end(), OP_PUSHDATA1);\n            insert(end(), (unsigned char)b.size());\n        }\n        else if (b.size() <= 0xffff)\n        {\n            insert(end(), OP_PUSHDATA2);\n            uint8_t _data[2];\n            WriteLE16(_data, b.size());\n            insert(end(), _data, _data + sizeof(_data));\n        }\n        else\n        {\n            insert(end(), OP_PUSHDATA4);\n            uint8_t _data[4];\n            WriteLE32(_data, b.size());\n            insert(end(), _data, _data + sizeof(_data));\n        }\n        insert(end(), b.begin(), b.end());\n        return *this;\n    }\n\n    CScript& operator<<(const CScript& b)\n    {\n        // I'm not sure if this should push the script or concatenate scripts.\n        // If there's ever a use for pushing a script onto a script, delete this member fn\n        assert(!\"Warning: Pushing a CScript onto a CScript with << is probably not intended, use + to concatenate!\");\n        return *this;\n    }\n\n\n    bool GetOp(iterator& pc, opcodetype& opcodeRet, std::vector<unsigned char>& vchRet)\n    {\n         // Wrapper so it can be called with either iterator or const_iterator\n         const_iterator pc2 = pc;\n         bool fRet = GetOp2(pc2, opcodeRet, &vchRet);\n         pc = begin() + (pc2 - begin());\n         return fRet;\n    }\n\n    bool GetOp(iterator& pc, opcodetype& opcodeRet)\n    {\n         const_iterator pc2 = pc;\n         bool fRet = GetOp2(pc2, opcodeRet, nullptr);\n         pc = begin() + (pc2 - begin());\n         return fRet;\n    }\n\n    bool GetOp(const_iterator& pc, opcodetype& opcodeRet, std::vector<unsigned char>& vchRet) const\n    {\n        return GetOp2(pc, opcodeRet, &vchRet);\n    }\n\n    bool GetOp(const_iterator& pc, opcodetype& opcodeRet) const\n    {\n        return GetOp2(pc, opcodeRet, nullptr);\n    }\n\n    bool GetOp2(const_iterator& pc, opcodetype& opcodeRet, std::vector<unsigned char>* pvchRet) const\n    {\n        opcodeRet = OP_INVALIDOPCODE;\n        if (pvchRet)\n            pvchRet->clear();\n        if (pc >= end())\n            return false;\n\n        // Read instruction\n        if (end() - pc < 1)\n            return false;\n        unsigned int opcode = *pc++;\n\n        // Immediate operand\n        if (opcode <= OP_PUSHDATA4)\n        {\n            unsigned int nSize = 0;\n            if (opcode < OP_PUSHDATA1)\n            {\n                nSize = opcode;\n            }\n            else if (opcode == OP_PUSHDATA1)\n            {\n                if (end() - pc < 1)\n                    return false;\n                nSize = *pc++;\n            }\n            else if (opcode == OP_PUSHDATA2)\n            {\n                if (end() - pc < 2)\n                    return false;\n                nSize = ReadLE16(&pc[0]);\n                pc += 2;\n            }\n            else if (opcode == OP_PUSHDATA4)\n            {\n                if (end() - pc < 4)\n                    return false;\n                nSize = ReadLE32(&pc[0]);\n                pc += 4;\n            }\n            if (end() - pc < 0 || (unsigned int)(end() - pc) < nSize)\n                return false;\n            if (pvchRet)\n                pvchRet->assign(pc, pc + nSize);\n            pc += nSize;\n        }\n\n        opcodeRet = (opcodetype)opcode;\n        return true;\n    }\n\n    /** Encode/decode small integers: */\n    static int DecodeOP_N(opcodetype opcode)\n    {\n        if (opcode == OP_0)\n            return 0;\n        assert(opcode >= OP_1 && opcode <= OP_16);\n        return (int)opcode - (int)(OP_1 - 1);\n    }\n    static opcodetype EncodeOP_N(int n)\n    {\n        assert(n >= 0 && n <= 16);\n        if (n == 0)\n            return OP_0;\n        return (opcodetype)(OP_1+n-1);\n    }\n\n    int FindAndDelete(const CScript& b)\n    {\n        int nFound = 0;\n        if (b.empty())\n            return nFound;\n        CScript result;\n        iterator pc = begin(), pc2 = begin();\n        opcodetype opcode;\n        do\n        {\n            result.insert(result.end(), pc2, pc);\n            while (static_cast<size_t>(end() - pc) >= b.size() && std::equal(b.begin(), b.end(), pc))\n            {\n                pc = pc + b.size();\n                ++nFound;\n            }\n            pc2 = pc;\n        }\n        while (GetOp(pc, opcode));\n\n        if (nFound > 0) {\n            result.insert(result.end(), pc2, end());\n            *this = result;\n        }\n\n        return nFound;\n    }\n    int Find(opcodetype op) const\n    {\n        int nFound = 0;\n        opcodetype opcode;\n        for (const_iterator pc = begin(); pc != end() && GetOp(pc, opcode);)\n            if (opcode == op)\n                ++nFound;\n        return nFound;\n    }\n\n    /**\n     * Pre-version-0.6, Bitcoin always counted CHECKMULTISIGs\n     * as 20 sigops. With pay-to-script-hash, that changed:\n     * CHECKMULTISIGs serialized in scriptSigs are\n     * counted more accurately, assuming they are of the form\n     *  ... OP_N CHECKMULTISIG ...\n     */\n    unsigned int GetSigOpCount(bool fAccurate) const;\n\n    /**\n     * Accurately count sigOps, including sigOps in\n     * pay-to-script-hash transactions:\n     */\n    unsigned int GetSigOpCount(const CScript& scriptSig) const;\n\n    bool IsPayToScriptHash() const;\n    bool IsPayToWitnessScriptHash() const;\n    bool IsWitnessProgram(int& version, std::vector<unsigned char>& program) const;\n\n    /** Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). */\n    bool IsPushOnly(const_iterator pc) const;\n    bool IsPushOnly() const;\n\n    /** Check if the script contains valid OP_CODES */\n    bool HasValidOps() const;\n\n    /**\n     * Returns whether the script is guaranteed to fail at execution,\n     * regardless of the initial stack. This allows outputs to be pruned\n     * instantly when entering the UTXO set.\n     */\n    bool IsUnspendable() const\n    {\n        return (size() > 0 && *begin() == OP_RETURN) || (size() > MAX_SCRIPT_SIZE);\n    }\n\n    void clear()\n    {\n        // The default prevector::clear() does not release memory\n        CScriptBase::clear();\n        shrink_to_fit();\n    }\n};\n\nstruct CScriptWitness\n{\n    // Note that this encodes the data elements being pushed, rather than\n    // encoding them as a CScript that pushes them.\n    std::vector<std::vector<unsigned char> > stack;\n\n    // Some compilers complain without a default constructor\n    CScriptWitness() { }\n\n    bool IsNull() const { return stack.empty(); }\n\n    void SetNull() { stack.clear(); stack.shrink_to_fit(); }\n\n    std::string ToString() const;\n};\n\nclass CReserveScript\n{\npublic:\n    CScript reserveScript;\n    virtual void KeepScript() {}\n    CReserveScript() {}\n    virtual ~CReserveScript() {}\n};\n\n#endif // BITCOIN_SCRIPT_SCRIPT_H\n"
  },
  {
    "path": "src/script/script_error.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <script/script_error.h>\n\nconst char* ScriptErrorString(const ScriptError serror)\n{\n    switch (serror)\n    {\n        case SCRIPT_ERR_OK:\n            return \"No error\";\n        case SCRIPT_ERR_EVAL_FALSE:\n            return \"Script evaluated without error but finished with a false/empty top stack element\";\n        case SCRIPT_ERR_VERIFY:\n            return \"Script failed an OP_VERIFY operation\";\n        case SCRIPT_ERR_EQUALVERIFY:\n            return \"Script failed an OP_EQUALVERIFY operation\";\n        case SCRIPT_ERR_CHECKMULTISIGVERIFY:\n            return \"Script failed an OP_CHECKMULTISIGVERIFY operation\";\n        case SCRIPT_ERR_CHECKSIGVERIFY:\n            return \"Script failed an OP_CHECKSIGVERIFY operation\";\n        case SCRIPT_ERR_NUMEQUALVERIFY:\n            return \"Script failed an OP_NUMEQUALVERIFY operation\";\n        case SCRIPT_ERR_SCRIPT_SIZE:\n            return \"Script is too big\";\n        case SCRIPT_ERR_PUSH_SIZE:\n            return \"Push value size limit exceeded\";\n        case SCRIPT_ERR_OP_COUNT:\n            return \"Operation limit exceeded\";\n        case SCRIPT_ERR_STACK_SIZE:\n            return \"Stack size limit exceeded\";\n        case SCRIPT_ERR_SIG_COUNT:\n            return \"Signature count negative or greater than pubkey count\";\n        case SCRIPT_ERR_PUBKEY_COUNT:\n            return \"Pubkey count negative or limit exceeded\";\n        case SCRIPT_ERR_BAD_OPCODE:\n            return \"Opcode missing or not understood\";\n        case SCRIPT_ERR_DISABLED_OPCODE:\n            return \"Attempted to use a disabled opcode\";\n        case SCRIPT_ERR_INVALID_STACK_OPERATION:\n            return \"Operation not valid with the current stack size\";\n        case SCRIPT_ERR_INVALID_ALTSTACK_OPERATION:\n            return \"Operation not valid with the current altstack size\";\n        case SCRIPT_ERR_OP_RETURN:\n            return \"OP_RETURN was encountered\";\n        case SCRIPT_ERR_UNBALANCED_CONDITIONAL:\n            return \"Invalid OP_IF construction\";\n        case SCRIPT_ERR_NEGATIVE_LOCKTIME:\n            return \"Negative locktime\";\n        case SCRIPT_ERR_UNSATISFIED_LOCKTIME:\n            return \"Locktime requirement not satisfied\";\n        case SCRIPT_ERR_SIG_HASHTYPE:\n            return \"Signature hash type missing or not understood\";\n        case SCRIPT_ERR_SIG_DER:\n            return \"Non-canonical DER signature\";\n        case SCRIPT_ERR_MINIMALDATA:\n            return \"Data push larger than necessary\";\n        case SCRIPT_ERR_SIG_PUSHONLY:\n            return \"Only non-push operators allowed in signatures\";\n        case SCRIPT_ERR_SIG_HIGH_S:\n            return \"Non-canonical signature: S value is unnecessarily high\";\n        case SCRIPT_ERR_SIG_NULLDUMMY:\n            return \"Dummy CHECKMULTISIG argument must be zero\";\n        case SCRIPT_ERR_MINIMALIF:\n            return \"OP_IF/NOTIF argument must be minimal\";\n        case SCRIPT_ERR_SIG_NULLFAIL:\n            return \"Signature must be zero for failed CHECK(MULTI)SIG operation\";\n        case SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS:\n            return \"NOPx reserved for soft-fork upgrades\";\n        case SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM:\n            return \"Witness version reserved for soft-fork upgrades\";\n        case SCRIPT_ERR_PUBKEYTYPE:\n            return \"Public key is neither compressed or uncompressed\";\n        case SCRIPT_ERR_CLEANSTACK:\n            return \"Extra items left on stack after execution\";\n        case SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH:\n            return \"Witness program has incorrect length\";\n        case SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY:\n            return \"Witness program was passed an empty witness\";\n        case SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH:\n            return \"Witness program hash mismatch\";\n        case SCRIPT_ERR_WITNESS_MALLEATED:\n            return \"Witness requires empty scriptSig\";\n        case SCRIPT_ERR_WITNESS_MALLEATED_P2SH:\n            return \"Witness requires only-redeemscript scriptSig\";\n        case SCRIPT_ERR_WITNESS_UNEXPECTED:\n            return \"Witness provided for non-witness script\";\n        case SCRIPT_ERR_WITNESS_PUBKEYTYPE:\n            return \"Using non-compressed keys in segwit\";\n        case SCRIPT_ERR_OP_CODESEPARATOR:\n            return \"Using OP_CODESEPARATOR in non-witness script\";\n        case SCRIPT_ERR_SIG_FINDANDDELETE:\n            return \"Signature is found in scriptCode\";\n        case SCRIPT_ERR_UNKNOWN_ERROR:\n        case SCRIPT_ERR_ERROR_COUNT:\n        default: break;\n    }\n    return \"unknown error\";\n}\n"
  },
  {
    "path": "src/script/script_error.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SCRIPT_SCRIPT_ERROR_H\n#define BITCOIN_SCRIPT_SCRIPT_ERROR_H\n\ntypedef enum ScriptError_t\n{\n    SCRIPT_ERR_OK = 0,\n    SCRIPT_ERR_UNKNOWN_ERROR,\n    SCRIPT_ERR_EVAL_FALSE,\n    SCRIPT_ERR_OP_RETURN,\n\n    /* Max sizes */\n    SCRIPT_ERR_SCRIPT_SIZE,\n    SCRIPT_ERR_PUSH_SIZE,\n    SCRIPT_ERR_OP_COUNT,\n    SCRIPT_ERR_STACK_SIZE,\n    SCRIPT_ERR_SIG_COUNT,\n    SCRIPT_ERR_PUBKEY_COUNT,\n\n    /* Failed verify operations */\n    SCRIPT_ERR_VERIFY,\n    SCRIPT_ERR_EQUALVERIFY,\n    SCRIPT_ERR_CHECKMULTISIGVERIFY,\n    SCRIPT_ERR_CHECKSIGVERIFY,\n    SCRIPT_ERR_NUMEQUALVERIFY,\n\n    /* Logical/Format/Canonical errors */\n    SCRIPT_ERR_BAD_OPCODE,\n    SCRIPT_ERR_DISABLED_OPCODE,\n    SCRIPT_ERR_INVALID_STACK_OPERATION,\n    SCRIPT_ERR_INVALID_ALTSTACK_OPERATION,\n    SCRIPT_ERR_UNBALANCED_CONDITIONAL,\n\n    /* CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY */\n    SCRIPT_ERR_NEGATIVE_LOCKTIME,\n    SCRIPT_ERR_UNSATISFIED_LOCKTIME,\n\n    /* Malleability */\n    SCRIPT_ERR_SIG_HASHTYPE,\n    SCRIPT_ERR_SIG_DER,\n    SCRIPT_ERR_MINIMALDATA,\n    SCRIPT_ERR_SIG_PUSHONLY,\n    SCRIPT_ERR_SIG_HIGH_S,\n    SCRIPT_ERR_SIG_NULLDUMMY,\n    SCRIPT_ERR_PUBKEYTYPE,\n    SCRIPT_ERR_CLEANSTACK,\n    SCRIPT_ERR_MINIMALIF,\n    SCRIPT_ERR_SIG_NULLFAIL,\n\n    /* softfork safeness */\n    SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS,\n    SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,\n\n    /* segregated witness */\n    SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH,\n    SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY,\n    SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH,\n    SCRIPT_ERR_WITNESS_MALLEATED,\n    SCRIPT_ERR_WITNESS_MALLEATED_P2SH,\n    SCRIPT_ERR_WITNESS_UNEXPECTED,\n    SCRIPT_ERR_WITNESS_PUBKEYTYPE,\n\n    /* Constant scriptCode */\n    SCRIPT_ERR_OP_CODESEPARATOR,\n    SCRIPT_ERR_SIG_FINDANDDELETE,\n\n    SCRIPT_ERR_ERROR_COUNT\n} ScriptError;\n\n#define SCRIPT_ERR_LAST SCRIPT_ERR_ERROR_COUNT\n\nconst char* ScriptErrorString(const ScriptError error);\n\n#endif // BITCOIN_SCRIPT_SCRIPT_ERROR_H\n"
  },
  {
    "path": "src/script/sigcache.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <script/sigcache.h>\n\n#include <memusage.h>\n#include <pubkey.h>\n#include <random.h>\n#include <uint256.h>\n#include <util.h>\n\n#include <cuckoocache.h>\n#include <boost/thread.hpp>\n\nnamespace {\n/**\n * Valid signature cache, to avoid doing expensive ECDSA signature checking\n * twice for every transaction (once when accepted into memory pool, and\n * again when accepted into the block chain)\n */\nclass CSignatureCache\n{\nprivate:\n     //! Entries are SHA256(nonce || signature hash || public key || signature):\n    uint256 nonce;\n    typedef CuckooCache::cache<uint256, SignatureCacheHasher> map_type;\n    map_type setValid;\n    boost::shared_mutex cs_sigcache;\n\npublic:\n    CSignatureCache()\n    {\n        GetRandBytes(nonce.begin(), 32);\n    }\n\n    void\n    ComputeEntry(uint256& entry, const uint256 &hash, const std::vector<unsigned char>& vchSig, const CPubKey& pubkey)\n    {\n        CSHA256().Write(nonce.begin(), 32).Write(hash.begin(), 32).Write(&pubkey[0], pubkey.size()).Write(&vchSig[0], vchSig.size()).Finalize(entry.begin());\n    }\n\n    bool\n    Get(const uint256& entry, const bool erase)\n    {\n        boost::shared_lock<boost::shared_mutex> lock(cs_sigcache);\n        return setValid.contains(entry, erase);\n    }\n\n    void Set(uint256& entry)\n    {\n        boost::unique_lock<boost::shared_mutex> lock(cs_sigcache);\n        setValid.insert(entry);\n    }\n    uint32_t setup_bytes(size_t n)\n    {\n        return setValid.setup_bytes(n);\n    }\n};\n\n/* In previous versions of this code, signatureCache was a local static variable\n * in CachingTransactionSignatureChecker::VerifySignature.  We initialize\n * signatureCache outside of VerifySignature to avoid the atomic operation per\n * call overhead associated with local static variables even though\n * signatureCache could be made local to VerifySignature.\n*/\nstatic CSignatureCache signatureCache;\n} // namespace\n\n// To be called once in AppInitMain/BasicTestingSetup to initialize the\n// signatureCache.\nvoid InitSignatureCache()\n{\n    // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero,\n    // setup_bytes creates the minimum possible cache (2 elements).\n    size_t nMaxCacheSize = std::min(std::max((int64_t)0, gArgs.GetArg(\"-maxsigcachesize\", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20);\n    size_t nElems = signatureCache.setup_bytes(nMaxCacheSize);\n    LogPrintf(\"Using %zu MiB out of %zu/2 requested for signature cache, able to store %zu elements\\n\",\n            (nElems*sizeof(uint256)) >>20, (nMaxCacheSize*2)>>20, nElems);\n}\n\nbool CachingTransactionSignatureChecker::VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& pubkey, const uint256& sighash) const\n{\n    uint256 entry;\n    signatureCache.ComputeEntry(entry, sighash, vchSig, pubkey);\n    if (signatureCache.Get(entry, !store))\n        return true;\n    if (!TransactionSignatureChecker::VerifySignature(vchSig, pubkey, sighash))\n        return false;\n    if (store)\n        signatureCache.Set(entry);\n    return true;\n}\n"
  },
  {
    "path": "src/script/sigcache.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SCRIPT_SIGCACHE_H\n#define BITCOIN_SCRIPT_SIGCACHE_H\n\n#include <script/interpreter.h>\n\n#include <vector>\n\n// DoS prevention: limit cache size to 32MB (over 1000000 entries on 64-bit\n// systems). Due to how we count cache size, actual memory usage is slightly\n// more (~32.25 MB)\nstatic const unsigned int DEFAULT_MAX_SIG_CACHE_SIZE = 32;\n// Maximum sig cache size allowed\nstatic const int64_t MAX_MAX_SIG_CACHE_SIZE = 16384;\n\nclass CPubKey;\n\n/**\n * We're hashing a nonce into the entries themselves, so we don't need extra\n * blinding in the set hash computation.\n *\n * This may exhibit platform endian dependent behavior but because these are\n * nonced hashes (random) and this state is only ever used locally it is safe.\n * All that matters is local consistency.\n */\nclass SignatureCacheHasher\n{\npublic:\n    template <uint8_t hash_select>\n    uint32_t operator()(const uint256& key) const\n    {\n        static_assert(hash_select <8, \"SignatureCacheHasher only has 8 hashes available.\");\n        uint32_t u;\n        std::memcpy(&u, key.begin()+4*hash_select, 4);\n        return u;\n    }\n};\n\nclass CachingTransactionSignatureChecker : public TransactionSignatureChecker\n{\nprivate:\n    bool store;\n\npublic:\n    CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, bool storeIn, PrecomputedTransactionData& txdataIn) : TransactionSignatureChecker(txToIn, nInIn, amountIn, txdataIn), store(storeIn) {}\n\n    bool VerifySignature(const std::vector<unsigned char>& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const override;\n};\n\nvoid InitSignatureCache();\n\n#endif // BITCOIN_SCRIPT_SIGCACHE_H\n"
  },
  {
    "path": "src/script/sign.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <script/sign.h>\n\n#include <key.h>\n#include <keystore.h>\n#include <policy/policy.h>\n#include <primitives/transaction.h>\n#include <script/standard.h>\n#include <uint256.h>\n\n\ntypedef std::vector<unsigned char> valtype;\n\nTransactionSignatureCreator::TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, int nHashTypeIn) : BaseSignatureCreator(keystoreIn), txTo(txToIn), nIn(nInIn), nHashType(nHashTypeIn), amount(amountIn), checker(txTo, nIn, amountIn) {}\n\nbool TransactionSignatureCreator::CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& address, const CScript& scriptCode, SigVersion sigversion) const\n{\n    CKey key;\n    if (!keystore->GetKey(address, key))\n        return false;\n\n    // Signing with uncompressed keys is disabled in witness scripts\n    if (sigversion == SIGVERSION_WITNESS_V0 && !key.IsCompressed())\n        return false;\n\n    uint256 hash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, sigversion);\n    if (!key.Sign(hash, vchSig))\n        return false;\n    vchSig.push_back((unsigned char)nHashType);\n    return true;\n}\n\nstatic bool Sign1(const CKeyID& address, const BaseSignatureCreator& creator, const CScript& scriptCode, std::vector<valtype>& ret, SigVersion sigversion)\n{\n    std::vector<unsigned char> vchSig;\n    if (!creator.CreateSig(vchSig, address, scriptCode, sigversion))\n        return false;\n    ret.push_back(vchSig);\n    return true;\n}\n\nstatic bool SignN(const std::vector<valtype>& multisigdata, const BaseSignatureCreator& creator, const CScript& scriptCode, std::vector<valtype>& ret, SigVersion sigversion)\n{\n    int nSigned = 0;\n    int nRequired = multisigdata.front()[0];\n    for (unsigned int i = 1; i < multisigdata.size()-1 && nSigned < nRequired; i++)\n    {\n        const valtype& pubkey = multisigdata[i];\n        CKeyID keyID = CPubKey(pubkey).GetID();\n        if (Sign1(keyID, creator, scriptCode, ret, sigversion))\n            ++nSigned;\n    }\n    return nSigned==nRequired;\n}\n\n/**\n * Sign scriptPubKey using signature made with creator.\n * Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed),\n * unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script.\n * Returns false if scriptPubKey could not be completely satisfied.\n */\nstatic bool SignStep(const BaseSignatureCreator& creator, const CScript& scriptPubKey,\n                     std::vector<valtype>& ret, txnouttype& whichTypeRet, SigVersion sigversion)\n{\n    CScript scriptRet;\n    uint160 h160;\n    ret.clear();\n\n    std::vector<valtype> vSolutions;\n    if (!Solver(scriptPubKey, whichTypeRet, vSolutions))\n        return false;\n\n    CKeyID keyID;\n    switch (whichTypeRet)\n    {\n    case TX_NONSTANDARD:\n    case TX_NULL_DATA:\n    case TX_WITNESS_UNKNOWN:\n        return false;\n    case TX_PUBKEY:\n        keyID = CPubKey(vSolutions[0]).GetID();\n        return Sign1(keyID, creator, scriptPubKey, ret, sigversion);\n    case TX_PUBKEYHASH:\n        keyID = CKeyID(uint160(vSolutions[0]));\n        if (!Sign1(keyID, creator, scriptPubKey, ret, sigversion))\n            return false;\n        else\n        {\n            CPubKey vch;\n            creator.KeyStore().GetPubKey(keyID, vch);\n            ret.push_back(ToByteVector(vch));\n        }\n        return true;\n    case TX_SCRIPTHASH:\n        if (creator.KeyStore().GetCScript(uint160(vSolutions[0]), scriptRet)) {\n            ret.push_back(std::vector<unsigned char>(scriptRet.begin(), scriptRet.end()));\n            return true;\n        }\n        return false;\n\n    case TX_MULTISIG:\n        ret.push_back(valtype()); // workaround CHECKMULTISIG bug\n        return (SignN(vSolutions, creator, scriptPubKey, ret, sigversion));\n\n    case TX_WITNESS_V0_KEYHASH:\n        ret.push_back(vSolutions[0]);\n        return true;\n\n    case TX_WITNESS_V0_SCRIPTHASH:\n        CRIPEMD160().Write(&vSolutions[0][0], vSolutions[0].size()).Finalize(h160.begin());\n        if (creator.KeyStore().GetCScript(h160, scriptRet)) {\n            ret.push_back(std::vector<unsigned char>(scriptRet.begin(), scriptRet.end()));\n            return true;\n        }\n        return false;\n\n    default:\n        return false;\n    }\n}\n\nstatic CScript PushAll(const std::vector<valtype>& values)\n{\n    CScript result;\n    for (const valtype& v : values) {\n        if (v.size() == 0) {\n            result << OP_0;\n        } else if (v.size() == 1 && v[0] >= 1 && v[0] <= 16) {\n            result << CScript::EncodeOP_N(v[0]);\n        } else {\n            result << v;\n        }\n    }\n    return result;\n}\n\nbool ProduceSignature(const BaseSignatureCreator& creator, const CScript& fromPubKey, SignatureData& sigdata)\n{\n    CScript script = fromPubKey;\n    std::vector<valtype> result;\n    txnouttype whichType;\n    bool solved = SignStep(creator, script, result, whichType, SIGVERSION_BASE);\n    bool P2SH = false;\n    CScript subscript;\n    sigdata.scriptWitness.stack.clear();\n\n    if (solved && whichType == TX_SCRIPTHASH)\n    {\n        // Solver returns the subscript that needs to be evaluated;\n        // the final scriptSig is the signatures from that\n        // and then the serialized subscript:\n        script = subscript = CScript(result[0].begin(), result[0].end());\n        solved = solved && SignStep(creator, script, result, whichType, SIGVERSION_BASE) && whichType != TX_SCRIPTHASH;\n        P2SH = true;\n    }\n\n    if (solved && whichType == TX_WITNESS_V0_KEYHASH)\n    {\n        CScript witnessscript;\n        witnessscript << OP_DUP << OP_HASH160 << ToByteVector(result[0]) << OP_EQUALVERIFY << OP_CHECKSIG;\n        txnouttype subType;\n        solved = solved && SignStep(creator, witnessscript, result, subType, SIGVERSION_WITNESS_V0);\n        sigdata.scriptWitness.stack = result;\n        result.clear();\n    }\n    else if (solved && whichType == TX_WITNESS_V0_SCRIPTHASH)\n    {\n        CScript witnessscript(result[0].begin(), result[0].end());\n        txnouttype subType;\n        solved = solved && SignStep(creator, witnessscript, result, subType, SIGVERSION_WITNESS_V0) && subType != TX_SCRIPTHASH && subType != TX_WITNESS_V0_SCRIPTHASH && subType != TX_WITNESS_V0_KEYHASH;\n        result.push_back(std::vector<unsigned char>(witnessscript.begin(), witnessscript.end()));\n        sigdata.scriptWitness.stack = result;\n        result.clear();\n    }\n\n    if (P2SH) {\n        result.push_back(std::vector<unsigned char>(subscript.begin(), subscript.end()));\n    }\n    sigdata.scriptSig = PushAll(result);\n\n    // Test solution\n    return solved && VerifyScript(sigdata.scriptSig, fromPubKey, &sigdata.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, creator.Checker());\n}\n\nSignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nIn)\n{\n    SignatureData data;\n    assert(tx.vin.size() > nIn);\n    data.scriptSig = tx.vin[nIn].scriptSig;\n    data.scriptWitness = tx.vin[nIn].scriptWitness;\n    return data;\n}\n\nvoid UpdateTransaction(CMutableTransaction& tx, unsigned int nIn, const SignatureData& data)\n{\n    assert(tx.vin.size() > nIn);\n    tx.vin[nIn].scriptSig = data.scriptSig;\n    tx.vin[nIn].scriptWitness = data.scriptWitness;\n}\n\nbool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, const CAmount& amount, int nHashType)\n{\n    assert(nIn < txTo.vin.size());\n\n    CTransaction txToConst(txTo);\n    TransactionSignatureCreator creator(&keystore, &txToConst, nIn, amount, nHashType);\n\n    SignatureData sigdata;\n    bool ret = ProduceSignature(creator, fromPubKey, sigdata);\n    UpdateTransaction(txTo, nIn, sigdata);\n    return ret;\n}\n\nbool SignSignature(const CKeyStore &keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType)\n{\n    assert(nIn < txTo.vin.size());\n    CTxIn& txin = txTo.vin[nIn];\n    assert(txin.prevout.n < txFrom.vout.size());\n    const CTxOut& txout = txFrom.vout[txin.prevout.n];\n\n    return SignSignature(keystore, txout.scriptPubKey, txTo, nIn, txout.nValue, nHashType);\n}\n\nstatic std::vector<valtype> CombineMultisig(const CScript& scriptPubKey, const BaseSignatureChecker& checker,\n                               const std::vector<valtype>& vSolutions,\n                               const std::vector<valtype>& sigs1, const std::vector<valtype>& sigs2, SigVersion sigversion)\n{\n    // Combine all the signatures we've got:\n    std::set<valtype> allsigs;\n    for (const valtype& v : sigs1)\n    {\n        if (!v.empty())\n            allsigs.insert(v);\n    }\n    for (const valtype& v : sigs2)\n    {\n        if (!v.empty())\n            allsigs.insert(v);\n    }\n\n    // Build a map of pubkey -> signature by matching sigs to pubkeys:\n    assert(vSolutions.size() > 1);\n    unsigned int nSigsRequired = vSolutions.front()[0];\n    unsigned int nPubKeys = vSolutions.size()-2;\n    std::map<valtype, valtype> sigs;\n    for (const valtype& sig : allsigs)\n    {\n        for (unsigned int i = 0; i < nPubKeys; i++)\n        {\n            const valtype& pubkey = vSolutions[i+1];\n            if (sigs.count(pubkey))\n                continue; // Already got a sig for this pubkey\n\n            if (checker.CheckSig(sig, pubkey, scriptPubKey, sigversion))\n            {\n                sigs[pubkey] = sig;\n                break;\n            }\n        }\n    }\n    // Now build a merged CScript:\n    unsigned int nSigsHave = 0;\n    std::vector<valtype> result; result.push_back(valtype()); // pop-one-too-many workaround\n    for (unsigned int i = 0; i < nPubKeys && nSigsHave < nSigsRequired; i++)\n    {\n        if (sigs.count(vSolutions[i+1]))\n        {\n            result.push_back(sigs[vSolutions[i+1]]);\n            ++nSigsHave;\n        }\n    }\n    // Fill any missing with OP_0:\n    for (unsigned int i = nSigsHave; i < nSigsRequired; i++)\n        result.push_back(valtype());\n\n    return result;\n}\n\nnamespace\n{\nstruct Stacks\n{\n    std::vector<valtype> script;\n    std::vector<valtype> witness;\n\n    Stacks() {}\n    explicit Stacks(const std::vector<valtype>& scriptSigStack_) : script(scriptSigStack_), witness() {}\n    explicit Stacks(const SignatureData& data) : witness(data.scriptWitness.stack) {\n        EvalScript(script, data.scriptSig, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker(), SIGVERSION_BASE);\n    }\n\n    SignatureData Output() const {\n        SignatureData result;\n        result.scriptSig = PushAll(script);\n        result.scriptWitness.stack = witness;\n        return result;\n    }\n};\n}\n\nstatic Stacks CombineSignatures(const CScript& scriptPubKey, const BaseSignatureChecker& checker,\n                                 const txnouttype txType, const std::vector<valtype>& vSolutions,\n                                 Stacks sigs1, Stacks sigs2, SigVersion sigversion)\n{\n    switch (txType)\n    {\n    case TX_NONSTANDARD:\n    case TX_NULL_DATA:\n    case TX_WITNESS_UNKNOWN:\n        // Don't know anything about this, assume bigger one is correct:\n        if (sigs1.script.size() >= sigs2.script.size())\n            return sigs1;\n        return sigs2;\n    case TX_PUBKEY:\n    case TX_PUBKEYHASH:\n        // Signatures are bigger than placeholders or empty scripts:\n        if (sigs1.script.empty() || sigs1.script[0].empty())\n            return sigs2;\n        return sigs1;\n    case TX_WITNESS_V0_KEYHASH:\n        // Signatures are bigger than placeholders or empty scripts:\n        if (sigs1.witness.empty() || sigs1.witness[0].empty())\n            return sigs2;\n        return sigs1;\n    case TX_SCRIPTHASH:\n        if (sigs1.script.empty() || sigs1.script.back().empty())\n            return sigs2;\n        else if (sigs2.script.empty() || sigs2.script.back().empty())\n            return sigs1;\n        else\n        {\n            // Recur to combine:\n            valtype spk = sigs1.script.back();\n            CScript pubKey2(spk.begin(), spk.end());\n\n            txnouttype txType2;\n            std::vector<std::vector<unsigned char> > vSolutions2;\n            Solver(pubKey2, txType2, vSolutions2);\n            sigs1.script.pop_back();\n            sigs2.script.pop_back();\n            Stacks result = CombineSignatures(pubKey2, checker, txType2, vSolutions2, sigs1, sigs2, sigversion);\n            result.script.push_back(spk);\n            return result;\n        }\n    case TX_MULTISIG:\n        return Stacks(CombineMultisig(scriptPubKey, checker, vSolutions, sigs1.script, sigs2.script, sigversion));\n    case TX_WITNESS_V0_SCRIPTHASH:\n        if (sigs1.witness.empty() || sigs1.witness.back().empty())\n            return sigs2;\n        else if (sigs2.witness.empty() || sigs2.witness.back().empty())\n            return sigs1;\n        else\n        {\n            // Recur to combine:\n            CScript pubKey2(sigs1.witness.back().begin(), sigs1.witness.back().end());\n            txnouttype txType2;\n            std::vector<valtype> vSolutions2;\n            Solver(pubKey2, txType2, vSolutions2);\n            sigs1.witness.pop_back();\n            sigs1.script = sigs1.witness;\n            sigs1.witness.clear();\n            sigs2.witness.pop_back();\n            sigs2.script = sigs2.witness;\n            sigs2.witness.clear();\n            Stacks result = CombineSignatures(pubKey2, checker, txType2, vSolutions2, sigs1, sigs2, SIGVERSION_WITNESS_V0);\n            result.witness = result.script;\n            result.script.clear();\n            result.witness.push_back(valtype(pubKey2.begin(), pubKey2.end()));\n            return result;\n        }\n    default:\n        return Stacks();\n    }\n}\n\nSignatureData CombineSignatures(const CScript& scriptPubKey, const BaseSignatureChecker& checker,\n                          const SignatureData& scriptSig1, const SignatureData& scriptSig2)\n{\n    txnouttype txType;\n    std::vector<std::vector<unsigned char> > vSolutions;\n    Solver(scriptPubKey, txType, vSolutions);\n\n    return CombineSignatures(scriptPubKey, checker, txType, vSolutions, Stacks(scriptSig1), Stacks(scriptSig2), SIGVERSION_BASE).Output();\n}\n\nnamespace {\n/** Dummy signature checker which accepts all signatures. */\nclass DummySignatureChecker : public BaseSignatureChecker\n{\npublic:\n    DummySignatureChecker() {}\n\n    bool CheckSig(const std::vector<unsigned char>& scriptSig, const std::vector<unsigned char>& vchPubKey, const CScript& scriptCode, SigVersion sigversion) const override\n    {\n        return true;\n    }\n};\nconst DummySignatureChecker dummyChecker;\n} // namespace\n\nconst BaseSignatureChecker& DummySignatureCreator::Checker() const\n{\n    return dummyChecker;\n}\n\nbool DummySignatureCreator::CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const\n{\n    // Create a dummy signature that is a valid DER-encoding\n    vchSig.assign(72, '\\000');\n    vchSig[0] = 0x30;\n    vchSig[1] = 69;\n    vchSig[2] = 0x02;\n    vchSig[3] = 33;\n    vchSig[4] = 0x01;\n    vchSig[4 + 33] = 0x02;\n    vchSig[5 + 33] = 32;\n    vchSig[6 + 33] = 0x01;\n    vchSig[6 + 33 + 32] = SIGHASH_ALL;\n    return true;\n}\n\nbool IsSolvable(const CKeyStore& store, const CScript& script)\n{\n    // This check is to make sure that the script we created can actually be solved for and signed by us\n    // if we were to have the private keys. This is just to make sure that the script is valid and that,\n    // if found in a transaction, we would still accept and relay that transaction. In particular,\n    // it will reject witness outputs that require signing with an uncompressed public key.\n    DummySignatureCreator creator(&store);\n    SignatureData sigs;\n    // Make sure that STANDARD_SCRIPT_VERIFY_FLAGS includes SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, the most\n    // important property this function is designed to test for.\n    static_assert(STANDARD_SCRIPT_VERIFY_FLAGS & SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, \"IsSolvable requires standard script flags to include WITNESS_PUBKEYTYPE\");\n    if (ProduceSignature(creator, script, sigs)) {\n        // VerifyScript check is just defensive, and should never fail.\n        assert(VerifyScript(sigs.scriptSig, script, &sigs.scriptWitness, STANDARD_SCRIPT_VERIFY_FLAGS, creator.Checker()));\n        return true;\n    }\n    return false;\n}\n"
  },
  {
    "path": "src/script/sign.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SCRIPT_SIGN_H\n#define BITCOIN_SCRIPT_SIGN_H\n\n#include <script/interpreter.h>\n\nclass CKeyID;\nclass CKeyStore;\nclass CScript;\nclass CTransaction;\n\nstruct CMutableTransaction;\n\n/** Virtual base class for signature creators. */\nclass BaseSignatureCreator {\nprotected:\n    const CKeyStore* keystore;\n\npublic:\n    explicit BaseSignatureCreator(const CKeyStore* keystoreIn) : keystore(keystoreIn) {}\n    const CKeyStore& KeyStore() const { return *keystore; };\n    virtual ~BaseSignatureCreator() {}\n    virtual const BaseSignatureChecker& Checker() const =0;\n\n    /** Create a singular (non-script) signature. */\n    virtual bool CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const =0;\n};\n\n/** A signature creator for transactions. */\nclass TransactionSignatureCreator : public BaseSignatureCreator {\n    const CTransaction* txTo;\n    unsigned int nIn;\n    int nHashType;\n    CAmount amount;\n    const TransactionSignatureChecker checker;\n\npublic:\n    TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, int nHashTypeIn=SIGHASH_ALL);\n    const BaseSignatureChecker& Checker() const override { return checker; }\n    bool CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const override;\n};\n\nclass MutableTransactionSignatureCreator : public TransactionSignatureCreator {\n    CTransaction tx;\n\npublic:\n    MutableTransactionSignatureCreator(const CKeyStore* keystoreIn, const CMutableTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, int nHashTypeIn) : TransactionSignatureCreator(keystoreIn, &tx, nInIn, amountIn, nHashTypeIn), tx(*txToIn) {}\n};\n\n/** A signature creator that just produces 72-byte empty signatures. */\nclass DummySignatureCreator : public BaseSignatureCreator {\npublic:\n    explicit DummySignatureCreator(const CKeyStore* keystoreIn) : BaseSignatureCreator(keystoreIn) {}\n    const BaseSignatureChecker& Checker() const override;\n    bool CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& keyid, const CScript& scriptCode, SigVersion sigversion) const override;\n};\n\nstruct SignatureData {\n    CScript scriptSig;\n    CScriptWitness scriptWitness;\n\n    SignatureData() {}\n    explicit SignatureData(const CScript& script) : scriptSig(script) {}\n};\n\n/** Produce a script signature using a generic signature creator. */\nbool ProduceSignature(const BaseSignatureCreator& creator, const CScript& scriptPubKey, SignatureData& sigdata);\n\n/** Produce a script signature for a transaction. */\nbool SignSignature(const CKeyStore &keystore, const CScript& fromPubKey, CMutableTransaction& txTo, unsigned int nIn, const CAmount& amount, int nHashType);\nbool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutableTransaction& txTo, unsigned int nIn, int nHashType);\n\n/** Combine two script signatures using a generic signature checker, intelligently, possibly with OP_0 placeholders. */\nSignatureData CombineSignatures(const CScript& scriptPubKey, const BaseSignatureChecker& checker, const SignatureData& scriptSig1, const SignatureData& scriptSig2);\n\n/** Extract signature data from a transaction, and insert it. */\nSignatureData DataFromTransaction(const CMutableTransaction& tx, unsigned int nIn);\nvoid UpdateTransaction(CMutableTransaction& tx, unsigned int nIn, const SignatureData& data);\n\n/* Check whether we know how to sign for an output like this, assuming we\n * have all private keys. While this function does not need private keys, the passed\n * keystore is used to look up public keys and redeemscripts by hash.\n * Solvability is unrelated to whether we consider this output to be ours. */\nbool IsSolvable(const CKeyStore& store, const CScript& script);\n\n#endif // BITCOIN_SCRIPT_SIGN_H\n"
  },
  {
    "path": "src/script/standard.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <script/standard.h>\n\n#include <pubkey.h>\n#include <script/script.h>\n#include <util.h>\n#include <utilstrencodings.h>\n\n\ntypedef std::vector<unsigned char> valtype;\n\nbool fAcceptDatacarrier = DEFAULT_ACCEPT_DATACARRIER;\nunsigned nMaxDatacarrierBytes = MAX_OP_RETURN_RELAY;\n\nCScriptID::CScriptID(const CScript& in) : uint160(Hash160(in.begin(), in.end())) {}\n\nconst char* GetTxnOutputType(txnouttype t)\n{\n    switch (t)\n    {\n    case TX_NONSTANDARD: return \"nonstandard\";\n    case TX_PUBKEY: return \"pubkey\";\n    case TX_PUBKEYHASH: return \"pubkeyhash\";\n    case TX_SCRIPTHASH: return \"scripthash\";\n    case TX_MULTISIG: return \"multisig\";\n    case TX_NULL_DATA: return \"nulldata\";\n    case TX_WITNESS_V0_KEYHASH: return \"witness_v0_keyhash\";\n    case TX_WITNESS_V0_SCRIPTHASH: return \"witness_v0_scripthash\";\n    case TX_WITNESS_UNKNOWN: return \"witness_unknown\";\n    }\n    return nullptr;\n}\n\nbool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::vector<unsigned char> >& vSolutionsRet)\n{\n    // Templates\n    static std::multimap<txnouttype, CScript> mTemplates;\n    if (mTemplates.empty())\n    {\n        // Standard tx, sender provides pubkey, receiver adds signature\n        mTemplates.insert(std::make_pair(TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG));\n\n        // Bitcoin address tx, sender provides hash of pubkey, receiver provides signature and pubkey\n        mTemplates.insert(std::make_pair(TX_PUBKEYHASH, CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH << OP_EQUALVERIFY << OP_CHECKSIG));\n\n        // Sender provides N pubkeys, receivers provides M signatures\n        mTemplates.insert(std::make_pair(TX_MULTISIG, CScript() << OP_SMALLINTEGER << OP_PUBKEYS << OP_SMALLINTEGER << OP_CHECKMULTISIG));\n    }\n\n    vSolutionsRet.clear();\n\n    // Shortcut for pay-to-script-hash, which are more constrained than the other types:\n    // it is always OP_HASH160 20 [20 byte hash] OP_EQUAL\n    if (scriptPubKey.IsPayToScriptHash())\n    {\n        typeRet = TX_SCRIPTHASH;\n        std::vector<unsigned char> hashBytes(scriptPubKey.begin()+2, scriptPubKey.begin()+22);\n        vSolutionsRet.push_back(hashBytes);\n        return true;\n    }\n\n    int witnessversion;\n    std::vector<unsigned char> witnessprogram;\n    if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {\n        if (witnessversion == 0 && witnessprogram.size() == 20) {\n            typeRet = TX_WITNESS_V0_KEYHASH;\n            vSolutionsRet.push_back(witnessprogram);\n            return true;\n        }\n        if (witnessversion == 0 && witnessprogram.size() == 32) {\n            typeRet = TX_WITNESS_V0_SCRIPTHASH;\n            vSolutionsRet.push_back(witnessprogram);\n            return true;\n        }\n        if (witnessversion != 0) {\n            typeRet = TX_WITNESS_UNKNOWN;\n            vSolutionsRet.push_back(std::vector<unsigned char>{(unsigned char)witnessversion});\n            vSolutionsRet.push_back(std::move(witnessprogram));\n            return true;\n        }\n        return false;\n    }\n\n    // Provably prunable, data-carrying output\n    //\n    // So long as script passes the IsUnspendable() test and all but the first\n    // byte passes the IsPushOnly() test we don't care what exactly is in the\n    // script.\n    if (scriptPubKey.size() >= 1 && scriptPubKey[0] == OP_RETURN && scriptPubKey.IsPushOnly(scriptPubKey.begin()+1)) {\n        typeRet = TX_NULL_DATA;\n        return true;\n    }\n\n    // Scan templates\n    const CScript& script1 = scriptPubKey;\n    for (const std::pair<txnouttype, CScript>& tplate : mTemplates)\n    {\n        const CScript& script2 = tplate.second;\n        vSolutionsRet.clear();\n\n        opcodetype opcode1, opcode2;\n        std::vector<unsigned char> vch1, vch2;\n\n        // Compare\n        CScript::const_iterator pc1 = script1.begin();\n        CScript::const_iterator pc2 = script2.begin();\n        while (true)\n        {\n            if (pc1 == script1.end() && pc2 == script2.end())\n            {\n                // Found a match\n                typeRet = tplate.first;\n                if (typeRet == TX_MULTISIG)\n                {\n                    // Additional checks for TX_MULTISIG:\n                    unsigned char m = vSolutionsRet.front()[0];\n                    unsigned char n = vSolutionsRet.back()[0];\n                    if (m < 1 || n < 1 || m > n || vSolutionsRet.size()-2 != n)\n                        return false;\n                }\n                return true;\n            }\n            if (!script1.GetOp(pc1, opcode1, vch1))\n                break;\n            if (!script2.GetOp(pc2, opcode2, vch2))\n                break;\n\n            // Template matching opcodes:\n            if (opcode2 == OP_PUBKEYS)\n            {\n                while (vch1.size() >= 33 && vch1.size() <= 65)\n                {\n                    vSolutionsRet.push_back(vch1);\n                    if (!script1.GetOp(pc1, opcode1, vch1))\n                        break;\n                }\n                if (!script2.GetOp(pc2, opcode2, vch2))\n                    break;\n                // Normal situation is to fall through\n                // to other if/else statements\n            }\n\n            if (opcode2 == OP_PUBKEY)\n            {\n                if (vch1.size() < 33 || vch1.size() > 65)\n                    break;\n                vSolutionsRet.push_back(vch1);\n            }\n            else if (opcode2 == OP_PUBKEYHASH)\n            {\n                if (vch1.size() != sizeof(uint160))\n                    break;\n                vSolutionsRet.push_back(vch1);\n            }\n            else if (opcode2 == OP_SMALLINTEGER)\n            {   // Single-byte small integer pushed onto vSolutions\n                if (opcode1 == OP_0 ||\n                    (opcode1 >= OP_1 && opcode1 <= OP_16))\n                {\n                    char n = (char)CScript::DecodeOP_N(opcode1);\n                    vSolutionsRet.push_back(valtype(1, n));\n                }\n                else\n                    break;\n            }\n            else if (opcode1 != opcode2 || vch1 != vch2)\n            {\n                // Others must match exactly\n                break;\n            }\n        }\n    }\n\n    vSolutionsRet.clear();\n    typeRet = TX_NONSTANDARD;\n    return false;\n}\n\nbool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)\n{\n    std::vector<valtype> vSolutions;\n    txnouttype whichType;\n    if (!Solver(scriptPubKey, whichType, vSolutions))\n        return false;\n\n    if (whichType == TX_PUBKEY)\n    {\n        CPubKey pubKey(vSolutions[0]);\n        if (!pubKey.IsValid())\n            return false;\n\n        addressRet = pubKey.GetID();\n        return true;\n    }\n    else if (whichType == TX_PUBKEYHASH)\n    {\n        addressRet = CKeyID(uint160(vSolutions[0]));\n        return true;\n    }\n    else if (whichType == TX_SCRIPTHASH)\n    {\n        addressRet = CScriptID(uint160(vSolutions[0]));\n        return true;\n    } else if (whichType == TX_WITNESS_V0_KEYHASH) {\n        WitnessV0KeyHash hash;\n        std::copy(vSolutions[0].begin(), vSolutions[0].end(), hash.begin());\n        addressRet = hash;\n        return true;\n    } else if (whichType == TX_WITNESS_V0_SCRIPTHASH) {\n        WitnessV0ScriptHash hash;\n        std::copy(vSolutions[0].begin(), vSolutions[0].end(), hash.begin());\n        addressRet = hash;\n        return true;\n    } else if (whichType == TX_WITNESS_UNKNOWN) {\n        WitnessUnknown unk;\n        unk.version = vSolutions[0][0];\n        std::copy(vSolutions[1].begin(), vSolutions[1].end(), unk.program);\n        unk.length = vSolutions[1].size();\n        addressRet = unk;\n        return true;\n    }\n    // Multisig txns have more than one address...\n    return false;\n}\n\nbool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<CTxDestination>& addressRet, int& nRequiredRet)\n{\n    addressRet.clear();\n    typeRet = TX_NONSTANDARD;\n    std::vector<valtype> vSolutions;\n    if (!Solver(scriptPubKey, typeRet, vSolutions))\n        return false;\n    if (typeRet == TX_NULL_DATA){\n        // This is data, not addresses\n        return false;\n    }\n\n    if (typeRet == TX_MULTISIG)\n    {\n        nRequiredRet = vSolutions.front()[0];\n        for (unsigned int i = 1; i < vSolutions.size()-1; i++)\n        {\n            CPubKey pubKey(vSolutions[i]);\n            if (!pubKey.IsValid())\n                continue;\n\n            CTxDestination address = pubKey.GetID();\n            addressRet.push_back(address);\n        }\n\n        if (addressRet.empty())\n            return false;\n    }\n    else\n    {\n        nRequiredRet = 1;\n        CTxDestination address;\n        if (!ExtractDestination(scriptPubKey, address))\n           return false;\n        addressRet.push_back(address);\n    }\n\n    return true;\n}\n\nnamespace\n{\nclass CScriptVisitor : public boost::static_visitor<bool>\n{\nprivate:\n    CScript *script;\npublic:\n    explicit CScriptVisitor(CScript *scriptin) { script = scriptin; }\n\n    bool operator()(const CNoDestination &dest) const {\n        script->clear();\n        return false;\n    }\n\n    bool operator()(const CKeyID &keyID) const {\n        script->clear();\n        *script << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;\n        return true;\n    }\n\n    bool operator()(const CScriptID &scriptID) const {\n        script->clear();\n        *script << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL;\n        return true;\n    }\n\n    bool operator()(const WitnessV0KeyHash& id) const\n    {\n        script->clear();\n        *script << OP_0 << ToByteVector(id);\n        return true;\n    }\n\n    bool operator()(const WitnessV0ScriptHash& id) const\n    {\n        script->clear();\n        *script << OP_0 << ToByteVector(id);\n        return true;\n    }\n\n    bool operator()(const WitnessUnknown& id) const\n    {\n        script->clear();\n        *script << CScript::EncodeOP_N(id.version) << std::vector<unsigned char>(id.program, id.program + id.length);\n        return true;\n    }\n};\n} // namespace\n\nCScript GetScriptForDestination(const CTxDestination& dest)\n{\n    CScript script;\n\n    boost::apply_visitor(CScriptVisitor(&script), dest);\n    return script;\n}\n\nCScript GetScriptForRawPubKey(const CPubKey& pubKey)\n{\n    return CScript() << std::vector<unsigned char>(pubKey.begin(), pubKey.end()) << OP_CHECKSIG;\n}\n\nCScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys)\n{\n    CScript script;\n\n    script << CScript::EncodeOP_N(nRequired);\n    for (const CPubKey& key : keys)\n        script << ToByteVector(key);\n    script << CScript::EncodeOP_N(keys.size()) << OP_CHECKMULTISIG;\n    return script;\n}\n\nCScript GetScriptForWitness(const CScript& redeemscript)\n{\n    CScript ret;\n\n    txnouttype typ;\n    std::vector<std::vector<unsigned char> > vSolutions;\n    if (Solver(redeemscript, typ, vSolutions)) {\n        if (typ == TX_PUBKEY) {\n            return GetScriptForDestination(WitnessV0KeyHash(Hash160(vSolutions[0].begin(), vSolutions[0].end())));\n        } else if (typ == TX_PUBKEYHASH) {\n            return GetScriptForDestination(WitnessV0KeyHash(vSolutions[0]));\n        }\n    }\n    uint256 hash;\n    CSHA256().Write(&redeemscript[0], redeemscript.size()).Finalize(hash.begin());\n    return GetScriptForDestination(WitnessV0ScriptHash(hash));\n}\n\nbool IsValidDestination(const CTxDestination& dest) {\n    return dest.which() != 0;\n}\n"
  },
  {
    "path": "src/script/standard.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SCRIPT_STANDARD_H\n#define BITCOIN_SCRIPT_STANDARD_H\n\n#include <script/interpreter.h>\n#include <uint256.h>\n\n#include <boost/variant.hpp>\n\n#include <stdint.h>\n\nstatic const bool DEFAULT_ACCEPT_DATACARRIER = true;\n\nclass CKeyID;\nclass CScript;\n\n/** A reference to a CScript: the Hash160 of its serialization (see script.h) */\nclass CScriptID : public uint160\n{\npublic:\n    CScriptID() : uint160() {}\n    CScriptID(const CScript& in);\n    CScriptID(const uint160& in) : uint160(in) {}\n};\n\n/**\n * Default setting for nMaxDatacarrierBytes. 80 bytes of data, +1 for OP_RETURN,\n * +2 for the pushdata opcodes.\n */\nstatic const unsigned int MAX_OP_RETURN_RELAY = 83;\n\n/**\n * A data carrying output is an unspendable output containing data. The script\n * type is designated as TX_NULL_DATA.\n */\nextern bool fAcceptDatacarrier;\n\n/** Maximum size of TX_NULL_DATA scripts that this node considers standard. */\nextern unsigned nMaxDatacarrierBytes;\n\n/**\n * Mandatory script verification flags that all new blocks must comply with for\n * them to be valid. (but old blocks may not comply with) Currently just P2SH,\n * but in the future other flags may be added, such as a soft-fork to enforce\n * strict DER encoding.\n *\n * Failing one of these tests may trigger a DoS ban - see CheckInputs() for\n * details.\n */\nstatic const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH;\n\nenum txnouttype\n{\n    TX_NONSTANDARD,\n    // 'standard' transaction types:\n    TX_PUBKEY,\n    TX_PUBKEYHASH,\n    TX_SCRIPTHASH,\n    TX_MULTISIG,\n    TX_NULL_DATA, //!< unspendable OP_RETURN script that carries data\n    TX_WITNESS_V0_SCRIPTHASH,\n    TX_WITNESS_V0_KEYHASH,\n    TX_WITNESS_UNKNOWN, //!< Only for Witness versions not already defined above\n};\n\nclass CNoDestination {\npublic:\n    friend bool operator==(const CNoDestination &a, const CNoDestination &b) { return true; }\n    friend bool operator<(const CNoDestination &a, const CNoDestination &b) { return true; }\n};\n\nstruct WitnessV0ScriptHash : public uint256\n{\n    WitnessV0ScriptHash() : uint256() {}\n    explicit WitnessV0ScriptHash(const uint256& hash) : uint256(hash) {}\n    using uint256::uint256;\n};\n\nstruct WitnessV0KeyHash : public uint160\n{\n    WitnessV0KeyHash() : uint160() {}\n    explicit WitnessV0KeyHash(const uint160& hash) : uint160(hash) {}\n    using uint160::uint160;\n};\n\n//! CTxDestination subtype to encode any future Witness version\nstruct WitnessUnknown\n{\n    unsigned int version;\n    unsigned int length;\n    unsigned char program[40];\n\n    friend bool operator==(const WitnessUnknown& w1, const WitnessUnknown& w2) {\n        if (w1.version != w2.version) return false;\n        if (w1.length != w2.length) return false;\n        return std::equal(w1.program, w1.program + w1.length, w2.program);\n    }\n\n    friend bool operator<(const WitnessUnknown& w1, const WitnessUnknown& w2) {\n        if (w1.version < w2.version) return true;\n        if (w1.version > w2.version) return false;\n        if (w1.length < w2.length) return true;\n        if (w1.length > w2.length) return false;\n        return std::lexicographical_compare(w1.program, w1.program + w1.length, w2.program, w2.program + w2.length);\n    }\n};\n\n/**\n * A txout script template with a specific destination. It is either:\n *  * CNoDestination: no destination set\n *  * CKeyID: TX_PUBKEYHASH destination (P2PKH)\n *  * CScriptID: TX_SCRIPTHASH destination (P2SH)\n *  * WitnessV0ScriptHash: TX_WITNESS_V0_SCRIPTHASH destination (P2WSH)\n *  * WitnessV0KeyHash: TX_WITNESS_V0_KEYHASH destination (P2WPKH)\n *  * WitnessUnknown: TX_WITNESS_UNKNOWN destination (P2W???)\n *  A CTxDestination is the internal data type encoded in a bitcoin address\n */\ntypedef boost::variant<CNoDestination, CKeyID, CScriptID, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown> CTxDestination;\n\n/** Check whether a CTxDestination is a CNoDestination. */\nbool IsValidDestination(const CTxDestination& dest);\n\n/** Get the name of a txnouttype as a C string, or nullptr if unknown. */\nconst char* GetTxnOutputType(txnouttype t);\n\n/**\n * Parse a scriptPubKey and identify script type for standard scripts. If\n * successful, returns script type and parsed pubkeys or hashes, depending on\n * the type. For example, for a P2SH script, vSolutionsRet will contain the\n * script hash, for P2PKH it will contain the key hash, etc.\n *\n * @param[in]   scriptPubKey   Script to parse\n * @param[out]  typeRet        The script type\n * @param[out]  vSolutionsRet  Vector of parsed pubkeys and hashes\n * @return                     True if script matches standard template\n */\nbool Solver(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<std::vector<unsigned char> >& vSolutionsRet);\n\n/**\n * Parse a standard scriptPubKey for the destination address. Assigns result to\n * the addressRet parameter and returns true if successful. For multisig\n * scripts, instead use ExtractDestinations. Currently only works for P2PK,\n * P2PKH, P2SH, P2WPKH, and P2WSH scripts.\n */\nbool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet);\n\n/**\n * Parse a standard scriptPubKey with one or more destination addresses. For\n * multisig scripts, this populates the addressRet vector with the pubkey IDs\n * and nRequiredRet with the n required to spend. For other destinations,\n * addressRet is populated with a single value and nRequiredRet is set to 1.\n * Returns true if successful. Currently does not extract address from\n * pay-to-witness scripts.\n *\n * Note: this function confuses destinations (a subset of CScripts that are\n * encodable as an address) with key identifiers (of keys involved in a\n * CScript), and its use should be phased out.\n */\nbool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, std::vector<CTxDestination>& addressRet, int& nRequiredRet);\n\n/**\n * Generate a Bitcoin scriptPubKey for the given CTxDestination. Returns a P2PKH\n * script for a CKeyID destination, a P2SH script for a CScriptID, and an empty\n * script for CNoDestination.\n */\nCScript GetScriptForDestination(const CTxDestination& dest);\n\n/** Generate a P2PK script for the given pubkey. */\nCScript GetScriptForRawPubKey(const CPubKey& pubkey);\n\n/** Generate a multisig script. */\nCScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys);\n\n/**\n * Generate a pay-to-witness script for the given redeem script. If the redeem\n * script is P2PK or P2PKH, this returns a P2WPKH script, otherwise it returns a\n * P2WSH script.\n *\n * TODO: replace calls to GetScriptForWitness with GetScriptForDestination using\n * the various witness-specific CTxDestination subtypes.\n */\nCScript GetScriptForWitness(const CScript& redeemscript);\n\n#endif // BITCOIN_SCRIPT_STANDARD_H\n"
  },
  {
    "path": "src/secp256k1/.gitignore",
    "content": "bench_inv\nbench_ecdh\nbench_sign\nbench_verify\nbench_schnorr_verify\nbench_recover\nbench_internal\ntests\nexhaustive_tests\ngen_context\n*.exe\n*.so\n*.a\n!.gitignore\n\nMakefile\nconfigure\n.libs/\nMakefile.in\naclocal.m4\nautom4te.cache/\nconfig.log\nconfig.status\n*.tar.gz\n*.la\nlibtool\n.deps/\n.dirstamp\n*.lo\n*.o\n*~\nsrc/libsecp256k1-config.h\nsrc/libsecp256k1-config.h.in\nsrc/ecmult_static_context.h\nbuild-aux/config.guess\nbuild-aux/config.sub\nbuild-aux/depcomp\nbuild-aux/install-sh\nbuild-aux/ltmain.sh\nbuild-aux/m4/libtool.m4\nbuild-aux/m4/lt~obsolete.m4\nbuild-aux/m4/ltoptions.m4\nbuild-aux/m4/ltsugar.m4\nbuild-aux/m4/ltversion.m4\nbuild-aux/missing\nbuild-aux/compile\nbuild-aux/test-driver\nsrc/stamp-h1\nlibsecp256k1.pc\n"
  },
  {
    "path": "src/secp256k1/.travis.yml",
    "content": "language: c\nsudo: false\naddons:\n  apt:\n    packages: libgmp-dev\ncompiler:\n  - clang\n  - gcc\ncache:\n  directories:\n  - src/java/guava/\nenv:\n  global:\n    - FIELD=auto  BIGNUM=auto  SCALAR=auto  ENDOMORPHISM=no  STATICPRECOMPUTATION=yes  ASM=no  BUILD=check  EXTRAFLAGS=  HOST=  ECDH=no  RECOVERY=no  EXPERIMENTAL=no\n    - GUAVA_URL=https://search.maven.org/remotecontent?filepath=com/google/guava/guava/18.0/guava-18.0.jar GUAVA_JAR=src/java/guava/guava-18.0.jar\n  matrix:\n    - SCALAR=32bit    RECOVERY=yes\n    - SCALAR=32bit    FIELD=32bit       ECDH=yes  EXPERIMENTAL=yes\n    - SCALAR=64bit\n    - FIELD=64bit     RECOVERY=yes\n    - FIELD=64bit     ENDOMORPHISM=yes\n    - FIELD=64bit     ENDOMORPHISM=yes  ECDH=yes EXPERIMENTAL=yes\n    - FIELD=64bit                       ASM=x86_64\n    - FIELD=64bit     ENDOMORPHISM=yes  ASM=x86_64\n    - FIELD=32bit     ENDOMORPHISM=yes\n    - BIGNUM=no\n    - BIGNUM=no       ENDOMORPHISM=yes RECOVERY=yes EXPERIMENTAL=yes\n    - BIGNUM=no       STATICPRECOMPUTATION=no\n    - BUILD=distcheck\n    - EXTRAFLAGS=CPPFLAGS=-DDETERMINISTIC\n    - EXTRAFLAGS=CFLAGS=-O0\n    - BUILD=check-java ECDH=yes EXPERIMENTAL=yes\nmatrix:\n  fast_finish: true\n  include:\n    - compiler: clang\n      env: HOST=i686-linux-gnu ENDOMORPHISM=yes\n      addons:\n        apt:\n          packages:\n            - gcc-multilib\n            - libgmp-dev:i386\n    - compiler: clang\n      env: HOST=i686-linux-gnu\n      addons:\n        apt:\n          packages:\n            - gcc-multilib\n    - compiler: gcc\n      env: HOST=i686-linux-gnu ENDOMORPHISM=yes\n      addons:\n        apt:\n          packages:\n            - gcc-multilib\n    - compiler: gcc\n      env: HOST=i686-linux-gnu\n      addons:\n        apt:\n          packages:\n            - gcc-multilib\n            - libgmp-dev:i386\nbefore_install: mkdir -p `dirname $GUAVA_JAR`\ninstall: if [ ! -f $GUAVA_JAR ]; then wget $GUAVA_URL -O $GUAVA_JAR; fi\nbefore_script: ./autogen.sh\nscript:\n - if [ -n \"$HOST\" ]; then export USE_HOST=\"--host=$HOST\"; fi\n - if [ \"x$HOST\" = \"xi686-linux-gnu\" ]; then export CC=\"$CC -m32\"; fi\n - ./configure --enable-experimental=$EXPERIMENTAL --enable-endomorphism=$ENDOMORPHISM --with-field=$FIELD --with-bignum=$BIGNUM --with-scalar=$SCALAR --enable-ecmult-static-precomputation=$STATICPRECOMPUTATION --enable-module-ecdh=$ECDH --enable-module-recovery=$RECOVERY $EXTRAFLAGS $USE_HOST && make -j2 $BUILD\nos: linux\n"
  },
  {
    "path": "src/secp256k1/COPYING",
    "content": "Copyright (c) 2013 Pieter Wuille\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "src/secp256k1/Makefile.am",
    "content": "ACLOCAL_AMFLAGS = -I build-aux/m4\n\nlib_LTLIBRARIES = libsecp256k1.la\nif USE_JNI\nJNI_LIB = libsecp256k1_jni.la\nnoinst_LTLIBRARIES = $(JNI_LIB)\nelse\nJNI_LIB =\nendif\ninclude_HEADERS = include/secp256k1.h\nnoinst_HEADERS =\nnoinst_HEADERS += src/scalar.h\nnoinst_HEADERS += src/scalar_4x64.h\nnoinst_HEADERS += src/scalar_8x32.h\nnoinst_HEADERS += src/scalar_low.h\nnoinst_HEADERS += src/scalar_impl.h\nnoinst_HEADERS += src/scalar_4x64_impl.h\nnoinst_HEADERS += src/scalar_8x32_impl.h\nnoinst_HEADERS += src/scalar_low_impl.h\nnoinst_HEADERS += src/group.h\nnoinst_HEADERS += src/group_impl.h\nnoinst_HEADERS += src/num_gmp.h\nnoinst_HEADERS += src/num_gmp_impl.h\nnoinst_HEADERS += src/ecdsa.h\nnoinst_HEADERS += src/ecdsa_impl.h\nnoinst_HEADERS += src/eckey.h\nnoinst_HEADERS += src/eckey_impl.h\nnoinst_HEADERS += src/ecmult.h\nnoinst_HEADERS += src/ecmult_impl.h\nnoinst_HEADERS += src/ecmult_const.h\nnoinst_HEADERS += src/ecmult_const_impl.h\nnoinst_HEADERS += src/ecmult_gen.h\nnoinst_HEADERS += src/ecmult_gen_impl.h\nnoinst_HEADERS += src/num.h\nnoinst_HEADERS += src/num_impl.h\nnoinst_HEADERS += src/field_10x26.h\nnoinst_HEADERS += src/field_10x26_impl.h\nnoinst_HEADERS += src/field_5x52.h\nnoinst_HEADERS += src/field_5x52_impl.h\nnoinst_HEADERS += src/field_5x52_int128_impl.h\nnoinst_HEADERS += src/field_5x52_asm_impl.h\nnoinst_HEADERS += src/java/org_bitcoin_NativeSecp256k1.h\nnoinst_HEADERS += src/java/org_bitcoin_Secp256k1Context.h\nnoinst_HEADERS += src/util.h\nnoinst_HEADERS += src/testrand.h\nnoinst_HEADERS += src/testrand_impl.h\nnoinst_HEADERS += src/hash.h\nnoinst_HEADERS += src/hash_impl.h\nnoinst_HEADERS += src/field.h\nnoinst_HEADERS += src/field_impl.h\nnoinst_HEADERS += src/bench.h\nnoinst_HEADERS += contrib/lax_der_parsing.h\nnoinst_HEADERS += contrib/lax_der_parsing.c\nnoinst_HEADERS += contrib/lax_der_privatekey_parsing.h\nnoinst_HEADERS += contrib/lax_der_privatekey_parsing.c\n\nif USE_EXTERNAL_ASM\nCOMMON_LIB = libsecp256k1_common.la\nnoinst_LTLIBRARIES = $(COMMON_LIB)\nelse\nCOMMON_LIB =\nendif\n\npkgconfigdir = $(libdir)/pkgconfig\npkgconfig_DATA = libsecp256k1.pc\n\nif USE_EXTERNAL_ASM\nif USE_ASM_ARM\nlibsecp256k1_common_la_SOURCES = src/asm/field_10x26_arm.s\nendif\nendif\n\nlibsecp256k1_la_SOURCES = src/secp256k1.c\nlibsecp256k1_la_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/include -I$(top_srcdir)/src $(SECP_INCLUDES)\nlibsecp256k1_la_LIBADD = $(JNI_LIB) $(SECP_LIBS) $(COMMON_LIB)\n\nlibsecp256k1_jni_la_SOURCES  = src/java/org_bitcoin_NativeSecp256k1.c src/java/org_bitcoin_Secp256k1Context.c\nlibsecp256k1_jni_la_CPPFLAGS = -DSECP256K1_BUILD $(JNI_INCLUDES)\n\nnoinst_PROGRAMS =\nif USE_BENCHMARK\nnoinst_PROGRAMS += bench_verify bench_sign bench_internal\nbench_verify_SOURCES = src/bench_verify.c\nbench_verify_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)\nbench_sign_SOURCES = src/bench_sign.c\nbench_sign_LDADD = libsecp256k1.la $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)\nbench_internal_SOURCES = src/bench_internal.c\nbench_internal_LDADD = $(SECP_LIBS) $(COMMON_LIB)\nbench_internal_CPPFLAGS = -DSECP256K1_BUILD $(SECP_INCLUDES)\nendif\n\nTESTS =\nif USE_TESTS\nnoinst_PROGRAMS += tests\ntests_SOURCES = src/tests.c\ntests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src -I$(top_srcdir)/include $(SECP_INCLUDES) $(SECP_TEST_INCLUDES)\nif !ENABLE_COVERAGE\ntests_CPPFLAGS += -DVERIFY\nendif\ntests_LDADD = $(SECP_LIBS) $(SECP_TEST_LIBS) $(COMMON_LIB)\ntests_LDFLAGS = -static\nTESTS += tests\nendif\n\nif USE_EXHAUSTIVE_TESTS\nnoinst_PROGRAMS += exhaustive_tests\nexhaustive_tests_SOURCES = src/tests_exhaustive.c\nexhaustive_tests_CPPFLAGS = -DSECP256K1_BUILD -I$(top_srcdir)/src $(SECP_INCLUDES)\nif !ENABLE_COVERAGE\nexhaustive_tests_CPPFLAGS += -DVERIFY\nendif\nexhaustive_tests_LDADD = $(SECP_LIBS)\nexhaustive_tests_LDFLAGS = -static\nTESTS += exhaustive_tests\nendif\n\nJAVAROOT=src/java\nJAVAORG=org/bitcoin\nJAVA_GUAVA=$(srcdir)/$(JAVAROOT)/guava/guava-18.0.jar\nCLASSPATH_ENV=CLASSPATH=$(JAVA_GUAVA)\nJAVA_FILES= \\\n  $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1.java \\\n  $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Test.java \\\n  $(JAVAROOT)/$(JAVAORG)/NativeSecp256k1Util.java \\\n  $(JAVAROOT)/$(JAVAORG)/Secp256k1Context.java\n\nif USE_JNI\n\n$(JAVA_GUAVA):\n\t@echo Guava is missing. Fetch it via: \\\n\twget https://search.maven.org/remotecontent?filepath=com/google/guava/guava/18.0/guava-18.0.jar -O $(@)\n\t@false\n\n.stamp-java: $(JAVA_FILES)\n\t@echo   Compiling $^\n\t$(AM_V_at)$(CLASSPATH_ENV) javac $^\n\t@touch $@\n\nif USE_TESTS\n\ncheck-java: libsecp256k1.la $(JAVA_GUAVA) .stamp-java\n\t$(AM_V_at)java -Djava.library.path=\"./:./src:./src/.libs:.libs/\" -cp \"$(JAVA_GUAVA):$(JAVAROOT)\" $(JAVAORG)/NativeSecp256k1Test\n\nendif\nendif\n\nif USE_ECMULT_STATIC_PRECOMPUTATION\nCPPFLAGS_FOR_BUILD +=-I$(top_srcdir)\nCFLAGS_FOR_BUILD += -Wall -Wextra -Wno-unused-function\n\ngen_context_OBJECTS = gen_context.o\ngen_context_BIN = gen_context$(BUILD_EXEEXT)\ngen_%.o: src/gen_%.c\n\t$(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) -c $< -o $@\n\n$(gen_context_BIN): $(gen_context_OBJECTS)\n\t$(CC_FOR_BUILD) $^ -o $@\n\n$(libsecp256k1_la_OBJECTS): src/ecmult_static_context.h\n$(tests_OBJECTS): src/ecmult_static_context.h\n$(bench_internal_OBJECTS): src/ecmult_static_context.h\n\nsrc/ecmult_static_context.h: $(gen_context_BIN)\n\t./$(gen_context_BIN)\n\nCLEANFILES = $(gen_context_BIN) src/ecmult_static_context.h $(JAVAROOT)/$(JAVAORG)/*.class .stamp-java\nendif\n\nEXTRA_DIST = autogen.sh src/gen_context.c src/basic-config.h $(JAVA_FILES)\n\nif ENABLE_MODULE_ECDH\ninclude src/modules/ecdh/Makefile.am.include\nendif\n\nif ENABLE_MODULE_RECOVERY\ninclude src/modules/recovery/Makefile.am.include\nendif\n"
  },
  {
    "path": "src/secp256k1/README.md",
    "content": "libsecp256k1\n============\n\n[![Build Status](https://travis-ci.org/bitcoin-core/secp256k1.svg?branch=master)](https://travis-ci.org/bitcoin-core/secp256k1)\n\nOptimized C library for EC operations on curve secp256k1.\n\nThis library is a work in progress and is being used to research best practices. Use at your own risk.\n\nFeatures:\n* secp256k1 ECDSA signing/verification and key generation.\n* Adding/multiplying private/public keys.\n* Serialization/parsing of private keys, public keys, signatures.\n* Constant time, constant memory access signing and pubkey generation.\n* Derandomized DSA (via RFC6979 or with a caller provided function.)\n* Very efficient implementation.\n\nImplementation details\n----------------------\n\n* General\n  * No runtime heap allocation.\n  * Extensive testing infrastructure.\n  * Structured to facilitate review and analysis.\n  * Intended to be portable to any system with a C89 compiler and uint64_t support.\n  * Expose only higher level interfaces to minimize the API surface and improve application security. (\"Be difficult to use insecurely.\")\n* Field operations\n  * Optimized implementation of arithmetic modulo the curve's field size (2^256 - 0x1000003D1).\n    * Using 5 52-bit limbs (including hand-optimized assembly for x86_64, by Diederik Huys).\n    * Using 10 26-bit limbs.\n  * Field inverses and square roots using a sliding window over blocks of 1s (by Peter Dettman).\n* Scalar operations\n  * Optimized implementation without data-dependent branches of arithmetic modulo the curve's order.\n    * Using 4 64-bit limbs (relying on __int128 support in the compiler).\n    * Using 8 32-bit limbs.\n* Group operations\n  * Point addition formula specifically simplified for the curve equation (y^2 = x^3 + 7).\n  * Use addition between points in Jacobian and affine coordinates where possible.\n  * Use a unified addition/doubling formula where necessary to avoid data-dependent branches.\n  * Point/x comparison without a field inversion by comparison in the Jacobian coordinate space.\n* Point multiplication for verification (a*P + b*G).\n  * Use wNAF notation for point multiplicands.\n  * Use a much larger window for multiples of G, using precomputed multiples.\n  * Use Shamir's trick to do the multiplication with the public key and the generator simultaneously.\n  * Optionally (off by default) use secp256k1's efficiently-computable endomorphism to split the P multiplicand into 2 half-sized ones.\n* Point multiplication for signing\n  * Use a precomputed table of multiples of powers of 16 multiplied with the generator, so general multiplication becomes a series of additions.\n  * Access the table with branch-free conditional moves so memory access is uniform.\n  * No data-dependent branches\n  * The precomputed tables add and eventually subtract points for which no known scalar (private key) is known, preventing even an attacker with control over the private key used to control the data internally.\n\nBuild steps\n-----------\n\nlibsecp256k1 is built using autotools:\n\n    $ ./autogen.sh\n    $ ./configure\n    $ make\n    $ ./tests\n    $ sudo make install  # optional\n"
  },
  {
    "path": "src/secp256k1/TODO",
    "content": "* Unit tests for fieldelem/groupelem, including ones intended to\n  trigger fieldelem's boundary cases.\n* Complete constant-time operations for signing/keygen\n"
  },
  {
    "path": "src/secp256k1/autogen.sh",
    "content": "#!/bin/sh\nset -e\nautoreconf -if --warnings=all\n"
  },
  {
    "path": "src/secp256k1/build-aux/m4/ax_jni_include_dir.m4",
    "content": "# ===========================================================================\n#    http://www.gnu.org/software/autoconf-archive/ax_jni_include_dir.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_JNI_INCLUDE_DIR\n#\n# DESCRIPTION\n#\n#   AX_JNI_INCLUDE_DIR finds include directories needed for compiling\n#   programs using the JNI interface.\n#\n#   JNI include directories are usually in the Java distribution. This is\n#   deduced from the value of $JAVA_HOME, $JAVAC, or the path to \"javac\", in\n#   that order. When this macro completes, a list of directories is left in\n#   the variable JNI_INCLUDE_DIRS.\n#\n#   Example usage follows:\n#\n#     AX_JNI_INCLUDE_DIR\n#\n#     for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS\n#     do\n#             CPPFLAGS=\"$CPPFLAGS -I$JNI_INCLUDE_DIR\"\n#     done\n#\n#   If you want to force a specific compiler:\n#\n#   - at the configure.in level, set JAVAC=yourcompiler before calling\n#   AX_JNI_INCLUDE_DIR\n#\n#   - at the configure level, setenv JAVAC\n#\n#   Note: This macro can work with the autoconf M4 macros for Java programs.\n#   This particular macro is not part of the original set of macros.\n#\n# LICENSE\n#\n#   Copyright (c) 2008 Don Anderson <dda@sleepycat.com>\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved. This file is offered as-is, without any\n#   warranty.\n\n#serial 10\n\nAU_ALIAS([AC_JNI_INCLUDE_DIR], [AX_JNI_INCLUDE_DIR])\nAC_DEFUN([AX_JNI_INCLUDE_DIR],[\n\nJNI_INCLUDE_DIRS=\"\"\n\nif test \"x$JAVA_HOME\" != x; then\n\t_JTOPDIR=\"$JAVA_HOME\"\nelse\n\tif test \"x$JAVAC\" = x; then\n\t\tJAVAC=javac\n\tfi\n\tAC_PATH_PROG([_ACJNI_JAVAC], [$JAVAC], [no])\n\tif test \"x$_ACJNI_JAVAC\" = xno; then\n\t\tAC_MSG_WARN([cannot find JDK; try setting \\$JAVAC or \\$JAVA_HOME])\n\tfi\n\t_ACJNI_FOLLOW_SYMLINKS(\"$_ACJNI_JAVAC\")\n\t_JTOPDIR=`echo \"$_ACJNI_FOLLOWED\" | sed -e 's://*:/:g' -e 's:/[[^/]]*$::'`\nfi\n\ncase \"$host_os\" in\n        darwin*)        _JTOPDIR=`echo \"$_JTOPDIR\" | sed -e 's:/[[^/]]*$::'`\n                        _JINC=\"$_JTOPDIR/Headers\";;\n        *)              _JINC=\"$_JTOPDIR/include\";;\nesac\n_AS_ECHO_LOG([_JTOPDIR=$_JTOPDIR])\n_AS_ECHO_LOG([_JINC=$_JINC])\n\n# On Mac OS X 10.6.4, jni.h is a symlink:\n# /System/Library/Frameworks/JavaVM.framework/Versions/Current/Headers/jni.h\n# -> ../../CurrentJDK/Headers/jni.h.\n\nAC_CACHE_CHECK(jni headers, ac_cv_jni_header_path,\n[\nif test -f \"$_JINC/jni.h\"; then\n  ac_cv_jni_header_path=\"$_JINC\"\n  JNI_INCLUDE_DIRS=\"$JNI_INCLUDE_DIRS $ac_cv_jni_header_path\"\nelse\n  _JTOPDIR=`echo \"$_JTOPDIR\" | sed -e 's:/[[^/]]*$::'`\n  if test -f \"$_JTOPDIR/include/jni.h\"; then\n    ac_cv_jni_header_path=\"$_JTOPDIR/include\"\n    JNI_INCLUDE_DIRS=\"$JNI_INCLUDE_DIRS $ac_cv_jni_header_path\"\n  else\n    ac_cv_jni_header_path=none\n  fi\nfi\n])\n\n\n\n# get the likely subdirectories for system specific java includes\ncase \"$host_os\" in\nbsdi*)          _JNI_INC_SUBDIRS=\"bsdos\";;\ndarwin*)        _JNI_INC_SUBDIRS=\"darwin\";;\nfreebsd*)       _JNI_INC_SUBDIRS=\"freebsd\";;\nlinux*)         _JNI_INC_SUBDIRS=\"linux genunix\";;\nosf*)           _JNI_INC_SUBDIRS=\"alpha\";;\nsolaris*)       _JNI_INC_SUBDIRS=\"solaris\";;\nmingw*)\t\t_JNI_INC_SUBDIRS=\"win32\";;\ncygwin*)\t_JNI_INC_SUBDIRS=\"win32\";;\n*)              _JNI_INC_SUBDIRS=\"genunix\";;\nesac\n\nif test \"x$ac_cv_jni_header_path\" != \"xnone\"; then\n  # add any subdirectories that are present\n  for JINCSUBDIR in $_JNI_INC_SUBDIRS\n  do\n      if test -d \"$_JTOPDIR/include/$JINCSUBDIR\"; then\n           JNI_INCLUDE_DIRS=\"$JNI_INCLUDE_DIRS $_JTOPDIR/include/$JINCSUBDIR\"\n      fi\n  done\nfi\n])\n\n# _ACJNI_FOLLOW_SYMLINKS <path>\n# Follows symbolic links on <path>,\n# finally setting variable _ACJNI_FOLLOWED\n# ----------------------------------------\nAC_DEFUN([_ACJNI_FOLLOW_SYMLINKS],[\n# find the include directory relative to the javac executable\n_cur=\"$1\"\nwhile ls -ld \"$_cur\" 2>/dev/null | grep \" -> \" >/dev/null; do\n        AC_MSG_CHECKING([symlink for $_cur])\n        _slink=`ls -ld \"$_cur\" | sed 's/.* -> //'`\n        case \"$_slink\" in\n        /*) _cur=\"$_slink\";;\n        # 'X' avoids triggering unwanted echo options.\n        *) _cur=`echo \"X$_cur\" | sed -e 's/^X//' -e 's:[[^/]]*$::'`\"$_slink\";;\n        esac\n        AC_MSG_RESULT([$_cur])\ndone\n_ACJNI_FOLLOWED=\"$_cur\"\n])# _ACJNI\n"
  },
  {
    "path": "src/secp256k1/build-aux/m4/ax_prog_cc_for_build.m4",
    "content": "# ===========================================================================\n#   http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html\n# ===========================================================================\n#\n# SYNOPSIS\n#\n#   AX_PROG_CC_FOR_BUILD\n#\n# DESCRIPTION\n#\n#   This macro searches for a C compiler that generates native executables,\n#   that is a C compiler that surely is not a cross-compiler. This can be\n#   useful if you have to generate source code at compile-time like for\n#   example GCC does.\n#\n#   The macro sets the CC_FOR_BUILD and CPP_FOR_BUILD macros to anything\n#   needed to compile or link (CC_FOR_BUILD) and preprocess (CPP_FOR_BUILD).\n#   The value of these variables can be overridden by the user by specifying\n#   a compiler with an environment variable (like you do for standard CC).\n#\n#   It also sets BUILD_EXEEXT and BUILD_OBJEXT to the executable and object\n#   file extensions for the build platform, and GCC_FOR_BUILD to `yes' if\n#   the compiler we found is GCC. All these variables but GCC_FOR_BUILD are\n#   substituted in the Makefile.\n#\n# LICENSE\n#\n#   Copyright (c) 2008 Paolo Bonzini <bonzini@gnu.org>\n#\n#   Copying and distribution of this file, with or without modification, are\n#   permitted in any medium without royalty provided the copyright notice\n#   and this notice are preserved. This file is offered as-is, without any\n#   warranty.\n\n#serial 8\n\nAU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])\nAC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl\nAC_REQUIRE([AC_PROG_CC])dnl\nAC_REQUIRE([AC_PROG_CPP])dnl\nAC_REQUIRE([AC_EXEEXT])dnl\nAC_REQUIRE([AC_CANONICAL_HOST])dnl\n\ndnl Use the standard macros, but make them use other variable names\ndnl\npushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl\npushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl\npushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl\npushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl\npushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl\npushdef([ac_cv_exeext], ac_cv_build_exeext)dnl\npushdef([ac_cv_objext], ac_cv_build_objext)dnl\npushdef([ac_exeext], ac_build_exeext)dnl\npushdef([ac_objext], ac_build_objext)dnl\npushdef([CC], CC_FOR_BUILD)dnl\npushdef([CPP], CPP_FOR_BUILD)dnl\npushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl\npushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl\npushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl\npushdef([host], build)dnl\npushdef([host_alias], build_alias)dnl\npushdef([host_cpu], build_cpu)dnl\npushdef([host_vendor], build_vendor)dnl\npushdef([host_os], build_os)dnl\npushdef([ac_cv_host], ac_cv_build)dnl\npushdef([ac_cv_host_alias], ac_cv_build_alias)dnl\npushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl\npushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl\npushdef([ac_cv_host_os], ac_cv_build_os)dnl\npushdef([ac_cpp], ac_build_cpp)dnl\npushdef([ac_compile], ac_build_compile)dnl\npushdef([ac_link], ac_build_link)dnl\n\nsave_cross_compiling=$cross_compiling\nsave_ac_tool_prefix=$ac_tool_prefix\ncross_compiling=no\nac_tool_prefix=\n\nAC_PROG_CC\nAC_PROG_CPP\nAC_EXEEXT\n\nac_tool_prefix=$save_ac_tool_prefix\ncross_compiling=$save_cross_compiling\n\ndnl Restore the old definitions\ndnl\npopdef([ac_link])dnl\npopdef([ac_compile])dnl\npopdef([ac_cpp])dnl\npopdef([ac_cv_host_os])dnl\npopdef([ac_cv_host_vendor])dnl\npopdef([ac_cv_host_cpu])dnl\npopdef([ac_cv_host_alias])dnl\npopdef([ac_cv_host])dnl\npopdef([host_os])dnl\npopdef([host_vendor])dnl\npopdef([host_cpu])dnl\npopdef([host_alias])dnl\npopdef([host])dnl\npopdef([LDFLAGS])dnl\npopdef([CPPFLAGS])dnl\npopdef([CFLAGS])dnl\npopdef([CPP])dnl\npopdef([CC])dnl\npopdef([ac_objext])dnl\npopdef([ac_exeext])dnl\npopdef([ac_cv_objext])dnl\npopdef([ac_cv_exeext])dnl\npopdef([ac_cv_prog_cc_g])dnl\npopdef([ac_cv_prog_cc_cross])dnl\npopdef([ac_cv_prog_cc_works])dnl\npopdef([ac_cv_prog_gcc])dnl\npopdef([ac_cv_prog_CPP])dnl\n\ndnl Finally, set Makefile variables\ndnl\nBUILD_EXEEXT=$ac_build_exeext\nBUILD_OBJEXT=$ac_build_objext\nAC_SUBST(BUILD_EXEEXT)dnl\nAC_SUBST(BUILD_OBJEXT)dnl\nAC_SUBST([CFLAGS_FOR_BUILD])dnl\nAC_SUBST([CPPFLAGS_FOR_BUILD])dnl\nAC_SUBST([LDFLAGS_FOR_BUILD])dnl\n])\n"
  },
  {
    "path": "src/secp256k1/build-aux/m4/bitcoin_secp.m4",
    "content": "dnl libsecp25k1 helper checks\nAC_DEFUN([SECP_INT128_CHECK],[\nhas_int128=$ac_cv_type___int128\n])\n\ndnl escape \"$0x\" below using the m4 quadrigaph @S|@, and escape it again with a \\ for the shell.\nAC_DEFUN([SECP_64BIT_ASM_CHECK],[\nAC_MSG_CHECKING(for x86_64 assembly availability)\nAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n  #include <stdint.h>]],[[\n  uint64_t a = 11, tmp;\n  __asm__ __volatile__(\"movq \\@S|@0x100000000,%1; mulq %%rsi\" : \"+a\"(a) : \"S\"(tmp) : \"cc\", \"%rdx\");\n  ]])],[has_64bit_asm=yes],[has_64bit_asm=no])\nAC_MSG_RESULT([$has_64bit_asm])\n])\n\ndnl\nAC_DEFUN([SECP_OPENSSL_CHECK],[\n  has_libcrypto=no\n  m4_ifdef([PKG_CHECK_MODULES],[\n    PKG_CHECK_MODULES([CRYPTO], [libcrypto], [has_libcrypto=yes],[has_libcrypto=no])\n    if test x\"$has_libcrypto\" = x\"yes\"; then\n      TEMP_LIBS=\"$LIBS\"\n      LIBS=\"$LIBS $CRYPTO_LIBS\"\n      AC_CHECK_LIB(crypto, main,[AC_DEFINE(HAVE_LIBCRYPTO,1,[Define this symbol if libcrypto is installed])],[has_libcrypto=no])\n      LIBS=\"$TEMP_LIBS\"\n    fi\n  ])\n  if test x$has_libcrypto = xno; then\n    AC_CHECK_HEADER(openssl/crypto.h,[\n      AC_CHECK_LIB(crypto, main,[\n        has_libcrypto=yes\n        CRYPTO_LIBS=-lcrypto\n        AC_DEFINE(HAVE_LIBCRYPTO,1,[Define this symbol if libcrypto is installed])\n      ])\n    ])\n    LIBS=\n  fi\nif test x\"$has_libcrypto\" = x\"yes\" && test x\"$has_openssl_ec\" = x; then\n  AC_MSG_CHECKING(for EC functions in libcrypto)\n  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[\n    #include <openssl/ec.h>\n    #include <openssl/ecdsa.h>\n    #include <openssl/obj_mac.h>]],[[\n    EC_KEY *eckey = EC_KEY_new_by_curve_name(NID_secp256k1);\n    ECDSA_sign(0, NULL, 0, NULL, NULL, eckey);\n    ECDSA_verify(0, NULL, 0, NULL, 0, eckey);\n    EC_KEY_free(eckey);\n    ECDSA_SIG *sig_openssl;\n    sig_openssl = ECDSA_SIG_new();\n    (void)sig_openssl->r;\n    ECDSA_SIG_free(sig_openssl);\n  ]])],[has_openssl_ec=yes],[has_openssl_ec=no])\n  AC_MSG_RESULT([$has_openssl_ec])\nfi\n])\n\ndnl\nAC_DEFUN([SECP_GMP_CHECK],[\nif test x\"$has_gmp\" != x\"yes\"; then\n  CPPFLAGS_TEMP=\"$CPPFLAGS\"\n  CPPFLAGS=\"$GMP_CPPFLAGS $CPPFLAGS\"\n  LIBS_TEMP=\"$LIBS\"\n  LIBS=\"$GMP_LIBS $LIBS\"\n  AC_CHECK_HEADER(gmp.h,[AC_CHECK_LIB(gmp, __gmpz_init,[has_gmp=yes; GMP_LIBS=\"$GMP_LIBS -lgmp\"; AC_DEFINE(HAVE_LIBGMP,1,[Define this symbol if libgmp is installed])])])\n  CPPFLAGS=\"$CPPFLAGS_TEMP\"\n  LIBS=\"$LIBS_TEMP\"\nfi\n])\n"
  },
  {
    "path": "src/secp256k1/configure.ac",
    "content": "AC_PREREQ([2.60])\nAC_INIT([libsecp256k1],[0.1])\nAC_CONFIG_AUX_DIR([build-aux])\nAC_CONFIG_MACRO_DIR([build-aux/m4])\nAC_CANONICAL_HOST\nAH_TOP([#ifndef LIBSECP256K1_CONFIG_H])\nAH_TOP([#define LIBSECP256K1_CONFIG_H])\nAH_BOTTOM([#endif /*LIBSECP256K1_CONFIG_H*/])\nAM_INIT_AUTOMAKE([foreign subdir-objects])\nLT_INIT\n\ndnl make the compilation flags quiet unless V=1 is used\nm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])\n\nPKG_PROG_PKG_CONFIG\n\nAC_PATH_TOOL(AR, ar)\nAC_PATH_TOOL(RANLIB, ranlib)\nAC_PATH_TOOL(STRIP, strip)\nAX_PROG_CC_FOR_BUILD\n\nif test \"x$CFLAGS\" = \"x\"; then\n  CFLAGS=\"-g\"\nfi\n\nAM_PROG_CC_C_O\n\nAC_PROG_CC_C89\nif test x\"$ac_cv_prog_cc_c89\" = x\"no\"; then\n  AC_MSG_ERROR([c89 compiler support required])\nfi\nAM_PROG_AS\n\ncase $host_os in\n  *darwin*)\n     if  test x$cross_compiling != xyes; then\n       AC_PATH_PROG([BREW],brew,)\n       if test x$BREW != x; then\n         dnl These Homebrew packages may be keg-only, meaning that they won't be found\n         dnl in expected paths because they may conflict with system files. Ask\n         dnl Homebrew where each one is located, then adjust paths accordingly.\n\n         openssl_prefix=`$BREW --prefix openssl 2>/dev/null`\n         gmp_prefix=`$BREW --prefix gmp 2>/dev/null`\n         if test x$openssl_prefix != x; then\n           PKG_CONFIG_PATH=\"$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH\"\n           export PKG_CONFIG_PATH\n         fi\n         if test x$gmp_prefix != x; then\n           GMP_CPPFLAGS=\"-I$gmp_prefix/include\"\n           GMP_LIBS=\"-L$gmp_prefix/lib\"\n         fi\n       else\n         AC_PATH_PROG([PORT],port,)\n         dnl if homebrew isn't installed and macports is, add the macports default paths\n         dnl as a last resort.\n         if test x$PORT != x; then\n           CPPFLAGS=\"$CPPFLAGS -isystem /opt/local/include\"\n           LDFLAGS=\"$LDFLAGS -L/opt/local/lib\"\n         fi\n       fi\n     fi\n   ;;\nesac\n\nCFLAGS=\"$CFLAGS -W\"\n\nwarn_CFLAGS=\"-std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings\"\nsaved_CFLAGS=\"$CFLAGS\"\nCFLAGS=\"$CFLAGS $warn_CFLAGS\"\nAC_MSG_CHECKING([if ${CC} supports ${warn_CFLAGS}])\nAC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],\n    [ AC_MSG_RESULT([yes]) ],\n    [ AC_MSG_RESULT([no])\n      CFLAGS=\"$saved_CFLAGS\"\n    ])\n\nsaved_CFLAGS=\"$CFLAGS\"\nCFLAGS=\"$CFLAGS -fvisibility=hidden\"\nAC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])\nAC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])],\n    [ AC_MSG_RESULT([yes]) ],\n    [ AC_MSG_RESULT([no])\n      CFLAGS=\"$saved_CFLAGS\"\n    ])\n\nAC_ARG_ENABLE(benchmark,\n    AS_HELP_STRING([--enable-benchmark],[compile benchmark (default is no)]),\n    [use_benchmark=$enableval],\n    [use_benchmark=no])\n\nAC_ARG_ENABLE(coverage,\n    AS_HELP_STRING([--enable-coverage],[enable compiler flags to support kcov coverage analysis]),\n    [enable_coverage=$enableval],\n    [enable_coverage=no])\n\nAC_ARG_ENABLE(tests,\n    AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]),\n    [use_tests=$enableval],\n    [use_tests=yes])\n\nAC_ARG_ENABLE(openssl_tests,\n    AS_HELP_STRING([--enable-openssl-tests],[enable OpenSSL tests, if OpenSSL is available (default is auto)]),\n    [enable_openssl_tests=$enableval],\n    [enable_openssl_tests=auto])\n\nAC_ARG_ENABLE(experimental,\n    AS_HELP_STRING([--enable-experimental],[allow experimental configure options (default is no)]),\n    [use_experimental=$enableval],\n    [use_experimental=no])\n\nAC_ARG_ENABLE(exhaustive_tests,\n    AS_HELP_STRING([--enable-exhaustive-tests],[compile exhaustive tests (default is yes)]),\n    [use_exhaustive_tests=$enableval],\n    [use_exhaustive_tests=yes])\n\nAC_ARG_ENABLE(endomorphism,\n    AS_HELP_STRING([--enable-endomorphism],[enable endomorphism (default is no)]),\n    [use_endomorphism=$enableval],\n    [use_endomorphism=no])\n\nAC_ARG_ENABLE(ecmult_static_precomputation,\n    AS_HELP_STRING([--enable-ecmult-static-precomputation],[enable precomputed ecmult table for signing (default is yes)]),\n    [use_ecmult_static_precomputation=$enableval],\n    [use_ecmult_static_precomputation=auto])\n\nAC_ARG_ENABLE(module_ecdh,\n    AS_HELP_STRING([--enable-module-ecdh],[enable ECDH shared secret computation (experimental)]),\n    [enable_module_ecdh=$enableval],\n    [enable_module_ecdh=no])\n\nAC_ARG_ENABLE(module_recovery,\n    AS_HELP_STRING([--enable-module-recovery],[enable ECDSA pubkey recovery module (default is no)]),\n    [enable_module_recovery=$enableval],\n    [enable_module_recovery=no])\n\nAC_ARG_ENABLE(jni,\n    AS_HELP_STRING([--enable-jni],[enable libsecp256k1_jni (default is auto)]),\n    [use_jni=$enableval],\n    [use_jni=auto])\n\nAC_ARG_WITH([field], [AS_HELP_STRING([--with-field=64bit|32bit|auto],\n[Specify Field Implementation. Default is auto])],[req_field=$withval], [req_field=auto])\n\nAC_ARG_WITH([bignum], [AS_HELP_STRING([--with-bignum=gmp|no|auto],\n[Specify Bignum Implementation. Default is auto])],[req_bignum=$withval], [req_bignum=auto])\n\nAC_ARG_WITH([scalar], [AS_HELP_STRING([--with-scalar=64bit|32bit|auto],\n[Specify scalar implementation. Default is auto])],[req_scalar=$withval], [req_scalar=auto])\n\nAC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|arm|no|auto]\n[Specify assembly optimizations to use. Default is auto (experimental: arm)])],[req_asm=$withval], [req_asm=auto])\n\nAC_CHECK_TYPES([__int128])\n\nAC_MSG_CHECKING([for __builtin_expect])\nAC_COMPILE_IFELSE([AC_LANG_SOURCE([[void myfunc() {__builtin_expect(0,0);}]])],\n    [ AC_MSG_RESULT([yes]);AC_DEFINE(HAVE_BUILTIN_EXPECT,1,[Define this symbol if __builtin_expect is available]) ],\n    [ AC_MSG_RESULT([no])\n    ])\n\nif test x\"$enable_coverage\" = x\"yes\"; then\n    AC_DEFINE(COVERAGE, 1, [Define this symbol to compile out all VERIFY code])\n    CFLAGS=\"$CFLAGS -O0 --coverage\"\n    LDFLAGS=\"--coverage\"\nelse\n    CFLAGS=\"$CFLAGS -O3\"\nfi\n\nif test x\"$use_ecmult_static_precomputation\" != x\"no\"; then\n  save_cross_compiling=$cross_compiling\n  cross_compiling=no\n  TEMP_CC=\"$CC\"\n  CC=\"$CC_FOR_BUILD\"\n  AC_MSG_CHECKING([native compiler: ${CC_FOR_BUILD}])\n  AC_RUN_IFELSE(\n    [AC_LANG_PROGRAM([], [return 0])],\n    [working_native_cc=yes],\n    [working_native_cc=no],[dnl])\n  CC=\"$TEMP_CC\"\n  cross_compiling=$save_cross_compiling\n\n  if test x\"$working_native_cc\" = x\"no\"; then\n    set_precomp=no\n    if test x\"$use_ecmult_static_precomputation\" = x\"yes\";  then\n      AC_MSG_ERROR([${CC_FOR_BUILD} does not produce working binaries. Please set CC_FOR_BUILD])\n    else\n      AC_MSG_RESULT([${CC_FOR_BUILD} does not produce working binaries. Please set CC_FOR_BUILD])\n    fi\n  else\n    AC_MSG_RESULT([ok])\n    set_precomp=yes\n  fi\nelse\n  set_precomp=no\nfi\n\nif test x\"$req_asm\" = x\"auto\"; then\n  SECP_64BIT_ASM_CHECK\n  if test x\"$has_64bit_asm\" = x\"yes\"; then\n    set_asm=x86_64\n  fi\n  if test x\"$set_asm\" = x; then\n    set_asm=no\n  fi\nelse\n  set_asm=$req_asm\n  case $set_asm in\n  x86_64)\n    SECP_64BIT_ASM_CHECK\n    if test x\"$has_64bit_asm\" != x\"yes\"; then\n      AC_MSG_ERROR([x86_64 assembly optimization requested but not available])\n    fi\n    ;;\n  arm)\n    ;;\n  no)\n    ;;\n  *)\n    AC_MSG_ERROR([invalid assembly optimization selection])\n    ;;\n  esac\nfi\n\nif test x\"$req_field\" = x\"auto\"; then\n  if test x\"set_asm\" = x\"x86_64\"; then\n    set_field=64bit\n  fi\n  if test x\"$set_field\" = x; then\n    SECP_INT128_CHECK\n    if test x\"$has_int128\" = x\"yes\"; then\n      set_field=64bit\n    fi\n  fi\n  if test x\"$set_field\" = x; then\n    set_field=32bit\n  fi\nelse\n  set_field=$req_field\n  case $set_field in\n  64bit)\n    if test x\"$set_asm\" != x\"x86_64\"; then\n      SECP_INT128_CHECK\n      if test x\"$has_int128\" != x\"yes\"; then\n        AC_MSG_ERROR([64bit field explicitly requested but neither __int128 support or x86_64 assembly available])\n      fi\n    fi\n    ;;\n  32bit)\n    ;;\n  *)\n    AC_MSG_ERROR([invalid field implementation selection])\n    ;;\n  esac\nfi\n\nif test x\"$req_scalar\" = x\"auto\"; then\n  SECP_INT128_CHECK\n  if test x\"$has_int128\" = x\"yes\"; then\n    set_scalar=64bit\n  fi\n  if test x\"$set_scalar\" = x; then\n    set_scalar=32bit\n  fi\nelse\n  set_scalar=$req_scalar\n  case $set_scalar in\n  64bit)\n    SECP_INT128_CHECK\n    if test x\"$has_int128\" != x\"yes\"; then\n      AC_MSG_ERROR([64bit scalar explicitly requested but __int128 support not available])\n    fi\n    ;;\n  32bit)\n    ;;\n  *)\n    AC_MSG_ERROR([invalid scalar implementation selected])\n    ;;\n  esac\nfi\n\nif test x\"$req_bignum\" = x\"auto\"; then\n  SECP_GMP_CHECK\n  if test x\"$has_gmp\" = x\"yes\"; then\n    set_bignum=gmp\n  fi\n\n  if test x\"$set_bignum\" = x; then\n    set_bignum=no\n  fi\nelse\n  set_bignum=$req_bignum\n  case $set_bignum in\n  gmp)\n    SECP_GMP_CHECK\n    if test x\"$has_gmp\" != x\"yes\"; then\n      AC_MSG_ERROR([gmp bignum explicitly requested but libgmp not available])\n    fi\n    ;;\n  no)\n    ;;\n  *)\n    AC_MSG_ERROR([invalid bignum implementation selection])\n    ;;\n  esac\nfi\n\n# select assembly optimization\nuse_external_asm=no\n\ncase $set_asm in\nx86_64)\n  AC_DEFINE(USE_ASM_X86_64, 1, [Define this symbol to enable x86_64 assembly optimizations])\n  ;;\narm)\n  use_external_asm=yes\n  ;;\nno)\n  ;;\n*)\n  AC_MSG_ERROR([invalid assembly optimizations])\n  ;;\nesac\n\n# select field implementation\ncase $set_field in\n64bit)\n  AC_DEFINE(USE_FIELD_5X52, 1, [Define this symbol to use the FIELD_5X52 implementation])\n  ;;\n32bit)\n  AC_DEFINE(USE_FIELD_10X26, 1, [Define this symbol to use the FIELD_10X26 implementation])\n  ;;\n*)\n  AC_MSG_ERROR([invalid field implementation])\n  ;;\nesac\n\n# select bignum implementation\ncase $set_bignum in\ngmp)\n  AC_DEFINE(HAVE_LIBGMP, 1, [Define this symbol if libgmp is installed])\n  AC_DEFINE(USE_NUM_GMP, 1, [Define this symbol to use the gmp implementation for num])\n  AC_DEFINE(USE_FIELD_INV_NUM, 1, [Define this symbol to use the num-based field inverse implementation])\n  AC_DEFINE(USE_SCALAR_INV_NUM, 1, [Define this symbol to use the num-based scalar inverse implementation])\n  ;;\nno)\n  AC_DEFINE(USE_NUM_NONE, 1, [Define this symbol to use no num implementation])\n  AC_DEFINE(USE_FIELD_INV_BUILTIN, 1, [Define this symbol to use the native field inverse implementation])\n  AC_DEFINE(USE_SCALAR_INV_BUILTIN, 1, [Define this symbol to use the native scalar inverse implementation])\n  ;;\n*)\n  AC_MSG_ERROR([invalid bignum implementation])\n  ;;\nesac\n\n#select scalar implementation\ncase $set_scalar in\n64bit)\n  AC_DEFINE(USE_SCALAR_4X64, 1, [Define this symbol to use the 4x64 scalar implementation])\n  ;;\n32bit)\n  AC_DEFINE(USE_SCALAR_8X32, 1, [Define this symbol to use the 8x32 scalar implementation])\n  ;;\n*)\n  AC_MSG_ERROR([invalid scalar implementation])\n  ;;\nesac\n\nif test x\"$use_tests\" = x\"yes\"; then\n  SECP_OPENSSL_CHECK\n  if test x\"$has_openssl_ec\" = x\"yes\"; then\n    if test x\"$enable_openssl_tests\" != x\"no\"; then\n      AC_DEFINE(ENABLE_OPENSSL_TESTS, 1, [Define this symbol if OpenSSL EC functions are available])\n      SECP_TEST_INCLUDES=\"$SSL_CFLAGS $CRYPTO_CFLAGS\"\n      SECP_TEST_LIBS=\"$CRYPTO_LIBS\"\n\n      case $host in\n      *mingw*)\n        SECP_TEST_LIBS=\"$SECP_TEST_LIBS -lgdi32\"\n        ;;\n      esac\n    fi\n  else\n    if test x\"$enable_openssl_tests\" = x\"yes\"; then\n      AC_MSG_ERROR([OpenSSL tests requested but OpenSSL with EC support is not available])\n    fi\n  fi\nelse\n  if test x\"$enable_openssl_tests\" = x\"yes\"; then\n    AC_MSG_ERROR([OpenSSL tests requested but tests are not enabled])\n  fi\nfi\n\nif test x\"$use_jni\" != x\"no\"; then\n  AX_JNI_INCLUDE_DIR\n  have_jni_dependencies=yes\n  if test x\"$enable_module_ecdh\" = x\"no\"; then\n    have_jni_dependencies=no\n  fi\n  if test \"x$JNI_INCLUDE_DIRS\" = \"x\"; then\n    have_jni_dependencies=no\n  fi\n  if test \"x$have_jni_dependencies\" = \"xno\"; then\n    if test x\"$use_jni\" = x\"yes\"; then\n      AC_MSG_ERROR([jni support explicitly requested but headers/dependencies were not found. Enable ECDH and try again.])\n    fi\n    AC_MSG_WARN([jni headers/dependencies not found. jni support disabled])\n    use_jni=no\n  else\n    use_jni=yes\n    for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS; do\n      JNI_INCLUDES=\"$JNI_INCLUDES -I$JNI_INCLUDE_DIR\"\n    done\n  fi\nfi\n\nif test x\"$set_bignum\" = x\"gmp\"; then\n  SECP_LIBS=\"$SECP_LIBS $GMP_LIBS\"\n  SECP_INCLUDES=\"$SECP_INCLUDES $GMP_CPPFLAGS\"\nfi\n\nif test x\"$use_endomorphism\" = x\"yes\"; then\n  AC_DEFINE(USE_ENDOMORPHISM, 1, [Define this symbol to use endomorphism optimization])\nfi\n\nif test x\"$set_precomp\" = x\"yes\"; then\n  AC_DEFINE(USE_ECMULT_STATIC_PRECOMPUTATION, 1, [Define this symbol to use a statically generated ecmult table])\nfi\n\nif test x\"$enable_module_ecdh\" = x\"yes\"; then\n  AC_DEFINE(ENABLE_MODULE_ECDH, 1, [Define this symbol to enable the ECDH module])\nfi\n\nif test x\"$enable_module_recovery\" = x\"yes\"; then\n  AC_DEFINE(ENABLE_MODULE_RECOVERY, 1, [Define this symbol to enable the ECDSA pubkey recovery module])\nfi\n\nAC_C_BIGENDIAN()\n\nif test x\"$use_external_asm\" = x\"yes\"; then\n  AC_DEFINE(USE_EXTERNAL_ASM, 1, [Define this symbol if an external (non-inline) assembly implementation is used])\nfi\n\nAC_MSG_NOTICE([Using static precomputation: $set_precomp])\nAC_MSG_NOTICE([Using assembly optimizations: $set_asm])\nAC_MSG_NOTICE([Using field implementation: $set_field])\nAC_MSG_NOTICE([Using bignum implementation: $set_bignum])\nAC_MSG_NOTICE([Using scalar implementation: $set_scalar])\nAC_MSG_NOTICE([Using endomorphism optimizations: $use_endomorphism])\nAC_MSG_NOTICE([Building for coverage analysis: $enable_coverage])\nAC_MSG_NOTICE([Building ECDH module: $enable_module_ecdh])\nAC_MSG_NOTICE([Building ECDSA pubkey recovery module: $enable_module_recovery])\nAC_MSG_NOTICE([Using jni: $use_jni])\n\nif test x\"$enable_experimental\" = x\"yes\"; then\n  AC_MSG_NOTICE([******])\n  AC_MSG_NOTICE([WARNING: experimental build])\n  AC_MSG_NOTICE([Experimental features do not have stable APIs or properties, and may not be safe for production use.])\n  AC_MSG_NOTICE([Building ECDH module: $enable_module_ecdh])\n  AC_MSG_NOTICE([******])\nelse\n  if test x\"$enable_module_ecdh\" = x\"yes\"; then\n    AC_MSG_ERROR([ECDH module is experimental. Use --enable-experimental to allow.])\n  fi\n  if test x\"$set_asm\" = x\"arm\"; then\n    AC_MSG_ERROR([ARM assembly optimization is experimental. Use --enable-experimental to allow.])\n  fi\nfi\n\nAC_CONFIG_HEADERS([src/libsecp256k1-config.h])\nAC_CONFIG_FILES([Makefile libsecp256k1.pc])\nAC_SUBST(JNI_INCLUDES)\nAC_SUBST(SECP_INCLUDES)\nAC_SUBST(SECP_LIBS)\nAC_SUBST(SECP_TEST_LIBS)\nAC_SUBST(SECP_TEST_INCLUDES)\nAM_CONDITIONAL([ENABLE_COVERAGE], [test x\"$enable_coverage\" = x\"yes\"])\nAM_CONDITIONAL([USE_TESTS], [test x\"$use_tests\" != x\"no\"])\nAM_CONDITIONAL([USE_EXHAUSTIVE_TESTS], [test x\"$use_exhaustive_tests\" != x\"no\"])\nAM_CONDITIONAL([USE_BENCHMARK], [test x\"$use_benchmark\" = x\"yes\"])\nAM_CONDITIONAL([USE_ECMULT_STATIC_PRECOMPUTATION], [test x\"$set_precomp\" = x\"yes\"])\nAM_CONDITIONAL([ENABLE_MODULE_ECDH], [test x\"$enable_module_ecdh\" = x\"yes\"])\nAM_CONDITIONAL([ENABLE_MODULE_RECOVERY], [test x\"$enable_module_recovery\" = x\"yes\"])\nAM_CONDITIONAL([USE_JNI], [test x\"$use_jni\" == x\"yes\"])\nAM_CONDITIONAL([USE_EXTERNAL_ASM], [test x\"$use_external_asm\" = x\"yes\"])\nAM_CONDITIONAL([USE_ASM_ARM], [test x\"$set_asm\" = x\"arm\"])\n\ndnl make sure nothing new is exported so that we don't break the cache\nPKGCONFIG_PATH_TEMP=\"$PKG_CONFIG_PATH\"\nunset PKG_CONFIG_PATH\nPKG_CONFIG_PATH=\"$PKGCONFIG_PATH_TEMP\"\n\nAC_OUTPUT\n"
  },
  {
    "path": "src/secp256k1/contrib/lax_der_parsing.c",
    "content": "/**********************************************************************\n * Copyright (c) 2015 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#include <string.h>\n#include <secp256k1.h>\n\n#include \"lax_der_parsing.h\"\n\nint ecdsa_signature_parse_der_lax(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {\n    size_t rpos, rlen, spos, slen;\n    size_t pos = 0;\n    size_t lenbyte;\n    unsigned char tmpsig[64] = {0};\n    int overflow = 0;\n\n    /* Hack to initialize sig with a correctly-parsed but invalid signature. */\n    secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);\n\n    /* Sequence tag byte */\n    if (pos == inputlen || input[pos] != 0x30) {\n        return 0;\n    }\n    pos++;\n\n    /* Sequence length bytes */\n    if (pos == inputlen) {\n        return 0;\n    }\n    lenbyte = input[pos++];\n    if (lenbyte & 0x80) {\n        lenbyte -= 0x80;\n        if (pos + lenbyte > inputlen) {\n            return 0;\n        }\n        pos += lenbyte;\n    }\n\n    /* Integer tag byte for R */\n    if (pos == inputlen || input[pos] != 0x02) {\n        return 0;\n    }\n    pos++;\n\n    /* Integer length for R */\n    if (pos == inputlen) {\n        return 0;\n    }\n    lenbyte = input[pos++];\n    if (lenbyte & 0x80) {\n        lenbyte -= 0x80;\n        if (pos + lenbyte > inputlen) {\n            return 0;\n        }\n        while (lenbyte > 0 && input[pos] == 0) {\n            pos++;\n            lenbyte--;\n        }\n        if (lenbyte >= sizeof(size_t)) {\n            return 0;\n        }\n        rlen = 0;\n        while (lenbyte > 0) {\n            rlen = (rlen << 8) + input[pos];\n            pos++;\n            lenbyte--;\n        }\n    } else {\n        rlen = lenbyte;\n    }\n    if (rlen > inputlen - pos) {\n        return 0;\n    }\n    rpos = pos;\n    pos += rlen;\n\n    /* Integer tag byte for S */\n    if (pos == inputlen || input[pos] != 0x02) {\n        return 0;\n    }\n    pos++;\n\n    /* Integer length for S */\n    if (pos == inputlen) {\n        return 0;\n    }\n    lenbyte = input[pos++];\n    if (lenbyte & 0x80) {\n        lenbyte -= 0x80;\n        if (pos + lenbyte > inputlen) {\n            return 0;\n        }\n        while (lenbyte > 0 && input[pos] == 0) {\n            pos++;\n            lenbyte--;\n        }\n        if (lenbyte >= sizeof(size_t)) {\n            return 0;\n        }\n        slen = 0;\n        while (lenbyte > 0) {\n            slen = (slen << 8) + input[pos];\n            pos++;\n            lenbyte--;\n        }\n    } else {\n        slen = lenbyte;\n    }\n    if (slen > inputlen - pos) {\n        return 0;\n    }\n    spos = pos;\n    pos += slen;\n\n    /* Ignore leading zeroes in R */\n    while (rlen > 0 && input[rpos] == 0) {\n        rlen--;\n        rpos++;\n    }\n    /* Copy R value */\n    if (rlen > 32) {\n        overflow = 1;\n    } else {\n        memcpy(tmpsig + 32 - rlen, input + rpos, rlen);\n    }\n\n    /* Ignore leading zeroes in S */\n    while (slen > 0 && input[spos] == 0) {\n        slen--;\n        spos++;\n    }\n    /* Copy S value */\n    if (slen > 32) {\n        overflow = 1;\n    } else {\n        memcpy(tmpsig + 64 - slen, input + spos, slen);\n    }\n\n    if (!overflow) {\n        overflow = !secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);\n    }\n    if (overflow) {\n        memset(tmpsig, 0, 64);\n        secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);\n    }\n    return 1;\n}\n\n"
  },
  {
    "path": "src/secp256k1/contrib/lax_der_parsing.h",
    "content": "/**********************************************************************\n * Copyright (c) 2015 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n/****\n * Please do not link this file directly. It is not part of the libsecp256k1\n * project and does not promise any stability in its API, functionality or\n * presence. Projects which use this code should instead copy this header\n * and its accompanying .c file directly into their codebase.\n ****/\n\n/* This file defines a function that parses DER with various errors and\n * violations. This is not a part of the library itself, because the allowed\n * violations are chosen arbitrarily and do not follow or establish any\n * standard.\n *\n * In many places it matters that different implementations do not only accept\n * the same set of valid signatures, but also reject the same set of signatures.\n * The only means to accomplish that is by strictly obeying a standard, and not\n * accepting anything else.\n *\n * Nonetheless, sometimes there is a need for compatibility with systems that\n * use signatures which do not strictly obey DER. The snippet below shows how\n * certain violations are easily supported. You may need to adapt it.\n *\n * Do not use this for new systems. Use well-defined DER or compact signatures\n * instead if you have the choice (see secp256k1_ecdsa_signature_parse_der and\n * secp256k1_ecdsa_signature_parse_compact).\n *\n * The supported violations are:\n * - All numbers are parsed as nonnegative integers, even though X.609-0207\n *   section 8.3.3 specifies that integers are always encoded as two's\n *   complement.\n * - Integers can have length 0, even though section 8.3.1 says they can't.\n * - Integers with overly long padding are accepted, violation section\n *   8.3.2.\n * - 127-byte long length descriptors are accepted, even though section\n *   8.1.3.5.c says that they are not.\n * - Trailing garbage data inside or after the signature is ignored.\n * - The length descriptor of the sequence is ignored.\n *\n * Compared to for example OpenSSL, many violations are NOT supported:\n * - Using overly long tag descriptors for the sequence or integers inside,\n *   violating section 8.1.2.2.\n * - Encoding primitive integers as constructed values, violating section\n *   8.3.1.\n */\n\n#ifndef SECP256K1_CONTRIB_LAX_DER_PARSING_H\n#define SECP256K1_CONTRIB_LAX_DER_PARSING_H\n\n#include <secp256k1.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** Parse a signature in \"lax DER\" format\n *\n *  Returns: 1 when the signature could be parsed, 0 otherwise.\n *  Args: ctx:      a secp256k1 context object\n *  Out:  sig:      a pointer to a signature object\n *  In:   input:    a pointer to the signature to be parsed\n *        inputlen: the length of the array pointed to be input\n *\n *  This function will accept any valid DER encoded signature, even if the\n *  encoded numbers are out of range. In addition, it will accept signatures\n *  which violate the DER spec in various ways. Its purpose is to allow\n *  validation of the Bitcoin blockchain, which includes non-DER signatures\n *  from before the network rules were updated to enforce DER. Note that\n *  the set of supported violations is a strict subset of what OpenSSL will\n *  accept.\n *\n *  After the call, sig will always be initialized. If parsing failed or the\n *  encoded numbers are out of range, signature validation with it is\n *  guaranteed to fail for every message and public key.\n */\nint ecdsa_signature_parse_der_lax(\n    const secp256k1_context* ctx,\n    secp256k1_ecdsa_signature* sig,\n    const unsigned char *input,\n    size_t inputlen\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SECP256K1_CONTRIB_LAX_DER_PARSING_H */\n"
  },
  {
    "path": "src/secp256k1/contrib/lax_der_privatekey_parsing.c",
    "content": "/**********************************************************************\n * Copyright (c) 2014, 2015 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#include <string.h>\n#include <secp256k1.h>\n\n#include \"lax_der_privatekey_parsing.h\"\n\nint ec_privkey_import_der(const secp256k1_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {\n    const unsigned char *end = privkey + privkeylen;\n    int lenb = 0;\n    int len = 0;\n    memset(out32, 0, 32);\n    /* sequence header */\n    if (end < privkey+1 || *privkey != 0x30) {\n        return 0;\n    }\n    privkey++;\n    /* sequence length constructor */\n    if (end < privkey+1 || !(*privkey & 0x80)) {\n        return 0;\n    }\n    lenb = *privkey & ~0x80; privkey++;\n    if (lenb < 1 || lenb > 2) {\n        return 0;\n    }\n    if (end < privkey+lenb) {\n        return 0;\n    }\n    /* sequence length */\n    len = privkey[lenb-1] | (lenb > 1 ? privkey[lenb-2] << 8 : 0);\n    privkey += lenb;\n    if (end < privkey+len) {\n        return 0;\n    }\n    /* sequence element 0: version number (=1) */\n    if (end < privkey+3 || privkey[0] != 0x02 || privkey[1] != 0x01 || privkey[2] != 0x01) {\n        return 0;\n    }\n    privkey += 3;\n    /* sequence element 1: octet string, up to 32 bytes */\n    if (end < privkey+2 || privkey[0] != 0x04 || privkey[1] > 0x20 || end < privkey+2+privkey[1]) {\n        return 0;\n    }\n    memcpy(out32 + 32 - privkey[1], privkey + 2, privkey[1]);\n    if (!secp256k1_ec_seckey_verify(ctx, out32)) {\n        memset(out32, 0, 32);\n        return 0;\n    }\n    return 1;\n}\n\nint ec_privkey_export_der(const secp256k1_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {\n    secp256k1_pubkey pubkey;\n    size_t pubkeylen = 0;\n    if (!secp256k1_ec_pubkey_create(ctx, &pubkey, key32)) {\n        *privkeylen = 0;\n        return 0;\n    }\n    if (compressed) {\n        static const unsigned char begin[] = {\n            0x30,0x81,0xD3,0x02,0x01,0x01,0x04,0x20\n        };\n        static const unsigned char middle[] = {\n            0xA0,0x81,0x85,0x30,0x81,0x82,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48,\n            0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04,\n            0x21,0x02,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87,\n            0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8,\n            0x17,0x98,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E,\n            0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x24,0x03,0x22,0x00\n        };\n        unsigned char *ptr = privkey;\n        memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin);\n        memcpy(ptr, key32, 32); ptr += 32;\n        memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);\n        pubkeylen = 33;\n        secp256k1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);\n        ptr += pubkeylen;\n        *privkeylen = ptr - privkey;\n    } else {\n        static const unsigned char begin[] = {\n            0x30,0x82,0x01,0x13,0x02,0x01,0x01,0x04,0x20\n        };\n        static const unsigned char middle[] = {\n            0xA0,0x81,0xA5,0x30,0x81,0xA2,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48,\n            0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04,\n            0x41,0x04,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87,\n            0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8,\n            0x17,0x98,0x48,0x3A,0xDA,0x77,0x26,0xA3,0xC4,0x65,0x5D,0xA4,0xFB,0xFC,0x0E,0x11,\n            0x08,0xA8,0xFD,0x17,0xB4,0x48,0xA6,0x85,0x54,0x19,0x9C,0x47,0xD0,0x8F,0xFB,0x10,\n            0xD4,0xB8,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E,\n            0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x44,0x03,0x42,0x00\n        };\n        unsigned char *ptr = privkey;\n        memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin);\n        memcpy(ptr, key32, 32); ptr += 32;\n        memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);\n        pubkeylen = 65;\n        secp256k1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);\n        ptr += pubkeylen;\n        *privkeylen = ptr - privkey;\n    }\n    return 1;\n}\n"
  },
  {
    "path": "src/secp256k1/contrib/lax_der_privatekey_parsing.h",
    "content": "/**********************************************************************\n * Copyright (c) 2014, 2015 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n/****\n * Please do not link this file directly. It is not part of the libsecp256k1\n * project and does not promise any stability in its API, functionality or\n * presence. Projects which use this code should instead copy this header\n * and its accompanying .c file directly into their codebase.\n ****/\n\n/* This file contains code snippets that parse DER private keys with\n * various errors and violations.  This is not a part of the library\n * itself, because the allowed violations are chosen arbitrarily and\n * do not follow or establish any standard.\n *\n * It also contains code to serialize private keys in a compatible\n * manner.\n *\n * These functions are meant for compatibility with applications\n * that require BER encoded keys. When working with secp256k1-specific\n * code, the simple 32-byte private keys normally used by the\n * library are sufficient.\n */\n\n#ifndef SECP256K1_CONTRIB_BER_PRIVATEKEY_H\n#define SECP256K1_CONTRIB_BER_PRIVATEKEY_H\n\n#include <secp256k1.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** Export a private key in DER format.\n *\n *  Returns: 1 if the private key was valid.\n *  Args: ctx:        pointer to a context object, initialized for signing (cannot\n *                    be NULL)\n *  Out: privkey:     pointer to an array for storing the private key in BER.\n *                    Should have space for 279 bytes, and cannot be NULL.\n *       privkeylen:  Pointer to an int where the length of the private key in\n *                    privkey will be stored.\n *  In:  seckey:      pointer to a 32-byte secret key to export.\n *       compressed:  1 if the key should be exported in\n *                    compressed format, 0 otherwise\n *\n *  This function is purely meant for compatibility with applications that\n *  require BER encoded keys. When working with secp256k1-specific code, the\n *  simple 32-byte private keys are sufficient.\n *\n *  Note that this function does not guarantee correct DER output. It is\n *  guaranteed to be parsable by secp256k1_ec_privkey_import_der\n */\nSECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(\n    const secp256k1_context* ctx,\n    unsigned char *privkey,\n    size_t *privkeylen,\n    const unsigned char *seckey,\n    int compressed\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);\n\n/** Import a private key in DER format.\n * Returns: 1 if a private key was extracted.\n * Args: ctx:        pointer to a context object (cannot be NULL).\n * Out:  seckey:     pointer to a 32-byte array for storing the private key.\n *                   (cannot be NULL).\n * In:   privkey:    pointer to a private key in DER format (cannot be NULL).\n *       privkeylen: length of the DER private key pointed to be privkey.\n *\n * This function will accept more than just strict DER, and even allow some BER\n * violations. The public key stored inside the DER-encoded private key is not\n * verified for correctness, nor are the curve parameters. Use this function\n * only if you know in advance it is supposed to contain a secp256k1 private\n * key.\n */\nSECP256K1_WARN_UNUSED_RESULT int ec_privkey_import_der(\n    const secp256k1_context* ctx,\n    unsigned char *seckey,\n    const unsigned char *privkey,\n    size_t privkeylen\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SECP256K1_CONTRIB_BER_PRIVATEKEY_H */\n"
  },
  {
    "path": "src/secp256k1/include/secp256k1.h",
    "content": "#ifndef SECP256K1_H\n#define SECP256K1_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <stddef.h>\n\n/* These rules specify the order of arguments in API calls:\n *\n * 1. Context pointers go first, followed by output arguments, combined\n *    output/input arguments, and finally input-only arguments.\n * 2. Array lengths always immediately the follow the argument whose length\n *    they describe, even if this violates rule 1.\n * 3. Within the OUT/OUTIN/IN groups, pointers to data that is typically generated\n *    later go first. This means: signatures, public nonces, private nonces,\n *    messages, public keys, secret keys, tweaks.\n * 4. Arguments that are not data pointers go last, from more complex to less\n *    complex: function pointers, algorithm names, messages, void pointers,\n *    counts, flags, booleans.\n * 5. Opaque data pointers follow the function pointer they are to be passed to.\n */\n\n/** Opaque data structure that holds context information (precomputed tables etc.).\n *\n *  The purpose of context structures is to cache large precomputed data tables\n *  that are expensive to construct, and also to maintain the randomization data\n *  for blinding.\n *\n *  Do not create a new context object for each operation, as construction is\n *  far slower than all other API calls (~100 times slower than an ECDSA\n *  verification).\n *\n *  A constructed context can safely be used from multiple threads\n *  simultaneously, but API call that take a non-const pointer to a context\n *  need exclusive access to it. In particular this is the case for\n *  secp256k1_context_destroy and secp256k1_context_randomize.\n *\n *  Regarding randomization, either do it once at creation time (in which case\n *  you do not need any locking for the other calls), or use a read-write lock.\n */\ntypedef struct secp256k1_context_struct secp256k1_context;\n\n/** Opaque data structure that holds a parsed and valid public key.\n *\n *  The exact representation of data inside is implementation defined and not\n *  guaranteed to be portable between different platforms or versions. It is\n *  however guaranteed to be 64 bytes in size, and can be safely copied/moved.\n *  If you need to convert to a format suitable for storage, transmission, or\n *  comparison, use secp256k1_ec_pubkey_serialize and secp256k1_ec_pubkey_parse.\n */\ntypedef struct {\n    unsigned char data[64];\n} secp256k1_pubkey;\n\n/** Opaque data structured that holds a parsed ECDSA signature.\n *\n *  The exact representation of data inside is implementation defined and not\n *  guaranteed to be portable between different platforms or versions. It is\n *  however guaranteed to be 64 bytes in size, and can be safely copied/moved.\n *  If you need to convert to a format suitable for storage, transmission, or\n *  comparison, use the secp256k1_ecdsa_signature_serialize_* and\n *  secp256k1_ecdsa_signature_parse_* functions.\n */\ntypedef struct {\n    unsigned char data[64];\n} secp256k1_ecdsa_signature;\n\n/** A pointer to a function to deterministically generate a nonce.\n *\n * Returns: 1 if a nonce was successfully generated. 0 will cause signing to fail.\n * Out:     nonce32:   pointer to a 32-byte array to be filled by the function.\n * In:      msg32:     the 32-byte message hash being verified (will not be NULL)\n *          key32:     pointer to a 32-byte secret key (will not be NULL)\n *          algo16:    pointer to a 16-byte array describing the signature\n *                     algorithm (will be NULL for ECDSA for compatibility).\n *          data:      Arbitrary data pointer that is passed through.\n *          attempt:   how many iterations we have tried to find a nonce.\n *                     This will almost always be 0, but different attempt values\n *                     are required to result in a different nonce.\n *\n * Except for test cases, this function should compute some cryptographic hash of\n * the message, the algorithm, the key and the attempt.\n */\ntypedef int (*secp256k1_nonce_function)(\n    unsigned char *nonce32,\n    const unsigned char *msg32,\n    const unsigned char *key32,\n    const unsigned char *algo16,\n    void *data,\n    unsigned int attempt\n);\n\n# if !defined(SECP256K1_GNUC_PREREQ)\n#  if defined(__GNUC__)&&defined(__GNUC_MINOR__)\n#   define SECP256K1_GNUC_PREREQ(_maj,_min) \\\n ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min))\n#  else\n#   define SECP256K1_GNUC_PREREQ(_maj,_min) 0\n#  endif\n# endif\n\n# if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )\n#  if SECP256K1_GNUC_PREREQ(2,7)\n#   define SECP256K1_INLINE __inline__\n#  elif (defined(_MSC_VER))\n#   define SECP256K1_INLINE __inline\n#  else\n#   define SECP256K1_INLINE\n#  endif\n# else\n#  define SECP256K1_INLINE inline\n# endif\n\n#ifndef SECP256K1_API\n# if defined(_WIN32)\n#  ifdef SECP256K1_BUILD\n#   define SECP256K1_API __declspec(dllexport)\n#  else\n#   define SECP256K1_API\n#  endif\n# elif defined(__GNUC__) && defined(SECP256K1_BUILD)\n#  define SECP256K1_API __attribute__ ((visibility (\"default\")))\n# else\n#  define SECP256K1_API\n# endif\n#endif\n\n/**Warning attributes\n  * NONNULL is not used if SECP256K1_BUILD is set to avoid the compiler optimizing out\n  * some paranoid null checks. */\n# if defined(__GNUC__) && SECP256K1_GNUC_PREREQ(3, 4)\n#  define SECP256K1_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__))\n# else\n#  define SECP256K1_WARN_UNUSED_RESULT\n# endif\n# if !defined(SECP256K1_BUILD) && defined(__GNUC__) && SECP256K1_GNUC_PREREQ(3, 4)\n#  define SECP256K1_ARG_NONNULL(_x)  __attribute__ ((__nonnull__(_x)))\n# else\n#  define SECP256K1_ARG_NONNULL(_x)\n# endif\n\n/** All flags' lower 8 bits indicate what they're for. Do not use directly. */\n#define SECP256K1_FLAGS_TYPE_MASK ((1 << 8) - 1)\n#define SECP256K1_FLAGS_TYPE_CONTEXT (1 << 0)\n#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)\n/** The higher bits contain the actual data. Do not use directly. */\n#define SECP256K1_FLAGS_BIT_CONTEXT_VERIFY (1 << 8)\n#define SECP256K1_FLAGS_BIT_CONTEXT_SIGN (1 << 9)\n#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)\n\n/** Flags to pass to secp256k1_context_create. */\n#define SECP256K1_CONTEXT_VERIFY (SECP256K1_FLAGS_TYPE_CONTEXT | SECP256K1_FLAGS_BIT_CONTEXT_VERIFY)\n#define SECP256K1_CONTEXT_SIGN (SECP256K1_FLAGS_TYPE_CONTEXT | SECP256K1_FLAGS_BIT_CONTEXT_SIGN)\n#define SECP256K1_CONTEXT_NONE (SECP256K1_FLAGS_TYPE_CONTEXT)\n\n/** Flag to pass to secp256k1_ec_pubkey_serialize and secp256k1_ec_privkey_export. */\n#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)\n#define SECP256K1_EC_UNCOMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION)\n\n/** Prefix byte used to tag various encoded curvepoints for specific purposes */\n#define SECP256K1_TAG_PUBKEY_EVEN 0x02\n#define SECP256K1_TAG_PUBKEY_ODD 0x03\n#define SECP256K1_TAG_PUBKEY_UNCOMPRESSED 0x04\n#define SECP256K1_TAG_PUBKEY_HYBRID_EVEN 0x06\n#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07\n\n/** Create a secp256k1 context object.\n *\n *  Returns: a newly created context object.\n *  In:      flags: which parts of the context to initialize.\n *\n *  See also secp256k1_context_randomize.\n */\nSECP256K1_API secp256k1_context* secp256k1_context_create(\n    unsigned int flags\n) SECP256K1_WARN_UNUSED_RESULT;\n\n/** Copies a secp256k1 context object.\n *\n *  Returns: a newly created context object.\n *  Args:    ctx: an existing context to copy (cannot be NULL)\n */\nSECP256K1_API secp256k1_context* secp256k1_context_clone(\n    const secp256k1_context* ctx\n) SECP256K1_ARG_NONNULL(1) SECP256K1_WARN_UNUSED_RESULT;\n\n/** Destroy a secp256k1 context object.\n *\n *  The context pointer may not be used afterwards.\n *  Args:   ctx: an existing context to destroy (cannot be NULL)\n */\nSECP256K1_API void secp256k1_context_destroy(\n    secp256k1_context* ctx\n);\n\n/** Set a callback function to be called when an illegal argument is passed to\n *  an API call. It will only trigger for violations that are mentioned\n *  explicitly in the header.\n *\n *  The philosophy is that these shouldn't be dealt with through a\n *  specific return value, as calling code should not have branches to deal with\n *  the case that this code itself is broken.\n *\n *  On the other hand, during debug stage, one would want to be informed about\n *  such mistakes, and the default (crashing) may be inadvisable.\n *  When this callback is triggered, the API function called is guaranteed not\n *  to cause a crash, though its return value and output arguments are\n *  undefined.\n *\n *  Args: ctx:  an existing context object (cannot be NULL)\n *  In:   fun:  a pointer to a function to call when an illegal argument is\n *              passed to the API, taking a message and an opaque pointer\n *              (NULL restores a default handler that calls abort).\n *        data: the opaque pointer to pass to fun above.\n */\nSECP256K1_API void secp256k1_context_set_illegal_callback(\n    secp256k1_context* ctx,\n    void (*fun)(const char* message, void* data),\n    const void* data\n) SECP256K1_ARG_NONNULL(1);\n\n/** Set a callback function to be called when an internal consistency check\n *  fails. The default is crashing.\n *\n *  This can only trigger in case of a hardware failure, miscompilation,\n *  memory corruption, serious bug in the library, or other error would can\n *  otherwise result in undefined behaviour. It will not trigger due to mere\n *  incorrect usage of the API (see secp256k1_context_set_illegal_callback\n *  for that). After this callback returns, anything may happen, including\n *  crashing.\n *\n *  Args: ctx:  an existing context object (cannot be NULL)\n *  In:   fun:  a pointer to a function to call when an internal error occurs,\n *              taking a message and an opaque pointer (NULL restores a default\n *              handler that calls abort).\n *        data: the opaque pointer to pass to fun above.\n */\nSECP256K1_API void secp256k1_context_set_error_callback(\n    secp256k1_context* ctx,\n    void (*fun)(const char* message, void* data),\n    const void* data\n) SECP256K1_ARG_NONNULL(1);\n\n/** Parse a variable-length public key into the pubkey object.\n *\n *  Returns: 1 if the public key was fully valid.\n *           0 if the public key could not be parsed or is invalid.\n *  Args: ctx:      a secp256k1 context object.\n *  Out:  pubkey:   pointer to a pubkey object. If 1 is returned, it is set to a\n *                  parsed version of input. If not, its value is undefined.\n *  In:   input:    pointer to a serialized public key\n *        inputlen: length of the array pointed to by input\n *\n *  This function supports parsing compressed (33 bytes, header byte 0x02 or\n *  0x03), uncompressed (65 bytes, header byte 0x04), or hybrid (65 bytes, header\n *  byte 0x06 or 0x07) format public keys.\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_parse(\n    const secp256k1_context* ctx,\n    secp256k1_pubkey* pubkey,\n    const unsigned char *input,\n    size_t inputlen\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Serialize a pubkey object into a serialized byte sequence.\n *\n *  Returns: 1 always.\n *  Args:   ctx:        a secp256k1 context object.\n *  Out:    output:     a pointer to a 65-byte (if compressed==0) or 33-byte (if\n *                      compressed==1) byte array to place the serialized key\n *                      in.\n *  In/Out: outputlen:  a pointer to an integer which is initially set to the\n *                      size of output, and is overwritten with the written\n *                      size.\n *  In:     pubkey:     a pointer to a secp256k1_pubkey containing an\n *                      initialized public key.\n *          flags:      SECP256K1_EC_COMPRESSED if serialization should be in\n *                      compressed format, otherwise SECP256K1_EC_UNCOMPRESSED.\n */\nSECP256K1_API int secp256k1_ec_pubkey_serialize(\n    const secp256k1_context* ctx,\n    unsigned char *output,\n    size_t *outputlen,\n    const secp256k1_pubkey* pubkey,\n    unsigned int flags\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);\n\n/** Parse an ECDSA signature in compact (64 bytes) format.\n *\n *  Returns: 1 when the signature could be parsed, 0 otherwise.\n *  Args: ctx:      a secp256k1 context object\n *  Out:  sig:      a pointer to a signature object\n *  In:   input64:  a pointer to the 64-byte array to parse\n *\n *  The signature must consist of a 32-byte big endian R value, followed by a\n *  32-byte big endian S value. If R or S fall outside of [0..order-1], the\n *  encoding is invalid. R and S with value 0 are allowed in the encoding.\n *\n *  After the call, sig will always be initialized. If parsing failed or R or\n *  S are zero, the resulting sig value is guaranteed to fail validation for any\n *  message and public key.\n */\nSECP256K1_API int secp256k1_ecdsa_signature_parse_compact(\n    const secp256k1_context* ctx,\n    secp256k1_ecdsa_signature* sig,\n    const unsigned char *input64\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Parse a DER ECDSA signature.\n *\n *  Returns: 1 when the signature could be parsed, 0 otherwise.\n *  Args: ctx:      a secp256k1 context object\n *  Out:  sig:      a pointer to a signature object\n *  In:   input:    a pointer to the signature to be parsed\n *        inputlen: the length of the array pointed to be input\n *\n *  This function will accept any valid DER encoded signature, even if the\n *  encoded numbers are out of range.\n *\n *  After the call, sig will always be initialized. If parsing failed or the\n *  encoded numbers are out of range, signature validation with it is\n *  guaranteed to fail for every message and public key.\n */\nSECP256K1_API int secp256k1_ecdsa_signature_parse_der(\n    const secp256k1_context* ctx,\n    secp256k1_ecdsa_signature* sig,\n    const unsigned char *input,\n    size_t inputlen\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Serialize an ECDSA signature in DER format.\n *\n *  Returns: 1 if enough space was available to serialize, 0 otherwise\n *  Args:   ctx:       a secp256k1 context object\n *  Out:    output:    a pointer to an array to store the DER serialization\n *  In/Out: outputlen: a pointer to a length integer. Initially, this integer\n *                     should be set to the length of output. After the call\n *                     it will be set to the length of the serialization (even\n *                     if 0 was returned).\n *  In:     sig:       a pointer to an initialized signature object\n */\nSECP256K1_API int secp256k1_ecdsa_signature_serialize_der(\n    const secp256k1_context* ctx,\n    unsigned char *output,\n    size_t *outputlen,\n    const secp256k1_ecdsa_signature* sig\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);\n\n/** Serialize an ECDSA signature in compact (64 byte) format.\n *\n *  Returns: 1\n *  Args:   ctx:       a secp256k1 context object\n *  Out:    output64:  a pointer to a 64-byte array to store the compact serialization\n *  In:     sig:       a pointer to an initialized signature object\n *\n *  See secp256k1_ecdsa_signature_parse_compact for details about the encoding.\n */\nSECP256K1_API int secp256k1_ecdsa_signature_serialize_compact(\n    const secp256k1_context* ctx,\n    unsigned char *output64,\n    const secp256k1_ecdsa_signature* sig\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Verify an ECDSA signature.\n *\n *  Returns: 1: correct signature\n *           0: incorrect or unparseable signature\n *  Args:    ctx:       a secp256k1 context object, initialized for verification.\n *  In:      sig:       the signature being verified (cannot be NULL)\n *           msg32:     the 32-byte message hash being verified (cannot be NULL)\n *           pubkey:    pointer to an initialized public key to verify with (cannot be NULL)\n *\n * To avoid accepting malleable signatures, only ECDSA signatures in lower-S\n * form are accepted.\n *\n * If you need to accept ECDSA signatures from sources that do not obey this\n * rule, apply secp256k1_ecdsa_signature_normalize to the signature prior to\n * validation, but be aware that doing so results in malleable signatures.\n *\n * For details, see the comments for that function.\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_verify(\n    const secp256k1_context* ctx,\n    const secp256k1_ecdsa_signature *sig,\n    const unsigned char *msg32,\n    const secp256k1_pubkey *pubkey\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);\n\n/** Convert a signature to a normalized lower-S form.\n *\n *  Returns: 1 if sigin was not normalized, 0 if it already was.\n *  Args: ctx:    a secp256k1 context object\n *  Out:  sigout: a pointer to a signature to fill with the normalized form,\n *                or copy if the input was already normalized. (can be NULL if\n *                you're only interested in whether the input was already\n *                normalized).\n *  In:   sigin:  a pointer to a signature to check/normalize (cannot be NULL,\n *                can be identical to sigout)\n *\n *  With ECDSA a third-party can forge a second distinct signature of the same\n *  message, given a single initial signature, but without knowing the key. This\n *  is done by negating the S value modulo the order of the curve, 'flipping'\n *  the sign of the random point R which is not included in the signature.\n *\n *  Forgery of the same message isn't universally problematic, but in systems\n *  where message malleability or uniqueness of signatures is important this can\n *  cause issues. This forgery can be blocked by all verifiers forcing signers\n *  to use a normalized form.\n *\n *  The lower-S form reduces the size of signatures slightly on average when\n *  variable length encodings (such as DER) are used and is cheap to verify,\n *  making it a good choice. Security of always using lower-S is assured because\n *  anyone can trivially modify a signature after the fact to enforce this\n *  property anyway.\n *\n *  The lower S value is always between 0x1 and\n *  0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0,\n *  inclusive.\n *\n *  No other forms of ECDSA malleability are known and none seem likely, but\n *  there is no formal proof that ECDSA, even with this additional restriction,\n *  is free of other malleability. Commonly used serialization schemes will also\n *  accept various non-unique encodings, so care should be taken when this\n *  property is required for an application.\n *\n *  The secp256k1_ecdsa_sign function will by default create signatures in the\n *  lower-S form, and secp256k1_ecdsa_verify will not accept others. In case\n *  signatures come from a system that cannot enforce this property,\n *  secp256k1_ecdsa_signature_normalize must be called before verification.\n */\nSECP256K1_API int secp256k1_ecdsa_signature_normalize(\n    const secp256k1_context* ctx,\n    secp256k1_ecdsa_signature *sigout,\n    const secp256k1_ecdsa_signature *sigin\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(3);\n\n/** An implementation of RFC6979 (using HMAC-SHA256) as nonce generation function.\n * If a data pointer is passed, it is assumed to be a pointer to 32 bytes of\n * extra entropy.\n */\nSECP256K1_API extern const secp256k1_nonce_function secp256k1_nonce_function_rfc6979;\n\n/** A default safe nonce generation function (currently equal to secp256k1_nonce_function_rfc6979). */\nSECP256K1_API extern const secp256k1_nonce_function secp256k1_nonce_function_default;\n\n/** Create an ECDSA signature.\n *\n *  Returns: 1: signature created\n *           0: the nonce generation function failed, or the private key was invalid.\n *  Args:    ctx:    pointer to a context object, initialized for signing (cannot be NULL)\n *  Out:     sig:    pointer to an array where the signature will be placed (cannot be NULL)\n *  In:      msg32:  the 32-byte message hash being signed (cannot be NULL)\n *           seckey: pointer to a 32-byte secret key (cannot be NULL)\n *           noncefp:pointer to a nonce generation function. If NULL, secp256k1_nonce_function_default is used\n *           ndata:  pointer to arbitrary data used by the nonce generation function (can be NULL)\n *\n * The created signature is always in lower-S form. See\n * secp256k1_ecdsa_signature_normalize for more details.\n */\nSECP256K1_API int secp256k1_ecdsa_sign(\n    const secp256k1_context* ctx,\n    secp256k1_ecdsa_signature *sig,\n    const unsigned char *msg32,\n    const unsigned char *seckey,\n    secp256k1_nonce_function noncefp,\n    const void *ndata\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);\n\n/** Verify an ECDSA secret key.\n *\n *  Returns: 1: secret key is valid\n *           0: secret key is invalid\n *  Args:    ctx: pointer to a context object (cannot be NULL)\n *  In:      seckey: pointer to a 32-byte secret key (cannot be NULL)\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_seckey_verify(\n    const secp256k1_context* ctx,\n    const unsigned char *seckey\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2);\n\n/** Compute the public key for a secret key.\n *\n *  Returns: 1: secret was valid, public key stores\n *           0: secret was invalid, try again\n *  Args:   ctx:        pointer to a context object, initialized for signing (cannot be NULL)\n *  Out:    pubkey:     pointer to the created public key (cannot be NULL)\n *  In:     seckey:     pointer to a 32-byte private key (cannot be NULL)\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_create(\n    const secp256k1_context* ctx,\n    secp256k1_pubkey *pubkey,\n    const unsigned char *seckey\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Negates a private key in place.\n *\n *  Returns: 1 always\n *  Args:   ctx:        pointer to a context object\n *  In/Out: pubkey:     pointer to the public key to be negated (cannot be NULL)\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_negate(\n    const secp256k1_context* ctx,\n    unsigned char *seckey\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2);\n\n/** Negates a public key in place.\n *\n *  Returns: 1 always\n *  Args:   ctx:        pointer to a context object\n *  In/Out: pubkey:     pointer to the public key to be negated (cannot be NULL)\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_negate(\n    const secp256k1_context* ctx,\n    secp256k1_pubkey *pubkey\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2);\n\n/** Tweak a private key by adding tweak to it.\n * Returns: 0 if the tweak was out of range (chance of around 1 in 2^128 for\n *          uniformly random 32-byte arrays, or if the resulting private key\n *          would be invalid (only when the tweak is the complement of the\n *          private key). 1 otherwise.\n * Args:    ctx:    pointer to a context object (cannot be NULL).\n * In/Out:  seckey: pointer to a 32-byte private key.\n * In:      tweak:  pointer to a 32-byte tweak.\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_add(\n    const secp256k1_context* ctx,\n    unsigned char *seckey,\n    const unsigned char *tweak\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Tweak a public key by adding tweak times the generator to it.\n * Returns: 0 if the tweak was out of range (chance of around 1 in 2^128 for\n *          uniformly random 32-byte arrays, or if the resulting public key\n *          would be invalid (only when the tweak is the complement of the\n *          corresponding private key). 1 otherwise.\n * Args:    ctx:    pointer to a context object initialized for validation\n *                  (cannot be NULL).\n * In/Out:  pubkey: pointer to a public key object.\n * In:      tweak:  pointer to a 32-byte tweak.\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_add(\n    const secp256k1_context* ctx,\n    secp256k1_pubkey *pubkey,\n    const unsigned char *tweak\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Tweak a private key by multiplying it by a tweak.\n * Returns: 0 if the tweak was out of range (chance of around 1 in 2^128 for\n *          uniformly random 32-byte arrays, or equal to zero. 1 otherwise.\n * Args:   ctx:    pointer to a context object (cannot be NULL).\n * In/Out: seckey: pointer to a 32-byte private key.\n * In:     tweak:  pointer to a 32-byte tweak.\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_privkey_tweak_mul(\n    const secp256k1_context* ctx,\n    unsigned char *seckey,\n    const unsigned char *tweak\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Tweak a public key by multiplying it by a tweak value.\n * Returns: 0 if the tweak was out of range (chance of around 1 in 2^128 for\n *          uniformly random 32-byte arrays, or equal to zero. 1 otherwise.\n * Args:    ctx:    pointer to a context object initialized for validation\n *                 (cannot be NULL).\n * In/Out:  pubkey: pointer to a public key obkect.\n * In:      tweak:  pointer to a 32-byte tweak.\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_tweak_mul(\n    const secp256k1_context* ctx,\n    secp256k1_pubkey *pubkey,\n    const unsigned char *tweak\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Updates the context randomization to protect against side-channel leakage.\n *  Returns: 1: randomization successfully updated\n *           0: error\n *  Args:    ctx:       pointer to a context object (cannot be NULL)\n *  In:      seed32:    pointer to a 32-byte random seed (NULL resets to initial state)\n *\n * While secp256k1 code is written to be constant-time no matter what secret\n * values are, it's possible that a future compiler may output code which isn't,\n * and also that the CPU may not emit the same radio frequencies or draw the same\n * amount power for all values.\n *\n * This function provides a seed which is combined into the blinding value: that\n * blinding value is added before each multiplication (and removed afterwards) so\n * that it does not affect function results, but shields against attacks which\n * rely on any input-dependent behaviour.\n *\n * You should call this after secp256k1_context_create or\n * secp256k1_context_clone, and may call this repeatedly afterwards.\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_context_randomize(\n    secp256k1_context* ctx,\n    const unsigned char *seed32\n) SECP256K1_ARG_NONNULL(1);\n\n/** Add a number of public keys together.\n *  Returns: 1: the sum of the public keys is valid.\n *           0: the sum of the public keys is not valid.\n *  Args:   ctx:        pointer to a context object\n *  Out:    out:        pointer to a public key object for placing the resulting public key\n *                      (cannot be NULL)\n *  In:     ins:        pointer to array of pointers to public keys (cannot be NULL)\n *          n:          the number of public keys to add together (must be at least 1)\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ec_pubkey_combine(\n    const secp256k1_context* ctx,\n    secp256k1_pubkey *out,\n    const secp256k1_pubkey * const * ins,\n    size_t n\n) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SECP256K1_H */\n"
  },
  {
    "path": "src/secp256k1/include/secp256k1_ecdh.h",
    "content": "#ifndef SECP256K1_ECDH_H\n#define SECP256K1_ECDH_H\n\n#include \"secp256k1.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** Compute an EC Diffie-Hellman secret in constant time\n *  Returns: 1: exponentiation was successful\n *           0: scalar was invalid (zero or overflow)\n *  Args:    ctx:        pointer to a context object (cannot be NULL)\n *  Out:     result:     a 32-byte array which will be populated by an ECDH\n *                       secret computed from the point and scalar\n *  In:      pubkey:     a pointer to a secp256k1_pubkey containing an\n *                       initialized public key\n *           privkey:    a 32-byte scalar with which to multiply the point\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh(\n  const secp256k1_context* ctx,\n  unsigned char *result,\n  const secp256k1_pubkey *pubkey,\n  const unsigned char *privkey\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SECP256K1_ECDH_H */\n"
  },
  {
    "path": "src/secp256k1/include/secp256k1_recovery.h",
    "content": "#ifndef SECP256K1_RECOVERY_H\n#define SECP256K1_RECOVERY_H\n\n#include \"secp256k1.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** Opaque data structured that holds a parsed ECDSA signature,\n *  supporting pubkey recovery.\n *\n *  The exact representation of data inside is implementation defined and not\n *  guaranteed to be portable between different platforms or versions. It is\n *  however guaranteed to be 65 bytes in size, and can be safely copied/moved.\n *  If you need to convert to a format suitable for storage or transmission, use\n *  the secp256k1_ecdsa_signature_serialize_* and\n *  secp256k1_ecdsa_signature_parse_* functions.\n *\n *  Furthermore, it is guaranteed that identical signatures (including their\n *  recoverability) will have identical representation, so they can be\n *  memcmp'ed.\n */\ntypedef struct {\n    unsigned char data[65];\n} secp256k1_ecdsa_recoverable_signature;\n\n/** Parse a compact ECDSA signature (64 bytes + recovery id).\n *\n *  Returns: 1 when the signature could be parsed, 0 otherwise\n *  Args: ctx:     a secp256k1 context object\n *  Out:  sig:     a pointer to a signature object\n *  In:   input64: a pointer to a 64-byte compact signature\n *        recid:   the recovery id (0, 1, 2 or 3)\n */\nSECP256K1_API int secp256k1_ecdsa_recoverable_signature_parse_compact(\n    const secp256k1_context* ctx,\n    secp256k1_ecdsa_recoverable_signature* sig,\n    const unsigned char *input64,\n    int recid\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Convert a recoverable signature into a normal signature.\n *\n *  Returns: 1\n *  Out: sig:    a pointer to a normal signature (cannot be NULL).\n *  In:  sigin:  a pointer to a recoverable signature (cannot be NULL).\n */\nSECP256K1_API int secp256k1_ecdsa_recoverable_signature_convert(\n    const secp256k1_context* ctx,\n    secp256k1_ecdsa_signature* sig,\n    const secp256k1_ecdsa_recoverable_signature* sigin\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);\n\n/** Serialize an ECDSA signature in compact format (64 bytes + recovery id).\n *\n *  Returns: 1\n *  Args: ctx:      a secp256k1 context object\n *  Out:  output64: a pointer to a 64-byte array of the compact signature (cannot be NULL)\n *        recid:    a pointer to an integer to hold the recovery id (can be NULL).\n *  In:   sig:      a pointer to an initialized signature object (cannot be NULL)\n */\nSECP256K1_API int secp256k1_ecdsa_recoverable_signature_serialize_compact(\n    const secp256k1_context* ctx,\n    unsigned char *output64,\n    int *recid,\n    const secp256k1_ecdsa_recoverable_signature* sig\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);\n\n/** Create a recoverable ECDSA signature.\n *\n *  Returns: 1: signature created\n *           0: the nonce generation function failed, or the private key was invalid.\n *  Args:    ctx:    pointer to a context object, initialized for signing (cannot be NULL)\n *  Out:     sig:    pointer to an array where the signature will be placed (cannot be NULL)\n *  In:      msg32:  the 32-byte message hash being signed (cannot be NULL)\n *           seckey: pointer to a 32-byte secret key (cannot be NULL)\n *           noncefp:pointer to a nonce generation function. If NULL, secp256k1_nonce_function_default is used\n *           ndata:  pointer to arbitrary data used by the nonce generation function (can be NULL)\n */\nSECP256K1_API int secp256k1_ecdsa_sign_recoverable(\n    const secp256k1_context* ctx,\n    secp256k1_ecdsa_recoverable_signature *sig,\n    const unsigned char *msg32,\n    const unsigned char *seckey,\n    secp256k1_nonce_function noncefp,\n    const void *ndata\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);\n\n/** Recover an ECDSA public key from a signature.\n *\n *  Returns: 1: public key successfully recovered (which guarantees a correct signature).\n *           0: otherwise.\n *  Args:    ctx:        pointer to a context object, initialized for verification (cannot be NULL)\n *  Out:     pubkey:     pointer to the recovered public key (cannot be NULL)\n *  In:      sig:        pointer to initialized signature that supports pubkey recovery (cannot be NULL)\n *           msg32:      the 32-byte message hash assumed to be signed (cannot be NULL)\n */\nSECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_recover(\n    const secp256k1_context* ctx,\n    secp256k1_pubkey *pubkey,\n    const secp256k1_ecdsa_recoverable_signature *sig,\n    const unsigned char *msg32\n) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif /* SECP256K1_RECOVERY_H */\n"
  },
  {
    "path": "src/secp256k1/libsecp256k1.pc.in",
    "content": "prefix=@prefix@\nexec_prefix=@exec_prefix@\nlibdir=@libdir@\nincludedir=@includedir@\n\nName: libsecp256k1\nDescription: Optimized C library for EC operations on curve secp256k1\nURL: https://github.com/bitcoin-core/secp256k1\nVersion: @PACKAGE_VERSION@\nCflags: -I${includedir}\nLibs.private: @SECP_LIBS@\nLibs: -L${libdir} -lsecp256k1\n\n"
  },
  {
    "path": "src/secp256k1/obj/.gitignore",
    "content": ""
  },
  {
    "path": "src/secp256k1/sage/group_prover.sage",
    "content": "# This code supports verifying group implementations which have branches\n# or conditional statements (like cmovs), by allowing each execution path\n# to independently set assumptions on input or intermediary variables.\n#\n# The general approach is:\n# * A constraint is a tuple of two sets of symbolic expressions:\n#   the first of which are required to evaluate to zero, the second of which\n#   are required to evaluate to nonzero.\n#   - A constraint is said to be conflicting if any of its nonzero expressions\n#     is in the ideal with basis the zero expressions (in other words: when the\n#     zero expressions imply that one of the nonzero expressions are zero).\n# * There is a list of laws that describe the intended behaviour, including\n#   laws for addition and doubling. Each law is called with the symbolic point\n#   coordinates as arguments, and returns:\n#   - A constraint describing the assumptions under which it is applicable,\n#     called \"assumeLaw\"\n#   - A constraint describing the requirements of the law, called \"require\"\n# * Implementations are transliterated into functions that operate as well on\n#   algebraic input points, and are called once per combination of branches\n#   executed. Each execution returns:\n#   - A constraint describing the assumptions this implementation requires\n#     (such as Z1=1), called \"assumeFormula\"\n#   - A constraint describing the assumptions this specific branch requires,\n#     but which is by construction guaranteed to cover the entire space by\n#     merging the results from all branches, called \"assumeBranch\"\n#   - The result of the computation\n# * All combinations of laws with implementation branches are tried, and:\n#   - If the combination of assumeLaw, assumeFormula, and assumeBranch results\n#     in a conflict, it means this law does not apply to this branch, and it is\n#     skipped.\n#   - For others, we try to prove the require constraints hold, assuming the\n#     information in assumeLaw + assumeFormula + assumeBranch, and if this does\n#     not succeed, we fail.\n#     + To prove an expression is zero, we check whether it belongs to the\n#       ideal with the assumed zero expressions as basis. This test is exact.\n#     + To prove an expression is nonzero, we check whether each of its\n#       factors is contained in the set of nonzero assumptions' factors.\n#       This test is not exact, so various combinations of original and\n#       reduced expressions' factors are tried.\n#   - If we succeed, we print out the assumptions from assumeFormula that\n#     weren't implied by assumeLaw already. Those from assumeBranch are skipped,\n#     as we assume that all constraints in it are complementary with each other.\n#\n# Based on the sage verification scripts used in the Explicit-Formulas Database\n# by Tanja Lange and others, see http://hyperelliptic.org/EFD\n\nclass fastfrac:\n  \"\"\"Fractions over rings.\"\"\"\n\n  def __init__(self,R,top,bot=1):\n    \"\"\"Construct a fractional, given a ring, a numerator, and denominator.\"\"\"\n    self.R = R\n    if parent(top) == ZZ or parent(top) == R:\n      self.top = R(top)\n      self.bot = R(bot)\n    elif top.__class__ == fastfrac:\n      self.top = top.top\n      self.bot = top.bot * bot\n    else:\n      self.top = R(numerator(top))\n      self.bot = R(denominator(top)) * bot\n\n  def iszero(self,I):\n    \"\"\"Return whether this fraction is zero given an ideal.\"\"\"\n    return self.top in I and self.bot not in I\n\n  def reduce(self,assumeZero):\n    zero = self.R.ideal(map(numerator, assumeZero))\n    return fastfrac(self.R, zero.reduce(self.top)) / fastfrac(self.R, zero.reduce(self.bot))\n\n  def __add__(self,other):\n    \"\"\"Add two fractions.\"\"\"\n    if parent(other) == ZZ:\n      return fastfrac(self.R,self.top + self.bot * other,self.bot)\n    if other.__class__ == fastfrac:\n      return fastfrac(self.R,self.top * other.bot + self.bot * other.top,self.bot * other.bot)\n    return NotImplemented\n\n  def __sub__(self,other):\n    \"\"\"Subtract two fractions.\"\"\"\n    if parent(other) == ZZ:\n      return fastfrac(self.R,self.top - self.bot * other,self.bot)\n    if other.__class__ == fastfrac:\n      return fastfrac(self.R,self.top * other.bot - self.bot * other.top,self.bot * other.bot)\n    return NotImplemented\n\n  def __neg__(self):\n    \"\"\"Return the negation of a fraction.\"\"\"\n    return fastfrac(self.R,-self.top,self.bot)\n\n  def __mul__(self,other):\n    \"\"\"Multiply two fractions.\"\"\"\n    if parent(other) == ZZ:\n      return fastfrac(self.R,self.top * other,self.bot)\n    if other.__class__ == fastfrac:\n      return fastfrac(self.R,self.top * other.top,self.bot * other.bot)\n    return NotImplemented\n\n  def __rmul__(self,other):\n    \"\"\"Multiply something else with a fraction.\"\"\"\n    return self.__mul__(other)\n\n  def __div__(self,other):\n    \"\"\"Divide two fractions.\"\"\"\n    if parent(other) == ZZ:\n      return fastfrac(self.R,self.top,self.bot * other)\n    if other.__class__ == fastfrac:\n      return fastfrac(self.R,self.top * other.bot,self.bot * other.top)\n    return NotImplemented\n\n  def __pow__(self,other):\n    \"\"\"Compute a power of a fraction.\"\"\"\n    if parent(other) == ZZ:\n      if other < 0:\n        # Negative powers require flipping top and bottom\n        return fastfrac(self.R,self.bot ^ (-other),self.top ^ (-other))\n      else:\n        return fastfrac(self.R,self.top ^ other,self.bot ^ other)\n    return NotImplemented\n\n  def __str__(self):\n    return \"fastfrac((\" + str(self.top) + \") / (\" + str(self.bot) + \"))\"\n  def __repr__(self):\n    return \"%s\" % self\n\n  def numerator(self):\n    return self.top\n\nclass constraints:\n  \"\"\"A set of constraints, consisting of zero and nonzero expressions.\n\n  Constraints can either be used to express knowledge or a requirement.\n\n  Both the fields zero and nonzero are maps from expressions to description\n  strings. The expressions that are the keys in zero are required to be zero,\n  and the expressions that are the keys in nonzero are required to be nonzero.\n\n  Note that (a != 0) and (b != 0) is the same as (a*b != 0), so all keys in\n  nonzero could be multiplied into a single key. This is often much less\n  efficient to work with though, so we keep them separate inside the\n  constraints. This allows higher-level code to do fast checks on the individual\n  nonzero elements, or combine them if needed for stronger checks.\n\n  We can't multiply the different zero elements, as it would suffice for one of\n  the factors to be zero, instead of all of them. Instead, the zero elements are\n  typically combined into an ideal first.\n  \"\"\"\n\n  def __init__(self, **kwargs):\n    if 'zero' in kwargs:\n      self.zero = dict(kwargs['zero'])\n    else:\n      self.zero = dict()\n    if 'nonzero' in kwargs:\n      self.nonzero = dict(kwargs['nonzero'])\n    else:\n      self.nonzero = dict()\n\n  def negate(self):\n    return constraints(zero=self.nonzero, nonzero=self.zero)\n\n  def __add__(self, other):\n    zero = self.zero.copy()\n    zero.update(other.zero)\n    nonzero = self.nonzero.copy()\n    nonzero.update(other.nonzero)\n    return constraints(zero=zero, nonzero=nonzero)\n\n  def __str__(self):\n    return \"constraints(zero=%s,nonzero=%s)\" % (self.zero, self.nonzero)\n\n  def __repr__(self):\n    return \"%s\" % self\n\n\ndef conflicts(R, con):\n  \"\"\"Check whether any of the passed non-zero assumptions is implied by the zero assumptions\"\"\"\n  zero = R.ideal(map(numerator, con.zero))\n  if 1 in zero:\n    return True\n  # First a cheap check whether any of the individual nonzero terms conflict on\n  # their own.\n  for nonzero in con.nonzero:\n    if nonzero.iszero(zero):\n      return True\n  # It can be the case that entries in the nonzero set do not individually\n  # conflict with the zero set, but their combination does. For example, knowing\n  # that either x or y is zero is equivalent to having x*y in the zero set.\n  # Having x or y individually in the nonzero set is not a conflict, but both\n  # simultaneously is, so that is the right thing to check for.\n  if reduce(lambda a,b: a * b, con.nonzero, fastfrac(R, 1)).iszero(zero):\n    return True\n  return False\n\n\ndef get_nonzero_set(R, assume):\n  \"\"\"Calculate a simple set of nonzero expressions\"\"\"\n  zero = R.ideal(map(numerator, assume.zero))\n  nonzero = set()\n  for nz in map(numerator, assume.nonzero):\n    for (f,n) in nz.factor():\n      nonzero.add(f)\n    rnz = zero.reduce(nz)\n    for (f,n) in rnz.factor():\n      nonzero.add(f)\n  return nonzero\n\n\ndef prove_nonzero(R, exprs, assume):\n  \"\"\"Check whether an expression is provably nonzero, given assumptions\"\"\"\n  zero = R.ideal(map(numerator, assume.zero))\n  nonzero = get_nonzero_set(R, assume)\n  expl = set()\n  ok = True\n  for expr in exprs:\n    if numerator(expr) in zero:\n      return (False, [exprs[expr]])\n  allexprs = reduce(lambda a,b: numerator(a)*numerator(b), exprs, 1)\n  for (f, n) in allexprs.factor():\n    if f not in nonzero:\n      ok = False\n  if ok:\n    return (True, None)\n  ok = True\n  for (f, n) in zero.reduce(numerator(allexprs)).factor():\n    if f not in nonzero:\n      ok = False\n  if ok:\n    return (True, None)\n  ok = True\n  for expr in exprs:\n    for (f,n) in numerator(expr).factor():\n      if f not in nonzero:\n        ok = False\n  if ok:\n    return (True, None)\n  ok = True\n  for expr in exprs:\n    for (f,n) in zero.reduce(numerator(expr)).factor():\n      if f not in nonzero:\n        expl.add(exprs[expr])\n  if expl:\n    return (False, list(expl))\n  else:\n    return (True, None)\n\n\ndef prove_zero(R, exprs, assume):\n  \"\"\"Check whether all of the passed expressions are provably zero, given assumptions\"\"\"\n  r, e = prove_nonzero(R, dict(map(lambda x: (fastfrac(R, x.bot, 1), exprs[x]), exprs)), assume)\n  if not r:\n    return (False, map(lambda x: \"Possibly zero denominator: %s\" % x, e))\n  zero = R.ideal(map(numerator, assume.zero))\n  nonzero = prod(x for x in assume.nonzero)\n  expl = []\n  for expr in exprs:\n    if not expr.iszero(zero):\n      expl.append(exprs[expr])\n  if not expl:\n    return (True, None)\n  return (False, expl)\n\n\ndef describe_extra(R, assume, assumeExtra):\n  \"\"\"Describe what assumptions are added, given existing assumptions\"\"\"\n  zerox = assume.zero.copy()\n  zerox.update(assumeExtra.zero)\n  zero = R.ideal(map(numerator, assume.zero))\n  zeroextra = R.ideal(map(numerator, zerox))\n  nonzero = get_nonzero_set(R, assume)\n  ret = set()\n  # Iterate over the extra zero expressions\n  for base in assumeExtra.zero:\n    if base not in zero:\n      add = []\n      for (f, n) in numerator(base).factor():\n        if f not in nonzero:\n          add += [\"%s\" % f]\n      if add:\n        ret.add((\" * \".join(add)) + \" = 0 [%s]\" % assumeExtra.zero[base])\n  # Iterate over the extra nonzero expressions\n  for nz in assumeExtra.nonzero:\n    nzr = zeroextra.reduce(numerator(nz))\n    if nzr not in zeroextra:\n      for (f,n) in nzr.factor():\n        if zeroextra.reduce(f) not in nonzero:\n          ret.add(\"%s != 0\" % zeroextra.reduce(f))\n  return \", \".join(x for x in ret)\n\n\ndef check_symbolic(R, assumeLaw, assumeAssert, assumeBranch, require):\n  \"\"\"Check a set of zero and nonzero requirements, given a set of zero and nonzero assumptions\"\"\"\n  assume = assumeLaw + assumeAssert + assumeBranch\n\n  if conflicts(R, assume):\n    # This formula does not apply\n    return None\n\n  describe = describe_extra(R, assumeLaw + assumeBranch, assumeAssert)\n\n  ok, msg = prove_zero(R, require.zero, assume)\n  if not ok:\n    return \"FAIL, %s fails (assuming %s)\" % (str(msg), describe)\n\n  res, expl = prove_nonzero(R, require.nonzero, assume)\n  if not res:\n    return \"FAIL, %s fails (assuming %s)\" % (str(expl), describe)\n\n  if describe != \"\":\n    return \"OK (assuming %s)\" % describe\n  else:\n    return \"OK\"\n\n\ndef concrete_verify(c):\n  for k in c.zero:\n    if k != 0:\n      return (False, c.zero[k])\n  for k in c.nonzero:\n    if k == 0:\n      return (False, c.nonzero[k])\n  return (True, None)\n"
  },
  {
    "path": "src/secp256k1/sage/secp256k1.sage",
    "content": "# Test libsecp256k1' group operation implementations using prover.sage\n\nimport sys\n\nload(\"group_prover.sage\")\nload(\"weierstrass_prover.sage\")\n\ndef formula_secp256k1_gej_double_var(a):\n  \"\"\"libsecp256k1's secp256k1_gej_double_var, used by various addition functions\"\"\"\n  rz = a.Z * a.Y\n  rz = rz * 2\n  t1 = a.X^2\n  t1 = t1 * 3\n  t2 = t1^2\n  t3 = a.Y^2\n  t3 = t3 * 2\n  t4 = t3^2\n  t4 = t4 * 2\n  t3 = t3 * a.X\n  rx = t3\n  rx = rx * 4\n  rx = -rx\n  rx = rx + t2\n  t2 = -t2\n  t3 = t3 * 6\n  t3 = t3 + t2\n  ry = t1 * t3\n  t2 = -t4\n  ry = ry + t2\n  return jacobianpoint(rx, ry, rz)\n\ndef formula_secp256k1_gej_add_var(branch, a, b):\n  \"\"\"libsecp256k1's secp256k1_gej_add_var\"\"\"\n  if branch == 0:\n    return (constraints(), constraints(nonzero={a.Infinity : 'a_infinite'}), b)\n  if branch == 1:\n    return (constraints(), constraints(zero={a.Infinity : 'a_finite'}, nonzero={b.Infinity : 'b_infinite'}), a)\n  z22 = b.Z^2\n  z12 = a.Z^2\n  u1 = a.X * z22\n  u2 = b.X * z12\n  s1 = a.Y * z22\n  s1 = s1 * b.Z\n  s2 = b.Y * z12\n  s2 = s2 * a.Z\n  h = -u1\n  h = h + u2\n  i = -s1\n  i = i + s2\n  if branch == 2:\n    r = formula_secp256k1_gej_double_var(a)\n    return (constraints(), constraints(zero={h : 'h=0', i : 'i=0', a.Infinity : 'a_finite', b.Infinity : 'b_finite'}), r)\n  if branch == 3:\n    return (constraints(), constraints(zero={h : 'h=0', a.Infinity : 'a_finite', b.Infinity : 'b_finite'}, nonzero={i : 'i!=0'}), point_at_infinity())\n  i2 = i^2\n  h2 = h^2\n  h3 = h2 * h\n  h = h * b.Z\n  rz = a.Z * h\n  t = u1 * h2\n  rx = t\n  rx = rx * 2\n  rx = rx + h3\n  rx = -rx\n  rx = rx + i2\n  ry = -rx\n  ry = ry + t\n  ry = ry * i\n  h3 = h3 * s1\n  h3 = -h3\n  ry = ry + h3\n  return (constraints(), constraints(zero={a.Infinity : 'a_finite', b.Infinity : 'b_finite'}, nonzero={h : 'h!=0'}), jacobianpoint(rx, ry, rz))\n\ndef formula_secp256k1_gej_add_ge_var(branch, a, b):\n  \"\"\"libsecp256k1's secp256k1_gej_add_ge_var, which assume bz==1\"\"\"\n  if branch == 0:\n    return (constraints(zero={b.Z - 1 : 'b.z=1'}), constraints(nonzero={a.Infinity : 'a_infinite'}), b)\n  if branch == 1:\n    return (constraints(zero={b.Z - 1 : 'b.z=1'}), constraints(zero={a.Infinity : 'a_finite'}, nonzero={b.Infinity : 'b_infinite'}), a)\n  z12 = a.Z^2\n  u1 = a.X\n  u2 = b.X * z12\n  s1 = a.Y\n  s2 = b.Y * z12\n  s2 = s2 * a.Z\n  h = -u1\n  h = h + u2\n  i = -s1\n  i = i + s2\n  if (branch == 2):\n    r = formula_secp256k1_gej_double_var(a)\n    return (constraints(zero={b.Z - 1 : 'b.z=1'}), constraints(zero={a.Infinity : 'a_finite', b.Infinity : 'b_finite', h : 'h=0', i : 'i=0'}), r)\n  if (branch == 3):\n    return (constraints(zero={b.Z - 1 : 'b.z=1'}), constraints(zero={a.Infinity : 'a_finite', b.Infinity : 'b_finite', h : 'h=0'}, nonzero={i : 'i!=0'}), point_at_infinity())\n  i2 = i^2\n  h2 = h^2\n  h3 = h * h2\n  rz = a.Z * h\n  t = u1 * h2\n  rx = t\n  rx = rx * 2\n  rx = rx + h3\n  rx = -rx\n  rx = rx + i2\n  ry = -rx\n  ry = ry + t\n  ry = ry * i\n  h3 = h3 * s1\n  h3 = -h3\n  ry = ry + h3\n  return (constraints(zero={b.Z - 1 : 'b.z=1'}), constraints(zero={a.Infinity : 'a_finite', b.Infinity : 'b_finite'}, nonzero={h : 'h!=0'}), jacobianpoint(rx, ry, rz))\n\ndef formula_secp256k1_gej_add_zinv_var(branch, a, b):\n  \"\"\"libsecp256k1's secp256k1_gej_add_zinv_var\"\"\"\n  bzinv = b.Z^(-1)\n  if branch == 0:\n    return (constraints(), constraints(nonzero={b.Infinity : 'b_infinite'}), a)\n  if branch == 1:\n    bzinv2 = bzinv^2\n    bzinv3 = bzinv2 * bzinv\n    rx = b.X * bzinv2\n    ry = b.Y * bzinv3\n    rz = 1\n    return (constraints(), constraints(zero={b.Infinity : 'b_finite'}, nonzero={a.Infinity : 'a_infinite'}), jacobianpoint(rx, ry, rz))\n  azz = a.Z * bzinv\n  z12 = azz^2\n  u1 = a.X\n  u2 = b.X * z12\n  s1 = a.Y\n  s2 = b.Y * z12\n  s2 = s2 * azz\n  h = -u1\n  h = h + u2\n  i = -s1\n  i = i + s2\n  if branch == 2:\n    r = formula_secp256k1_gej_double_var(a)\n    return (constraints(), constraints(zero={a.Infinity : 'a_finite', b.Infinity : 'b_finite', h : 'h=0', i : 'i=0'}), r)\n  if branch == 3:\n    return (constraints(), constraints(zero={a.Infinity : 'a_finite', b.Infinity : 'b_finite', h : 'h=0'}, nonzero={i : 'i!=0'}), point_at_infinity())\n  i2 = i^2\n  h2 = h^2\n  h3 = h * h2\n  rz = a.Z\n  rz = rz * h\n  t = u1 * h2\n  rx = t\n  rx = rx * 2\n  rx = rx + h3\n  rx = -rx\n  rx = rx + i2\n  ry = -rx\n  ry = ry + t\n  ry = ry * i\n  h3 = h3 * s1\n  h3 = -h3\n  ry = ry + h3\n  return (constraints(), constraints(zero={a.Infinity : 'a_finite', b.Infinity : 'b_finite'}, nonzero={h : 'h!=0'}), jacobianpoint(rx, ry, rz))\n\ndef formula_secp256k1_gej_add_ge(branch, a, b):\n  \"\"\"libsecp256k1's secp256k1_gej_add_ge\"\"\"\n  zeroes = {}\n  nonzeroes = {}\n  a_infinity = False\n  if (branch & 4) != 0:\n    nonzeroes.update({a.Infinity : 'a_infinite'})\n    a_infinity = True\n  else:\n    zeroes.update({a.Infinity : 'a_finite'})\n  zz = a.Z^2\n  u1 = a.X\n  u2 = b.X * zz\n  s1 = a.Y\n  s2 = b.Y * zz\n  s2 = s2 * a.Z\n  t = u1\n  t = t + u2\n  m = s1\n  m = m + s2\n  rr = t^2\n  m_alt = -u2\n  tt = u1 * m_alt\n  rr = rr + tt\n  degenerate = (branch & 3) == 3\n  if (branch & 1) != 0:\n    zeroes.update({m : 'm_zero'})\n  else:\n    nonzeroes.update({m : 'm_nonzero'})\n  if (branch & 2) != 0:\n    zeroes.update({rr : 'rr_zero'})\n  else:\n    nonzeroes.update({rr : 'rr_nonzero'})\n  rr_alt = s1\n  rr_alt = rr_alt * 2\n  m_alt = m_alt + u1\n  if not degenerate:\n    rr_alt = rr\n    m_alt = m\n  n = m_alt^2\n  q = n * t\n  n = n^2\n  if degenerate:\n    n = m\n  t = rr_alt^2\n  rz = a.Z * m_alt\n  infinity = False\n  if (branch & 8) != 0:\n    if not a_infinity:\n      infinity = True\n    zeroes.update({rz : 'r.z=0'})\n  else:\n    nonzeroes.update({rz : 'r.z!=0'})\n  rz = rz * 2\n  q = -q\n  t = t + q\n  rx = t\n  t = t * 2\n  t = t + q\n  t = t * rr_alt\n  t = t + n\n  ry = -t\n  rx = rx * 4\n  ry = ry * 4\n  if a_infinity:\n    rx = b.X\n    ry = b.Y\n    rz = 1\n  if infinity:\n    return (constraints(zero={b.Z - 1 : 'b.z=1', b.Infinity : 'b_finite'}), constraints(zero=zeroes, nonzero=nonzeroes), point_at_infinity())\n  return (constraints(zero={b.Z - 1 : 'b.z=1', b.Infinity : 'b_finite'}), constraints(zero=zeroes, nonzero=nonzeroes), jacobianpoint(rx, ry, rz))\n\ndef formula_secp256k1_gej_add_ge_old(branch, a, b):\n  \"\"\"libsecp256k1's old secp256k1_gej_add_ge, which fails when ay+by=0 but ax!=bx\"\"\"\n  a_infinity = (branch & 1) != 0\n  zero = {}\n  nonzero = {}\n  if a_infinity:\n    nonzero.update({a.Infinity : 'a_infinite'})\n  else:\n    zero.update({a.Infinity : 'a_finite'})\n  zz = a.Z^2\n  u1 = a.X\n  u2 = b.X * zz\n  s1 = a.Y\n  s2 = b.Y * zz\n  s2 = s2 * a.Z\n  z = a.Z\n  t = u1\n  t = t + u2\n  m = s1\n  m = m + s2\n  n = m^2\n  q = n * t\n  n = n^2\n  rr = t^2\n  t = u1 * u2\n  t = -t\n  rr = rr + t\n  t = rr^2\n  rz = m * z\n  infinity = False\n  if (branch & 2) != 0:\n    if not a_infinity:\n      infinity = True\n    else:\n      return (constraints(zero={b.Z - 1 : 'b.z=1', b.Infinity : 'b_finite'}), constraints(nonzero={z : 'conflict_a'}, zero={z : 'conflict_b'}), point_at_infinity())\n    zero.update({rz : 'r.z=0'})\n  else:\n    nonzero.update({rz : 'r.z!=0'})\n  rz = rz * (0 if a_infinity else 2)\n  rx = t\n  q = -q\n  rx = rx + q\n  q = q * 3\n  t = t * 2\n  t = t + q\n  t = t * rr\n  t = t + n\n  ry = -t\n  rx = rx * (0 if a_infinity else 4)\n  ry = ry * (0 if a_infinity else 4)\n  t = b.X\n  t = t * (1 if a_infinity else 0)\n  rx = rx + t\n  t = b.Y\n  t = t * (1 if a_infinity else 0)\n  ry = ry + t\n  t = (1 if a_infinity else 0)\n  rz = rz + t\n  if infinity:\n    return (constraints(zero={b.Z - 1 : 'b.z=1', b.Infinity : 'b_finite'}), constraints(zero=zero, nonzero=nonzero), point_at_infinity())\n  return (constraints(zero={b.Z - 1 : 'b.z=1', b.Infinity : 'b_finite'}), constraints(zero=zero, nonzero=nonzero), jacobianpoint(rx, ry, rz))\n\nif __name__ == \"__main__\":\n  check_symbolic_jacobian_weierstrass(\"secp256k1_gej_add_var\", 0, 7, 5, formula_secp256k1_gej_add_var)\n  check_symbolic_jacobian_weierstrass(\"secp256k1_gej_add_ge_var\", 0, 7, 5, formula_secp256k1_gej_add_ge_var)\n  check_symbolic_jacobian_weierstrass(\"secp256k1_gej_add_zinv_var\", 0, 7, 5, formula_secp256k1_gej_add_zinv_var)\n  check_symbolic_jacobian_weierstrass(\"secp256k1_gej_add_ge\", 0, 7, 16, formula_secp256k1_gej_add_ge)\n  check_symbolic_jacobian_weierstrass(\"secp256k1_gej_add_ge_old [should fail]\", 0, 7, 4, formula_secp256k1_gej_add_ge_old)\n\n  if len(sys.argv) >= 2 and sys.argv[1] == \"--exhaustive\":\n    check_exhaustive_jacobian_weierstrass(\"secp256k1_gej_add_var\", 0, 7, 5, formula_secp256k1_gej_add_var, 43)\n    check_exhaustive_jacobian_weierstrass(\"secp256k1_gej_add_ge_var\", 0, 7, 5, formula_secp256k1_gej_add_ge_var, 43)\n    check_exhaustive_jacobian_weierstrass(\"secp256k1_gej_add_zinv_var\", 0, 7, 5, formula_secp256k1_gej_add_zinv_var, 43)\n    check_exhaustive_jacobian_weierstrass(\"secp256k1_gej_add_ge\", 0, 7, 16, formula_secp256k1_gej_add_ge, 43)\n    check_exhaustive_jacobian_weierstrass(\"secp256k1_gej_add_ge_old [should fail]\", 0, 7, 4, formula_secp256k1_gej_add_ge_old, 43)\n"
  },
  {
    "path": "src/secp256k1/sage/weierstrass_prover.sage",
    "content": "# Prover implementation for Weierstrass curves of the form\n# y^2 = x^3 + A * x + B, specifically with a = 0 and b = 7, with group laws\n# operating on affine and Jacobian coordinates, including the point at infinity\n# represented by a 4th variable in coordinates.\n\nload(\"group_prover.sage\")\n\n\nclass affinepoint:\n  def __init__(self, x, y, infinity=0):\n    self.x = x\n    self.y = y\n    self.infinity = infinity\n  def __str__(self):\n    return \"affinepoint(x=%s,y=%s,inf=%s)\" % (self.x, self.y, self.infinity)\n\n\nclass jacobianpoint:\n  def __init__(self, x, y, z, infinity=0):\n    self.X = x\n    self.Y = y\n    self.Z = z\n    self.Infinity = infinity\n  def __str__(self):\n    return \"jacobianpoint(X=%s,Y=%s,Z=%s,inf=%s)\" % (self.X, self.Y, self.Z, self.Infinity)\n\n\ndef point_at_infinity():\n  return jacobianpoint(1, 1, 1, 1)\n\n\ndef negate(p):\n  if p.__class__ == affinepoint:\n    return affinepoint(p.x, -p.y)\n  if p.__class__ == jacobianpoint:\n    return jacobianpoint(p.X, -p.Y, p.Z)\n  assert(False)\n\n\ndef on_weierstrass_curve(A, B, p):\n  \"\"\"Return a set of zero-expressions for an affine point to be on the curve\"\"\"\n  return constraints(zero={p.x^3 + A*p.x + B - p.y^2: 'on_curve'})\n\n\ndef tangential_to_weierstrass_curve(A, B, p12, p3):\n  \"\"\"Return a set of zero-expressions for ((x12,y12),(x3,y3)) to be a line that is tangential to the curve at (x12,y12)\"\"\"\n  return constraints(zero={\n    (p12.y - p3.y) * (p12.y * 2) - (p12.x^2 * 3 + A) * (p12.x - p3.x): 'tangential_to_curve'\n  })\n\n\ndef colinear(p1, p2, p3):\n  \"\"\"Return a set of zero-expressions for ((x1,y1),(x2,y2),(x3,y3)) to be collinear\"\"\"\n  return constraints(zero={\n    (p1.y - p2.y) * (p1.x - p3.x) - (p1.y - p3.y) * (p1.x - p2.x): 'colinear_1',\n    (p2.y - p3.y) * (p2.x - p1.x) - (p2.y - p1.y) * (p2.x - p3.x): 'colinear_2',\n    (p3.y - p1.y) * (p3.x - p2.x) - (p3.y - p2.y) * (p3.x - p1.x): 'colinear_3'\n  })\n\n\ndef good_affine_point(p):\n  return constraints(nonzero={p.x : 'nonzero_x', p.y : 'nonzero_y'})\n\n\ndef good_jacobian_point(p):\n  return constraints(nonzero={p.X : 'nonzero_X', p.Y : 'nonzero_Y', p.Z^6 : 'nonzero_Z'})\n\n\ndef good_point(p):\n  return constraints(nonzero={p.Z^6 : 'nonzero_X'})\n\n\ndef finite(p, *affine_fns):\n  con = good_point(p) + constraints(zero={p.Infinity : 'finite_point'})\n  if p.Z != 0:\n    return con + reduce(lambda a, b: a + b, (f(affinepoint(p.X / p.Z^2, p.Y / p.Z^3)) for f in affine_fns), con)\n  else:\n    return con\n\ndef infinite(p):\n  return constraints(nonzero={p.Infinity : 'infinite_point'})\n\n\ndef law_jacobian_weierstrass_add(A, B, pa, pb, pA, pB, pC):\n  \"\"\"Check whether the passed set of coordinates is a valid Jacobian add, given assumptions\"\"\"\n  assumeLaw = (good_affine_point(pa) +\n               good_affine_point(pb) +\n               good_jacobian_point(pA) +\n               good_jacobian_point(pB) +\n               on_weierstrass_curve(A, B, pa) +\n               on_weierstrass_curve(A, B, pb) +\n               finite(pA) +\n               finite(pB) +\n               constraints(nonzero={pa.x - pb.x : 'different_x'}))\n  require = (finite(pC, lambda pc: on_weierstrass_curve(A, B, pc) +\n             colinear(pa, pb, negate(pc))))\n  return (assumeLaw, require)\n\n\ndef law_jacobian_weierstrass_double(A, B, pa, pb, pA, pB, pC):\n  \"\"\"Check whether the passed set of coordinates is a valid Jacobian doubling, given assumptions\"\"\"\n  assumeLaw = (good_affine_point(pa) +\n               good_affine_point(pb) +\n               good_jacobian_point(pA) +\n               good_jacobian_point(pB) +\n               on_weierstrass_curve(A, B, pa) +\n               on_weierstrass_curve(A, B, pb) +\n               finite(pA) +\n               finite(pB) +\n               constraints(zero={pa.x - pb.x : 'equal_x', pa.y - pb.y : 'equal_y'}))\n  require = (finite(pC, lambda pc: on_weierstrass_curve(A, B, pc) +\n             tangential_to_weierstrass_curve(A, B, pa, negate(pc))))\n  return (assumeLaw, require)\n\n\ndef law_jacobian_weierstrass_add_opposites(A, B, pa, pb, pA, pB, pC):\n  assumeLaw = (good_affine_point(pa) +\n               good_affine_point(pb) +\n               good_jacobian_point(pA) +\n               good_jacobian_point(pB) +\n               on_weierstrass_curve(A, B, pa) +\n               on_weierstrass_curve(A, B, pb) +\n               finite(pA) +\n               finite(pB) +\n               constraints(zero={pa.x - pb.x : 'equal_x', pa.y + pb.y : 'opposite_y'}))\n  require = infinite(pC)\n  return (assumeLaw, require)\n\n\ndef law_jacobian_weierstrass_add_infinite_a(A, B, pa, pb, pA, pB, pC):\n  assumeLaw = (good_affine_point(pa) +\n               good_affine_point(pb) +\n               good_jacobian_point(pA) +\n               good_jacobian_point(pB) +\n               on_weierstrass_curve(A, B, pb) +\n               infinite(pA) +\n               finite(pB))\n  require = finite(pC, lambda pc: constraints(zero={pc.x - pb.x : 'c.x=b.x', pc.y - pb.y : 'c.y=b.y'}))\n  return (assumeLaw, require)\n\n\ndef law_jacobian_weierstrass_add_infinite_b(A, B, pa, pb, pA, pB, pC):\n  assumeLaw = (good_affine_point(pa) +\n               good_affine_point(pb) +\n               good_jacobian_point(pA) +\n               good_jacobian_point(pB) +\n               on_weierstrass_curve(A, B, pa) +\n               infinite(pB) +\n               finite(pA))\n  require = finite(pC, lambda pc: constraints(zero={pc.x - pa.x : 'c.x=a.x', pc.y - pa.y : 'c.y=a.y'}))\n  return (assumeLaw, require)\n\n\ndef law_jacobian_weierstrass_add_infinite_ab(A, B, pa, pb, pA, pB, pC):\n  assumeLaw = (good_affine_point(pa) +\n               good_affine_point(pb) +\n               good_jacobian_point(pA) +\n               good_jacobian_point(pB) +\n               infinite(pA) +\n               infinite(pB))\n  require = infinite(pC)\n  return (assumeLaw, require)\n\n\nlaws_jacobian_weierstrass = {\n  'add': law_jacobian_weierstrass_add,\n  'double': law_jacobian_weierstrass_double,\n  'add_opposite': law_jacobian_weierstrass_add_opposites,\n  'add_infinite_a': law_jacobian_weierstrass_add_infinite_a,\n  'add_infinite_b': law_jacobian_weierstrass_add_infinite_b,\n  'add_infinite_ab': law_jacobian_weierstrass_add_infinite_ab\n}\n\n\ndef check_exhaustive_jacobian_weierstrass(name, A, B, branches, formula, p):\n  \"\"\"Verify an implementation of addition of Jacobian points on a Weierstrass curve, by executing and validating the result for every possible addition in a prime field\"\"\"\n  F = Integers(p)\n  print \"Formula %s on Z%i:\" % (name, p)\n  points = []\n  for x in xrange(0, p):\n    for y in xrange(0, p):\n      point = affinepoint(F(x), F(y))\n      r, e = concrete_verify(on_weierstrass_curve(A, B, point))\n      if r:\n        points.append(point)\n\n  for za in xrange(1, p):\n    for zb in xrange(1, p):\n      for pa in points:\n        for pb in points:\n          for ia in xrange(2):\n            for ib in xrange(2):\n              pA = jacobianpoint(pa.x * F(za)^2, pa.y * F(za)^3, F(za), ia)\n              pB = jacobianpoint(pb.x * F(zb)^2, pb.y * F(zb)^3, F(zb), ib)\n              for branch in xrange(0, branches):\n                assumeAssert, assumeBranch, pC = formula(branch, pA, pB)\n                pC.X = F(pC.X)\n                pC.Y = F(pC.Y)\n                pC.Z = F(pC.Z)\n                pC.Infinity = F(pC.Infinity)\n                r, e = concrete_verify(assumeAssert + assumeBranch)\n                if r:\n                  match = False\n                  for key in laws_jacobian_weierstrass:\n                    assumeLaw, require = laws_jacobian_weierstrass[key](A, B, pa, pb, pA, pB, pC)\n                    r, e = concrete_verify(assumeLaw)\n                    if r:\n                      if match:\n                        print \"  multiple branches for (%s,%s,%s,%s) + (%s,%s,%s,%s)\" % (pA.X, pA.Y, pA.Z, pA.Infinity, pB.X, pB.Y, pB.Z, pB.Infinity)\n                      else:\n                        match = True\n                      r, e = concrete_verify(require)\n                      if not r:\n                        print \"  failure in branch %i for (%s,%s,%s,%s) + (%s,%s,%s,%s) = (%s,%s,%s,%s): %s\" % (branch, pA.X, pA.Y, pA.Z, pA.Infinity, pB.X, pB.Y, pB.Z, pB.Infinity, pC.X, pC.Y, pC.Z, pC.Infinity, e)\n  print\n\n\ndef check_symbolic_function(R, assumeAssert, assumeBranch, f, A, B, pa, pb, pA, pB, pC):\n  assumeLaw, require = f(A, B, pa, pb, pA, pB, pC)\n  return check_symbolic(R, assumeLaw, assumeAssert, assumeBranch, require)\n\ndef check_symbolic_jacobian_weierstrass(name, A, B, branches, formula):\n  \"\"\"Verify an implementation of addition of Jacobian points on a Weierstrass curve symbolically\"\"\"\n  R.<ax,bx,ay,by,Az,Bz,Ai,Bi> = PolynomialRing(QQ,8,order='invlex')\n  lift = lambda x: fastfrac(R,x)\n  ax = lift(ax)\n  ay = lift(ay)\n  Az = lift(Az)\n  bx = lift(bx)\n  by = lift(by)\n  Bz = lift(Bz)\n  Ai = lift(Ai)\n  Bi = lift(Bi)\n\n  pa = affinepoint(ax, ay, Ai)\n  pb = affinepoint(bx, by, Bi)\n  pA = jacobianpoint(ax * Az^2, ay * Az^3, Az, Ai)\n  pB = jacobianpoint(bx * Bz^2, by * Bz^3, Bz, Bi)\n\n  res = {}\n\n  for key in laws_jacobian_weierstrass:\n    res[key] = []\n\n  print (\"Formula \" + name + \":\")\n  count = 0\n  for branch in xrange(branches):\n    assumeFormula, assumeBranch, pC = formula(branch, pA, pB)\n    pC.X = lift(pC.X)\n    pC.Y = lift(pC.Y)\n    pC.Z = lift(pC.Z)\n    pC.Infinity = lift(pC.Infinity)\n\n    for key in laws_jacobian_weierstrass:\n      res[key].append((check_symbolic_function(R, assumeFormula, assumeBranch, laws_jacobian_weierstrass[key], A, B, pa, pb, pA, pB, pC), branch))\n\n  for key in res:\n    print \"  %s:\" % key\n    val = res[key]\n    for x in val:\n      if x[0] is not None:\n        print \"    branch %i: %s\" % (x[1], x[0])\n\n  print\n"
  },
  {
    "path": "src/secp256k1/src/asm/field_10x26_arm.s",
    "content": "@ vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab syntax=armasm:\n/**********************************************************************\n * Copyright (c) 2014 Wladimir J. van der Laan                        *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n/*\nARM implementation of field_10x26 inner loops.\n\nNote:\n\n- To avoid unnecessary loads and make use of available registers, two\n  'passes' have every time been interleaved, with the odd passes accumulating c' and d' \n  which will be added to c and d respectively in the even passes\n\n*/\n\n\t.syntax unified\n\t.arch armv7-a\n\t@ eabi attributes - see readelf -A\n\t.eabi_attribute 8, 1  @ Tag_ARM_ISA_use = yes\n\t.eabi_attribute 9, 0  @ Tag_Thumb_ISA_use = no\n\t.eabi_attribute 10, 0 @ Tag_FP_arch = none\n\t.eabi_attribute 24, 1 @ Tag_ABI_align_needed = 8-byte\n\t.eabi_attribute 25, 1 @ Tag_ABI_align_preserved = 8-byte, except leaf SP\n\t.eabi_attribute 30, 2 @ Tag_ABI_optimization_goals = Aggressive Speed\n\t.eabi_attribute 34, 1 @ Tag_CPU_unaligned_access = v6\n\t.text\n\n\t@ Field constants\n\t.set field_R0, 0x3d10\n\t.set field_R1, 0x400\n\t.set field_not_M, 0xfc000000\t@ ~M = ~0x3ffffff\n\n\t.align\t2\n\t.global secp256k1_fe_mul_inner\n\t.type\tsecp256k1_fe_mul_inner, %function\n\t@ Arguments:\n\t@  r0  r      Restrict: can overlap with a, not with b\n\t@  r1  a\n\t@  r2  b\n\t@ Stack (total 4+10*4 = 44)\n\t@  sp + #0        saved 'r' pointer\n\t@  sp + #4 + 4*X  t0,t1,t2,t3,t4,t5,t6,t7,u8,t9\nsecp256k1_fe_mul_inner:\n\tstmfd\tsp!, {r4, r5, r6, r7, r8, r9, r10, r11, r14}\n\tsub\tsp, sp, #48\t\t\t@ frame=44 + alignment\n\tstr     r0, [sp, #0]\t\t\t@ save result address, we need it only at the end\n\n\t/******************************************\n\t * Main computation code.\n\t ******************************************\n\n\tAllocation:\n\t    r0,r14,r7,r8   scratch\n\t    r1       a (pointer)\n\t    r2       b (pointer)\n\t    r3:r4    c\n\t    r5:r6    d\n\t    r11:r12  c'\n\t    r9:r10   d'\n\n\tNote: do not write to r[] here, it may overlap with a[]\n\t*/\n\n\t/* A - interleaved with B */\n\tldr\tr7, [r1, #0*4]\t\t\t@ a[0]\n\tldr\tr8, [r2, #9*4]\t\t\t@ b[9]\n\tldr\tr0, [r1, #1*4]\t\t\t@ a[1]\n\tumull\tr5, r6, r7, r8\t\t\t@ d = a[0] * b[9]\n\tldr\tr14, [r2, #8*4]\t\t\t@ b[8]\n\tumull\tr9, r10, r0, r8\t\t\t@ d' = a[1] * b[9]\n\tldr\tr7, [r1, #2*4]\t\t\t@ a[2]\n\tumlal\tr5, r6, r0, r14\t\t\t@ d += a[1] * b[8]\n\tldr\tr8, [r2, #7*4] \t\t\t@ b[7]\n\tumlal\tr9, r10, r7, r14\t\t@ d' += a[2] * b[8]\n\tldr\tr0, [r1, #3*4]   \t\t@ a[3]\n\tumlal\tr5, r6, r7, r8   \t\t@ d += a[2] * b[7]\n\tldr\tr14, [r2, #6*4]   \t\t@ b[6]\n\tumlal\tr9, r10, r0, r8  \t\t@ d' += a[3] * b[7]\n\tldr\tr7, [r1, #4*4]   \t\t@ a[4]\n\tumlal\tr5, r6, r0, r14   \t\t@ d += a[3] * b[6]\n\tldr\tr8, [r2, #5*4]   \t\t@ b[5]\n\tumlal\tr9, r10, r7, r14  \t\t@ d' += a[4] * b[6]\n\tldr\tr0, [r1, #5*4]   \t\t@ a[5]\n\tumlal\tr5, r6, r7, r8   \t\t@ d += a[4] * b[5]\n\tldr\tr14, [r2, #4*4]   \t\t@ b[4]\n\tumlal\tr9, r10, r0, r8  \t\t@ d' += a[5] * b[5]\n\tldr\tr7, [r1, #6*4]   \t\t@ a[6]\n\tumlal\tr5, r6, r0, r14   \t\t@ d += a[5] * b[4]\n\tldr\tr8, [r2, #3*4]   \t\t@ b[3]\n\tumlal\tr9, r10, r7, r14  \t\t@ d' += a[6] * b[4]\n\tldr\tr0, [r1, #7*4]   \t\t@ a[7]\n\tumlal\tr5, r6, r7, r8   \t\t@ d += a[6] * b[3]\n\tldr\tr14, [r2, #2*4]   \t\t@ b[2]\n\tumlal\tr9, r10, r0, r8  \t\t@ d' += a[7] * b[3]\n\tldr\tr7, [r1, #8*4]   \t\t@ a[8]\n\tumlal\tr5, r6, r0, r14   \t\t@ d += a[7] * b[2]\n\tldr\tr8, [r2, #1*4]   \t\t@ b[1]\n\tumlal\tr9, r10, r7, r14  \t\t@ d' += a[8] * b[2]\n\tldr\tr0, [r1, #9*4]   \t\t@ a[9]\n\tumlal\tr5, r6, r7, r8   \t\t@ d += a[8] * b[1]\n\tldr\tr14, [r2, #0*4]   \t\t@ b[0]\n\tumlal\tr9, r10, r0, r8  \t\t@ d' += a[9] * b[1]\n\tldr\tr7, [r1, #0*4]   \t\t@ a[0]\n\tumlal\tr5, r6, r0, r14   \t\t@ d += a[9] * b[0]\n\t@ r7,r14 used in B\n\n\tbic\tr0, r5, field_not_M \t\t@ t9 = d & M\n\tstr     r0, [sp, #4 + 4*9]\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26 \n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\n\t/* B */\n\tumull\tr3, r4, r7, r14   \t\t@ c = a[0] * b[0]\n\tadds\tr5, r5, r9       \t\t@ d += d'\n\tadc\tr6, r6, r10\n\n\tbic\tr0, r5, field_not_M \t\t@ u0 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u0 * R0\n\tumlal   r3, r4, r0, r14\n\n\tbic\tr14, r3, field_not_M \t\t@ t0 = c & M\n\tstr\tr14, [sp, #4 + 0*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u0 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* C - interleaved with D */\n\tldr\tr7, [r1, #0*4]   \t\t@ a[0]\n\tldr\tr8, [r2, #2*4]   \t\t@ b[2]\n\tldr\tr14, [r2, #1*4]   \t\t@ b[1]\n\tumull\tr11, r12, r7, r8   \t\t@ c' = a[0] * b[2]\n\tldr\tr0, [r1, #1*4]   \t\t@ a[1]\n\tumlal   r3, r4, r7, r14   \t\t@ c += a[0] * b[1]\n\tldr\tr8, [r2, #0*4]   \t\t@ b[0]\n\tumlal   r11, r12, r0, r14   \t\t@ c' += a[1] * b[1]\n\tldr\tr7, [r1, #2*4]   \t\t@ a[2]\n\tumlal   r3, r4, r0, r8   \t\t@ c += a[1] * b[0]\n\tldr\tr14, [r2, #9*4]   \t\t@ b[9]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[2] * b[0]\n\tldr\tr0, [r1, #3*4]   \t\t@ a[3]\n\tumlal\tr5, r6, r7, r14   \t\t@ d += a[2] * b[9]\n\tldr\tr8, [r2, #8*4]   \t\t@ b[8]\n\tumull\tr9, r10, r0, r14   \t\t@ d' = a[3] * b[9]\n\tldr\tr7, [r1, #4*4]   \t\t@ a[4]\n\tumlal\tr5, r6, r0, r8   \t\t@ d += a[3] * b[8]\n\tldr\tr14, [r2, #7*4]   \t\t@ b[7]\n\tumlal\tr9, r10, r7, r8   \t\t@ d' += a[4] * b[8]\n\tldr\tr0, [r1, #5*4]   \t\t@ a[5]\n\tumlal\tr5, r6, r7, r14   \t\t@ d += a[4] * b[7]\n\tldr\tr8, [r2, #6*4]   \t\t@ b[6]\n\tumlal\tr9, r10, r0, r14   \t\t@ d' += a[5] * b[7]\n\tldr\tr7, [r1, #6*4]   \t\t@ a[6]\n\tumlal\tr5, r6, r0, r8   \t\t@ d += a[5] * b[6]\n\tldr\tr14, [r2, #5*4]   \t\t@ b[5]\n\tumlal\tr9, r10, r7, r8   \t\t@ d' += a[6] * b[6]\n\tldr\tr0, [r1, #7*4]   \t\t@ a[7]\n\tumlal\tr5, r6, r7, r14   \t\t@ d += a[6] * b[5]\n\tldr\tr8, [r2, #4*4]   \t\t@ b[4]\n\tumlal\tr9, r10, r0, r14   \t\t@ d' += a[7] * b[5]\n\tldr\tr7, [r1, #8*4]   \t\t@ a[8]\n\tumlal\tr5, r6, r0, r8   \t\t@ d += a[7] * b[4]\n\tldr\tr14, [r2, #3*4]   \t\t@ b[3]\n\tumlal\tr9, r10, r7, r8   \t\t@ d' += a[8] * b[4]\n\tldr\tr0, [r1, #9*4]   \t\t@ a[9]\n\tumlal\tr5, r6, r7, r14   \t\t@ d += a[8] * b[3]\n\tldr\tr8, [r2, #2*4]   \t\t@ b[2]\n\tumlal\tr9, r10, r0, r14   \t\t@ d' += a[9] * b[3]\n\tumlal\tr5, r6, r0, r8   \t\t@ d += a[9] * b[2]\n\n\tbic\tr0, r5, field_not_M \t\t@ u1 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u1 * R0\n\tumlal   r3, r4, r0, r14\n\n\tbic\tr14, r3, field_not_M \t\t@ t1 = c & M\n\tstr\tr14, [sp, #4 + 1*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u1 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* D */\n\tadds\tr3, r3, r11\t\t\t@ c += c'\n\tadc\tr4, r4, r12\n\tadds\tr5, r5, r9\t\t\t@ d += d'\n\tadc\tr6, r6, r10\n\n\tbic\tr0, r5, field_not_M \t\t@ u2 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u2 * R0\n\tumlal   r3, r4, r0, r14\n\n\tbic\tr14, r3, field_not_M \t\t@ t2 = c & M\n\tstr\tr14, [sp, #4 + 2*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u2 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* E - interleaved with F */\n\tldr\tr7, [r1, #0*4]   \t\t@ a[0]\n\tldr\tr8, [r2, #4*4]   \t\t@ b[4]\n\tumull\tr11, r12, r7, r8   \t\t@ c' = a[0] * b[4]\n\tldr\tr8, [r2, #3*4]   \t\t@ b[3]\n\tumlal   r3, r4, r7, r8   \t\t@ c += a[0] * b[3]\n\tldr\tr7, [r1, #1*4]   \t\t@ a[1]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[1] * b[3]\n\tldr\tr8, [r2, #2*4]   \t\t@ b[2]\n\tumlal   r3, r4, r7, r8   \t\t@ c += a[1] * b[2]\n\tldr\tr7, [r1, #2*4]   \t\t@ a[2]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[2] * b[2]\n\tldr\tr8, [r2, #1*4]   \t\t@ b[1]\n\tumlal   r3, r4, r7, r8   \t\t@ c += a[2] * b[1]\n\tldr\tr7, [r1, #3*4]   \t\t@ a[3]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[3] * b[1]\n\tldr\tr8, [r2, #0*4]   \t\t@ b[0]\n\tumlal   r3, r4, r7, r8   \t\t@ c += a[3] * b[0]\n\tldr\tr7, [r1, #4*4]   \t\t@ a[4]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[4] * b[0]\n\tldr\tr8, [r2, #9*4]   \t\t@ b[9]\n\tumlal\tr5, r6, r7, r8   \t\t@ d += a[4] * b[9]\n\tldr\tr7, [r1, #5*4]   \t\t@ a[5]\n\tumull\tr9, r10, r7, r8   \t\t@ d' = a[5] * b[9]\n\tldr\tr8, [r2, #8*4]   \t\t@ b[8]\n\tumlal\tr5, r6, r7, r8   \t\t@ d += a[5] * b[8]\n\tldr\tr7, [r1, #6*4]   \t\t@ a[6]\n\tumlal\tr9, r10, r7, r8   \t\t@ d' += a[6] * b[8]\n\tldr\tr8, [r2, #7*4]   \t\t@ b[7]\n\tumlal\tr5, r6, r7, r8   \t\t@ d += a[6] * b[7]\n\tldr\tr7, [r1, #7*4]   \t\t@ a[7]\n\tumlal\tr9, r10, r7, r8   \t\t@ d' += a[7] * b[7]\n\tldr\tr8, [r2, #6*4]   \t\t@ b[6]\n\tumlal\tr5, r6, r7, r8   \t\t@ d += a[7] * b[6]\n\tldr\tr7, [r1, #8*4]   \t\t@ a[8]\n\tumlal\tr9, r10, r7, r8   \t\t@ d' += a[8] * b[6]\n\tldr\tr8, [r2, #5*4]   \t\t@ b[5]\n\tumlal\tr5, r6, r7, r8   \t\t@ d += a[8] * b[5]\n\tldr\tr7, [r1, #9*4]   \t\t@ a[9]\n\tumlal\tr9, r10, r7, r8   \t\t@ d' += a[9] * b[5]\n\tldr\tr8, [r2, #4*4]   \t\t@ b[4]\n\tumlal\tr5, r6, r7, r8   \t\t@ d += a[9] * b[4]\n\n\tbic\tr0, r5, field_not_M \t\t@ u3 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u3 * R0\n\tumlal   r3, r4, r0, r14\n\n\tbic\tr14, r3, field_not_M \t\t@ t3 = c & M\n\tstr\tr14, [sp, #4 + 3*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u3 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* F */\n\tadds\tr3, r3, r11\t\t\t@ c += c'\n\tadc\tr4, r4, r12\n\tadds\tr5, r5, r9\t\t\t@ d += d'\n\tadc\tr6, r6, r10\n\n\tbic\tr0, r5, field_not_M \t\t@ u4 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u4 * R0\n\tumlal   r3, r4, r0, r14\n\n\tbic\tr14, r3, field_not_M \t\t@ t4 = c & M\n\tstr\tr14, [sp, #4 + 4*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u4 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* G - interleaved with H */\n\tldr\tr7, [r1, #0*4]   \t\t@ a[0]\n\tldr\tr8, [r2, #6*4]   \t\t@ b[6]\n\tldr\tr14, [r2, #5*4]   \t\t@ b[5]\n\tumull\tr11, r12, r7, r8   \t\t@ c' = a[0] * b[6]\n\tldr\tr0, [r1, #1*4]   \t\t@ a[1]\n\tumlal   r3, r4, r7, r14   \t\t@ c += a[0] * b[5]\n\tldr\tr8, [r2, #4*4]   \t\t@ b[4]\n\tumlal   r11, r12, r0, r14   \t\t@ c' += a[1] * b[5]\n\tldr\tr7, [r1, #2*4]   \t\t@ a[2]\n\tumlal   r3, r4, r0, r8   \t\t@ c += a[1] * b[4]\n\tldr\tr14, [r2, #3*4]   \t\t@ b[3]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[2] * b[4]\n\tldr\tr0, [r1, #3*4]   \t\t@ a[3]\n\tumlal   r3, r4, r7, r14   \t\t@ c += a[2] * b[3]\n\tldr\tr8, [r2, #2*4]   \t\t@ b[2]\n\tumlal   r11, r12, r0, r14   \t\t@ c' += a[3] * b[3]\n\tldr\tr7, [r1, #4*4]   \t\t@ a[4]\n\tumlal   r3, r4, r0, r8   \t\t@ c += a[3] * b[2]\n\tldr\tr14, [r2, #1*4]   \t\t@ b[1]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[4] * b[2]\n\tldr\tr0, [r1, #5*4]   \t\t@ a[5]\n\tumlal   r3, r4, r7, r14   \t\t@ c += a[4] * b[1]\n\tldr\tr8, [r2, #0*4]   \t\t@ b[0]\n\tumlal   r11, r12, r0, r14   \t\t@ c' += a[5] * b[1]\n\tldr\tr7, [r1, #6*4]   \t\t@ a[6]\n\tumlal   r3, r4, r0, r8   \t\t@ c += a[5] * b[0]\n\tldr\tr14, [r2, #9*4]   \t\t@ b[9]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[6] * b[0]\n\tldr\tr0, [r1, #7*4]   \t\t@ a[7]\n\tumlal\tr5, r6, r7, r14   \t\t@ d += a[6] * b[9]\n\tldr\tr8, [r2, #8*4]   \t\t@ b[8]\n\tumull\tr9, r10, r0, r14   \t\t@ d' = a[7] * b[9]\n\tldr\tr7, [r1, #8*4]   \t\t@ a[8]\n\tumlal\tr5, r6, r0, r8   \t\t@ d += a[7] * b[8]\n\tldr\tr14, [r2, #7*4]   \t\t@ b[7]\n\tumlal\tr9, r10, r7, r8   \t\t@ d' += a[8] * b[8]\n\tldr\tr0, [r1, #9*4]   \t\t@ a[9]\n\tumlal\tr5, r6, r7, r14   \t\t@ d += a[8] * b[7]\n\tldr\tr8, [r2, #6*4]   \t\t@ b[6]\n\tumlal\tr9, r10, r0, r14   \t\t@ d' += a[9] * b[7]\n\tumlal\tr5, r6, r0, r8   \t\t@ d += a[9] * b[6]\n\n\tbic\tr0, r5, field_not_M \t\t@ u5 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u5 * R0\n\tumlal   r3, r4, r0, r14\n\n\tbic\tr14, r3, field_not_M \t\t@ t5 = c & M\n\tstr\tr14, [sp, #4 + 5*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u5 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* H */\n\tadds\tr3, r3, r11\t\t\t@ c += c'\n\tadc\tr4, r4, r12\n\tadds\tr5, r5, r9\t\t\t@ d += d'\n\tadc\tr6, r6, r10\n\n\tbic\tr0, r5, field_not_M \t\t@ u6 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u6 * R0\n\tumlal   r3, r4, r0, r14\n\n\tbic\tr14, r3, field_not_M \t\t@ t6 = c & M\n\tstr\tr14, [sp, #4 + 6*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u6 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* I - interleaved with J */\n\tldr\tr8, [r2, #8*4]   \t\t@ b[8]\n\tldr\tr7, [r1, #0*4]   \t\t@ a[0]\n\tldr\tr14, [r2, #7*4]   \t\t@ b[7]\n\tumull   r11, r12, r7, r8   \t\t@ c' = a[0] * b[8]\n\tldr\tr0, [r1, #1*4]   \t\t@ a[1]\n\tumlal   r3, r4, r7, r14   \t\t@ c += a[0] * b[7]\n\tldr\tr8, [r2, #6*4]   \t\t@ b[6]\n\tumlal   r11, r12, r0, r14   \t\t@ c' += a[1] * b[7]\n\tldr\tr7, [r1, #2*4]   \t\t@ a[2]\n\tumlal   r3, r4, r0, r8   \t\t@ c += a[1] * b[6]\n\tldr\tr14, [r2, #5*4]   \t\t@ b[5]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[2] * b[6]\n\tldr\tr0, [r1, #3*4]   \t\t@ a[3]\n\tumlal   r3, r4, r7, r14   \t\t@ c += a[2] * b[5]\n\tldr\tr8, [r2, #4*4]   \t\t@ b[4]\n\tumlal   r11, r12, r0, r14   \t\t@ c' += a[3] * b[5]\n\tldr\tr7, [r1, #4*4]   \t\t@ a[4]\n\tumlal   r3, r4, r0, r8   \t\t@ c += a[3] * b[4]\n\tldr\tr14, [r2, #3*4]   \t\t@ b[3]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[4] * b[4]\n\tldr\tr0, [r1, #5*4]   \t\t@ a[5]\n\tumlal   r3, r4, r7, r14   \t\t@ c += a[4] * b[3]\n\tldr\tr8, [r2, #2*4]   \t\t@ b[2]\n\tumlal   r11, r12, r0, r14   \t\t@ c' += a[5] * b[3]\n\tldr\tr7, [r1, #6*4]   \t\t@ a[6]\n\tumlal   r3, r4, r0, r8   \t\t@ c += a[5] * b[2]\n\tldr\tr14, [r2, #1*4]   \t\t@ b[1]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[6] * b[2]\n\tldr\tr0, [r1, #7*4]   \t\t@ a[7]\n\tumlal   r3, r4, r7, r14   \t\t@ c += a[6] * b[1]\n\tldr\tr8, [r2, #0*4]   \t\t@ b[0]\n\tumlal   r11, r12, r0, r14   \t\t@ c' += a[7] * b[1]\n\tldr\tr7, [r1, #8*4]   \t\t@ a[8]\n\tumlal   r3, r4, r0, r8   \t\t@ c += a[7] * b[0]\n\tldr\tr14, [r2, #9*4]   \t\t@ b[9]\n\tumlal   r11, r12, r7, r8   \t\t@ c' += a[8] * b[0]\n\tldr\tr0, [r1, #9*4]   \t\t@ a[9]\n\tumlal\tr5, r6, r7, r14   \t\t@ d += a[8] * b[9]\n\tldr\tr8, [r2, #8*4]   \t\t@ b[8]\n\tumull\tr9, r10, r0, r14  \t\t@ d' = a[9] * b[9]\n\tumlal\tr5, r6, r0, r8   \t\t@ d += a[9] * b[8]\n\n\tbic\tr0, r5, field_not_M \t\t@ u7 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u7 * R0\n\tumlal   r3, r4, r0, r14\n\n\tbic\tr14, r3, field_not_M \t\t@ t7 = c & M\n\tstr\tr14, [sp, #4 + 7*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u7 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* J */\n\tadds\tr3, r3, r11\t\t\t@ c += c'\n\tadc\tr4, r4, r12\n\tadds\tr5, r5, r9\t\t\t@ d += d'\n\tadc\tr6, r6, r10\n\n\tbic\tr0, r5, field_not_M \t\t@ u8 = d & M\n\tstr\tr0, [sp, #4 + 8*4]\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u8 * R0\n\tumlal   r3, r4, r0, r14\n\n\t/******************************************\n\t * compute and write back result\n\t ******************************************\n\tAllocation:\n\t    r0    r\n\t    r3:r4 c\n\t    r5:r6 d\n\t    r7    t0\n\t    r8    t1\n\t    r9    t2\n\t    r11   u8\n\t    r12   t9\n\t    r1,r2,r10,r14 scratch\n\n\tNote: do not read from a[] after here, it may overlap with r[]\n\t*/\n\tldr\tr0, [sp, #0]\n\tadd\tr1, sp, #4 + 3*4\t\t@ r[3..7] = t3..7, r11=u8, r12=t9\n\tldmia\tr1, {r2,r7,r8,r9,r10,r11,r12}\n\tadd\tr1, r0, #3*4\n\tstmia\tr1, {r2,r7,r8,r9,r10}\n\n\tbic\tr2, r3, field_not_M \t\t@ r[8] = c & M\n\tstr\tr2, [r0, #8*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u8 * R1\n\tumlal   r3, r4, r11, r14\n\tmovw    r14, field_R0\t\t\t@ c += d * R0\n\tumlal   r3, r4, r5, r14\n\tadds\tr3, r3, r12\t\t\t@ c += t9\n\tadc\tr4, r4, #0\n\n\tadd\tr1, sp, #4 + 0*4\t\t@ r7,r8,r9 = t0,t1,t2\n\tldmia\tr1, {r7,r8,r9}\n\n\tubfx\tr2, r3, #0, #22     \t\t@ r[9] = c & (M >> 4)\n\tstr\tr2, [r0, #9*4]\n\tmov\tr3, r3, lsr #22     \t\t@ c >>= 22\n\torr\tr3, r3, r4, asl #10\n\tmov     r4, r4, lsr #22\n\tmovw    r14, field_R1 << 4   \t\t@ c += d * (R1 << 4)\n\tumlal   r3, r4, r5, r14\n\n\tmovw    r14, field_R0 >> 4   \t\t@ d = c * (R0 >> 4) + t0 (64x64 multiply+add)\n\tumull\tr5, r6, r3, r14\t\t\t@ d = c.lo * (R0 >> 4)\n\tadds\tr5, r5, r7\t    \t\t@ d.lo += t0\n\tmla\tr6, r14, r4, r6\t\t\t@ d.hi += c.hi * (R0 >> 4)\n\tadc\tr6, r6, 0\t     \t\t@ d.hi += carry\n\n\tbic\tr2, r5, field_not_M \t\t@ r[0] = d & M\n\tstr\tr2, [r0, #0*4]\n\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\t\n\tmovw    r14, field_R1 >> 4   \t\t@ d += c * (R1 >> 4) + t1 (64x64 multiply+add)\n\tumull\tr1, r2, r3, r14       \t\t@ tmp = c.lo * (R1 >> 4)\n\tadds\tr5, r5, r8\t    \t\t@ d.lo += t1\n\tadc\tr6, r6, #0\t    \t\t@ d.hi += carry\n\tadds\tr5, r5, r1\t    \t\t@ d.lo += tmp.lo\n\tmla\tr2, r14, r4, r2      \t\t@ tmp.hi += c.hi * (R1 >> 4)\n\tadc\tr6, r6, r2\t   \t\t@ d.hi += carry + tmp.hi\n\n\tbic\tr2, r5, field_not_M \t\t@ r[1] = d & M\n\tstr\tr2, [r0, #1*4]\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26 (ignore hi)\n\torr\tr5, r5, r6, asl #6\n\n\tadd\tr5, r5, r9\t  \t\t@ d += t2\n\tstr\tr5, [r0, #2*4]      \t\t@ r[2] = d\n\n\tadd\tsp, sp, #48\n\tldmfd\tsp!, {r4, r5, r6, r7, r8, r9, r10, r11, pc}\n\t.size\tsecp256k1_fe_mul_inner, .-secp256k1_fe_mul_inner\n\n\t.align\t2\n\t.global secp256k1_fe_sqr_inner\n\t.type\tsecp256k1_fe_sqr_inner, %function\n\t@ Arguments:\n\t@  r0  r\t Can overlap with a\n\t@  r1  a\n\t@ Stack (total 4+10*4 = 44)\n\t@  sp + #0        saved 'r' pointer\n\t@  sp + #4 + 4*X  t0,t1,t2,t3,t4,t5,t6,t7,u8,t9\nsecp256k1_fe_sqr_inner:\n\tstmfd\tsp!, {r4, r5, r6, r7, r8, r9, r10, r11, r14}\n\tsub\tsp, sp, #48\t\t\t@ frame=44 + alignment\n\tstr     r0, [sp, #0]\t\t\t@ save result address, we need it only at the end\n\t/******************************************\n\t * Main computation code.\n\t ******************************************\n\n\tAllocation:\n\t    r0,r14,r2,r7,r8   scratch\n\t    r1       a (pointer)\n\t    r3:r4    c\n\t    r5:r6    d\n\t    r11:r12  c'\n\t    r9:r10   d'\n\n\tNote: do not write to r[] here, it may overlap with a[]\n\t*/\n\t/* A interleaved with B */\n\tldr\tr0, [r1, #1*4]\t\t\t@ a[1]*2\n\tldr\tr7, [r1, #0*4]\t\t\t@ a[0]\n\tmov\tr0, r0, asl #1\n\tldr\tr14, [r1, #9*4]\t\t\t@ a[9]\n\tumull\tr3, r4, r7, r7\t\t\t@ c = a[0] * a[0]\n\tldr\tr8, [r1, #8*4]\t\t\t@ a[8]\n\tmov\tr7, r7, asl #1\n\tumull\tr5, r6, r7, r14\t\t\t@ d = a[0]*2 * a[9]\n\tldr\tr7, [r1, #2*4]\t\t\t@ a[2]*2\n\tumull\tr9, r10, r0, r14\t\t@ d' = a[1]*2 * a[9]\n\tldr\tr14, [r1, #7*4]\t\t\t@ a[7]\n\tumlal\tr5, r6, r0, r8\t\t\t@ d += a[1]*2 * a[8]\n\tmov\tr7, r7, asl #1\n\tldr\tr0, [r1, #3*4]\t\t\t@ a[3]*2\n\tumlal\tr9, r10, r7, r8\t\t\t@ d' += a[2]*2 * a[8]\n\tldr\tr8, [r1, #6*4]\t\t\t@ a[6]\n\tumlal\tr5, r6, r7, r14\t\t\t@ d += a[2]*2 * a[7]\n\tmov\tr0, r0, asl #1\n\tldr\tr7, [r1, #4*4]\t\t\t@ a[4]*2\n\tumlal\tr9, r10, r0, r14\t\t@ d' += a[3]*2 * a[7]\n\tldr\tr14, [r1, #5*4]\t\t\t@ a[5]\n\tmov\tr7, r7, asl #1\n\tumlal\tr5, r6, r0, r8\t\t\t@ d += a[3]*2 * a[6]\n\tumlal\tr9, r10, r7, r8\t\t\t@ d' += a[4]*2 * a[6]\n\tumlal\tr5, r6, r7, r14\t\t\t@ d += a[4]*2 * a[5]\n\tumlal\tr9, r10, r14, r14\t\t@ d' += a[5] * a[5]\n\n\tbic\tr0, r5, field_not_M \t\t@ t9 = d & M\n\tstr     r0, [sp, #4 + 9*4]\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26 \n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\n\t/* B */\n\tadds\tr5, r5, r9\t\t\t@ d += d'\n\tadc\tr6, r6, r10\n\n\tbic\tr0, r5, field_not_M \t\t@ u0 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u0 * R0\n\tumlal   r3, r4, r0, r14\n\tbic\tr14, r3, field_not_M \t\t@ t0 = c & M\n\tstr\tr14, [sp, #4 + 0*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u0 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* C interleaved with D */\n\tldr\tr0, [r1, #0*4]\t\t\t@ a[0]*2\n\tldr\tr14, [r1, #1*4]\t\t\t@ a[1]\n\tmov\tr0, r0, asl #1\n\tldr\tr8, [r1, #2*4]\t\t\t@ a[2]\n\tumlal\tr3, r4, r0, r14\t\t\t@ c += a[0]*2 * a[1]\n\tmov\tr7, r8, asl #1                  @ a[2]*2\n\tumull\tr11, r12, r14, r14\t\t@ c' = a[1] * a[1]\n\tldr\tr14, [r1, #9*4]\t\t\t@ a[9]\n\tumlal\tr11, r12, r0, r8\t\t@ c' += a[0]*2 * a[2]\n\tldr\tr0, [r1, #3*4]\t\t\t@ a[3]*2\n\tldr\tr8, [r1, #8*4]\t\t\t@ a[8]\n\tumlal\tr5, r6, r7, r14\t\t\t@ d += a[2]*2 * a[9]\n\tmov\tr0, r0, asl #1\n\tldr\tr7, [r1, #4*4]\t\t\t@ a[4]*2\n\tumull\tr9, r10, r0, r14\t\t@ d' = a[3]*2 * a[9]\n\tldr\tr14, [r1, #7*4]\t\t\t@ a[7]\n\tumlal\tr5, r6, r0, r8\t\t\t@ d += a[3]*2 * a[8]\n\tmov\tr7, r7, asl #1\n\tldr\tr0, [r1, #5*4]\t\t\t@ a[5]*2\n\tumlal\tr9, r10, r7, r8\t\t\t@ d' += a[4]*2 * a[8]\n\tldr\tr8, [r1, #6*4]\t\t\t@ a[6]\n\tmov\tr0, r0, asl #1\n\tumlal\tr5, r6, r7, r14\t\t\t@ d += a[4]*2 * a[7]\n\tumlal\tr9, r10, r0, r14\t\t@ d' += a[5]*2 * a[7]\n\tumlal\tr5, r6, r0, r8\t\t\t@ d += a[5]*2 * a[6]\n\tumlal\tr9, r10, r8, r8\t\t\t@ d' += a[6] * a[6]\n\n\tbic\tr0, r5, field_not_M \t\t@ u1 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u1 * R0\n\tumlal   r3, r4, r0, r14\n\tbic\tr14, r3, field_not_M \t\t@ t1 = c & M\n\tstr\tr14, [sp, #4 + 1*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u1 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* D */\n\tadds\tr3, r3, r11\t\t\t@ c += c'\n\tadc\tr4, r4, r12\n\tadds\tr5, r5, r9\t\t\t@ d += d'\n\tadc\tr6, r6, r10\n\n\tbic\tr0, r5, field_not_M \t\t@ u2 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u2 * R0\n\tumlal   r3, r4, r0, r14\n\tbic\tr14, r3, field_not_M \t\t@ t2 = c & M\n\tstr\tr14, [sp, #4 + 2*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u2 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* E interleaved with F */\n\tldr\tr7, [r1, #0*4]\t\t\t@ a[0]*2\n\tldr\tr0, [r1, #1*4]\t\t\t@ a[1]*2\n\tldr\tr14, [r1, #2*4]\t\t\t@ a[2]\n\tmov\tr7, r7, asl #1\n\tldr\tr8, [r1, #3*4]\t\t\t@ a[3]\n\tldr\tr2, [r1, #4*4]\n\tumlal\tr3, r4, r7, r8\t\t\t@ c += a[0]*2 * a[3]\n\tmov\tr0, r0, asl #1\n\tumull\tr11, r12, r7, r2\t\t@ c' = a[0]*2 * a[4]\n\tmov\tr2, r2, asl #1\t\t\t@ a[4]*2\n\tumlal\tr11, r12, r0, r8\t\t@ c' += a[1]*2 * a[3]\n\tldr\tr8, [r1, #9*4]\t\t\t@ a[9]\n\tumlal\tr3, r4, r0, r14\t\t\t@ c += a[1]*2 * a[2]\n\tldr\tr0, [r1, #5*4]\t\t\t@ a[5]*2\n\tumlal\tr11, r12, r14, r14\t\t@ c' += a[2] * a[2]\n\tldr\tr14, [r1, #8*4]\t\t\t@ a[8]\n\tmov\tr0, r0, asl #1\n\tumlal\tr5, r6, r2, r8\t\t\t@ d += a[4]*2 * a[9]\n\tldr\tr7, [r1, #6*4]\t\t\t@ a[6]*2\n\tumull\tr9, r10, r0, r8\t\t\t@ d' = a[5]*2 * a[9]\n\tmov\tr7, r7, asl #1\n\tldr\tr8, [r1, #7*4]\t\t\t@ a[7]\n\tumlal\tr5, r6, r0, r14\t\t\t@ d += a[5]*2 * a[8]\n\tumlal\tr9, r10, r7, r14\t\t@ d' += a[6]*2 * a[8]\n\tumlal\tr5, r6, r7, r8\t\t\t@ d += a[6]*2 * a[7]\n\tumlal\tr9, r10, r8, r8\t\t\t@ d' += a[7] * a[7]\n\n\tbic\tr0, r5, field_not_M \t\t@ u3 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u3 * R0\n\tumlal   r3, r4, r0, r14\n\tbic\tr14, r3, field_not_M \t\t@ t3 = c & M\n\tstr\tr14, [sp, #4 + 3*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u3 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* F */\n\tadds\tr3, r3, r11\t\t\t@ c += c'\n\tadc\tr4, r4, r12\n\tadds\tr5, r5, r9\t\t\t@ d += d'\n\tadc\tr6, r6, r10\n\n\tbic\tr0, r5, field_not_M \t\t@ u4 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u4 * R0\n\tumlal   r3, r4, r0, r14\n\tbic\tr14, r3, field_not_M \t\t@ t4 = c & M\n\tstr\tr14, [sp, #4 + 4*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u4 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* G interleaved with H */\n\tldr\tr7, [r1, #0*4]\t\t\t@ a[0]*2\n\tldr\tr0, [r1, #1*4]\t\t\t@ a[1]*2\n\tmov\tr7, r7, asl #1\n\tldr\tr8, [r1, #5*4]\t\t\t@ a[5]\n\tldr\tr2, [r1, #6*4]\t\t\t@ a[6]\n\tumlal\tr3, r4, r7, r8\t\t\t@ c += a[0]*2 * a[5]\n\tldr\tr14, [r1, #4*4]\t\t\t@ a[4]\n\tmov\tr0, r0, asl #1\n\tumull\tr11, r12, r7, r2\t\t@ c' = a[0]*2 * a[6]\n\tldr\tr7, [r1, #2*4]\t\t\t@ a[2]*2\n\tumlal\tr11, r12, r0, r8\t\t@ c' += a[1]*2 * a[5]\n\tmov\tr7, r7, asl #1\n\tldr\tr8, [r1, #3*4]\t\t\t@ a[3]\n\tumlal\tr3, r4, r0, r14\t\t\t@ c += a[1]*2 * a[4]\n\tmov\tr0, r2, asl #1\t\t\t@ a[6]*2\n\tumlal\tr11, r12, r7, r14\t\t@ c' += a[2]*2 * a[4]\n\tldr\tr14, [r1, #9*4]\t\t\t@ a[9]\n\tumlal\tr3, r4, r7, r8\t\t\t@ c += a[2]*2 * a[3]\n\tldr\tr7, [r1, #7*4]\t\t\t@ a[7]*2\n\tumlal\tr11, r12, r8, r8\t\t@ c' += a[3] * a[3]\n\tmov\tr7, r7, asl #1\n\tldr\tr8, [r1, #8*4]\t\t\t@ a[8]\n\tumlal\tr5, r6, r0, r14\t\t\t@ d += a[6]*2 * a[9]\n\tumull\tr9, r10, r7, r14\t\t@ d' = a[7]*2 * a[9]\n\tumlal\tr5, r6, r7, r8\t\t\t@ d += a[7]*2 * a[8]\n\tumlal\tr9, r10, r8, r8\t\t\t@ d' += a[8] * a[8]\n\n\tbic\tr0, r5, field_not_M \t\t@ u5 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u5 * R0\n\tumlal   r3, r4, r0, r14\n\tbic\tr14, r3, field_not_M \t\t@ t5 = c & M\n\tstr\tr14, [sp, #4 + 5*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u5 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* H */\n\tadds\tr3, r3, r11\t\t\t@ c += c'\n\tadc\tr4, r4, r12\n\tadds\tr5, r5, r9\t\t\t@ d += d'\n\tadc\tr6, r6, r10\n\n\tbic\tr0, r5, field_not_M \t\t@ u6 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u6 * R0\n\tumlal   r3, r4, r0, r14\n\tbic\tr14, r3, field_not_M \t\t@ t6 = c & M\n\tstr\tr14, [sp, #4 + 6*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u6 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* I interleaved with J */\n\tldr\tr7, [r1, #0*4]\t\t\t@ a[0]*2\n\tldr\tr0, [r1, #1*4]\t\t\t@ a[1]*2\n\tmov\tr7, r7, asl #1\n\tldr\tr8, [r1, #7*4]\t\t\t@ a[7]\n\tldr\tr2, [r1, #8*4]\t\t\t@ a[8]\n\tumlal\tr3, r4, r7, r8\t\t\t@ c += a[0]*2 * a[7]\n\tldr\tr14, [r1, #6*4]\t\t\t@ a[6]\n\tmov\tr0, r0, asl #1\n\tumull\tr11, r12, r7, r2\t\t@ c' = a[0]*2 * a[8]\n\tldr\tr7, [r1, #2*4]\t\t\t@ a[2]*2\n\tumlal\tr11, r12, r0, r8\t\t@ c' += a[1]*2 * a[7]\n\tldr\tr8, [r1, #5*4]\t\t\t@ a[5]\n\tumlal\tr3, r4, r0, r14\t\t\t@ c += a[1]*2 * a[6]\n\tldr\tr0, [r1, #3*4]\t\t\t@ a[3]*2\n\tmov\tr7, r7, asl #1\n\tumlal\tr11, r12, r7, r14\t\t@ c' += a[2]*2 * a[6]\n\tldr\tr14, [r1, #4*4]\t\t\t@ a[4]\n\tmov\tr0, r0, asl #1\n\tumlal\tr3, r4, r7, r8\t\t\t@ c += a[2]*2 * a[5]\n\tmov\tr2, r2, asl #1\t\t\t@ a[8]*2\n\tumlal\tr11, r12, r0, r8\t\t@ c' += a[3]*2 * a[5]\n\tumlal\tr3, r4, r0, r14\t\t\t@ c += a[3]*2 * a[4]\n\tumlal\tr11, r12, r14, r14\t\t@ c' += a[4] * a[4]\n\tldr\tr8, [r1, #9*4]\t\t\t@ a[9]\n\tumlal\tr5, r6, r2, r8\t\t\t@ d += a[8]*2 * a[9]\n\t@ r8 will be used in J\n\n\tbic\tr0, r5, field_not_M \t\t@ u7 = d & M\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u7 * R0\n\tumlal   r3, r4, r0, r14\n\tbic\tr14, r3, field_not_M \t\t@ t7 = c & M\n\tstr\tr14, [sp, #4 + 7*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u7 * R1\n\tumlal   r3, r4, r0, r14\n\n\t/* J */\n\tadds\tr3, r3, r11\t\t\t@ c += c'\n\tadc\tr4, r4, r12\n\tumlal\tr5, r6, r8, r8\t\t\t@ d += a[9] * a[9]\n\n\tbic\tr0, r5, field_not_M \t\t@ u8 = d & M\n\tstr\tr0, [sp, #4 + 8*4]\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\tmovw    r14, field_R0\t\t\t@ c += u8 * R0\n\tumlal   r3, r4, r0, r14\n\n\t/******************************************\n\t * compute and write back result\n\t ******************************************\n\tAllocation:\n\t    r0    r\n\t    r3:r4 c\n\t    r5:r6 d\n\t    r7    t0\n\t    r8    t1\n\t    r9    t2\n\t    r11   u8\n\t    r12   t9\n\t    r1,r2,r10,r14 scratch\n\n\tNote: do not read from a[] after here, it may overlap with r[]\n\t*/\n\tldr\tr0, [sp, #0]\n\tadd\tr1, sp, #4 + 3*4\t\t@ r[3..7] = t3..7, r11=u8, r12=t9\n\tldmia\tr1, {r2,r7,r8,r9,r10,r11,r12}\n\tadd\tr1, r0, #3*4\n\tstmia\tr1, {r2,r7,r8,r9,r10}\n\n\tbic\tr2, r3, field_not_M \t\t@ r[8] = c & M\n\tstr\tr2, [r0, #8*4]\n\tmov\tr3, r3, lsr #26     \t\t@ c >>= 26\n\torr\tr3, r3, r4, asl #6\n\tmov     r4, r4, lsr #26\n\tmov     r14, field_R1\t\t\t@ c += u8 * R1\n\tumlal   r3, r4, r11, r14\n\tmovw    r14, field_R0\t\t\t@ c += d * R0\n\tumlal   r3, r4, r5, r14\n\tadds\tr3, r3, r12\t\t\t@ c += t9\n\tadc\tr4, r4, #0\n\n\tadd\tr1, sp, #4 + 0*4\t\t@ r7,r8,r9 = t0,t1,t2\n\tldmia\tr1, {r7,r8,r9}\n\n\tubfx\tr2, r3, #0, #22     \t\t@ r[9] = c & (M >> 4)\n\tstr\tr2, [r0, #9*4]\n\tmov\tr3, r3, lsr #22     \t\t@ c >>= 22\n\torr\tr3, r3, r4, asl #10\n\tmov     r4, r4, lsr #22\n\tmovw    r14, field_R1 << 4   \t\t@ c += d * (R1 << 4)\n\tumlal   r3, r4, r5, r14\n\n\tmovw    r14, field_R0 >> 4   \t\t@ d = c * (R0 >> 4) + t0 (64x64 multiply+add)\n\tumull\tr5, r6, r3, r14\t\t\t@ d = c.lo * (R0 >> 4)\n\tadds\tr5, r5, r7\t    \t\t@ d.lo += t0\n\tmla\tr6, r14, r4, r6\t\t\t@ d.hi += c.hi * (R0 >> 4)\n\tadc\tr6, r6, 0\t     \t\t@ d.hi += carry\n\n\tbic\tr2, r5, field_not_M \t\t@ r[0] = d & M\n\tstr\tr2, [r0, #0*4]\n\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26\n\torr\tr5, r5, r6, asl #6\n\tmov     r6, r6, lsr #26\n\t\n\tmovw    r14, field_R1 >> 4   \t\t@ d += c * (R1 >> 4) + t1 (64x64 multiply+add)\n\tumull\tr1, r2, r3, r14       \t\t@ tmp = c.lo * (R1 >> 4)\n\tadds\tr5, r5, r8\t    \t\t@ d.lo += t1\n\tadc\tr6, r6, #0\t    \t\t@ d.hi += carry\n\tadds\tr5, r5, r1\t    \t\t@ d.lo += tmp.lo\n\tmla\tr2, r14, r4, r2      \t\t@ tmp.hi += c.hi * (R1 >> 4)\n\tadc\tr6, r6, r2\t   \t\t@ d.hi += carry + tmp.hi\n\n\tbic\tr2, r5, field_not_M \t\t@ r[1] = d & M\n\tstr\tr2, [r0, #1*4]\n\tmov\tr5, r5, lsr #26     \t\t@ d >>= 26 (ignore hi)\n\torr\tr5, r5, r6, asl #6\n\n\tadd\tr5, r5, r9\t  \t\t@ d += t2\n\tstr\tr5, [r0, #2*4]      \t\t@ r[2] = d\n\n\tadd\tsp, sp, #48\n\tldmfd\tsp!, {r4, r5, r6, r7, r8, r9, r10, r11, pc}\n\t.size\tsecp256k1_fe_sqr_inner, .-secp256k1_fe_sqr_inner\n\n"
  },
  {
    "path": "src/secp256k1/src/basic-config.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_BASIC_CONFIG_H\n#define SECP256K1_BASIC_CONFIG_H\n\n#ifdef USE_BASIC_CONFIG\n\n#undef USE_ASM_X86_64\n#undef USE_ENDOMORPHISM\n#undef USE_FIELD_10X26\n#undef USE_FIELD_5X52\n#undef USE_FIELD_INV_BUILTIN\n#undef USE_FIELD_INV_NUM\n#undef USE_NUM_GMP\n#undef USE_NUM_NONE\n#undef USE_SCALAR_4X64\n#undef USE_SCALAR_8X32\n#undef USE_SCALAR_INV_BUILTIN\n#undef USE_SCALAR_INV_NUM\n\n#define USE_NUM_NONE 1\n#define USE_FIELD_INV_BUILTIN 1\n#define USE_SCALAR_INV_BUILTIN 1\n#define USE_FIELD_10X26 1\n#define USE_SCALAR_8X32 1\n\n#endif /* USE_BASIC_CONFIG */\n\n#endif /* SECP256K1_BASIC_CONFIG_H */\n"
  },
  {
    "path": "src/secp256k1/src/bench.h",
    "content": "/**********************************************************************\n * Copyright (c) 2014 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_BENCH_H\n#define SECP256K1_BENCH_H\n\n#include <stdio.h>\n#include <math.h>\n#include \"sys/time.h\"\n\nstatic double gettimedouble(void) {\n    struct timeval tv;\n    gettimeofday(&tv, NULL);\n    return tv.tv_usec * 0.000001 + tv.tv_sec;\n}\n\nvoid print_number(double x) {\n    double y = x;\n    int c = 0;\n    if (y < 0.0) {\n        y = -y;\n    }\n    while (y > 0 && y < 100.0) {\n        y *= 10.0;\n        c++;\n    }\n    printf(\"%.*f\", c, x);\n}\n\nvoid run_benchmark(char *name, void (*benchmark)(void*), void (*setup)(void*), void (*teardown)(void*), void* data, int count, int iter) {\n    int i;\n    double min = HUGE_VAL;\n    double sum = 0.0;\n    double max = 0.0;\n    for (i = 0; i < count; i++) {\n        double begin, total;\n        if (setup != NULL) {\n            setup(data);\n        }\n        begin = gettimedouble();\n        benchmark(data);\n        total = gettimedouble() - begin;\n        if (teardown != NULL) {\n            teardown(data);\n        }\n        if (total < min) {\n            min = total;\n        }\n        if (total > max) {\n            max = total;\n        }\n        sum += total;\n    }\n    printf(\"%s: min \", name);\n    print_number(min * 1000000.0 / iter);\n    printf(\"us / avg \");\n    print_number((sum / count) * 1000000.0 / iter);\n    printf(\"us / max \");\n    print_number(max * 1000000.0 / iter);\n    printf(\"us\\n\");\n}\n\n#endif /* SECP256K1_BENCH_H */\n"
  },
  {
    "path": "src/secp256k1/src/bench_ecdh.c",
    "content": "/**********************************************************************\n * Copyright (c) 2015 Pieter Wuille, Andrew Poelstra                  *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#include <string.h>\n\n#include \"include/secp256k1.h\"\n#include \"include/secp256k1_ecdh.h\"\n#include \"util.h\"\n#include \"bench.h\"\n\ntypedef struct {\n    secp256k1_context *ctx;\n    secp256k1_pubkey point;\n    unsigned char scalar[32];\n} bench_ecdh_t;\n\nstatic void bench_ecdh_setup(void* arg) {\n    int i;\n    bench_ecdh_t *data = (bench_ecdh_t*)arg;\n    const unsigned char point[] = {\n        0x03,\n        0x54, 0x94, 0xc1, 0x5d, 0x32, 0x09, 0x97, 0x06,\n        0xc2, 0x39, 0x5f, 0x94, 0x34, 0x87, 0x45, 0xfd,\n        0x75, 0x7c, 0xe3, 0x0e, 0x4e, 0x8c, 0x90, 0xfb,\n        0xa2, 0xba, 0xd1, 0x84, 0xf8, 0x83, 0xc6, 0x9f\n    };\n\n    /* create a context with no capabilities */\n    data->ctx = secp256k1_context_create(SECP256K1_FLAGS_TYPE_CONTEXT);\n    for (i = 0; i < 32; i++) {\n        data->scalar[i] = i + 1;\n    }\n    CHECK(secp256k1_ec_pubkey_parse(data->ctx, &data->point, point, sizeof(point)) == 1);\n}\n\nstatic void bench_ecdh(void* arg) {\n    int i;\n    unsigned char res[32];\n    bench_ecdh_t *data = (bench_ecdh_t*)arg;\n\n    for (i = 0; i < 20000; i++) {\n        CHECK(secp256k1_ecdh(data->ctx, res, &data->point, data->scalar) == 1);\n    }\n}\n\nint main(void) {\n    bench_ecdh_t data;\n\n    run_benchmark(\"ecdh\", bench_ecdh, bench_ecdh_setup, NULL, &data, 10, 20000);\n    return 0;\n}\n"
  },
  {
    "path": "src/secp256k1/src/bench_internal.c",
    "content": "/**********************************************************************\n * Copyright (c) 2014-2015 Pieter Wuille                              *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n#include <stdio.h>\n\n#include \"include/secp256k1.h\"\n\n#include \"util.h\"\n#include \"hash_impl.h\"\n#include \"num_impl.h\"\n#include \"field_impl.h\"\n#include \"group_impl.h\"\n#include \"scalar_impl.h\"\n#include \"ecmult_const_impl.h\"\n#include \"ecmult_impl.h\"\n#include \"bench.h\"\n#include \"secp256k1.c\"\n\ntypedef struct {\n    secp256k1_scalar scalar_x, scalar_y;\n    secp256k1_fe fe_x, fe_y;\n    secp256k1_ge ge_x, ge_y;\n    secp256k1_gej gej_x, gej_y;\n    unsigned char data[64];\n    int wnaf[256];\n} bench_inv_t;\n\nvoid bench_setup(void* arg) {\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    static const unsigned char init_x[32] = {\n        0x02, 0x03, 0x05, 0x07, 0x0b, 0x0d, 0x11, 0x13,\n        0x17, 0x1d, 0x1f, 0x25, 0x29, 0x2b, 0x2f, 0x35,\n        0x3b, 0x3d, 0x43, 0x47, 0x49, 0x4f, 0x53, 0x59,\n        0x61, 0x65, 0x67, 0x6b, 0x6d, 0x71, 0x7f, 0x83\n    };\n\n    static const unsigned char init_y[32] = {\n        0x82, 0x83, 0x85, 0x87, 0x8b, 0x8d, 0x81, 0x83,\n        0x97, 0xad, 0xaf, 0xb5, 0xb9, 0xbb, 0xbf, 0xc5,\n        0xdb, 0xdd, 0xe3, 0xe7, 0xe9, 0xef, 0xf3, 0xf9,\n        0x11, 0x15, 0x17, 0x1b, 0x1d, 0xb1, 0xbf, 0xd3\n    };\n\n    secp256k1_scalar_set_b32(&data->scalar_x, init_x, NULL);\n    secp256k1_scalar_set_b32(&data->scalar_y, init_y, NULL);\n    secp256k1_fe_set_b32(&data->fe_x, init_x);\n    secp256k1_fe_set_b32(&data->fe_y, init_y);\n    CHECK(secp256k1_ge_set_xo_var(&data->ge_x, &data->fe_x, 0));\n    CHECK(secp256k1_ge_set_xo_var(&data->ge_y, &data->fe_y, 1));\n    secp256k1_gej_set_ge(&data->gej_x, &data->ge_x);\n    secp256k1_gej_set_ge(&data->gej_y, &data->ge_y);\n    memcpy(data->data, init_x, 32);\n    memcpy(data->data + 32, init_y, 32);\n}\n\nvoid bench_scalar_add(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 2000000; i++) {\n        secp256k1_scalar_add(&data->scalar_x, &data->scalar_x, &data->scalar_y);\n    }\n}\n\nvoid bench_scalar_negate(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 2000000; i++) {\n        secp256k1_scalar_negate(&data->scalar_x, &data->scalar_x);\n    }\n}\n\nvoid bench_scalar_sqr(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 200000; i++) {\n        secp256k1_scalar_sqr(&data->scalar_x, &data->scalar_x);\n    }\n}\n\nvoid bench_scalar_mul(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 200000; i++) {\n        secp256k1_scalar_mul(&data->scalar_x, &data->scalar_x, &data->scalar_y);\n    }\n}\n\n#ifdef USE_ENDOMORPHISM\nvoid bench_scalar_split(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_scalar l, r;\n        secp256k1_scalar_split_lambda(&l, &r, &data->scalar_x);\n        secp256k1_scalar_add(&data->scalar_x, &data->scalar_x, &data->scalar_y);\n    }\n}\n#endif\n\nvoid bench_scalar_inverse(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 2000; i++) {\n        secp256k1_scalar_inverse(&data->scalar_x, &data->scalar_x);\n        secp256k1_scalar_add(&data->scalar_x, &data->scalar_x, &data->scalar_y);\n    }\n}\n\nvoid bench_scalar_inverse_var(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 2000; i++) {\n        secp256k1_scalar_inverse_var(&data->scalar_x, &data->scalar_x);\n        secp256k1_scalar_add(&data->scalar_x, &data->scalar_x, &data->scalar_y);\n    }\n}\n\nvoid bench_field_normalize(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 2000000; i++) {\n        secp256k1_fe_normalize(&data->fe_x);\n    }\n}\n\nvoid bench_field_normalize_weak(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 2000000; i++) {\n        secp256k1_fe_normalize_weak(&data->fe_x);\n    }\n}\n\nvoid bench_field_mul(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 200000; i++) {\n        secp256k1_fe_mul(&data->fe_x, &data->fe_x, &data->fe_y);\n    }\n}\n\nvoid bench_field_sqr(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 200000; i++) {\n        secp256k1_fe_sqr(&data->fe_x, &data->fe_x);\n    }\n}\n\nvoid bench_field_inverse(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_fe_inv(&data->fe_x, &data->fe_x);\n        secp256k1_fe_add(&data->fe_x, &data->fe_y);\n    }\n}\n\nvoid bench_field_inverse_var(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_fe_inv_var(&data->fe_x, &data->fe_x);\n        secp256k1_fe_add(&data->fe_x, &data->fe_y);\n    }\n}\n\nvoid bench_field_sqrt(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_fe_sqrt(&data->fe_x, &data->fe_x);\n        secp256k1_fe_add(&data->fe_x, &data->fe_y);\n    }\n}\n\nvoid bench_group_double_var(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 200000; i++) {\n        secp256k1_gej_double_var(&data->gej_x, &data->gej_x, NULL);\n    }\n}\n\nvoid bench_group_add_var(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 200000; i++) {\n        secp256k1_gej_add_var(&data->gej_x, &data->gej_x, &data->gej_y, NULL);\n    }\n}\n\nvoid bench_group_add_affine(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 200000; i++) {\n        secp256k1_gej_add_ge(&data->gej_x, &data->gej_x, &data->ge_y);\n    }\n}\n\nvoid bench_group_add_affine_var(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 200000; i++) {\n        secp256k1_gej_add_ge_var(&data->gej_x, &data->gej_x, &data->ge_y, NULL);\n    }\n}\n\nvoid bench_group_jacobi_var(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_gej_has_quad_y_var(&data->gej_x);\n    }\n}\n\nvoid bench_ecmult_wnaf(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_ecmult_wnaf(data->wnaf, 256, &data->scalar_x, WINDOW_A);\n        secp256k1_scalar_add(&data->scalar_x, &data->scalar_x, &data->scalar_y);\n    }\n}\n\nvoid bench_wnaf_const(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_wnaf_const(data->wnaf, data->scalar_x, WINDOW_A);\n        secp256k1_scalar_add(&data->scalar_x, &data->scalar_x, &data->scalar_y);\n    }\n}\n\n\nvoid bench_sha256(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n    secp256k1_sha256_t sha;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_sha256_initialize(&sha);\n        secp256k1_sha256_write(&sha, data->data, 32);\n        secp256k1_sha256_finalize(&sha, data->data);\n    }\n}\n\nvoid bench_hmac_sha256(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n    secp256k1_hmac_sha256_t hmac;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_hmac_sha256_initialize(&hmac, data->data, 32);\n        secp256k1_hmac_sha256_write(&hmac, data->data, 32);\n        secp256k1_hmac_sha256_finalize(&hmac, data->data);\n    }\n}\n\nvoid bench_rfc6979_hmac_sha256(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n    secp256k1_rfc6979_hmac_sha256_t rng;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_rfc6979_hmac_sha256_initialize(&rng, data->data, 64);\n        secp256k1_rfc6979_hmac_sha256_generate(&rng, data->data, 32);\n    }\n}\n\nvoid bench_context_verify(void* arg) {\n    int i;\n    (void)arg;\n    for (i = 0; i < 20; i++) {\n        secp256k1_context_destroy(secp256k1_context_create(SECP256K1_CONTEXT_VERIFY));\n    }\n}\n\nvoid bench_context_sign(void* arg) {\n    int i;\n    (void)arg;\n    for (i = 0; i < 200; i++) {\n        secp256k1_context_destroy(secp256k1_context_create(SECP256K1_CONTEXT_SIGN));\n    }\n}\n\n#ifndef USE_NUM_NONE\nvoid bench_num_jacobi(void* arg) {\n    int i;\n    bench_inv_t *data = (bench_inv_t*)arg;\n    secp256k1_num nx, norder;\n\n    secp256k1_scalar_get_num(&nx, &data->scalar_x);\n    secp256k1_scalar_order_get_num(&norder);\n    secp256k1_scalar_get_num(&norder, &data->scalar_y);\n\n    for (i = 0; i < 200000; i++) {\n        secp256k1_num_jacobi(&nx, &norder);\n    }\n}\n#endif\n\nint have_flag(int argc, char** argv, char *flag) {\n    char** argm = argv + argc;\n    argv++;\n    if (argv == argm) {\n        return 1;\n    }\n    while (argv != NULL && argv != argm) {\n        if (strcmp(*argv, flag) == 0) {\n            return 1;\n        }\n        argv++;\n    }\n    return 0;\n}\n\nint main(int argc, char **argv) {\n    bench_inv_t data;\n    if (have_flag(argc, argv, \"scalar\") || have_flag(argc, argv, \"add\")) run_benchmark(\"scalar_add\", bench_scalar_add, bench_setup, NULL, &data, 10, 2000000);\n    if (have_flag(argc, argv, \"scalar\") || have_flag(argc, argv, \"negate\")) run_benchmark(\"scalar_negate\", bench_scalar_negate, bench_setup, NULL, &data, 10, 2000000);\n    if (have_flag(argc, argv, \"scalar\") || have_flag(argc, argv, \"sqr\")) run_benchmark(\"scalar_sqr\", bench_scalar_sqr, bench_setup, NULL, &data, 10, 200000);\n    if (have_flag(argc, argv, \"scalar\") || have_flag(argc, argv, \"mul\")) run_benchmark(\"scalar_mul\", bench_scalar_mul, bench_setup, NULL, &data, 10, 200000);\n#ifdef USE_ENDOMORPHISM\n    if (have_flag(argc, argv, \"scalar\") || have_flag(argc, argv, \"split\")) run_benchmark(\"scalar_split\", bench_scalar_split, bench_setup, NULL, &data, 10, 20000);\n#endif\n    if (have_flag(argc, argv, \"scalar\") || have_flag(argc, argv, \"inverse\")) run_benchmark(\"scalar_inverse\", bench_scalar_inverse, bench_setup, NULL, &data, 10, 2000);\n    if (have_flag(argc, argv, \"scalar\") || have_flag(argc, argv, \"inverse\")) run_benchmark(\"scalar_inverse_var\", bench_scalar_inverse_var, bench_setup, NULL, &data, 10, 2000);\n\n    if (have_flag(argc, argv, \"field\") || have_flag(argc, argv, \"normalize\")) run_benchmark(\"field_normalize\", bench_field_normalize, bench_setup, NULL, &data, 10, 2000000);\n    if (have_flag(argc, argv, \"field\") || have_flag(argc, argv, \"normalize\")) run_benchmark(\"field_normalize_weak\", bench_field_normalize_weak, bench_setup, NULL, &data, 10, 2000000);\n    if (have_flag(argc, argv, \"field\") || have_flag(argc, argv, \"sqr\")) run_benchmark(\"field_sqr\", bench_field_sqr, bench_setup, NULL, &data, 10, 200000);\n    if (have_flag(argc, argv, \"field\") || have_flag(argc, argv, \"mul\")) run_benchmark(\"field_mul\", bench_field_mul, bench_setup, NULL, &data, 10, 200000);\n    if (have_flag(argc, argv, \"field\") || have_flag(argc, argv, \"inverse\")) run_benchmark(\"field_inverse\", bench_field_inverse, bench_setup, NULL, &data, 10, 20000);\n    if (have_flag(argc, argv, \"field\") || have_flag(argc, argv, \"inverse\")) run_benchmark(\"field_inverse_var\", bench_field_inverse_var, bench_setup, NULL, &data, 10, 20000);\n    if (have_flag(argc, argv, \"field\") || have_flag(argc, argv, \"sqrt\")) run_benchmark(\"field_sqrt\", bench_field_sqrt, bench_setup, NULL, &data, 10, 20000);\n\n    if (have_flag(argc, argv, \"group\") || have_flag(argc, argv, \"double\")) run_benchmark(\"group_double_var\", bench_group_double_var, bench_setup, NULL, &data, 10, 200000);\n    if (have_flag(argc, argv, \"group\") || have_flag(argc, argv, \"add\")) run_benchmark(\"group_add_var\", bench_group_add_var, bench_setup, NULL, &data, 10, 200000);\n    if (have_flag(argc, argv, \"group\") || have_flag(argc, argv, \"add\")) run_benchmark(\"group_add_affine\", bench_group_add_affine, bench_setup, NULL, &data, 10, 200000);\n    if (have_flag(argc, argv, \"group\") || have_flag(argc, argv, \"add\")) run_benchmark(\"group_add_affine_var\", bench_group_add_affine_var, bench_setup, NULL, &data, 10, 200000);\n    if (have_flag(argc, argv, \"group\") || have_flag(argc, argv, \"jacobi\")) run_benchmark(\"group_jacobi_var\", bench_group_jacobi_var, bench_setup, NULL, &data, 10, 20000);\n\n    if (have_flag(argc, argv, \"ecmult\") || have_flag(argc, argv, \"wnaf\")) run_benchmark(\"wnaf_const\", bench_wnaf_const, bench_setup, NULL, &data, 10, 20000);\n    if (have_flag(argc, argv, \"ecmult\") || have_flag(argc, argv, \"wnaf\")) run_benchmark(\"ecmult_wnaf\", bench_ecmult_wnaf, bench_setup, NULL, &data, 10, 20000);\n\n    if (have_flag(argc, argv, \"hash\") || have_flag(argc, argv, \"sha256\")) run_benchmark(\"hash_sha256\", bench_sha256, bench_setup, NULL, &data, 10, 20000);\n    if (have_flag(argc, argv, \"hash\") || have_flag(argc, argv, \"hmac\")) run_benchmark(\"hash_hmac_sha256\", bench_hmac_sha256, bench_setup, NULL, &data, 10, 20000);\n    if (have_flag(argc, argv, \"hash\") || have_flag(argc, argv, \"rng6979\")) run_benchmark(\"hash_rfc6979_hmac_sha256\", bench_rfc6979_hmac_sha256, bench_setup, NULL, &data, 10, 20000);\n\n    if (have_flag(argc, argv, \"context\") || have_flag(argc, argv, \"verify\")) run_benchmark(\"context_verify\", bench_context_verify, bench_setup, NULL, &data, 10, 20);\n    if (have_flag(argc, argv, \"context\") || have_flag(argc, argv, \"sign\")) run_benchmark(\"context_sign\", bench_context_sign, bench_setup, NULL, &data, 10, 200);\n\n#ifndef USE_NUM_NONE\n    if (have_flag(argc, argv, \"num\") || have_flag(argc, argv, \"jacobi\")) run_benchmark(\"num_jacobi\", bench_num_jacobi, bench_setup, NULL, &data, 10, 200000);\n#endif\n    return 0;\n}\n"
  },
  {
    "path": "src/secp256k1/src/bench_recover.c",
    "content": "/**********************************************************************\n * Copyright (c) 2014-2015 Pieter Wuille                              *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#include \"include/secp256k1.h\"\n#include \"include/secp256k1_recovery.h\"\n#include \"util.h\"\n#include \"bench.h\"\n\ntypedef struct {\n    secp256k1_context *ctx;\n    unsigned char msg[32];\n    unsigned char sig[64];\n} bench_recover_t;\n\nvoid bench_recover(void* arg) {\n    int i;\n    bench_recover_t *data = (bench_recover_t*)arg;\n    secp256k1_pubkey pubkey;\n    unsigned char pubkeyc[33];\n\n    for (i = 0; i < 20000; i++) {\n        int j;\n        size_t pubkeylen = 33;\n        secp256k1_ecdsa_recoverable_signature sig;\n        CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(data->ctx, &sig, data->sig, i % 2));\n        CHECK(secp256k1_ecdsa_recover(data->ctx, &pubkey, &sig, data->msg));\n        CHECK(secp256k1_ec_pubkey_serialize(data->ctx, pubkeyc, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED));\n        for (j = 0; j < 32; j++) {\n            data->sig[j + 32] = data->msg[j];    /* Move former message to S. */\n            data->msg[j] = data->sig[j];         /* Move former R to message. */\n            data->sig[j] = pubkeyc[j + 1];       /* Move recovered pubkey X coordinate to R (which must be a valid X coordinate). */\n        }\n    }\n}\n\nvoid bench_recover_setup(void* arg) {\n    int i;\n    bench_recover_t *data = (bench_recover_t*)arg;\n\n    for (i = 0; i < 32; i++) {\n        data->msg[i] = 1 + i;\n    }\n    for (i = 0; i < 64; i++) {\n        data->sig[i] = 65 + i;\n    }\n}\n\nint main(void) {\n    bench_recover_t data;\n\n    data.ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY);\n\n    run_benchmark(\"ecdsa_recover\", bench_recover, bench_recover_setup, NULL, &data, 10, 20000);\n\n    secp256k1_context_destroy(data.ctx);\n    return 0;\n}\n"
  },
  {
    "path": "src/secp256k1/src/bench_sign.c",
    "content": "/**********************************************************************\n * Copyright (c) 2014 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#include \"include/secp256k1.h\"\n#include \"util.h\"\n#include \"bench.h\"\n\ntypedef struct {\n    secp256k1_context* ctx;\n    unsigned char msg[32];\n    unsigned char key[32];\n} bench_sign_t;\n\nstatic void bench_sign_setup(void* arg) {\n    int i;\n    bench_sign_t *data = (bench_sign_t*)arg;\n\n    for (i = 0; i < 32; i++) {\n        data->msg[i] = i + 1;\n    }\n    for (i = 0; i < 32; i++) {\n        data->key[i] = i + 65;\n    }\n}\n\nstatic void bench_sign(void* arg) {\n    int i;\n    bench_sign_t *data = (bench_sign_t*)arg;\n\n    unsigned char sig[74];\n    for (i = 0; i < 20000; i++) {\n        size_t siglen = 74;\n        int j;\n        secp256k1_ecdsa_signature signature;\n        CHECK(secp256k1_ecdsa_sign(data->ctx, &signature, data->msg, data->key, NULL, NULL));\n        CHECK(secp256k1_ecdsa_signature_serialize_der(data->ctx, sig, &siglen, &signature));\n        for (j = 0; j < 32; j++) {\n            data->msg[j] = sig[j];\n            data->key[j] = sig[j + 32];\n        }\n    }\n}\n\nint main(void) {\n    bench_sign_t data;\n\n    data.ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);\n\n    run_benchmark(\"ecdsa_sign\", bench_sign, bench_sign_setup, NULL, &data, 10, 20000);\n\n    secp256k1_context_destroy(data.ctx);\n    return 0;\n}\n"
  },
  {
    "path": "src/secp256k1/src/bench_verify.c",
    "content": "/**********************************************************************\n * Copyright (c) 2014 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#include <stdio.h>\n#include <string.h>\n\n#include \"include/secp256k1.h\"\n#include \"util.h\"\n#include \"bench.h\"\n\n#ifdef ENABLE_OPENSSL_TESTS\n#include <openssl/bn.h>\n#include <openssl/ecdsa.h>\n#include <openssl/obj_mac.h>\n#endif\n\ntypedef struct {\n    secp256k1_context *ctx;\n    unsigned char msg[32];\n    unsigned char key[32];\n    unsigned char sig[72];\n    size_t siglen;\n    unsigned char pubkey[33];\n    size_t pubkeylen;\n#ifdef ENABLE_OPENSSL_TESTS\n    EC_GROUP* ec_group;\n#endif\n} benchmark_verify_t;\n\nstatic void benchmark_verify(void* arg) {\n    int i;\n    benchmark_verify_t* data = (benchmark_verify_t*)arg;\n\n    for (i = 0; i < 20000; i++) {\n        secp256k1_pubkey pubkey;\n        secp256k1_ecdsa_signature sig;\n        data->sig[data->siglen - 1] ^= (i & 0xFF);\n        data->sig[data->siglen - 2] ^= ((i >> 8) & 0xFF);\n        data->sig[data->siglen - 3] ^= ((i >> 16) & 0xFF);\n        CHECK(secp256k1_ec_pubkey_parse(data->ctx, &pubkey, data->pubkey, data->pubkeylen) == 1);\n        CHECK(secp256k1_ecdsa_signature_parse_der(data->ctx, &sig, data->sig, data->siglen) == 1);\n        CHECK(secp256k1_ecdsa_verify(data->ctx, &sig, data->msg, &pubkey) == (i == 0));\n        data->sig[data->siglen - 1] ^= (i & 0xFF);\n        data->sig[data->siglen - 2] ^= ((i >> 8) & 0xFF);\n        data->sig[data->siglen - 3] ^= ((i >> 16) & 0xFF);\n    }\n}\n\n#ifdef ENABLE_OPENSSL_TESTS\nstatic void benchmark_verify_openssl(void* arg) {\n    int i;\n    benchmark_verify_t* data = (benchmark_verify_t*)arg;\n\n    for (i = 0; i < 20000; i++) {\n        data->sig[data->siglen - 1] ^= (i & 0xFF);\n        data->sig[data->siglen - 2] ^= ((i >> 8) & 0xFF);\n        data->sig[data->siglen - 3] ^= ((i >> 16) & 0xFF);\n        {\n            EC_KEY *pkey = EC_KEY_new();\n            const unsigned char *pubkey = &data->pubkey[0];\n            int result;\n\n            CHECK(pkey != NULL);\n            result = EC_KEY_set_group(pkey, data->ec_group);\n            CHECK(result);\n            result = (o2i_ECPublicKey(&pkey, &pubkey, data->pubkeylen)) != NULL;\n            CHECK(result);\n            result = ECDSA_verify(0, &data->msg[0], sizeof(data->msg), &data->sig[0], data->siglen, pkey) == (i == 0);\n            CHECK(result);\n            EC_KEY_free(pkey);\n        }\n        data->sig[data->siglen - 1] ^= (i & 0xFF);\n        data->sig[data->siglen - 2] ^= ((i >> 8) & 0xFF);\n        data->sig[data->siglen - 3] ^= ((i >> 16) & 0xFF);\n    }\n}\n#endif\n\nint main(void) {\n    int i;\n    secp256k1_pubkey pubkey;\n    secp256k1_ecdsa_signature sig;\n    benchmark_verify_t data;\n\n    data.ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);\n\n    for (i = 0; i < 32; i++) {\n        data.msg[i] = 1 + i;\n    }\n    for (i = 0; i < 32; i++) {\n        data.key[i] = 33 + i;\n    }\n    data.siglen = 72;\n    CHECK(secp256k1_ecdsa_sign(data.ctx, &sig, data.msg, data.key, NULL, NULL));\n    CHECK(secp256k1_ecdsa_signature_serialize_der(data.ctx, data.sig, &data.siglen, &sig));\n    CHECK(secp256k1_ec_pubkey_create(data.ctx, &pubkey, data.key));\n    data.pubkeylen = 33;\n    CHECK(secp256k1_ec_pubkey_serialize(data.ctx, data.pubkey, &data.pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED) == 1);\n\n    run_benchmark(\"ecdsa_verify\", benchmark_verify, NULL, NULL, &data, 10, 20000);\n#ifdef ENABLE_OPENSSL_TESTS\n    data.ec_group = EC_GROUP_new_by_curve_name(NID_secp256k1);\n    run_benchmark(\"ecdsa_verify_openssl\", benchmark_verify_openssl, NULL, NULL, &data, 10, 20000);\n    EC_GROUP_free(data.ec_group);\n#endif\n\n    secp256k1_context_destroy(data.ctx);\n    return 0;\n}\n"
  },
  {
    "path": "src/secp256k1/src/ecdsa.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_ECDSA_H\n#define SECP256K1_ECDSA_H\n\n#include <stddef.h>\n\n#include \"scalar.h\"\n#include \"group.h\"\n#include \"ecmult.h\"\n\nstatic int secp256k1_ecdsa_sig_parse(secp256k1_scalar *r, secp256k1_scalar *s, const unsigned char *sig, size_t size);\nstatic int secp256k1_ecdsa_sig_serialize(unsigned char *sig, size_t *size, const secp256k1_scalar *r, const secp256k1_scalar *s);\nstatic int secp256k1_ecdsa_sig_verify(const secp256k1_ecmult_context *ctx, const secp256k1_scalar* r, const secp256k1_scalar* s, const secp256k1_ge *pubkey, const secp256k1_scalar *message);\nstatic int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar* r, secp256k1_scalar* s, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid);\n\n#endif /* SECP256K1_ECDSA_H */\n"
  },
  {
    "path": "src/secp256k1/src/ecdsa_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013-2015 Pieter Wuille                              *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n\n#ifndef SECP256K1_ECDSA_IMPL_H\n#define SECP256K1_ECDSA_IMPL_H\n\n#include \"scalar.h\"\n#include \"field.h\"\n#include \"group.h\"\n#include \"ecmult.h\"\n#include \"ecmult_gen.h\"\n#include \"ecdsa.h\"\n\n/** Group order for secp256k1 defined as 'n' in \"Standards for Efficient Cryptography\" (SEC2) 2.7.1\n *  sage: for t in xrange(1023, -1, -1):\n *     ..   p = 2**256 - 2**32 - t\n *     ..   if p.is_prime():\n *     ..     print '%x'%p\n *     ..     break\n *   'fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f'\n *  sage: a = 0\n *  sage: b = 7\n *  sage: F = FiniteField (p)\n *  sage: '%x' % (EllipticCurve ([F (a), F (b)]).order())\n *   'fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141'\n */\nstatic const secp256k1_fe secp256k1_ecdsa_const_order_as_fe = SECP256K1_FE_CONST(\n    0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFEUL,\n    0xBAAEDCE6UL, 0xAF48A03BUL, 0xBFD25E8CUL, 0xD0364141UL\n);\n\n/** Difference between field and order, values 'p' and 'n' values defined in\n *  \"Standards for Efficient Cryptography\" (SEC2) 2.7.1.\n *  sage: p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F\n *  sage: a = 0\n *  sage: b = 7\n *  sage: F = FiniteField (p)\n *  sage: '%x' % (p - EllipticCurve ([F (a), F (b)]).order())\n *   '14551231950b75fc4402da1722fc9baee'\n */\nstatic const secp256k1_fe secp256k1_ecdsa_const_p_minus_order = SECP256K1_FE_CONST(\n    0, 0, 0, 1, 0x45512319UL, 0x50B75FC4UL, 0x402DA172UL, 0x2FC9BAEEUL\n);\n\nstatic int secp256k1_der_read_len(const unsigned char **sigp, const unsigned char *sigend) {\n    int lenleft, b1;\n    size_t ret = 0;\n    if (*sigp >= sigend) {\n        return -1;\n    }\n    b1 = *((*sigp)++);\n    if (b1 == 0xFF) {\n        /* X.690-0207 8.1.3.5.c the value 0xFF shall not be used. */\n        return -1;\n    }\n    if ((b1 & 0x80) == 0) {\n        /* X.690-0207 8.1.3.4 short form length octets */\n        return b1;\n    }\n    if (b1 == 0x80) {\n        /* Indefinite length is not allowed in DER. */\n        return -1;\n    }\n    /* X.690-207 8.1.3.5 long form length octets */\n    lenleft = b1 & 0x7F;\n    if (lenleft > sigend - *sigp) {\n        return -1;\n    }\n    if (**sigp == 0) {\n        /* Not the shortest possible length encoding. */\n        return -1;\n    }\n    if ((size_t)lenleft > sizeof(size_t)) {\n        /* The resulting length would exceed the range of a size_t, so\n         * certainly longer than the passed array size.\n         */\n        return -1;\n    }\n    while (lenleft > 0) {\n        ret = (ret << 8) | **sigp;\n        if (ret + lenleft > (size_t)(sigend - *sigp)) {\n            /* Result exceeds the length of the passed array. */\n            return -1;\n        }\n        (*sigp)++;\n        lenleft--;\n    }\n    if (ret < 128) {\n        /* Not the shortest possible length encoding. */\n        return -1;\n    }\n    return ret;\n}\n\nstatic int secp256k1_der_parse_integer(secp256k1_scalar *r, const unsigned char **sig, const unsigned char *sigend) {\n    int overflow = 0;\n    unsigned char ra[32] = {0};\n    int rlen;\n\n    if (*sig == sigend || **sig != 0x02) {\n        /* Not a primitive integer (X.690-0207 8.3.1). */\n        return 0;\n    }\n    (*sig)++;\n    rlen = secp256k1_der_read_len(sig, sigend);\n    if (rlen <= 0 || (*sig) + rlen > sigend) {\n        /* Exceeds bounds or not at least length 1 (X.690-0207 8.3.1).  */\n        return 0;\n    }\n    if (**sig == 0x00 && rlen > 1 && (((*sig)[1]) & 0x80) == 0x00) {\n        /* Excessive 0x00 padding. */\n        return 0;\n    }\n    if (**sig == 0xFF && rlen > 1 && (((*sig)[1]) & 0x80) == 0x80) {\n        /* Excessive 0xFF padding. */\n        return 0;\n    }\n    if ((**sig & 0x80) == 0x80) {\n        /* Negative. */\n        overflow = 1;\n    }\n    while (rlen > 0 && **sig == 0) {\n        /* Skip leading zero bytes */\n        rlen--;\n        (*sig)++;\n    }\n    if (rlen > 32) {\n        overflow = 1;\n    }\n    if (!overflow) {\n        memcpy(ra + 32 - rlen, *sig, rlen);\n        secp256k1_scalar_set_b32(r, ra, &overflow);\n    }\n    if (overflow) {\n        secp256k1_scalar_set_int(r, 0);\n    }\n    (*sig) += rlen;\n    return 1;\n}\n\nstatic int secp256k1_ecdsa_sig_parse(secp256k1_scalar *rr, secp256k1_scalar *rs, const unsigned char *sig, size_t size) {\n    const unsigned char *sigend = sig + size;\n    int rlen;\n    if (sig == sigend || *(sig++) != 0x30) {\n        /* The encoding doesn't start with a constructed sequence (X.690-0207 8.9.1). */\n        return 0;\n    }\n    rlen = secp256k1_der_read_len(&sig, sigend);\n    if (rlen < 0 || sig + rlen > sigend) {\n        /* Tuple exceeds bounds */\n        return 0;\n    }\n    if (sig + rlen != sigend) {\n        /* Garbage after tuple. */\n        return 0;\n    }\n\n    if (!secp256k1_der_parse_integer(rr, &sig, sigend)) {\n        return 0;\n    }\n    if (!secp256k1_der_parse_integer(rs, &sig, sigend)) {\n        return 0;\n    }\n\n    if (sig != sigend) {\n        /* Trailing garbage inside tuple. */\n        return 0;\n    }\n\n    return 1;\n}\n\nstatic int secp256k1_ecdsa_sig_serialize(unsigned char *sig, size_t *size, const secp256k1_scalar* ar, const secp256k1_scalar* as) {\n    unsigned char r[33] = {0}, s[33] = {0};\n    unsigned char *rp = r, *sp = s;\n    size_t lenR = 33, lenS = 33;\n    secp256k1_scalar_get_b32(&r[1], ar);\n    secp256k1_scalar_get_b32(&s[1], as);\n    while (lenR > 1 && rp[0] == 0 && rp[1] < 0x80) { lenR--; rp++; }\n    while (lenS > 1 && sp[0] == 0 && sp[1] < 0x80) { lenS--; sp++; }\n    if (*size < 6+lenS+lenR) {\n        *size = 6 + lenS + lenR;\n        return 0;\n    }\n    *size = 6 + lenS + lenR;\n    sig[0] = 0x30;\n    sig[1] = 4 + lenS + lenR;\n    sig[2] = 0x02;\n    sig[3] = lenR;\n    memcpy(sig+4, rp, lenR);\n    sig[4+lenR] = 0x02;\n    sig[5+lenR] = lenS;\n    memcpy(sig+lenR+6, sp, lenS);\n    return 1;\n}\n\nstatic int secp256k1_ecdsa_sig_verify(const secp256k1_ecmult_context *ctx, const secp256k1_scalar *sigr, const secp256k1_scalar *sigs, const secp256k1_ge *pubkey, const secp256k1_scalar *message) {\n    unsigned char c[32];\n    secp256k1_scalar sn, u1, u2;\n#if !defined(EXHAUSTIVE_TEST_ORDER)\n    secp256k1_fe xr;\n#endif\n    secp256k1_gej pubkeyj;\n    secp256k1_gej pr;\n\n    if (secp256k1_scalar_is_zero(sigr) || secp256k1_scalar_is_zero(sigs)) {\n        return 0;\n    }\n\n    secp256k1_scalar_inverse_var(&sn, sigs);\n    secp256k1_scalar_mul(&u1, &sn, message);\n    secp256k1_scalar_mul(&u2, &sn, sigr);\n    secp256k1_gej_set_ge(&pubkeyj, pubkey);\n    secp256k1_ecmult(ctx, &pr, &pubkeyj, &u2, &u1);\n    if (secp256k1_gej_is_infinity(&pr)) {\n        return 0;\n    }\n\n#if defined(EXHAUSTIVE_TEST_ORDER)\n{\n    secp256k1_scalar computed_r;\n    secp256k1_ge pr_ge;\n    secp256k1_ge_set_gej(&pr_ge, &pr);\n    secp256k1_fe_normalize(&pr_ge.x);\n\n    secp256k1_fe_get_b32(c, &pr_ge.x);\n    secp256k1_scalar_set_b32(&computed_r, c, NULL);\n    return secp256k1_scalar_eq(sigr, &computed_r);\n}\n#else\n    secp256k1_scalar_get_b32(c, sigr);\n    secp256k1_fe_set_b32(&xr, c);\n\n    /** We now have the recomputed R point in pr, and its claimed x coordinate (modulo n)\n     *  in xr. Naively, we would extract the x coordinate from pr (requiring a inversion modulo p),\n     *  compute the remainder modulo n, and compare it to xr. However:\n     *\n     *        xr == X(pr) mod n\n     *    <=> exists h. (xr + h * n < p && xr + h * n == X(pr))\n     *    [Since 2 * n > p, h can only be 0 or 1]\n     *    <=> (xr == X(pr)) || (xr + n < p && xr + n == X(pr))\n     *    [In Jacobian coordinates, X(pr) is pr.x / pr.z^2 mod p]\n     *    <=> (xr == pr.x / pr.z^2 mod p) || (xr + n < p && xr + n == pr.x / pr.z^2 mod p)\n     *    [Multiplying both sides of the equations by pr.z^2 mod p]\n     *    <=> (xr * pr.z^2 mod p == pr.x) || (xr + n < p && (xr + n) * pr.z^2 mod p == pr.x)\n     *\n     *  Thus, we can avoid the inversion, but we have to check both cases separately.\n     *  secp256k1_gej_eq_x implements the (xr * pr.z^2 mod p == pr.x) test.\n     */\n    if (secp256k1_gej_eq_x_var(&xr, &pr)) {\n        /* xr * pr.z^2 mod p == pr.x, so the signature is valid. */\n        return 1;\n    }\n    if (secp256k1_fe_cmp_var(&xr, &secp256k1_ecdsa_const_p_minus_order) >= 0) {\n        /* xr + n >= p, so we can skip testing the second case. */\n        return 0;\n    }\n    secp256k1_fe_add(&xr, &secp256k1_ecdsa_const_order_as_fe);\n    if (secp256k1_gej_eq_x_var(&xr, &pr)) {\n        /* (xr + n) * pr.z^2 mod p == pr.x, so the signature is valid. */\n        return 1;\n    }\n    return 0;\n#endif\n}\n\nstatic int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar *sigr, secp256k1_scalar *sigs, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid) {\n    unsigned char b[32];\n    secp256k1_gej rp;\n    secp256k1_ge r;\n    secp256k1_scalar n;\n    int overflow = 0;\n\n    secp256k1_ecmult_gen(ctx, &rp, nonce);\n    secp256k1_ge_set_gej(&r, &rp);\n    secp256k1_fe_normalize(&r.x);\n    secp256k1_fe_normalize(&r.y);\n    secp256k1_fe_get_b32(b, &r.x);\n    secp256k1_scalar_set_b32(sigr, b, &overflow);\n    /* These two conditions should be checked before calling */\n    VERIFY_CHECK(!secp256k1_scalar_is_zero(sigr));\n    VERIFY_CHECK(overflow == 0);\n\n    if (recid) {\n        /* The overflow condition is cryptographically unreachable as hitting it requires finding the discrete log\n         * of some P where P.x >= order, and only 1 in about 2^127 points meet this criteria.\n         */\n        *recid = (overflow ? 2 : 0) | (secp256k1_fe_is_odd(&r.y) ? 1 : 0);\n    }\n    secp256k1_scalar_mul(&n, sigr, seckey);\n    secp256k1_scalar_add(&n, &n, message);\n    secp256k1_scalar_inverse(sigs, nonce);\n    secp256k1_scalar_mul(sigs, sigs, &n);\n    secp256k1_scalar_clear(&n);\n    secp256k1_gej_clear(&rp);\n    secp256k1_ge_clear(&r);\n    if (secp256k1_scalar_is_zero(sigs)) {\n        return 0;\n    }\n    if (secp256k1_scalar_is_high(sigs)) {\n        secp256k1_scalar_negate(sigs, sigs);\n        if (recid) {\n            *recid ^= 1;\n        }\n    }\n    return 1;\n}\n\n#endif /* SECP256K1_ECDSA_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/eckey.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_ECKEY_H\n#define SECP256K1_ECKEY_H\n\n#include <stddef.h>\n\n#include \"group.h\"\n#include \"scalar.h\"\n#include \"ecmult.h\"\n#include \"ecmult_gen.h\"\n\nstatic int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char *pub, size_t size);\nstatic int secp256k1_eckey_pubkey_serialize(secp256k1_ge *elem, unsigned char *pub, size_t *size, int compressed);\n\nstatic int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak);\nstatic int secp256k1_eckey_pubkey_tweak_add(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak);\nstatic int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak);\nstatic int secp256k1_eckey_pubkey_tweak_mul(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak);\n\n#endif /* SECP256K1_ECKEY_H */\n"
  },
  {
    "path": "src/secp256k1/src/eckey_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_ECKEY_IMPL_H\n#define SECP256K1_ECKEY_IMPL_H\n\n#include \"eckey.h\"\n\n#include \"scalar.h\"\n#include \"field.h\"\n#include \"group.h\"\n#include \"ecmult_gen.h\"\n\nstatic int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char *pub, size_t size) {\n    if (size == 33 && (pub[0] == SECP256K1_TAG_PUBKEY_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_ODD)) {\n        secp256k1_fe x;\n        return secp256k1_fe_set_b32(&x, pub+1) && secp256k1_ge_set_xo_var(elem, &x, pub[0] == SECP256K1_TAG_PUBKEY_ODD);\n    } else if (size == 65 && (pub[0] == 0x04 || pub[0] == 0x06 || pub[0] == 0x07)) {\n        secp256k1_fe x, y;\n        if (!secp256k1_fe_set_b32(&x, pub+1) || !secp256k1_fe_set_b32(&y, pub+33)) {\n            return 0;\n        }\n        secp256k1_ge_set_xy(elem, &x, &y);\n        if ((pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD) &&\n            secp256k1_fe_is_odd(&y) != (pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) {\n            return 0;\n        }\n        return secp256k1_ge_is_valid_var(elem);\n    } else {\n        return 0;\n    }\n}\n\nstatic int secp256k1_eckey_pubkey_serialize(secp256k1_ge *elem, unsigned char *pub, size_t *size, int compressed) {\n    if (secp256k1_ge_is_infinity(elem)) {\n        return 0;\n    }\n    secp256k1_fe_normalize_var(&elem->x);\n    secp256k1_fe_normalize_var(&elem->y);\n    secp256k1_fe_get_b32(&pub[1], &elem->x);\n    if (compressed) {\n        *size = 33;\n        pub[0] = secp256k1_fe_is_odd(&elem->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;\n    } else {\n        *size = 65;\n        pub[0] = SECP256K1_TAG_PUBKEY_UNCOMPRESSED;\n        secp256k1_fe_get_b32(&pub[33], &elem->y);\n    }\n    return 1;\n}\n\nstatic int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak) {\n    secp256k1_scalar_add(key, key, tweak);\n    if (secp256k1_scalar_is_zero(key)) {\n        return 0;\n    }\n    return 1;\n}\n\nstatic int secp256k1_eckey_pubkey_tweak_add(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak) {\n    secp256k1_gej pt;\n    secp256k1_scalar one;\n    secp256k1_gej_set_ge(&pt, key);\n    secp256k1_scalar_set_int(&one, 1);\n    secp256k1_ecmult(ctx, &pt, &pt, &one, tweak);\n\n    if (secp256k1_gej_is_infinity(&pt)) {\n        return 0;\n    }\n    secp256k1_ge_set_gej(key, &pt);\n    return 1;\n}\n\nstatic int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak) {\n    if (secp256k1_scalar_is_zero(tweak)) {\n        return 0;\n    }\n\n    secp256k1_scalar_mul(key, key, tweak);\n    return 1;\n}\n\nstatic int secp256k1_eckey_pubkey_tweak_mul(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak) {\n    secp256k1_scalar zero;\n    secp256k1_gej pt;\n    if (secp256k1_scalar_is_zero(tweak)) {\n        return 0;\n    }\n\n    secp256k1_scalar_set_int(&zero, 0);\n    secp256k1_gej_set_ge(&pt, key);\n    secp256k1_ecmult(ctx, &pt, &pt, tweak, &zero);\n    secp256k1_ge_set_gej(key, &pt);\n    return 1;\n}\n\n#endif /* SECP256K1_ECKEY_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/ecmult.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_ECMULT_H\n#define SECP256K1_ECMULT_H\n\n#include \"num.h\"\n#include \"group.h\"\n\ntypedef struct {\n    /* For accelerating the computation of a*P + b*G: */\n    secp256k1_ge_storage (*pre_g)[];    /* odd multiples of the generator */\n#ifdef USE_ENDOMORPHISM\n    secp256k1_ge_storage (*pre_g_128)[]; /* odd multiples of 2^128*generator */\n#endif\n} secp256k1_ecmult_context;\n\nstatic void secp256k1_ecmult_context_init(secp256k1_ecmult_context *ctx);\nstatic void secp256k1_ecmult_context_build(secp256k1_ecmult_context *ctx, const secp256k1_callback *cb);\nstatic void secp256k1_ecmult_context_clone(secp256k1_ecmult_context *dst,\n                                           const secp256k1_ecmult_context *src, const secp256k1_callback *cb);\nstatic void secp256k1_ecmult_context_clear(secp256k1_ecmult_context *ctx);\nstatic int secp256k1_ecmult_context_is_built(const secp256k1_ecmult_context *ctx);\n\n/** Double multiply: R = na*A + ng*G */\nstatic void secp256k1_ecmult(const secp256k1_ecmult_context *ctx, secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng);\n\n#endif /* SECP256K1_ECMULT_H */\n"
  },
  {
    "path": "src/secp256k1/src/ecmult_const.h",
    "content": "/**********************************************************************\n * Copyright (c) 2015 Andrew Poelstra                                 *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_ECMULT_CONST_H\n#define SECP256K1_ECMULT_CONST_H\n\n#include \"scalar.h\"\n#include \"group.h\"\n\nstatic void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q);\n\n#endif /* SECP256K1_ECMULT_CONST_H */\n"
  },
  {
    "path": "src/secp256k1/src/ecmult_const_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2015 Pieter Wuille, Andrew Poelstra                  *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_ECMULT_CONST_IMPL_H\n#define SECP256K1_ECMULT_CONST_IMPL_H\n\n#include \"scalar.h\"\n#include \"group.h\"\n#include \"ecmult_const.h\"\n#include \"ecmult_impl.h\"\n\n#ifdef USE_ENDOMORPHISM\n    #define WNAF_BITS 128\n#else\n    #define WNAF_BITS 256\n#endif\n#define WNAF_SIZE(w) ((WNAF_BITS + (w) - 1) / (w))\n\n/* This is like `ECMULT_TABLE_GET_GE` but is constant time */\n#define ECMULT_CONST_TABLE_GET_GE(r,pre,n,w) do { \\\n    int m; \\\n    int abs_n = (n) * (((n) > 0) * 2 - 1); \\\n    int idx_n = abs_n / 2; \\\n    secp256k1_fe neg_y; \\\n    VERIFY_CHECK(((n) & 1) == 1); \\\n    VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1)); \\\n    VERIFY_CHECK((n) <=  ((1 << ((w)-1)) - 1)); \\\n    VERIFY_SETUP(secp256k1_fe_clear(&(r)->x)); \\\n    VERIFY_SETUP(secp256k1_fe_clear(&(r)->y)); \\\n    for (m = 0; m < ECMULT_TABLE_SIZE(w); m++) { \\\n        /* This loop is used to avoid secret data in array indices. See\n         * the comment in ecmult_gen_impl.h for rationale. */ \\\n        secp256k1_fe_cmov(&(r)->x, &(pre)[m].x, m == idx_n); \\\n        secp256k1_fe_cmov(&(r)->y, &(pre)[m].y, m == idx_n); \\\n    } \\\n    (r)->infinity = 0; \\\n    secp256k1_fe_negate(&neg_y, &(r)->y, 1); \\\n    secp256k1_fe_cmov(&(r)->y, &neg_y, (n) != abs_n); \\\n} while(0)\n\n\n/** Convert a number to WNAF notation.\n *  The number becomes represented by sum(2^{wi} * wnaf[i], i=0..WNAF_SIZE(w)+1) - return_val.\n *  It has the following guarantees:\n *  - each wnaf[i] an odd integer between -(1 << w) and (1 << w)\n *  - each wnaf[i] is nonzero\n *  - the number of words set is always WNAF_SIZE(w) + 1\n *\n *  Adapted from `The Width-w NAF Method Provides Small Memory and Fast Elliptic Scalar\n *  Multiplications Secure against Side Channel Attacks`, Okeya and Tagaki. M. Joye (Ed.)\n *  CT-RSA 2003, LNCS 2612, pp. 328-443, 2003. Springer-Verlagy Berlin Heidelberg 2003\n *\n *  Numbers reference steps of `Algorithm SPA-resistant Width-w NAF with Odd Scalar` on pp. 335\n */\nstatic int secp256k1_wnaf_const(int *wnaf, secp256k1_scalar s, int w) {\n    int global_sign;\n    int skew = 0;\n    int word = 0;\n\n    /* 1 2 3 */\n    int u_last;\n    int u;\n\n    int flip;\n    int bit;\n    secp256k1_scalar neg_s;\n    int not_neg_one;\n    /* Note that we cannot handle even numbers by negating them to be odd, as is\n     * done in other implementations, since if our scalars were specified to have\n     * width < 256 for performance reasons, their negations would have width 256\n     * and we'd lose any performance benefit. Instead, we use a technique from\n     * Section 4.2 of the Okeya/Tagaki paper, which is to add either 1 (for even)\n     * or 2 (for odd) to the number we are encoding, returning a skew value indicating\n     * this, and having the caller compensate after doing the multiplication. */\n\n    /* Negative numbers will be negated to keep their bit representation below the maximum width */\n    flip = secp256k1_scalar_is_high(&s);\n    /* We add 1 to even numbers, 2 to odd ones, noting that negation flips parity */\n    bit = flip ^ !secp256k1_scalar_is_even(&s);\n    /* We check for negative one, since adding 2 to it will cause an overflow */\n    secp256k1_scalar_negate(&neg_s, &s);\n    not_neg_one = !secp256k1_scalar_is_one(&neg_s);\n    secp256k1_scalar_cadd_bit(&s, bit, not_neg_one);\n    /* If we had negative one, flip == 1, s.d[0] == 0, bit == 1, so caller expects\n     * that we added two to it and flipped it. In fact for -1 these operations are\n     * identical. We only flipped, but since skewing is required (in the sense that\n     * the skew must be 1 or 2, never zero) and flipping is not, we need to change\n     * our flags to claim that we only skewed. */\n    global_sign = secp256k1_scalar_cond_negate(&s, flip);\n    global_sign *= not_neg_one * 2 - 1;\n    skew = 1 << bit;\n\n    /* 4 */\n    u_last = secp256k1_scalar_shr_int(&s, w);\n    while (word * w < WNAF_BITS) {\n        int sign;\n        int even;\n\n        /* 4.1 4.4 */\n        u = secp256k1_scalar_shr_int(&s, w);\n        /* 4.2 */\n        even = ((u & 1) == 0);\n        sign = 2 * (u_last > 0) - 1;\n        u += sign * even;\n        u_last -= sign * even * (1 << w);\n\n        /* 4.3, adapted for global sign change */\n        wnaf[word++] = u_last * global_sign;\n\n        u_last = u;\n    }\n    wnaf[word] = u * global_sign;\n\n    VERIFY_CHECK(secp256k1_scalar_is_zero(&s));\n    VERIFY_CHECK(word == WNAF_SIZE(w));\n    return skew;\n}\n\n\nstatic void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *scalar) {\n    secp256k1_ge pre_a[ECMULT_TABLE_SIZE(WINDOW_A)];\n    secp256k1_ge tmpa;\n    secp256k1_fe Z;\n\n    int skew_1;\n    int wnaf_1[1 + WNAF_SIZE(WINDOW_A - 1)];\n#ifdef USE_ENDOMORPHISM\n    secp256k1_ge pre_a_lam[ECMULT_TABLE_SIZE(WINDOW_A)];\n    int wnaf_lam[1 + WNAF_SIZE(WINDOW_A - 1)];\n    int skew_lam;\n    secp256k1_scalar q_1, q_lam;\n#endif\n\n    int i;\n    secp256k1_scalar sc = *scalar;\n\n    /* build wnaf representation for q. */\n#ifdef USE_ENDOMORPHISM\n    /* split q into q_1 and q_lam (where q = q_1 + q_lam*lambda, and q_1 and q_lam are ~128 bit) */\n    secp256k1_scalar_split_lambda(&q_1, &q_lam, &sc);\n    skew_1   = secp256k1_wnaf_const(wnaf_1,   q_1,   WINDOW_A - 1);\n    skew_lam = secp256k1_wnaf_const(wnaf_lam, q_lam, WINDOW_A - 1);\n#else\n    skew_1   = secp256k1_wnaf_const(wnaf_1, sc, WINDOW_A - 1);\n#endif\n\n    /* Calculate odd multiples of a.\n     * All multiples are brought to the same Z 'denominator', which is stored\n     * in Z. Due to secp256k1' isomorphism we can do all operations pretending\n     * that the Z coordinate was 1, use affine addition formulae, and correct\n     * the Z coordinate of the result once at the end.\n     */\n    secp256k1_gej_set_ge(r, a);\n    secp256k1_ecmult_odd_multiples_table_globalz_windowa(pre_a, &Z, r);\n    for (i = 0; i < ECMULT_TABLE_SIZE(WINDOW_A); i++) {\n        secp256k1_fe_normalize_weak(&pre_a[i].y);\n    }\n#ifdef USE_ENDOMORPHISM\n    for (i = 0; i < ECMULT_TABLE_SIZE(WINDOW_A); i++) {\n        secp256k1_ge_mul_lambda(&pre_a_lam[i], &pre_a[i]);\n    }\n#endif\n\n    /* first loop iteration (separated out so we can directly set r, rather\n     * than having it start at infinity, get doubled several times, then have\n     * its new value added to it) */\n    i = wnaf_1[WNAF_SIZE(WINDOW_A - 1)];\n    VERIFY_CHECK(i != 0);\n    ECMULT_CONST_TABLE_GET_GE(&tmpa, pre_a, i, WINDOW_A);\n    secp256k1_gej_set_ge(r, &tmpa);\n#ifdef USE_ENDOMORPHISM\n    i = wnaf_lam[WNAF_SIZE(WINDOW_A - 1)];\n    VERIFY_CHECK(i != 0);\n    ECMULT_CONST_TABLE_GET_GE(&tmpa, pre_a_lam, i, WINDOW_A);\n    secp256k1_gej_add_ge(r, r, &tmpa);\n#endif\n    /* remaining loop iterations */\n    for (i = WNAF_SIZE(WINDOW_A - 1) - 1; i >= 0; i--) {\n        int n;\n        int j;\n        for (j = 0; j < WINDOW_A - 1; ++j) {\n            secp256k1_gej_double_nonzero(r, r, NULL);\n        }\n\n        n = wnaf_1[i];\n        ECMULT_CONST_TABLE_GET_GE(&tmpa, pre_a, n, WINDOW_A);\n        VERIFY_CHECK(n != 0);\n        secp256k1_gej_add_ge(r, r, &tmpa);\n#ifdef USE_ENDOMORPHISM\n        n = wnaf_lam[i];\n        ECMULT_CONST_TABLE_GET_GE(&tmpa, pre_a_lam, n, WINDOW_A);\n        VERIFY_CHECK(n != 0);\n        secp256k1_gej_add_ge(r, r, &tmpa);\n#endif\n    }\n\n    secp256k1_fe_mul(&r->z, &r->z, &Z);\n\n    {\n        /* Correct for wNAF skew */\n        secp256k1_ge correction = *a;\n        secp256k1_ge_storage correction_1_stor;\n#ifdef USE_ENDOMORPHISM\n        secp256k1_ge_storage correction_lam_stor;\n#endif\n        secp256k1_ge_storage a2_stor;\n        secp256k1_gej tmpj;\n        secp256k1_gej_set_ge(&tmpj, &correction);\n        secp256k1_gej_double_var(&tmpj, &tmpj, NULL);\n        secp256k1_ge_set_gej(&correction, &tmpj);\n        secp256k1_ge_to_storage(&correction_1_stor, a);\n#ifdef USE_ENDOMORPHISM\n        secp256k1_ge_to_storage(&correction_lam_stor, a);\n#endif\n        secp256k1_ge_to_storage(&a2_stor, &correction);\n\n        /* For odd numbers this is 2a (so replace it), for even ones a (so no-op) */\n        secp256k1_ge_storage_cmov(&correction_1_stor, &a2_stor, skew_1 == 2);\n#ifdef USE_ENDOMORPHISM\n        secp256k1_ge_storage_cmov(&correction_lam_stor, &a2_stor, skew_lam == 2);\n#endif\n\n        /* Apply the correction */\n        secp256k1_ge_from_storage(&correction, &correction_1_stor);\n        secp256k1_ge_neg(&correction, &correction);\n        secp256k1_gej_add_ge(r, r, &correction);\n\n#ifdef USE_ENDOMORPHISM\n        secp256k1_ge_from_storage(&correction, &correction_lam_stor);\n        secp256k1_ge_neg(&correction, &correction);\n        secp256k1_ge_mul_lambda(&correction, &correction);\n        secp256k1_gej_add_ge(r, r, &correction);\n#endif\n    }\n}\n\n#endif /* SECP256K1_ECMULT_CONST_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/ecmult_gen.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_ECMULT_GEN_H\n#define SECP256K1_ECMULT_GEN_H\n\n#include \"scalar.h\"\n#include \"group.h\"\n\ntypedef struct {\n    /* For accelerating the computation of a*G:\n     * To harden against timing attacks, use the following mechanism:\n     * * Break up the multiplicand into groups of 4 bits, called n_0, n_1, n_2, ..., n_63.\n     * * Compute sum(n_i * 16^i * G + U_i, i=0..63), where:\n     *   * U_i = U * 2^i (for i=0..62)\n     *   * U_i = U * (1-2^63) (for i=63)\n     *   where U is a point with no known corresponding scalar. Note that sum(U_i, i=0..63) = 0.\n     * For each i, and each of the 16 possible values of n_i, (n_i * 16^i * G + U_i) is\n     * precomputed (call it prec(i, n_i)). The formula now becomes sum(prec(i, n_i), i=0..63).\n     * None of the resulting prec group elements have a known scalar, and neither do any of\n     * the intermediate sums while computing a*G.\n     */\n    secp256k1_ge_storage (*prec)[64][16]; /* prec[j][i] = 16^j * i * G + U_i */\n    secp256k1_scalar blind;\n    secp256k1_gej initial;\n} secp256k1_ecmult_gen_context;\n\nstatic void secp256k1_ecmult_gen_context_init(secp256k1_ecmult_gen_context* ctx);\nstatic void secp256k1_ecmult_gen_context_build(secp256k1_ecmult_gen_context* ctx, const secp256k1_callback* cb);\nstatic void secp256k1_ecmult_gen_context_clone(secp256k1_ecmult_gen_context *dst,\n                                               const secp256k1_ecmult_gen_context* src, const secp256k1_callback* cb);\nstatic void secp256k1_ecmult_gen_context_clear(secp256k1_ecmult_gen_context* ctx);\nstatic int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context* ctx);\n\n/** Multiply with the generator: R = a*G */\nstatic void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context* ctx, secp256k1_gej *r, const secp256k1_scalar *a);\n\nstatic void secp256k1_ecmult_gen_blind(secp256k1_ecmult_gen_context *ctx, const unsigned char *seed32);\n\n#endif /* SECP256K1_ECMULT_GEN_H */\n"
  },
  {
    "path": "src/secp256k1/src/ecmult_gen_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014, 2015 Pieter Wuille, Gregory Maxwell      *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_ECMULT_GEN_IMPL_H\n#define SECP256K1_ECMULT_GEN_IMPL_H\n\n#include \"scalar.h\"\n#include \"group.h\"\n#include \"ecmult_gen.h\"\n#include \"hash_impl.h\"\n#ifdef USE_ECMULT_STATIC_PRECOMPUTATION\n#include \"ecmult_static_context.h\"\n#endif\nstatic void secp256k1_ecmult_gen_context_init(secp256k1_ecmult_gen_context *ctx) {\n    ctx->prec = NULL;\n}\n\nstatic void secp256k1_ecmult_gen_context_build(secp256k1_ecmult_gen_context *ctx, const secp256k1_callback* cb) {\n#ifndef USE_ECMULT_STATIC_PRECOMPUTATION\n    secp256k1_ge prec[1024];\n    secp256k1_gej gj;\n    secp256k1_gej nums_gej;\n    int i, j;\n#endif\n\n    if (ctx->prec != NULL) {\n        return;\n    }\n#ifndef USE_ECMULT_STATIC_PRECOMPUTATION\n    ctx->prec = (secp256k1_ge_storage (*)[64][16])checked_malloc(cb, sizeof(*ctx->prec));\n\n    /* get the generator */\n    secp256k1_gej_set_ge(&gj, &secp256k1_ge_const_g);\n\n    /* Construct a group element with no known corresponding scalar (nothing up my sleeve). */\n    {\n        static const unsigned char nums_b32[33] = \"The scalar for this x is unknown\";\n        secp256k1_fe nums_x;\n        secp256k1_ge nums_ge;\n        int r;\n        r = secp256k1_fe_set_b32(&nums_x, nums_b32);\n        (void)r;\n        VERIFY_CHECK(r);\n        r = secp256k1_ge_set_xo_var(&nums_ge, &nums_x, 0);\n        (void)r;\n        VERIFY_CHECK(r);\n        secp256k1_gej_set_ge(&nums_gej, &nums_ge);\n        /* Add G to make the bits in x uniformly distributed. */\n        secp256k1_gej_add_ge_var(&nums_gej, &nums_gej, &secp256k1_ge_const_g, NULL);\n    }\n\n    /* compute prec. */\n    {\n        secp256k1_gej precj[1024]; /* Jacobian versions of prec. */\n        secp256k1_gej gbase;\n        secp256k1_gej numsbase;\n        gbase = gj; /* 16^j * G */\n        numsbase = nums_gej; /* 2^j * nums. */\n        for (j = 0; j < 64; j++) {\n            /* Set precj[j*16 .. j*16+15] to (numsbase, numsbase + gbase, ..., numsbase + 15*gbase). */\n            precj[j*16] = numsbase;\n            for (i = 1; i < 16; i++) {\n                secp256k1_gej_add_var(&precj[j*16 + i], &precj[j*16 + i - 1], &gbase, NULL);\n            }\n            /* Multiply gbase by 16. */\n            for (i = 0; i < 4; i++) {\n                secp256k1_gej_double_var(&gbase, &gbase, NULL);\n            }\n            /* Multiply numbase by 2. */\n            secp256k1_gej_double_var(&numsbase, &numsbase, NULL);\n            if (j == 62) {\n                /* In the last iteration, numsbase is (1 - 2^j) * nums instead. */\n                secp256k1_gej_neg(&numsbase, &numsbase);\n                secp256k1_gej_add_var(&numsbase, &numsbase, &nums_gej, NULL);\n            }\n        }\n        secp256k1_ge_set_all_gej_var(prec, precj, 1024, cb);\n    }\n    for (j = 0; j < 64; j++) {\n        for (i = 0; i < 16; i++) {\n            secp256k1_ge_to_storage(&(*ctx->prec)[j][i], &prec[j*16 + i]);\n        }\n    }\n#else\n    (void)cb;\n    ctx->prec = (secp256k1_ge_storage (*)[64][16])secp256k1_ecmult_static_context;\n#endif\n    secp256k1_ecmult_gen_blind(ctx, NULL);\n}\n\nstatic int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context* ctx) {\n    return ctx->prec != NULL;\n}\n\nstatic void secp256k1_ecmult_gen_context_clone(secp256k1_ecmult_gen_context *dst,\n                                               const secp256k1_ecmult_gen_context *src, const secp256k1_callback* cb) {\n    if (src->prec == NULL) {\n        dst->prec = NULL;\n    } else {\n#ifndef USE_ECMULT_STATIC_PRECOMPUTATION\n        dst->prec = (secp256k1_ge_storage (*)[64][16])checked_malloc(cb, sizeof(*dst->prec));\n        memcpy(dst->prec, src->prec, sizeof(*dst->prec));\n#else\n        (void)cb;\n        dst->prec = src->prec;\n#endif\n        dst->initial = src->initial;\n        dst->blind = src->blind;\n    }\n}\n\nstatic void secp256k1_ecmult_gen_context_clear(secp256k1_ecmult_gen_context *ctx) {\n#ifndef USE_ECMULT_STATIC_PRECOMPUTATION\n    free(ctx->prec);\n#endif\n    secp256k1_scalar_clear(&ctx->blind);\n    secp256k1_gej_clear(&ctx->initial);\n    ctx->prec = NULL;\n}\n\nstatic void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *gn) {\n    secp256k1_ge add;\n    secp256k1_ge_storage adds;\n    secp256k1_scalar gnb;\n    int bits;\n    int i, j;\n    memset(&adds, 0, sizeof(adds));\n    *r = ctx->initial;\n    /* Blind scalar/point multiplication by computing (n-b)G + bG instead of nG. */\n    secp256k1_scalar_add(&gnb, gn, &ctx->blind);\n    add.infinity = 0;\n    for (j = 0; j < 64; j++) {\n        bits = secp256k1_scalar_get_bits(&gnb, j * 4, 4);\n        for (i = 0; i < 16; i++) {\n            /** This uses a conditional move to avoid any secret data in array indexes.\n             *   _Any_ use of secret indexes has been demonstrated to result in timing\n             *   sidechannels, even when the cache-line access patterns are uniform.\n             *  See also:\n             *   \"A word of warning\", CHES 2013 Rump Session, by Daniel J. Bernstein and Peter Schwabe\n             *    (https://cryptojedi.org/peter/data/chesrump-20130822.pdf) and\n             *   \"Cache Attacks and Countermeasures: the Case of AES\", RSA 2006,\n             *    by Dag Arne Osvik, Adi Shamir, and Eran Tromer\n             *    (http://www.tau.ac.il/~tromer/papers/cache.pdf)\n             */\n            secp256k1_ge_storage_cmov(&adds, &(*ctx->prec)[j][i], i == bits);\n        }\n        secp256k1_ge_from_storage(&add, &adds);\n        secp256k1_gej_add_ge(r, r, &add);\n    }\n    bits = 0;\n    secp256k1_ge_clear(&add);\n    secp256k1_scalar_clear(&gnb);\n}\n\n/* Setup blinding values for secp256k1_ecmult_gen. */\nstatic void secp256k1_ecmult_gen_blind(secp256k1_ecmult_gen_context *ctx, const unsigned char *seed32) {\n    secp256k1_scalar b;\n    secp256k1_gej gb;\n    secp256k1_fe s;\n    unsigned char nonce32[32];\n    secp256k1_rfc6979_hmac_sha256_t rng;\n    int retry;\n    unsigned char keydata[64] = {0};\n    if (seed32 == NULL) {\n        /* When seed is NULL, reset the initial point and blinding value. */\n        secp256k1_gej_set_ge(&ctx->initial, &secp256k1_ge_const_g);\n        secp256k1_gej_neg(&ctx->initial, &ctx->initial);\n        secp256k1_scalar_set_int(&ctx->blind, 1);\n    }\n    /* The prior blinding value (if not reset) is chained forward by including it in the hash. */\n    secp256k1_scalar_get_b32(nonce32, &ctx->blind);\n    /** Using a CSPRNG allows a failure free interface, avoids needing large amounts of random data,\n     *   and guards against weak or adversarial seeds.  This is a simpler and safer interface than\n     *   asking the caller for blinding values directly and expecting them to retry on failure.\n     */\n    memcpy(keydata, nonce32, 32);\n    if (seed32 != NULL) {\n        memcpy(keydata + 32, seed32, 32);\n    }\n    secp256k1_rfc6979_hmac_sha256_initialize(&rng, keydata, seed32 ? 64 : 32);\n    memset(keydata, 0, sizeof(keydata));\n    /* Retry for out of range results to achieve uniformity. */\n    do {\n        secp256k1_rfc6979_hmac_sha256_generate(&rng, nonce32, 32);\n        retry = !secp256k1_fe_set_b32(&s, nonce32);\n        retry |= secp256k1_fe_is_zero(&s);\n    } while (retry); /* This branch true is cryptographically unreachable. Requires sha256_hmac output > Fp. */\n    /* Randomize the projection to defend against multiplier sidechannels. */\n    secp256k1_gej_rescale(&ctx->initial, &s);\n    secp256k1_fe_clear(&s);\n    do {\n        secp256k1_rfc6979_hmac_sha256_generate(&rng, nonce32, 32);\n        secp256k1_scalar_set_b32(&b, nonce32, &retry);\n        /* A blinding value of 0 works, but would undermine the projection hardening. */\n        retry |= secp256k1_scalar_is_zero(&b);\n    } while (retry); /* This branch true is cryptographically unreachable. Requires sha256_hmac output > order. */\n    secp256k1_rfc6979_hmac_sha256_finalize(&rng);\n    memset(nonce32, 0, 32);\n    secp256k1_ecmult_gen(ctx, &gb, &b);\n    secp256k1_scalar_negate(&b, &b);\n    ctx->blind = b;\n    ctx->initial = gb;\n    secp256k1_scalar_clear(&b);\n    secp256k1_gej_clear(&gb);\n}\n\n#endif /* SECP256K1_ECMULT_GEN_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/ecmult_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_ECMULT_IMPL_H\n#define SECP256K1_ECMULT_IMPL_H\n\n#include <string.h>\n\n#include \"group.h\"\n#include \"scalar.h\"\n#include \"ecmult.h\"\n\n#if defined(EXHAUSTIVE_TEST_ORDER)\n/* We need to lower these values for exhaustive tests because\n * the tables cannot have infinities in them (this breaks the\n * affine-isomorphism stuff which tracks z-ratios) */\n#  if EXHAUSTIVE_TEST_ORDER > 128\n#    define WINDOW_A 5\n#    define WINDOW_G 8\n#  elif EXHAUSTIVE_TEST_ORDER > 8\n#    define WINDOW_A 4\n#    define WINDOW_G 4\n#  else\n#    define WINDOW_A 2\n#    define WINDOW_G 2\n#  endif\n#else\n/* optimal for 128-bit and 256-bit exponents. */\n#define WINDOW_A 5\n/** larger numbers may result in slightly better performance, at the cost of\n    exponentially larger precomputed tables. */\n#ifdef USE_ENDOMORPHISM\n/** Two tables for window size 15: 1.375 MiB. */\n#define WINDOW_G 15\n#else\n/** One table for window size 16: 1.375 MiB. */\n#define WINDOW_G 16\n#endif\n#endif\n\n/** The number of entries a table with precomputed multiples needs to have. */\n#define ECMULT_TABLE_SIZE(w) (1 << ((w)-2))\n\n/** Fill a table 'prej' with precomputed odd multiples of a. Prej will contain\n *  the values [1*a,3*a,...,(2*n-1)*a], so it space for n values. zr[0] will\n *  contain prej[0].z / a.z. The other zr[i] values = prej[i].z / prej[i-1].z.\n *  Prej's Z values are undefined, except for the last value.\n */\nstatic void secp256k1_ecmult_odd_multiples_table(int n, secp256k1_gej *prej, secp256k1_fe *zr, const secp256k1_gej *a) {\n    secp256k1_gej d;\n    secp256k1_ge a_ge, d_ge;\n    int i;\n\n    VERIFY_CHECK(!a->infinity);\n\n    secp256k1_gej_double_var(&d, a, NULL);\n\n    /*\n     * Perform the additions on an isomorphism where 'd' is affine: drop the z coordinate\n     * of 'd', and scale the 1P starting value's x/y coordinates without changing its z.\n     */\n    d_ge.x = d.x;\n    d_ge.y = d.y;\n    d_ge.infinity = 0;\n\n    secp256k1_ge_set_gej_zinv(&a_ge, a, &d.z);\n    prej[0].x = a_ge.x;\n    prej[0].y = a_ge.y;\n    prej[0].z = a->z;\n    prej[0].infinity = 0;\n\n    zr[0] = d.z;\n    for (i = 1; i < n; i++) {\n        secp256k1_gej_add_ge_var(&prej[i], &prej[i-1], &d_ge, &zr[i]);\n    }\n\n    /*\n     * Each point in 'prej' has a z coordinate too small by a factor of 'd.z'. Only\n     * the final point's z coordinate is actually used though, so just update that.\n     */\n    secp256k1_fe_mul(&prej[n-1].z, &prej[n-1].z, &d.z);\n}\n\n/** Fill a table 'pre' with precomputed odd multiples of a.\n *\n *  There are two versions of this function:\n *  - secp256k1_ecmult_odd_multiples_table_globalz_windowa which brings its\n *    resulting point set to a single constant Z denominator, stores the X and Y\n *    coordinates as ge_storage points in pre, and stores the global Z in rz.\n *    It only operates on tables sized for WINDOW_A wnaf multiples.\n *  - secp256k1_ecmult_odd_multiples_table_storage_var, which converts its\n *    resulting point set to actually affine points, and stores those in pre.\n *    It operates on tables of any size, but uses heap-allocated temporaries.\n *\n *  To compute a*P + b*G, we compute a table for P using the first function,\n *  and for G using the second (which requires an inverse, but it only needs to\n *  happen once).\n */\nstatic void secp256k1_ecmult_odd_multiples_table_globalz_windowa(secp256k1_ge *pre, secp256k1_fe *globalz, const secp256k1_gej *a) {\n    secp256k1_gej prej[ECMULT_TABLE_SIZE(WINDOW_A)];\n    secp256k1_fe zr[ECMULT_TABLE_SIZE(WINDOW_A)];\n\n    /* Compute the odd multiples in Jacobian form. */\n    secp256k1_ecmult_odd_multiples_table(ECMULT_TABLE_SIZE(WINDOW_A), prej, zr, a);\n    /* Bring them to the same Z denominator. */\n    secp256k1_ge_globalz_set_table_gej(ECMULT_TABLE_SIZE(WINDOW_A), pre, globalz, prej, zr);\n}\n\nstatic void secp256k1_ecmult_odd_multiples_table_storage_var(int n, secp256k1_ge_storage *pre, const secp256k1_gej *a, const secp256k1_callback *cb) {\n    secp256k1_gej *prej = (secp256k1_gej*)checked_malloc(cb, sizeof(secp256k1_gej) * n);\n    secp256k1_ge *prea = (secp256k1_ge*)checked_malloc(cb, sizeof(secp256k1_ge) * n);\n    secp256k1_fe *zr = (secp256k1_fe*)checked_malloc(cb, sizeof(secp256k1_fe) * n);\n    int i;\n\n    /* Compute the odd multiples in Jacobian form. */\n    secp256k1_ecmult_odd_multiples_table(n, prej, zr, a);\n    /* Convert them in batch to affine coordinates. */\n    secp256k1_ge_set_table_gej_var(prea, prej, zr, n);\n    /* Convert them to compact storage form. */\n    for (i = 0; i < n; i++) {\n        secp256k1_ge_to_storage(&pre[i], &prea[i]);\n    }\n\n    free(prea);\n    free(prej);\n    free(zr);\n}\n\n/** The following two macro retrieves a particular odd multiple from a table\n *  of precomputed multiples. */\n#define ECMULT_TABLE_GET_GE(r,pre,n,w) do { \\\n    VERIFY_CHECK(((n) & 1) == 1); \\\n    VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1)); \\\n    VERIFY_CHECK((n) <=  ((1 << ((w)-1)) - 1)); \\\n    if ((n) > 0) { \\\n        *(r) = (pre)[((n)-1)/2]; \\\n    } else { \\\n        secp256k1_ge_neg((r), &(pre)[(-(n)-1)/2]); \\\n    } \\\n} while(0)\n\n#define ECMULT_TABLE_GET_GE_STORAGE(r,pre,n,w) do { \\\n    VERIFY_CHECK(((n) & 1) == 1); \\\n    VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1)); \\\n    VERIFY_CHECK((n) <=  ((1 << ((w)-1)) - 1)); \\\n    if ((n) > 0) { \\\n        secp256k1_ge_from_storage((r), &(pre)[((n)-1)/2]); \\\n    } else { \\\n        secp256k1_ge_from_storage((r), &(pre)[(-(n)-1)/2]); \\\n        secp256k1_ge_neg((r), (r)); \\\n    } \\\n} while(0)\n\nstatic void secp256k1_ecmult_context_init(secp256k1_ecmult_context *ctx) {\n    ctx->pre_g = NULL;\n#ifdef USE_ENDOMORPHISM\n    ctx->pre_g_128 = NULL;\n#endif\n}\n\nstatic void secp256k1_ecmult_context_build(secp256k1_ecmult_context *ctx, const secp256k1_callback *cb) {\n    secp256k1_gej gj;\n\n    if (ctx->pre_g != NULL) {\n        return;\n    }\n\n    /* get the generator */\n    secp256k1_gej_set_ge(&gj, &secp256k1_ge_const_g);\n\n    ctx->pre_g = (secp256k1_ge_storage (*)[])checked_malloc(cb, sizeof((*ctx->pre_g)[0]) * ECMULT_TABLE_SIZE(WINDOW_G));\n\n    /* precompute the tables with odd multiples */\n    secp256k1_ecmult_odd_multiples_table_storage_var(ECMULT_TABLE_SIZE(WINDOW_G), *ctx->pre_g, &gj, cb);\n\n#ifdef USE_ENDOMORPHISM\n    {\n        secp256k1_gej g_128j;\n        int i;\n\n        ctx->pre_g_128 = (secp256k1_ge_storage (*)[])checked_malloc(cb, sizeof((*ctx->pre_g_128)[0]) * ECMULT_TABLE_SIZE(WINDOW_G));\n\n        /* calculate 2^128*generator */\n        g_128j = gj;\n        for (i = 0; i < 128; i++) {\n            secp256k1_gej_double_var(&g_128j, &g_128j, NULL);\n        }\n        secp256k1_ecmult_odd_multiples_table_storage_var(ECMULT_TABLE_SIZE(WINDOW_G), *ctx->pre_g_128, &g_128j, cb);\n    }\n#endif\n}\n\nstatic void secp256k1_ecmult_context_clone(secp256k1_ecmult_context *dst,\n                                           const secp256k1_ecmult_context *src, const secp256k1_callback *cb) {\n    if (src->pre_g == NULL) {\n        dst->pre_g = NULL;\n    } else {\n        size_t size = sizeof((*dst->pre_g)[0]) * ECMULT_TABLE_SIZE(WINDOW_G);\n        dst->pre_g = (secp256k1_ge_storage (*)[])checked_malloc(cb, size);\n        memcpy(dst->pre_g, src->pre_g, size);\n    }\n#ifdef USE_ENDOMORPHISM\n    if (src->pre_g_128 == NULL) {\n        dst->pre_g_128 = NULL;\n    } else {\n        size_t size = sizeof((*dst->pre_g_128)[0]) * ECMULT_TABLE_SIZE(WINDOW_G);\n        dst->pre_g_128 = (secp256k1_ge_storage (*)[])checked_malloc(cb, size);\n        memcpy(dst->pre_g_128, src->pre_g_128, size);\n    }\n#endif\n}\n\nstatic int secp256k1_ecmult_context_is_built(const secp256k1_ecmult_context *ctx) {\n    return ctx->pre_g != NULL;\n}\n\nstatic void secp256k1_ecmult_context_clear(secp256k1_ecmult_context *ctx) {\n    free(ctx->pre_g);\n#ifdef USE_ENDOMORPHISM\n    free(ctx->pre_g_128);\n#endif\n    secp256k1_ecmult_context_init(ctx);\n}\n\n/** Convert a number to WNAF notation. The number becomes represented by sum(2^i * wnaf[i], i=0..bits),\n *  with the following guarantees:\n *  - each wnaf[i] is either 0, or an odd integer between -(1<<(w-1) - 1) and (1<<(w-1) - 1)\n *  - two non-zero entries in wnaf are separated by at least w-1 zeroes.\n *  - the number of set values in wnaf is returned. This number is at most 256, and at most one more\n *    than the number of bits in the (absolute value) of the input.\n */\nstatic int secp256k1_ecmult_wnaf(int *wnaf, int len, const secp256k1_scalar *a, int w) {\n    secp256k1_scalar s = *a;\n    int last_set_bit = -1;\n    int bit = 0;\n    int sign = 1;\n    int carry = 0;\n\n    VERIFY_CHECK(wnaf != NULL);\n    VERIFY_CHECK(0 <= len && len <= 256);\n    VERIFY_CHECK(a != NULL);\n    VERIFY_CHECK(2 <= w && w <= 31);\n\n    memset(wnaf, 0, len * sizeof(wnaf[0]));\n\n    if (secp256k1_scalar_get_bits(&s, 255, 1)) {\n        secp256k1_scalar_negate(&s, &s);\n        sign = -1;\n    }\n\n    while (bit < len) {\n        int now;\n        int word;\n        if (secp256k1_scalar_get_bits(&s, bit, 1) == (unsigned int)carry) {\n            bit++;\n            continue;\n        }\n\n        now = w;\n        if (now > len - bit) {\n            now = len - bit;\n        }\n\n        word = secp256k1_scalar_get_bits_var(&s, bit, now) + carry;\n\n        carry = (word >> (w-1)) & 1;\n        word -= carry << w;\n\n        wnaf[bit] = sign * word;\n        last_set_bit = bit;\n\n        bit += now;\n    }\n#ifdef VERIFY\n    CHECK(carry == 0);\n    while (bit < 256) {\n        CHECK(secp256k1_scalar_get_bits(&s, bit++, 1) == 0);\n    } \n#endif\n    return last_set_bit + 1;\n}\n\nstatic void secp256k1_ecmult(const secp256k1_ecmult_context *ctx, secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {\n    secp256k1_ge pre_a[ECMULT_TABLE_SIZE(WINDOW_A)];\n    secp256k1_ge tmpa;\n    secp256k1_fe Z;\n#ifdef USE_ENDOMORPHISM\n    secp256k1_ge pre_a_lam[ECMULT_TABLE_SIZE(WINDOW_A)];\n    secp256k1_scalar na_1, na_lam;\n    /* Splitted G factors. */\n    secp256k1_scalar ng_1, ng_128;\n    int wnaf_na_1[130];\n    int wnaf_na_lam[130];\n    int bits_na_1;\n    int bits_na_lam;\n    int wnaf_ng_1[129];\n    int bits_ng_1;\n    int wnaf_ng_128[129];\n    int bits_ng_128;\n#else\n    int wnaf_na[256];\n    int bits_na;\n    int wnaf_ng[256];\n    int bits_ng;\n#endif\n    int i;\n    int bits;\n\n#ifdef USE_ENDOMORPHISM\n    /* split na into na_1 and na_lam (where na = na_1 + na_lam*lambda, and na_1 and na_lam are ~128 bit) */\n    secp256k1_scalar_split_lambda(&na_1, &na_lam, na);\n\n    /* build wnaf representation for na_1 and na_lam. */\n    bits_na_1   = secp256k1_ecmult_wnaf(wnaf_na_1,   130, &na_1,   WINDOW_A);\n    bits_na_lam = secp256k1_ecmult_wnaf(wnaf_na_lam, 130, &na_lam, WINDOW_A);\n    VERIFY_CHECK(bits_na_1 <= 130);\n    VERIFY_CHECK(bits_na_lam <= 130);\n    bits = bits_na_1;\n    if (bits_na_lam > bits) {\n        bits = bits_na_lam;\n    }\n#else\n    /* build wnaf representation for na. */\n    bits_na     = secp256k1_ecmult_wnaf(wnaf_na,     256, na,      WINDOW_A);\n    bits = bits_na;\n#endif\n\n    /* Calculate odd multiples of a.\n     * All multiples are brought to the same Z 'denominator', which is stored\n     * in Z. Due to secp256k1' isomorphism we can do all operations pretending\n     * that the Z coordinate was 1, use affine addition formulae, and correct\n     * the Z coordinate of the result once at the end.\n     * The exception is the precomputed G table points, which are actually\n     * affine. Compared to the base used for other points, they have a Z ratio\n     * of 1/Z, so we can use secp256k1_gej_add_zinv_var, which uses the same\n     * isomorphism to efficiently add with a known Z inverse.\n     */\n    secp256k1_ecmult_odd_multiples_table_globalz_windowa(pre_a, &Z, a);\n\n#ifdef USE_ENDOMORPHISM\n    for (i = 0; i < ECMULT_TABLE_SIZE(WINDOW_A); i++) {\n        secp256k1_ge_mul_lambda(&pre_a_lam[i], &pre_a[i]);\n    }\n\n    /* split ng into ng_1 and ng_128 (where gn = gn_1 + gn_128*2^128, and gn_1 and gn_128 are ~128 bit) */\n    secp256k1_scalar_split_128(&ng_1, &ng_128, ng);\n\n    /* Build wnaf representation for ng_1 and ng_128 */\n    bits_ng_1   = secp256k1_ecmult_wnaf(wnaf_ng_1,   129, &ng_1,   WINDOW_G);\n    bits_ng_128 = secp256k1_ecmult_wnaf(wnaf_ng_128, 129, &ng_128, WINDOW_G);\n    if (bits_ng_1 > bits) {\n        bits = bits_ng_1;\n    }\n    if (bits_ng_128 > bits) {\n        bits = bits_ng_128;\n    }\n#else\n    bits_ng     = secp256k1_ecmult_wnaf(wnaf_ng,     256, ng,      WINDOW_G);\n    if (bits_ng > bits) {\n        bits = bits_ng;\n    }\n#endif\n\n    secp256k1_gej_set_infinity(r);\n\n    for (i = bits - 1; i >= 0; i--) {\n        int n;\n        secp256k1_gej_double_var(r, r, NULL);\n#ifdef USE_ENDOMORPHISM\n        if (i < bits_na_1 && (n = wnaf_na_1[i])) {\n            ECMULT_TABLE_GET_GE(&tmpa, pre_a, n, WINDOW_A);\n            secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);\n        }\n        if (i < bits_na_lam && (n = wnaf_na_lam[i])) {\n            ECMULT_TABLE_GET_GE(&tmpa, pre_a_lam, n, WINDOW_A);\n            secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);\n        }\n        if (i < bits_ng_1 && (n = wnaf_ng_1[i])) {\n            ECMULT_TABLE_GET_GE_STORAGE(&tmpa, *ctx->pre_g, n, WINDOW_G);\n            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);\n        }\n        if (i < bits_ng_128 && (n = wnaf_ng_128[i])) {\n            ECMULT_TABLE_GET_GE_STORAGE(&tmpa, *ctx->pre_g_128, n, WINDOW_G);\n            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);\n        }\n#else\n        if (i < bits_na && (n = wnaf_na[i])) {\n            ECMULT_TABLE_GET_GE(&tmpa, pre_a, n, WINDOW_A);\n            secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);\n        }\n        if (i < bits_ng && (n = wnaf_ng[i])) {\n            ECMULT_TABLE_GET_GE_STORAGE(&tmpa, *ctx->pre_g, n, WINDOW_G);\n            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);\n        }\n#endif\n    }\n\n    if (!r->infinity) {\n        secp256k1_fe_mul(&r->z, &r->z, &Z);\n    }\n}\n\n#endif /* SECP256K1_ECMULT_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/field.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_FIELD_H\n#define SECP256K1_FIELD_H\n\n/** Field element module.\n *\n *  Field elements can be represented in several ways, but code accessing\n *  it (and implementations) need to take certain properties into account:\n *  - Each field element can be normalized or not.\n *  - Each field element has a magnitude, which represents how far away\n *    its representation is away from normalization. Normalized elements\n *    always have a magnitude of 1, but a magnitude of 1 doesn't imply\n *    normality.\n */\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n#if defined(USE_FIELD_10X26)\n#include \"field_10x26.h\"\n#elif defined(USE_FIELD_5X52)\n#include \"field_5x52.h\"\n#else\n#error \"Please select field implementation\"\n#endif\n\n#include \"util.h\"\n\n/** Normalize a field element. */\nstatic void secp256k1_fe_normalize(secp256k1_fe *r);\n\n/** Weakly normalize a field element: reduce it magnitude to 1, but don't fully normalize. */\nstatic void secp256k1_fe_normalize_weak(secp256k1_fe *r);\n\n/** Normalize a field element, without constant-time guarantee. */\nstatic void secp256k1_fe_normalize_var(secp256k1_fe *r);\n\n/** Verify whether a field element represents zero i.e. would normalize to a zero value. The field\n *  implementation may optionally normalize the input, but this should not be relied upon. */\nstatic int secp256k1_fe_normalizes_to_zero(secp256k1_fe *r);\n\n/** Verify whether a field element represents zero i.e. would normalize to a zero value. The field\n *  implementation may optionally normalize the input, but this should not be relied upon. */\nstatic int secp256k1_fe_normalizes_to_zero_var(secp256k1_fe *r);\n\n/** Set a field element equal to a small integer. Resulting field element is normalized. */\nstatic void secp256k1_fe_set_int(secp256k1_fe *r, int a);\n\n/** Sets a field element equal to zero, initializing all fields. */\nstatic void secp256k1_fe_clear(secp256k1_fe *a);\n\n/** Verify whether a field element is zero. Requires the input to be normalized. */\nstatic int secp256k1_fe_is_zero(const secp256k1_fe *a);\n\n/** Check the \"oddness\" of a field element. Requires the input to be normalized. */\nstatic int secp256k1_fe_is_odd(const secp256k1_fe *a);\n\n/** Compare two field elements. Requires magnitude-1 inputs. */\nstatic int secp256k1_fe_equal(const secp256k1_fe *a, const secp256k1_fe *b);\n\n/** Same as secp256k1_fe_equal, but may be variable time. */\nstatic int secp256k1_fe_equal_var(const secp256k1_fe *a, const secp256k1_fe *b);\n\n/** Compare two field elements. Requires both inputs to be normalized */\nstatic int secp256k1_fe_cmp_var(const secp256k1_fe *a, const secp256k1_fe *b);\n\n/** Set a field element equal to 32-byte big endian value. If successful, the resulting field element is normalized. */\nstatic int secp256k1_fe_set_b32(secp256k1_fe *r, const unsigned char *a);\n\n/** Convert a field element to a 32-byte big endian value. Requires the input to be normalized */\nstatic void secp256k1_fe_get_b32(unsigned char *r, const secp256k1_fe *a);\n\n/** Set a field element equal to the additive inverse of another. Takes a maximum magnitude of the input\n *  as an argument. The magnitude of the output is one higher. */\nstatic void secp256k1_fe_negate(secp256k1_fe *r, const secp256k1_fe *a, int m);\n\n/** Multiplies the passed field element with a small integer constant. Multiplies the magnitude by that\n *  small integer. */\nstatic void secp256k1_fe_mul_int(secp256k1_fe *r, int a);\n\n/** Adds a field element to another. The result has the sum of the inputs' magnitudes as magnitude. */\nstatic void secp256k1_fe_add(secp256k1_fe *r, const secp256k1_fe *a);\n\n/** Sets a field element to be the product of two others. Requires the inputs' magnitudes to be at most 8.\n *  The output magnitude is 1 (but not guaranteed to be normalized). */\nstatic void secp256k1_fe_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b);\n\n/** Sets a field element to be the square of another. Requires the input's magnitude to be at most 8.\n *  The output magnitude is 1 (but not guaranteed to be normalized). */\nstatic void secp256k1_fe_sqr(secp256k1_fe *r, const secp256k1_fe *a);\n\n/** If a has a square root, it is computed in r and 1 is returned. If a does not\n *  have a square root, the root of its negation is computed and 0 is returned.\n *  The input's magnitude can be at most 8. The output magnitude is 1 (but not\n *  guaranteed to be normalized). The result in r will always be a square\n *  itself. */\nstatic int secp256k1_fe_sqrt(secp256k1_fe *r, const secp256k1_fe *a);\n\n/** Checks whether a field element is a quadratic residue. */\nstatic int secp256k1_fe_is_quad_var(const secp256k1_fe *a);\n\n/** Sets a field element to be the (modular) inverse of another. Requires the input's magnitude to be\n *  at most 8. The output magnitude is 1 (but not guaranteed to be normalized). */\nstatic void secp256k1_fe_inv(secp256k1_fe *r, const secp256k1_fe *a);\n\n/** Potentially faster version of secp256k1_fe_inv, without constant-time guarantee. */\nstatic void secp256k1_fe_inv_var(secp256k1_fe *r, const secp256k1_fe *a);\n\n/** Calculate the (modular) inverses of a batch of field elements. Requires the inputs' magnitudes to be\n *  at most 8. The output magnitudes are 1 (but not guaranteed to be normalized). The inputs and\n *  outputs must not overlap in memory. */\nstatic void secp256k1_fe_inv_all_var(secp256k1_fe *r, const secp256k1_fe *a, size_t len);\n\n/** Convert a field element to the storage type. */\nstatic void secp256k1_fe_to_storage(secp256k1_fe_storage *r, const secp256k1_fe *a);\n\n/** Convert a field element back from the storage type. */\nstatic void secp256k1_fe_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a);\n\n/** If flag is true, set *r equal to *a; otherwise leave it. Constant-time. */\nstatic void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag);\n\n/** If flag is true, set *r equal to *a; otherwise leave it. Constant-time. */\nstatic void secp256k1_fe_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag);\n\n#endif /* SECP256K1_FIELD_H */\n"
  },
  {
    "path": "src/secp256k1/src/field_10x26.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_FIELD_REPR_H\n#define SECP256K1_FIELD_REPR_H\n\n#include <stdint.h>\n\ntypedef struct {\n    /* X = sum(i=0..9, elem[i]*2^26) mod n */\n    uint32_t n[10];\n#ifdef VERIFY\n    int magnitude;\n    int normalized;\n#endif\n} secp256k1_fe;\n\n/* Unpacks a constant into a overlapping multi-limbed FE element. */\n#define SECP256K1_FE_CONST_INNER(d7, d6, d5, d4, d3, d2, d1, d0) { \\\n    (d0) & 0x3FFFFFFUL, \\\n    (((uint32_t)d0) >> 26) | (((uint32_t)(d1) & 0xFFFFFUL) << 6), \\\n    (((uint32_t)d1) >> 20) | (((uint32_t)(d2) & 0x3FFFUL) << 12), \\\n    (((uint32_t)d2) >> 14) | (((uint32_t)(d3) & 0xFFUL) << 18), \\\n    (((uint32_t)d3) >> 8) | (((uint32_t)(d4) & 0x3UL) << 24), \\\n    (((uint32_t)d4) >> 2) & 0x3FFFFFFUL, \\\n    (((uint32_t)d4) >> 28) | (((uint32_t)(d5) & 0x3FFFFFUL) << 4), \\\n    (((uint32_t)d5) >> 22) | (((uint32_t)(d6) & 0xFFFFUL) << 10), \\\n    (((uint32_t)d6) >> 16) | (((uint32_t)(d7) & 0x3FFUL) << 16), \\\n    (((uint32_t)d7) >> 10) \\\n}\n\n#ifdef VERIFY\n#define SECP256K1_FE_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {SECP256K1_FE_CONST_INNER((d7), (d6), (d5), (d4), (d3), (d2), (d1), (d0)), 1, 1}\n#else\n#define SECP256K1_FE_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {SECP256K1_FE_CONST_INNER((d7), (d6), (d5), (d4), (d3), (d2), (d1), (d0))}\n#endif\n\ntypedef struct {\n    uint32_t n[8];\n} secp256k1_fe_storage;\n\n#define SECP256K1_FE_STORAGE_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{ (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }}\n#define SECP256K1_FE_STORAGE_CONST_GET(d) d.n[7], d.n[6], d.n[5], d.n[4],d.n[3], d.n[2], d.n[1], d.n[0]\n\n#endif /* SECP256K1_FIELD_REPR_H */\n"
  },
  {
    "path": "src/secp256k1/src/field_10x26_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_FIELD_REPR_IMPL_H\n#define SECP256K1_FIELD_REPR_IMPL_H\n\n#include \"util.h\"\n#include \"num.h\"\n#include \"field.h\"\n\n#ifdef VERIFY\nstatic void secp256k1_fe_verify(const secp256k1_fe *a) {\n    const uint32_t *d = a->n;\n    int m = a->normalized ? 1 : 2 * a->magnitude, r = 1;\n    r &= (d[0] <= 0x3FFFFFFUL * m);\n    r &= (d[1] <= 0x3FFFFFFUL * m);\n    r &= (d[2] <= 0x3FFFFFFUL * m);\n    r &= (d[3] <= 0x3FFFFFFUL * m);\n    r &= (d[4] <= 0x3FFFFFFUL * m);\n    r &= (d[5] <= 0x3FFFFFFUL * m);\n    r &= (d[6] <= 0x3FFFFFFUL * m);\n    r &= (d[7] <= 0x3FFFFFFUL * m);\n    r &= (d[8] <= 0x3FFFFFFUL * m);\n    r &= (d[9] <= 0x03FFFFFUL * m);\n    r &= (a->magnitude >= 0);\n    r &= (a->magnitude <= 32);\n    if (a->normalized) {\n        r &= (a->magnitude <= 1);\n        if (r && (d[9] == 0x03FFFFFUL)) {\n            uint32_t mid = d[8] & d[7] & d[6] & d[5] & d[4] & d[3] & d[2];\n            if (mid == 0x3FFFFFFUL) {\n                r &= ((d[1] + 0x40UL + ((d[0] + 0x3D1UL) >> 26)) <= 0x3FFFFFFUL);\n            }\n        }\n    }\n    VERIFY_CHECK(r == 1);\n}\n#endif\n\nstatic void secp256k1_fe_normalize(secp256k1_fe *r) {\n    uint32_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4],\n             t5 = r->n[5], t6 = r->n[6], t7 = r->n[7], t8 = r->n[8], t9 = r->n[9];\n\n    /* Reduce t9 at the start so there will be at most a single carry from the first pass */\n    uint32_t m;\n    uint32_t x = t9 >> 22; t9 &= 0x03FFFFFUL;\n\n    /* The first pass ensures the magnitude is 1, ... */\n    t0 += x * 0x3D1UL; t1 += (x << 6);\n    t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL;\n    t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL;\n    t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL; m = t2;\n    t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL; m &= t3;\n    t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL; m &= t4;\n    t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL; m &= t5;\n    t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL; m &= t6;\n    t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL; m &= t7;\n    t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL; m &= t8;\n\n    /* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */\n    VERIFY_CHECK(t9 >> 23 == 0);\n\n    /* At most a single final reduction is needed; check if the value is >= the field characteristic */\n    x = (t9 >> 22) | ((t9 == 0x03FFFFFUL) & (m == 0x3FFFFFFUL)\n        & ((t1 + 0x40UL + ((t0 + 0x3D1UL) >> 26)) > 0x3FFFFFFUL));\n\n    /* Apply the final reduction (for constant-time behaviour, we do it always) */\n    t0 += x * 0x3D1UL; t1 += (x << 6);\n    t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL;\n    t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL;\n    t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL;\n    t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL;\n    t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL;\n    t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL;\n    t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL;\n    t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL;\n    t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL;\n\n    /* If t9 didn't carry to bit 22 already, then it should have after any final reduction */\n    VERIFY_CHECK(t9 >> 22 == x);\n\n    /* Mask off the possible multiple of 2^256 from the final reduction */\n    t9 &= 0x03FFFFFUL;\n\n    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;\n    r->n[5] = t5; r->n[6] = t6; r->n[7] = t7; r->n[8] = t8; r->n[9] = t9;\n\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 1;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic void secp256k1_fe_normalize_weak(secp256k1_fe *r) {\n    uint32_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4],\n             t5 = r->n[5], t6 = r->n[6], t7 = r->n[7], t8 = r->n[8], t9 = r->n[9];\n\n    /* Reduce t9 at the start so there will be at most a single carry from the first pass */\n    uint32_t x = t9 >> 22; t9 &= 0x03FFFFFUL;\n\n    /* The first pass ensures the magnitude is 1, ... */\n    t0 += x * 0x3D1UL; t1 += (x << 6);\n    t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL;\n    t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL;\n    t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL;\n    t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL;\n    t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL;\n    t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL;\n    t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL;\n    t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL;\n    t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL;\n\n    /* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */\n    VERIFY_CHECK(t9 >> 23 == 0);\n\n    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;\n    r->n[5] = t5; r->n[6] = t6; r->n[7] = t7; r->n[8] = t8; r->n[9] = t9;\n\n#ifdef VERIFY\n    r->magnitude = 1;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic void secp256k1_fe_normalize_var(secp256k1_fe *r) {\n    uint32_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4],\n             t5 = r->n[5], t6 = r->n[6], t7 = r->n[7], t8 = r->n[8], t9 = r->n[9];\n\n    /* Reduce t9 at the start so there will be at most a single carry from the first pass */\n    uint32_t m;\n    uint32_t x = t9 >> 22; t9 &= 0x03FFFFFUL;\n\n    /* The first pass ensures the magnitude is 1, ... */\n    t0 += x * 0x3D1UL; t1 += (x << 6);\n    t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL;\n    t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL;\n    t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL; m = t2;\n    t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL; m &= t3;\n    t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL; m &= t4;\n    t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL; m &= t5;\n    t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL; m &= t6;\n    t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL; m &= t7;\n    t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL; m &= t8;\n\n    /* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */\n    VERIFY_CHECK(t9 >> 23 == 0);\n\n    /* At most a single final reduction is needed; check if the value is >= the field characteristic */\n    x = (t9 >> 22) | ((t9 == 0x03FFFFFUL) & (m == 0x3FFFFFFUL)\n        & ((t1 + 0x40UL + ((t0 + 0x3D1UL) >> 26)) > 0x3FFFFFFUL));\n\n    if (x) {\n        t0 += 0x3D1UL; t1 += (x << 6);\n        t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL;\n        t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL;\n        t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL;\n        t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL;\n        t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL;\n        t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL;\n        t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL;\n        t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL;\n        t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL;\n\n        /* If t9 didn't carry to bit 22 already, then it should have after any final reduction */\n        VERIFY_CHECK(t9 >> 22 == x);\n\n        /* Mask off the possible multiple of 2^256 from the final reduction */\n        t9 &= 0x03FFFFFUL;\n    }\n\n    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;\n    r->n[5] = t5; r->n[6] = t6; r->n[7] = t7; r->n[8] = t8; r->n[9] = t9;\n\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 1;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic int secp256k1_fe_normalizes_to_zero(secp256k1_fe *r) {\n    uint32_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4],\n             t5 = r->n[5], t6 = r->n[6], t7 = r->n[7], t8 = r->n[8], t9 = r->n[9];\n\n    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */\n    uint32_t z0, z1;\n\n    /* Reduce t9 at the start so there will be at most a single carry from the first pass */\n    uint32_t x = t9 >> 22; t9 &= 0x03FFFFFUL;\n\n    /* The first pass ensures the magnitude is 1, ... */\n    t0 += x * 0x3D1UL; t1 += (x << 6);\n    t1 += (t0 >> 26); t0 &= 0x3FFFFFFUL; z0  = t0; z1  = t0 ^ 0x3D0UL;\n    t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL; z0 |= t1; z1 &= t1 ^ 0x40UL;\n    t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL; z0 |= t2; z1 &= t2;\n    t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL; z0 |= t3; z1 &= t3;\n    t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL; z0 |= t4; z1 &= t4;\n    t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL; z0 |= t5; z1 &= t5;\n    t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL; z0 |= t6; z1 &= t6;\n    t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL; z0 |= t7; z1 &= t7;\n    t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL; z0 |= t8; z1 &= t8;\n                                         z0 |= t9; z1 &= t9 ^ 0x3C00000UL;\n\n    /* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */\n    VERIFY_CHECK(t9 >> 23 == 0);\n\n    return (z0 == 0) | (z1 == 0x3FFFFFFUL);\n}\n\nstatic int secp256k1_fe_normalizes_to_zero_var(secp256k1_fe *r) {\n    uint32_t t0, t1, t2, t3, t4, t5, t6, t7, t8, t9;\n    uint32_t z0, z1;\n    uint32_t x;\n\n    t0 = r->n[0];\n    t9 = r->n[9];\n\n    /* Reduce t9 at the start so there will be at most a single carry from the first pass */\n    x = t9 >> 22;\n\n    /* The first pass ensures the magnitude is 1, ... */\n    t0 += x * 0x3D1UL;\n\n    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */\n    z0 = t0 & 0x3FFFFFFUL;\n    z1 = z0 ^ 0x3D0UL;\n\n    /* Fast return path should catch the majority of cases */\n    if ((z0 != 0UL) & (z1 != 0x3FFFFFFUL)) {\n        return 0;\n    }\n\n    t1 = r->n[1];\n    t2 = r->n[2];\n    t3 = r->n[3];\n    t4 = r->n[4];\n    t5 = r->n[5];\n    t6 = r->n[6];\n    t7 = r->n[7];\n    t8 = r->n[8];\n\n    t9 &= 0x03FFFFFUL;\n    t1 += (x << 6);\n\n    t1 += (t0 >> 26);\n    t2 += (t1 >> 26); t1 &= 0x3FFFFFFUL; z0 |= t1; z1 &= t1 ^ 0x40UL;\n    t3 += (t2 >> 26); t2 &= 0x3FFFFFFUL; z0 |= t2; z1 &= t2;\n    t4 += (t3 >> 26); t3 &= 0x3FFFFFFUL; z0 |= t3; z1 &= t3;\n    t5 += (t4 >> 26); t4 &= 0x3FFFFFFUL; z0 |= t4; z1 &= t4;\n    t6 += (t5 >> 26); t5 &= 0x3FFFFFFUL; z0 |= t5; z1 &= t5;\n    t7 += (t6 >> 26); t6 &= 0x3FFFFFFUL; z0 |= t6; z1 &= t6;\n    t8 += (t7 >> 26); t7 &= 0x3FFFFFFUL; z0 |= t7; z1 &= t7;\n    t9 += (t8 >> 26); t8 &= 0x3FFFFFFUL; z0 |= t8; z1 &= t8;\n                                         z0 |= t9; z1 &= t9 ^ 0x3C00000UL;\n\n    /* ... except for a possible carry at bit 22 of t9 (i.e. bit 256 of the field element) */\n    VERIFY_CHECK(t9 >> 23 == 0);\n\n    return (z0 == 0) | (z1 == 0x3FFFFFFUL);\n}\n\nSECP256K1_INLINE static void secp256k1_fe_set_int(secp256k1_fe *r, int a) {\n    r->n[0] = a;\n    r->n[1] = r->n[2] = r->n[3] = r->n[4] = r->n[5] = r->n[6] = r->n[7] = r->n[8] = r->n[9] = 0;\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 1;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nSECP256K1_INLINE static int secp256k1_fe_is_zero(const secp256k1_fe *a) {\n    const uint32_t *t = a->n;\n#ifdef VERIFY\n    VERIFY_CHECK(a->normalized);\n    secp256k1_fe_verify(a);\n#endif\n    return (t[0] | t[1] | t[2] | t[3] | t[4] | t[5] | t[6] | t[7] | t[8] | t[9]) == 0;\n}\n\nSECP256K1_INLINE static int secp256k1_fe_is_odd(const secp256k1_fe *a) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->normalized);\n    secp256k1_fe_verify(a);\n#endif\n    return a->n[0] & 1;\n}\n\nSECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe *a) {\n    int i;\n#ifdef VERIFY\n    a->magnitude = 0;\n    a->normalized = 1;\n#endif\n    for (i=0; i<10; i++) {\n        a->n[i] = 0;\n    }\n}\n\nstatic int secp256k1_fe_cmp_var(const secp256k1_fe *a, const secp256k1_fe *b) {\n    int i;\n#ifdef VERIFY\n    VERIFY_CHECK(a->normalized);\n    VERIFY_CHECK(b->normalized);\n    secp256k1_fe_verify(a);\n    secp256k1_fe_verify(b);\n#endif\n    for (i = 9; i >= 0; i--) {\n        if (a->n[i] > b->n[i]) {\n            return 1;\n        }\n        if (a->n[i] < b->n[i]) {\n            return -1;\n        }\n    }\n    return 0;\n}\n\nstatic int secp256k1_fe_set_b32(secp256k1_fe *r, const unsigned char *a) {\n    r->n[0] = (uint32_t)a[31] | ((uint32_t)a[30] << 8) | ((uint32_t)a[29] << 16) | ((uint32_t)(a[28] & 0x3) << 24);\n    r->n[1] = (uint32_t)((a[28] >> 2) & 0x3f) | ((uint32_t)a[27] << 6) | ((uint32_t)a[26] << 14) | ((uint32_t)(a[25] & 0xf) << 22);\n    r->n[2] = (uint32_t)((a[25] >> 4) & 0xf) | ((uint32_t)a[24] << 4) | ((uint32_t)a[23] << 12) | ((uint32_t)(a[22] & 0x3f) << 20);\n    r->n[3] = (uint32_t)((a[22] >> 6) & 0x3) | ((uint32_t)a[21] << 2) | ((uint32_t)a[20] << 10) | ((uint32_t)a[19] << 18);\n    r->n[4] = (uint32_t)a[18] | ((uint32_t)a[17] << 8) | ((uint32_t)a[16] << 16) | ((uint32_t)(a[15] & 0x3) << 24);\n    r->n[5] = (uint32_t)((a[15] >> 2) & 0x3f) | ((uint32_t)a[14] << 6) | ((uint32_t)a[13] << 14) | ((uint32_t)(a[12] & 0xf) << 22);\n    r->n[6] = (uint32_t)((a[12] >> 4) & 0xf) | ((uint32_t)a[11] << 4) | ((uint32_t)a[10] << 12) | ((uint32_t)(a[9] & 0x3f) << 20);\n    r->n[7] = (uint32_t)((a[9] >> 6) & 0x3) | ((uint32_t)a[8] << 2) | ((uint32_t)a[7] << 10) | ((uint32_t)a[6] << 18);\n    r->n[8] = (uint32_t)a[5] | ((uint32_t)a[4] << 8) | ((uint32_t)a[3] << 16) | ((uint32_t)(a[2] & 0x3) << 24);\n    r->n[9] = (uint32_t)((a[2] >> 2) & 0x3f) | ((uint32_t)a[1] << 6) | ((uint32_t)a[0] << 14);\n\n    if (r->n[9] == 0x3FFFFFUL && (r->n[8] & r->n[7] & r->n[6] & r->n[5] & r->n[4] & r->n[3] & r->n[2]) == 0x3FFFFFFUL && (r->n[1] + 0x40UL + ((r->n[0] + 0x3D1UL) >> 26)) > 0x3FFFFFFUL) {\n        return 0;\n    }\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 1;\n    secp256k1_fe_verify(r);\n#endif\n    return 1;\n}\n\n/** Convert a field element to a 32-byte big endian value. Requires the input to be normalized */\nstatic void secp256k1_fe_get_b32(unsigned char *r, const secp256k1_fe *a) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->normalized);\n    secp256k1_fe_verify(a);\n#endif\n    r[0] = (a->n[9] >> 14) & 0xff;\n    r[1] = (a->n[9] >> 6) & 0xff;\n    r[2] = ((a->n[9] & 0x3F) << 2) | ((a->n[8] >> 24) & 0x3);\n    r[3] = (a->n[8] >> 16) & 0xff;\n    r[4] = (a->n[8] >> 8) & 0xff;\n    r[5] = a->n[8] & 0xff;\n    r[6] = (a->n[7] >> 18) & 0xff;\n    r[7] = (a->n[7] >> 10) & 0xff;\n    r[8] = (a->n[7] >> 2) & 0xff;\n    r[9] = ((a->n[7] & 0x3) << 6) | ((a->n[6] >> 20) & 0x3f);\n    r[10] = (a->n[6] >> 12) & 0xff;\n    r[11] = (a->n[6] >> 4) & 0xff;\n    r[12] = ((a->n[6] & 0xf) << 4) | ((a->n[5] >> 22) & 0xf);\n    r[13] = (a->n[5] >> 14) & 0xff;\n    r[14] = (a->n[5] >> 6) & 0xff;\n    r[15] = ((a->n[5] & 0x3f) << 2) | ((a->n[4] >> 24) & 0x3);\n    r[16] = (a->n[4] >> 16) & 0xff;\n    r[17] = (a->n[4] >> 8) & 0xff;\n    r[18] = a->n[4] & 0xff;\n    r[19] = (a->n[3] >> 18) & 0xff;\n    r[20] = (a->n[3] >> 10) & 0xff;\n    r[21] = (a->n[3] >> 2) & 0xff;\n    r[22] = ((a->n[3] & 0x3) << 6) | ((a->n[2] >> 20) & 0x3f);\n    r[23] = (a->n[2] >> 12) & 0xff;\n    r[24] = (a->n[2] >> 4) & 0xff;\n    r[25] = ((a->n[2] & 0xf) << 4) | ((a->n[1] >> 22) & 0xf);\n    r[26] = (a->n[1] >> 14) & 0xff;\n    r[27] = (a->n[1] >> 6) & 0xff;\n    r[28] = ((a->n[1] & 0x3f) << 2) | ((a->n[0] >> 24) & 0x3);\n    r[29] = (a->n[0] >> 16) & 0xff;\n    r[30] = (a->n[0] >> 8) & 0xff;\n    r[31] = a->n[0] & 0xff;\n}\n\nSECP256K1_INLINE static void secp256k1_fe_negate(secp256k1_fe *r, const secp256k1_fe *a, int m) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->magnitude <= m);\n    secp256k1_fe_verify(a);\n#endif\n    r->n[0] = 0x3FFFC2FUL * 2 * (m + 1) - a->n[0];\n    r->n[1] = 0x3FFFFBFUL * 2 * (m + 1) - a->n[1];\n    r->n[2] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[2];\n    r->n[3] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[3];\n    r->n[4] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[4];\n    r->n[5] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[5];\n    r->n[6] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[6];\n    r->n[7] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[7];\n    r->n[8] = 0x3FFFFFFUL * 2 * (m + 1) - a->n[8];\n    r->n[9] = 0x03FFFFFUL * 2 * (m + 1) - a->n[9];\n#ifdef VERIFY\n    r->magnitude = m + 1;\n    r->normalized = 0;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nSECP256K1_INLINE static void secp256k1_fe_mul_int(secp256k1_fe *r, int a) {\n    r->n[0] *= a;\n    r->n[1] *= a;\n    r->n[2] *= a;\n    r->n[3] *= a;\n    r->n[4] *= a;\n    r->n[5] *= a;\n    r->n[6] *= a;\n    r->n[7] *= a;\n    r->n[8] *= a;\n    r->n[9] *= a;\n#ifdef VERIFY\n    r->magnitude *= a;\n    r->normalized = 0;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nSECP256K1_INLINE static void secp256k1_fe_add(secp256k1_fe *r, const secp256k1_fe *a) {\n#ifdef VERIFY\n    secp256k1_fe_verify(a);\n#endif\n    r->n[0] += a->n[0];\n    r->n[1] += a->n[1];\n    r->n[2] += a->n[2];\n    r->n[3] += a->n[3];\n    r->n[4] += a->n[4];\n    r->n[5] += a->n[5];\n    r->n[6] += a->n[6];\n    r->n[7] += a->n[7];\n    r->n[8] += a->n[8];\n    r->n[9] += a->n[9];\n#ifdef VERIFY\n    r->magnitude += a->magnitude;\n    r->normalized = 0;\n    secp256k1_fe_verify(r);\n#endif\n}\n\n#if defined(USE_EXTERNAL_ASM)\n\n/* External assembler implementation */\nvoid secp256k1_fe_mul_inner(uint32_t *r, const uint32_t *a, const uint32_t * SECP256K1_RESTRICT b);\nvoid secp256k1_fe_sqr_inner(uint32_t *r, const uint32_t *a);\n\n#else\n\n#ifdef VERIFY\n#define VERIFY_BITS(x, n) VERIFY_CHECK(((x) >> (n)) == 0)\n#else\n#define VERIFY_BITS(x, n) do { } while(0)\n#endif\n\nSECP256K1_INLINE static void secp256k1_fe_mul_inner(uint32_t *r, const uint32_t *a, const uint32_t * SECP256K1_RESTRICT b) {\n    uint64_t c, d;\n    uint64_t u0, u1, u2, u3, u4, u5, u6, u7, u8;\n    uint32_t t9, t1, t0, t2, t3, t4, t5, t6, t7;\n    const uint32_t M = 0x3FFFFFFUL, R0 = 0x3D10UL, R1 = 0x400UL;\n\n    VERIFY_BITS(a[0], 30);\n    VERIFY_BITS(a[1], 30);\n    VERIFY_BITS(a[2], 30);\n    VERIFY_BITS(a[3], 30);\n    VERIFY_BITS(a[4], 30);\n    VERIFY_BITS(a[5], 30);\n    VERIFY_BITS(a[6], 30);\n    VERIFY_BITS(a[7], 30);\n    VERIFY_BITS(a[8], 30);\n    VERIFY_BITS(a[9], 26);\n    VERIFY_BITS(b[0], 30);\n    VERIFY_BITS(b[1], 30);\n    VERIFY_BITS(b[2], 30);\n    VERIFY_BITS(b[3], 30);\n    VERIFY_BITS(b[4], 30);\n    VERIFY_BITS(b[5], 30);\n    VERIFY_BITS(b[6], 30);\n    VERIFY_BITS(b[7], 30);\n    VERIFY_BITS(b[8], 30);\n    VERIFY_BITS(b[9], 26);\n\n    /** [... a b c] is a shorthand for ... + a<<52 + b<<26 + c<<0 mod n.\n     *  px is a shorthand for sum(a[i]*b[x-i], i=0..x).\n     *  Note that [x 0 0 0 0 0 0 0 0 0 0] = [x*R1 x*R0].\n     */\n\n    d  = (uint64_t)a[0] * b[9]\n       + (uint64_t)a[1] * b[8]\n       + (uint64_t)a[2] * b[7]\n       + (uint64_t)a[3] * b[6]\n       + (uint64_t)a[4] * b[5]\n       + (uint64_t)a[5] * b[4]\n       + (uint64_t)a[6] * b[3]\n       + (uint64_t)a[7] * b[2]\n       + (uint64_t)a[8] * b[1]\n       + (uint64_t)a[9] * b[0];\n    /* VERIFY_BITS(d, 64); */\n    /* [d 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */\n    t9 = d & M; d >>= 26;\n    VERIFY_BITS(t9, 26);\n    VERIFY_BITS(d, 38);\n    /* [d t9 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */\n\n    c  = (uint64_t)a[0] * b[0];\n    VERIFY_BITS(c, 60);\n    /* [d t9 0 0 0 0 0 0 0 0 c] = [p9 0 0 0 0 0 0 0 0 p0] */\n    d += (uint64_t)a[1] * b[9]\n       + (uint64_t)a[2] * b[8]\n       + (uint64_t)a[3] * b[7]\n       + (uint64_t)a[4] * b[6]\n       + (uint64_t)a[5] * b[5]\n       + (uint64_t)a[6] * b[4]\n       + (uint64_t)a[7] * b[3]\n       + (uint64_t)a[8] * b[2]\n       + (uint64_t)a[9] * b[1];\n    VERIFY_BITS(d, 63);\n    /* [d t9 0 0 0 0 0 0 0 0 c] = [p10 p9 0 0 0 0 0 0 0 0 p0] */\n    u0 = d & M; d >>= 26; c += u0 * R0;\n    VERIFY_BITS(u0, 26);\n    VERIFY_BITS(d, 37);\n    VERIFY_BITS(c, 61);\n    /* [d u0 t9 0 0 0 0 0 0 0 0 c-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */\n    t0 = c & M; c >>= 26; c += u0 * R1;\n    VERIFY_BITS(t0, 26);\n    VERIFY_BITS(c, 37);\n    /* [d u0 t9 0 0 0 0 0 0 0 c-u0*R1 t0-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */\n    /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */\n\n    c += (uint64_t)a[0] * b[1]\n       + (uint64_t)a[1] * b[0];\n    VERIFY_BITS(c, 62);\n    /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 p1 p0] */\n    d += (uint64_t)a[2] * b[9]\n       + (uint64_t)a[3] * b[8]\n       + (uint64_t)a[4] * b[7]\n       + (uint64_t)a[5] * b[6]\n       + (uint64_t)a[6] * b[5]\n       + (uint64_t)a[7] * b[4]\n       + (uint64_t)a[8] * b[3]\n       + (uint64_t)a[9] * b[2];\n    VERIFY_BITS(d, 63);\n    /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */\n    u1 = d & M; d >>= 26; c += u1 * R0;\n    VERIFY_BITS(u1, 26);\n    VERIFY_BITS(d, 37);\n    VERIFY_BITS(c, 63);\n    /* [d u1 0 t9 0 0 0 0 0 0 0 c-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */\n    t1 = c & M; c >>= 26; c += u1 * R1;\n    VERIFY_BITS(t1, 26);\n    VERIFY_BITS(c, 38);\n    /* [d u1 0 t9 0 0 0 0 0 0 c-u1*R1 t1-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */\n    /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */\n\n    c += (uint64_t)a[0] * b[2]\n       + (uint64_t)a[1] * b[1]\n       + (uint64_t)a[2] * b[0];\n    VERIFY_BITS(c, 62);\n    /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */\n    d += (uint64_t)a[3] * b[9]\n       + (uint64_t)a[4] * b[8]\n       + (uint64_t)a[5] * b[7]\n       + (uint64_t)a[6] * b[6]\n       + (uint64_t)a[7] * b[5]\n       + (uint64_t)a[8] * b[4]\n       + (uint64_t)a[9] * b[3];\n    VERIFY_BITS(d, 63);\n    /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */\n    u2 = d & M; d >>= 26; c += u2 * R0;\n    VERIFY_BITS(u2, 26);\n    VERIFY_BITS(d, 37);\n    VERIFY_BITS(c, 63);\n    /* [d u2 0 0 t9 0 0 0 0 0 0 c-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */\n    t2 = c & M; c >>= 26; c += u2 * R1;\n    VERIFY_BITS(t2, 26);\n    VERIFY_BITS(c, 38);\n    /* [d u2 0 0 t9 0 0 0 0 0 c-u2*R1 t2-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */\n    /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */\n\n    c += (uint64_t)a[0] * b[3]\n       + (uint64_t)a[1] * b[2]\n       + (uint64_t)a[2] * b[1]\n       + (uint64_t)a[3] * b[0];\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */\n    d += (uint64_t)a[4] * b[9]\n       + (uint64_t)a[5] * b[8]\n       + (uint64_t)a[6] * b[7]\n       + (uint64_t)a[7] * b[6]\n       + (uint64_t)a[8] * b[5]\n       + (uint64_t)a[9] * b[4];\n    VERIFY_BITS(d, 63);\n    /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */\n    u3 = d & M; d >>= 26; c += u3 * R0;\n    VERIFY_BITS(u3, 26);\n    VERIFY_BITS(d, 37);\n    /* VERIFY_BITS(c, 64); */\n    /* [d u3 0 0 0 t9 0 0 0 0 0 c-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */\n    t3 = c & M; c >>= 26; c += u3 * R1;\n    VERIFY_BITS(t3, 26);\n    VERIFY_BITS(c, 39);\n    /* [d u3 0 0 0 t9 0 0 0 0 c-u3*R1 t3-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */\n\n    c += (uint64_t)a[0] * b[4]\n       + (uint64_t)a[1] * b[3]\n       + (uint64_t)a[2] * b[2]\n       + (uint64_t)a[3] * b[1]\n       + (uint64_t)a[4] * b[0];\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */\n    d += (uint64_t)a[5] * b[9]\n       + (uint64_t)a[6] * b[8]\n       + (uint64_t)a[7] * b[7]\n       + (uint64_t)a[8] * b[6]\n       + (uint64_t)a[9] * b[5];\n    VERIFY_BITS(d, 62);\n    /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */\n    u4 = d & M; d >>= 26; c += u4 * R0;\n    VERIFY_BITS(u4, 26);\n    VERIFY_BITS(d, 36);\n    /* VERIFY_BITS(c, 64); */\n    /* [d u4 0 0 0 0 t9 0 0 0 0 c-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */\n    t4 = c & M; c >>= 26; c += u4 * R1;\n    VERIFY_BITS(t4, 26);\n    VERIFY_BITS(c, 39);\n    /* [d u4 0 0 0 0 t9 0 0 0 c-u4*R1 t4-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */\n\n    c += (uint64_t)a[0] * b[5]\n       + (uint64_t)a[1] * b[4]\n       + (uint64_t)a[2] * b[3]\n       + (uint64_t)a[3] * b[2]\n       + (uint64_t)a[4] * b[1]\n       + (uint64_t)a[5] * b[0];\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */\n    d += (uint64_t)a[6] * b[9]\n       + (uint64_t)a[7] * b[8]\n       + (uint64_t)a[8] * b[7]\n       + (uint64_t)a[9] * b[6];\n    VERIFY_BITS(d, 62);\n    /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */\n    u5 = d & M; d >>= 26; c += u5 * R0;\n    VERIFY_BITS(u5, 26);\n    VERIFY_BITS(d, 36);\n    /* VERIFY_BITS(c, 64); */\n    /* [d u5 0 0 0 0 0 t9 0 0 0 c-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */\n    t5 = c & M; c >>= 26; c += u5 * R1;\n    VERIFY_BITS(t5, 26);\n    VERIFY_BITS(c, 39);\n    /* [d u5 0 0 0 0 0 t9 0 0 c-u5*R1 t5-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */\n\n    c += (uint64_t)a[0] * b[6]\n       + (uint64_t)a[1] * b[5]\n       + (uint64_t)a[2] * b[4]\n       + (uint64_t)a[3] * b[3]\n       + (uint64_t)a[4] * b[2]\n       + (uint64_t)a[5] * b[1]\n       + (uint64_t)a[6] * b[0];\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */\n    d += (uint64_t)a[7] * b[9]\n       + (uint64_t)a[8] * b[8]\n       + (uint64_t)a[9] * b[7];\n    VERIFY_BITS(d, 61);\n    /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */\n    u6 = d & M; d >>= 26; c += u6 * R0;\n    VERIFY_BITS(u6, 26);\n    VERIFY_BITS(d, 35);\n    /* VERIFY_BITS(c, 64); */\n    /* [d u6 0 0 0 0 0 0 t9 0 0 c-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */\n    t6 = c & M; c >>= 26; c += u6 * R1;\n    VERIFY_BITS(t6, 26);\n    VERIFY_BITS(c, 39);\n    /* [d u6 0 0 0 0 0 0 t9 0 c-u6*R1 t6-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */\n\n    c += (uint64_t)a[0] * b[7]\n       + (uint64_t)a[1] * b[6]\n       + (uint64_t)a[2] * b[5]\n       + (uint64_t)a[3] * b[4]\n       + (uint64_t)a[4] * b[3]\n       + (uint64_t)a[5] * b[2]\n       + (uint64_t)a[6] * b[1]\n       + (uint64_t)a[7] * b[0];\n    /* VERIFY_BITS(c, 64); */\n    VERIFY_CHECK(c <= 0x8000007C00000007ULL);\n    /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */\n    d += (uint64_t)a[8] * b[9]\n       + (uint64_t)a[9] * b[8];\n    VERIFY_BITS(d, 58);\n    /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */\n    u7 = d & M; d >>= 26; c += u7 * R0;\n    VERIFY_BITS(u7, 26);\n    VERIFY_BITS(d, 32);\n    /* VERIFY_BITS(c, 64); */\n    VERIFY_CHECK(c <= 0x800001703FFFC2F7ULL);\n    /* [d u7 0 0 0 0 0 0 0 t9 0 c-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */\n    t7 = c & M; c >>= 26; c += u7 * R1;\n    VERIFY_BITS(t7, 26);\n    VERIFY_BITS(c, 38);\n    /* [d u7 0 0 0 0 0 0 0 t9 c-u7*R1 t7-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */\n\n    c += (uint64_t)a[0] * b[8]\n       + (uint64_t)a[1] * b[7]\n       + (uint64_t)a[2] * b[6]\n       + (uint64_t)a[3] * b[5]\n       + (uint64_t)a[4] * b[4]\n       + (uint64_t)a[5] * b[3]\n       + (uint64_t)a[6] * b[2]\n       + (uint64_t)a[7] * b[1]\n       + (uint64_t)a[8] * b[0];\n    /* VERIFY_BITS(c, 64); */\n    VERIFY_CHECK(c <= 0x9000007B80000008ULL);\n    /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    d += (uint64_t)a[9] * b[9];\n    VERIFY_BITS(d, 57);\n    /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    u8 = d & M; d >>= 26; c += u8 * R0;\n    VERIFY_BITS(u8, 26);\n    VERIFY_BITS(d, 31);\n    /* VERIFY_BITS(c, 64); */\n    VERIFY_CHECK(c <= 0x9000016FBFFFC2F8ULL);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n\n    r[3] = t3;\n    VERIFY_BITS(r[3], 26);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[4] = t4;\n    VERIFY_BITS(r[4], 26);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[5] = t5;\n    VERIFY_BITS(r[5], 26);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[6] = t6;\n    VERIFY_BITS(r[6], 26);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[7] = t7;\n    VERIFY_BITS(r[7], 26);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n\n    r[8] = c & M; c >>= 26; c += u8 * R1;\n    VERIFY_BITS(r[8], 26);\n    VERIFY_BITS(c, 39);\n    /* [d u8 0 0 0 0 0 0 0 0 t9+c-u8*R1 r8-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 0 0 0 0 t9+c r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    c   += d * R0 + t9;\n    VERIFY_BITS(c, 45);\n    /* [d 0 0 0 0 0 0 0 0 0 c-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[9] = c & (M >> 4); c >>= 22; c += d * (R1 << 4);\n    VERIFY_BITS(r[9], 22);\n    VERIFY_BITS(c, 46);\n    /* [d 0 0 0 0 0 0 0 0 r9+((c-d*R1<<4)<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 0 0 -d*R1 r9+(c<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n\n    d    = c * (R0 >> 4) + t0;\n    VERIFY_BITS(d, 56);\n    /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 d-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[0] = d & M; d >>= 26;\n    VERIFY_BITS(r[0], 26);\n    VERIFY_BITS(d, 30);\n    /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1+d r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    d   += c * (R1 >> 4) + t1;\n    VERIFY_BITS(d, 53);\n    VERIFY_CHECK(d <= 0x10000003FFFFBFULL);\n    /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 d-c*R1>>4 r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    /* [r9 r8 r7 r6 r5 r4 r3 t2 d r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[1] = d & M; d >>= 26;\n    VERIFY_BITS(r[1], 26);\n    VERIFY_BITS(d, 27);\n    VERIFY_CHECK(d <= 0x4000000ULL);\n    /* [r9 r8 r7 r6 r5 r4 r3 t2+d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    d   += t2;\n    VERIFY_BITS(d, 27);\n    /* [r9 r8 r7 r6 r5 r4 r3 d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[2] = d;\n    VERIFY_BITS(r[2], 27);\n    /* [r9 r8 r7 r6 r5 r4 r3 r2 r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n}\n\nSECP256K1_INLINE static void secp256k1_fe_sqr_inner(uint32_t *r, const uint32_t *a) {\n    uint64_t c, d;\n    uint64_t u0, u1, u2, u3, u4, u5, u6, u7, u8;\n    uint32_t t9, t0, t1, t2, t3, t4, t5, t6, t7;\n    const uint32_t M = 0x3FFFFFFUL, R0 = 0x3D10UL, R1 = 0x400UL;\n\n    VERIFY_BITS(a[0], 30);\n    VERIFY_BITS(a[1], 30);\n    VERIFY_BITS(a[2], 30);\n    VERIFY_BITS(a[3], 30);\n    VERIFY_BITS(a[4], 30);\n    VERIFY_BITS(a[5], 30);\n    VERIFY_BITS(a[6], 30);\n    VERIFY_BITS(a[7], 30);\n    VERIFY_BITS(a[8], 30);\n    VERIFY_BITS(a[9], 26);\n\n    /** [... a b c] is a shorthand for ... + a<<52 + b<<26 + c<<0 mod n.\n     *  px is a shorthand for sum(a[i]*a[x-i], i=0..x).\n     *  Note that [x 0 0 0 0 0 0 0 0 0 0] = [x*R1 x*R0].\n     */\n\n    d  = (uint64_t)(a[0]*2) * a[9]\n       + (uint64_t)(a[1]*2) * a[8]\n       + (uint64_t)(a[2]*2) * a[7]\n       + (uint64_t)(a[3]*2) * a[6]\n       + (uint64_t)(a[4]*2) * a[5];\n    /* VERIFY_BITS(d, 64); */\n    /* [d 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */\n    t9 = d & M; d >>= 26;\n    VERIFY_BITS(t9, 26);\n    VERIFY_BITS(d, 38);\n    /* [d t9 0 0 0 0 0 0 0 0 0] = [p9 0 0 0 0 0 0 0 0 0] */\n\n    c  = (uint64_t)a[0] * a[0];\n    VERIFY_BITS(c, 60);\n    /* [d t9 0 0 0 0 0 0 0 0 c] = [p9 0 0 0 0 0 0 0 0 p0] */\n    d += (uint64_t)(a[1]*2) * a[9]\n       + (uint64_t)(a[2]*2) * a[8]\n       + (uint64_t)(a[3]*2) * a[7]\n       + (uint64_t)(a[4]*2) * a[6]\n       + (uint64_t)a[5] * a[5];\n    VERIFY_BITS(d, 63);\n    /* [d t9 0 0 0 0 0 0 0 0 c] = [p10 p9 0 0 0 0 0 0 0 0 p0] */\n    u0 = d & M; d >>= 26; c += u0 * R0;\n    VERIFY_BITS(u0, 26);\n    VERIFY_BITS(d, 37);\n    VERIFY_BITS(c, 61);\n    /* [d u0 t9 0 0 0 0 0 0 0 0 c-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */\n    t0 = c & M; c >>= 26; c += u0 * R1;\n    VERIFY_BITS(t0, 26);\n    VERIFY_BITS(c, 37);\n    /* [d u0 t9 0 0 0 0 0 0 0 c-u0*R1 t0-u0*R0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */\n    /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 0 p0] */\n\n    c += (uint64_t)(a[0]*2) * a[1];\n    VERIFY_BITS(c, 62);\n    /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p10 p9 0 0 0 0 0 0 0 p1 p0] */\n    d += (uint64_t)(a[2]*2) * a[9]\n       + (uint64_t)(a[3]*2) * a[8]\n       + (uint64_t)(a[4]*2) * a[7]\n       + (uint64_t)(a[5]*2) * a[6];\n    VERIFY_BITS(d, 63);\n    /* [d 0 t9 0 0 0 0 0 0 0 c t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */\n    u1 = d & M; d >>= 26; c += u1 * R0;\n    VERIFY_BITS(u1, 26);\n    VERIFY_BITS(d, 37);\n    VERIFY_BITS(c, 63);\n    /* [d u1 0 t9 0 0 0 0 0 0 0 c-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */\n    t1 = c & M; c >>= 26; c += u1 * R1;\n    VERIFY_BITS(t1, 26);\n    VERIFY_BITS(c, 38);\n    /* [d u1 0 t9 0 0 0 0 0 0 c-u1*R1 t1-u1*R0 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */\n    /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 0 p1 p0] */\n\n    c += (uint64_t)(a[0]*2) * a[2]\n       + (uint64_t)a[1] * a[1];\n    VERIFY_BITS(c, 62);\n    /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */\n    d += (uint64_t)(a[3]*2) * a[9]\n       + (uint64_t)(a[4]*2) * a[8]\n       + (uint64_t)(a[5]*2) * a[7]\n       + (uint64_t)a[6] * a[6];\n    VERIFY_BITS(d, 63);\n    /* [d 0 0 t9 0 0 0 0 0 0 c t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */\n    u2 = d & M; d >>= 26; c += u2 * R0;\n    VERIFY_BITS(u2, 26);\n    VERIFY_BITS(d, 37);\n    VERIFY_BITS(c, 63);\n    /* [d u2 0 0 t9 0 0 0 0 0 0 c-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */\n    t2 = c & M; c >>= 26; c += u2 * R1;\n    VERIFY_BITS(t2, 26);\n    VERIFY_BITS(c, 38);\n    /* [d u2 0 0 t9 0 0 0 0 0 c-u2*R1 t2-u2*R0 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */\n    /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 0 p2 p1 p0] */\n\n    c += (uint64_t)(a[0]*2) * a[3]\n       + (uint64_t)(a[1]*2) * a[2];\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */\n    d += (uint64_t)(a[4]*2) * a[9]\n       + (uint64_t)(a[5]*2) * a[8]\n       + (uint64_t)(a[6]*2) * a[7];\n    VERIFY_BITS(d, 63);\n    /* [d 0 0 0 t9 0 0 0 0 0 c t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */\n    u3 = d & M; d >>= 26; c += u3 * R0;\n    VERIFY_BITS(u3, 26);\n    VERIFY_BITS(d, 37);\n    /* VERIFY_BITS(c, 64); */\n    /* [d u3 0 0 0 t9 0 0 0 0 0 c-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */\n    t3 = c & M; c >>= 26; c += u3 * R1;\n    VERIFY_BITS(t3, 26);\n    VERIFY_BITS(c, 39);\n    /* [d u3 0 0 0 t9 0 0 0 0 c-u3*R1 t3-u3*R0 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 0 p3 p2 p1 p0] */\n\n    c += (uint64_t)(a[0]*2) * a[4]\n       + (uint64_t)(a[1]*2) * a[3]\n       + (uint64_t)a[2] * a[2];\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */\n    d += (uint64_t)(a[5]*2) * a[9]\n       + (uint64_t)(a[6]*2) * a[8]\n       + (uint64_t)a[7] * a[7];\n    VERIFY_BITS(d, 62);\n    /* [d 0 0 0 0 t9 0 0 0 0 c t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */\n    u4 = d & M; d >>= 26; c += u4 * R0;\n    VERIFY_BITS(u4, 26);\n    VERIFY_BITS(d, 36);\n    /* VERIFY_BITS(c, 64); */\n    /* [d u4 0 0 0 0 t9 0 0 0 0 c-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */\n    t4 = c & M; c >>= 26; c += u4 * R1;\n    VERIFY_BITS(t4, 26);\n    VERIFY_BITS(c, 39);\n    /* [d u4 0 0 0 0 t9 0 0 0 c-u4*R1 t4-u4*R0 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 0 p4 p3 p2 p1 p0] */\n\n    c += (uint64_t)(a[0]*2) * a[5]\n       + (uint64_t)(a[1]*2) * a[4]\n       + (uint64_t)(a[2]*2) * a[3];\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */\n    d += (uint64_t)(a[6]*2) * a[9]\n       + (uint64_t)(a[7]*2) * a[8];\n    VERIFY_BITS(d, 62);\n    /* [d 0 0 0 0 0 t9 0 0 0 c t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */\n    u5 = d & M; d >>= 26; c += u5 * R0;\n    VERIFY_BITS(u5, 26);\n    VERIFY_BITS(d, 36);\n    /* VERIFY_BITS(c, 64); */\n    /* [d u5 0 0 0 0 0 t9 0 0 0 c-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */\n    t5 = c & M; c >>= 26; c += u5 * R1;\n    VERIFY_BITS(t5, 26);\n    VERIFY_BITS(c, 39);\n    /* [d u5 0 0 0 0 0 t9 0 0 c-u5*R1 t5-u5*R0 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 0 p5 p4 p3 p2 p1 p0] */\n\n    c += (uint64_t)(a[0]*2) * a[6]\n       + (uint64_t)(a[1]*2) * a[5]\n       + (uint64_t)(a[2]*2) * a[4]\n       + (uint64_t)a[3] * a[3];\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */\n    d += (uint64_t)(a[7]*2) * a[9]\n       + (uint64_t)a[8] * a[8];\n    VERIFY_BITS(d, 61);\n    /* [d 0 0 0 0 0 0 t9 0 0 c t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */\n    u6 = d & M; d >>= 26; c += u6 * R0;\n    VERIFY_BITS(u6, 26);\n    VERIFY_BITS(d, 35);\n    /* VERIFY_BITS(c, 64); */\n    /* [d u6 0 0 0 0 0 0 t9 0 0 c-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */\n    t6 = c & M; c >>= 26; c += u6 * R1;\n    VERIFY_BITS(t6, 26);\n    VERIFY_BITS(c, 39);\n    /* [d u6 0 0 0 0 0 0 t9 0 c-u6*R1 t6-u6*R0 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 0 p6 p5 p4 p3 p2 p1 p0] */\n\n    c += (uint64_t)(a[0]*2) * a[7]\n       + (uint64_t)(a[1]*2) * a[6]\n       + (uint64_t)(a[2]*2) * a[5]\n       + (uint64_t)(a[3]*2) * a[4];\n    /* VERIFY_BITS(c, 64); */\n    VERIFY_CHECK(c <= 0x8000007C00000007ULL);\n    /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */\n    d += (uint64_t)(a[8]*2) * a[9];\n    VERIFY_BITS(d, 58);\n    /* [d 0 0 0 0 0 0 0 t9 0 c t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */\n    u7 = d & M; d >>= 26; c += u7 * R0;\n    VERIFY_BITS(u7, 26);\n    VERIFY_BITS(d, 32);\n    /* VERIFY_BITS(c, 64); */\n    VERIFY_CHECK(c <= 0x800001703FFFC2F7ULL);\n    /* [d u7 0 0 0 0 0 0 0 t9 0 c-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */\n    t7 = c & M; c >>= 26; c += u7 * R1;\n    VERIFY_BITS(t7, 26);\n    VERIFY_BITS(c, 38);\n    /* [d u7 0 0 0 0 0 0 0 t9 c-u7*R1 t7-u7*R0 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 0 p7 p6 p5 p4 p3 p2 p1 p0] */\n\n    c += (uint64_t)(a[0]*2) * a[8]\n       + (uint64_t)(a[1]*2) * a[7]\n       + (uint64_t)(a[2]*2) * a[6]\n       + (uint64_t)(a[3]*2) * a[5]\n       + (uint64_t)a[4] * a[4];\n    /* VERIFY_BITS(c, 64); */\n    VERIFY_CHECK(c <= 0x9000007B80000008ULL);\n    /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    d += (uint64_t)a[9] * a[9];\n    VERIFY_BITS(d, 57);\n    /* [d 0 0 0 0 0 0 0 0 t9 c t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    u8 = d & M; d >>= 26; c += u8 * R0;\n    VERIFY_BITS(u8, 26);\n    VERIFY_BITS(d, 31);\n    /* VERIFY_BITS(c, 64); */\n    VERIFY_CHECK(c <= 0x9000016FBFFFC2F8ULL);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 t3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n\n    r[3] = t3;\n    VERIFY_BITS(r[3], 26);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 t4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[4] = t4;\n    VERIFY_BITS(r[4], 26);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 t5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[5] = t5;\n    VERIFY_BITS(r[5], 26);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 t6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[6] = t6;\n    VERIFY_BITS(r[6], 26);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 t7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[7] = t7;\n    VERIFY_BITS(r[7], 26);\n    /* [d u8 0 0 0 0 0 0 0 0 t9 c-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n\n    r[8] = c & M; c >>= 26; c += u8 * R1;\n    VERIFY_BITS(r[8], 26);\n    VERIFY_BITS(c, 39);\n    /* [d u8 0 0 0 0 0 0 0 0 t9+c-u8*R1 r8-u8*R0 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 0 0 0 0 t9+c r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    c   += d * R0 + t9;\n    VERIFY_BITS(c, 45);\n    /* [d 0 0 0 0 0 0 0 0 0 c-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[9] = c & (M >> 4); c >>= 22; c += d * (R1 << 4);\n    VERIFY_BITS(r[9], 22);\n    VERIFY_BITS(c, 46);\n    /* [d 0 0 0 0 0 0 0 0 r9+((c-d*R1<<4)<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    /* [d 0 0 0 0 0 0 0 -d*R1 r9+(c<<22)-d*R0 r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 t0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n\n    d    = c * (R0 >> 4) + t0;\n    VERIFY_BITS(d, 56);\n    /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1 d-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[0] = d & M; d >>= 26;\n    VERIFY_BITS(r[0], 26);\n    VERIFY_BITS(d, 30);\n    /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 t1+d r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    d   += c * (R1 >> 4) + t1;\n    VERIFY_BITS(d, 53);\n    VERIFY_CHECK(d <= 0x10000003FFFFBFULL);\n    /* [r9+(c<<22) r8 r7 r6 r5 r4 r3 t2 d-c*R1>>4 r0-c*R0>>4] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    /* [r9 r8 r7 r6 r5 r4 r3 t2 d r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[1] = d & M; d >>= 26;\n    VERIFY_BITS(r[1], 26);\n    VERIFY_BITS(d, 27);\n    VERIFY_CHECK(d <= 0x4000000ULL);\n    /* [r9 r8 r7 r6 r5 r4 r3 t2+d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    d   += t2;\n    VERIFY_BITS(d, 27);\n    /* [r9 r8 r7 r6 r5 r4 r3 d r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[2] = d;\n    VERIFY_BITS(r[2], 27);\n    /* [r9 r8 r7 r6 r5 r4 r3 r2 r1 r0] = [p18 p17 p16 p15 p14 p13 p12 p11 p10 p9 p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n}\n#endif\n\nstatic void secp256k1_fe_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->magnitude <= 8);\n    VERIFY_CHECK(b->magnitude <= 8);\n    secp256k1_fe_verify(a);\n    secp256k1_fe_verify(b);\n    VERIFY_CHECK(r != b);\n#endif\n    secp256k1_fe_mul_inner(r->n, a->n, b->n);\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 0;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic void secp256k1_fe_sqr(secp256k1_fe *r, const secp256k1_fe *a) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->magnitude <= 8);\n    secp256k1_fe_verify(a);\n#endif\n    secp256k1_fe_sqr_inner(r->n, a->n);\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 0;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic SECP256K1_INLINE void secp256k1_fe_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag) {\n    uint32_t mask0, mask1;\n    mask0 = flag + ~((uint32_t)0);\n    mask1 = ~mask0;\n    r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);\n    r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);\n    r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);\n    r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);\n    r->n[4] = (r->n[4] & mask0) | (a->n[4] & mask1);\n    r->n[5] = (r->n[5] & mask0) | (a->n[5] & mask1);\n    r->n[6] = (r->n[6] & mask0) | (a->n[6] & mask1);\n    r->n[7] = (r->n[7] & mask0) | (a->n[7] & mask1);\n    r->n[8] = (r->n[8] & mask0) | (a->n[8] & mask1);\n    r->n[9] = (r->n[9] & mask0) | (a->n[9] & mask1);\n#ifdef VERIFY\n    if (a->magnitude > r->magnitude) {\n        r->magnitude = a->magnitude;\n    }\n    r->normalized &= a->normalized;\n#endif\n}\n\nstatic SECP256K1_INLINE void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag) {\n    uint32_t mask0, mask1;\n    mask0 = flag + ~((uint32_t)0);\n    mask1 = ~mask0;\n    r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);\n    r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);\n    r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);\n    r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);\n    r->n[4] = (r->n[4] & mask0) | (a->n[4] & mask1);\n    r->n[5] = (r->n[5] & mask0) | (a->n[5] & mask1);\n    r->n[6] = (r->n[6] & mask0) | (a->n[6] & mask1);\n    r->n[7] = (r->n[7] & mask0) | (a->n[7] & mask1);\n}\n\nstatic void secp256k1_fe_to_storage(secp256k1_fe_storage *r, const secp256k1_fe *a) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->normalized);\n#endif\n    r->n[0] = a->n[0] | a->n[1] << 26;\n    r->n[1] = a->n[1] >> 6 | a->n[2] << 20;\n    r->n[2] = a->n[2] >> 12 | a->n[3] << 14;\n    r->n[3] = a->n[3] >> 18 | a->n[4] << 8;\n    r->n[4] = a->n[4] >> 24 | a->n[5] << 2 | a->n[6] << 28;\n    r->n[5] = a->n[6] >> 4 | a->n[7] << 22;\n    r->n[6] = a->n[7] >> 10 | a->n[8] << 16;\n    r->n[7] = a->n[8] >> 16 | a->n[9] << 10;\n}\n\nstatic SECP256K1_INLINE void secp256k1_fe_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a) {\n    r->n[0] = a->n[0] & 0x3FFFFFFUL;\n    r->n[1] = a->n[0] >> 26 | ((a->n[1] << 6) & 0x3FFFFFFUL);\n    r->n[2] = a->n[1] >> 20 | ((a->n[2] << 12) & 0x3FFFFFFUL);\n    r->n[3] = a->n[2] >> 14 | ((a->n[3] << 18) & 0x3FFFFFFUL);\n    r->n[4] = a->n[3] >> 8 | ((a->n[4] << 24) & 0x3FFFFFFUL);\n    r->n[5] = (a->n[4] >> 2) & 0x3FFFFFFUL;\n    r->n[6] = a->n[4] >> 28 | ((a->n[5] << 4) & 0x3FFFFFFUL);\n    r->n[7] = a->n[5] >> 22 | ((a->n[6] << 10) & 0x3FFFFFFUL);\n    r->n[8] = a->n[6] >> 16 | ((a->n[7] << 16) & 0x3FFFFFFUL);\n    r->n[9] = a->n[7] >> 10;\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 1;\n#endif\n}\n\n#endif /* SECP256K1_FIELD_REPR_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/field_5x52.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_FIELD_REPR_H\n#define SECP256K1_FIELD_REPR_H\n\n#include <stdint.h>\n\ntypedef struct {\n    /* X = sum(i=0..4, elem[i]*2^52) mod n */\n    uint64_t n[5];\n#ifdef VERIFY\n    int magnitude;\n    int normalized;\n#endif\n} secp256k1_fe;\n\n/* Unpacks a constant into a overlapping multi-limbed FE element. */\n#define SECP256K1_FE_CONST_INNER(d7, d6, d5, d4, d3, d2, d1, d0) { \\\n    (d0) | (((uint64_t)(d1) & 0xFFFFFUL) << 32), \\\n    ((uint64_t)(d1) >> 20) | (((uint64_t)(d2)) << 12) | (((uint64_t)(d3) & 0xFFUL) << 44), \\\n    ((uint64_t)(d3) >> 8) | (((uint64_t)(d4) & 0xFFFFFFFUL) << 24), \\\n    ((uint64_t)(d4) >> 28) | (((uint64_t)(d5)) << 4) | (((uint64_t)(d6) & 0xFFFFUL) << 36), \\\n    ((uint64_t)(d6) >> 16) | (((uint64_t)(d7)) << 16) \\\n}\n\n#ifdef VERIFY\n#define SECP256K1_FE_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {SECP256K1_FE_CONST_INNER((d7), (d6), (d5), (d4), (d3), (d2), (d1), (d0)), 1, 1}\n#else\n#define SECP256K1_FE_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {SECP256K1_FE_CONST_INNER((d7), (d6), (d5), (d4), (d3), (d2), (d1), (d0))}\n#endif\n\ntypedef struct {\n    uint64_t n[4];\n} secp256k1_fe_storage;\n\n#define SECP256K1_FE_STORAGE_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{ \\\n    (d0) | (((uint64_t)(d1)) << 32), \\\n    (d2) | (((uint64_t)(d3)) << 32), \\\n    (d4) | (((uint64_t)(d5)) << 32), \\\n    (d6) | (((uint64_t)(d7)) << 32) \\\n}}\n\n#endif /* SECP256K1_FIELD_REPR_H */\n"
  },
  {
    "path": "src/secp256k1/src/field_5x52_asm_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013-2014 Diederik Huys, Pieter Wuille               *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n/**\n * Changelog:\n * - March 2013, Diederik Huys:    original version\n * - November 2014, Pieter Wuille: updated to use Peter Dettman's parallel multiplication algorithm\n * - December 2014, Pieter Wuille: converted from YASM to GCC inline assembly\n */\n\n#ifndef SECP256K1_FIELD_INNER5X52_IMPL_H\n#define SECP256K1_FIELD_INNER5X52_IMPL_H\n\nSECP256K1_INLINE static void secp256k1_fe_mul_inner(uint64_t *r, const uint64_t *a, const uint64_t * SECP256K1_RESTRICT b) {\n/**\n * Registers: rdx:rax = multiplication accumulator\n *            r9:r8   = c\n *            r15:rcx = d\n *            r10-r14 = a0-a4\n *            rbx     = b\n *            rdi     = r\n *            rsi     = a / t?\n */\n  uint64_t tmp1, tmp2, tmp3;\n__asm__ __volatile__(\n    \"movq 0(%%rsi),%%r10\\n\"\n    \"movq 8(%%rsi),%%r11\\n\"\n    \"movq 16(%%rsi),%%r12\\n\"\n    \"movq 24(%%rsi),%%r13\\n\"\n    \"movq 32(%%rsi),%%r14\\n\"\n\n    /* d += a3 * b0 */\n    \"movq 0(%%rbx),%%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"movq %%rax,%%rcx\\n\"\n    \"movq %%rdx,%%r15\\n\"\n    /* d += a2 * b1 */\n    \"movq 8(%%rbx),%%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a1 * b2 */\n    \"movq 16(%%rbx),%%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d = a0 * b3 */\n    \"movq 24(%%rbx),%%rax\\n\"\n    \"mulq %%r10\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* c = a4 * b4 */\n    \"movq 32(%%rbx),%%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"movq %%rax,%%r8\\n\"\n    \"movq %%rdx,%%r9\\n\"\n    /* d += (c & M) * R */\n    \"movq $0xfffffffffffff,%%rdx\\n\"\n    \"andq %%rdx,%%rax\\n\"\n    \"movq $0x1000003d10,%%rdx\\n\"\n    \"mulq %%rdx\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* c >>= 52 (%%r8 only) */\n    \"shrdq $52,%%r9,%%r8\\n\"\n    /* t3 (tmp1) = d & M */\n    \"movq %%rcx,%%rsi\\n\"\n    \"movq $0xfffffffffffff,%%rdx\\n\"\n    \"andq %%rdx,%%rsi\\n\"\n    \"movq %%rsi,%q1\\n\"\n    /* d >>= 52 */\n    \"shrdq $52,%%r15,%%rcx\\n\"\n    \"xorq %%r15,%%r15\\n\"\n    /* d += a4 * b0 */\n    \"movq 0(%%rbx),%%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a3 * b1 */\n    \"movq 8(%%rbx),%%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a2 * b2 */\n    \"movq 16(%%rbx),%%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a1 * b3 */\n    \"movq 24(%%rbx),%%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a0 * b4 */\n    \"movq 32(%%rbx),%%rax\\n\"\n    \"mulq %%r10\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += c * R */\n    \"movq %%r8,%%rax\\n\"\n    \"movq $0x1000003d10,%%rdx\\n\"\n    \"mulq %%rdx\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* t4 = d & M (%%rsi) */\n    \"movq %%rcx,%%rsi\\n\"\n    \"movq $0xfffffffffffff,%%rdx\\n\"\n    \"andq %%rdx,%%rsi\\n\"\n    /* d >>= 52 */\n    \"shrdq $52,%%r15,%%rcx\\n\"\n    \"xorq %%r15,%%r15\\n\"\n    /* tx = t4 >> 48 (tmp3) */\n    \"movq %%rsi,%%rax\\n\"\n    \"shrq $48,%%rax\\n\"\n    \"movq %%rax,%q3\\n\"\n    /* t4 &= (M >> 4) (tmp2) */\n    \"movq $0xffffffffffff,%%rax\\n\"\n    \"andq %%rax,%%rsi\\n\"\n    \"movq %%rsi,%q2\\n\"\n    /* c = a0 * b0 */\n    \"movq 0(%%rbx),%%rax\\n\"\n    \"mulq %%r10\\n\"\n    \"movq %%rax,%%r8\\n\"\n    \"movq %%rdx,%%r9\\n\"\n    /* d += a4 * b1 */\n    \"movq 8(%%rbx),%%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a3 * b2 */\n    \"movq 16(%%rbx),%%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a2 * b3 */\n    \"movq 24(%%rbx),%%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a1 * b4 */\n    \"movq 32(%%rbx),%%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* u0 = d & M (%%rsi) */\n    \"movq %%rcx,%%rsi\\n\"\n    \"movq $0xfffffffffffff,%%rdx\\n\"\n    \"andq %%rdx,%%rsi\\n\"\n    /* d >>= 52 */\n    \"shrdq $52,%%r15,%%rcx\\n\"\n    \"xorq %%r15,%%r15\\n\"\n    /* u0 = (u0 << 4) | tx (%%rsi) */\n    \"shlq $4,%%rsi\\n\"\n    \"movq %q3,%%rax\\n\"\n    \"orq %%rax,%%rsi\\n\"\n    /* c += u0 * (R >> 4) */\n    \"movq $0x1000003d1,%%rax\\n\"\n    \"mulq %%rsi\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* r[0] = c & M */\n    \"movq %%r8,%%rax\\n\"\n    \"movq $0xfffffffffffff,%%rdx\\n\"\n    \"andq %%rdx,%%rax\\n\"\n    \"movq %%rax,0(%%rdi)\\n\"\n    /* c >>= 52 */\n    \"shrdq $52,%%r9,%%r8\\n\"\n    \"xorq %%r9,%%r9\\n\"\n    /* c += a1 * b0 */\n    \"movq 0(%%rbx),%%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* c += a0 * b1 */\n    \"movq 8(%%rbx),%%rax\\n\"\n    \"mulq %%r10\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* d += a4 * b2 */\n    \"movq 16(%%rbx),%%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a3 * b3 */\n    \"movq 24(%%rbx),%%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a2 * b4 */\n    \"movq 32(%%rbx),%%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* c += (d & M) * R */\n    \"movq %%rcx,%%rax\\n\"\n    \"movq $0xfffffffffffff,%%rdx\\n\"\n    \"andq %%rdx,%%rax\\n\"\n    \"movq $0x1000003d10,%%rdx\\n\"\n    \"mulq %%rdx\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* d >>= 52 */\n    \"shrdq $52,%%r15,%%rcx\\n\"\n    \"xorq %%r15,%%r15\\n\"\n    /* r[1] = c & M */\n    \"movq %%r8,%%rax\\n\"\n    \"movq $0xfffffffffffff,%%rdx\\n\"\n    \"andq %%rdx,%%rax\\n\"\n    \"movq %%rax,8(%%rdi)\\n\"\n    /* c >>= 52 */\n    \"shrdq $52,%%r9,%%r8\\n\"\n    \"xorq %%r9,%%r9\\n\"\n    /* c += a2 * b0 */\n    \"movq 0(%%rbx),%%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* c += a1 * b1 */\n    \"movq 8(%%rbx),%%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* c += a0 * b2 (last use of %%r10 = a0) */\n    \"movq 16(%%rbx),%%rax\\n\"\n    \"mulq %%r10\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* fetch t3 (%%r10, overwrites a0), t4 (%%rsi) */\n    \"movq %q2,%%rsi\\n\"\n    \"movq %q1,%%r10\\n\"\n    /* d += a4 * b3 */\n    \"movq 24(%%rbx),%%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* d += a3 * b4 */\n    \"movq 32(%%rbx),%%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax,%%rcx\\n\"\n    \"adcq %%rdx,%%r15\\n\"\n    /* c += (d & M) * R */\n    \"movq %%rcx,%%rax\\n\"\n    \"movq $0xfffffffffffff,%%rdx\\n\"\n    \"andq %%rdx,%%rax\\n\"\n    \"movq $0x1000003d10,%%rdx\\n\"\n    \"mulq %%rdx\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* d >>= 52 (%%rcx only) */\n    \"shrdq $52,%%r15,%%rcx\\n\"\n    /* r[2] = c & M */\n    \"movq %%r8,%%rax\\n\"\n    \"movq $0xfffffffffffff,%%rdx\\n\"\n    \"andq %%rdx,%%rax\\n\"\n    \"movq %%rax,16(%%rdi)\\n\"\n    /* c >>= 52 */\n    \"shrdq $52,%%r9,%%r8\\n\"\n    \"xorq %%r9,%%r9\\n\"\n    /* c += t3 */\n    \"addq %%r10,%%r8\\n\"\n    /* c += d * R */\n    \"movq %%rcx,%%rax\\n\"\n    \"movq $0x1000003d10,%%rdx\\n\"\n    \"mulq %%rdx\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* r[3] = c & M */\n    \"movq %%r8,%%rax\\n\"\n    \"movq $0xfffffffffffff,%%rdx\\n\"\n    \"andq %%rdx,%%rax\\n\"\n    \"movq %%rax,24(%%rdi)\\n\"\n    /* c >>= 52 (%%r8 only) */\n    \"shrdq $52,%%r9,%%r8\\n\"\n    /* c += t4 (%%r8 only) */\n    \"addq %%rsi,%%r8\\n\"\n    /* r[4] = c */\n    \"movq %%r8,32(%%rdi)\\n\"\n: \"+S\"(a), \"=m\"(tmp1), \"=m\"(tmp2), \"=m\"(tmp3)\n: \"b\"(b), \"D\"(r)\n: \"%rax\", \"%rcx\", \"%rdx\", \"%r8\", \"%r9\", \"%r10\", \"%r11\", \"%r12\", \"%r13\", \"%r14\", \"%r15\", \"cc\", \"memory\"\n);\n}\n\nSECP256K1_INLINE static void secp256k1_fe_sqr_inner(uint64_t *r, const uint64_t *a) {\n/**\n * Registers: rdx:rax = multiplication accumulator\n *            r9:r8   = c\n *            rcx:rbx = d\n *            r10-r14 = a0-a4\n *            r15     = M (0xfffffffffffff)\n *            rdi     = r\n *            rsi     = a / t?\n */\n  uint64_t tmp1, tmp2, tmp3;\n__asm__ __volatile__(\n    \"movq 0(%%rsi),%%r10\\n\"\n    \"movq 8(%%rsi),%%r11\\n\"\n    \"movq 16(%%rsi),%%r12\\n\"\n    \"movq 24(%%rsi),%%r13\\n\"\n    \"movq 32(%%rsi),%%r14\\n\"\n    \"movq $0xfffffffffffff,%%r15\\n\"\n\n    /* d = (a0*2) * a3 */\n    \"leaq (%%r10,%%r10,1),%%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"movq %%rax,%%rbx\\n\"\n    \"movq %%rdx,%%rcx\\n\"\n    /* d += (a1*2) * a2 */\n    \"leaq (%%r11,%%r11,1),%%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* c = a4 * a4 */\n    \"movq %%r14,%%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"movq %%rax,%%r8\\n\"\n    \"movq %%rdx,%%r9\\n\"\n    /* d += (c & M) * R */\n    \"andq %%r15,%%rax\\n\"\n    \"movq $0x1000003d10,%%rdx\\n\"\n    \"mulq %%rdx\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* c >>= 52 (%%r8 only) */\n    \"shrdq $52,%%r9,%%r8\\n\"\n    /* t3 (tmp1) = d & M */\n    \"movq %%rbx,%%rsi\\n\"\n    \"andq %%r15,%%rsi\\n\"\n    \"movq %%rsi,%q1\\n\"\n    /* d >>= 52 */\n    \"shrdq $52,%%rcx,%%rbx\\n\"\n    \"xorq %%rcx,%%rcx\\n\"\n    /* a4 *= 2 */\n    \"addq %%r14,%%r14\\n\"\n    /* d += a0 * a4 */\n    \"movq %%r10,%%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* d+= (a1*2) * a3 */\n    \"leaq (%%r11,%%r11,1),%%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* d += a2 * a2 */\n    \"movq %%r12,%%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* d += c * R */\n    \"movq %%r8,%%rax\\n\"\n    \"movq $0x1000003d10,%%rdx\\n\"\n    \"mulq %%rdx\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* t4 = d & M (%%rsi) */\n    \"movq %%rbx,%%rsi\\n\"\n    \"andq %%r15,%%rsi\\n\"\n    /* d >>= 52 */\n    \"shrdq $52,%%rcx,%%rbx\\n\"\n    \"xorq %%rcx,%%rcx\\n\"\n    /* tx = t4 >> 48 (tmp3) */\n    \"movq %%rsi,%%rax\\n\"\n    \"shrq $48,%%rax\\n\"\n    \"movq %%rax,%q3\\n\"\n    /* t4 &= (M >> 4) (tmp2) */\n    \"movq $0xffffffffffff,%%rax\\n\"\n    \"andq %%rax,%%rsi\\n\"\n    \"movq %%rsi,%q2\\n\"\n    /* c = a0 * a0 */\n    \"movq %%r10,%%rax\\n\"\n    \"mulq %%r10\\n\"\n    \"movq %%rax,%%r8\\n\"\n    \"movq %%rdx,%%r9\\n\"\n    /* d += a1 * a4 */\n    \"movq %%r11,%%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* d += (a2*2) * a3 */\n    \"leaq (%%r12,%%r12,1),%%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* u0 = d & M (%%rsi) */\n    \"movq %%rbx,%%rsi\\n\"\n    \"andq %%r15,%%rsi\\n\"\n    /* d >>= 52 */\n    \"shrdq $52,%%rcx,%%rbx\\n\"\n    \"xorq %%rcx,%%rcx\\n\"\n    /* u0 = (u0 << 4) | tx (%%rsi) */\n    \"shlq $4,%%rsi\\n\"\n    \"movq %q3,%%rax\\n\"\n    \"orq %%rax,%%rsi\\n\"\n    /* c += u0 * (R >> 4) */\n    \"movq $0x1000003d1,%%rax\\n\"\n    \"mulq %%rsi\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* r[0] = c & M */\n    \"movq %%r8,%%rax\\n\"\n    \"andq %%r15,%%rax\\n\"\n    \"movq %%rax,0(%%rdi)\\n\"\n    /* c >>= 52 */\n    \"shrdq $52,%%r9,%%r8\\n\"\n    \"xorq %%r9,%%r9\\n\"\n    /* a0 *= 2 */\n    \"addq %%r10,%%r10\\n\"\n    /* c += a0 * a1 */\n    \"movq %%r10,%%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* d += a2 * a4 */\n    \"movq %%r12,%%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* d += a3 * a3 */\n    \"movq %%r13,%%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* c += (d & M) * R */\n    \"movq %%rbx,%%rax\\n\"\n    \"andq %%r15,%%rax\\n\"\n    \"movq $0x1000003d10,%%rdx\\n\"\n    \"mulq %%rdx\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* d >>= 52 */\n    \"shrdq $52,%%rcx,%%rbx\\n\"\n    \"xorq %%rcx,%%rcx\\n\"\n    /* r[1] = c & M */\n    \"movq %%r8,%%rax\\n\"\n    \"andq %%r15,%%rax\\n\"\n    \"movq %%rax,8(%%rdi)\\n\"\n    /* c >>= 52 */\n    \"shrdq $52,%%r9,%%r8\\n\"\n    \"xorq %%r9,%%r9\\n\"\n    /* c += a0 * a2 (last use of %%r10) */\n    \"movq %%r10,%%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* fetch t3 (%%r10, overwrites a0),t4 (%%rsi) */\n    \"movq %q2,%%rsi\\n\"\n    \"movq %q1,%%r10\\n\"\n    /* c += a1 * a1 */\n    \"movq %%r11,%%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* d += a3 * a4 */\n    \"movq %%r13,%%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax,%%rbx\\n\"\n    \"adcq %%rdx,%%rcx\\n\"\n    /* c += (d & M) * R */\n    \"movq %%rbx,%%rax\\n\"\n    \"andq %%r15,%%rax\\n\"\n    \"movq $0x1000003d10,%%rdx\\n\"\n    \"mulq %%rdx\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* d >>= 52 (%%rbx only) */\n    \"shrdq $52,%%rcx,%%rbx\\n\"\n    /* r[2] = c & M */\n    \"movq %%r8,%%rax\\n\"\n    \"andq %%r15,%%rax\\n\"\n    \"movq %%rax,16(%%rdi)\\n\"\n    /* c >>= 52 */\n    \"shrdq $52,%%r9,%%r8\\n\"\n    \"xorq %%r9,%%r9\\n\"\n    /* c += t3 */\n    \"addq %%r10,%%r8\\n\"\n    /* c += d * R */\n    \"movq %%rbx,%%rax\\n\"\n    \"movq $0x1000003d10,%%rdx\\n\"\n    \"mulq %%rdx\\n\"\n    \"addq %%rax,%%r8\\n\"\n    \"adcq %%rdx,%%r9\\n\"\n    /* r[3] = c & M */\n    \"movq %%r8,%%rax\\n\"\n    \"andq %%r15,%%rax\\n\"\n    \"movq %%rax,24(%%rdi)\\n\"\n    /* c >>= 52 (%%r8 only) */\n    \"shrdq $52,%%r9,%%r8\\n\"\n    /* c += t4 (%%r8 only) */\n    \"addq %%rsi,%%r8\\n\"\n    /* r[4] = c */\n    \"movq %%r8,32(%%rdi)\\n\"\n: \"+S\"(a), \"=m\"(tmp1), \"=m\"(tmp2), \"=m\"(tmp3)\n: \"D\"(r)\n: \"%rax\", \"%rbx\", \"%rcx\", \"%rdx\", \"%r8\", \"%r9\", \"%r10\", \"%r11\", \"%r12\", \"%r13\", \"%r14\", \"%r15\", \"cc\", \"memory\"\n);\n}\n\n#endif /* SECP256K1_FIELD_INNER5X52_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/field_5x52_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_FIELD_REPR_IMPL_H\n#define SECP256K1_FIELD_REPR_IMPL_H\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n#include \"util.h\"\n#include \"num.h\"\n#include \"field.h\"\n\n#if defined(USE_ASM_X86_64)\n#include \"field_5x52_asm_impl.h\"\n#else\n#include \"field_5x52_int128_impl.h\"\n#endif\n\n/** Implements arithmetic modulo FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F,\n *  represented as 5 uint64_t's in base 2^52. The values are allowed to contain >52 each. In particular,\n *  each FieldElem has a 'magnitude' associated with it. Internally, a magnitude M means each element\n *  is at most M*(2^53-1), except the most significant one, which is limited to M*(2^49-1). All operations\n *  accept any input with magnitude at most M, and have different rules for propagating magnitude to their\n *  output.\n */\n\n#ifdef VERIFY\nstatic void secp256k1_fe_verify(const secp256k1_fe *a) {\n    const uint64_t *d = a->n;\n    int m = a->normalized ? 1 : 2 * a->magnitude, r = 1;\n   /* secp256k1 'p' value defined in \"Standards for Efficient Cryptography\" (SEC2) 2.7.1. */\n    r &= (d[0] <= 0xFFFFFFFFFFFFFULL * m);\n    r &= (d[1] <= 0xFFFFFFFFFFFFFULL * m);\n    r &= (d[2] <= 0xFFFFFFFFFFFFFULL * m);\n    r &= (d[3] <= 0xFFFFFFFFFFFFFULL * m);\n    r &= (d[4] <= 0x0FFFFFFFFFFFFULL * m);\n    r &= (a->magnitude >= 0);\n    r &= (a->magnitude <= 2048);\n    if (a->normalized) {\n        r &= (a->magnitude <= 1);\n        if (r && (d[4] == 0x0FFFFFFFFFFFFULL) && ((d[3] & d[2] & d[1]) == 0xFFFFFFFFFFFFFULL)) {\n            r &= (d[0] < 0xFFFFEFFFFFC2FULL);\n        }\n    }\n    VERIFY_CHECK(r == 1);\n}\n#endif\n\nstatic void secp256k1_fe_normalize(secp256k1_fe *r) {\n    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];\n\n    /* Reduce t4 at the start so there will be at most a single carry from the first pass */\n    uint64_t m;\n    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;\n\n    /* The first pass ensures the magnitude is 1, ... */\n    t0 += x * 0x1000003D1ULL;\n    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;\n    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;\n    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;\n    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; m &= t3;\n\n    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */\n    VERIFY_CHECK(t4 >> 49 == 0);\n\n    /* At most a single final reduction is needed; check if the value is >= the field characteristic */\n    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)\n        & (t0 >= 0xFFFFEFFFFFC2FULL));\n\n    /* Apply the final reduction (for constant-time behaviour, we do it always) */\n    t0 += x * 0x1000003D1ULL;\n    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;\n    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;\n    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;\n    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL;\n\n    /* If t4 didn't carry to bit 48 already, then it should have after any final reduction */\n    VERIFY_CHECK(t4 >> 48 == x);\n\n    /* Mask off the possible multiple of 2^256 from the final reduction */\n    t4 &= 0x0FFFFFFFFFFFFULL;\n\n    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;\n\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 1;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic void secp256k1_fe_normalize_weak(secp256k1_fe *r) {\n    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];\n\n    /* Reduce t4 at the start so there will be at most a single carry from the first pass */\n    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;\n\n    /* The first pass ensures the magnitude is 1, ... */\n    t0 += x * 0x1000003D1ULL;\n    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;\n    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;\n    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;\n    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL;\n\n    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */\n    VERIFY_CHECK(t4 >> 49 == 0);\n\n    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;\n\n#ifdef VERIFY\n    r->magnitude = 1;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic void secp256k1_fe_normalize_var(secp256k1_fe *r) {\n    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];\n\n    /* Reduce t4 at the start so there will be at most a single carry from the first pass */\n    uint64_t m;\n    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;\n\n    /* The first pass ensures the magnitude is 1, ... */\n    t0 += x * 0x1000003D1ULL;\n    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;\n    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;\n    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;\n    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; m &= t3;\n\n    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */\n    VERIFY_CHECK(t4 >> 49 == 0);\n\n    /* At most a single final reduction is needed; check if the value is >= the field characteristic */\n    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)\n        & (t0 >= 0xFFFFEFFFFFC2FULL));\n\n    if (x) {\n        t0 += 0x1000003D1ULL;\n        t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;\n        t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;\n        t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;\n        t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL;\n\n        /* If t4 didn't carry to bit 48 already, then it should have after any final reduction */\n        VERIFY_CHECK(t4 >> 48 == x);\n\n        /* Mask off the possible multiple of 2^256 from the final reduction */\n        t4 &= 0x0FFFFFFFFFFFFULL;\n    }\n\n    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;\n\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 1;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic int secp256k1_fe_normalizes_to_zero(secp256k1_fe *r) {\n    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];\n\n    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */\n    uint64_t z0, z1;\n\n    /* Reduce t4 at the start so there will be at most a single carry from the first pass */\n    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;\n\n    /* The first pass ensures the magnitude is 1, ... */\n    t0 += x * 0x1000003D1ULL;\n    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL; z0  = t0; z1  = t0 ^ 0x1000003D0ULL;\n    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;\n    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;\n    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;\n                                                z0 |= t4; z1 &= t4 ^ 0xF000000000000ULL;\n\n    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */\n    VERIFY_CHECK(t4 >> 49 == 0);\n\n    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);\n}\n\nstatic int secp256k1_fe_normalizes_to_zero_var(secp256k1_fe *r) {\n    uint64_t t0, t1, t2, t3, t4;\n    uint64_t z0, z1;\n    uint64_t x;\n\n    t0 = r->n[0];\n    t4 = r->n[4];\n\n    /* Reduce t4 at the start so there will be at most a single carry from the first pass */\n    x = t4 >> 48;\n\n    /* The first pass ensures the magnitude is 1, ... */\n    t0 += x * 0x1000003D1ULL;\n\n    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */\n    z0 = t0 & 0xFFFFFFFFFFFFFULL;\n    z1 = z0 ^ 0x1000003D0ULL;\n\n    /* Fast return path should catch the majority of cases */\n    if ((z0 != 0ULL) & (z1 != 0xFFFFFFFFFFFFFULL)) {\n        return 0;\n    }\n\n    t1 = r->n[1];\n    t2 = r->n[2];\n    t3 = r->n[3];\n\n    t4 &= 0x0FFFFFFFFFFFFULL;\n\n    t1 += (t0 >> 52);\n    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;\n    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;\n    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;\n                                                z0 |= t4; z1 &= t4 ^ 0xF000000000000ULL;\n\n    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */\n    VERIFY_CHECK(t4 >> 49 == 0);\n\n    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);\n}\n\nSECP256K1_INLINE static void secp256k1_fe_set_int(secp256k1_fe *r, int a) {\n    r->n[0] = a;\n    r->n[1] = r->n[2] = r->n[3] = r->n[4] = 0;\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 1;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nSECP256K1_INLINE static int secp256k1_fe_is_zero(const secp256k1_fe *a) {\n    const uint64_t *t = a->n;\n#ifdef VERIFY\n    VERIFY_CHECK(a->normalized);\n    secp256k1_fe_verify(a);\n#endif\n    return (t[0] | t[1] | t[2] | t[3] | t[4]) == 0;\n}\n\nSECP256K1_INLINE static int secp256k1_fe_is_odd(const secp256k1_fe *a) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->normalized);\n    secp256k1_fe_verify(a);\n#endif\n    return a->n[0] & 1;\n}\n\nSECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe *a) {\n    int i;\n#ifdef VERIFY\n    a->magnitude = 0;\n    a->normalized = 1;\n#endif\n    for (i=0; i<5; i++) {\n        a->n[i] = 0;\n    }\n}\n\nstatic int secp256k1_fe_cmp_var(const secp256k1_fe *a, const secp256k1_fe *b) {\n    int i;\n#ifdef VERIFY\n    VERIFY_CHECK(a->normalized);\n    VERIFY_CHECK(b->normalized);\n    secp256k1_fe_verify(a);\n    secp256k1_fe_verify(b);\n#endif\n    for (i = 4; i >= 0; i--) {\n        if (a->n[i] > b->n[i]) {\n            return 1;\n        }\n        if (a->n[i] < b->n[i]) {\n            return -1;\n        }\n    }\n    return 0;\n}\n\nstatic int secp256k1_fe_set_b32(secp256k1_fe *r, const unsigned char *a) {\n    r->n[0] = (uint64_t)a[31]\n            | ((uint64_t)a[30] << 8)\n            | ((uint64_t)a[29] << 16)\n            | ((uint64_t)a[28] << 24)\n            | ((uint64_t)a[27] << 32)\n            | ((uint64_t)a[26] << 40)\n            | ((uint64_t)(a[25] & 0xF)  << 48);\n    r->n[1] = (uint64_t)((a[25] >> 4) & 0xF)\n            | ((uint64_t)a[24] << 4)\n            | ((uint64_t)a[23] << 12)\n            | ((uint64_t)a[22] << 20)\n            | ((uint64_t)a[21] << 28)\n            | ((uint64_t)a[20] << 36)\n            | ((uint64_t)a[19] << 44);\n    r->n[2] = (uint64_t)a[18]\n            | ((uint64_t)a[17] << 8)\n            | ((uint64_t)a[16] << 16)\n            | ((uint64_t)a[15] << 24)\n            | ((uint64_t)a[14] << 32)\n            | ((uint64_t)a[13] << 40)\n            | ((uint64_t)(a[12] & 0xF) << 48);\n    r->n[3] = (uint64_t)((a[12] >> 4) & 0xF)\n            | ((uint64_t)a[11] << 4)\n            | ((uint64_t)a[10] << 12)\n            | ((uint64_t)a[9]  << 20)\n            | ((uint64_t)a[8]  << 28)\n            | ((uint64_t)a[7]  << 36)\n            | ((uint64_t)a[6]  << 44);\n    r->n[4] = (uint64_t)a[5]\n            | ((uint64_t)a[4] << 8)\n            | ((uint64_t)a[3] << 16)\n            | ((uint64_t)a[2] << 24)\n            | ((uint64_t)a[1] << 32)\n            | ((uint64_t)a[0] << 40);\n    if (r->n[4] == 0x0FFFFFFFFFFFFULL && (r->n[3] & r->n[2] & r->n[1]) == 0xFFFFFFFFFFFFFULL && r->n[0] >= 0xFFFFEFFFFFC2FULL) {\n        return 0;\n    }\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 1;\n    secp256k1_fe_verify(r);\n#endif\n    return 1;\n}\n\n/** Convert a field element to a 32-byte big endian value. Requires the input to be normalized */\nstatic void secp256k1_fe_get_b32(unsigned char *r, const secp256k1_fe *a) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->normalized);\n    secp256k1_fe_verify(a);\n#endif\n    r[0] = (a->n[4] >> 40) & 0xFF;\n    r[1] = (a->n[4] >> 32) & 0xFF;\n    r[2] = (a->n[4] >> 24) & 0xFF;\n    r[3] = (a->n[4] >> 16) & 0xFF;\n    r[4] = (a->n[4] >> 8) & 0xFF;\n    r[5] = a->n[4] & 0xFF;\n    r[6] = (a->n[3] >> 44) & 0xFF;\n    r[7] = (a->n[3] >> 36) & 0xFF;\n    r[8] = (a->n[3] >> 28) & 0xFF;\n    r[9] = (a->n[3] >> 20) & 0xFF;\n    r[10] = (a->n[3] >> 12) & 0xFF;\n    r[11] = (a->n[3] >> 4) & 0xFF;\n    r[12] = ((a->n[2] >> 48) & 0xF) | ((a->n[3] & 0xF) << 4);\n    r[13] = (a->n[2] >> 40) & 0xFF;\n    r[14] = (a->n[2] >> 32) & 0xFF;\n    r[15] = (a->n[2] >> 24) & 0xFF;\n    r[16] = (a->n[2] >> 16) & 0xFF;\n    r[17] = (a->n[2] >> 8) & 0xFF;\n    r[18] = a->n[2] & 0xFF;\n    r[19] = (a->n[1] >> 44) & 0xFF;\n    r[20] = (a->n[1] >> 36) & 0xFF;\n    r[21] = (a->n[1] >> 28) & 0xFF;\n    r[22] = (a->n[1] >> 20) & 0xFF;\n    r[23] = (a->n[1] >> 12) & 0xFF;\n    r[24] = (a->n[1] >> 4) & 0xFF;\n    r[25] = ((a->n[0] >> 48) & 0xF) | ((a->n[1] & 0xF) << 4);\n    r[26] = (a->n[0] >> 40) & 0xFF;\n    r[27] = (a->n[0] >> 32) & 0xFF;\n    r[28] = (a->n[0] >> 24) & 0xFF;\n    r[29] = (a->n[0] >> 16) & 0xFF;\n    r[30] = (a->n[0] >> 8) & 0xFF;\n    r[31] = a->n[0] & 0xFF;\n}\n\nSECP256K1_INLINE static void secp256k1_fe_negate(secp256k1_fe *r, const secp256k1_fe *a, int m) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->magnitude <= m);\n    secp256k1_fe_verify(a);\n#endif\n    r->n[0] = 0xFFFFEFFFFFC2FULL * 2 * (m + 1) - a->n[0];\n    r->n[1] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[1];\n    r->n[2] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[2];\n    r->n[3] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[3];\n    r->n[4] = 0x0FFFFFFFFFFFFULL * 2 * (m + 1) - a->n[4];\n#ifdef VERIFY\n    r->magnitude = m + 1;\n    r->normalized = 0;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nSECP256K1_INLINE static void secp256k1_fe_mul_int(secp256k1_fe *r, int a) {\n    r->n[0] *= a;\n    r->n[1] *= a;\n    r->n[2] *= a;\n    r->n[3] *= a;\n    r->n[4] *= a;\n#ifdef VERIFY\n    r->magnitude *= a;\n    r->normalized = 0;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nSECP256K1_INLINE static void secp256k1_fe_add(secp256k1_fe *r, const secp256k1_fe *a) {\n#ifdef VERIFY\n    secp256k1_fe_verify(a);\n#endif\n    r->n[0] += a->n[0];\n    r->n[1] += a->n[1];\n    r->n[2] += a->n[2];\n    r->n[3] += a->n[3];\n    r->n[4] += a->n[4];\n#ifdef VERIFY\n    r->magnitude += a->magnitude;\n    r->normalized = 0;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic void secp256k1_fe_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->magnitude <= 8);\n    VERIFY_CHECK(b->magnitude <= 8);\n    secp256k1_fe_verify(a);\n    secp256k1_fe_verify(b);\n    VERIFY_CHECK(r != b);\n#endif\n    secp256k1_fe_mul_inner(r->n, a->n, b->n);\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 0;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic void secp256k1_fe_sqr(secp256k1_fe *r, const secp256k1_fe *a) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->magnitude <= 8);\n    secp256k1_fe_verify(a);\n#endif\n    secp256k1_fe_sqr_inner(r->n, a->n);\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 0;\n    secp256k1_fe_verify(r);\n#endif\n}\n\nstatic SECP256K1_INLINE void secp256k1_fe_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag) {\n    uint64_t mask0, mask1;\n    mask0 = flag + ~((uint64_t)0);\n    mask1 = ~mask0;\n    r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);\n    r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);\n    r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);\n    r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);\n    r->n[4] = (r->n[4] & mask0) | (a->n[4] & mask1);\n#ifdef VERIFY\n    if (a->magnitude > r->magnitude) {\n        r->magnitude = a->magnitude;\n    }\n    r->normalized &= a->normalized;\n#endif\n}\n\nstatic SECP256K1_INLINE void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag) {\n    uint64_t mask0, mask1;\n    mask0 = flag + ~((uint64_t)0);\n    mask1 = ~mask0;\n    r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);\n    r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);\n    r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);\n    r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);\n}\n\nstatic void secp256k1_fe_to_storage(secp256k1_fe_storage *r, const secp256k1_fe *a) {\n#ifdef VERIFY\n    VERIFY_CHECK(a->normalized);\n#endif\n    r->n[0] = a->n[0] | a->n[1] << 52;\n    r->n[1] = a->n[1] >> 12 | a->n[2] << 40;\n    r->n[2] = a->n[2] >> 24 | a->n[3] << 28;\n    r->n[3] = a->n[3] >> 36 | a->n[4] << 16;\n}\n\nstatic SECP256K1_INLINE void secp256k1_fe_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a) {\n    r->n[0] = a->n[0] & 0xFFFFFFFFFFFFFULL;\n    r->n[1] = a->n[0] >> 52 | ((a->n[1] << 12) & 0xFFFFFFFFFFFFFULL);\n    r->n[2] = a->n[1] >> 40 | ((a->n[2] << 24) & 0xFFFFFFFFFFFFFULL);\n    r->n[3] = a->n[2] >> 28 | ((a->n[3] << 36) & 0xFFFFFFFFFFFFFULL);\n    r->n[4] = a->n[3] >> 16;\n#ifdef VERIFY\n    r->magnitude = 1;\n    r->normalized = 1;\n#endif\n}\n\n#endif /* SECP256K1_FIELD_REPR_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/field_5x52_int128_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_FIELD_INNER5X52_IMPL_H\n#define SECP256K1_FIELD_INNER5X52_IMPL_H\n\n#include <stdint.h>\n\n#ifdef VERIFY\n#define VERIFY_BITS(x, n) VERIFY_CHECK(((x) >> (n)) == 0)\n#else\n#define VERIFY_BITS(x, n) do { } while(0)\n#endif\n\nSECP256K1_INLINE static void secp256k1_fe_mul_inner(uint64_t *r, const uint64_t *a, const uint64_t * SECP256K1_RESTRICT b) {\n    uint128_t c, d;\n    uint64_t t3, t4, tx, u0;\n    uint64_t a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4];\n    const uint64_t M = 0xFFFFFFFFFFFFFULL, R = 0x1000003D10ULL;\n\n    VERIFY_BITS(a[0], 56);\n    VERIFY_BITS(a[1], 56);\n    VERIFY_BITS(a[2], 56);\n    VERIFY_BITS(a[3], 56);\n    VERIFY_BITS(a[4], 52);\n    VERIFY_BITS(b[0], 56);\n    VERIFY_BITS(b[1], 56);\n    VERIFY_BITS(b[2], 56);\n    VERIFY_BITS(b[3], 56);\n    VERIFY_BITS(b[4], 52);\n    VERIFY_CHECK(r != b);\n\n    /*  [... a b c] is a shorthand for ... + a<<104 + b<<52 + c<<0 mod n.\n     *  px is a shorthand for sum(a[i]*b[x-i], i=0..x).\n     *  Note that [x 0 0 0 0 0] = [x*R].\n     */\n\n    d  = (uint128_t)a0 * b[3]\n       + (uint128_t)a1 * b[2]\n       + (uint128_t)a2 * b[1]\n       + (uint128_t)a3 * b[0];\n    VERIFY_BITS(d, 114);\n    /* [d 0 0 0] = [p3 0 0 0] */\n    c  = (uint128_t)a4 * b[4];\n    VERIFY_BITS(c, 112);\n    /* [c 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */\n    d += (c & M) * R; c >>= 52;\n    VERIFY_BITS(d, 115);\n    VERIFY_BITS(c, 60);\n    /* [c 0 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */\n    t3 = d & M; d >>= 52;\n    VERIFY_BITS(t3, 52);\n    VERIFY_BITS(d, 63);\n    /* [c 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */\n\n    d += (uint128_t)a0 * b[4]\n       + (uint128_t)a1 * b[3]\n       + (uint128_t)a2 * b[2]\n       + (uint128_t)a3 * b[1]\n       + (uint128_t)a4 * b[0];\n    VERIFY_BITS(d, 115);\n    /* [c 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */\n    d += c * R;\n    VERIFY_BITS(d, 116);\n    /* [d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */\n    t4 = d & M; d >>= 52;\n    VERIFY_BITS(t4, 52);\n    VERIFY_BITS(d, 64);\n    /* [d t4 t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */\n    tx = (t4 >> 48); t4 &= (M >> 4);\n    VERIFY_BITS(tx, 4);\n    VERIFY_BITS(t4, 48);\n    /* [d t4+(tx<<48) t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */\n\n    c  = (uint128_t)a0 * b[0];\n    VERIFY_BITS(c, 112);\n    /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 0 p4 p3 0 0 p0] */\n    d += (uint128_t)a1 * b[4]\n       + (uint128_t)a2 * b[3]\n       + (uint128_t)a3 * b[2]\n       + (uint128_t)a4 * b[1];\n    VERIFY_BITS(d, 115);\n    /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */\n    u0 = d & M; d >>= 52;\n    VERIFY_BITS(u0, 52);\n    VERIFY_BITS(d, 63);\n    /* [d u0 t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */\n    /* [d 0 t4+(tx<<48)+(u0<<52) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */\n    u0 = (u0 << 4) | tx;\n    VERIFY_BITS(u0, 56);\n    /* [d 0 t4+(u0<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */\n    c += (uint128_t)u0 * (R >> 4);\n    VERIFY_BITS(c, 115);\n    /* [d 0 t4 t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */\n    r[0] = c & M; c >>= 52;\n    VERIFY_BITS(r[0], 52);\n    VERIFY_BITS(c, 61);\n    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 0 p0] */\n\n    c += (uint128_t)a0 * b[1]\n       + (uint128_t)a1 * b[0];\n    VERIFY_BITS(c, 114);\n    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 p1 p0] */\n    d += (uint128_t)a2 * b[4]\n       + (uint128_t)a3 * b[3]\n       + (uint128_t)a4 * b[2];\n    VERIFY_BITS(d, 114);\n    /* [d 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */\n    c += (d & M) * R; d >>= 52;\n    VERIFY_BITS(c, 115);\n    VERIFY_BITS(d, 62);\n    /* [d 0 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */\n    r[1] = c & M; c >>= 52;\n    VERIFY_BITS(r[1], 52);\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */\n\n    c += (uint128_t)a0 * b[2]\n       + (uint128_t)a1 * b[1]\n       + (uint128_t)a2 * b[0];\n    VERIFY_BITS(c, 114);\n    /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 p2 p1 p0] */\n    d += (uint128_t)a3 * b[4]\n       + (uint128_t)a4 * b[3];\n    VERIFY_BITS(d, 114);\n    /* [d 0 0 t4 t3 c t1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    c += (d & M) * R; d >>= 52;\n    VERIFY_BITS(c, 115);\n    VERIFY_BITS(d, 62);\n    /* [d 0 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n\n    /* [d 0 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[2] = c & M; c >>= 52;\n    VERIFY_BITS(r[2], 52);\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 0 t4 t3+c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    c   += d * R + t3;\n    VERIFY_BITS(c, 100);\n    /* [t4 c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[3] = c & M; c >>= 52;\n    VERIFY_BITS(r[3], 52);\n    VERIFY_BITS(c, 48);\n    /* [t4+c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    c   += t4;\n    VERIFY_BITS(c, 49);\n    /* [c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[4] = c;\n    VERIFY_BITS(r[4], 49);\n    /* [r4 r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n}\n\nSECP256K1_INLINE static void secp256k1_fe_sqr_inner(uint64_t *r, const uint64_t *a) {\n    uint128_t c, d;\n    uint64_t a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4];\n    int64_t t3, t4, tx, u0;\n    const uint64_t M = 0xFFFFFFFFFFFFFULL, R = 0x1000003D10ULL;\n\n    VERIFY_BITS(a[0], 56);\n    VERIFY_BITS(a[1], 56);\n    VERIFY_BITS(a[2], 56);\n    VERIFY_BITS(a[3], 56);\n    VERIFY_BITS(a[4], 52);\n\n    /**  [... a b c] is a shorthand for ... + a<<104 + b<<52 + c<<0 mod n.\n     *  px is a shorthand for sum(a[i]*a[x-i], i=0..x).\n     *  Note that [x 0 0 0 0 0] = [x*R].\n     */\n\n    d  = (uint128_t)(a0*2) * a3\n       + (uint128_t)(a1*2) * a2;\n    VERIFY_BITS(d, 114);\n    /* [d 0 0 0] = [p3 0 0 0] */\n    c  = (uint128_t)a4 * a4;\n    VERIFY_BITS(c, 112);\n    /* [c 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */\n    d += (c & M) * R; c >>= 52;\n    VERIFY_BITS(d, 115);\n    VERIFY_BITS(c, 60);\n    /* [c 0 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */\n    t3 = d & M; d >>= 52;\n    VERIFY_BITS(t3, 52);\n    VERIFY_BITS(d, 63);\n    /* [c 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */\n\n    a4 *= 2;\n    d += (uint128_t)a0 * a4\n       + (uint128_t)(a1*2) * a3\n       + (uint128_t)a2 * a2;\n    VERIFY_BITS(d, 115);\n    /* [c 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */\n    d += c * R;\n    VERIFY_BITS(d, 116);\n    /* [d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */\n    t4 = d & M; d >>= 52;\n    VERIFY_BITS(t4, 52);\n    VERIFY_BITS(d, 64);\n    /* [d t4 t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */\n    tx = (t4 >> 48); t4 &= (M >> 4);\n    VERIFY_BITS(tx, 4);\n    VERIFY_BITS(t4, 48);\n    /* [d t4+(tx<<48) t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */\n\n    c  = (uint128_t)a0 * a0;\n    VERIFY_BITS(c, 112);\n    /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 0 p4 p3 0 0 p0] */\n    d += (uint128_t)a1 * a4\n       + (uint128_t)(a2*2) * a3;\n    VERIFY_BITS(d, 114);\n    /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */\n    u0 = d & M; d >>= 52;\n    VERIFY_BITS(u0, 52);\n    VERIFY_BITS(d, 62);\n    /* [d u0 t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */\n    /* [d 0 t4+(tx<<48)+(u0<<52) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */\n    u0 = (u0 << 4) | tx;\n    VERIFY_BITS(u0, 56);\n    /* [d 0 t4+(u0<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */\n    c += (uint128_t)u0 * (R >> 4);\n    VERIFY_BITS(c, 113);\n    /* [d 0 t4 t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */\n    r[0] = c & M; c >>= 52;\n    VERIFY_BITS(r[0], 52);\n    VERIFY_BITS(c, 61);\n    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 0 p0] */\n\n    a0 *= 2;\n    c += (uint128_t)a0 * a1;\n    VERIFY_BITS(c, 114);\n    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 p1 p0] */\n    d += (uint128_t)a2 * a4\n       + (uint128_t)a3 * a3;\n    VERIFY_BITS(d, 114);\n    /* [d 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */\n    c += (d & M) * R; d >>= 52;\n    VERIFY_BITS(c, 115);\n    VERIFY_BITS(d, 62);\n    /* [d 0 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */\n    r[1] = c & M; c >>= 52;\n    VERIFY_BITS(r[1], 52);\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */\n\n    c += (uint128_t)a0 * a2\n       + (uint128_t)a1 * a1;\n    VERIFY_BITS(c, 114);\n    /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 p2 p1 p0] */\n    d += (uint128_t)a3 * a4;\n    VERIFY_BITS(d, 114);\n    /* [d 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    c += (d & M) * R; d >>= 52;\n    VERIFY_BITS(c, 115);\n    VERIFY_BITS(d, 62);\n    /* [d 0 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[2] = c & M; c >>= 52;\n    VERIFY_BITS(r[2], 52);\n    VERIFY_BITS(c, 63);\n    /* [d 0 0 0 t4 t3+c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n\n    c   += d * R + t3;\n    VERIFY_BITS(c, 100);\n    /* [t4 c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[3] = c & M; c >>= 52;\n    VERIFY_BITS(r[3], 52);\n    VERIFY_BITS(c, 48);\n    /* [t4+c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    c   += t4;\n    VERIFY_BITS(c, 49);\n    /* [c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n    r[4] = c;\n    VERIFY_BITS(r[4], 49);\n    /* [r4 r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */\n}\n\n#endif /* SECP256K1_FIELD_INNER5X52_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/field_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_FIELD_IMPL_H\n#define SECP256K1_FIELD_IMPL_H\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n#include \"util.h\"\n\n#if defined(USE_FIELD_10X26)\n#include \"field_10x26_impl.h\"\n#elif defined(USE_FIELD_5X52)\n#include \"field_5x52_impl.h\"\n#else\n#error \"Please select field implementation\"\n#endif\n\nSECP256K1_INLINE static int secp256k1_fe_equal(const secp256k1_fe *a, const secp256k1_fe *b) {\n    secp256k1_fe na;\n    secp256k1_fe_negate(&na, a, 1);\n    secp256k1_fe_add(&na, b);\n    return secp256k1_fe_normalizes_to_zero(&na);\n}\n\nSECP256K1_INLINE static int secp256k1_fe_equal_var(const secp256k1_fe *a, const secp256k1_fe *b) {\n    secp256k1_fe na;\n    secp256k1_fe_negate(&na, a, 1);\n    secp256k1_fe_add(&na, b);\n    return secp256k1_fe_normalizes_to_zero_var(&na);\n}\n\nstatic int secp256k1_fe_sqrt(secp256k1_fe *r, const secp256k1_fe *a) {\n    /** Given that p is congruent to 3 mod 4, we can compute the square root of\n     *  a mod p as the (p+1)/4'th power of a.\n     *\n     *  As (p+1)/4 is an even number, it will have the same result for a and for\n     *  (-a). Only one of these two numbers actually has a square root however,\n     *  so we test at the end by squaring and comparing to the input.\n     *  Also because (p+1)/4 is an even number, the computed square root is\n     *  itself always a square (a ** ((p+1)/4) is the square of a ** ((p+1)/8)).\n     */\n    secp256k1_fe x2, x3, x6, x9, x11, x22, x44, x88, x176, x220, x223, t1;\n    int j;\n\n    /** The binary representation of (p + 1)/4 has 3 blocks of 1s, with lengths in\n     *  { 2, 22, 223 }. Use an addition chain to calculate 2^n - 1 for each block:\n     *  1, [2], 3, 6, 9, 11, [22], 44, 88, 176, 220, [223]\n     */\n\n    secp256k1_fe_sqr(&x2, a);\n    secp256k1_fe_mul(&x2, &x2, a);\n\n    secp256k1_fe_sqr(&x3, &x2);\n    secp256k1_fe_mul(&x3, &x3, a);\n\n    x6 = x3;\n    for (j=0; j<3; j++) {\n        secp256k1_fe_sqr(&x6, &x6);\n    }\n    secp256k1_fe_mul(&x6, &x6, &x3);\n\n    x9 = x6;\n    for (j=0; j<3; j++) {\n        secp256k1_fe_sqr(&x9, &x9);\n    }\n    secp256k1_fe_mul(&x9, &x9, &x3);\n\n    x11 = x9;\n    for (j=0; j<2; j++) {\n        secp256k1_fe_sqr(&x11, &x11);\n    }\n    secp256k1_fe_mul(&x11, &x11, &x2);\n\n    x22 = x11;\n    for (j=0; j<11; j++) {\n        secp256k1_fe_sqr(&x22, &x22);\n    }\n    secp256k1_fe_mul(&x22, &x22, &x11);\n\n    x44 = x22;\n    for (j=0; j<22; j++) {\n        secp256k1_fe_sqr(&x44, &x44);\n    }\n    secp256k1_fe_mul(&x44, &x44, &x22);\n\n    x88 = x44;\n    for (j=0; j<44; j++) {\n        secp256k1_fe_sqr(&x88, &x88);\n    }\n    secp256k1_fe_mul(&x88, &x88, &x44);\n\n    x176 = x88;\n    for (j=0; j<88; j++) {\n        secp256k1_fe_sqr(&x176, &x176);\n    }\n    secp256k1_fe_mul(&x176, &x176, &x88);\n\n    x220 = x176;\n    for (j=0; j<44; j++) {\n        secp256k1_fe_sqr(&x220, &x220);\n    }\n    secp256k1_fe_mul(&x220, &x220, &x44);\n\n    x223 = x220;\n    for (j=0; j<3; j++) {\n        secp256k1_fe_sqr(&x223, &x223);\n    }\n    secp256k1_fe_mul(&x223, &x223, &x3);\n\n    /* The final result is then assembled using a sliding window over the blocks. */\n\n    t1 = x223;\n    for (j=0; j<23; j++) {\n        secp256k1_fe_sqr(&t1, &t1);\n    }\n    secp256k1_fe_mul(&t1, &t1, &x22);\n    for (j=0; j<6; j++) {\n        secp256k1_fe_sqr(&t1, &t1);\n    }\n    secp256k1_fe_mul(&t1, &t1, &x2);\n    secp256k1_fe_sqr(&t1, &t1);\n    secp256k1_fe_sqr(r, &t1);\n\n    /* Check that a square root was actually calculated */\n\n    secp256k1_fe_sqr(&t1, r);\n    return secp256k1_fe_equal(&t1, a);\n}\n\nstatic void secp256k1_fe_inv(secp256k1_fe *r, const secp256k1_fe *a) {\n    secp256k1_fe x2, x3, x6, x9, x11, x22, x44, x88, x176, x220, x223, t1;\n    int j;\n\n    /** The binary representation of (p - 2) has 5 blocks of 1s, with lengths in\n     *  { 1, 2, 22, 223 }. Use an addition chain to calculate 2^n - 1 for each block:\n     *  [1], [2], 3, 6, 9, 11, [22], 44, 88, 176, 220, [223]\n     */\n\n    secp256k1_fe_sqr(&x2, a);\n    secp256k1_fe_mul(&x2, &x2, a);\n\n    secp256k1_fe_sqr(&x3, &x2);\n    secp256k1_fe_mul(&x3, &x3, a);\n\n    x6 = x3;\n    for (j=0; j<3; j++) {\n        secp256k1_fe_sqr(&x6, &x6);\n    }\n    secp256k1_fe_mul(&x6, &x6, &x3);\n\n    x9 = x6;\n    for (j=0; j<3; j++) {\n        secp256k1_fe_sqr(&x9, &x9);\n    }\n    secp256k1_fe_mul(&x9, &x9, &x3);\n\n    x11 = x9;\n    for (j=0; j<2; j++) {\n        secp256k1_fe_sqr(&x11, &x11);\n    }\n    secp256k1_fe_mul(&x11, &x11, &x2);\n\n    x22 = x11;\n    for (j=0; j<11; j++) {\n        secp256k1_fe_sqr(&x22, &x22);\n    }\n    secp256k1_fe_mul(&x22, &x22, &x11);\n\n    x44 = x22;\n    for (j=0; j<22; j++) {\n        secp256k1_fe_sqr(&x44, &x44);\n    }\n    secp256k1_fe_mul(&x44, &x44, &x22);\n\n    x88 = x44;\n    for (j=0; j<44; j++) {\n        secp256k1_fe_sqr(&x88, &x88);\n    }\n    secp256k1_fe_mul(&x88, &x88, &x44);\n\n    x176 = x88;\n    for (j=0; j<88; j++) {\n        secp256k1_fe_sqr(&x176, &x176);\n    }\n    secp256k1_fe_mul(&x176, &x176, &x88);\n\n    x220 = x176;\n    for (j=0; j<44; j++) {\n        secp256k1_fe_sqr(&x220, &x220);\n    }\n    secp256k1_fe_mul(&x220, &x220, &x44);\n\n    x223 = x220;\n    for (j=0; j<3; j++) {\n        secp256k1_fe_sqr(&x223, &x223);\n    }\n    secp256k1_fe_mul(&x223, &x223, &x3);\n\n    /* The final result is then assembled using a sliding window over the blocks. */\n\n    t1 = x223;\n    for (j=0; j<23; j++) {\n        secp256k1_fe_sqr(&t1, &t1);\n    }\n    secp256k1_fe_mul(&t1, &t1, &x22);\n    for (j=0; j<5; j++) {\n        secp256k1_fe_sqr(&t1, &t1);\n    }\n    secp256k1_fe_mul(&t1, &t1, a);\n    for (j=0; j<3; j++) {\n        secp256k1_fe_sqr(&t1, &t1);\n    }\n    secp256k1_fe_mul(&t1, &t1, &x2);\n    for (j=0; j<2; j++) {\n        secp256k1_fe_sqr(&t1, &t1);\n    }\n    secp256k1_fe_mul(r, a, &t1);\n}\n\nstatic void secp256k1_fe_inv_var(secp256k1_fe *r, const secp256k1_fe *a) {\n#if defined(USE_FIELD_INV_BUILTIN)\n    secp256k1_fe_inv(r, a);\n#elif defined(USE_FIELD_INV_NUM)\n    secp256k1_num n, m;\n    static const secp256k1_fe negone = SECP256K1_FE_CONST(\n        0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL,\n        0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFEUL, 0xFFFFFC2EUL\n    );\n    /* secp256k1 field prime, value p defined in \"Standards for Efficient Cryptography\" (SEC2) 2.7.1. */\n    static const unsigned char prime[32] = {\n        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n        0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F\n    };\n    unsigned char b[32];\n    int res;\n    secp256k1_fe c = *a;\n    secp256k1_fe_normalize_var(&c);\n    secp256k1_fe_get_b32(b, &c);\n    secp256k1_num_set_bin(&n, b, 32);\n    secp256k1_num_set_bin(&m, prime, 32);\n    secp256k1_num_mod_inverse(&n, &n, &m);\n    secp256k1_num_get_bin(b, 32, &n);\n    res = secp256k1_fe_set_b32(r, b);\n    (void)res;\n    VERIFY_CHECK(res);\n    /* Verify the result is the (unique) valid inverse using non-GMP code. */\n    secp256k1_fe_mul(&c, &c, r);\n    secp256k1_fe_add(&c, &negone);\n    CHECK(secp256k1_fe_normalizes_to_zero_var(&c));\n#else\n#error \"Please select field inverse implementation\"\n#endif\n}\n\nstatic void secp256k1_fe_inv_all_var(secp256k1_fe *r, const secp256k1_fe *a, size_t len) {\n    secp256k1_fe u;\n    size_t i;\n    if (len < 1) {\n        return;\n    }\n\n    VERIFY_CHECK((r + len <= a) || (a + len <= r));\n\n    r[0] = a[0];\n\n    i = 0;\n    while (++i < len) {\n        secp256k1_fe_mul(&r[i], &r[i - 1], &a[i]);\n    }\n\n    secp256k1_fe_inv_var(&u, &r[--i]);\n\n    while (i > 0) {\n        size_t j = i--;\n        secp256k1_fe_mul(&r[j], &r[i], &u);\n        secp256k1_fe_mul(&u, &u, &a[j]);\n    }\n\n    r[0] = u;\n}\n\nstatic int secp256k1_fe_is_quad_var(const secp256k1_fe *a) {\n#ifndef USE_NUM_NONE\n    unsigned char b[32];\n    secp256k1_num n;\n    secp256k1_num m;\n    /* secp256k1 field prime, value p defined in \"Standards for Efficient Cryptography\" (SEC2) 2.7.1. */\n    static const unsigned char prime[32] = {\n        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n        0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F\n    };\n\n    secp256k1_fe c = *a;\n    secp256k1_fe_normalize_var(&c);\n    secp256k1_fe_get_b32(b, &c);\n    secp256k1_num_set_bin(&n, b, 32);\n    secp256k1_num_set_bin(&m, prime, 32);\n    return secp256k1_num_jacobi(&n, &m) >= 0;\n#else\n    secp256k1_fe r;\n    return secp256k1_fe_sqrt(&r, a);\n#endif\n}\n\n#endif /* SECP256K1_FIELD_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/gen_context.c",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014, 2015 Thomas Daede, Cory Fields           *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#define USE_BASIC_CONFIG 1\n\n#include \"basic-config.h\"\n#include \"include/secp256k1.h\"\n#include \"field_impl.h\"\n#include \"scalar_impl.h\"\n#include \"group_impl.h\"\n#include \"ecmult_gen_impl.h\"\n\nstatic void default_error_callback_fn(const char* str, void* data) {\n    (void)data;\n    fprintf(stderr, \"[libsecp256k1] internal consistency check failed: %s\\n\", str);\n    abort();\n}\n\nstatic const secp256k1_callback default_error_callback = {\n    default_error_callback_fn,\n    NULL\n};\n\nint main(int argc, char **argv) {\n    secp256k1_ecmult_gen_context ctx;\n    int inner;\n    int outer;\n    FILE* fp;\n\n    (void)argc;\n    (void)argv;\n\n    fp = fopen(\"src/ecmult_static_context.h\",\"w\");\n    if (fp == NULL) {\n        fprintf(stderr, \"Could not open src/ecmult_static_context.h for writing!\\n\");\n        return -1;\n    }\n    \n    fprintf(fp, \"#ifndef _SECP256K1_ECMULT_STATIC_CONTEXT_\\n\");\n    fprintf(fp, \"#define _SECP256K1_ECMULT_STATIC_CONTEXT_\\n\");\n    fprintf(fp, \"#include \\\"group.h\\\"\\n\");\n    fprintf(fp, \"#define SC SECP256K1_GE_STORAGE_CONST\\n\");\n    fprintf(fp, \"static const secp256k1_ge_storage secp256k1_ecmult_static_context[64][16] = {\\n\");\n\n    secp256k1_ecmult_gen_context_init(&ctx);\n    secp256k1_ecmult_gen_context_build(&ctx, &default_error_callback);\n    for(outer = 0; outer != 64; outer++) {\n        fprintf(fp,\"{\\n\");\n        for(inner = 0; inner != 16; inner++) {\n            fprintf(fp,\"    SC(%uu, %uu, %uu, %uu, %uu, %uu, %uu, %uu, %uu, %uu, %uu, %uu, %uu, %uu, %uu, %uu)\", SECP256K1_GE_STORAGE_CONST_GET((*ctx.prec)[outer][inner]));\n            if (inner != 15) {\n                fprintf(fp,\",\\n\");\n            } else {\n                fprintf(fp,\"\\n\");\n            }\n        }\n        if (outer != 63) {\n            fprintf(fp,\"},\\n\");\n        } else {\n            fprintf(fp,\"}\\n\");\n        }\n    }\n    fprintf(fp,\"};\\n\");\n    secp256k1_ecmult_gen_context_clear(&ctx);\n    \n    fprintf(fp, \"#undef SC\\n\");\n    fprintf(fp, \"#endif\\n\");\n    fclose(fp);\n    \n    return 0;\n}\n"
  },
  {
    "path": "src/secp256k1/src/group.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_GROUP_H\n#define SECP256K1_GROUP_H\n\n#include \"num.h\"\n#include \"field.h\"\n\n/** A group element of the secp256k1 curve, in affine coordinates. */\ntypedef struct {\n    secp256k1_fe x;\n    secp256k1_fe y;\n    int infinity; /* whether this represents the point at infinity */\n} secp256k1_ge;\n\n#define SECP256K1_GE_CONST(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {SECP256K1_FE_CONST((a),(b),(c),(d),(e),(f),(g),(h)), SECP256K1_FE_CONST((i),(j),(k),(l),(m),(n),(o),(p)), 0}\n#define SECP256K1_GE_CONST_INFINITY {SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), 1}\n\n/** A group element of the secp256k1 curve, in jacobian coordinates. */\ntypedef struct {\n    secp256k1_fe x; /* actual X: x/z^2 */\n    secp256k1_fe y; /* actual Y: y/z^3 */\n    secp256k1_fe z;\n    int infinity; /* whether this represents the point at infinity */\n} secp256k1_gej;\n\n#define SECP256K1_GEJ_CONST(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {SECP256K1_FE_CONST((a),(b),(c),(d),(e),(f),(g),(h)), SECP256K1_FE_CONST((i),(j),(k),(l),(m),(n),(o),(p)), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 1), 0}\n#define SECP256K1_GEJ_CONST_INFINITY {SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 0), 1}\n\ntypedef struct {\n    secp256k1_fe_storage x;\n    secp256k1_fe_storage y;\n} secp256k1_ge_storage;\n\n#define SECP256K1_GE_STORAGE_CONST(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) {SECP256K1_FE_STORAGE_CONST((a),(b),(c),(d),(e),(f),(g),(h)), SECP256K1_FE_STORAGE_CONST((i),(j),(k),(l),(m),(n),(o),(p))}\n\n#define SECP256K1_GE_STORAGE_CONST_GET(t) SECP256K1_FE_STORAGE_CONST_GET(t.x), SECP256K1_FE_STORAGE_CONST_GET(t.y)\n\n/** Set a group element equal to the point with given X and Y coordinates */\nstatic void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y);\n\n/** Set a group element (affine) equal to the point with the given X coordinate\n *  and a Y coordinate that is a quadratic residue modulo p. The return value\n *  is true iff a coordinate with the given X coordinate exists.\n */\nstatic int secp256k1_ge_set_xquad(secp256k1_ge *r, const secp256k1_fe *x);\n\n/** Set a group element (affine) equal to the point with the given X coordinate, and given oddness\n *  for Y. Return value indicates whether the result is valid. */\nstatic int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd);\n\n/** Check whether a group element is the point at infinity. */\nstatic int secp256k1_ge_is_infinity(const secp256k1_ge *a);\n\n/** Check whether a group element is valid (i.e., on the curve). */\nstatic int secp256k1_ge_is_valid_var(const secp256k1_ge *a);\n\nstatic void secp256k1_ge_neg(secp256k1_ge *r, const secp256k1_ge *a);\n\n/** Set a group element equal to another which is given in jacobian coordinates */\nstatic void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a);\n\n/** Set a batch of group elements equal to the inputs given in jacobian coordinates */\nstatic void secp256k1_ge_set_all_gej_var(secp256k1_ge *r, const secp256k1_gej *a, size_t len, const secp256k1_callback *cb);\n\n/** Set a batch of group elements equal to the inputs given in jacobian\n *  coordinates (with known z-ratios). zr must contain the known z-ratios such\n *  that mul(a[i].z, zr[i+1]) == a[i+1].z. zr[0] is ignored. */\nstatic void secp256k1_ge_set_table_gej_var(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zr, size_t len);\n\n/** Bring a batch inputs given in jacobian coordinates (with known z-ratios) to\n *  the same global z \"denominator\". zr must contain the known z-ratios such\n *  that mul(a[i].z, zr[i+1]) == a[i+1].z. zr[0] is ignored. The x and y\n *  coordinates of the result are stored in r, the common z coordinate is\n *  stored in globalz. */\nstatic void secp256k1_ge_globalz_set_table_gej(size_t len, secp256k1_ge *r, secp256k1_fe *globalz, const secp256k1_gej *a, const secp256k1_fe *zr);\n\n/** Set a group element (jacobian) equal to the point at infinity. */\nstatic void secp256k1_gej_set_infinity(secp256k1_gej *r);\n\n/** Set a group element (jacobian) equal to another which is given in affine coordinates. */\nstatic void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a);\n\n/** Compare the X coordinate of a group element (jacobian). */\nstatic int secp256k1_gej_eq_x_var(const secp256k1_fe *x, const secp256k1_gej *a);\n\n/** Set r equal to the inverse of a (i.e., mirrored around the X axis) */\nstatic void secp256k1_gej_neg(secp256k1_gej *r, const secp256k1_gej *a);\n\n/** Check whether a group element is the point at infinity. */\nstatic int secp256k1_gej_is_infinity(const secp256k1_gej *a);\n\n/** Check whether a group element's y coordinate is a quadratic residue. */\nstatic int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a);\n\n/** Set r equal to the double of a. If rzr is not-NULL, r->z = a->z * *rzr (where infinity means an implicit z = 0).\n * a may not be zero. Constant time. */\nstatic void secp256k1_gej_double_nonzero(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr);\n\n/** Set r equal to the double of a. If rzr is not-NULL, r->z = a->z * *rzr (where infinity means an implicit z = 0). */\nstatic void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr);\n\n/** Set r equal to the sum of a and b. If rzr is non-NULL, r->z = a->z * *rzr (a cannot be infinity in that case). */\nstatic void secp256k1_gej_add_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_gej *b, secp256k1_fe *rzr);\n\n/** Set r equal to the sum of a and b (with b given in affine coordinates, and not infinity). */\nstatic void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b);\n\n/** Set r equal to the sum of a and b (with b given in affine coordinates). This is more efficient\n    than secp256k1_gej_add_var. It is identical to secp256k1_gej_add_ge but without constant-time\n    guarantee, and b is allowed to be infinity. If rzr is non-NULL, r->z = a->z * *rzr (a cannot be infinity in that case). */\nstatic void secp256k1_gej_add_ge_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, secp256k1_fe *rzr);\n\n/** Set r equal to the sum of a and b (with the inverse of b's Z coordinate passed as bzinv). */\nstatic void secp256k1_gej_add_zinv_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, const secp256k1_fe *bzinv);\n\n#ifdef USE_ENDOMORPHISM\n/** Set r to be equal to lambda times a, where lambda is chosen in a way such that this is very fast. */\nstatic void secp256k1_ge_mul_lambda(secp256k1_ge *r, const secp256k1_ge *a);\n#endif\n\n/** Clear a secp256k1_gej to prevent leaking sensitive information. */\nstatic void secp256k1_gej_clear(secp256k1_gej *r);\n\n/** Clear a secp256k1_ge to prevent leaking sensitive information. */\nstatic void secp256k1_ge_clear(secp256k1_ge *r);\n\n/** Convert a group element to the storage type. */\nstatic void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a);\n\n/** Convert a group element back from the storage type. */\nstatic void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a);\n\n/** If flag is true, set *r equal to *a; otherwise leave it. Constant-time. */\nstatic void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag);\n\n/** Rescale a jacobian point by b which must be non-zero. Constant-time. */\nstatic void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *b);\n\n#endif /* SECP256K1_GROUP_H */\n"
  },
  {
    "path": "src/secp256k1/src/group_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_GROUP_IMPL_H\n#define SECP256K1_GROUP_IMPL_H\n\n#include \"num.h\"\n#include \"field.h\"\n#include \"group.h\"\n\n/* These points can be generated in sage as follows:\n *\n * 0. Setup a worksheet with the following parameters.\n *   b = 4  # whatever CURVE_B will be set to\n *   F = FiniteField (0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F)\n *   C = EllipticCurve ([F (0), F (b)])\n *\n * 1. Determine all the small orders available to you. (If there are\n *    no satisfactory ones, go back and change b.)\n *   print C.order().factor(limit=1000)\n *\n * 2. Choose an order as one of the prime factors listed in the above step.\n *    (You can also multiply some to get a composite order, though the\n *    tests will crash trying to invert scalars during signing.) We take a\n *    random point and scale it to drop its order to the desired value.\n *    There is some probability this won't work; just try again.\n *   order = 199\n *   P = C.random_point()\n *   P = (int(P.order()) / int(order)) * P\n *   assert(P.order() == order)\n *\n * 3. Print the values. You'll need to use a vim macro or something to\n *    split the hex output into 4-byte chunks.\n *   print \"%x %x\" % P.xy()\n */\n#if defined(EXHAUSTIVE_TEST_ORDER)\n#  if EXHAUSTIVE_TEST_ORDER == 199\nconst secp256k1_ge secp256k1_ge_const_g = SECP256K1_GE_CONST(\n    0xFA7CC9A7, 0x0737F2DB, 0xA749DD39, 0x2B4FB069,\n    0x3B017A7D, 0xA808C2F1, 0xFB12940C, 0x9EA66C18,\n    0x78AC123A, 0x5ED8AEF3, 0x8732BC91, 0x1F3A2868,\n    0x48DF246C, 0x808DAE72, 0xCFE52572, 0x7F0501ED\n);\n\nconst int CURVE_B = 4;\n#  elif EXHAUSTIVE_TEST_ORDER == 13\nconst secp256k1_ge secp256k1_ge_const_g = SECP256K1_GE_CONST(\n    0xedc60018, 0xa51a786b, 0x2ea91f4d, 0x4c9416c0,\n    0x9de54c3b, 0xa1316554, 0x6cf4345c, 0x7277ef15,\n    0x54cb1b6b, 0xdc8c1273, 0x087844ea, 0x43f4603e,\n    0x0eaf9a43, 0xf6effe55, 0x939f806d, 0x37adf8ac\n);\nconst int CURVE_B = 2;\n#  else\n#    error No known generator for the specified exhaustive test group order.\n#  endif\n#else\n/** Generator for secp256k1, value 'g' defined in\n *  \"Standards for Efficient Cryptography\" (SEC2) 2.7.1.\n */\nstatic const secp256k1_ge secp256k1_ge_const_g = SECP256K1_GE_CONST(\n    0x79BE667EUL, 0xF9DCBBACUL, 0x55A06295UL, 0xCE870B07UL,\n    0x029BFCDBUL, 0x2DCE28D9UL, 0x59F2815BUL, 0x16F81798UL,\n    0x483ADA77UL, 0x26A3C465UL, 0x5DA4FBFCUL, 0x0E1108A8UL,\n    0xFD17B448UL, 0xA6855419UL, 0x9C47D08FUL, 0xFB10D4B8UL\n);\n\nconst int CURVE_B = 7;\n#endif\n\nstatic void secp256k1_ge_set_gej_zinv(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) {\n    secp256k1_fe zi2;\n    secp256k1_fe zi3;\n    secp256k1_fe_sqr(&zi2, zi);\n    secp256k1_fe_mul(&zi3, &zi2, zi);\n    secp256k1_fe_mul(&r->x, &a->x, &zi2);\n    secp256k1_fe_mul(&r->y, &a->y, &zi3);\n    r->infinity = a->infinity;\n}\n\nstatic void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y) {\n    r->infinity = 0;\n    r->x = *x;\n    r->y = *y;\n}\n\nstatic int secp256k1_ge_is_infinity(const secp256k1_ge *a) {\n    return a->infinity;\n}\n\nstatic void secp256k1_ge_neg(secp256k1_ge *r, const secp256k1_ge *a) {\n    *r = *a;\n    secp256k1_fe_normalize_weak(&r->y);\n    secp256k1_fe_negate(&r->y, &r->y, 1);\n}\n\nstatic void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a) {\n    secp256k1_fe z2, z3;\n    r->infinity = a->infinity;\n    secp256k1_fe_inv(&a->z, &a->z);\n    secp256k1_fe_sqr(&z2, &a->z);\n    secp256k1_fe_mul(&z3, &a->z, &z2);\n    secp256k1_fe_mul(&a->x, &a->x, &z2);\n    secp256k1_fe_mul(&a->y, &a->y, &z3);\n    secp256k1_fe_set_int(&a->z, 1);\n    r->x = a->x;\n    r->y = a->y;\n}\n\nstatic void secp256k1_ge_set_gej_var(secp256k1_ge *r, secp256k1_gej *a) {\n    secp256k1_fe z2, z3;\n    r->infinity = a->infinity;\n    if (a->infinity) {\n        return;\n    }\n    secp256k1_fe_inv_var(&a->z, &a->z);\n    secp256k1_fe_sqr(&z2, &a->z);\n    secp256k1_fe_mul(&z3, &a->z, &z2);\n    secp256k1_fe_mul(&a->x, &a->x, &z2);\n    secp256k1_fe_mul(&a->y, &a->y, &z3);\n    secp256k1_fe_set_int(&a->z, 1);\n    r->x = a->x;\n    r->y = a->y;\n}\n\nstatic void secp256k1_ge_set_all_gej_var(secp256k1_ge *r, const secp256k1_gej *a, size_t len, const secp256k1_callback *cb) {\n    secp256k1_fe *az;\n    secp256k1_fe *azi;\n    size_t i;\n    size_t count = 0;\n    az = (secp256k1_fe *)checked_malloc(cb, sizeof(secp256k1_fe) * len);\n    for (i = 0; i < len; i++) {\n        if (!a[i].infinity) {\n            az[count++] = a[i].z;\n        }\n    }\n\n    azi = (secp256k1_fe *)checked_malloc(cb, sizeof(secp256k1_fe) * count);\n    secp256k1_fe_inv_all_var(azi, az, count);\n    free(az);\n\n    count = 0;\n    for (i = 0; i < len; i++) {\n        r[i].infinity = a[i].infinity;\n        if (!a[i].infinity) {\n            secp256k1_ge_set_gej_zinv(&r[i], &a[i], &azi[count++]);\n        }\n    }\n    free(azi);\n}\n\nstatic void secp256k1_ge_set_table_gej_var(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zr, size_t len) {\n    size_t i = len - 1;\n    secp256k1_fe zi;\n\n    if (len > 0) {\n        /* Compute the inverse of the last z coordinate, and use it to compute the last affine output. */\n        secp256k1_fe_inv(&zi, &a[i].z);\n        secp256k1_ge_set_gej_zinv(&r[i], &a[i], &zi);\n\n        /* Work out way backwards, using the z-ratios to scale the x/y values. */\n        while (i > 0) {\n            secp256k1_fe_mul(&zi, &zi, &zr[i]);\n            i--;\n            secp256k1_ge_set_gej_zinv(&r[i], &a[i], &zi);\n        }\n    }\n}\n\nstatic void secp256k1_ge_globalz_set_table_gej(size_t len, secp256k1_ge *r, secp256k1_fe *globalz, const secp256k1_gej *a, const secp256k1_fe *zr) {\n    size_t i = len - 1;\n    secp256k1_fe zs;\n\n    if (len > 0) {\n        /* The z of the final point gives us the \"global Z\" for the table. */\n        r[i].x = a[i].x;\n        r[i].y = a[i].y;\n        *globalz = a[i].z;\n        r[i].infinity = 0;\n        zs = zr[i];\n\n        /* Work our way backwards, using the z-ratios to scale the x/y values. */\n        while (i > 0) {\n            if (i != len - 1) {\n                secp256k1_fe_mul(&zs, &zs, &zr[i]);\n            }\n            i--;\n            secp256k1_ge_set_gej_zinv(&r[i], &a[i], &zs);\n        }\n    }\n}\n\nstatic void secp256k1_gej_set_infinity(secp256k1_gej *r) {\n    r->infinity = 1;\n    secp256k1_fe_clear(&r->x);\n    secp256k1_fe_clear(&r->y);\n    secp256k1_fe_clear(&r->z);\n}\n\nstatic void secp256k1_gej_clear(secp256k1_gej *r) {\n    r->infinity = 0;\n    secp256k1_fe_clear(&r->x);\n    secp256k1_fe_clear(&r->y);\n    secp256k1_fe_clear(&r->z);\n}\n\nstatic void secp256k1_ge_clear(secp256k1_ge *r) {\n    r->infinity = 0;\n    secp256k1_fe_clear(&r->x);\n    secp256k1_fe_clear(&r->y);\n}\n\nstatic int secp256k1_ge_set_xquad(secp256k1_ge *r, const secp256k1_fe *x) {\n    secp256k1_fe x2, x3, c;\n    r->x = *x;\n    secp256k1_fe_sqr(&x2, x);\n    secp256k1_fe_mul(&x3, x, &x2);\n    r->infinity = 0;\n    secp256k1_fe_set_int(&c, CURVE_B);\n    secp256k1_fe_add(&c, &x3);\n    return secp256k1_fe_sqrt(&r->y, &c);\n}\n\nstatic int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd) {\n    if (!secp256k1_ge_set_xquad(r, x)) {\n        return 0;\n    }\n    secp256k1_fe_normalize_var(&r->y);\n    if (secp256k1_fe_is_odd(&r->y) != odd) {\n        secp256k1_fe_negate(&r->y, &r->y, 1);\n    }\n    return 1;\n\n}\n\nstatic void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a) {\n   r->infinity = a->infinity;\n   r->x = a->x;\n   r->y = a->y;\n   secp256k1_fe_set_int(&r->z, 1);\n}\n\nstatic int secp256k1_gej_eq_x_var(const secp256k1_fe *x, const secp256k1_gej *a) {\n    secp256k1_fe r, r2;\n    VERIFY_CHECK(!a->infinity);\n    secp256k1_fe_sqr(&r, &a->z); secp256k1_fe_mul(&r, &r, x);\n    r2 = a->x; secp256k1_fe_normalize_weak(&r2);\n    return secp256k1_fe_equal_var(&r, &r2);\n}\n\nstatic void secp256k1_gej_neg(secp256k1_gej *r, const secp256k1_gej *a) {\n    r->infinity = a->infinity;\n    r->x = a->x;\n    r->y = a->y;\n    r->z = a->z;\n    secp256k1_fe_normalize_weak(&r->y);\n    secp256k1_fe_negate(&r->y, &r->y, 1);\n}\n\nstatic int secp256k1_gej_is_infinity(const secp256k1_gej *a) {\n    return a->infinity;\n}\n\nstatic int secp256k1_gej_is_valid_var(const secp256k1_gej *a) {\n    secp256k1_fe y2, x3, z2, z6;\n    if (a->infinity) {\n        return 0;\n    }\n    /** y^2 = x^3 + 7\n     *  (Y/Z^3)^2 = (X/Z^2)^3 + 7\n     *  Y^2 / Z^6 = X^3 / Z^6 + 7\n     *  Y^2 = X^3 + 7*Z^6\n     */\n    secp256k1_fe_sqr(&y2, &a->y);\n    secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x);\n    secp256k1_fe_sqr(&z2, &a->z);\n    secp256k1_fe_sqr(&z6, &z2); secp256k1_fe_mul(&z6, &z6, &z2);\n    secp256k1_fe_mul_int(&z6, CURVE_B);\n    secp256k1_fe_add(&x3, &z6);\n    secp256k1_fe_normalize_weak(&x3);\n    return secp256k1_fe_equal_var(&y2, &x3);\n}\n\nstatic int secp256k1_ge_is_valid_var(const secp256k1_ge *a) {\n    secp256k1_fe y2, x3, c;\n    if (a->infinity) {\n        return 0;\n    }\n    /* y^2 = x^3 + 7 */\n    secp256k1_fe_sqr(&y2, &a->y);\n    secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x);\n    secp256k1_fe_set_int(&c, CURVE_B);\n    secp256k1_fe_add(&x3, &c);\n    secp256k1_fe_normalize_weak(&x3);\n    return secp256k1_fe_equal_var(&y2, &x3);\n}\n\nstatic void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) {\n    /* Operations: 3 mul, 4 sqr, 0 normalize, 12 mul_int/add/negate.\n     *\n     * Note that there is an implementation described at\n     *     https://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l\n     * which trades a multiply for a square, but in practice this is actually slower,\n     * mainly because it requires more normalizations.\n     */\n    secp256k1_fe t1,t2,t3,t4;\n    /** For secp256k1, 2Q is infinity if and only if Q is infinity. This is because if 2Q = infinity,\n     *  Q must equal -Q, or that Q.y == -(Q.y), or Q.y is 0. For a point on y^2 = x^3 + 7 to have\n     *  y=0, x^3 must be -7 mod p. However, -7 has no cube root mod p.\n     *\n     *  Having said this, if this function receives a point on a sextic twist, e.g. by\n     *  a fault attack, it is possible for y to be 0. This happens for y^2 = x^3 + 6,\n     *  since -6 does have a cube root mod p. For this point, this function will not set\n     *  the infinity flag even though the point doubles to infinity, and the result\n     *  point will be gibberish (z = 0 but infinity = 0).\n     */\n    r->infinity = a->infinity;\n    if (r->infinity) {\n        if (rzr != NULL) {\n            secp256k1_fe_set_int(rzr, 1);\n        }\n        return;\n    }\n\n    if (rzr != NULL) {\n        *rzr = a->y;\n        secp256k1_fe_normalize_weak(rzr);\n        secp256k1_fe_mul_int(rzr, 2);\n    }\n\n    secp256k1_fe_mul(&r->z, &a->z, &a->y);\n    secp256k1_fe_mul_int(&r->z, 2);       /* Z' = 2*Y*Z (2) */\n    secp256k1_fe_sqr(&t1, &a->x);\n    secp256k1_fe_mul_int(&t1, 3);         /* T1 = 3*X^2 (3) */\n    secp256k1_fe_sqr(&t2, &t1);           /* T2 = 9*X^4 (1) */\n    secp256k1_fe_sqr(&t3, &a->y);\n    secp256k1_fe_mul_int(&t3, 2);         /* T3 = 2*Y^2 (2) */\n    secp256k1_fe_sqr(&t4, &t3);\n    secp256k1_fe_mul_int(&t4, 2);         /* T4 = 8*Y^4 (2) */\n    secp256k1_fe_mul(&t3, &t3, &a->x);    /* T3 = 2*X*Y^2 (1) */\n    r->x = t3;\n    secp256k1_fe_mul_int(&r->x, 4);       /* X' = 8*X*Y^2 (4) */\n    secp256k1_fe_negate(&r->x, &r->x, 4); /* X' = -8*X*Y^2 (5) */\n    secp256k1_fe_add(&r->x, &t2);         /* X' = 9*X^4 - 8*X*Y^2 (6) */\n    secp256k1_fe_negate(&t2, &t2, 1);     /* T2 = -9*X^4 (2) */\n    secp256k1_fe_mul_int(&t3, 6);         /* T3 = 12*X*Y^2 (6) */\n    secp256k1_fe_add(&t3, &t2);           /* T3 = 12*X*Y^2 - 9*X^4 (8) */\n    secp256k1_fe_mul(&r->y, &t1, &t3);    /* Y' = 36*X^3*Y^2 - 27*X^6 (1) */\n    secp256k1_fe_negate(&t2, &t4, 2);     /* T2 = -8*Y^4 (3) */\n    secp256k1_fe_add(&r->y, &t2);         /* Y' = 36*X^3*Y^2 - 27*X^6 - 8*Y^4 (4) */\n}\n\nstatic SECP256K1_INLINE void secp256k1_gej_double_nonzero(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) {\n    VERIFY_CHECK(!secp256k1_gej_is_infinity(a));\n    secp256k1_gej_double_var(r, a, rzr);\n}\n\nstatic void secp256k1_gej_add_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_gej *b, secp256k1_fe *rzr) {\n    /* Operations: 12 mul, 4 sqr, 2 normalize, 12 mul_int/add/negate */\n    secp256k1_fe z22, z12, u1, u2, s1, s2, h, i, i2, h2, h3, t;\n\n    if (a->infinity) {\n        VERIFY_CHECK(rzr == NULL);\n        *r = *b;\n        return;\n    }\n\n    if (b->infinity) {\n        if (rzr != NULL) {\n            secp256k1_fe_set_int(rzr, 1);\n        }\n        *r = *a;\n        return;\n    }\n\n    r->infinity = 0;\n    secp256k1_fe_sqr(&z22, &b->z);\n    secp256k1_fe_sqr(&z12, &a->z);\n    secp256k1_fe_mul(&u1, &a->x, &z22);\n    secp256k1_fe_mul(&u2, &b->x, &z12);\n    secp256k1_fe_mul(&s1, &a->y, &z22); secp256k1_fe_mul(&s1, &s1, &b->z);\n    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);\n    secp256k1_fe_negate(&h, &u1, 1); secp256k1_fe_add(&h, &u2);\n    secp256k1_fe_negate(&i, &s1, 1); secp256k1_fe_add(&i, &s2);\n    if (secp256k1_fe_normalizes_to_zero_var(&h)) {\n        if (secp256k1_fe_normalizes_to_zero_var(&i)) {\n            secp256k1_gej_double_var(r, a, rzr);\n        } else {\n            if (rzr != NULL) {\n                secp256k1_fe_set_int(rzr, 0);\n            }\n            r->infinity = 1;\n        }\n        return;\n    }\n    secp256k1_fe_sqr(&i2, &i);\n    secp256k1_fe_sqr(&h2, &h);\n    secp256k1_fe_mul(&h3, &h, &h2);\n    secp256k1_fe_mul(&h, &h, &b->z);\n    if (rzr != NULL) {\n        *rzr = h;\n    }\n    secp256k1_fe_mul(&r->z, &a->z, &h);\n    secp256k1_fe_mul(&t, &u1, &h2);\n    r->x = t; secp256k1_fe_mul_int(&r->x, 2); secp256k1_fe_add(&r->x, &h3); secp256k1_fe_negate(&r->x, &r->x, 3); secp256k1_fe_add(&r->x, &i2);\n    secp256k1_fe_negate(&r->y, &r->x, 5); secp256k1_fe_add(&r->y, &t); secp256k1_fe_mul(&r->y, &r->y, &i);\n    secp256k1_fe_mul(&h3, &h3, &s1); secp256k1_fe_negate(&h3, &h3, 1);\n    secp256k1_fe_add(&r->y, &h3);\n}\n\nstatic void secp256k1_gej_add_ge_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, secp256k1_fe *rzr) {\n    /* 8 mul, 3 sqr, 4 normalize, 12 mul_int/add/negate */\n    secp256k1_fe z12, u1, u2, s1, s2, h, i, i2, h2, h3, t;\n    if (a->infinity) {\n        VERIFY_CHECK(rzr == NULL);\n        secp256k1_gej_set_ge(r, b);\n        return;\n    }\n    if (b->infinity) {\n        if (rzr != NULL) {\n            secp256k1_fe_set_int(rzr, 1);\n        }\n        *r = *a;\n        return;\n    }\n    r->infinity = 0;\n\n    secp256k1_fe_sqr(&z12, &a->z);\n    u1 = a->x; secp256k1_fe_normalize_weak(&u1);\n    secp256k1_fe_mul(&u2, &b->x, &z12);\n    s1 = a->y; secp256k1_fe_normalize_weak(&s1);\n    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);\n    secp256k1_fe_negate(&h, &u1, 1); secp256k1_fe_add(&h, &u2);\n    secp256k1_fe_negate(&i, &s1, 1); secp256k1_fe_add(&i, &s2);\n    if (secp256k1_fe_normalizes_to_zero_var(&h)) {\n        if (secp256k1_fe_normalizes_to_zero_var(&i)) {\n            secp256k1_gej_double_var(r, a, rzr);\n        } else {\n            if (rzr != NULL) {\n                secp256k1_fe_set_int(rzr, 0);\n            }\n            r->infinity = 1;\n        }\n        return;\n    }\n    secp256k1_fe_sqr(&i2, &i);\n    secp256k1_fe_sqr(&h2, &h);\n    secp256k1_fe_mul(&h3, &h, &h2);\n    if (rzr != NULL) {\n        *rzr = h;\n    }\n    secp256k1_fe_mul(&r->z, &a->z, &h);\n    secp256k1_fe_mul(&t, &u1, &h2);\n    r->x = t; secp256k1_fe_mul_int(&r->x, 2); secp256k1_fe_add(&r->x, &h3); secp256k1_fe_negate(&r->x, &r->x, 3); secp256k1_fe_add(&r->x, &i2);\n    secp256k1_fe_negate(&r->y, &r->x, 5); secp256k1_fe_add(&r->y, &t); secp256k1_fe_mul(&r->y, &r->y, &i);\n    secp256k1_fe_mul(&h3, &h3, &s1); secp256k1_fe_negate(&h3, &h3, 1);\n    secp256k1_fe_add(&r->y, &h3);\n}\n\nstatic void secp256k1_gej_add_zinv_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, const secp256k1_fe *bzinv) {\n    /* 9 mul, 3 sqr, 4 normalize, 12 mul_int/add/negate */\n    secp256k1_fe az, z12, u1, u2, s1, s2, h, i, i2, h2, h3, t;\n\n    if (b->infinity) {\n        *r = *a;\n        return;\n    }\n    if (a->infinity) {\n        secp256k1_fe bzinv2, bzinv3;\n        r->infinity = b->infinity;\n        secp256k1_fe_sqr(&bzinv2, bzinv);\n        secp256k1_fe_mul(&bzinv3, &bzinv2, bzinv);\n        secp256k1_fe_mul(&r->x, &b->x, &bzinv2);\n        secp256k1_fe_mul(&r->y, &b->y, &bzinv3);\n        secp256k1_fe_set_int(&r->z, 1);\n        return;\n    }\n    r->infinity = 0;\n\n    /** We need to calculate (rx,ry,rz) = (ax,ay,az) + (bx,by,1/bzinv). Due to\n     *  secp256k1's isomorphism we can multiply the Z coordinates on both sides\n     *  by bzinv, and get: (rx,ry,rz*bzinv) = (ax,ay,az*bzinv) + (bx,by,1).\n     *  This means that (rx,ry,rz) can be calculated as\n     *  (ax,ay,az*bzinv) + (bx,by,1), when not applying the bzinv factor to rz.\n     *  The variable az below holds the modified Z coordinate for a, which is used\n     *  for the computation of rx and ry, but not for rz.\n     */\n    secp256k1_fe_mul(&az, &a->z, bzinv);\n\n    secp256k1_fe_sqr(&z12, &az);\n    u1 = a->x; secp256k1_fe_normalize_weak(&u1);\n    secp256k1_fe_mul(&u2, &b->x, &z12);\n    s1 = a->y; secp256k1_fe_normalize_weak(&s1);\n    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);\n    secp256k1_fe_negate(&h, &u1, 1); secp256k1_fe_add(&h, &u2);\n    secp256k1_fe_negate(&i, &s1, 1); secp256k1_fe_add(&i, &s2);\n    if (secp256k1_fe_normalizes_to_zero_var(&h)) {\n        if (secp256k1_fe_normalizes_to_zero_var(&i)) {\n            secp256k1_gej_double_var(r, a, NULL);\n        } else {\n            r->infinity = 1;\n        }\n        return;\n    }\n    secp256k1_fe_sqr(&i2, &i);\n    secp256k1_fe_sqr(&h2, &h);\n    secp256k1_fe_mul(&h3, &h, &h2);\n    r->z = a->z; secp256k1_fe_mul(&r->z, &r->z, &h);\n    secp256k1_fe_mul(&t, &u1, &h2);\n    r->x = t; secp256k1_fe_mul_int(&r->x, 2); secp256k1_fe_add(&r->x, &h3); secp256k1_fe_negate(&r->x, &r->x, 3); secp256k1_fe_add(&r->x, &i2);\n    secp256k1_fe_negate(&r->y, &r->x, 5); secp256k1_fe_add(&r->y, &t); secp256k1_fe_mul(&r->y, &r->y, &i);\n    secp256k1_fe_mul(&h3, &h3, &s1); secp256k1_fe_negate(&h3, &h3, 1);\n    secp256k1_fe_add(&r->y, &h3);\n}\n\n\nstatic void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b) {\n    /* Operations: 7 mul, 5 sqr, 4 normalize, 21 mul_int/add/negate/cmov */\n    static const secp256k1_fe fe_1 = SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 1);\n    secp256k1_fe zz, u1, u2, s1, s2, t, tt, m, n, q, rr;\n    secp256k1_fe m_alt, rr_alt;\n    int infinity, degenerate;\n    VERIFY_CHECK(!b->infinity);\n    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);\n\n    /** In:\n     *    Eric Brier and Marc Joye, Weierstrass Elliptic Curves and Side-Channel Attacks.\n     *    In D. Naccache and P. Paillier, Eds., Public Key Cryptography, vol. 2274 of Lecture Notes in Computer Science, pages 335-345. Springer-Verlag, 2002.\n     *  we find as solution for a unified addition/doubling formula:\n     *    lambda = ((x1 + x2)^2 - x1 * x2 + a) / (y1 + y2), with a = 0 for secp256k1's curve equation.\n     *    x3 = lambda^2 - (x1 + x2)\n     *    2*y3 = lambda * (x1 + x2 - 2 * x3) - (y1 + y2).\n     *\n     *  Substituting x_i = Xi / Zi^2 and yi = Yi / Zi^3, for i=1,2,3, gives:\n     *    U1 = X1*Z2^2, U2 = X2*Z1^2\n     *    S1 = Y1*Z2^3, S2 = Y2*Z1^3\n     *    Z = Z1*Z2\n     *    T = U1+U2\n     *    M = S1+S2\n     *    Q = T*M^2\n     *    R = T^2-U1*U2\n     *    X3 = 4*(R^2-Q)\n     *    Y3 = 4*(R*(3*Q-2*R^2)-M^4)\n     *    Z3 = 2*M*Z\n     *  (Note that the paper uses xi = Xi / Zi and yi = Yi / Zi instead.)\n     *\n     *  This formula has the benefit of being the same for both addition\n     *  of distinct points and doubling. However, it breaks down in the\n     *  case that either point is infinity, or that y1 = -y2. We handle\n     *  these cases in the following ways:\n     *\n     *    - If b is infinity we simply bail by means of a VERIFY_CHECK.\n     *\n     *    - If a is infinity, we detect this, and at the end of the\n     *      computation replace the result (which will be meaningless,\n     *      but we compute to be constant-time) with b.x : b.y : 1.\n     *\n     *    - If a = -b, we have y1 = -y2, which is a degenerate case.\n     *      But here the answer is infinity, so we simply set the\n     *      infinity flag of the result, overriding the computed values\n     *      without even needing to cmov.\n     *\n     *    - If y1 = -y2 but x1 != x2, which does occur thanks to certain\n     *      properties of our curve (specifically, 1 has nontrivial cube\n     *      roots in our field, and the curve equation has no x coefficient)\n     *      then the answer is not infinity but also not given by the above\n     *      equation. In this case, we cmov in place an alternate expression\n     *      for lambda. Specifically (y1 - y2)/(x1 - x2). Where both these\n     *      expressions for lambda are defined, they are equal, and can be\n     *      obtained from each other by multiplication by (y1 + y2)/(y1 + y2)\n     *      then substitution of x^3 + 7 for y^2 (using the curve equation).\n     *      For all pairs of nonzero points (a, b) at least one is defined,\n     *      so this covers everything.\n     */\n\n    secp256k1_fe_sqr(&zz, &a->z);                       /* z = Z1^2 */\n    u1 = a->x; secp256k1_fe_normalize_weak(&u1);        /* u1 = U1 = X1*Z2^2 (1) */\n    secp256k1_fe_mul(&u2, &b->x, &zz);                  /* u2 = U2 = X2*Z1^2 (1) */\n    s1 = a->y; secp256k1_fe_normalize_weak(&s1);        /* s1 = S1 = Y1*Z2^3 (1) */\n    secp256k1_fe_mul(&s2, &b->y, &zz);                  /* s2 = Y2*Z1^2 (1) */\n    secp256k1_fe_mul(&s2, &s2, &a->z);                  /* s2 = S2 = Y2*Z1^3 (1) */\n    t = u1; secp256k1_fe_add(&t, &u2);                  /* t = T = U1+U2 (2) */\n    m = s1; secp256k1_fe_add(&m, &s2);                  /* m = M = S1+S2 (2) */\n    secp256k1_fe_sqr(&rr, &t);                          /* rr = T^2 (1) */\n    secp256k1_fe_negate(&m_alt, &u2, 1);                /* Malt = -X2*Z1^2 */\n    secp256k1_fe_mul(&tt, &u1, &m_alt);                 /* tt = -U1*U2 (2) */\n    secp256k1_fe_add(&rr, &tt);                         /* rr = R = T^2-U1*U2 (3) */\n    /** If lambda = R/M = 0/0 we have a problem (except in the \"trivial\"\n     *  case that Z = z1z2 = 0, and this is special-cased later on). */\n    degenerate = secp256k1_fe_normalizes_to_zero(&m) &\n                 secp256k1_fe_normalizes_to_zero(&rr);\n    /* This only occurs when y1 == -y2 and x1^3 == x2^3, but x1 != x2.\n     * This means either x1 == beta*x2 or beta*x1 == x2, where beta is\n     * a nontrivial cube root of one. In either case, an alternate\n     * non-indeterminate expression for lambda is (y1 - y2)/(x1 - x2),\n     * so we set R/M equal to this. */\n    rr_alt = s1;\n    secp256k1_fe_mul_int(&rr_alt, 2);       /* rr = Y1*Z2^3 - Y2*Z1^3 (2) */\n    secp256k1_fe_add(&m_alt, &u1);          /* Malt = X1*Z2^2 - X2*Z1^2 */\n\n    secp256k1_fe_cmov(&rr_alt, &rr, !degenerate);\n    secp256k1_fe_cmov(&m_alt, &m, !degenerate);\n    /* Now Ralt / Malt = lambda and is guaranteed not to be 0/0.\n     * From here on out Ralt and Malt represent the numerator\n     * and denominator of lambda; R and M represent the explicit\n     * expressions x1^2 + x2^2 + x1x2 and y1 + y2. */\n    secp256k1_fe_sqr(&n, &m_alt);                       /* n = Malt^2 (1) */\n    secp256k1_fe_mul(&q, &n, &t);                       /* q = Q = T*Malt^2 (1) */\n    /* These two lines use the observation that either M == Malt or M == 0,\n     * so M^3 * Malt is either Malt^4 (which is computed by squaring), or\n     * zero (which is \"computed\" by cmov). So the cost is one squaring\n     * versus two multiplications. */\n    secp256k1_fe_sqr(&n, &n);\n    secp256k1_fe_cmov(&n, &m, degenerate);              /* n = M^3 * Malt (2) */\n    secp256k1_fe_sqr(&t, &rr_alt);                      /* t = Ralt^2 (1) */\n    secp256k1_fe_mul(&r->z, &a->z, &m_alt);             /* r->z = Malt*Z (1) */\n    infinity = secp256k1_fe_normalizes_to_zero(&r->z) * (1 - a->infinity);\n    secp256k1_fe_mul_int(&r->z, 2);                     /* r->z = Z3 = 2*Malt*Z (2) */\n    secp256k1_fe_negate(&q, &q, 1);                     /* q = -Q (2) */\n    secp256k1_fe_add(&t, &q);                           /* t = Ralt^2-Q (3) */\n    secp256k1_fe_normalize_weak(&t);\n    r->x = t;                                           /* r->x = Ralt^2-Q (1) */\n    secp256k1_fe_mul_int(&t, 2);                        /* t = 2*x3 (2) */\n    secp256k1_fe_add(&t, &q);                           /* t = 2*x3 - Q: (4) */\n    secp256k1_fe_mul(&t, &t, &rr_alt);                  /* t = Ralt*(2*x3 - Q) (1) */\n    secp256k1_fe_add(&t, &n);                           /* t = Ralt*(2*x3 - Q) + M^3*Malt (3) */\n    secp256k1_fe_negate(&r->y, &t, 3);                  /* r->y = Ralt*(Q - 2x3) - M^3*Malt (4) */\n    secp256k1_fe_normalize_weak(&r->y);\n    secp256k1_fe_mul_int(&r->x, 4);                     /* r->x = X3 = 4*(Ralt^2-Q) */\n    secp256k1_fe_mul_int(&r->y, 4);                     /* r->y = Y3 = 4*Ralt*(Q - 2x3) - 4*M^3*Malt (4) */\n\n    /** In case a->infinity == 1, replace r with (b->x, b->y, 1). */\n    secp256k1_fe_cmov(&r->x, &b->x, a->infinity);\n    secp256k1_fe_cmov(&r->y, &b->y, a->infinity);\n    secp256k1_fe_cmov(&r->z, &fe_1, a->infinity);\n    r->infinity = infinity;\n}\n\nstatic void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *s) {\n    /* Operations: 4 mul, 1 sqr */\n    secp256k1_fe zz;\n    VERIFY_CHECK(!secp256k1_fe_is_zero(s));\n    secp256k1_fe_sqr(&zz, s);\n    secp256k1_fe_mul(&r->x, &r->x, &zz);                /* r->x *= s^2 */\n    secp256k1_fe_mul(&r->y, &r->y, &zz);\n    secp256k1_fe_mul(&r->y, &r->y, s);                  /* r->y *= s^3 */\n    secp256k1_fe_mul(&r->z, &r->z, s);                  /* r->z *= s   */\n}\n\nstatic void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a) {\n    secp256k1_fe x, y;\n    VERIFY_CHECK(!a->infinity);\n    x = a->x;\n    secp256k1_fe_normalize(&x);\n    y = a->y;\n    secp256k1_fe_normalize(&y);\n    secp256k1_fe_to_storage(&r->x, &x);\n    secp256k1_fe_to_storage(&r->y, &y);\n}\n\nstatic void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a) {\n    secp256k1_fe_from_storage(&r->x, &a->x);\n    secp256k1_fe_from_storage(&r->y, &a->y);\n    r->infinity = 0;\n}\n\nstatic SECP256K1_INLINE void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag) {\n    secp256k1_fe_storage_cmov(&r->x, &a->x, flag);\n    secp256k1_fe_storage_cmov(&r->y, &a->y, flag);\n}\n\n#ifdef USE_ENDOMORPHISM\nstatic void secp256k1_ge_mul_lambda(secp256k1_ge *r, const secp256k1_ge *a) {\n    static const secp256k1_fe beta = SECP256K1_FE_CONST(\n        0x7ae96a2bul, 0x657c0710ul, 0x6e64479eul, 0xac3434e9ul,\n        0x9cf04975ul, 0x12f58995ul, 0xc1396c28ul, 0x719501eeul\n    );\n    *r = *a;\n    secp256k1_fe_mul(&r->x, &r->x, &beta);\n}\n#endif\n\nstatic int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a) {\n    secp256k1_fe yz;\n\n    if (a->infinity) {\n        return 0;\n    }\n\n    /* We rely on the fact that the Jacobi symbol of 1 / a->z^3 is the same as\n     * that of a->z. Thus a->y / a->z^3 is a quadratic residue iff a->y * a->z\n       is */\n    secp256k1_fe_mul(&yz, &a->y, &a->z);\n    return secp256k1_fe_is_quad_var(&yz);\n}\n\n#endif /* SECP256K1_GROUP_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/hash.h",
    "content": "/**********************************************************************\n * Copyright (c) 2014 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_HASH_H\n#define SECP256K1_HASH_H\n\n#include <stdlib.h>\n#include <stdint.h>\n\ntypedef struct {\n    uint32_t s[8];\n    uint32_t buf[16]; /* In big endian */\n    size_t bytes;\n} secp256k1_sha256_t;\n\nstatic void secp256k1_sha256_initialize(secp256k1_sha256_t *hash);\nstatic void secp256k1_sha256_write(secp256k1_sha256_t *hash, const unsigned char *data, size_t size);\nstatic void secp256k1_sha256_finalize(secp256k1_sha256_t *hash, unsigned char *out32);\n\ntypedef struct {\n    secp256k1_sha256_t inner, outer;\n} secp256k1_hmac_sha256_t;\n\nstatic void secp256k1_hmac_sha256_initialize(secp256k1_hmac_sha256_t *hash, const unsigned char *key, size_t size);\nstatic void secp256k1_hmac_sha256_write(secp256k1_hmac_sha256_t *hash, const unsigned char *data, size_t size);\nstatic void secp256k1_hmac_sha256_finalize(secp256k1_hmac_sha256_t *hash, unsigned char *out32);\n\ntypedef struct {\n    unsigned char v[32];\n    unsigned char k[32];\n    int retry;\n} secp256k1_rfc6979_hmac_sha256_t;\n\nstatic void secp256k1_rfc6979_hmac_sha256_initialize(secp256k1_rfc6979_hmac_sha256_t *rng, const unsigned char *key, size_t keylen);\nstatic void secp256k1_rfc6979_hmac_sha256_generate(secp256k1_rfc6979_hmac_sha256_t *rng, unsigned char *out, size_t outlen);\nstatic void secp256k1_rfc6979_hmac_sha256_finalize(secp256k1_rfc6979_hmac_sha256_t *rng);\n\n#endif /* SECP256K1_HASH_H */\n"
  },
  {
    "path": "src/secp256k1/src/hash_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2014 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_HASH_IMPL_H\n#define SECP256K1_HASH_IMPL_H\n\n#include \"hash.h\"\n\n#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n\n#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))\n#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))\n#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))\n#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))\n#define sigma0(x) (((x) >> 7 | (x) << 25) ^ ((x) >> 18 | (x) << 14) ^ ((x) >> 3))\n#define sigma1(x) (((x) >> 17 | (x) << 15) ^ ((x) >> 19 | (x) << 13) ^ ((x) >> 10))\n\n#define Round(a,b,c,d,e,f,g,h,k,w) do { \\\n    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \\\n    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \\\n    (d) += t1; \\\n    (h) = t1 + t2; \\\n} while(0)\n\n#ifdef WORDS_BIGENDIAN\n#define BE32(x) (x)\n#else\n#define BE32(p) ((((p) & 0xFF) << 24) | (((p) & 0xFF00) << 8) | (((p) & 0xFF0000) >> 8) | (((p) & 0xFF000000) >> 24))\n#endif\n\nstatic void secp256k1_sha256_initialize(secp256k1_sha256_t *hash) {\n    hash->s[0] = 0x6a09e667ul;\n    hash->s[1] = 0xbb67ae85ul;\n    hash->s[2] = 0x3c6ef372ul;\n    hash->s[3] = 0xa54ff53aul;\n    hash->s[4] = 0x510e527ful;\n    hash->s[5] = 0x9b05688cul;\n    hash->s[6] = 0x1f83d9abul;\n    hash->s[7] = 0x5be0cd19ul;\n    hash->bytes = 0;\n}\n\n/** Perform one SHA-256 transformation, processing 16 big endian 32-bit words. */\nstatic void secp256k1_sha256_transform(uint32_t* s, const uint32_t* chunk) {\n    uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7];\n    uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;\n\n    Round(a, b, c, d, e, f, g, h, 0x428a2f98, w0 = BE32(chunk[0]));\n    Round(h, a, b, c, d, e, f, g, 0x71374491, w1 = BE32(chunk[1]));\n    Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf, w2 = BE32(chunk[2]));\n    Round(f, g, h, a, b, c, d, e, 0xe9b5dba5, w3 = BE32(chunk[3]));\n    Round(e, f, g, h, a, b, c, d, 0x3956c25b, w4 = BE32(chunk[4]));\n    Round(d, e, f, g, h, a, b, c, 0x59f111f1, w5 = BE32(chunk[5]));\n    Round(c, d, e, f, g, h, a, b, 0x923f82a4, w6 = BE32(chunk[6]));\n    Round(b, c, d, e, f, g, h, a, 0xab1c5ed5, w7 = BE32(chunk[7]));\n    Round(a, b, c, d, e, f, g, h, 0xd807aa98, w8 = BE32(chunk[8]));\n    Round(h, a, b, c, d, e, f, g, 0x12835b01, w9 = BE32(chunk[9]));\n    Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = BE32(chunk[10]));\n    Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = BE32(chunk[11]));\n    Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = BE32(chunk[12]));\n    Round(d, e, f, g, h, a, b, c, 0x80deb1fe, w13 = BE32(chunk[13]));\n    Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = BE32(chunk[14]));\n    Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = BE32(chunk[15]));\n\n    Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0(w1));\n    Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0(w2));\n    Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1(w0) + w11 + sigma0(w3));\n    Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1(w1) + w12 + sigma0(w4));\n    Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1(w2) + w13 + sigma0(w5));\n    Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1(w3) + w14 + sigma0(w6));\n    Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1(w4) + w15 + sigma0(w7));\n    Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1(w5) + w0 + sigma0(w8));\n    Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1(w6) + w1 + sigma0(w9));\n    Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1(w7) + w2 + sigma0(w10));\n    Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1(w8) + w3 + sigma0(w11));\n    Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1(w9) + w4 + sigma0(w12));\n    Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13));\n    Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14));\n    Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15));\n    Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0(w0));\n\n    Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0(w1));\n    Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0(w2));\n    Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1(w0) + w11 + sigma0(w3));\n    Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1(w1) + w12 + sigma0(w4));\n    Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1(w2) + w13 + sigma0(w5));\n    Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1(w3) + w14 + sigma0(w6));\n    Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1(w4) + w15 + sigma0(w7));\n    Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1(w5) + w0 + sigma0(w8));\n    Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1(w6) + w1 + sigma0(w9));\n    Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1(w7) + w2 + sigma0(w10));\n    Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1(w8) + w3 + sigma0(w11));\n    Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1(w9) + w4 + sigma0(w12));\n    Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13));\n    Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14));\n    Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15));\n    Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0(w0));\n\n    Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0(w1));\n    Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0(w2));\n    Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1(w0) + w11 + sigma0(w3));\n    Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1(w1) + w12 + sigma0(w4));\n    Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1(w2) + w13 + sigma0(w5));\n    Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1(w3) + w14 + sigma0(w6));\n    Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1(w4) + w15 + sigma0(w7));\n    Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1(w5) + w0 + sigma0(w8));\n    Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1(w6) + w1 + sigma0(w9));\n    Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1(w7) + w2 + sigma0(w10));\n    Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1(w8) + w3 + sigma0(w11));\n    Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1(w9) + w4 + sigma0(w12));\n    Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13));\n    Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14));\n    Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15));\n    Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0(w0));\n\n    s[0] += a;\n    s[1] += b;\n    s[2] += c;\n    s[3] += d;\n    s[4] += e;\n    s[5] += f;\n    s[6] += g;\n    s[7] += h;\n}\n\nstatic void secp256k1_sha256_write(secp256k1_sha256_t *hash, const unsigned char *data, size_t len) {\n    size_t bufsize = hash->bytes & 0x3F;\n    hash->bytes += len;\n    while (bufsize + len >= 64) {\n        /* Fill the buffer, and process it. */\n        memcpy(((unsigned char*)hash->buf) + bufsize, data, 64 - bufsize);\n        data += 64 - bufsize;\n        len -= 64 - bufsize;\n        secp256k1_sha256_transform(hash->s, hash->buf);\n        bufsize = 0;\n    }\n    if (len) {\n        /* Fill the buffer with what remains. */\n        memcpy(((unsigned char*)hash->buf) + bufsize, data, len);\n    }\n}\n\nstatic void secp256k1_sha256_finalize(secp256k1_sha256_t *hash, unsigned char *out32) {\n    static const unsigned char pad[64] = {0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n    uint32_t sizedesc[2];\n    uint32_t out[8];\n    int i = 0;\n    sizedesc[0] = BE32(hash->bytes >> 29);\n    sizedesc[1] = BE32(hash->bytes << 3);\n    secp256k1_sha256_write(hash, pad, 1 + ((119 - (hash->bytes % 64)) % 64));\n    secp256k1_sha256_write(hash, (const unsigned char*)sizedesc, 8);\n    for (i = 0; i < 8; i++) {\n        out[i] = BE32(hash->s[i]);\n        hash->s[i] = 0;\n    }\n    memcpy(out32, (const unsigned char*)out, 32);\n}\n\nstatic void secp256k1_hmac_sha256_initialize(secp256k1_hmac_sha256_t *hash, const unsigned char *key, size_t keylen) {\n    int n;\n    unsigned char rkey[64];\n    if (keylen <= 64) {\n        memcpy(rkey, key, keylen);\n        memset(rkey + keylen, 0, 64 - keylen);\n    } else {\n        secp256k1_sha256_t sha256;\n        secp256k1_sha256_initialize(&sha256);\n        secp256k1_sha256_write(&sha256, key, keylen);\n        secp256k1_sha256_finalize(&sha256, rkey);\n        memset(rkey + 32, 0, 32);\n    }\n\n    secp256k1_sha256_initialize(&hash->outer);\n    for (n = 0; n < 64; n++) {\n        rkey[n] ^= 0x5c;\n    }\n    secp256k1_sha256_write(&hash->outer, rkey, 64);\n\n    secp256k1_sha256_initialize(&hash->inner);\n    for (n = 0; n < 64; n++) {\n        rkey[n] ^= 0x5c ^ 0x36;\n    }\n    secp256k1_sha256_write(&hash->inner, rkey, 64);\n    memset(rkey, 0, 64);\n}\n\nstatic void secp256k1_hmac_sha256_write(secp256k1_hmac_sha256_t *hash, const unsigned char *data, size_t size) {\n    secp256k1_sha256_write(&hash->inner, data, size);\n}\n\nstatic void secp256k1_hmac_sha256_finalize(secp256k1_hmac_sha256_t *hash, unsigned char *out32) {\n    unsigned char temp[32];\n    secp256k1_sha256_finalize(&hash->inner, temp);\n    secp256k1_sha256_write(&hash->outer, temp, 32);\n    memset(temp, 0, 32);\n    secp256k1_sha256_finalize(&hash->outer, out32);\n}\n\n\nstatic void secp256k1_rfc6979_hmac_sha256_initialize(secp256k1_rfc6979_hmac_sha256_t *rng, const unsigned char *key, size_t keylen) {\n    secp256k1_hmac_sha256_t hmac;\n    static const unsigned char zero[1] = {0x00};\n    static const unsigned char one[1] = {0x01};\n\n    memset(rng->v, 0x01, 32); /* RFC6979 3.2.b. */\n    memset(rng->k, 0x00, 32); /* RFC6979 3.2.c. */\n\n    /* RFC6979 3.2.d. */\n    secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);\n    secp256k1_hmac_sha256_write(&hmac, rng->v, 32);\n    secp256k1_hmac_sha256_write(&hmac, zero, 1);\n    secp256k1_hmac_sha256_write(&hmac, key, keylen);\n    secp256k1_hmac_sha256_finalize(&hmac, rng->k);\n    secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);\n    secp256k1_hmac_sha256_write(&hmac, rng->v, 32);\n    secp256k1_hmac_sha256_finalize(&hmac, rng->v);\n\n    /* RFC6979 3.2.f. */\n    secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);\n    secp256k1_hmac_sha256_write(&hmac, rng->v, 32);\n    secp256k1_hmac_sha256_write(&hmac, one, 1);\n    secp256k1_hmac_sha256_write(&hmac, key, keylen);\n    secp256k1_hmac_sha256_finalize(&hmac, rng->k);\n    secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);\n    secp256k1_hmac_sha256_write(&hmac, rng->v, 32);\n    secp256k1_hmac_sha256_finalize(&hmac, rng->v);\n    rng->retry = 0;\n}\n\nstatic void secp256k1_rfc6979_hmac_sha256_generate(secp256k1_rfc6979_hmac_sha256_t *rng, unsigned char *out, size_t outlen) {\n    /* RFC6979 3.2.h. */\n    static const unsigned char zero[1] = {0x00};\n    if (rng->retry) {\n        secp256k1_hmac_sha256_t hmac;\n        secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);\n        secp256k1_hmac_sha256_write(&hmac, rng->v, 32);\n        secp256k1_hmac_sha256_write(&hmac, zero, 1);\n        secp256k1_hmac_sha256_finalize(&hmac, rng->k);\n        secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);\n        secp256k1_hmac_sha256_write(&hmac, rng->v, 32);\n        secp256k1_hmac_sha256_finalize(&hmac, rng->v);\n    }\n\n    while (outlen > 0) {\n        secp256k1_hmac_sha256_t hmac;\n        int now = outlen;\n        secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);\n        secp256k1_hmac_sha256_write(&hmac, rng->v, 32);\n        secp256k1_hmac_sha256_finalize(&hmac, rng->v);\n        if (now > 32) {\n            now = 32;\n        }\n        memcpy(out, rng->v, now);\n        out += now;\n        outlen -= now;\n    }\n\n    rng->retry = 1;\n}\n\nstatic void secp256k1_rfc6979_hmac_sha256_finalize(secp256k1_rfc6979_hmac_sha256_t *rng) {\n    memset(rng->k, 0, 32);\n    memset(rng->v, 0, 32);\n    rng->retry = 0;\n}\n\n#undef BE32\n#undef Round\n#undef sigma1\n#undef sigma0\n#undef Sigma1\n#undef Sigma0\n#undef Maj\n#undef Ch\n\n#endif /* SECP256K1_HASH_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/java/org/bitcoin/NativeSecp256k1.java",
    "content": "/*\n * Copyright 2013 Google Inc.\n * Copyright 2014-2016 the libsecp256k1 contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.bitcoin;\n\nimport java.nio.ByteBuffer;\nimport java.nio.ByteOrder;\n\nimport java.math.BigInteger;\nimport com.google.common.base.Preconditions;\nimport java.util.concurrent.locks.Lock;\nimport java.util.concurrent.locks.ReentrantReadWriteLock;\nimport static org.bitcoin.NativeSecp256k1Util.*;\n\n/**\n * <p>This class holds native methods to handle ECDSA verification.</p>\n *\n * <p>You can find an example library that can be used for this at https://github.com/bitcoin/secp256k1</p>\n *\n * <p>To build secp256k1 for use with bitcoinj, run\n * `./configure --enable-jni --enable-experimental --enable-module-ecdh`\n * and `make` then copy `.libs/libsecp256k1.so` to your system library path\n * or point the JVM to the folder containing it with -Djava.library.path\n * </p>\n */\npublic class NativeSecp256k1 {\n\n    private static final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();\n    private static final Lock r = rwl.readLock();\n    private static final Lock w = rwl.writeLock();\n    private static ThreadLocal<ByteBuffer> nativeECDSABuffer = new ThreadLocal<ByteBuffer>();\n    /**\n     * Verifies the given secp256k1 signature in native code.\n     * Calling when enabled == false is undefined (probably library not loaded)\n     *\n     * @param data The data which was signed, must be exactly 32 bytes\n     * @param signature The signature\n     * @param pub The public key which did the signing\n     */\n    public static boolean verify(byte[] data, byte[] signature, byte[] pub) throws AssertFailException{\n        Preconditions.checkArgument(data.length == 32 && signature.length <= 520 && pub.length <= 520);\n\n        ByteBuffer byteBuff = nativeECDSABuffer.get();\n        if (byteBuff == null || byteBuff.capacity() < 520) {\n            byteBuff = ByteBuffer.allocateDirect(520);\n            byteBuff.order(ByteOrder.nativeOrder());\n            nativeECDSABuffer.set(byteBuff);\n        }\n        byteBuff.rewind();\n        byteBuff.put(data);\n        byteBuff.put(signature);\n        byteBuff.put(pub);\n\n        byte[][] retByteArray;\n\n        r.lock();\n        try {\n          return secp256k1_ecdsa_verify(byteBuff, Secp256k1Context.getContext(), signature.length, pub.length) == 1;\n        } finally {\n          r.unlock();\n        }\n    }\n\n    /**\n     * libsecp256k1 Create an ECDSA signature.\n     *\n     * @param data Message hash, 32 bytes\n     * @param key Secret key, 32 bytes\n     *\n     * Return values\n     * @param sig byte array of signature\n     */\n    public static byte[] sign(byte[] data, byte[] sec) throws AssertFailException{\n        Preconditions.checkArgument(data.length == 32 && sec.length <= 32);\n\n        ByteBuffer byteBuff = nativeECDSABuffer.get();\n        if (byteBuff == null || byteBuff.capacity() < 32 + 32) {\n            byteBuff = ByteBuffer.allocateDirect(32 + 32);\n            byteBuff.order(ByteOrder.nativeOrder());\n            nativeECDSABuffer.set(byteBuff);\n        }\n        byteBuff.rewind();\n        byteBuff.put(data);\n        byteBuff.put(sec);\n\n        byte[][] retByteArray;\n\n        r.lock();\n        try {\n          retByteArray = secp256k1_ecdsa_sign(byteBuff, Secp256k1Context.getContext());\n        } finally {\n          r.unlock();\n        }\n\n        byte[] sigArr = retByteArray[0];\n        int sigLen = new BigInteger(new byte[] { retByteArray[1][0] }).intValue();\n        int retVal = new BigInteger(new byte[] { retByteArray[1][1] }).intValue();\n\n        assertEquals(sigArr.length, sigLen, \"Got bad signature length.\");\n\n        return retVal == 0 ? new byte[0] : sigArr;\n    }\n\n    /**\n     * libsecp256k1 Seckey Verify - returns 1 if valid, 0 if invalid\n     *\n     * @param seckey ECDSA Secret key, 32 bytes\n     */\n    public static boolean secKeyVerify(byte[] seckey) {\n        Preconditions.checkArgument(seckey.length == 32);\n\n        ByteBuffer byteBuff = nativeECDSABuffer.get();\n        if (byteBuff == null || byteBuff.capacity() < seckey.length) {\n            byteBuff = ByteBuffer.allocateDirect(seckey.length);\n            byteBuff.order(ByteOrder.nativeOrder());\n            nativeECDSABuffer.set(byteBuff);\n        }\n        byteBuff.rewind();\n        byteBuff.put(seckey);\n\n        r.lock();\n        try {\n          return secp256k1_ec_seckey_verify(byteBuff,Secp256k1Context.getContext()) == 1;\n        } finally {\n          r.unlock();\n        }\n    }\n\n\n    /**\n     * libsecp256k1 Compute Pubkey - computes public key from secret key\n     *\n     * @param seckey ECDSA Secret key, 32 bytes\n     *\n     * Return values\n     * @param pubkey ECDSA Public key, 33 or 65 bytes\n     */\n    //TODO add a 'compressed' arg\n    public static byte[] computePubkey(byte[] seckey) throws AssertFailException{\n        Preconditions.checkArgument(seckey.length == 32);\n\n        ByteBuffer byteBuff = nativeECDSABuffer.get();\n        if (byteBuff == null || byteBuff.capacity() < seckey.length) {\n            byteBuff = ByteBuffer.allocateDirect(seckey.length);\n            byteBuff.order(ByteOrder.nativeOrder());\n            nativeECDSABuffer.set(byteBuff);\n        }\n        byteBuff.rewind();\n        byteBuff.put(seckey);\n\n        byte[][] retByteArray;\n\n        r.lock();\n        try {\n          retByteArray = secp256k1_ec_pubkey_create(byteBuff, Secp256k1Context.getContext());\n        } finally {\n          r.unlock();\n        }\n\n        byte[] pubArr = retByteArray[0];\n        int pubLen = new BigInteger(new byte[] { retByteArray[1][0] }).intValue();\n        int retVal = new BigInteger(new byte[] { retByteArray[1][1] }).intValue();\n\n        assertEquals(pubArr.length, pubLen, \"Got bad pubkey length.\");\n\n        return retVal == 0 ? new byte[0]: pubArr;\n    }\n\n    /**\n     * libsecp256k1 Cleanup - This destroys the secp256k1 context object\n     * This should be called at the end of the program for proper cleanup of the context.\n     */\n    public static synchronized void cleanup() {\n        w.lock();\n        try {\n          secp256k1_destroy_context(Secp256k1Context.getContext());\n        } finally {\n          w.unlock();\n        }\n    }\n\n    public static long cloneContext() {\n       r.lock();\n       try {\n        return secp256k1_ctx_clone(Secp256k1Context.getContext());\n       } finally { r.unlock(); }\n    }\n\n    /**\n     * libsecp256k1 PrivKey Tweak-Mul - Tweak privkey by multiplying to it\n     *\n     * @param tweak some bytes to tweak with\n     * @param seckey 32-byte seckey\n     */\n    public static byte[] privKeyTweakMul(byte[] privkey, byte[] tweak) throws AssertFailException{\n        Preconditions.checkArgument(privkey.length == 32);\n\n        ByteBuffer byteBuff = nativeECDSABuffer.get();\n        if (byteBuff == null || byteBuff.capacity() < privkey.length + tweak.length) {\n            byteBuff = ByteBuffer.allocateDirect(privkey.length + tweak.length);\n            byteBuff.order(ByteOrder.nativeOrder());\n            nativeECDSABuffer.set(byteBuff);\n        }\n        byteBuff.rewind();\n        byteBuff.put(privkey);\n        byteBuff.put(tweak);\n\n        byte[][] retByteArray;\n        r.lock();\n        try {\n          retByteArray = secp256k1_privkey_tweak_mul(byteBuff,Secp256k1Context.getContext());\n        } finally {\n          r.unlock();\n        }\n\n        byte[] privArr = retByteArray[0];\n\n        int privLen = (byte) new BigInteger(new byte[] { retByteArray[1][0] }).intValue() & 0xFF;\n        int retVal = new BigInteger(new byte[] { retByteArray[1][1] }).intValue();\n\n        assertEquals(privArr.length, privLen, \"Got bad pubkey length.\");\n\n        assertEquals(retVal, 1, \"Failed return value check.\");\n\n        return privArr;\n    }\n\n    /**\n     * libsecp256k1 PrivKey Tweak-Add - Tweak privkey by adding to it\n     *\n     * @param tweak some bytes to tweak with\n     * @param seckey 32-byte seckey\n     */\n    public static byte[] privKeyTweakAdd(byte[] privkey, byte[] tweak) throws AssertFailException{\n        Preconditions.checkArgument(privkey.length == 32);\n\n        ByteBuffer byteBuff = nativeECDSABuffer.get();\n        if (byteBuff == null || byteBuff.capacity() < privkey.length + tweak.length) {\n            byteBuff = ByteBuffer.allocateDirect(privkey.length + tweak.length);\n            byteBuff.order(ByteOrder.nativeOrder());\n            nativeECDSABuffer.set(byteBuff);\n        }\n        byteBuff.rewind();\n        byteBuff.put(privkey);\n        byteBuff.put(tweak);\n\n        byte[][] retByteArray;\n        r.lock();\n        try {\n          retByteArray = secp256k1_privkey_tweak_add(byteBuff,Secp256k1Context.getContext());\n        } finally {\n          r.unlock();\n        }\n\n        byte[] privArr = retByteArray[0];\n\n        int privLen = (byte) new BigInteger(new byte[] { retByteArray[1][0] }).intValue() & 0xFF;\n        int retVal = new BigInteger(new byte[] { retByteArray[1][1] }).intValue();\n\n        assertEquals(privArr.length, privLen, \"Got bad pubkey length.\");\n\n        assertEquals(retVal, 1, \"Failed return value check.\");\n\n        return privArr;\n    }\n\n    /**\n     * libsecp256k1 PubKey Tweak-Add - Tweak pubkey by adding to it\n     *\n     * @param tweak some bytes to tweak with\n     * @param pubkey 32-byte seckey\n     */\n    public static byte[] pubKeyTweakAdd(byte[] pubkey, byte[] tweak) throws AssertFailException{\n        Preconditions.checkArgument(pubkey.length == 33 || pubkey.length == 65);\n\n        ByteBuffer byteBuff = nativeECDSABuffer.get();\n        if (byteBuff == null || byteBuff.capacity() < pubkey.length + tweak.length) {\n            byteBuff = ByteBuffer.allocateDirect(pubkey.length + tweak.length);\n            byteBuff.order(ByteOrder.nativeOrder());\n            nativeECDSABuffer.set(byteBuff);\n        }\n        byteBuff.rewind();\n        byteBuff.put(pubkey);\n        byteBuff.put(tweak);\n\n        byte[][] retByteArray;\n        r.lock();\n        try {\n          retByteArray = secp256k1_pubkey_tweak_add(byteBuff,Secp256k1Context.getContext(), pubkey.length);\n        } finally {\n          r.unlock();\n        }\n\n        byte[] pubArr = retByteArray[0];\n\n        int pubLen = (byte) new BigInteger(new byte[] { retByteArray[1][0] }).intValue() & 0xFF;\n        int retVal = new BigInteger(new byte[] { retByteArray[1][1] }).intValue();\n\n        assertEquals(pubArr.length, pubLen, \"Got bad pubkey length.\");\n\n        assertEquals(retVal, 1, \"Failed return value check.\");\n\n        return pubArr;\n    }\n\n    /**\n     * libsecp256k1 PubKey Tweak-Mul - Tweak pubkey by multiplying to it\n     *\n     * @param tweak some bytes to tweak with\n     * @param pubkey 32-byte seckey\n     */\n    public static byte[] pubKeyTweakMul(byte[] pubkey, byte[] tweak) throws AssertFailException{\n        Preconditions.checkArgument(pubkey.length == 33 || pubkey.length == 65);\n\n        ByteBuffer byteBuff = nativeECDSABuffer.get();\n        if (byteBuff == null || byteBuff.capacity() < pubkey.length + tweak.length) {\n            byteBuff = ByteBuffer.allocateDirect(pubkey.length + tweak.length);\n            byteBuff.order(ByteOrder.nativeOrder());\n            nativeECDSABuffer.set(byteBuff);\n        }\n        byteBuff.rewind();\n        byteBuff.put(pubkey);\n        byteBuff.put(tweak);\n\n        byte[][] retByteArray;\n        r.lock();\n        try {\n          retByteArray = secp256k1_pubkey_tweak_mul(byteBuff,Secp256k1Context.getContext(), pubkey.length);\n        } finally {\n          r.unlock();\n        }\n\n        byte[] pubArr = retByteArray[0];\n\n        int pubLen = (byte) new BigInteger(new byte[] { retByteArray[1][0] }).intValue() & 0xFF;\n        int retVal = new BigInteger(new byte[] { retByteArray[1][1] }).intValue();\n\n        assertEquals(pubArr.length, pubLen, \"Got bad pubkey length.\");\n\n        assertEquals(retVal, 1, \"Failed return value check.\");\n\n        return pubArr;\n    }\n\n    /**\n     * libsecp256k1 create ECDH secret - constant time ECDH calculation\n     *\n     * @param seckey byte array of secret key used in exponentiaion\n     * @param pubkey byte array of public key used in exponentiaion\n     */\n    public static byte[] createECDHSecret(byte[] seckey, byte[] pubkey) throws AssertFailException{\n        Preconditions.checkArgument(seckey.length <= 32 && pubkey.length <= 65);\n\n        ByteBuffer byteBuff = nativeECDSABuffer.get();\n        if (byteBuff == null || byteBuff.capacity() < 32 + pubkey.length) {\n            byteBuff = ByteBuffer.allocateDirect(32 + pubkey.length);\n            byteBuff.order(ByteOrder.nativeOrder());\n            nativeECDSABuffer.set(byteBuff);\n        }\n        byteBuff.rewind();\n        byteBuff.put(seckey);\n        byteBuff.put(pubkey);\n\n        byte[][] retByteArray;\n        r.lock();\n        try {\n          retByteArray = secp256k1_ecdh(byteBuff, Secp256k1Context.getContext(), pubkey.length);\n        } finally {\n          r.unlock();\n        }\n\n        byte[] resArr = retByteArray[0];\n        int retVal = new BigInteger(new byte[] { retByteArray[1][0] }).intValue();\n\n        assertEquals(resArr.length, 32, \"Got bad result length.\");\n        assertEquals(retVal, 1, \"Failed return value check.\");\n\n        return resArr;\n    }\n\n    /**\n     * libsecp256k1 randomize - updates the context randomization\n     *\n     * @param seed 32-byte random seed\n     */\n    public static synchronized boolean randomize(byte[] seed) throws AssertFailException{\n        Preconditions.checkArgument(seed.length == 32 || seed == null);\n\n        ByteBuffer byteBuff = nativeECDSABuffer.get();\n        if (byteBuff == null || byteBuff.capacity() < seed.length) {\n            byteBuff = ByteBuffer.allocateDirect(seed.length);\n            byteBuff.order(ByteOrder.nativeOrder());\n            nativeECDSABuffer.set(byteBuff);\n        }\n        byteBuff.rewind();\n        byteBuff.put(seed);\n\n        w.lock();\n        try {\n          return secp256k1_context_randomize(byteBuff, Secp256k1Context.getContext()) == 1;\n        } finally {\n          w.unlock();\n        }\n    }\n\n    private static native long secp256k1_ctx_clone(long context);\n\n    private static native int secp256k1_context_randomize(ByteBuffer byteBuff, long context);\n\n    private static native byte[][] secp256k1_privkey_tweak_add(ByteBuffer byteBuff, long context);\n\n    private static native byte[][] secp256k1_privkey_tweak_mul(ByteBuffer byteBuff, long context);\n\n    private static native byte[][] secp256k1_pubkey_tweak_add(ByteBuffer byteBuff, long context, int pubLen);\n\n    private static native byte[][] secp256k1_pubkey_tweak_mul(ByteBuffer byteBuff, long context, int pubLen);\n\n    private static native void secp256k1_destroy_context(long context);\n\n    private static native int secp256k1_ecdsa_verify(ByteBuffer byteBuff, long context, int sigLen, int pubLen);\n\n    private static native byte[][] secp256k1_ecdsa_sign(ByteBuffer byteBuff, long context);\n\n    private static native int secp256k1_ec_seckey_verify(ByteBuffer byteBuff, long context);\n\n    private static native byte[][] secp256k1_ec_pubkey_create(ByteBuffer byteBuff, long context);\n\n    private static native byte[][] secp256k1_ec_pubkey_parse(ByteBuffer byteBuff, long context, int inputLen);\n\n    private static native byte[][] secp256k1_ecdh(ByteBuffer byteBuff, long context, int inputLen);\n\n}\n"
  },
  {
    "path": "src/secp256k1/src/java/org/bitcoin/NativeSecp256k1Test.java",
    "content": "package org.bitcoin;\n\nimport com.google.common.io.BaseEncoding;\nimport java.util.Arrays;\nimport java.math.BigInteger;\nimport javax.xml.bind.DatatypeConverter;\nimport static org.bitcoin.NativeSecp256k1Util.*;\n\n/**\n * This class holds test cases defined for testing this library.\n */\npublic class NativeSecp256k1Test {\n\n    //TODO improve comments/add more tests\n    /**\n      * This tests verify() for a valid signature\n      */\n    public static void testVerifyPos() throws AssertFailException{\n        boolean result = false;\n        byte[] data = BaseEncoding.base16().lowerCase().decode(\"CF80CD8AED482D5D1527D7DC72FCEFF84E6326592848447D2DC0B0E87DFC9A90\".toLowerCase()); //sha256hash of \"testing\"\n        byte[] sig = BaseEncoding.base16().lowerCase().decode(\"3044022079BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F817980220294F14E883B3F525B5367756C2A11EF6CF84B730B36C17CB0C56F0AAB2C98589\".toLowerCase());\n        byte[] pub = BaseEncoding.base16().lowerCase().decode(\"040A629506E1B65CD9D2E0BA9C75DF9C4FED0DB16DC9625ED14397F0AFC836FAE595DC53F8B0EFE61E703075BD9B143BAC75EC0E19F82A2208CAEB32BE53414C40\".toLowerCase());\n\n        result = NativeSecp256k1.verify( data, sig, pub);\n        assertEquals( result, true , \"testVerifyPos\");\n    }\n\n    /**\n      * This tests verify() for a non-valid signature\n      */\n    public static void testVerifyNeg() throws AssertFailException{\n        boolean result = false;\n        byte[] data = BaseEncoding.base16().lowerCase().decode(\"CF80CD8AED482D5D1527D7DC72FCEFF84E6326592848447D2DC0B0E87DFC9A91\".toLowerCase()); //sha256hash of \"testing\"\n        byte[] sig = BaseEncoding.base16().lowerCase().decode(\"3044022079BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F817980220294F14E883B3F525B5367756C2A11EF6CF84B730B36C17CB0C56F0AAB2C98589\".toLowerCase());\n        byte[] pub = BaseEncoding.base16().lowerCase().decode(\"040A629506E1B65CD9D2E0BA9C75DF9C4FED0DB16DC9625ED14397F0AFC836FAE595DC53F8B0EFE61E703075BD9B143BAC75EC0E19F82A2208CAEB32BE53414C40\".toLowerCase());\n\n        result = NativeSecp256k1.verify( data, sig, pub);\n        //System.out.println(\" TEST \" + new BigInteger(1, resultbytes).toString(16));\n        assertEquals( result, false , \"testVerifyNeg\");\n    }\n\n    /**\n      * This tests secret key verify() for a valid secretkey\n      */\n    public static void testSecKeyVerifyPos() throws AssertFailException{\n        boolean result = false;\n        byte[] sec = BaseEncoding.base16().lowerCase().decode(\"67E56582298859DDAE725F972992A07C6C4FB9F62A8FFF58CE3CA926A1063530\".toLowerCase());\n\n        result = NativeSecp256k1.secKeyVerify( sec );\n        //System.out.println(\" TEST \" + new BigInteger(1, resultbytes).toString(16));\n        assertEquals( result, true , \"testSecKeyVerifyPos\");\n    }\n\n    /**\n      * This tests secret key verify() for a invalid secretkey\n      */\n    public static void testSecKeyVerifyNeg() throws AssertFailException{\n        boolean result = false;\n        byte[] sec = BaseEncoding.base16().lowerCase().decode(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\".toLowerCase());\n\n        result = NativeSecp256k1.secKeyVerify( sec );\n        //System.out.println(\" TEST \" + new BigInteger(1, resultbytes).toString(16));\n        assertEquals( result, false , \"testSecKeyVerifyNeg\");\n    }\n\n    /**\n      * This tests public key create() for a valid secretkey\n      */\n    public static void testPubKeyCreatePos() throws AssertFailException{\n        byte[] sec = BaseEncoding.base16().lowerCase().decode(\"67E56582298859DDAE725F972992A07C6C4FB9F62A8FFF58CE3CA926A1063530\".toLowerCase());\n\n        byte[] resultArr = NativeSecp256k1.computePubkey( sec);\n        String pubkeyString = javax.xml.bind.DatatypeConverter.printHexBinary(resultArr);\n        assertEquals( pubkeyString , \"04C591A8FF19AC9C4E4E5793673B83123437E975285E7B442F4EE2654DFFCA5E2D2103ED494718C697AC9AEBCFD19612E224DB46661011863ED2FC54E71861E2A6\" , \"testPubKeyCreatePos\");\n    }\n\n    /**\n      * This tests public key create() for a invalid secretkey\n      */\n    public static void testPubKeyCreateNeg() throws AssertFailException{\n       byte[] sec = BaseEncoding.base16().lowerCase().decode(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\".toLowerCase());\n\n       byte[] resultArr = NativeSecp256k1.computePubkey( sec);\n       String pubkeyString = javax.xml.bind.DatatypeConverter.printHexBinary(resultArr);\n       assertEquals( pubkeyString, \"\" , \"testPubKeyCreateNeg\");\n    }\n\n    /**\n      * This tests sign() for a valid secretkey\n      */\n    public static void testSignPos() throws AssertFailException{\n\n        byte[] data = BaseEncoding.base16().lowerCase().decode(\"CF80CD8AED482D5D1527D7DC72FCEFF84E6326592848447D2DC0B0E87DFC9A90\".toLowerCase()); //sha256hash of \"testing\"\n        byte[] sec = BaseEncoding.base16().lowerCase().decode(\"67E56582298859DDAE725F972992A07C6C4FB9F62A8FFF58CE3CA926A1063530\".toLowerCase());\n\n        byte[] resultArr = NativeSecp256k1.sign(data, sec);\n        String sigString = javax.xml.bind.DatatypeConverter.printHexBinary(resultArr);\n        assertEquals( sigString, \"30440220182A108E1448DC8F1FB467D06A0F3BB8EA0533584CB954EF8DA112F1D60E39A202201C66F36DA211C087F3AF88B50EDF4F9BDAA6CF5FD6817E74DCA34DB12390C6E9\" , \"testSignPos\");\n    }\n\n    /**\n      * This tests sign() for a invalid secretkey\n      */\n    public static void testSignNeg() throws AssertFailException{\n        byte[] data = BaseEncoding.base16().lowerCase().decode(\"CF80CD8AED482D5D1527D7DC72FCEFF84E6326592848447D2DC0B0E87DFC9A90\".toLowerCase()); //sha256hash of \"testing\"\n        byte[] sec = BaseEncoding.base16().lowerCase().decode(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\".toLowerCase());\n\n        byte[] resultArr = NativeSecp256k1.sign(data, sec);\n        String sigString = javax.xml.bind.DatatypeConverter.printHexBinary(resultArr);\n        assertEquals( sigString, \"\" , \"testSignNeg\");\n    }\n\n    /**\n      * This tests private key tweak-add\n      */\n    public static void testPrivKeyTweakAdd_1() throws AssertFailException {\n        byte[] sec = BaseEncoding.base16().lowerCase().decode(\"67E56582298859DDAE725F972992A07C6C4FB9F62A8FFF58CE3CA926A1063530\".toLowerCase());\n        byte[] data = BaseEncoding.base16().lowerCase().decode(\"3982F19BEF1615BCCFBB05E321C10E1D4CBA3DF0E841C2E41EEB6016347653C3\".toLowerCase()); //sha256hash of \"tweak\"\n\n        byte[] resultArr = NativeSecp256k1.privKeyTweakAdd( sec , data );\n        String sigString = javax.xml.bind.DatatypeConverter.printHexBinary(resultArr);\n        assertEquals( sigString , \"A168571E189E6F9A7E2D657A4B53AE99B909F7E712D1C23CED28093CD57C88F3\" , \"testPrivKeyAdd_1\");\n    }\n\n    /**\n      * This tests private key tweak-mul\n      */\n    public static void testPrivKeyTweakMul_1() throws AssertFailException {\n        byte[] sec = BaseEncoding.base16().lowerCase().decode(\"67E56582298859DDAE725F972992A07C6C4FB9F62A8FFF58CE3CA926A1063530\".toLowerCase());\n        byte[] data = BaseEncoding.base16().lowerCase().decode(\"3982F19BEF1615BCCFBB05E321C10E1D4CBA3DF0E841C2E41EEB6016347653C3\".toLowerCase()); //sha256hash of \"tweak\"\n\n        byte[] resultArr = NativeSecp256k1.privKeyTweakMul( sec , data );\n        String sigString = javax.xml.bind.DatatypeConverter.printHexBinary(resultArr);\n        assertEquals( sigString , \"97F8184235F101550F3C71C927507651BD3F1CDB4A5A33B8986ACF0DEE20FFFC\" , \"testPrivKeyMul_1\");\n    }\n\n    /**\n      * This tests private key tweak-add uncompressed\n      */\n    public static void testPrivKeyTweakAdd_2() throws AssertFailException {\n        byte[] pub = BaseEncoding.base16().lowerCase().decode(\"040A629506E1B65CD9D2E0BA9C75DF9C4FED0DB16DC9625ED14397F0AFC836FAE595DC53F8B0EFE61E703075BD9B143BAC75EC0E19F82A2208CAEB32BE53414C40\".toLowerCase());\n        byte[] data = BaseEncoding.base16().lowerCase().decode(\"3982F19BEF1615BCCFBB05E321C10E1D4CBA3DF0E841C2E41EEB6016347653C3\".toLowerCase()); //sha256hash of \"tweak\"\n\n        byte[] resultArr = NativeSecp256k1.pubKeyTweakAdd( pub , data );\n        String sigString = javax.xml.bind.DatatypeConverter.printHexBinary(resultArr);\n        assertEquals( sigString , \"0411C6790F4B663CCE607BAAE08C43557EDC1A4D11D88DFCB3D841D0C6A941AF525A268E2A863C148555C48FB5FBA368E88718A46E205FABC3DBA2CCFFAB0796EF\" , \"testPrivKeyAdd_2\");\n    }\n\n    /**\n      * This tests private key tweak-mul uncompressed\n      */\n    public static void testPrivKeyTweakMul_2() throws AssertFailException {\n        byte[] pub = BaseEncoding.base16().lowerCase().decode(\"040A629506E1B65CD9D2E0BA9C75DF9C4FED0DB16DC9625ED14397F0AFC836FAE595DC53F8B0EFE61E703075BD9B143BAC75EC0E19F82A2208CAEB32BE53414C40\".toLowerCase());\n        byte[] data = BaseEncoding.base16().lowerCase().decode(\"3982F19BEF1615BCCFBB05E321C10E1D4CBA3DF0E841C2E41EEB6016347653C3\".toLowerCase()); //sha256hash of \"tweak\"\n\n        byte[] resultArr = NativeSecp256k1.pubKeyTweakMul( pub , data );\n        String sigString = javax.xml.bind.DatatypeConverter.printHexBinary(resultArr);\n        assertEquals( sigString , \"04E0FE6FE55EBCA626B98A807F6CAF654139E14E5E3698F01A9A658E21DC1D2791EC060D4F412A794D5370F672BC94B722640B5F76914151CFCA6E712CA48CC589\" , \"testPrivKeyMul_2\");\n    }\n\n    /**\n      * This tests seed randomization\n      */\n    public static void testRandomize() throws AssertFailException {\n        byte[] seed = BaseEncoding.base16().lowerCase().decode(\"A441B15FE9A3CF56661190A0B93B9DEC7D04127288CC87250967CF3B52894D11\".toLowerCase()); //sha256hash of \"random\"\n        boolean result = NativeSecp256k1.randomize(seed);\n        assertEquals( result, true, \"testRandomize\");\n    }\n\n    public static void testCreateECDHSecret() throws AssertFailException{\n\n        byte[] sec = BaseEncoding.base16().lowerCase().decode(\"67E56582298859DDAE725F972992A07C6C4FB9F62A8FFF58CE3CA926A1063530\".toLowerCase());\n        byte[] pub = BaseEncoding.base16().lowerCase().decode(\"040A629506E1B65CD9D2E0BA9C75DF9C4FED0DB16DC9625ED14397F0AFC836FAE595DC53F8B0EFE61E703075BD9B143BAC75EC0E19F82A2208CAEB32BE53414C40\".toLowerCase());\n\n        byte[] resultArr = NativeSecp256k1.createECDHSecret(sec, pub);\n        String ecdhString = javax.xml.bind.DatatypeConverter.printHexBinary(resultArr);\n        assertEquals( ecdhString, \"2A2A67007A926E6594AF3EB564FC74005B37A9C8AEF2033C4552051B5C87F043\" , \"testCreateECDHSecret\");\n    }\n\n    public static void main(String[] args) throws AssertFailException{\n\n\n        System.out.println(\"\\n libsecp256k1 enabled: \" + Secp256k1Context.isEnabled() + \"\\n\");\n\n        assertEquals( Secp256k1Context.isEnabled(), true, \"isEnabled\" );\n\n        //Test verify() success/fail\n        testVerifyPos();\n        testVerifyNeg();\n\n        //Test secKeyVerify() success/fail\n        testSecKeyVerifyPos();\n        testSecKeyVerifyNeg();\n\n        //Test computePubkey() success/fail\n        testPubKeyCreatePos();\n        testPubKeyCreateNeg();\n\n        //Test sign() success/fail\n        testSignPos();\n        testSignNeg();\n\n        //Test privKeyTweakAdd() 1\n        testPrivKeyTweakAdd_1();\n\n        //Test privKeyTweakMul() 2\n        testPrivKeyTweakMul_1();\n\n        //Test privKeyTweakAdd() 3\n        testPrivKeyTweakAdd_2();\n\n        //Test privKeyTweakMul() 4\n        testPrivKeyTweakMul_2();\n\n        //Test randomize()\n        testRandomize();\n\n        //Test ECDH\n        testCreateECDHSecret();\n\n        NativeSecp256k1.cleanup();\n\n        System.out.println(\" All tests passed.\" );\n\n    }\n}\n"
  },
  {
    "path": "src/secp256k1/src/java/org/bitcoin/NativeSecp256k1Util.java",
    "content": "/*\n * Copyright 2014-2016 the libsecp256k1 contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.bitcoin;\n\npublic class NativeSecp256k1Util{\n\n    public static void assertEquals( int val, int val2, String message ) throws AssertFailException{\n      if( val != val2 )\n        throw new AssertFailException(\"FAIL: \" + message);\n    }\n\n    public static void assertEquals( boolean val, boolean val2, String message ) throws AssertFailException{\n      if( val != val2 )\n        throw new AssertFailException(\"FAIL: \" + message);\n      else\n        System.out.println(\"PASS: \" + message);\n    }\n\n    public static void assertEquals( String val, String val2, String message ) throws AssertFailException{\n      if( !val.equals(val2) )\n        throw new AssertFailException(\"FAIL: \" + message);\n      else\n        System.out.println(\"PASS: \" + message);\n    }\n\n    public static class AssertFailException extends Exception {\n      public AssertFailException(String message) {\n        super( message );\n      }\n    }\n}\n"
  },
  {
    "path": "src/secp256k1/src/java/org/bitcoin/Secp256k1Context.java",
    "content": "/*\n * Copyright 2014-2016 the libsecp256k1 contributors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *    http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.bitcoin;\n\n/**\n * This class holds the context reference used in native methods \n * to handle ECDSA operations.\n */\npublic class Secp256k1Context {\n  private static final boolean enabled; //true if the library is loaded\n  private static final long context; //ref to pointer to context obj\n\n  static { //static initializer\n      boolean isEnabled = true;\n      long contextRef = -1;\n      try {\n          System.loadLibrary(\"secp256k1\");\n          contextRef = secp256k1_init_context();\n      } catch (UnsatisfiedLinkError e) {\n          System.out.println(\"UnsatisfiedLinkError: \" + e.toString());\n          isEnabled = false;\n      }\n      enabled = isEnabled;\n      context = contextRef;\n  }\n\n  public static boolean isEnabled() {\n     return enabled;\n  }\n\n  public static long getContext() {\n     if(!enabled) return -1; //sanity check\n     return context;\n  }\n\n  private static native long secp256k1_init_context();\n}\n"
  },
  {
    "path": "src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c",
    "content": "#include <stdlib.h>\n#include <stdint.h>\n#include <string.h>\n#include \"org_bitcoin_NativeSecp256k1.h\"\n#include \"include/secp256k1.h\"\n#include \"include/secp256k1_ecdh.h\"\n#include \"include/secp256k1_recovery.h\"\n\n\nSECP256K1_API jlong JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ctx_1clone\n  (JNIEnv* env, jclass classObject, jlong ctx_l)\n{\n  const secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n\n  jlong ctx_clone_l = (uintptr_t) secp256k1_context_clone(ctx);\n\n  (void)classObject;(void)env;\n\n  return ctx_clone_l;\n\n}\n\nSECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1context_1randomize\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n\n  const unsigned char* seed = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);\n\n  (void)classObject;\n\n  return secp256k1_context_randomize(ctx, seed);\n\n}\n\nSECP256K1_API void JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1destroy_1context\n  (JNIEnv* env, jclass classObject, jlong ctx_l)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n\n  secp256k1_context_destroy(ctx);\n\n  (void)classObject;(void)env;\n}\n\nSECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint siglen, jint publen)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n\n  unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);\n  const unsigned char* sigdata = {  (unsigned char*) (data + 32) };\n  const unsigned char* pubdata = { (unsigned char*) (data + siglen + 32) };\n\n  secp256k1_ecdsa_signature sig;\n  secp256k1_pubkey pubkey;\n\n  int ret = secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigdata, siglen);\n\n  if( ret ) {\n    ret = secp256k1_ec_pubkey_parse(ctx, &pubkey, pubdata, publen);\n\n    if( ret ) {\n      ret = secp256k1_ecdsa_verify(ctx, &sig, data, &pubkey);\n    }\n  }\n\n  (void)classObject;\n\n  return ret;\n}\n\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1sign\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n  unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);\n  unsigned char* secKey = (unsigned char*) (data + 32);\n\n  jobjectArray retArray;\n  jbyteArray sigArray, intsByteArray;\n  unsigned char intsarray[2];\n\n  secp256k1_ecdsa_signature sig[72];\n\n  int ret = secp256k1_ecdsa_sign(ctx, sig, data, secKey, NULL, NULL );\n\n  unsigned char outputSer[72];\n  size_t outputLen = 72;\n\n  if( ret ) {\n    int ret2 = secp256k1_ecdsa_signature_serialize_der(ctx,outputSer, &outputLen, sig ); (void)ret2;\n  }\n\n  intsarray[0] = outputLen;\n  intsarray[1] = ret;\n\n  retArray = (*env)->NewObjectArray(env, 2,\n    (*env)->FindClass(env, \"[B\"),\n    (*env)->NewByteArray(env, 1));\n\n  sigArray = (*env)->NewByteArray(env, outputLen);\n  (*env)->SetByteArrayRegion(env, sigArray, 0, outputLen, (jbyte*)outputSer);\n  (*env)->SetObjectArrayElement(env, retArray, 0, sigArray);\n\n  intsByteArray = (*env)->NewByteArray(env, 2);\n  (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);\n  (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);\n\n  (void)classObject;\n\n  return retArray;\n}\n\nSECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1seckey_1verify\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n  unsigned char* secKey = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);\n\n  (void)classObject;\n\n  return secp256k1_ec_seckey_verify(ctx, secKey);\n}\n\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1pubkey_1create\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n  const unsigned char* secKey = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);\n\n  secp256k1_pubkey pubkey;\n\n  jobjectArray retArray;\n  jbyteArray pubkeyArray, intsByteArray;\n  unsigned char intsarray[2];\n\n  int ret = secp256k1_ec_pubkey_create(ctx, &pubkey, secKey);\n\n  unsigned char outputSer[65];\n  size_t outputLen = 65;\n\n  if( ret ) {\n    int ret2 = secp256k1_ec_pubkey_serialize(ctx,outputSer, &outputLen, &pubkey,SECP256K1_EC_UNCOMPRESSED );(void)ret2;\n  }\n\n  intsarray[0] = outputLen;\n  intsarray[1] = ret;\n\n  retArray = (*env)->NewObjectArray(env, 2,\n    (*env)->FindClass(env, \"[B\"),\n    (*env)->NewByteArray(env, 1));\n\n  pubkeyArray = (*env)->NewByteArray(env, outputLen);\n  (*env)->SetByteArrayRegion(env, pubkeyArray, 0, outputLen, (jbyte*)outputSer);\n  (*env)->SetObjectArrayElement(env, retArray, 0, pubkeyArray);\n\n  intsByteArray = (*env)->NewByteArray(env, 2);\n  (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);\n  (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);\n\n  (void)classObject;\n\n  return retArray;\n\n}\n\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1add\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n  unsigned char* privkey = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);\n  const unsigned char* tweak = (unsigned char*) (privkey + 32);\n\n  jobjectArray retArray;\n  jbyteArray privArray, intsByteArray;\n  unsigned char intsarray[2];\n\n  int privkeylen = 32;\n\n  int ret = secp256k1_ec_privkey_tweak_add(ctx, privkey, tweak);\n\n  intsarray[0] = privkeylen;\n  intsarray[1] = ret;\n\n  retArray = (*env)->NewObjectArray(env, 2,\n    (*env)->FindClass(env, \"[B\"),\n    (*env)->NewByteArray(env, 1));\n\n  privArray = (*env)->NewByteArray(env, privkeylen);\n  (*env)->SetByteArrayRegion(env, privArray, 0, privkeylen, (jbyte*)privkey);\n  (*env)->SetObjectArrayElement(env, retArray, 0, privArray);\n\n  intsByteArray = (*env)->NewByteArray(env, 2);\n  (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);\n  (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);\n\n  (void)classObject;\n\n  return retArray;\n}\n\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1mul\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n  unsigned char* privkey = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);\n  const unsigned char* tweak = (unsigned char*) (privkey + 32);\n\n  jobjectArray retArray;\n  jbyteArray privArray, intsByteArray;\n  unsigned char intsarray[2];\n\n  int privkeylen = 32;\n\n  int ret = secp256k1_ec_privkey_tweak_mul(ctx, privkey, tweak);\n\n  intsarray[0] = privkeylen;\n  intsarray[1] = ret;\n\n  retArray = (*env)->NewObjectArray(env, 2,\n    (*env)->FindClass(env, \"[B\"),\n    (*env)->NewByteArray(env, 1));\n\n  privArray = (*env)->NewByteArray(env, privkeylen);\n  (*env)->SetByteArrayRegion(env, privArray, 0, privkeylen, (jbyte*)privkey);\n  (*env)->SetObjectArrayElement(env, retArray, 0, privArray);\n\n  intsByteArray = (*env)->NewByteArray(env, 2);\n  (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);\n  (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);\n\n  (void)classObject;\n\n  return retArray;\n}\n\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1add\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n/*  secp256k1_pubkey* pubkey = (secp256k1_pubkey*) (*env)->GetDirectBufferAddress(env, byteBufferObject);*/\n  unsigned char* pkey = (*env)->GetDirectBufferAddress(env, byteBufferObject);\n  const unsigned char* tweak = (unsigned char*) (pkey + publen);\n\n  jobjectArray retArray;\n  jbyteArray pubArray, intsByteArray;\n  unsigned char intsarray[2];\n  unsigned char outputSer[65];\n  size_t outputLen = 65;\n\n  secp256k1_pubkey pubkey;\n  int ret = secp256k1_ec_pubkey_parse(ctx, &pubkey, pkey, publen);\n\n  if( ret ) {\n    ret = secp256k1_ec_pubkey_tweak_add(ctx, &pubkey, tweak);\n  }\n\n  if( ret ) {\n    int ret2 = secp256k1_ec_pubkey_serialize(ctx,outputSer, &outputLen, &pubkey,SECP256K1_EC_UNCOMPRESSED );(void)ret2;\n  }\n\n  intsarray[0] = outputLen;\n  intsarray[1] = ret;\n\n  retArray = (*env)->NewObjectArray(env, 2,\n    (*env)->FindClass(env, \"[B\"),\n    (*env)->NewByteArray(env, 1));\n\n  pubArray = (*env)->NewByteArray(env, outputLen);\n  (*env)->SetByteArrayRegion(env, pubArray, 0, outputLen, (jbyte*)outputSer);\n  (*env)->SetObjectArrayElement(env, retArray, 0, pubArray);\n\n  intsByteArray = (*env)->NewByteArray(env, 2);\n  (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);\n  (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);\n\n  (void)classObject;\n\n  return retArray;\n}\n\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1mul\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n  unsigned char* pkey = (*env)->GetDirectBufferAddress(env, byteBufferObject);\n  const unsigned char* tweak = (unsigned char*) (pkey + publen);\n\n  jobjectArray retArray;\n  jbyteArray pubArray, intsByteArray;\n  unsigned char intsarray[2];\n  unsigned char outputSer[65];\n  size_t outputLen = 65;\n\n  secp256k1_pubkey pubkey;\n  int ret = secp256k1_ec_pubkey_parse(ctx, &pubkey, pkey, publen);\n\n  if ( ret ) {\n    ret = secp256k1_ec_pubkey_tweak_mul(ctx, &pubkey, tweak);\n  }\n\n  if( ret ) {\n    int ret2 = secp256k1_ec_pubkey_serialize(ctx,outputSer, &outputLen, &pubkey,SECP256K1_EC_UNCOMPRESSED );(void)ret2;\n  }\n\n  intsarray[0] = outputLen;\n  intsarray[1] = ret;\n\n  retArray = (*env)->NewObjectArray(env, 2,\n    (*env)->FindClass(env, \"[B\"),\n    (*env)->NewByteArray(env, 1));\n\n  pubArray = (*env)->NewByteArray(env, outputLen);\n  (*env)->SetByteArrayRegion(env, pubArray, 0, outputLen, (jbyte*)outputSer);\n  (*env)->SetObjectArrayElement(env, retArray, 0, pubArray);\n\n  intsByteArray = (*env)->NewByteArray(env, 2);\n  (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);\n  (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);\n\n  (void)classObject;\n\n  return retArray;\n}\n\nSECP256K1_API jlong JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1pubkey_1combine\n  (JNIEnv * env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint numkeys)\n{\n  (void)classObject;(void)env;(void)byteBufferObject;(void)ctx_l;(void)numkeys;\n\n  return 0;\n}\n\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdh\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)\n{\n  secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;\n  const unsigned char* secdata = (*env)->GetDirectBufferAddress(env, byteBufferObject);\n  const unsigned char* pubdata = (const unsigned char*) (secdata + 32);\n\n  jobjectArray retArray;\n  jbyteArray outArray, intsByteArray;\n  unsigned char intsarray[1];\n  secp256k1_pubkey pubkey;\n  unsigned char nonce_res[32];\n  size_t outputLen = 32;\n\n  int ret = secp256k1_ec_pubkey_parse(ctx, &pubkey, pubdata, publen);\n\n  if (ret) {\n    ret = secp256k1_ecdh(\n      ctx,\n      nonce_res,\n      &pubkey,\n      secdata\n    );\n  }\n\n  intsarray[0] = ret;\n\n  retArray = (*env)->NewObjectArray(env, 2,\n    (*env)->FindClass(env, \"[B\"),\n    (*env)->NewByteArray(env, 1));\n\n  outArray = (*env)->NewByteArray(env, outputLen);\n  (*env)->SetByteArrayRegion(env, outArray, 0, 32, (jbyte*)nonce_res);\n  (*env)->SetObjectArrayElement(env, retArray, 0, outArray);\n\n  intsByteArray = (*env)->NewByteArray(env, 1);\n  (*env)->SetByteArrayRegion(env, intsByteArray, 0, 1, (jbyte*)intsarray);\n  (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);\n\n  (void)classObject;\n\n  return retArray;\n}\n"
  },
  {
    "path": "src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h",
    "content": "/* DO NOT EDIT THIS FILE - it is machine generated */\n#include <jni.h>\n#include \"include/secp256k1.h\"\n/* Header for class org_bitcoin_NativeSecp256k1 */\n\n#ifndef _Included_org_bitcoin_NativeSecp256k1\n#define _Included_org_bitcoin_NativeSecp256k1\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_ctx_clone\n * Signature: (J)J\n */\nSECP256K1_API jlong JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ctx_1clone\n  (JNIEnv *, jclass, jlong);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_context_randomize\n * Signature: (Ljava/nio/ByteBuffer;J)I\n */\nSECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1context_1randomize\n  (JNIEnv *, jclass, jobject, jlong);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_privkey_tweak_add\n * Signature: (Ljava/nio/ByteBuffer;J)[[B\n */\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1add\n  (JNIEnv *, jclass, jobject, jlong);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_privkey_tweak_mul\n * Signature: (Ljava/nio/ByteBuffer;J)[[B\n */\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1mul\n  (JNIEnv *, jclass, jobject, jlong);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_pubkey_tweak_add\n * Signature: (Ljava/nio/ByteBuffer;JI)[[B\n */\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1add\n  (JNIEnv *, jclass, jobject, jlong, jint);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_pubkey_tweak_mul\n * Signature: (Ljava/nio/ByteBuffer;JI)[[B\n */\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1mul\n  (JNIEnv *, jclass, jobject, jlong, jint);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_destroy_context\n * Signature: (J)V\n */\nSECP256K1_API void JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1destroy_1context\n  (JNIEnv *, jclass, jlong);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_ecdsa_verify\n * Signature: (Ljava/nio/ByteBuffer;JII)I\n */\nSECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify\n  (JNIEnv *, jclass, jobject, jlong, jint, jint);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_ecdsa_sign\n * Signature: (Ljava/nio/ByteBuffer;J)[[B\n */\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1sign\n  (JNIEnv *, jclass, jobject, jlong);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_ec_seckey_verify\n * Signature: (Ljava/nio/ByteBuffer;J)I\n */\nSECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1seckey_1verify\n  (JNIEnv *, jclass, jobject, jlong);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_ec_pubkey_create\n * Signature: (Ljava/nio/ByteBuffer;J)[[B\n */\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1pubkey_1create\n  (JNIEnv *, jclass, jobject, jlong);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_ec_pubkey_parse\n * Signature: (Ljava/nio/ByteBuffer;JI)[[B\n */\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1pubkey_1parse\n  (JNIEnv *, jclass, jobject, jlong, jint);\n\n/*\n * Class:     org_bitcoin_NativeSecp256k1\n * Method:    secp256k1_ecdh\n * Signature: (Ljava/nio/ByteBuffer;JI)[[B\n */\nSECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdh\n  (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen);\n\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "src/secp256k1/src/java/org_bitcoin_Secp256k1Context.c",
    "content": "#include <stdlib.h>\n#include <stdint.h>\n#include \"org_bitcoin_Secp256k1Context.h\"\n#include \"include/secp256k1.h\"\n\nSECP256K1_API jlong JNICALL Java_org_bitcoin_Secp256k1Context_secp256k1_1init_1context\n  (JNIEnv* env, jclass classObject)\n{\n  secp256k1_context *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);\n\n  (void)classObject;(void)env;\n\n  return (uintptr_t)ctx;\n}\n\n"
  },
  {
    "path": "src/secp256k1/src/java/org_bitcoin_Secp256k1Context.h",
    "content": "/* DO NOT EDIT THIS FILE - it is machine generated */\n#include <jni.h>\n#include \"include/secp256k1.h\"\n/* Header for class org_bitcoin_Secp256k1Context */\n\n#ifndef _Included_org_bitcoin_Secp256k1Context\n#define _Included_org_bitcoin_Secp256k1Context\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n/*\n * Class:     org_bitcoin_Secp256k1Context\n * Method:    secp256k1_init_context\n * Signature: ()J\n */\nSECP256K1_API jlong JNICALL Java_org_bitcoin_Secp256k1Context_secp256k1_1init_1context\n  (JNIEnv *, jclass);\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "src/secp256k1/src/modules/ecdh/Makefile.am.include",
    "content": "include_HEADERS += include/secp256k1_ecdh.h\nnoinst_HEADERS += src/modules/ecdh/main_impl.h\nnoinst_HEADERS += src/modules/ecdh/tests_impl.h\nif USE_BENCHMARK\nnoinst_PROGRAMS += bench_ecdh\nbench_ecdh_SOURCES = src/bench_ecdh.c\nbench_ecdh_LDADD = libsecp256k1.la $(SECP_LIBS) $(COMMON_LIB)\nendif\n"
  },
  {
    "path": "src/secp256k1/src/modules/ecdh/main_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2015 Andrew Poelstra                                 *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_MODULE_ECDH_MAIN_H\n#define SECP256K1_MODULE_ECDH_MAIN_H\n\n#include \"include/secp256k1_ecdh.h\"\n#include \"ecmult_const_impl.h\"\n\nint secp256k1_ecdh(const secp256k1_context* ctx, unsigned char *result, const secp256k1_pubkey *point, const unsigned char *scalar) {\n    int ret = 0;\n    int overflow = 0;\n    secp256k1_gej res;\n    secp256k1_ge pt;\n    secp256k1_scalar s;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(result != NULL);\n    ARG_CHECK(point != NULL);\n    ARG_CHECK(scalar != NULL);\n\n    secp256k1_pubkey_load(ctx, &pt, point);\n    secp256k1_scalar_set_b32(&s, scalar, &overflow);\n    if (overflow || secp256k1_scalar_is_zero(&s)) {\n        ret = 0;\n    } else {\n        unsigned char x[32];\n        unsigned char y[1];\n        secp256k1_sha256_t sha;\n\n        secp256k1_ecmult_const(&res, &pt, &s);\n        secp256k1_ge_set_gej(&pt, &res);\n        /* Compute a hash of the point in compressed form\n         * Note we cannot use secp256k1_eckey_pubkey_serialize here since it does not\n         * expect its output to be secret and has a timing sidechannel. */\n        secp256k1_fe_normalize(&pt.x);\n        secp256k1_fe_normalize(&pt.y);\n        secp256k1_fe_get_b32(x, &pt.x);\n        y[0] = 0x02 | secp256k1_fe_is_odd(&pt.y);\n\n        secp256k1_sha256_initialize(&sha);\n        secp256k1_sha256_write(&sha, y, sizeof(y));\n        secp256k1_sha256_write(&sha, x, sizeof(x));\n        secp256k1_sha256_finalize(&sha, result);\n        ret = 1;\n    }\n\n    secp256k1_scalar_clear(&s);\n    return ret;\n}\n\n#endif /* SECP256K1_MODULE_ECDH_MAIN_H */\n"
  },
  {
    "path": "src/secp256k1/src/modules/ecdh/tests_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2015 Andrew Poelstra                                 *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_MODULE_ECDH_TESTS_H\n#define SECP256K1_MODULE_ECDH_TESTS_H\n\nvoid test_ecdh_api(void) {\n    /* Setup context that just counts errors */\n    secp256k1_context *tctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);\n    secp256k1_pubkey point;\n    unsigned char res[32];\n    unsigned char s_one[32] = { 0 };\n    int32_t ecount = 0;\n    s_one[31] = 1;\n\n    secp256k1_context_set_error_callback(tctx, counting_illegal_callback_fn, &ecount);\n    secp256k1_context_set_illegal_callback(tctx, counting_illegal_callback_fn, &ecount);\n    CHECK(secp256k1_ec_pubkey_create(tctx, &point, s_one) == 1);\n\n    /* Check all NULLs are detected */\n    CHECK(secp256k1_ecdh(tctx, res, &point, s_one) == 1);\n    CHECK(ecount == 0);\n    CHECK(secp256k1_ecdh(tctx, NULL, &point, s_one) == 0);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ecdh(tctx, res, NULL, s_one) == 0);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ecdh(tctx, res, &point, NULL) == 0);\n    CHECK(ecount == 3);\n    CHECK(secp256k1_ecdh(tctx, res, &point, s_one) == 1);\n    CHECK(ecount == 3);\n\n    /* Cleanup */\n    secp256k1_context_destroy(tctx);\n}\n\nvoid test_ecdh_generator_basepoint(void) {\n    unsigned char s_one[32] = { 0 };\n    secp256k1_pubkey point[2];\n    int i;\n\n    s_one[31] = 1;\n    /* Check against pubkey creation when the basepoint is the generator */\n    for (i = 0; i < 100; ++i) {\n        secp256k1_sha256_t sha;\n        unsigned char s_b32[32];\n        unsigned char output_ecdh[32];\n        unsigned char output_ser[32];\n        unsigned char point_ser[33];\n        size_t point_ser_len = sizeof(point_ser);\n        secp256k1_scalar s;\n\n        random_scalar_order(&s);\n        secp256k1_scalar_get_b32(s_b32, &s);\n\n        /* compute using ECDH function */\n        CHECK(secp256k1_ec_pubkey_create(ctx, &point[0], s_one) == 1);\n        CHECK(secp256k1_ecdh(ctx, output_ecdh, &point[0], s_b32) == 1);\n        /* compute \"explicitly\" */\n        CHECK(secp256k1_ec_pubkey_create(ctx, &point[1], s_b32) == 1);\n        CHECK(secp256k1_ec_pubkey_serialize(ctx, point_ser, &point_ser_len, &point[1], SECP256K1_EC_COMPRESSED) == 1);\n        CHECK(point_ser_len == sizeof(point_ser));\n        secp256k1_sha256_initialize(&sha);\n        secp256k1_sha256_write(&sha, point_ser, point_ser_len);\n        secp256k1_sha256_finalize(&sha, output_ser);\n        /* compare */\n        CHECK(memcmp(output_ecdh, output_ser, sizeof(output_ser)) == 0);\n    }\n}\n\nvoid test_bad_scalar(void) {\n    unsigned char s_zero[32] = { 0 };\n    unsigned char s_overflow[32] = {\n        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,\n        0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,\n        0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x41\n    };\n    unsigned char s_rand[32] = { 0 };\n    unsigned char output[32];\n    secp256k1_scalar rand;\n    secp256k1_pubkey point;\n\n    /* Create random point */\n    random_scalar_order(&rand);\n    secp256k1_scalar_get_b32(s_rand, &rand);\n    CHECK(secp256k1_ec_pubkey_create(ctx, &point, s_rand) == 1);\n\n    /* Try to multiply it by bad values */\n    CHECK(secp256k1_ecdh(ctx, output, &point, s_zero) == 0);\n    CHECK(secp256k1_ecdh(ctx, output, &point, s_overflow) == 0);\n    /* ...and a good one */\n    s_overflow[31] -= 1;\n    CHECK(secp256k1_ecdh(ctx, output, &point, s_overflow) == 1);\n}\n\nvoid run_ecdh_tests(void) {\n    test_ecdh_api();\n    test_ecdh_generator_basepoint();\n    test_bad_scalar();\n}\n\n#endif /* SECP256K1_MODULE_ECDH_TESTS_H */\n"
  },
  {
    "path": "src/secp256k1/src/modules/recovery/Makefile.am.include",
    "content": "include_HEADERS += include/secp256k1_recovery.h\nnoinst_HEADERS += src/modules/recovery/main_impl.h\nnoinst_HEADERS += src/modules/recovery/tests_impl.h\nif USE_BENCHMARK\nnoinst_PROGRAMS += bench_recover\nbench_recover_SOURCES = src/bench_recover.c\nbench_recover_LDADD = libsecp256k1.la $(SECP_LIBS) $(COMMON_LIB)\nendif\n"
  },
  {
    "path": "src/secp256k1/src/modules/recovery/main_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013-2015 Pieter Wuille                              *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_MODULE_RECOVERY_MAIN_H\n#define SECP256K1_MODULE_RECOVERY_MAIN_H\n\n#include \"include/secp256k1_recovery.h\"\n\nstatic void secp256k1_ecdsa_recoverable_signature_load(const secp256k1_context* ctx, secp256k1_scalar* r, secp256k1_scalar* s, int* recid, const secp256k1_ecdsa_recoverable_signature* sig) {\n    (void)ctx;\n    if (sizeof(secp256k1_scalar) == 32) {\n        /* When the secp256k1_scalar type is exactly 32 byte, use its\n         * representation inside secp256k1_ecdsa_signature, as conversion is very fast.\n         * Note that secp256k1_ecdsa_signature_save must use the same representation. */\n        memcpy(r, &sig->data[0], 32);\n        memcpy(s, &sig->data[32], 32);\n    } else {\n        secp256k1_scalar_set_b32(r, &sig->data[0], NULL);\n        secp256k1_scalar_set_b32(s, &sig->data[32], NULL);\n    }\n    *recid = sig->data[64];\n}\n\nstatic void secp256k1_ecdsa_recoverable_signature_save(secp256k1_ecdsa_recoverable_signature* sig, const secp256k1_scalar* r, const secp256k1_scalar* s, int recid) {\n    if (sizeof(secp256k1_scalar) == 32) {\n        memcpy(&sig->data[0], r, 32);\n        memcpy(&sig->data[32], s, 32);\n    } else {\n        secp256k1_scalar_get_b32(&sig->data[0], r);\n        secp256k1_scalar_get_b32(&sig->data[32], s);\n    }\n    sig->data[64] = recid;\n}\n\nint secp256k1_ecdsa_recoverable_signature_parse_compact(const secp256k1_context* ctx, secp256k1_ecdsa_recoverable_signature* sig, const unsigned char *input64, int recid) {\n    secp256k1_scalar r, s;\n    int ret = 1;\n    int overflow = 0;\n\n    (void)ctx;\n    ARG_CHECK(sig != NULL);\n    ARG_CHECK(input64 != NULL);\n    ARG_CHECK(recid >= 0 && recid <= 3);\n\n    secp256k1_scalar_set_b32(&r, &input64[0], &overflow);\n    ret &= !overflow;\n    secp256k1_scalar_set_b32(&s, &input64[32], &overflow);\n    ret &= !overflow;\n    if (ret) {\n        secp256k1_ecdsa_recoverable_signature_save(sig, &r, &s, recid);\n    } else {\n        memset(sig, 0, sizeof(*sig));\n    }\n    return ret;\n}\n\nint secp256k1_ecdsa_recoverable_signature_serialize_compact(const secp256k1_context* ctx, unsigned char *output64, int *recid, const secp256k1_ecdsa_recoverable_signature* sig) {\n    secp256k1_scalar r, s;\n\n    (void)ctx;\n    ARG_CHECK(output64 != NULL);\n    ARG_CHECK(sig != NULL);\n    ARG_CHECK(recid != NULL);\n\n    secp256k1_ecdsa_recoverable_signature_load(ctx, &r, &s, recid, sig);\n    secp256k1_scalar_get_b32(&output64[0], &r);\n    secp256k1_scalar_get_b32(&output64[32], &s);\n    return 1;\n}\n\nint secp256k1_ecdsa_recoverable_signature_convert(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const secp256k1_ecdsa_recoverable_signature* sigin) {\n    secp256k1_scalar r, s;\n    int recid;\n\n    (void)ctx;\n    ARG_CHECK(sig != NULL);\n    ARG_CHECK(sigin != NULL);\n\n    secp256k1_ecdsa_recoverable_signature_load(ctx, &r, &s, &recid, sigin);\n    secp256k1_ecdsa_signature_save(sig, &r, &s);\n    return 1;\n}\n\nstatic int secp256k1_ecdsa_sig_recover(const secp256k1_ecmult_context *ctx, const secp256k1_scalar *sigr, const secp256k1_scalar* sigs, secp256k1_ge *pubkey, const secp256k1_scalar *message, int recid) {\n    unsigned char brx[32];\n    secp256k1_fe fx;\n    secp256k1_ge x;\n    secp256k1_gej xj;\n    secp256k1_scalar rn, u1, u2;\n    secp256k1_gej qj;\n    int r;\n\n    if (secp256k1_scalar_is_zero(sigr) || secp256k1_scalar_is_zero(sigs)) {\n        return 0;\n    }\n\n    secp256k1_scalar_get_b32(brx, sigr);\n    r = secp256k1_fe_set_b32(&fx, brx);\n    (void)r;\n    VERIFY_CHECK(r); /* brx comes from a scalar, so is less than the order; certainly less than p */\n    if (recid & 2) {\n        if (secp256k1_fe_cmp_var(&fx, &secp256k1_ecdsa_const_p_minus_order) >= 0) {\n            return 0;\n        }\n        secp256k1_fe_add(&fx, &secp256k1_ecdsa_const_order_as_fe);\n    }\n    if (!secp256k1_ge_set_xo_var(&x, &fx, recid & 1)) {\n        return 0;\n    }\n    secp256k1_gej_set_ge(&xj, &x);\n    secp256k1_scalar_inverse_var(&rn, sigr);\n    secp256k1_scalar_mul(&u1, &rn, message);\n    secp256k1_scalar_negate(&u1, &u1);\n    secp256k1_scalar_mul(&u2, &rn, sigs);\n    secp256k1_ecmult(ctx, &qj, &xj, &u2, &u1);\n    secp256k1_ge_set_gej_var(pubkey, &qj);\n    return !secp256k1_gej_is_infinity(&qj);\n}\n\nint secp256k1_ecdsa_sign_recoverable(const secp256k1_context* ctx, secp256k1_ecdsa_recoverable_signature *signature, const unsigned char *msg32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void* noncedata) {\n    secp256k1_scalar r, s;\n    secp256k1_scalar sec, non, msg;\n    int recid;\n    int ret = 0;\n    int overflow = 0;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));\n    ARG_CHECK(msg32 != NULL);\n    ARG_CHECK(signature != NULL);\n    ARG_CHECK(seckey != NULL);\n    if (noncefp == NULL) {\n        noncefp = secp256k1_nonce_function_default;\n    }\n\n    secp256k1_scalar_set_b32(&sec, seckey, &overflow);\n    /* Fail if the secret key is invalid. */\n    if (!overflow && !secp256k1_scalar_is_zero(&sec)) {\n        unsigned char nonce32[32];\n        unsigned int count = 0;\n        secp256k1_scalar_set_b32(&msg, msg32, NULL);\n        while (1) {\n            ret = noncefp(nonce32, msg32, seckey, NULL, (void*)noncedata, count);\n            if (!ret) {\n                break;\n            }\n            secp256k1_scalar_set_b32(&non, nonce32, &overflow);\n            if (!secp256k1_scalar_is_zero(&non) && !overflow) {\n                if (secp256k1_ecdsa_sig_sign(&ctx->ecmult_gen_ctx, &r, &s, &sec, &msg, &non, &recid)) {\n                    break;\n                }\n            }\n            count++;\n        }\n        memset(nonce32, 0, 32);\n        secp256k1_scalar_clear(&msg);\n        secp256k1_scalar_clear(&non);\n        secp256k1_scalar_clear(&sec);\n    }\n    if (ret) {\n        secp256k1_ecdsa_recoverable_signature_save(signature, &r, &s, recid);\n    } else {\n        memset(signature, 0, sizeof(*signature));\n    }\n    return ret;\n}\n\nint secp256k1_ecdsa_recover(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const secp256k1_ecdsa_recoverable_signature *signature, const unsigned char *msg32) {\n    secp256k1_ge q;\n    secp256k1_scalar r, s;\n    secp256k1_scalar m;\n    int recid;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(secp256k1_ecmult_context_is_built(&ctx->ecmult_ctx));\n    ARG_CHECK(msg32 != NULL);\n    ARG_CHECK(signature != NULL);\n    ARG_CHECK(pubkey != NULL);\n\n    secp256k1_ecdsa_recoverable_signature_load(ctx, &r, &s, &recid, signature);\n    VERIFY_CHECK(recid >= 0 && recid < 4);  /* should have been caught in parse_compact */\n    secp256k1_scalar_set_b32(&m, msg32, NULL);\n    if (secp256k1_ecdsa_sig_recover(&ctx->ecmult_ctx, &r, &s, &q, &m, recid)) {\n        secp256k1_pubkey_save(pubkey, &q);\n        return 1;\n    } else {\n        memset(pubkey, 0, sizeof(*pubkey));\n        return 0;\n    }\n}\n\n#endif /* SECP256K1_MODULE_RECOVERY_MAIN_H */\n"
  },
  {
    "path": "src/secp256k1/src/modules/recovery/tests_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013-2015 Pieter Wuille                              *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_MODULE_RECOVERY_TESTS_H\n#define SECP256K1_MODULE_RECOVERY_TESTS_H\n\nstatic int recovery_test_nonce_function(unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter) {\n    (void) msg32;\n    (void) key32;\n    (void) algo16;\n    (void) data;\n\n    /* On the first run, return 0 to force a second run */\n    if (counter == 0) {\n        memset(nonce32, 0, 32);\n        return 1;\n    }\n    /* On the second run, return an overflow to force a third run */\n    if (counter == 1) {\n        memset(nonce32, 0xff, 32);\n        return 1;\n    }\n    /* On the next run, return a valid nonce, but flip a coin as to whether or not to fail signing. */\n    memset(nonce32, 1, 32);\n    return secp256k1_rand_bits(1);\n}\n\nvoid test_ecdsa_recovery_api(void) {\n    /* Setup contexts that just count errors */\n    secp256k1_context *none = secp256k1_context_create(SECP256K1_CONTEXT_NONE);\n    secp256k1_context *sign = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);\n    secp256k1_context *vrfy = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY);\n    secp256k1_context *both = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);\n    secp256k1_pubkey pubkey;\n    secp256k1_pubkey recpubkey;\n    secp256k1_ecdsa_signature normal_sig;\n    secp256k1_ecdsa_recoverable_signature recsig;\n    unsigned char privkey[32] = { 1 };\n    unsigned char message[32] = { 2 };\n    int32_t ecount = 0;\n    int recid = 0;\n    unsigned char sig[74];\n    unsigned char zero_privkey[32] = { 0 };\n    unsigned char over_privkey[32] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                                       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                                       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n                                       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };\n\n    secp256k1_context_set_error_callback(none, counting_illegal_callback_fn, &ecount);\n    secp256k1_context_set_error_callback(sign, counting_illegal_callback_fn, &ecount);\n    secp256k1_context_set_error_callback(vrfy, counting_illegal_callback_fn, &ecount);\n    secp256k1_context_set_error_callback(both, counting_illegal_callback_fn, &ecount);\n    secp256k1_context_set_illegal_callback(none, counting_illegal_callback_fn, &ecount);\n    secp256k1_context_set_illegal_callback(sign, counting_illegal_callback_fn, &ecount);\n    secp256k1_context_set_illegal_callback(vrfy, counting_illegal_callback_fn, &ecount);\n    secp256k1_context_set_illegal_callback(both, counting_illegal_callback_fn, &ecount);\n\n    /* Construct and verify corresponding public key. */\n    CHECK(secp256k1_ec_seckey_verify(ctx, privkey) == 1);\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, privkey) == 1);\n\n    /* Check bad contexts and NULLs for signing */\n    ecount = 0;\n    CHECK(secp256k1_ecdsa_sign_recoverable(none, &recsig, message, privkey, NULL, NULL) == 0);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ecdsa_sign_recoverable(sign, &recsig, message, privkey, NULL, NULL) == 1);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ecdsa_sign_recoverable(vrfy, &recsig, message, privkey, NULL, NULL) == 0);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ecdsa_sign_recoverable(both, &recsig, message, privkey, NULL, NULL) == 1);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ecdsa_sign_recoverable(both, NULL, message, privkey, NULL, NULL) == 0);\n    CHECK(ecount == 3);\n    CHECK(secp256k1_ecdsa_sign_recoverable(both, &recsig, NULL, privkey, NULL, NULL) == 0);\n    CHECK(ecount == 4);\n    CHECK(secp256k1_ecdsa_sign_recoverable(both, &recsig, message, NULL, NULL, NULL) == 0);\n    CHECK(ecount == 5);\n    /* This will fail or succeed randomly, and in either case will not ARG_CHECK failure */\n    secp256k1_ecdsa_sign_recoverable(both, &recsig, message, privkey, recovery_test_nonce_function, NULL);\n    CHECK(ecount == 5);\n    /* These will all fail, but not in ARG_CHECK way */\n    CHECK(secp256k1_ecdsa_sign_recoverable(both, &recsig, message, zero_privkey, NULL, NULL) == 0);\n    CHECK(secp256k1_ecdsa_sign_recoverable(both, &recsig, message, over_privkey, NULL, NULL) == 0);\n    /* This one will succeed. */\n    CHECK(secp256k1_ecdsa_sign_recoverable(both, &recsig, message, privkey, NULL, NULL) == 1);\n    CHECK(ecount == 5);\n\n    /* Check signing with a goofy nonce function */\n\n    /* Check bad contexts and NULLs for recovery */\n    ecount = 0;\n    CHECK(secp256k1_ecdsa_recover(none, &recpubkey, &recsig, message) == 0);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ecdsa_recover(sign, &recpubkey, &recsig, message) == 0);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ecdsa_recover(vrfy, &recpubkey, &recsig, message) == 1);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ecdsa_recover(both, &recpubkey, &recsig, message) == 1);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ecdsa_recover(both, NULL, &recsig, message) == 0);\n    CHECK(ecount == 3);\n    CHECK(secp256k1_ecdsa_recover(both, &recpubkey, NULL, message) == 0);\n    CHECK(ecount == 4);\n    CHECK(secp256k1_ecdsa_recover(both, &recpubkey, &recsig, NULL) == 0);\n    CHECK(ecount == 5);\n\n    /* Check NULLs for conversion */\n    CHECK(secp256k1_ecdsa_sign(both, &normal_sig, message, privkey, NULL, NULL) == 1);\n    ecount = 0;\n    CHECK(secp256k1_ecdsa_recoverable_signature_convert(both, NULL, &recsig) == 0);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ecdsa_recoverable_signature_convert(both, &normal_sig, NULL) == 0);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ecdsa_recoverable_signature_convert(both, &normal_sig, &recsig) == 1);\n\n    /* Check NULLs for de/serialization */\n    CHECK(secp256k1_ecdsa_sign_recoverable(both, &recsig, message, privkey, NULL, NULL) == 1);\n    ecount = 0;\n    CHECK(secp256k1_ecdsa_recoverable_signature_serialize_compact(both, NULL, &recid, &recsig) == 0);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ecdsa_recoverable_signature_serialize_compact(both, sig, NULL, &recsig) == 0);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ecdsa_recoverable_signature_serialize_compact(both, sig, &recid, NULL) == 0);\n    CHECK(ecount == 3);\n    CHECK(secp256k1_ecdsa_recoverable_signature_serialize_compact(both, sig, &recid, &recsig) == 1);\n\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(both, NULL, sig, recid) == 0);\n    CHECK(ecount == 4);\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(both, &recsig, NULL, recid) == 0);\n    CHECK(ecount == 5);\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(both, &recsig, sig, -1) == 0);\n    CHECK(ecount == 6);\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(both, &recsig, sig, 5) == 0);\n    CHECK(ecount == 7);\n    /* overflow in signature will fail but not affect ecount */\n    memcpy(sig, over_privkey, 32);\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(both, &recsig, sig, recid) == 0);\n    CHECK(ecount == 7);\n\n    /* cleanup */\n    secp256k1_context_destroy(none);\n    secp256k1_context_destroy(sign);\n    secp256k1_context_destroy(vrfy);\n    secp256k1_context_destroy(both);\n}\n\nvoid test_ecdsa_recovery_end_to_end(void) {\n    unsigned char extra[32] = {0x00};\n    unsigned char privkey[32];\n    unsigned char message[32];\n    secp256k1_ecdsa_signature signature[5];\n    secp256k1_ecdsa_recoverable_signature rsignature[5];\n    unsigned char sig[74];\n    secp256k1_pubkey pubkey;\n    secp256k1_pubkey recpubkey;\n    int recid = 0;\n\n    /* Generate a random key and message. */\n    {\n        secp256k1_scalar msg, key;\n        random_scalar_order_test(&msg);\n        random_scalar_order_test(&key);\n        secp256k1_scalar_get_b32(privkey, &key);\n        secp256k1_scalar_get_b32(message, &msg);\n    }\n\n    /* Construct and verify corresponding public key. */\n    CHECK(secp256k1_ec_seckey_verify(ctx, privkey) == 1);\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, privkey) == 1);\n\n    /* Serialize/parse compact and verify/recover. */\n    extra[0] = 0;\n    CHECK(secp256k1_ecdsa_sign_recoverable(ctx, &rsignature[0], message, privkey, NULL, NULL) == 1);\n    CHECK(secp256k1_ecdsa_sign(ctx, &signature[0], message, privkey, NULL, NULL) == 1);\n    CHECK(secp256k1_ecdsa_sign_recoverable(ctx, &rsignature[4], message, privkey, NULL, NULL) == 1);\n    CHECK(secp256k1_ecdsa_sign_recoverable(ctx, &rsignature[1], message, privkey, NULL, extra) == 1);\n    extra[31] = 1;\n    CHECK(secp256k1_ecdsa_sign_recoverable(ctx, &rsignature[2], message, privkey, NULL, extra) == 1);\n    extra[31] = 0;\n    extra[0] = 1;\n    CHECK(secp256k1_ecdsa_sign_recoverable(ctx, &rsignature[3], message, privkey, NULL, extra) == 1);\n    CHECK(secp256k1_ecdsa_recoverable_signature_serialize_compact(ctx, sig, &recid, &rsignature[4]) == 1);\n    CHECK(secp256k1_ecdsa_recoverable_signature_convert(ctx, &signature[4], &rsignature[4]) == 1);\n    CHECK(memcmp(&signature[4], &signature[0], 64) == 0);\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[4], message, &pubkey) == 1);\n    memset(&rsignature[4], 0, sizeof(rsignature[4]));\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsignature[4], sig, recid) == 1);\n    CHECK(secp256k1_ecdsa_recoverable_signature_convert(ctx, &signature[4], &rsignature[4]) == 1);\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[4], message, &pubkey) == 1);\n    /* Parse compact (with recovery id) and recover. */\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsignature[4], sig, recid) == 1);\n    CHECK(secp256k1_ecdsa_recover(ctx, &recpubkey, &rsignature[4], message) == 1);\n    CHECK(memcmp(&pubkey, &recpubkey, sizeof(pubkey)) == 0);\n    /* Serialize/destroy/parse signature and verify again. */\n    CHECK(secp256k1_ecdsa_recoverable_signature_serialize_compact(ctx, sig, &recid, &rsignature[4]) == 1);\n    sig[secp256k1_rand_bits(6)] += 1 + secp256k1_rand_int(255);\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsignature[4], sig, recid) == 1);\n    CHECK(secp256k1_ecdsa_recoverable_signature_convert(ctx, &signature[4], &rsignature[4]) == 1);\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[4], message, &pubkey) == 0);\n    /* Recover again */\n    CHECK(secp256k1_ecdsa_recover(ctx, &recpubkey, &rsignature[4], message) == 0 ||\n          memcmp(&pubkey, &recpubkey, sizeof(pubkey)) != 0);\n}\n\n/* Tests several edge cases. */\nvoid test_ecdsa_recovery_edge_cases(void) {\n    const unsigned char msg32[32] = {\n        'T', 'h', 'i', 's', ' ', 'i', 's', ' ',\n        'a', ' ', 'v', 'e', 'r', 'y', ' ', 's',\n        'e', 'c', 'r', 'e', 't', ' ', 'm', 'e',\n        's', 's', 'a', 'g', 'e', '.', '.', '.'\n    };\n    const unsigned char sig64[64] = {\n        /* Generated by signing the above message with nonce 'This is the nonce we will use...'\n         * and secret key 0 (which is not valid), resulting in recid 0. */\n        0x67, 0xCB, 0x28, 0x5F, 0x9C, 0xD1, 0x94, 0xE8,\n        0x40, 0xD6, 0x29, 0x39, 0x7A, 0xF5, 0x56, 0x96,\n        0x62, 0xFD, 0xE4, 0x46, 0x49, 0x99, 0x59, 0x63,\n        0x17, 0x9A, 0x7D, 0xD1, 0x7B, 0xD2, 0x35, 0x32,\n        0x4B, 0x1B, 0x7D, 0xF3, 0x4C, 0xE1, 0xF6, 0x8E,\n        0x69, 0x4F, 0xF6, 0xF1, 0x1A, 0xC7, 0x51, 0xDD,\n        0x7D, 0xD7, 0x3E, 0x38, 0x7E, 0xE4, 0xFC, 0x86,\n        0x6E, 0x1B, 0xE8, 0xEC, 0xC7, 0xDD, 0x95, 0x57\n    };\n    secp256k1_pubkey pubkey;\n    /* signature (r,s) = (4,4), which can be recovered with all 4 recids. */\n    const unsigned char sigb64[64] = {\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,\n    };\n    secp256k1_pubkey pubkeyb;\n    secp256k1_ecdsa_recoverable_signature rsig;\n    secp256k1_ecdsa_signature sig;\n    int recid;\n\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsig, sig64, 0));\n    CHECK(!secp256k1_ecdsa_recover(ctx, &pubkey, &rsig, msg32));\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsig, sig64, 1));\n    CHECK(secp256k1_ecdsa_recover(ctx, &pubkey, &rsig, msg32));\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsig, sig64, 2));\n    CHECK(!secp256k1_ecdsa_recover(ctx, &pubkey, &rsig, msg32));\n    CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsig, sig64, 3));\n    CHECK(!secp256k1_ecdsa_recover(ctx, &pubkey, &rsig, msg32));\n\n    for (recid = 0; recid < 4; recid++) {\n        int i;\n        int recid2;\n        /* (4,4) encoded in DER. */\n        unsigned char sigbder[8] = {0x30, 0x06, 0x02, 0x01, 0x04, 0x02, 0x01, 0x04};\n        unsigned char sigcder_zr[7] = {0x30, 0x05, 0x02, 0x00, 0x02, 0x01, 0x01};\n        unsigned char sigcder_zs[7] = {0x30, 0x05, 0x02, 0x01, 0x01, 0x02, 0x00};\n        unsigned char sigbderalt1[39] = {\n            0x30, 0x25, 0x02, 0x20, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x04, 0x02, 0x01, 0x04,\n        };\n        unsigned char sigbderalt2[39] = {\n            0x30, 0x25, 0x02, 0x01, 0x04, 0x02, 0x20, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,\n        };\n        unsigned char sigbderalt3[40] = {\n            0x30, 0x26, 0x02, 0x21, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x01, 0x04,\n        };\n        unsigned char sigbderalt4[40] = {\n            0x30, 0x26, 0x02, 0x01, 0x04, 0x02, 0x21, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,\n        };\n        /* (order + r,4) encoded in DER. */\n        unsigned char sigbderlong[40] = {\n            0x30, 0x26, 0x02, 0x21, 0x00, 0xFF, 0xFF, 0xFF,\n            0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n            0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xBA, 0xAE, 0xDC,\n            0xE6, 0xAF, 0x48, 0xA0, 0x3B, 0xBF, 0xD2, 0x5E,\n            0x8C, 0xD0, 0x36, 0x41, 0x45, 0x02, 0x01, 0x04\n        };\n        CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsig, sigb64, recid) == 1);\n        CHECK(secp256k1_ecdsa_recover(ctx, &pubkeyb, &rsig, msg32) == 1);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbder, sizeof(sigbder)) == 1);\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg32, &pubkeyb) == 1);\n        for (recid2 = 0; recid2 < 4; recid2++) {\n            secp256k1_pubkey pubkey2b;\n            CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsig, sigb64, recid2) == 1);\n            CHECK(secp256k1_ecdsa_recover(ctx, &pubkey2b, &rsig, msg32) == 1);\n            /* Verifying with (order + r,4) should always fail. */\n            CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbderlong, sizeof(sigbderlong)) == 1);\n            CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg32, &pubkeyb) == 0);\n        }\n        /* DER parsing tests. */\n        /* Zero length r/s. */\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigcder_zr, sizeof(sigcder_zr)) == 0);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigcder_zs, sizeof(sigcder_zs)) == 0);\n        /* Leading zeros. */\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbderalt1, sizeof(sigbderalt1)) == 0);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbderalt2, sizeof(sigbderalt2)) == 0);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbderalt3, sizeof(sigbderalt3)) == 0);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbderalt4, sizeof(sigbderalt4)) == 0);\n        sigbderalt3[4] = 1;\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbderalt3, sizeof(sigbderalt3)) == 1);\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg32, &pubkeyb) == 0);\n        sigbderalt4[7] = 1;\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbderalt4, sizeof(sigbderalt4)) == 1);\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg32, &pubkeyb) == 0);\n        /* Damage signature. */\n        sigbder[7]++;\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbder, sizeof(sigbder)) == 1);\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg32, &pubkeyb) == 0);\n        sigbder[7]--;\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbder, 6) == 0);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbder, sizeof(sigbder) - 1) == 0);\n        for(i = 0; i < 8; i++) {\n            int c;\n            unsigned char orig = sigbder[i];\n            /*Try every single-byte change.*/\n            for (c = 0; c < 256; c++) {\n                if (c == orig ) {\n                    continue;\n                }\n                sigbder[i] = c;\n                CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigbder, sizeof(sigbder)) == 0 || secp256k1_ecdsa_verify(ctx, &sig, msg32, &pubkeyb) == 0);\n            }\n            sigbder[i] = orig;\n        }\n    }\n\n    /* Test r/s equal to zero */\n    {\n        /* (1,1) encoded in DER. */\n        unsigned char sigcder[8] = {0x30, 0x06, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01};\n        unsigned char sigc64[64] = {\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n        };\n        secp256k1_pubkey pubkeyc;\n        CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsig, sigc64, 0) == 1);\n        CHECK(secp256k1_ecdsa_recover(ctx, &pubkeyc, &rsig, msg32) == 1);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigcder, sizeof(sigcder)) == 1);\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg32, &pubkeyc) == 1);\n        sigcder[4] = 0;\n        sigc64[31] = 0;\n        CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsig, sigc64, 0) == 1);\n        CHECK(secp256k1_ecdsa_recover(ctx, &pubkeyb, &rsig, msg32) == 0);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigcder, sizeof(sigcder)) == 1);\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg32, &pubkeyc) == 0);\n        sigcder[4] = 1;\n        sigcder[7] = 0;\n        sigc64[31] = 1;\n        sigc64[63] = 0;\n        CHECK(secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, &rsig, sigc64, 0) == 1);\n        CHECK(secp256k1_ecdsa_recover(ctx, &pubkeyb, &rsig, msg32) == 0);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigcder, sizeof(sigcder)) == 1);\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg32, &pubkeyc) == 0);\n    }\n}\n\nvoid run_recovery_tests(void) {\n    int i;\n    for (i = 0; i < count; i++) {\n        test_ecdsa_recovery_api();\n    }\n    for (i = 0; i < 64*count; i++) {\n        test_ecdsa_recovery_end_to_end();\n    }\n    test_ecdsa_recovery_edge_cases();\n}\n\n#endif /* SECP256K1_MODULE_RECOVERY_TESTS_H */\n"
  },
  {
    "path": "src/secp256k1/src/num.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_NUM_H\n#define SECP256K1_NUM_H\n\n#ifndef USE_NUM_NONE\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n#if defined(USE_NUM_GMP)\n#include \"num_gmp.h\"\n#else\n#error \"Please select num implementation\"\n#endif\n\n/** Copy a number. */\nstatic void secp256k1_num_copy(secp256k1_num *r, const secp256k1_num *a);\n\n/** Convert a number's absolute value to a binary big-endian string.\n *  There must be enough place. */\nstatic void secp256k1_num_get_bin(unsigned char *r, unsigned int rlen, const secp256k1_num *a);\n\n/** Set a number to the value of a binary big-endian string. */\nstatic void secp256k1_num_set_bin(secp256k1_num *r, const unsigned char *a, unsigned int alen);\n\n/** Compute a modular inverse. The input must be less than the modulus. */\nstatic void secp256k1_num_mod_inverse(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *m);\n\n/** Compute the jacobi symbol (a|b). b must be positive and odd. */\nstatic int secp256k1_num_jacobi(const secp256k1_num *a, const secp256k1_num *b);\n\n/** Compare the absolute value of two numbers. */\nstatic int secp256k1_num_cmp(const secp256k1_num *a, const secp256k1_num *b);\n\n/** Test whether two number are equal (including sign). */\nstatic int secp256k1_num_eq(const secp256k1_num *a, const secp256k1_num *b);\n\n/** Add two (signed) numbers. */\nstatic void secp256k1_num_add(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b);\n\n/** Subtract two (signed) numbers. */\nstatic void secp256k1_num_sub(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b);\n\n/** Multiply two (signed) numbers. */\nstatic void secp256k1_num_mul(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b);\n\n/** Replace a number by its remainder modulo m. M's sign is ignored. The result is a number between 0 and m-1,\n    even if r was negative. */\nstatic void secp256k1_num_mod(secp256k1_num *r, const secp256k1_num *m);\n\n/** Right-shift the passed number by bits bits. */\nstatic void secp256k1_num_shift(secp256k1_num *r, int bits);\n\n/** Check whether a number is zero. */\nstatic int secp256k1_num_is_zero(const secp256k1_num *a);\n\n/** Check whether a number is one. */\nstatic int secp256k1_num_is_one(const secp256k1_num *a);\n\n/** Check whether a number is strictly negative. */\nstatic int secp256k1_num_is_neg(const secp256k1_num *a);\n\n/** Change a number's sign. */\nstatic void secp256k1_num_negate(secp256k1_num *r);\n\n#endif\n\n#endif /* SECP256K1_NUM_H */\n"
  },
  {
    "path": "src/secp256k1/src/num_gmp.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_NUM_REPR_H\n#define SECP256K1_NUM_REPR_H\n\n#include <gmp.h>\n\n#define NUM_LIMBS ((256+GMP_NUMB_BITS-1)/GMP_NUMB_BITS)\n\ntypedef struct {\n    mp_limb_t data[2*NUM_LIMBS];\n    int neg;\n    int limbs;\n} secp256k1_num;\n\n#endif /* SECP256K1_NUM_REPR_H */\n"
  },
  {
    "path": "src/secp256k1/src/num_gmp_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_NUM_REPR_IMPL_H\n#define SECP256K1_NUM_REPR_IMPL_H\n\n#include <string.h>\n#include <stdlib.h>\n#include <gmp.h>\n\n#include \"util.h\"\n#include \"num.h\"\n\n#ifdef VERIFY\nstatic void secp256k1_num_sanity(const secp256k1_num *a) {\n    VERIFY_CHECK(a->limbs == 1 || (a->limbs > 1 && a->data[a->limbs-1] != 0));\n}\n#else\n#define secp256k1_num_sanity(a) do { } while(0)\n#endif\n\nstatic void secp256k1_num_copy(secp256k1_num *r, const secp256k1_num *a) {\n    *r = *a;\n}\n\nstatic void secp256k1_num_get_bin(unsigned char *r, unsigned int rlen, const secp256k1_num *a) {\n    unsigned char tmp[65];\n    int len = 0;\n    int shift = 0;\n    if (a->limbs>1 || a->data[0] != 0) {\n        len = mpn_get_str(tmp, 256, (mp_limb_t*)a->data, a->limbs);\n    }\n    while (shift < len && tmp[shift] == 0) shift++;\n    VERIFY_CHECK(len-shift <= (int)rlen);\n    memset(r, 0, rlen - len + shift);\n    if (len > shift) {\n        memcpy(r + rlen - len + shift, tmp + shift, len - shift);\n    }\n    memset(tmp, 0, sizeof(tmp));\n}\n\nstatic void secp256k1_num_set_bin(secp256k1_num *r, const unsigned char *a, unsigned int alen) {\n    int len;\n    VERIFY_CHECK(alen > 0);\n    VERIFY_CHECK(alen <= 64);\n    len = mpn_set_str(r->data, a, alen, 256);\n    if (len == 0) {\n        r->data[0] = 0;\n        len = 1;\n    }\n    VERIFY_CHECK(len <= NUM_LIMBS*2);\n    r->limbs = len;\n    r->neg = 0;\n    while (r->limbs > 1 && r->data[r->limbs-1]==0) {\n        r->limbs--;\n    }\n}\n\nstatic void secp256k1_num_add_abs(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {\n    mp_limb_t c = mpn_add(r->data, a->data, a->limbs, b->data, b->limbs);\n    r->limbs = a->limbs;\n    if (c != 0) {\n        VERIFY_CHECK(r->limbs < 2*NUM_LIMBS);\n        r->data[r->limbs++] = c;\n    }\n}\n\nstatic void secp256k1_num_sub_abs(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {\n    mp_limb_t c = mpn_sub(r->data, a->data, a->limbs, b->data, b->limbs);\n    (void)c;\n    VERIFY_CHECK(c == 0);\n    r->limbs = a->limbs;\n    while (r->limbs > 1 && r->data[r->limbs-1]==0) {\n        r->limbs--;\n    }\n}\n\nstatic void secp256k1_num_mod(secp256k1_num *r, const secp256k1_num *m) {\n    secp256k1_num_sanity(r);\n    secp256k1_num_sanity(m);\n\n    if (r->limbs >= m->limbs) {\n        mp_limb_t t[2*NUM_LIMBS];\n        mpn_tdiv_qr(t, r->data, 0, r->data, r->limbs, m->data, m->limbs);\n        memset(t, 0, sizeof(t));\n        r->limbs = m->limbs;\n        while (r->limbs > 1 && r->data[r->limbs-1]==0) {\n            r->limbs--;\n        }\n    }\n\n    if (r->neg && (r->limbs > 1 || r->data[0] != 0)) {\n        secp256k1_num_sub_abs(r, m, r);\n        r->neg = 0;\n    }\n}\n\nstatic void secp256k1_num_mod_inverse(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *m) {\n    int i;\n    mp_limb_t g[NUM_LIMBS+1];\n    mp_limb_t u[NUM_LIMBS+1];\n    mp_limb_t v[NUM_LIMBS+1];\n    mp_size_t sn;\n    mp_size_t gn;\n    secp256k1_num_sanity(a);\n    secp256k1_num_sanity(m);\n\n    /** mpn_gcdext computes: (G,S) = gcdext(U,V), where\n     *  * G = gcd(U,V)\n     *  * G = U*S + V*T\n     *  * U has equal or more limbs than V, and V has no padding\n     *  If we set U to be (a padded version of) a, and V = m:\n     *    G = a*S + m*T\n     *    G = a*S mod m\n     *  Assuming G=1:\n     *    S = 1/a mod m\n     */\n    VERIFY_CHECK(m->limbs <= NUM_LIMBS);\n    VERIFY_CHECK(m->data[m->limbs-1] != 0);\n    for (i = 0; i < m->limbs; i++) {\n        u[i] = (i < a->limbs) ? a->data[i] : 0;\n        v[i] = m->data[i];\n    }\n    sn = NUM_LIMBS+1;\n    gn = mpn_gcdext(g, r->data, &sn, u, m->limbs, v, m->limbs);\n    (void)gn;\n    VERIFY_CHECK(gn == 1);\n    VERIFY_CHECK(g[0] == 1);\n    r->neg = a->neg ^ m->neg;\n    if (sn < 0) {\n        mpn_sub(r->data, m->data, m->limbs, r->data, -sn);\n        r->limbs = m->limbs;\n        while (r->limbs > 1 && r->data[r->limbs-1]==0) {\n            r->limbs--;\n        }\n    } else {\n        r->limbs = sn;\n    }\n    memset(g, 0, sizeof(g));\n    memset(u, 0, sizeof(u));\n    memset(v, 0, sizeof(v));\n}\n\nstatic int secp256k1_num_jacobi(const secp256k1_num *a, const secp256k1_num *b) {\n    int ret;\n    mpz_t ga, gb;\n    secp256k1_num_sanity(a);\n    secp256k1_num_sanity(b);\n    VERIFY_CHECK(!b->neg && (b->limbs > 0) && (b->data[0] & 1));\n\n    mpz_inits(ga, gb, NULL);\n\n    mpz_import(gb, b->limbs, -1, sizeof(mp_limb_t), 0, 0, b->data);\n    mpz_import(ga, a->limbs, -1, sizeof(mp_limb_t), 0, 0, a->data);\n    if (a->neg) {\n        mpz_neg(ga, ga);\n    }\n\n    ret = mpz_jacobi(ga, gb);\n\n    mpz_clears(ga, gb, NULL);\n\n    return ret;\n}\n\nstatic int secp256k1_num_is_one(const secp256k1_num *a) {\n    return (a->limbs == 1 && a->data[0] == 1);\n}\n\nstatic int secp256k1_num_is_zero(const secp256k1_num *a) {\n    return (a->limbs == 1 && a->data[0] == 0);\n}\n\nstatic int secp256k1_num_is_neg(const secp256k1_num *a) {\n    return (a->limbs > 1 || a->data[0] != 0) && a->neg;\n}\n\nstatic int secp256k1_num_cmp(const secp256k1_num *a, const secp256k1_num *b) {\n    if (a->limbs > b->limbs) {\n        return 1;\n    }\n    if (a->limbs < b->limbs) {\n        return -1;\n    }\n    return mpn_cmp(a->data, b->data, a->limbs);\n}\n\nstatic int secp256k1_num_eq(const secp256k1_num *a, const secp256k1_num *b) {\n    if (a->limbs > b->limbs) {\n        return 0;\n    }\n    if (a->limbs < b->limbs) {\n        return 0;\n    }\n    if ((a->neg && !secp256k1_num_is_zero(a)) != (b->neg && !secp256k1_num_is_zero(b))) {\n        return 0;\n    }\n    return mpn_cmp(a->data, b->data, a->limbs) == 0;\n}\n\nstatic void secp256k1_num_subadd(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b, int bneg) {\n    if (!(b->neg ^ bneg ^ a->neg)) { /* a and b have the same sign */\n        r->neg = a->neg;\n        if (a->limbs >= b->limbs) {\n            secp256k1_num_add_abs(r, a, b);\n        } else {\n            secp256k1_num_add_abs(r, b, a);\n        }\n    } else {\n        if (secp256k1_num_cmp(a, b) > 0) {\n            r->neg = a->neg;\n            secp256k1_num_sub_abs(r, a, b);\n        } else {\n            r->neg = b->neg ^ bneg;\n            secp256k1_num_sub_abs(r, b, a);\n        }\n    }\n}\n\nstatic void secp256k1_num_add(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {\n    secp256k1_num_sanity(a);\n    secp256k1_num_sanity(b);\n    secp256k1_num_subadd(r, a, b, 0);\n}\n\nstatic void secp256k1_num_sub(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {\n    secp256k1_num_sanity(a);\n    secp256k1_num_sanity(b);\n    secp256k1_num_subadd(r, a, b, 1);\n}\n\nstatic void secp256k1_num_mul(secp256k1_num *r, const secp256k1_num *a, const secp256k1_num *b) {\n    mp_limb_t tmp[2*NUM_LIMBS+1];\n    secp256k1_num_sanity(a);\n    secp256k1_num_sanity(b);\n\n    VERIFY_CHECK(a->limbs + b->limbs <= 2*NUM_LIMBS+1);\n    if ((a->limbs==1 && a->data[0]==0) || (b->limbs==1 && b->data[0]==0)) {\n        r->limbs = 1;\n        r->neg = 0;\n        r->data[0] = 0;\n        return;\n    }\n    if (a->limbs >= b->limbs) {\n        mpn_mul(tmp, a->data, a->limbs, b->data, b->limbs);\n    } else {\n        mpn_mul(tmp, b->data, b->limbs, a->data, a->limbs);\n    }\n    r->limbs = a->limbs + b->limbs;\n    if (r->limbs > 1 && tmp[r->limbs - 1]==0) {\n        r->limbs--;\n    }\n    VERIFY_CHECK(r->limbs <= 2*NUM_LIMBS);\n    mpn_copyi(r->data, tmp, r->limbs);\n    r->neg = a->neg ^ b->neg;\n    memset(tmp, 0, sizeof(tmp));\n}\n\nstatic void secp256k1_num_shift(secp256k1_num *r, int bits) {\n    if (bits % GMP_NUMB_BITS) {\n        /* Shift within limbs. */\n        mpn_rshift(r->data, r->data, r->limbs, bits % GMP_NUMB_BITS);\n    }\n    if (bits >= GMP_NUMB_BITS) {\n        int i;\n        /* Shift full limbs. */\n        for (i = 0; i < r->limbs; i++) {\n            int index = i + (bits / GMP_NUMB_BITS);\n            if (index < r->limbs && index < 2*NUM_LIMBS) {\n                r->data[i] = r->data[index];\n            } else {\n                r->data[i] = 0;\n            }\n        }\n    }\n    while (r->limbs>1 && r->data[r->limbs-1]==0) {\n        r->limbs--;\n    }\n}\n\nstatic void secp256k1_num_negate(secp256k1_num *r) {\n    r->neg ^= 1;\n}\n\n#endif /* SECP256K1_NUM_REPR_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/num_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_NUM_IMPL_H\n#define SECP256K1_NUM_IMPL_H\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n#include \"num.h\"\n\n#if defined(USE_NUM_GMP)\n#include \"num_gmp_impl.h\"\n#elif defined(USE_NUM_NONE)\n/* Nothing. */\n#else\n#error \"Please select num implementation\"\n#endif\n\n#endif /* SECP256K1_NUM_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/scalar.h",
    "content": "/**********************************************************************\n * Copyright (c) 2014 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_SCALAR_H\n#define SECP256K1_SCALAR_H\n\n#include \"num.h\"\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n#if defined(EXHAUSTIVE_TEST_ORDER)\n#include \"scalar_low.h\"\n#elif defined(USE_SCALAR_4X64)\n#include \"scalar_4x64.h\"\n#elif defined(USE_SCALAR_8X32)\n#include \"scalar_8x32.h\"\n#else\n#error \"Please select scalar implementation\"\n#endif\n\n/** Clear a scalar to prevent the leak of sensitive data. */\nstatic void secp256k1_scalar_clear(secp256k1_scalar *r);\n\n/** Access bits from a scalar. All requested bits must belong to the same 32-bit limb. */\nstatic unsigned int secp256k1_scalar_get_bits(const secp256k1_scalar *a, unsigned int offset, unsigned int count);\n\n/** Access bits from a scalar. Not constant time. */\nstatic unsigned int secp256k1_scalar_get_bits_var(const secp256k1_scalar *a, unsigned int offset, unsigned int count);\n\n/** Set a scalar from a big endian byte array. */\nstatic void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *bin, int *overflow);\n\n/** Set a scalar to an unsigned integer. */\nstatic void secp256k1_scalar_set_int(secp256k1_scalar *r, unsigned int v);\n\n/** Convert a scalar to a byte array. */\nstatic void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar* a);\n\n/** Add two scalars together (modulo the group order). Returns whether it overflowed. */\nstatic int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b);\n\n/** Conditionally add a power of two to a scalar. The result is not allowed to overflow. */\nstatic void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int flag);\n\n/** Multiply two scalars (modulo the group order). */\nstatic void secp256k1_scalar_mul(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b);\n\n/** Shift a scalar right by some amount strictly between 0 and 16, returning\n *  the low bits that were shifted off */\nstatic int secp256k1_scalar_shr_int(secp256k1_scalar *r, int n);\n\n/** Compute the square of a scalar (modulo the group order). */\nstatic void secp256k1_scalar_sqr(secp256k1_scalar *r, const secp256k1_scalar *a);\n\n/** Compute the inverse of a scalar (modulo the group order). */\nstatic void secp256k1_scalar_inverse(secp256k1_scalar *r, const secp256k1_scalar *a);\n\n/** Compute the inverse of a scalar (modulo the group order), without constant-time guarantee. */\nstatic void secp256k1_scalar_inverse_var(secp256k1_scalar *r, const secp256k1_scalar *a);\n\n/** Compute the complement of a scalar (modulo the group order). */\nstatic void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a);\n\n/** Check whether a scalar equals zero. */\nstatic int secp256k1_scalar_is_zero(const secp256k1_scalar *a);\n\n/** Check whether a scalar equals one. */\nstatic int secp256k1_scalar_is_one(const secp256k1_scalar *a);\n\n/** Check whether a scalar, considered as an nonnegative integer, is even. */\nstatic int secp256k1_scalar_is_even(const secp256k1_scalar *a);\n\n/** Check whether a scalar is higher than the group order divided by 2. */\nstatic int secp256k1_scalar_is_high(const secp256k1_scalar *a);\n\n/** Conditionally negate a number, in constant time.\n * Returns -1 if the number was negated, 1 otherwise */\nstatic int secp256k1_scalar_cond_negate(secp256k1_scalar *a, int flag);\n\n#ifndef USE_NUM_NONE\n/** Convert a scalar to a number. */\nstatic void secp256k1_scalar_get_num(secp256k1_num *r, const secp256k1_scalar *a);\n\n/** Get the order of the group as a number. */\nstatic void secp256k1_scalar_order_get_num(secp256k1_num *r);\n#endif\n\n/** Compare two scalars. */\nstatic int secp256k1_scalar_eq(const secp256k1_scalar *a, const secp256k1_scalar *b);\n\n#ifdef USE_ENDOMORPHISM\n/** Find r1 and r2 such that r1+r2*2^128 = a. */\nstatic void secp256k1_scalar_split_128(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *a);\n/** Find r1 and r2 such that r1+r2*lambda = a, and r1 and r2 are maximum 128 bits long (see secp256k1_gej_mul_lambda). */\nstatic void secp256k1_scalar_split_lambda(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *a);\n#endif\n\n/** Multiply a and b (without taking the modulus!), divide by 2**shift, and round to the nearest integer. Shift must be at least 256. */\nstatic void secp256k1_scalar_mul_shift_var(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b, unsigned int shift);\n\n#endif /* SECP256K1_SCALAR_H */\n"
  },
  {
    "path": "src/secp256k1/src/scalar_4x64.h",
    "content": "/**********************************************************************\n * Copyright (c) 2014 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_SCALAR_REPR_H\n#define SECP256K1_SCALAR_REPR_H\n\n#include <stdint.h>\n\n/** A scalar modulo the group order of the secp256k1 curve. */\ntypedef struct {\n    uint64_t d[4];\n} secp256k1_scalar;\n\n#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)}}\n\n#endif /* SECP256K1_SCALAR_REPR_H */\n"
  },
  {
    "path": "src/secp256k1/src/scalar_4x64_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_SCALAR_REPR_IMPL_H\n#define SECP256K1_SCALAR_REPR_IMPL_H\n\n/* Limbs of the secp256k1 order. */\n#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)\n#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)\n#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)\n#define SECP256K1_N_3 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)\n\n/* Limbs of 2^256 minus the secp256k1 order. */\n#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)\n#define SECP256K1_N_C_1 (~SECP256K1_N_1)\n#define SECP256K1_N_C_2 (1)\n\n/* Limbs of half the secp256k1 order. */\n#define SECP256K1_N_H_0 ((uint64_t)0xDFE92F46681B20A0ULL)\n#define SECP256K1_N_H_1 ((uint64_t)0x5D576E7357A4501DULL)\n#define SECP256K1_N_H_2 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)\n#define SECP256K1_N_H_3 ((uint64_t)0x7FFFFFFFFFFFFFFFULL)\n\nSECP256K1_INLINE static void secp256k1_scalar_clear(secp256k1_scalar *r) {\n    r->d[0] = 0;\n    r->d[1] = 0;\n    r->d[2] = 0;\n    r->d[3] = 0;\n}\n\nSECP256K1_INLINE static void secp256k1_scalar_set_int(secp256k1_scalar *r, unsigned int v) {\n    r->d[0] = v;\n    r->d[1] = 0;\n    r->d[2] = 0;\n    r->d[3] = 0;\n}\n\nSECP256K1_INLINE static unsigned int secp256k1_scalar_get_bits(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {\n    VERIFY_CHECK((offset + count - 1) >> 6 == offset >> 6);\n    return (a->d[offset >> 6] >> (offset & 0x3F)) & ((((uint64_t)1) << count) - 1);\n}\n\nSECP256K1_INLINE static unsigned int secp256k1_scalar_get_bits_var(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {\n    VERIFY_CHECK(count < 32);\n    VERIFY_CHECK(offset + count <= 256);\n    if ((offset + count - 1) >> 6 == offset >> 6) {\n        return secp256k1_scalar_get_bits(a, offset, count);\n    } else {\n        VERIFY_CHECK((offset >> 6) + 1 < 4);\n        return ((a->d[offset >> 6] >> (offset & 0x3F)) | (a->d[(offset >> 6) + 1] << (64 - (offset & 0x3F)))) & ((((uint64_t)1) << count) - 1);\n    }\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_check_overflow(const secp256k1_scalar *a) {\n    int yes = 0;\n    int no = 0;\n    no |= (a->d[3] < SECP256K1_N_3); /* No need for a > check. */\n    no |= (a->d[2] < SECP256K1_N_2);\n    yes |= (a->d[2] > SECP256K1_N_2) & ~no;\n    no |= (a->d[1] < SECP256K1_N_1);\n    yes |= (a->d[1] > SECP256K1_N_1) & ~no;\n    yes |= (a->d[0] >= SECP256K1_N_0) & ~no;\n    return yes;\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_reduce(secp256k1_scalar *r, unsigned int overflow) {\n    uint128_t t;\n    VERIFY_CHECK(overflow <= 1);\n    t = (uint128_t)r->d[0] + overflow * SECP256K1_N_C_0;\n    r->d[0] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;\n    t += (uint128_t)r->d[1] + overflow * SECP256K1_N_C_1;\n    r->d[1] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;\n    t += (uint128_t)r->d[2] + overflow * SECP256K1_N_C_2;\n    r->d[2] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;\n    t += (uint64_t)r->d[3];\n    r->d[3] = t & 0xFFFFFFFFFFFFFFFFULL;\n    return overflow;\n}\n\nstatic int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {\n    int overflow;\n    uint128_t t = (uint128_t)a->d[0] + b->d[0];\n    r->d[0] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;\n    t += (uint128_t)a->d[1] + b->d[1];\n    r->d[1] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;\n    t += (uint128_t)a->d[2] + b->d[2];\n    r->d[2] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;\n    t += (uint128_t)a->d[3] + b->d[3];\n    r->d[3] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;\n    overflow = t + secp256k1_scalar_check_overflow(r);\n    VERIFY_CHECK(overflow == 0 || overflow == 1);\n    secp256k1_scalar_reduce(r, overflow);\n    return overflow;\n}\n\nstatic void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int flag) {\n    uint128_t t;\n    VERIFY_CHECK(bit < 256);\n    bit += ((uint32_t) flag - 1) & 0x100;  /* forcing (bit >> 6) > 3 makes this a noop */\n    t = (uint128_t)r->d[0] + (((uint64_t)((bit >> 6) == 0)) << (bit & 0x3F));\n    r->d[0] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;\n    t += (uint128_t)r->d[1] + (((uint64_t)((bit >> 6) == 1)) << (bit & 0x3F));\n    r->d[1] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;\n    t += (uint128_t)r->d[2] + (((uint64_t)((bit >> 6) == 2)) << (bit & 0x3F));\n    r->d[2] = t & 0xFFFFFFFFFFFFFFFFULL; t >>= 64;\n    t += (uint128_t)r->d[3] + (((uint64_t)((bit >> 6) == 3)) << (bit & 0x3F));\n    r->d[3] = t & 0xFFFFFFFFFFFFFFFFULL;\n#ifdef VERIFY\n    VERIFY_CHECK((t >> 64) == 0);\n    VERIFY_CHECK(secp256k1_scalar_check_overflow(r) == 0);\n#endif\n}\n\nstatic void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *b32, int *overflow) {\n    int over;\n    r->d[0] = (uint64_t)b32[31] | (uint64_t)b32[30] << 8 | (uint64_t)b32[29] << 16 | (uint64_t)b32[28] << 24 | (uint64_t)b32[27] << 32 | (uint64_t)b32[26] << 40 | (uint64_t)b32[25] << 48 | (uint64_t)b32[24] << 56;\n    r->d[1] = (uint64_t)b32[23] | (uint64_t)b32[22] << 8 | (uint64_t)b32[21] << 16 | (uint64_t)b32[20] << 24 | (uint64_t)b32[19] << 32 | (uint64_t)b32[18] << 40 | (uint64_t)b32[17] << 48 | (uint64_t)b32[16] << 56;\n    r->d[2] = (uint64_t)b32[15] | (uint64_t)b32[14] << 8 | (uint64_t)b32[13] << 16 | (uint64_t)b32[12] << 24 | (uint64_t)b32[11] << 32 | (uint64_t)b32[10] << 40 | (uint64_t)b32[9] << 48 | (uint64_t)b32[8] << 56;\n    r->d[3] = (uint64_t)b32[7] | (uint64_t)b32[6] << 8 | (uint64_t)b32[5] << 16 | (uint64_t)b32[4] << 24 | (uint64_t)b32[3] << 32 | (uint64_t)b32[2] << 40 | (uint64_t)b32[1] << 48 | (uint64_t)b32[0] << 56;\n    over = secp256k1_scalar_reduce(r, secp256k1_scalar_check_overflow(r));\n    if (overflow) {\n        *overflow = over;\n    }\n}\n\nstatic void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar* a) {\n    bin[0] = a->d[3] >> 56; bin[1] = a->d[3] >> 48; bin[2] = a->d[3] >> 40; bin[3] = a->d[3] >> 32; bin[4] = a->d[3] >> 24; bin[5] = a->d[3] >> 16; bin[6] = a->d[3] >> 8; bin[7] = a->d[3];\n    bin[8] = a->d[2] >> 56; bin[9] = a->d[2] >> 48; bin[10] = a->d[2] >> 40; bin[11] = a->d[2] >> 32; bin[12] = a->d[2] >> 24; bin[13] = a->d[2] >> 16; bin[14] = a->d[2] >> 8; bin[15] = a->d[2];\n    bin[16] = a->d[1] >> 56; bin[17] = a->d[1] >> 48; bin[18] = a->d[1] >> 40; bin[19] = a->d[1] >> 32; bin[20] = a->d[1] >> 24; bin[21] = a->d[1] >> 16; bin[22] = a->d[1] >> 8; bin[23] = a->d[1];\n    bin[24] = a->d[0] >> 56; bin[25] = a->d[0] >> 48; bin[26] = a->d[0] >> 40; bin[27] = a->d[0] >> 32; bin[28] = a->d[0] >> 24; bin[29] = a->d[0] >> 16; bin[30] = a->d[0] >> 8; bin[31] = a->d[0];\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_is_zero(const secp256k1_scalar *a) {\n    return (a->d[0] | a->d[1] | a->d[2] | a->d[3]) == 0;\n}\n\nstatic void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a) {\n    uint64_t nonzero = 0xFFFFFFFFFFFFFFFFULL * (secp256k1_scalar_is_zero(a) == 0);\n    uint128_t t = (uint128_t)(~a->d[0]) + SECP256K1_N_0 + 1;\n    r->d[0] = t & nonzero; t >>= 64;\n    t += (uint128_t)(~a->d[1]) + SECP256K1_N_1;\n    r->d[1] = t & nonzero; t >>= 64;\n    t += (uint128_t)(~a->d[2]) + SECP256K1_N_2;\n    r->d[2] = t & nonzero; t >>= 64;\n    t += (uint128_t)(~a->d[3]) + SECP256K1_N_3;\n    r->d[3] = t & nonzero;\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_is_one(const secp256k1_scalar *a) {\n    return ((a->d[0] ^ 1) | a->d[1] | a->d[2] | a->d[3]) == 0;\n}\n\nstatic int secp256k1_scalar_is_high(const secp256k1_scalar *a) {\n    int yes = 0;\n    int no = 0;\n    no |= (a->d[3] < SECP256K1_N_H_3);\n    yes |= (a->d[3] > SECP256K1_N_H_3) & ~no;\n    no |= (a->d[2] < SECP256K1_N_H_2) & ~yes; /* No need for a > check. */\n    no |= (a->d[1] < SECP256K1_N_H_1) & ~yes;\n    yes |= (a->d[1] > SECP256K1_N_H_1) & ~no;\n    yes |= (a->d[0] > SECP256K1_N_H_0) & ~no;\n    return yes;\n}\n\nstatic int secp256k1_scalar_cond_negate(secp256k1_scalar *r, int flag) {\n    /* If we are flag = 0, mask = 00...00 and this is a no-op;\n     * if we are flag = 1, mask = 11...11 and this is identical to secp256k1_scalar_negate */\n    uint64_t mask = !flag - 1;\n    uint64_t nonzero = (secp256k1_scalar_is_zero(r) != 0) - 1;\n    uint128_t t = (uint128_t)(r->d[0] ^ mask) + ((SECP256K1_N_0 + 1) & mask);\n    r->d[0] = t & nonzero; t >>= 64;\n    t += (uint128_t)(r->d[1] ^ mask) + (SECP256K1_N_1 & mask);\n    r->d[1] = t & nonzero; t >>= 64;\n    t += (uint128_t)(r->d[2] ^ mask) + (SECP256K1_N_2 & mask);\n    r->d[2] = t & nonzero; t >>= 64;\n    t += (uint128_t)(r->d[3] ^ mask) + (SECP256K1_N_3 & mask);\n    r->d[3] = t & nonzero;\n    return 2 * (mask == 0) - 1;\n}\n\n/* Inspired by the macros in OpenSSL's crypto/bn/asm/x86_64-gcc.c. */\n\n/** Add a*b to the number defined by (c0,c1,c2). c2 must never overflow. */\n#define muladd(a,b) { \\\n    uint64_t tl, th; \\\n    { \\\n        uint128_t t = (uint128_t)a * b; \\\n        th = t >> 64;         /* at most 0xFFFFFFFFFFFFFFFE */ \\\n        tl = t; \\\n    } \\\n    c0 += tl;                 /* overflow is handled on the next line */ \\\n    th += (c0 < tl) ? 1 : 0;  /* at most 0xFFFFFFFFFFFFFFFF */ \\\n    c1 += th;                 /* overflow is handled on the next line */ \\\n    c2 += (c1 < th) ? 1 : 0;  /* never overflows by contract (verified in the next line) */ \\\n    VERIFY_CHECK((c1 >= th) || (c2 != 0)); \\\n}\n\n/** Add a*b to the number defined by (c0,c1). c1 must never overflow. */\n#define muladd_fast(a,b) { \\\n    uint64_t tl, th; \\\n    { \\\n        uint128_t t = (uint128_t)a * b; \\\n        th = t >> 64;         /* at most 0xFFFFFFFFFFFFFFFE */ \\\n        tl = t; \\\n    } \\\n    c0 += tl;                 /* overflow is handled on the next line */ \\\n    th += (c0 < tl) ? 1 : 0;  /* at most 0xFFFFFFFFFFFFFFFF */ \\\n    c1 += th;                 /* never overflows by contract (verified in the next line) */ \\\n    VERIFY_CHECK(c1 >= th); \\\n}\n\n/** Add 2*a*b to the number defined by (c0,c1,c2). c2 must never overflow. */\n#define muladd2(a,b) { \\\n    uint64_t tl, th, th2, tl2; \\\n    { \\\n        uint128_t t = (uint128_t)a * b; \\\n        th = t >> 64;               /* at most 0xFFFFFFFFFFFFFFFE */ \\\n        tl = t; \\\n    } \\\n    th2 = th + th;                  /* at most 0xFFFFFFFFFFFFFFFE (in case th was 0x7FFFFFFFFFFFFFFF) */ \\\n    c2 += (th2 < th) ? 1 : 0;       /* never overflows by contract (verified the next line) */ \\\n    VERIFY_CHECK((th2 >= th) || (c2 != 0)); \\\n    tl2 = tl + tl;                  /* at most 0xFFFFFFFFFFFFFFFE (in case the lowest 63 bits of tl were 0x7FFFFFFFFFFFFFFF) */ \\\n    th2 += (tl2 < tl) ? 1 : 0;      /* at most 0xFFFFFFFFFFFFFFFF */ \\\n    c0 += tl2;                      /* overflow is handled on the next line */ \\\n    th2 += (c0 < tl2) ? 1 : 0;      /* second overflow is handled on the next line */ \\\n    c2 += (c0 < tl2) & (th2 == 0);  /* never overflows by contract (verified the next line) */ \\\n    VERIFY_CHECK((c0 >= tl2) || (th2 != 0) || (c2 != 0)); \\\n    c1 += th2;                      /* overflow is handled on the next line */ \\\n    c2 += (c1 < th2) ? 1 : 0;       /* never overflows by contract (verified the next line) */ \\\n    VERIFY_CHECK((c1 >= th2) || (c2 != 0)); \\\n}\n\n/** Add a to the number defined by (c0,c1,c2). c2 must never overflow. */\n#define sumadd(a) { \\\n    unsigned int over; \\\n    c0 += (a);                  /* overflow is handled on the next line */ \\\n    over = (c0 < (a)) ? 1 : 0; \\\n    c1 += over;                 /* overflow is handled on the next line */ \\\n    c2 += (c1 < over) ? 1 : 0;  /* never overflows by contract */ \\\n}\n\n/** Add a to the number defined by (c0,c1). c1 must never overflow, c2 must be zero. */\n#define sumadd_fast(a) { \\\n    c0 += (a);                 /* overflow is handled on the next line */ \\\n    c1 += (c0 < (a)) ? 1 : 0;  /* never overflows by contract (verified the next line) */ \\\n    VERIFY_CHECK((c1 != 0) | (c0 >= (a))); \\\n    VERIFY_CHECK(c2 == 0); \\\n}\n\n/** Extract the lowest 64 bits of (c0,c1,c2) into n, and left shift the number 64 bits. */\n#define extract(n) { \\\n    (n) = c0; \\\n    c0 = c1; \\\n    c1 = c2; \\\n    c2 = 0; \\\n}\n\n/** Extract the lowest 64 bits of (c0,c1,c2) into n, and left shift the number 64 bits. c2 is required to be zero. */\n#define extract_fast(n) { \\\n    (n) = c0; \\\n    c0 = c1; \\\n    c1 = 0; \\\n    VERIFY_CHECK(c2 == 0); \\\n}\n\nstatic void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint64_t *l) {\n#ifdef USE_ASM_X86_64\n    /* Reduce 512 bits into 385. */\n    uint64_t m0, m1, m2, m3, m4, m5, m6;\n    uint64_t p0, p1, p2, p3, p4;\n    uint64_t c;\n\n    __asm__ __volatile__(\n    /* Preload. */\n    \"movq 32(%%rsi), %%r11\\n\"\n    \"movq 40(%%rsi), %%r12\\n\"\n    \"movq 48(%%rsi), %%r13\\n\"\n    \"movq 56(%%rsi), %%r14\\n\"\n    /* Initialize r8,r9,r10 */\n    \"movq 0(%%rsi), %%r8\\n\"\n    \"xorq %%r9, %%r9\\n\"\n    \"xorq %%r10, %%r10\\n\"\n    /* (r8,r9) += n0 * c0 */\n    \"movq %8, %%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    /* extract m0 */\n    \"movq %%r8, %q0\\n\"\n    \"xorq %%r8, %%r8\\n\"\n    /* (r9,r10) += l1 */\n    \"addq 8(%%rsi), %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* (r9,r10,r8) += n1 * c0 */\n    \"movq %8, %%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* (r9,r10,r8) += n0 * c1 */\n    \"movq %9, %%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* extract m1 */\n    \"movq %%r9, %q1\\n\"\n    \"xorq %%r9, %%r9\\n\"\n    /* (r10,r8,r9) += l2 */\n    \"addq 16(%%rsi), %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r10,r8,r9) += n2 * c0 */\n    \"movq %8, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r10,r8,r9) += n1 * c1 */\n    \"movq %9, %%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r10,r8,r9) += n0 */\n    \"addq %%r11, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* extract m2 */\n    \"movq %%r10, %q2\\n\"\n    \"xorq %%r10, %%r10\\n\"\n    /* (r8,r9,r10) += l3 */\n    \"addq 24(%%rsi), %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* (r8,r9,r10) += n3 * c0 */\n    \"movq %8, %%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* (r8,r9,r10) += n2 * c1 */\n    \"movq %9, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* (r8,r9,r10) += n1 */\n    \"addq %%r12, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* extract m3 */\n    \"movq %%r8, %q3\\n\"\n    \"xorq %%r8, %%r8\\n\"\n    /* (r9,r10,r8) += n3 * c1 */\n    \"movq %9, %%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* (r9,r10,r8) += n2 */\n    \"addq %%r13, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* extract m4 */\n    \"movq %%r9, %q4\\n\"\n    /* (r10,r8) += n3 */\n    \"addq %%r14, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* extract m5 */\n    \"movq %%r10, %q5\\n\"\n    /* extract m6 */\n    \"movq %%r8, %q6\\n\"\n    : \"=g\"(m0), \"=g\"(m1), \"=g\"(m2), \"=g\"(m3), \"=g\"(m4), \"=g\"(m5), \"=g\"(m6)\n    : \"S\"(l), \"n\"(SECP256K1_N_C_0), \"n\"(SECP256K1_N_C_1)\n    : \"rax\", \"rdx\", \"r8\", \"r9\", \"r10\", \"r11\", \"r12\", \"r13\", \"r14\", \"cc\");\n\n    /* Reduce 385 bits into 258. */\n    __asm__ __volatile__(\n    /* Preload */\n    \"movq %q9, %%r11\\n\"\n    \"movq %q10, %%r12\\n\"\n    \"movq %q11, %%r13\\n\"\n    /* Initialize (r8,r9,r10) */\n    \"movq %q5, %%r8\\n\"\n    \"xorq %%r9, %%r9\\n\"\n    \"xorq %%r10, %%r10\\n\"\n    /* (r8,r9) += m4 * c0 */\n    \"movq %12, %%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    /* extract p0 */\n    \"movq %%r8, %q0\\n\"\n    \"xorq %%r8, %%r8\\n\"\n    /* (r9,r10) += m1 */\n    \"addq %q6, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* (r9,r10,r8) += m5 * c0 */\n    \"movq %12, %%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* (r9,r10,r8) += m4 * c1 */\n    \"movq %13, %%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* extract p1 */\n    \"movq %%r9, %q1\\n\"\n    \"xorq %%r9, %%r9\\n\"\n    /* (r10,r8,r9) += m2 */\n    \"addq %q7, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r10,r8,r9) += m6 * c0 */\n    \"movq %12, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r10,r8,r9) += m5 * c1 */\n    \"movq %13, %%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r10,r8,r9) += m4 */\n    \"addq %%r11, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* extract p2 */\n    \"movq %%r10, %q2\\n\"\n    /* (r8,r9) += m3 */\n    \"addq %q8, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r8,r9) += m6 * c1 */\n    \"movq %13, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    /* (r8,r9) += m5 */\n    \"addq %%r12, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* extract p3 */\n    \"movq %%r8, %q3\\n\"\n    /* (r9) += m6 */\n    \"addq %%r13, %%r9\\n\"\n    /* extract p4 */\n    \"movq %%r9, %q4\\n\"\n    : \"=&g\"(p0), \"=&g\"(p1), \"=&g\"(p2), \"=g\"(p3), \"=g\"(p4)\n    : \"g\"(m0), \"g\"(m1), \"g\"(m2), \"g\"(m3), \"g\"(m4), \"g\"(m5), \"g\"(m6), \"n\"(SECP256K1_N_C_0), \"n\"(SECP256K1_N_C_1)\n    : \"rax\", \"rdx\", \"r8\", \"r9\", \"r10\", \"r11\", \"r12\", \"r13\", \"cc\");\n\n    /* Reduce 258 bits into 256. */\n    __asm__ __volatile__(\n    /* Preload */\n    \"movq %q5, %%r10\\n\"\n    /* (rax,rdx) = p4 * c0 */\n    \"movq %7, %%rax\\n\"\n    \"mulq %%r10\\n\"\n    /* (rax,rdx) += p0 */\n    \"addq %q1, %%rax\\n\"\n    \"adcq $0, %%rdx\\n\"\n    /* extract r0 */\n    \"movq %%rax, 0(%q6)\\n\"\n    /* Move to (r8,r9) */\n    \"movq %%rdx, %%r8\\n\"\n    \"xorq %%r9, %%r9\\n\"\n    /* (r8,r9) += p1 */\n    \"addq %q2, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r8,r9) += p4 * c1 */\n    \"movq %8, %%rax\\n\"\n    \"mulq %%r10\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    /* Extract r1 */\n    \"movq %%r8, 8(%q6)\\n\"\n    \"xorq %%r8, %%r8\\n\"\n    /* (r9,r8) += p4 */\n    \"addq %%r10, %%r9\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* (r9,r8) += p2 */\n    \"addq %q3, %%r9\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* Extract r2 */\n    \"movq %%r9, 16(%q6)\\n\"\n    \"xorq %%r9, %%r9\\n\"\n    /* (r8,r9) += p3 */\n    \"addq %q4, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* Extract r3 */\n    \"movq %%r8, 24(%q6)\\n\"\n    /* Extract c */\n    \"movq %%r9, %q0\\n\"\n    : \"=g\"(c)\n    : \"g\"(p0), \"g\"(p1), \"g\"(p2), \"g\"(p3), \"g\"(p4), \"D\"(r), \"n\"(SECP256K1_N_C_0), \"n\"(SECP256K1_N_C_1)\n    : \"rax\", \"rdx\", \"r8\", \"r9\", \"r10\", \"cc\", \"memory\");\n#else\n    uint128_t c;\n    uint64_t c0, c1, c2;\n    uint64_t n0 = l[4], n1 = l[5], n2 = l[6], n3 = l[7];\n    uint64_t m0, m1, m2, m3, m4, m5;\n    uint32_t m6;\n    uint64_t p0, p1, p2, p3;\n    uint32_t p4;\n\n    /* Reduce 512 bits into 385. */\n    /* m[0..6] = l[0..3] + n[0..3] * SECP256K1_N_C. */\n    c0 = l[0]; c1 = 0; c2 = 0;\n    muladd_fast(n0, SECP256K1_N_C_0);\n    extract_fast(m0);\n    sumadd_fast(l[1]);\n    muladd(n1, SECP256K1_N_C_0);\n    muladd(n0, SECP256K1_N_C_1);\n    extract(m1);\n    sumadd(l[2]);\n    muladd(n2, SECP256K1_N_C_0);\n    muladd(n1, SECP256K1_N_C_1);\n    sumadd(n0);\n    extract(m2);\n    sumadd(l[3]);\n    muladd(n3, SECP256K1_N_C_0);\n    muladd(n2, SECP256K1_N_C_1);\n    sumadd(n1);\n    extract(m3);\n    muladd(n3, SECP256K1_N_C_1);\n    sumadd(n2);\n    extract(m4);\n    sumadd_fast(n3);\n    extract_fast(m5);\n    VERIFY_CHECK(c0 <= 1);\n    m6 = c0;\n\n    /* Reduce 385 bits into 258. */\n    /* p[0..4] = m[0..3] + m[4..6] * SECP256K1_N_C. */\n    c0 = m0; c1 = 0; c2 = 0;\n    muladd_fast(m4, SECP256K1_N_C_0);\n    extract_fast(p0);\n    sumadd_fast(m1);\n    muladd(m5, SECP256K1_N_C_0);\n    muladd(m4, SECP256K1_N_C_1);\n    extract(p1);\n    sumadd(m2);\n    muladd(m6, SECP256K1_N_C_0);\n    muladd(m5, SECP256K1_N_C_1);\n    sumadd(m4);\n    extract(p2);\n    sumadd_fast(m3);\n    muladd_fast(m6, SECP256K1_N_C_1);\n    sumadd_fast(m5);\n    extract_fast(p3);\n    p4 = c0 + m6;\n    VERIFY_CHECK(p4 <= 2);\n\n    /* Reduce 258 bits into 256. */\n    /* r[0..3] = p[0..3] + p[4] * SECP256K1_N_C. */\n    c = p0 + (uint128_t)SECP256K1_N_C_0 * p4;\n    r->d[0] = c & 0xFFFFFFFFFFFFFFFFULL; c >>= 64;\n    c += p1 + (uint128_t)SECP256K1_N_C_1 * p4;\n    r->d[1] = c & 0xFFFFFFFFFFFFFFFFULL; c >>= 64;\n    c += p2 + (uint128_t)p4;\n    r->d[2] = c & 0xFFFFFFFFFFFFFFFFULL; c >>= 64;\n    c += p3;\n    r->d[3] = c & 0xFFFFFFFFFFFFFFFFULL; c >>= 64;\n#endif\n\n    /* Final reduction of r. */\n    secp256k1_scalar_reduce(r, c + secp256k1_scalar_check_overflow(r));\n}\n\nstatic void secp256k1_scalar_mul_512(uint64_t l[8], const secp256k1_scalar *a, const secp256k1_scalar *b) {\n#ifdef USE_ASM_X86_64\n    const uint64_t *pb = b->d;\n    __asm__ __volatile__(\n    /* Preload */\n    \"movq 0(%%rdi), %%r15\\n\"\n    \"movq 8(%%rdi), %%rbx\\n\"\n    \"movq 16(%%rdi), %%rcx\\n\"\n    \"movq 0(%%rdx), %%r11\\n\"\n    \"movq 8(%%rdx), %%r12\\n\"\n    \"movq 16(%%rdx), %%r13\\n\"\n    \"movq 24(%%rdx), %%r14\\n\"\n    /* (rax,rdx) = a0 * b0 */\n    \"movq %%r15, %%rax\\n\"\n    \"mulq %%r11\\n\"\n    /* Extract l0 */\n    \"movq %%rax, 0(%%rsi)\\n\"\n    /* (r8,r9,r10) = (rdx) */\n    \"movq %%rdx, %%r8\\n\"\n    \"xorq %%r9, %%r9\\n\"\n    \"xorq %%r10, %%r10\\n\"\n    /* (r8,r9,r10) += a0 * b1 */\n    \"movq %%r15, %%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* (r8,r9,r10) += a1 * b0 */\n    \"movq %%rbx, %%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* Extract l1 */\n    \"movq %%r8, 8(%%rsi)\\n\"\n    \"xorq %%r8, %%r8\\n\"\n    /* (r9,r10,r8) += a0 * b2 */\n    \"movq %%r15, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* (r9,r10,r8) += a1 * b1 */\n    \"movq %%rbx, %%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* (r9,r10,r8) += a2 * b0 */\n    \"movq %%rcx, %%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* Extract l2 */\n    \"movq %%r9, 16(%%rsi)\\n\"\n    \"xorq %%r9, %%r9\\n\"\n    /* (r10,r8,r9) += a0 * b3 */\n    \"movq %%r15, %%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* Preload a3 */\n    \"movq 24(%%rdi), %%r15\\n\"\n    /* (r10,r8,r9) += a1 * b2 */\n    \"movq %%rbx, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r10,r8,r9) += a2 * b1 */\n    \"movq %%rcx, %%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r10,r8,r9) += a3 * b0 */\n    \"movq %%r15, %%rax\\n\"\n    \"mulq %%r11\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* Extract l3 */\n    \"movq %%r10, 24(%%rsi)\\n\"\n    \"xorq %%r10, %%r10\\n\"\n    /* (r8,r9,r10) += a1 * b3 */\n    \"movq %%rbx, %%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* (r8,r9,r10) += a2 * b2 */\n    \"movq %%rcx, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* (r8,r9,r10) += a3 * b1 */\n    \"movq %%r15, %%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* Extract l4 */\n    \"movq %%r8, 32(%%rsi)\\n\"\n    \"xorq %%r8, %%r8\\n\"\n    /* (r9,r10,r8) += a2 * b3 */\n    \"movq %%rcx, %%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* (r9,r10,r8) += a3 * b2 */\n    \"movq %%r15, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* Extract l5 */\n    \"movq %%r9, 40(%%rsi)\\n\"\n    /* (r10,r8) += a3 * b3 */\n    \"movq %%r15, %%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    /* Extract l6 */\n    \"movq %%r10, 48(%%rsi)\\n\"\n    /* Extract l7 */\n    \"movq %%r8, 56(%%rsi)\\n\"\n    : \"+d\"(pb)\n    : \"S\"(l), \"D\"(a->d)\n    : \"rax\", \"rbx\", \"rcx\", \"r8\", \"r9\", \"r10\", \"r11\", \"r12\", \"r13\", \"r14\", \"r15\", \"cc\", \"memory\");\n#else\n    /* 160 bit accumulator. */\n    uint64_t c0 = 0, c1 = 0;\n    uint32_t c2 = 0;\n\n    /* l[0..7] = a[0..3] * b[0..3]. */\n    muladd_fast(a->d[0], b->d[0]);\n    extract_fast(l[0]);\n    muladd(a->d[0], b->d[1]);\n    muladd(a->d[1], b->d[0]);\n    extract(l[1]);\n    muladd(a->d[0], b->d[2]);\n    muladd(a->d[1], b->d[1]);\n    muladd(a->d[2], b->d[0]);\n    extract(l[2]);\n    muladd(a->d[0], b->d[3]);\n    muladd(a->d[1], b->d[2]);\n    muladd(a->d[2], b->d[1]);\n    muladd(a->d[3], b->d[0]);\n    extract(l[3]);\n    muladd(a->d[1], b->d[3]);\n    muladd(a->d[2], b->d[2]);\n    muladd(a->d[3], b->d[1]);\n    extract(l[4]);\n    muladd(a->d[2], b->d[3]);\n    muladd(a->d[3], b->d[2]);\n    extract(l[5]);\n    muladd_fast(a->d[3], b->d[3]);\n    extract_fast(l[6]);\n    VERIFY_CHECK(c1 == 0);\n    l[7] = c0;\n#endif\n}\n\nstatic void secp256k1_scalar_sqr_512(uint64_t l[8], const secp256k1_scalar *a) {\n#ifdef USE_ASM_X86_64\n    __asm__ __volatile__(\n    /* Preload */\n    \"movq 0(%%rdi), %%r11\\n\"\n    \"movq 8(%%rdi), %%r12\\n\"\n    \"movq 16(%%rdi), %%r13\\n\"\n    \"movq 24(%%rdi), %%r14\\n\"\n    /* (rax,rdx) = a0 * a0 */\n    \"movq %%r11, %%rax\\n\"\n    \"mulq %%r11\\n\"\n    /* Extract l0 */\n    \"movq %%rax, 0(%%rsi)\\n\"\n    /* (r8,r9,r10) = (rdx,0) */\n    \"movq %%rdx, %%r8\\n\"\n    \"xorq %%r9, %%r9\\n\"\n    \"xorq %%r10, %%r10\\n\"\n    /* (r8,r9,r10) += 2 * a0 * a1 */\n    \"movq %%r11, %%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* Extract l1 */\n    \"movq %%r8, 8(%%rsi)\\n\"\n    \"xorq %%r8, %%r8\\n\"\n    /* (r9,r10,r8) += 2 * a0 * a2 */\n    \"movq %%r11, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* (r9,r10,r8) += a1 * a1 */\n    \"movq %%r12, %%rax\\n\"\n    \"mulq %%r12\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* Extract l2 */\n    \"movq %%r9, 16(%%rsi)\\n\"\n    \"xorq %%r9, %%r9\\n\"\n    /* (r10,r8,r9) += 2 * a0 * a3 */\n    \"movq %%r11, %%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* (r10,r8,r9) += 2 * a1 * a2 */\n    \"movq %%r12, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    \"adcq $0, %%r9\\n\"\n    /* Extract l3 */\n    \"movq %%r10, 24(%%rsi)\\n\"\n    \"xorq %%r10, %%r10\\n\"\n    /* (r8,r9,r10) += 2 * a1 * a3 */\n    \"movq %%r12, %%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* (r8,r9,r10) += a2 * a2 */\n    \"movq %%r13, %%rax\\n\"\n    \"mulq %%r13\\n\"\n    \"addq %%rax, %%r8\\n\"\n    \"adcq %%rdx, %%r9\\n\"\n    \"adcq $0, %%r10\\n\"\n    /* Extract l4 */\n    \"movq %%r8, 32(%%rsi)\\n\"\n    \"xorq %%r8, %%r8\\n\"\n    /* (r9,r10,r8) += 2 * a2 * a3 */\n    \"movq %%r13, %%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    \"addq %%rax, %%r9\\n\"\n    \"adcq %%rdx, %%r10\\n\"\n    \"adcq $0, %%r8\\n\"\n    /* Extract l5 */\n    \"movq %%r9, 40(%%rsi)\\n\"\n    /* (r10,r8) += a3 * a3 */\n    \"movq %%r14, %%rax\\n\"\n    \"mulq %%r14\\n\"\n    \"addq %%rax, %%r10\\n\"\n    \"adcq %%rdx, %%r8\\n\"\n    /* Extract l6 */\n    \"movq %%r10, 48(%%rsi)\\n\"\n    /* Extract l7 */\n    \"movq %%r8, 56(%%rsi)\\n\"\n    :\n    : \"S\"(l), \"D\"(a->d)\n    : \"rax\", \"rdx\", \"r8\", \"r9\", \"r10\", \"r11\", \"r12\", \"r13\", \"r14\", \"cc\", \"memory\");\n#else\n    /* 160 bit accumulator. */\n    uint64_t c0 = 0, c1 = 0;\n    uint32_t c2 = 0;\n\n    /* l[0..7] = a[0..3] * b[0..3]. */\n    muladd_fast(a->d[0], a->d[0]);\n    extract_fast(l[0]);\n    muladd2(a->d[0], a->d[1]);\n    extract(l[1]);\n    muladd2(a->d[0], a->d[2]);\n    muladd(a->d[1], a->d[1]);\n    extract(l[2]);\n    muladd2(a->d[0], a->d[3]);\n    muladd2(a->d[1], a->d[2]);\n    extract(l[3]);\n    muladd2(a->d[1], a->d[3]);\n    muladd(a->d[2], a->d[2]);\n    extract(l[4]);\n    muladd2(a->d[2], a->d[3]);\n    extract(l[5]);\n    muladd_fast(a->d[3], a->d[3]);\n    extract_fast(l[6]);\n    VERIFY_CHECK(c1 == 0);\n    l[7] = c0;\n#endif\n}\n\n#undef sumadd\n#undef sumadd_fast\n#undef muladd\n#undef muladd_fast\n#undef muladd2\n#undef extract\n#undef extract_fast\n\nstatic void secp256k1_scalar_mul(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {\n    uint64_t l[8];\n    secp256k1_scalar_mul_512(l, a, b);\n    secp256k1_scalar_reduce_512(r, l);\n}\n\nstatic int secp256k1_scalar_shr_int(secp256k1_scalar *r, int n) {\n    int ret;\n    VERIFY_CHECK(n > 0);\n    VERIFY_CHECK(n < 16);\n    ret = r->d[0] & ((1 << n) - 1);\n    r->d[0] = (r->d[0] >> n) + (r->d[1] << (64 - n));\n    r->d[1] = (r->d[1] >> n) + (r->d[2] << (64 - n));\n    r->d[2] = (r->d[2] >> n) + (r->d[3] << (64 - n));\n    r->d[3] = (r->d[3] >> n);\n    return ret;\n}\n\nstatic void secp256k1_scalar_sqr(secp256k1_scalar *r, const secp256k1_scalar *a) {\n    uint64_t l[8];\n    secp256k1_scalar_sqr_512(l, a);\n    secp256k1_scalar_reduce_512(r, l);\n}\n\n#ifdef USE_ENDOMORPHISM\nstatic void secp256k1_scalar_split_128(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *a) {\n    r1->d[0] = a->d[0];\n    r1->d[1] = a->d[1];\n    r1->d[2] = 0;\n    r1->d[3] = 0;\n    r2->d[0] = a->d[2];\n    r2->d[1] = a->d[3];\n    r2->d[2] = 0;\n    r2->d[3] = 0;\n}\n#endif\n\nSECP256K1_INLINE static int secp256k1_scalar_eq(const secp256k1_scalar *a, const secp256k1_scalar *b) {\n    return ((a->d[0] ^ b->d[0]) | (a->d[1] ^ b->d[1]) | (a->d[2] ^ b->d[2]) | (a->d[3] ^ b->d[3])) == 0;\n}\n\nSECP256K1_INLINE static void secp256k1_scalar_mul_shift_var(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b, unsigned int shift) {\n    uint64_t l[8];\n    unsigned int shiftlimbs;\n    unsigned int shiftlow;\n    unsigned int shifthigh;\n    VERIFY_CHECK(shift >= 256);\n    secp256k1_scalar_mul_512(l, a, b);\n    shiftlimbs = shift >> 6;\n    shiftlow = shift & 0x3F;\n    shifthigh = 64 - shiftlow;\n    r->d[0] = shift < 512 ? (l[0 + shiftlimbs] >> shiftlow | (shift < 448 && shiftlow ? (l[1 + shiftlimbs] << shifthigh) : 0)) : 0;\n    r->d[1] = shift < 448 ? (l[1 + shiftlimbs] >> shiftlow | (shift < 384 && shiftlow ? (l[2 + shiftlimbs] << shifthigh) : 0)) : 0;\n    r->d[2] = shift < 384 ? (l[2 + shiftlimbs] >> shiftlow | (shift < 320 && shiftlow ? (l[3 + shiftlimbs] << shifthigh) : 0)) : 0;\n    r->d[3] = shift < 320 ? (l[3 + shiftlimbs] >> shiftlow) : 0;\n    secp256k1_scalar_cadd_bit(r, 0, (l[(shift - 1) >> 6] >> ((shift - 1) & 0x3f)) & 1);\n}\n\n#endif /* SECP256K1_SCALAR_REPR_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/scalar_8x32.h",
    "content": "/**********************************************************************\n * Copyright (c) 2014 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_SCALAR_REPR_H\n#define SECP256K1_SCALAR_REPR_H\n\n#include <stdint.h>\n\n/** A scalar modulo the group order of the secp256k1 curve. */\ntypedef struct {\n    uint32_t d[8];\n} secp256k1_scalar;\n\n#define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)}}\n\n#endif /* SECP256K1_SCALAR_REPR_H */\n"
  },
  {
    "path": "src/secp256k1/src/scalar_8x32_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2014 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_SCALAR_REPR_IMPL_H\n#define SECP256K1_SCALAR_REPR_IMPL_H\n\n/* Limbs of the secp256k1 order. */\n#define SECP256K1_N_0 ((uint32_t)0xD0364141UL)\n#define SECP256K1_N_1 ((uint32_t)0xBFD25E8CUL)\n#define SECP256K1_N_2 ((uint32_t)0xAF48A03BUL)\n#define SECP256K1_N_3 ((uint32_t)0xBAAEDCE6UL)\n#define SECP256K1_N_4 ((uint32_t)0xFFFFFFFEUL)\n#define SECP256K1_N_5 ((uint32_t)0xFFFFFFFFUL)\n#define SECP256K1_N_6 ((uint32_t)0xFFFFFFFFUL)\n#define SECP256K1_N_7 ((uint32_t)0xFFFFFFFFUL)\n\n/* Limbs of 2^256 minus the secp256k1 order. */\n#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)\n#define SECP256K1_N_C_1 (~SECP256K1_N_1)\n#define SECP256K1_N_C_2 (~SECP256K1_N_2)\n#define SECP256K1_N_C_3 (~SECP256K1_N_3)\n#define SECP256K1_N_C_4 (1)\n\n/* Limbs of half the secp256k1 order. */\n#define SECP256K1_N_H_0 ((uint32_t)0x681B20A0UL)\n#define SECP256K1_N_H_1 ((uint32_t)0xDFE92F46UL)\n#define SECP256K1_N_H_2 ((uint32_t)0x57A4501DUL)\n#define SECP256K1_N_H_3 ((uint32_t)0x5D576E73UL)\n#define SECP256K1_N_H_4 ((uint32_t)0xFFFFFFFFUL)\n#define SECP256K1_N_H_5 ((uint32_t)0xFFFFFFFFUL)\n#define SECP256K1_N_H_6 ((uint32_t)0xFFFFFFFFUL)\n#define SECP256K1_N_H_7 ((uint32_t)0x7FFFFFFFUL)\n\nSECP256K1_INLINE static void secp256k1_scalar_clear(secp256k1_scalar *r) {\n    r->d[0] = 0;\n    r->d[1] = 0;\n    r->d[2] = 0;\n    r->d[3] = 0;\n    r->d[4] = 0;\n    r->d[5] = 0;\n    r->d[6] = 0;\n    r->d[7] = 0;\n}\n\nSECP256K1_INLINE static void secp256k1_scalar_set_int(secp256k1_scalar *r, unsigned int v) {\n    r->d[0] = v;\n    r->d[1] = 0;\n    r->d[2] = 0;\n    r->d[3] = 0;\n    r->d[4] = 0;\n    r->d[5] = 0;\n    r->d[6] = 0;\n    r->d[7] = 0;\n}\n\nSECP256K1_INLINE static unsigned int secp256k1_scalar_get_bits(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {\n    VERIFY_CHECK((offset + count - 1) >> 5 == offset >> 5);\n    return (a->d[offset >> 5] >> (offset & 0x1F)) & ((1 << count) - 1);\n}\n\nSECP256K1_INLINE static unsigned int secp256k1_scalar_get_bits_var(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {\n    VERIFY_CHECK(count < 32);\n    VERIFY_CHECK(offset + count <= 256);\n    if ((offset + count - 1) >> 5 == offset >> 5) {\n        return secp256k1_scalar_get_bits(a, offset, count);\n    } else {\n        VERIFY_CHECK((offset >> 5) + 1 < 8);\n        return ((a->d[offset >> 5] >> (offset & 0x1F)) | (a->d[(offset >> 5) + 1] << (32 - (offset & 0x1F)))) & ((((uint32_t)1) << count) - 1);\n    }\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_check_overflow(const secp256k1_scalar *a) {\n    int yes = 0;\n    int no = 0;\n    no |= (a->d[7] < SECP256K1_N_7); /* No need for a > check. */\n    no |= (a->d[6] < SECP256K1_N_6); /* No need for a > check. */\n    no |= (a->d[5] < SECP256K1_N_5); /* No need for a > check. */\n    no |= (a->d[4] < SECP256K1_N_4);\n    yes |= (a->d[4] > SECP256K1_N_4) & ~no;\n    no |= (a->d[3] < SECP256K1_N_3) & ~yes;\n    yes |= (a->d[3] > SECP256K1_N_3) & ~no;\n    no |= (a->d[2] < SECP256K1_N_2) & ~yes;\n    yes |= (a->d[2] > SECP256K1_N_2) & ~no;\n    no |= (a->d[1] < SECP256K1_N_1) & ~yes;\n    yes |= (a->d[1] > SECP256K1_N_1) & ~no;\n    yes |= (a->d[0] >= SECP256K1_N_0) & ~no;\n    return yes;\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_reduce(secp256k1_scalar *r, uint32_t overflow) {\n    uint64_t t;\n    VERIFY_CHECK(overflow <= 1);\n    t = (uint64_t)r->d[0] + overflow * SECP256K1_N_C_0;\n    r->d[0] = t & 0xFFFFFFFFUL; t >>= 32;\n    t += (uint64_t)r->d[1] + overflow * SECP256K1_N_C_1;\n    r->d[1] = t & 0xFFFFFFFFUL; t >>= 32;\n    t += (uint64_t)r->d[2] + overflow * SECP256K1_N_C_2;\n    r->d[2] = t & 0xFFFFFFFFUL; t >>= 32;\n    t += (uint64_t)r->d[3] + overflow * SECP256K1_N_C_3;\n    r->d[3] = t & 0xFFFFFFFFUL; t >>= 32;\n    t += (uint64_t)r->d[4] + overflow * SECP256K1_N_C_4;\n    r->d[4] = t & 0xFFFFFFFFUL; t >>= 32;\n    t += (uint64_t)r->d[5];\n    r->d[5] = t & 0xFFFFFFFFUL; t >>= 32;\n    t += (uint64_t)r->d[6];\n    r->d[6] = t & 0xFFFFFFFFUL; t >>= 32;\n    t += (uint64_t)r->d[7];\n    r->d[7] = t & 0xFFFFFFFFUL;\n    return overflow;\n}\n\nstatic int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {\n    int overflow;\n    uint64_t t = (uint64_t)a->d[0] + b->d[0];\n    r->d[0] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)a->d[1] + b->d[1];\n    r->d[1] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)a->d[2] + b->d[2];\n    r->d[2] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)a->d[3] + b->d[3];\n    r->d[3] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)a->d[4] + b->d[4];\n    r->d[4] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)a->d[5] + b->d[5];\n    r->d[5] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)a->d[6] + b->d[6];\n    r->d[6] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)a->d[7] + b->d[7];\n    r->d[7] = t & 0xFFFFFFFFULL; t >>= 32;\n    overflow = t + secp256k1_scalar_check_overflow(r);\n    VERIFY_CHECK(overflow == 0 || overflow == 1);\n    secp256k1_scalar_reduce(r, overflow);\n    return overflow;\n}\n\nstatic void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int flag) {\n    uint64_t t;\n    VERIFY_CHECK(bit < 256);\n    bit += ((uint32_t) flag - 1) & 0x100;  /* forcing (bit >> 5) > 7 makes this a noop */\n    t = (uint64_t)r->d[0] + (((uint32_t)((bit >> 5) == 0)) << (bit & 0x1F));\n    r->d[0] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)r->d[1] + (((uint32_t)((bit >> 5) == 1)) << (bit & 0x1F));\n    r->d[1] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)r->d[2] + (((uint32_t)((bit >> 5) == 2)) << (bit & 0x1F));\n    r->d[2] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)r->d[3] + (((uint32_t)((bit >> 5) == 3)) << (bit & 0x1F));\n    r->d[3] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)r->d[4] + (((uint32_t)((bit >> 5) == 4)) << (bit & 0x1F));\n    r->d[4] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)r->d[5] + (((uint32_t)((bit >> 5) == 5)) << (bit & 0x1F));\n    r->d[5] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)r->d[6] + (((uint32_t)((bit >> 5) == 6)) << (bit & 0x1F));\n    r->d[6] = t & 0xFFFFFFFFULL; t >>= 32;\n    t += (uint64_t)r->d[7] + (((uint32_t)((bit >> 5) == 7)) << (bit & 0x1F));\n    r->d[7] = t & 0xFFFFFFFFULL;\n#ifdef VERIFY\n    VERIFY_CHECK((t >> 32) == 0);\n    VERIFY_CHECK(secp256k1_scalar_check_overflow(r) == 0);\n#endif\n}\n\nstatic void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *b32, int *overflow) {\n    int over;\n    r->d[0] = (uint32_t)b32[31] | (uint32_t)b32[30] << 8 | (uint32_t)b32[29] << 16 | (uint32_t)b32[28] << 24;\n    r->d[1] = (uint32_t)b32[27] | (uint32_t)b32[26] << 8 | (uint32_t)b32[25] << 16 | (uint32_t)b32[24] << 24;\n    r->d[2] = (uint32_t)b32[23] | (uint32_t)b32[22] << 8 | (uint32_t)b32[21] << 16 | (uint32_t)b32[20] << 24;\n    r->d[3] = (uint32_t)b32[19] | (uint32_t)b32[18] << 8 | (uint32_t)b32[17] << 16 | (uint32_t)b32[16] << 24;\n    r->d[4] = (uint32_t)b32[15] | (uint32_t)b32[14] << 8 | (uint32_t)b32[13] << 16 | (uint32_t)b32[12] << 24;\n    r->d[5] = (uint32_t)b32[11] | (uint32_t)b32[10] << 8 | (uint32_t)b32[9] << 16 | (uint32_t)b32[8] << 24;\n    r->d[6] = (uint32_t)b32[7] | (uint32_t)b32[6] << 8 | (uint32_t)b32[5] << 16 | (uint32_t)b32[4] << 24;\n    r->d[7] = (uint32_t)b32[3] | (uint32_t)b32[2] << 8 | (uint32_t)b32[1] << 16 | (uint32_t)b32[0] << 24;\n    over = secp256k1_scalar_reduce(r, secp256k1_scalar_check_overflow(r));\n    if (overflow) {\n        *overflow = over;\n    }\n}\n\nstatic void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar* a) {\n    bin[0] = a->d[7] >> 24; bin[1] = a->d[7] >> 16; bin[2] = a->d[7] >> 8; bin[3] = a->d[7];\n    bin[4] = a->d[6] >> 24; bin[5] = a->d[6] >> 16; bin[6] = a->d[6] >> 8; bin[7] = a->d[6];\n    bin[8] = a->d[5] >> 24; bin[9] = a->d[5] >> 16; bin[10] = a->d[5] >> 8; bin[11] = a->d[5];\n    bin[12] = a->d[4] >> 24; bin[13] = a->d[4] >> 16; bin[14] = a->d[4] >> 8; bin[15] = a->d[4];\n    bin[16] = a->d[3] >> 24; bin[17] = a->d[3] >> 16; bin[18] = a->d[3] >> 8; bin[19] = a->d[3];\n    bin[20] = a->d[2] >> 24; bin[21] = a->d[2] >> 16; bin[22] = a->d[2] >> 8; bin[23] = a->d[2];\n    bin[24] = a->d[1] >> 24; bin[25] = a->d[1] >> 16; bin[26] = a->d[1] >> 8; bin[27] = a->d[1];\n    bin[28] = a->d[0] >> 24; bin[29] = a->d[0] >> 16; bin[30] = a->d[0] >> 8; bin[31] = a->d[0];\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_is_zero(const secp256k1_scalar *a) {\n    return (a->d[0] | a->d[1] | a->d[2] | a->d[3] | a->d[4] | a->d[5] | a->d[6] | a->d[7]) == 0;\n}\n\nstatic void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a) {\n    uint32_t nonzero = 0xFFFFFFFFUL * (secp256k1_scalar_is_zero(a) == 0);\n    uint64_t t = (uint64_t)(~a->d[0]) + SECP256K1_N_0 + 1;\n    r->d[0] = t & nonzero; t >>= 32;\n    t += (uint64_t)(~a->d[1]) + SECP256K1_N_1;\n    r->d[1] = t & nonzero; t >>= 32;\n    t += (uint64_t)(~a->d[2]) + SECP256K1_N_2;\n    r->d[2] = t & nonzero; t >>= 32;\n    t += (uint64_t)(~a->d[3]) + SECP256K1_N_3;\n    r->d[3] = t & nonzero; t >>= 32;\n    t += (uint64_t)(~a->d[4]) + SECP256K1_N_4;\n    r->d[4] = t & nonzero; t >>= 32;\n    t += (uint64_t)(~a->d[5]) + SECP256K1_N_5;\n    r->d[5] = t & nonzero; t >>= 32;\n    t += (uint64_t)(~a->d[6]) + SECP256K1_N_6;\n    r->d[6] = t & nonzero; t >>= 32;\n    t += (uint64_t)(~a->d[7]) + SECP256K1_N_7;\n    r->d[7] = t & nonzero;\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_is_one(const secp256k1_scalar *a) {\n    return ((a->d[0] ^ 1) | a->d[1] | a->d[2] | a->d[3] | a->d[4] | a->d[5] | a->d[6] | a->d[7]) == 0;\n}\n\nstatic int secp256k1_scalar_is_high(const secp256k1_scalar *a) {\n    int yes = 0;\n    int no = 0;\n    no |= (a->d[7] < SECP256K1_N_H_7);\n    yes |= (a->d[7] > SECP256K1_N_H_7) & ~no;\n    no |= (a->d[6] < SECP256K1_N_H_6) & ~yes; /* No need for a > check. */\n    no |= (a->d[5] < SECP256K1_N_H_5) & ~yes; /* No need for a > check. */\n    no |= (a->d[4] < SECP256K1_N_H_4) & ~yes; /* No need for a > check. */\n    no |= (a->d[3] < SECP256K1_N_H_3) & ~yes;\n    yes |= (a->d[3] > SECP256K1_N_H_3) & ~no;\n    no |= (a->d[2] < SECP256K1_N_H_2) & ~yes;\n    yes |= (a->d[2] > SECP256K1_N_H_2) & ~no;\n    no |= (a->d[1] < SECP256K1_N_H_1) & ~yes;\n    yes |= (a->d[1] > SECP256K1_N_H_1) & ~no;\n    yes |= (a->d[0] > SECP256K1_N_H_0) & ~no;\n    return yes;\n}\n\nstatic int secp256k1_scalar_cond_negate(secp256k1_scalar *r, int flag) {\n    /* If we are flag = 0, mask = 00...00 and this is a no-op;\n     * if we are flag = 1, mask = 11...11 and this is identical to secp256k1_scalar_negate */\n    uint32_t mask = !flag - 1;\n    uint32_t nonzero = 0xFFFFFFFFUL * (secp256k1_scalar_is_zero(r) == 0);\n    uint64_t t = (uint64_t)(r->d[0] ^ mask) + ((SECP256K1_N_0 + 1) & mask);\n    r->d[0] = t & nonzero; t >>= 32;\n    t += (uint64_t)(r->d[1] ^ mask) + (SECP256K1_N_1 & mask);\n    r->d[1] = t & nonzero; t >>= 32;\n    t += (uint64_t)(r->d[2] ^ mask) + (SECP256K1_N_2 & mask);\n    r->d[2] = t & nonzero; t >>= 32;\n    t += (uint64_t)(r->d[3] ^ mask) + (SECP256K1_N_3 & mask);\n    r->d[3] = t & nonzero; t >>= 32;\n    t += (uint64_t)(r->d[4] ^ mask) + (SECP256K1_N_4 & mask);\n    r->d[4] = t & nonzero; t >>= 32;\n    t += (uint64_t)(r->d[5] ^ mask) + (SECP256K1_N_5 & mask);\n    r->d[5] = t & nonzero; t >>= 32;\n    t += (uint64_t)(r->d[6] ^ mask) + (SECP256K1_N_6 & mask);\n    r->d[6] = t & nonzero; t >>= 32;\n    t += (uint64_t)(r->d[7] ^ mask) + (SECP256K1_N_7 & mask);\n    r->d[7] = t & nonzero;\n    return 2 * (mask == 0) - 1;\n}\n\n\n/* Inspired by the macros in OpenSSL's crypto/bn/asm/x86_64-gcc.c. */\n\n/** Add a*b to the number defined by (c0,c1,c2). c2 must never overflow. */\n#define muladd(a,b) { \\\n    uint32_t tl, th; \\\n    { \\\n        uint64_t t = (uint64_t)a * b; \\\n        th = t >> 32;         /* at most 0xFFFFFFFE */ \\\n        tl = t; \\\n    } \\\n    c0 += tl;                 /* overflow is handled on the next line */ \\\n    th += (c0 < tl) ? 1 : 0;  /* at most 0xFFFFFFFF */ \\\n    c1 += th;                 /* overflow is handled on the next line */ \\\n    c2 += (c1 < th) ? 1 : 0;  /* never overflows by contract (verified in the next line) */ \\\n    VERIFY_CHECK((c1 >= th) || (c2 != 0)); \\\n}\n\n/** Add a*b to the number defined by (c0,c1). c1 must never overflow. */\n#define muladd_fast(a,b) { \\\n    uint32_t tl, th; \\\n    { \\\n        uint64_t t = (uint64_t)a * b; \\\n        th = t >> 32;         /* at most 0xFFFFFFFE */ \\\n        tl = t; \\\n    } \\\n    c0 += tl;                 /* overflow is handled on the next line */ \\\n    th += (c0 < tl) ? 1 : 0;  /* at most 0xFFFFFFFF */ \\\n    c1 += th;                 /* never overflows by contract (verified in the next line) */ \\\n    VERIFY_CHECK(c1 >= th); \\\n}\n\n/** Add 2*a*b to the number defined by (c0,c1,c2). c2 must never overflow. */\n#define muladd2(a,b) { \\\n    uint32_t tl, th, th2, tl2; \\\n    { \\\n        uint64_t t = (uint64_t)a * b; \\\n        th = t >> 32;               /* at most 0xFFFFFFFE */ \\\n        tl = t; \\\n    } \\\n    th2 = th + th;                  /* at most 0xFFFFFFFE (in case th was 0x7FFFFFFF) */ \\\n    c2 += (th2 < th) ? 1 : 0;       /* never overflows by contract (verified the next line) */ \\\n    VERIFY_CHECK((th2 >= th) || (c2 != 0)); \\\n    tl2 = tl + tl;                  /* at most 0xFFFFFFFE (in case the lowest 63 bits of tl were 0x7FFFFFFF) */ \\\n    th2 += (tl2 < tl) ? 1 : 0;      /* at most 0xFFFFFFFF */ \\\n    c0 += tl2;                      /* overflow is handled on the next line */ \\\n    th2 += (c0 < tl2) ? 1 : 0;      /* second overflow is handled on the next line */ \\\n    c2 += (c0 < tl2) & (th2 == 0);  /* never overflows by contract (verified the next line) */ \\\n    VERIFY_CHECK((c0 >= tl2) || (th2 != 0) || (c2 != 0)); \\\n    c1 += th2;                      /* overflow is handled on the next line */ \\\n    c2 += (c1 < th2) ? 1 : 0;       /* never overflows by contract (verified the next line) */ \\\n    VERIFY_CHECK((c1 >= th2) || (c2 != 0)); \\\n}\n\n/** Add a to the number defined by (c0,c1,c2). c2 must never overflow. */\n#define sumadd(a) { \\\n    unsigned int over; \\\n    c0 += (a);                  /* overflow is handled on the next line */ \\\n    over = (c0 < (a)) ? 1 : 0; \\\n    c1 += over;                 /* overflow is handled on the next line */ \\\n    c2 += (c1 < over) ? 1 : 0;  /* never overflows by contract */ \\\n}\n\n/** Add a to the number defined by (c0,c1). c1 must never overflow, c2 must be zero. */\n#define sumadd_fast(a) { \\\n    c0 += (a);                 /* overflow is handled on the next line */ \\\n    c1 += (c0 < (a)) ? 1 : 0;  /* never overflows by contract (verified the next line) */ \\\n    VERIFY_CHECK((c1 != 0) | (c0 >= (a))); \\\n    VERIFY_CHECK(c2 == 0); \\\n}\n\n/** Extract the lowest 32 bits of (c0,c1,c2) into n, and left shift the number 32 bits. */\n#define extract(n) { \\\n    (n) = c0; \\\n    c0 = c1; \\\n    c1 = c2; \\\n    c2 = 0; \\\n}\n\n/** Extract the lowest 32 bits of (c0,c1,c2) into n, and left shift the number 32 bits. c2 is required to be zero. */\n#define extract_fast(n) { \\\n    (n) = c0; \\\n    c0 = c1; \\\n    c1 = 0; \\\n    VERIFY_CHECK(c2 == 0); \\\n}\n\nstatic void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint32_t *l) {\n    uint64_t c;\n    uint32_t n0 = l[8], n1 = l[9], n2 = l[10], n3 = l[11], n4 = l[12], n5 = l[13], n6 = l[14], n7 = l[15];\n    uint32_t m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12;\n    uint32_t p0, p1, p2, p3, p4, p5, p6, p7, p8;\n\n    /* 96 bit accumulator. */\n    uint32_t c0, c1, c2;\n\n    /* Reduce 512 bits into 385. */\n    /* m[0..12] = l[0..7] + n[0..7] * SECP256K1_N_C. */\n    c0 = l[0]; c1 = 0; c2 = 0;\n    muladd_fast(n0, SECP256K1_N_C_0);\n    extract_fast(m0);\n    sumadd_fast(l[1]);\n    muladd(n1, SECP256K1_N_C_0);\n    muladd(n0, SECP256K1_N_C_1);\n    extract(m1);\n    sumadd(l[2]);\n    muladd(n2, SECP256K1_N_C_0);\n    muladd(n1, SECP256K1_N_C_1);\n    muladd(n0, SECP256K1_N_C_2);\n    extract(m2);\n    sumadd(l[3]);\n    muladd(n3, SECP256K1_N_C_0);\n    muladd(n2, SECP256K1_N_C_1);\n    muladd(n1, SECP256K1_N_C_2);\n    muladd(n0, SECP256K1_N_C_3);\n    extract(m3);\n    sumadd(l[4]);\n    muladd(n4, SECP256K1_N_C_0);\n    muladd(n3, SECP256K1_N_C_1);\n    muladd(n2, SECP256K1_N_C_2);\n    muladd(n1, SECP256K1_N_C_3);\n    sumadd(n0);\n    extract(m4);\n    sumadd(l[5]);\n    muladd(n5, SECP256K1_N_C_0);\n    muladd(n4, SECP256K1_N_C_1);\n    muladd(n3, SECP256K1_N_C_2);\n    muladd(n2, SECP256K1_N_C_3);\n    sumadd(n1);\n    extract(m5);\n    sumadd(l[6]);\n    muladd(n6, SECP256K1_N_C_0);\n    muladd(n5, SECP256K1_N_C_1);\n    muladd(n4, SECP256K1_N_C_2);\n    muladd(n3, SECP256K1_N_C_3);\n    sumadd(n2);\n    extract(m6);\n    sumadd(l[7]);\n    muladd(n7, SECP256K1_N_C_0);\n    muladd(n6, SECP256K1_N_C_1);\n    muladd(n5, SECP256K1_N_C_2);\n    muladd(n4, SECP256K1_N_C_3);\n    sumadd(n3);\n    extract(m7);\n    muladd(n7, SECP256K1_N_C_1);\n    muladd(n6, SECP256K1_N_C_2);\n    muladd(n5, SECP256K1_N_C_3);\n    sumadd(n4);\n    extract(m8);\n    muladd(n7, SECP256K1_N_C_2);\n    muladd(n6, SECP256K1_N_C_3);\n    sumadd(n5);\n    extract(m9);\n    muladd(n7, SECP256K1_N_C_3);\n    sumadd(n6);\n    extract(m10);\n    sumadd_fast(n7);\n    extract_fast(m11);\n    VERIFY_CHECK(c0 <= 1);\n    m12 = c0;\n\n    /* Reduce 385 bits into 258. */\n    /* p[0..8] = m[0..7] + m[8..12] * SECP256K1_N_C. */\n    c0 = m0; c1 = 0; c2 = 0;\n    muladd_fast(m8, SECP256K1_N_C_0);\n    extract_fast(p0);\n    sumadd_fast(m1);\n    muladd(m9, SECP256K1_N_C_0);\n    muladd(m8, SECP256K1_N_C_1);\n    extract(p1);\n    sumadd(m2);\n    muladd(m10, SECP256K1_N_C_0);\n    muladd(m9, SECP256K1_N_C_1);\n    muladd(m8, SECP256K1_N_C_2);\n    extract(p2);\n    sumadd(m3);\n    muladd(m11, SECP256K1_N_C_0);\n    muladd(m10, SECP256K1_N_C_1);\n    muladd(m9, SECP256K1_N_C_2);\n    muladd(m8, SECP256K1_N_C_3);\n    extract(p3);\n    sumadd(m4);\n    muladd(m12, SECP256K1_N_C_0);\n    muladd(m11, SECP256K1_N_C_1);\n    muladd(m10, SECP256K1_N_C_2);\n    muladd(m9, SECP256K1_N_C_3);\n    sumadd(m8);\n    extract(p4);\n    sumadd(m5);\n    muladd(m12, SECP256K1_N_C_1);\n    muladd(m11, SECP256K1_N_C_2);\n    muladd(m10, SECP256K1_N_C_3);\n    sumadd(m9);\n    extract(p5);\n    sumadd(m6);\n    muladd(m12, SECP256K1_N_C_2);\n    muladd(m11, SECP256K1_N_C_3);\n    sumadd(m10);\n    extract(p6);\n    sumadd_fast(m7);\n    muladd_fast(m12, SECP256K1_N_C_3);\n    sumadd_fast(m11);\n    extract_fast(p7);\n    p8 = c0 + m12;\n    VERIFY_CHECK(p8 <= 2);\n\n    /* Reduce 258 bits into 256. */\n    /* r[0..7] = p[0..7] + p[8] * SECP256K1_N_C. */\n    c = p0 + (uint64_t)SECP256K1_N_C_0 * p8;\n    r->d[0] = c & 0xFFFFFFFFUL; c >>= 32;\n    c += p1 + (uint64_t)SECP256K1_N_C_1 * p8;\n    r->d[1] = c & 0xFFFFFFFFUL; c >>= 32;\n    c += p2 + (uint64_t)SECP256K1_N_C_2 * p8;\n    r->d[2] = c & 0xFFFFFFFFUL; c >>= 32;\n    c += p3 + (uint64_t)SECP256K1_N_C_3 * p8;\n    r->d[3] = c & 0xFFFFFFFFUL; c >>= 32;\n    c += p4 + (uint64_t)p8;\n    r->d[4] = c & 0xFFFFFFFFUL; c >>= 32;\n    c += p5;\n    r->d[5] = c & 0xFFFFFFFFUL; c >>= 32;\n    c += p6;\n    r->d[6] = c & 0xFFFFFFFFUL; c >>= 32;\n    c += p7;\n    r->d[7] = c & 0xFFFFFFFFUL; c >>= 32;\n\n    /* Final reduction of r. */\n    secp256k1_scalar_reduce(r, c + secp256k1_scalar_check_overflow(r));\n}\n\nstatic void secp256k1_scalar_mul_512(uint32_t *l, const secp256k1_scalar *a, const secp256k1_scalar *b) {\n    /* 96 bit accumulator. */\n    uint32_t c0 = 0, c1 = 0, c2 = 0;\n\n    /* l[0..15] = a[0..7] * b[0..7]. */\n    muladd_fast(a->d[0], b->d[0]);\n    extract_fast(l[0]);\n    muladd(a->d[0], b->d[1]);\n    muladd(a->d[1], b->d[0]);\n    extract(l[1]);\n    muladd(a->d[0], b->d[2]);\n    muladd(a->d[1], b->d[1]);\n    muladd(a->d[2], b->d[0]);\n    extract(l[2]);\n    muladd(a->d[0], b->d[3]);\n    muladd(a->d[1], b->d[2]);\n    muladd(a->d[2], b->d[1]);\n    muladd(a->d[3], b->d[0]);\n    extract(l[3]);\n    muladd(a->d[0], b->d[4]);\n    muladd(a->d[1], b->d[3]);\n    muladd(a->d[2], b->d[2]);\n    muladd(a->d[3], b->d[1]);\n    muladd(a->d[4], b->d[0]);\n    extract(l[4]);\n    muladd(a->d[0], b->d[5]);\n    muladd(a->d[1], b->d[4]);\n    muladd(a->d[2], b->d[3]);\n    muladd(a->d[3], b->d[2]);\n    muladd(a->d[4], b->d[1]);\n    muladd(a->d[5], b->d[0]);\n    extract(l[5]);\n    muladd(a->d[0], b->d[6]);\n    muladd(a->d[1], b->d[5]);\n    muladd(a->d[2], b->d[4]);\n    muladd(a->d[3], b->d[3]);\n    muladd(a->d[4], b->d[2]);\n    muladd(a->d[5], b->d[1]);\n    muladd(a->d[6], b->d[0]);\n    extract(l[6]);\n    muladd(a->d[0], b->d[7]);\n    muladd(a->d[1], b->d[6]);\n    muladd(a->d[2], b->d[5]);\n    muladd(a->d[3], b->d[4]);\n    muladd(a->d[4], b->d[3]);\n    muladd(a->d[5], b->d[2]);\n    muladd(a->d[6], b->d[1]);\n    muladd(a->d[7], b->d[0]);\n    extract(l[7]);\n    muladd(a->d[1], b->d[7]);\n    muladd(a->d[2], b->d[6]);\n    muladd(a->d[3], b->d[5]);\n    muladd(a->d[4], b->d[4]);\n    muladd(a->d[5], b->d[3]);\n    muladd(a->d[6], b->d[2]);\n    muladd(a->d[7], b->d[1]);\n    extract(l[8]);\n    muladd(a->d[2], b->d[7]);\n    muladd(a->d[3], b->d[6]);\n    muladd(a->d[4], b->d[5]);\n    muladd(a->d[5], b->d[4]);\n    muladd(a->d[6], b->d[3]);\n    muladd(a->d[7], b->d[2]);\n    extract(l[9]);\n    muladd(a->d[3], b->d[7]);\n    muladd(a->d[4], b->d[6]);\n    muladd(a->d[5], b->d[5]);\n    muladd(a->d[6], b->d[4]);\n    muladd(a->d[7], b->d[3]);\n    extract(l[10]);\n    muladd(a->d[4], b->d[7]);\n    muladd(a->d[5], b->d[6]);\n    muladd(a->d[6], b->d[5]);\n    muladd(a->d[7], b->d[4]);\n    extract(l[11]);\n    muladd(a->d[5], b->d[7]);\n    muladd(a->d[6], b->d[6]);\n    muladd(a->d[7], b->d[5]);\n    extract(l[12]);\n    muladd(a->d[6], b->d[7]);\n    muladd(a->d[7], b->d[6]);\n    extract(l[13]);\n    muladd_fast(a->d[7], b->d[7]);\n    extract_fast(l[14]);\n    VERIFY_CHECK(c1 == 0);\n    l[15] = c0;\n}\n\nstatic void secp256k1_scalar_sqr_512(uint32_t *l, const secp256k1_scalar *a) {\n    /* 96 bit accumulator. */\n    uint32_t c0 = 0, c1 = 0, c2 = 0;\n\n    /* l[0..15] = a[0..7]^2. */\n    muladd_fast(a->d[0], a->d[0]);\n    extract_fast(l[0]);\n    muladd2(a->d[0], a->d[1]);\n    extract(l[1]);\n    muladd2(a->d[0], a->d[2]);\n    muladd(a->d[1], a->d[1]);\n    extract(l[2]);\n    muladd2(a->d[0], a->d[3]);\n    muladd2(a->d[1], a->d[2]);\n    extract(l[3]);\n    muladd2(a->d[0], a->d[4]);\n    muladd2(a->d[1], a->d[3]);\n    muladd(a->d[2], a->d[2]);\n    extract(l[4]);\n    muladd2(a->d[0], a->d[5]);\n    muladd2(a->d[1], a->d[4]);\n    muladd2(a->d[2], a->d[3]);\n    extract(l[5]);\n    muladd2(a->d[0], a->d[6]);\n    muladd2(a->d[1], a->d[5]);\n    muladd2(a->d[2], a->d[4]);\n    muladd(a->d[3], a->d[3]);\n    extract(l[6]);\n    muladd2(a->d[0], a->d[7]);\n    muladd2(a->d[1], a->d[6]);\n    muladd2(a->d[2], a->d[5]);\n    muladd2(a->d[3], a->d[4]);\n    extract(l[7]);\n    muladd2(a->d[1], a->d[7]);\n    muladd2(a->d[2], a->d[6]);\n    muladd2(a->d[3], a->d[5]);\n    muladd(a->d[4], a->d[4]);\n    extract(l[8]);\n    muladd2(a->d[2], a->d[7]);\n    muladd2(a->d[3], a->d[6]);\n    muladd2(a->d[4], a->d[5]);\n    extract(l[9]);\n    muladd2(a->d[3], a->d[7]);\n    muladd2(a->d[4], a->d[6]);\n    muladd(a->d[5], a->d[5]);\n    extract(l[10]);\n    muladd2(a->d[4], a->d[7]);\n    muladd2(a->d[5], a->d[6]);\n    extract(l[11]);\n    muladd2(a->d[5], a->d[7]);\n    muladd(a->d[6], a->d[6]);\n    extract(l[12]);\n    muladd2(a->d[6], a->d[7]);\n    extract(l[13]);\n    muladd_fast(a->d[7], a->d[7]);\n    extract_fast(l[14]);\n    VERIFY_CHECK(c1 == 0);\n    l[15] = c0;\n}\n\n#undef sumadd\n#undef sumadd_fast\n#undef muladd\n#undef muladd_fast\n#undef muladd2\n#undef extract\n#undef extract_fast\n\nstatic void secp256k1_scalar_mul(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {\n    uint32_t l[16];\n    secp256k1_scalar_mul_512(l, a, b);\n    secp256k1_scalar_reduce_512(r, l);\n}\n\nstatic int secp256k1_scalar_shr_int(secp256k1_scalar *r, int n) {\n    int ret;\n    VERIFY_CHECK(n > 0);\n    VERIFY_CHECK(n < 16);\n    ret = r->d[0] & ((1 << n) - 1);\n    r->d[0] = (r->d[0] >> n) + (r->d[1] << (32 - n));\n    r->d[1] = (r->d[1] >> n) + (r->d[2] << (32 - n));\n    r->d[2] = (r->d[2] >> n) + (r->d[3] << (32 - n));\n    r->d[3] = (r->d[3] >> n) + (r->d[4] << (32 - n));\n    r->d[4] = (r->d[4] >> n) + (r->d[5] << (32 - n));\n    r->d[5] = (r->d[5] >> n) + (r->d[6] << (32 - n));\n    r->d[6] = (r->d[6] >> n) + (r->d[7] << (32 - n));\n    r->d[7] = (r->d[7] >> n);\n    return ret;\n}\n\nstatic void secp256k1_scalar_sqr(secp256k1_scalar *r, const secp256k1_scalar *a) {\n    uint32_t l[16];\n    secp256k1_scalar_sqr_512(l, a);\n    secp256k1_scalar_reduce_512(r, l);\n}\n\n#ifdef USE_ENDOMORPHISM\nstatic void secp256k1_scalar_split_128(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *a) {\n    r1->d[0] = a->d[0];\n    r1->d[1] = a->d[1];\n    r1->d[2] = a->d[2];\n    r1->d[3] = a->d[3];\n    r1->d[4] = 0;\n    r1->d[5] = 0;\n    r1->d[6] = 0;\n    r1->d[7] = 0;\n    r2->d[0] = a->d[4];\n    r2->d[1] = a->d[5];\n    r2->d[2] = a->d[6];\n    r2->d[3] = a->d[7];\n    r2->d[4] = 0;\n    r2->d[5] = 0;\n    r2->d[6] = 0;\n    r2->d[7] = 0;\n}\n#endif\n\nSECP256K1_INLINE static int secp256k1_scalar_eq(const secp256k1_scalar *a, const secp256k1_scalar *b) {\n    return ((a->d[0] ^ b->d[0]) | (a->d[1] ^ b->d[1]) | (a->d[2] ^ b->d[2]) | (a->d[3] ^ b->d[3]) | (a->d[4] ^ b->d[4]) | (a->d[5] ^ b->d[5]) | (a->d[6] ^ b->d[6]) | (a->d[7] ^ b->d[7])) == 0;\n}\n\nSECP256K1_INLINE static void secp256k1_scalar_mul_shift_var(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b, unsigned int shift) {\n    uint32_t l[16];\n    unsigned int shiftlimbs;\n    unsigned int shiftlow;\n    unsigned int shifthigh;\n    VERIFY_CHECK(shift >= 256);\n    secp256k1_scalar_mul_512(l, a, b);\n    shiftlimbs = shift >> 5;\n    shiftlow = shift & 0x1F;\n    shifthigh = 32 - shiftlow;\n    r->d[0] = shift < 512 ? (l[0 + shiftlimbs] >> shiftlow | (shift < 480 && shiftlow ? (l[1 + shiftlimbs] << shifthigh) : 0)) : 0;\n    r->d[1] = shift < 480 ? (l[1 + shiftlimbs] >> shiftlow | (shift < 448 && shiftlow ? (l[2 + shiftlimbs] << shifthigh) : 0)) : 0;\n    r->d[2] = shift < 448 ? (l[2 + shiftlimbs] >> shiftlow | (shift < 416 && shiftlow ? (l[3 + shiftlimbs] << shifthigh) : 0)) : 0;\n    r->d[3] = shift < 416 ? (l[3 + shiftlimbs] >> shiftlow | (shift < 384 && shiftlow ? (l[4 + shiftlimbs] << shifthigh) : 0)) : 0;\n    r->d[4] = shift < 384 ? (l[4 + shiftlimbs] >> shiftlow | (shift < 352 && shiftlow ? (l[5 + shiftlimbs] << shifthigh) : 0)) : 0;\n    r->d[5] = shift < 352 ? (l[5 + shiftlimbs] >> shiftlow | (shift < 320 && shiftlow ? (l[6 + shiftlimbs] << shifthigh) : 0)) : 0;\n    r->d[6] = shift < 320 ? (l[6 + shiftlimbs] >> shiftlow | (shift < 288 && shiftlow ? (l[7 + shiftlimbs] << shifthigh) : 0)) : 0;\n    r->d[7] = shift < 288 ? (l[7 + shiftlimbs] >> shiftlow)  : 0;\n    secp256k1_scalar_cadd_bit(r, 0, (l[(shift - 1) >> 5] >> ((shift - 1) & 0x1f)) & 1);\n}\n\n#endif /* SECP256K1_SCALAR_REPR_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/scalar_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2014 Pieter Wuille                                   *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_SCALAR_IMPL_H\n#define SECP256K1_SCALAR_IMPL_H\n\n#include \"group.h\"\n#include \"scalar.h\"\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n#if defined(EXHAUSTIVE_TEST_ORDER)\n#include \"scalar_low_impl.h\"\n#elif defined(USE_SCALAR_4X64)\n#include \"scalar_4x64_impl.h\"\n#elif defined(USE_SCALAR_8X32)\n#include \"scalar_8x32_impl.h\"\n#else\n#error \"Please select scalar implementation\"\n#endif\n\n#ifndef USE_NUM_NONE\nstatic void secp256k1_scalar_get_num(secp256k1_num *r, const secp256k1_scalar *a) {\n    unsigned char c[32];\n    secp256k1_scalar_get_b32(c, a);\n    secp256k1_num_set_bin(r, c, 32);\n}\n\n/** secp256k1 curve order, see secp256k1_ecdsa_const_order_as_fe in ecdsa_impl.h */\nstatic void secp256k1_scalar_order_get_num(secp256k1_num *r) {\n#if defined(EXHAUSTIVE_TEST_ORDER)\n    static const unsigned char order[32] = {\n        0,0,0,0,0,0,0,0,\n        0,0,0,0,0,0,0,0,\n        0,0,0,0,0,0,0,0,\n        0,0,0,0,0,0,0,EXHAUSTIVE_TEST_ORDER\n    };\n#else\n    static const unsigned char order[32] = {\n        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n        0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,\n        0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,\n        0xBF,0xD2,0x5E,0x8C,0xD0,0x36,0x41,0x41\n    };\n#endif\n    secp256k1_num_set_bin(r, order, 32);\n}\n#endif\n\nstatic void secp256k1_scalar_inverse(secp256k1_scalar *r, const secp256k1_scalar *x) {\n#if defined(EXHAUSTIVE_TEST_ORDER)\n    int i;\n    *r = 0;\n    for (i = 0; i < EXHAUSTIVE_TEST_ORDER; i++)\n        if ((i * *x) % EXHAUSTIVE_TEST_ORDER == 1)\n            *r = i;\n    /* If this VERIFY_CHECK triggers we were given a noninvertible scalar (and thus\n     * have a composite group order; fix it in exhaustive_tests.c). */\n    VERIFY_CHECK(*r != 0);\n}\n#else\n    secp256k1_scalar *t;\n    int i;\n    /* First compute xN as x ^ (2^N - 1) for some values of N,\n     * and uM as x ^ M for some values of M. */\n    secp256k1_scalar x2, x3, x6, x8, x14, x28, x56, x112, x126;\n    secp256k1_scalar u2, u5, u9, u11, u13;\n\n    secp256k1_scalar_sqr(&u2, x);\n    secp256k1_scalar_mul(&x2, &u2,  x);\n    secp256k1_scalar_mul(&u5, &u2, &x2);\n    secp256k1_scalar_mul(&x3, &u5,  &u2);\n    secp256k1_scalar_mul(&u9, &x3, &u2);\n    secp256k1_scalar_mul(&u11, &u9, &u2);\n    secp256k1_scalar_mul(&u13, &u11, &u2);\n\n    secp256k1_scalar_sqr(&x6, &u13);\n    secp256k1_scalar_sqr(&x6, &x6);\n    secp256k1_scalar_mul(&x6, &x6, &u11);\n\n    secp256k1_scalar_sqr(&x8, &x6);\n    secp256k1_scalar_sqr(&x8, &x8);\n    secp256k1_scalar_mul(&x8, &x8,  &x2);\n\n    secp256k1_scalar_sqr(&x14, &x8);\n    for (i = 0; i < 5; i++) {\n        secp256k1_scalar_sqr(&x14, &x14);\n    }\n    secp256k1_scalar_mul(&x14, &x14, &x6);\n\n    secp256k1_scalar_sqr(&x28, &x14);\n    for (i = 0; i < 13; i++) {\n        secp256k1_scalar_sqr(&x28, &x28);\n    }\n    secp256k1_scalar_mul(&x28, &x28, &x14);\n\n    secp256k1_scalar_sqr(&x56, &x28);\n    for (i = 0; i < 27; i++) {\n        secp256k1_scalar_sqr(&x56, &x56);\n    }\n    secp256k1_scalar_mul(&x56, &x56, &x28);\n\n    secp256k1_scalar_sqr(&x112, &x56);\n    for (i = 0; i < 55; i++) {\n        secp256k1_scalar_sqr(&x112, &x112);\n    }\n    secp256k1_scalar_mul(&x112, &x112, &x56);\n\n    secp256k1_scalar_sqr(&x126, &x112);\n    for (i = 0; i < 13; i++) {\n        secp256k1_scalar_sqr(&x126, &x126);\n    }\n    secp256k1_scalar_mul(&x126, &x126, &x14);\n\n    /* Then accumulate the final result (t starts at x126). */\n    t = &x126;\n    for (i = 0; i < 3; i++) {\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u5); /* 101 */\n    for (i = 0; i < 4; i++) { /* 0 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &x3); /* 111 */\n    for (i = 0; i < 4; i++) { /* 0 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u5); /* 101 */\n    for (i = 0; i < 5; i++) { /* 0 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u11); /* 1011 */\n    for (i = 0; i < 4; i++) {\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u11); /* 1011 */\n    for (i = 0; i < 4; i++) { /* 0 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &x3); /* 111 */\n    for (i = 0; i < 5; i++) { /* 00 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &x3); /* 111 */\n    for (i = 0; i < 6; i++) { /* 00 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u13); /* 1101 */\n    for (i = 0; i < 4; i++) { /* 0 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u5); /* 101 */\n    for (i = 0; i < 3; i++) {\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &x3); /* 111 */\n    for (i = 0; i < 5; i++) { /* 0 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u9); /* 1001 */\n    for (i = 0; i < 6; i++) { /* 000 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u5); /* 101 */\n    for (i = 0; i < 10; i++) { /* 0000000 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &x3); /* 111 */\n    for (i = 0; i < 4; i++) { /* 0 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &x3); /* 111 */\n    for (i = 0; i < 9; i++) { /* 0 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &x8); /* 11111111 */\n    for (i = 0; i < 5; i++) { /* 0 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u9); /* 1001 */\n    for (i = 0; i < 6; i++) { /* 00 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u11); /* 1011 */\n    for (i = 0; i < 4; i++) {\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u13); /* 1101 */\n    for (i = 0; i < 5; i++) {\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &x2); /* 11 */\n    for (i = 0; i < 6; i++) { /* 00 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u13); /* 1101 */\n    for (i = 0; i < 10; i++) { /* 000000 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u13); /* 1101 */\n    for (i = 0; i < 4; i++) {\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, &u9); /* 1001 */\n    for (i = 0; i < 6; i++) { /* 00000 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(t, t, x); /* 1 */\n    for (i = 0; i < 8; i++) { /* 00 */\n        secp256k1_scalar_sqr(t, t);\n    }\n    secp256k1_scalar_mul(r, t, &x6); /* 111111 */\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_is_even(const secp256k1_scalar *a) {\n    return !(a->d[0] & 1);\n}\n#endif\n\nstatic void secp256k1_scalar_inverse_var(secp256k1_scalar *r, const secp256k1_scalar *x) {\n#if defined(USE_SCALAR_INV_BUILTIN)\n    secp256k1_scalar_inverse(r, x);\n#elif defined(USE_SCALAR_INV_NUM)\n    unsigned char b[32];\n    secp256k1_num n, m;\n    secp256k1_scalar t = *x;\n    secp256k1_scalar_get_b32(b, &t);\n    secp256k1_num_set_bin(&n, b, 32);\n    secp256k1_scalar_order_get_num(&m);\n    secp256k1_num_mod_inverse(&n, &n, &m);\n    secp256k1_num_get_bin(b, 32, &n);\n    secp256k1_scalar_set_b32(r, b, NULL);\n    /* Verify that the inverse was computed correctly, without GMP code. */\n    secp256k1_scalar_mul(&t, &t, r);\n    CHECK(secp256k1_scalar_is_one(&t));\n#else\n#error \"Please select scalar inverse implementation\"\n#endif\n}\n\n#ifdef USE_ENDOMORPHISM\n#if defined(EXHAUSTIVE_TEST_ORDER)\n/**\n * Find k1 and k2 given k, such that k1 + k2 * lambda == k mod n; unlike in the\n * full case we don't bother making k1 and k2 be small, we just want them to be\n * nontrivial to get full test coverage for the exhaustive tests. We therefore\n * (arbitrarily) set k2 = k + 5 and k1 = k - k2 * lambda.\n */\nstatic void secp256k1_scalar_split_lambda(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *a) {\n    *r2 = (*a + 5) % EXHAUSTIVE_TEST_ORDER;\n    *r1 = (*a + (EXHAUSTIVE_TEST_ORDER - *r2) * EXHAUSTIVE_TEST_LAMBDA) % EXHAUSTIVE_TEST_ORDER;\n}\n#else\n/**\n * The Secp256k1 curve has an endomorphism, where lambda * (x, y) = (beta * x, y), where\n * lambda is {0x53,0x63,0xad,0x4c,0xc0,0x5c,0x30,0xe0,0xa5,0x26,0x1c,0x02,0x88,0x12,0x64,0x5a,\n *            0x12,0x2e,0x22,0xea,0x20,0x81,0x66,0x78,0xdf,0x02,0x96,0x7c,0x1b,0x23,0xbd,0x72}\n *\n * \"Guide to Elliptic Curve Cryptography\" (Hankerson, Menezes, Vanstone) gives an algorithm\n * (algorithm 3.74) to find k1 and k2 given k, such that k1 + k2 * lambda == k mod n, and k1\n * and k2 have a small size.\n * It relies on constants a1, b1, a2, b2. These constants for the value of lambda above are:\n *\n * - a1 =      {0x30,0x86,0xd2,0x21,0xa7,0xd4,0x6b,0xcd,0xe8,0x6c,0x90,0xe4,0x92,0x84,0xeb,0x15}\n * - b1 =     -{0xe4,0x43,0x7e,0xd6,0x01,0x0e,0x88,0x28,0x6f,0x54,0x7f,0xa9,0x0a,0xbf,0xe4,0xc3}\n * - a2 = {0x01,0x14,0xca,0x50,0xf7,0xa8,0xe2,0xf3,0xf6,0x57,0xc1,0x10,0x8d,0x9d,0x44,0xcf,0xd8}\n * - b2 =      {0x30,0x86,0xd2,0x21,0xa7,0xd4,0x6b,0xcd,0xe8,0x6c,0x90,0xe4,0x92,0x84,0xeb,0x15}\n *\n * The algorithm then computes c1 = round(b1 * k / n) and c2 = round(b2 * k / n), and gives\n * k1 = k - (c1*a1 + c2*a2) and k2 = -(c1*b1 + c2*b2). Instead, we use modular arithmetic, and\n * compute k1 as k - k2 * lambda, avoiding the need for constants a1 and a2.\n *\n * g1, g2 are precomputed constants used to replace division with a rounded multiplication\n * when decomposing the scalar for an endomorphism-based point multiplication.\n *\n * The possibility of using precomputed estimates is mentioned in \"Guide to Elliptic Curve\n * Cryptography\" (Hankerson, Menezes, Vanstone) in section 3.5.\n *\n * The derivation is described in the paper \"Efficient Software Implementation of Public-Key\n * Cryptography on Sensor Networks Using the MSP430X Microcontroller\" (Gouvea, Oliveira, Lopez),\n * Section 4.3 (here we use a somewhat higher-precision estimate):\n * d = a1*b2 - b1*a2\n * g1 = round((2^272)*b2/d)\n * g2 = round((2^272)*b1/d)\n *\n * (Note that 'd' is also equal to the curve order here because [a1,b1] and [a2,b2] are found\n * as outputs of the Extended Euclidean Algorithm on inputs 'order' and 'lambda').\n *\n * The function below splits a in r1 and r2, such that r1 + lambda * r2 == a (mod order).\n */\n\nstatic void secp256k1_scalar_split_lambda(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *a) {\n    secp256k1_scalar c1, c2;\n    static const secp256k1_scalar minus_lambda = SECP256K1_SCALAR_CONST(\n        0xAC9C52B3UL, 0x3FA3CF1FUL, 0x5AD9E3FDUL, 0x77ED9BA4UL,\n        0xA880B9FCUL, 0x8EC739C2UL, 0xE0CFC810UL, 0xB51283CFUL\n    );\n    static const secp256k1_scalar minus_b1 = SECP256K1_SCALAR_CONST(\n        0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL,\n        0xE4437ED6UL, 0x010E8828UL, 0x6F547FA9UL, 0x0ABFE4C3UL\n    );\n    static const secp256k1_scalar minus_b2 = SECP256K1_SCALAR_CONST(\n        0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFEUL,\n        0x8A280AC5UL, 0x0774346DUL, 0xD765CDA8UL, 0x3DB1562CUL\n    );\n    static const secp256k1_scalar g1 = SECP256K1_SCALAR_CONST(\n        0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00003086UL,\n        0xD221A7D4UL, 0x6BCDE86CUL, 0x90E49284UL, 0xEB153DABUL\n    );\n    static const secp256k1_scalar g2 = SECP256K1_SCALAR_CONST(\n        0x00000000UL, 0x00000000UL, 0x00000000UL, 0x0000E443UL,\n        0x7ED6010EUL, 0x88286F54UL, 0x7FA90ABFUL, 0xE4C42212UL\n    );\n    VERIFY_CHECK(r1 != a);\n    VERIFY_CHECK(r2 != a);\n    /* these _var calls are constant time since the shift amount is constant */\n    secp256k1_scalar_mul_shift_var(&c1, a, &g1, 272);\n    secp256k1_scalar_mul_shift_var(&c2, a, &g2, 272);\n    secp256k1_scalar_mul(&c1, &c1, &minus_b1);\n    secp256k1_scalar_mul(&c2, &c2, &minus_b2);\n    secp256k1_scalar_add(r2, &c1, &c2);\n    secp256k1_scalar_mul(r1, r2, &minus_lambda);\n    secp256k1_scalar_add(r1, r1, a);\n}\n#endif\n#endif\n\n#endif /* SECP256K1_SCALAR_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/scalar_low.h",
    "content": "/**********************************************************************\n * Copyright (c) 2015 Andrew Poelstra                                 *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_SCALAR_REPR_H\n#define SECP256K1_SCALAR_REPR_H\n\n#include <stdint.h>\n\n/** A scalar modulo the group order of the secp256k1 curve. */\ntypedef uint32_t secp256k1_scalar;\n\n#endif /* SECP256K1_SCALAR_REPR_H */\n"
  },
  {
    "path": "src/secp256k1/src/scalar_low_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2015 Andrew Poelstra                                 *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_SCALAR_REPR_IMPL_H\n#define SECP256K1_SCALAR_REPR_IMPL_H\n\n#include \"scalar.h\"\n\n#include <string.h>\n\nSECP256K1_INLINE static int secp256k1_scalar_is_even(const secp256k1_scalar *a) {\n    return !(*a & 1);\n}\n\nSECP256K1_INLINE static void secp256k1_scalar_clear(secp256k1_scalar *r) { *r = 0; }\nSECP256K1_INLINE static void secp256k1_scalar_set_int(secp256k1_scalar *r, unsigned int v) { *r = v; }\n\nSECP256K1_INLINE static unsigned int secp256k1_scalar_get_bits(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {\n    if (offset < 32)\n        return ((*a >> offset) & ((((uint32_t)1) << count) - 1));\n    else\n        return 0;\n}\n\nSECP256K1_INLINE static unsigned int secp256k1_scalar_get_bits_var(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {\n    return secp256k1_scalar_get_bits(a, offset, count);\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_check_overflow(const secp256k1_scalar *a) { return *a >= EXHAUSTIVE_TEST_ORDER; }\n\nstatic int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {\n    *r = (*a + *b) % EXHAUSTIVE_TEST_ORDER;\n    return *r < *b;\n}\n\nstatic void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int flag) {\n    if (flag && bit < 32)\n        *r += (1 << bit);\n#ifdef VERIFY\n    VERIFY_CHECK(secp256k1_scalar_check_overflow(r) == 0);\n#endif\n}\n\nstatic void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *b32, int *overflow) {\n    const int base = 0x100 % EXHAUSTIVE_TEST_ORDER;\n    int i;\n    *r = 0;\n    for (i = 0; i < 32; i++) {\n       *r = ((*r * base) + b32[i]) % EXHAUSTIVE_TEST_ORDER;\n    }\n    /* just deny overflow, it basically always happens */\n    if (overflow) *overflow = 0;\n}\n\nstatic void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar* a) {\n    memset(bin, 0, 32);\n    bin[28] = *a >> 24; bin[29] = *a >> 16; bin[30] = *a >> 8; bin[31] = *a;\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_is_zero(const secp256k1_scalar *a) {\n    return *a == 0;\n}\n\nstatic void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a) {\n    if (*a == 0) {\n        *r = 0;\n    } else {\n        *r = EXHAUSTIVE_TEST_ORDER - *a;\n    }\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_is_one(const secp256k1_scalar *a) {\n    return *a == 1;\n}\n\nstatic int secp256k1_scalar_is_high(const secp256k1_scalar *a) {\n    return *a > EXHAUSTIVE_TEST_ORDER / 2;\n}\n\nstatic int secp256k1_scalar_cond_negate(secp256k1_scalar *r, int flag) {\n    if (flag) secp256k1_scalar_negate(r, r);\n    return flag ? -1 : 1;\n}\n\nstatic void secp256k1_scalar_mul(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {\n    *r = (*a * *b) % EXHAUSTIVE_TEST_ORDER;\n}\n\nstatic int secp256k1_scalar_shr_int(secp256k1_scalar *r, int n) {\n    int ret;\n    VERIFY_CHECK(n > 0);\n    VERIFY_CHECK(n < 16);\n    ret = *r & ((1 << n) - 1);\n    *r >>= n;\n    return ret;\n}\n\nstatic void secp256k1_scalar_sqr(secp256k1_scalar *r, const secp256k1_scalar *a) {\n    *r = (*a * *a) % EXHAUSTIVE_TEST_ORDER;\n}\n\nstatic void secp256k1_scalar_split_128(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *a) {\n    *r1 = *a;\n    *r2 = 0;\n}\n\nSECP256K1_INLINE static int secp256k1_scalar_eq(const secp256k1_scalar *a, const secp256k1_scalar *b) {\n    return *a == *b;\n}\n\n#endif /* SECP256K1_SCALAR_REPR_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/secp256k1.c",
    "content": "/**********************************************************************\n * Copyright (c) 2013-2015 Pieter Wuille                              *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#include \"include/secp256k1.h\"\n\n#include \"util.h\"\n#include \"num_impl.h\"\n#include \"field_impl.h\"\n#include \"scalar_impl.h\"\n#include \"group_impl.h\"\n#include \"ecmult_impl.h\"\n#include \"ecmult_const_impl.h\"\n#include \"ecmult_gen_impl.h\"\n#include \"ecdsa_impl.h\"\n#include \"eckey_impl.h\"\n#include \"hash_impl.h\"\n\n#define ARG_CHECK(cond) do { \\\n    if (EXPECT(!(cond), 0)) { \\\n        secp256k1_callback_call(&ctx->illegal_callback, #cond); \\\n        return 0; \\\n    } \\\n} while(0)\n\nstatic void default_illegal_callback_fn(const char* str, void* data) {\n    (void)data;\n    fprintf(stderr, \"[libsecp256k1] illegal argument: %s\\n\", str);\n    abort();\n}\n\nstatic const secp256k1_callback default_illegal_callback = {\n    default_illegal_callback_fn,\n    NULL\n};\n\nstatic void default_error_callback_fn(const char* str, void* data) {\n    (void)data;\n    fprintf(stderr, \"[libsecp256k1] internal consistency check failed: %s\\n\", str);\n    abort();\n}\n\nstatic const secp256k1_callback default_error_callback = {\n    default_error_callback_fn,\n    NULL\n};\n\n\nstruct secp256k1_context_struct {\n    secp256k1_ecmult_context ecmult_ctx;\n    secp256k1_ecmult_gen_context ecmult_gen_ctx;\n    secp256k1_callback illegal_callback;\n    secp256k1_callback error_callback;\n};\n\nsecp256k1_context* secp256k1_context_create(unsigned int flags) {\n    secp256k1_context* ret = (secp256k1_context*)checked_malloc(&default_error_callback, sizeof(secp256k1_context));\n    ret->illegal_callback = default_illegal_callback;\n    ret->error_callback = default_error_callback;\n\n    if (EXPECT((flags & SECP256K1_FLAGS_TYPE_MASK) != SECP256K1_FLAGS_TYPE_CONTEXT, 0)) {\n            secp256k1_callback_call(&ret->illegal_callback,\n                                    \"Invalid flags\");\n            free(ret);\n            return NULL;\n    }\n\n    secp256k1_ecmult_context_init(&ret->ecmult_ctx);\n    secp256k1_ecmult_gen_context_init(&ret->ecmult_gen_ctx);\n\n    if (flags & SECP256K1_FLAGS_BIT_CONTEXT_SIGN) {\n        secp256k1_ecmult_gen_context_build(&ret->ecmult_gen_ctx, &ret->error_callback);\n    }\n    if (flags & SECP256K1_FLAGS_BIT_CONTEXT_VERIFY) {\n        secp256k1_ecmult_context_build(&ret->ecmult_ctx, &ret->error_callback);\n    }\n\n    return ret;\n}\n\nsecp256k1_context* secp256k1_context_clone(const secp256k1_context* ctx) {\n    secp256k1_context* ret = (secp256k1_context*)checked_malloc(&ctx->error_callback, sizeof(secp256k1_context));\n    ret->illegal_callback = ctx->illegal_callback;\n    ret->error_callback = ctx->error_callback;\n    secp256k1_ecmult_context_clone(&ret->ecmult_ctx, &ctx->ecmult_ctx, &ctx->error_callback);\n    secp256k1_ecmult_gen_context_clone(&ret->ecmult_gen_ctx, &ctx->ecmult_gen_ctx, &ctx->error_callback);\n    return ret;\n}\n\nvoid secp256k1_context_destroy(secp256k1_context* ctx) {\n    if (ctx != NULL) {\n        secp256k1_ecmult_context_clear(&ctx->ecmult_ctx);\n        secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);\n\n        free(ctx);\n    }\n}\n\nvoid secp256k1_context_set_illegal_callback(secp256k1_context* ctx, void (*fun)(const char* message, void* data), const void* data) {\n    if (fun == NULL) {\n        fun = default_illegal_callback_fn;\n    }\n    ctx->illegal_callback.fn = fun;\n    ctx->illegal_callback.data = data;\n}\n\nvoid secp256k1_context_set_error_callback(secp256k1_context* ctx, void (*fun)(const char* message, void* data), const void* data) {\n    if (fun == NULL) {\n        fun = default_error_callback_fn;\n    }\n    ctx->error_callback.fn = fun;\n    ctx->error_callback.data = data;\n}\n\nstatic int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge, const secp256k1_pubkey* pubkey) {\n    if (sizeof(secp256k1_ge_storage) == 64) {\n        /* When the secp256k1_ge_storage type is exactly 64 byte, use its\n         * representation inside secp256k1_pubkey, as conversion is very fast.\n         * Note that secp256k1_pubkey_save must use the same representation. */\n        secp256k1_ge_storage s;\n        memcpy(&s, &pubkey->data[0], 64);\n        secp256k1_ge_from_storage(ge, &s);\n    } else {\n        /* Otherwise, fall back to 32-byte big endian for X and Y. */\n        secp256k1_fe x, y;\n        secp256k1_fe_set_b32(&x, pubkey->data);\n        secp256k1_fe_set_b32(&y, pubkey->data + 32);\n        secp256k1_ge_set_xy(ge, &x, &y);\n    }\n    ARG_CHECK(!secp256k1_fe_is_zero(&ge->x));\n    return 1;\n}\n\nstatic void secp256k1_pubkey_save(secp256k1_pubkey* pubkey, secp256k1_ge* ge) {\n    if (sizeof(secp256k1_ge_storage) == 64) {\n        secp256k1_ge_storage s;\n        secp256k1_ge_to_storage(&s, ge);\n        memcpy(&pubkey->data[0], &s, 64);\n    } else {\n        VERIFY_CHECK(!secp256k1_ge_is_infinity(ge));\n        secp256k1_fe_normalize_var(&ge->x);\n        secp256k1_fe_normalize_var(&ge->y);\n        secp256k1_fe_get_b32(pubkey->data, &ge->x);\n        secp256k1_fe_get_b32(pubkey->data + 32, &ge->y);\n    }\n}\n\nint secp256k1_ec_pubkey_parse(const secp256k1_context* ctx, secp256k1_pubkey* pubkey, const unsigned char *input, size_t inputlen) {\n    secp256k1_ge Q;\n\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(pubkey != NULL);\n    memset(pubkey, 0, sizeof(*pubkey));\n    ARG_CHECK(input != NULL);\n    if (!secp256k1_eckey_pubkey_parse(&Q, input, inputlen)) {\n        return 0;\n    }\n    secp256k1_pubkey_save(pubkey, &Q);\n    secp256k1_ge_clear(&Q);\n    return 1;\n}\n\nint secp256k1_ec_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_pubkey* pubkey, unsigned int flags) {\n    secp256k1_ge Q;\n    size_t len;\n    int ret = 0;\n\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(outputlen != NULL);\n    ARG_CHECK(*outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33 : 65));\n    len = *outputlen;\n    *outputlen = 0;\n    ARG_CHECK(output != NULL);\n    memset(output, 0, len);\n    ARG_CHECK(pubkey != NULL);\n    ARG_CHECK((flags & SECP256K1_FLAGS_TYPE_MASK) == SECP256K1_FLAGS_TYPE_COMPRESSION);\n    if (secp256k1_pubkey_load(ctx, &Q, pubkey)) {\n        ret = secp256k1_eckey_pubkey_serialize(&Q, output, &len, flags & SECP256K1_FLAGS_BIT_COMPRESSION);\n        if (ret) {\n            *outputlen = len;\n        }\n    }\n    return ret;\n}\n\nstatic void secp256k1_ecdsa_signature_load(const secp256k1_context* ctx, secp256k1_scalar* r, secp256k1_scalar* s, const secp256k1_ecdsa_signature* sig) {\n    (void)ctx;\n    if (sizeof(secp256k1_scalar) == 32) {\n        /* When the secp256k1_scalar type is exactly 32 byte, use its\n         * representation inside secp256k1_ecdsa_signature, as conversion is very fast.\n         * Note that secp256k1_ecdsa_signature_save must use the same representation. */\n        memcpy(r, &sig->data[0], 32);\n        memcpy(s, &sig->data[32], 32);\n    } else {\n        secp256k1_scalar_set_b32(r, &sig->data[0], NULL);\n        secp256k1_scalar_set_b32(s, &sig->data[32], NULL);\n    }\n}\n\nstatic void secp256k1_ecdsa_signature_save(secp256k1_ecdsa_signature* sig, const secp256k1_scalar* r, const secp256k1_scalar* s) {\n    if (sizeof(secp256k1_scalar) == 32) {\n        memcpy(&sig->data[0], r, 32);\n        memcpy(&sig->data[32], s, 32);\n    } else {\n        secp256k1_scalar_get_b32(&sig->data[0], r);\n        secp256k1_scalar_get_b32(&sig->data[32], s);\n    }\n}\n\nint secp256k1_ecdsa_signature_parse_der(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {\n    secp256k1_scalar r, s;\n\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(sig != NULL);\n    ARG_CHECK(input != NULL);\n\n    if (secp256k1_ecdsa_sig_parse(&r, &s, input, inputlen)) {\n        secp256k1_ecdsa_signature_save(sig, &r, &s);\n        return 1;\n    } else {\n        memset(sig, 0, sizeof(*sig));\n        return 0;\n    }\n}\n\nint secp256k1_ecdsa_signature_parse_compact(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input64) {\n    secp256k1_scalar r, s;\n    int ret = 1;\n    int overflow = 0;\n\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(sig != NULL);\n    ARG_CHECK(input64 != NULL);\n\n    secp256k1_scalar_set_b32(&r, &input64[0], &overflow);\n    ret &= !overflow;\n    secp256k1_scalar_set_b32(&s, &input64[32], &overflow);\n    ret &= !overflow;\n    if (ret) {\n        secp256k1_ecdsa_signature_save(sig, &r, &s);\n    } else {\n        memset(sig, 0, sizeof(*sig));\n    }\n    return ret;\n}\n\nint secp256k1_ecdsa_signature_serialize_der(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_ecdsa_signature* sig) {\n    secp256k1_scalar r, s;\n\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(output != NULL);\n    ARG_CHECK(outputlen != NULL);\n    ARG_CHECK(sig != NULL);\n\n    secp256k1_ecdsa_signature_load(ctx, &r, &s, sig);\n    return secp256k1_ecdsa_sig_serialize(output, outputlen, &r, &s);\n}\n\nint secp256k1_ecdsa_signature_serialize_compact(const secp256k1_context* ctx, unsigned char *output64, const secp256k1_ecdsa_signature* sig) {\n    secp256k1_scalar r, s;\n\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(output64 != NULL);\n    ARG_CHECK(sig != NULL);\n\n    secp256k1_ecdsa_signature_load(ctx, &r, &s, sig);\n    secp256k1_scalar_get_b32(&output64[0], &r);\n    secp256k1_scalar_get_b32(&output64[32], &s);\n    return 1;\n}\n\nint secp256k1_ecdsa_signature_normalize(const secp256k1_context* ctx, secp256k1_ecdsa_signature *sigout, const secp256k1_ecdsa_signature *sigin) {\n    secp256k1_scalar r, s;\n    int ret = 0;\n\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(sigin != NULL);\n\n    secp256k1_ecdsa_signature_load(ctx, &r, &s, sigin);\n    ret = secp256k1_scalar_is_high(&s);\n    if (sigout != NULL) {\n        if (ret) {\n            secp256k1_scalar_negate(&s, &s);\n        }\n        secp256k1_ecdsa_signature_save(sigout, &r, &s);\n    }\n\n    return ret;\n}\n\nint secp256k1_ecdsa_verify(const secp256k1_context* ctx, const secp256k1_ecdsa_signature *sig, const unsigned char *msg32, const secp256k1_pubkey *pubkey) {\n    secp256k1_ge q;\n    secp256k1_scalar r, s;\n    secp256k1_scalar m;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(secp256k1_ecmult_context_is_built(&ctx->ecmult_ctx));\n    ARG_CHECK(msg32 != NULL);\n    ARG_CHECK(sig != NULL);\n    ARG_CHECK(pubkey != NULL);\n\n    secp256k1_scalar_set_b32(&m, msg32, NULL);\n    secp256k1_ecdsa_signature_load(ctx, &r, &s, sig);\n    return (!secp256k1_scalar_is_high(&s) &&\n            secp256k1_pubkey_load(ctx, &q, pubkey) &&\n            secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &r, &s, &q, &m));\n}\n\nstatic int nonce_function_rfc6979(unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter) {\n   unsigned char keydata[112];\n   int keylen = 64;\n   secp256k1_rfc6979_hmac_sha256_t rng;\n   unsigned int i;\n   /* We feed a byte array to the PRNG as input, consisting of:\n    * - the private key (32 bytes) and message (32 bytes), see RFC 6979 3.2d.\n    * - optionally 32 extra bytes of data, see RFC 6979 3.6 Additional Data.\n    * - optionally 16 extra bytes with the algorithm name.\n    * Because the arguments have distinct fixed lengths it is not possible for\n    *  different argument mixtures to emulate each other and result in the same\n    *  nonces.\n    */\n   memcpy(keydata, key32, 32);\n   memcpy(keydata + 32, msg32, 32);\n   if (data != NULL) {\n       memcpy(keydata + 64, data, 32);\n       keylen = 96;\n   }\n   if (algo16 != NULL) {\n       memcpy(keydata + keylen, algo16, 16);\n       keylen += 16;\n   }\n   secp256k1_rfc6979_hmac_sha256_initialize(&rng, keydata, keylen);\n   memset(keydata, 0, sizeof(keydata));\n   for (i = 0; i <= counter; i++) {\n       secp256k1_rfc6979_hmac_sha256_generate(&rng, nonce32, 32);\n   }\n   secp256k1_rfc6979_hmac_sha256_finalize(&rng);\n   return 1;\n}\n\nconst secp256k1_nonce_function secp256k1_nonce_function_rfc6979 = nonce_function_rfc6979;\nconst secp256k1_nonce_function secp256k1_nonce_function_default = nonce_function_rfc6979;\n\nint secp256k1_ecdsa_sign(const secp256k1_context* ctx, secp256k1_ecdsa_signature *signature, const unsigned char *msg32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void* noncedata) {\n    secp256k1_scalar r, s;\n    secp256k1_scalar sec, non, msg;\n    int ret = 0;\n    int overflow = 0;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));\n    ARG_CHECK(msg32 != NULL);\n    ARG_CHECK(signature != NULL);\n    ARG_CHECK(seckey != NULL);\n    if (noncefp == NULL) {\n        noncefp = secp256k1_nonce_function_default;\n    }\n\n    secp256k1_scalar_set_b32(&sec, seckey, &overflow);\n    /* Fail if the secret key is invalid. */\n    if (!overflow && !secp256k1_scalar_is_zero(&sec)) {\n        unsigned char nonce32[32];\n        unsigned int count = 0;\n        secp256k1_scalar_set_b32(&msg, msg32, NULL);\n        while (1) {\n            ret = noncefp(nonce32, msg32, seckey, NULL, (void*)noncedata, count);\n            if (!ret) {\n                break;\n            }\n            secp256k1_scalar_set_b32(&non, nonce32, &overflow);\n            if (!overflow && !secp256k1_scalar_is_zero(&non)) {\n                if (secp256k1_ecdsa_sig_sign(&ctx->ecmult_gen_ctx, &r, &s, &sec, &msg, &non, NULL)) {\n                    break;\n                }\n            }\n            count++;\n        }\n        memset(nonce32, 0, 32);\n        secp256k1_scalar_clear(&msg);\n        secp256k1_scalar_clear(&non);\n        secp256k1_scalar_clear(&sec);\n    }\n    if (ret) {\n        secp256k1_ecdsa_signature_save(signature, &r, &s);\n    } else {\n        memset(signature, 0, sizeof(*signature));\n    }\n    return ret;\n}\n\nint secp256k1_ec_seckey_verify(const secp256k1_context* ctx, const unsigned char *seckey) {\n    secp256k1_scalar sec;\n    int ret;\n    int overflow;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(seckey != NULL);\n\n    secp256k1_scalar_set_b32(&sec, seckey, &overflow);\n    ret = !overflow && !secp256k1_scalar_is_zero(&sec);\n    secp256k1_scalar_clear(&sec);\n    return ret;\n}\n\nint secp256k1_ec_pubkey_create(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const unsigned char *seckey) {\n    secp256k1_gej pj;\n    secp256k1_ge p;\n    secp256k1_scalar sec;\n    int overflow;\n    int ret = 0;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(pubkey != NULL);\n    memset(pubkey, 0, sizeof(*pubkey));\n    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));\n    ARG_CHECK(seckey != NULL);\n\n    secp256k1_scalar_set_b32(&sec, seckey, &overflow);\n    ret = (!overflow) & (!secp256k1_scalar_is_zero(&sec));\n    if (ret) {\n        secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &pj, &sec);\n        secp256k1_ge_set_gej(&p, &pj);\n        secp256k1_pubkey_save(pubkey, &p);\n    }\n    secp256k1_scalar_clear(&sec);\n    return ret;\n}\n\nint secp256k1_ec_privkey_negate(const secp256k1_context* ctx, unsigned char *seckey) {\n    secp256k1_scalar sec;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(seckey != NULL);\n\n    secp256k1_scalar_set_b32(&sec, seckey, NULL);\n    secp256k1_scalar_negate(&sec, &sec);\n    secp256k1_scalar_get_b32(seckey, &sec);\n\n    return 1;\n}\n\nint secp256k1_ec_pubkey_negate(const secp256k1_context* ctx, secp256k1_pubkey *pubkey) {\n    int ret = 0;\n    secp256k1_ge p;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(pubkey != NULL);\n\n    ret = secp256k1_pubkey_load(ctx, &p, pubkey);\n    memset(pubkey, 0, sizeof(*pubkey));\n    if (ret) {\n        secp256k1_ge_neg(&p, &p);\n        secp256k1_pubkey_save(pubkey, &p);\n    }\n    return ret;\n}\n\nint secp256k1_ec_privkey_tweak_add(const secp256k1_context* ctx, unsigned char *seckey, const unsigned char *tweak) {\n    secp256k1_scalar term;\n    secp256k1_scalar sec;\n    int ret = 0;\n    int overflow = 0;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(seckey != NULL);\n    ARG_CHECK(tweak != NULL);\n\n    secp256k1_scalar_set_b32(&term, tweak, &overflow);\n    secp256k1_scalar_set_b32(&sec, seckey, NULL);\n\n    ret = !overflow && secp256k1_eckey_privkey_tweak_add(&sec, &term);\n    memset(seckey, 0, 32);\n    if (ret) {\n        secp256k1_scalar_get_b32(seckey, &sec);\n    }\n\n    secp256k1_scalar_clear(&sec);\n    secp256k1_scalar_clear(&term);\n    return ret;\n}\n\nint secp256k1_ec_pubkey_tweak_add(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak) {\n    secp256k1_ge p;\n    secp256k1_scalar term;\n    int ret = 0;\n    int overflow = 0;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(secp256k1_ecmult_context_is_built(&ctx->ecmult_ctx));\n    ARG_CHECK(pubkey != NULL);\n    ARG_CHECK(tweak != NULL);\n\n    secp256k1_scalar_set_b32(&term, tweak, &overflow);\n    ret = !overflow && secp256k1_pubkey_load(ctx, &p, pubkey);\n    memset(pubkey, 0, sizeof(*pubkey));\n    if (ret) {\n        if (secp256k1_eckey_pubkey_tweak_add(&ctx->ecmult_ctx, &p, &term)) {\n            secp256k1_pubkey_save(pubkey, &p);\n        } else {\n            ret = 0;\n        }\n    }\n\n    return ret;\n}\n\nint secp256k1_ec_privkey_tweak_mul(const secp256k1_context* ctx, unsigned char *seckey, const unsigned char *tweak) {\n    secp256k1_scalar factor;\n    secp256k1_scalar sec;\n    int ret = 0;\n    int overflow = 0;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(seckey != NULL);\n    ARG_CHECK(tweak != NULL);\n\n    secp256k1_scalar_set_b32(&factor, tweak, &overflow);\n    secp256k1_scalar_set_b32(&sec, seckey, NULL);\n    ret = !overflow && secp256k1_eckey_privkey_tweak_mul(&sec, &factor);\n    memset(seckey, 0, 32);\n    if (ret) {\n        secp256k1_scalar_get_b32(seckey, &sec);\n    }\n\n    secp256k1_scalar_clear(&sec);\n    secp256k1_scalar_clear(&factor);\n    return ret;\n}\n\nint secp256k1_ec_pubkey_tweak_mul(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak) {\n    secp256k1_ge p;\n    secp256k1_scalar factor;\n    int ret = 0;\n    int overflow = 0;\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(secp256k1_ecmult_context_is_built(&ctx->ecmult_ctx));\n    ARG_CHECK(pubkey != NULL);\n    ARG_CHECK(tweak != NULL);\n\n    secp256k1_scalar_set_b32(&factor, tweak, &overflow);\n    ret = !overflow && secp256k1_pubkey_load(ctx, &p, pubkey);\n    memset(pubkey, 0, sizeof(*pubkey));\n    if (ret) {\n        if (secp256k1_eckey_pubkey_tweak_mul(&ctx->ecmult_ctx, &p, &factor)) {\n            secp256k1_pubkey_save(pubkey, &p);\n        } else {\n            ret = 0;\n        }\n    }\n\n    return ret;\n}\n\nint secp256k1_context_randomize(secp256k1_context* ctx, const unsigned char *seed32) {\n    VERIFY_CHECK(ctx != NULL);\n    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));\n    secp256k1_ecmult_gen_blind(&ctx->ecmult_gen_ctx, seed32);\n    return 1;\n}\n\nint secp256k1_ec_pubkey_combine(const secp256k1_context* ctx, secp256k1_pubkey *pubnonce, const secp256k1_pubkey * const *pubnonces, size_t n) {\n    size_t i;\n    secp256k1_gej Qj;\n    secp256k1_ge Q;\n\n    ARG_CHECK(pubnonce != NULL);\n    memset(pubnonce, 0, sizeof(*pubnonce));\n    ARG_CHECK(n >= 1);\n    ARG_CHECK(pubnonces != NULL);\n\n    secp256k1_gej_set_infinity(&Qj);\n\n    for (i = 0; i < n; i++) {\n        secp256k1_pubkey_load(ctx, &Q, pubnonces[i]);\n        secp256k1_gej_add_ge(&Qj, &Qj, &Q);\n    }\n    if (secp256k1_gej_is_infinity(&Qj)) {\n        return 0;\n    }\n    secp256k1_ge_set_gej(&Q, &Qj);\n    secp256k1_pubkey_save(pubnonce, &Q);\n    return 1;\n}\n\n#ifdef ENABLE_MODULE_ECDH\n# include \"modules/ecdh/main_impl.h\"\n#endif\n\n#ifdef ENABLE_MODULE_RECOVERY\n# include \"modules/recovery/main_impl.h\"\n#endif\n"
  },
  {
    "path": "src/secp256k1/src/testrand.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_TESTRAND_H\n#define SECP256K1_TESTRAND_H\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n/* A non-cryptographic RNG used only for test infrastructure. */\n\n/** Seed the pseudorandom number generator for testing. */\nSECP256K1_INLINE static void secp256k1_rand_seed(const unsigned char *seed16);\n\n/** Generate a pseudorandom number in the range [0..2**32-1]. */\nstatic uint32_t secp256k1_rand32(void);\n\n/** Generate a pseudorandom number in the range [0..2**bits-1]. Bits must be 1 or\n *  more. */\nstatic uint32_t secp256k1_rand_bits(int bits);\n\n/** Generate a pseudorandom number in the range [0..range-1]. */\nstatic uint32_t secp256k1_rand_int(uint32_t range);\n\n/** Generate a pseudorandom 32-byte array. */\nstatic void secp256k1_rand256(unsigned char *b32);\n\n/** Generate a pseudorandom 32-byte array with long sequences of zero and one bits. */\nstatic void secp256k1_rand256_test(unsigned char *b32);\n\n/** Generate pseudorandom bytes with long sequences of zero and one bits. */\nstatic void secp256k1_rand_bytes_test(unsigned char *bytes, size_t len);\n\n#endif /* SECP256K1_TESTRAND_H */\n"
  },
  {
    "path": "src/secp256k1/src/testrand_impl.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013-2015 Pieter Wuille                              *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_TESTRAND_IMPL_H\n#define SECP256K1_TESTRAND_IMPL_H\n\n#include <stdint.h>\n#include <string.h>\n\n#include \"testrand.h\"\n#include \"hash.h\"\n\nstatic secp256k1_rfc6979_hmac_sha256_t secp256k1_test_rng;\nstatic uint32_t secp256k1_test_rng_precomputed[8];\nstatic int secp256k1_test_rng_precomputed_used = 8;\nstatic uint64_t secp256k1_test_rng_integer;\nstatic int secp256k1_test_rng_integer_bits_left = 0;\n\nSECP256K1_INLINE static void secp256k1_rand_seed(const unsigned char *seed16) {\n    secp256k1_rfc6979_hmac_sha256_initialize(&secp256k1_test_rng, seed16, 16);\n}\n\nSECP256K1_INLINE static uint32_t secp256k1_rand32(void) {\n    if (secp256k1_test_rng_precomputed_used == 8) {\n        secp256k1_rfc6979_hmac_sha256_generate(&secp256k1_test_rng, (unsigned char*)(&secp256k1_test_rng_precomputed[0]), sizeof(secp256k1_test_rng_precomputed));\n        secp256k1_test_rng_precomputed_used = 0;\n    }\n    return secp256k1_test_rng_precomputed[secp256k1_test_rng_precomputed_used++];\n}\n\nstatic uint32_t secp256k1_rand_bits(int bits) {\n    uint32_t ret;\n    if (secp256k1_test_rng_integer_bits_left < bits) {\n        secp256k1_test_rng_integer |= (((uint64_t)secp256k1_rand32()) << secp256k1_test_rng_integer_bits_left);\n        secp256k1_test_rng_integer_bits_left += 32;\n    }\n    ret = secp256k1_test_rng_integer;\n    secp256k1_test_rng_integer >>= bits;\n    secp256k1_test_rng_integer_bits_left -= bits;\n    ret &= ((~((uint32_t)0)) >> (32 - bits));\n    return ret;\n}\n\nstatic uint32_t secp256k1_rand_int(uint32_t range) {\n    /* We want a uniform integer between 0 and range-1, inclusive.\n     * B is the smallest number such that range <= 2**B.\n     * two mechanisms implemented here:\n     * - generate B bits numbers until one below range is found, and return it\n     * - find the largest multiple M of range that is <= 2**(B+A), generate B+A\n     *   bits numbers until one below M is found, and return it modulo range\n     * The second mechanism consumes A more bits of entropy in every iteration,\n     * but may need fewer iterations due to M being closer to 2**(B+A) then\n     * range is to 2**B. The array below (indexed by B) contains a 0 when the\n     * first mechanism is to be used, and the number A otherwise.\n     */\n    static const int addbits[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0};\n    uint32_t trange, mult;\n    int bits = 0;\n    if (range <= 1) {\n        return 0;\n    }\n    trange = range - 1;\n    while (trange > 0) {\n        trange >>= 1;\n        bits++;\n    }\n    if (addbits[bits]) {\n        bits = bits + addbits[bits];\n        mult = ((~((uint32_t)0)) >> (32 - bits)) / range;\n        trange = range * mult;\n    } else {\n        trange = range;\n        mult = 1;\n    }\n    while(1) {\n        uint32_t x = secp256k1_rand_bits(bits);\n        if (x < trange) {\n            return (mult == 1) ? x : (x % range);\n        }\n    }\n}\n\nstatic void secp256k1_rand256(unsigned char *b32) {\n    secp256k1_rfc6979_hmac_sha256_generate(&secp256k1_test_rng, b32, 32);\n}\n\nstatic void secp256k1_rand_bytes_test(unsigned char *bytes, size_t len) {\n    size_t bits = 0;\n    memset(bytes, 0, len);\n    while (bits < len * 8) {\n        int now;\n        uint32_t val;\n        now = 1 + (secp256k1_rand_bits(6) * secp256k1_rand_bits(5) + 16) / 31;\n        val = secp256k1_rand_bits(1);\n        while (now > 0 && bits < len * 8) {\n            bytes[bits / 8] |= val << (bits % 8);\n            now--;\n            bits++;\n        }\n    }\n}\n\nstatic void secp256k1_rand256_test(unsigned char *b32) {\n    secp256k1_rand_bytes_test(b32, 32);\n}\n\n#endif /* SECP256K1_TESTRAND_IMPL_H */\n"
  },
  {
    "path": "src/secp256k1/src/tests.c",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014, 2015 Pieter Wuille, Gregory Maxwell      *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n#include <time.h>\n\n#include \"secp256k1.c\"\n#include \"include/secp256k1.h\"\n#include \"testrand_impl.h\"\n\n#ifdef ENABLE_OPENSSL_TESTS\n#include \"openssl/bn.h\"\n#include \"openssl/ec.h\"\n#include \"openssl/ecdsa.h\"\n#include \"openssl/obj_mac.h\"\n#endif\n\n#include \"contrib/lax_der_parsing.c\"\n#include \"contrib/lax_der_privatekey_parsing.c\"\n\n#if !defined(VG_CHECK)\n# if defined(VALGRIND)\n#  include <valgrind/memcheck.h>\n#  define VG_UNDEF(x,y) VALGRIND_MAKE_MEM_UNDEFINED((x),(y))\n#  define VG_CHECK(x,y) VALGRIND_CHECK_MEM_IS_DEFINED((x),(y))\n# else\n#  define VG_UNDEF(x,y)\n#  define VG_CHECK(x,y)\n# endif\n#endif\n\nstatic int count = 64;\nstatic secp256k1_context *ctx = NULL;\n\nstatic void counting_illegal_callback_fn(const char* str, void* data) {\n    /* Dummy callback function that just counts. */\n    int32_t *p;\n    (void)str;\n    p = data;\n    (*p)++;\n}\n\nstatic void uncounting_illegal_callback_fn(const char* str, void* data) {\n    /* Dummy callback function that just counts (backwards). */\n    int32_t *p;\n    (void)str;\n    p = data;\n    (*p)--;\n}\n\nvoid random_field_element_test(secp256k1_fe *fe) {\n    do {\n        unsigned char b32[32];\n        secp256k1_rand256_test(b32);\n        if (secp256k1_fe_set_b32(fe, b32)) {\n            break;\n        }\n    } while(1);\n}\n\nvoid random_field_element_magnitude(secp256k1_fe *fe) {\n    secp256k1_fe zero;\n    int n = secp256k1_rand_int(9);\n    secp256k1_fe_normalize(fe);\n    if (n == 0) {\n        return;\n    }\n    secp256k1_fe_clear(&zero);\n    secp256k1_fe_negate(&zero, &zero, 0);\n    secp256k1_fe_mul_int(&zero, n - 1);\n    secp256k1_fe_add(fe, &zero);\n    VERIFY_CHECK(fe->magnitude == n);\n}\n\nvoid random_group_element_test(secp256k1_ge *ge) {\n    secp256k1_fe fe;\n    do {\n        random_field_element_test(&fe);\n        if (secp256k1_ge_set_xo_var(ge, &fe, secp256k1_rand_bits(1))) {\n            secp256k1_fe_normalize(&ge->y);\n            break;\n        }\n    } while(1);\n}\n\nvoid random_group_element_jacobian_test(secp256k1_gej *gej, const secp256k1_ge *ge) {\n    secp256k1_fe z2, z3;\n    do {\n        random_field_element_test(&gej->z);\n        if (!secp256k1_fe_is_zero(&gej->z)) {\n            break;\n        }\n    } while(1);\n    secp256k1_fe_sqr(&z2, &gej->z);\n    secp256k1_fe_mul(&z3, &z2, &gej->z);\n    secp256k1_fe_mul(&gej->x, &ge->x, &z2);\n    secp256k1_fe_mul(&gej->y, &ge->y, &z3);\n    gej->infinity = ge->infinity;\n}\n\nvoid random_scalar_order_test(secp256k1_scalar *num) {\n    do {\n        unsigned char b32[32];\n        int overflow = 0;\n        secp256k1_rand256_test(b32);\n        secp256k1_scalar_set_b32(num, b32, &overflow);\n        if (overflow || secp256k1_scalar_is_zero(num)) {\n            continue;\n        }\n        break;\n    } while(1);\n}\n\nvoid random_scalar_order(secp256k1_scalar *num) {\n    do {\n        unsigned char b32[32];\n        int overflow = 0;\n        secp256k1_rand256(b32);\n        secp256k1_scalar_set_b32(num, b32, &overflow);\n        if (overflow || secp256k1_scalar_is_zero(num)) {\n            continue;\n        }\n        break;\n    } while(1);\n}\n\nvoid run_context_tests(void) {\n    secp256k1_pubkey pubkey;\n    secp256k1_pubkey zero_pubkey;\n    secp256k1_ecdsa_signature sig;\n    unsigned char ctmp[32];\n    int32_t ecount;\n    int32_t ecount2;\n    secp256k1_context *none = secp256k1_context_create(SECP256K1_CONTEXT_NONE);\n    secp256k1_context *sign = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);\n    secp256k1_context *vrfy = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY);\n    secp256k1_context *both = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);\n\n    secp256k1_gej pubj;\n    secp256k1_ge pub;\n    secp256k1_scalar msg, key, nonce;\n    secp256k1_scalar sigr, sigs;\n\n    memset(&zero_pubkey, 0, sizeof(zero_pubkey));\n\n    ecount = 0;\n    ecount2 = 10;\n    secp256k1_context_set_illegal_callback(vrfy, counting_illegal_callback_fn, &ecount);\n    secp256k1_context_set_illegal_callback(sign, counting_illegal_callback_fn, &ecount2);\n    secp256k1_context_set_error_callback(sign, counting_illegal_callback_fn, NULL);\n    CHECK(vrfy->error_callback.fn != sign->error_callback.fn);\n\n    /*** clone and destroy all of them to make sure cloning was complete ***/\n    {\n        secp256k1_context *ctx_tmp;\n\n        ctx_tmp = none; none = secp256k1_context_clone(none); secp256k1_context_destroy(ctx_tmp);\n        ctx_tmp = sign; sign = secp256k1_context_clone(sign); secp256k1_context_destroy(ctx_tmp);\n        ctx_tmp = vrfy; vrfy = secp256k1_context_clone(vrfy); secp256k1_context_destroy(ctx_tmp);\n        ctx_tmp = both; both = secp256k1_context_clone(both); secp256k1_context_destroy(ctx_tmp);\n    }\n\n    /* Verify that the error callback makes it across the clone. */\n    CHECK(vrfy->error_callback.fn != sign->error_callback.fn);\n    /* And that it resets back to default. */\n    secp256k1_context_set_error_callback(sign, NULL, NULL);\n    CHECK(vrfy->error_callback.fn == sign->error_callback.fn);\n\n    /*** attempt to use them ***/\n    random_scalar_order_test(&msg);\n    random_scalar_order_test(&key);\n    secp256k1_ecmult_gen(&both->ecmult_gen_ctx, &pubj, &key);\n    secp256k1_ge_set_gej(&pub, &pubj);\n\n    /* Verify context-type checking illegal-argument errors. */\n    memset(ctmp, 1, 32);\n    CHECK(secp256k1_ec_pubkey_create(vrfy, &pubkey, ctmp) == 0);\n    CHECK(ecount == 1);\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_create(sign, &pubkey, ctmp) == 1);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ecdsa_sign(vrfy, &sig, ctmp, ctmp, NULL, NULL) == 0);\n    CHECK(ecount == 2);\n    VG_UNDEF(&sig, sizeof(sig));\n    CHECK(secp256k1_ecdsa_sign(sign, &sig, ctmp, ctmp, NULL, NULL) == 1);\n    VG_CHECK(&sig, sizeof(sig));\n    CHECK(ecount2 == 10);\n    CHECK(secp256k1_ecdsa_verify(sign, &sig, ctmp, &pubkey) == 0);\n    CHECK(ecount2 == 11);\n    CHECK(secp256k1_ecdsa_verify(vrfy, &sig, ctmp, &pubkey) == 1);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ec_pubkey_tweak_add(sign, &pubkey, ctmp) == 0);\n    CHECK(ecount2 == 12);\n    CHECK(secp256k1_ec_pubkey_tweak_add(vrfy, &pubkey, ctmp) == 1);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ec_pubkey_tweak_mul(sign, &pubkey, ctmp) == 0);\n    CHECK(ecount2 == 13);\n    CHECK(secp256k1_ec_pubkey_negate(vrfy, &pubkey) == 1);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ec_pubkey_negate(sign, &pubkey) == 1);\n    CHECK(ecount == 2);\n    CHECK(secp256k1_ec_pubkey_negate(sign, NULL) == 0);\n    CHECK(ecount2 == 14);\n    CHECK(secp256k1_ec_pubkey_negate(vrfy, &zero_pubkey) == 0);\n    CHECK(ecount == 3);\n    CHECK(secp256k1_ec_pubkey_tweak_mul(vrfy, &pubkey, ctmp) == 1);\n    CHECK(ecount == 3);\n    CHECK(secp256k1_context_randomize(vrfy, ctmp) == 0);\n    CHECK(ecount == 4);\n    CHECK(secp256k1_context_randomize(sign, NULL) == 1);\n    CHECK(ecount2 == 14);\n    secp256k1_context_set_illegal_callback(vrfy, NULL, NULL);\n    secp256k1_context_set_illegal_callback(sign, NULL, NULL);\n\n    /* This shouldn't leak memory, due to already-set tests. */\n    secp256k1_ecmult_gen_context_build(&sign->ecmult_gen_ctx, NULL);\n    secp256k1_ecmult_context_build(&vrfy->ecmult_ctx, NULL);\n\n    /* obtain a working nonce */\n    do {\n        random_scalar_order_test(&nonce);\n    } while(!secp256k1_ecdsa_sig_sign(&both->ecmult_gen_ctx, &sigr, &sigs, &key, &msg, &nonce, NULL));\n\n    /* try signing */\n    CHECK(secp256k1_ecdsa_sig_sign(&sign->ecmult_gen_ctx, &sigr, &sigs, &key, &msg, &nonce, NULL));\n    CHECK(secp256k1_ecdsa_sig_sign(&both->ecmult_gen_ctx, &sigr, &sigs, &key, &msg, &nonce, NULL));\n\n    /* try verifying */\n    CHECK(secp256k1_ecdsa_sig_verify(&vrfy->ecmult_ctx, &sigr, &sigs, &pub, &msg));\n    CHECK(secp256k1_ecdsa_sig_verify(&both->ecmult_ctx, &sigr, &sigs, &pub, &msg));\n\n    /* cleanup */\n    secp256k1_context_destroy(none);\n    secp256k1_context_destroy(sign);\n    secp256k1_context_destroy(vrfy);\n    secp256k1_context_destroy(both);\n    /* Defined as no-op. */\n    secp256k1_context_destroy(NULL);\n}\n\n/***** HASH TESTS *****/\n\nvoid run_sha256_tests(void) {\n    static const char *inputs[8] = {\n        \"\", \"abc\", \"message digest\", \"secure hash algorithm\", \"SHA256 is considered to be safe\",\n        \"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\",\n        \"For this sample, this 63-byte string will be used as input data\",\n        \"This is exactly 64 bytes long, not counting the terminating byte\"\n    };\n    static const unsigned char outputs[8][32] = {\n        {0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55},\n        {0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea, 0x41, 0x41, 0x40, 0xde, 0x5d, 0xae, 0x22, 0x23, 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17, 0x7a, 0x9c, 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad},\n        {0xf7, 0x84, 0x6f, 0x55, 0xcf, 0x23, 0xe1, 0x4e, 0xeb, 0xea, 0xb5, 0xb4, 0xe1, 0x55, 0x0c, 0xad, 0x5b, 0x50, 0x9e, 0x33, 0x48, 0xfb, 0xc4, 0xef, 0xa3, 0xa1, 0x41, 0x3d, 0x39, 0x3c, 0xb6, 0x50},\n        {0xf3, 0x0c, 0xeb, 0x2b, 0xb2, 0x82, 0x9e, 0x79, 0xe4, 0xca, 0x97, 0x53, 0xd3, 0x5a, 0x8e, 0xcc, 0x00, 0x26, 0x2d, 0x16, 0x4c, 0xc0, 0x77, 0x08, 0x02, 0x95, 0x38, 0x1c, 0xbd, 0x64, 0x3f, 0x0d},\n        {0x68, 0x19, 0xd9, 0x15, 0xc7, 0x3f, 0x4d, 0x1e, 0x77, 0xe4, 0xe1, 0xb5, 0x2d, 0x1f, 0xa0, 0xf9, 0xcf, 0x9b, 0xea, 0xea, 0xd3, 0x93, 0x9f, 0x15, 0x87, 0x4b, 0xd9, 0x88, 0xe2, 0xa2, 0x36, 0x30},\n        {0x24, 0x8d, 0x6a, 0x61, 0xd2, 0x06, 0x38, 0xb8, 0xe5, 0xc0, 0x26, 0x93, 0x0c, 0x3e, 0x60, 0x39, 0xa3, 0x3c, 0xe4, 0x59, 0x64, 0xff, 0x21, 0x67, 0xf6, 0xec, 0xed, 0xd4, 0x19, 0xdb, 0x06, 0xc1},\n        {0xf0, 0x8a, 0x78, 0xcb, 0xba, 0xee, 0x08, 0x2b, 0x05, 0x2a, 0xe0, 0x70, 0x8f, 0x32, 0xfa, 0x1e, 0x50, 0xc5, 0xc4, 0x21, 0xaa, 0x77, 0x2b, 0xa5, 0xdb, 0xb4, 0x06, 0xa2, 0xea, 0x6b, 0xe3, 0x42},\n        {0xab, 0x64, 0xef, 0xf7, 0xe8, 0x8e, 0x2e, 0x46, 0x16, 0x5e, 0x29, 0xf2, 0xbc, 0xe4, 0x18, 0x26, 0xbd, 0x4c, 0x7b, 0x35, 0x52, 0xf6, 0xb3, 0x82, 0xa9, 0xe7, 0xd3, 0xaf, 0x47, 0xc2, 0x45, 0xf8}\n    };\n    int i;\n    for (i = 0; i < 8; i++) {\n        unsigned char out[32];\n        secp256k1_sha256_t hasher;\n        secp256k1_sha256_initialize(&hasher);\n        secp256k1_sha256_write(&hasher, (const unsigned char*)(inputs[i]), strlen(inputs[i]));\n        secp256k1_sha256_finalize(&hasher, out);\n        CHECK(memcmp(out, outputs[i], 32) == 0);\n        if (strlen(inputs[i]) > 0) {\n            int split = secp256k1_rand_int(strlen(inputs[i]));\n            secp256k1_sha256_initialize(&hasher);\n            secp256k1_sha256_write(&hasher, (const unsigned char*)(inputs[i]), split);\n            secp256k1_sha256_write(&hasher, (const unsigned char*)(inputs[i] + split), strlen(inputs[i]) - split);\n            secp256k1_sha256_finalize(&hasher, out);\n            CHECK(memcmp(out, outputs[i], 32) == 0);\n        }\n    }\n}\n\nvoid run_hmac_sha256_tests(void) {\n    static const char *keys[6] = {\n        \"\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\\x0b\",\n        \"\\x4a\\x65\\x66\\x65\",\n        \"\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\",\n        \"\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\",\n        \"\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\",\n        \"\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\\xaa\"\n    };\n    static const char *inputs[6] = {\n        \"\\x48\\x69\\x20\\x54\\x68\\x65\\x72\\x65\",\n        \"\\x77\\x68\\x61\\x74\\x20\\x64\\x6f\\x20\\x79\\x61\\x20\\x77\\x61\\x6e\\x74\\x20\\x66\\x6f\\x72\\x20\\x6e\\x6f\\x74\\x68\\x69\\x6e\\x67\\x3f\",\n        \"\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\",\n        \"\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\\xcd\",\n        \"\\x54\\x65\\x73\\x74\\x20\\x55\\x73\\x69\\x6e\\x67\\x20\\x4c\\x61\\x72\\x67\\x65\\x72\\x20\\x54\\x68\\x61\\x6e\\x20\\x42\\x6c\\x6f\\x63\\x6b\\x2d\\x53\\x69\\x7a\\x65\\x20\\x4b\\x65\\x79\\x20\\x2d\\x20\\x48\\x61\\x73\\x68\\x20\\x4b\\x65\\x79\\x20\\x46\\x69\\x72\\x73\\x74\",\n        \"\\x54\\x68\\x69\\x73\\x20\\x69\\x73\\x20\\x61\\x20\\x74\\x65\\x73\\x74\\x20\\x75\\x73\\x69\\x6e\\x67\\x20\\x61\\x20\\x6c\\x61\\x72\\x67\\x65\\x72\\x20\\x74\\x68\\x61\\x6e\\x20\\x62\\x6c\\x6f\\x63\\x6b\\x2d\\x73\\x69\\x7a\\x65\\x20\\x6b\\x65\\x79\\x20\\x61\\x6e\\x64\\x20\\x61\\x20\\x6c\\x61\\x72\\x67\\x65\\x72\\x20\\x74\\x68\\x61\\x6e\\x20\\x62\\x6c\\x6f\\x63\\x6b\\x2d\\x73\\x69\\x7a\\x65\\x20\\x64\\x61\\x74\\x61\\x2e\\x20\\x54\\x68\\x65\\x20\\x6b\\x65\\x79\\x20\\x6e\\x65\\x65\\x64\\x73\\x20\\x74\\x6f\\x20\\x62\\x65\\x20\\x68\\x61\\x73\\x68\\x65\\x64\\x20\\x62\\x65\\x66\\x6f\\x72\\x65\\x20\\x62\\x65\\x69\\x6e\\x67\\x20\\x75\\x73\\x65\\x64\\x20\\x62\\x79\\x20\\x74\\x68\\x65\\x20\\x48\\x4d\\x41\\x43\\x20\\x61\\x6c\\x67\\x6f\\x72\\x69\\x74\\x68\\x6d\\x2e\"\n    };\n    static const unsigned char outputs[6][32] = {\n        {0xb0, 0x34, 0x4c, 0x61, 0xd8, 0xdb, 0x38, 0x53, 0x5c, 0xa8, 0xaf, 0xce, 0xaf, 0x0b, 0xf1, 0x2b, 0x88, 0x1d, 0xc2, 0x00, 0xc9, 0x83, 0x3d, 0xa7, 0x26, 0xe9, 0x37, 0x6c, 0x2e, 0x32, 0xcf, 0xf7},\n        {0x5b, 0xdc, 0xc1, 0x46, 0xbf, 0x60, 0x75, 0x4e, 0x6a, 0x04, 0x24, 0x26, 0x08, 0x95, 0x75, 0xc7, 0x5a, 0x00, 0x3f, 0x08, 0x9d, 0x27, 0x39, 0x83, 0x9d, 0xec, 0x58, 0xb9, 0x64, 0xec, 0x38, 0x43},\n        {0x77, 0x3e, 0xa9, 0x1e, 0x36, 0x80, 0x0e, 0x46, 0x85, 0x4d, 0xb8, 0xeb, 0xd0, 0x91, 0x81, 0xa7, 0x29, 0x59, 0x09, 0x8b, 0x3e, 0xf8, 0xc1, 0x22, 0xd9, 0x63, 0x55, 0x14, 0xce, 0xd5, 0x65, 0xfe},\n        {0x82, 0x55, 0x8a, 0x38, 0x9a, 0x44, 0x3c, 0x0e, 0xa4, 0xcc, 0x81, 0x98, 0x99, 0xf2, 0x08, 0x3a, 0x85, 0xf0, 0xfa, 0xa3, 0xe5, 0x78, 0xf8, 0x07, 0x7a, 0x2e, 0x3f, 0xf4, 0x67, 0x29, 0x66, 0x5b},\n        {0x60, 0xe4, 0x31, 0x59, 0x1e, 0xe0, 0xb6, 0x7f, 0x0d, 0x8a, 0x26, 0xaa, 0xcb, 0xf5, 0xb7, 0x7f, 0x8e, 0x0b, 0xc6, 0x21, 0x37, 0x28, 0xc5, 0x14, 0x05, 0x46, 0x04, 0x0f, 0x0e, 0xe3, 0x7f, 0x54},\n        {0x9b, 0x09, 0xff, 0xa7, 0x1b, 0x94, 0x2f, 0xcb, 0x27, 0x63, 0x5f, 0xbc, 0xd5, 0xb0, 0xe9, 0x44, 0xbf, 0xdc, 0x63, 0x64, 0x4f, 0x07, 0x13, 0x93, 0x8a, 0x7f, 0x51, 0x53, 0x5c, 0x3a, 0x35, 0xe2}\n    };\n    int i;\n    for (i = 0; i < 6; i++) {\n        secp256k1_hmac_sha256_t hasher;\n        unsigned char out[32];\n        secp256k1_hmac_sha256_initialize(&hasher, (const unsigned char*)(keys[i]), strlen(keys[i]));\n        secp256k1_hmac_sha256_write(&hasher, (const unsigned char*)(inputs[i]), strlen(inputs[i]));\n        secp256k1_hmac_sha256_finalize(&hasher, out);\n        CHECK(memcmp(out, outputs[i], 32) == 0);\n        if (strlen(inputs[i]) > 0) {\n            int split = secp256k1_rand_int(strlen(inputs[i]));\n            secp256k1_hmac_sha256_initialize(&hasher, (const unsigned char*)(keys[i]), strlen(keys[i]));\n            secp256k1_hmac_sha256_write(&hasher, (const unsigned char*)(inputs[i]), split);\n            secp256k1_hmac_sha256_write(&hasher, (const unsigned char*)(inputs[i] + split), strlen(inputs[i]) - split);\n            secp256k1_hmac_sha256_finalize(&hasher, out);\n            CHECK(memcmp(out, outputs[i], 32) == 0);\n        }\n    }\n}\n\nvoid run_rfc6979_hmac_sha256_tests(void) {\n    static const unsigned char key1[65] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x4b, 0xf5, 0x12, 0x2f, 0x34, 0x45, 0x54, 0xc5, 0x3b, 0xde, 0x2e, 0xbb, 0x8c, 0xd2, 0xb7, 0xe3, 0xd1, 0x60, 0x0a, 0xd6, 0x31, 0xc3, 0x85, 0xa5, 0xd7, 0xcc, 0xe2, 0x3c, 0x77, 0x85, 0x45, 0x9a, 0};\n    static const unsigned char out1[3][32] = {\n        {0x4f, 0xe2, 0x95, 0x25, 0xb2, 0x08, 0x68, 0x09, 0x15, 0x9a, 0xcd, 0xf0, 0x50, 0x6e, 0xfb, 0x86, 0xb0, 0xec, 0x93, 0x2c, 0x7b, 0xa4, 0x42, 0x56, 0xab, 0x32, 0x1e, 0x42, 0x1e, 0x67, 0xe9, 0xfb},\n        {0x2b, 0xf0, 0xff, 0xf1, 0xd3, 0xc3, 0x78, 0xa2, 0x2d, 0xc5, 0xde, 0x1d, 0x85, 0x65, 0x22, 0x32, 0x5c, 0x65, 0xb5, 0x04, 0x49, 0x1a, 0x0c, 0xbd, 0x01, 0xcb, 0x8f, 0x3a, 0xa6, 0x7f, 0xfd, 0x4a},\n        {0xf5, 0x28, 0xb4, 0x10, 0xcb, 0x54, 0x1f, 0x77, 0x00, 0x0d, 0x7a, 0xfb, 0x6c, 0x5b, 0x53, 0xc5, 0xc4, 0x71, 0xea, 0xb4, 0x3e, 0x46, 0x6d, 0x9a, 0xc5, 0x19, 0x0c, 0x39, 0xc8, 0x2f, 0xd8, 0x2e}\n    };\n\n    static const unsigned char key2[64] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55};\n    static const unsigned char out2[3][32] = {\n        {0x9c, 0x23, 0x6c, 0x16, 0x5b, 0x82, 0xae, 0x0c, 0xd5, 0x90, 0x65, 0x9e, 0x10, 0x0b, 0x6b, 0xab, 0x30, 0x36, 0xe7, 0xba, 0x8b, 0x06, 0x74, 0x9b, 0xaf, 0x69, 0x81, 0xe1, 0x6f, 0x1a, 0x2b, 0x95},\n        {0xdf, 0x47, 0x10, 0x61, 0x62, 0x5b, 0xc0, 0xea, 0x14, 0xb6, 0x82, 0xfe, 0xee, 0x2c, 0x9c, 0x02, 0xf2, 0x35, 0xda, 0x04, 0x20, 0x4c, 0x1d, 0x62, 0xa1, 0x53, 0x6c, 0x6e, 0x17, 0xae, 0xd7, 0xa9},\n        {0x75, 0x97, 0x88, 0x7c, 0xbd, 0x76, 0x32, 0x1f, 0x32, 0xe3, 0x04, 0x40, 0x67, 0x9a, 0x22, 0xcf, 0x7f, 0x8d, 0x9d, 0x2e, 0xac, 0x39, 0x0e, 0x58, 0x1f, 0xea, 0x09, 0x1c, 0xe2, 0x02, 0xba, 0x94}\n    };\n\n    secp256k1_rfc6979_hmac_sha256_t rng;\n    unsigned char out[32];\n    int i;\n\n    secp256k1_rfc6979_hmac_sha256_initialize(&rng, key1, 64);\n    for (i = 0; i < 3; i++) {\n        secp256k1_rfc6979_hmac_sha256_generate(&rng, out, 32);\n        CHECK(memcmp(out, out1[i], 32) == 0);\n    }\n    secp256k1_rfc6979_hmac_sha256_finalize(&rng);\n\n    secp256k1_rfc6979_hmac_sha256_initialize(&rng, key1, 65);\n    for (i = 0; i < 3; i++) {\n        secp256k1_rfc6979_hmac_sha256_generate(&rng, out, 32);\n        CHECK(memcmp(out, out1[i], 32) != 0);\n    }\n    secp256k1_rfc6979_hmac_sha256_finalize(&rng);\n\n    secp256k1_rfc6979_hmac_sha256_initialize(&rng, key2, 64);\n    for (i = 0; i < 3; i++) {\n        secp256k1_rfc6979_hmac_sha256_generate(&rng, out, 32);\n        CHECK(memcmp(out, out2[i], 32) == 0);\n    }\n    secp256k1_rfc6979_hmac_sha256_finalize(&rng);\n}\n\n/***** RANDOM TESTS *****/\n\nvoid test_rand_bits(int rand32, int bits) {\n    /* (1-1/2^B)^rounds[B] < 1/10^9, so rounds is the number of iterations to\n     * get a false negative chance below once in a billion */\n    static const unsigned int rounds[7] = {1, 30, 73, 156, 322, 653, 1316};\n    /* We try multiplying the results with various odd numbers, which shouldn't\n     * influence the uniform distribution modulo a power of 2. */\n    static const uint32_t mults[6] = {1, 3, 21, 289, 0x9999, 0x80402011};\n    /* We only select up to 6 bits from the output to analyse */\n    unsigned int usebits = bits > 6 ? 6 : bits;\n    unsigned int maxshift = bits - usebits;\n    /* For each of the maxshift+1 usebits-bit sequences inside a bits-bit\n       number, track all observed outcomes, one per bit in a uint64_t. */\n    uint64_t x[6][27] = {{0}};\n    unsigned int i, shift, m;\n    /* Multiply the output of all rand calls with the odd number m, which\n       should not change the uniformity of its distribution. */\n    for (i = 0; i < rounds[usebits]; i++) {\n        uint32_t r = (rand32 ? secp256k1_rand32() : secp256k1_rand_bits(bits));\n        CHECK((((uint64_t)r) >> bits) == 0);\n        for (m = 0; m < sizeof(mults) / sizeof(mults[0]); m++) {\n            uint32_t rm = r * mults[m];\n            for (shift = 0; shift <= maxshift; shift++) {\n                x[m][shift] |= (((uint64_t)1) << ((rm >> shift) & ((1 << usebits) - 1)));\n            }\n        }\n    }\n    for (m = 0; m < sizeof(mults) / sizeof(mults[0]); m++) {\n        for (shift = 0; shift <= maxshift; shift++) {\n            /* Test that the lower usebits bits of x[shift] are 1 */\n            CHECK(((~x[m][shift]) << (64 - (1 << usebits))) == 0);\n        }\n    }\n}\n\n/* Subrange must be a whole divisor of range, and at most 64 */\nvoid test_rand_int(uint32_t range, uint32_t subrange) {\n    /* (1-1/subrange)^rounds < 1/10^9 */\n    int rounds = (subrange * 2073) / 100;\n    int i;\n    uint64_t x = 0;\n    CHECK((range % subrange) == 0);\n    for (i = 0; i < rounds; i++) {\n        uint32_t r = secp256k1_rand_int(range);\n        CHECK(r < range);\n        r = r % subrange;\n        x |= (((uint64_t)1) << r);\n    }\n    /* Test that the lower subrange bits of x are 1. */\n    CHECK(((~x) << (64 - subrange)) == 0);\n}\n\nvoid run_rand_bits(void) {\n    size_t b;\n    test_rand_bits(1, 32);\n    for (b = 1; b <= 32; b++) {\n        test_rand_bits(0, b);\n    }\n}\n\nvoid run_rand_int(void) {\n    static const uint32_t ms[] = {1, 3, 17, 1000, 13771, 999999, 33554432};\n    static const uint32_t ss[] = {1, 3, 6, 9, 13, 31, 64};\n    unsigned int m, s;\n    for (m = 0; m < sizeof(ms) / sizeof(ms[0]); m++) {\n        for (s = 0; s < sizeof(ss) / sizeof(ss[0]); s++) {\n            test_rand_int(ms[m] * ss[s], ss[s]);\n        }\n    }\n}\n\n/***** NUM TESTS *****/\n\n#ifndef USE_NUM_NONE\nvoid random_num_negate(secp256k1_num *num) {\n    if (secp256k1_rand_bits(1)) {\n        secp256k1_num_negate(num);\n    }\n}\n\nvoid random_num_order_test(secp256k1_num *num) {\n    secp256k1_scalar sc;\n    random_scalar_order_test(&sc);\n    secp256k1_scalar_get_num(num, &sc);\n}\n\nvoid random_num_order(secp256k1_num *num) {\n    secp256k1_scalar sc;\n    random_scalar_order(&sc);\n    secp256k1_scalar_get_num(num, &sc);\n}\n\nvoid test_num_negate(void) {\n    secp256k1_num n1;\n    secp256k1_num n2;\n    random_num_order_test(&n1); /* n1 = R */\n    random_num_negate(&n1);\n    secp256k1_num_copy(&n2, &n1); /* n2 = R */\n    secp256k1_num_sub(&n1, &n2, &n1); /* n1 = n2-n1 = 0 */\n    CHECK(secp256k1_num_is_zero(&n1));\n    secp256k1_num_copy(&n1, &n2); /* n1 = R */\n    secp256k1_num_negate(&n1); /* n1 = -R */\n    CHECK(!secp256k1_num_is_zero(&n1));\n    secp256k1_num_add(&n1, &n2, &n1); /* n1 = n2+n1 = 0 */\n    CHECK(secp256k1_num_is_zero(&n1));\n    secp256k1_num_copy(&n1, &n2); /* n1 = R */\n    secp256k1_num_negate(&n1); /* n1 = -R */\n    CHECK(secp256k1_num_is_neg(&n1) != secp256k1_num_is_neg(&n2));\n    secp256k1_num_negate(&n1); /* n1 = R */\n    CHECK(secp256k1_num_eq(&n1, &n2));\n}\n\nvoid test_num_add_sub(void) {\n    int i;\n    secp256k1_scalar s;\n    secp256k1_num n1;\n    secp256k1_num n2;\n    secp256k1_num n1p2, n2p1, n1m2, n2m1;\n    random_num_order_test(&n1); /* n1 = R1 */\n    if (secp256k1_rand_bits(1)) {\n        random_num_negate(&n1);\n    }\n    random_num_order_test(&n2); /* n2 = R2 */\n    if (secp256k1_rand_bits(1)) {\n        random_num_negate(&n2);\n    }\n    secp256k1_num_add(&n1p2, &n1, &n2); /* n1p2 = R1 + R2 */\n    secp256k1_num_add(&n2p1, &n2, &n1); /* n2p1 = R2 + R1 */\n    secp256k1_num_sub(&n1m2, &n1, &n2); /* n1m2 = R1 - R2 */\n    secp256k1_num_sub(&n2m1, &n2, &n1); /* n2m1 = R2 - R1 */\n    CHECK(secp256k1_num_eq(&n1p2, &n2p1));\n    CHECK(!secp256k1_num_eq(&n1p2, &n1m2));\n    secp256k1_num_negate(&n2m1); /* n2m1 = -R2 + R1 */\n    CHECK(secp256k1_num_eq(&n2m1, &n1m2));\n    CHECK(!secp256k1_num_eq(&n2m1, &n1));\n    secp256k1_num_add(&n2m1, &n2m1, &n2); /* n2m1 = -R2 + R1 + R2 = R1 */\n    CHECK(secp256k1_num_eq(&n2m1, &n1));\n    CHECK(!secp256k1_num_eq(&n2p1, &n1));\n    secp256k1_num_sub(&n2p1, &n2p1, &n2); /* n2p1 = R2 + R1 - R2 = R1 */\n    CHECK(secp256k1_num_eq(&n2p1, &n1));\n\n    /* check is_one */\n    secp256k1_scalar_set_int(&s, 1);\n    secp256k1_scalar_get_num(&n1, &s);\n    CHECK(secp256k1_num_is_one(&n1));\n    /* check that 2^n + 1 is never 1 */\n    secp256k1_scalar_get_num(&n2, &s);\n    for (i = 0; i < 250; ++i) {\n        secp256k1_num_add(&n1, &n1, &n1);    /* n1 *= 2 */\n        secp256k1_num_add(&n1p2, &n1, &n2);  /* n1p2 = n1 + 1 */\n        CHECK(!secp256k1_num_is_one(&n1p2));\n    }\n}\n\nvoid test_num_mod(void) {\n    int i;\n    secp256k1_scalar s;\n    secp256k1_num order, n;\n\n    /* check that 0 mod anything is 0 */\n    random_scalar_order_test(&s);\n    secp256k1_scalar_get_num(&order, &s);\n    secp256k1_scalar_set_int(&s, 0);\n    secp256k1_scalar_get_num(&n, &s);\n    secp256k1_num_mod(&n, &order);\n    CHECK(secp256k1_num_is_zero(&n));\n\n    /* check that anything mod 1 is 0 */\n    secp256k1_scalar_set_int(&s, 1);\n    secp256k1_scalar_get_num(&order, &s);\n    secp256k1_scalar_get_num(&n, &s);\n    secp256k1_num_mod(&n, &order);\n    CHECK(secp256k1_num_is_zero(&n));\n\n    /* check that increasing the number past 2^256 does not break this */\n    random_scalar_order_test(&s);\n    secp256k1_scalar_get_num(&n, &s);\n    /* multiply by 2^8, which'll test this case with high probability */\n    for (i = 0; i < 8; ++i) {\n        secp256k1_num_add(&n, &n, &n);\n    }\n    secp256k1_num_mod(&n, &order);\n    CHECK(secp256k1_num_is_zero(&n));\n}\n\nvoid test_num_jacobi(void) {\n    secp256k1_scalar sqr;\n    secp256k1_scalar small;\n    secp256k1_scalar five;  /* five is not a quadratic residue */\n    secp256k1_num order, n;\n    int i;\n    /* squares mod 5 are 1, 4 */\n    const int jacobi5[10] = { 0, 1, -1, -1, 1, 0, 1, -1, -1, 1 };\n\n    /* check some small values with 5 as the order */\n    secp256k1_scalar_set_int(&five, 5);\n    secp256k1_scalar_get_num(&order, &five);\n    for (i = 0; i < 10; ++i) {\n        secp256k1_scalar_set_int(&small, i);\n        secp256k1_scalar_get_num(&n, &small);\n        CHECK(secp256k1_num_jacobi(&n, &order) == jacobi5[i]);\n    }\n\n    /** test large values with 5 as group order */\n    secp256k1_scalar_get_num(&order, &five);\n    /* we first need a scalar which is not a multiple of 5 */\n    do {\n        secp256k1_num fiven;\n        random_scalar_order_test(&sqr);\n        secp256k1_scalar_get_num(&fiven, &five);\n        secp256k1_scalar_get_num(&n, &sqr);\n        secp256k1_num_mod(&n, &fiven);\n    } while (secp256k1_num_is_zero(&n));\n    /* next force it to be a residue. 2 is a nonresidue mod 5 so we can\n     * just multiply by two, i.e. add the number to itself */\n    if (secp256k1_num_jacobi(&n, &order) == -1) {\n        secp256k1_num_add(&n, &n, &n);\n    }\n\n    /* test residue */\n    CHECK(secp256k1_num_jacobi(&n, &order) == 1);\n    /* test nonresidue */\n    secp256k1_num_add(&n, &n, &n);\n    CHECK(secp256k1_num_jacobi(&n, &order) == -1);\n\n    /** test with secp group order as order */\n    secp256k1_scalar_order_get_num(&order);\n    random_scalar_order_test(&sqr);\n    secp256k1_scalar_sqr(&sqr, &sqr);\n    /* test residue */\n    secp256k1_scalar_get_num(&n, &sqr);\n    CHECK(secp256k1_num_jacobi(&n, &order) == 1);\n    /* test nonresidue */\n    secp256k1_scalar_mul(&sqr, &sqr, &five);\n    secp256k1_scalar_get_num(&n, &sqr);\n    CHECK(secp256k1_num_jacobi(&n, &order) == -1);\n    /* test multiple of the order*/\n    CHECK(secp256k1_num_jacobi(&order, &order) == 0);\n\n    /* check one less than the order */\n    secp256k1_scalar_set_int(&small, 1);\n    secp256k1_scalar_get_num(&n, &small);\n    secp256k1_num_sub(&n, &order, &n);\n    CHECK(secp256k1_num_jacobi(&n, &order) == 1);  /* sage confirms this is 1 */\n}\n\nvoid run_num_smalltests(void) {\n    int i;\n    for (i = 0; i < 100*count; i++) {\n        test_num_negate();\n        test_num_add_sub();\n        test_num_mod();\n        test_num_jacobi();\n    }\n}\n#endif\n\n/***** SCALAR TESTS *****/\n\nvoid scalar_test(void) {\n    secp256k1_scalar s;\n    secp256k1_scalar s1;\n    secp256k1_scalar s2;\n#ifndef USE_NUM_NONE\n    secp256k1_num snum, s1num, s2num;\n    secp256k1_num order, half_order;\n#endif\n    unsigned char c[32];\n\n    /* Set 's' to a random scalar, with value 'snum'. */\n    random_scalar_order_test(&s);\n\n    /* Set 's1' to a random scalar, with value 's1num'. */\n    random_scalar_order_test(&s1);\n\n    /* Set 's2' to a random scalar, with value 'snum2', and byte array representation 'c'. */\n    random_scalar_order_test(&s2);\n    secp256k1_scalar_get_b32(c, &s2);\n\n#ifndef USE_NUM_NONE\n    secp256k1_scalar_get_num(&snum, &s);\n    secp256k1_scalar_get_num(&s1num, &s1);\n    secp256k1_scalar_get_num(&s2num, &s2);\n\n    secp256k1_scalar_order_get_num(&order);\n    half_order = order;\n    secp256k1_num_shift(&half_order, 1);\n#endif\n\n    {\n        int i;\n        /* Test that fetching groups of 4 bits from a scalar and recursing n(i)=16*n(i-1)+p(i) reconstructs it. */\n        secp256k1_scalar n;\n        secp256k1_scalar_set_int(&n, 0);\n        for (i = 0; i < 256; i += 4) {\n            secp256k1_scalar t;\n            int j;\n            secp256k1_scalar_set_int(&t, secp256k1_scalar_get_bits(&s, 256 - 4 - i, 4));\n            for (j = 0; j < 4; j++) {\n                secp256k1_scalar_add(&n, &n, &n);\n            }\n            secp256k1_scalar_add(&n, &n, &t);\n        }\n        CHECK(secp256k1_scalar_eq(&n, &s));\n    }\n\n    {\n        /* Test that fetching groups of randomly-sized bits from a scalar and recursing n(i)=b*n(i-1)+p(i) reconstructs it. */\n        secp256k1_scalar n;\n        int i = 0;\n        secp256k1_scalar_set_int(&n, 0);\n        while (i < 256) {\n            secp256k1_scalar t;\n            int j;\n            int now = secp256k1_rand_int(15) + 1;\n            if (now + i > 256) {\n                now = 256 - i;\n            }\n            secp256k1_scalar_set_int(&t, secp256k1_scalar_get_bits_var(&s, 256 - now - i, now));\n            for (j = 0; j < now; j++) {\n                secp256k1_scalar_add(&n, &n, &n);\n            }\n            secp256k1_scalar_add(&n, &n, &t);\n            i += now;\n        }\n        CHECK(secp256k1_scalar_eq(&n, &s));\n    }\n\n#ifndef USE_NUM_NONE\n    {\n        /* Test that adding the scalars together is equal to adding their numbers together modulo the order. */\n        secp256k1_num rnum;\n        secp256k1_num r2num;\n        secp256k1_scalar r;\n        secp256k1_num_add(&rnum, &snum, &s2num);\n        secp256k1_num_mod(&rnum, &order);\n        secp256k1_scalar_add(&r, &s, &s2);\n        secp256k1_scalar_get_num(&r2num, &r);\n        CHECK(secp256k1_num_eq(&rnum, &r2num));\n    }\n\n    {\n        /* Test that multiplying the scalars is equal to multiplying their numbers modulo the order. */\n        secp256k1_scalar r;\n        secp256k1_num r2num;\n        secp256k1_num rnum;\n        secp256k1_num_mul(&rnum, &snum, &s2num);\n        secp256k1_num_mod(&rnum, &order);\n        secp256k1_scalar_mul(&r, &s, &s2);\n        secp256k1_scalar_get_num(&r2num, &r);\n        CHECK(secp256k1_num_eq(&rnum, &r2num));\n        /* The result can only be zero if at least one of the factors was zero. */\n        CHECK(secp256k1_scalar_is_zero(&r) == (secp256k1_scalar_is_zero(&s) || secp256k1_scalar_is_zero(&s2)));\n        /* The results can only be equal to one of the factors if that factor was zero, or the other factor was one. */\n        CHECK(secp256k1_num_eq(&rnum, &snum) == (secp256k1_scalar_is_zero(&s) || secp256k1_scalar_is_one(&s2)));\n        CHECK(secp256k1_num_eq(&rnum, &s2num) == (secp256k1_scalar_is_zero(&s2) || secp256k1_scalar_is_one(&s)));\n    }\n\n    {\n        secp256k1_scalar neg;\n        secp256k1_num negnum;\n        secp256k1_num negnum2;\n        /* Check that comparison with zero matches comparison with zero on the number. */\n        CHECK(secp256k1_num_is_zero(&snum) == secp256k1_scalar_is_zero(&s));\n        /* Check that comparison with the half order is equal to testing for high scalar. */\n        CHECK(secp256k1_scalar_is_high(&s) == (secp256k1_num_cmp(&snum, &half_order) > 0));\n        secp256k1_scalar_negate(&neg, &s);\n        secp256k1_num_sub(&negnum, &order, &snum);\n        secp256k1_num_mod(&negnum, &order);\n        /* Check that comparison with the half order is equal to testing for high scalar after negation. */\n        CHECK(secp256k1_scalar_is_high(&neg) == (secp256k1_num_cmp(&negnum, &half_order) > 0));\n        /* Negating should change the high property, unless the value was already zero. */\n        CHECK((secp256k1_scalar_is_high(&s) == secp256k1_scalar_is_high(&neg)) == secp256k1_scalar_is_zero(&s));\n        secp256k1_scalar_get_num(&negnum2, &neg);\n        /* Negating a scalar should be equal to (order - n) mod order on the number. */\n        CHECK(secp256k1_num_eq(&negnum, &negnum2));\n        secp256k1_scalar_add(&neg, &neg, &s);\n        /* Adding a number to its negation should result in zero. */\n        CHECK(secp256k1_scalar_is_zero(&neg));\n        secp256k1_scalar_negate(&neg, &neg);\n        /* Negating zero should still result in zero. */\n        CHECK(secp256k1_scalar_is_zero(&neg));\n    }\n\n    {\n        /* Test secp256k1_scalar_mul_shift_var. */\n        secp256k1_scalar r;\n        secp256k1_num one;\n        secp256k1_num rnum;\n        secp256k1_num rnum2;\n        unsigned char cone[1] = {0x01};\n        unsigned int shift = 256 + secp256k1_rand_int(257);\n        secp256k1_scalar_mul_shift_var(&r, &s1, &s2, shift);\n        secp256k1_num_mul(&rnum, &s1num, &s2num);\n        secp256k1_num_shift(&rnum, shift - 1);\n        secp256k1_num_set_bin(&one, cone, 1);\n        secp256k1_num_add(&rnum, &rnum, &one);\n        secp256k1_num_shift(&rnum, 1);\n        secp256k1_scalar_get_num(&rnum2, &r);\n        CHECK(secp256k1_num_eq(&rnum, &rnum2));\n    }\n\n    {\n        /* test secp256k1_scalar_shr_int */\n        secp256k1_scalar r;\n        int i;\n        random_scalar_order_test(&r);\n        for (i = 0; i < 100; ++i) {\n            int low;\n            int shift = 1 + secp256k1_rand_int(15);\n            int expected = r.d[0] % (1 << shift);\n            low = secp256k1_scalar_shr_int(&r, shift);\n            CHECK(expected == low);\n        }\n    }\n#endif\n\n    {\n        /* Test that scalar inverses are equal to the inverse of their number modulo the order. */\n        if (!secp256k1_scalar_is_zero(&s)) {\n            secp256k1_scalar inv;\n#ifndef USE_NUM_NONE\n            secp256k1_num invnum;\n            secp256k1_num invnum2;\n#endif\n            secp256k1_scalar_inverse(&inv, &s);\n#ifndef USE_NUM_NONE\n            secp256k1_num_mod_inverse(&invnum, &snum, &order);\n            secp256k1_scalar_get_num(&invnum2, &inv);\n            CHECK(secp256k1_num_eq(&invnum, &invnum2));\n#endif\n            secp256k1_scalar_mul(&inv, &inv, &s);\n            /* Multiplying a scalar with its inverse must result in one. */\n            CHECK(secp256k1_scalar_is_one(&inv));\n            secp256k1_scalar_inverse(&inv, &inv);\n            /* Inverting one must result in one. */\n            CHECK(secp256k1_scalar_is_one(&inv));\n#ifndef USE_NUM_NONE\n            secp256k1_scalar_get_num(&invnum, &inv);\n            CHECK(secp256k1_num_is_one(&invnum));\n#endif\n        }\n    }\n\n    {\n        /* Test commutativity of add. */\n        secp256k1_scalar r1, r2;\n        secp256k1_scalar_add(&r1, &s1, &s2);\n        secp256k1_scalar_add(&r2, &s2, &s1);\n        CHECK(secp256k1_scalar_eq(&r1, &r2));\n    }\n\n    {\n        secp256k1_scalar r1, r2;\n        secp256k1_scalar b;\n        int i;\n        /* Test add_bit. */\n        int bit = secp256k1_rand_bits(8);\n        secp256k1_scalar_set_int(&b, 1);\n        CHECK(secp256k1_scalar_is_one(&b));\n        for (i = 0; i < bit; i++) {\n            secp256k1_scalar_add(&b, &b, &b);\n        }\n        r1 = s1;\n        r2 = s1;\n        if (!secp256k1_scalar_add(&r1, &r1, &b)) {\n            /* No overflow happened. */\n            secp256k1_scalar_cadd_bit(&r2, bit, 1);\n            CHECK(secp256k1_scalar_eq(&r1, &r2));\n            /* cadd is a noop when flag is zero */\n            secp256k1_scalar_cadd_bit(&r2, bit, 0);\n            CHECK(secp256k1_scalar_eq(&r1, &r2));\n        }\n    }\n\n    {\n        /* Test commutativity of mul. */\n        secp256k1_scalar r1, r2;\n        secp256k1_scalar_mul(&r1, &s1, &s2);\n        secp256k1_scalar_mul(&r2, &s2, &s1);\n        CHECK(secp256k1_scalar_eq(&r1, &r2));\n    }\n\n    {\n        /* Test associativity of add. */\n        secp256k1_scalar r1, r2;\n        secp256k1_scalar_add(&r1, &s1, &s2);\n        secp256k1_scalar_add(&r1, &r1, &s);\n        secp256k1_scalar_add(&r2, &s2, &s);\n        secp256k1_scalar_add(&r2, &s1, &r2);\n        CHECK(secp256k1_scalar_eq(&r1, &r2));\n    }\n\n    {\n        /* Test associativity of mul. */\n        secp256k1_scalar r1, r2;\n        secp256k1_scalar_mul(&r1, &s1, &s2);\n        secp256k1_scalar_mul(&r1, &r1, &s);\n        secp256k1_scalar_mul(&r2, &s2, &s);\n        secp256k1_scalar_mul(&r2, &s1, &r2);\n        CHECK(secp256k1_scalar_eq(&r1, &r2));\n    }\n\n    {\n        /* Test distributitivity of mul over add. */\n        secp256k1_scalar r1, r2, t;\n        secp256k1_scalar_add(&r1, &s1, &s2);\n        secp256k1_scalar_mul(&r1, &r1, &s);\n        secp256k1_scalar_mul(&r2, &s1, &s);\n        secp256k1_scalar_mul(&t, &s2, &s);\n        secp256k1_scalar_add(&r2, &r2, &t);\n        CHECK(secp256k1_scalar_eq(&r1, &r2));\n    }\n\n    {\n        /* Test square. */\n        secp256k1_scalar r1, r2;\n        secp256k1_scalar_sqr(&r1, &s1);\n        secp256k1_scalar_mul(&r2, &s1, &s1);\n        CHECK(secp256k1_scalar_eq(&r1, &r2));\n    }\n\n    {\n        /* Test multiplicative identity. */\n        secp256k1_scalar r1, v1;\n        secp256k1_scalar_set_int(&v1,1);\n        secp256k1_scalar_mul(&r1, &s1, &v1);\n        CHECK(secp256k1_scalar_eq(&r1, &s1));\n    }\n\n    {\n        /* Test additive identity. */\n        secp256k1_scalar r1, v0;\n        secp256k1_scalar_set_int(&v0,0);\n        secp256k1_scalar_add(&r1, &s1, &v0);\n        CHECK(secp256k1_scalar_eq(&r1, &s1));\n    }\n\n    {\n        /* Test zero product property. */\n        secp256k1_scalar r1, v0;\n        secp256k1_scalar_set_int(&v0,0);\n        secp256k1_scalar_mul(&r1, &s1, &v0);\n        CHECK(secp256k1_scalar_eq(&r1, &v0));\n    }\n\n}\n\nvoid run_scalar_tests(void) {\n    int i;\n    for (i = 0; i < 128 * count; i++) {\n        scalar_test();\n    }\n\n    {\n        /* (-1)+1 should be zero. */\n        secp256k1_scalar s, o;\n        secp256k1_scalar_set_int(&s, 1);\n        CHECK(secp256k1_scalar_is_one(&s));\n        secp256k1_scalar_negate(&o, &s);\n        secp256k1_scalar_add(&o, &o, &s);\n        CHECK(secp256k1_scalar_is_zero(&o));\n        secp256k1_scalar_negate(&o, &o);\n        CHECK(secp256k1_scalar_is_zero(&o));\n    }\n\n#ifndef USE_NUM_NONE\n    {\n        /* A scalar with value of the curve order should be 0. */\n        secp256k1_num order;\n        secp256k1_scalar zero;\n        unsigned char bin[32];\n        int overflow = 0;\n        secp256k1_scalar_order_get_num(&order);\n        secp256k1_num_get_bin(bin, 32, &order);\n        secp256k1_scalar_set_b32(&zero, bin, &overflow);\n        CHECK(overflow == 1);\n        CHECK(secp256k1_scalar_is_zero(&zero));\n    }\n#endif\n\n    {\n        /* Does check_overflow check catch all ones? */\n        static const secp256k1_scalar overflowed = SECP256K1_SCALAR_CONST(\n            0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL,\n            0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL\n        );\n        CHECK(secp256k1_scalar_check_overflow(&overflowed));\n    }\n\n    {\n        /* Static test vectors.\n         * These were reduced from ~10^12 random vectors based on comparison-decision\n         *  and edge-case coverage on 32-bit and 64-bit implementations.\n         * The responses were generated with Sage 5.9.\n         */\n        secp256k1_scalar x;\n        secp256k1_scalar y;\n        secp256k1_scalar z;\n        secp256k1_scalar zz;\n        secp256k1_scalar one;\n        secp256k1_scalar r1;\n        secp256k1_scalar r2;\n#if defined(USE_SCALAR_INV_NUM)\n        secp256k1_scalar zzv;\n#endif\n        int overflow;\n        unsigned char chal[33][2][32] = {\n            {{0xff, 0xff, 0x03, 0x07, 0x00, 0x00, 0x00, 0x00,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff,\n              0xff, 0xff, 0x03, 0x00, 0xc0, 0xff, 0xff, 0xff},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff}},\n            {{0xef, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n             {0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,\n              0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x80, 0xff}},\n            {{0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,\n              0x80, 0x00, 0x00, 0x80, 0xff, 0x3f, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x00},\n             {0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff, 0x80,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0xe0,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff}},\n            {{0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0x00, 0x1e, 0xf8, 0xff, 0xff, 0xff, 0xfd, 0xff},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f,\n              0x00, 0x00, 0x00, 0xf8, 0xff, 0x03, 0x00, 0xe0,\n              0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff,\n              0xf3, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00}},\n            {{0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x00,\n              0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00,\n              0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0x1f, 0x00, 0x00, 0x80, 0xff, 0xff, 0x3f,\n              0x00, 0xfe, 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff}},\n            {{0xff, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xfc, 0x9f,\n              0xff, 0xff, 0xff, 0x00, 0x80, 0x00, 0x00, 0x80,\n              0xff, 0x0f, 0xfc, 0xff, 0x7f, 0x00, 0x00, 0x00,\n              0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},\n             {0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,\n              0x00, 0x00, 0xf8, 0xff, 0x0f, 0xc0, 0xff, 0xff,\n              0xff, 0x1f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0x07, 0x80, 0xff, 0xff, 0xff}},\n            {{0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00,\n              0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,\n              0xf7, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0x00,\n              0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xf0},\n             {0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}},\n            {{0x00, 0xf8, 0xff, 0x03, 0xff, 0xff, 0xff, 0x00,\n              0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0x03, 0xc0, 0xff, 0x0f, 0xfc, 0xff},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff,\n              0xff, 0x01, 0x00, 0x00, 0x00, 0x3f, 0x00, 0xc0,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}},\n            {{0x8f, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0x7f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},\n            {{0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0x03, 0x00, 0x80, 0x00, 0x00, 0x80,\n              0xff, 0xff, 0xff, 0x00, 0x00, 0x80, 0xff, 0x7f},\n             {0xff, 0xcf, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,\n              0x00, 0xc0, 0xff, 0xcf, 0xff, 0xff, 0xff, 0xff,\n              0xbf, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x80, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00}},\n            {{0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff,\n              0xff, 0xff, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0x00, 0x80, 0x00, 0x00, 0x80,\n              0xff, 0x01, 0xfc, 0xff, 0x01, 0x00, 0xfe, 0xff},\n             {0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00}},\n            {{0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0x7f, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80},\n             {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0xf8, 0xff, 0x01, 0x00, 0xf0, 0xff, 0xff,\n              0xe0, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},\n            {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0x00},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,\n              0xfc, 0xff, 0xff, 0x3f, 0xf0, 0xff, 0xff, 0x3f,\n              0x00, 0x00, 0xf8, 0x07, 0x00, 0x00, 0x00, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0x0f, 0x7e, 0x00, 0x00}},\n            {{0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0x1f, 0x00, 0x00, 0xfe, 0x07, 0x00},\n             {0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xfb, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60}},\n            {{0xff, 0x01, 0x00, 0xff, 0xff, 0xff, 0x0f, 0x00,\n              0x80, 0x7f, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x03,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},\n             {0xff, 0xff, 0x1f, 0x00, 0xf0, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00}},\n            {{0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03,\n              0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff}},\n            {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0xc0, 0xff, 0xff, 0xcf, 0xff, 0x1f, 0x00, 0x00,\n              0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80},\n             {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x7e,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},\n            {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00},\n             {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,\n              0xff, 0xff, 0x7f, 0x00, 0x80, 0x00, 0x00, 0x00,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff}},\n            {{0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x80,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},\n             {0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x80,\n              0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,\n              0xff, 0x7f, 0xf8, 0xff, 0xff, 0x1f, 0x00, 0xfe}},\n            {{0xff, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0xff,\n              0xff, 0x03, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00,\n              0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,\n              0xff, 0xff, 0xff, 0xff, 0x01, 0x80, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00}},\n            {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,\n              0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,\n              0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x40}},\n            {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01},\n             {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},\n            {{0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},\n             {0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}},\n            {{0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0xc0,\n              0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,\n              0xf0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff}},\n            {{0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},\n             {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}},\n            {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,\n              0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,\n              0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x40},\n             {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}},\n            {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0x7e, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00,\n              0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,\n              0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff},\n             {0xff, 0x01, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x80,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}},\n            {{0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0x00, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01,\n              0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff},\n             {0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff,\n              0xff, 0xff, 0x3f, 0x00, 0xf8, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0x3f, 0x00, 0x00, 0xc0, 0xf1, 0x7f, 0x00}},\n            {{0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x80, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0x00},\n             {0x00, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,\n              0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f,\n              0x00, 0x00, 0xfc, 0xff, 0xff, 0x01, 0xff, 0xff}},\n            {{0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0x80, 0x00, 0x00, 0x80, 0xff, 0x03, 0xe0, 0x01,\n              0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xfc, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},\n             {0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,\n              0xfe, 0xff, 0xff, 0xf0, 0x07, 0x00, 0x3c, 0x80,\n              0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0x07, 0xe0, 0xff, 0x00, 0x00, 0x00}},\n            {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xf8,\n              0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80},\n             {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x80, 0x00,\n              0x00, 0x00, 0x00, 0xc0, 0x7f, 0xfe, 0xff, 0x1f,\n              0x00, 0xfe, 0xff, 0x03, 0x00, 0x00, 0xfe, 0xff}},\n            {{0xff, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 0x00,\n              0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83,\n              0xff, 0xff, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80,\n              0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xf0},\n             {0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00,\n              0xf8, 0x07, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xc7, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff}},\n            {{0x82, 0xc9, 0xfa, 0xb0, 0x68, 0x04, 0xa0, 0x00,\n              0x82, 0xc9, 0xfa, 0xb0, 0x68, 0x04, 0xa0, 0x00,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x03, 0xfb,\n              0xfa, 0x8a, 0x7d, 0xdf, 0x13, 0x86, 0xe2, 0x03},\n             {0x82, 0xc9, 0xfa, 0xb0, 0x68, 0x04, 0xa0, 0x00,\n              0x82, 0xc9, 0xfa, 0xb0, 0x68, 0x04, 0xa0, 0x00,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0x03, 0xfb,\n              0xfa, 0x8a, 0x7d, 0xdf, 0x13, 0x86, 0xe2, 0x03}}\n        };\n        unsigned char res[33][2][32] = {\n            {{0x0c, 0x3b, 0x0a, 0xca, 0x8d, 0x1a, 0x2f, 0xb9,\n              0x8a, 0x7b, 0x53, 0x5a, 0x1f, 0xc5, 0x22, 0xa1,\n              0x07, 0x2a, 0x48, 0xea, 0x02, 0xeb, 0xb3, 0xd6,\n              0x20, 0x1e, 0x86, 0xd0, 0x95, 0xf6, 0x92, 0x35},\n             {0xdc, 0x90, 0x7a, 0x07, 0x2e, 0x1e, 0x44, 0x6d,\n              0xf8, 0x15, 0x24, 0x5b, 0x5a, 0x96, 0x37, 0x9c,\n              0x37, 0x7b, 0x0d, 0xac, 0x1b, 0x65, 0x58, 0x49,\n              0x43, 0xb7, 0x31, 0xbb, 0xa7, 0xf4, 0x97, 0x15}},\n            {{0xf1, 0xf7, 0x3a, 0x50, 0xe6, 0x10, 0xba, 0x22,\n              0x43, 0x4d, 0x1f, 0x1f, 0x7c, 0x27, 0xca, 0x9c,\n              0xb8, 0xb6, 0xa0, 0xfc, 0xd8, 0xc0, 0x05, 0x2f,\n              0xf7, 0x08, 0xe1, 0x76, 0xdd, 0xd0, 0x80, 0xc8},\n             {0xe3, 0x80, 0x80, 0xb8, 0xdb, 0xe3, 0xa9, 0x77,\n              0x00, 0xb0, 0xf5, 0x2e, 0x27, 0xe2, 0x68, 0xc4,\n              0x88, 0xe8, 0x04, 0xc1, 0x12, 0xbf, 0x78, 0x59,\n              0xe6, 0xa9, 0x7c, 0xe1, 0x81, 0xdd, 0xb9, 0xd5}},\n            {{0x96, 0xe2, 0xee, 0x01, 0xa6, 0x80, 0x31, 0xef,\n              0x5c, 0xd0, 0x19, 0xb4, 0x7d, 0x5f, 0x79, 0xab,\n              0xa1, 0x97, 0xd3, 0x7e, 0x33, 0xbb, 0x86, 0x55,\n              0x60, 0x20, 0x10, 0x0d, 0x94, 0x2d, 0x11, 0x7c},\n             {0xcc, 0xab, 0xe0, 0xe8, 0x98, 0x65, 0x12, 0x96,\n              0x38, 0x5a, 0x1a, 0xf2, 0x85, 0x23, 0x59, 0x5f,\n              0xf9, 0xf3, 0xc2, 0x81, 0x70, 0x92, 0x65, 0x12,\n              0x9c, 0x65, 0x1e, 0x96, 0x00, 0xef, 0xe7, 0x63}},\n            {{0xac, 0x1e, 0x62, 0xc2, 0x59, 0xfc, 0x4e, 0x5c,\n              0x83, 0xb0, 0xd0, 0x6f, 0xce, 0x19, 0xf6, 0xbf,\n              0xa4, 0xb0, 0xe0, 0x53, 0x66, 0x1f, 0xbf, 0xc9,\n              0x33, 0x47, 0x37, 0xa9, 0x3d, 0x5d, 0xb0, 0x48},\n             {0x86, 0xb9, 0x2a, 0x7f, 0x8e, 0xa8, 0x60, 0x42,\n              0x26, 0x6d, 0x6e, 0x1c, 0xa2, 0xec, 0xe0, 0xe5,\n              0x3e, 0x0a, 0x33, 0xbb, 0x61, 0x4c, 0x9f, 0x3c,\n              0xd1, 0xdf, 0x49, 0x33, 0xcd, 0x72, 0x78, 0x18}},\n            {{0xf7, 0xd3, 0xcd, 0x49, 0x5c, 0x13, 0x22, 0xfb,\n              0x2e, 0xb2, 0x2f, 0x27, 0xf5, 0x8a, 0x5d, 0x74,\n              0xc1, 0x58, 0xc5, 0xc2, 0x2d, 0x9f, 0x52, 0xc6,\n              0x63, 0x9f, 0xba, 0x05, 0x76, 0x45, 0x7a, 0x63},\n             {0x8a, 0xfa, 0x55, 0x4d, 0xdd, 0xa3, 0xb2, 0xc3,\n              0x44, 0xfd, 0xec, 0x72, 0xde, 0xef, 0xc0, 0x99,\n              0xf5, 0x9f, 0xe2, 0x52, 0xb4, 0x05, 0x32, 0x58,\n              0x57, 0xc1, 0x8f, 0xea, 0xc3, 0x24, 0x5b, 0x94}},\n            {{0x05, 0x83, 0xee, 0xdd, 0x64, 0xf0, 0x14, 0x3b,\n              0xa0, 0x14, 0x4a, 0x3a, 0x41, 0x82, 0x7c, 0xa7,\n              0x2c, 0xaa, 0xb1, 0x76, 0xbb, 0x59, 0x64, 0x5f,\n              0x52, 0xad, 0x25, 0x29, 0x9d, 0x8f, 0x0b, 0xb0},\n             {0x7e, 0xe3, 0x7c, 0xca, 0xcd, 0x4f, 0xb0, 0x6d,\n              0x7a, 0xb2, 0x3e, 0xa0, 0x08, 0xb9, 0xa8, 0x2d,\n              0xc2, 0xf4, 0x99, 0x66, 0xcc, 0xac, 0xd8, 0xb9,\n              0x72, 0x2a, 0x4a, 0x3e, 0x0f, 0x7b, 0xbf, 0xf4}},\n            {{0x8c, 0x9c, 0x78, 0x2b, 0x39, 0x61, 0x7e, 0xf7,\n              0x65, 0x37, 0x66, 0x09, 0x38, 0xb9, 0x6f, 0x70,\n              0x78, 0x87, 0xff, 0xcf, 0x93, 0xca, 0x85, 0x06,\n              0x44, 0x84, 0xa7, 0xfe, 0xd3, 0xa4, 0xe3, 0x7e},\n             {0xa2, 0x56, 0x49, 0x23, 0x54, 0xa5, 0x50, 0xe9,\n              0x5f, 0xf0, 0x4d, 0xe7, 0xdc, 0x38, 0x32, 0x79,\n              0x4f, 0x1c, 0xb7, 0xe4, 0xbb, 0xf8, 0xbb, 0x2e,\n              0x40, 0x41, 0x4b, 0xcc, 0xe3, 0x1e, 0x16, 0x36}},\n            {{0x0c, 0x1e, 0xd7, 0x09, 0x25, 0x40, 0x97, 0xcb,\n              0x5c, 0x46, 0xa8, 0xda, 0xef, 0x25, 0xd5, 0xe5,\n              0x92, 0x4d, 0xcf, 0xa3, 0xc4, 0x5d, 0x35, 0x4a,\n              0xe4, 0x61, 0x92, 0xf3, 0xbf, 0x0e, 0xcd, 0xbe},\n             {0xe4, 0xaf, 0x0a, 0xb3, 0x30, 0x8b, 0x9b, 0x48,\n              0x49, 0x43, 0xc7, 0x64, 0x60, 0x4a, 0x2b, 0x9e,\n              0x95, 0x5f, 0x56, 0xe8, 0x35, 0xdc, 0xeb, 0xdc,\n              0xc7, 0xc4, 0xfe, 0x30, 0x40, 0xc7, 0xbf, 0xa4}},\n            {{0xd4, 0xa0, 0xf5, 0x81, 0x49, 0x6b, 0xb6, 0x8b,\n              0x0a, 0x69, 0xf9, 0xfe, 0xa8, 0x32, 0xe5, 0xe0,\n              0xa5, 0xcd, 0x02, 0x53, 0xf9, 0x2c, 0xe3, 0x53,\n              0x83, 0x36, 0xc6, 0x02, 0xb5, 0xeb, 0x64, 0xb8},\n             {0x1d, 0x42, 0xb9, 0xf9, 0xe9, 0xe3, 0x93, 0x2c,\n              0x4c, 0xee, 0x6c, 0x5a, 0x47, 0x9e, 0x62, 0x01,\n              0x6b, 0x04, 0xfe, 0xa4, 0x30, 0x2b, 0x0d, 0x4f,\n              0x71, 0x10, 0xd3, 0x55, 0xca, 0xf3, 0x5e, 0x80}},\n            {{0x77, 0x05, 0xf6, 0x0c, 0x15, 0x9b, 0x45, 0xe7,\n              0xb9, 0x11, 0xb8, 0xf5, 0xd6, 0xda, 0x73, 0x0c,\n              0xda, 0x92, 0xea, 0xd0, 0x9d, 0xd0, 0x18, 0x92,\n              0xce, 0x9a, 0xaa, 0xee, 0x0f, 0xef, 0xde, 0x30},\n             {0xf1, 0xf1, 0xd6, 0x9b, 0x51, 0xd7, 0x77, 0x62,\n              0x52, 0x10, 0xb8, 0x7a, 0x84, 0x9d, 0x15, 0x4e,\n              0x07, 0xdc, 0x1e, 0x75, 0x0d, 0x0c, 0x3b, 0xdb,\n              0x74, 0x58, 0x62, 0x02, 0x90, 0x54, 0x8b, 0x43}},\n            {{0xa6, 0xfe, 0x0b, 0x87, 0x80, 0x43, 0x67, 0x25,\n              0x57, 0x5d, 0xec, 0x40, 0x50, 0x08, 0xd5, 0x5d,\n              0x43, 0xd7, 0xe0, 0xaa, 0xe0, 0x13, 0xb6, 0xb0,\n              0xc0, 0xd4, 0xe5, 0x0d, 0x45, 0x83, 0xd6, 0x13},\n             {0x40, 0x45, 0x0a, 0x92, 0x31, 0xea, 0x8c, 0x60,\n              0x8c, 0x1f, 0xd8, 0x76, 0x45, 0xb9, 0x29, 0x00,\n              0x26, 0x32, 0xd8, 0xa6, 0x96, 0x88, 0xe2, 0xc4,\n              0x8b, 0xdb, 0x7f, 0x17, 0x87, 0xcc, 0xc8, 0xf2}},\n            {{0xc2, 0x56, 0xe2, 0xb6, 0x1a, 0x81, 0xe7, 0x31,\n              0x63, 0x2e, 0xbb, 0x0d, 0x2f, 0x81, 0x67, 0xd4,\n              0x22, 0xe2, 0x38, 0x02, 0x25, 0x97, 0xc7, 0x88,\n              0x6e, 0xdf, 0xbe, 0x2a, 0xa5, 0x73, 0x63, 0xaa},\n             {0x50, 0x45, 0xe2, 0xc3, 0xbd, 0x89, 0xfc, 0x57,\n              0xbd, 0x3c, 0xa3, 0x98, 0x7e, 0x7f, 0x36, 0x38,\n              0x92, 0x39, 0x1f, 0x0f, 0x81, 0x1a, 0x06, 0x51,\n              0x1f, 0x8d, 0x6a, 0xff, 0x47, 0x16, 0x06, 0x9c}},\n            {{0x33, 0x95, 0xa2, 0x6f, 0x27, 0x5f, 0x9c, 0x9c,\n              0x64, 0x45, 0xcb, 0xd1, 0x3c, 0xee, 0x5e, 0x5f,\n              0x48, 0xa6, 0xaf, 0xe3, 0x79, 0xcf, 0xb1, 0xe2,\n              0xbf, 0x55, 0x0e, 0xa2, 0x3b, 0x62, 0xf0, 0xe4},\n             {0x14, 0xe8, 0x06, 0xe3, 0xbe, 0x7e, 0x67, 0x01,\n              0xc5, 0x21, 0x67, 0xd8, 0x54, 0xb5, 0x7f, 0xa4,\n              0xf9, 0x75, 0x70, 0x1c, 0xfd, 0x79, 0xdb, 0x86,\n              0xad, 0x37, 0x85, 0x83, 0x56, 0x4e, 0xf0, 0xbf}},\n            {{0xbc, 0xa6, 0xe0, 0x56, 0x4e, 0xef, 0xfa, 0xf5,\n              0x1d, 0x5d, 0x3f, 0x2a, 0x5b, 0x19, 0xab, 0x51,\n              0xc5, 0x8b, 0xdd, 0x98, 0x28, 0x35, 0x2f, 0xc3,\n              0x81, 0x4f, 0x5c, 0xe5, 0x70, 0xb9, 0xeb, 0x62},\n             {0xc4, 0x6d, 0x26, 0xb0, 0x17, 0x6b, 0xfe, 0x6c,\n              0x12, 0xf8, 0xe7, 0xc1, 0xf5, 0x2f, 0xfa, 0x91,\n              0x13, 0x27, 0xbd, 0x73, 0xcc, 0x33, 0x31, 0x1c,\n              0x39, 0xe3, 0x27, 0x6a, 0x95, 0xcf, 0xc5, 0xfb}},\n            {{0x30, 0xb2, 0x99, 0x84, 0xf0, 0x18, 0x2a, 0x6e,\n              0x1e, 0x27, 0xed, 0xa2, 0x29, 0x99, 0x41, 0x56,\n              0xe8, 0xd4, 0x0d, 0xef, 0x99, 0x9c, 0xf3, 0x58,\n              0x29, 0x55, 0x1a, 0xc0, 0x68, 0xd6, 0x74, 0xa4},\n             {0x07, 0x9c, 0xe7, 0xec, 0xf5, 0x36, 0x73, 0x41,\n              0xa3, 0x1c, 0xe5, 0x93, 0x97, 0x6a, 0xfd, 0xf7,\n              0x53, 0x18, 0xab, 0xaf, 0xeb, 0x85, 0xbd, 0x92,\n              0x90, 0xab, 0x3c, 0xbf, 0x30, 0x82, 0xad, 0xf6}},\n            {{0xc6, 0x87, 0x8a, 0x2a, 0xea, 0xc0, 0xa9, 0xec,\n              0x6d, 0xd3, 0xdc, 0x32, 0x23, 0xce, 0x62, 0x19,\n              0xa4, 0x7e, 0xa8, 0xdd, 0x1c, 0x33, 0xae, 0xd3,\n              0x4f, 0x62, 0x9f, 0x52, 0xe7, 0x65, 0x46, 0xf4},\n             {0x97, 0x51, 0x27, 0x67, 0x2d, 0xa2, 0x82, 0x87,\n              0x98, 0xd3, 0xb6, 0x14, 0x7f, 0x51, 0xd3, 0x9a,\n              0x0b, 0xd0, 0x76, 0x81, 0xb2, 0x4f, 0x58, 0x92,\n              0xa4, 0x86, 0xa1, 0xa7, 0x09, 0x1d, 0xef, 0x9b}},\n            {{0xb3, 0x0f, 0x2b, 0x69, 0x0d, 0x06, 0x90, 0x64,\n              0xbd, 0x43, 0x4c, 0x10, 0xe8, 0x98, 0x1c, 0xa3,\n              0xe1, 0x68, 0xe9, 0x79, 0x6c, 0x29, 0x51, 0x3f,\n              0x41, 0xdc, 0xdf, 0x1f, 0xf3, 0x60, 0xbe, 0x33},\n             {0xa1, 0x5f, 0xf7, 0x1d, 0xb4, 0x3e, 0x9b, 0x3c,\n              0xe7, 0xbd, 0xb6, 0x06, 0xd5, 0x60, 0x06, 0x6d,\n              0x50, 0xd2, 0xf4, 0x1a, 0x31, 0x08, 0xf2, 0xea,\n              0x8e, 0xef, 0x5f, 0x7d, 0xb6, 0xd0, 0xc0, 0x27}},\n            {{0x62, 0x9a, 0xd9, 0xbb, 0x38, 0x36, 0xce, 0xf7,\n              0x5d, 0x2f, 0x13, 0xec, 0xc8, 0x2d, 0x02, 0x8a,\n              0x2e, 0x72, 0xf0, 0xe5, 0x15, 0x9d, 0x72, 0xae,\n              0xfc, 0xb3, 0x4f, 0x02, 0xea, 0xe1, 0x09, 0xfe},\n             {0x00, 0x00, 0x00, 0x00, 0xfa, 0x0a, 0x3d, 0xbc,\n              0xad, 0x16, 0x0c, 0xb6, 0xe7, 0x7c, 0x8b, 0x39,\n              0x9a, 0x43, 0xbb, 0xe3, 0xc2, 0x55, 0x15, 0x14,\n              0x75, 0xac, 0x90, 0x9b, 0x7f, 0x9a, 0x92, 0x00}},\n            {{0x8b, 0xac, 0x70, 0x86, 0x29, 0x8f, 0x00, 0x23,\n              0x7b, 0x45, 0x30, 0xaa, 0xb8, 0x4c, 0xc7, 0x8d,\n              0x4e, 0x47, 0x85, 0xc6, 0x19, 0xe3, 0x96, 0xc2,\n              0x9a, 0xa0, 0x12, 0xed, 0x6f, 0xd7, 0x76, 0x16},\n             {0x45, 0xaf, 0x7e, 0x33, 0xc7, 0x7f, 0x10, 0x6c,\n              0x7c, 0x9f, 0x29, 0xc1, 0xa8, 0x7e, 0x15, 0x84,\n              0xe7, 0x7d, 0xc0, 0x6d, 0xab, 0x71, 0x5d, 0xd0,\n              0x6b, 0x9f, 0x97, 0xab, 0xcb, 0x51, 0x0c, 0x9f}},\n            {{0x9e, 0xc3, 0x92, 0xb4, 0x04, 0x9f, 0xc8, 0xbb,\n              0xdd, 0x9e, 0xc6, 0x05, 0xfd, 0x65, 0xec, 0x94,\n              0x7f, 0x2c, 0x16, 0xc4, 0x40, 0xac, 0x63, 0x7b,\n              0x7d, 0xb8, 0x0c, 0xe4, 0x5b, 0xe3, 0xa7, 0x0e},\n             {0x43, 0xf4, 0x44, 0xe8, 0xcc, 0xc8, 0xd4, 0x54,\n              0x33, 0x37, 0x50, 0xf2, 0x87, 0x42, 0x2e, 0x00,\n              0x49, 0x60, 0x62, 0x02, 0xfd, 0x1a, 0x7c, 0xdb,\n              0x29, 0x6c, 0x6d, 0x54, 0x53, 0x08, 0xd1, 0xc8}},\n            {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n             {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}},\n            {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},\n             {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}},\n            {{0x27, 0x59, 0xc7, 0x35, 0x60, 0x71, 0xa6, 0xf1,\n              0x79, 0xa5, 0xfd, 0x79, 0x16, 0xf3, 0x41, 0xf0,\n              0x57, 0xb4, 0x02, 0x97, 0x32, 0xe7, 0xde, 0x59,\n              0xe2, 0x2d, 0x9b, 0x11, 0xea, 0x2c, 0x35, 0x92},\n             {0x27, 0x59, 0xc7, 0x35, 0x60, 0x71, 0xa6, 0xf1,\n              0x79, 0xa5, 0xfd, 0x79, 0x16, 0xf3, 0x41, 0xf0,\n              0x57, 0xb4, 0x02, 0x97, 0x32, 0xe7, 0xde, 0x59,\n              0xe2, 0x2d, 0x9b, 0x11, 0xea, 0x2c, 0x35, 0x92}},\n            {{0x28, 0x56, 0xac, 0x0e, 0x4f, 0x98, 0x09, 0xf0,\n              0x49, 0xfa, 0x7f, 0x84, 0xac, 0x7e, 0x50, 0x5b,\n              0x17, 0x43, 0x14, 0x89, 0x9c, 0x53, 0xa8, 0x94,\n              0x30, 0xf2, 0x11, 0x4d, 0x92, 0x14, 0x27, 0xe8},\n             {0x39, 0x7a, 0x84, 0x56, 0x79, 0x9d, 0xec, 0x26,\n              0x2c, 0x53, 0xc1, 0x94, 0xc9, 0x8d, 0x9e, 0x9d,\n              0x32, 0x1f, 0xdd, 0x84, 0x04, 0xe8, 0xe2, 0x0a,\n              0x6b, 0xbe, 0xbb, 0x42, 0x40, 0x67, 0x30, 0x6c}},\n            {{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n              0x45, 0x51, 0x23, 0x19, 0x50, 0xb7, 0x5f, 0xc4,\n              0x40, 0x2d, 0xa1, 0x73, 0x2f, 0xc9, 0xbe, 0xbd},\n             {0x27, 0x59, 0xc7, 0x35, 0x60, 0x71, 0xa6, 0xf1,\n              0x79, 0xa5, 0xfd, 0x79, 0x16, 0xf3, 0x41, 0xf0,\n              0x57, 0xb4, 0x02, 0x97, 0x32, 0xe7, 0xde, 0x59,\n              0xe2, 0x2d, 0x9b, 0x11, 0xea, 0x2c, 0x35, 0x92}},\n            {{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n              0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,\n              0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,\n              0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x40},\n             {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n              0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}},\n            {{0x1c, 0xc4, 0xf7, 0xda, 0x0f, 0x65, 0xca, 0x39,\n              0x70, 0x52, 0x92, 0x8e, 0xc3, 0xc8, 0x15, 0xea,\n              0x7f, 0x10, 0x9e, 0x77, 0x4b, 0x6e, 0x2d, 0xdf,\n              0xe8, 0x30, 0x9d, 0xda, 0xe8, 0x9a, 0x65, 0xae},\n             {0x02, 0xb0, 0x16, 0xb1, 0x1d, 0xc8, 0x57, 0x7b,\n              0xa2, 0x3a, 0xa2, 0xa3, 0x38, 0x5c, 0x8f, 0xeb,\n              0x66, 0x37, 0x91, 0xa8, 0x5f, 0xef, 0x04, 0xf6,\n              0x59, 0x75, 0xe1, 0xee, 0x92, 0xf6, 0x0e, 0x30}},\n            {{0x8d, 0x76, 0x14, 0xa4, 0x14, 0x06, 0x9f, 0x9a,\n              0xdf, 0x4a, 0x85, 0xa7, 0x6b, 0xbf, 0x29, 0x6f,\n              0xbc, 0x34, 0x87, 0x5d, 0xeb, 0xbb, 0x2e, 0xa9,\n              0xc9, 0x1f, 0x58, 0xd6, 0x9a, 0x82, 0xa0, 0x56},\n             {0xd4, 0xb9, 0xdb, 0x88, 0x1d, 0x04, 0xe9, 0x93,\n              0x8d, 0x3f, 0x20, 0xd5, 0x86, 0xa8, 0x83, 0x07,\n              0xdb, 0x09, 0xd8, 0x22, 0x1f, 0x7f, 0xf1, 0x71,\n              0xc8, 0xe7, 0x5d, 0x47, 0xaf, 0x8b, 0x72, 0xe9}},\n            {{0x83, 0xb9, 0x39, 0xb2, 0xa4, 0xdf, 0x46, 0x87,\n              0xc2, 0xb8, 0xf1, 0xe6, 0x4c, 0xd1, 0xe2, 0xa9,\n              0xe4, 0x70, 0x30, 0x34, 0xbc, 0x52, 0x7c, 0x55,\n              0xa6, 0xec, 0x80, 0xa4, 0xe5, 0xd2, 0xdc, 0x73},\n             {0x08, 0xf1, 0x03, 0xcf, 0x16, 0x73, 0xe8, 0x7d,\n              0xb6, 0x7e, 0x9b, 0xc0, 0xb4, 0xc2, 0xa5, 0x86,\n              0x02, 0x77, 0xd5, 0x27, 0x86, 0xa5, 0x15, 0xfb,\n              0xae, 0x9b, 0x8c, 0xa9, 0xf9, 0xf8, 0xa8, 0x4a}},\n            {{0x8b, 0x00, 0x49, 0xdb, 0xfa, 0xf0, 0x1b, 0xa2,\n              0xed, 0x8a, 0x9a, 0x7a, 0x36, 0x78, 0x4a, 0xc7,\n              0xf7, 0xad, 0x39, 0xd0, 0x6c, 0x65, 0x7a, 0x41,\n              0xce, 0xd6, 0xd6, 0x4c, 0x20, 0x21, 0x6b, 0xc7},\n             {0xc6, 0xca, 0x78, 0x1d, 0x32, 0x6c, 0x6c, 0x06,\n              0x91, 0xf2, 0x1a, 0xe8, 0x43, 0x16, 0xea, 0x04,\n              0x3c, 0x1f, 0x07, 0x85, 0xf7, 0x09, 0x22, 0x08,\n              0xba, 0x13, 0xfd, 0x78, 0x1e, 0x3f, 0x6f, 0x62}},\n            {{0x25, 0x9b, 0x7c, 0xb0, 0xac, 0x72, 0x6f, 0xb2,\n              0xe3, 0x53, 0x84, 0x7a, 0x1a, 0x9a, 0x98, 0x9b,\n              0x44, 0xd3, 0x59, 0xd0, 0x8e, 0x57, 0x41, 0x40,\n              0x78, 0xa7, 0x30, 0x2f, 0x4c, 0x9c, 0xb9, 0x68},\n             {0xb7, 0x75, 0x03, 0x63, 0x61, 0xc2, 0x48, 0x6e,\n              0x12, 0x3d, 0xbf, 0x4b, 0x27, 0xdf, 0xb1, 0x7a,\n              0xff, 0x4e, 0x31, 0x07, 0x83, 0xf4, 0x62, 0x5b,\n              0x19, 0xa5, 0xac, 0xa0, 0x32, 0x58, 0x0d, 0xa7}},\n            {{0x43, 0x4f, 0x10, 0xa4, 0xca, 0xdb, 0x38, 0x67,\n              0xfa, 0xae, 0x96, 0xb5, 0x6d, 0x97, 0xff, 0x1f,\n              0xb6, 0x83, 0x43, 0xd3, 0xa0, 0x2d, 0x70, 0x7a,\n              0x64, 0x05, 0x4c, 0xa7, 0xc1, 0xa5, 0x21, 0x51},\n             {0xe4, 0xf1, 0x23, 0x84, 0xe1, 0xb5, 0x9d, 0xf2,\n              0xb8, 0x73, 0x8b, 0x45, 0x2b, 0x35, 0x46, 0x38,\n              0x10, 0x2b, 0x50, 0xf8, 0x8b, 0x35, 0xcd, 0x34,\n              0xc8, 0x0e, 0xf6, 0xdb, 0x09, 0x35, 0xf0, 0xda}},\n            {{0xdb, 0x21, 0x5c, 0x8d, 0x83, 0x1d, 0xb3, 0x34,\n              0xc7, 0x0e, 0x43, 0xa1, 0x58, 0x79, 0x67, 0x13,\n              0x1e, 0x86, 0x5d, 0x89, 0x63, 0xe6, 0x0a, 0x46,\n              0x5c, 0x02, 0x97, 0x1b, 0x62, 0x43, 0x86, 0xf5},\n             {0xdb, 0x21, 0x5c, 0x8d, 0x83, 0x1d, 0xb3, 0x34,\n              0xc7, 0x0e, 0x43, 0xa1, 0x58, 0x79, 0x67, 0x13,\n              0x1e, 0x86, 0x5d, 0x89, 0x63, 0xe6, 0x0a, 0x46,\n              0x5c, 0x02, 0x97, 0x1b, 0x62, 0x43, 0x86, 0xf5}}\n        };\n        secp256k1_scalar_set_int(&one, 1);\n        for (i = 0; i < 33; i++) {\n            secp256k1_scalar_set_b32(&x, chal[i][0], &overflow);\n            CHECK(!overflow);\n            secp256k1_scalar_set_b32(&y, chal[i][1], &overflow);\n            CHECK(!overflow);\n            secp256k1_scalar_set_b32(&r1, res[i][0], &overflow);\n            CHECK(!overflow);\n            secp256k1_scalar_set_b32(&r2, res[i][1], &overflow);\n            CHECK(!overflow);\n            secp256k1_scalar_mul(&z, &x, &y);\n            CHECK(!secp256k1_scalar_check_overflow(&z));\n            CHECK(secp256k1_scalar_eq(&r1, &z));\n            if (!secp256k1_scalar_is_zero(&y)) {\n                secp256k1_scalar_inverse(&zz, &y);\n                CHECK(!secp256k1_scalar_check_overflow(&zz));\n#if defined(USE_SCALAR_INV_NUM)\n                secp256k1_scalar_inverse_var(&zzv, &y);\n                CHECK(secp256k1_scalar_eq(&zzv, &zz));\n#endif\n                secp256k1_scalar_mul(&z, &z, &zz);\n                CHECK(!secp256k1_scalar_check_overflow(&z));\n                CHECK(secp256k1_scalar_eq(&x, &z));\n                secp256k1_scalar_mul(&zz, &zz, &y);\n                CHECK(!secp256k1_scalar_check_overflow(&zz));\n                CHECK(secp256k1_scalar_eq(&one, &zz));\n            }\n            secp256k1_scalar_mul(&z, &x, &x);\n            CHECK(!secp256k1_scalar_check_overflow(&z));\n            secp256k1_scalar_sqr(&zz, &x);\n            CHECK(!secp256k1_scalar_check_overflow(&zz));\n            CHECK(secp256k1_scalar_eq(&zz, &z));\n            CHECK(secp256k1_scalar_eq(&r2, &zz));\n        }\n    }\n}\n\n/***** FIELD TESTS *****/\n\nvoid random_fe(secp256k1_fe *x) {\n    unsigned char bin[32];\n    do {\n        secp256k1_rand256(bin);\n        if (secp256k1_fe_set_b32(x, bin)) {\n            return;\n        }\n    } while(1);\n}\n\nvoid random_fe_test(secp256k1_fe *x) {\n    unsigned char bin[32];\n    do {\n        secp256k1_rand256_test(bin);\n        if (secp256k1_fe_set_b32(x, bin)) {\n            return;\n        }\n    } while(1);\n}\n\nvoid random_fe_non_zero(secp256k1_fe *nz) {\n    int tries = 10;\n    while (--tries >= 0) {\n        random_fe(nz);\n        secp256k1_fe_normalize(nz);\n        if (!secp256k1_fe_is_zero(nz)) {\n            break;\n        }\n    }\n    /* Infinitesimal probability of spurious failure here */\n    CHECK(tries >= 0);\n}\n\nvoid random_fe_non_square(secp256k1_fe *ns) {\n    secp256k1_fe r;\n    random_fe_non_zero(ns);\n    if (secp256k1_fe_sqrt(&r, ns)) {\n        secp256k1_fe_negate(ns, ns, 1);\n    }\n}\n\nint check_fe_equal(const secp256k1_fe *a, const secp256k1_fe *b) {\n    secp256k1_fe an = *a;\n    secp256k1_fe bn = *b;\n    secp256k1_fe_normalize_weak(&an);\n    secp256k1_fe_normalize_var(&bn);\n    return secp256k1_fe_equal_var(&an, &bn);\n}\n\nint check_fe_inverse(const secp256k1_fe *a, const secp256k1_fe *ai) {\n    secp256k1_fe x;\n    secp256k1_fe one = SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 1);\n    secp256k1_fe_mul(&x, a, ai);\n    return check_fe_equal(&x, &one);\n}\n\nvoid run_field_convert(void) {\n    static const unsigned char b32[32] = {\n        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,\n        0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,\n        0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29,\n        0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x40\n    };\n    static const secp256k1_fe_storage fes = SECP256K1_FE_STORAGE_CONST(\n        0x00010203UL, 0x04050607UL, 0x11121314UL, 0x15161718UL,\n        0x22232425UL, 0x26272829UL, 0x33343536UL, 0x37383940UL\n    );\n    static const secp256k1_fe fe = SECP256K1_FE_CONST(\n        0x00010203UL, 0x04050607UL, 0x11121314UL, 0x15161718UL,\n        0x22232425UL, 0x26272829UL, 0x33343536UL, 0x37383940UL\n    );\n    secp256k1_fe fe2;\n    unsigned char b322[32];\n    secp256k1_fe_storage fes2;\n    /* Check conversions to fe. */\n    CHECK(secp256k1_fe_set_b32(&fe2, b32));\n    CHECK(secp256k1_fe_equal_var(&fe, &fe2));\n    secp256k1_fe_from_storage(&fe2, &fes);\n    CHECK(secp256k1_fe_equal_var(&fe, &fe2));\n    /* Check conversion from fe. */\n    secp256k1_fe_get_b32(b322, &fe);\n    CHECK(memcmp(b322, b32, 32) == 0);\n    secp256k1_fe_to_storage(&fes2, &fe);\n    CHECK(memcmp(&fes2, &fes, sizeof(fes)) == 0);\n}\n\nint fe_memcmp(const secp256k1_fe *a, const secp256k1_fe *b) {\n    secp256k1_fe t = *b;\n#ifdef VERIFY\n    t.magnitude = a->magnitude;\n    t.normalized = a->normalized;\n#endif\n    return memcmp(a, &t, sizeof(secp256k1_fe));\n}\n\nvoid run_field_misc(void) {\n    secp256k1_fe x;\n    secp256k1_fe y;\n    secp256k1_fe z;\n    secp256k1_fe q;\n    secp256k1_fe fe5 = SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 5);\n    int i, j;\n    for (i = 0; i < 5*count; i++) {\n        secp256k1_fe_storage xs, ys, zs;\n        random_fe(&x);\n        random_fe_non_zero(&y);\n        /* Test the fe equality and comparison operations. */\n        CHECK(secp256k1_fe_cmp_var(&x, &x) == 0);\n        CHECK(secp256k1_fe_equal_var(&x, &x));\n        z = x;\n        secp256k1_fe_add(&z,&y);\n        /* Test fe conditional move; z is not normalized here. */\n        q = x;\n        secp256k1_fe_cmov(&x, &z, 0);\n        VERIFY_CHECK(!x.normalized && x.magnitude == z.magnitude);\n        secp256k1_fe_cmov(&x, &x, 1);\n        CHECK(fe_memcmp(&x, &z) != 0);\n        CHECK(fe_memcmp(&x, &q) == 0);\n        secp256k1_fe_cmov(&q, &z, 1);\n        VERIFY_CHECK(!q.normalized && q.magnitude == z.magnitude);\n        CHECK(fe_memcmp(&q, &z) == 0);\n        secp256k1_fe_normalize_var(&x);\n        secp256k1_fe_normalize_var(&z);\n        CHECK(!secp256k1_fe_equal_var(&x, &z));\n        secp256k1_fe_normalize_var(&q);\n        secp256k1_fe_cmov(&q, &z, (i&1));\n        VERIFY_CHECK(q.normalized && q.magnitude == 1);\n        for (j = 0; j < 6; j++) {\n            secp256k1_fe_negate(&z, &z, j+1);\n            secp256k1_fe_normalize_var(&q);\n            secp256k1_fe_cmov(&q, &z, (j&1));\n            VERIFY_CHECK(!q.normalized && q.magnitude == (j+2));\n        }\n        secp256k1_fe_normalize_var(&z);\n        /* Test storage conversion and conditional moves. */\n        secp256k1_fe_to_storage(&xs, &x);\n        secp256k1_fe_to_storage(&ys, &y);\n        secp256k1_fe_to_storage(&zs, &z);\n        secp256k1_fe_storage_cmov(&zs, &xs, 0);\n        secp256k1_fe_storage_cmov(&zs, &zs, 1);\n        CHECK(memcmp(&xs, &zs, sizeof(xs)) != 0);\n        secp256k1_fe_storage_cmov(&ys, &xs, 1);\n        CHECK(memcmp(&xs, &ys, sizeof(xs)) == 0);\n        secp256k1_fe_from_storage(&x, &xs);\n        secp256k1_fe_from_storage(&y, &ys);\n        secp256k1_fe_from_storage(&z, &zs);\n        /* Test that mul_int, mul, and add agree. */\n        secp256k1_fe_add(&y, &x);\n        secp256k1_fe_add(&y, &x);\n        z = x;\n        secp256k1_fe_mul_int(&z, 3);\n        CHECK(check_fe_equal(&y, &z));\n        secp256k1_fe_add(&y, &x);\n        secp256k1_fe_add(&z, &x);\n        CHECK(check_fe_equal(&z, &y));\n        z = x;\n        secp256k1_fe_mul_int(&z, 5);\n        secp256k1_fe_mul(&q, &x, &fe5);\n        CHECK(check_fe_equal(&z, &q));\n        secp256k1_fe_negate(&x, &x, 1);\n        secp256k1_fe_add(&z, &x);\n        secp256k1_fe_add(&q, &x);\n        CHECK(check_fe_equal(&y, &z));\n        CHECK(check_fe_equal(&q, &y));\n    }\n}\n\nvoid run_field_inv(void) {\n    secp256k1_fe x, xi, xii;\n    int i;\n    for (i = 0; i < 10*count; i++) {\n        random_fe_non_zero(&x);\n        secp256k1_fe_inv(&xi, &x);\n        CHECK(check_fe_inverse(&x, &xi));\n        secp256k1_fe_inv(&xii, &xi);\n        CHECK(check_fe_equal(&x, &xii));\n    }\n}\n\nvoid run_field_inv_var(void) {\n    secp256k1_fe x, xi, xii;\n    int i;\n    for (i = 0; i < 10*count; i++) {\n        random_fe_non_zero(&x);\n        secp256k1_fe_inv_var(&xi, &x);\n        CHECK(check_fe_inverse(&x, &xi));\n        secp256k1_fe_inv_var(&xii, &xi);\n        CHECK(check_fe_equal(&x, &xii));\n    }\n}\n\nvoid run_field_inv_all_var(void) {\n    secp256k1_fe x[16], xi[16], xii[16];\n    int i;\n    /* Check it's safe to call for 0 elements */\n    secp256k1_fe_inv_all_var(xi, x, 0);\n    for (i = 0; i < count; i++) {\n        size_t j;\n        size_t len = secp256k1_rand_int(15) + 1;\n        for (j = 0; j < len; j++) {\n            random_fe_non_zero(&x[j]);\n        }\n        secp256k1_fe_inv_all_var(xi, x, len);\n        for (j = 0; j < len; j++) {\n            CHECK(check_fe_inverse(&x[j], &xi[j]));\n        }\n        secp256k1_fe_inv_all_var(xii, xi, len);\n        for (j = 0; j < len; j++) {\n            CHECK(check_fe_equal(&x[j], &xii[j]));\n        }\n    }\n}\n\nvoid run_sqr(void) {\n    secp256k1_fe x, s;\n\n    {\n        int i;\n        secp256k1_fe_set_int(&x, 1);\n        secp256k1_fe_negate(&x, &x, 1);\n\n        for (i = 1; i <= 512; ++i) {\n            secp256k1_fe_mul_int(&x, 2);\n            secp256k1_fe_normalize(&x);\n            secp256k1_fe_sqr(&s, &x);\n        }\n    }\n}\n\nvoid test_sqrt(const secp256k1_fe *a, const secp256k1_fe *k) {\n    secp256k1_fe r1, r2;\n    int v = secp256k1_fe_sqrt(&r1, a);\n    CHECK((v == 0) == (k == NULL));\n\n    if (k != NULL) {\n        /* Check that the returned root is +/- the given known answer */\n        secp256k1_fe_negate(&r2, &r1, 1);\n        secp256k1_fe_add(&r1, k); secp256k1_fe_add(&r2, k);\n        secp256k1_fe_normalize(&r1); secp256k1_fe_normalize(&r2);\n        CHECK(secp256k1_fe_is_zero(&r1) || secp256k1_fe_is_zero(&r2));\n    }\n}\n\nvoid run_sqrt(void) {\n    secp256k1_fe ns, x, s, t;\n    int i;\n\n    /* Check sqrt(0) is 0 */\n    secp256k1_fe_set_int(&x, 0);\n    secp256k1_fe_sqr(&s, &x);\n    test_sqrt(&s, &x);\n\n    /* Check sqrt of small squares (and their negatives) */\n    for (i = 1; i <= 100; i++) {\n        secp256k1_fe_set_int(&x, i);\n        secp256k1_fe_sqr(&s, &x);\n        test_sqrt(&s, &x);\n        secp256k1_fe_negate(&t, &s, 1);\n        test_sqrt(&t, NULL);\n    }\n\n    /* Consistency checks for large random values */\n    for (i = 0; i < 10; i++) {\n        int j;\n        random_fe_non_square(&ns);\n        for (j = 0; j < count; j++) {\n            random_fe(&x);\n            secp256k1_fe_sqr(&s, &x);\n            test_sqrt(&s, &x);\n            secp256k1_fe_negate(&t, &s, 1);\n            test_sqrt(&t, NULL);\n            secp256k1_fe_mul(&t, &s, &ns);\n            test_sqrt(&t, NULL);\n        }\n    }\n}\n\n/***** GROUP TESTS *****/\n\nvoid ge_equals_ge(const secp256k1_ge *a, const secp256k1_ge *b) {\n    CHECK(a->infinity == b->infinity);\n    if (a->infinity) {\n        return;\n    }\n    CHECK(secp256k1_fe_equal_var(&a->x, &b->x));\n    CHECK(secp256k1_fe_equal_var(&a->y, &b->y));\n}\n\n/* This compares jacobian points including their Z, not just their geometric meaning. */\nint gej_xyz_equals_gej(const secp256k1_gej *a, const secp256k1_gej *b) {\n    secp256k1_gej a2;\n    secp256k1_gej b2;\n    int ret = 1;\n    ret &= a->infinity == b->infinity;\n    if (ret && !a->infinity) {\n        a2 = *a;\n        b2 = *b;\n        secp256k1_fe_normalize(&a2.x);\n        secp256k1_fe_normalize(&a2.y);\n        secp256k1_fe_normalize(&a2.z);\n        secp256k1_fe_normalize(&b2.x);\n        secp256k1_fe_normalize(&b2.y);\n        secp256k1_fe_normalize(&b2.z);\n        ret &= secp256k1_fe_cmp_var(&a2.x, &b2.x) == 0;\n        ret &= secp256k1_fe_cmp_var(&a2.y, &b2.y) == 0;\n        ret &= secp256k1_fe_cmp_var(&a2.z, &b2.z) == 0;\n    }\n    return ret;\n}\n\nvoid ge_equals_gej(const secp256k1_ge *a, const secp256k1_gej *b) {\n    secp256k1_fe z2s;\n    secp256k1_fe u1, u2, s1, s2;\n    CHECK(a->infinity == b->infinity);\n    if (a->infinity) {\n        return;\n    }\n    /* Check a.x * b.z^2 == b.x && a.y * b.z^3 == b.y, to avoid inverses. */\n    secp256k1_fe_sqr(&z2s, &b->z);\n    secp256k1_fe_mul(&u1, &a->x, &z2s);\n    u2 = b->x; secp256k1_fe_normalize_weak(&u2);\n    secp256k1_fe_mul(&s1, &a->y, &z2s); secp256k1_fe_mul(&s1, &s1, &b->z);\n    s2 = b->y; secp256k1_fe_normalize_weak(&s2);\n    CHECK(secp256k1_fe_equal_var(&u1, &u2));\n    CHECK(secp256k1_fe_equal_var(&s1, &s2));\n}\n\nvoid test_ge(void) {\n    int i, i1;\n#ifdef USE_ENDOMORPHISM\n    int runs = 6;\n#else\n    int runs = 4;\n#endif\n    /* Points: (infinity, p1, p1, -p1, -p1, p2, p2, -p2, -p2, p3, p3, -p3, -p3, p4, p4, -p4, -p4).\n     * The second in each pair of identical points uses a random Z coordinate in the Jacobian form.\n     * All magnitudes are randomized.\n     * All 17*17 combinations of points are added to each other, using all applicable methods.\n     *\n     * When the endomorphism code is compiled in, p5 = lambda*p1 and p6 = lambda^2*p1 are added as well.\n     */\n    secp256k1_ge *ge = (secp256k1_ge *)checked_malloc(&ctx->error_callback, sizeof(secp256k1_ge) * (1 + 4 * runs));\n    secp256k1_gej *gej = (secp256k1_gej *)checked_malloc(&ctx->error_callback, sizeof(secp256k1_gej) * (1 + 4 * runs));\n    secp256k1_fe *zinv = (secp256k1_fe *)checked_malloc(&ctx->error_callback, sizeof(secp256k1_fe) * (1 + 4 * runs));\n    secp256k1_fe zf;\n    secp256k1_fe zfi2, zfi3;\n\n    secp256k1_gej_set_infinity(&gej[0]);\n    secp256k1_ge_clear(&ge[0]);\n    secp256k1_ge_set_gej_var(&ge[0], &gej[0]);\n    for (i = 0; i < runs; i++) {\n        int j;\n        secp256k1_ge g;\n        random_group_element_test(&g);\n#ifdef USE_ENDOMORPHISM\n        if (i >= runs - 2) {\n            secp256k1_ge_mul_lambda(&g, &ge[1]);\n        }\n        if (i >= runs - 1) {\n            secp256k1_ge_mul_lambda(&g, &g);\n        }\n#endif\n        ge[1 + 4 * i] = g;\n        ge[2 + 4 * i] = g;\n        secp256k1_ge_neg(&ge[3 + 4 * i], &g);\n        secp256k1_ge_neg(&ge[4 + 4 * i], &g);\n        secp256k1_gej_set_ge(&gej[1 + 4 * i], &ge[1 + 4 * i]);\n        random_group_element_jacobian_test(&gej[2 + 4 * i], &ge[2 + 4 * i]);\n        secp256k1_gej_set_ge(&gej[3 + 4 * i], &ge[3 + 4 * i]);\n        random_group_element_jacobian_test(&gej[4 + 4 * i], &ge[4 + 4 * i]);\n        for (j = 0; j < 4; j++) {\n            random_field_element_magnitude(&ge[1 + j + 4 * i].x);\n            random_field_element_magnitude(&ge[1 + j + 4 * i].y);\n            random_field_element_magnitude(&gej[1 + j + 4 * i].x);\n            random_field_element_magnitude(&gej[1 + j + 4 * i].y);\n            random_field_element_magnitude(&gej[1 + j + 4 * i].z);\n        }\n    }\n\n    /* Compute z inverses. */\n    {\n        secp256k1_fe *zs = checked_malloc(&ctx->error_callback, sizeof(secp256k1_fe) * (1 + 4 * runs));\n        for (i = 0; i < 4 * runs + 1; i++) {\n            if (i == 0) {\n                /* The point at infinity does not have a meaningful z inverse. Any should do. */\n                do {\n                    random_field_element_test(&zs[i]);\n                } while(secp256k1_fe_is_zero(&zs[i]));\n            } else {\n                zs[i] = gej[i].z;\n            }\n        }\n        secp256k1_fe_inv_all_var(zinv, zs, 4 * runs + 1);\n        free(zs);\n    }\n\n    /* Generate random zf, and zfi2 = 1/zf^2, zfi3 = 1/zf^3 */\n    do {\n        random_field_element_test(&zf);\n    } while(secp256k1_fe_is_zero(&zf));\n    random_field_element_magnitude(&zf);\n    secp256k1_fe_inv_var(&zfi3, &zf);\n    secp256k1_fe_sqr(&zfi2, &zfi3);\n    secp256k1_fe_mul(&zfi3, &zfi3, &zfi2);\n\n    for (i1 = 0; i1 < 1 + 4 * runs; i1++) {\n        int i2;\n        for (i2 = 0; i2 < 1 + 4 * runs; i2++) {\n            /* Compute reference result using gej + gej (var). */\n            secp256k1_gej refj, resj;\n            secp256k1_ge ref;\n            secp256k1_fe zr;\n            secp256k1_gej_add_var(&refj, &gej[i1], &gej[i2], secp256k1_gej_is_infinity(&gej[i1]) ? NULL : &zr);\n            /* Check Z ratio. */\n            if (!secp256k1_gej_is_infinity(&gej[i1]) && !secp256k1_gej_is_infinity(&refj)) {\n                secp256k1_fe zrz; secp256k1_fe_mul(&zrz, &zr, &gej[i1].z);\n                CHECK(secp256k1_fe_equal_var(&zrz, &refj.z));\n            }\n            secp256k1_ge_set_gej_var(&ref, &refj);\n\n            /* Test gej + ge with Z ratio result (var). */\n            secp256k1_gej_add_ge_var(&resj, &gej[i1], &ge[i2], secp256k1_gej_is_infinity(&gej[i1]) ? NULL : &zr);\n            ge_equals_gej(&ref, &resj);\n            if (!secp256k1_gej_is_infinity(&gej[i1]) && !secp256k1_gej_is_infinity(&resj)) {\n                secp256k1_fe zrz; secp256k1_fe_mul(&zrz, &zr, &gej[i1].z);\n                CHECK(secp256k1_fe_equal_var(&zrz, &resj.z));\n            }\n\n            /* Test gej + ge (var, with additional Z factor). */\n            {\n                secp256k1_ge ge2_zfi = ge[i2]; /* the second term with x and y rescaled for z = 1/zf */\n                secp256k1_fe_mul(&ge2_zfi.x, &ge2_zfi.x, &zfi2);\n                secp256k1_fe_mul(&ge2_zfi.y, &ge2_zfi.y, &zfi3);\n                random_field_element_magnitude(&ge2_zfi.x);\n                random_field_element_magnitude(&ge2_zfi.y);\n                secp256k1_gej_add_zinv_var(&resj, &gej[i1], &ge2_zfi, &zf);\n                ge_equals_gej(&ref, &resj);\n            }\n\n            /* Test gej + ge (const). */\n            if (i2 != 0) {\n                /* secp256k1_gej_add_ge does not support its second argument being infinity. */\n                secp256k1_gej_add_ge(&resj, &gej[i1], &ge[i2]);\n                ge_equals_gej(&ref, &resj);\n            }\n\n            /* Test doubling (var). */\n            if ((i1 == 0 && i2 == 0) || ((i1 + 3)/4 == (i2 + 3)/4 && ((i1 + 3)%4)/2 == ((i2 + 3)%4)/2)) {\n                secp256k1_fe zr2;\n                /* Normal doubling with Z ratio result. */\n                secp256k1_gej_double_var(&resj, &gej[i1], &zr2);\n                ge_equals_gej(&ref, &resj);\n                /* Check Z ratio. */\n                secp256k1_fe_mul(&zr2, &zr2, &gej[i1].z);\n                CHECK(secp256k1_fe_equal_var(&zr2, &resj.z));\n                /* Normal doubling. */\n                secp256k1_gej_double_var(&resj, &gej[i2], NULL);\n                ge_equals_gej(&ref, &resj);\n            }\n\n            /* Test adding opposites. */\n            if ((i1 == 0 && i2 == 0) || ((i1 + 3)/4 == (i2 + 3)/4 && ((i1 + 3)%4)/2 != ((i2 + 3)%4)/2)) {\n                CHECK(secp256k1_ge_is_infinity(&ref));\n            }\n\n            /* Test adding infinity. */\n            if (i1 == 0) {\n                CHECK(secp256k1_ge_is_infinity(&ge[i1]));\n                CHECK(secp256k1_gej_is_infinity(&gej[i1]));\n                ge_equals_gej(&ref, &gej[i2]);\n            }\n            if (i2 == 0) {\n                CHECK(secp256k1_ge_is_infinity(&ge[i2]));\n                CHECK(secp256k1_gej_is_infinity(&gej[i2]));\n                ge_equals_gej(&ref, &gej[i1]);\n            }\n        }\n    }\n\n    /* Test adding all points together in random order equals infinity. */\n    {\n        secp256k1_gej sum = SECP256K1_GEJ_CONST_INFINITY;\n        secp256k1_gej *gej_shuffled = (secp256k1_gej *)checked_malloc(&ctx->error_callback, (4 * runs + 1) * sizeof(secp256k1_gej));\n        for (i = 0; i < 4 * runs + 1; i++) {\n            gej_shuffled[i] = gej[i];\n        }\n        for (i = 0; i < 4 * runs + 1; i++) {\n            int swap = i + secp256k1_rand_int(4 * runs + 1 - i);\n            if (swap != i) {\n                secp256k1_gej t = gej_shuffled[i];\n                gej_shuffled[i] = gej_shuffled[swap];\n                gej_shuffled[swap] = t;\n            }\n        }\n        for (i = 0; i < 4 * runs + 1; i++) {\n            secp256k1_gej_add_var(&sum, &sum, &gej_shuffled[i], NULL);\n        }\n        CHECK(secp256k1_gej_is_infinity(&sum));\n        free(gej_shuffled);\n    }\n\n    /* Test batch gej -> ge conversion with and without known z ratios. */\n    {\n        secp256k1_fe *zr = (secp256k1_fe *)checked_malloc(&ctx->error_callback, (4 * runs + 1) * sizeof(secp256k1_fe));\n        secp256k1_ge *ge_set_table = (secp256k1_ge *)checked_malloc(&ctx->error_callback, (4 * runs + 1) * sizeof(secp256k1_ge));\n        secp256k1_ge *ge_set_all = (secp256k1_ge *)checked_malloc(&ctx->error_callback, (4 * runs + 1) * sizeof(secp256k1_ge));\n        for (i = 0; i < 4 * runs + 1; i++) {\n            /* Compute gej[i + 1].z / gez[i].z (with gej[n].z taken to be 1). */\n            if (i < 4 * runs) {\n                secp256k1_fe_mul(&zr[i + 1], &zinv[i], &gej[i + 1].z);\n            }\n        }\n        secp256k1_ge_set_table_gej_var(ge_set_table, gej, zr, 4 * runs + 1);\n        secp256k1_ge_set_all_gej_var(ge_set_all, gej, 4 * runs + 1, &ctx->error_callback);\n        for (i = 0; i < 4 * runs + 1; i++) {\n            secp256k1_fe s;\n            random_fe_non_zero(&s);\n            secp256k1_gej_rescale(&gej[i], &s);\n            ge_equals_gej(&ge_set_table[i], &gej[i]);\n            ge_equals_gej(&ge_set_all[i], &gej[i]);\n        }\n        free(ge_set_table);\n        free(ge_set_all);\n        free(zr);\n    }\n\n    free(ge);\n    free(gej);\n    free(zinv);\n}\n\nvoid test_add_neg_y_diff_x(void) {\n    /* The point of this test is to check that we can add two points\n     * whose y-coordinates are negatives of each other but whose x\n     * coordinates differ. If the x-coordinates were the same, these\n     * points would be negatives of each other and their sum is\n     * infinity. This is cool because it \"covers up\" any degeneracy\n     * in the addition algorithm that would cause the xy coordinates\n     * of the sum to be wrong (since infinity has no xy coordinates).\n     * HOWEVER, if the x-coordinates are different, infinity is the\n     * wrong answer, and such degeneracies are exposed. This is the\n     * root of https://github.com/bitcoin-core/secp256k1/issues/257\n     * which this test is a regression test for.\n     *\n     * These points were generated in sage as\n     * # secp256k1 params\n     * F = FiniteField (0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F)\n     * C = EllipticCurve ([F (0), F (7)])\n     * G = C.lift_x(0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798)\n     * N = FiniteField(G.order())\n     *\n     * # endomorphism values (lambda is 1^{1/3} in N, beta is 1^{1/3} in F)\n     * x = polygen(N)\n     * lam  = (1 - x^3).roots()[1][0]\n     *\n     * # random \"bad pair\"\n     * P = C.random_element()\n     * Q = -int(lam) * P\n     * print \"    P: %x %x\" % P.xy()\n     * print \"    Q: %x %x\" % Q.xy()\n     * print \"P + Q: %x %x\" % (P + Q).xy()\n     */\n    secp256k1_gej aj = SECP256K1_GEJ_CONST(\n        0x8d24cd95, 0x0a355af1, 0x3c543505, 0x44238d30,\n        0x0643d79f, 0x05a59614, 0x2f8ec030, 0xd58977cb,\n        0x001e337a, 0x38093dcd, 0x6c0f386d, 0x0b1293a8,\n        0x4d72c879, 0xd7681924, 0x44e6d2f3, 0x9190117d\n    );\n    secp256k1_gej bj = SECP256K1_GEJ_CONST(\n        0xc7b74206, 0x1f788cd9, 0xabd0937d, 0x164a0d86,\n        0x95f6ff75, 0xf19a4ce9, 0xd013bd7b, 0xbf92d2a7,\n        0xffe1cc85, 0xc7f6c232, 0x93f0c792, 0xf4ed6c57,\n        0xb28d3786, 0x2897e6db, 0xbb192d0b, 0x6e6feab2\n    );\n    secp256k1_gej sumj = SECP256K1_GEJ_CONST(\n        0x671a63c0, 0x3efdad4c, 0x389a7798, 0x24356027,\n        0xb3d69010, 0x278625c3, 0x5c86d390, 0x184a8f7a,\n        0x5f6409c2, 0x2ce01f2b, 0x511fd375, 0x25071d08,\n        0xda651801, 0x70e95caf, 0x8f0d893c, 0xbed8fbbe\n    );\n    secp256k1_ge b;\n    secp256k1_gej resj;\n    secp256k1_ge res;\n    secp256k1_ge_set_gej(&b, &bj);\n\n    secp256k1_gej_add_var(&resj, &aj, &bj, NULL);\n    secp256k1_ge_set_gej(&res, &resj);\n    ge_equals_gej(&res, &sumj);\n\n    secp256k1_gej_add_ge(&resj, &aj, &b);\n    secp256k1_ge_set_gej(&res, &resj);\n    ge_equals_gej(&res, &sumj);\n\n    secp256k1_gej_add_ge_var(&resj, &aj, &b, NULL);\n    secp256k1_ge_set_gej(&res, &resj);\n    ge_equals_gej(&res, &sumj);\n}\n\nvoid run_ge(void) {\n    int i;\n    for (i = 0; i < count * 32; i++) {\n        test_ge();\n    }\n    test_add_neg_y_diff_x();\n}\n\nvoid test_ec_combine(void) {\n    secp256k1_scalar sum = SECP256K1_SCALAR_CONST(0, 0, 0, 0, 0, 0, 0, 0);\n    secp256k1_pubkey data[6];\n    const secp256k1_pubkey* d[6];\n    secp256k1_pubkey sd;\n    secp256k1_pubkey sd2;\n    secp256k1_gej Qj;\n    secp256k1_ge Q;\n    int i;\n    for (i = 1; i <= 6; i++) {\n        secp256k1_scalar s;\n        random_scalar_order_test(&s);\n        secp256k1_scalar_add(&sum, &sum, &s);\n        secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &Qj, &s);\n        secp256k1_ge_set_gej(&Q, &Qj);\n        secp256k1_pubkey_save(&data[i - 1], &Q);\n        d[i - 1] = &data[i - 1];\n        secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &Qj, &sum);\n        secp256k1_ge_set_gej(&Q, &Qj);\n        secp256k1_pubkey_save(&sd, &Q);\n        CHECK(secp256k1_ec_pubkey_combine(ctx, &sd2, d, i) == 1);\n        CHECK(memcmp(&sd, &sd2, sizeof(sd)) == 0);\n    }\n}\n\nvoid run_ec_combine(void) {\n    int i;\n    for (i = 0; i < count * 8; i++) {\n         test_ec_combine();\n    }\n}\n\nvoid test_group_decompress(const secp256k1_fe* x) {\n    /* The input itself, normalized. */\n    secp256k1_fe fex = *x;\n    secp256k1_fe fez;\n    /* Results of set_xquad_var, set_xo_var(..., 0), set_xo_var(..., 1). */\n    secp256k1_ge ge_quad, ge_even, ge_odd;\n    secp256k1_gej gej_quad;\n    /* Return values of the above calls. */\n    int res_quad, res_even, res_odd;\n\n    secp256k1_fe_normalize_var(&fex);\n\n    res_quad = secp256k1_ge_set_xquad(&ge_quad, &fex);\n    res_even = secp256k1_ge_set_xo_var(&ge_even, &fex, 0);\n    res_odd = secp256k1_ge_set_xo_var(&ge_odd, &fex, 1);\n\n    CHECK(res_quad == res_even);\n    CHECK(res_quad == res_odd);\n\n    if (res_quad) {\n        secp256k1_fe_normalize_var(&ge_quad.x);\n        secp256k1_fe_normalize_var(&ge_odd.x);\n        secp256k1_fe_normalize_var(&ge_even.x);\n        secp256k1_fe_normalize_var(&ge_quad.y);\n        secp256k1_fe_normalize_var(&ge_odd.y);\n        secp256k1_fe_normalize_var(&ge_even.y);\n\n        /* No infinity allowed. */\n        CHECK(!ge_quad.infinity);\n        CHECK(!ge_even.infinity);\n        CHECK(!ge_odd.infinity);\n\n        /* Check that the x coordinates check out. */\n        CHECK(secp256k1_fe_equal_var(&ge_quad.x, x));\n        CHECK(secp256k1_fe_equal_var(&ge_even.x, x));\n        CHECK(secp256k1_fe_equal_var(&ge_odd.x, x));\n\n        /* Check that the Y coordinate result in ge_quad is a square. */\n        CHECK(secp256k1_fe_is_quad_var(&ge_quad.y));\n\n        /* Check odd/even Y in ge_odd, ge_even. */\n        CHECK(secp256k1_fe_is_odd(&ge_odd.y));\n        CHECK(!secp256k1_fe_is_odd(&ge_even.y));\n\n        /* Check secp256k1_gej_has_quad_y_var. */\n        secp256k1_gej_set_ge(&gej_quad, &ge_quad);\n        CHECK(secp256k1_gej_has_quad_y_var(&gej_quad));\n        do {\n            random_fe_test(&fez);\n        } while (secp256k1_fe_is_zero(&fez));\n        secp256k1_gej_rescale(&gej_quad, &fez);\n        CHECK(secp256k1_gej_has_quad_y_var(&gej_quad));\n        secp256k1_gej_neg(&gej_quad, &gej_quad);\n        CHECK(!secp256k1_gej_has_quad_y_var(&gej_quad));\n        do {\n            random_fe_test(&fez);\n        } while (secp256k1_fe_is_zero(&fez));\n        secp256k1_gej_rescale(&gej_quad, &fez);\n        CHECK(!secp256k1_gej_has_quad_y_var(&gej_quad));\n        secp256k1_gej_neg(&gej_quad, &gej_quad);\n        CHECK(secp256k1_gej_has_quad_y_var(&gej_quad));\n    }\n}\n\nvoid run_group_decompress(void) {\n    int i;\n    for (i = 0; i < count * 4; i++) {\n        secp256k1_fe fe;\n        random_fe_test(&fe);\n        test_group_decompress(&fe);\n    }\n}\n\n/***** ECMULT TESTS *****/\n\nvoid run_ecmult_chain(void) {\n    /* random starting point A (on the curve) */\n    secp256k1_gej a = SECP256K1_GEJ_CONST(\n        0x8b30bbe9, 0xae2a9906, 0x96b22f67, 0x0709dff3,\n        0x727fd8bc, 0x04d3362c, 0x6c7bf458, 0xe2846004,\n        0xa357ae91, 0x5c4a6528, 0x1309edf2, 0x0504740f,\n        0x0eb33439, 0x90216b4f, 0x81063cb6, 0x5f2f7e0f\n    );\n    /* two random initial factors xn and gn */\n    secp256k1_scalar xn = SECP256K1_SCALAR_CONST(\n        0x84cc5452, 0xf7fde1ed, 0xb4d38a8c, 0xe9b1b84c,\n        0xcef31f14, 0x6e569be9, 0x705d357a, 0x42985407\n    );\n    secp256k1_scalar gn = SECP256K1_SCALAR_CONST(\n        0xa1e58d22, 0x553dcd42, 0xb2398062, 0x5d4c57a9,\n        0x6e9323d4, 0x2b3152e5, 0xca2c3990, 0xedc7c9de\n    );\n    /* two small multipliers to be applied to xn and gn in every iteration: */\n    static const secp256k1_scalar xf = SECP256K1_SCALAR_CONST(0, 0, 0, 0, 0, 0, 0, 0x1337);\n    static const secp256k1_scalar gf = SECP256K1_SCALAR_CONST(0, 0, 0, 0, 0, 0, 0, 0x7113);\n    /* accumulators with the resulting coefficients to A and G */\n    secp256k1_scalar ae = SECP256K1_SCALAR_CONST(0, 0, 0, 0, 0, 0, 0, 1);\n    secp256k1_scalar ge = SECP256K1_SCALAR_CONST(0, 0, 0, 0, 0, 0, 0, 0);\n    /* actual points */\n    secp256k1_gej x;\n    secp256k1_gej x2;\n    int i;\n\n    /* the point being computed */\n    x = a;\n    for (i = 0; i < 200*count; i++) {\n        /* in each iteration, compute X = xn*X + gn*G; */\n        secp256k1_ecmult(&ctx->ecmult_ctx, &x, &x, &xn, &gn);\n        /* also compute ae and ge: the actual accumulated factors for A and G */\n        /* if X was (ae*A+ge*G), xn*X + gn*G results in (xn*ae*A + (xn*ge+gn)*G) */\n        secp256k1_scalar_mul(&ae, &ae, &xn);\n        secp256k1_scalar_mul(&ge, &ge, &xn);\n        secp256k1_scalar_add(&ge, &ge, &gn);\n        /* modify xn and gn */\n        secp256k1_scalar_mul(&xn, &xn, &xf);\n        secp256k1_scalar_mul(&gn, &gn, &gf);\n\n        /* verify */\n        if (i == 19999) {\n            /* expected result after 19999 iterations */\n            secp256k1_gej rp = SECP256K1_GEJ_CONST(\n                0xD6E96687, 0xF9B10D09, 0x2A6F3543, 0x9D86CEBE,\n                0xA4535D0D, 0x409F5358, 0x6440BD74, 0xB933E830,\n                0xB95CBCA2, 0xC77DA786, 0x539BE8FD, 0x53354D2D,\n                0x3B4F566A, 0xE6580454, 0x07ED6015, 0xEE1B2A88\n            );\n\n            secp256k1_gej_neg(&rp, &rp);\n            secp256k1_gej_add_var(&rp, &rp, &x, NULL);\n            CHECK(secp256k1_gej_is_infinity(&rp));\n        }\n    }\n    /* redo the computation, but directly with the resulting ae and ge coefficients: */\n    secp256k1_ecmult(&ctx->ecmult_ctx, &x2, &a, &ae, &ge);\n    secp256k1_gej_neg(&x2, &x2);\n    secp256k1_gej_add_var(&x2, &x2, &x, NULL);\n    CHECK(secp256k1_gej_is_infinity(&x2));\n}\n\nvoid test_point_times_order(const secp256k1_gej *point) {\n    /* X * (point + G) + (order-X) * (pointer + G) = 0 */\n    secp256k1_scalar x;\n    secp256k1_scalar nx;\n    secp256k1_scalar zero = SECP256K1_SCALAR_CONST(0, 0, 0, 0, 0, 0, 0, 0);\n    secp256k1_scalar one = SECP256K1_SCALAR_CONST(0, 0, 0, 0, 0, 0, 0, 1);\n    secp256k1_gej res1, res2;\n    secp256k1_ge res3;\n    unsigned char pub[65];\n    size_t psize = 65;\n    random_scalar_order_test(&x);\n    secp256k1_scalar_negate(&nx, &x);\n    secp256k1_ecmult(&ctx->ecmult_ctx, &res1, point, &x, &x); /* calc res1 = x * point + x * G; */\n    secp256k1_ecmult(&ctx->ecmult_ctx, &res2, point, &nx, &nx); /* calc res2 = (order - x) * point + (order - x) * G; */\n    secp256k1_gej_add_var(&res1, &res1, &res2, NULL);\n    CHECK(secp256k1_gej_is_infinity(&res1));\n    CHECK(secp256k1_gej_is_valid_var(&res1) == 0);\n    secp256k1_ge_set_gej(&res3, &res1);\n    CHECK(secp256k1_ge_is_infinity(&res3));\n    CHECK(secp256k1_ge_is_valid_var(&res3) == 0);\n    CHECK(secp256k1_eckey_pubkey_serialize(&res3, pub, &psize, 0) == 0);\n    psize = 65;\n    CHECK(secp256k1_eckey_pubkey_serialize(&res3, pub, &psize, 1) == 0);\n    /* check zero/one edge cases */\n    secp256k1_ecmult(&ctx->ecmult_ctx, &res1, point, &zero, &zero);\n    secp256k1_ge_set_gej(&res3, &res1);\n    CHECK(secp256k1_ge_is_infinity(&res3));\n    secp256k1_ecmult(&ctx->ecmult_ctx, &res1, point, &one, &zero);\n    secp256k1_ge_set_gej(&res3, &res1);\n    ge_equals_gej(&res3, point);\n    secp256k1_ecmult(&ctx->ecmult_ctx, &res1, point, &zero, &one);\n    secp256k1_ge_set_gej(&res3, &res1);\n    ge_equals_ge(&res3, &secp256k1_ge_const_g);\n}\n\nvoid run_point_times_order(void) {\n    int i;\n    secp256k1_fe x = SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, 2);\n    static const secp256k1_fe xr = SECP256K1_FE_CONST(\n        0x7603CB59, 0xB0EF6C63, 0xFE608479, 0x2A0C378C,\n        0xDB3233A8, 0x0F8A9A09, 0xA877DEAD, 0x31B38C45\n    );\n    for (i = 0; i < 500; i++) {\n        secp256k1_ge p;\n        if (secp256k1_ge_set_xo_var(&p, &x, 1)) {\n            secp256k1_gej j;\n            CHECK(secp256k1_ge_is_valid_var(&p));\n            secp256k1_gej_set_ge(&j, &p);\n            CHECK(secp256k1_gej_is_valid_var(&j));\n            test_point_times_order(&j);\n        }\n        secp256k1_fe_sqr(&x, &x);\n    }\n    secp256k1_fe_normalize_var(&x);\n    CHECK(secp256k1_fe_equal_var(&x, &xr));\n}\n\nvoid ecmult_const_random_mult(void) {\n    /* random starting point A (on the curve) */\n    secp256k1_ge a = SECP256K1_GE_CONST(\n        0x6d986544, 0x57ff52b8, 0xcf1b8126, 0x5b802a5b,\n        0xa97f9263, 0xb1e88044, 0x93351325, 0x91bc450a,\n        0x535c59f7, 0x325e5d2b, 0xc391fbe8, 0x3c12787c,\n        0x337e4a98, 0xe82a9011, 0x0123ba37, 0xdd769c7d\n    );\n    /* random initial factor xn */\n    secp256k1_scalar xn = SECP256K1_SCALAR_CONST(\n        0x649d4f77, 0xc4242df7, 0x7f2079c9, 0x14530327,\n        0xa31b876a, 0xd2d8ce2a, 0x2236d5c6, 0xd7b2029b\n    );\n    /* expected xn * A (from sage) */\n    secp256k1_ge expected_b = SECP256K1_GE_CONST(\n        0x23773684, 0x4d209dc7, 0x098a786f, 0x20d06fcd,\n        0x070a38bf, 0xc11ac651, 0x03004319, 0x1e2a8786,\n        0xed8c3b8e, 0xc06dd57b, 0xd06ea66e, 0x45492b0f,\n        0xb84e4e1b, 0xfb77e21f, 0x96baae2a, 0x63dec956\n    );\n    secp256k1_gej b;\n    secp256k1_ecmult_const(&b, &a, &xn);\n\n    CHECK(secp256k1_ge_is_valid_var(&a));\n    ge_equals_gej(&expected_b, &b);\n}\n\nvoid ecmult_const_commutativity(void) {\n    secp256k1_scalar a;\n    secp256k1_scalar b;\n    secp256k1_gej res1;\n    secp256k1_gej res2;\n    secp256k1_ge mid1;\n    secp256k1_ge mid2;\n    random_scalar_order_test(&a);\n    random_scalar_order_test(&b);\n\n    secp256k1_ecmult_const(&res1, &secp256k1_ge_const_g, &a);\n    secp256k1_ecmult_const(&res2, &secp256k1_ge_const_g, &b);\n    secp256k1_ge_set_gej(&mid1, &res1);\n    secp256k1_ge_set_gej(&mid2, &res2);\n    secp256k1_ecmult_const(&res1, &mid1, &b);\n    secp256k1_ecmult_const(&res2, &mid2, &a);\n    secp256k1_ge_set_gej(&mid1, &res1);\n    secp256k1_ge_set_gej(&mid2, &res2);\n    ge_equals_ge(&mid1, &mid2);\n}\n\nvoid ecmult_const_mult_zero_one(void) {\n    secp256k1_scalar zero = SECP256K1_SCALAR_CONST(0, 0, 0, 0, 0, 0, 0, 0);\n    secp256k1_scalar one = SECP256K1_SCALAR_CONST(0, 0, 0, 0, 0, 0, 0, 1);\n    secp256k1_scalar negone;\n    secp256k1_gej res1;\n    secp256k1_ge res2;\n    secp256k1_ge point;\n    secp256k1_scalar_negate(&negone, &one);\n\n    random_group_element_test(&point);\n    secp256k1_ecmult_const(&res1, &point, &zero);\n    secp256k1_ge_set_gej(&res2, &res1);\n    CHECK(secp256k1_ge_is_infinity(&res2));\n    secp256k1_ecmult_const(&res1, &point, &one);\n    secp256k1_ge_set_gej(&res2, &res1);\n    ge_equals_ge(&res2, &point);\n    secp256k1_ecmult_const(&res1, &point, &negone);\n    secp256k1_gej_neg(&res1, &res1);\n    secp256k1_ge_set_gej(&res2, &res1);\n    ge_equals_ge(&res2, &point);\n}\n\nvoid ecmult_const_chain_multiply(void) {\n    /* Check known result (randomly generated test problem from sage) */\n    const secp256k1_scalar scalar = SECP256K1_SCALAR_CONST(\n        0x4968d524, 0x2abf9b7a, 0x466abbcf, 0x34b11b6d,\n        0xcd83d307, 0x827bed62, 0x05fad0ce, 0x18fae63b\n    );\n    const secp256k1_gej expected_point = SECP256K1_GEJ_CONST(\n        0x5494c15d, 0x32099706, 0xc2395f94, 0x348745fd,\n        0x757ce30e, 0x4e8c90fb, 0xa2bad184, 0xf883c69f,\n        0x5d195d20, 0xe191bf7f, 0x1be3e55f, 0x56a80196,\n        0x6071ad01, 0xf1462f66, 0xc997fa94, 0xdb858435\n    );\n    secp256k1_gej point;\n    secp256k1_ge res;\n    int i;\n\n    secp256k1_gej_set_ge(&point, &secp256k1_ge_const_g);\n    for (i = 0; i < 100; ++i) {\n        secp256k1_ge tmp;\n        secp256k1_ge_set_gej(&tmp, &point);\n        secp256k1_ecmult_const(&point, &tmp, &scalar);\n    }\n    secp256k1_ge_set_gej(&res, &point);\n    ge_equals_gej(&res, &expected_point);\n}\n\nvoid run_ecmult_const_tests(void) {\n    ecmult_const_mult_zero_one();\n    ecmult_const_random_mult();\n    ecmult_const_commutativity();\n    ecmult_const_chain_multiply();\n}\n\nvoid test_wnaf(const secp256k1_scalar *number, int w) {\n    secp256k1_scalar x, two, t;\n    int wnaf[256];\n    int zeroes = -1;\n    int i;\n    int bits;\n    secp256k1_scalar_set_int(&x, 0);\n    secp256k1_scalar_set_int(&two, 2);\n    bits = secp256k1_ecmult_wnaf(wnaf, 256, number, w);\n    CHECK(bits <= 256);\n    for (i = bits-1; i >= 0; i--) {\n        int v = wnaf[i];\n        secp256k1_scalar_mul(&x, &x, &two);\n        if (v) {\n            CHECK(zeroes == -1 || zeroes >= w-1); /* check that distance between non-zero elements is at least w-1 */\n            zeroes=0;\n            CHECK((v & 1) == 1); /* check non-zero elements are odd */\n            CHECK(v <= (1 << (w-1)) - 1); /* check range below */\n            CHECK(v >= -(1 << (w-1)) - 1); /* check range above */\n        } else {\n            CHECK(zeroes != -1); /* check that no unnecessary zero padding exists */\n            zeroes++;\n        }\n        if (v >= 0) {\n            secp256k1_scalar_set_int(&t, v);\n        } else {\n            secp256k1_scalar_set_int(&t, -v);\n            secp256k1_scalar_negate(&t, &t);\n        }\n        secp256k1_scalar_add(&x, &x, &t);\n    }\n    CHECK(secp256k1_scalar_eq(&x, number)); /* check that wnaf represents number */\n}\n\nvoid test_constant_wnaf_negate(const secp256k1_scalar *number) {\n    secp256k1_scalar neg1 = *number;\n    secp256k1_scalar neg2 = *number;\n    int sign1 = 1;\n    int sign2 = 1;\n\n    if (!secp256k1_scalar_get_bits(&neg1, 0, 1)) {\n        secp256k1_scalar_negate(&neg1, &neg1);\n        sign1 = -1;\n    }\n    sign2 = secp256k1_scalar_cond_negate(&neg2, secp256k1_scalar_is_even(&neg2));\n    CHECK(sign1 == sign2);\n    CHECK(secp256k1_scalar_eq(&neg1, &neg2));\n}\n\nvoid test_constant_wnaf(const secp256k1_scalar *number, int w) {\n    secp256k1_scalar x, shift;\n    int wnaf[256] = {0};\n    int i;\n    int skew;\n    secp256k1_scalar num = *number;\n\n    secp256k1_scalar_set_int(&x, 0);\n    secp256k1_scalar_set_int(&shift, 1 << w);\n    /* With USE_ENDOMORPHISM on we only consider 128-bit numbers */\n#ifdef USE_ENDOMORPHISM\n    for (i = 0; i < 16; ++i) {\n        secp256k1_scalar_shr_int(&num, 8);\n    }\n#endif\n    skew = secp256k1_wnaf_const(wnaf, num, w);\n\n    for (i = WNAF_SIZE(w); i >= 0; --i) {\n        secp256k1_scalar t;\n        int v = wnaf[i];\n        CHECK(v != 0); /* check nonzero */\n        CHECK(v & 1);  /* check parity */\n        CHECK(v > -(1 << w)); /* check range above */\n        CHECK(v < (1 << w));  /* check range below */\n\n        secp256k1_scalar_mul(&x, &x, &shift);\n        if (v >= 0) {\n            secp256k1_scalar_set_int(&t, v);\n        } else {\n            secp256k1_scalar_set_int(&t, -v);\n            secp256k1_scalar_negate(&t, &t);\n        }\n        secp256k1_scalar_add(&x, &x, &t);\n    }\n    /* Skew num because when encoding numbers as odd we use an offset */\n    secp256k1_scalar_cadd_bit(&num, skew == 2, 1);\n    CHECK(secp256k1_scalar_eq(&x, &num));\n}\n\nvoid run_wnaf(void) {\n    int i;\n    secp256k1_scalar n = {{0}};\n\n    /* Sanity check: 1 and 2 are the smallest odd and even numbers and should\n     *               have easier-to-diagnose failure modes  */\n    n.d[0] = 1;\n    test_constant_wnaf(&n, 4);\n    n.d[0] = 2;\n    test_constant_wnaf(&n, 4);\n    /* Random tests */\n    for (i = 0; i < count; i++) {\n        random_scalar_order(&n);\n        test_wnaf(&n, 4+(i%10));\n        test_constant_wnaf_negate(&n);\n        test_constant_wnaf(&n, 4 + (i % 10));\n    }\n    secp256k1_scalar_set_int(&n, 0);\n    CHECK(secp256k1_scalar_cond_negate(&n, 1) == -1);\n    CHECK(secp256k1_scalar_is_zero(&n));\n    CHECK(secp256k1_scalar_cond_negate(&n, 0) == 1);\n    CHECK(secp256k1_scalar_is_zero(&n));\n}\n\nvoid test_ecmult_constants(void) {\n    /* Test ecmult_gen() for [0..36) and [order-36..0). */\n    secp256k1_scalar x;\n    secp256k1_gej r;\n    secp256k1_ge ng;\n    int i;\n    int j;\n    secp256k1_ge_neg(&ng, &secp256k1_ge_const_g);\n    for (i = 0; i < 36; i++ ) {\n        secp256k1_scalar_set_int(&x, i);\n        secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &r, &x);\n        for (j = 0; j < i; j++) {\n            if (j == i - 1) {\n                ge_equals_gej(&secp256k1_ge_const_g, &r);\n            }\n            secp256k1_gej_add_ge(&r, &r, &ng);\n        }\n        CHECK(secp256k1_gej_is_infinity(&r));\n    }\n    for (i = 1; i <= 36; i++ ) {\n        secp256k1_scalar_set_int(&x, i);\n        secp256k1_scalar_negate(&x, &x);\n        secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &r, &x);\n        for (j = 0; j < i; j++) {\n            if (j == i - 1) {\n                ge_equals_gej(&ng, &r);\n            }\n            secp256k1_gej_add_ge(&r, &r, &secp256k1_ge_const_g);\n        }\n        CHECK(secp256k1_gej_is_infinity(&r));\n    }\n}\n\nvoid run_ecmult_constants(void) {\n    test_ecmult_constants();\n}\n\nvoid test_ecmult_gen_blind(void) {\n    /* Test ecmult_gen() blinding and confirm that the blinding changes, the affine points match, and the z's don't match. */\n    secp256k1_scalar key;\n    secp256k1_scalar b;\n    unsigned char seed32[32];\n    secp256k1_gej pgej;\n    secp256k1_gej pgej2;\n    secp256k1_gej i;\n    secp256k1_ge pge;\n    random_scalar_order_test(&key);\n    secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &pgej, &key);\n    secp256k1_rand256(seed32);\n    b = ctx->ecmult_gen_ctx.blind;\n    i = ctx->ecmult_gen_ctx.initial;\n    secp256k1_ecmult_gen_blind(&ctx->ecmult_gen_ctx, seed32);\n    CHECK(!secp256k1_scalar_eq(&b, &ctx->ecmult_gen_ctx.blind));\n    secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &pgej2, &key);\n    CHECK(!gej_xyz_equals_gej(&pgej, &pgej2));\n    CHECK(!gej_xyz_equals_gej(&i, &ctx->ecmult_gen_ctx.initial));\n    secp256k1_ge_set_gej(&pge, &pgej);\n    ge_equals_gej(&pge, &pgej2);\n}\n\nvoid test_ecmult_gen_blind_reset(void) {\n    /* Test ecmult_gen() blinding reset and confirm that the blinding is consistent. */\n    secp256k1_scalar b;\n    secp256k1_gej initial;\n    secp256k1_ecmult_gen_blind(&ctx->ecmult_gen_ctx, 0);\n    b = ctx->ecmult_gen_ctx.blind;\n    initial = ctx->ecmult_gen_ctx.initial;\n    secp256k1_ecmult_gen_blind(&ctx->ecmult_gen_ctx, 0);\n    CHECK(secp256k1_scalar_eq(&b, &ctx->ecmult_gen_ctx.blind));\n    CHECK(gej_xyz_equals_gej(&initial, &ctx->ecmult_gen_ctx.initial));\n}\n\nvoid run_ecmult_gen_blind(void) {\n    int i;\n    test_ecmult_gen_blind_reset();\n    for (i = 0; i < 10; i++) {\n        test_ecmult_gen_blind();\n    }\n}\n\n#ifdef USE_ENDOMORPHISM\n/***** ENDOMORPHISH TESTS *****/\nvoid test_scalar_split(void) {\n    secp256k1_scalar full;\n    secp256k1_scalar s1, slam;\n    const unsigned char zero[32] = {0};\n    unsigned char tmp[32];\n\n    random_scalar_order_test(&full);\n    secp256k1_scalar_split_lambda(&s1, &slam, &full);\n\n    /* check that both are <= 128 bits in size */\n    if (secp256k1_scalar_is_high(&s1)) {\n        secp256k1_scalar_negate(&s1, &s1);\n    }\n    if (secp256k1_scalar_is_high(&slam)) {\n        secp256k1_scalar_negate(&slam, &slam);\n    }\n\n    secp256k1_scalar_get_b32(tmp, &s1);\n    CHECK(memcmp(zero, tmp, 16) == 0);\n    secp256k1_scalar_get_b32(tmp, &slam);\n    CHECK(memcmp(zero, tmp, 16) == 0);\n}\n\nvoid run_endomorphism_tests(void) {\n    test_scalar_split();\n}\n#endif\n\nvoid ec_pubkey_parse_pointtest(const unsigned char *input, int xvalid, int yvalid) {\n    unsigned char pubkeyc[65];\n    secp256k1_pubkey pubkey;\n    secp256k1_ge ge;\n    size_t pubkeyclen;\n    int32_t ecount;\n    ecount = 0;\n    secp256k1_context_set_illegal_callback(ctx, counting_illegal_callback_fn, &ecount);\n    for (pubkeyclen = 3; pubkeyclen <= 65; pubkeyclen++) {\n        /* Smaller sizes are tested exhaustively elsewhere. */\n        int32_t i;\n        memcpy(&pubkeyc[1], input, 64);\n        VG_UNDEF(&pubkeyc[pubkeyclen], 65 - pubkeyclen);\n        for (i = 0; i < 256; i++) {\n            /* Try all type bytes. */\n            int xpass;\n            int ypass;\n            int ysign;\n            pubkeyc[0] = i;\n            /* What sign does this point have? */\n            ysign = (input[63] & 1) + 2;\n            /* For the current type (i) do we expect parsing to work? Handled all of compressed/uncompressed/hybrid. */\n            xpass = xvalid && (pubkeyclen == 33) && ((i & 254) == 2);\n            /* Do we expect a parse and re-serialize as uncompressed to give a matching y? */\n            ypass = xvalid && yvalid && ((i & 4) == ((pubkeyclen == 65) << 2)) &&\n                ((i == 4) || ((i & 251) == ysign)) && ((pubkeyclen == 33) || (pubkeyclen == 65));\n            if (xpass || ypass) {\n                /* These cases must parse. */\n                unsigned char pubkeyo[65];\n                size_t outl;\n                memset(&pubkey, 0, sizeof(pubkey));\n                VG_UNDEF(&pubkey, sizeof(pubkey));\n                ecount = 0;\n                CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, pubkeyc, pubkeyclen) == 1);\n                VG_CHECK(&pubkey, sizeof(pubkey));\n                outl = 65;\n                VG_UNDEF(pubkeyo, 65);\n                CHECK(secp256k1_ec_pubkey_serialize(ctx, pubkeyo, &outl, &pubkey, SECP256K1_EC_COMPRESSED) == 1);\n                VG_CHECK(pubkeyo, outl);\n                CHECK(outl == 33);\n                CHECK(memcmp(&pubkeyo[1], &pubkeyc[1], 32) == 0);\n                CHECK((pubkeyclen != 33) || (pubkeyo[0] == pubkeyc[0]));\n                if (ypass) {\n                    /* This test isn't always done because we decode with alternative signs, so the y won't match. */\n                    CHECK(pubkeyo[0] == ysign);\n                    CHECK(secp256k1_pubkey_load(ctx, &ge, &pubkey) == 1);\n                    memset(&pubkey, 0, sizeof(pubkey));\n                    VG_UNDEF(&pubkey, sizeof(pubkey));\n                    secp256k1_pubkey_save(&pubkey, &ge);\n                    VG_CHECK(&pubkey, sizeof(pubkey));\n                    outl = 65;\n                    VG_UNDEF(pubkeyo, 65);\n                    CHECK(secp256k1_ec_pubkey_serialize(ctx, pubkeyo, &outl, &pubkey, SECP256K1_EC_UNCOMPRESSED) == 1);\n                    VG_CHECK(pubkeyo, outl);\n                    CHECK(outl == 65);\n                    CHECK(pubkeyo[0] == 4);\n                    CHECK(memcmp(&pubkeyo[1], input, 64) == 0);\n                }\n                CHECK(ecount == 0);\n            } else {\n                /* These cases must fail to parse. */\n                memset(&pubkey, 0xfe, sizeof(pubkey));\n                ecount = 0;\n                VG_UNDEF(&pubkey, sizeof(pubkey));\n                CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, pubkeyc, pubkeyclen) == 0);\n                VG_CHECK(&pubkey, sizeof(pubkey));\n                CHECK(ecount == 0);\n                CHECK(secp256k1_pubkey_load(ctx, &ge, &pubkey) == 0);\n                CHECK(ecount == 1);\n            }\n        }\n    }\n    secp256k1_context_set_illegal_callback(ctx, NULL, NULL);\n}\n\nvoid run_ec_pubkey_parse_test(void) {\n#define SECP256K1_EC_PARSE_TEST_NVALID (12)\n    const unsigned char valid[SECP256K1_EC_PARSE_TEST_NVALID][64] = {\n        {\n            /* Point with leading and trailing zeros in x and y serialization. */\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x52,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x64, 0xef, 0xa1, 0x7b, 0x77, 0x61, 0xe1, 0xe4, 0x27, 0x06, 0x98, 0x9f, 0xb4, 0x83,\n            0xb8, 0xd2, 0xd4, 0x9b, 0xf7, 0x8f, 0xae, 0x98, 0x03, 0xf0, 0x99, 0xb8, 0x34, 0xed, 0xeb, 0x00\n        },\n        {\n            /* Point with x equal to a 3rd root of unity.*/\n            0x7a, 0xe9, 0x6a, 0x2b, 0x65, 0x7c, 0x07, 0x10, 0x6e, 0x64, 0x47, 0x9e, 0xac, 0x34, 0x34, 0xe9,\n            0x9c, 0xf0, 0x49, 0x75, 0x12, 0xf5, 0x89, 0x95, 0xc1, 0x39, 0x6c, 0x28, 0x71, 0x95, 0x01, 0xee,\n            0x42, 0x18, 0xf2, 0x0a, 0xe6, 0xc6, 0x46, 0xb3, 0x63, 0xdb, 0x68, 0x60, 0x58, 0x22, 0xfb, 0x14,\n            0x26, 0x4c, 0xa8, 0xd2, 0x58, 0x7f, 0xdd, 0x6f, 0xbc, 0x75, 0x0d, 0x58, 0x7e, 0x76, 0xa7, 0xee,\n        },\n        {\n            /* Point with largest x. (1/2) */\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x2c,\n            0x0e, 0x99, 0x4b, 0x14, 0xea, 0x72, 0xf8, 0xc3, 0xeb, 0x95, 0xc7, 0x1e, 0xf6, 0x92, 0x57, 0x5e,\n            0x77, 0x50, 0x58, 0x33, 0x2d, 0x7e, 0x52, 0xd0, 0x99, 0x5c, 0xf8, 0x03, 0x88, 0x71, 0xb6, 0x7d,\n        },\n        {\n            /* Point with largest x. (2/2) */\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x2c,\n            0xf1, 0x66, 0xb4, 0xeb, 0x15, 0x8d, 0x07, 0x3c, 0x14, 0x6a, 0x38, 0xe1, 0x09, 0x6d, 0xa8, 0xa1,\n            0x88, 0xaf, 0xa7, 0xcc, 0xd2, 0x81, 0xad, 0x2f, 0x66, 0xa3, 0x07, 0xfb, 0x77, 0x8e, 0x45, 0xb2,\n        },\n        {\n            /* Point with smallest x. (1/2) */\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n            0x42, 0x18, 0xf2, 0x0a, 0xe6, 0xc6, 0x46, 0xb3, 0x63, 0xdb, 0x68, 0x60, 0x58, 0x22, 0xfb, 0x14,\n            0x26, 0x4c, 0xa8, 0xd2, 0x58, 0x7f, 0xdd, 0x6f, 0xbc, 0x75, 0x0d, 0x58, 0x7e, 0x76, 0xa7, 0xee,\n        },\n        {\n            /* Point with smallest x. (2/2) */\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n            0xbd, 0xe7, 0x0d, 0xf5, 0x19, 0x39, 0xb9, 0x4c, 0x9c, 0x24, 0x97, 0x9f, 0xa7, 0xdd, 0x04, 0xeb,\n            0xd9, 0xb3, 0x57, 0x2d, 0xa7, 0x80, 0x22, 0x90, 0x43, 0x8a, 0xf2, 0xa6, 0x81, 0x89, 0x54, 0x41,\n        },\n        {\n            /* Point with largest y. (1/3) */\n            0x1f, 0xe1, 0xe5, 0xef, 0x3f, 0xce, 0xb5, 0xc1, 0x35, 0xab, 0x77, 0x41, 0x33, 0x3c, 0xe5, 0xa6,\n            0xe8, 0x0d, 0x68, 0x16, 0x76, 0x53, 0xf6, 0xb2, 0xb2, 0x4b, 0xcb, 0xcf, 0xaa, 0xaf, 0xf5, 0x07,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x2e,\n        },\n        {\n            /* Point with largest y. (2/3) */\n            0xcb, 0xb0, 0xde, 0xab, 0x12, 0x57, 0x54, 0xf1, 0xfd, 0xb2, 0x03, 0x8b, 0x04, 0x34, 0xed, 0x9c,\n            0xb3, 0xfb, 0x53, 0xab, 0x73, 0x53, 0x91, 0x12, 0x99, 0x94, 0xa5, 0x35, 0xd9, 0x25, 0xf6, 0x73,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x2e,\n        },\n        {\n            /* Point with largest y. (3/3) */\n            0x14, 0x6d, 0x3b, 0x65, 0xad, 0xd9, 0xf5, 0x4c, 0xcc, 0xa2, 0x85, 0x33, 0xc8, 0x8e, 0x2c, 0xbc,\n            0x63, 0xf7, 0x44, 0x3e, 0x16, 0x58, 0x78, 0x3a, 0xb4, 0x1f, 0x8e, 0xf9, 0x7c, 0x2a, 0x10, 0xb5,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x2e,\n        },\n        {\n            /* Point with smallest y. (1/3) */\n            0x1f, 0xe1, 0xe5, 0xef, 0x3f, 0xce, 0xb5, 0xc1, 0x35, 0xab, 0x77, 0x41, 0x33, 0x3c, 0xe5, 0xa6,\n            0xe8, 0x0d, 0x68, 0x16, 0x76, 0x53, 0xf6, 0xb2, 0xb2, 0x4b, 0xcb, 0xcf, 0xaa, 0xaf, 0xf5, 0x07,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n        },\n        {\n            /* Point with smallest y. (2/3) */\n            0xcb, 0xb0, 0xde, 0xab, 0x12, 0x57, 0x54, 0xf1, 0xfd, 0xb2, 0x03, 0x8b, 0x04, 0x34, 0xed, 0x9c,\n            0xb3, 0xfb, 0x53, 0xab, 0x73, 0x53, 0x91, 0x12, 0x99, 0x94, 0xa5, 0x35, 0xd9, 0x25, 0xf6, 0x73,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n        },\n        {\n            /* Point with smallest y. (3/3) */\n            0x14, 0x6d, 0x3b, 0x65, 0xad, 0xd9, 0xf5, 0x4c, 0xcc, 0xa2, 0x85, 0x33, 0xc8, 0x8e, 0x2c, 0xbc,\n            0x63, 0xf7, 0x44, 0x3e, 0x16, 0x58, 0x78, 0x3a, 0xb4, 0x1f, 0x8e, 0xf9, 0x7c, 0x2a, 0x10, 0xb5,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01\n        }\n    };\n#define SECP256K1_EC_PARSE_TEST_NXVALID (4)\n    const unsigned char onlyxvalid[SECP256K1_EC_PARSE_TEST_NXVALID][64] = {\n        {\n            /* Valid if y overflow ignored (y = 1 mod p). (1/3) */\n            0x1f, 0xe1, 0xe5, 0xef, 0x3f, 0xce, 0xb5, 0xc1, 0x35, 0xab, 0x77, 0x41, 0x33, 0x3c, 0xe5, 0xa6,\n            0xe8, 0x0d, 0x68, 0x16, 0x76, 0x53, 0xf6, 0xb2, 0xb2, 0x4b, 0xcb, 0xcf, 0xaa, 0xaf, 0xf5, 0x07,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x30,\n        },\n        {\n            /* Valid if y overflow ignored (y = 1 mod p). (2/3) */\n            0xcb, 0xb0, 0xde, 0xab, 0x12, 0x57, 0x54, 0xf1, 0xfd, 0xb2, 0x03, 0x8b, 0x04, 0x34, 0xed, 0x9c,\n            0xb3, 0xfb, 0x53, 0xab, 0x73, 0x53, 0x91, 0x12, 0x99, 0x94, 0xa5, 0x35, 0xd9, 0x25, 0xf6, 0x73,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x30,\n        },\n        {\n            /* Valid if y overflow ignored (y = 1 mod p). (3/3)*/\n            0x14, 0x6d, 0x3b, 0x65, 0xad, 0xd9, 0xf5, 0x4c, 0xcc, 0xa2, 0x85, 0x33, 0xc8, 0x8e, 0x2c, 0xbc,\n            0x63, 0xf7, 0x44, 0x3e, 0x16, 0x58, 0x78, 0x3a, 0xb4, 0x1f, 0x8e, 0xf9, 0x7c, 0x2a, 0x10, 0xb5,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x30,\n        },\n        {\n            /* x on curve, y is from y^2 = x^3 + 8. */\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03\n        }\n    };\n#define SECP256K1_EC_PARSE_TEST_NINVALID (7)\n    const unsigned char invalid[SECP256K1_EC_PARSE_TEST_NINVALID][64] = {\n        {\n            /* x is third root of -8, y is -1 * (x^3+7); also on the curve for y^2 = x^3 + 9. */\n            0x0a, 0x2d, 0x2b, 0xa9, 0x35, 0x07, 0xf1, 0xdf, 0x23, 0x37, 0x70, 0xc2, 0xa7, 0x97, 0x96, 0x2c,\n            0xc6, 0x1f, 0x6d, 0x15, 0xda, 0x14, 0xec, 0xd4, 0x7d, 0x8d, 0x27, 0xae, 0x1c, 0xd5, 0xf8, 0x53,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n        },\n        {\n            /* Valid if x overflow ignored (x = 1 mod p). */\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x30,\n            0x42, 0x18, 0xf2, 0x0a, 0xe6, 0xc6, 0x46, 0xb3, 0x63, 0xdb, 0x68, 0x60, 0x58, 0x22, 0xfb, 0x14,\n            0x26, 0x4c, 0xa8, 0xd2, 0x58, 0x7f, 0xdd, 0x6f, 0xbc, 0x75, 0x0d, 0x58, 0x7e, 0x76, 0xa7, 0xee,\n        },\n        {\n            /* Valid if x overflow ignored (x = 1 mod p). */\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x30,\n            0xbd, 0xe7, 0x0d, 0xf5, 0x19, 0x39, 0xb9, 0x4c, 0x9c, 0x24, 0x97, 0x9f, 0xa7, 0xdd, 0x04, 0xeb,\n            0xd9, 0xb3, 0x57, 0x2d, 0xa7, 0x80, 0x22, 0x90, 0x43, 0x8a, 0xf2, 0xa6, 0x81, 0x89, 0x54, 0x41,\n        },\n        {\n            /* x is -1, y is the result of the sqrt ladder; also on the curve for y^2 = x^3 - 5. */\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x2e,\n            0xf4, 0x84, 0x14, 0x5c, 0xb0, 0x14, 0x9b, 0x82, 0x5d, 0xff, 0x41, 0x2f, 0xa0, 0x52, 0xa8, 0x3f,\n            0xcb, 0x72, 0xdb, 0x61, 0xd5, 0x6f, 0x37, 0x70, 0xce, 0x06, 0x6b, 0x73, 0x49, 0xa2, 0xaa, 0x28,\n        },\n        {\n            /* x is -1, y is the result of the sqrt ladder; also on the curve for y^2 = x^3 - 5. */\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xfc, 0x2e,\n            0x0b, 0x7b, 0xeb, 0xa3, 0x4f, 0xeb, 0x64, 0x7d, 0xa2, 0x00, 0xbe, 0xd0, 0x5f, 0xad, 0x57, 0xc0,\n            0x34, 0x8d, 0x24, 0x9e, 0x2a, 0x90, 0xc8, 0x8f, 0x31, 0xf9, 0x94, 0x8b, 0xb6, 0x5d, 0x52, 0x07,\n        },\n        {\n            /* x is zero, y is the result of the sqrt ladder; also on the curve for y^2 = x^3 - 7. */\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x8f, 0x53, 0x7e, 0xef, 0xdf, 0xc1, 0x60, 0x6a, 0x07, 0x27, 0xcd, 0x69, 0xb4, 0xa7, 0x33, 0x3d,\n            0x38, 0xed, 0x44, 0xe3, 0x93, 0x2a, 0x71, 0x79, 0xee, 0xcb, 0x4b, 0x6f, 0xba, 0x93, 0x60, 0xdc,\n        },\n        {\n            /* x is zero, y is the result of the sqrt ladder; also on the curve for y^2 = x^3 - 7. */\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x70, 0xac, 0x81, 0x10, 0x20, 0x3e, 0x9f, 0x95, 0xf8, 0xd8, 0x32, 0x96, 0x4b, 0x58, 0xcc, 0xc2,\n            0xc7, 0x12, 0xbb, 0x1c, 0x6c, 0xd5, 0x8e, 0x86, 0x11, 0x34, 0xb4, 0x8f, 0x45, 0x6c, 0x9b, 0x53\n        }\n    };\n    const unsigned char pubkeyc[66] = {\n        /* Serialization of G. */\n        0x04, 0x79, 0xBE, 0x66, 0x7E, 0xF9, 0xDC, 0xBB, 0xAC, 0x55, 0xA0, 0x62, 0x95, 0xCE, 0x87, 0x0B,\n        0x07, 0x02, 0x9B, 0xFC, 0xDB, 0x2D, 0xCE, 0x28, 0xD9, 0x59, 0xF2, 0x81, 0x5B, 0x16, 0xF8, 0x17,\n        0x98, 0x48, 0x3A, 0xDA, 0x77, 0x26, 0xA3, 0xC4, 0x65, 0x5D, 0xA4, 0xFB, 0xFC, 0x0E, 0x11, 0x08,\n        0xA8, 0xFD, 0x17, 0xB4, 0x48, 0xA6, 0x85, 0x54, 0x19, 0x9C, 0x47, 0xD0, 0x8F, 0xFB, 0x10, 0xD4,\n        0xB8, 0x00\n    };\n    unsigned char sout[65];\n    unsigned char shortkey[2];\n    secp256k1_ge ge;\n    secp256k1_pubkey pubkey;\n    size_t len;\n    int32_t i;\n    int32_t ecount;\n    int32_t ecount2;\n    ecount = 0;\n    /* Nothing should be reading this far into pubkeyc. */\n    VG_UNDEF(&pubkeyc[65], 1);\n    secp256k1_context_set_illegal_callback(ctx, counting_illegal_callback_fn, &ecount);\n    /* Zero length claimed, fail, zeroize, no illegal arg error. */\n    memset(&pubkey, 0xfe, sizeof(pubkey));\n    ecount = 0;\n    VG_UNDEF(shortkey, 2);\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, shortkey, 0) == 0);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(ecount == 0);\n    CHECK(secp256k1_pubkey_load(ctx, &ge, &pubkey) == 0);\n    CHECK(ecount == 1);\n    /* Length one claimed, fail, zeroize, no illegal arg error. */\n    for (i = 0; i < 256 ; i++) {\n        memset(&pubkey, 0xfe, sizeof(pubkey));\n        ecount = 0;\n        shortkey[0] = i;\n        VG_UNDEF(&shortkey[1], 1);\n        VG_UNDEF(&pubkey, sizeof(pubkey));\n        CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, shortkey, 1) == 0);\n        VG_CHECK(&pubkey, sizeof(pubkey));\n        CHECK(ecount == 0);\n        CHECK(secp256k1_pubkey_load(ctx, &ge, &pubkey) == 0);\n        CHECK(ecount == 1);\n    }\n    /* Length two claimed, fail, zeroize, no illegal arg error. */\n    for (i = 0; i < 65536 ; i++) {\n        memset(&pubkey, 0xfe, sizeof(pubkey));\n        ecount = 0;\n        shortkey[0] = i & 255;\n        shortkey[1] = i >> 8;\n        VG_UNDEF(&pubkey, sizeof(pubkey));\n        CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, shortkey, 2) == 0);\n        VG_CHECK(&pubkey, sizeof(pubkey));\n        CHECK(ecount == 0);\n        CHECK(secp256k1_pubkey_load(ctx, &ge, &pubkey) == 0);\n        CHECK(ecount == 1);\n    }\n    memset(&pubkey, 0xfe, sizeof(pubkey));\n    ecount = 0;\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    /* 33 bytes claimed on otherwise valid input starting with 0x04, fail, zeroize output, no illegal arg error. */\n    CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, pubkeyc, 33) == 0);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(ecount == 0);\n    CHECK(secp256k1_pubkey_load(ctx, &ge, &pubkey) == 0);\n    CHECK(ecount == 1);\n    /* NULL pubkey, illegal arg error. Pubkey isn't rewritten before this step, since it's NULL into the parser. */\n    CHECK(secp256k1_ec_pubkey_parse(ctx, NULL, pubkeyc, 65) == 0);\n    CHECK(ecount == 2);\n    /* NULL input string. Illegal arg and zeroize output. */\n    memset(&pubkey, 0xfe, sizeof(pubkey));\n    ecount = 0;\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, NULL, 65) == 0);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(ecount == 1);\n    CHECK(secp256k1_pubkey_load(ctx, &ge, &pubkey) == 0);\n    CHECK(ecount == 2);\n    /* 64 bytes claimed on input starting with 0x04, fail, zeroize output, no illegal arg error. */\n    memset(&pubkey, 0xfe, sizeof(pubkey));\n    ecount = 0;\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, pubkeyc, 64) == 0);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(ecount == 0);\n    CHECK(secp256k1_pubkey_load(ctx, &ge, &pubkey) == 0);\n    CHECK(ecount == 1);\n    /* 66 bytes claimed, fail, zeroize output, no illegal arg error. */\n    memset(&pubkey, 0xfe, sizeof(pubkey));\n    ecount = 0;\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, pubkeyc, 66) == 0);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(ecount == 0);\n    CHECK(secp256k1_pubkey_load(ctx, &ge, &pubkey) == 0);\n    CHECK(ecount == 1);\n    /* Valid parse. */\n    memset(&pubkey, 0, sizeof(pubkey));\n    ecount = 0;\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, pubkeyc, 65) == 1);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(ecount == 0);\n    VG_UNDEF(&ge, sizeof(ge));\n    CHECK(secp256k1_pubkey_load(ctx, &ge, &pubkey) == 1);\n    VG_CHECK(&ge.x, sizeof(ge.x));\n    VG_CHECK(&ge.y, sizeof(ge.y));\n    VG_CHECK(&ge.infinity, sizeof(ge.infinity));\n    ge_equals_ge(&secp256k1_ge_const_g, &ge);\n    CHECK(ecount == 0);\n    /* secp256k1_ec_pubkey_serialize illegal args. */\n    ecount = 0;\n    len = 65;\n    CHECK(secp256k1_ec_pubkey_serialize(ctx, NULL, &len, &pubkey, SECP256K1_EC_UNCOMPRESSED) == 0);\n    CHECK(ecount == 1);\n    CHECK(len == 0);\n    CHECK(secp256k1_ec_pubkey_serialize(ctx, sout, NULL, &pubkey, SECP256K1_EC_UNCOMPRESSED) == 0);\n    CHECK(ecount == 2);\n    len = 65;\n    VG_UNDEF(sout, 65);\n    CHECK(secp256k1_ec_pubkey_serialize(ctx, sout, &len, NULL, SECP256K1_EC_UNCOMPRESSED) == 0);\n    VG_CHECK(sout, 65);\n    CHECK(ecount == 3);\n    CHECK(len == 0);\n    len = 65;\n    CHECK(secp256k1_ec_pubkey_serialize(ctx, sout, &len, &pubkey, ~0) == 0);\n    CHECK(ecount == 4);\n    CHECK(len == 0);\n    len = 65;\n    VG_UNDEF(sout, 65);\n    CHECK(secp256k1_ec_pubkey_serialize(ctx, sout, &len, &pubkey, SECP256K1_EC_UNCOMPRESSED) == 1);\n    VG_CHECK(sout, 65);\n    CHECK(ecount == 4);\n    CHECK(len == 65);\n    /* Multiple illegal args. Should still set arg error only once. */\n    ecount = 0;\n    ecount2 = 11;\n    CHECK(secp256k1_ec_pubkey_parse(ctx, NULL, NULL, 65) == 0);\n    CHECK(ecount == 1);\n    /* Does the illegal arg callback actually change the behavior? */\n    secp256k1_context_set_illegal_callback(ctx, uncounting_illegal_callback_fn, &ecount2);\n    CHECK(secp256k1_ec_pubkey_parse(ctx, NULL, NULL, 65) == 0);\n    CHECK(ecount == 1);\n    CHECK(ecount2 == 10);\n    secp256k1_context_set_illegal_callback(ctx, NULL, NULL);\n    /* Try a bunch of prefabbed points with all possible encodings. */\n    for (i = 0; i < SECP256K1_EC_PARSE_TEST_NVALID; i++) {\n        ec_pubkey_parse_pointtest(valid[i], 1, 1);\n    }\n    for (i = 0; i < SECP256K1_EC_PARSE_TEST_NXVALID; i++) {\n        ec_pubkey_parse_pointtest(onlyxvalid[i], 1, 0);\n    }\n    for (i = 0; i < SECP256K1_EC_PARSE_TEST_NINVALID; i++) {\n        ec_pubkey_parse_pointtest(invalid[i], 0, 0);\n    }\n}\n\nvoid run_eckey_edge_case_test(void) {\n    const unsigned char orderc[32] = {\n        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,\n        0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,\n        0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x41\n    };\n    const unsigned char zeros[sizeof(secp256k1_pubkey)] = {0x00};\n    unsigned char ctmp[33];\n    unsigned char ctmp2[33];\n    secp256k1_pubkey pubkey;\n    secp256k1_pubkey pubkey2;\n    secp256k1_pubkey pubkey_one;\n    secp256k1_pubkey pubkey_negone;\n    const secp256k1_pubkey *pubkeys[3];\n    size_t len;\n    int32_t ecount;\n    /* Group order is too large, reject. */\n    CHECK(secp256k1_ec_seckey_verify(ctx, orderc) == 0);\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, orderc) == 0);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) == 0);\n    /* Maximum value is too large, reject. */\n    memset(ctmp, 255, 32);\n    CHECK(secp256k1_ec_seckey_verify(ctx, ctmp) == 0);\n    memset(&pubkey, 1, sizeof(pubkey));\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, ctmp) == 0);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) == 0);\n    /* Zero is too small, reject. */\n    memset(ctmp, 0, 32);\n    CHECK(secp256k1_ec_seckey_verify(ctx, ctmp) == 0);\n    memset(&pubkey, 1, sizeof(pubkey));\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, ctmp) == 0);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) == 0);\n    /* One must be accepted. */\n    ctmp[31] = 0x01;\n    CHECK(secp256k1_ec_seckey_verify(ctx, ctmp) == 1);\n    memset(&pubkey, 0, sizeof(pubkey));\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, ctmp) == 1);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) > 0);\n    pubkey_one = pubkey;\n    /* Group order + 1 is too large, reject. */\n    memcpy(ctmp, orderc, 32);\n    ctmp[31] = 0x42;\n    CHECK(secp256k1_ec_seckey_verify(ctx, ctmp) == 0);\n    memset(&pubkey, 1, sizeof(pubkey));\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, ctmp) == 0);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) == 0);\n    /* -1 must be accepted. */\n    ctmp[31] = 0x40;\n    CHECK(secp256k1_ec_seckey_verify(ctx, ctmp) == 1);\n    memset(&pubkey, 0, sizeof(pubkey));\n    VG_UNDEF(&pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, ctmp) == 1);\n    VG_CHECK(&pubkey, sizeof(pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) > 0);\n    pubkey_negone = pubkey;\n    /* Tweak of zero leaves the value changed. */\n    memset(ctmp2, 0, 32);\n    CHECK(secp256k1_ec_privkey_tweak_add(ctx, ctmp, ctmp2) == 1);\n    CHECK(memcmp(orderc, ctmp, 31) == 0 && ctmp[31] == 0x40);\n    memcpy(&pubkey2, &pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_tweak_add(ctx, &pubkey, ctmp2) == 1);\n    CHECK(memcmp(&pubkey, &pubkey2, sizeof(pubkey)) == 0);\n    /* Multiply tweak of zero zeroizes the output. */\n    CHECK(secp256k1_ec_privkey_tweak_mul(ctx, ctmp, ctmp2) == 0);\n    CHECK(memcmp(zeros, ctmp, 32) == 0);\n    CHECK(secp256k1_ec_pubkey_tweak_mul(ctx, &pubkey, ctmp2) == 0);\n    CHECK(memcmp(&pubkey, zeros, sizeof(pubkey)) == 0);\n    memcpy(&pubkey, &pubkey2, sizeof(pubkey));\n    /* Overflowing key tweak zeroizes. */\n    memcpy(ctmp, orderc, 32);\n    ctmp[31] = 0x40;\n    CHECK(secp256k1_ec_privkey_tweak_add(ctx, ctmp, orderc) == 0);\n    CHECK(memcmp(zeros, ctmp, 32) == 0);\n    memcpy(ctmp, orderc, 32);\n    ctmp[31] = 0x40;\n    CHECK(secp256k1_ec_privkey_tweak_mul(ctx, ctmp, orderc) == 0);\n    CHECK(memcmp(zeros, ctmp, 32) == 0);\n    memcpy(ctmp, orderc, 32);\n    ctmp[31] = 0x40;\n    CHECK(secp256k1_ec_pubkey_tweak_add(ctx, &pubkey, orderc) == 0);\n    CHECK(memcmp(&pubkey, zeros, sizeof(pubkey)) == 0);\n    memcpy(&pubkey, &pubkey2, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_tweak_mul(ctx, &pubkey, orderc) == 0);\n    CHECK(memcmp(&pubkey, zeros, sizeof(pubkey)) == 0);\n    memcpy(&pubkey, &pubkey2, sizeof(pubkey));\n    /* Private key tweaks results in a key of zero. */\n    ctmp2[31] = 1;\n    CHECK(secp256k1_ec_privkey_tweak_add(ctx, ctmp2, ctmp) == 0);\n    CHECK(memcmp(zeros, ctmp2, 32) == 0);\n    ctmp2[31] = 1;\n    CHECK(secp256k1_ec_pubkey_tweak_add(ctx, &pubkey, ctmp2) == 0);\n    CHECK(memcmp(&pubkey, zeros, sizeof(pubkey)) == 0);\n    memcpy(&pubkey, &pubkey2, sizeof(pubkey));\n    /* Tweak computation wraps and results in a key of 1. */\n    ctmp2[31] = 2;\n    CHECK(secp256k1_ec_privkey_tweak_add(ctx, ctmp2, ctmp) == 1);\n    CHECK(memcmp(ctmp2, zeros, 31) == 0 && ctmp2[31] == 1);\n    ctmp2[31] = 2;\n    CHECK(secp256k1_ec_pubkey_tweak_add(ctx, &pubkey, ctmp2) == 1);\n    ctmp2[31] = 1;\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey2, ctmp2) == 1);\n    CHECK(memcmp(&pubkey, &pubkey2, sizeof(pubkey)) == 0);\n    /* Tweak mul * 2 = 1+1. */\n    CHECK(secp256k1_ec_pubkey_tweak_add(ctx, &pubkey, ctmp2) == 1);\n    ctmp2[31] = 2;\n    CHECK(secp256k1_ec_pubkey_tweak_mul(ctx, &pubkey2, ctmp2) == 1);\n    CHECK(memcmp(&pubkey, &pubkey2, sizeof(pubkey)) == 0);\n    /* Test argument errors. */\n    ecount = 0;\n    secp256k1_context_set_illegal_callback(ctx, counting_illegal_callback_fn, &ecount);\n    CHECK(ecount == 0);\n    /* Zeroize pubkey on parse error. */\n    memset(&pubkey, 0, 32);\n    CHECK(secp256k1_ec_pubkey_tweak_add(ctx, &pubkey, ctmp2) == 0);\n    CHECK(ecount == 1);\n    CHECK(memcmp(&pubkey, zeros, sizeof(pubkey)) == 0);\n    memcpy(&pubkey, &pubkey2, sizeof(pubkey));\n    memset(&pubkey2, 0, 32);\n    CHECK(secp256k1_ec_pubkey_tweak_mul(ctx, &pubkey2, ctmp2) == 0);\n    CHECK(ecount == 2);\n    CHECK(memcmp(&pubkey2, zeros, sizeof(pubkey2)) == 0);\n    /* Plain argument errors. */\n    ecount = 0;\n    CHECK(secp256k1_ec_seckey_verify(ctx, ctmp) == 1);\n    CHECK(ecount == 0);\n    CHECK(secp256k1_ec_seckey_verify(ctx, NULL) == 0);\n    CHECK(ecount == 1);\n    ecount = 0;\n    memset(ctmp2, 0, 32);\n    ctmp2[31] = 4;\n    CHECK(secp256k1_ec_pubkey_tweak_add(ctx, NULL, ctmp2) == 0);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ec_pubkey_tweak_add(ctx, &pubkey, NULL) == 0);\n    CHECK(ecount == 2);\n    ecount = 0;\n    memset(ctmp2, 0, 32);\n    ctmp2[31] = 4;\n    CHECK(secp256k1_ec_pubkey_tweak_mul(ctx, NULL, ctmp2) == 0);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ec_pubkey_tweak_mul(ctx, &pubkey, NULL) == 0);\n    CHECK(ecount == 2);\n    ecount = 0;\n    memset(ctmp2, 0, 32);\n    CHECK(secp256k1_ec_privkey_tweak_add(ctx, NULL, ctmp2) == 0);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ec_privkey_tweak_add(ctx, ctmp, NULL) == 0);\n    CHECK(ecount == 2);\n    ecount = 0;\n    memset(ctmp2, 0, 32);\n    ctmp2[31] = 1;\n    CHECK(secp256k1_ec_privkey_tweak_mul(ctx, NULL, ctmp2) == 0);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ec_privkey_tweak_mul(ctx, ctmp, NULL) == 0);\n    CHECK(ecount == 2);\n    ecount = 0;\n    CHECK(secp256k1_ec_pubkey_create(ctx, NULL, ctmp) == 0);\n    CHECK(ecount == 1);\n    memset(&pubkey, 1, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, NULL) == 0);\n    CHECK(ecount == 2);\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) == 0);\n    /* secp256k1_ec_pubkey_combine tests. */\n    ecount = 0;\n    pubkeys[0] = &pubkey_one;\n    VG_UNDEF(&pubkeys[0], sizeof(secp256k1_pubkey *));\n    VG_UNDEF(&pubkeys[1], sizeof(secp256k1_pubkey *));\n    VG_UNDEF(&pubkeys[2], sizeof(secp256k1_pubkey *));\n    memset(&pubkey, 255, sizeof(secp256k1_pubkey));\n    VG_UNDEF(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(secp256k1_ec_pubkey_combine(ctx, &pubkey, pubkeys, 0) == 0);\n    VG_CHECK(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) == 0);\n    CHECK(ecount == 1);\n    CHECK(secp256k1_ec_pubkey_combine(ctx, NULL, pubkeys, 1) == 0);\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) == 0);\n    CHECK(ecount == 2);\n    memset(&pubkey, 255, sizeof(secp256k1_pubkey));\n    VG_UNDEF(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(secp256k1_ec_pubkey_combine(ctx, &pubkey, NULL, 1) == 0);\n    VG_CHECK(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) == 0);\n    CHECK(ecount == 3);\n    pubkeys[0] = &pubkey_negone;\n    memset(&pubkey, 255, sizeof(secp256k1_pubkey));\n    VG_UNDEF(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(secp256k1_ec_pubkey_combine(ctx, &pubkey, pubkeys, 1) == 1);\n    VG_CHECK(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) > 0);\n    CHECK(ecount == 3);\n    len = 33;\n    CHECK(secp256k1_ec_pubkey_serialize(ctx, ctmp, &len, &pubkey, SECP256K1_EC_COMPRESSED) == 1);\n    CHECK(secp256k1_ec_pubkey_serialize(ctx, ctmp2, &len, &pubkey_negone, SECP256K1_EC_COMPRESSED) == 1);\n    CHECK(memcmp(ctmp, ctmp2, 33) == 0);\n    /* Result is infinity. */\n    pubkeys[0] = &pubkey_one;\n    pubkeys[1] = &pubkey_negone;\n    memset(&pubkey, 255, sizeof(secp256k1_pubkey));\n    VG_UNDEF(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(secp256k1_ec_pubkey_combine(ctx, &pubkey, pubkeys, 2) == 0);\n    VG_CHECK(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) == 0);\n    CHECK(ecount == 3);\n    /* Passes through infinity but comes out one. */\n    pubkeys[2] = &pubkey_one;\n    memset(&pubkey, 255, sizeof(secp256k1_pubkey));\n    VG_UNDEF(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(secp256k1_ec_pubkey_combine(ctx, &pubkey, pubkeys, 3) == 1);\n    VG_CHECK(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) > 0);\n    CHECK(ecount == 3);\n    len = 33;\n    CHECK(secp256k1_ec_pubkey_serialize(ctx, ctmp, &len, &pubkey, SECP256K1_EC_COMPRESSED) == 1);\n    CHECK(secp256k1_ec_pubkey_serialize(ctx, ctmp2, &len, &pubkey_one, SECP256K1_EC_COMPRESSED) == 1);\n    CHECK(memcmp(ctmp, ctmp2, 33) == 0);\n    /* Adds to two. */\n    pubkeys[1] = &pubkey_one;\n    memset(&pubkey, 255, sizeof(secp256k1_pubkey));\n    VG_UNDEF(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(secp256k1_ec_pubkey_combine(ctx, &pubkey, pubkeys, 2) == 1);\n    VG_CHECK(&pubkey, sizeof(secp256k1_pubkey));\n    CHECK(memcmp(&pubkey, zeros, sizeof(secp256k1_pubkey)) > 0);\n    CHECK(ecount == 3);\n    secp256k1_context_set_illegal_callback(ctx, NULL, NULL);\n}\n\nvoid random_sign(secp256k1_scalar *sigr, secp256k1_scalar *sigs, const secp256k1_scalar *key, const secp256k1_scalar *msg, int *recid) {\n    secp256k1_scalar nonce;\n    do {\n        random_scalar_order_test(&nonce);\n    } while(!secp256k1_ecdsa_sig_sign(&ctx->ecmult_gen_ctx, sigr, sigs, key, msg, &nonce, recid));\n}\n\nvoid test_ecdsa_sign_verify(void) {\n    secp256k1_gej pubj;\n    secp256k1_ge pub;\n    secp256k1_scalar one;\n    secp256k1_scalar msg, key;\n    secp256k1_scalar sigr, sigs;\n    int recid;\n    int getrec;\n    random_scalar_order_test(&msg);\n    random_scalar_order_test(&key);\n    secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &pubj, &key);\n    secp256k1_ge_set_gej(&pub, &pubj);\n    getrec = secp256k1_rand_bits(1);\n    random_sign(&sigr, &sigs, &key, &msg, getrec?&recid:NULL);\n    if (getrec) {\n        CHECK(recid >= 0 && recid < 4);\n    }\n    CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sigr, &sigs, &pub, &msg));\n    secp256k1_scalar_set_int(&one, 1);\n    secp256k1_scalar_add(&msg, &msg, &one);\n    CHECK(!secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sigr, &sigs, &pub, &msg));\n}\n\nvoid run_ecdsa_sign_verify(void) {\n    int i;\n    for (i = 0; i < 10*count; i++) {\n        test_ecdsa_sign_verify();\n    }\n}\n\n/** Dummy nonce generation function that just uses a precomputed nonce, and fails if it is not accepted. Use only for testing. */\nstatic int precomputed_nonce_function(unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter) {\n    (void)msg32;\n    (void)key32;\n    (void)algo16;\n    memcpy(nonce32, data, 32);\n    return (counter == 0);\n}\n\nstatic int nonce_function_test_fail(unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter) {\n   /* Dummy nonce generator that has a fatal error on the first counter value. */\n   if (counter == 0) {\n       return 0;\n   }\n   return nonce_function_rfc6979(nonce32, msg32, key32, algo16, data, counter - 1);\n}\n\nstatic int nonce_function_test_retry(unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter) {\n   /* Dummy nonce generator that produces unacceptable nonces for the first several counter values. */\n   if (counter < 3) {\n       memset(nonce32, counter==0 ? 0 : 255, 32);\n       if (counter == 2) {\n           nonce32[31]--;\n       }\n       return 1;\n   }\n   if (counter < 5) {\n       static const unsigned char order[] = {\n           0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n           0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,\n           0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,\n           0xBF,0xD2,0x5E,0x8C,0xD0,0x36,0x41,0x41\n       };\n       memcpy(nonce32, order, 32);\n       if (counter == 4) {\n           nonce32[31]++;\n       }\n       return 1;\n   }\n   /* Retry rate of 6979 is negligible esp. as we only call this in deterministic tests. */\n   /* If someone does fine a case where it retries for secp256k1, we'd like to know. */\n   if (counter > 5) {\n       return 0;\n   }\n   return nonce_function_rfc6979(nonce32, msg32, key32, algo16, data, counter - 5);\n}\n\nint is_empty_signature(const secp256k1_ecdsa_signature *sig) {\n    static const unsigned char res[sizeof(secp256k1_ecdsa_signature)] = {0};\n    return memcmp(sig, res, sizeof(secp256k1_ecdsa_signature)) == 0;\n}\n\nvoid test_ecdsa_end_to_end(void) {\n    unsigned char extra[32] = {0x00};\n    unsigned char privkey[32];\n    unsigned char message[32];\n    unsigned char privkey2[32];\n    secp256k1_ecdsa_signature signature[6];\n    secp256k1_scalar r, s;\n    unsigned char sig[74];\n    size_t siglen = 74;\n    unsigned char pubkeyc[65];\n    size_t pubkeyclen = 65;\n    secp256k1_pubkey pubkey;\n    secp256k1_pubkey pubkey_tmp;\n    unsigned char seckey[300];\n    size_t seckeylen = 300;\n\n    /* Generate a random key and message. */\n    {\n        secp256k1_scalar msg, key;\n        random_scalar_order_test(&msg);\n        random_scalar_order_test(&key);\n        secp256k1_scalar_get_b32(privkey, &key);\n        secp256k1_scalar_get_b32(message, &msg);\n    }\n\n    /* Construct and verify corresponding public key. */\n    CHECK(secp256k1_ec_seckey_verify(ctx, privkey) == 1);\n    CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, privkey) == 1);\n\n    /* Verify exporting and importing public key. */\n    CHECK(secp256k1_ec_pubkey_serialize(ctx, pubkeyc, &pubkeyclen, &pubkey, secp256k1_rand_bits(1) == 1 ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED));\n    memset(&pubkey, 0, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_parse(ctx, &pubkey, pubkeyc, pubkeyclen) == 1);\n\n    /* Verify negation changes the key and changes it back */\n    memcpy(&pubkey_tmp, &pubkey, sizeof(pubkey));\n    CHECK(secp256k1_ec_pubkey_negate(ctx, &pubkey_tmp) == 1);\n    CHECK(memcmp(&pubkey_tmp, &pubkey, sizeof(pubkey)) != 0);\n    CHECK(secp256k1_ec_pubkey_negate(ctx, &pubkey_tmp) == 1);\n    CHECK(memcmp(&pubkey_tmp, &pubkey, sizeof(pubkey)) == 0);\n\n    /* Verify private key import and export. */\n    CHECK(ec_privkey_export_der(ctx, seckey, &seckeylen, privkey, secp256k1_rand_bits(1) == 1));\n    CHECK(ec_privkey_import_der(ctx, privkey2, seckey, seckeylen) == 1);\n    CHECK(memcmp(privkey, privkey2, 32) == 0);\n\n    /* Optionally tweak the keys using addition. */\n    if (secp256k1_rand_int(3) == 0) {\n        int ret1;\n        int ret2;\n        unsigned char rnd[32];\n        secp256k1_pubkey pubkey2;\n        secp256k1_rand256_test(rnd);\n        ret1 = secp256k1_ec_privkey_tweak_add(ctx, privkey, rnd);\n        ret2 = secp256k1_ec_pubkey_tweak_add(ctx, &pubkey, rnd);\n        CHECK(ret1 == ret2);\n        if (ret1 == 0) {\n            return;\n        }\n        CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey2, privkey) == 1);\n        CHECK(memcmp(&pubkey, &pubkey2, sizeof(pubkey)) == 0);\n    }\n\n    /* Optionally tweak the keys using multiplication. */\n    if (secp256k1_rand_int(3) == 0) {\n        int ret1;\n        int ret2;\n        unsigned char rnd[32];\n        secp256k1_pubkey pubkey2;\n        secp256k1_rand256_test(rnd);\n        ret1 = secp256k1_ec_privkey_tweak_mul(ctx, privkey, rnd);\n        ret2 = secp256k1_ec_pubkey_tweak_mul(ctx, &pubkey, rnd);\n        CHECK(ret1 == ret2);\n        if (ret1 == 0) {\n            return;\n        }\n        CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey2, privkey) == 1);\n        CHECK(memcmp(&pubkey, &pubkey2, sizeof(pubkey)) == 0);\n    }\n\n    /* Sign. */\n    CHECK(secp256k1_ecdsa_sign(ctx, &signature[0], message, privkey, NULL, NULL) == 1);\n    CHECK(secp256k1_ecdsa_sign(ctx, &signature[4], message, privkey, NULL, NULL) == 1);\n    CHECK(secp256k1_ecdsa_sign(ctx, &signature[1], message, privkey, NULL, extra) == 1);\n    extra[31] = 1;\n    CHECK(secp256k1_ecdsa_sign(ctx, &signature[2], message, privkey, NULL, extra) == 1);\n    extra[31] = 0;\n    extra[0] = 1;\n    CHECK(secp256k1_ecdsa_sign(ctx, &signature[3], message, privkey, NULL, extra) == 1);\n    CHECK(memcmp(&signature[0], &signature[4], sizeof(signature[0])) == 0);\n    CHECK(memcmp(&signature[0], &signature[1], sizeof(signature[0])) != 0);\n    CHECK(memcmp(&signature[0], &signature[2], sizeof(signature[0])) != 0);\n    CHECK(memcmp(&signature[0], &signature[3], sizeof(signature[0])) != 0);\n    CHECK(memcmp(&signature[1], &signature[2], sizeof(signature[0])) != 0);\n    CHECK(memcmp(&signature[1], &signature[3], sizeof(signature[0])) != 0);\n    CHECK(memcmp(&signature[2], &signature[3], sizeof(signature[0])) != 0);\n    /* Verify. */\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[0], message, &pubkey) == 1);\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[1], message, &pubkey) == 1);\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[2], message, &pubkey) == 1);\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[3], message, &pubkey) == 1);\n    /* Test lower-S form, malleate, verify and fail, test again, malleate again */\n    CHECK(!secp256k1_ecdsa_signature_normalize(ctx, NULL, &signature[0]));\n    secp256k1_ecdsa_signature_load(ctx, &r, &s, &signature[0]);\n    secp256k1_scalar_negate(&s, &s);\n    secp256k1_ecdsa_signature_save(&signature[5], &r, &s);\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[5], message, &pubkey) == 0);\n    CHECK(secp256k1_ecdsa_signature_normalize(ctx, NULL, &signature[5]));\n    CHECK(secp256k1_ecdsa_signature_normalize(ctx, &signature[5], &signature[5]));\n    CHECK(!secp256k1_ecdsa_signature_normalize(ctx, NULL, &signature[5]));\n    CHECK(!secp256k1_ecdsa_signature_normalize(ctx, &signature[5], &signature[5]));\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[5], message, &pubkey) == 1);\n    secp256k1_scalar_negate(&s, &s);\n    secp256k1_ecdsa_signature_save(&signature[5], &r, &s);\n    CHECK(!secp256k1_ecdsa_signature_normalize(ctx, NULL, &signature[5]));\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[5], message, &pubkey) == 1);\n    CHECK(memcmp(&signature[5], &signature[0], 64) == 0);\n\n    /* Serialize/parse DER and verify again */\n    CHECK(secp256k1_ecdsa_signature_serialize_der(ctx, sig, &siglen, &signature[0]) == 1);\n    memset(&signature[0], 0, sizeof(signature[0]));\n    CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &signature[0], sig, siglen) == 1);\n    CHECK(secp256k1_ecdsa_verify(ctx, &signature[0], message, &pubkey) == 1);\n    /* Serialize/destroy/parse DER and verify again. */\n    siglen = 74;\n    CHECK(secp256k1_ecdsa_signature_serialize_der(ctx, sig, &siglen, &signature[0]) == 1);\n    sig[secp256k1_rand_int(siglen)] += 1 + secp256k1_rand_int(255);\n    CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &signature[0], sig, siglen) == 0 ||\n          secp256k1_ecdsa_verify(ctx, &signature[0], message, &pubkey) == 0);\n}\n\nvoid test_random_pubkeys(void) {\n    secp256k1_ge elem;\n    secp256k1_ge elem2;\n    unsigned char in[65];\n    /* Generate some randomly sized pubkeys. */\n    size_t len = secp256k1_rand_bits(2) == 0 ? 65 : 33;\n    if (secp256k1_rand_bits(2) == 0) {\n        len = secp256k1_rand_bits(6);\n    }\n    if (len == 65) {\n      in[0] = secp256k1_rand_bits(1) ? 4 : (secp256k1_rand_bits(1) ? 6 : 7);\n    } else {\n      in[0] = secp256k1_rand_bits(1) ? 2 : 3;\n    }\n    if (secp256k1_rand_bits(3) == 0) {\n        in[0] = secp256k1_rand_bits(8);\n    }\n    if (len > 1) {\n        secp256k1_rand256(&in[1]);\n    }\n    if (len > 33) {\n        secp256k1_rand256(&in[33]);\n    }\n    if (secp256k1_eckey_pubkey_parse(&elem, in, len)) {\n        unsigned char out[65];\n        unsigned char firstb;\n        int res;\n        size_t size = len;\n        firstb = in[0];\n        /* If the pubkey can be parsed, it should round-trip... */\n        CHECK(secp256k1_eckey_pubkey_serialize(&elem, out, &size, len == 33));\n        CHECK(size == len);\n        CHECK(memcmp(&in[1], &out[1], len-1) == 0);\n        /* ... except for the type of hybrid inputs. */\n        if ((in[0] != 6) && (in[0] != 7)) {\n            CHECK(in[0] == out[0]);\n        }\n        size = 65;\n        CHECK(secp256k1_eckey_pubkey_serialize(&elem, in, &size, 0));\n        CHECK(size == 65);\n        CHECK(secp256k1_eckey_pubkey_parse(&elem2, in, size));\n        ge_equals_ge(&elem,&elem2);\n        /* Check that the X9.62 hybrid type is checked. */\n        in[0] = secp256k1_rand_bits(1) ? 6 : 7;\n        res = secp256k1_eckey_pubkey_parse(&elem2, in, size);\n        if (firstb == 2 || firstb == 3) {\n            if (in[0] == firstb + 4) {\n              CHECK(res);\n            } else {\n              CHECK(!res);\n            }\n        }\n        if (res) {\n            ge_equals_ge(&elem,&elem2);\n            CHECK(secp256k1_eckey_pubkey_serialize(&elem, out, &size, 0));\n            CHECK(memcmp(&in[1], &out[1], 64) == 0);\n        }\n    }\n}\n\nvoid run_random_pubkeys(void) {\n    int i;\n    for (i = 0; i < 10*count; i++) {\n        test_random_pubkeys();\n    }\n}\n\nvoid run_ecdsa_end_to_end(void) {\n    int i;\n    for (i = 0; i < 64*count; i++) {\n        test_ecdsa_end_to_end();\n    }\n}\n\nint test_ecdsa_der_parse(const unsigned char *sig, size_t siglen, int certainly_der, int certainly_not_der) {\n    static const unsigned char zeroes[32] = {0};\n#ifdef ENABLE_OPENSSL_TESTS\n    static const unsigned char max_scalar[32] = {\n        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n        0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,\n        0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,\n        0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x40\n    };\n#endif\n\n    int ret = 0;\n\n    secp256k1_ecdsa_signature sig_der;\n    unsigned char roundtrip_der[2048];\n    unsigned char compact_der[64];\n    size_t len_der = 2048;\n    int parsed_der = 0, valid_der = 0, roundtrips_der = 0;\n\n    secp256k1_ecdsa_signature sig_der_lax;\n    unsigned char roundtrip_der_lax[2048];\n    unsigned char compact_der_lax[64];\n    size_t len_der_lax = 2048;\n    int parsed_der_lax = 0, valid_der_lax = 0, roundtrips_der_lax = 0;\n\n#ifdef ENABLE_OPENSSL_TESTS\n    ECDSA_SIG *sig_openssl;\n    const unsigned char *sigptr;\n    unsigned char roundtrip_openssl[2048];\n    int len_openssl = 2048;\n    int parsed_openssl, valid_openssl = 0, roundtrips_openssl = 0;\n#endif\n\n    parsed_der = secp256k1_ecdsa_signature_parse_der(ctx, &sig_der, sig, siglen);\n    if (parsed_der) {\n        ret |= (!secp256k1_ecdsa_signature_serialize_compact(ctx, compact_der, &sig_der)) << 0;\n        valid_der = (memcmp(compact_der, zeroes, 32) != 0) && (memcmp(compact_der + 32, zeroes, 32) != 0);\n    }\n    if (valid_der) {\n        ret |= (!secp256k1_ecdsa_signature_serialize_der(ctx, roundtrip_der, &len_der, &sig_der)) << 1;\n        roundtrips_der = (len_der == siglen) && memcmp(roundtrip_der, sig, siglen) == 0;\n    }\n\n    parsed_der_lax = ecdsa_signature_parse_der_lax(ctx, &sig_der_lax, sig, siglen);\n    if (parsed_der_lax) {\n        ret |= (!secp256k1_ecdsa_signature_serialize_compact(ctx, compact_der_lax, &sig_der_lax)) << 10;\n        valid_der_lax = (memcmp(compact_der_lax, zeroes, 32) != 0) && (memcmp(compact_der_lax + 32, zeroes, 32) != 0);\n    }\n    if (valid_der_lax) {\n        ret |= (!secp256k1_ecdsa_signature_serialize_der(ctx, roundtrip_der_lax, &len_der_lax, &sig_der_lax)) << 11;\n        roundtrips_der_lax = (len_der_lax == siglen) && memcmp(roundtrip_der_lax, sig, siglen) == 0;\n    }\n\n    if (certainly_der) {\n        ret |= (!parsed_der) << 2;\n    }\n    if (certainly_not_der) {\n        ret |= (parsed_der) << 17;\n    }\n    if (valid_der) {\n        ret |= (!roundtrips_der) << 3;\n    }\n\n    if (valid_der) {\n        ret |= (!roundtrips_der_lax) << 12;\n        ret |= (len_der != len_der_lax) << 13;\n        ret |= (memcmp(roundtrip_der_lax, roundtrip_der, len_der) != 0) << 14;\n    }\n    ret |= (roundtrips_der != roundtrips_der_lax) << 15;\n    if (parsed_der) {\n        ret |= (!parsed_der_lax) << 16;\n    }\n\n#ifdef ENABLE_OPENSSL_TESTS\n    sig_openssl = ECDSA_SIG_new();\n    sigptr = sig;\n    parsed_openssl = (d2i_ECDSA_SIG(&sig_openssl, &sigptr, siglen) != NULL);\n    if (parsed_openssl) {\n        valid_openssl = !BN_is_negative(sig_openssl->r) && !BN_is_negative(sig_openssl->s) && BN_num_bits(sig_openssl->r) > 0 && BN_num_bits(sig_openssl->r) <= 256 && BN_num_bits(sig_openssl->s) > 0 && BN_num_bits(sig_openssl->s) <= 256;\n        if (valid_openssl) {\n            unsigned char tmp[32] = {0};\n            BN_bn2bin(sig_openssl->r, tmp + 32 - BN_num_bytes(sig_openssl->r));\n            valid_openssl = memcmp(tmp, max_scalar, 32) < 0;\n        }\n        if (valid_openssl) {\n            unsigned char tmp[32] = {0};\n            BN_bn2bin(sig_openssl->s, tmp + 32 - BN_num_bytes(sig_openssl->s));\n            valid_openssl = memcmp(tmp, max_scalar, 32) < 0;\n        }\n    }\n    len_openssl = i2d_ECDSA_SIG(sig_openssl, NULL);\n    if (len_openssl <= 2048) {\n        unsigned char *ptr = roundtrip_openssl;\n        CHECK(i2d_ECDSA_SIG(sig_openssl, &ptr) == len_openssl);\n        roundtrips_openssl = valid_openssl && ((size_t)len_openssl == siglen) && (memcmp(roundtrip_openssl, sig, siglen) == 0);\n    } else {\n        len_openssl = 0;\n    }\n    ECDSA_SIG_free(sig_openssl);\n\n    ret |= (parsed_der && !parsed_openssl) << 4;\n    ret |= (valid_der && !valid_openssl) << 5;\n    ret |= (roundtrips_openssl && !parsed_der) << 6;\n    ret |= (roundtrips_der != roundtrips_openssl) << 7;\n    if (roundtrips_openssl) {\n        ret |= (len_der != (size_t)len_openssl) << 8;\n        ret |= (memcmp(roundtrip_der, roundtrip_openssl, len_der) != 0) << 9;\n    }\n#endif\n    return ret;\n}\n\nstatic void assign_big_endian(unsigned char *ptr, size_t ptrlen, uint32_t val) {\n    size_t i;\n    for (i = 0; i < ptrlen; i++) {\n        int shift = ptrlen - 1 - i;\n        if (shift >= 4) {\n            ptr[i] = 0;\n        } else {\n            ptr[i] = (val >> shift) & 0xFF;\n        }\n    }\n}\n\nstatic void damage_array(unsigned char *sig, size_t *len) {\n    int pos;\n    int action = secp256k1_rand_bits(3);\n    if (action < 1 && *len > 3) {\n        /* Delete a byte. */\n        pos = secp256k1_rand_int(*len);\n        memmove(sig + pos, sig + pos + 1, *len - pos - 1);\n        (*len)--;\n        return;\n    } else if (action < 2 && *len < 2048) {\n        /* Insert a byte. */\n        pos = secp256k1_rand_int(1 + *len);\n        memmove(sig + pos + 1, sig + pos, *len - pos);\n        sig[pos] = secp256k1_rand_bits(8);\n        (*len)++;\n        return;\n    } else if (action < 4) {\n        /* Modify a byte. */\n        sig[secp256k1_rand_int(*len)] += 1 + secp256k1_rand_int(255);\n        return;\n    } else { /* action < 8 */\n        /* Modify a bit. */\n        sig[secp256k1_rand_int(*len)] ^= 1 << secp256k1_rand_bits(3);\n        return;\n    }\n}\n\nstatic void random_ber_signature(unsigned char *sig, size_t *len, int* certainly_der, int* certainly_not_der) {\n    int der;\n    int nlow[2], nlen[2], nlenlen[2], nhbit[2], nhbyte[2], nzlen[2];\n    size_t tlen, elen, glen;\n    int indet;\n    int n;\n\n    *len = 0;\n    der = secp256k1_rand_bits(2) == 0;\n    *certainly_der = der;\n    *certainly_not_der = 0;\n    indet = der ? 0 : secp256k1_rand_int(10) == 0;\n\n    for (n = 0; n < 2; n++) {\n        /* We generate two classes of numbers: nlow==1 \"low\" ones (up to 32 bytes), nlow==0 \"high\" ones (32 bytes with 129 top bits set, or larger than 32 bytes) */\n        nlow[n] = der ? 1 : (secp256k1_rand_bits(3) != 0);\n        /* The length of the number in bytes (the first byte of which will always be nonzero) */\n        nlen[n] = nlow[n] ? secp256k1_rand_int(33) : 32 + secp256k1_rand_int(200) * secp256k1_rand_int(8) / 8;\n        CHECK(nlen[n] <= 232);\n        /* The top bit of the number. */\n        nhbit[n] = (nlow[n] == 0 && nlen[n] == 32) ? 1 : (nlen[n] == 0 ? 0 : secp256k1_rand_bits(1));\n        /* The top byte of the number (after the potential hardcoded 16 0xFF characters for \"high\" 32 bytes numbers) */\n        nhbyte[n] = nlen[n] == 0 ? 0 : (nhbit[n] ? 128 + secp256k1_rand_bits(7) : 1 + secp256k1_rand_int(127));\n        /* The number of zero bytes in front of the number (which is 0 or 1 in case of DER, otherwise we extend up to 300 bytes) */\n        nzlen[n] = der ? ((nlen[n] == 0 || nhbit[n]) ? 1 : 0) : (nlow[n] ? secp256k1_rand_int(3) : secp256k1_rand_int(300 - nlen[n]) * secp256k1_rand_int(8) / 8);\n        if (nzlen[n] > ((nlen[n] == 0 || nhbit[n]) ? 1 : 0)) {\n            *certainly_not_der = 1;\n        }\n        CHECK(nlen[n] + nzlen[n] <= 300);\n        /* The length of the length descriptor for the number. 0 means short encoding, anything else is long encoding. */\n        nlenlen[n] = nlen[n] + nzlen[n] < 128 ? 0 : (nlen[n] + nzlen[n] < 256 ? 1 : 2);\n        if (!der) {\n            /* nlenlen[n] max 127 bytes */\n            int add = secp256k1_rand_int(127 - nlenlen[n]) * secp256k1_rand_int(16) * secp256k1_rand_int(16) / 256;\n            nlenlen[n] += add;\n            if (add != 0) {\n                *certainly_not_der = 1;\n            }\n        }\n        CHECK(nlen[n] + nzlen[n] + nlenlen[n] <= 427);\n    }\n\n    /* The total length of the data to go, so far */\n    tlen = 2 + nlenlen[0] + nlen[0] + nzlen[0] + 2 + nlenlen[1] + nlen[1] + nzlen[1];\n    CHECK(tlen <= 856);\n\n    /* The length of the garbage inside the tuple. */\n    elen = (der || indet) ? 0 : secp256k1_rand_int(980 - tlen) * secp256k1_rand_int(8) / 8;\n    if (elen != 0) {\n        *certainly_not_der = 1;\n    }\n    tlen += elen;\n    CHECK(tlen <= 980);\n\n    /* The length of the garbage after the end of the tuple. */\n    glen = der ? 0 : secp256k1_rand_int(990 - tlen) * secp256k1_rand_int(8) / 8;\n    if (glen != 0) {\n        *certainly_not_der = 1;\n    }\n    CHECK(tlen + glen <= 990);\n\n    /* Write the tuple header. */\n    sig[(*len)++] = 0x30;\n    if (indet) {\n        /* Indeterminate length */\n        sig[(*len)++] = 0x80;\n        *certainly_not_der = 1;\n    } else {\n        int tlenlen = tlen < 128 ? 0 : (tlen < 256 ? 1 : 2);\n        if (!der) {\n            int add = secp256k1_rand_int(127 - tlenlen) * secp256k1_rand_int(16) * secp256k1_rand_int(16) / 256;\n            tlenlen += add;\n            if (add != 0) {\n                *certainly_not_der = 1;\n            }\n        }\n        if (tlenlen == 0) {\n            /* Short length notation */\n            sig[(*len)++] = tlen;\n        } else {\n            /* Long length notation */\n            sig[(*len)++] = 128 + tlenlen;\n            assign_big_endian(sig + *len, tlenlen, tlen);\n            *len += tlenlen;\n        }\n        tlen += tlenlen;\n    }\n    tlen += 2;\n    CHECK(tlen + glen <= 1119);\n\n    for (n = 0; n < 2; n++) {\n        /* Write the integer header. */\n        sig[(*len)++] = 0x02;\n        if (nlenlen[n] == 0) {\n            /* Short length notation */\n            sig[(*len)++] = nlen[n] + nzlen[n];\n        } else {\n            /* Long length notation. */\n            sig[(*len)++] = 128 + nlenlen[n];\n            assign_big_endian(sig + *len, nlenlen[n], nlen[n] + nzlen[n]);\n            *len += nlenlen[n];\n        }\n        /* Write zero padding */\n        while (nzlen[n] > 0) {\n            sig[(*len)++] = 0x00;\n            nzlen[n]--;\n        }\n        if (nlen[n] == 32 && !nlow[n]) {\n            /* Special extra 16 0xFF bytes in \"high\" 32-byte numbers */\n            int i;\n            for (i = 0; i < 16; i++) {\n                sig[(*len)++] = 0xFF;\n            }\n            nlen[n] -= 16;\n        }\n        /* Write first byte of number */\n        if (nlen[n] > 0) {\n            sig[(*len)++] = nhbyte[n];\n            nlen[n]--;\n        }\n        /* Generate remaining random bytes of number */\n        secp256k1_rand_bytes_test(sig + *len, nlen[n]);\n        *len += nlen[n];\n        nlen[n] = 0;\n    }\n\n    /* Generate random garbage inside tuple. */\n    secp256k1_rand_bytes_test(sig + *len, elen);\n    *len += elen;\n\n    /* Generate end-of-contents bytes. */\n    if (indet) {\n        sig[(*len)++] = 0;\n        sig[(*len)++] = 0;\n        tlen += 2;\n    }\n    CHECK(tlen + glen <= 1121);\n\n    /* Generate random garbage outside tuple. */\n    secp256k1_rand_bytes_test(sig + *len, glen);\n    *len += glen;\n    tlen += glen;\n    CHECK(tlen <= 1121);\n    CHECK(tlen == *len);\n}\n\nvoid run_ecdsa_der_parse(void) {\n    int i,j;\n    for (i = 0; i < 200 * count; i++) {\n        unsigned char buffer[2048];\n        size_t buflen = 0;\n        int certainly_der = 0;\n        int certainly_not_der = 0;\n        random_ber_signature(buffer, &buflen, &certainly_der, &certainly_not_der);\n        CHECK(buflen <= 2048);\n        for (j = 0; j < 16; j++) {\n            int ret = 0;\n            if (j > 0) {\n                damage_array(buffer, &buflen);\n                /* We don't know anything anymore about the DERness of the result */\n                certainly_der = 0;\n                certainly_not_der = 0;\n            }\n            ret = test_ecdsa_der_parse(buffer, buflen, certainly_der, certainly_not_der);\n            if (ret != 0) {\n                size_t k;\n                fprintf(stderr, \"Failure %x on \", ret);\n                for (k = 0; k < buflen; k++) {\n                    fprintf(stderr, \"%02x \", buffer[k]);\n                }\n                fprintf(stderr, \"\\n\");\n            }\n            CHECK(ret == 0);\n        }\n    }\n}\n\n/* Tests several edge cases. */\nvoid test_ecdsa_edge_cases(void) {\n    int t;\n    secp256k1_ecdsa_signature sig;\n\n    /* Test the case where ECDSA recomputes a point that is infinity. */\n    {\n        secp256k1_gej keyj;\n        secp256k1_ge key;\n        secp256k1_scalar msg;\n        secp256k1_scalar sr, ss;\n        secp256k1_scalar_set_int(&ss, 1);\n        secp256k1_scalar_negate(&ss, &ss);\n        secp256k1_scalar_inverse(&ss, &ss);\n        secp256k1_scalar_set_int(&sr, 1);\n        secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &keyj, &sr);\n        secp256k1_ge_set_gej(&key, &keyj);\n        msg = ss;\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 0);\n    }\n\n    /* Verify signature with r of zero fails. */\n    {\n        const unsigned char pubkey_mods_zero[33] = {\n            0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xfe, 0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0,\n            0x3b, 0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41,\n            0x41\n        };\n        secp256k1_ge key;\n        secp256k1_scalar msg;\n        secp256k1_scalar sr, ss;\n        secp256k1_scalar_set_int(&ss, 1);\n        secp256k1_scalar_set_int(&msg, 0);\n        secp256k1_scalar_set_int(&sr, 0);\n        CHECK(secp256k1_eckey_pubkey_parse(&key, pubkey_mods_zero, 33));\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 0);\n    }\n\n    /* Verify signature with s of zero fails. */\n    {\n        const unsigned char pubkey[33] = {\n            0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x01\n        };\n        secp256k1_ge key;\n        secp256k1_scalar msg;\n        secp256k1_scalar sr, ss;\n        secp256k1_scalar_set_int(&ss, 0);\n        secp256k1_scalar_set_int(&msg, 0);\n        secp256k1_scalar_set_int(&sr, 1);\n        CHECK(secp256k1_eckey_pubkey_parse(&key, pubkey, 33));\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 0);\n    }\n\n    /* Verify signature with message 0 passes. */\n    {\n        const unsigned char pubkey[33] = {\n            0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x02\n        };\n        const unsigned char pubkey2[33] = {\n            0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xfe, 0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0,\n            0x3b, 0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41,\n            0x43\n        };\n        secp256k1_ge key;\n        secp256k1_ge key2;\n        secp256k1_scalar msg;\n        secp256k1_scalar sr, ss;\n        secp256k1_scalar_set_int(&ss, 2);\n        secp256k1_scalar_set_int(&msg, 0);\n        secp256k1_scalar_set_int(&sr, 2);\n        CHECK(secp256k1_eckey_pubkey_parse(&key, pubkey, 33));\n        CHECK(secp256k1_eckey_pubkey_parse(&key2, pubkey2, 33));\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 1);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key2, &msg) == 1);\n        secp256k1_scalar_negate(&ss, &ss);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 1);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key2, &msg) == 1);\n        secp256k1_scalar_set_int(&ss, 1);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 0);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key2, &msg) == 0);\n    }\n\n    /* Verify signature with message 1 passes. */\n    {\n        const unsigned char pubkey[33] = {\n            0x02, 0x14, 0x4e, 0x5a, 0x58, 0xef, 0x5b, 0x22,\n            0x6f, 0xd2, 0xe2, 0x07, 0x6a, 0x77, 0xcf, 0x05,\n            0xb4, 0x1d, 0xe7, 0x4a, 0x30, 0x98, 0x27, 0x8c,\n            0x93, 0xe6, 0xe6, 0x3c, 0x0b, 0xc4, 0x73, 0x76,\n            0x25\n        };\n        const unsigned char pubkey2[33] = {\n            0x02, 0x8a, 0xd5, 0x37, 0xed, 0x73, 0xd9, 0x40,\n            0x1d, 0xa0, 0x33, 0xd2, 0xdc, 0xf0, 0xaf, 0xae,\n            0x34, 0xcf, 0x5f, 0x96, 0x4c, 0x73, 0x28, 0x0f,\n            0x92, 0xc0, 0xf6, 0x9d, 0xd9, 0xb2, 0x09, 0x10,\n            0x62\n        };\n        const unsigned char csr[32] = {\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n            0x45, 0x51, 0x23, 0x19, 0x50, 0xb7, 0x5f, 0xc4,\n            0x40, 0x2d, 0xa1, 0x72, 0x2f, 0xc9, 0xba, 0xeb\n        };\n        secp256k1_ge key;\n        secp256k1_ge key2;\n        secp256k1_scalar msg;\n        secp256k1_scalar sr, ss;\n        secp256k1_scalar_set_int(&ss, 1);\n        secp256k1_scalar_set_int(&msg, 1);\n        secp256k1_scalar_set_b32(&sr, csr, NULL);\n        CHECK(secp256k1_eckey_pubkey_parse(&key, pubkey, 33));\n        CHECK(secp256k1_eckey_pubkey_parse(&key2, pubkey2, 33));\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 1);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key2, &msg) == 1);\n        secp256k1_scalar_negate(&ss, &ss);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 1);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key2, &msg) == 1);\n        secp256k1_scalar_set_int(&ss, 2);\n        secp256k1_scalar_inverse_var(&ss, &ss);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 0);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key2, &msg) == 0);\n    }\n\n    /* Verify signature with message -1 passes. */\n    {\n        const unsigned char pubkey[33] = {\n            0x03, 0xaf, 0x97, 0xff, 0x7d, 0x3a, 0xf6, 0xa0,\n            0x02, 0x94, 0xbd, 0x9f, 0x4b, 0x2e, 0xd7, 0x52,\n            0x28, 0xdb, 0x49, 0x2a, 0x65, 0xcb, 0x1e, 0x27,\n            0x57, 0x9c, 0xba, 0x74, 0x20, 0xd5, 0x1d, 0x20,\n            0xf1\n        };\n        const unsigned char csr[32] = {\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n            0x45, 0x51, 0x23, 0x19, 0x50, 0xb7, 0x5f, 0xc4,\n            0x40, 0x2d, 0xa1, 0x72, 0x2f, 0xc9, 0xba, 0xee\n        };\n        secp256k1_ge key;\n        secp256k1_scalar msg;\n        secp256k1_scalar sr, ss;\n        secp256k1_scalar_set_int(&ss, 1);\n        secp256k1_scalar_set_int(&msg, 1);\n        secp256k1_scalar_negate(&msg, &msg);\n        secp256k1_scalar_set_b32(&sr, csr, NULL);\n        CHECK(secp256k1_eckey_pubkey_parse(&key, pubkey, 33));\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 1);\n        secp256k1_scalar_negate(&ss, &ss);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 1);\n        secp256k1_scalar_set_int(&ss, 3);\n        secp256k1_scalar_inverse_var(&ss, &ss);\n        CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sr, &ss, &key, &msg) == 0);\n    }\n\n    /* Signature where s would be zero. */\n    {\n        secp256k1_pubkey pubkey;\n        size_t siglen;\n        int32_t ecount;\n        unsigned char signature[72];\n        static const unsigned char nonce[32] = {\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n        };\n        static const unsigned char nonce2[32] = {\n            0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,\n            0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,\n            0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,\n            0xBF,0xD2,0x5E,0x8C,0xD0,0x36,0x41,0x40\n        };\n        const unsigned char key[32] = {\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,\n        };\n        unsigned char msg[32] = {\n            0x86, 0x41, 0x99, 0x81, 0x06, 0x23, 0x44, 0x53,\n            0xaa, 0x5f, 0x9d, 0x6a, 0x31, 0x78, 0xf4, 0xf7,\n            0xb8, 0x12, 0xe0, 0x0b, 0x81, 0x7a, 0x77, 0x62,\n            0x65, 0xdf, 0xdd, 0x31, 0xb9, 0x3e, 0x29, 0xa9,\n        };\n        ecount = 0;\n        secp256k1_context_set_illegal_callback(ctx, counting_illegal_callback_fn, &ecount);\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig, msg, key, precomputed_nonce_function, nonce) == 0);\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig, msg, key, precomputed_nonce_function, nonce2) == 0);\n        msg[31] = 0xaa;\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig, msg, key, precomputed_nonce_function, nonce) == 1);\n        CHECK(ecount == 0);\n        CHECK(secp256k1_ecdsa_sign(ctx, NULL, msg, key, precomputed_nonce_function, nonce2) == 0);\n        CHECK(ecount == 1);\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig, NULL, key, precomputed_nonce_function, nonce2) == 0);\n        CHECK(ecount == 2);\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig, msg, NULL, precomputed_nonce_function, nonce2) == 0);\n        CHECK(ecount == 3);\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig, msg, key, precomputed_nonce_function, nonce2) == 1);\n        CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, key) == 1);\n        CHECK(secp256k1_ecdsa_verify(ctx, NULL, msg, &pubkey) == 0);\n        CHECK(ecount == 4);\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, NULL, &pubkey) == 0);\n        CHECK(ecount == 5);\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg, NULL) == 0);\n        CHECK(ecount == 6);\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg, &pubkey) == 1);\n        CHECK(ecount == 6);\n        CHECK(secp256k1_ec_pubkey_create(ctx, &pubkey, NULL) == 0);\n        CHECK(ecount == 7);\n        /* That pubkeyload fails via an ARGCHECK is a little odd but makes sense because pubkeys are an opaque data type. */\n        CHECK(secp256k1_ecdsa_verify(ctx, &sig, msg, &pubkey) == 0);\n        CHECK(ecount == 8);\n        siglen = 72;\n        CHECK(secp256k1_ecdsa_signature_serialize_der(ctx, NULL, &siglen, &sig) == 0);\n        CHECK(ecount == 9);\n        CHECK(secp256k1_ecdsa_signature_serialize_der(ctx, signature, NULL, &sig) == 0);\n        CHECK(ecount == 10);\n        CHECK(secp256k1_ecdsa_signature_serialize_der(ctx, signature, &siglen, NULL) == 0);\n        CHECK(ecount == 11);\n        CHECK(secp256k1_ecdsa_signature_serialize_der(ctx, signature, &siglen, &sig) == 1);\n        CHECK(ecount == 11);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, NULL, signature, siglen) == 0);\n        CHECK(ecount == 12);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, NULL, siglen) == 0);\n        CHECK(ecount == 13);\n        CHECK(secp256k1_ecdsa_signature_parse_der(ctx, &sig, signature, siglen) == 1);\n        CHECK(ecount == 13);\n        siglen = 10;\n        /* Too little room for a signature does not fail via ARGCHECK. */\n        CHECK(secp256k1_ecdsa_signature_serialize_der(ctx, signature, &siglen, &sig) == 0);\n        CHECK(ecount == 13);\n        ecount = 0;\n        CHECK(secp256k1_ecdsa_signature_normalize(ctx, NULL, NULL) == 0);\n        CHECK(ecount == 1);\n        CHECK(secp256k1_ecdsa_signature_serialize_compact(ctx, NULL, &sig) == 0);\n        CHECK(ecount == 2);\n        CHECK(secp256k1_ecdsa_signature_serialize_compact(ctx, signature, NULL) == 0);\n        CHECK(ecount == 3);\n        CHECK(secp256k1_ecdsa_signature_serialize_compact(ctx, signature, &sig) == 1);\n        CHECK(ecount == 3);\n        CHECK(secp256k1_ecdsa_signature_parse_compact(ctx, NULL, signature) == 0);\n        CHECK(ecount == 4);\n        CHECK(secp256k1_ecdsa_signature_parse_compact(ctx, &sig, NULL) == 0);\n        CHECK(ecount == 5);\n        CHECK(secp256k1_ecdsa_signature_parse_compact(ctx, &sig, signature) == 1);\n        CHECK(ecount == 5);\n        memset(signature, 255, 64);\n        CHECK(secp256k1_ecdsa_signature_parse_compact(ctx, &sig, signature) == 0);\n        CHECK(ecount == 5);\n        secp256k1_context_set_illegal_callback(ctx, NULL, NULL);\n    }\n\n    /* Nonce function corner cases. */\n    for (t = 0; t < 2; t++) {\n        static const unsigned char zero[32] = {0x00};\n        int i;\n        unsigned char key[32];\n        unsigned char msg[32];\n        secp256k1_ecdsa_signature sig2;\n        secp256k1_scalar sr[512], ss;\n        const unsigned char *extra;\n        extra = t == 0 ? NULL : zero;\n        memset(msg, 0, 32);\n        msg[31] = 1;\n        /* High key results in signature failure. */\n        memset(key, 0xFF, 32);\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig, msg, key, NULL, extra) == 0);\n        CHECK(is_empty_signature(&sig));\n        /* Zero key results in signature failure. */\n        memset(key, 0, 32);\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig, msg, key, NULL, extra) == 0);\n        CHECK(is_empty_signature(&sig));\n        /* Nonce function failure results in signature failure. */\n        key[31] = 1;\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig, msg, key, nonce_function_test_fail, extra) == 0);\n        CHECK(is_empty_signature(&sig));\n        /* The retry loop successfully makes its way to the first good value. */\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig, msg, key, nonce_function_test_retry, extra) == 1);\n        CHECK(!is_empty_signature(&sig));\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig2, msg, key, nonce_function_rfc6979, extra) == 1);\n        CHECK(!is_empty_signature(&sig2));\n        CHECK(memcmp(&sig, &sig2, sizeof(sig)) == 0);\n        /* The default nonce function is deterministic. */\n        CHECK(secp256k1_ecdsa_sign(ctx, &sig2, msg, key, NULL, extra) == 1);\n        CHECK(!is_empty_signature(&sig2));\n        CHECK(memcmp(&sig, &sig2, sizeof(sig)) == 0);\n        /* The default nonce function changes output with different messages. */\n        for(i = 0; i < 256; i++) {\n            int j;\n            msg[0] = i;\n            CHECK(secp256k1_ecdsa_sign(ctx, &sig2, msg, key, NULL, extra) == 1);\n            CHECK(!is_empty_signature(&sig2));\n            secp256k1_ecdsa_signature_load(ctx, &sr[i], &ss, &sig2);\n            for (j = 0; j < i; j++) {\n                CHECK(!secp256k1_scalar_eq(&sr[i], &sr[j]));\n            }\n        }\n        msg[0] = 0;\n        msg[31] = 2;\n        /* The default nonce function changes output with different keys. */\n        for(i = 256; i < 512; i++) {\n            int j;\n            key[0] = i - 256;\n            CHECK(secp256k1_ecdsa_sign(ctx, &sig2, msg, key, NULL, extra) == 1);\n            CHECK(!is_empty_signature(&sig2));\n            secp256k1_ecdsa_signature_load(ctx, &sr[i], &ss, &sig2);\n            for (j = 0; j < i; j++) {\n                CHECK(!secp256k1_scalar_eq(&sr[i], &sr[j]));\n            }\n        }\n        key[0] = 0;\n    }\n\n    {\n        /* Check that optional nonce arguments do not have equivalent effect. */\n        const unsigned char zeros[32] = {0};\n        unsigned char nonce[32];\n        unsigned char nonce2[32];\n        unsigned char nonce3[32];\n        unsigned char nonce4[32];\n        VG_UNDEF(nonce,32);\n        VG_UNDEF(nonce2,32);\n        VG_UNDEF(nonce3,32);\n        VG_UNDEF(nonce4,32);\n        CHECK(nonce_function_rfc6979(nonce, zeros, zeros, NULL, NULL, 0) == 1);\n        VG_CHECK(nonce,32);\n        CHECK(nonce_function_rfc6979(nonce2, zeros, zeros, zeros, NULL, 0) == 1);\n        VG_CHECK(nonce2,32);\n        CHECK(nonce_function_rfc6979(nonce3, zeros, zeros, NULL, (void *)zeros, 0) == 1);\n        VG_CHECK(nonce3,32);\n        CHECK(nonce_function_rfc6979(nonce4, zeros, zeros, zeros, (void *)zeros, 0) == 1);\n        VG_CHECK(nonce4,32);\n        CHECK(memcmp(nonce, nonce2, 32) != 0);\n        CHECK(memcmp(nonce, nonce3, 32) != 0);\n        CHECK(memcmp(nonce, nonce4, 32) != 0);\n        CHECK(memcmp(nonce2, nonce3, 32) != 0);\n        CHECK(memcmp(nonce2, nonce4, 32) != 0);\n        CHECK(memcmp(nonce3, nonce4, 32) != 0);\n    }\n\n\n    /* Privkey export where pubkey is the point at infinity. */\n    {\n        unsigned char privkey[300];\n        unsigned char seckey[32] = {\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n            0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,\n            0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,\n            0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x41,\n        };\n        size_t outlen = 300;\n        CHECK(!ec_privkey_export_der(ctx, privkey, &outlen, seckey, 0));\n        outlen = 300;\n        CHECK(!ec_privkey_export_der(ctx, privkey, &outlen, seckey, 1));\n    }\n}\n\nvoid run_ecdsa_edge_cases(void) {\n    test_ecdsa_edge_cases();\n}\n\n#ifdef ENABLE_OPENSSL_TESTS\nEC_KEY *get_openssl_key(const unsigned char *key32) {\n    unsigned char privkey[300];\n    size_t privkeylen;\n    const unsigned char* pbegin = privkey;\n    int compr = secp256k1_rand_bits(1);\n    EC_KEY *ec_key = EC_KEY_new_by_curve_name(NID_secp256k1);\n    CHECK(ec_privkey_export_der(ctx, privkey, &privkeylen, key32, compr));\n    CHECK(d2i_ECPrivateKey(&ec_key, &pbegin, privkeylen));\n    CHECK(EC_KEY_check_key(ec_key));\n    return ec_key;\n}\n\nvoid test_ecdsa_openssl(void) {\n    secp256k1_gej qj;\n    secp256k1_ge q;\n    secp256k1_scalar sigr, sigs;\n    secp256k1_scalar one;\n    secp256k1_scalar msg2;\n    secp256k1_scalar key, msg;\n    EC_KEY *ec_key;\n    unsigned int sigsize = 80;\n    size_t secp_sigsize = 80;\n    unsigned char message[32];\n    unsigned char signature[80];\n    unsigned char key32[32];\n    secp256k1_rand256_test(message);\n    secp256k1_scalar_set_b32(&msg, message, NULL);\n    random_scalar_order_test(&key);\n    secp256k1_scalar_get_b32(key32, &key);\n    secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &qj, &key);\n    secp256k1_ge_set_gej(&q, &qj);\n    ec_key = get_openssl_key(key32);\n    CHECK(ec_key != NULL);\n    CHECK(ECDSA_sign(0, message, sizeof(message), signature, &sigsize, ec_key));\n    CHECK(secp256k1_ecdsa_sig_parse(&sigr, &sigs, signature, sigsize));\n    CHECK(secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sigr, &sigs, &q, &msg));\n    secp256k1_scalar_set_int(&one, 1);\n    secp256k1_scalar_add(&msg2, &msg, &one);\n    CHECK(!secp256k1_ecdsa_sig_verify(&ctx->ecmult_ctx, &sigr, &sigs, &q, &msg2));\n\n    random_sign(&sigr, &sigs, &key, &msg, NULL);\n    CHECK(secp256k1_ecdsa_sig_serialize(signature, &secp_sigsize, &sigr, &sigs));\n    CHECK(ECDSA_verify(0, message, sizeof(message), signature, secp_sigsize, ec_key) == 1);\n\n    EC_KEY_free(ec_key);\n}\n\nvoid run_ecdsa_openssl(void) {\n    int i;\n    for (i = 0; i < 10*count; i++) {\n        test_ecdsa_openssl();\n    }\n}\n#endif\n\n#ifdef ENABLE_MODULE_ECDH\n# include \"modules/ecdh/tests_impl.h\"\n#endif\n\n#ifdef ENABLE_MODULE_RECOVERY\n# include \"modules/recovery/tests_impl.h\"\n#endif\n\nint main(int argc, char **argv) {\n    unsigned char seed16[16] = {0};\n    unsigned char run32[32] = {0};\n    /* find iteration count */\n    if (argc > 1) {\n        count = strtol(argv[1], NULL, 0);\n    }\n\n    /* find random seed */\n    if (argc > 2) {\n        int pos = 0;\n        const char* ch = argv[2];\n        while (pos < 16 && ch[0] != 0 && ch[1] != 0) {\n            unsigned short sh;\n            if (sscanf(ch, \"%2hx\", &sh)) {\n                seed16[pos] = sh;\n            } else {\n                break;\n            }\n            ch += 2;\n            pos++;\n        }\n    } else {\n        FILE *frand = fopen(\"/dev/urandom\", \"r\");\n        if ((frand == NULL) || !fread(&seed16, sizeof(seed16), 1, frand)) {\n            uint64_t t = time(NULL) * (uint64_t)1337;\n            seed16[0] ^= t;\n            seed16[1] ^= t >> 8;\n            seed16[2] ^= t >> 16;\n            seed16[3] ^= t >> 24;\n            seed16[4] ^= t >> 32;\n            seed16[5] ^= t >> 40;\n            seed16[6] ^= t >> 48;\n            seed16[7] ^= t >> 56;\n        }\n        fclose(frand);\n    }\n    secp256k1_rand_seed(seed16);\n\n    printf(\"test count = %i\\n\", count);\n    printf(\"random seed = %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\\n\", seed16[0], seed16[1], seed16[2], seed16[3], seed16[4], seed16[5], seed16[6], seed16[7], seed16[8], seed16[9], seed16[10], seed16[11], seed16[12], seed16[13], seed16[14], seed16[15]);\n\n    /* initialize */\n    run_context_tests();\n    ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);\n    if (secp256k1_rand_bits(1)) {\n        secp256k1_rand256(run32);\n        CHECK(secp256k1_context_randomize(ctx, secp256k1_rand_bits(1) ? run32 : NULL));\n    }\n\n    run_rand_bits();\n    run_rand_int();\n\n    run_sha256_tests();\n    run_hmac_sha256_tests();\n    run_rfc6979_hmac_sha256_tests();\n\n#ifndef USE_NUM_NONE\n    /* num tests */\n    run_num_smalltests();\n#endif\n\n    /* scalar tests */\n    run_scalar_tests();\n\n    /* field tests */\n    run_field_inv();\n    run_field_inv_var();\n    run_field_inv_all_var();\n    run_field_misc();\n    run_field_convert();\n    run_sqr();\n    run_sqrt();\n\n    /* group tests */\n    run_ge();\n    run_group_decompress();\n\n    /* ecmult tests */\n    run_wnaf();\n    run_point_times_order();\n    run_ecmult_chain();\n    run_ecmult_constants();\n    run_ecmult_gen_blind();\n    run_ecmult_const_tests();\n    run_ec_combine();\n\n    /* endomorphism tests */\n#ifdef USE_ENDOMORPHISM\n    run_endomorphism_tests();\n#endif\n\n    /* EC point parser test */\n    run_ec_pubkey_parse_test();\n\n    /* EC key edge cases */\n    run_eckey_edge_case_test();\n\n#ifdef ENABLE_MODULE_ECDH\n    /* ecdh tests */\n    run_ecdh_tests();\n#endif\n\n    /* ecdsa tests */\n    run_random_pubkeys();\n    run_ecdsa_der_parse();\n    run_ecdsa_sign_verify();\n    run_ecdsa_end_to_end();\n    run_ecdsa_edge_cases();\n#ifdef ENABLE_OPENSSL_TESTS\n    run_ecdsa_openssl();\n#endif\n\n#ifdef ENABLE_MODULE_RECOVERY\n    /* ECDSA pubkey recovery tests */\n    run_recovery_tests();\n#endif\n\n    secp256k1_rand256(run32);\n    printf(\"random run = %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\\n\", run32[0], run32[1], run32[2], run32[3], run32[4], run32[5], run32[6], run32[7], run32[8], run32[9], run32[10], run32[11], run32[12], run32[13], run32[14], run32[15]);\n\n    /* shutdown */\n    secp256k1_context_destroy(ctx);\n\n    printf(\"no problems found\\n\");\n    return 0;\n}\n"
  },
  {
    "path": "src/secp256k1/src/tests_exhaustive.c",
    "content": "/***********************************************************************\n * Copyright (c) 2016 Andrew Poelstra                                 *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n#include <stdio.h>\n#include <stdlib.h>\n\n#include <time.h>\n\n#undef USE_ECMULT_STATIC_PRECOMPUTATION\n\n#ifndef EXHAUSTIVE_TEST_ORDER\n/* see group_impl.h for allowable values */\n#define EXHAUSTIVE_TEST_ORDER 13\n#define EXHAUSTIVE_TEST_LAMBDA 9   /* cube root of 1 mod 13 */\n#endif\n\n#include \"include/secp256k1.h\"\n#include \"group.h\"\n#include \"secp256k1.c\"\n#include \"testrand_impl.h\"\n\n#ifdef ENABLE_MODULE_RECOVERY\n#include \"src/modules/recovery/main_impl.h\"\n#include \"include/secp256k1_recovery.h\"\n#endif\n\n/** stolen from tests.c */\nvoid ge_equals_ge(const secp256k1_ge *a, const secp256k1_ge *b) {\n    CHECK(a->infinity == b->infinity);\n    if (a->infinity) {\n        return;\n    }\n    CHECK(secp256k1_fe_equal_var(&a->x, &b->x));\n    CHECK(secp256k1_fe_equal_var(&a->y, &b->y));\n}\n\nvoid ge_equals_gej(const secp256k1_ge *a, const secp256k1_gej *b) {\n    secp256k1_fe z2s;\n    secp256k1_fe u1, u2, s1, s2;\n    CHECK(a->infinity == b->infinity);\n    if (a->infinity) {\n        return;\n    }\n    /* Check a.x * b.z^2 == b.x && a.y * b.z^3 == b.y, to avoid inverses. */\n    secp256k1_fe_sqr(&z2s, &b->z);\n    secp256k1_fe_mul(&u1, &a->x, &z2s);\n    u2 = b->x; secp256k1_fe_normalize_weak(&u2);\n    secp256k1_fe_mul(&s1, &a->y, &z2s); secp256k1_fe_mul(&s1, &s1, &b->z);\n    s2 = b->y; secp256k1_fe_normalize_weak(&s2);\n    CHECK(secp256k1_fe_equal_var(&u1, &u2));\n    CHECK(secp256k1_fe_equal_var(&s1, &s2));\n}\n\nvoid random_fe(secp256k1_fe *x) {\n    unsigned char bin[32];\n    do {\n        secp256k1_rand256(bin);\n        if (secp256k1_fe_set_b32(x, bin)) {\n            return;\n        }\n    } while(1);\n}\n/** END stolen from tests.c */\n\nint secp256k1_nonce_function_smallint(unsigned char *nonce32, const unsigned char *msg32,\n                                      const unsigned char *key32, const unsigned char *algo16,\n                                      void *data, unsigned int attempt) {\n    secp256k1_scalar s;\n    int *idata = data;\n    (void)msg32;\n    (void)key32;\n    (void)algo16;\n    /* Some nonces cannot be used because they'd cause s and/or r to be zero.\n     * The signing function has retry logic here that just re-calls the nonce\n     * function with an increased `attempt`. So if attempt > 0 this means we\n     * need to change the nonce to avoid an infinite loop. */\n    if (attempt > 0) {\n        *idata = (*idata + 1) % EXHAUSTIVE_TEST_ORDER;\n    }\n    secp256k1_scalar_set_int(&s, *idata);\n    secp256k1_scalar_get_b32(nonce32, &s);\n    return 1;\n}\n\n#ifdef USE_ENDOMORPHISM\nvoid test_exhaustive_endomorphism(const secp256k1_ge *group, int order) {\n    int i;\n    for (i = 0; i < order; i++) {\n        secp256k1_ge res;\n        secp256k1_ge_mul_lambda(&res, &group[i]);\n        ge_equals_ge(&group[i * EXHAUSTIVE_TEST_LAMBDA % EXHAUSTIVE_TEST_ORDER], &res);\n    }\n}\n#endif\n\nvoid test_exhaustive_addition(const secp256k1_ge *group, const secp256k1_gej *groupj, int order) {\n    int i, j;\n\n    /* Sanity-check (and check infinity functions) */\n    CHECK(secp256k1_ge_is_infinity(&group[0]));\n    CHECK(secp256k1_gej_is_infinity(&groupj[0]));\n    for (i = 1; i < order; i++) {\n        CHECK(!secp256k1_ge_is_infinity(&group[i]));\n        CHECK(!secp256k1_gej_is_infinity(&groupj[i]));\n    }\n\n    /* Check all addition formulae */\n    for (j = 0; j < order; j++) {\n        secp256k1_fe fe_inv;\n        secp256k1_fe_inv(&fe_inv, &groupj[j].z);\n        for (i = 0; i < order; i++) {\n            secp256k1_ge zless_gej;\n            secp256k1_gej tmp;\n            /* add_var */\n            secp256k1_gej_add_var(&tmp, &groupj[i], &groupj[j], NULL);\n            ge_equals_gej(&group[(i + j) % order], &tmp);\n            /* add_ge */\n            if (j > 0) {\n                secp256k1_gej_add_ge(&tmp, &groupj[i], &group[j]);\n                ge_equals_gej(&group[(i + j) % order], &tmp);\n            }\n            /* add_ge_var */\n            secp256k1_gej_add_ge_var(&tmp, &groupj[i], &group[j], NULL);\n            ge_equals_gej(&group[(i + j) % order], &tmp);\n            /* add_zinv_var */\n            zless_gej.infinity = groupj[j].infinity;\n            zless_gej.x = groupj[j].x;\n            zless_gej.y = groupj[j].y;\n            secp256k1_gej_add_zinv_var(&tmp, &groupj[i], &zless_gej, &fe_inv);\n            ge_equals_gej(&group[(i + j) % order], &tmp);\n        }\n    }\n\n    /* Check doubling */\n    for (i = 0; i < order; i++) {\n        secp256k1_gej tmp;\n        if (i > 0) {\n            secp256k1_gej_double_nonzero(&tmp, &groupj[i], NULL);\n            ge_equals_gej(&group[(2 * i) % order], &tmp);\n        }\n        secp256k1_gej_double_var(&tmp, &groupj[i], NULL);\n        ge_equals_gej(&group[(2 * i) % order], &tmp);\n    }\n\n    /* Check negation */\n    for (i = 1; i < order; i++) {\n        secp256k1_ge tmp;\n        secp256k1_gej tmpj;\n        secp256k1_ge_neg(&tmp, &group[i]);\n        ge_equals_ge(&group[order - i], &tmp);\n        secp256k1_gej_neg(&tmpj, &groupj[i]);\n        ge_equals_gej(&group[order - i], &tmpj);\n    }\n}\n\nvoid test_exhaustive_ecmult(const secp256k1_context *ctx, const secp256k1_ge *group, const secp256k1_gej *groupj, int order) {\n    int i, j, r_log;\n    for (r_log = 1; r_log < order; r_log++) {\n        for (j = 0; j < order; j++) {\n            for (i = 0; i < order; i++) {\n                secp256k1_gej tmp;\n                secp256k1_scalar na, ng;\n                secp256k1_scalar_set_int(&na, i);\n                secp256k1_scalar_set_int(&ng, j);\n\n                secp256k1_ecmult(&ctx->ecmult_ctx, &tmp, &groupj[r_log], &na, &ng);\n                ge_equals_gej(&group[(i * r_log + j) % order], &tmp);\n\n                if (i > 0) {\n                    secp256k1_ecmult_const(&tmp, &group[i], &ng);\n                    ge_equals_gej(&group[(i * j) % order], &tmp);\n                }\n            }\n        }\n    }\n}\n\nvoid r_from_k(secp256k1_scalar *r, const secp256k1_ge *group, int k) {\n    secp256k1_fe x;\n    unsigned char x_bin[32];\n    k %= EXHAUSTIVE_TEST_ORDER;\n    x = group[k].x;\n    secp256k1_fe_normalize(&x);\n    secp256k1_fe_get_b32(x_bin, &x);\n    secp256k1_scalar_set_b32(r, x_bin, NULL);\n}\n\nvoid test_exhaustive_verify(const secp256k1_context *ctx, const secp256k1_ge *group, int order) {\n    int s, r, msg, key;\n    for (s = 1; s < order; s++) {\n        for (r = 1; r < order; r++) {\n            for (msg = 1; msg < order; msg++) {\n                for (key = 1; key < order; key++) {\n                    secp256k1_ge nonconst_ge;\n                    secp256k1_ecdsa_signature sig;\n                    secp256k1_pubkey pk;\n                    secp256k1_scalar sk_s, msg_s, r_s, s_s;\n                    secp256k1_scalar s_times_k_s, msg_plus_r_times_sk_s;\n                    int k, should_verify;\n                    unsigned char msg32[32];\n\n                    secp256k1_scalar_set_int(&s_s, s);\n                    secp256k1_scalar_set_int(&r_s, r);\n                    secp256k1_scalar_set_int(&msg_s, msg);\n                    secp256k1_scalar_set_int(&sk_s, key);\n\n                    /* Verify by hand */\n                    /* Run through every k value that gives us this r and check that *one* works.\n                     * Note there could be none, there could be multiple, ECDSA is weird. */\n                    should_verify = 0;\n                    for (k = 0; k < order; k++) {\n                        secp256k1_scalar check_x_s;\n                        r_from_k(&check_x_s, group, k);\n                        if (r_s == check_x_s) {\n                            secp256k1_scalar_set_int(&s_times_k_s, k);\n                            secp256k1_scalar_mul(&s_times_k_s, &s_times_k_s, &s_s);\n                            secp256k1_scalar_mul(&msg_plus_r_times_sk_s, &r_s, &sk_s);\n                            secp256k1_scalar_add(&msg_plus_r_times_sk_s, &msg_plus_r_times_sk_s, &msg_s);\n                            should_verify |= secp256k1_scalar_eq(&s_times_k_s, &msg_plus_r_times_sk_s);\n                        }\n                    }\n                    /* nb we have a \"high s\" rule */\n                    should_verify &= !secp256k1_scalar_is_high(&s_s);\n\n                    /* Verify by calling verify */\n                    secp256k1_ecdsa_signature_save(&sig, &r_s, &s_s);\n                    memcpy(&nonconst_ge, &group[sk_s], sizeof(nonconst_ge));\n                    secp256k1_pubkey_save(&pk, &nonconst_ge);\n                    secp256k1_scalar_get_b32(msg32, &msg_s);\n                    CHECK(should_verify ==\n                          secp256k1_ecdsa_verify(ctx, &sig, msg32, &pk));\n                }\n            }\n        }\n    }\n}\n\nvoid test_exhaustive_sign(const secp256k1_context *ctx, const secp256k1_ge *group, int order) {\n    int i, j, k;\n\n    /* Loop */\n    for (i = 1; i < order; i++) {  /* message */\n        for (j = 1; j < order; j++) {  /* key */\n            for (k = 1; k < order; k++) {  /* nonce */\n                const int starting_k = k;\n                secp256k1_ecdsa_signature sig;\n                secp256k1_scalar sk, msg, r, s, expected_r;\n                unsigned char sk32[32], msg32[32];\n                secp256k1_scalar_set_int(&msg, i);\n                secp256k1_scalar_set_int(&sk, j);\n                secp256k1_scalar_get_b32(sk32, &sk);\n                secp256k1_scalar_get_b32(msg32, &msg);\n\n                secp256k1_ecdsa_sign(ctx, &sig, msg32, sk32, secp256k1_nonce_function_smallint, &k);\n\n                secp256k1_ecdsa_signature_load(ctx, &r, &s, &sig);\n                /* Note that we compute expected_r *after* signing -- this is important\n                 * because our nonce-computing function function might change k during\n                 * signing. */\n                r_from_k(&expected_r, group, k);\n                CHECK(r == expected_r);\n                CHECK((k * s) % order == (i + r * j) % order ||\n                      (k * (EXHAUSTIVE_TEST_ORDER - s)) % order == (i + r * j) % order);\n\n                /* Overflow means we've tried every possible nonce */\n                if (k < starting_k) {\n                    break;\n                }\n            }\n        }\n    }\n\n    /* We would like to verify zero-knowledge here by counting how often every\n     * possible (s, r) tuple appears, but because the group order is larger\n     * than the field order, when coercing the x-values to scalar values, some\n     * appear more often than others, so we are actually not zero-knowledge.\n     * (This effect also appears in the real code, but the difference is on the\n     * order of 1/2^128th the field order, so the deviation is not useful to a\n     * computationally bounded attacker.)\n     */\n}\n\n#ifdef ENABLE_MODULE_RECOVERY\nvoid test_exhaustive_recovery_sign(const secp256k1_context *ctx, const secp256k1_ge *group, int order) {\n    int i, j, k;\n\n    /* Loop */\n    for (i = 1; i < order; i++) {  /* message */\n        for (j = 1; j < order; j++) {  /* key */\n            for (k = 1; k < order; k++) {  /* nonce */\n                const int starting_k = k;\n                secp256k1_fe r_dot_y_normalized;\n                secp256k1_ecdsa_recoverable_signature rsig;\n                secp256k1_ecdsa_signature sig;\n                secp256k1_scalar sk, msg, r, s, expected_r;\n                unsigned char sk32[32], msg32[32];\n                int expected_recid;\n                int recid;\n                secp256k1_scalar_set_int(&msg, i);\n                secp256k1_scalar_set_int(&sk, j);\n                secp256k1_scalar_get_b32(sk32, &sk);\n                secp256k1_scalar_get_b32(msg32, &msg);\n\n                secp256k1_ecdsa_sign_recoverable(ctx, &rsig, msg32, sk32, secp256k1_nonce_function_smallint, &k);\n\n                /* Check directly */\n                secp256k1_ecdsa_recoverable_signature_load(ctx, &r, &s, &recid, &rsig);\n                r_from_k(&expected_r, group, k);\n                CHECK(r == expected_r);\n                CHECK((k * s) % order == (i + r * j) % order ||\n                      (k * (EXHAUSTIVE_TEST_ORDER - s)) % order == (i + r * j) % order);\n                /* In computing the recid, there is an overflow condition that is disabled in\n                 * scalar_low_impl.h `secp256k1_scalar_set_b32` because almost every r.y value\n                 * will exceed the group order, and our signing code always holds out for r\n                 * values that don't overflow, so with a proper overflow check the tests would\n                 * loop indefinitely. */\n                r_dot_y_normalized = group[k].y;\n                secp256k1_fe_normalize(&r_dot_y_normalized);\n                /* Also the recovery id is flipped depending if we hit the low-s branch */\n                if ((k * s) % order == (i + r * j) % order) {\n                    expected_recid = secp256k1_fe_is_odd(&r_dot_y_normalized) ? 1 : 0;\n                } else {\n                    expected_recid = secp256k1_fe_is_odd(&r_dot_y_normalized) ? 0 : 1;\n                }\n                CHECK(recid == expected_recid);\n\n                /* Convert to a standard sig then check */\n                secp256k1_ecdsa_recoverable_signature_convert(ctx, &sig, &rsig);\n                secp256k1_ecdsa_signature_load(ctx, &r, &s, &sig);\n                /* Note that we compute expected_r *after* signing -- this is important\n                 * because our nonce-computing function function might change k during\n                 * signing. */\n                r_from_k(&expected_r, group, k);\n                CHECK(r == expected_r);\n                CHECK((k * s) % order == (i + r * j) % order ||\n                      (k * (EXHAUSTIVE_TEST_ORDER - s)) % order == (i + r * j) % order);\n\n                /* Overflow means we've tried every possible nonce */\n                if (k < starting_k) {\n                    break;\n                }\n            }\n        }\n    }\n}\n\nvoid test_exhaustive_recovery_verify(const secp256k1_context *ctx, const secp256k1_ge *group, int order) {\n    /* This is essentially a copy of test_exhaustive_verify, with recovery added */\n    int s, r, msg, key;\n    for (s = 1; s < order; s++) {\n        for (r = 1; r < order; r++) {\n            for (msg = 1; msg < order; msg++) {\n                for (key = 1; key < order; key++) {\n                    secp256k1_ge nonconst_ge;\n                    secp256k1_ecdsa_recoverable_signature rsig;\n                    secp256k1_ecdsa_signature sig;\n                    secp256k1_pubkey pk;\n                    secp256k1_scalar sk_s, msg_s, r_s, s_s;\n                    secp256k1_scalar s_times_k_s, msg_plus_r_times_sk_s;\n                    int recid = 0;\n                    int k, should_verify;\n                    unsigned char msg32[32];\n\n                    secp256k1_scalar_set_int(&s_s, s);\n                    secp256k1_scalar_set_int(&r_s, r);\n                    secp256k1_scalar_set_int(&msg_s, msg);\n                    secp256k1_scalar_set_int(&sk_s, key);\n                    secp256k1_scalar_get_b32(msg32, &msg_s);\n\n                    /* Verify by hand */\n                    /* Run through every k value that gives us this r and check that *one* works.\n                     * Note there could be none, there could be multiple, ECDSA is weird. */\n                    should_verify = 0;\n                    for (k = 0; k < order; k++) {\n                        secp256k1_scalar check_x_s;\n                        r_from_k(&check_x_s, group, k);\n                        if (r_s == check_x_s) {\n                            secp256k1_scalar_set_int(&s_times_k_s, k);\n                            secp256k1_scalar_mul(&s_times_k_s, &s_times_k_s, &s_s);\n                            secp256k1_scalar_mul(&msg_plus_r_times_sk_s, &r_s, &sk_s);\n                            secp256k1_scalar_add(&msg_plus_r_times_sk_s, &msg_plus_r_times_sk_s, &msg_s);\n                            should_verify |= secp256k1_scalar_eq(&s_times_k_s, &msg_plus_r_times_sk_s);\n                        }\n                    }\n                    /* nb we have a \"high s\" rule */\n                    should_verify &= !secp256k1_scalar_is_high(&s_s);\n\n                    /* We would like to try recovering the pubkey and checking that it matches,\n                     * but pubkey recovery is impossible in the exhaustive tests (the reason\n                     * being that there are 12 nonzero r values, 12 nonzero points, and no\n                     * overlap between the sets, so there are no valid signatures). */\n\n                    /* Verify by converting to a standard signature and calling verify */\n                    secp256k1_ecdsa_recoverable_signature_save(&rsig, &r_s, &s_s, recid);\n                    secp256k1_ecdsa_recoverable_signature_convert(ctx, &sig, &rsig);\n                    memcpy(&nonconst_ge, &group[sk_s], sizeof(nonconst_ge));\n                    secp256k1_pubkey_save(&pk, &nonconst_ge);\n                    CHECK(should_verify ==\n                          secp256k1_ecdsa_verify(ctx, &sig, msg32, &pk));\n                }\n            }\n        }\n    }\n}\n#endif\n\nint main(void) {\n    int i;\n    secp256k1_gej groupj[EXHAUSTIVE_TEST_ORDER];\n    secp256k1_ge group[EXHAUSTIVE_TEST_ORDER];\n\n    /* Build context */\n    secp256k1_context *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);\n\n    /* TODO set z = 1, then do num_tests runs with random z values */\n\n    /* Generate the entire group */\n    secp256k1_gej_set_infinity(&groupj[0]);\n    secp256k1_ge_set_gej(&group[0], &groupj[0]);\n    for (i = 1; i < EXHAUSTIVE_TEST_ORDER; i++) {\n        /* Set a different random z-value for each Jacobian point */\n        secp256k1_fe z;\n        random_fe(&z);\n\n        secp256k1_gej_add_ge(&groupj[i], &groupj[i - 1], &secp256k1_ge_const_g);\n        secp256k1_ge_set_gej(&group[i], &groupj[i]);\n        secp256k1_gej_rescale(&groupj[i], &z);\n\n        /* Verify against ecmult_gen */\n        {\n            secp256k1_scalar scalar_i;\n            secp256k1_gej generatedj;\n            secp256k1_ge generated;\n\n            secp256k1_scalar_set_int(&scalar_i, i);\n            secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &generatedj, &scalar_i);\n            secp256k1_ge_set_gej(&generated, &generatedj);\n\n            CHECK(group[i].infinity == 0);\n            CHECK(generated.infinity == 0);\n            CHECK(secp256k1_fe_equal_var(&generated.x, &group[i].x));\n            CHECK(secp256k1_fe_equal_var(&generated.y, &group[i].y));\n        }\n    }\n\n    /* Run the tests */\n#ifdef USE_ENDOMORPHISM\n    test_exhaustive_endomorphism(group, EXHAUSTIVE_TEST_ORDER);\n#endif\n    test_exhaustive_addition(group, groupj, EXHAUSTIVE_TEST_ORDER);\n    test_exhaustive_ecmult(ctx, group, groupj, EXHAUSTIVE_TEST_ORDER);\n    test_exhaustive_sign(ctx, group, EXHAUSTIVE_TEST_ORDER);\n    test_exhaustive_verify(ctx, group, EXHAUSTIVE_TEST_ORDER);\n\n#ifdef ENABLE_MODULE_RECOVERY\n    test_exhaustive_recovery_sign(ctx, group, EXHAUSTIVE_TEST_ORDER);\n    test_exhaustive_recovery_verify(ctx, group, EXHAUSTIVE_TEST_ORDER);\n#endif\n\n    secp256k1_context_destroy(ctx);\n    return 0;\n}\n\n"
  },
  {
    "path": "src/secp256k1/src/util.h",
    "content": "/**********************************************************************\n * Copyright (c) 2013, 2014 Pieter Wuille                             *\n * Distributed under the MIT software license, see the accompanying   *\n * file COPYING or http://www.opensource.org/licenses/mit-license.php.*\n **********************************************************************/\n\n#ifndef SECP256K1_UTIL_H\n#define SECP256K1_UTIL_H\n\n#if defined HAVE_CONFIG_H\n#include \"libsecp256k1-config.h\"\n#endif\n\n#include <stdlib.h>\n#include <stdint.h>\n#include <stdio.h>\n\ntypedef struct {\n    void (*fn)(const char *text, void* data);\n    const void* data;\n} secp256k1_callback;\n\nstatic SECP256K1_INLINE void secp256k1_callback_call(const secp256k1_callback * const cb, const char * const text) {\n    cb->fn(text, (void*)cb->data);\n}\n\n#ifdef DETERMINISTIC\n#define TEST_FAILURE(msg) do { \\\n    fprintf(stderr, \"%s\\n\", msg); \\\n    abort(); \\\n} while(0);\n#else\n#define TEST_FAILURE(msg) do { \\\n    fprintf(stderr, \"%s:%d: %s\\n\", __FILE__, __LINE__, msg); \\\n    abort(); \\\n} while(0)\n#endif\n\n#ifdef HAVE_BUILTIN_EXPECT\n#define EXPECT(x,c) __builtin_expect((x),(c))\n#else\n#define EXPECT(x,c) (x)\n#endif\n\n#ifdef DETERMINISTIC\n#define CHECK(cond) do { \\\n    if (EXPECT(!(cond), 0)) { \\\n        TEST_FAILURE(\"test condition failed\"); \\\n    } \\\n} while(0)\n#else\n#define CHECK(cond) do { \\\n    if (EXPECT(!(cond), 0)) { \\\n        TEST_FAILURE(\"test condition failed: \" #cond); \\\n    } \\\n} while(0)\n#endif\n\n/* Like assert(), but when VERIFY is defined, and side-effect safe. */\n#if defined(COVERAGE)\n#define VERIFY_CHECK(check)\n#define VERIFY_SETUP(stmt)\n#elif defined(VERIFY)\n#define VERIFY_CHECK CHECK\n#define VERIFY_SETUP(stmt) do { stmt; } while(0)\n#else\n#define VERIFY_CHECK(cond) do { (void)(cond); } while(0)\n#define VERIFY_SETUP(stmt)\n#endif\n\nstatic SECP256K1_INLINE void *checked_malloc(const secp256k1_callback* cb, size_t size) {\n    void *ret = malloc(size);\n    if (ret == NULL) {\n        secp256k1_callback_call(cb, \"Out of memory\");\n    }\n    return ret;\n}\n\n/* Macro for restrict, when available and not in a VERIFY build. */\n#if defined(SECP256K1_BUILD) && defined(VERIFY)\n# define SECP256K1_RESTRICT\n#else\n# if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) )\n#  if SECP256K1_GNUC_PREREQ(3,0)\n#   define SECP256K1_RESTRICT __restrict__\n#  elif (defined(_MSC_VER) && _MSC_VER >= 1400)\n#   define SECP256K1_RESTRICT __restrict\n#  else\n#   define SECP256K1_RESTRICT\n#  endif\n# else\n#  define SECP256K1_RESTRICT restrict\n# endif\n#endif\n\n#if defined(_WIN32)\n# define I64FORMAT \"I64d\"\n# define I64uFORMAT \"I64u\"\n#else\n# define I64FORMAT \"lld\"\n# define I64uFORMAT \"llu\"\n#endif\n\n#if defined(HAVE___INT128)\n# if defined(__GNUC__)\n#  define SECP256K1_GNUC_EXT __extension__\n# else\n#  define SECP256K1_GNUC_EXT\n# endif\nSECP256K1_GNUC_EXT typedef unsigned __int128 uint128_t;\n#endif\n\n#endif /* SECP256K1_UTIL_H */\n"
  },
  {
    "path": "src/serialize.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SERIALIZE_H\n#define BITCOIN_SERIALIZE_H\n\n#include <compat/endian.h>\n\n#include <algorithm>\n#include <assert.h>\n#include <ios>\n#include <limits>\n#include <map>\n#include <memory>\n#include <set>\n#include <stdint.h>\n#include <string>\n#include <string.h>\n#include <utility>\n#include <vector>\n\n#include <prevector.h>\n\nstatic const unsigned int MAX_SIZE = 0x02000000;\n\n/**\n * Dummy data type to identify deserializing constructors.\n *\n * By convention, a constructor of a type T with signature\n *\n *   template <typename Stream> T::T(deserialize_type, Stream& s)\n *\n * is a deserializing constructor, which builds the type by\n * deserializing it from s. If T contains const fields, this\n * is likely the only way to do so.\n */\nstruct deserialize_type {};\nconstexpr deserialize_type deserialize {};\n\n/**\n * Used to bypass the rule against non-const reference to temporary\n * where it makes sense with wrappers such as CFlatData or CTxDB\n */\ntemplate<typename T>\ninline T& REF(const T& val)\n{\n    return const_cast<T&>(val);\n}\n\n/**\n * Used to acquire a non-const pointer \"this\" to generate bodies\n * of const serialization operations from a template\n */\ntemplate<typename T>\ninline T* NCONST_PTR(const T* val)\n{\n    return const_cast<T*>(val);\n}\n\n/*\n * Lowest-level serialization and conversion.\n * @note Sizes of these types are verified in the tests\n */\ntemplate<typename Stream> inline void ser_writedata8(Stream &s, uint8_t obj)\n{\n    s.write((char*)&obj, 1);\n}\ntemplate<typename Stream> inline void ser_writedata16(Stream &s, uint16_t obj)\n{\n    obj = htole16(obj);\n    s.write((char*)&obj, 2);\n}\ntemplate<typename Stream> inline void ser_writedata32(Stream &s, uint32_t obj)\n{\n    obj = htole32(obj);\n    s.write((char*)&obj, 4);\n}\ntemplate<typename Stream> inline void ser_writedata64(Stream &s, uint64_t obj)\n{\n    obj = htole64(obj);\n    s.write((char*)&obj, 8);\n}\ntemplate<typename Stream> inline uint8_t ser_readdata8(Stream &s)\n{\n    uint8_t obj;\n    s.read((char*)&obj, 1);\n    return obj;\n}\ntemplate<typename Stream> inline uint16_t ser_readdata16(Stream &s)\n{\n    uint16_t obj;\n    s.read((char*)&obj, 2);\n    return le16toh(obj);\n}\ntemplate<typename Stream> inline uint32_t ser_readdata32(Stream &s)\n{\n    uint32_t obj;\n    s.read((char*)&obj, 4);\n    return le32toh(obj);\n}\ntemplate<typename Stream> inline uint64_t ser_readdata64(Stream &s)\n{\n    uint64_t obj;\n    s.read((char*)&obj, 8);\n    return le64toh(obj);\n}\ninline uint64_t ser_double_to_uint64(double x)\n{\n    union { double x; uint64_t y; } tmp;\n    tmp.x = x;\n    return tmp.y;\n}\ninline uint32_t ser_float_to_uint32(float x)\n{\n    union { float x; uint32_t y; } tmp;\n    tmp.x = x;\n    return tmp.y;\n}\ninline double ser_uint64_to_double(uint64_t y)\n{\n    union { double x; uint64_t y; } tmp;\n    tmp.y = y;\n    return tmp.x;\n}\ninline float ser_uint32_to_float(uint32_t y)\n{\n    union { float x; uint32_t y; } tmp;\n    tmp.y = y;\n    return tmp.x;\n}\n\n\n/////////////////////////////////////////////////////////////////\n//\n// Templates for serializing to anything that looks like a stream,\n// i.e. anything that supports .read(char*, size_t) and .write(char*, size_t)\n//\n\nclass CSizeComputer;\n\nenum\n{\n    // primary actions\n    SER_NETWORK         = (1 << 0),\n    SER_DISK            = (1 << 1),\n    SER_GETHASH         = (1 << 2),\n};\n\n#define READWRITE(obj)      (::SerReadWrite(s, (obj), ser_action))\n#define READWRITEMANY(...)      (::SerReadWriteMany(s, ser_action, __VA_ARGS__))\n\n/** \n * Implement three methods for serializable objects. These are actually wrappers over\n * \"SerializationOp\" template, which implements the body of each class' serialization\n * code. Adding \"ADD_SERIALIZE_METHODS\" in the body of the class causes these wrappers to be\n * added as members. \n */\n#define ADD_SERIALIZE_METHODS                                         \\\n    template<typename Stream>                                         \\\n    void Serialize(Stream& s) const {                                 \\\n        NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize());  \\\n    }                                                                 \\\n    template<typename Stream>                                         \\\n    void Unserialize(Stream& s) {                                     \\\n        SerializationOp(s, CSerActionUnserialize());                  \\\n    }\n\ntemplate<typename Stream> inline void Serialize(Stream& s, char a    ) { ser_writedata8(s, a); } // TODO Get rid of bare char\ntemplate<typename Stream> inline void Serialize(Stream& s, int8_t a  ) { ser_writedata8(s, a); }\ntemplate<typename Stream> inline void Serialize(Stream& s, uint8_t a ) { ser_writedata8(s, a); }\ntemplate<typename Stream> inline void Serialize(Stream& s, int16_t a ) { ser_writedata16(s, a); }\ntemplate<typename Stream> inline void Serialize(Stream& s, uint16_t a) { ser_writedata16(s, a); }\ntemplate<typename Stream> inline void Serialize(Stream& s, int32_t a ) { ser_writedata32(s, a); }\ntemplate<typename Stream> inline void Serialize(Stream& s, uint32_t a) { ser_writedata32(s, a); }\ntemplate<typename Stream> inline void Serialize(Stream& s, int64_t a ) { ser_writedata64(s, a); }\ntemplate<typename Stream> inline void Serialize(Stream& s, uint64_t a) { ser_writedata64(s, a); }\ntemplate<typename Stream> inline void Serialize(Stream& s, float a   ) { ser_writedata32(s, ser_float_to_uint32(a)); }\ntemplate<typename Stream> inline void Serialize(Stream& s, double a  ) { ser_writedata64(s, ser_double_to_uint64(a)); }\n\ntemplate<typename Stream> inline void Unserialize(Stream& s, char& a    ) { a = ser_readdata8(s); } // TODO Get rid of bare char\ntemplate<typename Stream> inline void Unserialize(Stream& s, int8_t& a  ) { a = ser_readdata8(s); }\ntemplate<typename Stream> inline void Unserialize(Stream& s, uint8_t& a ) { a = ser_readdata8(s); }\ntemplate<typename Stream> inline void Unserialize(Stream& s, int16_t& a ) { a = ser_readdata16(s); }\ntemplate<typename Stream> inline void Unserialize(Stream& s, uint16_t& a) { a = ser_readdata16(s); }\ntemplate<typename Stream> inline void Unserialize(Stream& s, int32_t& a ) { a = ser_readdata32(s); }\ntemplate<typename Stream> inline void Unserialize(Stream& s, uint32_t& a) { a = ser_readdata32(s); }\ntemplate<typename Stream> inline void Unserialize(Stream& s, int64_t& a ) { a = ser_readdata64(s); }\ntemplate<typename Stream> inline void Unserialize(Stream& s, uint64_t& a) { a = ser_readdata64(s); }\ntemplate<typename Stream> inline void Unserialize(Stream& s, float& a   ) { a = ser_uint32_to_float(ser_readdata32(s)); }\ntemplate<typename Stream> inline void Unserialize(Stream& s, double& a  ) { a = ser_uint64_to_double(ser_readdata64(s)); }\n\ntemplate<typename Stream> inline void Serialize(Stream& s, bool a)    { char f=a; ser_writedata8(s, f); }\ntemplate<typename Stream> inline void Unserialize(Stream& s, bool& a) { char f=ser_readdata8(s); a=f; }\n\n\n\n\n\n\n/**\n * Compact Size\n * size <  253        -- 1 byte\n * size <= USHRT_MAX  -- 3 bytes  (253 + 2 bytes)\n * size <= UINT_MAX   -- 5 bytes  (254 + 4 bytes)\n * size >  UINT_MAX   -- 9 bytes  (255 + 8 bytes)\n */\ninline unsigned int GetSizeOfCompactSize(uint64_t nSize)\n{\n    if (nSize < 253)             return sizeof(unsigned char);\n    else if (nSize <= std::numeric_limits<unsigned short>::max()) return sizeof(unsigned char) + sizeof(unsigned short);\n    else if (nSize <= std::numeric_limits<unsigned int>::max())  return sizeof(unsigned char) + sizeof(unsigned int);\n    else                         return sizeof(unsigned char) + sizeof(uint64_t);\n}\n\ninline void WriteCompactSize(CSizeComputer& os, uint64_t nSize);\n\ntemplate<typename Stream>\nvoid WriteCompactSize(Stream& os, uint64_t nSize)\n{\n    if (nSize < 253)\n    {\n        ser_writedata8(os, nSize);\n    }\n    else if (nSize <= std::numeric_limits<unsigned short>::max())\n    {\n        ser_writedata8(os, 253);\n        ser_writedata16(os, nSize);\n    }\n    else if (nSize <= std::numeric_limits<unsigned int>::max())\n    {\n        ser_writedata8(os, 254);\n        ser_writedata32(os, nSize);\n    }\n    else\n    {\n        ser_writedata8(os, 255);\n        ser_writedata64(os, nSize);\n    }\n    return;\n}\n\ntemplate<typename Stream>\nuint64_t ReadCompactSize(Stream& is)\n{\n    uint8_t chSize = ser_readdata8(is);\n    uint64_t nSizeRet = 0;\n    if (chSize < 253)\n    {\n        nSizeRet = chSize;\n    }\n    else if (chSize == 253)\n    {\n        nSizeRet = ser_readdata16(is);\n        if (nSizeRet < 253)\n            throw std::ios_base::failure(\"non-canonical ReadCompactSize()\");\n    }\n    else if (chSize == 254)\n    {\n        nSizeRet = ser_readdata32(is);\n        if (nSizeRet < 0x10000u)\n            throw std::ios_base::failure(\"non-canonical ReadCompactSize()\");\n    }\n    else\n    {\n        nSizeRet = ser_readdata64(is);\n        if (nSizeRet < 0x100000000ULL)\n            throw std::ios_base::failure(\"non-canonical ReadCompactSize()\");\n    }\n    if (nSizeRet > (uint64_t)MAX_SIZE)\n        throw std::ios_base::failure(\"ReadCompactSize(): size too large\");\n    return nSizeRet;\n}\n\n/**\n * Variable-length integers: bytes are a MSB base-128 encoding of the number.\n * The high bit in each byte signifies whether another digit follows. To make\n * sure the encoding is one-to-one, one is subtracted from all but the last digit.\n * Thus, the byte sequence a[] with length len, where all but the last byte\n * has bit 128 set, encodes the number:\n * \n *  (a[len-1] & 0x7F) + sum(i=1..len-1, 128^i*((a[len-i-1] & 0x7F)+1))\n * \n * Properties:\n * * Very small (0-127: 1 byte, 128-16511: 2 bytes, 16512-2113663: 3 bytes)\n * * Every integer has exactly one encoding\n * * Encoding does not depend on size of original integer type\n * * No redundancy: every (infinite) byte sequence corresponds to a list\n *   of encoded integers.\n * \n * 0:         [0x00]  256:        [0x81 0x00]\n * 1:         [0x01]  16383:      [0xFE 0x7F]\n * 127:       [0x7F]  16384:      [0xFF 0x00]\n * 128:  [0x80 0x00]  16511:      [0xFF 0x7F]\n * 255:  [0x80 0x7F]  65535: [0x82 0xFE 0x7F]\n * 2^32:           [0x8E 0xFE 0xFE 0xFF 0x00]\n */\n\ntemplate<typename I>\ninline unsigned int GetSizeOfVarInt(I n)\n{\n    int nRet = 0;\n    while(true) {\n        nRet++;\n        if (n <= 0x7F)\n            break;\n        n = (n >> 7) - 1;\n    }\n    return nRet;\n}\n\ntemplate<typename I>\ninline void WriteVarInt(CSizeComputer& os, I n);\n\ntemplate<typename Stream, typename I>\nvoid WriteVarInt(Stream& os, I n)\n{\n    unsigned char tmp[(sizeof(n)*8+6)/7];\n    int len=0;\n    while(true) {\n        tmp[len] = (n & 0x7F) | (len ? 0x80 : 0x00);\n        if (n <= 0x7F)\n            break;\n        n = (n >> 7) - 1;\n        len++;\n    }\n    do {\n        ser_writedata8(os, tmp[len]);\n    } while(len--);\n}\n\ntemplate<typename Stream, typename I>\nI ReadVarInt(Stream& is)\n{\n    I n = 0;\n    while(true) {\n        unsigned char chData = ser_readdata8(is);\n        if (n > (std::numeric_limits<I>::max() >> 7)) {\n           throw std::ios_base::failure(\"ReadVarInt(): size too large\");\n        }\n        n = (n << 7) | (chData & 0x7F);\n        if (chData & 0x80) {\n            if (n == std::numeric_limits<I>::max()) {\n                throw std::ios_base::failure(\"ReadVarInt(): size too large\");\n            }\n            n++;\n        } else {\n            return n;\n        }\n    }\n}\n\n#define FLATDATA(obj) REF(CFlatData((char*)&(obj), (char*)&(obj) + sizeof(obj)))\n#define VARINT(obj) REF(WrapVarInt(REF(obj)))\n#define COMPACTSIZE(obj) REF(CCompactSize(REF(obj)))\n#define LIMITED_STRING(obj,n) REF(LimitedString< n >(REF(obj)))\n\n/** \n * Wrapper for serializing arrays and POD.\n */\nclass CFlatData\n{\nprotected:\n    char* pbegin;\n    char* pend;\npublic:\n    CFlatData(void* pbeginIn, void* pendIn) : pbegin((char*)pbeginIn), pend((char*)pendIn) { }\n    template <class T, class TAl>\n    explicit CFlatData(std::vector<T,TAl> &v)\n    {\n        pbegin = (char*)v.data();\n        pend = (char*)(v.data() + v.size());\n    }\n    template <unsigned int N, typename T, typename S, typename D>\n    explicit CFlatData(prevector<N, T, S, D> &v)\n    {\n        pbegin = (char*)v.data();\n        pend = (char*)(v.data() + v.size());\n    }\n    char* begin() { return pbegin; }\n    const char* begin() const { return pbegin; }\n    char* end() { return pend; }\n    const char* end() const { return pend; }\n\n    template<typename Stream>\n    void Serialize(Stream& s) const\n    {\n        s.write(pbegin, pend - pbegin);\n    }\n\n    template<typename Stream>\n    void Unserialize(Stream& s)\n    {\n        s.read(pbegin, pend - pbegin);\n    }\n};\n\ntemplate<typename I>\nclass CVarInt\n{\nprotected:\n    I &n;\npublic:\n    explicit CVarInt(I& nIn) : n(nIn) { }\n\n    template<typename Stream>\n    void Serialize(Stream &s) const {\n        WriteVarInt<Stream,I>(s, n);\n    }\n\n    template<typename Stream>\n    void Unserialize(Stream& s) {\n        n = ReadVarInt<Stream,I>(s);\n    }\n};\n\nclass CCompactSize\n{\nprotected:\n    uint64_t &n;\npublic:\n    explicit CCompactSize(uint64_t& nIn) : n(nIn) { }\n\n    template<typename Stream>\n    void Serialize(Stream &s) const {\n        WriteCompactSize<Stream>(s, n);\n    }\n\n    template<typename Stream>\n    void Unserialize(Stream& s) {\n        n = ReadCompactSize<Stream>(s);\n    }\n};\n\ntemplate<size_t Limit>\nclass LimitedString\n{\nprotected:\n    std::string& string;\npublic:\n    explicit LimitedString(std::string& _string) : string(_string) {}\n\n    template<typename Stream>\n    void Unserialize(Stream& s)\n    {\n        size_t size = ReadCompactSize(s);\n        if (size > Limit) {\n            throw std::ios_base::failure(\"String length limit exceeded\");\n        }\n        string.resize(size);\n        if (size != 0)\n            s.read((char*)string.data(), size);\n    }\n\n    template<typename Stream>\n    void Serialize(Stream& s) const\n    {\n        WriteCompactSize(s, string.size());\n        if (!string.empty())\n            s.write((char*)string.data(), string.size());\n    }\n};\n\ntemplate<typename I>\nCVarInt<I> WrapVarInt(I& n) { return CVarInt<I>(n); }\n\n/**\n * Forward declarations\n */\n\n/**\n *  string\n */\ntemplate<typename Stream, typename C> void Serialize(Stream& os, const std::basic_string<C>& str);\ntemplate<typename Stream, typename C> void Unserialize(Stream& is, std::basic_string<C>& str);\n\n/**\n * prevector\n * prevectors of unsigned char are a special case and are intended to be serialized as a single opaque blob.\n */\ntemplate<typename Stream, unsigned int N, typename T> void Serialize_impl(Stream& os, const prevector<N, T>& v, const unsigned char&);\ntemplate<typename Stream, unsigned int N, typename T, typename V> void Serialize_impl(Stream& os, const prevector<N, T>& v, const V&);\ntemplate<typename Stream, unsigned int N, typename T> inline void Serialize(Stream& os, const prevector<N, T>& v);\ntemplate<typename Stream, unsigned int N, typename T> void Unserialize_impl(Stream& is, prevector<N, T>& v, const unsigned char&);\ntemplate<typename Stream, unsigned int N, typename T, typename V> void Unserialize_impl(Stream& is, prevector<N, T>& v, const V&);\ntemplate<typename Stream, unsigned int N, typename T> inline void Unserialize(Stream& is, prevector<N, T>& v);\n\n/**\n * vector\n * vectors of unsigned char are a special case and are intended to be serialized as a single opaque blob.\n */\ntemplate<typename Stream, typename T, typename A> void Serialize_impl(Stream& os, const std::vector<T, A>& v, const unsigned char&);\ntemplate<typename Stream, typename T, typename A, typename V> void Serialize_impl(Stream& os, const std::vector<T, A>& v, const V&);\ntemplate<typename Stream, typename T, typename A> inline void Serialize(Stream& os, const std::vector<T, A>& v);\ntemplate<typename Stream, typename T, typename A> void Unserialize_impl(Stream& is, std::vector<T, A>& v, const unsigned char&);\ntemplate<typename Stream, typename T, typename A, typename V> void Unserialize_impl(Stream& is, std::vector<T, A>& v, const V&);\ntemplate<typename Stream, typename T, typename A> inline void Unserialize(Stream& is, std::vector<T, A>& v);\n\n/**\n * pair\n */\ntemplate<typename Stream, typename K, typename T> void Serialize(Stream& os, const std::pair<K, T>& item);\ntemplate<typename Stream, typename K, typename T> void Unserialize(Stream& is, std::pair<K, T>& item);\n\n/**\n * map\n */\ntemplate<typename Stream, typename K, typename T, typename Pred, typename A> void Serialize(Stream& os, const std::map<K, T, Pred, A>& m);\ntemplate<typename Stream, typename K, typename T, typename Pred, typename A> void Unserialize(Stream& is, std::map<K, T, Pred, A>& m);\n\n/**\n * set\n */\ntemplate<typename Stream, typename K, typename Pred, typename A> void Serialize(Stream& os, const std::set<K, Pred, A>& m);\ntemplate<typename Stream, typename K, typename Pred, typename A> void Unserialize(Stream& is, std::set<K, Pred, A>& m);\n\n/**\n * shared_ptr\n */\ntemplate<typename Stream, typename T> void Serialize(Stream& os, const std::shared_ptr<const T>& p);\ntemplate<typename Stream, typename T> void Unserialize(Stream& os, std::shared_ptr<const T>& p);\n\n/**\n * unique_ptr\n */\ntemplate<typename Stream, typename T> void Serialize(Stream& os, const std::unique_ptr<const T>& p);\ntemplate<typename Stream, typename T> void Unserialize(Stream& os, std::unique_ptr<const T>& p);\n\n\n\n/**\n * If none of the specialized versions above matched, default to calling member function.\n */\ntemplate<typename Stream, typename T>\ninline void Serialize(Stream& os, const T& a)\n{\n    a.Serialize(os);\n}\n\ntemplate<typename Stream, typename T>\ninline void Unserialize(Stream& is, T& a)\n{\n    a.Unserialize(is);\n}\n\n\n\n\n\n/**\n * string\n */\ntemplate<typename Stream, typename C>\nvoid Serialize(Stream& os, const std::basic_string<C>& str)\n{\n    WriteCompactSize(os, str.size());\n    if (!str.empty())\n        os.write((char*)str.data(), str.size() * sizeof(C));\n}\n\ntemplate<typename Stream, typename C>\nvoid Unserialize(Stream& is, std::basic_string<C>& str)\n{\n    unsigned int nSize = ReadCompactSize(is);\n    str.resize(nSize);\n    if (nSize != 0)\n        is.read((char*)str.data(), nSize * sizeof(C));\n}\n\n\n\n/**\n * prevector\n */\ntemplate<typename Stream, unsigned int N, typename T>\nvoid Serialize_impl(Stream& os, const prevector<N, T>& v, const unsigned char&)\n{\n    WriteCompactSize(os, v.size());\n    if (!v.empty())\n        os.write((char*)v.data(), v.size() * sizeof(T));\n}\n\ntemplate<typename Stream, unsigned int N, typename T, typename V>\nvoid Serialize_impl(Stream& os, const prevector<N, T>& v, const V&)\n{\n    WriteCompactSize(os, v.size());\n    for (typename prevector<N, T>::const_iterator vi = v.begin(); vi != v.end(); ++vi)\n        ::Serialize(os, (*vi));\n}\n\ntemplate<typename Stream, unsigned int N, typename T>\ninline void Serialize(Stream& os, const prevector<N, T>& v)\n{\n    Serialize_impl(os, v, T());\n}\n\n\ntemplate<typename Stream, unsigned int N, typename T>\nvoid Unserialize_impl(Stream& is, prevector<N, T>& v, const unsigned char&)\n{\n    // Limit size per read so bogus size value won't cause out of memory\n    v.clear();\n    unsigned int nSize = ReadCompactSize(is);\n    unsigned int i = 0;\n    while (i < nSize)\n    {\n        unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));\n        v.resize(i + blk);\n        is.read((char*)&v[i], blk * sizeof(T));\n        i += blk;\n    }\n}\n\ntemplate<typename Stream, unsigned int N, typename T, typename V>\nvoid Unserialize_impl(Stream& is, prevector<N, T>& v, const V&)\n{\n    v.clear();\n    unsigned int nSize = ReadCompactSize(is);\n    unsigned int i = 0;\n    unsigned int nMid = 0;\n    while (nMid < nSize)\n    {\n        nMid += 5000000 / sizeof(T);\n        if (nMid > nSize)\n            nMid = nSize;\n        v.resize(nMid);\n        for (; i < nMid; i++)\n            Unserialize(is, v[i]);\n    }\n}\n\ntemplate<typename Stream, unsigned int N, typename T>\ninline void Unserialize(Stream& is, prevector<N, T>& v)\n{\n    Unserialize_impl(is, v, T());\n}\n\n\n\n/**\n * vector\n */\ntemplate<typename Stream, typename T, typename A>\nvoid Serialize_impl(Stream& os, const std::vector<T, A>& v, const unsigned char&)\n{\n    WriteCompactSize(os, v.size());\n    if (!v.empty())\n        os.write((char*)v.data(), v.size() * sizeof(T));\n}\n\ntemplate<typename Stream, typename T, typename A, typename V>\nvoid Serialize_impl(Stream& os, const std::vector<T, A>& v, const V&)\n{\n    WriteCompactSize(os, v.size());\n    for (typename std::vector<T, A>::const_iterator vi = v.begin(); vi != v.end(); ++vi)\n        ::Serialize(os, (*vi));\n}\n\ntemplate<typename Stream, typename T, typename A>\ninline void Serialize(Stream& os, const std::vector<T, A>& v)\n{\n    Serialize_impl(os, v, T());\n}\n\n\ntemplate<typename Stream, typename T, typename A>\nvoid Unserialize_impl(Stream& is, std::vector<T, A>& v, const unsigned char&)\n{\n    // Limit size per read so bogus size value won't cause out of memory\n    v.clear();\n    unsigned int nSize = ReadCompactSize(is);\n    unsigned int i = 0;\n    while (i < nSize)\n    {\n        unsigned int blk = std::min(nSize - i, (unsigned int)(1 + 4999999 / sizeof(T)));\n        v.resize(i + blk);\n        is.read((char*)&v[i], blk * sizeof(T));\n        i += blk;\n    }\n}\n\ntemplate<typename Stream, typename T, typename A, typename V>\nvoid Unserialize_impl(Stream& is, std::vector<T, A>& v, const V&)\n{\n    v.clear();\n    unsigned int nSize = ReadCompactSize(is);\n    unsigned int i = 0;\n    unsigned int nMid = 0;\n    while (nMid < nSize)\n    {\n        nMid += 5000000 / sizeof(T);\n        if (nMid > nSize)\n            nMid = nSize;\n        v.resize(nMid);\n        for (; i < nMid; i++)\n            Unserialize(is, v[i]);\n    }\n}\n\ntemplate<typename Stream, typename T, typename A>\ninline void Unserialize(Stream& is, std::vector<T, A>& v)\n{\n    Unserialize_impl(is, v, T());\n}\n\n\n\n/**\n * pair\n */\ntemplate<typename Stream, typename K, typename T>\nvoid Serialize(Stream& os, const std::pair<K, T>& item)\n{\n    Serialize(os, item.first);\n    Serialize(os, item.second);\n}\n\ntemplate<typename Stream, typename K, typename T>\nvoid Unserialize(Stream& is, std::pair<K, T>& item)\n{\n    Unserialize(is, item.first);\n    Unserialize(is, item.second);\n}\n\n\n\n/**\n * map\n */\ntemplate<typename Stream, typename K, typename T, typename Pred, typename A>\nvoid Serialize(Stream& os, const std::map<K, T, Pred, A>& m)\n{\n    WriteCompactSize(os, m.size());\n    for (const auto& entry : m)\n        Serialize(os, entry);\n}\n\ntemplate<typename Stream, typename K, typename T, typename Pred, typename A>\nvoid Unserialize(Stream& is, std::map<K, T, Pred, A>& m)\n{\n    m.clear();\n    unsigned int nSize = ReadCompactSize(is);\n    typename std::map<K, T, Pred, A>::iterator mi = m.begin();\n    for (unsigned int i = 0; i < nSize; i++)\n    {\n        std::pair<K, T> item;\n        Unserialize(is, item);\n        mi = m.insert(mi, item);\n    }\n}\n\n\n\n/**\n * set\n */\ntemplate<typename Stream, typename K, typename Pred, typename A>\nvoid Serialize(Stream& os, const std::set<K, Pred, A>& m)\n{\n    WriteCompactSize(os, m.size());\n    for (typename std::set<K, Pred, A>::const_iterator it = m.begin(); it != m.end(); ++it)\n        Serialize(os, (*it));\n}\n\ntemplate<typename Stream, typename K, typename Pred, typename A>\nvoid Unserialize(Stream& is, std::set<K, Pred, A>& m)\n{\n    m.clear();\n    unsigned int nSize = ReadCompactSize(is);\n    typename std::set<K, Pred, A>::iterator it = m.begin();\n    for (unsigned int i = 0; i < nSize; i++)\n    {\n        K key;\n        Unserialize(is, key);\n        it = m.insert(it, key);\n    }\n}\n\n\n\n/**\n * unique_ptr\n */\ntemplate<typename Stream, typename T> void\nSerialize(Stream& os, const std::unique_ptr<const T>& p)\n{\n    Serialize(os, *p);\n}\n\ntemplate<typename Stream, typename T>\nvoid Unserialize(Stream& is, std::unique_ptr<const T>& p)\n{\n    p.reset(new T(deserialize, is));\n}\n\n\n\n/**\n * shared_ptr\n */\ntemplate<typename Stream, typename T> void\nSerialize(Stream& os, const std::shared_ptr<const T>& p)\n{\n    Serialize(os, *p);\n}\n\ntemplate<typename Stream, typename T>\nvoid Unserialize(Stream& is, std::shared_ptr<const T>& p)\n{\n    p = std::make_shared<const T>(deserialize, is);\n}\n\n\n\n/**\n * Support for ADD_SERIALIZE_METHODS and READWRITE macro\n */\nstruct CSerActionSerialize\n{\n    constexpr bool ForRead() const { return false; }\n};\nstruct CSerActionUnserialize\n{\n    constexpr bool ForRead() const { return true; }\n};\n\ntemplate<typename Stream, typename T>\ninline void SerReadWrite(Stream& s, const T& obj, CSerActionSerialize ser_action)\n{\n    ::Serialize(s, obj);\n}\n\ntemplate<typename Stream, typename T>\ninline void SerReadWrite(Stream& s, T& obj, CSerActionUnserialize ser_action)\n{\n    ::Unserialize(s, obj);\n}\n\n\n\n\n\n\n\n\n\n/* ::GetSerializeSize implementations\n *\n * Computing the serialized size of objects is done through a special stream\n * object of type CSizeComputer, which only records the number of bytes written\n * to it.\n *\n * If your Serialize or SerializationOp method has non-trivial overhead for\n * serialization, it may be worthwhile to implement a specialized version for\n * CSizeComputer, which uses the s.seek() method to record bytes that would\n * be written instead.\n */\nclass CSizeComputer\n{\nprotected:\n    size_t nSize;\n\n    const int nType;\n    const int nVersion;\npublic:\n    CSizeComputer(int nTypeIn, int nVersionIn) : nSize(0), nType(nTypeIn), nVersion(nVersionIn) {}\n\n    void write(const char *psz, size_t _nSize)\n    {\n        this->nSize += _nSize;\n    }\n\n    /** Pretend _nSize bytes are written, without specifying them. */\n    void seek(size_t _nSize)\n    {\n        this->nSize += _nSize;\n    }\n\n    template<typename T>\n    CSizeComputer& operator<<(const T& obj)\n    {\n        ::Serialize(*this, obj);\n        return (*this);\n    }\n\n    size_t size() const {\n        return nSize;\n    }\n\n    int GetVersion() const { return nVersion; }\n    int GetType() const { return nType; }\n};\n\ntemplate<typename Stream>\nvoid SerializeMany(Stream& s)\n{\n}\n\ntemplate<typename Stream, typename Arg>\nvoid SerializeMany(Stream& s, Arg&& arg)\n{\n    ::Serialize(s, std::forward<Arg>(arg));\n}\n\ntemplate<typename Stream, typename Arg, typename... Args>\nvoid SerializeMany(Stream& s, Arg&& arg, Args&&... args)\n{\n    ::Serialize(s, std::forward<Arg>(arg));\n    ::SerializeMany(s, std::forward<Args>(args)...);\n}\n\ntemplate<typename Stream>\ninline void UnserializeMany(Stream& s)\n{\n}\n\ntemplate<typename Stream, typename Arg>\ninline void UnserializeMany(Stream& s, Arg& arg)\n{\n    ::Unserialize(s, arg);\n}\n\ntemplate<typename Stream, typename Arg, typename... Args>\ninline void UnserializeMany(Stream& s, Arg& arg, Args&... args)\n{\n    ::Unserialize(s, arg);\n    ::UnserializeMany(s, args...);\n}\n\ntemplate<typename Stream, typename... Args>\ninline void SerReadWriteMany(Stream& s, CSerActionSerialize ser_action, Args&&... args)\n{\n    ::SerializeMany(s, std::forward<Args>(args)...);\n}\n\ntemplate<typename Stream, typename... Args>\ninline void SerReadWriteMany(Stream& s, CSerActionUnserialize ser_action, Args&... args)\n{\n    ::UnserializeMany(s, args...);\n}\n\ntemplate<typename I>\ninline void WriteVarInt(CSizeComputer &s, I n)\n{\n    s.seek(GetSizeOfVarInt<I>(n));\n}\n\ninline void WriteCompactSize(CSizeComputer &s, uint64_t nSize)\n{\n    s.seek(GetSizeOfCompactSize(nSize));\n}\n\ntemplate <typename T>\nsize_t GetSerializeSize(const T& t, int nType, int nVersion = 0)\n{\n    return (CSizeComputer(nType, nVersion) << t).size();\n}\n\ntemplate <typename S, typename T>\nsize_t GetSerializeSize(const S& s, const T& t)\n{\n    return (CSizeComputer(s.GetType(), s.GetVersion()) << t).size();\n}\n\n#endif // BITCOIN_SERIALIZE_H\n"
  },
  {
    "path": "src/streams.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_STREAMS_H\n#define BITCOIN_STREAMS_H\n\n#include <support/allocators/zeroafterfree.h>\n#include <serialize.h>\n\n#include <algorithm>\n#include <assert.h>\n#include <ios>\n#include <limits>\n#include <map>\n#include <set>\n#include <stdint.h>\n#include <stdio.h>\n#include <string>\n#include <string.h>\n#include <utility>\n#include <vector>\n\ntemplate<typename Stream>\nclass OverrideStream\n{\n    Stream* stream;\n\n    const int nType;\n    const int nVersion;\n\npublic:\n    OverrideStream(Stream* stream_, int nType_, int nVersion_) : stream(stream_), nType(nType_), nVersion(nVersion_) {}\n\n    template<typename T>\n    OverrideStream<Stream>& operator<<(const T& obj)\n    {\n        // Serialize to this stream\n        ::Serialize(*this, obj);\n        return (*this);\n    }\n\n    template<typename T>\n    OverrideStream<Stream>& operator>>(T& obj)\n    {\n        // Unserialize from this stream\n        ::Unserialize(*this, obj);\n        return (*this);\n    }\n\n    void write(const char* pch, size_t nSize)\n    {\n        stream->write(pch, nSize);\n    }\n\n    void read(char* pch, size_t nSize)\n    {\n        stream->read(pch, nSize);\n    }\n\n    int GetVersion() const { return nVersion; }\n    int GetType() const { return nType; }\n};\n\ntemplate<typename S>\nOverrideStream<S> WithOrVersion(S* s, int nVersionFlag)\n{\n    return OverrideStream<S>(s, s->GetType(), s->GetVersion() | nVersionFlag);\n}\n\n/* Minimal stream for overwriting and/or appending to an existing byte vector\n *\n * The referenced vector will grow as necessary\n */\nclass CVectorWriter\n{\n public:\n\n/*\n * @param[in]  nTypeIn Serialization Type\n * @param[in]  nVersionIn Serialization Version (including any flags)\n * @param[in]  vchDataIn  Referenced byte vector to overwrite/append\n * @param[in]  nPosIn Starting position. Vector index where writes should start. The vector will initially\n *                    grow as necessary to  max(nPosIn, vec.size()). So to append, use vec.size().\n*/\n    CVectorWriter(int nTypeIn, int nVersionIn, std::vector<unsigned char>& vchDataIn, size_t nPosIn) : nType(nTypeIn), nVersion(nVersionIn), vchData(vchDataIn), nPos(nPosIn)\n    {\n        if(nPos > vchData.size())\n            vchData.resize(nPos);\n    }\n/*\n * (other params same as above)\n * @param[in]  args  A list of items to serialize starting at nPosIn.\n*/\n    template <typename... Args>\n    CVectorWriter(int nTypeIn, int nVersionIn, std::vector<unsigned char>& vchDataIn, size_t nPosIn, Args&&... args) : CVectorWriter(nTypeIn, nVersionIn, vchDataIn, nPosIn)\n    {\n        ::SerializeMany(*this, std::forward<Args>(args)...);\n    }\n    void write(const char* pch, size_t nSize)\n    {\n        assert(nPos <= vchData.size());\n        size_t nOverwrite = std::min(nSize, vchData.size() - nPos);\n        if (nOverwrite) {\n            memcpy(vchData.data() + nPos, reinterpret_cast<const unsigned char*>(pch), nOverwrite);\n        }\n        if (nOverwrite < nSize) {\n            vchData.insert(vchData.end(), reinterpret_cast<const unsigned char*>(pch) + nOverwrite, reinterpret_cast<const unsigned char*>(pch) + nSize);\n        }\n        nPos += nSize;\n    }\n    template<typename T>\n    CVectorWriter& operator<<(const T& obj)\n    {\n        // Serialize to this stream\n        ::Serialize(*this, obj);\n        return (*this);\n    }\n    int GetVersion() const\n    {\n        return nVersion;\n    }\n    int GetType() const\n    {\n        return nType;\n    }\n    void seek(size_t nSize)\n    {\n        nPos += nSize;\n        if(nPos > vchData.size())\n            vchData.resize(nPos);\n    }\nprivate:\n    const int nType;\n    const int nVersion;\n    std::vector<unsigned char>& vchData;\n    size_t nPos;\n};\n\n/** Double ended buffer combining vector and stream-like interfaces.\n *\n * >> and << read and write unformatted data using the above serialization templates.\n * Fills with data in linear time; some stringstream implementations take N^2 time.\n */\nclass CDataStream\n{\nprotected:\n    typedef CSerializeData vector_type;\n    vector_type vch;\n    unsigned int nReadPos;\n\n    int nType;\n    int nVersion;\npublic:\n\n    typedef vector_type::allocator_type   allocator_type;\n    typedef vector_type::size_type        size_type;\n    typedef vector_type::difference_type  difference_type;\n    typedef vector_type::reference        reference;\n    typedef vector_type::const_reference  const_reference;\n    typedef vector_type::value_type       value_type;\n    typedef vector_type::iterator         iterator;\n    typedef vector_type::const_iterator   const_iterator;\n    typedef vector_type::reverse_iterator reverse_iterator;\n\n    explicit CDataStream(int nTypeIn, int nVersionIn)\n    {\n        Init(nTypeIn, nVersionIn);\n    }\n\n    CDataStream(const_iterator pbegin, const_iterator pend, int nTypeIn, int nVersionIn) : vch(pbegin, pend)\n    {\n        Init(nTypeIn, nVersionIn);\n    }\n\n    CDataStream(const char* pbegin, const char* pend, int nTypeIn, int nVersionIn) : vch(pbegin, pend)\n    {\n        Init(nTypeIn, nVersionIn);\n    }\n\n    CDataStream(const vector_type& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end())\n    {\n        Init(nTypeIn, nVersionIn);\n    }\n\n    CDataStream(const std::vector<char>& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end())\n    {\n        Init(nTypeIn, nVersionIn);\n    }\n\n    CDataStream(const std::vector<unsigned char>& vchIn, int nTypeIn, int nVersionIn) : vch(vchIn.begin(), vchIn.end())\n    {\n        Init(nTypeIn, nVersionIn);\n    }\n\n    template <typename... Args>\n    CDataStream(int nTypeIn, int nVersionIn, Args&&... args)\n    {\n        Init(nTypeIn, nVersionIn);\n        ::SerializeMany(*this, std::forward<Args>(args)...);\n    }\n\n    void Init(int nTypeIn, int nVersionIn)\n    {\n        nReadPos = 0;\n        nType = nTypeIn;\n        nVersion = nVersionIn;\n    }\n\n    CDataStream& operator+=(const CDataStream& b)\n    {\n        vch.insert(vch.end(), b.begin(), b.end());\n        return *this;\n    }\n\n    friend CDataStream operator+(const CDataStream& a, const CDataStream& b)\n    {\n        CDataStream ret = a;\n        ret += b;\n        return (ret);\n    }\n\n    std::string str() const\n    {\n        return (std::string(begin(), end()));\n    }\n\n\n    //\n    // Vector subset\n    //\n    const_iterator begin() const                     { return vch.begin() + nReadPos; }\n    iterator begin()                                 { return vch.begin() + nReadPos; }\n    const_iterator end() const                       { return vch.end(); }\n    iterator end()                                   { return vch.end(); }\n    size_type size() const                           { return vch.size() - nReadPos; }\n    bool empty() const                               { return vch.size() == nReadPos; }\n    void resize(size_type n, value_type c=0)         { vch.resize(n + nReadPos, c); }\n    void reserve(size_type n)                        { vch.reserve(n + nReadPos); }\n    const_reference operator[](size_type pos) const  { return vch[pos + nReadPos]; }\n    reference operator[](size_type pos)              { return vch[pos + nReadPos]; }\n    void clear()                                     { vch.clear(); nReadPos = 0; }\n    iterator insert(iterator it, const char x=char()) { return vch.insert(it, x); }\n    void insert(iterator it, size_type n, const char x) { vch.insert(it, n, x); }\n    value_type* data()                               { return vch.data() + nReadPos; }\n    const value_type* data() const                   { return vch.data() + nReadPos; }\n\n    void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)\n    {\n        if (last == first) return;\n        assert(last - first > 0);\n        if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos)\n        {\n            // special case for inserting at the front when there's room\n            nReadPos -= (last - first);\n            memcpy(&vch[nReadPos], &first[0], last - first);\n        }\n        else\n            vch.insert(it, first, last);\n    }\n\n    void insert(iterator it, const char* first, const char* last)\n    {\n        if (last == first) return;\n        assert(last - first > 0);\n        if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos)\n        {\n            // special case for inserting at the front when there's room\n            nReadPos -= (last - first);\n            memcpy(&vch[nReadPos], &first[0], last - first);\n        }\n        else\n            vch.insert(it, first, last);\n    }\n\n    iterator erase(iterator it)\n    {\n        if (it == vch.begin() + nReadPos)\n        {\n            // special case for erasing from the front\n            if (++nReadPos >= vch.size())\n            {\n                // whenever we reach the end, we take the opportunity to clear the buffer\n                nReadPos = 0;\n                return vch.erase(vch.begin(), vch.end());\n            }\n            return vch.begin() + nReadPos;\n        }\n        else\n            return vch.erase(it);\n    }\n\n    iterator erase(iterator first, iterator last)\n    {\n        if (first == vch.begin() + nReadPos)\n        {\n            // special case for erasing from the front\n            if (last == vch.end())\n            {\n                nReadPos = 0;\n                return vch.erase(vch.begin(), vch.end());\n            }\n            else\n            {\n                nReadPos = (last - vch.begin());\n                return last;\n            }\n        }\n        else\n            return vch.erase(first, last);\n    }\n\n    inline void Compact()\n    {\n        vch.erase(vch.begin(), vch.begin() + nReadPos);\n        nReadPos = 0;\n    }\n\n    bool Rewind(size_type n)\n    {\n        // Rewind by n characters if the buffer hasn't been compacted yet\n        if (n > nReadPos)\n            return false;\n        nReadPos -= n;\n        return true;\n    }\n\n\n    //\n    // Stream subset\n    //\n    bool eof() const             { return size() == 0; }\n    CDataStream* rdbuf()         { return this; }\n    int in_avail() const         { return size(); }\n\n    void SetType(int n)          { nType = n; }\n    int GetType() const          { return nType; }\n    void SetVersion(int n)       { nVersion = n; }\n    int GetVersion() const       { return nVersion; }\n\n    void read(char* pch, size_t nSize)\n    {\n        if (nSize == 0) return;\n\n        // Read from the beginning of the buffer\n        unsigned int nReadPosNext = nReadPos + nSize;\n        if (nReadPosNext > vch.size()) {\n            throw std::ios_base::failure(\"CDataStream::read(): end of data\");\n        }\n        memcpy(pch, &vch[nReadPos], nSize);        \n        if (nReadPosNext == vch.size())\n        {\n            nReadPos = 0;\n            vch.clear();\n            return;\n        }\n        nReadPos = nReadPosNext;\n    }\n\n    void ignore(int nSize)\n    {\n        // Ignore from the beginning of the buffer\n        if (nSize < 0) {\n            throw std::ios_base::failure(\"CDataStream::ignore(): nSize negative\");\n        }\n        unsigned int nReadPosNext = nReadPos + nSize;\n        if (nReadPosNext >= vch.size())\n        {\n            if (nReadPosNext > vch.size())\n                throw std::ios_base::failure(\"CDataStream::ignore(): end of data\");\n            nReadPos = 0;\n            vch.clear();\n            return;\n        }\n        nReadPos = nReadPosNext;\n    }\n\n    void write(const char* pch, size_t nSize)\n    {\n        // Write to the end of the buffer\n        vch.insert(vch.end(), pch, pch + nSize);\n    }\n\n    template<typename Stream>\n    void Serialize(Stream& s) const\n    {\n        // Special case: stream << stream concatenates like stream += stream\n        if (!vch.empty())\n            s.write((char*)vch.data(), vch.size() * sizeof(value_type));\n    }\n\n    template<typename T>\n    CDataStream& operator<<(const T& obj)\n    {\n        // Serialize to this stream\n        ::Serialize(*this, obj);\n        return (*this);\n    }\n\n    template<typename T>\n    CDataStream& operator>>(T& obj)\n    {\n        // Unserialize from this stream\n        ::Unserialize(*this, obj);\n        return (*this);\n    }\n\n    void GetAndClear(CSerializeData &d) {\n        d.insert(d.end(), begin(), end());\n        clear();\n    }\n\n    /**\n     * XOR the contents of this stream with a certain key.\n     *\n     * @param[in] key    The key used to XOR the data in this stream.\n     */\n    void Xor(const std::vector<unsigned char>& key)\n    {\n        if (key.size() == 0) {\n            return;\n        }\n\n        for (size_type i = 0, j = 0; i != size(); i++) {\n            vch[i] ^= key[j++];\n\n            // This potentially acts on very many bytes of data, so it's\n            // important that we calculate `j`, i.e. the `key` index in this\n            // way instead of doing a %, which would effectively be a division\n            // for each byte Xor'd -- much slower than need be.\n            if (j == key.size())\n                j = 0;\n        }\n    }\n};\n\n\n\n\n\n\n\n\n\n\n/** Non-refcounted RAII wrapper for FILE*\n *\n * Will automatically close the file when it goes out of scope if not null.\n * If you're returning the file pointer, return file.release().\n * If you need to close the file early, use file.fclose() instead of fclose(file).\n */\nclass CAutoFile\n{\nprivate:\n    const int nType;\n    const int nVersion;\n\n    FILE* file;\t\n\npublic:\n    CAutoFile(FILE* filenew, int nTypeIn, int nVersionIn) : nType(nTypeIn), nVersion(nVersionIn)\n    {\n        file = filenew;\n    }\n\n    ~CAutoFile()\n    {\n        fclose();\n    }\n\n    // Disallow copies\n    CAutoFile(const CAutoFile&) = delete;\n    CAutoFile& operator=(const CAutoFile&) = delete;\n\n    void fclose()\n    {\n        if (file) {\n            ::fclose(file);\n            file = nullptr;\n        }\n    }\n\n    /** Get wrapped FILE* with transfer of ownership.\n     * @note This will invalidate the CAutoFile object, and makes it the responsibility of the caller\n     * of this function to clean up the returned FILE*.\n     */\n    FILE* release()             { FILE* ret = file; file = nullptr; return ret; }\n\n    /** Get wrapped FILE* without transfer of ownership.\n     * @note Ownership of the FILE* will remain with this class. Use this only if the scope of the\n     * CAutoFile outlives use of the passed pointer.\n     */\n    FILE* Get() const           { return file; }\n\n    /** Return true if the wrapped FILE* is nullptr, false otherwise.\n     */\n    bool IsNull() const         { return (file == nullptr); }\n\n    //\n    // Stream subset\n    //\n    int GetType() const          { return nType; }\n    int GetVersion() const       { return nVersion; }\n\n    void read(char* pch, size_t nSize)\n    {\n        if (!file)\n            throw std::ios_base::failure(\"CAutoFile::read: file handle is nullptr\");\n        if (fread(pch, 1, nSize, file) != nSize)\n            throw std::ios_base::failure(feof(file) ? \"CAutoFile::read: end of file\" : \"CAutoFile::read: fread failed\");\n    }\n\n    void ignore(size_t nSize)\n    {\n        if (!file)\n            throw std::ios_base::failure(\"CAutoFile::ignore: file handle is nullptr\");\n        unsigned char data[4096];\n        while (nSize > 0) {\n            size_t nNow = std::min<size_t>(nSize, sizeof(data));\n            if (fread(data, 1, nNow, file) != nNow)\n                throw std::ios_base::failure(feof(file) ? \"CAutoFile::ignore: end of file\" : \"CAutoFile::read: fread failed\");\n            nSize -= nNow;\n        }\n    }\n\n    void write(const char* pch, size_t nSize)\n    {\n        if (!file)\n            throw std::ios_base::failure(\"CAutoFile::write: file handle is nullptr\");\n        if (fwrite(pch, 1, nSize, file) != nSize)\n            throw std::ios_base::failure(\"CAutoFile::write: write failed\");\n    }\n\n    template<typename T>\n    CAutoFile& operator<<(const T& obj)\n    {\n        // Serialize to this stream\n        if (!file)\n            throw std::ios_base::failure(\"CAutoFile::operator<<: file handle is nullptr\");\n        ::Serialize(*this, obj);\n        return (*this);\n    }\n\n    template<typename T>\n    CAutoFile& operator>>(T& obj)\n    {\n        // Unserialize from this stream\n        if (!file)\n            throw std::ios_base::failure(\"CAutoFile::operator>>: file handle is nullptr\");\n        ::Unserialize(*this, obj);\n        return (*this);\n    }\n};\n\n/** Non-refcounted RAII wrapper around a FILE* that implements a ring buffer to\n *  deserialize from. It guarantees the ability to rewind a given number of bytes.\n *\n *  Will automatically close the file when it goes out of scope if not null.\n *  If you need to close the file early, use file.fclose() instead of fclose(file).\n */\nclass CBufferedFile\n{\nprivate:\n    const int nType;\n    const int nVersion;\n\n    FILE *src;            // source file\n    uint64_t nSrcPos;     // how many bytes have been read from source\n    uint64_t nReadPos;    // how many bytes have been read from this\n    uint64_t nReadLimit;  // up to which position we're allowed to read\n    uint64_t nRewind;     // how many bytes we guarantee to rewind\n    std::vector<char> vchBuf; // the buffer\n\nprotected:\n    // read data from the source to fill the buffer\n    bool Fill() {\n        unsigned int pos = nSrcPos % vchBuf.size();\n        unsigned int readNow = vchBuf.size() - pos;\n        unsigned int nAvail = vchBuf.size() - (nSrcPos - nReadPos) - nRewind;\n        if (nAvail < readNow)\n            readNow = nAvail;\n        if (readNow == 0)\n            return false;\n        size_t nBytes = fread((void*)&vchBuf[pos], 1, readNow, src);\n        if (nBytes == 0) {\n            throw std::ios_base::failure(feof(src) ? \"CBufferedFile::Fill: end of file\" : \"CBufferedFile::Fill: fread failed\");\n        } else {\n            nSrcPos += nBytes;\n            return true;\n        }\n    }\n\npublic:\n    CBufferedFile(FILE *fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nTypeIn, int nVersionIn) :\n        nType(nTypeIn), nVersion(nVersionIn), nSrcPos(0), nReadPos(0), nReadLimit((uint64_t)(-1)), nRewind(nRewindIn), vchBuf(nBufSize, 0)\n    {\n        src = fileIn;\n    }\n\n    ~CBufferedFile()\n    {\n        fclose();\n    }\n\n    // Disallow copies\n    CBufferedFile(const CBufferedFile&) = delete;\n    CBufferedFile& operator=(const CBufferedFile&) = delete;\n\n    int GetVersion() const { return nVersion; }\n    int GetType() const { return nType; }\n\n    void fclose()\n    {\n        if (src) {\n            ::fclose(src);\n            src = nullptr;\n        }\n    }\n\n    // check whether we're at the end of the source file\n    bool eof() const {\n        return nReadPos == nSrcPos && feof(src);\n    }\n\n    // read a number of bytes\n    void read(char *pch, size_t nSize) {\n        if (nSize + nReadPos > nReadLimit)\n            throw std::ios_base::failure(\"Read attempted past buffer limit\");\n        if (nSize + nRewind > vchBuf.size())\n            throw std::ios_base::failure(\"Read larger than buffer size\");\n        while (nSize > 0) {\n            if (nReadPos == nSrcPos)\n                Fill();\n            unsigned int pos = nReadPos % vchBuf.size();\n            size_t nNow = nSize;\n            if (nNow + pos > vchBuf.size())\n                nNow = vchBuf.size() - pos;\n            if (nNow + nReadPos > nSrcPos)\n                nNow = nSrcPos - nReadPos;\n            memcpy(pch, &vchBuf[pos], nNow);\n            nReadPos += nNow;\n            pch += nNow;\n            nSize -= nNow;\n        }\n    }\n\n    // return the current reading position\n    uint64_t GetPos() const {\n        return nReadPos;\n    }\n\n    // rewind to a given reading position\n    bool SetPos(uint64_t nPos) {\n        nReadPos = nPos;\n        if (nReadPos + nRewind < nSrcPos) {\n            nReadPos = nSrcPos - nRewind;\n            return false;\n        } else if (nReadPos > nSrcPos) {\n            nReadPos = nSrcPos;\n            return false;\n        } else {\n            return true;\n        }\n    }\n\n    bool Seek(uint64_t nPos) {\n        long nLongPos = nPos;\n        if (nPos != (uint64_t)nLongPos)\n            return false;\n        if (fseek(src, nLongPos, SEEK_SET))\n            return false;\n        nLongPos = ftell(src);\n        nSrcPos = nLongPos;\n        nReadPos = nLongPos;\n        return true;\n    }\n\n    // prevent reading beyond a certain position\n    // no argument removes the limit\n    bool SetLimit(uint64_t nPos = (uint64_t)(-1)) {\n        if (nPos < nReadPos)\n            return false;\n        nReadLimit = nPos;\n        return true;\n    }\n\n    template<typename T>\n    CBufferedFile& operator>>(T& obj) {\n        // Unserialize from this stream\n        ::Unserialize(*this, obj);\n        return (*this);\n    }\n\n    // search for a given byte in the stream, and remain positioned on it\n    void FindByte(char ch) {\n        while (true) {\n            if (nReadPos == nSrcPos)\n                Fill();\n            if (vchBuf[nReadPos % vchBuf.size()] == ch)\n                break;\n            nReadPos++;\n        }\n    }\n};\n\n#endif // BITCOIN_STREAMS_H\n"
  },
  {
    "path": "src/support/allocators/secure.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SUPPORT_ALLOCATORS_SECURE_H\n#define BITCOIN_SUPPORT_ALLOCATORS_SECURE_H\n\n#include <support/lockedpool.h>\n#include <support/cleanse.h>\n\n#include <string>\n\n//\n// Allocator that locks its contents from being paged\n// out of memory and clears its contents before deletion.\n//\ntemplate <typename T>\nstruct secure_allocator : public std::allocator<T> {\n    // MSVC8 default copy constructor is broken\n    typedef std::allocator<T> base;\n    typedef typename base::size_type size_type;\n    typedef typename base::difference_type difference_type;\n    typedef typename base::pointer pointer;\n    typedef typename base::const_pointer const_pointer;\n    typedef typename base::reference reference;\n    typedef typename base::const_reference const_reference;\n    typedef typename base::value_type value_type;\n    secure_allocator() noexcept {}\n    secure_allocator(const secure_allocator& a) noexcept : base(a) {}\n    template <typename U>\n    secure_allocator(const secure_allocator<U>& a) noexcept : base(a)\n    {\n    }\n    ~secure_allocator() noexcept {}\n    template <typename _Other>\n    struct rebind {\n        typedef secure_allocator<_Other> other;\n    };\n\n    T* allocate(std::size_t n, const void* hint = 0)\n    {\n        return static_cast<T*>(LockedPoolManager::Instance().alloc(sizeof(T) * n));\n    }\n\n    void deallocate(T* p, std::size_t n)\n    {\n        if (p != nullptr) {\n            memory_cleanse(p, sizeof(T) * n);\n        }\n        LockedPoolManager::Instance().free(p);\n    }\n};\n\n// This is exactly like std::string, but with a custom allocator.\ntypedef std::basic_string<char, std::char_traits<char>, secure_allocator<char> > SecureString;\n\n#endif // BITCOIN_SUPPORT_ALLOCATORS_SECURE_H\n"
  },
  {
    "path": "src/support/allocators/zeroafterfree.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H\n#define BITCOIN_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H\n\n#include <support/cleanse.h>\n\n#include <memory>\n#include <vector>\n\ntemplate <typename T>\nstruct zero_after_free_allocator : public std::allocator<T> {\n    // MSVC8 default copy constructor is broken\n    typedef std::allocator<T> base;\n    typedef typename base::size_type size_type;\n    typedef typename base::difference_type difference_type;\n    typedef typename base::pointer pointer;\n    typedef typename base::const_pointer const_pointer;\n    typedef typename base::reference reference;\n    typedef typename base::const_reference const_reference;\n    typedef typename base::value_type value_type;\n    zero_after_free_allocator() noexcept {}\n    zero_after_free_allocator(const zero_after_free_allocator& a) noexcept : base(a) {}\n    template <typename U>\n    zero_after_free_allocator(const zero_after_free_allocator<U>& a) noexcept : base(a)\n    {\n    }\n    ~zero_after_free_allocator() noexcept {}\n    template <typename _Other>\n    struct rebind {\n        typedef zero_after_free_allocator<_Other> other;\n    };\n\n    void deallocate(T* p, std::size_t n)\n    {\n        if (p != nullptr)\n            memory_cleanse(p, sizeof(T) * n);\n        std::allocator<T>::deallocate(p, n);\n    }\n};\n\n// Byte-vector that clears its contents before deletion.\ntypedef std::vector<char, zero_after_free_allocator<char> > CSerializeData;\n\n#endif // BITCOIN_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H\n"
  },
  {
    "path": "src/support/cleanse.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <support/cleanse.h>\n\n#include <cstring>\n\n#if defined(_MSC_VER)\n#include <Windows.h> // For SecureZeroMemory.\n#endif\n\n/* Compilers have a bad habit of removing \"superfluous\" memset calls that\n * are trying to zero memory. For example, when memset()ing a buffer and\n * then free()ing it, the compiler might decide that the memset is\n * unobservable and thus can be removed.\n *\n * Previously we used OpenSSL which tried to stop this by a) implementing\n * memset in assembly on x86 and b) putting the function in its own file\n * for other platforms.\n *\n * This change removes those tricks in favour of using asm directives to\n * scare the compiler away. As best as our compiler folks can tell, this is\n * sufficient and will continue to be so.\n *\n * Adam Langley <agl@google.com>\n * Commit: ad1907fe73334d6c696c8539646c21b11178f20f\n * BoringSSL (LICENSE: ISC)\n */\nvoid memory_cleanse(void *ptr, size_t len)\n{\n    std::memset(ptr, 0, len);\n\n    /* As best as we can tell, this is sufficient to break any optimisations that\n       might try to eliminate \"superfluous\" memsets. If there's an easy way to\n       detect memset_s, it would be better to use that. */\n#if defined(_MSC_VER)\n    SecureZeroMemory(ptr, len);\n#else\n    __asm__ __volatile__(\"\" : : \"r\"(ptr) : \"memory\");\n#endif\n}\n"
  },
  {
    "path": "src/support/cleanse.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SUPPORT_CLEANSE_H\n#define BITCOIN_SUPPORT_CLEANSE_H\n\n#include <stdlib.h>\n\n// Attempt to overwrite data in the specified memory span.\nvoid memory_cleanse(void *ptr, size_t len);\n\n#endif // BITCOIN_SUPPORT_CLEANSE_H\n"
  },
  {
    "path": "src/support/events.h",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SUPPORT_EVENTS_H\n#define BITCOIN_SUPPORT_EVENTS_H\n\n#include <ios>\n#include <memory>\n\n#include <event2/event.h>\n#include <event2/http.h>\n\n#define MAKE_RAII(type) \\\n/* deleter */\\\nstruct type##_deleter {\\\n    void operator()(struct type* ob) {\\\n        type##_free(ob);\\\n    }\\\n};\\\n/* unique ptr typedef */\\\ntypedef std::unique_ptr<struct type, type##_deleter> raii_##type\n\nMAKE_RAII(event_base);\nMAKE_RAII(event);\nMAKE_RAII(evhttp);\nMAKE_RAII(evhttp_request);\nMAKE_RAII(evhttp_connection);\n\ninline raii_event_base obtain_event_base() {\n    auto result = raii_event_base(event_base_new());\n    if (!result.get())\n        throw std::runtime_error(\"cannot create event_base\");\n    return result;\n}\n\ninline raii_event obtain_event(struct event_base* base, evutil_socket_t s, short events, event_callback_fn cb, void* arg) {\n    return raii_event(event_new(base, s, events, cb, arg));\n}\n\ninline raii_evhttp obtain_evhttp(struct event_base* base) {\n    return raii_evhttp(evhttp_new(base));\n}\n\ninline raii_evhttp_request obtain_evhttp_request(void(*cb)(struct evhttp_request *, void *), void *arg) {\n    return raii_evhttp_request(evhttp_request_new(cb, arg));\n}\n\ninline raii_evhttp_connection obtain_evhttp_connection_base(struct event_base* base, std::string host, uint16_t port) {\n    auto result = raii_evhttp_connection(evhttp_connection_base_new(base, nullptr, host.c_str(), port));\n    if (!result.get())\n        throw std::runtime_error(\"create connection failed\");\n    return result;\n}\n\n#endif // BITCOIN_SUPPORT_EVENTS_H\n"
  },
  {
    "path": "src/support/lockedpool.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <support/lockedpool.h>\n#include <support/cleanse.h>\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#ifdef WIN32\n#ifdef _WIN32_WINNT\n#undef _WIN32_WINNT\n#endif\n#define _WIN32_WINNT 0x0501\n#define WIN32_LEAN_AND_MEAN 1\n#ifndef NOMINMAX\n#define NOMINMAX\n#endif\n#include <windows.h>\n#else\n#include <sys/mman.h> // for mmap\n#include <sys/resource.h> // for getrlimit\n#include <limits.h> // for PAGESIZE\n#include <unistd.h> // for sysconf\n#endif\n\n#include <algorithm>\n#include <memory>\n\nLockedPoolManager* LockedPoolManager::_instance = nullptr;\nstd::once_flag LockedPoolManager::init_flag;\n\n/*******************************************************************************/\n// Utilities\n//\n/** Align up to power of 2 */\nstatic inline size_t align_up(size_t x, size_t align)\n{\n    return (x + align - 1) & ~(align - 1);\n}\n\n/*******************************************************************************/\n// Implementation: Arena\n\nArena::Arena(void *base_in, size_t size_in, size_t alignment_in):\n    base(static_cast<char*>(base_in)), end(static_cast<char*>(base_in) + size_in), alignment(alignment_in)\n{\n    // Start with one free chunk that covers the entire arena\n    chunks_free.emplace(base, size_in);\n}\n\nArena::~Arena()\n{\n}\n\nvoid* Arena::alloc(size_t size)\n{\n    // Round to next multiple of alignment\n    size = align_up(size, alignment);\n\n    // Don't handle zero-sized chunks\n    if (size == 0)\n        return nullptr;\n\n    // Pick a large enough free-chunk\n    auto it = std::find_if(chunks_free.begin(), chunks_free.end(),\n        [=](const std::map<char*, size_t>::value_type& chunk){ return chunk.second >= size; });\n    if (it == chunks_free.end())\n        return nullptr;\n\n    // Create the used-chunk, taking its space from the end of the free-chunk\n    auto alloced = chunks_used.emplace(it->first + it->second - size, size).first;\n    if (!(it->second -= size))\n        chunks_free.erase(it);\n    return reinterpret_cast<void*>(alloced->first);\n}\n\n/* extend the Iterator if other begins at its end */\ntemplate <class Iterator, class Pair> bool extend(Iterator it, const Pair& other) {\n    if (it->first + it->second == other.first) {\n        it->second += other.second;\n        return true;\n    }\n    return false;\n}\n\nvoid Arena::free(void *ptr)\n{\n    // Freeing the nullptr pointer is OK.\n    if (ptr == nullptr) {\n        return;\n    }\n\n    // Remove chunk from used map\n    auto i = chunks_used.find(static_cast<char*>(ptr));\n    if (i == chunks_used.end()) {\n        throw std::runtime_error(\"Arena: invalid or double free\");\n    }\n    auto freed = *i;\n    chunks_used.erase(i);\n\n    // Add space to free map, coalescing contiguous chunks\n    auto next = chunks_free.upper_bound(freed.first);\n    auto prev = (next == chunks_free.begin()) ? chunks_free.end() : std::prev(next);\n    if (prev == chunks_free.end() || !extend(prev, freed))\n        prev = chunks_free.emplace_hint(next, freed);\n    if (next != chunks_free.end() && extend(prev, *next))\n        chunks_free.erase(next);\n}\n\nArena::Stats Arena::stats() const\n{\n    Arena::Stats r{ 0, 0, 0, chunks_used.size(), chunks_free.size() };\n    for (const auto& chunk: chunks_used)\n        r.used += chunk.second;\n    for (const auto& chunk: chunks_free)\n        r.free += chunk.second;\n    r.total = r.used + r.free;\n    return r;\n}\n\n#ifdef ARENA_DEBUG\nvoid printchunk(char* base, size_t sz, bool used) {\n    std::cout <<\n        \"0x\" << std::hex << std::setw(16) << std::setfill('0') << base <<\n        \" 0x\" << std::hex << std::setw(16) << std::setfill('0') << sz <<\n        \" 0x\" << used << std::endl;\n}\nvoid Arena::walk() const\n{\n    for (const auto& chunk: chunks_used)\n        printchunk(chunk.first, chunk.second, true);\n    std::cout << std::endl;\n    for (const auto& chunk: chunks_free)\n        printchunk(chunk.first, chunk.second, false);\n    std::cout << std::endl;\n}\n#endif\n\n/*******************************************************************************/\n// Implementation: Win32LockedPageAllocator\n\n#ifdef WIN32\n/** LockedPageAllocator specialized for Windows.\n */\nclass Win32LockedPageAllocator: public LockedPageAllocator\n{\npublic:\n    Win32LockedPageAllocator();\n    void* AllocateLocked(size_t len, bool *lockingSuccess) override;\n    void FreeLocked(void* addr, size_t len) override;\n    size_t GetLimit() override;\nprivate:\n    size_t page_size;\n};\n\nWin32LockedPageAllocator::Win32LockedPageAllocator()\n{\n    // Determine system page size in bytes\n    SYSTEM_INFO sSysInfo;\n    GetSystemInfo(&sSysInfo);\n    page_size = sSysInfo.dwPageSize;\n}\nvoid *Win32LockedPageAllocator::AllocateLocked(size_t len, bool *lockingSuccess)\n{\n    len = align_up(len, page_size);\n    void *addr = VirtualAlloc(nullptr, len, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);\n    if (addr) {\n        // VirtualLock is used to attempt to keep keying material out of swap. Note\n        // that it does not provide this as a guarantee, but, in practice, memory\n        // that has been VirtualLock'd almost never gets written to the pagefile\n        // except in rare circumstances where memory is extremely low.\n        *lockingSuccess = VirtualLock(const_cast<void*>(addr), len) != 0;\n    }\n    return addr;\n}\nvoid Win32LockedPageAllocator::FreeLocked(void* addr, size_t len)\n{\n    len = align_up(len, page_size);\n    memory_cleanse(addr, len);\n    VirtualUnlock(const_cast<void*>(addr), len);\n}\n\nsize_t Win32LockedPageAllocator::GetLimit()\n{\n    // TODO is there a limit on windows, how to get it?\n    return std::numeric_limits<size_t>::max();\n}\n#endif\n\n/*******************************************************************************/\n// Implementation: PosixLockedPageAllocator\n\n#ifndef WIN32\n/** LockedPageAllocator specialized for OSes that don't try to be\n * special snowflakes.\n */\nclass PosixLockedPageAllocator: public LockedPageAllocator\n{\npublic:\n    PosixLockedPageAllocator();\n    void* AllocateLocked(size_t len, bool *lockingSuccess) override;\n    void FreeLocked(void* addr, size_t len) override;\n    size_t GetLimit() override;\nprivate:\n    size_t page_size;\n};\n\nPosixLockedPageAllocator::PosixLockedPageAllocator()\n{\n    // Determine system page size in bytes\n#if defined(PAGESIZE) // defined in limits.h\n    page_size = PAGESIZE;\n#else                   // assume some POSIX OS\n    page_size = sysconf(_SC_PAGESIZE);\n#endif\n}\n\n// Some systems (at least OS X) do not define MAP_ANONYMOUS yet and define\n// MAP_ANON which is deprecated\n#ifndef MAP_ANONYMOUS\n#define MAP_ANONYMOUS MAP_ANON\n#endif\n\nvoid *PosixLockedPageAllocator::AllocateLocked(size_t len, bool *lockingSuccess)\n{\n    void *addr;\n    len = align_up(len, page_size);\n    addr = mmap(nullptr, len, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);\n    if (addr) {\n        *lockingSuccess = mlock(addr, len) == 0;\n    }\n    return addr;\n}\nvoid PosixLockedPageAllocator::FreeLocked(void* addr, size_t len)\n{\n    len = align_up(len, page_size);\n    memory_cleanse(addr, len);\n    munlock(addr, len);\n    munmap(addr, len);\n}\nsize_t PosixLockedPageAllocator::GetLimit()\n{\n#ifdef RLIMIT_MEMLOCK\n    struct rlimit rlim;\n    if (getrlimit(RLIMIT_MEMLOCK, &rlim) == 0) {\n        if (rlim.rlim_cur != RLIM_INFINITY) {\n            return rlim.rlim_cur;\n        }\n    }\n#endif\n    return std::numeric_limits<size_t>::max();\n}\n#endif\n\n/*******************************************************************************/\n// Implementation: LockedPool\n\nLockedPool::LockedPool(std::unique_ptr<LockedPageAllocator> allocator_in, LockingFailed_Callback lf_cb_in):\n    allocator(std::move(allocator_in)), lf_cb(lf_cb_in), cumulative_bytes_locked(0)\n{\n}\n\nLockedPool::~LockedPool()\n{\n}\nvoid* LockedPool::alloc(size_t size)\n{\n    std::lock_guard<std::mutex> lock(mutex);\n\n    // Don't handle impossible sizes\n    if (size == 0 || size > ARENA_SIZE)\n        return nullptr;\n\n    // Try allocating from each current arena\n    for (auto &arena: arenas) {\n        void *addr = arena.alloc(size);\n        if (addr) {\n            return addr;\n        }\n    }\n    // If that fails, create a new one\n    if (new_arena(ARENA_SIZE, ARENA_ALIGN)) {\n        return arenas.back().alloc(size);\n    }\n    return nullptr;\n}\n\nvoid LockedPool::free(void *ptr)\n{\n    std::lock_guard<std::mutex> lock(mutex);\n    // TODO we can do better than this linear search by keeping a map of arena\n    // extents to arena, and looking up the address.\n    for (auto &arena: arenas) {\n        if (arena.addressInArena(ptr)) {\n            arena.free(ptr);\n            return;\n        }\n    }\n    throw std::runtime_error(\"LockedPool: invalid address not pointing to any arena\");\n}\n\nLockedPool::Stats LockedPool::stats() const\n{\n    std::lock_guard<std::mutex> lock(mutex);\n    LockedPool::Stats r{0, 0, 0, cumulative_bytes_locked, 0, 0};\n    for (const auto &arena: arenas) {\n        Arena::Stats i = arena.stats();\n        r.used += i.used;\n        r.free += i.free;\n        r.total += i.total;\n        r.chunks_used += i.chunks_used;\n        r.chunks_free += i.chunks_free;\n    }\n    return r;\n}\n\nbool LockedPool::new_arena(size_t size, size_t align)\n{\n    bool locked;\n    // If this is the first arena, handle this specially: Cap the upper size\n    // by the process limit. This makes sure that the first arena will at least\n    // be locked. An exception to this is if the process limit is 0:\n    // in this case no memory can be locked at all so we'll skip past this logic.\n    if (arenas.empty()) {\n        size_t limit = allocator->GetLimit();\n        if (limit > 0) {\n            size = std::min(size, limit);\n        }\n    }\n    void *addr = allocator->AllocateLocked(size, &locked);\n    if (!addr) {\n        return false;\n    }\n    if (locked) {\n        cumulative_bytes_locked += size;\n    } else if (lf_cb) { // Call the locking-failed callback if locking failed\n        if (!lf_cb()) { // If the callback returns false, free the memory and fail, otherwise consider the user warned and proceed.\n            allocator->FreeLocked(addr, size);\n            return false;\n        }\n    }\n    arenas.emplace_back(allocator.get(), addr, size, align);\n    return true;\n}\n\nLockedPool::LockedPageArena::LockedPageArena(LockedPageAllocator *allocator_in, void *base_in, size_t size_in, size_t align_in):\n    Arena(base_in, size_in, align_in), base(base_in), size(size_in), allocator(allocator_in)\n{\n}\nLockedPool::LockedPageArena::~LockedPageArena()\n{\n    allocator->FreeLocked(base, size);\n}\n\n/*******************************************************************************/\n// Implementation: LockedPoolManager\n//\nLockedPoolManager::LockedPoolManager(std::unique_ptr<LockedPageAllocator> allocator_in):\n    LockedPool(std::move(allocator_in), &LockedPoolManager::LockingFailed)\n{\n}\n\nbool LockedPoolManager::LockingFailed()\n{\n    // TODO: log something but how? without including util.h\n    return true;\n}\n\nvoid LockedPoolManager::CreateInstance()\n{\n    // Using a local static instance guarantees that the object is initialized\n    // when it's first needed and also deinitialized after all objects that use\n    // it are done with it.  I can think of one unlikely scenario where we may\n    // have a static deinitialization order/problem, but the check in\n    // LockedPoolManagerBase's destructor helps us detect if that ever happens.\n#ifdef WIN32\n    std::unique_ptr<LockedPageAllocator> allocator(new Win32LockedPageAllocator());\n#else\n    std::unique_ptr<LockedPageAllocator> allocator(new PosixLockedPageAllocator());\n#endif\n    static LockedPoolManager instance(std::move(allocator));\n    LockedPoolManager::_instance = &instance;\n}\n"
  },
  {
    "path": "src/support/lockedpool.h",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SUPPORT_LOCKEDPOOL_H\n#define BITCOIN_SUPPORT_LOCKEDPOOL_H\n\n#include <stdint.h>\n#include <list>\n#include <map>\n#include <mutex>\n#include <memory>\n\n/**\n * OS-dependent allocation and deallocation of locked/pinned memory pages.\n * Abstract base class.\n */\nclass LockedPageAllocator\n{\npublic:\n    virtual ~LockedPageAllocator() {}\n    /** Allocate and lock memory pages.\n     * If len is not a multiple of the system page size, it is rounded up.\n     * Returns 0 in case of allocation failure.\n     *\n     * If locking the memory pages could not be accomplished it will still\n     * return the memory, however the lockingSuccess flag will be false.\n     * lockingSuccess is undefined if the allocation fails.\n     */\n    virtual void* AllocateLocked(size_t len, bool *lockingSuccess) = 0;\n\n    /** Unlock and free memory pages.\n     * Clear the memory before unlocking.\n     */\n    virtual void FreeLocked(void* addr, size_t len) = 0;\n\n    /** Get the total limit on the amount of memory that may be locked by this\n     * process, in bytes. Return size_t max if there is no limit or the limit\n     * is unknown. Return 0 if no memory can be locked at all.\n     */\n    virtual size_t GetLimit() = 0;\n};\n\n/* An arena manages a contiguous region of memory by dividing it into\n * chunks.\n */\nclass Arena\n{\npublic:\n    Arena(void *base, size_t size, size_t alignment);\n    virtual ~Arena();\n\n    Arena(const Arena& other) = delete; // non construction-copyable\n    Arena& operator=(const Arena&) = delete; // non copyable\n\n    /** Memory statistics. */\n    struct Stats\n    {\n        size_t used;\n        size_t free;\n        size_t total;\n        size_t chunks_used;\n        size_t chunks_free;\n    };\n\n    /** Allocate size bytes from this arena.\n     * Returns pointer on success, or 0 if memory is full or\n     * the application tried to allocate 0 bytes.\n     */\n    void* alloc(size_t size);\n\n    /** Free a previously allocated chunk of memory.\n     * Freeing the zero pointer has no effect.\n     * Raises std::runtime_error in case of error.\n     */\n    void free(void *ptr);\n\n    /** Get arena usage statistics */\n    Stats stats() const;\n\n#ifdef ARENA_DEBUG\n    void walk() const;\n#endif\n\n    /** Return whether a pointer points inside this arena.\n     * This returns base <= ptr < (base+size) so only use it for (inclusive)\n     * chunk starting addresses.\n     */\n    bool addressInArena(void *ptr) const { return ptr >= base && ptr < end; }\nprivate:\n    /** Map of chunk address to chunk information. This class makes use of the\n     * sorted order to merge previous and next chunks during deallocation.\n     */\n    std::map<char*, size_t> chunks_free;\n    std::map<char*, size_t> chunks_used;\n    /** Base address of arena */\n    char* base;\n    /** End address of arena */\n    char* end;\n    /** Minimum chunk alignment */\n    size_t alignment;\n};\n\n/** Pool for locked memory chunks.\n *\n * To avoid sensitive key data from being swapped to disk, the memory in this pool\n * is locked/pinned.\n *\n * An arena manages a contiguous region of memory. The pool starts out with one arena\n * but can grow to multiple arenas if the need arises.\n *\n * Unlike a normal C heap, the administrative structures are separate from the managed\n * memory. This has been done as the sizes and bases of objects are not in themselves sensitive\n * information, as to conserve precious locked memory. In some operating systems\n * the amount of memory that can be locked is small.\n */\nclass LockedPool\n{\npublic:\n    /** Size of one arena of locked memory. This is a compromise.\n     * Do not set this too low, as managing many arenas will increase\n     * allocation and deallocation overhead. Setting it too high allocates\n     * more locked memory from the OS than strictly necessary.\n     */\n    static const size_t ARENA_SIZE = 256*1024;\n    /** Chunk alignment. Another compromise. Setting this too high will waste\n     * memory, setting it too low will facilitate fragmentation.\n     */\n    static const size_t ARENA_ALIGN = 16;\n\n    /** Callback when allocation succeeds but locking fails.\n     */\n    typedef bool (*LockingFailed_Callback)();\n\n    /** Memory statistics. */\n    struct Stats\n    {\n        size_t used;\n        size_t free;\n        size_t total;\n        size_t locked;\n        size_t chunks_used;\n        size_t chunks_free;\n    };\n\n    /** Create a new LockedPool. This takes ownership of the MemoryPageLocker,\n     * you can only instantiate this with LockedPool(std::move(...)).\n     *\n     * The second argument is an optional callback when locking a newly allocated arena failed.\n     * If this callback is provided and returns false, the allocation fails (hard fail), if\n     * it returns true the allocation proceeds, but it could warn.\n     */\n    explicit LockedPool(std::unique_ptr<LockedPageAllocator> allocator, LockingFailed_Callback lf_cb_in = nullptr);\n    ~LockedPool();\n\n    LockedPool(const LockedPool& other) = delete; // non construction-copyable\n    LockedPool& operator=(const LockedPool&) = delete; // non copyable\n\n    /** Allocate size bytes from this arena.\n     * Returns pointer on success, or 0 if memory is full or\n     * the application tried to allocate 0 bytes.\n     */\n    void* alloc(size_t size);\n\n    /** Free a previously allocated chunk of memory.\n     * Freeing the zero pointer has no effect.\n     * Raises std::runtime_error in case of error.\n     */\n    void free(void *ptr);\n\n    /** Get pool usage statistics */\n    Stats stats() const;\nprivate:\n    std::unique_ptr<LockedPageAllocator> allocator;\n\n    /** Create an arena from locked pages */\n    class LockedPageArena: public Arena\n    {\n    public:\n        LockedPageArena(LockedPageAllocator *alloc_in, void *base_in, size_t size, size_t align);\n        ~LockedPageArena();\n    private:\n        void *base;\n        size_t size;\n        LockedPageAllocator *allocator;\n    };\n\n    bool new_arena(size_t size, size_t align);\n\n    std::list<LockedPageArena> arenas;\n    LockingFailed_Callback lf_cb;\n    size_t cumulative_bytes_locked;\n    /** Mutex protects access to this pool's data structures, including arenas.\n     */\n    mutable std::mutex mutex;\n};\n\n/**\n * Singleton class to keep track of locked (ie, non-swappable) memory, for use in\n * std::allocator templates.\n *\n * Some implementations of the STL allocate memory in some constructors (i.e., see\n * MSVC's vector<T> implementation where it allocates 1 byte of memory in the allocator.)\n * Due to the unpredictable order of static initializers, we have to make sure the\n * LockedPoolManager instance exists before any other STL-based objects that use\n * secure_allocator are created. So instead of having LockedPoolManager also be\n * static-initialized, it is created on demand.\n */\nclass LockedPoolManager : public LockedPool\n{\npublic:\n    /** Return the current instance, or create it once */\n    static LockedPoolManager& Instance()\n    {\n        std::call_once(LockedPoolManager::init_flag, LockedPoolManager::CreateInstance);\n        return *LockedPoolManager::_instance;\n    }\n\nprivate:\n    explicit LockedPoolManager(std::unique_ptr<LockedPageAllocator> allocator);\n\n    /** Create a new LockedPoolManager specialized to the OS */\n    static void CreateInstance();\n    /** Called when locking fails, warn the user here */\n    static bool LockingFailed();\n\n    static LockedPoolManager* _instance;\n    static std::once_flag init_flag;\n};\n\n#endif // BITCOIN_SUPPORT_LOCKEDPOOL_H\n"
  },
  {
    "path": "src/sync.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <sync.h>\n\n#include <memory>\n#include <set>\n#include <util.h>\n#include <utilstrencodings.h>\n\n#include <stdio.h>\n\n#ifdef DEBUG_LOCKCONTENTION\n#if !defined(HAVE_THREAD_LOCAL)\nstatic_assert(false, \"thread_local is not supported\");\n#endif\nvoid PrintLockContention(const char* pszName, const char* pszFile, int nLine)\n{\n    LogPrintf(\"LOCKCONTENTION: %s\\n\", pszName);\n    LogPrintf(\"Locker: %s:%d\\n\", pszFile, nLine);\n}\n#endif /* DEBUG_LOCKCONTENTION */\n\n#ifdef DEBUG_LOCKORDER\n//\n// Early deadlock detection.\n// Problem being solved:\n//    Thread 1 locks  A, then B, then C\n//    Thread 2 locks  D, then C, then A\n//     --> may result in deadlock between the two threads, depending on when they run.\n// Solution implemented here:\n// Keep track of pairs of locks: (A before B), (A before C), etc.\n// Complain if any thread tries to lock in a different order.\n//\n\nstruct CLockLocation {\n    CLockLocation(const char* pszName, const char* pszFile, int nLine, bool fTryIn)\n    {\n        mutexName = pszName;\n        sourceFile = pszFile;\n        sourceLine = nLine;\n        fTry = fTryIn;\n    }\n\n    std::string ToString() const\n    {\n        return mutexName + \"  \" + sourceFile + \":\" + itostr(sourceLine) + (fTry ? \" (TRY)\" : \"\");\n    }\n\nprivate:\n    bool fTry;\n    std::string mutexName;\n    std::string sourceFile;\n    int sourceLine;\n};\n\ntypedef std::vector<std::pair<void*, CLockLocation> > LockStack;\ntypedef std::map<std::pair<void*, void*>, LockStack> LockOrders;\ntypedef std::set<std::pair<void*, void*> > InvLockOrders;\n\nstruct LockData {\n    // Very ugly hack: as the global constructs and destructors run single\n    // threaded, we use this boolean to know whether LockData still exists,\n    // as DeleteLock can get called by global CCriticalSection destructors\n    // after LockData disappears.\n    bool available;\n    LockData() : available(true) {}\n    ~LockData() { available = false; }\n\n    LockOrders lockorders;\n    InvLockOrders invlockorders;\n    std::mutex dd_mutex;\n} static lockdata;\n\nstatic thread_local LockStack g_lockstack;\n\nstatic void potential_deadlock_detected(const std::pair<void*, void*>& mismatch, const LockStack& s1, const LockStack& s2)\n{\n    LogPrintf(\"POTENTIAL DEADLOCK DETECTED\\n\");\n    LogPrintf(\"Previous lock order was:\\n\");\n    for (const std::pair<void*, CLockLocation> & i : s2) {\n        if (i.first == mismatch.first) {\n            LogPrintf(\" (1)\");\n        }\n        if (i.first == mismatch.second) {\n            LogPrintf(\" (2)\");\n        }\n        LogPrintf(\" %s\\n\", i.second.ToString());\n    }\n    LogPrintf(\"Current lock order is:\\n\");\n    for (const std::pair<void*, CLockLocation> & i : s1) {\n        if (i.first == mismatch.first) {\n            LogPrintf(\" (1)\");\n        }\n        if (i.first == mismatch.second) {\n            LogPrintf(\" (2)\");\n        }\n        LogPrintf(\" %s\\n\", i.second.ToString());\n    }\n    assert(false);\n}\n\nstatic void push_lock(void* c, const CLockLocation& locklocation)\n{\n    std::lock_guard<std::mutex> lock(lockdata.dd_mutex);\n\n    g_lockstack.push_back(std::make_pair(c, locklocation));\n\n    for (const std::pair<void*, CLockLocation>& i : g_lockstack) {\n        if (i.first == c)\n            break;\n\n        std::pair<void*, void*> p1 = std::make_pair(i.first, c);\n        if (lockdata.lockorders.count(p1))\n            continue;\n        lockdata.lockorders[p1] = g_lockstack;\n\n        std::pair<void*, void*> p2 = std::make_pair(c, i.first);\n        lockdata.invlockorders.insert(p2);\n        if (lockdata.lockorders.count(p2))\n            potential_deadlock_detected(p1, lockdata.lockorders[p2], lockdata.lockorders[p1]);\n    }\n}\n\nstatic void pop_lock()\n{\n    g_lockstack.pop_back();\n}\n\nvoid EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry)\n{\n    push_lock(cs, CLockLocation(pszName, pszFile, nLine, fTry));\n}\n\nvoid LeaveCritical()\n{\n    pop_lock();\n}\n\nstd::string LocksHeld()\n{\n    std::string result;\n    for (const std::pair<void*, CLockLocation>& i : g_lockstack)\n        result += i.second.ToString() + std::string(\"\\n\");\n    return result;\n}\n\nvoid AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs)\n{\n    for (const std::pair<void*, CLockLocation>& i : g_lockstack)\n        if (i.first == cs)\n            return;\n    fprintf(stderr, \"Assertion failed: lock %s not held in %s:%i; locks held:\\n%s\", pszName, pszFile, nLine, LocksHeld().c_str());\n    abort();\n}\n\nvoid AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs)\n{\n    for (const std::pair<void*, CLockLocation>& i : g_lockstack) {\n        if (i.first == cs) {\n            fprintf(stderr, \"Assertion failed: lock %s held in %s:%i; locks held:\\n%s\", pszName, pszFile, nLine, LocksHeld().c_str());\n            abort();\n        }\n    }\n}\n\nvoid DeleteLock(void* cs)\n{\n    if (!lockdata.available) {\n        // We're already shutting down.\n        return;\n    }\n    std::lock_guard<std::mutex> lock(lockdata.dd_mutex);\n    std::pair<void*, void*> item = std::make_pair(cs, nullptr);\n    LockOrders::iterator it = lockdata.lockorders.lower_bound(item);\n    while (it != lockdata.lockorders.end() && it->first.first == cs) {\n        std::pair<void*, void*> invitem = std::make_pair(it->first.second, it->first.first);\n        lockdata.invlockorders.erase(invitem);\n        lockdata.lockorders.erase(it++);\n    }\n    InvLockOrders::iterator invit = lockdata.invlockorders.lower_bound(item);\n    while (invit != lockdata.invlockorders.end() && invit->first == cs) {\n        std::pair<void*, void*> invinvitem = std::make_pair(invit->second, invit->first);\n        lockdata.lockorders.erase(invinvitem);\n        lockdata.invlockorders.erase(invit++);\n    }\n}\n\n#endif /* DEBUG_LOCKORDER */\n"
  },
  {
    "path": "src/sync.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_SYNC_H\n#define BITCOIN_SYNC_H\n\n#include <threadsafety.h>\n\n#include <condition_variable>\n#include <thread>\n#include <mutex>\n\n\n////////////////////////////////////////////////\n//                                            //\n// THE SIMPLE DEFINITION, EXCLUDING DEBUG CODE //\n//                                            //\n////////////////////////////////////////////////\n\n/*\nCCriticalSection mutex;\n    std::recursive_mutex mutex;\n\nLOCK(mutex);\n    std::unique_lock<std::recursive_mutex> criticalblock(mutex);\n\nLOCK2(mutex1, mutex2);\n    std::unique_lock<std::recursive_mutex> criticalblock1(mutex1);\n    std::unique_lock<std::recursive_mutex> criticalblock2(mutex2);\n\nTRY_LOCK(mutex, name);\n    std::unique_lock<std::recursive_mutex> name(mutex, std::try_to_lock_t);\n\nENTER_CRITICAL_SECTION(mutex); // no RAII\n    mutex.lock();\n\nLEAVE_CRITICAL_SECTION(mutex); // no RAII\n    mutex.unlock();\n */\n\n///////////////////////////////\n//                           //\n// THE ACTUAL IMPLEMENTATION //\n//                           //\n///////////////////////////////\n\n/**\n * Template mixin that adds -Wthread-safety locking\n * annotations to a subset of the mutex API.\n */\ntemplate <typename PARENT>\nclass LOCKABLE AnnotatedMixin : public PARENT\n{\npublic:\n    void lock() EXCLUSIVE_LOCK_FUNCTION()\n    {\n        PARENT::lock();\n    }\n\n    void unlock() UNLOCK_FUNCTION()\n    {\n        PARENT::unlock();\n    }\n\n    bool try_lock() EXCLUSIVE_TRYLOCK_FUNCTION(true)\n    {\n        return PARENT::try_lock();\n    }\n};\n\n#ifdef DEBUG_LOCKORDER\nvoid EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false);\nvoid LeaveCritical();\nstd::string LocksHeld();\nvoid AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs);\nvoid AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs);\nvoid DeleteLock(void* cs);\n#else\nvoid static inline EnterCritical(const char* pszName, const char* pszFile, int nLine, void* cs, bool fTry = false) {}\nvoid static inline LeaveCritical() {}\nvoid static inline AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) {}\nvoid static inline AssertLockNotHeldInternal(const char* pszName, const char* pszFile, int nLine, void* cs) {}\nvoid static inline DeleteLock(void* cs) {}\n#endif\n#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)\n#define AssertLockNotHeld(cs) AssertLockNotHeldInternal(#cs, __FILE__, __LINE__, &cs)\n\n/**\n * Wrapped mutex: supports recursive locking, but no waiting\n * TODO: We should move away from using the recursive lock by default.\n */\nclass CCriticalSection : public AnnotatedMixin<std::recursive_mutex>\n{\npublic:\n    ~CCriticalSection() {\n        DeleteLock((void*)this);\n    }\n};\n\n/** Wrapped mutex: supports waiting but not recursive locking */\ntypedef AnnotatedMixin<std::mutex> CWaitableCriticalSection;\n\n/** Just a typedef for std::condition_variable, can be wrapped later if desired */\ntypedef std::condition_variable CConditionVariable;\n\n/** Just a typedef for std::unique_lock, can be wrapped later if desired */\ntypedef std::unique_lock<std::mutex> WaitableLock;\n\n#ifdef DEBUG_LOCKCONTENTION\nvoid PrintLockContention(const char* pszName, const char* pszFile, int nLine);\n#endif\n\n/** Wrapper around std::unique_lock<CCriticalSection> */\nclass SCOPED_LOCKABLE CCriticalBlock\n{\nprivate:\n    std::unique_lock<CCriticalSection> lock;\n\n    void Enter(const char* pszName, const char* pszFile, int nLine)\n    {\n        EnterCritical(pszName, pszFile, nLine, (void*)(lock.mutex()));\n#ifdef DEBUG_LOCKCONTENTION\n        if (!lock.try_lock()) {\n            PrintLockContention(pszName, pszFile, nLine);\n#endif\n            lock.lock();\n#ifdef DEBUG_LOCKCONTENTION\n        }\n#endif\n    }\n\n    bool TryEnter(const char* pszName, const char* pszFile, int nLine)\n    {\n        EnterCritical(pszName, pszFile, nLine, (void*)(lock.mutex()), true);\n        lock.try_lock();\n        if (!lock.owns_lock())\n            LeaveCritical();\n        return lock.owns_lock();\n    }\n\npublic:\n    CCriticalBlock(CCriticalSection& mutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(mutexIn) : lock(mutexIn, std::defer_lock)\n    {\n        if (fTry)\n            TryEnter(pszName, pszFile, nLine);\n        else\n            Enter(pszName, pszFile, nLine);\n    }\n\n    CCriticalBlock(CCriticalSection* pmutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(pmutexIn)\n    {\n        if (!pmutexIn) return;\n\n        lock = std::unique_lock<CCriticalSection>(*pmutexIn, std::defer_lock);\n        if (fTry)\n            TryEnter(pszName, pszFile, nLine);\n        else\n            Enter(pszName, pszFile, nLine);\n    }\n\n    ~CCriticalBlock() UNLOCK_FUNCTION()\n    {\n        if (lock.owns_lock())\n            LeaveCritical();\n    }\n\n    operator bool()\n    {\n        return lock.owns_lock();\n    }\n};\n\n#define PASTE(x, y) x ## y\n#define PASTE2(x, y) PASTE(x, y)\n\n#define LOCK(cs) CCriticalBlock PASTE2(criticalblock, __COUNTER__)(cs, #cs, __FILE__, __LINE__)\n#define LOCK2(cs1, cs2) CCriticalBlock criticalblock1(cs1, #cs1, __FILE__, __LINE__), criticalblock2(cs2, #cs2, __FILE__, __LINE__)\n#define TRY_LOCK(cs, name) CCriticalBlock name(cs, #cs, __FILE__, __LINE__, true)\n\n#define ENTER_CRITICAL_SECTION(cs)                            \\\n    {                                                         \\\n        EnterCritical(#cs, __FILE__, __LINE__, (void*)(&cs)); \\\n        (cs).lock();                                          \\\n    }\n\n#define LEAVE_CRITICAL_SECTION(cs) \\\n    {                              \\\n        (cs).unlock();             \\\n        LeaveCritical();           \\\n    }\n\nclass CSemaphore\n{\nprivate:\n    std::condition_variable condition;\n    std::mutex mutex;\n    int value;\n\npublic:\n    explicit CSemaphore(int init) : value(init) {}\n\n    void wait()\n    {\n        std::unique_lock<std::mutex> lock(mutex);\n        condition.wait(lock, [&]() { return value >= 1; });\n        value--;\n    }\n\n    bool try_wait()\n    {\n        std::lock_guard<std::mutex> lock(mutex);\n        if (value < 1)\n            return false;\n        value--;\n        return true;\n    }\n\n    void post()\n    {\n        {\n            std::lock_guard<std::mutex> lock(mutex);\n            value++;\n        }\n        condition.notify_one();\n    }\n};\n\n/** RAII-style semaphore lock */\nclass CSemaphoreGrant\n{\nprivate:\n    CSemaphore* sem;\n    bool fHaveGrant;\n\npublic:\n    void Acquire()\n    {\n        if (fHaveGrant)\n            return;\n        sem->wait();\n        fHaveGrant = true;\n    }\n\n    void Release()\n    {\n        if (!fHaveGrant)\n            return;\n        sem->post();\n        fHaveGrant = false;\n    }\n\n    bool TryAcquire()\n    {\n        if (!fHaveGrant && sem->try_wait())\n            fHaveGrant = true;\n        return fHaveGrant;\n    }\n\n    void MoveTo(CSemaphoreGrant& grant)\n    {\n        grant.Release();\n        grant.sem = sem;\n        grant.fHaveGrant = fHaveGrant;\n        fHaveGrant = false;\n    }\n\n    CSemaphoreGrant() : sem(nullptr), fHaveGrant(false) {}\n\n    explicit CSemaphoreGrant(CSemaphore& sema, bool fTry = false) : sem(&sema), fHaveGrant(false)\n    {\n        if (fTry)\n            TryAcquire();\n        else\n            Acquire();\n    }\n\n    ~CSemaphoreGrant()\n    {\n        Release();\n    }\n\n    operator bool() const\n    {\n        return fHaveGrant;\n    }\n};\n\n#endif // BITCOIN_SYNC_H\n"
  },
  {
    "path": "src/test/DoS_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n// Unit tests for denial-of-service detection/prevention code\n\n#include <chainparams.h>\n#include <keystore.h>\n#include <net.h>\n#include <net_processing.h>\n#include <pow.h>\n#include <script/sign.h>\n#include <serialize.h>\n#include <util.h>\n#include <validation.h>\n\n#include <test/test_bitcoin.h>\n\n#include <stdint.h>\n\n#include <boost/test/unit_test.hpp>\n\n// Tests these internal-to-net_processing.cpp methods:\nextern bool AddOrphanTx(const CTransactionRef& tx, NodeId peer);\nextern void EraseOrphansFor(NodeId peer);\nextern unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans);\nstruct COrphanTx {\n    CTransactionRef tx;\n    NodeId fromPeer;\n    int64_t nTimeExpire;\n};\nextern std::map<uint256, COrphanTx> mapOrphanTransactions;\n\nCService ip(uint32_t i)\n{\n    struct in_addr s;\n    s.s_addr = i;\n    return CService(CNetAddr(s), Params().GetDefaultPort());\n}\n\nstatic NodeId id = 0;\n\nvoid UpdateLastBlockAnnounceTime(NodeId node, int64_t time_in_seconds);\n\nBOOST_FIXTURE_TEST_SUITE(DoS_tests, TestingSetup)\n\n// Test eviction of an outbound peer whose chain never advances\n// Mock a node connection, and use mocktime to simulate a peer\n// which never sends any headers messages.  PeerLogic should\n// decide to evict that outbound peer, after the appropriate timeouts.\n// Note that we protect 4 outbound nodes from being subject to\n// this logic; this test takes advantage of that protection only\n// being applied to nodes which send headers with sufficient\n// work.\nBOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)\n{\n    std::atomic<bool> interruptDummy(false);\n\n    // Mock an outbound peer\n    CAddress addr1(ip(0xa0b0c001), NODE_NONE);\n    CNode dummyNode1(id++, ServiceFlags(NODE_NETWORK|NODE_WITNESS), 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), \"\", /*fInboundIn=*/ false);\n    dummyNode1.SetSendVersion(PROTOCOL_VERSION);\n\n    peerLogic->InitializeNode(&dummyNode1);\n    dummyNode1.nVersion = 1;\n    dummyNode1.fSuccessfullyConnected = true;\n\n    // This test requires that we have a chain with non-zero work.\n    LOCK(cs_main);\n    BOOST_CHECK(chainActive.Tip() != nullptr);\n    BOOST_CHECK(chainActive.Tip()->nChainWork > 0);\n\n    // Test starts here\n    LOCK(dummyNode1.cs_sendProcessing);\n    peerLogic->SendMessages(&dummyNode1, interruptDummy); // should result in getheaders\n    LOCK(dummyNode1.cs_vSend);\n    BOOST_CHECK(dummyNode1.vSendMsg.size() > 0);\n    dummyNode1.vSendMsg.clear();\n\n    int64_t nStartTime = GetTime();\n    // Wait 21 minutes\n    SetMockTime(nStartTime+21*60);\n    peerLogic->SendMessages(&dummyNode1, interruptDummy); // should result in getheaders\n    BOOST_CHECK(dummyNode1.vSendMsg.size() > 0);\n    // Wait 3 more minutes\n    SetMockTime(nStartTime+24*60);\n    peerLogic->SendMessages(&dummyNode1, interruptDummy); // should result in disconnect\n    BOOST_CHECK(dummyNode1.fDisconnect == true);\n    SetMockTime(0);\n\n    bool dummy;\n    peerLogic->FinalizeNode(dummyNode1.GetId(), dummy);\n}\n\nvoid AddRandomOutboundPeer(std::vector<CNode *> &vNodes, PeerLogicValidation &peerLogic)\n{\n    CAddress addr(ip(GetRandInt(0xffffffff)), NODE_NONE);\n    vNodes.emplace_back(new CNode(id++, ServiceFlags(NODE_NETWORK|NODE_WITNESS), 0, INVALID_SOCKET, addr, 0, 0, CAddress(), \"\", /*fInboundIn=*/ false));\n    CNode &node = *vNodes.back();\n    node.SetSendVersion(PROTOCOL_VERSION);\n\n    peerLogic.InitializeNode(&node);\n    node.nVersion = 1;\n    node.fSuccessfullyConnected = true;\n\n    CConnmanTest::AddNode(node);\n}\n\nBOOST_AUTO_TEST_CASE(stale_tip_peer_management)\n{\n    const Consensus::Params& consensusParams = Params().GetConsensus();\n    constexpr int nMaxOutbound = 8;\n    CConnman::Options options;\n    options.nMaxConnections = 125;\n    options.nMaxOutbound = nMaxOutbound;\n    options.nMaxFeeler = 1;\n\n    connman->Init(options);\n    std::vector<CNode *> vNodes;\n\n    // Mock some outbound peers\n    for (int i=0; i<nMaxOutbound; ++i) {\n        AddRandomOutboundPeer(vNodes, *peerLogic);\n    }\n\n    peerLogic->CheckForStaleTipAndEvictPeers(consensusParams);\n\n    // No nodes should be marked for disconnection while we have no extra peers\n    for (const CNode *node : vNodes) {\n        BOOST_CHECK(node->fDisconnect == false);\n    }\n\n    SetMockTime(GetTime() + 3*consensusParams.nPowTargetSpacing + 1);\n\n    // Now tip should definitely be stale, and we should look for an extra\n    // outbound peer\n    peerLogic->CheckForStaleTipAndEvictPeers(consensusParams);\n    BOOST_CHECK(connman->GetTryNewOutboundPeer()); // FIXME.SUGAR // <net_processing.h> STALE_CHECK_INTERVAL\n\n    // Still no peers should be marked for disconnection\n    for (const CNode *node : vNodes) {\n        BOOST_CHECK(node->fDisconnect == false);\n    }\n\n    // If we add one more peer, something should get marked for eviction\n    // on the next check (since we're mocking the time to be in the future, the\n    // required time connected check should be satisfied).\n    AddRandomOutboundPeer(vNodes, *peerLogic);\n\n    peerLogic->CheckForStaleTipAndEvictPeers(consensusParams);\n    for (int i=0; i<nMaxOutbound; ++i) {\n        BOOST_CHECK(vNodes[i]->fDisconnect == false);\n    }\n    // Last added node should get marked for eviction\n    BOOST_CHECK(vNodes.back()->fDisconnect == true); // FIXME.SUGAR // <net_processing.h> MINIMUM_CONNECT_TIME\n\n    vNodes.back()->fDisconnect = false;\n\n    // Update the last announced block time for the last\n    // peer, and check that the next newest node gets evicted.\n    UpdateLastBlockAnnounceTime(vNodes.back()->GetId(), GetTime());\n\n    peerLogic->CheckForStaleTipAndEvictPeers(consensusParams);\n    for (int i=0; i<nMaxOutbound-1; ++i) {\n        BOOST_CHECK(vNodes[i]->fDisconnect == false);\n    }\n    BOOST_CHECK(vNodes[nMaxOutbound-1]->fDisconnect == true); // FIXME.SUGAR // <net_processing.h> MINIMUM_CONNECT_TIME\n    BOOST_CHECK(vNodes.back()->fDisconnect == false);\n\n    bool dummy;\n    for (const CNode *node : vNodes) {\n        peerLogic->FinalizeNode(node->GetId(), dummy);\n    }\n\n    CConnmanTest::ClearNodes();\n}\n\nBOOST_AUTO_TEST_CASE(DoS_banning)\n{\n    std::atomic<bool> interruptDummy(false);\n\n    connman->ClearBanned();\n    CAddress addr1(ip(0xa0b0c001), NODE_NONE);\n    CNode dummyNode1(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), \"\", true);\n    dummyNode1.SetSendVersion(PROTOCOL_VERSION);\n    peerLogic->InitializeNode(&dummyNode1);\n    dummyNode1.nVersion = 1;\n    dummyNode1.fSuccessfullyConnected = true;\n    {\n        LOCK(cs_main);\n        Misbehaving(dummyNode1.GetId(), 100); // Should get banned\n    }\n    LOCK(dummyNode1.cs_sendProcessing);\n    peerLogic->SendMessages(&dummyNode1, interruptDummy);\n    BOOST_CHECK(connman->IsBanned(addr1));\n    BOOST_CHECK(!connman->IsBanned(ip(0xa0b0c001|0x0000ff00))); // Different IP, not banned\n\n    CAddress addr2(ip(0xa0b0c002), NODE_NONE);\n    CNode dummyNode2(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr2, 1, 1, CAddress(), \"\", true);\n    dummyNode2.SetSendVersion(PROTOCOL_VERSION);\n    peerLogic->InitializeNode(&dummyNode2);\n    dummyNode2.nVersion = 1;\n    dummyNode2.fSuccessfullyConnected = true;\n    {\n        LOCK(cs_main);\n        Misbehaving(dummyNode2.GetId(), 50);\n    }\n    LOCK(dummyNode2.cs_sendProcessing);\n    peerLogic->SendMessages(&dummyNode2, interruptDummy);\n    BOOST_CHECK(!connman->IsBanned(addr2)); // 2 not banned yet...\n    BOOST_CHECK(connman->IsBanned(addr1));  // ... but 1 still should be\n    {\n        LOCK(cs_main);\n        Misbehaving(dummyNode2.GetId(), 50);\n    }\n    peerLogic->SendMessages(&dummyNode2, interruptDummy);\n    BOOST_CHECK(connman->IsBanned(addr2));\n\n    bool dummy;\n    peerLogic->FinalizeNode(dummyNode1.GetId(), dummy);\n    peerLogic->FinalizeNode(dummyNode2.GetId(), dummy);\n}\n\nBOOST_AUTO_TEST_CASE(DoS_banscore)\n{\n    std::atomic<bool> interruptDummy(false);\n\n    connman->ClearBanned();\n    gArgs.ForceSetArg(\"-banscore\", \"111\"); // because 11 is my favorite number\n    CAddress addr1(ip(0xa0b0c001), NODE_NONE);\n    CNode dummyNode1(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr1, 3, 1, CAddress(), \"\", true);\n    dummyNode1.SetSendVersion(PROTOCOL_VERSION);\n    peerLogic->InitializeNode(&dummyNode1);\n    dummyNode1.nVersion = 1;\n    dummyNode1.fSuccessfullyConnected = true;\n    {\n        LOCK(cs_main);\n        Misbehaving(dummyNode1.GetId(), 100);\n    }\n    LOCK(dummyNode1.cs_sendProcessing);\n    peerLogic->SendMessages(&dummyNode1, interruptDummy);\n    BOOST_CHECK(!connman->IsBanned(addr1));\n    {\n        LOCK(cs_main);\n        Misbehaving(dummyNode1.GetId(), 10);\n    }\n    peerLogic->SendMessages(&dummyNode1, interruptDummy);\n    BOOST_CHECK(!connman->IsBanned(addr1));\n    {\n        LOCK(cs_main);\n        Misbehaving(dummyNode1.GetId(), 1);\n    }\n    peerLogic->SendMessages(&dummyNode1, interruptDummy);\n    BOOST_CHECK(connman->IsBanned(addr1));\n    gArgs.ForceSetArg(\"-banscore\", std::to_string(DEFAULT_BANSCORE_THRESHOLD));\n\n    bool dummy;\n    peerLogic->FinalizeNode(dummyNode1.GetId(), dummy);\n}\n\nBOOST_AUTO_TEST_CASE(DoS_bantime)\n{\n    std::atomic<bool> interruptDummy(false);\n\n    connman->ClearBanned();\n    int64_t nStartTime = GetTime();\n    SetMockTime(nStartTime); // Overrides future calls to GetTime()\n\n    CAddress addr(ip(0xa0b0c001), NODE_NONE);\n    CNode dummyNode(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr, 4, 4, CAddress(), \"\", true);\n    dummyNode.SetSendVersion(PROTOCOL_VERSION);\n    peerLogic->InitializeNode(&dummyNode);\n    dummyNode.nVersion = 1;\n    dummyNode.fSuccessfullyConnected = true;\n\n    {\n        LOCK(cs_main);\n        Misbehaving(dummyNode.GetId(), 100);\n    }\n    LOCK(dummyNode.cs_sendProcessing);\n    peerLogic->SendMessages(&dummyNode, interruptDummy);\n    BOOST_CHECK(connman->IsBanned(addr));\n\n    SetMockTime(nStartTime+60*60);\n    BOOST_CHECK(connman->IsBanned(addr));\n\n    SetMockTime(nStartTime+60*60*24+1);\n    BOOST_CHECK(!connman->IsBanned(addr));\n\n    bool dummy;\n    peerLogic->FinalizeNode(dummyNode.GetId(), dummy);\n}\n\nCTransactionRef RandomOrphan()\n{\n    std::map<uint256, COrphanTx>::iterator it;\n    LOCK(cs_main);\n    it = mapOrphanTransactions.lower_bound(InsecureRand256());\n    if (it == mapOrphanTransactions.end())\n        it = mapOrphanTransactions.begin();\n    return it->second.tx;\n}\n\nBOOST_AUTO_TEST_CASE(DoS_mapOrphans)\n{\n    CKey key;\n    key.MakeNewKey(true);\n    CBasicKeyStore keystore;\n    keystore.AddKey(key);\n\n    // 50 orphan transactions:\n    for (int i = 0; i < 50; i++)\n    {\n        CMutableTransaction tx;\n        tx.vin.resize(1);\n        tx.vin[0].prevout.n = 0;\n        tx.vin[0].prevout.hash = InsecureRand256();\n        tx.vin[0].scriptSig << OP_1;\n        tx.vout.resize(1);\n        tx.vout[0].nValue = 1*CENT;\n        tx.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID());\n\n        AddOrphanTx(MakeTransactionRef(tx), i);\n    }\n\n    // ... and 50 that depend on other orphans:\n    for (int i = 0; i < 50; i++)\n    {\n        CTransactionRef txPrev = RandomOrphan();\n\n        CMutableTransaction tx;\n        tx.vin.resize(1);\n        tx.vin[0].prevout.n = 0;\n        tx.vin[0].prevout.hash = txPrev->GetHash();\n        tx.vout.resize(1);\n        tx.vout[0].nValue = 1*CENT;\n        tx.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID());\n        SignSignature(keystore, *txPrev, tx, 0, SIGHASH_ALL);\n\n        AddOrphanTx(MakeTransactionRef(tx), i);\n    }\n\n    // This really-big orphan should be ignored:\n    for (int i = 0; i < 10; i++)\n    {\n        CTransactionRef txPrev = RandomOrphan();\n\n        CMutableTransaction tx;\n        tx.vout.resize(1);\n        tx.vout[0].nValue = 1*CENT;\n        tx.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID());\n        tx.vin.resize(2777);\n        for (unsigned int j = 0; j < tx.vin.size(); j++)\n        {\n            tx.vin[j].prevout.n = j;\n            tx.vin[j].prevout.hash = txPrev->GetHash();\n        }\n        SignSignature(keystore, *txPrev, tx, 0, SIGHASH_ALL);\n        // Re-use same signature for other inputs\n        // (they don't have to be valid for this test)\n        for (unsigned int j = 1; j < tx.vin.size(); j++)\n            tx.vin[j].scriptSig = tx.vin[0].scriptSig;\n\n        BOOST_CHECK(!AddOrphanTx(MakeTransactionRef(tx), i));\n    }\n\n    LOCK(cs_main);\n    // Test EraseOrphansFor:\n    for (NodeId i = 0; i < 3; i++)\n    {\n        size_t sizeBefore = mapOrphanTransactions.size();\n        EraseOrphansFor(i);\n        BOOST_CHECK(mapOrphanTransactions.size() < sizeBefore);\n    }\n\n    // Test LimitOrphanTxSize() function:\n    LimitOrphanTxSize(40);\n    BOOST_CHECK(mapOrphanTransactions.size() <= 40);\n    LimitOrphanTxSize(10);\n    BOOST_CHECK(mapOrphanTransactions.size() <= 10);\n    LimitOrphanTxSize(0);\n    BOOST_CHECK(mapOrphanTransactions.empty());\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/README.md",
    "content": "### Compiling/running unit tests\n\nUnit tests will be automatically compiled if dependencies were met in `./configure`\nand tests weren't explicitly disabled.\n\nAfter configuring, they can be run with `make check`.\n\nTo run the bitcoind tests manually, launch `src/test/test_bitcoin`. To recompile\nafter a test file was modified, run `make` and then run the test again. If you\nmodify a non-test file, use `make -C src/test` to recompile only what's needed\nto run the bitcoind tests.\n\nTo add more bitcoind tests, add `BOOST_AUTO_TEST_CASE` functions to the existing\n.cpp files in the `test/` directory or add new .cpp files that\nimplement new BOOST_AUTO_TEST_SUITE sections.\n\nTo run the bitcoin-qt tests manually, launch `src/qt/test/test_bitcoin-qt`\n\nTo add more bitcoin-qt tests, add them to the `src/qt/test/` directory and\nthe `src/qt/test/test_main.cpp` file.\n\n### Running individual tests\n\ntest_bitcoin has some built-in command-line arguments; for\nexample, to run just the getarg_tests verbosely:\n\n    test_bitcoin --log_level=all --run_test=getarg_tests\n\n... or to run just the doubledash test:\n\n    test_bitcoin --run_test=getarg_tests/doubledash\n\nRun `test_bitcoin --help` for the full list.\n\n### Note on adding test cases\n\nThe sources in this directory are unit test cases.  Boost includes a\nunit testing framework, and since bitcoin already uses boost, it makes\nsense to simply use this framework rather than require developers to\nconfigure some other framework (we want as few impediments to creating\nunit tests as possible).\n\nThe build system is setup to compile an executable called `test_bitcoin`\nthat runs all of the unit tests.  The main source file is called\ntest_bitcoin.cpp. To add a new unit test file to our test suite you need \nto add the file to `src/Makefile.test.include`. The pattern is to create \none test file for each class or source file for which you want to create \nunit tests.  The file naming convention is `<source_filename>_tests.cpp` \nand such files should wrap their tests in a test suite \ncalled `<source_filename>_tests`. For an example of this pattern, \nexamine `uint256_tests.cpp`.\n\nFor further reading, I found the following website to be helpful in\nexplaining how the boost unit test framework works:\n[http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/](http://archive.is/dRBGf).\n"
  },
  {
    "path": "src/test/addrman_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#include <addrman.h>\n#include <test/test_bitcoin.h>\n#include <string>\n#include <boost/test/unit_test.hpp>\n\n#include <hash.h>\n#include <netbase.h>\n#include <random.h>\n\nclass CAddrManTest : public CAddrMan\n{\n    uint64_t state;\n\npublic:\n    explicit CAddrManTest(bool makeDeterministic = true)\n    {\n        state = 1;\n\n        if (makeDeterministic) {\n            //  Set addrman addr placement to be deterministic.\n            MakeDeterministic();\n        }\n    }\n\n    //! Ensure that bucket placement is always the same for testing purposes.\n    void MakeDeterministic()\n    {\n        nKey.SetNull();\n        insecure_rand = FastRandomContext(true);\n    }\n\n    int RandomInt(int nMax) override\n    {\n        state = (CHashWriter(SER_GETHASH, 0) << state).GetHash().GetCheapHash();\n        return (unsigned int)(state % nMax);\n    }\n\n    CAddrInfo* Find(const CNetAddr& addr, int* pnId = nullptr)\n    {\n        return CAddrMan::Find(addr, pnId);\n    }\n\n    CAddrInfo* Create(const CAddress& addr, const CNetAddr& addrSource, int* pnId = nullptr)\n    {\n        return CAddrMan::Create(addr, addrSource, pnId);\n    }\n\n    void Delete(int nId)\n    {\n        CAddrMan::Delete(nId);\n    }\n};\n\nstatic CNetAddr ResolveIP(const char* ip)\n{\n    CNetAddr addr;\n    BOOST_CHECK_MESSAGE(LookupHost(ip, addr, false), strprintf(\"failed to resolve: %s\", ip));\n    return addr;\n}\n\nstatic CNetAddr ResolveIP(std::string ip)\n{\n    return ResolveIP(ip.c_str());\n}\n\nstatic CService ResolveService(const char* ip, int port = 0)\n{\n    CService serv;\n    BOOST_CHECK_MESSAGE(Lookup(ip, serv, port, false), strprintf(\"failed to resolve: %s:%i\", ip, port));\n    return serv;\n}\n\nstatic CService ResolveService(std::string ip, int port = 0)\n{\n    return ResolveService(ip.c_str(), port);\n}\n\nBOOST_FIXTURE_TEST_SUITE(addrman_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(addrman_simple)\n{\n    CAddrManTest addrman;\n\n    CNetAddr source = ResolveIP(\"252.2.2.2\");\n\n    // Test: Does Addrman respond correctly when empty.\n    BOOST_CHECK_EQUAL(addrman.size(), 0);\n    CAddrInfo addr_null = addrman.Select();\n    BOOST_CHECK_EQUAL(addr_null.ToString(), \"[::]:0\");\n\n    // Test: Does Addrman::Add work as expected.\n    CService addr1 = ResolveService(\"250.1.1.1\", 34230);\n    BOOST_CHECK(addrman.Add(CAddress(addr1, NODE_NONE), source));\n    BOOST_CHECK_EQUAL(addrman.size(), 1);\n    CAddrInfo addr_ret1 = addrman.Select();\n    BOOST_CHECK_EQUAL(addr_ret1.ToString(), \"250.1.1.1:34230\");\n\n    // Test: Does IP address deduplication work correctly.\n    //  Expected dup IP should not be added.\n    CService addr1_dup = ResolveService(\"250.1.1.1\", 34230);\n    BOOST_CHECK(!addrman.Add(CAddress(addr1_dup, NODE_NONE), source));\n    BOOST_CHECK_EQUAL(addrman.size(), 1);\n\n\n    // Test: New table has one addr and we add a diff addr we should\n    //  have at least one addr.\n    // Note that addrman's size cannot be tested reliably after insertion, as\n    // hash collisions may occur. But we can always be sure of at least one\n    // success.\n\n    CService addr2 = ResolveService(\"250.1.1.2\", 34230);\n    BOOST_CHECK(addrman.Add(CAddress(addr2, NODE_NONE), source));\n    BOOST_CHECK(addrman.size() >= 1);\n\n    // Test: AddrMan::Clear() should empty the new table.\n    addrman.Clear();\n    BOOST_CHECK_EQUAL(addrman.size(), 0);\n    CAddrInfo addr_null2 = addrman.Select();\n    BOOST_CHECK_EQUAL(addr_null2.ToString(), \"[::]:0\");\n\n    // Test: AddrMan::Add multiple addresses works as expected\n    std::vector<CAddress> vAddr;\n    vAddr.push_back(CAddress(ResolveService(\"250.1.1.3\", 34230), NODE_NONE));\n    vAddr.push_back(CAddress(ResolveService(\"250.1.1.4\", 34230), NODE_NONE));\n    BOOST_CHECK(addrman.Add(vAddr, source));\n    BOOST_CHECK(addrman.size() >= 1);\n}\n\nBOOST_AUTO_TEST_CASE(addrman_ports)\n{\n    CAddrManTest addrman;\n\n    CNetAddr source = ResolveIP(\"252.2.2.2\");\n\n    BOOST_CHECK_EQUAL(addrman.size(), 0);\n\n    // Test 7; Addr with same IP but diff port does not replace existing addr.\n    CService addr1 = ResolveService(\"250.1.1.1\", 34230);\n    addrman.Add(CAddress(addr1, NODE_NONE), source);\n    BOOST_CHECK_EQUAL(addrman.size(), 1);\n\n    CService addr1_port = ResolveService(\"250.1.1.1\", 8334);\n    addrman.Add(CAddress(addr1_port, NODE_NONE), source);\n    BOOST_CHECK_EQUAL(addrman.size(), 1);\n    CAddrInfo addr_ret2 = addrman.Select();\n    BOOST_CHECK_EQUAL(addr_ret2.ToString(), \"250.1.1.1:34230\");\n\n    // Test: Add same IP but diff port to tried table, it doesn't get added.\n    //  Perhaps this is not ideal behavior but it is the current behavior.\n    addrman.Good(CAddress(addr1_port, NODE_NONE));\n    BOOST_CHECK_EQUAL(addrman.size(), 1);\n    bool newOnly = true;\n    CAddrInfo addr_ret3 = addrman.Select(newOnly);\n    BOOST_CHECK_EQUAL(addr_ret3.ToString(), \"250.1.1.1:34230\");\n}\n\n\nBOOST_AUTO_TEST_CASE(addrman_select)\n{\n    CAddrManTest addrman;\n\n    CNetAddr source = ResolveIP(\"252.2.2.2\");\n\n    // Test: Select from new with 1 addr in new.\n    CService addr1 = ResolveService(\"250.1.1.1\", 34230);\n    addrman.Add(CAddress(addr1, NODE_NONE), source);\n    BOOST_CHECK_EQUAL(addrman.size(), 1);\n\n    bool newOnly = true;\n    CAddrInfo addr_ret1 = addrman.Select(newOnly);\n    BOOST_CHECK_EQUAL(addr_ret1.ToString(), \"250.1.1.1:34230\");\n\n    // Test: move addr to tried, select from new expected nothing returned.\n    addrman.Good(CAddress(addr1, NODE_NONE));\n    BOOST_CHECK_EQUAL(addrman.size(), 1);\n    CAddrInfo addr_ret2 = addrman.Select(newOnly);\n    BOOST_CHECK_EQUAL(addr_ret2.ToString(), \"[::]:0\");\n\n    CAddrInfo addr_ret3 = addrman.Select();\n    BOOST_CHECK_EQUAL(addr_ret3.ToString(), \"250.1.1.1:34230\");\n\n    BOOST_CHECK_EQUAL(addrman.size(), 1);\n\n\n    // Add three addresses to new table.\n    CService addr2 = ResolveService(\"250.3.1.1\", 34230);\n    CService addr3 = ResolveService(\"250.3.2.2\", 9999);\n    CService addr4 = ResolveService(\"250.3.3.3\", 9999);\n\n    addrman.Add(CAddress(addr2, NODE_NONE), ResolveService(\"250.3.1.1\", 34230));\n    addrman.Add(CAddress(addr3, NODE_NONE), ResolveService(\"250.3.1.1\", 34230));\n    addrman.Add(CAddress(addr4, NODE_NONE), ResolveService(\"250.4.1.1\", 34230));\n\n    // Add three addresses to tried table.\n    CService addr5 = ResolveService(\"250.4.4.4\", 34230);\n    CService addr6 = ResolveService(\"250.4.5.5\", 7777);\n    CService addr7 = ResolveService(\"250.4.6.6\", 34230);\n\n    addrman.Add(CAddress(addr5, NODE_NONE), ResolveService(\"250.3.1.1\", 34230));\n    addrman.Good(CAddress(addr5, NODE_NONE));\n    addrman.Add(CAddress(addr6, NODE_NONE), ResolveService(\"250.3.1.1\", 34230));\n    addrman.Good(CAddress(addr6, NODE_NONE));\n    addrman.Add(CAddress(addr7, NODE_NONE), ResolveService(\"250.1.1.3\", 34230));\n    addrman.Good(CAddress(addr7, NODE_NONE));\n\n    // Test: 6 addrs + 1 addr from last test = 7.\n    BOOST_CHECK_EQUAL(addrman.size(), 7);\n\n    // Test: Select pulls from new and tried regardless of port number.\n    std::set<uint16_t> ports;\n    for (int i = 0; i < 20; ++i) {\n        ports.insert(addrman.Select().GetPort());\n    }\n    BOOST_CHECK_EQUAL(ports.size(), 3);\n}\n\nBOOST_AUTO_TEST_CASE(addrman_new_collisions)\n{\n    CAddrManTest addrman;\n\n    CNetAddr source = ResolveIP(\"252.2.2.2\");\n\n    BOOST_CHECK_EQUAL(addrman.size(), 0);\n\n    for (unsigned int i = 1; i < 18; i++) {\n        CService addr = ResolveService(\"250.1.1.\" + boost::to_string(i));\n        addrman.Add(CAddress(addr, NODE_NONE), source);\n\n        //Test: No collision in new table yet.\n        BOOST_CHECK_EQUAL(addrman.size(), i);\n    }\n\n    //Test: new table collision!\n    CService addr1 = ResolveService(\"250.1.1.18\");\n    addrman.Add(CAddress(addr1, NODE_NONE), source);\n    BOOST_CHECK_EQUAL(addrman.size(), 17);\n\n    CService addr2 = ResolveService(\"250.1.1.19\");\n    addrman.Add(CAddress(addr2, NODE_NONE), source);\n    BOOST_CHECK_EQUAL(addrman.size(), 18);\n}\n\nBOOST_AUTO_TEST_CASE(addrman_tried_collisions)\n{\n    CAddrManTest addrman;\n\n    CNetAddr source = ResolveIP(\"252.2.2.2\");\n\n    BOOST_CHECK_EQUAL(addrman.size(), 0);\n\n    for (unsigned int i = 1; i < 80; i++) {\n        CService addr = ResolveService(\"250.1.1.\" + boost::to_string(i));\n        addrman.Add(CAddress(addr, NODE_NONE), source);\n        addrman.Good(CAddress(addr, NODE_NONE));\n\n        //Test: No collision in tried table yet.\n        BOOST_CHECK_EQUAL(addrman.size(), i);\n    }\n\n    //Test: tried table collision!\n    CService addr1 = ResolveService(\"250.1.1.80\");\n    addrman.Add(CAddress(addr1, NODE_NONE), source);\n    BOOST_CHECK_EQUAL(addrman.size(), 79);\n\n    CService addr2 = ResolveService(\"250.1.1.81\");\n    addrman.Add(CAddress(addr2, NODE_NONE), source);\n    BOOST_CHECK_EQUAL(addrman.size(), 80);\n}\n\nBOOST_AUTO_TEST_CASE(addrman_find)\n{\n    CAddrManTest addrman;\n\n    BOOST_CHECK_EQUAL(addrman.size(), 0);\n\n    CAddress addr1 = CAddress(ResolveService(\"250.1.2.1\", 34230), NODE_NONE);\n    CAddress addr2 = CAddress(ResolveService(\"250.1.2.1\", 9999), NODE_NONE);\n    CAddress addr3 = CAddress(ResolveService(\"251.255.2.1\", 34230), NODE_NONE);\n\n    CNetAddr source1 = ResolveIP(\"250.1.2.1\");\n    CNetAddr source2 = ResolveIP(\"250.1.2.2\");\n\n    addrman.Add(addr1, source1);\n    addrman.Add(addr2, source2);\n    addrman.Add(addr3, source1);\n\n    // Test: ensure Find returns an IP matching what we searched on.\n    CAddrInfo* info1 = addrman.Find(addr1);\n    BOOST_REQUIRE(info1);\n    BOOST_CHECK_EQUAL(info1->ToString(), \"250.1.2.1:34230\");\n\n    // Test 18; Find does not discriminate by port number.\n    CAddrInfo* info2 = addrman.Find(addr2);\n    BOOST_REQUIRE(info2);\n    BOOST_CHECK_EQUAL(info2->ToString(), info1->ToString());\n\n    // Test: Find returns another IP matching what we searched on.\n    CAddrInfo* info3 = addrman.Find(addr3);\n    BOOST_REQUIRE(info3);\n    BOOST_CHECK_EQUAL(info3->ToString(), \"251.255.2.1:34230\");\n}\n\nBOOST_AUTO_TEST_CASE(addrman_create)\n{\n    CAddrManTest addrman;\n\n    BOOST_CHECK_EQUAL(addrman.size(), 0);\n\n    CAddress addr1 = CAddress(ResolveService(\"250.1.2.1\", 34230), NODE_NONE);\n    CNetAddr source1 = ResolveIP(\"250.1.2.1\");\n\n    int nId;\n    CAddrInfo* pinfo = addrman.Create(addr1, source1, &nId);\n\n    // Test: The result should be the same as the input addr.\n    BOOST_CHECK_EQUAL(pinfo->ToString(), \"250.1.2.1:34230\");\n\n    CAddrInfo* info2 = addrman.Find(addr1);\n    BOOST_CHECK_EQUAL(info2->ToString(), \"250.1.2.1:34230\");\n}\n\n\nBOOST_AUTO_TEST_CASE(addrman_delete)\n{\n    CAddrManTest addrman;\n\n    BOOST_CHECK_EQUAL(addrman.size(), 0);\n\n    CAddress addr1 = CAddress(ResolveService(\"250.1.2.1\", 34230), NODE_NONE);\n    CNetAddr source1 = ResolveIP(\"250.1.2.1\");\n\n    int nId;\n    addrman.Create(addr1, source1, &nId);\n\n    // Test: Delete should actually delete the addr.\n    BOOST_CHECK_EQUAL(addrman.size(), 1);\n    addrman.Delete(nId);\n    BOOST_CHECK_EQUAL(addrman.size(), 0);\n    CAddrInfo* info2 = addrman.Find(addr1);\n    BOOST_CHECK(info2 == nullptr);\n}\n\nBOOST_AUTO_TEST_CASE(addrman_getaddr)\n{\n    CAddrManTest addrman;\n\n    // Test: Sanity check, GetAddr should never return anything if addrman\n    //  is empty.\n    BOOST_CHECK_EQUAL(addrman.size(), 0);\n    std::vector<CAddress> vAddr1 = addrman.GetAddr();\n    BOOST_CHECK_EQUAL(vAddr1.size(), 0);\n\n    CAddress addr1 = CAddress(ResolveService(\"250.250.2.1\", 34230), NODE_NONE);\n    addr1.nTime = GetAdjustedTime(); // Set time so isTerrible = false\n    CAddress addr2 = CAddress(ResolveService(\"250.251.2.2\", 9999), NODE_NONE);\n    addr2.nTime = GetAdjustedTime();\n    CAddress addr3 = CAddress(ResolveService(\"251.252.2.3\", 34230), NODE_NONE);\n    addr3.nTime = GetAdjustedTime();\n    CAddress addr4 = CAddress(ResolveService(\"252.253.3.4\", 34230), NODE_NONE);\n    addr4.nTime = GetAdjustedTime();\n    CAddress addr5 = CAddress(ResolveService(\"252.254.4.5\", 34230), NODE_NONE);\n    addr5.nTime = GetAdjustedTime();\n    CNetAddr source1 = ResolveIP(\"250.1.2.1\");\n    CNetAddr source2 = ResolveIP(\"250.2.3.3\");\n\n    // Test: Ensure GetAddr works with new addresses.\n    addrman.Add(addr1, source1);\n    addrman.Add(addr2, source2);\n    addrman.Add(addr3, source1);\n    addrman.Add(addr4, source2);\n    addrman.Add(addr5, source1);\n\n    // GetAddr returns 23% of addresses, 23% of 5 is 1 rounded down.\n    BOOST_CHECK_EQUAL(addrman.GetAddr().size(), 1);\n\n    // Test: Ensure GetAddr works with new and tried addresses.\n    addrman.Good(CAddress(addr1, NODE_NONE));\n    addrman.Good(CAddress(addr2, NODE_NONE));\n    BOOST_CHECK_EQUAL(addrman.GetAddr().size(), 1);\n\n    // Test: Ensure GetAddr still returns 23% when addrman has many addrs.\n    for (unsigned int i = 1; i < (8 * 256); i++) {\n        int octet1 = i % 256;\n        int octet2 = i >> 8 % 256;\n        std::string strAddr = boost::to_string(octet1) + \".\" + boost::to_string(octet2) + \".1.23\";\n        CAddress addr = CAddress(ResolveService(strAddr), NODE_NONE);\n\n        // Ensure that for all addrs in addrman, isTerrible == false.\n        addr.nTime = GetAdjustedTime();\n        addrman.Add(addr, ResolveIP(strAddr));\n        if (i % 8 == 0)\n            addrman.Good(addr);\n    }\n    std::vector<CAddress> vAddr = addrman.GetAddr();\n\n    size_t percent23 = (addrman.size() * 23) / 100;\n    BOOST_CHECK_EQUAL(vAddr.size(), percent23);\n    BOOST_CHECK_EQUAL(vAddr.size(), 461);\n    // (Addrman.size() < number of addresses added) due to address collisions.\n    BOOST_CHECK_EQUAL(addrman.size(), 2006);\n}\n\n\nBOOST_AUTO_TEST_CASE(caddrinfo_get_tried_bucket)\n{\n    CAddrManTest addrman;\n\n    CAddress addr1 = CAddress(ResolveService(\"250.1.1.1\", 34230), NODE_NONE);\n    CAddress addr2 = CAddress(ResolveService(\"250.1.1.1\", 9999), NODE_NONE);\n\n    CNetAddr source1 = ResolveIP(\"250.1.1.1\");\n\n\n    CAddrInfo info1 = CAddrInfo(addr1, source1);\n\n    uint256 nKey1 = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();\n    uint256 nKey2 = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();\n\n\n    BOOST_CHECK_EQUAL(info1.GetTriedBucket(nKey1), 14); // FIXME.SUGAR // SURE?\n\n    // FIXME.SUGAR\n    // BEGIN - DEBUG\n    /*\n    printf(\"addr1 = %s\\n\", addr1.ToString().c_str());\n    printf(\"source1 = %s\\n\", source1.ToString().c_str());\n    printf(\"CAddrInfo(addr1, source1) = %s\\n\", CAddrInfo(addr1, source1).ToString().c_str());\n    printf(\"info1 = %s\\n\", info1.ToString().c_str());\n    printf(\"nKey1 = %s\\n\", nKey1.ToString().c_str());\n    printf(\"info1.GetTriedBucket(nKey1) = %d\\n\", info1.GetTriedBucket(nKey1));\n    BOOST_CHECK_EQUAL(CAddrInfo(addr1, source1).GetTriedBucket( (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash() ), 14); // DOUBLE CHECK\n    */\n    // END - DEBUG\n\n    // BEGIN - ADDITIONAL CHECK: BTC\n    CAddress addr1_BTC = CAddress(ResolveService(\"250.1.1.1\", 8333), NODE_NONE); // BTC original\n    CAddress addr2_BTC = CAddress(ResolveService(\"250.1.1.1\", 9999), NODE_NONE);\n    CNetAddr source1_BTC = ResolveIP(\"250.1.1.1\");\n    CAddrInfo info1_BTC = CAddrInfo(addr1_BTC, source1_BTC);\n    CAddrInfo info2_BTC = CAddrInfo(addr2_BTC, source1_BTC);\n    uint256 nKey1_BTC = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();\n    uint256 nKey2_BTC = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();\n\n    BOOST_CHECK_EQUAL(info1_BTC.GetTriedBucket(nKey1_BTC), 40); // Additional Check2\n    BOOST_CHECK_EQUAL(info2_BTC.GetTriedBucket(nKey1_BTC), 113); // Additional Check2 // FIXME.SUGAR // SURE? // It should be 40?\n    BOOST_CHECK_EQUAL(info1_BTC.GetTriedBucket(nKey2_BTC), 191); // Additional Check2\n    BOOST_CHECK_EQUAL(info2_BTC.GetTriedBucket(nKey2_BTC), 191); // Additional Check2\n    // END - ADDITIONAL CHECK: BTC\n\n    // Test: Make sure key actually randomizes bucket placement. A fail on\n    //  this test could be a security issue.\n    BOOST_CHECK(info1.GetTriedBucket(nKey1) != info1.GetTriedBucket(nKey2));\n\n    // Test: Two addresses with same IP but different ports can map to\n    //  different buckets because they have different keys.\n    CAddrInfo info2 = CAddrInfo(addr2, source1);\n\n    BOOST_CHECK(info1.GetKey() != info2.GetKey());\n    BOOST_CHECK(info1.GetTriedBucket(nKey1) != info2.GetTriedBucket(nKey1));\n\n    std::set<int> buckets;\n    for (int i = 0; i < 255; i++) {\n        CAddrInfo infoi = CAddrInfo(\n            CAddress(ResolveService(\"250.1.1.\" + boost::to_string(i)), NODE_NONE),\n            ResolveIP(\"250.1.1.\" + boost::to_string(i)));\n        int bucket = infoi.GetTriedBucket(nKey1);\n        buckets.insert(bucket);\n    }\n    // Test: IP addresses in the same group (\\16 prefix for IPv4) should\n    //  never get more than 8 buckets\n    BOOST_CHECK_EQUAL(buckets.size(), 8);\n\n    buckets.clear();\n    for (int j = 0; j < 255; j++) {\n        CAddrInfo infoj = CAddrInfo(\n            CAddress(ResolveService(\"250.\" + boost::to_string(j) + \".1.1\"), NODE_NONE),\n            ResolveIP(\"250.\" + boost::to_string(j) + \".1.1\"));\n        int bucket = infoj.GetTriedBucket(nKey1);\n        buckets.insert(bucket);\n    }\n    // Test: IP addresses in the different groups should map to more than\n    //  8 buckets.\n    BOOST_CHECK_EQUAL(buckets.size(), 160);\n}\n\nBOOST_AUTO_TEST_CASE(caddrinfo_get_new_bucket)\n{\n    CAddrManTest addrman;\n\n    CAddress addr1 = CAddress(ResolveService(\"250.1.2.1\", 34230), NODE_NONE);\n    CAddress addr2 = CAddress(ResolveService(\"250.1.2.1\", 9999), NODE_NONE);\n\n    CNetAddr source1 = ResolveIP(\"250.1.2.1\");\n\n    CAddrInfo info1 = CAddrInfo(addr1, source1);\n\n    uint256 nKey1 = (uint256)(CHashWriter(SER_GETHASH, 0) << 1).GetHash();\n    uint256 nKey2 = (uint256)(CHashWriter(SER_GETHASH, 0) << 2).GetHash();\n\n    // Test: Make sure the buckets are what we expect\n    BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1), 786);\n    BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1, source1), 786);\n\n    // Test: Make sure key actually randomizes bucket placement. A fail on\n    //  this test could be a security issue.\n    BOOST_CHECK(info1.GetNewBucket(nKey1) != info1.GetNewBucket(nKey2));\n\n    // Test: Ports should not effect bucket placement in the addr\n    CAddrInfo info2 = CAddrInfo(addr2, source1);\n    BOOST_CHECK(info1.GetKey() != info2.GetKey());\n    BOOST_CHECK_EQUAL(info1.GetNewBucket(nKey1), info2.GetNewBucket(nKey1));\n\n    std::set<int> buckets;\n    for (int i = 0; i < 255; i++) {\n        CAddrInfo infoi = CAddrInfo(\n            CAddress(ResolveService(\"250.1.1.\" + boost::to_string(i)), NODE_NONE),\n            ResolveIP(\"250.1.1.\" + boost::to_string(i)));\n        int bucket = infoi.GetNewBucket(nKey1);\n        buckets.insert(bucket);\n    }\n    // Test: IP addresses in the same group (\\16 prefix for IPv4) should\n    //  always map to the same bucket.\n    BOOST_CHECK_EQUAL(buckets.size(), 1);\n\n    buckets.clear();\n    for (int j = 0; j < 4 * 255; j++) {\n        CAddrInfo infoj = CAddrInfo(CAddress(\n                                        ResolveService(\n                                            boost::to_string(250 + (j / 255)) + \".\" + boost::to_string(j % 256) + \".1.1\"), NODE_NONE),\n            ResolveIP(\"251.4.1.1\"));\n        int bucket = infoj.GetNewBucket(nKey1);\n        buckets.insert(bucket);\n    }\n    // Test: IP addresses in the same source groups should map to no more\n    //  than 64 buckets.\n    BOOST_CHECK(buckets.size() <= 64);\n\n    buckets.clear();\n    for (int p = 0; p < 255; p++) {\n        CAddrInfo infoj = CAddrInfo(\n            CAddress(ResolveService(\"250.1.1.1\"), NODE_NONE),\n            ResolveIP(\"250.\" + boost::to_string(p) + \".1.1\"));\n        int bucket = infoj.GetNewBucket(nKey1);\n        buckets.insert(bucket);\n    }\n    // Test: IP addresses in the different source groups should map to more\n    //  than 64 buckets.\n    BOOST_CHECK(buckets.size() > 64);\n}\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/allocator_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <util.h>\n\n#include <support/allocators/secure.h>\n#include <test/test_bitcoin.h>\n\n#include <memory>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(allocator_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(arena_tests)\n{\n    // Fake memory base address for testing\n    // without actually using memory.\n    void *synth_base = reinterpret_cast<void*>(0x08000000);\n    const size_t synth_size = 1024*1024;\n    Arena b(synth_base, synth_size, 16);\n    void *chunk = b.alloc(1000);\n#ifdef ARENA_DEBUG\n    b.walk();\n#endif\n    BOOST_CHECK(chunk != nullptr);\n    BOOST_CHECK(b.stats().used == 1008); // Aligned to 16\n    BOOST_CHECK(b.stats().total == synth_size); // Nothing has disappeared?\n    b.free(chunk);\n#ifdef ARENA_DEBUG\n    b.walk();\n#endif\n    BOOST_CHECK(b.stats().used == 0);\n    BOOST_CHECK(b.stats().free == synth_size);\n    try { // Test exception on double-free\n        b.free(chunk);\n        BOOST_CHECK(0);\n    } catch(std::runtime_error &)\n    {\n    }\n\n    void *a0 = b.alloc(128);\n    void *a1 = b.alloc(256);\n    void *a2 = b.alloc(512);\n    BOOST_CHECK(b.stats().used == 896);\n    BOOST_CHECK(b.stats().total == synth_size);\n#ifdef ARENA_DEBUG\n    b.walk();\n#endif\n    b.free(a0);\n#ifdef ARENA_DEBUG\n    b.walk();\n#endif\n    BOOST_CHECK(b.stats().used == 768);\n    b.free(a1);\n    BOOST_CHECK(b.stats().used == 512);\n    void *a3 = b.alloc(128);\n#ifdef ARENA_DEBUG\n    b.walk();\n#endif\n    BOOST_CHECK(b.stats().used == 640);\n    b.free(a2);\n    BOOST_CHECK(b.stats().used == 128);\n    b.free(a3);\n    BOOST_CHECK(b.stats().used == 0);\n    BOOST_CHECK_EQUAL(b.stats().chunks_used, 0);\n    BOOST_CHECK(b.stats().total == synth_size);\n    BOOST_CHECK(b.stats().free == synth_size);\n    BOOST_CHECK_EQUAL(b.stats().chunks_free, 1);\n\n    std::vector<void*> addr;\n    BOOST_CHECK(b.alloc(0) == nullptr); // allocating 0 always returns nullptr\n#ifdef ARENA_DEBUG\n    b.walk();\n#endif\n    // Sweeping allocate all memory\n    for (int x=0; x<1024; ++x)\n        addr.push_back(b.alloc(1024));\n    BOOST_CHECK(b.stats().free == 0);\n    BOOST_CHECK(b.alloc(1024) == nullptr); // memory is full, this must return nullptr\n    BOOST_CHECK(b.alloc(0) == nullptr);\n    for (int x=0; x<1024; ++x)\n        b.free(addr[x]);\n    addr.clear();\n    BOOST_CHECK(b.stats().total == synth_size);\n    BOOST_CHECK(b.stats().free == synth_size);\n\n    // Now in the other direction...\n    for (int x=0; x<1024; ++x)\n        addr.push_back(b.alloc(1024));\n    for (int x=0; x<1024; ++x)\n        b.free(addr[1023-x]);\n    addr.clear();\n\n    // Now allocate in smaller unequal chunks, then deallocate haphazardly\n    // Not all the chunks will succeed allocating, but freeing nullptr is\n    // allowed so that is no problem.\n    for (int x=0; x<2048; ++x)\n        addr.push_back(b.alloc(x+1));\n    for (int x=0; x<2048; ++x)\n        b.free(addr[((x*23)%2048)^242]);\n    addr.clear();\n\n    // Go entirely wild: free and alloc interleaved,\n    // generate targets and sizes using pseudo-randomness.\n    for (int x=0; x<2048; ++x)\n        addr.push_back(0);\n    uint32_t s = 0x12345678;\n    for (int x=0; x<5000; ++x) {\n        int idx = s & (addr.size()-1);\n        if (s & 0x80000000) {\n            b.free(addr[idx]);\n            addr[idx] = 0;\n        } else if(!addr[idx]) {\n            addr[idx] = b.alloc((s >> 16) & 2047);\n        }\n        bool lsb = s & 1;\n        s >>= 1;\n        if (lsb)\n            s ^= 0xf00f00f0; // LFSR period 0xf7ffffe0\n    }\n    for (void *ptr: addr)\n        b.free(ptr);\n    addr.clear();\n\n    BOOST_CHECK(b.stats().total == synth_size);\n    BOOST_CHECK(b.stats().free == synth_size);\n}\n\n/** Mock LockedPageAllocator for testing */\nclass TestLockedPageAllocator: public LockedPageAllocator\n{\npublic:\n    TestLockedPageAllocator(int count_in, int lockedcount_in): count(count_in), lockedcount(lockedcount_in) {}\n    void* AllocateLocked(size_t len, bool *lockingSuccess) override\n    {\n        *lockingSuccess = false;\n        if (count > 0) {\n            --count;\n\n            if (lockedcount > 0) {\n                --lockedcount;\n                *lockingSuccess = true;\n            }\n\n            return reinterpret_cast<void*>(0x08000000 + (count<<24)); // Fake address, do not actually use this memory\n        }\n        return 0;\n    }\n    void FreeLocked(void* addr, size_t len) override\n    {\n    }\n    size_t GetLimit() override\n    {\n        return std::numeric_limits<size_t>::max();\n    }\nprivate:\n    int count;\n    int lockedcount;\n};\n\nBOOST_AUTO_TEST_CASE(lockedpool_tests_mock)\n{\n    // Test over three virtual arenas, of which one will succeed being locked\n    std::unique_ptr<LockedPageAllocator> x(new TestLockedPageAllocator(3, 1));\n    LockedPool pool(std::move(x));\n    BOOST_CHECK(pool.stats().total == 0);\n    BOOST_CHECK(pool.stats().locked == 0);\n\n    // Ensure unreasonable requests are refused without allocating anything\n    void *invalid_toosmall = pool.alloc(0);\n    BOOST_CHECK(invalid_toosmall == nullptr);\n    BOOST_CHECK(pool.stats().used == 0);\n    BOOST_CHECK(pool.stats().free == 0);\n    void *invalid_toobig = pool.alloc(LockedPool::ARENA_SIZE+1);\n    BOOST_CHECK(invalid_toobig == nullptr);\n    BOOST_CHECK(pool.stats().used == 0);\n    BOOST_CHECK(pool.stats().free == 0);\n\n    void *a0 = pool.alloc(LockedPool::ARENA_SIZE / 2);\n    BOOST_CHECK(a0);\n    BOOST_CHECK(pool.stats().locked == LockedPool::ARENA_SIZE);\n    void *a1 = pool.alloc(LockedPool::ARENA_SIZE / 2);\n    BOOST_CHECK(a1);\n    void *a2 = pool.alloc(LockedPool::ARENA_SIZE / 2);\n    BOOST_CHECK(a2);\n    void *a3 = pool.alloc(LockedPool::ARENA_SIZE / 2);\n    BOOST_CHECK(a3);\n    void *a4 = pool.alloc(LockedPool::ARENA_SIZE / 2);\n    BOOST_CHECK(a4);\n    void *a5 = pool.alloc(LockedPool::ARENA_SIZE / 2);\n    BOOST_CHECK(a5);\n    // We've passed a count of three arenas, so this allocation should fail\n    void *a6 = pool.alloc(16);\n    BOOST_CHECK(!a6);\n\n    pool.free(a0);\n    pool.free(a2);\n    pool.free(a4);\n    pool.free(a1);\n    pool.free(a3);\n    pool.free(a5);\n    BOOST_CHECK(pool.stats().total == 3*LockedPool::ARENA_SIZE);\n    BOOST_CHECK(pool.stats().locked == LockedPool::ARENA_SIZE);\n    BOOST_CHECK(pool.stats().used == 0);\n}\n\n// These tests used the live LockedPoolManager object, this is also used\n// by other tests so the conditions are somewhat less controllable and thus the\n// tests are somewhat more error-prone.\nBOOST_AUTO_TEST_CASE(lockedpool_tests_live)\n{\n    LockedPoolManager &pool = LockedPoolManager::Instance();\n    LockedPool::Stats initial = pool.stats();\n\n    void *a0 = pool.alloc(16);\n    BOOST_CHECK(a0);\n    // Test reading and writing the allocated memory\n    *((uint32_t*)a0) = 0x1234;\n    BOOST_CHECK(*((uint32_t*)a0) == 0x1234);\n\n    pool.free(a0);\n    try { // Test exception on double-free\n        pool.free(a0);\n        BOOST_CHECK(0);\n    } catch(std::runtime_error &)\n    {\n    }\n    // If more than one new arena was allocated for the above tests, something is wrong\n    BOOST_CHECK(pool.stats().total <= (initial.total + LockedPool::ARENA_SIZE));\n    // Usage must be back to where it started\n    BOOST_CHECK(pool.stats().used == initial.used);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/amount_tests.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <amount.h>\n#include <policy/feerate.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(amount_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(MoneyRangeTest)\n{\n    BOOST_CHECK_EQUAL(MoneyRange(CAmount(-1)), false);\n    BOOST_CHECK_EQUAL(MoneyRange(MAX_MONEY + CAmount(1)), false);\n    BOOST_CHECK_EQUAL(MoneyRange(CAmount(1)), true);\n}\n\nBOOST_AUTO_TEST_CASE(GetFeeTest)\n{\n    CFeeRate feeRate, altFeeRate;\n\n    feeRate = CFeeRate(0);\n    // Must always return 0\n    BOOST_CHECK_EQUAL(feeRate.GetFee(0), 0);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(1e5), 0);\n\n    feeRate = CFeeRate(1000);\n    // Must always just return the arg\n    BOOST_CHECK_EQUAL(feeRate.GetFee(0), 0);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(1), 1);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(121), 121);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(999), 999);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(1e3), 1e3);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(9e3), 9e3);\n\n    feeRate = CFeeRate(-1000);\n    // Must always just return -1 * arg\n    BOOST_CHECK_EQUAL(feeRate.GetFee(0), 0);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(1), -1);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(121), -121);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(999), -999);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(1e3), -1e3);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(9e3), -9e3);\n\n    feeRate = CFeeRate(123);\n    // Truncates the result, if not integer\n    BOOST_CHECK_EQUAL(feeRate.GetFee(0), 0);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(8), 1); // Special case: returns 1 instead of 0\n    BOOST_CHECK_EQUAL(feeRate.GetFee(9), 1);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(121), 14);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(122), 15);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(999), 122);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(1e3), 123);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(9e3), 1107);\n\n    feeRate = CFeeRate(-123);\n    // Truncates the result, if not integer\n    BOOST_CHECK_EQUAL(feeRate.GetFee(0), 0);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(8), -1); // Special case: returns -1 instead of 0\n    BOOST_CHECK_EQUAL(feeRate.GetFee(9), -1);\n\n    // check alternate constructor\n    feeRate = CFeeRate(1000);\n    altFeeRate = CFeeRate(feeRate);\n    BOOST_CHECK_EQUAL(feeRate.GetFee(100), altFeeRate.GetFee(100));\n\n    // Check full constructor\n    // default value\n    BOOST_CHECK(CFeeRate(CAmount(-1), 1000) == CFeeRate(-1));\n    BOOST_CHECK(CFeeRate(CAmount(0), 1000) == CFeeRate(0));\n    BOOST_CHECK(CFeeRate(CAmount(1), 1000) == CFeeRate(1));\n    // lost precision (can only resolve satoshis per kB)\n    BOOST_CHECK(CFeeRate(CAmount(1), 1001) == CFeeRate(0));\n    BOOST_CHECK(CFeeRate(CAmount(2), 1001) == CFeeRate(1));\n    // some more integer checks\n    BOOST_CHECK(CFeeRate(CAmount(26), 789) == CFeeRate(32));\n    BOOST_CHECK(CFeeRate(CAmount(27), 789) == CFeeRate(34));\n    // Maximum size in bytes, should not crash\n    CFeeRate(MAX_MONEY, std::numeric_limits<size_t>::max() >> 1).GetFeePerK();\n}\n\nBOOST_AUTO_TEST_CASE(BinaryOperatorTest)\n{\n    CFeeRate a, b;\n    a = CFeeRate(1);\n    b = CFeeRate(2);\n    BOOST_CHECK(a < b);\n    BOOST_CHECK(b > a);\n    BOOST_CHECK(a == a);\n    BOOST_CHECK(a <= b);\n    BOOST_CHECK(a <= a);\n    BOOST_CHECK(b >= a);\n    BOOST_CHECK(b >= b);\n    // a should be 0.00000002 BTC/kB now\n    a += a;\n    BOOST_CHECK(a == b);\n}\n\nBOOST_AUTO_TEST_CASE(ToStringTest)\n{\n    CFeeRate feeRate;\n    feeRate = CFeeRate(1);\n    BOOST_CHECK_EQUAL(feeRate.ToString(), \"0.00000001 SUGAR/kB\");\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/arith_uint256_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <boost/test/unit_test.hpp>\n#include <stdint.h>\n#include <sstream>\n#include <iomanip>\n#include <limits>\n#include <cmath>\n#include <uint256.h>\n#include <arith_uint256.h>\n#include <string>\n#include <version.h>\n#include <test/test_bitcoin.h>\n\nBOOST_FIXTURE_TEST_SUITE(arith_uint256_tests, BasicTestingSetup)\n\n/// Convert vector to arith_uint256, via uint256 blob\ninline arith_uint256 arith_uint256V(const std::vector<unsigned char>& vch)\n{\n    return UintToArith256(uint256(vch));\n}\n\nconst unsigned char R1Array[] =\n    \"\\x9c\\x52\\x4a\\xdb\\xcf\\x56\\x11\\x12\\x2b\\x29\\x12\\x5e\\x5d\\x35\\xd2\\xd2\"\n    \"\\x22\\x81\\xaa\\xb5\\x33\\xf0\\x08\\x32\\xd5\\x56\\xb1\\xf9\\xea\\xe5\\x1d\\x7d\";\nconst char R1ArrayHex[] = \"7D1DE5EAF9B156D53208F033B5AA8122D2d2355d5e12292b121156cfdb4a529c\";\nconst double R1Ldouble = 0.4887374590559308955; // R1L equals roughly R1Ldouble * 2^256\nconst arith_uint256 R1L = arith_uint256V(std::vector<unsigned char>(R1Array,R1Array+32));\nconst uint64_t R1LLow64 = 0x121156cfdb4a529cULL;\n\nconst unsigned char R2Array[] =\n    \"\\x70\\x32\\x1d\\x7c\\x47\\xa5\\x6b\\x40\\x26\\x7e\\x0a\\xc3\\xa6\\x9c\\xb6\\xbf\"\n    \"\\x13\\x30\\x47\\xa3\\x19\\x2d\\xda\\x71\\x49\\x13\\x72\\xf0\\xb4\\xca\\x81\\xd7\";\nconst arith_uint256 R2L = arith_uint256V(std::vector<unsigned char>(R2Array,R2Array+32));\n\nconst char R1LplusR2L[] = \"549FB09FEA236A1EA3E31D4D58F1B1369288D204211CA751527CFC175767850C\";\n\nconst unsigned char ZeroArray[] =\n    \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n    \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";\nconst arith_uint256 ZeroL = arith_uint256V(std::vector<unsigned char>(ZeroArray,ZeroArray+32));\n\nconst unsigned char OneArray[] =\n    \"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n    \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";\nconst arith_uint256 OneL = arith_uint256V(std::vector<unsigned char>(OneArray,OneArray+32));\n\nconst unsigned char MaxArray[] =\n    \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\"\n    \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\";\nconst arith_uint256 MaxL = arith_uint256V(std::vector<unsigned char>(MaxArray,MaxArray+32));\n\nconst arith_uint256 HalfL = (OneL << 255);\nstd::string ArrayToString(const unsigned char A[], unsigned int width)\n{\n    std::stringstream Stream;\n    Stream << std::hex;\n    for (unsigned int i = 0; i < width; ++i)\n    {\n        Stream<<std::setw(2)<<std::setfill('0')<<(unsigned int)A[width-i-1];\n    }\n    return Stream.str();\n}\n\nBOOST_AUTO_TEST_CASE( basics ) // constructors, equality, inequality\n{\n    BOOST_CHECK(1 == 0+1);\n    // constructor arith_uint256(vector<char>):\n    BOOST_CHECK(R1L.ToString() == ArrayToString(R1Array,32));\n    BOOST_CHECK(R2L.ToString() == ArrayToString(R2Array,32));\n    BOOST_CHECK(ZeroL.ToString() == ArrayToString(ZeroArray,32));\n    BOOST_CHECK(OneL.ToString() == ArrayToString(OneArray,32));\n    BOOST_CHECK(MaxL.ToString() == ArrayToString(MaxArray,32));\n    BOOST_CHECK(OneL.ToString() != ArrayToString(ZeroArray,32));\n\n    // == and !=\n    BOOST_CHECK(R1L != R2L);\n    BOOST_CHECK(ZeroL != OneL);\n    BOOST_CHECK(OneL != ZeroL);\n    BOOST_CHECK(MaxL != ZeroL);\n    BOOST_CHECK(~MaxL == ZeroL);\n    BOOST_CHECK( ((R1L ^ R2L) ^ R1L) == R2L);\n\n    uint64_t Tmp64 = 0xc4dab720d9c7acaaULL;\n    for (unsigned int i = 0; i < 256; ++i)\n    {\n        BOOST_CHECK(ZeroL != (OneL << i));\n        BOOST_CHECK((OneL << i) != ZeroL);\n        BOOST_CHECK(R1L != (R1L ^ (OneL << i)));\n        BOOST_CHECK(((arith_uint256(Tmp64) ^ (OneL << i) ) != Tmp64 ));\n    }\n    BOOST_CHECK(ZeroL == (OneL << 256));\n\n    // String Constructor and Copy Constructor\n    BOOST_CHECK(arith_uint256(\"0x\"+R1L.ToString()) == R1L);\n    BOOST_CHECK(arith_uint256(\"0x\"+R2L.ToString()) == R2L);\n    BOOST_CHECK(arith_uint256(\"0x\"+ZeroL.ToString()) == ZeroL);\n    BOOST_CHECK(arith_uint256(\"0x\"+OneL.ToString()) == OneL);\n    BOOST_CHECK(arith_uint256(\"0x\"+MaxL.ToString()) == MaxL);\n    BOOST_CHECK(arith_uint256(R1L.ToString()) == R1L);\n    BOOST_CHECK(arith_uint256(\"   0x\"+R1L.ToString()+\"   \") == R1L);\n    BOOST_CHECK(arith_uint256(\"\") == ZeroL);\n    BOOST_CHECK(R1L == arith_uint256(R1ArrayHex));\n    BOOST_CHECK(arith_uint256(R1L) == R1L);\n    BOOST_CHECK((arith_uint256(R1L^R2L)^R2L) == R1L);\n    BOOST_CHECK(arith_uint256(ZeroL) == ZeroL);\n    BOOST_CHECK(arith_uint256(OneL) == OneL);\n\n    // uint64_t constructor\n    BOOST_CHECK( (R1L & arith_uint256(\"0xffffffffffffffff\")) == arith_uint256(R1LLow64));\n    BOOST_CHECK(ZeroL == arith_uint256(0));\n    BOOST_CHECK(OneL == arith_uint256(1));\n    BOOST_CHECK(arith_uint256(\"0xffffffffffffffff\") == arith_uint256(0xffffffffffffffffULL));\n\n    // Assignment (from base_uint)\n    arith_uint256 tmpL = ~ZeroL; BOOST_CHECK(tmpL == ~ZeroL);\n    tmpL = ~OneL; BOOST_CHECK(tmpL == ~OneL);\n    tmpL = ~R1L; BOOST_CHECK(tmpL == ~R1L);\n    tmpL = ~R2L; BOOST_CHECK(tmpL == ~R2L);\n    tmpL = ~MaxL; BOOST_CHECK(tmpL == ~MaxL);\n}\n\nvoid shiftArrayRight(unsigned char* to, const unsigned char* from, unsigned int arrayLength, unsigned int bitsToShift)\n{\n    for (unsigned int T=0; T < arrayLength; ++T)\n    {\n        unsigned int F = (T+bitsToShift/8);\n        if (F < arrayLength)\n            to[T]  = from[F] >> (bitsToShift%8);\n        else\n            to[T] = 0;\n        if (F + 1 < arrayLength)\n            to[T] |= from[(F+1)] << (8-bitsToShift%8);\n    }\n}\n\nvoid shiftArrayLeft(unsigned char* to, const unsigned char* from, unsigned int arrayLength, unsigned int bitsToShift)\n{\n    for (unsigned int T=0; T < arrayLength; ++T)\n    {\n        if (T >= bitsToShift/8)\n        {\n            unsigned int F = T-bitsToShift/8;\n            to[T]  = from[F] << (bitsToShift%8);\n            if (T >= bitsToShift/8+1)\n                to[T] |= from[F-1] >> (8-bitsToShift%8);\n        }\n        else {\n            to[T] = 0;\n        }\n    }\n}\n\nBOOST_AUTO_TEST_CASE( shifts ) { // \"<<\"  \">>\"  \"<<=\"  \">>=\"\n    unsigned char TmpArray[32];\n    arith_uint256 TmpL;\n    for (unsigned int i = 0; i < 256; ++i)\n    {\n        shiftArrayLeft(TmpArray, OneArray, 32, i);\n        BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (OneL << i));\n        TmpL = OneL; TmpL <<= i;\n        BOOST_CHECK(TmpL == (OneL << i));\n        BOOST_CHECK((HalfL >> (255-i)) == (OneL << i));\n        TmpL = HalfL; TmpL >>= (255-i);\n        BOOST_CHECK(TmpL == (OneL << i));\n\n        shiftArrayLeft(TmpArray, R1Array, 32, i);\n        BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (R1L << i));\n        TmpL = R1L; TmpL <<= i;\n        BOOST_CHECK(TmpL == (R1L << i));\n\n        shiftArrayRight(TmpArray, R1Array, 32, i);\n        BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (R1L >> i));\n        TmpL = R1L; TmpL >>= i;\n        BOOST_CHECK(TmpL == (R1L >> i));\n\n        shiftArrayLeft(TmpArray, MaxArray, 32, i);\n        BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (MaxL << i));\n        TmpL = MaxL; TmpL <<= i;\n        BOOST_CHECK(TmpL == (MaxL << i));\n\n        shiftArrayRight(TmpArray, MaxArray, 32, i);\n        BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (MaxL >> i));\n        TmpL = MaxL; TmpL >>= i;\n        BOOST_CHECK(TmpL == (MaxL >> i));\n    }\n    arith_uint256 c1L = arith_uint256(0x0123456789abcdefULL);\n    arith_uint256 c2L = c1L << 128;\n    for (unsigned int i = 0; i < 128; ++i) {\n        BOOST_CHECK((c1L << i) == (c2L >> (128-i)));\n    }\n    for (unsigned int i = 128; i < 256; ++i) {\n        BOOST_CHECK((c1L << i) == (c2L << (i-128)));\n    }\n}\n\nBOOST_AUTO_TEST_CASE( unaryOperators ) // !    ~    -\n{\n    BOOST_CHECK(!ZeroL);\n    BOOST_CHECK(!(!OneL));\n    for (unsigned int i = 0; i < 256; ++i)\n        BOOST_CHECK(!(!(OneL<<i)));\n    BOOST_CHECK(!(!R1L));\n    BOOST_CHECK(!(!MaxL));\n\n    BOOST_CHECK(~ZeroL == MaxL);\n\n    unsigned char TmpArray[32];\n    for (unsigned int i = 0; i < 32; ++i) { TmpArray[i] = ~R1Array[i]; }\n    BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (~R1L));\n\n    BOOST_CHECK(-ZeroL == ZeroL);\n    BOOST_CHECK(-R1L == (~R1L)+1);\n    for (unsigned int i = 0; i < 256; ++i)\n        BOOST_CHECK(-(OneL<<i) == (MaxL << i));\n}\n\n\n// Check if doing _A_ _OP_ _B_ results in the same as applying _OP_ onto each\n// element of Aarray and Barray, and then converting the result into an arith_uint256.\n#define CHECKBITWISEOPERATOR(_A_,_B_,_OP_)                              \\\n    for (unsigned int i = 0; i < 32; ++i) { TmpArray[i] = _A_##Array[i] _OP_ _B_##Array[i]; } \\\n    BOOST_CHECK(arith_uint256V(std::vector<unsigned char>(TmpArray,TmpArray+32)) == (_A_##L _OP_ _B_##L));\n\n#define CHECKASSIGNMENTOPERATOR(_A_,_B_,_OP_)                           \\\n    TmpL = _A_##L; TmpL _OP_##= _B_##L; BOOST_CHECK(TmpL == (_A_##L _OP_ _B_##L));\n\nBOOST_AUTO_TEST_CASE( bitwiseOperators )\n{\n    unsigned char TmpArray[32];\n\n    CHECKBITWISEOPERATOR(R1,R2,|)\n    CHECKBITWISEOPERATOR(R1,R2,^)\n    CHECKBITWISEOPERATOR(R1,R2,&)\n    CHECKBITWISEOPERATOR(R1,Zero,|)\n    CHECKBITWISEOPERATOR(R1,Zero,^)\n    CHECKBITWISEOPERATOR(R1,Zero,&)\n    CHECKBITWISEOPERATOR(R1,Max,|)\n    CHECKBITWISEOPERATOR(R1,Max,^)\n    CHECKBITWISEOPERATOR(R1,Max,&)\n    CHECKBITWISEOPERATOR(Zero,R1,|)\n    CHECKBITWISEOPERATOR(Zero,R1,^)\n    CHECKBITWISEOPERATOR(Zero,R1,&)\n    CHECKBITWISEOPERATOR(Max,R1,|)\n    CHECKBITWISEOPERATOR(Max,R1,^)\n    CHECKBITWISEOPERATOR(Max,R1,&)\n\n    arith_uint256 TmpL;\n    CHECKASSIGNMENTOPERATOR(R1,R2,|)\n    CHECKASSIGNMENTOPERATOR(R1,R2,^)\n    CHECKASSIGNMENTOPERATOR(R1,R2,&)\n    CHECKASSIGNMENTOPERATOR(R1,Zero,|)\n    CHECKASSIGNMENTOPERATOR(R1,Zero,^)\n    CHECKASSIGNMENTOPERATOR(R1,Zero,&)\n    CHECKASSIGNMENTOPERATOR(R1,Max,|)\n    CHECKASSIGNMENTOPERATOR(R1,Max,^)\n    CHECKASSIGNMENTOPERATOR(R1,Max,&)\n    CHECKASSIGNMENTOPERATOR(Zero,R1,|)\n    CHECKASSIGNMENTOPERATOR(Zero,R1,^)\n    CHECKASSIGNMENTOPERATOR(Zero,R1,&)\n    CHECKASSIGNMENTOPERATOR(Max,R1,|)\n    CHECKASSIGNMENTOPERATOR(Max,R1,^)\n    CHECKASSIGNMENTOPERATOR(Max,R1,&)\n\n    uint64_t Tmp64 = 0xe1db685c9a0b47a2ULL;\n    TmpL = R1L; TmpL |= Tmp64;  BOOST_CHECK(TmpL == (R1L | arith_uint256(Tmp64)));\n    TmpL = R1L; TmpL |= 0; BOOST_CHECK(TmpL == R1L);\n    TmpL ^= 0; BOOST_CHECK(TmpL == R1L);\n    TmpL ^= Tmp64;  BOOST_CHECK(TmpL == (R1L ^ arith_uint256(Tmp64)));\n}\n\nBOOST_AUTO_TEST_CASE( comparison ) // <= >= < >\n{\n    arith_uint256 TmpL;\n    for (unsigned int i = 0; i < 256; ++i) {\n        TmpL= OneL<< i;\n        BOOST_CHECK( TmpL >= ZeroL && TmpL > ZeroL && ZeroL < TmpL && ZeroL <= TmpL);\n        BOOST_CHECK( TmpL >= 0 && TmpL > 0 && 0 < TmpL && 0 <= TmpL);\n        TmpL |= R1L;\n        BOOST_CHECK( TmpL >= R1L ); BOOST_CHECK( (TmpL == R1L) != (TmpL > R1L)); BOOST_CHECK( (TmpL == R1L) || !( TmpL <= R1L));\n        BOOST_CHECK( R1L <= TmpL ); BOOST_CHECK( (R1L == TmpL) != (R1L < TmpL)); BOOST_CHECK( (TmpL == R1L) || !( R1L >= TmpL));\n        BOOST_CHECK(! (TmpL < R1L)); BOOST_CHECK(! (R1L > TmpL));\n    }\n}\n\nBOOST_AUTO_TEST_CASE( plusMinus )\n{\n    arith_uint256 TmpL = 0;\n    BOOST_CHECK(R1L+R2L == arith_uint256(R1LplusR2L));\n    TmpL += R1L;\n    BOOST_CHECK(TmpL == R1L);\n    TmpL += R2L;\n    BOOST_CHECK(TmpL == R1L + R2L);\n    BOOST_CHECK(OneL+MaxL == ZeroL);\n    BOOST_CHECK(MaxL+OneL == ZeroL);\n    for (unsigned int i = 1; i < 256; ++i) {\n        BOOST_CHECK( (MaxL >> i) + OneL == (HalfL >> (i-1)) );\n        BOOST_CHECK( OneL + (MaxL >> i) == (HalfL >> (i-1)) );\n        TmpL = (MaxL>>i); TmpL += OneL;\n        BOOST_CHECK( TmpL == (HalfL >> (i-1)) );\n        TmpL = (MaxL>>i); TmpL += 1;\n        BOOST_CHECK( TmpL == (HalfL >> (i-1)) );\n        TmpL = (MaxL>>i);\n        BOOST_CHECK( TmpL++ == (MaxL>>i) );\n        BOOST_CHECK( TmpL == (HalfL >> (i-1)));\n    }\n    BOOST_CHECK(arith_uint256(0xbedc77e27940a7ULL) + 0xee8d836fce66fbULL == arith_uint256(0xbedc77e27940a7ULL + 0xee8d836fce66fbULL));\n    TmpL = arith_uint256(0xbedc77e27940a7ULL); TmpL += 0xee8d836fce66fbULL;\n    BOOST_CHECK(TmpL == arith_uint256(0xbedc77e27940a7ULL+0xee8d836fce66fbULL));\n    TmpL -= 0xee8d836fce66fbULL;  BOOST_CHECK(TmpL == 0xbedc77e27940a7ULL);\n    TmpL = R1L;\n    BOOST_CHECK(++TmpL == R1L+1);\n\n    BOOST_CHECK(R1L -(-R2L) == R1L+R2L);\n    BOOST_CHECK(R1L -(-OneL) == R1L+OneL);\n    BOOST_CHECK(R1L - OneL == R1L+(-OneL));\n    for (unsigned int i = 1; i < 256; ++i) {\n        BOOST_CHECK((MaxL>>i) - (-OneL)  == (HalfL >> (i-1)));\n        BOOST_CHECK((HalfL >> (i-1)) - OneL == (MaxL>>i));\n        TmpL = (HalfL >> (i-1));\n        BOOST_CHECK(TmpL-- == (HalfL >> (i-1)));\n        BOOST_CHECK(TmpL == (MaxL >> i));\n        TmpL = (HalfL >> (i-1));\n        BOOST_CHECK(--TmpL == (MaxL >> i));\n    }\n    TmpL = R1L;\n    BOOST_CHECK(--TmpL == R1L-1);\n}\n\nBOOST_AUTO_TEST_CASE( multiply )\n{\n    BOOST_CHECK((R1L * R1L).ToString() == \"62a38c0486f01e45879d7910a7761bf30d5237e9873f9bff3642a732c4d84f10\");\n    BOOST_CHECK((R1L * R2L).ToString() == \"de37805e9986996cfba76ff6ba51c008df851987d9dd323f0e5de07760529c40\");\n    BOOST_CHECK((R1L * ZeroL) == ZeroL);\n    BOOST_CHECK((R1L * OneL) == R1L);\n    BOOST_CHECK((R1L * MaxL) == -R1L);\n    BOOST_CHECK((R2L * R1L) == (R1L * R2L));\n    BOOST_CHECK((R2L * R2L).ToString() == \"ac8c010096767d3cae5005dec28bb2b45a1d85ab7996ccd3e102a650f74ff100\");\n    BOOST_CHECK((R2L * ZeroL) == ZeroL);\n    BOOST_CHECK((R2L * OneL) == R2L);\n    BOOST_CHECK((R2L * MaxL) == -R2L);\n\n    BOOST_CHECK(MaxL * MaxL == OneL);\n\n    BOOST_CHECK((R1L * 0) == 0);\n    BOOST_CHECK((R1L * 1) == R1L);\n    BOOST_CHECK((R1L * 3).ToString() == \"7759b1c0ed14047f961ad09b20ff83687876a0181a367b813634046f91def7d4\");\n    BOOST_CHECK((R2L * 0x87654321UL).ToString() == \"23f7816e30c4ae2017257b7a0fa64d60402f5234d46e746b61c960d09a26d070\");\n}\n\nBOOST_AUTO_TEST_CASE( divide )\n{\n    arith_uint256 D1L(\"AD7133AC1977FA2B7\");\n    arith_uint256 D2L(\"ECD751716\");\n    BOOST_CHECK((R1L / D1L).ToString() == \"00000000000000000b8ac01106981635d9ed112290f8895545a7654dde28fb3a\");\n    BOOST_CHECK((R1L / D2L).ToString() == \"000000000873ce8efec5b67150bad3aa8c5fcb70e947586153bf2cec7c37c57a\");\n    BOOST_CHECK(R1L / OneL == R1L);\n    BOOST_CHECK(R1L / MaxL == ZeroL);\n    BOOST_CHECK(MaxL / R1L == 2);\n    BOOST_CHECK_THROW(R1L / ZeroL, uint_error);\n    BOOST_CHECK((R2L / D1L).ToString() == \"000000000000000013e1665895a1cc981de6d93670105a6b3ec3b73141b3a3c5\");\n    BOOST_CHECK((R2L / D2L).ToString() == \"000000000e8f0abe753bb0afe2e9437ee85d280be60882cf0bd1aaf7fa3cc2c4\");\n    BOOST_CHECK(R2L / OneL == R2L);\n    BOOST_CHECK(R2L / MaxL == ZeroL);\n    BOOST_CHECK(MaxL / R2L == 1);\n    BOOST_CHECK_THROW(R2L / ZeroL, uint_error);\n}\n\n\nbool almostEqual(double d1, double d2)\n{\n    return fabs(d1-d2) <= 4*fabs(d1)*std::numeric_limits<double>::epsilon();\n}\n\nBOOST_AUTO_TEST_CASE( methods ) // GetHex SetHex size() GetLow64 GetSerializeSize, Serialize, Unserialize\n{\n    BOOST_CHECK(R1L.GetHex() == R1L.ToString());\n    BOOST_CHECK(R2L.GetHex() == R2L.ToString());\n    BOOST_CHECK(OneL.GetHex() == OneL.ToString());\n    BOOST_CHECK(MaxL.GetHex() == MaxL.ToString());\n    arith_uint256 TmpL(R1L);\n    BOOST_CHECK(TmpL == R1L);\n    TmpL.SetHex(R2L.ToString());   BOOST_CHECK(TmpL == R2L);\n    TmpL.SetHex(ZeroL.ToString()); BOOST_CHECK(TmpL == 0);\n    TmpL.SetHex(HalfL.ToString()); BOOST_CHECK(TmpL == HalfL);\n\n    TmpL.SetHex(R1L.ToString());\n    BOOST_CHECK(R1L.size() == 32);\n    BOOST_CHECK(R2L.size() == 32);\n    BOOST_CHECK(ZeroL.size() == 32);\n    BOOST_CHECK(MaxL.size() == 32);\n    BOOST_CHECK(R1L.GetLow64()  == R1LLow64);\n    BOOST_CHECK(HalfL.GetLow64() ==0x0000000000000000ULL);\n    BOOST_CHECK(OneL.GetLow64() ==0x0000000000000001ULL);\n\n    for (unsigned int i = 0; i < 255; ++i)\n    {\n        BOOST_CHECK((OneL << i).getdouble() == ldexp(1.0,i));\n    }\n    BOOST_CHECK(ZeroL.getdouble() == 0.0);\n    for (int i = 256; i > 53; --i)\n        BOOST_CHECK(almostEqual((R1L>>(256-i)).getdouble(), ldexp(R1Ldouble,i)));\n    uint64_t R1L64part = (R1L>>192).GetLow64();\n    for (int i = 53; i > 0; --i) // doubles can store all integers in {0,...,2^54-1} exactly\n    {\n        BOOST_CHECK((R1L>>(256-i)).getdouble() == (double)(R1L64part >> (64-i)));\n    }\n}\n\nBOOST_AUTO_TEST_CASE(bignum_SetCompact)\n{\n    arith_uint256 num;\n    bool fNegative;\n    bool fOverflow;\n    num.SetCompact(0, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x00123456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x01003456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x02000056, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x03000000, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x04000000, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x00923456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x01803456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x02800056, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x03800000, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x04800000, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x01123456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000000012\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0x01120000U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    // Make sure that we don't generate compacts with the 0x00800000 bit set\n    num = 0x80;\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0x02008000U);\n\n    num.SetCompact(0x01fedcba, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"000000000000000000000000000000000000000000000000000000000000007e\");\n    BOOST_CHECK_EQUAL(num.GetCompact(true), 0x01fe0000U);\n    BOOST_CHECK_EQUAL(fNegative, true);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x02123456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000001234\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0x02123400U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x03123456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000000123456\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0x03123456U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x04123456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000012345600\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0x04123456U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x04923456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000012345600\");\n    BOOST_CHECK_EQUAL(num.GetCompact(true), 0x04923456U);\n    BOOST_CHECK_EQUAL(fNegative, true);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x05009234, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"0000000000000000000000000000000000000000000000000000000092340000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0x05009234U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0x20123456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(num.GetHex(), \"1234560000000000000000000000000000000000000000000000000000000000\");\n    BOOST_CHECK_EQUAL(num.GetCompact(), 0x20123456U);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, false);\n\n    num.SetCompact(0xff123456, &fNegative, &fOverflow);\n    BOOST_CHECK_EQUAL(fNegative, false);\n    BOOST_CHECK_EQUAL(fOverflow, true);\n}\n\n\nBOOST_AUTO_TEST_CASE( getmaxcoverage ) // some more tests just to get 100% coverage\n{\n    // ~R1L give a base_uint<256>\n    BOOST_CHECK((~~R1L >> 10) == (R1L >> 10));\n    BOOST_CHECK((~~R1L << 10) == (R1L << 10));\n    BOOST_CHECK(!(~~R1L < R1L));\n    BOOST_CHECK(~~R1L <= R1L);\n    BOOST_CHECK(!(~~R1L > R1L));\n    BOOST_CHECK(~~R1L >= R1L);\n    BOOST_CHECK(!(R1L < ~~R1L));\n    BOOST_CHECK(R1L <= ~~R1L);\n    BOOST_CHECK(!(R1L > ~~R1L));\n    BOOST_CHECK(R1L >= ~~R1L);\n\n    BOOST_CHECK(~~R1L + R2L == R1L + ~~R2L);\n    BOOST_CHECK(~~R1L - R2L == R1L - ~~R2L);\n    BOOST_CHECK(~R1L != R1L); BOOST_CHECK(R1L != ~R1L);\n    unsigned char TmpArray[32];\n    CHECKBITWISEOPERATOR(~R1,R2,|)\n    CHECKBITWISEOPERATOR(~R1,R2,^)\n    CHECKBITWISEOPERATOR(~R1,R2,&)\n    CHECKBITWISEOPERATOR(R1,~R2,|)\n    CHECKBITWISEOPERATOR(R1,~R2,^)\n    CHECKBITWISEOPERATOR(R1,~R2,&)\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/base32_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <utilstrencodings.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(base32_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(base32_testvectors)\n{\n    static const std::string vstrIn[]  = {\"\",\"f\",\"fo\",\"foo\",\"foob\",\"fooba\",\"foobar\"};\n    static const std::string vstrOut[] = {\"\",\"my======\",\"mzxq====\",\"mzxw6===\",\"mzxw6yq=\",\"mzxw6ytb\",\"mzxw6ytboi======\"};\n    for (unsigned int i=0; i<sizeof(vstrIn)/sizeof(vstrIn[0]); i++)\n    {\n        std::string strEnc = EncodeBase32(vstrIn[i]);\n        BOOST_CHECK(strEnc == vstrOut[i]);\n        std::string strDec = DecodeBase32(vstrOut[i]);\n        BOOST_CHECK(strDec == vstrIn[i]);\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/base58_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <base58.h>\n\n#include <test/data/base58_encode_decode.json.h>\n#include <test/data/base58_keys_invalid.json.h>\n#include <test/data/base58_keys_valid.json.h>\n\n#include <key.h>\n#include <script/script.h>\n#include <test/test_bitcoin.h>\n#include <uint256.h>\n#include <util.h>\n#include <utilstrencodings.h>\n\n#include <univalue.h>\n\n#include <boost/test/unit_test.hpp>\n\n\nextern UniValue read_json(const std::string& jsondata);\n\nBOOST_FIXTURE_TEST_SUITE(base58_tests, BasicTestingSetup)\n\n// Goal: test low-level base58 encoding functionality\nBOOST_AUTO_TEST_CASE(base58_EncodeBase58)\n{\n    UniValue tests = read_json(std::string(json_tests::base58_encode_decode, json_tests::base58_encode_decode + sizeof(json_tests::base58_encode_decode)));\n    for (unsigned int idx = 0; idx < tests.size(); idx++) {\n        UniValue test = tests[idx];\n        std::string strTest = test.write();\n        if (test.size() < 2) // Allow for extra stuff (useful for comments)\n        {\n            BOOST_ERROR(\"Bad test: \" << strTest);\n            continue;\n        }\n        std::vector<unsigned char> sourcedata = ParseHex(test[0].get_str());\n        std::string base58string = test[1].get_str();\n        BOOST_CHECK_MESSAGE(\n                    EncodeBase58(sourcedata.data(), sourcedata.data() + sourcedata.size()) == base58string,\n                    strTest);\n    }\n}\n\n// Goal: test low-level base58 decoding functionality\nBOOST_AUTO_TEST_CASE(base58_DecodeBase58)\n{\n    UniValue tests = read_json(std::string(json_tests::base58_encode_decode, json_tests::base58_encode_decode + sizeof(json_tests::base58_encode_decode)));\n    std::vector<unsigned char> result;\n\n    for (unsigned int idx = 0; idx < tests.size(); idx++) {\n        UniValue test = tests[idx];\n        std::string strTest = test.write();\n        if (test.size() < 2) // Allow for extra stuff (useful for comments)\n        {\n            BOOST_ERROR(\"Bad test: \" << strTest);\n            continue;\n        }\n        std::vector<unsigned char> expected = ParseHex(test[0].get_str());\n        std::string base58string = test[1].get_str();\n        BOOST_CHECK_MESSAGE(DecodeBase58(base58string, result), strTest);\n        BOOST_CHECK_MESSAGE(result.size() == expected.size() && std::equal(result.begin(), result.end(), expected.begin()), strTest);\n    }\n\n    BOOST_CHECK(!DecodeBase58(\"invalid\", result));\n\n    // check that DecodeBase58 skips whitespace, but still fails with unexpected non-whitespace at the end.\n    BOOST_CHECK(!DecodeBase58(\" \\t\\n\\v\\f\\r skip \\r\\f\\v\\n\\t a\", result));\n    BOOST_CHECK( DecodeBase58(\" \\t\\n\\v\\f\\r skip \\r\\f\\v\\n\\t \", result));\n    std::vector<unsigned char> expected = ParseHex(\"971a55\");\n    BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end());\n}\n\n// Goal: check that parsed keys match test payload\nBOOST_AUTO_TEST_CASE(base58_keys_valid_parse)\n{\n    UniValue tests = read_json(std::string(json_tests::base58_keys_valid, json_tests::base58_keys_valid + sizeof(json_tests::base58_keys_valid)));\n    CBitcoinSecret secret;\n    CTxDestination destination;\n    SelectParams(CBaseChainParams::MAIN);\n\n    for (unsigned int idx = 0; idx < tests.size(); idx++) {\n        UniValue test = tests[idx];\n        std::string strTest = test.write();\n        if (test.size() < 3) { // Allow for extra stuff (useful for comments)\n            BOOST_ERROR(\"Bad test: \" << strTest);\n            continue;\n        }\n        std::string exp_base58string = test[0].get_str();\n        std::vector<unsigned char> exp_payload = ParseHex(test[1].get_str());\n        const UniValue &metadata = test[2].get_obj();\n        bool isPrivkey = find_value(metadata, \"isPrivkey\").get_bool();\n        SelectParams(find_value(metadata, \"chain\").get_str());\n        bool try_case_flip = find_value(metadata, \"tryCaseFlip\").isNull() ? false : find_value(metadata, \"tryCaseFlip\").get_bool();\n        if (isPrivkey) {\n            bool isCompressed = find_value(metadata, \"isCompressed\").get_bool();\n            // Must be valid private key\n            BOOST_CHECK_MESSAGE(secret.SetString(exp_base58string), \"!SetString:\"+ strTest);\n            BOOST_CHECK_MESSAGE(secret.IsValid(), \"!IsValid:\" + strTest);\n            CKey privkey = secret.GetKey();\n            BOOST_CHECK_MESSAGE(privkey.IsCompressed() == isCompressed, \"compressed mismatch:\" + strTest);\n            BOOST_CHECK_MESSAGE(privkey.size() == exp_payload.size() && std::equal(privkey.begin(), privkey.end(), exp_payload.begin()), \"key mismatch:\" + strTest);\n\n            // Private key must be invalid public key\n            destination = DecodeDestination(exp_base58string);\n            BOOST_CHECK_MESSAGE(!IsValidDestination(destination), \"IsValid privkey as pubkey:\" + strTest);\n        } else {\n            // Must be valid public key\n            destination = DecodeDestination(exp_base58string);\n            CScript script = GetScriptForDestination(destination);\n            BOOST_CHECK_MESSAGE(IsValidDestination(destination), \"!IsValid:\" + strTest);\n            BOOST_CHECK_EQUAL(HexStr(script), HexStr(exp_payload));\n\n            // Try flipped case version\n            for (char& c : exp_base58string) {\n                if (c >= 'a' && c <= 'z') {\n                    c = (c - 'a') + 'A';\n                } else if (c >= 'A' && c <= 'Z') {\n                    c = (c - 'A') + 'a';\n                }\n            }\n            destination = DecodeDestination(exp_base58string);\n            BOOST_CHECK_MESSAGE(IsValidDestination(destination) == try_case_flip, \"!IsValid case flipped:\" + strTest);\n            if (IsValidDestination(destination)) {\n                script = GetScriptForDestination(destination);\n                BOOST_CHECK_EQUAL(HexStr(script), HexStr(exp_payload));\n            }\n\n            // Public key must be invalid private key\n            secret.SetString(exp_base58string);\n            BOOST_CHECK_MESSAGE(!secret.IsValid(), \"IsValid pubkey as privkey:\" + strTest);\n        }\n    }\n}\n\n// Goal: check that generated keys match test vectors\nBOOST_AUTO_TEST_CASE(base58_keys_valid_gen)\n{\n    UniValue tests = read_json(std::string(json_tests::base58_keys_valid, json_tests::base58_keys_valid + sizeof(json_tests::base58_keys_valid)));\n\n    for (unsigned int idx = 0; idx < tests.size(); idx++) {\n        UniValue test = tests[idx];\n        std::string strTest = test.write();\n        if (test.size() < 3) // Allow for extra stuff (useful for comments)\n        {\n            BOOST_ERROR(\"Bad test: \" << strTest);\n            continue;\n        }\n        std::string exp_base58string = test[0].get_str();\n        std::vector<unsigned char> exp_payload = ParseHex(test[1].get_str());\n        const UniValue &metadata = test[2].get_obj();\n        bool isPrivkey = find_value(metadata, \"isPrivkey\").get_bool();\n        SelectParams(find_value(metadata, \"chain\").get_str());\n        if (isPrivkey) {\n            bool isCompressed = find_value(metadata, \"isCompressed\").get_bool();\n            CKey key;\n            key.Set(exp_payload.begin(), exp_payload.end(), isCompressed);\n            assert(key.IsValid());\n            CBitcoinSecret secret;\n            secret.SetKey(key);\n            BOOST_CHECK_MESSAGE(secret.ToString() == exp_base58string, \"result mismatch: \" + strTest);\n        } else {\n            CTxDestination dest;\n            CScript exp_script(exp_payload.begin(), exp_payload.end());\n            ExtractDestination(exp_script, dest);\n            std::string address = EncodeDestination(dest);\n\n            BOOST_CHECK_EQUAL(address, exp_base58string);\n        }\n    }\n\n    SelectParams(CBaseChainParams::MAIN);\n}\n\n\n// Goal: check that base58 parsing code is robust against a variety of corrupted data\nBOOST_AUTO_TEST_CASE(base58_keys_invalid)\n{\n    UniValue tests = read_json(std::string(json_tests::base58_keys_invalid, json_tests::base58_keys_invalid + sizeof(json_tests::base58_keys_invalid))); // Negative testcases\n    CBitcoinSecret secret;\n    CTxDestination destination;\n\n    for (unsigned int idx = 0; idx < tests.size(); idx++) {\n        UniValue test = tests[idx];\n        std::string strTest = test.write();\n        if (test.size() < 1) // Allow for extra stuff (useful for comments)\n        {\n            BOOST_ERROR(\"Bad test: \" << strTest);\n            continue;\n        }\n        std::string exp_base58string = test[0].get_str();\n\n        // must be invalid as public and as private key\n        for (auto chain : { CBaseChainParams::MAIN, CBaseChainParams::TESTNET, CBaseChainParams::REGTEST }) {\n            SelectParams(chain);\n            destination = DecodeDestination(exp_base58string);\n            BOOST_CHECK_MESSAGE(!IsValidDestination(destination), \"IsValid pubkey in mainnet:\" + strTest);\n            secret.SetString(exp_base58string);\n            BOOST_CHECK_MESSAGE(!secret.IsValid(), \"IsValid privkey in mainnet:\" + strTest);\n        }\n    }\n}\n\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/base64_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <utilstrencodings.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(base64_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(base64_testvectors)\n{\n    static const std::string vstrIn[]  = {\"\",\"f\",\"fo\",\"foo\",\"foob\",\"fooba\",\"foobar\"};\n    static const std::string vstrOut[] = {\"\",\"Zg==\",\"Zm8=\",\"Zm9v\",\"Zm9vYg==\",\"Zm9vYmE=\",\"Zm9vYmFy\"};\n    for (unsigned int i=0; i<sizeof(vstrIn)/sizeof(vstrIn[0]); i++)\n    {\n        std::string strEnc = EncodeBase64(vstrIn[i]);\n        BOOST_CHECK(strEnc == vstrOut[i]);\n        std::string strDec = DecodeBase64(strEnc);\n        BOOST_CHECK(strDec == vstrIn[i]);\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/bech32_tests.cpp",
    "content": "// Copyright (c) 2017 Pieter Wuille\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bech32.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(bech32_tests, BasicTestingSetup)\n\nbool CaseInsensitiveEqual(const std::string &s1, const std::string &s2)\n{\n    if (s1.size() != s2.size()) return false;\n    for (size_t i = 0; i < s1.size(); ++i) {\n        char c1 = s1[i];\n        if (c1 >= 'A' && c1 <= 'Z') c1 -= ('A' - 'a');\n        char c2 = s2[i];\n        if (c2 >= 'A' && c2 <= 'Z') c2 -= ('A' - 'a');\n        if (c1 != c2) return false;\n    }\n    return true;\n}\n\nBOOST_AUTO_TEST_CASE(bip173_testvectors_valid)\n{\n    static const std::string CASES[] = {\n        \"A12UEL5L\",\n        \"a12uel5l\",\n        \"an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1tt5tgs\",\n        \"abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw\",\n        \"11qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqc8247j\",\n        \"split1checkupstagehandshakeupstreamerranterredcaperred2y9e3w\",\n        \"?1ezyfcl\",\n    };\n    for (const std::string& str : CASES) {\n        auto ret = bech32::Decode(str);\n        BOOST_CHECK(!ret.first.empty());\n        std::string recode = bech32::Encode(ret.first, ret.second);\n        BOOST_CHECK(!recode.empty());\n        BOOST_CHECK(CaseInsensitiveEqual(str, recode));\n    }\n}\n\nBOOST_AUTO_TEST_CASE(bip173_testvectors_invalid)\n{\n    static const std::string CASES[] = {\n        \" 1nwldj5\",\n        \"\\x7f\"\"1axkwrx\",\n        \"\\x80\"\"1eym55h\",\n        \"an84characterslonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1569pvx\",\n        \"pzry9x0s0muk\",\n        \"1pzry9x0s0muk\",\n        \"x1b4n0q5v\",\n        \"li1dgmt3\",\n        \"de1lg7wt\\xff\",\n        \"A1G7SGD8\",\n        \"10a06t8\",\n        \"1qzzfhee\",\n    };\n    for (const std::string& str : CASES) {\n        auto ret = bech32::Decode(str);\n        BOOST_CHECK(ret.first.empty());\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/bip32_tests.cpp",
    "content": "// Copyright (c) 2013-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <boost/test/unit_test.hpp>\n\n#include <base58.h>\n#include <key.h>\n#include <uint256.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <test/test_bitcoin.h>\n\n#include <string>\n#include <vector>\n\nstruct TestDerivation {\n    std::string pub;\n    std::string prv;\n    unsigned int nChild;\n};\n\nstruct TestVector {\n    std::string strHexMaster;\n    std::vector<TestDerivation> vDerive;\n\n    explicit TestVector(std::string strHexMasterIn) : strHexMaster(strHexMasterIn) {}\n\n    TestVector& operator()(std::string pub, std::string prv, unsigned int nChild) {\n        vDerive.push_back(TestDerivation());\n        TestDerivation &der = vDerive.back();\n        der.pub = pub;\n        der.prv = prv;\n        der.nChild = nChild;\n        return *this;\n    }\n};\n\nTestVector test1 =\n  TestVector(\"000102030405060708090a0b0c0d0e0f\")\n    (\"xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8\",\n     \"xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi\",\n     0x80000000)\n    (\"xpub68Gmy5EdvgibQVfPdqkBBCHxA5htiqg55crXYuXoQRKfDBFA1WEjWgP6LHhwBZeNK1VTsfTFUHCdrfp1bgwQ9xv5ski8PX9rL2dZXvgGDnw\",\n     \"xprv9uHRZZhk6KAJC1avXpDAp4MDc3sQKNxDiPvvkX8Br5ngLNv1TxvUxt4cV1rGL5hj6KCesnDYUhd7oWgT11eZG7XnxHrnYeSvkzY7d2bhkJ7\",\n     1)\n    (\"xpub6ASuArnXKPbfEwhqN6e3mwBcDTgzisQN1wXN9BJcM47sSikHjJf3UFHKkNAWbWMiGj7Wf5uMash7SyYq527Hqck2AxYysAA7xmALppuCkwQ\",\n     \"xprv9wTYmMFdV23N2TdNG573QoEsfRrWKQgWeibmLntzniatZvR9BmLnvSxqu53Kw1UmYPxLgboyZQaXwTCg8MSY3H2EU4pWcQDnRnrVA1xe8fs\",\n     0x80000002)\n    (\"xpub6D4BDPcP2GT577Vvch3R8wDkScZWzQzMMUm3PWbmWvVJrZwQY4VUNgqFJPMM3No2dFDFGTsxxpG5uJh7n7epu4trkrX7x7DogT5Uv6fcLW5\",\n     \"xprv9z4pot5VBttmtdRTWfWQmoH1taj2axGVzFqSb8C9xaxKymcFzXBDptWmT7FwuEzG3ryjH4ktypQSAewRiNMjANTtpgP4mLTj34bhnZX7UiM\",\n     2)\n    (\"xpub6FHa3pjLCk84BayeJxFW2SP4XRrFd1JYnxeLeU8EqN3vDfZmbqBqaGJAyiLjTAwm6ZLRQUMv1ZACTj37sR62cfN7fe5JnJ7dh8zL4fiyLHV\",\n     \"xprvA2JDeKCSNNZky6uBCviVfJSKyQ1mDYahRjijr5idH2WwLsEd4Hsb2Tyh8RfQMuPh7f7RtyzTtdrbdqqsunu5Mm3wDvUAKRHSC34sJ7in334\",\n     1000000000)\n    (\"xpub6H1LXWLaKsWFhvm6RVpEL9P4KfRZSW7abD2ttkWP3SSQvnyA8FSVqNTEcYFgJS2UaFcxupHiYkro49S8yGasTvXEYBVPamhGW6cFJodrTHy\",\n     \"xprvA41z7zogVVwxVSgdKUHDy1SKmdb533PjDz7J6N6mV6uS3ze1ai8FHa8kmHScGpWmj4WggLyQjgPie1rFSruoUihUZREPSL39UNdE3BBDu76\",\n     0);\n\nTestVector test2 =\n  TestVector(\"fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542\")\n    (\"xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB\",\n     \"xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U\",\n     0)\n    (\"xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH\",\n     \"xprv9vHkqa6EV4sPZHYqZznhT2NPtPCjKuDKGY38FBWLvgaDx45zo9WQRUT3dKYnjwih2yJD9mkrocEZXo1ex8G81dwSM1fwqWpWkeS3v86pgKt\",\n     0xFFFFFFFF)\n    (\"xpub6ASAVgeehLbnwdqV6UKMHVzgqAG8Gr6riv3Fxxpj8ksbH9ebxaEyBLZ85ySDhKiLDBrQSARLq1uNRts8RuJiHjaDMBU4Zn9h8LZNnBC5y4a\",\n     \"xprv9wSp6B7kry3Vj9m1zSnLvN3xH8RdsPP1Mh7fAaR7aRLcQMKTR2vidYEeEg2mUCTAwCd6vnxVrcjfy2kRgVsFawNzmjuHc2YmYRmagcEPdU9\",\n     1)\n    (\"xpub6DF8uhdarytz3FWdA8TvFSvvAh8dP3283MY7p2V4SeE2wyWmG5mg5EwVvmdMVCQcoNJxGoWaU9DCWh89LojfZ537wTfunKau47EL2dhHKon\",\n     \"xprv9zFnWC6h2cLgpmSA46vutJzBcfJ8yaJGg8cX1e5StJh45BBciYTRXSd25UEPVuesF9yog62tGAQtHjXajPPdbRCHuWS6T8XA2ECKADdw4Ef\",\n     0xFFFFFFFE)\n    (\"xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL\",\n     \"xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc\",\n     2)\n    (\"xpub6FnCn6nSzZAw5Tw7cgR9bi15UV96gLZhjDstkXXxvCLsUXBGXPdSnLFbdpq8p9HmGsApME5hQTZ3emM2rnY5agb9rXpVGyy3bdW6EEgAtqt\",\n     \"xprvA2nrNbFZABcdryreWet9Ea4LvTJcGsqrMzxHx98MMrotbir7yrKCEXw7nadnHM8Dq38EGfSh6dqA9QWTyefMLEcBYJUuekgW4BYPJcr9E7j\",\n     0);\n\nTestVector test3 =\n  TestVector(\"4b381541583be4423346c643850da4b320e46a87ae3d2a4e6da11eba819cd4acba45d239319ac14f863b8d5ab5a0d0c64d2e8a1e7d1457df2e5a3c51c73235be\")\n    (\"xpub661MyMwAqRbcEZVB4dScxMAdx6d4nFc9nvyvH3v4gJL378CSRZiYmhRoP7mBy6gSPSCYk6SzXPTf3ND1cZAceL7SfJ1Z3GC8vBgp2epUt13\",\n     \"xprv9s21ZrQH143K25QhxbucbDDuQ4naNntJRi4KUfWT7xo4EKsHt2QJDu7KXp1A3u7Bi1j8ph3EGsZ9Xvz9dGuVrtHHs7pXeTzjuxBrCmmhgC6\",\n      0x80000000)\n    (\"xpub68NZiKmJWnxxS6aaHmn81bvJeTESw724CRDs6HbuccFQN9Ku14VQrADWgqbhhTHBaohPX4CjNLf9fq9MYo6oDaPPLPxSb7gwQN3ih19Zm4Y\",\n     \"xprv9uPDJpEQgRQfDcW7BkF7eTya6RPxXeJCqCJGHuCJ4GiRVLzkTXBAJMu2qaMWPrS7AANYqdq6vcBcBUdJCVVFceUvJFjaPdGZ2y9WACViL4L\",\n      0);\n\nvoid RunTest(const TestVector &test) {\n    std::vector<unsigned char> seed = ParseHex(test.strHexMaster);\n    CExtKey key;\n    CExtPubKey pubkey;\n    key.SetMaster(seed.data(), seed.size());\n    pubkey = key.Neuter();\n    for (const TestDerivation &derive : test.vDerive) {\n        unsigned char data[74];\n        key.Encode(data);\n        pubkey.Encode(data);\n\n        // Test private key\n        CBitcoinExtKey b58key; b58key.SetKey(key);\n        BOOST_CHECK(b58key.ToString() == derive.prv);\n\n        CBitcoinExtKey b58keyDecodeCheck(derive.prv);\n        CExtKey checkKey = b58keyDecodeCheck.GetKey();\n        assert(checkKey == key); //ensure a base58 decoded key also matches\n\n        // Test public key\n        CBitcoinExtPubKey b58pubkey; b58pubkey.SetKey(pubkey);\n        BOOST_CHECK(b58pubkey.ToString() == derive.pub);\n\n        CBitcoinExtPubKey b58PubkeyDecodeCheck(derive.pub);\n        CExtPubKey checkPubKey = b58PubkeyDecodeCheck.GetKey();\n        assert(checkPubKey == pubkey); //ensure a base58 decoded pubkey also matches\n\n        // Derive new keys\n        CExtKey keyNew;\n        BOOST_CHECK(key.Derive(keyNew, derive.nChild));\n        CExtPubKey pubkeyNew = keyNew.Neuter();\n        if (!(derive.nChild & 0x80000000)) {\n            // Compare with public derivation\n            CExtPubKey pubkeyNew2;\n            BOOST_CHECK(pubkey.Derive(pubkeyNew2, derive.nChild));\n            BOOST_CHECK(pubkeyNew == pubkeyNew2);\n        }\n        key = keyNew;\n        pubkey = pubkeyNew;\n\n        CDataStream ssPub(SER_DISK, CLIENT_VERSION);\n        ssPub << pubkeyNew;\n        BOOST_CHECK(ssPub.size() == 75);\n\n        CDataStream ssPriv(SER_DISK, CLIENT_VERSION);\n        ssPriv << keyNew;\n        BOOST_CHECK(ssPriv.size() == 75);\n\n        CExtPubKey pubCheck;\n        CExtKey privCheck;\n        ssPub >> pubCheck;\n        ssPriv >> privCheck;\n\n        BOOST_CHECK(pubCheck == pubkeyNew);\n        BOOST_CHECK(privCheck == keyNew);\n    }\n}\n\nBOOST_FIXTURE_TEST_SUITE(bip32_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(bip32_test1) {\n    RunTest(test1);\n}\n\nBOOST_AUTO_TEST_CASE(bip32_test2) {\n    RunTest(test2);\n}\n\nBOOST_AUTO_TEST_CASE(bip32_test3) {\n    RunTest(test3);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/blockchain_tests.cpp",
    "content": "#include <boost/test/unit_test.hpp>\n\n#include \"stdlib.h\"\n\n#include \"rpc/blockchain.cpp\"\n#include \"test/test_bitcoin.h\"\n\n/* Equality between doubles is imprecise. Comparison should be done\n * with a small threshold of tolerance, rather than exact equality.\n */\nbool DoubleEquals(double a, double b, double epsilon)\n{\n    return std::abs(a - b) < epsilon;\n}\n\nCBlockIndex* CreateBlockIndexWithNbits(uint32_t nbits)\n{\n    CBlockIndex* block_index = new CBlockIndex();\n    block_index->nHeight = 46367;\n    block_index->nTime = 1269211443;\n    block_index->nBits = nbits;\n    return block_index;\n}\n\nCChain CreateChainWithNbits(uint32_t nbits)\n{\n    CBlockIndex* block_index = CreateBlockIndexWithNbits(nbits);\n    CChain chain;\n    chain.SetTip(block_index);\n    return chain;\n}\n\nvoid RejectDifficultyMismatch(double difficulty, double expected_difficulty) {\n     BOOST_CHECK_MESSAGE(\n        DoubleEquals(difficulty, expected_difficulty, 0.00001),\n        \"Difficulty was \" + std::to_string(difficulty)\n            + \" but was expected to be \" + std::to_string(expected_difficulty));\n}\n\n/* Given a BlockIndex with the provided nbits,\n * verify that the expected difficulty results.\n */\nvoid TestDifficulty(uint32_t nbits, double expected_difficulty)\n{\n    CBlockIndex* block_index = CreateBlockIndexWithNbits(nbits);\n    /* Since we are passing in block index explicitly,\n     * there is no need to set up anything within the chain itself.\n     */\n    CChain chain;\n\n    double difficulty = GetDifficulty(chain, block_index);\n    delete block_index;\n\n    RejectDifficultyMismatch(difficulty, expected_difficulty);\n}\n\nBOOST_FIXTURE_TEST_SUITE(blockchain_difficulty_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(get_difficulty_for_very_low_target)\n{\n    TestDifficulty(0x1f111111, 0.000001);\n}\n\nBOOST_AUTO_TEST_CASE(get_difficulty_for_low_target)\n{\n    TestDifficulty(0x1ef88f6f, 0.000016);\n}\n\nBOOST_AUTO_TEST_CASE(get_difficulty_for_mid_target)\n{\n    TestDifficulty(0x1df88f6f, 0.004023);\n}\n\nBOOST_AUTO_TEST_CASE(get_difficulty_for_high_target)\n{\n    TestDifficulty(0x1cf88f6f, 1.029916);\n}\n\nBOOST_AUTO_TEST_CASE(get_difficulty_for_very_high_target)\n{\n    TestDifficulty(0x12345678, 5913134931067755359633408.0);\n}\n\n// Verify that difficulty is 1.0 for an empty chain.\nBOOST_AUTO_TEST_CASE(get_difficulty_for_null_tip)\n{\n    CChain chain;\n    double difficulty = GetDifficulty(chain, nullptr);\n    RejectDifficultyMismatch(difficulty, 1.0);\n}\n\n/* Verify that if difficulty is based upon the block index\n * in the chain, if no block index is explicitly specified.\n */\nBOOST_AUTO_TEST_CASE(get_difficulty_for_null_block_index)\n{\n    CChain chain = CreateChainWithNbits(0x1df88f6f);\n\n    double difficulty = GetDifficulty(chain, nullptr);\n    delete chain.Tip();\n\n    double expected_difficulty = 0.004023;\n\n    RejectDifficultyMismatch(difficulty, expected_difficulty);\n}\n\n/* Verify that difficulty is based upon the explicitly specified\n * block index rather than being taken from the provided chain,\n * when both are present.\n */\nBOOST_AUTO_TEST_CASE(get_difficulty_for_block_index_overrides_tip)\n{\n    CChain chain = CreateChainWithNbits(0x1df88f6f);\n    /* This block index's nbits should be used\n     * instead of the chain's when calculating difficulty.\n     */\n    CBlockIndex* override_block_index = CreateBlockIndexWithNbits(0x12345678);\n\n    double difficulty = GetDifficulty(chain, override_block_index);\n    delete chain.Tip();\n    delete override_block_index;\n\n    RejectDifficultyMismatch(difficulty, 5913134931067755359633408.0);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/blockencodings_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <blockencodings.h>\n#include <consensus/merkle.h>\n#include <chainparams.h>\n#include <random.h>\n\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nstd::vector<std::pair<uint256, CTransactionRef>> extra_txn;\n\nstruct RegtestingSetup : public TestingSetup {\n    RegtestingSetup() : TestingSetup(CBaseChainParams::REGTEST) {}\n};\n\nBOOST_FIXTURE_TEST_SUITE(blockencodings_tests, RegtestingSetup)\n\nstatic CBlock BuildBlockTestCase() {\n    CBlock block;\n    CMutableTransaction tx;\n    tx.vin.resize(1);\n    tx.vin[0].scriptSig.resize(10);\n    tx.vout.resize(1);\n    tx.vout[0].nValue = 42;\n\n    block.vtx.resize(3);\n    block.vtx[0] = MakeTransactionRef(tx);\n    block.nVersion = 1;\n    block.hashPrevBlock = InsecureRand256();\n    block.nBits = 0x200f0f0f;\n\n    tx.vin[0].prevout.hash = InsecureRand256();\n    tx.vin[0].prevout.n = 0;\n    block.vtx[1] = MakeTransactionRef(tx);\n\n    tx.vin.resize(10);\n    for (size_t i = 0; i < tx.vin.size(); i++) {\n        tx.vin[i].prevout.hash = InsecureRand256();\n        tx.vin[i].prevout.n = 0;\n    }\n    block.vtx[2] = MakeTransactionRef(tx);\n\n    bool mutated;\n    block.hashMerkleRoot = BlockMerkleRoot(block, &mutated);\n    assert(!mutated);\n    while (!CheckProofOfWork(block.GetPoWHash(), block.nBits, Params().GetConsensus())) ++block.nNonce;\n    return block;\n}\n\n// Number of shared use_counts we expect for a tx we haven't touched\n// == 2 (mempool + our copy from the GetSharedTx call)\n#define SHARED_TX_OFFSET 2\n\nBOOST_AUTO_TEST_CASE(SimpleRoundTripTest)\n{\n    CTxMemPool pool;\n    TestMemPoolEntryHelper entry;\n    CBlock block(BuildBlockTestCase());\n\n    pool.addUnchecked(block.vtx[2]->GetHash(), entry.FromTx(*block.vtx[2]));\n    LOCK(pool.cs);\n    BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);\n\n    // Do a simple ShortTxIDs RT\n    {\n        CBlockHeaderAndShortTxIDs shortIDs(block, true);\n\n        CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n        stream << shortIDs;\n\n        CBlockHeaderAndShortTxIDs shortIDs2;\n        stream >> shortIDs2;\n\n        PartiallyDownloadedBlock partialBlock(&pool);\n        BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);\n        BOOST_CHECK( partialBlock.IsTxAvailable(0));\n        BOOST_CHECK(!partialBlock.IsTxAvailable(1));\n        BOOST_CHECK( partialBlock.IsTxAvailable(2));\n\n        BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1);\n\n        size_t poolSize = pool.size();\n        pool.removeRecursive(*block.vtx[2]);\n        BOOST_CHECK_EQUAL(pool.size(), poolSize - 1);\n\n        CBlock block2;\n        {\n            PartiallyDownloadedBlock tmp = partialBlock;\n            BOOST_CHECK(partialBlock.FillBlock(block2, {}) == READ_STATUS_INVALID); // No transactions\n            partialBlock = tmp;\n        }\n\n        // Wrong transaction\n        {\n            PartiallyDownloadedBlock tmp = partialBlock;\n            partialBlock.FillBlock(block2, {block.vtx[2]}); // Current implementation doesn't check txn here, but don't require that\n            partialBlock = tmp;\n        }\n        bool mutated;\n        BOOST_CHECK(block.hashMerkleRoot != BlockMerkleRoot(block2, &mutated));\n\n        CBlock block3;\n        BOOST_CHECK(partialBlock.FillBlock(block3, {block.vtx[1]}) == READ_STATUS_OK);\n        BOOST_CHECK_EQUAL(block.GetPoWHash().ToString(), block3.GetPoWHash().ToString());\n        BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block3, &mutated).ToString());\n        BOOST_CHECK(!mutated);\n    }\n}\n\nclass TestHeaderAndShortIDs {\n    // Utility to encode custom CBlockHeaderAndShortTxIDs\npublic:\n    CBlockHeader header;\n    uint64_t nonce;\n    std::vector<uint64_t> shorttxids;\n    std::vector<PrefilledTransaction> prefilledtxn;\n\n    explicit TestHeaderAndShortIDs(const CBlockHeaderAndShortTxIDs& orig) {\n        CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n        stream << orig;\n        stream >> *this;\n    }\n    explicit TestHeaderAndShortIDs(const CBlock& block) :\n        TestHeaderAndShortIDs(CBlockHeaderAndShortTxIDs(block, true)) {}\n\n    uint64_t GetShortID(const uint256& txhash) const {\n        CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n        stream << *this;\n        CBlockHeaderAndShortTxIDs base;\n        stream >> base;\n        return base.GetShortID(txhash);\n    }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(header);\n        READWRITE(nonce);\n        size_t shorttxids_size = shorttxids.size();\n        READWRITE(VARINT(shorttxids_size));\n        shorttxids.resize(shorttxids_size);\n        for (size_t i = 0; i < shorttxids.size(); i++) {\n            uint32_t lsb = shorttxids[i] & 0xffffffff;\n            uint16_t msb = (shorttxids[i] >> 32) & 0xffff;\n            READWRITE(lsb);\n            READWRITE(msb);\n            shorttxids[i] = (uint64_t(msb) << 32) | uint64_t(lsb);\n        }\n        READWRITE(prefilledtxn);\n    }\n};\n\nBOOST_AUTO_TEST_CASE(NonCoinbasePreforwardRTTest)\n{\n    CTxMemPool pool;\n    TestMemPoolEntryHelper entry;\n    CBlock block(BuildBlockTestCase());\n\n    pool.addUnchecked(block.vtx[2]->GetHash(), entry.FromTx(*block.vtx[2]));\n    LOCK(pool.cs);\n    BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);\n\n    uint256 txhash;\n\n    // Test with pre-forwarding tx 1, but not coinbase\n    {\n        TestHeaderAndShortIDs shortIDs(block);\n        shortIDs.prefilledtxn.resize(1);\n        shortIDs.prefilledtxn[0] = {1, block.vtx[1]};\n        shortIDs.shorttxids.resize(2);\n        shortIDs.shorttxids[0] = shortIDs.GetShortID(block.vtx[0]->GetHash());\n        shortIDs.shorttxids[1] = shortIDs.GetShortID(block.vtx[2]->GetHash());\n\n        CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n        stream << shortIDs;\n\n        CBlockHeaderAndShortTxIDs shortIDs2;\n        stream >> shortIDs2;\n\n        PartiallyDownloadedBlock partialBlock(&pool);\n        BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);\n        BOOST_CHECK(!partialBlock.IsTxAvailable(0));\n        BOOST_CHECK( partialBlock.IsTxAvailable(1));\n        BOOST_CHECK( partialBlock.IsTxAvailable(2));\n\n        BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[2]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1);\n\n        CBlock block2;\n        {\n            PartiallyDownloadedBlock tmp = partialBlock;\n            BOOST_CHECK(partialBlock.FillBlock(block2, {}) == READ_STATUS_INVALID); // No transactions\n            partialBlock = tmp;\n        }\n\n        // Wrong transaction\n        {\n            PartiallyDownloadedBlock tmp = partialBlock;\n            partialBlock.FillBlock(block2, {block.vtx[1]}); // Current implementation doesn't check txn here, but don't require that\n            partialBlock = tmp;\n        }\n        bool mutated;\n        BOOST_CHECK(block.hashMerkleRoot != BlockMerkleRoot(block2, &mutated));\n\n        CBlock block3;\n        PartiallyDownloadedBlock partialBlockCopy = partialBlock;\n        BOOST_CHECK(partialBlock.FillBlock(block3, {block.vtx[0]}) == READ_STATUS_OK);\n        BOOST_CHECK_EQUAL(block.GetPoWHash().ToString(), block3.GetPoWHash().ToString());\n        BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block3, &mutated).ToString());\n        BOOST_CHECK(!mutated);\n\n        txhash = block.vtx[2]->GetHash();\n        block.vtx.clear();\n        block2.vtx.clear();\n        block3.vtx.clear();\n        BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1); // + 1 because of partialBlockCopy.\n    }\n    BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);\n}\n\nBOOST_AUTO_TEST_CASE(SufficientPreforwardRTTest)\n{\n    CTxMemPool pool;\n    TestMemPoolEntryHelper entry;\n    CBlock block(BuildBlockTestCase());\n\n    pool.addUnchecked(block.vtx[1]->GetHash(), entry.FromTx(*block.vtx[1]));\n    LOCK(pool.cs);\n    BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[1]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);\n\n    uint256 txhash;\n\n    // Test with pre-forwarding coinbase + tx 2 with tx 1 in mempool\n    {\n        TestHeaderAndShortIDs shortIDs(block);\n        shortIDs.prefilledtxn.resize(2);\n        shortIDs.prefilledtxn[0] = {0, block.vtx[0]};\n        shortIDs.prefilledtxn[1] = {1, block.vtx[2]}; // id == 1 as it is 1 after index 1\n        shortIDs.shorttxids.resize(1);\n        shortIDs.shorttxids[0] = shortIDs.GetShortID(block.vtx[1]->GetHash());\n\n        CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n        stream << shortIDs;\n\n        CBlockHeaderAndShortTxIDs shortIDs2;\n        stream >> shortIDs2;\n\n        PartiallyDownloadedBlock partialBlock(&pool);\n        BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);\n        BOOST_CHECK( partialBlock.IsTxAvailable(0));\n        BOOST_CHECK( partialBlock.IsTxAvailable(1));\n        BOOST_CHECK( partialBlock.IsTxAvailable(2));\n\n        BOOST_CHECK_EQUAL(pool.mapTx.find(block.vtx[1]->GetHash())->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1);\n\n        CBlock block2;\n        PartiallyDownloadedBlock partialBlockCopy = partialBlock;\n        BOOST_CHECK(partialBlock.FillBlock(block2, {}) == READ_STATUS_OK);\n        BOOST_CHECK_EQUAL(block.GetPoWHash().ToString(), block2.GetPoWHash().ToString());\n        bool mutated;\n        BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block2, &mutated).ToString());\n        BOOST_CHECK(!mutated);\n\n        txhash = block.vtx[1]->GetHash();\n        block.vtx.clear();\n        block2.vtx.clear();\n        BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET + 1); // + 1 because of partialBlockCopy.\n    }\n    BOOST_CHECK_EQUAL(pool.mapTx.find(txhash)->GetSharedTx().use_count(), SHARED_TX_OFFSET + 0);\n}\n\nBOOST_AUTO_TEST_CASE(EmptyBlockRoundTripTest)\n{\n    CTxMemPool pool;\n    CMutableTransaction coinbase;\n    coinbase.vin.resize(1);\n    coinbase.vin[0].scriptSig.resize(10);\n    coinbase.vout.resize(1);\n    coinbase.vout[0].nValue = 42;\n\n    CBlock block;\n    block.vtx.resize(1);\n    block.vtx[0] = MakeTransactionRef(std::move(coinbase));\n    block.nVersion = 1;\n    block.hashPrevBlock = InsecureRand256();\n    block.nBits = 0x200f0f0f;\n\n    bool mutated;\n    block.hashMerkleRoot = BlockMerkleRoot(block, &mutated);\n    assert(!mutated);\n    while (!CheckProofOfWork(block.GetPoWHash(), block.nBits, Params().GetConsensus())) ++block.nNonce;\n\n    // Test simple header round-trip with only coinbase\n    {\n        CBlockHeaderAndShortTxIDs shortIDs(block, false);\n\n        CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n        stream << shortIDs;\n\n        CBlockHeaderAndShortTxIDs shortIDs2;\n        stream >> shortIDs2;\n\n        PartiallyDownloadedBlock partialBlock(&pool);\n        BOOST_CHECK(partialBlock.InitData(shortIDs2, extra_txn) == READ_STATUS_OK);\n        BOOST_CHECK(partialBlock.IsTxAvailable(0));\n\n        CBlock block2;\n        std::vector<CTransactionRef> vtx_missing;\n        BOOST_CHECK(partialBlock.FillBlock(block2, vtx_missing) == READ_STATUS_OK);\n        BOOST_CHECK_EQUAL(block.GetPoWHash().ToString(), block2.GetPoWHash().ToString());\n        BOOST_CHECK_EQUAL(block.hashMerkleRoot.ToString(), BlockMerkleRoot(block2, &mutated).ToString());\n        BOOST_CHECK(!mutated);\n    }\n}\n\nBOOST_AUTO_TEST_CASE(TransactionsRequestSerializationTest) {\n    BlockTransactionsRequest req1;\n    req1.blockhash = InsecureRand256();\n    req1.indexes.resize(4);\n    req1.indexes[0] = 0;\n    req1.indexes[1] = 1;\n    req1.indexes[2] = 3;\n    req1.indexes[3] = 4;\n\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << req1;\n\n    BlockTransactionsRequest req2;\n    stream >> req2;\n\n    BOOST_CHECK_EQUAL(req1.blockhash.ToString(), req2.blockhash.ToString());\n    BOOST_CHECK_EQUAL(req1.indexes.size(), req2.indexes.size());\n    BOOST_CHECK_EQUAL(req1.indexes[0], req2.indexes[0]);\n    BOOST_CHECK_EQUAL(req1.indexes[1], req2.indexes[1]);\n    BOOST_CHECK_EQUAL(req1.indexes[2], req2.indexes[2]);\n    BOOST_CHECK_EQUAL(req1.indexes[3], req2.indexes[3]);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/bloom_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <bloom.h>\n\n#include <base58.h>\n#include <clientversion.h>\n#include <key.h>\n#include <merkleblock.h>\n#include <primitives/block.h>\n#include <random.h>\n#include <serialize.h>\n#include <streams.h>\n#include <uint256.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <test/test_bitcoin.h>\n\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(bloom_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(bloom_create_insert_serialize)\n{\n    CBloomFilter filter(3, 0.01, 0, BLOOM_UPDATE_ALL);\n\n    filter.insert(ParseHex(\"99108ad8ed9bb6274d3980bab5a85c048f0950c8\"));\n    BOOST_CHECK_MESSAGE( filter.contains(ParseHex(\"99108ad8ed9bb6274d3980bab5a85c048f0950c8\")), \"Bloom filter doesn't contain just-inserted object!\");\n    // One bit different in first byte\n    BOOST_CHECK_MESSAGE(!filter.contains(ParseHex(\"19108ad8ed9bb6274d3980bab5a85c048f0950c8\")), \"Bloom filter contains something it shouldn't!\");\n\n    filter.insert(ParseHex(\"b5a2c786d9ef4658287ced5914b37a1b4aa32eee\"));\n    BOOST_CHECK_MESSAGE(filter.contains(ParseHex(\"b5a2c786d9ef4658287ced5914b37a1b4aa32eee\")), \"Bloom filter doesn't contain just-inserted object (2)!\");\n\n    filter.insert(ParseHex(\"b9300670b4c5366e95b2699e8b18bc75e5f729c5\"));\n    BOOST_CHECK_MESSAGE(filter.contains(ParseHex(\"b9300670b4c5366e95b2699e8b18bc75e5f729c5\")), \"Bloom filter doesn't contain just-inserted object (3)!\");\n\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << filter;\n\n    std::vector<unsigned char> vch = ParseHex(\"03614e9b050000000000000001\");\n    std::vector<char> expected(vch.size());\n\n    for (unsigned int i = 0; i < vch.size(); i++)\n        expected[i] = (char)vch[i];\n\n    BOOST_CHECK_EQUAL_COLLECTIONS(stream.begin(), stream.end(), expected.begin(), expected.end());\n\n    BOOST_CHECK_MESSAGE( filter.contains(ParseHex(\"99108ad8ed9bb6274d3980bab5a85c048f0950c8\")), \"Bloom filter doesn't contain just-inserted object!\");\n    filter.clear();\n    BOOST_CHECK_MESSAGE( !filter.contains(ParseHex(\"99108ad8ed9bb6274d3980bab5a85c048f0950c8\")), \"Bloom filter should be empty!\");\n}\n\nBOOST_AUTO_TEST_CASE(bloom_create_insert_serialize_with_tweak)\n{\n    // Same test as bloom_create_insert_serialize, but we add a nTweak of 100\n    CBloomFilter filter(3, 0.01, 2147483649UL, BLOOM_UPDATE_ALL);\n\n    filter.insert(ParseHex(\"99108ad8ed9bb6274d3980bab5a85c048f0950c8\"));\n    BOOST_CHECK_MESSAGE( filter.contains(ParseHex(\"99108ad8ed9bb6274d3980bab5a85c048f0950c8\")), \"Bloom filter doesn't contain just-inserted object!\");\n    // One bit different in first byte\n    BOOST_CHECK_MESSAGE(!filter.contains(ParseHex(\"19108ad8ed9bb6274d3980bab5a85c048f0950c8\")), \"Bloom filter contains something it shouldn't!\");\n\n    filter.insert(ParseHex(\"b5a2c786d9ef4658287ced5914b37a1b4aa32eee\"));\n    BOOST_CHECK_MESSAGE(filter.contains(ParseHex(\"b5a2c786d9ef4658287ced5914b37a1b4aa32eee\")), \"Bloom filter doesn't contain just-inserted object (2)!\");\n\n    filter.insert(ParseHex(\"b9300670b4c5366e95b2699e8b18bc75e5f729c5\"));\n    BOOST_CHECK_MESSAGE(filter.contains(ParseHex(\"b9300670b4c5366e95b2699e8b18bc75e5f729c5\")), \"Bloom filter doesn't contain just-inserted object (3)!\");\n\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << filter;\n\n    std::vector<unsigned char> vch = ParseHex(\"03ce4299050000000100008001\");\n    std::vector<char> expected(vch.size());\n\n    for (unsigned int i = 0; i < vch.size(); i++)\n        expected[i] = (char)vch[i];\n\n    BOOST_CHECK_EQUAL_COLLECTIONS(stream.begin(), stream.end(), expected.begin(), expected.end());\n}\n\nBOOST_AUTO_TEST_CASE(bloom_create_insert_key)\n{\n    std::string strSecret = std::string(\"5Kg1gnAjaLfKiwhhPpGS3QfRg2m6awQvaj98JCZBZQ5SuS2F15C\");\n    CBitcoinSecret vchSecret;\n    BOOST_CHECK(vchSecret.SetString(strSecret));\n\n    CKey key = vchSecret.GetKey();\n    CPubKey pubkey = key.GetPubKey();\n    std::vector<unsigned char> vchPubKey(pubkey.begin(), pubkey.end());\n\n    CBloomFilter filter(2, 0.001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(vchPubKey);\n    uint160 hash = pubkey.GetID();\n    filter.insert(std::vector<unsigned char>(hash.begin(), hash.end()));\n\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << filter;\n\n    std::vector<unsigned char> vch = ParseHex(\"038fc16b080000000000000001\");\n    std::vector<char> expected(vch.size());\n\n    for (unsigned int i = 0; i < vch.size(); i++)\n        expected[i] = (char)vch[i];\n\n    BOOST_CHECK_EQUAL_COLLECTIONS(stream.begin(), stream.end(), expected.begin(), expected.end());\n}\n\nBOOST_AUTO_TEST_CASE(bloom_match)\n{\n    // Random real transaction (b4749f017444b051c44dfd2720e88f314ff94f3dd6d56d40ef65854fcd7fff6b)\n    CDataStream stream(ParseHex(\"01000000010b26e9b7735eb6aabdf358bab62f9816a21ba9ebdb719d5299e88607d722c190000000008b4830450220070aca44506c5cef3a16ed519d7c3c39f8aab192c4e1c90d065f37b8a4af6141022100a8e160b856c2d43d27d8fba71e5aef6405b8643ac4cb7cb3c462aced7f14711a0141046d11fee51b0e60666d5049a9101a72741df480b96ee26488a4d3466b95c9a40ac5eeef87e10a5cd336c19a84565f80fa6c547957b7700ff4dfbdefe76036c339ffffffff021bff3d11000000001976a91404943fdd508053c75000106d3bc6e2754dbcff1988ac2f15de00000000001976a914a266436d2965547608b9e15d9032a7b9d64fa43188ac00000000\"), SER_DISK, CLIENT_VERSION);\n    CTransaction tx(deserialize, stream);\n\n    // and one which spends it (e2769b09e784f32f62ef849763d4f45b98e07ba658647343b915ff832b110436)\n    unsigned char ch[] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x6b, 0xff, 0x7f, 0xcd, 0x4f, 0x85, 0x65, 0xef, 0x40, 0x6d, 0xd5, 0xd6, 0x3d, 0x4f, 0xf9, 0x4f, 0x31, 0x8f, 0xe8, 0x20, 0x27, 0xfd, 0x4d, 0xc4, 0x51, 0xb0, 0x44, 0x74, 0x01, 0x9f, 0x74, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x49, 0x30, 0x46, 0x02, 0x21, 0x00, 0xda, 0x0d, 0xc6, 0xae, 0xce, 0xfe, 0x1e, 0x06, 0xef, 0xdf, 0x05, 0x77, 0x37, 0x57, 0xde, 0xb1, 0x68, 0x82, 0x09, 0x30, 0xe3, 0xb0, 0xd0, 0x3f, 0x46, 0xf5, 0xfc, 0xf1, 0x50, 0xbf, 0x99, 0x0c, 0x02, 0x21, 0x00, 0xd2, 0x5b, 0x5c, 0x87, 0x04, 0x00, 0x76, 0xe4, 0xf2, 0x53, 0xf8, 0x26, 0x2e, 0x76, 0x3e, 0x2d, 0xd5, 0x1e, 0x7f, 0xf0, 0xbe, 0x15, 0x77, 0x27, 0xc4, 0xbc, 0x42, 0x80, 0x7f, 0x17, 0xbd, 0x39, 0x01, 0x41, 0x04, 0xe6, 0xc2, 0x6e, 0xf6, 0x7d, 0xc6, 0x10, 0xd2, 0xcd, 0x19, 0x24, 0x84, 0x78, 0x9a, 0x6c, 0xf9, 0xae, 0xa9, 0x93, 0x0b, 0x94, 0x4b, 0x7e, 0x2d, 0xb5, 0x34, 0x2b, 0x9d, 0x9e, 0x5b, 0x9f, 0xf7, 0x9a, 0xff, 0x9a, 0x2e, 0xe1, 0x97, 0x8d, 0xd7, 0xfd, 0x01, 0xdf, 0xc5, 0x22, 0xee, 0x02, 0x28, 0x3d, 0x3b, 0x06, 0xa9, 0xd0, 0x3a, 0xcf, 0x80, 0x96, 0x96, 0x8d, 0x7d, 0xbb, 0x0f, 0x91, 0x78, 0xff, 0xff, 0xff, 0xff, 0x02, 0x8b, 0xa7, 0x94, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xba, 0xde, 0xec, 0xfd, 0xef, 0x05, 0x07, 0x24, 0x7f, 0xc8, 0xf7, 0x42, 0x41, 0xd7, 0x3b, 0xc0, 0x39, 0x97, 0x2d, 0x7b, 0x88, 0xac, 0x40, 0x94, 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xc1, 0x09, 0x32, 0x48, 0x3f, 0xec, 0x93, 0xed, 0x51, 0xf5, 0xfe, 0x95, 0xe7, 0x25, 0x59, 0xf2, 0xcc, 0x70, 0x43, 0xf9, 0x88, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00};\n    std::vector<unsigned char> vch(ch, ch + sizeof(ch) -1);\n    CDataStream spendStream(vch, SER_DISK, CLIENT_VERSION);\n    CTransaction spendingTx(deserialize, spendStream);\n\n    CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(uint256S(\"0xb4749f017444b051c44dfd2720e88f314ff94f3dd6d56d40ef65854fcd7fff6b\"));\n    BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter didn't match tx hash\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    // byte-reversed tx hash\n    filter.insert(ParseHex(\"6bff7fcd4f8565ef406dd5d63d4ff94f318fe82027fd4dc451b04474019f74b4\"));\n    BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter didn't match manually serialized tx hash\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(ParseHex(\"30450220070aca44506c5cef3a16ed519d7c3c39f8aab192c4e1c90d065f37b8a4af6141022100a8e160b856c2d43d27d8fba71e5aef6405b8643ac4cb7cb3c462aced7f14711a01\"));\n    BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter didn't match input signature\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(ParseHex(\"046d11fee51b0e60666d5049a9101a72741df480b96ee26488a4d3466b95c9a40ac5eeef87e10a5cd336c19a84565f80fa6c547957b7700ff4dfbdefe76036c339\"));\n    BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter didn't match input pub key\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(ParseHex(\"04943fdd508053c75000106d3bc6e2754dbcff19\"));\n    BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter didn't match output address\");\n    BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(spendingTx), \"Simple Bloom filter didn't add output\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(ParseHex(\"a266436d2965547608b9e15d9032a7b9d64fa431\"));\n    BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter didn't match output address\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(COutPoint(uint256S(\"0x90c122d70786e899529d71dbeba91ba216982fb6ba58f3bdaab65e73b7e9260b\"), 0));\n    BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter didn't match COutPoint\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    COutPoint prevOutPoint(uint256S(\"0x90c122d70786e899529d71dbeba91ba216982fb6ba58f3bdaab65e73b7e9260b\"), 0);\n    {\n        std::vector<unsigned char> data(32 + sizeof(unsigned int));\n        memcpy(data.data(), prevOutPoint.hash.begin(), 32);\n        memcpy(data.data()+32, &prevOutPoint.n, sizeof(unsigned int));\n        filter.insert(data);\n    }\n    BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter didn't match manually serialized COutPoint\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(uint256S(\"00000009e784f32f62ef849763d4f45b98e07ba658647343b915ff832b110436\"));\n    BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter matched random tx hash\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(ParseHex(\"0000006d2965547608b9e15d9032a7b9d64fa431\"));\n    BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter matched random address\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(COutPoint(uint256S(\"0x90c122d70786e899529d71dbeba91ba216982fb6ba58f3bdaab65e73b7e9260b\"), 1));\n    BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter matched COutPoint for an output we didn't care about\");\n\n    filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    filter.insert(COutPoint(uint256S(\"0x000000d70786e899529d71dbeba91ba216982fb6ba58f3bdaab65e73b7e9260b\"), 0));\n    BOOST_CHECK_MESSAGE(!filter.IsRelevantAndUpdate(tx), \"Simple Bloom filter matched COutPoint for an output we didn't care about\");\n}\n\nBOOST_AUTO_TEST_CASE(merkle_block_1)\n{\n    CBlock block = getBlock13b8a();\n    CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    // Match the last transaction\n    filter.insert(uint256S(\"0x74d681e0e03bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20\"));\n\n    CMerkleBlock merkleBlock(block, filter);\n    BOOST_CHECK_EQUAL(merkleBlock.header.GetHash().GetHex(), block.GetHash().GetHex());\n\n    BOOST_CHECK_EQUAL(merkleBlock.vMatchedTxn.size(), 1);\n    std::pair<unsigned int, uint256> pair = merkleBlock.vMatchedTxn[0];\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S(\"0x74d681e0e03bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 8);\n\n    std::vector<uint256> vMatched;\n    std::vector<unsigned int> vIndex;\n    BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched, vIndex) == block.hashMerkleRoot);\n    BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size());\n    for (unsigned int i = 0; i < vMatched.size(); i++)\n        BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second);\n\n    // Also match the 8th transaction\n    filter.insert(uint256S(\"0xdd1fd2a6fc16404faf339881a90adbde7f4f728691ac62e8f168809cdfae1053\"));\n    merkleBlock = CMerkleBlock(block, filter);\n    BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash());\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 2);\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[1] == pair);\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S(\"0xdd1fd2a6fc16404faf339881a90adbde7f4f728691ac62e8f168809cdfae1053\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 7);\n\n    BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched, vIndex) == block.hashMerkleRoot);\n    BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size());\n    for (unsigned int i = 0; i < vMatched.size(); i++)\n        BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second);\n}\n\nBOOST_AUTO_TEST_CASE(merkle_block_2)\n{\n    // Random real block (000000005a4ded781e667e06ceefafb71410b511fe0d5adc3e5a27ecbec34ae6)\n    // With 4 txes\n    CBlock block;\n    CDataStream stream(ParseHex(\"0100000075616236cc2126035fadb38deb65b9102cc2c41c09cdf29fc051906800000000fe7d5e12ef0ff901f6050211249919b1c0653771832b3a80c66cea42847f0ae1d4d26e49ffff001d00f0a4410401000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0804ffff001d029105ffffffff0100f2052a010000004341046d8709a041d34357697dfcb30a9d05900a6294078012bf3bb09c6f9b525f1d16d5503d7905db1ada9501446ea00728668fc5719aa80be2fdfc8a858a4dbdd4fbac00000000010000000255605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d28350000000049483045022100aa46504baa86df8a33b1192b1b9367b4d729dc41e389f2c04f3e5c7f0559aae702205e82253a54bf5c4f65b7428551554b2045167d6d206dfe6a2e198127d3f7df1501ffffffff55605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d2835010000004847304402202329484c35fa9d6bb32a55a70c0982f606ce0e3634b69006138683bcd12cbb6602200c28feb1e2555c3210f1dddb299738b4ff8bbe9667b68cb8764b5ac17b7adf0001ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac0000000001000000025f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028000000004847304402205d6058484157235b06028c30736c15613a28bdb768ee628094ca8b0030d4d6eb0220328789c9a2ec27ddaec0ad5ef58efded42e6ea17c2e1ce838f3d6913f5e95db601ffffffff5f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028010000004a493046022100c45af050d3cea806cedd0ab22520c53ebe63b987b8954146cdca42487b84bdd6022100b9b027716a6b59e640da50a864d6dd8a0ef24c76ce62391fa3eabaf4d2886d2d01ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac000000000100000002e2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b0000000048473044022016e7a727a061ea2254a6c358376aaa617ac537eb836c77d646ebda4c748aac8b0220192ce28bf9f2c06a6467e6531e27648d2b3e2e2bae85159c9242939840295ba501ffffffffe2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b010000004a493046022100b7a1a755588d4190118936e15cd217d133b0e4a53c3c15924010d5648d8925c9022100aaef031874db2114f2d869ac2de4ae53908fbfea5b2b1862e181626bb9005c9f01ffffffff0200e1f505000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00000000\"), SER_NETWORK, PROTOCOL_VERSION);\n    stream >> block;\n\n    CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    // Match the first transaction\n    filter.insert(uint256S(\"0xe980fe9f792d014e73b95203dc1335c5f9ce19ac537a419e6df5b47aecb93b70\"));\n\n    CMerkleBlock merkleBlock(block, filter);\n    BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash());\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1);\n    std::pair<unsigned int, uint256> pair = merkleBlock.vMatchedTxn[0];\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S(\"0xe980fe9f792d014e73b95203dc1335c5f9ce19ac537a419e6df5b47aecb93b70\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 0);\n\n    std::vector<uint256> vMatched;\n    std::vector<unsigned int> vIndex;\n    BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched, vIndex) == block.hashMerkleRoot);\n    BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size());\n    for (unsigned int i = 0; i < vMatched.size(); i++)\n        BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second);\n\n    // Match an output from the second transaction (the pubkey for address 1DZTzaBHUDM7T3QvUKBz4qXMRpkg8jsfB5)\n    // This should match the third transaction because it spends the output matched\n    // It also matches the fourth transaction, which spends to the pubkey again\n    filter.insert(ParseHex(\"044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45af\"));\n\n    merkleBlock = CMerkleBlock(block, filter);\n    BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash());\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 4);\n\n    BOOST_CHECK(pair == merkleBlock.vMatchedTxn[0]);\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[1].second == uint256S(\"0x28204cad1d7fc1d199e8ef4fa22f182de6258a3eaafe1bbe56ebdcacd3069a5f\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[1].first == 1);\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[2].second == uint256S(\"0x6b0f8a73a56c04b519f1883e8aafda643ba61a30bd1439969df21bea5f4e27e2\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[2].first == 2);\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[3].second == uint256S(\"0x3c1d7e82342158e4109df2e0b6348b6e84e403d8b4046d7007663ace63cddb23\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[3].first == 3);\n\n    BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched, vIndex) == block.hashMerkleRoot);\n    BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size());\n    for (unsigned int i = 0; i < vMatched.size(); i++)\n        BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second);\n}\n\nBOOST_AUTO_TEST_CASE(merkle_block_2_with_update_none)\n{\n    // Random real block (000000005a4ded781e667e06ceefafb71410b511fe0d5adc3e5a27ecbec34ae6)\n    // With 4 txes\n    CBlock block;\n    CDataStream stream(ParseHex(\"0100000075616236cc2126035fadb38deb65b9102cc2c41c09cdf29fc051906800000000fe7d5e12ef0ff901f6050211249919b1c0653771832b3a80c66cea42847f0ae1d4d26e49ffff001d00f0a4410401000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0804ffff001d029105ffffffff0100f2052a010000004341046d8709a041d34357697dfcb30a9d05900a6294078012bf3bb09c6f9b525f1d16d5503d7905db1ada9501446ea00728668fc5719aa80be2fdfc8a858a4dbdd4fbac00000000010000000255605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d28350000000049483045022100aa46504baa86df8a33b1192b1b9367b4d729dc41e389f2c04f3e5c7f0559aae702205e82253a54bf5c4f65b7428551554b2045167d6d206dfe6a2e198127d3f7df1501ffffffff55605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d2835010000004847304402202329484c35fa9d6bb32a55a70c0982f606ce0e3634b69006138683bcd12cbb6602200c28feb1e2555c3210f1dddb299738b4ff8bbe9667b68cb8764b5ac17b7adf0001ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac0000000001000000025f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028000000004847304402205d6058484157235b06028c30736c15613a28bdb768ee628094ca8b0030d4d6eb0220328789c9a2ec27ddaec0ad5ef58efded42e6ea17c2e1ce838f3d6913f5e95db601ffffffff5f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028010000004a493046022100c45af050d3cea806cedd0ab22520c53ebe63b987b8954146cdca42487b84bdd6022100b9b027716a6b59e640da50a864d6dd8a0ef24c76ce62391fa3eabaf4d2886d2d01ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac000000000100000002e2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b0000000048473044022016e7a727a061ea2254a6c358376aaa617ac537eb836c77d646ebda4c748aac8b0220192ce28bf9f2c06a6467e6531e27648d2b3e2e2bae85159c9242939840295ba501ffffffffe2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b010000004a493046022100b7a1a755588d4190118936e15cd217d133b0e4a53c3c15924010d5648d8925c9022100aaef031874db2114f2d869ac2de4ae53908fbfea5b2b1862e181626bb9005c9f01ffffffff0200e1f505000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00000000\"), SER_NETWORK, PROTOCOL_VERSION);\n    stream >> block;\n\n    CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_NONE);\n    // Match the first transaction\n    filter.insert(uint256S(\"0xe980fe9f792d014e73b95203dc1335c5f9ce19ac537a419e6df5b47aecb93b70\"));\n\n    CMerkleBlock merkleBlock(block, filter);\n    BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash());\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1);\n    std::pair<unsigned int, uint256> pair = merkleBlock.vMatchedTxn[0];\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S(\"0xe980fe9f792d014e73b95203dc1335c5f9ce19ac537a419e6df5b47aecb93b70\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 0);\n\n    std::vector<uint256> vMatched;\n    std::vector<unsigned int> vIndex;\n    BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched, vIndex) == block.hashMerkleRoot);\n    BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size());\n    for (unsigned int i = 0; i < vMatched.size(); i++)\n        BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second);\n\n    // Match an output from the second transaction (the pubkey for address 1DZTzaBHUDM7T3QvUKBz4qXMRpkg8jsfB5)\n    // This should not match the third transaction though it spends the output matched\n    // It will match the fourth transaction, which has another pay-to-pubkey output to the same address\n    filter.insert(ParseHex(\"044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45af\"));\n\n    merkleBlock = CMerkleBlock(block, filter);\n    BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash());\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 3);\n\n    BOOST_CHECK(pair == merkleBlock.vMatchedTxn[0]);\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[1].second == uint256S(\"0x28204cad1d7fc1d199e8ef4fa22f182de6258a3eaafe1bbe56ebdcacd3069a5f\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[1].first == 1);\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[2].second == uint256S(\"0x3c1d7e82342158e4109df2e0b6348b6e84e403d8b4046d7007663ace63cddb23\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[2].first == 3);\n\n    BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched, vIndex) == block.hashMerkleRoot);\n    BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size());\n    for (unsigned int i = 0; i < vMatched.size(); i++)\n        BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second);\n}\n\nBOOST_AUTO_TEST_CASE(merkle_block_3_and_serialize)\n{\n    // Random real block (000000000000dab0130bbcc991d3d7ae6b81aa6f50a798888dfe62337458dc45)\n    // With one tx\n    CBlock block;\n    CDataStream stream(ParseHex(\"0100000079cda856b143d9db2c1caff01d1aecc8630d30625d10e8b4b8b0000000000000b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f196367291b4d4c86041b8fa45d630101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff08044c86041b020a02ffffffff0100f2052a01000000434104ecd3229b0571c3be876feaac0442a9f13c5a572742927af1dc623353ecf8c202225f64868137a18cdd85cbbb4c74fbccfd4f49639cf1bdc94a5672bb15ad5d4cac00000000\"), SER_NETWORK, PROTOCOL_VERSION);\n    stream >> block;\n\n    CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    // Match the only transaction\n    filter.insert(uint256S(\"0x63194f18be0af63f2c6bc9dc0f777cbefed3d9415c4af83f3ee3a3d669c00cb5\"));\n\n    CMerkleBlock merkleBlock(block, filter);\n    BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash());\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1);\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S(\"0x63194f18be0af63f2c6bc9dc0f777cbefed3d9415c4af83f3ee3a3d669c00cb5\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 0);\n\n    std::vector<uint256> vMatched;\n    std::vector<unsigned int> vIndex;\n    BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched, vIndex) == block.hashMerkleRoot);\n    BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size());\n    for (unsigned int i = 0; i < vMatched.size(); i++)\n        BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second);\n\n    CDataStream merkleStream(SER_NETWORK, PROTOCOL_VERSION);\n    merkleStream << merkleBlock;\n\n    std::vector<unsigned char> vch = ParseHex(\"0100000079cda856b143d9db2c1caff01d1aecc8630d30625d10e8b4b8b0000000000000b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f196367291b4d4c86041b8fa45d630100000001b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f19630101\");\n    std::vector<char> expected(vch.size());\n\n    for (unsigned int i = 0; i < vch.size(); i++)\n        expected[i] = (char)vch[i];\n\n    BOOST_CHECK_EQUAL_COLLECTIONS(expected.begin(), expected.end(), merkleStream.begin(), merkleStream.end());\n}\n\nBOOST_AUTO_TEST_CASE(merkle_block_4)\n{\n    // Random real block (000000000000b731f2eef9e8c63173adfb07e41bd53eb0ef0a6b720d6cb6dea4)\n    // With 7 txes\n    CBlock block;\n    CDataStream stream(ParseHex(\"0100000082bb869cf3a793432a66e826e05a6fc37469f8efb7421dc880670100000000007f16c5962e8bd963659c793ce370d95f093bc7e367117b3c30c1f8fdd0d9728776381b4d4c86041b554b85290701000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b0136ffffffff0100f2052a01000000434104eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91ac000000000100000001bcad20a6a29827d1424f08989255120bf7f3e9e3cdaaa6bb31b0737fe048724300000000494830450220356e834b046cadc0f8ebb5a8a017b02de59c86305403dad52cd77b55af062ea10221009253cd6c119d4729b77c978e1e2aa19f5ea6e0e52b3f16e32fa608cd5bab753901ffffffff02008d380c010000001976a9142b4b8072ecbba129b6453c63e129e643207249ca88ac0065cd1d000000001976a9141b8dd13b994bcfc787b32aeadf58ccb3615cbd5488ac000000000100000003fdacf9b3eb077412e7a968d2e4f11b9a9dee312d666187ed77ee7d26af16cb0b000000008c493046022100ea1608e70911ca0de5af51ba57ad23b9a51db8d28f82c53563c56a05c20f5a87022100a8bdc8b4a8acc8634c6b420410150775eb7f2474f5615f7fccd65af30f310fbf01410465fdf49e29b06b9a1582287b6279014f834edc317695d125ef623c1cc3aaece245bd69fcad7508666e9c74a49dc9056d5fc14338ef38118dc4afae5fe2c585caffffffff309e1913634ecb50f3c4f83e96e70b2df071b497b8973a3e75429df397b5af83000000004948304502202bdb79c596a9ffc24e96f4386199aba386e9bc7b6071516e2b51dda942b3a1ed022100c53a857e76b724fc14d45311eac5019650d415c3abb5428f3aae16d8e69bec2301ffffffff2089e33491695080c9edc18a428f7d834db5b6d372df13ce2b1b0e0cbcb1e6c10000000049483045022100d4ce67c5896ee251c810ac1ff9ceccd328b497c8f553ab6e08431e7d40bad6b5022033119c0c2b7d792d31f1187779c7bd95aefd93d90a715586d73801d9b47471c601ffffffff0100714460030000001976a914c7b55141d097ea5df7a0ed330cf794376e53ec8d88ac0000000001000000045bf0e214aa4069a3e792ecee1e1bf0c1d397cde8dd08138f4b72a00681743447000000008b48304502200c45de8c4f3e2c1821f2fc878cba97b1e6f8807d94930713aa1c86a67b9bf1e40221008581abfef2e30f957815fc89978423746b2086375ca8ecf359c85c2a5b7c88ad01410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffffd669f7d7958d40fc59d2253d88e0f248e29b599c80bbcec344a83dda5f9aa72c000000008a473044022078124c8beeaa825f9e0b30bff96e564dd859432f2d0cb3b72d3d5d93d38d7e930220691d233b6c0f995be5acb03d70a7f7a65b6bc9bdd426260f38a1346669507a3601410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95fffffffff878af0d93f5229a68166cf051fd372bb7a537232946e0a46f53636b4dafdaa4000000008c493046022100c717d1714551663f69c3c5759bdbb3a0fcd3fab023abc0e522fe6440de35d8290221008d9cbe25bffc44af2b18e81c58eb37293fd7fe1c2e7b46fc37ee8c96c50ab1e201410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff27f2b668859cd7f2f894aa0fd2d9e60963bcd07c88973f425f999b8cbfd7a1e2000000008c493046022100e00847147cbf517bcc2f502f3ddc6d284358d102ed20d47a8aa788a62f0db780022100d17b2d6fa84dcaf1c95d88d7e7c30385aecf415588d749afd3ec81f6022cecd701410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff0100c817a8040000001976a914b6efd80d99179f4f4ff6f4dd0a007d018c385d2188ac000000000100000001834537b2f1ce8ef9373a258e10545ce5a50b758df616cd4356e0032554ebd3c4000000008b483045022100e68f422dd7c34fdce11eeb4509ddae38201773dd62f284e8aa9d96f85099d0b002202243bd399ff96b649a0fad05fa759d6a882f0af8c90cf7632c2840c29070aec20141045e58067e815c2f464c6a2a15f987758374203895710c2d452442e28496ff38ba8f5fd901dc20e29e88477167fe4fc299bf818fd0d9e1632d467b2a3d9503b1aaffffffff0280d7e636030000001976a914f34c3e10eb387efe872acb614c89e78bfca7815d88ac404b4c00000000001976a914a84e272933aaf87e1715d7786c51dfaeb5b65a6f88ac00000000010000000143ac81c8e6f6ef307dfe17f3d906d999e23e0189fda838c5510d850927e03ae7000000008c4930460221009c87c344760a64cb8ae6685a3eec2c1ac1bed5b88c87de51acd0e124f266c16602210082d07c037359c3a257b5c63ebd90f5a5edf97b2ac1c434b08ca998839f346dd40141040ba7e521fa7946d12edbb1d1e95a15c34bd4398195e86433c92b431cd315f455fe30032ede69cad9d1e1ed6c3c4ec0dbfced53438c625462afb792dcb098544bffffffff0240420f00000000001976a9144676d1b820d63ec272f1900d59d43bc6463d96f888ac40420f00000000001976a914648d04341d00d7968b3405c034adc38d4d8fb9bd88ac00000000010000000248cc917501ea5c55f4a8d2009c0567c40cfe037c2e71af017d0a452ff705e3f1000000008b483045022100bf5fdc86dc5f08a5d5c8e43a8c9d5b1ed8c65562e280007b52b133021acd9acc02205e325d613e555f772802bf413d36ba807892ed1a690a77811d3033b3de226e0a01410429fa713b124484cb2bd7b5557b2c0b9df7b2b1fee61825eadc5ae6c37a9920d38bfccdc7dc3cb0c47d7b173dbc9db8d37db0a33ae487982c59c6f8606e9d1791ffffffff41ed70551dd7e841883ab8f0b16bf04176b7d1480e4f0af9f3d4c3595768d068000000008b4830450221008513ad65187b903aed1102d1d0c47688127658c51106753fed0151ce9c16b80902201432b9ebcb87bd04ceb2de66035fbbaf4bf8b00d1cfe41f1a1f7338f9ad79d210141049d4cf80125bf50be1709f718c07ad15d0fc612b7da1f5570dddc35f2a352f0f27c978b06820edca9ef982c35fda2d255afba340068c5035552368bc7200c1488ffffffff0100093d00000000001976a9148edb68822f1ad580b043c7b3df2e400f8699eb4888ac00000000\"), SER_NETWORK, PROTOCOL_VERSION);\n    stream >> block;\n\n    CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL);\n    // Match the last transaction\n    filter.insert(uint256S(\"0x0a2a92f0bda4727d0a13eaddf4dd9ac6b5c61a1429e6b2b818f19b15df0ac154\"));\n\n    CMerkleBlock merkleBlock(block, filter);\n    BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash());\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1);\n    std::pair<unsigned int, uint256> pair = merkleBlock.vMatchedTxn[0];\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S(\"0x0a2a92f0bda4727d0a13eaddf4dd9ac6b5c61a1429e6b2b818f19b15df0ac154\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 6);\n\n    std::vector<uint256> vMatched;\n    std::vector<unsigned int> vIndex;\n    BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched, vIndex) == block.hashMerkleRoot);\n    BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size());\n    for (unsigned int i = 0; i < vMatched.size(); i++)\n        BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second);\n\n    // Also match the 4th transaction\n    filter.insert(uint256S(\"0x02981fa052f0481dbc5868f4fc2166035a10f27a03cfd2de67326471df5bc041\"));\n    merkleBlock = CMerkleBlock(block, filter);\n    BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash());\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 2);\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S(\"0x02981fa052f0481dbc5868f4fc2166035a10f27a03cfd2de67326471df5bc041\"));\n    BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 3);\n\n    BOOST_CHECK(merkleBlock.vMatchedTxn[1] == pair);\n\n    BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched, vIndex) == block.hashMerkleRoot);\n    BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size());\n    for (unsigned int i = 0; i < vMatched.size(); i++)\n        BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second);\n}\n\nBOOST_AUTO_TEST_CASE(merkle_block_4_test_p2pubkey_only)\n{\n    // Random real block (000000000000b731f2eef9e8c63173adfb07e41bd53eb0ef0a6b720d6cb6dea4)\n    // With 7 txes\n    CBlock block;\n    CDataStream stream(ParseHex(\"0100000082bb869cf3a793432a66e826e05a6fc37469f8efb7421dc880670100000000007f16c5962e8bd963659c793ce370d95f093bc7e367117b3c30c1f8fdd0d9728776381b4d4c86041b554b85290701000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b0136ffffffff0100f2052a01000000434104eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91ac000000000100000001bcad20a6a29827d1424f08989255120bf7f3e9e3cdaaa6bb31b0737fe048724300000000494830450220356e834b046cadc0f8ebb5a8a017b02de59c86305403dad52cd77b55af062ea10221009253cd6c119d4729b77c978e1e2aa19f5ea6e0e52b3f16e32fa608cd5bab753901ffffffff02008d380c010000001976a9142b4b8072ecbba129b6453c63e129e643207249ca88ac0065cd1d000000001976a9141b8dd13b994bcfc787b32aeadf58ccb3615cbd5488ac000000000100000003fdacf9b3eb077412e7a968d2e4f11b9a9dee312d666187ed77ee7d26af16cb0b000000008c493046022100ea1608e70911ca0de5af51ba57ad23b9a51db8d28f82c53563c56a05c20f5a87022100a8bdc8b4a8acc8634c6b420410150775eb7f2474f5615f7fccd65af30f310fbf01410465fdf49e29b06b9a1582287b6279014f834edc317695d125ef623c1cc3aaece245bd69fcad7508666e9c74a49dc9056d5fc14338ef38118dc4afae5fe2c585caffffffff309e1913634ecb50f3c4f83e96e70b2df071b497b8973a3e75429df397b5af83000000004948304502202bdb79c596a9ffc24e96f4386199aba386e9bc7b6071516e2b51dda942b3a1ed022100c53a857e76b724fc14d45311eac5019650d415c3abb5428f3aae16d8e69bec2301ffffffff2089e33491695080c9edc18a428f7d834db5b6d372df13ce2b1b0e0cbcb1e6c10000000049483045022100d4ce67c5896ee251c810ac1ff9ceccd328b497c8f553ab6e08431e7d40bad6b5022033119c0c2b7d792d31f1187779c7bd95aefd93d90a715586d73801d9b47471c601ffffffff0100714460030000001976a914c7b55141d097ea5df7a0ed330cf794376e53ec8d88ac0000000001000000045bf0e214aa4069a3e792ecee1e1bf0c1d397cde8dd08138f4b72a00681743447000000008b48304502200c45de8c4f3e2c1821f2fc878cba97b1e6f8807d94930713aa1c86a67b9bf1e40221008581abfef2e30f957815fc89978423746b2086375ca8ecf359c85c2a5b7c88ad01410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffffd669f7d7958d40fc59d2253d88e0f248e29b599c80bbcec344a83dda5f9aa72c000000008a473044022078124c8beeaa825f9e0b30bff96e564dd859432f2d0cb3b72d3d5d93d38d7e930220691d233b6c0f995be5acb03d70a7f7a65b6bc9bdd426260f38a1346669507a3601410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95fffffffff878af0d93f5229a68166cf051fd372bb7a537232946e0a46f53636b4dafdaa4000000008c493046022100c717d1714551663f69c3c5759bdbb3a0fcd3fab023abc0e522fe6440de35d8290221008d9cbe25bffc44af2b18e81c58eb37293fd7fe1c2e7b46fc37ee8c96c50ab1e201410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff27f2b668859cd7f2f894aa0fd2d9e60963bcd07c88973f425f999b8cbfd7a1e2000000008c493046022100e00847147cbf517bcc2f502f3ddc6d284358d102ed20d47a8aa788a62f0db780022100d17b2d6fa84dcaf1c95d88d7e7c30385aecf415588d749afd3ec81f6022cecd701410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff0100c817a8040000001976a914b6efd80d99179f4f4ff6f4dd0a007d018c385d2188ac000000000100000001834537b2f1ce8ef9373a258e10545ce5a50b758df616cd4356e0032554ebd3c4000000008b483045022100e68f422dd7c34fdce11eeb4509ddae38201773dd62f284e8aa9d96f85099d0b002202243bd399ff96b649a0fad05fa759d6a882f0af8c90cf7632c2840c29070aec20141045e58067e815c2f464c6a2a15f987758374203895710c2d452442e28496ff38ba8f5fd901dc20e29e88477167fe4fc299bf818fd0d9e1632d467b2a3d9503b1aaffffffff0280d7e636030000001976a914f34c3e10eb387efe872acb614c89e78bfca7815d88ac404b4c00000000001976a914a84e272933aaf87e1715d7786c51dfaeb5b65a6f88ac00000000010000000143ac81c8e6f6ef307dfe17f3d906d999e23e0189fda838c5510d850927e03ae7000000008c4930460221009c87c344760a64cb8ae6685a3eec2c1ac1bed5b88c87de51acd0e124f266c16602210082d07c037359c3a257b5c63ebd90f5a5edf97b2ac1c434b08ca998839f346dd40141040ba7e521fa7946d12edbb1d1e95a15c34bd4398195e86433c92b431cd315f455fe30032ede69cad9d1e1ed6c3c4ec0dbfced53438c625462afb792dcb098544bffffffff0240420f00000000001976a9144676d1b820d63ec272f1900d59d43bc6463d96f888ac40420f00000000001976a914648d04341d00d7968b3405c034adc38d4d8fb9bd88ac00000000010000000248cc917501ea5c55f4a8d2009c0567c40cfe037c2e71af017d0a452ff705e3f1000000008b483045022100bf5fdc86dc5f08a5d5c8e43a8c9d5b1ed8c65562e280007b52b133021acd9acc02205e325d613e555f772802bf413d36ba807892ed1a690a77811d3033b3de226e0a01410429fa713b124484cb2bd7b5557b2c0b9df7b2b1fee61825eadc5ae6c37a9920d38bfccdc7dc3cb0c47d7b173dbc9db8d37db0a33ae487982c59c6f8606e9d1791ffffffff41ed70551dd7e841883ab8f0b16bf04176b7d1480e4f0af9f3d4c3595768d068000000008b4830450221008513ad65187b903aed1102d1d0c47688127658c51106753fed0151ce9c16b80902201432b9ebcb87bd04ceb2de66035fbbaf4bf8b00d1cfe41f1a1f7338f9ad79d210141049d4cf80125bf50be1709f718c07ad15d0fc612b7da1f5570dddc35f2a352f0f27c978b06820edca9ef982c35fda2d255afba340068c5035552368bc7200c1488ffffffff0100093d00000000001976a9148edb68822f1ad580b043c7b3df2e400f8699eb4888ac00000000\"), SER_NETWORK, PROTOCOL_VERSION);\n    stream >> block;\n\n    CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_P2PUBKEY_ONLY);\n    // Match the generation pubkey\n    filter.insert(ParseHex(\"04eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91\"));\n    // ...and the output address of the 4th transaction\n    filter.insert(ParseHex(\"b6efd80d99179f4f4ff6f4dd0a007d018c385d21\"));\n\n    CMerkleBlock merkleBlock(block, filter);\n    BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash());\n\n    // We should match the generation outpoint\n    BOOST_CHECK(filter.contains(COutPoint(uint256S(\"0x147caa76786596590baa4e98f5d9f48b86c7765e489f7a6ff3360fe5c674360b\"), 0)));\n    // ... but not the 4th transaction's output (its not pay-2-pubkey)\n    BOOST_CHECK(!filter.contains(COutPoint(uint256S(\"0x02981fa052f0481dbc5868f4fc2166035a10f27a03cfd2de67326471df5bc041\"), 0)));\n}\n\nBOOST_AUTO_TEST_CASE(merkle_block_4_test_update_none)\n{\n    // Random real block (000000000000b731f2eef9e8c63173adfb07e41bd53eb0ef0a6b720d6cb6dea4)\n    // With 7 txes\n    CBlock block;\n    CDataStream stream(ParseHex(\"0100000082bb869cf3a793432a66e826e05a6fc37469f8efb7421dc880670100000000007f16c5962e8bd963659c793ce370d95f093bc7e367117b3c30c1f8fdd0d9728776381b4d4c86041b554b85290701000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b0136ffffffff0100f2052a01000000434104eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91ac000000000100000001bcad20a6a29827d1424f08989255120bf7f3e9e3cdaaa6bb31b0737fe048724300000000494830450220356e834b046cadc0f8ebb5a8a017b02de59c86305403dad52cd77b55af062ea10221009253cd6c119d4729b77c978e1e2aa19f5ea6e0e52b3f16e32fa608cd5bab753901ffffffff02008d380c010000001976a9142b4b8072ecbba129b6453c63e129e643207249ca88ac0065cd1d000000001976a9141b8dd13b994bcfc787b32aeadf58ccb3615cbd5488ac000000000100000003fdacf9b3eb077412e7a968d2e4f11b9a9dee312d666187ed77ee7d26af16cb0b000000008c493046022100ea1608e70911ca0de5af51ba57ad23b9a51db8d28f82c53563c56a05c20f5a87022100a8bdc8b4a8acc8634c6b420410150775eb7f2474f5615f7fccd65af30f310fbf01410465fdf49e29b06b9a1582287b6279014f834edc317695d125ef623c1cc3aaece245bd69fcad7508666e9c74a49dc9056d5fc14338ef38118dc4afae5fe2c585caffffffff309e1913634ecb50f3c4f83e96e70b2df071b497b8973a3e75429df397b5af83000000004948304502202bdb79c596a9ffc24e96f4386199aba386e9bc7b6071516e2b51dda942b3a1ed022100c53a857e76b724fc14d45311eac5019650d415c3abb5428f3aae16d8e69bec2301ffffffff2089e33491695080c9edc18a428f7d834db5b6d372df13ce2b1b0e0cbcb1e6c10000000049483045022100d4ce67c5896ee251c810ac1ff9ceccd328b497c8f553ab6e08431e7d40bad6b5022033119c0c2b7d792d31f1187779c7bd95aefd93d90a715586d73801d9b47471c601ffffffff0100714460030000001976a914c7b55141d097ea5df7a0ed330cf794376e53ec8d88ac0000000001000000045bf0e214aa4069a3e792ecee1e1bf0c1d397cde8dd08138f4b72a00681743447000000008b48304502200c45de8c4f3e2c1821f2fc878cba97b1e6f8807d94930713aa1c86a67b9bf1e40221008581abfef2e30f957815fc89978423746b2086375ca8ecf359c85c2a5b7c88ad01410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffffd669f7d7958d40fc59d2253d88e0f248e29b599c80bbcec344a83dda5f9aa72c000000008a473044022078124c8beeaa825f9e0b30bff96e564dd859432f2d0cb3b72d3d5d93d38d7e930220691d233b6c0f995be5acb03d70a7f7a65b6bc9bdd426260f38a1346669507a3601410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95fffffffff878af0d93f5229a68166cf051fd372bb7a537232946e0a46f53636b4dafdaa4000000008c493046022100c717d1714551663f69c3c5759bdbb3a0fcd3fab023abc0e522fe6440de35d8290221008d9cbe25bffc44af2b18e81c58eb37293fd7fe1c2e7b46fc37ee8c96c50ab1e201410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff27f2b668859cd7f2f894aa0fd2d9e60963bcd07c88973f425f999b8cbfd7a1e2000000008c493046022100e00847147cbf517bcc2f502f3ddc6d284358d102ed20d47a8aa788a62f0db780022100d17b2d6fa84dcaf1c95d88d7e7c30385aecf415588d749afd3ec81f6022cecd701410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff0100c817a8040000001976a914b6efd80d99179f4f4ff6f4dd0a007d018c385d2188ac000000000100000001834537b2f1ce8ef9373a258e10545ce5a50b758df616cd4356e0032554ebd3c4000000008b483045022100e68f422dd7c34fdce11eeb4509ddae38201773dd62f284e8aa9d96f85099d0b002202243bd399ff96b649a0fad05fa759d6a882f0af8c90cf7632c2840c29070aec20141045e58067e815c2f464c6a2a15f987758374203895710c2d452442e28496ff38ba8f5fd901dc20e29e88477167fe4fc299bf818fd0d9e1632d467b2a3d9503b1aaffffffff0280d7e636030000001976a914f34c3e10eb387efe872acb614c89e78bfca7815d88ac404b4c00000000001976a914a84e272933aaf87e1715d7786c51dfaeb5b65a6f88ac00000000010000000143ac81c8e6f6ef307dfe17f3d906d999e23e0189fda838c5510d850927e03ae7000000008c4930460221009c87c344760a64cb8ae6685a3eec2c1ac1bed5b88c87de51acd0e124f266c16602210082d07c037359c3a257b5c63ebd90f5a5edf97b2ac1c434b08ca998839f346dd40141040ba7e521fa7946d12edbb1d1e95a15c34bd4398195e86433c92b431cd315f455fe30032ede69cad9d1e1ed6c3c4ec0dbfced53438c625462afb792dcb098544bffffffff0240420f00000000001976a9144676d1b820d63ec272f1900d59d43bc6463d96f888ac40420f00000000001976a914648d04341d00d7968b3405c034adc38d4d8fb9bd88ac00000000010000000248cc917501ea5c55f4a8d2009c0567c40cfe037c2e71af017d0a452ff705e3f1000000008b483045022100bf5fdc86dc5f08a5d5c8e43a8c9d5b1ed8c65562e280007b52b133021acd9acc02205e325d613e555f772802bf413d36ba807892ed1a690a77811d3033b3de226e0a01410429fa713b124484cb2bd7b5557b2c0b9df7b2b1fee61825eadc5ae6c37a9920d38bfccdc7dc3cb0c47d7b173dbc9db8d37db0a33ae487982c59c6f8606e9d1791ffffffff41ed70551dd7e841883ab8f0b16bf04176b7d1480e4f0af9f3d4c3595768d068000000008b4830450221008513ad65187b903aed1102d1d0c47688127658c51106753fed0151ce9c16b80902201432b9ebcb87bd04ceb2de66035fbbaf4bf8b00d1cfe41f1a1f7338f9ad79d210141049d4cf80125bf50be1709f718c07ad15d0fc612b7da1f5570dddc35f2a352f0f27c978b06820edca9ef982c35fda2d255afba340068c5035552368bc7200c1488ffffffff0100093d00000000001976a9148edb68822f1ad580b043c7b3df2e400f8699eb4888ac00000000\"), SER_NETWORK, PROTOCOL_VERSION);\n    stream >> block;\n\n    CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_NONE);\n    // Match the generation pubkey\n    filter.insert(ParseHex(\"04eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91\"));\n    // ...and the output address of the 4th transaction\n    filter.insert(ParseHex(\"b6efd80d99179f4f4ff6f4dd0a007d018c385d21\"));\n\n    CMerkleBlock merkleBlock(block, filter);\n    BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash());\n\n    // We shouldn't match any outpoints (UPDATE_NONE)\n    BOOST_CHECK(!filter.contains(COutPoint(uint256S(\"0x147caa76786596590baa4e98f5d9f48b86c7765e489f7a6ff3360fe5c674360b\"), 0)));\n    BOOST_CHECK(!filter.contains(COutPoint(uint256S(\"0x02981fa052f0481dbc5868f4fc2166035a10f27a03cfd2de67326471df5bc041\"), 0)));\n}\n\nstatic std::vector<unsigned char> RandomData()\n{\n    uint256 r = InsecureRand256();\n    return std::vector<unsigned char>(r.begin(), r.end());\n}\n\nBOOST_AUTO_TEST_CASE(rolling_bloom)\n{\n    // last-100-entry, 1% false positive:\n    CRollingBloomFilter rb1(100, 0.01);\n\n    // Overfill:\n    static const int DATASIZE=399;\n    std::vector<unsigned char> data[DATASIZE];\n    for (int i = 0; i < DATASIZE; i++) {\n        data[i] = RandomData();\n        rb1.insert(data[i]);\n    }\n    // Last 100 guaranteed to be remembered:\n    for (int i = 299; i < DATASIZE; i++) {\n        BOOST_CHECK(rb1.contains(data[i]));\n    }\n\n    // false positive rate is 1%, so we should get about 100 hits if\n    // testing 10,000 random keys. We get worst-case false positive\n    // behavior when the filter is as full as possible, which is\n    // when we've inserted one minus an integer multiple of nElement*2.\n    unsigned int nHits = 0;\n    for (int i = 0; i < 10000; i++) {\n        if (rb1.contains(RandomData()))\n            ++nHits;\n    }\n    // Run test_bitcoin with --log_level=message to see BOOST_TEST_MESSAGEs:\n    BOOST_TEST_MESSAGE(\"RollingBloomFilter got \" << nHits << \" false positives (~100 expected)\");\n\n    // Insanely unlikely to get a fp count outside this range:\n    BOOST_CHECK(nHits > 25);\n    BOOST_CHECK(nHits < 175);\n\n    BOOST_CHECK(rb1.contains(data[DATASIZE-1]));\n    rb1.reset();\n    BOOST_CHECK(!rb1.contains(data[DATASIZE-1]));\n\n    // Now roll through data, make sure last 100 entries\n    // are always remembered:\n    for (int i = 0; i < DATASIZE; i++) {\n        if (i >= 100)\n            BOOST_CHECK(rb1.contains(data[i-100]));\n        rb1.insert(data[i]);\n        BOOST_CHECK(rb1.contains(data[i]));\n    }\n\n    // Insert 999 more random entries:\n    for (int i = 0; i < 999; i++) {\n        std::vector<unsigned char> d = RandomData();\n        rb1.insert(d);\n        BOOST_CHECK(rb1.contains(d));\n    }\n    // Sanity check to make sure the filter isn't just filling up:\n    nHits = 0;\n    for (int i = 0; i < DATASIZE; i++) {\n        if (rb1.contains(data[i]))\n            ++nHits;\n    }\n    // Expect about 5 false positives, more than 100 means\n    // something is definitely broken.\n    BOOST_TEST_MESSAGE(\"RollingBloomFilter got \" << nHits << \" false positives (~5 expected)\");\n    BOOST_CHECK(nHits < 100);\n\n    // last-1000-entry, 0.01% false positive:\n    CRollingBloomFilter rb2(1000, 0.001);\n    for (int i = 0; i < DATASIZE; i++) {\n        rb2.insert(data[i]);\n    }\n    // ... room for all of them:\n    for (int i = 0; i < DATASIZE; i++) {\n        BOOST_CHECK(rb2.contains(data[i]));\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/bswap_tests.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <compat/byteswap.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(bswap_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(bswap_tests)\n{\n\t// Sibling in bitcoin/src/qt/test/compattests.cpp\n\tuint16_t u1 = 0x1234;\n\tuint32_t u2 = 0x56789abc;\n\tuint64_t u3 = 0xdef0123456789abc;\n\tuint16_t e1 = 0x3412;\n\tuint32_t e2 = 0xbc9a7856;\n\tuint64_t e3 = 0xbc9a78563412f0de;\n\tBOOST_CHECK(bswap_16(u1) == e1);\n\tBOOST_CHECK(bswap_32(u2) == e2);\n\tBOOST_CHECK(bswap_64(u3) == e3);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/checkqueue_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <util.h>\n#include <utiltime.h>\n#include <validation.h>\n\n#include <test/test_bitcoin.h>\n#include <checkqueue.h>\n#include <boost/test/unit_test.hpp>\n#include <boost/thread.hpp>\n#include <atomic>\n#include <thread>\n#include <vector>\n#include <mutex>\n#include <condition_variable>\n\n#include <unordered_set>\n#include <memory>\n#include <random.h>\n\n// BasicTestingSetup not sufficient because nScriptCheckThreads is not set\n// otherwise.\nBOOST_FIXTURE_TEST_SUITE(checkqueue_tests, TestingSetup)\n\nstatic const unsigned int QUEUE_BATCH_SIZE = 128;\n\nstruct FakeCheck {\n    bool operator()()\n    {\n        return true;\n    }\n    void swap(FakeCheck& x){};\n};\n\nstruct FakeCheckCheckCompletion {\n    static std::atomic<size_t> n_calls;\n    bool operator()()\n    {\n        n_calls.fetch_add(1, std::memory_order_relaxed);\n        return true;\n    }\n    void swap(FakeCheckCheckCompletion& x){};\n};\n\nstruct FailingCheck {\n    bool fails;\n    FailingCheck(bool _fails) : fails(_fails){};\n    FailingCheck() : fails(true){};\n    bool operator()()\n    {\n        return !fails;\n    }\n    void swap(FailingCheck& x)\n    {\n        std::swap(fails, x.fails);\n    };\n};\n\nstruct UniqueCheck {\n    static std::mutex m;\n    static std::unordered_multiset<size_t> results;\n    size_t check_id;\n    UniqueCheck(size_t check_id_in) : check_id(check_id_in){};\n    UniqueCheck() : check_id(0){};\n    bool operator()()\n    {\n        std::lock_guard<std::mutex> l(m);\n        results.insert(check_id);\n        return true;\n    }\n    void swap(UniqueCheck& x) { std::swap(x.check_id, check_id); };\n};\n\n\nstruct MemoryCheck {\n    static std::atomic<size_t> fake_allocated_memory;\n    bool b {false};\n    bool operator()()\n    {\n        return true;\n    }\n    MemoryCheck(){};\n    MemoryCheck(const MemoryCheck& x)\n    {\n        // We have to do this to make sure that destructor calls are paired\n        //\n        // Really, copy constructor should be deletable, but CCheckQueue breaks\n        // if it is deleted because of internal push_back.\n        fake_allocated_memory.fetch_add(b, std::memory_order_relaxed);\n    };\n    MemoryCheck(bool b_) : b(b_)\n    {\n        fake_allocated_memory.fetch_add(b, std::memory_order_relaxed);\n    };\n    ~MemoryCheck()\n    {\n        fake_allocated_memory.fetch_sub(b, std::memory_order_relaxed);\n    };\n    void swap(MemoryCheck& x) { std::swap(b, x.b); };\n};\n\nstruct FrozenCleanupCheck {\n    static std::atomic<uint64_t> nFrozen;\n    static std::condition_variable cv;\n    static std::mutex m;\n    // Freezing can't be the default initialized behavior given how the queue\n    // swaps in default initialized Checks.\n    bool should_freeze {false};\n    bool operator()()\n    {\n        return true;\n    }\n    FrozenCleanupCheck() {}\n    ~FrozenCleanupCheck()\n    {\n        if (should_freeze) {\n            std::unique_lock<std::mutex> l(m);\n            nFrozen.store(1, std::memory_order_relaxed);\n            cv.notify_one();\n            cv.wait(l, []{ return nFrozen.load(std::memory_order_relaxed) == 0;});\n        }\n    }\n    void swap(FrozenCleanupCheck& x){std::swap(should_freeze, x.should_freeze);};\n};\n\n// Static Allocations\nstd::mutex FrozenCleanupCheck::m{};\nstd::atomic<uint64_t> FrozenCleanupCheck::nFrozen{0};\nstd::condition_variable FrozenCleanupCheck::cv{};\nstd::mutex UniqueCheck::m;\nstd::unordered_multiset<size_t> UniqueCheck::results;\nstd::atomic<size_t> FakeCheckCheckCompletion::n_calls{0};\nstd::atomic<size_t> MemoryCheck::fake_allocated_memory{0};\n\n// Queue Typedefs\ntypedef CCheckQueue<FakeCheckCheckCompletion> Correct_Queue;\ntypedef CCheckQueue<FakeCheck> Standard_Queue;\ntypedef CCheckQueue<FailingCheck> Failing_Queue;\ntypedef CCheckQueue<UniqueCheck> Unique_Queue;\ntypedef CCheckQueue<MemoryCheck> Memory_Queue;\ntypedef CCheckQueue<FrozenCleanupCheck> FrozenCleanup_Queue;\n\n\n/** This test case checks that the CCheckQueue works properly\n * with each specified size_t Checks pushed.\n */\nvoid Correct_Queue_range(std::vector<size_t> range)\n{\n    auto small_queue = std::unique_ptr<Correct_Queue>(new Correct_Queue {QUEUE_BATCH_SIZE});\n    boost::thread_group tg;\n    for (auto x = 0; x < nScriptCheckThreads; ++x) {\n       tg.create_thread([&]{small_queue->Thread();});\n    }\n    // Make vChecks here to save on malloc (this test can be slow...)\n    std::vector<FakeCheckCheckCompletion> vChecks;\n    for (auto i : range) {\n        size_t total = i;\n        FakeCheckCheckCompletion::n_calls = 0;\n        CCheckQueueControl<FakeCheckCheckCompletion> control(small_queue.get());\n        while (total) {\n            vChecks.resize(std::min(total, (size_t) InsecureRandRange(10)));\n            total -= vChecks.size();\n            control.Add(vChecks);\n        }\n        BOOST_REQUIRE(control.Wait());\n        if (FakeCheckCheckCompletion::n_calls != i) {\n            BOOST_REQUIRE_EQUAL(FakeCheckCheckCompletion::n_calls, i);\n            BOOST_TEST_MESSAGE(\"Failure on trial \" << i << \" expected, got \" << FakeCheckCheckCompletion::n_calls);\n        }\n    }\n    tg.interrupt_all();\n    tg.join_all();\n}\n\n/** Test that 0 checks is correct\n */\nBOOST_AUTO_TEST_CASE(test_CheckQueue_Correct_Zero)\n{\n    std::vector<size_t> range;\n    range.push_back((size_t)0);\n    Correct_Queue_range(range);\n}\n/** Test that 1 check is correct\n */\nBOOST_AUTO_TEST_CASE(test_CheckQueue_Correct_One)\n{\n    std::vector<size_t> range;\n    range.push_back((size_t)1);\n    Correct_Queue_range(range);\n}\n/** Test that MAX check is correct\n */\nBOOST_AUTO_TEST_CASE(test_CheckQueue_Correct_Max)\n{\n    std::vector<size_t> range;\n    range.push_back(100000);\n    Correct_Queue_range(range);\n}\n/** Test that random numbers of checks are correct\n */\nBOOST_AUTO_TEST_CASE(test_CheckQueue_Correct_Random)\n{\n    std::vector<size_t> range;\n    range.reserve(100000/1000);\n    for (size_t i = 2; i < 100000; i += std::max((size_t)1, (size_t)InsecureRandRange(std::min((size_t)1000, ((size_t)100000) - i))))\n        range.push_back(i);\n    Correct_Queue_range(range);\n}\n\n\n/** Test that failing checks are caught */\nBOOST_AUTO_TEST_CASE(test_CheckQueue_Catches_Failure)\n{\n    auto fail_queue = std::unique_ptr<Failing_Queue>(new Failing_Queue {QUEUE_BATCH_SIZE});\n\n    boost::thread_group tg;\n    for (auto x = 0; x < nScriptCheckThreads; ++x) {\n       tg.create_thread([&]{fail_queue->Thread();});\n    }\n\n    for (size_t i = 0; i < 1001; ++i) {\n        CCheckQueueControl<FailingCheck> control(fail_queue.get());\n        size_t remaining = i;\n        while (remaining) {\n            size_t r = InsecureRandRange(10);\n\n            std::vector<FailingCheck> vChecks;\n            vChecks.reserve(r);\n            for (size_t k = 0; k < r && remaining; k++, remaining--)\n                vChecks.emplace_back(remaining == 1);\n            control.Add(vChecks);\n        }\n        bool success = control.Wait();\n        if (i > 0) {\n            BOOST_REQUIRE(!success);\n        } else if (i == 0) {\n            BOOST_REQUIRE(success);\n        }\n    }\n    tg.interrupt_all();\n    tg.join_all();\n}\n// Test that a block validation which fails does not interfere with\n// future blocks, ie, the bad state is cleared.\nBOOST_AUTO_TEST_CASE(test_CheckQueue_Recovers_From_Failure)\n{\n    auto fail_queue = std::unique_ptr<Failing_Queue>(new Failing_Queue {QUEUE_BATCH_SIZE});\n    boost::thread_group tg;\n    for (auto x = 0; x < nScriptCheckThreads; ++x) {\n       tg.create_thread([&]{fail_queue->Thread();});\n    }\n\n    for (auto times = 0; times < 10; ++times) {\n        for (bool end_fails : {true, false}) {\n            CCheckQueueControl<FailingCheck> control(fail_queue.get());\n            {\n                std::vector<FailingCheck> vChecks;\n                vChecks.resize(100, false);\n                vChecks[99] = end_fails;\n                control.Add(vChecks);\n            }\n            bool r =control.Wait();\n            BOOST_REQUIRE(r != end_fails);\n        }\n    }\n    tg.interrupt_all();\n    tg.join_all();\n}\n\n// Test that unique checks are actually all called individually, rather than\n// just one check being called repeatedly. Test that checks are not called\n// more than once as well\nBOOST_AUTO_TEST_CASE(test_CheckQueue_UniqueCheck)\n{\n    auto queue = std::unique_ptr<Unique_Queue>(new Unique_Queue {QUEUE_BATCH_SIZE});\n    boost::thread_group tg;\n    for (auto x = 0; x < nScriptCheckThreads; ++x) {\n       tg.create_thread([&]{queue->Thread();});\n\n    }\n\n    size_t COUNT = 100000;\n    size_t total = COUNT;\n    {\n        CCheckQueueControl<UniqueCheck> control(queue.get());\n        while (total) {\n            size_t r = InsecureRandRange(10);\n            std::vector<UniqueCheck> vChecks;\n            for (size_t k = 0; k < r && total; k++)\n                vChecks.emplace_back(--total);\n            control.Add(vChecks);\n        }\n    }\n    bool r = true;\n    BOOST_REQUIRE_EQUAL(UniqueCheck::results.size(), COUNT);\n    for (size_t i = 0; i < COUNT; ++i)\n        r = r && UniqueCheck::results.count(i) == 1;\n    BOOST_REQUIRE(r);\n    tg.interrupt_all();\n    tg.join_all();\n}\n\n\n// Test that blocks which might allocate lots of memory free their memory aggressively.\n//\n// This test attempts to catch a pathological case where by lazily freeing\n// checks might mean leaving a check un-swapped out, and decreasing by 1 each\n// time could leave the data hanging across a sequence of blocks.\nBOOST_AUTO_TEST_CASE(test_CheckQueue_Memory)\n{\n    auto queue = std::unique_ptr<Memory_Queue>(new Memory_Queue {QUEUE_BATCH_SIZE});\n    boost::thread_group tg;\n    for (auto x = 0; x < nScriptCheckThreads; ++x) {\n       tg.create_thread([&]{queue->Thread();});\n    }\n    for (size_t i = 0; i < 1000; ++i) {\n        size_t total = i;\n        {\n            CCheckQueueControl<MemoryCheck> control(queue.get());\n            while (total) {\n                size_t r = InsecureRandRange(10);\n                std::vector<MemoryCheck> vChecks;\n                for (size_t k = 0; k < r && total; k++) {\n                    total--;\n                    // Each iteration leaves data at the front, back, and middle\n                    // to catch any sort of deallocation failure\n                    vChecks.emplace_back(total == 0 || total == i || total == i/2);\n                }\n                control.Add(vChecks);\n            }\n        }\n        BOOST_REQUIRE_EQUAL(MemoryCheck::fake_allocated_memory, 0);\n    }\n    tg.interrupt_all();\n    tg.join_all();\n}\n\n// Test that a new verification cannot occur until all checks\n// have been destructed\nBOOST_AUTO_TEST_CASE(test_CheckQueue_FrozenCleanup)\n{\n    auto queue = std::unique_ptr<FrozenCleanup_Queue>(new FrozenCleanup_Queue {QUEUE_BATCH_SIZE});\n    boost::thread_group tg;\n    bool fails = false;\n    for (auto x = 0; x < nScriptCheckThreads; ++x) {\n        tg.create_thread([&]{queue->Thread();});\n    }\n    std::thread t0([&]() {\n        CCheckQueueControl<FrozenCleanupCheck> control(queue.get());\n        std::vector<FrozenCleanupCheck> vChecks(1);\n        // Freezing can't be the default initialized behavior given how the queue\n        // swaps in default initialized Checks (otherwise freezing destructor\n        // would get called twice).\n        vChecks[0].should_freeze = true;\n        control.Add(vChecks);\n        control.Wait(); // Hangs here\n    });\n    {\n        std::unique_lock<std::mutex> l(FrozenCleanupCheck::m);\n        // Wait until the queue has finished all jobs and frozen\n        FrozenCleanupCheck::cv.wait(l, [](){return FrozenCleanupCheck::nFrozen == 1;});\n    }\n    // Try to get control of the queue a bunch of times\n    for (auto x = 0; x < 100 && !fails; ++x) {\n        fails = queue->ControlMutex.try_lock();\n    }\n    {\n        // Unfreeze (we need lock n case of spurious wakeup)\n        std::unique_lock<std::mutex> l(FrozenCleanupCheck::m);\n        FrozenCleanupCheck::nFrozen = 0;\n    }\n    // Awaken frozen destructor\n    FrozenCleanupCheck::cv.notify_one();\n    // Wait for control to finish\n    t0.join();\n    tg.interrupt_all();\n    tg.join_all();\n    BOOST_REQUIRE(!fails);\n}\n\n\n/** Test that CCheckQueueControl is threadsafe */\nBOOST_AUTO_TEST_CASE(test_CheckQueueControl_Locks)\n{\n    auto queue = std::unique_ptr<Standard_Queue>(new Standard_Queue{QUEUE_BATCH_SIZE});\n    {\n        boost::thread_group tg;\n        std::atomic<int> nThreads {0};\n        std::atomic<int> fails {0};\n        for (size_t i = 0; i < 3; ++i) {\n            tg.create_thread(\n                    [&]{\n                    CCheckQueueControl<FakeCheck> control(queue.get());\n                    // While sleeping, no other thread should execute to this point\n                    auto observed = ++nThreads;\n                    MilliSleep(10);\n                    fails += observed  != nThreads;\n                    });\n        }\n        tg.join_all();\n        BOOST_REQUIRE_EQUAL(fails, 0);\n    }\n    {\n        boost::thread_group tg;\n        std::mutex m;\n        std::condition_variable cv;\n        {\n            bool has_lock {false};\n            bool has_tried {false};\n            bool done {false};\n            bool done_ack {false};\n            std::unique_lock<std::mutex> l(m);\n            tg.create_thread([&]{\n                    CCheckQueueControl<FakeCheck> control(queue.get());\n                    std::unique_lock<std::mutex> ll(m);\n                    has_lock = true;\n                    cv.notify_one();\n                    cv.wait(ll, [&]{return has_tried;});\n                    done = true;\n                    cv.notify_one();\n                    // Wait until the done is acknowledged\n                    //\n                    cv.wait(ll, [&]{return done_ack;});\n                    });\n            // Wait for thread to get the lock\n            cv.wait(l, [&](){return has_lock;});\n            bool fails = false;\n            for (auto x = 0; x < 100 && !fails; ++x) {\n                fails = queue->ControlMutex.try_lock();\n            }\n            has_tried = true;\n            cv.notify_one();\n            cv.wait(l, [&](){return done;});\n            // Acknowledge the done\n            done_ack = true;\n            cv.notify_one();\n            BOOST_REQUIRE(!fails);\n        }\n        tg.join_all();\n    }\n}\nBOOST_AUTO_TEST_SUITE_END()\n\n"
  },
  {
    "path": "src/test/coins_tests.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <coins.h>\n#include <script/standard.h>\n#include <uint256.h>\n#include <undo.h>\n#include <utilstrencodings.h>\n#include <test/test_bitcoin.h>\n#include <validation.h>\n#include <consensus/validation.h>\n\n#include <vector>\n#include <map>\n\n#include <boost/test/unit_test.hpp>\n\nint ApplyTxInUndo(Coin&& undo, CCoinsViewCache& view, const COutPoint& out);\nvoid UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txundo, int nHeight);\n\nnamespace\n{\n//! equality test\nbool operator==(const Coin &a, const Coin &b) {\n    // Empty Coin objects are always equal.\n    if (a.IsSpent() && b.IsSpent()) return true;\n    return a.fCoinBase == b.fCoinBase &&\n           a.nHeight == b.nHeight &&\n           a.out == b.out;\n}\n\nclass CCoinsViewTest : public CCoinsView\n{\n    uint256 hashBestBlock_;\n    std::map<COutPoint, Coin> map_;\n\npublic:\n    bool GetCoin(const COutPoint& outpoint, Coin& coin) const override\n    {\n        std::map<COutPoint, Coin>::const_iterator it = map_.find(outpoint);\n        if (it == map_.end()) {\n            return false;\n        }\n        coin = it->second;\n        if (coin.IsSpent() && InsecureRandBool() == 0) {\n            // Randomly return false in case of an empty entry.\n            return false;\n        }\n        return true;\n    }\n\n    uint256 GetBestBlock() const override { return hashBestBlock_; }\n\n    bool BatchWrite(CCoinsMap& mapCoins, const uint256& hashBlock) override\n    {\n        for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end(); ) {\n            if (it->second.flags & CCoinsCacheEntry::DIRTY) {\n                // Same optimization used in CCoinsViewDB is to only write dirty entries.\n                map_[it->first] = it->second.coin;\n                if (it->second.coin.IsSpent() && InsecureRandRange(3) == 0) {\n                    // Randomly delete empty entries on write.\n                    map_.erase(it->first);\n                }\n            }\n            mapCoins.erase(it++);\n        }\n        if (!hashBlock.IsNull())\n            hashBestBlock_ = hashBlock;\n        return true;\n    }\n};\n\nclass CCoinsViewCacheTest : public CCoinsViewCache\n{\npublic:\n    explicit CCoinsViewCacheTest(CCoinsView* _base) : CCoinsViewCache(_base) {}\n\n    void SelfTest() const\n    {\n        // Manually recompute the dynamic usage of the whole data, and compare it.\n        size_t ret = memusage::DynamicUsage(cacheCoins);\n        size_t count = 0;\n        for (const auto& entry : cacheCoins) {\n            ret += entry.second.coin.DynamicMemoryUsage();\n            ++count;\n        }\n        BOOST_CHECK_EQUAL(GetCacheSize(), count);\n        BOOST_CHECK_EQUAL(DynamicMemoryUsage(), ret);\n    }\n\n    CCoinsMap& map() const { return cacheCoins; }\n    size_t& usage() const { return cachedCoinsUsage; }\n};\n\n} // namespace\n\nBOOST_FIXTURE_TEST_SUITE(coins_tests, BasicTestingSetup)\n\nstatic const unsigned int NUM_SIMULATION_ITERATIONS = 40000;\n\n// This is a large randomized insert/remove simulation test on a variable-size\n// stack of caches on top of CCoinsViewTest.\n//\n// It will randomly create/update/delete Coin entries to a tip of caches, with\n// txids picked from a limited list of random 256-bit hashes. Occasionally, a\n// new tip is added to the stack of caches, or the tip is flushed and removed.\n//\n// During the process, booleans are kept to make sure that the randomized\n// operation hits all branches.\nBOOST_AUTO_TEST_CASE(coins_cache_simulation_test)\n{\n    // Various coverage trackers.\n    bool removed_all_caches = false;\n    bool reached_4_caches = false;\n    bool added_an_entry = false;\n    bool added_an_unspendable_entry = false;\n    bool removed_an_entry = false;\n    bool updated_an_entry = false;\n    bool found_an_entry = false;\n    bool missed_an_entry = false;\n    bool uncached_an_entry = false;\n\n    // A simple map to track what we expect the cache stack to represent.\n    std::map<COutPoint, Coin> result;\n\n    // The cache stack.\n    CCoinsViewTest base; // A CCoinsViewTest at the bottom.\n    std::vector<CCoinsViewCacheTest*> stack; // A stack of CCoinsViewCaches on top.\n    stack.push_back(new CCoinsViewCacheTest(&base)); // Start with one cache.\n\n    // Use a limited set of random transaction ids, so we do test overwriting entries.\n    std::vector<uint256> txids;\n    txids.resize(NUM_SIMULATION_ITERATIONS / 8);\n    for (unsigned int i = 0; i < txids.size(); i++) {\n        txids[i] = InsecureRand256();\n    }\n\n    for (unsigned int i = 0; i < NUM_SIMULATION_ITERATIONS; i++) {\n        // Do a random modification.\n        {\n            uint256 txid = txids[InsecureRandRange(txids.size())]; // txid we're going to modify in this iteration.\n            Coin& coin = result[COutPoint(txid, 0)];\n\n            // Determine whether to test HaveCoin before or after Access* (or both). As these functions\n            // can influence each other's behaviour by pulling things into the cache, all combinations\n            // are tested.\n            bool test_havecoin_before = InsecureRandBits(2) == 0;\n            bool test_havecoin_after = InsecureRandBits(2) == 0;\n\n            bool result_havecoin = test_havecoin_before ? stack.back()->HaveCoin(COutPoint(txid, 0)) : false;\n            const Coin& entry = (InsecureRandRange(500) == 0) ? AccessByTxid(*stack.back(), txid) : stack.back()->AccessCoin(COutPoint(txid, 0));\n            BOOST_CHECK(coin == entry);\n            BOOST_CHECK(!test_havecoin_before || result_havecoin == !entry.IsSpent());\n\n            if (test_havecoin_after) {\n                bool ret = stack.back()->HaveCoin(COutPoint(txid, 0));\n                BOOST_CHECK(ret == !entry.IsSpent());\n            }\n\n            if (InsecureRandRange(5) == 0 || coin.IsSpent()) {\n                Coin newcoin;\n                newcoin.out.nValue = InsecureRand32();\n                newcoin.nHeight = 1;\n                if (InsecureRandRange(16) == 0 && coin.IsSpent()) {\n                    newcoin.out.scriptPubKey.assign(1 + InsecureRandBits(6), OP_RETURN);\n                    BOOST_CHECK(newcoin.out.scriptPubKey.IsUnspendable());\n                    added_an_unspendable_entry = true;\n                } else {\n                    newcoin.out.scriptPubKey.assign(InsecureRandBits(6), 0); // Random sizes so we can test memory usage accounting\n                    (coin.IsSpent() ? added_an_entry : updated_an_entry) = true;\n                    coin = newcoin;\n                }\n                stack.back()->AddCoin(COutPoint(txid, 0), std::move(newcoin), !coin.IsSpent() || InsecureRand32() & 1);\n            } else {\n                removed_an_entry = true;\n                coin.Clear();\n                stack.back()->SpendCoin(COutPoint(txid, 0));\n            }\n        }\n\n        // One every 10 iterations, remove a random entry from the cache\n        if (InsecureRandRange(10) == 0) {\n            COutPoint out(txids[InsecureRand32() % txids.size()], 0);\n            int cacheid = InsecureRand32() % stack.size();\n            stack[cacheid]->Uncache(out);\n            uncached_an_entry |= !stack[cacheid]->HaveCoinInCache(out);\n        }\n\n        // Once every 1000 iterations and at the end, verify the full cache.\n        if (InsecureRandRange(1000) == 1 || i == NUM_SIMULATION_ITERATIONS - 1) {\n            for (const auto& entry : result) {\n                bool have = stack.back()->HaveCoin(entry.first);\n                const Coin& coin = stack.back()->AccessCoin(entry.first);\n                BOOST_CHECK(have == !coin.IsSpent());\n                BOOST_CHECK(coin == entry.second);\n                if (coin.IsSpent()) {\n                    missed_an_entry = true;\n                } else {\n                    BOOST_CHECK(stack.back()->HaveCoinInCache(entry.first));\n                    found_an_entry = true;\n                }\n            }\n            for (const CCoinsViewCacheTest *test : stack) {\n                test->SelfTest();\n            }\n        }\n\n        if (InsecureRandRange(100) == 0) {\n            // Every 100 iterations, flush an intermediate cache\n            if (stack.size() > 1 && InsecureRandBool() == 0) {\n                unsigned int flushIndex = InsecureRandRange(stack.size() - 1);\n                stack[flushIndex]->Flush();\n            }\n        }\n        if (InsecureRandRange(100) == 0) {\n            // Every 100 iterations, change the cache stack.\n            if (stack.size() > 0 && InsecureRandBool() == 0) {\n                //Remove the top cache\n                stack.back()->Flush();\n                delete stack.back();\n                stack.pop_back();\n            }\n            if (stack.size() == 0 || (stack.size() < 4 && InsecureRandBool())) {\n                //Add a new cache\n                CCoinsView* tip = &base;\n                if (stack.size() > 0) {\n                    tip = stack.back();\n                } else {\n                    removed_all_caches = true;\n                }\n                stack.push_back(new CCoinsViewCacheTest(tip));\n                if (stack.size() == 4) {\n                    reached_4_caches = true;\n                }\n            }\n        }\n    }\n\n    // Clean up the stack.\n    while (stack.size() > 0) {\n        delete stack.back();\n        stack.pop_back();\n    }\n\n    // Verify coverage.\n    BOOST_CHECK(removed_all_caches);\n    BOOST_CHECK(reached_4_caches);\n    BOOST_CHECK(added_an_entry);\n    BOOST_CHECK(added_an_unspendable_entry);\n    BOOST_CHECK(removed_an_entry);\n    BOOST_CHECK(updated_an_entry);\n    BOOST_CHECK(found_an_entry);\n    BOOST_CHECK(missed_an_entry);\n    BOOST_CHECK(uncached_an_entry);\n}\n\n// Store of all necessary tx and undo data for next test\ntypedef std::map<COutPoint, std::tuple<CTransaction,CTxUndo,Coin>> UtxoData;\nUtxoData utxoData;\n\nUtxoData::iterator FindRandomFrom(const std::set<COutPoint> &utxoSet) {\n    assert(utxoSet.size());\n    auto utxoSetIt = utxoSet.lower_bound(COutPoint(InsecureRand256(), 0));\n    if (utxoSetIt == utxoSet.end()) {\n        utxoSetIt = utxoSet.begin();\n    }\n    auto utxoDataIt = utxoData.find(*utxoSetIt);\n    assert(utxoDataIt != utxoData.end());\n    return utxoDataIt;\n}\n\n\n// This test is similar to the previous test\n// except the emphasis is on testing the functionality of UpdateCoins\n// random txs are created and UpdateCoins is used to update the cache stack\n// In particular it is tested that spending a duplicate coinbase tx\n// has the expected effect (the other duplicate is overwritten at all cache levels)\nBOOST_AUTO_TEST_CASE(updatecoins_simulation_test)\n{\n    bool spent_a_duplicate_coinbase = false;\n    // A simple map to track what we expect the cache stack to represent.\n    std::map<COutPoint, Coin> result;\n\n    // The cache stack.\n    CCoinsViewTest base; // A CCoinsViewTest at the bottom.\n    std::vector<CCoinsViewCacheTest*> stack; // A stack of CCoinsViewCaches on top.\n    stack.push_back(new CCoinsViewCacheTest(&base)); // Start with one cache.\n\n    // Track the txids we've used in various sets\n    std::set<COutPoint> coinbase_coins;\n    std::set<COutPoint> disconnected_coins;\n    std::set<COutPoint> duplicate_coins;\n    std::set<COutPoint> utxoset;\n\n    for (unsigned int i = 0; i < NUM_SIMULATION_ITERATIONS; i++) {\n        uint32_t randiter = InsecureRand32();\n\n        // 19/20 txs add a new transaction\n        if (randiter % 20 < 19) {\n            CMutableTransaction tx;\n            tx.vin.resize(1);\n            tx.vout.resize(1);\n            tx.vout[0].nValue = i; //Keep txs unique unless intended to duplicate\n            tx.vout[0].scriptPubKey.assign(InsecureRand32() & 0x3F, 0); // Random sizes so we can test memory usage accounting\n            unsigned int height = InsecureRand32();\n            Coin old_coin;\n\n            // 2/20 times create a new coinbase\n            if (randiter % 20 < 2 || coinbase_coins.size() < 10) {\n                // 1/10 of those times create a duplicate coinbase\n                if (InsecureRandRange(10) == 0 && coinbase_coins.size()) {\n                    auto utxod = FindRandomFrom(coinbase_coins);\n                    // Reuse the exact same coinbase\n                    tx = std::get<0>(utxod->second);\n                    // shouldn't be available for reconnection if its been duplicated\n                    disconnected_coins.erase(utxod->first);\n\n                    duplicate_coins.insert(utxod->first);\n                }\n                else {\n                    coinbase_coins.insert(COutPoint(tx.GetHash(), 0));\n                }\n                assert(CTransaction(tx).IsCoinBase());\n            }\n\n            // 17/20 times reconnect previous or add a regular tx\n            else {\n\n                COutPoint prevout;\n                // 1/20 times reconnect a previously disconnected tx\n                if (randiter % 20 == 2 && disconnected_coins.size()) {\n                    auto utxod = FindRandomFrom(disconnected_coins);\n                    tx = std::get<0>(utxod->second);\n                    prevout = tx.vin[0].prevout;\n                    if (!CTransaction(tx).IsCoinBase() && !utxoset.count(prevout)) {\n                        disconnected_coins.erase(utxod->first);\n                        continue;\n                    }\n\n                    // If this tx is already IN the UTXO, then it must be a coinbase, and it must be a duplicate\n                    if (utxoset.count(utxod->first)) {\n                        assert(CTransaction(tx).IsCoinBase());\n                        assert(duplicate_coins.count(utxod->first));\n                    }\n                    disconnected_coins.erase(utxod->first);\n                }\n\n                // 16/20 times create a regular tx\n                else {\n                    auto utxod = FindRandomFrom(utxoset);\n                    prevout = utxod->first;\n\n                    // Construct the tx to spend the coins of prevouthash\n                    tx.vin[0].prevout = prevout;\n                    assert(!CTransaction(tx).IsCoinBase());\n                }\n                // In this simple test coins only have two states, spent or unspent, save the unspent state to restore\n                old_coin = result[prevout];\n                // Update the expected result of prevouthash to know these coins are spent\n                result[prevout].Clear();\n\n                utxoset.erase(prevout);\n\n                // The test is designed to ensure spending a duplicate coinbase will work properly\n                // if that ever happens and not resurrect the previously overwritten coinbase\n                if (duplicate_coins.count(prevout)) {\n                    spent_a_duplicate_coinbase = true;\n                }\n\n            }\n            // Update the expected result to know about the new output coins\n            assert(tx.vout.size() == 1);\n            const COutPoint outpoint(tx.GetHash(), 0);\n            result[outpoint] = Coin(tx.vout[0], height, CTransaction(tx).IsCoinBase());\n\n            // Call UpdateCoins on the top cache\n            CTxUndo undo;\n            UpdateCoins(tx, *(stack.back()), undo, height);\n\n            // Update the utxo set for future spends\n            utxoset.insert(outpoint);\n\n            // Track this tx and undo info to use later\n            utxoData.emplace(outpoint, std::make_tuple(tx,undo,old_coin));\n        } else if (utxoset.size()) {\n            //1/20 times undo a previous transaction\n            auto utxod = FindRandomFrom(utxoset);\n\n            CTransaction &tx = std::get<0>(utxod->second);\n            CTxUndo &undo = std::get<1>(utxod->second);\n            Coin &orig_coin = std::get<2>(utxod->second);\n\n            // Update the expected result\n            // Remove new outputs\n            result[utxod->first].Clear();\n            // If not coinbase restore prevout\n            if (!tx.IsCoinBase()) {\n                result[tx.vin[0].prevout] = orig_coin;\n            }\n\n            // Disconnect the tx from the current UTXO\n            // See code in DisconnectBlock\n            // remove outputs\n            stack.back()->SpendCoin(utxod->first);\n            // restore inputs\n            if (!tx.IsCoinBase()) {\n                const COutPoint &out = tx.vin[0].prevout;\n                Coin coin = undo.vprevout[0];\n                ApplyTxInUndo(std::move(coin), *(stack.back()), out);\n            }\n            // Store as a candidate for reconnection\n            disconnected_coins.insert(utxod->first);\n\n            // Update the utxoset\n            utxoset.erase(utxod->first);\n            if (!tx.IsCoinBase())\n                utxoset.insert(tx.vin[0].prevout);\n        }\n\n        // Once every 1000 iterations and at the end, verify the full cache.\n        if (InsecureRandRange(1000) == 1 || i == NUM_SIMULATION_ITERATIONS - 1) {\n            for (const auto& entry : result) {\n                bool have = stack.back()->HaveCoin(entry.first);\n                const Coin& coin = stack.back()->AccessCoin(entry.first);\n                BOOST_CHECK(have == !coin.IsSpent());\n                BOOST_CHECK(coin == entry.second);\n            }\n        }\n\n        // One every 10 iterations, remove a random entry from the cache\n        if (utxoset.size() > 1 && InsecureRandRange(30) == 0) {\n            stack[InsecureRand32() % stack.size()]->Uncache(FindRandomFrom(utxoset)->first);\n        }\n        if (disconnected_coins.size() > 1 && InsecureRandRange(30) == 0) {\n            stack[InsecureRand32() % stack.size()]->Uncache(FindRandomFrom(disconnected_coins)->first);\n        }\n        if (duplicate_coins.size() > 1 && InsecureRandRange(30) == 0) {\n            stack[InsecureRand32() % stack.size()]->Uncache(FindRandomFrom(duplicate_coins)->first);\n        }\n\n        if (InsecureRandRange(100) == 0) {\n            // Every 100 iterations, flush an intermediate cache\n            if (stack.size() > 1 && InsecureRandBool() == 0) {\n                unsigned int flushIndex = InsecureRandRange(stack.size() - 1);\n                stack[flushIndex]->Flush();\n            }\n        }\n        if (InsecureRandRange(100) == 0) {\n            // Every 100 iterations, change the cache stack.\n            if (stack.size() > 0 && InsecureRandBool() == 0) {\n                stack.back()->Flush();\n                delete stack.back();\n                stack.pop_back();\n            }\n            if (stack.size() == 0 || (stack.size() < 4 && InsecureRandBool())) {\n                CCoinsView* tip = &base;\n                if (stack.size() > 0) {\n                    tip = stack.back();\n                }\n                stack.push_back(new CCoinsViewCacheTest(tip));\n            }\n        }\n    }\n\n    // Clean up the stack.\n    while (stack.size() > 0) {\n        delete stack.back();\n        stack.pop_back();\n    }\n\n    // Verify coverage.\n    BOOST_CHECK(spent_a_duplicate_coinbase);\n}\n\nBOOST_AUTO_TEST_CASE(ccoins_serialization)\n{\n    // Good example\n    CDataStream ss1(ParseHex(\"97f23c835800816115944e077fe7c803cfa57f29b36bf87c1d35\"), SER_DISK, CLIENT_VERSION);\n    Coin cc1;\n    ss1 >> cc1;\n    BOOST_CHECK_EQUAL(cc1.fCoinBase, false);\n    BOOST_CHECK_EQUAL(cc1.nHeight, 203998);\n    BOOST_CHECK_EQUAL(cc1.out.nValue, 60000000000ULL);\n    BOOST_CHECK_EQUAL(HexStr(cc1.out.scriptPubKey), HexStr(GetScriptForDestination(CKeyID(uint160(ParseHex(\"816115944e077fe7c803cfa57f29b36bf87c1d35\"))))));\n\n    // Good example\n    CDataStream ss2(ParseHex(\"8ddf77bbd123008c988f1a4a4de2161e0f50aac7f17e7f9555caa4\"), SER_DISK, CLIENT_VERSION);\n    Coin cc2;\n    ss2 >> cc2;\n    BOOST_CHECK_EQUAL(cc2.fCoinBase, true);\n    BOOST_CHECK_EQUAL(cc2.nHeight, 120891);\n    BOOST_CHECK_EQUAL(cc2.out.nValue, 110397);\n    BOOST_CHECK_EQUAL(HexStr(cc2.out.scriptPubKey), HexStr(GetScriptForDestination(CKeyID(uint160(ParseHex(\"8c988f1a4a4de2161e0f50aac7f17e7f9555caa4\"))))));\n\n    // Smallest possible example\n    CDataStream ss3(ParseHex(\"000006\"), SER_DISK, CLIENT_VERSION);\n    Coin cc3;\n    ss3 >> cc3;\n    BOOST_CHECK_EQUAL(cc3.fCoinBase, false);\n    BOOST_CHECK_EQUAL(cc3.nHeight, 0);\n    BOOST_CHECK_EQUAL(cc3.out.nValue, 0);\n    BOOST_CHECK_EQUAL(cc3.out.scriptPubKey.size(), 0);\n\n    // scriptPubKey that ends beyond the end of the stream\n    CDataStream ss4(ParseHex(\"000007\"), SER_DISK, CLIENT_VERSION);\n    try {\n        Coin cc4;\n        ss4 >> cc4;\n        BOOST_CHECK_MESSAGE(false, \"We should have thrown\");\n    } catch (const std::ios_base::failure& e) {\n    }\n\n    // Very large scriptPubKey (3*10^9 bytes) past the end of the stream\n    CDataStream tmp(SER_DISK, CLIENT_VERSION);\n    uint64_t x = 3000000000ULL;\n    tmp << VARINT(x);\n    BOOST_CHECK_EQUAL(HexStr(tmp.begin(), tmp.end()), \"8a95c0bb00\");\n    CDataStream ss5(ParseHex(\"00008a95c0bb00\"), SER_DISK, CLIENT_VERSION);\n    try {\n        Coin cc5;\n        ss5 >> cc5;\n        BOOST_CHECK_MESSAGE(false, \"We should have thrown\");\n    } catch (const std::ios_base::failure& e) {\n    }\n}\n\nconst static COutPoint OUTPOINT;\nconst static CAmount PRUNED = -1;\nconst static CAmount ABSENT = -2;\nconst static CAmount FAIL = -3;\nconst static CAmount VALUE1 = 100;\nconst static CAmount VALUE2 = 200;\nconst static CAmount VALUE3 = 300;\nconst static char DIRTY = CCoinsCacheEntry::DIRTY;\nconst static char FRESH = CCoinsCacheEntry::FRESH;\nconst static char NO_ENTRY = -1;\n\nconst static auto FLAGS = {char(0), FRESH, DIRTY, char(DIRTY | FRESH)};\nconst static auto CLEAN_FLAGS = {char(0), FRESH};\nconst static auto ABSENT_FLAGS = {NO_ENTRY};\n\nvoid SetCoinsValue(CAmount value, Coin& coin)\n{\n    assert(value != ABSENT);\n    coin.Clear();\n    assert(coin.IsSpent());\n    if (value != PRUNED) {\n        coin.out.nValue = value;\n        coin.nHeight = 1;\n        assert(!coin.IsSpent());\n    }\n}\n\nsize_t InsertCoinsMapEntry(CCoinsMap& map, CAmount value, char flags)\n{\n    if (value == ABSENT) {\n        assert(flags == NO_ENTRY);\n        return 0;\n    }\n    assert(flags != NO_ENTRY);\n    CCoinsCacheEntry entry;\n    entry.flags = flags;\n    SetCoinsValue(value, entry.coin);\n    auto inserted = map.emplace(OUTPOINT, std::move(entry));\n    assert(inserted.second);\n    return inserted.first->second.coin.DynamicMemoryUsage();\n}\n\nvoid GetCoinsMapEntry(const CCoinsMap& map, CAmount& value, char& flags)\n{\n    auto it = map.find(OUTPOINT);\n    if (it == map.end()) {\n        value = ABSENT;\n        flags = NO_ENTRY;\n    } else {\n        if (it->second.coin.IsSpent()) {\n            value = PRUNED;\n        } else {\n            value = it->second.coin.out.nValue;\n        }\n        flags = it->second.flags;\n        assert(flags != NO_ENTRY);\n    }\n}\n\nvoid WriteCoinsViewEntry(CCoinsView& view, CAmount value, char flags)\n{\n    CCoinsMap map;\n    InsertCoinsMapEntry(map, value, flags);\n    view.BatchWrite(map, {});\n}\n\nclass SingleEntryCacheTest\n{\npublic:\n    SingleEntryCacheTest(CAmount base_value, CAmount cache_value, char cache_flags)\n    {\n        WriteCoinsViewEntry(base, base_value, base_value == ABSENT ? NO_ENTRY : DIRTY);\n        cache.usage() += InsertCoinsMapEntry(cache.map(), cache_value, cache_flags);\n    }\n\n    CCoinsView root;\n    CCoinsViewCacheTest base{&root};\n    CCoinsViewCacheTest cache{&base};\n};\n\nvoid CheckAccessCoin(CAmount base_value, CAmount cache_value, CAmount expected_value, char cache_flags, char expected_flags)\n{\n    SingleEntryCacheTest test(base_value, cache_value, cache_flags);\n    test.cache.AccessCoin(OUTPOINT);\n    test.cache.SelfTest();\n\n    CAmount result_value;\n    char result_flags;\n    GetCoinsMapEntry(test.cache.map(), result_value, result_flags);\n    BOOST_CHECK_EQUAL(result_value, expected_value);\n    BOOST_CHECK_EQUAL(result_flags, expected_flags);\n}\n\nBOOST_AUTO_TEST_CASE(ccoins_access)\n{\n    /* Check AccessCoin behavior, requesting a coin from a cache view layered on\n     * top of a base view, and checking the resulting entry in the cache after\n     * the access.\n     *\n     *               Base    Cache   Result  Cache        Result\n     *               Value   Value   Value   Flags        Flags\n     */\n    CheckAccessCoin(ABSENT, ABSENT, ABSENT, NO_ENTRY   , NO_ENTRY   );\n    CheckAccessCoin(ABSENT, PRUNED, PRUNED, 0          , 0          );\n    CheckAccessCoin(ABSENT, PRUNED, PRUNED, FRESH      , FRESH      );\n    CheckAccessCoin(ABSENT, PRUNED, PRUNED, DIRTY      , DIRTY      );\n    CheckAccessCoin(ABSENT, PRUNED, PRUNED, DIRTY|FRESH, DIRTY|FRESH);\n    CheckAccessCoin(ABSENT, VALUE2, VALUE2, 0          , 0          );\n    CheckAccessCoin(ABSENT, VALUE2, VALUE2, FRESH      , FRESH      );\n    CheckAccessCoin(ABSENT, VALUE2, VALUE2, DIRTY      , DIRTY      );\n    CheckAccessCoin(ABSENT, VALUE2, VALUE2, DIRTY|FRESH, DIRTY|FRESH);\n    CheckAccessCoin(PRUNED, ABSENT, ABSENT, NO_ENTRY   , NO_ENTRY   );\n    CheckAccessCoin(PRUNED, PRUNED, PRUNED, 0          , 0          );\n    CheckAccessCoin(PRUNED, PRUNED, PRUNED, FRESH      , FRESH      );\n    CheckAccessCoin(PRUNED, PRUNED, PRUNED, DIRTY      , DIRTY      );\n    CheckAccessCoin(PRUNED, PRUNED, PRUNED, DIRTY|FRESH, DIRTY|FRESH);\n    CheckAccessCoin(PRUNED, VALUE2, VALUE2, 0          , 0          );\n    CheckAccessCoin(PRUNED, VALUE2, VALUE2, FRESH      , FRESH      );\n    CheckAccessCoin(PRUNED, VALUE2, VALUE2, DIRTY      , DIRTY      );\n    CheckAccessCoin(PRUNED, VALUE2, VALUE2, DIRTY|FRESH, DIRTY|FRESH);\n    CheckAccessCoin(VALUE1, ABSENT, VALUE1, NO_ENTRY   , 0          );\n    CheckAccessCoin(VALUE1, PRUNED, PRUNED, 0          , 0          );\n    CheckAccessCoin(VALUE1, PRUNED, PRUNED, FRESH      , FRESH      );\n    CheckAccessCoin(VALUE1, PRUNED, PRUNED, DIRTY      , DIRTY      );\n    CheckAccessCoin(VALUE1, PRUNED, PRUNED, DIRTY|FRESH, DIRTY|FRESH);\n    CheckAccessCoin(VALUE1, VALUE2, VALUE2, 0          , 0          );\n    CheckAccessCoin(VALUE1, VALUE2, VALUE2, FRESH      , FRESH      );\n    CheckAccessCoin(VALUE1, VALUE2, VALUE2, DIRTY      , DIRTY      );\n    CheckAccessCoin(VALUE1, VALUE2, VALUE2, DIRTY|FRESH, DIRTY|FRESH);\n}\n\nvoid CheckSpendCoins(CAmount base_value, CAmount cache_value, CAmount expected_value, char cache_flags, char expected_flags)\n{\n    SingleEntryCacheTest test(base_value, cache_value, cache_flags);\n    test.cache.SpendCoin(OUTPOINT);\n    test.cache.SelfTest();\n\n    CAmount result_value;\n    char result_flags;\n    GetCoinsMapEntry(test.cache.map(), result_value, result_flags);\n    BOOST_CHECK_EQUAL(result_value, expected_value);\n    BOOST_CHECK_EQUAL(result_flags, expected_flags);\n};\n\nBOOST_AUTO_TEST_CASE(ccoins_spend)\n{\n    /* Check SpendCoin behavior, requesting a coin from a cache view layered on\n     * top of a base view, spending, and then checking\n     * the resulting entry in the cache after the modification.\n     *\n     *              Base    Cache   Result  Cache        Result\n     *              Value   Value   Value   Flags        Flags\n     */\n    CheckSpendCoins(ABSENT, ABSENT, ABSENT, NO_ENTRY   , NO_ENTRY   );\n    CheckSpendCoins(ABSENT, PRUNED, PRUNED, 0          , DIRTY      );\n    CheckSpendCoins(ABSENT, PRUNED, ABSENT, FRESH      , NO_ENTRY   );\n    CheckSpendCoins(ABSENT, PRUNED, PRUNED, DIRTY      , DIRTY      );\n    CheckSpendCoins(ABSENT, PRUNED, ABSENT, DIRTY|FRESH, NO_ENTRY   );\n    CheckSpendCoins(ABSENT, VALUE2, PRUNED, 0          , DIRTY      );\n    CheckSpendCoins(ABSENT, VALUE2, ABSENT, FRESH      , NO_ENTRY   );\n    CheckSpendCoins(ABSENT, VALUE2, PRUNED, DIRTY      , DIRTY      );\n    CheckSpendCoins(ABSENT, VALUE2, ABSENT, DIRTY|FRESH, NO_ENTRY   );\n    CheckSpendCoins(PRUNED, ABSENT, ABSENT, NO_ENTRY   , NO_ENTRY   );\n    CheckSpendCoins(PRUNED, PRUNED, PRUNED, 0          , DIRTY      );\n    CheckSpendCoins(PRUNED, PRUNED, ABSENT, FRESH      , NO_ENTRY   );\n    CheckSpendCoins(PRUNED, PRUNED, PRUNED, DIRTY      , DIRTY      );\n    CheckSpendCoins(PRUNED, PRUNED, ABSENT, DIRTY|FRESH, NO_ENTRY   );\n    CheckSpendCoins(PRUNED, VALUE2, PRUNED, 0          , DIRTY      );\n    CheckSpendCoins(PRUNED, VALUE2, ABSENT, FRESH      , NO_ENTRY   );\n    CheckSpendCoins(PRUNED, VALUE2, PRUNED, DIRTY      , DIRTY      );\n    CheckSpendCoins(PRUNED, VALUE2, ABSENT, DIRTY|FRESH, NO_ENTRY   );\n    CheckSpendCoins(VALUE1, ABSENT, PRUNED, NO_ENTRY   , DIRTY      );\n    CheckSpendCoins(VALUE1, PRUNED, PRUNED, 0          , DIRTY      );\n    CheckSpendCoins(VALUE1, PRUNED, ABSENT, FRESH      , NO_ENTRY   );\n    CheckSpendCoins(VALUE1, PRUNED, PRUNED, DIRTY      , DIRTY      );\n    CheckSpendCoins(VALUE1, PRUNED, ABSENT, DIRTY|FRESH, NO_ENTRY   );\n    CheckSpendCoins(VALUE1, VALUE2, PRUNED, 0          , DIRTY      );\n    CheckSpendCoins(VALUE1, VALUE2, ABSENT, FRESH      , NO_ENTRY   );\n    CheckSpendCoins(VALUE1, VALUE2, PRUNED, DIRTY      , DIRTY      );\n    CheckSpendCoins(VALUE1, VALUE2, ABSENT, DIRTY|FRESH, NO_ENTRY   );\n}\n\nvoid CheckAddCoinBase(CAmount base_value, CAmount cache_value, CAmount modify_value, CAmount expected_value, char cache_flags, char expected_flags, bool coinbase)\n{\n    SingleEntryCacheTest test(base_value, cache_value, cache_flags);\n\n    CAmount result_value;\n    char result_flags;\n    try {\n        CTxOut output;\n        output.nValue = modify_value;\n        test.cache.AddCoin(OUTPOINT, Coin(std::move(output), 1, coinbase), coinbase);\n        test.cache.SelfTest();\n        GetCoinsMapEntry(test.cache.map(), result_value, result_flags);\n    } catch (std::logic_error& e) {\n        result_value = FAIL;\n        result_flags = NO_ENTRY;\n    }\n\n    BOOST_CHECK_EQUAL(result_value, expected_value);\n    BOOST_CHECK_EQUAL(result_flags, expected_flags);\n}\n\n// Simple wrapper for CheckAddCoinBase function above that loops through\n// different possible base_values, making sure each one gives the same results.\n// This wrapper lets the coins_add test below be shorter and less repetitive,\n// while still verifying that the CoinsViewCache::AddCoin implementation\n// ignores base values.\ntemplate <typename... Args>\nvoid CheckAddCoin(Args&&... args)\n{\n    for (CAmount base_value : {ABSENT, PRUNED, VALUE1})\n        CheckAddCoinBase(base_value, std::forward<Args>(args)...);\n}\n\nBOOST_AUTO_TEST_CASE(ccoins_add)\n{\n    /* Check AddCoin behavior, requesting a new coin from a cache view,\n     * writing a modification to the coin, and then checking the resulting\n     * entry in the cache after the modification. Verify behavior with the\n     * with the AddCoin potential_overwrite argument set to false, and to true.\n     *\n     *           Cache   Write   Result  Cache        Result       potential_overwrite\n     *           Value   Value   Value   Flags        Flags\n     */\n    CheckAddCoin(ABSENT, VALUE3, VALUE3, NO_ENTRY   , DIRTY|FRESH, false);\n    CheckAddCoin(ABSENT, VALUE3, VALUE3, NO_ENTRY   , DIRTY      , true );\n    CheckAddCoin(PRUNED, VALUE3, VALUE3, 0          , DIRTY|FRESH, false);\n    CheckAddCoin(PRUNED, VALUE3, VALUE3, 0          , DIRTY      , true );\n    CheckAddCoin(PRUNED, VALUE3, VALUE3, FRESH      , DIRTY|FRESH, false);\n    CheckAddCoin(PRUNED, VALUE3, VALUE3, FRESH      , DIRTY|FRESH, true );\n    CheckAddCoin(PRUNED, VALUE3, VALUE3, DIRTY      , DIRTY      , false);\n    CheckAddCoin(PRUNED, VALUE3, VALUE3, DIRTY      , DIRTY      , true );\n    CheckAddCoin(PRUNED, VALUE3, VALUE3, DIRTY|FRESH, DIRTY|FRESH, false);\n    CheckAddCoin(PRUNED, VALUE3, VALUE3, DIRTY|FRESH, DIRTY|FRESH, true );\n    CheckAddCoin(VALUE2, VALUE3, FAIL  , 0          , NO_ENTRY   , false);\n    CheckAddCoin(VALUE2, VALUE3, VALUE3, 0          , DIRTY      , true );\n    CheckAddCoin(VALUE2, VALUE3, FAIL  , FRESH      , NO_ENTRY   , false);\n    CheckAddCoin(VALUE2, VALUE3, VALUE3, FRESH      , DIRTY|FRESH, true );\n    CheckAddCoin(VALUE2, VALUE3, FAIL  , DIRTY      , NO_ENTRY   , false);\n    CheckAddCoin(VALUE2, VALUE3, VALUE3, DIRTY      , DIRTY      , true );\n    CheckAddCoin(VALUE2, VALUE3, FAIL  , DIRTY|FRESH, NO_ENTRY   , false);\n    CheckAddCoin(VALUE2, VALUE3, VALUE3, DIRTY|FRESH, DIRTY|FRESH, true );\n}\n\nvoid CheckWriteCoins(CAmount parent_value, CAmount child_value, CAmount expected_value, char parent_flags, char child_flags, char expected_flags)\n{\n    SingleEntryCacheTest test(ABSENT, parent_value, parent_flags);\n\n    CAmount result_value;\n    char result_flags;\n    try {\n        WriteCoinsViewEntry(test.cache, child_value, child_flags);\n        test.cache.SelfTest();\n        GetCoinsMapEntry(test.cache.map(), result_value, result_flags);\n    } catch (std::logic_error& e) {\n        result_value = FAIL;\n        result_flags = NO_ENTRY;\n    }\n\n    BOOST_CHECK_EQUAL(result_value, expected_value);\n    BOOST_CHECK_EQUAL(result_flags, expected_flags);\n}\n\nBOOST_AUTO_TEST_CASE(ccoins_write)\n{\n    /* Check BatchWrite behavior, flushing one entry from a child cache to a\n     * parent cache, and checking the resulting entry in the parent cache\n     * after the write.\n     *\n     *              Parent  Child   Result  Parent       Child        Result\n     *              Value   Value   Value   Flags        Flags        Flags\n     */\n    CheckWriteCoins(ABSENT, ABSENT, ABSENT, NO_ENTRY   , NO_ENTRY   , NO_ENTRY   );\n    CheckWriteCoins(ABSENT, PRUNED, PRUNED, NO_ENTRY   , DIRTY      , DIRTY      );\n    CheckWriteCoins(ABSENT, PRUNED, ABSENT, NO_ENTRY   , DIRTY|FRESH, NO_ENTRY   );\n    CheckWriteCoins(ABSENT, VALUE2, VALUE2, NO_ENTRY   , DIRTY      , DIRTY      );\n    CheckWriteCoins(ABSENT, VALUE2, VALUE2, NO_ENTRY   , DIRTY|FRESH, DIRTY|FRESH);\n    CheckWriteCoins(PRUNED, ABSENT, PRUNED, 0          , NO_ENTRY   , 0          );\n    CheckWriteCoins(PRUNED, ABSENT, PRUNED, FRESH      , NO_ENTRY   , FRESH      );\n    CheckWriteCoins(PRUNED, ABSENT, PRUNED, DIRTY      , NO_ENTRY   , DIRTY      );\n    CheckWriteCoins(PRUNED, ABSENT, PRUNED, DIRTY|FRESH, NO_ENTRY   , DIRTY|FRESH);\n    CheckWriteCoins(PRUNED, PRUNED, PRUNED, 0          , DIRTY      , DIRTY      );\n    CheckWriteCoins(PRUNED, PRUNED, PRUNED, 0          , DIRTY|FRESH, DIRTY      );\n    CheckWriteCoins(PRUNED, PRUNED, ABSENT, FRESH      , DIRTY      , NO_ENTRY   );\n    CheckWriteCoins(PRUNED, PRUNED, ABSENT, FRESH      , DIRTY|FRESH, NO_ENTRY   );\n    CheckWriteCoins(PRUNED, PRUNED, PRUNED, DIRTY      , DIRTY      , DIRTY      );\n    CheckWriteCoins(PRUNED, PRUNED, PRUNED, DIRTY      , DIRTY|FRESH, DIRTY      );\n    CheckWriteCoins(PRUNED, PRUNED, ABSENT, DIRTY|FRESH, DIRTY      , NO_ENTRY   );\n    CheckWriteCoins(PRUNED, PRUNED, ABSENT, DIRTY|FRESH, DIRTY|FRESH, NO_ENTRY   );\n    CheckWriteCoins(PRUNED, VALUE2, VALUE2, 0          , DIRTY      , DIRTY      );\n    CheckWriteCoins(PRUNED, VALUE2, VALUE2, 0          , DIRTY|FRESH, DIRTY      );\n    CheckWriteCoins(PRUNED, VALUE2, VALUE2, FRESH      , DIRTY      , DIRTY|FRESH);\n    CheckWriteCoins(PRUNED, VALUE2, VALUE2, FRESH      , DIRTY|FRESH, DIRTY|FRESH);\n    CheckWriteCoins(PRUNED, VALUE2, VALUE2, DIRTY      , DIRTY      , DIRTY      );\n    CheckWriteCoins(PRUNED, VALUE2, VALUE2, DIRTY      , DIRTY|FRESH, DIRTY      );\n    CheckWriteCoins(PRUNED, VALUE2, VALUE2, DIRTY|FRESH, DIRTY      , DIRTY|FRESH);\n    CheckWriteCoins(PRUNED, VALUE2, VALUE2, DIRTY|FRESH, DIRTY|FRESH, DIRTY|FRESH);\n    CheckWriteCoins(VALUE1, ABSENT, VALUE1, 0          , NO_ENTRY   , 0          );\n    CheckWriteCoins(VALUE1, ABSENT, VALUE1, FRESH      , NO_ENTRY   , FRESH      );\n    CheckWriteCoins(VALUE1, ABSENT, VALUE1, DIRTY      , NO_ENTRY   , DIRTY      );\n    CheckWriteCoins(VALUE1, ABSENT, VALUE1, DIRTY|FRESH, NO_ENTRY   , DIRTY|FRESH);\n    CheckWriteCoins(VALUE1, PRUNED, PRUNED, 0          , DIRTY      , DIRTY      );\n    CheckWriteCoins(VALUE1, PRUNED, FAIL  , 0          , DIRTY|FRESH, NO_ENTRY   );\n    CheckWriteCoins(VALUE1, PRUNED, ABSENT, FRESH      , DIRTY      , NO_ENTRY   );\n    CheckWriteCoins(VALUE1, PRUNED, FAIL  , FRESH      , DIRTY|FRESH, NO_ENTRY   );\n    CheckWriteCoins(VALUE1, PRUNED, PRUNED, DIRTY      , DIRTY      , DIRTY      );\n    CheckWriteCoins(VALUE1, PRUNED, FAIL  , DIRTY      , DIRTY|FRESH, NO_ENTRY   );\n    CheckWriteCoins(VALUE1, PRUNED, ABSENT, DIRTY|FRESH, DIRTY      , NO_ENTRY   );\n    CheckWriteCoins(VALUE1, PRUNED, FAIL  , DIRTY|FRESH, DIRTY|FRESH, NO_ENTRY   );\n    CheckWriteCoins(VALUE1, VALUE2, VALUE2, 0          , DIRTY      , DIRTY      );\n    CheckWriteCoins(VALUE1, VALUE2, FAIL  , 0          , DIRTY|FRESH, NO_ENTRY   );\n    CheckWriteCoins(VALUE1, VALUE2, VALUE2, FRESH      , DIRTY      , DIRTY|FRESH);\n    CheckWriteCoins(VALUE1, VALUE2, FAIL  , FRESH      , DIRTY|FRESH, NO_ENTRY   );\n    CheckWriteCoins(VALUE1, VALUE2, VALUE2, DIRTY      , DIRTY      , DIRTY      );\n    CheckWriteCoins(VALUE1, VALUE2, FAIL  , DIRTY      , DIRTY|FRESH, NO_ENTRY   );\n    CheckWriteCoins(VALUE1, VALUE2, VALUE2, DIRTY|FRESH, DIRTY      , DIRTY|FRESH);\n    CheckWriteCoins(VALUE1, VALUE2, FAIL  , DIRTY|FRESH, DIRTY|FRESH, NO_ENTRY   );\n\n    // The checks above omit cases where the child flags are not DIRTY, since\n    // they would be too repetitive (the parent cache is never updated in these\n    // cases). The loop below covers these cases and makes sure the parent cache\n    // is always left unchanged.\n    for (CAmount parent_value : {ABSENT, PRUNED, VALUE1})\n        for (CAmount child_value : {ABSENT, PRUNED, VALUE2})\n            for (char parent_flags : parent_value == ABSENT ? ABSENT_FLAGS : FLAGS)\n                for (char child_flags : child_value == ABSENT ? ABSENT_FLAGS : CLEAN_FLAGS)\n                    CheckWriteCoins(parent_value, child_value, parent_value, parent_flags, child_flags, parent_flags);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/compress_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <compressor.h>\n#include <util.h>\n#include <test/test_bitcoin.h>\n\n#include <stdint.h>\n\n#include <boost/test/unit_test.hpp>\n\n// amounts 0.00000001 .. 0.00100000\n#define NUM_MULTIPLES_UNIT 100000\n\n// amounts 0.01 .. 100.00\n#define NUM_MULTIPLES_CENT 10000\n\n// amounts 1 .. 10000\n#define NUM_MULTIPLES_1BTC 10000\n\n// amounts 50 .. 21000000\n#define NUM_MULTIPLES_50BTC 420000 // FIXME.SUGAR // but, no error // TEST DISABLED\n\nBOOST_FIXTURE_TEST_SUITE(compress_tests, BasicTestingSetup)\n\nbool static TestEncode(uint64_t in) {\n    return in == CTxOutCompressor::DecompressAmount(CTxOutCompressor::CompressAmount(in));\n}\n\nbool static TestDecode(uint64_t in) {\n    return in == CTxOutCompressor::CompressAmount(CTxOutCompressor::DecompressAmount(in));\n}\n\nbool static TestPair(uint64_t dec, uint64_t enc) {\n    return CTxOutCompressor::CompressAmount(dec) == enc &&\n           CTxOutCompressor::DecompressAmount(enc) == dec;\n}\n\nBOOST_AUTO_TEST_CASE(compress_amounts)\n{\n    BOOST_CHECK(TestPair(            0,       0x0));\n    BOOST_CHECK(TestPair(            1,       0x1));\n    BOOST_CHECK(TestPair(         CENT,       0x7));\n    BOOST_CHECK(TestPair(         COIN,       0x9));\n    BOOST_CHECK(TestPair(      50*COIN,      0x32)); // FIXME.SUGAR // but, no error // TEST DISABLED\n    BOOST_CHECK(TestPair(21000000*COIN, 0x1406f40)); // FIXME.SUGAR // but, no error // TEST DISABLED\n\n    for (uint64_t i = 1; i <= NUM_MULTIPLES_UNIT; i++)\n        BOOST_CHECK(TestEncode(i));\n\n    for (uint64_t i = 1; i <= NUM_MULTIPLES_CENT; i++)\n        BOOST_CHECK(TestEncode(i * CENT));\n\n    for (uint64_t i = 1; i <= NUM_MULTIPLES_1BTC; i++)\n        BOOST_CHECK(TestEncode(i * COIN));\n\n    for (uint64_t i = 1; i <= NUM_MULTIPLES_50BTC; i++)\n        BOOST_CHECK(TestEncode(i * 50 * COIN)); // FIXME.SUGAR // but, no error // TEST DISABLED\n\n    for (uint64_t i = 0; i < 100000; i++)\n        BOOST_CHECK(TestDecode(i));\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/crypto_tests.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <crypto/aes.h>\n#include <crypto/chacha20.h>\n#include <crypto/ripemd160.h>\n#include <crypto/sha1.h>\n#include <crypto/sha256.h>\n#include <crypto/sha512.h>\n#include <crypto/hmac_sha256.h>\n#include <crypto/hmac_sha512.h>\n#include <random.h>\n#include <utilstrencodings.h>\n#include <test/test_bitcoin.h>\n\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n#include <openssl/aes.h>\n#include <openssl/evp.h>\n\nBOOST_FIXTURE_TEST_SUITE(crypto_tests, BasicTestingSetup)\n\ntemplate<typename Hasher, typename In, typename Out>\nvoid TestVector(const Hasher &h, const In &in, const Out &out) {\n    Out hash;\n    BOOST_CHECK(out.size() == h.OUTPUT_SIZE);\n    hash.resize(out.size());\n    {\n        // Test that writing the whole input string at once works.\n        Hasher(h).Write((unsigned char*)&in[0], in.size()).Finalize(&hash[0]);\n        BOOST_CHECK(hash == out);\n    }\n    for (int i=0; i<32; i++) {\n        // Test that writing the string broken up in random pieces works.\n        Hasher hasher(h);\n        size_t pos = 0;\n        while (pos < in.size()) {\n            size_t len = InsecureRandRange((in.size() - pos + 1) / 2 + 1);\n            hasher.Write((unsigned char*)&in[pos], len);\n            pos += len;\n            if (pos > 0 && pos + 2 * out.size() > in.size() && pos < in.size()) {\n                // Test that writing the rest at once to a copy of a hasher works.\n                Hasher(hasher).Write((unsigned char*)&in[pos], in.size() - pos).Finalize(&hash[0]);\n                BOOST_CHECK(hash == out);\n            }\n        }\n        hasher.Finalize(&hash[0]);\n        BOOST_CHECK(hash == out);\n    }\n}\n\nvoid TestSHA1(const std::string &in, const std::string &hexout) { TestVector(CSHA1(), in, ParseHex(hexout));}\nvoid TestSHA256(const std::string &in, const std::string &hexout) { TestVector(CSHA256(), in, ParseHex(hexout));}\nvoid TestSHA512(const std::string &in, const std::string &hexout) { TestVector(CSHA512(), in, ParseHex(hexout));}\nvoid TestRIPEMD160(const std::string &in, const std::string &hexout) { TestVector(CRIPEMD160(), in, ParseHex(hexout));}\n\nvoid TestHMACSHA256(const std::string &hexkey, const std::string &hexin, const std::string &hexout) {\n    std::vector<unsigned char> key = ParseHex(hexkey);\n    TestVector(CHMAC_SHA256(key.data(), key.size()), ParseHex(hexin), ParseHex(hexout));\n}\n\nvoid TestHMACSHA512(const std::string &hexkey, const std::string &hexin, const std::string &hexout) {\n    std::vector<unsigned char> key = ParseHex(hexkey);\n    TestVector(CHMAC_SHA512(key.data(), key.size()), ParseHex(hexin), ParseHex(hexout));\n}\n\nvoid TestAES128(const std::string &hexkey, const std::string &hexin, const std::string &hexout)\n{\n    std::vector<unsigned char> key = ParseHex(hexkey);\n    std::vector<unsigned char> in = ParseHex(hexin);\n    std::vector<unsigned char> correctout = ParseHex(hexout);\n    std::vector<unsigned char> buf, buf2;\n\n    assert(key.size() == 16);\n    assert(in.size() == 16);\n    assert(correctout.size() == 16);\n    AES128Encrypt enc(key.data());\n    buf.resize(correctout.size());\n    buf2.resize(correctout.size());\n    enc.Encrypt(buf.data(), in.data());\n    BOOST_CHECK_EQUAL(HexStr(buf), HexStr(correctout));\n    AES128Decrypt dec(key.data());\n    dec.Decrypt(buf2.data(), buf.data());\n    BOOST_CHECK_EQUAL(HexStr(buf2), HexStr(in));\n}\n\nvoid TestAES256(const std::string &hexkey, const std::string &hexin, const std::string &hexout)\n{\n    std::vector<unsigned char> key = ParseHex(hexkey);\n    std::vector<unsigned char> in = ParseHex(hexin);\n    std::vector<unsigned char> correctout = ParseHex(hexout);\n    std::vector<unsigned char> buf;\n\n    assert(key.size() == 32);\n    assert(in.size() == 16);\n    assert(correctout.size() == 16);\n    AES256Encrypt enc(key.data());\n    buf.resize(correctout.size());\n    enc.Encrypt(buf.data(), in.data());\n    BOOST_CHECK(buf == correctout);\n    AES256Decrypt dec(key.data());\n    dec.Decrypt(buf.data(), buf.data());\n    BOOST_CHECK(buf == in);\n}\n\nvoid TestAES128CBC(const std::string &hexkey, const std::string &hexiv, bool pad, const std::string &hexin, const std::string &hexout)\n{\n    std::vector<unsigned char> key = ParseHex(hexkey);\n    std::vector<unsigned char> iv = ParseHex(hexiv);\n    std::vector<unsigned char> in = ParseHex(hexin);\n    std::vector<unsigned char> correctout = ParseHex(hexout);\n    std::vector<unsigned char> realout(in.size() + AES_BLOCKSIZE);\n\n    // Encrypt the plaintext and verify that it equals the cipher\n    AES128CBCEncrypt enc(key.data(), iv.data(), pad);\n    int size = enc.Encrypt(in.data(), in.size(), realout.data());\n    realout.resize(size);\n    BOOST_CHECK(realout.size() == correctout.size());\n    BOOST_CHECK_MESSAGE(realout == correctout, HexStr(realout) + std::string(\" != \") + hexout);\n\n    // Decrypt the cipher and verify that it equals the plaintext\n    std::vector<unsigned char> decrypted(correctout.size());\n    AES128CBCDecrypt dec(key.data(), iv.data(), pad);\n    size = dec.Decrypt(correctout.data(), correctout.size(), decrypted.data());\n    decrypted.resize(size);\n    BOOST_CHECK(decrypted.size() == in.size());\n    BOOST_CHECK_MESSAGE(decrypted == in, HexStr(decrypted) + std::string(\" != \") + hexin);\n\n    // Encrypt and re-decrypt substrings of the plaintext and verify that they equal each-other\n    for(std::vector<unsigned char>::iterator i(in.begin()); i != in.end(); ++i)\n    {\n        std::vector<unsigned char> sub(i, in.end());\n        std::vector<unsigned char> subout(sub.size() + AES_BLOCKSIZE);\n        int _size = enc.Encrypt(sub.data(), sub.size(), subout.data());\n        if (_size != 0)\n        {\n            subout.resize(_size);\n            std::vector<unsigned char> subdecrypted(subout.size());\n            _size = dec.Decrypt(subout.data(), subout.size(), subdecrypted.data());\n            subdecrypted.resize(_size);\n            BOOST_CHECK(decrypted.size() == in.size());\n            BOOST_CHECK_MESSAGE(subdecrypted == sub, HexStr(subdecrypted) + std::string(\" != \") + HexStr(sub));\n        }\n    }\n}\n\nvoid TestAES256CBC(const std::string &hexkey, const std::string &hexiv, bool pad, const std::string &hexin, const std::string &hexout)\n{\n    std::vector<unsigned char> key = ParseHex(hexkey);\n    std::vector<unsigned char> iv = ParseHex(hexiv);\n    std::vector<unsigned char> in = ParseHex(hexin);\n    std::vector<unsigned char> correctout = ParseHex(hexout);\n    std::vector<unsigned char> realout(in.size() + AES_BLOCKSIZE);\n\n    // Encrypt the plaintext and verify that it equals the cipher\n    AES256CBCEncrypt enc(key.data(), iv.data(), pad);\n    int size = enc.Encrypt(in.data(), in.size(), realout.data());\n    realout.resize(size);\n    BOOST_CHECK(realout.size() == correctout.size());\n    BOOST_CHECK_MESSAGE(realout == correctout, HexStr(realout) + std::string(\" != \") + hexout);\n\n    // Decrypt the cipher and verify that it equals the plaintext\n    std::vector<unsigned char> decrypted(correctout.size());\n    AES256CBCDecrypt dec(key.data(), iv.data(), pad);\n    size = dec.Decrypt(correctout.data(), correctout.size(), decrypted.data());\n    decrypted.resize(size);\n    BOOST_CHECK(decrypted.size() == in.size());\n    BOOST_CHECK_MESSAGE(decrypted == in, HexStr(decrypted) + std::string(\" != \") + hexin);\n\n    // Encrypt and re-decrypt substrings of the plaintext and verify that they equal each-other\n    for(std::vector<unsigned char>::iterator i(in.begin()); i != in.end(); ++i)\n    {\n        std::vector<unsigned char> sub(i, in.end());\n        std::vector<unsigned char> subout(sub.size() + AES_BLOCKSIZE);\n        int _size = enc.Encrypt(sub.data(), sub.size(), subout.data());\n        if (_size != 0)\n        {\n            subout.resize(_size);\n            std::vector<unsigned char> subdecrypted(subout.size());\n            _size = dec.Decrypt(subout.data(), subout.size(), subdecrypted.data());\n            subdecrypted.resize(_size);\n            BOOST_CHECK(decrypted.size() == in.size());\n            BOOST_CHECK_MESSAGE(subdecrypted == sub, HexStr(subdecrypted) + std::string(\" != \") + HexStr(sub));\n        }\n    }\n}\n\nvoid TestChaCha20(const std::string &hexkey, uint64_t nonce, uint64_t seek, const std::string& hexout)\n{\n    std::vector<unsigned char> key = ParseHex(hexkey);\n    ChaCha20 rng(key.data(), key.size());\n    rng.SetIV(nonce);\n    rng.Seek(seek);\n    std::vector<unsigned char> out = ParseHex(hexout);\n    std::vector<unsigned char> outres;\n    outres.resize(out.size());\n    rng.Output(outres.data(), outres.size());\n    BOOST_CHECK(out == outres);\n}\n\nstd::string LongTestString(void) {\n    std::string ret;\n    for (int i=0; i<200000; i++) {\n        ret += (unsigned char)(i);\n        ret += (unsigned char)(i >> 4);\n        ret += (unsigned char)(i >> 8);\n        ret += (unsigned char)(i >> 12);\n        ret += (unsigned char)(i >> 16);\n    }\n    return ret;\n}\n\nconst std::string test1 = LongTestString();\n\nBOOST_AUTO_TEST_CASE(ripemd160_testvectors) {\n    TestRIPEMD160(\"\", \"9c1185a5c5e9fc54612808977ee8f548b2258d31\");\n    TestRIPEMD160(\"abc\", \"8eb208f7e05d987a9b044a8e98c6b087f15a0bfc\");\n    TestRIPEMD160(\"message digest\", \"5d0689ef49d2fae572b881b123a85ffa21595f36\");\n    TestRIPEMD160(\"secure hash algorithm\", \"20397528223b6a5f4cbc2808aba0464e645544f9\");\n    TestRIPEMD160(\"RIPEMD160 is considered to be safe\", \"a7d78608c7af8a8e728778e81576870734122b66\");\n    TestRIPEMD160(\"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\",\n                  \"12a053384a9c0c88e405a06c27dcf49ada62eb2b\");\n    TestRIPEMD160(\"For this sample, this 63-byte string will be used as input data\",\n                  \"de90dbfee14b63fb5abf27c2ad4a82aaa5f27a11\");\n    TestRIPEMD160(\"This is exactly 64 bytes long, not counting the terminating byte\",\n                  \"eda31d51d3a623b81e19eb02e24ff65d27d67b37\");\n    TestRIPEMD160(std::string(1000000, 'a'), \"52783243c1697bdbe16d37f97f68f08325dc1528\");\n    TestRIPEMD160(test1, \"464243587bd146ea835cdf57bdae582f25ec45f1\");\n}\n\nBOOST_AUTO_TEST_CASE(sha1_testvectors) {\n    TestSHA1(\"\", \"da39a3ee5e6b4b0d3255bfef95601890afd80709\");\n    TestSHA1(\"abc\", \"a9993e364706816aba3e25717850c26c9cd0d89d\");\n    TestSHA1(\"message digest\", \"c12252ceda8be8994d5fa0290a47231c1d16aae3\");\n    TestSHA1(\"secure hash algorithm\", \"d4d6d2f0ebe317513bbd8d967d89bac5819c2f60\");\n    TestSHA1(\"SHA1 is considered to be safe\", \"f2b6650569ad3a8720348dd6ea6c497dee3a842a\");\n    TestSHA1(\"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\",\n             \"84983e441c3bd26ebaae4aa1f95129e5e54670f1\");\n    TestSHA1(\"For this sample, this 63-byte string will be used as input data\",\n             \"4f0ea5cd0585a23d028abdc1a6684e5a8094dc49\");\n    TestSHA1(\"This is exactly 64 bytes long, not counting the terminating byte\",\n             \"fb679f23e7d1ce053313e66e127ab1b444397057\");\n    TestSHA1(std::string(1000000, 'a'), \"34aa973cd4c4daa4f61eeb2bdbad27316534016f\");\n    TestSHA1(test1, \"b7755760681cbfd971451668f32af5774f4656b5\");\n}\n\nBOOST_AUTO_TEST_CASE(sha256_testvectors) {\n    TestSHA256(\"\", \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\");\n    TestSHA256(\"abc\", \"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad\");\n    TestSHA256(\"message digest\",\n               \"f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650\");\n    TestSHA256(\"secure hash algorithm\",\n               \"f30ceb2bb2829e79e4ca9753d35a8ecc00262d164cc077080295381cbd643f0d\");\n    TestSHA256(\"SHA256 is considered to be safe\",\n               \"6819d915c73f4d1e77e4e1b52d1fa0f9cf9beaead3939f15874bd988e2a23630\");\n    TestSHA256(\"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\",\n               \"248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1\");\n    TestSHA256(\"For this sample, this 63-byte string will be used as input data\",\n               \"f08a78cbbaee082b052ae0708f32fa1e50c5c421aa772ba5dbb406a2ea6be342\");\n    TestSHA256(\"This is exactly 64 bytes long, not counting the terminating byte\",\n               \"ab64eff7e88e2e46165e29f2bce41826bd4c7b3552f6b382a9e7d3af47c245f8\");\n    TestSHA256(\"As Bitcoin relies on 80 byte header hashes, we want to have an example for that.\",\n               \"7406e8de7d6e4fffc573daef05aefb8806e7790f55eab5576f31349743cca743\");\n    TestSHA256(std::string(1000000, 'a'),\n               \"cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0\");\n    TestSHA256(test1, \"a316d55510b49662420f49d145d42fb83f31ef8dc016aa4e32df049991a91e26\");\n}\n\nBOOST_AUTO_TEST_CASE(sha512_testvectors) {\n    TestSHA512(\"\",\n               \"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce\"\n               \"47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e\");\n    TestSHA512(\"abc\",\n               \"ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a\"\n               \"2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f\");\n    TestSHA512(\"message digest\",\n               \"107dbf389d9e9f71a3a95f6c055b9251bc5268c2be16d6c13492ea45b0199f33\"\n               \"09e16455ab1e96118e8a905d5597b72038ddb372a89826046de66687bb420e7c\");\n    TestSHA512(\"secure hash algorithm\",\n               \"7746d91f3de30c68cec0dd693120a7e8b04d8073cb699bdce1a3f64127bca7a3\"\n               \"d5db502e814bb63c063a7a5043b2df87c61133395f4ad1edca7fcf4b30c3236e\");\n    TestSHA512(\"SHA512 is considered to be safe\",\n               \"099e6468d889e1c79092a89ae925a9499b5408e01b66cb5b0a3bd0dfa51a9964\"\n               \"6b4a3901caab1318189f74cd8cf2e941829012f2449df52067d3dd5b978456c2\");\n    TestSHA512(\"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq\",\n               \"204a8fc6dda82f0a0ced7beb8e08a41657c16ef468b228a8279be331a703c335\"\n               \"96fd15c13b1b07f9aa1d3bea57789ca031ad85c7a71dd70354ec631238ca3445\");\n    TestSHA512(\"For this sample, this 63-byte string will be used as input data\",\n               \"b3de4afbc516d2478fe9b518d063bda6c8dd65fc38402dd81d1eb7364e72fb6e\"\n               \"6663cf6d2771c8f5a6da09601712fb3d2a36c6ffea3e28b0818b05b0a8660766\");\n    TestSHA512(\"This is exactly 64 bytes long, not counting the terminating byte\",\n               \"70aefeaa0e7ac4f8fe17532d7185a289bee3b428d950c14fa8b713ca09814a38\"\n               \"7d245870e007a80ad97c369d193e41701aa07f3221d15f0e65a1ff970cedf030\");\n    TestSHA512(\"abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmno\"\n               \"ijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu\",\n               \"8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018\"\n               \"501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909\");\n    TestSHA512(std::string(1000000, 'a'),\n               \"e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb\"\n               \"de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b\");\n    TestSHA512(test1,\n               \"40cac46c147e6131c5193dd5f34e9d8bb4951395f27b08c558c65ff4ba2de594\"\n               \"37de8c3ef5459d76a52cedc02dc499a3c9ed9dedbfb3281afd9653b8a112fafc\");\n}\n\nBOOST_AUTO_TEST_CASE(hmac_sha256_testvectors) {\n    // test cases 1, 2, 3, 4, 6 and 7 of RFC 4231\n    TestHMACSHA256(\"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b\",\n                   \"4869205468657265\",\n                   \"b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7\");\n    TestHMACSHA256(\"4a656665\",\n                   \"7768617420646f2079612077616e7420666f72206e6f7468696e673f\",\n                   \"5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843\");\n    TestHMACSHA256(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n                   \"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"\n                   \"dddddddddddddddddddddddddddddddddddd\",\n                   \"773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fe\");\n    TestHMACSHA256(\"0102030405060708090a0b0c0d0e0f10111213141516171819\",\n                   \"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd\"\n                   \"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd\",\n                   \"82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665b\");\n    TestHMACSHA256(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaa\",\n                   \"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a\"\n                   \"65204b6579202d2048617368204b6579204669727374\",\n                   \"60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54\");\n    TestHMACSHA256(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaa\",\n                   \"5468697320697320612074657374207573696e672061206c6172676572207468\"\n                   \"616e20626c6f636b2d73697a65206b657920616e642061206c61726765722074\"\n                   \"68616e20626c6f636b2d73697a6520646174612e20546865206b6579206e6565\"\n                   \"647320746f20626520686173686564206265666f7265206265696e6720757365\"\n                   \"642062792074686520484d414320616c676f726974686d2e\",\n                   \"9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2\");\n    // Test case with key length 63 bytes.\n    TestHMACSHA256(\"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a6566\",\n                   \"7768617420646f2079612077616e7420666f72206e6f7468696e673f\",\n                   \"9de4b546756c83516720a4ad7fe7bdbeac4298c6fdd82b15f895a6d10b0769a6\");\n    // Test case with key length 64 bytes.\n    TestHMACSHA256(\"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\",\n                   \"7768617420646f2079612077616e7420666f72206e6f7468696e673f\",\n                   \"528c609a4c9254c274585334946b7c2661bad8f1fc406b20f6892478d19163dd\");\n    // Test case with key length 65 bytes.\n    TestHMACSHA256(\"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a\",\n                   \"7768617420646f2079612077616e7420666f72206e6f7468696e673f\",\n                   \"d06af337f359a2330deffb8e3cbe4b5b7aa8ca1f208528cdbd245d5dc63c4483\");\n}\n\nBOOST_AUTO_TEST_CASE(hmac_sha512_testvectors) {\n    // test cases 1, 2, 3, 4, 6 and 7 of RFC 4231\n    TestHMACSHA512(\"0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b\",\n                   \"4869205468657265\",\n                   \"87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cde\"\n                   \"daa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854\");\n    TestHMACSHA512(\"4a656665\",\n                   \"7768617420646f2079612077616e7420666f72206e6f7468696e673f\",\n                   \"164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea250554\"\n                   \"9758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737\");\n    TestHMACSHA512(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n                   \"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd\"\n                   \"dddddddddddddddddddddddddddddddddddd\",\n                   \"fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39\"\n                   \"bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fb\");\n    TestHMACSHA512(\"0102030405060708090a0b0c0d0e0f10111213141516171819\",\n                   \"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd\"\n                   \"cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd\",\n                   \"b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050361ee3db\"\n                   \"a91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2de2adebeb10a298dd\");\n    TestHMACSHA512(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaa\",\n                   \"54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a\"\n                   \"65204b6579202d2048617368204b6579204669727374\",\n                   \"80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b013783f8f352\"\n                   \"6b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec8b915a985d786598\");\n    TestHMACSHA512(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n                   \"aaaaaa\",\n                   \"5468697320697320612074657374207573696e672061206c6172676572207468\"\n                   \"616e20626c6f636b2d73697a65206b657920616e642061206c61726765722074\"\n                   \"68616e20626c6f636b2d73697a6520646174612e20546865206b6579206e6565\"\n                   \"647320746f20626520686173686564206265666f7265206265696e6720757365\"\n                   \"642062792074686520484d414320616c676f726974686d2e\",\n                   \"e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944\"\n                   \"b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58\");\n    // Test case with key length 127 bytes.\n    TestHMACSHA512(\"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a6566\",\n                   \"7768617420646f2079612077616e7420666f72206e6f7468696e673f\",\n                   \"267424dfb8eeb999f3e5ec39a4fe9fd14c923e6187e0897063e5c9e02b2e624a\"\n                   \"c04413e762977df71a9fb5d562b37f89dfdfb930fce2ed1fa783bbc2a203d80e\");\n    // Test case with key length 128 bytes.\n    TestHMACSHA512(\"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\",\n                   \"7768617420646f2079612077616e7420666f72206e6f7468696e673f\",\n                   \"43aaac07bb1dd97c82c04df921f83b16a68d76815cd1a30d3455ad43a3d80484\"\n                   \"2bb35462be42cc2e4b5902de4d204c1c66d93b47d1383e3e13a3788687d61258\");\n    // Test case with key length 129 bytes.\n    TestHMACSHA512(\"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a6566654a6566654a6566654a6566654a6566654a6566654a6566654a656665\"\n                   \"4a\",\n                   \"7768617420646f2079612077616e7420666f72206e6f7468696e673f\",\n                   \"0b273325191cfc1b4b71d5075c8fcad67696309d292b1dad2cd23983a35feb8e\"\n                   \"fb29795e79f2ef27f68cb1e16d76178c307a67beaad9456fac5fdffeadb16e2c\");\n}\n\nBOOST_AUTO_TEST_CASE(aes_testvectors) {\n    // AES test vectors from FIPS 197.\n    TestAES128(\"000102030405060708090a0b0c0d0e0f\", \"00112233445566778899aabbccddeeff\", \"69c4e0d86a7b0430d8cdb78070b4c55a\");\n    TestAES256(\"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f\", \"00112233445566778899aabbccddeeff\", \"8ea2b7ca516745bfeafc49904b496089\");\n\n    // AES-ECB test vectors from NIST sp800-38a.\n    TestAES128(\"2b7e151628aed2a6abf7158809cf4f3c\", \"6bc1bee22e409f96e93d7e117393172a\", \"3ad77bb40d7a3660a89ecaf32466ef97\");\n    TestAES128(\"2b7e151628aed2a6abf7158809cf4f3c\", \"ae2d8a571e03ac9c9eb76fac45af8e51\", \"f5d3d58503b9699de785895a96fdbaaf\");\n    TestAES128(\"2b7e151628aed2a6abf7158809cf4f3c\", \"30c81c46a35ce411e5fbc1191a0a52ef\", \"43b1cd7f598ece23881b00e3ed030688\");\n    TestAES128(\"2b7e151628aed2a6abf7158809cf4f3c\", \"f69f2445df4f9b17ad2b417be66c3710\", \"7b0c785e27e8ad3f8223207104725dd4\");\n    TestAES256(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \"6bc1bee22e409f96e93d7e117393172a\", \"f3eed1bdb5d2a03c064b5a7e3db181f8\");\n    TestAES256(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \"ae2d8a571e03ac9c9eb76fac45af8e51\", \"591ccb10d410ed26dc5ba74a31362870\");\n    TestAES256(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \"30c81c46a35ce411e5fbc1191a0a52ef\", \"b6ed21b99ca6f4f9f153e7b1beafed1d\");\n    TestAES256(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \"f69f2445df4f9b17ad2b417be66c3710\", \"23304b7a39f9f3ff067d8d8f9e24ecc7\");\n}\n\nBOOST_AUTO_TEST_CASE(aes_cbc_testvectors) {\n\n    // NIST AES CBC 128-bit encryption test-vectors\n    TestAES128CBC(\"2b7e151628aed2a6abf7158809cf4f3c\", \"000102030405060708090A0B0C0D0E0F\", false, \\\n                  \"6bc1bee22e409f96e93d7e117393172a\", \"7649abac8119b246cee98e9b12e9197d\");\n    TestAES128CBC(\"2b7e151628aed2a6abf7158809cf4f3c\", \"7649ABAC8119B246CEE98E9B12E9197D\", false, \\\n                  \"ae2d8a571e03ac9c9eb76fac45af8e51\", \"5086cb9b507219ee95db113a917678b2\");\n    TestAES128CBC(\"2b7e151628aed2a6abf7158809cf4f3c\", \"5086cb9b507219ee95db113a917678b2\", false, \\\n                  \"30c81c46a35ce411e5fbc1191a0a52ef\", \"73bed6b8e3c1743b7116e69e22229516\");\n    TestAES128CBC(\"2b7e151628aed2a6abf7158809cf4f3c\", \"73bed6b8e3c1743b7116e69e22229516\", false, \\\n                  \"f69f2445df4f9b17ad2b417be66c3710\", \"3ff1caa1681fac09120eca307586e1a7\");\n\n    // The same vectors with padding enabled\n    TestAES128CBC(\"2b7e151628aed2a6abf7158809cf4f3c\", \"000102030405060708090A0B0C0D0E0F\", true, \\\n                  \"6bc1bee22e409f96e93d7e117393172a\", \"7649abac8119b246cee98e9b12e9197d8964e0b149c10b7b682e6e39aaeb731c\");\n    TestAES128CBC(\"2b7e151628aed2a6abf7158809cf4f3c\", \"7649ABAC8119B246CEE98E9B12E9197D\", true, \\\n                  \"ae2d8a571e03ac9c9eb76fac45af8e51\", \"5086cb9b507219ee95db113a917678b255e21d7100b988ffec32feeafaf23538\");\n    TestAES128CBC(\"2b7e151628aed2a6abf7158809cf4f3c\", \"5086cb9b507219ee95db113a917678b2\", true, \\\n                  \"30c81c46a35ce411e5fbc1191a0a52ef\", \"73bed6b8e3c1743b7116e69e22229516f6eccda327bf8e5ec43718b0039adceb\");\n    TestAES128CBC(\"2b7e151628aed2a6abf7158809cf4f3c\", \"73bed6b8e3c1743b7116e69e22229516\", true, \\\n                  \"f69f2445df4f9b17ad2b417be66c3710\", \"3ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012\");\n\n    // NIST AES CBC 256-bit encryption test-vectors\n    TestAES256CBC(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \\\n                  \"000102030405060708090A0B0C0D0E0F\", false, \"6bc1bee22e409f96e93d7e117393172a\", \\\n                  \"f58c4c04d6e5f1ba779eabfb5f7bfbd6\");\n    TestAES256CBC(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \\\n                  \"F58C4C04D6E5F1BA779EABFB5F7BFBD6\", false, \"ae2d8a571e03ac9c9eb76fac45af8e51\", \\\n                  \"9cfc4e967edb808d679f777bc6702c7d\");\n    TestAES256CBC(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \\\n                  \"9CFC4E967EDB808D679F777BC6702C7D\", false, \"30c81c46a35ce411e5fbc1191a0a52ef\",\n                  \"39f23369a9d9bacfa530e26304231461\");\n    TestAES256CBC(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \\\n                  \"39F23369A9D9BACFA530E26304231461\", false, \"f69f2445df4f9b17ad2b417be66c3710\", \\\n                  \"b2eb05e2c39be9fcda6c19078c6a9d1b\");\n\n    // The same vectors with padding enabled\n    TestAES256CBC(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \\\n                  \"000102030405060708090A0B0C0D0E0F\", true, \"6bc1bee22e409f96e93d7e117393172a\", \\\n                  \"f58c4c04d6e5f1ba779eabfb5f7bfbd6485a5c81519cf378fa36d42b8547edc0\");\n    TestAES256CBC(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \\\n                  \"F58C4C04D6E5F1BA779EABFB5F7BFBD6\", true, \"ae2d8a571e03ac9c9eb76fac45af8e51\", \\\n                  \"9cfc4e967edb808d679f777bc6702c7d3a3aa5e0213db1a9901f9036cf5102d2\");\n    TestAES256CBC(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \\\n                  \"9CFC4E967EDB808D679F777BC6702C7D\", true, \"30c81c46a35ce411e5fbc1191a0a52ef\",\n                  \"39f23369a9d9bacfa530e263042314612f8da707643c90a6f732b3de1d3f5cee\");\n    TestAES256CBC(\"603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4\", \\\n                  \"39F23369A9D9BACFA530E26304231461\", true, \"f69f2445df4f9b17ad2b417be66c3710\", \\\n                  \"b2eb05e2c39be9fcda6c19078c6a9d1b3f461796d6b0d6b2e0c2a72b4d80e644\");\n}\n\n\nBOOST_AUTO_TEST_CASE(chacha20_testvector)\n{\n    // Test vector from RFC 7539\n    TestChaCha20(\"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f\", 0x4a000000UL, 1,\n                 \"224f51f3401bd9e12fde276fb8631ded8c131f823d2c06e27e4fcaec9ef3cf788a3b0aa372600a92b57974cded2b9334794cb\"\n                 \"a40c63e34cdea212c4cf07d41b769a6749f3f630f4122cafe28ec4dc47e26d4346d70b98c73f3e9c53ac40c5945398b6eda1a\"\n                 \"832c89c167eacd901d7e2bf363\");\n\n    // Test vectors from https://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-04#section-7\n    TestChaCha20(\"0000000000000000000000000000000000000000000000000000000000000000\", 0, 0,\n                 \"76b8e0ada0f13d90405d6ae55386bd28bdd219b8a08ded1aa836efcc8b770dc7da41597c5157488d7724e03fb8d84a376a43b\"\n                 \"8f41518a11cc387b669b2ee6586\");\n    TestChaCha20(\"0000000000000000000000000000000000000000000000000000000000000001\", 0, 0,\n                 \"4540f05a9f1fb296d7736e7b208e3c96eb4fe1834688d2604f450952ed432d41bbe2a0b6ea7566d2a5d1e7e20d42af2c53d79\"\n                 \"2b1c43fea817e9ad275ae546963\");\n    TestChaCha20(\"0000000000000000000000000000000000000000000000000000000000000000\", 0x0100000000000000ULL, 0,\n                 \"de9cba7bf3d69ef5e786dc63973f653a0b49e015adbff7134fcb7df137821031e85a050278a7084527214f73efc7fa5b52770\"\n                 \"62eb7a0433e445f41e3\");\n    TestChaCha20(\"0000000000000000000000000000000000000000000000000000000000000000\", 1, 0,\n                 \"ef3fdfd6c61578fbf5cf35bd3dd33b8009631634d21e42ac33960bd138e50d32111e4caf237ee53ca8ad6426194a88545ddc4\"\n                 \"97a0b466e7d6bbdb0041b2f586b\");\n    TestChaCha20(\"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f\", 0x0706050403020100ULL, 0,\n                 \"f798a189f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3b\"\n                 \"e59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc1\"\n                 \"18be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5\"\n                 \"a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5\"\n                 \"360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78\"\n                 \"fab78c9\");\n}\n\nBOOST_AUTO_TEST_CASE(countbits_tests)\n{\n    FastRandomContext ctx;\n    for (int i = 0; i <= 64; ++i) {\n        if (i == 0) {\n            // Check handling of zero.\n            BOOST_CHECK_EQUAL(CountBits(0), 0);\n        } else if (i < 10) {\n            for (uint64_t j = 1 << (i - 1); (j >> i) == 0; ++j) {\n                // Exhaustively test up to 10 bits\n                BOOST_CHECK_EQUAL(CountBits(j), i);\n            }\n        } else {\n            for (int k = 0; k < 1000; k++) {\n                // Randomly test 1000 samples of each length above 10 bits.\n                uint64_t j = ((uint64_t)1) << (i - 1) | ctx.randbits(i - 1);\n                BOOST_CHECK_EQUAL(CountBits(j), i);\n            }\n        }\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/cuckoocache_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#include <boost/test/unit_test.hpp>\n#include <cuckoocache.h>\n#include <script/sigcache.h>\n#include <test/test_bitcoin.h>\n#include <random.h>\n#include <thread>\n\n/** Test Suite for CuckooCache\n *\n *  1) All tests should have a deterministic result (using insecure rand\n *  with deterministic seeds)\n *  2) Some test methods are templated to allow for easier testing\n *  against new versions / comparing\n *  3) Results should be treated as a regression test, i.e., did the behavior\n *  change significantly from what was expected. This can be OK, depending on\n *  the nature of the change, but requires updating the tests to reflect the new\n *  expected behavior. For example improving the hit rate may cause some tests\n *  using BOOST_CHECK_CLOSE to fail.\n *\n */\nFastRandomContext local_rand_ctx(true);\n\nBOOST_AUTO_TEST_SUITE(cuckoocache_tests);\n\n\n/** insecure_GetRandHash fills in a uint256 from local_rand_ctx\n */\nvoid insecure_GetRandHash(uint256& t)\n{\n    uint32_t* ptr = (uint32_t*)t.begin();\n    for (uint8_t j = 0; j < 8; ++j)\n        *(ptr++) = local_rand_ctx.rand32();\n}\n\n\n\n/* Test that no values not inserted into the cache are read out of it.\n *\n * There are no repeats in the first 200000 insecure_GetRandHash calls\n */\nBOOST_AUTO_TEST_CASE(test_cuckoocache_no_fakes)\n{\n    local_rand_ctx = FastRandomContext(true);\n    CuckooCache::cache<uint256, SignatureCacheHasher> cc{};\n    size_t megabytes = 4;\n    cc.setup_bytes(megabytes << 20);\n    uint256 v;\n    for (int x = 0; x < 100000; ++x) {\n        insecure_GetRandHash(v);\n        cc.insert(v);\n    }\n    for (int x = 0; x < 100000; ++x) {\n        insecure_GetRandHash(v);\n        BOOST_CHECK(!cc.contains(v, false));\n    }\n};\n\n/** This helper returns the hit rate when megabytes*load worth of entries are\n * inserted into a megabytes sized cache\n */\ntemplate <typename Cache>\ndouble test_cache(size_t megabytes, double load)\n{\n    local_rand_ctx = FastRandomContext(true);\n    std::vector<uint256> hashes;\n    Cache set{};\n    size_t bytes = megabytes * (1 << 20);\n    set.setup_bytes(bytes);\n    uint32_t n_insert = static_cast<uint32_t>(load * (bytes / sizeof(uint256)));\n    hashes.resize(n_insert);\n    for (uint32_t i = 0; i < n_insert; ++i) {\n        uint32_t* ptr = (uint32_t*)hashes[i].begin();\n        for (uint8_t j = 0; j < 8; ++j)\n            *(ptr++) = local_rand_ctx.rand32();\n    }\n    /** We make a copy of the hashes because future optimizations of the\n     * cuckoocache may overwrite the inserted element, so the test is\n     * \"future proofed\".\n     */\n    std::vector<uint256> hashes_insert_copy = hashes;\n    /** Do the insert */\n    for (uint256& h : hashes_insert_copy)\n        set.insert(h);\n    /** Count the hits */\n    uint32_t count = 0;\n    for (uint256& h : hashes)\n        count += set.contains(h, false);\n    double hit_rate = ((double)count) / ((double)n_insert);\n    return hit_rate;\n}\n\n/** The normalized hit rate for a given load.\n *\n * The semantics are a little confusing, so please see the below\n * explanation.\n *\n * Examples:\n *\n * 1) at load 0.5, we expect a perfect hit rate, so we multiply by\n * 1.0\n * 2) at load 2.0, we expect to see half the entries, so a perfect hit rate\n * would be 0.5. Therefore, if we see a hit rate of 0.4, 0.4*2.0 = 0.8 is the\n * normalized hit rate.\n *\n * This is basically the right semantics, but has a bit of a glitch depending on\n * how you measure around load 1.0 as after load 1.0 your normalized hit rate\n * becomes effectively perfect, ignoring freshness.\n */\ndouble normalize_hit_rate(double hits, double load)\n{\n    return hits * std::max(load, 1.0);\n}\n\n/** Check the hit rate on loads ranging from 0.1 to 2.0 */\nBOOST_AUTO_TEST_CASE(cuckoocache_hit_rate_ok)\n{\n    /** Arbitrarily selected Hit Rate threshold that happens to work for this test\n     * as a lower bound on performance.\n     */\n    double HitRateThresh = 0.98;\n    size_t megabytes = 4;\n    for (double load = 0.1; load < 2; load *= 2) {\n        double hits = test_cache<CuckooCache::cache<uint256, SignatureCacheHasher>>(megabytes, load);\n        BOOST_CHECK(normalize_hit_rate(hits, load) > HitRateThresh);\n    }\n}\n\n\n/** This helper checks that erased elements are preferentially inserted onto and\n * that the hit rate of \"fresher\" keys is reasonable*/\ntemplate <typename Cache>\nvoid test_cache_erase(size_t megabytes)\n{\n    double load = 1;\n    local_rand_ctx = FastRandomContext(true);\n    std::vector<uint256> hashes;\n    Cache set{};\n    size_t bytes = megabytes * (1 << 20);\n    set.setup_bytes(bytes);\n    uint32_t n_insert = static_cast<uint32_t>(load * (bytes / sizeof(uint256)));\n    hashes.resize(n_insert);\n    for (uint32_t i = 0; i < n_insert; ++i) {\n        uint32_t* ptr = (uint32_t*)hashes[i].begin();\n        for (uint8_t j = 0; j < 8; ++j)\n            *(ptr++) = local_rand_ctx.rand32();\n    }\n    /** We make a copy of the hashes because future optimizations of the\n     * cuckoocache may overwrite the inserted element, so the test is\n     * \"future proofed\".\n     */\n    std::vector<uint256> hashes_insert_copy = hashes;\n\n    /** Insert the first half */\n    for (uint32_t i = 0; i < (n_insert / 2); ++i)\n        set.insert(hashes_insert_copy[i]);\n    /** Erase the first quarter */\n    for (uint32_t i = 0; i < (n_insert / 4); ++i)\n        set.contains(hashes[i], true);\n    /** Insert the second half */\n    for (uint32_t i = (n_insert / 2); i < n_insert; ++i)\n        set.insert(hashes_insert_copy[i]);\n\n    /** elements that we marked erased but that are still there */\n    size_t count_erased_but_contained = 0;\n    /** elements that we did not erase but are older */\n    size_t count_stale = 0;\n    /** elements that were most recently inserted */\n    size_t count_fresh = 0;\n\n    for (uint32_t i = 0; i < (n_insert / 4); ++i)\n        count_erased_but_contained += set.contains(hashes[i], false);\n    for (uint32_t i = (n_insert / 4); i < (n_insert / 2); ++i)\n        count_stale += set.contains(hashes[i], false);\n    for (uint32_t i = (n_insert / 2); i < n_insert; ++i)\n        count_fresh += set.contains(hashes[i], false);\n\n    double hit_rate_erased_but_contained = double(count_erased_but_contained) / (double(n_insert) / 4.0);\n    double hit_rate_stale = double(count_stale) / (double(n_insert) / 4.0);\n    double hit_rate_fresh = double(count_fresh) / (double(n_insert) / 2.0);\n\n    // Check that our hit_rate_fresh is perfect\n    BOOST_CHECK_EQUAL(hit_rate_fresh, 1.0);\n    // Check that we have a more than 2x better hit rate on stale elements than\n    // erased elements.\n    BOOST_CHECK(hit_rate_stale > 2 * hit_rate_erased_but_contained);\n}\n\nBOOST_AUTO_TEST_CASE(cuckoocache_erase_ok)\n{\n    size_t megabytes = 4;\n    test_cache_erase<CuckooCache::cache<uint256, SignatureCacheHasher>>(megabytes);\n}\n\ntemplate <typename Cache>\nvoid test_cache_erase_parallel(size_t megabytes)\n{\n    double load = 1;\n    local_rand_ctx = FastRandomContext(true);\n    std::vector<uint256> hashes;\n    Cache set{};\n    size_t bytes = megabytes * (1 << 20);\n    set.setup_bytes(bytes);\n    uint32_t n_insert = static_cast<uint32_t>(load * (bytes / sizeof(uint256)));\n    hashes.resize(n_insert);\n    for (uint32_t i = 0; i < n_insert; ++i) {\n        uint32_t* ptr = (uint32_t*)hashes[i].begin();\n        for (uint8_t j = 0; j < 8; ++j)\n            *(ptr++) = local_rand_ctx.rand32();\n    }\n    /** We make a copy of the hashes because future optimizations of the\n     * cuckoocache may overwrite the inserted element, so the test is\n     * \"future proofed\".\n     */\n    std::vector<uint256> hashes_insert_copy = hashes;\n    boost::shared_mutex mtx;\n\n    {\n        /** Grab lock to make sure we release inserts */\n        boost::unique_lock<boost::shared_mutex> l(mtx);\n        /** Insert the first half */\n        for (uint32_t i = 0; i < (n_insert / 2); ++i)\n            set.insert(hashes_insert_copy[i]);\n    }\n\n    /** Spin up 3 threads to run contains with erase.\n     */\n    std::vector<std::thread> threads;\n    /** Erase the first quarter */\n    for (uint32_t x = 0; x < 3; ++x)\n        /** Each thread is emplaced with x copy-by-value\n        */\n        threads.emplace_back([&, x] {\n            boost::shared_lock<boost::shared_mutex> l(mtx);\n            size_t ntodo = (n_insert/4)/3;\n            size_t start = ntodo*x;\n            size_t end = ntodo*(x+1);\n            for (uint32_t i = start; i < end; ++i)\n                set.contains(hashes[i], true);\n        });\n\n    /** Wait for all threads to finish\n     */\n    for (std::thread& t : threads)\n        t.join();\n    /** Grab lock to make sure we observe erases */\n    boost::unique_lock<boost::shared_mutex> l(mtx);\n    /** Insert the second half */\n    for (uint32_t i = (n_insert / 2); i < n_insert; ++i)\n        set.insert(hashes_insert_copy[i]);\n\n    /** elements that we marked erased but that are still there */\n    size_t count_erased_but_contained = 0;\n    /** elements that we did not erase but are older */\n    size_t count_stale = 0;\n    /** elements that were most recently inserted */\n    size_t count_fresh = 0;\n\n    for (uint32_t i = 0; i < (n_insert / 4); ++i)\n        count_erased_but_contained += set.contains(hashes[i], false);\n    for (uint32_t i = (n_insert / 4); i < (n_insert / 2); ++i)\n        count_stale += set.contains(hashes[i], false);\n    for (uint32_t i = (n_insert / 2); i < n_insert; ++i)\n        count_fresh += set.contains(hashes[i], false);\n\n    double hit_rate_erased_but_contained = double(count_erased_but_contained) / (double(n_insert) / 4.0);\n    double hit_rate_stale = double(count_stale) / (double(n_insert) / 4.0);\n    double hit_rate_fresh = double(count_fresh) / (double(n_insert) / 2.0);\n\n    // Check that our hit_rate_fresh is perfect\n    BOOST_CHECK_EQUAL(hit_rate_fresh, 1.0);\n    // Check that we have a more than 2x better hit rate on stale elements than\n    // erased elements.\n    BOOST_CHECK(hit_rate_stale > 2 * hit_rate_erased_but_contained);\n}\nBOOST_AUTO_TEST_CASE(cuckoocache_erase_parallel_ok)\n{\n    size_t megabytes = 4;\n    test_cache_erase_parallel<CuckooCache::cache<uint256, SignatureCacheHasher>>(megabytes);\n}\n\n\ntemplate <typename Cache>\nvoid test_cache_generations()\n{\n    // This test checks that for a simulation of network activity, the fresh hit\n    // rate is never below 99%, and the number of times that it is worse than\n    // 99.9% are less than 1% of the time.\n    double min_hit_rate = 0.99;\n    double tight_hit_rate = 0.999;\n    double max_rate_less_than_tight_hit_rate = 0.01;\n    // A cache that meets this specification is therefore shown to have a hit\n    // rate of at least tight_hit_rate * (1 - max_rate_less_than_tight_hit_rate) +\n    // min_hit_rate*max_rate_less_than_tight_hit_rate = 0.999*99%+0.99*1% == 99.89%\n    // hit rate with low variance.\n\n    // We use deterministic values, but this test has also passed on many\n    // iterations with non-deterministic values, so it isn't \"overfit\" to the\n    // specific entropy in FastRandomContext(true) and implementation of the\n    // cache.\n    local_rand_ctx = FastRandomContext(true);\n\n    // block_activity models a chunk of network activity. n_insert elements are\n    // adde to the cache. The first and last n/4 are stored for removal later\n    // and the middle n/2 are not stored. This models a network which uses half\n    // the signatures of recently (since the last block) added transactions\n    // immediately and never uses the other half.\n    struct block_activity {\n        std::vector<uint256> reads;\n        block_activity(uint32_t n_insert, Cache& c) : reads()\n        {\n            std::vector<uint256> inserts;\n            inserts.resize(n_insert);\n            reads.reserve(n_insert / 2);\n            for (uint32_t i = 0; i < n_insert; ++i) {\n                uint32_t* ptr = (uint32_t*)inserts[i].begin();\n                for (uint8_t j = 0; j < 8; ++j)\n                    *(ptr++) = local_rand_ctx.rand32();\n            }\n            for (uint32_t i = 0; i < n_insert / 4; ++i)\n                reads.push_back(inserts[i]);\n            for (uint32_t i = n_insert - (n_insert / 4); i < n_insert; ++i)\n                reads.push_back(inserts[i]);\n            for (auto h : inserts)\n                c.insert(h);\n        }\n    };\n\n    const uint32_t BLOCK_SIZE = 1000;\n    // We expect window size 60 to perform reasonably given that each epoch\n    // stores 45% of the cache size (~472k).\n    const uint32_t WINDOW_SIZE = 60;\n    const uint32_t POP_AMOUNT = (BLOCK_SIZE / WINDOW_SIZE) / 2;\n    const double load = 10;\n    const size_t megabytes = 4;\n    const size_t bytes = megabytes * (1 << 20);\n    const uint32_t n_insert = static_cast<uint32_t>(load * (bytes / sizeof(uint256)));\n\n    std::vector<block_activity> hashes;\n    Cache set{};\n    set.setup_bytes(bytes);\n    hashes.reserve(n_insert / BLOCK_SIZE);\n    std::deque<block_activity> last_few;\n    uint32_t out_of_tight_tolerance = 0;\n    uint32_t total = n_insert / BLOCK_SIZE;\n    // we use the deque last_few to model a sliding window of blocks. at each\n    // step, each of the last WINDOW_SIZE block_activities checks the cache for\n    // POP_AMOUNT of the hashes that they inserted, and marks these erased.\n    for (uint32_t i = 0; i < total; ++i) {\n        if (last_few.size() == WINDOW_SIZE)\n            last_few.pop_front();\n        last_few.emplace_back(BLOCK_SIZE, set);\n        uint32_t count = 0;\n        for (auto& act : last_few)\n            for (uint32_t k = 0; k < POP_AMOUNT; ++k) {\n                count += set.contains(act.reads.back(), true);\n                act.reads.pop_back();\n            }\n        // We use last_few.size() rather than WINDOW_SIZE for the correct\n        // behavior on the first WINDOW_SIZE iterations where the deque is not\n        // full yet.\n        double hit = (double(count)) / (last_few.size() * POP_AMOUNT);\n        // Loose Check that hit rate is above min_hit_rate\n        BOOST_CHECK(hit > min_hit_rate);\n        // Tighter check, count number of times we are less than tight_hit_rate\n        // (and implicitly, greater than min_hit_rate)\n        out_of_tight_tolerance += hit < tight_hit_rate;\n    }\n    // Check that being out of tolerance happens less than\n    // max_rate_less_than_tight_hit_rate of the time\n    BOOST_CHECK(double(out_of_tight_tolerance) / double(total) < max_rate_less_than_tight_hit_rate);\n}\nBOOST_AUTO_TEST_CASE(cuckoocache_generations)\n{\n    test_cache_generations<CuckooCache::cache<uint256, SignatureCacheHasher>>();\n}\n\nBOOST_AUTO_TEST_SUITE_END();\n"
  },
  {
    "path": "src/test/data/README.md",
    "content": "Description\n------------\n\nThis directory contains data-driven tests for various aspects of Bitcoin.\n\nLicense\n--------\n\nThe data files in this directory are distributed under the MIT software\nlicense, see the accompanying file COPYING or\nhttp://www.opensource.org/licenses/mit-license.php.\n\n"
  },
  {
    "path": "src/test/data/base58_encode_decode.json",
    "content": "[\n[\"\", \"\"],\n[\"61\", \"2g\"],\n[\"626262\", \"a3gV\"],\n[\"636363\", \"aPEr\"],\n[\"73696d706c792061206c6f6e6720737472696e67\", \"2cFupjhnEsSn59qHXstmK2ffpLv2\"],\n[\"00eb15231dfceb60925886b67d065299925915aeb172c06647\", \"1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L\"],\n[\"516b6fcd0f\", \"ABnLTmg\"],\n[\"bf4f89001e670274dd\", \"3SEo3LWLoPntC\"],\n[\"572e4794\", \"3EFU7m\"],\n[\"ecac89cad93923c02321\", \"EJDM8drfXA6uyA\"],\n[\"10c8511e\", \"Rt5zm\"],\n[\"00000000000000000000\", \"1111111111\"]\n]\n"
  },
  {
    "path": "src/test/data/base58_keys_invalid.json",
    "content": "[\n    [\n        \"\"\n    ], \n    [\n        \"x\"\n    ], \n    [\n        \"PgPjryUCAJgt2nbAw76EMv7C3kKyFYTFRNjtPuiq3AzS8zKHXCTWUSGhWgwc3VM73rKXQBCrmsb\"\n    ], \n    [\n        \"PjYpqz4kAd9vvu1o13mijHJN4RGdVk8s2Kw79nPmMKS9FkRZqFxX1S764VuCdcQ8hAsWMn2D5pG\"\n    ], \n    [\n        \"25H4gtiMtoF9Gky5PgXdifp8efDMupocnTz\"\n    ], \n    [\n        \"sh5jpoNBBpmmVrj6oBqgZZabzcjVjeaKDv\"\n    ], \n    [\n        \"2brE5vjQyeJkB6c7hekoN7t8dmxjU59Amqv\"\n    ], \n    [\n        \"nsJ12GEFWsPYjx1z6hLw4VzHPZVsR6UWGGe5E1d2aLMzF9UoixWqKz7xCST2pGXdRQt52cyCEQx\"\n    ], \n    [\n        \"nZw8AVYV99Ktwo5kUem67V4qbUJKmMwfqmpqeNc7XDhmg8mzfbKk3nWHXSoWGufAVwaVSP9B84T\"\n    ], \n    [\n        \"YfqcAjcTKayH5u2jCwmUKEUok6PPwJ1UcX8zWeMwY7K5iTJLEJom\"\n    ], \n    [\n        \"TkeW43YhUyZPXqwUfQ3VBbkGK8HtSAbrxUg\"\n    ], \n    [\n        \"GmboDPJGi2PeZF5bB8nku5uhHTqRnqHN9Nk5UQKF8pPXmMJG5MhWFJZiKfbzPwn5Pk4nv3k4yLD\"\n    ], \n    [\n        \"nmu3riamHymnBtDLvdSu85tGhwgEQ6j9MrFdpSiS2JyfjVPakmQXmfCvh9KjxYCHoS27meLrd6z\"\n    ], \n    [\n        \"mYNHMaVaqanD3BxmEUtd54CNq3eebDN3gJy5aDpswjanojjq4gyZLCiGrtNzkRGk7uZ1hXzxqqR\"\n    ], \n    [\n        \"4U4yteXquoTC2GtqewYkJALz8HzoFRcXjp3hS9SYyGjPGo5NkX4KCBhKrHDu5bJfTAcQQWfettNNk\"\n    ], \n    [\n        \"2UE8gbtZawuQ2MBVf8hU2AXrAXyuTCuH51R3uxFHv7y43R4jkaKzPVHRk23oe4mPFh3hX1XGranz\"\n    ], \n    [\n        \"F6CVUNSdd9xcHJsyMnS3s9UenxbfVyFN9VZSHCQUHAWscnKto9t3\"\n    ], \n    [\n        \"PkTkd5VKjfSCsDK9QgqnroMYgeADmistMGaY1mwyWJUSM9H1RBQYf5o1GvPkGoVftLU9cYG6wDr\"\n    ], \n    [\n        \"2mqVGuK3JKyC9zW6q2wwY5X6kQR3EbkPChb\"\n    ], \n    [\n        \"5PVnrWnNtu8ECFtCTbCv3wz5JPrf6C9UCMAadU3btY64L6uG7q2R\"\n    ], \n    [\n        \"XW6btkBqJJS2PbooSn6MN3snVT5hQAbVmNd3NMTvWURnERE2ci5V\"\n    ], \n    [\n        \"cMmGGdxZQH1PNn4jkApmAxhCvqPf7uMPJdMDHxsJvG3M8kAgfNEx\"\n    ], \n    [\n        \"25sAHvSUYsgWAqBjKPPwGK6RnfChQxfFtTc\"\n    ], \n    [\n        \"L4rkuThxRnh3shD1Y1hLjonpChySnc7BKv5VFYycpAc2dpqVxnRnP\"\n    ], \n    [\n        \"W2z6qYh38sBHSiMAuwfxwRa95saqi8oZiSrCB6CWfpjVzWwQRHUS\"\n    ], \n    [\n        \"PTJF2eKidbViSPDTWDVUUJXnciTVuvfZDH4QhTo5pwtyK3BRx2gk3g4yD3Jz25qynABRj6VEBFi\"\n    ], \n    [\n        \"TsN1LVyyht892LaQRUn7TifooUnXEdaLfT\"\n    ], \n    [\n        \"4UrkNAZfY1GrmXPmr5cgi5Qtc6Snd5W6UenUrr4c9YSEofTSw1hWLM1nkxYJJ8T84YirnbpNZHN6G\"\n    ], \n    [\n        \"9F2fN9KYhDC8BH4DiwCdzMqmXi5j14A828HCfrNoCGoRktqbHfd\"\n    ], \n    [\n        \"Pj9ZynVXozaC27cLeg5f5X34Pm1dkiCHPHQfje1QqSFTxSwsajBwS82LqXDskc2QDfbvShxK2ei\"\n    ], \n    [\n        \"mYBsF5FLBAhT7VCxDU1irwgthnFrj3ABoVD2qVBym9gQ8aEUy8xGsYzQieTMFS7vqh6mv8kx9zJh\"\n    ], \n    [\n        \"y2sWAyXKYHQWBVUvoKR3PEH1NoFNzaEAcx\"\n    ], \n    [\n        \"2UKUh76ac3EvTPqZ9dKfytLBtBhPgGRQBxL29NnS5KGVBR4TGsmzcpPB3SZw8ncBNamP3CF52xT6\"\n    ], \n    [\n        \"7VQnG3MNdvPr8eZmRHeZSi5tF3ZisqqJ8zHJSTMkUZ69uFHpvWmqmbLGeZzDyckm6dZheWKkQtdGf\"\n    ], \n    [\n        \"2CsjweGQpgGaXfswRRa62qn3pP2AoUd7R5pq4JteukU6EJbrnJHLYneGjVaMaYPAdUNV9fddRrYs\"\n    ], \n    [\n        \"ncALVqWGxy4Dey24LWy5XN3Vg4wDxsJDZuVf15zYnkyKgsSgw9zFKcCnTzvhF3FcfBMjRKcptzT\"\n    ], \n    [\n        \"KxZiJtLNtQQgR6gs9SQU1VhfaWgQB2qwBq8MRHmcY6N29JaWK6xQ\"\n    ], \n    [\n        \"52fFHWcUKfREe1St7DsJfU9f3fp7YfqXk2XW19pGF6bDcEAdseu84CPjRQ3Eck3xn3ymtuoeSvYcN\"\n    ], \n    [\n        \"PUhtFymutjx98tyWqodyUiouSHRkky43uHU9abQjvTKo8rJHF6SHZpsQk6sVT3BWmYvZzjnMh4a\"\n    ], \n    [\n        \"2BAELBjEPTZsFmS6ZjBU8p33gmKchuSJamb\"\n    ], \n    [\n        \"GbcRrG9hB5BbZb16CPutL1sdeiydjPcgCPyeE7UQAmemSLHpTTVWeKh1x15VnbpbRJeVGyMqzys\"\n    ], \n    [\n        \"W1EseqMmJon22ExDJQwzATZFM4rEdSJM2tv8u17FXGYNri1m59Yn8WeLRFJqKU8GK5aJJgkaoPt\"\n    ], \n    [\n        \"2KfYr1G4Xb4fVAYxfqYF331hb3W65GrRVxXv\"\n    ], \n    [\n        \"QpbWdsxSvKKJWqYLtyk3sw84KwmBNAv6oeMAU2RdnnJREoqvaEzCsqmciZ41qpQsoJJGx6DBjZ4\"\n    ], \n    [\n        \"nmQX4FcwWV4RQBRJenpyzovq6TCtk4WS9wFhyHfLfeX5de3SwJiSchEkS6CBqGELYiXXLsVP7Qb\"\n    ], \n    [\n        \"JSDT1tVuCED6NqvjXdo4ViJB2SjTpXbZ6uEgPMvz3M5JMBWioUMq\"\n    ], \n    [\n        \"mf1UpeankYM9afhLip66kkq8HVQWAkaY1hzyffCUDQs38mzGs6mtWnskK6tYyX5eUpnzJ2F3mC8\"\n    ], \n    [\n        \"QZkYaVxzFntCzM4Gc738PzTRk3YWDW4CBEQeaoBYUM3BAExvwbCNaH7imfzrVxWH3tp8pHpZ6Wd\"\n    ], \n    [\n        \"4UxFrndsLACMeofRMVyCmLEo2kU29FkejRMsUGt3FFgpwzfqLygJ\"\n    ], \n    [\n        \"4UBiNCgNUFLk6MCZWWTK1HmiXkMq7aLZDidTyLqgweJ7zWFkYDJ8Janm1FVk2p7xPoT5XQY5EUjr4\"\n    ]\n]\n"
  },
  {
    "path": "src/test/data/base58_keys_valid.json",
    "content": "[\n    [\n        \"L4PQk1eb1ruSJpsJhTqnC5B8wL4SYFJdWkME397Wf37iCrT2CM4e\", \n        \"d5d9f8976c3695c33d77211b1f9786d4f371f657585d962dd3ed1e8b4ffd0245\", \n        {\n            \"isCompressed\": true, \n            \"isPrivkey\": true, \n            \"isTestnet\": false,\n            \"chain\": \"main\"\n        }\n    ],\n    [\n        \"cMg62d5EnbFRNGoQKKeGnwusyiqTizwpXAJXCwEZgX1ijtJRTCpg\", \n        \"02c54c247492825802ce44c477b324e7918d9cc06beba7394ad28bdf5eaa2837\", \n        {\n            \"isCompressed\": true, \n            \"isPrivkey\": true, \n            \"isTestnet\": true,\n            \"chain\": \"test\"\n        }\n    ],\n    [\n        \"93P5r4s2CXEEWTyju9iycdrH5wjyhYzLxgrp4JC79admdxqNHSc\", \n        \"ec861935bc0faa7c3b7de272a8682bb8f14fafbea5edb8025b9b10c90a7a2041\", \n        {\n            \"isCompressed\": false, \n            \"isPrivkey\": true, \n            \"isTestnet\": true,\n            \"chain\": \"regtest\"\n        }\n    ]\n]"
  },
  {
    "path": "src/test/data/script_tests.json",
    "content": "[\n[\"Format is: [[wit..., amount]?, scriptSig, scriptPubKey, flags, expected_scripterror, ... comments]\"],\n[\"It is evaluated as if there was a crediting coinbase transaction with two 0\"],\n[\"pushes as scriptSig, and one output of 0 satoshi and given scriptPubKey,\"],\n[\"followed by a spending transaction which spends this output as only input (and\"],\n[\"correct prevout hash), using the given scriptSig. All nLockTimes are 0, all\"],\n[\"nSequences are max.\"],\n\n[\"\", \"DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Test the test: we should have an empty stack after scriptSig evaluation\"],\n[\"  \", \"DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"and multiple spaces should not change that.\"],\n[\"   \", \"DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"    \", \"DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 2\", \"2 EQUALVERIFY 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Similarly whitespace around and between symbols\"],\n[\"1  2\", \"2 EQUALVERIFY 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"  1  2\", \"2 EQUALVERIFY 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1  2  \", \"2 EQUALVERIFY 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"  1  2  \", \"2 EQUALVERIFY 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"1\", \"\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0x02 0x01 0x00\", \"\", \"P2SH,STRICTENC\", \"OK\", \"all bytes are significant, not only the last one\"],\n[\"0x09 0x00000000 0x00000000 0x10\", \"\", \"P2SH,STRICTENC\", \"OK\", \"equals zero when cast to Int64\"],\n\n[\"0x01 0x0b\", \"11 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"push 1 byte\"],\n[\"0x02 0x417a\", \"'Az' EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0x4b 0x417a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a\",\n \"'Azzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"push 75 bytes\"],\n\n[\"0x4c 0x01 0x07\",\"7 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"0x4c is OP_PUSHDATA1\"],\n[\"0x4d 0x0100 0x08\",\"8 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"0x4d is OP_PUSHDATA2\"],\n[\"0x4e 0x01000000 0x09\",\"9 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"0x4e is OP_PUSHDATA4\"],\n\n[\"0x4c 0x00\",\"0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0x4d 0x0000\",\"0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0x4e 0x00000000\",\"0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0x4f 1000 ADD\",\"999 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0x50 ENDIF 1\", \"P2SH,STRICTENC\", \"OK\", \"0x50 is reserved (ok if not executed)\"],\n[\"0x51\", \"0x5f ADD 0x60 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"0x51 through 0x60 push 1 through 16 onto stack\"],\n[\"1\",\"NOP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF VER ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\", \"VER non-functional (ok if not executed)\"],\n[\"0\", \"IF RESERVED RESERVED1 RESERVED2 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\", \"RESERVED ok in un-executed IF\"],\n\n[\"1\", \"DUP IF ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1\", \"IF 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1\", \"DUP IF ELSE ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1\", \"IF 1 ELSE ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"1 1\", \"IF IF 1 ELSE 0 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"IF IF 1 ELSE 0 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 1\", \"IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0\", \"IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"1 0\", \"NOTIF IF 1 ELSE 0 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 1\", \"NOTIF IF 1 ELSE 0 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1\", \"NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"0\", \"IF 0 ELSE 1 ELSE 0 ENDIF\", \"P2SH,STRICTENC\", \"OK\", \"Multiple ELSE's are valid and executed inverts on each ELSE encountered\"],\n[\"1\", \"IF 1 ELSE 0 ELSE ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1\", \"IF ELSE 0 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1\", \"IF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'' 1\", \"IF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"1\", \"NOTIF 0 ELSE 1 ELSE 0 ENDIF\", \"P2SH,STRICTENC\", \"OK\", \"Multiple ELSE's are valid and execution inverts on each ELSE encountered\"],\n[\"0\", \"NOTIF 1 ELSE 0 ELSE ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"NOTIF ELSE 0 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"NOTIF 1 ELSE 0 ELSE 1 ENDIF ADD 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'' 0\", \"NOTIF SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ELSE ELSE SHA1 ENDIF 0x14 0x68ca4fec736264c13b859bac43d5173df6871682 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"0\", \"IF 1 IF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 1 IF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Nested ELSE ELSE\"],\n[\"1\", \"NOTIF 0 NOTIF RETURN ELSE RETURN ELSE RETURN ENDIF ELSE 0 NOTIF 1 ELSE RETURN ELSE 1 ENDIF ELSE RETURN ENDIF ADD 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"0\", \"IF RETURN ENDIF 1\", \"P2SH,STRICTENC\", \"OK\", \"RETURN only works if executed\"],\n\n[\"1 1\", \"VERIFY\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0x05 0x01 0x00 0x00 0x00 0x00\", \"VERIFY\", \"P2SH,STRICTENC\", \"OK\", \"values >4 bytes can be cast to boolean\"],\n[\"1 0x01 0x80\", \"IF 0 ENDIF\", \"P2SH,STRICTENC\", \"OK\", \"negative 0 is false\"],\n\n[\"10 0 11 TOALTSTACK DROP FROMALTSTACK\", \"ADD 21 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'gavin_was_here' TOALTSTACK 11 FROMALTSTACK\", \"'gavin_was_here' EQUALVERIFY 11 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"0 IFDUP\", \"DEPTH 1 EQUALVERIFY 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 IFDUP\", \"DEPTH 2 EQUALVERIFY 1 EQUALVERIFY 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0x05 0x0100000000 IFDUP\", \"DEPTH 2 EQUALVERIFY 0x05 0x0100000000 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"IFDUP dups non ints\"],\n[\"0 DROP\", \"DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"DUP 1 ADD 1 EQUALVERIFY 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1\", \"NIP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"OVER DEPTH 3 EQUALVERIFY\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"ROT 22 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"ROT DROP 20 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"ROT DROP DROP 21 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"ROT ROT 21 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"22 21 20\", \"ROT ROT ROT 20 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"25 24 23 22 21 20\", \"2ROT 24 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"25 24 23 22 21 20\", \"2ROT DROP 25 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"25 24 23 22 21 20\", \"2ROT 2DROP 20 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"25 24 23 22 21 20\", \"2ROT 2DROP DROP 21 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"25 24 23 22 21 20\", \"2ROT 2DROP 2DROP 22 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"25 24 23 22 21 20\", \"2ROT 2DROP 2DROP DROP 23 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"25 24 23 22 21 20\", \"2ROT 2ROT 22 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"25 24 23 22 21 20\", \"2ROT 2ROT 2ROT 20 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"SWAP 1 EQUALVERIFY 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1\", \"TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"13 14\", \"2DUP ROT EQUALVERIFY EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1 0 1 2\", \"3DUP DEPTH 7 EQUALVERIFY ADD ADD 3 EQUALVERIFY 2DROP 0 EQUALVERIFY\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 2 3 5\", \"2OVER ADD ADD 8 EQUALVERIFY ADD ADD 6 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 3 5 7\", \"2SWAP ADD 4 EQUALVERIFY ADD 12 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"SIZE 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1\", \"SIZE 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"127\", \"SIZE 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"128\", \"SIZE 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"32767\", \"SIZE 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"32768\", \"SIZE 3 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"8388607\", \"SIZE 3 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"8388608\", \"SIZE 4 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"2147483647\", \"SIZE 4 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"2147483648\", \"SIZE 5 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"549755813887\", \"SIZE 5 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"549755813888\", \"SIZE 6 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"9223372036854775807\", \"SIZE 8 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1\", \"SIZE 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-127\", \"SIZE 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-128\", \"SIZE 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-32767\", \"SIZE 2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-32768\", \"SIZE 3 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-8388607\", \"SIZE 3 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-8388608\", \"SIZE 4 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-2147483647\", \"SIZE 4 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-2147483648\", \"SIZE 5 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-549755813887\", \"SIZE 5 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-549755813888\", \"SIZE 6 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-9223372036854775807\", \"SIZE 8 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'abcdefghijklmnopqrstuvwxyz'\", \"SIZE 26 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"42\", \"SIZE 1 EQUALVERIFY 42 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"SIZE does not consume argument\"],\n\n[\"2 -2 ADD\", \"0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"2147483647 -2147483647 ADD\", \"0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1 -1 ADD\", \"-2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"0 0\",\"EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 1 ADD\", \"2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 1ADD\", \"2 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"111 1SUB\", \"110 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"111 1 ADD 12 SUB\", \"100 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 ABS\", \"0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"16 ABS\", \"16 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-16 ABS\", \"-16 NEGATE EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 NOT\", \"NOP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 NOT\", \"0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"11 NOT\", \"0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0NOTEQUAL\", \"0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0NOTEQUAL\", \"1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"111 0NOTEQUAL\", \"1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-111 0NOTEQUAL\", \"1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 1 BOOLAND\", \"NOP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0 BOOLAND\", \"NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1 BOOLAND\", \"NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0 BOOLAND\", \"NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"16 17 BOOLAND\", \"NOP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 1 BOOLOR\", \"NOP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0 BOOLOR\", \"NOP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1 BOOLOR\", \"NOP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0 BOOLOR\", \"NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"16 17 BOOLOR\", \"NOP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"11 10 1 ADD\", \"NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"11 10 1 ADD\", \"NUMEQUALVERIFY 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"11 10 1 ADD\", \"NUMNOTEQUAL NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"111 10 1 ADD\", \"NUMNOTEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"11 10\", \"LESSTHAN NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"4 4\", \"LESSTHAN NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"10 11\", \"LESSTHAN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-11 11\", \"LESSTHAN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-11 -10\", \"LESSTHAN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"11 10\", \"GREATERTHAN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"4 4\", \"GREATERTHAN NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"10 11\", \"GREATERTHAN NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-11 11\", \"GREATERTHAN NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-11 -10\", \"GREATERTHAN NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"11 10\", \"LESSTHANOREQUAL NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"4 4\", \"LESSTHANOREQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"10 11\", \"LESSTHANOREQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-11 11\", \"LESSTHANOREQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-11 -10\", \"LESSTHANOREQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"11 10\", \"GREATERTHANOREQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"4 4\", \"GREATERTHANOREQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"10 11\", \"GREATERTHANOREQUAL NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-11 11\", \"GREATERTHANOREQUAL NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-11 -10\", \"GREATERTHANOREQUAL NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0 MIN\", \"0 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1 MIN\", \"0 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1 0 MIN\", \"-1 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 -2147483647 MIN\", \"-2147483647 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"2147483647 0 MAX\", \"2147483647 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 100 MAX\", \"100 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-100 0 MAX\", \"0 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 -2147483647 MAX\", \"0 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0 1\", \"WITHIN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0 1\", \"WITHIN NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 -2147483647 2147483647\", \"WITHIN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1 -100 100\", \"WITHIN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"11 -100 100\", \"WITHIN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-2147483647 -100 100\", \"WITHIN NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"2147483647 -100 100\", \"WITHIN NOT\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"2147483647 2147483647 SUB\", \"0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"2147483647 DUP ADD\", \"4294967294 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \">32 bit EQUAL is valid\"],\n[\"2147483647 NEGATE DUP ADD\", \"-4294967294 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"''\", \"RIPEMD160 0x14 0x9c1185a5c5e9fc54612808977ee8f548b2258d31 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'a'\", \"RIPEMD160 0x14 0x0bdc9d2d256b3ee9daae347be6f4dc835a467ffe EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'abcdefghijklmnopqrstuvwxyz'\", \"RIPEMD160 0x14 0xf71c27109c692c1b56bbdceb5b9d2865b3708dbc EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"''\", \"SHA1 0x14 0xda39a3ee5e6b4b0d3255bfef95601890afd80709 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'a'\", \"SHA1 0x14 0x86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'abcdefghijklmnopqrstuvwxyz'\", \"SHA1 0x14 0x32d10c7b8cf96570ca04ce37f2a19d84240d3a89 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"''\", \"SHA256 0x20 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'a'\", \"SHA256 0x20 0xca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'abcdefghijklmnopqrstuvwxyz'\", \"SHA256 0x20 0x71c480df93d6ae2f1efad1447c66c9525e316218cf51fc8d9ed832f2daf18b73 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"''\", \"DUP HASH160 SWAP SHA256 RIPEMD160 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"''\", \"DUP HASH256 SWAP SHA256 SHA256 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"''\", \"NOP HASH160 0x14 0xb472a266d0bd89c13706a4132ccfb16f7c3b9fcb EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'a'\", \"HASH160 NOP 0x14 0x994355199e516ff76c4fa4aab39337b9d84cf12b EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'abcdefghijklmnopqrstuvwxyz'\", \"HASH160 0x4c 0x14 0xc286a1af0947f58d1ad787385b1c2c4a976f9e71 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"''\", \"HASH256 0x20 0x5df6e0e2761359d30a8275058e299fcc0381534545f55cf43e41983f5d4c9456 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'a'\", \"HASH256 0x20 0xbf5d3affb73efd2ec6c36ad3112dd933efed63c4e1cbffcfa88e2759c144f2d8 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'abcdefghijklmnopqrstuvwxyz'\", \"HASH256 0x4c 0x20 0xca139bc10c2f660da42666f72e89a225936fc60f193c161124a672050c434671 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n\n[\"1\",\"NOP1 CHECKLOCKTIMEVERIFY CHECKSEQUENCEVERIFY NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 1 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"'NOP_1_to_10' NOP1 CHECKLOCKTIMEVERIFY CHECKSEQUENCEVERIFY NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10\",\"'NOP_1_to_10' EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"1\", \"NOP\", \"P2SH,STRICTENC,DISCOURAGE_UPGRADABLE_NOPS\", \"OK\", \"Discourage NOPx flag allows OP_NOP\"],\n\n[\"0\", \"IF NOP10 ENDIF 1\", \"P2SH,STRICTENC,DISCOURAGE_UPGRADABLE_NOPS\", \"OK\",\n \"Discouraged NOPs are allowed if not executed\"],\n\n[\"0\", \"IF 0xba ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\", \"opcodes above MAX_OPCODE invalid if executed\"],\n[\"0\", \"IF 0xbb ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xbc ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xbd ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xbe ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xbf ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xc0 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xc1 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xc2 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xc3 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xc4 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xc5 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xc6 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xc7 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xc8 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xc9 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xca ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xcb ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xcc ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xcd ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xce ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xcf ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xd0 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xd1 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xd2 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xd3 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xd4 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xd5 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xd6 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xd7 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xd8 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xd9 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xda ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xdb ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xdc ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xdd ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xde ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xdf ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xe0 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xe1 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xe2 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xe3 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xe4 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xe5 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xe6 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xe7 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xe8 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xe9 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xea ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xeb ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xec ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xed ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xee ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xef ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xf0 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xf1 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xf2 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xf3 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xf4 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xf5 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xf6 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xf7 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xf8 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xf9 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xfa ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xfb ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xfc ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xfd ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xfe ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"IF 0xff ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"NOP\",\n\"'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'\",\n\"P2SH,STRICTENC\", \"OK\",\n\"520 byte push\"],\n[\"1\",\n\"0x616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161\",\n\"P2SH,STRICTENC\", \"OK\",\n\"201 opcodes executed. 0x61 is NOP\"],\n[\"1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f\",\n\"1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f\",\n\"P2SH,STRICTENC\", \"OK\",\n\"1,000 stack size (0x6f is 3DUP)\"],\n[\"1 TOALTSTACK 2 TOALTSTACK 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f\",\n\"1 2 3 4 5 6 7 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f\",\n\"P2SH,STRICTENC\", \"OK\",\n\"1,000 stack size (altstack cleared between scriptSig/scriptPubKey)\"],\n[\"'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f\",\n\"'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f 2DUP 0x616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161\",\n\"P2SH,STRICTENC\", \"OK\",\n\"Max-size (10,000-byte), max-push(520 bytes), max-opcodes(201), max stack size(1,000 items). 0x6f is 3DUP, 0x61 is NOP\"],\n\n[\"0\",\n\"IF 0x5050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050505050 ENDIF 1\",\n\"P2SH,STRICTENC\", \"OK\",\n\">201 opcodes, but RESERVED (0x50) doesn't count towards opcode limit.\"],\n\n[\"NOP\",\"1\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"1\", \"0x01 0x01 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"The following is useful for checking implementations of BN_bn2mpi\"],\n[\"127\", \"0x01 0x7F EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"128\", \"0x02 0x8000 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Leave room for the sign bit\"],\n[\"32767\", \"0x02 0xFF7F EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"32768\", \"0x03 0x008000 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"8388607\", \"0x03 0xFFFF7F EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"8388608\", \"0x04 0x00008000 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"2147483647\", \"0x04 0xFFFFFF7F EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"2147483648\", \"0x05 0x0000008000 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"549755813887\", \"0x05 0xFFFFFFFF7F EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"549755813888\", \"0x06 0x000000008000 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"9223372036854775807\", \"0x08 0xFFFFFFFFFFFFFF7F EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1\", \"0x01 0x81 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Numbers are little-endian with the MSB being a sign bit\"],\n[\"-127\", \"0x01 0xFF EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-128\", \"0x02 0x8080 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-32767\", \"0x02 0xFFFF EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-32768\", \"0x03 0x008080 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-8388607\", \"0x03 0xFFFFFF EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-8388608\", \"0x04 0x00008080 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-2147483647\", \"0x04 0xFFFFFFFF EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-2147483648\", \"0x05 0x0000008080 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-4294967295\", \"0x05 0xFFFFFFFF80 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-549755813887\", \"0x05 0xFFFFFFFFFF EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-549755813888\", \"0x06 0x000000008080 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-9223372036854775807\", \"0x08 0xFFFFFFFFFFFFFFFF EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"2147483647\", \"1ADD 2147483648 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"We can do math on 4-byte integers, and compare 5-byte ones\"],\n[\"2147483647\", \"1ADD 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-2147483647\", \"1ADD 1\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"1\", \"0x02 0x0100 EQUAL NOT\", \"P2SH,STRICTENC\", \"OK\", \"Not the same byte array...\"],\n[\"1\", \"0x02 0x0100 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\", \"... but they are numerically equal\"],\n[\"11\", \"0x4c 0x03 0x0b0000 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"0x01 0x80 EQUAL NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"0x01 0x80 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Zero numerically equals negative zero\"],\n[\"0\", \"0x02 0x0080 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0x03 0x000080\", \"0x04 0x00000080 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0x03 0x100080\", \"0x04 0x10000080 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0x03 0x100000\", \"0x04 0x10000000 NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"NOP\", \"NOP 1\", \"P2SH,STRICTENC\", \"OK\", \"The following tests check the if(stack.size() < N) tests in each opcode\"],\n[\"1\", \"IF 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\", \"They are here to catch copy-and-paste errors\"],\n[\"0\", \"NOTIF 1 ENDIF\", \"P2SH,STRICTENC\", \"OK\", \"Most of them are duplicated elsewhere,\"],\n[\"1\", \"VERIFY 1\", \"P2SH,STRICTENC\", \"OK\", \"but, hey, more is always better, right?\"],\n\n[\"0\", \"TOALTSTACK 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1\", \"TOALTSTACK FROMALTSTACK\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0\", \"2DROP 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1\", \"2DUP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0 1\", \"3DUP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1 0 0\", \"2OVER\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1 0 0 0 0\", \"2ROT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1 0 0\", \"2SWAP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1\", \"IFDUP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"DEPTH 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"DROP 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1\", \"DUP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1\", \"NIP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"OVER\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0 0 0 3\", \"PICK\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"PICK\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0 0 0 3\", \"ROLL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"ROLL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0 0\", \"ROT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"SWAP\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 1\", \"TUCK\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"1\", \"SIZE\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"0 0\", \"EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0\", \"EQUALVERIFY 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0 1\", \"EQUAL EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"OP_0 and bools must have identical byte representations\"],\n\n[\"0\", \"1ADD\", \"P2SH,STRICTENC\", \"OK\"],\n[\"2\", \"1SUB\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1\", \"NEGATE\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1\", \"ABS\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"NOT\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1\", \"0NOTEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"1 0\", \"ADD\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"SUB\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1 -1\", \"BOOLAND\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1 0\", \"BOOLOR\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0\", \"NUMEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0\", \"NUMEQUALVERIFY 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1 0\", \"NUMNOTEQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1 0\", \"LESSTHAN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"GREATERTHAN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0\", \"LESSTHANOREQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0 0\", \"GREATERTHANOREQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1 0\", \"MIN\", \"P2SH,STRICTENC\", \"OK\"],\n[\"1 0\", \"MAX\", \"P2SH,STRICTENC\", \"OK\"],\n[\"-1 -1 0\", \"WITHIN\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"0\", \"RIPEMD160\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"SHA1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"SHA256\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"HASH160\", \"P2SH,STRICTENC\", \"OK\"],\n[\"0\", \"HASH256\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"CODESEPARATOR 1\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"NOP\", \"NOP1 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"CHECKLOCKTIMEVERIFY 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"CHECKSEQUENCEVERIFY 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"NOP4 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"NOP5 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"NOP6 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"NOP7 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"NOP8 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"NOP9 1\", \"P2SH,STRICTENC\", \"OK\"],\n[\"NOP\", \"NOP10 1\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"\", \"0 0 0 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"CHECKMULTISIG is allowed to have zero keys and/or sigs\"],\n[\"\", \"0 0 0 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 0 1 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Zero sigs means no sigs are checked\"],\n[\"\", \"0 0 0 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"\", \"0 0 0 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"CHECKMULTISIG is allowed to have zero keys and/or sigs\"],\n[\"\", \"0 0 0 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 0 1 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Zero sigs means no sigs are checked\"],\n[\"\", \"0 0 0 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"\", \"0 0 'a' 'b' 2 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Test from up to 20 pubkeys, all not checked\"],\n[\"\", \"0 0 'a' 'b' 'c' 3 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 4 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 5 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 6 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 7 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 8 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 9 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 10 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 11 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 12 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 13 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 14 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 15 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 16 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 17 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 18 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 19 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG VERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 1 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 2 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 3 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 4 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 5 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 6 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 7 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 8 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 9 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 10 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 11 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 12 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 13 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 14 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 15 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 16 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 17 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 18 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 19 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n[\"\", \"0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"\",\n\"0 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG\",\n\"P2SH,STRICTENC\", \"OK\",\n\"nOpCount is incremented by the number of keys evaluated in addition to the usual one op per op. In this case we have zero keys, so we can execute 201 CHECKMULTISIGS\"],\n\n[\"1\",\n\"0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY 0 0 0 CHECKMULTISIGVERIFY\",\n\"P2SH,STRICTENC\", \"OK\"],\n\n[\"\",\n\"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG\",\n\"P2SH,STRICTENC\", \"OK\",\n\"Even though there are no signatures being checked nOpCount is incremented by the number of keys.\"],\n\n[\"1\",\n\"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY\",\n\"P2SH,STRICTENC\", \"OK\"],\n\n[\"0 0x01 1\", \"HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Very basic P2SH\"],\n[\"0x4c 0 0x01 1\", \"HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL\", \"P2SH,STRICTENC\", \"OK\"],\n\n[\"0x40 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242\",\n\"0x4d 0x4000 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242 EQUAL\",\n\"P2SH,STRICTENC\", \"OK\",\n\"Basic PUSH signedness check\"],\n\n[\"0x4c 0x40 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242\",\n\"0x4d 0x4000 0x42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242 EQUAL\",\n\"P2SH,STRICTENC\", \"OK\",\n\"Basic PUSHDATA1 signedness check\"],\n\n[\"all PUSHDATA forms are equivalent\"],\n\n[\"0x4c 0x4b 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\", \"0x4b 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 EQUAL\", \"\", \"OK\", \"PUSHDATA1 of 75 bytes equals direct push of it\"],\n[\"0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\", \"0x4c 0xFF 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 EQUAL\", \"\", \"OK\", \"PUSHDATA2 of 255 bytes equals PUSHDATA1 of it\"],\n\n[\"0x00\", \"SIZE 0 EQUAL\", \"P2SH,STRICTENC\", \"OK\", \"Basic OP_0 execution\"],\n\n[\"Numeric pushes\"],\n\n[\"0x01 0x81\", \"0x4f EQUAL\", \"\", \"OK\", \"OP1_NEGATE pushes 0x81\"],\n[\"0x01 0x01\", \"0x51 EQUAL\", \"\", \"OK\", \"OP_1  pushes 0x01\"],\n[\"0x01 0x02\", \"0x52 EQUAL\", \"\", \"OK\", \"OP_2  pushes 0x02\"],\n[\"0x01 0x03\", \"0x53 EQUAL\", \"\", \"OK\", \"OP_3  pushes 0x03\"],\n[\"0x01 0x04\", \"0x54 EQUAL\", \"\", \"OK\", \"OP_4  pushes 0x04\"],\n[\"0x01 0x05\", \"0x55 EQUAL\", \"\", \"OK\", \"OP_5  pushes 0x05\"],\n[\"0x01 0x06\", \"0x56 EQUAL\", \"\", \"OK\", \"OP_6  pushes 0x06\"],\n[\"0x01 0x07\", \"0x57 EQUAL\", \"\", \"OK\", \"OP_7  pushes 0x07\"],\n[\"0x01 0x08\", \"0x58 EQUAL\", \"\", \"OK\", \"OP_8  pushes 0x08\"],\n[\"0x01 0x09\", \"0x59 EQUAL\", \"\", \"OK\", \"OP_9  pushes 0x09\"],\n[\"0x01 0x0a\", \"0x5a EQUAL\", \"\", \"OK\", \"OP_10 pushes 0x0a\"],\n[\"0x01 0x0b\", \"0x5b EQUAL\", \"\", \"OK\", \"OP_11 pushes 0x0b\"],\n[\"0x01 0x0c\", \"0x5c EQUAL\", \"\", \"OK\", \"OP_12 pushes 0x0c\"],\n[\"0x01 0x0d\", \"0x5d EQUAL\", \"\", \"OK\", \"OP_13 pushes 0x0d\"],\n[\"0x01 0x0e\", \"0x5e EQUAL\", \"\", \"OK\", \"OP_14 pushes 0x0e\"],\n[\"0x01 0x0f\", \"0x5f EQUAL\", \"\", \"OK\", \"OP_15 pushes 0x0f\"],\n[\"0x01 0x10\", \"0x60 EQUAL\", \"\", \"OK\", \"OP_16 pushes 0x10\"],\n\n[\"Equivalency of different numeric encodings\"],\n\n[\"0x02 0x8000\", \"128 NUMEQUAL\", \"\", \"OK\", \"0x8000 equals 128\"],\n[\"0x01 0x00\", \"0 NUMEQUAL\", \"\", \"OK\", \"0x00 numequals 0\"],\n[\"0x01 0x80\", \"0 NUMEQUAL\", \"\", \"OK\", \"0x80 (negative zero) numequals 0\"],\n[\"0x02 0x0080\", \"0 NUMEQUAL\", \"\", \"OK\", \"0x0080 numequals 0\"],\n[\"0x02 0x0500\", \"5 NUMEQUAL\", \"\", \"OK\", \"0x0500 numequals 5\"],\n[\"0x03 0xff7f80\", \"0x02 0xffff NUMEQUAL\", \"\", \"OK\", \"\"],\n[\"0x03 0xff7f00\", \"0x02 0xff7f NUMEQUAL\", \"\", \"OK\", \"\"],\n[\"0x04 0xffff7f80\", \"0x03 0xffffff NUMEQUAL\", \"\", \"OK\", \"\"],\n[\"0x04 0xffff7f00\", \"0x03 0xffff7f NUMEQUAL\", \"\", \"OK\", \"\"],\n\n[\"Unevaluated non-minimal pushes are ignored\"],\n\n[\"0 IF 0x4c 0x00 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"non-minimal PUSHDATA1 ignored\"],\n[\"0 IF 0x4d 0x0000 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"non-minimal PUSHDATA2 ignored\"],\n[\"0 IF 0x4c 0x00000000 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"non-minimal PUSHDATA4 ignored\"],\n[\"0 IF 0x01 0x81 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"1NEGATE equiv\"],\n[\"0 IF 0x01 0x01 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_1  equiv\"],\n[\"0 IF 0x01 0x02 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_2  equiv\"],\n[\"0 IF 0x01 0x03 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_3  equiv\"],\n[\"0 IF 0x01 0x04 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_4  equiv\"],\n[\"0 IF 0x01 0x05 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_5  equiv\"],\n[\"0 IF 0x01 0x06 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_6  equiv\"],\n[\"0 IF 0x01 0x07 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_7  equiv\"],\n[\"0 IF 0x01 0x08 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_8  equiv\"],\n[\"0 IF 0x01 0x09 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_9  equiv\"],\n[\"0 IF 0x01 0x0a ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_10 equiv\"],\n[\"0 IF 0x01 0x0b ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_11 equiv\"],\n[\"0 IF 0x01 0x0c ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_12 equiv\"],\n[\"0 IF 0x01 0x0d ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_13 equiv\"],\n[\"0 IF 0x01 0x0e ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_14 equiv\"],\n[\"0 IF 0x01 0x0f ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_15 equiv\"],\n[\"0 IF 0x01 0x10 ENDIF 1\", \"\", \"MINIMALDATA\", \"OK\", \"OP_16 equiv\"],\n\n[\"Numeric minimaldata rules are only applied when a stack item is numerically evaluated; the push itself is allowed\"],\n\n[\"0x01 0x00\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x01 0x80\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0180\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0100\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0200\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0300\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0400\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0500\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0600\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0700\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0800\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0900\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0a00\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0b00\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0c00\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0d00\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0e00\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x0f00\", \"1\", \"MINIMALDATA\", \"OK\"],\n[\"0x02 0x1000\", \"1\", \"MINIMALDATA\", \"OK\"],\n\n[\"Valid version of the 'Test every numeric-accepting opcode for correct handling of the numeric minimal encoding rule' script_invalid test\"],\n\n[\"1 0x02 0x0000\", \"PICK DROP\", \"\", \"OK\"],\n[\"1 0x02 0x0000\", \"ROLL DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000\", \"1ADD DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000\", \"1SUB DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000\", \"NEGATE DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000\", \"ABS DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000\", \"NOT DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000\", \"0NOTEQUAL DROP 1\", \"\", \"OK\"],\n\n[\"0 0x02 0x0000\", \"ADD DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"ADD DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"SUB DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"SUB DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"BOOLAND DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"BOOLAND DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"BOOLOR DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"BOOLOR DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"NUMEQUAL DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 1\", \"NUMEQUAL DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"NUMEQUALVERIFY 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"NUMEQUALVERIFY 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"NUMNOTEQUAL DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"NUMNOTEQUAL DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"LESSTHAN DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"LESSTHAN DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"GREATERTHAN DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"GREATERTHAN DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"LESSTHANOREQUAL DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"LESSTHANOREQUAL DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"GREATERTHANOREQUAL DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"GREATERTHANOREQUAL DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"MIN DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"MIN DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000\", \"MAX DROP 1\", \"\", \"OK\"],\n[\"0x02 0x0000 0\", \"MAX DROP 1\", \"\", \"OK\"],\n\n[\"0x02 0x0000 0 0\", \"WITHIN DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000 0\", \"WITHIN DROP 1\", \"\", \"OK\"],\n[\"0 0 0x02 0x0000\", \"WITHIN DROP 1\", \"\", \"OK\"],\n\n[\"0 0 0x02 0x0000\", \"CHECKMULTISIG DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000 0\", \"CHECKMULTISIG DROP 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000 0 1\", \"CHECKMULTISIG DROP 1\", \"\", \"OK\"],\n[\"0 0 0x02 0x0000\", \"CHECKMULTISIGVERIFY 1\", \"\", \"OK\"],\n[\"0 0x02 0x0000 0\", \"CHECKMULTISIGVERIFY 1\", \"\", \"OK\"],\n\n[\"While not really correctly DER encoded, the empty signature is allowed by\"],\n[\"STRICTENC to provide a compact way to provide a delibrately invalid signature.\"],\n[\"0\", \"0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 CHECKSIG NOT\", \"STRICTENC\", \"OK\"],\n[\"0 0\", \"1 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 1 CHECKMULTISIG NOT\", \"STRICTENC\", \"OK\"],\n\n[\"CHECKMULTISIG evaluation order tests. CHECKMULTISIG evaluates signatures and\"],\n[\"pubkeys in a specific order, and will exit early if the number of signatures\"],\n[\"left to check is greater than the number of keys left. As STRICTENC fails the\"],\n[\"script when it reaches an invalidly encoded signature or pubkey, we can use it\"],\n[\"to test the exact order in which signatures and pubkeys are evaluated by\"],\n[\"distinguishing CHECKMULTISIG returning false on the stack and the script as a\"],\n[\"whole failing.\"],\n[\"See also the corresponding inverted versions of these tests in script_invalid.json\"],\n[\n    \"0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501\",\n    \"2 0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT\",\n    \"STRICTENC\", \"OK\",\n    \"2-of-2 CHECKMULTISIG NOT with the second pubkey invalid, and both signatures validly encoded. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid pubkey.\"\n],\n[\n    \"0 0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501\",\n    \"2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT\",\n    \"STRICTENC\", \"OK\",\n    \"2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but second signature invalid. Valid pubkey fails, and CHECKMULTISIG exits early, prior to evaluation of second invalid signature.\"\n],\n\n[\"Increase test coverage for DERSIG\"],\n[\"0x4a 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\", \"0 CHECKSIG NOT\", \"\", \"OK\", \"Overly long signature is correctly encoded\"],\n[\"0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000\", \"0 CHECKSIG NOT\", \"\", \"OK\", \"Missing S is correctly encoded\"],\n[\"0x27 0x3024021077777777777777777777777777777777020a7777777777777777777777777777777701\", \"0 CHECKSIG NOT\", \"\", \"OK\", \"S with invalid S length is correctly encoded\"],\n[\"0x27 0x302403107777777777777777777777777777777702107777777777777777777777777777777701\", \"0 CHECKSIG NOT\", \"\", \"OK\", \"Non-integer R is correctly encoded\"],\n[\"0x27 0x302402107777777777777777777777777777777703107777777777777777777777777777777701\", \"0 CHECKSIG NOT\", \"\", \"OK\", \"Non-integer S is correctly encoded\"],\n[\"0x17 0x3014020002107777777777777777777777777777777701\", \"0 CHECKSIG NOT\", \"\", \"OK\", \"Zero-length R is correctly encoded\"],\n[\"0x17 0x3014021077777777777777777777777777777777020001\", \"0 CHECKSIG NOT\", \"\", \"OK\", \"Zero-length S is correctly encoded for DERSIG\"],\n[\"0x27 0x302402107777777777777777777777777777777702108777777777777777777777777777777701\", \"0 CHECKSIG NOT\", \"\", \"OK\", \"Negative S is correctly encoded\"],\n \n[\"2147483648\", \"CHECKSEQUENCEVERIFY\", \"CHECKSEQUENCEVERIFY\", \"OK\", \"CSV passes if stack top bit 1 << 31 is set\"],\n\n[\"\", \"DEPTH\", \"P2SH,STRICTENC\",   \"EVAL_FALSE\", \"Test the test: we should have an empty stack after scriptSig evaluation\"],\n[\"  \", \"DEPTH\", \"P2SH,STRICTENC\", \"EVAL_FALSE\", \"and multiple spaces should not change that.\"],\n[\"   \", \"DEPTH\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"    \", \"DEPTH\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n\n[\"\", \"\", \"P2SH,STRICTENC\",\"EVAL_FALSE\"],\n[\"\", \"NOP\", \"P2SH,STRICTENC\",\"EVAL_FALSE\"],\n[\"\", \"NOP DEPTH\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"NOP\", \"\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"NOP\", \"DEPTH\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"NOP\",\"NOP\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"NOP\",\"NOP DEPTH\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n\n[\"DEPTH\", \"\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n\n[\"0x4c01\",\"0x01 NOP\", \"P2SH,STRICTENC\",\"BAD_OPCODE\", \"PUSHDATA1 with not enough bytes\"],\n[\"0x4d0200ff\",\"0x01 NOP\", \"P2SH,STRICTENC\",\"BAD_OPCODE\", \"PUSHDATA2 with not enough bytes\"],\n[\"0x4e03000000ffff\",\"0x01 NOP\", \"P2SH,STRICTENC\",\"BAD_OPCODE\", \"PUSHDATA4 with not enough bytes\"],\n\n[\"1\", \"IF 0x50 ENDIF 1\", \"P2SH,STRICTENC\",\"BAD_OPCODE\", \"0x50 is reserved\"],\n[\"0x52\", \"0x5f ADD 0x60 EQUAL\", \"P2SH,STRICTENC\",\"EVAL_FALSE\", \"0x51 through 0x60 push 1 through 16 onto stack\"],\n[\"0\",\"NOP\", \"P2SH,STRICTENC\",\"EVAL_FALSE\",\"\"],\n[\"1\", \"IF VER ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"VER non-functional\"],\n[\"0\", \"IF VERIF ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"VERIF illegal everywhere\"],\n[\"0\", \"IF ELSE 1 ELSE VERIF ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"VERIF illegal everywhere\"],\n[\"0\", \"IF VERNOTIF ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"VERNOTIF illegal everywhere\"],\n[\"0\", \"IF ELSE 1 ELSE VERNOTIF ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"VERNOTIF illegal everywhere\"],\n\n[\"1 IF\", \"1 ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\", \"IF/ENDIF can't span scriptSig/scriptPubKey\"],\n[\"1 IF 0 ENDIF\", \"1 ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\"],\n[\"1 ELSE 0 ENDIF\", \"1\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\"],\n[\"0 NOTIF\", \"123\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\"],\n\n[\"0\", \"DUP IF ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"0\", \"IF 1 ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"0\", \"DUP IF ELSE ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"0\", \"IF 1 ELSE ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"0\", \"NOTIF ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n\n[\"0 1\", \"IF IF 1 ELSE 0 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"0 0\", \"IF IF 1 ELSE 0 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"1 0\", \"IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"0 1\", \"IF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n\n[\"0 0\", \"NOTIF IF 1 ELSE 0 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"0 1\", \"NOTIF IF 1 ELSE 0 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"1 1\", \"NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"0 0\", \"NOTIF IF 1 ELSE 0 ENDIF ELSE IF 0 ELSE 1 ENDIF ENDIF\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n\n[\"1\", \"IF RETURN ELSE ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"OP_RETURN\", \"Multiple ELSEs\"],\n[\"1\", \"IF 1 ELSE ELSE RETURN ENDIF\", \"P2SH,STRICTENC\", \"OP_RETURN\"],\n\n[\"1\", \"ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\", \"Malformed IF/ELSE/ENDIF sequence\"],\n[\"1\", \"ELSE ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\"],\n[\"1\", \"ENDIF ELSE\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\"],\n[\"1\", \"ENDIF ELSE IF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\"],\n[\"1\", \"IF ELSE ENDIF ELSE\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\"],\n[\"1\", \"IF ELSE ENDIF ELSE ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\"],\n[\"1\", \"IF ENDIF ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\"],\n[\"1\", \"IF ELSE ELSE ENDIF ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\"],\n\n[\"1\", \"RETURN\", \"P2SH,STRICTENC\", \"OP_RETURN\"],\n[\"1\", \"DUP IF RETURN ENDIF\", \"P2SH,STRICTENC\", \"OP_RETURN\"],\n\n[\"1\", \"RETURN 'data'\", \"P2SH,STRICTENC\", \"OP_RETURN\", \"canonical prunable txout format\"],\n[\"0 IF\", \"RETURN ENDIF 1\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\", \"still prunable because IF/ENDIF can't span scriptSig/scriptPubKey\"],\n\n[\"0\", \"VERIFY 1\", \"P2SH,STRICTENC\", \"VERIFY\"],\n[\"1\", \"VERIFY\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"1\", \"VERIFY 0\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n\n[\"1 TOALTSTACK\", \"FROMALTSTACK 1\", \"P2SH,STRICTENC\", \"INVALID_ALTSTACK_OPERATION\", \"alt stack not shared between sig/pubkey\"],\n\n[\"IFDUP\", \"DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"DROP\", \"DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"DUP\", \"DEPTH 0 EQUAL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"DUP 1 ADD 2 EQUALVERIFY 0 EQUAL\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"NOP\", \"NIP\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"1 NIP\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"1 0 NIP\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"NOP\", \"OVER 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"OVER\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"0 1\", \"OVER DEPTH 3 EQUALVERIFY\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"19 20 21\", \"PICK 19 EQUALVERIFY DEPTH 2 EQUAL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"0 PICK\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"-1 PICK\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"19 20 21\", \"0 PICK 20 EQUALVERIFY DEPTH 3 EQUAL\", \"P2SH,STRICTENC\", \"EQUALVERIFY\"],\n[\"19 20 21\", \"1 PICK 21 EQUALVERIFY DEPTH 3 EQUAL\", \"P2SH,STRICTENC\", \"EQUALVERIFY\"],\n[\"19 20 21\", \"2 PICK 22 EQUALVERIFY DEPTH 3 EQUAL\", \"P2SH,STRICTENC\", \"EQUALVERIFY\"],\n[\"NOP\", \"0 ROLL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"-1 ROLL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"19 20 21\", \"0 ROLL 20 EQUALVERIFY DEPTH 2 EQUAL\", \"P2SH,STRICTENC\", \"EQUALVERIFY\"],\n[\"19 20 21\", \"1 ROLL 21 EQUALVERIFY DEPTH 2 EQUAL\", \"P2SH,STRICTENC\", \"EQUALVERIFY\"],\n[\"19 20 21\", \"2 ROLL 22 EQUALVERIFY DEPTH 2 EQUAL\", \"P2SH,STRICTENC\", \"EQUALVERIFY\"],\n[\"NOP\", \"ROT 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"1 ROT 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"1 2 ROT 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"0 1 2 ROT\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"NOP\", \"SWAP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"SWAP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"0 1\", \"SWAP 1 EQUALVERIFY\", \"P2SH,STRICTENC\", \"EQUALVERIFY\"],\n[\"NOP\", \"TUCK 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"TUCK 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1 0\", \"TUCK DEPTH 3 EQUALVERIFY SWAP 2DROP\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"NOP\", \"2DUP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"2DUP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"3DUP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"3DUP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1 2\", \"3DUP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"2OVER 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"2 3 2OVER 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"2SWAP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"2 3 2SWAP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n\n[\"'a' 'b'\", \"CAT\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"CAT disabled\"],\n[\"'a' 'b' 0\", \"IF CAT ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"CAT disabled\"],\n[\"'abc' 1 1\", \"SUBSTR\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"SUBSTR disabled\"],\n[\"'abc' 1 1 0\", \"IF SUBSTR ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"SUBSTR disabled\"],\n[\"'abc' 2 0\", \"IF LEFT ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"LEFT disabled\"],\n[\"'abc' 2 0\", \"IF RIGHT ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"RIGHT disabled\"],\n\n[\"NOP\", \"SIZE 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n\n[\"'abc'\", \"IF INVERT ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"INVERT disabled\"],\n[\"1 2 0 IF AND ELSE 1 ENDIF\", \"NOP\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"AND disabled\"],\n[\"1 2 0 IF OR ELSE 1 ENDIF\", \"NOP\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"OR disabled\"],\n[\"1 2 0 IF XOR ELSE 1 ENDIF\", \"NOP\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"XOR disabled\"],\n[\"2 0 IF 2MUL ELSE 1 ENDIF\", \"NOP\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"2MUL disabled\"],\n[\"2 0 IF 2DIV ELSE 1 ENDIF\", \"NOP\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"2DIV disabled\"],\n[\"2 2 0 IF MUL ELSE 1 ENDIF\", \"NOP\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"MUL disabled\"],\n[\"2 2 0 IF DIV ELSE 1 ENDIF\", \"NOP\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"DIV disabled\"],\n[\"2 2 0 IF MOD ELSE 1 ENDIF\", \"NOP\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"MOD disabled\"],\n[\"2 2 0 IF LSHIFT ELSE 1 ENDIF\", \"NOP\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"LSHIFT disabled\"],\n[\"2 2 0 IF RSHIFT ELSE 1 ENDIF\", \"NOP\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"RSHIFT disabled\"],\n\n[\"\", \"EQUAL NOT\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\", \"EQUAL must error when there are no stack items\"],\n[\"0\", \"EQUAL NOT\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\", \"EQUAL must error when there are not 2 stack items\"],\n[\"0 1\",\"EQUAL\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"1 1 ADD\", \"0 EQUAL\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"11 1 ADD 12 SUB\", \"11 EQUAL\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n\n[\"2147483648 0 ADD\", \"NOP\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"arithmetic operands must be in range [-2^31...2^31] \"],\n[\"-2147483648 0 ADD\", \"NOP\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"arithmetic operands must be in range [-2^31...2^31] \"],\n[\"2147483647 DUP ADD\", \"4294967294 NUMEQUAL\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"NUMEQUAL must be in numeric range\"],\n[\"'abcdef' NOT\", \"0 EQUAL\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"NOT is an arithmetic operand\"],\n\n[\"2 DUP MUL\", \"4 EQUAL\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"disabled\"],\n[\"2 DUP DIV\", \"1 EQUAL\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"disabled\"],\n[\"2 2MUL\", \"4 EQUAL\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"disabled\"],\n[\"2 2DIV\", \"1 EQUAL\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"disabled\"],\n[\"7 3 MOD\", \"1 EQUAL\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"disabled\"],\n[\"2 2 LSHIFT\", \"8 EQUAL\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"disabled\"],\n[\"2 1 RSHIFT\", \"1 EQUAL\", \"P2SH,STRICTENC\", \"DISABLED_OPCODE\", \"disabled\"],\n\n[\"1\", \"NOP1 CHECKLOCKTIMEVERIFY CHECKSEQUENCEVERIFY NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10 2 EQUAL\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n[\"'NOP_1_to_10' NOP1 CHECKLOCKTIMEVERIFY CHECKSEQUENCEVERIFY NOP4 NOP5 NOP6 NOP7 NOP8 NOP9 NOP10\",\"'NOP_1_to_11' EQUAL\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n\n[\"Ensure 100% coverage of discouraged NOPS\"],\n[\"1\", \"NOP1\",  \"P2SH,DISCOURAGE_UPGRADABLE_NOPS\", \"DISCOURAGE_UPGRADABLE_NOPS\"],\n[\"1\", \"NOP4\",  \"P2SH,DISCOURAGE_UPGRADABLE_NOPS\", \"DISCOURAGE_UPGRADABLE_NOPS\"],\n[\"1\", \"NOP5\",  \"P2SH,DISCOURAGE_UPGRADABLE_NOPS\", \"DISCOURAGE_UPGRADABLE_NOPS\"],\n[\"1\", \"NOP6\",  \"P2SH,DISCOURAGE_UPGRADABLE_NOPS\", \"DISCOURAGE_UPGRADABLE_NOPS\"],\n[\"1\", \"NOP7\",  \"P2SH,DISCOURAGE_UPGRADABLE_NOPS\", \"DISCOURAGE_UPGRADABLE_NOPS\"],\n[\"1\", \"NOP8\",  \"P2SH,DISCOURAGE_UPGRADABLE_NOPS\", \"DISCOURAGE_UPGRADABLE_NOPS\"],\n[\"1\", \"NOP9\",  \"P2SH,DISCOURAGE_UPGRADABLE_NOPS\", \"DISCOURAGE_UPGRADABLE_NOPS\"],\n[\"1\", \"NOP10\", \"P2SH,DISCOURAGE_UPGRADABLE_NOPS\", \"DISCOURAGE_UPGRADABLE_NOPS\"],\n\n[\"NOP10\", \"1\", \"P2SH,DISCOURAGE_UPGRADABLE_NOPS\", \"DISCOURAGE_UPGRADABLE_NOPS\", \"Discouraged NOP10 in scriptSig\"],\n\n[\"1 0x01 0xb9\", \"HASH160 0x14 0x15727299b05b45fdaf9ac9ecf7565cfe27c3e567 EQUAL\",\n \"P2SH,DISCOURAGE_UPGRADABLE_NOPS\", \"DISCOURAGE_UPGRADABLE_NOPS\", \"Discouraged NOP10 in redeemScript\"],\n\n[\"0x50\",\"1\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"opcode 0x50 is reserved\"],\n[\"1\", \"IF 0xba ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"opcodes above MAX_OPCODE invalid if executed\"],\n[\"1\", \"IF 0xbb ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xbc ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xbd ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xbe ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xbf ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xc0 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xc1 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xc2 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xc3 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xc4 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xc5 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xc6 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xc7 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xc8 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xc9 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xca ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xcb ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xcc ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xcd ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xce ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xcf ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xd0 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xd1 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xd2 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xd3 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xd4 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xd5 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xd6 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xd7 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xd8 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xd9 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xda ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xdb ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xdc ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xdd ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xde ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xdf ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xe0 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xe1 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xe2 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xe3 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xe4 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xe5 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xe6 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xe7 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xe8 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xe9 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xea ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xeb ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xec ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xed ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xee ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xef ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xf0 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xf1 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xf2 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xf3 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xf4 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xf5 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xf6 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xf7 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xf8 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xf9 ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xfa ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xfb ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xfc ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xfd ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xfe ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n[\"1\", \"IF 0xff ELSE 1 ENDIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\"],\n\n[\"1 IF 1 ELSE\", \"0xff ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\", \"invalid because scriptSig and scriptPubKey are processed separately\"],\n\n[\"NOP\", \"RIPEMD160\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"SHA1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"SHA256\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"HASH160\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"HASH256\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n\n[\"NOP\",\n\"'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'\",\n\"P2SH,STRICTENC\",\n\"PUSH_SIZE\",\n\">520 byte push\"],\n[\"0\",\n\"IF 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' ENDIF 1\",\n\"P2SH,STRICTENC\",\n\"PUSH_SIZE\",\n\">520 byte push in non-executed IF branch\"],\n[\"1\",\n\"0x61616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161\",\n\"P2SH,STRICTENC\",\n\"OP_COUNT\",\n\">201 opcodes executed. 0x61 is NOP\"],\n[\"0\",\n\"IF 0x6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161 ENDIF 1\",\n\"P2SH,STRICTENC\",\n\"OP_COUNT\",\n\">201 opcodes including non-executed IF branch. 0x61 is NOP\"],\n[\"1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f\",\n\"1 2 3 4 5 6 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f\",\n\"P2SH,STRICTENC\",\n\"STACK_SIZE\",\n\">1,000 stack size (0x6f is 3DUP)\"],\n[\"1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f\",\n\"1 TOALTSTACK 2 TOALTSTACK 3 4 5 6 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f\",\n\"P2SH,STRICTENC\",\n\"STACK_SIZE\",\n\">1,000 stack+altstack size\"],\n[\"NOP\",\n\"0 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f 2DUP 0x616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161\",\n\"P2SH,STRICTENC\",\n\"SCRIPT_SIZE\",\n\"10,001-byte scriptPubKey\"],\n\n[\"NOP1\",\"NOP10\", \"P2SH,STRICTENC\", \"EVAL_FALSE\"],\n\n[\"1\",\"VER\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"OP_VER is reserved\"],\n[\"1\",\"VERIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"OP_VERIF is reserved\"],\n[\"1\",\"VERNOTIF\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"OP_VERNOTIF is reserved\"],\n[\"1\",\"RESERVED\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"OP_RESERVED is reserved\"],\n[\"1\",\"RESERVED1\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"OP_RESERVED1 is reserved\"],\n[\"1\",\"RESERVED2\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"OP_RESERVED2 is reserved\"],\n[\"1\",\"0xba\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"0xba == MAX_OPCODE + 1\"],\n\n[\"2147483648\", \"1ADD 1\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"We cannot do math on 5-byte integers\"],\n[\"2147483648\", \"NEGATE 1\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"We cannot do math on 5-byte integers\"],\n[\"-2147483648\", \"1ADD 1\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"Because we use a sign bit, -2147483648 is also 5 bytes\"],\n[\"2147483647\", \"1ADD 1SUB 1\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"We cannot do math on 5-byte integers, even if the result is 4-bytes\"],\n[\"2147483648\", \"1SUB 1\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"We cannot do math on 5-byte integers, even if the result is 4-bytes\"],\n\n[\"2147483648 1\", \"BOOLOR 1\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"We cannot do BOOLOR on 5-byte integers (but we can still do IF etc)\"],\n[\"2147483648 1\", \"BOOLAND 1\", \"P2SH,STRICTENC\", \"UNKNOWN_ERROR\", \"We cannot do BOOLAND on 5-byte integers\"],\n\n[\"1\", \"1 ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\", \"ENDIF without IF\"],\n[\"1\", \"IF 1\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\", \"IF without ENDIF\"],\n[\"1 IF 1\", \"ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\", \"IFs don't carry over\"],\n\n[\"NOP\", \"IF 1 ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\", \"The following tests check the if(stack.size() < N) tests in each opcode\"],\n[\"NOP\", \"NOTIF 1 ENDIF\", \"P2SH,STRICTENC\", \"UNBALANCED_CONDITIONAL\", \"They are here to catch copy-and-paste errors\"],\n[\"NOP\", \"VERIFY 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\", \"Most of them are duplicated elsewhere,\"],\n\n[\"NOP\", \"TOALTSTACK 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\", \"but, hey, more is always better, right?\"],\n[\"1\", \"FROMALTSTACK\", \"P2SH,STRICTENC\", \"INVALID_ALTSTACK_OPERATION\"],\n[\"1\", \"2DROP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"2DUP\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1 1\", \"3DUP\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1 1 1\", \"2OVER\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1 1 1 1 1\", \"2ROT\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1 1 1\", \"2SWAP\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"IFDUP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"DROP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"DUP 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"NIP\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"OVER\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1 1 1 3\", \"PICK\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"0\", \"PICK 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1 1 1 3\", \"ROLL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"0\", \"ROLL 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1 1\", \"ROT\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"SWAP\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"TUCK\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n\n[\"NOP\", \"SIZE 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n\n[\"1\", \"EQUAL 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"EQUALVERIFY 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n\n[\"NOP\", \"1ADD 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"1SUB 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"NEGATE 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"ABS 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"NOT 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"0NOTEQUAL 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n\n[\"1\", \"ADD\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"SUB\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"BOOLAND\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"BOOLOR\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"NUMEQUAL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"NUMEQUALVERIFY 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"NUMNOTEQUAL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"LESSTHAN\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"GREATERTHAN\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"LESSTHANOREQUAL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"GREATERTHANOREQUAL\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"MIN\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1\", \"MAX\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"1 1\", \"WITHIN\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n\n[\"NOP\", \"RIPEMD160 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"SHA1 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"SHA256 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"HASH160 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n[\"NOP\", \"HASH256 1\", \"P2SH,STRICTENC\", \"INVALID_STACK_OPERATION\"],\n\n[\"Increase CHECKSIG and CHECKMULTISIG negative test coverage\"],\n[\"\", \"CHECKSIG NOT\", \"STRICTENC\", \"INVALID_STACK_OPERATION\", \"CHECKSIG must error when there are no stack items\"],\n[\"0\", \"CHECKSIG NOT\", \"STRICTENC\", \"INVALID_STACK_OPERATION\", \"CHECKSIG must error when there are not 2 stack items\"],\n[\"\", \"CHECKMULTISIG NOT\", \"STRICTENC\", \"INVALID_STACK_OPERATION\", \"CHECKMULTISIG must error when there are no stack items\"],\n[\"\", \"-1 CHECKMULTISIG NOT\", \"STRICTENC\", \"PUBKEY_COUNT\", \"CHECKMULTISIG must error when the specified number of pubkeys is negative\"],\n[\"\", \"1 CHECKMULTISIG NOT\", \"STRICTENC\", \"INVALID_STACK_OPERATION\", \"CHECKMULTISIG must error when there are not enough pubkeys on the stack\"],\n[\"\", \"-1 0 CHECKMULTISIG NOT\", \"STRICTENC\", \"SIG_COUNT\", \"CHECKMULTISIG must error when the specified number of signatures is negative\"],\n[\"\", \"1 'pk1' 1 CHECKMULTISIG NOT\", \"STRICTENC\", \"INVALID_STACK_OPERATION\", \"CHECKMULTISIG must error when there are not enough signatures on the stack\"],\n[\"\", \"'dummy' 'sig1' 1 'pk1' 1 CHECKMULTISIG IF 1 ENDIF\", \"\", \"EVAL_FALSE\", \"CHECKMULTISIG must push false to stack when signature is invalid when NOT in strict enc mode\"],\n\n[\"\",\n\"0 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG 0 0 CHECKMULTISIG\",\n\"P2SH,STRICTENC\",\n\"OP_COUNT\",\n\"202 CHECKMULTISIGS, fails due to 201 op limit\"],\n\n[\"1\",\n\"0 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY 0 0 CHECKMULTISIGVERIFY\",\n\"P2SH,STRICTENC\",\n\"INVALID_STACK_OPERATION\",\n\"\"],\n\n[\"\",\n\"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIG\",\n\"P2SH,STRICTENC\",\n\"OP_COUNT\",\n\"Fails due to 201 script operation limit\"],\n\n[\"1\",\n\"NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY 0 0 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j' 'k' 'l' 'm' 'n' 'o' 'p' 'q' 'r' 's' 't' 20 CHECKMULTISIGVERIFY\",\n\"P2SH,STRICTENC\",\n\"OP_COUNT\",\n\"\"],\n\n\n[\"0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21\", \"21 CHECKMULTISIG 1\", \"P2SH,STRICTENC\", \"PUBKEY_COUNT\", \"nPubKeys > 20\"],\n[\"0 'sig' 1 0\", \"CHECKMULTISIG 1\", \"P2SH,STRICTENC\", \"SIG_COUNT\", \"nSigs > nPubKeys\"],\n\n\n[\"NOP 0x01 1\", \"HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL\", \"P2SH,STRICTENC\", \"SIG_PUSHONLY\", \"Tests for Script.IsPushOnly()\"],\n[\"NOP1 0x01 1\", \"HASH160 0x14 0xda1745e9b549bd0bfa1a569971c77eba30cd5a4b EQUAL\", \"P2SH,STRICTENC\", \"SIG_PUSHONLY\"],\n\n[\"0 0x01 0x50\", \"HASH160 0x14 0xece424a6bb6ddf4db592c0faed60685047a361b1 EQUAL\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"OP_RESERVED in P2SH should fail\"],\n[\"0 0x01 VER\", \"HASH160 0x14 0x0f4d7845db968f2a81b530b6f3c1d6246d4c7e01 EQUAL\", \"P2SH,STRICTENC\", \"BAD_OPCODE\", \"OP_VER in P2SH should fail\"],\n\n[\"0x00\", \"'00' EQUAL\", \"P2SH,STRICTENC\", \"EVAL_FALSE\", \"Basic OP_0 execution\"],\n\n[\"MINIMALDATA enforcement for PUSHDATAs\"],\n\n[\"0x4c 0x00\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\", \"Empty vector minimally represented by OP_0\"],\n[\"0x01 0x81\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\", \"-1 minimally represented by OP_1NEGATE\"],\n[\"0x01 0x01\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\", \"1 to 16 minimally represented by OP_1 to OP_16\"],\n[\"0x01 0x02\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x03\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x04\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x05\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x06\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x07\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x08\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x09\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x0a\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x0b\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x0c\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x0d\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x0e\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x0f\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n[\"0x01 0x10\", \"DROP 1\", \"MINIMALDATA\", \"MINIMALDATA\"],\n\n[\"0x4c 0x48 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\", \"DROP 1\", \"MINIMALDATA\",\n \"MINIMALDATA\",\n \"PUSHDATA1 of 72 bytes minimally represented by direct push\"],\n\n[\"0x4d 0xFF00 0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\", \"DROP 1\", \"MINIMALDATA\",\n \"MINIMALDATA\",\n \"PUSHDATA2 of 255 bytes minimally represented by PUSHDATA1\"],\n\n[\"0x4e 0x00010000 0x11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\", \"DROP 1\", \"MINIMALDATA\",\n \"MINIMALDATA\",\n \"PUSHDATA4 of 256 bytes minimally represented by PUSHDATA2\"],\n\n[\"MINIMALDATA enforcement for numeric arguments\"],\n\n[\"0x01 0x00\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"numequals 0\"],\n[\"0x02 0x0000\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"numequals 0\"],\n[\"0x01 0x80\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"0x80 (negative zero) numequals 0\"],\n[\"0x02 0x0080\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"numequals 0\"],\n[\"0x02 0x0500\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"numequals 5\"],\n[\"0x03 0x050000\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"numequals 5\"],\n[\"0x02 0x0580\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"numequals -5\"],\n[\"0x03 0x050080\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"numequals -5\"],\n[\"0x03 0xff7f80\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"Minimal encoding is 0xffff\"],\n[\"0x03 0xff7f00\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"Minimal encoding is 0xff7f\"],\n[\"0x04 0xffff7f80\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"Minimal encoding is 0xffffff\"],\n[\"0x04 0xffff7f00\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\", \"Minimal encoding is 0xffff7f\"],\n\n[\"Test every numeric-accepting opcode for correct handling of the numeric minimal encoding rule\"],\n\n[\"1 0x02 0x0000\", \"PICK DROP\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"1 0x02 0x0000\", \"ROLL DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000\", \"1ADD DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000\", \"1SUB DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000\", \"NEGATE DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000\", \"ABS DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000\", \"NOT DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000\", \"0NOTEQUAL DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n\n[\"0 0x02 0x0000\", \"ADD DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"ADD DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"SUB DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"SUB DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"BOOLAND DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"BOOLAND DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"BOOLOR DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"BOOLOR DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"NUMEQUAL DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 1\", \"NUMEQUAL DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"NUMEQUALVERIFY 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"NUMEQUALVERIFY 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"NUMNOTEQUAL DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"NUMNOTEQUAL DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"LESSTHAN DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"LESSTHAN DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"GREATERTHAN DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"GREATERTHAN DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"LESSTHANOREQUAL DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"LESSTHANOREQUAL DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"GREATERTHANOREQUAL DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"GREATERTHANOREQUAL DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"MIN DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"MIN DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000\", \"MAX DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0x02 0x0000 0\", \"MAX DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n\n[\"0x02 0x0000 0 0\", \"WITHIN DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000 0\", \"WITHIN DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0 0x02 0x0000\", \"WITHIN DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n\n[\"0 0 0x02 0x0000\", \"CHECKMULTISIG DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000 0\", \"CHECKMULTISIG DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000 0 1\", \"CHECKMULTISIG DROP 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0 0x02 0x0000\", \"CHECKMULTISIGVERIFY 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n[\"0 0x02 0x0000 0\", \"CHECKMULTISIGVERIFY 1\", \"MINIMALDATA\", \"UNKNOWN_ERROR\"],\n\n\n[\"Order of CHECKMULTISIG evaluation tests, inverted by swapping the order of\"],\n[\"pubkeys/signatures so they fail due to the STRICTENC rules on validly encoded\"],\n[\"signatures and pubkeys.\"],\n[\n    \"0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501\",\n    \"2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0 2 CHECKMULTISIG NOT\",\n    \"STRICTENC\",\n    \"PUBKEYTYPE\",\n    \"2-of-2 CHECKMULTISIG NOT with the first pubkey invalid, and both signatures validly encoded.\"\n],\n[\n    \"0 0x47 0x3044022044dc17b0887c161bb67ba9635bf758735bdde503e4b0a0987f587f14a4e1143d022009a215772d49a85dae40d8ca03955af26ad3978a0ff965faa12915e9586249a501 1\",\n    \"2 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 0x21 0x02865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac0 2 CHECKMULTISIG NOT\",\n    \"STRICTENC\",\n    \"SIG_DER\",\n    \"2-of-2 CHECKMULTISIG NOT with both pubkeys valid, but first signature invalid.\"\n],\n[\n    \"0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f\",\n    \"2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG\",\n    \"P2SH,STRICTENC\",\n    \"SIG_DER\",\n    \"2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs\"\n],\n\n[\"Increase DERSIG test coverage\"],\n[\"0x4a 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\", \"0 CHECKSIG NOT\", \"DERSIG\", \"SIG_DER\", \"Overly long signature is incorrectly encoded for DERSIG\"],\n[\"0x25 0x30220220000000000000000000000000000000000000000000000000000000000000000000\", \"0 CHECKSIG NOT\", \"DERSIG\", \"SIG_DER\", \"Missing S is incorrectly encoded for DERSIG\"],\n[\"0x27 0x3024021077777777777777777777777777777777020a7777777777777777777777777777777701\", \"0 CHECKSIG NOT\", \"DERSIG\", \"SIG_DER\", \"S with invalid S length is incorrectly encoded for DERSIG\"],\n[\"0x27 0x302403107777777777777777777777777777777702107777777777777777777777777777777701\", \"0 CHECKSIG NOT\", \"DERSIG\", \"SIG_DER\", \"Non-integer R is incorrectly encoded for DERSIG\"],\n[\"0x27 0x302402107777777777777777777777777777777703107777777777777777777777777777777701\", \"0 CHECKSIG NOT\", \"DERSIG\", \"SIG_DER\", \"Non-integer S is incorrectly encoded for DERSIG\"],\n[\"0x17 0x3014020002107777777777777777777777777777777701\", \"0 CHECKSIG NOT\", \"DERSIG\", \"SIG_DER\", \"Zero-length R is incorrectly encoded for DERSIG\"],\n[\"0x17 0x3014021077777777777777777777777777777777020001\", \"0 CHECKSIG NOT\", \"DERSIG\", \"SIG_DER\", \"Zero-length S is incorrectly encoded for DERSIG\"],\n[\"0x27 0x302402107777777777777777777777777777777702108777777777777777777777777777777701\", \"0 CHECKSIG NOT\", \"DERSIG\", \"SIG_DER\", \"Negative S is incorrectly encoded for DERSIG\"],\n\n[\"Some basic segwit checks\"],\n[[\"00\", 0.00000000 ], \"\", \"0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d\", \"P2SH,WITNESS\", \"EVAL_FALSE\", \"Invalid witness script\"],\n[[\"51\", 0.00000000 ], \"\", \"0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d\", \"P2SH,WITNESS\", \"WITNESS_PROGRAM_MISMATCH\", \"Witness script hash mismatch\"],\n[[\"00\", 0.00000000 ], \"\", \"0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d\", \"\", \"OK\", \"Invalid witness script without WITNESS\"],\n[[\"51\", 0.00000000 ], \"\", \"0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d\", \"\", \"OK\", \"Witness script hash mismatch without WITNESS\"],\n\n[\"Automatically generated test cases\"],\n[\n    \"0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001\",\n    \"0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PK\"\n],\n[\n    \"0x47 0x304402200a5c6163f07b8c3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001\",\n    \"0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"P2PK, bad sig\"\n],\n[\n    \"0x47 0x304402206e05a6fe23c59196ffe176c9ddc31e73a9885638f9d1328d47c0c703863b8876022076feb53811aa5b04e0e79f938eb19906cc5e67548bc555a8e8b8b0fc603d840c01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508\",\n    \"DUP HASH160 0x14 0x1018853670f9f3b0582c5b9ee8ce93764ac32b93 EQUALVERIFY CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PKH\"\n],\n[\n    \"0x47 0x3044022034bb0494b50b8ef130e2185bb220265b9284ef5b4b8a8da4d8415df489c83b5102206259a26d9cc0a125ac26af6153b17c02956855ebe1467412f066e402f5f05d1201 0x21 0x03363d90d446b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640\",\n    \"DUP HASH160 0x14 0xc0834c0c158f53be706d234c38fd52de7eece656 EQUALVERIFY CHECKSIG\",\n    \"\",\n    \"EQUALVERIFY\",\n    \"P2PKH, bad pubkey\"\n],\n[\n    \"0x47 0x304402204710a85181663b32d25c70ec2bbd14adff5ddfff6cb50d09e155ef5f541fc86c0220056b0cc949be9386ecc5f6c2ac0493269031dbb185781db90171b54ac127790281\",\n    \"0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PK anyonecanpay\"\n],\n[\n    \"0x47 0x304402204710a85181663b32d25c70ec2bbd14adff5ddfff6cb50d09e155ef5f541fc86c0220056b0cc949be9386ecc5f6c2ac0493269031dbb185781db90171b54ac127790201\",\n    \"0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"P2PK anyonecanpay marked with normal hashtype\"\n],\n[\n    \"0x47 0x3044022003fef42ed6c7be8917441218f525a60e2431be978e28b7aca4d7a532cc413ae8022067a1f82c74e8d69291b90d148778405c6257bbcfc2353cc38a3e1f22bf44254601 0x23 0x210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac\",\n    \"HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL\",\n    \"P2SH\",\n    \"OK\",\n    \"P2SH(P2PK)\"\n],\n[\n    \"0x47 0x3044022003fef42ed6c7be8917441218f525a60e2431be978e28b7aca4d7a532cc413ae8022067a1f82c74e8d69291b90d148778405c6257bbcfc2353cc38a3e1f22bf44254601 0x23 0x210279be667ef9dcbbac54a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac\",\n    \"HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL\",\n    \"P2SH\",\n    \"EVAL_FALSE\",\n    \"P2SH(P2PK), bad redeemscript\"\n],\n[\n    \"0x47 0x30440220781ba4f59a7b207a10db87628bc2168df4d59b844b397d2dbc9a5835fb2f2b7602206ed8fbcc1072fe2dfc5bb25909269e5dc42ffcae7ec2bc81d59692210ff30c2b01 0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x19 0x76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\",\n    \"HASH160 0x14 0x7f67f0521934a57d3039f77f9f32cf313f3ac74b EQUAL\",\n    \"P2SH\",\n    \"OK\",\n    \"P2SH(P2PKH)\"\n],\n[\n    \"0x47 0x304402204e2eb034be7b089534ac9e798cf6a2c79f38bcb34d1b179efd6f2de0841735db022071461beb056b5a7be1819da6a3e3ce3662831ecc298419ca101eb6887b5dd6a401 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac\",\n    \"HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL\",\n    \"\",\n    \"OK\",\n    \"P2SH(P2PKH), bad sig but no VERIFY_P2SH\"\n],\n[\n    \"0x47 0x304402204e2eb034be7b089534ac9e798cf6a2c79f38bcb34d1b179efd6f2de0841735db022071461beb056b5a7be1819da6a3e3ce3662831ecc298419ca101eb6887b5dd6a401 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac\",\n    \"HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL\",\n    \"P2SH\",\n    \"EQUALVERIFY\",\n    \"P2SH(P2PKH), bad sig\"\n],\n[\n    \"0 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901\",\n    \"3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG\",\n    \"\",\n    \"OK\",\n    \"3-of-3\"\n],\n[\n    \"0 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0\",\n    \"3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"3-of-3, 2 sigs\"\n],\n[\n    \"0 0x47 0x304402205b7d2c2f177ae76cfbbf14d589c113b0b35db753d305d5562dd0b61cbf366cfb02202e56f93c4f08a27f986cd424ffc48a462c3202c4902104d4d0ff98ed28f4bf8001 0x47 0x30440220563e5b3b1fc11662a84bc5ea2a32cc3819703254060ba30d639a1aaf2d5068ad0220601c1f47ddc76d93284dd9ed68f7c9974c4a0ea7cbe8a247d6bc3878567a5fca01 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae\",\n    \"HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL\",\n    \"P2SH\",\n    \"OK\",\n    \"P2SH(2-of-3)\"\n],\n[\n    \"0 0x47 0x304402205b7d2c2f177ae76cfbbf14d589c113b0b35db753d305d5562dd0b61cbf366cfb02202e56f93c4f08a27f986cd424ffc48a462c3202c4902104d4d0ff98ed28f4bf8001 0 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae\",\n    \"HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL\",\n    \"P2SH\",\n    \"EVAL_FALSE\",\n    \"P2SH(2-of-3), 1 sig\"\n],\n[\n    \"0x47 0x304402200060558477337b9022e70534f1fea71a318caf836812465a2509931c5e7c4987022078ec32bd50ac9e03a349ba953dfd9fe1c8d2dd8bdb1d38ddca844d3d5c78c11801\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PK with too much R padding but no DERSIG\"\n],\n[\n    \"0x47 0x304402200060558477337b9022e70534f1fea71a318caf836812465a2509931c5e7c4987022078ec32bd50ac9e03a349ba953dfd9fe1c8d2dd8bdb1d38ddca844d3d5c78c11801\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"P2PK with too much R padding\"\n],\n[\n    \"0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PK with too much S padding but no DERSIG\"\n],\n[\n    \"0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"P2PK with too much S padding\"\n],\n[\n    \"0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PK with too little R padding but no DERSIG\"\n],\n[\n    \"0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"P2PK with too little R padding\"\n],\n[\n    \"0x47 0x30440220005ece1335e7f757a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601\",\n    \"0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT\",\n    \"\",\n    \"OK\",\n    \"P2PK NOT with bad sig with too much R padding but no DERSIG\"\n],\n[\n    \"0x47 0x30440220005ece1335e7f757a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601\",\n    \"0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"P2PK NOT with bad sig with too much R padding\"\n],\n[\n    \"0x47 0x30440220005ece1335e7f657a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601\",\n    \"0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"P2PK NOT with too much R padding but no DERSIG\"\n],\n[\n    \"0x47 0x30440220005ece1335e7f657a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601\",\n    \"0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"P2PK NOT with too much R padding\"\n],\n[\n    \"0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"BIP66 example 1, without DERSIG\"\n],\n[\n    \"0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"BIP66 example 1, with DERSIG\"\n],\n[\n    \"0x47 0x304402208e43c0b91f7c1e5bc58e41c8185f8a6086e111b0090187968a86f2822462d3c902200a58f4076b1133b18ff1dc83ee51676e44c60cc608d9534e0df5ace0424fc0be01\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"BIP66 example 2, without DERSIG\"\n],\n[\n    \"0x47 0x304402208e43c0b91f7c1e5bc58e41c8185f8a6086e111b0090187968a86f2822462d3c902200a58f4076b1133b18ff1dc83ee51676e44c60cc608d9534e0df5ace0424fc0be01\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"BIP66 example 2, with DERSIG\"\n],\n[\n    \"0\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"BIP66 example 3, without DERSIG\"\n],\n[\n    \"0\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"DERSIG\",\n    \"EVAL_FALSE\",\n    \"BIP66 example 3, with DERSIG\"\n],\n[\n    \"0\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT\",\n    \"\",\n    \"OK\",\n    \"BIP66 example 4, without DERSIG\"\n],\n[\n    \"0\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT\",\n    \"DERSIG\",\n    \"OK\",\n    \"BIP66 example 4, with DERSIG\"\n],\n[\n    \"0x09 0x300602010102010101\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT\",\n    \"DERSIG\",\n    \"OK\",\n    \"BIP66 example 4, with DERSIG, non-null DER-compliant signature\"\n],\n[\n    \"0\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT\",\n    \"DERSIG,NULLFAIL\",\n    \"OK\",\n    \"BIP66 example 4, with DERSIG and NULLFAIL\"\n],\n[\n    \"0x09 0x300602010102010101\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT\",\n    \"DERSIG,NULLFAIL\",\n    \"NULLFAIL\",\n    \"BIP66 example 4, with DERSIG and NULLFAIL, non-null DER-compliant signature\"\n],\n[\n    \"1\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"BIP66 example 5, without DERSIG\"\n],\n[\n    \"1\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"BIP66 example 5, with DERSIG\"\n],\n[\n    \"1\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT\",\n    \"\",\n    \"OK\",\n    \"BIP66 example 6, without DERSIG\"\n],\n[\n    \"1\",\n    \"0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"BIP66 example 6, with DERSIG\"\n],\n[\n    \"0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG\",\n    \"\",\n    \"OK\",\n    \"BIP66 example 7, without DERSIG\"\n],\n[\n    \"0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"BIP66 example 7, with DERSIG\"\n],\n[\n    \"0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0x47 0x3044022079ea80afd538d9ada421b5101febeb6bc874e01dde5bca108c1d0479aec339a4022004576db8f66130d1df686ccf00935703689d69cf539438da1edab208b0d63c4801\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"BIP66 example 8, without DERSIG\"\n],\n[\n    \"0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0x47 0x3044022079ea80afd538d9ada421b5101febeb6bc874e01dde5bca108c1d0479aec339a4022004576db8f66130d1df686ccf00935703689d69cf539438da1edab208b0d63c4801\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"BIP66 example 8, with DERSIG\"\n],\n[\n    \"0 0 0x47 0x3044022081aa9d436f2154e8b6d600516db03d78de71df685b585a9807ead4210bd883490220534bb6bdf318a419ac0749660b60e78d17d515558ef369bf872eff405b676b2e01\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"BIP66 example 9, without DERSIG\"\n],\n[\n    \"0 0 0x47 0x3044022081aa9d436f2154e8b6d600516db03d78de71df685b585a9807ead4210bd883490220534bb6bdf318a419ac0749660b60e78d17d515558ef369bf872eff405b676b2e01\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"BIP66 example 9, with DERSIG\"\n],\n[\n    \"0 0 0x47 0x30440220da6f441dc3b4b2c84cfa8db0cd5b34ed92c9e01686de5a800d40498b70c0dcac02207c2cf91b0c32b860c4cd4994be36cfb84caf8bb7c3a8e4d96a31b2022c5299c501\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT\",\n    \"\",\n    \"OK\",\n    \"BIP66 example 10, without DERSIG\"\n],\n[\n    \"0 0 0x47 0x30440220da6f441dc3b4b2c84cfa8db0cd5b34ed92c9e01686de5a800d40498b70c0dcac02207c2cf91b0c32b860c4cd4994be36cfb84caf8bb7c3a8e4d96a31b2022c5299c501\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"BIP66 example 10, with DERSIG\"\n],\n[\n    \"0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"BIP66 example 11, without DERSIG\"\n],\n[\n    \"0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG\",\n    \"DERSIG\",\n    \"EVAL_FALSE\",\n    \"BIP66 example 11, with DERSIG\"\n],\n[\n    \"0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT\",\n    \"\",\n    \"OK\",\n    \"BIP66 example 12, without DERSIG\"\n],\n[\n    \"0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT\",\n    \"DERSIG\",\n    \"OK\",\n    \"BIP66 example 12, with DERSIG\"\n],\n[\n    \"0x48 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb12510101\",\n    \"0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PK with multi-byte hashtype, without DERSIG\"\n],\n[\n    \"0x48 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb12510101\",\n    \"0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG\",\n    \"DERSIG\",\n    \"SIG_DER\",\n    \"P2PK with multi-byte hashtype, with DERSIG\"\n],\n[\n    \"0x48 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef001\",\n    \"0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PK with high S but no LOW_S\"\n],\n[\n    \"0x48 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef001\",\n    \"0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG\",\n    \"LOW_S\",\n    \"SIG_HIGH_S\",\n    \"P2PK with high S\"\n],\n[\n    \"0x47 0x3044022057292e2d4dfe775becdd0a9e6547997c728cdf35390f6a017da56d654d374e4902206b643be2fc53763b4e284845bfea2c597d2dc7759941dce937636c9d341b71ed01\",\n    \"0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PK with hybrid pubkey but no STRICTENC\"\n],\n[\n    \"0x47 0x3044022057292e2d4dfe775becdd0a9e6547997c728cdf35390f6a017da56d654d374e4902206b643be2fc53763b4e284845bfea2c597d2dc7759941dce937636c9d341b71ed01\",\n    \"0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG\",\n    \"STRICTENC\",\n    \"PUBKEYTYPE\",\n    \"P2PK with hybrid pubkey\"\n],\n[\n    \"0x47 0x30440220035d554e3153c14950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101\",\n    \"0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT\",\n    \"\",\n    \"EVAL_FALSE\",\n    \"P2PK NOT with hybrid pubkey but no STRICTENC\"\n],\n[\n    \"0x47 0x30440220035d554e3153c14950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101\",\n    \"0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT\",\n    \"STRICTENC\",\n    \"PUBKEYTYPE\",\n    \"P2PK NOT with hybrid pubkey\"\n],\n[\n    \"0x47 0x30440220035d554e3153c04950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101\",\n    \"0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT\",\n    \"\",\n    \"OK\",\n    \"P2PK NOT with invalid hybrid pubkey but no STRICTENC\"\n],\n[\n    \"0x47 0x30440220035d554e3153c04950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101\",\n    \"0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT\",\n    \"STRICTENC\",\n    \"PUBKEYTYPE\",\n    \"P2PK NOT with invalid hybrid pubkey\"\n],\n[\n    \"0 0x47 0x304402202e79441ad1baf5a07fb86bae3753184f6717d9692680947ea8b6e8b777c69af1022079a262e13d868bb5a0964fefe3ba26942e1b0669af1afb55ef3344bc9d4fc4c401\",\n    \"1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG\",\n    \"\",\n    \"OK\",\n    \"1-of-2 with the second 1 hybrid pubkey and no STRICTENC\"\n],\n[\n    \"0 0x47 0x304402202e79441ad1baf5a07fb86bae3753184f6717d9692680947ea8b6e8b777c69af1022079a262e13d868bb5a0964fefe3ba26942e1b0669af1afb55ef3344bc9d4fc4c401\",\n    \"1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG\",\n    \"STRICTENC\",\n    \"OK\",\n    \"1-of-2 with the second 1 hybrid pubkey\"\n],\n[\n    \"0 0x47 0x3044022079c7824d6c868e0e1a273484e28c2654a27d043c8a27f49f52cb72efed0759090220452bbbf7089574fa082095a4fc1b3a16bafcf97a3a34d745fafc922cce66b27201\",\n    \"1 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 2 CHECKMULTISIG\",\n    \"STRICTENC\",\n    \"PUBKEYTYPE\",\n    \"1-of-2 with the first 1 hybrid pubkey\"\n],\n[\n    \"0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205\",\n    \"0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PK with undefined hashtype but no STRICTENC\"\n],\n[\n    \"0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205\",\n    \"0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG\",\n    \"STRICTENC\",\n    \"SIG_HASHTYPE\",\n    \"P2PK with undefined hashtype\"\n],\n[\n    \"0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05\",\n    \"0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT\",\n    \"\",\n    \"OK\",\n    \"P2PK NOT with invalid sig and undefined hashtype but no STRICTENC\"\n],\n[\n    \"0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05\",\n    \"0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT\",\n    \"STRICTENC\",\n    \"SIG_HASHTYPE\",\n    \"P2PK NOT with invalid sig and undefined hashtype\"\n],\n[\n    \"1 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901\",\n    \"3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG\",\n    \"\",\n    \"OK\",\n    \"3-of-3 with nonzero dummy but no NULLDUMMY\"\n],\n[\n    \"1 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901\",\n    \"3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG\",\n    \"NULLDUMMY\",\n    \"SIG_NULLDUMMY\",\n    \"3-of-3 with nonzero dummy\"\n],\n[\n    \"1 0x47 0x304402201bb2edab700a5d020236df174fefed78087697143731f659bea59642c759c16d022061f42cdbae5bcd3e8790f20bf76687443436e94a634321c16a72aa54cbc7c2ea01 0x47 0x304402204bb4a64f2a6e5c7fb2f07fef85ee56fde5e6da234c6a984262307a20e99842d702206f8303aaba5e625d223897e2ffd3f88ef1bcffef55f38dc3768e5f2e94c923f901 0x47 0x3044022040c2809b71fffb155ec8b82fe7a27f666bd97f941207be4e14ade85a1249dd4d02204d56c85ec525dd18e29a0533d5ddf61b6b1bb32980c2f63edf951aebf7a27bfe01\",\n    \"3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT\",\n    \"\",\n    \"OK\",\n    \"3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY\"\n],\n[\n    \"1 0x47 0x304402201bb2edab700a5d020236df174fefed78087697143731f659bea59642c759c16d022061f42cdbae5bcd3e8790f20bf76687443436e94a634321c16a72aa54cbc7c2ea01 0x47 0x304402204bb4a64f2a6e5c7fb2f07fef85ee56fde5e6da234c6a984262307a20e99842d702206f8303aaba5e625d223897e2ffd3f88ef1bcffef55f38dc3768e5f2e94c923f901 0x47 0x3044022040c2809b71fffb155ec8b82fe7a27f666bd97f941207be4e14ade85a1249dd4d02204d56c85ec525dd18e29a0533d5ddf61b6b1bb32980c2f63edf951aebf7a27bfe01\",\n    \"3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT\",\n    \"NULLDUMMY\",\n    \"SIG_NULLDUMMY\",\n    \"3-of-3 NOT with invalid sig with nonzero dummy\"\n],\n[\n    \"0 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901 DUP\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG\",\n    \"\",\n    \"OK\",\n    \"2-of-2 with two identical keys and sigs pushed using OP_DUP but no SIGPUSHONLY\"\n],\n[\n    \"0 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901 DUP\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG\",\n    \"SIGPUSHONLY\",\n    \"SIG_PUSHONLY\",\n    \"2-of-2 with two identical keys and sigs pushed using OP_DUP\"\n],\n[\n    \"0x47 0x3044022018a2a81a93add5cb5f5da76305718e4ea66045ec4888b28d84cb22fae7f4645b02201e6daa5ed5d2e4b2b2027cf7ffd43d8d9844dd49f74ef86899ec8e669dfd39aa01 NOP8 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac\",\n    \"HASH160 0x14 0x215640c2f72f0d16b4eced26762035a42ffed39a EQUAL\",\n    \"\",\n    \"OK\",\n    \"P2SH(P2PK) with non-push scriptSig but no P2SH or SIGPUSHONLY\"\n],\n[\n    \"0x47 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb125101 NOP8\",\n    \"0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG\",\n    \"\",\n    \"OK\",\n    \"P2PK with non-push scriptSig but with P2SH validation\"\n],\n[\n    \"0x47 0x3044022018a2a81a93add5cb5f5da76305718e4ea66045ec4888b28d84cb22fae7f4645b02201e6daa5ed5d2e4b2b2027cf7ffd43d8d9844dd49f74ef86899ec8e669dfd39aa01 NOP8 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac\",\n    \"HASH160 0x14 0x215640c2f72f0d16b4eced26762035a42ffed39a EQUAL\",\n    \"P2SH\",\n    \"SIG_PUSHONLY\",\n    \"P2SH(P2PK) with non-push scriptSig but no SIGPUSHONLY\"\n],\n[\n    \"0x47 0x3044022018a2a81a93add5cb5f5da76305718e4ea66045ec4888b28d84cb22fae7f4645b02201e6daa5ed5d2e4b2b2027cf7ffd43d8d9844dd49f74ef86899ec8e669dfd39aa01 NOP8 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac\",\n    \"HASH160 0x14 0x215640c2f72f0d16b4eced26762035a42ffed39a EQUAL\",\n    \"SIGPUSHONLY\",\n    \"SIG_PUSHONLY\",\n    \"P2SH(P2PK) with non-push scriptSig but not P2SH\"\n],\n[\n    \"0 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901\",\n    \"2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG\",\n    \"SIGPUSHONLY\",\n    \"OK\",\n    \"2-of-2 with two identical keys and sigs pushed\"\n],\n[\n    \"11 0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001\",\n    \"0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG\",\n    \"P2SH\",\n    \"OK\",\n    \"P2PK with unnecessary input but no CLEANSTACK\"\n],\n[\n    \"11 0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001\",\n    \"0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG\",\n    \"CLEANSTACK,P2SH\",\n    \"CLEANSTACK\",\n    \"P2PK with unnecessary input\"\n],\n[\n    \"11 0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac\",\n    \"HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL\",\n    \"P2SH\",\n    \"OK\",\n    \"P2SH with unnecessary input but no CLEANSTACK\"\n],\n[\n    \"11 0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac\",\n    \"HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL\",\n    \"CLEANSTACK,P2SH\",\n    \"CLEANSTACK\",\n    \"P2SH with unnecessary input\"\n],\n[\n    \"0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac\",\n    \"HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL\",\n    \"CLEANSTACK,P2SH\",\n    \"OK\",\n    \"P2SH with CLEANSTACK\"\n],\n\n[\"Testing with uncompressed keys in witness v0 without WITNESS_PUBKEYTYPE\"],\n[\n    [\n        \"304402200d461c140cfdfcf36b94961db57ae8c18d1cb80e9d95a9e47ac22470c1bf125502201c8dc1cbfef6a3ef90acbbb992ca22fe9466ee6f9d4898eda277a7ac3ab4b25101\",\n        \"410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"Basic P2WSH\"\n],\n[\n    [\n        \"304402201e7216e5ccb3b61d46946ec6cc7e8c4e0117d13ac2fd4b152197e4805191c74202203e9903e33e84d9ee1dd13fb057afb7ccfb47006c23f6a067185efbc9dd780fc501\",\n        \"0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"Basic P2WPKH\"\n],\n[\n    [\n        \"3044022066e02c19a513049d49349cf5311a1b012b7c4fae023795a18ab1d91c23496c22022025e216342c8e07ce8ef51e8daee88f84306a9de66236cab230bb63067ded1ad301\",\n        \"410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac\",\n        0.00000001\n    ],\n    \"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64\",\n    \"HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"Basic P2SH(P2WSH)\"\n],\n[\n    [\n        \"304402200929d11561cd958460371200f82e9cae64c727a495715a31828e27a7ad57b36d0220361732ced04a6f97351ecca21a56d0b8cd4932c1da1f8f569a2b68e5e48aed7801\",\n        \"0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        0.00000001\n    ],\n    \"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5\",\n    \"HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"Basic P2SH(P2WPKH)\"\n],\n[\n    [\n        \"304402202589f0512cb2408fb08ed9bd24f85eb3059744d9e4f2262d0b7f1338cff6e8b902206c0978f449693e0578c71bc543b11079fd0baae700ee5e9a6bee94db490af9fc01\",\n        \"41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac\",\n        0.00000000\n    ],\n    \"\",\n    \"0 0x20 0xac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610\",\n    \"P2SH,WITNESS\",\n    \"EVAL_FALSE\",\n    \"Basic P2WSH with the wrong key\"\n],\n[\n    [\n        \"304402206ef7fdb2986325d37c6eb1a8bb24aeb46dede112ed8fc76c7d7500b9b83c0d3d02201edc2322c794fe2d6b0bd73ed319e714aa9b86d8891961530d5c9b7156b60d4e01\",\n        \"048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\",\n        0.00000000\n    ],\n    \"\",\n    \"0 0x14 0x7cf9c846cd4882efec4bf07e44ebdad495c94f4b\",\n    \"P2SH,WITNESS\",\n    \"EVAL_FALSE\",\n    \"Basic P2WPKH with the wrong key\"\n],\n[\n    [\n        \"30440220069ea3581afaf8187f63feee1fd2bd1f9c0dc71ea7d6e8a8b07ee2ebcf824bf402201a4fdef4c532eae59223be1eda6a397fc835142d4ddc6c74f4aa85b766a5c16f01\",\n        \"41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac\",\n        0.00000000\n    ],\n    \"0x22 0x0020ac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610\",\n    \"HASH160 0x14 0x61039a003883787c0d6ebc66d97fdabe8e31449d EQUAL\",\n    \"P2SH,WITNESS\",\n    \"EVAL_FALSE\",\n    \"Basic P2SH(P2WSH) with the wrong key\"\n],\n[\n    [\n        \"304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001\",\n        \"048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\",\n        0.00000000\n    ],\n    \"0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b\",\n    \"HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL\",\n    \"P2SH,WITNESS\",\n    \"EVAL_FALSE\",\n    \"Basic P2SH(P2WPKH) with the wrong key\"\n],\n[\n    [\n        \"304402202589f0512cb2408fb08ed9bd24f85eb3059744d9e4f2262d0b7f1338cff6e8b902206c0978f449693e0578c71bc543b11079fd0baae700ee5e9a6bee94db490af9fc01\",\n        \"41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac\",\n        0.00000000\n    ],\n    \"\",\n    \"0 0x20 0xac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610\",\n    \"P2SH\",\n    \"OK\",\n    \"Basic P2WSH with the wrong key but no WITNESS\"\n],\n[\n    [\n        \"304402206ef7fdb2986325d37c6eb1a8bb24aeb46dede112ed8fc76c7d7500b9b83c0d3d02201edc2322c794fe2d6b0bd73ed319e714aa9b86d8891961530d5c9b7156b60d4e01\",\n        \"048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\",\n        0.00000000\n    ],\n    \"\",\n    \"0 0x14 0x7cf9c846cd4882efec4bf07e44ebdad495c94f4b\",\n    \"P2SH\",\n    \"OK\",\n    \"Basic P2WPKH with the wrong key but no WITNESS\"\n],\n[\n    [\n        \"30440220069ea3581afaf8187f63feee1fd2bd1f9c0dc71ea7d6e8a8b07ee2ebcf824bf402201a4fdef4c532eae59223be1eda6a397fc835142d4ddc6c74f4aa85b766a5c16f01\",\n        \"41048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26cafac\",\n        0.00000000\n    ],\n    \"0x22 0x0020ac8ebd9e52c17619a381fa4f71aebb696087c6ef17c960fd0587addad99c0610\",\n    \"HASH160 0x14 0x61039a003883787c0d6ebc66d97fdabe8e31449d EQUAL\",\n    \"P2SH\",\n    \"OK\",\n    \"Basic P2SH(P2WSH) with the wrong key but no WITNESS\"\n],\n[\n    [\n        \"304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001\",\n        \"048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\",\n        0.00000000\n    ],\n    \"0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b\",\n    \"HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL\",\n    \"P2SH\",\n    \"OK\",\n    \"Basic P2SH(P2WPKH) with the wrong key but no WITNESS\"\n],\n[\n    [\n        \"3044022066faa86e74e8b30e82691b985b373de4f9e26dc144ec399c4f066aa59308e7c202204712b86f28c32503faa051dbeabff2c238ece861abc36c5e0b40b1139ca222f001\",\n        \"410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac\",\n        0.00000000\n    ],\n    \"\",\n    \"0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64\",\n    \"P2SH,WITNESS\",\n    \"EVAL_FALSE\",\n    \"Basic P2WSH with wrong value\"\n],\n[\n    [\n        \"304402203b3389b87448d7dfdb5e82fb854fcf92d7925f9938ea5444e36abef02c3d6a9602202410bc3265049abb07fd2e252c65ab7034d95c9d5acccabe9fadbdc63a52712601\",\n        \"0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        0.00000000\n    ],\n    \"\",\n    \"0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5\",\n    \"P2SH,WITNESS\",\n    \"EVAL_FALSE\",\n    \"Basic P2WPKH with wrong value\"\n],\n[\n    [\n        \"3044022000a30c4cfc10e4387be528613575434826ad3c15587475e0df8ce3b1746aa210022008149265e4f8e9dafe1f3ea50d90cb425e9e40ea7ebdd383069a7cfa2b77004701\",\n        \"410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac\",\n        0.00000000\n    ],\n    \"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64\",\n    \"HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL\",\n    \"P2SH,WITNESS\",\n    \"EVAL_FALSE\",\n    \"Basic P2SH(P2WSH) with wrong value\"\n],\n[\n    [\n        \"304402204fc3a2cd61a47913f2a5f9107d0ad4a504c7b31ee2d6b3b2f38c2b10ee031e940220055d58b7c3c281aaa381d8f486ac0f3e361939acfd568046cb6a311cdfa974cf01\",\n        \"0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        0.00000000\n    ],\n    \"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5\",\n    \"HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL\",\n    \"P2SH,WITNESS\",\n    \"EVAL_FALSE\",\n    \"Basic P2SH(P2WPKH) with wrong value\"\n],\n[\n    [\n        \"304402205ae57ae0534c05ca9981c8a6cdf353b505eaacb7375f96681a2d1a4ba6f02f84022056248e68643b7d8ce7c7d128c9f1f348bcab8be15d094ad5cadd24251a28df8001\",\n        \"0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        0.00000000\n    ],\n    \"\",\n    \"1 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5\",\n    \"DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM,P2SH,WITNESS\",\n    \"DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM\",\n    \"P2WPKH with future witness version\"\n],\n[\n    [\n        \"3044022064100ca0e2a33332136775a86cd83d0230e58b9aebb889c5ac952abff79a46ef02205f1bf900e022039ad3091bdaf27ac2aef3eae9ed9f190d821d3e508405b9513101\",\n        \"0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        0.00000000\n    ],\n    \"\",\n    \"0 0x1f 0xb34b78da162751647974d5cb7410aa428ad339dbf7d1e16e833f68a0cbf1c3\",\n    \"P2SH,WITNESS\",\n    \"WITNESS_PROGRAM_WRONG_LENGTH\",\n    \"P2WPKH with wrong witness program length\"\n],\n[\n    \"\",\n    \"0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64\",\n    \"P2SH,WITNESS\",\n    \"WITNESS_PROGRAM_WITNESS_EMPTY\",\n    \"P2WSH with empty witness\"\n],\n[\n    [\n        \"3044022039105b995a5f448639a997a5c90fda06f50b49df30c3bdb6663217bf79323db002206fecd54269dec569fcc517178880eb58bb40f381a282bb75766ff3637d5f4b4301\",\n        \"400479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac\",\n        0.00000000\n    ],\n    \"\",\n    \"0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64\",\n    \"P2SH,WITNESS\",\n    \"WITNESS_PROGRAM_MISMATCH\",\n    \"P2WSH with witness program mismatch\"\n],\n[\n    [\n        \"304402201a96950593cb0af32d080b0f193517f4559241a8ebd1e95e414533ad64a3f423022047f4f6d3095c23235bdff3aeff480d0529c027a3f093cb265b7cbf148553b85101\",\n        \"0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        \"\",\n        0.00000000\n    ],\n    \"\",\n    \"0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5\",\n    \"P2SH,WITNESS\",\n    \"WITNESS_PROGRAM_MISMATCH\",\n    \"P2WPKH with witness program mismatch\"\n],\n[\n    [\n        \"304402201a96950593cb0af32d080b0f193517f4559241a8ebd1e95e414533ad64a3f423022047f4f6d3095c23235bdff3aeff480d0529c027a3f093cb265b7cbf148553b85101\",\n        \"0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        0.00000000\n    ],\n    \"11\",\n    \"0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5\",\n    \"P2SH,WITNESS\",\n    \"WITNESS_MALLEATED\",\n    \"P2WPKH with non-empty scriptSig\"\n],\n[\n    [\n        \"304402204209e49457c2358f80d0256bc24535b8754c14d08840fc4be762d6f5a0aed80b02202eaf7d8fc8d62f60c67adcd99295528d0e491ae93c195cec5a67e7a09532a88001\",\n        \"048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\",\n        0.00000000\n    ],\n    \"11 0x16 0x00147cf9c846cd4882efec4bf07e44ebdad495c94f4b\",\n    \"HASH160 0x14 0x4e0c2aed91315303fc6a1dc4c7bc21c88f75402e EQUAL\",\n    \"P2SH,WITNESS\",\n    \"WITNESS_MALLEATED_P2SH\",\n    \"P2SH(P2WPKH) with superfluous push in scriptSig\"\n],\n[\n    [\n        \"\",\n        0.00000000\n    ],\n    \"0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001\",\n    \"0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG\",\n    \"P2SH,WITNESS\",\n    \"WITNESS_UNEXPECTED\",\n    \"P2PK with witness\"\n],\n\n[\"Testing with compressed keys in witness v0 with WITNESS_PUBKEYTYPE\"],\n[\n    [\n        \"304402204256146fcf8e73b0fd817ffa2a4e408ff0418ff987dd08a4f485b62546f6c43c02203f3c8c3e2febc051e1222867f5f9d0eaf039d6792911c10940aa3cc74123378e01\",\n        \"210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x1863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"OK\",\n    \"Basic P2WSH with compressed key\"\n],\n[\n    [\n        \"304402204edf27486f11432466b744df533e1acac727e0c83e5f912eb289a3df5bf8035f022075809fdd876ede40ad21667eba8b7e96394938f9c9c50f11b6a1280cce2cea8601\",\n        \"0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x14 0x751e76e8199196d454941c45d1b3a323f1433bd6\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"OK\",\n    \"Basic P2WPKH with compressed key\"\n],\n[\n    [\n        \"304402203a549090cc46bce1e5e95c4922ea2c12747988e0207b04c42f81cdbe87bb1539022050f57a245b875fd5119c419aaf050bcdf41384f0765f04b809e5bced1fe7093d01\",\n        \"210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac\",\n        0.00000001\n    ],\n    \"0x22 0x00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262\",\n    \"HASH160 0x14 0xe4300531190587e3880d4c3004f5355d88ff928d EQUAL\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"OK\",\n    \"Basic P2SH(P2WSH) with compressed key\"\n],\n[\n    [\n        \"304402201bc0d53046827f4a35a3166e33e3b3366c4085540dc383b95d21ed2ab11e368a0220333e78c6231214f5f8e59621e15d7eeab0d4e4d0796437e00bfbd2680c5f9c1701\",\n        \"0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\",\n        0.00000001\n    ],\n    \"0x16 0x0014751e76e8199196d454941c45d1b3a323f1433bd6\",\n    \"HASH160 0x14 0xbcfeb728b584253d5f3f70bcb780e9ef218a68f4 EQUAL\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"OK\",\n    \"Basic P2SH(P2WPKH) with compressed key\"\n],\n\n[\"Testing with uncompressed keys in witness v0 with WITNESS_PUBKEYTYPE\"],\n[\n    [\n        \"304402200d461c140cfdfcf36b94961db57ae8c18d1cb80e9d95a9e47ac22470c1bf125502201c8dc1cbfef6a3ef90acbbb992ca22fe9466ee6f9d4898eda277a7ac3ab4b25101\",\n        \"410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0xb95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"WITNESS_PUBKEYTYPE\",\n    \"Basic P2WSH\"\n],\n[\n    [\n        \"304402201e7216e5ccb3b61d46946ec6cc7e8c4e0117d13ac2fd4b152197e4805191c74202203e9903e33e84d9ee1dd13fb057afb7ccfb47006c23f6a067185efbc9dd780fc501\",\n        \"0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x14 0x91b24bf9f5288532960ac687abb035127b1d28a5\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"WITNESS_PUBKEYTYPE\",\n    \"Basic P2WPKH\"\n],\n[\n    [\n        \"3044022066e02c19a513049d49349cf5311a1b012b7c4fae023795a18ab1d91c23496c22022025e216342c8e07ce8ef51e8daee88f84306a9de66236cab230bb63067ded1ad301\",\n        \"410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac\",\n        0.00000001\n    ],\n    \"0x22 0x0020b95237b48faaa69eb078e1170be3b5cbb3fddf16d0a991e14ad274f7b33a4f64\",\n    \"HASH160 0x14 0xf386c2ba255cc56d20cfa6ea8b062f8b59945518 EQUAL\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"WITNESS_PUBKEYTYPE\",\n    \"Basic P2SH(P2WSH)\"\n],\n[\n    [\n        \"304402200929d11561cd958460371200f82e9cae64c727a495715a31828e27a7ad57b36d0220361732ced04a6f97351ecca21a56d0b8cd4932c1da1f8f569a2b68e5e48aed7801\",\n        \"0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n        0.00000001\n    ],\n    \"0x16 0x001491b24bf9f5288532960ac687abb035127b1d28a5\",\n    \"HASH160 0x14 0x17743beb429c55c942d2ec703b98c4d57c2df5c6 EQUAL\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"WITNESS_PUBKEYTYPE\",\n    \"Basic P2SH(P2WPKH)\"\n],\n\n[\"Testing P2WSH multisig with compressed keys\"],\n[\n    [\n        \"\",\n        \"304402207eb8a59b5c65fc3f6aeef77066556ed5c541948a53a3ba7f7c375b8eed76ee7502201e036a7a9a98ff919ff94dc905d67a1ec006f79ef7cff0708485c8bb79dce38e01\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x06c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"OK\",\n    \"P2WSH CHECKMULTISIG with compressed keys\"\n],\n[\n    [\n        \"\",\n        \"3044022033706aed33b8155d5486df3b9bca8cdd3bd4bdb5436dce46d72cdaba51d22b4002203626e94fe53a178af46624f17315c6931f20a30b103f5e044e1eda0c3fe185c601\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"0x22 0x002006c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460\",\n    \"HASH160 0x14 0x26282aad7c29369d15fed062a778b6100d31a340 EQUAL\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"OK\",\n    \"P2SH(P2WSH) CHECKMULTISIG with compressed keys\"\n],\n[\n    [\n        \"\",\n        \"304402204048b7371ab1c544362efb89af0c80154747d665aa4fcfb2edfd2d161e57b42e02207e043748e96637080ffc3acbd4dcc6fee1e58d30f6d1269535f32188e5ddae7301\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x06c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"OK\",\n    \"P2WSH CHECKMULTISIG with compressed keys\"\n],\n[\n    [\n        \"\",\n        \"3044022073902ef0b8a554c36c44cc03c1b64df96ce2914ebcf946f5bb36078fd5245cdf02205b148f1ba127065fb8c83a5a9576f2dcd111739788ed4bb3ee08b2bd3860c91c01\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"0x22 0x002006c24420938f0fa3c1cb2707d867154220dca365cdbfa0dd2a83854730221460\",\n    \"HASH160 0x14 0x26282aad7c29369d15fed062a778b6100d31a340 EQUAL\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"OK\",\n    \"P2SH(P2WSH) CHECKMULTISIG with compressed keys\"\n],\n\n[\"Testing P2WSH multisig with compressed and uncompressed keys (first key being the key closer to the top of stack)\"],\n[\n    [\n        \"\",\n        \"304402202d092ededd1f060609dbf8cb76950634ff42b3e62cf4adb69ab92397b07d742302204ff886f8d0817491a96d1daccdcc820f6feb122ee6230143303100db37dfa79f01\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"P2WSH CHECKMULTISIG with first key uncompressed and signing with the first key\"\n],\n[\n    [\n        \"\",\n        \"304402202dd7e91243f2235481ffb626c3b7baf2c859ae3a5a77fb750ef97b99a8125dc002204960de3d3c3ab9496e218ec57e5240e0e10a6f9546316fe240c216d45116d29301\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae\",\n        0.00000001\n    ],\n    \"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa\",\n    \"HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"P2SH(P2WSH) CHECKMULTISIG first key uncompressed and signing with the first key\"\n],\n[\n    [\n        \"\",\n        \"304402202d092ededd1f060609dbf8cb76950634ff42b3e62cf4adb69ab92397b07d742302204ff886f8d0817491a96d1daccdcc820f6feb122ee6230143303100db37dfa79f01\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"WITNESS_PUBKEYTYPE\",\n    \"P2WSH CHECKMULTISIG with first key uncompressed and signing with the first key\"\n],\n[\n    [\n        \"\",\n        \"304402202dd7e91243f2235481ffb626c3b7baf2c859ae3a5a77fb750ef97b99a8125dc002204960de3d3c3ab9496e218ec57e5240e0e10a6f9546316fe240c216d45116d29301\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae\",\n        0.00000001\n    ],\n    \"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa\",\n    \"HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"WITNESS_PUBKEYTYPE\",\n    \"P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the first key\"\n],\n[\n    [\n        \"\",\n        \"304402201e9e6f7deef5b2f21d8223c5189b7d5e82d237c10e97165dd08f547c4e5ce6ed02206796372eb1cc6acb52e13ee2d7f45807780bf96b132cb6697f69434be74b1af901\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"P2WSH CHECKMULTISIG with first key uncompressed and signing with the second key\"\n],\n[\n    [\n        \"\",\n        \"3044022045e667f3f0f3147b95597a24babe9afecea1f649fd23637dfa7ed7e9f3ac18440220295748e81005231135289fe3a88338dabba55afa1bdb4478691337009d82b68d01\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae\",\n        0.00000001\n    ],\n    \"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa\",\n    \"HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the second key\"\n],\n[\n    [\n        \"\",\n        \"304402201e9e6f7deef5b2f21d8223c5189b7d5e82d237c10e97165dd08f547c4e5ce6ed02206796372eb1cc6acb52e13ee2d7f45807780bf96b132cb6697f69434be74b1af901\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x08a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"WITNESS_PUBKEYTYPE\",\n    \"P2WSH CHECKMULTISIG with first key uncompressed and signing with the second key\"\n],\n[\n    [\n        \"\",\n        \"3044022045e667f3f0f3147b95597a24babe9afecea1f649fd23637dfa7ed7e9f3ac18440220295748e81005231135289fe3a88338dabba55afa1bdb4478691337009d82b68d01\",\n        \"5121038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b852ae\",\n        0.00000001\n    ],\n    \"0x22 0x002008a6665ebfd43b02323423e764e185d98d1587f903b81507dbb69bfc41005efa\",\n    \"HASH160 0x14 0x6f5ecd4b83b77f3c438f5214eff96454934fc5d1 EQUAL\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"WITNESS_PUBKEYTYPE\",\n    \"P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the second key\"\n],\n[\n    [\n        \"\",\n        \"3044022046f5367a261fd8f8d7de6eb390491344f8ec2501638fb9a1095a0599a21d3f4c02205c1b3b51d20091c5f1020841bbca87b44ebe25405c64e4acf758f2eae8665f8401\",\n        \"5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"P2WSH CHECKMULTISIG with second key uncompressed and signing with the first key\"\n],\n[\n    [\n        \"\",\n        \"3044022053e210e4fb1881e6092fd75c3efc5163105599e246ded661c0ee2b5682cc2d6c02203a26b7ada8682a095b84c6d1b881637000b47d761fc837c4cee33555296d63f101\",\n        \"5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb\",\n    \"HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"P2SH(P2WSH) CHECKMULTISIG second key uncompressed and signing with the first key\"\n],\n[\n    [\n        \"\",\n        \"3044022046f5367a261fd8f8d7de6eb390491344f8ec2501638fb9a1095a0599a21d3f4c02205c1b3b51d20091c5f1020841bbca87b44ebe25405c64e4acf758f2eae8665f8401\",\n        \"5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"OK\",\n    \"P2WSH CHECKMULTISIG with second key uncompressed and signing with the first key should pass as the uncompressed key is not used\"\n],\n[\n    [\n        \"\",\n        \"3044022053e210e4fb1881e6092fd75c3efc5163105599e246ded661c0ee2b5682cc2d6c02203a26b7ada8682a095b84c6d1b881637000b47d761fc837c4cee33555296d63f101\",\n        \"5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb\",\n    \"HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"OK\",\n    \"P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the first key should pass as the uncompressed key is not used\"\n],\n[\n    [\n        \"\",\n        \"304402206c6d9f5daf85b54af2a93ec38b15ab27f205dbf5c735365ff12451e43613d1f40220736a44be63423ed5ebf53491618b7cc3d8a5093861908da853739c73717938b701\",\n        \"5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key\"\n],\n[\n    [\n        \"\",\n        \"30440220687871bc6144012d75baf585bb26ce13997f7d8c626f4d8825b069c3b2d064470220108936fe1c57327764782253e99090b09c203ec400ed35ce9e026ce2ecf842a001\",\n        \"5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb\",\n    \"HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL\",\n    \"P2SH,WITNESS\",\n    \"OK\",\n    \"P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key\"\n],\n[\n    [\n        \"\",\n        \"304402206c6d9f5daf85b54af2a93ec38b15ab27f205dbf5c735365ff12451e43613d1f40220736a44be63423ed5ebf53491618b7cc3d8a5093861908da853739c73717938b701\",\n        \"5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"\",\n    \"0 0x20 0x230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"WITNESS_PUBKEYTYPE\",\n    \"P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key\"\n],\n[\n    [\n        \"\",\n        \"30440220687871bc6144012d75baf585bb26ce13997f7d8c626f4d8825b069c3b2d064470220108936fe1c57327764782253e99090b09c203ec400ed35ce9e026ce2ecf842a001\",\n        \"5141048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179852ae\",\n        0.00000001\n    ],\n    \"0x22 0x0020230828ed48871f0f362ce9432aa52f620f442cc8d9ce7a8b5e798365595a38bb\",\n    \"HASH160 0x14 0x3478e7019ce61a68148f87549579b704cbe4c393 EQUAL\",\n    \"P2SH,WITNESS,WITNESS_PUBKEYTYPE\",\n    \"WITNESS_PUBKEYTYPE\",\n    \"P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key\"\n],\n\n[\"CHECKSEQUENCEVERIFY tests\"],\n[\"\", \"CHECKSEQUENCEVERIFY\", \"CHECKSEQUENCEVERIFY\", \"INVALID_STACK_OPERATION\", \"CSV automatically fails on an empty stack\"],\n[\"-1\", \"CHECKSEQUENCEVERIFY\", \"CHECKSEQUENCEVERIFY\", \"NEGATIVE_LOCKTIME\", \"CSV automatically fails if stack top is negative\"],\n[\"0x0100\", \"CHECKSEQUENCEVERIFY\", \"CHECKSEQUENCEVERIFY,MINIMALDATA\", \"UNKNOWN_ERROR\", \"CSV fails if stack top is not minimally encoded\"],\n[\"0\", \"CHECKSEQUENCEVERIFY\", \"CHECKSEQUENCEVERIFY\", \"UNSATISFIED_LOCKTIME\", \"CSV fails if stack top bit 1 << 31 is set and the tx version < 2\"],\n[\"4294967296\", \"CHECKSEQUENCEVERIFY\", \"CHECKSEQUENCEVERIFY\", \"UNSATISFIED_LOCKTIME\",\n  \"CSV fails if stack top bit 1 << 31 is not set, and tx version < 2\"],\n\n[\"MINIMALIF tests\"],\n[\"MINIMALIF is not applied to non-segwit scripts\"],\n[\"1\", \"IF 1 ENDIF\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[\"2\", \"IF 1 ENDIF\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[\"0x02 0x0100\", \"IF 1 ENDIF\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[\"0\", \"IF 1 ENDIF\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[\"0x01 0x00\", \"IF 1 ENDIF\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[\"1\", \"NOTIF 1 ENDIF\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[\"2\", \"NOTIF 1 ENDIF\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[\"0x02 0x0100\", \"NOTIF 1 ENDIF\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[\"0\", \"NOTIF 1 ENDIF\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[\"0x01 0x00\", \"NOTIF 1 ENDIF\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[\"Normal P2SH IF 1 ENDIF\"],\n[\"1 0x03 0x635168\", \"HASH160 0x14 0xe7309652a8e3f600f06f5d8d52d6df03d2176cc3 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[\"2 0x03 0x635168\", \"HASH160 0x14 0xe7309652a8e3f600f06f5d8d52d6df03d2176cc3 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[\"0x02 0x0100 0x03 0x635168\", \"HASH160 0x14 0xe7309652a8e3f600f06f5d8d52d6df03d2176cc3 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[\"0 0x03 0x635168\", \"HASH160 0x14 0xe7309652a8e3f600f06f5d8d52d6df03d2176cc3 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[\"0x01 0x00 0x03 0x635168\", \"HASH160 0x14 0xe7309652a8e3f600f06f5d8d52d6df03d2176cc3 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[\"0x03 0x635168\", \"HASH160 0x14 0xe7309652a8e3f600f06f5d8d52d6df03d2176cc3 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"UNBALANCED_CONDITIONAL\"],\n[\"Normal P2SH NOTIF 1 ENDIF\"],\n[\"1 0x03 0x645168\", \"HASH160 0x14 0x0c3f8fe3d6ca266e76311ecda544c67d15fdd5b0 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[\"2 0x03 0x645168\", \"HASH160 0x14 0x0c3f8fe3d6ca266e76311ecda544c67d15fdd5b0 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[\"0x02 0x0100 0x03 0x645168\", \"HASH160 0x14 0x0c3f8fe3d6ca266e76311ecda544c67d15fdd5b0 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[\"0 0x03 0x645168\", \"HASH160 0x14 0x0c3f8fe3d6ca266e76311ecda544c67d15fdd5b0 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[\"0x01 0x00 0x03 0x645168\", \"HASH160 0x14 0x0c3f8fe3d6ca266e76311ecda544c67d15fdd5b0 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[\"0x03 0x645168\", \"HASH160 0x14 0x0c3f8fe3d6ca266e76311ecda544c67d15fdd5b0 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"UNBALANCED_CONDITIONAL\"],\n[\"P2WSH IF 1 ENDIF\"],\n[[\"01\", \"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS\", \"OK\"],\n[[\"02\", \"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS\", \"OK\"],\n[[\"0100\", \"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS\", \"OK\"],\n[[\"\", \"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS\", \"EVAL_FALSE\"],\n[[\"00\", \"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS\", \"EVAL_FALSE\"],\n[[\"01\", \"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[[\"02\", \"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"0100\", \"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"\", \"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[[\"00\", \"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS\", \"UNBALANCED_CONDITIONAL\"],\n[[\"635168\", 0.00000001], \"\", \"0 0x20 0xc7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"P2SH,WITNESS,MINIMALIF\", \"UNBALANCED_CONDITIONAL\"],\n[\"P2WSH NOTIF 1 ENDIF\"],\n[[\"01\", \"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS\", \"EVAL_FALSE\"],\n[[\"02\", \"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS\", \"EVAL_FALSE\"],\n[[\"0100\", \"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS\", \"EVAL_FALSE\"],\n[[\"\", \"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS\", \"OK\"],\n[[\"00\", \"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS\", \"OK\"],\n[[\"01\", \"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[[\"02\", \"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"0100\", \"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"\", \"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[[\"00\", \"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS\", \"UNBALANCED_CONDITIONAL\"],\n[[\"645168\", 0.00000001], \"\", \"0 0x20 0xf913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"P2SH,WITNESS,MINIMALIF\", \"UNBALANCED_CONDITIONAL\"],\n\n\n\n[\"P2SH-P2WSH IF 1 ENDIF\"],\n[[\"01\", \"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS\", \"OK\"],\n[[\"02\", \"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS\", \"OK\"],\n[[\"0100\", \"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS\", \"OK\"],\n[[\"\", \"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS\", \"EVAL_FALSE\"],\n[[\"00\", \"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS\", \"EVAL_FALSE\"],\n[[\"01\", \"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[[\"02\", \"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"0100\", \"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"\", \"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[[\"00\", \"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS\", \"UNBALANCED_CONDITIONAL\"],\n[[\"635168\", 0.00000001], \"0x22 0x0020c7eaf06d5ae01a58e376e126eb1e6fab2036076922b96b2711ffbec1e590665d\", \"HASH160 0x14 0x9b27ee6d9010c21bf837b334d043be5d150e7ba7 EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"UNBALANCED_CONDITIONAL\"],\n[\"P2SH-P2WSH NOTIF 1 ENDIF\"],\n[[\"01\", \"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS\", \"EVAL_FALSE\"],\n[[\"02\", \"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS\", \"EVAL_FALSE\"],\n[[\"0100\", \"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS\", \"EVAL_FALSE\"],\n[[\"\", \"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS\", \"OK\"],\n[[\"00\", \"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS\", \"OK\"],\n[[\"01\", \"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"EVAL_FALSE\"],\n[[\"02\", \"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"0100\", \"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"\", \"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"OK\"],\n[[\"00\", \"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"MINIMALIF\"],\n[[\"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS\", \"UNBALANCED_CONDITIONAL\"],\n[[\"645168\", 0.00000001], \"0x22 0x0020f913eacf2e38a5d6fc3a8311d72ae704cb83866350a984dd3e5eb76d2a8c28e8\", \"HASH160 0x14 0xdbb7d1c0a56b7a9c423300c8cca6e6e065baf1dc EQUAL\", \"P2SH,WITNESS,MINIMALIF\", \"UNBALANCED_CONDITIONAL\"],\n\n[\"NULLFAIL should cover all signatures and signatures only\"],\n[\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\", \"0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT\", \"DERSIG\", \"OK\", \"BIP66 and NULLFAIL-compliant\"],\n[\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\", \"0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT\", \"DERSIG,NULLFAIL\", \"OK\", \"BIP66 and NULLFAIL-compliant\"],\n[\"1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\", \"0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT\", \"DERSIG,NULLFAIL\", \"OK\", \"BIP66 and NULLFAIL-compliant, not NULLDUMMY-compliant\"],\n[\"1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\", \"0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT\", \"DERSIG,NULLFAIL,NULLDUMMY\", \"SIG_NULLDUMMY\", \"BIP66 and NULLFAIL-compliant, not NULLDUMMY-compliant\"],\n[\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101\", \"0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT\", \"DERSIG\", \"OK\", \"BIP66-compliant but not NULLFAIL-compliant\"],\n[\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0x09 0x300602010102010101\", \"0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT\", \"DERSIG,NULLFAIL\", \"NULLFAIL\", \"BIP66-compliant but not NULLFAIL-compliant\"],\n[\"0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\", \"0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT\", \"DERSIG\", \"OK\", \"BIP66-compliant but not NULLFAIL-compliant\"],\n[\"0 0x09 0x300602010102010101 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\", \"0x01 0x14 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0x01 0x14 CHECKMULTISIG NOT\", \"DERSIG,NULLFAIL\", \"NULLFAIL\", \"BIP66-compliant but not NULLFAIL-compliant\"],\n\n[\"The End\"]\n]\n"
  },
  {
    "path": "src/test/data/sighash.json",
    "content": "[\n\t[\"raw_transaction, script, input_index, hashType, signature_hash (result)\"],\n\t[\"907c2bc503ade11cc3b04eb2918b6f547b0630ab569273824748c87ea14b0696526c66ba740200000004ab65ababfd1f9bdd4ef073c7afc4ae00da8a66f429c917a0081ad1e1dabce28d373eab81d8628de802000000096aab5253ab52000052ad042b5f25efb33beec9f3364e8a9139e8439d9d7e26529c3c30b6c3fd89f8684cfd68ea0200000009ab53526500636a52ab599ac2fe02a526ed040000000008535300516352515164370e010000000003006300ab2ec229\", \"\", 2, 1864164639, \"31af167a6cf3f9d5f6875caa4d31704ceb0eba078d132b78dab52c3b8997317e\"],\n\t[\"a0aa3126041621a6dea5b800141aa696daf28408959dfb2df96095db9fa425ad3f427f2f6103000000015360290e9c6063fa26912c2e7fb6a0ad80f1c5fea1771d42f12976092e7a85a4229fdb6e890000000001abc109f6e47688ac0e4682988785744602b8c87228fcef0695085edf19088af1a9db126e93000000000665516aac536affffffff8fe53e0806e12dfd05d67ac68f4768fdbe23fc48ace22a5aa8ba04c96d58e2750300000009ac51abac63ab5153650524aa680455ce7b000000000000499e50030000000008636a00ac526563ac5051ee030000000003abacabd2b6fe000000000003516563910fb6b5\", \"65\", 0, -1391424484, \"48d6a1bd2cd9eec54eb866fc71209418a950402b5d7e52363bfb75c98e141175\"],\n\t[\"6e7e9d4b04ce17afa1e8546b627bb8d89a6a7fefd9d892ec8a192d79c2ceafc01694a6a7e7030000000953ac6a51006353636a33bced1544f797f08ceed02f108da22cd24c9e7809a446c61eb3895914508ac91f07053a01000000055163ab516affffffff11dc54eee8f9e4ff0bcf6b1a1a35b1cd10d63389571375501af7444073bcec3c02000000046aab53514a821f0ce3956e235f71e4c69d91abe1e93fb703bd33039ac567249ed339bf0ba0883ef300000000090063ab65000065ac654bec3cc504bcf499020000000005ab6a52abac64eb060100000000076a6a5351650053bbbc130100000000056a6aab53abd6e1380100000000026a51c4e509b8\", \"acab655151\", 0, 479279909, \"2a3d95b09237b72034b23f2d2bb29fa32a58ab5c6aa72f6aafdfa178ab1dd01c\"],\n\t[\"73107cbd025c22ebc8c3e0a47b2a760739216a528de8d4dab5d45cbeb3051cebae73b01ca10200000007ab6353656a636affffffffe26816dffc670841e6a6c8c61c586da401df1261a330a6c6b3dd9f9a0789bc9e000000000800ac6552ac6aac51ffffffff0174a8f0010000000004ac52515100000000\", \"5163ac63635151ac\", 1, 1190874345, \"06e328de263a87b09beabe222a21627a6ea5c7f560030da31610c4611f4a46bc\"],\n\t[\"e93bbf6902be872933cb987fc26ba0f914fcfc2f6ce555258554dd9939d12032a8536c8802030000000453ac5353eabb6451e074e6fef9de211347d6a45900ea5aaf2636ef7967f565dce66fa451805c5cd10000000003525253ffffffff047dc3e6020000000007516565ac656aabec9eea010000000001633e46e600000000000015080a030000000001ab00000000\", \"5300ac6a53ab6a\", 1, -886562767, \"f03aa4fc5f97e826323d0daa03343ebf8a34ed67a1ce18631f8b88e5c992e798\"],\n\t[\"50818f4c01b464538b1e7e7f5ae4ed96ad23c68c830e78da9a845bc19b5c3b0b20bb82e5e9030000000763526a63655352ffffffff023b3f9c040000000008630051516a6a5163a83caf01000000000553ab65510000000000\", \"6aac\", 0, 946795545, \"746306f322de2b4b58ffe7faae83f6a72433c22f88062cdde881d4dd8a5a4e2d\"],\n\t[\"a93e93440250f97012d466a6cc24839f572def241c814fe6ae94442cf58ea33eb0fdd9bcc1030000000600636a0065acffffffff5dee3a6e7e5ad6310dea3e5b3ddda1a56bf8de7d3b75889fc024b5e233ec10f80300000007ac53635253ab53ffffffff0160468b04000000000800526a5300ac526a00000000\", \"ac00636a53\", 1, 1773442520, \"5c9d3a2ce9365bb72cfabbaa4579c843bb8abf200944612cf8ae4b56a908bcbd\"],\n\t[\"ce7d371f0476dda8b811d4bf3b64d5f86204725deeaa3937861869d5b2766ea7d17c57e40b0100000003535265ffffffff7e7e9188f76c34a46d0bbe856bde5cb32f089a07a70ea96e15e92abb37e479a10100000006ab6552ab655225bcab06d1c2896709f364b1e372814d842c9c671356a1aa5ca4e060462c65ae55acc02d0000000006abac0063ac5281b33e332f96beebdbc6a379ebe6aea36af115c067461eb99d22ba1afbf59462b59ae0bd0200000004ab635365be15c23801724a1704000000000965006a65ac00000052ca555572\", \"53ab530051ab\", 1, 2030598449, \"c336b2f7d3702fbbdeffc014d106c69e3413c7c71e436ba7562d8a7a2871f181\"],\n\t[\"d3b7421e011f4de0f1cea9ba7458bf3486bee722519efab711a963fa8c100970cf7488b7bb0200000003525352dcd61b300148be5d05000000000000000000\", \"535251536aac536a\", 0, -1960128125, \"29aa6d2d752d3310eba20442770ad345b7f6a35f96161ede5f07b33e92053e2a\"],\n\t[\"04bac8c5033460235919a9c63c42b2db884c7c8f2ed8fcd69ff683a0a2cccd9796346a04050200000003655351fcad3a2c5a7cbadeb4ec7acc9836c3f5c3e776e5c566220f7f965cf194f8ef98efb5e3530200000007526a006552526526a2f55ba5f69699ece76692552b399ba908301907c5763d28a15b08581b23179cb01eac03000000075363ab6a516351073942c2025aa98a05000000000765006aabac65abd7ffa6030000000004516a655200000000\", \"53ac6365ac526a\", 1, 764174870, \"bf5fdc314ded2372a0ad078568d76c5064bf2affbde0764c335009e56634481b\"],\n\t[\"c363a70c01ab174230bbe4afe0c3efa2d7f2feaf179431359adedccf30d1f69efe0c86ed390200000002ab51558648fe0231318b04000000000151662170000000000008ac5300006a63acac00000000\", \"\", 0, 2146479410, \"191ab180b0d753763671717d051f138d4866b7cb0d1d4811472e64de595d2c70\"],\n\t[\"8d437a7304d8772210a923fd81187c425fc28c17a5052571501db05c7e89b11448b36618cd02000000026a6340fec14ad2c9298fde1477f1e8325e5747b61b7e2ff2a549f3d132689560ab6c45dd43c3010000000963ac00ac000051516a447ed907a7efffebeb103988bf5f947fc688aab2c6a7914f48238cf92c337fad4a79348102000000085352ac526a5152517436edf2d80e3ef06725227c970a816b25d0b58d2cd3c187a7af2cea66d6b27ba69bf33a0300000007000063ab526553f3f0d6140386815d030000000003ab6300de138f00000000000900525153515265abac1f87040300000000036aac6500000000\", \"51\", 3, -315779667, \"b6632ac53578a741ae8c36d8b69e79f39b89913a2c781cdf1bf47a8c29d997a5\"],\n\t[\"fd878840031e82fdbe1ad1d745d1185622b0060ac56638290ec4f66b1beef4450817114a2c0000000009516a63ab53650051abffffffff37b7a10322b5418bfd64fb09cd8a27ddf57731aeb1f1f920ffde7cb2dfb6cdb70300000008536a5365ac53515369ecc034f1594690dbe189094dc816d6d57ea75917de764cbf8eccce4632cbabe7e116cd0100000003515352ffffffff035777fc000000000003515200abe9140300000000050063005165bed6d10200000000076300536363ab65195e9110\", \"635265\", 0, 1729787658, \"6e3735d37a4b28c45919543aabcb732e7a3e1874db5315abb7cc6b143d62ff10\"],\n\t[\"f40a750702af06efff3ea68e5d56e42bc41cdb8b6065c98f1221fe04a325a898cb61f3d7ee030000000363acacffffffffb5788174aef79788716f96af779d7959147a0c2e0e5bfb6c2dba2df5b4b97894030000000965510065535163ac6affffffff0445e6fd0200000000096aac536365526a526aa6546b000000000008acab656a6552535141a0fd010000000000c897ea030000000008526500ab526a6a631b39dba3\", \"00abab5163ac\", 1, -1778064747, \"d76d0fc0abfa72d646df888bce08db957e627f72962647016eeae5a8412354cf\"],\n\t[\"a63bc673049c75211aa2c09ecc38e360eaa571435fedd2af1116b5c1fa3d0629c269ecccbf0000000008ac65ab516352ac52ffffffffbf1a76fdda7f451a5f0baff0f9ccd0fe9136444c094bb8c544b1af0fa2774b06010000000463535253ffffffff13d6b7c3ddceef255d680d87181e100864eeb11a5bb6a3528cb0d70d7ee2bbbc02000000056a0052abab951241809623313b198bb520645c15ec96bfcc74a2b0f3db7ad61d455cc32db04afc5cc702000000016309c9ae25014d9473020000000004abab6aac3bb1e803\", \"\", 3, -232881718, \"6e48f3da3a4ac07eb4043a232df9f84e110485d7c7669dd114f679c27d15b97e\"],\n\t[\"4c565efe04e7d32bac03ae358d63140c1cfe95de15e30c5b84f31bb0b65bb542d637f49e0f010000000551abab536348ae32b31c7d3132030a510a1b1aacf7b7c3f19ce8dc49944ef93e5fa5fe2d356b4a73a00100000009abac635163ac00ab514c8bc57b6b844e04555c0a4f4fb426df139475cd2396ae418bc7015820e852f711519bc202000000086a00510000abac52488ff4aec72cbcfcc98759c58e20a8d2d9725aa4a80f83964e69bc4e793a4ff25cd75dc701000000086a52ac6aac5351532ec6b10802463e0200000000000553005265523e08680100000000002f39a6b0\", \"\", 3, 70712784, \"c6076b6a45e6fcfba14d3df47a34f6aadbacfba107e95621d8d7c9c0e40518ed\"],\n\t[\"1233d5e703403b3b8b4dae84510ddfc126b4838dcb47d3b23df815c0b3a07b55bf3098110e010000000163c5c55528041f480f40cf68a8762d6ed3efe2bd402795d5233e5d94bf5ddee71665144898030000000965525165655151656affffffff6381667e78bb74d0880625993bec0ea3bd41396f2bcccc3cc097b240e5e92d6a01000000096363acac6a63536365ffffffff04610ad60200000000065251ab65ab52e90d680200000000046351516ae30e98010000000008abab52520063656a671856010000000004ac6aac514c84e383\", \"6aabab636300\", 1, -114996813, \"aeb8c5a62e8a0b572c28f2029db32854c0b614dbecef0eaa726abebb42eebb8d\"],\n\t[\"0c69702103b25ceaed43122cc2672de84a3b9aa49872f2a5bb458e19a52f8cc75973abb9f102000000055365656aacffffffff3ffb1cf0f76d9e3397de0942038c856b0ebbea355dc9d8f2b06036e19044b0450100000000ffffffff4b7793f4169617c54b734f2cd905ed65f1ce3d396ecd15b6c426a677186ca0620200000008655263526551006a181a25b703240cce0100000000046352ab53dee22903000000000865526a6a516a51005e121602000000000852ab52ababac655200000000\", \"6a516aab63\", 1, -2040012771, \"a6e6cb69f409ec14e10dd476f39167c29e586e99bfac93a37ed2c230fcc1dbbe\"],\n\t[\"fd22692802db8ae6ab095aeae3867305a954278f7c076c542f0344b2591789e7e33e4d29f4020000000151ffffffffb9409129cfed9d3226f3b6bab7a2c83f99f48d039100eeb5796f00903b0e5e5e0100000006656552ac63abd226abac0403e649000000000007abab51ac5100ac8035f10000000000095165006a63526a52510d42db030000000007635365ac6a63ab24ef5901000000000453ab6a0000000000\", \"536a52516aac6a\", 1, 309309168, \"7ca0f75e6530ec9f80d031fc3513ca4ecd67f20cb38b4dacc6a1d825c3cdbfdb\"],\n\t[\"a43f85f701ffa54a3cc57177510f3ea28ecb6db0d4431fc79171cad708a6054f6e5b4f89170000000008ac6a006a536551652bebeaa2013e779c05000000000665ac5363635100000000\", \"ac\", 0, 2028978692, \"58294f0d7f2e68fe1fd30c01764fe1619bcc7961d68968944a0e263af6550437\"],\n\t[\"c2b0b99001acfecf7da736de0ffaef8134a9676811602a6299ba5a2563a23bb09e8cbedf9300000000026300ffffffff042997c50300000000045252536a272437030000000007655353ab6363ac663752030000000002ab6a6d5c900000000000066a6a5265abab00000000\", \"52ac525163515251\", 0, -894181723, \"8b300032a1915a4ac05cea2f7d44c26f2a08d109a71602636f15866563eaafdc\"],\n\t[\"82f9f10304c17a9d954cf3380db817814a8c738d2c811f0412284b2c791ec75515f38c4f8c020000000265ab5729ca7db1b79abee66c8a757221f29280d0681355cb522149525f36da760548dbd7080a0100000001510b477bd9ce9ad5bb81c0306273a3a7d051e053f04ecf3a1dbeda543e20601a5755c0cfae030000000451ac656affffffff71141a04134f6c292c2e0d415e6705dfd8dcee892b0d0807828d5aeb7d11f5ef0300000001520b6c6dc802a6f3dd0000000000056aab515163bfb6800300000000015300000000\", \"\", 3, -635779440, \"d55ed1e6c53510f2608716c12132a11fb5e662ec67421a513c074537eeccc34b\"],\n\t[\"8edcf5a1014b604e53f0d12fe143cf4284f86dc79a634a9f17d7e9f8725f7beb95e8ffcd2403000000046aabac52ffffffff01c402b5040000000005ab6a63525100000000\", \"6351525251acabab6a\", 0, 1520147826, \"2765bbdcd3ebb8b1a316c04656b28d637f80bffbe9b040661481d3dc83eea6d6\"],\n\t[\"2074bad5011847f14df5ea7b4afd80cd56b02b99634893c6e3d5aaad41ca7c8ee8e5098df003000000026a6affffffff018ad59700000000000900ac656a526551635300000000\", \"65635265\", 0, -1804671183, \"663c999a52288c9999bff36c9da2f8b78d5c61b8347538f76c164ccba9868d0a\"],\n\t[\"7100b11302e554d4ef249ee416e7510a485e43b2ba4b8812d8fe5529fe33ea75f36d392c4403000000020000ffffffff3d01a37e075e9a7715a657ae1bdf1e44b46e236ad16fd2f4c74eb9bf370368810000000007636553ac536365ffffffff01db696a0400000000065200ac656aac00000000\", \"63005151\", 0, -1210499507, \"b9c3aee8515a4a3b439de1ffc9c156824bda12cb75bfe5bc863164e8fd31bd7a\"],\n\t[\"02c1017802091d1cb08fec512db7b012fe4220d57a5f15f9e7676358b012786e1209bcff950100000004acab6352ffffffff799bc282724a970a6fea1828984d0aeb0f16b67776fa213cbdc4838a2f1961a3010000000951516a536552ab6aabffffffff016c7b4b03000000000865abac5253ac5352b70195ad\", \"65655200516a\", 0, -241626954, \"be567cb47170b34ff81c66c1142cb9d27f9b6898a384d6dfc4fce16b75b6cb14\"],\n\t[\"cb3178520136cd294568b83bb2520f78fecc507898f4a2db2674560d72fd69b9858f75b3b502000000066aac00515100ffffffff03ab005a01000000000563526363006e3836030000000001abfbda3200000000000665ab0065006500000000\", \"ab516a0063006a5300\", 0, 1182109299, \"2149e79c3f4513da4e4378608e497dcfdfc7f27c21a826868f728abd2b8a637a\"],\n\t[\"18a4b0c004702cf0e39686ac98aab78ad788308f1d484b1ddfe70dc1997148ba0e28515c310300000000ffffffff05275a52a23c59da91129093364e275da5616c4070d8a05b96df5a2080ef259500000000096aac51656a6aac53ab66e64966b3b36a07dd2bb40242dd4a3743d3026e7e1e0d9e9e18f11d068464b989661321030000000265ac383339c4fae63379cafb63b0bab2eca70e1f5fc7d857eb5c88ccd6c0465093924bba8b2a000000000300636ab5e0545402bc2c4c010000000000cd41c002000000000000000000\", \"abac635253656a00\", 3, 2052372230, \"32db877b6b1ca556c9e859442329406f0f8246706522369839979a9f7a235a32\"],\n\t[\"1d9c5df20139904c582285e1ea63dec934251c0f9cf5c47e86abfb2b394ebc57417a81f67c010000000353515222ba722504800d3402000000000353656a3c0b4a0200000000000fb8d20500000000076300ab005200516462f30400000000015200000000\", \"ab65\", 0, -210854112, \"edf73e2396694e58f6b619f68595b0c1cdcb56a9b3147845b6d6afdb5a80b736\"],\n\t[\"4504cb1904c7a4acf375ddae431a74de72d5436efc73312cf8e9921f431267ea6852f9714a01000000066a656a656553a2fbd587c098b3a1c5bd1d6480f730a0d6d9b537966e20efc0e352d971576d0f87df0d6d01000000016321aeec3c4dcc819f1290edb463a737118f39ab5765800547522708c425306ebfca3f396603000000055300ac656a1d09281d05bfac57b5eb17eb3fa81ffcedfbcd3a917f1be0985c944d473d2c34d245eb350300000007656a51525152ac263078d9032f470f0500000000066aac00000052e12da60200000000003488410200000000076365006300ab539981e432\", \"52536a52526a\", 1, -31909119, \"f0a2deee7fd8a3a9fad6927e763ded11c940ee47e9e6d410f94fda5001f82e0c\"],\n\t[\"14bc7c3e03322ec0f1311f4327e93059c996275302554473104f3f7b46ca179bfac9ef753503000000016affffffff9d405eaeffa1ca54d9a05441a296e5cc3a3e32bb8307afaf167f7b57190b07e00300000008abab51ab5263abab45533aa242c61bca90dd15d46079a0ab0841d85df67b29ba87f2393cd764a6997c372b55030000000452005263ffffffff0250f40e02000000000651516a0063630e95ab0000000000046a5151ac00000000\", \"6a65005151\", 0, -1460947095, \"aa418d096929394c9147be8818d8c9dafe6d105945ab9cd7ec682df537b5dd79\"],\n\t[\"2b3bd0dd04a1832f893bf49a776cd567ec4b43945934f4786b615d6cb850dfc0349b33301a000000000565ac000051cf80c670f6ddafab63411adb4d91a69c11d9ac588898cbfb4cb16061821cc104325c895103000000025163ffffffffa9e2d7506d2d7d53b882bd377bbcc941f7a0f23fd15d2edbef3cd9df8a4c39d10200000009ac63006a52526a5265ffffffff44c099cdf10b10ce87d4b38658d002fd6ea17ae4a970053c05401d86d6e75f99000000000963ab53526a5252ab63ffffffff035af69c01000000000100ba9b8b0400000000004cead10500000000026a520b77d667\", \"ab52abac526553\", 3, -1955078165, \"eb9ceecc3b401224cb79a44d23aa8f428e29f1405daf69b4e01910b848ef1523\"],\n\t[\"35df11f004a48ba439aba878fe9df20cc935b4a761c262b1b707e6f2b33e2bb7565cd68b130000000000ffffffffb2a2f99abf64163bb57ca900500b863f40c02632dfd9ea2590854c5fb4811da90200000006ac006363636affffffffaf9d89b2a8d2670ca37c8f7c140600b81259f2e037cb4590578ec6e37af8bf200000000005abac6a655270a4751eb551f058a93301ffeda2e252b6614a1fdd0e283e1d9fe53c96c5bbaafaac57b8030000000153ffffffff020d9f3b02000000000100ed7008030000000004abac000000000000\", \"abac\", 3, 593793071, \"88fdee1c2d4aeead71d62396e28dc4d00e5a23498eea66844b9f5d26d1f21042\"],\n\t[\"a08ff466049fb7619e25502ec22fedfb229eaa1fe275aa0b5a23154b318441bf547989d0510000000005ab5363636affffffff2b0e335cb5383886751cdbd993dc0720817745a6b1c9b8ab3d15547fc9aafd03000000000965656a536a52656a532b53d10584c290d3ac1ab74ab0a19201a4a039cb59dc58719821c024f6bf2eb26322b33f010000000965ac6aac0053ab6353ffffffff048decba6ebbd2db81e416e39dde1f821ba69329725e702bcdea20c5cc0ecc6402000000086363ab5351ac6551466e377b0468c0fa00000000000651ab53ac6a513461c6010000000008636a636365535100eeb3dc010000000006526a52ac516a43f362010000000005000063536500000000\", \"0063516a\", 1, -1158911348, \"f6a1ecb50bd7c2594ebecea5a1aa23c905087553e40486dade793c2f127fdfae\"],\n\t[\"5ac2f17d03bc902e2bac2469907ec7d01a62b5729340bc58c343b7145b66e6b97d434b30fa000000000163ffffffff44028aa674192caa0d0b4ebfeb969c284cb16b80c312d096efd80c6c6b094cca000000000763acabac516a52ffffffff10c809106e04b10f9b43085855521270fb48ab579266e7474657c6c625062d2d030000000351636595a0a97004a1b69603000000000465ab005352ad68010000000008636a5263acac5100da7105010000000002acab90325200000000000000000000\", \"6a6aab516a63526353\", 2, 1518400956, \"f7efb74b1dcc49d316b49c632301bc46f98d333c427e55338be60c7ef0d953be\"],\n\t[\"aeb2e11902dc3770c218b97f0b1960d6ee70459ecb6a95eff3f05295dc1ef4a0884f10ba460300000005516352526393e9b1b3e6ae834102d699ddd3845a1e159aa7cf7635edb5c02003f7830fee3788b795f20100000009ab006a526553ac006ad8809c570469290e0400000000050000abab00b10fd5040000000008ab655263abac53ab630b180300000000009d9993040000000002516300000000\", \"5351ababac6a65\", 0, 1084852870, \"f2286001af0b0170cbdad92693d0a5ebaa8262a4a9d66e002f6d79a8c94026d1\"],\n\t[\"9860ca9a0294ff4812534def8c3a3e3db35b817e1a2ddb7f0bf673f70eab71bb79e90a2f3100000000086a636551acac5165ffffffffed4d6d3cd9ff9b2d490e0c089739121161a1445844c3e204296816ab06e0a83702000000035100ac88d0db5201c3b59a050000000005ac6a0051ab00000000\", \"535263ab006a526aab\", 1, -962088116, \"30df2473e1403e2b8e637e576825f785528d998af127d501556e5f7f5ed89a2a\"],\n\t[\"4ddaa680026ec4d8060640304b86823f1ac760c260cef81d85bd847952863d629a3002b54b0200000008526365636a656aab65457861fc6c24bdc760c8b2e906b6656edaf9ed22b5f50e1fb29ec076ceadd9e8ebcb6b000000000152ffffffff033ff04f00000000000551526a00657a1d900300000000002153af040000000003006a6300000000\", \"ab526a53acabab\", 0, 1055317633, \"7f21b62267ed52462e371a917eb3542569a4049b9dfca2de3c75872b39510b26\"],\n\t[\"01e76dcd02ad54cbc8c71d68eaf3fa7c883b65d74217b30ba81f1f5144ef80b706c0dc82ca000000000352ab6a078ec18bcd0514825feced2e8b8ea1ccb34429fae41c70cc0b73a2799e85603613c6870002000000086363ab6365536a53ffffffff043acea90000000000016ad20e1803000000000100fa00830200000000056352515351e864ee00000000000865535253ab6a6551d0c46672\", \"6a6365abacab\", 0, -1420559003, \"8af0b4cbdbc011be848edf4dbd2cde96f0578d662cfebc42252495387114224a\"],\n\t[\"fa00b26402670b97906203434aa967ce1559d9bd097d56dbe760469e6032e7ab61accb54160100000006635163630052fffffffffe0d3f4f0f808fd9cfb162e9f0c004601acf725cd7ea5683bbdc9a9a433ef15a0200000005ab52536563d09c7bef049040f305000000000153a7c7b9020000000004ac63ab52847a2503000000000553ab00655390ed80010000000005006553ab52860671d4\", \"536565ab52\", 0, 799022412, \"40ed8e7bbbd893e15f3cce210ae02c97669818de5946ca37eefc7541116e2c78\"],\n\t[\"cb5c06dc01b022ee6105ba410f0eb12b9ce5b5aa185b28532492d839a10cef33d06134b91b010000000153ffffffff02cec0530400000000005e1e4504000000000865656551acacac6a00000000\", \"ab53\", 0, -1514251329, \"136beb95459fe6b126cd6cefd54eb5d971524b0e883e41a292a78f78015cb8d5\"],\n\t[\"f10a0356031cd569d652dbca8e7a4d36c8da33cdff428d003338602b7764fe2c96c505175b010000000465ac516affffffffbb54563c71136fa944ee20452d78dc87073ac2365ba07e638dce29a5d179da600000000003635152ffffffff9a411d8e2d421b1e6085540ee2809901e590940bbb41532fa38bd7a16b68cc350100000007535251635365636195df1603b61c45010000000002ab65bf6a310400000000026352fcbba10200000000016aa30b7ff0\", \"5351\", 0, 1552495929, \"9eb8adf2caecb4bf9ac59d7f46bd20e83258472db2f569ee91aba4cf5ee78e29\"],\n\t[\"c3325c9b012f659466626ca8f3c61dfd36f34670abc054476b7516a1839ec43cd0870aa0c0000000000753525265005351e7e3f04b0112650500000000000363ac6300000000\", \"acac\", 0, -68961433, \"5ca70e727d91b1a42b78488af2ed551642c32d3de4712a51679f60f1456a8647\"],\n\t[\"2333e54c044370a8af16b9750ac949b151522ea6029bacc9a34261599549581c7b4e5ece470000000007510052006563abffffffff80630fc0155c750ce20d0ca4a3d0c8e8d83b014a5b40f0b0be0dd4c63ac28126020000000465000000ffffffff1b5f1433d38cdc494093bb1d62d84b10abbdae57e3d04e82e600857ab3b1dc990300000003515100b76564be13e4890a908ea7508afdad92ec1b200a9a67939fadce6eb7a29eb4550a0a28cb0300000001acffffffff02926c930300000000016373800201000000000153d27ee740\", \"ab6365ab516a53\", 3, 598653797, \"2be27a686eb7940dd32c44ff3a97c1b28feb7ab9c5c0b1593b2d762361cfc2db\"],\n\t[\"b500ca48011ec57c2e5252e5da6432089130603245ffbafb0e4c5ffe6090feb629207eeb0e010000000652ab6a636aab8302c9d2042b44f40500000000015278c05a050000000004ac5251524be080020000000007636aac63ac5252c93a9a04000000000965ab6553636aab5352d91f9ddb\", \"52005100\", 0, -2024394677, \"49c8a6940a461cc7225637f1e512cdd174c99f96ec05935a59637ededc77124c\"],\n\t[\"f52ff64b02ee91adb01f3936cc42e41e1672778962b68cf013293d649536b519bc3271dd2c00000000020065afee11313784849a7c15f44a61cd5fd51ccfcdae707e5896d131b082dc9322a19e12858501000000036aac654e8ca882022deb7c020000000006006a515352abd3defc0000000000016300000000\", \"63520063\", 0, 1130989496, \"7f208df9a5507e98c62cebc5c1e2445eb632e95527594929b9577b53363e96f6\"],\n\t[\"ab7d6f36027a7adc36a5cf7528fe4fb5d94b2c96803a4b38a83a675d7806dda62b380df86a0000000003000000ffffffff5bc00131e29e22057c04be854794b4877dda42e416a7a24706b802ff9da521b20000000007ac6a0065ac52ac957cf45501b9f06501000000000500ac6363ab25f1110b\", \"00526500536a635253\", 0, 911316637, \"5fa09d43c8aef6f6fa01c383a69a5a61a609cd06e37dce35a39dc9eae3ddfe6c\"],\n\t[\"f940888f023dce6360263c850372eb145b864228fdbbb4c1186174fa83aab890ff38f8c9a90300000000ffffffff01e80ccdb081e7bbae1c776531adcbfb77f2e5a7d0e5d0d0e2e6c8758470e85f00000000020053ffffffff03b49088050000000004656a52ab428bd604000000000951630065ab63ac636a0cbacf0400000000070063ac5265ac53d6e16604\", \"ac63\", 0, 39900215, \"713ddeeefcfe04929e7b6593c792a4efbae88d2b5280d1f0835d2214eddcbad6\"],\n\t[\"530ecd0b01ec302d97ef6f1b5a6420b9a239714013e20d39aa3789d191ef623fc215aa8b940200000005ac5351ab6a3823ab8202572eaa04000000000752ab6a51526563fd8a270100000000036a006581a798f0\", \"525153656a0063\", 0, 1784562684, \"fe42f73a8742676e640698222b1bd6b9c338ff1ccd766d3d88d7d3c6c6ac987e\"],\n\t[\"5d781d9303acfcce964f50865ddfddab527ea971aee91234c88e184979985c00b4de15204b0100000003ab6352a009c8ab01f93c8ef2447386c434b4498538f061845862c3f9d5751ad0fce52af442b3a902000000045165ababb909c66b5a3e7c81b3c45396b944be13b8aacfc0204f3f3c105a66fa8fa6402f1b5efddb01000000096a65ac636aacab656ac3c677c402b79fa4050000000004006aab5133e35802000000000751ab635163ab0078c2e025\", \"6aac51636a6a005265\", 0, -882306874, \"551ce975d58647f10adefb3e529d9bf9cda34751627ec45e690f135ef0034b95\"],\n\t[\"25ee54ef0187387564bb86e0af96baec54289ca8d15e81a507a2ed6668dc92683111dfb7a50100000004005263634cecf17d0429aa4d000000000007636a6aabab5263daa75601000000000251ab4df70a01000000000151980a890400000000065253ac6a006377fd24e3\", \"65ab\", 0, 797877378, \"069f38fd5d47abff46f04ee3ae27db03275e9aa4737fa0d2f5394779f9654845\"],\n\t[\"a9c57b1a018551bcbc781b256642532bbc09967f1cbe30a227d352a19365d219d3f11649a3030000000451655352b140942203182894030000000006ab00ac6aab654add350400000000003d379505000000000553abacac00e1739d36\", \"5363\", 0, -1069721025, \"6da32416deb45a0d720a1dbe6d357886eabc44029dd5db74d50feaffbe763245\"],\n\t[\"05c4fb94040f5119dc0b10aa9df054871ed23c98c890f1e931a98ffb0683dac45e98619fdc0200000007acab6a525263513e7495651c9794c4d60da835d303eb4ee6e871f8292f6ad0b32e85ef08c9dc7aa4e03c9c010000000500ab52acacfffffffffee953259cf14ced323fe8d567e4c57ba331021a1ef5ac2fa90f7789340d7c550100000007ac6aacac6a6a53ffffffff08d9dc820d00f18998af247319f9de5c0bbd52a475ea587f16101af3afab7c210100000003535363569bca7c0468e34f00000000000863536353ac51ac6584e319010000000006650052ab6a533debea030000000003ac0053ee7070020000000006ac52005253ac00000000\", \"6351005253\", 2, 1386916157, \"76c4013c40bfa1481badd9d342b6d4b8118de5ab497995fafbf73144469e5ff0\"],\n\t[\"c95ab19104b63986d7303f4363ca8f5d2fa87c21e3c5d462b99f1ebcb7c402fc012f5034780000000009006aac63ac65655265ffffffffbe91afa68af40a8700fd579c86d4b706c24e47f7379dad6133de389f815ef7f501000000046aac00abffffffff1520db0d81be4c631878494668d258369f30b8f2b7a71e257764e9a27f24b48701000000076a515100535300b0a989e1164db9499845bac01d07a3a7d6d2c2a76e4c04abe68f808b6e2ef5068ce6540e0100000009ac53636a63ab65656affffffff0309aac6050000000005ab6563656a6067e8020000000003ac536aec91c8030000000009655251ab65ac6a53acc7a45bc5\", \"63526a65abac\", 1, 512079270, \"fb7eca81d816354b6aedec8cafc721d5b107336657acafd0d246049556f9e04b\"],\n\t[\"ca66ae10049533c2b39f1449791bd6d3f039efe0a121ab7339d39ef05d6dcb200ec3fb2b3b020000000465006a53ffffffff534b8f97f15cc7fb4f4cea9bf798472dc93135cd5b809e4ca7fe4617a61895980100000000ddd83c1dc96f640929dd5e6f1151dab1aa669128591f153310d3993e562cc7725b6ae3d903000000046a52536582f8ccddb8086d8550f09128029e1782c3f2624419abdeaf74ecb24889cc45ac1a64492a0100000002516a4867b41502ee6ccf03000000000752acacab52ab6a4b7ba80000000000075151ab0052536300000000\", \"6553\", 2, -62969257, \"8085e904164ab9a8c20f58f0d387f6adb3df85532e11662c03b53c3df8c943cb\"],\n\t[\"ba646d0b0453999f0c70cb0430d4cab0e2120457bb9128ed002b6e9500e9c7f8d7baa20abe0200000001652a4e42935b21db02b56bf6f08ef4be5adb13c38bc6a0c3187ed7f6197607ba6a2c47bc8a03000000040052516affffffffa55c3cbfc19b1667594ac8681ba5d159514b623d08ed4697f56ce8fcd9ca5b0b00000000096a6a5263ac655263ab66728c2720fdeabdfdf8d9fb2bfe88b295d3b87590e26a1e456bad5991964165f888c03a0200000006630051ac00acffffffff0176fafe0100000000070063acac65515200000000\", \"63\", 1, 2002322280, \"9db4e320208185ee70edb4764ee195deca00ba46412d5527d9700c1cf1c3d057\"],\n\t[\"2ddb8f84039f983b45f64a7a79b74ff939e3b598b38f436def7edd57282d0803c7ef34968d02000000026a537eb00c4187de96e6e397c05f11915270bcc383959877868ba93bac417d9f6ed9f627a7930300000004516551abffffffffacc12f1bb67be3ae9f1d43e55fda8b885340a0df1175392a8bbd9f959ad3605003000000025163ffffffff02ff0f4700000000000070bd99040000000003ac53abf8440b42\", \"\", 2, -393923011, \"0133f1a161363b71dfb3a90065c7128c56bd0028b558b610142df79e055ab5c7\"],\n\t[\"b21fc15403b4bdaa994204444b59323a7b8714dd471bd7f975a4e4b7b48787e720cbd1f5f00000000000ffffffff311533001cb85c98c1d58de0a5fbf27684a69af850d52e22197b0dc941bc6ca9030000000765ab6363ab5351a8ae2c2c7141ece9a4ff75c43b7ea9d94ec79b7e28f63e015ac584d984a526a73fe1e04e0100000007526352536a5365ffffffff02a0a9ea030000000002ab52cfc4f300000000000465525253e8e0f342\", \"000000\", 1, 1305253970, \"d1df1f4bba2484cff8a816012bb6ec91c693e8ca69fe85255e0031711081c46a\"],\n\t[\"d1704d6601acf710b19fa753e307cfcee2735eada0d982b5df768573df690f460281aad12d0000000007656300005100acffffffff0232205505000000000351ab632ca1bc0300000000016300000000\", \"ac65ab65ab51\", 0, 165179664, \"40b4f03c68288bdc996011b0f0ddb4b48dc3be6762db7388bdc826113266cd6c\"],\n\t[\"d2f6c096025cc909952c2400bd83ac3d532bfa8a1f8f3e73c69b1fd7b8913379793f3ce92202000000076a00ab6a53516ade5332d81d58b22ed47b2a249ab3a2cb3a6ce9a6b5a6810e18e3e1283c1a1b3bd73e3ab00300000002acabffffffff01a9b2d40500000000056352abab00dc4b7f69\", \"ab0065\", 0, -78019184, \"2ef025e907f0fa454a2b48a4f3b81346ba2b252769b5c35d742d0c8985e0bf5e\"],\n\t[\"3e6db1a1019444dba461247224ad5933c997256d15c5d37ade3d700506a0ba0a57824930d7010000000852ab6500ab00ac00ffffffff03389242020000000001aba8465a0200000000086a6a636a5100ab52394e6003000000000953ac51526351000053d21d9800\", \"abababacab53ab65\", 0, 1643661850, \"1f8a3aca573a609f4aea0c69522a82fcb4e15835449da24a05886ddc601f4f6a\"],\n\t[\"f821a042036ad43634d29913b77c0fc87b4af593ac86e9a816a9d83fd18dfcfc84e1e1d57102000000076a63ac52006351ffffffffbcdaf490fc75086109e2f832c8985716b3a624a422cf9412fe6227c10585d21203000000095252abab5352ac526affffffff2efed01a4b73ad46c7f7bc7fa3bc480f8e32d741252f389eaca889a2e9d2007e000000000353ac53ffffffff032ac8b3020000000009636300000063516300d3d9f2040000000006510065ac656aafa5de0000000000066352ab5300ac9042b57d\", \"525365\", 1, 667065611, \"0d17a92c8d5041ba09b506ddf9fd48993be389d000aad54f9cc2a44fcc70426b\"],\n\t[\"58e3f0f704a186ef55d3919061459910df5406a9121f375e7502f3be872a449c3f2bb058380100000000f0e858da3ac57b6c973f889ad879ffb2bd645e91b774006dfa366c74e2794aafc8bbc871010000000751ac65516a515131a68f120fd88ca08687ceb4800e1e3fbfea7533d34c84fef70cc5a96b648d580369526d000000000600ac00515363f6191d5b3e460fa541a30a6e83345dedfa3ed31ad8574d46d7bbecd3c9074e6ba5287c24020000000151e3e19d6604162602010000000004005100ac71e17101000000000065b5e90300000000040053ab53f6b7d101000000000200ac00000000\", \"6563ab\", 1, -669018604, \"8221d5dfb75fc301a80e919e158e0b1d1e86ffb08870a326c89408d9bc17346b\"],\n\t[\"efec1cce044a676c1a3d973f810edb5a9706eb4cf888a240f2b5fb08636bd2db482327cf500000000005ab51656a52ffffffff46ef019d7c03d9456e5134eb0a7b5408d274bd8e33e83df44fab94101f7c5b650200000009ac5100006353630051407aadf6f5aaffbd318fdbbc9cae4bd883e67d524df06bb006ce2f7c7e2725744afb76960100000005536aab53acec0d64eae09e2fa1a7c4960354230d51146cf6dc45ee8a51f489e20508a785cbe6ca86fc000000000651536a516300ffffffff014ef598020000000006636aac655265a6ae1b75\", \"53516a5363526563ab\", 2, -1823982010, \"13e8b5ab4e5b2ceeff0045c625e19898bda2d39fd7af682e2d1521303cfe1154\"],\n\t[\"3c436c2501442a5b700cbc0622ee5143b34b1b8021ea7bbc29e4154ab1f5bdfb3dff9d640501000000086aab5251ac5252acffffffff0170b9a20300000000066aab6351525114b13791\", \"63acabab52ab51ac65\", 0, -2140612788, \"87ddf1f9acb6640448e955bd1968f738b4b3e073983af7b83394ab7557f5cd61\"],\n\t[\"d62f183e037e0d52dcf73f9b31f70554bce4f693d36d17552d0e217041e01f15ad3840c838000000000963acac6a6a6a63ab63ffffffffabdfb395b6b4e63e02a763830f536fc09a35ff8a0cf604021c3c751fe4c88f4d0300000006ab63ab65ac53aa4d30de95a2327bccf9039fb1ad976f84e0b4a0936d82e67eafebc108993f1e57d8ae39000000000165ffffffff04364ad30500000000036a005179fd84010000000007ab636aac6363519b9023030000000008510065006563ac6acd2a4a02000000000000000000\", \"52\", 1, 595020383, \"da8405db28726dc4e0f82b61b2bfd82b1baa436b4e59300305cc3b090b157504\"],\n\t[\"44c200a5021238de8de7d80e7cce905606001524e21c8d8627e279335554ca886454d692e6000000000500acac52abbb8d1dc876abb1f514e96b21c6e83f429c66accd961860dc3aed5071e153e556e6cf076d02000000056553526a51870a928d0360a580040000000004516a535290e1e302000000000851ab6a00510065acdd7fc5040000000007515363ab65636abb1ec182\", \"6363\", 0, -785766894, \"ed53cc766cf7cb8071cec9752460763b504b2183442328c5a9761eb005c69501\"],\n\t[\"d682d52d034e9b062544e5f8c60f860c18f029df8b47716cabb6c1b4a4b310a0705e754556020000000400656a0016eeb88eef6924fed207fba7ddd321ff3d84f09902ff958c815a2bf2bb692eb52032c4d803000000076365ac516a520099788831f8c8eb2552389839cfb81a9dc55ecd25367acad4e03cfbb06530f8cccf82802701000000085253655300656a53ffffffff02d543200500000000056a510052ac03978b05000000000700ac51525363acfdc4f784\", \"\", 2, -696035135, \"e1a256854099907050cfee7778f2018082e735a1f1a3d91437584850a74c87bb\"],\n\t[\"e8c0dec5026575ddf31343c20aeeca8770afb33d4e562aa8ee52eeda6b88806fdfd4fe0a97030000000953acabab65ab516552ffffffffdde122c2c3e9708874286465f8105f43019e837746686f442666629088a970e0010000000153ffffffff01f98eee0100000000025251fe87379a\", \"63\", 1, 633826334, \"abe441209165d25bc6d8368f2e7e7dc21019056719fef1ace45542aa2ef282e2\"],\n\t[\"b288c331011c17569293c1e6448e33a64205fc9dc6e35bc756a1ac8b97d18e912ea88dc0770200000007635300ac6aacabfc3c890903a3ccf8040000000004656500ac9c65c9040000000009ab6a6aabab65abac63ac5f7702000000000365005200000000\", \"526a63\", 0, 1574937329, \"0dd1bd5c25533bf5f268aa316ce40f97452cca2061f0b126a59094ca5b65f7a0\"],\n\t[\"fc0a092003cb275fa9a25a72cf85d69c19e4590bfde36c2b91cd2c9c56385f51cc545530210000000004ab530063ffffffff729b006eb6d14d6e5e32b1c376acf1c62830a5d9246da38dbdb4db9f51fd1c74020000000463636500ffffffff0ae695c6d12ab7dcb8d3d4b547b03f178c7268765d1de9af8523d244e3836b12030000000151ffffffff0115c1e20100000000066a6aabac6a6a1ff59aec\", \"ab0053ac\", 0, 931831026, \"73fe22099c826c34a74edf45591f5d7b3a888c8178cd08facdfd96a9a681261c\"],\n\t[\"0fcae7e004a71a4a7c8f66e9450c0c1785268679f5f1a2ee0fb3e72413d70a9049ecff75de020000000452005251ffffffff99c8363c4b95e7ec13b8c017d7bb6e80f7c04b1187d6072961e1c2479b1dc0320200000000ffffffff7cf03b3d66ab53ed740a70c5c392b84f780fff5472aee82971ac3bfeeb09b2df0200000006ab5265636a0058e4fe9257d7c7c7e82ff187757c6eadc14cceb6664dba2de03a018095fd3006682a5b9600000000056353536a636de26b2303ff76de010000000001acdc0a2e020000000001ab0a53ed020000000007530063ab51510088417307\", \"ac6aacab5165535253\", 2, -902160694, \"eea96a48ee572aea33d75d0587ce954fcfb425531a7da39df26ef9a6635201be\"],\n\t[\"612701500414271138e30a46b7a5d95c70c78cc45bf8e40491dac23a6a1b65a51af04e6b94020000000451655153ffffffffeb72dc0e49b2fad3075c19e1e6e4b387f1365dca43d510f6a02136318ddecb7f0200000003536352e115ffc4f9bae25ef5baf534a890d18106fb07055c4d7ec9553ba89ed1ac2101724e507303000000080063006563acabac2ff07f69a080cf61a9d19f868239e6a4817c0eeb6a4f33fe254045d8af2bca289a8695de0300000000430736c404d317840500000000086a00abac5351ab65306e0503000000000963ab0051536aabab6a6c8aca01000000000565516351ab5dcf960100000000016a00000000\", \"ab\", 2, -604581431, \"5ec805e74ee934aa815ca5f763425785ae390282d46b5f6ea076b6ad6255a842\"],\n\t[\"6b68ba00023bb4f446365ea04d68d48539aae66f5b04e31e6b38b594d2723ab82d44512460000000000200acffffffff5dfc6febb484fff69c9eeb7c7eb972e91b6d949295571b8235b1da8955f3137b020000000851ac6352516a535325828c8a03365da801000000000800636aabac6551ab0f594d03000000000963ac536365ac63636a45329e010000000005abac53526a00000000\", \"005151\", 0, 1317038910, \"42f5ba6f5fe1e00e652a08c46715871dc4b40d89d9799fd7c0ea758f86eab6a7\"],\n\t[\"aff5850c0168a67296cc790c1b04a9ed9ad1ba0469263a9432fcb53676d1bb4e0eea8ea1410100000005ac65526a537d5fcb1d01d9c26d0200000000065265ab5153acc0617ca1\", \"51ab650063\", 0, 1712981774, \"8449d5247071325e5f8edcc93cb9666c0fecabb130ce0e5bef050575488477eb\"],\n\t[\"e6d6b9d8042c27aec99af8c12b6c1f7a80453e2252c02515e1f391da185df0874e133696b50300000006ac5165650065ffffffff6a4b60a5bfe7af72b198eaa3cde2e02aa5fa36bdf5f24ebce79f6ecb51f3b554000000000652656aababac2ec4c5a6cebf86866b1fcc4c5bd5f4b19785a8eea2cdfe58851febf87feacf6f355324a80100000001537100145149ac1e287cef62f6f5343579189fad849dd33f25c25bfca841cb696f10c5a34503000000046a636a63df9d7c4c018d96e20100000000015100000000\", \"53ab\", 1, -1924777542, \"f98f95d0c5ec3ac3e699d81f6c440d2e7843eab15393eb023bc5a62835d6dcea\"],\n\t[\"046ac25e030a344116489cc48025659a363da60bc36b3a8784df137a93b9afeab91a04c1ed020000000951ab0000526a65ac51ffffffff6c094a03869fde55b9a8c4942a9906683f0a96e2d3e5a03c73614ea3223b2c29020000000500ab636a6affffffff3da7aa5ecef9071600866267674b54af1740c5aeb88a290c459caa257a2683cb0000000004ab6565ab7e2a1b900301b916030000000005abac63656308f4ed03000000000852ab53ac63ac51ac73d620020000000003ab00008deb1285\", \"6a\", 2, 1299505108, \"f79e6b776e2592bad45ca328c54abf14050c241d8f822d982c36ea890fd45757\"],\n\t[\"bd515acd0130b0ac47c2d87f8d65953ec7d657af8d96af584fc13323d0c182a2e5f9a96573000000000652ac51acac65ffffffff0467aade000000000003655363dc577d050000000006515252ab5300137f60030000000007535163530065004cdc860500000000036a5265241bf53e\", \"acab\", 0, 621090621, \"771d4d87f1591a13d77e51858c16d78f1956712fe09a46ff1abcabbc1e7af711\"],\n\t[\"ff1ae37103397245ac0fa1c115b079fa20930757f5b6623db3579cb7663313c2dc4a3ffdb300000000076353656a000053ffffffff83c59e38e5ad91216ee1a312d15b4267bae2dd2e57d1a3fd5c2f0f809eeb5d46010000000800abab6a6a53ab51ffffffff9d5e706c032c1e0ca75915f8c6686f64ec995ebcd2539508b7dd8abc3e4d7d2a01000000006b2bdcda02a8fe070500000000045253000019e31d04000000000700ab63acab526a00000000\", \"53656aab6a525251\", 0, 881938872, \"726bb88cdf3af2f7603a31f33d2612562306d08972a4412a55dbbc0e3363721c\"],\n\t[\"ff5400dd02fec5beb9a396e1cbedc82bedae09ed44bae60ba9bef2ff375a6858212478844b03000000025253ffffffff01e46c203577a79d1172db715e9cc6316b9cfc59b5e5e4d9199fef201c6f9f0f000000000900ab6552656a5165acffffffff02e8ce62040000000002515312ce3e00000000000251513f119316\", \"\", 0, 1541581667, \"1e0da47eedbbb381b0e0debbb76e128d042e02e65b11125e17fd127305fc65cd\"],\n\t[\"28e3daa603c03626ad91ffd0ff927a126e28d29db5012588b829a06a652ea4a8a5732407030200000004ab6552acffffffff8e643146d3d0568fc2ad854fd7864d43f6f16b84e395db82b739f6f5c84d97b40000000004515165526b01c2dc1469db0198bd884e95d8f29056c48d7e74ff9fd37a9dec53e44b8769a6c99c030200000009ab006a516a53630065eea8738901002398000000000007ac5363516a51abeaef12f5\", \"52ab52515253ab\", 2, 1687390463, \"55591346aec652980885a558cc5fc2e3f8d21cbd09f314a798e5a7ead5113ea6\"],\n\t[\"b54bf5ac043b62e97817abb892892269231b9b220ba08bc8dbc570937cd1ea7cdc13d9676c010000000451ab5365a10adb7b35189e1e8c00b86250f769319668189b7993d6bdac012800f1749150415b2deb0200000003655300ffffffff60b9f4fb9a7e17069fd00416d421f804e2ef2f2c67de4ca04e0241b9f9c1cc5d0200000003ab6aacfffffffff048168461cce1d40601b42fbc5c4f904ace0d35654b7cc1937ccf53fe78505a0100000008526563525265abacffffffff01dbf4e6040000000007acac656553636500000000\", \"63\", 2, 882302077, \"f5b38b0f06e246e47ce622e5ee27d5512c509f8ac0e39651b3389815eff2ab93\"],\n\t[\"ebf628b30360bab3fa4f47ce9e0dcbe9ceaf6675350e638baff0c2c197b2419f8e4fb17e16000000000452516365ac4d909a79be207c6e5fb44fbe348acc42fc7fe7ef1d0baa0e4771a3c4a6efdd7e2c118b0100000003acacacffffffffa6166e9101f03975721a3067f1636cc390d72617be72e5c3c4f73057004ee0ee010000000863636a6a516a5252c1b1e82102d8d54500000000000153324c900400000000015308384913\", \"0063516a51\", 1, -1658428367, \"eb2d8dea38e9175d4d33df41f4087c6fea038a71572e3bad1ea166353bf22184\"],\n\t[\"d6a8500303f1507b1221a91adb6462fb62d741b3052e5e7684ea7cd061a5fc0b0e93549fa50100000004acab65acfffffffffdec79bf7e139c428c7cfd4b35435ae94336367c7b5e1f8e9826fcb0ebaaaea30300000000ffffffffd115fdc00713d52c35ea92805414bd57d1e59d0e6d3b79a77ee18a3228278ada020000000453005151ffffffff040231510300000000085100ac6a6a000063c6041c0400000000080000536a6563acac138a0b04000000000263abd25fbe03000000000900656a00656aac510000000000\", \"ac526aac6a00\", 1, -2007972591, \"13d12a51598b34851e7066cd93ab8c5212d60c6ed2dae09d91672c10ccd7f87c\"],\n\t[\"658cb1c1049564e728291a56fa79987a4ed3146775fce078bd2e875d1a5ca83baf6166a82302000000056a656351ab2170e7d0826cbdb45fda0457ca7689745fd70541e2137bb4f52e7b432dcfe2112807bd720300000007006a0052536351ffffffff8715ca2977696abf86d433d5c920ef26974f50e9f4a20c584fecbb68e530af5101000000009e49d864155bf1d3c757186d29f3388fd89c7f55cc4d9158b4cf74ca27a35a1dd93f945502000000096a535353ac656351510d29fa870230b809040000000006ab6a6a526a633b41da050000000004ab6a6a65ed63bf62\", \"52acabac\", 2, -1774073281, \"53ab197fa7e27b8a3f99ff48305e67081eb90e95d89d7e92d80cee25a03a6689\"],\n\t[\"e92492cc01aec4e62df67ea3bc645e2e3f603645b3c5b353e4ae967b562d23d6e043badecd0100000003acab65ffffffff02c7e5ea040000000002ab52e1e584010000000005536365515195d16047\", \"6551\", 0, -424930556, \"93c34627f526d73f4bea044392d1a99776b4409f7d3d835f23b03c358f5a61c2\"],\n\t[\"02e242db04be2d8ced9179957e98cee395d4767966f71448dd084426844cbc6d15f2182e85030000000200650c8ffce3db9de9c3f9cdb9104c7cb26647a7531ad1ebf7591c259a9c9985503be50f8de30000000007ac6a51636a6353ffffffffa2e33e7ff06fd6469987ddf8a626853dbf30c01719efb259ae768f051f803cd30300000000fffffffffd69d8aead941683ca0b1ee235d09eade960e0b1df3cd99f850afc0af1b73e070300000001ab60bb602a011659670100000000076363526300acac00000000\", \"6353ab515251\", 3, 1451100552, \"bbc9069b8615f3a52ac8a77359098dcc6c1ba88c8372d5d5fe080b99eb781e55\"],\n\t[\"b28d5f5e015a7f24d5f9e7b04a83cd07277d452e898f78b50aae45393dfb87f94a26ef57720200000008ababac630053ac52ffffffff046475ed040000000008ab5100526363ac65c9834a04000000000251abae26b30100000000040000ac65ceefb900000000000000000000\", \"ac6551ac6a536553\", 0, -1756558188, \"5848d93491044d7f21884eef7a244fe7d38886f8ae60df49ce0dfb2a342cd51a\"],\n\t[\"efb8b09801f647553b91922a5874f8e4bb2ed8ddb3536ed2d2ed0698fac5e0e3a298012391030000000952ac005263ac52006affffffff04cdfa0f050000000007ac53ab51abac65b68d1b02000000000553ab65ac00d057d50000000000016a9e1fda010000000007ac63ac536552ac00000000\", \"6aac\", 0, 1947322973, \"603a9b61cd30fcea43ef0a5c18b88ca372690b971b379ee9e01909c336280511\"],\n\t[\"68a59fb901c21946797e7d07a4a3ea86978ce43df0479860d7116ac514ba955460bae78fff0000000001abffffffff03979be80100000000036553639300bc040000000008006552006a656565cfa78d0000000000076552acab63ab5100000000\", \"ab65ab\", 0, 995583673, \"3b320dd47f2702452a49a1288bdc74a19a4b849b132b6cad9a1d945d87dfbb23\"],\n\t[\"67761f2a014a16f3940dcb14a22ba5dc057fcffdcd2cf6150b01d516be00ef55ef7eb07a830100000004636a6a51ffffffff01af67bd050000000008526553526300510000000000\", \"6a00\", 0, 1570943676, \"079fa62e9d9d7654da8b74b065da3154f3e63c315f25751b4d896733a1d67807\"],\n\t[\"e20fe96302496eb436eee98cd5a32e1c49f2a379ceb71ada8a48c5382df7c8cd88bdc47ced03000000016556aa0e180660925a841b457aed0aae47fca2a92fa1d7afeda647abf67198a3902a7c80dd00000000085152ac636a535265bd18335e01803c810100000000046500ac52f371025e\", \"6363ab\", 1, -651254218, \"2921a0e5e3ba83c57ba57c25569380c17986bf34c366ec216d4188d5ba8b0b47\"],\n\t[\"4e1bd9fa011fe7aa14eee8e78f27c9fde5127f99f53d86bc67bdab23ca8901054ee8a8b6eb0300000009ac535153006a6a0063ffffffff044233670500000000000a667205000000000652ab636a51abe5bf35030000000003535351d579e505000000000700630065ab51ac3419ac30\", \"52abac52\", 0, -1807563680, \"4aae6648f856994bed252d319932d78db55da50d32b9008216d5366b44bfdf8a\"],\n\t[\"ec02fbee03120d02fde12574649660c441b40d330439183430c6feb404064d4f507e704f3c0100000000ffffffffe108d99c7a4e5f75cc35c05debb615d52fac6e3240a6964a29c1704d98017fb60200000002ab63fffffffff726ec890038977adfc9dadbeaf5e486d5fcb65dc23acff0dd90b61b8e2773410000000002ac65e9dace55010f881b010000000005ac00ab650000000000\", \"51ac525152ac6552\", 2, -1564046020, \"3f988922d8cd11c7adff1a83ce9499019e5ab5f424752d8d361cf1762e04269b\"],\n\t[\"23dbdcc1039c99bf11938d8e3ccec53b60c6c1d10c8eb6c31197d62c6c4e2af17f52115c3a0300000008636352000063ababffffffff17823880e1df93e63ad98c29bfac12e36efd60254346cac9d3f8ada020afc0620300000003ab63631c26f002ac66e86cd22a25e3ed3cb39d982f47c5118f03253054842daadc88a6c41a2e1500000000096a00ab636a53635163195314de015570fd0100000000096a5263acab5200005300000000\", \"ababac6a6553\", 1, 11586329, \"bd36a50e0e0a4ecbf2709e68daef41eddc1c0c9769efaee57910e99c0a1d1343\"],\n\t[\"33b03bf00222c7ca35c2f8870bbdef2a543b70677e413ce50494ac9b22ea673287b6aa55c50000000005ab00006a52ee4d97b527eb0b427e4514ea4a76c81e68c34900a23838d3e57d0edb5410e62eeb8c92b6000000000553ac6aacac42e59e170326245c000000000009656553536aab516aabb1a10603000000000852ab52ab6a516500cc89c802000000000763ac6a63ac516300000000\", \"\", 0, 557416556, \"41bead1b073e1e9fee065dd612a617ca0689e8f9d3fed9d0acfa97398ebb404c\"],\n\t[\"813eda1103ac8159850b4524ef65e4644e0fc30efe57a5db0c0365a30446d518d9b9aa8fdd0000000003656565c2f1e89448b374b8f12055557927d5b33339c52228f7108228149920e0b77ef0bcd69da60000000006abac00ab63ab82cdb7978d28630c5e1dc630f332c4245581f787936f0b1e84d38d33892141974c75b4750300000004ac53ab65ffffffff0137edfb02000000000000000000\", \"0063\", 1, -1948560575, \"71dfcd2eb7f2e6473aed47b16a6d5fcbd0af22813d892e9765023151e07771ec\"],\n\t[\"9e45d9aa0248c16dbd7f435e8c54ae1ad086de50c7b25795a704f3d8e45e1886386c653fbf01000000025352fb4a1acefdd27747b60d1fb79b96d14fb88770c75e0da941b7803a513e6d4c908c6445c7010000000163ffffffff014069a8010000000001520a794fb3\", \"51ac005363\", 1, -719113284, \"0d31a221c69bd322ef7193dd7359ddfefec9e0a1521d4a8740326d46e44a5d6a\"],\n\t[\"36e42018044652286b19a90e5dd4f8d9f361d0760d080c5c5add1970296ff0f1de630233c8010000000200ac39260c7606017d2246ee14ddb7611586178067e6a4be38e788e33f39a3a95a55a13a6775010000000352ac638bea784f7c2354ed02ea0b93f0240cdfb91796fa77649beee6f7027caa70778b091deee700000000066a65ac656363ffffffff4d9d77ab676d711267ef65363f2d192e1bd55d3cd37f2280a34c72e8b4c559d700000000056a006aab00001764e1020d30220100000000085252516aacab0053472097040000000009635353ab6a636a5100a56407a1\", \"006a536551ab53ab\", 0, 827296034, \"daec2af5622bbe220c762da77bab14dc75e7d28aa1ade9b7f100798f7f0fd97a\"],\n\t[\"5e06159a02762b5f3a5edcdfc91fd88c3bff08b202e69eb5ba74743e9f4291c4059ab008200000000001ac348f5446bb069ef977f89dbe925795d59fb5d98562679bafd61f5f5f3150c3559582992d0000000008ab5165515353abac762fc67703847ec6010000000000e200cf040000000002abaca64b86010000000008520000515363acabb82b491b\", \"ab53525352ab6a\", 0, -61819505, \"75a7db0df41485a28bf6a77a37ca15fa8eccc95b5d6014a731fd8adb9ada0f12\"],\n\t[\"a1948872013b543d6d902ccdeead231c585195214ccf5d39f136023855958436a43266911501000000086aac006a6a6a51514951c9b2038a538a04000000000452526563c0f345050000000007526a5252ac526af9be8e03000000000752acac51ab006306198db2\", \"ab6353\", 0, -326384076, \"ced7ef84aad4097e1eb96310e0d1c8e512cfcb392a01d9010713459b23bc0cf4\"],\n\t[\"c3efabba03cb656f154d1e159aa4a1a4bf9423a50454ebcef07bc3c42a35fb8ad84014864d0000000000d1cc73d260980775650caa272e9103dc6408bdacaddada6b9c67c88ceba6abaa9caa2f7d020000000553536a5265ffffffff9f946e8176d9b11ff854b76efcca0a4c236d29b69fb645ba29d406480427438e01000000066a0065005300ffffffff040419c0010000000003ab6a63cdb5b6010000000009006300ab5352656a63f9fe5e050000000004acac5352611b980100000000086a00acac00006a512d7f0c40\", \"0053\", 0, -59089911, \"c503001c16fbff82a99a18d88fe18720af63656fccd8511bca1c3d0d69bd7fc0\"],\n\t[\"efb55c2e04b21a0c25e0e29f6586be9ef09f2008389e5257ebf2f5251051cdc6a79fce2dac020000000351006affffffffaba73e5b6e6c62048ba5676d18c33ccbcb59866470bb7911ccafb2238cfd493802000000026563ffffffffe62d7cb8658a6eca8a8babeb0f1f4fa535b62f5fc0ec70eb0111174e72bbec5e0300000009abababac516365526affffffffbf568789e681032d3e3be761642f25e46c20322fa80346c1146cb47ac999cf1b0300000000b3dbd55902528828010000000001ab0aac7b0100000000015300000000\", \"acac52\", 3, 1638140535, \"e84444d91580da41c8a7dcf6d32229bb106f1be0c811b2292967ead5a96ce9d4\"],\n\t[\"91d3b21903629209b877b3e1aef09cd59aca6a5a0db9b83e6b3472aceec3bc2109e64ab85a0200000003530065ffffffffca5f92de2f1b7d8478b8261eaf32e5656b9eabbc58dcb2345912e9079a33c4cd010000000700ab65ab00536ad530611da41bbd51a389788c46678a265fe85737b8d317a83a8ff7a839debd18892ae5c80300000007ab6aac65ab51008b86c501038b8a9a05000000000263525b3f7a040000000007ab535353ab00abd4e3ff04000000000665ac51ab65630b7b656f\", \"6551525151516a00\", 2, 499657927, \"ef4bd7622eb7b2bbbbdc48663c1bc90e01d5bde90ff4cb946596f781eb420a0c\"],\n\t[\"5d5c41ad0317aa7e40a513f5141ad5fc6e17d3916eebee4ddb400ddab596175b41a111ead20100000005536a5265acffffffff900ecb5e355c5c9f278c2c6ea15ac1558b041738e4bffe5ae06a9346d66d5b2b00000000080000ab636a65ab6affffffff99f4e08305fa5bd8e38fb9ca18b73f7a33c61ff7b3c68e696b30a04fea87f3ca000000000163d3d1760d019fc13a00000000000000000000\", \"ab53acabab6aac6a52\", 2, 1007461922, \"4012f5ff2f1238a0eb84854074670b4703238ebc15bfcdcd47ffa8498105fcd9\"],\n\t[\"ceecfa6c02b7e3345445b82226b15b7a097563fa7d15f3b0c979232b138124b62c0be007890200000009abac51536a63525253ffffffffbae481ccb4f15d94db5ec0d8854c24c1cc8642bd0c6300ede98a91ca13a4539a0200000001ac50b0813d023110f5020000000006acabac526563e2b0d0040000000009656aac0063516a536300000000\", \"0063526500\", 0, -1862053821, \"e1600e6df8a6160a79ac32aa40bb4644daa88b5f76c0d7d13bf003327223f70c\"],\n\t[\"ae62d5fd0380c4083a26642159f51af24bf55dc69008e6b7769442b6a69a603edd980a33000000000005ab5100ab53ffffffff49d048324d899d4b8ed5e739d604f5806a1104fede4cb9f92cc825a7fa7b4bfe0200000005536a000053ffffffff42e5cea5673c650881d0b4005fa4550fd86de5f21509c4564a379a0b7252ac0e0000000007530000526a53525f26a68a03bfacc3010000000000e2496f000000000009ab5253acac52636563b11cc600000000000700510065526a6a00000000\", \"abab\", 1, -1600104856, \"05cf0ec9c61f1a15f651a0b3c5c221aa543553ce6c804593f43bb5c50bb91ffb\"],\n\t[\"f06f64af04fdcb830464b5efdb3d5ee25869b0744005375481d7b9d7136a0eb8828ad1f0240200000003516563fffffffffd3ba192dabe9c4eb634a1e3079fca4f072ee5ceb4b57deb6ade5527053a92c5000000000165ffffffff39f43401a36ba13a5c6dd7f1190e793933ae32ee3bf3e7bfb967be51e681af760300000009650000536552636a528e34f50b21183952cad945a83d4d56294b55258183e1627d6e8fb3beb8457ec36cadb0630000000005abab530052334a7128014bbfd10100000000085352ab006a63656afc424a7c\", \"53650051635253ac00\", 2, 313255000, \"d309da5afd91b7afa257cfd62df3ca9df036b6a9f4b38f5697d1daa1f587312b\"],\n\t[\"6dfd2f98046b08e7e2ef5fff153e00545faf7076699012993c7a30cb1a50ec528281a9022f030000000152ffffffff1f535e4851920b968e6c437d84d6ecf586984ebddb7d5db6ae035bd02ba222a8010000000651006a53ab51605072acb3e17939fa0737bc3ee43bc393b4acd58451fc4ffeeedc06df9fc649828822d5010000000253525a4955221715f27788d302382112cf60719be9ae159c51f394519bd5f7e70a4f9816c7020200000009526a6a51636aab656a36d3a5ff0445548e0100000000086a6a00516a52655167030b050000000004ac6a63525cfda8030000000000e158200000000000010000000000\", \"535263ac6a65515153\", 3, 585774166, \"72b7da10704c3ca7d1deb60c31b718ee12c70dc9dfb9ae3461edce50789fe2ba\"],\n\t[\"187eafed01389a45e75e9dda526d3acbbd41e6414936b3356473d1f9793d161603efdb45670100000002ab00ffffffff04371c8202000000000563630063523b3bde02000000000753516563006300e9e765010000000005516aac656a373f9805000000000665525352acab08d46763\", \"ab\", 0, 122457992, \"393aa6c758e0eed15fa4af6d9e2d7c63f49057246dbb92b4268ec24fc87301ca\"],\n\t[\"7d50b977035d50411d814d296da9f7965ddc56f3250961ca5ba805cadd0454e7c521e31b0300000000003d0416c2cf115a397bacf615339f0e54f6c35ffec95aa009284d38390bdde1595cc7aa7c0100000005ab52ac5365ffffffff4232c6e796544d5ac848c9dc8d25cfa74e32e847a5fc74c74d8f38ca51188562030000000653ac51006a51ffffffff016bd8bb00000000000465ab5253163526f3\", \"51ab526a00005353\", 1, -1311316785, \"60b7544319b42e4159976c35c32c2644f0adf42eff13be1dc2f726fc0b6bb492\"],\n\t[\"2a45cd1001bf642a2315d4a427eddcc1e2b0209b1c6abd2db81a800c5f1af32812de42032702000000050051525200ffffffff032177db050000000005530051abac49186f000000000004ab6aab00645c0000000000000765655263acabac00000000\", \"6a65\", 0, -1774715722, \"6a9ac3f7da4c7735fbc91f728b52ecbd602233208f96ac5592656074a5db118a\"],\n\t[\"479358c202427f3c8d19e2ea3def6d6d3ef2281b4a93cd76214f0c7d8f040aa042fe19f71f0300000001abffffffffa2709be556cf6ecaa5ef530df9e4d056d0ed57ce96de55a5b1f369fa40d4e74a020000000700006a51635365c426be3f02af578505000000000363ab63fd8f590500000000065153abac53632dfb14b3\", \"520063ab51\", 1, -763226778, \"cfe147982afacde044ce66008cbc5b1e9f0fd9b8ed52b59fc7c0fecf95a39b0e\"],\n\t[\"76179a8e03bec40747ad65ab0f8a21bc0d125b5c3c17ad5565556d5cb03ade7c83b4f32d98030000000151ffffffff99b900504e0c02b97a65e24f3ad8435dfa54e3c368f4e654803b756d011d24150200000003ac5353617a04ac61bb6cf697cfa4726657ba35ed0031432da8c0ffb252a190278830f9bd54f0320100000006656551005153c8e8fc8803677c77020000000007ac6553535253ac70f442030000000001535be0f20200000000026300bf46cb3a\", \"6aab52\", 1, -58495673, \"35e94b3776a6729d20aa2f3ddeeb06d3aad1c14cc4cde52fd21a4efc212ea16c\"],\n\t[\"75ae53c2042f7546223ce5d5f9e00a968ddc68d52e8932ef2013fa40ce4e8c6ed0b6195cde01000000056563ac630079da0452c20697382e3dba6f4fc300da5f52e95a9dca379bb792907db872ba751b8024ee0300000009655151536500005163ffffffffe091b6d43f51ff00eff0ccfbc99b72d3aff208e0f44b44dfa5e1c7322cfc0c5f01000000075200005363ab63ffffffff7e96c3b83443260ac5cfd18258574fbc4225c630d3950df812bf51dceaeb0f9103000000065365655165639a6bf70b01b3e14305000000000563530063ac00000000\", \"6300ab00ac\", 2, 982422189, \"ee4ea49d2aae0dbba05f0b9785172da54408eb1ec67d36759ff7ed25bfc28766\"],\n\t[\"1cdfa01e01e1b8078e9c2b0ca5082249bd18fdb8b629ead659adedf9a0dd5a04031871ba120200000008525351536565ab6affffffff011e28430200000000076a5363636aac52b2febd4a\", \"abacac63656300\", 0, 387396350, \"299dcaac2bdaa627eba0dfd74767ee6c6f27c9200b49da8ff6270b1041669e7e\"],\n\t[\"cc28c1810113dfa6f0fcd9c7d9c9a30fb6f1d774356abeb527a8651f24f4e6b25cf763c4e00300000003ab636affffffff02dfc6050000000000080053636351ab0052afd56903000000000453ab5265f6c90d99\", \"006551abacacac\", 0, 1299280838, \"a4c0773204ab418a939e23f493bd4b3e817375d133d307609e9782f2cc38dbcf\"],\n\t[\"ca816e7802cd43d66b9374cd9bf99a8da09402d69c688d8dcc5283ace8f147e1672b757e020200000005516aabab5240fb06c95c922342279fcd88ba6cd915933e320d7becac03192e0941e0345b79223e89570300000004005151ac353ecb5d0264dfbd010000000005ac6aacababd5d70001000000000752ac53ac6a5151ec257f71\", \"63ac\", 1, 774695685, \"cc180c4f797c16a639962e7aec58ec4b209853d842010e4d090895b22e7a7863\"],\n\t[\"b42b955303942fedd7dc77bbd9040aa0de858afa100f399d63c7f167b7986d6c2377f66a7403000000066aac00525100ffffffff0577d04b64880425a3174055f94191031ad6b4ca6f34f6da9be7c3411d8b51fc000000000300526a6391e1cf0f22e45ef1c44298523b516b3e1249df153590f592fcb5c5fc432dc66f3b57cb03000000046a6aac65ffffffff0393a6c9000000000004516a65aca674ac0400000000046a525352c82c370000000000030053538e577f89\", \"\", 1, -1237094944, \"566953eb806d40a9fb684d46c1bf8c69dea86273424d562bd407b9461c8509af\"],\n\t[\"92c9fe210201e781b72554a0ed5e22507fb02434ddbaa69aff6e74ea8bad656071f1923f3f02000000056a63ac6a514470cef985ba83dcb8eee2044807bedbf0d983ae21286421506ae276142359c8c6a34d68020000000863ac63525265006aa796dd0102ca3f9d05000000000800abab52ab535353cd5c83010000000007ac00525252005322ac75ee\", \"5165\", 0, 97879971, \"6e6307cef4f3a9b386f751a6f40acebab12a0e7e17171d2989293cbec7fd45c2\"],\n\t[\"ccca1d5b01e40fe2c6b3ee24c660252134601dab785b8f55bd6201ffaf2fddc7b3e2192325030000000365535100496d4703b4b66603000000000665535253ac633013240000000000015212d2a502000000000951abac636353636a5337b82426\", \"0052\", 0, -1691630172, \"577bf2b3520b40aef44899a20d37833f1cded6b167e4d648fc5abe203e43b649\"],\n\t[\"bc1a7a3c01691e2d0c4266136f12e391422f93655c71831d90935fbda7e840e50770c61da20000000008635253abac516353ffffffff031f32aa020000000003636563786dbc0200000000003e950f00000000000563516a655184b8a1de\", \"51536a\", 0, -1627072905, \"730bc25699b46703d7718fd5f5c34c4b5f00f594a9968ddc247fa7d5175124ed\"],\n\t[\"076d209e02d904a6c40713c7225d23e7c25d4133c3c3477828f98c7d6dbd68744023dbb66b030000000753ab00536565acffffffff10975f1b8db8861ca94c8cc7c7cff086ddcd83e10b5fffd4fc8f2bdb03f9463c0100000000ffffffff029dff76010000000006526365530051a3be6004000000000000000000\", \"515253ac65acacac\", 1, -1207502445, \"66c488603b2bc53f0d22994a1f0f66fb2958203102eba30fe1d37b27a55de7a5\"],\n\t[\"690fd1f80476db1f9eebe91317f2f130a60cbc1f4feadd9d6474d438e9cb7f91e4994600af0300000004ab536a63a15ce9fa6622d0c4171d895b42bff884dc6e8a7452f827fdc68a29c3c88e6fdee364eaf50000000002ab52ffffffff022dc39d3c0956b24d7f410b1e387859e7a72955f45d6ffb1e884d77888d18fe0300000005ac6a63656afffffffff10b06bce1800f5c49153d24748fdefb0bf514c12863247d1042d56018c3e25c03000000086a63ac6365536a52ffffffff031f162f0500000000060000655265abffbcd40500000000045151ac001a9c8c05000000000652ac53656a6300000000\", \"ac51ab63acac\", 0, -67986012, \"051c0df7ac688c2c930808dabde1f50300aea115f2bb3334f4753d5169b51e46\"],\n\t[\"49ac2af00216c0307a29e83aa5de19770e6b20845de329290bd69cf0e0db7aed61ae41b39002000000035163ac8b2558ef84635bfc59635150e90b61fc753d34acfd10d97531043053e229cd720133cd95000000000463516a51ffffffff02458471040000000008abab636a51ac0065545aa80000000000096a6553516a5263ac6a00000000\", \"51526300ab5363\", 1, 1449668540, \"ddfd902bba312a06197810da96a0ddccb595f96670b28ded7dba88d8cd0469b8\"],\n\t[\"fa4d868b024b010bd5dce46576c2fb489aa60bb797dac3c72a4836f49812c5c564c258414f03000000007a9b3a585e05027bdd89edbadf3c85ac61f8c3a04c773fa746517ae600ff1a9d6b6c02fb0200000004515163abffffffff01b17d020500000000046a65520000000000\", \"536565ab65635363\", 0, -1718953372, \"96c2b32f0a00a5925db7ba72d0b5d39922f30ea0f7443b22bc1b734808513c47\"],\n\t[\"cac6382d0462375e83b67c7a86c922b569a7473bfced67f17afd96c3cd2d896cf113febf9e0300000003006a53ffffffffaa4913b7eae6821487dd3ca43a514e94dcbbf350f8cc4cafff9c1a88720711b800000000096a6a525300acac6353ffffffff184fc4109c34ea27014cc2c1536ef7ed1821951797a7141ddacdd6e429fae6ff01000000055251655200ffffffff9e7b79b4e6836e290d7b489ead931cba65d1030ccc06f20bd4ca46a40195b33c030000000008f6bc8304a09a2704000000000563655353511dbc73050000000000cf34c500000000000091f76e0000000000085200ab00005100abd07208cb\", \"0063656a\", 2, -1488731031, \"bf078519fa87b79f40abc38f1831731422722c59f88d86775535f209cb41b9b1\"],\n\t[\"1711146502c1a0b82eaa7893976fefe0fb758c3f0e560447cef6e1bde11e42de91a125f71c030000000015bd8c04703b4030496c7461482481f290c623be3e76ad23d57a955807c9e851aaaa20270300000000d04abaf20326dcb7030000000001632225350400000000075263ac00520063dddad9020000000000af23d148\", \"52520053510063\", 0, 1852122830, \"e33d5ee08c0f3c130a44d7ce29606450271b676f4a80c52ab9ffab00cecf67f8\"],\n\t[\"8d5b124d0231fbfc640c706ddb1d57bb49a18ba8ca0e1101e32c7e6e65a0d4c7971d93ea360100000008acabac0000abac65ffffffff8fe0fd7696597b845c079c3e7b87d4a44110c445a330d70342a5501955e17dd70100000004ab525363ef22e8a90346629f030000000009516a00ac63acac51657bd57b05000000000200acfd4288050000000009acab5352ab00ab636300000000\", \"53ac526553ab65\", 0, 1253152975, \"8b57a7c3170c6c02dd14ae1d392ce3d828197b20e9145c89c1cfd5de050e1562\"],\n\t[\"38146dc502c7430e92b6708e9e107b61cd38e5e773d9395e5c8ad8986e7e4c03ee1c1e1e760100000000c8962ce2ac1bb3b1285c0b9ba07f4d2e5ce87c738c42ac0548cd8cec1100e6928cd6b0b6010000000763ab636aab52527cccefbd04e5f6f8020000000006006aabacac65ab2c4a00000000000351635209a6f40100000000026aacce57dc040000000008ab5353ab516a516a00000000\", \"ab\", 0, -1205978252, \"3cb5b030e7da0b60ccce5b4a7f3793e6ca56f03e3799fe2d6c3cc22d6d841dcb\"],\n\t[\"22d81c740469695a6a83a9a4824f77ecff8804d020df23713990afce2b72591ed7de98500502000000065352526a6a6affffffff90dc85e118379b1005d7bbc7d2b8b0bab104dad7eaa49ff5bead892f17d8c3ba010000000665656300ab51ffffffff965193879e1d5628b52005d8560a35a2ba57a7f19201a4045b7cbab85133311d0200000003ac005348af21a13f9b4e0ad90ed20bf84e4740c8a9d7129632590349afc03799414b76fd6e826200000000025353ffffffff04a0d40d04000000000060702700000000000652655151516ad31f1502000000000365ac0069a1ac0500000000095100655300ab53525100000000\", \"51636a52ac\", 0, -1644680765, \"add7f5da27262f13da6a1e2cc2feafdc809bd66a67fb8ae2a6f5e6be95373b6f\"],\n\t[\"a27dcbc801e3475174a183586082e0914c314bc9d79d1570f29b54591e5e0dff07fbb45a7f0000000004ac53ab51ffffffff027347f5020000000005535351ab63d0e5c9030000000009ac65ab6a63515200ab7cd632ed\", \"ac63636553\", 0, -686435306, \"883a6ea3b2cc53fe8a803c229106366ca14d25ffbab9fef8367340f65b201da6\"],\n\t[\"b123ed2204410d4e8aaaa8cdb95234ca86dad9ff77fb4ae0fd4c06ebed36794f0215ede0040100000002ac63ffffffff3b58b81b19b90d8f402701389b238c3a84ff9ba9aeea298bbf15b41a6766d27a01000000056a6553ab00151824d401786153b819831fb15926ff1944ea7b03d884935a8bde01ed069d5fd80220310200000000ffffffffa9c9d246f1eb8b7b382a9032b55567e9a93f86c77f4e32c092aa1738f7f756c30100000002ab65ffffffff011a2b48000000000000ed44d1fb\", \"630051ab63\", 2, -1118263883, \"b5dab912bcabedff5f63f6dd395fc2cf030d83eb4dd28214baba68a45b4bfff0\"],\n\t[\"1339051503e196f730955c5a39acd6ed28dec89b4dadc3f7c79b203b344511270e5747fa9900000000045151636affffffff378c6090e08a3895cedf1d25453bbe955a274657172491fd2887ed5c9aceca7b0100000000ffffffffcf7cc3c36ddf9d4749edfa9cefed496d2f86e870deb814bfcd3b5637a5496461030000000451006300ffffffff04dcf3fa010000000008526a63005263acabb41d84040000000004abac5153800eff020000000005656a535365106c5e00000000000000000000\", \"abac5300\", 2, 2013719928, \"7fc74de39ce6ca46ca25d760d3cec7bb21fd14f7efe1c443b5aa294f2cb5f546\"],\n\t[\"0728c606014c1fd6005ccf878196ba71a54e86cc8c53d6db500c3cc0ac369a26fac6fcbc210000000005ab53ac5365ba9668290182d7870100000000066a000053655100000000\", \"65\", 0, 1789961588, \"ab6baa6da3b2bc853868d166f8996ad31d63ef981179f9104f49968fd61c8427\"],\n\t[\"a1134397034bf4067b6c81c581e2b73fb63835a08819ba24e4e92df73074bf773c94577df7000000000465525251ffffffff8b6608feaa3c1f35f49c6330a769716fa01c5c6f6e0cdc2eb10dfc99bbc21e77010000000952656aac005352655180a0bda4bc72002c2ea8262e26e03391536ec36867258cab968a6fd6ec7523b64fa1d8c001000000056a53ac6353ffffffff04dbeeed05000000000553650052abcd5d0e01000000000463abab51104b2e0500000000066aac53ac5165283ca7010000000004535252ab00000000\", \"ab515151516552ab\", 1, -324598676, \"91178482112f94d1c8e929de443e4b9c893e18682998d393ca9ca77950412586\"],\n\t[\"bcdafbae04aa18eb75855aeb1f5124f30044741351b33794254a80070940cb10552fa4fa8e0300000001acd0423fe6e3f3f88ae606f2e8cfab7a5ef87caa2a8f0401765ff9a47d718afcfb40c0099b0000000008ac6565ab53ac6aac645308009d680202d600e492b31ee0ab77c7c5883ebad5065f1ce87e4dfe6453e54023a0010000000151ffffffffb9d818b14245899e1d440152827c95268a676f14c3389fc47f5a11a7b38b1bde03000000026300ffffffff03cda22102000000000751ac535263005100a4d20400000000045200536ac8bef405000000000700ab51ab6563ac00000000\", \"6553516a526aab\", 1, -2111409753, \"5e1849e7368cf4f042718586d9bd831d61479b775bab97aba9f450042bd9876a\"],\n\t[\"ed3bb93802ddbd08cb030ef60a2247f715a0226de390c9c1a81d52e83f8674879065b5f87d0300000003ab6552ffffffff04d2c5e60a21fb6da8de20bf206db43b720e2a24ce26779bca25584c3f765d1e0200000008ab656a6aacab00ab6e946ded025a811d04000000000951abac6352ac00ab5143cfa3030000000005635200636a00000000\", \"5352ac650065535300\", 1, -668727133, \"e9995065e1fddef72a796eef5274de62012249660dc9d233a4f24e02a2979c87\"],\n\t[\"59f4629d030fa5d115c33e8d55a79ea3cba8c209821f979ed0e285299a9c72a73c5bba00150200000002636affffffffd8aca2176df3f7a96d0dc4ee3d24e6cecde1582323eec2ebef9a11f8162f17ac0000000007ab6565acab6553ffffffffeebc10af4f99c7a21cbc1d1074bd9f0ee032482a71800f44f26ee67491208e0403000000065352ac656351ffffffff0434e955040000000004ab515152caf2b305000000000365ac007b1473030000000003ab530033da970500000000060051536a5253bb08ab51\", \"\", 2, 396340944, \"0e9c47973ef2c292b2252c623f465bbb92046fe0b893eebf4e1c9e02cb01c397\"],\n\t[\"286e3eb7043902bae5173ac3b39b44c5950bc363f474386a50b98c7bdab26f98dc83449c4a020000000752ac6a00510051ffffffff4339cd6a07f5a5a2cb5815e5845da70300f5c7833788363bf7fe67595d3225520100000000fffffffff9c2dd8b06ad910365ffdee1a966f124378a2b8021065c8764f6138bb1e951380200000005ab5153ac6affffffff0370202aba7a68df85436ea7c945139513384ef391fa33d16020420b8ad40e9a000000000900ab5165526353abacffffffff020c1907000000000004abac526a1b490b040000000000df1528f7\", \"5353ab\", 3, -1407529517, \"32154c09174a9906183abf26538c39e78468344ca0848bbd0785e24a3565d932\"],\n\t[\"2e245cf80179e2e95cd1b34995c2aff49fe4519cd7cee93ad7587f7f7e8105fc2dff206cd30200000009006a63516a6553ab52350435a201d5ed2d02000000000352ab6558552c89\", \"00ab53\", 0, -233917810, \"4605ae5fd3d50f9c45d37db7118a81a9ef6eb475d2333f59df5d3e216f150d49\"],\n\t[\"33a98004029d262f951881b20a8d746c8c707ea802cd2c8b02a33b7e907c58699f97e42be80100000007ac53536552abacdee04cc01d205fd8a3687fdf265b064d42ab38046d76c736aad8865ca210824b7c622ecf02000000070065006a536a6affffffff01431c5d010000000000270d48ee\", \"\", 1, 921554116, \"ff9d7394002f3f196ea25472ea6c46f753bd879a7244795157bb7235c9322902\"],\n\t[\"aac18f2b02b144ed481557c53f2146ae523f24fcde40f3445ab0193b6b276c315dc2894d2300000000075165650000636a233526947dbffc76aec7db1e1baa6868ad4799c76e14794dcbaaec9e713a83967f6a65170200000005abac6551ab27d518be01b652a30000000000015300000000\", \"52ac5353\", 1, 1559377136, \"59fc2959bb7bb24576cc8a237961ed95bbb900679d94da6567734c4390cb6ef5\"],\n\t[\"5ab79881033555b65fe58c928883f70ce7057426fbdd5c67d7260da0fe8b1b9e6a2674cb850300000009ac516aac6aac006a6affffffffa5be9223b43c2b1a4d120b5c5b6ec0484f637952a3252181d0f8e813e76e11580200000000e4b5ceb8118cb77215bbeedc9a076a4d087bb9cd1473ea32368b71daeeeacc451ec209010000000005acac5153aced7dc34e02bc5d11030000000005ac5363006a54185803000000000552ab00636a00000000\", \"5100\", 1, 1927062711, \"e9f53d531c12cce1c50abed4ac521a372b4449b6a12f9327c80020df6bff66c0\"],\n\t[\"6c2c8fac0124b0b7d4b610c3c5b91dee32b7c927ac71abdf2d008990ca1ac40de0dfd530660300000006ababac5253656bd7eada01d847ec000000000004ac52006af4232ec8\", \"6a6a6a0051\", 0, -340809707, \"fb51eb9d7e47d32ff2086205214f90c7c139e08c257a64829ae4d2b301071c6a\"],\n\t[\"6e3880af031735a0059c0bb5180574a7dcc88e522c8b56746d130f8d45a52184045f96793e0100000008acabac6a526a6553fffffffffe05f14cdef7d12a9169ec0fd37524b5fcd3295f73f48ca35a36e671da4a2f560000000008006a526a6351ab63ffffffffdfbd869ac9e472640a84caf28bdd82e8c6797f42d03b99817a705a24fde2736600000000010090a090a503db956b04000000000952ac53ab6a536a63ab358390010000000009656a5200525153ac65353ee204000000000763530052526aaba6ad83fb\", \"535151ab6300\", 2, 222014018, \"57a34ddeb1bf36d28c7294dda0432e9228a9c9e5cc5c692db98b6ed2e218d825\"],\n\t[\"8df1cd19027db4240718dcaf70cdee33b26ea3dece49ae6917331a028c85c5a1fb7ee3e475020000000865ab6a00510063636157988bc84d8d55a8ba93cdea001b9bf9d0fa65b5db42be6084b5b1e1556f3602f65d4d0100000005ac00ab0052206c852902b2fb54030000000008ac5252536aacac5378c4a5050000000007acabac535163532784439e\", \"acab6a\", 0, 1105620132, \"edb7c74223d1f10f9b3b9c1db8064bc487321ff7bb346f287c6bc2fad83682de\"],\n\t[\"0e803682024f79337b25c98f276d412bc27e56a300aa422c42994004790cee213008ff1b8303000000080051ac65ac655165f421a331892b19a44c9f88413d057fea03c3c4a6c7de4911fe6fe79cf2e9b3b10184b1910200000005525163630096cb1c670398277204000000000253acf7d5d502000000000963536a6a636a5363ab381092020000000002ac6a911ccf32\", \"6565\", 1, -1492094009, \"f0672638a0e568a919e9d8a9cbd7c0189a3e132940beeb52f111a89dcc2daa2c\"],\n\t[\"7d71669d03022f9dd90edac323cde9e56354c6804c6b8e687e9ae699f46805aafb8bcaa636000000000253abffffffff698a5fdd3d7f2b8b000c68333e4dd58fa8045b3e2f689b889beeb3156cecdb490300000009525353abab0051acabc53f0aa821cdd69b473ec6e6cf45cf9b38996e1c8f52c27878a01ec8bb02e8cb31ad24e500000000055353ab0052ffffffff0447a23401000000000565ab53ab5133aaa0030000000006515163656563057d110300000000056a6aacac52cf13b5000000000003526a5100000000\", \"6a6a51\", 1, -1349253507, \"722efdd69a7d51d3d77bed0ac5544502da67e475ea5857cd5af6bdf640a69945\"],\n\t[\"9ff618e60136f8e6bb7eabaaac7d6e2535f5fba95854be6d2726f986eaa9537cb283c701ff02000000026a65ffffffff012d1c0905000000000865ab00ac6a516a652f9ad240\", \"51515253635351ac\", 0, 1571304387, \"659cd3203095d4a8672646add7d77831a1926fc5b66128801979939383695a79\"],\n\t[\"9fbd43ac025e1462ecd10b1a9182a8e0c542f6d1089322a41822ab94361e214ed7e1dfdd8a020000000263519d0437581538e8e0b6aea765beff5b4f3a4a202fca6e5d19b34c141078c6688f71ba5b8e0100000003ac6552ffffffff02077774050000000009655153655263acab6a0ae4e10100000000035152524c97136b\", \"635152ab\", 0, 1969622955, \"d82d4ccd9b67810f26a378ad9592eb7a30935cbbd27e859b00981aefd0a72e08\"],\n\t[\"0117c92004314b84ed228fc11e2999e657f953b6de3b233331b5f0d0cf40d5cc149b93c7b30300000005515263516a083e8af1bd540e54bf5b309d36ba80ed361d77bbf4a1805c7aa73667ad9df4f97e2da410020000000600ab6351ab524d04f2179455e794b2fcb3d214670001c885f0802e4b5e015ed13a917514a7618f5f332203000000086a536aab51000063ecf029e65a4a009a5d67796c9f1eb358b0d4bd2620c8ad7330fb98f5a802ab92d0038b1002000000036a6551a184a88804b04490000000000009ab6a5152535165526a33d1ab020000000001518e92320000000000002913df04000000000952abac6353525353ac8b19bfdf\", \"000051ab0000\", 0, 489433059, \"8eebac87e60da524bbccaf285a44043e2c9232868dda6c6271a53c153e7f3a55\"],\n\t[\"e7f5482903f98f0299e0984b361efb2fddcd9979869102281e705d3001a9d283fe9f3f3a1e02000000025365ffffffffcc5c7fe82feebad32a22715fc30bc584efc9cd9cadd57e5bc4b6a265547e676e0000000001ab579d21235bc2281e08bf5e7f8f64d3afb552839b9aa5c77cf762ba2366fffd7ebb74e49400000000055263ab63633df82cf40100982e05000000000453ac535300000000\", \"acacab\", 2, -1362931214, \"046de666545330e50d53083eb78c9336416902f9b96c77cc8d8e543da6dfc7e4\"],\n\t[\"09adb2e90175ca0e816326ae2dce7750c1b27941b16f6278023dbc294632ab97977852a09d030000000465ab006affffffff027739cf0100000000075151ab63ac65ab8a5bb601000000000653ac5151520011313cdc\", \"ac\", 0, -76831756, \"478ee06501b4965b40bdba6cbaad9b779b38555a970912bb791b86b7191c54bc\"],\n\t[\"f973867602e30f857855cd0364b5bbb894c049f44abbfd661d7ae5dbfeaafca89fac8959c20100000005ab52536a51ffffffffbeceb68a4715f99ba50e131884d8d20f4a179313691150adf0ebf29d05f8770303000000066352ab00ac63ffffffff021fddb90000000000036a656322a177000000000008526500ac5100acac84839083\", \"52acab53ac\", 0, 1407879325, \"db0329439490efc64b7104d6d009b03fbc6fac597cf54fd786fbbb5fd73b92b4\"],\n\t[\"fd22ebaa03bd588ad16795bea7d4aa7f7d48df163d75ea3afebe7017ce2f350f6a0c1cb0bb00000000086aabac5153526363ffffffff488e0bb22e26a565d77ba07178d17d8f85702630ee665ec35d152fa05af3bda10200000004515163abffffffffeb21035849e85ad84b2805e1069a91bb36c425dc9c212d9bae50a95b6bfde1200300000001ab5df262fd02b69848040000000008ab6363636a6363ace23bf2010000000007655263635253534348c1da\", \"006353526563516a00\", 0, -1491036196, \"92364ba3c7a85d4e88885b8cb9b520dd81fc29e9d2b750d0790690e9c1246673\"],\n\t[\"130b462d01dd49fac019dc4442d0fb54eaa6b1c2d1ad0197590b7df26969a67abd7f3fbb4f0100000008ac65abac53ab6563ffffffff0345f825000000000004ac53acac9d5816020000000002ababeff8e90500000000086aab006552ac6a53a892dc55\", \"ab0065ac530052\", 0, 944483412, \"1f4209fd4ce7f13d175fdd522474ae9b34776fe11a5f17a27d0796c77a2a7a9d\"],\n\t[\"f8e50c2604609be2a95f6d0f31553081f4e1a49a0a30777fe51eb1c596c1a9a92c053cf28c0300000009656a51ac5252630052fffffffff792ed0132ae2bd2f11d4a2aab9d0c4fbdf9a66d9ae2dc4108afccdc14d2b1700100000007ab6a6563ac636a7bfb2fa116122b539dd6a2ab089f88f3bc5923e5050c8262c112ff9ce0a3cd51c6e3e84f02000000066551ac5352650d5e687ddf4cc9a497087cabecf74d236aa4fc3081c3f67b6d323cba795e10e7a171b725000000000852635351ab635100ffffffff02df5409020000000008ac6a53acab5151004156990200000000045163655200000000\", \"ac53abac65005300\", 0, -173065000, \"b596f206d7eba22b7e2d1b7a4f4cf69c7c541b6c84dcc943f84e19a99a923310\"],\n\t[\"18020dd1017f149eec65b2ec23300d8df0a7dd64fc8558b36907723c03cd1ba672bbb0f51d0300000005ab65ab6a63ffffffff037cd7ae000000000009ab516a65005352ac65f1e4360400000000056353530053f118f0040000000009536363ab006500abac00000000\", \"63ab51acab52ac\", 0, -550412404, \"e19b796c14a0373674968e342f2741d8b51092a5f8409e9bff7dcd52e56fcbcb\"],\n\t[\"b04154610363fdade55ceb6942d5e5a723323863b48a0cb04fdcf56210717955763f56b08d0300000009ac526a525151635151ffffffff93a176e76151a9eabdd7af00ef2af72f9e7af5ecb0aa4d45d00618f394cdd03c030000000074d818b332ebe05dc24c44d776cf9d275c61f471cc01efce12fd5a16464157f1842c65cb00000000066a0000ac6352d3c4134f01d8a1c0030000000005520000005200000000\", \"5200656a656351\", 2, -9757957, \"6e3e5ba77f760b6b5b5557b13043f1262418f3dd2ce7f0298b012811fc8ad5bc\"],\n\t[\"9794b3ce033df7b1e32db62d2f0906b589eacdacf5743963dc2255b6b9a6cba211fadd0d41020000000600ab00650065ffffffffaae00687a6a4131152bbcaafedfaed461c86754b0bde39e2bef720e6d1860a0302000000070065516aac6552ffffffff50e4ef784d6230df7486e972e8918d919f005025bc2d9aacba130f58bed7056703000000075265ab52656a52ffffffff02c6f1a9000000000006005251006363cf450c040000000008abab63510053abac00000000\", \"ac0063ababab515353\", 1, 2063905082, \"fad092fc98f17c2c20e10ba9a8eb44cc2bcc964b006f4da45cb9ceb249c69698\"],\n\t[\"94533db7015e70e8df715066efa69dbb9c3a42ff733367c18c22ff070392f988f3b93920820000000006535363636300ce4dac3e03169af80300000000080065ac6a53ac65ac39c050020000000006abacab6aacac708a02050000000005ac5251520000000000\", \"6553\", 0, -360458507, \"5418cf059b5f15774836edd93571e0eed3855ba67b2b08c99dccab69dc87d3e9\"],\n\t[\"c8597ada04f59836f06c224a2640b79f3a8a7b41ef3efa2602592ddda38e7597da6c639fee0300000009005251635351acabacffffffff4c518f347ee694884b9d4072c9e916b1a1f0a7fc74a1c90c63fdf8e5a185b6ae02000000007113af55afb41af7518ea6146786c7c726641c68c8829a52925e8d4afd07d8945f68e7230300000008ab00ab65ab650063ffffffffc28e46d7598312c420e11dfaae12add68b4d85adb182ae5b28f8340185394b63000000000165ffffffff04dbabb7010000000000ee2f6000000000000852ab6500ab6a51acb62a27000000000009ac53515300ac006a6345fb7505000000000752516a0051636a00000000\", \"\", 3, 15199787, \"0d66003aff5bf78cf492ecbc8fd40c92891acd58d0a271be9062e035897f317e\"],\n\t[\"1a28c4f702c8efaad96d879b38ec65c5283b5c084b819ad7db1c086e85e32446c7818dc7a90300000008656351536a525165fa78cef86c982f1aac9c5eb8b707aee8366f74574c8f42ef240599c955ef4401cf578be30200000002ab518893292204c430eb0100000000016503138a0300000000040053abac60e0eb010000000005525200ab63567c2d030000000004abab52006cf81e85\", \"ab51525152\", 1, 2118315905, \"4e4c9a781f626b59b1d3ad8f2c488eb6dee8bb19b9bc138bf0dc33e7799210d4\"],\n\t[\"c6c7a87003f772bcae9f3a0ac5e499000b68703e1804b9ddc3e73099663564d53ddc4e1c6e01000000076a536a6aac63636e3102122f4c30056ef8711a6bf11f641ddfa6984c25ac38c3b3e286e74e839198a80a34010000000165867195cd425821dfa2f279cb1390029834c06f018b1e6af73823c867bf3a0524d1d6923b0300000005acab53ab65ffffffff02fa4c49010000000008ab656a0052650053e001100400000000008836d972\", \"ac526351acab\", 1, 978122815, \"a869c18a0edf563d6e5eddd5d5ae8686f41d07f394f95c9feb8b7e52761531ca\"],\n\t[\"0ea580ac04c9495ab6af3b8d59108bb4194fcb9af90b3511c83f7bb046d87aedbf8423218e02000000085152acac006363ab9063d7dc25704e0caa5edde1c6f2dd137ded379ff597e055b2977b9c559b07a7134fcef2000000000200aca89e50181f86e9854ae3b453f239e2847cf67300fff802707c8e3867ae421df69274449402000000056365abababffffffff47a4760c881a4d7e51c69b69977707bd2fb3bcdc300f0efc61f5840e1ac72cee0000000000ffffffff0460179a020000000004ab53ab52a5250c0500000000096565acac6365ab52ab6c281e02000000000952635100ac006563654e55070400000000046552526500000000\", \"ab526563acac53ab\", 2, 1426964167, \"b1c50d58b753e8f6c7513752158e9802cf0a729ebe432b99acc0fe5d9b4e9980\"],\n\t[\"c33028b301d5093e1e8397270d75a0b009b2a6509a01861061ab022ca122a6ba935b8513320200000000ffffffff013bcf5a0500000000015200000000\", \"\", 0, -513413204, \"6b1459536f51482f5dbf42d7e561896557461e1e3b6bf67871e2b51faae2832c\"],\n\t[\"43b2727901a7dd06dd2abf690a1ccedc0b0739cb551200796669d9a25f24f71d8d101379f50300000000ffffffff0418e031040000000000863d770000000000085352ac526563ac5174929e040000000004ac65ac00ec31ac0100000000066a51ababab5300000000\", \"65\", 0, -492874289, \"154ff7a9f0875edcfb9f8657a0b98dd9600fabee3c43eb88af37cf99286d516c\"],\n\t[\"4763ed4401c3e6ab204bed280528e84d5288f9cac5fb8a2e7bd699c7b98d4df4ac0c40e55303000000066a6aacab5165ffffffff015b57f80400000000046a63535100000000\", \"ac51abab53\", 0, -592611747, \"849033a2321b5755e56ef4527ae6f51e30e3bca50149d5707368479723d744f8\"],\n\t[\"d24f647b02f71708a880e6819a1dc929c1a50b16447e158f8ff62f9ccd644e0ca3c592593702000000050053536a00ffffffff67868cd5414b6ca792030b18d649de5450a456407242b296d936bcf3db79e07b02000000005af6319c016022f50100000000036a516300000000\", \"6aab526353516a6a\", 0, 1350782301, \"8556fe52d1d0782361dc28baaf8774b13f3ce5ed486ae0f124b665111e08e3e3\"],\n\t[\"fe6ddf3a02657e42a7496ef170b4a8caf245b925b91c7840fd28e4a22c03cb459cb498b8d603000000065263656a650071ce6bf8d905106f9f1faf6488164f3decac65bf3c5afe1dcee20e6bc3cb6d052561985a030000000163295b117601343dbb0000000000026563dba521df\", \"\", 1, -1696179931, \"d9684685c99ce48f398fb467a91a1a59629a850c429046fb3071f1fa9a5fe816\"],\n\t[\"c61523ef0129bb3952533cbf22ed797fa2088f307837dd0be1849f20decf709cf98c6f032f03000000026563c0f1d378044338310400000000066363516a5165a14fcb0400000000095163536a6a00ab53657271d60200000000001d953f0500000000010000000000\", \"53516353005153\", 0, 1141615707, \"7e975a72db5adaa3c48d525d9c28ac11cf116d0f8b16ce08f735ad75a80aec66\"],\n\t[\"ba3dac6c0182562b0a26d475fe1e36315f0913b6869bdad0ecf21f1339a5fcbccd32056c840200000000ffffffff04300351050000000000220ed405000000000851abac636565ac53dbbd19020000000007636363ac6a52acbb005a0500000000016abd0c78a8\", \"63006a635151005352\", 0, 1359658828, \"47bc8ab070273e1f4a0789c37b45569a6e16f3f3092d1ce94dddc3c34a28f9f4\"],\n\t[\"ac27e7f5025fc877d1d99f7fc18dd4cadbafa50e34e1676748cc89c202f93abf36ed46362101000000036300abffffffff958cd5381962b765e14d87fc9524d751e4752dd66471f973ed38b9d562e525620100000003006500ffffffff02b67120050000000004ac51516adc330c0300000000015200000000\", \"656352\", 1, 15049991, \"f3374253d64ac264055bdbcc32e27426416bd595b7c7915936c70f839e504010\"],\n\t[\"edb30140029182b80c8c3255b888f7c7f061c4174d1db45879dca98c9aab8c8fed647a6ffc03000000086a53510052ab6300ffffffff82f65f261db62d517362c886c429c8fbbea250bcaad93356be6f86ba573e9d930100000000ffffffff04daaf150400000000016a86d1300100000000096a6353535252ac5165d4ddaf000000000002abab5f1c6201000000000000000000\", \"ab6a6a00ac\", 0, -2058017816, \"8d7794703dad18e2e40d83f3e65269834bb293e2d2b8525932d6921884b8f368\"],\n\t[\"7e50207303146d1f7ad62843ae8017737a698498d4b9118c7a89bb02e8370307fa4fada41d000000000753006300005152b7afefc85674b1104ba33ef2bf37c6ed26316badbc0b4aa6cb8b00722da4f82ff3555a6c020000000900ac656363ac51ac52ffffffff93fab89973bd322c5d7ad7e2b929315453e5f7ada3072a36d8e33ca8bebee6e0020000000300acab930da52b04384b04000000000004650052ac435e380200000000076a6a515263ab6aa9494705000000000600ab6a525252af8ba90100000000096565acab526353536a279b17ad\", \"acac005263536aac63\", 1, -34754133, \"4e6357da0057fb7ff79da2cc0f20c5df27ff8b2f8af4c1709e6530459f7972b0\"],\n\t[\"c05764f40244fb4ebe4c54f2c5298c7c798aa90e62c29709acca0b4c2c6ec08430b26167440100000008acab6a6565005253ffffffffc02c2418f398318e7f34a3cf669d034eef2111ea95b9f0978b01493293293a870100000000e563e2e00238ee8d040000000002acab03fb060200000000076500ac656a516aa37f5534\", \"52ab6a0065\", 1, -2033176648, \"83deef4a698b62a79d4877dd9afebc3011a5275dbe06e89567e9ef84e8a4ee19\"],\n\t[\"5a59e0b9040654a3596d6dab8146462363cd6549898c26e2476b1f6ae42915f73fd9aedfda00000000036363abffffffff9ac9e9ca90be0187be2214251ff08ba118e6bf5e2fd1ba55229d24e50a510d53010000000165ffffffff41d42d799ac4104644969937522873c0834cc2fcdab7cdbecd84d213c0e96fd60000000000ffffffffd838db2c1a4f30e2eaa7876ef778470f8729fcf258ad228b388df2488709f8410300000000fdf2ace002ceb6d903000000000265654c1310040000000003ac00657e91c0ec\", \"536a63ac\", 0, 82144555, \"98ccde2dc14d14f5d8b1eeea5364bd18fc84560fec2fcea8de4d88b49c00695e\"],\n\t[\"156ebc8202065d0b114984ee98c097600c75c859bfee13af75dc93f57c313a877efb09f230010000000463536a51ffffffff81114e8a697be3ead948b43b5005770dd87ffb1d5ccd4089fa6c8b33d3029e9c03000000066a5251656351ffffffff01a87f140000000000050000ac51ac00000000\", \"00\", 0, -362221092, \"a903c84d8c5e71134d1ab6dc1e21ac307c4c1a32c90c90f556f257b8a0ec1bf5\"],\n\t[\"15e37793023c7cbf46e073428908fce0331e49550f2a42b92468827852693f0532a01c29f70200000007005353636351acffffffff38426d9cec036f00eb56ec1dcd193647e56a7577278417b8a86a78ac53199bc403000000056353006a53ffffffff04a25ce103000000000900ab5365656a526a63c8eff7030000000004526353537ab6db0200000000016a11a3fa02000000000651acacab526500000000\", \"53ac6aab6a6551\", 0, 1117532791, \"83c68b3c5a89260ce16ce8b4dbf02e1f573c532d9a72f5ea57ab419fa2630214\"],\n\t[\"f7a09f10027250fc1b70398fb5c6bffd2be9718d3da727e841a73596fdd63810c9e4520a6a010000000963ac516a636a65acac1d2e2c57ab28d311edc4f858c1663972eebc3bbc93ed774801227fda65020a7ec1965f780200000005ac5252516a8299fddc01dcbf7200000000000463ac6551960fda03\", \"65acab51\", 1, 2017321737, \"9c5fa02abfd34d0f9dec32bf3edb1089fca70016debdb41f4f54affcb13a2a2a\"],\n\t[\"6d97a9a5029220e04f4ccc342d8394c751282c328bf1c132167fc05551d4ca4da4795f6d4e02000000076a0052ab525165ffffffff9516a205e555fa2a16b73e6db6c223a9e759a7e09c9a149a8f376c0a7233fa1b0100000007acab51ab63ac6affffffff04868aed04000000000652ac65ac536a396edf01000000000044386c0000000000076aab5363655200894d48010000000001ab8ebefc23\", \"6351526aac51\", 1, 1943666485, \"f0bd4ca8e97203b9b4e86bc24bdc8a1a726db5e99b91000a14519dc83fc55c29\"],\n\t[\"8e3fddfb028d9e566dfdda251cd874cd3ce72e9dde837f95343e90bd2a93fe21c5daeb5eed01000000045151525140517dc818181f1e7564b8b1013fd68a2f9a56bd89469686367a0e72c06be435cf99db750000000003635251ffffffff01c051780300000000096552ababac6a65acab099766eb\", \"5163ab6a52ababab51\", 1, 1296295812, \"5509eba029cc11d7dd2808b8c9eb47a19022b8d8b7778893459bbc19ab7ea820\"],\n\t[\"a603f37b02a35e5f25aae73d0adc0b4b479e68a734cf722723fd4e0267a26644c36faefdab0200000000ffffffff43374ad26838bf733f8302585b0f9c22e5b8179888030de9bdda180160d770650200000001004c7309ce01379099040000000005526552536500000000\", \"abababab005153\", 0, 1409936559, \"4ca73da4fcd5f1b10da07998706ffe16408aa5dff7cec40b52081a6514e3827e\"],\n\t[\"9eeedaa8034471a3a0e3165620d1743237986f060c4434f095c226114dcb4b4ec78274729f03000000086a5365510052ac6afb505af3736e347e3f299a58b1b968fce0d78f7457f4eab69240cbc40872fd61b5bf8b120200000002ac52df8247cf979b95a4c97ecb8edf26b3833f967020cd2fb25146a70e60f82c9ee4b14e88b103000000008459e2fa0125cbcd05000000000000000000\", \"52ab5352006353516a\", 0, -1832576682, \"fb018ae54206fdd20c83ae5873ec82b8e320a27ed0d0662db09cda8a071f9852\"],\n\t[\"05921d7c048cf26f76c1219d0237c226454c2a713c18bf152acc83c8b0647a94b13477c07f0300000003ac526afffffffff2f494453afa0cabffd1ba0a626c56f90681087a5c1bd81d6adeb89184b27b7402000000036a6352ffffffff0ad10e2d3ce355481d1b215030820da411d3f571c3f15e8daf22fe15342fed04000000000095f29f7b93ff814a9836f54dc6852ec414e9c4e16a506636715f569151559100ccfec1d100000000055263656a53ffffffff04f4ffef010000000008ac6a6aabacabab6a0e6689040000000006ab536a5352abe364d005000000000965536363655251ab53807e00010000000004526aab63f18003e3\", \"6363ac51\", 3, -375891099, \"001b0b176f0451dfe2d9787b42097ceb62c70d324e925ead4c58b09eebdf7f67\"],\n\t[\"b9b44d9f04b9f15e787d7704e6797d51bc46382190c36d8845ec68dfd63ee64cf7a467b21e00000000096aac00530052ab636aba1bcb110a80c5cbe073f12c739e3b20836aa217a4507648d133a8eedd3f02cb55c132b203000000076a000063526352b1c288e3a9ff1f2da603f230b32ef7c0d402bdcf652545e2322ac01d725d75f5024048ad0100000000ffffffffffd882d963be559569c94febc0ef241801d09dc69527c9490210f098ed8203c700000000056a006300ab9109298d01719d9a0300000000066a52ab006365d7894c5b\", \"ac6351650063636a\", 3, -622355349, \"ac87b1b93a6baab6b2c6624f10e8ebf6849b0378ef9660a3329073e8f5553c8d\"],\n\t[\"ff60473b02574f46d3e49814c484081d1adb9b15367ba8487291fc6714fd6e3383d5b335f001000000026a6ae0b82da3dc77e5030db23d77b58c3c20fa0b70aa7d341a0f95f3f72912165d751afd57230300000008ac536563516a6363ffffffff04f86c0200000000000553acab636ab13111000000000003510065f0d3f305000000000951ab516a65516aabab730a3a010000000002515200000000\", \"ac6a\", 1, 1895032314, \"0767e09bba8cd66d55915677a1c781acd5054f530d5cf6de2d34320d6c467d80\"],\n\t[\"f218026204f4f4fc3d3bd0eada07c57b88570d544a0436ae9f8b753792c0c239810bb30fbc0200000002536affffffff8a468928d6ec4cc10aa0f73047697970e99fa64ae8a3b4dca7551deb0b639149010000000851ab520052650051ffffffffa98dc5df357289c9f6873d0f5afcb5b030d629e8f23aa082cf06ec9a95f3b0cf0000000000ffffffffea2c2850c5107705fd380d6f29b03f533482fd036db88739122aac9eff04e0aa010000000365536a03bd37db034ac4c4020000000007515152655200ac33b27705000000000151efb71e0000000000007b65425b\", \"515151\", 3, -1772252043, \"de35c84a58f2458c33f564b9e58bc57c3e028d629f961ad1b3c10ee020166e5a\"],\n\t[\"48e7d42103b260b27577b70530d1ac2fed2551e9dd607cbcf66dca34bb8c03862cf8f5fd5401000000075151526aacab00ffffffff1e3d3b841552f7c6a83ee379d9d66636836673ce0b0eda95af8f2d2523c91813030000000665acac006365ffffffff388b3c386cd8c9ef67c83f3eaddc79f1ff910342602c9152ffe8003bce51b28b0100000008636363006a636a52ffffffff04b8f67703000000000852005353ac6552520cef720200000000085151ab6352ab00ab5096d6030000000005516a005100662582020000000001ac6c137280\", \"6a65\", 1, 1513618429, \"e2fa3e1976aed82c0987ab30d4542da2cb1cffc2f73be13480132da8c8558d5c\"],\n\t[\"91ebc4cf01bc1e068d958d72ee6e954b196f1d85b3faf75a521b88a78021c543a06e056279000000000265ab7c12df0503832121030000000000cc41a6010000000005ab5263516540a951050000000006ab63ab65acac00000000\", \"526a0065636a6a6aac\", 0, -614046478, \"7de4ba875b2e584a7b658818c112e51ee5e86226f5a80e5f6b15528c86400573\"],\n\t[\"3cd4474201be7a6c25403bf00ca62e2aa8f8f4f700154e1bb4d18c66f7bb7f9b975649f0dc0100000006535151535153ffffffff01febbeb000000000006005151006aac00000000\", \"\", 0, -1674687131, \"6b77ca70cc452cc89acb83b69857cda98efbfc221688fe816ef4cb4faf152f86\"],\n\t[\"92fc95f00307a6b3e2572e228011b9c9ed41e58ddbaefe3b139343dbfb3b34182e9fcdc3f50200000002acab847bf1935fde8bcfe41c7dd99683289292770e7f163ad09deff0e0665ed473cd2b56b0f40300000006516551ab6351294dab312dd87b9327ce2e95eb44b712cfae0e50fda15b07816c8282e8365b643390eaab01000000026aacffffffff016e0b6b040000000001ac00000000\", \"650065acac005300\", 2, -1885164012, \"bd7d26bb3a98fc8c90c972500618bf894cb1b4fe37bf5481ff60eef439d3b970\"],\n\t[\"4db591ab018adcef5f4f3f2060e41f7829ce3a07ea41d681e8cb70a0e37685561e4767ac3b0000000005000052acabd280e63601ae6ef20000000000036a636326c908f7\", \"ac6a51526300630052\", 0, 862877446, \"355ccaf30697c9c5b966e619a554d3323d7494c3ea280a9b0dfb73f953f5c1cb\"],\n\t[\"503fd5ef029e1beb7b242d10032ac2768f9a1aca0b0faffe51cec24770664ec707ef7ede4f01000000045253ac53375e350cc77741b8e96eb1ce2d3ca91858c052e5f5830a0193200ae2a45b413dda31541f0000000003516553ffffffff0175a5ba0500000000015200000000\", \"6aab65510053ab65\", 1, 1603081205, \"353ca9619ccb0210ae18b24d0e57efa7abf8e58fa6f7102738e51e8e72c9f0c4\"],\n\t[\"c80abebd042cfec3f5c1958ee6970d2b4586e0abec8305e1d99eb9ee69ecc6c2cbd76374380000000007ac53006300ac510acee933b44817db79320df8094af039fd82111c7726da3b33269d3820123694d849ee5001000000056a65ab526562699bea8530dc916f5d61f0babea709dac578774e8a4dcd9c640ec3aceb6cb2443f24f302000000020063ea780e9e57d1e4245c1e5df19b4582f1bf704049c5654f426d783069bcc039f2d8fa659f030000000851ab53635200006a8d00de0b03654e8500000000000463ab635178ebbb0400000000055100636aab239f1d030000000006ab006300536500000000\", \"6565ac515100\", 3, 1460851377, \"b35bb1b72d02fab866ed6bbbea9726ab32d968d33a776686df3ac16aa445871e\"],\n\t[\"0337b2d5043eb6949a76d6632b8bb393efc7fe26130d7409ef248576708e2d7f9d0ced9d3102000000075352636a5163007034384dfa200f52160690fea6ce6c82a475c0ef1caf5c9e5a39f8f9ddc1c8297a5aa0eb02000000026a51ffffffff38e536298799631550f793357795d432fb2d4231f4effa183c4e2f61a816bcf0030000000463ac5300706f1cd3454344e521fde05b59b96e875c8295294da5d81d6cc7efcfe8128f150aa54d6503000000008f4a98c704c1561600000000000072cfa6000000000000e43def01000000000100cf31cc0500000000066365526a6500cbaa8e2e\", \"\", 3, 2029506437, \"7615b4a7b3be865633a31e346bc3db0bcc410502c8358a65b8127089d81b01f8\"],\n\t[\"59f6cffd034733f4616a20fe19ea6aaf6abddb30b408a3a6bd86cd343ab6fe90dc58300cc90200000000ffffffffc835430a04c3882066abe7deeb0fa1fdaef035d3233460c67d9eabdb05e95e5a02000000080065ac535353ab00ffffffff4b9a043e89ad1b4a129c8777b0e8d87a014a0ab6a3d03e131c27337bbdcb43b402000000066a5100abac6ad9e9bf62014bb118010000000001526cbe484f\", \"ab526352ab65\", 0, 2103515652, \"4f2ccf981598639bec57f885b4c3d8ea8db445ea6e61cfd45789c69374862e5e\"],\n\t[\"cbc79b10020b15d605680a24ee11d8098ad94ae5203cb6b0589e432832e20c27b72a926af20300000006ab65516a53acbb854f3146e55c508ece25fa3d99dbfde641a58ed88c051a8a51f3dacdffb1afb827814b02000000026352c43e6ef30302410a020000000000ff4bd90100000000065100ab63000008aa8e0400000000095265526565ac5365abc52c8a77\", \"53526aac0051\", 0, 202662340, \"984efe0d8d12e43827b9e4b27e97b3777ece930fd1f589d616c6f9b71dab710e\"],\n\t[\"7c07419202fa756d29288c57b5c2b83f3c847a807f4a9a651a3f6cd6c46034ae0aa3a7446b0200000004ab6a6365ffffffff9da83cf4219bb96c76f2d77d5df31c1411a421171d9b59ec02e5c1218f29935403000000008c13879002f8b1ac0400000000086a63536a636553653c584f02000000000000000000\", \"abac53ab656363\", 1, -1038419525, \"4a74f365a161bc6c9bddd249cbd70f5dadbe3de70ef4bd745dcb6ee1cd299fbd\"],\n\t[\"351cbb57021346e076d2a2889d491e9bfa28c54388c91b46ee8695874ad9aa576f1241874d0200000008ab6563525300516affffffffe13e61b8880b8cd52be4a59e00f9723a4722ea58013ec579f5b3693b9e115b1100000000096363abac5252635351ffffffff027fee02040000000008ab6a5200ab006a65b85f130200000000086a52630053ab52ab00000000\", \"ab6aab65\", 1, 586415826, \"08bbb746a596991ab7f53a76e19acad087f19cf3e1db54054aab403c43682d09\"],\n\t[\"a8252ea903f1e8ff953adb16c1d1455a5036222c6ea98207fc21818f0ece2e1fac310f9a0100000000095163ac635363ac0000be6619e9fffcde50a0413078821283ce3340b3993ad00b59950bae7a9f931a9b0a3a035f010000000463005300b8b0583fbd6049a1715e7adacf770162811989f2be20af33f5f60f26eba653dc26b024a00000000006525351636552ffffffff046d2acc030000000002636a9a2d430500000000080065005165ab53abecf63204000000000052b9ed050000000008acacac53ab65656500000000\", \"65ab53635253636a51\", 2, 1442639059, \"8ca11838775822f9a5beee57bdb352f4ee548f122de4a5ca61c21b01a1d50325\"],\n\t[\"2f1a425c0471a5239068c4f38f9df135b1d24bf52d730d4461144b97ea637504495aec360801000000055300515365c71801dd1f49f376dd134a9f523e0b4ae611a4bb122d8b26de66d95203f181d09037974300000000025152ffffffff9bdcea7bc72b6e5262e242c94851e3a5bf8f314b3e5de0e389fc9e5b3eadac030000000009525265655151005153ffffffffdbb53ce99b5a2320a4e6e2d13b01e88ed885a0957d222e508e9ec8e4f83496cb0200000007635200abac63ac04c96237020cc5490100000000080000516a51ac6553074a360200000000025152225520ca\", \"6551ab65ac65516a\", 1, -489869549, \"9bc5bb772c553831fb40abe466074e59a469154679c7dee042b8ea3001c20393\"],\n\t[\"ef3acfd4024defb48def411b8f8ba2dc408dc9ee97a4e8bde4d6cb8e10280f29c98a6e8e9103000000035100513d5389e3d67e075469dfd9f204a7d16175653a149bd7851619610d7ca6eece85a516b2df0300000005516aac6552ca678bdf02f477f003000000000057e45b0300000000055252525252af35c20a\", \"5165ac53ab\", 1, -1900839569, \"78eb6b24365ac1edc386aa4ffd15772f601059581c8776c34f92f8a7763c9ccf\"],\n\t[\"ff4468dc0108475fc8d4959a9562879ce4ab4867a419664bf6e065f17ae25043e6016c70480100000000ffffffff02133c6f0400000000000bd0a8020000000004006a520035afa4f6\", \"51ac65ab\", 0, -537664660, \"f6da59b9deac63e83728850ac791de61f5dfcaeed384ebcbb20e44afcd8c8910\"],\n\t[\"4e8594d803b1d0a26911a2bcdd46d7cbc987b7095a763885b1a97ca9cbb747d32c5ab9aa91030000000353ac53a0cc4b215e07f1d648b6eeb5cdbe9fa32b07400aa773b9696f582cebfd9930ade067b2b200000000060065abab6500fc99833216b8e27a02defd9be47fafae4e4a97f52a9d2a210d08148d2a4e5d02730bcd460100000004516351ac37ce3ae1033baa55040000000006006a636a63acc63c990400000000025265eb1919030000000005656a6a516a00000000\", \"\", 1, -75217178, \"04c5ee48514cd033b82a28e336c4d051074f477ef2675ce0ce4bafe565ee9049\"],\n\t[\"a88830a7023f13ed19ab14fd757358eb6af10d6520f9a54923a6d613ac4f2c11e249cda8aa030000000851630065abababacffffffff8f5fe0bc04a33504c4b47e3991d25118947a0261a9fa520356731eeabd561dd3020000000363ababffffffff038404bd010000000008ab5153516aab6a63d33a5601000000000263004642dc020000000009655152acac636352004be6f3af\", \"5253536565006aab6a\", 0, 1174417836, \"2e42ead953c9f4f81b72c27557e6dc7d48c37ff2f5c46c1dbe9778fb0d79f5b2\"],\n\t[\"44e1a2b4010762af23d2027864c784e34ef322b6e24c70308a28c8f2157d90d17b99cd94a401000000085163656565006300ffffffff0198233d020000000002000000000000\", \"52525153656365\", 0, 1119696980, \"d9096de94d70c6337da6202e6e588166f31bff5d51bb5adc9468594559d65695\"],\n\t[\"44ca65b901259245abd50a745037b17eb51d9ce1f41aa7056b4888285f48c6f26cb97b7a25020000000552636363abffffffff047820350400000000040053acab14f3e603000000000652635100ab630ce66c03000000000001bdc704000000000765650065ac51ac3e886381\", \"51\", 0, -263340864, \"ed5622ac642d11f90e68c0feea6a2fe36d880ecae6b8c0d89c4ea4b3d162bd90\"],\n\t[\"cfa147d2017fe84122122b4dda2f0d6318e59e60a7207a2d00737b5d89694d480a2c26324b0000000006006351526552ffffffff0456b5b804000000000800516aab525363ab166633000000000004655363ab254c0e02000000000952ab6a6a00ab525151097c1b020000000009656a52ac6300530065ad0d6e50\", \"6a535165ac6a536500\", 0, -574683184, \"f926d4036eac7f019a2b0b65356c4ee2fe50e089dd7a70f1843a9f7bc6997b35\"],\n\t[\"91c5d5f6022fea6f230cc4ae446ce040d8313071c5ac1749c82982cc1988c94cb1738aa48503000000016a19e204f30cb45dd29e68ff4ae160da037e5fc93538e21a11b92d9dd51cf0b5efacba4dd70000000005656a6aac51ffffffff03db126905000000000953006a53ab6563636a36a273030000000006656a52656552b03ede00000000000352516500000000\", \"530052526a00\", 1, 1437328441, \"255c125b60ee85f4718b2972174c83588ee214958c3627f51f13b5fb56c8c317\"],\n\t[\"03f20dc202c886907b607e278731ebc5d7373c348c8c66cac167560f19b341b782dfb634cb03000000076a51ac6aab63abea3e8de7adb9f599c9caba95aa3fa852e947fc88ed97ee50e0a0ec0d14d164f44c0115c10100000004ab5153516fdd679e0414edbd000000000005ac636a53512021f2040000000007006a0051536a52c73db2050000000005525265ac5369046e000000000003ab006a1ef7bd1e\", \"52656a\", 0, 1360223035, \"5a0a05e32ce4cd0558aabd5d79cd5fcbffa95c07137506e875a9afcba4bef5a2\"],\n\t[\"d9611140036881b61e01627078512bc3378386e1d4761f959d480fdb9d9710bebddba2079d020000000763536aab5153ab819271b41e228f5b04daa1d4e72c8e1955230accd790640b81783cfc165116a9f535a74c000000000163ffffffffa2e7bb9a28e810624c251ff5ba6b0f07a356ac082048cf9f39ec036bba3d431a02000000076a000000ac65acffffffff01678a820000000000085363515153ac635100000000\", \"535353\", 2, -82213851, \"52b9e0778206af68998cbc4ebdaad5a9469e04d0a0a6cef251abfdbb74e2f031\"],\n\t[\"98b3a0bf034233afdcf0df9d46ac65be84ef839e58ee9fa59f32daaa7d684b6bdac30081c60200000007636351acabababffffffffc71cf82ded4d1593e5825618dc1d5752ae30560ecfaa07f192731d68ea768d0f0100000006650052636563f3a2888deb5ddd161430177ce298242c1a86844619bc60ca2590d98243b5385bc52a5b8f00000000095365acacab520052ac50d4722801c3b8a60300000000035165517e563b65\", \"51\", 1, -168940690, \"b6b684e2d2ecec8a8dce4ed3fc1147f8b2e45732444222aa8f52d860c2a27a9d\"],\n\t[\"97be4f7702dc20b087a1fdd533c7de762a3f2867a8f439bddf0dcec9a374dfd0276f9c55cc0300000000cdfb1dbe6582499569127bda6ca4aaff02c132dc73e15dcd91d73da77e92a32a13d1a0ba0200000002ab51ffffffff048cfbe202000000000900516351515363ac535128ce0100000000076aac5365ab6aabc84e8302000000000863536a53ab6a6552f051230500000000066aac535153510848d813\", \"ac51\", 0, 229541474, \"e5da9a416ea883be1f8b8b2d178463633f19de3fa82ae25d44ffb531e35bdbc8\"],\n\t[\"085b6e04040b5bff81e29b646f0ed4a45e05890a8d32780c49d09643e69cdccb5bd81357670100000001abffffffffa5c981fe758307648e783217e3b4349e31a557602225e237f62b636ec26df1a80300000004650052ab4792e1da2930cc90822a8d2a0a91ea343317bce5356b6aa8aae6c3956076aa33a5351a9c0300000004abac5265e27ddbcd472a2f13325cc6be40049d53f3e266ac082172f17f6df817db1936d9ff48c02b000000000152ffffffff021aa7670500000000085353635163ab51ac14d584000000000001aca4d136cc\", \"6a525300536352536a\", 0, -1398925877, \"41ecca1e8152ec55074f4c39f8f2a7204dda48e9ec1e7f99d5e7e4044d159d43\"],\n\t[\"eec32fff03c6a18b12cd7b60b7bdc2dd74a08977e53fdd756000af221228fe736bd9c42d870100000007005353ac515265ffffffff037929791a188e9980e8b9cc154ad1b0d05fb322932501698195ab5b219488fc02000000070063510065ab6a0bfc176aa7e84f771ea3d45a6b9c24887ceea715a0ff10ede63db8f089e97d927075b4f1000000000551abab63abffffffff02eb933c000000000000262c420000000000036563632549c2b6\", \"6352\", 2, 1480445874, \"ff8a4016dfdd918f53a45d3a1f62b12c407cd147d68ca5c92b7520e12c353ff5\"],\n\t[\"98ea7eac0313d9fb03573fb2b8e718180c70ce647bebcf49b97a8403837a2556cb8c9377f30000000004ac53ac65ffffffff8caac77a5e52f0d8213ef6ce998bedbb50cfdf108954771031c0e0cd2a78423900000000010066e99a44937ebb37015be3693761078ad5c73aa73ec623ac7300b45375cc8eef36087eb80000000007515352acac5100ffffffff0114a51b02000000000000000000\", \"6aacab\", 0, 243527074, \"bad77967f98941af4dd52a8517d5ad1e32307c0d511e15461e86465e1b8b5273\"],\n\t[\"3ab70f4604e8fc7f9de395ec3e4c3de0d560212e84a63f8d75333b604237aa52a10da17196000000000763526a6553ac63a25de6fd66563d71471716fe59087be0dde98e969e2b359282cf11f82f14b00f1c0ac70f02000000050052516aacdffed6bb6889a13e46956f4b8af20752f10185838fd4654e3191bf49579c961f5597c36c0100000005ac636363abc3a1785bae5b8a1b4be5d0cbfadc240b4f7acaa7dfed6a66e852835df5eb9ac3c553766801000000036a65630733b7530218569602000000000952006a6a6a51acab52777f06030000000007ac0063530052abc08267c9\", \"000000536aac0000\", 1, 1919096509, \"df1c87cf3ba70e754d19618a39fdbd2970def0c1bfc4576260cba5f025b87532\"],\n\t[\"bdb6b4d704af0b7234ced671c04ba57421aba7ead0a117d925d7ebd6ca078ec6e7b93eea6600000000026565ffffffff3270f5ad8f46495d69b9d71d4ab0238cbf86cc4908927fbb70a71fa3043108e6010000000700516a65655152ffffffff6085a0fdc03ae8567d0562c584e8bfe13a1bd1094c518690ebcb2b7c6ce5f04502000000095251530052536a53aba576a37f2c516aad9911f687fe83d0ae7983686b6269b4dd54701cb5ce9ec91f0e6828390300000000ffffffff04cc76cc020000000002656a01ffb702000000000253ab534610040000000009acab006565516a00521f55f5040000000000389dfee9\", \"6a525165\", 0, 1336204763, \"71c294523c48fd7747eebefbf3ca06e25db7b36bff6d95b41c522fecb264a919\"],\n\t[\"54258edd017d22b274fbf0317555aaf11318affef5a5f0ae45a43d9ca4aa652c6e85f8a040010000000953ac65ab5251656500ffffffff03321d450000000000085265526a51526a529ede8b030000000003635151ce6065020000000001534c56ec1b\", \"acac\", 0, 2094130012, \"110d90fea9470dfe6c5048f45c3af5e8cc0cb77dd58fd13d338268e1c24b1ccc\"],\n\t[\"ce0d322e04f0ffc7774218b251530a7b64ebefca55c90db3d0624c0ff4b3f03f918e8cf6f60300000003656500ffffffff9cce943872da8d8af29022d0b6321af5fefc004a281d07b598b95f6dcc07b1830200000007abab515351acab8d926410e69d76b7e584aad1470a97b14b9c879c8b43f9a9238e52a2c2fefc2001c56af8010000000400ab5253cd2cd1fe192ce3a93b5478af82fa250c27064df82ba416dfb0debf4f0eb307a746b6928901000000096500abacac6a0063514214524502947efc0200000000035251652c40340100000000096a6aab52000052656a5231c54c\", \"51\", 2, -2090320538, \"0322ca570446869ec7ec6ad66d9838cff95405002d474c0d3c17708c7ee039c6\"],\n\t[\"47ac54940313430712ebb32004679d3a512242c2b33d549bf5bbc8420ec1fd0850ed50eb6d0300000009536aac6a65acacab51ffffffffb843e44266ce2462f92e6bff54316661048c8c17ecb092cb493b39bfca9117850000000001519ab348c05e74ebc3f67423724a3371dd99e3bceb4f098f8860148f48ad70000313c4c223000000000653006565656512c2d8dc033f3c97010000000002636aa993aa010000000006526365ab526ab7cf560300000000076a0065ac6a526500000000\", \"005352535300ab6a\", 2, 59531991, \"8b5b3d00d9c658f062fe6c5298e54b1fe4ed3a3eab2a87af4f3119edc47b1691\"],\n\t[\"233cd90b043916fc41eb870c64543f0111fb31f3c486dc72457689dea58f75c16ae59e9eb2000000000500536a6a6affffffff9ae30de76be7cd57fb81220fce78d74a13b2dbcad4d023f3cadb3c9a0e45a3ce000000000965ac6353ac5165515130834512dfb293f87cb1879d8d1b20ebad9d7d3d5c3e399a291ce86a3b4d30e4e32368a9020000000453005165ffffffff26d84ae93eb58c81158c9b3c3cbc24a84614d731094f38d0eea8686dec02824d0300000005636a65abacf02c784001a0bd5d03000000000900655351ab65ac516a416ef503\", \"\", 1, -295106477, \"b79f31c289e95d9dadec48ebf88e27c1d920661e50d090e422957f90ff94cb6e\"],\n\t[\"9200e26b03ff36bc4bf908143de5f97d4d02358db642bd5a8541e6ff709c420d1482d471b70000000008abab65536a636553ffffffff61ba6d15f5453b5079fb494af4c48de713a0c3e7f6454d7450074a2a80cb6d880300000007ac6a00ab5165515dfb7574fbce822892c2acb5d978188b1d65f969e4fe874b08db4c791d176113272a5cc10100000000ffffffff0420958d000000000009ac63516a0063516353dd885505000000000465ac00007b79e901000000000066d8bf010000000005525252006a00000000\", \"ac5152\", 0, 2089531339, \"89ec7fab7cfe7d8d7d96956613c49dc48bf295269cfb4ea44f7333d88c170e62\"],\n\t[\"45f335ba01ce2073a8b0273884eb5b48f56df474fc3dff310d9706a8ac7202cf5ac188272103000000025363ffffffff049d859502000000000365ab6a8e98b1030000000002ac51f3a80603000000000752535151ac00000306e30300000000020051b58b2b3a\", \"\", 0, 1899564574, \"78e01310a228f645c23a2ad0acbb8d91cedff4ecdf7ca997662c6031eb702b11\"],\n\t[\"d8f652a6043b4faeada05e14b81756cd6920cfcf332e97f4086961d49232ad6ffb6bc6c097000000000453526563ffffffff1ea4d60e5e91193fbbc1a476c8785a79a4c11ec5e5d6c9950c668ceacfe07a15020000000352ab51fffffffffe029a374595c4edd382875a8dd3f20b9820abb3e93f877b622598d11d0b09e503000000095351000052ac515152ffffffff9d65fea491b979699ceb13caf2479cd42a354bd674ded3925e760758e85a756803000000046365acabffffffff0169001d00000000000651636a65656300000000\", \"ab0063630000ac\", 3, 1050965951, \"4cc85cbc2863ee7dbce15490d8ca2c5ded61998257b9eeaff968fe38e9f009ae\"],\n\t[\"718662be026e1dcf672869ac658fd0c87d6835cfbb34bd854c44e577d5708a7faecda96e260300000004526a636a489493073353b678549adc7640281b9cbcb225037f84007c57e55b874366bb7b0fa03bdc00000000095165ababac65ac00008ab7f2a802eaa53d000000000007acac516aac526ae92f380100000000056aac00536500000000\", \"ab00\", 1, 43296088, \"2d642ceee910abff0af2116af75b2e117ffb7469b2f19ad8fef08f558416d8f7\"],\n\t[\"94083c840288d40a6983faca876d452f7c52a07de9268ad892e70a81e150d602a773c175ad03000000007ec3637d7e1103e2e7e0c61896cbbf8d7e205b2ecc93dd0d6d7527d39cdbf6d335789f660300000000ffffffff019e1f7b03000000000800ac0051acac0053539cb363\", \"\", 1, -183614058, \"a17b66d6bb427f42653d08207a22b02353dd19ccf2c7de6a9a3a2bdb7c49c9e7\"],\n\t[\"30e0d4d20493d0cd0e640b757c9c47a823120e012b3b64c9c1890f9a087ae4f2001ca22a61010000000152f8f05468303b8fcfaad1fb60534a08fe90daa79bff51675472528ebe1438b6f60e7f60c10100000009526aab6551ac510053ffffffffaaab73957ea2133e32329795221ed44548a0d3a54d1cf9c96827e7cffd1706df0200000009ab00526a005265526affffffffd19a6fe54352015bf170119742821696f64083b5f14fb5c7d1b5a721a3d7786801000000085265abababac53abffffffff020f39bd030000000004ab6aac52049f6c050000000004ab52516aba5b4c60\", \"6a6365516a6a655253\", 0, -624256405, \"8e221a6c4bf81ca0d8a0464562674dcd14a76a32a4b7baf99450dd9195d411e6\"],\n\t[\"f9c69d940276ec00f65f9fe08120fc89385d7350388508fd80f4a6ba2b5d4597a9e21c884f010000000663ab63ababab15473ae6d82c744c07fc876ecd53bd0f3018b2dbedad77d757d5bdf3811b23d294e8c0170000000001abafababe00157ede2050000000006ac6a5263635300000000\", \"ab53\", 1, 606547088, \"714d8b14699835b26b2f94c58b6ea4c53da3f7adf0c62ea9966b1e1758272c47\"],\n\t[\"5c0ac112032d6885b7a9071d3c5f493aa16c610a4a57228b2491258c38de8302014276e8be030000000300ab6a17468315215262ad5c7393bb5e0c5a6429fd1911f78f6f72dafbbbb78f3149a5073e24740300000003ac5100ffffffff33c7a14a062bdea1be3c9c8e973f54ade53fe4a69dcb5ab019df5f3345050be00100000008ac63655163526aab428defc0033ec36203000000000765516365536a00ae55b2000000000002ab53f4c0080400000000095265516a536563536a00000000\", \"6a005151006a\", 2, 272749594, \"91082410630337a5d89ff19145097090f25d4a20bdd657b4b953927b2f62c73b\"],\n\t[\"e3683329026720010b08d4bec0faa244f159ae10aa582252dd0f3f80046a4e145207d54d31000000000852acac52656aacac3aaf2a5017438ad6adfa3f9d05f53ebed9ceb1b10d809d507bcf75e0604254a8259fc29c020000000653526552ab51f926e52c04b44918030000000000f7679c0100000000090000525152005365539e3f48050000000009516500ab635363ab008396c905000000000253650591024f\", \"6a6365\", 0, 908746924, \"458aec3b5089a585b6bad9f99fd37a2b443dc5a2eefac2b7e8c5b06705efc9db\"],\n\t[\"48c4afb204204209e1df6805f0697edaa42c0450bbbd767941fe125b9bc40614d63d757e2203000000066a5363005152dc8b6a605a6d1088e631af3c94b8164e36e61445e2c60130292d81dabd30d15f54b355a802000000036a6353ffffffff1d05dcec4f3dedcfd02c042ce5d230587ee92cb22b52b1e59863f3717df2362f0300000005536552ac52ffffffffd4d71c4f0a7d53ba47bb0289ca79b1e33d4c569c1e951dd611fc9c9c1ca8bc6c030000000865536a65ab51abacffffffff042f9aa905000000000753655153656351ab93d8010000000002655337440e0300000000005d4c690000000000015278587acb\", \"ab006565526a51\", 0, 1502064227, \"bbed77ff0f808aa8abd946ba9e7ec1ddb003a969fa223dee0af779643cb841a9\"],\n\t[\"00b20fd104dd59705b84d67441019fa26c4c3dec5fd3b50eca1aa549e750ef9ddb774dcabe000000000651ac656aac65ffffffff52d4246f2db568fc9eea143e4d260c698a319f0d0670f84c9c83341204fde48b0200000000ffffffffb8aeabb85d3bcbc67b132f1fd815b451ea12dcf7fc169c1bc2e2cf433eb6777a03000000086a51ac6aab6563acd510d209f413da2cf036a31b0def1e4dcd8115abf2e511afbcccb5ddf41d9702f28c52900100000006ac52ab6a0065ffffffff039c8276000000000008ab53655200656a52401561010000000003acab0082b7160100000000035100ab00000000\", \"535265\", 1, -947367579, \"3212c6d6dd8d9d3b2ac959dec11f4638ccde9be6ed5d36955769294e23343da0\"],\n\t[\"455131860220abbaa72015519090a666faf137a0febce7edd49da1eada41feab1505a0028b02000000036365ab453ead4225724eb69beb590f2ec56a7693a608871e0ab0c34f5e96157f90e0a96148f3c502000000085251ab51535163acffffffff022d1249040000000009abac00acac6565630088b310040000000000e3920e59\", \"5152ab6a52ac5152\", 0, 294375737, \"c40fd7dfa72321ac79516502500478d09a35cc22cc264d652c7d18b14400b739\"],\n\t[\"624d28cb02c8747915e9af2b13c79b417eb34d2fa2a73547897770ace08c6dd9de528848d3030000000651ab63abab533c69d3f9b75b6ef8ed2df50c2210fd0bf4e889c42477d58682f711cbaece1a626194bb85030000000765acab53ac5353ffffffff018cc280040000000009abacabac52636352ac6859409e\", \"ac51ac\", 1, 1005144875, \"919144aada50db8675b7f9a6849c9d263b86450570293a03c245bd1e3095e292\"],\n\t[\"8f28471d02f7d41b2e70e9b4c804f2d90d23fb24d53426fa746bcdcfffea864925bdeabe3e0200000001acffffffff76d1d35d04db0e64d65810c808fe40168f8d1f2143902a1cc551034fd193be0e0000000001acffffffff048a5565000000000005005151516afafb610400000000045263ac53648bb30500000000086363516a6a5165513245de01000000000000000000\", \"6a0053510053\", 1, -1525137460, \"305fc8ff5dc04ebd9b6448b03c9a3d945a11567206c8d5214666b30ec6d0d6cc\"],\n\t[\"10ec50d7046b8b40e4222a3c6449490ebe41513aad2eca7848284a08f3069f3352c2a9954f0000000009526aac656352acac53ffffffff0d979f236155aa972472d43ee6f8ce22a2d052c740f10b59211454ff22cb7fd00200000007acacacab63ab53ffffffffbbf97ebde8969b35725b2e240092a986a2cbfd58de48c4475fe077bdd493a20c010000000663ab5365ababffffffff4600722d33b8dba300d3ad037bcfc6038b1db8abfe8008a15a1de2da2264007302000000035351ac6dbdafaf020d0ccf04000000000663ab6a51ab6ae06e5e0200000000036aabab00000000\", \"\", 0, -1658960232, \"2420dd722e229eccafae8508e7b8d75c6920bfdb3b5bac7cb8e23419480637c2\"],\n\t[\"fef98b7101bf99277b08a6eff17d08f3fcb862e20e13138a77d66fba55d54f26304143e5360100000006515365abab00ffffffff04265965030000000004655252ace2c775010000000001002b23b4040000000007516a5153ab53ac456a7a00000000000753ab525251acacba521291\", \"526aacacab00abab53\", 0, -1614097109, \"4370d05c07e231d6515c7e454a4e401000b99329d22ed7def323976fa1d2eeb5\"],\n\t[\"34a2b8830253661b373b519546552a2c3bff7414ea0060df183b1052683d78d8f54e842442000000000152ffffffffd961a8e34cf374151058dfcddc86509b33832bc57267c63489f69ff01199697c0300000002abacba856cfb01b17c2f050000000008515365ac53ab000000000000\", \"5263ab656a\", 1, -2104480987, \"2f9993e0a84a6ca560d6d1cc2b63ffe7fd71236d9cfe7d809491cef62bbfad84\"],\n\t[\"43559290038f32fda86580dd8a4bc4422db88dd22a626b8bd4f10f1c9dd325c8dc49bf479f01000000026351ffffffff401339530e1ed3ffe996578a17c3ec9d6fccb0723dd63e7b3f39e2c44b976b7b0300000006ab6a65656a51ffffffff6fb9ba041c96b886482009f56c09c22e7b0d33091f2ac5418d05708951816ce7000000000551ac525100ffffffff020921e40500000000035365533986f40500000000016a00000000\", \"52ac51\", 0, 1769771809, \"02040283ef2291d8e1f79bb71bdabe7c1546c40d7ed615c375643000a8b9600d\"],\n\t[\"6878a6bd02e7e1c8082d5e3ee1b746cfebfac9e8b97e61caa9e0759d8a8ecb3743e36a30de0100000002ab532a911b0f12b73e0071f5d50b6bdaf783f4b9a6ce90ec0cad9eecca27d5abae188241ddec0200000001651c7758d803f7457b0500000000036551515f4e90000000000001007022080200000000035365acc86b6946\", \"6351ab\", 0, -1929374995, \"f24be499c58295f3a07f5f1c6e5084496ae160450bd61fdb2934e615289448f1\"],\n\t[\"35b6fc06047ebad04783a5167ab5fc9878a00c4eb5e7d70ef297c33d5abd5137a2dea9912402000000036aacacffffffff21dc291763419a584bdb3ed4f6f8c60b218aaa5b99784e4ba8acfec04993e50c03000000046a00ac6affffffff69e04d77e4b662a82db71a68dd72ef0af48ca5bebdcb40f5edf0caf591bb41020200000000b5db78a16d93f5f24d7d932f93a29bb4b784febd0cbb1943f90216dc80bba15a0567684b000000000853ab52ab5100006a1be2208a02f6bdc103000000000265ab8550ea04000000000365636a00000000\", \"\", 0, -1114114836, \"1c8655969b241e717b841526f87e6bd68b2329905ba3fc9e9f72526c0b3ea20c\"],\n\t[\"bebb90c302bf91fd4501d33555a5fc5f2e1be281d9b7743680979b65c3c919108cc2f517510100000003abab00ffffffff969c30053f1276550532d0aa33cfe80ca63758cd215b740448a9c08a84826f3303000000056565ab5153ffffffff04bf6f2a04000000000565ab5265ab903e760100000000026a6a7103fa020000000006526553525365b05b2c000000000006ab000000535300000000\", \"51510053ab63635153\", 1, 1081291172, \"94338cd47a4639be30a71e21a7103cee4c99ef7297e0edd56aaf57a068b004de\"],\n\t[\"af48319f031b4eeb4319714a285f44244f283cbff30dcb9275b06f2348ccd0d7f015b54f8500000000066363ac65ac6affffffff2560a9817ebbc738ad01d0c9b9cf657b8f9179b1a7f073eb0b67517409d108180200000005ac6365ab52ffffffff0bdd67cd4ecae96249a2e2a96db1490ee645f042fd9d5579de945e22b799f4d003000000086552ab515153ab00cf187c8202e51abf0300000000066552006a00abadf37d000000000004ac6a535100000000\", \"63ab65\", 1, -1855554446, \"60caf46a7625f303c04706cec515a44b68ec319ee92273acb566cca4f66861c1\"],\n\t[\"f35befbc03faf8c25cc4bc0b92f6239f477e663b44b83065c9cb7cf231243032cf367ce3130000000005ab65526a517c4c334149a9c9edc39e29276a4b3ffbbab337de7908ea6f88af331228bd90086a6900ba020000000151279d19950d2fe81979b72ce3a33c6d82ebb92f9a2e164b6471ac857f3bbd3c0ea213b542010000000953ab51635363520065052657c20300a9ba04000000000452636a6a0516ea020000000008535253656365ababcfdd3f01000000000865ac516aac00530000000000\", \"\", 2, -99793521, \"c834a5485e68dc13edb6c79948784712122440d7fa5bbaa5cd2fc3d4dac8185d\"],\n\t[\"d3da18520216601acf885414538ce2fb4d910997eeb91582cac42eb6982c9381589587794f0300000000fffffffff1b1c9880356852e10cf41c02e928748dd8fae2e988be4e1c4cb32d0bfaea6f7000000000465ab6aabffffffff02fb0d69050000000002ababeda8580500000000085163526565ac52522b913c95\", \"ac\", 1, -1247973017, \"99b32b5679d91e0f9cdd6737afeb07459806e5acd7630c6a3b9ab5d550d0c003\"],\n\t[\"8218eb740229c695c252e3630fc6257c42624f974bc856b7af8208df643a6c520ef681bfd00000000002510066f30f270a09b2b420e274c14d07430008e7886ec621ba45665057120afce58befca96010300000004525153ab84c380a9015d96100000000000076a5300acac526500000000\", \"ac005263\", 0, -1855679695, \"5071f8acf96aea41c7518bd1b5b6bbe16258b529df0c03f9e374b83c66b742c6\"],\n\t[\"1123e7010240310013c74e5def60d8e14dd67aedff5a57d07a24abc84d933483431b8cf8ea0300000003530051fc6775ff1a23c627a2e605dd2560e84e27f4208300071e90f4589e762ad9c9fe8d0da95e020000000465655200ffffffff04251598030000000004ab65ab639d28d90400000000096563636aacac525153474df801000000000851525165ac51006a75e23b040000000000e5bd3a4a\", \"6363636565\", 0, -467124448, \"9cb0dd04e9fe287b112e94a1647590d27e8b164ca13c4fe70c610fd13f82c2fd\"],\n\t[\"fd92fe1003083c5179f97e77bf7d71975788138147adbdb283306802e261c0aee080fa22630200000000860c643ba9a1816b9badf36077b4554d11720e284e395a1121bc45279e148b2064c65e49020000000651ab6a53636a2c713088d20f4bc4001264d972cce05b9fe004dc33376ad24d0d013e417b91a5f1b6734e000000000100ffffffff02e3064c0500000000066552006a5165b86e8705000000000665ab65ab53522052eadb\", \"00ab53525265\", 0, 776203277, \"47207b48777727532f62e09afcd4104ea6687e723c7657c30504fa2081331cc8\"],\n\t[\"d1b6a703038f14d41fcc5cc45455faa135a5322be4bf0f5cbcd526578fc270a236cacb853f0200000001abffffffff135aeff902fa38f202ccf5bd34437ff89c9dc57a028b62447a0a38579383e8ef0000000000ffffffffadf398d2c818d0b90bc474f540c3618a4a643482eeab73d36101987e2ec0335900000000004bd3323504e69fc10000000000055151535251790ada02000000000563ab6aab521337a704000000000963ac63abacac52656a1e9862010000000007656500ac51ab6a8f4ee672\", \"ab5251656565ac63\", 2, 82008394, \"b8f3d255549909c07588ecba10a02e55a2d6f2206d831af9da1a7dae64cfbc8b\"],\n\t[\"81dadaa7011556683db3fe95262f4fdb20391b7e75b7ffcee51b176af64d83c06f85545d620200000005ab5151ab52ffffffff044805ef0300000000065353516352639702c802000000000900516351515252ab5270db08040000000009ac516aab526553abac4aabc90500000000096365ab0052636a525100000000\", \"6565ab6a5152\", 0, -2126294159, \"ad01ec9d6dbae325ec3a8e1fd98e2d03b1188378210efef093dd8b0b0ef3f19d\"],\n\t[\"3b937e05032b8895d2f4945cb7e3679be2fbd15311e2414f4184706dbfc0558cf7de7b4d000000000001638b91a12668a3c3ce349788c961c26aa893c862f1e630f18d80e7843686b6e1e6fc396310000000000852635353ab65ac51eeb09dd1c9605391258ee6f74b9ae17b5e8c2ef010dc721c5433dcdc6e93a1593e3b6d1700000000085365ac6553526351ffffffff0308b18e04000000000253acb6dd00040000000008536aac5153ac516ab0a88201000000000500ac006500804e3ff2\", \"\", 0, 416167343, \"595a3c02254564634e8085283ec4ea7c23808da97ce9c5da7aecd7b553e7fd7f\"],\n\t[\"a48f27ca047997470da74c8ee086ddad82f36d9c22e790bd6f8603ee6e27ad4d3174ea875403000000095153ac636aab6aacabffffffffefc936294e468d2c9a99e09909ba599978a8c0891ad47dc00ba424761627cef202000000056a51630053ffffffff304cae7ed2d3dbb4f2fbd679da442aed06221ffda9aee460a28ceec5a9399f4e0200000000f5bddf82c9c25fc29c5729274c1ff0b43934303e5f595ce86316fc66ad263b96ca46ab8d0100000003536500d7cf226b0146b00c04000000000200ac5c2014ce\", \"515100636563\", 0, 1991799059, \"9c051a7092fe17fa62b1720bc2c4cb2ffc1527d9fb0b006d2e142bb8fe07bf3c\"],\n\t[\"180cd53101c5074cf0b7f089d139e837fe49932791f73fa2342bd823c6df6a2f72fe6dba1303000000076a6a63ac53acabffffffff03853bc1020000000007ac526a6a6a6a003c4a8903000000000453515163a0fbbd030000000005ab656a5253253d64cf\", \"ac65\", 0, -1548453970, \"4d8efb3b99b9064d2f6be33b194a903ffabb9d0e7baa97a48fcec038072aac06\"],\n\t[\"c21ec8b60376c47e057f2c71caa90269888d0ffd5c46a471649144a920d0b409e56f190b700000000008acac6a526a536365ffffffff5d315d9da8bf643a9ba11299450b1f87272e6030fdb0c8adc04e6c1bfc87de9a0000000000ea43a9a142e5830c96b0ce827663af36b23b0277244658f8f606e95384574b91750b8e940000000007516a63ac0063acffffffff023c61be0400000000055165ab5263313cc8020000000006006a53526551ed8c3d56\", \"6a\", 1, 1160627414, \"a638cc17fd91f4b1e77877e8d82448c84b2a4e100df1373f779de7ad32695112\"],\n\t[\"128cd90f04b66a4cbc78bf48748f6eec0f08d5193ee8d0a6f2e8d3e5f138ed12c2c87d01a301000000085200ab6aac00ab00ffffffff09fc88bb1851e3dfb3d30179c38e15aeb1b39929c7c74f6acd071994ed4806490300000000e7fc5ea12ec56f56c0d758ecf4bb88aa95f3b08176b336db3b9bec2f6e27336dce28adbe030000000400530051fffffffffd6ff1adcf1fbe0d883451ee46904f1b7e8820243d395559b2d4ee8190a6e891000000000080fb1ae702f85b400000000000035200ab8d9651010000000006ab6a52536aab00000000\", \"ab\", 1, 1667598199, \"c10ccc9db8a92d7d4b133a2980782dab9d9d1d633d0dde9f9612ada57771fd89\"],\n\t[\"da9695a403493d3511c10e1fe1286f954db0366b7667c91ef18ae4578056c1bf752114ac5901000000035351519788d91dd1f9c62dc005d80ea54eb13f7131ca5aace3d5d29f9b58ccc5fbc9a27e779950010000000453ac6a00ffffffffe2556ff29ebe83eb42a32c7a8d93bc598043578f491b5935805a33608538845a030000000252ab65d21b3b018f26c4030000000006acab51535352e1cbcb10\", \"006565ab52\", 2, -1550927794, \"0ca673a1ee66f9625ceb9ab278ebef772c113c188112b02824570c17fdf48194\"],\n\t[\"b240517501334021240427adb0b413433641555424f6d24647211e3e6bfbb22a8045cbda2f000000000071bac8630112717802000000000000000000\", \"6a5165abac52656551\", 0, 1790414254, \"2c8be597620d95abd88f9c1cf4967c1ae3ca2309f3afec8928058c9598660e9e\"],\n\t[\"96bac43903044a199b4b3efeeec5d196ee23fb05495541fa2cd6fb6405a9432d1723363660010000000151ffffffffe6ce2b66ce1488918a3e880bebb0e750123f007c7bcbac8fcd67ce75cb6fbae80300000000ffffffff9c0955aa07f506455834895c0c56be5a095398f47c62a3d431fe125b161d666a0200000005520000abac7ffdbc540216f2f004000000000165a26dce010000000001ab00000000\", \"5151ab656a656a6a63\", 0, -707123065, \"26b22e18d5d9081fde9631594a4f7c49069ed2e429f3d08caf9d834f685ccab2\"],\n\t[\"b8fd394001ed255f49ad491fecc990b7f38688e9c837ccbc7714ddbbf5404f42524e68c18f0000000007ab6353535363ab081e15ee02706f7d050000000008515200535351526364c7ec040000000005636a53acac9206cbe1\", \"655352ac\", 0, -1251578838, \"8e0697d8cd8a9ccea837fd798cc6c5ed29f6fbd1892ee9bcb6c944772778af19\"],\n\t[\"e42a76740264677829e30ed610864160c7f97232c16528fe5610fc08814b21c34eefcea69d010000000653006a6a0052ffffffff647046cf44f217d040e6a8ff3f295312ab4dd5a0df231c66968ad1c6d8f4428000000000025352ffffffff0199a7f900000000000000000000\", \"655263006a005163\", 1, 1122505713, \"7cda43f1ff9191c646c56a4e29b1a8c6cb3f7b331da6883ef2f0480a515d0861\"],\n\t[\"0f034f32027a8e094119443aa9cfe11737c6d7dda9a52b839bc073dcc0235b847b28e0fab60200000006ac53ac536a63eee63447dfdad80476994b68706e916df1bd9d7cb4f3a4f6b14369de84564bea2e8688bd030000000565636a65acf8434663020b35fe01000000000800abab655163acabb3d6a103000000000353acab345eeda0\", \"526a51ac63ab51\", 1, 66020215, \"4435e62ff6531ac73529aac9cf878a7219e0b6e6cac79af8487c5355d1ad6d43\"],\n\t[\"a2dfa4690214c1ab25331815a5128f143219de51a47abdc7ce2d367e683eeb93960a31af9f010000000363636affffffff8be0628abb1861b078fcc19c236bc4cc726fa49068b88ad170adb2a97862e7460200000004ac655363ffffffff0441f11103000000000153dbab0c000000000009ab53ac5365526aab63abbb95050000000004ab52516a29a029040000000003ac526a00000000\", \"6a52ac63\", 1, -1302210567, \"913060c7454e6c80f5ba3835454b54db2188e37dc4ce72a16b37d11a430b3d23\"],\n\t[\"9dbc591f04521670af83fb3bb591c5d4da99206f5d38e020289f7db95414390dddbbeb56680100000004ac5100acffffffffb6a40b5e29d5e459f8e72d39f800089529f0889006cad3d734011991da8ef09d0100000009526a5100acab536a515fc427436df97cc51dc8497642ffc868857ee245314d28b356bd70adba671bd6071301fc0000000000ffffffff487efde2f620566a9b017b2e6e6d42525e4070f73a602f85c6dfd58304518db30000000005516353006a8d8090180244904a0200000000046a65656ab1e9c203000000000451ab63aba06a5449\", \"\", 0, -1414953913, \"bae189eb3d64aedbc28a6c28f6c0ccbd58472caaf0cf45a5aabae3e031dd1fea\"],\n\t[\"1345fb2c04bb21a35ae33a3f9f295bece34650308a9d8984a989dfe4c977790b0c21ff9a7f0000000006ac52ac6a0053ffffffff7baee9e8717d81d375a43b691e91579be53875350dfe23ba0058ea950029fcb7020000000753ab53ab63ab52ffffffff684b6b3828dfb4c8a92043b49b8cb15dd3a7c98b978da1d314dce5b9570dadd202000000086353ab6a5200ac63d1a8647bf667ceb2eae7ec75569ca249fbfd5d1b582acfbd7e1fcf5886121fca699c011d0100000003ac006affffffff049b1eb00300000000001e46dc0100000000080065ab6a6a630065ca95b40300000000030051520c8499010000000006ab6aac526a6500000000\", \"53526aac636300\", 2, 1809978100, \"cfeaa36790bc398783d4ca45e6354e1ea52ee74e005df7f9ebd10a680e9607bf\"],\n\t[\"7d75dc8f011e5f9f7313ba6aedef8dbe10d0a471aca88bbfc0c4a448ce424a2c5580cda1560300000003ab5152ffffffff01997f8e0200000000096552ac6a65656563530d93bbcc\", \"00656a6563\", 0, 1414485913, \"ec91eda1149f75bffb97612569a78855498c5d5386d473752a2c81454f297fa7\"],\n\t[\"1459179504b69f01c066e8ade5e124c748ae5652566b34ed673eea38568c483a5a4c4836ca0100000008ac5352006563656affffffff5d4e037880ab1975ce95ea378d2874dcd49d5e01e1cdbfae3343a01f383fa35800000000095251ac52ac6aac6500ffffffff7de3ae7d97373b7f2aeb4c55137b5e947b2d5fb325e892530cb589bc4f92abd503000000086563ac53ab520052ffffffffb4db36a32d6e543ef49f4bafde46053cb85b2a6c4f0e19fa0860d9083901a1190300000003ab51531bbcfe5504a6dbda040000000008536a5365abac6500d660c80300000000096565abab6a53536a6a54e84e010000000003acac52df2ccf0500000000025351220c857e\", \"\", 2, 1879181631, \"3aad18a209fab8db44954eb55fd3cc7689b5ec9c77373a4d5f4dae8f7ae58d14\"],\n\t[\"d98b777f04b1b3f4de16b07a05c31d79965579d0edda05600c118908d7cf642c9cd670093f020000000953005351ac65ab5363a268caad6733b7d1718008997f249e1375eb3ab9fe68ab0fe170d8e745ea24f54ce67f9b00000000066500516a5151ffffffff7ef8040dfcc86a0651f5907e8bfd1017c940f51cf8d57e3d3fe78d57e40b1e610200000003535263ffffffff39846cfed4babc098ff465256ba3820c30d710581316afcb67cd31c623b703360300000001acffffffff03d405120100000000056300006a5201a73d050000000004ab636a6a294c8c000000000006ac65536553ac00000000\", \"63525351abac\", 1, 2018694761, \"86970af23c89b72a4f9d6281e46b9ef5220816bed71ebf1ae20df53f38fe16ff\"],\n\t[\"cabb1b06045a895e6dcfc0c1e971e94130c46feace286759f69a16d298c8b0f6fd0afef8f20300000004ac006352ffffffffa299f5edac903072bfb7d29b663c1dd1345c2a33546a508ba5cf17aab911234602000000056a65515365ffffffff89a20dc2ee0524b361231092a070ace03343b162e7162479c96b757739c8394a0300000002abab92ec524daf73fabee63f95c1b79fa8b84e92d0e8bac57295e1d0adc55dc7af5534ebea410200000001534d70e79b04674f6f00000000000600abacab53517d60cc0200000000035265ab96c51d040000000004ac6300ac62a787050000000008006a516563ab63639e2e7ff7\", \"6551ac6351ac\", 3, 1942663262, \"d0c4a780e4e0bc22e2f231e23f01c9d536b09f6e5be51c123d218e906ec518be\"],\n\t[\"8b96d7a30132f6005b5bd33ea82aa325e2bcb441f46f63b5fca159ac7094499f380f6b7e2e00000000076aacabac6300acffffffff0158056700000000000465005100c319e6d0\", \"52006a\", 0, -1100733473, \"fb4bd26a91b5cf225dd3f170eb09bad0eac314bc1e74503cc2a3f376833f183e\"],\n\t[\"112191b7013cfbe18a175eaf09af7a43cbac2c396f3695bbe050e1e5f4250603056d60910e02000000001c8a5bba03738a22010000000005525352656a77a149010000000002510003b52302000000000351ac52722be8e6\", \"65ac6565\", 0, -1847972737, \"8e795aeef18f510d117dfa2b9f4a2bd2e2847a343205276cedd2ba14548fd63f\"],\n\t[\"ce6e1a9e04b4c746318424705ea69517e5e0343357d131ad55d071562d0b6ebfedafd6cb840100000003656553ffffffff67bd2fa78e2f52d9f8900c58b84c27ef9d7679f67a0a6f78645ce61b883fb8de000000000100d699a56b9861d99be2838e8504884af4d30b909b1911639dd0c5ad47c557a0773155d4d303000000046a5151abffffffff9fdb84b77c326921a8266854f7bbd5a71305b54385e747fe41af8a397e78b7fa010000000863acac6a51ab00ac0d2e9b9d049b8173010000000007ac53526a650063ba9b7e010000000008526a00525263acac0ab3fd030000000000ea8a0303000000000200aca61a97b9\", \"\", 1, -1276952681, \"b6ed4a3721be3c3c7305a5128c9d418efa58e419580cec0d83f133a93e3a22c5\"],\n\t[\"a7721d94021652d90c79aaf5022d98219337d50f836382403ed313adb1116ba507ac28b0b0010000000551ac6300ab89e6d64a7aa81fb9595368f04d1b36d7020e7adf5807535c80d015f994cce29554fe869b01000000065353ab636500ffffffff024944c90100000000046300635369df9f01000000000000000000\", \"656a536551ab\", 0, -1740151687, \"935892c6f02948f3b08bcd463b6acb769b02c1912be4450126768b055e8f183a\"],\n\t[\"2f7353dd02e395b0a4d16da0f7472db618857cd3de5b9e2789232952a9b154d249102245fd030000000151617fd88f103280b85b0a198198e438e7cab1a4c92ba58409709997cc7a65a619eb9eec3c0200000003636aabffffffff0397481c0200000000045300636a0dc97803000000000009d389030000000003ac6a53134007bb\", \"0000536552526a\", 0, -1912746174, \"30c4cd4bd6b291f7e9489cc4b4440a083f93a7664ea1f93e77a9597dab8ded9c\"],\n\t[\"7d95473604fd5267d0e1bb8c9b8be06d7e83ff18ad597e7a568a0aa033fa5b4e1e2b6f1007020000000465006a6affffffffaee008503bfc5708bd557c7e78d2eab4878216a9f19daa87555f175490c40aaf000000000263abffffffffabd74f0cff6e7ceb9acc2ee25e65af1abcebb50c08306e6c78fa8171c37613dd010000000552acacababffffffff54a3069393f7930fa1b331cdff0cb945ec21c11d4605d8eedba1d3e094c6ae1f01000000026300ffffffff0182edeb050000000009526353ab5153530065a247e8cd\", \"51516aab00\", 2, -426210430, \"2707ca714af09494bb4cf0794abe33c6cba5f29891d619e76070269d1fa8e690\"],\n\t[\"221d4718023d9ca9fe1af178dbfce02b2b369bf823ea3f43f00891b7fef98e215c06b94fdd000000000951005153ab000051acffffffffb1c7ad1c64b7441bf5e70cd0f6eb4ec96821d67fc4997d9e6dfdceadecd36dde01000000070051536a635153ffffffff04e883cd00000000000851ab536553ab0052bbb2f70400000000002f1b2e03000000000165259fcb00000000000010dbde99\", \"ab\", 1, 665721280, \"4abce77432a86dfe608e7c1646c18b5253a373392ff962e288e3ab96bba1ba1d\"],\n\t[\"6f66c0b3013e6ae6aabae9382a4326df31c981eac169b6bc4f746edaa7fc1f8c796ef4e374000000000665ab6aabac6affffffff0191c8d6030000000002525300000000\", \"6a5352516a635352ab\", 0, -1299629906, \"48411efeb133c6b7fec4e7bdbe613f827093cb06ea0dbcc2ffcfde3a9ac4356c\"],\n\t[\"89e7928c04363cb520eff4465251fd8e41550cbd0d2cdf18c456a0be3d634382abcfd4a2130200000006ac516a6a656355042a796061ed72db52ae47d1607b1ceef6ca6aea3b7eea48e7e02429f382b378c4e51901000000085351ab6352ab5252ffffffff53631cbda79b40183000d6ede011c778f70147dc6fa1aed3395d4ce9f7a8e69701000000096a6553ab52516a52abad0de418d80afe059aab5da73237e0beb60af4ac490c3394c12d66665d1bac13bdf29aa8000000000153f2b59ab6027a33eb040000000007005351ac5100ac88b941030000000003ab0052e1e8a143\", \"63656a\", 0, 1258533326, \"b575a04b0bb56e38bbf26e1a396a76b99fb09db01527651673a073a75f0a7a34\"],\n\t[\"ca356e2004bea08ec2dd2df203dc275765dc3f6073f55c46513a588a7abcc4cbde2ff011c7020000000553525100003aefec4860ef5d6c1c6be93e13bd2d2a40c6fb7361694136a7620b020ecbaca9413bcd2a030000000965ac00536352535100ace4289e00e97caaea741f2b89c1143060011a1f93090dc230bee3f05e34fbd8d8b6c399010000000365526affffffff48fc444238bda7a757cb6a98cb89fb44338829d3e24e46a60a36d4e24ba05d9002000000026a53ffffffff03d70b440200000000056a6a526aac853c97010000000002515335552202000000000351635300000000\", \"0052\", 3, -528192467, \"fc93cc056c70d5e033933d730965f36ad81ef64f1762e57f0bc5506c5b507e24\"],\n\t[\"82d4fa65017958d53e562fac073df233ab154bd0cf6e5a18f57f4badea8200b217975e31030200000004636aab51ac0891a204227cc9050000000006635200655365bfef8802000000000865650051635252acfc2d09050000000006ab65ac51516380195e030000000007ac52525352510063d50572\", \"53\", 0, -713567171, \"e095003ca82af89738c1863f0f5488ec56a96fb81ea7df334f9344fcb1d0cf40\"],\n\t[\"75f6949503e0e47dd70426ef32002d6cdb564a45abedc1575425a18a8828bf385fa8e808e600000000036aabab82f9fd14e9647d7a1b5284e6c55169c8bd228a7ea335987cef0195841e83da45ec28aa2e0300000002516350dc6fe239d150efdb1b51aa288fe85f9b9f741c72956c11d9dcd176889963d699abd63f0000000001ab429a63f502777d20010000000007abac52ac516a53d081d9020000000003acac630c3cc3a8\", \"535152516551510000\", 1, 973814968, \"c6ec1b7cb5c16a1bfd8a3790db227d2acc836300534564252b57bd66acf95092\"],\n\t[\"24f24cd90132b2162f938f1c22d3ca5e7daa83515883f31a61a5177aebf99d7db6bdfc398c010000000163ffffffff01d5562d0100000000016300000000\", \"5265ac5165ac5252ab\", 0, 1055129103, \"5eeb03e03806cd7bfd44bbba69c30f84c2c5120df9e68cd8facc605fcfbc9693\"],\n\t[\"5ff2cac201423064a4d87a96b88f1669b33adddc6fa9acdc840c0d8a243671e0e6de49a5b00300000005ac6353655353b91db50180db5a03000000000663535151006a047a3aff\", \"52ab51ab5365005163\", 0, -1336626596, \"b8db8d57fe40ab3a99cf2f8ed57da7a65050fcc1d34d4280e25faf10108d3110\"],\n\t[\"10011f150220ad76a50ccc7bb1a015eda0ff987e64cd447f84b0afb8dc3060bdae5b36a6900200000000ffffffff1e92dd814dfafa830187bc8e5b9258de2445ec07b02c420ee5181d0b203bb334000000000565ab536a65ffffffff0124e65401000000000800ab636553ab53ac00000000\", \"53abab0051\", 0, 440222748, \"c6675bf229737e005b5c8ffa6f81d9e2c4396840921b6151316f67c4315a4270\"],\n\t[\"8b95ec900456648d820a9b8df1d8f816db647df8a8dc9f6e7151ebf6079d90ee3f6861352a02000000085200ab00ac535151ffffffff039b10b845f961225ac0bcaac4f5fe1991029a051aa3d06a3811b5762977a67403000000035252abffffffff8559d65f40d5e261f45aec8aad3d2c56c6114b22b26f7ee54a06f0881be3a7f5010000000765635252536363ffffffff38f8b003b50f6412feb2322b06b270197f81ad69c36af02ca5008b94eee5f650020000000165ffffffff01ae2b00010000000001638eb153a2\", \"0053ab5300ac53\", 2, 1266056769, \"205f3653f0142b35ce3ef39625442efebae98cde8cbf0516b97b51073bb0479f\"],\n\t[\"babbb7ea01ab5d584727cb44393b17cf66521606dc81e25d85273be0d57bad43e8f6b6d43501000000036a656aba83a68803fb0f4a000000000005536353ab633fcfe4020000000009ac00acab6351006a65182a0c03000000000453ac5363bee74f44\", \"536a6a6a6365ac51ab\", 0, -799187625, \"3275e98dca37243b977525a07b5d8e369d6c3bdc08cb948029a635547d0d1a4e\"],\n\t[\"e86a24bc03e4fae784cdf81b24d120348cb5e52d937cd9055402fdba7e43281e482e77a1c100000000046363006affffffffa5447e9bdcdab22bd20d88b19795d4c8fb263fbbf7ce8f4f9a85f865953a6325020000000663ac53535253ffffffff9f8b693bc84e0101fc73748e0513a8cecdc264270d8a4ee1a1b6717607ee1eaa00000000026a513417bf980158d82c020000000009005253005351acac5200000000\", \"6353516365536a6a\", 2, -563792735, \"508129278ef07b43112ac32faf00170ad38a500eed97615a860fd58baaad174b\"],\n\t[\"53bd749603798ed78798ef0f1861b498fc61dcee2ee0f2b37cddb115b118e73bc6a5a47a0201000000096a63656a6aab6a000007ff674a0d74f8b4be9d2e8e654840e99d533263adbdd0cf083fa1d5dd38e44d2d163d900100000007abab5251ac6a51c8b6b63f744a9b9273ccfdd47ceb05d3be6400c1ed0f7283d32b34a7f4f0889cccf06be30000000009516a52636551ab516a9ac1fe63030c677e05000000000027bc610000000000086565636a635100526e2dc60200000000015300000000\", \"6552536a515351ab\", 1, -1617066878, \"fe516df92299e995b8e6489be824c6839543071ec5e9286060b2600935bf1f20\"],\n\t[\"691bf9fc028ca3099020b79184e70039cf53b3c7b3fe695d661fd62d7b433e65feda2150610000000003ac63abffffffff2c814c15b142bc944192bddccb90a392cd05b968b599c1d8cd99a55a28a243fd0100000009ab5300526a5200abac98516a5803dfd3540500000000046552ac522838120100000000040053ab6a4409a903000000000665636a5300658759621b\", \"65ac5165ab\", 0, -359941441, \"d582c442e0ecc400c7ba33a56c93ad9c8cfd45af820350a13623594b793486f0\"],\n\t[\"536bc5e60232eb60954587667d6bcdd19a49048d67a027383cc0c2a29a48b960dc38c5a0370300000005ac636300abffffffff8f1cfc102f39b1c9348a2195d496e602c77d9f57e0769dabde7eaaedf9c69e250100000006acabab6a6351ffffffff0432f56f0400000000046a5365517fd54b0400000000035265539484e4050000000003536a5376dc25020000000008ac536aab6aab536ab978e686\", \"ac0051006a006a006a\", 0, -273074082, \"f151f1ec305f698d9fdce18ea292b145a58d931f1518cf2a4c83484d9a429638\"],\n\t[\"74606eba01c2f98b86c29ba5a32dc7a7807c2abe6ed8d89435b3da875d87c12ae05329e6070200000003510052ffffffff02a1e2c4020000000006516563526a63c68bae04000000000952ab6363ab00006363fe19ae4f\", \"63ababacac5365\", 0, 112323400, \"d1b1d79001b4a0324962607b739972d6f39c1493c4500ce814fd3bd72d32a5a0\"],\n\t[\"2ed805e20399e52b5bcc9dc075dad5cf19049ff5d7f3de1a77aee9288e59c5f4986751483f020000000165ffffffff967531a5726e7a653a9db75bd3d5208fa3e2c5e6cd5970c4d3aba84eb644c72c0300000000ffffffffd79030d20c65e5f8d3c55b5692e5bdaa2ae78cfa1935a0282efb97515feac43f030000000400006365261ab88c02bdf66a000000000003ab6351d6ad8b000000000005525152abac00000000\", \"630053ab5265\", 0, 2072814938, \"1d25d16d84d5793be1ad5cda2de9c9cf70e04a66c3dae618f1a7ca4026198e7f\"],\n\t[\"fab796ee03f737f07669160d1f1c8bf0800041157e3ac7961fea33a293f976d79ce49c02ab0200000003ac5252eb097ea1a6d1a7ae9dace338505ba559e579a1ee98a2e9ad96f30696d6337adcda5a85f403000000096500abab656a6a656396d5d41a9b11f571d91e4242ddc0cf2420eca796ad4882ef1251e84e42b930398ec69dd80100000005526551ac6a8e5d0de804f763bb0400000000015288271a010000000001acf2bf2905000000000300ab51c9641500000000000952655363636365ac5100000000\", \"00ac536552\", 0, -1854521113, \"f3bbab70b759fe6cfae1bf349ce10716dbc64f6e9b32916904be4386eb461f1f\"],\n\t[\"f2b539a401e4e8402869d5e1502dbc3156dbce93583f516a4947b333260d5af1a34810c6a00200000003525363ffffffff01d305e2000000000005acab535200a265fe77\", \"\", 0, -1435650456, \"41617b27321a830c712638dbb156dae23d4ef181c7a06728ccbf3153ec53d7dd\"],\n\t[\"9f10b1d8033aee81ac04d84ceee0c03416a784d1017a2af8f8a34d2f56b767aea28ff88c8f02000000025352ffffffff748cb29843bea8e9c44ed5ff258df1faf55fbb9146870b8d76454786c4549de100000000016a5ba089417305424d05112c0ca445bc7107339083e7da15e430050d578f034ec0c589223b0200000007abac53ac6565abffffffff025a4ecd010000000006636563ab65ab40d2700000000000056a6553526333fa296c\", \"\", 0, -395044364, \"20fd0eee5b5716d6cbc0ddf852614b686e7a1534693570809f6719b6fcb0a626\"],\n\t[\"ab81755f02b325cbd2377acd416374806aa51482f9cc5c3b72991e64f459a25d0ddb52e66703000000036a00ab8727056d48c00cc6e6222be6608c721bc2b1e69d0ffbadd51d131f05ec54bcd83003aac5000000000003f2cdb60454630e020000000007526aac63000000e9e25c040000000003516a0088c97e0000000000076a535265655263771b5805000000000851ab00ac6565515100000000\", \"5151ab00ac\", 0, -230931127, \"ba0a2c987fcdd74b6915f6462f62c3f126a0750aa70048f7aa20f70726e6a20b\"],\n\t[\"7a17e0ef0378dab4c601240639139335da3b7d684600fa682f59b7346ef39386fe9abd69350000000004ac5252ab807f26fb3249326813e18260a603b9ad66f41f05eaa8146f66bcca452162a502aac4aa8b02000000026a534ea460faa7e3d7854ec6c70d7e797025697b547ec500b2c09c873b4d5517767d3f3720660300000000ffffffff01b12e7a02000000000900ab006aab65656a63991c03e2\", \"6aab6a\", 1, -1577994103, \"62cd3413d9d819fb7355336365cf8a2a997f7436cc050a7143972044343b3281\"],\n\t[\"ff2ecc09041b4cf5abb7b760e910b775268abee2792c7f21cc5301dd3fecc1b4233ee70a2c0200000009acac5300006a51526affffffffeb39c195a5426afff38379fc85369771e4933587218ef4968f3f05c51d6b7c92000000000165453a5f039b8dbef7c1ffdc70ac383b481f72f99f52b0b3a5903c825c45cfa5d2c0642cd50200000001654b5038e6c49daea8c0a9ac8611cfe904fc206dad03a41fb4e5b1d6d85b1ecad73ecd4c0102000000096a51000053ab656565bdb5548302cc719200000000000452655265214a3603000000000300ab6a00000000\", \"52516a006a63\", 1, -2113289251, \"37ed6fae36fcb3360c69cac8b359daa62230fc1419b2cf992a32d8f3e079dcff\"],\n\t[\"70a8577804e553e462a859375957db68cfdf724d68caeacf08995e80d7fa93db7ebc04519d02000000045352ab53619f4f2a428109c5fcf9fee634a2ab92f4a09dc01a5015e8ecb3fc0d9279c4a77fb27e900000000006ab6a51006a6affffffff3ed1a0a0d03f25c5e8d279bb5d931b7eb7e99c8203306a6c310db113419a69ad010000000565516300abffffffff6bf668d4ff5005ef73a1b0c51f32e8235e67ab31fe019bf131e1382050b39a630000000004536a6563ffffffff02faf0bb00000000000163cf2b4b05000000000752ac635363acac15ab369f\", \"ac\", 0, -1175809030, \"1c9d6816c20865849078f9777544b5ddf37c8620fe7bd1618e4b72fb72dddca1\"],\n\t[\"a3604e5304caa5a6ba3c257c20b45dcd468f2c732a8ca59016e77b6476ac741ce8b16ca8360200000004acac6553ffffffff695e7006495517e0b79bd4770f955040610e74d35f01e41c9932ab8ccfa3b55d0300000007ac5253515365acffffffff6153120efc5d73cd959d72566fc829a4eb00b3ef1a5bd3559677fb5aae116e38000000000400abab52c29e7abd06ff98372a3a06227386609adc7665a602e511cadcb06377cc6ac0b8f63d4fdb03000000055100acabacffffffff04209073050000000009ab5163ac525253ab6514462e05000000000952abacab636300656a20672c0400000000025153b276990000000000056565ab6a5300000000\", \"5351\", 0, 1460890590, \"249c4513a49076c6618aabf736dfd5ae2172be4311844a62cf313950b4ba94be\"],\n\t[\"c6a72ed403313b7d027f6864e705ec6b5fa52eb99169f8ea7cd884f5cdb830a150cebade870100000009ac63ab516565ab6a51ffffffff398d5838735ff43c390ca418593dbe43f3445ba69394a6d665b5dc3b4769b5d700000000075265acab515365ffffffff7ee5616a1ee105fd18189806a477300e2a9cf836bf8035464e8192a0d785eea3030000000700ac6a51516a52ffffffff018075fd0000000000015100000000\", \"005251acac5252\", 2, -656067295, \"2cc1c7514fdc512fd45ca7ba4f7be8a9fe6d3318328bc1a61ae6e7675047e654\"],\n\t[\"93c12cc30270fc4370c960665b8f774e07942a627c83e58e860e38bd6b0aa2cb7a2c1e060901000000036300abffffffff4d9b618035f9175f564837f733a2b108c0f462f28818093372eec070d9f0a5440300000001acffffffff039c2137020000000001525500990100000000055265ab636a07980e0300000000005ba0e9d1\", \"656a5100\", 1, 18954182, \"6beca0e0388f824ca33bf3589087a3c8ad0857f9fe7b7609ae3704bef0eb83e2\"],\n\t[\"97bddc63015f1767619d56598ad0eb5c7e9f880b24a928fea1e040e95429c930c1dc653bdb0100000008ac53acac00005152aaa94eb90235ed10040000000000287bdd0400000000016a8077673a\", \"acac6a536352655252\", 0, -813649781, \"5990b139451847343c9bb89cdba0e6daee6850b60e5b7ea505b04efba15f5d92\"],\n\t[\"cc3c9dd303637839fb727270261d8e9ddb8a21b7f6cbdcf07015ba1e5cf01dc3c3a327745d0300000000d2d7804fe20a9fca9659a0e49f258800304580499e8753046276062f69dbbde85d17cd2201000000096352536a520000acabffffffffbc75dfa9b5f81f3552e4143e08f485dfb97ae6187330e6cd6752de6c21bdfd21030000000600ab53650063ffffffff0313d0140400000000096565515253526aacac167f0a040000000008acab00535263536a9a52f8030000000006abab5151ab63f75b66f2\", \"6a635353636a65ac65\", 1, 377286607, \"dbc7935d718328d23d73f8a6dc4f53a267b8d4d9816d0091f33823bd1f0233e9\"],\n\t[\"236f91b702b8ffea3b890700b6f91af713480769dda5a085ae219c8737ebae90ff25915a3203000000056300ac6300811a6a10230f12c9faa28dae5be2ebe93f37c06a79e76214feba49bb017fb25305ff84eb020000000100ffffffff041e351703000000000351ac004ff53e050000000003ab53636c1460010000000000cb55f701000000000651520051ab0000000000\", \"acac636a6aac5300\", 0, 406448919, \"793a3d3c37f6494fab79ff10c16702de002f63e34be25dd8561f424b0ea938c4\"],\n\t[\"22e10d2003ab4ea9849a2801921113583b7c35c3710ff49a6003489395789a7cfb1e6051900100000006526a65535151ffffffff82f21e249ec60db33831d33b9ead0d56f6496db64337dcb7f1c3327c47729c4a020000000253abffffffff138f098f0e6a4cf51dc3e7a3b749f487d1ebde71b73b731d1d02ad1180ac7b8c02000000036563acda215011027a9484020000000007635165530000ac4bf6cb0400000000066aacabab65ab3ce3f32c\", \"ab0052ab\", 2, 1136359457, \"b5bd080bbcb8cd652f440484311d7a3cb6a973cd48f03c5c00fd6beb52dfc061\"],\n\t[\"c47d5ad60485cb2f7a825587b95ea665a593769191382852f3514a486d7a7a11d220b62c54000000000663655253acab8c3cf32b0285b040e50dcf6987ddf7c385b3665048ad2f9317b9e0c5ba0405d8fde4129b00000000095251ab00ac65635300ffffffff549fe963ee410d6435bb2ed3042a7c294d0c7382a83edefba8582a2064af3265000000000152fffffffff7737a85e0e94c2d19cd1cde47328ece04b3e33cd60f24a8a345da7f2a96a6d0000000000865ab6a0051656aab28ff30d5049613ea020000000005ac51000063f06df1050000000008ac63516aabac5153afef5901000000000700656500655253688bc00000000000086aab5352526a53521ff1d5ff\", \"51ac52\", 2, -1296011911, \"0c1fd44476ff28bf603ad4f306e8b6c7f0135a441dc3194a6f227cb54598642a\"],\n\t[\"0b43f122032f182366541e7ee18562eb5f39bc7a8e5e0d3c398f7e306e551cdef773941918030000000863006351ac51acabffffffffae586660c8ff43355b685dfa8676a370799865fbc4b641c5a962f0849a13d8250100000005abab63acabffffffff0b2b6b800d8e77807cf130de6286b237717957658443674df047a2ab18e413860100000008ab6aac655200ab63ffffffff04f1dbca03000000000800635253ab656a52a6eefd0300000000036365655d8ca90200000000005a0d530400000000015300000000\", \"65ac65acac\", 0, 351448685, \"86f26e23822afd1bdfc9fff92840fc1e60089f12f54439e3ab9e5167d0361dcf\"],\n\t[\"4b0ecc0c03ba35700d2a30a71f28e432ff6ac7e357533b49f4e97cf28f1071119ad6b97f3e0300000008acab516363ac63acffffffffcd6a2019d99b5c2d639ddca0b1aa5ea7c1326a071255ea226960bd88f45ca57d00000000085253655363005353ffffffffba257635191c9f216de3277be548cb5a2313114cb1a4c563b03b4ef6c0f4f7040300000001abda542edf0495cdc40100000000026353c049e903000000000752516a53ab65512b0f9304000000000963ab516aac65516552fa9ece050000000009acab6500005152530000000000\", \"65ab51525352510052\", 1, -1355414590, \"3cd85f84aae6d702436f3f9b8980adcc1f8f202e957759540a27da0a32fc6c87\"],\n\t[\"adaac0a803f66811346271c733036d6e0d45e15a9b602092e2e04ad93564f196e7f020b088000000000600526a636a00700ec3f9db07a3a6ce910bf318c7ec87a876e1f2a3366cc69f20cde09203b99c1cb9d15800000000050000ac636a4d0de554ebe95c6cc14faf5ff6361d1deba9474b8b0fd3b93c011cd96aec783abb3f36830200000005ab65005251ffffffff0464eb10050000000007520000ab6a65ab1beaa80300000000005a2f31050000000006526aab65ac52ba7db10000000000045251ab6a0cfb46e7\", \"ab0051ac52636a\", 1, -184733716, \"961ff413850336d3987c550404fc1d923266ca36cc9ffee7113edb3a9fea7f30\"],\n\t[\"af1c4ab301ec462f76ee69ba419b1b2557b7ded639f3442a3522d4f9170b2d6859765c3df402000000016affffffff01a5ca6c000000000008ab52536aab00005300000000\", \"6a6351\", 0, 110304602, \"e88ed2eea9143f2517b15c03db00767eb01a5ce12193b99b964a35700607e5f4\"],\n\t[\"0bfd34210451c92cdfa02125a62ba365448e11ff1db3fb8bc84f1c7e5615da40233a8cd368010000000252ac9a070cd88dec5cf9aed1eab10d19529720e12c52d3a21b92c6fdb589d056908e43ea910e0200000009ac516a52656a6a5165ffffffffc3edcca8d2f61f34a5296c405c5f6bc58276416c720c956ff277f1fb81541ddd00000000030063abffffffff811247905cdfc973d179c03014c01e37d44e78f087233444dfdce1d1389d97c302000000065163000063ab1724a26e02ca37c902000000000851ab53525352ac529012a90100000000085200525253535353fa32575b\", \"5352ac6351\", 1, -1087700448, \"b8f1e1f35e3e1368bd17008c756e59cced216b3c699bcd7bebdb5b6c8eec4697\"],\n\t[\"2c84c0640487a4a695751d3e4be48019dbaea85a6e854f796881697383ea455347d2b2769001000000055265526500ffffffff6aac176d8aa00778d496a7231eeb7d3334f20c512d3db1683276402100d98de5030000000700536a5263526ac1ee9ceb171c0c984ebaf12c234fd1487fbf3b3d73aa0756907f26837efba78d1bed33200300000001ab4d9e8ec0bed837cb929bbed76ee848959cec59de44bd7667b7631a744f880d5c71a20cfd0100000007005363515300abffffffff023753fb0000000000036565532d3873050000000009005152ab6a63acab5200000000\", \"ab650053ab\", 0, -877941183, \"c49af297dffe2d80deddf10ceea84b99f8554bd2d55bbdc34e449728c31f0835\"],\n\t[\"1f7e4b1b045d3efa6cd7a11d7873a8bab886c19bd11fcb6712f0948f2db3a7be76ff76c8f100000000095265ab6a0065ac5363ffffffffdaafcfa6029336c997680a541725190f09a6f6da21e54560eca4b5b8ae987da1000000000952ac52acac52515165ffffffff825a38d3b1e5bb4d10f33653ab3ab6882c7abdaec74460257d1528ce7be3f98e0100000007526a006a656a63c14adc8f04953a5d3d3f89237f38b857dd357713896d36215f7e8b77b11d98ea3cdc93df02000000015212484f6104bfafae0300000000025263a2b0120000000000056563ab00516c4d2605000000000653ac6500655301cc93030000000002acab14643b1f\", \"63acac53ab\", 0, 333824258, \"18da6ceb011cd36f15ad7dd6c55ef07e6f6ed48881ce3bb31416d3c290d9a0e9\"],\n\t[\"467a3e7602e6d1a7a531106791845ec3908a29b833598e41f610ef83d02a7da3a1900bf2960000000005ab6a636353ffffffff031db6dac6f0bafafe723b9199420217ad2c94221b6880654f2b35114f44b1df010000000965ab52636a63ac6352ffffffff02b3b95c0100000000026300703216030000000001ab3261c0aa\", \"6a\", 0, 2110869267, \"3078b1d1a7713c6d101c64afe35adfae0977a5ab4c7e07a0b170b041258adbf2\"],\n\t[\"8713bc4f01b411149d575ebae575f5dd7e456198d61d238695df459dd9b86c4e3b2734b62e0300000004abac6363ffffffff03b58049050000000002ac653c714c04000000000953656a005151526a527b5a9e03000000000652ac5100525300000000\", \"52\", 0, -647281251, \"0e0bed1bf2ff255aef6e5c587f879ae0be6222ab33bd75ee365ec6fbb8acbe38\"],\n\t[\"f2ba8a8701b9c401efe3dd0695d655e20532b90ac0142768cee4a3bb0a89646758f544aa8102000000036a52527899f4e4040c6f0b030000000008636565ab530051ab52b60c000000000009515200ab630053ac53a49c5f040000000008ab53ab516300ab63fa27340300000000015100000000\", \"ac63abab5251\", 0, -1328936437, \"ab61497afd39e61fe06bc5677326919716f9b20083c9f3417dcea905090e0411\"],\n\t[\"b5a7df6102107beded33ae7f1dec0531d4829dff7477260925aa2cba54119b7a07d92d5a1d02000000046a516a52803b625c334c1d2107a326538a3db92c6c6ae3f7c3516cd90a09b619ec6f58d10e77bd6703000000056563006a63ffffffff0117484b03000000000853acab52526a65abc1b548a1\", \"ac006a525100\", 0, 2074359913, \"680336db57347d8183b8898cd27a83f1ba5884155aeae5ce20b4840b75e12871\"],\n\t[\"278cb16204b9dadf400266106392c4aa9df01ba03af988c8139dae4c1818ac009f13fc5f1a00000000065200ac656a52ffffffffd006bbebd8cbd7bdead24cddc9badfcc6bc0c2e63c037e5c29aa858f5d0f3e7d01000000046a0051acffffffffbc62a5f57e58da0b67956003ae81ac97cb4cbd1d694c914fc41515c008c4d8fd020000000165e329c844bcc16164be64b64a81cbf4ffd41ed2934e0daa0040ccb8365bab0b2a9e401c180300000003ab52abffffffff02588460030000000000a25a12030000000005535100005300000000\", \"6553ab6a5300acab51\", 3, 989407546, \"1c29f110576f4a3b257f67454d99dfc0dee62ef5517ca702848ce4bd2ea1a1d7\"],\n\t[\"49eb2178020a04fca08612c34959fd41447319c190fb7ffed9f71c235aa77bec28703aa1820200000003ac6353abaff326071f07ec6b77fb651af06e8e8bd171068ec96b52ed584de1d71437fed186aecf0300000001acffffffff03da3dbe02000000000652ac63ac6aab8f3b680400000000096a536a65636a53516a5175470100000000016500000000\", \"6a536365\", 0, 1283691249, \"c670219a93234929f662ecb9aa148a85a2d281e83f4e53d10509461cdea47979\"],\n\t[\"0f96cea9019b4b3233c0485d5b1bad770c246fe8d4a58fb24c3b7dfdb3b0fd90ea4e8e947f0300000006006a5163515303571e1e01906956030000000005ab635353abadc0fbbe\", \"acac\", 0, -1491469027, \"716a8180e417228f769dcb49e0491e3fda63badf3d5ea0ceeac7970d483dd7e2\"],\n\t[\"9a7d858604577171f5fe3f3fd3e5e039c4b0a06717a5381e9977d80e9f53e025e0f16d2877020000000752636565536353ffffffff5862bd028e8276e63f044be1dddcbb8d0c3fa097678308abf2b0f45104a93dbd0100000001531200667ba8fdd3b28e98a35da73d3ddfe51e210303d8eb580f923de988ee632d77793892030000000752526363526563ffffffffe9744eb44db2658f120847c77f47786d268c302120d269e6004455aa3ea5f5e20200000009ab6300636aab656551ffffffff03c61a3c020000000009ab516a6aab6aab53ab737f1a05000000000853acabab655365ab92a4a00400000000016367edf6c8\", \"535352ab\", 3, 659348595, \"d36ee79fc80db2e63e05cdc50357d186181b40ae20e3720878284228a13ee8b3\"],\n\t[\"148e68480196eb52529af8e83e14127cbfdbd4a174e60a86ac2d86eac9665f46f4447cf7aa01000000045200ac538f8f871401cf240c0300000000065252ab52656a5266cf61\", \"\", 0, -344314825, \"eacc47c5a53734d6ae3aedbc6a7c0a75a1565310851b29ef0342dc4745ceb607\"],\n\t[\"e2bc29d4013660631ba14ecf75c60ec5e9bed7237524d8c10f66d0675daa66d1492cb834530200000004ac510065e42d0c9e04f2b26c01000000000951525152acac65ababa35b7504000000000953ac6aac00650053ab94688c0400000000056365526553a1bced0300000000016a00000000\", \"65ab0063655353\", 0, -888431789, \"59a34b3ed3a1cce0b104de8f7d733f2d386ffc7445efae67680cd90bc915f7e0\"],\n\t[\"0c8a70d70494dca6ab05b2bc941b5b431c43a292bd8f2f02eab5e240a408ca73a676044a4103000000056a51ab006affffffff84496004e54836c035821f14439149f22e1db834f315b24588ba2f031511926c0100000000ffffffffbbc5e70ed1c3060ba1bfe99c1656a3158a7307c3ce8eb362ec32c668596d2bd30000000009636563635351abab00b039344c6fc4f9bec24322e45407af271b2d3dfec5f259ee2fc7227bc5285e22b3be85b40100000009ac00ab53abac6a5352e5ddfcff02d50231020000000005006a51536ab086d9020000000006ababac51ac6a00000000\", \"abab636565acac6a\", 3, 241546088, \"643a7b4c8d832e14d5c10762e74ec84f2c3f7ed96c03053157f1bed226614911\"],\n\t[\"f98f79cf0274b745e1d6f36da7cbe205a79132a7ad462bdc434cfb1dcd62a6977c3d2a5dbc010000000553516a5365ffffffff4f89f485b53cdad7fb80cc1b7e314b9735b9383bc92c1248bb0e5c6173a55c0d010000000353655293f9b014045ad96d02000000000963ac526a53ac636365f4c27904000000000952536563635152526a2788f0030000000002516aff5add01000000000863530051655351abd04716ba\", \"ab6552536a53\", 1, -2128899945, \"56d29f5e300ddfed2cd8dcce5d79826e193981d0b70dc7487772c8a0b3b8d7b1\"],\n\t[\"6c7913f902aa3f5f939dd1615114ce961beda7c1e0dd195be36a2f0d9d047c28ac62738c3a020000000453abac00ffffffff477bf2c5b5c6733881447ac1ecaff3a6f80d7016eee3513f382ad7f554015b970100000007ab6563acab5152ffffffff04e58fe1040000000009ab00526aabab526553e59790010000000002ab525a834b03000000000035fdaf0200000000086551ac65515200ab00000000\", \"63ac53\", 1, 1285478169, \"1536da582a0b6de017862445e91ba14181bd6bf953f4de2f46b040d351a747c9\"],\n\t[\"4624aa9204584f06a8a325c84e3b108cafb97a387af62dc9eab9afd85ae5e2c71e593a3b690200000003636a005eb2b44eabbaeca6257c442fea00107c80e32e8715a1293cc164a42e62ce14fea146220c020000000090b9ee38106e3310037bfc519fd209bdbd21c588522a0e96df5fba4e979392bc993bfe9f01000000086363636a635353ab6f1907d218ef6f3c729d9200e23c1dbff2df58b8b1282c6717b26cf760ee4c880d23f4d100000000086a516a536a525163ffffffff01d6f162050000000000ebbab208\", \"525365ab0053\", 1, -1515409325, \"6cf9cd409b7185b1f118171f0a34217af5b612ea54195ea186505b667c19337f\"],\n\t[\"16562fc503f1cf9113987040c408bfd4523f1512da699a2ca6ba122dc65677a4c9bf7763830000000003636552ffffffff1ec1fab5ff099d1c8e6b068156f4e39b5543286bab53c6d61e2582d1e07c96cf02000000045163656affffffffd0ef40003524d54c08cb4d13a5ee61c84fbb28cde9eca7a6d11ba3a9335d8c620100000007635153536a6300fbb84fc2012003a601000000000363ab6a00000000\", \"63636a006a6aab\", 0, -1310262675, \"1efbf3d37a92bc03d9eb950b792f307e95504f7c4998f668aa250707ebb752ac\"],\n\t[\"531665d701f86bacbdb881c317ef60d9cd1baeffb2475e57d3b282cd9225e2a3bf9cbe0ded01000000086300ac515263acabffffffff0453a8500100000000086353acab516a6565e5e9200500000000026a52a44caa00000000000453ac000065e41b0500000000076500ac0065526ab4476f4d\", \"006563006aab00636a\", 0, 1770013777, \"0898b26dd3ca08632a5131fa48eb55b44386d0c5070c24d6e329673d5e3693b8\"],\n\t[\"0f1227a20140655a3da36e413b9b5d108a866f6f147eb4940f032f5a89854eae6d7c3a91600100000009525363515153515253e37a79480161ab61020000000001ab00000000\", \"ab65005200\", 0, -1996383599, \"979782dc3f36d908d37d7e4046a38d306b4b08ddc60a5eba355fe3d6da1b29a9\"],\n\t[\"063ff6eb01aff98d0d2a6db224475010edb634c2f3b46257084676adeb84165a4ff8558d7601000000066353006a5165deb3262c042d109c0000000000076363ab52ac005200b9c4050000000007516300ac510063cfffc800000000000200639e815501000000000700526a52ac6365ac7b07b8\", \"656552abac6500\", 0, -1559847112, \"674a4bcb04247f8dc98780f1792cac86b8aee41a800fc1e6f5032f6e1dccde65\"],\n\t[\"3320f6730132f830c4681d0cae542188e4177cad5d526fae84565c60ceb5c0118e844f90bd030000000163ffffffff0257ec5a040000000005525251ac6538344d000000000002515200000000\", \"5352656a53ac516a65\", 0, 788050308, \"3afacaca0ef6be9d39e71d7b1b118994f99e4ea5973c9107ca687d28d8eba485\"],\n\t[\"c13aa4b702eedd7cde09d0416e649a890d40e675aa9b5b6d6912686e20e9b9e10dbd40abb1000000000863ab6353515351ac11d24dc4cc22ded7cdbc13edd3f87bd4b226eda3e4408853a57bcd1becf2df2a1671fd1600000000045165516affffffff01baea300100000000076aab52ab53005300000000\", \"0065\", 0, -1195908377, \"241a23e7b1982d5f78917ed97a8678087acbbffe7f624b81df78a5fe5e41e754\"],\n\t[\"d9a6f20e019dd1b5fae897fb472843903f9c3c2293a0ffb59cff2b413bae6eceab574aaf9d030000000663ab006a515102f54939032df5100100000000056a51ab65530ec28f010000000004ac5100007e874905000000000651005265ac6a00000000\", \"abacab63acacabab\", 0, 271463254, \"1326a46f4c21e7619f30a992719a905aa1632aaf481a57e1cbd7d7c22139b41e\"],\n\t[\"157c81bf0490432b3fcb3f9a5b79e5f91f67f05efb89fa1c8740a3fe7e9bdc18d7cb6acd2203000000026351ffffffff912e48e72bbcf8a540b693cf8b028e532a950e6e63a28801f6eaad1afcc52ad00000000000b1a4b170a2b9e60e0cad88a0085137309f6807d25d5afb5c1e1d32aa10ba1cdf7df596dd0000000009525165656a51ab65ab3674fba32a76fe09b273618d5f14124465933f4190ba4e0fd09d838daafc6223b31642ac00000000086a53536551ac6565ffffffff01fe9fb6030000000008ab51656a5165636a00000000\", \"ab00ab6a6551\", 3, -64357617, \"1ddaab7f973551d71f16bd70c4c4edbf7225e64e784a6da0ee7f7a9fe4f12a0b\"],\n\t[\"a2692fff03b2387f5bacd5640c86ba7df574a0ee9ed7f66f22c73cccaef3907eae791cbd230200000004536363abffffffff4d9fe7e5b375de88ba48925d9b2005447a69ea2e00495a96eafb2f144ad475b40000000008000053000052636537259bee3cedd3dcc07c8f423739690c590dc195274a7d398fa196af37f3e9b4a1413f810000000006ac63acac52abffffffff04c65fe60200000000075151536365ab657236fc020000000009005263ab00656a6a5195b8b6030000000007ac5165636aac6a7d7b66010000000002acab00000000\", \"51\", 2, -826546582, \"925037c7dc7625f3f12dc83904755a37016560de8e1cdd153c88270a7201cf15\"],\n\t[\"2c5b003201b88654ac2d02ff6762446cb5a4af77586f05e65ee5d54680cea13291efcf930d0100000005ab536a006a37423d2504100367000000000004536a515335149800000000000152166aeb03000000000452510063226c8e03000000000000000000\", \"635251\", 0, 1060344799, \"7e058ca5dd07640e4aae7dea731cfb7d7fef1bfd0d6d7b6ce109d041f4ca2a31\"],\n\t[\"f981b9e104acb93b9a7e2375080f3ea0e7a94ce54cd8fb25c57992fa8042bdf4378572859f0100000002630008604febba7e4837da77084d5d1b81965e0ea0deb6d61278b6be8627b0d9a2ecd7aeb06a0300000005ac5353536a42af3ef15ce7a2cd60482fc0d191c4236e66b4b48c9018d7dbe4db820f5925aad0e8b52a0300000008ab0063510052516301863715efc8608bf69c0343f18fb81a8b0c720898a3563eca8fe630736c0440a179129d03000000086aac6a52ac6a63ac44fec4c00408320a03000000000062c21c030000000007ac6a655263006553835f0100000000015303cd60000000000005535263536558b596e0\", \"00\", 0, -2140385880, \"49870a961263354c9baf108c6979b28261f99b374e97605baa532d9fa3848797\"],\n\t[\"e7416df901269b7af14a13d9d0507709b3cd751f586ce9d5da8d16a121e1bd481f5a086e1103000000056aab005200ffffffff01aa269c040000000006acac6a6a5263ee718de6\", \"ab525363\", 0, 1309186551, \"eea7d2212bda2d408fff146f9ae5e85e6b640a93b9362622bb9d5e6e36798389\"],\n\t[\"402a815902193073625ab13d876190d1bbb72aecb0ea733c3330f2a4c2fe6146f322d8843a0300000008656aab0000535363fffffffff9dccdec5d8509d9297d26dfcb1e789cf02236c77dc4b90ebccbf94d1b5821150300000001510bf1f96a03c5c145000000000002ac6ae11b1c0100000000055163516a5239c8a600000000000365636300000000\", \"63536aacab\", 0, -1811424955, \"0090803a20102a778ab967a74532faee13e03b702083b090b1497bc2267ee2fe\"],\n\t[\"c4b702e502f1a54f235224f0e6de961d2e53b506ab45b9a40805d1dacd35148f0acf24ca5e00000000085200ac65ac53acabf34ba6099135658460de9d9b433b84a8562032723635baf21ca1db561dce1c13a06f4407000000000851ac006a63516aabffffffff02a853a603000000000163d17a67030000000005ab63006a5200000000\", \"ac5363515153\", 1, 480734903, \"5c46f7ac3d6460af0da28468fcc5b3c87f2b9093d0f837954b7c8174b4d7b6e7\"],\n\t[\"9b83f78704f492b9b353a3faad8d93f688e885030c274856e4037818848b99e490afef27770200000000ffffffff36b60675a5888c0ef4d9e11744ecd90d9fe9e6d8abb4cff5666c898fdce98d9e00000000056aab656352596370fca7a7c139752971e169a1af3e67d7656fc4fc7fd3b98408e607c2f2c836c9f27c030000000653ac51ab6300a0761de7e158947f401b3595b7dc0fe7b75fa9c833d13f1af57b9206e4012de0c41b8124030000000953656a53ab53510052242e5f5601bf83b301000000000465516a6300000000\", \"63515200ac656365\", 3, -150879312, \"9cf05990421ea853782e4a2c67118e03434629e7d52ab3f1d55c37cf7d72cdc4\"],\n\t[\"f492a9da04f80b679708c01224f68203d5ea2668b1f442ebba16b1aa4301d2fe5b4e2568f3010000000953005351525263ab65ffffffff93b34c3f37d4a66df255b514419105b56d7d60c24bf395415eda3d3d8aa5cd0101000000020065ffffffff9dba34dabdc4f1643b372b6b77fdf2b482b33ed425914bb4b1a61e4fad33cf390000000002ab52ffffffffbbf3dc82f397ef3ee902c5146c8a80d9a1344fa6e38b7abce0f157be7adaefae0000000009515351005365006a51ffffffff021359ba010000000000403fea0200000000095200ac6353abac635300000000\", \"00ac51acacac\", 0, -2115078404, \"fd44fc98639ca32c927929196fc3f3594578f4c4bd248156a25c04a65bf3a9f3\"],\n\t[\"2f73e0b304f154d3a00fde2fdd40e791295e28d6cb76af9c0fd8547acf3771a02e3a92ba37030000000852ac6351ab6565639aa95467b065cec61b6e7dc4d6192b5536a7c569315fb43f470078b31ed22a55dab8265f02000000080065636a6aab6a53ffffffff9e3addbff52b2aaf9fe49c67017395198a9b71f0aa668c5cb354d06c295a691a0100000000ffffffff45c2b4019abaf05c5e484df982a4a07459204d1343a6ee5badade358141f8f990300000007ac516a6aacac6308655cd601f3bc2f0000000000015200000000\", \"\", 0, -2082053939, \"9a95e692e1f78efd3e46bb98f178a1e3a0ef60bd0301d9f064c0e5703dc879c2\"],\n\t[\"5a60b9b503553f3c099f775db56af3456330f1e44e67355c4ab290d22764b9144a7b5f959003000000030052acbd63e0564decc8659aa53868be48c1bfcda0a8c9857b0db32a217bc8b46d9e7323fe9649020000000553ac6551abd0ecf806211db989bead96c09c7f3ec5f73c1411d3329d47d12f9e46678f09bac0dc383e0200000000ffffffff01494bb202000000000500516551ac00000000\", \"ac\", 0, 1169947809, \"62a36c6e8da037202fa8aeae03e533665376d5a4e0a854fc4624a75ec52e4eb1\"],\n\t[\"7e98d353045569c52347ca0ff2fdba608829e744f61eb779ffdb5830aae0e6d6857ab2690e03000000075365acab656352ffffffffa890dd37818776d12da8dca53d02d243ef23b4535c67016f4c58103eed85360f030000000093dbacdc25ca65d2951e047d6102c4a7da5e37f3d5e3c8b87c29b489360725dcd117ee2003000000056a6300ac53c7e99fa1dc2b8b51733034e6555f6d6de47dbbf1026effac7db80cb2080678687380dc1e02000000075352005263516affffffff04423272040000000008ab6353ab65510051e0f53b0500000000086300516552635152f74a5f04000000000853acab0053ab52ab0e8e5f00000000000951ac5363516a6aabab00000000\", \"6a5163ab52\", 3, 890006103, \"476868cecd1763c91dade98f17defa42d31049547df45acffa1cc5ae5c3d75d6\"],\n\t[\"e3649aa40405e6ffe377dbb1bbbb672a40d8424c430fa6512c6165273a2b9b6afa9949ec430200000007630052ab655153a365f62f2792fa90c784efe3f0981134d72aac0b1e1578097132c7f0406671457c332b84020000000353ab6ad780f40cf51be22bb4ff755434779c7f1def4999e4f289d2bd23d142f36b66fbe5cfbb4b01000000076a5252abac52ab1430ffdc67127c9c0fc97dcd4b578dab64f4fb9550d2b59d599773962077a563e8b6732c02000000016affffffff04cb2687000000000002ab636e320904000000000252acf70e9401000000000100dc3393050000000006ab0063536aacbc231765\", \"65520053\", 3, -2016196547, \"f64f805f0ff7f237359fa6b0e58085f3c766d1859003332223444fd29144112a\"],\n\t[\"1d033569040700441686672832b531ab55db89b50dc1f9fc00fb72218b652da9dcfbc83be901000000066551ac526a632b390f9ad068e5fdee6563e88e2a8e4e09763c861072713dc069893dc6bbc9db3f00e26502000000096a5363526565525252ffffffff8a36bdd0aaf38f6707592d203e14476ca9f259021e487135c7e8324244057ed90300000000ed3fb2a3dfd4d46b5f3603fe0148653911988457bd0ed7f742b07c452f5476c228ff9f600200000007526aac00525152ffffffff04b88e48030000000000c753d602000000000853510000006553518fda2603000000000853ac52acac5263534839f1030000000006ac006aacac5300000000\", \"516553635300ab0052\", 1, 2075958316, \"c2cefaec2293134acbcf6d2a8bf2b3eb42e4ec04ee8f8bf30ff23e65680677c1\"],\n\t[\"4c4be7540344050e3044f0f1d628039a334a7c1f7b4573469cfea46101d6888bb6161fe9710200000000ffffffffac85a4fdad641d8e28523f78cf5b0f4dc74e6c5d903c10b358dd13a5a1fd8a06000000000163e0ae75d05616b72467b691dc207fe2e65ea35e2eadb7e06ea442b2adb9715f212c0924f10200000000ffffffff0194ddfe02000000000265ac00000000\", \"00006500\", 1, -479922562, \"d66924d49f03a6960d3ca479f3415d638c45889ce9ab05e25b65ac260b51d634\"],\n\t[\"202c18eb012bc0a987e69e205aea63f0f0c089f96dd8f0e9fcde199f2f37892b1d4e6da90302000000055352ac6565ffffffff0257e5450100000000025300ad257203000000000000000000\", \"520052ac6a005265\", 0, 168054797, \"502967a6f999f7ee25610a443caf8653dda288e6d644a77537bcc115a8a29894\"],\n\t[\"32fa0b0804e6ea101e137665a041cc2350b794e59bf42d9b09088b01cde806ec1bbea077df0200000008515153650000006506a11c55904258fa418e57b88b12724b81153260d3f4c9f080439789a391ab147aabb0fa0000000007000052ac51ab510986f2a15c0d5e05d20dc876dd2dafa435276d53da7b47c393f20900e55f163b97ce0b800000000008ab526a520065636a8087df7d4d9c985fb42308fb09dce704650719140aa6050e8955fa5d2ea46b464a333f870000000009636300636a6565006affffffff01994a0d040000000002536500000000\", \"516563530065\", 2, -163068286, \"f58637277d2bc42e18358dc55f7e87e7043f5e33f4ce1fc974e715ef0d3d1c2a\"],\n\t[\"ae23424d040cd884ebfb9a815d8f17176980ab8015285e03fdde899449f4ae71e04275e9a80100000007ab006553530053ffffffff018e06db6af519dadc5280c07791c0fd33251500955e43fe4ac747a4df5c54df020000000251ac330e977c0fec6149a1768e0d312fdb53ed9953a3737d7b5d06aad4d86e9970346a4feeb5030000000951ab51ac6563ab526a67cabc431ee3d8111224d5ecdbb7d717aa8fe82ce4a63842c9bd1aa848f111910e5ae1eb0100000004ac515300bfb7e0d7048acddc030000000009636a5253636a655363a3428e040000000001525b99c6050000000004655265ab717e6e020000000000d99011eb\", \"ac6a6a516565\", 1, -716251549, \"b098eb9aff1bbd375c70a0cbb9497882ab51f3abfebbf4e1f8d74c0739dc7717\"],\n\t[\"030f44fc01b4a9267335a95677bd190c1c12655e64df74addc53b753641259af1a54146baa020000000152e004b56c04ba11780300000000026a53f125f001000000000251acd2cc7c03000000000763536563655363c9b9e50500000000015200000000\", \"ac\", 0, -1351818298, \"19dd32190ed2a37be22f0224a9b55b91e37290577c6c346d36d32774db0219a3\"],\n\t[\"c05f448f02817740b30652c5681a3b128322f9dc97d166bd4402d39c37c0b14506d8adb5890300000003536353ffffffffa188b430357055ba291c648f951cd2f9b28a2e76353bef391b71a889ba68d5fc02000000056565526a6affffffff02745f73010000000001ab3ec34c0400000000036aac5200000000\", \"516551510053\", 0, -267877178, \"3a1c6742d4c374f061b1ebe330b1e169a113a19792a1fdde979b53e094cc4a3c\"],\n\t[\"163ba45703dd8c2c5a1c1f8b806afdc710a2a8fc40c0138e2d83e329e0e02a9b6c837ff6b8000000000700655151ab6a522b48b8f134eb1a7e6f5a6fa319ce9d11b36327ba427b7d65ead3b4a6a69f85cda8bbcd22030000000563656552acffffffffdbcf4955232bd11eef0cc6954f3f6279675b2956b9bcc24f08c360894027a60201000000066500006500abffffffff04d0ce9d0200000000008380650000000000015233f360040000000003006aabedcf0801000000000000000000\", \"000065006500ac\", 0, 216965323, \"9afe3f4978df6a86e9a8ebd62ef6a9d48a2203f02629349f1864ef2b8b92fd55\"],\n\t[\"07f7f5530453a12ad0c7eb8fbc3f140c7ab6818144d67d2d8752600ca5d9a9358e2dff87d4000000000663526aab526a9e599c379d455e2da36d0cde88d931a863a3e97e01e93b9edb65856f3d958dc08b92b720000000000165bbc8d66dae3b1b170a6e2457f5b161465cb8706e0e6ffc6af55deb918365f14c5f40d4890100000000a7bd77c069ee4b48638e2363fcf2a86b02bea022047bd9fcb16d2b94ad068308d19b31cb00000000066aab5300ab529672aa8f01dbd8a205000000000663536353006a02e99901\", \"ac006351006a63ab63\", 1, 119789359, \"6629a1e75c6ae8f4f9d5f734246b6a71682a5ea57246040ef0584f6b97916175\"],\n\t[\"fe647f950311bf8f3a4d90afd7517df306e04a344d2b2a2fea368935faf11fa6882505890d0000000005ab5100516affffffff43c140947d9778718919c49c0535667fc6cc727f5876851cb8f7b6460710c7f60100000000ffffffffce4aa5d90d7ab93cbec2e9626a435afcf2a68dd693c15b0e1ece81a9fcbe025e0300000000ffffffff02f34806020000000002515262e54403000000000965635151ac655363636de5ce24\", \"6a005100ac516351\", 2, 989643518, \"818a7ceaf963f52b5c48a7f01681ac6653c26b63a9f491856f090d9d60f2ffe3\"],\n\t[\"a1050f8604d0f9d2feefcdb5051ae0052f38e21bf39daf583fd0c3900faa3eab5d431c0bbe030000000653536a005151683d27e5c6e0da8f22125823f32d5d98477d8098ef36263b9694d61d4d85d3f2ac02b7570200000007000052005165abffffffff0cad981542bcb54a87d9400aa63e514c7c6fab7158c2b1fb37821ea755eb162a0200000000b94feb5100e5ef3bf8ed8d43356c8a8d5ac6c7e80d7ff6040f4f0aa19abbe783f4f461240200000007636500000052655686fd70042be3ad02000000000465ab636a15680b000000000004acac53511277c705000000000452635252d27a0102000000000000000000\", \"6a6aacab65655251\", 1, -982144648, \"dfcf484111801989eb6df8dc2bafb944d7365ffeb36a575a08f3270d3ef24c9f\"],\n\t[\"cef7316804c3e77fe67fc6207a1ea6ae6eb06b3bf1b3a4010a45ae5c7ad677bb8a4ebd16d90200000009ac536a5152ac5263005301ab8a0da2b3e0654d31a30264f9356ba1851c820a403be2948d35cafc7f9fe67a06960300000006526a63636a53ffffffffbada0d85465199fa4232c6e4222df790470c5b7afd54704595a48eedd7a4916b030000000865ab63ac006a006ab28dba4ad55e58b5375053f78b8cdf4879f723ea4068aed3dd4138766cb4d80aab0aff3d0300000003ac6a00ffffffff010f5dd6010000000006ab006aab51ab00000000\", \"\", 1, 889284257, \"d0f32a6db43378af84b063a6706d614e2d647031cf066997c48c04de3b493a94\"],\n\t[\"7b3ff28004ba3c7590ed6e36f45453ebb3f16636fe716acb2418bb2963df596a50ed954d2e03000000065251515265abffffffff706ee16e32e22179400c9841013971645dabf63a3a6d2d5feb42f83aa468983e030000000653ac51ac5152ffffffffa03a16e5e5de65dfa848b9a64ee8bf8656cc1f96b06a15d35bd5f3d32629876e020000000043c1a3965448b3b46f0f0689f1368f3b2981208a368ec5c30defb35595ef9cf95ffd10e902000000036aac65253a5bbe042e907204000000000800006565656352634203b4020000000002656336b3b7010000000001ab7a063f0100000000026500a233cb76\", \"006551636a53ac5251\", 1, -1144216171, \"68c7bd717b399b1ee33a6562a916825a2fed3019cdf4920418bb72ffd7403c8c\"],\n\t[\"d5c1b16f0248c60a3ddccf7ebd1b3f260360bbdf2230577d1c236891a1993725e262e1b6cb000000000363636affffffff0a32362cfe68d25b243a015fc9aa172ea9c6b087c9e231474bb01824fd6bd8bc0300000005ab52ab516affffffff0420d9a70200000000045152656a45765d0000000000055252536a5277bad100000000000252ab3f3f3803000000000463acac5200000000\", \"52636a52ab65\", 1, 1305123906, \"978dc178ecd03d403b048213d904653979d11c51730381c96c4208e3ea24243a\"],\n\t[\"1be8ee5604a9937ebecffc832155d9ba7860d0ca451eaced58ca3688945a31d93420c27c460100000006abac5300535288b65458af2f17cbbf7c5fbcdcfb334ffd84c1510d5500dc7d25a43c36679b702e850f7c0200000003005300ffffffff7c237281cb859653eb5bb0a66dbb7aeb2ac11d99ba9ed0f12c766a8ae2a2157203000000086aabac526365acabfffffffff09d3d6639849f442a6a52ad10a5d0e4cb1f4a6b22a98a8f442f60280c9e5be80200000007ab00ab6565ab52ffffffff0398fe83030000000005526aababacbdd6ec010000000005535252ab6a82c1e6040000000001652b71c40c\", \"6563526353656351\", 2, -853634888, \"0d936cceda2f56c7bb87d90a7b508f6208577014ff280910a710580357df25f3\"],\n\t[\"9e0f99c504fbca858c209c6d9371ddd78985be1ab52845db0720af9ae5e2664d352f5037d4010000000552ac53636affffffff0e0ce866bc3f5b0a49748f597c18fa47a2483b8a94cef1d7295d9a5d36d31ae7030000000663515263ac635bb5d1698325164cdd3f7f3f7831635a3588f26d47cc30bf0fefd56cd87dc4e84f162ab702000000036a6365ffffffff85c2b1a61de4bcbd1d5332d5f59f338dd5e8accbc466fd860f96eef1f54c28ec030000000165ffffffff04f5cabd010000000007000052ac526563c18f1502000000000465510051dc9157050000000008655363ac525253ac506bb600000000000865656a53ab63006a00000000\", \"006a6a0052\", 0, 1186324483, \"2f9b7348600336512686e7271c53015d1cb096ab1a5e0bce49acd35bceb42bc8\"],\n\t[\"11ce51f90164b4b54b9278f0337d95c50d16f6828fcb641df9c7a041a2b274aa70b1250f2b0000000008ab6a6a65006551524c9fe7f604af44be050000000005525365006521f79a0300000000015306bb4e04000000000265ac99611a05000000000765acab656500006dc866d0\", \"\", 0, -1710478768, \"cfa4b7573559b3b199478880c8013fa713ca81ca8754a3fd68a6d7ee6147dc5a\"],\n\t[\"86bc233e02ba3c647e356558e7252481a7769491fb46e883dd547a4ce9898fc9a1ca1b77790000000006ab5351abab51f0c1d09c37696d5c7c257788f5dff5583f4700687bcb7d4acfb48521dc953659e325fa390300000003acac5280f29523027225af03000000000963abac0065ab65acab7e59d90400000000016549dac846\", \"53006aac52acac\", 0, 711159875, \"880330ccde00991503ea598a6dfd81135c6cda9d317820352781417f89134d85\"],\n\t[\"beac155d03a853bf18cd5c490bb2a245b3b2a501a3ce5967945b0bf388fec2ba9f04c03d68030000000012fe96283aec4d3aafed8f888b0f1534bd903f9cd1af86a7e64006a2fa0d2d30711af770010000000163ffffffffd963a19d19a292104b9021c535d3e302925543fb3b5ed39fb2124ee23a9db00302000000056500ac63acffffffff01ad67f503000000000300ac5189f78db2\", \"53536a636500\", 2, 748992863, \"bde3dd0575164d7ece3b5783ce0783ffddb7df98f178fe6468683230314f285a\"],\n\t[\"81dab34a039c9e225ba8ef421ec8e0e9d46b5172e892058a9ade579fe0eb239f7d9c97d45b0300000009ac65655351ab526363ffffffff10c0faaf7f597fc8b00bbc67c3fd4c6b70ca6b22718d15946bf6b032e62dae570000000005536a00ab6a02cddec3acf985bbe62c96fccf17012a87026ed63fc6756fa39e286eb4c2dd79b59d37400300000002516affffffff04f18b8d03000000000753abab5152636564411c02000000000400ab6300e965750300000000001bd2cf02000000000565ab526aab00000000\", \"006551ab\", 0, -1488174485, \"a3d65a8cd0c1eea8558d01396b929520a2221c29d9f25f29035b8abae874447f\"],\n\t[\"489ebbf10478e260ba88c0168bd7509a651b36aaee983e400c7063da39c93bf28100011f280100000004abab63ab2fc856f05f59b257a4445253e0d91b6dffe32302d520ac8e7f6f2467f7f6b4b65f2f59e903000000096353abacab6351656affffffff0122d9480db6c45a2c6fd68b7bc57246edffbf6330c39ccd36aa3aa45ec108fc030000000265ab9a7e78a69aadd6b030b12602dff0739bbc346b466c7c0129b34f50ae1f61e634e11e9f3d0000000006516a53525100ffffffff011271070000000000086563ab6353536352c4dd0e2c\", \"\", 0, -293358504, \"4eba3055bc2b58765593ec6e11775cea4b6493d8f785e28d01e2d5470ea71575\"],\n\t[\"6911195d04f449e8eade3bc49fd09b6fb4b7b7ec86529918b8593a9f6c34c2f2d301ec378b000000000263ab49162266af054643505b572c24ff6f8e4c920e601b23b3c42095881857d00caf56b28acd030000000565525200ac3ac4d24cb59ee8cfec0950312dcdcc14d1b360ab343e834004a5628d629642422f3c5acc02000000035100accf99b663e3c74787aba1272129a34130668a877cc6516bfb7574af9fa6d07f9b4197303400000000085351ab5152635252ffffffff042b3c95000000000000ff92330200000000046a5252ab884a2402000000000853530065520063000d78be03000000000953abab52ab53ac65aba72cb34b\", \"6a\", 2, -637739405, \"6b80d74eb0e7ee59d14f06f30ba7d72a48d3a8ff2d68d3b99e770dec23e9284f\"],\n\t[\"746347cf03faa548f4c0b9d2bd96504d2e780292730f690bf0475b188493fb67ca58dcca4f0000000002005336e3521bfb94c254058e852a32fc4cf50d99f9cc7215f7c632b251922104f638aa0b9d080100000008656aac5351635251ffffffff4da22a678bb5bb3ad1a29f97f6f7e5b5de11bb80bcf2f7bb96b67b9f1ac44d09030000000365ababffffffff036f02b30000000000076353ab6aac63ac50b72a050000000002acaba8abf804000000000663006a6a6353797eb999\", \"acac5100\", 1, -1484493812, \"164c32a263f357e385bd744619b91c3f9e3ce6c256d6a827d6defcbdff38fa75\"],\n\t[\"e17149010239dd33f847bf1f57896db60e955117d8cf013e7553fae6baa9acd3d0f1412ad90200000006516500516500cb7b32a8a67d58dddfb6ceb5897e75ef1c1ff812d8cd73875856487826dec4a4e2d2422a0100000004ac525365196dbb69039229270400000000070000535351636a8b7596020000000006ab51ac52655131e99d040000000003516551ee437f5c\", \"ac656a53\", 1, 1102662601, \"8858bb47a042243f369f27d9ab4a9cd6216adeac1c1ac413ed0890e46f23d3f3\"],\n\t[\"144971940223597a2d1dec49c7d4ec557e4f4bd207428618bafa3c96c411752d494249e1fb0100000004526a5151ffffffff340a545b1080d4f7e2225ff1c9831f283a7d4ca4d3d0a29d12e07d86d6826f7f0200000003006553ffffffff03c36965000000000000dfa9af00000000000451636aac7f7d140300000000016300000000\", \"\", 1, -108117779, \"c84fcaf9d779df736a26cc3cabd04d0e61150d4d5472dd5358d6626e610be57f\"],\n\t[\"b11b6752044e650b9c4744fb9c930819227d2ac4040d8c91a133080e090b042a142e93906e0000000003650053ffffffff6b9ce7e29550d3c1676b702e5e1537567354b002c8b7bb3d3535e63ad03b50ea01000000055100516300fffffffffcf7b252fea3ad5a108af3640a9bc2cd724a7a3ce22a760fba95496e88e2f2e801000000036a00ac7c58df5efba193d33d9549547f6ca839f93e14fa0e111f780c28c60cc938f785b363941b000000000863ab51516552ac5265e51fcd0308e9830400000000036a00abab72190300000000016a63d0710000000000050051ab6a6300000000\", \"53005165ac51ab65\", 0, 229563932, \"e562579d1a2b10d1c5e45c06513456002a6bec157d7eb42511d30b118103c052\"],\n\t[\"2aee6b9a02172a8288e02fac654520c9dd9ab93cf514d73163701f4788b4caeeb9297d2e250300000004ab6363008fb36695528d7482710ea2926412f877a3b20acae31e9d3091406bfa6b62ebf9d9d2a6470100000009535165536a63520065ffffffff03f7b560050000000003acab6a9a8338050000000000206ce90000000000056552516a5100000000\", \"5252\", 1, -1102319963, \"fa4676c374ae3a417124b4c970d1ed3319dc3ac91fb36efca1aa9ed981a8aa1b\"],\n\t[\"9554595203ad5d687f34474685425c1919e3d2cd05cf2dac89d5f33cd3963e5bb43f8706480100000000ffffffff9de2539c2fe3000d59afbd376cb46cefa8bd01dbc43938ff6089b63d68acdc2b02000000096553655251536a6500fffffffff9695e4016cd4dfeb5f7dadf00968e6a409ef048f81922cec231efed4ac78f5d010000000763abab6a5365006caaf0070162cc640200000000045163ab5100000000\", \"\", 0, -1105256289, \"e8e10ed162b1a43bfd23bd06b74a6c2f138b8dc1ab094ffb2fa11d5b22869bee\"],\n\t[\"04f51f2a0484cba53d63de1cb0efdcb222999cdf2dd9d19b3542a896ca96e23a643dfc45f00200000007acac53510063002b091fd0bfc0cfb386edf7b9e694f1927d7a3cf4e1d2ce937c1e01610313729ef6419ae7030000000165a3372a913c59b8b3da458335dc1714805c0db98992fd0d93f16a7f28c55dc747fe66a5b503000000095351ab65ab52536351ffffffff5650b318b3e236802a4e41ed9bc0a19c32b7aa3f9b2cda1178f84499963a0cde000000000165ffffffff0383954f04000000000553ac536363a8fc90030000000000a2e315000000000005acab00ab5100000000\", \"0053\", 2, -1424653648, \"a5bc0356f56b2b41a2314ec05bee7b91ef57f1074bcd2efc4da442222269d1a3\"],\n\t[\"5e4fab42024a27f0544fe11abc781f46596f75086730be9d16ce948b04cc36f86db7ad50fd01000000026a00613330f4916285b5305cc2d3de6f0293946aa6362fc087727e5203e558c676b314ef8dd401000000001af590d202ba496f040000000001009e3c9604000000000351ac51943d64d3\", \"51acabab5100ab52\", 1, -129301207, \"556c3f90aa81f9b4df5b92a23399fe6432cf8fecf7bba66fd8fdb0246440036c\"],\n\t[\"a115284704b88b45a5f060af429a3a8eab10b26b7c15ed421258f5320fa22f4882817d6c2b0300000003005300ffffffff4162f4d738e973e5d26991452769b2e1be4b2b5b7e8cbeab79b9cf9df2882c040000000006636aac63ac5194abc8aa22f8ddc8a7ab102a58e39671683d1891799d19bd1308d24ea6d365e571172f1e030000000700515352515153ffffffff4da7ad75ce6d8541acbb0226e9818a1784e9c97c54b7d1ff82f791df1c6578f60000000000ffffffff01b1f265040000000009ab0051ac656a516a5300000000\", \"51abab6352535265\", 0, -1269106800, \"0ef7b6e87c782fa33fe109aab157a2d9cddc4472864f629510a1c92fa1fe7fc1\"],\n\t[\"f3f771ae02939752bfe309d6c652c0d271b7cab14107e98032f269d92b2a8c8853ab057da8010000000563ab6a6365670c305c38f458e30a7c0ab45ee9abd9a8dc03bae1860f965ffced879cb2e5d0bb156821020000000153ffffffff025dc619050000000002ac51ec0d250100000000076a5200636a6363333aecd8\", \"650053ac515100ab\", 1, 1812404608, \"a7aa34bf8a5644f03c6dd8801f9b15ba2e07e07256dbf1e02dad59f0d3e17ea9\"],\n\t[\"fd3e267203ae7d6d3975e738ca84f12540229bb237dd228d5f688e9d5ba53fce4302b0334d01000000026353ffffffff602a3ab75af7aa951d93093e345ef0037a2863f3f580a9b1a575fffe68e677450300000000239e476d1e8f81e8b6313880d8a49b27c1b00af467f29756e76f675f084a5676539636ab030000000765ab6351acac52d9217747044d773204000000000752ac51526353acc33e45050000000005516500005115d889040000000004ab5163510cbbbd0200000000016500000000\", \"65ac526aac6a53ab52\", 2, -886179388, \"bc46f3f83058ddf5bebd9e1f2c117a673847c4dc5e31cfb24bac91adf30877cf\"],\n\t[\"f380ae23033646af5dfc186f6599098015139e961919aea28502ea2d69474413d94a555ea2000000000853635265abacac5314da394b99b07733341ddba9e86022637be3b76492992fb0f58f23c915098979250a96620300000003ab6300ffffffff4bb6d1c0a0d84eac7f770d3ad0fdc5369ae42a21bbe4c06e0b5060d5990776220300000000ffffffff0486fd70020000000007ac6500635252acf3fd72010000000005656a6a6551212de90500000000096365006a63635153000fa33100000000000600535151656300000000\", \"ab52\", 2, -740890152, \"f804fc4d81f039009ed1f2cccb5c91da797543f235ac71b214c20e763a6d86d7\"],\n\t[\"5c45d09801bb4d8e7679d857b86b97697472d514f8b76d862460e7421e8617b15a2df217c6010000000863acacab6565006affffffff01156dbc03000000000952ac63516551ac6aac00000000\", \"6aabac\", 0, 1310125891, \"270445ab77258ced2e5e22a6d0d8c36ac7c30fff9beefa4b3e981867b03fa0ad\"],\n\t[\"4ecc6bde030ca0f83c0ed3d4b777f94c0c88708c6c933fe1df6874f296d425cac95355c23d0000000006ac6a51536a52f286a0969d6170e20f2a8000193807f5bc556770e9d82341ef8e17b0035eace89c76edd50200000007ac65525100656affffffff5bade6e462fac1927f078d69d3a981f5b4c1e59311a38efcb9a910aa436afaa80000000007ac6a006352ab52ffffffff0331e58902000000000763ac53636352abb8b3ca000000000001637a1d26040000000009535263ac6a5352ab655ae34a39\", \"6a65ab\", 2, 2142728517, \"4a3415eb1677ae4e0c939644a4cfd5dc6299780b55cd0dc735967057b6b1526a\"],\n\t[\"a59484b501eb50114be0fc79e72ab9bc9f4a5f7acdf274a56d6b68684eb68cf8b07ec5d1c2000000000765abab00ab00639e09aa940141e3530200000000046500ac6500000000\", \"00516565ab\", 0, -1561622405, \"d60bbadd2cc0674100baa08d0e0493ee4248f0304b3eb778da942041f503a896\"],\n\t[\"53dc1a88046531c7b57a35f4d9adf101d068bf8d63fbbedaf4741dba8bc5e92c8725def571030000000453655251fcdf116a226b3ec240739c4c7493800e4edfe67275234e371a227721eac43d3d9ecaf1b50300000003ac0052ffffffff2c9279ffeea4718d167e9499bd067600715c14484e373ef93ae4a31d2f5671ab0000000009516553ac636a6a65001977752eeba95a8f16b88c571a459c2f2a204e23d48cc7090e4f4cc35846ca7fc0a455ce00000000055165ac0063188143f80205972902000000000765ac63ac516353c7b6a50000000000036a510000000000\", \"655351536a\", 0, 103806788, \"b276584d3514e5b4e058167c41dc02915b9d97f6795936a51f40e894ed8508bc\"],\n\t[\"53f8959f01ddb36afdcd20167edcbb75a63d18654fdcf10bc0004c761ab450fe236d79cb2702000000065151650063653435003a033a5e34050000000009ac52516a630000516ab86db3030000000002006344ac090500000000046363ab00f3644537\", \"5263abab63ac656353\", 0, -218513553, \"f1f2a489682e42a6fc20025dfc89584d17f150b2d7ae3ddedd2bf43d5e24f37f\"],\n\t[\"5a06cb4602dcfc85f49b8d14513f33c48f67146f2ee44959bbca092788e6823b2719f3160b0200000001ab3c013f2518035b9ea635f9a1c74ec1a3fb7496a160f46aae2e09bfc5cd5111a0f20969e003000000015158c89ab7049f20d6010000000008ac6a52abac53515349765e00000000000300ab638292630100000000045351ab0086da09010000000006656a6365525300000000\", \"526a63\", 1, 1502936586, \"bdfaff8a4e775379c5dc26e024968efa805f923de53fa8272dd53ec582afa0c5\"],\n\t[\"ca9d84fa0129011e1bf27d7cb71819650b59fb292b053d625c6f02b0339249b498ff7fd4b601000000025352ffffffff032173a0040000000008525253abab5152639473bb030000000009005153526a53535151d085bd0000000000086a5365ab5165655300000000\", \"005152ac51\", 0, 580353445, \"c629d93b02037f40aa110e46d903edb34107f64806aa0c418d435926feef68b8\"],\n\t[\"e3cdbfb4014d90ae6a4401e85f7ac717adc2c035858bf6ff48979dd399d155bce1f150daea0300000002ac51a67a0d39017f6c71040000000005535200535200000000\", \"\", 0, -1899950911, \"c1c7df8206e661d593f6455db1d61a364a249407f88e99ecad05346e495b38d7\"],\n\t[\"b2b6b9ab0283d9d73eeae3d847f41439cd88279c166aa805e44f8243adeb3b09e584efb1df00000000026300ffffffff7dfe653bd67ca094f8dab51007c6adaced09de2af745e175b9714ca1f5c68d050000000003ac6500aa8e596903fd3f3204000000000553ac6a6a533a2e210500000000075253acabab526392d0ee020000000008520065635200ab5200000000\", \"65acacac65005365\", 0, 28298553, \"39c2aaa2496212b3ab120ab7d7f37c5e852bfe38d20f5226413a2268663eeae8\"],\n\t[\"f30c5c3d01a6edb9e10fafaf7e85db14e7fec558b9dca4a80b05d7c3a2944d282c5018f4680200000003005263ffffffff04aac3530300000000026551bc2419010000000009005163acab6a5100658e7085050000000000c5e4ec050000000007656a6a635365ab2d8e8882\", \"abac53ab005251ac52\", 0, -490287546, \"877e347ec7487497769e2581142276d1a8d813b652e4483cf9cc993d16354417\"],\n\t[\"4314339e01de40faabcb1b970245a7f19eedbc17c507dac86cf986c2973715035cf95736ae0200000007abababababab65bde67b900151510b04000000000853ac00655200535300000000\", \"52\", 0, 399070095, \"47585dc25469d04ff3a60939d0a03779e3e81a411bf0ca18b91bb925ebd30718\"],\n\t[\"2d4cf4e9031b3e175b2ff18cd933151379d9cfac4713d8bd0e63b70bd4a92277aa7af901ab000000000565515353abffffffff557666c7f3be9cdecdad44c3df206eb63a2da4ed1f159d21193882a9f0340081020000000963ab53ab5252ac63abffffffff8a8c897bdb87e93886aad5ded9d82a13101d5476554386373646ca5e23612e450300000009006a526552abab6a635ac03fc00198bb02040000000009525100526a6563636a1d052834\", \"ab52ac00acac6a\", 0, -1469882480, \"09ed6563a454814ab7e3b4c28d56d8751162b77df1825b37ba66c6147750b2a3\"],\n\t[\"f063171b03e1830fdc1d685a30a377537363ccafdc68b42bf2e3acb908dac61ee24b37595c020000000765ac5100ab6aacf447bc8e037b89d6cadd62d960cc442d5ced901d188867b5122b42a862929ce45e7b628d010000000253aba009a1ba42b00f1490b0b857052820976c675f335491cda838fb7934d5eea0257684a2a202000000001e83cf2401a7f777030000000008ab6553526a53526a00000000\", \"\", 2, 1984790332, \"c19caada8e71535e29a86fa29cfd9b74a0c7412003fc722a121005e461e01636\"],\n\t[\"cf7bdc250249e22cbe23baf6b648328d31773ea0e771b3b76a48b4748d7fbd390e88a004d30000000003ac536a4ab8cce0e097136c90b2037f231b7fde2063017facd40ed4e5896da7ad00e9c71dd70ae600000000096a0063516352525365ffffffff01b71e3e00000000000300536a00000000\", \"\", 1, 546970113, \"6a815ba155270af102322c882f26d22da11c5330a751f520807936b320b9af5d\"],\n\t[\"ac7a125a0269d35f5dbdab9948c48674616e7507413cd10e1acebeaf85b369cd8c88301b7c030000000963656aac6a530053abffffffffed94c39a582e1a46ce4c6bffda2ccdb16cda485f3a0d94b06206066da12aecfe010000000752abab63536363ef71dcfb02ee07fa0400000000016a6908c802000000000751656a6551abac688c2c2d\", \"6a6351526551\", 0, 858400684, \"552ff97d7924f51cda6d1b94be53483153ef725cc0a3a107adbef220c753f9a6\"],\n\t[\"3a1f454a03a4591e46cf1f7605a3a130b631bf4dfd81bd2443dc4fac1e0a224e74112884fe0000000005516aac6a53a87e78b55548601ffc941f91d75eab263aa79cd498c88c37fdf275a64feff89fc1710efe03000000016a39d7ef6f2a52c00378b4f8f8301853b61c54792c0f1c4e2cd18a08cb97a7668caa008d970200000002656affffffff017642b20100000000096a63535253abac6a6528271998\", \"51\", 2, 1459585400, \"e9a7f21fc2d38be7be47095fbc8f1bf8923660aa4d71df6d797ae0ba5ca4d5b0\"],\n\t[\"f59366cc0114c2a18e6bd1347ed9470f2522284e9e835dd5c5f7ef243639ebea95d9b232b6020000000153474b62eb045c00170500000000096352ab516352ab5200038a520400000000086aab5253656a63005b968904000000000963536353ac0053635387106002000000000000000000\", \"ab52526300ab51\", 0, 1834116153, \"cdf51f6e3a9dc2be5a59ea4c00f5aac1e1426a5202c325e6cf2567d07d8d8de4\"],\n\t[\"6269e0fa0173e76e89657ca495913f1b86af5b8f1c1586bcd6c960aede9bc759718dfd5044000000000352ac530e2c7bd90219849b000000000007ab00ab6a53006319f281000000000007ab00515165ac5200000000\", \"6a\", 0, -2039568300, \"62094f98234a05bf1b9c7078c5275ed085656856fb5bdfd1b48090e86b53dd85\"],\n\t[\"eb2bc00604815b9ced1c604960d54beea4a3a74b5c0035d4a8b6bfec5d0c9108f143c0e99a0000000000ffffffff22645b6e8da5f11d90e5130fd0a0df8cf79829b2647957471d881c2372c527d8010000000263acffffffff1179dbaf17404109f706ae27ad7ba61e860346f63f0c81cb235d2b05d14f2c1003000000025300264cb23aaffdc4d6fa8ec0bb94eff3a2e50a83418a8e9473a16aaa4ef8b855625ed77ef40100000003ac51acf8414ad404dd328901000000000652526500006ab6261c000000000002526a72a4c9020000000006ac526500656586d2e7000000000006656aac00ac5279cd8908\", \"51\", 1, -399279379, \"d37532e7b2b8e7db5c7c534197600397ebcc15a750e3af07a3e2d2e4f84b024f\"],\n\t[\"dc9fe6a8038b84209bbdae5d848e8c040433237f415437592907aa798bf30d9dbbddf0ff85010000000153ffffffff23269a7ea29fcf788db483b8d4c4b35669e582608644259e950ce152b0fa6e050000000003acababffffffff65de94857897ae9ea3aa0b938ba6e5adf374d48469922d2b36dbb83d3b8c8261010000000452ac5200ffffffff02856e9b0300000000026a51980c8e02000000000365ab63d2648db4\", \"00ab0051ac526565\", 2, 1562581941, \"5cef9d8e18a2d5a70448f17b465d411a19dab78f0ddf1672ffd518b188f52433\"],\n\t[\"eba8b0de04ac276293c272d0d3636e81400b1aaa60db5f11561480592f99e6f6fa13ad387002000000070053acab536563bebb23d66fd17d98271b182019864a90e60a54f5a615e40b643a54f8408fa8512cfac927030000000963ac6a6aabac65ababffffffff890a72192bc01255058314f376bab1dc72b5fea104c154a15d6faee75dfa5dba020000000100592b3559b0085387ac7575c05b29b1f35d9a2c26a0c27903cc0f43e7e6e37d5a60d8305a030000000252abffffffff0126518f05000000000000000000\", \"005300635252635351\", 1, 664344756, \"26dc2cba4bd5334e5c0b3a520b44cc1640c6b923d10e576062f1197171724097\"],\n\t[\"91bd040802c92f6fe97411b159df2cd60fb9571764b001f31657f2d616964637605875c2a901000000055263006a65ffffffff3651df372645f50cf4e32fdf6e61c766e912e16335db2b40c5d52fe89eefe7cd00000000040065ab65ffffffff03ca8625030000000009ab51ac63530052ab52c6bf14020000000006ab00ab52005167d270000000000007ab53525351636a00000000\", \"5151ab63005252ac\", 1, 1983087664, \"3e5aa0200248d8d86ede3b315ca1b857018b89184a4bd023bd88ab12e499f6e1\"],\n\t[\"185cda1a01ecf7a8a8c28466725b60431545fc7a3367ab68e34d486e8ea85ee3128e0d8384000000000465ac63abec88b7bb031c56eb04000000000965636a51005252006a7c78d5040000000007acac63abac51ac3024a40500000000086300526a51abac51464c0e8c\", \"0065535265515352\", 0, 1594558917, \"b5280b9610c0625a65b36a8c2402a95019a7bbb9dd3de77f7c3cb1d82c3263ba\"],\n\t[\"a9531f07034091668b65fea8b1a79700d586ac9e2f42ca0455a26abe41f9e1805d009a0f5702000000096365516365ac5263ab3619bac643a9e28ee47855118cf80c3a74531cdf198835d206d0fe41804e325a4f9f105e03000000016a58e3ab0d46375d98994daf0fa7c600d2bb4669e726fca0e3a3f21ea0d9e777396740328f0100000008636a5363ab526a538d3ea7700304cb66030000000007515163ab52ab510184030500000000085353636565ac0051d9cff402000000000751ab52ab5352abf0e36254\", \"ab5353ac5365acab\", 2, 1633101834, \"04c9ef72f33668ca449c0415becf62cc0b8e0c75f9c8813852d42a58acf107c8\"],\n\t[\"6b5ecc7903fe0ba37ea551df92a59e12bad0a3065846ba69179a8f4a741a2b4fcf679aac810200000004535263529a3d343293b99ab425e7ef8529549d84f480bcd92472bab972ea380a302128ae14dfcd0200000000025163ffffffff24636e4545cab9bf87009119b7fc3ec4d5ee9e206b90f35d1df8a563b6cd097a010000000852abac53005153abc64467860406e832020000000009526300006a53ac6352ac1395010000000002ac53b117f300000000000863655351acab00651edf02030000000008ab51ac6353535252628ef71d\", \"ab63ab6a52ac526563\", 2, -1559697626, \"8f07ece7d65e509f1e0780584ef8d271c1c61a13b10335d5faafc7afc8b5b8ec\"],\n\t[\"92c9fb780138abc472e589d5b59489303f234acc838ca66ffcdf0164517a8679bb622a4267020000000153468e373d04de03fa020000000009ac006a5265ab5163006af649050000000007515153006a00658ceb59030000000001ac36afa0020000000009ab53006351ab51000000000000\", \"6a\", 0, 2059357502, \"e2358dfb51831ee81d7b0bc602a65287d6cd2dbfacf55106e2bf597e22a4b573\"],\n\t[\"6f62138301436f33a00b84a26a0457ccbfc0f82403288b9cbae39986b34357cb2ff9b889b302000000045253655335a7ff6701bac9960400000000086552ab656352635200000000\", \"6aac51\", 0, 1444414211, \"502a2435fd02898d2ff3ab08a3c19078414b32ec9b73d64a944834efc9dae10c\"],\n\t[\"9981143a040a88c2484ac3abe053849e72d04862120f424f373753161997dd40505dcb4783030000000700536365536565a2e10da3f4b1c1ad049d97b33f0ae0ea48c5d7c30cc8810e144ad93be97789706a5ead180100000003636a00ffffffffbdcbac84c4bcc87f03d0ad83fbe13b369d7e42ddb3aecf40870a37e814ad8bb5010000000963536a5100636a53abffffffff883609905a80e34202101544f69b58a0b4576fb7391e12a769f890eef90ffb72020000000651656352526affffffff04243660000000000004ab5352534a9ce001000000000863656363ab6a53652df19d030000000003ac65acedc51700000000000000000000\", \"ac6300acac\", 2, 293672388, \"7ba99b289c04718a7283f150d831175ed6303081e191a0608ea81f78926c5bdf\"],\n\t[\"a2bb630b01989bc5d643f2da4fb9b55c0cdf846ba06d1dbe372893024dbbe5b9b8a1900af802000000055265ac63aca7a68d2f04916c74010000000003abac007077f0040000000001007d4127010000000005ac516aac000f31e8030000000000571079c9\", \"65ab0051ac\", 0, -1103627693, \"92d53b4390262e6b288e8a32e0cfc36cd5adfdfabfe96c7bfd4a19d65e233761\"],\n\t[\"49f7d0b6037bba276e910ad3cd74966c7b3bc197ffbcfefd6108d6587006947e97789835ea0300000008526a52006a650053ffffffff8d7b6c07cd10f4c4010eac7946f61aff7fb5f3920bdf3467e939e58a1d4100ab03000000076aac63ac535351ffffffff8f48c3ba2d52ad67fbcdc90d8778f3c8a3894e3c35b9730562d7176b81af23c80100000003ab5265ffffffff0301e3ef0300000000046a525353e899ac0500000000075153ab6a65abac259bea0400000000007b739972\", \"53516aacac6aac\", 1, 955403557, \"5d366a7f4346ae18aeb7c9fc4dab5af71173184aa20ed22fcb4ea8511ad25449\"],\n\t[\"58a4fed801fbd8d92db9dfcb2e26b6ff10b120204243fee954d7dcb3b4b9b53380e7bb8fb60100000003006351ffffffff02a0795b050000000006536351ac6aac2718d00200000000075151acabac515354d21ba1\", \"005363515351\", 0, -1322430665, \"bbee941bbad950424bf40e3623457db47f60ed29deaa43c99dec702317cb3326\"],\n\t[\"32765a0b02e455793d9ce530e9f6a44bcbc612e893a875b5da61d822dc56d8245166c398b403000000085353abac6300006a6bdee2a78d0d0b6a5ea666eed70b9bfea99d1d612ba3878f615c4da10d4a521cba27155002000000035363abffffffff043cd42401000000000551656a53653685320100000000030000511881bc0500000000065165abab636a20169f010000000007acab656aac63acdb0706a8\", \"65ac53ab53\", 0, 1936499176, \"5c5a9c3a5de7dc7a82bc171c9d3505913b8bcc450bc8b2d11772c1a1d781210b\"],\n\t[\"17fad0d303da0d764fedf9f2887a91ea625331b28704940f41e39adf3903d8e75683ef6d46020000000151ffffffffff376eea4e880bcf0f03d33999104aafed2b3daf4907950bb06496af6b51720a020000000900636a63525253525196521684f3b08497bad2c660b00b43a6a517edc58217876eb5e478aa3b5fda0f29ee1bea00000000046aacab6affffffff03dde8e2050000000007ac5365ac51516a14772e000000000005630000abacbbb360010000000006ab5251ab656a50f180f0\", \"0053\", 0, -1043701251, \"a3bdf8771c8990971bff9b4e7d59b7829b067ed0b8d3ac1ec203429811384668\"],\n\t[\"236c32850300045e292c84ede2b9ab5733ba08315a2bb09ab234c4b4e8894808edbdac0d3b020000000653635363abacffffffffd3f696bb31fdd18a72f3fc2bb9ae54b416a253fc37c1a0f0180b52d35bad49440100000004650053abffffffffa85c75a2406d82a93b12e555b66641c1896a4e83ae41ef1038218311e38ace060200000006abab006a51ac104b5e6701e2842c04000000000800630051ac0000ab00000000\", \"ab63ac6a516a\", 1, -1709887524, \"8c29ea8ef60c5a927fccdba8ea385db6b6b84d98e891db45f5d4ee3148d3f5a7\"],\n\t[\"b78d5fd601345f3100af494cdf447e7d4076179f940035b0ebe8962587d4d0c9c6c9fc34ee0300000003516a6affffffff03dc5c890100000000085353ac53ac6a52534ac941040000000007ac63656a51ab51d4266b0100000000036aacac70731f2d\", \"005351ab0053\", 0, -1789071265, \"d5f1c1cb35956a5711d67bfb4cedbc67e77c089b912d688ad440ff735adb390d\"],\n\t[\"5a2257df03554550b774e677f348939b37f8e765a212e566ce6b60b4ea8fed4c9504b7f7d1000000000653655265ab5258b67bb931df15b041177cf9599b0604160b79e30f3d7a594e7826bae2c29700f6d8f8f40300000005515300ac6a159cf8808a41f504eb5c2e0e8a9279f3801a5b5d7bc6a70515fbf1c5edc875bb4c9ffac500000000050063510052ffffffff0422a90105000000000965006a650000516a006417d2020000000006526363ab00524d969d0100000000035153acc4f077040000000005ac5200636500000000\", \"6a52\", 1, -1482463464, \"37b794b05d0687c9b93d5917ab068f6b2f0e38406ff04e7154d104fc1fb14cdc\"],\n\t[\"e0032ad601269154b3fa72d3888a3151da0aed32fb2e1a15b3ae7bee57c3ddcffff76a1321010000000100110d93ae03f5bd080100000000075263516a6551002871e60100000000046a005252eaa753040000000004ab6aab526e325c71\", \"630052\", 0, -1857873018, \"ea117348e94de86381bb8ad1c7f93b8c623f0272104341701bb54e6cb433596c\"],\n\t[\"014b2a5304d46764817aca180dca50f5ab25f2e0d5749f21bb74a2f8bf6b8b7b3fa8189cb7030000000965ac5165ab6a51ac6360ecd91e8abc7e700a4c36c1a708a494c94bb20cbe695c408543146566ab22be43beae9103000000045163ab00ffffffffffa48066012829629a9ec06ccd4905a05df0e2b745b966f6a269c9c8e13451fc00000000026565ffffffffc40ccadc21e65fe8a4b1e072f4994738ccaf4881ae6fede2a2844d7da4d199ab02000000065152ab536aabffffffff01b6e054030000000004515352ab3e063432\", \"\", 0, 1056459916, \"a7aff48f3b8aeb7a4bfe2e6017c80a84168487a69b69e46681e0d0d8e63a84b6\"],\n\t[\"c4ef04c103c5dde65410fced19bf6a569549ecf01ceb0db4867db11f2a3a3eef0320c9e8e001000000085100536a53516aabffffffff2a0354fa5bd96f1e28835ffe30f52e19bd7d5150c687d255021a6bec03cf4cfd03000000056a006300514900c5b01d3d4ae1b97370ff1155b9dd0510e198d266c356d6168109c54c11b4c283dca00300000002ababffffffff02e19e3003000000000451655351fa5c0003000000000163ef1fc64b\", \"51636a51ab630065\", 1, -1754709177, \"0a281172d306b6a32e166e6fb2a2cc52c505c5d60ea448e9ba7029aa0a2211e1\"],\n\t[\"29083fe00398bd2bb76ceb178f22c51b49b5c029336a51357442ed1bac35b67e1ae6fdf13100000000066a6500acab51ffffffffe4ca45c9dc84fd2c9c47c7281575c2ba4bf33b0b45c7eca8a2a483f9e3ebe4b3010000000200abffffffffdf47ad2b8c263fafb1e3908158b18146357c3a6e0832f718cd464518a219d18303000000096352ac656351ac0052daddfb3b0231c36f00000000000400526a5275c7e0020000000001ab00000000\", \"acab536aac52\", 2, 300802386, \"82ebc07b16cff0077e9c1a279373185b3494e39d08fd3194aae6a4a019377509\"],\n\t[\"1201ab5d04f89f07c0077abd009762e59db4bb0d86048383ba9e1dad2c9c2ad96ef660e6d00200000007ab6a65ac5200652466fa5143ab13d55886b6cdc3d0f226f47ec1c3020c1c6e32602cd3428aceab544ef43e00000000086a6a6a526a6a5263ffffffffd5be0b0be13ab75001243749c839d779716f46687e2e9978bd6c9e2fe457ee48020000000365abab1e1bac0f72005cf638f71a3df2e3bbc0fa35bf00f32d9c7dc9c39a5e8909f7d53170c8ae0200000008ab6a51516363516affffffff02f0a6210500000000036300ac867356010000000009acab65ac6353536a659356d367\", \"ac53535252\", 0, 917543338, \"418acc156c2bc76a5d7baa58db29f1b4cf6c266c9222ed167ef5b4d47f0e0f41\"],\n\t[\"344fa11e01c19c4dd232c77742f0dd0aeb3695f18f76da627628741d0ee362b0ea1fb3a2180200000007635151005100529bab25af01937c1f0500000000055153ab53656e7630af\", \"6351005163ac51\", 0, -629732125, \"228ca52a0a376fe0527a61cfa8da6d7baf87486bba92d49dfd3899cac8a1034f\"],\n\t[\"b2fda1950191358a2b855f5626a0ebc830ab625bea7480f09f9cd3b388102e35c0f303124c030000000565ac65ab53ffffffff03f9c5ec04000000000765ab51516551650e2b9f0500000000045365525284e8f6040000000001ac00000000\", \"ac51655253\", 0, 1433027632, \"d2fa7e13c34cecda5105156bd2424c9b84ee0a07162642b0706f83243ff811a8\"],\n\t[\"a4a6bbd201aa5d882957ac94f2c74d4747ae32d69fdc765add4acc2b68abd1bdb8ee333d6e0300000008516a6552515152abffffffff02c353cb040000000007ac6351ab51536588bd320500000000066552525253ac00000000\", \"\", 0, 1702060459, \"499da7d74032388f820645191ac3c8d20f9dba8e8ded7fa3a5401ea2942392a1\"],\n\t[\"584e8d6c035a6b2f9dac2791b980a485994bf38e876d9dda9b77ad156eee02fa39e19224a60300000003ab636529db326cc8686a339b79ab6b6e82794a18e0aabc19d9ad13f31dee9d7aad8eff38288588020000000452530052ffffffff09a41f07755c16cea1c7e193c765807d18cadddca6ec1c2ed7f5dcdca99e90e80000000001acffffffff01cba62305000000000451ac63acccdf1f67\", \"ab536a6363\", 2, -27393461, \"1125645b49202dca2df2d76dae51877387903a096a9d3f66b5ac80e042c95788\"],\n\t[\"83a583d204d926f2ee587a83dd526cf1e25a44bb668e45370798f91a2907d184f7cddcbbc7030000000700ab6565536a539f71d3776300dffdfa0cdd1c3784c9a1f773e34041ca400193612341a9c42df64e3f550e01000000050052515251ffffffff52dab2034ab0648553a1bb8fc4e924b2c89ed97c18dfc8a63e248b454035564b01000000015139ab54708c7d4d2c2886290f08a5221cf69592a810fd1979d7b63d35c271961e710424fd0300000005ac65ac5251ffffffff01168f7c030000000000a85e5fb0\", \"6a536353656a00\", 0, 179595345, \"5350a31ac954a0b49931239d0ecafbf34d035a537fd0c545816b8fdc355e9961\"],\n\t[\"ffd35d51042f290108fcb6ea49a560ba0a6560f9181da7453a55dfdbdfe672dc800b39e7320200000006630065516a65f2166db2e3827f44457e86dddfd27a8af3a19074e216348daa0204717d61825f198ec0030100000006ab51abab00abffffffffdf41807adb7dff7db9f14d95fd6dc4e65f8402c002d009a3f1ddedf6f4895fc8030000000500ab006a65a5a848345052f860620abd5fcd074195548ce3bd0839fa9ad8642ed80627bf43a0d47dbd010000000765ab006a656a53b38cdd6502a186da05000000000765ab00ab006a53527c0e0100000000085365ab51acacac52534bd1b1\", \"6a635253ac0000\", 0, 1095082149, \"3c05473a816621a3613f0e903faa1a1e44891dd40862b029e41fc520776350fa\"],\n\t[\"6c9a4b98013c8f1cae1b1df9f0f2de518d0c50206a0ab871603ac682155504c0e0ce946f460100000000ffffffff04e9266305000000000753535100ac6aacded39e04000000000365ac6ab93ccd010000000002515397bf3d050000000003ab636300000000\", \"63520052ac656353\", 0, -352633155, \"936eff8cdfd771be24124da87c7b24feb48da7cbc2c25fb5ba13d1a23255d902\"],\n\t[\"e01dc7f0021dc07928906b2946ca3e9ac95f14ad4026887101e2d722c26982c27dc2b59fdb0000000005ac5200516ab5a31ffadcbe74957a5a3f97d7f1475cc6423fc6dbc4f96471bd44c70cc736e7dec0d1ea020000000951636a526a52abac53ffffffff04bc2edd05000000000252ab528c7b02000000000952ac51526500525353324820040000000002005380c713000000000009630065ab00ac525252451bbb48\", \"53ab65ac\", 0, -552384418, \"69c0b30f4c630a6c878fde6ea6b74dae94f4eb3bcfbde2dc3649e1a9ada00757\"],\n\t[\"009046a1023f266d0113556d604931374d7932b4d6a7952d08fbd9c9b87cbd83f4f4c178b4030000000452ac526346e73b438c4516c60edd5488023131f07acb5f9ea1540b3e84de92f4e3c432289781ea4900000000046500655357dfd6da02baef910100000000026a007d101703000000000800516500abacac5100000000\", \"6aab6553ac\", 0, -802456605, \"f8757fbb4448ca34e0cd41b997685b37238d331e70316659a9cc9087d116169d\"],\n\t[\"df76ec0801a3fcf3d18862c5f686b878266dd5083f16cf655facab888b4cb3123b3ce5db7e01000000010010e7ac6a0233c83803000000000365ac51faf14a040000000004ac51655100000000\", \"6353acab\", 0, 15705861, \"e7d873aa079a19ec712b269a37d2670f60d8cb334c4f97e2e3fd10eeb8ee5f5e\"],\n\t[\"828fd3e0031084051ccef9cfdd97fae4d9cc50c0dae36bd22a3ff332881f17e9756c3e288e0200000004ab535363961a2ccccaf0218ec6a16ba0c1d8b5e93cfd025c95b6e72bc629ec0a3f47da7a4c396dad01000000025353ffffffff19ad28747fb32b4caf7b5dbd9b2da5a264bedb6c86d3a4805cd294ae53a86ac40200000009ab53535351ab6551abffffffff04a41650030000000005656aab6aab8331a304000000000700516365ac516a0d2a47010000000007abac516353abacdebc19040000000006ab5300636a6300000000\", \"51ab52ab53ac52\", 0, 1866105980, \"311094b4d73e31aefc77e97859ef07ca2f07a7b7e4d7def80c69d3f5d58527e5\"],\n\t[\"c4b80f850323022205b3e1582f1ed097911a81be593471a8dce93d5c3a7bded92ef6c7c1260100000002006affffffff70294d62f37c3da7c5eae5d67dce6e1b28fedd7316d03f4f48e1829f78a88ae801000000096a5200530000516351f6b7b544f7c39189d3a2106ca58ce4130605328ce7795204be592a90acd81bef517d6f170200000000ffffffff012ab8080000000000075100006365006335454c1e\", \"53ac6a536aacac\", 0, -1124103895, \"06277201504e6bf8b8c94136fad81b6e3dadacb9d4a2c21a8e10017bfa929e0e\"],\n\t[\"8ab69ed50351b47b6e04ac05e12320984a63801716739ed7a940b3429c9c9fed44d3398ad40300000006536a516a52638171ef3a46a2adb8025a4884b453889bc457d63499971307a7e834b0e76eec69c943038a0300000000ffffffff566bb96f94904ed8d43d9d44a4a6301073cef2c011bf5a12a89bedbaa03e4724030000000265acb606affd01edea38050000000008515252516aacac6300000000\", \"65000000006365ac53\", 0, -1338942849, \"7912573937824058103cb921a59a7f910a854bf2682f4116a393a2045045a8c3\"],\n\t[\"2484991e047f1cf3cfe38eab071f915fe86ebd45d111463b315217bf9481daf0e0d10902a402000000006e71a424eb1347ffa638363604c0d5eccbc90447ff371e000bf52fc743ec832851bb564a0100000001abffffffffef7d014fad3ae7927948edbbb3afe247c1bcbe7c4c8f5d6cf97c799696412612020000000851536a5353006a001dfee0d7a0dd46ada63b925709e141863f7338f34f7aebde85d39268ae21b77c3068c01d0000000008535151ab00636563ffffffff018478070200000000095200635365ac52ab5341b08cd3\", \"\", 3, 265623923, \"24cb420a53b4f8bb477f7cbb293caabfd2fc47cc400ce37dbbab07f92d3a9575\"],\n\t[\"54839ef9026f65db30fc9cfcb71f5f84d7bb3c48731ab9d63351a1b3c7bc1e7da22bbd508e0300000000442ad138f170e446d427d1f64040016032f36d8325c3b2f7a4078766bdd8fb106e52e8d20000000003656500ffffffff02219aa101000000000851ababac52ab00659646bd02000000000552acacabac24c394a5\", \"ac\", 0, 906807497, \"69264faadcd1a581f7000570a239a0a26b82f2ad40374c5b9c1f58730514de96\"],\n\t[\"5036d7080434eb4eef93efda86b9131b0b4c6a0c421e1e5feb099a28ff9dd8477728639f77030000000951516aab535152ab5391429be9cce85d9f3d358c5605cf8c3666f034af42740e94d495e28b9aaa1001ba0c87580300000008006552ab00ab006affffffffd838978e10c0c78f1cd0a0830d6815f38cdcc631408649c32a25170099669daa0000000002acab8984227e804ad268b5b367285edcdf102d382d027789250a2c0641892b480c21bf84e3fb0100000000b518041e023d8653010000000001004040fb0100000000080051ac5200636a6300000000\", \"52ac\", 0, 366357656, \"bd0e88829afa6bdc1e192bb8b2d9d14db69298a4d81d464cbd34df0302c634c6\"],\n\t[\"9ad5ccf503fa4facf6a27b538bc910cce83c118d6dfd82f3fb1b8ae364a1aff4dcefabd38f03000000096365655263ac655300807c48130c5937190a996105a69a8eba585e0bd32fadfc57d24029cbed6446d30ebc1f100100000004000053650f0ccfca1356768df7f9210cbf078a53c72e0712736d9a7a238e0115faac0ca383f219d0010000000600ab536552002799982b0221b8280000000000000c41320000000000086552ac6365636a6595f233a3\", \"6a5152\", 2, 553208588, \"f99c29a79f1d73d2a69c59abbb5798e987639e36d4c44125d8dc78a94ddcfb13\"],\n\t[\"669538a204047214ce058aed6a07ca5ad4866c821c41ac1642c7d63ed0054f84677077a84f030000000853abacab6a655353ffffffff70c2a071c115282924e3cb678b13800c1d29b6a028b3c989a598c491bc7c76c5030000000752ac52ac5163ac80420e8a6e43d39af0163271580df6b936237f15de998e9589ec39fe717553d415ac02a4030000000463635153184ad8a5a4e69a8969f71288c331aff3c2b7d1b677d2ebafad47234840454b624bf7ac1d03000000056a63abab63df38c24a02fbc63a040000000002ab535ec3dc050000000002536500000000\", \"635153\", 3, -190399351, \"9615541884dfb1feeb08073a6a6aa73ef694bc5076e52187fdf4138a369f94d9\"],\n\t[\"a7f139e502af5894be88158853b7cbea49ba08417fbbca876ca6614b5a41432be34499987b000000000765635165abac63ffffffff8b8d70e96c7f54eb70da0229b548ced438e1ca2ba5ddd648a027f72277ee1efc0100000001abffffffff044f2c4204000000000165e93f550100000000050000526a6a94550304000000000365536aadc21c0300000000016300000000\", \"6aacac6363ab5265ac\", 1, 2143189425, \"6e3f97955490d93d6a107c18d7fe402f1cada79993bb0ff0d096357261b3a724\"],\n\t[\"3b94438f0366f9f53579a9989b86a95d134256ce271da63ca7cd16f7dd5e4bffa17d35133f010000000100ffffffff1aaad0c721e06ec00d07e61a84fb6dc840b9a968002ce7e142f943f06fd143a10100000008535151ac51ab0053b68b8e9c672daf66041332163e04db3f6048534bd718e1940b3fc3811c4eef5b7a56888b01000000001d58e38c012e38e700000000000852ab53ac6365536a00000000\", \"ab655352\", 1, -935223304, \"b3b336de141d4f071313a2207b2a0c7cf54a070dd8d234a511b7f1d13e23b0c4\"],\n\t[\"e5dca8a20456de0a67e185fa6ea94085ceae478d2c15c73cb931a500db3a1b6735dd1649ec0200000005ab536aabab32d11bbdcb81361202681df06a6b824b12b5cb40bb1a672cf9af8f2a836e4d95b7839327030000000951005365ab65abacabb345085932939eef0c724adef8a57f9e1bf5813852d957c039b6a12d9c2f201ea520fb030000000009ac5352005165acac6a5efc6072f1a421dc7dc714fc6368f6d763a5d76d0278b95fc0503b9268ccfadb48213a2500000000026a53ffffffff039ee1c4020000000009ac5353ab6353535163184018000000000005655265526a9a4a8a050000000001ac00000000\", \"65ab53ab6a00ab6553\", 2, 1902561212, \"7928ae8e86c0b0cad1b2c120ea313087437974382ee6d46443ca5ac3f5878b88\"],\n\t[\"972128b904e7b673517e96e98d80c0c8ceceae76e2f5c126d63da77ffd7893fb53308bb2da0300000006ac6552ab52acffffffff4cac767c797d297c079a93d06dc8569f016b4bf7a7d79b605c526e1d36a40e2202000000095365ab636aac6a6a6a69928d2eddc836133a690cfb72ec2d3115bf50fb3b0d10708fa5d2ebb09b4810c426a1db01000000060052526300001e8e89585da7e77b2dd2e30625887f0660accdf29e53a614d23cf698e6fc8ab03310e87700000000076a520051acac6555231ddb0330ec2d03000000000200abfaf457040000000004ab6a6352bdc42400000000000153d6dd2f04\", \"\", 0, 209234698, \"4a92fec1eb03f5bd754ee9bfd70707dc4420cc13737374f4675f48529be518e4\"],\n\t[\"1fb4085b022c6cfb848f8af7ba3ba8d21bd23ffa9f0bfd181cb68bcaaf2074e66d4974a31602000000090000006a6a6500acab6c12c07d9f3dbd2d93295c3a49e3757119767097e7fd5371f7d1ba9ba32f1a67a5a426f00000000000ffffffff018fd2fc04000000000363ac5100000000\", \"65ab006a6aab526a\", 0, 1431502299, \"8b7dd0ff12ca0d8f4dbf9abf0abba00e897c2f6fd3b92c79f5f6a534e0b33b32\"],\n\t[\"5374f0c603d727f63006078bd6c3dce48bd5d0a4b6ea00a47e5832292d86af258ea0825c260000000009655353636352526a6af2221067297d42a9f8933dfe07f61a574048ff9d3a44a3535cd8eb7de79fb7c45b6f47320200000003ac006affffffff153d917c447d367e75693c5591e0abf4c94bbdd88a98ab8ad7f75bfe69a08c470200000005ac65516365ffffffff037b5b7b000000000001515dc4d904000000000004bb26010000000004536a6aac00000000\", \"516552516352ac\", 2, 328538756, \"8bb7a0129eaf4b8fc23e911c531b9b7637a21ab11a246352c6c053ff6e93fcb6\"],\n\t[\"c441132102cc82101b6f31c1025066ab089f28108c95f18fa67db179610247086350c163bd010000000651525263ab00ffffffff9b8d56b1f16746f075249b215bdb3516cbbe190fef6292c75b1ad8a8988897c3000000000751ab6553abab00ffffffff02f9078b000000000009ab0053ac51ac00ab51c0422105000000000651006563525200000000\", \"ac51\", 0, -197051790, \"55acd8293ed0be6792150a3d7ced6c5ccd153ca7daf09cee035c1b0dac92bb96\"],\n\t[\"ab82ad3b04545bd86b3bb937eb1af304d3ef1a6d1343ed809b4346cafb79b7297c09e1648202000000086351ac5200535353ffffffff95d32795bbaaf5977a81c2128a9ec0b3c7551b9b1c3d952876fcb423b2dfb9e80000000005515363acac47a7d050ec1a603627ce6cd606b3af314fa7964abcc579d92e19c7aba00cf6c3090d6d4601000000056a516551633e794768bfe39277ebc0db18b5afb5f0c8117dde9b4dfd5697e9027210eca76a9be20d63000000000700520063ab6aacffffffff01ec2ddc050000000008ac52ac65ac65ac5100000000\", \"536300abab\", 1, -2070209841, \"b362da5634f20be7267de78b545d81773d711b82fe9310f23cd0414a8280801d\"],\n\t[\"8bff9d170419fa6d556c65fa227a185fe066efc1decf8a1c490bc5cbb9f742d68da2ab7f320100000007ab000053525365a7a43a80ab9593b9e8b6130a7849603b14b5c9397a190008d89d362250c3a2257504eb810200000007acabacac00ab51ee141be418f003e75b127fd3883dbf4e8c3f6cd05ca4afcaac52edd25dd3027ae70a62a00000000008ac52526a5200536affffffffb8058f4e1d7f220a1d1fa17e96d81dfb9a304a2de4e004250c9a576963a586ae0300000005abacac5363b9bc856c039c01d804000000000951656aac53005365acb0724e00000000000565abab63acea7c7a0000000000036a00ac00000000\", \"6565\", 1, -1349282084, \"2b822737c2affeefae13451d7c9db22ff98e06490005aba57013f6b9bbc97250\"],\n\t[\"0e1633b4041c50f656e882a53fde964e7f0c853b0ada0964fc89ae124a2b7ffc5bc97ea6230100000006ac6aacacabacffffffff2e35f4dfcad2d53ea1c8ada8041d13ea6c65880860d96a14835b025f76b1fbd9000000000351515121270867ef6bf63a91adbaf790a43465c61a096acc5a776b8e5215d4e5cd1492e611f761000000000600ac6aab5265ffffffff63b5fc39bcac83ca80ac36124abafc5caee608f9f63a12479b68473bd4bae769000000000965ac52acac5263acabffffffff0163153e020000000008ab005165ab65515300000000\", \"6a6aac00\", 0, -968477862, \"20732d5073805419f275c53784e78db45e53332ee618a9fcf60a3417a6e2ca69\"],\n\t[\"2b052c24022369e956a8d318e38780ef73b487ba6a8f674a56bdb80a9a63634c6110fb5154010000000251acffffffff48fe138fb7fdaa014d67044bc05940f4127e70c113c6744fbd13f8d51d45143e01000000005710db3804e01aa9030000000008acac6a516a5152abfd55aa01000000000751ab510000ac636d6026010000000000b97da9000000000000fddf3b53\", \"006552\", 0, 595461670, \"685d67d84755906d67a007a7d4fa311519467b9bdc6a351913246a41e082a29f\"],\n\t[\"073bc856015245f03b2ea2da62ccedc44ecb99e4250c7042f596bcb23b294c9dc92cfceb6b02000000095163abab52abab636afe292fb303b7c3f001000000000352636af3c49502000000000400ac6a535851850100000000066aac6553ab6500000000\", \"ab6aab53006aab52\", 0, 247114317, \"123916c6485cf23bfea95654a8815fbf04ce4d21a3b7f862805c241472906658\"],\n\t[\"7888b71403f6d522e414d4ca2e12786247acf3e78f1918f6d727d081a79813d129ee8befce0100000009ab516a6353ab6365abffffffff4a882791bf6400fda7a8209fb2c83c6eef51831bdf0f5dacde648859090797ec030000000153ffffffffbb08957d59fa15303b681bad19ccf670d7d913697a2f4f51584bf85fcf91f1f30200000008526565ac52ac63acffffffff0227c0e8050000000001ac361dc801000000000800515165ab00ab0000000000\", \"656a\", 2, 1869281295, \"f43378a0b7822ad672773944884e866d7a46579ee34f9afc17b20afc1f6cf197\"],\n\t[\"cc4dda57047bd0ca6806243a6a4b108f7ced43d8042a1acaa28083c9160911cf47eab910c40200000007526a0000ab6a63e4154e581fcf52567836c9a455e8b41b162a78c85906ccc1c2b2b300b4c69caaaa2ba0230300000008ab5152ac5100ab65ffffffff69696b523ed4bd41ecd4d65b4af73c9cf77edf0e066138712a8e60a04614ea1c0300000004ab6a000016c9045c7df7836e05ac4b2e397e2dd72a5708f4a8bf6d2bc36adc5af3cacefcf074b8b403000000065352ac5252acffffffff01d7e380050000000000cf4e699a\", \"525163656351\", 1, -776533694, \"ff18c5bffd086e00917c2234f880034d24e7ea2d1e1933a28973d134ca9e35d2\"],\n\t[\"b7877f82019c832707a60cf14fba44cfa254d787501fdd676bd58c744f6e951dbba0b3b77f0200000009ac515263ac53525300a5a36e500148f89c0500000000085265ac6a6a65acab00000000\", \"6563\", 0, -1785108415, \"cb6e4322955af12eb29613c70e1a00ddbb559c887ba844df0bcdebed736dffbd\"],\n\t[\"aeb14046045a28cc59f244c2347134d3434faaf980961019a084f7547218785a2bd03916f3000000000165f852e6104304955bda5fa0b75826ee176211acc4a78209816bbb4419feff984377b2352200000000003a94a5032df1e0d60390715b4b188c330e4bb7b995f07cdef11ced9d17ee0f60bb7ffc8e0100000002516513e343a5c1dc1c80cd4561e9dddad22391a2dbf9c8d2b6048e519343ca1925a9c6f0800a020000000665516365ac513180144a0290db27000000000006ab655151ab5138b187010000000007ab5363abac516a9e5cd98a\", \"53ac\", 0, 478591320, \"e8d89a302ae626898d4775d103867a8d9e81f4fd387af07212adab99946311ef\"],\n\t[\"c9270fe004c7911b791a00999d108ce42f9f1b19ec59143f7b7b04a67400888808487bd59103000000066a0052ac6565b905e76687be2dd7723b22c5e8269bc0f2000a332a289cfc40bc0d617cfe3214a61a85a30300000007ac63ac00635251560871209f21eb0268f175b8b4a06edd0b04162a974cf8b5dada43e499a1f22380d35ede0300000000792213fc58b6342cc8100079f9f5f046fb89f2d92cf0a2cb6d07304d32d9da858757037c0000000008abab51636565516affffffff02c72a8b03000000000452acac530dfb9f05000000000096f94307\", \"5253ab536351\", 3, 543688436, \"0278adbcc476d135493ae9bdcd7b3c2002df17f2d81c17d631c50c73e546c264\"],\n\t[\"57a5a04c0278c8c8e243d2df4bb716f81d41ac41e2df153e7096f5682380c4f441888d9d260300000004ab63ab6afdbe4203525dff42a7b1e628fe22bccaa5edbb34d8ab02faff198e085580ea5fcdb0c61b0000000002ac6affffffff03375e6c05000000000663ab516a6a513cb6260400000000007ca328020000000006516a636a52ab94701cc7\", \"0053ac5152\", 0, -550925626, \"b7ca991ab2e20d0158168df2d3dd842a57ab4a3b67cca8f45b07c4b7d1d11126\"],\n\t[\"072b75a504ad2550c2e9a02614bc9b2a2f50b5b553af7b87c0ef07c64ddc8d8934c96d216401000000036aabaca1387242a5bcd21099b016ad6045bed7dce603472757d9822cc5f602caa4ae20414d378b02000000026a63e4ac816734acdc969538d6f70b8ab43a2589f55e0177a4dc471bdd0eb61d59f0f46f6bb801000000065351526aab52d9f2977be76a492c3a7617b7a16dc29a3b0a7618f328c2f7d4fd9bafe760dc427a5066ef000000000465635165ffffffff02c5793600000000000165296820050000000002ac6300000000\", \"53006a6aac0052ab\", 2, 66084636, \"437e89bb6f70fd2ed2feef33350b6f6483b891305e574da03e580b3efd81ae13\"],\n\t[\"7e27c42d0279c1a05eeb9b9faedcc9be0cab6303bde351a19e5cbb26dd0d594b9d74f40d2b020000000200518c8689a08a01e862d5c4dcb294a2331912ff11c13785be7dce3092f154a005624970f84e0200000000500cf5a601e74c1f0000000000076aab52636a6a5200000000\", \"6500006a5351\", 0, 449533391, \"535ba819d74770d4d613ee19369001576f98837e18e1777b8246238ff2381dd0\"],\n\t[\"11414de403d7f6c0135a9df01cb108c1359b8d4e105be50a3dcba5e6be595c8817217490b20000000003005263ffffffff0c6becb9c3ad301c8dcd92f5cbc07c8bed7973573806d1489316fc77a829da03030000000700005253535352ffffffff2346d74ff9e12e5111aa8779a2025981850d4bf788a48de72baa2e321e4bc9ca00000000056352acab63cc585b64045e0385050000000009ab5253ab516aacac00efa9cf0300000000065200635151acbe80330400000000070063635100ab000be159050000000007525300655300ac00000000\", \"51656a0051ab\", 0, 683137826, \"d4737f3b58f3e5081b35f36f91acde89dda00a6a09d447e516b523e7a99264d5\"],\n\t[\"1c6b5f29033fc139338658237a42456123727c8430019ca25bd71c6168a9e35a2bf54538d80100000008536aac52ac6a6a52ffffffff3fb36be74036ff0c940a0247c451d923c65f826793d0ac2bb3f01ecbec8033290100000007ab000051ab6363ffffffff5d9eca0cf711685105bd060bf7a67321eaef95367acffab36ce8dedddd632ee2000000000652ac6a63ac517167319e032d26de040000000003516363dc38fb010000000000b37b00000000000006ab520051ac534baba51f\", \"636300ababac6563\", 0, -2049129935, \"3282a2ec6b8c87c9303e6060c17b421687db1bd35fbfa0345b48f2490e15b6cc\"],\n\t[\"978b9dad0214cfc7ce392d74d9dcc507350dc34007d72e4125861c63071ebf2cc0a6fd4856020000000651ac6a6aab52ffffffff47f20734e3370e733f87a6edab95a7a268ae44db7a8974e255614836b22938720200000008635265ac51516553ffffffff0137b2560100000000035252ac2f3363e9\", \"006aab6352\", 1, 2014249801, \"55611a5fb1483bce4c14c33ed15198130e788b72cd8929b2ceef4dd68b1806bf\"],\n\t[\"442f1c8703ab39876153c241ab3d69f432ba6db4732bea5002be45c8ca10c3a2356fe0e9590300000001accb2b679cab7c58a660cb6d4b3452c21cd7251a1b77a52c300f655f5baeb6fa27ff5b79880300000003005252e5ccf55712bc8ed6179f6726f8a78f3018a7a0391594b7e286ef5ee99efdcde302a102cc0200000009006352526351536a63ffffffff04443f63030000000006536a63ab63651405fb020000000009ac535351525300ab6a9f172b000000000004ab535263ad5c50050000000008656a65ab630000ac00000000\", \"65636aab006552\", 2, 2125838294, \"b3ff10f21e71ebc8b25fe058c4074c42f08617e0dcc03f9e75d20539d3242644\"],\n\t[\"2b3470dd028083910117f86614cdcfb459ee56d876572510be4df24c72e8f58c70d5f5948b03000000066aab65635265da2c3aac9d42c9baafd4b655c2f3efc181784d8cba5418e053482132ee798408ba43ccf90300000000ffffffff047dda4703000000000765516a52ac53009384a603000000000651636a63ab6a8cf57a03000000000352ab6a8cf6a405000000000952636a6a6565525100661e09cb\", \"ac520063ac6a6a52\", 1, 1405647183, \"9b360c3310d55c845ef537125662b9fe56840c72136891274e9fedfef56f9bb5\"],\n\t[\"d74282b501be95d3c19a5d9da3d49c8a88a7049c573f3788f2c42fc6fa594f59715560b9b00000000009655353525265ac52ac9772121f028f8303030000000003510065af5f47040000000007ac516a6551630000000000\", \"acab53006363ac\", 0, -1113209770, \"2f482b97178f17286f693796a756f4d7bd2dfcdbecd4142528eec1c7a3e5101a\"],\n\t[\"3a5644a9010f199f253f858d65782d3caec0ac64c3262b56893022b9796086275c9d4d097b02000000009d168f7603a67b30050000000007ac51536a0053acd9d88a050000000007655363535263ab3cf1f403000000000352ac6a00000000\", \"005363536565acac6a\", 0, -1383947195, \"6390ab0963cf611e0cea35a71dc958b494b084e6fd71d22217fdc5524787ade6\"],\n\t[\"67b3cc43049d13007485a8133b90d94648bcf30e83ba174f5486ab42c9107c69c5530c5e1f0000000003005100ffffffff9870ebb65c14263282ea8d41e4f4f40df16b565c2cf86f1d22a9494cad03a67f01000000016a5a121bee5e359da548e808ae1ad6dfccae7c67cbb8898d811638a1f455a671e822f228ef030000000151c1fcc9f9825f27c0dde27ea709da62a80a2ff9f6b1b86a5874c50d6c37d39ae31fb6c8a0030000000163553b8786020ca74a00000000000665635153ab5275c0760000000000020052e659b05d\", \"636aab6a6a\", 0, -342795451, \"f77c3322c97b1681c17b1eba461fa27b07e04c1534e8aaf735a49cab72c7c2e2\"],\n\t[\"bda1ff6804a3c228b7a12799a4c20917301dd501c67847d35da497533a606701ad31bf9d5e0300000001ac16a6c5d03cf516cd7364e4cbbf5aeccd62f8fd03cb6675883a0636a7daeb650423cb1291010000000500656553ac4a63c30b6a835606909c9efbae1b2597e9db020c5ecfc0642da6dc583fba4e84167539a8020000000865525353515200acffffffff990807720a5803c305b7da08a9f24b92abe343c42ac9e917a84e1f335aad785d00000000026a52ffffffff04981f20030000000001ab8c762200000000000253ab690b9605000000000151ce88b301000000000753526a6a51006500000000\", \"000052ac52530000\", 1, -1809193140, \"5299b0fb7fc16f40a5d6b337e71fcd1eb04d2600aefd22c06fe9c71fe0b0ba54\"],\n\t[\"2ead28ff0243b3ab285e5d1067f0ec8724224402b21b9cef9be962a8b0d153d401be99bbee0000000004ac635153ffffffff6985987b7c1360c9fa8406dd6e0a61141709f0d5195f946da55ed83be4e3895301000000020053ffffffff016503d20500000000085251ac6a65656a6a00000000\", \"51abab\", 1, 1723793403, \"67483ee62516be17a2431a163e96fd88a08ff2ce8634a52e42c1bc04e30f3f8a\"],\n\t[\"db4904e6026b6dd8d898f278c6428a176410d1ffbde75a4fa37cda12263108ccd4ca6137440100000007656a0000515263ffffffff1db7d5005c1c40da0ed17b74cf6b2a6ee2c33c9e0bacda76c0da2017dcac2fc70200000004abab6a53ffffffff0454cf2103000000000153463aef000000000009ab6a630065ab52636387e0ed050000000000e8d16f05000000000352ac63e4521b22\", \"\", 1, 1027042424, \"48315a95e49277ab6a2d561ee4626820b7bab919eea372b6bf4e9931ab221d04\"],\n\t[\"dca31ad10461ead74751e83d9a81dcee08db778d3d79ad9a6d079cfdb93919ac1b0b61871102000000086500525365ab51ac7f7e9aed78e1ef8d213d40a1c50145403d196019985c837ffe83836222fe3e5955e177e70100000006525152525300ffffffff5e98482883cc08a6fe946f674cca479822f0576a43bf4113de9cbf414ca628060100000006ac53516a5253ffffffff07490b0b898198ec16c23b75d606e14fa16aa3107ef9818594f72d5776805ec502000000036a0052ffffffff01932a2803000000000865ab6551ac6a516a2687aa06\", \"635300ac\", 2, -1880362326, \"74d6a2fa7866fd8b74b2e34693e2d6fd690410384b7afdcd6461b1ae71d265ce\"],\n\t[\"e14e1a9f0442ab44dfc5f6d945ad1ff8a376bc966aad5515421e96ddbe49e529614995cafc03000000055165515165fffffffff97582b8290e5a5cfeb2b0f018882dbe1b43f60b7f45e4dd21dbd3a8b0cfca3b0200000000daa267726fe075db282d694b9fee7d6216d17a8c1f00b2229085495c5dc5b260c8f8cd5d000000000363ac6affffffffaab083d22d0465471c896a438c6ac3abf4d383ae79420617a8e0ba8b9baa872b010000000963526563ac5363ababd948b5ce022113440200000000076a636552006a53229017040000000000e6f62ac8\", \"526353636a65\", 3, -485265025, \"1bc8ad76f9b7c366c5d052dc479d6a8a2015566d3a42e93ab12f727692c89d65\"],\n\t[\"720d4693025ca3d347360e219e9bc746ef8f7bc88e8795162e5e2f0b0fc99dc17116fc937100000000046353520045cb1fd79824a100d30b6946eab9b219daea2b0cdca6c86367c0c36af98f19ac64f3575002000000008a1c881003ed16f3050000000008536a63630000abac45e0e704000000000151f6551a05000000000963536565515363abab00000000\", \"6553ab6a6a510000ab\", 1, 1249091393, \"a575fa4f59a8e90cd07de012c78fe8f981183bb170b9c50fcc292b8c164cbc3b\"],\n\t[\"69df842a04c1410bfca10896467ce664cfa31c681a5dac10106b34d4b9d4d6d0dc1eac01c1000000000551536a5165269835ca4ad7268667b16d0a2df154ec81e304290d5ed69e0069b43f8c89e673328005e200000000076a5153006aacabffffffffc9314bd80b176488f3d634360fcba90c3a659e74a52e100ac91d3897072e3509010000000765abac51636363ffffffff0e0768b13f10f0fbd2fa3f68e4b4841809b3b5ba0e53987c3aaffcf09eee12bf0300000008ac535263526a53ac514f4c2402da8fab0400000000001ef15201000000000451526a52d0ec9aca\", \"525365ac52\", 1, 313967049, \"a72a760b361af41832d2c667c7488dc9702091918d11e344afc234a4aea3ec44\"],\n\t[\"adf2340d03af5c589cb5d28c06635ac07dd0757b884d4777ba85a6a7c410408ad5efa8b19001000000045100ab00ffffffff808dc0231c96e6667c04786865727013922bcb7db20739b686f0c17f5ba70e8f0300000000fd2332a654b580881a5e2bfec8313f5aa878ae94312f37441bf2d226e7fc953dcf0c77ab000000000163aa73dc580412f8c2050000000005636aacac63da02d502000000000153e74b52020000000001536b293d030000000009636552ababacab526500000000\", \"000052ab52ababab\", 0, -568651175, \"2c45d021db545df7167ac03c9ee56473f2398d9b2b739cf3ff3e074501d324f8\"],\n\t[\"e4fec9f10378a95199c1dd23c6228732c9de0d7997bf1c83918a5cfd36012476c0c3cba24002000000085165536500ac0000ad08ab93fb49d77d12a7ccdbb596bc5110876451b53a79fdce43104ff1c316ad63501de801000000046a6352ab76af9908463444aeecd32516a04dd5803e02680ed7f16307242a794024d93287595250f4000000000089807279041a82e603000000000200521429100200000000055253636a63f20b940400000000004049ed04000000000500ab5265ab43dfaf7d\", \"6563526aac\", 2, -1923470368, \"32f3c012eca9a823bebb9b282240aec40ca65df9f38da43b1dcfa0cac0c0df7e\"],\n\t[\"4000d3600100b7a3ff5b41ec8d6ccdc8b2775ad034765bad505192f05d1f55d2bc39d0cbe10100000007ab5165ac6a5163ffffffff034949150100000000026a6a92c9f6000000000008ab6553ab6aab635200e697040000000007636a5353525365237ae7d2\", \"52000063\", 0, -880046683, \"c76146f68f43037289aaeb2bacf47408cddc0fb326b350eb4f5ef6f0f8564793\"],\n\t[\"eabc0aa701fe489c0e4e6222d72b52f083166b49d63ad1410fb98caed027b6a71c02ab830c03000000075253ab63530065ffffffff01a5dc0b05000000000253533e820177\", \"\", 0, 954499283, \"1d849b92eedb9bf26bd4ced52ce9cb0595164295b0526842ab1096001fcd31b1\"],\n\t[\"d48d55d304aad0139783b44789a771539d052db565379f668def5084daba0dfd348f7dcf6b00000000006826f59e5ffba0dd0ccbac89c1e2d69a346531d7f995dea2ca6d7e6d9225d81aec257c6003000000096a655200ac656552acffffffffa188ffbd5365cae844c8e0dea6213c4d1b2407274ae287b769ab0bf293e049eb0300000005ac6a6aab51ad1c407c5b116ca8f65ed496b476183f85f072c5f8a0193a4273e2015b1cc288bf03e9e2030000000252abffffffff04076f44040000000006655353abab53be6500050000000003ac65ac3c15040500000000095100ab536353516a52ed3aba04000000000900ac53ab53636aabac00000000\", \"5253526563acac\", 2, -1506108646, \"bbee17c8582514744bab5df50012c94b0db4aff5984d2e13a8d09421674404e2\"],\n\t[\"9746f45b039bfe723258fdb6be77eb85917af808211eb9d43b15475ee0b01253d33fc3bfc502000000065163006a655312b12562dc9c54e11299210266428632a7d0ee31d04dfc7375dcad2da6e9c11947ced0e000000000009074095a5ac4df057554566dd04740c61490e1d3826000ad9d8f777a93373c8dddc4918a00000000025351ffffffff01287564030000000004636a00ab00000000\", \"52\", 2, -1380411075, \"84af1623366c4db68d81f452b86346832344734492b9c23fbb89015e516c60b2\"],\n\t[\"8731b64903d735ba16da64af537eaf487b57d73977f390baac57c7b567cb2770dfa2ef65870100000001635aedd990c42645482340eacb0bfa4a0a9e888057389c728b5b6a8691cdeb1a6a67b45e140200000008ac53526a52516551ffffffff45c4f567c47b8d999916fd49642cbc5d10d43c304b99e32d044d35091679cb860100000003006a51ffffffff0176d6c200000000000000000000\", \"ab6a65ab53\", 2, -1221546710, \"ccfdba36d9445f4451fb7cbf0752cc89c23d4fc6fff0f3930d20e116f9db0b95\"],\n\t[\"f5cfc52f016209ab1385e890c2865a74e93076595d1ca77cbe8fbf2022a2f2061a90fb0f3e010000000253acffffffff027de73f0200000000085252ac510052acac49cd6a020000000000e6c2cb56\", \"516552535300ab63\", 0, -1195302704, \"5532717402a2da01a1da912d824964024185ca7e8d4ad1748659dc393a14182b\"],\n\t[\"df0a32ae01c4672fd1abd0b2623aae0a1a8256028df57e532f9a472d1a9ceb194267b6ee190200000009536a6a51516a525251b545f9e803469a2302000000000465526500810631040000000000441f5b050000000006530051006aaceb183c76\", \"536a635252ac6a\", 0, 1601138113, \"9a0435996cc58bdba09643927fe48c1fc908d491a050abbef8daec87f323c58f\"],\n\t[\"d102d10c028b9c721abb259fe70bc68962f6cae384dabd77477c59cbeb1fb26266e091ba3e0100000002516affffffffe8d7305a74f43e30c772109849f4cd6fb867c7216e6d92e27605e69a0818899700000000026a65ecf82d58027db4620500000000026552c28ed3010000000001ab00000000\", \"0051ab515365\", 1, -131815460, \"1d1757a782cb5860302128bcbe9398243124a2f82d671a113f74f8e582c7a182\"],\n\t[\"cef930ed01c36fcb1d62ceef931bef57098f27a77a4299904cc0cbb44504802d535fb11557010000000153ffffffff02c8657403000000000863ac655253520063d593380400000000046aab536a00000000\", \"656a0051ab6365ab53\", 0, -351313308, \"e69dba3efb5c02af2ab1087d0a990678784671f4744d01ca097d71aec14dd8e9\"],\n\t[\"b1c0b71804dff30812b92eefb533ac77c4b9fdb9ab2f77120a76128d7da43ad70c20bbfb990200000002536392693e6001bc59411aebf15a3dc62a6566ec71a302141b0c730a3ecc8de5d76538b30f55010000000665535252ac514b740c6271fb9fe69fdf82bf98b459a7faa8a3b62f3af34943ad55df4881e0d93d3ce0ac0200000000c4158866eb9fb73da252102d1e64a3ce611b52e873533be43e6883137d0aaa0f63966f060000000001abffffffff04a605b604000000000851006a656a630052f49a0300000000000252515a94e1050000000009abac65ab0052abab00fd8dd002000000000651535163526a2566852d\", \"ac5363\", 0, -1718831517, \"b0dc030661783dd9939e4bf1a6dfcba809da2017e1b315a6312e5942d714cf05\"],\n\t[\"6a270ee404ebc8d137cfd4bb6b92aa3702213a3139a579c1fc6f56fbc7edd9574ef17b13f30100000009ab00ab656565ababacffffffffaa65b1ab6c6d87260d9e27a472edceb7dd212483e72d90f08857abf1dbfd46d10100000000fffffffff93c4c9c84c4dbbe8a912b99a2830cfe3401aebc919041de063d660e585fc9f002000000096aabacab52ac6a53acfa6dcef3f28355a8d98eee53839455445eeee83eecd2c854e784efa53cee699dbfecaebd0100000003ab6a51ffffffff04f7d71b050000000009ac6a536aac6a6365513c37650500000000065265abab6a53fa742002000000000039ed82030000000009516aac635165ab51ab2fdabd17\", \"ab535252526563\", 1, -1326210506, \"1dec0d5eb921bf5b2df39c8576e19c38d0c17254a4a0b78ac4b5422bcc426258\"],\n\t[\"3657e4260304ccdc19936e47bdf058d36167ee3d4eb145c52b224eff04c9eb5d1b4e434dfc0000000001ab58aefe57707c66328d3cceef2e6f56ab6b7465e587410c5f73555a513ace2b232793a74400000000036a006522e69d3a785b61ad41a635d59b3a06b2780a92173f85f8ed428491d0aaa436619baa9c4501000000046351abab2609629902eb7793050000000000a1b967040000000003525353a34d6192\", \"516a\", 0, -1761874713, \"0a2ff41f6d155d8d0e37cd9438f3b270df9f9214cda8e95c76d5a239ca189df2\"],\n\t[\"a0eb6dc402994e493c787b45d1f946d267b09c596c5edde043e620ce3d59e95b2b5b93d43002000000096a5252526aac63ab6555694287a279e29ee491c177a801cd685b8744a2eab83824255a3bcd08fc0e3ea13fb8820000000009abab6365ab52ab0063ffffffff029e424a040000000008acab53ab516a636a23830f0400000000016adf49c1f9\", \"ac0065ac6500005252\", 1, 669294500, \"e05e3d383631a7ed1b78210c13c2eb26564e5577db7ddfcea2583c7c014091d4\"],\n\t[\"6e67c0d3027701ef71082204c85ed63c700ef1400c65efb62ce3580d187fb348376a23e9710200000001655b91369d3155ba916a0bc6fe4f5d94cad461d899bb8aaac3699a755838bfc229d6828920010000000765536353526a52ffffffff04c0c792000000000005650052535372f79e000000000001527fc0ee010000000005ac5300ab65d1b3e902000000000251aba942b278\", \"6a5151\", 0, 1741407676, \"e657e2c8ec4ebc769ddd3198a83267b47d4f2a419fc737e813812acefad92ff7\"],\n\t[\"8f53639901f1d643e01fc631f632b7a16e831d846a0184cdcda289b8fa7767f0c292eb221a00000000046a53abacffffffff037a2daa01000000000553ac6a6a51eac349020000000005ac526552638421b3040000000007006a005100ac63048a1492\", \"ac65\", 0, 1033685559, \"da86c260d42a692358f46893d6f91563985d86eeb9ea9e21cd38c2d8ffcfcc4d\"],\n\t[\"491f99cb01bdfba1aa235e5538dac081fae9ce55f9622de483afe7e65105c2b0db75d360d200000000045251636340b60f0f041421330300000000096351ac000051636553ce2822040000000005516a00ac5180c8e40300000000025100caa8570400000000020000cfdc8da6\", \"6a5100516aab655365\", 0, -953727341, \"397c68803b7ce953666830b0221a5e2bcf897aa2ded8e36a6b76c497dcb1a2e1\"],\n\t[\"b3cad3a7041c2c17d90a2cd994f6c37307753fa3635e9ef05ab8b1ff121ca11239a0902e700300000009ab635300006aac5163ffffffffcec91722c7468156dce4664f3c783afef147f0e6f80739c83b5f09d5a09a57040200000004516a6552ffffffff969d1c6daf8ef53a70b7cdf1b4102fb3240055a8eaeaed2489617cd84cfd56cf020000000352ab53ffffffff46598b6579494a77b593681c33422a99559b9993d77ca2fa97833508b0c169f80200000009655300655365516351ffffffff04d7ddf800000000000853536a65ac6351ab09f3420300000000056aab65abac33589d04000000000952656a65655151acac944d6f0400000000006a8004ba\", \"005165\", 1, 1035865506, \"fe1dc9e8554deecf8f50c417c670b839cc9d650722ebaaf36572418756075d58\"],\n\t[\"e1cfd73b0125add9e9d699f5a45dca458355af175a7bd4486ebef28f1928d87864384d02df02000000036a0051ffffffff0357df030100000000036a5365777e2d04000000000763ab6a00005265f434a601000000000351655100000000\", \"ab53ab\", 0, -1936500914, \"950f4b4f72ccdf8a6a0f381265d6c8842fdb7e8b3df3e9742905f643b2432b69\"],\n\t[\"cf781855040a755f5ba85eef93837236b34a5d3daeb2dbbdcf58bb811828d806ed05754ab8010000000351ac53ffffffffda1e264727cf55c67f06ebcc56dfe7fa12ac2a994fecd0180ce09ee15c480f7d00000000096351516a51acac00ab53dd49ff9f334befd6d6f87f1a832cddfd826a90b78fd8cf19a52cb8287788af94e939d6020000000700525251ac526310d54a7e8900ed633f0f6f0841145aae7ee0cbbb1e2a0cae724ee4558dbabfdc58ba6855010000000552536a53abfd1b101102c51f910500000000096300656a525252656a300bee010000000009ac52005263635151abe19235c9\", \"53005365\", 2, 1422854188, \"d5981bd4467817c1330da72ddb8760d6c2556cd809264b2d85e6d274609fc3a3\"],\n\t[\"fea256ce01272d125e577c0a09570a71366898280dda279b021000db1325f27edda41a53460100000002ab53c752c21c013c2b3a01000000000000000000\", \"65\", 0, 1145543262, \"076b9f844f6ae429de228a2c337c704df1652c292b6c6494882190638dad9efd\"]\n]\n"
  },
  {
    "path": "src/test/data/tx_invalid.json",
    "content": "[\n[\"The following are deserialized transactions which are invalid.\"],\n[\"They are in the form\"],\n[\"[[[prevout hash, prevout index, prevout scriptPubKey, amount?], [input 2], ...],\"],\n[\"serializedTransaction, verifyFlags]\"],\n[\"Objects that are only a single string (like this one) are ignored\"],\n\n[\"0e1b5688cf179cd9f7cbda1fac0090f6e684bbf8cd946660120197c3f3681809 but with extra junk appended to the end of the scriptPubKey\"],\n[[[\"6ca7ec7b1847f6bdbd737176050e6a08d66ccd55bb94ad24f4018024107a5827\", 0, \"0x41 0x043b640e983c9690a14c039a2037ecc3467b27a0dcd58f19d76c7bc118d09fec45adc5370a1c5bf8067ca9f5557a4cf885fdb0fe0dcc9c3a7137226106fbc779a5 CHECKSIG VERIFY 1\"]],\n\"010000000127587a10248001f424ad94bb55cd6cd6086a0e05767173bdbdf647187beca76c000000004948304502201b822ad10d6adc1a341ae8835be3f70a25201bbff31f59cbb9c5353a5f0eca18022100ea7b2f7074e9aa9cf70aa8d0ffee13e6b45dddabf1ab961bda378bcdb778fa4701ffffffff0100f2052a010000001976a914fc50c5907d86fed474ba5ce8b12a66e0a4c139d888ac00000000\", \"P2SH\"],\n\n[\"This is the nearly-standard transaction with CHECKSIGVERIFY 1 instead of CHECKSIG from tx_valid.json\"],\n[\"but with the signature duplicated in the scriptPubKey with a non-standard pushdata prefix\"],\n[\"See FindAndDelete, which will only remove if it uses the same pushdata prefix as is standard\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x4c 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"Same as above, but with the sig in the scriptSig also pushed with the same non-standard OP_PUSHDATA\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x4c 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006b4c473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"This is the nearly-standard transaction with CHECKSIGVERIFY 1 instead of CHECKSIG from tx_valid.json\"],\n[\"but with the signature duplicated in the scriptPubKey with a different hashtype suffix\"],\n[\"See FindAndDelete, which will only remove if the signature, including the hash type, matches\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a81\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"An invalid P2SH Transaction\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0x7a052c840ba73af26755de42cf01cc9e0a49fef0 EQUAL\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000009085768617420697320ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"Tests for CheckTransaction()\"],\n[\"No outputs\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0x05ab9e14d983742513f0f451e105ffb4198d1dd4 EQUAL\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022100f16703104aab4e4088317c862daec83440242411b039d14280e03dd33b487ab802201318a7be236672c5c56083eb7a5a195bc57a40af7923ff8545016cd3b571e2a601232103c40e5d339df3f30bf753e7e04450ae4ef76c9e45587d1d993bdc4cd06f0651c7acffffffff0000000000\", \"P2SH\"],\n\n[\"Negative output\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0xae609aca8061d77c5e111f6bb62501a6bbe2bfdb EQUAL\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d4830450220063222cbb128731fc09de0d7323746539166544d6c1df84d867ccea84bcc8903022100bf568e8552844de664cd41648a031554327aa8844af34b4f27397c65b92c04de0123210243ec37dee0e2e053a9c976f43147e79bc7d9dc606ea51010af1ac80db6b069e1acffffffff01ffffffffffffffff015100000000\", \"P2SH\"],\n\n[\"MAX_MONEY + 1 output\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0x32afac281462b822adbec5094b8d4d337dd5bd6a EQUAL\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100e1eadba00d9296c743cb6ecc703fd9ddc9b3cd12906176a226ae4c18d6b00796022100a71aef7d2874deff681ba6080f1b278bac7bb99c61b08a85f4311970ffe7f63f012321030c0588dc44d92bdcbf8e72093466766fdc265ead8db64517b0c542275b70fffbacffffffff010140075af0750700015100000000\", \"P2SH\"],\n\n[\"MAX_MONEY output + 1 output\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0xb558cbf4930954aa6a344363a15668d7477ae716 EQUAL\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022027deccc14aa6668e78a8c9da3484fbcd4f9dcc9bb7d1b85146314b21b9ae4d86022100d0b43dece8cfb07348de0ca8bc5b86276fa88f7f2138381128b7c36ab2e42264012321029bb13463ddd5d2cc05da6e84e37536cb9525703cfd8f43afdb414988987a92f6acffffffff020040075af075070001510001000000000000015100000000\", \"P2SH\"],\n\n[\"Duplicate inputs\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0x236d0639db62b0773fd8ac34dc85ae19e9aba80a EQUAL\"]],\n\"01000000020001000000000000000000000000000000000000000000000000000000000000000000006c47304402204bb1197053d0d7799bf1b30cd503c44b58d6240cccbdc85b6fe76d087980208f02204beeed78200178ffc6c74237bb74b3f276bbb4098b5605d814304fe128bf1431012321039e8815e15952a7c3fada1905f8cf55419837133bd7756c0ef14fc8dfe50c0deaacffffffff0001000000000000000000000000000000000000000000000000000000000000000000006c47304402202306489afef52a6f62e90bf750bbcdf40c06f5c6b138286e6b6b86176bb9341802200dba98486ea68380f47ebb19a7df173b99e6bc9c681d6ccf3bde31465d1f16b3012321039e8815e15952a7c3fada1905f8cf55419837133bd7756c0ef14fc8dfe50c0deaacffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"Coinbase of size 1\"],\n[\"Note the input is just required to make the tester happy\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000000\", -1, \"1\"]],\n\"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0151ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"Coinbase of size 101\"],\n[\"Note the input is just required to make the tester happy\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000000\", -1, \"1\"]],\n\"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff655151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"Null txin, but without being a coinbase (because there are two inputs)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000000\", -1, \"1\"],\n  [\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"1\"]],\n\"01000000020000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015100000000\", \"P2SH\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"1\"],\n  [\"0000000000000000000000000000000000000000000000000000000000000000\", -1, \"1\"]],\n\"010000000200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0000000000000000000000000000000000000000000000000000000000000000ffffffff00ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"Same as the transactions in valid with one input SIGHASH_ALL and one SIGHASH_ANYONECANPAY, but we set the _ANYONECANPAY sequence number, invalidating the SIGHASH_ALL signature\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG\"],\n  [\"0000000000000000000000000000000000000000000000000000000000000200\", 0, \"0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG\"]],\n \"01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df10101000000000200000000000000000000000000000000000000000000000000000000000000000000484730440220201dc2d030e380e8f9cfb41b442d930fa5a685bb2c8db5906671f865507d0670022018d9e7a8d4c8d86a73c2a724ee38ef983ec249827e0e464841735955c707ece98101000000010100000000000000015100000000\", \"P2SH\"],\n\n[\"CHECKMULTISIG with incorrect signature order\"],\n[\"Note the input is just required to make the tester happy\"],\n[[[\"b3da01dd4aae683c7aee4d5d8b52a540a508e1115f77cd7fa9a291243f501223\", 0, \"HASH160 0x14 0xb1ce99298d5f07364b57b1e5c9cc00be0b04a954 EQUAL\"]],\n\"01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe000048304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f401483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000\", \"P2SH\"],\n\n\n[\"The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63\"],\n[\"It is an OP_CHECKMULTISIG with the dummy value missing\"],\n[[[\"60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1\", 0, \"1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG\"]],\n\"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004847304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000\", \"P2SH\"],\n\n\n[\"CHECKMULTISIG SCRIPT_VERIFY_NULLDUMMY tests:\"],\n\n[\"The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63\"],\n[\"It is an OP_CHECKMULTISIG with the dummy value set to something other than an empty string\"],\n[[[\"60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1\", 0, \"1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG\"]],\n\"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a010047304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000\", \"P2SH,NULLDUMMY\"],\n\n[\"As above, but using a OP_1\"],\n[[[\"60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1\", 0, \"1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG\"]],\n\"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000495147304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000\", \"P2SH,NULLDUMMY\"],\n\n[\"As above, but using a OP_1NEGATE\"],\n[[[\"60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1\", 0, \"1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG\"]],\n\"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000494f47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000\", \"P2SH,NULLDUMMY\"],\n\n[\"As above, but with the dummy byte missing\"],\n[[[\"60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1\", 0, \"1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG\"]],\n\"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004847304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000\", \"P2SH,NULLDUMMY\"],\n\n\n[\"Empty stack when we try to run CHECKSIG\"],\n[[[\"ad503f72c18df5801ee64d76090afe4c607fb2b822e9b7b63c5826c50e22fc3b\", 0, \"0x21 0x027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5 CHECKSIG NOT\"]],\n\"01000000013bfc220ec526583cb6b7e922b8b27f604cfe0a09764de61e80f58dc1723f50ad0000000000ffffffff0101000000000000002321027c3a97665bf283a102a587a62a30a0c102d4d3b141015e2cae6f64e2543113e5ac00000000\", \"P2SH\"],\n\n\n[\"Inverted versions of tx_valid CODESEPARATOR IF block tests\"],\n\n[\"CODESEPARATOR in an unexecuted IF block does not change what is hashed\"],\n[[[\"a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944\", 0, \"IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1\"]],\n\"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a48304502207a6974a77c591fa13dff60cabbb85a0de9e025c09c65a4b2285e47ce8e22f761022100f0efaac9ff8ac36b10721e0aae1fb975c90500b50c56e8a0cc52b0403f0425dd0151ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n[\"As above, with the IF block executed\"],\n[[[\"a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944\", 0, \"IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1\"]],\n\"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a483045022100fa4a74ba9fd59c59f46c3960cf90cbe0d2b743c471d24a3d5d6db6002af5eebb02204d70ec490fd0f7055a7c45f86514336e3a7f03503dacecabb247fc23f15c83510100ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n[\"CHECKLOCKTIMEVERIFY tests\"],\n\n[\"By-height locks, with argument just beyond tx nLockTime\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"1 CHECKLOCKTIMEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"499999999 CHECKLOCKTIMEVERIFY 1\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000fe64cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"By-time locks, with argument just beyond tx nLockTime (but within numerical boundaries)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"500000001 CHECKLOCKTIMEVERIFY 1\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4294967295 CHECKLOCKTIMEVERIFY 1\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000feffffff\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Argument missing\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"CHECKLOCKTIMEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000001b1010000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Argument negative with by-blockheight nLockTime=0\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"-1 CHECKLOCKTIMEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Argument negative with by-blocktime nLockTime=500,000,000\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"-1 CHECKLOCKTIMEVERIFY 1\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000004005194b1010000000100000000000000000002000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Input locked\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0 CHECKLOCKTIMEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1ffffffff0100000000000000000002000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Another input being unlocked isn't sufficient; the CHECKLOCKTIMEVERIFY-using input must be unlocked\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0 CHECKLOCKTIMEVERIFY 1\"] ,\n  [\"0000000000000000000000000000000000000000000000000000000000000200\", 1, \"1\"]],\n\"010000000200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00020000000000000000000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Argument/tx height/time mismatch, both versions\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0 CHECKLOCKTIMEVERIFY 1\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b100000000010000000000000000000065cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"499999999 CHECKLOCKTIMEVERIFY 1\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"500000000 CHECKLOCKTIMEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"500000000 CHECKLOCKTIMEVERIFY 1\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Argument 2^32 with nLockTime=2^32-1\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4294967296 CHECKLOCKTIMEVERIFY 1\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Same, but with nLockTime=2^31-1\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"2147483648 CHECKLOCKTIMEVERIFY 1\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffff7f\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"6 byte non-minimally-encoded arguments are invalid even if their contents are valid\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x06 0x000000000000 CHECKLOCKTIMEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Failure due to failing CHECKLOCKTIMEVERIFY in scriptSig\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"1\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1000000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Failure due to failing CHECKLOCKTIMEVERIFY in redeemScript\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0xc5b93064159b3b2d6ab506a41b1f50463771b988 EQUAL\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000030251b1000000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"A transaction with a non-standard DER signature.\"],\n[[[\"b1dbc81696c8a9c0fccd0693ab66d7c368dbc38c0def4e800685560ddd1b2132\", 0, \"DUP HASH160 0x14 0x4b3bd7eba3bc0284fd3007be7f3be275e94f5826 EQUALVERIFY CHECKSIG\"]],\n\"010000000132211bdd0d568506804eef0d8cc3db68c3d766ab9306cdfcc0a9c89616c8dbb1000000006c493045022100c7bb0faea0522e74ff220c20c022d2cb6033f8d167fb89e75a50e237a35fd6d202203064713491b1f8ad5f79e623d0219ad32510bfaa1009ab30cbee77b59317d6e30001210237af13eb2d84e4545af287b919c2282019c9691cc509e78e196a9d8274ed1be0ffffffff0100000000000000001976a914f1b3ed2eda9a2ebe5a9374f692877cdf87c0f95b88ac00000000\", \"P2SH,DERSIG\"],\n\n[\"CHECKSEQUENCEVERIFY tests\"],\n\n[\"By-height locks, with argument just beyond txin.nSequence\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"1 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4259839 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000feff40000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"By-time locks, with argument just beyond txin.nSequence (but within numerical boundaries)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4194305 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4259839 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000feff40000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Argument missing\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Argument negative with by-blockheight txin.nSequence=0\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"-1 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Argument negative with by-blocktime txin.nSequence=CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"-1 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Argument/tx height/time mismatch, both versions\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"65535 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4194304 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4259839 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"6 byte non-minimally-encoded arguments are invalid even if their contents are valid\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x06 0x000000000000 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffff00000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Failure due to failing CHECKSEQUENCEVERIFY in scriptSig\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"1\"]],\n\"02000000010001000000000000000000000000000000000000000000000000000000000000000000000251b2000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Failure due to failing CHECKSEQUENCEVERIFY in redeemScript\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0x7c17aff532f22beb54069942f9bf567a66133eaf EQUAL\"]],\n\"0200000001000100000000000000000000000000000000000000000000000000000000000000000000030251b2000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Failure due to insufficient tx.nVersion (<2)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0 CHECKSEQUENCEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4194304 CHECKSEQUENCEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Unknown witness program version (with DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x60 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b00000000000001510002483045022100a3cec69b52cba2d2de623ffffffffff1606184ea55476c0f8189fda231bc9cbb022003181ad597f7c380a7d1c740286b1d022b8b04ded028b833282e055e03b8efef812103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS,DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM\"],\n\n[\"Unknown length for witness program v0\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x15 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3fff\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff04b60300000000000001519e070000000000000151860b0000000000000100960000000000000001510002473044022022fceb54f62f8feea77faac7083c3b56c4676a78f93745adc8a35800bc36adfa022026927df9abcf0a8777829bcfcce3ff0a385fa54c3f9df577405e3ef24ee56479022103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash Single|AnyoneCanPay (same index output value changed)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e80300000000000001516c070000000000000151b80b0000000000000151000248304502210092f4777a0f17bf5aeb8ae768dec5f2c14feabf9d1fe2c89c78dfed0f13fdb86902206da90a86042e252bcd1e80a168c719e4a1ddcc3cebea24b9812c5453c79107e9832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash None|AnyoneCanPay (input sequence changed)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff000100000000000000000000000000000000000000000000000000000000000001000000000100000000010000000000000000000000000000000000000000000000000000000000000200000000ffffffff00000248304502210091b32274295c2a3fa02f5bce92fb2789e3fc6ea947fbe1a76e52ea3f4ef2381a022079ad72aefa3837a2e0c033a8652a59731da05fa4a813f4fc48e87c075037256b822103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash All|AnyoneCanPay (third output value changed)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151540b00000000000001510002483045022100a3cec69b52cba2d2de623eeef89e0ba1606184ea55476c0f8189fda231bc9cbb022003181ad597f7c380a7d1c740286b1d022b8b04ded028b833282e055e03b8efef812103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with a push of 521 bytes\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x00 0x20 0x33198a9bfef674ebddb9ffaa52928017b8472791e54c609cb95f278ac6b1e349\", 1000]],\n\"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015102fd0902000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002755100000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with unknown version which push false on the stack should be invalid (even without DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x60 0x02 0x0000\", 2000]],\n\"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015101010100000000\", \"P2SH,WITNESS\"],\n\n[\"Witness program should leave clean stack\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x00 0x20 0x2f04a3aa051f1f60d695f6c44c0c3d383973dfd446ace8962664a76bb10e31a8\", 2000]],\n\"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01000000000000000001510102515100000000\", \"P2SH,WITNESS\"],\n\n[\"Witness v0 with a push of 2 bytes\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x00 0x02 0x0001\", 2000]],\n\"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015101040002000100000000\", \"P2SH,WITNESS\"],\n\n[\"Unknown witness version with non empty scriptSig\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x60 0x02 0x0001\", 2000]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000151ffffffff010000000000000000015100000000\", \"P2SH,WITNESS\"],\n\n[\"Non witness Single|AnyoneCanPay hash input's position (permutation)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x21 0x03596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71 CHECKSIG\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x21 0x03596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71 CHECKSIG\", 1001]],\n\"010000000200010000000000000000000000000000000000000000000000000000000000000100000049483045022100acb96cfdbda6dc94b489fd06f2d720983b5f350e31ba906cdbd800773e80b21c02200d74ea5bdf114212b4bbe9ed82c36d2e369e302dff57cb60d01c428f0bd3daab83ffffffff0001000000000000000000000000000000000000000000000000000000000000000000004847304402202a0b4b1294d70540235ae033d78e64b4897ec859c7b6f1b2b1d8a02e1d46006702201445e756d2254b0f1dfda9ab8e1e1bc26df9668077403204f32d16a49a36eb6983ffffffff02e9030000000000000151e803000000000000015100000000\", \"P2SH,WITNESS\"],\n\n[\"P2WSH with a redeem representing a witness scriptPubKey should fail\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x00 0x20 0x34b6c399093e06cf9f0f7f660a1abcfe78fcf7b576f43993208edd9518a0ae9b\", 1000]],\n\"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0001045102010100000000\", \"P2SH,WITNESS\"],\n\n[\"33 bytes push should be considered a witness scriptPubKey\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x60 0x21 0xff25429251b5a84f452230a3c75fd886b7fc5a7865ce4a7bb7a9d7c5be6da3dbff\", 1000]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000\", \"P2SH,WITNESS,DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM\"],\n\n[\"FindAndDelete tests\"],\n[\"This is a test of FindAndDelete. The first tx is a spend of normal scriptPubKey and the second tx is a spend of bare P2WSH.\"],\n[\"The redeemScript/witnessScript is CHECKSIGVERIFY <0x30450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01>.\"],\n[\"The signature is <0x30450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01> <pubkey>,\"],\n[\"where the pubkey is obtained through key recovery with sig and the wrong sighash.\"],\n[\"This is to show that FindAndDelete is applied only to non-segwit scripts\"],\n[\"To show that the tests are 'correctly wrong', they should pass by modifying OP_CHECKSIG under interpreter.cpp\"],\n[\"by replacing (sigversion == SIGVERSION_BASE) with (sigversion != SIGVERSION_BASE)\"],\n[\"Non-segwit: wrong sighash (without FindAndDelete) = 1ba1fe3bc90c5d1265460e684ce6774e324f0fabdf67619eda729e64e8b6bc08\"],\n[[[\"f18783ace138abac5d3a7a5cf08e88fe6912f267ef936452e0c27d090621c169\", 7000, \"HASH160 0x14 0x0c746489e2d83cdbb5b90b432773342ba809c134 EQUAL\", 200000]],\n\"010000000169c12106097dc2e0526493ef67f21269fe888ef05c7a3a5dacab38e1ac8387f1581b0000b64830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e012103b12a1ec8428fc74166926318c15e17408fea82dbb157575e16a8c365f546248f4aad4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01ffffffff0101000000000000000000000000\", \"P2SH,WITNESS\"],\n[\"BIP143: wrong sighash (with FindAndDelete) = 71c9cd9b2869b9c70b01b1f0360c148f42dee72297db312638df136f43311f23\"],\n[[[\"f18783ace138abac5d3a7a5cf08e88fe6912f267ef936452e0c27d090621c169\", 7500, \"0x00 0x20 0x9e1be07558ea5cc8e02ed1d80c0911048afad949affa36d5c3951e3159dbea19\", 200000]],\n\"0100000000010169c12106097dc2e0526493ef67f21269fe888ef05c7a3a5dacab38e1ac8387f14c1d000000ffffffff01010000000000000000034830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e012102a9d7ed6e161f0e255c10bbfcca0128a9e2035c2c8da58899c54d22d3a31afdef4aad4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0100000000\", \"P2SH,WITNESS\"],\n[\"This is multisig version of the FindAndDelete tests\"],\n[\"Script is 2 CHECKMULTISIGVERIFY <sig1> <sig2> DROP\"],\n[\"52af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c0395960175\"],\n[\"Signature is 0 <sig1> <sig2> 2 <key1> <key2>\"],\n[\"Should pass by replacing (sigversion == SIGVERSION_BASE) with (sigversion != SIGVERSION_BASE) under OP_CHECKMULTISIG\"],\n[\"Non-segwit: wrong sighash (without FindAndDelete) = 4bc6a53e8e16ef508c19e38bba08831daba85228b0211f323d4cb0999cf2a5e8\"],\n[[[\"9628667ad48219a169b41b020800162287d2c0f713c04157e95c484a8dcb7592\", 7000, \"HASH160 0x14 0x5748407f5ca5cdca53ba30b79040260770c9ee1b EQUAL\", 200000]],\n\"01000000019275cb8d4a485ce95741c013f7c0d28722160008021bb469a11982d47a662896581b0000fd6f01004830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c039596015221023fd5dd42b44769c5653cbc5947ff30ab8871f240ad0c0e7432aefe84b5b4ff3421039d52178dbde360b83f19cf348deb04fa8360e1bf5634577be8e50fafc2b0e4ef4c9552af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c0395960175ffffffff0101000000000000000000000000\", \"P2SH,WITNESS\"],\n[\"BIP143: wrong sighash (with FindAndDelete) = 17c50ec2181ecdfdc85ca081174b248199ba81fff730794d4f69b8ec031f2dce\"],\n[[[\"9628667ad48219a169b41b020800162287d2c0f713c04157e95c484a8dcb7592\", 7500, \"0x00 0x20 0x9b66c15b4e0b4eb49fa877982cafded24859fe5b0e2dbfbe4f0df1de7743fd52\", 200000]],\n\"010000000001019275cb8d4a485ce95741c013f7c0d28722160008021bb469a11982d47a6628964c1d000000ffffffff0101000000000000000007004830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c03959601010221023cb6055f4b57a1580c5a753e19610cafaedf7e0ff377731c77837fd666eae1712102c1b1db303ac232ffa8e5e7cc2cf5f96c6e40d3e6914061204c0541cb2043a0969552af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c039596017500000000\", \"P2SH,WITNESS\"],\n\n[\"SCRIPT_VERIFY_CONST_SCRIPTCODE tests\"],\n[\"All transactions are copied from OP_CODESEPARATOR tests in tx_valid.json\"],\n\n[[[\"bc7fd132fcf817918334822ee6d9bd95c889099c96e07ca2c1eb2cc70db63224\", 0, \"CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG\"]],\n  \"01000000012432b60dc72cebc1a27ce0969c0989c895bdd9e62e8234839117f8fc32d17fbc000000004a493046022100a576b52051962c25e642c0fd3d77ee6c92487048e5d90818bcf5b51abaccd7900221008204f8fb121be4ec3b24483b1f92d89b1b0548513a134e345c5442e86e8617a501ffffffff010000000000000000016a00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n[[[\"83e194f90b6ef21fa2e3a365b63794fb5daa844bdc9b25de30899fcfe7b01047\", 0, \"CODESEPARATOR CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG\"]],\n  \"01000000014710b0e7cf9f8930de259bdc4b84aa5dfb9437b665a3e3a21ff26e0bf994e183000000004a493046022100a166121a61b4eeb19d8f922b978ff6ab58ead8a5a5552bf9be73dc9c156873ea02210092ad9bc43ee647da4f6652c320800debcf08ec20a094a0aaf085f63ecb37a17201ffffffff010000000000000000016a00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n[[[\"326882a7f22b5191f1a0cc9962ca4b878cd969cf3b3a70887aece4d801a0ba5e\", 0, \"0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CODESEPARATOR CHECKSIG\"]],\n  \"01000000015ebaa001d8e4ec7a88703a3bcf69d98c874bca6299cca0f191512bf2a7826832000000004948304502203bf754d1c6732fbf87c5dcd81258aefd30f2060d7bd8ac4a5696f7927091dad1022100f5bcb726c4cf5ed0ed34cc13dadeedf628ae1045b7cb34421bc60b89f4cecae701ffffffff010000000000000000016a00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n[[[\"a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944\", 0, \"0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 1\"]],\n  \"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a900000000924830450221009c0a27f886a1d8cb87f6f595fbc3163d28f7a81ec3c4b252ee7f3ac77fd13ffa02203caa8dfa09713c8c4d7ef575c75ed97812072405d932bd11e6a1593a98b679370148304502201e3861ef39a526406bad1e20ecad06be7375ad40ddb582c9be42d26c3a0d7b240221009d0a3985e96522e59635d19cc4448547477396ce0ef17a58e7d74c3ef464292301ffffffff010000000000000000016a00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n[\"CODESEPARATOR in an unexecuted IF block is still invalid\"],\n[[[\"a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944\", 0, \"IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1\"]],\n  \"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a48304502207a6974a77c591fa13dff60cabbb85a0de9e025c09c65a4b2285e47ce8e22f761022100f0efaac9ff8ac36b10721e0aae1fb975c90500b50c56e8a0cc52b0403f0425dd0100ffffffff010000000000000000016a00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n[\"CODESEPARATOR in an executed IF block is invalid\"],\n[[[\"a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944\", 0, \"IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1\"]],\n  \"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a483045022100fa4a74ba9fd59c59f46c3960cf90cbe0d2b743c471d24a3d5d6db6002af5eebb02204d70ec490fd0f7055a7c45f86514336e3a7f03503dacecabb247fc23f15c83510151ffffffff010000000000000000016a00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n\n[\"Using CHECKSIG with singatures in scriptSigs will trigger FindAndDelete, which is invalid\"],\n[[[\"ccf7f4053a02e653c36ac75c891b7496d0dc5ce5214f6c913d9cf8f1329ebee0\", 0, \"DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG\"]],\n  \"0100000001e0be9e32f1f89c3d916c4f21e55cdcd096741b895cc76ac353e6023a05f4f7cc00000000d86149304602210086e5f736a2c3622ebb62bd9d93d8e5d76508b98be922b97160edc3dcca6d8c47022100b23c312ac232a4473f19d2aeb95ab7bdf2b65518911a0d72d50e38b5dd31dc820121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac4730440220508fa761865c8abd81244a168392876ee1d94e8ed83897066b5e2df2400dad24022043f5ee7538e87e9c6aef7ef55133d3e51da7cc522830a9c4d736977a76ef755c0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n[\"OP_CODESEPARATOR in scriptSig is invalid\"],\n[[[\"10c9f0effe83e97f80f067de2b11c6a00c3088a4bce42c5ae761519af9306f3c\", 1, \"DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG\"]],\n  \"01000000013c6f30f99a5161e75a2ce4bca488300ca0c6112bde67f0807fe983feeff0c91001000000e608646561646265656675ab61493046022100ce18d384221a731c993939015e3d1bcebafb16e8c0b5b5d14097ec8177ae6f28022100bcab227af90bab33c3fe0a9abfee03ba976ee25dc6ce542526e9b2e56e14b7f10121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac493046022100c3b93edcc0fd6250eb32f2dd8a0bba1754b0f6c3be8ed4100ed582f3db73eba2022100bf75b5bd2eff4d6bf2bda2e34a40fcc07d4aa3cf862ceaa77b47b81eff829f9a01ab21038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n[\"Again, FindAndDelete() in scriptSig\"],\n[[[\"6056ebd549003b10cbbd915cea0d82209fe40b8617104be917a26fa92cbe3d6f\", 0, \"DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG\"]],\n  \"01000000016f3dbe2ca96fa217e94b1017860be49f20820dea5c91bdcb103b0049d5eb566000000000fd1d0147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac47304402203757e937ba807e4a5da8534c17f9d121176056406a6465054bdd260457515c1a02200f02eccf1bec0f3a0d65df37889143c2e88ab7acec61a7b6f5aa264139141a2b0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n[[[\"5a6b0021a6042a686b6b94abc36b387bef9109847774e8b1e51eb8cc55c53921\", 1, \"DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG\"]],\n  \"01000000012139c555ccb81ee5b1e87477840991ef7b386bc3ab946b6b682a04a621006b5a01000000fdb40148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f2204148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390175ac4830450220646b72c35beeec51f4d5bc1cbae01863825750d7f490864af354e6ea4f625e9c022100f04b98432df3a9641719dbced53393022e7249fb59db993af1118539830aab870148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a580039017521038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n[\"FindAndDelete() in redeemScript\"],\n[[[\"b5b598de91787439afd5938116654e0b16b7a0d0f82742ba37564219c5afcbf9\", 0, \"DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG\"],\n  [\"ab9805c6d57d7070d9a42c5176e47bb705023e6b67249fb6760880548298e742\", 0, \"HASH160 0x14 0xd8dacdadb7462ae15cd906f1878706d0da8660e6 EQUAL\"]],\n  \"0100000002f9cbafc519425637ba4227f8d0a0b7160b4e65168193d5af39747891de98b5b5000000006b4830450221008dd619c563e527c47d9bd53534a770b102e40faa87f61433580e04e271ef2f960220029886434e18122b53d5decd25f1f4acb2480659fea20aabd856987ba3c3907e0121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffff42e7988254800876b69f24676b3e0205b77be476512ca4d970707dd5c60598ab00000000fd260100483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a53034930460221008431bdfa72bc67f9d41fe72e94c88fb8f359ffa30b33c72c121c5a877d922e1002210089ef5fc22dd8bfc6bf9ffdb01a9862d27687d424d1fefbab9e9c7176844a187a014c9052483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c7153aeffffffff01a08601000000000017a914d8dacdadb7462ae15cd906f1878706d0da8660e68700000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n[\"FindAndDelete() in bare CHECKMULTISIG\"],\n[[[\"ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db\", 0, \"DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG\"],\n  [\"ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db\", 1, \"2 0x48 0x3045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 3 CHECKMULTISIG\"]],\n  \"0100000002dbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce000000006b4830450221009627444320dc5ef8d7f68f35010b4c050a6ed0d96b67a84db99fda9c9de58b1e02203e4b4aaa019e012e65d69b487fdf8719df72f488fa91506a80c49a33929f1fd50121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffffdbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce010000009300483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303ffffffff01a0860100000000001976a9149bc0bbdd3024da4d0c38ed1aecf5c68dd1d3fa1288ac00000000\", \"P2SH,CONST_SCRIPTCODE\"],\n\n[\"Make diffs cleaner by leaving a comment here without comma at the end\"]\n]\n"
  },
  {
    "path": "src/test/data/tx_valid.json",
    "content": "[\n[\"The following are deserialized transactions which are valid.\"],\n[\"They are in the form\"],\n[\"[[[prevout hash, prevout index, prevout scriptPubKey, amount?], [input 2], ...],\"],\n[\"serializedTransaction, verifyFlags]\"],\n[\"Objects that are only a single string (like this one) are ignored\"],\n\n[\"The following is 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63\"],\n[\"It is of particular interest because it contains an invalidly-encoded signature which OpenSSL accepts\"],\n[\"See http://r6.ca/blog/20111119T211504Z.html\"],\n[\"It is also the first OP_CHECKMULTISIG transaction in standard form\"],\n[[[\"60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1\", 0, \"1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG\"]],\n\"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000490047304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000\", \"P2SH\"],\n\n[\"The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63\"],\n[\"It is an OP_CHECKMULTISIG with an arbitrary extra byte stuffed into the signature at pos length - 2\"],\n[\"The dummy byte is fine however, so the NULLDUMMY flag should be happy\"],\n[[[\"60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1\", 0, \"1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG\"]],\n\"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a0048304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2bab01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000\", \"P2SH,NULLDUMMY\"],\n\n[\"The following is a tweaked form of 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63\"],\n[\"It is an OP_CHECKMULTISIG with the dummy value set to something other than an empty string\"],\n[[[\"60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1\", 0, \"1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG\"]],\n\"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba260000000004a01ff47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000\", \"P2SH\"],\n\n[\"As above, but using a OP_1\"],\n[[[\"60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1\", 0, \"1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG\"]],\n\"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000495147304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000\", \"P2SH\"],\n\n[\"As above, but using a OP_1NEGATE\"],\n[[[\"60a20bd93aa49ab4b28d514ec10b06e1829ce6818ec06cd3aabd013ebcdc4bb1\", 0, \"1 0x41 0x04cc71eb30d653c0c3163990c47b976f3fb3f37cccdcbedb169a1dfef58bbfbfaff7d8a473e7e2e6d317b87bafe8bde97e3cf8f065dec022b51d11fcdd0d348ac4 0x41 0x0461cbdcc5409fb4b4d42b51d33381354d80e550078cb532a34bfa2fcfdeb7d76519aecc62770f5b0e4ef8551946d8a540911abe3e7854a26f39f58b25c15342af 2 OP_CHECKMULTISIG\"]],\n\"0100000001b14bdcbc3e01bdaad36cc08e81e69c82e1060bc14e518db2b49aa43ad90ba26000000000494f47304402203f16c6f40162ab686621ef3000b04e75418a0c0cb2d8aebeac894ae360ac1e780220ddc15ecdfc3507ac48e1681a33eb60996631bf6bf5bc0a0682c4db743ce7ca2b01ffffffff0140420f00000000001976a914660d4ef3a743e3e696ad990364e555c271ad504b88ac00000000\", \"P2SH\"],\n\n[\"The following is c99c49da4c38af669dea436d3e73780dfdb6c1ecf9958baa52960e8baee30e73\"],\n[\"It is of interest because it contains a 0-sequence as well as a signature of SIGHASH type 0 (which is not a real type)\"],\n[[[\"406b2b06bcd34d3c8733e6b79f7a394c8a431fbf4ff5ac705c93f4076bb77602\", 0, \"DUP HASH160 0x14 0xdc44b1164188067c3a32d4780f5996fa14a4f2d9 EQUALVERIFY CHECKSIG\"]],\n\"01000000010276b76b07f4935c70acf54fbf1f438a4c397a9fb7e633873c4dd3bc062b6b40000000008c493046022100d23459d03ed7e9511a47d13292d3430a04627de6235b6e51a40f9cd386f2abe3022100e7d25b080f0bb8d8d5f878bba7d54ad2fda650ea8d158a33ee3cbd11768191fd004104b0e2c879e4daf7b9ab68350228c159766676a14f5815084ba166432aab46198d4cca98fa3e9981d0a90b2effc514b76279476550ba3663fdcaff94c38420e9d5000000000100093d00000000001976a9149a7b0f3b80c6baaeedce0a0842553800f832ba1f88ac00000000\", \"P2SH\"],\n\n[\"A nearly-standard transaction with CHECKSIGVERIFY 1 instead of CHECKSIG\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"Same as above, but with the signature duplicated in the scriptPubKey with the proper pushdata prefix\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"DUP HASH160 0x14 0x5b6462475454710f3c22f5fdf0b40704c92f25c3 EQUALVERIFY CHECKSIGVERIFY 1 0x47 0x3044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a01\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006a473044022067288ea50aa799543a536ff9306f8e1cba05b9c6b10951175b924f96732555ed022026d7b5265f38d21541519e4a1e55044d5b9e17e15cdbaf29ae3792e99e883e7a012103ba8c8b86dea131c22ab967e6dd99bdae8eff7a1f75a2c35f1f944109e3fe5e22ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"The following is f7fdd091fa6d8f5e7a8c2458f5c38faffff2d3f1406b6e4fe2c99dcc0d2d1cbb\"],\n[\"It caught a bug in the workaround for 23b397edccd3740a74adb603c9756370fafcde9bcc4483eb271ecad09a94dd63 in an overly simple implementation. In a signature, it contains an ASN1 integer which isn't strict-DER conformant due to being negative, which doesn't make sense in a signature. Before BIP66 activated, it was a valid signature. After it activated, it's not valid any more.\"],\n[[[\"b464e85df2a238416f8bdae11d120add610380ea07f4ef19c5f9dfd472f96c3d\", 0, \"DUP HASH160 0x14 0xbef80ecf3a44500fda1bc92176e442891662aed2 EQUALVERIFY CHECKSIG\"],\n[\"b7978cc96e59a8b13e0865d3f95657561a7f725be952438637475920bac9eb21\", 1, \"DUP HASH160 0x14 0xbef80ecf3a44500fda1bc92176e442891662aed2 EQUALVERIFY CHECKSIG\"]],\n\"01000000023d6cf972d4dff9c519eff407ea800361dd0a121de1da8b6f4138a2f25de864b4000000008a4730440220ffda47bfc776bcd269da4832626ac332adfca6dd835e8ecd83cd1ebe7d709b0e022049cffa1cdc102a0b56e0e04913606c70af702a1149dc3b305ab9439288fee090014104266abb36d66eb4218a6dd31f09bb92cf3cfa803c7ea72c1fc80a50f919273e613f895b855fb7465ccbc8919ad1bd4a306c783f22cd3227327694c4fa4c1c439affffffff21ebc9ba20594737864352e95b727f1a565756f9d365083eb1a8596ec98c97b7010000008a4730440220503ff10e9f1e0de731407a4a245531c9ff17676eda461f8ceeb8c06049fa2c810220c008ac34694510298fa60b3f000df01caa244f165b727d4896eb84f81e46bcc4014104266abb36d66eb4218a6dd31f09bb92cf3cfa803c7ea72c1fc80a50f919273e613f895b855fb7465ccbc8919ad1bd4a306c783f22cd3227327694c4fa4c1c439affffffff01f0da5200000000001976a914857ccd42dded6df32949d4646dfa10a92458cfaa88ac00000000\", \"P2SH\"],\n\n[\"The following tests for the presence of a bug in the handling of SIGHASH_SINGLE\"],\n[\"It results in signing the constant 1, instead of something generated based on the transaction,\"],\n[\"when the input doing the signing has an index greater than the maximum output index\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000200\", 0, \"1\"], [\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"DUP HASH160 0x14 0xe52b482f2faa8ecbf0db344f93c84ac908557f33 EQUALVERIFY CHECKSIG\"]],\n\"01000000020002000000000000000000000000000000000000000000000000000000000000000000000151ffffffff0001000000000000000000000000000000000000000000000000000000000000000000006b483045022100c9cdd08798a28af9d1baf44a6c77bcc7e279f47dc487c8c899911bc48feaffcc0220503c5c50ae3998a733263c5c0f7061b483e2b56c4c41b456e7d2f5a78a74c077032102d5c25adb51b61339d2b05315791e21bbe80ea470a49db0135720983c905aace0ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"The following tests SIGHASH_SINGLE|SIGHASHANYONECANPAY inputs\"],\n[[[\"437a1002eb125dec0f93f635763e0ae45f28ff8e81d82945753d0107611cd390\", 1, \"DUP HASH160 0x14 0x383fb81cb0a3fc724b5e08cf8bbd404336d711f6 EQUALVERIFY CHECKSIG\"],\n  [\"2d48d32ccad087bcda0ac5b31555bd58d1d2568184cbc8e752dd2be2684af03f\", 1, \"DUP HASH160 0x14 0x275ec2a233e5b23d43fa19e7bf9beb0cb3996117 EQUALVERIFY CHECKSIG\"],\n  [\"c76168ef1a272a4f176e55e73157ecfce040cfad16a5272f6296eb7089dca846\", 1, \"DUP HASH160 0x14 0x34fea2c5a75414fd945273ae2d029ce1f28dafcf EQUALVERIFY CHECKSIG\"]],\n\"010000000390d31c6107013d754529d8818eff285fe40a3e7635f6930fec5d12eb02107a43010000006b483045022100f40815ae3c81a0dd851cc8d376d6fd226c88416671346a9033468cca2cdcc6c202204f764623903e6c4bed1b734b75d82c40f1725e4471a55ad4f51218f86130ac038321033d710ab45bb54ac99618ad23b3c1da661631aa25f23bfe9d22b41876f1d46e4effffffff3ff04a68e22bdd52e7c8cb848156d2d158bd5515b3c50adabc87d0ca2cd3482d010000006a4730440220598d263c107004008e9e26baa1e770be30fd31ee55ded1898f7c00da05a75977022045536bead322ca246779698b9c3df3003377090f41afeca7fb2ce9e328ec4af2832102b738b531def73020bd637f32935924cc88549c8206976226d968edd3a42fc2d7ffffffff46a8dc8970eb96622f27a516adcf40e0fcec5731e7556e174f2a271aef6861c7010000006b483045022100c5b90a777a9fdc90c208dbef7290d1fc1be651f47151ee4ccff646872a454cf90220640cfbc4550446968fbbe9d12528f3adf7d87b31541569c59e790db8a220482583210391332546e22bbe8fe3af54addfad6f8b83d05fa4f5e047593d4c07ae938795beffffffff028036be26000000001976a914ddfb29efad43a667465ac59ff14dc6442a1adfca88ac3d5cba01000000001976a914b64dde7a505a13ca986c40e86e984a8dc81368b688ac00000000\", \"P2SH\"],\n\n[\"An invalid P2SH Transaction\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0x7a052c840ba73af26755de42cf01cc9e0a49fef0 EQUAL\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000009085768617420697320ffffffff010000000000000000015100000000\", \"NONE\"],\n\n[\"A valid P2SH Transaction using the standard transaction type put forth in BIP 16\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0x8febbed40483661de6958d957412f82deed8e2f7 EQUAL\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100c66c9cdf4c43609586d15424c54707156e316d88b0a1534c9e6b0d4f311406310221009c0fe51dbc9c4ab7cc25d3fdbeccf6679fe6827f08edf2b4a9f16ee3eb0e438a0123210338e8034509af564c62644c07691942e0c056752008a173c89f60ab2a88ac2ebfacffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"Tests for CheckTransaction()\"],\n[\"MAX_MONEY output\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0x32afac281462b822adbec5094b8d4d337dd5bd6a EQUAL\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006e493046022100e1eadba00d9296c743cb6ecc703fd9ddc9b3cd12906176a226ae4c18d6b00796022100a71aef7d2874deff681ba6080f1b278bac7bb99c61b08a85f4311970ffe7f63f012321030c0588dc44d92bdcbf8e72093466766fdc265ead8db64517b0c542275b70fffbacffffffff010040075af0750700015100000000\", \"P2SH\"],\n\n[\"MAX_MONEY output + 0 output\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0xb558cbf4930954aa6a344363a15668d7477ae716 EQUAL\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000006d483045022027deccc14aa6668e78a8c9da3484fbcd4f9dcc9bb7d1b85146314b21b9ae4d86022100d0b43dece8cfb07348de0ca8bc5b86276fa88f7f2138381128b7c36ab2e42264012321029bb13463ddd5d2cc05da6e84e37536cb9525703cfd8f43afdb414988987a92f6acffffffff020040075af075070001510000000000000000015100000000\", \"P2SH\"],\n\n[\"Coinbase of size 2\"],\n[\"Note the input is just required to make the tester happy\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000000\", -1, \"1\"]],\n\"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025151ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"Coinbase of size 100\"],\n[\"Note the input is just required to make the tester happy\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000000\", -1, \"1\"]],\n\"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff6451515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151ffffffff010000000000000000015100000000\", \"P2SH\"],\n\n[\"Simple transaction with first input is signed with SIGHASH_ALL, second with SIGHASH_ANYONECANPAY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG\"],\n  [\"0000000000000000000000000000000000000000000000000000000000000200\", 0, \"0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG\"]],\n \"010000000200010000000000000000000000000000000000000000000000000000000000000000000049483045022100d180fd2eb9140aeb4210c9204d3f358766eb53842b2a9473db687fa24b12a3cc022079781799cd4f038b85135bbe49ec2b57f306b2bb17101b17f71f000fcab2b6fb01ffffffff0002000000000000000000000000000000000000000000000000000000000000000000004847304402205f7530653eea9b38699e476320ab135b74771e1c48b81a5d041e2ca84b9be7a802200ac8d1f40fb026674fe5a5edd3dea715c27baa9baca51ed45ea750ac9dc0a55e81ffffffff010100000000000000015100000000\", \"P2SH\"],\n\n[\"Same as above, but we change the sequence number of the first input to check that SIGHASH_ANYONECANPAY is being followed\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG\"],\n  [\"0000000000000000000000000000000000000000000000000000000000000200\", 0, \"0x21 0x035e7f0d4d0841bcd56c39337ed086b1a633ee770c1ffdd94ac552a95ac2ce0efc CHECKSIG\"]],\n \"01000000020001000000000000000000000000000000000000000000000000000000000000000000004948304502203a0f5f0e1f2bdbcd04db3061d18f3af70e07f4f467cbc1b8116f267025f5360b022100c792b6e215afc5afc721a351ec413e714305cb749aae3d7fee76621313418df101010000000002000000000000000000000000000000000000000000000000000000000000000000004847304402205f7530653eea9b38699e476320ab135b74771e1c48b81a5d041e2ca84b9be7a802200ac8d1f40fb026674fe5a5edd3dea715c27baa9baca51ed45ea750ac9dc0a55e81ffffffff010100000000000000015100000000\", \"P2SH\"],\n\n[\"afd9c17f8913577ec3509520bd6e5d63e9c0fd2a5f70c787993b097ba6ca9fae which has several SIGHASH_SINGLE signatures\"],\n[[[\"63cfa5a09dc540bf63e53713b82d9ea3692ca97cd608c384f2aa88e51a0aac70\", 0, \"DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG\"],\n [\"04e8d0fcf3846c6734477b98f0f3d4badfb78f020ee097a0be5fe347645b817d\", 1, \"DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG\"],\n [\"ee1377aff5d0579909e11782e1d2f5f7b84d26537be7f5516dd4e43373091f3f\", 1, \"DUP HASH160 0x14 0xdcf72c4fd02f5a987cf9b02f2fabfcac3341a87d EQUALVERIFY CHECKSIG\"]],\n \"010000000370ac0a1ae588aaf284c308d67ca92c69a39e2db81337e563bf40c59da0a5cf63000000006a4730440220360d20baff382059040ba9be98947fd678fb08aab2bb0c172efa996fd8ece9b702201b4fb0de67f015c90e7ac8a193aeab486a1f587e0f54d0fb9552ef7f5ce6caec032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff7d815b6447e35fbea097e00e028fb7dfbad4f3f0987b4734676c84f3fcd0e804010000006b483045022100c714310be1e3a9ff1c5f7cacc65c2d8e781fc3a88ceb063c6153bf950650802102200b2d0979c76e12bb480da635f192cc8dc6f905380dd4ac1ff35a4f68f462fffd032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff3f1f097333e4d46d51f5e77b53264db8f7f5d2e18217e1099957d0f5af7713ee010000006c493046022100b663499ef73273a3788dea342717c2640ac43c5a1cf862c9e09b206fcb3f6bb8022100b09972e75972d9148f2bdd462e5cb69b57c1214b88fc55ca638676c07cfc10d8032103579ca2e6d107522f012cd00b52b9a65fb46f0c57b9b8b6e377c48f526a44741affffffff0380841e00000000001976a914bfb282c70c4191f45b5a6665cad1682f2c9cfdfb88ac80841e00000000001976a9149857cc07bed33a5cf12b9c5e0500b675d500c81188ace0fd1c00000000001976a91443c52850606c872403c0601e69fa34b26f62db4a88ac00000000\", \"P2SH\"],\n\n [\"ddc454a1c0c35c188c98976b17670f69e586d9c0f3593ea879928332f0a069e7, which spends an input that pushes using a PUSHDATA1 that is negative when read as signed\"],\n [[[\"c5510a5dd97a25f43175af1fe649b707b1df8e1a41489bac33a23087027a2f48\", 0, \"0x4c 0xae 0x606563686f2022553246736447566b58312b5a536e587574356542793066794778625456415675534a6c376a6a334878416945325364667657734f53474f36633338584d7439435c6e543249584967306a486956304f376e775236644546673d3d22203e20743b206f70656e73736c20656e63202d7061737320706173733a5b314a564d7751432d707269766b65792d6865785d202d64202d6165732d3235362d636263202d61202d696e207460 DROP DUP HASH160 0x14 0xbfd7436b6265aa9de506f8a994f881ff08cc2872 EQUALVERIFY CHECKSIG\"]],\n \"0100000001482f7a028730a233ac9b48411a8edfb107b749e61faf7531f4257ad95d0a51c5000000008b483045022100bf0bbae9bde51ad2b222e87fbf67530fbafc25c903519a1e5dcc52a32ff5844e022028c4d9ad49b006dd59974372a54291d5764be541574bb0c4dc208ec51f80b7190141049dd4aad62741dc27d5f267f7b70682eee22e7e9c1923b9c0957bdae0b96374569b460eb8d5b40d972e8c7c0ad441de3d94c4a29864b212d56050acb980b72b2bffffffff0180969800000000001976a914e336d0017a9d28de99d16472f6ca6d5a3a8ebc9988ac00000000\", \"P2SH\"],\n\n[\"Correct signature order\"],\n[\"Note the input is just required to make the tester happy\"],\n[[[\"b3da01dd4aae683c7aee4d5d8b52a540a508e1115f77cd7fa9a291243f501223\", 0, \"HASH160 0x14 0xb1ce99298d5f07364b57b1e5c9cc00be0b04a954 EQUAL\"]],\n\"01000000012312503f2491a2a97fcd775f11e108a540a5528b5d4dee7a3c68ae4add01dab300000000fdfe0000483045022100f6649b0eddfdfd4ad55426663385090d51ee86c3481bdc6b0c18ea6c0ece2c0b0220561c315b07cffa6f7dd9df96dbae9200c2dee09bf93cc35ca05e6cdf613340aa0148304502207aacee820e08b0b174e248abd8d7a34ed63b5da3abedb99934df9fddd65c05c4022100dfe87896ab5ee3df476c2655f9fbe5bd089dccbef3e4ea05b5d121169fe7f5f4014c695221031d11db38972b712a9fe1fc023577c7ae3ddb4a3004187d41c45121eecfdbb5b7210207ec36911b6ad2382860d32989c7b8728e9489d7bbc94a6b5509ef0029be128821024ea9fac06f666a4adc3fc1357b7bec1fd0bdece2b9d08579226a8ebde53058e453aeffffffff0180380100000000001976a914c9b99cddf847d10685a4fabaa0baf505f7c3dfab88ac00000000\", \"P2SH\"],\n\n[\"cc60b1f899ec0a69b7c3f25ddf32c4524096a9c5b01cbd84c6d0312a0c478984, which is a fairly strange transaction which relies on OP_CHECKSIG returning 0 when checking a completely invalid sig of length 0\"],\n[[[\"cbebc4da731e8995fe97f6fadcd731b36ad40e5ecb31e38e904f6e5982fa09f7\", 0, \"0x2102085c6600657566acc2d6382a47bc3f324008d2aa10940dd7705a48aa2a5a5e33ac7c2103f5d0fb955f95dd6be6115ce85661db412ec6a08abcbfce7da0ba8297c6cc0ec4ac7c5379a820d68df9e32a147cffa36193c6f7c43a1c8c69cda530e1c6db354bfabdcfefaf3c875379a820f531f3041d3136701ea09067c53e7159c8f9b2746a56c3d82966c54bbc553226879a5479827701200122a59a5379827701200122a59a6353798277537982778779679a68\"]],\n\"0100000001f709fa82596e4f908ee331cb5e0ed46ab331d7dcfaf697fe95891e73dac4ebcb000000008c20ca42095840735e89283fec298e62ac2ddea9b5f34a8cbb7097ad965b87568100201b1b01dc829177da4a14551d2fc96a9db00c6501edfa12f22cd9cefd335c227f483045022100a9df60536df5733dd0de6bc921fab0b3eee6426501b43a228afa2c90072eb5ca02201c78b74266fac7d1db5deff080d8a403743203f109fbcabf6d5a760bf87386d20100ffffffff01c075790000000000232103611f9a45c18f28f06f19076ad571c344c82ce8fcfe34464cf8085217a2d294a6ac00000000\", \"P2SH\"],\n\n[\"Empty pubkey\"],\n[[[\"229257c295e7f555421c1bfec8538dd30a4b5c37c1c8810bbe83cafa7811652c\", 0, \"0x00 CHECKSIG NOT\"]],\n\"01000000012c651178faca83be0b81c8c1375c4b0ad38d53c8fe1b1c4255f5e795c25792220000000049483045022100d6044562284ac76c985018fc4a90127847708c9edb280996c507b28babdc4b2a02203d74eca3f1a4d1eea7ff77b528fde6d5dc324ec2dbfdb964ba885f643b9704cd01ffffffff010100000000000000232102c2410f8891ae918cab4ffc4bb4a3b0881be67c7a1e7faa8b5acf9ab8932ec30cac00000000\", \"P2SH\"],\n\n[\"Empty signature\"],\n[[[\"9ca93cfd8e3806b9d9e2ba1cf64e3cc6946ee0119670b1796a09928d14ea25f7\", 0, \"0x21 0x028a1d66975dbdf97897e3a4aef450ebeb5b5293e4a0b4a6d3a2daaa0b2b110e02 CHECKSIG NOT\"]],\n\"0100000001f725ea148d92096a79b1709611e06e94c63c4ef61cbae2d9b906388efd3ca99c000000000100ffffffff0101000000000000002321028a1d66975dbdf97897e3a4aef450ebeb5b5293e4a0b4a6d3a2daaa0b2b110e02ac00000000\", \"P2SH\"],\n\n[[[\"444e00ed7840d41f20ecd9c11d3f91982326c731a02f3c05748414a4fa9e59be\", 0, \"1 0x00 0x21 0x02136b04758b0b6e363e7a6fbe83aaf527a153db2b060d36cc29f7f8309ba6e458 2 CHECKMULTISIG\"]],\n\"0100000001be599efaa4148474053c2fa031c7262398913f1dc1d9ec201fd44078ed004e44000000004900473044022022b29706cb2ed9ef0cb3c97b72677ca2dfd7b4160f7b4beb3ba806aa856c401502202d1e52582412eba2ed474f1f437a427640306fd3838725fab173ade7fe4eae4a01ffffffff010100000000000000232103ac4bba7e7ca3e873eea49e08132ad30c7f03640b6539e9b59903cf14fd016bbbac00000000\", \"P2SH\"],\n\n[[[\"e16abbe80bf30c080f63830c8dbf669deaef08957446e95940227d8c5e6db612\", 0, \"1 0x21 0x03905380c7013e36e6e19d305311c1b81fce6581f5ee1c86ef0627c68c9362fc9f 0x00 2 CHECKMULTISIG\"]],\n\"010000000112b66d5e8c7d224059e946749508efea9d66bf8d0c83630f080cf30be8bb6ae100000000490047304402206ffe3f14caf38ad5c1544428e99da76ffa5455675ec8d9780fac215ca17953520220779502985e194d84baa36b9bd40a0dbd981163fa191eb884ae83fc5bd1c86b1101ffffffff010100000000000000232103905380c7013e36e6e19d305311c1b81fce6581f5ee1c86ef0627c68c9362fc9fac00000000\", \"P2SH\"],\n\n[[[\"ebbcf4bfce13292bd791d6a65a2a858d59adbf737e387e40370d4e64cc70efb0\", 0, \"2 0x21 0x033bcaa0a602f0d44cc9d5637c6e515b0471db514c020883830b7cefd73af04194 0x21 0x03a88b326f8767f4f192ce252afe33c94d25ab1d24f27f159b3cb3aa691ffe1423 2 CHECKMULTISIG NOT\"]],\n\"0100000001b0ef70cc644e0d37407e387e73bfad598d852a5aa6d691d72b2913cebff4bceb000000004a00473044022068cd4851fc7f9a892ab910df7a24e616f293bcb5c5fbdfbc304a194b26b60fba022078e6da13d8cb881a22939b952c24f88b97afd06b4c47a47d7f804c9a352a6d6d0100ffffffff0101000000000000002321033bcaa0a602f0d44cc9d5637c6e515b0471db514c020883830b7cefd73af04194ac00000000\", \"P2SH\"],\n\n[[[\"ba4cd7ae2ad4d4d13ebfc8ab1d93a63e4a6563f25089a18bf0fc68f282aa88c1\", 0, \"2 0x21 0x037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1 0x21 0x02edc823cd634f2c4033d94f5755207cb6b60c4b1f1f056ad7471c47de5f2e4d50 2 CHECKMULTISIG NOT\"]],\n\"0100000001c188aa82f268fcf08ba18950f263654a3ea6931dabc8bf3ed1d4d42aaed74cba000000004b0000483045022100940378576e069aca261a6b26fb38344e4497ca6751bb10905c76bb689f4222b002204833806b014c26fd801727b792b1260003c55710f87c5adbd7a9cb57446dbc9801ffffffff0101000000000000002321037c615d761e71d38903609bf4f46847266edc2fb37532047d747ba47eaae5ffe1ac00000000\", \"P2SH\"],\n\n\n[\"OP_CODESEPARATOR tests\"],\n\n[\"Test that SignatureHash() removes OP_CODESEPARATOR with FindAndDelete()\"],\n[[[\"bc7fd132fcf817918334822ee6d9bd95c889099c96e07ca2c1eb2cc70db63224\", 0, \"CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG\"]],\n\"01000000012432b60dc72cebc1a27ce0969c0989c895bdd9e62e8234839117f8fc32d17fbc000000004a493046022100a576b52051962c25e642c0fd3d77ee6c92487048e5d90818bcf5b51abaccd7900221008204f8fb121be4ec3b24483b1f92d89b1b0548513a134e345c5442e86e8617a501ffffffff010000000000000000016a00000000\", \"P2SH\"],\n[[[\"83e194f90b6ef21fa2e3a365b63794fb5daa844bdc9b25de30899fcfe7b01047\", 0, \"CODESEPARATOR CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIG\"]],\n\"01000000014710b0e7cf9f8930de259bdc4b84aa5dfb9437b665a3e3a21ff26e0bf994e183000000004a493046022100a166121a61b4eeb19d8f922b978ff6ab58ead8a5a5552bf9be73dc9c156873ea02210092ad9bc43ee647da4f6652c320800debcf08ec20a094a0aaf085f63ecb37a17201ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n[\"Hashed data starts at the CODESEPARATOR\"],\n[[[\"326882a7f22b5191f1a0cc9962ca4b878cd969cf3b3a70887aece4d801a0ba5e\", 0, \"0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CODESEPARATOR CHECKSIG\"]],\n\"01000000015ebaa001d8e4ec7a88703a3bcf69d98c874bca6299cca0f191512bf2a7826832000000004948304502203bf754d1c6732fbf87c5dcd81258aefd30f2060d7bd8ac4a5696f7927091dad1022100f5bcb726c4cf5ed0ed34cc13dadeedf628ae1045b7cb34421bc60b89f4cecae701ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n[\"But only if execution has reached it\"],\n[[[\"a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944\", 0, \"0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 0x21 0x038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041 CHECKSIGVERIFY CODESEPARATOR 1\"]],\n\"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a900000000924830450221009c0a27f886a1d8cb87f6f595fbc3163d28f7a81ec3c4b252ee7f3ac77fd13ffa02203caa8dfa09713c8c4d7ef575c75ed97812072405d932bd11e6a1593a98b679370148304502201e3861ef39a526406bad1e20ecad06be7375ad40ddb582c9be42d26c3a0d7b240221009d0a3985e96522e59635d19cc4448547477396ce0ef17a58e7d74c3ef464292301ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n[\"CODESEPARATOR in an unexecuted IF block does not change what is hashed\"],\n[[[\"a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944\", 0, \"IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1\"]],\n\"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a48304502207a6974a77c591fa13dff60cabbb85a0de9e025c09c65a4b2285e47ce8e22f761022100f0efaac9ff8ac36b10721e0aae1fb975c90500b50c56e8a0cc52b0403f0425dd0100ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n[\"As above, with the IF block executed\"],\n[[[\"a955032f4d6b0c9bfe8cad8f00a8933790b9c1dc28c82e0f48e75b35da0e4944\", 0, \"IF CODESEPARATOR ENDIF 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 CHECKSIGVERIFY CODESEPARATOR 1\"]],\n\"010000000144490eda355be7480f2ec828dcc1b9903793a8008fad8cfe9b0c6b4d2f0355a9000000004a483045022100fa4a74ba9fd59c59f46c3960cf90cbe0d2b743c471d24a3d5d6db6002af5eebb02204d70ec490fd0f7055a7c45f86514336e3a7f03503dacecabb247fc23f15c83510151ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n\n[\"CHECKSIG is legal in scriptSigs\"],\n[[[\"ccf7f4053a02e653c36ac75c891b7496d0dc5ce5214f6c913d9cf8f1329ebee0\", 0, \"DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG\"]],\n\"0100000001e0be9e32f1f89c3d916c4f21e55cdcd096741b895cc76ac353e6023a05f4f7cc00000000d86149304602210086e5f736a2c3622ebb62bd9d93d8e5d76508b98be922b97160edc3dcca6d8c47022100b23c312ac232a4473f19d2aeb95ab7bdf2b65518911a0d72d50e38b5dd31dc820121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac4730440220508fa761865c8abd81244a168392876ee1d94e8ed83897066b5e2df2400dad24022043f5ee7538e87e9c6aef7ef55133d3e51da7cc522830a9c4d736977a76ef755c0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n[\"Same semantics for OP_CODESEPARATOR\"],\n[[[\"10c9f0effe83e97f80f067de2b11c6a00c3088a4bce42c5ae761519af9306f3c\", 1, \"DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG\"]],\n\"01000000013c6f30f99a5161e75a2ce4bca488300ca0c6112bde67f0807fe983feeff0c91001000000e608646561646265656675ab61493046022100ce18d384221a731c993939015e3d1bcebafb16e8c0b5b5d14097ec8177ae6f28022100bcab227af90bab33c3fe0a9abfee03ba976ee25dc6ce542526e9b2e56e14b7f10121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac493046022100c3b93edcc0fd6250eb32f2dd8a0bba1754b0f6c3be8ed4100ed582f3db73eba2022100bf75b5bd2eff4d6bf2bda2e34a40fcc07d4aa3cf862ceaa77b47b81eff829f9a01ab21038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n[\"Signatures are removed from the script they are in by FindAndDelete() in the CHECKSIG code; even multiple instances of one signature can be removed.\"],\n[[[\"6056ebd549003b10cbbd915cea0d82209fe40b8617104be917a26fa92cbe3d6f\", 0, \"DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG\"]],\n\"01000000016f3dbe2ca96fa217e94b1017860be49f20820dea5c91bdcb103b0049d5eb566000000000fd1d0147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140147304402203989ac8f9ad36b5d0919d97fa0a7f70c5272abee3b14477dc646288a8b976df5022027d19da84a066af9053ad3d1d7459d171b7e3a80bc6c4ef7a330677a6be548140121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ac47304402203757e937ba807e4a5da8534c17f9d121176056406a6465054bdd260457515c1a02200f02eccf1bec0f3a0d65df37889143c2e88ab7acec61a7b6f5aa264139141a2b0121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n[\"That also includes ahead of the opcode being executed.\"],\n[[[\"5a6b0021a6042a686b6b94abc36b387bef9109847774e8b1e51eb8cc55c53921\", 1, \"DUP HASH160 0x14 0xee5a6aa40facefb2655ac23c0c28c57c65c41f9b EQUALVERIFY CHECKSIG\"]],\n\"01000000012139c555ccb81ee5b1e87477840991ef7b386bc3ab946b6b682a04a621006b5a01000000fdb40148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390121038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f2204148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a5800390175ac4830450220646b72c35beeec51f4d5bc1cbae01863825750d7f490864af354e6ea4f625e9c022100f04b98432df3a9641719dbced53393022e7249fb59db993af1118539830aab870148304502201723e692e5f409a7151db386291b63524c5eb2030df652b1f53022fd8207349f022100b90d9bbf2f3366ce176e5e780a00433da67d9e5c79312c6388312a296a580039017521038479a0fa998cd35259a2ef0a7a5c68662c1474f88ccb6d08a7677bbec7f22041ffffffff010000000000000000016a00000000\", \"P2SH\"],\n\n[\"Finally CHECKMULTISIG removes all signatures prior to hashing the script containing those signatures. In conjunction with the SIGHASH_SINGLE bug this lets us test whether or not FindAndDelete() is actually present in scriptPubKey/redeemScript evaluation by including a signature of the digest 0x01 We can compute in advance for our pubkey, embed it in the scriptPubKey, and then also using a normal SIGHASH_ALL signature. If FindAndDelete() wasn't run, the 'bugged' signature would still be in the hashed script, and the normal signature would fail.\"],\n\n[\"Here's an example on mainnet within a P2SH redeemScript. Remarkably it's a standard transaction in <0.9\"],\n[[[\"b5b598de91787439afd5938116654e0b16b7a0d0f82742ba37564219c5afcbf9\", 0, \"DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG\"],\n  [\"ab9805c6d57d7070d9a42c5176e47bb705023e6b67249fb6760880548298e742\", 0, \"HASH160 0x14 0xd8dacdadb7462ae15cd906f1878706d0da8660e6 EQUAL\"]],\n\"0100000002f9cbafc519425637ba4227f8d0a0b7160b4e65168193d5af39747891de98b5b5000000006b4830450221008dd619c563e527c47d9bd53534a770b102e40faa87f61433580e04e271ef2f960220029886434e18122b53d5decd25f1f4acb2480659fea20aabd856987ba3c3907e0121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffff42e7988254800876b69f24676b3e0205b77be476512ca4d970707dd5c60598ab00000000fd260100483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a53034930460221008431bdfa72bc67f9d41fe72e94c88fb8f359ffa30b33c72c121c5a877d922e1002210089ef5fc22dd8bfc6bf9ffdb01a9862d27687d424d1fefbab9e9c7176844a187a014c9052483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71210378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c7153aeffffffff01a08601000000000017a914d8dacdadb7462ae15cd906f1878706d0da8660e68700000000\", \"P2SH\"],\n\n[\"Same idea, but with bare CHECKMULTISIG\"],\n[[[\"ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db\", 0, \"DUP HASH160 0x14 0xf6f365c40f0739b61de827a44751e5e99032ed8f EQUALVERIFY CHECKSIG\"],\n  [\"ceafe58e0f6e7d67c0409fbbf673c84c166e3c5d3c24af58f7175b18df3bb3db\", 1, \"2 0x48 0x3045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 0x21 0x0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71 3 CHECKMULTISIG\"]],\n\"0100000002dbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce000000006b4830450221009627444320dc5ef8d7f68f35010b4c050a6ed0d96b67a84db99fda9c9de58b1e02203e4b4aaa019e012e65d69b487fdf8719df72f488fa91506a80c49a33929f1fd50121022b78b756e2258af13779c1a1f37ea6800259716ca4b7f0b87610e0bf3ab52a01ffffffffdbb33bdf185b17f758af243c5d3c6e164cc873f6bb9f40c0677d6e0f8ee5afce010000009300483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303483045022015bd0139bcccf990a6af6ec5c1c52ed8222e03a0d51c334df139968525d2fcd20221009f9efe325476eb64c3958e4713e9eefe49bf1d820ed58d2112721b134e2a1a5303ffffffff01a0860100000000001976a9149bc0bbdd3024da4d0c38ed1aecf5c68dd1d3fa1288ac00000000\", \"P2SH\"],\n\n\n[\"CHECKLOCKTIMEVERIFY tests\"],\n\n[\"By-height locks, with argument == 0 and == tx nLockTime\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0 CHECKLOCKTIMEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"499999999 CHECKLOCKTIMEVERIFY 1\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0 CHECKLOCKTIMEVERIFY 1\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ff64cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"By-time locks, with argument just beyond tx nLockTime (but within numerical boundaries)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"500000000 CHECKLOCKTIMEVERIFY 1\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4294967295 CHECKLOCKTIMEVERIFY 1\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"500000000 CHECKLOCKTIMEVERIFY 1\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000ffffffff\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Any non-maxint nSequence is fine\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0 CHECKLOCKTIMEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000feffffff0100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"The argument can be calculated rather than created directly by a PUSHDATA\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"499999999 1ADD CHECKLOCKTIMEVERIFY 1\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000065cd1d\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Perhaps even by an ADD producing a 5-byte result that is out of bounds for other opcodes\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"2147483647 2147483647 ADD CHECKLOCKTIMEVERIFY 1\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000feffffff\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"5 byte non-minimally-encoded arguments are valid\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x05 0x0000000000 CHECKLOCKTIMEVERIFY 1\"]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Valid CHECKLOCKTIMEVERIFY in scriptSig\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"1\"]],\n\"01000000010001000000000000000000000000000000000000000000000000000000000000000000000251b1000000000100000000000000000001000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"Valid CHECKLOCKTIMEVERIFY in redeemScript\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0xc5b93064159b3b2d6ab506a41b1f50463771b988 EQUAL\"]],\n\"0100000001000100000000000000000000000000000000000000000000000000000000000000000000030251b1000000000100000000000000000001000000\", \"P2SH,CHECKLOCKTIMEVERIFY\"],\n\n[\"A transaction with a non-standard DER signature.\"],\n[[[\"b1dbc81696c8a9c0fccd0693ab66d7c368dbc38c0def4e800685560ddd1b2132\", 0, \"DUP HASH160 0x14 0x4b3bd7eba3bc0284fd3007be7f3be275e94f5826 EQUALVERIFY CHECKSIG\"]],\n\"010000000132211bdd0d568506804eef0d8cc3db68c3d766ab9306cdfcc0a9c89616c8dbb1000000006c493045022100c7bb0faea0522e74ff220c20c022d2cb6033f8d167fb89e75a50e237a35fd6d202203064713491b1f8ad5f79e623d0219ad32510bfaa1009ab30cbee77b59317d6e30001210237af13eb2d84e4545af287b919c2282019c9691cc509e78e196a9d8274ed1be0ffffffff0100000000000000001976a914f1b3ed2eda9a2ebe5a9374f692877cdf87c0f95b88ac00000000\", \"P2SH\"],\n\n[\"CHECKSEQUENCEVERIFY tests\"],\n\n[\"By-height locks, with argument == 0 and == txin.nSequence\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"65535 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffff00000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"65535 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffbf7f0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffbf7f0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"By-time locks, with argument == 0 and == txin.nSequence\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4194304 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4259839 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffff40000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4259839 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffff7f0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4194304 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffff7f0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Upper sequence with upper sequence is fine\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"2147483648 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000800100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4294967295 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000800100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"2147483648 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000feffffff0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4294967295 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000feffffff0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"2147483648 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4294967295 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Argument 2^31 with various nSequence\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"2147483648 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffbf7f0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"2147483648 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffff7f0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"2147483648 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Argument 2^32-1 with various nSequence\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4294967295 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffbf7f0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4294967295 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffff7f0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4294967295 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Argument 3<<31 with various nSequence\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"6442450944 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffbf7f0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"6442450944 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffff7f0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"6442450944 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff0100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"5 byte non-minimally-encoded operandss are valid\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x05 0x0000000000 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"The argument can be calculated rather than created directly by a PUSHDATA\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4194303 1ADD CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"4194304 1SUB CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000ffff00000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"An ADD producing a 5-byte result that sets CTxIn::SEQUENCE_LOCKTIME_DISABLE_FLAG\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"2147483647 65536 CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"2147483647 4259840 ADD CHECKSEQUENCEVERIFY 1\"]],\n\"020000000100010000000000000000000000000000000000000000000000000000000000000000000000000040000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Valid CHECKSEQUENCEVERIFY in scriptSig\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"1\"]],\n\"02000000010001000000000000000000000000000000000000000000000000000000000000000000000251b2010000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Valid CHECKSEQUENCEVERIFY in redeemScript\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0x7c17aff532f22beb54069942f9bf567a66133eaf EQUAL\"]],\n\"0200000001000100000000000000000000000000000000000000000000000000000000000000000000030251b2010000000100000000000000000000000000\", \"P2SH,CHECKSEQUENCEVERIFY\"],\n\n[\"Valid P2WPKH (Private key of segwit tests is L5AQtV2HDm4xGsseLokK2VAT2EtYKcTm3c7HwqnJBFt9LdaQULsM)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1000]],\n\"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac02483045022100cfb07164b36ba64c1b1e8c7720a56ad64d96f6ef332d3d37f9cb3c96477dc44502200a464cd7a9cf94cd70f66ce4f4f0625ef650052c7afcfe29d7d7e01830ff91ed012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7100000000\", \"P2SH,WITNESS\"],\n\n[\"Valid P2WSH\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x00 0x20 0xff25429251b5a84f452230a3c75fd886b7fc5a7865ce4a7bb7a9d7c5be6da3db\", 1000]],\n\"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac02483045022100aa5d8aa40a90f23ce2c3d11bc845ca4a12acd99cbea37de6b9f6d86edebba8cb022022dedc2aa0a255f74d04c0b76ece2d7c691f9dd11a64a8ac49f62a99c3a05f9d01232103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ac00000000\", \"P2SH,WITNESS\"],\n\n[\"Valid P2SH(P2WPKH)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0xfe9c7dacc9fcfbf7e3b7d5ad06aa2b28c5a7b7e3 EQUAL\", 1000]],\n\"01000000000101000100000000000000000000000000000000000000000000000000000000000000000000171600144c9c3dfac4207d5d8cb89df5722cb3d712385e3fffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac02483045022100cfb07164b36ba64c1b1e8c7720a56ad64d96f6ef332d3d37f9cb3c96477dc44502200a464cd7a9cf94cd70f66ce4f4f0625ef650052c7afcfe29d7d7e01830ff91ed012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7100000000\", \"P2SH,WITNESS\"],\n\n[\"Valid P2SH(P2WSH)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"HASH160 0x14 0x2135ab4f0981830311e35600eebc7376dce3a914 EQUAL\", 1000]],\n\"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000023220020ff25429251b5a84f452230a3c75fd886b7fc5a7865ce4a7bb7a9d7c5be6da3dbffffffff01e8030000000000001976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac02483045022100aa5d8aa40a90f23ce2c3d11bc845ca4a12acd99cbea37de6b9f6d86edebba8cb022022dedc2aa0a255f74d04c0b76ece2d7c691f9dd11a64a8ac49f62a99c3a05f9d01232103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ac00000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash Single|AnyoneCanPay\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3100],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1100],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 3, \"0x51\", 4100]],\n\"0100000000010400010000000000000000000000000000000000000000000000000000000000000200000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000300000000ffffffff05540b0000000000000151d0070000000000000151840300000000000001513c0f00000000000001512c010000000000000151000248304502210092f4777a0f17bf5aeb8ae768dec5f2c14feabf9d1fe2c89c78dfed0f13fdb86902206da90a86042e252bcd1e80a168c719e4a1ddcc3cebea24b9812c5453c79107e9832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71000000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash Single|AnyoneCanPay (same signature as previous)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b0000000000000151000248304502210092f4777a0f17bf5aeb8ae768dec5f2c14feabf9d1fe2c89c78dfed0f13fdb86902206da90a86042e252bcd1e80a168c719e4a1ddcc3cebea24b9812c5453c79107e9832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash Single\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff0484030000000000000151d0070000000000000151540b0000000000000151c800000000000000015100024730440220699e6b0cfe015b64ca3283e6551440a34f901ba62dd4c72fe1cb815afb2e6761022021cc5e84db498b1479de14efda49093219441adc6c543e5534979605e273d80b032103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash Single (same signature as previous)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b000000000000015100024730440220699e6b0cfe015b64ca3283e6551440a34f901ba62dd4c72fe1cb815afb2e6761022021cc5e84db498b1479de14efda49093219441adc6c543e5534979605e273d80b032103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash None|AnyoneCanPay\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3100],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1100],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 3, \"0x51\", 4100]],\n\"0100000000010400010000000000000000000000000000000000000000000000000000000000000200000000ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000300000000ffffffff04b60300000000000001519e070000000000000151860b00000000000001009600000000000000015100000248304502210091b32274295c2a3fa02f5bce92fb2789e3fc6ea947fbe1a76e52ea3f4ef2381a022079ad72aefa3837a2e0c033a8652a59731da05fa4a813f4fc48e87c075037256b822103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash None|AnyoneCanPay (same signature as previous)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b0000000000000151000248304502210091b32274295c2a3fa02f5bce92fb2789e3fc6ea947fbe1a76e52ea3f4ef2381a022079ad72aefa3837a2e0c033a8652a59731da05fa4a813f4fc48e87c075037256b822103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash None\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff04b60300000000000001519e070000000000000151860b0000000000000100960000000000000001510002473044022022fceb54f62f8feea77faac7083c3b56c4676a78f93745adc8a35800bc36adfa022026927df9abcf0a8777829bcfcce3ff0a385fa54c3f9df577405e3ef24ee56479022103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash None (same signature as previous)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b00000000000001510002473044022022fceb54f62f8feea77faac7083c3b56c4676a78f93745adc8a35800bc36adfa022026927df9abcf0a8777829bcfcce3ff0a385fa54c3f9df577405e3ef24ee56479022103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash None (same signature, only sequences changed)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"01000000000103000100000000000000000000000000000000000000000000000000000000000000000000000200000000010000000000000000000000000000000000000000000000000000000000000100000000ffffffff000100000000000000000000000000000000000000000000000000000000000002000000000200000003e8030000000000000151d0070000000000000151b80b00000000000001510002473044022022fceb54f62f8feea77faac7083c3b56c4676a78f93745adc8a35800bc36adfa022026927df9abcf0a8777829bcfcce3ff0a385fa54c3f9df577405e3ef24ee56479022103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash All|AnyoneCanPay\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3100],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1100],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 3, \"0x51\", 4100]],\n\"0100000000010400010000000000000000000000000000000000000000000000000000000000000200000000ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000300000000ffffffff03e8030000000000000151d0070000000000000151b80b0000000000000151000002483045022100a3cec69b52cba2d2de623eeef89e0ba1606184ea55476c0f8189fda231bc9cbb022003181ad597f7c380a7d1c740286b1d022b8b04ded028b833282e055e03b8efef812103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with SigHash All|AnyoneCanPay (same signature as previous)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b00000000000001510002483045022100a3cec69b52cba2d2de623eeef89e0ba1606184ea55476c0f8189fda231bc9cbb022003181ad597f7c380a7d1c740286b1d022b8b04ded028b833282e055e03b8efef812103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Unknown witness program version  (without DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x60 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 2000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"0x51\", 3000]],\n\"0100000000010300010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000200000000ffffffff03e8030000000000000151d0070000000000000151b80b00000000000001510002483045022100a3cec69b52cba2d2de623ffffffffff1606184ea55476c0f8189fda231bc9cbb022003181ad597f7c380a7d1c740286b1d022b8b04ded028b833282e055e03b8efef812103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Witness with a push of 520 bytes\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x00 0x20 0x33198a9bfef674ebddb9ffaa52928017b8472791e54c609cb95f278ac6b1e349\", 1000]],\n\"0100000000010100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff010000000000000000015102fd08020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002755100000000\", \"P2SH,WITNESS\"],\n\n[\"Transaction mixing all SigHash, segwit and normal inputs\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1001],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 2, \"DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG\", 1002],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 3, \"DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG\", 1003],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 4, \"DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG\", 1004],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 5, \"DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG\", 1005],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 6, \"DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG\", 1006],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 7, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1007],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 8, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1008],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 9, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1009],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 10, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1010],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 11, \"DUP HASH160 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f EQUALVERIFY CHECKSIG\", 1011]],\n\"0100000000010c00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff0001000000000000000000000000000000000000000000000000000000000000020000006a473044022026c2e65b33fcd03b2a3b0f25030f0244bd23cc45ae4dec0f48ae62255b1998a00220463aa3982b718d593a6b9e0044513fd67a5009c2fdccc59992cffc2b167889f4012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff0001000000000000000000000000000000000000000000000000000000000000030000006a4730440220008bd8382911218dcb4c9f2e75bf5c5c3635f2f2df49b36994fde85b0be21a1a02205a539ef10fb4c778b522c1be852352ea06c67ab74200977c722b0bc68972575a012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff0001000000000000000000000000000000000000000000000000000000000000040000006b483045022100d9436c32ff065127d71e1a20e319e4fe0a103ba0272743dbd8580be4659ab5d302203fd62571ee1fe790b182d078ecfd092a509eac112bea558d122974ef9cc012c7012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff0001000000000000000000000000000000000000000000000000000000000000050000006a47304402200e2c149b114ec546015c13b2b464bbcb0cdc5872e6775787527af6cbc4830b6c02207e9396c6979fb15a9a2b96ca08a633866eaf20dc0ff3c03e512c1d5a1654f148012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff0001000000000000000000000000000000000000000000000000000000000000060000006b483045022100b20e70d897dc15420bccb5e0d3e208d27bdd676af109abbd3f88dbdb7721e6d6022005836e663173fbdfe069f54cde3c2decd3d0ea84378092a5d9d85ec8642e8a41012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff00010000000000000000000000000000000000000000000000000000000000000700000000ffffffff00010000000000000000000000000000000000000000000000000000000000000800000000ffffffff00010000000000000000000000000000000000000000000000000000000000000900000000ffffffff00010000000000000000000000000000000000000000000000000000000000000a00000000ffffffff00010000000000000000000000000000000000000000000000000000000000000b0000006a47304402206639c6e05e3b9d2675a7f3876286bdf7584fe2bbd15e0ce52dd4e02c0092cdc60220757d60b0a61fc95ada79d23746744c72bac1545a75ff6c2c7cdb6ae04e7e9592012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71ffffffff0ce8030000000000000151e9030000000000000151ea030000000000000151eb030000000000000151ec030000000000000151ed030000000000000151ee030000000000000151ef030000000000000151f0030000000000000151f1030000000000000151f2030000000000000151f30300000000000001510248304502210082219a54f61bf126bfc3fa068c6e33831222d1d7138c6faa9d33ca87fd4202d6022063f9902519624254d7c2c8ea7ba2d66ae975e4e229ae38043973ec707d5d4a83012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7102473044022017fb58502475848c1b09f162cb1688d0920ff7f142bed0ef904da2ccc88b168f02201798afa61850c65e77889cbcd648a5703b487895517c88f85cdd18b021ee246a012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7100000000000247304402202830b7926e488da75782c81a54cd281720890d1af064629ebf2e31bf9f5435f30220089afaa8b455bbeb7d9b9c3fe1ed37d07685ade8455c76472cda424d93e4074a012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7102473044022026326fcdae9207b596c2b05921dbac11d81040c4d40378513670f19d9f4af893022034ecd7a282c0163b89aaa62c22ec202cef4736c58cd251649bad0d8139bcbf55012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71024730440220214978daeb2f38cd426ee6e2f44131a33d6b191af1c216247f1dd7d74c16d84a02205fdc05529b0bc0c430b4d5987264d9d075351c4f4484c16e91662e90a72aab24012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710247304402204a6e9f199dc9672cf2ff8094aaa784363be1eb62b679f7ff2df361124f1dca3302205eeb11f70fab5355c9c8ad1a0700ea355d315e334822fa182227e9815308ee8f012103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710000000000\", \"P2SH,WITNESS\"],\n\n[\"Unknown version witness program with empty witness\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x60 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1000]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000\", \"P2SH,WITNESS\"],\n\n[\"Witness SIGHASH_SINGLE with output out of bound\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x51\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x20 0x4d6c2a32c87821d68fc016fca70797abdb80df6cd84651d40a9300c6bad79e62\", 1000]],\n\"0100000000010200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff01d00700000000000001510003483045022100e078de4e96a0e05dcdc0a414124dd8475782b5f3f0ed3f607919e9a5eeeb22bf02201de309b3a3109adb3de8074b3610d4cf454c49b61247a2779a0bcbf31c889333032103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc711976a9144c9c3dfac4207d5d8cb89df5722cb3d712385e3f88ac00000000\", \"P2SH,WITNESS\"],\n\n[\"1 byte push should not be considered a witness scriptPubKey\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x60 0x01 0x01\", 1000]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000\", \"P2SH,WITNESS,DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM\"],\n\n[\"41 bytes push should not be considered a witness scriptPubKey\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x60 0x29 0xff25429251b5a84f452230a3c75fd886b7fc5a7865ce4a7bb7a9d7c5be6da3dbff0000000000000000\", 1000]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000\", \"P2SH,WITNESS,DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM\"],\n\n[\"The witness version must use OP_1 to OP_16 only\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x01 0x10 0x02 0x0001\", 1000]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000\", \"P2SH,WITNESS,DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM\"],\n\n[\"The witness program push must be canonical\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x60 0x4c02 0x0001\", 1000]],\n\"010000000100010000000000000000000000000000000000000000000000000000000000000000000000ffffffff01e803000000000000015100000000\", \"P2SH,WITNESS,DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM\"],\n\n[\"Witness Single|AnyoneCanPay does not hash input's position\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1001]],\n\"0100000000010200010000000000000000000000000000000000000000000000000000000000000000000000ffffffff00010000000000000000000000000000000000000000000000000000000000000100000000ffffffff02e8030000000000000151e90300000000000001510247304402206d59682663faab5e4cb733c562e22cdae59294895929ec38d7c016621ff90da0022063ef0af5f970afe8a45ea836e3509b8847ed39463253106ac17d19c437d3d56b832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710248304502210085001a820bfcbc9f9de0298af714493f8a37b3b354bfd21a7097c3e009f2018c022050a8b4dbc8155d4d04da2f5cdd575dcf8dd0108de8bec759bd897ea01ecb3af7832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7100000000\", \"P2SH,WITNESS\"],\n\n[\"Witness Single|AnyoneCanPay does not hash input's position (permutation)\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1001],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x00 0x14 0x4c9c3dfac4207d5d8cb89df5722cb3d712385e3f\", 1000]],\n\"0100000000010200010000000000000000000000000000000000000000000000000000000000000100000000ffffffff00010000000000000000000000000000000000000000000000000000000000000000000000ffffffff02e9030000000000000151e80300000000000001510248304502210085001a820bfcbc9f9de0298af714493f8a37b3b354bfd21a7097c3e009f2018c022050a8b4dbc8155d4d04da2f5cdd575dcf8dd0108de8bec759bd897ea01ecb3af7832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc710247304402206d59682663faab5e4cb733c562e22cdae59294895929ec38d7c016621ff90da0022063ef0af5f970afe8a45ea836e3509b8847ed39463253106ac17d19c437d3d56b832103596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc7100000000\", \"P2SH,WITNESS\"],\n\n[\"Non witness Single|AnyoneCanPay hash input's position\"],\n[[[\"0000000000000000000000000000000000000000000000000000000000000100\", 0, \"0x21 0x03596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71 CHECKSIG\", 1000],\n[\"0000000000000000000000000000000000000000000000000000000000000100\", 1, \"0x21 0x03596d3451025c19dbbdeb932d6bf8bfb4ad499b95b6f88db8899efac102e5fc71 CHECKSIG\", 1001]],\n\"01000000020001000000000000000000000000000000000000000000000000000000000000000000004847304402202a0b4b1294d70540235ae033d78e64b4897ec859c7b6f1b2b1d8a02e1d46006702201445e756d2254b0f1dfda9ab8e1e1bc26df9668077403204f32d16a49a36eb6983ffffffff00010000000000000000000000000000000000000000000000000000000000000100000049483045022100acb96cfdbda6dc94b489fd06f2d720983b5f350e31ba906cdbd800773e80b21c02200d74ea5bdf114212b4bbe9ed82c36d2e369e302dff57cb60d01c428f0bd3daab83ffffffff02e8030000000000000151e903000000000000015100000000\", \"P2SH,WITNESS\"],\n\n[\"BIP143 examples: details and private keys are available in BIP143\"],\n[\"BIP143 example: P2WSH with OP_CODESEPARATOR and out-of-range SIGHASH_SINGLE.\"],\n[[[\"6eb316926b1c5d567cd6f5e6a84fec606fc53d7b474526d1fff3948020c93dfe\", 0, \"0x21 0x036d5c20fa14fb2f635474c1dc4ef5909d4568e5569b79fc94d3448486e14685f8 CHECKSIG\", 156250000],\n[\"f825690aee1b3dc247da796cacb12687a5e802429fd291cfd63e010f02cf1508\", 0, \"0x00 0x20 0x5d1b56b63d714eebe542309525f484b7e9d6f686b3781b6f61ef925d66d6f6a0\", 4900000000]],\n\"01000000000102fe3dc9208094f3ffd12645477b3dc56f60ec4fa8e6f5d67c565d1c6b9216b36e000000004847304402200af4e47c9b9629dbecc21f73af989bdaa911f7e6f6c2e9394588a3aa68f81e9902204f3fcf6ade7e5abb1295b6774c8e0abd94ae62217367096bc02ee5e435b67da201ffffffff0815cf020f013ed6cf91d29f4202e8a58726b1ac6c79da47c23d1bee0a6925f80000000000ffffffff0100f2052a010000001976a914a30741f8145e5acadf23f751864167f32e0963f788ac000347304402200de66acf4527789bfda55fc5459e214fa6083f936b430a762c629656216805ac0220396f550692cd347171cbc1ef1f51e15282e837bb2b30860dc77c8f78bc8501e503473044022027dc95ad6b740fe5129e7e62a75dd00f291a2aeb1200b84b09d9e3789406b6c002201a9ecd315dd6a0e632ab20bbb98948bc0c6fb204f2c286963bb48517a7058e27034721026dccc749adc2a9d0d89497ac511f760f45c47dc5ed9cf352a58ac706453880aeadab210255a9626aebf5e29c0e6538428ba0d1dcf6ca98ffdf086aa8ced5e0d0215ea465ac00000000\", \"P2SH,WITNESS,CONST_SCRIPTCODE\"],\n\n[\"BIP143 example: P2WSH with unexecuted OP_CODESEPARATOR and SINGLE|ANYONECANPAY\"],\n[[[\"01c0cf7fba650638e55eb91261b183251fbb466f90dff17f10086817c542b5e9\", 0, \"0x00 0x20 0xba468eea561b26301e4cf69fa34bde4ad60c81e70f059f045ca9a79931004a4d\", 16777215],\n[\"1b2a9a426ba603ba357ce7773cb5805cb9c7c2b386d100d1fc9263513188e680\", 0, \"0x00 0x20 0xd9bbfbe56af7c4b7f960a70d7ea107156913d9e5a26b0a71429df5e097ca6537\", 16777215]],\n\"01000000000102e9b542c5176808107ff1df906f46bb1f2583b16112b95ee5380665ba7fcfc0010000000000ffffffff80e68831516392fcd100d186b3c2c7b95c80b53c77e77c35ba03a66b429a2a1b0000000000ffffffff0280969800000000001976a914de4b231626ef508c9a74a8517e6783c0546d6b2888ac80969800000000001976a9146648a8cd4531e1ec47f35916de8e259237294d1e88ac02483045022100f6a10b8604e6dc910194b79ccfc93e1bc0ec7c03453caaa8987f7d6c3413566002206216229ede9b4d6ec2d325be245c5b508ff0339bf1794078e20bfe0babc7ffe683270063ab68210392972e2eb617b2388771abe27235fd5ac44af8e61693261550447a4c3e39da98ac024730440220032521802a76ad7bf74d0e2c218b72cf0cbc867066e2e53db905ba37f130397e02207709e2188ed7f08f4c952d9d13986da504502b8c3be59617e043552f506c46ff83275163ab68210392972e2eb617b2388771abe27235fd5ac44af8e61693261550447a4c3e39da98ac00000000\", \"P2SH,WITNESS,CONST_SCRIPTCODE\"],\n\n[\"BIP143 example: Same as the previous example with input-output pairs swapped\"],\n[[[\"1b2a9a426ba603ba357ce7773cb5805cb9c7c2b386d100d1fc9263513188e680\", 0, \"0x00 0x20 0xd9bbfbe56af7c4b7f960a70d7ea107156913d9e5a26b0a71429df5e097ca6537\", 16777215],\n[\"01c0cf7fba650638e55eb91261b183251fbb466f90dff17f10086817c542b5e9\", 0, \"0x00 0x20 0xba468eea561b26301e4cf69fa34bde4ad60c81e70f059f045ca9a79931004a4d\", 16777215]],\n\"0100000000010280e68831516392fcd100d186b3c2c7b95c80b53c77e77c35ba03a66b429a2a1b0000000000ffffffffe9b542c5176808107ff1df906f46bb1f2583b16112b95ee5380665ba7fcfc0010000000000ffffffff0280969800000000001976a9146648a8cd4531e1ec47f35916de8e259237294d1e88ac80969800000000001976a914de4b231626ef508c9a74a8517e6783c0546d6b2888ac024730440220032521802a76ad7bf74d0e2c218b72cf0cbc867066e2e53db905ba37f130397e02207709e2188ed7f08f4c952d9d13986da504502b8c3be59617e043552f506c46ff83275163ab68210392972e2eb617b2388771abe27235fd5ac44af8e61693261550447a4c3e39da98ac02483045022100f6a10b8604e6dc910194b79ccfc93e1bc0ec7c03453caaa8987f7d6c3413566002206216229ede9b4d6ec2d325be245c5b508ff0339bf1794078e20bfe0babc7ffe683270063ab68210392972e2eb617b2388771abe27235fd5ac44af8e61693261550447a4c3e39da98ac00000000\", \"P2SH,WITNESS,CONST_SCRIPTCODE\"],\n\n[\"BIP143 example: P2SH-P2WSH 6-of-6 multisig signed with 6 different SIGHASH types\"],\n[[[\"6eb98797a21c6c10aa74edf29d618be109f48a8e94c694f3701e08ca69186436\", 1, \"HASH160 0x14 0x9993a429037b5d912407a71c252019287b8d27a5 EQUAL\", 987654321]],\n\"0100000000010136641869ca081e70f394c6948e8af409e18b619df2ed74aa106c1ca29787b96e0100000023220020a16b5755f7f6f96dbd65f5f0d6ab9418b89af4b1f14a1bb8a09062c35f0dcb54ffffffff0200e9a435000000001976a914389ffce9cd9ae88dcc0631e88a821ffdbe9bfe2688acc0832f05000000001976a9147480a33f950689af511e6e84c138dbbd3c3ee41588ac080047304402206ac44d672dac41f9b00e28f4df20c52eeb087207e8d758d76d92c6fab3b73e2b0220367750dbbe19290069cba53d096f44530e4f98acaa594810388cf7409a1870ce01473044022068c7946a43232757cbdf9176f009a928e1cd9a1a8c212f15c1e11ac9f2925d9002205b75f937ff2f9f3c1246e547e54f62e027f64eefa2695578cc6432cdabce271502473044022059ebf56d98010a932cf8ecfec54c48e6139ed6adb0728c09cbe1e4fa0915302e022007cd986c8fa870ff5d2b3a89139c9fe7e499259875357e20fcbb15571c76795403483045022100fbefd94bd0a488d50b79102b5dad4ab6ced30c4069f1eaa69a4b5a763414067e02203156c6a5c9cf88f91265f5a942e96213afae16d83321c8b31bb342142a14d16381483045022100a5263ea0553ba89221984bd7f0b13613db16e7a70c549a86de0cc0444141a407022005c360ef0ae5a5d4f9f2f87a56c1546cc8268cab08c73501d6b3be2e1e1a8a08824730440220525406a1482936d5a21888260dc165497a90a15669636d8edca6b9fe490d309c022032af0c646a34a44d1f4576bf6a4a74b67940f8faa84c7df9abe12a01a11e2b4783cf56210307b8ae49ac90a048e9b53357a2354b3334e9c8bee813ecb98e99a7e07e8c3ba32103b28f0c28bfab54554ae8c658ac5c3e0ce6e79ad336331f78c428dd43eea8449b21034b8113d703413d57761b8b9781957b8c0ac1dfe69f492580ca4195f50376ba4a21033400f6afecb833092a9a21cfdf1ed1376e58c5d1f47de74683123987e967a8f42103a6d48b1131e94ba04d9737d61acdaa1322008af9602b3b14862c07a1789aac162102d8b661b0b3302ee2f162b09e07a55ad5dfbe673a9f01d9f0c19617681024306b56ae00000000\", \"P2SH,WITNESS\"],\n\n[\"FindAndDelete tests\"],\n[\"This is a test of FindAndDelete. The first tx is a spend of normal P2SH and the second tx is a spend of bare P2WSH.\"],\n[\"The redeemScript/witnessScript is CHECKSIGVERIFY <0x30450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01>.\"],\n[\"The signature is <0x30450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01> <pubkey>,\"],\n[\"where the pubkey is obtained through key recovery with sig and correct sighash.\"],\n[\"This is to show that FindAndDelete is applied only to non-segwit scripts\"],\n[\"Non-segwit: correct sighash (with FindAndDelete) = 1ba1fe3bc90c5d1265460e684ce6774e324f0fabdf67619eda729e64e8b6bc08\"],\n[[[\"f18783ace138abac5d3a7a5cf08e88fe6912f267ef936452e0c27d090621c169\", 7000, \"HASH160 0x14 0x0c746489e2d83cdbb5b90b432773342ba809c134 EQUAL\", 200000]],\n\"010000000169c12106097dc2e0526493ef67f21269fe888ef05c7a3a5dacab38e1ac8387f1581b0000b64830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0121037a3fb04bcdb09eba90f69961ba1692a3528e45e67c85b200df820212d7594d334aad4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e01ffffffff0101000000000000000000000000\", \"P2SH,WITNESS\"],\n[\"BIP143: correct sighash (without FindAndDelete) = 71c9cd9b2869b9c70b01b1f0360c148f42dee72297db312638df136f43311f23\"],\n[[[\"f18783ace138abac5d3a7a5cf08e88fe6912f267ef936452e0c27d090621c169\", 7500, \"0x00 0x20 0x9e1be07558ea5cc8e02ed1d80c0911048afad949affa36d5c3951e3159dbea19\", 200000]],\n\"0100000000010169c12106097dc2e0526493ef67f21269fe888ef05c7a3a5dacab38e1ac8387f14c1d000000ffffffff01010000000000000000034830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e012102a9781d66b61fb5a7ef00ac5ad5bc6ffc78be7b44a566e3c87870e1079368df4c4aad4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0100000000\", \"P2SH,WITNESS,CONST_SCRIPTCODE\"],\n[\"This is multisig version of the FindAndDelete tests\"],\n[\"Script is 2 CHECKMULTISIGVERIFY <sig1> <sig2> DROP\"],\n[\"52af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c0395960175\"],\n[\"Signature is 0 <sig1> <sig2> 2 <key1> <key2>\"],\n[\"Non-segwit: correct sighash (with FindAndDelete) = 1d50f00ba4db2917b903b0ec5002e017343bb38876398c9510570f5dce099295\"],\n[[[\"9628667ad48219a169b41b020800162287d2c0f713c04157e95c484a8dcb7592\", 7000, \"HASH160 0x14 0x5748407f5ca5cdca53ba30b79040260770c9ee1b EQUAL\", 200000]],\n\"01000000019275cb8d4a485ce95741c013f7c0d28722160008021bb469a11982d47a662896581b0000fd6f01004830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c03959601522102cd74a2809ffeeed0092bc124fd79836706e41f048db3f6ae9df8708cefb83a1c2102e615999372426e46fd107b76eaf007156a507584aa2cc21de9eee3bdbd26d36c4c9552af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c0395960175ffffffff0101000000000000000000000000\", \"P2SH,WITNESS\"],\n[\"BIP143: correct sighash (without FindAndDelete) = c1628a1e7c67f14ca0c27c06e4fdeec2e6d1a73c7a91d7c046ff83e835aebb72\"],\n[[[\"9628667ad48219a169b41b020800162287d2c0f713c04157e95c484a8dcb7592\", 7500, \"0x00 0x20 0x9b66c15b4e0b4eb49fa877982cafded24859fe5b0e2dbfbe4f0df1de7743fd52\", 200000]],\n\"010000000001019275cb8d4a485ce95741c013f7c0d28722160008021bb469a11982d47a6628964c1d000000ffffffff0101000000000000000007004830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c0395960101022102966f109c54e85d3aee8321301136cedeb9fc710fdef58a9de8a73942f8e567c021034ffc99dd9a79dd3cb31e2ab3e0b09e0e67db41ac068c625cd1f491576016c84e9552af4830450220487fb382c4974de3f7d834c1b617fe15860828c7f96454490edd6d891556dcc9022100baf95feb48f845d5bfc9882eb6aeefa1bc3790e39f59eaa46ff7f15ae626c53e0148304502205286f726690b2e9b0207f0345711e63fa7012045b9eb0f19c2458ce1db90cf43022100e89f17f86abc5b149eba4115d4f128bcf45d77fb3ecdd34f594091340c039596017500000000\", \"P2SH,WITNESS,CONST_SCRIPTCODE\"],\n\n[\"Make diffs cleaner by leaving a comment here without comma at the end\"]\n]\n"
  },
  {
    "path": "src/test/dbwrapper_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <dbwrapper.h>\n#include <uint256.h>\n#include <random.h>\n#include <test/test_bitcoin.h>\n\n#include <memory>\n\n#include <boost/test/unit_test.hpp>\n\n// Test if a string consists entirely of null characters\nbool is_null_key(const std::vector<unsigned char>& key) {\n    bool isnull = true;\n\n    for (unsigned int i = 0; i < key.size(); i++)\n        isnull &= (key[i] == '\\x00');\n\n    return isnull;\n}\n \nBOOST_FIXTURE_TEST_SUITE(dbwrapper_tests, BasicTestingSetup)\n                       \nBOOST_AUTO_TEST_CASE(dbwrapper)\n{\n    // Perform tests both obfuscated and non-obfuscated.\n    for (bool obfuscate : {false, true}) {\n        fs::path ph = fs::temp_directory_path() / fs::unique_path();\n        CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);\n        char key = 'k';\n        uint256 in = InsecureRand256();\n        uint256 res;\n\n        // Ensure that we're doing real obfuscation when obfuscate=true\n        BOOST_CHECK(obfuscate != is_null_key(dbwrapper_private::GetObfuscateKey(dbw)));\n\n        BOOST_CHECK(dbw.Write(key, in));\n        BOOST_CHECK(dbw.Read(key, res));\n        BOOST_CHECK_EQUAL(res.ToString(), in.ToString());\n    }\n}\n\n// Test batch operations\nBOOST_AUTO_TEST_CASE(dbwrapper_batch)\n{\n    // Perform tests both obfuscated and non-obfuscated.\n    for (bool obfuscate : {false, true}) {\n        fs::path ph = fs::temp_directory_path() / fs::unique_path();\n        CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);\n\n        char key = 'i';\n        uint256 in = InsecureRand256();\n        char key2 = 'j';\n        uint256 in2 = InsecureRand256();\n        char key3 = 'k';\n        uint256 in3 = InsecureRand256();\n\n        uint256 res;\n        CDBBatch batch(dbw);\n\n        batch.Write(key, in);\n        batch.Write(key2, in2);\n        batch.Write(key3, in3);\n\n        // Remove key3 before it's even been written\n        batch.Erase(key3);\n\n        dbw.WriteBatch(batch);\n\n        BOOST_CHECK(dbw.Read(key, res));\n        BOOST_CHECK_EQUAL(res.ToString(), in.ToString());\n        BOOST_CHECK(dbw.Read(key2, res));\n        BOOST_CHECK_EQUAL(res.ToString(), in2.ToString());\n\n        // key3 should've never been written\n        BOOST_CHECK(dbw.Read(key3, res) == false);\n    }\n}\n\nBOOST_AUTO_TEST_CASE(dbwrapper_iterator)\n{\n    // Perform tests both obfuscated and non-obfuscated.\n    for (bool obfuscate : {false, true}) {\n        fs::path ph = fs::temp_directory_path() / fs::unique_path();\n        CDBWrapper dbw(ph, (1 << 20), true, false, obfuscate);\n\n        // The two keys are intentionally chosen for ordering\n        char key = 'j';\n        uint256 in = InsecureRand256();\n        BOOST_CHECK(dbw.Write(key, in));\n        char key2 = 'k';\n        uint256 in2 = InsecureRand256();\n        BOOST_CHECK(dbw.Write(key2, in2));\n\n        std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper&>(dbw).NewIterator());\n\n        // Be sure to seek past the obfuscation key (if it exists)\n        it->Seek(key);\n\n        char key_res;\n        uint256 val_res;\n\n        it->GetKey(key_res);\n        it->GetValue(val_res);\n        BOOST_CHECK_EQUAL(key_res, key);\n        BOOST_CHECK_EQUAL(val_res.ToString(), in.ToString());\n\n        it->Next();\n\n        it->GetKey(key_res);\n        it->GetValue(val_res);\n        BOOST_CHECK_EQUAL(key_res, key2);\n        BOOST_CHECK_EQUAL(val_res.ToString(), in2.ToString());\n\n        it->Next();\n        BOOST_CHECK_EQUAL(it->Valid(), false);\n    }\n}\n\n// Test that we do not obfuscation if there is existing data.\nBOOST_AUTO_TEST_CASE(existing_data_no_obfuscate)\n{\n    // We're going to share this fs::path between two wrappers\n    fs::path ph = fs::temp_directory_path() / fs::unique_path();\n    create_directories(ph);\n\n    // Set up a non-obfuscated wrapper to write some initial data.\n    std::unique_ptr<CDBWrapper> dbw = MakeUnique<CDBWrapper>(ph, (1 << 10), false, false, false);\n    char key = 'k';\n    uint256 in = InsecureRand256();\n    uint256 res;\n\n    BOOST_CHECK(dbw->Write(key, in));\n    BOOST_CHECK(dbw->Read(key, res));\n    BOOST_CHECK_EQUAL(res.ToString(), in.ToString());\n\n    // Call the destructor to free leveldb LOCK\n    dbw.reset();\n\n    // Now, set up another wrapper that wants to obfuscate the same directory\n    CDBWrapper odbw(ph, (1 << 10), false, false, true);\n\n    // Check that the key/val we wrote with unobfuscated wrapper exists and \n    // is readable.\n    uint256 res2;\n    BOOST_CHECK(odbw.Read(key, res2));\n    BOOST_CHECK_EQUAL(res2.ToString(), in.ToString());\n\n    BOOST_CHECK(!odbw.IsEmpty()); // There should be existing data\n    BOOST_CHECK(is_null_key(dbwrapper_private::GetObfuscateKey(odbw))); // The key should be an empty string\n\n    uint256 in2 = InsecureRand256();\n    uint256 res3;\n \n    // Check that we can write successfully\n    BOOST_CHECK(odbw.Write(key, in2));\n    BOOST_CHECK(odbw.Read(key, res3));\n    BOOST_CHECK_EQUAL(res3.ToString(), in2.ToString());\n}\n                        \n// Ensure that we start obfuscating during a reindex.\nBOOST_AUTO_TEST_CASE(existing_data_reindex)\n{\n    // We're going to share this fs::path between two wrappers\n    fs::path ph = fs::temp_directory_path() / fs::unique_path();\n    create_directories(ph);\n\n    // Set up a non-obfuscated wrapper to write some initial data.\n    std::unique_ptr<CDBWrapper> dbw = MakeUnique<CDBWrapper>(ph, (1 << 10), false, false, false);\n    char key = 'k';\n    uint256 in = InsecureRand256();\n    uint256 res;\n\n    BOOST_CHECK(dbw->Write(key, in));\n    BOOST_CHECK(dbw->Read(key, res));\n    BOOST_CHECK_EQUAL(res.ToString(), in.ToString());\n\n    // Call the destructor to free leveldb LOCK\n    dbw.reset();\n\n    // Simulate a -reindex by wiping the existing data store\n    CDBWrapper odbw(ph, (1 << 10), false, true, true);\n\n    // Check that the key/val we wrote with unobfuscated wrapper doesn't exist\n    uint256 res2;\n    BOOST_CHECK(!odbw.Read(key, res2));\n    BOOST_CHECK(!is_null_key(dbwrapper_private::GetObfuscateKey(odbw)));\n\n    uint256 in2 = InsecureRand256();\n    uint256 res3;\n \n    // Check that we can write successfully\n    BOOST_CHECK(odbw.Write(key, in2));\n    BOOST_CHECK(odbw.Read(key, res3));\n    BOOST_CHECK_EQUAL(res3.ToString(), in2.ToString());\n}\n\nBOOST_AUTO_TEST_CASE(iterator_ordering)\n{\n    fs::path ph = fs::temp_directory_path() / fs::unique_path();\n    CDBWrapper dbw(ph, (1 << 20), true, false, false);\n    for (int x=0x00; x<256; ++x) {\n        uint8_t key = x;\n        uint32_t value = x*x;\n        if (!(x & 1)) BOOST_CHECK(dbw.Write(key, value));\n    }\n\n    // Check that creating an iterator creates a snapshot\n    std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper&>(dbw).NewIterator());\n\n    for (int x=0x00; x<256; ++x) {\n        uint8_t key = x;\n        uint32_t value = x*x;\n        if (x & 1) BOOST_CHECK(dbw.Write(key, value));\n    }\n\n    for (int seek_start : {0x00, 0x80}) {\n        it->Seek((uint8_t)seek_start);\n        for (int x=seek_start; x<255; ++x) {\n            uint8_t key;\n            uint32_t value;\n            BOOST_CHECK(it->Valid());\n            if (!it->Valid()) // Avoid spurious errors about invalid iterator's key and value in case of failure\n                break;\n            BOOST_CHECK(it->GetKey(key));\n            if (x & 1) {\n                BOOST_CHECK_EQUAL(key, x + 1);\n                continue;\n            }\n            BOOST_CHECK(it->GetValue(value));\n            BOOST_CHECK_EQUAL(key, x);\n            BOOST_CHECK_EQUAL(value, x*x);\n            it->Next();\n        }\n        BOOST_CHECK(!it->Valid());\n    }\n}\n\nstruct StringContentsSerializer {\n    // Used to make two serialized objects the same while letting them have a different lengths\n    // This is a terrible idea\n    std::string str;\n    StringContentsSerializer() {}\n    explicit StringContentsSerializer(const std::string& inp) : str(inp) {}\n\n    StringContentsSerializer& operator+=(const std::string& s) {\n        str += s;\n        return *this;\n    }\n    StringContentsSerializer& operator+=(const StringContentsSerializer& s) { return *this += s.str; }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        if (ser_action.ForRead()) {\n            str.clear();\n            char c = 0;\n            while (true) {\n                try {\n                    READWRITE(c);\n                    str.push_back(c);\n                } catch (const std::ios_base::failure& e) {\n                    break;\n                }\n            }\n        } else {\n            for (size_t i = 0; i < str.size(); i++)\n                READWRITE(str[i]);\n        }\n    }\n};\n\nBOOST_AUTO_TEST_CASE(iterator_string_ordering)\n{\n    char buf[10];\n\n    fs::path ph = fs::temp_directory_path() / fs::unique_path();\n    CDBWrapper dbw(ph, (1 << 20), true, false, false);\n    for (int x=0x00; x<10; ++x) {\n        for (int y = 0; y < 10; y++) {\n            snprintf(buf, sizeof(buf), \"%d\", x);\n            StringContentsSerializer key(buf);\n            for (int z = 0; z < y; z++)\n                key += key;\n            uint32_t value = x*x;\n            BOOST_CHECK(dbw.Write(key, value));\n        }\n    }\n\n    std::unique_ptr<CDBIterator> it(const_cast<CDBWrapper&>(dbw).NewIterator());\n    for (int seek_start : {0, 5}) {\n        snprintf(buf, sizeof(buf), \"%d\", seek_start);\n        StringContentsSerializer seek_key(buf);\n        it->Seek(seek_key);\n        for (int x=seek_start; x<10; ++x) {\n            for (int y = 0; y < 10; y++) {\n                snprintf(buf, sizeof(buf), \"%d\", x);\n                std::string exp_key(buf);\n                for (int z = 0; z < y; z++)\n                    exp_key += exp_key;\n                StringContentsSerializer key;\n                uint32_t value;\n                BOOST_CHECK(it->Valid());\n                if (!it->Valid()) // Avoid spurious errors about invalid iterator's key and value in case of failure\n                    break;\n                BOOST_CHECK(it->GetKey(key));\n                BOOST_CHECK(it->GetValue(value));\n                BOOST_CHECK_EQUAL(key.str, exp_key);\n                BOOST_CHECK_EQUAL(value, x*x);\n                it->Next();\n            }\n        }\n        BOOST_CHECK(!it->Valid());\n    }\n}\n\n\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/getarg_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <util.h>\n#include <test/test_bitcoin.h>\n\n#include <string>\n#include <vector>\n\n#include <boost/algorithm/string.hpp>\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(getarg_tests, BasicTestingSetup)\n\nstatic void ResetArgs(const std::string& strArg)\n{\n    std::vector<std::string> vecArg;\n    if (strArg.size())\n      boost::split(vecArg, strArg, boost::is_space(), boost::token_compress_on);\n\n    // Insert dummy executable name:\n    vecArg.insert(vecArg.begin(), \"testsugarchain\");\n\n    // Convert to char*:\n    std::vector<const char*> vecChar;\n    for (std::string& s : vecArg)\n        vecChar.push_back(s.c_str());\n\n    gArgs.ParseParameters(vecChar.size(), vecChar.data());\n}\n\nBOOST_AUTO_TEST_CASE(boolarg)\n{\n    ResetArgs(\"-foo\");\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", false));\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", true));\n\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-fo\", false));\n    BOOST_CHECK(gArgs.GetBoolArg(\"-fo\", true));\n\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-fooo\", false));\n    BOOST_CHECK(gArgs.GetBoolArg(\"-fooo\", true));\n\n    ResetArgs(\"-foo=0\");\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", false));\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", true));\n\n    ResetArgs(\"-foo=1\");\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", false));\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", true));\n\n    // New 0.6 feature: auto-map -nosomething to !-something:\n    ResetArgs(\"-nofoo\");\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", false));\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", true));\n\n    ResetArgs(\"-nofoo=1\");\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", false));\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", true));\n\n    ResetArgs(\"-foo -nofoo\");  // -nofoo should win\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", false));\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", true));\n\n    ResetArgs(\"-foo=1 -nofoo=1\");  // -nofoo should win\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", false));\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", true));\n\n    ResetArgs(\"-foo=0 -nofoo=0\");  // -nofoo=0 should win\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", false));\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", true));\n\n    // New 0.6 feature: treat -- same as -:\n    ResetArgs(\"--foo=1\");\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", false));\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", true));\n\n    ResetArgs(\"--nofoo=1\");\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", false));\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", true));\n\n}\n\nBOOST_AUTO_TEST_CASE(stringarg)\n{\n    ResetArgs(\"\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"\"), \"\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"eleven\"), \"eleven\");\n\n    ResetArgs(\"-foo -bar\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"\"), \"\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"eleven\"), \"\");\n\n    ResetArgs(\"-foo=\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"\"), \"\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"eleven\"), \"\");\n\n    ResetArgs(\"-foo=11\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"\"), \"11\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"eleven\"), \"11\");\n\n    ResetArgs(\"-foo=eleven\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"\"), \"eleven\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"eleven\"), \"eleven\");\n\n}\n\nBOOST_AUTO_TEST_CASE(intarg)\n{\n    ResetArgs(\"\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", 11), 11);\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", 0), 0);\n\n    ResetArgs(\"-foo -bar\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", 11), 0);\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-bar\", 11), 0);\n\n    ResetArgs(\"-foo=11 -bar=12\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", 0), 11);\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-bar\", 11), 12);\n\n    ResetArgs(\"-foo=NaN -bar=NotANumber\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", 1), 0);\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-bar\", 11), 0);\n}\n\nBOOST_AUTO_TEST_CASE(doubledash)\n{\n    ResetArgs(\"--foo\");\n    BOOST_CHECK_EQUAL(gArgs.GetBoolArg(\"-foo\", false), true);\n\n    ResetArgs(\"--foo=verbose --bar=1\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-foo\", \"\"), \"verbose\");\n    BOOST_CHECK_EQUAL(gArgs.GetArg(\"-bar\", 0), 1);\n}\n\nBOOST_AUTO_TEST_CASE(boolargno)\n{\n    ResetArgs(\"-nofoo\");\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", true));\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", false));\n\n    ResetArgs(\"-nofoo=1\");\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", true));\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", false));\n\n    ResetArgs(\"-nofoo=0\");\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", true));\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", false));\n\n    ResetArgs(\"-foo --nofoo\"); // --nofoo should win\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", true));\n    BOOST_CHECK(!gArgs.GetBoolArg(\"-foo\", false));\n\n    ResetArgs(\"-nofoo -foo\"); // foo always wins:\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", true));\n    BOOST_CHECK(gArgs.GetBoolArg(\"-foo\", false));\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/hash_tests.cpp",
    "content": "// Copyright (c) 2013-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <hash.h>\n#include <utilstrencodings.h>\n#include <test/test_bitcoin.h>\n\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(hash_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(murmurhash3)\n{\n\n#define T(expected, seed, data) BOOST_CHECK_EQUAL(MurmurHash3(seed, ParseHex(data)), expected)\n\n    // Test MurmurHash3 with various inputs. Of course this is retested in the\n    // bloom filter tests - they would fail if MurmurHash3() had any problems -\n    // but is useful for those trying to implement Bitcoin libraries as a\n    // source of test data for their MurmurHash3() primitive during\n    // development.\n    //\n    // The magic number 0xFBA4C795 comes from CBloomFilter::Hash()\n\n    T(0x00000000, 0x00000000, \"\");\n    T(0x6a396f08, 0xFBA4C795, \"\");\n    T(0x81f16f39, 0xffffffff, \"\");\n\n    T(0x514e28b7, 0x00000000, \"00\");\n    T(0xea3f0b17, 0xFBA4C795, \"00\");\n    T(0xfd6cf10d, 0x00000000, \"ff\");\n\n    T(0x16c6b7ab, 0x00000000, \"0011\");\n    T(0x8eb51c3d, 0x00000000, \"001122\");\n    T(0xb4471bf8, 0x00000000, \"00112233\");\n    T(0xe2301fa8, 0x00000000, \"0011223344\");\n    T(0xfc2e4a15, 0x00000000, \"001122334455\");\n    T(0xb074502c, 0x00000000, \"00112233445566\");\n    T(0x8034d2a0, 0x00000000, \"0011223344556677\");\n    T(0xb4698def, 0x00000000, \"001122334455667788\");\n\n#undef T\n}\n\n/*\n   SipHash-2-4 output with\n   k = 00 01 02 ...\n   and\n   in = (empty string)\n   in = 00 (1 byte)\n   in = 00 01 (2 bytes)\n   in = 00 01 02 (3 bytes)\n   ...\n   in = 00 01 02 ... 3e (63 bytes)\n\n   from: https://131002.net/siphash/siphash24.c\n*/\nuint64_t siphash_4_2_testvec[] = {\n    0x726fdb47dd0e0e31, 0x74f839c593dc67fd, 0x0d6c8009d9a94f5a, 0x85676696d7fb7e2d,\n    0xcf2794e0277187b7, 0x18765564cd99a68d, 0xcbc9466e58fee3ce, 0xab0200f58b01d137,\n    0x93f5f5799a932462, 0x9e0082df0ba9e4b0, 0x7a5dbbc594ddb9f3, 0xf4b32f46226bada7,\n    0x751e8fbc860ee5fb, 0x14ea5627c0843d90, 0xf723ca908e7af2ee, 0xa129ca6149be45e5,\n    0x3f2acc7f57c29bdb, 0x699ae9f52cbe4794, 0x4bc1b3f0968dd39c, 0xbb6dc91da77961bd,\n    0xbed65cf21aa2ee98, 0xd0f2cbb02e3b67c7, 0x93536795e3a33e88, 0xa80c038ccd5ccec8,\n    0xb8ad50c6f649af94, 0xbce192de8a85b8ea, 0x17d835b85bbb15f3, 0x2f2e6163076bcfad,\n    0xde4daaaca71dc9a5, 0xa6a2506687956571, 0xad87a3535c49ef28, 0x32d892fad841c342,\n    0x7127512f72f27cce, 0xa7f32346f95978e3, 0x12e0b01abb051238, 0x15e034d40fa197ae,\n    0x314dffbe0815a3b4, 0x027990f029623981, 0xcadcd4e59ef40c4d, 0x9abfd8766a33735c,\n    0x0e3ea96b5304a7d0, 0xad0c42d6fc585992, 0x187306c89bc215a9, 0xd4a60abcf3792b95,\n    0xf935451de4f21df2, 0xa9538f0419755787, 0xdb9acddff56ca510, 0xd06c98cd5c0975eb,\n    0xe612a3cb9ecba951, 0xc766e62cfcadaf96, 0xee64435a9752fe72, 0xa192d576b245165a,\n    0x0a8787bf8ecb74b2, 0x81b3e73d20b49b6f, 0x7fa8220ba3b2ecea, 0x245731c13ca42499,\n    0xb78dbfaf3a8d83bd, 0xea1ad565322a1a0b, 0x60e61c23a3795013, 0x6606d7e446282b93,\n    0x6ca4ecb15c5f91e1, 0x9f626da15c9625f3, 0xe51b38608ef25f57, 0x958a324ceb064572\n};\n\nBOOST_AUTO_TEST_CASE(siphash)\n{\n    CSipHasher hasher(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL);\n    BOOST_CHECK_EQUAL(hasher.Finalize(),  0x726fdb47dd0e0e31ull);\n    static const unsigned char t0[1] = {0};\n    hasher.Write(t0, 1);\n    BOOST_CHECK_EQUAL(hasher.Finalize(),  0x74f839c593dc67fdull);\n    static const unsigned char t1[7] = {1,2,3,4,5,6,7};\n    hasher.Write(t1, 7);\n    BOOST_CHECK_EQUAL(hasher.Finalize(),  0x93f5f5799a932462ull);\n    hasher.Write(0x0F0E0D0C0B0A0908ULL);\n    BOOST_CHECK_EQUAL(hasher.Finalize(),  0x3f2acc7f57c29bdbull);\n    static const unsigned char t2[2] = {16,17};\n    hasher.Write(t2, 2);\n    BOOST_CHECK_EQUAL(hasher.Finalize(),  0x4bc1b3f0968dd39cull);\n    static const unsigned char t3[9] = {18,19,20,21,22,23,24,25,26};\n    hasher.Write(t3, 9);\n    BOOST_CHECK_EQUAL(hasher.Finalize(),  0x2f2e6163076bcfadull);\n    static const unsigned char t4[5] = {27,28,29,30,31};\n    hasher.Write(t4, 5);\n    BOOST_CHECK_EQUAL(hasher.Finalize(),  0x7127512f72f27cceull);\n    hasher.Write(0x2726252423222120ULL);\n    BOOST_CHECK_EQUAL(hasher.Finalize(),  0x0e3ea96b5304a7d0ull);\n    hasher.Write(0x2F2E2D2C2B2A2928ULL);\n    BOOST_CHECK_EQUAL(hasher.Finalize(),  0xe612a3cb9ecba951ull);\n\n    BOOST_CHECK_EQUAL(SipHashUint256(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL, uint256S(\"1f1e1d1c1b1a191817161514131211100f0e0d0c0b0a09080706050403020100\")), 0x7127512f72f27cceull);\n\n    // Check test vectors from spec, one byte at a time\n    CSipHasher hasher2(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL);\n    for (uint8_t x=0; x<ARRAYLEN(siphash_4_2_testvec); ++x)\n    {\n        BOOST_CHECK_EQUAL(hasher2.Finalize(), siphash_4_2_testvec[x]);\n        hasher2.Write(&x, 1);\n    }\n    // Check test vectors from spec, eight bytes at a time\n    CSipHasher hasher3(0x0706050403020100ULL, 0x0F0E0D0C0B0A0908ULL);\n    for (uint8_t x=0; x<ARRAYLEN(siphash_4_2_testvec); x+=8)\n    {\n        BOOST_CHECK_EQUAL(hasher3.Finalize(), siphash_4_2_testvec[x]);\n        hasher3.Write(uint64_t(x)|(uint64_t(x+1)<<8)|(uint64_t(x+2)<<16)|(uint64_t(x+3)<<24)|\n                     (uint64_t(x+4)<<32)|(uint64_t(x+5)<<40)|(uint64_t(x+6)<<48)|(uint64_t(x+7)<<56));\n    }\n\n    CHashWriter ss(SER_DISK, CLIENT_VERSION);\n    CMutableTransaction tx;\n    // Note these tests were originally written with tx.nVersion=1\n    // and the test would be affected by default tx version bumps if not fixed.\n    tx.nVersion = 1;\n    ss << tx;\n    BOOST_CHECK_EQUAL(SipHashUint256(1, 2, ss.GetHash()), 0x79751e980c2a0a35ULL);\n\n    // Check consistency between CSipHasher and SipHashUint256[Extra].\n    FastRandomContext ctx;\n    for (int i = 0; i < 16; ++i) {\n        uint64_t k1 = ctx.rand64();\n        uint64_t k2 = ctx.rand64();\n        uint256 x = InsecureRand256();\n        uint32_t n = ctx.rand32();\n        uint8_t nb[4];\n        WriteLE32(nb, n);\n        CSipHasher sip256(k1, k2);\n        sip256.Write(x.begin(), 32);\n        CSipHasher sip288 = sip256;\n        sip288.Write(nb, 4);\n        BOOST_CHECK_EQUAL(SipHashUint256(k1, k2, x), sip256.Finalize());\n        BOOST_CHECK_EQUAL(SipHashUint256Extra(k1, k2, x, n), sip288.Finalize());\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/key_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <key.h>\n\n#include <base58.h>\n#include <script/script.h>\n#include <uint256.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <test/test_bitcoin.h>\n\n#include <string>\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n\nstatic const std::string strSecret1 = \"5KZwi7ToG3cwrysmw9EhFQmenFKXeWXPukz7YvpHSa17hVA52kH\";\nstatic const std::string strSecret2 = \"5Hth2a9Nys6o8QhF99n5ErRoBQgiY7LmxUg3raKnZjqQmdRPGDu\";\nstatic const std::string strSecret1C = \"L4xQUTXHBQZf9c37KyMSebv5kiCnGZKA7s95uvXhZrfWZafbABkR\";\nstatic const std::string strSecret2C = \"KwZ9fwHz1z8abhadQyjwi9ASpwYJLJzHRs9Mbp5v7W4fuxiJU92P\";\nstatic const std::string addr1 = \"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\";\nstatic const std::string addr2 = \"SUGAR1c3CvDCUtQ42h3u5kR3vnpVcSRaV5\";\nstatic const std::string addr1C = \"SN3vYQD88r4QfzAYzdf3cjbib4u3p6YHHi\";\nstatic const std::string addr2C = \"ShcGKh4cCApmUJvw83a9Fhxnc6bEJmUC5i\";\n\nstatic const std::string strAddressBad = \"1HV9Lc3sNHZxwj4Zk6fB38tEmBryq2cBiF\";\n\n\nBOOST_FIXTURE_TEST_SUITE(key_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(key_test1)\n{\n    CBitcoinSecret bsecret1, bsecret2, bsecret1C, bsecret2C, baddress1;\n    BOOST_CHECK( bsecret1.SetString (strSecret1));\n    BOOST_CHECK( bsecret2.SetString (strSecret2));\n    BOOST_CHECK( bsecret1C.SetString(strSecret1C));\n    BOOST_CHECK( bsecret2C.SetString(strSecret2C));\n    BOOST_CHECK(!baddress1.SetString(strAddressBad));\n\n    CKey key1  = bsecret1.GetKey();\n    BOOST_CHECK(key1.IsCompressed() == false);\n    CKey key2  = bsecret2.GetKey();\n    BOOST_CHECK(key2.IsCompressed() == false);\n    CKey key1C = bsecret1C.GetKey();\n    BOOST_CHECK(key1C.IsCompressed() == true);\n    CKey key2C = bsecret2C.GetKey();\n    BOOST_CHECK(key2C.IsCompressed() == true);\n\n    CPubKey pubkey1  = key1. GetPubKey();\n    CPubKey pubkey2  = key2. GetPubKey();\n    CPubKey pubkey1C = key1C.GetPubKey();\n    CPubKey pubkey2C = key2C.GetPubKey();\n\n    BOOST_CHECK(key1.VerifyPubKey(pubkey1));\n    BOOST_CHECK(!key1.VerifyPubKey(pubkey1C));\n    BOOST_CHECK(!key1.VerifyPubKey(pubkey2));\n    BOOST_CHECK(!key1.VerifyPubKey(pubkey2C));\n\n    BOOST_CHECK(!key1C.VerifyPubKey(pubkey1));\n    BOOST_CHECK(key1C.VerifyPubKey(pubkey1C));\n    BOOST_CHECK(!key1C.VerifyPubKey(pubkey2));\n    BOOST_CHECK(!key1C.VerifyPubKey(pubkey2C));\n\n    BOOST_CHECK(!key2.VerifyPubKey(pubkey1));\n    BOOST_CHECK(!key2.VerifyPubKey(pubkey1C));\n    BOOST_CHECK(key2.VerifyPubKey(pubkey2));\n    BOOST_CHECK(!key2.VerifyPubKey(pubkey2C));\n\n    BOOST_CHECK(!key2C.VerifyPubKey(pubkey1));\n    BOOST_CHECK(!key2C.VerifyPubKey(pubkey1C));\n    BOOST_CHECK(!key2C.VerifyPubKey(pubkey2));\n    BOOST_CHECK(key2C.VerifyPubKey(pubkey2C));\n\n    BOOST_CHECK(DecodeDestination(addr1)  == CTxDestination(pubkey1.GetID()));\n    BOOST_CHECK(DecodeDestination(addr2)  == CTxDestination(pubkey2.GetID()));\n    BOOST_CHECK(DecodeDestination(addr1C) == CTxDestination(pubkey1C.GetID()));\n    BOOST_CHECK(DecodeDestination(addr2C) == CTxDestination(pubkey2C.GetID()));\n\n    for (int n=0; n<16; n++)\n    {\n        std::string strMsg = strprintf(\"Very secret message %i: 11\", n);\n        uint256 hashMsg = Hash(strMsg.begin(), strMsg.end());\n\n        // normal signatures\n\n        std::vector<unsigned char> sign1, sign2, sign1C, sign2C;\n\n        BOOST_CHECK(key1.Sign (hashMsg, sign1));\n        BOOST_CHECK(key2.Sign (hashMsg, sign2));\n        BOOST_CHECK(key1C.Sign(hashMsg, sign1C));\n        BOOST_CHECK(key2C.Sign(hashMsg, sign2C));\n\n        BOOST_CHECK( pubkey1.Verify(hashMsg, sign1));\n        BOOST_CHECK(!pubkey1.Verify(hashMsg, sign2));\n        BOOST_CHECK( pubkey1.Verify(hashMsg, sign1C));\n        BOOST_CHECK(!pubkey1.Verify(hashMsg, sign2C));\n\n        BOOST_CHECK(!pubkey2.Verify(hashMsg, sign1));\n        BOOST_CHECK( pubkey2.Verify(hashMsg, sign2));\n        BOOST_CHECK(!pubkey2.Verify(hashMsg, sign1C));\n        BOOST_CHECK( pubkey2.Verify(hashMsg, sign2C));\n\n        BOOST_CHECK( pubkey1C.Verify(hashMsg, sign1));\n        BOOST_CHECK(!pubkey1C.Verify(hashMsg, sign2));\n        BOOST_CHECK( pubkey1C.Verify(hashMsg, sign1C));\n        BOOST_CHECK(!pubkey1C.Verify(hashMsg, sign2C));\n\n        BOOST_CHECK(!pubkey2C.Verify(hashMsg, sign1));\n        BOOST_CHECK( pubkey2C.Verify(hashMsg, sign2));\n        BOOST_CHECK(!pubkey2C.Verify(hashMsg, sign1C));\n        BOOST_CHECK( pubkey2C.Verify(hashMsg, sign2C));\n\n        // compact signatures (with key recovery)\n\n        std::vector<unsigned char> csign1, csign2, csign1C, csign2C;\n\n        BOOST_CHECK(key1.SignCompact (hashMsg, csign1));\n        BOOST_CHECK(key2.SignCompact (hashMsg, csign2));\n        BOOST_CHECK(key1C.SignCompact(hashMsg, csign1C));\n        BOOST_CHECK(key2C.SignCompact(hashMsg, csign2C));\n\n        CPubKey rkey1, rkey2, rkey1C, rkey2C;\n\n        BOOST_CHECK(rkey1.RecoverCompact (hashMsg, csign1));\n        BOOST_CHECK(rkey2.RecoverCompact (hashMsg, csign2));\n        BOOST_CHECK(rkey1C.RecoverCompact(hashMsg, csign1C));\n        BOOST_CHECK(rkey2C.RecoverCompact(hashMsg, csign2C));\n\n        BOOST_CHECK(rkey1  == pubkey1);\n        BOOST_CHECK(rkey2  == pubkey2);\n        BOOST_CHECK(rkey1C == pubkey1C);\n        BOOST_CHECK(rkey2C == pubkey2C);\n    }\n\n    // test deterministic signing\n\n    std::vector<unsigned char> detsig, detsigc;\n    std::string strMsg = \"Very deterministic message\";\n    uint256 hashMsg = Hash(strMsg.begin(), strMsg.end());\n    BOOST_CHECK(key1.Sign(hashMsg, detsig));\n    BOOST_CHECK(key1C.Sign(hashMsg, detsigc));\n    BOOST_CHECK(detsig == detsigc);\n\n    // BOOST_CHECK(detsig == ParseHex(\"304402205dbbddda71772d95ce91cd2d14b592cfbc1dd0aabd6a394b6c2d377bbe59d31d022014ddda21494a4e221f0824f0b8b924c43fa43c0ad57dccdaa11f81a6bd4582f6\"));\n    // for (int i = 0; i <= 9; i++) { printf(\"detsig[%d] = %d\\n\", i, detsig[i]); } // FIXME.SUGAR // SURE?\n    BOOST_CHECK_EQUAL(detsig[0], 48);\n    BOOST_CHECK_EQUAL(detsig[4], 55);\n    BOOST_CHECK_EQUAL(detsig[9], 254);\n\n    BOOST_CHECK(key2.Sign(hashMsg, detsig));\n    BOOST_CHECK(key2C.Sign(hashMsg, detsigc));\n    BOOST_CHECK(detsig == detsigc);\n\n    // BOOST_CHECK(detsig == ParseHex(\"3044022052d8a32079c11e79db95af63bb9600c5b04f21a9ca33dc129c2bfa8ac9dc1cd5022061d8ae5e0f6c1a16bde3719c64c2fd70e404b6428ab9a69566962e8771b5944d\"));\n    // for (int i = 0; i <= 9; i++) { printf(\"detsig[%d] = %d\\n\", i, detsig[i]); } // FIXME.SUGAR // SURE?\n    BOOST_CHECK_EQUAL(detsig[0], 48);\n    BOOST_CHECK_EQUAL(detsig[4], 58);\n    BOOST_CHECK_EQUAL(detsig[9], 249);\n\n    BOOST_CHECK(key1.SignCompact(hashMsg, detsig));\n    BOOST_CHECK(key1C.SignCompact(hashMsg, detsigc));\n\n    // BOOST_CHECK(detsig == ParseHex(\"1c5dbbddda71772d95ce91cd2d14b592cfbc1dd0aabd6a394b6c2d377bbe59d31d14ddda21494a4e221f0824f0b8b924c43fa43c0ad57dccdaa11f81a6bd4582f6\"));\n    // for (int i = 0; i <= 9; i++) { printf(\"detsig[%d] = %d\\n\", i, detsig[i]); } // FIXME.SUGAR // SURE?\n    BOOST_CHECK_EQUAL(detsig[0], 27);\n    BOOST_CHECK_EQUAL(detsig[4], 150);\n    BOOST_CHECK_EQUAL(detsig[9], 66);\n\n    // BOOST_CHECK(detsigc == ParseHex(\"205dbbddda71772d95ce91cd2d14b592cfbc1dd0aabd6a394b6c2d377bbe59d31d14ddda21494a4e221f0824f0b8b924c43fa43c0ad57dccdaa11f81a6bd4582f6\"));\n    // for (int i = 0; i <= 9; i++) { printf(\"detsig[%d] = %d\\n\", i, detsigc[i]); } // FIXME.SUGAR // SURE?\n    BOOST_CHECK_EQUAL(detsigc[0], 31);\n    BOOST_CHECK_EQUAL(detsigc[4], 150);\n    BOOST_CHECK_EQUAL(detsigc[9], 66);\n\n    BOOST_CHECK(key2.SignCompact(hashMsg, detsig));\n    BOOST_CHECK(key2C.SignCompact(hashMsg, detsigc));\n\n    // BOOST_CHECK(detsig == ParseHex(\"1c52d8a32079c11e79db95af63bb9600c5b04f21a9ca33dc129c2bfa8ac9dc1cd561d8ae5e0f6c1a16bde3719c64c2fd70e404b6428ab9a69566962e8771b5944d\"));\n    // for (int i = 0; i <= 9; i++) { printf(\"detsig[%d] = %d\\n\", i, detsig[i]); } // FIXME.SUGAR // SURE?\n    BOOST_CHECK_EQUAL(detsig[0], 28);\n    BOOST_CHECK_EQUAL(detsig[4], 109);\n    BOOST_CHECK_EQUAL(detsig[9], 96);\n\n    // BOOST_CHECK(detsigc == ParseHex(\"2052d8a32079c11e79db95af63bb9600c5b04f21a9ca33dc129c2bfa8ac9dc1cd561d8ae5e0f6c1a16bde3719c64c2fd70e404b6428ab9a69566962e8771b5944d\"));\n    // for (int i = 0; i <= 9; i++) { printf(\"detsig[%d] = %d\\n\", i, detsigc[i]); } // FIXME.SUGAR // SURE?\n    BOOST_CHECK_EQUAL(detsigc[0], 32);\n    BOOST_CHECK_EQUAL(detsigc[4], 109);\n    BOOST_CHECK_EQUAL(detsigc[9], 96);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/limitedmap_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <limitedmap.h>\n\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(limitedmap_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(limitedmap_test)\n{\n    // create a limitedmap capped at 10 items\n    limitedmap<int, int> map(10);\n\n    // check that the max size is 10\n    BOOST_CHECK(map.max_size() == 10);\n\n    // check that it's empty\n    BOOST_CHECK(map.size() == 0);\n\n    // insert (-1, -1)\n    map.insert(std::pair<int, int>(-1, -1));\n\n    // make sure that the size is updated\n    BOOST_CHECK(map.size() == 1);\n\n    // make sure that the new item is in the map\n    BOOST_CHECK(map.count(-1) == 1);\n\n    // insert 10 new items\n    for (int i = 0; i < 10; i++) {\n        map.insert(std::pair<int, int>(i, i + 1));\n    }\n\n    // make sure that the map now contains 10 items...\n    BOOST_CHECK(map.size() == 10);\n\n    // ...and that the first item has been discarded\n    BOOST_CHECK(map.count(-1) == 0);\n\n    // iterate over the map, both with an index and an iterator\n    limitedmap<int, int>::const_iterator it = map.begin();\n    for (int i = 0; i < 10; i++) {\n        // make sure the item is present\n        BOOST_CHECK(map.count(i) == 1);\n\n        // use the iterator to check for the expected key and value\n        BOOST_CHECK(it->first == i);\n        BOOST_CHECK(it->second == i + 1);\n        \n        // use find to check for the value\n        BOOST_CHECK(map.find(i)->second == i + 1);\n        \n        // update and recheck\n        map.update(it, i + 2);\n        BOOST_CHECK(map.find(i)->second == i + 2);\n\n        it++;\n    }\n\n    // check that we've exhausted the iterator\n    BOOST_CHECK(it == map.end());\n\n    // resize the map to 5 items\n    map.max_size(5);\n\n    // check that the max size and size are now 5\n    BOOST_CHECK(map.max_size() == 5);\n    BOOST_CHECK(map.size() == 5);\n\n    // check that items less than 5 have been discarded\n    // and items greater than 5 are retained\n    for (int i = 0; i < 10; i++) {\n        if (i < 5) {\n            BOOST_CHECK(map.count(i) == 0);\n        } else {\n            BOOST_CHECK(map.count(i) == 1);\n        }\n    }\n\n    // erase some items not in the map\n    for (int i = 100; i < 1000; i += 100) {\n        map.erase(i);\n    }\n\n    // check that the size is unaffected\n    BOOST_CHECK(map.size() == 5);\n\n    // erase the remaining elements\n    for (int i = 5; i < 10; i++) {\n        map.erase(i);\n    }\n\n    // check that the map is now empty\n    BOOST_CHECK(map.empty());\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/main_tests.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <chainparams.h>\n#include <validation.h>\n#include <net.h>\n\n#include <test/test_bitcoin.h>\n\n#include <boost/signals2/signal.hpp>\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(main_tests, TestingSetup)\n\nstatic void TestBlockSubsidyHalvings(const Consensus::Params& consensusParams)\n{\n    int maxHalvings = 64;\n    CAmount nInitialSubsidy = 42.94967296 * COIN; // 2^32/COIN = 42.94967296 (was 50)\n\n    CAmount nPreviousSubsidy = nInitialSubsidy * 2; // for height == 0\n    BOOST_CHECK_EQUAL(nPreviousSubsidy, nInitialSubsidy * 2);\n    for (int nHalvings = 0; nHalvings < maxHalvings; nHalvings++) {\n        int nHeight = nHalvings * consensusParams.nSubsidyHalvingInterval;\n        CAmount nSubsidy = GetBlockSubsidy(nHeight, consensusParams);\n        BOOST_CHECK(nSubsidy <= nInitialSubsidy);\n        BOOST_CHECK_EQUAL(nSubsidy, nPreviousSubsidy / 2);\n        nPreviousSubsidy = nSubsidy;\n    }\n    BOOST_CHECK_EQUAL(GetBlockSubsidy(maxHalvings * consensusParams.nSubsidyHalvingInterval, consensusParams), 0);\n}\n\nstatic void TestBlockSubsidyHalvings(int nSubsidyHalvingInterval)\n{\n    Consensus::Params consensusParams;\n    consensusParams.nSubsidyHalvingInterval = nSubsidyHalvingInterval;\n    TestBlockSubsidyHalvings(consensusParams);\n}\n\nBOOST_AUTO_TEST_CASE(block_subsidy_test)\n{\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN);\n    TestBlockSubsidyHalvings(chainParams->GetConsensus()); // As in main\n    TestBlockSubsidyHalvings(150); // As in regtest\n    TestBlockSubsidyHalvings(1000); // Just another interval\n}\n\nBOOST_AUTO_TEST_CASE(subsidy_limit_test)\n{\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN);\n    CAmount nSum = 0;\n\n    // SUGAR-HALVING\n    // BTC: (was 14000000 = 21000000/1.5)\n    for (int nHeight = 0; nHeight < 1073741824/1.5; nHeight += 1000) { // TotalSupply/1.5 = 1073741824/1.5 = 715827882.6666666\n        CAmount nSubsidy = GetBlockSubsidy(nHeight, chainParams->GetConsensus());\n        BOOST_CHECK(nSubsidy <= 42.94967296 * COIN); // SUGAR-HALVING // 2^32/COIN = 42.94967296 (was 50)\n        nSum += nSubsidy * 1000;\n        BOOST_CHECK(MoneyRange(nSum));\n    }\n    // SUGAR-HALVING\n    // BTC: (was 2099999997690000ULL)\n    // Total Supply in COINs (in theory):\t1073741824\n    // Total Supply in COINs (in actual):\t1073741823.87500000\n    // Difference: 0.125\n    BOOST_CHECK_EQUAL(nSum, 107374182387500000ULL); // Total Supply in Satoshis (in actual): :\t107374182387500000\n}\n\nbool ReturnFalse() { return false; }\nbool ReturnTrue() { return true; }\n\nBOOST_AUTO_TEST_CASE(test_combiner_all)\n{\n    boost::signals2::signal<bool (), CombinerAll> Test;\n    BOOST_CHECK(Test());\n    Test.connect(&ReturnFalse);\n    BOOST_CHECK(!Test());\n    Test.connect(&ReturnTrue);\n    BOOST_CHECK(!Test());\n    Test.disconnect(&ReturnFalse);\n    BOOST_CHECK(Test());\n    Test.disconnect(&ReturnTrue);\n    BOOST_CHECK(Test());\n}\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/mempool_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <policy/policy.h>\n#include <txmempool.h>\n#include <util.h>\n\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n#include <list>\n#include <vector>\n\nBOOST_FIXTURE_TEST_SUITE(mempool_tests, TestingSetup)\n\nBOOST_AUTO_TEST_CASE(MempoolRemoveTest)\n{\n    // Test CTxMemPool::remove functionality\n\n    TestMemPoolEntryHelper entry;\n    // Parent transaction with three children,\n    // and three grand-children:\n    CMutableTransaction txParent;\n    txParent.vin.resize(1);\n    txParent.vin[0].scriptSig = CScript() << OP_11;\n    txParent.vout.resize(3);\n    for (int i = 0; i < 3; i++)\n    {\n        txParent.vout[i].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n        txParent.vout[i].nValue = 33000LL;\n    }\n    CMutableTransaction txChild[3];\n    for (int i = 0; i < 3; i++)\n    {\n        txChild[i].vin.resize(1);\n        txChild[i].vin[0].scriptSig = CScript() << OP_11;\n        txChild[i].vin[0].prevout.hash = txParent.GetHash();\n        txChild[i].vin[0].prevout.n = i;\n        txChild[i].vout.resize(1);\n        txChild[i].vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n        txChild[i].vout[0].nValue = 11000LL;\n    }\n    CMutableTransaction txGrandChild[3];\n    for (int i = 0; i < 3; i++)\n    {\n        txGrandChild[i].vin.resize(1);\n        txGrandChild[i].vin[0].scriptSig = CScript() << OP_11;\n        txGrandChild[i].vin[0].prevout.hash = txChild[i].GetHash();\n        txGrandChild[i].vin[0].prevout.n = 0;\n        txGrandChild[i].vout.resize(1);\n        txGrandChild[i].vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n        txGrandChild[i].vout[0].nValue = 11000LL;\n    }\n\n\n    CTxMemPool testPool;\n\n    // Nothing in pool, remove should do nothing:\n    unsigned int poolSize = testPool.size();\n    testPool.removeRecursive(txParent);\n    BOOST_CHECK_EQUAL(testPool.size(), poolSize);\n\n    // Just the parent:\n    testPool.addUnchecked(txParent.GetHash(), entry.FromTx(txParent));\n    poolSize = testPool.size();\n    testPool.removeRecursive(txParent);\n    BOOST_CHECK_EQUAL(testPool.size(), poolSize - 1);\n    \n    // Parent, children, grandchildren:\n    testPool.addUnchecked(txParent.GetHash(), entry.FromTx(txParent));\n    for (int i = 0; i < 3; i++)\n    {\n        testPool.addUnchecked(txChild[i].GetHash(), entry.FromTx(txChild[i]));\n        testPool.addUnchecked(txGrandChild[i].GetHash(), entry.FromTx(txGrandChild[i]));\n    }\n    // Remove Child[0], GrandChild[0] should be removed:\n    poolSize = testPool.size();\n    testPool.removeRecursive(txChild[0]);\n    BOOST_CHECK_EQUAL(testPool.size(), poolSize - 2);\n    // ... make sure grandchild and child are gone:\n    poolSize = testPool.size();\n    testPool.removeRecursive(txGrandChild[0]);\n    BOOST_CHECK_EQUAL(testPool.size(), poolSize);\n    poolSize = testPool.size();\n    testPool.removeRecursive(txChild[0]);\n    BOOST_CHECK_EQUAL(testPool.size(), poolSize);\n    // Remove parent, all children/grandchildren should go:\n    poolSize = testPool.size();\n    testPool.removeRecursive(txParent);\n    BOOST_CHECK_EQUAL(testPool.size(), poolSize - 5);\n    BOOST_CHECK_EQUAL(testPool.size(), 0);\n\n    // Add children and grandchildren, but NOT the parent (simulate the parent being in a block)\n    for (int i = 0; i < 3; i++)\n    {\n        testPool.addUnchecked(txChild[i].GetHash(), entry.FromTx(txChild[i]));\n        testPool.addUnchecked(txGrandChild[i].GetHash(), entry.FromTx(txGrandChild[i]));\n    }\n    // Now remove the parent, as might happen if a block-re-org occurs but the parent cannot be\n    // put into the mempool (maybe because it is non-standard):\n    poolSize = testPool.size();\n    testPool.removeRecursive(txParent);\n    BOOST_CHECK_EQUAL(testPool.size(), poolSize - 6);\n    BOOST_CHECK_EQUAL(testPool.size(), 0);\n}\n\ntemplate<typename name>\nvoid CheckSort(CTxMemPool &pool, std::vector<std::string> &sortedOrder)\n{\n    BOOST_CHECK_EQUAL(pool.size(), sortedOrder.size());\n    typename CTxMemPool::indexed_transaction_set::index<name>::type::iterator it = pool.mapTx.get<name>().begin();\n    int count=0;\n    for (; it != pool.mapTx.get<name>().end(); ++it, ++count) {\n        BOOST_CHECK_EQUAL(it->GetTx().GetHash().ToString(), sortedOrder[count]);\n    }\n}\n\nBOOST_AUTO_TEST_CASE(MempoolIndexingTest)\n{\n    CTxMemPool pool;\n    TestMemPoolEntryHelper entry;\n\n    /* 3rd highest fee */\n    CMutableTransaction tx1 = CMutableTransaction();\n    tx1.vout.resize(1);\n    tx1.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx1.vout[0].nValue = 10 * COIN;\n    pool.addUnchecked(tx1.GetHash(), entry.Fee(10000LL).FromTx(tx1));\n\n    /* highest fee */\n    CMutableTransaction tx2 = CMutableTransaction();\n    tx2.vout.resize(1);\n    tx2.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx2.vout[0].nValue = 2 * COIN;\n    pool.addUnchecked(tx2.GetHash(), entry.Fee(20000LL).FromTx(tx2));\n\n    /* lowest fee */\n    CMutableTransaction tx3 = CMutableTransaction();\n    tx3.vout.resize(1);\n    tx3.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx3.vout[0].nValue = 5 * COIN;\n    pool.addUnchecked(tx3.GetHash(), entry.Fee(0LL).FromTx(tx3));\n\n    /* 2nd highest fee */\n    CMutableTransaction tx4 = CMutableTransaction();\n    tx4.vout.resize(1);\n    tx4.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx4.vout[0].nValue = 6 * COIN;\n    pool.addUnchecked(tx4.GetHash(), entry.Fee(15000LL).FromTx(tx4));\n\n    /* equal fee rate to tx1, but newer */\n    CMutableTransaction tx5 = CMutableTransaction();\n    tx5.vout.resize(1);\n    tx5.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx5.vout[0].nValue = 11 * COIN;\n    entry.nTime = 1;\n    pool.addUnchecked(tx5.GetHash(), entry.Fee(10000LL).FromTx(tx5));\n    BOOST_CHECK_EQUAL(pool.size(), 5);\n\n    std::vector<std::string> sortedOrder;\n    sortedOrder.resize(5);\n    sortedOrder[0] = tx3.GetHash().ToString(); // 0\n    sortedOrder[1] = tx5.GetHash().ToString(); // 10000\n    sortedOrder[2] = tx1.GetHash().ToString(); // 10000\n    sortedOrder[3] = tx4.GetHash().ToString(); // 15000\n    sortedOrder[4] = tx2.GetHash().ToString(); // 20000\n    LOCK(pool.cs);\n    CheckSort<descendant_score>(pool, sortedOrder);\n\n    /* low fee but with high fee child */\n    /* tx6 -> tx7 -> tx8, tx9 -> tx10 */\n    CMutableTransaction tx6 = CMutableTransaction();\n    tx6.vout.resize(1);\n    tx6.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx6.vout[0].nValue = 20 * COIN;\n    pool.addUnchecked(tx6.GetHash(), entry.Fee(0LL).FromTx(tx6));\n    BOOST_CHECK_EQUAL(pool.size(), 6);\n    // Check that at this point, tx6 is sorted low\n    sortedOrder.insert(sortedOrder.begin(), tx6.GetHash().ToString());\n    CheckSort<descendant_score>(pool, sortedOrder);\n\n    CTxMemPool::setEntries setAncestors;\n    setAncestors.insert(pool.mapTx.find(tx6.GetHash()));\n    CMutableTransaction tx7 = CMutableTransaction();\n    tx7.vin.resize(1);\n    tx7.vin[0].prevout = COutPoint(tx6.GetHash(), 0);\n    tx7.vin[0].scriptSig = CScript() << OP_11;\n    tx7.vout.resize(2);\n    tx7.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx7.vout[0].nValue = 10 * COIN;\n    tx7.vout[1].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx7.vout[1].nValue = 1 * COIN;\n\n    CTxMemPool::setEntries setAncestorsCalculated;\n    std::string dummy;\n    BOOST_CHECK_EQUAL(pool.CalculateMemPoolAncestors(entry.Fee(2000000LL).FromTx(tx7), setAncestorsCalculated, 100, 1000000, 1000, 1000000, dummy), true);\n    BOOST_CHECK(setAncestorsCalculated == setAncestors);\n\n    pool.addUnchecked(tx7.GetHash(), entry.FromTx(tx7), setAncestors);\n    BOOST_CHECK_EQUAL(pool.size(), 7);\n\n    // Now tx6 should be sorted higher (high fee child): tx7, tx6, tx2, ...\n    sortedOrder.erase(sortedOrder.begin());\n    sortedOrder.push_back(tx6.GetHash().ToString());\n    sortedOrder.push_back(tx7.GetHash().ToString());\n    CheckSort<descendant_score>(pool, sortedOrder);\n\n    /* low fee child of tx7 */\n    CMutableTransaction tx8 = CMutableTransaction();\n    tx8.vin.resize(1);\n    tx8.vin[0].prevout = COutPoint(tx7.GetHash(), 0);\n    tx8.vin[0].scriptSig = CScript() << OP_11;\n    tx8.vout.resize(1);\n    tx8.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx8.vout[0].nValue = 10 * COIN;\n    setAncestors.insert(pool.mapTx.find(tx7.GetHash()));\n    pool.addUnchecked(tx8.GetHash(), entry.Fee(0LL).Time(2).FromTx(tx8), setAncestors);\n\n    // Now tx8 should be sorted low, but tx6/tx both high\n    sortedOrder.insert(sortedOrder.begin(), tx8.GetHash().ToString());\n    CheckSort<descendant_score>(pool, sortedOrder);\n\n    /* low fee child of tx7 */\n    CMutableTransaction tx9 = CMutableTransaction();\n    tx9.vin.resize(1);\n    tx9.vin[0].prevout = COutPoint(tx7.GetHash(), 1);\n    tx9.vin[0].scriptSig = CScript() << OP_11;\n    tx9.vout.resize(1);\n    tx9.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx9.vout[0].nValue = 1 * COIN;\n    pool.addUnchecked(tx9.GetHash(), entry.Fee(0LL).Time(3).FromTx(tx9), setAncestors);\n\n    // tx9 should be sorted low\n    BOOST_CHECK_EQUAL(pool.size(), 9);\n    sortedOrder.insert(sortedOrder.begin(), tx9.GetHash().ToString());\n    CheckSort<descendant_score>(pool, sortedOrder);\n\n    std::vector<std::string> snapshotOrder = sortedOrder;\n\n    setAncestors.insert(pool.mapTx.find(tx8.GetHash()));\n    setAncestors.insert(pool.mapTx.find(tx9.GetHash()));\n    /* tx10 depends on tx8 and tx9 and has a high fee*/\n    CMutableTransaction tx10 = CMutableTransaction();\n    tx10.vin.resize(2);\n    tx10.vin[0].prevout = COutPoint(tx8.GetHash(), 0);\n    tx10.vin[0].scriptSig = CScript() << OP_11;\n    tx10.vin[1].prevout = COutPoint(tx9.GetHash(), 0);\n    tx10.vin[1].scriptSig = CScript() << OP_11;\n    tx10.vout.resize(1);\n    tx10.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx10.vout[0].nValue = 10 * COIN;\n\n    setAncestorsCalculated.clear();\n    BOOST_CHECK_EQUAL(pool.CalculateMemPoolAncestors(entry.Fee(200000LL).Time(4).FromTx(tx10), setAncestorsCalculated, 100, 1000000, 1000, 1000000, dummy), true);\n    BOOST_CHECK(setAncestorsCalculated == setAncestors);\n\n    pool.addUnchecked(tx10.GetHash(), entry.FromTx(tx10), setAncestors);\n\n    /**\n     *  tx8 and tx9 should both now be sorted higher\n     *  Final order after tx10 is added:\n     *\n     *  tx3 = 0 (1)\n     *  tx5 = 10000 (1)\n     *  tx1 = 10000 (1)\n     *  tx4 = 15000 (1)\n     *  tx2 = 20000 (1)\n     *  tx9 = 200k (2 txs)\n     *  tx8 = 200k (2 txs)\n     *  tx10 = 200k (1 tx)\n     *  tx6 = 2.2M (5 txs)\n     *  tx7 = 2.2M (4 txs)\n     */\n    sortedOrder.erase(sortedOrder.begin(), sortedOrder.begin()+2); // take out tx9, tx8 from the beginning\n    sortedOrder.insert(sortedOrder.begin()+5, tx9.GetHash().ToString());\n    sortedOrder.insert(sortedOrder.begin()+6, tx8.GetHash().ToString());\n    sortedOrder.insert(sortedOrder.begin()+7, tx10.GetHash().ToString()); // tx10 is just before tx6\n    CheckSort<descendant_score>(pool, sortedOrder);\n\n    // there should be 10 transactions in the mempool\n    BOOST_CHECK_EQUAL(pool.size(), 10);\n\n    // Now try removing tx10 and verify the sort order returns to normal\n    pool.removeRecursive(pool.mapTx.find(tx10.GetHash())->GetTx());\n    CheckSort<descendant_score>(pool, snapshotOrder);\n\n    pool.removeRecursive(pool.mapTx.find(tx9.GetHash())->GetTx());\n    pool.removeRecursive(pool.mapTx.find(tx8.GetHash())->GetTx());\n}\n\nBOOST_AUTO_TEST_CASE(MempoolAncestorIndexingTest)\n{\n    CTxMemPool pool;\n    TestMemPoolEntryHelper entry;\n\n    /* 3rd highest fee */\n    CMutableTransaction tx1 = CMutableTransaction();\n    tx1.vout.resize(1);\n    tx1.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx1.vout[0].nValue = 10 * COIN;\n    pool.addUnchecked(tx1.GetHash(), entry.Fee(10000LL).FromTx(tx1));\n\n    /* highest fee */\n    CMutableTransaction tx2 = CMutableTransaction();\n    tx2.vout.resize(1);\n    tx2.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx2.vout[0].nValue = 2 * COIN;\n    pool.addUnchecked(tx2.GetHash(), entry.Fee(20000LL).FromTx(tx2));\n    uint64_t tx2Size = GetVirtualTransactionSize(tx2);\n\n    /* lowest fee */\n    CMutableTransaction tx3 = CMutableTransaction();\n    tx3.vout.resize(1);\n    tx3.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx3.vout[0].nValue = 5 * COIN;\n    pool.addUnchecked(tx3.GetHash(), entry.Fee(0LL).FromTx(tx3));\n\n    /* 2nd highest fee */\n    CMutableTransaction tx4 = CMutableTransaction();\n    tx4.vout.resize(1);\n    tx4.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx4.vout[0].nValue = 6 * COIN;\n    pool.addUnchecked(tx4.GetHash(), entry.Fee(15000LL).FromTx(tx4));\n\n    /* equal fee rate to tx1, but newer */\n    CMutableTransaction tx5 = CMutableTransaction();\n    tx5.vout.resize(1);\n    tx5.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx5.vout[0].nValue = 11 * COIN;\n    pool.addUnchecked(tx5.GetHash(), entry.Fee(10000LL).FromTx(tx5));\n    BOOST_CHECK_EQUAL(pool.size(), 5);\n\n    std::vector<std::string> sortedOrder;\n    sortedOrder.resize(5);\n    sortedOrder[0] = tx2.GetHash().ToString(); // 20000\n    sortedOrder[1] = tx4.GetHash().ToString(); // 15000\n    // tx1 and tx5 are both 10000\n    // Ties are broken by hash, not timestamp, so determine which\n    // hash comes first.\n    if (tx1.GetHash() < tx5.GetHash()) {\n        sortedOrder[2] = tx1.GetHash().ToString();\n        sortedOrder[3] = tx5.GetHash().ToString();\n    } else {\n        sortedOrder[2] = tx5.GetHash().ToString();\n        sortedOrder[3] = tx1.GetHash().ToString();\n    }\n    sortedOrder[4] = tx3.GetHash().ToString(); // 0\n\n    LOCK(pool.cs);\n    CheckSort<ancestor_score>(pool, sortedOrder);\n\n    /* low fee parent with high fee child */\n    /* tx6 (0) -> tx7 (high) */\n    CMutableTransaction tx6 = CMutableTransaction();\n    tx6.vout.resize(1);\n    tx6.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx6.vout[0].nValue = 20 * COIN;\n    uint64_t tx6Size = GetVirtualTransactionSize(tx6);\n\n    pool.addUnchecked(tx6.GetHash(), entry.Fee(0LL).FromTx(tx6));\n    BOOST_CHECK_EQUAL(pool.size(), 6);\n    // Ties are broken by hash\n    if (tx3.GetHash() < tx6.GetHash())\n        sortedOrder.push_back(tx6.GetHash().ToString());\n    else\n        sortedOrder.insert(sortedOrder.end()-1,tx6.GetHash().ToString());\n\n    CheckSort<ancestor_score>(pool, sortedOrder);\n\n    CMutableTransaction tx7 = CMutableTransaction();\n    tx7.vin.resize(1);\n    tx7.vin[0].prevout = COutPoint(tx6.GetHash(), 0);\n    tx7.vin[0].scriptSig = CScript() << OP_11;\n    tx7.vout.resize(1);\n    tx7.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx7.vout[0].nValue = 10 * COIN;\n    uint64_t tx7Size = GetVirtualTransactionSize(tx7);\n\n    /* set the fee to just below tx2's feerate when including ancestor */\n    CAmount fee = (20000/tx2Size)*(tx7Size + tx6Size) - 1;\n\n    pool.addUnchecked(tx7.GetHash(), entry.Fee(fee).FromTx(tx7));\n    BOOST_CHECK_EQUAL(pool.size(), 7);\n    sortedOrder.insert(sortedOrder.begin()+1, tx7.GetHash().ToString());\n    CheckSort<ancestor_score>(pool, sortedOrder);\n\n    /* after tx6 is mined, tx7 should move up in the sort */\n    std::vector<CTransactionRef> vtx;\n    vtx.push_back(MakeTransactionRef(tx6));\n    pool.removeForBlock(vtx, 1);\n\n    sortedOrder.erase(sortedOrder.begin()+1);\n    // Ties are broken by hash\n    if (tx3.GetHash() < tx6.GetHash())\n        sortedOrder.pop_back();\n    else\n        sortedOrder.erase(sortedOrder.end()-2);\n    sortedOrder.insert(sortedOrder.begin(), tx7.GetHash().ToString());\n    CheckSort<ancestor_score>(pool, sortedOrder);\n\n    // High-fee parent, low-fee child\n    // tx7 -> tx8\n    CMutableTransaction tx8 = CMutableTransaction();\n    tx8.vin.resize(1);\n    tx8.vin[0].prevout  = COutPoint(tx7.GetHash(), 0);\n    tx8.vin[0].scriptSig = CScript() << OP_11;\n    tx8.vout.resize(1);\n    tx8.vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL;\n    tx8.vout[0].nValue = 10*COIN;\n\n    // Check that we sort by min(feerate, ancestor_feerate):\n    // set the fee so that the ancestor feerate is above tx1/5,\n    // but the transaction's own feerate is lower\n    pool.addUnchecked(tx8.GetHash(), entry.Fee(5000LL).FromTx(tx8));\n    sortedOrder.insert(sortedOrder.end()-1, tx8.GetHash().ToString());\n    CheckSort<ancestor_score>(pool, sortedOrder);\n}\n\n\nBOOST_AUTO_TEST_CASE(MempoolSizeLimitTest)\n{\n    CTxMemPool pool;\n    TestMemPoolEntryHelper entry;\n\n    CMutableTransaction tx1 = CMutableTransaction();\n    tx1.vin.resize(1);\n    tx1.vin[0].scriptSig = CScript() << OP_1;\n    tx1.vout.resize(1);\n    tx1.vout[0].scriptPubKey = CScript() << OP_1 << OP_EQUAL;\n    tx1.vout[0].nValue = 10 * COIN;\n    pool.addUnchecked(tx1.GetHash(), entry.Fee(10000LL).FromTx(tx1));\n\n    CMutableTransaction tx2 = CMutableTransaction();\n    tx2.vin.resize(1);\n    tx2.vin[0].scriptSig = CScript() << OP_2;\n    tx2.vout.resize(1);\n    tx2.vout[0].scriptPubKey = CScript() << OP_2 << OP_EQUAL;\n    tx2.vout[0].nValue = 10 * COIN;\n    pool.addUnchecked(tx2.GetHash(), entry.Fee(5000LL).FromTx(tx2));\n\n    pool.TrimToSize(pool.DynamicMemoryUsage()); // should do nothing\n    BOOST_CHECK(pool.exists(tx1.GetHash()));\n    BOOST_CHECK(pool.exists(tx2.GetHash()));\n\n    pool.TrimToSize(pool.DynamicMemoryUsage() * 3 / 4); // should remove the lower-feerate transaction\n    BOOST_CHECK(pool.exists(tx1.GetHash()));\n    BOOST_CHECK(!pool.exists(tx2.GetHash()));\n\n    pool.addUnchecked(tx2.GetHash(), entry.FromTx(tx2));\n    CMutableTransaction tx3 = CMutableTransaction();\n    tx3.vin.resize(1);\n    tx3.vin[0].prevout = COutPoint(tx2.GetHash(), 0);\n    tx3.vin[0].scriptSig = CScript() << OP_2;\n    tx3.vout.resize(1);\n    tx3.vout[0].scriptPubKey = CScript() << OP_3 << OP_EQUAL;\n    tx3.vout[0].nValue = 10 * COIN;\n    pool.addUnchecked(tx3.GetHash(), entry.Fee(20000LL).FromTx(tx3));\n\n    pool.TrimToSize(pool.DynamicMemoryUsage() * 3 / 4); // tx3 should pay for tx2 (CPFP)\n    BOOST_CHECK(!pool.exists(tx1.GetHash()));\n    BOOST_CHECK(pool.exists(tx2.GetHash()));\n    BOOST_CHECK(pool.exists(tx3.GetHash()));\n\n    pool.TrimToSize(GetVirtualTransactionSize(tx1)); // mempool is limited to tx1's size in memory usage, so nothing fits\n    BOOST_CHECK(!pool.exists(tx1.GetHash()));\n    BOOST_CHECK(!pool.exists(tx2.GetHash()));\n    BOOST_CHECK(!pool.exists(tx3.GetHash()));\n\n    CFeeRate maxFeeRateRemoved(25000, GetVirtualTransactionSize(tx3) + GetVirtualTransactionSize(tx2));\n    BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), maxFeeRateRemoved.GetFeePerK() + 1000);\n\n    CMutableTransaction tx4 = CMutableTransaction();\n    tx4.vin.resize(2);\n    tx4.vin[0].prevout.SetNull();\n    tx4.vin[0].scriptSig = CScript() << OP_4;\n    tx4.vin[1].prevout.SetNull();\n    tx4.vin[1].scriptSig = CScript() << OP_4;\n    tx4.vout.resize(2);\n    tx4.vout[0].scriptPubKey = CScript() << OP_4 << OP_EQUAL;\n    tx4.vout[0].nValue = 10 * COIN;\n    tx4.vout[1].scriptPubKey = CScript() << OP_4 << OP_EQUAL;\n    tx4.vout[1].nValue = 10 * COIN;\n\n    CMutableTransaction tx5 = CMutableTransaction();\n    tx5.vin.resize(2);\n    tx5.vin[0].prevout = COutPoint(tx4.GetHash(), 0);\n    tx5.vin[0].scriptSig = CScript() << OP_4;\n    tx5.vin[1].prevout.SetNull();\n    tx5.vin[1].scriptSig = CScript() << OP_5;\n    tx5.vout.resize(2);\n    tx5.vout[0].scriptPubKey = CScript() << OP_5 << OP_EQUAL;\n    tx5.vout[0].nValue = 10 * COIN;\n    tx5.vout[1].scriptPubKey = CScript() << OP_5 << OP_EQUAL;\n    tx5.vout[1].nValue = 10 * COIN;\n\n    CMutableTransaction tx6 = CMutableTransaction();\n    tx6.vin.resize(2);\n    tx6.vin[0].prevout = COutPoint(tx4.GetHash(), 1);\n    tx6.vin[0].scriptSig = CScript() << OP_4;\n    tx6.vin[1].prevout.SetNull();\n    tx6.vin[1].scriptSig = CScript() << OP_6;\n    tx6.vout.resize(2);\n    tx6.vout[0].scriptPubKey = CScript() << OP_6 << OP_EQUAL;\n    tx6.vout[0].nValue = 10 * COIN;\n    tx6.vout[1].scriptPubKey = CScript() << OP_6 << OP_EQUAL;\n    tx6.vout[1].nValue = 10 * COIN;\n\n    CMutableTransaction tx7 = CMutableTransaction();\n    tx7.vin.resize(2);\n    tx7.vin[0].prevout = COutPoint(tx5.GetHash(), 0);\n    tx7.vin[0].scriptSig = CScript() << OP_5;\n    tx7.vin[1].prevout = COutPoint(tx6.GetHash(), 0);\n    tx7.vin[1].scriptSig = CScript() << OP_6;\n    tx7.vout.resize(2);\n    tx7.vout[0].scriptPubKey = CScript() << OP_7 << OP_EQUAL;\n    tx7.vout[0].nValue = 10 * COIN;\n    tx7.vout[1].scriptPubKey = CScript() << OP_7 << OP_EQUAL;\n    tx7.vout[1].nValue = 10 * COIN;\n\n    pool.addUnchecked(tx4.GetHash(), entry.Fee(7000LL).FromTx(tx4));\n    pool.addUnchecked(tx5.GetHash(), entry.Fee(1000LL).FromTx(tx5));\n    pool.addUnchecked(tx6.GetHash(), entry.Fee(1100LL).FromTx(tx6));\n    pool.addUnchecked(tx7.GetHash(), entry.Fee(9000LL).FromTx(tx7));\n\n    // we only require this remove, at max, 2 txn, because its not clear what we're really optimizing for aside from that\n    pool.TrimToSize(pool.DynamicMemoryUsage() - 1);\n    BOOST_CHECK(pool.exists(tx4.GetHash()));\n    BOOST_CHECK(pool.exists(tx6.GetHash()));\n    BOOST_CHECK(!pool.exists(tx7.GetHash()));\n\n    if (!pool.exists(tx5.GetHash()))\n        pool.addUnchecked(tx5.GetHash(), entry.Fee(1000LL).FromTx(tx5));\n    pool.addUnchecked(tx7.GetHash(), entry.Fee(9000LL).FromTx(tx7));\n\n    pool.TrimToSize(pool.DynamicMemoryUsage() / 2); // should maximize mempool size by only removing 5/7\n    BOOST_CHECK(pool.exists(tx4.GetHash()));\n    BOOST_CHECK(!pool.exists(tx5.GetHash()));\n    BOOST_CHECK(pool.exists(tx6.GetHash()));\n    BOOST_CHECK(!pool.exists(tx7.GetHash()));\n\n    pool.addUnchecked(tx5.GetHash(), entry.Fee(1000LL).FromTx(tx5));\n    pool.addUnchecked(tx7.GetHash(), entry.Fee(9000LL).FromTx(tx7));\n\n    std::vector<CTransactionRef> vtx;\n    SetMockTime(42);\n    SetMockTime(42 + CTxMemPool::ROLLING_FEE_HALFLIFE);\n    BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), maxFeeRateRemoved.GetFeePerK() + 1000);\n    // ... we should keep the same min fee until we get a block\n    pool.removeForBlock(vtx, 1);\n    SetMockTime(42 + 2*CTxMemPool::ROLLING_FEE_HALFLIFE);\n    BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), llround((maxFeeRateRemoved.GetFeePerK() + 1000)/2.0));\n    // ... then feerate should drop 1/2 each halflife\n\n    SetMockTime(42 + 2*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2);\n    BOOST_CHECK_EQUAL(pool.GetMinFee(pool.DynamicMemoryUsage() * 5 / 2).GetFeePerK(), llround((maxFeeRateRemoved.GetFeePerK() + 1000)/4.0));\n    // ... with a 1/2 halflife when mempool is < 1/2 its target size\n\n    SetMockTime(42 + 2*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4);\n    BOOST_CHECK_EQUAL(pool.GetMinFee(pool.DynamicMemoryUsage() * 9 / 2).GetFeePerK(), llround((maxFeeRateRemoved.GetFeePerK() + 1000)/8.0));\n    // ... with a 1/4 halflife when mempool is < 1/4 its target size\n\n    SetMockTime(42 + 7*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4);\n    BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), 1000);\n    // ... but feerate should never drop below 1000\n\n    SetMockTime(42 + 8*CTxMemPool::ROLLING_FEE_HALFLIFE + CTxMemPool::ROLLING_FEE_HALFLIFE/2 + CTxMemPool::ROLLING_FEE_HALFLIFE/4);\n    BOOST_CHECK_EQUAL(pool.GetMinFee(1).GetFeePerK(), 0);\n    // ... unless it has gone all the way to 0 (after getting past 1000/2)\n\n    SetMockTime(0);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/merkle_tests.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <consensus/merkle.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(merkle_tests, TestingSetup)\n\n// Older version of the merkle root computation code, for comparison.\nstatic uint256 BlockBuildMerkleTree(const CBlock& block, bool* fMutated, std::vector<uint256>& vMerkleTree)\n{\n    vMerkleTree.clear();\n    vMerkleTree.reserve(block.vtx.size() * 2 + 16); // Safe upper bound for the number of total nodes.\n    for (std::vector<CTransactionRef>::const_iterator it(block.vtx.begin()); it != block.vtx.end(); ++it)\n        vMerkleTree.push_back((*it)->GetHash());\n    int j = 0;\n    bool mutated = false;\n    for (int nSize = block.vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)\n    {\n        for (int i = 0; i < nSize; i += 2)\n        {\n            int i2 = std::min(i+1, nSize-1);\n            if (i2 == i + 1 && i2 + 1 == nSize && vMerkleTree[j+i] == vMerkleTree[j+i2]) {\n                // Two identical hashes at the end of the list at a particular level.\n                mutated = true;\n            }\n            vMerkleTree.push_back(Hash(vMerkleTree[j+i].begin(), vMerkleTree[j+i].end(),\n                                       vMerkleTree[j+i2].begin(), vMerkleTree[j+i2].end()));\n        }\n        j += nSize;\n    }\n    if (fMutated) {\n        *fMutated = mutated;\n    }\n    return (vMerkleTree.empty() ? uint256() : vMerkleTree.back());\n}\n\n// Older version of the merkle branch computation code, for comparison.\nstatic std::vector<uint256> BlockGetMerkleBranch(const CBlock& block, const std::vector<uint256>& vMerkleTree, int nIndex)\n{\n    std::vector<uint256> vMerkleBranch;\n    int j = 0;\n    for (int nSize = block.vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)\n    {\n        int i = std::min(nIndex^1, nSize-1);\n        vMerkleBranch.push_back(vMerkleTree[j+i]);\n        nIndex >>= 1;\n        j += nSize;\n    }\n    return vMerkleBranch;\n}\n\nstatic inline int ctz(uint32_t i) {\n    if (i == 0) return 0;\n    int j = 0;\n    while (!(i & 1)) {\n        j++;\n        i >>= 1;\n    }\n    return j;\n}\n\nBOOST_AUTO_TEST_CASE(merkle_test)\n{\n    for (int i = 0; i < 32; i++) {\n        // Try 32 block sizes: all sizes from 0 to 16 inclusive, and then 15 random sizes.\n        int ntx = (i <= 16) ? i : 17 + (InsecureRandRange(4000));\n        // Try up to 3 mutations.\n        for (int mutate = 0; mutate <= 3; mutate++) {\n            int duplicate1 = mutate >= 1 ? 1 << ctz(ntx) : 0; // The last how many transactions to duplicate first.\n            if (duplicate1 >= ntx) break; // Duplication of the entire tree results in a different root (it adds a level).\n            int ntx1 = ntx + duplicate1; // The resulting number of transactions after the first duplication.\n            int duplicate2 = mutate >= 2 ? 1 << ctz(ntx1) : 0; // Likewise for the second mutation.\n            if (duplicate2 >= ntx1) break;\n            int ntx2 = ntx1 + duplicate2;\n            int duplicate3 = mutate >= 3 ? 1 << ctz(ntx2) : 0; // And for the third mutation.\n            if (duplicate3 >= ntx2) break;\n            int ntx3 = ntx2 + duplicate3;\n            // Build a block with ntx different transactions.\n            CBlock block;\n            block.vtx.resize(ntx);\n            for (int j = 0; j < ntx; j++) {\n                CMutableTransaction mtx;\n                mtx.nLockTime = j;\n                block.vtx[j] = MakeTransactionRef(std::move(mtx));\n            }\n            // Compute the root of the block before mutating it.\n            bool unmutatedMutated = false;\n            uint256 unmutatedRoot = BlockMerkleRoot(block, &unmutatedMutated);\n            BOOST_CHECK(unmutatedMutated == false);\n            // Optionally mutate by duplicating the last transactions, resulting in the same merkle root.\n            block.vtx.resize(ntx3);\n            for (int j = 0; j < duplicate1; j++) {\n                block.vtx[ntx + j] = block.vtx[ntx + j - duplicate1];\n            }\n            for (int j = 0; j < duplicate2; j++) {\n                block.vtx[ntx1 + j] = block.vtx[ntx1 + j - duplicate2];\n            }\n            for (int j = 0; j < duplicate3; j++) {\n                block.vtx[ntx2 + j] = block.vtx[ntx2 + j - duplicate3];\n            }\n            // Compute the merkle root and merkle tree using the old mechanism.\n            bool oldMutated = false;\n            std::vector<uint256> merkleTree;\n            uint256 oldRoot = BlockBuildMerkleTree(block, &oldMutated, merkleTree);\n            // Compute the merkle root using the new mechanism.\n            bool newMutated = false;\n            uint256 newRoot = BlockMerkleRoot(block, &newMutated);\n            BOOST_CHECK(oldRoot == newRoot);\n            BOOST_CHECK(newRoot == unmutatedRoot);\n            BOOST_CHECK((newRoot == uint256()) == (ntx == 0));\n            BOOST_CHECK(oldMutated == newMutated);\n            BOOST_CHECK(newMutated == !!mutate);\n            // If no mutation was done (once for every ntx value), try up to 16 branches.\n            if (mutate == 0) {\n                for (int loop = 0; loop < std::min(ntx, 16); loop++) {\n                    // If ntx <= 16, try all branches. Otherwise, try 16 random ones.\n                    int mtx = loop;\n                    if (ntx > 16) {\n                        mtx = InsecureRandRange(ntx);\n                    }\n                    std::vector<uint256> newBranch = BlockMerkleBranch(block, mtx);\n                    std::vector<uint256> oldBranch = BlockGetMerkleBranch(block, merkleTree, mtx);\n                    BOOST_CHECK(oldBranch == newBranch);\n                    BOOST_CHECK(ComputeMerkleRootFromBranch(block.vtx[mtx]->GetHash(), newBranch, mtx) == oldRoot);\n                }\n            }\n        }\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/merkleblock_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <merkleblock.h>\n#include <uint256.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\n\nBOOST_FIXTURE_TEST_SUITE(merkleblock_tests, BasicTestingSetup)\n\n/**\n * Create a CMerkleBlock using a list of txids which will be found in the\n * given block.\n */\nBOOST_AUTO_TEST_CASE(merkleblock_construct_from_txids_found)\n{\n    CBlock block = getBlock13b8a();\n\n    std::set<uint256> txids;\n\n    // Last txn in block.\n    uint256 txhash1 = uint256S(\"0x74d681e0e03bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20\");\n\n    // Second txn in block.\n    uint256 txhash2 = uint256S(\"0xf9fc751cb7dc372406a9f8d738d5e6f8f63bab71986a39cf36ee70ee17036d07\");\n\n    txids.insert(txhash1);\n    txids.insert(txhash2);\n\n    CMerkleBlock merkleBlock(block, txids);\n\n    BOOST_CHECK_EQUAL(merkleBlock.header.GetHash().GetHex(), block.GetHash().GetHex());\n\n    // vMatchedTxn is only used when bloom filter is specified.\n    BOOST_CHECK_EQUAL(merkleBlock.vMatchedTxn.size(), 0);\n\n    std::vector<uint256> vMatched;\n    std::vector<unsigned int> vIndex;\n\n    BOOST_CHECK_EQUAL(merkleBlock.txn.ExtractMatches(vMatched, vIndex).GetHex(), block.hashMerkleRoot.GetHex());\n    BOOST_CHECK_EQUAL(vMatched.size(), 2);\n\n    // Ordered by occurrence in depth-first tree traversal.\n    BOOST_CHECK_EQUAL(vMatched[0].ToString(), txhash2.ToString());\n    BOOST_CHECK_EQUAL(vIndex[0], 1);\n\n    BOOST_CHECK_EQUAL(vMatched[1].ToString(), txhash1.ToString());\n    BOOST_CHECK_EQUAL(vIndex[1], 8);\n}\n\n\n/**\n * Create a CMerkleBlock using a list of txids which will not be found in the\n * given block.\n */\nBOOST_AUTO_TEST_CASE(merkleblock_construct_from_txids_not_found)\n{\n    CBlock block = getBlock13b8a();\n\n    std::set<uint256> txids2;\n    txids2.insert(uint256S(\"0xc0ffee00003bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20\"));\n    CMerkleBlock merkleBlock(block, txids2);\n\n    BOOST_CHECK_EQUAL(merkleBlock.header.GetHash().GetHex(), block.GetHash().GetHex());\n    BOOST_CHECK_EQUAL(merkleBlock.vMatchedTxn.size(), 0);\n\n    std::vector<uint256> vMatched;\n    std::vector<unsigned int> vIndex;\n\n    BOOST_CHECK_EQUAL(merkleBlock.txn.ExtractMatches(vMatched, vIndex).GetHex(), block.hashMerkleRoot.GetHex());\n    BOOST_CHECK_EQUAL(vMatched.size(), 0);\n    BOOST_CHECK_EQUAL(vIndex.size(), 0);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/miner_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <chainparams.h>\n#include <coins.h>\n#include <consensus/consensus.h>\n#include <consensus/merkle.h>\n#include <consensus/tx_verify.h>\n#include <consensus/validation.h>\n#include <validation.h>\n#include <miner.h>\n#include <policy/policy.h>\n#include <pubkey.h>\n#include <script/standard.h>\n#include <txmempool.h>\n#include <uint256.h>\n#include <util.h>\n#include <utilstrencodings.h>\n\n#include <test/test_bitcoin.h>\n\n#include <memory>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(miner_tests, TestingSetup)\n\n// BOOST_CHECK_EXCEPTION predicates to check the specific validation error\nclass HasReason {\npublic:\n    HasReason(const std::string& reason) : m_reason(reason) {}\n    bool operator() (const std::runtime_error& e) const {\n        return std::string(e.what()).find(m_reason) != std::string::npos;\n    };\nprivate:\n    const std::string m_reason;\n};\n\nstatic CFeeRate blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE);\n\nstatic BlockAssembler AssemblerForTest(const CChainParams& params) {\n    BlockAssembler::Options options;\n\n    options.nBlockMaxWeight = MAX_BLOCK_WEIGHT;\n    options.blockMinFeeRate = blockMinFeeRate;\n    return BlockAssembler(params, options);\n}\n\nstatic\nstruct {\n    unsigned char extranonce;\n    unsigned int nonce;\n} blockinfo[] = {\n    {4, 0xa4a3e223}, {2, 0x15c32f9e}, {1, 0x0375b547}, {1, 0x7004a8a5},\n    {2, 0xce440296}, {2, 0x52cfe198}, {1, 0x77a72cd0}, {2, 0xbb5d6f84},\n    {2, 0x83f30c2c}, {1, 0x48a73d5b}, {1, 0xef7dcd01}, {2, 0x6809c6c4},\n    {2, 0x0883ab3c}, {1, 0x087bbbe2}, {2, 0x2104a814}, {2, 0xdffb6daa},\n    {1, 0xee8a0a08}, {2, 0xba4237c1}, {1, 0xa70349dc}, {1, 0x344722bb},\n    {3, 0xd6294733}, {2, 0xec9f5c94}, {2, 0xca2fbc28}, {1, 0x6ba4f406},\n    {2, 0x015d4532}, {1, 0x6e119b7c}, {2, 0x43e8f314}, {2, 0x27962f38},\n    {2, 0xb571b51b}, {2, 0xb36bee23}, {2, 0xd17924a8}, {2, 0x6bc212d9},\n    {1, 0x630d4948}, {2, 0x9a4c4ebb}, {2, 0x554be537}, {1, 0xd63ddfc7},\n    {2, 0xa10acc11}, {1, 0x759a8363}, {2, 0xfb73090d}, {1, 0xe82c6a34},\n    {1, 0xe33e92d7}, {3, 0x658ef5cb}, {2, 0xba32ff22}, {5, 0x0227a10c},\n    {1, 0xa9a70155}, {5, 0xd096d809}, {1, 0x37176174}, {1, 0x830b8d0f},\n    {1, 0xc6e3910e}, {2, 0x823f3ca8}, {1, 0x99850849}, {1, 0x7521fb81},\n    {1, 0xaacaabab}, {1, 0xd645a2eb}, {5, 0x7aea1781}, {5, 0x9d6e4b78},\n    {1, 0x4ce90fd8}, {1, 0xabdc832d}, {6, 0x4a34f32a}, {2, 0xf2524c1c},\n    {2, 0x1bbeb08a}, {1, 0xad47f480}, {1, 0x9f026aeb}, {1, 0x15a95049},\n    {2, 0xd1cb95b2}, {2, 0xf84bbda5}, {1, 0x0fa62cd1}, {1, 0xe05f9169},\n    {1, 0x78d194a9}, {5, 0x3e38147b}, {5, 0x737ba0d4}, {1, 0x63378e10},\n    {1, 0x6d5f91cf}, {2, 0x88612eb8}, {2, 0xe9639484}, {1, 0xb7fabc9d},\n    {2, 0x19b01592}, {1, 0x5a90dd31}, {2, 0x5bd7e028}, {2, 0x94d00323},\n    {1, 0xa9b9c01a}, {1, 0x3a40de61}, {1, 0x56e7eec7}, {5, 0x859f7ef6},\n    {1, 0xfd8e5630}, {1, 0x2b0c9f7f}, {1, 0xba700e26}, {1, 0x7170a408},\n    {1, 0x70de86a8}, {1, 0x74d64cd5}, {1, 0x49e738a1}, {2, 0x6910b602},\n    {0, 0x643c565f}, {1, 0x54264b3f}, {2, 0x97ea6396}, {2, 0x55174459},\n    {2, 0x03e8779a}, {1, 0x98f34d8f}, {1, 0xc07b2b07}, {1, 0xdfe29668},\n    {1, 0x3141c7c1}, {1, 0xb3b595f4}, {1, 0x735abf08}, {5, 0x623bfbce},\n    {2, 0xd351e722}, {1, 0xf4ca48c9}, {1, 0x5b19c670}, {1, 0xa164bf0e},\n    {2, 0xbbbeb305}, {2, 0xfe1c810a},\n};\n\nCBlockIndex CreateBlockIndex(int nHeight)\n{\n    CBlockIndex index;\n    index.nHeight = nHeight;\n    index.pprev = chainActive.Tip();\n    return index;\n}\n\nbool TestSequenceLocks(const CTransaction &tx, int flags)\n{\n    LOCK(mempool.cs);\n    return CheckSequenceLocks(tx, flags);\n}\n\n// Test suite for ancestor feerate transaction selection.\n// Implemented as an additional function, rather than a separate test case,\n// to allow reusing the blockchain created in CreateNewBlock_validity.\nvoid TestPackageSelection(const CChainParams& chainparams, CScript scriptPubKey, std::vector<CTransactionRef>& txFirst)\n{\n    // Test the ancestor feerate transaction selection.\n    TestMemPoolEntryHelper entry;\n\n    // Test that a medium fee transaction will be selected after a higher fee\n    // rate package with a low fee rate parent.\n    CMutableTransaction tx;\n    tx.vin.resize(1);\n    tx.vin[0].scriptSig = CScript() << OP_1;\n    tx.vin[0].prevout.hash = txFirst[0]->GetHash();\n    tx.vin[0].prevout.n = 0;\n    tx.vout.resize(1);\n    tx.vout[0].nValue = 5000000000LL - 1000;\n    // This tx has a low fee: 1000 satoshis\n    uint256 hashParentTx = tx.GetHash(); // save this txid for later use\n    mempool.addUnchecked(hashParentTx, entry.Fee(1000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));\n\n    // This tx has a medium fee: 10000 satoshis\n    tx.vin[0].prevout.hash = txFirst[1]->GetHash();\n    tx.vout[0].nValue = 5000000000LL - 10000;\n    uint256 hashMediumFeeTx = tx.GetHash();\n    mempool.addUnchecked(hashMediumFeeTx, entry.Fee(10000).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));\n\n    // This tx has a high fee, but depends on the first transaction\n    tx.vin[0].prevout.hash = hashParentTx;\n    tx.vout[0].nValue = 5000000000LL - 1000 - 50000; // 50k satoshi fee\n    uint256 hashHighFeeTx = tx.GetHash();\n    mempool.addUnchecked(hashHighFeeTx, entry.Fee(50000).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));\n\n    std::unique_ptr<CBlockTemplate> pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);\n    BOOST_CHECK(pblocktemplate->block.vtx[1]->GetHash() == hashParentTx);\n    BOOST_CHECK(pblocktemplate->block.vtx[2]->GetHash() == hashHighFeeTx);\n    BOOST_CHECK(pblocktemplate->block.vtx[3]->GetHash() == hashMediumFeeTx);\n\n    // Test that a package below the block min tx fee doesn't get included\n    tx.vin[0].prevout.hash = hashHighFeeTx;\n    tx.vout[0].nValue = 5000000000LL - 1000 - 50000; // 0 fee\n    uint256 hashFreeTx = tx.GetHash();\n    mempool.addUnchecked(hashFreeTx, entry.Fee(0).FromTx(tx));\n    size_t freeTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION);\n\n    // Calculate a fee on child transaction that will put the package just\n    // below the block min tx fee (assuming 1 child tx of the same size).\n    CAmount feeToUse = blockMinFeeRate.GetFee(2*freeTxSize) - 1;\n\n    tx.vin[0].prevout.hash = hashFreeTx;\n    tx.vout[0].nValue = 5000000000LL - 1000 - 50000 - feeToUse;\n    uint256 hashLowFeeTx = tx.GetHash();\n    mempool.addUnchecked(hashLowFeeTx, entry.Fee(feeToUse).FromTx(tx));\n    pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);\n    // Verify that the free tx and the low fee tx didn't get selected\n    for (size_t i=0; i<pblocktemplate->block.vtx.size(); ++i) {\n        BOOST_CHECK(pblocktemplate->block.vtx[i]->GetHash() != hashFreeTx);\n        BOOST_CHECK(pblocktemplate->block.vtx[i]->GetHash() != hashLowFeeTx);\n    }\n\n    // Test that packages above the min relay fee do get included, even if one\n    // of the transactions is below the min relay fee\n    // Remove the low fee transaction and replace with a higher fee transaction\n    mempool.removeRecursive(tx);\n    tx.vout[0].nValue -= 2; // Now we should be just over the min relay fee\n    hashLowFeeTx = tx.GetHash();\n    mempool.addUnchecked(hashLowFeeTx, entry.Fee(feeToUse+2).FromTx(tx));\n    pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);\n    BOOST_CHECK(pblocktemplate->block.vtx[4]->GetHash() == hashFreeTx);\n    BOOST_CHECK(pblocktemplate->block.vtx[5]->GetHash() == hashLowFeeTx);\n\n    // Test that transaction selection properly updates ancestor fee\n    // calculations as ancestor transactions get included in a block.\n    // Add a 0-fee transaction that has 2 outputs.\n    tx.vin[0].prevout.hash = txFirst[2]->GetHash();\n    tx.vout.resize(2);\n    tx.vout[0].nValue = 5000000000LL - 100000000;\n    tx.vout[1].nValue = 100000000; // 1BTC output\n    uint256 hashFreeTx2 = tx.GetHash();\n    mempool.addUnchecked(hashFreeTx2, entry.Fee(0).SpendsCoinbase(true).FromTx(tx));\n\n    // This tx can't be mined by itself\n    tx.vin[0].prevout.hash = hashFreeTx2;\n    tx.vout.resize(1);\n    feeToUse = blockMinFeeRate.GetFee(freeTxSize);\n    tx.vout[0].nValue = 5000000000LL - 100000000 - feeToUse;\n    uint256 hashLowFeeTx2 = tx.GetHash();\n    mempool.addUnchecked(hashLowFeeTx2, entry.Fee(feeToUse).SpendsCoinbase(false).FromTx(tx));\n    pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);\n\n    // Verify that this tx isn't selected.\n    for (size_t i=0; i<pblocktemplate->block.vtx.size(); ++i) {\n        BOOST_CHECK(pblocktemplate->block.vtx[i]->GetHash() != hashFreeTx2);\n        BOOST_CHECK(pblocktemplate->block.vtx[i]->GetHash() != hashLowFeeTx2);\n    }\n\n    // This tx will be mineable, and should cause hashLowFeeTx2 to be selected\n    // as well.\n    tx.vin[0].prevout.n = 1;\n    tx.vout[0].nValue = 100000000 - 10000; // 10k satoshi fee\n    mempool.addUnchecked(tx.GetHash(), entry.Fee(10000).FromTx(tx));\n    pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey);\n    BOOST_CHECK(pblocktemplate->block.vtx[8]->GetHash() == hashLowFeeTx2);\n}\n\n// NOTE: These tests rely on CreateNewBlock doing its own self-validation!\nBOOST_AUTO_TEST_CASE(CreateNewBlock_validity)\n{\n    /* // BEGIN - TESTS_DISABLED\n    // Note that by default, these tests run with size accounting enabled.\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN);\n    const CChainParams& chainparams = *chainParams;\n    CScript scriptPubKey = CScript() << ParseHex(\"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f\") << OP_CHECKSIG;\n    std::unique_ptr<CBlockTemplate> pblocktemplate;\n    CMutableTransaction tx,tx2;\n    CScript script;\n    uint256 hash;\n    TestMemPoolEntryHelper entry;\n    entry.nFee = 11;\n    entry.nHeight = 11;\n\n    fCheckpointsEnabled = false;\n\n    // Simple block creation, nothing special yet:\n    BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));\n\n    // We can't make transactions until we have inputs\n    // Therefore, load 100 blocks :)\n    int baseheight = 0;\n    std::vector<CTransactionRef> txFirst;\n    for (unsigned int i = 0; i < sizeof(blockinfo)/sizeof(*blockinfo); ++i)\n    {\n        CBlock *pblock = &pblocktemplate->block; // pointer for convenience\n        {\n            LOCK(cs_main);\n            pblock->nVersion = 1;\n            pblock->nTime = chainActive.Tip()->GetMedianTimePast()+1;\n            CMutableTransaction txCoinbase(*pblock->vtx[0]);\n            txCoinbase.nVersion = 1;\n            txCoinbase.vin[0].scriptSig = CScript();\n            txCoinbase.vin[0].scriptSig.push_back(blockinfo[i].extranonce);\n            txCoinbase.vin[0].scriptSig.push_back(chainActive.Height());\n            txCoinbase.vout.resize(1); // Ignore the (optional) segwit commitment added by CreateNewBlock (as the hardcoded nonces don't account for this)\n            txCoinbase.vout[0].scriptPubKey = CScript();\n            pblock->vtx[0] = MakeTransactionRef(std::move(txCoinbase));\n            if (txFirst.size() == 0)\n                baseheight = chainActive.Height();\n            if (txFirst.size() < 4)\n                txFirst.push_back(pblock->vtx[0]);\n            pblock->hashMerkleRoot = BlockMerkleRoot(*pblock);\n            pblock->nNonce = blockinfo[i].nonce;\n        }\n        std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(*pblock);\n        BOOST_CHECK(ProcessNewBlock(chainparams, shared_pblock, true, nullptr));\n        pblock->hashPrevBlock = pblock->GetHash();\n    }\n\n    LOCK(cs_main);\n\n    // Just to make sure we can still make simple blocks\n    BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));\n\n    const CAmount BLOCKSUBSIDY = 50*COIN;\n    const CAmount LOWFEE = CENT;\n    const CAmount HIGHFEE = COIN;\n    const CAmount HIGHERFEE = 4*COIN;\n\n    // block sigops > limit: 1000 CHECKMULTISIG + 1\n    tx.vin.resize(1);\n    // NOTE: OP_NOP is used to force 20 SigOps for the CHECKMULTISIG\n    tx.vin[0].scriptSig = CScript() << OP_0 << OP_0 << OP_0 << OP_NOP << OP_CHECKMULTISIG << OP_1;\n    tx.vin[0].prevout.hash = txFirst[0]->GetHash();\n    tx.vin[0].prevout.n = 0;\n    tx.vout.resize(1);\n    tx.vout[0].nValue = BLOCKSUBSIDY;\n    for (unsigned int i = 0; i < 1001; ++i)\n    {\n        tx.vout[0].nValue -= LOWFEE;\n        hash = tx.GetHash();\n        bool spendsCoinbase = i == 0; // only first tx spends coinbase\n        // If we don't set the # of sig ops in the CTxMemPoolEntry, template creation fails\n        mempool.addUnchecked(hash, entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).FromTx(tx));\n        tx.vin[0].prevout.hash = hash;\n    }\n\n    BOOST_CHECK_EXCEPTION(AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason(\"bad-blk-sigops\"));\n    mempool.clear();\n\n    tx.vin[0].prevout.hash = txFirst[0]->GetHash();\n    tx.vout[0].nValue = BLOCKSUBSIDY;\n    for (unsigned int i = 0; i < 1001; ++i)\n    {\n        tx.vout[0].nValue -= LOWFEE;\n        hash = tx.GetHash();\n        bool spendsCoinbase = i == 0; // only first tx spends coinbase\n        // If we do set the # of sig ops in the CTxMemPoolEntry, template creation passes\n        mempool.addUnchecked(hash, entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).SigOpsCost(80).FromTx(tx));\n        tx.vin[0].prevout.hash = hash;\n    }\n    BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));\n    mempool.clear();\n\n    // block size > limit\n    tx.vin[0].scriptSig = CScript();\n    // 18 * (520char + DROP) + OP_1 = 9433 bytes\n    std::vector<unsigned char> vchData(520);\n    for (unsigned int i = 0; i < 18; ++i)\n        tx.vin[0].scriptSig << vchData << OP_DROP;\n    tx.vin[0].scriptSig << OP_1;\n    tx.vin[0].prevout.hash = txFirst[0]->GetHash();\n    tx.vout[0].nValue = BLOCKSUBSIDY;\n    for (unsigned int i = 0; i < 128; ++i)\n    {\n        tx.vout[0].nValue -= LOWFEE;\n        hash = tx.GetHash();\n        bool spendsCoinbase = i == 0; // only first tx spends coinbase\n        mempool.addUnchecked(hash, entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(spendsCoinbase).FromTx(tx));\n        tx.vin[0].prevout.hash = hash;\n    }\n    BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));\n    mempool.clear();\n\n    // orphan in mempool, template creation fails\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Fee(LOWFEE).Time(GetTime()).FromTx(tx));\n    BOOST_CHECK_EXCEPTION(AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason(\"bad-txns-inputs-missingorspent\"));\n    mempool.clear();\n\n    // child with higher feerate than parent\n    tx.vin[0].scriptSig = CScript() << OP_1;\n    tx.vin[0].prevout.hash = txFirst[1]->GetHash();\n    tx.vout[0].nValue = BLOCKSUBSIDY-HIGHFEE;\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));\n    tx.vin[0].prevout.hash = hash;\n    tx.vin.resize(2);\n    tx.vin[1].scriptSig = CScript() << OP_1;\n    tx.vin[1].prevout.hash = txFirst[0]->GetHash();\n    tx.vin[1].prevout.n = 0;\n    tx.vout[0].nValue = tx.vout[0].nValue+BLOCKSUBSIDY-HIGHERFEE; //First txn output + fresh coinbase - new txn fee\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Fee(HIGHERFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));\n    BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));\n    mempool.clear();\n\n    // coinbase in mempool, template creation fails\n    tx.vin.resize(1);\n    tx.vin[0].prevout.SetNull();\n    tx.vin[0].scriptSig = CScript() << OP_0 << OP_1;\n    tx.vout[0].nValue = 0;\n    hash = tx.GetHash();\n    // give it a fee so it'll get mined\n    mempool.addUnchecked(hash, entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));\n    // Should throw bad-cb-multiple\n    BOOST_CHECK_EXCEPTION(AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason(\"bad-cb-multiple\"));\n    mempool.clear();\n\n    // double spend txn pair in mempool, template creation fails\n    tx.vin[0].prevout.hash = txFirst[0]->GetHash();\n    tx.vin[0].scriptSig = CScript() << OP_1;\n    tx.vout[0].nValue = BLOCKSUBSIDY-HIGHFEE;\n    tx.vout[0].scriptPubKey = CScript() << OP_1;\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));\n    tx.vout[0].scriptPubKey = CScript() << OP_2;\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));\n    BOOST_CHECK_EXCEPTION(AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason(\"bad-txns-inputs-missingorspent\"));\n    mempool.clear();\n\n    // subsidy changing\n    int nHeight = chainActive.Height();\n    // Create an actual 209999-long block chain (without valid blocks).\n    while (chainActive.Tip()->nHeight < 209999) {\n        CBlockIndex* prev = chainActive.Tip();\n        CBlockIndex* next = new CBlockIndex();\n        next->phashBlock = new uint256(InsecureRand256());\n        pcoinsTip->SetBestBlock(next->GetBlockHash());\n        next->pprev = prev;\n        next->nHeight = prev->nHeight + 1;\n        next->BuildSkip();\n        chainActive.SetTip(next);\n    }\n    BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));\n    // Extend to a 210000-long block chain.\n    while (chainActive.Tip()->nHeight < 210000) {\n        CBlockIndex* prev = chainActive.Tip();\n        CBlockIndex* next = new CBlockIndex();\n        next->phashBlock = new uint256(InsecureRand256());\n        pcoinsTip->SetBestBlock(next->GetBlockHash());\n        next->pprev = prev;\n        next->nHeight = prev->nHeight + 1;\n        next->BuildSkip();\n        chainActive.SetTip(next);\n    }\n    BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));\n\n    // invalid p2sh txn in mempool, template creation fails\n    tx.vin[0].prevout.hash = txFirst[0]->GetHash();\n    tx.vin[0].prevout.n = 0;\n    tx.vin[0].scriptSig = CScript() << OP_1;\n    tx.vout[0].nValue = BLOCKSUBSIDY-LOWFEE;\n    script = CScript() << OP_0;\n    tx.vout[0].scriptPubKey = GetScriptForDestination(CScriptID(script));\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));\n    tx.vin[0].prevout.hash = hash;\n    tx.vin[0].scriptSig = CScript() << std::vector<unsigned char>(script.begin(), script.end());\n    tx.vout[0].nValue -= LOWFEE;\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Fee(LOWFEE).Time(GetTime()).SpendsCoinbase(false).FromTx(tx));\n    // Should throw block-validation-failed\n    BOOST_CHECK_EXCEPTION(AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey), std::runtime_error, HasReason(\"block-validation-failed\"));\n    mempool.clear();\n\n    // Delete the dummy blocks again.\n    while (chainActive.Tip()->nHeight > nHeight) {\n        CBlockIndex* del = chainActive.Tip();\n        chainActive.SetTip(del->pprev);\n        pcoinsTip->SetBestBlock(del->pprev->GetBlockHash());\n        delete del->phashBlock;\n        delete del;\n    }\n\n    // non-final txs in mempool\n    SetMockTime(chainActive.Tip()->GetMedianTimePast()+1);\n    int flags = LOCKTIME_VERIFY_SEQUENCE|LOCKTIME_MEDIAN_TIME_PAST;\n    // height map\n    std::vector<int> prevheights;\n\n    // relative height locked\n    tx.nVersion = 2;\n    tx.vin.resize(1);\n    prevheights.resize(1);\n    tx.vin[0].prevout.hash = txFirst[0]->GetHash(); // only 1 transaction\n    tx.vin[0].prevout.n = 0;\n    tx.vin[0].scriptSig = CScript() << OP_1;\n    tx.vin[0].nSequence = chainActive.Tip()->nHeight + 1; // txFirst[0] is the 2nd block\n    prevheights[0] = baseheight + 1;\n    tx.vout.resize(1);\n    tx.vout[0].nValue = BLOCKSUBSIDY-HIGHFEE;\n    tx.vout[0].scriptPubKey = CScript() << OP_1;\n    tx.nLockTime = 0;\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Fee(HIGHFEE).Time(GetTime()).SpendsCoinbase(true).FromTx(tx));\n    BOOST_CHECK(CheckFinalTx(tx, flags)); // Locktime passes\n    BOOST_CHECK(!TestSequenceLocks(tx, flags)); // Sequence locks fail\n    BOOST_CHECK(SequenceLocks(tx, flags, &prevheights, CreateBlockIndex(chainActive.Tip()->nHeight + 2))); // Sequence locks pass on 2nd block\n\n    // relative time locked\n    tx.vin[0].prevout.hash = txFirst[1]->GetHash();\n    tx.vin[0].nSequence = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG | (((chainActive.Tip()->GetMedianTimePast()+1-chainActive[1]->GetMedianTimePast()) >> CTxIn::SEQUENCE_LOCKTIME_GRANULARITY) + 1); // txFirst[1] is the 3rd block\n    prevheights[0] = baseheight + 2;\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Time(GetTime()).FromTx(tx));\n    BOOST_CHECK(CheckFinalTx(tx, flags)); // Locktime passes\n    BOOST_CHECK(!TestSequenceLocks(tx, flags)); // Sequence locks fail\n\n    for (int i = 0; i < CBlockIndex::nMedianTimeSpan; i++)\n        chainActive.Tip()->GetAncestor(chainActive.Tip()->nHeight - i)->nTime += 512; //Trick the MedianTimePast\n    BOOST_CHECK(SequenceLocks(tx, flags, &prevheights, CreateBlockIndex(chainActive.Tip()->nHeight + 1))); // Sequence locks pass 512 seconds later\n    for (int i = 0; i < CBlockIndex::nMedianTimeSpan; i++)\n        chainActive.Tip()->GetAncestor(chainActive.Tip()->nHeight - i)->nTime -= 512; //undo tricked MTP\n\n    // absolute height locked\n    tx.vin[0].prevout.hash = txFirst[2]->GetHash();\n    tx.vin[0].nSequence = CTxIn::SEQUENCE_FINAL - 1;\n    prevheights[0] = baseheight + 3;\n    tx.nLockTime = chainActive.Tip()->nHeight + 1;\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Time(GetTime()).FromTx(tx));\n    BOOST_CHECK(!CheckFinalTx(tx, flags)); // Locktime fails\n    BOOST_CHECK(TestSequenceLocks(tx, flags)); // Sequence locks pass\n    BOOST_CHECK(IsFinalTx(tx, chainActive.Tip()->nHeight + 2, chainActive.Tip()->GetMedianTimePast())); // Locktime passes on 2nd block\n\n    // absolute time locked\n    tx.vin[0].prevout.hash = txFirst[3]->GetHash();\n    tx.nLockTime = chainActive.Tip()->GetMedianTimePast();\n    prevheights.resize(1);\n    prevheights[0] = baseheight + 4;\n    hash = tx.GetHash();\n    mempool.addUnchecked(hash, entry.Time(GetTime()).FromTx(tx));\n    BOOST_CHECK(!CheckFinalTx(tx, flags)); // Locktime fails\n    BOOST_CHECK(TestSequenceLocks(tx, flags)); // Sequence locks pass\n    BOOST_CHECK(IsFinalTx(tx, chainActive.Tip()->nHeight + 2, chainActive.Tip()->GetMedianTimePast() + 1)); // Locktime passes 1 second later\n\n    // mempool-dependent transactions (not added)\n    tx.vin[0].prevout.hash = hash;\n    prevheights[0] = chainActive.Tip()->nHeight + 1;\n    tx.nLockTime = 0;\n    tx.vin[0].nSequence = 0;\n    BOOST_CHECK(CheckFinalTx(tx, flags)); // Locktime passes\n    BOOST_CHECK(TestSequenceLocks(tx, flags)); // Sequence locks pass\n    tx.vin[0].nSequence = 1;\n    BOOST_CHECK(!TestSequenceLocks(tx, flags)); // Sequence locks fail\n    tx.vin[0].nSequence = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG;\n    BOOST_CHECK(TestSequenceLocks(tx, flags)); // Sequence locks pass\n    tx.vin[0].nSequence = CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG | 1;\n    BOOST_CHECK(!TestSequenceLocks(tx, flags)); // Sequence locks fail\n\n    BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));\n\n    // None of the of the absolute height/time locked tx should have made\n    // it into the template because we still check IsFinalTx in CreateNewBlock,\n    // but relative locked txs will if inconsistently added to mempool.\n    // For now these will still generate a valid template until BIP68 soft fork\n    BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 3);\n    // However if we advance height by 1 and time by 512, all of them should be mined\n    for (int i = 0; i < CBlockIndex::nMedianTimeSpan; i++)\n        chainActive.Tip()->GetAncestor(chainActive.Tip()->nHeight - i)->nTime += 512; //Trick the MedianTimePast\n    chainActive.Tip()->nHeight++;\n    SetMockTime(chainActive.Tip()->GetMedianTimePast() + 1);\n\n    BOOST_CHECK(pblocktemplate = AssemblerForTest(chainparams).CreateNewBlock(scriptPubKey));\n    BOOST_CHECK_EQUAL(pblocktemplate->block.vtx.size(), 5);\n\n    chainActive.Tip()->nHeight--;\n    SetMockTime(0);\n    mempool.clear();\n\n    TestPackageSelection(chainparams, scriptPubKey, txFirst);\n\n    fCheckpointsEnabled = true;\n    */ // END - TESTS_DISABLED\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/multisig_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <key.h>\n#include <keystore.h>\n#include <policy/policy.h>\n#include <script/script.h>\n#include <script/script_error.h>\n#include <script/interpreter.h>\n#include <script/sign.h>\n#include <script/ismine.h>\n#include <uint256.h>\n#include <test/test_bitcoin.h>\n\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(multisig_tests, BasicTestingSetup)\n\nCScript\nsign_multisig(CScript scriptPubKey, std::vector<CKey> keys, CTransaction transaction, int whichIn)\n{\n    uint256 hash = SignatureHash(scriptPubKey, transaction, whichIn, SIGHASH_ALL, 0, SIGVERSION_BASE);\n\n    CScript result;\n    result << OP_0; // CHECKMULTISIG bug workaround\n    for (const CKey &key : keys)\n    {\n        std::vector<unsigned char> vchSig;\n        BOOST_CHECK(key.Sign(hash, vchSig));\n        vchSig.push_back((unsigned char)SIGHASH_ALL);\n        result << vchSig;\n    }\n    return result;\n}\n\nBOOST_AUTO_TEST_CASE(multisig_verify)\n{\n    unsigned int flags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC;\n\n    ScriptError err;\n    CKey key[4];\n    CAmount amount = 0;\n    for (int i = 0; i < 4; i++)\n        key[i].MakeNewKey(true);\n\n    CScript a_and_b;\n    a_and_b << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG;\n\n    CScript a_or_b;\n    a_or_b << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG;\n\n    CScript escrow;\n    escrow << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey()) << OP_3 << OP_CHECKMULTISIG;\n\n    CMutableTransaction txFrom;  // Funding transaction\n    txFrom.vout.resize(3);\n    txFrom.vout[0].scriptPubKey = a_and_b;\n    txFrom.vout[1].scriptPubKey = a_or_b;\n    txFrom.vout[2].scriptPubKey = escrow;\n\n    CMutableTransaction txTo[3]; // Spending transaction\n    for (int i = 0; i < 3; i++)\n    {\n        txTo[i].vin.resize(1);\n        txTo[i].vout.resize(1);\n        txTo[i].vin[0].prevout.n = i;\n        txTo[i].vin[0].prevout.hash = txFrom.GetHash();\n        txTo[i].vout[0].nValue = 1;\n    }\n\n    std::vector<CKey> keys;\n    CScript s;\n\n    // Test a AND b:\n    keys.assign(1,key[0]);\n    keys.push_back(key[1]);\n    s = sign_multisig(a_and_b, keys, txTo[0], 0);\n    BOOST_CHECK(VerifyScript(s, a_and_b, nullptr, flags, MutableTransactionSignatureChecker(&txTo[0], 0, amount), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n\n    for (int i = 0; i < 4; i++)\n    {\n        keys.assign(1,key[i]);\n        s = sign_multisig(a_and_b, keys, txTo[0], 0);\n        BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, nullptr, flags, MutableTransactionSignatureChecker(&txTo[0], 0, amount), &err), strprintf(\"a&b 1: %d\", i));\n        BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_INVALID_STACK_OPERATION, ScriptErrorString(err));\n\n        keys.assign(1,key[1]);\n        keys.push_back(key[i]);\n        s = sign_multisig(a_and_b, keys, txTo[0], 0);\n        BOOST_CHECK_MESSAGE(!VerifyScript(s, a_and_b, nullptr, flags, MutableTransactionSignatureChecker(&txTo[0], 0, amount), &err), strprintf(\"a&b 2: %d\", i));\n        BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));\n    }\n\n    // Test a OR b:\n    for (int i = 0; i < 4; i++)\n    {\n        keys.assign(1,key[i]);\n        s = sign_multisig(a_or_b, keys, txTo[1], 0);\n        if (i == 0 || i == 1)\n        {\n            BOOST_CHECK_MESSAGE(VerifyScript(s, a_or_b, nullptr, flags, MutableTransactionSignatureChecker(&txTo[1], 0, amount), &err), strprintf(\"a|b: %d\", i));\n            BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n        }\n        else\n        {\n            BOOST_CHECK_MESSAGE(!VerifyScript(s, a_or_b, nullptr, flags, MutableTransactionSignatureChecker(&txTo[1], 0, amount), &err), strprintf(\"a|b: %d\", i));\n            BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));\n        }\n    }\n    s.clear();\n    s << OP_0 << OP_1;\n    BOOST_CHECK(!VerifyScript(s, a_or_b, nullptr, flags, MutableTransactionSignatureChecker(&txTo[1], 0, amount), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_SIG_DER, ScriptErrorString(err));\n\n\n    for (int i = 0; i < 4; i++)\n        for (int j = 0; j < 4; j++)\n        {\n            keys.assign(1,key[i]);\n            keys.push_back(key[j]);\n            s = sign_multisig(escrow, keys, txTo[2], 0);\n            if (i < j && i < 3 && j < 3)\n            {\n                BOOST_CHECK_MESSAGE(VerifyScript(s, escrow, nullptr, flags, MutableTransactionSignatureChecker(&txTo[2], 0, amount), &err), strprintf(\"escrow 1: %d %d\", i, j));\n                BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n            }\n            else\n            {\n                BOOST_CHECK_MESSAGE(!VerifyScript(s, escrow, nullptr, flags, MutableTransactionSignatureChecker(&txTo[2], 0, amount), &err), strprintf(\"escrow 2: %d %d\", i, j));\n                BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));\n            }\n        }\n}\n\nBOOST_AUTO_TEST_CASE(multisig_IsStandard)\n{\n    CKey key[4];\n    for (int i = 0; i < 4; i++)\n        key[i].MakeNewKey(true);\n\n    txnouttype whichType;\n\n    CScript a_and_b;\n    a_and_b << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG;\n    BOOST_CHECK(::IsStandard(a_and_b, whichType));\n\n    CScript a_or_b;\n    a_or_b  << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG;\n    BOOST_CHECK(::IsStandard(a_or_b, whichType));\n\n    CScript escrow;\n    escrow << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey()) << OP_3 << OP_CHECKMULTISIG;\n    BOOST_CHECK(::IsStandard(escrow, whichType));\n\n    CScript one_of_four;\n    one_of_four << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey()) << ToByteVector(key[3].GetPubKey()) << OP_4 << OP_CHECKMULTISIG;\n    BOOST_CHECK(!::IsStandard(one_of_four, whichType));\n\n    CScript malformed[6];\n    malformed[0] << OP_3 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG;\n    malformed[1] << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_3 << OP_CHECKMULTISIG;\n    malformed[2] << OP_0 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG;\n    malformed[3] << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_0 << OP_CHECKMULTISIG;\n    malformed[4] << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_CHECKMULTISIG;\n    malformed[5] << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey());\n\n    for (int i = 0; i < 6; i++)\n        BOOST_CHECK(!::IsStandard(malformed[i], whichType));\n}\n\nBOOST_AUTO_TEST_CASE(multisig_Sign)\n{\n    // Test SignSignature() (and therefore the version of Solver() that signs transactions)\n    CBasicKeyStore keystore;\n    CKey key[4];\n    for (int i = 0; i < 4; i++)\n    {\n        key[i].MakeNewKey(true);\n        keystore.AddKey(key[i]);\n    }\n\n    CScript a_and_b;\n    a_and_b << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG;\n\n    CScript a_or_b;\n    a_or_b  << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << OP_2 << OP_CHECKMULTISIG;\n\n    CScript escrow;\n    escrow << OP_2 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey()) << OP_3 << OP_CHECKMULTISIG;\n\n    CMutableTransaction txFrom;  // Funding transaction\n    txFrom.vout.resize(3);\n    txFrom.vout[0].scriptPubKey = a_and_b;\n    txFrom.vout[1].scriptPubKey = a_or_b;\n    txFrom.vout[2].scriptPubKey = escrow;\n\n    CMutableTransaction txTo[3]; // Spending transaction\n    for (int i = 0; i < 3; i++)\n    {\n        txTo[i].vin.resize(1);\n        txTo[i].vout.resize(1);\n        txTo[i].vin[0].prevout.n = i;\n        txTo[i].vin[0].prevout.hash = txFrom.GetHash();\n        txTo[i].vout[0].nValue = 1;\n    }\n\n    for (int i = 0; i < 3; i++)\n    {\n        BOOST_CHECK_MESSAGE(SignSignature(keystore, txFrom, txTo[i], 0, SIGHASH_ALL), strprintf(\"SignSignature %d\", i));\n    }\n}\n\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/net_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#include <addrman.h>\n#include <test/test_bitcoin.h>\n#include <string>\n#include <boost/test/unit_test.hpp>\n#include <hash.h>\n#include <serialize.h>\n#include <streams.h>\n#include <net.h>\n#include <netbase.h>\n#include <chainparams.h>\n#include <util.h>\n\n#include <memory>\n\nclass CAddrManSerializationMock : public CAddrMan\n{\npublic:\n    virtual void Serialize(CDataStream& s) const = 0;\n\n    //! Ensure that bucket placement is always the same for testing purposes.\n    void MakeDeterministic()\n    {\n        nKey.SetNull();\n        insecure_rand = FastRandomContext(true);\n    }\n};\n\nclass CAddrManUncorrupted : public CAddrManSerializationMock\n{\npublic:\n    void Serialize(CDataStream& s) const override\n    {\n        CAddrMan::Serialize(s);\n    }\n};\n\nclass CAddrManCorrupted : public CAddrManSerializationMock\n{\npublic:\n    void Serialize(CDataStream& s) const override\n    {\n        // Produces corrupt output that claims addrman has 20 addrs when it only has one addr.\n        unsigned char nVersion = 1;\n        s << nVersion;\n        s << ((unsigned char)32);\n        s << nKey;\n        s << 10; // nNew\n        s << 10; // nTried\n\n        int nUBuckets = ADDRMAN_NEW_BUCKET_COUNT ^ (1 << 30);\n        s << nUBuckets;\n\n        CService serv;\n        Lookup(\"252.1.1.1\", serv, 7777, false);\n        CAddress addr = CAddress(serv, NODE_NONE);\n        CNetAddr resolved;\n        LookupHost(\"252.2.2.2\", resolved, false);\n        CAddrInfo info = CAddrInfo(addr, resolved);\n        s << info;\n    }\n};\n\nCDataStream AddrmanToStream(CAddrManSerializationMock& _addrman)\n{\n    CDataStream ssPeersIn(SER_DISK, CLIENT_VERSION);\n    ssPeersIn << FLATDATA(Params().MessageStart());\n    ssPeersIn << _addrman;\n    std::string str = ssPeersIn.str();\n    std::vector<unsigned char> vchData(str.begin(), str.end());\n    return CDataStream(vchData, SER_DISK, CLIENT_VERSION);\n}\n\nBOOST_FIXTURE_TEST_SUITE(net_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(cnode_listen_port)\n{\n    // test default\n    unsigned short port = GetListenPort();\n    BOOST_CHECK(port == Params().GetDefaultPort());\n    // test set port\n    unsigned short altPort = 12345;\n    gArgs.SoftSetArg(\"-port\", std::to_string(altPort));\n    port = GetListenPort();\n    BOOST_CHECK(port == altPort);\n}\n\nBOOST_AUTO_TEST_CASE(caddrdb_read)\n{\n    CAddrManUncorrupted addrmanUncorrupted;\n    addrmanUncorrupted.MakeDeterministic();\n\n    CService addr1, addr2, addr3;\n    Lookup(\"250.7.1.1\", addr1, 34230, false);\n    Lookup(\"250.7.2.2\", addr2, 9999, false);\n    Lookup(\"250.7.3.3\", addr3, 9999, false);\n\n    // Add three addresses to new table.\n    CService source;\n    Lookup(\"252.5.1.1\", source, 34230, false);\n    addrmanUncorrupted.Add(CAddress(addr1, NODE_NONE), source);\n    addrmanUncorrupted.Add(CAddress(addr2, NODE_NONE), source);\n    addrmanUncorrupted.Add(CAddress(addr3, NODE_NONE), source);\n\n    // Test that the de-serialization does not throw an exception.\n    CDataStream ssPeers1 = AddrmanToStream(addrmanUncorrupted);\n    bool exceptionThrown = false;\n    CAddrMan addrman1;\n\n    BOOST_CHECK(addrman1.size() == 0);\n    try {\n        unsigned char pchMsgTmp[4];\n        ssPeers1 >> FLATDATA(pchMsgTmp);\n        ssPeers1 >> addrman1;\n    } catch (const std::exception& e) {\n        exceptionThrown = true;\n    }\n\n    BOOST_CHECK(addrman1.size() == 3);\n    BOOST_CHECK(exceptionThrown == false);\n\n    // Test that CAddrDB::Read creates an addrman with the correct number of addrs.\n    CDataStream ssPeers2 = AddrmanToStream(addrmanUncorrupted);\n\n    CAddrMan addrman2;\n    CAddrDB adb;\n    BOOST_CHECK(addrman2.size() == 0);\n    adb.Read(addrman2, ssPeers2);\n    BOOST_CHECK(addrman2.size() == 3);\n}\n\n\nBOOST_AUTO_TEST_CASE(caddrdb_read_corrupted)\n{\n    CAddrManCorrupted addrmanCorrupted;\n    addrmanCorrupted.MakeDeterministic();\n\n    // Test that the de-serialization of corrupted addrman throws an exception.\n    CDataStream ssPeers1 = AddrmanToStream(addrmanCorrupted);\n    bool exceptionThrown = false;\n    CAddrMan addrman1;\n    BOOST_CHECK(addrman1.size() == 0);\n    try {\n        unsigned char pchMsgTmp[4];\n        ssPeers1 >> FLATDATA(pchMsgTmp);\n        ssPeers1 >> addrman1;\n    } catch (const std::exception& e) {\n        exceptionThrown = true;\n    }\n    // Even through de-serialization failed addrman is not left in a clean state.\n    BOOST_CHECK(addrman1.size() == 1);\n    BOOST_CHECK(exceptionThrown);\n\n    // Test that CAddrDB::Read leaves addrman in a clean state if de-serialization fails.\n    CDataStream ssPeers2 = AddrmanToStream(addrmanCorrupted);\n\n    CAddrMan addrman2;\n    CAddrDB adb;\n    BOOST_CHECK(addrman2.size() == 0);\n    adb.Read(addrman2, ssPeers2);\n    BOOST_CHECK(addrman2.size() == 0);\n}\n\nBOOST_AUTO_TEST_CASE(cnode_simple_test)\n{\n    SOCKET hSocket = INVALID_SOCKET;\n    NodeId id = 0;\n    int height = 0;\n\n    in_addr ipv4Addr;\n    ipv4Addr.s_addr = 0xa0b0c001;\n    \n    CAddress addr = CAddress(CService(ipv4Addr, 7777), NODE_NETWORK);\n    std::string pszDest = \"\";\n    bool fInboundIn = false;\n\n    // Test that fFeeler is false by default.\n    std::unique_ptr<CNode> pnode1(new CNode(id++, NODE_NETWORK, height, hSocket, addr, 0, 0, CAddress(), pszDest, fInboundIn));\n    BOOST_CHECK(pnode1->fInbound == false);\n    BOOST_CHECK(pnode1->fFeeler == false);\n\n    fInboundIn = true;\n    std::unique_ptr<CNode> pnode2(new CNode(id++, NODE_NETWORK, height, hSocket, addr, 1, 1, CAddress(), pszDest, fInboundIn));\n    BOOST_CHECK(pnode2->fInbound == true);\n    BOOST_CHECK(pnode2->fFeeler == false);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/netbase_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <netbase.h>\n#include <test/test_bitcoin.h>\n#include <utilstrencodings.h>\n\n#include <string>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(netbase_tests, BasicTestingSetup)\n\nstatic CNetAddr ResolveIP(const char* ip)\n{\n    CNetAddr addr;\n    LookupHost(ip, addr, false);\n    return addr;\n}\n\nstatic CSubNet ResolveSubNet(const char* subnet)\n{\n    CSubNet ret;\n    LookupSubNet(subnet, ret);\n    return ret;\n}\n\nstatic CNetAddr CreateInternal(const char* host)\n{\n    CNetAddr addr;\n    addr.SetInternal(host);\n    return addr;\n}\n\nBOOST_AUTO_TEST_CASE(netbase_networks)\n{\n    BOOST_CHECK(ResolveIP(\"127.0.0.1\").GetNetwork()                              == NET_UNROUTABLE);\n    BOOST_CHECK(ResolveIP(\"::1\").GetNetwork()                                    == NET_UNROUTABLE);\n    BOOST_CHECK(ResolveIP(\"8.8.8.8\").GetNetwork()                                == NET_IPV4);\n    BOOST_CHECK(ResolveIP(\"2001::8888\").GetNetwork()                             == NET_IPV6);\n    BOOST_CHECK(ResolveIP(\"FD87:D87E:EB43:edb1:8e4:3588:e546:35ca\").GetNetwork() == NET_TOR);\n    BOOST_CHECK(CreateInternal(\"foo.com\").GetNetwork()                           == NET_INTERNAL);\n\n}\n\nBOOST_AUTO_TEST_CASE(netbase_properties)\n{\n\n    BOOST_CHECK(ResolveIP(\"127.0.0.1\").IsIPv4());\n    BOOST_CHECK(ResolveIP(\"::FFFF:192.168.1.1\").IsIPv4());\n    BOOST_CHECK(ResolveIP(\"::1\").IsIPv6());\n    BOOST_CHECK(ResolveIP(\"10.0.0.1\").IsRFC1918());\n    BOOST_CHECK(ResolveIP(\"192.168.1.1\").IsRFC1918());\n    BOOST_CHECK(ResolveIP(\"172.31.255.255\").IsRFC1918());\n    BOOST_CHECK(ResolveIP(\"2001:0DB8::\").IsRFC3849());\n    BOOST_CHECK(ResolveIP(\"169.254.1.1\").IsRFC3927());\n    BOOST_CHECK(ResolveIP(\"2002::1\").IsRFC3964());\n    BOOST_CHECK(ResolveIP(\"FC00::\").IsRFC4193());\n    BOOST_CHECK(ResolveIP(\"2001::2\").IsRFC4380());\n    BOOST_CHECK(ResolveIP(\"2001:10::\").IsRFC4843());\n    BOOST_CHECK(ResolveIP(\"FE80::\").IsRFC4862());\n    BOOST_CHECK(ResolveIP(\"64:FF9B::\").IsRFC6052());\n    BOOST_CHECK(ResolveIP(\"FD87:D87E:EB43:edb1:8e4:3588:e546:35ca\").IsTor());\n    BOOST_CHECK(ResolveIP(\"127.0.0.1\").IsLocal());\n    BOOST_CHECK(ResolveIP(\"::1\").IsLocal());\n    BOOST_CHECK(ResolveIP(\"8.8.8.8\").IsRoutable());\n    BOOST_CHECK(ResolveIP(\"2001::1\").IsRoutable());\n    BOOST_CHECK(ResolveIP(\"127.0.0.1\").IsValid());\n    BOOST_CHECK(CreateInternal(\"FD6B:88C0:8724:edb1:8e4:3588:e546:35ca\").IsInternal());\n    BOOST_CHECK(CreateInternal(\"bar.com\").IsInternal());\n\n}\n\nbool static TestSplitHost(std::string test, std::string host, int port)\n{\n    std::string hostOut;\n    int portOut = -1;\n    SplitHostPort(test, portOut, hostOut);\n    return hostOut == host && port == portOut;\n}\n\nBOOST_AUTO_TEST_CASE(netbase_splithost)\n{\n    BOOST_CHECK(TestSplitHost(\"www.bitcoin.org\", \"www.bitcoin.org\", -1));\n    BOOST_CHECK(TestSplitHost(\"[www.bitcoin.org]\", \"www.bitcoin.org\", -1));\n    BOOST_CHECK(TestSplitHost(\"www.bitcoin.org:80\", \"www.bitcoin.org\", 80));\n    BOOST_CHECK(TestSplitHost(\"[www.bitcoin.org]:80\", \"www.bitcoin.org\", 80));\n    BOOST_CHECK(TestSplitHost(\"127.0.0.1\", \"127.0.0.1\", -1));\n    BOOST_CHECK(TestSplitHost(\"127.0.0.1:34230\", \"127.0.0.1\", 34230));\n    BOOST_CHECK(TestSplitHost(\"[127.0.0.1]\", \"127.0.0.1\", -1));\n    BOOST_CHECK(TestSplitHost(\"[127.0.0.1]:34230\", \"127.0.0.1\", 34230));\n    BOOST_CHECK(TestSplitHost(\"::ffff:127.0.0.1\", \"::ffff:127.0.0.1\", -1));\n    BOOST_CHECK(TestSplitHost(\"[::ffff:127.0.0.1]:34230\", \"::ffff:127.0.0.1\", 34230));\n    BOOST_CHECK(TestSplitHost(\"[::]:34230\", \"::\", 34230));\n    BOOST_CHECK(TestSplitHost(\"::34230\", \"::34230\", -1));\n    BOOST_CHECK(TestSplitHost(\":34230\", \"\", 34230));\n    BOOST_CHECK(TestSplitHost(\"[]:34230\", \"\", 34230));\n    BOOST_CHECK(TestSplitHost(\"\", \"\", -1));\n}\n\nbool static TestParse(std::string src, std::string canon)\n{\n    CService addr(LookupNumeric(src.c_str(), 65535));\n    return canon == addr.ToString();\n}\n\nBOOST_AUTO_TEST_CASE(netbase_lookupnumeric)\n{\n    BOOST_CHECK(TestParse(\"127.0.0.1\", \"127.0.0.1:65535\"));\n    BOOST_CHECK(TestParse(\"127.0.0.1:34230\", \"127.0.0.1:34230\"));\n    BOOST_CHECK(TestParse(\"::ffff:127.0.0.1\", \"127.0.0.1:65535\"));\n    BOOST_CHECK(TestParse(\"::\", \"[::]:65535\"));\n    BOOST_CHECK(TestParse(\"[::]:34230\", \"[::]:34230\"));\n    BOOST_CHECK(TestParse(\"[127.0.0.1]\", \"127.0.0.1:65535\"));\n    BOOST_CHECK(TestParse(\":::\", \"[::]:0\"));\n\n    // verify that an internal address fails to resolve\n    BOOST_CHECK(TestParse(\"[fd6b:88c0:8724:1:2:3:4:5]\", \"[::]:0\"));\n    // and that a one-off resolves correctly\n    BOOST_CHECK(TestParse(\"[fd6c:88c0:8724:1:2:3:4:5]\", \"[fd6c:88c0:8724:1:2:3:4:5]:65535\"));\n}\n\nBOOST_AUTO_TEST_CASE(onioncat_test)\n{\n\n    // values from https://web.archive.org/web/20121122003543/http://www.cypherpunk.at/onioncat/wiki/OnionCat\n    CNetAddr addr1(ResolveIP(\"5wyqrzbvrdsumnok.onion\"));\n    CNetAddr addr2(ResolveIP(\"FD87:D87E:EB43:edb1:8e4:3588:e546:35ca\"));\n    BOOST_CHECK(addr1 == addr2);\n    BOOST_CHECK(addr1.IsTor());\n    BOOST_CHECK(addr1.ToStringIP() == \"5wyqrzbvrdsumnok.onion\");\n    BOOST_CHECK(addr1.IsRoutable());\n\n}\n\nBOOST_AUTO_TEST_CASE(subnet_test)\n{\n\n    BOOST_CHECK(ResolveSubNet(\"1.2.3.0/24\") == ResolveSubNet(\"1.2.3.0/255.255.255.0\"));\n    BOOST_CHECK(ResolveSubNet(\"1.2.3.0/24\") != ResolveSubNet(\"1.2.4.0/255.255.255.0\"));\n    BOOST_CHECK(ResolveSubNet(\"1.2.3.0/24\").Match(ResolveIP(\"1.2.3.4\")));\n    BOOST_CHECK(!ResolveSubNet(\"1.2.2.0/24\").Match(ResolveIP(\"1.2.3.4\")));\n    BOOST_CHECK(ResolveSubNet(\"1.2.3.4\").Match(ResolveIP(\"1.2.3.4\")));\n    BOOST_CHECK(ResolveSubNet(\"1.2.3.4/32\").Match(ResolveIP(\"1.2.3.4\")));\n    BOOST_CHECK(!ResolveSubNet(\"1.2.3.4\").Match(ResolveIP(\"5.6.7.8\")));\n    BOOST_CHECK(!ResolveSubNet(\"1.2.3.4/32\").Match(ResolveIP(\"5.6.7.8\")));\n    BOOST_CHECK(ResolveSubNet(\"::ffff:127.0.0.1\").Match(ResolveIP(\"127.0.0.1\")));\n    BOOST_CHECK(ResolveSubNet(\"1:2:3:4:5:6:7:8\").Match(ResolveIP(\"1:2:3:4:5:6:7:8\")));\n    BOOST_CHECK(!ResolveSubNet(\"1:2:3:4:5:6:7:8\").Match(ResolveIP(\"1:2:3:4:5:6:7:9\")));\n    BOOST_CHECK(ResolveSubNet(\"1:2:3:4:5:6:7:0/112\").Match(ResolveIP(\"1:2:3:4:5:6:7:1234\")));\n    BOOST_CHECK(ResolveSubNet(\"192.168.0.1/24\").Match(ResolveIP(\"192.168.0.2\")));\n    BOOST_CHECK(ResolveSubNet(\"192.168.0.20/29\").Match(ResolveIP(\"192.168.0.18\")));\n    BOOST_CHECK(ResolveSubNet(\"1.2.2.1/24\").Match(ResolveIP(\"1.2.2.4\")));\n    BOOST_CHECK(ResolveSubNet(\"1.2.2.110/31\").Match(ResolveIP(\"1.2.2.111\")));\n    BOOST_CHECK(ResolveSubNet(\"1.2.2.20/26\").Match(ResolveIP(\"1.2.2.63\")));\n    // All-Matching IPv6 Matches arbitrary IPv4 and IPv6\n    BOOST_CHECK(ResolveSubNet(\"::/0\").Match(ResolveIP(\"1:2:3:4:5:6:7:1234\")));\n    BOOST_CHECK(ResolveSubNet(\"::/0\").Match(ResolveIP(\"1.2.3.4\")));\n    // All-Matching IPv4 does not Match IPv6\n    BOOST_CHECK(!ResolveSubNet(\"0.0.0.0/0\").Match(ResolveIP(\"1:2:3:4:5:6:7:1234\")));\n    // Invalid subnets Match nothing (not even invalid addresses)\n    BOOST_CHECK(!CSubNet().Match(ResolveIP(\"1.2.3.4\")));\n    BOOST_CHECK(!ResolveSubNet(\"\").Match(ResolveIP(\"4.5.6.7\")));\n    BOOST_CHECK(!ResolveSubNet(\"bloop\").Match(ResolveIP(\"0.0.0.0\")));\n    BOOST_CHECK(!ResolveSubNet(\"bloop\").Match(ResolveIP(\"hab\")));\n    // Check valid/invalid\n    BOOST_CHECK(ResolveSubNet(\"1.2.3.0/0\").IsValid());\n    BOOST_CHECK(!ResolveSubNet(\"1.2.3.0/-1\").IsValid());\n    BOOST_CHECK(ResolveSubNet(\"1.2.3.0/32\").IsValid());\n    BOOST_CHECK(!ResolveSubNet(\"1.2.3.0/33\").IsValid());\n    BOOST_CHECK(ResolveSubNet(\"1:2:3:4:5:6:7:8/0\").IsValid());\n    BOOST_CHECK(ResolveSubNet(\"1:2:3:4:5:6:7:8/33\").IsValid());\n    BOOST_CHECK(!ResolveSubNet(\"1:2:3:4:5:6:7:8/-1\").IsValid());\n    BOOST_CHECK(ResolveSubNet(\"1:2:3:4:5:6:7:8/128\").IsValid());\n    BOOST_CHECK(!ResolveSubNet(\"1:2:3:4:5:6:7:8/129\").IsValid());\n    BOOST_CHECK(!ResolveSubNet(\"fuzzy\").IsValid());\n\n    //CNetAddr constructor test\n    BOOST_CHECK(CSubNet(ResolveIP(\"127.0.0.1\")).IsValid());\n    BOOST_CHECK(CSubNet(ResolveIP(\"127.0.0.1\")).Match(ResolveIP(\"127.0.0.1\")));\n    BOOST_CHECK(!CSubNet(ResolveIP(\"127.0.0.1\")).Match(ResolveIP(\"127.0.0.2\")));\n    BOOST_CHECK(CSubNet(ResolveIP(\"127.0.0.1\")).ToString() == \"127.0.0.1/32\");\n\n    CSubNet subnet = CSubNet(ResolveIP(\"1.2.3.4\"), 32);\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.4/32\");\n    subnet = CSubNet(ResolveIP(\"1.2.3.4\"), 8);\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.0.0.0/8\");\n    subnet = CSubNet(ResolveIP(\"1.2.3.4\"), 0);\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"0.0.0.0/0\");\n\n    subnet = CSubNet(ResolveIP(\"1.2.3.4\"), ResolveIP(\"255.255.255.255\"));\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.4/32\");\n    subnet = CSubNet(ResolveIP(\"1.2.3.4\"), ResolveIP(\"255.0.0.0\"));\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.0.0.0/8\");\n    subnet = CSubNet(ResolveIP(\"1.2.3.4\"), ResolveIP(\"0.0.0.0\"));\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"0.0.0.0/0\");\n\n    BOOST_CHECK(CSubNet(ResolveIP(\"1:2:3:4:5:6:7:8\")).IsValid());\n    BOOST_CHECK(CSubNet(ResolveIP(\"1:2:3:4:5:6:7:8\")).Match(ResolveIP(\"1:2:3:4:5:6:7:8\")));\n    BOOST_CHECK(!CSubNet(ResolveIP(\"1:2:3:4:5:6:7:8\")).Match(ResolveIP(\"1:2:3:4:5:6:7:9\")));\n    BOOST_CHECK(CSubNet(ResolveIP(\"1:2:3:4:5:6:7:8\")).ToString() == \"1:2:3:4:5:6:7:8/128\");\n\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.255.255\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.4/32\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.255.254\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.4/31\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.255.252\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.4/30\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.255.248\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.0/29\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.255.240\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.0/28\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.255.224\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.0/27\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.255.192\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.0/26\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.255.128\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.0/25\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.255.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.3.0/24\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.254.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.2.0/23\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.252.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.0.0/22\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.248.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.0.0/21\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.240.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.0.0/20\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.224.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.0.0/19\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.192.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.0.0/18\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.128.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.0.0/17\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.0.0/16\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.254.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.0.0/15\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.252.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.0.0.0/14\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.248.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.0.0.0/13\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.240.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.0.0.0/12\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.224.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.0.0.0/11\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.192.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.0.0.0/10\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.128.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.0.0.0/9\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.0.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.0.0.0/8\");\n    subnet = ResolveSubNet(\"1.2.3.4/254.0.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"0.0.0.0/7\");\n    subnet = ResolveSubNet(\"1.2.3.4/252.0.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"0.0.0.0/6\");\n    subnet = ResolveSubNet(\"1.2.3.4/248.0.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"0.0.0.0/5\");\n    subnet = ResolveSubNet(\"1.2.3.4/240.0.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"0.0.0.0/4\");\n    subnet = ResolveSubNet(\"1.2.3.4/224.0.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"0.0.0.0/3\");\n    subnet = ResolveSubNet(\"1.2.3.4/192.0.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"0.0.0.0/2\");\n    subnet = ResolveSubNet(\"1.2.3.4/128.0.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"0.0.0.0/1\");\n    subnet = ResolveSubNet(\"1.2.3.4/0.0.0.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"0.0.0.0/0\");\n\n    subnet = ResolveSubNet(\"1:2:3:4:5:6:7:8/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1:2:3:4:5:6:7:8/128\");\n    subnet = ResolveSubNet(\"1:2:3:4:5:6:7:8/ffff:0000:0000:0000:0000:0000:0000:0000\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1::/16\");\n    subnet = ResolveSubNet(\"1:2:3:4:5:6:7:8/0000:0000:0000:0000:0000:0000:0000:0000\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"::/0\");\n    subnet = ResolveSubNet(\"1.2.3.4/255.255.232.0\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1.2.0.0/255.255.232.0\");\n    subnet = ResolveSubNet(\"1:2:3:4:5:6:7:8/ffff:ffff:ffff:fffe:ffff:ffff:ffff:ff0f\");\n    BOOST_CHECK_EQUAL(subnet.ToString(), \"1:2:3:4:5:6:7:8/ffff:ffff:ffff:fffe:ffff:ffff:ffff:ff0f\");\n\n}\n\nBOOST_AUTO_TEST_CASE(netbase_getgroup)\n{\n\n    BOOST_CHECK(ResolveIP(\"127.0.0.1\").GetGroup() == std::vector<unsigned char>({0})); // Local -> !Routable()\n    BOOST_CHECK(ResolveIP(\"257.0.0.1\").GetGroup() == std::vector<unsigned char>({0})); // !Valid -> !Routable()\n    BOOST_CHECK(ResolveIP(\"10.0.0.1\").GetGroup() == std::vector<unsigned char>({0})); // RFC1918 -> !Routable()\n    BOOST_CHECK(ResolveIP(\"169.254.1.1\").GetGroup() == std::vector<unsigned char>({0})); // RFC3927 -> !Routable()\n    BOOST_CHECK(ResolveIP(\"1.2.3.4\").GetGroup() == std::vector<unsigned char>({(unsigned char)NET_IPV4, 1, 2})); // IPv4\n    BOOST_CHECK(ResolveIP(\"::FFFF:0:102:304\").GetGroup() == std::vector<unsigned char>({(unsigned char)NET_IPV4, 1, 2})); // RFC6145\n    BOOST_CHECK(ResolveIP(\"64:FF9B::102:304\").GetGroup() == std::vector<unsigned char>({(unsigned char)NET_IPV4, 1, 2})); // RFC6052\n    BOOST_CHECK(ResolveIP(\"2002:102:304:9999:9999:9999:9999:9999\").GetGroup() == std::vector<unsigned char>({(unsigned char)NET_IPV4, 1, 2})); // RFC3964\n    BOOST_CHECK(ResolveIP(\"2001:0:9999:9999:9999:9999:FEFD:FCFB\").GetGroup() == std::vector<unsigned char>({(unsigned char)NET_IPV4, 1, 2})); // RFC4380\n    BOOST_CHECK(ResolveIP(\"FD87:D87E:EB43:edb1:8e4:3588:e546:35ca\").GetGroup() == std::vector<unsigned char>({(unsigned char)NET_TOR, 239})); // Tor\n    BOOST_CHECK(ResolveIP(\"2001:470:abcd:9999:9999:9999:9999:9999\").GetGroup() == std::vector<unsigned char>({(unsigned char)NET_IPV6, 32, 1, 4, 112, 175})); //he.net\n    BOOST_CHECK(ResolveIP(\"2001:2001:9999:9999:9999:9999:9999:9999\").GetGroup() == std::vector<unsigned char>({(unsigned char)NET_IPV6, 32, 1, 32, 1})); //IPv6\n\n    // baz.net sha256 hash: 12929400eb4607c4ac075f087167e75286b179c693eb059a01774b864e8fe505\n    std::vector<unsigned char> internal_group = {NET_INTERNAL, 0x12, 0x92, 0x94, 0x00, 0xeb, 0x46, 0x07, 0xc4, 0xac, 0x07};\n    BOOST_CHECK(CreateInternal(\"baz.net\").GetGroup() == internal_group);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/pmt_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <consensus/merkle.h>\n#include <merkleblock.h>\n#include <serialize.h>\n#include <streams.h>\n#include <uint256.h>\n#include <arith_uint256.h>\n#include <version.h>\n#include <test/test_bitcoin.h>\n\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n\nclass CPartialMerkleTreeTester : public CPartialMerkleTree\n{\npublic:\n    // flip one bit in one of the hashes - this should break the authentication\n    void Damage() {\n        unsigned int n = InsecureRandRange(vHash.size());\n        int bit = InsecureRandBits(8);\n        *(vHash[n].begin() + (bit>>3)) ^= 1<<(bit&7);\n    }\n};\n\nBOOST_FIXTURE_TEST_SUITE(pmt_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(pmt_test1)\n{\n    SeedInsecureRand(false);\n    static const unsigned int nTxCounts[] = {1, 4, 7, 17, 56, 100, 127, 256, 312, 513, 1000, 4095};\n\n    for (int i = 0; i < 12; i++) {\n        unsigned int nTx = nTxCounts[i];\n\n        // build a block with some dummy transactions\n        CBlock block;\n        for (unsigned int j=0; j<nTx; j++) {\n            CMutableTransaction tx;\n            tx.nLockTime = j; // actual transaction data doesn't matter; just make the nLockTime's unique\n            block.vtx.push_back(MakeTransactionRef(std::move(tx)));\n        }\n\n        // calculate actual merkle root and height\n        uint256 merkleRoot1 = BlockMerkleRoot(block);\n        std::vector<uint256> vTxid(nTx, uint256());\n        for (unsigned int j=0; j<nTx; j++)\n            vTxid[j] = block.vtx[j]->GetHash();\n        int nHeight = 1, nTx_ = nTx;\n        while (nTx_ > 1) {\n            nTx_ = (nTx_+1)/2;\n            nHeight++;\n        }\n\n        // check with random subsets with inclusion chances 1, 1/2, 1/4, ..., 1/128\n        for (int att = 1; att < 15; att++) {\n            // build random subset of txid's\n            std::vector<bool> vMatch(nTx, false);\n            std::vector<uint256> vMatchTxid1;\n            for (unsigned int j=0; j<nTx; j++) {\n                bool fInclude = InsecureRandBits(att / 2) == 0;\n                vMatch[j] = fInclude;\n                if (fInclude)\n                    vMatchTxid1.push_back(vTxid[j]);\n            }\n\n            // build the partial merkle tree\n            CPartialMerkleTree pmt1(vTxid, vMatch);\n\n            // serialize\n            CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);\n            ss << pmt1;\n\n            // verify CPartialMerkleTree's size guarantees\n            unsigned int n = std::min<unsigned int>(nTx, 1 + vMatchTxid1.size()*nHeight);\n            BOOST_CHECK(ss.size() <= 10 + (258*n+7)/8);\n\n            // deserialize into a tester copy\n            CPartialMerkleTreeTester pmt2;\n            ss >> pmt2;\n\n            // extract merkle root and matched txids from copy\n            std::vector<uint256> vMatchTxid2;\n            std::vector<unsigned int> vIndex;\n            uint256 merkleRoot2 = pmt2.ExtractMatches(vMatchTxid2, vIndex);\n\n            // check that it has the same merkle root as the original, and a valid one\n            BOOST_CHECK(merkleRoot1 == merkleRoot2);\n            BOOST_CHECK(!merkleRoot2.IsNull());\n\n            // check that it contains the matched transactions (in the same order!)\n            BOOST_CHECK(vMatchTxid1 == vMatchTxid2);\n\n            // check that random bit flips break the authentication\n            for (int j=0; j<4; j++) {\n                CPartialMerkleTreeTester pmt3(pmt2);\n                pmt3.Damage();\n                std::vector<uint256> vMatchTxid3;\n                uint256 merkleRoot3 = pmt3.ExtractMatches(vMatchTxid3, vIndex);\n                BOOST_CHECK(merkleRoot3 != merkleRoot1);\n            }\n        }\n    }\n}\n\nBOOST_AUTO_TEST_CASE(pmt_malleability)\n{\n    std::vector<uint256> vTxid = {\n        ArithToUint256(1), ArithToUint256(2),\n        ArithToUint256(3), ArithToUint256(4),\n        ArithToUint256(5), ArithToUint256(6),\n        ArithToUint256(7), ArithToUint256(8),\n        ArithToUint256(9), ArithToUint256(10),\n        ArithToUint256(9), ArithToUint256(10),\n    };\n    std::vector<bool> vMatch = {false, false, false, false, false, false, false, false, false, true, true, false};\n\n    CPartialMerkleTree tree(vTxid, vMatch);\n    std::vector<unsigned int> vIndex;\n    BOOST_CHECK(tree.ExtractMatches(vTxid, vIndex).IsNull());\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/policyestimator_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <policy/policy.h>\n#include <policy/fees.h>\n#include <txmempool.h>\n#include <uint256.h>\n#include <util.h>\n\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(policyestimator_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(BlockPolicyEstimates)\n{\n    CBlockPolicyEstimator feeEst;\n    CTxMemPool mpool(&feeEst);\n    TestMemPoolEntryHelper entry;\n    CAmount basefee(2000);\n    CAmount deltaFee(100);\n    std::vector<CAmount> feeV;\n\n    // Populate vectors of increasing fees\n    for (int j = 0; j < 10; j++) {\n        feeV.push_back(basefee * (j+1));\n    }\n\n    // Store the hashes of transactions that have been\n    // added to the mempool by their associate fee\n    // txHashes[j] is populated with transactions either of\n    // fee = basefee * (j+1)\n    std::vector<uint256> txHashes[10];\n\n    // Create a transaction template\n    CScript garbage;\n    for (unsigned int i = 0; i < 128; i++)\n        garbage.push_back('X');\n    CMutableTransaction tx;\n    tx.vin.resize(1);\n    tx.vin[0].scriptSig = garbage;\n    tx.vout.resize(1);\n    tx.vout[0].nValue=0LL;\n    CFeeRate baseRate(basefee, GetVirtualTransactionSize(tx));\n\n    // Create a fake block\n    std::vector<CTransactionRef> block;\n    int blocknum = 0;\n\n    // Loop through 200 blocks\n    // At a decay .9952 and 4 fee transactions per block\n    // This makes the tx count about 2.5 per bucket, well above the 0.1 threshold\n    while (blocknum < 200) {\n        for (int j = 0; j < 10; j++) { // For each fee\n            for (int k = 0; k < 4; k++) { // add 4 fee txs\n                tx.vin[0].prevout.n = 10000*blocknum+100*j+k; // make transaction unique\n                uint256 hash = tx.GetHash();\n                mpool.addUnchecked(hash, entry.Fee(feeV[j]).Time(GetTime()).Height(blocknum).FromTx(tx));\n                txHashes[j].push_back(hash);\n            }\n        }\n        //Create blocks where higher fee txs are included more often\n        for (int h = 0; h <= blocknum%10; h++) {\n            // 10/10 blocks add highest fee transactions\n            // 9/10 blocks add 2nd highest and so on until ...\n            // 1/10 blocks add lowest fee transactions\n            while (txHashes[9-h].size()) {\n                CTransactionRef ptx = mpool.get(txHashes[9-h].back());\n                if (ptx)\n                    block.push_back(ptx);\n                txHashes[9-h].pop_back();\n            }\n        }\n        mpool.removeForBlock(block, ++blocknum);\n        block.clear();\n        // Check after just a few txs that combining buckets works as expected\n        if (blocknum == 3) {\n            // At this point we should need to combine 3 buckets to get enough data points\n            // So estimateFee(1) should fail and estimateFee(2) should return somewhere around\n            // 9*baserate.  estimateFee(2) %'s are 100,100,90 = average 97%\n            BOOST_CHECK(feeEst.estimateFee(1) == CFeeRate(0));\n            BOOST_CHECK(feeEst.estimateFee(2).GetFeePerK() < 9*baseRate.GetFeePerK() + deltaFee);\n            BOOST_CHECK(feeEst.estimateFee(2).GetFeePerK() > 9*baseRate.GetFeePerK() - deltaFee);\n        }\n    }\n\n    std::vector<CAmount> origFeeEst;\n    // Highest feerate is 10*baseRate and gets in all blocks,\n    // second highest feerate is 9*baseRate and gets in 9/10 blocks = 90%,\n    // third highest feerate is 8*base rate, and gets in 8/10 blocks = 80%,\n    // so estimateFee(1) would return 10*baseRate but is hardcoded to return failure\n    // Second highest feerate has 100% chance of being included by 2 blocks,\n    // so estimateFee(2) should return 9*baseRate etc...\n    for (int i = 1; i < 10;i++) {\n        origFeeEst.push_back(feeEst.estimateFee(i).GetFeePerK());\n        if (i > 2) { // Fee estimates should be monotonically decreasing\n            BOOST_CHECK(origFeeEst[i-1] <= origFeeEst[i-2]);\n        }\n        int mult = 11-i;\n        if (i % 2 == 0) { //At scale 2, test logic is only correct for even targets\n            BOOST_CHECK(origFeeEst[i-1] < mult*baseRate.GetFeePerK() + deltaFee);\n            BOOST_CHECK(origFeeEst[i-1] > mult*baseRate.GetFeePerK() - deltaFee);\n        }\n    }\n    // Fill out rest of the original estimates\n    for (int i = 10; i <= 48; i++) {\n        origFeeEst.push_back(feeEst.estimateFee(i).GetFeePerK());\n    }\n\n    // Mine 50 more blocks with no transactions happening, estimates shouldn't change\n    // We haven't decayed the moving average enough so we still have enough data points in every bucket\n    while (blocknum < 250)\n        mpool.removeForBlock(block, ++blocknum);\n\n    BOOST_CHECK(feeEst.estimateFee(1) == CFeeRate(0));\n    for (int i = 2; i < 10;i++) {\n        BOOST_CHECK(feeEst.estimateFee(i).GetFeePerK() < origFeeEst[i-1] + deltaFee);\n        BOOST_CHECK(feeEst.estimateFee(i).GetFeePerK() > origFeeEst[i-1] - deltaFee);\n    }\n\n\n    // Mine 15 more blocks with lots of transactions happening and not getting mined\n    // Estimates should go up\n    while (blocknum < 265) {\n        for (int j = 0; j < 10; j++) { // For each fee multiple\n            for (int k = 0; k < 4; k++) { // add 4 fee txs\n                tx.vin[0].prevout.n = 10000*blocknum+100*j+k;\n                uint256 hash = tx.GetHash();\n                mpool.addUnchecked(hash, entry.Fee(feeV[j]).Time(GetTime()).Height(blocknum).FromTx(tx));\n                txHashes[j].push_back(hash);\n            }\n        }\n        mpool.removeForBlock(block, ++blocknum);\n    }\n\n    for (int i = 1; i < 10;i++) {\n        BOOST_CHECK(feeEst.estimateFee(i) == CFeeRate(0) || feeEst.estimateFee(i).GetFeePerK() > origFeeEst[i-1] - deltaFee);\n    }\n\n    // Mine all those transactions\n    // Estimates should still not be below original\n    for (int j = 0; j < 10; j++) {\n        while(txHashes[j].size()) {\n            CTransactionRef ptx = mpool.get(txHashes[j].back());\n            if (ptx)\n                block.push_back(ptx);\n            txHashes[j].pop_back();\n        }\n    }\n    mpool.removeForBlock(block, 266);\n    block.clear();\n    BOOST_CHECK(feeEst.estimateFee(1) == CFeeRate(0));\n    for (int i = 2; i < 10;i++) {\n        BOOST_CHECK(feeEst.estimateFee(i) == CFeeRate(0) || feeEst.estimateFee(i).GetFeePerK() > origFeeEst[i-1] - deltaFee);\n    }\n\n    // Mine 400 more blocks where everything is mined every block\n    // Estimates should be below original estimates\n    while (blocknum < 665) {\n        for (int j = 0; j < 10; j++) { // For each fee multiple\n            for (int k = 0; k < 4; k++) { // add 4 fee txs\n                tx.vin[0].prevout.n = 10000*blocknum+100*j+k;\n                uint256 hash = tx.GetHash();\n                mpool.addUnchecked(hash, entry.Fee(feeV[j]).Time(GetTime()).Height(blocknum).FromTx(tx));\n                CTransactionRef ptx = mpool.get(hash);\n                if (ptx)\n                    block.push_back(ptx);\n\n            }\n        }\n        mpool.removeForBlock(block, ++blocknum);\n        block.clear();\n    }\n    BOOST_CHECK(feeEst.estimateFee(1) == CFeeRate(0));\n    for (int i = 2; i < 9; i++) { // At 9, the original estimate was already at the bottom (b/c scale = 2)\n        BOOST_CHECK(feeEst.estimateFee(i).GetFeePerK() < origFeeEst[i-1] - deltaFee);\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/pow_tests.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT/X11 software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <chain.h>\n#include <chainparams.h>\n#include <pow.h>\n#include <random.h>\n#include <util.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(pow_tests, BasicTestingSetup)\n\n/* Test calculation of next difficulty target with no constraints applying */\nBOOST_AUTO_TEST_CASE(get_next_work)\n{\n    /*\n    2019-04-22 12:18:06 UpdateTip: new best=be25b4a7c3d1c4cb144f578b0977922b0866e02d8a1327a432dc9fd90878d27c height=6161 version=0x20000000 log2_work=23.325692 tx=6162 date='2019-04-22 12:18:05' progress=1.000000 cache=0.8MiB(5675txo)\n    2019-04-22 12:18:06 CreateNewBlock(): block weight: 808 txs: 0 fees: 0 sigops 400\n    2019-04-22 12:18:06 \n\n    bnAvg=001c205249494949494949494949494949494949494949494949494949494949 nLastBlockTime=1555935464 nFirstBlockTime=1555932646 params=0x5637617381c0\n\n    2019-04-22 12:18:06   nActualTimespan = 2818  before dampening\n    2019-04-22 12:18:06   nActualTimespan = 2617  before bounds\n    2019-04-22 12:18:06 GetNextWorkRequired RETARGET\n    2019-04-22 12:18:06 params.AveragingWindowTimespan() = 2550    nActualTimespan = 2617\n    2019-04-22 12:18:06 Timespan ratio: 2550 / 2617 = \u001b[31;1m0.974\u001b[0m\n    2019-04-22 12:18:06 Current average: 1f1c2052  001c205249494949494949494949494949494949494949494949494949494949\n    2019-04-22 12:18:06 After:  1f1cdd81  001cdd819ff15c60ff37087378164e1f8a8f2d6536a1a6447c4db8bd5b936334  521985409\n    2019-04-22 12:18:06\n    */\n\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN); // height=6161\n    arith_uint256 bnAvg = arith_uint256(\"001c205249494949494949494949494949494949494949494949494949494949\");\n    int64_t nLastBlockTime = 1555935464;\n    int64_t nFirstBlockTime = 1555932646;\n    BOOST_CHECK_EQUAL(CalculateNextWorkRequired(bnAvg, nLastBlockTime, nFirstBlockTime, chainParams->GetConsensus()), 521985409); // 0x1f1cdd81\n}\n\n/* Test the constraint on the upper bound for next work */\nBOOST_AUTO_TEST_CASE(get_next_work_pow_limit)\n{\n    /*\n    2019-04-22 05:27:41 UpdateTip: new best=fb986f63e1211dcb39a1160effa62319705e5c72bd362724691646389146c247 height=511 version=0x20000000 log2_work=19 tx=512 date='2019-04-22 05:27:40' progress=1.000000 cache=0.0MiB(14txo)\n    2019-04-22 05:27:41 AddToWallet 8e0eb41c43c4a4931e28a8dc786342e3d9703be1896047565578b4090871f28d  new\n    2019-04-22 05:27:41 CreateNewBlock(): block weight: 808 txs: 0 fees: 0 sigops 400\n    2019-04-22 05:27:41 \n\n    bnAvg=003fffff00000000000000000000000000000000000000000000000000000000 nLastBlockTime=1555910839 nFirstBlockTime=1555908929 params=0x5637617381c0\n\n    2019-04-22 05:27:41   nActualTimespan = 1910  before dampening\n    2019-04-22 05:27:41   nActualTimespan = 2390  before bounds\n    2019-04-22 05:27:41 GetNextWorkRequired RETARGET\n    2019-04-22 05:27:41 params.AveragingWindowTimespan() = 2550    nActualTimespan = 2390\n    2019-04-22 05:27:41 Timespan ratio: 2550 / 2390 = \u001b[31;1m1.07\u001b[0m\n    2019-04-22 05:27:41 Current average: 1f3fffff  003fffff00000000000000000000000000000000000000000000000000000000\n    2019-04-22 05:27:41 After:  1f3bfbfb  003bfbfb0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0548  524024827\n    2019-04-22 05:27:41\n    */\n\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN); // height=511 (N=510)\n    arith_uint256 bnAvg = arith_uint256(\"003fffff00000000000000000000000000000000000000000000000000000000\");\n    int64_t nLastBlockTime = 1555910839;\n    int64_t nFirstBlockTime = 1555908929;\n    BOOST_CHECK_EQUAL(CalculateNextWorkRequired(bnAvg, nLastBlockTime, nFirstBlockTime, chainParams->GetConsensus()), 524024827); // 0x1f3bfbfb\n}\n\n/* Test the constraint on the lower bound for actual time taken */\nBOOST_AUTO_TEST_CASE(get_next_work_lower_limit_actual)\n{\n    /*\n    2019-04-22 06:17:08 UpdateTip: new best=66e32f2f15b55ccc519431e94b9baa8546ef464fc26b7c6c1d8ba46fe7812ce5 height=1234 version=0x20000000 log2_work=20.373246 tx=1235 date='2019-04-22 06:17:08' progress=1.000000 cache=0.1MiB(737txo)\n    2019-04-22 06:17:08 AddToWallet aab7131d9100234693f3f4f7200343675283d174c335ef601a45d581fb6e0905  new\n    2019-04-22 06:17:08 CreateNewBlock(): block weight: 808 txs: 0 fees: 0 sigops 400\n    2019-04-22 06:17:08 \n\n    bnAvg=0037e5f3e2626262626262626262626262626262626262626262626262626262 nLastBlockTime=1555913812 nFirstBlockTime=1555911686 params=0x5637617381c0\n\n    2019-04-22 06:17:08   nActualTimespan = 2126  before dampening\n    2019-04-22 06:17:08   nActualTimespan = 2444  before bounds\n    2019-04-22 06:17:08 GetNextWorkRequired RETARGET\n    2019-04-22 06:17:08 params.AveragingWindowTimespan() = 2550    nActualTimespan = 2444\n    2019-04-22 06:17:08 Timespan ratio: 2550 / 2444 = \u001b[31;1m1.04\u001b[0m\n    2019-04-22 06:17:08 Current average: 1f37e5f3  0037e5f3e2626262626262626262626262626262626262626262626262626262\n    2019-04-22 06:17:08 After:  1f35931b  0035931b8a7797eb722c19398d13cdbadb2eb56f5c7cd05710fe1e71f8b297cc  523604763\n    2019-04-22 06:17:08 \n    */\n\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN); // height=1234\n    arith_uint256 bnAvg = arith_uint256(\"0037e5f3e2626262626262626262626262626262626262626262626262626262\");\n    int64_t nLastBlockTime = 1555913812;\n    int64_t nFirstBlockTime = 1555911686;\n    BOOST_CHECK_EQUAL(CalculateNextWorkRequired(bnAvg, nLastBlockTime, nFirstBlockTime, chainParams->GetConsensus()), 523604763); // 0x1f35931b\n}\n\n/* Test the constraint on the upper bound for actual time taken */\nBOOST_AUTO_TEST_CASE(get_next_work_upper_limit_actual)\n{\n    /*\n    2019-04-22 05:27:43 UpdateTip: new best=80c7e76ad10627c7f393b601db2dcd8dd2e470666d6d1477d584741b7cf99c7e height=512 version=0x20000000 log2_work=19.003002 tx=513 date='2019-04-22 05:27:41' progress=1.000000 cache=0.0MiB(15txo)\n    2019-04-22 05:27:43 CreateNewBlock(): block weight: 808 txs: 0 fees: 0 sigops 400\n    2019-04-22 05:27:43 \n\n    bnAvg=003ffdfaf9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9 nLastBlockTime=1555910839 nFirstBlockTime=1555908929 params=0x5637617381c0\n\n    2019-04-22 05:27:43   nActualTimespan = 1910  before dampening\n    2019-04-22 05:27:43   nActualTimespan = 2390  before bounds\n    2019-04-22 05:27:43 GetNextWorkRequired RETARGET\n    2019-04-22 05:27:43 params.AveragingWindowTimespan() = 2550    nActualTimespan = 2390\n    2019-04-22 05:27:43 Timespan ratio: 2550 / 2390 = \u001b[31;1m1.07\u001b[0m\n    2019-04-22 05:27:43 Current average: 1f3ffdfa  003ffdfaf9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9\n    2019-04-22 05:27:43 After:  1f3bfa17  003bfa1766c72787e848a90969ca2a8aeb4bac0c6ccd2d8dee4eaf0f6fd02892  524024343\n    2019-04-22 05:27:43 \n    */\n\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN); // height=512\n    arith_uint256 bnAvg = arith_uint256(\"003ffdfaf9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9\");\n    int64_t nLastBlockTime = 1555910839;\n    int64_t nFirstBlockTime = 1555908929;\n    BOOST_CHECK_EQUAL(CalculateNextWorkRequired(bnAvg, nLastBlockTime, nFirstBlockTime, chainParams->GetConsensus()), 524024343); // 0x1f3bfa17\n}\n\nBOOST_AUTO_TEST_CASE(GetBlockProofEquivalentTime_test)\n{\n    // genesis = CreateGenesisBlock(1554336000, 2645, 0x1f3fffff, 1, 42.94967296 * COIN);\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN);\n    std::vector<CBlockIndex> blocks(10000);\n    for (int i = 0; i < 10000; i++) {\n        blocks[i].pprev = i ? &blocks[i - 1] : nullptr;\n        blocks[i].nHeight = i;\n        blocks[i].nTime = 1554336000 + i * chainParams->GetConsensus().nPowTargetSpacing;\n        blocks[i].nBits = 0x1f3fffff; /* target ???... */\n        blocks[i].nChainWork = i ? blocks[i - 1].nChainWork + GetBlockProof(blocks[i - 1]) : arith_uint256(0);\n    }\n\n    for (int j = 0; j < 1000; j++) {\n        CBlockIndex *p1 = &blocks[InsecureRandRange(10000)];\n        CBlockIndex *p2 = &blocks[InsecureRandRange(10000)];\n        CBlockIndex *p3 = &blocks[InsecureRandRange(10000)];\n\n        int64_t tdiff = GetBlockProofEquivalentTime(*p1, *p2, *p3, chainParams->GetConsensus());\n        BOOST_CHECK_EQUAL(tdiff, p1->GetBlockTime() - p2->GetBlockTime());\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/prevector_tests.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <vector>\n#include <prevector.h>\n\n#include <reverse_iterator.h>\n#include <serialize.h>\n#include <streams.h>\n\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(PrevectorTests, TestingSetup)\n\ntemplate<unsigned int N, typename T>\nclass prevector_tester {\n    typedef std::vector<T> realtype;\n    realtype real_vector;\n    realtype real_vector_alt;\n\n    typedef prevector<N, T> pretype;\n    pretype pre_vector;\n    pretype pre_vector_alt;\n\n    typedef typename pretype::size_type Size;\n    bool passed = true;\n    FastRandomContext rand_cache;\n    uint256 rand_seed;\n\n\n    template <typename A, typename B>\n        void local_check_equal(A a, B b)\n        {\n            local_check(a == b);\n        }\n    void local_check(bool b) \n    {\n        passed &= b;\n    }\n    void test() {\n        const pretype& const_pre_vector = pre_vector;\n        local_check_equal(real_vector.size(), pre_vector.size());\n        local_check_equal(real_vector.empty(), pre_vector.empty());\n        for (Size s = 0; s < real_vector.size(); s++) {\n             local_check(real_vector[s] == pre_vector[s]);\n             local_check(&(pre_vector[s]) == &(pre_vector.begin()[s]));\n             local_check(&(pre_vector[s]) == &*(pre_vector.begin() + s));\n             local_check(&(pre_vector[s]) == &*((pre_vector.end() + s) - real_vector.size()));\n        }\n        // local_check(realtype(pre_vector) == real_vector);\n        local_check(pretype(real_vector.begin(), real_vector.end()) == pre_vector);\n        local_check(pretype(pre_vector.begin(), pre_vector.end()) == pre_vector);\n        size_t pos = 0;\n        for (const T& v : pre_vector) {\n             local_check(v == real_vector[pos++]);\n        }\n        for (const T& v : reverse_iterate(pre_vector)) {\n             local_check(v == real_vector[--pos]);\n        }\n        for (const T& v : const_pre_vector) {\n             local_check(v == real_vector[pos++]);\n        }\n        for (const T& v : reverse_iterate(const_pre_vector)) {\n             local_check(v == real_vector[--pos]);\n        }\n        CDataStream ss1(SER_DISK, 0);\n        CDataStream ss2(SER_DISK, 0);\n        ss1 << real_vector;\n        ss2 << pre_vector;\n        local_check_equal(ss1.size(), ss2.size());\n        for (Size s = 0; s < ss1.size(); s++) {\n            local_check_equal(ss1[s], ss2[s]);\n        }\n    }\n\npublic:\n    void resize(Size s) {\n        real_vector.resize(s);\n        local_check_equal(real_vector.size(), s);\n        pre_vector.resize(s);\n        local_check_equal(pre_vector.size(), s);\n        test();\n    }\n\n    void reserve(Size s) {\n        real_vector.reserve(s);\n        local_check(real_vector.capacity() >= s);\n        pre_vector.reserve(s);\n        local_check(pre_vector.capacity() >= s);\n        test();\n    }\n\n    void insert(Size position, const T& value) {\n        real_vector.insert(real_vector.begin() + position, value);\n        pre_vector.insert(pre_vector.begin() + position, value);\n        test();\n    }\n\n    void insert(Size position, Size count, const T& value) {\n        real_vector.insert(real_vector.begin() + position, count, value);\n        pre_vector.insert(pre_vector.begin() + position, count, value);\n        test();\n    }\n\n    template<typename I>\n    void insert_range(Size position, I first, I last) {\n        real_vector.insert(real_vector.begin() + position, first, last);\n        pre_vector.insert(pre_vector.begin() + position, first, last);\n        test();\n    }\n\n    void erase(Size position) {\n        real_vector.erase(real_vector.begin() + position);\n        pre_vector.erase(pre_vector.begin() + position);\n        test();\n    }\n\n    void erase(Size first, Size last) {\n        real_vector.erase(real_vector.begin() + first, real_vector.begin() + last);\n        pre_vector.erase(pre_vector.begin() + first, pre_vector.begin() + last);\n        test();\n    }\n\n    void update(Size pos, const T& value) {\n        real_vector[pos] = value;\n        pre_vector[pos] = value;\n        test();\n    }\n\n    void push_back(const T& value) {\n        real_vector.push_back(value);\n        pre_vector.push_back(value);\n        test();\n    }\n\n    void pop_back() {\n        real_vector.pop_back();\n        pre_vector.pop_back();\n        test();\n    }\n\n    void clear() {\n        real_vector.clear();\n        pre_vector.clear();\n    }\n\n    void assign(Size n, const T& value) {\n        real_vector.assign(n, value);\n        pre_vector.assign(n, value);\n    }\n\n    Size size() const {\n        return real_vector.size();\n    }\n\n    Size capacity() const {\n        return pre_vector.capacity();\n    }\n\n    void shrink_to_fit() {\n        pre_vector.shrink_to_fit();\n        test();\n    }\n\n    void swap() {\n        real_vector.swap(real_vector_alt);\n        pre_vector.swap(pre_vector_alt);\n        test();\n    }\n\n    void move() {\n        real_vector = std::move(real_vector_alt);\n        real_vector_alt.clear();\n        pre_vector = std::move(pre_vector_alt);\n        pre_vector_alt.clear();\n    }\n\n    void copy() {\n        real_vector = real_vector_alt;\n        pre_vector = pre_vector_alt;\n    }\n\n    ~prevector_tester() {\n        BOOST_CHECK_MESSAGE(passed, \"insecure_rand: \" + rand_seed.ToString());\n    }\n\n    prevector_tester() {\n        SeedInsecureRand();\n        rand_seed = insecure_rand_seed;\n        rand_cache = insecure_rand_ctx;\n    }\n};\n\nBOOST_AUTO_TEST_CASE(PrevectorTestInt)\n{\n    for (int j = 0; j < 64; j++) {\n        prevector_tester<8, int> test;\n        for (int i = 0; i < 2048; i++) {\n            if (InsecureRandBits(2) == 0) {\n                test.insert(InsecureRandRange(test.size() + 1), InsecureRand32());\n            }\n            if (test.size() > 0 && InsecureRandBits(2) == 1) {\n                test.erase(InsecureRandRange(test.size()));\n            }\n            if (InsecureRandBits(3) == 2) {\n                int new_size = std::max<int>(0, std::min<int>(30, test.size() + (InsecureRandRange(5)) - 2));\n                test.resize(new_size);\n            }\n            if (InsecureRandBits(3) == 3) {\n                test.insert(InsecureRandRange(test.size() + 1), 1 + InsecureRandBool(), InsecureRand32());\n            }\n            if (InsecureRandBits(3) == 4) {\n                int del = std::min<int>(test.size(), 1 + (InsecureRandBool()));\n                int beg = InsecureRandRange(test.size() + 1 - del);\n                test.erase(beg, beg + del);\n            }\n            if (InsecureRandBits(4) == 5) {\n                test.push_back(InsecureRand32());\n            }\n            if (test.size() > 0 && InsecureRandBits(4) == 6) {\n                test.pop_back();\n            }\n            if (InsecureRandBits(5) == 7) {\n                int values[4];\n                int num = 1 + (InsecureRandBits(2));\n                for (int k = 0; k < num; k++) {\n                    values[k] = InsecureRand32();\n                }\n                test.insert_range(InsecureRandRange(test.size() + 1), values, values + num);\n            }\n            if (InsecureRandBits(5) == 8) {\n                int del = std::min<int>(test.size(), 1 + (InsecureRandBits(2)));\n                int beg = InsecureRandRange(test.size() + 1 - del);\n                test.erase(beg, beg + del);\n            }\n            if (InsecureRandBits(5) == 9) {\n                test.reserve(InsecureRandBits(5));\n            }\n            if (InsecureRandBits(6) == 10) {\n                test.shrink_to_fit();\n            }\n            if (test.size() > 0) {\n                test.update(InsecureRandRange(test.size()), InsecureRand32());\n            }\n            if (InsecureRandBits(10) == 11) {\n                test.clear();\n            }\n            if (InsecureRandBits(9) == 12) {\n                test.assign(InsecureRandBits(5), InsecureRand32());\n            }\n            if (InsecureRandBits(3) == 3) {\n                test.swap();\n            }\n            if (InsecureRandBits(4) == 8) {\n                test.copy();\n            }\n            if (InsecureRandBits(5) == 18) {\n                test.move();\n            }\n        }\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/raii_event_tests.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <event2/event.h>\n\n#ifdef EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED\n// It would probably be ideal to define dummy test(s) that report skipped, but boost::test doesn't seem to make that practical (at least not in versions available with common distros)\n\n#include <map>\n#include <stdlib.h>\n\n#include <support/events.h>\n\n#include <test/test_bitcoin.h>\n\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n\nstatic std::map<void*, short> tags;\nstatic std::map<void*, uint16_t> orders;\nstatic uint16_t tagSequence = 0;\n\nstatic void* tag_malloc(size_t sz) {\n    void* mem = malloc(sz);\n    if (!mem) return mem;\n    tags[mem]++;\n    orders[mem] = tagSequence++;\n    return mem;\n}\n\nstatic void tag_free(void* mem) {\n    tags[mem]--;\n    orders[mem] = tagSequence++;\n    free(mem);\n}\n\nBOOST_FIXTURE_TEST_SUITE(raii_event_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(raii_event_creation)\n{\n    event_set_mem_functions(tag_malloc, realloc, tag_free);\n    \n    void* base_ptr = nullptr;\n    {\n        auto base = obtain_event_base();\n        base_ptr = (void*)base.get();\n        BOOST_CHECK(tags[base_ptr] == 1);\n    }\n    BOOST_CHECK(tags[base_ptr] == 0);\n    \n    void* event_ptr = nullptr;\n    {\n        auto base = obtain_event_base();\n        auto event = obtain_event(base.get(), -1, 0, nullptr, nullptr);\n\n        base_ptr = (void*)base.get();\n        event_ptr = (void*)event.get();\n\n        BOOST_CHECK(tags[base_ptr] == 1);\n        BOOST_CHECK(tags[event_ptr] == 1);\n    }\n    BOOST_CHECK(tags[base_ptr] == 0);\n    BOOST_CHECK(tags[event_ptr] == 0);\n    \n    event_set_mem_functions(malloc, realloc, free);\n}\n\nBOOST_AUTO_TEST_CASE(raii_event_order)\n{\n    event_set_mem_functions(tag_malloc, realloc, tag_free);\n    \n    void* base_ptr = nullptr;\n    void* event_ptr = nullptr;\n    {\n        auto base = obtain_event_base();\n        auto event = obtain_event(base.get(), -1, 0, nullptr, nullptr);\n\n        base_ptr = (void*)base.get();\n        event_ptr = (void*)event.get();\n\n        // base should have allocated before event\n        BOOST_CHECK(orders[base_ptr] < orders[event_ptr]);\n    }\n    // base should be freed after event\n    BOOST_CHECK(orders[base_ptr] > orders[event_ptr]);\n\n    event_set_mem_functions(malloc, realloc, free);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n\n#endif  // EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED\n"
  },
  {
    "path": "src/test/random_tests.cpp",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <random.h>\n\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(random_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(osrandom_tests)\n{\n    BOOST_CHECK(Random_SanityCheck());\n}\n\nBOOST_AUTO_TEST_CASE(fastrandom_tests)\n{\n    // Check that deterministic FastRandomContexts are deterministic\n    FastRandomContext ctx1(true);\n    FastRandomContext ctx2(true);\n\n    BOOST_CHECK_EQUAL(ctx1.rand32(), ctx2.rand32());\n    BOOST_CHECK_EQUAL(ctx1.rand32(), ctx2.rand32());\n    BOOST_CHECK_EQUAL(ctx1.rand64(), ctx2.rand64());\n    BOOST_CHECK_EQUAL(ctx1.randbits(3), ctx2.randbits(3));\n    BOOST_CHECK(ctx1.randbytes(17) == ctx2.randbytes(17));\n    BOOST_CHECK(ctx1.rand256() == ctx2.rand256());\n    BOOST_CHECK_EQUAL(ctx1.randbits(7), ctx2.randbits(7));\n    BOOST_CHECK(ctx1.randbytes(128) == ctx2.randbytes(128));\n    BOOST_CHECK_EQUAL(ctx1.rand32(), ctx2.rand32());\n    BOOST_CHECK_EQUAL(ctx1.randbits(3), ctx2.randbits(3));\n    BOOST_CHECK(ctx1.rand256() == ctx2.rand256());\n    BOOST_CHECK(ctx1.randbytes(50) == ctx2.randbytes(50));\n\n    // Check that a nondeterministic ones are not\n    FastRandomContext ctx3;\n    FastRandomContext ctx4;\n    BOOST_CHECK(ctx3.rand64() != ctx4.rand64()); // extremely unlikely to be equal\n    BOOST_CHECK(ctx3.rand256() != ctx4.rand256());\n    BOOST_CHECK(ctx3.randbytes(7) != ctx4.randbytes(7));\n}\n\nBOOST_AUTO_TEST_CASE(fastrandom_randbits)\n{\n    FastRandomContext ctx1;\n    FastRandomContext ctx2;\n    for (int bits = 0; bits < 63; ++bits) {\n        for (int j = 0; j < 1000; ++j) {\n            uint64_t rangebits = ctx1.randbits(bits);\n            BOOST_CHECK_EQUAL(rangebits >> bits, 0);\n            uint64_t range = ((uint64_t)1) << bits | rangebits;\n            uint64_t rand = ctx2.randrange(range);\n            BOOST_CHECK(rand < range);\n        }\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/reverselock_tests.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <reverselock.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(reverselock_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(reverselock_basics)\n{\n    boost::mutex mutex;\n    boost::unique_lock<boost::mutex> lock(mutex);\n\n    BOOST_CHECK(lock.owns_lock());\n    {\n        reverse_lock<boost::unique_lock<boost::mutex> > rlock(lock);\n        BOOST_CHECK(!lock.owns_lock());\n    }\n    BOOST_CHECK(lock.owns_lock());\n}\n\nBOOST_AUTO_TEST_CASE(reverselock_errors)\n{\n    boost::mutex mutex;\n    boost::unique_lock<boost::mutex> lock(mutex);\n\n    // Make sure trying to reverse lock an unlocked lock fails\n    lock.unlock();\n\n    BOOST_CHECK(!lock.owns_lock());\n\n    bool failed = false;\n    try {\n        reverse_lock<boost::unique_lock<boost::mutex> > rlock(lock);\n    } catch(...) {\n        failed = true;\n    }\n\n    BOOST_CHECK(failed);\n    BOOST_CHECK(!lock.owns_lock());\n\n    // Locking the original lock after it has been taken by a reverse lock\n    // makes no sense. Ensure that the original lock no longer owns the lock\n    // after giving it to a reverse one.\n\n    lock.lock();\n    BOOST_CHECK(lock.owns_lock());\n    {\n        reverse_lock<boost::unique_lock<boost::mutex> > rlock(lock);\n        BOOST_CHECK(!lock.owns_lock());\n    }\n\n    BOOST_CHECK(failed);\n    BOOST_CHECK(lock.owns_lock());\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/rpc_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <rpc/server.h>\n#include <rpc/client.h>\n\n#include <base58.h>\n#include <core_io.h>\n#include <netbase.h>\n\n#include <test/test_bitcoin.h>\n\n#include <boost/algorithm/string.hpp>\n#include <boost/test/unit_test.hpp>\n\n#include <univalue.h>\n\nUniValue CallRPC(std::string args)\n{\n    std::vector<std::string> vArgs;\n    boost::split(vArgs, args, boost::is_any_of(\" \\t\"));\n    std::string strMethod = vArgs[0];\n    vArgs.erase(vArgs.begin());\n    JSONRPCRequest request;\n    request.strMethod = strMethod;\n    request.params = RPCConvertValues(strMethod, vArgs);\n    request.fHelp = false;\n    BOOST_CHECK(tableRPC[strMethod]);\n    rpcfn_type method = tableRPC[strMethod]->actor;\n    try {\n        UniValue result = (*method)(request);\n        return result;\n    }\n    catch (const UniValue& objError) {\n        throw std::runtime_error(find_value(objError, \"message\").get_str());\n    }\n}\n\n\nBOOST_FIXTURE_TEST_SUITE(rpc_tests, TestingSetup)\n\nBOOST_AUTO_TEST_CASE(rpc_rawparams)\n{\n    // Test raw transaction API argument handling\n    UniValue r;\n\n    BOOST_CHECK_THROW(CallRPC(\"getrawtransaction\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"getrawtransaction not_hex\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"getrawtransaction a3b807410df0b60fcb9736768df5823938b2f838694939ba45f3c0a1bff150ed not_int\"), std::runtime_error);\n\n    BOOST_CHECK_THROW(CallRPC(\"createrawtransaction\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"createrawtransaction null null\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"createrawtransaction not_array\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"createrawtransaction [] []\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"createrawtransaction {} {}\"), std::runtime_error);\n    BOOST_CHECK_NO_THROW(CallRPC(\"createrawtransaction [] {}\"));\n    BOOST_CHECK_THROW(CallRPC(\"createrawtransaction [] {} extra\"), std::runtime_error);\n\n    BOOST_CHECK_THROW(CallRPC(\"decoderawtransaction\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"decoderawtransaction null\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"decoderawtransaction DEADBEEF\"), std::runtime_error);\n    std::string rawtx = \"0100000001a15d57094aa7a21a28cb20b59aab8fc7d1149a3bdbcddba9c622e4f5f6a99ece010000006c493046022100f93bb0e7d8db7bd46e40132d1f8242026e045f03a0efe71bbb8e3f475e970d790221009337cd7f1f929f00cc6ff01f03729b069a7c21b59b1736ddfee5db5946c5da8c0121033b9b137ee87d5a812d6f506efdd37f0affa7ffc310711c06c7f3e097c9447c52ffffffff0100e1f505000000001976a9140389035a9225b3839e2bbf32d826a1e222031fd888ac00000000\";\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"decoderawtransaction \")+rawtx));\n    BOOST_CHECK_EQUAL(find_value(r.get_obj(), \"size\").get_int(), 193);\n    BOOST_CHECK_EQUAL(find_value(r.get_obj(), \"version\").get_int(), 1);\n    BOOST_CHECK_EQUAL(find_value(r.get_obj(), \"locktime\").get_int(), 0);\n    BOOST_CHECK_THROW(CallRPC(std::string(\"decoderawtransaction \")+rawtx+\" extra\"), std::runtime_error);\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"decoderawtransaction \")+rawtx+\" false\"));\n    BOOST_CHECK_THROW(r = CallRPC(std::string(\"decoderawtransaction \")+rawtx+\" false extra\"), std::runtime_error);\n\n    BOOST_CHECK_THROW(CallRPC(\"signrawtransaction\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"signrawtransaction null\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"signrawtransaction ff00\"), std::runtime_error);\n    BOOST_CHECK_NO_THROW(CallRPC(std::string(\"signrawtransaction \")+rawtx));\n    BOOST_CHECK_NO_THROW(CallRPC(std::string(\"signrawtransaction \")+rawtx+\" null null NONE|ANYONECANPAY\"));\n    BOOST_CHECK_NO_THROW(CallRPC(std::string(\"signrawtransaction \")+rawtx+\" [] [] NONE|ANYONECANPAY\"));\n    BOOST_CHECK_THROW(CallRPC(std::string(\"signrawtransaction \")+rawtx+\" null null badenum\"), std::runtime_error);\n\n    // Only check failure cases for sendrawtransaction, there's no network to send to...\n    BOOST_CHECK_THROW(CallRPC(\"sendrawtransaction\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"sendrawtransaction null\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"sendrawtransaction DEADBEEF\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(std::string(\"sendrawtransaction \")+rawtx+\" extra\"), std::runtime_error);\n}\n\nBOOST_AUTO_TEST_CASE(rpc_togglenetwork)\n{\n    UniValue r;\n\n    r = CallRPC(\"getnetworkinfo\");\n    bool netState = find_value(r.get_obj(), \"networkactive\").get_bool();\n    BOOST_CHECK_EQUAL(netState, true);\n\n    BOOST_CHECK_NO_THROW(CallRPC(\"setnetworkactive false\"));\n    r = CallRPC(\"getnetworkinfo\");\n    int numConnection = find_value(r.get_obj(), \"connections\").get_int();\n    BOOST_CHECK_EQUAL(numConnection, 0);\n\n    netState = find_value(r.get_obj(), \"networkactive\").get_bool();\n    BOOST_CHECK_EQUAL(netState, false);\n\n    BOOST_CHECK_NO_THROW(CallRPC(\"setnetworkactive true\"));\n    r = CallRPC(\"getnetworkinfo\");\n    netState = find_value(r.get_obj(), \"networkactive\").get_bool();\n    BOOST_CHECK_EQUAL(netState, true);\n}\n\nBOOST_AUTO_TEST_CASE(rpc_rawsign)\n{\n    UniValue r;\n    // input is a 1-of-2 multisig (so is output):\n    std::string prevout =\n      \"[{\\\"txid\\\":\\\"b4cc287e58f87cdae59417329f710f3ecd75a4ee1d2872b7248f50977c8493f3\\\",\"\n      \"\\\"vout\\\":1,\\\"scriptPubKey\\\":\\\"a914b10c9df5f7edf436c697f02f1efdba4cf399615187\\\",\"\n      \"\\\"redeemScript\\\":\\\"512103debedc17b3df2badbcdd86d5feb4562b86fe182e5998abd8bcd4f122c6155b1b21027e940bb73ab8732bfdf7f9216ecefca5b94d6df834e77e108f68e66f126044c052ae\\\"}]\";\n    r = CallRPC(std::string(\"createrawtransaction \")+prevout+\" \"+\n      \"{\\\"sZK1LsVdoyjjAMdMXQYtDAyH6N7RYnvNZq\\\":11}\");\n    std::string notsigned = r.get_str();\n    std::string privkey1 = \"\\\"KzsXybp9jX64P5ekX1KUxRQ79Jht9uzW7LorgwE65i5rWACL6LQe\\\"\";\n    std::string privkey2 = \"\\\"Kyhdf5LuKTRx4ge69ybABsiUAWjVRK4XGxAKk2FQLp2HjGMy87Z4\\\"\";\n    r = CallRPC(std::string(\"signrawtransaction \")+notsigned+\" \"+prevout+\" \"+\"[]\");\n    BOOST_CHECK(find_value(r.get_obj(), \"complete\").get_bool() == false);\n    r = CallRPC(std::string(\"signrawtransaction \")+notsigned+\" \"+prevout+\" \"+\"[\"+privkey1+\",\"+privkey2+\"]\");\n    BOOST_CHECK(find_value(r.get_obj(), \"complete\").get_bool() == true);\n}\n\nBOOST_AUTO_TEST_CASE(rpc_createraw_op_return)\n{\n    BOOST_CHECK_NO_THROW(CallRPC(\"createrawtransaction [{\\\"txid\\\":\\\"a3b807410df0b60fcb9736768df5823938b2f838694939ba45f3c0a1bff150ed\\\",\\\"vout\\\":0}] {\\\"data\\\":\\\"68656c6c6f776f726c64\\\"}\"));\n\n    // Allow more than one data transaction output\n    BOOST_CHECK_NO_THROW(CallRPC(\"createrawtransaction [{\\\"txid\\\":\\\"a3b807410df0b60fcb9736768df5823938b2f838694939ba45f3c0a1bff150ed\\\",\\\"vout\\\":0}] {\\\"data\\\":\\\"68656c6c6f776f726c64\\\",\\\"data\\\":\\\"68656c6c6f776f726c64\\\"}\"));\n\n    // Key not \"data\" (bad address)\n    BOOST_CHECK_THROW(CallRPC(\"createrawtransaction [{\\\"txid\\\":\\\"a3b807410df0b60fcb9736768df5823938b2f838694939ba45f3c0a1bff150ed\\\",\\\"vout\\\":0}] {\\\"somedata\\\":\\\"68656c6c6f776f726c64\\\"}\"), std::runtime_error);\n\n    // Bad hex encoding of data output\n    BOOST_CHECK_THROW(CallRPC(\"createrawtransaction [{\\\"txid\\\":\\\"a3b807410df0b60fcb9736768df5823938b2f838694939ba45f3c0a1bff150ed\\\",\\\"vout\\\":0}] {\\\"data\\\":\\\"12345\\\"}\"), std::runtime_error);\n    BOOST_CHECK_THROW(CallRPC(\"createrawtransaction [{\\\"txid\\\":\\\"a3b807410df0b60fcb9736768df5823938b2f838694939ba45f3c0a1bff150ed\\\",\\\"vout\\\":0}] {\\\"data\\\":\\\"12345g\\\"}\"), std::runtime_error);\n\n    // Data 81 bytes long\n    BOOST_CHECK_NO_THROW(CallRPC(\"createrawtransaction [{\\\"txid\\\":\\\"a3b807410df0b60fcb9736768df5823938b2f838694939ba45f3c0a1bff150ed\\\",\\\"vout\\\":0}] {\\\"data\\\":\\\"010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081\\\"}\"));\n}\n\nBOOST_AUTO_TEST_CASE(rpc_format_monetary_values)\n{\n    BOOST_CHECK(ValueFromAmount(0LL).write() == \"0.00000000\");\n    BOOST_CHECK(ValueFromAmount(1LL).write() == \"0.00000001\");\n    BOOST_CHECK(ValueFromAmount(17622195LL).write() == \"0.17622195\");\n    BOOST_CHECK(ValueFromAmount(50000000LL).write() == \"0.50000000\");\n    BOOST_CHECK(ValueFromAmount(89898989LL).write() == \"0.89898989\");\n    BOOST_CHECK(ValueFromAmount(100000000LL).write() == \"1.00000000\");\n    BOOST_CHECK(ValueFromAmount(2099999999999990LL).write() == \"20999999.99999990\");\n    BOOST_CHECK(ValueFromAmount(2099999999999999LL).write() == \"20999999.99999999\");\n\n    BOOST_CHECK_EQUAL(ValueFromAmount(0).write(), \"0.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount((COIN/10000)*123456789).write(), \"12345.67890000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(-COIN).write(), \"-1.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(-COIN/10).write(), \"-0.10000000\");\n\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN*100000000).write(), \"100000000.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN*10000000).write(), \"10000000.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN*1000000).write(), \"1000000.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN*100000).write(), \"100000.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN*10000).write(), \"10000.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN*1000).write(), \"1000.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN*100).write(), \"100.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN*10).write(), \"10.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN).write(), \"1.00000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN/10).write(), \"0.10000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN/100).write(), \"0.01000000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN/1000).write(), \"0.00100000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN/10000).write(), \"0.00010000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN/100000).write(), \"0.00001000\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN/1000000).write(), \"0.00000100\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN/10000000).write(), \"0.00000010\");\n    BOOST_CHECK_EQUAL(ValueFromAmount(COIN/100000000).write(), \"0.00000001\");\n}\n\nstatic UniValue ValueFromString(const std::string &str)\n{\n    UniValue value;\n    BOOST_CHECK(value.setNumStr(str));\n    return value;\n}\n\nBOOST_AUTO_TEST_CASE(rpc_parse_monetary_values)\n{\n    BOOST_CHECK_THROW(AmountFromValue(ValueFromString(\"-0.00000001\")), UniValue);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0\")), 0LL);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.00000000\")), 0LL);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.00000001\")), 1LL);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.17622195\")), 17622195LL);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.5\")), 50000000LL);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.50000000\")), 50000000LL);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.89898989\")), 89898989LL);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"1.00000000\")), 100000000LL);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"20999999.9999999\")), 2099999999999990LL);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"20999999.99999999\")), 2099999999999999LL);\n\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"1e-8\")), COIN/100000000);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.1e-7\")), COIN/100000000);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.01e-6\")), COIN/100000000);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.0000000000000000000000000000000000000000000000000000000000000000000000000001e+68\")), COIN/100000000);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"10000000000000000000000000000000000000000000000000000000000000000e-64\")), COIN);\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000e64\")), COIN);\n\n    BOOST_CHECK_THROW(AmountFromValue(ValueFromString(\"1e-9\")), UniValue); //should fail\n    BOOST_CHECK_THROW(AmountFromValue(ValueFromString(\"0.000000019\")), UniValue); //should fail\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.00000001000000\")), 1LL); //should pass, cut trailing 0\n    BOOST_CHECK_THROW(AmountFromValue(ValueFromString(\"19e-9\")), UniValue); //should fail\n    BOOST_CHECK_EQUAL(AmountFromValue(ValueFromString(\"0.19e-6\")), 19); //should pass, leading 0 is present\n\n    BOOST_CHECK_THROW(AmountFromValue(ValueFromString(\"92233720368.54775808\")), UniValue); //overflow error\n    BOOST_CHECK_THROW(AmountFromValue(ValueFromString(\"1e+11\")), UniValue); //overflow error\n    BOOST_CHECK_THROW(AmountFromValue(ValueFromString(\"1e11\")), UniValue); //overflow error signless\n    BOOST_CHECK_THROW(AmountFromValue(ValueFromString(\"93e+9\")), UniValue); //overflow error\n}\n\nBOOST_AUTO_TEST_CASE(json_parse_errors)\n{\n    // Valid\n    BOOST_CHECK_EQUAL(ParseNonRFCJSONValue(\"1.0\").get_real(), 1.0);\n    // Valid, with leading or trailing whitespace\n    BOOST_CHECK_EQUAL(ParseNonRFCJSONValue(\" 1.0\").get_real(), 1.0);\n    BOOST_CHECK_EQUAL(ParseNonRFCJSONValue(\"1.0 \").get_real(), 1.0);\n\n    BOOST_CHECK_THROW(AmountFromValue(ParseNonRFCJSONValue(\".19e-6\")), std::runtime_error); //should fail, missing leading 0, therefore invalid JSON\n    BOOST_CHECK_EQUAL(AmountFromValue(ParseNonRFCJSONValue(\"0.00000000000000000000000000000000000001e+30 \")), 1);\n    // Invalid, initial garbage\n    BOOST_CHECK_THROW(ParseNonRFCJSONValue(\"[1.0\"), std::runtime_error);\n    BOOST_CHECK_THROW(ParseNonRFCJSONValue(\"a1.0\"), std::runtime_error);\n    // Invalid, trailing garbage\n    BOOST_CHECK_THROW(ParseNonRFCJSONValue(\"1.0sds\"), std::runtime_error);\n    BOOST_CHECK_THROW(ParseNonRFCJSONValue(\"1.0]\"), std::runtime_error);\n    // BTC addresses should fail parsing\n    BOOST_CHECK_THROW(ParseNonRFCJSONValue(\"175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W\"), std::runtime_error);\n    BOOST_CHECK_THROW(ParseNonRFCJSONValue(\"3J98t1WpEZ73CNmQviecrnyiWrnqRhWNL\"), std::runtime_error);\n}\n\nBOOST_AUTO_TEST_CASE(rpc_ban)\n{\n    BOOST_CHECK_NO_THROW(CallRPC(std::string(\"clearbanned\")));\n\n    UniValue r;\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"setban 127.0.0.0 add\")));\n    BOOST_CHECK_THROW(r = CallRPC(std::string(\"setban 127.0.0.0:8334\")), std::runtime_error); //portnumber for setban not allowed\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"listbanned\")));\n    UniValue ar = r.get_array();\n    UniValue o1 = ar[0].get_obj();\n    UniValue adr = find_value(o1, \"address\");\n    BOOST_CHECK_EQUAL(adr.get_str(), \"127.0.0.0/32\");\n    BOOST_CHECK_NO_THROW(CallRPC(std::string(\"setban 127.0.0.0 remove\")));\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"listbanned\")));\n    ar = r.get_array();\n    BOOST_CHECK_EQUAL(ar.size(), 0);\n\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"setban 127.0.0.0/24 add 9907731200 true\")));\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"listbanned\")));\n    ar = r.get_array();\n    o1 = ar[0].get_obj();\n    adr = find_value(o1, \"address\");\n    UniValue banned_until = find_value(o1, \"banned_until\");\n    BOOST_CHECK_EQUAL(adr.get_str(), \"127.0.0.0/24\");\n    BOOST_CHECK_EQUAL(banned_until.get_int64(), 9907731200); // absolute time check\n\n    BOOST_CHECK_NO_THROW(CallRPC(std::string(\"clearbanned\")));\n\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"setban 127.0.0.0/24 add 200\")));\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"listbanned\")));\n    ar = r.get_array();\n    o1 = ar[0].get_obj();\n    adr = find_value(o1, \"address\");\n    banned_until = find_value(o1, \"banned_until\");\n    BOOST_CHECK_EQUAL(adr.get_str(), \"127.0.0.0/24\");\n    int64_t now = GetTime();\n    BOOST_CHECK(banned_until.get_int64() > now);\n    BOOST_CHECK(banned_until.get_int64()-now <= 200);\n\n    // must throw an exception because 127.0.0.1 is in already banned subnet range\n    BOOST_CHECK_THROW(r = CallRPC(std::string(\"setban 127.0.0.1 add\")), std::runtime_error);\n\n    BOOST_CHECK_NO_THROW(CallRPC(std::string(\"setban 127.0.0.0/24 remove\")));\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"listbanned\")));\n    ar = r.get_array();\n    BOOST_CHECK_EQUAL(ar.size(), 0);\n\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"setban 127.0.0.0/255.255.0.0 add\")));\n    BOOST_CHECK_THROW(r = CallRPC(std::string(\"setban 127.0.1.1 add\")), std::runtime_error);\n\n    BOOST_CHECK_NO_THROW(CallRPC(std::string(\"clearbanned\")));\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"listbanned\")));\n    ar = r.get_array();\n    BOOST_CHECK_EQUAL(ar.size(), 0);\n\n\n    BOOST_CHECK_THROW(r = CallRPC(std::string(\"setban test add\")), std::runtime_error); //invalid IP\n\n    //IPv6 tests\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"setban FE80:0000:0000:0000:0202:B3FF:FE1E:8329 add\")));\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"listbanned\")));\n    ar = r.get_array();\n    o1 = ar[0].get_obj();\n    adr = find_value(o1, \"address\");\n    BOOST_CHECK_EQUAL(adr.get_str(), \"fe80::202:b3ff:fe1e:8329/128\");\n\n    BOOST_CHECK_NO_THROW(CallRPC(std::string(\"clearbanned\")));\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"setban 2001:db8::/ffff:fffc:0:0:0:0:0:0 add\")));\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"listbanned\")));\n    ar = r.get_array();\n    o1 = ar[0].get_obj();\n    adr = find_value(o1, \"address\");\n    BOOST_CHECK_EQUAL(adr.get_str(), \"2001:db8::/30\");\n\n    BOOST_CHECK_NO_THROW(CallRPC(std::string(\"clearbanned\")));\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"setban 2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/128 add\")));\n    BOOST_CHECK_NO_THROW(r = CallRPC(std::string(\"listbanned\")));\n    ar = r.get_array();\n    o1 = ar[0].get_obj();\n    adr = find_value(o1, \"address\");\n    BOOST_CHECK_EQUAL(adr.get_str(), \"2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/128\");\n}\n\nBOOST_AUTO_TEST_CASE(rpc_convert_values_generatetoaddress)\n{\n    UniValue result;\n\n    BOOST_CHECK_NO_THROW(result = RPCConvertValues(\"generatetoaddress\", {\"101\", \"mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a\"}));\n    BOOST_CHECK_EQUAL(result[0].get_int(), 101);\n    BOOST_CHECK_EQUAL(result[1].get_str(), \"mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a\");\n\n    BOOST_CHECK_NO_THROW(result = RPCConvertValues(\"generatetoaddress\", {\"101\", \"mhMbmE2tE9xzJYCV9aNC8jKWN31vtGrguU\"}));\n    BOOST_CHECK_EQUAL(result[0].get_int(), 101);\n    BOOST_CHECK_EQUAL(result[1].get_str(), \"mhMbmE2tE9xzJYCV9aNC8jKWN31vtGrguU\");\n\n    BOOST_CHECK_NO_THROW(result = RPCConvertValues(\"generatetoaddress\", {\"1\", \"mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a\", \"9\"}));\n    BOOST_CHECK_EQUAL(result[0].get_int(), 1);\n    BOOST_CHECK_EQUAL(result[1].get_str(), \"mkESjLZW66TmHhiFX8MCaBjrhZ543PPh9a\");\n    BOOST_CHECK_EQUAL(result[2].get_int(), 9);\n\n    BOOST_CHECK_NO_THROW(result = RPCConvertValues(\"generatetoaddress\", {\"1\", \"mhMbmE2tE9xzJYCV9aNC8jKWN31vtGrguU\", \"9\"}));\n    BOOST_CHECK_EQUAL(result[0].get_int(), 1);\n    BOOST_CHECK_EQUAL(result[1].get_str(), \"mhMbmE2tE9xzJYCV9aNC8jKWN31vtGrguU\");\n    BOOST_CHECK_EQUAL(result[2].get_int(), 9);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/sanity_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <compat/sanity.h>\n#include <key.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(basic_sanity)\n{\n  BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, \"libc sanity test\");\n  BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, \"stdlib sanity test\");\n  BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, \"openssl ECC test\");\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/scheduler_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <random.h>\n#include <scheduler.h>\n\n#include <test/test_bitcoin.h>\n\n#include <boost/bind.hpp>\n#include <boost/thread.hpp>\n#include <boost/test/unit_test.hpp>\n\nBOOST_AUTO_TEST_SUITE(scheduler_tests)\n\nstatic void microTask(CScheduler& s, boost::mutex& mutex, int& counter, int delta, boost::chrono::system_clock::time_point rescheduleTime)\n{\n    {\n        boost::unique_lock<boost::mutex> lock(mutex);\n        counter += delta;\n    }\n    boost::chrono::system_clock::time_point noTime = boost::chrono::system_clock::time_point::min();\n    if (rescheduleTime != noTime) {\n        CScheduler::Function f = boost::bind(&microTask, boost::ref(s), boost::ref(mutex), boost::ref(counter), -delta + 1, noTime);\n        s.schedule(f, rescheduleTime);\n    }\n}\n\nstatic void MicroSleep(uint64_t n)\n{\n#if defined(HAVE_WORKING_BOOST_SLEEP_FOR)\n    boost::this_thread::sleep_for(boost::chrono::microseconds(n));\n#elif defined(HAVE_WORKING_BOOST_SLEEP)\n    boost::this_thread::sleep(boost::posix_time::microseconds(n));\n#else\n    //should never get here\n    #error missing boost sleep implementation\n#endif\n}\n\nBOOST_AUTO_TEST_CASE(manythreads)\n{\n    // Stress test: hundreds of microsecond-scheduled tasks,\n    // serviced by 10 threads.\n    //\n    // So... ten shared counters, which if all the tasks execute\n    // properly will sum to the number of tasks done.\n    // Each task adds or subtracts a random amount from one of the\n    // counters, and then schedules another task 0-1000\n    // microseconds in the future to subtract or add from\n    // the counter -random_amount+1, so in the end the shared\n    // counters should sum to the number of initial tasks performed.\n    CScheduler microTasks;\n\n    boost::mutex counterMutex[10];\n    int counter[10] = { 0 };\n    FastRandomContext rng(42);\n    auto zeroToNine = [](FastRandomContext& rc) -> int { return rc.randrange(10); }; // [0, 9]\n    auto randomMsec = [](FastRandomContext& rc) -> int { return -11 + rc.randrange(1012); }; // [-11, 1000]\n    auto randomDelta = [](FastRandomContext& rc) -> int { return -1000 + rc.randrange(2001); }; // [-1000, 1000]\n\n    boost::chrono::system_clock::time_point start = boost::chrono::system_clock::now();\n    boost::chrono::system_clock::time_point now = start;\n    boost::chrono::system_clock::time_point first, last;\n    size_t nTasks = microTasks.getQueueInfo(first, last);\n    BOOST_CHECK(nTasks == 0);\n\n    for (int i = 0; i < 100; i++) {\n        boost::chrono::system_clock::time_point t = now + boost::chrono::microseconds(randomMsec(rng));\n        boost::chrono::system_clock::time_point tReschedule = now + boost::chrono::microseconds(500 + randomMsec(rng));\n        int whichCounter = zeroToNine(rng);\n        CScheduler::Function f = boost::bind(&microTask, boost::ref(microTasks),\n                                             boost::ref(counterMutex[whichCounter]), boost::ref(counter[whichCounter]),\n                                             randomDelta(rng), tReschedule);\n        microTasks.schedule(f, t);\n    }\n    nTasks = microTasks.getQueueInfo(first, last);\n    BOOST_CHECK(nTasks == 100);\n    BOOST_CHECK(first < last);\n    BOOST_CHECK(last > now);\n\n    // As soon as these are created they will start running and servicing the queue\n    boost::thread_group microThreads;\n    for (int i = 0; i < 5; i++)\n        microThreads.create_thread(boost::bind(&CScheduler::serviceQueue, &microTasks));\n\n    MicroSleep(600);\n    now = boost::chrono::system_clock::now();\n\n    // More threads and more tasks:\n    for (int i = 0; i < 5; i++)\n        microThreads.create_thread(boost::bind(&CScheduler::serviceQueue, &microTasks));\n    for (int i = 0; i < 100; i++) {\n        boost::chrono::system_clock::time_point t = now + boost::chrono::microseconds(randomMsec(rng));\n        boost::chrono::system_clock::time_point tReschedule = now + boost::chrono::microseconds(500 + randomMsec(rng));\n        int whichCounter = zeroToNine(rng);\n        CScheduler::Function f = boost::bind(&microTask, boost::ref(microTasks),\n                                             boost::ref(counterMutex[whichCounter]), boost::ref(counter[whichCounter]),\n                                             randomDelta(rng), tReschedule);\n        microTasks.schedule(f, t);\n    }\n\n    // Drain the task queue then exit threads\n    microTasks.stop(true);\n    microThreads.join_all(); // ... wait until all the threads are done\n\n    int counterSum = 0;\n    for (int i = 0; i < 10; i++) {\n        BOOST_CHECK(counter[i] != 0);\n        counterSum += counter[i];\n    }\n    BOOST_CHECK_EQUAL(counterSum, 200);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/script_P2SH_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <consensus/tx_verify.h>\n#include <core_io.h>\n#include <key.h>\n#include <keystore.h>\n#include <validation.h>\n#include <policy/policy.h>\n#include <script/script.h>\n#include <script/script_error.h>\n#include <script/sign.h>\n#include <script/ismine.h>\n#include <test/test_bitcoin.h>\n\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n\n// Helpers:\nstatic std::vector<unsigned char>\nSerialize(const CScript& s)\n{\n    std::vector<unsigned char> sSerialized(s.begin(), s.end());\n    return sSerialized;\n}\n\nstatic bool\nVerify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict, ScriptError& err)\n{\n    // Create dummy to/from transactions:\n    CMutableTransaction txFrom;\n    txFrom.vout.resize(1);\n    txFrom.vout[0].scriptPubKey = scriptPubKey;\n\n    CMutableTransaction txTo;\n    txTo.vin.resize(1);\n    txTo.vout.resize(1);\n    txTo.vin[0].prevout.n = 0;\n    txTo.vin[0].prevout.hash = txFrom.GetHash();\n    txTo.vin[0].scriptSig = scriptSig;\n    txTo.vout[0].nValue = 1;\n\n    return VerifyScript(scriptSig, scriptPubKey, nullptr, fStrict ? SCRIPT_VERIFY_P2SH : SCRIPT_VERIFY_NONE, MutableTransactionSignatureChecker(&txTo, 0, txFrom.vout[0].nValue), &err);\n}\n\n\nBOOST_FIXTURE_TEST_SUITE(script_P2SH_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(sign)\n{\n    LOCK(cs_main);\n    // Pay-to-script-hash looks like this:\n    // scriptSig:    <sig> <sig...> <serialized_script>\n    // scriptPubKey: HASH160 <hash> EQUAL\n\n    // Test SignSignature() (and therefore the version of Solver() that signs transactions)\n    CBasicKeyStore keystore;\n    CKey key[4];\n    for (int i = 0; i < 4; i++)\n    {\n        key[i].MakeNewKey(true);\n        keystore.AddKey(key[i]);\n    }\n\n    // 8 Scripts: checking all combinations of\n    // different keys, straight/P2SH, pubkey/pubkeyhash\n    CScript standardScripts[4];\n    standardScripts[0] << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG;\n    standardScripts[1] = GetScriptForDestination(key[1].GetPubKey().GetID());\n    standardScripts[2] << ToByteVector(key[1].GetPubKey()) << OP_CHECKSIG;\n    standardScripts[3] = GetScriptForDestination(key[2].GetPubKey().GetID());\n    CScript evalScripts[4];\n    for (int i = 0; i < 4; i++)\n    {\n        keystore.AddCScript(standardScripts[i]);\n        evalScripts[i] = GetScriptForDestination(CScriptID(standardScripts[i]));\n    }\n\n    CMutableTransaction txFrom;  // Funding transaction:\n    std::string reason;\n    txFrom.vout.resize(8);\n    for (int i = 0; i < 4; i++)\n    {\n        txFrom.vout[i].scriptPubKey = evalScripts[i];\n        txFrom.vout[i].nValue = COIN;\n        txFrom.vout[i+4].scriptPubKey = standardScripts[i];\n        txFrom.vout[i+4].nValue = COIN;\n    }\n    BOOST_CHECK(IsStandardTx(txFrom, reason));\n\n    CMutableTransaction txTo[8]; // Spending transactions\n    for (int i = 0; i < 8; i++)\n    {\n        txTo[i].vin.resize(1);\n        txTo[i].vout.resize(1);\n        txTo[i].vin[0].prevout.n = i;\n        txTo[i].vin[0].prevout.hash = txFrom.GetHash();\n        txTo[i].vout[0].nValue = 1;\n        BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf(\"IsMine %d\", i));\n    }\n    for (int i = 0; i < 8; i++)\n    {\n        BOOST_CHECK_MESSAGE(SignSignature(keystore, txFrom, txTo[i], 0, SIGHASH_ALL), strprintf(\"SignSignature %d\", i));\n    }\n    // All of the above should be OK, and the txTos have valid signatures\n    // Check to make sure signature verification fails if we use the wrong ScriptSig:\n    for (int i = 0; i < 8; i++) {\n        PrecomputedTransactionData txdata(txTo[i]);\n        for (int j = 0; j < 8; j++)\n        {\n            CScript sigSave = txTo[i].vin[0].scriptSig;\n            txTo[i].vin[0].scriptSig = txTo[j].vin[0].scriptSig;\n            bool sigOK = CScriptCheck(txFrom.vout[txTo[i].vin[0].prevout.n], txTo[i], 0, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, false, &txdata)();\n            if (i == j)\n                BOOST_CHECK_MESSAGE(sigOK, strprintf(\"VerifySignature %d %d\", i, j));\n            else\n                BOOST_CHECK_MESSAGE(!sigOK, strprintf(\"VerifySignature %d %d\", i, j));\n            txTo[i].vin[0].scriptSig = sigSave;\n        }\n    }\n}\n\nBOOST_AUTO_TEST_CASE(norecurse)\n{\n    ScriptError err;\n    // Make sure only the outer pay-to-script-hash does the\n    // extra-validation thing:\n    CScript invalidAsScript;\n    invalidAsScript << OP_INVALIDOPCODE << OP_INVALIDOPCODE;\n\n    CScript p2sh = GetScriptForDestination(CScriptID(invalidAsScript));\n\n    CScript scriptSig;\n    scriptSig << Serialize(invalidAsScript);\n\n    // Should not verify, because it will try to execute OP_INVALIDOPCODE\n    BOOST_CHECK(!Verify(scriptSig, p2sh, true, err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_BAD_OPCODE, ScriptErrorString(err));\n\n    // Try to recur, and verification should succeed because\n    // the inner HASH160 <> EQUAL should only check the hash:\n    CScript p2sh2 = GetScriptForDestination(CScriptID(p2sh));\n    CScript scriptSig2;\n    scriptSig2 << Serialize(invalidAsScript) << Serialize(p2sh);\n\n    BOOST_CHECK(Verify(scriptSig2, p2sh2, true, err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n}\n\nBOOST_AUTO_TEST_CASE(set)\n{\n    LOCK(cs_main);\n    // Test the CScript::Set* methods\n    CBasicKeyStore keystore;\n    CKey key[4];\n    std::vector<CPubKey> keys;\n    for (int i = 0; i < 4; i++)\n    {\n        key[i].MakeNewKey(true);\n        keystore.AddKey(key[i]);\n        keys.push_back(key[i].GetPubKey());\n    }\n\n    CScript inner[4];\n    inner[0] = GetScriptForDestination(key[0].GetPubKey().GetID());\n    inner[1] = GetScriptForMultisig(2, std::vector<CPubKey>(keys.begin(), keys.begin()+2));\n    inner[2] = GetScriptForMultisig(1, std::vector<CPubKey>(keys.begin(), keys.begin()+2));\n    inner[3] = GetScriptForMultisig(2, std::vector<CPubKey>(keys.begin(), keys.begin()+3));\n\n    CScript outer[4];\n    for (int i = 0; i < 4; i++)\n    {\n        outer[i] = GetScriptForDestination(CScriptID(inner[i]));\n        keystore.AddCScript(inner[i]);\n    }\n\n    CMutableTransaction txFrom;  // Funding transaction:\n    std::string reason;\n    txFrom.vout.resize(4);\n    for (int i = 0; i < 4; i++)\n    {\n        txFrom.vout[i].scriptPubKey = outer[i];\n        txFrom.vout[i].nValue = CENT;\n    }\n    BOOST_CHECK(IsStandardTx(txFrom, reason));\n\n    CMutableTransaction txTo[4]; // Spending transactions\n    for (int i = 0; i < 4; i++)\n    {\n        txTo[i].vin.resize(1);\n        txTo[i].vout.resize(1);\n        txTo[i].vin[0].prevout.n = i;\n        txTo[i].vin[0].prevout.hash = txFrom.GetHash();\n        txTo[i].vout[0].nValue = 1*CENT;\n        txTo[i].vout[0].scriptPubKey = inner[i];\n        BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf(\"IsMine %d\", i));\n    }\n    for (int i = 0; i < 4; i++)\n    {\n        BOOST_CHECK_MESSAGE(SignSignature(keystore, txFrom, txTo[i], 0, SIGHASH_ALL), strprintf(\"SignSignature %d\", i));\n        BOOST_CHECK_MESSAGE(IsStandardTx(txTo[i], reason), strprintf(\"txTo[%d].IsStandard\", i));\n    }\n}\n\nBOOST_AUTO_TEST_CASE(is)\n{\n    // Test CScript::IsPayToScriptHash()\n    uint160 dummy;\n    CScript p2sh;\n    p2sh << OP_HASH160 << ToByteVector(dummy) << OP_EQUAL;\n    BOOST_CHECK(p2sh.IsPayToScriptHash());\n\n    // Not considered pay-to-script-hash if using one of the OP_PUSHDATA opcodes:\n    static const unsigned char direct[] =    { OP_HASH160, 20, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, OP_EQUAL };\n    BOOST_CHECK(CScript(direct, direct+sizeof(direct)).IsPayToScriptHash());\n    static const unsigned char pushdata1[] = { OP_HASH160, OP_PUSHDATA1, 20, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, OP_EQUAL };\n    BOOST_CHECK(!CScript(pushdata1, pushdata1+sizeof(pushdata1)).IsPayToScriptHash());\n    static const unsigned char pushdata2[] = { OP_HASH160, OP_PUSHDATA2, 20,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, OP_EQUAL };\n    BOOST_CHECK(!CScript(pushdata2, pushdata2+sizeof(pushdata2)).IsPayToScriptHash());\n    static const unsigned char pushdata4[] = { OP_HASH160, OP_PUSHDATA4, 20,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, OP_EQUAL };\n    BOOST_CHECK(!CScript(pushdata4, pushdata4+sizeof(pushdata4)).IsPayToScriptHash());\n\n    CScript not_p2sh;\n    BOOST_CHECK(!not_p2sh.IsPayToScriptHash());\n\n    not_p2sh.clear(); not_p2sh << OP_HASH160 << ToByteVector(dummy) << ToByteVector(dummy) << OP_EQUAL;\n    BOOST_CHECK(!not_p2sh.IsPayToScriptHash());\n\n    not_p2sh.clear(); not_p2sh << OP_NOP << ToByteVector(dummy) << OP_EQUAL;\n    BOOST_CHECK(!not_p2sh.IsPayToScriptHash());\n\n    not_p2sh.clear(); not_p2sh << OP_HASH160 << ToByteVector(dummy) << OP_CHECKSIG;\n    BOOST_CHECK(!not_p2sh.IsPayToScriptHash());\n}\n\nBOOST_AUTO_TEST_CASE(switchover)\n{\n    // Test switch over code\n    CScript notValid;\n    ScriptError err;\n    notValid << OP_11 << OP_12 << OP_EQUALVERIFY;\n    CScript scriptSig;\n    scriptSig << Serialize(notValid);\n\n    CScript fund = GetScriptForDestination(CScriptID(notValid));\n\n\n    // Validation should succeed under old rules (hash is correct):\n    BOOST_CHECK(Verify(scriptSig, fund, false, err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n    // Fail under new:\n    BOOST_CHECK(!Verify(scriptSig, fund, true, err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EQUALVERIFY, ScriptErrorString(err));\n}\n\nBOOST_AUTO_TEST_CASE(AreInputsStandard)\n{\n    LOCK(cs_main);\n    CCoinsView coinsDummy;\n    CCoinsViewCache coins(&coinsDummy);\n    CBasicKeyStore keystore;\n    CKey key[6];\n    std::vector<CPubKey> keys;\n    for (int i = 0; i < 6; i++)\n    {\n        key[i].MakeNewKey(true);\n        keystore.AddKey(key[i]);\n    }\n    for (int i = 0; i < 3; i++)\n        keys.push_back(key[i].GetPubKey());\n\n    CMutableTransaction txFrom;\n    txFrom.vout.resize(7);\n\n    // First three are standard:\n    CScript pay1 = GetScriptForDestination(key[0].GetPubKey().GetID());\n    keystore.AddCScript(pay1);\n    CScript pay1of3 = GetScriptForMultisig(1, keys);\n\n    txFrom.vout[0].scriptPubKey = GetScriptForDestination(CScriptID(pay1)); // P2SH (OP_CHECKSIG)\n    txFrom.vout[0].nValue = 1000;\n    txFrom.vout[1].scriptPubKey = pay1; // ordinary OP_CHECKSIG\n    txFrom.vout[1].nValue = 2000;\n    txFrom.vout[2].scriptPubKey = pay1of3; // ordinary OP_CHECKMULTISIG\n    txFrom.vout[2].nValue = 3000;\n\n    // vout[3] is complicated 1-of-3 AND 2-of-3\n    // ... that is OK if wrapped in P2SH:\n    CScript oneAndTwo;\n    oneAndTwo << OP_1 << ToByteVector(key[0].GetPubKey()) << ToByteVector(key[1].GetPubKey()) << ToByteVector(key[2].GetPubKey());\n    oneAndTwo << OP_3 << OP_CHECKMULTISIGVERIFY;\n    oneAndTwo << OP_2 << ToByteVector(key[3].GetPubKey()) << ToByteVector(key[4].GetPubKey()) << ToByteVector(key[5].GetPubKey());\n    oneAndTwo << OP_3 << OP_CHECKMULTISIG;\n    keystore.AddCScript(oneAndTwo);\n    txFrom.vout[3].scriptPubKey = GetScriptForDestination(CScriptID(oneAndTwo));\n    txFrom.vout[3].nValue = 4000;\n\n    // vout[4] is max sigops:\n    CScript fifteenSigops; fifteenSigops << OP_1;\n    for (unsigned i = 0; i < MAX_P2SH_SIGOPS; i++)\n        fifteenSigops << ToByteVector(key[i%3].GetPubKey());\n    fifteenSigops << OP_15 << OP_CHECKMULTISIG;\n    keystore.AddCScript(fifteenSigops);\n    txFrom.vout[4].scriptPubKey = GetScriptForDestination(CScriptID(fifteenSigops));\n    txFrom.vout[4].nValue = 5000;\n\n    // vout[5/6] are non-standard because they exceed MAX_P2SH_SIGOPS\n    CScript sixteenSigops; sixteenSigops << OP_16 << OP_CHECKMULTISIG;\n    keystore.AddCScript(sixteenSigops);\n    txFrom.vout[5].scriptPubKey = GetScriptForDestination(CScriptID(fifteenSigops));\n    txFrom.vout[5].nValue = 5000;\n    CScript twentySigops; twentySigops << OP_CHECKMULTISIG;\n    keystore.AddCScript(twentySigops);\n    txFrom.vout[6].scriptPubKey = GetScriptForDestination(CScriptID(twentySigops));\n    txFrom.vout[6].nValue = 6000;\n\n    AddCoins(coins, txFrom, 0);\n\n    CMutableTransaction txTo;\n    txTo.vout.resize(1);\n    txTo.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID());\n\n    txTo.vin.resize(5);\n    for (int i = 0; i < 5; i++)\n    {\n        txTo.vin[i].prevout.n = i;\n        txTo.vin[i].prevout.hash = txFrom.GetHash();\n    }\n    BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 0, SIGHASH_ALL));\n    BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 1, SIGHASH_ALL));\n    BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 2, SIGHASH_ALL));\n    // SignSignature doesn't know how to sign these. We're\n    // not testing validating signatures, so just create\n    // dummy signatures that DO include the correct P2SH scripts:\n    txTo.vin[3].scriptSig << OP_11 << OP_11 << std::vector<unsigned char>(oneAndTwo.begin(), oneAndTwo.end());\n    txTo.vin[4].scriptSig << std::vector<unsigned char>(fifteenSigops.begin(), fifteenSigops.end());\n\n    BOOST_CHECK(::AreInputsStandard(txTo, coins));\n    // 22 P2SH sigops for all inputs (1 for vin[0], 6 for vin[3], 15 for vin[4]\n    BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txTo, coins), 22U);\n\n    CMutableTransaction txToNonStd1;\n    txToNonStd1.vout.resize(1);\n    txToNonStd1.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID());\n    txToNonStd1.vout[0].nValue = 1000;\n    txToNonStd1.vin.resize(1);\n    txToNonStd1.vin[0].prevout.n = 5;\n    txToNonStd1.vin[0].prevout.hash = txFrom.GetHash();\n    txToNonStd1.vin[0].scriptSig << std::vector<unsigned char>(sixteenSigops.begin(), sixteenSigops.end());\n\n    BOOST_CHECK(!::AreInputsStandard(txToNonStd1, coins));\n    BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txToNonStd1, coins), 16U);\n\n    CMutableTransaction txToNonStd2;\n    txToNonStd2.vout.resize(1);\n    txToNonStd2.vout[0].scriptPubKey = GetScriptForDestination(key[1].GetPubKey().GetID());\n    txToNonStd2.vout[0].nValue = 1000;\n    txToNonStd2.vin.resize(1);\n    txToNonStd2.vin[0].prevout.n = 6;\n    txToNonStd2.vin[0].prevout.hash = txFrom.GetHash();\n    txToNonStd2.vin[0].scriptSig << std::vector<unsigned char>(twentySigops.begin(), twentySigops.end());\n\n    BOOST_CHECK(!::AreInputsStandard(txToNonStd2, coins));\n    BOOST_CHECK_EQUAL(GetP2SHSigOpCount(txToNonStd2, coins), 20U);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/script_standard_tests.cpp",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <key.h>\n#include <keystore.h>\n#include <script/ismine.h>\n#include <script/script.h>\n#include <script/script_error.h>\n#include <script/standard.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\n\nBOOST_FIXTURE_TEST_SUITE(script_standard_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(script_standard_Solver_success)\n{\n    CKey keys[3];\n    CPubKey pubkeys[3];\n    for (int i = 0; i < 3; i++) {\n        keys[i].MakeNewKey(true);\n        pubkeys[i] = keys[i].GetPubKey();\n    }\n\n    CScript s;\n    txnouttype whichType;\n    std::vector<std::vector<unsigned char> > solutions;\n\n    // TX_PUBKEY\n    s.clear();\n    s << ToByteVector(pubkeys[0]) << OP_CHECKSIG;\n    BOOST_CHECK(Solver(s, whichType, solutions));\n    BOOST_CHECK_EQUAL(whichType, TX_PUBKEY);\n    BOOST_CHECK_EQUAL(solutions.size(), 1);\n    BOOST_CHECK(solutions[0] == ToByteVector(pubkeys[0]));\n\n    // TX_PUBKEYHASH\n    s.clear();\n    s << OP_DUP << OP_HASH160 << ToByteVector(pubkeys[0].GetID()) << OP_EQUALVERIFY << OP_CHECKSIG;\n    BOOST_CHECK(Solver(s, whichType, solutions));\n    BOOST_CHECK_EQUAL(whichType, TX_PUBKEYHASH);\n    BOOST_CHECK_EQUAL(solutions.size(), 1);\n    BOOST_CHECK(solutions[0] == ToByteVector(pubkeys[0].GetID()));\n\n    // TX_SCRIPTHASH\n    CScript redeemScript(s); // initialize with leftover P2PKH script\n    s.clear();\n    s << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL;\n    BOOST_CHECK(Solver(s, whichType, solutions));\n    BOOST_CHECK_EQUAL(whichType, TX_SCRIPTHASH);\n    BOOST_CHECK_EQUAL(solutions.size(), 1);\n    BOOST_CHECK(solutions[0] == ToByteVector(CScriptID(redeemScript)));\n\n    // TX_MULTISIG\n    s.clear();\n    s << OP_1 <<\n        ToByteVector(pubkeys[0]) <<\n        ToByteVector(pubkeys[1]) <<\n        OP_2 << OP_CHECKMULTISIG;\n    BOOST_CHECK(Solver(s, whichType, solutions));\n    BOOST_CHECK_EQUAL(whichType, TX_MULTISIG);\n    BOOST_CHECK_EQUAL(solutions.size(), 4);\n    BOOST_CHECK(solutions[0] == std::vector<unsigned char>({1}));\n    BOOST_CHECK(solutions[1] == ToByteVector(pubkeys[0]));\n    BOOST_CHECK(solutions[2] == ToByteVector(pubkeys[1]));\n    BOOST_CHECK(solutions[3] == std::vector<unsigned char>({2}));\n\n    s.clear();\n    s << OP_2 <<\n        ToByteVector(pubkeys[0]) <<\n        ToByteVector(pubkeys[1]) <<\n        ToByteVector(pubkeys[2]) <<\n        OP_3 << OP_CHECKMULTISIG;\n    BOOST_CHECK(Solver(s, whichType, solutions));\n    BOOST_CHECK_EQUAL(whichType, TX_MULTISIG);\n    BOOST_CHECK_EQUAL(solutions.size(), 5);\n    BOOST_CHECK(solutions[0] == std::vector<unsigned char>({2}));\n    BOOST_CHECK(solutions[1] == ToByteVector(pubkeys[0]));\n    BOOST_CHECK(solutions[2] == ToByteVector(pubkeys[1]));\n    BOOST_CHECK(solutions[3] == ToByteVector(pubkeys[2]));\n    BOOST_CHECK(solutions[4] == std::vector<unsigned char>({3}));\n\n    // TX_NULL_DATA\n    s.clear();\n    s << OP_RETURN <<\n        std::vector<unsigned char>({0}) <<\n        std::vector<unsigned char>({75}) <<\n        std::vector<unsigned char>({255});\n    BOOST_CHECK(Solver(s, whichType, solutions));\n    BOOST_CHECK_EQUAL(whichType, TX_NULL_DATA);\n    BOOST_CHECK_EQUAL(solutions.size(), 0);\n\n    // TX_WITNESS_V0_KEYHASH\n    s.clear();\n    s << OP_0 << ToByteVector(pubkeys[0].GetID());\n    BOOST_CHECK(Solver(s, whichType, solutions));\n    BOOST_CHECK_EQUAL(whichType, TX_WITNESS_V0_KEYHASH);\n    BOOST_CHECK_EQUAL(solutions.size(), 1);\n    BOOST_CHECK(solutions[0] == ToByteVector(pubkeys[0].GetID()));\n\n    // TX_WITNESS_V0_SCRIPTHASH\n    uint256 scriptHash;\n    CSHA256().Write(&redeemScript[0], redeemScript.size())\n        .Finalize(scriptHash.begin());\n\n    s.clear();\n    s << OP_0 << ToByteVector(scriptHash);\n    BOOST_CHECK(Solver(s, whichType, solutions));\n    BOOST_CHECK_EQUAL(whichType, TX_WITNESS_V0_SCRIPTHASH);\n    BOOST_CHECK_EQUAL(solutions.size(), 1);\n    BOOST_CHECK(solutions[0] == ToByteVector(scriptHash));\n\n    // TX_NONSTANDARD\n    s.clear();\n    s << OP_9 << OP_ADD << OP_11 << OP_EQUAL;\n    BOOST_CHECK(!Solver(s, whichType, solutions));\n    BOOST_CHECK_EQUAL(whichType, TX_NONSTANDARD);\n}\n\nBOOST_AUTO_TEST_CASE(script_standard_Solver_failure)\n{\n    CKey key;\n    CPubKey pubkey;\n    key.MakeNewKey(true);\n    pubkey = key.GetPubKey();\n\n    CScript s;\n    txnouttype whichType;\n    std::vector<std::vector<unsigned char> > solutions;\n\n    // TX_PUBKEY with incorrectly sized pubkey\n    s.clear();\n    s << std::vector<unsigned char>(30, 0x01) << OP_CHECKSIG;\n    BOOST_CHECK(!Solver(s, whichType, solutions));\n\n    // TX_PUBKEYHASH with incorrectly sized key hash\n    s.clear();\n    s << OP_DUP << OP_HASH160 << ToByteVector(pubkey) << OP_EQUALVERIFY << OP_CHECKSIG;\n    BOOST_CHECK(!Solver(s, whichType, solutions));\n\n    // TX_SCRIPTHASH with incorrectly sized script hash\n    s.clear();\n    s << OP_HASH160 << std::vector<unsigned char>(21, 0x01) << OP_EQUAL;\n    BOOST_CHECK(!Solver(s, whichType, solutions));\n\n    // TX_MULTISIG 0/2\n    s.clear();\n    s << OP_0 << ToByteVector(pubkey) << OP_1 << OP_CHECKMULTISIG;\n    BOOST_CHECK(!Solver(s, whichType, solutions));\n\n    // TX_MULTISIG 2/1\n    s.clear();\n    s << OP_2 << ToByteVector(pubkey) << OP_1 << OP_CHECKMULTISIG;\n    BOOST_CHECK(!Solver(s, whichType, solutions));\n\n    // TX_MULTISIG n = 2 with 1 pubkey\n    s.clear();\n    s << OP_1 << ToByteVector(pubkey) << OP_2 << OP_CHECKMULTISIG;\n    BOOST_CHECK(!Solver(s, whichType, solutions));\n\n    // TX_MULTISIG n = 1 with 0 pubkeys\n    s.clear();\n    s << OP_1 << OP_1 << OP_CHECKMULTISIG;\n    BOOST_CHECK(!Solver(s, whichType, solutions));\n\n    // TX_NULL_DATA with other opcodes\n    s.clear();\n    s << OP_RETURN << std::vector<unsigned char>({75}) << OP_ADD;\n    BOOST_CHECK(!Solver(s, whichType, solutions));\n\n    // TX_WITNESS with incorrect program size\n    s.clear();\n    s << OP_0 << std::vector<unsigned char>(19, 0x01);\n    BOOST_CHECK(!Solver(s, whichType, solutions));\n}\n\nBOOST_AUTO_TEST_CASE(script_standard_ExtractDestination)\n{\n    CKey key;\n    CPubKey pubkey;\n    key.MakeNewKey(true);\n    pubkey = key.GetPubKey();\n\n    CScript s;\n    CTxDestination address;\n\n    // TX_PUBKEY\n    s.clear();\n    s << ToByteVector(pubkey) << OP_CHECKSIG;\n    BOOST_CHECK(ExtractDestination(s, address));\n    BOOST_CHECK(boost::get<CKeyID>(&address) &&\n                *boost::get<CKeyID>(&address) == pubkey.GetID());\n\n    // TX_PUBKEYHASH\n    s.clear();\n    s << OP_DUP << OP_HASH160 << ToByteVector(pubkey.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG;\n    BOOST_CHECK(ExtractDestination(s, address));\n    BOOST_CHECK(boost::get<CKeyID>(&address) &&\n                *boost::get<CKeyID>(&address) == pubkey.GetID());\n\n    // TX_SCRIPTHASH\n    CScript redeemScript(s); // initialize with leftover P2PKH script\n    s.clear();\n    s << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL;\n    BOOST_CHECK(ExtractDestination(s, address));\n    BOOST_CHECK(boost::get<CScriptID>(&address) &&\n                *boost::get<CScriptID>(&address) == CScriptID(redeemScript));\n\n    // TX_MULTISIG\n    s.clear();\n    s << OP_1 << ToByteVector(pubkey) << OP_1 << OP_CHECKMULTISIG;\n    BOOST_CHECK(!ExtractDestination(s, address));\n\n    // TX_NULL_DATA\n    s.clear();\n    s << OP_RETURN << std::vector<unsigned char>({75});\n    BOOST_CHECK(!ExtractDestination(s, address));\n\n    // TX_WITNESS_V0_KEYHASH\n    s.clear();\n    s << OP_0 << ToByteVector(pubkey.GetID());\n    BOOST_CHECK(ExtractDestination(s, address));\n    WitnessV0KeyHash keyhash;\n    CHash160().Write(pubkey.begin(), pubkey.size()).Finalize(keyhash.begin());\n    BOOST_CHECK(boost::get<WitnessV0KeyHash>(&address) && *boost::get<WitnessV0KeyHash>(&address) == keyhash);\n\n    // TX_WITNESS_V0_SCRIPTHASH\n    s.clear();\n    WitnessV0ScriptHash scripthash;\n    CSHA256().Write(redeemScript.data(), redeemScript.size()).Finalize(scripthash.begin());\n    s << OP_0 << ToByteVector(scripthash);\n    BOOST_CHECK(ExtractDestination(s, address));\n    BOOST_CHECK(boost::get<WitnessV0ScriptHash>(&address) && *boost::get<WitnessV0ScriptHash>(&address) == scripthash);\n\n    // TX_WITNESS with unknown version\n    s.clear();\n    s << OP_1 << ToByteVector(pubkey);\n    BOOST_CHECK(ExtractDestination(s, address));\n    WitnessUnknown unk;\n    unk.length = 33;\n    unk.version = 1;\n    std::copy(pubkey.begin(), pubkey.end(), unk.program);\n    BOOST_CHECK(boost::get<WitnessUnknown>(&address) && *boost::get<WitnessUnknown>(&address) == unk);\n}\n\nBOOST_AUTO_TEST_CASE(script_standard_ExtractDestinations)\n{\n    CKey keys[3];\n    CPubKey pubkeys[3];\n    for (int i = 0; i < 3; i++) {\n        keys[i].MakeNewKey(true);\n        pubkeys[i] = keys[i].GetPubKey();\n    }\n\n    CScript s;\n    txnouttype whichType;\n    std::vector<CTxDestination> addresses;\n    int nRequired;\n\n    // TX_PUBKEY\n    s.clear();\n    s << ToByteVector(pubkeys[0]) << OP_CHECKSIG;\n    BOOST_CHECK(ExtractDestinations(s, whichType, addresses, nRequired));\n    BOOST_CHECK_EQUAL(whichType, TX_PUBKEY);\n    BOOST_CHECK_EQUAL(addresses.size(), 1);\n    BOOST_CHECK_EQUAL(nRequired, 1);\n    BOOST_CHECK(boost::get<CKeyID>(&addresses[0]) &&\n                *boost::get<CKeyID>(&addresses[0]) == pubkeys[0].GetID());\n\n    // TX_PUBKEYHASH\n    s.clear();\n    s << OP_DUP << OP_HASH160 << ToByteVector(pubkeys[0].GetID()) << OP_EQUALVERIFY << OP_CHECKSIG;\n    BOOST_CHECK(ExtractDestinations(s, whichType, addresses, nRequired));\n    BOOST_CHECK_EQUAL(whichType, TX_PUBKEYHASH);\n    BOOST_CHECK_EQUAL(addresses.size(), 1);\n    BOOST_CHECK_EQUAL(nRequired, 1);\n    BOOST_CHECK(boost::get<CKeyID>(&addresses[0]) &&\n                *boost::get<CKeyID>(&addresses[0]) == pubkeys[0].GetID());\n\n    // TX_SCRIPTHASH\n    CScript redeemScript(s); // initialize with leftover P2PKH script\n    s.clear();\n    s << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL;\n    BOOST_CHECK(ExtractDestinations(s, whichType, addresses, nRequired));\n    BOOST_CHECK_EQUAL(whichType, TX_SCRIPTHASH);\n    BOOST_CHECK_EQUAL(addresses.size(), 1);\n    BOOST_CHECK_EQUAL(nRequired, 1);\n    BOOST_CHECK(boost::get<CScriptID>(&addresses[0]) &&\n                *boost::get<CScriptID>(&addresses[0]) == CScriptID(redeemScript));\n\n    // TX_MULTISIG\n    s.clear();\n    s << OP_2 <<\n        ToByteVector(pubkeys[0]) <<\n        ToByteVector(pubkeys[1]) <<\n        OP_2 << OP_CHECKMULTISIG;\n    BOOST_CHECK(ExtractDestinations(s, whichType, addresses, nRequired));\n    BOOST_CHECK_EQUAL(whichType, TX_MULTISIG);\n    BOOST_CHECK_EQUAL(addresses.size(), 2);\n    BOOST_CHECK_EQUAL(nRequired, 2);\n    BOOST_CHECK(boost::get<CKeyID>(&addresses[0]) &&\n                *boost::get<CKeyID>(&addresses[0]) == pubkeys[0].GetID());\n    BOOST_CHECK(boost::get<CKeyID>(&addresses[1]) &&\n                *boost::get<CKeyID>(&addresses[1]) == pubkeys[1].GetID());\n\n    // TX_NULL_DATA\n    s.clear();\n    s << OP_RETURN << std::vector<unsigned char>({75});\n    BOOST_CHECK(!ExtractDestinations(s, whichType, addresses, nRequired));\n}\n\nBOOST_AUTO_TEST_CASE(script_standard_GetScriptFor_)\n{\n    CKey keys[3];\n    CPubKey pubkeys[3];\n    for (int i = 0; i < 3; i++) {\n        keys[i].MakeNewKey(true);\n        pubkeys[i] = keys[i].GetPubKey();\n    }\n\n    CScript expected, result;\n\n    // CKeyID\n    expected.clear();\n    expected << OP_DUP << OP_HASH160 << ToByteVector(pubkeys[0].GetID()) << OP_EQUALVERIFY << OP_CHECKSIG;\n    result = GetScriptForDestination(pubkeys[0].GetID());\n    BOOST_CHECK(result == expected);\n\n    // CScriptID\n    CScript redeemScript(result);\n    expected.clear();\n    expected << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL;\n    result = GetScriptForDestination(CScriptID(redeemScript));\n    BOOST_CHECK(result == expected);\n\n    // CNoDestination\n    expected.clear();\n    result = GetScriptForDestination(CNoDestination());\n    BOOST_CHECK(result == expected);\n\n    // GetScriptForRawPubKey\n    expected.clear();\n    expected << ToByteVector(pubkeys[0]) << OP_CHECKSIG;\n    result = GetScriptForRawPubKey(pubkeys[0]);\n    BOOST_CHECK(result == expected);\n\n    // GetScriptForMultisig\n    expected.clear();\n    expected << OP_2 <<\n        ToByteVector(pubkeys[0]) <<\n        ToByteVector(pubkeys[1]) <<\n        ToByteVector(pubkeys[2]) <<\n        OP_3 << OP_CHECKMULTISIG;\n    result = GetScriptForMultisig(2, std::vector<CPubKey>(pubkeys, pubkeys + 3));\n    BOOST_CHECK(result == expected);\n\n    // GetScriptForWitness\n    CScript witnessScript;\n\n    witnessScript << ToByteVector(pubkeys[0]) << OP_CHECKSIG;\n    expected.clear();\n    expected << OP_0 << ToByteVector(pubkeys[0].GetID());\n    result = GetScriptForWitness(witnessScript);\n    BOOST_CHECK(result == expected);\n\n    witnessScript.clear();\n    witnessScript << OP_DUP << OP_HASH160 << ToByteVector(pubkeys[0].GetID()) << OP_EQUALVERIFY << OP_CHECKSIG;\n    result = GetScriptForWitness(witnessScript);\n    BOOST_CHECK(result == expected);\n\n    witnessScript.clear();\n    witnessScript << OP_1 << ToByteVector(pubkeys[0]) << OP_1 << OP_CHECKMULTISIG;\n\n    uint256 scriptHash;\n    CSHA256().Write(&witnessScript[0], witnessScript.size())\n        .Finalize(scriptHash.begin());\n\n    expected.clear();\n    expected << OP_0 << ToByteVector(scriptHash);\n    result = GetScriptForWitness(witnessScript);\n    BOOST_CHECK(result == expected);\n}\n\nBOOST_AUTO_TEST_CASE(script_standard_IsMine)\n{\n    CKey keys[2];\n    CPubKey pubkeys[2];\n    for (int i = 0; i < 2; i++) {\n        keys[i].MakeNewKey(true);\n        pubkeys[i] = keys[i].GetPubKey();\n    }\n\n    CKey uncompressedKey;\n    uncompressedKey.MakeNewKey(false);\n    CPubKey uncompressedPubkey = uncompressedKey.GetPubKey();\n\n    CScript scriptPubKey;\n    isminetype result;\n    bool isInvalid;\n\n    // P2PK compressed\n    {\n        CBasicKeyStore keystore;\n        scriptPubKey.clear();\n        scriptPubKey << ToByteVector(pubkeys[0]) << OP_CHECKSIG;\n\n        // Keystore does not have key\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has key\n        keystore.AddKey(keys[0]);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // P2PK uncompressed\n    {\n        CBasicKeyStore keystore;\n        scriptPubKey.clear();\n        scriptPubKey << ToByteVector(uncompressedPubkey) << OP_CHECKSIG;\n\n        // Keystore does not have key\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has key\n        keystore.AddKey(uncompressedKey);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // P2PKH compressed\n    {\n        CBasicKeyStore keystore;\n        scriptPubKey.clear();\n        scriptPubKey << OP_DUP << OP_HASH160 << ToByteVector(pubkeys[0].GetID()) << OP_EQUALVERIFY << OP_CHECKSIG;\n\n        // Keystore does not have key\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has key\n        keystore.AddKey(keys[0]);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // P2PKH uncompressed\n    {\n        CBasicKeyStore keystore;\n        scriptPubKey.clear();\n        scriptPubKey << OP_DUP << OP_HASH160 << ToByteVector(uncompressedPubkey.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG;\n\n        // Keystore does not have key\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has key\n        keystore.AddKey(uncompressedKey);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // P2SH\n    {\n        CBasicKeyStore keystore;\n\n        CScript redeemScript;\n        redeemScript << OP_DUP << OP_HASH160 << ToByteVector(pubkeys[0].GetID()) << OP_EQUALVERIFY << OP_CHECKSIG;\n\n        scriptPubKey.clear();\n        scriptPubKey << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL;\n\n        // Keystore does not have redeemScript or key\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has redeemScript but no key\n        keystore.AddCScript(redeemScript);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has redeemScript and key\n        keystore.AddKey(keys[0]);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // P2WPKH compressed\n    {\n        CBasicKeyStore keystore;\n        keystore.AddKey(keys[0]);\n\n        scriptPubKey.clear();\n        scriptPubKey << OP_0 << ToByteVector(pubkeys[0].GetID());\n\n        // Keystore implicitly has key and P2SH redeemScript\n        keystore.AddCScript(scriptPubKey);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // P2WPKH uncompressed\n    {\n        CBasicKeyStore keystore;\n        keystore.AddKey(uncompressedKey);\n\n        scriptPubKey.clear();\n        scriptPubKey << OP_0 << ToByteVector(uncompressedPubkey.GetID());\n\n        // Keystore has key, but no P2SH redeemScript\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has key and P2SH redeemScript\n        keystore.AddCScript(scriptPubKey);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(isInvalid);\n    }\n\n    // scriptPubKey multisig\n    {\n        CBasicKeyStore keystore;\n\n        scriptPubKey.clear();\n        scriptPubKey << OP_2 <<\n            ToByteVector(uncompressedPubkey) <<\n            ToByteVector(pubkeys[1]) <<\n            OP_2 << OP_CHECKMULTISIG;\n\n        // Keystore does not have any keys\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has 1/2 keys\n        keystore.AddKey(uncompressedKey);\n\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has 2/2 keys\n        keystore.AddKey(keys[1]);\n\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // P2SH multisig\n    {\n        CBasicKeyStore keystore;\n        keystore.AddKey(uncompressedKey);\n        keystore.AddKey(keys[1]);\n\n        CScript redeemScript;\n        redeemScript << OP_2 <<\n            ToByteVector(uncompressedPubkey) <<\n            ToByteVector(pubkeys[1]) <<\n            OP_2 << OP_CHECKMULTISIG;\n\n        scriptPubKey.clear();\n        scriptPubKey << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL;\n\n        // Keystore has no redeemScript\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has redeemScript\n        keystore.AddCScript(redeemScript);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // P2WSH multisig with compressed keys\n    {\n        CBasicKeyStore keystore;\n        keystore.AddKey(keys[0]);\n        keystore.AddKey(keys[1]);\n\n        CScript witnessScript;\n        witnessScript << OP_2 <<\n            ToByteVector(pubkeys[0]) <<\n            ToByteVector(pubkeys[1]) <<\n            OP_2 << OP_CHECKMULTISIG;\n\n        uint256 scriptHash;\n        CSHA256().Write(&witnessScript[0], witnessScript.size())\n            .Finalize(scriptHash.begin());\n\n        scriptPubKey.clear();\n        scriptPubKey << OP_0 << ToByteVector(scriptHash);\n\n        // Keystore has keys, but no witnessScript or P2SH redeemScript\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has keys and witnessScript, but no P2SH redeemScript\n        keystore.AddCScript(witnessScript);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has keys, witnessScript, P2SH redeemScript\n        keystore.AddCScript(scriptPubKey);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // P2WSH multisig with uncompressed key\n    {\n        CBasicKeyStore keystore;\n        keystore.AddKey(uncompressedKey);\n        keystore.AddKey(keys[1]);\n\n        CScript witnessScript;\n        witnessScript << OP_2 <<\n            ToByteVector(uncompressedPubkey) <<\n            ToByteVector(pubkeys[1]) <<\n            OP_2 << OP_CHECKMULTISIG;\n\n        uint256 scriptHash;\n        CSHA256().Write(&witnessScript[0], witnessScript.size())\n            .Finalize(scriptHash.begin());\n\n        scriptPubKey.clear();\n        scriptPubKey << OP_0 << ToByteVector(scriptHash);\n\n        // Keystore has keys, but no witnessScript or P2SH redeemScript\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has keys and witnessScript, but no P2SH redeemScript\n        keystore.AddCScript(witnessScript);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has keys, witnessScript, P2SH redeemScript\n        keystore.AddCScript(scriptPubKey);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(isInvalid);\n    }\n\n    // P2WSH multisig wrapped in P2SH\n    {\n        CBasicKeyStore keystore;\n\n        CScript witnessScript;\n        witnessScript << OP_2 <<\n            ToByteVector(pubkeys[0]) <<\n            ToByteVector(pubkeys[1]) <<\n            OP_2 << OP_CHECKMULTISIG;\n\n        uint256 scriptHash;\n        CSHA256().Write(&witnessScript[0], witnessScript.size())\n            .Finalize(scriptHash.begin());\n\n        CScript redeemScript;\n        redeemScript << OP_0 << ToByteVector(scriptHash);\n\n        scriptPubKey.clear();\n        scriptPubKey << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL;\n\n        // Keystore has no witnessScript, P2SH redeemScript, or keys\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has witnessScript and P2SH redeemScript, but no keys\n        keystore.AddCScript(redeemScript);\n        keystore.AddCScript(witnessScript);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n\n        // Keystore has keys, witnessScript, P2SH redeemScript\n        keystore.AddKey(keys[0]);\n        keystore.AddKey(keys[1]);\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_SPENDABLE);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // OP_RETURN\n    {\n        CBasicKeyStore keystore;\n        keystore.AddKey(keys[0]);\n\n        scriptPubKey.clear();\n        scriptPubKey << OP_RETURN << ToByteVector(pubkeys[0]);\n\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n    }\n\n    // Nonstandard\n    {\n        CBasicKeyStore keystore;\n        keystore.AddKey(keys[0]);\n\n        scriptPubKey.clear();\n        scriptPubKey << OP_9 << OP_ADD << OP_11 << OP_EQUAL;\n\n        result = IsMine(keystore, scriptPubKey, isInvalid);\n        BOOST_CHECK_EQUAL(result, ISMINE_NO);\n        BOOST_CHECK(!isInvalid);\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/script_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <test/data/script_tests.json.h>\n\n#include <core_io.h>\n#include <key.h>\n#include <keystore.h>\n#include <script/script.h>\n#include <script/script_error.h>\n#include <script/sign.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <test/test_bitcoin.h>\n#include <rpc/server.h>\n\n#if defined(HAVE_CONSENSUS_LIB)\n#include <script/bitcoinconsensus.h>\n#endif\n\n#include <fstream>\n#include <stdint.h>\n#include <string>\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n\n#include <univalue.h>\n\n// Uncomment if you want to output updated JSON tests.\n// #define UPDATE_JSON_TESTS\n\nstatic const unsigned int gFlags = SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC;\n\nunsigned int ParseScriptFlags(std::string strFlags);\nstd::string FormatScriptFlags(unsigned int flags);\n\nUniValue\nread_json(const std::string& jsondata)\n{\n    UniValue v;\n\n    if (!v.read(jsondata) || !v.isArray())\n    {\n        BOOST_ERROR(\"Parse error.\");\n        return UniValue(UniValue::VARR);\n    }\n    return v.get_array();\n}\n\nstruct ScriptErrorDesc\n{\n    ScriptError_t err;\n    const char *name;\n};\n\nstatic ScriptErrorDesc script_errors[]={\n    {SCRIPT_ERR_OK, \"OK\"},\n    {SCRIPT_ERR_UNKNOWN_ERROR, \"UNKNOWN_ERROR\"},\n    {SCRIPT_ERR_EVAL_FALSE, \"EVAL_FALSE\"},\n    {SCRIPT_ERR_OP_RETURN, \"OP_RETURN\"},\n    {SCRIPT_ERR_SCRIPT_SIZE, \"SCRIPT_SIZE\"},\n    {SCRIPT_ERR_PUSH_SIZE, \"PUSH_SIZE\"},\n    {SCRIPT_ERR_OP_COUNT, \"OP_COUNT\"},\n    {SCRIPT_ERR_STACK_SIZE, \"STACK_SIZE\"},\n    {SCRIPT_ERR_SIG_COUNT, \"SIG_COUNT\"},\n    {SCRIPT_ERR_PUBKEY_COUNT, \"PUBKEY_COUNT\"},\n    {SCRIPT_ERR_VERIFY, \"VERIFY\"},\n    {SCRIPT_ERR_EQUALVERIFY, \"EQUALVERIFY\"},\n    {SCRIPT_ERR_CHECKMULTISIGVERIFY, \"CHECKMULTISIGVERIFY\"},\n    {SCRIPT_ERR_CHECKSIGVERIFY, \"CHECKSIGVERIFY\"},\n    {SCRIPT_ERR_NUMEQUALVERIFY, \"NUMEQUALVERIFY\"},\n    {SCRIPT_ERR_BAD_OPCODE, \"BAD_OPCODE\"},\n    {SCRIPT_ERR_DISABLED_OPCODE, \"DISABLED_OPCODE\"},\n    {SCRIPT_ERR_INVALID_STACK_OPERATION, \"INVALID_STACK_OPERATION\"},\n    {SCRIPT_ERR_INVALID_ALTSTACK_OPERATION, \"INVALID_ALTSTACK_OPERATION\"},\n    {SCRIPT_ERR_UNBALANCED_CONDITIONAL, \"UNBALANCED_CONDITIONAL\"},\n    {SCRIPT_ERR_NEGATIVE_LOCKTIME, \"NEGATIVE_LOCKTIME\"},\n    {SCRIPT_ERR_UNSATISFIED_LOCKTIME, \"UNSATISFIED_LOCKTIME\"},\n    {SCRIPT_ERR_SIG_HASHTYPE, \"SIG_HASHTYPE\"},\n    {SCRIPT_ERR_SIG_DER, \"SIG_DER\"},\n    {SCRIPT_ERR_MINIMALDATA, \"MINIMALDATA\"},\n    {SCRIPT_ERR_SIG_PUSHONLY, \"SIG_PUSHONLY\"},\n    {SCRIPT_ERR_SIG_HIGH_S, \"SIG_HIGH_S\"},\n    {SCRIPT_ERR_SIG_NULLDUMMY, \"SIG_NULLDUMMY\"},\n    {SCRIPT_ERR_PUBKEYTYPE, \"PUBKEYTYPE\"},\n    {SCRIPT_ERR_CLEANSTACK, \"CLEANSTACK\"},\n    {SCRIPT_ERR_MINIMALIF, \"MINIMALIF\"},\n    {SCRIPT_ERR_SIG_NULLFAIL, \"NULLFAIL\"},\n    {SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS, \"DISCOURAGE_UPGRADABLE_NOPS\"},\n    {SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM, \"DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM\"},\n    {SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH, \"WITNESS_PROGRAM_WRONG_LENGTH\"},\n    {SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY, \"WITNESS_PROGRAM_WITNESS_EMPTY\"},\n    {SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH, \"WITNESS_PROGRAM_MISMATCH\"},\n    {SCRIPT_ERR_WITNESS_MALLEATED, \"WITNESS_MALLEATED\"},\n    {SCRIPT_ERR_WITNESS_MALLEATED_P2SH, \"WITNESS_MALLEATED_P2SH\"},\n    {SCRIPT_ERR_WITNESS_UNEXPECTED, \"WITNESS_UNEXPECTED\"},\n    {SCRIPT_ERR_WITNESS_PUBKEYTYPE, \"WITNESS_PUBKEYTYPE\"},\n    {SCRIPT_ERR_OP_CODESEPARATOR, \"OP_CODESEPARATOR\"},\n    {SCRIPT_ERR_SIG_FINDANDDELETE, \"SIG_FINDANDDELETE\"},\n};\n\nconst char *FormatScriptError(ScriptError_t err)\n{\n    for (unsigned int i=0; i<ARRAYLEN(script_errors); ++i)\n        if (script_errors[i].err == err)\n            return script_errors[i].name;\n    BOOST_ERROR(\"Unknown scripterror enumeration value, update script_errors in script_tests.cpp.\");\n    return \"\";\n}\n\nScriptError_t ParseScriptError(const std::string &name)\n{\n    for (unsigned int i=0; i<ARRAYLEN(script_errors); ++i)\n        if (script_errors[i].name == name)\n            return script_errors[i].err;\n    BOOST_ERROR(\"Unknown scripterror \\\"\" << name << \"\\\" in test description\");\n    return SCRIPT_ERR_UNKNOWN_ERROR;\n}\n\nBOOST_FIXTURE_TEST_SUITE(script_tests, BasicTestingSetup)\n\nCMutableTransaction BuildCreditingTransaction(const CScript& scriptPubKey, int nValue = 0)\n{\n    CMutableTransaction txCredit;\n    txCredit.nVersion = 1;\n    txCredit.nLockTime = 0;\n    txCredit.vin.resize(1);\n    txCredit.vout.resize(1);\n    txCredit.vin[0].prevout.SetNull();\n    txCredit.vin[0].scriptSig = CScript() << CScriptNum(0) << CScriptNum(0);\n    txCredit.vin[0].nSequence = CTxIn::SEQUENCE_FINAL;\n    txCredit.vout[0].scriptPubKey = scriptPubKey;\n    txCredit.vout[0].nValue = nValue;\n\n    return txCredit;\n}\n\nCMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CScriptWitness& scriptWitness, const CMutableTransaction& txCredit)\n{\n    CMutableTransaction txSpend;\n    txSpend.nVersion = 1;\n    txSpend.nLockTime = 0;\n    txSpend.vin.resize(1);\n    txSpend.vout.resize(1);\n    txSpend.vin[0].scriptWitness = scriptWitness;\n    txSpend.vin[0].prevout.hash = txCredit.GetHash();\n    txSpend.vin[0].prevout.n = 0;\n    txSpend.vin[0].scriptSig = scriptSig;\n    txSpend.vin[0].nSequence = CTxIn::SEQUENCE_FINAL;\n    txSpend.vout[0].scriptPubKey = CScript();\n    txSpend.vout[0].nValue = txCredit.vout[0].nValue;\n\n    return txSpend;\n}\n\nvoid DoTest(const CScript& scriptPubKey, const CScript& scriptSig, const CScriptWitness& scriptWitness, int flags, const std::string& message, int scriptError, CAmount nValue = 0)\n{\n    bool expect = (scriptError == SCRIPT_ERR_OK);\n    if (flags & SCRIPT_VERIFY_CLEANSTACK) {\n        flags |= SCRIPT_VERIFY_P2SH;\n        flags |= SCRIPT_VERIFY_WITNESS;\n    }\n    ScriptError err;\n    CMutableTransaction txCredit = BuildCreditingTransaction(scriptPubKey, nValue);\n    CMutableTransaction tx = BuildSpendingTransaction(scriptSig, scriptWitness, txCredit);\n    CMutableTransaction tx2 = tx;\n    BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, &scriptWitness, flags, MutableTransactionSignatureChecker(&tx, 0, txCredit.vout[0].nValue), &err) == expect, message);\n    BOOST_CHECK_MESSAGE(err == scriptError, std::string(FormatScriptError(err)) + \" where \" + std::string(FormatScriptError((ScriptError_t)scriptError)) + \" expected: \" + message);\n\n    // Verify that removing flags from a passing test or adding flags to a failing test does not change the result.\n    for (int i = 0; i < 16; ++i) {\n        int extra_flags = InsecureRandBits(16);\n        int combined_flags = expect ? (flags & ~extra_flags) : (flags | extra_flags);\n        // Weed out some invalid flag combinations.\n        if (combined_flags & SCRIPT_VERIFY_CLEANSTACK && ~combined_flags & (SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS)) continue;\n        if (combined_flags & SCRIPT_VERIFY_WITNESS && ~combined_flags & SCRIPT_VERIFY_P2SH) continue;\n        BOOST_CHECK_MESSAGE(VerifyScript(scriptSig, scriptPubKey, &scriptWitness, combined_flags, MutableTransactionSignatureChecker(&tx, 0, txCredit.vout[0].nValue), &err) == expect, message + strprintf(\" (with flags %x)\", combined_flags));\n    }\n\n#if defined(HAVE_CONSENSUS_LIB)\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << tx2;\n    int libconsensus_flags = flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_ALL;\n    if (libconsensus_flags == flags) {\n        if (flags & bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS) {\n            BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(scriptPubKey.data(), scriptPubKey.size(), txCredit.vout[0].nValue, (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expect, message);\n        } else {\n            BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script_with_amount(scriptPubKey.data(), scriptPubKey.size(), 0, (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expect, message);\n            BOOST_CHECK_MESSAGE(bitcoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), 0, libconsensus_flags, nullptr) == expect,message);\n        }\n    }\n#endif\n}\n\nvoid static NegateSignatureS(std::vector<unsigned char>& vchSig) {\n    // Parse the signature.\n    std::vector<unsigned char> r, s;\n    r = std::vector<unsigned char>(vchSig.begin() + 4, vchSig.begin() + 4 + vchSig[3]);\n    s = std::vector<unsigned char>(vchSig.begin() + 6 + vchSig[3], vchSig.begin() + 6 + vchSig[3] + vchSig[5 + vchSig[3]]);\n\n    // Really ugly to implement mod-n negation here, but it would be feature creep to expose such functionality from libsecp256k1.\n    static const unsigned char order[33] = {\n        0x00,\n        0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,\n        0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE,\n        0xBA, 0xAE, 0xDC, 0xE6, 0xAF, 0x48, 0xA0, 0x3B,\n        0xBF, 0xD2, 0x5E, 0x8C, 0xD0, 0x36, 0x41, 0x41\n    };\n    while (s.size() < 33) {\n        s.insert(s.begin(), 0x00);\n    }\n    int carry = 0;\n    for (int p = 32; p >= 1; p--) {\n        int n = (int)order[p] - s[p] - carry;\n        s[p] = (n + 256) & 0xFF;\n        carry = (n < 0);\n    }\n    assert(carry == 0);\n    if (s.size() > 1 && s[0] == 0 && s[1] < 0x80) {\n        s.erase(s.begin());\n    }\n\n    // Reconstruct the signature.\n    vchSig.clear();\n    vchSig.push_back(0x30);\n    vchSig.push_back(4 + r.size() + s.size());\n    vchSig.push_back(0x02);\n    vchSig.push_back(r.size());\n    vchSig.insert(vchSig.end(), r.begin(), r.end());\n    vchSig.push_back(0x02);\n    vchSig.push_back(s.size());\n    vchSig.insert(vchSig.end(), s.begin(), s.end());\n}\n\nnamespace\n{\nconst unsigned char vchKey0[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1};\nconst unsigned char vchKey1[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0};\nconst unsigned char vchKey2[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0};\n\nstruct KeyData\n{\n    CKey key0, key0C, key1, key1C, key2, key2C;\n    CPubKey pubkey0, pubkey0C, pubkey0H;\n    CPubKey pubkey1, pubkey1C;\n    CPubKey pubkey2, pubkey2C;\n\n    KeyData()\n    {\n\n        key0.Set(vchKey0, vchKey0 + 32, false);\n        key0C.Set(vchKey0, vchKey0 + 32, true);\n        pubkey0 = key0.GetPubKey();\n        pubkey0H = key0.GetPubKey();\n        pubkey0C = key0C.GetPubKey();\n        *const_cast<unsigned char*>(&pubkey0H[0]) = 0x06 | (pubkey0H[64] & 1);\n\n        key1.Set(vchKey1, vchKey1 + 32, false);\n        key1C.Set(vchKey1, vchKey1 + 32, true);\n        pubkey1 = key1.GetPubKey();\n        pubkey1C = key1C.GetPubKey();\n\n        key2.Set(vchKey2, vchKey2 + 32, false);\n        key2C.Set(vchKey2, vchKey2 + 32, true);\n        pubkey2 = key2.GetPubKey();\n        pubkey2C = key2C.GetPubKey();\n    }\n};\n\nenum WitnessMode {\n    WITNESS_NONE,\n    WITNESS_PKH,\n    WITNESS_SH\n};\n\nclass TestBuilder\n{\nprivate:\n    //! Actually executed script\n    CScript script;\n    //! The P2SH redeemscript\n    CScript redeemscript;\n    //! The Witness embedded script\n    CScript witscript;\n    CScriptWitness scriptWitness;\n    CTransactionRef creditTx;\n    CMutableTransaction spendTx;\n    bool havePush;\n    std::vector<unsigned char> push;\n    std::string comment;\n    int flags;\n    int scriptError;\n    CAmount nValue;\n\n    void DoPush()\n    {\n        if (havePush) {\n            spendTx.vin[0].scriptSig << push;\n            havePush = false;\n        }\n    }\n\n    void DoPush(const std::vector<unsigned char>& data)\n    {\n         DoPush();\n         push = data;\n         havePush = true;\n    }\n\npublic:\n    TestBuilder(const CScript& script_, const std::string& comment_, int flags_, bool P2SH = false, WitnessMode wm = WITNESS_NONE, int witnessversion = 0, CAmount nValue_ = 0) : script(script_), havePush(false), comment(comment_), flags(flags_), scriptError(SCRIPT_ERR_OK), nValue(nValue_)\n    {\n        CScript scriptPubKey = script;\n        if (wm == WITNESS_PKH) {\n            uint160 hash;\n            CHash160().Write(&script[1], script.size() - 1).Finalize(hash.begin());\n            script = CScript() << OP_DUP << OP_HASH160 << ToByteVector(hash) << OP_EQUALVERIFY << OP_CHECKSIG;\n            scriptPubKey = CScript() << witnessversion << ToByteVector(hash);\n        } else if (wm == WITNESS_SH) {\n            witscript = scriptPubKey;\n            uint256 hash;\n            CSHA256().Write(&witscript[0], witscript.size()).Finalize(hash.begin());\n            scriptPubKey = CScript() << witnessversion << ToByteVector(hash);\n        }\n        if (P2SH) {\n            redeemscript = scriptPubKey;\n            scriptPubKey = CScript() << OP_HASH160 << ToByteVector(CScriptID(redeemscript)) << OP_EQUAL;\n        }\n        creditTx = MakeTransactionRef(BuildCreditingTransaction(scriptPubKey, nValue));\n        spendTx = BuildSpendingTransaction(CScript(), CScriptWitness(), *creditTx);\n    }\n\n    TestBuilder& ScriptError(ScriptError_t err)\n    {\n        scriptError = err;\n        return *this;\n    }\n\n    TestBuilder& Add(const CScript& _script)\n    {\n        DoPush();\n        spendTx.vin[0].scriptSig += _script;\n        return *this;\n    }\n\n    TestBuilder& Num(int num)\n    {\n        DoPush();\n        spendTx.vin[0].scriptSig << num;\n        return *this;\n    }\n\n    TestBuilder& Push(const std::string& hex)\n    {\n        DoPush(ParseHex(hex));\n        return *this;\n    }\n\n    TestBuilder& Push(const CScript& _script) {\n         DoPush(std::vector<unsigned char>(_script.begin(), _script.end()));\n        return *this;\n    }\n\n    TestBuilder& PushSig(const CKey& key, int nHashType = SIGHASH_ALL, unsigned int lenR = 32, unsigned int lenS = 32, SigVersion sigversion = SIGVERSION_BASE, CAmount amount = 0)\n    {\n        uint256 hash = SignatureHash(script, spendTx, 0, nHashType, amount, sigversion);\n        std::vector<unsigned char> vchSig, r, s;\n        uint32_t iter = 0;\n        do {\n            key.Sign(hash, vchSig, iter++);\n            if ((lenS == 33) != (vchSig[5 + vchSig[3]] == 33)) {\n                NegateSignatureS(vchSig);\n            }\n            r = std::vector<unsigned char>(vchSig.begin() + 4, vchSig.begin() + 4 + vchSig[3]);\n            s = std::vector<unsigned char>(vchSig.begin() + 6 + vchSig[3], vchSig.begin() + 6 + vchSig[3] + vchSig[5 + vchSig[3]]);\n        } while (lenR != r.size() || lenS != s.size());\n        vchSig.push_back(static_cast<unsigned char>(nHashType));\n        DoPush(vchSig);\n        return *this;\n    }\n\n    TestBuilder& PushWitSig(const CKey& key, CAmount amount = -1, int nHashType = SIGHASH_ALL, unsigned int lenR = 32, unsigned int lenS = 32, SigVersion sigversion = SIGVERSION_WITNESS_V0)\n    {\n        if (amount == -1)\n            amount = nValue;\n        return PushSig(key, nHashType, lenR, lenS, sigversion, amount).AsWit();\n    }\n\n    TestBuilder& Push(const CPubKey& pubkey)\n    {\n        DoPush(std::vector<unsigned char>(pubkey.begin(), pubkey.end()));\n        return *this;\n    }\n\n    TestBuilder& PushRedeem()\n    {\n        DoPush(std::vector<unsigned char>(redeemscript.begin(), redeemscript.end()));\n        return *this;\n    }\n\n    TestBuilder& PushWitRedeem()\n    {\n        DoPush(std::vector<unsigned char>(witscript.begin(), witscript.end()));\n        return AsWit();\n    }\n\n    TestBuilder& EditPush(unsigned int pos, const std::string& hexin, const std::string& hexout)\n    {\n        assert(havePush);\n        std::vector<unsigned char> datain = ParseHex(hexin);\n        std::vector<unsigned char> dataout = ParseHex(hexout);\n        assert(pos + datain.size() <= push.size());\n        BOOST_CHECK_MESSAGE(std::vector<unsigned char>(push.begin() + pos, push.begin() + pos + datain.size()) == datain, comment);\n        push.erase(push.begin() + pos, push.begin() + pos + datain.size());\n        push.insert(push.begin() + pos, dataout.begin(), dataout.end());\n        return *this;\n    }\n\n    TestBuilder& DamagePush(unsigned int pos)\n    {\n        assert(havePush);\n        assert(pos < push.size());\n        push[pos] ^= 1;\n        return *this;\n    }\n\n    TestBuilder& Test()\n    {\n        TestBuilder copy = *this; // Make a copy so we can rollback the push.\n        DoPush();\n        DoTest(creditTx->vout[0].scriptPubKey, spendTx.vin[0].scriptSig, scriptWitness, flags, comment, scriptError, nValue);\n        *this = copy;\n        return *this;\n    }\n\n    TestBuilder& AsWit()\n    {\n        assert(havePush);\n        scriptWitness.stack.push_back(push);\n        havePush = false;\n        return *this;\n    }\n\n    UniValue GetJSON()\n    {\n        DoPush();\n        UniValue array(UniValue::VARR);\n        if (!scriptWitness.stack.empty()) {\n            UniValue wit(UniValue::VARR);\n            for (unsigned i = 0; i < scriptWitness.stack.size(); i++) {\n                wit.push_back(HexStr(scriptWitness.stack[i]));\n            }\n            wit.push_back(ValueFromAmount(nValue));\n            array.push_back(wit);\n        }\n        array.push_back(FormatScript(spendTx.vin[0].scriptSig));\n        array.push_back(FormatScript(creditTx->vout[0].scriptPubKey));\n        array.push_back(FormatScriptFlags(flags));\n        array.push_back(FormatScriptError((ScriptError_t)scriptError));\n        array.push_back(comment);\n        return array;\n    }\n\n    std::string GetComment() const\n    {\n        return comment;\n    }\n};\n\nstd::string JSONPrettyPrint(const UniValue& univalue)\n{\n    std::string ret = univalue.write(4);\n    // Workaround for libunivalue pretty printer, which puts a space between commas and newlines\n    size_t pos = 0;\n    while ((pos = ret.find(\" \\n\", pos)) != std::string::npos) {\n        ret.replace(pos, 2, \"\\n\");\n        pos++;\n    }\n    return ret;\n}\n} // namespace\n\nBOOST_AUTO_TEST_CASE(script_build)\n{\n    const KeyData keys;\n\n    std::vector<TestBuilder> tests;\n\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"P2PK\", 0\n                               ).PushSig(keys.key0));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"P2PK, bad sig\", 0\n                               ).PushSig(keys.key0).DamagePush(10).ScriptError(SCRIPT_ERR_EVAL_FALSE));\n\n    tests.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << ToByteVector(keys.pubkey1C.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG,\n                                \"P2PKH\", 0\n                               ).PushSig(keys.key1).Push(keys.pubkey1C));\n    tests.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << ToByteVector(keys.pubkey2C.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG,\n                                \"P2PKH, bad pubkey\", 0\n                               ).PushSig(keys.key2).Push(keys.pubkey2C).DamagePush(5).ScriptError(SCRIPT_ERR_EQUALVERIFY));\n\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG,\n                                \"P2PK anyonecanpay\", 0\n                               ).PushSig(keys.key1, SIGHASH_ALL | SIGHASH_ANYONECANPAY));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG,\n                                \"P2PK anyonecanpay marked with normal hashtype\", 0\n                               ).PushSig(keys.key1, SIGHASH_ALL | SIGHASH_ANYONECANPAY).EditPush(70, \"81\", \"01\").ScriptError(SCRIPT_ERR_EVAL_FALSE));\n\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0C) << OP_CHECKSIG,\n                                \"P2SH(P2PK)\", SCRIPT_VERIFY_P2SH, true\n                               ).PushSig(keys.key0).PushRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0C) << OP_CHECKSIG,\n                                \"P2SH(P2PK), bad redeemscript\", SCRIPT_VERIFY_P2SH, true\n                               ).PushSig(keys.key0).PushRedeem().DamagePush(10).ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    \n    tests.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << ToByteVector(keys.pubkey0.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG,\n                                \"P2SH(P2PKH)\", SCRIPT_VERIFY_P2SH, true\n                               ).PushSig(keys.key0).Push(keys.pubkey0).PushRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << ToByteVector(keys.pubkey1.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG,\n                                \"P2SH(P2PKH), bad sig but no VERIFY_P2SH\", 0, true\n                               ).PushSig(keys.key0).DamagePush(10).PushRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_DUP << OP_HASH160 << ToByteVector(keys.pubkey1.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG,\n                                \"P2SH(P2PKH), bad sig\", SCRIPT_VERIFY_P2SH, true\n                               ).PushSig(keys.key0).DamagePush(10).PushRedeem().ScriptError(SCRIPT_ERR_EQUALVERIFY));\n\n    tests.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG,\n                                \"3-of-3\", 0\n                               ).Num(0).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2));\n    tests.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG,\n                                \"3-of-3, 2 sigs\", 0\n                               ).Num(0).PushSig(keys.key0).PushSig(keys.key1).Num(0).ScriptError(SCRIPT_ERR_EVAL_FALSE));\n\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG,\n                                \"P2SH(2-of-3)\", SCRIPT_VERIFY_P2SH, true\n                               ).Num(0).PushSig(keys.key1).PushSig(keys.key2).PushRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG,\n                                \"P2SH(2-of-3), 1 sig\", SCRIPT_VERIFY_P2SH, true\n                               ).Num(0).PushSig(keys.key1).Num(0).PushRedeem().ScriptError(SCRIPT_ERR_EVAL_FALSE));\n\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"P2PK with too much R padding but no DERSIG\", 0\n                               ).PushSig(keys.key1, SIGHASH_ALL, 31, 32).EditPush(1, \"43021F\", \"44022000\"));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"P2PK with too much R padding\", SCRIPT_VERIFY_DERSIG\n                               ).PushSig(keys.key1, SIGHASH_ALL, 31, 32).EditPush(1, \"43021F\", \"44022000\").ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"P2PK with too much S padding but no DERSIG\", 0\n                               ).PushSig(keys.key1, SIGHASH_ALL).EditPush(1, \"44\", \"45\").EditPush(37, \"20\", \"2100\"));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"P2PK with too much S padding\", SCRIPT_VERIFY_DERSIG\n                               ).PushSig(keys.key1, SIGHASH_ALL).EditPush(1, \"44\", \"45\").EditPush(37, \"20\", \"2100\").ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"P2PK with too little R padding but no DERSIG\", 0\n                               ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\"));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"P2PK with too little R padding\", SCRIPT_VERIFY_DERSIG\n                               ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG << OP_NOT,\n                                \"P2PK NOT with bad sig with too much R padding but no DERSIG\", 0\n                               ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, \"43021F\", \"44022000\").DamagePush(10));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG << OP_NOT,\n                                \"P2PK NOT with bad sig with too much R padding\", SCRIPT_VERIFY_DERSIG\n                               ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, \"43021F\", \"44022000\").DamagePush(10).ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG << OP_NOT,\n                                \"P2PK NOT with too much R padding but no DERSIG\", 0\n                               ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, \"43021F\", \"44022000\").ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG << OP_NOT,\n                                \"P2PK NOT with too much R padding\", SCRIPT_VERIFY_DERSIG\n                               ).PushSig(keys.key2, SIGHASH_ALL, 31, 32).EditPush(1, \"43021F\", \"44022000\").ScriptError(SCRIPT_ERR_SIG_DER));\n\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"BIP66 example 1, without DERSIG\", 0\n                               ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\"));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"BIP66 example 1, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG << OP_NOT,\n                                \"BIP66 example 2, without DERSIG\", 0\n                               ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG << OP_NOT,\n                                \"BIP66 example 2, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"BIP66 example 3, without DERSIG\", 0\n                               ).Num(0).ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"BIP66 example 3, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).Num(0).ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG << OP_NOT,\n                                \"BIP66 example 4, without DERSIG\", 0\n                               ).Num(0));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG << OP_NOT,\n                                \"BIP66 example 4, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).Num(0));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"BIP66 example 5, without DERSIG\", 0\n                               ).Num(1).ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG,\n                                \"BIP66 example 5, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).Num(1).ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG << OP_NOT,\n                                \"BIP66 example 6, without DERSIG\", 0\n                               ).Num(1));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1C) << OP_CHECKSIG << OP_NOT,\n                                \"BIP66 example 6, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).Num(1).ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG,\n                                \"BIP66 example 7, without DERSIG\", 0\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").PushSig(keys.key2));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG,\n                                \"BIP66 example 7, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").PushSig(keys.key2).ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG << OP_NOT,\n                                \"BIP66 example 8, without DERSIG\", 0\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").PushSig(keys.key2).ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG << OP_NOT,\n                                \"BIP66 example 8, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").PushSig(keys.key2).ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG,\n                                \"BIP66 example 9, without DERSIG\", 0\n                               ).Num(0).Num(0).PushSig(keys.key2, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG,\n                                \"BIP66 example 9, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).Num(0).Num(0).PushSig(keys.key2, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG << OP_NOT,\n                                \"BIP66 example 10, without DERSIG\", 0\n                               ).Num(0).Num(0).PushSig(keys.key2, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\"));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG << OP_NOT,\n                                \"BIP66 example 10, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).Num(0).Num(0).PushSig(keys.key2, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").ScriptError(SCRIPT_ERR_SIG_DER));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG,\n                                \"BIP66 example 11, without DERSIG\", 0\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").Num(0).ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG,\n                                \"BIP66 example 11, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").Num(0).ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG << OP_NOT,\n                                \"BIP66 example 12, without DERSIG\", 0\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").Num(0));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_2 << OP_CHECKMULTISIG << OP_NOT,\n                                \"BIP66 example 12, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL, 33, 32).EditPush(1, \"45022100\", \"440220\").Num(0));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG,\n                                \"P2PK with multi-byte hashtype, without DERSIG\", 0\n                               ).PushSig(keys.key2, SIGHASH_ALL).EditPush(70, \"01\", \"0101\"));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG,\n                                \"P2PK with multi-byte hashtype, with DERSIG\", SCRIPT_VERIFY_DERSIG\n                               ).PushSig(keys.key2, SIGHASH_ALL).EditPush(70, \"01\", \"0101\").ScriptError(SCRIPT_ERR_SIG_DER));\n\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG,\n                                \"P2PK with high S but no LOW_S\", 0\n                               ).PushSig(keys.key2, SIGHASH_ALL, 32, 33));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG,\n                                \"P2PK with high S\", SCRIPT_VERIFY_LOW_S\n                               ).PushSig(keys.key2, SIGHASH_ALL, 32, 33).ScriptError(SCRIPT_ERR_SIG_HIGH_S));\n\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG,\n                                \"P2PK with hybrid pubkey but no STRICTENC\", 0\n                               ).PushSig(keys.key0, SIGHASH_ALL));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG,\n                                \"P2PK with hybrid pubkey\", SCRIPT_VERIFY_STRICTENC\n                               ).PushSig(keys.key0, SIGHASH_ALL).ScriptError(SCRIPT_ERR_PUBKEYTYPE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT,\n                                \"P2PK NOT with hybrid pubkey but no STRICTENC\", 0\n                               ).PushSig(keys.key0, SIGHASH_ALL).ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT,\n                                \"P2PK NOT with hybrid pubkey\", SCRIPT_VERIFY_STRICTENC\n                               ).PushSig(keys.key0, SIGHASH_ALL).ScriptError(SCRIPT_ERR_PUBKEYTYPE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT,\n                                \"P2PK NOT with invalid hybrid pubkey but no STRICTENC\", 0\n                               ).PushSig(keys.key0, SIGHASH_ALL).DamagePush(10));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0H) << OP_CHECKSIG << OP_NOT,\n                                \"P2PK NOT with invalid hybrid pubkey\", SCRIPT_VERIFY_STRICTENC\n                               ).PushSig(keys.key0, SIGHASH_ALL).DamagePush(10).ScriptError(SCRIPT_ERR_PUBKEYTYPE));\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0H) << ToByteVector(keys.pubkey1C) << OP_2 << OP_CHECKMULTISIG,\n                                \"1-of-2 with the second 1 hybrid pubkey and no STRICTENC\", 0\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL));\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey0H) << ToByteVector(keys.pubkey1C) << OP_2 << OP_CHECKMULTISIG,\n                                \"1-of-2 with the second 1 hybrid pubkey\", SCRIPT_VERIFY_STRICTENC\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL));\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0H) << OP_2 << OP_CHECKMULTISIG,\n                                \"1-of-2 with the first 1 hybrid pubkey\", SCRIPT_VERIFY_STRICTENC\n                               ).Num(0).PushSig(keys.key1, SIGHASH_ALL).ScriptError(SCRIPT_ERR_PUBKEYTYPE));\n\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG,\n                                \"P2PK with undefined hashtype but no STRICTENC\", 0\n                               ).PushSig(keys.key1, 5));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG,\n                                \"P2PK with undefined hashtype\", SCRIPT_VERIFY_STRICTENC\n                               ).PushSig(keys.key1, 5).ScriptError(SCRIPT_ERR_SIG_HASHTYPE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG << OP_NOT,\n                                \"P2PK NOT with invalid sig and undefined hashtype but no STRICTENC\", 0\n                               ).PushSig(keys.key1, 5).DamagePush(10));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG << OP_NOT,\n                                \"P2PK NOT with invalid sig and undefined hashtype\", SCRIPT_VERIFY_STRICTENC\n                               ).PushSig(keys.key1, 5).DamagePush(10).ScriptError(SCRIPT_ERR_SIG_HASHTYPE));\n\n    tests.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG,\n                                \"3-of-3 with nonzero dummy but no NULLDUMMY\", 0\n                               ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2));\n    tests.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG,\n                                \"3-of-3 with nonzero dummy\", SCRIPT_VERIFY_NULLDUMMY\n                               ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2).ScriptError(SCRIPT_ERR_SIG_NULLDUMMY));\n    tests.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG << OP_NOT,\n                                \"3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY\", 0\n                               ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2).DamagePush(10));\n    tests.push_back(TestBuilder(CScript() << OP_3 << ToByteVector(keys.pubkey0C) << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey2C) << OP_3 << OP_CHECKMULTISIG << OP_NOT,\n                                \"3-of-3 NOT with invalid sig with nonzero dummy\", SCRIPT_VERIFY_NULLDUMMY\n                               ).Num(1).PushSig(keys.key0).PushSig(keys.key1).PushSig(keys.key2).DamagePush(10).ScriptError(SCRIPT_ERR_SIG_NULLDUMMY));\n\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey1C) << OP_2 << OP_CHECKMULTISIG,\n                                \"2-of-2 with two identical keys and sigs pushed using OP_DUP but no SIGPUSHONLY\", 0\n                               ).Num(0).PushSig(keys.key1).Add(CScript() << OP_DUP));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey1C) << OP_2 << OP_CHECKMULTISIG,\n                                \"2-of-2 with two identical keys and sigs pushed using OP_DUP\", SCRIPT_VERIFY_SIGPUSHONLY\n                               ).Num(0).PushSig(keys.key1).Add(CScript() << OP_DUP).ScriptError(SCRIPT_ERR_SIG_PUSHONLY));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG,\n                                \"P2SH(P2PK) with non-push scriptSig but no P2SH or SIGPUSHONLY\", 0, true\n                               ).PushSig(keys.key2).Add(CScript() << OP_NOP8).PushRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG,\n                                \"P2PK with non-push scriptSig but with P2SH validation\", 0\n                               ).PushSig(keys.key2).Add(CScript() << OP_NOP8));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG,\n                                \"P2SH(P2PK) with non-push scriptSig but no SIGPUSHONLY\", SCRIPT_VERIFY_P2SH, true\n                               ).PushSig(keys.key2).Add(CScript() << OP_NOP8).PushRedeem().ScriptError(SCRIPT_ERR_SIG_PUSHONLY));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey2C) << OP_CHECKSIG,\n                                \"P2SH(P2PK) with non-push scriptSig but not P2SH\", SCRIPT_VERIFY_SIGPUSHONLY, true\n                               ).PushSig(keys.key2).Add(CScript() << OP_NOP8).PushRedeem().ScriptError(SCRIPT_ERR_SIG_PUSHONLY));\n    tests.push_back(TestBuilder(CScript() << OP_2 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey1C) << OP_2 << OP_CHECKMULTISIG,\n                                \"2-of-2 with two identical keys and sigs pushed\", SCRIPT_VERIFY_SIGPUSHONLY\n                               ).Num(0).PushSig(keys.key1).PushSig(keys.key1));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"P2PK with unnecessary input but no CLEANSTACK\", SCRIPT_VERIFY_P2SH\n                               ).Num(11).PushSig(keys.key0));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"P2PK with unnecessary input\", SCRIPT_VERIFY_CLEANSTACK | SCRIPT_VERIFY_P2SH\n                               ).Num(11).PushSig(keys.key0).ScriptError(SCRIPT_ERR_CLEANSTACK));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"P2SH with unnecessary input but no CLEANSTACK\", SCRIPT_VERIFY_P2SH, true\n                               ).Num(11).PushSig(keys.key0).PushRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"P2SH with unnecessary input\", SCRIPT_VERIFY_CLEANSTACK | SCRIPT_VERIFY_P2SH, true\n                               ).Num(11).PushSig(keys.key0).PushRedeem().ScriptError(SCRIPT_ERR_CLEANSTACK));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"P2SH with CLEANSTACK\", SCRIPT_VERIFY_CLEANSTACK | SCRIPT_VERIFY_P2SH, true\n                               ).PushSig(keys.key0).PushRedeem());\n\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"Basic P2WSH\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_SH,\n                                0, 1).PushWitSig(keys.key0).PushWitRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0),\n                                \"Basic P2WPKH\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_PKH,\n                                0, 1).PushWitSig(keys.key0).Push(keys.pubkey0).AsWit());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"Basic P2SH(P2WSH)\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_SH,\n                                0, 1).PushWitSig(keys.key0).PushWitRedeem().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0),\n                                \"Basic P2SH(P2WPKH)\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_PKH,\n                                0, 1).PushWitSig(keys.key0).Push(keys.pubkey0).AsWit().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG,\n                                \"Basic P2WSH with the wrong key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_SH\n                               ).PushWitSig(keys.key0).PushWitRedeem().ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1),\n                                \"Basic P2WPKH with the wrong key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_PKH\n                               ).PushWitSig(keys.key0).Push(keys.pubkey1).AsWit().ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG,\n                                \"Basic P2SH(P2WSH) with the wrong key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_SH\n                               ).PushWitSig(keys.key0).PushWitRedeem().PushRedeem().ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1),\n                                \"Basic P2SH(P2WPKH) with the wrong key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_PKH\n                               ).PushWitSig(keys.key0).Push(keys.pubkey1).AsWit().PushRedeem().ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG,\n                                \"Basic P2WSH with the wrong key but no WITNESS\", SCRIPT_VERIFY_P2SH, false, WITNESS_SH\n                               ).PushWitSig(keys.key0).PushWitRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1),\n                                \"Basic P2WPKH with the wrong key but no WITNESS\", SCRIPT_VERIFY_P2SH, false, WITNESS_PKH\n                               ).PushWitSig(keys.key0).Push(keys.pubkey1).AsWit());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1) << OP_CHECKSIG,\n                                \"Basic P2SH(P2WSH) with the wrong key but no WITNESS\", SCRIPT_VERIFY_P2SH, true, WITNESS_SH\n                               ).PushWitSig(keys.key0).PushWitRedeem().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1),\n                                \"Basic P2SH(P2WPKH) with the wrong key but no WITNESS\", SCRIPT_VERIFY_P2SH, true, WITNESS_PKH\n                               ).PushWitSig(keys.key0).Push(keys.pubkey1).AsWit().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"Basic P2WSH with wrong value\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_SH,\n                                0, 0).PushWitSig(keys.key0, 1).PushWitRedeem().ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0),\n                                \"Basic P2WPKH with wrong value\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_PKH,\n                                0, 0).PushWitSig(keys.key0, 1).Push(keys.pubkey0).AsWit().ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"Basic P2SH(P2WSH) with wrong value\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_SH,\n                                0, 0).PushWitSig(keys.key0, 1).PushWitRedeem().PushRedeem().ScriptError(SCRIPT_ERR_EVAL_FALSE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0),\n                                \"Basic P2SH(P2WPKH) with wrong value\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_PKH,\n                                0, 0).PushWitSig(keys.key0, 1).Push(keys.pubkey0).AsWit().PushRedeem().ScriptError(SCRIPT_ERR_EVAL_FALSE));\n\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0),\n                                \"P2WPKH with future witness version\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH |\n                                SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM, false, WITNESS_PKH, 1\n                               ).PushWitSig(keys.key0).Push(keys.pubkey0).AsWit().ScriptError(SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM));\n    {\n        CScript witscript = CScript() << ToByteVector(keys.pubkey0);\n        uint256 hash;\n        CSHA256().Write(&witscript[0], witscript.size()).Finalize(hash.begin());\n        std::vector<unsigned char> hashBytes = ToByteVector(hash);\n        hashBytes.pop_back();\n        tests.push_back(TestBuilder(CScript() << OP_0 << hashBytes,\n                                    \"P2WPKH with wrong witness program length\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false\n                                   ).PushWitSig(keys.key0).Push(keys.pubkey0).AsWit().ScriptError(SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH));\n    }\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"P2WSH with empty witness\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_SH\n                               ).ScriptError(SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY));\n    {\n        CScript witscript = CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG;\n        tests.push_back(TestBuilder(witscript,\n                                    \"P2WSH with witness program mismatch\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_SH\n                                   ).PushWitSig(keys.key0).Push(witscript).DamagePush(0).AsWit().ScriptError(SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH));\n    }\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0),\n                                \"P2WPKH with witness program mismatch\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_PKH\n                               ).PushWitSig(keys.key0).Push(keys.pubkey0).AsWit().Push(\"0\").AsWit().ScriptError(SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0),\n                                \"P2WPKH with non-empty scriptSig\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_PKH\n                               ).PushWitSig(keys.key0).Push(keys.pubkey0).AsWit().Num(11).ScriptError(SCRIPT_ERR_WITNESS_MALLEATED));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey1),\n                                \"P2SH(P2WPKH) with superfluous push in scriptSig\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_PKH\n                               ).PushWitSig(keys.key0).Push(keys.pubkey1).AsWit().Num(11).PushRedeem().ScriptError(SCRIPT_ERR_WITNESS_MALLEATED_P2SH));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"P2PK with witness\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH\n                               ).PushSig(keys.key0).Push(\"0\").AsWit().ScriptError(SCRIPT_ERR_WITNESS_UNEXPECTED));\n\n    // Compressed keys should pass SCRIPT_VERIFY_WITNESS_PUBKEYTYPE\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0C) << OP_CHECKSIG,\n                                \"Basic P2WSH with compressed key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, false, WITNESS_SH,\n                                0, 1).PushWitSig(keys.key0C).PushWitRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0C),\n                                \"Basic P2WPKH with compressed key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, false, WITNESS_PKH,\n                                0, 1).PushWitSig(keys.key0C).Push(keys.pubkey0C).AsWit());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0C) << OP_CHECKSIG,\n                                \"Basic P2SH(P2WSH) with compressed key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, true, WITNESS_SH,\n                                0, 1).PushWitSig(keys.key0C).PushWitRedeem().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0C),\n                                \"Basic P2SH(P2WPKH) with compressed key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, true, WITNESS_PKH,\n                                0, 1).PushWitSig(keys.key0C).Push(keys.pubkey0C).AsWit().PushRedeem());\n\n    // Testing uncompressed key in witness with SCRIPT_VERIFY_WITNESS_PUBKEYTYPE\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"Basic P2WSH\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, false, WITNESS_SH,\n                                0, 1).PushWitSig(keys.key0).PushWitRedeem().ScriptError(SCRIPT_ERR_WITNESS_PUBKEYTYPE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0),\n                                \"Basic P2WPKH\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, false, WITNESS_PKH,\n                                0, 1).PushWitSig(keys.key0).Push(keys.pubkey0).AsWit().ScriptError(SCRIPT_ERR_WITNESS_PUBKEYTYPE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0) << OP_CHECKSIG,\n                                \"Basic P2SH(P2WSH)\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, true, WITNESS_SH,\n                                0, 1).PushWitSig(keys.key0).PushWitRedeem().PushRedeem().ScriptError(SCRIPT_ERR_WITNESS_PUBKEYTYPE));\n    tests.push_back(TestBuilder(CScript() << ToByteVector(keys.pubkey0),\n                                \"Basic P2SH(P2WPKH)\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, true, WITNESS_PKH,\n                                0, 1).PushWitSig(keys.key0).Push(keys.pubkey0).AsWit().PushRedeem().ScriptError(SCRIPT_ERR_WITNESS_PUBKEYTYPE));\n\n    // P2WSH 1-of-2 multisig with compressed keys\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2WSH CHECKMULTISIG with compressed keys\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, false, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key0C).PushWitRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2SH(P2WSH) CHECKMULTISIG with compressed keys\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, true, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key0C).PushWitRedeem().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2WSH CHECKMULTISIG with compressed keys\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, false, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key1C).PushWitRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2SH(P2WSH) CHECKMULTISIG with compressed keys\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, true, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key1C).PushWitRedeem().PushRedeem());\n\n    // P2WSH 1-of-2 multisig with first key uncompressed\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2WSH CHECKMULTISIG with first key uncompressed and signing with the first key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key0).PushWitRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2SH(P2WSH) CHECKMULTISIG first key uncompressed and signing with the first key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key0).PushWitRedeem().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2WSH CHECKMULTISIG with first key uncompressed and signing with the first key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, false, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key0).PushWitRedeem().ScriptError(SCRIPT_ERR_WITNESS_PUBKEYTYPE));\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the first key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, true, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key0).PushWitRedeem().PushRedeem().ScriptError(SCRIPT_ERR_WITNESS_PUBKEYTYPE));\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2WSH CHECKMULTISIG with first key uncompressed and signing with the second key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key1C).PushWitRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the second key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key1C).PushWitRedeem().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2WSH CHECKMULTISIG with first key uncompressed and signing with the second key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, false, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key1C).PushWitRedeem().ScriptError(SCRIPT_ERR_WITNESS_PUBKEYTYPE));\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1C) << ToByteVector(keys.pubkey0) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2SH(P2WSH) CHECKMULTISIG with first key uncompressed and signing with the second key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, true, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key1C).PushWitRedeem().PushRedeem().ScriptError(SCRIPT_ERR_WITNESS_PUBKEYTYPE));\n    // P2WSH 1-of-2 multisig with second key uncompressed\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2WSH CHECKMULTISIG with second key uncompressed and signing with the first key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key0C).PushWitRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2SH(P2WSH) CHECKMULTISIG second key uncompressed and signing with the first key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key0C).PushWitRedeem().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2WSH CHECKMULTISIG with second key uncompressed and signing with the first key should pass as the uncompressed key is not used\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, false, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key0C).PushWitRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the first key should pass as the uncompressed key is not used\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, true, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key0C).PushWitRedeem().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key1).PushWitRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key1).PushWitRedeem().PushRedeem());\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2WSH CHECKMULTISIG with second key uncompressed and signing with the second key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, false, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key1).PushWitRedeem().ScriptError(SCRIPT_ERR_WITNESS_PUBKEYTYPE));\n    tests.push_back(TestBuilder(CScript() << OP_1 << ToByteVector(keys.pubkey1) << ToByteVector(keys.pubkey0C) << OP_2 << OP_CHECKMULTISIG,\n                                \"P2SH(P2WSH) CHECKMULTISIG with second key uncompressed and signing with the second key\", SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS_PUBKEYTYPE, true, WITNESS_SH,\n                                0, 1).Push(CScript()).AsWit().PushWitSig(keys.key1).PushWitRedeem().PushRedeem().ScriptError(SCRIPT_ERR_WITNESS_PUBKEYTYPE));\n\n    std::set<std::string> tests_set;\n\n    {\n        UniValue json_tests = read_json(std::string(json_tests::script_tests, json_tests::script_tests + sizeof(json_tests::script_tests)));\n\n        for (unsigned int idx = 0; idx < json_tests.size(); idx++) {\n            const UniValue& tv = json_tests[idx];\n            tests_set.insert(JSONPrettyPrint(tv.get_array()));\n        }\n    }\n\n    std::string strGen;\n\n    for (TestBuilder& test : tests) {\n        test.Test();\n        std::string str = JSONPrettyPrint(test.GetJSON());\n#ifndef UPDATE_JSON_TESTS\n        if (tests_set.count(str) == 0) {\n            BOOST_CHECK_MESSAGE(false, \"Missing auto script_valid test: \" + test.GetComment());\n        }\n#endif\n        strGen += str + \",\\n\";\n    }\n\n#ifdef UPDATE_JSON_TESTS\n    FILE* file = fopen(\"script_tests.json.gen\", \"w\");\n    fputs(strGen.c_str(), file);\n    fclose(file);\n#endif\n}\n\nBOOST_AUTO_TEST_CASE(script_json_test)\n{\n    // Read tests from test/data/script_tests.json\n    // Format is an array of arrays\n    // Inner arrays are [ [\"wit\"..., nValue]?, \"scriptSig\", \"scriptPubKey\", \"flags\", \"expected_scripterror\" ]\n    // ... where scriptSig and scriptPubKey are stringified\n    // scripts.\n    // If a witness is given, then the last value in the array should be the\n    // amount (nValue) to use in the crediting tx\n    UniValue tests = read_json(std::string(json_tests::script_tests, json_tests::script_tests + sizeof(json_tests::script_tests)));\n\n    for (unsigned int idx = 0; idx < tests.size(); idx++) {\n        UniValue test = tests[idx];\n        std::string strTest = test.write();\n        CScriptWitness witness;\n        CAmount nValue = 0;\n        unsigned int pos = 0;\n        if (test.size() > 0 && test[pos].isArray()) {\n            unsigned int i=0;\n            for (i = 0; i < test[pos].size()-1; i++) {\n                witness.stack.push_back(ParseHex(test[pos][i].get_str()));\n            }\n            nValue = AmountFromValue(test[pos][i]);\n            pos++;\n        }\n        if (test.size() < 4 + pos) // Allow size > 3; extra stuff ignored (useful for comments)\n        {\n            if (test.size() != 1) {\n                BOOST_ERROR(\"Bad test: \" << strTest);\n            }\n            continue;\n        }\n        std::string scriptSigString = test[pos++].get_str();\n        CScript scriptSig = ParseScript(scriptSigString);\n        std::string scriptPubKeyString = test[pos++].get_str();\n        CScript scriptPubKey = ParseScript(scriptPubKeyString);\n        unsigned int scriptflags = ParseScriptFlags(test[pos++].get_str());\n        int scriptError = ParseScriptError(test[pos++].get_str());\n\n        DoTest(scriptPubKey, scriptSig, witness, scriptflags, strTest, scriptError, nValue);\n    }\n}\n\nBOOST_AUTO_TEST_CASE(script_PushData)\n{\n    // Check that PUSHDATA1, PUSHDATA2, and PUSHDATA4 create the same value on\n    // the stack as the 1-75 opcodes do.\n    static const unsigned char direct[] = { 1, 0x5a };\n    static const unsigned char pushdata1[] = { OP_PUSHDATA1, 1, 0x5a };\n    static const unsigned char pushdata2[] = { OP_PUSHDATA2, 1, 0, 0x5a };\n    static const unsigned char pushdata4[] = { OP_PUSHDATA4, 1, 0, 0, 0, 0x5a };\n\n    ScriptError err;\n    std::vector<std::vector<unsigned char> > directStack;\n    BOOST_CHECK(EvalScript(directStack, CScript(&direct[0], &direct[sizeof(direct)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), SIGVERSION_BASE, &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n\n    std::vector<std::vector<unsigned char> > pushdata1Stack;\n    BOOST_CHECK(EvalScript(pushdata1Stack, CScript(&pushdata1[0], &pushdata1[sizeof(pushdata1)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), SIGVERSION_BASE, &err));\n    BOOST_CHECK(pushdata1Stack == directStack);\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n\n    std::vector<std::vector<unsigned char> > pushdata2Stack;\n    BOOST_CHECK(EvalScript(pushdata2Stack, CScript(&pushdata2[0], &pushdata2[sizeof(pushdata2)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), SIGVERSION_BASE, &err));\n    BOOST_CHECK(pushdata2Stack == directStack);\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n\n    std::vector<std::vector<unsigned char> > pushdata4Stack;\n    BOOST_CHECK(EvalScript(pushdata4Stack, CScript(&pushdata4[0], &pushdata4[sizeof(pushdata4)]), SCRIPT_VERIFY_P2SH, BaseSignatureChecker(), SIGVERSION_BASE, &err));\n    BOOST_CHECK(pushdata4Stack == directStack);\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n}\n\nCScript\nsign_multisig(CScript scriptPubKey, std::vector<CKey> keys, CTransaction transaction)\n{\n    uint256 hash = SignatureHash(scriptPubKey, transaction, 0, SIGHASH_ALL, 0, SIGVERSION_BASE);\n\n    CScript result;\n    //\n    // NOTE: CHECKMULTISIG has an unfortunate bug; it requires\n    // one extra item on the stack, before the signatures.\n    // Putting OP_0 on the stack is the workaround;\n    // fixing the bug would mean splitting the block chain (old\n    // clients would not accept new CHECKMULTISIG transactions,\n    // and vice-versa)\n    //\n    result << OP_0;\n    for (const CKey &key : keys)\n    {\n        std::vector<unsigned char> vchSig;\n        BOOST_CHECK(key.Sign(hash, vchSig));\n        vchSig.push_back((unsigned char)SIGHASH_ALL);\n        result << vchSig;\n    }\n    return result;\n}\nCScript\nsign_multisig(CScript scriptPubKey, const CKey &key, CTransaction transaction)\n{\n    std::vector<CKey> keys;\n    keys.push_back(key);\n    return sign_multisig(scriptPubKey, keys, transaction);\n}\n\nBOOST_AUTO_TEST_CASE(script_CHECKMULTISIG12)\n{\n    ScriptError err;\n    CKey key1, key2, key3;\n    key1.MakeNewKey(true);\n    key2.MakeNewKey(false);\n    key3.MakeNewKey(true);\n\n    CScript scriptPubKey12;\n    scriptPubKey12 << OP_1 << ToByteVector(key1.GetPubKey()) << ToByteVector(key2.GetPubKey()) << OP_2 << OP_CHECKMULTISIG;\n\n    CMutableTransaction txFrom12 = BuildCreditingTransaction(scriptPubKey12);\n    CMutableTransaction txTo12 = BuildSpendingTransaction(CScript(), CScriptWitness(), txFrom12);\n\n    CScript goodsig1 = sign_multisig(scriptPubKey12, key1, txTo12);\n    BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey12, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo12, 0, txFrom12.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n    txTo12.vout[0].nValue = 2;\n    BOOST_CHECK(!VerifyScript(goodsig1, scriptPubKey12, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo12, 0, txFrom12.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));\n\n    CScript goodsig2 = sign_multisig(scriptPubKey12, key2, txTo12);\n    BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey12, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo12, 0, txFrom12.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n\n    CScript badsig1 = sign_multisig(scriptPubKey12, key3, txTo12);\n    BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey12, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo12, 0, txFrom12.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));\n}\n\nBOOST_AUTO_TEST_CASE(script_CHECKMULTISIG23)\n{\n    ScriptError err;\n    CKey key1, key2, key3, key4;\n    key1.MakeNewKey(true);\n    key2.MakeNewKey(false);\n    key3.MakeNewKey(true);\n    key4.MakeNewKey(false);\n\n    CScript scriptPubKey23;\n    scriptPubKey23 << OP_2 << ToByteVector(key1.GetPubKey()) << ToByteVector(key2.GetPubKey()) << ToByteVector(key3.GetPubKey()) << OP_3 << OP_CHECKMULTISIG;\n\n    CMutableTransaction txFrom23 = BuildCreditingTransaction(scriptPubKey23);\n    CMutableTransaction txTo23 = BuildSpendingTransaction(CScript(), CScriptWitness(), txFrom23);\n\n    std::vector<CKey> keys;\n    keys.push_back(key1); keys.push_back(key2);\n    CScript goodsig1 = sign_multisig(scriptPubKey23, keys, txTo23);\n    BOOST_CHECK(VerifyScript(goodsig1, scriptPubKey23, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n\n    keys.clear();\n    keys.push_back(key1); keys.push_back(key3);\n    CScript goodsig2 = sign_multisig(scriptPubKey23, keys, txTo23);\n    BOOST_CHECK(VerifyScript(goodsig2, scriptPubKey23, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n\n    keys.clear();\n    keys.push_back(key2); keys.push_back(key3);\n    CScript goodsig3 = sign_multisig(scriptPubKey23, keys, txTo23);\n    BOOST_CHECK(VerifyScript(goodsig3, scriptPubKey23, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n\n    keys.clear();\n    keys.push_back(key2); keys.push_back(key2); // Can't re-use sig\n    CScript badsig1 = sign_multisig(scriptPubKey23, keys, txTo23);\n    BOOST_CHECK(!VerifyScript(badsig1, scriptPubKey23, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));\n\n    keys.clear();\n    keys.push_back(key2); keys.push_back(key1); // sigs must be in correct order\n    CScript badsig2 = sign_multisig(scriptPubKey23, keys, txTo23);\n    BOOST_CHECK(!VerifyScript(badsig2, scriptPubKey23, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));\n\n    keys.clear();\n    keys.push_back(key3); keys.push_back(key2); // sigs must be in correct order\n    CScript badsig3 = sign_multisig(scriptPubKey23, keys, txTo23);\n    BOOST_CHECK(!VerifyScript(badsig3, scriptPubKey23, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));\n\n    keys.clear();\n    keys.push_back(key4); keys.push_back(key2); // sigs must match pubkeys\n    CScript badsig4 = sign_multisig(scriptPubKey23, keys, txTo23);\n    BOOST_CHECK(!VerifyScript(badsig4, scriptPubKey23, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));\n\n    keys.clear();\n    keys.push_back(key1); keys.push_back(key4); // sigs must match pubkeys\n    CScript badsig5 = sign_multisig(scriptPubKey23, keys, txTo23);\n    BOOST_CHECK(!VerifyScript(badsig5, scriptPubKey23, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_EVAL_FALSE, ScriptErrorString(err));\n\n    keys.clear(); // Must have signatures\n    CScript badsig6 = sign_multisig(scriptPubKey23, keys, txTo23);\n    BOOST_CHECK(!VerifyScript(badsig6, scriptPubKey23, nullptr, gFlags, MutableTransactionSignatureChecker(&txTo23, 0, txFrom23.vout[0].nValue), &err));\n    BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_INVALID_STACK_OPERATION, ScriptErrorString(err));\n}\n\nBOOST_AUTO_TEST_CASE(script_combineSigs)\n{\n    // Test the CombineSignatures function\n    CAmount amount = 0;\n    CBasicKeyStore keystore;\n    std::vector<CKey> keys;\n    std::vector<CPubKey> pubkeys;\n    for (int i = 0; i < 3; i++)\n    {\n        CKey key;\n        key.MakeNewKey(i%2 == 1);\n        keys.push_back(key);\n        pubkeys.push_back(key.GetPubKey());\n        keystore.AddKey(key);\n    }\n\n    CMutableTransaction txFrom = BuildCreditingTransaction(GetScriptForDestination(keys[0].GetPubKey().GetID()));\n    CMutableTransaction txTo = BuildSpendingTransaction(CScript(), CScriptWitness(), txFrom);\n    CScript& scriptPubKey = txFrom.vout[0].scriptPubKey;\n    CScript& scriptSig = txTo.vin[0].scriptSig;\n\n    SignatureData empty;\n    SignatureData combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), empty, empty);\n    BOOST_CHECK(combined.scriptSig.empty());\n\n    // Single signature case:\n    SignSignature(keystore, txFrom, txTo, 0, SIGHASH_ALL); // changes scriptSig\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSig), empty);\n    BOOST_CHECK(combined.scriptSig == scriptSig);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), empty, SignatureData(scriptSig));\n    BOOST_CHECK(combined.scriptSig == scriptSig);\n    CScript scriptSigCopy = scriptSig;\n    // Signing again will give a different, valid signature:\n    SignSignature(keystore, txFrom, txTo, 0, SIGHASH_ALL);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSigCopy), SignatureData(scriptSig));\n    BOOST_CHECK(combined.scriptSig == scriptSigCopy || combined.scriptSig == scriptSig);\n\n    // P2SH, single-signature case:\n    CScript pkSingle; pkSingle << ToByteVector(keys[0].GetPubKey()) << OP_CHECKSIG;\n    keystore.AddCScript(pkSingle);\n    scriptPubKey = GetScriptForDestination(CScriptID(pkSingle));\n    SignSignature(keystore, txFrom, txTo, 0, SIGHASH_ALL);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSig), empty);\n    BOOST_CHECK(combined.scriptSig == scriptSig);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), empty, SignatureData(scriptSig));\n    BOOST_CHECK(combined.scriptSig == scriptSig);\n    scriptSigCopy = scriptSig;\n    SignSignature(keystore, txFrom, txTo, 0, SIGHASH_ALL);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSigCopy), SignatureData(scriptSig));\n    BOOST_CHECK(combined.scriptSig == scriptSigCopy || combined.scriptSig == scriptSig);\n    // dummy scriptSigCopy with placeholder, should always choose non-placeholder:\n    scriptSigCopy = CScript() << OP_0 << std::vector<unsigned char>(pkSingle.begin(), pkSingle.end());\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSigCopy), SignatureData(scriptSig));\n    BOOST_CHECK(combined.scriptSig == scriptSig);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSig), SignatureData(scriptSigCopy));\n    BOOST_CHECK(combined.scriptSig == scriptSig);\n\n    // Hardest case:  Multisig 2-of-3\n    scriptPubKey = GetScriptForMultisig(2, pubkeys);\n    keystore.AddCScript(scriptPubKey);\n    SignSignature(keystore, txFrom, txTo, 0, SIGHASH_ALL);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(scriptSig), empty);\n    BOOST_CHECK(combined.scriptSig == scriptSig);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), empty, SignatureData(scriptSig));\n    BOOST_CHECK(combined.scriptSig == scriptSig);\n\n    // A couple of partially-signed versions:\n    std::vector<unsigned char> sig1;\n    uint256 hash1 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_ALL, 0, SIGVERSION_BASE);\n    BOOST_CHECK(keys[0].Sign(hash1, sig1));\n    sig1.push_back(SIGHASH_ALL);\n    std::vector<unsigned char> sig2;\n    uint256 hash2 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_NONE, 0, SIGVERSION_BASE);\n    BOOST_CHECK(keys[1].Sign(hash2, sig2));\n    sig2.push_back(SIGHASH_NONE);\n    std::vector<unsigned char> sig3;\n    uint256 hash3 = SignatureHash(scriptPubKey, txTo, 0, SIGHASH_SINGLE, 0, SIGVERSION_BASE);\n    BOOST_CHECK(keys[2].Sign(hash3, sig3));\n    sig3.push_back(SIGHASH_SINGLE);\n\n    // Not fussy about order (or even existence) of placeholders or signatures:\n    CScript partial1a = CScript() << OP_0 << sig1 << OP_0;\n    CScript partial1b = CScript() << OP_0 << OP_0 << sig1;\n    CScript partial2a = CScript() << OP_0 << sig2;\n    CScript partial2b = CScript() << sig2 << OP_0;\n    CScript partial3a = CScript() << sig3;\n    CScript partial3b = CScript() << OP_0 << OP_0 << sig3;\n    CScript partial3c = CScript() << OP_0 << sig3 << OP_0;\n    CScript complete12 = CScript() << OP_0 << sig1 << sig2;\n    CScript complete13 = CScript() << OP_0 << sig1 << sig3;\n    CScript complete23 = CScript() << OP_0 << sig2 << sig3;\n\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial1a), SignatureData(partial1b));\n    BOOST_CHECK(combined.scriptSig == partial1a);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial1a), SignatureData(partial2a));\n    BOOST_CHECK(combined.scriptSig == complete12);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial2a), SignatureData(partial1a));\n    BOOST_CHECK(combined.scriptSig == complete12);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial1b), SignatureData(partial2b));\n    BOOST_CHECK(combined.scriptSig == complete12);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial3b), SignatureData(partial1b));\n    BOOST_CHECK(combined.scriptSig == complete13);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial2a), SignatureData(partial3a));\n    BOOST_CHECK(combined.scriptSig == complete23);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial3b), SignatureData(partial2b));\n    BOOST_CHECK(combined.scriptSig == complete23);\n    combined = CombineSignatures(scriptPubKey, MutableTransactionSignatureChecker(&txTo, 0, amount), SignatureData(partial3b), SignatureData(partial3a));\n    BOOST_CHECK(combined.scriptSig == partial3c);\n}\n\nBOOST_AUTO_TEST_CASE(script_standard_push)\n{\n    ScriptError err;\n    for (int i=0; i<67000; i++) {\n        CScript script;\n        script << i;\n        BOOST_CHECK_MESSAGE(script.IsPushOnly(), \"Number \" << i << \" is not pure push.\");\n        BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, nullptr, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker(), &err), \"Number \" << i << \" push is not minimal data.\");\n        BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n    }\n\n    for (unsigned int i=0; i<=MAX_SCRIPT_ELEMENT_SIZE; i++) {\n        std::vector<unsigned char> data(i, '\\111');\n        CScript script;\n        script << data;\n        BOOST_CHECK_MESSAGE(script.IsPushOnly(), \"Length \" << i << \" is not pure push.\");\n        BOOST_CHECK_MESSAGE(VerifyScript(script, CScript() << OP_1, nullptr, SCRIPT_VERIFY_MINIMALDATA, BaseSignatureChecker(), &err), \"Length \" << i << \" push is not minimal data.\");\n        BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n    }\n}\n\nBOOST_AUTO_TEST_CASE(script_IsPushOnly_on_invalid_scripts)\n{\n    // IsPushOnly returns false when given a script containing only pushes that\n    // are invalid due to truncation. IsPushOnly() is consensus critical\n    // because P2SH evaluation uses it, although this specific behavior should\n    // not be consensus critical as the P2SH evaluation would fail first due to\n    // the invalid push. Still, it doesn't hurt to test it explicitly.\n    static const unsigned char direct[] = { 1 };\n    BOOST_CHECK(!CScript(direct, direct+sizeof(direct)).IsPushOnly());\n}\n\nBOOST_AUTO_TEST_CASE(script_GetScriptAsm)\n{\n    BOOST_CHECK_EQUAL(\"OP_CHECKLOCKTIMEVERIFY\", ScriptToAsmStr(CScript() << OP_NOP2, true));\n    BOOST_CHECK_EQUAL(\"OP_CHECKLOCKTIMEVERIFY\", ScriptToAsmStr(CScript() << OP_CHECKLOCKTIMEVERIFY, true));\n    BOOST_CHECK_EQUAL(\"OP_CHECKLOCKTIMEVERIFY\", ScriptToAsmStr(CScript() << OP_NOP2));\n    BOOST_CHECK_EQUAL(\"OP_CHECKLOCKTIMEVERIFY\", ScriptToAsmStr(CScript() << OP_CHECKLOCKTIMEVERIFY));\n\n    std::string derSig(\"304502207fa7a6d1e0ee81132a269ad84e68d695483745cde8b541e3bf630749894e342a022100c1f7ab20e13e22fb95281a870f3dcf38d782e53023ee313d741ad0cfbc0c5090\");\n    std::string pubKey(\"03b0da749730dc9b4b1f4a14d6902877a92541f5368778853d9c4a0cb7802dcfb2\");\n    std::vector<unsigned char> vchPubKey = ToByteVector(ParseHex(pubKey));\n\n    BOOST_CHECK_EQUAL(derSig + \"00 \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"00\")) << vchPubKey, true));\n    BOOST_CHECK_EQUAL(derSig + \"80 \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"80\")) << vchPubKey, true));\n    BOOST_CHECK_EQUAL(derSig + \"[ALL] \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"01\")) << vchPubKey, true));\n    BOOST_CHECK_EQUAL(derSig + \"[NONE] \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"02\")) << vchPubKey, true));\n    BOOST_CHECK_EQUAL(derSig + \"[SINGLE] \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"03\")) << vchPubKey, true));\n    BOOST_CHECK_EQUAL(derSig + \"[ALL|ANYONECANPAY] \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"81\")) << vchPubKey, true));\n    BOOST_CHECK_EQUAL(derSig + \"[NONE|ANYONECANPAY] \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"82\")) << vchPubKey, true));\n    BOOST_CHECK_EQUAL(derSig + \"[SINGLE|ANYONECANPAY] \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"83\")) << vchPubKey, true));\n\n    BOOST_CHECK_EQUAL(derSig + \"00 \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"00\")) << vchPubKey));\n    BOOST_CHECK_EQUAL(derSig + \"80 \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"80\")) << vchPubKey));\n    BOOST_CHECK_EQUAL(derSig + \"01 \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"01\")) << vchPubKey));\n    BOOST_CHECK_EQUAL(derSig + \"02 \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"02\")) << vchPubKey));\n    BOOST_CHECK_EQUAL(derSig + \"03 \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"03\")) << vchPubKey));\n    BOOST_CHECK_EQUAL(derSig + \"81 \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"81\")) << vchPubKey));\n    BOOST_CHECK_EQUAL(derSig + \"82 \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"82\")) << vchPubKey));\n    BOOST_CHECK_EQUAL(derSig + \"83 \" + pubKey, ScriptToAsmStr(CScript() << ToByteVector(ParseHex(derSig + \"83\")) << vchPubKey));\n}\n\nstatic CScript\nScriptFromHex(const char* hex)\n{\n    std::vector<unsigned char> data = ParseHex(hex);\n    return CScript(data.begin(), data.end());\n}\n\n\nBOOST_AUTO_TEST_CASE(script_FindAndDelete)\n{\n    // Exercise the FindAndDelete functionality\n    CScript s;\n    CScript d;\n    CScript expect;\n\n    s = CScript() << OP_1 << OP_2;\n    d = CScript(); // delete nothing should be a no-op\n    expect = s;\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 0);\n    BOOST_CHECK(s == expect);\n\n    s = CScript() << OP_1 << OP_2 << OP_3;\n    d = CScript() << OP_2;\n    expect = CScript() << OP_1 << OP_3;\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 1);\n    BOOST_CHECK(s == expect);\n\n    s = CScript() << OP_3 << OP_1 << OP_3 << OP_3 << OP_4 << OP_3;\n    d = CScript() << OP_3;\n    expect = CScript() << OP_1 << OP_4;\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 4);\n    BOOST_CHECK(s == expect);\n\n    s = ScriptFromHex(\"0302ff03\"); // PUSH 0x02ff03 onto stack\n    d = ScriptFromHex(\"0302ff03\");\n    expect = CScript();\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 1);\n    BOOST_CHECK(s == expect);\n\n    s = ScriptFromHex(\"0302ff030302ff03\"); // PUSH 0x2ff03 PUSH 0x2ff03\n    d = ScriptFromHex(\"0302ff03\");\n    expect = CScript();\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 2);\n    BOOST_CHECK(s == expect);\n\n    s = ScriptFromHex(\"0302ff030302ff03\");\n    d = ScriptFromHex(\"02\");\n    expect = s; // FindAndDelete matches entire opcodes\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 0);\n    BOOST_CHECK(s == expect);\n\n    s = ScriptFromHex(\"0302ff030302ff03\");\n    d = ScriptFromHex(\"ff\");\n    expect = s;\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 0);\n    BOOST_CHECK(s == expect);\n\n    // This is an odd edge case: strip of the push-three-bytes\n    // prefix, leaving 02ff03 which is push-two-bytes:\n    s = ScriptFromHex(\"0302ff030302ff03\");\n    d = ScriptFromHex(\"03\");\n    expect = CScript() << ParseHex(\"ff03\") << ParseHex(\"ff03\");\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 2);\n    BOOST_CHECK(s == expect);\n\n    // Byte sequence that spans multiple opcodes:\n    s = ScriptFromHex(\"02feed5169\"); // PUSH(0xfeed) OP_1 OP_VERIFY\n    d = ScriptFromHex(\"feed51\");\n    expect = s;\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 0); // doesn't match 'inside' opcodes\n    BOOST_CHECK(s == expect);\n\n    s = ScriptFromHex(\"02feed5169\"); // PUSH(0xfeed) OP_1 OP_VERIFY\n    d = ScriptFromHex(\"02feed51\");\n    expect = ScriptFromHex(\"69\");\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 1);\n    BOOST_CHECK(s == expect);\n\n    s = ScriptFromHex(\"516902feed5169\");\n    d = ScriptFromHex(\"feed51\");\n    expect = s;\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 0);\n    BOOST_CHECK(s == expect);\n\n    s = ScriptFromHex(\"516902feed5169\");\n    d = ScriptFromHex(\"02feed51\");\n    expect = ScriptFromHex(\"516969\");\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 1);\n    BOOST_CHECK(s == expect);\n\n    s = CScript() << OP_0 << OP_0 << OP_1 << OP_1;\n    d = CScript() << OP_0 << OP_1;\n    expect = CScript() << OP_0 << OP_1; // FindAndDelete is single-pass\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 1);\n    BOOST_CHECK(s == expect);\n\n    s = CScript() << OP_0 << OP_0 << OP_1 << OP_0 << OP_1 << OP_1;\n    d = CScript() << OP_0 << OP_1;\n    expect = CScript() << OP_0 << OP_1; // FindAndDelete is single-pass\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 2);\n    BOOST_CHECK(s == expect);\n\n    // Another weird edge case:\n    // End with invalid push (not enough data)...\n    s = ScriptFromHex(\"0003feed\");\n    d = ScriptFromHex(\"03feed\"); // ... can remove the invalid push\n    expect = ScriptFromHex(\"00\");\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 1);\n    BOOST_CHECK(s == expect);\n\n    s = ScriptFromHex(\"0003feed\");\n    d = ScriptFromHex(\"00\");\n    expect = ScriptFromHex(\"03feed\");\n    BOOST_CHECK_EQUAL(s.FindAndDelete(d), 1);\n    BOOST_CHECK(s == expect);\n}\n\nBOOST_AUTO_TEST_CASE(script_HasValidOps)\n{\n    // Exercise the HasValidOps functionality\n    CScript script;\n    script = ScriptFromHex(\"76a9141234567890abcdefa1a2a3a4a5a6a7a8a9a0aaab88ac\"); // Normal script\n    BOOST_CHECK(script.HasValidOps());\n    script = ScriptFromHex(\"76a914ff34567890abcdefa1a2a3a4a5a6a7a8a9a0aaab88ac\");\n    BOOST_CHECK(script.HasValidOps());\n    script = ScriptFromHex(\"ff88ac\"); // Script with OP_INVALIDOPCODE explicit\n    BOOST_CHECK(!script.HasValidOps());\n    script = ScriptFromHex(\"88acc0\"); // Script with undefined opcode\n    BOOST_CHECK(!script.HasValidOps());\n}\n\nBOOST_AUTO_TEST_CASE(script_can_append_self)\n{\n    CScript s, d;\n\n    s = ScriptFromHex(\"00\");\n    s += s;\n    d = ScriptFromHex(\"0000\");\n    BOOST_CHECK(s == d);\n\n    // check doubling a script that's large enough to require reallocation\n    static const char hex[] = \"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f\";\n    s = CScript() << ParseHex(hex) << OP_CHECKSIG;\n    d = CScript() << ParseHex(hex) << OP_CHECKSIG << ParseHex(hex) << OP_CHECKSIG;\n    s += s;\n    BOOST_CHECK(s == d);\n}\n\n\n#if defined(HAVE_CONSENSUS_LIB)\n\n/* Test simple (successful) usage of bitcoinconsensus_verify_script */\nBOOST_AUTO_TEST_CASE(bitcoinconsensus_verify_script_returns_true)\n{\n    unsigned int libconsensus_flags = 0;\n    int nIn = 0;\n\n    CScript scriptPubKey;\n    CScript scriptSig;\n    CScriptWitness wit;\n\n    scriptPubKey << OP_1;\n    CTransaction creditTx = BuildCreditingTransaction(scriptPubKey, 1);\n    CTransaction spendTx = BuildSpendingTransaction(scriptSig, wit, creditTx);\n\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << spendTx;\n\n    bitcoinconsensus_error err;\n    int result = bitcoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), nIn, libconsensus_flags, &err);\n    BOOST_CHECK_EQUAL(result, 1);\n    BOOST_CHECK_EQUAL(err, bitcoinconsensus_ERR_OK);\n}\n\n/* Test bitcoinconsensus_verify_script returns invalid tx index err*/\nBOOST_AUTO_TEST_CASE(bitcoinconsensus_verify_script_tx_index_err)\n{\n    unsigned int libconsensus_flags = 0;\n    int nIn = 3;\n\n    CScript scriptPubKey;\n    CScript scriptSig;\n    CScriptWitness wit;\n\n    scriptPubKey << OP_EQUAL;\n    CTransaction creditTx = BuildCreditingTransaction(scriptPubKey, 1);\n    CTransaction spendTx = BuildSpendingTransaction(scriptSig, wit, creditTx);\n\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << spendTx;\n\n    bitcoinconsensus_error err;\n    int result = bitcoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), nIn, libconsensus_flags, &err);\n    BOOST_CHECK_EQUAL(result, 0);\n    BOOST_CHECK_EQUAL(err, bitcoinconsensus_ERR_TX_INDEX);\n}\n\n/* Test bitcoinconsensus_verify_script returns tx size mismatch err*/\nBOOST_AUTO_TEST_CASE(bitcoinconsensus_verify_script_tx_size)\n{\n    unsigned int libconsensus_flags = 0;\n    int nIn = 0;\n\n    CScript scriptPubKey;\n    CScript scriptSig;\n    CScriptWitness wit;\n\n    scriptPubKey << OP_EQUAL;\n    CTransaction creditTx = BuildCreditingTransaction(scriptPubKey, 1);\n    CTransaction spendTx = BuildSpendingTransaction(scriptSig, wit, creditTx);\n\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << spendTx;\n\n    bitcoinconsensus_error err;\n    int result = bitcoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size() * 2, nIn, libconsensus_flags, &err);\n    BOOST_CHECK_EQUAL(result, 0);\n    BOOST_CHECK_EQUAL(err, bitcoinconsensus_ERR_TX_SIZE_MISMATCH);\n}\n\n/* Test bitcoinconsensus_verify_script returns invalid tx serialization error */\nBOOST_AUTO_TEST_CASE(bitcoinconsensus_verify_script_tx_serialization)\n{\n    unsigned int libconsensus_flags = 0;\n    int nIn = 0;\n\n    CScript scriptPubKey;\n    CScript scriptSig;\n    CScriptWitness wit;\n\n    scriptPubKey << OP_EQUAL;\n    CTransaction creditTx = BuildCreditingTransaction(scriptPubKey, 1);\n    CTransaction spendTx = BuildSpendingTransaction(scriptSig, wit, creditTx);\n\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << 0xffffffff;\n\n    bitcoinconsensus_error err;\n    int result = bitcoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), nIn, libconsensus_flags, &err);\n    BOOST_CHECK_EQUAL(result, 0);\n    BOOST_CHECK_EQUAL(err, bitcoinconsensus_ERR_TX_DESERIALIZE);\n}\n\n/* Test bitcoinconsensus_verify_script returns amount required error */\nBOOST_AUTO_TEST_CASE(bitcoinconsensus_verify_script_amount_required_err)\n{\n    unsigned int libconsensus_flags = bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS;\n    int nIn = 0;\n\n    CScript scriptPubKey;\n    CScript scriptSig;\n    CScriptWitness wit;\n\n    scriptPubKey << OP_EQUAL;\n    CTransaction creditTx = BuildCreditingTransaction(scriptPubKey, 1);\n    CTransaction spendTx = BuildSpendingTransaction(scriptSig, wit, creditTx);\n\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << spendTx;\n\n    bitcoinconsensus_error err;\n    int result = bitcoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), nIn, libconsensus_flags, &err);\n    BOOST_CHECK_EQUAL(result, 0);\n    BOOST_CHECK_EQUAL(err, bitcoinconsensus_ERR_AMOUNT_REQUIRED);\n}\n\n/* Test bitcoinconsensus_verify_script returns invalid flags err */\nBOOST_AUTO_TEST_CASE(bitcoinconsensus_verify_script_invalid_flags)\n{\n    unsigned int libconsensus_flags = 1 << 3;\n    int nIn = 0;\n\n    CScript scriptPubKey;\n    CScript scriptSig;\n    CScriptWitness wit;\n\n    scriptPubKey << OP_EQUAL;\n    CTransaction creditTx = BuildCreditingTransaction(scriptPubKey, 1);\n    CTransaction spendTx = BuildSpendingTransaction(scriptSig, wit, creditTx);\n\n    CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);\n    stream << spendTx;\n\n    bitcoinconsensus_error err;\n    int result = bitcoinconsensus_verify_script(scriptPubKey.data(), scriptPubKey.size(), (const unsigned char*)&stream[0], stream.size(), nIn, libconsensus_flags, &err);\n    BOOST_CHECK_EQUAL(result, 0);\n    BOOST_CHECK_EQUAL(err, bitcoinconsensus_ERR_INVALID_FLAGS);\n}\n\n#endif\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/scriptnum10.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_TEST_SCRIPTNUM10_H\n#define BITCOIN_TEST_SCRIPTNUM10_H\n\n#include <algorithm>\n#include <limits>\n#include <stdexcept>\n#include <stdint.h>\n#include <string>\n#include <vector>\n#include <assert.h>\n\nclass scriptnum10_error : public std::runtime_error\n{\npublic:\n    explicit scriptnum10_error(const std::string& str) : std::runtime_error(str) {}\n};\n\nclass CScriptNum10\n{\n/**\n * The ScriptNum implementation from Bitcoin Core 0.10.0, for cross-comparison.\n */\npublic:\n\n    explicit CScriptNum10(const int64_t& n)\n    {\n        m_value = n;\n    }\n\n    static const size_t nDefaultMaxNumSize = 4;\n\n    explicit CScriptNum10(const std::vector<unsigned char>& vch, bool fRequireMinimal,\n                        const size_t nMaxNumSize = nDefaultMaxNumSize)\n    {\n        if (vch.size() > nMaxNumSize) {\n            throw scriptnum10_error(\"script number overflow\");\n        }\n        if (fRequireMinimal && vch.size() > 0) {\n            // Check that the number is encoded with the minimum possible\n            // number of bytes.\n            //\n            // If the most-significant-byte - excluding the sign bit - is zero\n            // then we're not minimal. Note how this test also rejects the\n            // negative-zero encoding, 0x80.\n            if ((vch.back() & 0x7f) == 0) {\n                // One exception: if there's more than one byte and the most\n                // significant bit of the second-most-significant-byte is set\n                // it would conflict with the sign bit. An example of this case\n                // is +-255, which encode to 0xff00 and 0xff80 respectively.\n                // (big-endian).\n                if (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0) {\n                    throw scriptnum10_error(\"non-minimally encoded script number\");\n                }\n            }\n        }\n        m_value = set_vch(vch);\n    }\n\n    inline bool operator==(const int64_t& rhs) const    { return m_value == rhs; }\n    inline bool operator!=(const int64_t& rhs) const    { return m_value != rhs; }\n    inline bool operator<=(const int64_t& rhs) const    { return m_value <= rhs; }\n    inline bool operator< (const int64_t& rhs) const    { return m_value <  rhs; }\n    inline bool operator>=(const int64_t& rhs) const    { return m_value >= rhs; }\n    inline bool operator> (const int64_t& rhs) const    { return m_value >  rhs; }\n\n    inline bool operator==(const CScriptNum10& rhs) const { return operator==(rhs.m_value); }\n    inline bool operator!=(const CScriptNum10& rhs) const { return operator!=(rhs.m_value); }\n    inline bool operator<=(const CScriptNum10& rhs) const { return operator<=(rhs.m_value); }\n    inline bool operator< (const CScriptNum10& rhs) const { return operator< (rhs.m_value); }\n    inline bool operator>=(const CScriptNum10& rhs) const { return operator>=(rhs.m_value); }\n    inline bool operator> (const CScriptNum10& rhs) const { return operator> (rhs.m_value); }\n\n    inline CScriptNum10 operator+(   const int64_t& rhs)    const { return CScriptNum10(m_value + rhs);}\n    inline CScriptNum10 operator-(   const int64_t& rhs)    const { return CScriptNum10(m_value - rhs);}\n    inline CScriptNum10 operator+(   const CScriptNum10& rhs) const { return operator+(rhs.m_value);   }\n    inline CScriptNum10 operator-(   const CScriptNum10& rhs) const { return operator-(rhs.m_value);   }\n\n    inline CScriptNum10& operator+=( const CScriptNum10& rhs)       { return operator+=(rhs.m_value);  }\n    inline CScriptNum10& operator-=( const CScriptNum10& rhs)       { return operator-=(rhs.m_value);  }\n\n    inline CScriptNum10 operator-()                         const\n    {\n        assert(m_value != std::numeric_limits<int64_t>::min());\n        return CScriptNum10(-m_value);\n    }\n\n    inline CScriptNum10& operator=( const int64_t& rhs)\n    {\n        m_value = rhs;\n        return *this;\n    }\n\n    inline CScriptNum10& operator+=( const int64_t& rhs)\n    {\n        assert(rhs == 0 || (rhs > 0 && m_value <= std::numeric_limits<int64_t>::max() - rhs) ||\n                           (rhs < 0 && m_value >= std::numeric_limits<int64_t>::min() - rhs));\n        m_value += rhs;\n        return *this;\n    }\n\n    inline CScriptNum10& operator-=( const int64_t& rhs)\n    {\n        assert(rhs == 0 || (rhs > 0 && m_value >= std::numeric_limits<int64_t>::min() + rhs) ||\n                           (rhs < 0 && m_value <= std::numeric_limits<int64_t>::max() + rhs));\n        m_value -= rhs;\n        return *this;\n    }\n\n    int getint() const\n    {\n        if (m_value > std::numeric_limits<int>::max())\n            return std::numeric_limits<int>::max();\n        else if (m_value < std::numeric_limits<int>::min())\n            return std::numeric_limits<int>::min();\n        return m_value;\n    }\n\n    std::vector<unsigned char> getvch() const\n    {\n        return serialize(m_value);\n    }\n\n    static std::vector<unsigned char> serialize(const int64_t& value)\n    {\n        if(value == 0)\n            return std::vector<unsigned char>();\n\n        std::vector<unsigned char> result;\n        const bool neg = value < 0;\n        uint64_t absvalue = neg ? -value : value;\n\n        while(absvalue)\n        {\n            result.push_back(absvalue & 0xff);\n            absvalue >>= 8;\n        }\n\n//    - If the most significant byte is >= 0x80 and the value is positive, push a\n//    new zero-byte to make the significant byte < 0x80 again.\n\n//    - If the most significant byte is >= 0x80 and the value is negative, push a\n//    new 0x80 byte that will be popped off when converting to an integral.\n\n//    - If the most significant byte is < 0x80 and the value is negative, add\n//    0x80 to it, since it will be subtracted and interpreted as a negative when\n//    converting to an integral.\n\n        if (result.back() & 0x80)\n            result.push_back(neg ? 0x80 : 0);\n        else if (neg)\n            result.back() |= 0x80;\n\n        return result;\n    }\n\nprivate:\n    static int64_t set_vch(const std::vector<unsigned char>& vch)\n    {\n      if (vch.empty())\n          return 0;\n\n      int64_t result = 0;\n      for (size_t i = 0; i != vch.size(); ++i)\n          result |= static_cast<int64_t>(vch[i]) << 8*i;\n\n      // If the input vector's most significant byte is 0x80, remove it from\n      // the result's msb and return a negative.\n      if (vch.back() & 0x80)\n          return -((int64_t)(result & ~(0x80ULL << (8 * (vch.size() - 1)))));\n\n      return result;\n    }\n\n    int64_t m_value;\n};\n\n\n#endif // BITCOIN_TEST_BIGNUM_H\n"
  },
  {
    "path": "src/test/scriptnum_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <test/scriptnum10.h>\n#include <script/script.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n#include <limits.h>\n#include <stdint.h>\n\nBOOST_FIXTURE_TEST_SUITE(scriptnum_tests, BasicTestingSetup)\n\n/** A selection of numbers that do not trigger int64_t overflow\n *  when added/subtracted. */\nstatic const int64_t values[] = { 0, 1, -2, 127, 128, -255, 256, (1LL << 15) - 1, -(1LL << 16), (1LL << 24) - 1, (1LL << 31), 1 - (1LL << 32), 1LL << 40 };\n\nstatic const int64_t offsets[] = { 1, 0x79, 0x80, 0x81, 0xFF, 0x7FFF, 0x8000, 0xFFFF, 0x10000};\n\nstatic bool verify(const CScriptNum10& bignum, const CScriptNum& scriptnum)\n{\n    return bignum.getvch() == scriptnum.getvch() && bignum.getint() == scriptnum.getint();\n}\n\nstatic void CheckCreateVch(const int64_t& num)\n{\n    CScriptNum10 bignum(num);\n    CScriptNum scriptnum(num);\n    BOOST_CHECK(verify(bignum, scriptnum));\n\n    CScriptNum10 bignum2(bignum.getvch(), false);\n    CScriptNum scriptnum2(scriptnum.getvch(), false);\n    BOOST_CHECK(verify(bignum2, scriptnum2));\n\n    CScriptNum10 bignum3(scriptnum2.getvch(), false);\n    CScriptNum scriptnum3(bignum2.getvch(), false);\n    BOOST_CHECK(verify(bignum3, scriptnum3));\n}\n\nstatic void CheckCreateInt(const int64_t& num)\n{\n    CScriptNum10 bignum(num);\n    CScriptNum scriptnum(num);\n    BOOST_CHECK(verify(bignum, scriptnum));\n    BOOST_CHECK(verify(CScriptNum10(bignum.getint()), CScriptNum(scriptnum.getint())));\n    BOOST_CHECK(verify(CScriptNum10(scriptnum.getint()), CScriptNum(bignum.getint())));\n    BOOST_CHECK(verify(CScriptNum10(CScriptNum10(scriptnum.getint()).getint()), CScriptNum(CScriptNum(bignum.getint()).getint())));\n}\n\n\nstatic void CheckAdd(const int64_t& num1, const int64_t& num2)\n{\n    const CScriptNum10 bignum1(num1);\n    const CScriptNum10 bignum2(num2);\n    const CScriptNum scriptnum1(num1);\n    const CScriptNum scriptnum2(num2);\n    CScriptNum10 bignum3(num1);\n    CScriptNum10 bignum4(num1);\n    CScriptNum scriptnum3(num1);\n    CScriptNum scriptnum4(num1);\n\n    // int64_t overflow is undefined.\n    bool invalid = (((num2 > 0) && (num1 > (std::numeric_limits<int64_t>::max() - num2))) ||\n                    ((num2 < 0) && (num1 < (std::numeric_limits<int64_t>::min() - num2))));\n    if (!invalid)\n    {\n        BOOST_CHECK(verify(bignum1 + bignum2, scriptnum1 + scriptnum2));\n        BOOST_CHECK(verify(bignum1 + bignum2, scriptnum1 + num2));\n        BOOST_CHECK(verify(bignum1 + bignum2, scriptnum2 + num1));\n    }\n}\n\nstatic void CheckNegate(const int64_t& num)\n{\n    const CScriptNum10 bignum(num);\n    const CScriptNum scriptnum(num);\n\n    // -INT64_MIN is undefined\n    if (num != std::numeric_limits<int64_t>::min())\n        BOOST_CHECK(verify(-bignum, -scriptnum));\n}\n\nstatic void CheckSubtract(const int64_t& num1, const int64_t& num2)\n{\n    const CScriptNum10 bignum1(num1);\n    const CScriptNum10 bignum2(num2);\n    const CScriptNum scriptnum1(num1);\n    const CScriptNum scriptnum2(num2);\n\n    // int64_t overflow is undefined.\n    bool invalid = ((num2 > 0 && num1 < std::numeric_limits<int64_t>::min() + num2) ||\n                    (num2 < 0 && num1 > std::numeric_limits<int64_t>::max() + num2));\n    if (!invalid)\n    {\n        BOOST_CHECK(verify(bignum1 - bignum2, scriptnum1 - scriptnum2));\n        BOOST_CHECK(verify(bignum1 - bignum2, scriptnum1 - num2));\n    }\n\n    invalid = ((num1 > 0 && num2 < std::numeric_limits<int64_t>::min() + num1) ||\n               (num1 < 0 && num2 > std::numeric_limits<int64_t>::max() + num1));\n    if (!invalid)\n    {\n        BOOST_CHECK(verify(bignum2 - bignum1, scriptnum2 - scriptnum1));\n        BOOST_CHECK(verify(bignum2 - bignum1, scriptnum2 - num1));\n    }\n}\n\nstatic void CheckCompare(const int64_t& num1, const int64_t& num2)\n{\n    const CScriptNum10 bignum1(num1);\n    const CScriptNum10 bignum2(num2);\n    const CScriptNum scriptnum1(num1);\n    const CScriptNum scriptnum2(num2);\n\n    BOOST_CHECK((bignum1 == bignum1) == (scriptnum1 == scriptnum1));\n    BOOST_CHECK((bignum1 != bignum1) ==  (scriptnum1 != scriptnum1));\n    BOOST_CHECK((bignum1 < bignum1) ==  (scriptnum1 < scriptnum1));\n    BOOST_CHECK((bignum1 > bignum1) ==  (scriptnum1 > scriptnum1));\n    BOOST_CHECK((bignum1 >= bignum1) ==  (scriptnum1 >= scriptnum1));\n    BOOST_CHECK((bignum1 <= bignum1) ==  (scriptnum1 <= scriptnum1));\n\n    BOOST_CHECK((bignum1 == bignum1) == (scriptnum1 == num1));\n    BOOST_CHECK((bignum1 != bignum1) ==  (scriptnum1 != num1));\n    BOOST_CHECK((bignum1 < bignum1) ==  (scriptnum1 < num1));\n    BOOST_CHECK((bignum1 > bignum1) ==  (scriptnum1 > num1));\n    BOOST_CHECK((bignum1 >= bignum1) ==  (scriptnum1 >= num1));\n    BOOST_CHECK((bignum1 <= bignum1) ==  (scriptnum1 <= num1));\n\n    BOOST_CHECK((bignum1 == bignum2) ==  (scriptnum1 == scriptnum2));\n    BOOST_CHECK((bignum1 != bignum2) ==  (scriptnum1 != scriptnum2));\n    BOOST_CHECK((bignum1 < bignum2) ==  (scriptnum1 < scriptnum2));\n    BOOST_CHECK((bignum1 > bignum2) ==  (scriptnum1 > scriptnum2));\n    BOOST_CHECK((bignum1 >= bignum2) ==  (scriptnum1 >= scriptnum2));\n    BOOST_CHECK((bignum1 <= bignum2) ==  (scriptnum1 <= scriptnum2));\n\n    BOOST_CHECK((bignum1 == bignum2) ==  (scriptnum1 == num2));\n    BOOST_CHECK((bignum1 != bignum2) ==  (scriptnum1 != num2));\n    BOOST_CHECK((bignum1 < bignum2) ==  (scriptnum1 < num2));\n    BOOST_CHECK((bignum1 > bignum2) ==  (scriptnum1 > num2));\n    BOOST_CHECK((bignum1 >= bignum2) ==  (scriptnum1 >= num2));\n    BOOST_CHECK((bignum1 <= bignum2) ==  (scriptnum1 <= num2));\n}\n\nstatic void RunCreate(const int64_t& num)\n{\n    CheckCreateInt(num);\n    CScriptNum scriptnum(num);\n    if (scriptnum.getvch().size() <= CScriptNum::nDefaultMaxNumSize)\n        CheckCreateVch(num);\n    else\n    {\n        BOOST_CHECK_THROW (CheckCreateVch(num), scriptnum10_error);\n    }\n}\n\nstatic void RunOperators(const int64_t& num1, const int64_t& num2)\n{\n    CheckAdd(num1, num2);\n    CheckSubtract(num1, num2);\n    CheckNegate(num1);\n    CheckCompare(num1, num2);\n}\n\nBOOST_AUTO_TEST_CASE(creation)\n{\n    for(size_t i = 0; i < sizeof(values) / sizeof(values[0]); ++i)\n    {\n        for(size_t j = 0; j < sizeof(offsets) / sizeof(offsets[0]); ++j)\n        {\n            RunCreate(values[i]);\n            RunCreate(values[i] + offsets[j]);\n            RunCreate(values[i] - offsets[j]);\n        }\n    }\n}\n\nBOOST_AUTO_TEST_CASE(operators)\n{\n    for(size_t i = 0; i < sizeof(values) / sizeof(values[0]); ++i)\n    {\n        for(size_t j = 0; j < sizeof(offsets) / sizeof(offsets[0]); ++j)\n        {\n            RunOperators(values[i], values[i]);\n            RunOperators(values[i], -values[i]);\n            RunOperators(values[i], values[j]);\n            RunOperators(values[i], -values[j]);\n            RunOperators(values[i] + values[j], values[j]);\n            RunOperators(values[i] + values[j], -values[j]);\n            RunOperators(values[i] - values[j], values[j]);\n            RunOperators(values[i] - values[j], -values[j]);\n            RunOperators(values[i] + values[j], values[i] + values[j]);\n            RunOperators(values[i] + values[j], values[i] - values[j]);\n            RunOperators(values[i] - values[j], values[i] + values[j]);\n            RunOperators(values[i] - values[j], values[i] - values[j]);\n        }\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/serialize_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <serialize.h>\n#include <streams.h>\n#include <hash.h>\n#include <test/test_bitcoin.h>\n\n#include <stdint.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(serialize_tests, BasicTestingSetup)\n\nclass CSerializeMethodsTestSingle\n{\nprotected:\n    int intval;\n    bool boolval;\n    std::string stringval;\n    const char* charstrval;\n    CTransactionRef txval;\npublic:\n    CSerializeMethodsTestSingle() = default;\n    CSerializeMethodsTestSingle(int intvalin, bool boolvalin, std::string stringvalin, const char* charstrvalin, CTransaction txvalin) : intval(intvalin), boolval(boolvalin), stringval(std::move(stringvalin)), charstrval(charstrvalin), txval(MakeTransactionRef(txvalin)){}\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(intval);\n        READWRITE(boolval);\n        READWRITE(stringval);\n        READWRITE(FLATDATA(charstrval));\n        READWRITE(txval);\n    }\n\n    bool operator==(const CSerializeMethodsTestSingle& rhs)\n    {\n        return  intval == rhs.intval && \\\n                boolval == rhs.boolval && \\\n                stringval == rhs.stringval && \\\n                strcmp(charstrval, rhs.charstrval) == 0 && \\\n                *txval == *rhs.txval;\n    }\n};\n\nclass CSerializeMethodsTestMany : public CSerializeMethodsTestSingle\n{\npublic:\n    using CSerializeMethodsTestSingle::CSerializeMethodsTestSingle;\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITEMANY(intval, boolval, stringval, FLATDATA(charstrval), txval);\n    }\n};\n\nBOOST_AUTO_TEST_CASE(sizes)\n{\n    BOOST_CHECK_EQUAL(sizeof(char), GetSerializeSize(char(0), 0));\n    BOOST_CHECK_EQUAL(sizeof(int8_t), GetSerializeSize(int8_t(0), 0));\n    BOOST_CHECK_EQUAL(sizeof(uint8_t), GetSerializeSize(uint8_t(0), 0));\n    BOOST_CHECK_EQUAL(sizeof(int16_t), GetSerializeSize(int16_t(0), 0));\n    BOOST_CHECK_EQUAL(sizeof(uint16_t), GetSerializeSize(uint16_t(0), 0));\n    BOOST_CHECK_EQUAL(sizeof(int32_t), GetSerializeSize(int32_t(0), 0));\n    BOOST_CHECK_EQUAL(sizeof(uint32_t), GetSerializeSize(uint32_t(0), 0));\n    BOOST_CHECK_EQUAL(sizeof(int64_t), GetSerializeSize(int64_t(0), 0));\n    BOOST_CHECK_EQUAL(sizeof(uint64_t), GetSerializeSize(uint64_t(0), 0));\n    BOOST_CHECK_EQUAL(sizeof(float), GetSerializeSize(float(0), 0));\n    BOOST_CHECK_EQUAL(sizeof(double), GetSerializeSize(double(0), 0));\n    // Bool is serialized as char\n    BOOST_CHECK_EQUAL(sizeof(char), GetSerializeSize(bool(0), 0));\n\n    // Sanity-check GetSerializeSize and c++ type matching\n    BOOST_CHECK_EQUAL(GetSerializeSize(char(0), 0), 1);\n    BOOST_CHECK_EQUAL(GetSerializeSize(int8_t(0), 0), 1);\n    BOOST_CHECK_EQUAL(GetSerializeSize(uint8_t(0), 0), 1);\n    BOOST_CHECK_EQUAL(GetSerializeSize(int16_t(0), 0), 2);\n    BOOST_CHECK_EQUAL(GetSerializeSize(uint16_t(0), 0), 2);\n    BOOST_CHECK_EQUAL(GetSerializeSize(int32_t(0), 0), 4);\n    BOOST_CHECK_EQUAL(GetSerializeSize(uint32_t(0), 0), 4);\n    BOOST_CHECK_EQUAL(GetSerializeSize(int64_t(0), 0), 8);\n    BOOST_CHECK_EQUAL(GetSerializeSize(uint64_t(0), 0), 8);\n    BOOST_CHECK_EQUAL(GetSerializeSize(float(0), 0), 4);\n    BOOST_CHECK_EQUAL(GetSerializeSize(double(0), 0), 8);\n    BOOST_CHECK_EQUAL(GetSerializeSize(bool(0), 0), 1);\n}\n\nBOOST_AUTO_TEST_CASE(floats_conversion)\n{\n    // Choose values that map unambiguously to binary floating point to avoid\n    // rounding issues at the compiler side.\n    BOOST_CHECK_EQUAL(ser_uint32_to_float(0x00000000), 0.0F);\n    BOOST_CHECK_EQUAL(ser_uint32_to_float(0x3f000000), 0.5F);\n    BOOST_CHECK_EQUAL(ser_uint32_to_float(0x3f800000), 1.0F);\n    BOOST_CHECK_EQUAL(ser_uint32_to_float(0x40000000), 2.0F);\n    BOOST_CHECK_EQUAL(ser_uint32_to_float(0x40800000), 4.0F);\n    BOOST_CHECK_EQUAL(ser_uint32_to_float(0x44444444), 785.066650390625F);\n\n    BOOST_CHECK_EQUAL(ser_float_to_uint32(0.0F), 0x00000000);\n    BOOST_CHECK_EQUAL(ser_float_to_uint32(0.5F), 0x3f000000);\n    BOOST_CHECK_EQUAL(ser_float_to_uint32(1.0F), 0x3f800000);\n    BOOST_CHECK_EQUAL(ser_float_to_uint32(2.0F), 0x40000000);\n    BOOST_CHECK_EQUAL(ser_float_to_uint32(4.0F), 0x40800000);\n    BOOST_CHECK_EQUAL(ser_float_to_uint32(785.066650390625F), 0x44444444);\n}\n\nBOOST_AUTO_TEST_CASE(doubles_conversion)\n{\n    // Choose values that map unambiguously to binary floating point to avoid\n    // rounding issues at the compiler side.\n    BOOST_CHECK_EQUAL(ser_uint64_to_double(0x0000000000000000ULL), 0.0);\n    BOOST_CHECK_EQUAL(ser_uint64_to_double(0x3fe0000000000000ULL), 0.5);\n    BOOST_CHECK_EQUAL(ser_uint64_to_double(0x3ff0000000000000ULL), 1.0);\n    BOOST_CHECK_EQUAL(ser_uint64_to_double(0x4000000000000000ULL), 2.0);\n    BOOST_CHECK_EQUAL(ser_uint64_to_double(0x4010000000000000ULL), 4.0);\n    BOOST_CHECK_EQUAL(ser_uint64_to_double(0x4088888880000000ULL), 785.066650390625);\n\n    BOOST_CHECK_EQUAL(ser_double_to_uint64(0.0), 0x0000000000000000ULL);\n    BOOST_CHECK_EQUAL(ser_double_to_uint64(0.5), 0x3fe0000000000000ULL);\n    BOOST_CHECK_EQUAL(ser_double_to_uint64(1.0), 0x3ff0000000000000ULL);\n    BOOST_CHECK_EQUAL(ser_double_to_uint64(2.0), 0x4000000000000000ULL);\n    BOOST_CHECK_EQUAL(ser_double_to_uint64(4.0), 0x4010000000000000ULL);\n    BOOST_CHECK_EQUAL(ser_double_to_uint64(785.066650390625), 0x4088888880000000ULL);\n}\n/*\nPython code to generate the below hashes:\n\n    def reversed_hex(x):\n        return binascii.hexlify(''.join(reversed(x)))\n    def dsha256(x):\n        return hashlib.sha256(hashlib.sha256(x).digest()).digest()\n\n    reversed_hex(dsha256(''.join(struct.pack('<f', x) for x in range(0,1000)))) == '8e8b4cf3e4df8b332057e3e23af42ebc663b61e0495d5e7e32d85099d7f3fe0c'\n    reversed_hex(dsha256(''.join(struct.pack('<d', x) for x in range(0,1000)))) == '43d0c82591953c4eafe114590d392676a01585d25b25d433557f0d7878b23f96'\n*/\nBOOST_AUTO_TEST_CASE(floats)\n{\n    CDataStream ss(SER_DISK, 0);\n    // encode\n    for (int i = 0; i < 1000; i++) {\n        ss << float(i);\n    }\n    BOOST_CHECK(Hash(ss.begin(), ss.end()) == uint256S(\"8e8b4cf3e4df8b332057e3e23af42ebc663b61e0495d5e7e32d85099d7f3fe0c\"));\n\n    // decode\n    for (int i = 0; i < 1000; i++) {\n        float j;\n        ss >> j;\n        BOOST_CHECK_MESSAGE(i == j, \"decoded:\" << j << \" expected:\" << i);\n    }\n}\n\nBOOST_AUTO_TEST_CASE(doubles)\n{\n    CDataStream ss(SER_DISK, 0);\n    // encode\n    for (int i = 0; i < 1000; i++) {\n        ss << double(i);\n    }\n    BOOST_CHECK(Hash(ss.begin(), ss.end()) == uint256S(\"43d0c82591953c4eafe114590d392676a01585d25b25d433557f0d7878b23f96\"));\n\n    // decode\n    for (int i = 0; i < 1000; i++) {\n        double j;\n        ss >> j;\n        BOOST_CHECK_MESSAGE(i == j, \"decoded:\" << j << \" expected:\" << i);\n    }\n}\n\nBOOST_AUTO_TEST_CASE(varints)\n{\n    // encode\n\n    CDataStream ss(SER_DISK, 0);\n    CDataStream::size_type size = 0;\n    for (int i = 0; i < 100000; i++) {\n        ss << VARINT(i);\n        size += ::GetSerializeSize(VARINT(i), 0, 0);\n        BOOST_CHECK(size == ss.size());\n    }\n\n    for (uint64_t i = 0;  i < 100000000000ULL; i += 999999937) {\n        ss << VARINT(i);\n        size += ::GetSerializeSize(VARINT(i), 0, 0);\n        BOOST_CHECK(size == ss.size());\n    }\n\n    // decode\n    for (int i = 0; i < 100000; i++) {\n        int j = -1;\n        ss >> VARINT(j);\n        BOOST_CHECK_MESSAGE(i == j, \"decoded:\" << j << \" expected:\" << i);\n    }\n\n    for (uint64_t i = 0;  i < 100000000000ULL; i += 999999937) {\n        uint64_t j = -1;\n        ss >> VARINT(j);\n        BOOST_CHECK_MESSAGE(i == j, \"decoded:\" << j << \" expected:\" << i);\n    }\n}\n\nBOOST_AUTO_TEST_CASE(varints_bitpatterns)\n{\n    CDataStream ss(SER_DISK, 0);\n    ss << VARINT(0); BOOST_CHECK_EQUAL(HexStr(ss), \"00\"); ss.clear();\n    ss << VARINT(0x7f); BOOST_CHECK_EQUAL(HexStr(ss), \"7f\"); ss.clear();\n    ss << VARINT((int8_t)0x7f); BOOST_CHECK_EQUAL(HexStr(ss), \"7f\"); ss.clear();\n    ss << VARINT(0x80); BOOST_CHECK_EQUAL(HexStr(ss), \"8000\"); ss.clear();\n    ss << VARINT((uint8_t)0x80); BOOST_CHECK_EQUAL(HexStr(ss), \"8000\"); ss.clear();\n    ss << VARINT(0x1234); BOOST_CHECK_EQUAL(HexStr(ss), \"a334\"); ss.clear();\n    ss << VARINT((int16_t)0x1234); BOOST_CHECK_EQUAL(HexStr(ss), \"a334\"); ss.clear();\n    ss << VARINT(0xffff); BOOST_CHECK_EQUAL(HexStr(ss), \"82fe7f\"); ss.clear();\n    ss << VARINT((uint16_t)0xffff); BOOST_CHECK_EQUAL(HexStr(ss), \"82fe7f\"); ss.clear();\n    ss << VARINT(0x123456); BOOST_CHECK_EQUAL(HexStr(ss), \"c7e756\"); ss.clear();\n    ss << VARINT((int32_t)0x123456); BOOST_CHECK_EQUAL(HexStr(ss), \"c7e756\"); ss.clear();\n    ss << VARINT(0x80123456U); BOOST_CHECK_EQUAL(HexStr(ss), \"86ffc7e756\"); ss.clear();\n    ss << VARINT((uint32_t)0x80123456U); BOOST_CHECK_EQUAL(HexStr(ss), \"86ffc7e756\"); ss.clear();\n    ss << VARINT(0xffffffff); BOOST_CHECK_EQUAL(HexStr(ss), \"8efefefe7f\"); ss.clear();\n    ss << VARINT(0x7fffffffffffffffLL); BOOST_CHECK_EQUAL(HexStr(ss), \"fefefefefefefefe7f\"); ss.clear();\n    ss << VARINT(0xffffffffffffffffULL); BOOST_CHECK_EQUAL(HexStr(ss), \"80fefefefefefefefe7f\"); ss.clear();\n}\n\nBOOST_AUTO_TEST_CASE(compactsize)\n{\n    CDataStream ss(SER_DISK, 0);\n    std::vector<char>::size_type i, j;\n\n    for (i = 1; i <= MAX_SIZE; i *= 2)\n    {\n        WriteCompactSize(ss, i-1);\n        WriteCompactSize(ss, i);\n    }\n    for (i = 1; i <= MAX_SIZE; i *= 2)\n    {\n        j = ReadCompactSize(ss);\n        BOOST_CHECK_MESSAGE((i-1) == j, \"decoded:\" << j << \" expected:\" << (i-1));\n        j = ReadCompactSize(ss);\n        BOOST_CHECK_MESSAGE(i == j, \"decoded:\" << j << \" expected:\" << i);\n    }\n}\n\nstatic bool isCanonicalException(const std::ios_base::failure& ex)\n{\n    std::ios_base::failure expectedException(\"non-canonical ReadCompactSize()\");\n\n    // The string returned by what() can be different for different platforms.\n    // Instead of directly comparing the ex.what() with an expected string,\n    // create an instance of exception to see if ex.what() matches \n    // the expected explanatory string returned by the exception instance. \n    return strcmp(expectedException.what(), ex.what()) == 0;\n}\n\n\nBOOST_AUTO_TEST_CASE(noncanonical)\n{\n    // Write some non-canonical CompactSize encodings, and\n    // make sure an exception is thrown when read back.\n    CDataStream ss(SER_DISK, 0);\n    std::vector<char>::size_type n;\n\n    // zero encoded with three bytes:\n    ss.write(\"\\xfd\\x00\\x00\", 3);\n    BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);\n\n    // 0xfc encoded with three bytes:\n    ss.write(\"\\xfd\\xfc\\x00\", 3);\n    BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);\n\n    // 0xfd encoded with three bytes is OK:\n    ss.write(\"\\xfd\\xfd\\x00\", 3);\n    n = ReadCompactSize(ss);\n    BOOST_CHECK(n == 0xfd);\n\n    // zero encoded with five bytes:\n    ss.write(\"\\xfe\\x00\\x00\\x00\\x00\", 5);\n    BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);\n\n    // 0xffff encoded with five bytes:\n    ss.write(\"\\xfe\\xff\\xff\\x00\\x00\", 5);\n    BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);\n\n    // zero encoded with nine bytes:\n    ss.write(\"\\xff\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\", 9);\n    BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);\n\n    // 0x01ffffff encoded with nine bytes:\n    ss.write(\"\\xff\\xff\\xff\\xff\\x01\\x00\\x00\\x00\\x00\", 9);\n    BOOST_CHECK_EXCEPTION(ReadCompactSize(ss), std::ios_base::failure, isCanonicalException);\n}\n\nBOOST_AUTO_TEST_CASE(insert_delete)\n{\n    // Test inserting/deleting bytes.\n    CDataStream ss(SER_DISK, 0);\n    BOOST_CHECK_EQUAL(ss.size(), 0);\n\n    ss.write(\"\\x00\\x01\\x02\\xff\", 4);\n    BOOST_CHECK_EQUAL(ss.size(), 4);\n\n    char c = (char)11;\n\n    // Inserting at beginning/end/middle:\n    ss.insert(ss.begin(), c);\n    BOOST_CHECK_EQUAL(ss.size(), 5);\n    BOOST_CHECK_EQUAL(ss[0], c);\n    BOOST_CHECK_EQUAL(ss[1], 0);\n\n    ss.insert(ss.end(), c);\n    BOOST_CHECK_EQUAL(ss.size(), 6);\n    BOOST_CHECK_EQUAL(ss[4], (char)0xff);\n    BOOST_CHECK_EQUAL(ss[5], c);\n\n    ss.insert(ss.begin()+2, c);\n    BOOST_CHECK_EQUAL(ss.size(), 7);\n    BOOST_CHECK_EQUAL(ss[2], c);\n\n    // Delete at beginning/end/middle\n    ss.erase(ss.begin());\n    BOOST_CHECK_EQUAL(ss.size(), 6);\n    BOOST_CHECK_EQUAL(ss[0], 0);\n\n    ss.erase(ss.begin()+ss.size()-1);\n    BOOST_CHECK_EQUAL(ss.size(), 5);\n    BOOST_CHECK_EQUAL(ss[4], (char)0xff);\n\n    ss.erase(ss.begin()+1);\n    BOOST_CHECK_EQUAL(ss.size(), 4);\n    BOOST_CHECK_EQUAL(ss[0], 0);\n    BOOST_CHECK_EQUAL(ss[1], 1);\n    BOOST_CHECK_EQUAL(ss[2], 2);\n    BOOST_CHECK_EQUAL(ss[3], (char)0xff);\n\n    // Make sure GetAndClear does the right thing:\n    CSerializeData d;\n    ss.GetAndClear(d);\n    BOOST_CHECK_EQUAL(ss.size(), 0);\n}\n\nBOOST_AUTO_TEST_CASE(class_methods)\n{\n    int intval(100);\n    bool boolval(true);\n    std::string stringval(\"testing\");\n    const char* charstrval(\"testing charstr\");\n    CMutableTransaction txval;\n    CSerializeMethodsTestSingle methodtest1(intval, boolval, stringval, charstrval, txval);\n    CSerializeMethodsTestMany methodtest2(intval, boolval, stringval, charstrval, txval);\n    CSerializeMethodsTestSingle methodtest3;\n    CSerializeMethodsTestMany methodtest4;\n    CDataStream ss(SER_DISK, PROTOCOL_VERSION);\n    BOOST_CHECK(methodtest1 == methodtest2);\n    ss << methodtest1;\n    ss >> methodtest4;\n    ss << methodtest2;\n    ss >> methodtest3;\n    BOOST_CHECK(methodtest1 == methodtest2);\n    BOOST_CHECK(methodtest2 == methodtest3);\n    BOOST_CHECK(methodtest3 == methodtest4);\n\n    CDataStream ss2(SER_DISK, PROTOCOL_VERSION, intval, boolval, stringval, FLATDATA(charstrval), txval);\n    ss2 >> methodtest3;\n    BOOST_CHECK(methodtest3 == methodtest4);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/sighash_tests.cpp",
    "content": "// Copyright (c) 2013-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <consensus/tx_verify.h>\n#include <consensus/validation.h>\n#include <test/data/sighash.json.h>\n#include <hash.h>\n#include <script/interpreter.h>\n#include <script/script.h>\n#include <serialize.h>\n#include <streams.h>\n#include <test/test_bitcoin.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <version.h>\n\n#include <iostream>\n\n#include <boost/test/unit_test.hpp>\n\n#include <univalue.h>\n\nextern UniValue read_json(const std::string& jsondata);\n\n// Old script.cpp SignatureHash function\nuint256 static SignatureHashOld(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType)\n{\n    static const uint256 one(uint256S(\"0000000000000000000000000000000000000000000000000000000000000001\"));\n    if (nIn >= txTo.vin.size())\n    {\n        return one;\n    }\n    CMutableTransaction txTmp(txTo);\n\n    // In case concatenating two scripts ends up with two codeseparators,\n    // or an extra one at the end, this prevents all those possible incompatibilities.\n    scriptCode.FindAndDelete(CScript(OP_CODESEPARATOR));\n\n    // Blank out other inputs' signatures\n    for (unsigned int i = 0; i < txTmp.vin.size(); i++)\n        txTmp.vin[i].scriptSig = CScript();\n    txTmp.vin[nIn].scriptSig = scriptCode;\n\n    // Blank out some of the outputs\n    if ((nHashType & 0x1f) == SIGHASH_NONE)\n    {\n        // Wildcard payee\n        txTmp.vout.clear();\n\n        // Let the others update at will\n        for (unsigned int i = 0; i < txTmp.vin.size(); i++)\n            if (i != nIn)\n                txTmp.vin[i].nSequence = 0;\n    }\n    else if ((nHashType & 0x1f) == SIGHASH_SINGLE)\n    {\n        // Only lock-in the txout payee at same index as txin\n        unsigned int nOut = nIn;\n        if (nOut >= txTmp.vout.size())\n        {\n            return one;\n        }\n        txTmp.vout.resize(nOut+1);\n        for (unsigned int i = 0; i < nOut; i++)\n            txTmp.vout[i].SetNull();\n\n        // Let the others update at will\n        for (unsigned int i = 0; i < txTmp.vin.size(); i++)\n            if (i != nIn)\n                txTmp.vin[i].nSequence = 0;\n    }\n\n    // Blank out other inputs completely, not recommended for open transactions\n    if (nHashType & SIGHASH_ANYONECANPAY)\n    {\n        txTmp.vin[0] = txTmp.vin[nIn];\n        txTmp.vin.resize(1);\n    }\n\n    // Serialize and hash\n    CHashWriter ss(SER_GETHASH, SERIALIZE_TRANSACTION_NO_WITNESS);\n    ss << txTmp << nHashType;\n    return ss.GetHash();\n}\n\nvoid static RandomScript(CScript &script) {\n    static const opcodetype oplist[] = {OP_FALSE, OP_1, OP_2, OP_3, OP_CHECKSIG, OP_IF, OP_VERIF, OP_RETURN, OP_CODESEPARATOR};\n    script = CScript();\n    int ops = (InsecureRandRange(10));\n    for (int i=0; i<ops; i++)\n        script << oplist[InsecureRandRange(sizeof(oplist)/sizeof(oplist[0]))];\n}\n\nvoid static RandomTransaction(CMutableTransaction &tx, bool fSingle) {\n    tx.nVersion = InsecureRand32();\n    tx.vin.clear();\n    tx.vout.clear();\n    tx.nLockTime = (InsecureRandBool()) ? InsecureRand32() : 0;\n    int ins = (InsecureRandBits(2)) + 1;\n    int outs = fSingle ? ins : (InsecureRandBits(2)) + 1;\n    for (int in = 0; in < ins; in++) {\n        tx.vin.push_back(CTxIn());\n        CTxIn &txin = tx.vin.back();\n        txin.prevout.hash = InsecureRand256();\n        txin.prevout.n = InsecureRandBits(2);\n        RandomScript(txin.scriptSig);\n        txin.nSequence = (InsecureRandBool()) ? InsecureRand32() : (unsigned int)-1;\n    }\n    for (int out = 0; out < outs; out++) {\n        tx.vout.push_back(CTxOut());\n        CTxOut &txout = tx.vout.back();\n        txout.nValue = InsecureRandRange(100000000);\n        RandomScript(txout.scriptPubKey);\n    }\n}\n\nBOOST_FIXTURE_TEST_SUITE(sighash_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(sighash_test)\n{\n    SeedInsecureRand(false);\n\n    #if defined(PRINT_SIGHASH_JSON)\n    std::cout << \"[\\n\";\n    std::cout << \"\\t[\\\"raw_transaction, script, input_index, hashType, signature_hash (result)\\\"],\\n\";\n    int nRandomTests = 500;\n    #else\n    int nRandomTests = 50000;\n    #endif\n    for (int i=0; i<nRandomTests; i++) {\n        int nHashType = InsecureRand32();\n        CMutableTransaction txTo;\n        RandomTransaction(txTo, (nHashType & 0x1f) == SIGHASH_SINGLE);\n        CScript scriptCode;\n        RandomScript(scriptCode);\n        int nIn = InsecureRandRange(txTo.vin.size());\n\n        uint256 sh, sho;\n        sho = SignatureHashOld(scriptCode, txTo, nIn, nHashType);\n        sh = SignatureHash(scriptCode, txTo, nIn, nHashType, 0, SIGVERSION_BASE);\n        #if defined(PRINT_SIGHASH_JSON)\n        CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);\n        ss << txTo;\n\n        std::cout << \"\\t[\\\"\" ;\n        std::cout << HexStr(ss.begin(), ss.end()) << \"\\\", \\\"\";\n        std::cout << HexStr(scriptCode) << \"\\\", \";\n        std::cout << nIn << \", \";\n        std::cout << nHashType << \", \\\"\";\n        std::cout << sho.GetHex() << \"\\\"]\";\n        if (i+1 != nRandomTests) {\n          std::cout << \",\";\n        }\n        std::cout << \"\\n\";\n        #endif\n        BOOST_CHECK(sh == sho);\n    }\n    #if defined(PRINT_SIGHASH_JSON)\n    std::cout << \"]\\n\";\n    #endif\n}\n\n// Goal: check that SignatureHash generates correct hash\nBOOST_AUTO_TEST_CASE(sighash_from_data)\n{\n    UniValue tests = read_json(std::string(json_tests::sighash, json_tests::sighash + sizeof(json_tests::sighash)));\n\n    for (unsigned int idx = 0; idx < tests.size(); idx++) {\n        UniValue test = tests[idx];\n        std::string strTest = test.write();\n        if (test.size() < 1) // Allow for extra stuff (useful for comments)\n        {\n            BOOST_ERROR(\"Bad test: \" << strTest);\n            continue;\n        }\n        if (test.size() == 1) continue; // comment\n\n        std::string raw_tx, raw_script, sigHashHex;\n        int nIn, nHashType;\n        uint256 sh;\n        CTransactionRef tx;\n        CScript scriptCode = CScript();\n\n        try {\n          // deserialize test data\n          raw_tx = test[0].get_str();\n          raw_script = test[1].get_str();\n          nIn = test[2].get_int();\n          nHashType = test[3].get_int();\n          sigHashHex = test[4].get_str();\n\n          CDataStream stream(ParseHex(raw_tx), SER_NETWORK, PROTOCOL_VERSION);\n          stream >> tx;\n\n          CValidationState state;\n          BOOST_CHECK_MESSAGE(CheckTransaction(*tx, state), strTest);\n          BOOST_CHECK(state.IsValid());\n\n          std::vector<unsigned char> raw = ParseHex(raw_script);\n          scriptCode.insert(scriptCode.end(), raw.begin(), raw.end());\n        } catch (...) {\n          BOOST_ERROR(\"Bad test, couldn't deserialize data: \" << strTest);\n          continue;\n        }\n\n        sh = SignatureHash(scriptCode, *tx, nIn, nHashType, 0, SIGVERSION_BASE);\n        BOOST_CHECK_MESSAGE(sh.GetHex() == sigHashHex, strTest);\n    }\n}\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/sigopcount_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <consensus/tx_verify.h>\n#include <consensus/validation.h>\n#include <pubkey.h>\n#include <key.h>\n#include <script/script.h>\n#include <script/standard.h>\n#include <uint256.h>\n#include <test/test_bitcoin.h>\n\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n\n// Helpers:\nstatic std::vector<unsigned char>\nSerialize(const CScript& s)\n{\n    std::vector<unsigned char> sSerialized(s.begin(), s.end());\n    return sSerialized;\n}\n\nBOOST_FIXTURE_TEST_SUITE(sigopcount_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(GetSigOpCount)\n{\n    // Test CScript::GetSigOpCount()\n    CScript s1;\n    BOOST_CHECK_EQUAL(s1.GetSigOpCount(false), 0U);\n    BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 0U);\n\n    uint160 dummy;\n    s1 << OP_1 << ToByteVector(dummy) << ToByteVector(dummy) << OP_2 << OP_CHECKMULTISIG;\n    BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 2U);\n    s1 << OP_IF << OP_CHECKSIG << OP_ENDIF;\n    BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 3U);\n    BOOST_CHECK_EQUAL(s1.GetSigOpCount(false), 21U);\n\n    CScript p2sh = GetScriptForDestination(CScriptID(s1));\n    CScript scriptSig;\n    scriptSig << OP_0 << Serialize(s1);\n    BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig), 3U);\n\n    std::vector<CPubKey> keys;\n    for (int i = 0; i < 3; i++)\n    {\n        CKey k;\n        k.MakeNewKey(true);\n        keys.push_back(k.GetPubKey());\n    }\n    CScript s2 = GetScriptForMultisig(1, keys);\n    BOOST_CHECK_EQUAL(s2.GetSigOpCount(true), 3U);\n    BOOST_CHECK_EQUAL(s2.GetSigOpCount(false), 20U);\n\n    p2sh = GetScriptForDestination(CScriptID(s2));\n    BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(true), 0U);\n    BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(false), 0U);\n    CScript scriptSig2;\n    scriptSig2 << OP_1 << ToByteVector(dummy) << ToByteVector(dummy) << Serialize(s2);\n    BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig2), 3U);\n}\n\n/**\n * Verifies script execution of the zeroth scriptPubKey of tx output and\n * zeroth scriptSig and witness of tx input.\n */\nScriptError VerifyWithFlag(const CTransaction& output, const CMutableTransaction& input, int flags)\n{\n    ScriptError error;\n    CTransaction inputi(input);\n    bool ret = VerifyScript(inputi.vin[0].scriptSig, output.vout[0].scriptPubKey, &inputi.vin[0].scriptWitness, flags, TransactionSignatureChecker(&inputi, 0, output.vout[0].nValue), &error);\n    BOOST_CHECK((ret == true) == (error == SCRIPT_ERR_OK));\n\n    return error;\n}\n\n/**\n * Builds a creationTx from scriptPubKey and a spendingTx from scriptSig\n * and witness such that spendingTx spends output zero of creationTx.\n * Also inserts creationTx's output into the coins view.\n */\nvoid BuildTxs(CMutableTransaction& spendingTx, CCoinsViewCache& coins, CMutableTransaction& creationTx, const CScript& scriptPubKey, const CScript& scriptSig, const CScriptWitness& witness)\n{\n    creationTx.nVersion = 1;\n    creationTx.vin.resize(1);\n    creationTx.vin[0].prevout.SetNull();\n    creationTx.vin[0].scriptSig = CScript();\n    creationTx.vout.resize(1);\n    creationTx.vout[0].nValue = 1;\n    creationTx.vout[0].scriptPubKey = scriptPubKey;\n\n    spendingTx.nVersion = 1;\n    spendingTx.vin.resize(1);\n    spendingTx.vin[0].prevout.hash = creationTx.GetHash();\n    spendingTx.vin[0].prevout.n = 0;\n    spendingTx.vin[0].scriptSig = scriptSig;\n    spendingTx.vin[0].scriptWitness = witness;\n    spendingTx.vout.resize(1);\n    spendingTx.vout[0].nValue = 1;\n    spendingTx.vout[0].scriptPubKey = CScript();\n\n    AddCoins(coins, creationTx, 0);\n}\n\nBOOST_AUTO_TEST_CASE(GetTxSigOpCost)\n{\n    // Transaction creates outputs\n    CMutableTransaction creationTx;\n    // Transaction that spends outputs and whose\n    // sig op cost is going to be tested\n    CMutableTransaction spendingTx;\n\n    // Create utxo set\n    CCoinsView coinsDummy;\n    CCoinsViewCache coins(&coinsDummy);\n    // Create key\n    CKey key;\n    key.MakeNewKey(true);\n    CPubKey pubkey = key.GetPubKey();\n    // Default flags\n    int flags = SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH;\n\n    // Multisig script (legacy counting)\n    {\n        CScript scriptPubKey = CScript() << 1 << ToByteVector(pubkey) << ToByteVector(pubkey) << 2 << OP_CHECKMULTISIGVERIFY;\n        // Do not use a valid signature to avoid using wallet operations.\n        CScript scriptSig = CScript() << OP_0 << OP_0;\n\n        BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, CScriptWitness());\n        // Legacy counting only includes signature operations in scriptSigs and scriptPubKeys\n        // of a transaction and does not take the actual executed sig operations into account.\n        // spendingTx in itself does not contain a signature operation.\n        assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 0);\n        // creationTx contains two signature operations in its scriptPubKey, but legacy counting\n        // is not accurate.\n        assert(GetTransactionSigOpCost(CTransaction(creationTx), coins, flags) == MAX_PUBKEYS_PER_MULTISIG * WITNESS_SCALE_FACTOR);\n        // Sanity check: script verification fails because of an invalid signature.\n        assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);\n    }\n\n    // Multisig nested in P2SH\n    {\n        CScript redeemScript = CScript() << 1 << ToByteVector(pubkey) << ToByteVector(pubkey) << 2 << OP_CHECKMULTISIGVERIFY;\n        CScript scriptPubKey = GetScriptForDestination(CScriptID(redeemScript));\n        CScript scriptSig = CScript() << OP_0 << OP_0 << ToByteVector(redeemScript);\n\n        BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, CScriptWitness());\n        assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 2 * WITNESS_SCALE_FACTOR);\n        assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);\n    }\n\n    // P2WPKH witness program\n    {\n        CScript p2pk = CScript() << ToByteVector(pubkey) << OP_CHECKSIG;\n        CScript scriptPubKey = GetScriptForWitness(p2pk);\n        CScript scriptSig = CScript();\n        CScriptWitness scriptWitness;\n        scriptWitness.stack.push_back(std::vector<unsigned char>(0));\n        scriptWitness.stack.push_back(std::vector<unsigned char>(0));\n\n\n        BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);\n        assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 1);\n        // No signature operations if we don't verify the witness.\n        assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags & ~SCRIPT_VERIFY_WITNESS) == 0);\n        assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_EQUALVERIFY);\n\n        // The sig op cost for witness version != 0 is zero.\n        assert(scriptPubKey[0] == 0x00);\n        scriptPubKey[0] = 0x51;\n        BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);\n        assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 0);\n        scriptPubKey[0] = 0x00;\n        BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);\n\n        // The witness of a coinbase transaction is not taken into account.\n        spendingTx.vin[0].prevout.SetNull();\n        assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 0);\n    }\n\n    // P2WPKH nested in P2SH\n    {\n        CScript p2pk = CScript() << ToByteVector(pubkey) << OP_CHECKSIG;\n        CScript scriptSig = GetScriptForWitness(p2pk);\n        CScript scriptPubKey = GetScriptForDestination(CScriptID(scriptSig));\n        scriptSig = CScript() << ToByteVector(scriptSig);\n        CScriptWitness scriptWitness;\n        scriptWitness.stack.push_back(std::vector<unsigned char>(0));\n        scriptWitness.stack.push_back(std::vector<unsigned char>(0));\n\n        BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);\n        assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 1);\n        assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_EQUALVERIFY);\n    }\n\n    // P2WSH witness program\n    {\n        CScript witnessScript = CScript() << 1 << ToByteVector(pubkey) << ToByteVector(pubkey) << 2 << OP_CHECKMULTISIGVERIFY;\n        CScript scriptPubKey = GetScriptForWitness(witnessScript);\n        CScript scriptSig = CScript();\n        CScriptWitness scriptWitness;\n        scriptWitness.stack.push_back(std::vector<unsigned char>(0));\n        scriptWitness.stack.push_back(std::vector<unsigned char>(0));\n        scriptWitness.stack.push_back(std::vector<unsigned char>(witnessScript.begin(), witnessScript.end()));\n\n        BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);\n        assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 2);\n        assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags & ~SCRIPT_VERIFY_WITNESS) == 0);\n        assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);\n    }\n\n    // P2WSH nested in P2SH\n    {\n        CScript witnessScript = CScript() << 1 << ToByteVector(pubkey) << ToByteVector(pubkey) << 2 << OP_CHECKMULTISIGVERIFY;\n        CScript redeemScript = GetScriptForWitness(witnessScript);\n        CScript scriptPubKey = GetScriptForDestination(CScriptID(redeemScript));\n        CScript scriptSig = CScript() << ToByteVector(redeemScript);\n        CScriptWitness scriptWitness;\n        scriptWitness.stack.push_back(std::vector<unsigned char>(0));\n        scriptWitness.stack.push_back(std::vector<unsigned char>(0));\n        scriptWitness.stack.push_back(std::vector<unsigned char>(witnessScript.begin(), witnessScript.end()));\n\n        BuildTxs(spendingTx, coins, creationTx, scriptPubKey, scriptSig, scriptWitness);\n        assert(GetTransactionSigOpCost(CTransaction(spendingTx), coins, flags) == 2);\n        assert(VerifyWithFlag(creationTx, spendingTx, flags) == SCRIPT_ERR_CHECKMULTISIGVERIFY);\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/skiplist_tests.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <chain.h>\n#include <util.h>\n#include <test/test_bitcoin.h>\n\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n\n#define SKIPLIST_LENGTH 300000\n\nBOOST_FIXTURE_TEST_SUITE(skiplist_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(skiplist_test)\n{\n    std::vector<CBlockIndex> vIndex(SKIPLIST_LENGTH);\n\n    for (int i=0; i<SKIPLIST_LENGTH; i++) {\n        vIndex[i].nHeight = i;\n        vIndex[i].pprev = (i == 0) ? nullptr : &vIndex[i - 1];\n        vIndex[i].BuildSkip();\n    }\n\n    for (int i=0; i<SKIPLIST_LENGTH; i++) {\n        if (i > 0) {\n            BOOST_CHECK(vIndex[i].pskip == &vIndex[vIndex[i].pskip->nHeight]);\n            BOOST_CHECK(vIndex[i].pskip->nHeight < i);\n        } else {\n            BOOST_CHECK(vIndex[i].pskip == nullptr);\n        }\n    }\n\n    for (int i=0; i < 1000; i++) {\n        int from = InsecureRandRange(SKIPLIST_LENGTH - 1);\n        int to = InsecureRandRange(from + 1);\n\n        BOOST_CHECK(vIndex[SKIPLIST_LENGTH - 1].GetAncestor(from) == &vIndex[from]);\n        BOOST_CHECK(vIndex[from].GetAncestor(to) == &vIndex[to]);\n        BOOST_CHECK(vIndex[from].GetAncestor(0) == vIndex.data());\n    }\n}\n\nBOOST_AUTO_TEST_CASE(getlocator_test)\n{\n    // Build a main chain 100000 blocks long.\n    std::vector<uint256> vHashMain(100000);\n    std::vector<CBlockIndex> vBlocksMain(100000);\n    for (unsigned int i=0; i<vBlocksMain.size(); i++) {\n        vHashMain[i] = ArithToUint256(i); // Set the hash equal to the height, so we can quickly check the distances.\n        vBlocksMain[i].nHeight = i;\n        vBlocksMain[i].pprev = i ? &vBlocksMain[i - 1] : nullptr;\n        vBlocksMain[i].phashBlock = &vHashMain[i];\n        vBlocksMain[i].BuildSkip();\n        BOOST_CHECK_EQUAL((int)UintToArith256(vBlocksMain[i].GetBlockHash()).GetLow64(), vBlocksMain[i].nHeight);\n        BOOST_CHECK(vBlocksMain[i].pprev == nullptr || vBlocksMain[i].nHeight == vBlocksMain[i].pprev->nHeight + 1);\n    }\n\n    // Build a branch that splits off at block 49999, 50000 blocks long.\n    std::vector<uint256> vHashSide(50000);\n    std::vector<CBlockIndex> vBlocksSide(50000);\n    for (unsigned int i=0; i<vBlocksSide.size(); i++) {\n        vHashSide[i] = ArithToUint256(i + 50000 + (arith_uint256(1) << 128)); // Add 1<<128 to the hashes, so GetLow64() still returns the height.\n        vBlocksSide[i].nHeight = i + 50000;\n        vBlocksSide[i].pprev = i ? &vBlocksSide[i - 1] : (vBlocksMain.data()+49999);\n        vBlocksSide[i].phashBlock = &vHashSide[i];\n        vBlocksSide[i].BuildSkip();\n        BOOST_CHECK_EQUAL((int)UintToArith256(vBlocksSide[i].GetBlockHash()).GetLow64(), vBlocksSide[i].nHeight);\n        BOOST_CHECK(vBlocksSide[i].pprev == nullptr || vBlocksSide[i].nHeight == vBlocksSide[i].pprev->nHeight + 1);\n    }\n\n    // Build a CChain for the main branch.\n    CChain chain;\n    chain.SetTip(&vBlocksMain.back());\n\n    // Test 100 random starting points for locators.\n    for (int n=0; n<100; n++) {\n        int r = InsecureRandRange(150000);\n        CBlockIndex* tip = (r < 100000) ? &vBlocksMain[r] : &vBlocksSide[r - 100000];\n        CBlockLocator locator = chain.GetLocator(tip);\n\n        // The first result must be the block itself, the last one must be genesis.\n        BOOST_CHECK(locator.vHave.front() == tip->GetBlockHash());\n        BOOST_CHECK(locator.vHave.back() == vBlocksMain[0].GetBlockHash());\n\n        // Entries 1 through 11 (inclusive) go back one step each.\n        for (unsigned int i = 1; i < 12 && i < locator.vHave.size() - 1; i++) {\n            BOOST_CHECK_EQUAL(UintToArith256(locator.vHave[i]).GetLow64(), tip->nHeight - i);\n        }\n\n        // The further ones (excluding the last one) go back with exponential steps.\n        unsigned int dist = 2;\n        for (unsigned int i = 12; i < locator.vHave.size() - 1; i++) {\n            BOOST_CHECK_EQUAL(UintToArith256(locator.vHave[i - 1]).GetLow64() - UintToArith256(locator.vHave[i]).GetLow64(), dist);\n            dist *= 2;\n        }\n    }\n}\n\nBOOST_AUTO_TEST_CASE(findearliestatleast_test)\n{\n    std::vector<uint256> vHashMain(100000);\n    std::vector<CBlockIndex> vBlocksMain(100000);\n    for (unsigned int i=0; i<vBlocksMain.size(); i++) {\n        vHashMain[i] = ArithToUint256(i); // Set the hash equal to the height\n        vBlocksMain[i].nHeight = i;\n        vBlocksMain[i].pprev = i ? &vBlocksMain[i - 1] : nullptr;\n        vBlocksMain[i].phashBlock = &vHashMain[i];\n        vBlocksMain[i].BuildSkip();\n        if (i < 10) {\n            vBlocksMain[i].nTime = i;\n            vBlocksMain[i].nTimeMax = i;\n        } else {\n            // randomly choose something in the range [MTP, MTP*2]\n            int64_t medianTimePast = vBlocksMain[i].GetMedianTimePast();\n            int r = InsecureRandRange(medianTimePast);\n            vBlocksMain[i].nTime = r + medianTimePast;\n            vBlocksMain[i].nTimeMax = std::max(vBlocksMain[i].nTime, vBlocksMain[i-1].nTimeMax);\n        }\n    }\n    // Check that we set nTimeMax up correctly.\n    unsigned int curTimeMax = 0;\n    for (unsigned int i=0; i<vBlocksMain.size(); ++i) {\n        curTimeMax = std::max(curTimeMax, vBlocksMain[i].nTime);\n        BOOST_CHECK(curTimeMax == vBlocksMain[i].nTimeMax);\n    }\n\n    // Build a CChain for the main branch.\n    CChain chain;\n    chain.SetTip(&vBlocksMain.back());\n\n    // Verify that FindEarliestAtLeast is correct.\n    for (unsigned int i=0; i<10000; ++i) {\n        // Pick a random element in vBlocksMain.\n        int r = InsecureRandRange(vBlocksMain.size());\n        int64_t test_time = vBlocksMain[r].nTime;\n        CBlockIndex *ret = chain.FindEarliestAtLeast(test_time);\n        BOOST_CHECK(ret->nTimeMax >= test_time);\n        BOOST_CHECK((ret->pprev==nullptr) || ret->pprev->nTimeMax < test_time);\n        BOOST_CHECK(vBlocksMain[r].GetAncestor(ret->nHeight) == ret);\n    }\n}\n\nBOOST_AUTO_TEST_CASE(findearliestatleast_edge_test)\n{\n    std::list<CBlockIndex> blocks;\n    for (unsigned int timeMax : {100, 100, 100, 200, 200, 200, 300, 300, 300}) {\n        CBlockIndex* prev = blocks.empty() ? nullptr : &blocks.back();\n        blocks.emplace_back();\n        blocks.back().nHeight = prev ? prev->nHeight + 1 : 0;\n        blocks.back().pprev = prev;\n        blocks.back().BuildSkip();\n        blocks.back().nTimeMax = timeMax;\n    }\n\n    CChain chain;\n    chain.SetTip(&blocks.back());\n\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(50)->nHeight, 0);\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(100)->nHeight, 0);\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(150)->nHeight, 3);\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(200)->nHeight, 3);\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(250)->nHeight, 6);\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(300)->nHeight, 6);\n    BOOST_CHECK(!chain.FindEarliestAtLeast(350));\n\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(0)->nHeight, 0);\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(-1)->nHeight, 0);\n\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(std::numeric_limits<int64_t>::min())->nHeight, 0);\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(std::numeric_limits<unsigned int>::min())->nHeight, 0);\n    BOOST_CHECK_EQUAL(chain.FindEarliestAtLeast(-int64_t(std::numeric_limits<unsigned int>::max()) - 1)->nHeight, 0);\n    BOOST_CHECK(!chain.FindEarliestAtLeast(std::numeric_limits<int64_t>::max()));\n    BOOST_CHECK(!chain.FindEarliestAtLeast(std::numeric_limits<unsigned int>::max()));\n    BOOST_CHECK(!chain.FindEarliestAtLeast(int64_t(std::numeric_limits<unsigned int>::max()) + 1));\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/streams_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <streams.h>\n#include <support/allocators/zeroafterfree.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(streams_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(streams_vector_writer)\n{\n    unsigned char a(1);\n    unsigned char b(2);\n    unsigned char bytes[] = { 3, 4, 5, 6 };\n    std::vector<unsigned char> vch;\n\n    // Each test runs twice. Serializing a second time at the same starting\n    // point should yield the same results, even if the first test grew the\n    // vector.\n\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 0, a, b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{1, 2}}));\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 0, a, b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{1, 2}}));\n    vch.clear();\n\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 1, 2}}));\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 1, 2}}));\n    vch.clear();\n\n    vch.resize(5, 0);\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 1, 2, 0}}));\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 1, 2, 0}}));\n    vch.clear();\n\n    vch.resize(4, 0);\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 3, a, b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 0, 1, 2}}));\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 3, a, b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 0, 1, 2}}));\n    vch.clear();\n\n    vch.resize(4, 0);\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 4, a, b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 0, 0, 1, 2}}));\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 4, a, b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{0, 0, 0, 0, 1, 2}}));\n    vch.clear();\n\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 0, FLATDATA(bytes));\n    BOOST_CHECK((vch == std::vector<unsigned char>{{3, 4, 5, 6}}));\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 0, FLATDATA(bytes));\n    BOOST_CHECK((vch == std::vector<unsigned char>{{3, 4, 5, 6}}));\n    vch.clear();\n\n    vch.resize(4, 8);\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, FLATDATA(bytes), b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{8, 8, 1, 3, 4, 5, 6, 2}}));\n    CVectorWriter(SER_NETWORK, INIT_PROTO_VERSION, vch, 2, a, FLATDATA(bytes), b);\n    BOOST_CHECK((vch == std::vector<unsigned char>{{8, 8, 1, 3, 4, 5, 6, 2}}));\n    vch.clear();\n}\n\nBOOST_AUTO_TEST_CASE(streams_serializedata_xor)\n{\n    std::vector<char> in;\n    std::vector<char> expected_xor;\n    std::vector<unsigned char> key;\n    CDataStream ds(in, 0, 0);\n\n    // Degenerate case\n    \n    key.push_back('\\x00');\n    key.push_back('\\x00');\n    ds.Xor(key);\n    BOOST_CHECK_EQUAL(\n            std::string(expected_xor.begin(), expected_xor.end()), \n            std::string(ds.begin(), ds.end()));\n\n    in.push_back('\\x0f');\n    in.push_back('\\xf0');\n    expected_xor.push_back('\\xf0');\n    expected_xor.push_back('\\x0f');\n    \n    // Single character key\n\n    ds.clear();\n    ds.insert(ds.begin(), in.begin(), in.end());\n    key.clear();\n\n    key.push_back('\\xff');\n    ds.Xor(key);\n    BOOST_CHECK_EQUAL(\n            std::string(expected_xor.begin(), expected_xor.end()), \n            std::string(ds.begin(), ds.end())); \n    \n    // Multi character key\n\n    in.clear();\n    expected_xor.clear();\n    in.push_back('\\xf0');\n    in.push_back('\\x0f');\n    expected_xor.push_back('\\x0f');\n    expected_xor.push_back('\\x00');\n                        \n    ds.clear();\n    ds.insert(ds.begin(), in.begin(), in.end());\n\n    key.clear();\n    key.push_back('\\xff');\n    key.push_back('\\x0f');\n\n    ds.Xor(key);\n    BOOST_CHECK_EQUAL(\n            std::string(expected_xor.begin(), expected_xor.end()), \n            std::string(ds.begin(), ds.end()));  \n}         \n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/test_bitcoin.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <test/test_bitcoin.h>\n\n#include <chainparams.h>\n#include <consensus/consensus.h>\n#include <consensus/validation.h>\n#include <crypto/sha256.h>\n#include <validation.h>\n#include <miner.h>\n#include <net_processing.h>\n#include <ui_interface.h>\n#include <streams.h>\n#include <rpc/server.h>\n#include <rpc/register.h>\n#include <script/sigcache.h>\n\n#include <memory>\n\nvoid CConnmanTest::AddNode(CNode& node)\n{\n    LOCK(g_connman->cs_vNodes);\n    g_connman->vNodes.push_back(&node);\n}\n\nvoid CConnmanTest::ClearNodes()\n{\n    LOCK(g_connman->cs_vNodes);\n    g_connman->vNodes.clear();\n}\n\nuint256 insecure_rand_seed = GetRandHash();\nFastRandomContext insecure_rand_ctx(insecure_rand_seed);\n\nextern bool fPrintToConsole;\nextern void noui_connect();\n\nstd::ostream& operator<<(std::ostream& os, const uint256& num)\n{\n    os << num.ToString();\n    return os;\n}\n\nBasicTestingSetup::BasicTestingSetup(const std::string& chainName)\n{\n        SHA256AutoDetect();\n        RandomInit();\n        ECC_Start();\n        SetupEnvironment();\n        SetupNetworking();\n        InitSignatureCache();\n        InitScriptExecutionCache();\n        fPrintToDebugLog = false; // don't want to write to debug.log file\n        fCheckBlockIndex = true;\n        SelectParams(chainName);\n        noui_connect();\n}\n\nBasicTestingSetup::~BasicTestingSetup()\n{\n        ECC_Stop();\n}\n\nTestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(chainName)\n{\n    const CChainParams& chainparams = Params();\n        // Ideally we'd move all the RPC tests to the functional testing framework\n        // instead of unit tests, but for now we need these here.\n\n        RegisterAllCoreRPCCommands(tableRPC);\n        ClearDatadirCache();\n        pathTemp = fs::temp_directory_path() / strprintf(\"test_sugarchain_%lu_%i\", (unsigned long)GetTime(), (int)(InsecureRandRange(100000)));\n        fs::create_directories(pathTemp);\n        gArgs.ForceSetArg(\"-datadir\", pathTemp.string());\n\n        // We have to run a scheduler thread to prevent ActivateBestChain\n        // from blocking due to queue overrun.\n        threadGroup.create_thread(boost::bind(&CScheduler::serviceQueue, &scheduler));\n        GetMainSignals().RegisterBackgroundSignalScheduler(scheduler);\n\n        mempool.setSanityCheck(1.0);\n        pblocktree.reset(new CBlockTreeDB(1 << 20, true));\n        pcoinsdbview.reset(new CCoinsViewDB(1 << 23, true));\n        pcoinsTip.reset(new CCoinsViewCache(pcoinsdbview.get()));\n        if (!LoadGenesisBlock(chainparams)) {\n            throw std::runtime_error(\"LoadGenesisBlock failed.\");\n        }\n        {\n            CValidationState state;\n            if (!ActivateBestChain(state, chainparams)) {\n                throw std::runtime_error(\"ActivateBestChain failed.\");\n            }\n        }\n        nScriptCheckThreads = 3;\n        for (int i=0; i < nScriptCheckThreads-1; i++)\n            threadGroup.create_thread(&ThreadScriptCheck);\n        g_connman = std::unique_ptr<CConnman>(new CConnman(0x1337, 0x1337)); // Deterministic randomness for tests.\n        connman = g_connman.get();\n        peerLogic.reset(new PeerLogicValidation(connman, scheduler));\n}\n\nTestingSetup::~TestingSetup()\n{\n        threadGroup.interrupt_all();\n        threadGroup.join_all();\n        GetMainSignals().FlushBackgroundCallbacks();\n        GetMainSignals().UnregisterBackgroundSignalScheduler();\n        g_connman.reset();\n        peerLogic.reset();\n        UnloadBlockIndex();\n        pcoinsTip.reset();\n        pcoinsdbview.reset();\n        pblocktree.reset();\n        fs::remove_all(pathTemp);\n}\n\nTestChain100Setup::TestChain100Setup() : TestingSetup(CBaseChainParams::REGTEST)\n{\n    // CreateAndProcessBlock() does not support building SegWit blocks, so don't activate in these tests.\n    // TODO: fix the code to support SegWit blocks.\n    UpdateVersionBitsParameters(Consensus::DEPLOYMENT_SEGWIT, 0, Consensus::BIP9Deployment::NO_TIMEOUT);\n    // Generate a 100-block chain:\n    coinbaseKey.MakeNewKey(true);\n    CScript scriptPubKey = CScript() <<  ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;\n    for (int i = 0; i < COINBASE_MATURITY; i++)\n    {\n        std::vector<CMutableTransaction> noTxns;\n        CBlock b = CreateAndProcessBlock(noTxns, scriptPubKey);\n        coinbaseTxns.push_back(*b.vtx[0]);\n    }\n}\n\n//\n// Create a new block with just given transactions, coinbase paying to\n// scriptPubKey, and try to add it to the current chain.\n//\nCBlock\nTestChain100Setup::CreateAndProcessBlock(const std::vector<CMutableTransaction>& txns, const CScript& scriptPubKey)\n{\n    const CChainParams& chainparams = Params();\n    std::unique_ptr<CBlockTemplate> pblocktemplate = BlockAssembler(chainparams).CreateNewBlock(scriptPubKey);\n    CBlock& block = pblocktemplate->block;\n\n    // Replace mempool-selected txns with just coinbase plus passed-in txns:\n    block.vtx.resize(1);\n    for (const CMutableTransaction& tx : txns)\n        block.vtx.push_back(MakeTransactionRef(tx));\n    // IncrementExtraNonce creates a valid coinbase and merkleRoot\n    unsigned int extraNonce = 0;\n    {\n        LOCK(cs_main);\n        IncrementExtraNonce(&block, chainActive.Tip(), extraNonce);\n    }\n\n    while (!CheckProofOfWork(block.GetPoWHash(), block.nBits, chainparams.GetConsensus())) ++block.nNonce;\n\n    std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(block);\n    ProcessNewBlock(chainparams, shared_pblock, true, nullptr);\n\n    CBlock result = block;\n    return result;\n}\n\nTestChain100Setup::~TestChain100Setup()\n{\n}\n\n\nCTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CMutableTransaction &tx) {\n    CTransaction txn(tx);\n    return FromTx(txn);\n}\n\nCTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CTransaction &txn) {\n    return CTxMemPoolEntry(MakeTransactionRef(txn), nFee, nTime, nHeight,\n                           spendsCoinbase, sigOpCost, lp);\n}\n\n/**\n * @returns a real block (0000000000013b8ab2cd513b0261a14096412195a72a0c4827d229dcc7e0f7af)\n *      with 9 txs.\n */\nCBlock getBlock13b8a()\n{\n    CBlock block;\n    CDataStream stream(ParseHex(\"0100000090f0a9f110702f808219ebea1173056042a714bad51b916cb6800000000000005275289558f51c9966699404ae2294730c3c9f9bda53523ce50e9b95e558da2fdb261b4d4c86041b1ab1bf930901000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b0146ffffffff0100f2052a01000000434104e18f7afbe4721580e81e8414fc8c24d7cfacf254bb5c7b949450c3e997c2dc1242487a8169507b631eb3771f2b425483fb13102c4eb5d858eef260fe70fbfae0ac00000000010000000196608ccbafa16abada902780da4dc35dafd7af05fa0da08cf833575f8cf9e836000000004a493046022100dab24889213caf43ae6adc41cf1c9396c08240c199f5225acf45416330fd7dbd022100fe37900e0644bf574493a07fc5edba06dbc07c311b947520c2d514bc5725dcb401ffffffff0100f2052a010000001976a914f15d1921f52e4007b146dfa60f369ed2fc393ce288ac000000000100000001fb766c1288458c2bafcfec81e48b24d98ec706de6b8af7c4e3c29419bfacb56d000000008c493046022100f268ba165ce0ad2e6d93f089cfcd3785de5c963bb5ea6b8c1b23f1ce3e517b9f022100da7c0f21adc6c401887f2bfd1922f11d76159cbc597fbd756a23dcbb00f4d7290141042b4e8625a96127826915a5b109852636ad0da753c9e1d5606a50480cd0c40f1f8b8d898235e571fe9357d9ec842bc4bba1827daaf4de06d71844d0057707966affffffff0280969800000000001976a9146963907531db72d0ed1a0cfb471ccb63923446f388ac80d6e34c000000001976a914f0688ba1c0d1ce182c7af6741e02658c7d4dfcd388ac000000000100000002c40297f730dd7b5a99567eb8d27b78758f607507c52292d02d4031895b52f2ff010000008b483045022100f7edfd4b0aac404e5bab4fd3889e0c6c41aa8d0e6fa122316f68eddd0a65013902205b09cc8b2d56e1cd1f7f2fafd60a129ed94504c4ac7bdc67b56fe67512658b3e014104732012cb962afa90d31b25d8fb0e32c94e513ab7a17805c14ca4c3423e18b4fb5d0e676841733cb83abaf975845c9f6f2a8097b7d04f4908b18368d6fc2d68ecffffffffca5065ff9617cbcba45eb23726df6498a9b9cafed4f54cbab9d227b0035ddefb000000008a473044022068010362a13c7f9919fa832b2dee4e788f61f6f5d344a7c2a0da6ae740605658022006d1af525b9a14a35c003b78b72bd59738cd676f845d1ff3fc25049e01003614014104732012cb962afa90d31b25d8fb0e32c94e513ab7a17805c14ca4c3423e18b4fb5d0e676841733cb83abaf975845c9f6f2a8097b7d04f4908b18368d6fc2d68ecffffffff01001ec4110200000043410469ab4181eceb28985b9b4e895c13fa5e68d85761b7eee311db5addef76fa8621865134a221bd01f28ec9999ee3e021e60766e9d1f3458c115fb28650605f11c9ac000000000100000001cdaf2f758e91c514655e2dc50633d1e4c84989f8aa90a0dbc883f0d23ed5c2fa010000008b48304502207ab51be6f12a1962ba0aaaf24a20e0b69b27a94fac5adf45aa7d2d18ffd9236102210086ae728b370e5329eead9accd880d0cb070aea0c96255fae6c4f1ddcce1fd56e014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff02404b4c00000000001976a9142b6ba7c9d796b75eef7942fc9288edd37c32f5c388ac002d3101000000001976a9141befba0cdc1ad56529371864d9f6cb042faa06b588ac000000000100000001b4a47603e71b61bc3326efd90111bf02d2f549b067f4c4a8fa183b57a0f800cb010000008a4730440220177c37f9a505c3f1a1f0ce2da777c339bd8339ffa02c7cb41f0a5804f473c9230220585b25a2ee80eb59292e52b987dad92acb0c64eced92ed9ee105ad153cdb12d001410443bd44f683467e549dae7d20d1d79cbdb6df985c6e9c029c8d0c6cb46cc1a4d3cf7923c5021b27f7a0b562ada113bc85d5fda5a1b41e87fe6e8802817cf69996ffffffff0280651406000000001976a9145505614859643ab7b547cd7f1f5e7e2a12322d3788ac00aa0271000000001976a914ea4720a7a52fc166c55ff2298e07baf70ae67e1b88ac00000000010000000586c62cd602d219bb60edb14a3e204de0705176f9022fe49a538054fb14abb49e010000008c493046022100f2bc2aba2534becbdf062eb993853a42bbbc282083d0daf9b4b585bd401aa8c9022100b1d7fd7ee0b95600db8535bbf331b19eed8d961f7a8e54159c53675d5f69df8c014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff03ad0e58ccdac3df9dc28a218bcf6f1997b0a93306faaa4b3a28ae83447b2179010000008b483045022100be12b2937179da88599e27bb31c3525097a07cdb52422d165b3ca2f2020ffcf702200971b51f853a53d644ebae9ec8f3512e442b1bcb6c315a5b491d119d10624c83014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff2acfcab629bbc8685792603762c921580030ba144af553d271716a95089e107b010000008b483045022100fa579a840ac258871365dd48cd7552f96c8eea69bd00d84f05b283a0dab311e102207e3c0ee9234814cfbb1b659b83671618f45abc1326b9edcc77d552a4f2a805c0014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffffdcdc6023bbc9944a658ddc588e61eacb737ddf0a3cd24f113b5a8634c517fcd2000000008b4830450221008d6df731df5d32267954bd7d2dda2302b74c6c2a6aa5c0ca64ecbabc1af03c75022010e55c571d65da7701ae2da1956c442df81bbf076cdbac25133f99d98a9ed34c014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffffe15557cd5ce258f479dfd6dc6514edf6d7ed5b21fcfa4a038fd69f06b83ac76e010000008b483045022023b3e0ab071eb11de2eb1cc3a67261b866f86bf6867d4558165f7c8c8aca2d86022100dc6e1f53a91de3efe8f63512850811f26284b62f850c70ca73ed5de8771fb451014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff01404b4c00000000001976a9142b6ba7c9d796b75eef7942fc9288edd37c32f5c388ac00000000010000000166d7577163c932b4f9690ca6a80b6e4eb001f0a2fa9023df5595602aae96ed8d000000008a4730440220262b42546302dfb654a229cefc86432b89628ff259dc87edd1154535b16a67e102207b4634c020a97c3e7bbd0d4d19da6aa2269ad9dded4026e896b213d73ca4b63f014104979b82d02226b3a4597523845754d44f13639e3bf2df5e82c6aab2bdc79687368b01b1ab8b19875ae3c90d661a3d0a33161dab29934edeb36aa01976be3baf8affffffff02404b4c00000000001976a9144854e695a02af0aeacb823ccbc272134561e0a1688ac40420f00000000001976a914abee93376d6b37b5c2940655a6fcaf1c8e74237988ac0000000001000000014e3f8ef2e91349a9059cb4f01e54ab2597c1387161d3da89919f7ea6acdbb371010000008c49304602210081f3183471a5ca22307c0800226f3ef9c353069e0773ac76bb580654d56aa523022100d4c56465bdc069060846f4fbf2f6b20520b2a80b08b168b31e66ddb9c694e240014104976c79848e18251612f8940875b2b08d06e6dc73b9840e8860c066b7e87432c477e9a59a453e71e6d76d5fe34058b800a098fc1740ce3012e8fc8a00c96af966ffffffff02c0e1e400000000001976a9144134e75a6fcb6042034aab5e18570cf1f844f54788ac404b4c00000000001976a9142b6ba7c9d796b75eef7942fc9288edd37c32f5c388ac00000000\"), SER_NETWORK, PROTOCOL_VERSION);\n    stream >> block;\n    return block;\n}\n"
  },
  {
    "path": "src/test/test_bitcoin.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_TEST_TEST_BITCOIN_H\n#define BITCOIN_TEST_TEST_BITCOIN_H\n\n#include <chainparamsbase.h>\n#include <fs.h>\n#include <key.h>\n#include <pubkey.h>\n#include <random.h>\n#include <scheduler.h>\n#include <txdb.h>\n#include <txmempool.h>\n\n#include <memory>\n\n#include <boost/thread.hpp>\n\nextern uint256 insecure_rand_seed;\nextern FastRandomContext insecure_rand_ctx;\n\nstatic inline void SeedInsecureRand(bool fDeterministic = false)\n{\n    if (fDeterministic) {\n        insecure_rand_seed = uint256();\n    } else {\n        insecure_rand_seed = GetRandHash();\n    }\n    insecure_rand_ctx = FastRandomContext(insecure_rand_seed);\n}\n\nstatic inline uint32_t InsecureRand32() { return insecure_rand_ctx.rand32(); }\nstatic inline uint256 InsecureRand256() { return insecure_rand_ctx.rand256(); }\nstatic inline uint64_t InsecureRandBits(int bits) { return insecure_rand_ctx.randbits(bits); }\nstatic inline uint64_t InsecureRandRange(uint64_t range) { return insecure_rand_ctx.randrange(range); }\nstatic inline bool InsecureRandBool() { return insecure_rand_ctx.randbool(); }\n\n/** Basic testing setup.\n * This just configures logging and chain parameters.\n */\nstruct BasicTestingSetup {\n    ECCVerifyHandle globalVerifyHandle;\n\n    explicit BasicTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);\n    ~BasicTestingSetup();\n};\n\n/** Testing setup that configures a complete environment.\n * Included are data directory, coins database, script check threads setup.\n */\nclass CConnman;\nclass CNode;\nstruct CConnmanTest {\n    static void AddNode(CNode& node);\n    static void ClearNodes();\n};\n\nclass PeerLogicValidation;\nstruct TestingSetup: public BasicTestingSetup {\n    fs::path pathTemp;\n    boost::thread_group threadGroup;\n    CConnman* connman;\n    CScheduler scheduler;\n    std::unique_ptr<PeerLogicValidation> peerLogic;\n\n    explicit TestingSetup(const std::string& chainName = CBaseChainParams::MAIN);\n    ~TestingSetup();\n};\n\nclass CBlock;\nstruct CMutableTransaction;\nclass CScript;\n\n//\n// Testing fixture that pre-creates a\n// 100-block REGTEST-mode block chain\n//\nstruct TestChain100Setup : public TestingSetup {\n    TestChain100Setup();\n\n    // Create a new block with just given transactions, coinbase paying to\n    // scriptPubKey, and try to add it to the current chain.\n    CBlock CreateAndProcessBlock(const std::vector<CMutableTransaction>& txns,\n                                 const CScript& scriptPubKey);\n\n    ~TestChain100Setup();\n\n    std::vector<CTransaction> coinbaseTxns; // For convenience, coinbase transactions\n    CKey coinbaseKey; // private/public key needed to spend coinbase transactions\n};\n\nclass CTxMemPoolEntry;\n\nstruct TestMemPoolEntryHelper\n{\n    // Default values\n    CAmount nFee;\n    int64_t nTime;\n    unsigned int nHeight;\n    bool spendsCoinbase;\n    unsigned int sigOpCost;\n    LockPoints lp;\n\n    TestMemPoolEntryHelper() :\n        nFee(0), nTime(0), nHeight(1),\n        spendsCoinbase(false), sigOpCost(4) { }\n\n    CTxMemPoolEntry FromTx(const CMutableTransaction &tx);\n    CTxMemPoolEntry FromTx(const CTransaction &tx);\n\n    // Change the default value\n    TestMemPoolEntryHelper &Fee(CAmount _fee) { nFee = _fee; return *this; }\n    TestMemPoolEntryHelper &Time(int64_t _time) { nTime = _time; return *this; }\n    TestMemPoolEntryHelper &Height(unsigned int _height) { nHeight = _height; return *this; }\n    TestMemPoolEntryHelper &SpendsCoinbase(bool _flag) { spendsCoinbase = _flag; return *this; }\n    TestMemPoolEntryHelper &SigOpsCost(unsigned int _sigopsCost) { sigOpCost = _sigopsCost; return *this; }\n};\n\nCBlock getBlock13b8a();\n\n// define an implicit conversion here so that uint256 may be used directly in BOOST_CHECK_*\nstd::ostream& operator<<(std::ostream& os, const uint256& num);\n\n#endif\n"
  },
  {
    "path": "src/test/test_bitcoin_fuzzy.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <consensus/merkle.h>\n#include <primitives/block.h>\n#include <script/script.h>\n#include <addrman.h>\n#include <chain.h>\n#include <coins.h>\n#include <compressor.h>\n#include <net.h>\n#include <protocol.h>\n#include <streams.h>\n#include <undo.h>\n#include <version.h>\n#include <pubkey.h>\n#include <blockencodings.h>\n\n#include <stdint.h>\n#include <unistd.h>\n\n#include <algorithm>\n#include <memory>\n#include <vector>\n\nenum TEST_ID {\n    CBLOCK_DESERIALIZE=0,\n    CTRANSACTION_DESERIALIZE,\n    CBLOCKLOCATOR_DESERIALIZE,\n    CBLOCKMERKLEROOT,\n    CADDRMAN_DESERIALIZE,\n    CBLOCKHEADER_DESERIALIZE,\n    CBANENTRY_DESERIALIZE,\n    CTXUNDO_DESERIALIZE,\n    CBLOCKUNDO_DESERIALIZE,\n    CCOINS_DESERIALIZE,\n    CNETADDR_DESERIALIZE,\n    CSERVICE_DESERIALIZE,\n    CMESSAGEHEADER_DESERIALIZE,\n    CADDRESS_DESERIALIZE,\n    CINV_DESERIALIZE,\n    CBLOOMFILTER_DESERIALIZE,\n    CDISKBLOCKINDEX_DESERIALIZE,\n    CTXOUTCOMPRESSOR_DESERIALIZE,\n    BLOCKTRANSACTIONS_DESERIALIZE,\n    BLOCKTRANSACTIONSREQUEST_DESERIALIZE,\n    TEST_ID_END\n};\n\nbool read_stdin(std::vector<uint8_t> &data) {\n    uint8_t buffer[1024];\n    ssize_t length=0;\n    while((length = read(STDIN_FILENO, buffer, 1024)) > 0) {\n        data.insert(data.end(), buffer, buffer+length);\n\n        if (data.size() > (1<<20)) return false;\n    }\n    return length==0;\n}\n\nint test_one_input(std::vector<uint8_t> buffer) {\n    if (buffer.size() < sizeof(uint32_t)) return 0;\n\n    uint32_t test_id = 0xffffffff;\n    memcpy(&test_id, buffer.data(), sizeof(uint32_t));\n    buffer.erase(buffer.begin(), buffer.begin() + sizeof(uint32_t));\n\n    if (test_id >= TEST_ID_END) return 0;\n\n    CDataStream ds(buffer, SER_NETWORK, INIT_PROTO_VERSION);\n    try {\n        int nVersion;\n        ds >> nVersion;\n        ds.SetVersion(nVersion);\n    } catch (const std::ios_base::failure& e) {\n        return 0;\n    }\n\n    switch(test_id) {\n        case CBLOCK_DESERIALIZE:\n        {\n            try\n            {\n                CBlock block;\n                ds >> block;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CTRANSACTION_DESERIALIZE:\n        {\n            try\n            {\n                CTransaction tx(deserialize, ds);\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CBLOCKLOCATOR_DESERIALIZE:\n        {\n            try\n            {\n                CBlockLocator bl;\n                ds >> bl;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CBLOCKMERKLEROOT:\n        {\n            try\n            {\n                CBlock block;\n                ds >> block;\n                bool mutated;\n                BlockMerkleRoot(block, &mutated);\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CADDRMAN_DESERIALIZE:\n        {\n            try\n            {\n                CAddrMan am;\n                ds >> am;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CBLOCKHEADER_DESERIALIZE:\n        {\n            try\n            {\n                CBlockHeader bh;\n                ds >> bh;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CBANENTRY_DESERIALIZE:\n        {\n            try\n            {\n                CBanEntry be;\n                ds >> be;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CTXUNDO_DESERIALIZE:\n        {\n            try\n            {\n                CTxUndo tu;\n                ds >> tu;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CBLOCKUNDO_DESERIALIZE:\n        {\n            try\n            {\n                CBlockUndo bu;\n                ds >> bu;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CCOINS_DESERIALIZE:\n        {\n            try\n            {\n                Coin coin;\n                ds >> coin;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CNETADDR_DESERIALIZE:\n        {\n            try\n            {\n                CNetAddr na;\n                ds >> na;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CSERVICE_DESERIALIZE:\n        {\n            try\n            {\n                CService s;\n                ds >> s;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CMESSAGEHEADER_DESERIALIZE:\n        {\n            CMessageHeader::MessageStartChars pchMessageStart = {0x00, 0x00, 0x00, 0x00};\n            try\n            {\n                CMessageHeader mh(pchMessageStart);\n                ds >> mh;\n                if (!mh.IsValid(pchMessageStart)) {return 0;}\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CADDRESS_DESERIALIZE:\n        {\n            try\n            {\n                CAddress a;\n                ds >> a;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CINV_DESERIALIZE:\n        {\n            try\n            {\n                CInv i;\n                ds >> i;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CBLOOMFILTER_DESERIALIZE:\n        {\n            try\n            {\n                CBloomFilter bf;\n                ds >> bf;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CDISKBLOCKINDEX_DESERIALIZE:\n        {\n            try\n            {\n                CDiskBlockIndex dbi;\n                ds >> dbi;\n            } catch (const std::ios_base::failure& e) {return 0;}\n            break;\n        }\n        case CTXOUTCOMPRESSOR_DESERIALIZE:\n        {\n            CTxOut to;\n            CTxOutCompressor toc(to);\n            try\n            {\n                ds >> toc;\n            } catch (const std::ios_base::failure& e) {return 0;}\n\n            break;\n        }\n        case BLOCKTRANSACTIONS_DESERIALIZE:\n        {\n            try\n            {\n                BlockTransactions bt;\n                ds >> bt;\n            } catch (const std::ios_base::failure& e) {return 0;}\n\n            break;\n        }\n        case BLOCKTRANSACTIONSREQUEST_DESERIALIZE:\n        {\n            try\n            {\n                BlockTransactionsRequest btr;\n                ds >> btr;\n            } catch (const std::ios_base::failure& e) {return 0;}\n\n            break;\n        }\n        default:\n            return 0;\n    }\n    return 0;\n}\n\nstatic std::unique_ptr<ECCVerifyHandle> globalVerifyHandle;\nvoid initialize() {\n    globalVerifyHandle = std::unique_ptr<ECCVerifyHandle>(new ECCVerifyHandle());\n}\n\n// This function is used by libFuzzer\nextern \"C\" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {\n    test_one_input(std::vector<uint8_t>(data, data + size));\n    return 0;\n}\n\n// This function is used by libFuzzer\nextern \"C\" int LLVMFuzzerInitialize(int *argc, char ***argv) {\n    initialize();\n    return 0;\n}\n\n// Disabled under WIN32 due to clash with Cygwin's WinMain.\n#ifndef WIN32\n// Declare main(...) \"weak\" to allow for libFuzzer linking. libFuzzer provides\n// the main(...) function.\n__attribute__((weak))\n#endif\nint main(int argc, char **argv)\n{\n    initialize();\n#ifdef __AFL_INIT\n    // Enable AFL deferred forkserver mode. Requires compilation using\n    // afl-clang-fast++. See fuzzing.md for details.\n    __AFL_INIT();\n#endif\n\n#ifdef __AFL_LOOP\n    // Enable AFL persistent mode. Requires compilation using afl-clang-fast++.\n    // See fuzzing.md for details.\n    int ret = 0;\n    while (__AFL_LOOP(1000)) {\n        std::vector<uint8_t> buffer;\n        if (!read_stdin(buffer)) {\n            continue;\n        }\n        ret = test_one_input(buffer);\n    }\n    return ret;\n#else\n    std::vector<uint8_t> buffer;\n    if (!read_stdin(buffer)) {\n        return 0;\n    }\n    return test_one_input(buffer);\n#endif\n}\n"
  },
  {
    "path": "src/test/test_bitcoin_main.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#define BOOST_TEST_MODULE Sugarchain Test Suite\n\n#include <net.h>\n\n#include <memory>\n\n#include <boost/test/unit_test.hpp>\n\nstd::unique_ptr<CConnman> g_connman;\n\n[[noreturn]] void Shutdown(void* parg)\n{\n  std::exit(EXIT_SUCCESS);\n}\n\n[[noreturn]] void StartShutdown()\n{\n  std::exit(EXIT_SUCCESS);\n}\n\nbool ShutdownRequested()\n{\n  return false;\n}\n"
  },
  {
    "path": "src/test/timedata_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n//\n#include <timedata.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(timedata_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(util_MedianFilter)\n{\n    CMedianFilter<int> filter(5, 15);\n\n    BOOST_CHECK_EQUAL(filter.median(), 15);\n\n    filter.input(20); // [15 20]\n    BOOST_CHECK_EQUAL(filter.median(), 17);\n\n    filter.input(30); // [15 20 30]\n    BOOST_CHECK_EQUAL(filter.median(), 20);\n\n    filter.input(3); // [3 15 20 30]\n    BOOST_CHECK_EQUAL(filter.median(), 17);\n\n    filter.input(7); // [3 7 15 20 30]\n    BOOST_CHECK_EQUAL(filter.median(), 15);\n\n    filter.input(18); // [3 7 18 20 30]\n    BOOST_CHECK_EQUAL(filter.median(), 18);\n\n    filter.input(0); // [0 3 7 18 30]\n    BOOST_CHECK_EQUAL(filter.median(), 7);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/torcontrol_tests.cpp",
    "content": "// Copyright (c) 2017 The Zcash developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n//\n#include <test/test_bitcoin.h>\n#include <torcontrol.cpp>\n\n#include <boost/test/unit_test.hpp>\n\n\nBOOST_FIXTURE_TEST_SUITE(torcontrol_tests, BasicTestingSetup)\n\nvoid CheckSplitTorReplyLine(std::string input, std::string command, std::string args)\n{\n    BOOST_TEST_MESSAGE(std::string(\"CheckSplitTorReplyLine(\") + input + \")\");\n    auto ret = SplitTorReplyLine(input);\n    BOOST_CHECK_EQUAL(ret.first, command);\n    BOOST_CHECK_EQUAL(ret.second, args);\n}\n\nBOOST_AUTO_TEST_CASE(util_SplitTorReplyLine)\n{\n    // Data we should receive during normal usage\n    CheckSplitTorReplyLine(\n        \"PROTOCOLINFO PIVERSION\",\n        \"PROTOCOLINFO\", \"PIVERSION\");\n    CheckSplitTorReplyLine(\n        \"AUTH METHODS=COOKIE,SAFECOOKIE COOKIEFILE=\\\"/home/x/.tor/control_auth_cookie\\\"\",\n        \"AUTH\", \"METHODS=COOKIE,SAFECOOKIE COOKIEFILE=\\\"/home/x/.tor/control_auth_cookie\\\"\");\n    CheckSplitTorReplyLine(\n        \"AUTH METHODS=NULL\",\n        \"AUTH\", \"METHODS=NULL\");\n    CheckSplitTorReplyLine(\n        \"AUTH METHODS=HASHEDPASSWORD\",\n        \"AUTH\", \"METHODS=HASHEDPASSWORD\");\n    CheckSplitTorReplyLine(\n        \"VERSION Tor=\\\"0.2.9.8 (git-a0df013ea241b026)\\\"\",\n        \"VERSION\", \"Tor=\\\"0.2.9.8 (git-a0df013ea241b026)\\\"\");\n    CheckSplitTorReplyLine(\n        \"AUTHCHALLENGE SERVERHASH=aaaa SERVERNONCE=bbbb\",\n        \"AUTHCHALLENGE\", \"SERVERHASH=aaaa SERVERNONCE=bbbb\");\n\n    // Other valid inputs\n    CheckSplitTorReplyLine(\"COMMAND\", \"COMMAND\", \"\");\n    CheckSplitTorReplyLine(\"COMMAND SOME  ARGS\", \"COMMAND\", \"SOME  ARGS\");\n\n    // These inputs are valid because PROTOCOLINFO accepts an OtherLine that is\n    // just an OptArguments, which enables multiple spaces to be present\n    // between the command and arguments.\n    CheckSplitTorReplyLine(\"COMMAND  ARGS\", \"COMMAND\", \" ARGS\");\n    CheckSplitTorReplyLine(\"COMMAND   EVEN+more  ARGS\", \"COMMAND\", \"  EVEN+more  ARGS\");\n}\n\nvoid CheckParseTorReplyMapping(std::string input, std::map<std::string,std::string> expected)\n{\n    BOOST_TEST_MESSAGE(std::string(\"CheckParseTorReplyMapping(\") + input + \")\");\n    auto ret = ParseTorReplyMapping(input);\n    BOOST_CHECK_EQUAL(ret.size(), expected.size());\n    auto r_it = ret.begin();\n    auto e_it = expected.begin();\n    while (r_it != ret.end() && e_it != expected.end()) {\n        BOOST_CHECK_EQUAL(r_it->first, e_it->first);\n        BOOST_CHECK_EQUAL(r_it->second, e_it->second);\n        r_it++;\n        e_it++;\n    }\n}\n\nBOOST_AUTO_TEST_CASE(util_ParseTorReplyMapping)\n{\n    // Data we should receive during normal usage\n    CheckParseTorReplyMapping(\n        \"METHODS=COOKIE,SAFECOOKIE COOKIEFILE=\\\"/home/x/.tor/control_auth_cookie\\\"\", {\n            {\"METHODS\", \"COOKIE,SAFECOOKIE\"},\n            {\"COOKIEFILE\", \"/home/x/.tor/control_auth_cookie\"},\n        });\n    CheckParseTorReplyMapping(\n        \"METHODS=NULL\", {\n            {\"METHODS\", \"NULL\"},\n        });\n    CheckParseTorReplyMapping(\n        \"METHODS=HASHEDPASSWORD\", {\n            {\"METHODS\", \"HASHEDPASSWORD\"},\n        });\n    CheckParseTorReplyMapping(\n        \"Tor=\\\"0.2.9.8 (git-a0df013ea241b026)\\\"\", {\n            {\"Tor\", \"0.2.9.8 (git-a0df013ea241b026)\"},\n        });\n    CheckParseTorReplyMapping(\n        \"SERVERHASH=aaaa SERVERNONCE=bbbb\", {\n            {\"SERVERHASH\", \"aaaa\"},\n            {\"SERVERNONCE\", \"bbbb\"},\n        });\n    CheckParseTorReplyMapping(\n        \"ServiceID=exampleonion1234\", {\n            {\"ServiceID\", \"exampleonion1234\"},\n        });\n    CheckParseTorReplyMapping(\n        \"PrivateKey=RSA1024:BLOB\", {\n            {\"PrivateKey\", \"RSA1024:BLOB\"},\n        });\n    CheckParseTorReplyMapping(\n        \"ClientAuth=bob:BLOB\", {\n            {\"ClientAuth\", \"bob:BLOB\"},\n        });\n\n    // Other valid inputs\n    CheckParseTorReplyMapping(\n        \"Foo=Bar=Baz Spam=Eggs\", {\n            {\"Foo\", \"Bar=Baz\"},\n            {\"Spam\", \"Eggs\"},\n        });\n    CheckParseTorReplyMapping(\n        \"Foo=\\\"Bar=Baz\\\"\", {\n            {\"Foo\", \"Bar=Baz\"},\n        });\n    CheckParseTorReplyMapping(\n        \"Foo=\\\"Bar Baz\\\"\", {\n            {\"Foo\", \"Bar Baz\"},\n        });\n\n    // Escapes\n    CheckParseTorReplyMapping(\n        \"Foo=\\\"Bar\\\\ Baz\\\"\", {\n            {\"Foo\", \"Bar Baz\"},\n        });\n    CheckParseTorReplyMapping(\n        \"Foo=\\\"Bar\\\\Baz\\\"\", {\n            {\"Foo\", \"BarBaz\"},\n        });\n    CheckParseTorReplyMapping(\n        \"Foo=\\\"Bar\\\\@Baz\\\"\", {\n            {\"Foo\", \"Bar@Baz\"},\n        });\n    CheckParseTorReplyMapping(\n        \"Foo=\\\"Bar\\\\\\\"Baz\\\" Spam=\\\"\\\\\\\"Eggs\\\\\\\"\\\"\", {\n            {\"Foo\", \"Bar\\\"Baz\"},\n            {\"Spam\", \"\\\"Eggs\\\"\"},\n        });\n    CheckParseTorReplyMapping(\n        \"Foo=\\\"Bar\\\\\\\\Baz\\\"\", {\n            {\"Foo\", \"Bar\\\\Baz\"},\n        });\n\n    // C escapes\n    CheckParseTorReplyMapping(\n        \"Foo=\\\"Bar\\\\nBaz\\\\t\\\" Spam=\\\"\\\\rEggs\\\" Octals=\\\"\\\\1a\\\\11\\\\17\\\\18\\\\81\\\\377\\\\378\\\\400\\\\2222\\\" Final=Check\", {\n            {\"Foo\", \"Bar\\nBaz\\t\"},\n            {\"Spam\", \"\\rEggs\"},\n            {\"Octals\", \"\\1a\\11\\17\\1\" \"881\\377\\37\" \"8\\40\" \"0\\222\" \"2\"},\n            {\"Final\", \"Check\"},\n        });\n    CheckParseTorReplyMapping(\n        \"Valid=Mapping Escaped=\\\"Escape\\\\\\\\\\\"\", {\n            {\"Valid\", \"Mapping\"},\n            {\"Escaped\", \"Escape\\\\\"},\n        });\n    CheckParseTorReplyMapping(\n        \"Valid=Mapping Bare=\\\"Escape\\\\\\\"\", {});\n    CheckParseTorReplyMapping(\n        \"OneOctal=\\\"OneEnd\\\\1\\\" TwoOctal=\\\"TwoEnd\\\\11\\\"\", {\n            {\"OneOctal\", \"OneEnd\\1\"},\n            {\"TwoOctal\", \"TwoEnd\\11\"},\n        });\n\n    // Special handling for null case\n    // (needed because string comparison reads the null as end-of-string)\n    BOOST_TEST_MESSAGE(std::string(\"CheckParseTorReplyMapping(Null=\\\"\\\\0\\\")\"));\n    auto ret = ParseTorReplyMapping(\"Null=\\\"\\\\0\\\"\");\n    BOOST_CHECK_EQUAL(ret.size(), 1);\n    auto r_it = ret.begin();\n    BOOST_CHECK_EQUAL(r_it->first, \"Null\");\n    BOOST_CHECK_EQUAL(r_it->second.size(), 1);\n    BOOST_CHECK_EQUAL(r_it->second[0], '\\0');\n\n    // A more complex valid grammar. PROTOCOLINFO accepts a VersionLine that\n    // takes a key=value pair followed by an OptArguments, making this valid.\n    // Because an OptArguments contains no semantic data, there is no point in\n    // parsing it.\n    CheckParseTorReplyMapping(\n        \"SOME=args,here MORE optional=arguments  here\", {\n            {\"SOME\", \"args,here\"},\n        });\n\n    // Inputs that are effectively invalid under the target grammar.\n    // PROTOCOLINFO accepts an OtherLine that is just an OptArguments, which\n    // would make these inputs valid. However,\n    // - This parser is never used in that situation, because the\n    //   SplitTorReplyLine parser enables OtherLine to be skipped.\n    // - Even if these were valid, an OptArguments contains no semantic data,\n    //   so there is no point in parsing it.\n    CheckParseTorReplyMapping(\"ARGS\", {});\n    CheckParseTorReplyMapping(\"MORE ARGS\", {});\n    CheckParseTorReplyMapping(\"MORE  ARGS\", {});\n    CheckParseTorReplyMapping(\"EVEN more=ARGS\", {});\n    CheckParseTorReplyMapping(\"EVEN+more ARGS\", {});\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/transaction_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <test/data/tx_invalid.json.h>\n#include <test/data/tx_valid.json.h>\n#include <test/test_bitcoin.h>\n\n#include <clientversion.h>\n#include <checkqueue.h>\n#include <consensus/tx_verify.h>\n#include <consensus/validation.h>\n#include <core_io.h>\n#include <key.h>\n#include <keystore.h>\n#include <validation.h>\n#include <policy/policy.h>\n#include <script/script.h>\n#include <script/sign.h>\n#include <script/script_error.h>\n#include <script/standard.h>\n#include <utilstrencodings.h>\n\n#include <map>\n#include <string>\n\n#include <boost/algorithm/string/classification.hpp>\n#include <boost/algorithm/string/split.hpp>\n#include <boost/test/unit_test.hpp>\n\n#include <univalue.h>\n\ntypedef std::vector<unsigned char> valtype;\n\n// In script_tests.cpp\nextern UniValue read_json(const std::string& jsondata);\n\nstatic std::map<std::string, unsigned int> mapFlagNames = {\n    {std::string(\"NONE\"), (unsigned int)SCRIPT_VERIFY_NONE},\n    {std::string(\"P2SH\"), (unsigned int)SCRIPT_VERIFY_P2SH},\n    {std::string(\"STRICTENC\"), (unsigned int)SCRIPT_VERIFY_STRICTENC},\n    {std::string(\"DERSIG\"), (unsigned int)SCRIPT_VERIFY_DERSIG},\n    {std::string(\"LOW_S\"), (unsigned int)SCRIPT_VERIFY_LOW_S},\n    {std::string(\"SIGPUSHONLY\"), (unsigned int)SCRIPT_VERIFY_SIGPUSHONLY},\n    {std::string(\"MINIMALDATA\"), (unsigned int)SCRIPT_VERIFY_MINIMALDATA},\n    {std::string(\"NULLDUMMY\"), (unsigned int)SCRIPT_VERIFY_NULLDUMMY},\n    {std::string(\"DISCOURAGE_UPGRADABLE_NOPS\"), (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS},\n    {std::string(\"CLEANSTACK\"), (unsigned int)SCRIPT_VERIFY_CLEANSTACK},\n    {std::string(\"MINIMALIF\"), (unsigned int)SCRIPT_VERIFY_MINIMALIF},\n    {std::string(\"NULLFAIL\"), (unsigned int)SCRIPT_VERIFY_NULLFAIL},\n    {std::string(\"CHECKLOCKTIMEVERIFY\"), (unsigned int)SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY},\n    {std::string(\"CHECKSEQUENCEVERIFY\"), (unsigned int)SCRIPT_VERIFY_CHECKSEQUENCEVERIFY},\n    {std::string(\"WITNESS\"), (unsigned int)SCRIPT_VERIFY_WITNESS},\n    {std::string(\"DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM\"), (unsigned int)SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM},\n    {std::string(\"WITNESS_PUBKEYTYPE\"), (unsigned int)SCRIPT_VERIFY_WITNESS_PUBKEYTYPE},\n    {std::string(\"CONST_SCRIPTCODE\"), (unsigned int)SCRIPT_VERIFY_CONST_SCRIPTCODE},\n};\n\nunsigned int ParseScriptFlags(std::string strFlags)\n{\n    if (strFlags.empty()) {\n        return 0;\n    }\n    unsigned int flags = 0;\n    std::vector<std::string> words;\n    boost::algorithm::split(words, strFlags, boost::algorithm::is_any_of(\",\"));\n\n    for (std::string word : words)\n    {\n        if (!mapFlagNames.count(word))\n            BOOST_ERROR(\"Bad test: unknown verification flag '\" << word << \"'\");\n        flags |= mapFlagNames[word];\n    }\n\n    return flags;\n}\n\nstd::string FormatScriptFlags(unsigned int flags)\n{\n    if (flags == 0) {\n        return \"\";\n    }\n    std::string ret;\n    std::map<std::string, unsigned int>::const_iterator it = mapFlagNames.begin();\n    while (it != mapFlagNames.end()) {\n        if (flags & it->second) {\n            ret += it->first + \",\";\n        }\n        it++;\n    }\n    return ret.substr(0, ret.size() - 1);\n}\n\nBOOST_FIXTURE_TEST_SUITE(transaction_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(tx_valid)\n{\n    // Read tests from test/data/tx_valid.json\n    // Format is an array of arrays\n    // Inner arrays are either [ \"comment\" ]\n    // or [[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],\"], serializedTransaction, verifyFlags\n    // ... where all scripts are stringified scripts.\n    //\n    // verifyFlags is a comma separated list of script verification flags to apply, or \"NONE\"\n    UniValue tests = read_json(std::string(json_tests::tx_valid, json_tests::tx_valid + sizeof(json_tests::tx_valid)));\n\n    ScriptError err;\n    for (unsigned int idx = 0; idx < tests.size(); idx++) {\n        UniValue test = tests[idx];\n        std::string strTest = test.write();\n        if (test[0].isArray())\n        {\n            if (test.size() != 3 || !test[1].isStr() || !test[2].isStr())\n            {\n                BOOST_ERROR(\"Bad test: \" << strTest);\n                continue;\n            }\n\n            std::map<COutPoint, CScript> mapprevOutScriptPubKeys;\n            std::map<COutPoint, int64_t> mapprevOutValues;\n            UniValue inputs = test[0].get_array();\n            bool fValid = true;\n\t    for (unsigned int inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {\n\t        const UniValue& input = inputs[inpIdx];\n                if (!input.isArray())\n                {\n                    fValid = false;\n                    break;\n                }\n                UniValue vinput = input.get_array();\n                if (vinput.size() < 3 || vinput.size() > 4)\n                {\n                    fValid = false;\n                    break;\n                }\n                COutPoint outpoint(uint256S(vinput[0].get_str()), vinput[1].get_int());\n                mapprevOutScriptPubKeys[outpoint] = ParseScript(vinput[2].get_str());\n                if (vinput.size() >= 4)\n                {\n                    mapprevOutValues[outpoint] = vinput[3].get_int64();\n                }\n            }\n            if (!fValid)\n            {\n                BOOST_ERROR(\"Bad test: \" << strTest);\n                continue;\n            }\n\n            std::string transaction = test[1].get_str();\n            CDataStream stream(ParseHex(transaction), SER_NETWORK, PROTOCOL_VERSION);\n            CTransaction tx(deserialize, stream);\n\n            CValidationState state;\n            BOOST_CHECK_MESSAGE(CheckTransaction(tx, state), strTest);\n            BOOST_CHECK(state.IsValid());\n\n            PrecomputedTransactionData txdata(tx);\n            for (unsigned int i = 0; i < tx.vin.size(); i++)\n            {\n                if (!mapprevOutScriptPubKeys.count(tx.vin[i].prevout))\n                {\n                    BOOST_ERROR(\"Bad test: \" << strTest);\n                    break;\n                }\n\n                CAmount amount = 0;\n                if (mapprevOutValues.count(tx.vin[i].prevout)) {\n                    amount = mapprevOutValues[tx.vin[i].prevout];\n                }\n                unsigned int verify_flags = ParseScriptFlags(test[2].get_str());\n                const CScriptWitness *witness = &tx.vin[i].scriptWitness;\n                BOOST_CHECK_MESSAGE(VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout],\n                                                 witness, verify_flags, TransactionSignatureChecker(&tx, i, amount, txdata), &err),\n                                    strTest);\n                BOOST_CHECK_MESSAGE(err == SCRIPT_ERR_OK, ScriptErrorString(err));\n            }\n        }\n    }\n}\n\nBOOST_AUTO_TEST_CASE(tx_invalid)\n{\n    // Read tests from test/data/tx_invalid.json\n    // Format is an array of arrays\n    // Inner arrays are either [ \"comment\" ]\n    // or [[[prevout hash, prevout index, prevout scriptPubKey], [input 2], ...],\"], serializedTransaction, verifyFlags\n    // ... where all scripts are stringified scripts.\n    //\n    // verifyFlags is a comma separated list of script verification flags to apply, or \"NONE\"\n    UniValue tests = read_json(std::string(json_tests::tx_invalid, json_tests::tx_invalid + sizeof(json_tests::tx_invalid)));\n\n    // Initialize to SCRIPT_ERR_OK. The tests expect err to be changed to a\n    // value other than SCRIPT_ERR_OK.\n    ScriptError err = SCRIPT_ERR_OK;\n    for (unsigned int idx = 0; idx < tests.size(); idx++) {\n        UniValue test = tests[idx];\n        std::string strTest = test.write();\n        if (test[0].isArray())\n        {\n            if (test.size() != 3 || !test[1].isStr() || !test[2].isStr())\n            {\n                BOOST_ERROR(\"Bad test: \" << strTest);\n                continue;\n            }\n\n            std::map<COutPoint, CScript> mapprevOutScriptPubKeys;\n            std::map<COutPoint, int64_t> mapprevOutValues;\n            UniValue inputs = test[0].get_array();\n            bool fValid = true;\n\t    for (unsigned int inpIdx = 0; inpIdx < inputs.size(); inpIdx++) {\n\t        const UniValue& input = inputs[inpIdx];\n                if (!input.isArray())\n                {\n                    fValid = false;\n                    break;\n                }\n                UniValue vinput = input.get_array();\n                if (vinput.size() < 3 || vinput.size() > 4)\n                {\n                    fValid = false;\n                    break;\n                }\n                COutPoint outpoint(uint256S(vinput[0].get_str()), vinput[1].get_int());\n                mapprevOutScriptPubKeys[outpoint] = ParseScript(vinput[2].get_str());\n                if (vinput.size() >= 4)\n                {\n                    mapprevOutValues[outpoint] = vinput[3].get_int64();\n                }\n            }\n            if (!fValid)\n            {\n                BOOST_ERROR(\"Bad test: \" << strTest);\n                continue;\n            }\n\n            std::string transaction = test[1].get_str();\n            CDataStream stream(ParseHex(transaction), SER_NETWORK, PROTOCOL_VERSION );\n            CTransaction tx(deserialize, stream);\n\n            CValidationState state;\n            fValid = CheckTransaction(tx, state) && state.IsValid();\n\n            PrecomputedTransactionData txdata(tx);\n            for (unsigned int i = 0; i < tx.vin.size() && fValid; i++)\n            {\n                if (!mapprevOutScriptPubKeys.count(tx.vin[i].prevout))\n                {\n                    BOOST_ERROR(\"Bad test: \" << strTest);\n                    break;\n                }\n\n                unsigned int verify_flags = ParseScriptFlags(test[2].get_str());\n                CAmount amount = 0;\n                if (mapprevOutValues.count(tx.vin[i].prevout)) {\n                    amount = mapprevOutValues[tx.vin[i].prevout];\n                }\n                const CScriptWitness *witness = &tx.vin[i].scriptWitness;\n                fValid = VerifyScript(tx.vin[i].scriptSig, mapprevOutScriptPubKeys[tx.vin[i].prevout],\n                                      witness, verify_flags, TransactionSignatureChecker(&tx, i, amount, txdata), &err);\n            }\n            BOOST_CHECK_MESSAGE(!fValid, strTest);\n            BOOST_CHECK_MESSAGE(err != SCRIPT_ERR_OK, ScriptErrorString(err));\n        }\n    }\n}\n\nBOOST_AUTO_TEST_CASE(basic_transaction_tests)\n{\n    // Random real transaction (e2769b09e784f32f62ef849763d4f45b98e07ba658647343b915ff832b110436)\n    unsigned char ch[] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x6b, 0xff, 0x7f, 0xcd, 0x4f, 0x85, 0x65, 0xef, 0x40, 0x6d, 0xd5, 0xd6, 0x3d, 0x4f, 0xf9, 0x4f, 0x31, 0x8f, 0xe8, 0x20, 0x27, 0xfd, 0x4d, 0xc4, 0x51, 0xb0, 0x44, 0x74, 0x01, 0x9f, 0x74, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x49, 0x30, 0x46, 0x02, 0x21, 0x00, 0xda, 0x0d, 0xc6, 0xae, 0xce, 0xfe, 0x1e, 0x06, 0xef, 0xdf, 0x05, 0x77, 0x37, 0x57, 0xde, 0xb1, 0x68, 0x82, 0x09, 0x30, 0xe3, 0xb0, 0xd0, 0x3f, 0x46, 0xf5, 0xfc, 0xf1, 0x50, 0xbf, 0x99, 0x0c, 0x02, 0x21, 0x00, 0xd2, 0x5b, 0x5c, 0x87, 0x04, 0x00, 0x76, 0xe4, 0xf2, 0x53, 0xf8, 0x26, 0x2e, 0x76, 0x3e, 0x2d, 0xd5, 0x1e, 0x7f, 0xf0, 0xbe, 0x15, 0x77, 0x27, 0xc4, 0xbc, 0x42, 0x80, 0x7f, 0x17, 0xbd, 0x39, 0x01, 0x41, 0x04, 0xe6, 0xc2, 0x6e, 0xf6, 0x7d, 0xc6, 0x10, 0xd2, 0xcd, 0x19, 0x24, 0x84, 0x78, 0x9a, 0x6c, 0xf9, 0xae, 0xa9, 0x93, 0x0b, 0x94, 0x4b, 0x7e, 0x2d, 0xb5, 0x34, 0x2b, 0x9d, 0x9e, 0x5b, 0x9f, 0xf7, 0x9a, 0xff, 0x9a, 0x2e, 0xe1, 0x97, 0x8d, 0xd7, 0xfd, 0x01, 0xdf, 0xc5, 0x22, 0xee, 0x02, 0x28, 0x3d, 0x3b, 0x06, 0xa9, 0xd0, 0x3a, 0xcf, 0x80, 0x96, 0x96, 0x8d, 0x7d, 0xbb, 0x0f, 0x91, 0x78, 0xff, 0xff, 0xff, 0xff, 0x02, 0x8b, 0xa7, 0x94, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xba, 0xde, 0xec, 0xfd, 0xef, 0x05, 0x07, 0x24, 0x7f, 0xc8, 0xf7, 0x42, 0x41, 0xd7, 0x3b, 0xc0, 0x39, 0x97, 0x2d, 0x7b, 0x88, 0xac, 0x40, 0x94, 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xc1, 0x09, 0x32, 0x48, 0x3f, 0xec, 0x93, 0xed, 0x51, 0xf5, 0xfe, 0x95, 0xe7, 0x25, 0x59, 0xf2, 0xcc, 0x70, 0x43, 0xf9, 0x88, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00};\n    std::vector<unsigned char> vch(ch, ch + sizeof(ch) -1);\n    CDataStream stream(vch, SER_DISK, CLIENT_VERSION);\n    CMutableTransaction tx;\n    stream >> tx;\n    CValidationState state;\n    BOOST_CHECK_MESSAGE(CheckTransaction(tx, state) && state.IsValid(), \"Simple deserialized transaction should be valid.\");\n\n    // Check that duplicate txins fail\n    tx.vin.push_back(tx.vin[0]);\n    BOOST_CHECK_MESSAGE(!CheckTransaction(tx, state) || !state.IsValid(), \"Transaction with duplicate txins should be invalid.\");\n}\n\n//\n// Helper: create two dummy transactions, each with\n// two outputs.  The first has 11 and 50 CENT outputs\n// paid to a TX_PUBKEY, the second 21 and 22 CENT outputs\n// paid to a TX_PUBKEYHASH.\n//\nstatic std::vector<CMutableTransaction>\nSetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsViewCache& coinsRet)\n{\n    std::vector<CMutableTransaction> dummyTransactions;\n    dummyTransactions.resize(2);\n\n    // Add some keys to the keystore:\n    CKey key[4];\n    for (int i = 0; i < 4; i++)\n    {\n        key[i].MakeNewKey(i % 2);\n        keystoreRet.AddKey(key[i]);\n    }\n\n    // Create some dummy input transactions\n    dummyTransactions[0].vout.resize(2);\n    dummyTransactions[0].vout[0].nValue = 11*CENT;\n    dummyTransactions[0].vout[0].scriptPubKey << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG;\n    dummyTransactions[0].vout[1].nValue = 50*CENT;\n    dummyTransactions[0].vout[1].scriptPubKey << ToByteVector(key[1].GetPubKey()) << OP_CHECKSIG;\n    AddCoins(coinsRet, dummyTransactions[0], 0);\n\n    dummyTransactions[1].vout.resize(2);\n    dummyTransactions[1].vout[0].nValue = 21*CENT;\n    dummyTransactions[1].vout[0].scriptPubKey = GetScriptForDestination(key[2].GetPubKey().GetID());\n    dummyTransactions[1].vout[1].nValue = 22*CENT;\n    dummyTransactions[1].vout[1].scriptPubKey = GetScriptForDestination(key[3].GetPubKey().GetID());\n    AddCoins(coinsRet, dummyTransactions[1], 0);\n\n    return dummyTransactions;\n}\n\nBOOST_AUTO_TEST_CASE(test_Get)\n{\n    CBasicKeyStore keystore;\n    CCoinsView coinsDummy;\n    CCoinsViewCache coins(&coinsDummy);\n    std::vector<CMutableTransaction> dummyTransactions = SetupDummyInputs(keystore, coins);\n\n    CMutableTransaction t1;\n    t1.vin.resize(3);\n    t1.vin[0].prevout.hash = dummyTransactions[0].GetHash();\n    t1.vin[0].prevout.n = 1;\n    t1.vin[0].scriptSig << std::vector<unsigned char>(65, 0);\n    t1.vin[1].prevout.hash = dummyTransactions[1].GetHash();\n    t1.vin[1].prevout.n = 0;\n    t1.vin[1].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);\n    t1.vin[2].prevout.hash = dummyTransactions[1].GetHash();\n    t1.vin[2].prevout.n = 1;\n    t1.vin[2].scriptSig << std::vector<unsigned char>(65, 0) << std::vector<unsigned char>(33, 4);\n    t1.vout.resize(2);\n    t1.vout[0].nValue = 90*CENT;\n    t1.vout[0].scriptPubKey << OP_1;\n\n    BOOST_CHECK(AreInputsStandard(t1, coins));\n    BOOST_CHECK_EQUAL(coins.GetValueIn(t1), (50+21+22)*CENT);\n}\n\nvoid CreateCreditAndSpend(const CKeyStore& keystore, const CScript& outscript, CTransactionRef& output, CMutableTransaction& input, bool success = true)\n{\n    CMutableTransaction outputm;\n    outputm.nVersion = 1;\n    outputm.vin.resize(1);\n    outputm.vin[0].prevout.SetNull();\n    outputm.vin[0].scriptSig = CScript();\n    outputm.vout.resize(1);\n    outputm.vout[0].nValue = 1;\n    outputm.vout[0].scriptPubKey = outscript;\n    CDataStream ssout(SER_NETWORK, PROTOCOL_VERSION);\n    ssout << outputm;\n    ssout >> output;\n    assert(output->vin.size() == 1);\n    assert(output->vin[0] == outputm.vin[0]);\n    assert(output->vout.size() == 1);\n    assert(output->vout[0] == outputm.vout[0]);\n\n    CMutableTransaction inputm;\n    inputm.nVersion = 1;\n    inputm.vin.resize(1);\n    inputm.vin[0].prevout.hash = output->GetHash();\n    inputm.vin[0].prevout.n = 0;\n    inputm.vout.resize(1);\n    inputm.vout[0].nValue = 1;\n    inputm.vout[0].scriptPubKey = CScript();\n    bool ret = SignSignature(keystore, *output, inputm, 0, SIGHASH_ALL);\n    assert(ret == success);\n    CDataStream ssin(SER_NETWORK, PROTOCOL_VERSION);\n    ssin << inputm;\n    ssin >> input;\n    assert(input.vin.size() == 1);\n    assert(input.vin[0] == inputm.vin[0]);\n    assert(input.vout.size() == 1);\n    assert(input.vout[0] == inputm.vout[0]);\n    assert(input.vin[0].scriptWitness.stack == inputm.vin[0].scriptWitness.stack);\n}\n\nvoid CheckWithFlag(const CTransactionRef& output, const CMutableTransaction& input, int flags, bool success)\n{\n    ScriptError error;\n    CTransaction inputi(input);\n    bool ret = VerifyScript(inputi.vin[0].scriptSig, output->vout[0].scriptPubKey, &inputi.vin[0].scriptWitness, flags, TransactionSignatureChecker(&inputi, 0, output->vout[0].nValue), &error);\n    assert(ret == success);\n}\n\nstatic CScript PushAll(const std::vector<valtype>& values)\n{\n    CScript result;\n    for (const valtype& v : values) {\n        if (v.size() == 0) {\n            result << OP_0;\n        } else if (v.size() == 1 && v[0] >= 1 && v[0] <= 16) {\n            result << CScript::EncodeOP_N(v[0]);\n        } else {\n            result << v;\n        }\n    }\n    return result;\n}\n\nvoid ReplaceRedeemScript(CScript& script, const CScript& redeemScript)\n{\n    std::vector<valtype> stack;\n    EvalScript(stack, script, SCRIPT_VERIFY_STRICTENC, BaseSignatureChecker(), SIGVERSION_BASE);\n    assert(stack.size() > 0);\n    stack.back() = std::vector<unsigned char>(redeemScript.begin(), redeemScript.end());\n    script = PushAll(stack);\n}\n\nBOOST_AUTO_TEST_CASE(test_big_witness_transaction) {\n    CMutableTransaction mtx;\n    mtx.nVersion = 1;\n\n    CKey key;\n    key.MakeNewKey(true); // Need to use compressed keys in segwit or the signing will fail\n    CBasicKeyStore keystore;\n    keystore.AddKeyPubKey(key, key.GetPubKey());\n    CKeyID hash = key.GetPubKey().GetID();\n    CScript scriptPubKey = CScript() << OP_0 << std::vector<unsigned char>(hash.begin(), hash.end());\n\n    std::vector<int> sigHashes;\n    sigHashes.push_back(SIGHASH_NONE | SIGHASH_ANYONECANPAY);\n    sigHashes.push_back(SIGHASH_SINGLE | SIGHASH_ANYONECANPAY);\n    sigHashes.push_back(SIGHASH_ALL | SIGHASH_ANYONECANPAY);\n    sigHashes.push_back(SIGHASH_NONE);\n    sigHashes.push_back(SIGHASH_SINGLE);\n    sigHashes.push_back(SIGHASH_ALL);\n\n    // create a big transaction of 4500 inputs signed by the same key\n    for(uint32_t ij = 0; ij < 4500; ij++) {\n        uint32_t i = mtx.vin.size();\n        uint256 prevId;\n        prevId.SetHex(\"0000000000000000000000000000000000000000000000000000000000000100\");\n        COutPoint outpoint(prevId, i);\n\n        mtx.vin.resize(mtx.vin.size() + 1);\n        mtx.vin[i].prevout = outpoint;\n        mtx.vin[i].scriptSig = CScript();\n\n        mtx.vout.resize(mtx.vout.size() + 1);\n        mtx.vout[i].nValue = 1000;\n        mtx.vout[i].scriptPubKey = CScript() << OP_1;\n    }\n\n    // sign all inputs\n    for(uint32_t i = 0; i < mtx.vin.size(); i++) {\n        bool hashSigned = SignSignature(keystore, scriptPubKey, mtx, i, 1000, sigHashes.at(i % sigHashes.size()));\n        assert(hashSigned);\n    }\n\n    CDataStream ssout(SER_NETWORK, PROTOCOL_VERSION);\n    auto vstream = WithOrVersion(&ssout, 0);\n    vstream << mtx;\n    CTransaction tx(deserialize, vstream);\n\n    // check all inputs concurrently, with the cache\n    PrecomputedTransactionData txdata(tx);\n    boost::thread_group threadGroup;\n    CCheckQueue<CScriptCheck> scriptcheckqueue(128);\n    CCheckQueueControl<CScriptCheck> control(&scriptcheckqueue);\n\n    for (int i=0; i<20; i++)\n        threadGroup.create_thread(boost::bind(&CCheckQueue<CScriptCheck>::Thread, boost::ref(scriptcheckqueue)));\n\n    std::vector<Coin> coins;\n    for(uint32_t i = 0; i < mtx.vin.size(); i++) {\n        Coin coin;\n        coin.nHeight = 1;\n        coin.fCoinBase = false;\n        coin.out.nValue = 1000;\n        coin.out.scriptPubKey = scriptPubKey;\n        coins.emplace_back(std::move(coin));\n    }\n\n    for(uint32_t i = 0; i < mtx.vin.size(); i++) {\n        std::vector<CScriptCheck> vChecks;\n        CScriptCheck check(coins[tx.vin[i].prevout.n].out, tx, i, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false, &txdata);\n        vChecks.push_back(CScriptCheck());\n        check.swap(vChecks.back());\n        control.Add(vChecks);\n    }\n\n    bool controlCheck = control.Wait();\n    assert(controlCheck);\n\n    threadGroup.interrupt_all();\n    threadGroup.join_all();\n}\n\nBOOST_AUTO_TEST_CASE(test_witness)\n{\n    CBasicKeyStore keystore, keystore2;\n    CKey key1, key2, key3, key1L, key2L;\n    CPubKey pubkey1, pubkey2, pubkey3, pubkey1L, pubkey2L;\n    key1.MakeNewKey(true);\n    key2.MakeNewKey(true);\n    key3.MakeNewKey(true);\n    key1L.MakeNewKey(false);\n    key2L.MakeNewKey(false);\n    pubkey1 = key1.GetPubKey();\n    pubkey2 = key2.GetPubKey();\n    pubkey3 = key3.GetPubKey();\n    pubkey1L = key1L.GetPubKey();\n    pubkey2L = key2L.GetPubKey();\n    keystore.AddKeyPubKey(key1, pubkey1);\n    keystore.AddKeyPubKey(key2, pubkey2);\n    keystore.AddKeyPubKey(key1L, pubkey1L);\n    keystore.AddKeyPubKey(key2L, pubkey2L);\n    CScript scriptPubkey1, scriptPubkey2, scriptPubkey1L, scriptPubkey2L, scriptMulti;\n    scriptPubkey1 << ToByteVector(pubkey1) << OP_CHECKSIG;\n    scriptPubkey2 << ToByteVector(pubkey2) << OP_CHECKSIG;\n    scriptPubkey1L << ToByteVector(pubkey1L) << OP_CHECKSIG;\n    scriptPubkey2L << ToByteVector(pubkey2L) << OP_CHECKSIG;\n    std::vector<CPubKey> oneandthree;\n    oneandthree.push_back(pubkey1);\n    oneandthree.push_back(pubkey3);\n    scriptMulti = GetScriptForMultisig(2, oneandthree);\n    keystore.AddCScript(scriptPubkey1);\n    keystore.AddCScript(scriptPubkey2);\n    keystore.AddCScript(scriptPubkey1L);\n    keystore.AddCScript(scriptPubkey2L);\n    keystore.AddCScript(scriptMulti);\n    keystore.AddCScript(GetScriptForWitness(scriptPubkey1));\n    keystore.AddCScript(GetScriptForWitness(scriptPubkey2));\n    keystore.AddCScript(GetScriptForWitness(scriptPubkey1L));\n    keystore.AddCScript(GetScriptForWitness(scriptPubkey2L));\n    keystore.AddCScript(GetScriptForWitness(scriptMulti));\n    keystore2.AddCScript(scriptMulti);\n    keystore2.AddCScript(GetScriptForWitness(scriptMulti));\n    keystore2.AddKeyPubKey(key3, pubkey3);\n\n    CTransactionRef output1, output2;\n    CMutableTransaction input1, input2;\n    SignatureData sigdata;\n\n    // Normal pay-to-compressed-pubkey.\n    CreateCreditAndSpend(keystore, scriptPubkey1, output1, input1);\n    CreateCreditAndSpend(keystore, scriptPubkey2, output2, input2);\n    CheckWithFlag(output1, input1, 0, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true);\n    CheckWithFlag(output1, input2, 0, false);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, false);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false);\n    CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false);\n\n    // P2SH pay-to-compressed-pubkey.\n    CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(scriptPubkey1)), output1, input1);\n    CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(scriptPubkey2)), output2, input2);\n    ReplaceRedeemScript(input2.vin[0].scriptSig, scriptPubkey1);\n    CheckWithFlag(output1, input1, 0, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true);\n    CheckWithFlag(output1, input2, 0, true);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, false);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false);\n    CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false);\n\n    // Witness pay-to-compressed-pubkey (v0).\n    CreateCreditAndSpend(keystore, GetScriptForWitness(scriptPubkey1), output1, input1);\n    CreateCreditAndSpend(keystore, GetScriptForWitness(scriptPubkey2), output2, input2);\n    CheckWithFlag(output1, input1, 0, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true);\n    CheckWithFlag(output1, input2, 0, true);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false);\n    CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false);\n\n    // P2SH witness pay-to-compressed-pubkey (v0).\n    CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptPubkey1))), output1, input1);\n    CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptPubkey2))), output2, input2);\n    ReplaceRedeemScript(input2.vin[0].scriptSig, GetScriptForWitness(scriptPubkey1));\n    CheckWithFlag(output1, input1, 0, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true);\n    CheckWithFlag(output1, input2, 0, true);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false);\n    CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false);\n\n    // Normal pay-to-uncompressed-pubkey.\n    CreateCreditAndSpend(keystore, scriptPubkey1L, output1, input1);\n    CreateCreditAndSpend(keystore, scriptPubkey2L, output2, input2);\n    CheckWithFlag(output1, input1, 0, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true);\n    CheckWithFlag(output1, input2, 0, false);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, false);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false);\n    CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false);\n\n    // P2SH pay-to-uncompressed-pubkey.\n    CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(scriptPubkey1L)), output1, input1);\n    CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(scriptPubkey2L)), output2, input2);\n    ReplaceRedeemScript(input2.vin[0].scriptSig, scriptPubkey1L);\n    CheckWithFlag(output1, input1, 0, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true);\n    CheckWithFlag(output1, input2, 0, true);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_P2SH, false);\n    CheckWithFlag(output1, input2, SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_P2SH, false);\n    CheckWithFlag(output1, input2, STANDARD_SCRIPT_VERIFY_FLAGS, false);\n\n    // Signing disabled for witness pay-to-uncompressed-pubkey (v1).\n    CreateCreditAndSpend(keystore, GetScriptForWitness(scriptPubkey1L), output1, input1, false);\n    CreateCreditAndSpend(keystore, GetScriptForWitness(scriptPubkey2L), output2, input2, false);\n\n    // Signing disabled for P2SH witness pay-to-uncompressed-pubkey (v1).\n    CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptPubkey1L))), output1, input1, false);\n    CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptPubkey2L))), output2, input2, false);\n\n    // Normal 2-of-2 multisig\n    CreateCreditAndSpend(keystore, scriptMulti, output1, input1, false);\n    CheckWithFlag(output1, input1, 0, false);\n    CreateCreditAndSpend(keystore2, scriptMulti, output2, input2, false);\n    CheckWithFlag(output2, input2, 0, false);\n    BOOST_CHECK(*output1 == *output2);\n    UpdateTransaction(input1, 0, CombineSignatures(output1->vout[0].scriptPubKey, MutableTransactionSignatureChecker(&input1, 0, output1->vout[0].nValue), DataFromTransaction(input1, 0), DataFromTransaction(input2, 0)));\n    CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true);\n\n    // P2SH 2-of-2 multisig\n    CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(scriptMulti)), output1, input1, false);\n    CheckWithFlag(output1, input1, 0, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, false);\n    CreateCreditAndSpend(keystore2, GetScriptForDestination(CScriptID(scriptMulti)), output2, input2, false);\n    CheckWithFlag(output2, input2, 0, true);\n    CheckWithFlag(output2, input2, SCRIPT_VERIFY_P2SH, false);\n    BOOST_CHECK(*output1 == *output2);\n    UpdateTransaction(input1, 0, CombineSignatures(output1->vout[0].scriptPubKey, MutableTransactionSignatureChecker(&input1, 0, output1->vout[0].nValue), DataFromTransaction(input1, 0), DataFromTransaction(input2, 0)));\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true);\n\n    // Witness 2-of-2 multisig\n    CreateCreditAndSpend(keystore, GetScriptForWitness(scriptMulti), output1, input1, false);\n    CheckWithFlag(output1, input1, 0, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false);\n    CreateCreditAndSpend(keystore2, GetScriptForWitness(scriptMulti), output2, input2, false);\n    CheckWithFlag(output2, input2, 0, true);\n    CheckWithFlag(output2, input2, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false);\n    BOOST_CHECK(*output1 == *output2);\n    UpdateTransaction(input1, 0, CombineSignatures(output1->vout[0].scriptPubKey, MutableTransactionSignatureChecker(&input1, 0, output1->vout[0].nValue), DataFromTransaction(input1, 0), DataFromTransaction(input2, 0)));\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, true);\n    CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true);\n\n    // P2SH witness 2-of-2 multisig\n    CreateCreditAndSpend(keystore, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptMulti))), output1, input1, false);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false);\n    CreateCreditAndSpend(keystore2, GetScriptForDestination(CScriptID(GetScriptForWitness(scriptMulti))), output2, input2, false);\n    CheckWithFlag(output2, input2, SCRIPT_VERIFY_P2SH, true);\n    CheckWithFlag(output2, input2, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, false);\n    BOOST_CHECK(*output1 == *output2);\n    UpdateTransaction(input1, 0, CombineSignatures(output1->vout[0].scriptPubKey, MutableTransactionSignatureChecker(&input1, 0, output1->vout[0].nValue), DataFromTransaction(input1, 0), DataFromTransaction(input2, 0)));\n    CheckWithFlag(output1, input1, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, true);\n    CheckWithFlag(output1, input1, STANDARD_SCRIPT_VERIFY_FLAGS, true);\n}\n\nBOOST_AUTO_TEST_CASE(test_IsStandard)\n{\n    LOCK(cs_main);\n    CBasicKeyStore keystore;\n    CCoinsView coinsDummy;\n    CCoinsViewCache coins(&coinsDummy);\n    std::vector<CMutableTransaction> dummyTransactions = SetupDummyInputs(keystore, coins);\n\n    CMutableTransaction t;\n    t.vin.resize(1);\n    t.vin[0].prevout.hash = dummyTransactions[0].GetHash();\n    t.vin[0].prevout.n = 1;\n    t.vin[0].scriptSig << std::vector<unsigned char>(65, 0);\n    t.vout.resize(1);\n    t.vout[0].nValue = 90*CENT;\n    CKey key;\n    key.MakeNewKey(true);\n    t.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID());\n\n    std::string reason;\n    BOOST_CHECK(IsStandardTx(t, reason));\n\n    // Check dust with default relay fee:\n    CAmount nDustThreshold = 182 * dustRelayFee.GetFeePerK()/1000;\n    BOOST_CHECK_EQUAL(nDustThreshold, 546);\n    // dust:\n    t.vout[0].nValue = nDustThreshold - 1;\n    BOOST_CHECK(!IsStandardTx(t, reason));\n    // not dust:\n    t.vout[0].nValue = nDustThreshold;\n    BOOST_CHECK(IsStandardTx(t, reason));\n\n    // Check dust with odd relay fee to verify rounding:\n    // nDustThreshold = 182 * 3702 / 1000\n    dustRelayFee = CFeeRate(3702);\n    // dust:\n    t.vout[0].nValue = 673 - 1;\n    BOOST_CHECK(!IsStandardTx(t, reason));\n    // not dust:\n    t.vout[0].nValue = 673;\n    BOOST_CHECK(IsStandardTx(t, reason));\n    dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE);\n\n    t.vout[0].scriptPubKey = CScript() << OP_1;\n    BOOST_CHECK(!IsStandardTx(t, reason));\n\n    // MAX_OP_RETURN_RELAY-byte TX_NULL_DATA (standard)\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex(\"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38\");\n    BOOST_CHECK_EQUAL(MAX_OP_RETURN_RELAY, t.vout[0].scriptPubKey.size());\n    BOOST_CHECK(IsStandardTx(t, reason));\n\n    // MAX_OP_RETURN_RELAY+1-byte TX_NULL_DATA (non-standard)\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex(\"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3800\");\n    BOOST_CHECK_EQUAL(MAX_OP_RETURN_RELAY + 1, t.vout[0].scriptPubKey.size());\n    BOOST_CHECK(!IsStandardTx(t, reason));\n\n    // Data payload can be encoded in any way...\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex(\"\");\n    BOOST_CHECK(IsStandardTx(t, reason));\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex(\"00\") << ParseHex(\"01\");\n    BOOST_CHECK(IsStandardTx(t, reason));\n    // OP_RESERVED *is* considered to be a PUSHDATA type opcode by IsPushOnly()!\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN << OP_RESERVED << -1 << 0 << ParseHex(\"01\") << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12 << 13 << 14 << 15 << 16;\n    BOOST_CHECK(IsStandardTx(t, reason));\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN << 0 << ParseHex(\"01\") << 2 << ParseHex(\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\");\n    BOOST_CHECK(IsStandardTx(t, reason));\n\n    // ...so long as it only contains PUSHDATA's\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN << OP_RETURN;\n    BOOST_CHECK(!IsStandardTx(t, reason));\n\n    // TX_NULL_DATA w/o PUSHDATA\n    t.vout.resize(1);\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN;\n    BOOST_CHECK(IsStandardTx(t, reason));\n\n    // Only one TX_NULL_DATA permitted in all cases\n    t.vout.resize(2);\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex(\"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38\");\n    t.vout[1].scriptPubKey = CScript() << OP_RETURN << ParseHex(\"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38\");\n    BOOST_CHECK(!IsStandardTx(t, reason));\n\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex(\"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38\");\n    t.vout[1].scriptPubKey = CScript() << OP_RETURN;\n    BOOST_CHECK(!IsStandardTx(t, reason));\n\n    t.vout[0].scriptPubKey = CScript() << OP_RETURN;\n    t.vout[1].scriptPubKey = CScript() << OP_RETURN;\n    BOOST_CHECK(!IsStandardTx(t, reason));\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/txvalidation_tests.cpp",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <validation.h>\n#include <txmempool.h>\n#include <amount.h>\n#include <consensus/validation.h>\n#include <primitives/transaction.h>\n#include <script/script.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n\n\nBOOST_AUTO_TEST_SUITE(txvalidation_tests)\n\n/**\n * Ensure that the mempool won't accept coinbase transactions.\n */\nBOOST_FIXTURE_TEST_CASE(tx_mempool_reject_coinbase, TestChain100Setup)\n{\n    CScript scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;\n    CMutableTransaction coinbaseTx;\n\n    coinbaseTx.nVersion = 1;\n    coinbaseTx.vin.resize(1);\n    coinbaseTx.vout.resize(1);\n    coinbaseTx.vin[0].scriptSig = CScript() << OP_11 << OP_EQUAL;\n    coinbaseTx.vout[0].nValue = 1 * CENT;\n    coinbaseTx.vout[0].scriptPubKey = scriptPubKey;\n\n    assert(CTransaction(coinbaseTx).IsCoinBase());\n\n    CValidationState state;\n\n    LOCK(cs_main);\n\n    unsigned int initialPoolSize = mempool.size();\n\n    BOOST_CHECK_EQUAL(\n            false,\n            AcceptToMemoryPool(mempool, state, MakeTransactionRef(coinbaseTx),\n                nullptr /* pfMissingInputs */,\n                nullptr /* plTxnReplaced */,\n                true /* bypass_limits */,\n                0 /* nAbsurdFee */));\n\n    // Check that the transaction hasn't been added to mempool.\n    BOOST_CHECK_EQUAL(mempool.size(), initialPoolSize);\n\n    // Check that the validation state reflects the unsuccessful attempt.\n    BOOST_CHECK(state.IsInvalid());\n    BOOST_CHECK_EQUAL(state.GetRejectReason(), \"coinbase\");\n\n    int nDoS;\n    BOOST_CHECK_EQUAL(state.IsInvalid(nDoS), true);\n    BOOST_CHECK_EQUAL(nDoS, 100);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/txvalidationcache_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <consensus/validation.h>\n#include <key.h>\n#include <validation.h>\n#include <miner.h>\n#include <pubkey.h>\n#include <txmempool.h>\n#include <random.h>\n#include <script/standard.h>\n#include <script/sign.h>\n#include <test/test_bitcoin.h>\n#include <utiltime.h>\n#include <core_io.h>\n#include <keystore.h>\n#include <policy/policy.h>\n\n#include <boost/test/unit_test.hpp>\n\nbool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck> *pvChecks);\n\nBOOST_AUTO_TEST_SUITE(tx_validationcache_tests)\n\nstatic bool\nToMemPool(CMutableTransaction& tx)\n{\n    LOCK(cs_main);\n\n    CValidationState state;\n    return AcceptToMemoryPool(mempool, state, MakeTransactionRef(tx), nullptr /* pfMissingInputs */,\n                              nullptr /* plTxnReplaced */, true /* bypass_limits */, 0 /* nAbsurdFee */);\n}\n\nBOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, TestChain100Setup)\n{\n    // Make sure skipping validation of transctions that were\n    // validated going into the memory pool does not allow\n    // double-spends in blocks to pass validation when they should not.\n\n    CScript scriptPubKey = CScript() <<  ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;\n\n    // Create a double-spend of mature coinbase txn:\n    std::vector<CMutableTransaction> spends;\n    spends.resize(2);\n    for (int i = 0; i < 2; i++)\n    {\n        spends[i].nVersion = 1;\n        spends[i].vin.resize(1);\n        spends[i].vin[0].prevout.hash = coinbaseTxns[0].GetHash();\n        spends[i].vin[0].prevout.n = 0;\n        spends[i].vout.resize(1);\n        spends[i].vout[0].nValue = 11*CENT;\n        spends[i].vout[0].scriptPubKey = scriptPubKey;\n\n        // Sign:\n        std::vector<unsigned char> vchSig;\n        uint256 hash = SignatureHash(scriptPubKey, spends[i], 0, SIGHASH_ALL, 0, SIGVERSION_BASE);\n        BOOST_CHECK(coinbaseKey.Sign(hash, vchSig));\n        vchSig.push_back((unsigned char)SIGHASH_ALL);\n        spends[i].vin[0].scriptSig << vchSig;\n    }\n\n    CBlock block;\n\n    // Test 1: block with both of those transactions should be rejected.\n    block = CreateAndProcessBlock(spends, scriptPubKey);\n    BOOST_CHECK(chainActive.Tip()->GetBlockHash() != block.GetHash());\n\n    // Test 2: ... and should be rejected if spend1 is in the memory pool\n    BOOST_CHECK(ToMemPool(spends[0]));\n    block = CreateAndProcessBlock(spends, scriptPubKey);\n    BOOST_CHECK(chainActive.Tip()->GetBlockHash() != block.GetHash());\n    mempool.clear();\n\n    // Test 3: ... and should be rejected if spend2 is in the memory pool\n    BOOST_CHECK(ToMemPool(spends[1]));\n    block = CreateAndProcessBlock(spends, scriptPubKey);\n    BOOST_CHECK(chainActive.Tip()->GetBlockHash() != block.GetHash());\n    mempool.clear();\n\n    // Final sanity test: first spend in mempool, second in block, that's OK:\n    std::vector<CMutableTransaction> oneSpend;\n    oneSpend.push_back(spends[0]);\n    BOOST_CHECK(ToMemPool(spends[1]));\n    block = CreateAndProcessBlock(oneSpend, scriptPubKey);\n    BOOST_CHECK(chainActive.Tip()->GetBlockHash() == block.GetHash());\n    // spends[1] should have been removed from the mempool when the\n    // block with spends[0] is accepted:\n    BOOST_CHECK_EQUAL(mempool.size(), 0);\n}\n\n// Run CheckInputs (using pcoinsTip) on the given transaction, for all script\n// flags.  Test that CheckInputs passes for all flags that don't overlap with\n// the failing_flags argument, but otherwise fails.\n// CHECKLOCKTIMEVERIFY and CHECKSEQUENCEVERIFY (and future NOP codes that may\n// get reassigned) have an interaction with DISCOURAGE_UPGRADABLE_NOPS: if\n// the script flags used contain DISCOURAGE_UPGRADABLE_NOPS but don't contain\n// CHECKLOCKTIMEVERIFY (or CHECKSEQUENCEVERIFY), but the script does contain\n// OP_CHECKLOCKTIMEVERIFY (or OP_CHECKSEQUENCEVERIFY), then script execution\n// should fail.\n// Capture this interaction with the upgraded_nop argument: set it when evaluating\n// any script flag that is implemented as an upgraded NOP code.\nvoid ValidateCheckInputsForAllFlags(CMutableTransaction &tx, uint32_t failing_flags, bool add_to_cache)\n{\n    PrecomputedTransactionData txdata(tx);\n    // If we add many more flags, this loop can get too expensive, but we can\n    // rewrite in the future to randomly pick a set of flags to evaluate.\n    for (uint32_t test_flags=0; test_flags < (1U << 16); test_flags += 1) {\n        CValidationState state;\n        // Filter out incompatible flag choices\n        if ((test_flags & SCRIPT_VERIFY_CLEANSTACK)) {\n            // CLEANSTACK requires P2SH and WITNESS, see VerifyScript() in\n            // script/interpreter.cpp\n            test_flags |= SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS;\n        }\n        if ((test_flags & SCRIPT_VERIFY_WITNESS)) {\n            // WITNESS requires P2SH\n            test_flags |= SCRIPT_VERIFY_P2SH;\n        }\n        bool ret = CheckInputs(tx, state, pcoinsTip.get(), true, test_flags, true, add_to_cache, txdata, nullptr);\n        // CheckInputs should succeed iff test_flags doesn't intersect with\n        // failing_flags\n        bool expected_return_value = !(test_flags & failing_flags);\n        BOOST_CHECK_EQUAL(ret, expected_return_value);\n\n        // Test the caching\n        if (ret && add_to_cache) {\n            // Check that we get a cache hit if the tx was valid\n            std::vector<CScriptCheck> scriptchecks;\n            BOOST_CHECK(CheckInputs(tx, state, pcoinsTip.get(), true, test_flags, true, add_to_cache, txdata, &scriptchecks));\n            BOOST_CHECK(scriptchecks.empty());\n        } else {\n            // Check that we get script executions to check, if the transaction\n            // was invalid, or we didn't add to cache.\n            std::vector<CScriptCheck> scriptchecks;\n            BOOST_CHECK(CheckInputs(tx, state, pcoinsTip.get(), true, test_flags, true, add_to_cache, txdata, &scriptchecks));\n            BOOST_CHECK_EQUAL(scriptchecks.size(), tx.vin.size());\n        }\n    }\n}\n\nBOOST_FIXTURE_TEST_CASE(checkinputs_test, TestChain100Setup)\n{\n    // Test that passing CheckInputs with one set of script flags doesn't imply\n    // that we would pass again with a different set of flags.\n    {\n        LOCK(cs_main);\n        InitScriptExecutionCache();\n    }\n\n    CScript p2pk_scriptPubKey = CScript() << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;\n    CScript p2sh_scriptPubKey = GetScriptForDestination(CScriptID(p2pk_scriptPubKey));\n    CScript p2pkh_scriptPubKey = GetScriptForDestination(coinbaseKey.GetPubKey().GetID());\n    CScript p2wpkh_scriptPubKey = GetScriptForWitness(p2pkh_scriptPubKey);\n\n    CBasicKeyStore keystore;\n    keystore.AddKey(coinbaseKey);\n    keystore.AddCScript(p2pk_scriptPubKey);\n\n    // flags to test: SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY, SCRIPT_VERIFY_CHECKSEQUENCE_VERIFY, SCRIPT_VERIFY_NULLDUMMY, uncompressed pubkey thing\n\n    // Create 2 outputs that match the three scripts above, spending the first\n    // coinbase tx.\n    CMutableTransaction spend_tx;\n\n    spend_tx.nVersion = 1;\n    spend_tx.vin.resize(1);\n    spend_tx.vin[0].prevout.hash = coinbaseTxns[0].GetHash();\n    spend_tx.vin[0].prevout.n = 0;\n    spend_tx.vout.resize(4);\n    spend_tx.vout[0].nValue = 11*CENT;\n    spend_tx.vout[0].scriptPubKey = p2sh_scriptPubKey;\n    spend_tx.vout[1].nValue = 11*CENT;\n    spend_tx.vout[1].scriptPubKey = p2wpkh_scriptPubKey;\n    spend_tx.vout[2].nValue = 11*CENT;\n    spend_tx.vout[2].scriptPubKey = CScript() << OP_CHECKLOCKTIMEVERIFY << OP_DROP << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;\n    spend_tx.vout[3].nValue = 11*CENT;\n    spend_tx.vout[3].scriptPubKey = CScript() << OP_CHECKSEQUENCEVERIFY << OP_DROP << ToByteVector(coinbaseKey.GetPubKey()) << OP_CHECKSIG;\n\n    // Sign, with a non-DER signature\n    {\n        std::vector<unsigned char> vchSig;\n        uint256 hash = SignatureHash(p2pk_scriptPubKey, spend_tx, 0, SIGHASH_ALL, 0, SIGVERSION_BASE);\n        BOOST_CHECK(coinbaseKey.Sign(hash, vchSig));\n        vchSig.push_back((unsigned char) 0); // padding byte makes this non-DER\n        vchSig.push_back((unsigned char)SIGHASH_ALL);\n        spend_tx.vin[0].scriptSig << vchSig;\n    }\n\n    // Test that invalidity under a set of flags doesn't preclude validity\n    // under other (eg consensus) flags.\n    // spend_tx is invalid according to DERSIG\n    {\n        LOCK(cs_main);\n\n        CValidationState state;\n        PrecomputedTransactionData ptd_spend_tx(spend_tx);\n\n        BOOST_CHECK(!CheckInputs(spend_tx, state, pcoinsTip.get(), true, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_DERSIG, true, true, ptd_spend_tx, nullptr));\n\n        // If we call again asking for scriptchecks (as happens in\n        // ConnectBlock), we should add a script check object for this -- we're\n        // not caching invalidity (if that changes, delete this test case).\n        std::vector<CScriptCheck> scriptchecks;\n        BOOST_CHECK(CheckInputs(spend_tx, state, pcoinsTip.get(), true, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_DERSIG, true, true, ptd_spend_tx, &scriptchecks));\n        BOOST_CHECK_EQUAL(scriptchecks.size(), 1);\n\n        // Test that CheckInputs returns true iff DERSIG-enforcing flags are\n        // not present.  Don't add these checks to the cache, so that we can\n        // test later that block validation works fine in the absence of cached\n        // successes.\n        ValidateCheckInputsForAllFlags(spend_tx, SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC, false);\n    }\n\n    // And if we produce a block with this tx, it should be valid (DERSIG not\n    // enabled yet), even though there's no cache entry.\n    CBlock block;\n\n    block = CreateAndProcessBlock({spend_tx}, p2pk_scriptPubKey);\n    BOOST_CHECK(chainActive.Tip()->GetBlockHash() == block.GetHash());\n    BOOST_CHECK(pcoinsTip->GetBestBlock() == block.GetHash());\n\n    LOCK(cs_main);\n\n    // Test P2SH: construct a transaction that is valid without P2SH, and\n    // then test validity with P2SH.\n    {\n        CMutableTransaction invalid_under_p2sh_tx;\n        invalid_under_p2sh_tx.nVersion = 1;\n        invalid_under_p2sh_tx.vin.resize(1);\n        invalid_under_p2sh_tx.vin[0].prevout.hash = spend_tx.GetHash();\n        invalid_under_p2sh_tx.vin[0].prevout.n = 0;\n        invalid_under_p2sh_tx.vout.resize(1);\n        invalid_under_p2sh_tx.vout[0].nValue = 11*CENT;\n        invalid_under_p2sh_tx.vout[0].scriptPubKey = p2pk_scriptPubKey;\n        std::vector<unsigned char> vchSig2(p2pk_scriptPubKey.begin(), p2pk_scriptPubKey.end());\n        invalid_under_p2sh_tx.vin[0].scriptSig << vchSig2;\n\n        ValidateCheckInputsForAllFlags(invalid_under_p2sh_tx, SCRIPT_VERIFY_P2SH, true);\n    }\n\n    // Test CHECKLOCKTIMEVERIFY\n    {\n        CMutableTransaction invalid_with_cltv_tx;\n        invalid_with_cltv_tx.nVersion = 1;\n        invalid_with_cltv_tx.nLockTime = 100;\n        invalid_with_cltv_tx.vin.resize(1);\n        invalid_with_cltv_tx.vin[0].prevout.hash = spend_tx.GetHash();\n        invalid_with_cltv_tx.vin[0].prevout.n = 2;\n        invalid_with_cltv_tx.vin[0].nSequence = 0;\n        invalid_with_cltv_tx.vout.resize(1);\n        invalid_with_cltv_tx.vout[0].nValue = 11*CENT;\n        invalid_with_cltv_tx.vout[0].scriptPubKey = p2pk_scriptPubKey;\n\n        // Sign\n        std::vector<unsigned char> vchSig;\n        uint256 hash = SignatureHash(spend_tx.vout[2].scriptPubKey, invalid_with_cltv_tx, 0, SIGHASH_ALL, 0, SIGVERSION_BASE);\n        BOOST_CHECK(coinbaseKey.Sign(hash, vchSig));\n        vchSig.push_back((unsigned char)SIGHASH_ALL);\n        invalid_with_cltv_tx.vin[0].scriptSig = CScript() << vchSig << 101;\n\n        ValidateCheckInputsForAllFlags(invalid_with_cltv_tx, SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY, true);\n\n        // Make it valid, and check again\n        invalid_with_cltv_tx.vin[0].scriptSig = CScript() << vchSig << 100;\n        CValidationState state;\n        PrecomputedTransactionData txdata(invalid_with_cltv_tx);\n        BOOST_CHECK(CheckInputs(invalid_with_cltv_tx, state, pcoinsTip.get(), true, SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY, true, true, txdata, nullptr));\n    }\n\n    // TEST CHECKSEQUENCEVERIFY\n    {\n        CMutableTransaction invalid_with_csv_tx;\n        invalid_with_csv_tx.nVersion = 2;\n        invalid_with_csv_tx.vin.resize(1);\n        invalid_with_csv_tx.vin[0].prevout.hash = spend_tx.GetHash();\n        invalid_with_csv_tx.vin[0].prevout.n = 3;\n        invalid_with_csv_tx.vin[0].nSequence = 100;\n        invalid_with_csv_tx.vout.resize(1);\n        invalid_with_csv_tx.vout[0].nValue = 11*CENT;\n        invalid_with_csv_tx.vout[0].scriptPubKey = p2pk_scriptPubKey;\n\n        // Sign\n        std::vector<unsigned char> vchSig;\n        uint256 hash = SignatureHash(spend_tx.vout[3].scriptPubKey, invalid_with_csv_tx, 0, SIGHASH_ALL, 0, SIGVERSION_BASE);\n        BOOST_CHECK(coinbaseKey.Sign(hash, vchSig));\n        vchSig.push_back((unsigned char)SIGHASH_ALL);\n        invalid_with_csv_tx.vin[0].scriptSig = CScript() << vchSig << 101;\n\n        ValidateCheckInputsForAllFlags(invalid_with_csv_tx, SCRIPT_VERIFY_CHECKSEQUENCEVERIFY, true);\n\n        // Make it valid, and check again\n        invalid_with_csv_tx.vin[0].scriptSig = CScript() << vchSig << 100;\n        CValidationState state;\n        PrecomputedTransactionData txdata(invalid_with_csv_tx);\n        BOOST_CHECK(CheckInputs(invalid_with_csv_tx, state, pcoinsTip.get(), true, SCRIPT_VERIFY_CHECKSEQUENCEVERIFY, true, true, txdata, nullptr));\n    }\n\n    // TODO: add tests for remaining script flags\n\n    // Test that passing CheckInputs with a valid witness doesn't imply success\n    // for the same tx with a different witness.\n    {\n        CMutableTransaction valid_with_witness_tx;\n        valid_with_witness_tx.nVersion = 1;\n        valid_with_witness_tx.vin.resize(1);\n        valid_with_witness_tx.vin[0].prevout.hash = spend_tx.GetHash();\n        valid_with_witness_tx.vin[0].prevout.n = 1;\n        valid_with_witness_tx.vout.resize(1);\n        valid_with_witness_tx.vout[0].nValue = 11*CENT;\n        valid_with_witness_tx.vout[0].scriptPubKey = p2pk_scriptPubKey;\n\n        // Sign\n        SignatureData sigdata;\n        ProduceSignature(MutableTransactionSignatureCreator(&keystore, &valid_with_witness_tx, 0, 11*CENT, SIGHASH_ALL), spend_tx.vout[1].scriptPubKey, sigdata);\n        UpdateTransaction(valid_with_witness_tx, 0, sigdata);\n\n        // This should be valid under all script flags.\n        ValidateCheckInputsForAllFlags(valid_with_witness_tx, 0, true);\n\n        // Remove the witness, and check that it is now invalid.\n        valid_with_witness_tx.vin[0].scriptWitness.SetNull();\n        ValidateCheckInputsForAllFlags(valid_with_witness_tx, SCRIPT_VERIFY_WITNESS, true);\n    }\n\n    {\n        // Test a transaction with multiple inputs.\n        CMutableTransaction tx;\n\n        tx.nVersion = 1;\n        tx.vin.resize(2);\n        tx.vin[0].prevout.hash = spend_tx.GetHash();\n        tx.vin[0].prevout.n = 0;\n        tx.vin[1].prevout.hash = spend_tx.GetHash();\n        tx.vin[1].prevout.n = 1;\n        tx.vout.resize(1);\n        tx.vout[0].nValue = 22*CENT;\n        tx.vout[0].scriptPubKey = p2pk_scriptPubKey;\n\n        // Sign\n        for (int i=0; i<2; ++i) {\n            SignatureData sigdata;\n            ProduceSignature(MutableTransactionSignatureCreator(&keystore, &tx, i, 11*CENT, SIGHASH_ALL), spend_tx.vout[i].scriptPubKey, sigdata);\n            UpdateTransaction(tx, i, sigdata);\n        }\n\n        // This should be valid under all script flags\n        ValidateCheckInputsForAllFlags(tx, 0, true);\n\n        // Check that if the second input is invalid, but the first input is\n        // valid, the transaction is not cached.\n        // Invalidate vin[1]\n        tx.vin[1].scriptWitness.SetNull();\n\n        CValidationState state;\n        PrecomputedTransactionData txdata(tx);\n        // This transaction is now invalid under segwit, because of the second input.\n        BOOST_CHECK(!CheckInputs(tx, state, pcoinsTip.get(), true, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, true, true, txdata, nullptr));\n\n        std::vector<CScriptCheck> scriptchecks;\n        // Make sure this transaction was not cached (ie because the first\n        // input was valid)\n        BOOST_CHECK(CheckInputs(tx, state, pcoinsTip.get(), true, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS, true, true, txdata, &scriptchecks));\n        // Should get 2 script checks back -- caching is on a whole-transaction basis.\n        BOOST_CHECK_EQUAL(scriptchecks.size(), 2);\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/uint256_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#include <arith_uint256.h>\n#include <uint256.h>\n#include <version.h>\n#include <test/test_bitcoin.h>\n\n#include <boost/test/unit_test.hpp>\n#include <stdint.h>\n#include <sstream>\n#include <iomanip>\n#include <limits>\n#include <cmath>\n#include <string>\n#include <stdio.h>\n\nBOOST_FIXTURE_TEST_SUITE(uint256_tests, BasicTestingSetup)\n\nconst unsigned char R1Array[] =\n    \"\\x9c\\x52\\x4a\\xdb\\xcf\\x56\\x11\\x12\\x2b\\x29\\x12\\x5e\\x5d\\x35\\xd2\\xd2\"\n    \"\\x22\\x81\\xaa\\xb5\\x33\\xf0\\x08\\x32\\xd5\\x56\\xb1\\xf9\\xea\\xe5\\x1d\\x7d\";\nconst char R1ArrayHex[] = \"7D1DE5EAF9B156D53208F033B5AA8122D2d2355d5e12292b121156cfdb4a529c\";\nconst uint256 R1L = uint256(std::vector<unsigned char>(R1Array,R1Array+32));\nconst uint160 R1S = uint160(std::vector<unsigned char>(R1Array,R1Array+20));\n\nconst unsigned char R2Array[] =\n    \"\\x70\\x32\\x1d\\x7c\\x47\\xa5\\x6b\\x40\\x26\\x7e\\x0a\\xc3\\xa6\\x9c\\xb6\\xbf\"\n    \"\\x13\\x30\\x47\\xa3\\x19\\x2d\\xda\\x71\\x49\\x13\\x72\\xf0\\xb4\\xca\\x81\\xd7\";\nconst uint256 R2L = uint256(std::vector<unsigned char>(R2Array,R2Array+32));\nconst uint160 R2S = uint160(std::vector<unsigned char>(R2Array,R2Array+20));\n\nconst unsigned char ZeroArray[] =\n    \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n    \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";\nconst uint256 ZeroL = uint256(std::vector<unsigned char>(ZeroArray,ZeroArray+32));\nconst uint160 ZeroS = uint160(std::vector<unsigned char>(ZeroArray,ZeroArray+20));\n\nconst unsigned char OneArray[] =\n    \"\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n    \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";\nconst uint256 OneL = uint256(std::vector<unsigned char>(OneArray,OneArray+32));\nconst uint160 OneS = uint160(std::vector<unsigned char>(OneArray,OneArray+20));\n\nconst unsigned char MaxArray[] =\n    \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\"\n    \"\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\";\nconst uint256 MaxL = uint256(std::vector<unsigned char>(MaxArray,MaxArray+32));\nconst uint160 MaxS = uint160(std::vector<unsigned char>(MaxArray,MaxArray+20));\n\nstd::string ArrayToString(const unsigned char A[], unsigned int width)\n{\n    std::stringstream Stream;\n    Stream << std::hex;\n    for (unsigned int i = 0; i < width; ++i)\n    {\n        Stream<<std::setw(2)<<std::setfill('0')<<(unsigned int)A[width-i-1];\n    }\n    return Stream.str();\n}\n\ninline uint160 uint160S(const char *str)\n{\n    uint160 rv;\n    rv.SetHex(str);\n    return rv;\n}\ninline uint160 uint160S(const std::string& str)\n{\n    uint160 rv;\n    rv.SetHex(str);\n    return rv;\n}\n\nBOOST_AUTO_TEST_CASE( basics ) // constructors, equality, inequality\n{\n    BOOST_CHECK(1 == 0+1);\n    // constructor uint256(vector<char>):\n    BOOST_CHECK(R1L.ToString() == ArrayToString(R1Array,32));\n    BOOST_CHECK(R1S.ToString() == ArrayToString(R1Array,20));\n    BOOST_CHECK(R2L.ToString() == ArrayToString(R2Array,32));\n    BOOST_CHECK(R2S.ToString() == ArrayToString(R2Array,20));\n    BOOST_CHECK(ZeroL.ToString() == ArrayToString(ZeroArray,32));\n    BOOST_CHECK(ZeroS.ToString() == ArrayToString(ZeroArray,20));\n    BOOST_CHECK(OneL.ToString() == ArrayToString(OneArray,32));\n    BOOST_CHECK(OneS.ToString() == ArrayToString(OneArray,20));\n    BOOST_CHECK(MaxL.ToString() == ArrayToString(MaxArray,32));\n    BOOST_CHECK(MaxS.ToString() == ArrayToString(MaxArray,20));\n    BOOST_CHECK(OneL.ToString() != ArrayToString(ZeroArray,32));\n    BOOST_CHECK(OneS.ToString() != ArrayToString(ZeroArray,20));\n\n    // == and !=\n    BOOST_CHECK(R1L != R2L && R1S != R2S);\n    BOOST_CHECK(ZeroL != OneL && ZeroS != OneS);\n    BOOST_CHECK(OneL != ZeroL && OneS != ZeroS);\n    BOOST_CHECK(MaxL != ZeroL && MaxS != ZeroS);\n\n    // String Constructor and Copy Constructor\n    BOOST_CHECK(uint256S(\"0x\"+R1L.ToString()) == R1L);\n    BOOST_CHECK(uint256S(\"0x\"+R2L.ToString()) == R2L);\n    BOOST_CHECK(uint256S(\"0x\"+ZeroL.ToString()) == ZeroL);\n    BOOST_CHECK(uint256S(\"0x\"+OneL.ToString()) == OneL);\n    BOOST_CHECK(uint256S(\"0x\"+MaxL.ToString()) == MaxL);\n    BOOST_CHECK(uint256S(R1L.ToString()) == R1L);\n    BOOST_CHECK(uint256S(\"   0x\"+R1L.ToString()+\"   \") == R1L);\n    BOOST_CHECK(uint256S(\"\") == ZeroL);\n    BOOST_CHECK(R1L == uint256S(R1ArrayHex));\n    BOOST_CHECK(uint256(R1L) == R1L);\n    BOOST_CHECK(uint256(ZeroL) == ZeroL);\n    BOOST_CHECK(uint256(OneL) == OneL);\n\n    BOOST_CHECK(uint160S(\"0x\"+R1S.ToString()) == R1S);\n    BOOST_CHECK(uint160S(\"0x\"+R2S.ToString()) == R2S);\n    BOOST_CHECK(uint160S(\"0x\"+ZeroS.ToString()) == ZeroS);\n    BOOST_CHECK(uint160S(\"0x\"+OneS.ToString()) == OneS);\n    BOOST_CHECK(uint160S(\"0x\"+MaxS.ToString()) == MaxS);\n    BOOST_CHECK(uint160S(R1S.ToString()) == R1S);\n    BOOST_CHECK(uint160S(\"   0x\"+R1S.ToString()+\"   \") == R1S);\n    BOOST_CHECK(uint160S(\"\") == ZeroS);\n    BOOST_CHECK(R1S == uint160S(R1ArrayHex));\n\n    BOOST_CHECK(uint160(R1S) == R1S);\n    BOOST_CHECK(uint160(ZeroS) == ZeroS);\n    BOOST_CHECK(uint160(OneS) == OneS);\n}\n\nBOOST_AUTO_TEST_CASE( comparison ) // <= >= < >\n{\n    uint256 LastL;\n    for (int i = 255; i >= 0; --i) {\n        uint256 TmpL;\n        *(TmpL.begin() + (i>>3)) |= 1<<(7-(i&7));\n        BOOST_CHECK( LastL < TmpL );\n        LastL = TmpL;\n    }\n\n    BOOST_CHECK( ZeroL < R1L );\n    BOOST_CHECK( R2L < R1L );\n    BOOST_CHECK( ZeroL < OneL );\n    BOOST_CHECK( OneL < MaxL );\n    BOOST_CHECK( R1L < MaxL );\n    BOOST_CHECK( R2L < MaxL );\n\n    uint160 LastS;\n    for (int i = 159; i >= 0; --i) {\n        uint160 TmpS;\n        *(TmpS.begin() + (i>>3)) |= 1<<(7-(i&7));\n        BOOST_CHECK( LastS < TmpS );\n        LastS = TmpS;\n    }\n    BOOST_CHECK( ZeroS < R1S );\n    BOOST_CHECK( R2S < R1S );\n    BOOST_CHECK( ZeroS < OneS );\n    BOOST_CHECK( OneS < MaxS );\n    BOOST_CHECK( R1S < MaxS );\n    BOOST_CHECK( R2S < MaxS );\n}\n\nBOOST_AUTO_TEST_CASE( methods ) // GetHex SetHex begin() end() size() GetLow64 GetSerializeSize, Serialize, Unserialize\n{\n    BOOST_CHECK(R1L.GetHex() == R1L.ToString());\n    BOOST_CHECK(R2L.GetHex() == R2L.ToString());\n    BOOST_CHECK(OneL.GetHex() == OneL.ToString());\n    BOOST_CHECK(MaxL.GetHex() == MaxL.ToString());\n    uint256 TmpL(R1L);\n    BOOST_CHECK(TmpL == R1L);\n    TmpL.SetHex(R2L.ToString());   BOOST_CHECK(TmpL == R2L);\n    TmpL.SetHex(ZeroL.ToString()); BOOST_CHECK(TmpL == uint256());\n\n    TmpL.SetHex(R1L.ToString());\n    BOOST_CHECK(memcmp(R1L.begin(), R1Array, 32)==0);\n    BOOST_CHECK(memcmp(TmpL.begin(), R1Array, 32)==0);\n    BOOST_CHECK(memcmp(R2L.begin(), R2Array, 32)==0);\n    BOOST_CHECK(memcmp(ZeroL.begin(), ZeroArray, 32)==0);\n    BOOST_CHECK(memcmp(OneL.begin(), OneArray, 32)==0);\n    BOOST_CHECK(R1L.size() == sizeof(R1L));\n    BOOST_CHECK(sizeof(R1L) == 32);\n    BOOST_CHECK(R1L.size() == 32);\n    BOOST_CHECK(R2L.size() == 32);\n    BOOST_CHECK(ZeroL.size() == 32);\n    BOOST_CHECK(MaxL.size() == 32);\n    BOOST_CHECK(R1L.begin() + 32 == R1L.end());\n    BOOST_CHECK(R2L.begin() + 32 == R2L.end());\n    BOOST_CHECK(OneL.begin() + 32 == OneL.end());\n    BOOST_CHECK(MaxL.begin() + 32 == MaxL.end());\n    BOOST_CHECK(TmpL.begin() + 32 == TmpL.end());\n    BOOST_CHECK(GetSerializeSize(R1L, 0, PROTOCOL_VERSION) == 32);\n    BOOST_CHECK(GetSerializeSize(ZeroL, 0, PROTOCOL_VERSION) == 32);\n\n    CDataStream ss(0, PROTOCOL_VERSION);\n    ss << R1L;\n    BOOST_CHECK(ss.str() == std::string(R1Array,R1Array+32));\n    ss >> TmpL;\n    BOOST_CHECK(R1L == TmpL);\n    ss.clear();\n    ss << ZeroL;\n    BOOST_CHECK(ss.str() == std::string(ZeroArray,ZeroArray+32));\n    ss >> TmpL;\n    BOOST_CHECK(ZeroL == TmpL);\n    ss.clear();\n    ss << MaxL;\n    BOOST_CHECK(ss.str() == std::string(MaxArray,MaxArray+32));\n    ss >> TmpL;\n    BOOST_CHECK(MaxL == TmpL);\n    ss.clear();\n\n    BOOST_CHECK(R1S.GetHex() == R1S.ToString());\n    BOOST_CHECK(R2S.GetHex() == R2S.ToString());\n    BOOST_CHECK(OneS.GetHex() == OneS.ToString());\n    BOOST_CHECK(MaxS.GetHex() == MaxS.ToString());\n    uint160 TmpS(R1S);\n    BOOST_CHECK(TmpS == R1S);\n    TmpS.SetHex(R2S.ToString());   BOOST_CHECK(TmpS == R2S);\n    TmpS.SetHex(ZeroS.ToString()); BOOST_CHECK(TmpS == uint160());\n\n    TmpS.SetHex(R1S.ToString());\n    BOOST_CHECK(memcmp(R1S.begin(), R1Array, 20)==0);\n    BOOST_CHECK(memcmp(TmpS.begin(), R1Array, 20)==0);\n    BOOST_CHECK(memcmp(R2S.begin(), R2Array, 20)==0);\n    BOOST_CHECK(memcmp(ZeroS.begin(), ZeroArray, 20)==0);\n    BOOST_CHECK(memcmp(OneS.begin(), OneArray, 20)==0);\n    BOOST_CHECK(R1S.size() == sizeof(R1S));\n    BOOST_CHECK(sizeof(R1S) == 20);\n    BOOST_CHECK(R1S.size() == 20);\n    BOOST_CHECK(R2S.size() == 20);\n    BOOST_CHECK(ZeroS.size() == 20);\n    BOOST_CHECK(MaxS.size() == 20);\n    BOOST_CHECK(R1S.begin() + 20 == R1S.end());\n    BOOST_CHECK(R2S.begin() + 20 == R2S.end());\n    BOOST_CHECK(OneS.begin() + 20 == OneS.end());\n    BOOST_CHECK(MaxS.begin() + 20 == MaxS.end());\n    BOOST_CHECK(TmpS.begin() + 20 == TmpS.end());\n    BOOST_CHECK(GetSerializeSize(R1S, 0, PROTOCOL_VERSION) == 20);\n    BOOST_CHECK(GetSerializeSize(ZeroS, 0, PROTOCOL_VERSION) == 20);\n\n    ss << R1S;\n    BOOST_CHECK(ss.str() == std::string(R1Array,R1Array+20));\n    ss >> TmpS;\n    BOOST_CHECK(R1S == TmpS);\n    ss.clear();\n    ss << ZeroS;\n    BOOST_CHECK(ss.str() == std::string(ZeroArray,ZeroArray+20));\n    ss >> TmpS;\n    BOOST_CHECK(ZeroS == TmpS);\n    ss.clear();\n    ss << MaxS;\n    BOOST_CHECK(ss.str() == std::string(MaxArray,MaxArray+20));\n    ss >> TmpS;\n    BOOST_CHECK(MaxS == TmpS);\n    ss.clear();\n}\n\nBOOST_AUTO_TEST_CASE( conversion )\n{\n    BOOST_CHECK(ArithToUint256(UintToArith256(ZeroL)) == ZeroL);\n    BOOST_CHECK(ArithToUint256(UintToArith256(OneL)) == OneL);\n    BOOST_CHECK(ArithToUint256(UintToArith256(R1L)) == R1L);\n    BOOST_CHECK(ArithToUint256(UintToArith256(R2L)) == R2L);\n    BOOST_CHECK(UintToArith256(ZeroL) == 0);\n    BOOST_CHECK(UintToArith256(OneL) == 1);\n    BOOST_CHECK(ArithToUint256(0) == ZeroL);\n    BOOST_CHECK(ArithToUint256(1) == OneL);\n    BOOST_CHECK(arith_uint256(R1L.GetHex()) == UintToArith256(R1L));\n    BOOST_CHECK(arith_uint256(R2L.GetHex()) == UintToArith256(R2L));\n    BOOST_CHECK(R1L.GetHex() == UintToArith256(R1L).GetHex());\n    BOOST_CHECK(R2L.GetHex() == UintToArith256(R2L).GetHex());\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/util_tests.cpp",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <util.h>\n\n#include <clientversion.h>\n#include <primitives/transaction.h>\n#include <sync.h>\n#include <utilstrencodings.h>\n#include <utilmoneystr.h>\n#include <test/test_bitcoin.h>\n\n#include <stdint.h>\n#include <vector>\n#ifndef WIN32\n#include <signal.h>\n#include <sys/types.h>\n#include <sys/wait.h>\n#endif\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(util_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(util_criticalsection)\n{\n    CCriticalSection cs;\n\n    do {\n        LOCK(cs);\n        break;\n\n        BOOST_ERROR(\"break was swallowed!\");\n    } while(0);\n\n    do {\n        TRY_LOCK(cs, lockTest);\n        if (lockTest)\n            break;\n\n        BOOST_ERROR(\"break was swallowed!\");\n    } while(0);\n}\n\nstatic const unsigned char ParseHex_expected[65] = {\n    0x04, 0x67, 0x8a, 0xfd, 0xb0, 0xfe, 0x55, 0x48, 0x27, 0x19, 0x67, 0xf1, 0xa6, 0x71, 0x30, 0xb7,\n    0x10, 0x5c, 0xd6, 0xa8, 0x28, 0xe0, 0x39, 0x09, 0xa6, 0x79, 0x62, 0xe0, 0xea, 0x1f, 0x61, 0xde,\n    0xb6, 0x49, 0xf6, 0xbc, 0x3f, 0x4c, 0xef, 0x38, 0xc4, 0xf3, 0x55, 0x04, 0xe5, 0x1e, 0xc1, 0x12,\n    0xde, 0x5c, 0x38, 0x4d, 0xf7, 0xba, 0x0b, 0x8d, 0x57, 0x8a, 0x4c, 0x70, 0x2b, 0x6b, 0xf1, 0x1d,\n    0x5f\n};\nBOOST_AUTO_TEST_CASE(util_ParseHex)\n{\n    std::vector<unsigned char> result;\n    std::vector<unsigned char> expected(ParseHex_expected, ParseHex_expected + sizeof(ParseHex_expected));\n    // Basic test vector\n    result = ParseHex(\"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f\");\n    BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end());\n\n    // Spaces between bytes must be supported\n    result = ParseHex(\"12 34 56 78\");\n    BOOST_CHECK(result.size() == 4 && result[0] == 0x12 && result[1] == 0x34 && result[2] == 0x56 && result[3] == 0x78);\n\n    // Leading space must be supported (used in CDBEnv::Salvage)\n    result = ParseHex(\" 89 34 56 78\");\n    BOOST_CHECK(result.size() == 4 && result[0] == 0x89 && result[1] == 0x34 && result[2] == 0x56 && result[3] == 0x78);\n\n    // Stop parsing at invalid value\n    result = ParseHex(\"1234 invalid 1234\");\n    BOOST_CHECK(result.size() == 2 && result[0] == 0x12 && result[1] == 0x34);\n}\n\nBOOST_AUTO_TEST_CASE(util_HexStr)\n{\n    BOOST_CHECK_EQUAL(\n        HexStr(ParseHex_expected, ParseHex_expected + sizeof(ParseHex_expected)),\n        \"04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f\");\n\n    BOOST_CHECK_EQUAL(\n        HexStr(ParseHex_expected, ParseHex_expected + 5, true),\n        \"04 67 8a fd b0\");\n\n    BOOST_CHECK_EQUAL(\n        HexStr(ParseHex_expected, ParseHex_expected, true),\n        \"\");\n\n    std::vector<unsigned char> ParseHex_vec(ParseHex_expected, ParseHex_expected + 5);\n\n    BOOST_CHECK_EQUAL(\n        HexStr(ParseHex_vec, true),\n        \"04 67 8a fd b0\");\n}\n\n\nBOOST_AUTO_TEST_CASE(util_DateTimeStrFormat)\n{\n    BOOST_CHECK_EQUAL(DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", 0), \"1970-01-01 00:00:00\");\n    BOOST_CHECK_EQUAL(DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", 0x7FFFFFFF), \"2038-01-19 03:14:07\");\n    BOOST_CHECK_EQUAL(DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", 1317425777), \"2011-09-30 23:36:17\");\n    BOOST_CHECK_EQUAL(DateTimeStrFormat(\"%Y-%m-%d %H:%M\", 1317425777), \"2011-09-30 23:36\");\n    BOOST_CHECK_EQUAL(DateTimeStrFormat(\"%a, %d %b %Y %H:%M:%S +0000\", 1317425777), \"Fri, 30 Sep 2011 23:36:17 +0000\");\n}\n\nclass TestArgsManager : public ArgsManager\n{\npublic:\n    std::map<std::string, std::string>& GetMapArgs()\n    {\n        return mapArgs;\n    };\n    const std::map<std::string, std::vector<std::string> >& GetMapMultiArgs()\n    {\n        return mapMultiArgs;\n    };\n};\n\nBOOST_AUTO_TEST_CASE(util_ParseParameters)\n{\n    TestArgsManager testArgs;\n    const char *argv_test[] = {\"-ignored\", \"-a\", \"-b\", \"-ccc=argument\", \"-ccc=multiple\", \"f\", \"-d=e\"};\n\n    testArgs.ParseParameters(0, (char**)argv_test);\n    BOOST_CHECK(testArgs.GetMapArgs().empty() && testArgs.GetMapMultiArgs().empty());\n\n    testArgs.ParseParameters(1, (char**)argv_test);\n    BOOST_CHECK(testArgs.GetMapArgs().empty() && testArgs.GetMapMultiArgs().empty());\n\n    testArgs.ParseParameters(7, (char**)argv_test);\n    // expectation: -ignored is ignored (program name argument),\n    // -a, -b and -ccc end up in map, -d ignored because it is after\n    // a non-option argument (non-GNU option parsing)\n    BOOST_CHECK(testArgs.GetMapArgs().size() == 3 && testArgs.GetMapMultiArgs().size() == 3);\n    BOOST_CHECK(testArgs.IsArgSet(\"-a\") && testArgs.IsArgSet(\"-b\") && testArgs.IsArgSet(\"-ccc\")\n                && !testArgs.IsArgSet(\"f\") && !testArgs.IsArgSet(\"-d\"));\n    BOOST_CHECK(testArgs.GetMapMultiArgs().count(\"-a\") && testArgs.GetMapMultiArgs().count(\"-b\") && testArgs.GetMapMultiArgs().count(\"-ccc\")\n                && !testArgs.GetMapMultiArgs().count(\"f\") && !testArgs.GetMapMultiArgs().count(\"-d\"));\n\n    BOOST_CHECK(testArgs.GetMapArgs()[\"-a\"] == \"\" && testArgs.GetMapArgs()[\"-ccc\"] == \"multiple\");\n    BOOST_CHECK(testArgs.GetArgs(\"-ccc\").size() == 2);\n}\n\nBOOST_AUTO_TEST_CASE(util_GetArg)\n{\n    TestArgsManager testArgs;\n    testArgs.GetMapArgs().clear();\n    testArgs.GetMapArgs()[\"strtest1\"] = \"string...\";\n    // strtest2 undefined on purpose\n    testArgs.GetMapArgs()[\"inttest1\"] = \"12345\";\n    testArgs.GetMapArgs()[\"inttest2\"] = \"81985529216486895\";\n    // inttest3 undefined on purpose\n    testArgs.GetMapArgs()[\"booltest1\"] = \"\";\n    // booltest2 undefined on purpose\n    testArgs.GetMapArgs()[\"booltest3\"] = \"0\";\n    testArgs.GetMapArgs()[\"booltest4\"] = \"1\";\n\n    BOOST_CHECK_EQUAL(testArgs.GetArg(\"strtest1\", \"default\"), \"string...\");\n    BOOST_CHECK_EQUAL(testArgs.GetArg(\"strtest2\", \"default\"), \"default\");\n    BOOST_CHECK_EQUAL(testArgs.GetArg(\"inttest1\", -1), 12345);\n    BOOST_CHECK_EQUAL(testArgs.GetArg(\"inttest2\", -1), 81985529216486895LL);\n    BOOST_CHECK_EQUAL(testArgs.GetArg(\"inttest3\", -1), -1);\n    BOOST_CHECK_EQUAL(testArgs.GetBoolArg(\"booltest1\", false), true);\n    BOOST_CHECK_EQUAL(testArgs.GetBoolArg(\"booltest2\", false), false);\n    BOOST_CHECK_EQUAL(testArgs.GetBoolArg(\"booltest3\", false), false);\n    BOOST_CHECK_EQUAL(testArgs.GetBoolArg(\"booltest4\", false), true);\n}\n\nBOOST_AUTO_TEST_CASE(util_FormatMoney)\n{\n    BOOST_CHECK_EQUAL(FormatMoney(0), \"0.00\");\n    BOOST_CHECK_EQUAL(FormatMoney((COIN/10000)*123456789), \"12345.6789\");\n    BOOST_CHECK_EQUAL(FormatMoney(-COIN), \"-1.00\");\n\n    BOOST_CHECK_EQUAL(FormatMoney(COIN*100000000), \"100000000.00\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN*10000000), \"10000000.00\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN*1000000), \"1000000.00\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN*100000), \"100000.00\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN*10000), \"10000.00\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN*1000), \"1000.00\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN*100), \"100.00\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN*10), \"10.00\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN), \"1.00\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN/10), \"0.10\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN/100), \"0.01\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN/1000), \"0.001\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN/10000), \"0.0001\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN/100000), \"0.00001\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN/1000000), \"0.000001\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN/10000000), \"0.0000001\");\n    BOOST_CHECK_EQUAL(FormatMoney(COIN/100000000), \"0.00000001\");\n}\n\nBOOST_AUTO_TEST_CASE(util_ParseMoney)\n{\n    CAmount ret = 0;\n    BOOST_CHECK(ParseMoney(\"0.0\", ret));\n    BOOST_CHECK_EQUAL(ret, 0);\n\n    BOOST_CHECK(ParseMoney(\"12345.6789\", ret));\n    BOOST_CHECK_EQUAL(ret, (COIN/10000)*123456789);\n\n    BOOST_CHECK(ParseMoney(\"100000000.00\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN*100000000);\n    BOOST_CHECK(ParseMoney(\"10000000.00\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN*10000000);\n    BOOST_CHECK(ParseMoney(\"1000000.00\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN*1000000);\n    BOOST_CHECK(ParseMoney(\"100000.00\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN*100000);\n    BOOST_CHECK(ParseMoney(\"10000.00\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN*10000);\n    BOOST_CHECK(ParseMoney(\"1000.00\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN*1000);\n    BOOST_CHECK(ParseMoney(\"100.00\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN*100);\n    BOOST_CHECK(ParseMoney(\"10.00\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN*10);\n    BOOST_CHECK(ParseMoney(\"1.00\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN);\n    BOOST_CHECK(ParseMoney(\"1\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN);\n    BOOST_CHECK(ParseMoney(\"0.1\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN/10);\n    BOOST_CHECK(ParseMoney(\"0.01\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN/100);\n    BOOST_CHECK(ParseMoney(\"0.001\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN/1000);\n    BOOST_CHECK(ParseMoney(\"0.0001\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN/10000);\n    BOOST_CHECK(ParseMoney(\"0.00001\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN/100000);\n    BOOST_CHECK(ParseMoney(\"0.000001\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN/1000000);\n    BOOST_CHECK(ParseMoney(\"0.0000001\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN/10000000);\n    BOOST_CHECK(ParseMoney(\"0.00000001\", ret));\n    BOOST_CHECK_EQUAL(ret, COIN/100000000);\n\n    // Attempted 63 bit overflow should fail\n    BOOST_CHECK(!ParseMoney(\"92233720368.54775808\", ret));\n\n    // Parsing negative amounts must fail\n    BOOST_CHECK(!ParseMoney(\"-1\", ret));\n}\n\nBOOST_AUTO_TEST_CASE(util_IsHex)\n{\n    BOOST_CHECK(IsHex(\"00\"));\n    BOOST_CHECK(IsHex(\"00112233445566778899aabbccddeeffAABBCCDDEEFF\"));\n    BOOST_CHECK(IsHex(\"ff\"));\n    BOOST_CHECK(IsHex(\"FF\"));\n\n    BOOST_CHECK(!IsHex(\"\"));\n    BOOST_CHECK(!IsHex(\"0\"));\n    BOOST_CHECK(!IsHex(\"a\"));\n    BOOST_CHECK(!IsHex(\"eleven\"));\n    BOOST_CHECK(!IsHex(\"00xx00\"));\n    BOOST_CHECK(!IsHex(\"0x0000\"));\n}\n\nBOOST_AUTO_TEST_CASE(util_IsHexNumber)\n{\n    BOOST_CHECK(IsHexNumber(\"0x0\"));\n    BOOST_CHECK(IsHexNumber(\"0\"));\n    BOOST_CHECK(IsHexNumber(\"0x10\"));\n    BOOST_CHECK(IsHexNumber(\"10\"));\n    BOOST_CHECK(IsHexNumber(\"0xff\"));\n    BOOST_CHECK(IsHexNumber(\"ff\"));\n    BOOST_CHECK(IsHexNumber(\"0xFfa\"));\n    BOOST_CHECK(IsHexNumber(\"Ffa\"));\n    BOOST_CHECK(IsHexNumber(\"0x00112233445566778899aabbccddeeffAABBCCDDEEFF\"));\n    BOOST_CHECK(IsHexNumber(\"00112233445566778899aabbccddeeffAABBCCDDEEFF\"));\n\n    BOOST_CHECK(!IsHexNumber(\"\"));   // empty string not allowed\n    BOOST_CHECK(!IsHexNumber(\"0x\")); // empty string after prefix not allowed\n    BOOST_CHECK(!IsHexNumber(\"0x0 \")); // no spaces at end,\n    BOOST_CHECK(!IsHexNumber(\" 0x0\")); // or beginning,\n    BOOST_CHECK(!IsHexNumber(\"0x 0\")); // or middle,\n    BOOST_CHECK(!IsHexNumber(\" \"));    // etc.\n    BOOST_CHECK(!IsHexNumber(\"0x0ga\")); // invalid character\n    BOOST_CHECK(!IsHexNumber(\"x0\"));    // broken prefix\n    BOOST_CHECK(!IsHexNumber(\"0x0x00\")); // two prefixes not allowed\n\n}\n\nBOOST_AUTO_TEST_CASE(util_seed_insecure_rand)\n{\n    SeedInsecureRand(true);\n    for (int mod=2;mod<11;mod++)\n    {\n        int mask = 1;\n        // Really rough binomial confidence approximation.\n        int err = 30*10000./mod*sqrt((1./mod*(1-1./mod))/10000.);\n        //mask is 2^ceil(log2(mod))-1\n        while(mask<mod-1)mask=(mask<<1)+1;\n\n        int count = 0;\n        //How often does it get a zero from the uniform range [0,mod)?\n        for (int i = 0; i < 10000; i++) {\n            uint32_t rval;\n            do{\n                rval=InsecureRand32()&mask;\n            }while(rval>=(uint32_t)mod);\n            count += rval==0;\n        }\n        BOOST_CHECK(count<=10000/mod+err);\n        BOOST_CHECK(count>=10000/mod-err);\n    }\n}\n\nBOOST_AUTO_TEST_CASE(util_TimingResistantEqual)\n{\n    BOOST_CHECK(TimingResistantEqual(std::string(\"\"), std::string(\"\")));\n    BOOST_CHECK(!TimingResistantEqual(std::string(\"abc\"), std::string(\"\")));\n    BOOST_CHECK(!TimingResistantEqual(std::string(\"\"), std::string(\"abc\")));\n    BOOST_CHECK(!TimingResistantEqual(std::string(\"a\"), std::string(\"aa\")));\n    BOOST_CHECK(!TimingResistantEqual(std::string(\"aa\"), std::string(\"a\")));\n    BOOST_CHECK(TimingResistantEqual(std::string(\"abc\"), std::string(\"abc\")));\n    BOOST_CHECK(!TimingResistantEqual(std::string(\"abc\"), std::string(\"aba\")));\n}\n\n/* Test strprintf formatting directives.\n * Put a string before and after to ensure sanity of element sizes on stack. */\n#define B \"check_prefix\"\n#define E \"check_postfix\"\nBOOST_AUTO_TEST_CASE(strprintf_numbers)\n{\n    int64_t s64t = -9223372036854775807LL; /* signed 64 bit test value */\n    uint64_t u64t = 18446744073709551615ULL; /* unsigned 64 bit test value */\n    BOOST_CHECK(strprintf(\"%s %d %s\", B, s64t, E) == B\" -9223372036854775807 \" E);\n    BOOST_CHECK(strprintf(\"%s %u %s\", B, u64t, E) == B\" 18446744073709551615 \" E);\n    BOOST_CHECK(strprintf(\"%s %x %s\", B, u64t, E) == B\" ffffffffffffffff \" E);\n\n    size_t st = 12345678; /* unsigned size_t test value */\n    ssize_t sst = -12345678; /* signed size_t test value */\n    BOOST_CHECK(strprintf(\"%s %d %s\", B, sst, E) == B\" -12345678 \" E);\n    BOOST_CHECK(strprintf(\"%s %u %s\", B, st, E) == B\" 12345678 \" E);\n    BOOST_CHECK(strprintf(\"%s %x %s\", B, st, E) == B\" bc614e \" E);\n\n    ptrdiff_t pt = 87654321; /* positive ptrdiff_t test value */\n    ptrdiff_t spt = -87654321; /* negative ptrdiff_t test value */\n    BOOST_CHECK(strprintf(\"%s %d %s\", B, spt, E) == B\" -87654321 \" E);\n    BOOST_CHECK(strprintf(\"%s %u %s\", B, pt, E) == B\" 87654321 \" E);\n    BOOST_CHECK(strprintf(\"%s %x %s\", B, pt, E) == B\" 5397fb1 \" E);\n}\n#undef B\n#undef E\n\n/* Check for mingw/wine issue #3494\n * Remove this test before time.ctime(0xffffffff) == 'Sun Feb  7 07:28:15 2106'\n */\nBOOST_AUTO_TEST_CASE(gettime)\n{\n    BOOST_CHECK((GetTime() & ~0xFFFFFFFFLL) == 0);\n}\n\nBOOST_AUTO_TEST_CASE(test_ParseInt32)\n{\n    int32_t n;\n    // Valid values\n    BOOST_CHECK(ParseInt32(\"1234\", nullptr));\n    BOOST_CHECK(ParseInt32(\"0\", &n) && n == 0);\n    BOOST_CHECK(ParseInt32(\"1234\", &n) && n == 1234);\n    BOOST_CHECK(ParseInt32(\"01234\", &n) && n == 1234); // no octal\n    BOOST_CHECK(ParseInt32(\"2147483647\", &n) && n == 2147483647);\n    BOOST_CHECK(ParseInt32(\"-2147483648\", &n) && n == (-2147483647 - 1)); // (-2147483647 - 1) equals INT_MIN\n    BOOST_CHECK(ParseInt32(\"-1234\", &n) && n == -1234);\n    // Invalid values\n    BOOST_CHECK(!ParseInt32(\"\", &n));\n    BOOST_CHECK(!ParseInt32(\" 1\", &n)); // no padding inside\n    BOOST_CHECK(!ParseInt32(\"1 \", &n));\n    BOOST_CHECK(!ParseInt32(\"1a\", &n));\n    BOOST_CHECK(!ParseInt32(\"aap\", &n));\n    BOOST_CHECK(!ParseInt32(\"0x1\", &n)); // no hex\n    BOOST_CHECK(!ParseInt32(\"0x1\", &n)); // no hex\n    const char test_bytes[] = {'1', 0, '1'};\n    std::string teststr(test_bytes, sizeof(test_bytes));\n    BOOST_CHECK(!ParseInt32(teststr, &n)); // no embedded NULs\n    // Overflow and underflow\n    BOOST_CHECK(!ParseInt32(\"-2147483649\", nullptr));\n    BOOST_CHECK(!ParseInt32(\"2147483648\", nullptr));\n    BOOST_CHECK(!ParseInt32(\"-32482348723847471234\", nullptr));\n    BOOST_CHECK(!ParseInt32(\"32482348723847471234\", nullptr));\n}\n\nBOOST_AUTO_TEST_CASE(test_ParseInt64)\n{\n    int64_t n;\n    // Valid values\n    BOOST_CHECK(ParseInt64(\"1234\", nullptr));\n    BOOST_CHECK(ParseInt64(\"0\", &n) && n == 0LL);\n    BOOST_CHECK(ParseInt64(\"1234\", &n) && n == 1234LL);\n    BOOST_CHECK(ParseInt64(\"01234\", &n) && n == 1234LL); // no octal\n    BOOST_CHECK(ParseInt64(\"2147483647\", &n) && n == 2147483647LL);\n    BOOST_CHECK(ParseInt64(\"-2147483648\", &n) && n == -2147483648LL);\n    BOOST_CHECK(ParseInt64(\"9223372036854775807\", &n) && n == (int64_t)9223372036854775807);\n    BOOST_CHECK(ParseInt64(\"-9223372036854775808\", &n) && n == (int64_t)-9223372036854775807-1);\n    BOOST_CHECK(ParseInt64(\"-1234\", &n) && n == -1234LL);\n    // Invalid values\n    BOOST_CHECK(!ParseInt64(\"\", &n));\n    BOOST_CHECK(!ParseInt64(\" 1\", &n)); // no padding inside\n    BOOST_CHECK(!ParseInt64(\"1 \", &n));\n    BOOST_CHECK(!ParseInt64(\"1a\", &n));\n    BOOST_CHECK(!ParseInt64(\"aap\", &n));\n    BOOST_CHECK(!ParseInt64(\"0x1\", &n)); // no hex\n    const char test_bytes[] = {'1', 0, '1'};\n    std::string teststr(test_bytes, sizeof(test_bytes));\n    BOOST_CHECK(!ParseInt64(teststr, &n)); // no embedded NULs\n    // Overflow and underflow\n    BOOST_CHECK(!ParseInt64(\"-9223372036854775809\", nullptr));\n    BOOST_CHECK(!ParseInt64(\"9223372036854775808\", nullptr));\n    BOOST_CHECK(!ParseInt64(\"-32482348723847471234\", nullptr));\n    BOOST_CHECK(!ParseInt64(\"32482348723847471234\", nullptr));\n}\n\nBOOST_AUTO_TEST_CASE(test_ParseUInt32)\n{\n    uint32_t n;\n    // Valid values\n    BOOST_CHECK(ParseUInt32(\"1234\", nullptr));\n    BOOST_CHECK(ParseUInt32(\"0\", &n) && n == 0);\n    BOOST_CHECK(ParseUInt32(\"1234\", &n) && n == 1234);\n    BOOST_CHECK(ParseUInt32(\"01234\", &n) && n == 1234); // no octal\n    BOOST_CHECK(ParseUInt32(\"2147483647\", &n) && n == 2147483647);\n    BOOST_CHECK(ParseUInt32(\"2147483648\", &n) && n == (uint32_t)2147483648);\n    BOOST_CHECK(ParseUInt32(\"4294967295\", &n) && n == (uint32_t)4294967295);\n    // Invalid values\n    BOOST_CHECK(!ParseUInt32(\"\", &n));\n    BOOST_CHECK(!ParseUInt32(\" 1\", &n)); // no padding inside\n    BOOST_CHECK(!ParseUInt32(\" -1\", &n));\n    BOOST_CHECK(!ParseUInt32(\"1 \", &n));\n    BOOST_CHECK(!ParseUInt32(\"1a\", &n));\n    BOOST_CHECK(!ParseUInt32(\"aap\", &n));\n    BOOST_CHECK(!ParseUInt32(\"0x1\", &n)); // no hex\n    BOOST_CHECK(!ParseUInt32(\"0x1\", &n)); // no hex\n    const char test_bytes[] = {'1', 0, '1'};\n    std::string teststr(test_bytes, sizeof(test_bytes));\n    BOOST_CHECK(!ParseUInt32(teststr, &n)); // no embedded NULs\n    // Overflow and underflow\n    BOOST_CHECK(!ParseUInt32(\"-2147483648\", &n));\n    BOOST_CHECK(!ParseUInt32(\"4294967296\", &n));\n    BOOST_CHECK(!ParseUInt32(\"-1234\", &n));\n    BOOST_CHECK(!ParseUInt32(\"-32482348723847471234\", nullptr));\n    BOOST_CHECK(!ParseUInt32(\"32482348723847471234\", nullptr));\n}\n\nBOOST_AUTO_TEST_CASE(test_ParseUInt64)\n{\n    uint64_t n;\n    // Valid values\n    BOOST_CHECK(ParseUInt64(\"1234\", nullptr));\n    BOOST_CHECK(ParseUInt64(\"0\", &n) && n == 0LL);\n    BOOST_CHECK(ParseUInt64(\"1234\", &n) && n == 1234LL);\n    BOOST_CHECK(ParseUInt64(\"01234\", &n) && n == 1234LL); // no octal\n    BOOST_CHECK(ParseUInt64(\"2147483647\", &n) && n == 2147483647LL);\n    BOOST_CHECK(ParseUInt64(\"9223372036854775807\", &n) && n == 9223372036854775807ULL);\n    BOOST_CHECK(ParseUInt64(\"9223372036854775808\", &n) && n == 9223372036854775808ULL);\n    BOOST_CHECK(ParseUInt64(\"18446744073709551615\", &n) && n == 18446744073709551615ULL);\n    // Invalid values\n    BOOST_CHECK(!ParseUInt64(\"\", &n));\n    BOOST_CHECK(!ParseUInt64(\" 1\", &n)); // no padding inside\n    BOOST_CHECK(!ParseUInt64(\" -1\", &n));\n    BOOST_CHECK(!ParseUInt64(\"1 \", &n));\n    BOOST_CHECK(!ParseUInt64(\"1a\", &n));\n    BOOST_CHECK(!ParseUInt64(\"aap\", &n));\n    BOOST_CHECK(!ParseUInt64(\"0x1\", &n)); // no hex\n    const char test_bytes[] = {'1', 0, '1'};\n    std::string teststr(test_bytes, sizeof(test_bytes));\n    BOOST_CHECK(!ParseUInt64(teststr, &n)); // no embedded NULs\n    // Overflow and underflow\n    BOOST_CHECK(!ParseUInt64(\"-9223372036854775809\", nullptr));\n    BOOST_CHECK(!ParseUInt64(\"18446744073709551616\", nullptr));\n    BOOST_CHECK(!ParseUInt64(\"-32482348723847471234\", nullptr));\n    BOOST_CHECK(!ParseUInt64(\"-2147483648\", &n));\n    BOOST_CHECK(!ParseUInt64(\"-9223372036854775808\", &n));\n    BOOST_CHECK(!ParseUInt64(\"-1234\", &n));\n}\n\nBOOST_AUTO_TEST_CASE(test_ParseDouble)\n{\n    double n;\n    // Valid values\n    BOOST_CHECK(ParseDouble(\"1234\", nullptr));\n    BOOST_CHECK(ParseDouble(\"0\", &n) && n == 0.0);\n    BOOST_CHECK(ParseDouble(\"1234\", &n) && n == 1234.0);\n    BOOST_CHECK(ParseDouble(\"01234\", &n) && n == 1234.0); // no octal\n    BOOST_CHECK(ParseDouble(\"2147483647\", &n) && n == 2147483647.0);\n    BOOST_CHECK(ParseDouble(\"-2147483648\", &n) && n == -2147483648.0);\n    BOOST_CHECK(ParseDouble(\"-1234\", &n) && n == -1234.0);\n    BOOST_CHECK(ParseDouble(\"1e6\", &n) && n == 1e6);\n    BOOST_CHECK(ParseDouble(\"-1e6\", &n) && n == -1e6);\n    // Invalid values\n    BOOST_CHECK(!ParseDouble(\"\", &n));\n    BOOST_CHECK(!ParseDouble(\" 1\", &n)); // no padding inside\n    BOOST_CHECK(!ParseDouble(\"1 \", &n));\n    BOOST_CHECK(!ParseDouble(\"1a\", &n));\n    BOOST_CHECK(!ParseDouble(\"aap\", &n));\n    BOOST_CHECK(!ParseDouble(\"0x1\", &n)); // no hex\n    const char test_bytes[] = {'1', 0, '1'};\n    std::string teststr(test_bytes, sizeof(test_bytes));\n    BOOST_CHECK(!ParseDouble(teststr, &n)); // no embedded NULs\n    // Overflow and underflow\n    BOOST_CHECK(!ParseDouble(\"-1e10000\", nullptr));\n    BOOST_CHECK(!ParseDouble(\"1e10000\", nullptr));\n}\n\nBOOST_AUTO_TEST_CASE(test_FormatParagraph)\n{\n    BOOST_CHECK_EQUAL(FormatParagraph(\"\", 79, 0), \"\");\n    BOOST_CHECK_EQUAL(FormatParagraph(\"test\", 79, 0), \"test\");\n    BOOST_CHECK_EQUAL(FormatParagraph(\" test\", 79, 0), \" test\");\n    BOOST_CHECK_EQUAL(FormatParagraph(\"test test\", 79, 0), \"test test\");\n    BOOST_CHECK_EQUAL(FormatParagraph(\"test test\", 4, 0), \"test\\ntest\");\n    BOOST_CHECK_EQUAL(FormatParagraph(\"testerde test\", 4, 0), \"testerde\\ntest\");\n    BOOST_CHECK_EQUAL(FormatParagraph(\"test test\", 4, 4), \"test\\n    test\");\n\n    // Make sure we don't indent a fully-new line following a too-long line ending\n    BOOST_CHECK_EQUAL(FormatParagraph(\"test test\\nabc\", 4, 4), \"test\\n    test\\nabc\");\n\n    BOOST_CHECK_EQUAL(FormatParagraph(\"This_is_a_very_long_test_string_without_any_spaces_so_it_should_just_get_returned_as_is_despite_the_length until it gets here\", 79), \"This_is_a_very_long_test_string_without_any_spaces_so_it_should_just_get_returned_as_is_despite_the_length\\nuntil it gets here\");\n\n    // Test wrap length is exact\n    BOOST_CHECK_EQUAL(FormatParagraph(\"a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p\", 79), \"a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\\nf g h i j k l m n o p\");\n    BOOST_CHECK_EQUAL(FormatParagraph(\"x\\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p\", 79), \"x\\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\\nf g h i j k l m n o p\");\n    // Indent should be included in length of lines\n    BOOST_CHECK_EQUAL(FormatParagraph(\"x\\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e fg h i j k\", 79, 4), \"x\\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\\n    f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e fg\\n    h i j k\");\n\n    BOOST_CHECK_EQUAL(FormatParagraph(\"This is a very long test string. This is a second sentence in the very long test string.\", 79), \"This is a very long test string. This is a second sentence in the very long\\ntest string.\");\n    BOOST_CHECK_EQUAL(FormatParagraph(\"This is a very long test string.\\nThis is a second sentence in the very long test string. This is a third sentence in the very long test string.\", 79), \"This is a very long test string.\\nThis is a second sentence in the very long test string. This is a third\\nsentence in the very long test string.\");\n    BOOST_CHECK_EQUAL(FormatParagraph(\"This is a very long test string.\\n\\nThis is a second sentence in the very long test string. This is a third sentence in the very long test string.\", 79), \"This is a very long test string.\\n\\nThis is a second sentence in the very long test string. This is a third\\nsentence in the very long test string.\");\n    BOOST_CHECK_EQUAL(FormatParagraph(\"Testing that normal newlines do not get indented.\\nLike here.\", 79), \"Testing that normal newlines do not get indented.\\nLike here.\");\n}\n\nBOOST_AUTO_TEST_CASE(test_FormatSubVersion)\n{\n    std::vector<std::string> comments;\n    comments.push_back(std::string(\"comment1\"));\n    std::vector<std::string> comments2;\n    comments2.push_back(std::string(\"comment1\"));\n    comments2.push_back(SanitizeString(std::string(\"Comment2; .,_?@-; !\\\"#$%&'()*+/<=>[]\\\\^`{|}~\"), SAFE_CHARS_UA_COMMENT)); // Semicolon is discouraged but not forbidden by BIP-0014\n    BOOST_CHECK_EQUAL(FormatSubVersion(\"Test\", 99900, std::vector<std::string>()),std::string(\"/Test:0.9.99/\"));\n    BOOST_CHECK_EQUAL(FormatSubVersion(\"Test\", 99900, comments),std::string(\"/Test:0.9.99(comment1)/\"));\n    BOOST_CHECK_EQUAL(FormatSubVersion(\"Test\", 99900, comments2),std::string(\"/Test:0.9.99(comment1; Comment2; .,_?@-; )/\"));\n}\n\nBOOST_AUTO_TEST_CASE(test_ParseFixedPoint)\n{\n    int64_t amount = 0;\n    BOOST_CHECK(ParseFixedPoint(\"0\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 0LL);\n    BOOST_CHECK(ParseFixedPoint(\"1\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 100000000LL);\n    BOOST_CHECK(ParseFixedPoint(\"0.0\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 0LL);\n    BOOST_CHECK(ParseFixedPoint(\"-0.1\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, -10000000LL);\n    BOOST_CHECK(ParseFixedPoint(\"1.1\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 110000000LL);\n    BOOST_CHECK(ParseFixedPoint(\"1.10000000000000000\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 110000000LL);\n    BOOST_CHECK(ParseFixedPoint(\"1.1e1\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 1100000000LL);\n    BOOST_CHECK(ParseFixedPoint(\"1.1e-1\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 11000000LL);\n    BOOST_CHECK(ParseFixedPoint(\"1000\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 100000000000LL);\n    BOOST_CHECK(ParseFixedPoint(\"-1000\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, -100000000000LL);\n    BOOST_CHECK(ParseFixedPoint(\"0.00000001\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 1LL);\n    BOOST_CHECK(ParseFixedPoint(\"0.0000000100000000\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 1LL);\n    BOOST_CHECK(ParseFixedPoint(\"-0.00000001\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, -1LL);\n    BOOST_CHECK(ParseFixedPoint(\"1000000000.00000001\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 100000000000000001LL);\n    BOOST_CHECK(ParseFixedPoint(\"9999999999.99999999\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, 999999999999999999LL);\n    BOOST_CHECK(ParseFixedPoint(\"-9999999999.99999999\", 8, &amount));\n    BOOST_CHECK_EQUAL(amount, -999999999999999999LL);\n\n    BOOST_CHECK(!ParseFixedPoint(\"\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"a-1000\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-a1000\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-1000a\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-01000\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"00.1\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\".1\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"--0.1\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"0.000000001\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-0.000000001\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"0.00000001000000001\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-10000000000.00000000\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"10000000000.00000000\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-10000000000.00000001\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"10000000000.00000001\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-10000000000.00000009\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"10000000000.00000009\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-99999999999.99999999\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"99999909999.09999999\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"92233720368.54775807\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"92233720368.54775808\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-92233720368.54775808\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"-92233720368.54775809\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"1.1e\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"1.1e-\", 8, &amount));\n    BOOST_CHECK(!ParseFixedPoint(\"1.\", 8, &amount));\n}\n\nstatic void TestOtherThread(fs::path dirname, std::string lockname, bool *result)\n{\n    *result = LockDirectory(dirname, lockname);\n}\n\n#ifndef WIN32 // Cannot do this test on WIN32 due to lack of fork()\nstatic constexpr char LockCommand = 'L';\nstatic constexpr char UnlockCommand = 'U';\nstatic constexpr char ExitCommand = 'X';\n\nstatic void TestOtherProcess(fs::path dirname, std::string lockname, int fd)\n{\n    char ch;\n    int rv;\n    while (true) {\n        rv = read(fd, &ch, 1); // Wait for command\n        assert(rv == 1);\n        switch(ch) {\n        case LockCommand:\n            ch = LockDirectory(dirname, lockname);\n            rv = write(fd, &ch, 1);\n            assert(rv == 1);\n            break;\n        case UnlockCommand:\n            ReleaseDirectoryLocks();\n            ch = true; // Always succeeds\n            rv = write(fd, &ch, 1);\n            break;\n        case ExitCommand:\n            close(fd);\n            exit(0);\n        default:\n            assert(0);\n        }\n    }\n}\n#endif\n\nBOOST_AUTO_TEST_CASE(test_LockDirectory)\n{\n    fs::path dirname = fs::temp_directory_path() / fs::unique_path();\n    const std::string lockname = \".lock\";\n#ifndef WIN32\n    // Revert SIGCHLD to default, otherwise boost.test will catch and fail on\n    // it: there is BOOST_TEST_IGNORE_SIGCHLD but that only works when defined\n    // at build-time of the boost library\n    void (*old_handler)(int) = signal(SIGCHLD, SIG_DFL);\n\n    // Fork another process for testing before creating the lock, so that we\n    // won't fork while holding the lock (which might be undefined, and is not\n    // relevant as test case as that is avoided with -daemonize).\n    int fd[2];\n    BOOST_CHECK_EQUAL(socketpair(AF_UNIX, SOCK_STREAM, 0, fd), 0);\n    pid_t pid = fork();\n    if (!pid) {\n        BOOST_CHECK_EQUAL(close(fd[1]), 0); // Child: close parent end\n        TestOtherProcess(dirname, lockname, fd[0]);\n    }\n    BOOST_CHECK_EQUAL(close(fd[0]), 0); // Parent: close child end\n#endif\n    // Lock on non-existent directory should fail\n    BOOST_CHECK_EQUAL(LockDirectory(dirname, lockname), false);\n\n    fs::create_directories(dirname);\n\n    // Probing lock on new directory should succeed\n    BOOST_CHECK_EQUAL(LockDirectory(dirname, lockname, true), true);\n\n    // Persistent lock on new directory should succeed\n    BOOST_CHECK_EQUAL(LockDirectory(dirname, lockname), true);\n\n    // Another lock on the directory from the same thread should succeed\n    BOOST_CHECK_EQUAL(LockDirectory(dirname, lockname), true);\n\n    // Another lock on the directory from a different thread within the same process should succeed\n    bool threadresult;\n    std::thread thr(TestOtherThread, dirname, lockname, &threadresult);\n    thr.join();\n    BOOST_CHECK_EQUAL(threadresult, true);\n#ifndef WIN32\n    // Try to aquire lock in child process while we're holding it, this should fail.\n    char ch;\n    BOOST_CHECK_EQUAL(write(fd[1], &LockCommand, 1), 1);\n    BOOST_CHECK_EQUAL(read(fd[1], &ch, 1), 1);\n    BOOST_CHECK_EQUAL((bool)ch, false);\n\n    // Give up our lock\n    ReleaseDirectoryLocks();\n    // Probing lock from our side now should succeed, but not hold on to the lock.\n    BOOST_CHECK_EQUAL(LockDirectory(dirname, lockname, true), true);\n\n    // Try to acquire the lock in the child process, this should be succesful.\n    BOOST_CHECK_EQUAL(write(fd[1], &LockCommand, 1), 1);\n    BOOST_CHECK_EQUAL(read(fd[1], &ch, 1), 1);\n    BOOST_CHECK_EQUAL((bool)ch, true);\n\n    // When we try to probe the lock now, it should fail.\n    BOOST_CHECK_EQUAL(LockDirectory(dirname, lockname, true), false);\n\n    // Unlock the lock in the child process\n    BOOST_CHECK_EQUAL(write(fd[1], &UnlockCommand, 1), 1);\n    BOOST_CHECK_EQUAL(read(fd[1], &ch, 1), 1);\n    BOOST_CHECK_EQUAL((bool)ch, true);\n\n    // When we try to probe the lock now, it should succeed.\n    BOOST_CHECK_EQUAL(LockDirectory(dirname, lockname, true), true);\n\n    // Re-lock the lock in the child process, then wait for it to exit, check\n    // successful return. After that, we check that exiting the process\n    // has released the lock as we would expect by probing it.\n    int processstatus;\n    BOOST_CHECK_EQUAL(write(fd[1], &LockCommand, 1), 1);\n    BOOST_CHECK_EQUAL(write(fd[1], &ExitCommand, 1), 1);\n    BOOST_CHECK_EQUAL(waitpid(pid, &processstatus, 0), pid);\n    BOOST_CHECK_EQUAL(processstatus, 0);\n    BOOST_CHECK_EQUAL(LockDirectory(dirname, lockname, true), true);\n\n    // Restore SIGCHLD\n    signal(SIGCHLD, old_handler);\n    BOOST_CHECK_EQUAL(close(fd[1]), 0); // Close our side of the socketpair\n#endif\n    // Clean up\n    ReleaseDirectoryLocks();\n    fs::remove_all(dirname);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/validation_block_tests.cpp",
    "content": "// Copyright (c) 2018 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <boost/test/unit_test.hpp>\n\n#include <chainparams.h>\n#include <consensus/merkle.h>\n#include <consensus/validation.h>\n#include <miner.h>\n#include <pow.h>\n#include <random.h>\n#include <test/test_bitcoin.h>\n#include <validation.h>\n#include <validationinterface.h>\n\nstruct RegtestingSetup : public TestingSetup {\n    RegtestingSetup() : TestingSetup(CBaseChainParams::REGTEST) {}\n};\n\nBOOST_FIXTURE_TEST_SUITE(validation_block_tests, RegtestingSetup)\n\nstruct TestSubscriber : public CValidationInterface {\n    uint256 m_expected_tip;\n\n    TestSubscriber(uint256 tip) : m_expected_tip(tip) {}\n\n    void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)\n    {\n        BOOST_CHECK_EQUAL(m_expected_tip, pindexNew->GetBlockHash());\n    }\n\n    void BlockConnected(const std::shared_ptr<const CBlock>& block, const CBlockIndex* pindex, const std::vector<CTransactionRef>& txnConflicted)\n    {\n        BOOST_CHECK_EQUAL(m_expected_tip, block->hashPrevBlock);\n        BOOST_CHECK_EQUAL(m_expected_tip, pindex->pprev->GetBlockHash());\n\n        m_expected_tip = block->GetHash();\n    }\n\n    void BlockDisconnected(const std::shared_ptr<const CBlock>& block)\n    {\n        BOOST_CHECK_EQUAL(m_expected_tip, block->GetHash());\n\n        m_expected_tip = block->hashPrevBlock;\n    }\n};\n\nstd::shared_ptr<CBlock> Block(const uint256& prev_hash)\n{\n    static int i = 0;\n    static uint64_t time = Params().GenesisBlock().nTime;\n\n    CScript pubKey;\n    pubKey << i++ << OP_TRUE;\n\n    auto ptemplate = BlockAssembler(Params()).CreateNewBlock(pubKey, false);\n    auto pblock = std::make_shared<CBlock>(ptemplate->block);\n    pblock->hashPrevBlock = prev_hash;\n    pblock->nTime = ++time;\n\n    CMutableTransaction txCoinbase(*pblock->vtx[0]);\n    txCoinbase.vout.resize(1);\n    txCoinbase.vin[0].scriptWitness.SetNull();\n    pblock->vtx[0] = MakeTransactionRef(std::move(txCoinbase));\n\n    return pblock;\n}\n\nstd::shared_ptr<CBlock> FinalizeBlock(std::shared_ptr<CBlock> pblock)\n{\n    pblock->hashMerkleRoot = BlockMerkleRoot(*pblock);\n\n    while (!CheckProofOfWork(pblock->GetPoWHash(), pblock->nBits, Params().GetConsensus())) {\n        ++(pblock->nNonce);\n    }\n\n    return pblock;\n}\n\n// construct a valid block\nconst std::shared_ptr<const CBlock> GoodBlock(const uint256& prev_hash)\n{\n    return FinalizeBlock(Block(prev_hash));\n}\n\n// construct an invalid block (but with a valid header)\nconst std::shared_ptr<const CBlock> BadBlock(const uint256& prev_hash)\n{\n    auto pblock = Block(prev_hash);\n\n    CMutableTransaction coinbase_spend;\n    coinbase_spend.vin.push_back(CTxIn(COutPoint(pblock->vtx[0]->GetHash(), 0), CScript(), 0));\n    coinbase_spend.vout.push_back(pblock->vtx[0]->vout[0]);\n\n    CTransactionRef tx = MakeTransactionRef(coinbase_spend);\n    pblock->vtx.push_back(tx);\n\n    auto ret = FinalizeBlock(pblock);\n    return ret;\n}\n\nvoid BuildChain(const uint256& root, int height, const unsigned int invalid_rate, const unsigned int branch_rate, const unsigned int max_size, std::vector<std::shared_ptr<const CBlock>>& blocks)\n{\n    if (height <= 0 || blocks.size() >= max_size) return;\n\n    bool gen_invalid = GetRand(100) < invalid_rate;\n    bool gen_fork = GetRand(100) < branch_rate;\n\n    const std::shared_ptr<const CBlock> pblock = gen_invalid ? BadBlock(root) : GoodBlock(root);\n    blocks.push_back(pblock);\n    if (!gen_invalid) {\n        BuildChain(pblock->GetHash(), height - 1, invalid_rate, branch_rate, max_size, blocks);\n    }\n\n    if (gen_fork) {\n        blocks.push_back(GoodBlock(root));\n        BuildChain(blocks.back()->GetHash(), height - 1, invalid_rate, branch_rate, max_size, blocks);\n    }\n}\n\nBOOST_AUTO_TEST_CASE(processnewblock_signals_ordering)\n{\n    // build a large-ish chain that's likely to have some forks\n    std::vector<std::shared_ptr<const CBlock>> blocks;\n    while (blocks.size() < 50) {\n        blocks.clear();\n        BuildChain(Params().GenesisBlock().GetHash(), 100, 15, 10, 500, blocks);\n    }\n\n    bool ignored;\n    CValidationState state;\n    std::vector<CBlockHeader> headers;\n    std::transform(blocks.begin(), blocks.end(), std::back_inserter(headers), [](std::shared_ptr<const CBlock> b) { return b->GetBlockHeader(); });\n\n    // Process all the headers so we understand the toplogy of the chain\n    BOOST_CHECK(ProcessNewBlockHeaders(headers, state, Params()));\n\n    // Connect the genesis block and drain any outstanding events\n    ProcessNewBlock(Params(), std::make_shared<CBlock>(Params().GenesisBlock()), true, &ignored);\n    SyncWithValidationInterfaceQueue();\n\n    // subscribe to events (this subscriber will validate event ordering)\n    const CBlockIndex* initial_tip = nullptr;\n    {\n        LOCK(cs_main);\n        initial_tip = chainActive.Tip();\n    }\n    TestSubscriber sub(initial_tip->GetBlockHash());\n    RegisterValidationInterface(&sub);\n\n    // create a bunch of threads that repeatedly process a block generated above at random\n    // this will create parallelism and randomness inside validation - the ValidationInterface\n    // will subscribe to events generated during block validation and assert on ordering invariance\n    boost::thread_group threads;\n    for (int i = 0; i < 10; i++) {\n        threads.create_thread([&blocks]() {\n            bool ignored;\n            for (int i = 0; i < 1000; i++) {\n                auto block = blocks[GetRand(blocks.size() - 1)];\n                ProcessNewBlock(Params(), block, true, &ignored);\n            }\n\n            // to make sure that eventually we process the full chain - do it here\n            for (auto block : blocks) {\n                if (block->vtx.size() == 1) {\n                    bool processed = ProcessNewBlock(Params(), block, true, &ignored);\n                    assert(processed);\n                }\n            }\n        });\n    }\n\n    threads.join_all();\n    while (GetMainSignals().CallbacksPending() > 0) {\n        MilliSleep(100);\n    }\n\n    UnregisterValidationInterface(&sub);\n\n    BOOST_CHECK_EQUAL(sub.m_expected_tip, chainActive.Tip()->GetBlockHash());\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/test/versionbits_tests.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <chain.h>\n#include <versionbits.h>\n#include <test/test_bitcoin.h>\n#include <chainparams.h>\n#include <validation.h>\n#include <consensus/params.h>\n\n#include <boost/test/unit_test.hpp>\n\n/* Define a virtual block time, one block per 10 minutes after Nov 14 2014, 0:55:36am */\nint32_t TestTime(int nHeight) { return 1415926536 + 600 * nHeight; }\n\nstatic const Consensus::Params paramsDummy = Consensus::Params();\n\nclass TestConditionChecker : public AbstractThresholdConditionChecker\n{\nprivate:\n    mutable ThresholdConditionCache cache;\n\npublic:\n    int64_t BeginTime(const Consensus::Params& params) const override { return TestTime(10000); }\n    int64_t EndTime(const Consensus::Params& params) const override { return TestTime(20000); }\n    int Period(const Consensus::Params& params) const override { return 1000; }\n    int Threshold(const Consensus::Params& params) const override { return 900; }\n    bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const override { return (pindex->nVersion & 0x100); }\n\n    ThresholdState GetStateFor(const CBlockIndex* pindexPrev) const { return AbstractThresholdConditionChecker::GetStateFor(pindexPrev, paramsDummy, cache); }\n    int GetStateSinceHeightFor(const CBlockIndex* pindexPrev) const { return AbstractThresholdConditionChecker::GetStateSinceHeightFor(pindexPrev, paramsDummy, cache); }\n};\n\nclass TestAlwaysActiveConditionChecker : public TestConditionChecker\n{\npublic:\n    int64_t BeginTime(const Consensus::Params& params) const override { return Consensus::BIP9Deployment::ALWAYS_ACTIVE; }\n};\n\n#define CHECKERS 6\n\nclass VersionBitsTester\n{\n    // A fake blockchain\n    std::vector<CBlockIndex*> vpblock;\n\n    // 6 independent checkers for the same bit.\n    // The first one performs all checks, the second only 50%, the third only 25%, etc...\n    // This is to test whether lack of cached information leads to the same results.\n    TestConditionChecker checker[CHECKERS];\n    // Another 6 that assume always active activation\n    TestAlwaysActiveConditionChecker checker_always[CHECKERS];\n\n    // Test counter (to identify failures)\n    int num;\n\npublic:\n    VersionBitsTester() : num(0) {}\n\n    VersionBitsTester& Reset() {\n        for (unsigned int i = 0; i < vpblock.size(); i++) {\n            delete vpblock[i];\n        }\n        for (unsigned int  i = 0; i < CHECKERS; i++) {\n            checker[i] = TestConditionChecker();\n            checker_always[i] = TestAlwaysActiveConditionChecker();\n        }\n        vpblock.clear();\n        return *this;\n    }\n\n    ~VersionBitsTester() {\n         Reset();\n    }\n\n    VersionBitsTester& Mine(unsigned int height, int32_t nTime, int32_t nVersion) {\n        while (vpblock.size() < height) {\n            CBlockIndex* pindex = new CBlockIndex();\n            pindex->nHeight = vpblock.size();\n            pindex->pprev = vpblock.size() > 0 ? vpblock.back() : nullptr;\n            pindex->nTime = nTime;\n            pindex->nVersion = nVersion;\n            pindex->BuildSkip();\n            vpblock.push_back(pindex);\n        }\n        return *this;\n    }\n\n    VersionBitsTester& TestStateSinceHeight(int height) {\n        for (int i = 0; i < CHECKERS; i++) {\n            if (InsecureRandBits(i) == 0) {\n                BOOST_CHECK_MESSAGE(checker[i].GetStateSinceHeightFor(vpblock.empty() ? nullptr : vpblock.back()) == height, strprintf(\"Test %i for StateSinceHeight\", num));\n                BOOST_CHECK_MESSAGE(checker_always[i].GetStateSinceHeightFor(vpblock.empty() ? nullptr : vpblock.back()) == 0, strprintf(\"Test %i for StateSinceHeight (always active)\", num));\n            }\n        }\n        num++;\n        return *this;\n    }\n\n    VersionBitsTester& TestDefined() {\n        for (int i = 0; i < CHECKERS; i++) {\n            if (InsecureRandBits(i) == 0) {\n                BOOST_CHECK_MESSAGE(checker[i].GetStateFor(vpblock.empty() ? nullptr : vpblock.back()) == THRESHOLD_DEFINED, strprintf(\"Test %i for DEFINED\", num));\n                BOOST_CHECK_MESSAGE(checker_always[i].GetStateFor(vpblock.empty() ? nullptr : vpblock.back()) == THRESHOLD_ACTIVE, strprintf(\"Test %i for ACTIVE (always active)\", num));\n            }\n        }\n        num++;\n        return *this;\n    }\n\n    VersionBitsTester& TestStarted() {\n        for (int i = 0; i < CHECKERS; i++) {\n            if (InsecureRandBits(i) == 0) {\n                BOOST_CHECK_MESSAGE(checker[i].GetStateFor(vpblock.empty() ? nullptr : vpblock.back()) == THRESHOLD_STARTED, strprintf(\"Test %i for STARTED\", num));\n                BOOST_CHECK_MESSAGE(checker_always[i].GetStateFor(vpblock.empty() ? nullptr : vpblock.back()) == THRESHOLD_ACTIVE, strprintf(\"Test %i for ACTIVE (always active)\", num));\n            }\n        }\n        num++;\n        return *this;\n    }\n\n    VersionBitsTester& TestLockedIn() {\n        for (int i = 0; i < CHECKERS; i++) {\n            if (InsecureRandBits(i) == 0) {\n                BOOST_CHECK_MESSAGE(checker[i].GetStateFor(vpblock.empty() ? nullptr : vpblock.back()) == THRESHOLD_LOCKED_IN, strprintf(\"Test %i for LOCKED_IN\", num));\n                BOOST_CHECK_MESSAGE(checker_always[i].GetStateFor(vpblock.empty() ? nullptr : vpblock.back()) == THRESHOLD_ACTIVE, strprintf(\"Test %i for ACTIVE (always active)\", num));\n            }\n        }\n        num++;\n        return *this;\n    }\n\n    VersionBitsTester& TestActive() {\n        for (int i = 0; i < CHECKERS; i++) {\n            if (InsecureRandBits(i) == 0) {\n                BOOST_CHECK_MESSAGE(checker[i].GetStateFor(vpblock.empty() ? nullptr : vpblock.back()) == THRESHOLD_ACTIVE, strprintf(\"Test %i for ACTIVE\", num));\n                BOOST_CHECK_MESSAGE(checker_always[i].GetStateFor(vpblock.empty() ? nullptr : vpblock.back()) == THRESHOLD_ACTIVE, strprintf(\"Test %i for ACTIVE (always active)\", num));\n            }\n        }\n        num++;\n        return *this;\n    }\n\n    VersionBitsTester& TestFailed() {\n        for (int i = 0; i < CHECKERS; i++) {\n            if (InsecureRandBits(i) == 0) {\n                BOOST_CHECK_MESSAGE(checker[i].GetStateFor(vpblock.empty() ? nullptr : vpblock.back()) == THRESHOLD_FAILED, strprintf(\"Test %i for FAILED\", num));\n                BOOST_CHECK_MESSAGE(checker_always[i].GetStateFor(vpblock.empty() ? nullptr : vpblock.back()) == THRESHOLD_ACTIVE, strprintf(\"Test %i for ACTIVE (always active)\", num));\n            }\n        }\n        num++;\n        return *this;\n    }\n\n    CBlockIndex * Tip() { return vpblock.size() ? vpblock.back() : nullptr; }\n};\n\nBOOST_FIXTURE_TEST_SUITE(versionbits_tests, TestingSetup)\n\nBOOST_AUTO_TEST_CASE(versionbits_test)\n{\n    for (int i = 0; i < 64; i++) {\n        // DEFINED -> FAILED\n        VersionBitsTester().TestDefined().TestStateSinceHeight(0)\n                           .Mine(1, TestTime(1), 0x100).TestDefined().TestStateSinceHeight(0)\n                           .Mine(11, TestTime(11), 0x100).TestDefined().TestStateSinceHeight(0)\n                           .Mine(989, TestTime(989), 0x100).TestDefined().TestStateSinceHeight(0)\n                           .Mine(999, TestTime(20000), 0x100).TestDefined().TestStateSinceHeight(0)\n                           .Mine(1000, TestTime(20000), 0x100).TestFailed().TestStateSinceHeight(1000)\n                           .Mine(1999, TestTime(30001), 0x100).TestFailed().TestStateSinceHeight(1000)\n                           .Mine(2000, TestTime(30002), 0x100).TestFailed().TestStateSinceHeight(1000)\n                           .Mine(2001, TestTime(30003), 0x100).TestFailed().TestStateSinceHeight(1000)\n                           .Mine(2999, TestTime(30004), 0x100).TestFailed().TestStateSinceHeight(1000)\n                           .Mine(3000, TestTime(30005), 0x100).TestFailed().TestStateSinceHeight(1000)\n\n        // DEFINED -> STARTED -> FAILED\n                           .Reset().TestDefined().TestStateSinceHeight(0)\n                           .Mine(1, TestTime(1), 0).TestDefined().TestStateSinceHeight(0)\n                           .Mine(1000, TestTime(10000) - 1, 0x100).TestDefined().TestStateSinceHeight(0) // One second more and it would be defined\n                           .Mine(2000, TestTime(10000), 0x100).TestStarted().TestStateSinceHeight(2000) // So that's what happens the next period\n                           .Mine(2051, TestTime(10010), 0).TestStarted().TestStateSinceHeight(2000) // 51 old blocks\n                           .Mine(2950, TestTime(10020), 0x100).TestStarted().TestStateSinceHeight(2000) // 899 new blocks\n                           .Mine(3000, TestTime(20000), 0).TestFailed().TestStateSinceHeight(3000) // 50 old blocks (so 899 out of the past 1000)\n                           .Mine(4000, TestTime(20010), 0x100).TestFailed().TestStateSinceHeight(3000)\n\n        // DEFINED -> STARTED -> FAILED while threshold reached\n                           .Reset().TestDefined().TestStateSinceHeight(0)\n                           .Mine(1, TestTime(1), 0).TestDefined().TestStateSinceHeight(0)\n                           .Mine(1000, TestTime(10000) - 1, 0x101).TestDefined().TestStateSinceHeight(0) // One second more and it would be defined\n                           .Mine(2000, TestTime(10000), 0x101).TestStarted().TestStateSinceHeight(2000) // So that's what happens the next period\n                           .Mine(2999, TestTime(30000), 0x100).TestStarted().TestStateSinceHeight(2000) // 999 new blocks\n                           .Mine(3000, TestTime(30000), 0x100).TestFailed().TestStateSinceHeight(3000) // 1 new block (so 1000 out of the past 1000 are new)\n                           .Mine(3999, TestTime(30001), 0).TestFailed().TestStateSinceHeight(3000)\n                           .Mine(4000, TestTime(30002), 0).TestFailed().TestStateSinceHeight(3000)\n                           .Mine(14333, TestTime(30003), 0).TestFailed().TestStateSinceHeight(3000)\n                           .Mine(24000, TestTime(40000), 0).TestFailed().TestStateSinceHeight(3000)\n\n        // DEFINED -> STARTED -> LOCKEDIN at the last minute -> ACTIVE\n                           .Reset().TestDefined()\n                           .Mine(1, TestTime(1), 0).TestDefined().TestStateSinceHeight(0)\n                           .Mine(1000, TestTime(10000) - 1, 0x101).TestDefined().TestStateSinceHeight(0) // One second more and it would be defined\n                           .Mine(2000, TestTime(10000), 0x101).TestStarted().TestStateSinceHeight(2000) // So that's what happens the next period\n                           .Mine(2050, TestTime(10010), 0x200).TestStarted().TestStateSinceHeight(2000) // 50 old blocks\n                           .Mine(2950, TestTime(10020), 0x100).TestStarted().TestStateSinceHeight(2000) // 900 new blocks\n                           .Mine(2999, TestTime(19999), 0x200).TestStarted().TestStateSinceHeight(2000) // 49 old blocks\n                           .Mine(3000, TestTime(29999), 0x200).TestLockedIn().TestStateSinceHeight(3000) // 1 old block (so 900 out of the past 1000)\n                           .Mine(3999, TestTime(30001), 0).TestLockedIn().TestStateSinceHeight(3000)\n                           .Mine(4000, TestTime(30002), 0).TestActive().TestStateSinceHeight(4000)\n                           .Mine(14333, TestTime(30003), 0).TestActive().TestStateSinceHeight(4000)\n                           .Mine(24000, TestTime(40000), 0).TestActive().TestStateSinceHeight(4000)\n\n        // DEFINED multiple periods -> STARTED multiple periods -> FAILED\n                           .Reset().TestDefined().TestStateSinceHeight(0)\n                           .Mine(999, TestTime(999), 0).TestDefined().TestStateSinceHeight(0)\n                           .Mine(1000, TestTime(1000), 0).TestDefined().TestStateSinceHeight(0)\n                           .Mine(2000, TestTime(2000), 0).TestDefined().TestStateSinceHeight(0)\n                           .Mine(3000, TestTime(10000), 0).TestStarted().TestStateSinceHeight(3000)\n                           .Mine(4000, TestTime(10000), 0).TestStarted().TestStateSinceHeight(3000)\n                           .Mine(5000, TestTime(10000), 0).TestStarted().TestStateSinceHeight(3000)\n                           .Mine(6000, TestTime(20000), 0).TestFailed().TestStateSinceHeight(6000)\n                           .Mine(7000, TestTime(20000), 0x100).TestFailed().TestStateSinceHeight(6000);\n    }\n\n    // Sanity checks of version bit deployments\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN);\n    const Consensus::Params &mainnetParams = chainParams->GetConsensus();\n    for (int i=0; i<(int) Consensus::MAX_VERSION_BITS_DEPLOYMENTS; i++) {\n        uint32_t bitmask = VersionBitsMask(mainnetParams, (Consensus::DeploymentPos)i);\n        // Make sure that no deployment tries to set an invalid bit.\n        BOOST_CHECK_EQUAL(bitmask & ~(uint32_t)VERSIONBITS_TOP_MASK, bitmask);\n\n        // Verify that the deployment windows of different deployment using the\n        // same bit are disjoint.\n        // This test may need modification at such time as a new deployment\n        // is proposed that reuses the bit of an activated soft fork, before the\n        // end time of that soft fork.  (Alternatively, the end time of that\n        // activated soft fork could be later changed to be earlier to avoid\n        // overlap.)\n        for (int j=i+1; j<(int) Consensus::MAX_VERSION_BITS_DEPLOYMENTS; j++) {\n            if (VersionBitsMask(mainnetParams, (Consensus::DeploymentPos)j) == bitmask) {\n                BOOST_CHECK(mainnetParams.vDeployments[j].nStartTime > mainnetParams.vDeployments[i].nTimeout ||\n                        mainnetParams.vDeployments[i].nStartTime > mainnetParams.vDeployments[j].nTimeout);\n            }\n        }\n    }\n}\n\nBOOST_AUTO_TEST_CASE(versionbits_computeblockversion)\n{\n    // Check that ComputeBlockVersion will set the appropriate bit correctly\n    // on mainnet.\n    const auto chainParams = CreateChainParams(CBaseChainParams::MAIN);\n    const Consensus::Params &mainnetParams = chainParams->GetConsensus();\n\n    // Use the TESTDUMMY deployment for testing purposes.\n    int64_t bit = mainnetParams.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit;\n    int64_t nStartTime = mainnetParams.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime;\n    int64_t nTimeout = mainnetParams.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout;\n\n    assert(nStartTime < nTimeout);\n\n    // In the first chain, test that the bit is set by CBV until it has failed.\n    // In the second chain, test the bit is set by CBV while STARTED and\n    // LOCKED-IN, and then no longer set while ACTIVE.\n    VersionBitsTester firstChain, secondChain;\n\n    // Start generating blocks before nStartTime\n    int64_t nTime = nStartTime - 1;\n\n    // Before MedianTimePast of the chain has crossed nStartTime, the bit\n    // should not be set.\n    CBlockIndex *lastBlock = nullptr;\n    lastBlock = firstChain.Mine(12240, nTime, VERSIONBITS_LAST_OLD_BLOCK_VERSION).Tip();\n    BOOST_CHECK_EQUAL(ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit), 0);\n\n    // Mine 12240-5 more blocks at the old time, and check that CBV isn't setting the bit yet.\n    for (int i=1; i<12240-4; i++) {\n        lastBlock = firstChain.Mine(12240+i, nTime, VERSIONBITS_LAST_OLD_BLOCK_VERSION).Tip();\n        // This works because VERSIONBITS_LAST_OLD_BLOCK_VERSION happens\n        // to be 4, and the bit we're testing happens to be bit 28.\n        BOOST_CHECK_EQUAL(ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit), 0);\n    }\n    // Now mine 5 more blocks at the start time -- MTP should not have passed yet, so\n    // CBV should still not yet set the bit.\n    nTime = nStartTime;\n    for (int i=12240-4; i<=12240; i++) {\n        lastBlock = firstChain.Mine(12240+i, nTime, VERSIONBITS_LAST_OLD_BLOCK_VERSION).Tip();\n        BOOST_CHECK_EQUAL(ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit), 0);\n    }\n\n    // Advance to the next period and transition to STARTED,\n    lastBlock = firstChain.Mine(12240*3, nTime, VERSIONBITS_LAST_OLD_BLOCK_VERSION).Tip();\n    // so ComputeBlockVersion should now set the bit,\n    BOOST_CHECK((ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit)) != 0);\n    // and should also be using the VERSIONBITS_TOP_BITS.\n    BOOST_CHECK_EQUAL(ComputeBlockVersion(lastBlock, mainnetParams) & VERSIONBITS_TOP_MASK, VERSIONBITS_TOP_BITS);\n\n    // Check that ComputeBlockVersion will set the bit until nTimeout\n    nTime += 5; // 5 seconds\n    int blocksToMine = 12240*2; // test blocks for up to 2 time periods\n    int nHeight = 12240*3;\n    // These blocks are all before nTimeout is reached.\n    while (nTime < nTimeout && blocksToMine > 0) {\n        lastBlock = firstChain.Mine(nHeight+1, nTime, VERSIONBITS_LAST_OLD_BLOCK_VERSION).Tip();\n        BOOST_CHECK((ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit)) != 0);\n        BOOST_CHECK_EQUAL(ComputeBlockVersion(lastBlock, mainnetParams) & VERSIONBITS_TOP_MASK, VERSIONBITS_TOP_BITS);\n        blocksToMine--;\n        nTime += 5; // 5 seconds\n        nHeight += 1;\n    }\n\n    nTime = nTimeout;\n    // FAILED is only triggered at the end of a period, so CBV should be setting\n    // the bit until the period transition.\n    for (int i=0; i<12240-1; i++) {\n        lastBlock = firstChain.Mine(nHeight+1, nTime, VERSIONBITS_LAST_OLD_BLOCK_VERSION).Tip();\n        BOOST_CHECK((ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit)) != 0);\n        nHeight += 1;\n    }\n    // The next block should trigger no longer setting the bit.\n    lastBlock = firstChain.Mine(nHeight+1, nTime, VERSIONBITS_LAST_OLD_BLOCK_VERSION).Tip();\n    BOOST_CHECK_EQUAL(ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit), 0);\n\n    // On a new chain:\n    // verify that the bit will be set after lock-in, and then stop being set\n    // after activation.\n    nTime = nStartTime;\n\n    // Mine one period worth of blocks, and check that the bit will be on for the\n    // next period.\n    lastBlock = secondChain.Mine(12240, nTime, VERSIONBITS_LAST_OLD_BLOCK_VERSION).Tip();\n    BOOST_CHECK((ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit)) != 0);\n\n    // Mine another period worth of blocks, signaling the new bit.\n    lastBlock = secondChain.Mine(12240*2, nTime, VERSIONBITS_TOP_BITS | (1<<bit)).Tip();\n    // After one period of setting the bit on each block, it should have locked in.\n    // We keep setting the bit for one more period though, until activation.\n    BOOST_CHECK((ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit)) != 0);\n\n    // Now check that we keep mining the block until the end of this period, and\n    // then stop at the beginning of the next period.\n    lastBlock = secondChain.Mine((12240*3)-1, nTime, VERSIONBITS_LAST_OLD_BLOCK_VERSION).Tip();\n    BOOST_CHECK((ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit)) != 0);\n    lastBlock = secondChain.Mine(12240*3, nTime, VERSIONBITS_LAST_OLD_BLOCK_VERSION).Tip();\n    BOOST_CHECK_EQUAL(ComputeBlockVersion(lastBlock, mainnetParams) & (1<<bit), 0);\n\n    // Finally, verify that after a soft fork has activated, CBV no longer uses\n    // VERSIONBITS_LAST_OLD_BLOCK_VERSION.\n    //BOOST_CHECK_EQUAL(ComputeBlockVersion(lastBlock, mainnetParams) & VERSIONBITS_TOP_MASK, VERSIONBITS_TOP_BITS);\n}\n\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/threadinterrupt.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <threadinterrupt.h>\n\nCThreadInterrupt::operator bool() const\n{\n    return flag.load(std::memory_order_acquire);\n}\n\nvoid CThreadInterrupt::reset()\n{\n    flag.store(false, std::memory_order_release);\n}\n\nvoid CThreadInterrupt::operator()()\n{\n    {\n        std::unique_lock<std::mutex> lock(mut);\n        flag.store(true, std::memory_order_release);\n    }\n    cond.notify_all();\n}\n\nbool CThreadInterrupt::sleep_for(std::chrono::milliseconds rel_time)\n{\n    std::unique_lock<std::mutex> lock(mut);\n    return !cond.wait_for(lock, rel_time, [this]() { return flag.load(std::memory_order_acquire); });\n}\n\nbool CThreadInterrupt::sleep_for(std::chrono::seconds rel_time)\n{\n    return sleep_for(std::chrono::duration_cast<std::chrono::milliseconds>(rel_time));\n}\n\nbool CThreadInterrupt::sleep_for(std::chrono::minutes rel_time)\n{\n    return sleep_for(std::chrono::duration_cast<std::chrono::milliseconds>(rel_time));\n}\n"
  },
  {
    "path": "src/threadinterrupt.h",
    "content": "// Copyright (c) 2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_THREADINTERRUPT_H\n#define BITCOIN_THREADINTERRUPT_H\n\n#include <atomic>\n#include <chrono>\n#include <condition_variable>\n#include <mutex>\n\n/*\n    A helper class for interruptible sleeps. Calling operator() will interrupt\n    any current sleep, and after that point operator bool() will return true\n    until reset.\n*/\nclass CThreadInterrupt\n{\npublic:\n    explicit operator bool() const;\n    void operator()();\n    void reset();\n    bool sleep_for(std::chrono::milliseconds rel_time);\n    bool sleep_for(std::chrono::seconds rel_time);\n    bool sleep_for(std::chrono::minutes rel_time);\n\nprivate:\n    std::condition_variable cond;\n    std::mutex mut;\n    std::atomic<bool> flag;\n};\n\n#endif //BITCOIN_THREADINTERRUPT_H\n"
  },
  {
    "path": "src/threadsafety.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_THREADSAFETY_H\n#define BITCOIN_THREADSAFETY_H\n\n#ifdef __clang__\n// TL;DR Add GUARDED_BY(mutex) to member variables. The others are\n// rarely necessary. Ex: int nFoo GUARDED_BY(cs_foo);\n//\n// See http://clang.llvm.org/docs/LanguageExtensions.html#threadsafety\n// for documentation.  The clang compiler can do advanced static analysis\n// of locking when given the -Wthread-safety option.\n#define LOCKABLE __attribute__((lockable))\n#define SCOPED_LOCKABLE __attribute__((scoped_lockable))\n#define GUARDED_BY(x) __attribute__((guarded_by(x)))\n#define GUARDED_VAR __attribute__((guarded_var))\n#define PT_GUARDED_BY(x) __attribute__((pt_guarded_by(x)))\n#define PT_GUARDED_VAR __attribute__((pt_guarded_var))\n#define ACQUIRED_AFTER(...) __attribute__((acquired_after(__VA_ARGS__)))\n#define ACQUIRED_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__)))\n#define EXCLUSIVE_LOCK_FUNCTION(...) __attribute__((exclusive_lock_function(__VA_ARGS__)))\n#define SHARED_LOCK_FUNCTION(...) __attribute__((shared_lock_function(__VA_ARGS__)))\n#define EXCLUSIVE_TRYLOCK_FUNCTION(...) __attribute__((exclusive_trylock_function(__VA_ARGS__)))\n#define SHARED_TRYLOCK_FUNCTION(...) __attribute__((shared_trylock_function(__VA_ARGS__)))\n#define UNLOCK_FUNCTION(...) __attribute__((unlock_function(__VA_ARGS__)))\n#define LOCK_RETURNED(x) __attribute__((lock_returned(x)))\n#define LOCKS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__)))\n#define EXCLUSIVE_LOCKS_REQUIRED(...) __attribute__((exclusive_locks_required(__VA_ARGS__)))\n#define SHARED_LOCKS_REQUIRED(...) __attribute__((shared_locks_required(__VA_ARGS__)))\n#define NO_THREAD_SAFETY_ANALYSIS __attribute__((no_thread_safety_analysis))\n#else\n#define LOCKABLE\n#define SCOPED_LOCKABLE\n#define GUARDED_BY(x)\n#define GUARDED_VAR\n#define PT_GUARDED_BY(x)\n#define PT_GUARDED_VAR\n#define ACQUIRED_AFTER(...)\n#define ACQUIRED_BEFORE(...)\n#define EXCLUSIVE_LOCK_FUNCTION(...)\n#define SHARED_LOCK_FUNCTION(...)\n#define EXCLUSIVE_TRYLOCK_FUNCTION(...)\n#define SHARED_TRYLOCK_FUNCTION(...)\n#define UNLOCK_FUNCTION(...)\n#define LOCK_RETURNED(x)\n#define LOCKS_EXCLUDED(...)\n#define EXCLUSIVE_LOCKS_REQUIRED(...)\n#define SHARED_LOCKS_REQUIRED(...)\n#define NO_THREAD_SAFETY_ANALYSIS\n#endif // __GNUC__\n\n#endif // BITCOIN_THREADSAFETY_H\n"
  },
  {
    "path": "src/timedata.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <timedata.h>\n\n#include <netaddress.h>\n#include <sync.h>\n#include <ui_interface.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <warnings.h>\n\n\nstatic CCriticalSection cs_nTimeOffset;\nstatic int64_t nTimeOffset = 0;\n\n/**\n * \"Never go to sea with two chronometers; take one or three.\"\n * Our three time sources are:\n *  - System clock\n *  - Median of other nodes clocks\n *  - The user (asking the user to fix the system clock if the first two disagree)\n */\nint64_t GetTimeOffset()\n{\n    LOCK(cs_nTimeOffset);\n    return nTimeOffset;\n}\n\nint64_t GetAdjustedTime()\n{\n    return GetTime() + GetTimeOffset();\n}\n\nstatic int64_t abs64(int64_t n)\n{\n    return (n >= 0 ? n : -n);\n}\n\n#define BITCOIN_TIMEDATA_MAX_SAMPLES 200\n\nvoid AddTimeData(const CNetAddr& ip, int64_t nOffsetSample)\n{\n    LOCK(cs_nTimeOffset);\n    // Ignore duplicates\n    static std::set<CNetAddr> setKnown;\n    if (setKnown.size() == BITCOIN_TIMEDATA_MAX_SAMPLES)\n        return;\n    if (!setKnown.insert(ip).second)\n        return;\n\n    // Add data\n    static CMedianFilter<int64_t> vTimeOffsets(BITCOIN_TIMEDATA_MAX_SAMPLES, 0);\n    vTimeOffsets.input(nOffsetSample);\n    LogPrint(BCLog::NET,\"added time data, samples %d, offset %+d (%+d minutes)\\n\", vTimeOffsets.size(), nOffsetSample, nOffsetSample/60);\n\n    // There is a known issue here (see issue #4521):\n    //\n    // - The structure vTimeOffsets contains up to 200 elements, after which\n    // any new element added to it will not increase its size, replacing the\n    // oldest element.\n    //\n    // - The condition to update nTimeOffset includes checking whether the\n    // number of elements in vTimeOffsets is odd, which will never happen after\n    // there are 200 elements.\n    //\n    // But in this case the 'bug' is protective against some attacks, and may\n    // actually explain why we've never seen attacks which manipulate the\n    // clock offset.\n    //\n    // So we should hold off on fixing this and clean it up as part of\n    // a timing cleanup that strengthens it in a number of other ways.\n    //\n    if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1)\n    {\n        int64_t nMedian = vTimeOffsets.median();\n        std::vector<int64_t> vSorted = vTimeOffsets.sorted();\n        // Only let other nodes change our time by so much\n        if (abs64(nMedian) <= std::max<int64_t>(0, gArgs.GetArg(\"-maxtimeadjustment\", DEFAULT_MAX_TIME_ADJUSTMENT)))\n        {\n            nTimeOffset = nMedian;\n        }\n        else\n        {\n            nTimeOffset = 0;\n\n            static bool fDone;\n            if (!fDone)\n            {\n                // If nobody has a time different than ours but within 5 minutes of ours, give a warning\n                bool fMatch = false;\n                for (int64_t nOffset : vSorted)\n                    if (nOffset != 0 && abs64(nOffset) < 5 * 60)\n                        fMatch = true;\n\n                if (!fMatch)\n                {\n                    fDone = true;\n                    std::string strMessage = strprintf(_(\"Please check that your computer's date and time are correct! If your clock is wrong, %s will not work properly.\"), _(PACKAGE_NAME));\n                    SetMiscWarning(strMessage);\n                    uiInterface.ThreadSafeMessageBox(strMessage, \"\", CClientUIInterface::MSG_WARNING);\n                }\n            }\n        }\n\n        if (LogAcceptCategory(BCLog::NET)) {\n            for (int64_t n : vSorted) {\n                LogPrint(BCLog::NET, \"%+d  \", n);\n            }\n            LogPrint(BCLog::NET, \"|  \");\n\n            LogPrint(BCLog::NET, \"nTimeOffset = %+d  (%+d minutes)\\n\", nTimeOffset, nTimeOffset/60);\n        }\n    }\n}\n"
  },
  {
    "path": "src/timedata.h",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_TIMEDATA_H\n#define BITCOIN_TIMEDATA_H\n\n#include <algorithm>\n#include <assert.h>\n#include <stdint.h>\n#include <vector>\n\n/*\nFTL\n120x faster than bitcoin\n\nBTC = 70 * 60 = \"4200s\"\nLTC = 35 * 60 = \"2100s\" 4x faster but 1/2 times\nSUGAR = 70 * 60 / 60 = \"70s\" = 120x faster but 1/60 times\nBTC / 60 = (70 * 60) / 60 = 70\n*/\nstatic const int64_t DEFAULT_MAX_TIME_ADJUSTMENT = 70; // FIXME.SUGAR // FTL\n\nclass CNetAddr;\n\n/** \n * Median filter over a stream of values.\n * Returns the median of the last N numbers\n */\ntemplate <typename T>\nclass CMedianFilter\n{\nprivate:\n    std::vector<T> vValues;\n    std::vector<T> vSorted;\n    unsigned int nSize;\n\npublic:\n    CMedianFilter(unsigned int _size, T initial_value) : nSize(_size)\n    {\n        vValues.reserve(_size);\n        vValues.push_back(initial_value);\n        vSorted = vValues;\n    }\n\n    void input(T value)\n    {\n        if (vValues.size() == nSize) {\n            vValues.erase(vValues.begin());\n        }\n        vValues.push_back(value);\n\n        vSorted.resize(vValues.size());\n        std::copy(vValues.begin(), vValues.end(), vSorted.begin());\n        std::sort(vSorted.begin(), vSorted.end());\n    }\n\n    T median() const\n    {\n        int vSortedSize = vSorted.size();\n        assert(vSortedSize > 0);\n        if (vSortedSize & 1) // Odd number of elements\n        {\n            return vSorted[vSortedSize / 2];\n        } else // Even number of elements\n        {\n            return (vSorted[vSortedSize / 2 - 1] + vSorted[vSortedSize / 2]) / 2;\n        }\n    }\n\n    int size() const\n    {\n        return vValues.size();\n    }\n\n    std::vector<T> sorted() const\n    {\n        return vSorted;\n    }\n};\n\n/** Functions to keep track of adjusted P2P time */\nint64_t GetTimeOffset();\nint64_t GetAdjustedTime();\nvoid AddTimeData(const CNetAddr& ip, int64_t nTime);\n\n#endif // BITCOIN_TIMEDATA_H\n"
  },
  {
    "path": "src/tinyformat.h",
    "content": "// tinyformat.h\n// Copyright (C) 2011, Chris Foster [chris42f (at) gmail (d0t) com]\n//\n// Boost Software License - Version 1.0\n//\n// Permission is hereby granted, free of charge, to any person or organization\n// obtaining a copy of the software and accompanying documentation covered by\n// this license (the \"Software\") to use, reproduce, display, distribute,\n// execute, and transmit the Software, and to prepare derivative works of the\n// Software, and to permit third-parties to whom the Software is furnished to\n// do so, all subject to the following:\n//\n// The copyright notices in the Software and this entire statement, including\n// the above license grant, this restriction and the following disclaimer,\n// must be included in all copies of the Software, in whole or in part, and\n// all derivative works of the Software, unless such copies or derivative\n// works are solely in the form of machine-executable object code generated by\n// a source language processor.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT\n// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE\n// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,\n// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n\n//------------------------------------------------------------------------------\n// Tinyformat: A minimal type safe printf replacement\n//\n// tinyformat.h is a type safe printf replacement library in a single C++\n// header file.  Design goals include:\n//\n// * Type safety and extensibility for user defined types.\n// * C99 printf() compatibility, to the extent possible using std::ostream\n// * Simplicity and minimalism.  A single header file to include and distribute\n//   with your projects.\n// * Augment rather than replace the standard stream formatting mechanism\n// * C++98 support, with optional C++11 niceties\n//\n//\n// Main interface example usage\n// ----------------------------\n//\n// To print a date to std::cout:\n//\n//   std::string weekday = \"Wednesday\";\n//   const char* month = \"July\";\n//   size_t day = 27;\n//   long hour = 14;\n//   int min = 44;\n//\n//   tfm::printf(\"%s, %s %d, %.2d:%.2d\\n\", weekday, month, day, hour, min);\n//\n// The strange types here emphasize the type safety of the interface; it is\n// possible to print a std::string using the \"%s\" conversion, and a\n// size_t using the \"%d\" conversion.  A similar result could be achieved\n// using either of the tfm::format() functions.  One prints on a user provided\n// stream:\n//\n//   tfm::format(std::cerr, \"%s, %s %d, %.2d:%.2d\\n\",\n//               weekday, month, day, hour, min);\n//\n// The other returns a std::string:\n//\n//   std::string date = tfm::format(\"%s, %s %d, %.2d:%.2d\\n\",\n//                                  weekday, month, day, hour, min);\n//   std::cout << date;\n//\n// These are the three primary interface functions.  There is also a\n// convenience function printfln() which appends a newline to the usual result\n// of printf() for super simple logging.\n//\n//\n// User defined format functions\n// -----------------------------\n//\n// Simulating variadic templates in C++98 is pretty painful since it requires\n// writing out the same function for each desired number of arguments.  To make\n// this bearable tinyformat comes with a set of macros which are used\n// internally to generate the API, but which may also be used in user code.\n//\n// The three macros TINYFORMAT_ARGTYPES(n), TINYFORMAT_VARARGS(n) and\n// TINYFORMAT_PASSARGS(n) will generate a list of n argument types,\n// type/name pairs and argument names respectively when called with an integer\n// n between 1 and 16.  We can use these to define a macro which generates the\n// desired user defined function with n arguments.  To generate all 16 user\n// defined function bodies, use the macro TINYFORMAT_FOREACH_ARGNUM.  For an\n// example, see the implementation of printf() at the end of the source file.\n//\n// Sometimes it's useful to be able to pass a list of format arguments through\n// to a non-template function.  The FormatList class is provided as a way to do\n// this by storing the argument list in a type-opaque way.  Continuing the\n// example from above, we construct a FormatList using makeFormatList():\n//\n//   FormatListRef formatList = tfm::makeFormatList(weekday, month, day, hour, min);\n//\n// The format list can now be passed into any non-template function and used\n// via a call to the vformat() function:\n//\n//   tfm::vformat(std::cout, \"%s, %s %d, %.2d:%.2d\\n\", formatList);\n//\n//\n// Additional API information\n// --------------------------\n//\n// Error handling: Define TINYFORMAT_ERROR to customize the error handling for\n// format strings which are unsupported or have the wrong number of format\n// specifiers (calls assert() by default).\n//\n// User defined types: Uses operator<< for user defined types by default.\n// Overload formatValue() for more control.\n\n\n#ifndef TINYFORMAT_H_INCLUDED\n#define TINYFORMAT_H_INCLUDED\n\nnamespace tinyformat {}\n//------------------------------------------------------------------------------\n// Config section.  Customize to your liking!\n\n// Namespace alias to encourage brevity\nnamespace tfm = tinyformat;\n\n// Error handling; calls assert() by default.\n#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)\n\n// Define for C++11 variadic templates which make the code shorter & more\n// general.  If you don't define this, C++11 support is autodetected below.\n#define TINYFORMAT_USE_VARIADIC_TEMPLATES\n\n\n//------------------------------------------------------------------------------\n// Implementation details.\n#include <algorithm>\n#include <cassert>\n#include <iostream>\n#include <sstream>\n#include <stdexcept>\n\n#ifndef TINYFORMAT_ERROR\n#   define TINYFORMAT_ERROR(reason) assert(0 && reason)\n#endif\n\n#if !defined(TINYFORMAT_USE_VARIADIC_TEMPLATES) && !defined(TINYFORMAT_NO_VARIADIC_TEMPLATES)\n#   ifdef __GXX_EXPERIMENTAL_CXX0X__\n#       define TINYFORMAT_USE_VARIADIC_TEMPLATES\n#   endif\n#endif\n\n#if defined(__GLIBCXX__) && __GLIBCXX__ < 20080201\n//  std::showpos is broken on old libstdc++ as provided with OSX.  See\n//  http://gcc.gnu.org/ml/libstdc++/2007-11/msg00075.html\n#   define TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND\n#endif\n\n#ifdef __APPLE__\n// Workaround OSX linker warning: xcode uses different default symbol\n// visibilities for static libs vs executables (see issue #25)\n#   define TINYFORMAT_HIDDEN __attribute__((visibility(\"hidden\")))\n#else\n#   define TINYFORMAT_HIDDEN\n#endif\n\nnamespace tinyformat {\n\nclass format_error: public std::runtime_error\n{\npublic:\n    explicit format_error(const std::string &what): std::runtime_error(what) {\n    }\n};\n\n//------------------------------------------------------------------------------\nnamespace detail {\n\n// Test whether type T1 is convertible to type T2\ntemplate <typename T1, typename T2>\nstruct is_convertible\n{\n    private:\n        // two types of different size\n        struct fail { char dummy[2]; };\n        struct succeed { char dummy; };\n        // Try to convert a T1 to a T2 by plugging into tryConvert\n        static fail tryConvert(...);\n        static succeed tryConvert(const T2&);\n        static const T1& makeT1();\n    public:\n#       ifdef _MSC_VER\n        // Disable spurious loss of precision warnings in tryConvert(makeT1())\n#       pragma warning(push)\n#       pragma warning(disable:4244)\n#       pragma warning(disable:4267)\n#       endif\n        // Standard trick: the (...) version of tryConvert will be chosen from\n        // the overload set only if the version taking a T2 doesn't match.\n        // Then we compare the sizes of the return types to check which\n        // function matched.  Very neat, in a disgusting kind of way :)\n        static const bool value =\n            sizeof(tryConvert(makeT1())) == sizeof(succeed);\n#       ifdef _MSC_VER\n#       pragma warning(pop)\n#       endif\n};\n\n\n// Detect when a type is not a wchar_t string\ntemplate<typename T> struct is_wchar { typedef int tinyformat_wchar_is_not_supported; };\ntemplate<> struct is_wchar<wchar_t*> {};\ntemplate<> struct is_wchar<const wchar_t*> {};\ntemplate<int n> struct is_wchar<const wchar_t[n]> {};\ntemplate<int n> struct is_wchar<wchar_t[n]> {};\n\n\n// Format the value by casting to type fmtT.  This default implementation\n// should never be called.\ntemplate<typename T, typename fmtT, bool convertible = is_convertible<T, fmtT>::value>\nstruct formatValueAsType\n{\n    static void invoke(std::ostream& /*out*/, const T& /*value*/) { assert(0); }\n};\n// Specialized version for types that can actually be converted to fmtT, as\n// indicated by the \"convertible\" template parameter.\ntemplate<typename T, typename fmtT>\nstruct formatValueAsType<T,fmtT,true>\n{\n    static void invoke(std::ostream& out, const T& value)\n        { out << static_cast<fmtT>(value); }\n};\n\n#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND\ntemplate<typename T, bool convertible = is_convertible<T, int>::value>\nstruct formatZeroIntegerWorkaround\n{\n    static bool invoke(std::ostream& /**/, const T& /**/) { return false; }\n};\ntemplate<typename T>\nstruct formatZeroIntegerWorkaround<T,true>\n{\n    static bool invoke(std::ostream& out, const T& value)\n    {\n        if (static_cast<int>(value) == 0 && out.flags() & std::ios::showpos)\n        {\n            out << \"+0\";\n            return true;\n        }\n        return false;\n    }\n};\n#endif // TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND\n\n// Convert an arbitrary type to integer.  The version with convertible=false\n// throws an error.\ntemplate<typename T, bool convertible = is_convertible<T,int>::value>\nstruct convertToInt\n{\n    static int invoke(const T& /*value*/)\n    {\n        TINYFORMAT_ERROR(\"tinyformat: Cannot convert from argument type to \"\n                         \"integer for use as variable width or precision\");\n        return 0;\n    }\n};\n// Specialization for convertToInt when conversion is possible\ntemplate<typename T>\nstruct convertToInt<T,true>\n{\n    static int invoke(const T& value) { return static_cast<int>(value); }\n};\n\n// Format at most ntrunc characters to the given stream.\ntemplate<typename T>\ninline void formatTruncated(std::ostream& out, const T& value, int ntrunc)\n{\n    std::ostringstream tmp;\n    tmp << value;\n    std::string result = tmp.str();\n    out.write(result.c_str(), (std::min)(ntrunc, static_cast<int>(result.size())));\n}\n#define TINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR(type)       \\\ninline void formatTruncated(std::ostream& out, type* value, int ntrunc) \\\n{                                                           \\\n    std::streamsize len = 0;                                \\\n    while(len < ntrunc && value[len] != 0)                  \\\n        ++len;                                              \\\n    out.write(value, len);                                  \\\n}\n// Overload for const char* and char*.  Could overload for signed & unsigned\n// char too, but these are technically unneeded for printf compatibility.\nTINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR(const char)\nTINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR(char)\n#undef TINYFORMAT_DEFINE_FORMAT_TRUNCATED_CSTR\n\n} // namespace detail\n\n\n//------------------------------------------------------------------------------\n// Variable formatting functions.  May be overridden for user-defined types if\n// desired.\n\n\n/// Format a value into a stream, delegating to operator<< by default.\n///\n/// Users may override this for their own types.  When this function is called,\n/// the stream flags will have been modified according to the format string.\n/// The format specification is provided in the range [fmtBegin, fmtEnd).  For\n/// truncating conversions, ntrunc is set to the desired maximum number of\n/// characters, for example \"%.7s\" calls formatValue with ntrunc = 7.\n///\n/// By default, formatValue() uses the usual stream insertion operator\n/// operator<< to format the type T, with special cases for the %c and %p\n/// conversions.\ntemplate<typename T>\ninline void formatValue(std::ostream& out, const char* /*fmtBegin*/,\n                        const char* fmtEnd, int ntrunc, const T& value)\n{\n#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS\n    // Since we don't support printing of wchar_t using \"%ls\", make it fail at\n    // compile time in preference to printing as a void* at runtime.\n    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;\n    (void) DummyType(); // avoid unused type warning with gcc-4.8\n#endif\n    // The mess here is to support the %c and %p conversions: if these\n    // conversions are active we try to convert the type to a char or const\n    // void* respectively and format that instead of the value itself.  For the\n    // %p conversion it's important to avoid dereferencing the pointer, which\n    // could otherwise lead to a crash when printing a dangling (const char*).\n    const bool canConvertToChar = detail::is_convertible<T,char>::value;\n    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;\n    if(canConvertToChar && *(fmtEnd-1) == 'c')\n        detail::formatValueAsType<T, char>::invoke(out, value);\n    else if(canConvertToVoidPtr && *(fmtEnd-1) == 'p')\n        detail::formatValueAsType<T, const void*>::invoke(out, value);\n#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND\n    else if(detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;\n#endif\n    else if(ntrunc >= 0)\n    {\n        // Take care not to overread C strings in truncating conversions like\n        // \"%.4s\" where at most 4 characters may be read.\n        detail::formatTruncated(out, value, ntrunc);\n    }\n    else\n        out << value;\n}\n\n\n// Overloaded version for char types to support printing as an integer\n#define TINYFORMAT_DEFINE_FORMATVALUE_CHAR(charType)                  \\\ninline void formatValue(std::ostream& out, const char* /*fmtBegin*/,  \\\n                        const char* fmtEnd, int /**/, charType value) \\\n{                                                                     \\\n    switch(*(fmtEnd-1))                                               \\\n    {                                                                 \\\n        case 'u': case 'd': case 'i': case 'o': case 'X': case 'x':   \\\n            out << static_cast<int>(value); break;                    \\\n        default:                                                      \\\n            out << value;                   break;                    \\\n    }                                                                 \\\n}\n// per 3.9.1: char, signed char and unsigned char are all distinct types\nTINYFORMAT_DEFINE_FORMATVALUE_CHAR(char)\nTINYFORMAT_DEFINE_FORMATVALUE_CHAR(signed char)\nTINYFORMAT_DEFINE_FORMATVALUE_CHAR(unsigned char)\n#undef TINYFORMAT_DEFINE_FORMATVALUE_CHAR\n\n\n//------------------------------------------------------------------------------\n// Tools for emulating variadic templates in C++98.  The basic idea here is\n// stolen from the boost preprocessor metaprogramming library and cut down to\n// be just general enough for what we need.\n\n#define TINYFORMAT_ARGTYPES(n) TINYFORMAT_ARGTYPES_ ## n\n#define TINYFORMAT_VARARGS(n) TINYFORMAT_VARARGS_ ## n\n#define TINYFORMAT_PASSARGS(n) TINYFORMAT_PASSARGS_ ## n\n#define TINYFORMAT_PASSARGS_TAIL(n) TINYFORMAT_PASSARGS_TAIL_ ## n\n\n// To keep it as transparent as possible, the macros below have been generated\n// using python via the excellent cog.py code generation script.  This avoids\n// the need for a bunch of complex (but more general) preprocessor tricks as\n// used in boost.preprocessor.\n//\n// To rerun the code generation in place, use `cog.py -r tinyformat.h`\n// (see http://nedbatchelder.com/code/cog).  Alternatively you can just create\n// extra versions by hand.\n\n/*[[[cog\nmaxParams = 16\n\ndef makeCommaSepLists(lineTemplate, elemTemplate, startInd=1):\n    for j in range(startInd,maxParams+1):\n        list = ', '.join([elemTemplate % {'i':i} for i in range(startInd,j+1)])\n        cog.outl(lineTemplate % {'j':j, 'list':list})\n\nmakeCommaSepLists('#define TINYFORMAT_ARGTYPES_%(j)d %(list)s',\n                  'class T%(i)d')\n\ncog.outl()\nmakeCommaSepLists('#define TINYFORMAT_VARARGS_%(j)d %(list)s',\n                  'const T%(i)d& v%(i)d')\n\ncog.outl()\nmakeCommaSepLists('#define TINYFORMAT_PASSARGS_%(j)d %(list)s', 'v%(i)d')\n\ncog.outl()\ncog.outl('#define TINYFORMAT_PASSARGS_TAIL_1')\nmakeCommaSepLists('#define TINYFORMAT_PASSARGS_TAIL_%(j)d , %(list)s',\n                  'v%(i)d', startInd = 2)\n\ncog.outl()\ncog.outl('#define TINYFORMAT_FOREACH_ARGNUM(m) \\\\\\n    ' +\n         ' '.join(['m(%d)' % (j,) for j in range(1,maxParams+1)]))\n]]]*/\n#define TINYFORMAT_ARGTYPES_1 class T1\n#define TINYFORMAT_ARGTYPES_2 class T1, class T2\n#define TINYFORMAT_ARGTYPES_3 class T1, class T2, class T3\n#define TINYFORMAT_ARGTYPES_4 class T1, class T2, class T3, class T4\n#define TINYFORMAT_ARGTYPES_5 class T1, class T2, class T3, class T4, class T5\n#define TINYFORMAT_ARGTYPES_6 class T1, class T2, class T3, class T4, class T5, class T6\n#define TINYFORMAT_ARGTYPES_7 class T1, class T2, class T3, class T4, class T5, class T6, class T7\n#define TINYFORMAT_ARGTYPES_8 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8\n#define TINYFORMAT_ARGTYPES_9 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9\n#define TINYFORMAT_ARGTYPES_10 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10\n#define TINYFORMAT_ARGTYPES_11 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11\n#define TINYFORMAT_ARGTYPES_12 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12\n#define TINYFORMAT_ARGTYPES_13 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13\n#define TINYFORMAT_ARGTYPES_14 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14\n#define TINYFORMAT_ARGTYPES_15 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15\n#define TINYFORMAT_ARGTYPES_16 class T1, class T2, class T3, class T4, class T5, class T6, class T7, class T8, class T9, class T10, class T11, class T12, class T13, class T14, class T15, class T16\n\n#define TINYFORMAT_VARARGS_1 const T1& v1\n#define TINYFORMAT_VARARGS_2 const T1& v1, const T2& v2\n#define TINYFORMAT_VARARGS_3 const T1& v1, const T2& v2, const T3& v3\n#define TINYFORMAT_VARARGS_4 const T1& v1, const T2& v2, const T3& v3, const T4& v4\n#define TINYFORMAT_VARARGS_5 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5\n#define TINYFORMAT_VARARGS_6 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6\n#define TINYFORMAT_VARARGS_7 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7\n#define TINYFORMAT_VARARGS_8 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8\n#define TINYFORMAT_VARARGS_9 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9\n#define TINYFORMAT_VARARGS_10 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10\n#define TINYFORMAT_VARARGS_11 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11\n#define TINYFORMAT_VARARGS_12 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11, const T12& v12\n#define TINYFORMAT_VARARGS_13 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11, const T12& v12, const T13& v13\n#define TINYFORMAT_VARARGS_14 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11, const T12& v12, const T13& v13, const T14& v14\n#define TINYFORMAT_VARARGS_15 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11, const T12& v12, const T13& v13, const T14& v14, const T15& v15\n#define TINYFORMAT_VARARGS_16 const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8, const T9& v9, const T10& v10, const T11& v11, const T12& v12, const T13& v13, const T14& v14, const T15& v15, const T16& v16\n\n#define TINYFORMAT_PASSARGS_1 v1\n#define TINYFORMAT_PASSARGS_2 v1, v2\n#define TINYFORMAT_PASSARGS_3 v1, v2, v3\n#define TINYFORMAT_PASSARGS_4 v1, v2, v3, v4\n#define TINYFORMAT_PASSARGS_5 v1, v2, v3, v4, v5\n#define TINYFORMAT_PASSARGS_6 v1, v2, v3, v4, v5, v6\n#define TINYFORMAT_PASSARGS_7 v1, v2, v3, v4, v5, v6, v7\n#define TINYFORMAT_PASSARGS_8 v1, v2, v3, v4, v5, v6, v7, v8\n#define TINYFORMAT_PASSARGS_9 v1, v2, v3, v4, v5, v6, v7, v8, v9\n#define TINYFORMAT_PASSARGS_10 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10\n#define TINYFORMAT_PASSARGS_11 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11\n#define TINYFORMAT_PASSARGS_12 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12\n#define TINYFORMAT_PASSARGS_13 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13\n#define TINYFORMAT_PASSARGS_14 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14\n#define TINYFORMAT_PASSARGS_15 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15\n#define TINYFORMAT_PASSARGS_16 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16\n\n#define TINYFORMAT_PASSARGS_TAIL_1\n#define TINYFORMAT_PASSARGS_TAIL_2 , v2\n#define TINYFORMAT_PASSARGS_TAIL_3 , v2, v3\n#define TINYFORMAT_PASSARGS_TAIL_4 , v2, v3, v4\n#define TINYFORMAT_PASSARGS_TAIL_5 , v2, v3, v4, v5\n#define TINYFORMAT_PASSARGS_TAIL_6 , v2, v3, v4, v5, v6\n#define TINYFORMAT_PASSARGS_TAIL_7 , v2, v3, v4, v5, v6, v7\n#define TINYFORMAT_PASSARGS_TAIL_8 , v2, v3, v4, v5, v6, v7, v8\n#define TINYFORMAT_PASSARGS_TAIL_9 , v2, v3, v4, v5, v6, v7, v8, v9\n#define TINYFORMAT_PASSARGS_TAIL_10 , v2, v3, v4, v5, v6, v7, v8, v9, v10\n#define TINYFORMAT_PASSARGS_TAIL_11 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11\n#define TINYFORMAT_PASSARGS_TAIL_12 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12\n#define TINYFORMAT_PASSARGS_TAIL_13 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13\n#define TINYFORMAT_PASSARGS_TAIL_14 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14\n#define TINYFORMAT_PASSARGS_TAIL_15 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15\n#define TINYFORMAT_PASSARGS_TAIL_16 , v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16\n\n#define TINYFORMAT_FOREACH_ARGNUM(m) \\\n    m(1) m(2) m(3) m(4) m(5) m(6) m(7) m(8) m(9) m(10) m(11) m(12) m(13) m(14) m(15) m(16)\n//[[[end]]]\n\n\n\nnamespace detail {\n\n// Type-opaque holder for an argument to format(), with associated actions on\n// the type held as explicit function pointers.  This allows FormatArg's for\n// each argument to be allocated as a homogenous array inside FormatList\n// whereas a naive implementation based on inheritance does not.\nclass FormatArg\n{\n    public:\n        FormatArg()\n             : m_value(nullptr),\n             m_formatImpl(nullptr),\n             m_toIntImpl(nullptr)\n         { }\n\n        template<typename T>\n        explicit FormatArg(const T& value)\n            : m_value(static_cast<const void*>(&value)),\n            m_formatImpl(&formatImpl<T>),\n            m_toIntImpl(&toIntImpl<T>)\n        { }\n\n        void format(std::ostream& out, const char* fmtBegin,\n                    const char* fmtEnd, int ntrunc) const\n        {\n            assert(m_value);\n            assert(m_formatImpl);\n            m_formatImpl(out, fmtBegin, fmtEnd, ntrunc, m_value);\n        }\n\n        int toInt() const\n        {\n            assert(m_value);\n            assert(m_toIntImpl);\n            return m_toIntImpl(m_value);\n        }\n\n    private:\n        template<typename T>\n        TINYFORMAT_HIDDEN static void formatImpl(std::ostream& out, const char* fmtBegin,\n                        const char* fmtEnd, int ntrunc, const void* value)\n        {\n            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));\n        }\n\n        template<typename T>\n        TINYFORMAT_HIDDEN static int toIntImpl(const void* value)\n        {\n            return convertToInt<T>::invoke(*static_cast<const T*>(value));\n        }\n\n        const void* m_value;\n        void (*m_formatImpl)(std::ostream& out, const char* fmtBegin,\n                             const char* fmtEnd, int ntrunc, const void* value);\n        int (*m_toIntImpl)(const void* value);\n};\n\n\n// Parse and return an integer from the string c, as atoi()\n// On return, c is set to one past the end of the integer.\ninline int parseIntAndAdvance(const char*& c)\n{\n    int i = 0;\n    for(;*c >= '0' && *c <= '9'; ++c)\n        i = 10*i + (*c - '0');\n    return i;\n}\n\n// Print literal part of format string and return next format spec\n// position.\n//\n// Skips over any occurrences of '%%', printing a literal '%' to the\n// output.  The position of the first % character of the next\n// nontrivial format spec is returned, or the end of string.\ninline const char* printFormatStringLiteral(std::ostream& out, const char* fmt)\n{\n    const char* c = fmt;\n    for(;; ++c)\n    {\n        switch(*c)\n        {\n            case '\\0':\n                out.write(fmt, c - fmt);\n                return c;\n            case '%':\n                out.write(fmt, c - fmt);\n                if(*(c+1) != '%')\n                    return c;\n                // for \"%%\", tack trailing % onto next literal section.\n                fmt = ++c;\n                break;\n            default:\n                break;\n        }\n    }\n}\n\n\n// Parse a format string and set the stream state accordingly.\n//\n// The format mini-language recognized here is meant to be the one from C99,\n// with the form \"%[flags][width][.precision][length]type\".\n//\n// Formatting options which can't be natively represented using the ostream\n// state are returned in spacePadPositive (for space padded positive numbers)\n// and ntrunc (for truncating conversions).  argIndex is incremented if\n// necessary to pull out variable width and precision .  The function returns a\n// pointer to the character after the end of the current format spec.\ninline const char* streamStateFromFormat(std::ostream& out, bool& spacePadPositive,\n                                         int& ntrunc, const char* fmtStart,\n                                         const detail::FormatArg* formatters,\n                                         int& argIndex, int numFormatters)\n{\n    if(*fmtStart != '%')\n    {\n        TINYFORMAT_ERROR(\"tinyformat: Not enough conversion specifiers in format string\");\n        return fmtStart;\n    }\n    // Reset stream state to defaults.\n    out.width(0);\n    out.precision(6);\n    out.fill(' ');\n    // Reset most flags; ignore irrelevant unitbuf & skipws.\n    out.unsetf(std::ios::adjustfield | std::ios::basefield |\n               std::ios::floatfield | std::ios::showbase | std::ios::boolalpha |\n               std::ios::showpoint | std::ios::showpos | std::ios::uppercase);\n    bool precisionSet = false;\n    bool widthSet = false;\n    int widthExtra = 0;\n    const char* c = fmtStart + 1;\n    // 1) Parse flags\n    for(;; ++c)\n    {\n        switch(*c)\n        {\n            case '#':\n                out.setf(std::ios::showpoint | std::ios::showbase);\n                continue;\n            case '0':\n                // overridden by left alignment ('-' flag)\n                if(!(out.flags() & std::ios::left))\n                {\n                    // Use internal padding so that numeric values are\n                    // formatted correctly, eg -00010 rather than 000-10\n                    out.fill('0');\n                    out.setf(std::ios::internal, std::ios::adjustfield);\n                }\n                continue;\n            case '-':\n                out.fill(' ');\n                out.setf(std::ios::left, std::ios::adjustfield);\n                continue;\n            case ' ':\n                // overridden by show positive sign, '+' flag.\n                if(!(out.flags() & std::ios::showpos))\n                    spacePadPositive = true;\n                continue;\n            case '+':\n                out.setf(std::ios::showpos);\n                spacePadPositive = false;\n                widthExtra = 1;\n                continue;\n            default:\n                break;\n        }\n        break;\n    }\n    // 2) Parse width\n    if(*c >= '0' && *c <= '9')\n    {\n        widthSet = true;\n        out.width(parseIntAndAdvance(c));\n    }\n    if(*c == '*')\n    {\n        widthSet = true;\n        int width = 0;\n        if(argIndex < numFormatters)\n            width = formatters[argIndex++].toInt();\n        else\n            TINYFORMAT_ERROR(\"tinyformat: Not enough arguments to read variable width\");\n        if(width < 0)\n        {\n            // negative widths correspond to '-' flag set\n            out.fill(' ');\n            out.setf(std::ios::left, std::ios::adjustfield);\n            width = -width;\n        }\n        out.width(width);\n        ++c;\n    }\n    // 3) Parse precision\n    if(*c == '.')\n    {\n        ++c;\n        int precision = 0;\n        if(*c == '*')\n        {\n            ++c;\n            if(argIndex < numFormatters)\n                precision = formatters[argIndex++].toInt();\n            else\n                TINYFORMAT_ERROR(\"tinyformat: Not enough arguments to read variable precision\");\n        }\n        else\n        {\n            if(*c >= '0' && *c <= '9')\n                precision = parseIntAndAdvance(c);\n            else if(*c == '-') // negative precisions ignored, treated as zero.\n                parseIntAndAdvance(++c);\n        }\n        out.precision(precision);\n        precisionSet = true;\n    }\n    // 4) Ignore any C99 length modifier\n    while(*c == 'l' || *c == 'h' || *c == 'L' ||\n          *c == 'j' || *c == 'z' || *c == 't')\n        ++c;\n    // 5) We're up to the conversion specifier character.\n    // Set stream flags based on conversion specifier (thanks to the\n    // boost::format class for forging the way here).\n    bool intConversion = false;\n    switch(*c)\n    {\n        case 'u': case 'd': case 'i':\n            out.setf(std::ios::dec, std::ios::basefield);\n            intConversion = true;\n            break;\n        case 'o':\n            out.setf(std::ios::oct, std::ios::basefield);\n            intConversion = true;\n            break;\n        case 'X':\n            out.setf(std::ios::uppercase);\n            // Falls through\n        case 'x': case 'p':\n            out.setf(std::ios::hex, std::ios::basefield);\n            intConversion = true;\n            break;\n        case 'E':\n            out.setf(std::ios::uppercase);\n            // Falls through\n        case 'e':\n            out.setf(std::ios::scientific, std::ios::floatfield);\n            out.setf(std::ios::dec, std::ios::basefield);\n            break;\n        case 'F':\n            out.setf(std::ios::uppercase);\n            // Falls through\n        case 'f':\n            out.setf(std::ios::fixed, std::ios::floatfield);\n            break;\n        case 'G':\n            out.setf(std::ios::uppercase);\n            // Falls through\n        case 'g':\n            out.setf(std::ios::dec, std::ios::basefield);\n            // As in boost::format, let stream decide float format.\n            out.flags(out.flags() & ~std::ios::floatfield);\n            break;\n        case 'a': case 'A':\n            TINYFORMAT_ERROR(\"tinyformat: the %a and %A conversion specs \"\n                             \"are not supported\");\n            break;\n        case 'c':\n            // Handled as special case inside formatValue()\n            break;\n        case 's':\n            if(precisionSet)\n                ntrunc = static_cast<int>(out.precision());\n            // Make %s print booleans as \"true\" and \"false\"\n            out.setf(std::ios::boolalpha);\n            break;\n        case 'n':\n            // Not supported - will cause problems!\n            TINYFORMAT_ERROR(\"tinyformat: %n conversion spec not supported\");\n            break;\n        case '\\0':\n            TINYFORMAT_ERROR(\"tinyformat: Conversion spec incorrectly \"\n                             \"terminated by end of string\");\n            return c;\n        default:\n            break;\n    }\n    if(intConversion && precisionSet && !widthSet)\n    {\n        // \"precision\" for integers gives the minimum number of digits (to be\n        // padded with zeros on the left).  This isn't really supported by the\n        // iostreams, but we can approximately simulate it with the width if\n        // the width isn't otherwise used.\n        out.width(out.precision() + widthExtra);\n        out.setf(std::ios::internal, std::ios::adjustfield);\n        out.fill('0');\n    }\n    return c+1;\n}\n\n\n//------------------------------------------------------------------------------\ninline void formatImpl(std::ostream& out, const char* fmt,\n                       const detail::FormatArg* formatters,\n                       int numFormatters)\n{\n    // Saved stream state\n    std::streamsize origWidth = out.width();\n    std::streamsize origPrecision = out.precision();\n    std::ios::fmtflags origFlags = out.flags();\n    char origFill = out.fill();\n\n    for (int argIndex = 0; argIndex < numFormatters; ++argIndex)\n    {\n        // Parse the format string\n        fmt = printFormatStringLiteral(out, fmt);\n        bool spacePadPositive = false;\n        int ntrunc = -1;\n        const char* fmtEnd = streamStateFromFormat(out, spacePadPositive, ntrunc, fmt,\n                                                   formatters, argIndex, numFormatters);\n        if (argIndex >= numFormatters)\n        {\n            // Check args remain after reading any variable width/precision\n            TINYFORMAT_ERROR(\"tinyformat: Not enough format arguments\");\n            return;\n        }\n        const FormatArg& arg = formatters[argIndex];\n        // Format the arg into the stream.\n        if(!spacePadPositive)\n            arg.format(out, fmt, fmtEnd, ntrunc);\n        else\n        {\n            // The following is a special case with no direct correspondence\n            // between stream formatting and the printf() behaviour.  Simulate\n            // it crudely by formatting into a temporary string stream and\n            // munging the resulting string.\n            std::ostringstream tmpStream;\n            tmpStream.copyfmt(out);\n            tmpStream.setf(std::ios::showpos);\n            arg.format(tmpStream, fmt, fmtEnd, ntrunc);\n            std::string result = tmpStream.str(); // allocates... yuck.\n            for(size_t i = 0, iend = result.size(); i < iend; ++i)\n                if(result[i] == '+') result[i] = ' ';\n            out << result;\n        }\n        fmt = fmtEnd;\n    }\n\n    // Print remaining part of format string.\n    fmt = printFormatStringLiteral(out, fmt);\n    if(*fmt != '\\0')\n        TINYFORMAT_ERROR(\"tinyformat: Too many conversion specifiers in format string\");\n\n    // Restore stream state\n    out.width(origWidth);\n    out.precision(origPrecision);\n    out.flags(origFlags);\n    out.fill(origFill);\n}\n\n} // namespace detail\n\n\n/// List of template arguments format(), held in a type-opaque way.\n///\n/// A const reference to FormatList (typedef'd as FormatListRef) may be\n/// conveniently used to pass arguments to non-template functions: All type\n/// information has been stripped from the arguments, leaving just enough of a\n/// common interface to perform formatting as required.\nclass FormatList\n{\n    public:\n        FormatList(detail::FormatArg* formatters, int N)\n            : m_formatters(formatters), m_N(N) { }\n\n        friend void vformat(std::ostream& out, const char* fmt,\n                            const FormatList& list);\n\n    private:\n        const detail::FormatArg* m_formatters;\n        int m_N;\n};\n\n/// Reference to type-opaque format list for passing to vformat()\ntypedef const FormatList& FormatListRef;\n\n\nnamespace detail {\n\n// Format list subclass with fixed storage to avoid dynamic allocation\ntemplate<int N>\nclass FormatListN : public FormatList\n{\n    public:\n#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES\n        template<typename... Args>\n        explicit FormatListN(const Args&... args)\n            : FormatList(&m_formatterStore[0], N),\n            m_formatterStore { FormatArg(args)... }\n        { static_assert(sizeof...(args) == N, \"Number of args must be N\"); }\n#else // C++98 version\n        void init(int) {}\n#       define TINYFORMAT_MAKE_FORMATLIST_CONSTRUCTOR(n)       \\\n                                                               \\\n        template<TINYFORMAT_ARGTYPES(n)>                       \\\n        explicit FormatListN(TINYFORMAT_VARARGS(n))            \\\n            : FormatList(&m_formatterStore[0], n)              \\\n        { assert(n == N); init(0, TINYFORMAT_PASSARGS(n)); }   \\\n                                                               \\\n        template<TINYFORMAT_ARGTYPES(n)>                       \\\n        void init(int i, TINYFORMAT_VARARGS(n))                \\\n        {                                                      \\\n            m_formatterStore[i] = FormatArg(v1);               \\\n            init(i+1 TINYFORMAT_PASSARGS_TAIL(n));             \\\n        }\n\n        TINYFORMAT_FOREACH_ARGNUM(TINYFORMAT_MAKE_FORMATLIST_CONSTRUCTOR)\n#       undef TINYFORMAT_MAKE_FORMATLIST_CONSTRUCTOR\n#endif\n\n    private:\n        FormatArg m_formatterStore[N];\n};\n\n// Special 0-arg version - MSVC says zero-sized C array in struct is nonstandard\ntemplate<> class FormatListN<0> : public FormatList\n{\n    public: FormatListN() : FormatList(0, 0) {}\n};\n\n} // namespace detail\n\n\n//------------------------------------------------------------------------------\n// Primary API functions\n\n#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES\n\n/// Make type-agnostic format list from list of template arguments.\n///\n/// The exact return type of this function is an implementation detail and\n/// shouldn't be relied upon.  Instead it should be stored as a FormatListRef:\n///\n///   FormatListRef formatList = makeFormatList( /*...*/ );\ntemplate<typename... Args>\ndetail::FormatListN<sizeof...(Args)> makeFormatList(const Args&... args)\n{\n    return detail::FormatListN<sizeof...(args)>(args...);\n}\n\n#else // C++98 version\n\ninline detail::FormatListN<0> makeFormatList()\n{\n    return detail::FormatListN<0>();\n}\n#define TINYFORMAT_MAKE_MAKEFORMATLIST(n)                     \\\ntemplate<TINYFORMAT_ARGTYPES(n)>                              \\\ndetail::FormatListN<n> makeFormatList(TINYFORMAT_VARARGS(n))  \\\n{                                                             \\\n    return detail::FormatListN<n>(TINYFORMAT_PASSARGS(n));    \\\n}\nTINYFORMAT_FOREACH_ARGNUM(TINYFORMAT_MAKE_MAKEFORMATLIST)\n#undef TINYFORMAT_MAKE_MAKEFORMATLIST\n\n#endif\n\n/// Format list of arguments to the stream according to the given format string.\n///\n/// The name vformat() is chosen for the semantic similarity to vprintf(): the\n/// list of format arguments is held in a single function argument.\ninline void vformat(std::ostream& out, const char* fmt, FormatListRef list)\n{\n    detail::formatImpl(out, fmt, list.m_formatters, list.m_N);\n}\n\n\n#ifdef TINYFORMAT_USE_VARIADIC_TEMPLATES\n\n/// Format list of arguments to the stream according to given format string.\ntemplate<typename... Args>\nvoid format(std::ostream& out, const char* fmt, const Args&... args)\n{\n    vformat(out, fmt, makeFormatList(args...));\n}\n\n/// Format list of arguments according to the given format string and return\n/// the result as a string.\ntemplate<typename... Args>\nstd::string format(const char* fmt, const Args&... args)\n{\n    std::ostringstream oss;\n    format(oss, fmt, args...);\n    return oss.str();\n}\n\n/// Format list of arguments to std::cout, according to the given format string\ntemplate<typename... Args>\nvoid printf(const char* fmt, const Args&... args)\n{\n    format(std::cout, fmt, args...);\n}\n\ntemplate<typename... Args>\nvoid printfln(const char* fmt, const Args&... args)\n{\n    format(std::cout, fmt, args...);\n    std::cout << '\\n';\n}\n\n#else // C++98 version\n\ninline void format(std::ostream& out, const char* fmt)\n{\n    vformat(out, fmt, makeFormatList());\n}\n\ninline std::string format(const char* fmt)\n{\n    std::ostringstream oss;\n    format(oss, fmt);\n    return oss.str();\n}\n\ninline void printf(const char* fmt)\n{\n    format(std::cout, fmt);\n}\n\ninline void printfln(const char* fmt)\n{\n    format(std::cout, fmt);\n    std::cout << '\\n';\n}\n\n#define TINYFORMAT_MAKE_FORMAT_FUNCS(n)                                   \\\n                                                                          \\\ntemplate<TINYFORMAT_ARGTYPES(n)>                                          \\\nvoid format(std::ostream& out, const char* fmt, TINYFORMAT_VARARGS(n))    \\\n{                                                                         \\\n    vformat(out, fmt, makeFormatList(TINYFORMAT_PASSARGS(n)));            \\\n}                                                                         \\\n                                                                          \\\ntemplate<TINYFORMAT_ARGTYPES(n)>                                          \\\nstd::string format(const char* fmt, TINYFORMAT_VARARGS(n))                \\\n{                                                                         \\\n    std::ostringstream oss;                                               \\\n    format(oss, fmt, TINYFORMAT_PASSARGS(n));                             \\\n    return oss.str();                                                     \\\n}                                                                         \\\n                                                                          \\\ntemplate<TINYFORMAT_ARGTYPES(n)>                                          \\\nvoid printf(const char* fmt, TINYFORMAT_VARARGS(n))                       \\\n{                                                                         \\\n    format(std::cout, fmt, TINYFORMAT_PASSARGS(n));                       \\\n}                                                                         \\\n                                                                          \\\ntemplate<TINYFORMAT_ARGTYPES(n)>                                          \\\nvoid printfln(const char* fmt, TINYFORMAT_VARARGS(n))                     \\\n{                                                                         \\\n    format(std::cout, fmt, TINYFORMAT_PASSARGS(n));                       \\\n    std::cout << '\\n';                                                    \\\n}\n\nTINYFORMAT_FOREACH_ARGNUM(TINYFORMAT_MAKE_FORMAT_FUNCS)\n#undef TINYFORMAT_MAKE_FORMAT_FUNCS\n\n#endif\n\n// Added for Bitcoin Core\ntemplate<typename... Args>\nstd::string format(const std::string &fmt, const Args&... args)\n{\n    std::ostringstream oss;\n    format(oss, fmt.c_str(), args...);\n    return oss.str();\n}\n\n} // namespace tinyformat\n\n#define strprintf tfm::format\n\n#endif // TINYFORMAT_H_INCLUDED\n"
  },
  {
    "path": "src/torcontrol.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Copyright (c) 2017 The Zcash developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <torcontrol.h>\n#include <utilstrencodings.h>\n#include <netbase.h>\n#include <net.h>\n#include <util.h>\n#include <crypto/hmac_sha256.h>\n\n#include <vector>\n#include <deque>\n#include <set>\n#include <stdlib.h>\n\n#include <boost/bind.hpp>\n#include <boost/signals2/signal.hpp>\n#include <boost/algorithm/string/split.hpp>\n#include <boost/algorithm/string/classification.hpp>\n#include <boost/algorithm/string/replace.hpp>\n\n#include <event2/bufferevent.h>\n#include <event2/buffer.h>\n#include <event2/util.h>\n#include <event2/event.h>\n#include <event2/thread.h>\n\n/** Default control port */\nconst std::string DEFAULT_TOR_CONTROL = \"127.0.0.1:9051\";\n/** Tor cookie size (from control-spec.txt) */\nstatic const int TOR_COOKIE_SIZE = 32;\n/** Size of client/server nonce for SAFECOOKIE */\nstatic const int TOR_NONCE_SIZE = 32;\n/** For computing serverHash in SAFECOOKIE */\nstatic const std::string TOR_SAFE_SERVERKEY = \"Tor safe cookie authentication server-to-controller hash\";\n/** For computing clientHash in SAFECOOKIE */\nstatic const std::string TOR_SAFE_CLIENTKEY = \"Tor safe cookie authentication controller-to-server hash\";\n/** Exponential backoff configuration - initial timeout in seconds */\nstatic const float RECONNECT_TIMEOUT_START = 1.0;\n/** Exponential backoff configuration - growth factor */\nstatic const float RECONNECT_TIMEOUT_EXP = 1.5;\n/** Maximum length for lines received on TorControlConnection.\n * tor-control-spec.txt mentions that there is explicitly no limit defined to line length,\n * this is belt-and-suspenders sanity limit to prevent memory exhaustion.\n */\nstatic const int MAX_LINE_LENGTH = 100000;\n\n/****** Low-level TorControlConnection ********/\n\n/** Reply from Tor, can be single or multi-line */\nclass TorControlReply\n{\npublic:\n    TorControlReply() { Clear(); }\n\n    int code;\n    std::vector<std::string> lines;\n\n    void Clear()\n    {\n        code = 0;\n        lines.clear();\n    }\n};\n\n/** Low-level handling for Tor control connection.\n * Speaks the SMTP-like protocol as defined in torspec/control-spec.txt\n */\nclass TorControlConnection\n{\npublic:\n    typedef std::function<void(TorControlConnection&)> ConnectionCB;\n    typedef std::function<void(TorControlConnection &,const TorControlReply &)> ReplyHandlerCB;\n\n    /** Create a new TorControlConnection.\n     */\n    explicit TorControlConnection(struct event_base *base);\n    ~TorControlConnection();\n\n    /**\n     * Connect to a Tor control port.\n     * target is address of the form host:port.\n     * connected is the handler that is called when connection is successfully established.\n     * disconnected is a handler that is called when the connection is broken.\n     * Return true on success.\n     */\n    bool Connect(const std::string &target, const ConnectionCB& connected, const ConnectionCB& disconnected);\n\n    /**\n     * Disconnect from Tor control port.\n     */\n    bool Disconnect();\n\n    /** Send a command, register a handler for the reply.\n     * A trailing CRLF is automatically added.\n     * Return true on success.\n     */\n    bool Command(const std::string &cmd, const ReplyHandlerCB& reply_handler);\n\n    /** Response handlers for async replies */\n    boost::signals2::signal<void(TorControlConnection &,const TorControlReply &)> async_handler;\nprivate:\n    /** Callback when ready for use */\n    std::function<void(TorControlConnection&)> connected;\n    /** Callback when connection lost */\n    std::function<void(TorControlConnection&)> disconnected;\n    /** Libevent event base */\n    struct event_base *base;\n    /** Connection to control socket */\n    struct bufferevent *b_conn;\n    /** Message being received */\n    TorControlReply message;\n    /** Response handlers */\n    std::deque<ReplyHandlerCB> reply_handlers;\n\n    /** Libevent handlers: internal */\n    static void readcb(struct bufferevent *bev, void *ctx);\n    static void eventcb(struct bufferevent *bev, short what, void *ctx);\n};\n\nTorControlConnection::TorControlConnection(struct event_base *_base):\n    base(_base), b_conn(nullptr)\n{\n}\n\nTorControlConnection::~TorControlConnection()\n{\n    if (b_conn)\n        bufferevent_free(b_conn);\n}\n\nvoid TorControlConnection::readcb(struct bufferevent *bev, void *ctx)\n{\n    TorControlConnection *self = (TorControlConnection*)ctx;\n    struct evbuffer *input = bufferevent_get_input(bev);\n    size_t n_read_out = 0;\n    char *line;\n    assert(input);\n    //  If there is not a whole line to read, evbuffer_readln returns nullptr\n    while((line = evbuffer_readln(input, &n_read_out, EVBUFFER_EOL_CRLF)) != nullptr)\n    {\n        std::string s(line, n_read_out);\n        free(line);\n        if (s.size() < 4) // Short line\n            continue;\n        // <status>(-|+| )<data><CRLF>\n        self->message.code = atoi(s.substr(0,3));\n        self->message.lines.push_back(s.substr(4));\n        char ch = s[3]; // '-','+' or ' '\n        if (ch == ' ') {\n            // Final line, dispatch reply and clean up\n            if (self->message.code >= 600) {\n                // Dispatch async notifications to async handler\n                // Synchronous and asynchronous messages are never interleaved\n                self->async_handler(*self, self->message);\n            } else {\n                if (!self->reply_handlers.empty()) {\n                    // Invoke reply handler with message\n                    self->reply_handlers.front()(*self, self->message);\n                    self->reply_handlers.pop_front();\n                } else {\n                    LogPrint(BCLog::TOR, \"tor: Received unexpected sync reply %i\\n\", self->message.code);\n                }\n            }\n            self->message.Clear();\n        }\n    }\n    //  Check for size of buffer - protect against memory exhaustion with very long lines\n    //  Do this after evbuffer_readln to make sure all full lines have been\n    //  removed from the buffer. Everything left is an incomplete line.\n    if (evbuffer_get_length(input) > MAX_LINE_LENGTH) {\n        LogPrintf(\"tor: Disconnecting because MAX_LINE_LENGTH exceeded\\n\");\n        self->Disconnect();\n    }\n}\n\nvoid TorControlConnection::eventcb(struct bufferevent *bev, short what, void *ctx)\n{\n    TorControlConnection *self = (TorControlConnection*)ctx;\n    if (what & BEV_EVENT_CONNECTED) {\n        LogPrint(BCLog::TOR, \"tor: Successfully connected!\\n\");\n        self->connected(*self);\n    } else if (what & (BEV_EVENT_EOF|BEV_EVENT_ERROR)) {\n        if (what & BEV_EVENT_ERROR) {\n            LogPrint(BCLog::TOR, \"tor: Error connecting to Tor control socket\\n\");\n        } else {\n            LogPrint(BCLog::TOR, \"tor: End of stream\\n\");\n        }\n        self->Disconnect();\n        self->disconnected(*self);\n    }\n}\n\nbool TorControlConnection::Connect(const std::string &target, const ConnectionCB& _connected, const ConnectionCB&  _disconnected)\n{\n    if (b_conn)\n        Disconnect();\n    // Parse target address:port\n    struct sockaddr_storage connect_to_addr;\n    int connect_to_addrlen = sizeof(connect_to_addr);\n    if (evutil_parse_sockaddr_port(target.c_str(),\n        (struct sockaddr*)&connect_to_addr, &connect_to_addrlen)<0) {\n        LogPrintf(\"tor: Error parsing socket address %s\\n\", target);\n        return false;\n    }\n\n    // Create a new socket, set up callbacks and enable notification bits\n    b_conn = bufferevent_socket_new(base, -1, BEV_OPT_CLOSE_ON_FREE);\n    if (!b_conn)\n        return false;\n    bufferevent_setcb(b_conn, TorControlConnection::readcb, nullptr, TorControlConnection::eventcb, this);\n    bufferevent_enable(b_conn, EV_READ|EV_WRITE);\n    this->connected = _connected;\n    this->disconnected = _disconnected;\n\n    // Finally, connect to target\n    if (bufferevent_socket_connect(b_conn, (struct sockaddr*)&connect_to_addr, connect_to_addrlen) < 0) {\n        LogPrintf(\"tor: Error connecting to address %s\\n\", target);\n        return false;\n    }\n    return true;\n}\n\nbool TorControlConnection::Disconnect()\n{\n    if (b_conn)\n        bufferevent_free(b_conn);\n    b_conn = nullptr;\n    return true;\n}\n\nbool TorControlConnection::Command(const std::string &cmd, const ReplyHandlerCB& reply_handler)\n{\n    if (!b_conn)\n        return false;\n    struct evbuffer *buf = bufferevent_get_output(b_conn);\n    if (!buf)\n        return false;\n    evbuffer_add(buf, cmd.data(), cmd.size());\n    evbuffer_add(buf, \"\\r\\n\", 2);\n    reply_handlers.push_back(reply_handler);\n    return true;\n}\n\n/****** General parsing utilities ********/\n\n/* Split reply line in the form 'AUTH METHODS=...' into a type\n * 'AUTH' and arguments 'METHODS=...'.\n * Grammar is implicitly defined in https://spec.torproject.org/control-spec by\n * the server reply formats for PROTOCOLINFO (S3.21) and AUTHCHALLENGE (S3.24).\n */\nstatic std::pair<std::string,std::string> SplitTorReplyLine(const std::string &s)\n{\n    size_t ptr=0;\n    std::string type;\n    while (ptr < s.size() && s[ptr] != ' ') {\n        type.push_back(s[ptr]);\n        ++ptr;\n    }\n    if (ptr < s.size())\n        ++ptr; // skip ' '\n    return make_pair(type, s.substr(ptr));\n}\n\n/** Parse reply arguments in the form 'METHODS=COOKIE,SAFECOOKIE COOKIEFILE=\".../control_auth_cookie\"'.\n * Returns a map of keys to values, or an empty map if there was an error.\n * Grammar is implicitly defined in https://spec.torproject.org/control-spec by\n * the server reply formats for PROTOCOLINFO (S3.21), AUTHCHALLENGE (S3.24),\n * and ADD_ONION (S3.27). See also sections 2.1 and 2.3.\n */\nstatic std::map<std::string,std::string> ParseTorReplyMapping(const std::string &s)\n{\n    std::map<std::string,std::string> mapping;\n    size_t ptr=0;\n    while (ptr < s.size()) {\n        std::string key, value;\n        while (ptr < s.size() && s[ptr] != '=' && s[ptr] != ' ') {\n            key.push_back(s[ptr]);\n            ++ptr;\n        }\n        if (ptr == s.size()) // unexpected end of line\n            return std::map<std::string,std::string>();\n        if (s[ptr] == ' ') // The remaining string is an OptArguments\n            break;\n        ++ptr; // skip '='\n        if (ptr < s.size() && s[ptr] == '\"') { // Quoted string\n            ++ptr; // skip opening '\"'\n            bool escape_next = false;\n            while (ptr < s.size() && (escape_next || s[ptr] != '\"')) {\n                // Repeated backslashes must be interpreted as pairs\n                escape_next = (s[ptr] == '\\\\' && !escape_next);\n                value.push_back(s[ptr]);\n                ++ptr;\n            }\n            if (ptr == s.size()) // unexpected end of line\n                return std::map<std::string,std::string>();\n            ++ptr; // skip closing '\"'\n            /**\n             * Unescape value. Per https://spec.torproject.org/control-spec section 2.1.1:\n             *\n             *   For future-proofing, controller implementors MAY use the following\n             *   rules to be compatible with buggy Tor implementations and with\n             *   future ones that implement the spec as intended:\n             *\n             *     Read \\n \\t \\r and \\0 ... \\377 as C escapes.\n             *     Treat a backslash followed by any other character as that character.\n             */\n            std::string escaped_value;\n            for (size_t i = 0; i < value.size(); ++i) {\n                if (value[i] == '\\\\') {\n                    // This will always be valid, because if the QuotedString\n                    // ended in an odd number of backslashes, then the parser\n                    // would already have returned above, due to a missing\n                    // terminating double-quote.\n                    ++i;\n                    if (value[i] == 'n') {\n                        escaped_value.push_back('\\n');\n                    } else if (value[i] == 't') {\n                        escaped_value.push_back('\\t');\n                    } else if (value[i] == 'r') {\n                        escaped_value.push_back('\\r');\n                    } else if ('0' <= value[i] && value[i] <= '7') {\n                        size_t j;\n                        // Octal escape sequences have a limit of three octal digits,\n                        // but terminate at the first character that is not a valid\n                        // octal digit if encountered sooner.\n                        for (j = 1; j < 3 && (i+j) < value.size() && '0' <= value[i+j] && value[i+j] <= '7'; ++j) {}\n                        // Tor restricts first digit to 0-3 for three-digit octals.\n                        // A leading digit of 4-7 would therefore be interpreted as\n                        // a two-digit octal.\n                        if (j == 3 && value[i] > '3') {\n                            j--;\n                        }\n                        escaped_value.push_back(strtol(value.substr(i, j).c_str(), nullptr, 8));\n                        // Account for automatic incrementing at loop end\n                        i += j - 1;\n                    } else {\n                        escaped_value.push_back(value[i]);\n                    }\n                } else {\n                    escaped_value.push_back(value[i]);\n                }\n            }\n            value = escaped_value;\n        } else { // Unquoted value. Note that values can contain '=' at will, just no spaces\n            while (ptr < s.size() && s[ptr] != ' ') {\n                value.push_back(s[ptr]);\n                ++ptr;\n            }\n        }\n        if (ptr < s.size() && s[ptr] == ' ')\n            ++ptr; // skip ' ' after key=value\n        mapping[key] = value;\n    }\n    return mapping;\n}\n\n/** Read full contents of a file and return them in a std::string.\n * Returns a pair <status, string>.\n * If an error occurred, status will be false, otherwise status will be true and the data will be returned in string.\n *\n * @param maxsize Puts a maximum size limit on the file that is read. If the file is larger than this, truncated data\n *         (with len > maxsize) will be returned.\n */\nstatic std::pair<bool,std::string> ReadBinaryFile(const fs::path &filename, size_t maxsize=std::numeric_limits<size_t>::max())\n{\n    FILE *f = fsbridge::fopen(filename, \"rb\");\n    if (f == nullptr)\n        return std::make_pair(false,\"\");\n    std::string retval;\n    char buffer[128];\n    size_t n;\n    while ((n=fread(buffer, 1, sizeof(buffer), f)) > 0) {\n        // Check for reading errors so we don't return any data if we couldn't\n        // read the entire file (or up to maxsize)\n        if (ferror(f)) {\n            fclose(f);\n            return std::make_pair(false,\"\");\n        }\n        retval.append(buffer, buffer+n);\n        if (retval.size() > maxsize)\n            break;\n    }\n    fclose(f);\n    return std::make_pair(true,retval);\n}\n\n/** Write contents of std::string to a file.\n * @return true on success.\n */\nstatic bool WriteBinaryFile(const fs::path &filename, const std::string &data)\n{\n    FILE *f = fsbridge::fopen(filename, \"wb\");\n    if (f == nullptr)\n        return false;\n    if (fwrite(data.data(), 1, data.size(), f) != data.size()) {\n        fclose(f);\n        return false;\n    }\n    fclose(f);\n    return true;\n}\n\n/****** Bitcoin specific TorController implementation ********/\n\n/** Controller that connects to Tor control socket, authenticate, then create\n * and maintain an ephemeral hidden service.\n */\nclass TorController\n{\npublic:\n    TorController(struct event_base* base, const std::string& target);\n    ~TorController();\n\n    /** Get name fo file to store private key in */\n    fs::path GetPrivateKeyFile();\n\n    /** Reconnect, after getting disconnected */\n    void Reconnect();\nprivate:\n    struct event_base* base;\n    std::string target;\n    TorControlConnection conn;\n    std::string private_key;\n    std::string service_id;\n    bool reconnect;\n    struct event *reconnect_ev;\n    float reconnect_timeout;\n    CService service;\n    /** Cookie for SAFECOOKIE auth */\n    std::vector<uint8_t> cookie;\n    /** ClientNonce for SAFECOOKIE auth */\n    std::vector<uint8_t> clientNonce;\n\n    /** Callback for ADD_ONION result */\n    void add_onion_cb(TorControlConnection& conn, const TorControlReply& reply);\n    /** Callback for AUTHENTICATE result */\n    void auth_cb(TorControlConnection& conn, const TorControlReply& reply);\n    /** Callback for AUTHCHALLENGE result */\n    void authchallenge_cb(TorControlConnection& conn, const TorControlReply& reply);\n    /** Callback for PROTOCOLINFO result */\n    void protocolinfo_cb(TorControlConnection& conn, const TorControlReply& reply);\n    /** Callback after successful connection */\n    void connected_cb(TorControlConnection& conn);\n    /** Callback after connection lost or failed connection attempt */\n    void disconnected_cb(TorControlConnection& conn);\n\n    /** Callback for reconnect timer */\n    static void reconnect_cb(evutil_socket_t fd, short what, void *arg);\n};\n\nTorController::TorController(struct event_base* _base, const std::string& _target):\n    base(_base),\n    target(_target), conn(base), reconnect(true), reconnect_ev(0),\n    reconnect_timeout(RECONNECT_TIMEOUT_START)\n{\n    reconnect_ev = event_new(base, -1, 0, reconnect_cb, this);\n    if (!reconnect_ev)\n        LogPrintf(\"tor: Failed to create event for reconnection: out of memory?\\n\");\n    // Start connection attempts immediately\n    if (!conn.Connect(_target, boost::bind(&TorController::connected_cb, this, _1),\n         boost::bind(&TorController::disconnected_cb, this, _1) )) {\n        LogPrintf(\"tor: Initiating connection to Tor control port %s failed\\n\", _target);\n    }\n    // Read service private key if cached\n    std::pair<bool,std::string> pkf = ReadBinaryFile(GetPrivateKeyFile());\n    if (pkf.first) {\n        LogPrint(BCLog::TOR, \"tor: Reading cached private key from %s\\n\", GetPrivateKeyFile().string());\n        private_key = pkf.second;\n    }\n}\n\nTorController::~TorController()\n{\n    if (reconnect_ev) {\n        event_free(reconnect_ev);\n        reconnect_ev = nullptr;\n    }\n    if (service.IsValid()) {\n        RemoveLocal(service);\n    }\n}\n\nvoid TorController::add_onion_cb(TorControlConnection& _conn, const TorControlReply& reply)\n{\n    if (reply.code == 250) {\n        LogPrint(BCLog::TOR, \"tor: ADD_ONION successful\\n\");\n        for (const std::string &s : reply.lines) {\n            std::map<std::string,std::string> m = ParseTorReplyMapping(s);\n            std::map<std::string,std::string>::iterator i;\n            if ((i = m.find(\"ServiceID\")) != m.end())\n                service_id = i->second;\n            if ((i = m.find(\"PrivateKey\")) != m.end())\n                private_key = i->second;\n        }\n        if (service_id.empty()) {\n            LogPrintf(\"tor: Error parsing ADD_ONION parameters:\\n\");\n            for (const std::string &s : reply.lines) {\n                LogPrintf(\"    %s\\n\", SanitizeString(s));\n            }\n            return;\n        }\n        service = LookupNumeric(std::string(service_id+\".onion\").c_str(), GetListenPort());\n        LogPrintf(\"tor: Got service ID %s, advertising service %s\\n\", service_id, service.ToString());\n        if (WriteBinaryFile(GetPrivateKeyFile(), private_key)) {\n            LogPrint(BCLog::TOR, \"tor: Cached service private key to %s\\n\", GetPrivateKeyFile().string());\n        } else {\n            LogPrintf(\"tor: Error writing service private key to %s\\n\", GetPrivateKeyFile().string());\n        }\n        AddLocal(service, LOCAL_MANUAL);\n        // ... onion requested - keep connection open\n    } else if (reply.code == 510) { // 510 Unrecognized command\n        LogPrintf(\"tor: Add onion failed with unrecognized command (You probably need to upgrade Tor)\\n\");\n    } else {\n        LogPrintf(\"tor: Add onion failed; error code %d\\n\", reply.code);\n    }\n}\n\nvoid TorController::auth_cb(TorControlConnection& _conn, const TorControlReply& reply)\n{\n    if (reply.code == 250) {\n        LogPrint(BCLog::TOR, \"tor: Authentication successful\\n\");\n\n        // Now that we know Tor is running setup the proxy for onion addresses\n        // if -onion isn't set to something else.\n        if (gArgs.GetArg(\"-onion\", \"\") == \"\") {\n            CService resolved(LookupNumeric(\"127.0.0.1\", 9050));\n            proxyType addrOnion = proxyType(resolved, true);\n            SetProxy(NET_TOR, addrOnion);\n            SetLimited(NET_TOR, false);\n        }\n\n        // Finally - now create the service\n        if (private_key.empty()) // No private key, generate one\n            private_key = \"NEW:RSA1024\"; // Explicitly request RSA1024 - see issue #9214\n        // Request hidden service, redirect port.\n        // Note that the 'virtual' port doesn't have to be the same as our internal port, but this is just a convenient\n        // choice.  TODO; refactor the shutdown sequence some day.\n        _conn.Command(strprintf(\"ADD_ONION %s Port=%i,127.0.0.1:%i\", private_key, GetListenPort(), GetListenPort()),\n            boost::bind(&TorController::add_onion_cb, this, _1, _2));\n    } else {\n        LogPrintf(\"tor: Authentication failed\\n\");\n    }\n}\n\n/** Compute Tor SAFECOOKIE response.\n *\n *    ServerHash is computed as:\n *      HMAC-SHA256(\"Tor safe cookie authentication server-to-controller hash\",\n *                  CookieString | ClientNonce | ServerNonce)\n *    (with the HMAC key as its first argument)\n *\n *    After a controller sends a successful AUTHCHALLENGE command, the\n *    next command sent on the connection must be an AUTHENTICATE command,\n *    and the only authentication string which that AUTHENTICATE command\n *    will accept is:\n *\n *      HMAC-SHA256(\"Tor safe cookie authentication controller-to-server hash\",\n *                  CookieString | ClientNonce | ServerNonce)\n *\n */\nstatic std::vector<uint8_t> ComputeResponse(const std::string &key, const std::vector<uint8_t> &cookie,  const std::vector<uint8_t> &clientNonce, const std::vector<uint8_t> &serverNonce)\n{\n    CHMAC_SHA256 computeHash((const uint8_t*)key.data(), key.size());\n    std::vector<uint8_t> computedHash(CHMAC_SHA256::OUTPUT_SIZE, 0);\n    computeHash.Write(cookie.data(), cookie.size());\n    computeHash.Write(clientNonce.data(), clientNonce.size());\n    computeHash.Write(serverNonce.data(), serverNonce.size());\n    computeHash.Finalize(computedHash.data());\n    return computedHash;\n}\n\nvoid TorController::authchallenge_cb(TorControlConnection& _conn, const TorControlReply& reply)\n{\n    if (reply.code == 250) {\n        LogPrint(BCLog::TOR, \"tor: SAFECOOKIE authentication challenge successful\\n\");\n        std::pair<std::string,std::string> l = SplitTorReplyLine(reply.lines[0]);\n        if (l.first == \"AUTHCHALLENGE\") {\n            std::map<std::string,std::string> m = ParseTorReplyMapping(l.second);\n            if (m.empty()) {\n                LogPrintf(\"tor: Error parsing AUTHCHALLENGE parameters: %s\\n\", SanitizeString(l.second));\n                return;\n            }\n            std::vector<uint8_t> serverHash = ParseHex(m[\"SERVERHASH\"]);\n            std::vector<uint8_t> serverNonce = ParseHex(m[\"SERVERNONCE\"]);\n            LogPrint(BCLog::TOR, \"tor: AUTHCHALLENGE ServerHash %s ServerNonce %s\\n\", HexStr(serverHash), HexStr(serverNonce));\n            if (serverNonce.size() != 32) {\n                LogPrintf(\"tor: ServerNonce is not 32 bytes, as required by spec\\n\");\n                return;\n            }\n\n            std::vector<uint8_t> computedServerHash = ComputeResponse(TOR_SAFE_SERVERKEY, cookie, clientNonce, serverNonce);\n            if (computedServerHash != serverHash) {\n                LogPrintf(\"tor: ServerHash %s does not match expected ServerHash %s\\n\", HexStr(serverHash), HexStr(computedServerHash));\n                return;\n            }\n\n            std::vector<uint8_t> computedClientHash = ComputeResponse(TOR_SAFE_CLIENTKEY, cookie, clientNonce, serverNonce);\n            _conn.Command(\"AUTHENTICATE \" + HexStr(computedClientHash), boost::bind(&TorController::auth_cb, this, _1, _2));\n        } else {\n            LogPrintf(\"tor: Invalid reply to AUTHCHALLENGE\\n\");\n        }\n    } else {\n        LogPrintf(\"tor: SAFECOOKIE authentication challenge failed\\n\");\n    }\n}\n\nvoid TorController::protocolinfo_cb(TorControlConnection& _conn, const TorControlReply& reply)\n{\n    if (reply.code == 250) {\n        std::set<std::string> methods;\n        std::string cookiefile;\n        /*\n         * 250-AUTH METHODS=COOKIE,SAFECOOKIE COOKIEFILE=\"/home/x/.tor/control_auth_cookie\"\n         * 250-AUTH METHODS=NULL\n         * 250-AUTH METHODS=HASHEDPASSWORD\n         */\n        for (const std::string &s : reply.lines) {\n            std::pair<std::string,std::string> l = SplitTorReplyLine(s);\n            if (l.first == \"AUTH\") {\n                std::map<std::string,std::string> m = ParseTorReplyMapping(l.second);\n                std::map<std::string,std::string>::iterator i;\n                if ((i = m.find(\"METHODS\")) != m.end())\n                    boost::split(methods, i->second, boost::is_any_of(\",\"));\n                if ((i = m.find(\"COOKIEFILE\")) != m.end())\n                    cookiefile = i->second;\n            } else if (l.first == \"VERSION\") {\n                std::map<std::string,std::string> m = ParseTorReplyMapping(l.second);\n                std::map<std::string,std::string>::iterator i;\n                if ((i = m.find(\"Tor\")) != m.end()) {\n                    LogPrint(BCLog::TOR, \"tor: Connected to Tor version %s\\n\", i->second);\n                }\n            }\n        }\n        for (const std::string &s : methods) {\n            LogPrint(BCLog::TOR, \"tor: Supported authentication method: %s\\n\", s);\n        }\n        // Prefer NULL, otherwise SAFECOOKIE. If a password is provided, use HASHEDPASSWORD\n        /* Authentication:\n         *   cookie:   hex-encoded ~/.tor/control_auth_cookie\n         *   password: \"password\"\n         */\n        std::string torpassword = gArgs.GetArg(\"-torpassword\", \"\");\n        if (!torpassword.empty()) {\n            if (methods.count(\"HASHEDPASSWORD\")) {\n                LogPrint(BCLog::TOR, \"tor: Using HASHEDPASSWORD authentication\\n\");\n                boost::replace_all(torpassword, \"\\\"\", \"\\\\\\\"\");\n                _conn.Command(\"AUTHENTICATE \\\"\" + torpassword + \"\\\"\", boost::bind(&TorController::auth_cb, this, _1, _2));\n            } else {\n                LogPrintf(\"tor: Password provided with -torpassword, but HASHEDPASSWORD authentication is not available\\n\");\n            }\n        } else if (methods.count(\"NULL\")) {\n            LogPrint(BCLog::TOR, \"tor: Using NULL authentication\\n\");\n            _conn.Command(\"AUTHENTICATE\", boost::bind(&TorController::auth_cb, this, _1, _2));\n        } else if (methods.count(\"SAFECOOKIE\")) {\n            // Cookie: hexdump -e '32/1 \"%02x\"\"\\n\"'  ~/.tor/control_auth_cookie\n            LogPrint(BCLog::TOR, \"tor: Using SAFECOOKIE authentication, reading cookie authentication from %s\\n\", cookiefile);\n            std::pair<bool,std::string> status_cookie = ReadBinaryFile(cookiefile, TOR_COOKIE_SIZE);\n            if (status_cookie.first && status_cookie.second.size() == TOR_COOKIE_SIZE) {\n                // _conn.Command(\"AUTHENTICATE \" + HexStr(status_cookie.second), boost::bind(&TorController::auth_cb, this, _1, _2));\n                cookie = std::vector<uint8_t>(status_cookie.second.begin(), status_cookie.second.end());\n                clientNonce = std::vector<uint8_t>(TOR_NONCE_SIZE, 0);\n                GetRandBytes(clientNonce.data(), TOR_NONCE_SIZE);\n                _conn.Command(\"AUTHCHALLENGE SAFECOOKIE \" + HexStr(clientNonce), boost::bind(&TorController::authchallenge_cb, this, _1, _2));\n            } else {\n                if (status_cookie.first) {\n                    LogPrintf(\"tor: Authentication cookie %s is not exactly %i bytes, as is required by the spec\\n\", cookiefile, TOR_COOKIE_SIZE);\n                } else {\n                    LogPrintf(\"tor: Authentication cookie %s could not be opened (check permissions)\\n\", cookiefile);\n                }\n            }\n        } else if (methods.count(\"HASHEDPASSWORD\")) {\n            LogPrintf(\"tor: The only supported authentication mechanism left is password, but no password provided with -torpassword\\n\");\n        } else {\n            LogPrintf(\"tor: No supported authentication method\\n\");\n        }\n    } else {\n        LogPrintf(\"tor: Requesting protocol info failed\\n\");\n    }\n}\n\nvoid TorController::connected_cb(TorControlConnection& _conn)\n{\n    reconnect_timeout = RECONNECT_TIMEOUT_START;\n    // First send a PROTOCOLINFO command to figure out what authentication is expected\n    if (!_conn.Command(\"PROTOCOLINFO 1\", boost::bind(&TorController::protocolinfo_cb, this, _1, _2)))\n        LogPrintf(\"tor: Error sending initial protocolinfo command\\n\");\n}\n\nvoid TorController::disconnected_cb(TorControlConnection& _conn)\n{\n    // Stop advertising service when disconnected\n    if (service.IsValid())\n        RemoveLocal(service);\n    service = CService();\n    if (!reconnect)\n        return;\n\n    LogPrint(BCLog::TOR, \"tor: Not connected to Tor control port %s, trying to reconnect\\n\", target);\n\n    // Single-shot timer for reconnect. Use exponential backoff.\n    struct timeval time = MillisToTimeval(int64_t(reconnect_timeout * 1000.0));\n    if (reconnect_ev)\n        event_add(reconnect_ev, &time);\n    reconnect_timeout *= RECONNECT_TIMEOUT_EXP;\n}\n\nvoid TorController::Reconnect()\n{\n    /* Try to reconnect and reestablish if we get booted - for example, Tor\n     * may be restarting.\n     */\n    if (!conn.Connect(target, boost::bind(&TorController::connected_cb, this, _1),\n         boost::bind(&TorController::disconnected_cb, this, _1) )) {\n        LogPrintf(\"tor: Re-initiating connection to Tor control port %s failed\\n\", target);\n    }\n}\n\nfs::path TorController::GetPrivateKeyFile()\n{\n    return GetDataDir() / \"onion_private_key\";\n}\n\nvoid TorController::reconnect_cb(evutil_socket_t fd, short what, void *arg)\n{\n    TorController *self = (TorController*)arg;\n    self->Reconnect();\n}\n\n/****** Thread ********/\nstatic struct event_base *gBase;\nstatic boost::thread torControlThread;\n\nstatic void TorControlThread()\n{\n    TorController ctrl(gBase, gArgs.GetArg(\"-torcontrol\", DEFAULT_TOR_CONTROL));\n\n    event_base_dispatch(gBase);\n}\n\nvoid StartTorControl(boost::thread_group& threadGroup, CScheduler& scheduler)\n{\n    assert(!gBase);\n#ifdef WIN32\n    evthread_use_windows_threads();\n#else\n    evthread_use_pthreads();\n#endif\n    gBase = event_base_new();\n    if (!gBase) {\n        LogPrintf(\"tor: Unable to create event_base\\n\");\n        return;\n    }\n\n    torControlThread = boost::thread(boost::bind(&TraceThread<void (*)()>, \"torcontrol\", &TorControlThread));\n}\n\nvoid InterruptTorControl()\n{\n    if (gBase) {\n        LogPrintf(\"tor: Thread interrupt\\n\");\n        event_base_loopbreak(gBase);\n    }\n}\n\nvoid StopTorControl()\n{\n    if (gBase) {\n        torControlThread.join();\n        event_base_free(gBase);\n        gBase = nullptr;\n    }\n}\n\n"
  },
  {
    "path": "src/torcontrol.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n/**\n * Functionality for communicating with Tor.\n */\n#ifndef BITCOIN_TORCONTROL_H\n#define BITCOIN_TORCONTROL_H\n\n#include <scheduler.h>\n\nextern const std::string DEFAULT_TOR_CONTROL;\nstatic const bool DEFAULT_LISTEN_ONION = true;\n\nvoid StartTorControl(boost::thread_group& threadGroup, CScheduler& scheduler);\nvoid InterruptTorControl();\nvoid StopTorControl();\n\n#endif /* BITCOIN_TORCONTROL_H */\n"
  },
  {
    "path": "src/txdb.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <txdb.h>\n\n#include <chainparams.h>\n#include <hash.h>\n#include <random.h>\n#include <pow.h>\n#include <uint256.h>\n#include <util.h>\n#include <ui_interface.h>\n#include <init.h>\n\n#include <stdint.h>\n\n#include <boost/thread.hpp>\n\nstatic const char DB_COIN = 'C';\nstatic const char DB_COINS = 'c';\nstatic const char DB_BLOCK_FILES = 'f';\nstatic const char DB_TXINDEX = 't';\nstatic const char DB_BLOCK_INDEX = 'b';\n\nstatic const char DB_BEST_BLOCK = 'B';\nstatic const char DB_HEAD_BLOCKS = 'H';\nstatic const char DB_FLAG = 'F';\nstatic const char DB_REINDEX_FLAG = 'R';\nstatic const char DB_LAST_BLOCK = 'l';\n\nnamespace {\n\nstruct CoinEntry {\n    COutPoint* outpoint;\n    char key;\n    explicit CoinEntry(const COutPoint* ptr) : outpoint(const_cast<COutPoint*>(ptr)), key(DB_COIN)  {}\n\n    template<typename Stream>\n    void Serialize(Stream &s) const {\n        s << key;\n        s << outpoint->hash;\n        s << VARINT(outpoint->n);\n    }\n\n    template<typename Stream>\n    void Unserialize(Stream& s) {\n        s >> key;\n        s >> outpoint->hash;\n        s >> VARINT(outpoint->n);\n    }\n};\n\n}\n\nCCoinsViewDB::CCoinsViewDB(size_t nCacheSize, bool fMemory, bool fWipe) : db(GetDataDir() / \"chainstate\", nCacheSize, fMemory, fWipe, true) \n{\n}\n\nbool CCoinsViewDB::GetCoin(const COutPoint &outpoint, Coin &coin) const {\n    return db.Read(CoinEntry(&outpoint), coin);\n}\n\nbool CCoinsViewDB::HaveCoin(const COutPoint &outpoint) const {\n    return db.Exists(CoinEntry(&outpoint));\n}\n\nuint256 CCoinsViewDB::GetBestBlock() const {\n    uint256 hashBestChain;\n    if (!db.Read(DB_BEST_BLOCK, hashBestChain))\n        return uint256();\n    return hashBestChain;\n}\n\nstd::vector<uint256> CCoinsViewDB::GetHeadBlocks() const {\n    std::vector<uint256> vhashHeadBlocks;\n    if (!db.Read(DB_HEAD_BLOCKS, vhashHeadBlocks)) {\n        return std::vector<uint256>();\n    }\n    return vhashHeadBlocks;\n}\n\nbool CCoinsViewDB::BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) {\n    CDBBatch batch(db);\n    size_t count = 0;\n    size_t changed = 0;\n    size_t batch_size = (size_t)gArgs.GetArg(\"-dbbatchsize\", nDefaultDbBatchSize);\n    int crash_simulate = gArgs.GetArg(\"-dbcrashratio\", 0);\n    assert(!hashBlock.IsNull());\n\n    uint256 old_tip = GetBestBlock();\n    if (old_tip.IsNull()) {\n        // We may be in the middle of replaying.\n        std::vector<uint256> old_heads = GetHeadBlocks();\n        if (old_heads.size() == 2) {\n            assert(old_heads[0] == hashBlock);\n            old_tip = old_heads[1];\n        }\n    }\n\n    // In the first batch, mark the database as being in the middle of a\n    // transition from old_tip to hashBlock.\n    // A vector is used for future extensibility, as we may want to support\n    // interrupting after partial writes from multiple independent reorgs.\n    batch.Erase(DB_BEST_BLOCK);\n    batch.Write(DB_HEAD_BLOCKS, std::vector<uint256>{hashBlock, old_tip});\n\n    for (CCoinsMap::iterator it = mapCoins.begin(); it != mapCoins.end();) {\n        if (it->second.flags & CCoinsCacheEntry::DIRTY) {\n            CoinEntry entry(&it->first);\n            if (it->second.coin.IsSpent())\n                batch.Erase(entry);\n            else\n                batch.Write(entry, it->second.coin);\n            changed++;\n        }\n        count++;\n        CCoinsMap::iterator itOld = it++;\n        mapCoins.erase(itOld);\n        if (batch.SizeEstimate() > batch_size) {\n            LogPrint(BCLog::COINDB, \"Writing partial batch of %.2f MiB\\n\", batch.SizeEstimate() * (1.0 / 1048576.0));\n            db.WriteBatch(batch);\n            batch.Clear();\n            if (crash_simulate) {\n                static FastRandomContext rng;\n                if (rng.randrange(crash_simulate) == 0) {\n                    LogPrintf(\"Simulating a crash. Goodbye.\\n\");\n                    _Exit(0);\n                }\n            }\n        }\n    }\n\n    // In the last batch, mark the database as consistent with hashBlock again.\n    batch.Erase(DB_HEAD_BLOCKS);\n    batch.Write(DB_BEST_BLOCK, hashBlock);\n\n    LogPrint(BCLog::COINDB, \"Writing final batch of %.2f MiB\\n\", batch.SizeEstimate() * (1.0 / 1048576.0));\n    bool ret = db.WriteBatch(batch);\n    LogPrint(BCLog::COINDB, \"Committed %u changed transaction outputs (out of %u) to coin database...\\n\", (unsigned int)changed, (unsigned int)count);\n    return ret;\n}\n\nsize_t CCoinsViewDB::EstimateSize() const\n{\n    return db.EstimateSize(DB_COIN, (char)(DB_COIN+1));\n}\n\nCBlockTreeDB::CBlockTreeDB(size_t nCacheSize, bool fMemory, bool fWipe) : CDBWrapper(GetDataDir() / \"blocks\" / \"index\", nCacheSize, fMemory, fWipe) {\n}\n\nbool CBlockTreeDB::ReadBlockFileInfo(int nFile, CBlockFileInfo &info) {\n    return Read(std::make_pair(DB_BLOCK_FILES, nFile), info);\n}\n\nbool CBlockTreeDB::WriteReindexing(bool fReindexing) {\n    if (fReindexing)\n        return Write(DB_REINDEX_FLAG, '1');\n    else\n        return Erase(DB_REINDEX_FLAG);\n}\n\nbool CBlockTreeDB::ReadReindexing(bool &fReindexing) {\n    fReindexing = Exists(DB_REINDEX_FLAG);\n    return true;\n}\n\nbool CBlockTreeDB::ReadLastBlockFile(int &nFile) {\n    return Read(DB_LAST_BLOCK, nFile);\n}\n\nCCoinsViewCursor *CCoinsViewDB::Cursor() const\n{\n    CCoinsViewDBCursor *i = new CCoinsViewDBCursor(const_cast<CDBWrapper&>(db).NewIterator(), GetBestBlock());\n    /* It seems that there are no \"const iterators\" for LevelDB.  Since we\n       only need read operations on it, use a const-cast to get around\n       that restriction.  */\n    i->pcursor->Seek(DB_COIN);\n    // Cache key of first record\n    if (i->pcursor->Valid()) {\n        CoinEntry entry(&i->keyTmp.second);\n        i->pcursor->GetKey(entry);\n        i->keyTmp.first = entry.key;\n    } else {\n        i->keyTmp.first = 0; // Make sure Valid() and GetKey() return false\n    }\n    return i;\n}\n\nbool CCoinsViewDBCursor::GetKey(COutPoint &key) const\n{\n    // Return cached key\n    if (keyTmp.first == DB_COIN) {\n        key = keyTmp.second;\n        return true;\n    }\n    return false;\n}\n\nbool CCoinsViewDBCursor::GetValue(Coin &coin) const\n{\n    return pcursor->GetValue(coin);\n}\n\nunsigned int CCoinsViewDBCursor::GetValueSize() const\n{\n    return pcursor->GetValueSize();\n}\n\nbool CCoinsViewDBCursor::Valid() const\n{\n    return keyTmp.first == DB_COIN;\n}\n\nvoid CCoinsViewDBCursor::Next()\n{\n    pcursor->Next();\n    CoinEntry entry(&keyTmp.second);\n    if (!pcursor->Valid() || !pcursor->GetKey(entry)) {\n        keyTmp.first = 0; // Invalidate cached key after last record so that Valid() and GetKey() return false\n    } else {\n        keyTmp.first = entry.key;\n    }\n}\n\nbool CBlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo) {\n    CDBBatch batch(*this);\n    for (std::vector<std::pair<int, const CBlockFileInfo*> >::const_iterator it=fileInfo.begin(); it != fileInfo.end(); it++) {\n        batch.Write(std::make_pair(DB_BLOCK_FILES, it->first), *it->second);\n    }\n    batch.Write(DB_LAST_BLOCK, nLastFile);\n    for (std::vector<const CBlockIndex*>::const_iterator it=blockinfo.begin(); it != blockinfo.end(); it++) {\n        batch.Write(std::make_pair(DB_BLOCK_INDEX, (*it)->GetBlockHash()), CDiskBlockIndex(*it));\n    }\n    return WriteBatch(batch, true);\n}\n\nbool CBlockTreeDB::ReadTxIndex(const uint256 &txid, CDiskTxPos &pos) {\n    return Read(std::make_pair(DB_TXINDEX, txid), pos);\n}\n\nbool CBlockTreeDB::WriteTxIndex(const std::vector<std::pair<uint256, CDiskTxPos> >&vect) {\n    CDBBatch batch(*this);\n    for (std::vector<std::pair<uint256,CDiskTxPos> >::const_iterator it=vect.begin(); it!=vect.end(); it++)\n        batch.Write(std::make_pair(DB_TXINDEX, it->first), it->second);\n    return WriteBatch(batch);\n}\n\nbool CBlockTreeDB::WriteFlag(const std::string &name, bool fValue) {\n    return Write(std::make_pair(DB_FLAG, name), fValue ? '1' : '0');\n}\n\nbool CBlockTreeDB::ReadFlag(const std::string &name, bool &fValue) {\n    char ch;\n    if (!Read(std::make_pair(DB_FLAG, name), ch))\n        return false;\n    fValue = ch == '1';\n    return true;\n}\n\nbool CBlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function<CBlockIndex*(const uint256&)> insertBlockIndex)\n{\n    std::unique_ptr<CDBIterator> pcursor(NewIterator());\n\n    pcursor->Seek(std::make_pair(DB_BLOCK_INDEX, uint256()));\n\n    // Load mapBlockIndex\n    while (pcursor->Valid()) {\n        boost::this_thread::interruption_point();\n        std::pair<char, uint256> key;\n        if (pcursor->GetKey(key) && key.first == DB_BLOCK_INDEX) {\n            CDiskBlockIndex diskindex;\n            if (pcursor->GetValue(diskindex)) {\n                // Construct block index object\n                CBlockIndex* pindexNew = insertBlockIndex(diskindex.GetBlockHash());\n                pindexNew->pprev          = insertBlockIndex(diskindex.hashPrev);\n                pindexNew->nHeight        = diskindex.nHeight;\n                pindexNew->nFile          = diskindex.nFile;\n                pindexNew->nDataPos       = diskindex.nDataPos;\n                pindexNew->nUndoPos       = diskindex.nUndoPos;\n                pindexNew->nVersion       = diskindex.nVersion;\n                pindexNew->hashMerkleRoot = diskindex.hashMerkleRoot;\n                pindexNew->nTime          = diskindex.nTime;\n                pindexNew->nBits          = diskindex.nBits;\n                pindexNew->nNonce         = diskindex.nNonce;\n                pindexNew->nStatus        = diskindex.nStatus;\n                pindexNew->nTx            = diskindex.nTx;\n\n                // FIXME.SUGAR // SURE?\n                // Litecoin: Disable PoW Sanity check while loading block index from disk.\n                // We use the sha256 hash for the block index for performance reasons, which is recorded for later use.\n                // CheckProofOfWork() uses the scrypt hash which is discarded after a block is accepted.\n                // While it is technically feasible to verify the PoW, doing so takes several minutes as it\n                // requires recomputing every PoW hash during every Litecoin startup.\n                // We opt instead to simply trust the data that is on your local disk.\n\n                //if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits, consensusParams))\n                //    return error(\"%s: CheckProofOfWork failed: %s\", __func__, pindexNew->ToString());\n\n                pcursor->Next();\n            } else {\n                return error(\"%s: failed to read value\", __func__);\n            }\n        } else {\n            break;\n        }\n    }\n\n    return true;\n}\n\nnamespace {\n\n//! Legacy class to deserialize pre-pertxout database entries without reindex.\nclass CCoins\n{\npublic:\n    //! whether transaction is a coinbase\n    bool fCoinBase;\n\n    //! unspent transaction outputs; spent outputs are .IsNull(); spent outputs at the end of the array are dropped\n    std::vector<CTxOut> vout;\n\n    //! at which height this transaction was included in the active block chain\n    int nHeight;\n\n    //! empty constructor\n    CCoins() : fCoinBase(false), vout(0), nHeight(0) { }\n\n    template<typename Stream>\n    void Unserialize(Stream &s) {\n        unsigned int nCode = 0;\n        // version\n        int nVersionDummy;\n        ::Unserialize(s, VARINT(nVersionDummy));\n        // header code\n        ::Unserialize(s, VARINT(nCode));\n        fCoinBase = nCode & 1;\n        std::vector<bool> vAvail(2, false);\n        vAvail[0] = (nCode & 2) != 0;\n        vAvail[1] = (nCode & 4) != 0;\n        unsigned int nMaskCode = (nCode / 8) + ((nCode & 6) != 0 ? 0 : 1);\n        // spentness bitmask\n        while (nMaskCode > 0) {\n            unsigned char chAvail = 0;\n            ::Unserialize(s, chAvail);\n            for (unsigned int p = 0; p < 8; p++) {\n                bool f = (chAvail & (1 << p)) != 0;\n                vAvail.push_back(f);\n            }\n            if (chAvail != 0)\n                nMaskCode--;\n        }\n        // txouts themself\n        vout.assign(vAvail.size(), CTxOut());\n        for (unsigned int i = 0; i < vAvail.size(); i++) {\n            if (vAvail[i])\n                ::Unserialize(s, REF(CTxOutCompressor(vout[i])));\n        }\n        // coinbase height\n        ::Unserialize(s, VARINT(nHeight));\n    }\n};\n\n}\n\n/** Upgrade the database from older formats.\n *\n * Currently implemented: from the per-tx utxo model (0.8..0.14.x) to per-txout.\n */\nbool CCoinsViewDB::Upgrade() {\n    std::unique_ptr<CDBIterator> pcursor(db.NewIterator());\n    pcursor->Seek(std::make_pair(DB_COINS, uint256()));\n    if (!pcursor->Valid()) {\n        return true;\n    }\n\n    int64_t count = 0;\n    LogPrintf(\"Upgrading utxo-set database...\\n\");\n    LogPrintf(\"[0%%]...\");\n    uiInterface.ShowProgress(_(\"Upgrading UTXO database\"), 0, true);\n    size_t batch_size = 1 << 24;\n    CDBBatch batch(db);\n    int reportDone = 0;\n    std::pair<unsigned char, uint256> key;\n    std::pair<unsigned char, uint256> prev_key = {DB_COINS, uint256()};\n    while (pcursor->Valid()) {\n        boost::this_thread::interruption_point();\n        if (ShutdownRequested()) {\n            break;\n        }\n        if (pcursor->GetKey(key) && key.first == DB_COINS) {\n            if (count++ % 256 == 0) {\n                uint32_t high = 0x100 * *key.second.begin() + *(key.second.begin() + 1);\n                int percentageDone = (int)(high * 100.0 / 65536.0 + 0.5);\n                uiInterface.ShowProgress(_(\"Upgrading UTXO database\"), percentageDone, true);\n                if (reportDone < percentageDone/10) {\n                    // report max. every 10% step\n                    LogPrintf(\"[%d%%]...\", percentageDone);\n                    reportDone = percentageDone/10;\n                }\n            }\n            CCoins old_coins;\n            if (!pcursor->GetValue(old_coins)) {\n                return error(\"%s: cannot parse CCoins record\", __func__);\n            }\n            COutPoint outpoint(key.second, 0);\n            for (size_t i = 0; i < old_coins.vout.size(); ++i) {\n                if (!old_coins.vout[i].IsNull() && !old_coins.vout[i].scriptPubKey.IsUnspendable()) {\n                    Coin newcoin(std::move(old_coins.vout[i]), old_coins.nHeight, old_coins.fCoinBase);\n                    outpoint.n = i;\n                    CoinEntry entry(&outpoint);\n                    batch.Write(entry, newcoin);\n                }\n            }\n            batch.Erase(key);\n            if (batch.SizeEstimate() > batch_size) {\n                db.WriteBatch(batch);\n                batch.Clear();\n                db.CompactRange(prev_key, key);\n                prev_key = key;\n            }\n            pcursor->Next();\n        } else {\n            break;\n        }\n    }\n    db.WriteBatch(batch);\n    db.CompactRange({DB_COINS, uint256()}, key);\n    uiInterface.ShowProgress(\"\", 100, false);\n    LogPrintf(\"[%s].\\n\", ShutdownRequested() ? \"CANCELLED\" : \"DONE\");\n    return !ShutdownRequested();\n}\n"
  },
  {
    "path": "src/txdb.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_TXDB_H\n#define BITCOIN_TXDB_H\n\n#include <coins.h>\n#include <dbwrapper.h>\n#include <chain.h>\n\n#include <map>\n#include <memory>\n#include <string>\n#include <utility>\n#include <vector>\n\nclass CBlockIndex;\nclass CCoinsViewDBCursor;\nclass uint256;\n\n//! No need to periodic flush if at least this much space still available.\nstatic constexpr int MAX_BLOCK_COINSDB_USAGE = 10;\n//! -dbcache default (MiB)\nstatic const int64_t nDefaultDbCache = 450;\n//! -dbbatchsize default (bytes)\nstatic const int64_t nDefaultDbBatchSize = 16 << 20;\n//! max. -dbcache (MiB)\nstatic const int64_t nMaxDbCache = sizeof(void*) > 4 ? 16384 : 1024;\n//! min. -dbcache (MiB)\nstatic const int64_t nMinDbCache = 4;\n//! Max memory allocated to block tree DB specific cache, if no -txindex (MiB)\nstatic const int64_t nMaxBlockDBCache = 2;\n//! Max memory allocated to block tree DB specific cache, if -txindex (MiB)\n// Unlike for the UTXO database, for the txindex scenario the leveldb cache make\n// a meaningful difference: https://github.com/bitcoin/bitcoin/pull/8273#issuecomment-229601991\nstatic const int64_t nMaxBlockDBAndTxIndexCache = 1024;\n//! Max memory allocated to coin DB specific cache (MiB)\nstatic const int64_t nMaxCoinsDBCache = 8;\n\nstruct CDiskTxPos : public CDiskBlockPos\n{\n    unsigned int nTxOffset; // after header\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(*(CDiskBlockPos*)this);\n        READWRITE(VARINT(nTxOffset));\n    }\n\n    CDiskTxPos(const CDiskBlockPos &blockIn, unsigned int nTxOffsetIn) : CDiskBlockPos(blockIn.nFile, blockIn.nPos), nTxOffset(nTxOffsetIn) {\n    }\n\n    CDiskTxPos() {\n        SetNull();\n    }\n\n    void SetNull() {\n        CDiskBlockPos::SetNull();\n        nTxOffset = 0;\n    }\n};\n\n/** CCoinsView backed by the coin database (chainstate/) */\nclass CCoinsViewDB final : public CCoinsView\n{\nprotected:\n    CDBWrapper db;\npublic:\n    explicit CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false);\n\n    bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;\n    bool HaveCoin(const COutPoint &outpoint) const override;\n    uint256 GetBestBlock() const override;\n    std::vector<uint256> GetHeadBlocks() const override;\n    bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override;\n    CCoinsViewCursor *Cursor() const override;\n\n    //! Attempt to update from an older database format. Returns whether an error occurred.\n    bool Upgrade();\n    size_t EstimateSize() const override;\n};\n\n/** Specialization of CCoinsViewCursor to iterate over a CCoinsViewDB */\nclass CCoinsViewDBCursor: public CCoinsViewCursor\n{\npublic:\n    ~CCoinsViewDBCursor() {}\n\n    bool GetKey(COutPoint &key) const override;\n    bool GetValue(Coin &coin) const override;\n    unsigned int GetValueSize() const override;\n\n    bool Valid() const override;\n    void Next() override;\n\nprivate:\n    CCoinsViewDBCursor(CDBIterator* pcursorIn, const uint256 &hashBlockIn):\n        CCoinsViewCursor(hashBlockIn), pcursor(pcursorIn) {}\n    std::unique_ptr<CDBIterator> pcursor;\n    std::pair<char, COutPoint> keyTmp;\n\n    friend class CCoinsViewDB;\n};\n\n/** Access to the block database (blocks/index/) */\nclass CBlockTreeDB : public CDBWrapper\n{\npublic:\n    explicit CBlockTreeDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false);\n\n    CBlockTreeDB(const CBlockTreeDB&) = delete;\n    CBlockTreeDB& operator=(const CBlockTreeDB&) = delete;\n\n    bool WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo);\n    bool ReadBlockFileInfo(int nFile, CBlockFileInfo &info);\n    bool ReadLastBlockFile(int &nFile);\n    bool WriteReindexing(bool fReindexing);\n    bool ReadReindexing(bool &fReindexing);\n    bool ReadTxIndex(const uint256 &txid, CDiskTxPos &pos);\n    bool WriteTxIndex(const std::vector<std::pair<uint256, CDiskTxPos> > &vect);\n    bool WriteFlag(const std::string &name, bool fValue);\n    bool ReadFlag(const std::string &name, bool &fValue);\n    bool LoadBlockIndexGuts(const Consensus::Params& consensusParams, std::function<CBlockIndex*(const uint256&)> insertBlockIndex);\n};\n\n#endif // BITCOIN_TXDB_H\n"
  },
  {
    "path": "src/txmempool.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <txmempool.h>\n\n#include <consensus/consensus.h>\n#include <consensus/tx_verify.h>\n#include <consensus/validation.h>\n#include <validation.h>\n#include <policy/policy.h>\n#include <policy/fees.h>\n#include <reverse_iterator.h>\n#include <streams.h>\n#include <timedata.h>\n#include <util.h>\n#include <utilmoneystr.h>\n#include <utiltime.h>\n\nCTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee,\n                                 int64_t _nTime, unsigned int _entryHeight,\n                                 bool _spendsCoinbase, int64_t _sigOpsCost, LockPoints lp):\n    tx(_tx), nFee(_nFee), nTime(_nTime), entryHeight(_entryHeight),\n    spendsCoinbase(_spendsCoinbase), sigOpCost(_sigOpsCost), lockPoints(lp)\n{\n    nTxWeight = GetTransactionWeight(*tx);\n    nUsageSize = RecursiveDynamicUsage(tx);\n\n    nCountWithDescendants = 1;\n    nSizeWithDescendants = GetTxSize();\n    nModFeesWithDescendants = nFee;\n\n    feeDelta = 0;\n\n    nCountWithAncestors = 1;\n    nSizeWithAncestors = GetTxSize();\n    nModFeesWithAncestors = nFee;\n    nSigOpCostWithAncestors = sigOpCost;\n}\n\nvoid CTxMemPoolEntry::UpdateFeeDelta(int64_t newFeeDelta)\n{\n    nModFeesWithDescendants += newFeeDelta - feeDelta;\n    nModFeesWithAncestors += newFeeDelta - feeDelta;\n    feeDelta = newFeeDelta;\n}\n\nvoid CTxMemPoolEntry::UpdateLockPoints(const LockPoints& lp)\n{\n    lockPoints = lp;\n}\n\nsize_t CTxMemPoolEntry::GetTxSize() const\n{\n    return GetVirtualTransactionSize(nTxWeight, sigOpCost);\n}\n\n// Update the given tx for any in-mempool descendants.\n// Assumes that setMemPoolChildren is correct for the given tx and all\n// descendants.\nvoid CTxMemPool::UpdateForDescendants(txiter updateIt, cacheMap &cachedDescendants, const std::set<uint256> &setExclude)\n{\n    setEntries stageEntries, setAllDescendants;\n    stageEntries = GetMemPoolChildren(updateIt);\n\n    while (!stageEntries.empty()) {\n        const txiter cit = *stageEntries.begin();\n        setAllDescendants.insert(cit);\n        stageEntries.erase(cit);\n        const setEntries &setChildren = GetMemPoolChildren(cit);\n        for (const txiter childEntry : setChildren) {\n            cacheMap::iterator cacheIt = cachedDescendants.find(childEntry);\n            if (cacheIt != cachedDescendants.end()) {\n                // We've already calculated this one, just add the entries for this set\n                // but don't traverse again.\n                for (const txiter cacheEntry : cacheIt->second) {\n                    setAllDescendants.insert(cacheEntry);\n                }\n            } else if (!setAllDescendants.count(childEntry)) {\n                // Schedule for later processing\n                stageEntries.insert(childEntry);\n            }\n        }\n    }\n    // setAllDescendants now contains all in-mempool descendants of updateIt.\n    // Update and add to cached descendant map\n    int64_t modifySize = 0;\n    CAmount modifyFee = 0;\n    int64_t modifyCount = 0;\n    for (txiter cit : setAllDescendants) {\n        if (!setExclude.count(cit->GetTx().GetHash())) {\n            modifySize += cit->GetTxSize();\n            modifyFee += cit->GetModifiedFee();\n            modifyCount++;\n            cachedDescendants[updateIt].insert(cit);\n            // Update ancestor state for each descendant\n            mapTx.modify(cit, update_ancestor_state(updateIt->GetTxSize(), updateIt->GetModifiedFee(), 1, updateIt->GetSigOpCost()));\n        }\n    }\n    mapTx.modify(updateIt, update_descendant_state(modifySize, modifyFee, modifyCount));\n}\n\n// vHashesToUpdate is the set of transaction hashes from a disconnected block\n// which has been re-added to the mempool.\n// for each entry, look for descendants that are outside vHashesToUpdate, and\n// add fee/size information for such descendants to the parent.\n// for each such descendant, also update the ancestor state to include the parent.\nvoid CTxMemPool::UpdateTransactionsFromBlock(const std::vector<uint256> &vHashesToUpdate)\n{\n    LOCK(cs);\n    // For each entry in vHashesToUpdate, store the set of in-mempool, but not\n    // in-vHashesToUpdate transactions, so that we don't have to recalculate\n    // descendants when we come across a previously seen entry.\n    cacheMap mapMemPoolDescendantsToUpdate;\n\n    // Use a set for lookups into vHashesToUpdate (these entries are already\n    // accounted for in the state of their ancestors)\n    std::set<uint256> setAlreadyIncluded(vHashesToUpdate.begin(), vHashesToUpdate.end());\n\n    // Iterate in reverse, so that whenever we are looking at a transaction\n    // we are sure that all in-mempool descendants have already been processed.\n    // This maximizes the benefit of the descendant cache and guarantees that\n    // setMemPoolChildren will be updated, an assumption made in\n    // UpdateForDescendants.\n    for (const uint256 &hash : reverse_iterate(vHashesToUpdate)) {\n        // we cache the in-mempool children to avoid duplicate updates\n        setEntries setChildren;\n        // calculate children from mapNextTx\n        txiter it = mapTx.find(hash);\n        if (it == mapTx.end()) {\n            continue;\n        }\n        auto iter = mapNextTx.lower_bound(COutPoint(hash, 0));\n        // First calculate the children, and update setMemPoolChildren to\n        // include them, and update their setMemPoolParents to include this tx.\n        for (; iter != mapNextTx.end() && iter->first->hash == hash; ++iter) {\n            const uint256 &childHash = iter->second->GetHash();\n            txiter childIter = mapTx.find(childHash);\n            assert(childIter != mapTx.end());\n            // We can skip updating entries we've encountered before or that\n            // are in the block (which are already accounted for).\n            if (setChildren.insert(childIter).second && !setAlreadyIncluded.count(childHash)) {\n                UpdateChild(it, childIter, true);\n                UpdateParent(childIter, it, true);\n            }\n        }\n        UpdateForDescendants(it, mapMemPoolDescendantsToUpdate, setAlreadyIncluded);\n    }\n}\n\nbool CTxMemPool::CalculateMemPoolAncestors(const CTxMemPoolEntry &entry, setEntries &setAncestors, uint64_t limitAncestorCount, uint64_t limitAncestorSize, uint64_t limitDescendantCount, uint64_t limitDescendantSize, std::string &errString, bool fSearchForParents /* = true */) const\n{\n    LOCK(cs);\n\n    setEntries parentHashes;\n    const CTransaction &tx = entry.GetTx();\n\n    if (fSearchForParents) {\n        // Get parents of this transaction that are in the mempool\n        // GetMemPoolParents() is only valid for entries in the mempool, so we\n        // iterate mapTx to find parents.\n        for (unsigned int i = 0; i < tx.vin.size(); i++) {\n            txiter piter = mapTx.find(tx.vin[i].prevout.hash);\n            if (piter != mapTx.end()) {\n                parentHashes.insert(piter);\n                if (parentHashes.size() + 1 > limitAncestorCount) {\n                    errString = strprintf(\"too many unconfirmed parents [limit: %u]\", limitAncestorCount);\n                    return false;\n                }\n            }\n        }\n    } else {\n        // If we're not searching for parents, we require this to be an\n        // entry in the mempool already.\n        txiter it = mapTx.iterator_to(entry);\n        parentHashes = GetMemPoolParents(it);\n    }\n\n    size_t totalSizeWithAncestors = entry.GetTxSize();\n\n    while (!parentHashes.empty()) {\n        txiter stageit = *parentHashes.begin();\n\n        setAncestors.insert(stageit);\n        parentHashes.erase(stageit);\n        totalSizeWithAncestors += stageit->GetTxSize();\n\n        if (stageit->GetSizeWithDescendants() + entry.GetTxSize() > limitDescendantSize) {\n            errString = strprintf(\"exceeds descendant size limit for tx %s [limit: %u]\", stageit->GetTx().GetHash().ToString(), limitDescendantSize);\n            return false;\n        } else if (stageit->GetCountWithDescendants() + 1 > limitDescendantCount) {\n            errString = strprintf(\"too many descendants for tx %s [limit: %u]\", stageit->GetTx().GetHash().ToString(), limitDescendantCount);\n            return false;\n        } else if (totalSizeWithAncestors > limitAncestorSize) {\n            errString = strprintf(\"exceeds ancestor size limit [limit: %u]\", limitAncestorSize);\n            return false;\n        }\n\n        const setEntries & setMemPoolParents = GetMemPoolParents(stageit);\n        for (const txiter &phash : setMemPoolParents) {\n            // If this is a new ancestor, add it.\n            if (setAncestors.count(phash) == 0) {\n                parentHashes.insert(phash);\n            }\n            if (parentHashes.size() + setAncestors.size() + 1 > limitAncestorCount) {\n                errString = strprintf(\"too many unconfirmed ancestors [limit: %u]\", limitAncestorCount);\n                return false;\n            }\n        }\n    }\n\n    return true;\n}\n\nvoid CTxMemPool::UpdateAncestorsOf(bool add, txiter it, setEntries &setAncestors)\n{\n    setEntries parentIters = GetMemPoolParents(it);\n    // add or remove this tx as a child of each parent\n    for (txiter piter : parentIters) {\n        UpdateChild(piter, it, add);\n    }\n    const int64_t updateCount = (add ? 1 : -1);\n    const int64_t updateSize = updateCount * it->GetTxSize();\n    const CAmount updateFee = updateCount * it->GetModifiedFee();\n    for (txiter ancestorIt : setAncestors) {\n        mapTx.modify(ancestorIt, update_descendant_state(updateSize, updateFee, updateCount));\n    }\n}\n\nvoid CTxMemPool::UpdateEntryForAncestors(txiter it, const setEntries &setAncestors)\n{\n    int64_t updateCount = setAncestors.size();\n    int64_t updateSize = 0;\n    CAmount updateFee = 0;\n    int64_t updateSigOpsCost = 0;\n    for (txiter ancestorIt : setAncestors) {\n        updateSize += ancestorIt->GetTxSize();\n        updateFee += ancestorIt->GetModifiedFee();\n        updateSigOpsCost += ancestorIt->GetSigOpCost();\n    }\n    mapTx.modify(it, update_ancestor_state(updateSize, updateFee, updateCount, updateSigOpsCost));\n}\n\nvoid CTxMemPool::UpdateChildrenForRemoval(txiter it)\n{\n    const setEntries &setMemPoolChildren = GetMemPoolChildren(it);\n    for (txiter updateIt : setMemPoolChildren) {\n        UpdateParent(updateIt, it, false);\n    }\n}\n\nvoid CTxMemPool::UpdateForRemoveFromMempool(const setEntries &entriesToRemove, bool updateDescendants)\n{\n    // For each entry, walk back all ancestors and decrement size associated with this\n    // transaction\n    const uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();\n    if (updateDescendants) {\n        // updateDescendants should be true whenever we're not recursively\n        // removing a tx and all its descendants, eg when a transaction is\n        // confirmed in a block.\n        // Here we only update statistics and not data in mapLinks (which\n        // we need to preserve until we're finished with all operations that\n        // need to traverse the mempool).\n        for (txiter removeIt : entriesToRemove) {\n            setEntries setDescendants;\n            CalculateDescendants(removeIt, setDescendants);\n            setDescendants.erase(removeIt); // don't update state for self\n            int64_t modifySize = -((int64_t)removeIt->GetTxSize());\n            CAmount modifyFee = -removeIt->GetModifiedFee();\n            int modifySigOps = -removeIt->GetSigOpCost();\n            for (txiter dit : setDescendants) {\n                mapTx.modify(dit, update_ancestor_state(modifySize, modifyFee, -1, modifySigOps));\n            }\n        }\n    }\n    for (txiter removeIt : entriesToRemove) {\n        setEntries setAncestors;\n        const CTxMemPoolEntry &entry = *removeIt;\n        std::string dummy;\n        // Since this is a tx that is already in the mempool, we can call CMPA\n        // with fSearchForParents = false.  If the mempool is in a consistent\n        // state, then using true or false should both be correct, though false\n        // should be a bit faster.\n        // However, if we happen to be in the middle of processing a reorg, then\n        // the mempool can be in an inconsistent state.  In this case, the set\n        // of ancestors reachable via mapLinks will be the same as the set of \n        // ancestors whose packages include this transaction, because when we\n        // add a new transaction to the mempool in addUnchecked(), we assume it\n        // has no children, and in the case of a reorg where that assumption is\n        // false, the in-mempool children aren't linked to the in-block tx's\n        // until UpdateTransactionsFromBlock() is called.\n        // So if we're being called during a reorg, ie before\n        // UpdateTransactionsFromBlock() has been called, then mapLinks[] will\n        // differ from the set of mempool parents we'd calculate by searching,\n        // and it's important that we use the mapLinks[] notion of ancestor\n        // transactions as the set of things to update for removal.\n        CalculateMemPoolAncestors(entry, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy, false);\n        // Note that UpdateAncestorsOf severs the child links that point to\n        // removeIt in the entries for the parents of removeIt.\n        UpdateAncestorsOf(false, removeIt, setAncestors);\n    }\n    // After updating all the ancestor sizes, we can now sever the link between each\n    // transaction being removed and any mempool children (ie, update setMemPoolParents\n    // for each direct child of a transaction being removed).\n    for (txiter removeIt : entriesToRemove) {\n        UpdateChildrenForRemoval(removeIt);\n    }\n}\n\nvoid CTxMemPoolEntry::UpdateDescendantState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount)\n{\n    nSizeWithDescendants += modifySize;\n    assert(int64_t(nSizeWithDescendants) > 0);\n    nModFeesWithDescendants += modifyFee;\n    nCountWithDescendants += modifyCount;\n    assert(int64_t(nCountWithDescendants) > 0);\n}\n\nvoid CTxMemPoolEntry::UpdateAncestorState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount, int64_t modifySigOps)\n{\n    nSizeWithAncestors += modifySize;\n    assert(int64_t(nSizeWithAncestors) > 0);\n    nModFeesWithAncestors += modifyFee;\n    nCountWithAncestors += modifyCount;\n    assert(int64_t(nCountWithAncestors) > 0);\n    nSigOpCostWithAncestors += modifySigOps;\n    assert(int(nSigOpCostWithAncestors) >= 0);\n}\n\nCTxMemPool::CTxMemPool(CBlockPolicyEstimator* estimator) :\n    nTransactionsUpdated(0), minerPolicyEstimator(estimator)\n{\n    _clear(); //lock free clear\n\n    // Sanity checks off by default for performance, because otherwise\n    // accepting transactions becomes O(N^2) where N is the number\n    // of transactions in the pool\n    nCheckFrequency = 0;\n}\n\nbool CTxMemPool::isSpent(const COutPoint& outpoint)\n{\n    LOCK(cs);\n    return mapNextTx.count(outpoint);\n}\n\nunsigned int CTxMemPool::GetTransactionsUpdated() const\n{\n    LOCK(cs);\n    return nTransactionsUpdated;\n}\n\nvoid CTxMemPool::AddTransactionsUpdated(unsigned int n)\n{\n    LOCK(cs);\n    nTransactionsUpdated += n;\n}\n\nbool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, setEntries &setAncestors, bool validFeeEstimate)\n{\n    NotifyEntryAdded(entry.GetSharedTx());\n    // Add to memory pool without checking anything.\n    // Used by AcceptToMemoryPool(), which DOES do\n    // all the appropriate checks.\n    LOCK(cs);\n    indexed_transaction_set::iterator newit = mapTx.insert(entry).first;\n    mapLinks.insert(make_pair(newit, TxLinks()));\n\n    // Update transaction for any feeDelta created by PrioritiseTransaction\n    // TODO: refactor so that the fee delta is calculated before inserting\n    // into mapTx.\n    std::map<uint256, CAmount>::const_iterator pos = mapDeltas.find(hash);\n    if (pos != mapDeltas.end()) {\n        const CAmount &delta = pos->second;\n        if (delta) {\n            mapTx.modify(newit, update_fee_delta(delta));\n        }\n    }\n\n    // Update cachedInnerUsage to include contained transaction's usage.\n    // (When we update the entry for in-mempool parents, memory usage will be\n    // further updated.)\n    cachedInnerUsage += entry.DynamicMemoryUsage();\n\n    const CTransaction& tx = newit->GetTx();\n    std::set<uint256> setParentTransactions;\n    for (unsigned int i = 0; i < tx.vin.size(); i++) {\n        mapNextTx.insert(std::make_pair(&tx.vin[i].prevout, &tx));\n        setParentTransactions.insert(tx.vin[i].prevout.hash);\n    }\n    // Don't bother worrying about child transactions of this one.\n    // Normal case of a new transaction arriving is that there can't be any\n    // children, because such children would be orphans.\n    // An exception to that is if a transaction enters that used to be in a block.\n    // In that case, our disconnect block logic will call UpdateTransactionsFromBlock\n    // to clean up the mess we're leaving here.\n\n    // Update ancestors with information about this tx\n    for (const uint256 &phash : setParentTransactions) {\n        txiter pit = mapTx.find(phash);\n        if (pit != mapTx.end()) {\n            UpdateParent(newit, pit, true);\n        }\n    }\n    UpdateAncestorsOf(true, newit, setAncestors);\n    UpdateEntryForAncestors(newit, setAncestors);\n\n    nTransactionsUpdated++;\n    totalTxSize += entry.GetTxSize();\n    if (minerPolicyEstimator) {minerPolicyEstimator->processTransaction(entry, validFeeEstimate);}\n\n    vTxHashes.emplace_back(tx.GetWitnessHash(), newit);\n    newit->vTxHashesIdx = vTxHashes.size() - 1;\n\n    return true;\n}\n\nvoid CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason)\n{\n    NotifyEntryRemoved(it->GetSharedTx(), reason);\n    const uint256 hash = it->GetTx().GetHash();\n    for (const CTxIn& txin : it->GetTx().vin)\n        mapNextTx.erase(txin.prevout);\n\n    if (vTxHashes.size() > 1) {\n        vTxHashes[it->vTxHashesIdx] = std::move(vTxHashes.back());\n        vTxHashes[it->vTxHashesIdx].second->vTxHashesIdx = it->vTxHashesIdx;\n        vTxHashes.pop_back();\n        if (vTxHashes.size() * 2 < vTxHashes.capacity())\n            vTxHashes.shrink_to_fit();\n    } else\n        vTxHashes.clear();\n\n    totalTxSize -= it->GetTxSize();\n    cachedInnerUsage -= it->DynamicMemoryUsage();\n    cachedInnerUsage -= memusage::DynamicUsage(mapLinks[it].parents) + memusage::DynamicUsage(mapLinks[it].children);\n    mapLinks.erase(it);\n    mapTx.erase(it);\n    nTransactionsUpdated++;\n    if (minerPolicyEstimator) {minerPolicyEstimator->removeTx(hash, false);}\n}\n\n// Calculates descendants of entry that are not already in setDescendants, and adds to\n// setDescendants. Assumes entryit is already a tx in the mempool and setMemPoolChildren\n// is correct for tx and all descendants.\n// Also assumes that if an entry is in setDescendants already, then all\n// in-mempool descendants of it are already in setDescendants as well, so that we\n// can save time by not iterating over those entries.\nvoid CTxMemPool::CalculateDescendants(txiter entryit, setEntries &setDescendants)\n{\n    setEntries stage;\n    if (setDescendants.count(entryit) == 0) {\n        stage.insert(entryit);\n    }\n    // Traverse down the children of entry, only adding children that are not\n    // accounted for in setDescendants already (because those children have either\n    // already been walked, or will be walked in this iteration).\n    while (!stage.empty()) {\n        txiter it = *stage.begin();\n        setDescendants.insert(it);\n        stage.erase(it);\n\n        const setEntries &setChildren = GetMemPoolChildren(it);\n        for (const txiter &childiter : setChildren) {\n            if (!setDescendants.count(childiter)) {\n                stage.insert(childiter);\n            }\n        }\n    }\n}\n\nvoid CTxMemPool::removeRecursive(const CTransaction &origTx, MemPoolRemovalReason reason)\n{\n    // Remove transaction from memory pool\n    {\n        LOCK(cs);\n        setEntries txToRemove;\n        txiter origit = mapTx.find(origTx.GetHash());\n        if (origit != mapTx.end()) {\n            txToRemove.insert(origit);\n        } else {\n            // When recursively removing but origTx isn't in the mempool\n            // be sure to remove any children that are in the pool. This can\n            // happen during chain re-orgs if origTx isn't re-accepted into\n            // the mempool for any reason.\n            for (unsigned int i = 0; i < origTx.vout.size(); i++) {\n                auto it = mapNextTx.find(COutPoint(origTx.GetHash(), i));\n                if (it == mapNextTx.end())\n                    continue;\n                txiter nextit = mapTx.find(it->second->GetHash());\n                assert(nextit != mapTx.end());\n                txToRemove.insert(nextit);\n            }\n        }\n        setEntries setAllRemoves;\n        for (txiter it : txToRemove) {\n            CalculateDescendants(it, setAllRemoves);\n        }\n\n        RemoveStaged(setAllRemoves, false, reason);\n    }\n}\n\nvoid CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags)\n{\n    // Remove transactions spending a coinbase which are now immature and no-longer-final transactions\n    LOCK(cs);\n    setEntries txToRemove;\n    for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) {\n        const CTransaction& tx = it->GetTx();\n        LockPoints lp = it->GetLockPoints();\n        bool validLP =  TestLockPointValidity(&lp);\n        if (!CheckFinalTx(tx, flags) || !CheckSequenceLocks(tx, flags, &lp, validLP)) {\n            // Note if CheckSequenceLocks fails the LockPoints may still be invalid\n            // So it's critical that we remove the tx and not depend on the LockPoints.\n            txToRemove.insert(it);\n        } else if (it->GetSpendsCoinbase()) {\n            for (const CTxIn& txin : tx.vin) {\n                indexed_transaction_set::const_iterator it2 = mapTx.find(txin.prevout.hash);\n                if (it2 != mapTx.end())\n                    continue;\n                const Coin &coin = pcoins->AccessCoin(txin.prevout);\n                if (nCheckFrequency != 0) assert(!coin.IsSpent());\n                if (coin.IsSpent() || (coin.IsCoinBase() && ((signed long)nMemPoolHeight) - coin.nHeight < COINBASE_MATURITY)) {\n                    txToRemove.insert(it);\n                    break;\n                }\n            }\n        }\n        if (!validLP) {\n            mapTx.modify(it, update_lock_points(lp));\n        }\n    }\n    setEntries setAllRemoves;\n    for (txiter it : txToRemove) {\n        CalculateDescendants(it, setAllRemoves);\n    }\n    RemoveStaged(setAllRemoves, false, MemPoolRemovalReason::REORG);\n}\n\nvoid CTxMemPool::removeConflicts(const CTransaction &tx)\n{\n    // Remove transactions which depend on inputs of tx, recursively\n    LOCK(cs);\n    for (const CTxIn &txin : tx.vin) {\n        auto it = mapNextTx.find(txin.prevout);\n        if (it != mapNextTx.end()) {\n            const CTransaction &txConflict = *it->second;\n            if (txConflict != tx)\n            {\n                ClearPrioritisation(txConflict.GetHash());\n                removeRecursive(txConflict, MemPoolRemovalReason::CONFLICT);\n            }\n        }\n    }\n}\n\n/**\n * Called when a block is connected. Removes from mempool and updates the miner fee estimator.\n */\nvoid CTxMemPool::removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight)\n{\n    LOCK(cs);\n    std::vector<const CTxMemPoolEntry*> entries;\n    for (const auto& tx : vtx)\n    {\n        uint256 hash = tx->GetHash();\n\n        indexed_transaction_set::iterator i = mapTx.find(hash);\n        if (i != mapTx.end())\n            entries.push_back(&*i);\n    }\n    // Before the txs in the new block have been removed from the mempool, update policy estimates\n    if (minerPolicyEstimator) {minerPolicyEstimator->processBlock(nBlockHeight, entries);}\n    for (const auto& tx : vtx)\n    {\n        txiter it = mapTx.find(tx->GetHash());\n        if (it != mapTx.end()) {\n            setEntries stage;\n            stage.insert(it);\n            RemoveStaged(stage, true, MemPoolRemovalReason::BLOCK);\n        }\n        removeConflicts(*tx);\n        ClearPrioritisation(tx->GetHash());\n    }\n    lastRollingFeeUpdate = GetTime();\n    blockSinceLastRollingFeeBump = true;\n}\n\nvoid CTxMemPool::_clear()\n{\n    mapLinks.clear();\n    mapTx.clear();\n    mapNextTx.clear();\n    totalTxSize = 0;\n    cachedInnerUsage = 0;\n    lastRollingFeeUpdate = GetTime();\n    blockSinceLastRollingFeeBump = false;\n    rollingMinimumFeeRate = 0;\n    ++nTransactionsUpdated;\n}\n\nvoid CTxMemPool::clear()\n{\n    LOCK(cs);\n    _clear();\n}\n\nstatic void CheckInputsAndUpdateCoins(const CTransaction& tx, CCoinsViewCache& mempoolDuplicate, const int64_t spendheight)\n{\n    CValidationState state;\n    CAmount txfee = 0;\n    bool fCheckResult = tx.IsCoinBase() || Consensus::CheckTxInputs(tx, state, mempoolDuplicate, spendheight, txfee);\n    assert(fCheckResult);\n    UpdateCoins(tx, mempoolDuplicate, 1000000);\n}\n\nvoid CTxMemPool::check(const CCoinsViewCache *pcoins) const\n{\n    if (nCheckFrequency == 0)\n        return;\n\n    if (GetRand(std::numeric_limits<uint32_t>::max()) >= nCheckFrequency)\n        return;\n\n    LogPrint(BCLog::MEMPOOL, \"Checking mempool with %u transactions and %u inputs\\n\", (unsigned int)mapTx.size(), (unsigned int)mapNextTx.size());\n\n    uint64_t checkTotal = 0;\n    uint64_t innerUsage = 0;\n\n    CCoinsViewCache mempoolDuplicate(const_cast<CCoinsViewCache*>(pcoins));\n    const int64_t spendheight = GetSpendHeight(mempoolDuplicate);\n\n    LOCK(cs);\n    std::list<const CTxMemPoolEntry*> waitingOnDependants;\n    for (indexed_transaction_set::const_iterator it = mapTx.begin(); it != mapTx.end(); it++) {\n        unsigned int i = 0;\n        checkTotal += it->GetTxSize();\n        innerUsage += it->DynamicMemoryUsage();\n        const CTransaction& tx = it->GetTx();\n        txlinksMap::const_iterator linksiter = mapLinks.find(it);\n        assert(linksiter != mapLinks.end());\n        const TxLinks &links = linksiter->second;\n        innerUsage += memusage::DynamicUsage(links.parents) + memusage::DynamicUsage(links.children);\n        bool fDependsWait = false;\n        setEntries setParentCheck;\n        int64_t parentSizes = 0;\n        int64_t parentSigOpCost = 0;\n        for (const CTxIn &txin : tx.vin) {\n            // Check that every mempool transaction's inputs refer to available coins, or other mempool tx's.\n            indexed_transaction_set::const_iterator it2 = mapTx.find(txin.prevout.hash);\n            if (it2 != mapTx.end()) {\n                const CTransaction& tx2 = it2->GetTx();\n                assert(tx2.vout.size() > txin.prevout.n && !tx2.vout[txin.prevout.n].IsNull());\n                fDependsWait = true;\n                if (setParentCheck.insert(it2).second) {\n                    parentSizes += it2->GetTxSize();\n                    parentSigOpCost += it2->GetSigOpCost();\n                }\n            } else {\n                assert(pcoins->HaveCoin(txin.prevout));\n            }\n            // Check whether its inputs are marked in mapNextTx.\n            auto it3 = mapNextTx.find(txin.prevout);\n            assert(it3 != mapNextTx.end());\n            assert(it3->first == &txin.prevout);\n            assert(it3->second == &tx);\n            i++;\n        }\n        assert(setParentCheck == GetMemPoolParents(it));\n        // Verify ancestor state is correct.\n        setEntries setAncestors;\n        uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();\n        std::string dummy;\n        CalculateMemPoolAncestors(*it, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy);\n        uint64_t nCountCheck = setAncestors.size() + 1;\n        uint64_t nSizeCheck = it->GetTxSize();\n        CAmount nFeesCheck = it->GetModifiedFee();\n        int64_t nSigOpCheck = it->GetSigOpCost();\n\n        for (txiter ancestorIt : setAncestors) {\n            nSizeCheck += ancestorIt->GetTxSize();\n            nFeesCheck += ancestorIt->GetModifiedFee();\n            nSigOpCheck += ancestorIt->GetSigOpCost();\n        }\n\n        assert(it->GetCountWithAncestors() == nCountCheck);\n        assert(it->GetSizeWithAncestors() == nSizeCheck);\n        assert(it->GetSigOpCostWithAncestors() == nSigOpCheck);\n        assert(it->GetModFeesWithAncestors() == nFeesCheck);\n\n        // Check children against mapNextTx\n        CTxMemPool::setEntries setChildrenCheck;\n        auto iter = mapNextTx.lower_bound(COutPoint(it->GetTx().GetHash(), 0));\n        int64_t childSizes = 0;\n        for (; iter != mapNextTx.end() && iter->first->hash == it->GetTx().GetHash(); ++iter) {\n            txiter childit = mapTx.find(iter->second->GetHash());\n            assert(childit != mapTx.end()); // mapNextTx points to in-mempool transactions\n            if (setChildrenCheck.insert(childit).second) {\n                childSizes += childit->GetTxSize();\n            }\n        }\n        assert(setChildrenCheck == GetMemPoolChildren(it));\n        // Also check to make sure size is greater than sum with immediate children.\n        // just a sanity check, not definitive that this calc is correct...\n        assert(it->GetSizeWithDescendants() >= childSizes + it->GetTxSize());\n\n        if (fDependsWait)\n            waitingOnDependants.push_back(&(*it));\n        else {\n            CheckInputsAndUpdateCoins(tx, mempoolDuplicate, spendheight);\n        }\n    }\n    unsigned int stepsSinceLastRemove = 0;\n    while (!waitingOnDependants.empty()) {\n        const CTxMemPoolEntry* entry = waitingOnDependants.front();\n        waitingOnDependants.pop_front();\n        CValidationState state;\n        if (!mempoolDuplicate.HaveInputs(entry->GetTx())) {\n            waitingOnDependants.push_back(entry);\n            stepsSinceLastRemove++;\n            assert(stepsSinceLastRemove < waitingOnDependants.size());\n        } else {\n            CheckInputsAndUpdateCoins(entry->GetTx(), mempoolDuplicate, spendheight);\n            stepsSinceLastRemove = 0;\n        }\n    }\n    for (auto it = mapNextTx.cbegin(); it != mapNextTx.cend(); it++) {\n        uint256 hash = it->second->GetHash();\n        indexed_transaction_set::const_iterator it2 = mapTx.find(hash);\n        const CTransaction& tx = it2->GetTx();\n        assert(it2 != mapTx.end());\n        assert(&tx == it->second);\n    }\n\n    assert(totalTxSize == checkTotal);\n    assert(innerUsage == cachedInnerUsage);\n}\n\nbool CTxMemPool::CompareDepthAndScore(const uint256& hasha, const uint256& hashb)\n{\n    LOCK(cs);\n    indexed_transaction_set::const_iterator i = mapTx.find(hasha);\n    if (i == mapTx.end()) return false;\n    indexed_transaction_set::const_iterator j = mapTx.find(hashb);\n    if (j == mapTx.end()) return true;\n    uint64_t counta = i->GetCountWithAncestors();\n    uint64_t countb = j->GetCountWithAncestors();\n    if (counta == countb) {\n        return CompareTxMemPoolEntryByScore()(*i, *j);\n    }\n    return counta < countb;\n}\n\nnamespace {\nclass DepthAndScoreComparator\n{\npublic:\n    bool operator()(const CTxMemPool::indexed_transaction_set::const_iterator& a, const CTxMemPool::indexed_transaction_set::const_iterator& b)\n    {\n        uint64_t counta = a->GetCountWithAncestors();\n        uint64_t countb = b->GetCountWithAncestors();\n        if (counta == countb) {\n            return CompareTxMemPoolEntryByScore()(*a, *b);\n        }\n        return counta < countb;\n    }\n};\n} // namespace\n\nstd::vector<CTxMemPool::indexed_transaction_set::const_iterator> CTxMemPool::GetSortedDepthAndScore() const\n{\n    std::vector<indexed_transaction_set::const_iterator> iters;\n    AssertLockHeld(cs);\n\n    iters.reserve(mapTx.size());\n\n    for (indexed_transaction_set::iterator mi = mapTx.begin(); mi != mapTx.end(); ++mi) {\n        iters.push_back(mi);\n    }\n    std::sort(iters.begin(), iters.end(), DepthAndScoreComparator());\n    return iters;\n}\n\nvoid CTxMemPool::queryHashes(std::vector<uint256>& vtxid)\n{\n    LOCK(cs);\n    auto iters = GetSortedDepthAndScore();\n\n    vtxid.clear();\n    vtxid.reserve(mapTx.size());\n\n    for (auto it : iters) {\n        vtxid.push_back(it->GetTx().GetHash());\n    }\n}\n\nstatic TxMempoolInfo GetInfo(CTxMemPool::indexed_transaction_set::const_iterator it) {\n    return TxMempoolInfo{it->GetSharedTx(), it->GetTime(), CFeeRate(it->GetFee(), it->GetTxSize()), it->GetModifiedFee() - it->GetFee()};\n}\n\nstd::vector<TxMempoolInfo> CTxMemPool::infoAll() const\n{\n    LOCK(cs);\n    auto iters = GetSortedDepthAndScore();\n\n    std::vector<TxMempoolInfo> ret;\n    ret.reserve(mapTx.size());\n    for (auto it : iters) {\n        ret.push_back(GetInfo(it));\n    }\n\n    return ret;\n}\n\nCTransactionRef CTxMemPool::get(const uint256& hash) const\n{\n    LOCK(cs);\n    indexed_transaction_set::const_iterator i = mapTx.find(hash);\n    if (i == mapTx.end())\n        return nullptr;\n    return i->GetSharedTx();\n}\n\nTxMempoolInfo CTxMemPool::info(const uint256& hash) const\n{\n    LOCK(cs);\n    indexed_transaction_set::const_iterator i = mapTx.find(hash);\n    if (i == mapTx.end())\n        return TxMempoolInfo();\n    return GetInfo(i);\n}\n\nvoid CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta)\n{\n    {\n        LOCK(cs);\n        CAmount &delta = mapDeltas[hash];\n        delta += nFeeDelta;\n        txiter it = mapTx.find(hash);\n        if (it != mapTx.end()) {\n            mapTx.modify(it, update_fee_delta(delta));\n            // Now update all ancestors' modified fees with descendants\n            setEntries setAncestors;\n            uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();\n            std::string dummy;\n            CalculateMemPoolAncestors(*it, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy, false);\n            for (txiter ancestorIt : setAncestors) {\n                mapTx.modify(ancestorIt, update_descendant_state(0, nFeeDelta, 0));\n            }\n            // Now update all descendants' modified fees with ancestors\n            setEntries setDescendants;\n            CalculateDescendants(it, setDescendants);\n            setDescendants.erase(it);\n            for (txiter descendantIt : setDescendants) {\n                mapTx.modify(descendantIt, update_ancestor_state(0, nFeeDelta, 0, 0));\n            }\n            ++nTransactionsUpdated;\n        }\n    }\n    LogPrintf(\"PrioritiseTransaction: %s feerate += %s\\n\", hash.ToString(), FormatMoney(nFeeDelta));\n}\n\nvoid CTxMemPool::ApplyDelta(const uint256 hash, CAmount &nFeeDelta) const\n{\n    LOCK(cs);\n    std::map<uint256, CAmount>::const_iterator pos = mapDeltas.find(hash);\n    if (pos == mapDeltas.end())\n        return;\n    const CAmount &delta = pos->second;\n    nFeeDelta += delta;\n}\n\nvoid CTxMemPool::ClearPrioritisation(const uint256 hash)\n{\n    LOCK(cs);\n    mapDeltas.erase(hash);\n}\n\nbool CTxMemPool::HasNoInputsOf(const CTransaction &tx) const\n{\n    for (unsigned int i = 0; i < tx.vin.size(); i++)\n        if (exists(tx.vin[i].prevout.hash))\n            return false;\n    return true;\n}\n\nCCoinsViewMemPool::CCoinsViewMemPool(CCoinsView* baseIn, const CTxMemPool& mempoolIn) : CCoinsViewBacked(baseIn), mempool(mempoolIn) { }\n\nbool CCoinsViewMemPool::GetCoin(const COutPoint &outpoint, Coin &coin) const {\n    // If an entry in the mempool exists, always return that one, as it's guaranteed to never\n    // conflict with the underlying cache, and it cannot have pruned entries (as it contains full)\n    // transactions. First checking the underlying cache risks returning a pruned entry instead.\n    CTransactionRef ptx = mempool.get(outpoint.hash);\n    if (ptx) {\n        if (outpoint.n < ptx->vout.size()) {\n            coin = Coin(ptx->vout[outpoint.n], MEMPOOL_HEIGHT, false);\n            return true;\n        } else {\n            return false;\n        }\n    }\n    return base->GetCoin(outpoint, coin);\n}\n\nsize_t CTxMemPool::DynamicMemoryUsage() const {\n    LOCK(cs);\n    // Estimate the overhead of mapTx to be 12 pointers + an allocation, as no exact formula for boost::multi_index_contained is implemented.\n    return memusage::MallocUsage(sizeof(CTxMemPoolEntry) + 12 * sizeof(void*)) * mapTx.size() + memusage::DynamicUsage(mapNextTx) + memusage::DynamicUsage(mapDeltas) + memusage::DynamicUsage(mapLinks) + memusage::DynamicUsage(vTxHashes) + cachedInnerUsage;\n}\n\nvoid CTxMemPool::RemoveStaged(setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason) {\n    AssertLockHeld(cs);\n    UpdateForRemoveFromMempool(stage, updateDescendants);\n    for (const txiter& it : stage) {\n        removeUnchecked(it, reason);\n    }\n}\n\nint CTxMemPool::Expire(int64_t time) {\n    LOCK(cs);\n    indexed_transaction_set::index<entry_time>::type::iterator it = mapTx.get<entry_time>().begin();\n    setEntries toremove;\n    while (it != mapTx.get<entry_time>().end() && it->GetTime() < time) {\n        toremove.insert(mapTx.project<0>(it));\n        it++;\n    }\n    setEntries stage;\n    for (txiter removeit : toremove) {\n        CalculateDescendants(removeit, stage);\n    }\n    RemoveStaged(stage, false, MemPoolRemovalReason::EXPIRY);\n    return stage.size();\n}\n\nbool CTxMemPool::addUnchecked(const uint256&hash, const CTxMemPoolEntry &entry, bool validFeeEstimate)\n{\n    LOCK(cs);\n    setEntries setAncestors;\n    uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();\n    std::string dummy;\n    CalculateMemPoolAncestors(entry, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy);\n    return addUnchecked(hash, entry, setAncestors, validFeeEstimate);\n}\n\nvoid CTxMemPool::UpdateChild(txiter entry, txiter child, bool add)\n{\n    setEntries s;\n    if (add && mapLinks[entry].children.insert(child).second) {\n        cachedInnerUsage += memusage::IncrementalDynamicUsage(s);\n    } else if (!add && mapLinks[entry].children.erase(child)) {\n        cachedInnerUsage -= memusage::IncrementalDynamicUsage(s);\n    }\n}\n\nvoid CTxMemPool::UpdateParent(txiter entry, txiter parent, bool add)\n{\n    setEntries s;\n    if (add && mapLinks[entry].parents.insert(parent).second) {\n        cachedInnerUsage += memusage::IncrementalDynamicUsage(s);\n    } else if (!add && mapLinks[entry].parents.erase(parent)) {\n        cachedInnerUsage -= memusage::IncrementalDynamicUsage(s);\n    }\n}\n\nconst CTxMemPool::setEntries & CTxMemPool::GetMemPoolParents(txiter entry) const\n{\n    assert (entry != mapTx.end());\n    txlinksMap::const_iterator it = mapLinks.find(entry);\n    assert(it != mapLinks.end());\n    return it->second.parents;\n}\n\nconst CTxMemPool::setEntries & CTxMemPool::GetMemPoolChildren(txiter entry) const\n{\n    assert (entry != mapTx.end());\n    txlinksMap::const_iterator it = mapLinks.find(entry);\n    assert(it != mapLinks.end());\n    return it->second.children;\n}\n\nCFeeRate CTxMemPool::GetMinFee(size_t sizelimit) const {\n    LOCK(cs);\n    if (!blockSinceLastRollingFeeBump || rollingMinimumFeeRate == 0)\n        return CFeeRate(llround(rollingMinimumFeeRate));\n\n    int64_t time = GetTime();\n    if (time > lastRollingFeeUpdate + 10) {\n        double halflife = ROLLING_FEE_HALFLIFE;\n        if (DynamicMemoryUsage() < sizelimit / 4)\n            halflife /= 4;\n        else if (DynamicMemoryUsage() < sizelimit / 2)\n            halflife /= 2;\n\n        rollingMinimumFeeRate = rollingMinimumFeeRate / pow(2.0, (time - lastRollingFeeUpdate) / halflife);\n        lastRollingFeeUpdate = time;\n\n        if (rollingMinimumFeeRate < (double)incrementalRelayFee.GetFeePerK() / 2) {\n            rollingMinimumFeeRate = 0;\n            return CFeeRate(0);\n        }\n    }\n    return std::max(CFeeRate(llround(rollingMinimumFeeRate)), incrementalRelayFee);\n}\n\nvoid CTxMemPool::trackPackageRemoved(const CFeeRate& rate) {\n    AssertLockHeld(cs);\n    if (rate.GetFeePerK() > rollingMinimumFeeRate) {\n        rollingMinimumFeeRate = rate.GetFeePerK();\n        blockSinceLastRollingFeeBump = false;\n    }\n}\n\nvoid CTxMemPool::TrimToSize(size_t sizelimit, std::vector<COutPoint>* pvNoSpendsRemaining) {\n    LOCK(cs);\n\n    unsigned nTxnRemoved = 0;\n    CFeeRate maxFeeRateRemoved(0);\n    while (!mapTx.empty() && DynamicMemoryUsage() > sizelimit) {\n        indexed_transaction_set::index<descendant_score>::type::iterator it = mapTx.get<descendant_score>().begin();\n\n        // We set the new mempool min fee to the feerate of the removed set, plus the\n        // \"minimum reasonable fee rate\" (ie some value under which we consider txn\n        // to have 0 fee). This way, we don't allow txn to enter mempool with feerate\n        // equal to txn which were removed with no block in between.\n        CFeeRate removed(it->GetModFeesWithDescendants(), it->GetSizeWithDescendants());\n        removed += incrementalRelayFee;\n        trackPackageRemoved(removed);\n        maxFeeRateRemoved = std::max(maxFeeRateRemoved, removed);\n\n        setEntries stage;\n        CalculateDescendants(mapTx.project<0>(it), stage);\n        nTxnRemoved += stage.size();\n\n        std::vector<CTransaction> txn;\n        if (pvNoSpendsRemaining) {\n            txn.reserve(stage.size());\n            for (txiter iter : stage)\n                txn.push_back(iter->GetTx());\n        }\n        RemoveStaged(stage, false, MemPoolRemovalReason::SIZELIMIT);\n        if (pvNoSpendsRemaining) {\n            for (const CTransaction& tx : txn) {\n                for (const CTxIn& txin : tx.vin) {\n                    if (exists(txin.prevout.hash)) continue;\n                    pvNoSpendsRemaining->push_back(txin.prevout);\n                }\n            }\n        }\n    }\n\n    if (maxFeeRateRemoved > CFeeRate(0)) {\n        LogPrint(BCLog::MEMPOOL, \"Removed %u txn, rolling minimum fee bumped to %s\\n\", nTxnRemoved, maxFeeRateRemoved.ToString());\n    }\n}\n\nbool CTxMemPool::TransactionWithinChainLimit(const uint256& txid, size_t chainLimit) const {\n    LOCK(cs);\n    auto it = mapTx.find(txid);\n    return it == mapTx.end() || (it->GetCountWithAncestors() < chainLimit &&\n       it->GetCountWithDescendants() < chainLimit);\n}\n\nSaltedTxidHasher::SaltedTxidHasher() : k0(GetRand(std::numeric_limits<uint64_t>::max())), k1(GetRand(std::numeric_limits<uint64_t>::max())) {}\n"
  },
  {
    "path": "src/txmempool.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_TXMEMPOOL_H\n#define BITCOIN_TXMEMPOOL_H\n\n#include <memory>\n#include <set>\n#include <map>\n#include <vector>\n#include <utility>\n#include <string>\n\n#include <amount.h>\n#include <coins.h>\n#include <indirectmap.h>\n#include <policy/feerate.h>\n#include <primitives/transaction.h>\n#include <sync.h>\n#include <random.h>\n\n#include <boost/multi_index_container.hpp>\n#include <boost/multi_index/hashed_index.hpp>\n#include <boost/multi_index/ordered_index.hpp>\n#include <boost/multi_index/sequenced_index.hpp>\n#include <boost/signals2/signal.hpp>\n\nclass CBlockIndex;\n\n/** Fake height value used in Coin to signify they are only in the memory pool (since 0.8) */\nstatic const uint32_t MEMPOOL_HEIGHT = 0x7FFFFFFF;\n\nstruct LockPoints\n{\n    // Will be set to the blockchain height and median time past\n    // values that would be necessary to satisfy all relative locktime\n    // constraints (BIP68) of this tx given our view of block chain history\n    int height;\n    int64_t time;\n    // As long as the current chain descends from the highest height block\n    // containing one of the inputs used in the calculation, then the cached\n    // values are still valid even after a reorg.\n    CBlockIndex* maxInputBlock;\n\n    LockPoints() : height(0), time(0), maxInputBlock(nullptr) { }\n};\n\nclass CTxMemPool;\n\n/** \\class CTxMemPoolEntry\n *\n * CTxMemPoolEntry stores data about the corresponding transaction, as well\n * as data about all in-mempool transactions that depend on the transaction\n * (\"descendant\" transactions).\n *\n * When a new entry is added to the mempool, we update the descendant state\n * (nCountWithDescendants, nSizeWithDescendants, and nModFeesWithDescendants) for\n * all ancestors of the newly added transaction.\n *\n */\n\nclass CTxMemPoolEntry\n{\nprivate:\n    CTransactionRef tx;\n    CAmount nFee;              //!< Cached to avoid expensive parent-transaction lookups\n    size_t nTxWeight;          //!< ... and avoid recomputing tx weight (also used for GetTxSize())\n    size_t nUsageSize;         //!< ... and total memory usage\n    int64_t nTime;             //!< Local time when entering the mempool\n    unsigned int entryHeight;  //!< Chain height when entering the mempool\n    bool spendsCoinbase;       //!< keep track of transactions that spend a coinbase\n    int64_t sigOpCost;         //!< Total sigop cost\n    int64_t feeDelta;          //!< Used for determining the priority of the transaction for mining in a block\n    LockPoints lockPoints;     //!< Track the height and time at which tx was final\n\n    // Information about descendants of this transaction that are in the\n    // mempool; if we remove this transaction we must remove all of these\n    // descendants as well.\n    uint64_t nCountWithDescendants;  //!< number of descendant transactions\n    uint64_t nSizeWithDescendants;   //!< ... and size\n    CAmount nModFeesWithDescendants; //!< ... and total fees (all including us)\n\n    // Analogous statistics for ancestor transactions\n    uint64_t nCountWithAncestors;\n    uint64_t nSizeWithAncestors;\n    CAmount nModFeesWithAncestors;\n    int64_t nSigOpCostWithAncestors;\n\npublic:\n    CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee,\n                    int64_t _nTime, unsigned int _entryHeight,\n                    bool spendsCoinbase,\n                    int64_t nSigOpsCost, LockPoints lp);\n\n    const CTransaction& GetTx() const { return *this->tx; }\n    CTransactionRef GetSharedTx() const { return this->tx; }\n    const CAmount& GetFee() const { return nFee; }\n    size_t GetTxSize() const;\n    size_t GetTxWeight() const { return nTxWeight; }\n    int64_t GetTime() const { return nTime; }\n    unsigned int GetHeight() const { return entryHeight; }\n    int64_t GetSigOpCost() const { return sigOpCost; }\n    int64_t GetModifiedFee() const { return nFee + feeDelta; }\n    size_t DynamicMemoryUsage() const { return nUsageSize; }\n    const LockPoints& GetLockPoints() const { return lockPoints; }\n\n    // Adjusts the descendant state.\n    void UpdateDescendantState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount);\n    // Adjusts the ancestor state\n    void UpdateAncestorState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount, int64_t modifySigOps);\n    // Updates the fee delta used for mining priority score, and the\n    // modified fees with descendants.\n    void UpdateFeeDelta(int64_t feeDelta);\n    // Update the LockPoints after a reorg\n    void UpdateLockPoints(const LockPoints& lp);\n\n    uint64_t GetCountWithDescendants() const { return nCountWithDescendants; }\n    uint64_t GetSizeWithDescendants() const { return nSizeWithDescendants; }\n    CAmount GetModFeesWithDescendants() const { return nModFeesWithDescendants; }\n\n    bool GetSpendsCoinbase() const { return spendsCoinbase; }\n\n    uint64_t GetCountWithAncestors() const { return nCountWithAncestors; }\n    uint64_t GetSizeWithAncestors() const { return nSizeWithAncestors; }\n    CAmount GetModFeesWithAncestors() const { return nModFeesWithAncestors; }\n    int64_t GetSigOpCostWithAncestors() const { return nSigOpCostWithAncestors; }\n\n    mutable size_t vTxHashesIdx; //!< Index in mempool's vTxHashes\n};\n\n// Helpers for modifying CTxMemPool::mapTx, which is a boost multi_index.\nstruct update_descendant_state\n{\n    update_descendant_state(int64_t _modifySize, CAmount _modifyFee, int64_t _modifyCount) :\n        modifySize(_modifySize), modifyFee(_modifyFee), modifyCount(_modifyCount)\n    {}\n\n    void operator() (CTxMemPoolEntry &e)\n        { e.UpdateDescendantState(modifySize, modifyFee, modifyCount); }\n\n    private:\n        int64_t modifySize;\n        CAmount modifyFee;\n        int64_t modifyCount;\n};\n\nstruct update_ancestor_state\n{\n    update_ancestor_state(int64_t _modifySize, CAmount _modifyFee, int64_t _modifyCount, int64_t _modifySigOpsCost) :\n        modifySize(_modifySize), modifyFee(_modifyFee), modifyCount(_modifyCount), modifySigOpsCost(_modifySigOpsCost)\n    {}\n\n    void operator() (CTxMemPoolEntry &e)\n        { e.UpdateAncestorState(modifySize, modifyFee, modifyCount, modifySigOpsCost); }\n\n    private:\n        int64_t modifySize;\n        CAmount modifyFee;\n        int64_t modifyCount;\n        int64_t modifySigOpsCost;\n};\n\nstruct update_fee_delta\n{\n    explicit update_fee_delta(int64_t _feeDelta) : feeDelta(_feeDelta) { }\n\n    void operator() (CTxMemPoolEntry &e) { e.UpdateFeeDelta(feeDelta); }\n\nprivate:\n    int64_t feeDelta;\n};\n\nstruct update_lock_points\n{\n    explicit update_lock_points(const LockPoints& _lp) : lp(_lp) { }\n\n    void operator() (CTxMemPoolEntry &e) { e.UpdateLockPoints(lp); }\n\nprivate:\n    const LockPoints& lp;\n};\n\n// extracts a transaction hash from CTxMempoolEntry or CTransactionRef\nstruct mempoolentry_txid\n{\n    typedef uint256 result_type;\n    result_type operator() (const CTxMemPoolEntry &entry) const\n    {\n        return entry.GetTx().GetHash();\n    }\n\n    result_type operator() (const CTransactionRef& tx) const\n    {\n        return tx->GetHash();\n    }\n};\n\n/** \\class CompareTxMemPoolEntryByDescendantScore\n *\n *  Sort an entry by max(score/size of entry's tx, score/size with all descendants).\n */\nclass CompareTxMemPoolEntryByDescendantScore\n{\npublic:\n    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const\n    {\n        double a_mod_fee, a_size, b_mod_fee, b_size;\n\n        GetModFeeAndSize(a, a_mod_fee, a_size);\n        GetModFeeAndSize(b, b_mod_fee, b_size);\n\n        // Avoid division by rewriting (a/b > c/d) as (a*d > c*b).\n        double f1 = a_mod_fee * b_size;\n        double f2 = a_size * b_mod_fee;\n\n        if (f1 == f2) {\n            return a.GetTime() >= b.GetTime();\n        }\n        return f1 < f2;\n    }\n\n    // Return the fee/size we're using for sorting this entry.\n    void GetModFeeAndSize(const CTxMemPoolEntry &a, double &mod_fee, double &size) const\n    {\n        // Compare feerate with descendants to feerate of the transaction, and\n        // return the fee/size for the max.\n        double f1 = (double)a.GetModifiedFee() * a.GetSizeWithDescendants();\n        double f2 = (double)a.GetModFeesWithDescendants() * a.GetTxSize();\n\n        if (f2 > f1) {\n            mod_fee = a.GetModFeesWithDescendants();\n            size = a.GetSizeWithDescendants();\n        } else {\n            mod_fee = a.GetModifiedFee();\n            size = a.GetTxSize();\n        }\n    }\n};\n\n/** \\class CompareTxMemPoolEntryByScore\n *\n *  Sort by score of entry ((fee+delta)/size) in descending order\n */\nclass CompareTxMemPoolEntryByScore\n{\npublic:\n    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const\n    {\n        double f1 = (double)a.GetModifiedFee() * b.GetTxSize();\n        double f2 = (double)b.GetModifiedFee() * a.GetTxSize();\n        if (f1 == f2) {\n            return b.GetTx().GetHash() < a.GetTx().GetHash();\n        }\n        return f1 > f2;\n    }\n};\n\nclass CompareTxMemPoolEntryByEntryTime\n{\npublic:\n    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const\n    {\n        return a.GetTime() < b.GetTime();\n    }\n};\n\n/** \\class CompareTxMemPoolEntryByAncestorScore\n *\n *  Sort an entry by min(score/size of entry's tx, score/size with all ancestors).\n */\nclass CompareTxMemPoolEntryByAncestorFee\n{\npublic:\n    template<typename T>\n    bool operator()(const T& a, const T& b) const\n    {\n        double a_mod_fee, a_size, b_mod_fee, b_size;\n\n        GetModFeeAndSize(a, a_mod_fee, a_size);\n        GetModFeeAndSize(b, b_mod_fee, b_size);\n\n        // Avoid division by rewriting (a/b > c/d) as (a*d > c*b).\n        double f1 = a_mod_fee * b_size;\n        double f2 = a_size * b_mod_fee;\n\n        if (f1 == f2) {\n            return a.GetTx().GetHash() < b.GetTx().GetHash();\n        }\n        return f1 > f2;\n    }\n\n    // Return the fee/size we're using for sorting this entry.\n    template <typename T>\n    void GetModFeeAndSize(const T &a, double &mod_fee, double &size) const\n    {\n        // Compare feerate with ancestors to feerate of the transaction, and\n        // return the fee/size for the min.\n        double f1 = (double)a.GetModifiedFee() * a.GetSizeWithAncestors();\n        double f2 = (double)a.GetModFeesWithAncestors() * a.GetTxSize();\n\n        if (f1 > f2) {\n            mod_fee = a.GetModFeesWithAncestors();\n            size = a.GetSizeWithAncestors();\n        } else {\n            mod_fee = a.GetModifiedFee();\n            size = a.GetTxSize();\n        }\n    }\n};\n\n// Multi_index tag names\nstruct descendant_score {};\nstruct entry_time {};\nstruct ancestor_score {};\n\nclass CBlockPolicyEstimator;\n\n/**\n * Information about a mempool transaction.\n */\nstruct TxMempoolInfo\n{\n    /** The transaction itself */\n    CTransactionRef tx;\n\n    /** Time the transaction entered the mempool. */\n    int64_t nTime;\n\n    /** Feerate of the transaction. */\n    CFeeRate feeRate;\n\n    /** The fee delta. */\n    int64_t nFeeDelta;\n};\n\n/** Reason why a transaction was removed from the mempool,\n * this is passed to the notification signal.\n */\nenum class MemPoolRemovalReason {\n    UNKNOWN = 0, //! Manually removed or unknown reason\n    EXPIRY,      //! Expired from mempool\n    SIZELIMIT,   //! Removed in size limiting\n    REORG,       //! Removed for reorganization\n    BLOCK,       //! Removed for block\n    CONFLICT,    //! Removed for conflict with in-block transaction\n    REPLACED     //! Removed for replacement\n};\n\nclass SaltedTxidHasher\n{\nprivate:\n    /** Salt */\n    const uint64_t k0, k1;\n\npublic:\n    SaltedTxidHasher();\n\n    size_t operator()(const uint256& txid) const {\n        return SipHashUint256(k0, k1, txid);\n    }\n};\n\n/**\n * CTxMemPool stores valid-according-to-the-current-best-chain transactions\n * that may be included in the next block.\n *\n * Transactions are added when they are seen on the network (or created by the\n * local node), but not all transactions seen are added to the pool. For\n * example, the following new transactions will not be added to the mempool:\n * - a transaction which doesn't meet the minimum fee requirements.\n * - a new transaction that double-spends an input of a transaction already in\n * the pool where the new transaction does not meet the Replace-By-Fee\n * requirements as defined in BIP 125.\n * - a non-standard transaction.\n *\n * CTxMemPool::mapTx, and CTxMemPoolEntry bookkeeping:\n *\n * mapTx is a boost::multi_index that sorts the mempool on 4 criteria:\n * - transaction hash\n * - feerate [we use max(feerate of tx, feerate of tx with all descendants)]\n * - time in mempool\n *\n * Note: the term \"descendant\" refers to in-mempool transactions that depend on\n * this one, while \"ancestor\" refers to in-mempool transactions that a given\n * transaction depends on.\n *\n * In order for the feerate sort to remain correct, we must update transactions\n * in the mempool when new descendants arrive.  To facilitate this, we track\n * the set of in-mempool direct parents and direct children in mapLinks.  Within\n * each CTxMemPoolEntry, we track the size and fees of all descendants.\n *\n * Usually when a new transaction is added to the mempool, it has no in-mempool\n * children (because any such children would be an orphan).  So in\n * addUnchecked(), we:\n * - update a new entry's setMemPoolParents to include all in-mempool parents\n * - update the new entry's direct parents to include the new tx as a child\n * - update all ancestors of the transaction to include the new tx's size/fee\n *\n * When a transaction is removed from the mempool, we must:\n * - update all in-mempool parents to not track the tx in setMemPoolChildren\n * - update all ancestors to not include the tx's size/fees in descendant state\n * - update all in-mempool children to not include it as a parent\n *\n * These happen in UpdateForRemoveFromMempool().  (Note that when removing a\n * transaction along with its descendants, we must calculate that set of\n * transactions to be removed before doing the removal, or else the mempool can\n * be in an inconsistent state where it's impossible to walk the ancestors of\n * a transaction.)\n *\n * In the event of a reorg, the assumption that a newly added tx has no\n * in-mempool children is false.  In particular, the mempool is in an\n * inconsistent state while new transactions are being added, because there may\n * be descendant transactions of a tx coming from a disconnected block that are\n * unreachable from just looking at transactions in the mempool (the linking\n * transactions may also be in the disconnected block, waiting to be added).\n * Because of this, there's not much benefit in trying to search for in-mempool\n * children in addUnchecked().  Instead, in the special case of transactions\n * being added from a disconnected block, we require the caller to clean up the\n * state, to account for in-mempool, out-of-block descendants for all the\n * in-block transactions by calling UpdateTransactionsFromBlock().  Note that\n * until this is called, the mempool state is not consistent, and in particular\n * mapLinks may not be correct (and therefore functions like\n * CalculateMemPoolAncestors() and CalculateDescendants() that rely\n * on them to walk the mempool are not generally safe to use).\n *\n * Computational limits:\n *\n * Updating all in-mempool ancestors of a newly added transaction can be slow,\n * if no bound exists on how many in-mempool ancestors there may be.\n * CalculateMemPoolAncestors() takes configurable limits that are designed to\n * prevent these calculations from being too CPU intensive.\n *\n */\nclass CTxMemPool\n{\nprivate:\n    uint32_t nCheckFrequency; //!< Value n means that n times in 2^32 we check.\n    unsigned int nTransactionsUpdated; //!< Used by getblocktemplate to trigger CreateNewBlock() invocation\n    CBlockPolicyEstimator* minerPolicyEstimator;\n\n    uint64_t totalTxSize;      //!< sum of all mempool tx's virtual sizes. Differs from serialized tx size since witness data is discounted. Defined in BIP 141.\n    uint64_t cachedInnerUsage; //!< sum of dynamic memory usage of all the map elements (NOT the maps themselves)\n\n    mutable int64_t lastRollingFeeUpdate;\n    mutable bool blockSinceLastRollingFeeBump;\n    mutable double rollingMinimumFeeRate; //!< minimum fee to get into the pool, decreases exponentially\n\n    void trackPackageRemoved(const CFeeRate& rate);\n\npublic:\n\n    static const int ROLLING_FEE_HALFLIFE = 60 * 60 * 12; // public only for testing\n\n    typedef boost::multi_index_container<\n        CTxMemPoolEntry,\n        boost::multi_index::indexed_by<\n            // sorted by txid\n            boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>,\n            // sorted by fee rate\n            boost::multi_index::ordered_non_unique<\n                boost::multi_index::tag<descendant_score>,\n                boost::multi_index::identity<CTxMemPoolEntry>,\n                CompareTxMemPoolEntryByDescendantScore\n            >,\n            // sorted by entry time\n            boost::multi_index::ordered_non_unique<\n                boost::multi_index::tag<entry_time>,\n                boost::multi_index::identity<CTxMemPoolEntry>,\n                CompareTxMemPoolEntryByEntryTime\n            >,\n            // sorted by fee rate with ancestors\n            boost::multi_index::ordered_non_unique<\n                boost::multi_index::tag<ancestor_score>,\n                boost::multi_index::identity<CTxMemPoolEntry>,\n                CompareTxMemPoolEntryByAncestorFee\n            >\n        >\n    > indexed_transaction_set;\n\n    mutable CCriticalSection cs;\n    indexed_transaction_set mapTx;\n\n    typedef indexed_transaction_set::nth_index<0>::type::iterator txiter;\n    std::vector<std::pair<uint256, txiter> > vTxHashes; //!< All tx witness hashes/entries in mapTx, in random order\n\n    struct CompareIteratorByHash {\n        bool operator()(const txiter &a, const txiter &b) const {\n            return a->GetTx().GetHash() < b->GetTx().GetHash();\n        }\n    };\n    typedef std::set<txiter, CompareIteratorByHash> setEntries;\n\n    const setEntries & GetMemPoolParents(txiter entry) const;\n    const setEntries & GetMemPoolChildren(txiter entry) const;\nprivate:\n    typedef std::map<txiter, setEntries, CompareIteratorByHash> cacheMap;\n\n    struct TxLinks {\n        setEntries parents;\n        setEntries children;\n    };\n\n    typedef std::map<txiter, TxLinks, CompareIteratorByHash> txlinksMap;\n    txlinksMap mapLinks;\n\n    void UpdateParent(txiter entry, txiter parent, bool add);\n    void UpdateChild(txiter entry, txiter child, bool add);\n\n    std::vector<indexed_transaction_set::const_iterator> GetSortedDepthAndScore() const;\n\npublic:\n    indirectmap<COutPoint, const CTransaction*> mapNextTx;\n    std::map<uint256, CAmount> mapDeltas;\n\n    /** Create a new CTxMemPool.\n     */\n    explicit CTxMemPool(CBlockPolicyEstimator* estimator = nullptr);\n\n    /**\n     * If sanity-checking is turned on, check makes sure the pool is\n     * consistent (does not contain two transactions that spend the same inputs,\n     * all inputs are in the mapNextTx array). If sanity-checking is turned off,\n     * check does nothing.\n     */\n    void check(const CCoinsViewCache *pcoins) const;\n    void setSanityCheck(double dFrequency = 1.0) { nCheckFrequency = static_cast<uint32_t>(dFrequency * 4294967295.0); }\n\n    // addUnchecked must updated state for all ancestors of a given transaction,\n    // to track size/count of descendant transactions.  First version of\n    // addUnchecked can be used to have it call CalculateMemPoolAncestors(), and\n    // then invoke the second version.\n    // Note that addUnchecked is ONLY called from ATMP outside of tests\n    // and any other callers may break wallet's in-mempool tracking (due to\n    // lack of CValidationInterface::TransactionAddedToMempool callbacks).\n    bool addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, bool validFeeEstimate = true);\n    bool addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, setEntries &setAncestors, bool validFeeEstimate = true);\n\n    void removeRecursive(const CTransaction &tx, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN);\n    void removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMemPoolHeight, int flags);\n    void removeConflicts(const CTransaction &tx);\n    void removeForBlock(const std::vector<CTransactionRef>& vtx, unsigned int nBlockHeight);\n\n    void clear();\n    void _clear(); //lock free\n    bool CompareDepthAndScore(const uint256& hasha, const uint256& hashb);\n    void queryHashes(std::vector<uint256>& vtxid);\n    bool isSpent(const COutPoint& outpoint);\n    unsigned int GetTransactionsUpdated() const;\n    void AddTransactionsUpdated(unsigned int n);\n    /**\n     * Check that none of this transactions inputs are in the mempool, and thus\n     * the tx is not dependent on other mempool transactions to be included in a block.\n     */\n    bool HasNoInputsOf(const CTransaction& tx) const;\n\n    /** Affect CreateNewBlock prioritisation of transactions */\n    void PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta);\n    void ApplyDelta(const uint256 hash, CAmount &nFeeDelta) const;\n    void ClearPrioritisation(const uint256 hash);\n\npublic:\n    /** Remove a set of transactions from the mempool.\n     *  If a transaction is in this set, then all in-mempool descendants must\n     *  also be in the set, unless this transaction is being removed for being\n     *  in a block.\n     *  Set updateDescendants to true when removing a tx that was in a block, so\n     *  that any in-mempool descendants have their ancestor state updated.\n     */\n    void RemoveStaged(setEntries &stage, bool updateDescendants, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN);\n\n    /** When adding transactions from a disconnected block back to the mempool,\n     *  new mempool entries may have children in the mempool (which is generally\n     *  not the case when otherwise adding transactions).\n     *  UpdateTransactionsFromBlock() will find child transactions and update the\n     *  descendant state for each transaction in vHashesToUpdate (excluding any\n     *  child transactions present in vHashesToUpdate, which are already accounted\n     *  for).  Note: vHashesToUpdate should be the set of transactions from the\n     *  disconnected block that have been accepted back into the mempool.\n     */\n    void UpdateTransactionsFromBlock(const std::vector<uint256> &vHashesToUpdate);\n\n    /** Try to calculate all in-mempool ancestors of entry.\n     *  (these are all calculated including the tx itself)\n     *  limitAncestorCount = max number of ancestors\n     *  limitAncestorSize = max size of ancestors\n     *  limitDescendantCount = max number of descendants any ancestor can have\n     *  limitDescendantSize = max size of descendants any ancestor can have\n     *  errString = populated with error reason if any limits are hit\n     *  fSearchForParents = whether to search a tx's vin for in-mempool parents, or\n     *    look up parents from mapLinks. Must be true for entries not in the mempool\n     */\n    bool CalculateMemPoolAncestors(const CTxMemPoolEntry &entry, setEntries &setAncestors, uint64_t limitAncestorCount, uint64_t limitAncestorSize, uint64_t limitDescendantCount, uint64_t limitDescendantSize, std::string &errString, bool fSearchForParents = true) const;\n\n    /** Populate setDescendants with all in-mempool descendants of hash.\n     *  Assumes that setDescendants includes all in-mempool descendants of anything\n     *  already in it.  */\n    void CalculateDescendants(txiter it, setEntries &setDescendants);\n\n    /** The minimum fee to get into the mempool, which may itself not be enough\n      *  for larger-sized transactions.\n      *  The incrementalRelayFee policy variable is used to bound the time it\n      *  takes the fee rate to go back down all the way to 0. When the feerate\n      *  would otherwise be half of this, it is set to 0 instead.\n      */\n    CFeeRate GetMinFee(size_t sizelimit) const;\n\n    /** Remove transactions from the mempool until its dynamic size is <= sizelimit.\n      *  pvNoSpendsRemaining, if set, will be populated with the list of outpoints\n      *  which are not in mempool which no longer have any spends in this mempool.\n      */\n    void TrimToSize(size_t sizelimit, std::vector<COutPoint>* pvNoSpendsRemaining=nullptr);\n\n    /** Expire all transaction (and their dependencies) in the mempool older than time. Return the number of removed transactions. */\n    int Expire(int64_t time);\n\n    /** Returns false if the transaction is in the mempool and not within the chain limit specified. */\n    bool TransactionWithinChainLimit(const uint256& txid, size_t chainLimit) const;\n\n    unsigned long size()\n    {\n        LOCK(cs);\n        return mapTx.size();\n    }\n\n    uint64_t GetTotalTxSize() const\n    {\n        LOCK(cs);\n        return totalTxSize;\n    }\n\n    bool exists(uint256 hash) const\n    {\n        LOCK(cs);\n        return (mapTx.count(hash) != 0);\n    }\n\n    CTransactionRef get(const uint256& hash) const;\n    TxMempoolInfo info(const uint256& hash) const;\n    std::vector<TxMempoolInfo> infoAll() const;\n\n    size_t DynamicMemoryUsage() const;\n\n    boost::signals2::signal<void (CTransactionRef)> NotifyEntryAdded;\n    boost::signals2::signal<void (CTransactionRef, MemPoolRemovalReason)> NotifyEntryRemoved;\n\nprivate:\n    /** UpdateForDescendants is used by UpdateTransactionsFromBlock to update\n     *  the descendants for a single transaction that has been added to the\n     *  mempool but may have child transactions in the mempool, eg during a\n     *  chain reorg.  setExclude is the set of descendant transactions in the\n     *  mempool that must not be accounted for (because any descendants in\n     *  setExclude were added to the mempool after the transaction being\n     *  updated and hence their state is already reflected in the parent\n     *  state).\n     *\n     *  cachedDescendants will be updated with the descendants of the transaction\n     *  being updated, so that future invocations don't need to walk the\n     *  same transaction again, if encountered in another transaction chain.\n     */\n    void UpdateForDescendants(txiter updateIt,\n            cacheMap &cachedDescendants,\n            const std::set<uint256> &setExclude);\n    /** Update ancestors of hash to add/remove it as a descendant transaction. */\n    void UpdateAncestorsOf(bool add, txiter hash, setEntries &setAncestors);\n    /** Set ancestor state for an entry */\n    void UpdateEntryForAncestors(txiter it, const setEntries &setAncestors);\n    /** For each transaction being removed, update ancestors and any direct children.\n      * If updateDescendants is true, then also update in-mempool descendants'\n      * ancestor state. */\n    void UpdateForRemoveFromMempool(const setEntries &entriesToRemove, bool updateDescendants);\n    /** Sever link between specified transaction and direct children. */\n    void UpdateChildrenForRemoval(txiter entry);\n\n    /** Before calling removeUnchecked for a given transaction,\n     *  UpdateForRemoveFromMempool must be called on the entire (dependent) set\n     *  of transactions being removed at the same time.  We use each\n     *  CTxMemPoolEntry's setMemPoolParents in order to walk ancestors of a\n     *  given transaction that is removed, so we can't remove intermediate\n     *  transactions in a chain before we've updated all the state for the\n     *  removal.\n     */\n    void removeUnchecked(txiter entry, MemPoolRemovalReason reason = MemPoolRemovalReason::UNKNOWN);\n};\n\n/** \n * CCoinsView that brings transactions from a memorypool into view.\n * It does not check for spendings by memory pool transactions.\n * Instead, it provides access to all Coins which are either unspent in the\n * base CCoinsView, or are outputs from any mempool transaction!\n * This allows transaction replacement to work as expected, as you want to\n * have all inputs \"available\" to check signatures, and any cycles in the\n * dependency graph are checked directly in AcceptToMemoryPool.\n * It also allows you to sign a double-spend directly in signrawtransaction,\n * as long as the conflicting transaction is not yet confirmed.\n */\nclass CCoinsViewMemPool : public CCoinsViewBacked\n{\nprotected:\n    const CTxMemPool& mempool;\n\npublic:\n    CCoinsViewMemPool(CCoinsView* baseIn, const CTxMemPool& mempoolIn);\n    bool GetCoin(const COutPoint &outpoint, Coin &coin) const override;\n};\n\n/**\n * DisconnectedBlockTransactions\n\n * During the reorg, it's desirable to re-add previously confirmed transactions\n * to the mempool, so that anything not re-confirmed in the new chain is\n * available to be mined. However, it's more efficient to wait until the reorg\n * is complete and process all still-unconfirmed transactions at that time,\n * since we expect most confirmed transactions to (typically) still be\n * confirmed in the new chain, and re-accepting to the memory pool is expensive\n * (and therefore better to not do in the middle of reorg-processing).\n * Instead, store the disconnected transactions (in order!) as we go, remove any\n * that are included in blocks in the new chain, and then process the remaining\n * still-unconfirmed transactions at the end.\n */\n\n// multi_index tag names\nstruct txid_index {};\nstruct insertion_order {};\n\nstruct DisconnectedBlockTransactions {\n    typedef boost::multi_index_container<\n        CTransactionRef,\n        boost::multi_index::indexed_by<\n            // sorted by txid\n            boost::multi_index::hashed_unique<\n                boost::multi_index::tag<txid_index>,\n                mempoolentry_txid,\n                SaltedTxidHasher\n            >,\n            // sorted by order in the blockchain\n            boost::multi_index::sequenced<\n                boost::multi_index::tag<insertion_order>\n            >\n        >\n    > indexed_disconnected_transactions;\n\n    // It's almost certainly a logic bug if we don't clear out queuedTx before\n    // destruction, as we add to it while disconnecting blocks, and then we\n    // need to re-process remaining transactions to ensure mempool consistency.\n    // For now, assert() that we've emptied out this object on destruction.\n    // This assert() can always be removed if the reorg-processing code were\n    // to be refactored such that this assumption is no longer true (for\n    // instance if there was some other way we cleaned up the mempool after a\n    // reorg, besides draining this object).\n    ~DisconnectedBlockTransactions() { assert(queuedTx.empty()); }\n\n    indexed_disconnected_transactions queuedTx;\n    uint64_t cachedInnerUsage = 0;\n\n    // Estimate the overhead of queuedTx to be 6 pointers + an allocation, as\n    // no exact formula for boost::multi_index_contained is implemented.\n    size_t DynamicMemoryUsage() const {\n        return memusage::MallocUsage(sizeof(CTransactionRef) + 6 * sizeof(void*)) * queuedTx.size() + cachedInnerUsage;\n    }\n\n    void addTransaction(const CTransactionRef& tx)\n    {\n        queuedTx.insert(tx);\n        cachedInnerUsage += RecursiveDynamicUsage(tx);\n    }\n\n    // Remove entries based on txid_index, and update memory usage.\n    void removeForBlock(const std::vector<CTransactionRef>& vtx)\n    {\n        // Short-circuit in the common case of a block being added to the tip\n        if (queuedTx.empty()) {\n            return;\n        }\n        for (auto const &tx : vtx) {\n            auto it = queuedTx.find(tx->GetHash());\n            if (it != queuedTx.end()) {\n                cachedInnerUsage -= RecursiveDynamicUsage(*it);\n                queuedTx.erase(it);\n            }\n        }\n    }\n\n    // Remove an entry by insertion_order index, and update memory usage.\n    void removeEntry(indexed_disconnected_transactions::index<insertion_order>::type::iterator entry)\n    {\n        cachedInnerUsage -= RecursiveDynamicUsage(*entry);\n        queuedTx.get<insertion_order>().erase(entry);\n    }\n\n    void clear()\n    {\n        cachedInnerUsage = 0;\n        queuedTx.clear();\n    }\n};\n\n#endif // BITCOIN_TXMEMPOOL_H\n"
  },
  {
    "path": "src/ui_interface.cpp",
    "content": "// Copyright (c) 2010-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <ui_interface.h>\n#include <util.h>\n\nCClientUIInterface uiInterface;\n\nbool InitError(const std::string& str)\n{\n    uiInterface.ThreadSafeMessageBox(str, \"\", CClientUIInterface::MSG_ERROR);\n    return false;\n}\n\nvoid InitWarning(const std::string& str)\n{\n    uiInterface.ThreadSafeMessageBox(str, \"\", CClientUIInterface::MSG_WARNING);\n}\n\nstd::string AmountHighWarn(const std::string& optname)\n{\n    return strprintf(_(\"%s is set very high!\"), optname);\n}\n\nstd::string AmountErrMsg(const char* const optname, const std::string& strValue)\n{\n    return strprintf(_(\"Invalid amount for -%s=<amount>: '%s'\"), optname, strValue);\n}\n"
  },
  {
    "path": "src/ui_interface.h",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_UI_INTERFACE_H\n#define BITCOIN_UI_INTERFACE_H\n\n#include <stdint.h>\n#include <string>\n\n#include <boost/signals2/last_value.hpp>\n#include <boost/signals2/signal.hpp>\n\nclass CWallet;\nclass CBlockIndex;\n\n/** General change type (added, updated, removed). */\nenum ChangeType\n{\n    CT_NEW,\n    CT_UPDATED,\n    CT_DELETED\n};\n\n/** Signals for UI communication. */\nclass CClientUIInterface\n{\npublic:\n    /** Flags for CClientUIInterface::ThreadSafeMessageBox */\n    enum MessageBoxFlags\n    {\n        ICON_INFORMATION    = 0,\n        ICON_WARNING        = (1U << 0),\n        ICON_ERROR          = (1U << 1),\n        /**\n         * Mask of all available icons in CClientUIInterface::MessageBoxFlags\n         * This needs to be updated, when icons are changed there!\n         */\n        ICON_MASK = (ICON_INFORMATION | ICON_WARNING | ICON_ERROR),\n\n        /** These values are taken from qmessagebox.h \"enum StandardButton\" to be directly usable */\n        BTN_OK      = 0x00000400U, // QMessageBox::Ok\n        BTN_YES     = 0x00004000U, // QMessageBox::Yes\n        BTN_NO      = 0x00010000U, // QMessageBox::No\n        BTN_ABORT   = 0x00040000U, // QMessageBox::Abort\n        BTN_RETRY   = 0x00080000U, // QMessageBox::Retry\n        BTN_IGNORE  = 0x00100000U, // QMessageBox::Ignore\n        BTN_CLOSE   = 0x00200000U, // QMessageBox::Close\n        BTN_CANCEL  = 0x00400000U, // QMessageBox::Cancel\n        BTN_DISCARD = 0x00800000U, // QMessageBox::Discard\n        BTN_HELP    = 0x01000000U, // QMessageBox::Help\n        BTN_APPLY   = 0x02000000U, // QMessageBox::Apply\n        BTN_RESET   = 0x04000000U, // QMessageBox::Reset\n        /**\n         * Mask of all available buttons in CClientUIInterface::MessageBoxFlags\n         * This needs to be updated, when buttons are changed there!\n         */\n        BTN_MASK = (BTN_OK | BTN_YES | BTN_NO | BTN_ABORT | BTN_RETRY | BTN_IGNORE |\n                    BTN_CLOSE | BTN_CANCEL | BTN_DISCARD | BTN_HELP | BTN_APPLY | BTN_RESET),\n\n        /** Force blocking, modal message box dialog (not just OS notification) */\n        MODAL               = 0x10000000U,\n\n        /** Do not print contents of message to debug log */\n        SECURE              = 0x40000000U,\n\n        /** Predefined combinations for certain default usage cases */\n        MSG_INFORMATION = ICON_INFORMATION,\n        MSG_WARNING = (ICON_WARNING | BTN_OK | MODAL),\n        MSG_ERROR = (ICON_ERROR | BTN_OK | MODAL)\n    };\n\n    /** Show message box. */\n    boost::signals2::signal<bool (const std::string& message, const std::string& caption, unsigned int style), boost::signals2::last_value<bool> > ThreadSafeMessageBox;\n\n    /** If possible, ask the user a question. If not, falls back to ThreadSafeMessageBox(noninteractive_message, caption, style) and returns false. */\n    boost::signals2::signal<bool (const std::string& message, const std::string& noninteractive_message, const std::string& caption, unsigned int style), boost::signals2::last_value<bool> > ThreadSafeQuestion;\n\n    /** Progress message during initialization. */\n    boost::signals2::signal<void (const std::string &message)> InitMessage;\n\n    /** Number of network connections changed. */\n    boost::signals2::signal<void (int newNumConnections)> NotifyNumConnectionsChanged;\n\n    /** Network activity state changed. */\n    boost::signals2::signal<void (bool networkActive)> NotifyNetworkActiveChanged;\n\n    /**\n     * Status bar alerts changed.\n     */\n    boost::signals2::signal<void ()> NotifyAlertChanged;\n\n    /** A wallet has been loaded. */\n    boost::signals2::signal<void (CWallet* wallet)> LoadWallet;\n\n    /**\n     * Show progress e.g. for verifychain.\n     * resume_possible indicates shutting down now will result in the current progress action resuming upon restart.\n     */\n    boost::signals2::signal<void (const std::string &title, int nProgress, bool resume_possible)> ShowProgress;\n\n    /** New block has been accepted */\n    boost::signals2::signal<void (bool, const CBlockIndex *)> NotifyBlockTip;\n\n    /** Best header has changed */\n    boost::signals2::signal<void (bool, const CBlockIndex *)> NotifyHeaderTip;\n\n    /** Banlist did change. */\n    boost::signals2::signal<void (void)> BannedListChanged;\n};\n\n/** Show warning message **/\nvoid InitWarning(const std::string& str);\n\n/** Show error message **/\nbool InitError(const std::string& str);\n\nstd::string AmountHighWarn(const std::string& optname);\n\nstd::string AmountErrMsg(const char* const optname, const std::string& strValue);\n\nextern CClientUIInterface uiInterface;\n\n#endif // BITCOIN_UI_INTERFACE_H\n"
  },
  {
    "path": "src/uint256.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <uint256.h>\n\n#include <utilstrencodings.h>\n\n#include <stdio.h>\n#include <string.h>\n\ntemplate <unsigned int BITS>\nbase_blob<BITS>::base_blob(const std::vector<unsigned char>& vch)\n{\n    assert(vch.size() == sizeof(data));\n    memcpy(data, vch.data(), sizeof(data));\n}\n\ntemplate <unsigned int BITS>\nstd::string base_blob<BITS>::GetHex() const\n{\n    return HexStr(std::reverse_iterator<const uint8_t*>(data + sizeof(data)), std::reverse_iterator<const uint8_t*>(data));\n}\n\ntemplate <unsigned int BITS>\nvoid base_blob<BITS>::SetHex(const char* psz)\n{\n    memset(data, 0, sizeof(data));\n\n    // skip leading spaces\n    while (isspace(*psz))\n        psz++;\n\n    // skip 0x\n    if (psz[0] == '0' && tolower(psz[1]) == 'x')\n        psz += 2;\n\n    // hex string to uint\n    const char* pbegin = psz;\n    while (::HexDigit(*psz) != -1)\n        psz++;\n    psz--;\n    unsigned char* p1 = (unsigned char*)data;\n    unsigned char* pend = p1 + WIDTH;\n    while (psz >= pbegin && p1 < pend) {\n        *p1 = ::HexDigit(*psz--);\n        if (psz >= pbegin) {\n            *p1 |= ((unsigned char)::HexDigit(*psz--) << 4);\n            p1++;\n        }\n    }\n}\n\ntemplate <unsigned int BITS>\nvoid base_blob<BITS>::SetHex(const std::string& str)\n{\n    SetHex(str.c_str());\n}\n\ntemplate <unsigned int BITS>\nstd::string base_blob<BITS>::ToString() const\n{\n    return (GetHex());\n}\n\n// Explicit instantiations for base_blob<160>\ntemplate base_blob<160>::base_blob(const std::vector<unsigned char>&);\ntemplate std::string base_blob<160>::GetHex() const;\ntemplate std::string base_blob<160>::ToString() const;\ntemplate void base_blob<160>::SetHex(const char*);\ntemplate void base_blob<160>::SetHex(const std::string&);\n\n// Explicit instantiations for base_blob<256>\ntemplate base_blob<256>::base_blob(const std::vector<unsigned char>&);\ntemplate std::string base_blob<256>::GetHex() const;\ntemplate std::string base_blob<256>::ToString() const;\ntemplate void base_blob<256>::SetHex(const char*);\ntemplate void base_blob<256>::SetHex(const std::string&);\n"
  },
  {
    "path": "src/uint256.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_UINT256_H\n#define BITCOIN_UINT256_H\n\n#include <assert.h>\n#include <cstring>\n#include <stdexcept>\n#include <stdint.h>\n#include <string>\n#include <vector>\n#include <crypto/common.h>\n\n/** Template base class for fixed-sized opaque blobs. */\ntemplate<unsigned int BITS>\nclass base_blob\n{\nprotected:\n    static constexpr int WIDTH = BITS / 8;\n    uint8_t data[WIDTH];\npublic:\n    base_blob()\n    {\n        memset(data, 0, sizeof(data));\n    }\n\n    explicit base_blob(const std::vector<unsigned char>& vch);\n\n    bool IsNull() const\n    {\n        for (int i = 0; i < WIDTH; i++)\n            if (data[i] != 0)\n                return false;\n        return true;\n    }\n\n    void SetNull()\n    {\n        memset(data, 0, sizeof(data));\n    }\n\n    inline int Compare(const base_blob& other) const { return memcmp(data, other.data, sizeof(data)); }\n\n    friend inline bool operator==(const base_blob& a, const base_blob& b) { return a.Compare(b) == 0; }\n    friend inline bool operator!=(const base_blob& a, const base_blob& b) { return a.Compare(b) != 0; }\n    friend inline bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; }\n\n    std::string GetHex() const;\n    void SetHex(const char* psz);\n    void SetHex(const std::string& str);\n    std::string ToString() const;\n\n    unsigned char* begin()\n    {\n        return &data[0];\n    }\n\n    unsigned char* end()\n    {\n        return &data[WIDTH];\n    }\n\n    const unsigned char* begin() const\n    {\n        return &data[0];\n    }\n\n    const unsigned char* end() const\n    {\n        return &data[WIDTH];\n    }\n\n    unsigned int size() const\n    {\n        return sizeof(data);\n    }\n\n    uint64_t GetUint64(int pos) const\n    {\n        const uint8_t* ptr = data + pos * 8;\n        return ((uint64_t)ptr[0]) | \\\n               ((uint64_t)ptr[1]) << 8 | \\\n               ((uint64_t)ptr[2]) << 16 | \\\n               ((uint64_t)ptr[3]) << 24 | \\\n               ((uint64_t)ptr[4]) << 32 | \\\n               ((uint64_t)ptr[5]) << 40 | \\\n               ((uint64_t)ptr[6]) << 48 | \\\n               ((uint64_t)ptr[7]) << 56;\n    }\n\n    template<typename Stream>\n    void Serialize(Stream& s) const\n    {\n        s.write((char*)data, sizeof(data));\n    }\n\n    template<typename Stream>\n    void Unserialize(Stream& s)\n    {\n        s.read((char*)data, sizeof(data));\n    }\n};\n\n/** 160-bit opaque blob.\n * @note This type is called uint160 for historical reasons only. It is an opaque\n * blob of 160 bits and has no integer operations.\n */\nclass uint160 : public base_blob<160> {\npublic:\n    uint160() {}\n    explicit uint160(const std::vector<unsigned char>& vch) : base_blob<160>(vch) {}\n};\n\n/** 256-bit opaque blob.\n * @note This type is called uint256 for historical reasons only. It is an\n * opaque blob of 256 bits and has no integer operations. Use arith_uint256 if\n * those are required.\n */\nclass uint256 : public base_blob<256> {\npublic:\n    uint256() {}\n    explicit uint256(const std::vector<unsigned char>& vch) : base_blob<256>(vch) {}\n\n    /** A cheap hash function that just returns 64 bits from the result, it can be\n     * used when the contents are considered uniformly random. It is not appropriate\n     * when the value can easily be influenced from outside as e.g. a network adversary could\n     * provide values to trigger worst-case behavior.\n     */\n    uint64_t GetCheapHash() const\n    {\n        return ReadLE64(data);\n    }\n};\n\n/* uint256 from const char *.\n * This is a separate function because the constructor uint256(const char*) can result\n * in dangerously catching uint256(0).\n */\ninline uint256 uint256S(const char *str)\n{\n    uint256 rv;\n    rv.SetHex(str);\n    return rv;\n}\n/* uint256 from std::string.\n * This is a separate function because the constructor uint256(const std::string &str) can result\n * in dangerously catching uint256(0) via std::string(const char*).\n */\ninline uint256 uint256S(const std::string& str)\n{\n    uint256 rv;\n    rv.SetHex(str);\n    return rv;\n}\n\n#endif // BITCOIN_UINT256_H\n"
  },
  {
    "path": "src/undo.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_UNDO_H\n#define BITCOIN_UNDO_H\n\n#include <compressor.h>\n#include <consensus/consensus.h>\n#include <primitives/transaction.h>\n#include <serialize.h>\n\n/** Undo information for a CTxIn\n *\n *  Contains the prevout's CTxOut being spent, and its metadata as well\n *  (coinbase or not, height). The serialization contains a dummy value of\n *  zero. This is be compatible with older versions which expect to see\n *  the transaction version there.\n */\nclass TxInUndoSerializer\n{\n    const Coin* txout;\n\npublic:\n    template<typename Stream>\n    void Serialize(Stream &s) const {\n        ::Serialize(s, VARINT(txout->nHeight * 2 + (txout->fCoinBase ? 1 : 0)));\n        if (txout->nHeight > 0) {\n            // Required to maintain compatibility with older undo format.\n            ::Serialize(s, (unsigned char)0);\n        }\n        ::Serialize(s, CTxOutCompressor(REF(txout->out)));\n    }\n\n    explicit TxInUndoSerializer(const Coin* coin) : txout(coin) {}\n};\n\nclass TxInUndoDeserializer\n{\n    Coin* txout;\n\npublic:\n    template<typename Stream>\n    void Unserialize(Stream &s) {\n        unsigned int nCode = 0;\n        ::Unserialize(s, VARINT(nCode));\n        txout->nHeight = nCode / 2;\n        txout->fCoinBase = nCode & 1;\n        if (txout->nHeight > 0) {\n            // Old versions stored the version number for the last spend of\n            // a transaction's outputs. Non-final spends were indicated with\n            // height = 0.\n            int nVersionDummy;\n            ::Unserialize(s, VARINT(nVersionDummy));\n        }\n        ::Unserialize(s, REF(CTxOutCompressor(REF(txout->out))));\n    }\n\n    explicit TxInUndoDeserializer(Coin* coin) : txout(coin) {}\n};\n\nstatic const size_t MIN_TRANSACTION_INPUT_WEIGHT = WITNESS_SCALE_FACTOR * ::GetSerializeSize(CTxIn(), SER_NETWORK, PROTOCOL_VERSION);\nstatic const size_t MAX_INPUTS_PER_BLOCK = MAX_BLOCK_WEIGHT / MIN_TRANSACTION_INPUT_WEIGHT;\n\n/** Undo information for a CTransaction */\nclass CTxUndo\n{\npublic:\n    // undo information for all txins\n    std::vector<Coin> vprevout;\n\n    template <typename Stream>\n    void Serialize(Stream& s) const {\n        // TODO: avoid reimplementing vector serializer\n        uint64_t count = vprevout.size();\n        ::Serialize(s, COMPACTSIZE(REF(count)));\n        for (const auto& prevout : vprevout) {\n            ::Serialize(s, REF(TxInUndoSerializer(&prevout)));\n        }\n    }\n\n    template <typename Stream>\n    void Unserialize(Stream& s) {\n        // TODO: avoid reimplementing vector deserializer\n        uint64_t count = 0;\n        ::Unserialize(s, COMPACTSIZE(count));\n        if (count > MAX_INPUTS_PER_BLOCK) {\n            throw std::ios_base::failure(\"Too many input undo records\");\n        }\n        vprevout.resize(count);\n        for (auto& prevout : vprevout) {\n            ::Unserialize(s, REF(TxInUndoDeserializer(&prevout)));\n        }\n    }\n};\n\n/** Undo information for a CBlock */\nclass CBlockUndo\n{\npublic:\n    std::vector<CTxUndo> vtxundo; // for all but the coinbase\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(vtxundo);\n    }\n};\n\n#endif // BITCOIN_UNDO_H\n"
  },
  {
    "path": "src/univalue/.gitignore",
    "content": ".deps/\nINSTALL\nMakefile\nMakefile.in\naclocal.m4\nautom4te.cache/\ncompile\nconfig.log\nconfig.status\nconfig.guess\nconfig.sub\nconfigure\ndepcomp\ninstall-sh\nmissing\nstamp-h1\nunivalue-config.h*\ntest-driver\nlibtool\nltmain.sh\ntest-suite.log\n\n*.a\n*.la\n*.lo\n*.logs\n*.o\n*.pc\n*.trs\n\n.dirstamp\n.libs\n"
  },
  {
    "path": "src/univalue/.travis.yml",
    "content": "language: cpp\n\ncompiler:\n  - clang\n  - gcc\n\nos:\n  - linux\n  - osx\n\nsudo: false\n\nenv:\n  global:\n    - MAKEJOBS=-j3\n    - RUN_TESTS=true\n    - BASE_OUTDIR=$TRAVIS_BUILD_DIR/out\n\ncache:\n  apt: true\n\naddons:\n  apt:\n    packages:\n      - pkg-config\n\nbefore_script:\n  - if [ -n \"$USE_SHELL\" ]; then export CONFIG_SHELL=\"$USE_SHELL\"; fi\n  - test -n \"$USE_SHELL\" && eval '\"$USE_SHELL\" -c \"./autogen.sh\"' || ./autogen.sh\n\nscript:\n  - if [ -n \"$UNIVALUE_CONFIG\" ]; then unset CC; unset CXX; fi\n  - OUTDIR=$BASE_OUTDIR/$TRAVIS_PULL_REQUEST/$TRAVIS_JOB_NUMBER-$HOST\n  - UNIVALUE_CONFIG_ALL=\"--prefix=$TRAVIS_BUILD_DIR/depends/$HOST --bindir=$OUTDIR/bin --libdir=$OUTDIR/lib\"\n  - ./configure --cache-file=config.cache $UNIVALUE_CONFIG_ALL $UNIVALUE_CONFIG || ( cat config.log && false)\n  - make -s $MAKEJOBS $GOAL || ( echo \"Build failure. Verbose build follows.\" && make $GOAL ; false )\n  - export LD_LIBRARY_PATH=$TRAVIS_BUILD_DIR/depends/$HOST/lib\n  - if [ \"$RUN_TESTS\" = \"true\" ]; then make $MAKEJOBS distcheck; fi\n\nmatrix:\n  fast_finish: true\n  include:\n    - os: linux\n      compiler: gcc\n      env: UNIVALUE_CONFIG=--host=x86_64-w64-mingw32 RUN_TESTS=false\n      addons:\n        apt:\n          packages:\n            - g++-mingw-w64-x86-64\n            - gcc-mingw-w64-x86-64\n            - binutils-mingw-w64-x86-64\n"
  },
  {
    "path": "src/univalue/COPYING",
    "content": "\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n"
  },
  {
    "path": "src/univalue/Makefile.am",
    "content": "ACLOCAL_AMFLAGS = -I build-aux/m4\n.PHONY: gen\n.INTERMEDIATE: $(GENBIN)\n\ninclude_HEADERS = include/univalue.h\nnoinst_HEADERS = lib/univalue_escapes.h lib/univalue_utffilter.h\n\nlib_LTLIBRARIES = libunivalue.la\n\npkgconfigdir = $(libdir)/pkgconfig\npkgconfig_DATA = pc/libunivalue.pc\n\nlibunivalue_la_SOURCES = \\\n\tlib/univalue.cpp \\\n\tlib/univalue_get.cpp \\\n\tlib/univalue_read.cpp \\\n\tlib/univalue_write.cpp\n\nlibunivalue_la_LDFLAGS = \\\n\t-version-info $(LIBUNIVALUE_CURRENT):$(LIBUNIVALUE_REVISION):$(LIBUNIVALUE_AGE) \\\n\t-no-undefined\nlibunivalue_la_CXXFLAGS = -I$(top_srcdir)/include\n\nTESTS = test/object test/unitester test/no_nul\n\nGENBIN = gen/gen$(BUILD_EXEEXT)\nGEN_SRCS = gen/gen.cpp\n\n$(GENBIN): $(GEN_SRCS)\n\t@echo Building $@\n\t$(AM_V_at)c++ -I$(top_srcdir)/include -o $@ $<\n\ngen: lib/univalue_escapes.h $(GENBIN)\n\t@echo Updating $<\n\t$(AM_V_at)$(GENBIN) > lib/univalue_escapes.h\n\nnoinst_PROGRAMS = $(TESTS) test/test_json\n\nTEST_DATA_DIR=test\n\ntest_unitester_SOURCES = test/unitester.cpp\ntest_unitester_LDADD = libunivalue.la\ntest_unitester_CXXFLAGS = -I$(top_srcdir)/include -DJSON_TEST_SRC=\\\"$(srcdir)/$(TEST_DATA_DIR)\\\"\ntest_unitester_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS)\n\ntest_test_json_SOURCES = test/test_json.cpp\ntest_test_json_LDADD = libunivalue.la\ntest_test_json_CXXFLAGS = -I$(top_srcdir)/include\ntest_test_json_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS)\n\ntest_no_nul_SOURCES = test/no_nul.cpp\ntest_no_nul_LDADD = libunivalue.la\ntest_no_nul_CXXFLAGS = -I$(top_srcdir)/include\ntest_no_nul_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS)\n\ntest_object_SOURCES = test/object.cpp\ntest_object_LDADD = libunivalue.la\ntest_object_CXXFLAGS = -I$(top_srcdir)/include\ntest_object_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS)\n\nTEST_FILES = \\\n\t$(TEST_DATA_DIR)/fail10.json \\\n\t$(TEST_DATA_DIR)/fail11.json \\\n\t$(TEST_DATA_DIR)/fail12.json \\\n\t$(TEST_DATA_DIR)/fail13.json \\\n\t$(TEST_DATA_DIR)/fail14.json \\\n\t$(TEST_DATA_DIR)/fail15.json \\\n\t$(TEST_DATA_DIR)/fail16.json \\\n\t$(TEST_DATA_DIR)/fail17.json \\\n\t$(TEST_DATA_DIR)/fail18.json \\\n\t$(TEST_DATA_DIR)/fail19.json \\\n\t$(TEST_DATA_DIR)/fail1.json \\\n\t$(TEST_DATA_DIR)/fail20.json \\\n\t$(TEST_DATA_DIR)/fail21.json \\\n\t$(TEST_DATA_DIR)/fail22.json \\\n\t$(TEST_DATA_DIR)/fail23.json \\\n\t$(TEST_DATA_DIR)/fail24.json \\\n\t$(TEST_DATA_DIR)/fail25.json \\\n\t$(TEST_DATA_DIR)/fail26.json \\\n\t$(TEST_DATA_DIR)/fail27.json \\\n\t$(TEST_DATA_DIR)/fail28.json \\\n\t$(TEST_DATA_DIR)/fail29.json \\\n\t$(TEST_DATA_DIR)/fail2.json \\\n\t$(TEST_DATA_DIR)/fail30.json \\\n\t$(TEST_DATA_DIR)/fail31.json \\\n\t$(TEST_DATA_DIR)/fail32.json \\\n\t$(TEST_DATA_DIR)/fail33.json \\\n\t$(TEST_DATA_DIR)/fail34.json \\\n\t$(TEST_DATA_DIR)/fail35.json \\\n\t$(TEST_DATA_DIR)/fail36.json \\\n\t$(TEST_DATA_DIR)/fail37.json \\\n\t$(TEST_DATA_DIR)/fail38.json \\\n\t$(TEST_DATA_DIR)/fail39.json \\\n\t$(TEST_DATA_DIR)/fail40.json \\\n\t$(TEST_DATA_DIR)/fail41.json \\\n\t$(TEST_DATA_DIR)/fail42.json \\\n\t$(TEST_DATA_DIR)/fail44.json \\\n\t$(TEST_DATA_DIR)/fail3.json \\\n\t$(TEST_DATA_DIR)/fail4.json \\\n\t$(TEST_DATA_DIR)/fail5.json \\\n\t$(TEST_DATA_DIR)/fail6.json \\\n\t$(TEST_DATA_DIR)/fail7.json \\\n\t$(TEST_DATA_DIR)/fail8.json \\\n\t$(TEST_DATA_DIR)/fail9.json \\\n\t$(TEST_DATA_DIR)/pass1.json \\\n\t$(TEST_DATA_DIR)/pass2.json \\\n\t$(TEST_DATA_DIR)/pass3.json \\\n\t$(TEST_DATA_DIR)/round1.json \\\n\t$(TEST_DATA_DIR)/round2.json \\\n\t$(TEST_DATA_DIR)/round3.json \\\n\t$(TEST_DATA_DIR)/round4.json \\\n\t$(TEST_DATA_DIR)/round5.json \\\n\t$(TEST_DATA_DIR)/round6.json \\\n\t$(TEST_DATA_DIR)/round7.json\n\nEXTRA_DIST=$(TEST_FILES) $(GEN_SRCS)\n"
  },
  {
    "path": "src/univalue/README.md",
    "content": "\n# UniValue\n\n## Summary\n\nA universal value class, with JSON encoding and decoding.\n\nUniValue is an abstract data type that may be a null, boolean, string,\nnumber, array container, or a key/value dictionary container, nested to\nan arbitrary depth.\n\nThis class is aligned with the JSON standard, [RFC\n7159](https://tools.ietf.org/html/rfc7159.html).\n\n## Installation\n\nThis project is a standard GNU\n[autotools](https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html)\nproject.  Build and install instructions are available in the `INSTALL`\nfile provided with GNU autotools.\n\n```\n$ ./autogen.sh\n$ ./configure\n$ make\n```\n\n## Design\n\nUniValue provides a single dynamic RAII C++ object class,\nand minimizes template use (contra json_spirit).\n\n"
  },
  {
    "path": "src/univalue/TODO",
    "content": "\nRearrange tree for easier 'git subtree' style use\n\nMove towards C++11 etc.\n\nNamespace support - must come up with useful shorthand, avoiding\nlong Univalue::Univalue::Univalue usages forced upon library users.\n\nImprove test suite\n\n"
  },
  {
    "path": "src/univalue/autogen.sh",
    "content": "#!/bin/sh\nset -e\nsrcdir=\"$(dirname $0)\"\ncd \"$srcdir\"\nif [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE=\"`which glibtoolize 2>/dev/null`\"; then\n  LIBTOOLIZE=\"${GLIBTOOLIZE}\"\n  export LIBTOOLIZE\nfi\nautoreconf --install --force\n"
  },
  {
    "path": "src/univalue/build-aux/m4/.gitignore",
    "content": "/*.m4\n"
  },
  {
    "path": "src/univalue/configure.ac",
    "content": "m4_define([libunivalue_major_version], [1])\nm4_define([libunivalue_minor_version], [1])\nm4_define([libunivalue_micro_version], [3])\nm4_define([libunivalue_interface_age], [3])\n# If you need a modifier for the version number. \n# Normally empty, but can be used to make \"fixup\" releases.\nm4_define([libunivalue_extraversion], [])\n\ndnl libtool versioning from libunivalue\nm4_define([libunivalue_current], [m4_eval(100 * libunivalue_minor_version + libunivalue_micro_version - libunivalue_interface_age)])\nm4_define([libunivalue_binary_age], [m4_eval(100 * libunivalue_minor_version + libunivalue_micro_version)])\nm4_define([libunivalue_revision], [libunivalue_interface_age])\nm4_define([libunivalue_age], [m4_eval(libunivalue_binary_age - libunivalue_interface_age)])\nm4_define([libunivalue_version], [libunivalue_major_version().libunivalue_minor_version().libunivalue_micro_version()libunivalue_extraversion()])\n\n\nAC_INIT([univalue], [1.0.3],\n        [http://github.com/jgarzik/univalue/])\n\ndnl make the compilation flags quiet unless V=1 is used\nm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])\n\nAC_PREREQ(2.60)\nAC_CONFIG_SRCDIR([lib/univalue.cpp])\nAC_CONFIG_AUX_DIR([build-aux])\nAC_CONFIG_MACRO_DIR([build-aux/m4])\nAC_CONFIG_HEADERS([univalue-config.h])\nAM_INIT_AUTOMAKE([subdir-objects foreign])\n\nLIBUNIVALUE_MAJOR_VERSION=libunivalue_major_version\nLIBUNIVALUE_MINOR_VERSION=libunivalue_minor_version\nLIBUNIVALUE_MICRO_VERSION=libunivalue_micro_version\nLIBUNIVALUE_INTERFACE_AGE=libunivalue_interface_age\n\n# ABI version\n# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html\nLIBUNIVALUE_CURRENT=libunivalue_current\nLIBUNIVALUE_REVISION=libunivalue_revision\nLIBUNIVALUE_AGE=libunivalue_age\n\nAC_SUBST(LIBUNIVALUE_CURRENT)\nAC_SUBST(LIBUNIVALUE_REVISION)\nAC_SUBST(LIBUNIVALUE_AGE)\n\nLT_INIT\nLT_LANG([C++])\n\ncase $host in\n  *mingw*)\n    LIBTOOL_APP_LDFLAGS=\"$LIBTOOL_APP_LDFLAGS -all-static\"\n  ;;\nesac\n\nBUILD_EXEEXT=\ncase $build in\n  *mingw*)\n    BUILD_EXEEXT=\".exe\"\n  ;;\nesac\n\nAC_CONFIG_FILES([\n    Makefile\n    pc/libunivalue.pc\n    pc/libunivalue-uninstalled.pc])\n\nAC_SUBST(LIBTOOL_APP_LDFLAGS)\nAC_SUBST(BUILD_EXEEXT)\nAC_OUTPUT\n\n"
  },
  {
    "path": "src/univalue/include/univalue.h",
    "content": "// Copyright 2014 BitPay Inc.\n// Copyright 2015 Bitcoin Core Developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef __UNIVALUE_H__\n#define __UNIVALUE_H__\n\n#include <stdint.h>\n#include <string.h>\n\n#include <string>\n#include <vector>\n#include <map>\n#include <cassert>\n\n#include <sstream>        // .get_int64()\n#include <utility>        // std::pair\n\nclass UniValue {\npublic:\n    enum VType { VNULL, VOBJ, VARR, VSTR, VNUM, VBOOL, };\n\n    UniValue() { typ = VNULL; }\n    UniValue(UniValue::VType initialType, const std::string& initialStr = \"\") {\n        typ = initialType;\n        val = initialStr;\n    }\n    UniValue(uint64_t val_) {\n        setInt(val_);\n    }\n    UniValue(int64_t val_) {\n        setInt(val_);\n    }\n    UniValue(bool val_) {\n        setBool(val_);\n    }\n    UniValue(int val_) {\n        setInt(val_);\n    }\n    UniValue(double val_) {\n        setFloat(val_);\n    }\n    UniValue(const std::string& val_) {\n        setStr(val_);\n    }\n    UniValue(const char *val_) {\n        std::string s(val_);\n        setStr(s);\n    }\n    ~UniValue() {}\n\n    void clear();\n\n    bool setNull();\n    bool setBool(bool val);\n    bool setNumStr(const std::string& val);\n    bool setInt(uint64_t val);\n    bool setInt(int64_t val);\n    bool setInt(int val_) { return setInt((int64_t)val_); }\n    bool setFloat(double val);\n    bool setStr(const std::string& val);\n    bool setArray();\n    bool setObject();\n\n    enum VType getType() const { return typ; }\n    const std::string& getValStr() const { return val; }\n    bool empty() const { return (values.size() == 0); }\n\n    size_t size() const { return values.size(); }\n\n    bool getBool() const { return isTrue(); }\n    void getObjMap(std::map<std::string,UniValue>& kv) const;\n    bool checkObject(const std::map<std::string,UniValue::VType>& memberTypes) const;\n    const UniValue& operator[](const std::string& key) const;\n    const UniValue& operator[](size_t index) const;\n    bool exists(const std::string& key) const { size_t i; return findKey(key, i); }\n\n    bool isNull() const { return (typ == VNULL); }\n    bool isTrue() const { return (typ == VBOOL) && (val == \"1\"); }\n    bool isFalse() const { return (typ == VBOOL) && (val != \"1\"); }\n    bool isBool() const { return (typ == VBOOL); }\n    bool isStr() const { return (typ == VSTR); }\n    bool isNum() const { return (typ == VNUM); }\n    bool isArray() const { return (typ == VARR); }\n    bool isObject() const { return (typ == VOBJ); }\n\n    bool push_back(const UniValue& val);\n    bool push_back(const std::string& val_) {\n        UniValue tmpVal(VSTR, val_);\n        return push_back(tmpVal);\n    }\n    bool push_back(const char *val_) {\n        std::string s(val_);\n        return push_back(s);\n    }\n    bool push_back(uint64_t val_) {\n        UniValue tmpVal(val_);\n        return push_back(tmpVal);\n    }\n    bool push_back(int64_t val_) {\n        UniValue tmpVal(val_);\n        return push_back(tmpVal);\n    }\n    bool push_back(int val_) {\n        UniValue tmpVal(val_);\n        return push_back(tmpVal);\n    }\n    bool push_back(double val_) {\n        UniValue tmpVal(val_);\n        return push_back(tmpVal);\n    }\n    bool push_backV(const std::vector<UniValue>& vec);\n\n    void __pushKV(const std::string& key, const UniValue& val);\n    bool pushKV(const std::string& key, const UniValue& val);\n    bool pushKV(const std::string& key, const std::string& val_) {\n        UniValue tmpVal(VSTR, val_);\n        return pushKV(key, tmpVal);\n    }\n    bool pushKV(const std::string& key, const char *val_) {\n        std::string _val(val_);\n        return pushKV(key, _val);\n    }\n    bool pushKV(const std::string& key, int64_t val_) {\n        UniValue tmpVal(val_);\n        return pushKV(key, tmpVal);\n    }\n    bool pushKV(const std::string& key, uint64_t val_) {\n        UniValue tmpVal(val_);\n        return pushKV(key, tmpVal);\n    }\n    bool pushKV(const std::string& key, int val_) {\n        UniValue tmpVal((int64_t)val_);\n        return pushKV(key, tmpVal);\n    }\n    bool pushKV(const std::string& key, double val_) {\n        UniValue tmpVal(val_);\n        return pushKV(key, tmpVal);\n    }\n    bool pushKVs(const UniValue& obj);\n\n    std::string write(unsigned int prettyIndent = 0,\n                      unsigned int indentLevel = 0) const;\n\n    bool read(const char *raw, size_t len);\n    bool read(const char *raw) { return read(raw, strlen(raw)); }\n    bool read(const std::string& rawStr) {\n        return read(rawStr.data(), rawStr.size());\n    }\n\nprivate:\n    UniValue::VType typ;\n    std::string val;                       // numbers are stored as C++ strings\n    std::vector<std::string> keys;\n    std::vector<UniValue> values;\n\n    bool findKey(const std::string& key, size_t& retIdx) const;\n    void writeArray(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const;\n    void writeObject(unsigned int prettyIndent, unsigned int indentLevel, std::string& s) const;\n\npublic:\n    // Strict type-specific getters, these throw std::runtime_error if the\n    // value is of unexpected type\n    const std::vector<std::string>& getKeys() const;\n    const std::vector<UniValue>& getValues() const;\n    bool get_bool() const;\n    const std::string& get_str() const;\n    int get_int() const;\n    int64_t get_int64() const;\n    double get_real() const;\n    const UniValue& get_obj() const;\n    const UniValue& get_array() const;\n\n    enum VType type() const { return getType(); }\n    bool push_back(std::pair<std::string,UniValue> pear) {\n        return pushKV(pear.first, pear.second);\n    }\n    friend const UniValue& find_value( const UniValue& obj, const std::string& name);\n};\n\n//\n// The following were added for compatibility with json_spirit.\n// Most duplicate other methods, and should be removed.\n//\nstatic inline std::pair<std::string,UniValue> Pair(const char *cKey, const char *cVal)\n{\n    std::string key(cKey);\n    UniValue uVal(cVal);\n    return std::make_pair(key, uVal);\n}\n\nstatic inline std::pair<std::string,UniValue> Pair(const char *cKey, std::string strVal)\n{\n    std::string key(cKey);\n    UniValue uVal(strVal);\n    return std::make_pair(key, uVal);\n}\n\nstatic inline std::pair<std::string,UniValue> Pair(const char *cKey, uint64_t u64Val)\n{\n    std::string key(cKey);\n    UniValue uVal(u64Val);\n    return std::make_pair(key, uVal);\n}\n\nstatic inline std::pair<std::string,UniValue> Pair(const char *cKey, int64_t i64Val)\n{\n    std::string key(cKey);\n    UniValue uVal(i64Val);\n    return std::make_pair(key, uVal);\n}\n\nstatic inline std::pair<std::string,UniValue> Pair(const char *cKey, bool iVal)\n{\n    std::string key(cKey);\n    UniValue uVal(iVal);\n    return std::make_pair(key, uVal);\n}\n\nstatic inline std::pair<std::string,UniValue> Pair(const char *cKey, int iVal)\n{\n    std::string key(cKey);\n    UniValue uVal(iVal);\n    return std::make_pair(key, uVal);\n}\n\nstatic inline std::pair<std::string,UniValue> Pair(const char *cKey, double dVal)\n{\n    std::string key(cKey);\n    UniValue uVal(dVal);\n    return std::make_pair(key, uVal);\n}\n\nstatic inline std::pair<std::string,UniValue> Pair(const char *cKey, const UniValue& uVal)\n{\n    std::string key(cKey);\n    return std::make_pair(key, uVal);\n}\n\nstatic inline std::pair<std::string,UniValue> Pair(std::string key, const UniValue& uVal)\n{\n    return std::make_pair(key, uVal);\n}\n\nenum jtokentype {\n    JTOK_ERR        = -1,\n    JTOK_NONE       = 0,                           // eof\n    JTOK_OBJ_OPEN,\n    JTOK_OBJ_CLOSE,\n    JTOK_ARR_OPEN,\n    JTOK_ARR_CLOSE,\n    JTOK_COLON,\n    JTOK_COMMA,\n    JTOK_KW_NULL,\n    JTOK_KW_TRUE,\n    JTOK_KW_FALSE,\n    JTOK_NUMBER,\n    JTOK_STRING,\n};\n\nextern enum jtokentype getJsonToken(std::string& tokenVal,\n                                    unsigned int& consumed, const char *raw, const char *end);\nextern const char *uvTypeName(UniValue::VType t);\n\nstatic inline bool jsonTokenIsValue(enum jtokentype jtt)\n{\n    switch (jtt) {\n    case JTOK_KW_NULL:\n    case JTOK_KW_TRUE:\n    case JTOK_KW_FALSE:\n    case JTOK_NUMBER:\n    case JTOK_STRING:\n        return true;\n\n    default:\n        return false;\n    }\n\n    // not reached\n}\n\nstatic inline bool json_isspace(int ch)\n{\n    switch (ch) {\n    case 0x20:\n    case 0x09:\n    case 0x0a:\n    case 0x0d:\n        return true;\n\n    default:\n        return false;\n    }\n\n    // not reached\n}\n\nextern const UniValue NullUniValue;\n\nconst UniValue& find_value( const UniValue& obj, const std::string& name);\n\n#endif // __UNIVALUE_H__\n"
  },
  {
    "path": "src/univalue/lib/.gitignore",
    "content": "gen\n.libs\n"
  },
  {
    "path": "src/univalue/lib/univalue.cpp",
    "content": "// Copyright 2014 BitPay Inc.\n// Copyright 2015 Bitcoin Core Developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <stdint.h>\n#include <iomanip>\n#include <sstream>\n#include <stdlib.h>\n\n#include \"univalue.h\"\n\nusing namespace std;\n\nconst UniValue NullUniValue;\n\nvoid UniValue::clear()\n{\n    typ = VNULL;\n    val.clear();\n    keys.clear();\n    values.clear();\n}\n\nbool UniValue::setNull()\n{\n    clear();\n    return true;\n}\n\nbool UniValue::setBool(bool val_)\n{\n    clear();\n    typ = VBOOL;\n    if (val_)\n        val = \"1\";\n    return true;\n}\n\nstatic bool validNumStr(const string& s)\n{\n    string tokenVal;\n    unsigned int consumed;\n    enum jtokentype tt = getJsonToken(tokenVal, consumed, s.data(), s.data() + s.size());\n    return (tt == JTOK_NUMBER);\n}\n\nbool UniValue::setNumStr(const string& val_)\n{\n    if (!validNumStr(val_))\n        return false;\n\n    clear();\n    typ = VNUM;\n    val = val_;\n    return true;\n}\n\nbool UniValue::setInt(uint64_t val_)\n{\n    ostringstream oss;\n\n    oss << val_;\n\n    return setNumStr(oss.str());\n}\n\nbool UniValue::setInt(int64_t val_)\n{\n    ostringstream oss;\n\n    oss << val_;\n\n    return setNumStr(oss.str());\n}\n\nbool UniValue::setFloat(double val_)\n{\n    ostringstream oss;\n\n    oss << std::setprecision(16) << val_;\n\n    bool ret = setNumStr(oss.str());\n    typ = VNUM;\n    return ret;\n}\n\nbool UniValue::setStr(const string& val_)\n{\n    clear();\n    typ = VSTR;\n    val = val_;\n    return true;\n}\n\nbool UniValue::setArray()\n{\n    clear();\n    typ = VARR;\n    return true;\n}\n\nbool UniValue::setObject()\n{\n    clear();\n    typ = VOBJ;\n    return true;\n}\n\nbool UniValue::push_back(const UniValue& val_)\n{\n    if (typ != VARR)\n        return false;\n\n    values.push_back(val_);\n    return true;\n}\n\nbool UniValue::push_backV(const std::vector<UniValue>& vec)\n{\n    if (typ != VARR)\n        return false;\n\n    values.insert(values.end(), vec.begin(), vec.end());\n\n    return true;\n}\n\nvoid UniValue::__pushKV(const std::string& key, const UniValue& val_)\n{\n    keys.push_back(key);\n    values.push_back(val_);\n}\n\nbool UniValue::pushKV(const std::string& key, const UniValue& val_)\n{\n    if (typ != VOBJ)\n        return false;\n\n    size_t idx;\n    if (findKey(key, idx))\n        values[idx] = val_;\n    else\n        __pushKV(key, val_);\n    return true;\n}\n\nbool UniValue::pushKVs(const UniValue& obj)\n{\n    if (typ != VOBJ || obj.typ != VOBJ)\n        return false;\n\n    for (size_t i = 0; i < obj.keys.size(); i++)\n        __pushKV(obj.keys[i], obj.values.at(i));\n\n    return true;\n}\n\nvoid UniValue::getObjMap(std::map<std::string,UniValue>& kv) const\n{\n    if (typ != VOBJ)\n        return;\n\n    kv.clear();\n    for (size_t i = 0; i < keys.size(); i++)\n        kv[keys[i]] = values[i];\n}\n\nbool UniValue::findKey(const std::string& key, size_t& retIdx) const\n{\n    for (size_t i = 0; i < keys.size(); i++) {\n        if (keys[i] == key) {\n            retIdx = i;\n            return true;\n        }\n    }\n\n    return false;\n}\n\nbool UniValue::checkObject(const std::map<std::string,UniValue::VType>& t) const\n{\n    if (typ != VOBJ)\n        return false;\n\n    for (std::map<std::string,UniValue::VType>::const_iterator it = t.begin();\n         it != t.end(); ++it) {\n        size_t idx = 0;\n        if (!findKey(it->first, idx))\n            return false;\n\n        if (values.at(idx).getType() != it->second)\n            return false;\n    }\n\n    return true;\n}\n\nconst UniValue& UniValue::operator[](const std::string& key) const\n{\n    if (typ != VOBJ)\n        return NullUniValue;\n\n    size_t index = 0;\n    if (!findKey(key, index))\n        return NullUniValue;\n\n    return values.at(index);\n}\n\nconst UniValue& UniValue::operator[](size_t index) const\n{\n    if (typ != VOBJ && typ != VARR)\n        return NullUniValue;\n    if (index >= values.size())\n        return NullUniValue;\n\n    return values.at(index);\n}\n\nconst char *uvTypeName(UniValue::VType t)\n{\n    switch (t) {\n    case UniValue::VNULL: return \"null\";\n    case UniValue::VBOOL: return \"bool\";\n    case UniValue::VOBJ: return \"object\";\n    case UniValue::VARR: return \"array\";\n    case UniValue::VSTR: return \"string\";\n    case UniValue::VNUM: return \"number\";\n    }\n\n    // not reached\n    return NULL;\n}\n\nconst UniValue& find_value(const UniValue& obj, const std::string& name)\n{\n    for (unsigned int i = 0; i < obj.keys.size(); i++)\n        if (obj.keys[i] == name)\n            return obj.values.at(i);\n\n    return NullUniValue;\n}\n\n"
  },
  {
    "path": "src/univalue/lib/univalue_escapes.h",
    "content": "// Automatically generated file. Do not modify.\n#ifndef BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n#define BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\nstatic const char *escapes[256] = {\n\t\"\\\\u0000\",\n\t\"\\\\u0001\",\n\t\"\\\\u0002\",\n\t\"\\\\u0003\",\n\t\"\\\\u0004\",\n\t\"\\\\u0005\",\n\t\"\\\\u0006\",\n\t\"\\\\u0007\",\n\t\"\\\\b\",\n\t\"\\\\t\",\n\t\"\\\\n\",\n\t\"\\\\u000b\",\n\t\"\\\\f\",\n\t\"\\\\r\",\n\t\"\\\\u000e\",\n\t\"\\\\u000f\",\n\t\"\\\\u0010\",\n\t\"\\\\u0011\",\n\t\"\\\\u0012\",\n\t\"\\\\u0013\",\n\t\"\\\\u0014\",\n\t\"\\\\u0015\",\n\t\"\\\\u0016\",\n\t\"\\\\u0017\",\n\t\"\\\\u0018\",\n\t\"\\\\u0019\",\n\t\"\\\\u001a\",\n\t\"\\\\u001b\",\n\t\"\\\\u001c\",\n\t\"\\\\u001d\",\n\t\"\\\\u001e\",\n\t\"\\\\u001f\",\n\tNULL,\n\tNULL,\n\t\"\\\\\\\"\",\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\t\"\\\\\\\\\",\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\t\"\\\\u007f\",\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n\tNULL,\n};\n#endif // BITCOIN_UNIVALUE_UNIVALUE_ESCAPES_H\n"
  },
  {
    "path": "src/univalue/lib/univalue_get.cpp",
    "content": "// Copyright 2014 BitPay Inc.\n// Copyright 2015 Bitcoin Core Developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <stdint.h>\n#include <errno.h>\n#include <string.h>\n#include <stdlib.h>\n#include <stdexcept>\n#include <vector>\n#include <limits>\n#include <string>\n\n#include \"univalue.h\"\n\nnamespace\n{\nstatic bool ParsePrechecks(const std::string& str)\n{\n    if (str.empty()) // No empty string allowed\n        return false;\n    if (str.size() >= 1 && (json_isspace(str[0]) || json_isspace(str[str.size()-1]))) // No padding allowed\n        return false;\n    if (str.size() != strlen(str.c_str())) // No embedded NUL characters allowed\n        return false;\n    return true;\n}\n\nbool ParseInt32(const std::string& str, int32_t *out)\n{\n    if (!ParsePrechecks(str))\n        return false;\n    char *endp = NULL;\n    errno = 0; // strtol will not set errno if valid\n    long int n = strtol(str.c_str(), &endp, 10);\n    if(out) *out = (int32_t)n;\n    // Note that strtol returns a *long int*, so even if strtol doesn't report a over/underflow\n    // we still have to check that the returned value is within the range of an *int32_t*. On 64-bit\n    // platforms the size of these types may be different.\n    return endp && *endp == 0 && !errno &&\n        n >= std::numeric_limits<int32_t>::min() &&\n        n <= std::numeric_limits<int32_t>::max();\n}\n\nbool ParseInt64(const std::string& str, int64_t *out)\n{\n    if (!ParsePrechecks(str))\n        return false;\n    char *endp = NULL;\n    errno = 0; // strtoll will not set errno if valid\n    long long int n = strtoll(str.c_str(), &endp, 10);\n    if(out) *out = (int64_t)n;\n    // Note that strtoll returns a *long long int*, so even if strtol doesn't report a over/underflow\n    // we still have to check that the returned value is within the range of an *int64_t*.\n    return endp && *endp == 0 && !errno &&\n        n >= std::numeric_limits<int64_t>::min() &&\n        n <= std::numeric_limits<int64_t>::max();\n}\n\nbool ParseDouble(const std::string& str, double *out)\n{\n    if (!ParsePrechecks(str))\n        return false;\n    if (str.size() >= 2 && str[0] == '0' && str[1] == 'x') // No hexadecimal floats allowed\n        return false;\n    std::istringstream text(str);\n    text.imbue(std::locale::classic());\n    double result;\n    text >> result;\n    if(out) *out = result;\n    return text.eof() && !text.fail();\n}\n}\n\nconst std::vector<std::string>& UniValue::getKeys() const\n{\n    if (typ != VOBJ)\n        throw std::runtime_error(\"JSON value is not an object as expected\");\n    return keys;\n}\n\nconst std::vector<UniValue>& UniValue::getValues() const\n{\n    if (typ != VOBJ && typ != VARR)\n        throw std::runtime_error(\"JSON value is not an object or array as expected\");\n    return values;\n}\n\nbool UniValue::get_bool() const\n{\n    if (typ != VBOOL)\n        throw std::runtime_error(\"JSON value is not a boolean as expected\");\n    return getBool();\n}\n\nconst std::string& UniValue::get_str() const\n{\n    if (typ != VSTR)\n        throw std::runtime_error(\"JSON value is not a string as expected\");\n    return getValStr();\n}\n\nint UniValue::get_int() const\n{\n    if (typ != VNUM)\n        throw std::runtime_error(\"JSON value is not an integer as expected\");\n    int32_t retval;\n    if (!ParseInt32(getValStr(), &retval))\n        throw std::runtime_error(\"JSON integer out of range\");\n    return retval;\n}\n\nint64_t UniValue::get_int64() const\n{\n    if (typ != VNUM)\n        throw std::runtime_error(\"JSON value is not an integer as expected\");\n    int64_t retval;\n    if (!ParseInt64(getValStr(), &retval))\n        throw std::runtime_error(\"JSON integer out of range\");\n    return retval;\n}\n\ndouble UniValue::get_real() const\n{\n    if (typ != VNUM)\n        throw std::runtime_error(\"JSON value is not a number as expected\");\n    double retval;\n    if (!ParseDouble(getValStr(), &retval))\n        throw std::runtime_error(\"JSON double out of range\");\n    return retval;\n}\n\nconst UniValue& UniValue::get_obj() const\n{\n    if (typ != VOBJ)\n        throw std::runtime_error(\"JSON value is not an object as expected\");\n    return *this;\n}\n\nconst UniValue& UniValue::get_array() const\n{\n    if (typ != VARR)\n        throw std::runtime_error(\"JSON value is not an array as expected\");\n    return *this;\n}\n\n"
  },
  {
    "path": "src/univalue/lib/univalue_read.cpp",
    "content": "// Copyright 2014 BitPay Inc.\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <string.h>\n#include <vector>\n#include <stdio.h>\n#include \"univalue.h\"\n#include \"univalue_utffilter.h\"\n\nusing namespace std;\n\nstatic bool json_isdigit(int ch)\n{\n    return ((ch >= '0') && (ch <= '9'));\n}\n\n// convert hexadecimal string to unsigned integer\nstatic const char *hatoui(const char *first, const char *last,\n                          unsigned int& out)\n{\n    unsigned int result = 0;\n    for (; first != last; ++first)\n    {\n        int digit;\n        if (json_isdigit(*first))\n            digit = *first - '0';\n\n        else if (*first >= 'a' && *first <= 'f')\n            digit = *first - 'a' + 10;\n\n        else if (*first >= 'A' && *first <= 'F')\n            digit = *first - 'A' + 10;\n\n        else\n            break;\n\n        result = 16 * result + digit;\n    }\n    out = result;\n\n    return first;\n}\n\nenum jtokentype getJsonToken(string& tokenVal, unsigned int& consumed,\n                            const char *raw, const char *end)\n{\n    tokenVal.clear();\n    consumed = 0;\n\n    const char *rawStart = raw;\n\n    while (raw < end && (json_isspace(*raw)))          // skip whitespace\n        raw++;\n\n    if (raw >= end)\n        return JTOK_NONE;\n\n    switch (*raw) {\n\n    case '{':\n        raw++;\n        consumed = (raw - rawStart);\n        return JTOK_OBJ_OPEN;\n    case '}':\n        raw++;\n        consumed = (raw - rawStart);\n        return JTOK_OBJ_CLOSE;\n    case '[':\n        raw++;\n        consumed = (raw - rawStart);\n        return JTOK_ARR_OPEN;\n    case ']':\n        raw++;\n        consumed = (raw - rawStart);\n        return JTOK_ARR_CLOSE;\n\n    case ':':\n        raw++;\n        consumed = (raw - rawStart);\n        return JTOK_COLON;\n    case ',':\n        raw++;\n        consumed = (raw - rawStart);\n        return JTOK_COMMA;\n\n    case 'n':\n    case 't':\n    case 'f':\n        if (!strncmp(raw, \"null\", 4)) {\n            raw += 4;\n            consumed = (raw - rawStart);\n            return JTOK_KW_NULL;\n        } else if (!strncmp(raw, \"true\", 4)) {\n            raw += 4;\n            consumed = (raw - rawStart);\n            return JTOK_KW_TRUE;\n        } else if (!strncmp(raw, \"false\", 5)) {\n            raw += 5;\n            consumed = (raw - rawStart);\n            return JTOK_KW_FALSE;\n        } else\n            return JTOK_ERR;\n\n    case '-':\n    case '0':\n    case '1':\n    case '2':\n    case '3':\n    case '4':\n    case '5':\n    case '6':\n    case '7':\n    case '8':\n    case '9': {\n        // part 1: int\n        string numStr;\n\n        const char *first = raw;\n\n        const char *firstDigit = first;\n        if (!json_isdigit(*firstDigit))\n            firstDigit++;\n        if ((*firstDigit == '0') && json_isdigit(firstDigit[1]))\n            return JTOK_ERR;\n\n        numStr += *raw;                       // copy first char\n        raw++;\n\n        if ((*first == '-') && (raw < end) && (!json_isdigit(*raw)))\n            return JTOK_ERR;\n\n        while (raw < end && json_isdigit(*raw)) {  // copy digits\n            numStr += *raw;\n            raw++;\n        }\n\n        // part 2: frac\n        if (raw < end && *raw == '.') {\n            numStr += *raw;                   // copy .\n            raw++;\n\n            if (raw >= end || !json_isdigit(*raw))\n                return JTOK_ERR;\n            while (raw < end && json_isdigit(*raw)) { // copy digits\n                numStr += *raw;\n                raw++;\n            }\n        }\n\n        // part 3: exp\n        if (raw < end && (*raw == 'e' || *raw == 'E')) {\n            numStr += *raw;                   // copy E\n            raw++;\n\n            if (raw < end && (*raw == '-' || *raw == '+')) { // copy +/-\n                numStr += *raw;\n                raw++;\n            }\n\n            if (raw >= end || !json_isdigit(*raw))\n                return JTOK_ERR;\n            while (raw < end && json_isdigit(*raw)) { // copy digits\n                numStr += *raw;\n                raw++;\n            }\n        }\n\n        tokenVal = numStr;\n        consumed = (raw - rawStart);\n        return JTOK_NUMBER;\n        }\n\n    case '\"': {\n        raw++;                                // skip \"\n\n        string valStr;\n        JSONUTF8StringFilter writer(valStr);\n\n        while (true) {\n            if (raw >= end || (unsigned char)*raw < 0x20)\n                return JTOK_ERR;\n\n            else if (*raw == '\\\\') {\n                raw++;                        // skip backslash\n\n                if (raw >= end)\n                    return JTOK_ERR;\n\n                switch (*raw) {\n                case '\"':  writer.push_back('\\\"'); break;\n                case '\\\\': writer.push_back('\\\\'); break;\n                case '/':  writer.push_back('/'); break;\n                case 'b':  writer.push_back('\\b'); break;\n                case 'f':  writer.push_back('\\f'); break;\n                case 'n':  writer.push_back('\\n'); break;\n                case 'r':  writer.push_back('\\r'); break;\n                case 't':  writer.push_back('\\t'); break;\n\n                case 'u': {\n                    unsigned int codepoint;\n                    if (raw + 1 + 4 >= end ||\n                        hatoui(raw + 1, raw + 1 + 4, codepoint) !=\n                               raw + 1 + 4)\n                        return JTOK_ERR;\n                    writer.push_back_u(codepoint);\n                    raw += 4;\n                    break;\n                    }\n                default:\n                    return JTOK_ERR;\n\n                }\n\n                raw++;                        // skip esc'd char\n            }\n\n            else if (*raw == '\"') {\n                raw++;                        // skip \"\n                break;                        // stop scanning\n            }\n\n            else {\n                writer.push_back(*raw);\n                raw++;\n            }\n        }\n\n        if (!writer.finalize())\n            return JTOK_ERR;\n        tokenVal = valStr;\n        consumed = (raw - rawStart);\n        return JTOK_STRING;\n        }\n\n    default:\n        return JTOK_ERR;\n    }\n}\n\nenum expect_bits {\n    EXP_OBJ_NAME = (1U << 0),\n    EXP_COLON = (1U << 1),\n    EXP_ARR_VALUE = (1U << 2),\n    EXP_VALUE = (1U << 3),\n    EXP_NOT_VALUE = (1U << 4),\n};\n\n#define expect(bit) (expectMask & (EXP_##bit))\n#define setExpect(bit) (expectMask |= EXP_##bit)\n#define clearExpect(bit) (expectMask &= ~EXP_##bit)\n\nbool UniValue::read(const char *raw, size_t size)\n{\n    clear();\n\n    uint32_t expectMask = 0;\n    vector<UniValue*> stack;\n\n    string tokenVal;\n    unsigned int consumed;\n    enum jtokentype tok = JTOK_NONE;\n    enum jtokentype last_tok = JTOK_NONE;\n    const char* end = raw + size;\n    do {\n        last_tok = tok;\n\n        tok = getJsonToken(tokenVal, consumed, raw, end);\n        if (tok == JTOK_NONE || tok == JTOK_ERR)\n            return false;\n        raw += consumed;\n\n        bool isValueOpen = jsonTokenIsValue(tok) ||\n            tok == JTOK_OBJ_OPEN || tok == JTOK_ARR_OPEN;\n\n        if (expect(VALUE)) {\n            if (!isValueOpen)\n                return false;\n            clearExpect(VALUE);\n\n        } else if (expect(ARR_VALUE)) {\n            bool isArrValue = isValueOpen || (tok == JTOK_ARR_CLOSE);\n            if (!isArrValue)\n                return false;\n\n            clearExpect(ARR_VALUE);\n\n        } else if (expect(OBJ_NAME)) {\n            bool isObjName = (tok == JTOK_OBJ_CLOSE || tok == JTOK_STRING);\n            if (!isObjName)\n                return false;\n\n        } else if (expect(COLON)) {\n            if (tok != JTOK_COLON)\n                return false;\n            clearExpect(COLON);\n\n        } else if (!expect(COLON) && (tok == JTOK_COLON)) {\n            return false;\n        }\n\n        if (expect(NOT_VALUE)) {\n            if (isValueOpen)\n                return false;\n            clearExpect(NOT_VALUE);\n        }\n\n        switch (tok) {\n\n        case JTOK_OBJ_OPEN:\n        case JTOK_ARR_OPEN: {\n            VType utyp = (tok == JTOK_OBJ_OPEN ? VOBJ : VARR);\n            if (!stack.size()) {\n                if (utyp == VOBJ)\n                    setObject();\n                else\n                    setArray();\n                stack.push_back(this);\n            } else {\n                UniValue tmpVal(utyp);\n                UniValue *top = stack.back();\n                top->values.push_back(tmpVal);\n\n                UniValue *newTop = &(top->values.back());\n                stack.push_back(newTop);\n            }\n\n            if (utyp == VOBJ)\n                setExpect(OBJ_NAME);\n            else\n                setExpect(ARR_VALUE);\n            break;\n            }\n\n        case JTOK_OBJ_CLOSE:\n        case JTOK_ARR_CLOSE: {\n            if (!stack.size() || (last_tok == JTOK_COMMA))\n                return false;\n\n            VType utyp = (tok == JTOK_OBJ_CLOSE ? VOBJ : VARR);\n            UniValue *top = stack.back();\n            if (utyp != top->getType())\n                return false;\n\n            stack.pop_back();\n            clearExpect(OBJ_NAME);\n            setExpect(NOT_VALUE);\n            break;\n            }\n\n        case JTOK_COLON: {\n            if (!stack.size())\n                return false;\n\n            UniValue *top = stack.back();\n            if (top->getType() != VOBJ)\n                return false;\n\n            setExpect(VALUE);\n            break;\n            }\n\n        case JTOK_COMMA: {\n            if (!stack.size() ||\n                (last_tok == JTOK_COMMA) || (last_tok == JTOK_ARR_OPEN))\n                return false;\n\n            UniValue *top = stack.back();\n            if (top->getType() == VOBJ)\n                setExpect(OBJ_NAME);\n            else\n                setExpect(ARR_VALUE);\n            break;\n            }\n\n        case JTOK_KW_NULL:\n        case JTOK_KW_TRUE:\n        case JTOK_KW_FALSE: {\n            UniValue tmpVal;\n            switch (tok) {\n            case JTOK_KW_NULL:\n                // do nothing more\n                break;\n            case JTOK_KW_TRUE:\n                tmpVal.setBool(true);\n                break;\n            case JTOK_KW_FALSE:\n                tmpVal.setBool(false);\n                break;\n            default: /* impossible */ break;\n            }\n\n            if (!stack.size()) {\n                *this = tmpVal;\n                break;\n            }\n\n            UniValue *top = stack.back();\n            top->values.push_back(tmpVal);\n\n            setExpect(NOT_VALUE);\n            break;\n            }\n\n        case JTOK_NUMBER: {\n            UniValue tmpVal(VNUM, tokenVal);\n            if (!stack.size()) {\n                *this = tmpVal;\n                break;\n            }\n\n            UniValue *top = stack.back();\n            top->values.push_back(tmpVal);\n\n            setExpect(NOT_VALUE);\n            break;\n            }\n\n        case JTOK_STRING: {\n            if (expect(OBJ_NAME)) {\n                UniValue *top = stack.back();\n                top->keys.push_back(tokenVal);\n                clearExpect(OBJ_NAME);\n                setExpect(COLON);\n            } else {\n                UniValue tmpVal(VSTR, tokenVal);\n                if (!stack.size()) {\n                    *this = tmpVal;\n                    break;\n                }\n                UniValue *top = stack.back();\n                top->values.push_back(tmpVal);\n            }\n\n            setExpect(NOT_VALUE);\n            break;\n            }\n\n        default:\n            return false;\n        }\n    } while (!stack.empty ());\n\n    /* Check that nothing follows the initial construct (parsed above).  */\n    tok = getJsonToken(tokenVal, consumed, raw, end);\n    if (tok != JTOK_NONE)\n        return false;\n\n    return true;\n}\n\n"
  },
  {
    "path": "src/univalue/lib/univalue_utffilter.h",
    "content": "// Copyright 2016 Wladimir J. van der Laan\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#ifndef UNIVALUE_UTFFILTER_H\n#define UNIVALUE_UTFFILTER_H\n\n#include <string>\n\n/**\n * Filter that generates and validates UTF-8, as well as collates UTF-16\n * surrogate pairs as specified in RFC4627.\n */\nclass JSONUTF8StringFilter\n{\npublic:\n    explicit JSONUTF8StringFilter(std::string &s):\n        str(s), is_valid(true), codepoint(0), state(0), surpair(0)\n    {\n    }\n    // Write single 8-bit char (may be part of UTF-8 sequence)\n    void push_back(unsigned char ch)\n    {\n        if (state == 0) {\n            if (ch < 0x80) // 7-bit ASCII, fast direct pass-through\n                str.push_back(ch);\n            else if (ch < 0xc0) // Mid-sequence character, invalid in this state\n                is_valid = false;\n            else if (ch < 0xe0) { // Start of 2-byte sequence\n                codepoint = (ch & 0x1f) << 6;\n                state = 6;\n            } else if (ch < 0xf0) { // Start of 3-byte sequence\n                codepoint = (ch & 0x0f) << 12;\n                state = 12;\n            } else if (ch < 0xf8) { // Start of 4-byte sequence\n                codepoint = (ch & 0x07) << 18;\n                state = 18;\n            } else // Reserved, invalid\n                is_valid = false;\n        } else {\n            if ((ch & 0xc0) != 0x80) // Not a continuation, invalid\n                is_valid = false;\n            state -= 6;\n            codepoint |= (ch & 0x3f) << state;\n            if (state == 0)\n                push_back_u(codepoint);\n        }\n    }\n    // Write codepoint directly, possibly collating surrogate pairs\n    void push_back_u(unsigned int codepoint_)\n    {\n        if (state) // Only accept full codepoints in open state\n            is_valid = false;\n        if (codepoint_ >= 0xD800 && codepoint_ < 0xDC00) { // First half of surrogate pair\n            if (surpair) // Two subsequent surrogate pair openers - fail\n                is_valid = false;\n            else\n                surpair = codepoint_;\n        } else if (codepoint_ >= 0xDC00 && codepoint_ < 0xE000) { // Second half of surrogate pair\n            if (surpair) { // Open surrogate pair, expect second half\n                // Compute code point from UTF-16 surrogate pair\n                append_codepoint(0x10000 | ((surpair - 0xD800)<<10) | (codepoint_ - 0xDC00));\n                surpair = 0;\n            } else // Second half doesn't follow a first half - fail\n                is_valid = false;\n        } else {\n            if (surpair) // First half of surrogate pair not followed by second - fail\n                is_valid = false;\n            else\n                append_codepoint(codepoint_);\n        }\n    }\n    // Check that we're in a state where the string can be ended\n    // No open sequences, no open surrogate pairs, etc\n    bool finalize()\n    {\n        if (state || surpair)\n            is_valid = false;\n        return is_valid;\n    }\nprivate:\n    std::string &str;\n    bool is_valid;\n    // Current UTF-8 decoding state\n    unsigned int codepoint;\n    int state; // Top bit to be filled in for next UTF-8 byte, or 0\n\n    // Keep track of the following state to handle the following section of\n    // RFC4627:\n    //\n    //    To escape an extended character that is not in the Basic Multilingual\n    //    Plane, the character is represented as a twelve-character sequence,\n    //    encoding the UTF-16 surrogate pair.  So, for example, a string\n    //    containing only the G clef character (U+1D11E) may be represented as\n    //    \"\\uD834\\uDD1E\".\n    //\n    //  Two subsequent \\u.... may have to be replaced with one actual codepoint.\n    unsigned int surpair; // First half of open UTF-16 surrogate pair, or 0\n\n    void append_codepoint(unsigned int codepoint_)\n    {\n        if (codepoint_ <= 0x7f)\n            str.push_back((char)codepoint_);\n        else if (codepoint_ <= 0x7FF) {\n            str.push_back((char)(0xC0 | (codepoint_ >> 6)));\n            str.push_back((char)(0x80 | (codepoint_ & 0x3F)));\n        } else if (codepoint_ <= 0xFFFF) {\n            str.push_back((char)(0xE0 | (codepoint_ >> 12)));\n            str.push_back((char)(0x80 | ((codepoint_ >> 6) & 0x3F)));\n            str.push_back((char)(0x80 | (codepoint_ & 0x3F)));\n        } else if (codepoint_ <= 0x1FFFFF) {\n            str.push_back((char)(0xF0 | (codepoint_ >> 18)));\n            str.push_back((char)(0x80 | ((codepoint_ >> 12) & 0x3F)));\n            str.push_back((char)(0x80 | ((codepoint_ >> 6) & 0x3F)));\n            str.push_back((char)(0x80 | (codepoint_ & 0x3F)));\n        }\n    }\n};\n\n#endif\n"
  },
  {
    "path": "src/univalue/lib/univalue_write.cpp",
    "content": "// Copyright 2014 BitPay Inc.\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <iomanip>\n#include <sstream>\n#include <stdio.h>\n#include \"univalue.h\"\n#include \"univalue_escapes.h\"\n\nusing namespace std;\n\nstatic string json_escape(const string& inS)\n{\n    string outS;\n    outS.reserve(inS.size() * 2);\n\n    for (unsigned int i = 0; i < inS.size(); i++) {\n        unsigned char ch = inS[i];\n        const char *escStr = escapes[ch];\n\n        if (escStr)\n            outS += escStr;\n        else\n            outS += ch;\n    }\n\n    return outS;\n}\n\nstring UniValue::write(unsigned int prettyIndent,\n                       unsigned int indentLevel) const\n{\n    string s;\n    s.reserve(1024);\n\n    unsigned int modIndent = indentLevel;\n    if (modIndent == 0)\n        modIndent = 1;\n\n    switch (typ) {\n    case VNULL:\n        s += \"null\";\n        break;\n    case VOBJ:\n        writeObject(prettyIndent, modIndent, s);\n        break;\n    case VARR:\n        writeArray(prettyIndent, modIndent, s);\n        break;\n    case VSTR:\n        s += \"\\\"\" + json_escape(val) + \"\\\"\";\n        break;\n    case VNUM:\n        s += val;\n        break;\n    case VBOOL:\n        s += (val == \"1\" ? \"true\" : \"false\");\n        break;\n    }\n\n    return s;\n}\n\nstatic void indentStr(unsigned int prettyIndent, unsigned int indentLevel, string& s)\n{\n    s.append(prettyIndent * indentLevel, ' ');\n}\n\nvoid UniValue::writeArray(unsigned int prettyIndent, unsigned int indentLevel, string& s) const\n{\n    s += \"[\";\n    if (prettyIndent)\n        s += \"\\n\";\n\n    for (unsigned int i = 0; i < values.size(); i++) {\n        if (prettyIndent)\n            indentStr(prettyIndent, indentLevel, s);\n        s += values[i].write(prettyIndent, indentLevel + 1);\n        if (i != (values.size() - 1)) {\n            s += \",\";\n        }\n        if (prettyIndent)\n            s += \"\\n\";\n    }\n\n    if (prettyIndent)\n        indentStr(prettyIndent, indentLevel - 1, s);\n    s += \"]\";\n}\n\nvoid UniValue::writeObject(unsigned int prettyIndent, unsigned int indentLevel, string& s) const\n{\n    s += \"{\";\n    if (prettyIndent)\n        s += \"\\n\";\n\n    for (unsigned int i = 0; i < keys.size(); i++) {\n        if (prettyIndent)\n            indentStr(prettyIndent, indentLevel, s);\n        s += \"\\\"\" + json_escape(keys[i]) + \"\\\":\";\n        if (prettyIndent)\n            s += \" \";\n        s += values.at(i).write(prettyIndent, indentLevel + 1);\n        if (i != (values.size() - 1))\n            s += \",\";\n        if (prettyIndent)\n            s += \"\\n\";\n    }\n\n    if (prettyIndent)\n        indentStr(prettyIndent, indentLevel - 1, s);\n    s += \"}\";\n}\n\n"
  },
  {
    "path": "src/univalue/pc/libunivalue-uninstalled.pc.in",
    "content": "prefix=@prefix@\nexec_prefix=@exec_prefix@\nlibdir=@libdir@\nincludedir=@includedir@\n\nName: libunivalue\nDescription: libunivalue, C++ universal value object and JSON library\nVersion: @VERSION@\nLibs: ${pc_top_builddir}/${pcfiledir}/libunivalue.la\n"
  },
  {
    "path": "src/univalue/pc/libunivalue.pc.in",
    "content": "prefix=@prefix@\nexec_prefix=@exec_prefix@\nlibdir=@libdir@\nincludedir=@includedir@\n\nName: libunivalue\nDescription: libunivalue, C++ universal value object and JSON library\nVersion: @VERSION@\nLibs: -L${libdir} -lunivalue\nCflags: -I${includedir}\n"
  },
  {
    "path": "src/univalue/test/.gitignore",
    "content": "\nobject\nunitester\ntest_json\nno_nul\n\n*.trs\n*.log\n"
  },
  {
    "path": "src/univalue/test/fail1.json",
    "content": "\"This is a string that never ends, yes it goes on and on, my friends.\n"
  },
  {
    "path": "src/univalue/test/fail10.json",
    "content": "{\"Extra value after close\": true} \"misplaced quoted value\""
  },
  {
    "path": "src/univalue/test/fail11.json",
    "content": "{\"Illegal expression\": 1 + 2}"
  },
  {
    "path": "src/univalue/test/fail12.json",
    "content": "{\"Illegal invocation\": alert()}"
  },
  {
    "path": "src/univalue/test/fail13.json",
    "content": "{\"Numbers cannot have leading zeroes\": 013}"
  },
  {
    "path": "src/univalue/test/fail14.json",
    "content": "{\"Numbers cannot be hex\": 0x14}"
  },
  {
    "path": "src/univalue/test/fail15.json",
    "content": "[\"Illegal backslash escape: \\x15\"]"
  },
  {
    "path": "src/univalue/test/fail16.json",
    "content": "[\\naked]"
  },
  {
    "path": "src/univalue/test/fail17.json",
    "content": "[\"Illegal backslash escape: \\017\"]"
  },
  {
    "path": "src/univalue/test/fail18.json",
    "content": "[[[[[[[[[[[[[[[[[[[[\"Too deep\"]]]]]]]]]]]]]]]]]]]]"
  },
  {
    "path": "src/univalue/test/fail19.json",
    "content": "{\"Missing colon\" null}"
  },
  {
    "path": "src/univalue/test/fail2.json",
    "content": "[\"Unclosed array\""
  },
  {
    "path": "src/univalue/test/fail20.json",
    "content": "{\"Double colon\":: null}"
  },
  {
    "path": "src/univalue/test/fail21.json",
    "content": "{\"Comma instead of colon\", null}"
  },
  {
    "path": "src/univalue/test/fail22.json",
    "content": "[\"Colon instead of comma\": false]"
  },
  {
    "path": "src/univalue/test/fail23.json",
    "content": "[\"Bad value\", truth]"
  },
  {
    "path": "src/univalue/test/fail24.json",
    "content": "['single quote']"
  },
  {
    "path": "src/univalue/test/fail25.json",
    "content": "[\"\ttab\tcharacter\tin\tstring\t\"]"
  },
  {
    "path": "src/univalue/test/fail26.json",
    "content": "[\"tab\\   character\\   in\\  string\\  \"]"
  },
  {
    "path": "src/univalue/test/fail27.json",
    "content": "[\"line\nbreak\"]"
  },
  {
    "path": "src/univalue/test/fail28.json",
    "content": "[\"line\\\nbreak\"]"
  },
  {
    "path": "src/univalue/test/fail29.json",
    "content": "[0e]"
  },
  {
    "path": "src/univalue/test/fail3.json",
    "content": "{unquoted_key: \"keys must be quoted\"}"
  },
  {
    "path": "src/univalue/test/fail30.json",
    "content": "[0e+]"
  },
  {
    "path": "src/univalue/test/fail31.json",
    "content": "[0e+-1]"
  },
  {
    "path": "src/univalue/test/fail32.json",
    "content": "{\"Comma instead if closing brace\": true,"
  },
  {
    "path": "src/univalue/test/fail33.json",
    "content": "[\"mismatch\"}"
  },
  {
    "path": "src/univalue/test/fail34.json",
    "content": "{} garbage"
  },
  {
    "path": "src/univalue/test/fail35.json",
    "content": "[ true true true [] [] [] ]\n"
  },
  {
    "path": "src/univalue/test/fail36.json",
    "content": "{\"a\":}\n"
  },
  {
    "path": "src/univalue/test/fail37.json",
    "content": "{\"a\":1 \"b\":2}\n"
  },
  {
    "path": "src/univalue/test/fail38.json",
    "content": "[\"\\ud834\"]\n"
  },
  {
    "path": "src/univalue/test/fail39.json",
    "content": "[\"\\udd61\"]\n"
  },
  {
    "path": "src/univalue/test/fail4.json",
    "content": "[\"extra comma\",]"
  },
  {
    "path": "src/univalue/test/fail40.json",
    "content": "[\"\"]"
  },
  {
    "path": "src/univalue/test/fail41.json",
    "content": "[\"\"]"
  },
  {
    "path": "src/univalue/test/fail44.json",
    "content": "\"This file ends without a newline or close-quote."
  },
  {
    "path": "src/univalue/test/fail5.json",
    "content": "[\"double extra comma\",,]"
  },
  {
    "path": "src/univalue/test/fail6.json",
    "content": "[   , \"<-- missing value\"]"
  },
  {
    "path": "src/univalue/test/fail7.json",
    "content": "[\"Comma after the close\"],"
  },
  {
    "path": "src/univalue/test/fail8.json",
    "content": "[\"Extra close\"]]"
  },
  {
    "path": "src/univalue/test/fail9.json",
    "content": "{\"Extra comma\": true,}"
  },
  {
    "path": "src/univalue/test/no_nul.cpp",
    "content": "#include \"univalue.h\"\n\nint main (int argc, char *argv[])\n{\n    char buf[] = \"___[1,2,3]___\";\n    UniValue val;\n    return val.read(buf + 3, 7) ? 0 : 1;\n}\n"
  },
  {
    "path": "src/univalue/test/object.cpp",
    "content": "// Copyright (c) 2014 BitPay Inc.\n// Copyright (c) 2014-2016 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <stdint.h>\n#include <vector>\n#include <string>\n#include <map>\n#include <cassert>\n#include <stdexcept>\n#include <univalue.h>\n\n#define BOOST_FIXTURE_TEST_SUITE(a, b)\n#define BOOST_AUTO_TEST_CASE(funcName) void funcName()\n#define BOOST_AUTO_TEST_SUITE_END()\n#define BOOST_CHECK(expr) assert(expr)\n#define BOOST_CHECK_EQUAL(v1, v2) assert((v1) == (v2))\n#define BOOST_CHECK_THROW(stmt, excMatch) { \\\n        try { \\\n            (stmt); \\\n            assert(0 && \"No exception caught\"); \\\n        } catch (excMatch & e) { \\\n\t} catch (...) { \\\n\t    assert(0 && \"Wrong exception caught\"); \\\n\t} \\\n    }\n#define BOOST_CHECK_NO_THROW(stmt) { \\\n        try { \\\n            (stmt); \\\n\t} catch (...) { \\\n\t    assert(0); \\\n\t} \\\n    }\n\nBOOST_FIXTURE_TEST_SUITE(univalue_tests, BasicTestingSetup)\n\nBOOST_AUTO_TEST_CASE(univalue_constructor)\n{\n    UniValue v1;\n    BOOST_CHECK(v1.isNull());\n\n    UniValue v2(UniValue::VSTR);\n    BOOST_CHECK(v2.isStr());\n\n    UniValue v3(UniValue::VSTR, \"foo\");\n    BOOST_CHECK(v3.isStr());\n    BOOST_CHECK_EQUAL(v3.getValStr(), \"foo\");\n\n    UniValue numTest;\n    BOOST_CHECK(numTest.setNumStr(\"82\"));\n    BOOST_CHECK(numTest.isNum());\n    BOOST_CHECK_EQUAL(numTest.getValStr(), \"82\");\n\n    uint64_t vu64 = 82;\n    UniValue v4(vu64);\n    BOOST_CHECK(v4.isNum());\n    BOOST_CHECK_EQUAL(v4.getValStr(), \"82\");\n\n    int64_t vi64 = -82;\n    UniValue v5(vi64);\n    BOOST_CHECK(v5.isNum());\n    BOOST_CHECK_EQUAL(v5.getValStr(), \"-82\");\n\n    int vi = -688;\n    UniValue v6(vi);\n    BOOST_CHECK(v6.isNum());\n    BOOST_CHECK_EQUAL(v6.getValStr(), \"-688\");\n\n    double vd = -7.21;\n    UniValue v7(vd);\n    BOOST_CHECK(v7.isNum());\n    BOOST_CHECK_EQUAL(v7.getValStr(), \"-7.21\");\n\n    std::string vs(\"yawn\");\n    UniValue v8(vs);\n    BOOST_CHECK(v8.isStr());\n    BOOST_CHECK_EQUAL(v8.getValStr(), \"yawn\");\n\n    const char *vcs = \"zappa\";\n    UniValue v9(vcs);\n    BOOST_CHECK(v9.isStr());\n    BOOST_CHECK_EQUAL(v9.getValStr(), \"zappa\");\n}\n\nBOOST_AUTO_TEST_CASE(univalue_typecheck)\n{\n    UniValue v1;\n    BOOST_CHECK(v1.setNumStr(\"1\"));\n    BOOST_CHECK(v1.isNum());\n    BOOST_CHECK_THROW(v1.get_bool(), std::runtime_error);\n\n    UniValue v2;\n    BOOST_CHECK(v2.setBool(true));\n    BOOST_CHECK_EQUAL(v2.get_bool(), true);\n    BOOST_CHECK_THROW(v2.get_int(), std::runtime_error);\n\n    UniValue v3;\n    BOOST_CHECK(v3.setNumStr(\"32482348723847471234\"));\n    BOOST_CHECK_THROW(v3.get_int64(), std::runtime_error);\n    BOOST_CHECK(v3.setNumStr(\"1000\"));\n    BOOST_CHECK_EQUAL(v3.get_int64(), 1000);\n\n    UniValue v4;\n    BOOST_CHECK(v4.setNumStr(\"2147483648\"));\n    BOOST_CHECK_EQUAL(v4.get_int64(), 2147483648);\n    BOOST_CHECK_THROW(v4.get_int(), std::runtime_error);\n    BOOST_CHECK(v4.setNumStr(\"1000\"));\n    BOOST_CHECK_EQUAL(v4.get_int(), 1000);\n    BOOST_CHECK_THROW(v4.get_str(), std::runtime_error);\n    BOOST_CHECK_EQUAL(v4.get_real(), 1000);\n    BOOST_CHECK_THROW(v4.get_array(), std::runtime_error);\n    BOOST_CHECK_THROW(v4.getKeys(), std::runtime_error);\n    BOOST_CHECK_THROW(v4.getValues(), std::runtime_error);\n    BOOST_CHECK_THROW(v4.get_obj(), std::runtime_error);\n\n    UniValue v5;\n    BOOST_CHECK(v5.read(\"[true, 10]\"));\n    BOOST_CHECK_NO_THROW(v5.get_array());\n    std::vector<UniValue> vals = v5.getValues();\n    BOOST_CHECK_THROW(vals[0].get_int(), std::runtime_error);\n    BOOST_CHECK_EQUAL(vals[0].get_bool(), true);\n\n    BOOST_CHECK_EQUAL(vals[1].get_int(), 10);\n    BOOST_CHECK_THROW(vals[1].get_bool(), std::runtime_error);\n}\n\nBOOST_AUTO_TEST_CASE(univalue_set)\n{\n    UniValue v(UniValue::VSTR, \"foo\");\n    v.clear();\n    BOOST_CHECK(v.isNull());\n    BOOST_CHECK_EQUAL(v.getValStr(), \"\");\n\n    BOOST_CHECK(v.setObject());\n    BOOST_CHECK(v.isObject());\n    BOOST_CHECK_EQUAL(v.size(), 0);\n    BOOST_CHECK_EQUAL(v.getType(), UniValue::VOBJ);\n    BOOST_CHECK(v.empty());\n\n    BOOST_CHECK(v.setArray());\n    BOOST_CHECK(v.isArray());\n    BOOST_CHECK_EQUAL(v.size(), 0);\n\n    BOOST_CHECK(v.setStr(\"zum\"));\n    BOOST_CHECK(v.isStr());\n    BOOST_CHECK_EQUAL(v.getValStr(), \"zum\");\n\n    BOOST_CHECK(v.setFloat(-1.01));\n    BOOST_CHECK(v.isNum());\n    BOOST_CHECK_EQUAL(v.getValStr(), \"-1.01\");\n\n    BOOST_CHECK(v.setInt((int)1023));\n    BOOST_CHECK(v.isNum());\n    BOOST_CHECK_EQUAL(v.getValStr(), \"1023\");\n\n    BOOST_CHECK(v.setInt((int64_t)-1023LL));\n    BOOST_CHECK(v.isNum());\n    BOOST_CHECK_EQUAL(v.getValStr(), \"-1023\");\n\n    BOOST_CHECK(v.setInt((uint64_t)1023ULL));\n    BOOST_CHECK(v.isNum());\n    BOOST_CHECK_EQUAL(v.getValStr(), \"1023\");\n\n    BOOST_CHECK(v.setNumStr(\"-688\"));\n    BOOST_CHECK(v.isNum());\n    BOOST_CHECK_EQUAL(v.getValStr(), \"-688\");\n\n    BOOST_CHECK(v.setBool(false));\n    BOOST_CHECK_EQUAL(v.isBool(), true);\n    BOOST_CHECK_EQUAL(v.isTrue(), false);\n    BOOST_CHECK_EQUAL(v.isFalse(), true);\n    BOOST_CHECK_EQUAL(v.getBool(), false);\n\n    BOOST_CHECK(v.setBool(true));\n    BOOST_CHECK_EQUAL(v.isBool(), true);\n    BOOST_CHECK_EQUAL(v.isTrue(), true);\n    BOOST_CHECK_EQUAL(v.isFalse(), false);\n    BOOST_CHECK_EQUAL(v.getBool(), true);\n\n    BOOST_CHECK(!v.setNumStr(\"zombocom\"));\n\n    BOOST_CHECK(v.setNull());\n    BOOST_CHECK(v.isNull());\n}\n\nBOOST_AUTO_TEST_CASE(univalue_array)\n{\n    UniValue arr(UniValue::VARR);\n\n    UniValue v((int64_t)1023LL);\n    BOOST_CHECK(arr.push_back(v));\n\n    std::string vStr(\"zippy\");\n    BOOST_CHECK(arr.push_back(vStr));\n\n    const char *s = \"pippy\";\n    BOOST_CHECK(arr.push_back(s));\n\n    std::vector<UniValue> vec;\n    v.setStr(\"boing\");\n    vec.push_back(v);\n\n    v.setStr(\"going\");\n    vec.push_back(v);\n\n    BOOST_CHECK(arr.push_backV(vec));\n\n    BOOST_CHECK(arr.push_back((uint64_t) 400ULL));\n    BOOST_CHECK(arr.push_back((int64_t) -400LL));\n    BOOST_CHECK(arr.push_back((int) -401));\n    BOOST_CHECK(arr.push_back(-40.1));\n\n    BOOST_CHECK_EQUAL(arr.empty(), false);\n    BOOST_CHECK_EQUAL(arr.size(), 9);\n\n    BOOST_CHECK_EQUAL(arr[0].getValStr(), \"1023\");\n    BOOST_CHECK_EQUAL(arr[1].getValStr(), \"zippy\");\n    BOOST_CHECK_EQUAL(arr[2].getValStr(), \"pippy\");\n    BOOST_CHECK_EQUAL(arr[3].getValStr(), \"boing\");\n    BOOST_CHECK_EQUAL(arr[4].getValStr(), \"going\");\n    BOOST_CHECK_EQUAL(arr[5].getValStr(), \"400\");\n    BOOST_CHECK_EQUAL(arr[6].getValStr(), \"-400\");\n    BOOST_CHECK_EQUAL(arr[7].getValStr(), \"-401\");\n    BOOST_CHECK_EQUAL(arr[8].getValStr(), \"-40.1\");\n\n    BOOST_CHECK_EQUAL(arr[999].getValStr(), \"\");\n\n    arr.clear();\n    BOOST_CHECK(arr.empty());\n    BOOST_CHECK_EQUAL(arr.size(), 0);\n}\n\nBOOST_AUTO_TEST_CASE(univalue_object)\n{\n    UniValue obj(UniValue::VOBJ);\n    std::string strKey, strVal;\n    UniValue v;\n\n    strKey = \"age\";\n    v.setInt(100);\n    BOOST_CHECK(obj.pushKV(strKey, v));\n\n    strKey = \"first\";\n    strVal = \"John\";\n    BOOST_CHECK(obj.pushKV(strKey, strVal));\n\n    strKey = \"last\";\n    const char *cVal = \"Smith\";\n    BOOST_CHECK(obj.pushKV(strKey, cVal));\n\n    strKey = \"distance\";\n    BOOST_CHECK(obj.pushKV(strKey, (int64_t) 25));\n\n    strKey = \"time\";\n    BOOST_CHECK(obj.pushKV(strKey, (uint64_t) 3600));\n\n    strKey = \"calories\";\n    BOOST_CHECK(obj.pushKV(strKey, (int) 12));\n\n    strKey = \"temperature\";\n    BOOST_CHECK(obj.pushKV(strKey, (double) 90.012));\n\n    UniValue obj2(UniValue::VOBJ);\n    BOOST_CHECK(obj2.pushKV(\"cat1\", 9000));\n    BOOST_CHECK(obj2.pushKV(\"cat2\", 12345));\n\n    BOOST_CHECK(obj.pushKVs(obj2));\n\n    BOOST_CHECK_EQUAL(obj.empty(), false);\n    BOOST_CHECK_EQUAL(obj.size(), 9);\n\n    BOOST_CHECK_EQUAL(obj[\"age\"].getValStr(), \"100\");\n    BOOST_CHECK_EQUAL(obj[\"first\"].getValStr(), \"John\");\n    BOOST_CHECK_EQUAL(obj[\"last\"].getValStr(), \"Smith\");\n    BOOST_CHECK_EQUAL(obj[\"distance\"].getValStr(), \"25\");\n    BOOST_CHECK_EQUAL(obj[\"time\"].getValStr(), \"3600\");\n    BOOST_CHECK_EQUAL(obj[\"calories\"].getValStr(), \"12\");\n    BOOST_CHECK_EQUAL(obj[\"temperature\"].getValStr(), \"90.012\");\n    BOOST_CHECK_EQUAL(obj[\"cat1\"].getValStr(), \"9000\");\n    BOOST_CHECK_EQUAL(obj[\"cat2\"].getValStr(), \"12345\");\n\n    BOOST_CHECK_EQUAL(obj[\"nyuknyuknyuk\"].getValStr(), \"\");\n\n    BOOST_CHECK(obj.exists(\"age\"));\n    BOOST_CHECK(obj.exists(\"first\"));\n    BOOST_CHECK(obj.exists(\"last\"));\n    BOOST_CHECK(obj.exists(\"distance\"));\n    BOOST_CHECK(obj.exists(\"time\"));\n    BOOST_CHECK(obj.exists(\"calories\"));\n    BOOST_CHECK(obj.exists(\"temperature\"));\n    BOOST_CHECK(obj.exists(\"cat1\"));\n    BOOST_CHECK(obj.exists(\"cat2\"));\n\n    BOOST_CHECK(!obj.exists(\"nyuknyuknyuk\"));\n\n    std::map<std::string, UniValue::VType> objTypes;\n    objTypes[\"age\"] = UniValue::VNUM;\n    objTypes[\"first\"] = UniValue::VSTR;\n    objTypes[\"last\"] = UniValue::VSTR;\n    objTypes[\"distance\"] = UniValue::VNUM;\n    objTypes[\"time\"] = UniValue::VNUM;\n    objTypes[\"calories\"] = UniValue::VNUM;\n    objTypes[\"temperature\"] = UniValue::VNUM;\n    objTypes[\"cat1\"] = UniValue::VNUM;\n    objTypes[\"cat2\"] = UniValue::VNUM;\n    BOOST_CHECK(obj.checkObject(objTypes));\n\n    objTypes[\"cat2\"] = UniValue::VSTR;\n    BOOST_CHECK(!obj.checkObject(objTypes));\n\n    obj.clear();\n    BOOST_CHECK(obj.empty());\n    BOOST_CHECK_EQUAL(obj.size(), 0);\n    BOOST_CHECK_EQUAL(obj.getType(), UniValue::VNULL);\n\n    BOOST_CHECK_EQUAL(obj.setObject(), true);\n    UniValue uv;\n    uv.setInt(42);\n    obj.__pushKV(\"age\", uv);\n    BOOST_CHECK_EQUAL(obj.size(), 1);\n    BOOST_CHECK_EQUAL(obj[\"age\"].getValStr(), \"42\");\n\n    uv.setInt(43);\n    obj.pushKV(\"age\", uv);\n    BOOST_CHECK_EQUAL(obj.size(), 1);\n    BOOST_CHECK_EQUAL(obj[\"age\"].getValStr(), \"43\");\n\n    obj.pushKV(\"name\", \"foo bar\");\n\n    std::map<std::string,UniValue> kv;\n    obj.getObjMap(kv);\n    BOOST_CHECK_EQUAL(kv[\"age\"].getValStr(), \"43\");\n    BOOST_CHECK_EQUAL(kv[\"name\"].getValStr(), \"foo bar\");\n\n}\n\nstatic const char *json1 =\n\"[1.10000000,{\\\"key1\\\":\\\"str\\\\u0000\\\",\\\"key2\\\":800,\\\"key3\\\":{\\\"name\\\":\\\"martian http://test.com\\\"}}]\";\n\nBOOST_AUTO_TEST_CASE(univalue_readwrite)\n{\n    UniValue v;\n    BOOST_CHECK(v.read(json1));\n\n    std::string strJson1(json1);\n    BOOST_CHECK(v.read(strJson1));\n\n    BOOST_CHECK(v.isArray());\n    BOOST_CHECK_EQUAL(v.size(), 2);\n\n    BOOST_CHECK_EQUAL(v[0].getValStr(), \"1.10000000\");\n\n    UniValue obj = v[1];\n    BOOST_CHECK(obj.isObject());\n    BOOST_CHECK_EQUAL(obj.size(), 3);\n\n    BOOST_CHECK(obj[\"key1\"].isStr());\n    std::string correctValue(\"str\");\n    correctValue.push_back('\\0');\n    BOOST_CHECK_EQUAL(obj[\"key1\"].getValStr(), correctValue);\n    BOOST_CHECK(obj[\"key2\"].isNum());\n    BOOST_CHECK_EQUAL(obj[\"key2\"].getValStr(), \"800\");\n    BOOST_CHECK(obj[\"key3\"].isObject());\n\n    BOOST_CHECK_EQUAL(strJson1, v.write());\n\n    /* Check for (correctly reporting) a parsing error if the initial\n       JSON construct is followed by more stuff.  Note that whitespace\n       is, of course, exempt.  */\n\n    BOOST_CHECK(v.read(\"  {}\\n  \"));\n    BOOST_CHECK(v.isObject());\n    BOOST_CHECK(v.read(\"  []\\n  \"));\n    BOOST_CHECK(v.isArray());\n\n    BOOST_CHECK(!v.read(\"@{}\"));\n    BOOST_CHECK(!v.read(\"{} garbage\"));\n    BOOST_CHECK(!v.read(\"[]{}\"));\n    BOOST_CHECK(!v.read(\"{}[]\"));\n    BOOST_CHECK(!v.read(\"{} 42\"));\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n\nint main (int argc, char *argv[])\n{\n    univalue_constructor();\n    univalue_typecheck();\n    univalue_set();\n    univalue_array();\n    univalue_object();\n    univalue_readwrite();\n    return 0;\n}\n\n"
  },
  {
    "path": "src/univalue/test/pass1.json",
    "content": "[\n    \"JSON Test Pattern pass1\",\n    {\"object with 1 member\":[\"array with 1 element\"]},\n    {},\n    [],\n    -42,\n    true,\n    false,\n    null,\n    {\n        \"integer\": 1234567890,\n        \"real\": -9876.543210,\n        \"e\": 0.123456789e-12,\n        \"E\": 1.234567890E+34,\n        \"\":  23456789012E66,\n        \"zero\": 0,\n        \"one\": 1,\n        \"space\": \" \",\n        \"quote\": \"\\\"\",\n        \"backslash\": \"\\\\\",\n        \"controls\": \"\\b\\f\\n\\r\\t\",\n        \"slash\": \"/ & \\/\",\n        \"alpha\": \"abcdefghijklmnopqrstuvwyz\",\n        \"ALPHA\": \"ABCDEFGHIJKLMNOPQRSTUVWYZ\",\n        \"digit\": \"0123456789\",\n        \"0123456789\": \"digit\",\n        \"special\": \"`1~!@#$%^&*()_+-={':[,]}|;.</>?\",\n        \"hex\": \"\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A\",\n        \"true\": true,\n        \"false\": false,\n        \"null\": null,\n        \"array\":[  ],\n        \"object\":{  },\n        \"address\": \"50 St. James Street\",\n        \"url\": \"http://www.JSON.org/\",\n        \"comment\": \"// /* <!-- --\",\n        \"# -- --> */\": \" \",\n        \" s p a c e d \" :[1,2 , 3\n\n,\n\n4 , 5        ,          6           ,7        ],\"compact\":[1,2,3,4,5,6,7],\n        \"jsontext\": \"{\\\"object with 1 member\\\":[\\\"array with 1 element\\\"]}\",\n        \"quotes\": \"&#34; \\u0022 %22 0x22 034 &#x22;\",\n        \"\\/\\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?\"\n: \"A key can be any string\"\n    },\n    0.5 ,98.6\n,\n99.44\n,\n\n1066,\n1e1,\n0.1e1,\n1e-1,\n1e00,2e+00,2e-00\n,\"rosebud\"]"
  },
  {
    "path": "src/univalue/test/pass2.json",
    "content": "[[[[[[[[[[[[[[[[[[[\"Not too deep\"]]]]]]]]]]]]]]]]]]]"
  },
  {
    "path": "src/univalue/test/pass3.json",
    "content": "{\n    \"JSON Test Pattern pass3\": {\n        \"The outermost value\": \"must be an object or array.\",\n        \"In this test\": \"It is an object.\"\n    }\n}\n"
  },
  {
    "path": "src/univalue/test/round1.json",
    "content": "[\"\\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\"]\n"
  },
  {
    "path": "src/univalue/test/round2.json",
    "content": "[\"a§■𐎒𝅘𝅥𝅯\"]\n"
  },
  {
    "path": "src/univalue/test/round3.json",
    "content": "\"abcdefghijklmnopqrstuvwxyz\"\n"
  },
  {
    "path": "src/univalue/test/round4.json",
    "content": "7\n"
  },
  {
    "path": "src/univalue/test/round5.json",
    "content": "true\n"
  },
  {
    "path": "src/univalue/test/round6.json",
    "content": "false\n"
  },
  {
    "path": "src/univalue/test/round7.json",
    "content": "null\n"
  },
  {
    "path": "src/univalue/test/test_json.cpp",
    "content": "// Test program that can be called by the JSON test suite at\n// https://github.com/nst/JSONTestSuite.\n//\n// It reads JSON input from stdin and exits with code 0 if it can be parsed\n// successfully. It also pretty prints the parsed JSON value to stdout.\n\n#include <iostream>\n#include <string>\n#include \"univalue.h\"\n\nusing namespace std;\n\nint main (int argc, char *argv[])\n{\n    UniValue val;\n    if (val.read(string(istreambuf_iterator<char>(cin),\n                        istreambuf_iterator<char>()))) {\n        cout << val.write(1 /* prettyIndent */, 4 /* indentLevel */) << endl;\n        return 0;\n    } else {\n        cerr << \"JSON Parse Error.\" << endl;\n        return 1;\n    }\n}\n"
  },
  {
    "path": "src/univalue/test/unitester.cpp",
    "content": "// Copyright 2014 BitPay Inc.\n// Distributed under the MIT/X11 software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <cassert>\n#include <string>\n#include \"univalue.h\"\n\n#ifndef JSON_TEST_SRC\n#error JSON_TEST_SRC must point to test source directory\n#endif\n\n#ifndef ARRAY_SIZE\n#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))\n#endif\n\nusing namespace std;\nstring srcdir(JSON_TEST_SRC);\nstatic bool test_failed = false;\n\n#define d_assert(expr) { if (!(expr)) { test_failed = true; fprintf(stderr, \"%s failed\\n\", filename.c_str()); } }\n#define f_assert(expr) { if (!(expr)) { test_failed = true; fprintf(stderr, \"%s failed\\n\", __func__); } }\n\nstatic std::string rtrim(std::string s)\n{\n    s.erase(s.find_last_not_of(\" \\n\\r\\t\")+1);\n    return s;\n}\n\nstatic void runtest(string filename, const string& jdata)\n{\n        string prefix = filename.substr(0, 4);\n\n        bool wantPass = (prefix == \"pass\") || (prefix == \"roun\");\n        bool wantFail = (prefix == \"fail\");\n        bool wantRoundTrip = (prefix == \"roun\");\n        assert(wantPass || wantFail);\n\n        UniValue val;\n        bool testResult = val.read(jdata);\n\n        if (wantPass) {\n            d_assert(testResult == true);\n        } else {\n            d_assert(testResult == false);\n        }\n\n        if (wantRoundTrip) {\n            std::string odata = val.write(0, 0);\n            assert(odata == rtrim(jdata));\n        }\n}\n\nstatic void runtest_file(const char *filename_)\n{\n        string basename(filename_);\n        string filename = srcdir + \"/\" + basename;\n        FILE *f = fopen(filename.c_str(), \"r\");\n        assert(f != NULL);\n\n        string jdata;\n\n        char buf[4096];\n        while (!feof(f)) {\n                int bread = fread(buf, 1, sizeof(buf), f);\n                assert(!ferror(f));\n\n                string s(buf, bread);\n                jdata += s;\n        }\n\n        assert(!ferror(f));\n        fclose(f);\n\n        runtest(basename, jdata);\n}\n\nstatic const char *filenames[] = {\n        \"fail10.json\",\n        \"fail11.json\",\n        \"fail12.json\",\n        \"fail13.json\",\n        \"fail14.json\",\n        \"fail15.json\",\n        \"fail16.json\",\n        \"fail17.json\",\n        //\"fail18.json\",             // investigate\n        \"fail19.json\",\n        \"fail1.json\",\n        \"fail20.json\",\n        \"fail21.json\",\n        \"fail22.json\",\n        \"fail23.json\",\n        \"fail24.json\",\n        \"fail25.json\",\n        \"fail26.json\",\n        \"fail27.json\",\n        \"fail28.json\",\n        \"fail29.json\",\n        \"fail2.json\",\n        \"fail30.json\",\n        \"fail31.json\",\n        \"fail32.json\",\n        \"fail33.json\",\n        \"fail34.json\",\n        \"fail35.json\",\n        \"fail36.json\",\n        \"fail37.json\",\n        \"fail38.json\",               // invalid unicode: only first half of surrogate pair\n        \"fail39.json\",               // invalid unicode: only second half of surrogate pair\n        \"fail40.json\",               // invalid unicode: broken UTF-8\n        \"fail41.json\",               // invalid unicode: unfinished UTF-8\n        \"fail42.json\",               // valid json with garbage following a nul byte\n        \"fail44.json\",               // unterminated string\n        \"fail3.json\",\n        \"fail4.json\",                // extra comma\n        \"fail5.json\",\n        \"fail6.json\",\n        \"fail7.json\",\n        \"fail8.json\",\n        \"fail9.json\",               // extra comma\n        \"pass1.json\",\n        \"pass2.json\",\n        \"pass3.json\",\n        \"round1.json\",              // round-trip test\n        \"round2.json\",              // unicode\n        \"round3.json\",              // bare string\n        \"round4.json\",              // bare number\n        \"round5.json\",              // bare true\n        \"round6.json\",              // bare false\n        \"round7.json\",              // bare null\n};\n\n// Test \\u handling\nvoid unescape_unicode_test()\n{\n    UniValue val;\n    bool testResult;\n    // Escaped ASCII (quote)\n    testResult = val.read(\"[\\\"\\\\u0022\\\"]\");\n    f_assert(testResult);\n    f_assert(val[0].get_str() == \"\\\"\");\n    // Escaped Basic Plane character, two-byte UTF-8\n    testResult = val.read(\"[\\\"\\\\u0191\\\"]\");\n    f_assert(testResult);\n    f_assert(val[0].get_str() == \"\\xc6\\x91\");\n    // Escaped Basic Plane character, three-byte UTF-8\n    testResult = val.read(\"[\\\"\\\\u2191\\\"]\");\n    f_assert(testResult);\n    f_assert(val[0].get_str() == \"\\xe2\\x86\\x91\");\n    // Escaped Supplementary Plane character U+1d161\n    testResult = val.read(\"[\\\"\\\\ud834\\\\udd61\\\"]\");\n    f_assert(testResult);\n    f_assert(val[0].get_str() == \"\\xf0\\x9d\\x85\\xa1\");\n}\n\nint main (int argc, char *argv[])\n{\n    for (unsigned int fidx = 0; fidx < ARRAY_SIZE(filenames); fidx++) {\n        runtest_file(filenames[fidx]);\n    }\n\n    unescape_unicode_test();\n\n    return test_failed ? 1 : 0;\n}\n\n"
  },
  {
    "path": "src/util.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <util.h>\n\n#include <chainparamsbase.h>\n#include <random.h>\n#include <serialize.h>\n#include <utilstrencodings.h>\n\n#include <stdarg.h>\n\n#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))\n#include <pthread.h>\n#include <pthread_np.h>\n#endif\n\n#ifndef WIN32\n// for posix_fallocate\n#ifdef __linux__\n\n#ifdef _POSIX_C_SOURCE\n#undef _POSIX_C_SOURCE\n#endif\n\n#define _POSIX_C_SOURCE 200112L\n\n#endif // __linux__\n\n#include <algorithm>\n#include <fcntl.h>\n#include <sys/resource.h>\n#include <sys/stat.h>\n\n#else\n\n#ifdef _MSC_VER\n#pragma warning(disable:4786)\n#pragma warning(disable:4804)\n#pragma warning(disable:4805)\n#pragma warning(disable:4717)\n#endif\n\n#ifdef _WIN32_WINNT\n#undef _WIN32_WINNT\n#endif\n#define _WIN32_WINNT 0x0501\n\n#ifdef _WIN32_IE\n#undef _WIN32_IE\n#endif\n#define _WIN32_IE 0x0501\n\n#define WIN32_LEAN_AND_MEAN 1\n#ifndef NOMINMAX\n#define NOMINMAX\n#endif\n\n#include <io.h> /* for _commit */\n#include <shlobj.h>\n#endif\n\n#ifdef HAVE_SYS_PRCTL_H\n#include <sys/prctl.h>\n#endif\n\n#ifdef HAVE_MALLOPT_ARENA_MAX\n#include <malloc.h>\n#endif\n\n#include <boost/algorithm/string/case_conv.hpp> // for to_lower()\n#include <boost/algorithm/string/predicate.hpp> // for startswith() and endswith()\n#include <boost/interprocess/sync/file_lock.hpp>\n#include <boost/program_options/detail/config_file.hpp>\n#include <boost/thread.hpp>\n#include <openssl/crypto.h>\n#include <openssl/rand.h>\n#include <openssl/conf.h>\n\n// Application startup time (used for uptime calculation)\nconst int64_t nStartupTime = GetTime();\n\nconst char * const BITCOIN_CONF_FILENAME = \"sugarchain.conf\";\nconst char * const BITCOIN_PID_FILENAME = \"sugarchaind.pid\";\nconst char * const DEFAULT_DEBUGLOGFILE = \"debug.log\";\n\nArgsManager gArgs;\nbool fPrintToConsole = false;\nbool fPrintToDebugLog = true;\nbool fPruneDebugLog = false; // FIXME.SUGAR // prune debug.log\n\nbool fLogTimestamps = DEFAULT_LOGTIMESTAMPS;\nbool fLogTimeMicros = DEFAULT_LOGTIMEMICROS;\nbool fLogIPs = DEFAULT_LOGIPS;\nstd::atomic<bool> fReopenDebugLog(false);\nCTranslationInterface translationInterface;\n\n/** Log categories bitfield. */\nstd::atomic<uint32_t> logCategories(0);\n\n/** Init OpenSSL library multithreading support */\nstatic std::unique_ptr<CCriticalSection[]> ppmutexOpenSSL;\nvoid locking_callback(int mode, int i, const char* file, int line) NO_THREAD_SAFETY_ANALYSIS\n{\n    if (mode & CRYPTO_LOCK) {\n        ENTER_CRITICAL_SECTION(ppmutexOpenSSL[i]);\n    } else {\n        LEAVE_CRITICAL_SECTION(ppmutexOpenSSL[i]);\n    }\n}\n\n// Singleton for wrapping OpenSSL setup/teardown.\nclass CInit\n{\npublic:\n    CInit()\n    {\n        // Init OpenSSL library multithreading support\n        ppmutexOpenSSL.reset(new CCriticalSection[CRYPTO_num_locks()]);\n        CRYPTO_set_locking_callback(locking_callback);\n\n        // OpenSSL can optionally load a config file which lists optional loadable modules and engines.\n        // We don't use them so we don't require the config. However some of our libs may call functions\n        // which attempt to load the config file, possibly resulting in an exit() or crash if it is missing\n        // or corrupt. Explicitly tell OpenSSL not to try to load the file. The result for our libs will be\n        // that the config appears to have been loaded and there are no modules/engines available.\n        OPENSSL_no_config();\n\n#ifdef WIN32\n        // Seed OpenSSL PRNG with current contents of the screen\n        RAND_screen();\n#endif\n\n        // Seed OpenSSL PRNG with performance counter\n        RandAddSeed();\n    }\n    ~CInit()\n    {\n        // Securely erase the memory used by the PRNG\n        RAND_cleanup();\n        // Shutdown OpenSSL library multithreading support\n        CRYPTO_set_locking_callback(nullptr);\n        // Clear the set of locks now to maintain symmetry with the constructor.\n        ppmutexOpenSSL.reset();\n    }\n}\ninstance_of_cinit;\n\n/**\n * LogPrintf() has been broken a couple of times now\n * by well-meaning people adding mutexes in the most straightforward way.\n * It breaks because it may be called by global destructors during shutdown.\n * Since the order of destruction of static/global objects is undefined,\n * defining a mutex as a global object doesn't work (the mutex gets\n * destroyed, and then some later destructor calls OutputDebugStringF,\n * maybe indirectly, and you get a core dump at shutdown trying to lock\n * the mutex).\n */\n\nstatic boost::once_flag debugPrintInitFlag = BOOST_ONCE_INIT;\n\n/**\n * We use boost::call_once() to make sure mutexDebugLog and\n * vMsgsBeforeOpenLog are initialized in a thread-safe manner.\n *\n * NOTE: fileout, mutexDebugLog and sometimes vMsgsBeforeOpenLog\n * are leaked on exit. This is ugly, but will be cleaned up by\n * the OS/libc. When the shutdown sequence is fully audited and\n * tested, explicit destruction of these objects can be implemented.\n */\nstatic FILE* fileout = nullptr;\nstatic boost::mutex* mutexDebugLog = nullptr;\nstatic std::list<std::string>* vMsgsBeforeOpenLog;\n\nstatic int FileWriteStr(const std::string &str, FILE *fp)\n{\n    return fwrite(str.data(), 1, str.size(), fp);\n}\n\nstatic void DebugPrintInit()\n{\n    assert(mutexDebugLog == nullptr);\n    mutexDebugLog = new boost::mutex();\n    vMsgsBeforeOpenLog = new std::list<std::string>;\n}\n\nfs::path GetDebugLogPath()\n{\n    fs::path logfile(gArgs.GetArg(\"-debuglogfile\", DEFAULT_DEBUGLOGFILE));\n    if (logfile.is_absolute()) {\n        return logfile;\n    } else {\n        return GetDataDir() / logfile;\n    }\n}\n\nbool OpenDebugLog()\n{\n    boost::call_once(&DebugPrintInit, debugPrintInitFlag);\n    boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);\n\n    assert(fileout == nullptr);\n    assert(vMsgsBeforeOpenLog);\n    fs::path pathDebug = GetDebugLogPath();\n\n    fileout = fsbridge::fopen(pathDebug, \"a\");\n    if (!fileout) {\n        return false;\n    }\n\n    setbuf(fileout, nullptr); // unbuffered\n    // dump buffered messages from before we opened the log\n    while (!vMsgsBeforeOpenLog->empty()) {\n        FileWriteStr(vMsgsBeforeOpenLog->front(), fileout);\n        vMsgsBeforeOpenLog->pop_front();\n    }\n\n    delete vMsgsBeforeOpenLog;\n    vMsgsBeforeOpenLog = nullptr;\n    return true;\n}\n\nstruct CLogCategoryDesc\n{\n    uint32_t flag;\n    std::string category;\n};\n\nconst CLogCategoryDesc LogCategories[] =\n{\n    {BCLog::NONE, \"0\"},\n    {BCLog::NONE, \"none\"},\n    {BCLog::NET, \"net\"},\n    {BCLog::TOR, \"tor\"},\n    {BCLog::MEMPOOL, \"mempool\"},\n    {BCLog::HTTP, \"http\"},\n    {BCLog::BENCH, \"bench\"},\n    {BCLog::ZMQ, \"zmq\"},\n    {BCLog::DB, \"db\"},\n    {BCLog::RPC, \"rpc\"},\n    {BCLog::ESTIMATEFEE, \"estimatefee\"},\n    {BCLog::ADDRMAN, \"addrman\"},\n    {BCLog::SELECTCOINS, \"selectcoins\"},\n    {BCLog::REINDEX, \"reindex\"},\n    {BCLog::CMPCTBLOCK, \"cmpctblock\"},\n    {BCLog::RAND, \"rand\"},\n    {BCLog::PRUNE, \"prune\"},\n    {BCLog::PROXY, \"proxy\"},\n    {BCLog::MEMPOOLREJ, \"mempoolrej\"},\n    {BCLog::LIBEVENT, \"libevent\"},\n    {BCLog::COINDB, \"coindb\"},\n    {BCLog::QT, \"qt\"},\n    {BCLog::LEVELDB, \"leveldb\"},\n    {BCLog::ALL, \"1\"},\n    {BCLog::ALL, \"all\"},\n};\n\nbool GetLogCategory(uint32_t *f, const std::string *str)\n{\n    if (f && str) {\n        if (*str == \"\") {\n            *f = BCLog::ALL;\n            return true;\n        }\n        for (unsigned int i = 0; i < ARRAYLEN(LogCategories); i++) {\n            if (LogCategories[i].category == *str) {\n                *f = LogCategories[i].flag;\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\nstd::string ListLogCategories()\n{\n    std::string ret;\n    int outcount = 0;\n    for (unsigned int i = 0; i < ARRAYLEN(LogCategories); i++) {\n        // Omit the special cases.\n        if (LogCategories[i].flag != BCLog::NONE && LogCategories[i].flag != BCLog::ALL) {\n            if (outcount != 0) ret += \", \";\n            ret += LogCategories[i].category;\n            outcount++;\n        }\n    }\n    return ret;\n}\n\nstd::vector<CLogCategoryActive> ListActiveLogCategories()\n{\n    std::vector<CLogCategoryActive> ret;\n    for (unsigned int i = 0; i < ARRAYLEN(LogCategories); i++) {\n        // Omit the special cases.\n        if (LogCategories[i].flag != BCLog::NONE && LogCategories[i].flag != BCLog::ALL) {\n            CLogCategoryActive catActive;\n            catActive.category = LogCategories[i].category;\n            catActive.active = LogAcceptCategory(LogCategories[i].flag);\n            ret.push_back(catActive);\n        }\n    }\n    return ret;\n}\n\n/**\n * fStartedNewLine is a state variable held by the calling context that will\n * suppress printing of the timestamp when multiple calls are made that don't\n * end in a newline. Initialize it to true, and hold it, in the calling context.\n */\nstatic std::string LogTimestampStr(const std::string &str, std::atomic_bool *fStartedNewLine)\n{\n    std::string strStamped;\n\n    if (!fLogTimestamps)\n        return str;\n\n    if (*fStartedNewLine) {\n        int64_t nTimeMicros = GetTimeMicros();\n        strStamped = DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", nTimeMicros/1000000);\n        if (fLogTimeMicros)\n            strStamped += strprintf(\".%06d\", nTimeMicros%1000000);\n        int64_t mocktime = GetMockTime();\n        if (mocktime) {\n            strStamped += \" (mocktime: \" + DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", mocktime) + \")\";\n        }\n        strStamped += ' ' + str;\n    } else\n        strStamped = str;\n\n    if (!str.empty() && str[str.size()-1] == '\\n')\n        *fStartedNewLine = true;\n    else\n        *fStartedNewLine = false;\n\n    return strStamped;\n}\n\nint LogPrintStr(const std::string &str)\n{\n    int ret = 0; // Returns total number of characters written\n    static std::atomic_bool fStartedNewLine(true);\n\n    std::string strTimestamped = LogTimestampStr(str, &fStartedNewLine);\n\n    if (fPrintToConsole)\n    {\n        // print to console\n        ret = fwrite(strTimestamped.data(), 1, strTimestamped.size(), stdout);\n        fflush(stdout);\n    }\n    else if (fPrintToDebugLog)\n    {\n        boost::call_once(&DebugPrintInit, debugPrintInitFlag);\n        boost::mutex::scoped_lock scoped_lock(*mutexDebugLog);\n\n        // buffer if we haven't opened the log yet\n        if (fileout == nullptr) {\n            assert(vMsgsBeforeOpenLog);\n            ret = strTimestamped.length();\n            vMsgsBeforeOpenLog->push_back(strTimestamped);\n        }\n        else\n        {\n            // reopen the log file, if requested\n            if (fReopenDebugLog) {\n                fReopenDebugLog = false;\n                fs::path pathDebug = GetDebugLogPath();\n                if (fsbridge::freopen(pathDebug,\"a\",fileout) != nullptr)\n                    setbuf(fileout, nullptr); // unbuffered\n            }\n\n            ret = FileWriteStr(strTimestamped, fileout);\n        }\n\n        // FIXME.SUGAR // prune debug.log\n        // BEGIN - PRUNE DEBUG.LOG\n        // If debug.log is over 10 MB (10*1000*1000), shrink to 1 MB (1*1000*1000)\n        // see \"void ShrinkDebugFile()\"\n        if (fPrintToDebugLog && fPruneDebugLog && !fPrintToConsole)\n        {\n            {\n                // Amount of debug.log to save at end when shrinking (must fit in memory)\n                constexpr size_t RECENT_DEBUG_HISTORY_SIZE = 1*1000*1000; // was (10 * 1000000)\n                // Scroll debug.log if it's getting too big\n                fs::path pathLog = GetDebugLogPath();\n                FILE* file = fsbridge::fopen(pathLog, \"r\");\n                // If debug.log file is more than 10x bigger the RECENT_DEBUG_HISTORY_SIZE\n                // trim it down by saving only the last RECENT_DEBUG_HISTORY_SIZE bytes\n                if (file && fs::file_size(pathLog) > 10 * RECENT_DEBUG_HISTORY_SIZE) // was (11 * (RECENT_DEBUG_HISTORY_SIZE / 10)))\n                {\n                    // BEGIN - DEBUG FILESIZE\n                    printf(\"%s DEBUG.LOG PRUNED at %lu\\n\", DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", GetTime()).c_str(), fs::file_size(pathLog));\n                    // END - DEBUG FILESIZE\n\n                    // Restart the file with some of the end\n                    std::vector<char> vch(RECENT_DEBUG_HISTORY_SIZE, 0);\n                    fseek(file, -((long)vch.size()), SEEK_END);\n                    int nBytes = fread(vch.data(), 1, vch.size(), file);\n                    fclose(file);\n\n                    file = fsbridge::fopen(pathLog, \"w\");\n                    if (file)\n                    {\n                        fwrite(vch.data(), 1, nBytes, file);\n                        fclose(file);\n                    }\n                }\n                else if (file != nullptr)\n                    fclose(file);\n            }\n        }\n        // END - PRUNE LOG\n    }\n    return ret;\n}\n\n/** A map that contains all the currently held directory locks. After\n * successful locking, these will be held here until the global destructor\n * cleans them up and thus automatically unlocks them, or ReleaseDirectoryLocks\n * is called.\n */\nstatic std::map<std::string, std::unique_ptr<boost::interprocess::file_lock>> dir_locks;\n/** Mutex to protect dir_locks. */\nstatic std::mutex cs_dir_locks;\n\nbool LockDirectory(const fs::path& directory, const std::string lockfile_name, bool probe_only)\n{\n    std::lock_guard<std::mutex> ulock(cs_dir_locks);\n    fs::path pathLockFile = directory / lockfile_name;\n\n    // If a lock for this directory already exists in the map, don't try to re-lock it\n    if (dir_locks.count(pathLockFile.string())) {\n        return true;\n    }\n\n    // Create empty lock file if it doesn't exist.\n    FILE* file = fsbridge::fopen(pathLockFile, \"a\");\n    if (file) fclose(file);\n\n    try {\n        auto lock = MakeUnique<boost::interprocess::file_lock>(pathLockFile.string().c_str());\n        if (!lock->try_lock()) {\n            return false;\n        }\n        if (!probe_only) {\n            // Lock successful and we're not just probing, put it into the map\n            dir_locks.emplace(pathLockFile.string(), std::move(lock));\n        }\n    } catch (const boost::interprocess::interprocess_exception& e) {\n        return error(\"Error while attempting to lock directory %s: %s\", directory.string(), e.what());\n    }\n    return true;\n}\n\nvoid ReleaseDirectoryLocks()\n{\n    std::lock_guard<std::mutex> ulock(cs_dir_locks);\n    dir_locks.clear();\n}\n\n/** Interpret string as boolean, for argument parsing */\nstatic bool InterpretBool(const std::string& strValue)\n{\n    if (strValue.empty())\n        return true;\n    return (atoi(strValue) != 0);\n}\n\n/** Turn -noX into -X=0 */\nstatic void InterpretNegativeSetting(std::string& strKey, std::string& strValue)\n{\n    if (strKey.length()>3 && strKey[0]=='-' && strKey[1]=='n' && strKey[2]=='o')\n    {\n        strKey = \"-\" + strKey.substr(3);\n        strValue = InterpretBool(strValue) ? \"0\" : \"1\";\n    }\n}\n\nvoid ArgsManager::ParseParameters(int argc, const char* const argv[])\n{\n    LOCK(cs_args);\n    mapArgs.clear();\n    mapMultiArgs.clear();\n\n    for (int i = 1; i < argc; i++)\n    {\n        std::string str(argv[i]);\n        std::string strValue;\n        size_t is_index = str.find('=');\n        if (is_index != std::string::npos)\n        {\n            strValue = str.substr(is_index+1);\n            str = str.substr(0, is_index);\n        }\n#ifdef WIN32\n        boost::to_lower(str);\n        if (boost::algorithm::starts_with(str, \"/\"))\n            str = \"-\" + str.substr(1);\n#endif\n\n        if (str[0] != '-')\n            break;\n\n        // Interpret --foo as -foo.\n        // If both --foo and -foo are set, the last takes effect.\n        if (str.length() > 1 && str[1] == '-')\n            str = str.substr(1);\n        InterpretNegativeSetting(str, strValue);\n\n        mapArgs[str] = strValue;\n        mapMultiArgs[str].push_back(strValue);\n    }\n}\n\nstd::vector<std::string> ArgsManager::GetArgs(const std::string& strArg) const\n{\n    LOCK(cs_args);\n    auto it = mapMultiArgs.find(strArg);\n    if (it != mapMultiArgs.end()) return it->second;\n    return {};\n}\n\nbool ArgsManager::IsArgSet(const std::string& strArg) const\n{\n    LOCK(cs_args);\n    return mapArgs.count(strArg);\n}\n\nstd::string ArgsManager::GetArg(const std::string& strArg, const std::string& strDefault) const\n{\n    LOCK(cs_args);\n    auto it = mapArgs.find(strArg);\n    if (it != mapArgs.end()) return it->second;\n    return strDefault;\n}\n\nint64_t ArgsManager::GetArg(const std::string& strArg, int64_t nDefault) const\n{\n    LOCK(cs_args);\n    auto it = mapArgs.find(strArg);\n    if (it != mapArgs.end()) return atoi64(it->second);\n    return nDefault;\n}\n\nbool ArgsManager::GetBoolArg(const std::string& strArg, bool fDefault) const\n{\n    LOCK(cs_args);\n    auto it = mapArgs.find(strArg);\n    if (it != mapArgs.end()) return InterpretBool(it->second);\n    return fDefault;\n}\n\nbool ArgsManager::SoftSetArg(const std::string& strArg, const std::string& strValue)\n{\n    LOCK(cs_args);\n    if (IsArgSet(strArg)) return false;\n    ForceSetArg(strArg, strValue);\n    return true;\n}\n\nbool ArgsManager::SoftSetBoolArg(const std::string& strArg, bool fValue)\n{\n    if (fValue)\n        return SoftSetArg(strArg, std::string(\"1\"));\n    else\n        return SoftSetArg(strArg, std::string(\"0\"));\n}\n\nvoid ArgsManager::ForceSetArg(const std::string& strArg, const std::string& strValue)\n{\n    LOCK(cs_args);\n    mapArgs[strArg] = strValue;\n    mapMultiArgs[strArg] = {strValue};\n}\n\n\n\nstatic const int screenWidth = 79;\nstatic const int optIndent = 2;\nstatic const int msgIndent = 7;\n\nstd::string HelpMessageGroup(const std::string &message) {\n    return std::string(message) + std::string(\"\\n\\n\");\n}\n\nstd::string HelpMessageOpt(const std::string &option, const std::string &message) {\n    return std::string(optIndent,' ') + std::string(option) +\n           std::string(\"\\n\") + std::string(msgIndent,' ') +\n           FormatParagraph(message, screenWidth - msgIndent, msgIndent) +\n           std::string(\"\\n\\n\");\n}\n\nstatic std::string FormatException(const std::exception* pex, const char* pszThread)\n{\n#ifdef WIN32\n    char pszModule[MAX_PATH] = \"\";\n    GetModuleFileNameA(nullptr, pszModule, sizeof(pszModule));\n#else\n    const char* pszModule = \"sugarchain\";\n#endif\n    if (pex)\n        return strprintf(\n            \"EXCEPTION: %s       \\n%s       \\n%s in %s       \\n\", typeid(*pex).name(), pex->what(), pszModule, pszThread);\n    else\n        return strprintf(\n            \"UNKNOWN EXCEPTION       \\n%s in %s       \\n\", pszModule, pszThread);\n}\n\nvoid PrintExceptionContinue(const std::exception* pex, const char* pszThread)\n{\n    std::string message = FormatException(pex, pszThread);\n    LogPrintf(\"\\n\\n************************\\n%s\\n\", message);\n    fprintf(stderr, \"\\n\\n************************\\n%s\\n\", message.c_str());\n}\n\nfs::path GetDefaultDataDir()\n{\n    // Windows < Vista: C:\\Documents and Settings\\Username\\Application Data\\Bitcoin\n    // Windows >= Vista: C:\\Users\\Username\\AppData\\Roaming\\Bitcoin\n    // Mac: ~/Library/Application Support/Bitcoin\n    // Unix: ~/.bitcoin\n#ifdef WIN32\n    // Windows\n    return GetSpecialFolderPath(CSIDL_APPDATA) / \"Sugarchain\";\n#else\n    fs::path pathRet;\n    char* pszHome = getenv(\"HOME\");\n    if (pszHome == nullptr || strlen(pszHome) == 0)\n        pathRet = fs::path(\"/\");\n    else\n        pathRet = fs::path(pszHome);\n#ifdef MAC_OSX\n    // Mac\n    return pathRet / \"Library/Application Support/Sugarchain\";\n#else\n    // Unix\n    return pathRet / \".sugarchain\";\n#endif\n#endif\n}\n\nstatic fs::path pathCached;\nstatic fs::path pathCachedNetSpecific;\nstatic CCriticalSection csPathCached;\n\nconst fs::path &GetDataDir(bool fNetSpecific)\n{\n\n    LOCK(csPathCached);\n\n    fs::path &path = fNetSpecific ? pathCachedNetSpecific : pathCached;\n\n    // This can be called during exceptions by LogPrintf(), so we cache the\n    // value so we don't have to do memory allocations after that.\n    if (!path.empty())\n        return path;\n\n    if (gArgs.IsArgSet(\"-datadir\")) {\n        path = fs::system_complete(gArgs.GetArg(\"-datadir\", \"\"));\n        if (!fs::is_directory(path)) {\n            path = \"\";\n            return path;\n        }\n    } else {\n        path = GetDefaultDataDir();\n    }\n    if (fNetSpecific)\n        path /= BaseParams().DataDir();\n\n    if (fs::create_directories(path)) {\n        // This is the first run, create wallets subdirectory too\n        fs::create_directories(path / \"wallets\");\n    }\n\n    return path;\n}\n\nvoid ClearDatadirCache()\n{\n    LOCK(csPathCached);\n\n    pathCached = fs::path();\n    pathCachedNetSpecific = fs::path();\n}\n\nfs::path GetConfigFile(const std::string& confPath)\n{\n    fs::path pathConfigFile(confPath);\n    if (!pathConfigFile.is_complete())\n        pathConfigFile = GetDataDir(false) / pathConfigFile;\n\n    return pathConfigFile;\n}\n\nvoid ArgsManager::ReadConfigFile(const std::string& confPath)\n{\n    fs::ifstream streamConfig(GetConfigFile(confPath));\n    if (!streamConfig.good())\n        return; // No bitcoin.conf file is OK\n\n    {\n        LOCK(cs_args);\n        std::set<std::string> setOptions;\n        setOptions.insert(\"*\");\n\n        for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it)\n        {\n            // Don't overwrite existing settings so command line settings override bitcoin.conf\n            std::string strKey = std::string(\"-\") + it->string_key;\n            std::string strValue = it->value[0];\n            InterpretNegativeSetting(strKey, strValue);\n            if (mapArgs.count(strKey) == 0)\n                mapArgs[strKey] = strValue;\n            mapMultiArgs[strKey].push_back(strValue);\n        }\n    }\n    // If datadir is changed in .conf file:\n    ClearDatadirCache();\n    if (!fs::is_directory(GetDataDir(false))) {\n        throw std::runtime_error(strprintf(\"specified data directory \\\"%s\\\" does not exist.\", gArgs.GetArg(\"-datadir\", \"\").c_str()));\n    }\n}\n\n#ifndef WIN32\nfs::path GetPidFile()\n{\n    fs::path pathPidFile(gArgs.GetArg(\"-pid\", BITCOIN_PID_FILENAME));\n    if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;\n    return pathPidFile;\n}\n\nvoid CreatePidFile(const fs::path &path, pid_t pid)\n{\n    FILE* file = fsbridge::fopen(path, \"w\");\n    if (file)\n    {\n        fprintf(file, \"%d\\n\", pid);\n        fclose(file);\n    }\n}\n#endif\n\nbool RenameOver(fs::path src, fs::path dest)\n{\n#ifdef WIN32\n    return MoveFileExA(src.string().c_str(), dest.string().c_str(),\n                       MOVEFILE_REPLACE_EXISTING) != 0;\n#else\n    int rc = std::rename(src.string().c_str(), dest.string().c_str());\n    return (rc == 0);\n#endif /* WIN32 */\n}\n\n/**\n * Ignores exceptions thrown by Boost's create_directories if the requested directory exists.\n * Specifically handles case where path p exists, but it wasn't possible for the user to\n * write to the parent directory.\n */\nbool TryCreateDirectories(const fs::path& p)\n{\n    try\n    {\n        return fs::create_directories(p);\n    } catch (const fs::filesystem_error&) {\n        if (!fs::exists(p) || !fs::is_directory(p))\n            throw;\n    }\n\n    // create_directories didn't create the directory, it had to have existed already\n    return false;\n}\n\nvoid FileCommit(FILE *file)\n{\n    fflush(file); // harmless if redundantly called\n#ifdef WIN32\n    HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(file));\n    FlushFileBuffers(hFile);\n#else\n    #if defined(__linux__) || defined(__NetBSD__)\n    fdatasync(fileno(file));\n    #elif defined(__APPLE__) && defined(F_FULLFSYNC)\n    fcntl(fileno(file), F_FULLFSYNC, 0);\n    #else\n    fsync(fileno(file));\n    #endif\n#endif\n}\n\nbool TruncateFile(FILE *file, unsigned int length) {\n#if defined(WIN32)\n    return _chsize(_fileno(file), length) == 0;\n#else\n    return ftruncate(fileno(file), length) == 0;\n#endif\n}\n\n/**\n * this function tries to raise the file descriptor limit to the requested number.\n * It returns the actual file descriptor limit (which may be more or less than nMinFD)\n */\nint RaiseFileDescriptorLimit(int nMinFD) {\n#if defined(WIN32)\n    return 2048;\n#else\n    struct rlimit limitFD;\n    if (getrlimit(RLIMIT_NOFILE, &limitFD) != -1) {\n        if (limitFD.rlim_cur < (rlim_t)nMinFD) {\n            limitFD.rlim_cur = nMinFD;\n            if (limitFD.rlim_cur > limitFD.rlim_max)\n                limitFD.rlim_cur = limitFD.rlim_max;\n            setrlimit(RLIMIT_NOFILE, &limitFD);\n            getrlimit(RLIMIT_NOFILE, &limitFD);\n        }\n        return limitFD.rlim_cur;\n    }\n    return nMinFD; // getrlimit failed, assume it's fine\n#endif\n}\n\n/**\n * this function tries to make a particular range of a file allocated (corresponding to disk space)\n * it is advisory, and the range specified in the arguments will never contain live data\n */\nvoid AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) {\n#if defined(WIN32)\n    // Windows-specific version\n    HANDLE hFile = (HANDLE)_get_osfhandle(_fileno(file));\n    LARGE_INTEGER nFileSize;\n    int64_t nEndPos = (int64_t)offset + length;\n    nFileSize.u.LowPart = nEndPos & 0xFFFFFFFF;\n    nFileSize.u.HighPart = nEndPos >> 32;\n    SetFilePointerEx(hFile, nFileSize, 0, FILE_BEGIN);\n    SetEndOfFile(hFile);\n#elif defined(MAC_OSX)\n    // OSX specific version\n    fstore_t fst;\n    fst.fst_flags = F_ALLOCATECONTIG;\n    fst.fst_posmode = F_PEOFPOSMODE;\n    fst.fst_offset = 0;\n    fst.fst_length = (off_t)offset + length;\n    fst.fst_bytesalloc = 0;\n    if (fcntl(fileno(file), F_PREALLOCATE, &fst) == -1) {\n        fst.fst_flags = F_ALLOCATEALL;\n        fcntl(fileno(file), F_PREALLOCATE, &fst);\n    }\n    ftruncate(fileno(file), fst.fst_length);\n#elif defined(__linux__)\n    // Version using posix_fallocate\n    off_t nEndPos = (off_t)offset + length;\n    posix_fallocate(fileno(file), 0, nEndPos);\n#else\n    // Fallback version\n    // TODO: just write one byte per block\n    static const char buf[65536] = {};\n    fseek(file, offset, SEEK_SET);\n    while (length > 0) {\n        unsigned int now = 65536;\n        if (length < now)\n            now = length;\n        fwrite(buf, 1, now, file); // allowed to fail; this function is advisory anyway\n        length -= now;\n    }\n#endif\n}\n\nvoid ShrinkDebugFile()\n{\n    // Amount of debug.log to save at end when shrinking (must fit in memory)\n    constexpr size_t RECENT_DEBUG_HISTORY_SIZE = 10 * 1000000;\n    // Scroll debug.log if it's getting too big\n    fs::path pathLog = GetDebugLogPath();\n    FILE* file = fsbridge::fopen(pathLog, \"r\");\n    // If debug.log file is more than 10% bigger the RECENT_DEBUG_HISTORY_SIZE\n    // trim it down by saving only the last RECENT_DEBUG_HISTORY_SIZE bytes\n    if (file && fs::file_size(pathLog) > 11 * (RECENT_DEBUG_HISTORY_SIZE / 10))\n    {\n        // Restart the file with some of the end\n        std::vector<char> vch(RECENT_DEBUG_HISTORY_SIZE, 0);\n        fseek(file, -((long)vch.size()), SEEK_END);\n        int nBytes = fread(vch.data(), 1, vch.size(), file);\n        fclose(file);\n\n        file = fsbridge::fopen(pathLog, \"w\");\n        if (file)\n        {\n            fwrite(vch.data(), 1, nBytes, file);\n            fclose(file);\n        }\n    }\n    else if (file != nullptr)\n        fclose(file);\n}\n\n#ifdef WIN32\nfs::path GetSpecialFolderPath(int nFolder, bool fCreate)\n{\n    char pszPath[MAX_PATH] = \"\";\n\n    if(SHGetSpecialFolderPathA(nullptr, pszPath, nFolder, fCreate))\n    {\n        return fs::path(pszPath);\n    }\n\n    LogPrintf(\"SHGetSpecialFolderPathA() failed, could not obtain requested path.\\n\");\n    return fs::path(\"\");\n}\n#endif\n\nvoid runCommand(const std::string& strCommand)\n{\n    if (strCommand.empty()) return;\n    int nErr = ::system(strCommand.c_str());\n    if (nErr)\n        LogPrintf(\"runCommand error: system(%s) returned %d\\n\", strCommand, nErr);\n}\n\nvoid RenameThread(const char* name)\n{\n#if defined(PR_SET_NAME)\n    // Only the first 15 characters are used (16 - NUL terminator)\n    ::prctl(PR_SET_NAME, name, 0, 0, 0);\n#elif (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__))\n    pthread_set_name_np(pthread_self(), name);\n\n#elif defined(MAC_OSX)\n    pthread_setname_np(name);\n#else\n    // Prevent warnings for unused parameters...\n    (void)name;\n#endif\n}\n\nvoid SetupEnvironment()\n{\n#ifdef HAVE_MALLOPT_ARENA_MAX\n    // glibc-specific: On 32-bit systems set the number of arenas to 1.\n    // By default, since glibc 2.10, the C library will create up to two heap\n    // arenas per core. This is known to cause excessive virtual address space\n    // usage in our usage. Work around it by setting the maximum number of\n    // arenas to 1.\n    if (sizeof(void*) == 4) {\n        mallopt(M_ARENA_MAX, 1);\n    }\n#endif\n    // On most POSIX systems (e.g. Linux, but not BSD) the environment's locale\n    // may be invalid, in which case the \"C\" locale is used as fallback.\n#if !defined(WIN32) && !defined(MAC_OSX) && !defined(__FreeBSD__) && !defined(__OpenBSD__)\n    try {\n        std::locale(\"\"); // Raises a runtime error if current locale is invalid\n    } catch (const std::runtime_error&) {\n        setenv(\"LC_ALL\", \"C\", 1);\n    }\n#endif\n    // The path locale is lazy initialized and to avoid deinitialization errors\n    // in multithreading environments, it is set explicitly by the main thread.\n    // A dummy locale is used to extract the internal default locale, used by\n    // fs::path, which is then used to explicitly imbue the path.\n    std::locale loc = fs::path::imbue(std::locale::classic());\n    fs::path::imbue(loc);\n}\n\nbool SetupNetworking()\n{\n#ifdef WIN32\n    // Initialize Windows Sockets\n    WSADATA wsadata;\n    int ret = WSAStartup(MAKEWORD(2,2), &wsadata);\n    if (ret != NO_ERROR || LOBYTE(wsadata.wVersion ) != 2 || HIBYTE(wsadata.wVersion) != 2)\n        return false;\n#endif\n    return true;\n}\n\nint GetNumCores()\n{\n#if BOOST_VERSION >= 105600\n    return boost::thread::physical_concurrency();\n#else // Must fall back to hardware_concurrency, which unfortunately counts virtual cores\n    return boost::thread::hardware_concurrency();\n#endif\n}\n\nstd::string CopyrightHolders(const std::string& strPrefix)\n{\n    std::string strCopyrightHolders = strPrefix + strprintf(_(COPYRIGHT_HOLDERS), _(COPYRIGHT_HOLDERS_SUBSTITUTION));\n\n    // FIXME.SUGAR // SURE?\n    // remove duplicated CopyrightHolders on SplashScreen and About\n    /*\n    // Check for untranslated substitution to make sure Bitcoin Core copyright is not removed by accident\n    if (strprintf(COPYRIGHT_HOLDERS, COPYRIGHT_HOLDERS_SUBSTITUTION).find(\"Bitcoin Core\") == std::string::npos) {\n        strCopyrightHolders += \"\\n\" + strPrefix + \"The Bitcoin Core developers\";\n    }\n    */\n    return strCopyrightHolders;\n}\n\n// Obtain the application startup time (used for uptime calculation)\nint64_t GetStartupTime()\n{\n    return nStartupTime;\n}\n"
  },
  {
    "path": "src/util.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n/**\n * Server/client environment: argument handling, config file parsing,\n * logging, thread wrappers, startup time\n */\n#ifndef BITCOIN_UTIL_H\n#define BITCOIN_UTIL_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <compat.h>\n#include <fs.h>\n#include <sync.h>\n#include <tinyformat.h>\n#include <utiltime.h>\n\n#include <atomic>\n#include <exception>\n#include <map>\n#include <memory>\n#include <stdint.h>\n#include <string>\n#include <vector>\n\n#include <boost/signals2/signal.hpp>\n#include <boost/thread/condition_variable.hpp> // for boost::thread_interrupted\n\n// Application startup time (used for uptime calculation)\nint64_t GetStartupTime();\n\nstatic const bool DEFAULT_LOGTIMEMICROS = false;\nstatic const bool DEFAULT_LOGIPS        = false;\nstatic const bool DEFAULT_LOGTIMESTAMPS = true;\nextern const char * const DEFAULT_DEBUGLOGFILE;\n\n/** Signals for translation. */\nclass CTranslationInterface\n{\npublic:\n    /** Translate a message to the native language of the user. */\n    boost::signals2::signal<std::string (const char* psz)> Translate;\n};\n\nextern bool fPrintToConsole;\nextern bool fPrintToDebugLog;\nextern bool fPruneDebugLog; // FIXME.SUGAR // prune debug.log\n\nextern bool fLogTimestamps;\nextern bool fLogTimeMicros;\nextern bool fLogIPs;\nextern std::atomic<bool> fReopenDebugLog;\nextern CTranslationInterface translationInterface;\n\nextern const char * const BITCOIN_CONF_FILENAME;\nextern const char * const BITCOIN_PID_FILENAME;\n\nextern std::atomic<uint32_t> logCategories;\n\n/**\n * Translation function: Call Translate signal on UI interface, which returns a boost::optional result.\n * If no translation slot is registered, nothing is returned, and simply return the input.\n */\ninline std::string _(const char* psz)\n{\n    boost::optional<std::string> rv = translationInterface.Translate(psz);\n    return rv ? (*rv) : psz;\n}\n\nvoid SetupEnvironment();\nbool SetupNetworking();\n\nstruct CLogCategoryActive\n{\n    std::string category;\n    bool active;\n};\n\nnamespace BCLog {\n    enum LogFlags : uint32_t {\n        NONE        = 0,\n        NET         = (1 <<  0),\n        TOR         = (1 <<  1),\n        MEMPOOL     = (1 <<  2),\n        HTTP        = (1 <<  3),\n        BENCH       = (1 <<  4),\n        ZMQ         = (1 <<  5),\n        DB          = (1 <<  6),\n        RPC         = (1 <<  7),\n        ESTIMATEFEE = (1 <<  8),\n        ADDRMAN     = (1 <<  9),\n        SELECTCOINS = (1 << 10),\n        REINDEX     = (1 << 11),\n        CMPCTBLOCK  = (1 << 12),\n        RAND        = (1 << 13),\n        PRUNE       = (1 << 14),\n        PROXY       = (1 << 15),\n        MEMPOOLREJ  = (1 << 16),\n        LIBEVENT    = (1 << 17),\n        COINDB      = (1 << 18),\n        QT          = (1 << 19),\n        LEVELDB     = (1 << 20),\n        ALL         = ~(uint32_t)0,\n    };\n}\n/** Return true if log accepts specified category */\nstatic inline bool LogAcceptCategory(uint32_t category)\n{\n    return (logCategories.load(std::memory_order_relaxed) & category) != 0;\n}\n\n/** Returns a string with the log categories. */\nstd::string ListLogCategories();\n\n/** Returns a vector of the active log categories. */\nstd::vector<CLogCategoryActive> ListActiveLogCategories();\n\n/** Return true if str parses as a log category and set the flags in f */\nbool GetLogCategory(uint32_t *f, const std::string *str);\n\n/** Send a string to the log output */\nint LogPrintStr(const std::string &str);\n\n/** Get format string from VA_ARGS for error reporting */\ntemplate<typename... Args> std::string FormatStringFromLogArgs(const char *fmt, const Args&... args) { return fmt; }\n\nstatic inline void MarkUsed() {}\ntemplate<typename T, typename... Args> static inline void MarkUsed(const T& t, const Args&... args)\n{\n    (void)t;\n    MarkUsed(args...);\n}\n\n// Be conservative when using LogPrintf/error or other things which\n// unconditionally log to debug.log! It should not be the case that an inbound\n// peer can fill up a users disk with debug.log entries.\n\n#ifdef USE_COVERAGE\n#define LogPrintf(...) do { MarkUsed(__VA_ARGS__); } while(0)\n#define LogPrint(category, ...) do { MarkUsed(__VA_ARGS__); } while(0)\n#else\n#define LogPrintf(...) do { \\\n    std::string _log_msg_; /* Unlikely name to avoid shadowing variables */ \\\n    try { \\\n        _log_msg_ = tfm::format(__VA_ARGS__); \\\n    } catch (tinyformat::format_error &fmterr) { \\\n        /* Original format string will have newline so don't add one here */ \\\n        _log_msg_ = \"Error \\\"\" + std::string(fmterr.what()) + \"\\\" while formatting log message: \" + FormatStringFromLogArgs(__VA_ARGS__); \\\n    } \\\n    LogPrintStr(_log_msg_); \\\n} while(0)\n\n#define LogPrint(category, ...) do { \\\n    if (LogAcceptCategory((category))) { \\\n        LogPrintf(__VA_ARGS__); \\\n    } \\\n} while(0)\n#endif\n\ntemplate<typename... Args>\nbool error(const char* fmt, const Args&... args)\n{\n    LogPrintStr(\"ERROR: \" + tfm::format(fmt, args...) + \"\\n\");\n    return false;\n}\n\nvoid PrintExceptionContinue(const std::exception *pex, const char* pszThread);\nvoid FileCommit(FILE *file);\nbool TruncateFile(FILE *file, unsigned int length);\nint RaiseFileDescriptorLimit(int nMinFD);\nvoid AllocateFileRange(FILE *file, unsigned int offset, unsigned int length);\nbool RenameOver(fs::path src, fs::path dest);\nbool LockDirectory(const fs::path& directory, const std::string lockfile_name, bool probe_only=false);\n\n/** Release all directory locks. This is used for unit testing only, at runtime\n * the global destructor will take care of the locks.\n */\nvoid ReleaseDirectoryLocks();\n\nbool TryCreateDirectories(const fs::path& p);\nfs::path GetDefaultDataDir();\nconst fs::path &GetDataDir(bool fNetSpecific = true);\nvoid ClearDatadirCache();\nfs::path GetConfigFile(const std::string& confPath);\n#ifndef WIN32\nfs::path GetPidFile();\nvoid CreatePidFile(const fs::path &path, pid_t pid);\n#endif\n#ifdef WIN32\nfs::path GetSpecialFolderPath(int nFolder, bool fCreate = true);\n#endif\nfs::path GetDebugLogPath();\nbool OpenDebugLog();\nvoid ShrinkDebugFile();\nvoid runCommand(const std::string& strCommand);\n\ninline bool IsSwitchChar(char c)\n{\n#ifdef WIN32\n    return c == '-' || c == '/';\n#else\n    return c == '-';\n#endif\n}\n\nclass ArgsManager\n{\nprotected:\n    mutable CCriticalSection cs_args;\n    std::map<std::string, std::string> mapArgs;\n    std::map<std::string, std::vector<std::string>> mapMultiArgs;\npublic:\n    void ParseParameters(int argc, const char*const argv[]);\n    void ReadConfigFile(const std::string& confPath);\n\n    /**\n     * Return a vector of strings of the given argument\n     *\n     * @param strArg Argument to get (e.g. \"-foo\")\n     * @return command-line arguments\n     */\n    std::vector<std::string> GetArgs(const std::string& strArg) const;\n\n    /**\n     * Return true if the given argument has been manually set\n     *\n     * @param strArg Argument to get (e.g. \"-foo\")\n     * @return true if the argument has been set\n     */\n    bool IsArgSet(const std::string& strArg) const;\n\n    /**\n     * Return string argument or default value\n     *\n     * @param strArg Argument to get (e.g. \"-foo\")\n     * @param strDefault (e.g. \"1\")\n     * @return command-line argument or default value\n     */\n    std::string GetArg(const std::string& strArg, const std::string& strDefault) const;\n\n    /**\n     * Return integer argument or default value\n     *\n     * @param strArg Argument to get (e.g. \"-foo\")\n     * @param nDefault (e.g. 1)\n     * @return command-line argument (0 if invalid number) or default value\n     */\n    int64_t GetArg(const std::string& strArg, int64_t nDefault) const;\n\n    /**\n     * Return boolean argument or default value\n     *\n     * @param strArg Argument to get (e.g. \"-foo\")\n     * @param fDefault (true or false)\n     * @return command-line argument or default value\n     */\n    bool GetBoolArg(const std::string& strArg, bool fDefault) const;\n\n    /**\n     * Set an argument if it doesn't already have a value\n     *\n     * @param strArg Argument to set (e.g. \"-foo\")\n     * @param strValue Value (e.g. \"1\")\n     * @return true if argument gets set, false if it already had a value\n     */\n    bool SoftSetArg(const std::string& strArg, const std::string& strValue);\n\n    /**\n     * Set a boolean argument if it doesn't already have a value\n     *\n     * @param strArg Argument to set (e.g. \"-foo\")\n     * @param fValue Value (e.g. false)\n     * @return true if argument gets set, false if it already had a value\n     */\n    bool SoftSetBoolArg(const std::string& strArg, bool fValue);\n\n    // Forces an arg setting. Called by SoftSetArg() if the arg hasn't already\n    // been set. Also called directly in testing.\n    void ForceSetArg(const std::string& strArg, const std::string& strValue);\n};\n\nextern ArgsManager gArgs;\n\n/**\n * Format a string to be used as group of options in help messages\n *\n * @param message Group name (e.g. \"RPC server options:\")\n * @return the formatted string\n */\nstd::string HelpMessageGroup(const std::string& message);\n\n/**\n * Format a string to be used as option description in help messages\n *\n * @param option Option message (e.g. \"-rpcuser=<user>\")\n * @param message Option description (e.g. \"Username for JSON-RPC connections\")\n * @return the formatted string\n */\nstd::string HelpMessageOpt(const std::string& option, const std::string& message);\n\n/**\n * Return the number of physical cores available on the current system.\n * @note This does not count virtual cores, such as those provided by HyperThreading\n * when boost is newer than 1.56.\n */\nint GetNumCores();\n\nvoid RenameThread(const char* name);\n\n/**\n * .. and a wrapper that just calls func once\n */\ntemplate <typename Callable> void TraceThread(const char* name,  Callable func)\n{\n    std::string s = strprintf(\"bitcoin-%s\", name);\n    RenameThread(s.c_str());\n    try\n    {\n        LogPrintf(\"%s thread start\\n\", name);\n        func();\n        LogPrintf(\"%s thread exit\\n\", name);\n    }\n    catch (const boost::thread_interrupted&)\n    {\n        LogPrintf(\"%s thread interrupt\\n\", name);\n        throw;\n    }\n    catch (const std::exception& e) {\n        PrintExceptionContinue(&e, name);\n        throw;\n    }\n    catch (...) {\n        PrintExceptionContinue(nullptr, name);\n        throw;\n    }\n}\n\nstd::string CopyrightHolders(const std::string& strPrefix);\n\n//! Substitute for C++14 std::make_unique.\ntemplate <typename T, typename... Args>\nstd::unique_ptr<T> MakeUnique(Args&&... args)\n{\n    return std::unique_ptr<T>(new T(std::forward<Args>(args)...));\n}\n\n#endif // BITCOIN_UTIL_H\n"
  },
  {
    "path": "src/utilmoneystr.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <utilmoneystr.h>\n\n#include <primitives/transaction.h>\n#include <tinyformat.h>\n#include <utilstrencodings.h>\n\nstd::string FormatMoney(const CAmount& n)\n{\n    // Note: not using straight sprintf here because we do NOT want\n    // localized number formatting.\n    int64_t n_abs = (n > 0 ? n : -n);\n    int64_t quotient = n_abs/COIN;\n    int64_t remainder = n_abs%COIN;\n    std::string str = strprintf(\"%d.%08d\", quotient, remainder);\n\n    // Right-trim excess zeros before the decimal point:\n    int nTrim = 0;\n    for (int i = str.size()-1; (str[i] == '0' && isdigit(str[i-2])); --i)\n        ++nTrim;\n    if (nTrim)\n        str.erase(str.size()-nTrim, nTrim);\n\n    if (n < 0)\n        str.insert((unsigned int)0, 1, '-');\n    return str;\n}\n\n\nbool ParseMoney(const std::string& str, CAmount& nRet)\n{\n    return ParseMoney(str.c_str(), nRet);\n}\n\nbool ParseMoney(const char* pszIn, CAmount& nRet)\n{\n    std::string strWhole;\n    int64_t nUnits = 0;\n    const char* p = pszIn;\n    while (isspace(*p))\n        p++;\n    for (; *p; p++)\n    {\n        if (*p == '.')\n        {\n            p++;\n            int64_t nMult = CENT*10;\n            while (isdigit(*p) && (nMult > 0))\n            {\n                nUnits += nMult * (*p++ - '0');\n                nMult /= 10;\n            }\n            break;\n        }\n        if (isspace(*p))\n            break;\n        if (!isdigit(*p))\n            return false;\n        strWhole.insert(strWhole.end(), *p);\n    }\n    for (; *p; p++)\n        if (!isspace(*p))\n            return false;\n    if (strWhole.size() > 10) // guard against 63 bit overflow\n        return false;\n    if (nUnits < 0 || nUnits > COIN)\n        return false;\n    int64_t nWhole = atoi64(strWhole);\n    CAmount nValue = nWhole*COIN + nUnits;\n\n    nRet = nValue;\n    return true;\n}\n"
  },
  {
    "path": "src/utilmoneystr.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n/**\n * Money parsing/formatting utilities.\n */\n#ifndef BITCOIN_UTILMONEYSTR_H\n#define BITCOIN_UTILMONEYSTR_H\n\n#include <stdint.h>\n#include <string>\n\n#include <amount.h>\n\n/* Do not use these functions to represent or parse monetary amounts to or from\n * JSON but use AmountFromValue and ValueFromAmount for that.\n */\nstd::string FormatMoney(const CAmount& n);\nbool ParseMoney(const std::string& str, CAmount& nRet);\nbool ParseMoney(const char* pszIn, CAmount& nRet);\n\n#endif // BITCOIN_UTILMONEYSTR_H\n"
  },
  {
    "path": "src/utilstrencodings.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <utilstrencodings.h>\n\n#include <tinyformat.h>\n\n#include <cstdlib>\n#include <cstring>\n#include <errno.h>\n#include <limits>\n\nstatic const std::string CHARS_ALPHA_NUM = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\nstatic const std::string SAFE_CHARS[] =\n{\n    CHARS_ALPHA_NUM + \" .,;-_/:?@()\", // SAFE_CHARS_DEFAULT\n    CHARS_ALPHA_NUM + \" .,;-_?@\", // SAFE_CHARS_UA_COMMENT\n    CHARS_ALPHA_NUM + \".-_\", // SAFE_CHARS_FILENAME\n};\n\nstd::string SanitizeString(const std::string& str, int rule)\n{\n    std::string strResult;\n    for (std::string::size_type i = 0; i < str.size(); i++)\n    {\n        if (SAFE_CHARS[rule].find(str[i]) != std::string::npos)\n            strResult.push_back(str[i]);\n    }\n    return strResult;\n}\n\nconst signed char p_util_hexdigit[256] =\n{ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,\n  -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,0xa,0xb,0xc,0xd,0xe,0xf,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,\n  -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, };\n\nsigned char HexDigit(char c)\n{\n    return p_util_hexdigit[(unsigned char)c];\n}\n\nbool IsHex(const std::string& str)\n{\n    for(std::string::const_iterator it(str.begin()); it != str.end(); ++it)\n    {\n        if (HexDigit(*it) < 0)\n            return false;\n    }\n    return (str.size() > 0) && (str.size()%2 == 0);\n}\n\nbool IsHexNumber(const std::string& str)\n{\n    size_t starting_location = 0;\n    if (str.size() > 2 && *str.begin() == '0' && *(str.begin()+1) == 'x') {\n        starting_location = 2;\n    }\n    for (auto c : str.substr(starting_location)) {\n        if (HexDigit(c) < 0) return false;\n    }\n    // Return false for empty string or \"0x\".\n    return (str.size() > starting_location);\n}\n\nstd::vector<unsigned char> ParseHex(const char* psz)\n{\n    // convert hex dump to vector\n    std::vector<unsigned char> vch;\n    while (true)\n    {\n        while (isspace(*psz))\n            psz++;\n        signed char c = HexDigit(*psz++);\n        if (c == (signed char)-1)\n            break;\n        unsigned char n = (c << 4);\n        c = HexDigit(*psz++);\n        if (c == (signed char)-1)\n            break;\n        n |= c;\n        vch.push_back(n);\n    }\n    return vch;\n}\n\nstd::vector<unsigned char> ParseHex(const std::string& str)\n{\n    return ParseHex(str.c_str());\n}\n\nvoid SplitHostPort(std::string in, int &portOut, std::string &hostOut) {\n    size_t colon = in.find_last_of(':');\n    // if a : is found, and it either follows a [...], or no other : is in the string, treat it as port separator\n    bool fHaveColon = colon != in.npos;\n    bool fBracketed = fHaveColon && (in[0]=='[' && in[colon-1]==']'); // if there is a colon, and in[0]=='[', colon is not 0, so in[colon-1] is safe\n    bool fMultiColon = fHaveColon && (in.find_last_of(':',colon-1) != in.npos);\n    if (fHaveColon && (colon==0 || fBracketed || !fMultiColon)) {\n        int32_t n;\n        if (ParseInt32(in.substr(colon + 1), &n) && n > 0 && n < 0x10000) {\n            in = in.substr(0, colon);\n            portOut = n;\n        }\n    }\n    if (in.size()>0 && in[0] == '[' && in[in.size()-1] == ']')\n        hostOut = in.substr(1, in.size()-2);\n    else\n        hostOut = in;\n}\n\nstd::string EncodeBase64(const unsigned char* pch, size_t len)\n{\n    static const char *pbase64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n    std::string strRet = \"\";\n    strRet.reserve((len+2)/3*4);\n\n    int mode=0, left=0;\n    const unsigned char *pchEnd = pch+len;\n\n    while (pch<pchEnd)\n    {\n        int enc = *(pch++);\n        switch (mode)\n        {\n            case 0: // we have no bits\n                strRet += pbase64[enc >> 2];\n                left = (enc & 3) << 4;\n                mode = 1;\n                break;\n\n            case 1: // we have two bits\n                strRet += pbase64[left | (enc >> 4)];\n                left = (enc & 15) << 2;\n                mode = 2;\n                break;\n\n            case 2: // we have four bits\n                strRet += pbase64[left | (enc >> 6)];\n                strRet += pbase64[enc & 63];\n                mode = 0;\n                break;\n        }\n    }\n\n    if (mode)\n    {\n        strRet += pbase64[left];\n        strRet += '=';\n        if (mode == 1)\n            strRet += '=';\n    }\n\n    return strRet;\n}\n\nstd::string EncodeBase64(const std::string& str)\n{\n    return EncodeBase64((const unsigned char*)str.c_str(), str.size());\n}\n\nstd::vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid)\n{\n    static const int decode64_table[256] =\n    {\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1,\n        -1, -1, -1, -1, -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,\n        15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28,\n        29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,\n        49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1\n    };\n\n    if (pfInvalid)\n        *pfInvalid = false;\n\n    std::vector<unsigned char> vchRet;\n    vchRet.reserve(strlen(p)*3/4);\n\n    int mode = 0;\n    int left = 0;\n\n    while (1)\n    {\n         int dec = decode64_table[(unsigned char)*p];\n         if (dec == -1) break;\n         p++;\n         switch (mode)\n         {\n             case 0: // we have no bits and get 6\n                 left = dec;\n                 mode = 1;\n                 break;\n\n              case 1: // we have 6 bits and keep 4\n                  vchRet.push_back((left<<2) | (dec>>4));\n                  left = dec & 15;\n                  mode = 2;\n                  break;\n\n             case 2: // we have 4 bits and get 6, we keep 2\n                 vchRet.push_back((left<<4) | (dec>>2));\n                 left = dec & 3;\n                 mode = 3;\n                 break;\n\n             case 3: // we have 2 bits and get 6\n                 vchRet.push_back((left<<6) | dec);\n                 mode = 0;\n                 break;\n         }\n    }\n\n    if (pfInvalid)\n        switch (mode)\n        {\n            case 0: // 4n base64 characters processed: ok\n                break;\n\n            case 1: // 4n+1 base64 character processed: impossible\n                *pfInvalid = true;\n                break;\n\n            case 2: // 4n+2 base64 characters processed: require '=='\n                if (left || p[0] != '=' || p[1] != '=' || decode64_table[(unsigned char)p[2]] != -1)\n                    *pfInvalid = true;\n                break;\n\n            case 3: // 4n+3 base64 characters processed: require '='\n                if (left || p[0] != '=' || decode64_table[(unsigned char)p[1]] != -1)\n                    *pfInvalid = true;\n                break;\n        }\n\n    return vchRet;\n}\n\nstd::string DecodeBase64(const std::string& str)\n{\n    std::vector<unsigned char> vchRet = DecodeBase64(str.c_str());\n    return std::string((const char*)vchRet.data(), vchRet.size());\n}\n\nstd::string EncodeBase32(const unsigned char* pch, size_t len)\n{\n    static const char *pbase32 = \"abcdefghijklmnopqrstuvwxyz234567\";\n\n    std::string strRet=\"\";\n    strRet.reserve((len+4)/5*8);\n\n    int mode=0, left=0;\n    const unsigned char *pchEnd = pch+len;\n\n    while (pch<pchEnd)\n    {\n        int enc = *(pch++);\n        switch (mode)\n        {\n            case 0: // we have no bits\n                strRet += pbase32[enc >> 3];\n                left = (enc & 7) << 2;\n                mode = 1;\n                break;\n\n            case 1: // we have three bits\n                strRet += pbase32[left | (enc >> 6)];\n                strRet += pbase32[(enc >> 1) & 31];\n                left = (enc & 1) << 4;\n                mode = 2;\n                break;\n\n            case 2: // we have one bit\n                strRet += pbase32[left | (enc >> 4)];\n                left = (enc & 15) << 1;\n                mode = 3;\n                break;\n\n            case 3: // we have four bits\n                strRet += pbase32[left | (enc >> 7)];\n                strRet += pbase32[(enc >> 2) & 31];\n                left = (enc & 3) << 3;\n                mode = 4;\n                break;\n\n            case 4: // we have two bits\n                strRet += pbase32[left | (enc >> 5)];\n                strRet += pbase32[enc & 31];\n                mode = 0;\n        }\n    }\n\n    static const int nPadding[5] = {0, 6, 4, 3, 1};\n    if (mode)\n    {\n        strRet += pbase32[left];\n        for (int n=0; n<nPadding[mode]; n++)\n             strRet += '=';\n    }\n\n    return strRet;\n}\n\nstd::string EncodeBase32(const std::string& str)\n{\n    return EncodeBase32((const unsigned char*)str.c_str(), str.size());\n}\n\nstd::vector<unsigned char> DecodeBase32(const char* p, bool* pfInvalid)\n{\n    static const int decode32_table[256] =\n    {\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,\n        15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1,  0,  1,  2,\n         3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,\n        23, 24, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n        -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1\n    };\n\n    if (pfInvalid)\n        *pfInvalid = false;\n\n    std::vector<unsigned char> vchRet;\n    vchRet.reserve((strlen(p))*5/8);\n\n    int mode = 0;\n    int left = 0;\n\n    while (1)\n    {\n         int dec = decode32_table[(unsigned char)*p];\n         if (dec == -1) break;\n         p++;\n         switch (mode)\n         {\n             case 0: // we have no bits and get 5\n                 left = dec;\n                 mode = 1;\n                 break;\n\n              case 1: // we have 5 bits and keep 2\n                  vchRet.push_back((left<<3) | (dec>>2));\n                  left = dec & 3;\n                  mode = 2;\n                  break;\n\n             case 2: // we have 2 bits and keep 7\n                 left = left << 5 | dec;\n                 mode = 3;\n                 break;\n\n             case 3: // we have 7 bits and keep 4\n                 vchRet.push_back((left<<1) | (dec>>4));\n                 left = dec & 15;\n                 mode = 4;\n                 break;\n\n             case 4: // we have 4 bits, and keep 1\n                 vchRet.push_back((left<<4) | (dec>>1));\n                 left = dec & 1;\n                 mode = 5;\n                 break;\n\n             case 5: // we have 1 bit, and keep 6\n                 left = left << 5 | dec;\n                 mode = 6;\n                 break;\n\n             case 6: // we have 6 bits, and keep 3\n                 vchRet.push_back((left<<2) | (dec>>3));\n                 left = dec & 7;\n                 mode = 7;\n                 break;\n\n             case 7: // we have 3 bits, and keep 0\n                 vchRet.push_back((left<<5) | dec);\n                 mode = 0;\n                 break;\n         }\n    }\n\n    if (pfInvalid)\n        switch (mode)\n        {\n            case 0: // 8n base32 characters processed: ok\n                break;\n\n            case 1: // 8n+1 base32 characters processed: impossible\n            case 3: //   +3\n            case 6: //   +6\n                *pfInvalid = true;\n                break;\n\n            case 2: // 8n+2 base32 characters processed: require '======'\n                if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || p[4] != '=' || p[5] != '=' || decode32_table[(unsigned char)p[6]] != -1)\n                    *pfInvalid = true;\n                break;\n\n            case 4: // 8n+4 base32 characters processed: require '===='\n                if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || p[3] != '=' || decode32_table[(unsigned char)p[4]] != -1)\n                    *pfInvalid = true;\n                break;\n\n            case 5: // 8n+5 base32 characters processed: require '==='\n                if (left || p[0] != '=' || p[1] != '=' || p[2] != '=' || decode32_table[(unsigned char)p[3]] != -1)\n                    *pfInvalid = true;\n                break;\n\n            case 7: // 8n+7 base32 characters processed: require '='\n                if (left || p[0] != '=' || decode32_table[(unsigned char)p[1]] != -1)\n                    *pfInvalid = true;\n                break;\n        }\n\n    return vchRet;\n}\n\nstd::string DecodeBase32(const std::string& str)\n{\n    std::vector<unsigned char> vchRet = DecodeBase32(str.c_str());\n    return std::string((const char*)vchRet.data(), vchRet.size());\n}\n\nstatic bool ParsePrechecks(const std::string& str)\n{\n    if (str.empty()) // No empty string allowed\n        return false;\n    if (str.size() >= 1 && (isspace(str[0]) || isspace(str[str.size()-1]))) // No padding allowed\n        return false;\n    if (str.size() != strlen(str.c_str())) // No embedded NUL characters allowed\n        return false;\n    return true;\n}\n\nbool ParseInt32(const std::string& str, int32_t *out)\n{\n    if (!ParsePrechecks(str))\n        return false;\n    char *endp = nullptr;\n    errno = 0; // strtol will not set errno if valid\n    long int n = strtol(str.c_str(), &endp, 10);\n    if(out) *out = (int32_t)n;\n    // Note that strtol returns a *long int*, so even if strtol doesn't report an over/underflow\n    // we still have to check that the returned value is within the range of an *int32_t*. On 64-bit\n    // platforms the size of these types may be different.\n    return endp && *endp == 0 && !errno &&\n        n >= std::numeric_limits<int32_t>::min() &&\n        n <= std::numeric_limits<int32_t>::max();\n}\n\nbool ParseInt64(const std::string& str, int64_t *out)\n{\n    if (!ParsePrechecks(str))\n        return false;\n    char *endp = nullptr;\n    errno = 0; // strtoll will not set errno if valid\n    long long int n = strtoll(str.c_str(), &endp, 10);\n    if(out) *out = (int64_t)n;\n    // Note that strtoll returns a *long long int*, so even if strtol doesn't report an over/underflow\n    // we still have to check that the returned value is within the range of an *int64_t*.\n    return endp && *endp == 0 && !errno &&\n        n >= std::numeric_limits<int64_t>::min() &&\n        n <= std::numeric_limits<int64_t>::max();\n}\n\nbool ParseUInt32(const std::string& str, uint32_t *out)\n{\n    if (!ParsePrechecks(str))\n        return false;\n    if (str.size() >= 1 && str[0] == '-') // Reject negative values, unfortunately strtoul accepts these by default if they fit in the range\n        return false;\n    char *endp = nullptr;\n    errno = 0; // strtoul will not set errno if valid\n    unsigned long int n = strtoul(str.c_str(), &endp, 10);\n    if(out) *out = (uint32_t)n;\n    // Note that strtoul returns a *unsigned long int*, so even if it doesn't report an over/underflow\n    // we still have to check that the returned value is within the range of an *uint32_t*. On 64-bit\n    // platforms the size of these types may be different.\n    return endp && *endp == 0 && !errno &&\n        n <= std::numeric_limits<uint32_t>::max();\n}\n\nbool ParseUInt64(const std::string& str, uint64_t *out)\n{\n    if (!ParsePrechecks(str))\n        return false;\n    if (str.size() >= 1 && str[0] == '-') // Reject negative values, unfortunately strtoull accepts these by default if they fit in the range\n        return false;\n    char *endp = nullptr;\n    errno = 0; // strtoull will not set errno if valid\n    unsigned long long int n = strtoull(str.c_str(), &endp, 10);\n    if(out) *out = (uint64_t)n;\n    // Note that strtoull returns a *unsigned long long int*, so even if it doesn't report an over/underflow\n    // we still have to check that the returned value is within the range of an *uint64_t*.\n    return endp && *endp == 0 && !errno &&\n        n <= std::numeric_limits<uint64_t>::max();\n}\n\n\nbool ParseDouble(const std::string& str, double *out)\n{\n    if (!ParsePrechecks(str))\n        return false;\n    if (str.size() >= 2 && str[0] == '0' && str[1] == 'x') // No hexadecimal floats allowed\n        return false;\n    std::istringstream text(str);\n    text.imbue(std::locale::classic());\n    double result;\n    text >> result;\n    if(out) *out = result;\n    return text.eof() && !text.fail();\n}\n\nstd::string FormatParagraph(const std::string& in, size_t width, size_t indent)\n{\n    std::stringstream out;\n    size_t ptr = 0;\n    size_t indented = 0;\n    while (ptr < in.size())\n    {\n        size_t lineend = in.find_first_of('\\n', ptr);\n        if (lineend == std::string::npos) {\n            lineend = in.size();\n        }\n        const size_t linelen = lineend - ptr;\n        const size_t rem_width = width - indented;\n        if (linelen <= rem_width) {\n            out << in.substr(ptr, linelen + 1);\n            ptr = lineend + 1;\n            indented = 0;\n        } else {\n            size_t finalspace = in.find_last_of(\" \\n\", ptr + rem_width);\n            if (finalspace == std::string::npos || finalspace < ptr) {\n                // No place to break; just include the entire word and move on\n                finalspace = in.find_first_of(\"\\n \", ptr);\n                if (finalspace == std::string::npos) {\n                    // End of the string, just add it and break\n                    out << in.substr(ptr);\n                    break;\n                }\n            }\n            out << in.substr(ptr, finalspace - ptr) << \"\\n\";\n            if (in[finalspace] == '\\n') {\n                indented = 0;\n            } else if (indent) {\n                out << std::string(indent, ' ');\n                indented = indent;\n            }\n            ptr = finalspace + 1;\n        }\n    }\n    return out.str();\n}\n\nstd::string i64tostr(int64_t n)\n{\n    return strprintf(\"%d\", n);\n}\n\nstd::string itostr(int n)\n{\n    return strprintf(\"%d\", n);\n}\n\nint64_t atoi64(const char* psz)\n{\n#ifdef _MSC_VER\n    return _atoi64(psz);\n#else\n    return strtoll(psz, nullptr, 10);\n#endif\n}\n\nint64_t atoi64(const std::string& str)\n{\n#ifdef _MSC_VER\n    return _atoi64(str.c_str());\n#else\n    return strtoll(str.c_str(), nullptr, 10);\n#endif\n}\n\nint atoi(const std::string& str)\n{\n    return atoi(str.c_str());\n}\n\n/** Upper bound for mantissa.\n * 10^18-1 is the largest arbitrary decimal that will fit in a signed 64-bit integer.\n * Larger integers cannot consist of arbitrary combinations of 0-9:\n *\n *   999999999999999999  1^18-1\n *  9223372036854775807  (1<<63)-1  (max int64_t)\n *  9999999999999999999  1^19-1     (would overflow)\n */\nstatic const int64_t UPPER_BOUND = 1000000000000000000LL - 1LL;\n\n/** Helper function for ParseFixedPoint */\nstatic inline bool ProcessMantissaDigit(char ch, int64_t &mantissa, int &mantissa_tzeros)\n{\n    if(ch == '0')\n        ++mantissa_tzeros;\n    else {\n        for (int i=0; i<=mantissa_tzeros; ++i) {\n            if (mantissa > (UPPER_BOUND / 10LL))\n                return false; /* overflow */\n            mantissa *= 10;\n        }\n        mantissa += ch - '0';\n        mantissa_tzeros = 0;\n    }\n    return true;\n}\n\nbool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out)\n{\n    int64_t mantissa = 0;\n    int64_t exponent = 0;\n    int mantissa_tzeros = 0;\n    bool mantissa_sign = false;\n    bool exponent_sign = false;\n    int ptr = 0;\n    int end = val.size();\n    int point_ofs = 0;\n\n    if (ptr < end && val[ptr] == '-') {\n        mantissa_sign = true;\n        ++ptr;\n    }\n    if (ptr < end)\n    {\n        if (val[ptr] == '0') {\n            /* pass single 0 */\n            ++ptr;\n        } else if (val[ptr] >= '1' && val[ptr] <= '9') {\n            while (ptr < end && val[ptr] >= '0' && val[ptr] <= '9') {\n                if (!ProcessMantissaDigit(val[ptr], mantissa, mantissa_tzeros))\n                    return false; /* overflow */\n                ++ptr;\n            }\n        } else return false; /* missing expected digit */\n    } else return false; /* empty string or loose '-' */\n    if (ptr < end && val[ptr] == '.')\n    {\n        ++ptr;\n        if (ptr < end && val[ptr] >= '0' && val[ptr] <= '9')\n        {\n            while (ptr < end && val[ptr] >= '0' && val[ptr] <= '9') {\n                if (!ProcessMantissaDigit(val[ptr], mantissa, mantissa_tzeros))\n                    return false; /* overflow */\n                ++ptr;\n                ++point_ofs;\n            }\n        } else return false; /* missing expected digit */\n    }\n    if (ptr < end && (val[ptr] == 'e' || val[ptr] == 'E'))\n    {\n        ++ptr;\n        if (ptr < end && val[ptr] == '+')\n            ++ptr;\n        else if (ptr < end && val[ptr] == '-') {\n            exponent_sign = true;\n            ++ptr;\n        }\n        if (ptr < end && val[ptr] >= '0' && val[ptr] <= '9') {\n            while (ptr < end && val[ptr] >= '0' && val[ptr] <= '9') {\n                if (exponent > (UPPER_BOUND / 10LL))\n                    return false; /* overflow */\n                exponent = exponent * 10 + val[ptr] - '0';\n                ++ptr;\n            }\n        } else return false; /* missing expected digit */\n    }\n    if (ptr != end)\n        return false; /* trailing garbage */\n\n    /* finalize exponent */\n    if (exponent_sign)\n        exponent = -exponent;\n    exponent = exponent - point_ofs + mantissa_tzeros;\n\n    /* finalize mantissa */\n    if (mantissa_sign)\n        mantissa = -mantissa;\n\n    /* convert to one 64-bit fixed-point value */\n    exponent += decimals;\n    if (exponent < 0)\n        return false; /* cannot represent values smaller than 10^-decimals */\n    if (exponent >= 18)\n        return false; /* cannot represent values larger than or equal to 10^(18-decimals) */\n\n    for (int i=0; i < exponent; ++i) {\n        if (mantissa > (UPPER_BOUND / 10LL) || mantissa < -(UPPER_BOUND / 10LL))\n            return false; /* overflow */\n        mantissa *= 10;\n    }\n    if (mantissa > UPPER_BOUND || mantissa < -UPPER_BOUND)\n        return false; /* overflow */\n\n    if (amount_out)\n        *amount_out = mantissa;\n\n    return true;\n}\n\n"
  },
  {
    "path": "src/utilstrencodings.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n/**\n * Utilities for converting data from/to strings.\n */\n#ifndef BITCOIN_UTILSTRENCODINGS_H\n#define BITCOIN_UTILSTRENCODINGS_H\n\n#include <stdint.h>\n#include <string>\n#include <vector>\n\n#define BEGIN(a)            ((char*)&(a))\n#define END(a)              ((char*)&((&(a))[1]))\n#define UBEGIN(a)           ((unsigned char*)&(a))\n#define UEND(a)             ((unsigned char*)&((&(a))[1]))\n#define ARRAYLEN(array)     (sizeof(array)/sizeof((array)[0]))\n\n/** Used by SanitizeString() */\nenum SafeChars\n{\n    SAFE_CHARS_DEFAULT, //!< The full set of allowed chars\n    SAFE_CHARS_UA_COMMENT, //!< BIP-0014 subset\n    SAFE_CHARS_FILENAME, //!< Chars allowed in filenames\n};\n\n/**\n* Remove unsafe chars. Safe chars chosen to allow simple messages/URLs/email\n* addresses, but avoid anything even possibly remotely dangerous like & or >\n* @param[in] str    The string to sanitize\n* @param[in] rule   The set of safe chars to choose (default: least restrictive)\n* @return           A new string without unsafe chars\n*/\nstd::string SanitizeString(const std::string& str, int rule = SAFE_CHARS_DEFAULT);\nstd::vector<unsigned char> ParseHex(const char* psz);\nstd::vector<unsigned char> ParseHex(const std::string& str);\nsigned char HexDigit(char c);\n/* Returns true if each character in str is a hex character, and has an even\n * number of hex digits.*/\nbool IsHex(const std::string& str);\n/**\n* Return true if the string is a hex number, optionally prefixed with \"0x\"\n*/\nbool IsHexNumber(const std::string& str);\nstd::vector<unsigned char> DecodeBase64(const char* p, bool* pfInvalid = nullptr);\nstd::string DecodeBase64(const std::string& str);\nstd::string EncodeBase64(const unsigned char* pch, size_t len);\nstd::string EncodeBase64(const std::string& str);\nstd::vector<unsigned char> DecodeBase32(const char* p, bool* pfInvalid = nullptr);\nstd::string DecodeBase32(const std::string& str);\nstd::string EncodeBase32(const unsigned char* pch, size_t len);\nstd::string EncodeBase32(const std::string& str);\n\nvoid SplitHostPort(std::string in, int &portOut, std::string &hostOut);\nstd::string i64tostr(int64_t n);\nstd::string itostr(int n);\nint64_t atoi64(const char* psz);\nint64_t atoi64(const std::string& str);\nint atoi(const std::string& str);\n\n/**\n * Convert string to signed 32-bit integer with strict parse error feedback.\n * @returns true if the entire string could be parsed as valid integer,\n *   false if not the entire string could be parsed or when overflow or underflow occurred.\n */\nbool ParseInt32(const std::string& str, int32_t *out);\n\n/**\n * Convert string to signed 64-bit integer with strict parse error feedback.\n * @returns true if the entire string could be parsed as valid integer,\n *   false if not the entire string could be parsed or when overflow or underflow occurred.\n */\nbool ParseInt64(const std::string& str, int64_t *out);\n\n/**\n * Convert decimal string to unsigned 32-bit integer with strict parse error feedback.\n * @returns true if the entire string could be parsed as valid integer,\n *   false if not the entire string could be parsed or when overflow or underflow occurred.\n */\nbool ParseUInt32(const std::string& str, uint32_t *out);\n\n/**\n * Convert decimal string to unsigned 64-bit integer with strict parse error feedback.\n * @returns true if the entire string could be parsed as valid integer,\n *   false if not the entire string could be parsed or when overflow or underflow occurred.\n */\nbool ParseUInt64(const std::string& str, uint64_t *out);\n\n/**\n * Convert string to double with strict parse error feedback.\n * @returns true if the entire string could be parsed as valid double,\n *   false if not the entire string could be parsed or when overflow or underflow occurred.\n */\nbool ParseDouble(const std::string& str, double *out);\n\ntemplate<typename T>\nstd::string HexStr(const T itbegin, const T itend, bool fSpaces=false)\n{\n    std::string rv;\n    static const char hexmap[16] = { '0', '1', '2', '3', '4', '5', '6', '7',\n                                     '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };\n    rv.reserve((itend-itbegin)*3);\n    for(T it = itbegin; it < itend; ++it)\n    {\n        unsigned char val = (unsigned char)(*it);\n        if(fSpaces && it != itbegin)\n            rv.push_back(' ');\n        rv.push_back(hexmap[val>>4]);\n        rv.push_back(hexmap[val&15]);\n    }\n\n    return rv;\n}\n\ntemplate<typename T>\ninline std::string HexStr(const T& vch, bool fSpaces=false)\n{\n    return HexStr(vch.begin(), vch.end(), fSpaces);\n}\n\n/**\n * Format a paragraph of text to a fixed width, adding spaces for\n * indentation to any added line.\n */\nstd::string FormatParagraph(const std::string& in, size_t width = 79, size_t indent = 0);\n\n/**\n * Timing-attack-resistant comparison.\n * Takes time proportional to length\n * of first argument.\n */\ntemplate <typename T>\nbool TimingResistantEqual(const T& a, const T& b)\n{\n    if (b.size() == 0) return a.size() == 0;\n    size_t accumulator = a.size() ^ b.size();\n    for (size_t i = 0; i < a.size(); i++)\n        accumulator |= a[i] ^ b[i%b.size()];\n    return accumulator == 0;\n}\n\n/** Parse number as fixed point according to JSON number syntax.\n * See http://json.org/number.gif\n * @returns true on success, false on error.\n * @note The result must be in the range (-10^18,10^18), otherwise an overflow error will trigger.\n */\nbool ParseFixedPoint(const std::string &val, int decimals, int64_t *amount_out);\n\n/** Convert from one power-of-2 number base to another. */\ntemplate<int frombits, int tobits, bool pad, typename O, typename I>\nbool ConvertBits(O& out, I it, I end) {\n    size_t acc = 0;\n    size_t bits = 0;\n    constexpr size_t maxv = (1 << tobits) - 1;\n    constexpr size_t max_acc = (1 << (frombits + tobits - 1)) - 1;\n    while (it != end) {\n        acc = ((acc << frombits) | *it) & max_acc;\n        bits += frombits;\n        while (bits >= tobits) {\n            bits -= tobits;\n            out.push_back((acc >> bits) & maxv);\n        }\n        ++it;\n    }\n    if (pad) {\n        if (bits) out.push_back((acc << (tobits - bits)) & maxv);\n    } else if (bits >= frombits || ((acc << (tobits - bits)) & maxv)) {\n        return false;\n    }\n    return true;\n}\n\n#endif // BITCOIN_UTILSTRENCODINGS_H\n"
  },
  {
    "path": "src/utiltime.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <utiltime.h>\n\n#include <atomic>\n\n#include <boost/date_time/posix_time/posix_time.hpp>\n#include <boost/thread.hpp>\n\nstatic std::atomic<int64_t> nMockTime(0); //!< For unit testing\n\nint64_t GetTime()\n{\n    int64_t mocktime = nMockTime.load(std::memory_order_relaxed);\n    if (mocktime) return mocktime;\n\n    time_t now = time(nullptr);\n    assert(now > 0);\n    return now;\n}\n\nvoid SetMockTime(int64_t nMockTimeIn)\n{\n    nMockTime.store(nMockTimeIn, std::memory_order_relaxed);\n}\n\nint64_t GetMockTime()\n{\n    return nMockTime.load(std::memory_order_relaxed);\n}\n\nint64_t GetTimeMillis()\n{\n    int64_t now = (boost::posix_time::microsec_clock::universal_time() -\n                   boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds();\n    assert(now > 0);\n    return now;\n}\n\nint64_t GetTimeMicros()\n{\n    int64_t now = (boost::posix_time::microsec_clock::universal_time() -\n                   boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_microseconds();\n    assert(now > 0);\n    return now;\n}\n\nint64_t GetSystemTimeInSeconds()\n{\n    return GetTimeMicros()/1000000;\n}\n\nvoid MilliSleep(int64_t n)\n{\n\n/**\n * Boost's sleep_for was uninterruptible when backed by nanosleep from 1.50\n * until fixed in 1.52. Use the deprecated sleep method for the broken case.\n * See: https://svn.boost.org/trac/boost/ticket/7238\n */\n#if defined(HAVE_WORKING_BOOST_SLEEP_FOR)\n    boost::this_thread::sleep_for(boost::chrono::milliseconds(n));\n#elif defined(HAVE_WORKING_BOOST_SLEEP)\n    boost::this_thread::sleep(boost::posix_time::milliseconds(n));\n#else\n//should never get here\n#error missing boost sleep implementation\n#endif\n}\n\nstd::string DateTimeStrFormat(const char* pszFormat, int64_t nTime)\n{\n    static std::locale classic(std::locale::classic());\n    // std::locale takes ownership of the pointer\n    std::locale loc(classic, new boost::posix_time::time_facet(pszFormat));\n    std::stringstream ss;\n    ss.imbue(loc);\n    ss << boost::posix_time::from_time_t(nTime);\n    return ss.str();\n}\n"
  },
  {
    "path": "src/utiltime.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_UTILTIME_H\n#define BITCOIN_UTILTIME_H\n\n#include <stdint.h>\n#include <string>\n\n/**\n * GetTimeMicros() and GetTimeMillis() both return the system time, but in\n * different units. GetTime() returns the system time in seconds, but also\n * supports mocktime, where the time can be specified by the user, eg for\n * testing (eg with the setmocktime rpc, or -mocktime argument).\n *\n * TODO: Rework these functions to be type-safe (so that we don't inadvertently\n * compare numbers with different units, or compare a mocktime to system time).\n */\n\nint64_t GetTime();\nint64_t GetTimeMillis();\nint64_t GetTimeMicros();\nint64_t GetSystemTimeInSeconds(); // Like GetTime(), but not mockable\nvoid SetMockTime(int64_t nMockTimeIn);\nint64_t GetMockTime();\nvoid MilliSleep(int64_t n);\n\nstd::string DateTimeStrFormat(const char* pszFormat, int64_t nTime);\n\n#endif // BITCOIN_UTILTIME_H\n"
  },
  {
    "path": "src/validation.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Copyright (c) 2013-2019 Alexander Peslyak - Yespower 1.0.1\n// Copyright (c) 2018-2020 The Sugarchain Yumekawa developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <validation.h>\n\n#include <arith_uint256.h>\n#include <chain.h>\n#include <chainparams.h>\n#include <checkpoints.h>\n#include <checkqueue.h>\n#include <consensus/consensus.h>\n#include <consensus/merkle.h>\n#include <consensus/tx_verify.h>\n#include <consensus/validation.h>\n#include <cuckoocache.h>\n#include <hash.h>\n#include <init.h>\n#include <policy/fees.h>\n#include <policy/policy.h>\n#include <policy/rbf.h>\n#include <pow.h>\n#include <primitives/block.h>\n#include <primitives/transaction.h>\n#include <random.h>\n#include <reverse_iterator.h>\n#include <script/script.h>\n#include <script/sigcache.h>\n#include <script/standard.h>\n#include <timedata.h>\n#include <tinyformat.h>\n#include <txdb.h>\n#include <txmempool.h>\n#include <ui_interface.h>\n#include <undo.h>\n#include <util.h>\n#include <utilmoneystr.h>\n#include <utilstrencodings.h>\n#include <validationinterface.h>\n#include <warnings.h>\n\n#include <future>\n#include <sstream>\n\n#include <boost/algorithm/string/replace.hpp>\n#include <boost/algorithm/string/join.hpp>\n#include <boost/thread.hpp>\n\n#if defined(NDEBUG)\n# error \"Sugarchain cannot be compiled without assertions.\"\n#endif\n\n#define MICRO 0.000001\n#define MILLI 0.001\n\n/**\n * Global state\n */\nnamespace {\n    struct CBlockIndexWorkComparator\n    {\n        bool operator()(const CBlockIndex *pa, const CBlockIndex *pb) const {\n            // First sort by most total work, ...\n            if (pa->nChainWork > pb->nChainWork) return false;\n            if (pa->nChainWork < pb->nChainWork) return true;\n\n            // ... then by earliest time received, ...\n            if (pa->nSequenceId < pb->nSequenceId) return false;\n            if (pa->nSequenceId > pb->nSequenceId) return true;\n\n            // Use pointer address as tie breaker (should only happen with blocks\n            // loaded from disk, as those all have id 0).\n            if (pa < pb) return false;\n            if (pa > pb) return true;\n\n            // Identical blocks.\n            return false;\n        }\n    };\n} // anon namespace\n\nenum DisconnectResult\n{\n    DISCONNECT_OK,      // All good.\n    DISCONNECT_UNCLEAN, // Rolled back, but UTXO set was inconsistent with block.\n    DISCONNECT_FAILED   // Something else went wrong.\n};\n\nclass ConnectTrace;\n\n/**\n * CChainState stores and provides an API to update our local knowledge of the\n * current best chain and header tree.\n *\n * It generally provides access to the current block tree, as well as functions\n * to provide new data, which it will appropriately validate and incorporate in\n * its state as necessary.\n *\n * Eventually, the API here is targeted at being exposed externally as a\n * consumable libconsensus library, so any functions added must only call\n * other class member functions, pure functions in other parts of the consensus\n * library, callbacks via the validation interface, or read/write-to-disk\n * functions (eventually this will also be via callbacks).\n */\nclass CChainState {\nprivate:\n    /**\n     * The set of all CBlockIndex entries with BLOCK_VALID_TRANSACTIONS (for itself and all ancestors) and\n     * as good as our current tip or better. Entries may be failed, though, and pruning nodes may be\n     * missing the data for the block.\n     */\n    std::set<CBlockIndex*, CBlockIndexWorkComparator> setBlockIndexCandidates;\n\n    /**\n     * Every received block is assigned a unique and increasing identifier, so we\n     * know which one to give priority in case of a fork.\n     */\n    CCriticalSection cs_nBlockSequenceId;\n    /** Blocks loaded from disk are assigned id 0, so start the counter at 1. */\n    int32_t nBlockSequenceId = 1;\n    /** Decreasing counter (used by subsequent preciousblock calls). */\n    int32_t nBlockReverseSequenceId = -1;\n    /** chainwork for the last block that preciousblock has been applied to. */\n    arith_uint256 nLastPreciousChainwork = 0;\n\n    /** In order to efficiently track invalidity of headers, we keep the set of\n      * blocks which we tried to connect and found to be invalid here (ie which\n      * were set to BLOCK_FAILED_VALID since the last restart). We can then\n      * walk this set and check if a new header is a descendant of something in\n      * this set, preventing us from having to walk mapBlockIndex when we try\n      * to connect a bad block and fail.\n      *\n      * While this is more complicated than marking everything which descends\n      * from an invalid block as invalid at the time we discover it to be\n      * invalid, doing so would require walking all of mapBlockIndex to find all\n      * descendants. Since this case should be very rare, keeping track of all\n      * BLOCK_FAILED_VALID blocks in a set should be just fine and work just as\n      * well.\n      *\n      * Because we already walk mapBlockIndex in height-order at startup, we go\n      * ahead and mark descendants of invalid blocks as FAILED_CHILD at that time,\n      * instead of putting things in this set.\n      */\n    std::set<CBlockIndex*> g_failed_blocks;\n\n    /**\n     * the ChainState CriticalSection\n     * A lock that must be held when modifying this ChainState - held in ActivateBestChain()\n     */\n    CCriticalSection m_cs_chainstate;\n\npublic:\n    CChain chainActive;\n    BlockMap mapBlockIndex;\n    std::multimap<CBlockIndex*, CBlockIndex*> mapBlocksUnlinked;\n    CBlockIndex *pindexBestInvalid = nullptr;\n\n    bool LoadBlockIndex(const Consensus::Params& consensus_params, CBlockTreeDB& blocktree);\n\n    bool ActivateBestChain(CValidationState &state, const CChainParams& chainparams, std::shared_ptr<const CBlock> pblock);\n\n    bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, const CChainParams& chainparams, CBlockIndex** ppindex);\n    bool AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CValidationState& state, const CChainParams& chainparams, CBlockIndex** ppindex, bool fRequested, const CDiskBlockPos* dbp, bool* fNewBlock);\n\n    // Block (dis)connection on a given view:\n    DisconnectResult DisconnectBlock(const CBlock& block, const CBlockIndex* pindex, CCoinsViewCache& view);\n    bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex,\n                    CCoinsViewCache& view, const CChainParams& chainparams, bool fJustCheck = false);\n\n    // Block disconnection on our pcoinsTip:\n    bool DisconnectTip(CValidationState& state, const CChainParams& chainparams, DisconnectedBlockTransactions *disconnectpool);\n\n    // Manual block validity manipulation:\n    bool PreciousBlock(CValidationState& state, const CChainParams& params, CBlockIndex *pindex);\n    bool InvalidateBlock(CValidationState& state, const CChainParams& chainparams, CBlockIndex *pindex);\n    bool ResetBlockFailureFlags(CBlockIndex *pindex);\n\n    bool ReplayBlocks(const CChainParams& params, CCoinsView* view);\n    bool RewindBlockIndex(const CChainParams& params);\n    bool LoadGenesisBlock(const CChainParams& chainparams);\n\n    void PruneBlockIndexCandidates();\n\n    void UnloadBlockIndex();\n\nprivate:\n    bool ActivateBestChainStep(CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexMostWork, const std::shared_ptr<const CBlock>& pblock, bool& fInvalidFound, ConnectTrace& connectTrace);\n    bool ConnectTip(CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexNew, const std::shared_ptr<const CBlock>& pblock, ConnectTrace& connectTrace, DisconnectedBlockTransactions &disconnectpool);\n\n    CBlockIndex* AddToBlockIndex(const CBlockHeader& block);\n    /** Create a new block index entry for a given block hash */\n    CBlockIndex * InsertBlockIndex(const uint256& hash);\n    void CheckBlockIndex(const Consensus::Params& consensusParams);\n\n    void InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state);\n    CBlockIndex* FindMostWorkChain();\n    bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBlockIndex *pindexNew, const CDiskBlockPos& pos, const Consensus::Params& consensusParams);\n\n\n    bool RollforwardBlock(const CBlockIndex* pindex, CCoinsViewCache& inputs, const CChainParams& params);\n} g_chainstate;\n\n\n\nCCriticalSection cs_main;\n\nBlockMap& mapBlockIndex = g_chainstate.mapBlockIndex;\nCChain& chainActive = g_chainstate.chainActive;\nCBlockIndex *pindexBestHeader = nullptr;\nCWaitableCriticalSection csBestBlock;\nCConditionVariable cvBlockChange;\nuint256 hashBestBlock;\nint nScriptCheckThreads = 0;\nstd::atomic_bool fImporting(false);\nstd::atomic_bool fReindex(false);\nbool fTxIndex = false;\nbool fHavePruned = false;\nbool fPruneMode = false;\nbool fIsBareMultisigStd = DEFAULT_PERMIT_BAREMULTISIG;\nbool fRequireStandard = true;\nbool fCheckBlockIndex = false;\nbool fCheckpointsEnabled = DEFAULT_CHECKPOINTS_ENABLED;\nsize_t nCoinCacheUsage = 5000 * 300;\nuint64_t nPruneTarget = 0;\nint64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;\nbool fEnableReplacement = DEFAULT_ENABLE_REPLACEMENT;\n\nuint256 hashAssumeValid;\narith_uint256 nMinimumChainWork;\n\nCFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE);\nCAmount maxTxFee = DEFAULT_TRANSACTION_MAXFEE;\n\nCBlockPolicyEstimator feeEstimator;\nCTxMemPool mempool(&feeEstimator);\n\n/** Constant stuff for coinbase transactions we create: */\nCScript COINBASE_FLAGS;\n\nconst std::string strMessageMagic = \"Sugarchain Signed Message:\\n\";\n\n// Internal stuff\nnamespace {\n    CBlockIndex *&pindexBestInvalid = g_chainstate.pindexBestInvalid;\n\n    /** All pairs A->B, where A (or one of its ancestors) misses transactions, but B has transactions.\n     * Pruned nodes may have entries where B is missing data.\n     */\n    std::multimap<CBlockIndex*, CBlockIndex*>& mapBlocksUnlinked = g_chainstate.mapBlocksUnlinked;\n\n    CCriticalSection cs_LastBlockFile;\n    std::vector<CBlockFileInfo> vinfoBlockFile;\n    int nLastBlockFile = 0;\n    /** Global flag to indicate we should check to see if there are\n     *  block/undo files that should be deleted.  Set on startup\n     *  or if we allocate more file space when we're in prune mode\n     */\n    bool fCheckForPruning = false;\n\n    /** Dirty block index entries. */\n    std::set<CBlockIndex*> setDirtyBlockIndex;\n\n    /** Dirty block file entries. */\n    std::set<int> setDirtyFileInfo;\n} // anon namespace\n\nCBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator)\n{\n    // Find the first block the caller has in the main chain\n    for (const uint256& hash : locator.vHave) {\n        BlockMap::iterator mi = mapBlockIndex.find(hash);\n        if (mi != mapBlockIndex.end())\n        {\n            CBlockIndex* pindex = (*mi).second;\n            if (chain.Contains(pindex))\n                return pindex;\n            if (pindex->GetAncestor(chain.Height()) == chain.Tip()) {\n                return chain.Tip();\n            }\n        }\n    }\n    return chain.Genesis();\n}\n\nstd::unique_ptr<CCoinsViewDB> pcoinsdbview;\nstd::unique_ptr<CCoinsViewCache> pcoinsTip;\nstd::unique_ptr<CBlockTreeDB> pblocktree;\n\nenum FlushStateMode {\n    FLUSH_STATE_NONE,\n    FLUSH_STATE_IF_NEEDED,\n    FLUSH_STATE_PERIODIC,\n    FLUSH_STATE_ALWAYS\n};\n\n// See definition for documentation\nstatic bool FlushStateToDisk(const CChainParams& chainParams, CValidationState &state, FlushStateMode mode, int nManualPruneHeight=0);\nstatic void FindFilesToPruneManual(std::set<int>& setFilesToPrune, int nManualPruneHeight);\nstatic void FindFilesToPrune(std::set<int>& setFilesToPrune, uint64_t nPruneAfterHeight);\nbool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck> *pvChecks = nullptr);\nstatic FILE* OpenUndoFile(const CDiskBlockPos &pos, bool fReadOnly = false);\n\nbool CheckFinalTx(const CTransaction &tx, int flags)\n{\n    AssertLockHeld(cs_main);\n\n    // By convention a negative value for flags indicates that the\n    // current network-enforced consensus rules should be used. In\n    // a future soft-fork scenario that would mean checking which\n    // rules would be enforced for the next block and setting the\n    // appropriate flags. At the present time no soft-forks are\n    // scheduled, so no flags are set.\n    flags = std::max(flags, 0);\n\n    // CheckFinalTx() uses chainActive.Height()+1 to evaluate\n    // nLockTime because when IsFinalTx() is called within\n    // CBlock::AcceptBlock(), the height of the block *being*\n    // evaluated is what is used. Thus if we want to know if a\n    // transaction can be part of the *next* block, we need to call\n    // IsFinalTx() with one more than chainActive.Height().\n    const int nBlockHeight = chainActive.Height() + 1;\n\n    // BIP113 requires that time-locked transactions have nLockTime set to\n    // less than the median time of the previous block they're contained in.\n    // When the next block is created its previous block will be the current\n    // chain tip, so we use that to calculate the median time passed to\n    // IsFinalTx() if LOCKTIME_MEDIAN_TIME_PAST is set.\n    const int64_t nBlockTime = (flags & LOCKTIME_MEDIAN_TIME_PAST)\n                             ? chainActive.Tip()->GetMedianTimePast()\n                             : GetAdjustedTime();\n\n    return IsFinalTx(tx, nBlockHeight, nBlockTime);\n}\n\nbool TestLockPointValidity(const LockPoints* lp)\n{\n    AssertLockHeld(cs_main);\n    assert(lp);\n    // If there are relative lock times then the maxInputBlock will be set\n    // If there are no relative lock times, the LockPoints don't depend on the chain\n    if (lp->maxInputBlock) {\n        // Check whether chainActive is an extension of the block at which the LockPoints\n        // calculation was valid.  If not LockPoints are no longer valid\n        if (!chainActive.Contains(lp->maxInputBlock)) {\n            return false;\n        }\n    }\n\n    // LockPoints still valid\n    return true;\n}\n\nbool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints* lp, bool useExistingLockPoints)\n{\n    AssertLockHeld(cs_main);\n    AssertLockHeld(mempool.cs);\n\n    CBlockIndex* tip = chainActive.Tip();\n    assert(tip != nullptr);\n\n    CBlockIndex index;\n    index.pprev = tip;\n    // CheckSequenceLocks() uses chainActive.Height()+1 to evaluate\n    // height based locks because when SequenceLocks() is called within\n    // ConnectBlock(), the height of the block *being*\n    // evaluated is what is used.\n    // Thus if we want to know if a transaction can be part of the\n    // *next* block, we need to use one more than chainActive.Height()\n    index.nHeight = tip->nHeight + 1;\n\n    std::pair<int, int64_t> lockPair;\n    if (useExistingLockPoints) {\n        assert(lp);\n        lockPair.first = lp->height;\n        lockPair.second = lp->time;\n    }\n    else {\n        // pcoinsTip contains the UTXO set for chainActive.Tip()\n        CCoinsViewMemPool viewMemPool(pcoinsTip.get(), mempool);\n        std::vector<int> prevheights;\n        prevheights.resize(tx.vin.size());\n        for (size_t txinIndex = 0; txinIndex < tx.vin.size(); txinIndex++) {\n            const CTxIn& txin = tx.vin[txinIndex];\n            Coin coin;\n            if (!viewMemPool.GetCoin(txin.prevout, coin)) {\n                return error(\"%s: Missing input\", __func__);\n            }\n            if (coin.nHeight == MEMPOOL_HEIGHT) {\n                // Assume all mempool transaction confirm in the next block\n                prevheights[txinIndex] = tip->nHeight + 1;\n            } else {\n                prevheights[txinIndex] = coin.nHeight;\n            }\n        }\n        lockPair = CalculateSequenceLocks(tx, flags, &prevheights, index);\n        if (lp) {\n            lp->height = lockPair.first;\n            lp->time = lockPair.second;\n            // Also store the hash of the block with the highest height of\n            // all the blocks which have sequence locked prevouts.\n            // This hash needs to still be on the chain\n            // for these LockPoint calculations to be valid\n            // Note: It is impossible to correctly calculate a maxInputBlock\n            // if any of the sequence locked inputs depend on unconfirmed txs,\n            // except in the special case where the relative lock time/height\n            // is 0, which is equivalent to no sequence lock. Since we assume\n            // input height of tip+1 for mempool txs and test the resulting\n            // lockPair from CalculateSequenceLocks against tip+1.  We know\n            // EvaluateSequenceLocks will fail if there was a non-zero sequence\n            // lock on a mempool input, so we can use the return value of\n            // CheckSequenceLocks to indicate the LockPoints validity\n            int maxInputHeight = 0;\n            for (int height : prevheights) {\n                // Can ignore mempool inputs since we'll fail if they had non-zero locks\n                if (height != tip->nHeight+1) {\n                    maxInputHeight = std::max(maxInputHeight, height);\n                }\n            }\n            lp->maxInputBlock = tip->GetAncestor(maxInputHeight);\n        }\n    }\n    return EvaluateSequenceLocks(index, lockPair);\n}\n\n// Returns the script flags which should be checked for a given block\nstatic unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consensus::Params& chainparams);\n\nstatic void LimitMempoolSize(CTxMemPool& pool, size_t limit, unsigned long age) {\n    int expired = pool.Expire(GetTime() - age);\n    if (expired != 0) {\n        LogPrint(BCLog::MEMPOOL, \"Expired %i transactions from the memory pool\\n\", expired);\n    }\n\n    std::vector<COutPoint> vNoSpendsRemaining;\n    pool.TrimToSize(limit, &vNoSpendsRemaining);\n    for (const COutPoint& removed : vNoSpendsRemaining)\n        pcoinsTip->Uncache(removed);\n}\n\n/** Convert CValidationState to a human-readable message for logging */\nstd::string FormatStateMessage(const CValidationState &state)\n{\n    return strprintf(\"%s%s (code %i)\",\n        state.GetRejectReason(),\n        state.GetDebugMessage().empty() ? \"\" : \", \"+state.GetDebugMessage(),\n        state.GetRejectCode());\n}\n\nstatic bool IsCurrentForFeeEstimation()\n{\n    AssertLockHeld(cs_main);\n    if (IsInitialBlockDownload())\n        return false;\n    if (chainActive.Tip()->GetBlockTime() < (GetTime() - MAX_FEE_ESTIMATION_TIP_AGE))\n        return false;\n    if (chainActive.Height() < pindexBestHeader->nHeight - 1)\n        return false;\n    return true;\n}\n\n/* Make mempool consistent after a reorg, by re-adding or recursively erasing\n * disconnected block transactions from the mempool, and also removing any\n * other transactions from the mempool that are no longer valid given the new\n * tip/height.\n *\n * Note: we assume that disconnectpool only contains transactions that are NOT\n * confirmed in the current chain nor already in the mempool (otherwise,\n * in-mempool descendants of such transactions would be removed).\n *\n * Passing fAddToMempool=false will skip trying to add the transactions back,\n * and instead just erase from the mempool as needed.\n */\n\nvoid UpdateMempoolForReorg(DisconnectedBlockTransactions &disconnectpool, bool fAddToMempool)\n{\n    AssertLockHeld(cs_main);\n    std::vector<uint256> vHashUpdate;\n    // disconnectpool's insertion_order index sorts the entries from\n    // oldest to newest, but the oldest entry will be the last tx from the\n    // latest mined block that was disconnected.\n    // Iterate disconnectpool in reverse, so that we add transactions\n    // back to the mempool starting with the earliest transaction that had\n    // been previously seen in a block.\n    auto it = disconnectpool.queuedTx.get<insertion_order>().rbegin();\n    while (it != disconnectpool.queuedTx.get<insertion_order>().rend()) {\n        // ignore validation errors in resurrected transactions\n        CValidationState stateDummy;\n        if (!fAddToMempool || (*it)->IsCoinBase() ||\n            !AcceptToMemoryPool(mempool, stateDummy, *it, nullptr /* pfMissingInputs */,\n                                nullptr /* plTxnReplaced */, true /* bypass_limits */, 0 /* nAbsurdFee */)) {\n            // If the transaction doesn't make it in to the mempool, remove any\n            // transactions that depend on it (which would now be orphans).\n            mempool.removeRecursive(**it, MemPoolRemovalReason::REORG);\n        } else if (mempool.exists((*it)->GetHash())) {\n            vHashUpdate.push_back((*it)->GetHash());\n        }\n        ++it;\n    }\n    disconnectpool.queuedTx.clear();\n    // AcceptToMemoryPool/addUnchecked all assume that new mempool entries have\n    // no in-mempool children, which is generally not true when adding\n    // previously-confirmed transactions back to the mempool.\n    // UpdateTransactionsFromBlock finds descendants of any transactions in\n    // the disconnectpool that were added back and cleans up the mempool state.\n    mempool.UpdateTransactionsFromBlock(vHashUpdate);\n\n    // We also need to remove any now-immature transactions\n    mempool.removeForReorg(pcoinsTip.get(), chainActive.Tip()->nHeight + 1, STANDARD_LOCKTIME_VERIFY_FLAGS);\n    // Re-limit mempool size, in case we added any transactions\n    LimitMempoolSize(mempool, gArgs.GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, gArgs.GetArg(\"-mempoolexpiry\", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60);\n}\n\n// Used to avoid mempool polluting consensus critical paths if CCoinsViewMempool\n// were somehow broken and returning the wrong scriptPubKeys\nstatic bool CheckInputsFromMempoolAndCache(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &view, CTxMemPool& pool,\n                 unsigned int flags, bool cacheSigStore, PrecomputedTransactionData& txdata) {\n    AssertLockHeld(cs_main);\n\n    // pool.cs should be locked already, but go ahead and re-take the lock here\n    // to enforce that mempool doesn't change between when we check the view\n    // and when we actually call through to CheckInputs\n    LOCK(pool.cs);\n\n    assert(!tx.IsCoinBase());\n    for (const CTxIn& txin : tx.vin) {\n        const Coin& coin = view.AccessCoin(txin.prevout);\n\n        // At this point we haven't actually checked if the coins are all\n        // available (or shouldn't assume we have, since CheckInputs does).\n        // So we just return failure if the inputs are not available here,\n        // and then only have to check equivalence for available inputs.\n        if (coin.IsSpent()) return false;\n\n        const CTransactionRef& txFrom = pool.get(txin.prevout.hash);\n        if (txFrom) {\n            assert(txFrom->GetHash() == txin.prevout.hash);\n            assert(txFrom->vout.size() > txin.prevout.n);\n            assert(txFrom->vout[txin.prevout.n] == coin.out);\n        } else {\n            const Coin& coinFromDisk = pcoinsTip->AccessCoin(txin.prevout);\n            assert(!coinFromDisk.IsSpent());\n            assert(coinFromDisk.out == coin.out);\n        }\n    }\n\n    return CheckInputs(tx, state, view, true, flags, cacheSigStore, true, txdata);\n}\n\nstatic bool AcceptToMemoryPoolWorker(const CChainParams& chainparams, CTxMemPool& pool, CValidationState& state, const CTransactionRef& ptx,\n                              bool* pfMissingInputs, int64_t nAcceptTime, std::list<CTransactionRef>* plTxnReplaced,\n                              bool bypass_limits, const CAmount& nAbsurdFee, std::vector<COutPoint>& coins_to_uncache)\n{\n    const CTransaction& tx = *ptx;\n    const uint256 hash = tx.GetHash();\n    AssertLockHeld(cs_main);\n    LOCK(pool.cs); // mempool \"read lock\" (held through GetMainSignals().TransactionAddedToMempool())\n    if (pfMissingInputs) {\n        *pfMissingInputs = false;\n    }\n\n    if (!CheckTransaction(tx, state))\n        return false; // state filled in by CheckTransaction\n\n    // Coinbase is only valid in a block, not as a loose transaction\n    if (tx.IsCoinBase())\n        return state.DoS(100, false, REJECT_INVALID, \"coinbase\");\n\n    // Reject transactions with witness before segregated witness activates (override with -prematurewitness)\n    bool witnessEnabled = IsWitnessEnabled(chainActive.Tip(), chainparams.GetConsensus());\n    if (!gArgs.GetBoolArg(\"-prematurewitness\", false) && tx.HasWitness() && !witnessEnabled) {\n        return state.DoS(0, false, REJECT_NONSTANDARD, \"no-witness-yet\", true);\n    }\n\n    // Rather not work on nonstandard transactions (unless -testnet/-regtest)\n    std::string reason;\n    if (fRequireStandard && !IsStandardTx(tx, reason, witnessEnabled))\n        return state.DoS(0, false, REJECT_NONSTANDARD, reason);\n\n    // Do not work on transactions that are too small.\n    // A transaction with 1 segwit input and 1 P2WPHK output has non-witness size of 82 bytes.\n    // Transactions smaller than this are not relayed to reduce unnecessary malloc overhead.\n    if (::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) < MIN_STANDARD_TX_NONWITNESS_SIZE)\n        return state.DoS(0, false, REJECT_NONSTANDARD, \"tx-size-small\");\n\n    // Only accept nLockTime-using transactions that can be mined in the next\n    // block; we don't want our mempool filled up with transactions that can't\n    // be mined yet.\n    if (!CheckFinalTx(tx, STANDARD_LOCKTIME_VERIFY_FLAGS))\n        return state.DoS(0, false, REJECT_NONSTANDARD, \"non-final\");\n\n    // is it already in the memory pool?\n    if (pool.exists(hash)) {\n        return state.Invalid(false, REJECT_DUPLICATE, \"txn-already-in-mempool\");\n    }\n\n    // Check for conflicts with in-memory transactions\n    std::set<uint256> setConflicts;\n    for (const CTxIn &txin : tx.vin)\n    {\n        auto itConflicting = pool.mapNextTx.find(txin.prevout);\n        if (itConflicting != pool.mapNextTx.end())\n        {\n            const CTransaction *ptxConflicting = itConflicting->second;\n            if (!setConflicts.count(ptxConflicting->GetHash()))\n            {\n                // Allow opt-out of transaction replacement by setting\n                // nSequence > MAX_BIP125_RBF_SEQUENCE (SEQUENCE_FINAL-2) on all inputs.\n                //\n                // SEQUENCE_FINAL-1 is picked to still allow use of nLockTime by\n                // non-replaceable transactions. All inputs rather than just one\n                // is for the sake of multi-party protocols, where we don't\n                // want a single party to be able to disable replacement.\n                //\n                // The opt-out ignores descendants as anyone relying on\n                // first-seen mempool behavior should be checking all\n                // unconfirmed ancestors anyway; doing otherwise is hopelessly\n                // insecure.\n                bool fReplacementOptOut = true;\n                if (fEnableReplacement)\n                {\n                    for (const CTxIn &_txin : ptxConflicting->vin)\n                    {\n                        if (_txin.nSequence <= MAX_BIP125_RBF_SEQUENCE)\n                        {\n                            fReplacementOptOut = false;\n                            break;\n                        }\n                    }\n                }\n                if (fReplacementOptOut) {\n                    return state.Invalid(false, REJECT_DUPLICATE, \"txn-mempool-conflict\");\n                }\n\n                setConflicts.insert(ptxConflicting->GetHash());\n            }\n        }\n    }\n\n    {\n        CCoinsView dummy;\n        CCoinsViewCache view(&dummy);\n\n        LockPoints lp;\n        CCoinsViewMemPool viewMemPool(pcoinsTip.get(), pool);\n        view.SetBackend(viewMemPool);\n\n        // do all inputs exist?\n        for (const CTxIn txin : tx.vin) {\n            if (!pcoinsTip->HaveCoinInCache(txin.prevout)) {\n                coins_to_uncache.push_back(txin.prevout);\n            }\n            if (!view.HaveCoin(txin.prevout)) {\n                // Are inputs missing because we already have the tx?\n                for (size_t out = 0; out < tx.vout.size(); out++) {\n                    // Optimistically just do efficient check of cache for outputs\n                    if (pcoinsTip->HaveCoinInCache(COutPoint(hash, out))) {\n                        return state.Invalid(false, REJECT_DUPLICATE, \"txn-already-known\");\n                    }\n                }\n                // Otherwise assume this might be an orphan tx for which we just haven't seen parents yet\n                if (pfMissingInputs) {\n                    *pfMissingInputs = true;\n                }\n                return false; // fMissingInputs and !state.IsInvalid() is used to detect this condition, don't set state.Invalid()\n            }\n        }\n\n        // Bring the best block into scope\n        view.GetBestBlock();\n\n        // we have all inputs cached now, so switch back to dummy, so we don't need to keep lock on mempool\n        view.SetBackend(dummy);\n\n        // Only accept BIP68 sequence locked transactions that can be mined in the next\n        // block; we don't want our mempool filled up with transactions that can't\n        // be mined yet.\n        // Must keep pool.cs for this unless we change CheckSequenceLocks to take a\n        // CoinsViewCache instead of create its own\n        if (!CheckSequenceLocks(tx, STANDARD_LOCKTIME_VERIFY_FLAGS, &lp))\n            return state.DoS(0, false, REJECT_NONSTANDARD, \"non-BIP68-final\");\n\n        CAmount nFees = 0;\n        if (!Consensus::CheckTxInputs(tx, state, view, GetSpendHeight(view), nFees)) {\n            return error(\"%s: Consensus::CheckTxInputs: %s, %s\", __func__, tx.GetHash().ToString(), FormatStateMessage(state));\n        }\n\n        // Check for non-standard pay-to-script-hash in inputs\n        if (fRequireStandard && !AreInputsStandard(tx, view))\n            return state.Invalid(false, REJECT_NONSTANDARD, \"bad-txns-nonstandard-inputs\");\n\n        // Check for non-standard witness in P2WSH\n        if (tx.HasWitness() && fRequireStandard && !IsWitnessStandard(tx, view))\n            return state.DoS(0, false, REJECT_NONSTANDARD, \"bad-witness-nonstandard\", true);\n\n        int64_t nSigOpsCost = GetTransactionSigOpCost(tx, view, STANDARD_SCRIPT_VERIFY_FLAGS);\n\n        // nModifiedFees includes any fee deltas from PrioritiseTransaction\n        CAmount nModifiedFees = nFees;\n        pool.ApplyDelta(hash, nModifiedFees);\n\n        // Keep track of transactions that spend a coinbase, which we re-scan\n        // during reorgs to ensure COINBASE_MATURITY is still met.\n        bool fSpendsCoinbase = false;\n        for (const CTxIn &txin : tx.vin) {\n            const Coin &coin = view.AccessCoin(txin.prevout);\n            if (coin.IsCoinBase()) {\n                fSpendsCoinbase = true;\n                break;\n            }\n        }\n\n        CTxMemPoolEntry entry(ptx, nFees, nAcceptTime, chainActive.Height(),\n                              fSpendsCoinbase, nSigOpsCost, lp);\n        unsigned int nSize = entry.GetTxSize();\n\n        // Check that the transaction doesn't have an excessive number of\n        // sigops, making it impossible to mine. Since the coinbase transaction\n        // itself can contain sigops MAX_STANDARD_TX_SIGOPS is less than\n        // MAX_BLOCK_SIGOPS; we still consider this an invalid rather than\n        // merely non-standard transaction.\n        if (nSigOpsCost > MAX_STANDARD_TX_SIGOPS_COST)\n            return state.DoS(0, false, REJECT_NONSTANDARD, \"bad-txns-too-many-sigops\", false,\n                strprintf(\"%d\", nSigOpsCost));\n\n        CAmount mempoolRejectFee = pool.GetMinFee(gArgs.GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFee(nSize);\n        if (!bypass_limits && mempoolRejectFee > 0 && nModifiedFees < mempoolRejectFee) {\n            return state.DoS(0, false, REJECT_INSUFFICIENTFEE, \"mempool min fee not met\", false, strprintf(\"%d < %d\", nFees, mempoolRejectFee));\n        }\n\n        // No transactions are allowed below minRelayTxFee except from disconnected blocks\n        if (!bypass_limits && nModifiedFees < ::minRelayTxFee.GetFee(nSize)) {\n            return state.DoS(0, false, REJECT_INSUFFICIENTFEE, \"min relay fee not met\");\n        }\n\n        if (nAbsurdFee && nFees > nAbsurdFee)\n            return state.Invalid(false,\n                REJECT_HIGHFEE, \"absurdly-high-fee\",\n                strprintf(\"%d > %d\", nFees, nAbsurdFee));\n\n        // Calculate in-mempool ancestors, up to a limit.\n        CTxMemPool::setEntries setAncestors;\n        size_t nLimitAncestors = gArgs.GetArg(\"-limitancestorcount\", DEFAULT_ANCESTOR_LIMIT);\n        size_t nLimitAncestorSize = gArgs.GetArg(\"-limitancestorsize\", DEFAULT_ANCESTOR_SIZE_LIMIT)*1000;\n        size_t nLimitDescendants = gArgs.GetArg(\"-limitdescendantcount\", DEFAULT_DESCENDANT_LIMIT);\n        size_t nLimitDescendantSize = gArgs.GetArg(\"-limitdescendantsize\", DEFAULT_DESCENDANT_SIZE_LIMIT)*1000;\n        std::string errString;\n        if (!pool.CalculateMemPoolAncestors(entry, setAncestors, nLimitAncestors, nLimitAncestorSize, nLimitDescendants, nLimitDescendantSize, errString)) {\n            return state.DoS(0, false, REJECT_NONSTANDARD, \"too-long-mempool-chain\", false, errString);\n        }\n\n        // A transaction that spends outputs that would be replaced by it is invalid. Now\n        // that we have the set of all ancestors we can detect this\n        // pathological case by making sure setConflicts and setAncestors don't\n        // intersect.\n        for (CTxMemPool::txiter ancestorIt : setAncestors)\n        {\n            const uint256 &hashAncestor = ancestorIt->GetTx().GetHash();\n            if (setConflicts.count(hashAncestor))\n            {\n                return state.DoS(10, false,\n                                 REJECT_INVALID, \"bad-txns-spends-conflicting-tx\", false,\n                                 strprintf(\"%s spends conflicting transaction %s\",\n                                           hash.ToString(),\n                                           hashAncestor.ToString()));\n            }\n        }\n\n        // Check if it's economically rational to mine this transaction rather\n        // than the ones it replaces.\n        CAmount nConflictingFees = 0;\n        size_t nConflictingSize = 0;\n        uint64_t nConflictingCount = 0;\n        CTxMemPool::setEntries allConflicting;\n\n        // If we don't hold the lock allConflicting might be incomplete; the\n        // subsequent RemoveStaged() and addUnchecked() calls don't guarantee\n        // mempool consistency for us.\n        const bool fReplacementTransaction = setConflicts.size();\n        if (fReplacementTransaction)\n        {\n            CFeeRate newFeeRate(nModifiedFees, nSize);\n            std::set<uint256> setConflictsParents;\n            const int maxDescendantsToVisit = 100;\n            CTxMemPool::setEntries setIterConflicting;\n            for (const uint256 &hashConflicting : setConflicts)\n            {\n                CTxMemPool::txiter mi = pool.mapTx.find(hashConflicting);\n                if (mi == pool.mapTx.end())\n                    continue;\n\n                // Save these to avoid repeated lookups\n                setIterConflicting.insert(mi);\n\n                // Don't allow the replacement to reduce the feerate of the\n                // mempool.\n                //\n                // We usually don't want to accept replacements with lower\n                // feerates than what they replaced as that would lower the\n                // feerate of the next block. Requiring that the feerate always\n                // be increased is also an easy-to-reason about way to prevent\n                // DoS attacks via replacements.\n                //\n                // The mining code doesn't (currently) take children into\n                // account (CPFP) so we only consider the feerates of\n                // transactions being directly replaced, not their indirect\n                // descendants. While that does mean high feerate children are\n                // ignored when deciding whether or not to replace, we do\n                // require the replacement to pay more overall fees too,\n                // mitigating most cases.\n                CFeeRate oldFeeRate(mi->GetModifiedFee(), mi->GetTxSize());\n                if (newFeeRate <= oldFeeRate)\n                {\n                    return state.DoS(0, false,\n                            REJECT_INSUFFICIENTFEE, \"insufficient fee\", false,\n                            strprintf(\"rejecting replacement %s; new feerate %s <= old feerate %s\",\n                                  hash.ToString(),\n                                  newFeeRate.ToString(),\n                                  oldFeeRate.ToString()));\n                }\n\n                for (const CTxIn &txin : mi->GetTx().vin)\n                {\n                    setConflictsParents.insert(txin.prevout.hash);\n                }\n\n                nConflictingCount += mi->GetCountWithDescendants();\n            }\n            // This potentially overestimates the number of actual descendants\n            // but we just want to be conservative to avoid doing too much\n            // work.\n            if (nConflictingCount <= maxDescendantsToVisit) {\n                // If not too many to replace, then calculate the set of\n                // transactions that would have to be evicted\n                for (CTxMemPool::txiter it : setIterConflicting) {\n                    pool.CalculateDescendants(it, allConflicting);\n                }\n                for (CTxMemPool::txiter it : allConflicting) {\n                    nConflictingFees += it->GetModifiedFee();\n                    nConflictingSize += it->GetTxSize();\n                }\n            } else {\n                return state.DoS(0, false,\n                        REJECT_NONSTANDARD, \"too many potential replacements\", false,\n                        strprintf(\"rejecting replacement %s; too many potential replacements (%d > %d)\\n\",\n                            hash.ToString(),\n                            nConflictingCount,\n                            maxDescendantsToVisit));\n            }\n\n            for (unsigned int j = 0; j < tx.vin.size(); j++)\n            {\n                // We don't want to accept replacements that require low\n                // feerate junk to be mined first. Ideally we'd keep track of\n                // the ancestor feerates and make the decision based on that,\n                // but for now requiring all new inputs to be confirmed works.\n                if (!setConflictsParents.count(tx.vin[j].prevout.hash))\n                {\n                    // Rather than check the UTXO set - potentially expensive -\n                    // it's cheaper to just check if the new input refers to a\n                    // tx that's in the mempool.\n                    if (pool.mapTx.find(tx.vin[j].prevout.hash) != pool.mapTx.end())\n                        return state.DoS(0, false,\n                                         REJECT_NONSTANDARD, \"replacement-adds-unconfirmed\", false,\n                                         strprintf(\"replacement %s adds unconfirmed input, idx %d\",\n                                                  hash.ToString(), j));\n                }\n            }\n\n            // The replacement must pay greater fees than the transactions it\n            // replaces - if we did the bandwidth used by those conflicting\n            // transactions would not be paid for.\n            if (nModifiedFees < nConflictingFees)\n            {\n                return state.DoS(0, false,\n                                 REJECT_INSUFFICIENTFEE, \"insufficient fee\", false,\n                                 strprintf(\"rejecting replacement %s, less fees than conflicting txs; %s < %s\",\n                                          hash.ToString(), FormatMoney(nModifiedFees), FormatMoney(nConflictingFees)));\n            }\n\n            // Finally in addition to paying more fees than the conflicts the\n            // new transaction must pay for its own bandwidth.\n            CAmount nDeltaFees = nModifiedFees - nConflictingFees;\n            if (nDeltaFees < ::incrementalRelayFee.GetFee(nSize))\n            {\n                return state.DoS(0, false,\n                        REJECT_INSUFFICIENTFEE, \"insufficient fee\", false,\n                        strprintf(\"rejecting replacement %s, not enough additional fees to relay; %s < %s\",\n                              hash.ToString(),\n                              FormatMoney(nDeltaFees),\n                              FormatMoney(::incrementalRelayFee.GetFee(nSize))));\n            }\n        }\n\n        unsigned int scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS;\n        if (!chainparams.RequireStandard()) {\n            scriptVerifyFlags = gArgs.GetArg(\"-promiscuousmempoolflags\", scriptVerifyFlags);\n        }\n\n        // Check against previous transactions\n        // This is done last to help prevent CPU exhaustion denial-of-service attacks.\n        PrecomputedTransactionData txdata(tx);\n        if (!CheckInputs(tx, state, view, true, scriptVerifyFlags, true, false, txdata)) {\n            // SCRIPT_VERIFY_CLEANSTACK requires SCRIPT_VERIFY_WITNESS, so we\n            // need to turn both off, and compare against just turning off CLEANSTACK\n            // to see if the failure is specifically due to witness validation.\n            CValidationState stateDummy; // Want reported failures to be from first CheckInputs\n            if (!tx.HasWitness() && CheckInputs(tx, stateDummy, view, true, scriptVerifyFlags & ~(SCRIPT_VERIFY_WITNESS | SCRIPT_VERIFY_CLEANSTACK), true, false, txdata) &&\n                !CheckInputs(tx, stateDummy, view, true, scriptVerifyFlags & ~SCRIPT_VERIFY_CLEANSTACK, true, false, txdata)) {\n                // Only the witness is missing, so the transaction itself may be fine.\n                state.SetCorruptionPossible();\n            }\n            return false; // state filled in by CheckInputs\n        }\n\n        // Check again against the current block tip's script verification\n        // flags to cache our script execution flags. This is, of course,\n        // useless if the next block has different script flags from the\n        // previous one, but because the cache tracks script flags for us it\n        // will auto-invalidate and we'll just have a few blocks of extra\n        // misses on soft-fork activation.\n        //\n        // This is also useful in case of bugs in the standard flags that cause\n        // transactions to pass as valid when they're actually invalid. For\n        // instance the STRICTENC flag was incorrectly allowing certain\n        // CHECKSIG NOT scripts to pass, even though they were invalid.\n        //\n        // There is a similar check in CreateNewBlock() to prevent creating\n        // invalid blocks (using TestBlockValidity), however allowing such\n        // transactions into the mempool can be exploited as a DoS attack.\n        unsigned int currentBlockScriptVerifyFlags = GetBlockScriptFlags(chainActive.Tip(), Params().GetConsensus());\n        if (!CheckInputsFromMempoolAndCache(tx, state, view, pool, currentBlockScriptVerifyFlags, true, txdata))\n        {\n            // If we're using promiscuousmempoolflags, we may hit this normally\n            // Check if current block has some flags that scriptVerifyFlags\n            // does not before printing an ominous warning\n            if (!(~scriptVerifyFlags & currentBlockScriptVerifyFlags)) {\n                return error(\"%s: BUG! PLEASE REPORT THIS! ConnectInputs failed against latest-block but not STANDARD flags %s, %s\",\n                    __func__, hash.ToString(), FormatStateMessage(state));\n            } else {\n                if (!CheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, false, txdata)) {\n                    return error(\"%s: ConnectInputs failed against MANDATORY but not STANDARD flags due to promiscuous mempool %s, %s\",\n                        __func__, hash.ToString(), FormatStateMessage(state));\n                } else {\n                    LogPrintf(\"Warning: -promiscuousmempool flags set to not include currently enforced soft forks, this may break mining or otherwise cause instability!\\n\");\n                }\n            }\n        }\n\n        // Remove conflicting transactions from the mempool\n        for (const CTxMemPool::txiter it : allConflicting)\n        {\n            LogPrint(BCLog::MEMPOOL, \"replacing tx %s with %s for %s SUGAR additional fees, %d delta bytes\\n\",\n                    it->GetTx().GetHash().ToString(),\n                    hash.ToString(),\n                    FormatMoney(nModifiedFees - nConflictingFees),\n                    (int)nSize - (int)nConflictingSize);\n            if (plTxnReplaced)\n                plTxnReplaced->push_back(it->GetSharedTx());\n        }\n        pool.RemoveStaged(allConflicting, false, MemPoolRemovalReason::REPLACED);\n\n        // This transaction should only count for fee estimation if:\n        // - it isn't a BIP 125 replacement transaction (may not be widely supported)\n        // - it's not being readded during a reorg which bypasses typical mempool fee limits\n        // - the node is not behind\n        // - the transaction is not dependent on any other transactions in the mempool\n        bool validForFeeEstimation = !fReplacementTransaction && !bypass_limits && IsCurrentForFeeEstimation() && pool.HasNoInputsOf(tx);\n\n        // Store transaction in memory\n        pool.addUnchecked(hash, entry, setAncestors, validForFeeEstimation);\n\n        // trim mempool and check if tx was trimmed\n        if (!bypass_limits) {\n            LimitMempoolSize(pool, gArgs.GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, gArgs.GetArg(\"-mempoolexpiry\", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60);\n            if (!pool.exists(hash))\n                return state.DoS(0, false, REJECT_INSUFFICIENTFEE, \"mempool full\");\n        }\n    }\n\n    GetMainSignals().TransactionAddedToMempool(ptx);\n\n    return true;\n}\n\n/** (try to) add transaction to memory pool with a specified acceptance time **/\nstatic bool AcceptToMemoryPoolWithTime(const CChainParams& chainparams, CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx,\n                        bool* pfMissingInputs, int64_t nAcceptTime, std::list<CTransactionRef>* plTxnReplaced,\n                        bool bypass_limits, const CAmount nAbsurdFee)\n{\n    std::vector<COutPoint> coins_to_uncache;\n    bool res = AcceptToMemoryPoolWorker(chainparams, pool, state, tx, pfMissingInputs, nAcceptTime, plTxnReplaced, bypass_limits, nAbsurdFee, coins_to_uncache);\n    if (!res) {\n        for (const COutPoint& hashTx : coins_to_uncache)\n            pcoinsTip->Uncache(hashTx);\n    }\n    // After we've (potentially) uncached entries, ensure our coins cache is still within its size limits\n    CValidationState stateDummy;\n    FlushStateToDisk(chainparams, stateDummy, FLUSH_STATE_PERIODIC);\n    return res;\n}\n\nbool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx,\n                        bool* pfMissingInputs, std::list<CTransactionRef>* plTxnReplaced,\n                        bool bypass_limits, const CAmount nAbsurdFee)\n{\n    const CChainParams& chainparams = Params();\n    return AcceptToMemoryPoolWithTime(chainparams, pool, state, tx, pfMissingInputs, GetTime(), plTxnReplaced, bypass_limits, nAbsurdFee);\n}\n\n/**\n * Return transaction in txOut, and if it was found inside a block, its hash is placed in hashBlock.\n * If blockIndex is provided, the transaction is fetched from the corresponding block.\n */\nbool GetTransaction(const uint256& hash, CTransactionRef& txOut, const Consensus::Params& consensusParams, uint256& hashBlock, bool fAllowSlow, CBlockIndex* blockIndex)\n{\n    CBlockIndex* pindexSlow = blockIndex;\n\n    LOCK(cs_main);\n\n    if (!blockIndex) {\n        CTransactionRef ptx = mempool.get(hash);\n        if (ptx) {\n            txOut = ptx;\n            return true;\n        }\n\n        if (fTxIndex) {\n            CDiskTxPos postx;\n            if (pblocktree->ReadTxIndex(hash, postx)) {\n                CAutoFile file(OpenBlockFile(postx, true), SER_DISK, CLIENT_VERSION);\n                if (file.IsNull())\n                    return error(\"%s: OpenBlockFile failed\", __func__);\n                CBlockHeader header;\n                try {\n                    file >> header;\n                    fseek(file.Get(), postx.nTxOffset, SEEK_CUR);\n                    file >> txOut;\n                } catch (const std::exception& e) {\n                    return error(\"%s: Deserialize or I/O error - %s\", __func__, e.what());\n                }\n                hashBlock = header.GetHash();\n                if (txOut->GetHash() != hash)\n                    return error(\"%s: txid mismatch\", __func__);\n                return true;\n            }\n\n            // transaction not found in index, nothing more can be done\n            return false;\n        }\n\n        if (fAllowSlow) { // use coin database to locate block that contains transaction, and scan it\n            const Coin& coin = AccessByTxid(*pcoinsTip, hash);\n            if (!coin.IsSpent()) pindexSlow = chainActive[coin.nHeight];\n        }\n    }\n\n    if (pindexSlow) {\n        CBlock block;\n        if (ReadBlockFromDisk(block, pindexSlow, consensusParams)) {\n            for (const auto& tx : block.vtx) {\n                if (tx->GetHash() == hash) {\n                    txOut = tx;\n                    hashBlock = pindexSlow->GetBlockHash();\n                    return true;\n                }\n            }\n        }\n    }\n\n    return false;\n}\n\n\n\n\n\n\n//////////////////////////////////////////////////////////////////////////////\n//\n// CBlock and CBlockIndex\n//\n\nstatic bool WriteBlockToDisk(const CBlock& block, CDiskBlockPos& pos, const CMessageHeader::MessageStartChars& messageStart)\n{\n    // Open history file to append\n    CAutoFile fileout(OpenBlockFile(pos), SER_DISK, CLIENT_VERSION);\n    if (fileout.IsNull())\n        return error(\"WriteBlockToDisk: OpenBlockFile failed\");\n\n    // Write index header\n    unsigned int nSize = GetSerializeSize(fileout, block);\n    fileout << FLATDATA(messageStart) << nSize;\n\n    // Write block\n    long fileOutPos = ftell(fileout.Get());\n    if (fileOutPos < 0)\n        return error(\"WriteBlockToDisk: ftell failed\");\n    pos.nPos = (unsigned int)fileOutPos;\n    fileout << block;\n\n    return true;\n}\n\nbool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos, const Consensus::Params& consensusParams)\n{\n    block.SetNull();\n\n    // Open history file to read\n    CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION);\n    if (filein.IsNull())\n        return error(\"ReadBlockFromDisk: OpenBlockFile failed for %s\", pos.ToString());\n\n    // Read block\n    try {\n        filein >> block;\n    }\n    catch (const std::exception& e) {\n        return error(\"%s: Deserialize or I/O error - %s at %s\", __func__, e.what(), pos.ToString());\n    }\n\n    // Check the header\n    if (!CheckProofOfWork(block.GetPoWHash_cached(), block.nBits, consensusParams))\n        return error(\"ReadBlockFromDisk: Errors in block header at %s\", pos.ToString());\n\n    return true;\n}\n\nbool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex, const Consensus::Params& consensusParams)\n{\n    CDiskBlockPos blockPos;\n    {\n        LOCK(cs_main);\n        blockPos = pindex->GetBlockPos();\n    }\n\n    if (!ReadBlockFromDisk(block, blockPos, consensusParams))\n        return false;\n    if (block.GetHash() != pindex->GetBlockHash())\n        return error(\"ReadBlockFromDisk(CBlock&, CBlockIndex*): GetHash() doesn't match index for %s at %s\",\n                pindex->ToString(), pindex->GetBlockPos().ToString());\n    return true;\n}\n\nCAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)\n{\n    int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;\n    // Force block reward to zero when right shift is undefined.\n    if (halvings >= 64)\n        return 0;\n\n    // FIXME.SUGAR // SURE?\n    CAmount nSubsidy = 42.94967296 * COIN; // 2^32/COIN = 42.94967296 (was 50)\n\n    // DEBUG - SUGAR\n    /*if (halvings == 1) { // no output if it zero(0)\n      printf(\"\\n*** BEGIN - DEBUG: GetBlockSubsidy\\n\");\n      printf(\"nSubsidy & COIN = %ld %ld\\n\", nSubsidy, COIN);\n      printf(\"*** END - DEBUG\\n\");\n    }*/\n    /* OUTPUT\n    nSubsidy & COIN = 4294967296 100000000\n    */\n\n    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.\n    nSubsidy >>= halvings;\n\n    // DEBUG - SUGAR\n    /*if (halvings > 0) {\n      printf(\"\\n*** BEGIN - DEBUG: nSubsidy\\n\");\n      printf(\"halvings & nSubsidy = %d %ld\\n\", halvings, nSubsidy);\n      printf(\"*** END - DEBUG\\n\");\n    }*/\n    /* OUTPUT\n    halvings & nSubsidy = 1 2147483648\n    halvings & nSubsidy = 2 1073741824 // its the supply at 2nd halving, not the total supply, but same as in COIN (2^30 = 1073741824)\n    halvings & nSubsidy = 3 536870912\n    halvings & nSubsidy = 4 268435456\n    halvings & nSubsidy = 5 134217728\n    halvings & nSubsidy = 6 67108864\n    halvings & nSubsidy = 7 33554432\n    halvings & nSubsidy = 8 16777216\n    halvings & nSubsidy = 9 8388608\n    halvings & nSubsidy = 10 4194304\n    halvings & nSubsidy = 11 2097152\n    halvings & nSubsidy = 12 1048576\n    halvings & nSubsidy = 13 524288\n    halvings & nSubsidy = 14 262144\n    halvings & nSubsidy = 15 131072\n    halvings & nSubsidy = 16 65536\n    halvings & nSubsidy = 17 32768\n    halvings & nSubsidy = 18 16384\n    halvings & nSubsidy = 19 8192\n    halvings & nSubsidy = 20 4096\n    halvings & nSubsidy = 21 2048\n    halvings & nSubsidy = 22 1024\n    halvings & nSubsidy = 23 512\n    halvings & nSubsidy = 24 256\n    halvings & nSubsidy = 25 128\n    halvings & nSubsidy = 26 64\n    halvings & nSubsidy = 27 32\n    halvings & nSubsidy = 28 16\n    halvings & nSubsidy = 29 8\n    halvings & nSubsidy = 30 4\n    halvings & nSubsidy = 31 2\n    halvings & nSubsidy = 32 1\n    halvings & nSubsidy = 33 0 << zero!\n    halvings & nSubsidy = 34 0\n    (...)\n    halvings & nSubsidy = 63 0 << done: no more HALVINGS after 63rd - if (halvings >= 64) {return 0;}\n    */\n\n    return nSubsidy;\n}\n\nbool IsInitialBlockDownload()\n{\n    // Once this function has returned false, it must remain false.\n    static std::atomic<bool> latchToFalse{false};\n    // Optimization: pre-test latch before taking the lock.\n    if (latchToFalse.load(std::memory_order_relaxed))\n        return false;\n\n    LOCK(cs_main);\n    if (latchToFalse.load(std::memory_order_relaxed))\n        return false;\n    if (fImporting || fReindex)\n        return true;\n    if (chainActive.Tip() == nullptr)\n        return true;\n    if (chainActive.Tip()->nChainWork < nMinimumChainWork)\n        return true;\n    if (chainActive.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge))\n        return true;\n    LogPrintf(\"Leaving InitialBlockDownload (latching to false)\\n\");\n    latchToFalse.store(true, std::memory_order_relaxed);\n    return false;\n}\n\nCBlockIndex *pindexBestForkTip = nullptr, *pindexBestForkBase = nullptr;\n\nstatic void AlertNotify(const std::string& strMessage)\n{\n    uiInterface.NotifyAlertChanged();\n    std::string strCmd = gArgs.GetArg(\"-alertnotify\", \"\");\n    if (strCmd.empty()) return;\n\n    // Alert text should be plain ascii coming from a trusted source, but to\n    // be safe we first strip anything not in safeChars, then add single quotes around\n    // the whole string before passing it to the shell:\n    std::string singleQuote(\"'\");\n    std::string safeStatus = SanitizeString(strMessage);\n    safeStatus = singleQuote+safeStatus+singleQuote;\n    boost::replace_all(strCmd, \"%s\", safeStatus);\n\n    boost::thread t(runCommand, strCmd); // thread runs free\n}\n\nstatic void CheckForkWarningConditions()\n{\n    AssertLockHeld(cs_main);\n    // Before we get past initial download, we cannot reliably alert about forks\n    // (we assume we don't get stuck on a fork before finishing our initial sync)\n    if (IsInitialBlockDownload())\n        return;\n\n    // If our best fork is no longer within 72 blocks (+/- 12 hours if no one mines it)\n    // of our head, drop it\n    if (pindexBestForkTip && chainActive.Height() - pindexBestForkTip->nHeight >= 72)\n        pindexBestForkTip = nullptr;\n\n    if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (GetBlockProof(*chainActive.Tip()) * 6)))\n    {\n        if (!GetfLargeWorkForkFound() && pindexBestForkBase)\n        {\n            std::string warning = std::string(\"'Warning: Large-work fork detected, forking after block \") +\n                pindexBestForkBase->phashBlock->ToString() + std::string(\"'\");\n            AlertNotify(warning);\n        }\n        if (pindexBestForkTip && pindexBestForkBase)\n        {\n            LogPrintf(\"%s: Warning: Large valid fork found\\n  forking the chain at height %d (%s)\\n  lasting to height %d (%s).\\nChain state database corruption likely.\\n\", __func__,\n                   pindexBestForkBase->nHeight, pindexBestForkBase->phashBlock->ToString(),\n                   pindexBestForkTip->nHeight, pindexBestForkTip->phashBlock->ToString());\n            SetfLargeWorkForkFound(true);\n        }\n        else\n        {\n            LogPrintf(\"%s: Warning: Found invalid chain at least ~6 blocks longer than our best chain.\\nChain state database corruption likely.\\n\", __func__);\n            SetfLargeWorkInvalidChainFound(true);\n        }\n    }\n    else\n    {\n        SetfLargeWorkForkFound(false);\n        SetfLargeWorkInvalidChainFound(false);\n    }\n}\n\nstatic void CheckForkWarningConditionsOnNewFork(CBlockIndex* pindexNewForkTip)\n{\n    AssertLockHeld(cs_main);\n    // If we are on a fork that is sufficiently large, set a warning flag\n    CBlockIndex* pfork = pindexNewForkTip;\n    CBlockIndex* plonger = chainActive.Tip();\n    while (pfork && pfork != plonger)\n    {\n        while (plonger && plonger->nHeight > pfork->nHeight)\n            plonger = plonger->pprev;\n        if (pfork == plonger)\n            break;\n        pfork = pfork->pprev;\n    }\n\n    // We define a condition where we should warn the user about as a fork of at least 7 blocks\n    // with a tip within 72 blocks (+/- 12 hours if no one mines it) of ours\n    // We use 7 blocks rather arbitrarily as it represents just under 10% of sustained network\n    // hash rate operating on the fork.\n    // or a chain that is entirely longer than ours and invalid (note that this should be detected by both)\n    // We define it this way because it allows us to only store the highest fork tip (+ base) which meets\n    // the 7-block condition and from this always have the most-likely-to-cause-warning fork\n    if (pfork && (!pindexBestForkTip || pindexNewForkTip->nHeight > pindexBestForkTip->nHeight) &&\n            pindexNewForkTip->nChainWork - pfork->nChainWork > (GetBlockProof(*pfork) * 7) &&\n            chainActive.Height() - pindexNewForkTip->nHeight < 72)\n    {\n        pindexBestForkTip = pindexNewForkTip;\n        pindexBestForkBase = pfork;\n    }\n\n    CheckForkWarningConditions();\n}\n\nvoid static InvalidChainFound(CBlockIndex* pindexNew)\n{\n    if (!pindexBestInvalid || pindexNew->nChainWork > pindexBestInvalid->nChainWork)\n        pindexBestInvalid = pindexNew;\n\n    LogPrintf(\"%s: invalid block=%s  height=%d  log2_work=%.8g  date=%s\\n\", __func__,\n      pindexNew->GetBlockHash().ToString(), pindexNew->nHeight,\n      log(pindexNew->nChainWork.getdouble())/log(2.0), DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\",\n      pindexNew->GetBlockTime()));\n    CBlockIndex *tip = chainActive.Tip();\n    assert (tip);\n    LogPrintf(\"%s:  current best=%s  height=%d  log2_work=%.8g  date=%s\\n\", __func__,\n      tip->GetBlockHash().ToString(), chainActive.Height(), log(tip->nChainWork.getdouble())/log(2.0),\n      DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", tip->GetBlockTime()));\n    CheckForkWarningConditions();\n}\n\nvoid CChainState::InvalidBlockFound(CBlockIndex *pindex, const CValidationState &state) {\n    if (!state.CorruptionPossible()) {\n        pindex->nStatus |= BLOCK_FAILED_VALID;\n        g_failed_blocks.insert(pindex);\n        setDirtyBlockIndex.insert(pindex);\n        setBlockIndexCandidates.erase(pindex);\n        InvalidChainFound(pindex);\n    }\n}\n\nvoid UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, CTxUndo &txundo, int nHeight)\n{\n    // mark inputs spent\n    if (!tx.IsCoinBase()) {\n        txundo.vprevout.reserve(tx.vin.size());\n        for (const CTxIn &txin : tx.vin) {\n            txundo.vprevout.emplace_back();\n            bool is_spent = inputs.SpendCoin(txin.prevout, &txundo.vprevout.back());\n            assert(is_spent);\n        }\n    }\n    // add outputs\n    AddCoins(inputs, tx, nHeight);\n}\n\nvoid UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight)\n{\n    CTxUndo txundo;\n    UpdateCoins(tx, inputs, txundo, nHeight);\n}\n\nbool CScriptCheck::operator()() {\n    const CScript &scriptSig = ptxTo->vin[nIn].scriptSig;\n    const CScriptWitness *witness = &ptxTo->vin[nIn].scriptWitness;\n    return VerifyScript(scriptSig, m_tx_out.scriptPubKey, witness, nFlags, CachingTransactionSignatureChecker(ptxTo, nIn, m_tx_out.nValue, cacheStore, *txdata), &error);\n}\n\nint GetSpendHeight(const CCoinsViewCache& inputs)\n{\n    LOCK(cs_main);\n    CBlockIndex* pindexPrev = mapBlockIndex.find(inputs.GetBestBlock())->second;\n    return pindexPrev->nHeight + 1;\n}\n\n\nstatic CuckooCache::cache<uint256, SignatureCacheHasher> scriptExecutionCache;\nstatic uint256 scriptExecutionCacheNonce(GetRandHash());\n\nvoid InitScriptExecutionCache() {\n    // nMaxCacheSize is unsigned. If -maxsigcachesize is set to zero,\n    // setup_bytes creates the minimum possible cache (2 elements).\n    size_t nMaxCacheSize = std::min(std::max((int64_t)0, gArgs.GetArg(\"-maxsigcachesize\", DEFAULT_MAX_SIG_CACHE_SIZE) / 2), MAX_MAX_SIG_CACHE_SIZE) * ((size_t) 1 << 20);\n    size_t nElems = scriptExecutionCache.setup_bytes(nMaxCacheSize);\n    LogPrintf(\"Using %zu MiB out of %zu/2 requested for script execution cache, able to store %zu elements\\n\",\n            (nElems*sizeof(uint256)) >>20, (nMaxCacheSize*2)>>20, nElems);\n}\n\n/**\n * Check whether all inputs of this transaction are valid (no double spends, scripts & sigs, amounts)\n * This does not modify the UTXO set.\n *\n * If pvChecks is not nullptr, script checks are pushed onto it instead of being performed inline. Any\n * script checks which are not necessary (eg due to script execution cache hits) are, obviously,\n * not pushed onto pvChecks/run.\n *\n * Setting cacheSigStore/cacheFullScriptStore to false will remove elements from the corresponding cache\n * which are matched. This is useful for checking blocks where we will likely never need the cache\n * entry again.\n *\n * Non-static (and re-declared) in src/test/txvalidationcache_tests.cpp\n */\nbool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, bool cacheSigStore, bool cacheFullScriptStore, PrecomputedTransactionData& txdata, std::vector<CScriptCheck> *pvChecks)\n{\n    if (!tx.IsCoinBase())\n    {\n        if (pvChecks)\n            pvChecks->reserve(tx.vin.size());\n\n        // The first loop above does all the inexpensive checks.\n        // Only if ALL inputs pass do we perform expensive ECDSA signature checks.\n        // Helps prevent CPU exhaustion attacks.\n\n        // Skip script verification when connecting blocks under the\n        // assumevalid block. Assuming the assumevalid block is valid this\n        // is safe because block merkle hashes are still computed and checked,\n        // Of course, if an assumed valid block is invalid due to false scriptSigs\n        // this optimization would allow an invalid chain to be accepted.\n        if (fScriptChecks) {\n            // First check if script executions have been cached with the same\n            // flags. Note that this assumes that the inputs provided are\n            // correct (ie that the transaction hash which is in tx's prevouts\n            // properly commits to the scriptPubKey in the inputs view of that\n            // transaction).\n            uint256 hashCacheEntry;\n            // We only use the first 19 bytes of nonce to avoid a second SHA\n            // round - giving us 19 + 32 + 4 = 55 bytes (+ 8 + 1 = 64)\n            static_assert(55 - sizeof(flags) - 32 >= 128/8, \"Want at least 128 bits of nonce for script execution cache\");\n            CSHA256().Write(scriptExecutionCacheNonce.begin(), 55 - sizeof(flags) - 32).Write(tx.GetWitnessHash().begin(), 32).Write((unsigned char*)&flags, sizeof(flags)).Finalize(hashCacheEntry.begin());\n            AssertLockHeld(cs_main); //TODO: Remove this requirement by making CuckooCache not require external locks\n            if (scriptExecutionCache.contains(hashCacheEntry, !cacheFullScriptStore)) {\n                return true;\n            }\n\n            for (unsigned int i = 0; i < tx.vin.size(); i++) {\n                const COutPoint &prevout = tx.vin[i].prevout;\n                const Coin& coin = inputs.AccessCoin(prevout);\n                assert(!coin.IsSpent());\n\n                // We very carefully only pass in things to CScriptCheck which\n                // are clearly committed to by tx' witness hash. This provides\n                // a sanity check that our caching is not introducing consensus\n                // failures through additional data in, eg, the coins being\n                // spent being checked as a part of CScriptCheck.\n\n                // Verify signature\n                CScriptCheck check(coin.out, tx, i, flags, cacheSigStore, &txdata);\n                if (pvChecks) {\n                    pvChecks->push_back(CScriptCheck());\n                    check.swap(pvChecks->back());\n                } else if (!check()) {\n                    if (flags & STANDARD_NOT_MANDATORY_VERIFY_FLAGS) {\n                        // Check whether the failure was caused by a\n                        // non-mandatory script verification check, such as\n                        // non-standard DER encodings or non-null dummy\n                        // arguments; if so, don't trigger DoS protection to\n                        // avoid splitting the network between upgraded and\n                        // non-upgraded nodes.\n                        CScriptCheck check2(coin.out, tx, i,\n                                flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS, cacheSigStore, &txdata);\n                        if (check2())\n                            return state.Invalid(false, REJECT_NONSTANDARD, strprintf(\"non-mandatory-script-verify-flag (%s)\", ScriptErrorString(check.GetScriptError())));\n                    }\n                    // Failures of other flags indicate a transaction that is\n                    // invalid in new blocks, e.g. an invalid P2SH. We DoS ban\n                    // such nodes as they are not following the protocol. That\n                    // said during an upgrade careful thought should be taken\n                    // as to the correct behavior - we may want to continue\n                    // peering with non-upgraded nodes even after soft-fork\n                    // super-majority signaling has occurred.\n                    return state.DoS(100,false, REJECT_INVALID, strprintf(\"mandatory-script-verify-flag-failed (%s)\", ScriptErrorString(check.GetScriptError())));\n                }\n            }\n\n            if (cacheFullScriptStore && !pvChecks) {\n                // We executed all of the provided scripts, and were told to\n                // cache the result. Do so now.\n                scriptExecutionCache.insert(hashCacheEntry);\n            }\n        }\n    }\n\n    return true;\n}\n\nnamespace {\n\nbool UndoWriteToDisk(const CBlockUndo& blockundo, CDiskBlockPos& pos, const uint256& hashBlock, const CMessageHeader::MessageStartChars& messageStart)\n{\n    // Open history file to append\n    CAutoFile fileout(OpenUndoFile(pos), SER_DISK, CLIENT_VERSION);\n    if (fileout.IsNull())\n        return error(\"%s: OpenUndoFile failed\", __func__);\n\n    // Write index header\n    unsigned int nSize = GetSerializeSize(fileout, blockundo);\n    fileout << FLATDATA(messageStart) << nSize;\n\n    // Write undo data\n    long fileOutPos = ftell(fileout.Get());\n    if (fileOutPos < 0)\n        return error(\"%s: ftell failed\", __func__);\n    pos.nPos = (unsigned int)fileOutPos;\n    fileout << blockundo;\n\n    // calculate & write checksum\n    CHashWriter hasher(SER_GETHASH, PROTOCOL_VERSION);\n    hasher << hashBlock;\n    hasher << blockundo;\n    fileout << hasher.GetHash();\n\n    return true;\n}\n\nstatic bool UndoReadFromDisk(CBlockUndo& blockundo, const CBlockIndex *pindex)\n{\n    CDiskBlockPos pos = pindex->GetUndoPos();\n    if (pos.IsNull()) {\n        return error(\"%s: no undo data available\", __func__);\n    }\n\n    // Open history file to read\n    CAutoFile filein(OpenUndoFile(pos, true), SER_DISK, CLIENT_VERSION);\n    if (filein.IsNull())\n        return error(\"%s: OpenUndoFile failed\", __func__);\n\n    // Read block\n    uint256 hashChecksum;\n    CHashVerifier<CAutoFile> verifier(&filein); // We need a CHashVerifier as reserializing may lose data\n    try {\n        verifier << pindex->pprev->GetBlockHash();\n        verifier >> blockundo;\n        filein >> hashChecksum;\n    }\n    catch (const std::exception& e) {\n        return error(\"%s: Deserialize or I/O error - %s\", __func__, e.what());\n    }\n\n    // Verify checksum\n    if (hashChecksum != verifier.GetHash())\n        return error(\"%s: Checksum mismatch\", __func__);\n\n    return true;\n}\n\n/** Abort with a message */\nbool AbortNode(const std::string& strMessage, const std::string& userMessage=\"\")\n{\n    SetMiscWarning(strMessage);\n    LogPrintf(\"*** %s\\n\", strMessage);\n    uiInterface.ThreadSafeMessageBox(\n        userMessage.empty() ? _(\"Error: A fatal internal error occurred, see debug.log for details\") : userMessage,\n        \"\", CClientUIInterface::MSG_ERROR);\n    StartShutdown();\n    return false;\n}\n\nbool AbortNode(CValidationState& state, const std::string& strMessage, const std::string& userMessage=\"\")\n{\n    AbortNode(strMessage, userMessage);\n    return state.Error(strMessage);\n}\n\n} // namespace\n\n/**\n * Restore the UTXO in a Coin at a given COutPoint\n * @param undo The Coin to be restored.\n * @param view The coins view to which to apply the changes.\n * @param out The out point that corresponds to the tx input.\n * @return A DisconnectResult as an int\n */\nint ApplyTxInUndo(Coin&& undo, CCoinsViewCache& view, const COutPoint& out)\n{\n    bool fClean = true;\n\n    if (view.HaveCoin(out)) fClean = false; // overwriting transaction output\n\n    if (undo.nHeight == 0) {\n        // Missing undo metadata (height and coinbase). Older versions included this\n        // information only in undo records for the last spend of a transactions'\n        // outputs. This implies that it must be present for some other output of the same tx.\n        const Coin& alternate = AccessByTxid(view, out.hash);\n        if (!alternate.IsSpent()) {\n            undo.nHeight = alternate.nHeight;\n            undo.fCoinBase = alternate.fCoinBase;\n        } else {\n            return DISCONNECT_FAILED; // adding output for transaction without known metadata\n        }\n    }\n    // The potential_overwrite parameter to AddCoin is only allowed to be false if we know for\n    // sure that the coin did not already exist in the cache. As we have queried for that above\n    // using HaveCoin, we don't need to guess. When fClean is false, a coin already existed and\n    // it is an overwrite.\n    view.AddCoin(out, std::move(undo), !fClean);\n\n    return fClean ? DISCONNECT_OK : DISCONNECT_UNCLEAN;\n}\n\n/** Undo the effects of this block (with given index) on the UTXO set represented by coins.\n *  When FAILED is returned, view is left in an indeterminate state. */\nDisconnectResult CChainState::DisconnectBlock(const CBlock& block, const CBlockIndex* pindex, CCoinsViewCache& view)\n{\n    bool fClean = true;\n\n    CBlockUndo blockUndo;\n    if (!UndoReadFromDisk(blockUndo, pindex)) {\n        error(\"DisconnectBlock(): failure reading undo data\");\n        return DISCONNECT_FAILED;\n    }\n\n    if (blockUndo.vtxundo.size() + 1 != block.vtx.size()) {\n        error(\"DisconnectBlock(): block and undo data inconsistent\");\n        return DISCONNECT_FAILED;\n    }\n\n    // undo transactions in reverse order\n    for (int i = block.vtx.size() - 1; i >= 0; i--) {\n        const CTransaction &tx = *(block.vtx[i]);\n        uint256 hash = tx.GetHash();\n        bool is_coinbase = tx.IsCoinBase();\n\n        // Check that all outputs are available and match the outputs in the block itself\n        // exactly.\n        for (size_t o = 0; o < tx.vout.size(); o++) {\n            if (!tx.vout[o].scriptPubKey.IsUnspendable()) {\n                COutPoint out(hash, o);\n                Coin coin;\n                bool is_spent = view.SpendCoin(out, &coin);\n                if (!is_spent || tx.vout[o] != coin.out || pindex->nHeight != coin.nHeight || is_coinbase != coin.fCoinBase) {\n                    fClean = false; // transaction output mismatch\n                }\n            }\n        }\n\n        // restore inputs\n        if (i > 0) { // not coinbases\n            CTxUndo &txundo = blockUndo.vtxundo[i-1];\n            if (txundo.vprevout.size() != tx.vin.size()) {\n                error(\"DisconnectBlock(): transaction and undo data inconsistent\");\n                return DISCONNECT_FAILED;\n            }\n            for (unsigned int j = tx.vin.size(); j-- > 0;) {\n                const COutPoint &out = tx.vin[j].prevout;\n                int res = ApplyTxInUndo(std::move(txundo.vprevout[j]), view, out);\n                if (res == DISCONNECT_FAILED) return DISCONNECT_FAILED;\n                fClean = fClean && res != DISCONNECT_UNCLEAN;\n            }\n            // At this point, all of txundo.vprevout should have been moved out.\n        }\n    }\n\n    // move best block pointer to prevout block\n    view.SetBestBlock(pindex->pprev->GetBlockHash());\n\n    return fClean ? DISCONNECT_OK : DISCONNECT_UNCLEAN;\n}\n\nvoid static FlushBlockFile(bool fFinalize = false)\n{\n    LOCK(cs_LastBlockFile);\n\n    CDiskBlockPos posOld(nLastBlockFile, 0);\n\n    FILE *fileOld = OpenBlockFile(posOld);\n    if (fileOld) {\n        if (fFinalize)\n            TruncateFile(fileOld, vinfoBlockFile[nLastBlockFile].nSize);\n        FileCommit(fileOld);\n        fclose(fileOld);\n    }\n\n    fileOld = OpenUndoFile(posOld);\n    if (fileOld) {\n        if (fFinalize)\n            TruncateFile(fileOld, vinfoBlockFile[nLastBlockFile].nUndoSize);\n        FileCommit(fileOld);\n        fclose(fileOld);\n    }\n}\n\nstatic bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigned int nAddSize);\n\nstatic bool WriteUndoDataForBlock(const CBlockUndo& blockundo, CValidationState& state, CBlockIndex* pindex, const CChainParams& chainparams)\n{\n    // Write undo information to disk\n    if (pindex->GetUndoPos().IsNull()) {\n        CDiskBlockPos _pos;\n        if (!FindUndoPos(state, pindex->nFile, _pos, ::GetSerializeSize(blockundo, SER_DISK, CLIENT_VERSION) + 40))\n            return error(\"ConnectBlock(): FindUndoPos failed\");\n        if (!UndoWriteToDisk(blockundo, _pos, pindex->pprev->GetBlockHash(), chainparams.MessageStart()))\n            return AbortNode(state, \"Failed to write undo data\");\n\n        // update nUndoPos in block index\n        pindex->nUndoPos = _pos.nPos;\n        pindex->nStatus |= BLOCK_HAVE_UNDO;\n        setDirtyBlockIndex.insert(pindex);\n    }\n\n    return true;\n}\n\nstatic bool WriteTxIndexDataForBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex)\n{\n    if (!fTxIndex) return true;\n\n    CDiskTxPos pos(pindex->GetBlockPos(), GetSizeOfCompactSize(block.vtx.size()));\n    std::vector<std::pair<uint256, CDiskTxPos> > vPos;\n    vPos.reserve(block.vtx.size());\n    for (const CTransactionRef& tx : block.vtx)\n    {\n        vPos.push_back(std::make_pair(tx->GetHash(), pos));\n        pos.nTxOffset += ::GetSerializeSize(*tx, SER_DISK, CLIENT_VERSION);\n    }\n\n    if (!pblocktree->WriteTxIndex(vPos)) {\n        return AbortNode(state, \"Failed to write transaction index\");\n    }\n\n    return true;\n}\n\nstatic CCheckQueue<CScriptCheck> scriptcheckqueue(128);\n\nvoid ThreadScriptCheck() {\n    RenameThread(\"sugarchain-scriptch\");\n    scriptcheckqueue.Thread();\n}\n\n// Protected by cs_main\nVersionBitsCache versionbitscache;\n\nint32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params)\n{\n    LOCK(cs_main);\n    int32_t nVersion = VERSIONBITS_TOP_BITS;\n\n    for (int i = 0; i < (int)Consensus::MAX_VERSION_BITS_DEPLOYMENTS; i++) {\n        ThresholdState state = VersionBitsState(pindexPrev, params, (Consensus::DeploymentPos)i, versionbitscache);\n        if (state == THRESHOLD_LOCKED_IN || state == THRESHOLD_STARTED) {\n            nVersion |= VersionBitsMask(params, (Consensus::DeploymentPos)i);\n        }\n    }\n\n    return nVersion;\n}\n\n/**\n * Threshold condition checker that triggers when unknown versionbits are seen on the network.\n */\nclass WarningBitsConditionChecker : public AbstractThresholdConditionChecker\n{\nprivate:\n    int bit;\n\npublic:\n    explicit WarningBitsConditionChecker(int bitIn) : bit(bitIn) {}\n\n    int64_t BeginTime(const Consensus::Params& params) const override { return 0; }\n    int64_t EndTime(const Consensus::Params& params) const override { return std::numeric_limits<int64_t>::max(); }\n    int Period(const Consensus::Params& params) const override { return params.nMinerConfirmationWindow; }\n    int Threshold(const Consensus::Params& params) const override { return params.nRuleChangeActivationThreshold; }\n\n    bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const override\n    {\n        return ((pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS) &&\n               ((pindex->nVersion >> bit) & 1) != 0 &&\n               ((ComputeBlockVersion(pindex->pprev, params) >> bit) & 1) == 0;\n    }\n};\n\n// Protected by cs_main\nstatic ThresholdConditionCache warningcache[VERSIONBITS_NUM_BITS];\n\nstatic unsigned int GetBlockScriptFlags(const CBlockIndex* pindex, const Consensus::Params& consensusparams) {\n    AssertLockHeld(cs_main);\n\n    unsigned int flags = SCRIPT_VERIFY_NONE;\n\n    // Start enforcing P2SH (BIP16)\n    if (pindex->nHeight >= consensusparams.BIP16Height) {\n        flags |= SCRIPT_VERIFY_P2SH;\n    }\n\n    // Start enforcing the DERSIG (BIP66) rule\n    if (pindex->nHeight >= consensusparams.BIP66Height) {\n        flags |= SCRIPT_VERIFY_DERSIG;\n    }\n\n    // Start enforcing CHECKLOCKTIMEVERIFY (BIP65) rule\n    if (pindex->nHeight >= consensusparams.BIP65Height) {\n        flags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY;\n    }\n\n    // Start enforcing BIP68 (sequence locks) and BIP112 (CHECKSEQUENCEVERIFY) using versionbits logic.\n    if (VersionBitsState(pindex->pprev, consensusparams, Consensus::DEPLOYMENT_CSV, versionbitscache) == THRESHOLD_ACTIVE) {\n        flags |= SCRIPT_VERIFY_CHECKSEQUENCEVERIFY;\n    }\n\n    // Start enforcing WITNESS rules using versionbits logic.\n    if (IsWitnessEnabled(pindex->pprev, consensusparams)) {\n        flags |= SCRIPT_VERIFY_WITNESS;\n        flags |= SCRIPT_VERIFY_NULLDUMMY;\n    }\n\n    return flags;\n}\n\n\n\nstatic int64_t nTimeCheck = 0;\nstatic int64_t nTimeForks = 0;\nstatic int64_t nTimeVerify = 0;\nstatic int64_t nTimeConnect = 0;\nstatic int64_t nTimeIndex = 0;\nstatic int64_t nTimeCallbacks = 0;\nstatic int64_t nTimeTotal = 0;\nstatic int64_t nBlocksTotal = 0;\n\n/** Apply the effects of this block (with given index) on the UTXO set represented by coins.\n *  Validity checks that depend on the UTXO set are also done; ConnectBlock()\n *  can fail if those validity checks fail (among other reasons). */\nbool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pindex,\n                  CCoinsViewCache& view, const CChainParams& chainparams, bool fJustCheck)\n{\n    AssertLockHeld(cs_main);\n    assert(pindex);\n    // pindex->phashBlock can be null if called by CreateNewBlock/TestBlockValidity\n    assert((pindex->phashBlock == nullptr) ||\n           (*pindex->phashBlock == block.GetHash()));\n    int64_t nTimeStart = GetTimeMicros();\n\n    // Check it again in case a previous version let a bad block in\n    // NOTE: We don't currently (re-)invoke ContextualCheckBlock() or\n    // ContextualCheckBlockHeader() here. This means that if we add a new\n    // consensus rule that is enforced in one of those two functions, then we\n    // may have let in a block that violates the rule prior to updating the\n    // software, and we would NOT be enforcing the rule here. Fully solving\n    // upgrade from one software version to the next after a consensus rule\n    // change is potentially tricky and issue-specific (see RewindBlockIndex()\n    // for one general approach that was used for BIP 141 deployment).\n    // Also, currently the rule against blocks more than 2 hours in the future\n    // is enforced in ContextualCheckBlockHeader(); we wouldn't want to\n    // re-enforce that rule here (at least until we make it impossible for\n    // GetAdjustedTime() to go backward).\n    if (!CheckBlock(block, state, chainparams.GetConsensus(), !fJustCheck, !fJustCheck))\n        return error(\"%s: Consensus::CheckBlock: %s\", __func__, FormatStateMessage(state));\n\n    // verify that the view's current state corresponds to the previous block\n    uint256 hashPrevBlock = pindex->pprev == nullptr ? uint256() : pindex->pprev->GetBlockHash();\n    assert(hashPrevBlock == view.GetBestBlock());\n\n    // Special case for the genesis block, skipping connection of its transactions\n    // (its coinbase is unspendable)\n    if (block.GetHash() == chainparams.GetConsensus().hashGenesisBlock) {\n        if (!fJustCheck)\n            view.SetBestBlock(pindex->GetBlockHash());\n        return true;\n    }\n\n    nBlocksTotal++;\n\n    bool fScriptChecks = true;\n    if (!hashAssumeValid.IsNull()) {\n        // We've been configured with the hash of a block which has been externally verified to have a valid history.\n        // A suitable default value is included with the software and updated from time to time.  Because validity\n        //  relative to a piece of software is an objective fact these defaults can be easily reviewed.\n        // This setting doesn't force the selection of any particular chain but makes validating some faster by\n        //  effectively caching the result of part of the verification.\n        BlockMap::const_iterator  it = mapBlockIndex.find(hashAssumeValid);\n        if (it != mapBlockIndex.end()) {\n            if (it->second->GetAncestor(pindex->nHeight) == pindex &&\n                pindexBestHeader->GetAncestor(pindex->nHeight) == pindex &&\n                pindexBestHeader->nChainWork >= nMinimumChainWork) {\n                // This block is a member of the assumed verified chain and an ancestor of the best header.\n                // The equivalent time check discourages hash power from extorting the network via DOS attack\n                //  into accepting an invalid block through telling users they must manually set assumevalid.\n                //  Requiring a software change or burying the invalid block, regardless of the setting, makes\n                //  it hard to hide the implication of the demand.  This also avoids having release candidates\n                //  that are hardly doing any signature verification at all in testing without having to\n                //  artificially set the default assumed verified block further back.\n                // The test against nMinimumChainWork prevents the skipping when denied access to any chain at\n                //  least as good as the expected chain.\n                fScriptChecks = (GetBlockProofEquivalentTime(*pindexBestHeader, *pindex, *pindexBestHeader, chainparams.GetConsensus()) <= 60 * 60 * 24 * 7 * 2);\n            }\n        }\n    }\n\n    int64_t nTime1 = GetTimeMicros(); nTimeCheck += nTime1 - nTimeStart;\n    LogPrint(BCLog::BENCH, \"    - Sanity checks: %.2fms [%.2fs (%.2fms/blk)]\\n\", MILLI * (nTime1 - nTimeStart), nTimeCheck * MICRO, nTimeCheck * MILLI / nBlocksTotal);\n\n    // Do not allow blocks that contain transactions which 'overwrite' older transactions,\n    // unless those are already completely spent.\n    // If such overwrites are allowed, coinbases and transactions depending upon those\n    // can be duplicated to remove the ability to spend the first instance -- even after\n    // being sent to another address.\n    // See BIP30 and http://r6.ca/blog/20120206T005236Z.html for more information.\n    // This logic is not necessary for memory pool transactions, as AcceptToMemoryPool\n    // already refuses previously-known transaction ids entirely.\n    // This rule was originally applied to all blocks with a timestamp after March 15, 2012, 0:00 UTC.\n    // Now that the whole chain is irreversibly beyond that time it is applied to all blocks except the\n    // two in the chain that violate it. This prevents exploiting the issue against nodes during their\n    // initial block download.\n\n    // FIXME.SUGAR // SURE?\n    bool fEnforceBIP30 = true;\n                        //(!pindex->phashBlock) || // Enforce on CreateNewBlock invocations which don't have a hash.\n                        //  !((pindex->nHeight==91842 && pindex->GetBlockHash() == uint256S(\"0x00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec\")) ||\n                        //   (pindex->nHeight==91880 && pindex->GetBlockHash() == uint256S(\"0x00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721\")));\n\n    // Once BIP34 activated it was not possible to create new duplicate coinbases and thus other than starting\n    // with the 2 existing duplicate coinbase pairs, not possible to create overwriting txs.  But by the\n    // time BIP34 activated, in each of the existing pairs the duplicate coinbase had overwritten the first\n    // before the first had been spent.  Since those coinbases are sufficiently buried its no longer possible to create further\n    // duplicate transactions descending from the known pairs either.\n    // If we're on the known chain at height greater than where BIP34 activated, we can save the db accesses needed for the BIP30 check.\n    assert(pindex->pprev);\n    CBlockIndex *pindexBIP34height = pindex->pprev->GetAncestor(chainparams.GetConsensus().BIP34Height);\n    //Only continue to enforce if we're below BIP34 activation height or the block hash at that height doesn't correspond.\n    fEnforceBIP30 = fEnforceBIP30 && (!pindexBIP34height || !(pindexBIP34height->GetBlockHash() == chainparams.GetConsensus().BIP34Hash));\n\n    if (fEnforceBIP30) {\n        for (const auto& tx : block.vtx) {\n            for (size_t o = 0; o < tx->vout.size(); o++) {\n                if (view.HaveCoin(COutPoint(tx->GetHash(), o))) {\n                    return state.DoS(100, error(\"ConnectBlock(): tried to overwrite transaction\"),\n                                     REJECT_INVALID, \"bad-txns-BIP30\");\n                }\n            }\n        }\n    }\n\n    // Start enforcing BIP68 (sequence locks) and BIP112 (CHECKSEQUENCEVERIFY) using versionbits logic.\n    int nLockTimeFlags = 0;\n    if (VersionBitsState(pindex->pprev, chainparams.GetConsensus(), Consensus::DEPLOYMENT_CSV, versionbitscache) == THRESHOLD_ACTIVE) {\n        nLockTimeFlags |= LOCKTIME_VERIFY_SEQUENCE;\n    }\n\n    // Get the script flags for this block\n    unsigned int flags = GetBlockScriptFlags(pindex, chainparams.GetConsensus());\n\n    int64_t nTime2 = GetTimeMicros(); nTimeForks += nTime2 - nTime1;\n    LogPrint(BCLog::BENCH, \"    - Fork checks: %.2fms [%.2fs (%.2fms/blk)]\\n\", MILLI * (nTime2 - nTime1), nTimeForks * MICRO, nTimeForks * MILLI / nBlocksTotal);\n\n    CBlockUndo blockundo;\n\n    CCheckQueueControl<CScriptCheck> control(fScriptChecks && nScriptCheckThreads ? &scriptcheckqueue : nullptr);\n\n    std::vector<int> prevheights;\n    CAmount nFees = 0;\n    int nInputs = 0;\n    int64_t nSigOpsCost = 0;\n    blockundo.vtxundo.reserve(block.vtx.size() - 1);\n    std::vector<PrecomputedTransactionData> txdata;\n    txdata.reserve(block.vtx.size()); // Required so that pointers to individual PrecomputedTransactionData don't get invalidated\n    for (unsigned int i = 0; i < block.vtx.size(); i++)\n    {\n        const CTransaction &tx = *(block.vtx[i]);\n\n        nInputs += tx.vin.size();\n\n        if (!tx.IsCoinBase())\n        {\n            CAmount txfee = 0;\n            if (!Consensus::CheckTxInputs(tx, state, view, pindex->nHeight, txfee)) {\n                return error(\"%s: Consensus::CheckTxInputs: %s, %s\", __func__, tx.GetHash().ToString(), FormatStateMessage(state));\n            }\n            nFees += txfee;\n            if (!MoneyRange(nFees)) {\n                return state.DoS(100, error(\"%s: accumulated fee in the block out of range.\", __func__),\n                                 REJECT_INVALID, \"bad-txns-accumulated-fee-outofrange\");\n            }\n\n            // Check that transaction is BIP68 final\n            // BIP68 lock checks (as opposed to nLockTime checks) must\n            // be in ConnectBlock because they require the UTXO set\n            prevheights.resize(tx.vin.size());\n            for (size_t j = 0; j < tx.vin.size(); j++) {\n                prevheights[j] = view.AccessCoin(tx.vin[j].prevout).nHeight;\n            }\n\n            if (!SequenceLocks(tx, nLockTimeFlags, &prevheights, *pindex)) {\n                return state.DoS(100, error(\"%s: contains a non-BIP68-final transaction\", __func__),\n                                 REJECT_INVALID, \"bad-txns-nonfinal\");\n            }\n        }\n\n        // GetTransactionSigOpCost counts 3 types of sigops:\n        // * legacy (always)\n        // * p2sh (when P2SH enabled in flags and excludes coinbase)\n        // * witness (when witness enabled in flags and excludes coinbase)\n        nSigOpsCost += GetTransactionSigOpCost(tx, view, flags);\n        if (nSigOpsCost > MAX_BLOCK_SIGOPS_COST)\n            return state.DoS(100, error(\"ConnectBlock(): too many sigops\"),\n                             REJECT_INVALID, \"bad-blk-sigops\");\n\n        txdata.emplace_back(tx);\n        if (!tx.IsCoinBase())\n        {\n            std::vector<CScriptCheck> vChecks;\n            bool fCacheResults = fJustCheck; /* Don't cache results if we're actually connecting blocks (still consult the cache, though) */\n            if (!CheckInputs(tx, state, view, fScriptChecks, flags, fCacheResults, fCacheResults, txdata[i], nScriptCheckThreads ? &vChecks : nullptr))\n                return error(\"ConnectBlock(): CheckInputs on %s failed with %s\",\n                    tx.GetHash().ToString(), FormatStateMessage(state));\n            control.Add(vChecks);\n        }\n\n        CTxUndo undoDummy;\n        if (i > 0) {\n            blockundo.vtxundo.push_back(CTxUndo());\n        }\n        UpdateCoins(tx, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight);\n    }\n    int64_t nTime3 = GetTimeMicros(); nTimeConnect += nTime3 - nTime2;\n    LogPrint(BCLog::BENCH, \"      - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs (%.2fms/blk)]\\n\", (unsigned)block.vtx.size(), MILLI * (nTime3 - nTime2), MILLI * (nTime3 - nTime2) / block.vtx.size(), nInputs <= 1 ? 0 : MILLI * (nTime3 - nTime2) / (nInputs-1), nTimeConnect * MICRO, nTimeConnect * MILLI / nBlocksTotal);\n\n    CAmount blockReward = nFees + GetBlockSubsidy(pindex->nHeight, chainparams.GetConsensus());\n    if (block.vtx[0]->GetValueOut() > blockReward)\n        return state.DoS(100,\n                         error(\"ConnectBlock(): coinbase pays too much (actual=%d vs limit=%d)\",\n                               block.vtx[0]->GetValueOut(), blockReward),\n                               REJECT_INVALID, \"bad-cb-amount\");\n\n    if (!control.Wait())\n        return state.DoS(100, error(\"%s: CheckQueue failed\", __func__), REJECT_INVALID, \"block-validation-failed\");\n    int64_t nTime4 = GetTimeMicros(); nTimeVerify += nTime4 - nTime2;\n    LogPrint(BCLog::BENCH, \"    - Verify %u txins: %.2fms (%.3fms/txin) [%.2fs (%.2fms/blk)]\\n\", nInputs - 1, MILLI * (nTime4 - nTime2), nInputs <= 1 ? 0 : MILLI * (nTime4 - nTime2) / (nInputs-1), nTimeVerify * MICRO, nTimeVerify * MILLI / nBlocksTotal);\n\n    if (fJustCheck)\n        return true;\n\n    if (!WriteUndoDataForBlock(blockundo, state, pindex, chainparams))\n        return false;\n\n    if (!pindex->IsValid(BLOCK_VALID_SCRIPTS)) {\n        pindex->RaiseValidity(BLOCK_VALID_SCRIPTS);\n        setDirtyBlockIndex.insert(pindex);\n    }\n\n    if (!WriteTxIndexDataForBlock(block, state, pindex))\n        return false;\n\n    assert(pindex->phashBlock);\n    // add this block to the view's block chain\n    view.SetBestBlock(pindex->GetBlockHash());\n\n    int64_t nTime5 = GetTimeMicros(); nTimeIndex += nTime5 - nTime4;\n    LogPrint(BCLog::BENCH, \"    - Index writing: %.2fms [%.2fs (%.2fms/blk)]\\n\", MILLI * (nTime5 - nTime4), nTimeIndex * MICRO, nTimeIndex * MILLI / nBlocksTotal);\n\n    int64_t nTime6 = GetTimeMicros(); nTimeCallbacks += nTime6 - nTime5;\n    LogPrint(BCLog::BENCH, \"    - Callbacks: %.2fms [%.2fs (%.2fms/blk)]\\n\", MILLI * (nTime6 - nTime5), nTimeCallbacks * MICRO, nTimeCallbacks * MILLI / nBlocksTotal);\n\n    return true;\n}\n\n/**\n * Update the on-disk chain state.\n * The caches and indexes are flushed depending on the mode we're called with\n * if they're too large, if it's been a while since the last write,\n * or always and in all cases if we're in prune mode and are deleting files.\n */\nbool static FlushStateToDisk(const CChainParams& chainparams, CValidationState &state, FlushStateMode mode, int nManualPruneHeight) {\n    int64_t nMempoolUsage = mempool.DynamicMemoryUsage();\n    LOCK(cs_main);\n    static int64_t nLastWrite = 0;\n    static int64_t nLastFlush = 0;\n    static int64_t nLastSetChain = 0;\n    std::set<int> setFilesToPrune;\n    bool fFlushForPrune = false;\n    bool fDoFullFlush = false;\n    int64_t nNow = 0;\n    try {\n    {\n        LOCK(cs_LastBlockFile);\n        if (fPruneMode && (fCheckForPruning || nManualPruneHeight > 0) && !fReindex) {\n            if (nManualPruneHeight > 0) {\n                FindFilesToPruneManual(setFilesToPrune, nManualPruneHeight);\n            } else {\n                FindFilesToPrune(setFilesToPrune, chainparams.PruneAfterHeight());\n                fCheckForPruning = false;\n            }\n            if (!setFilesToPrune.empty()) {\n                fFlushForPrune = true;\n                if (!fHavePruned) {\n                    pblocktree->WriteFlag(\"prunedblockfiles\", true);\n                    fHavePruned = true;\n                }\n            }\n        }\n        nNow = GetTimeMicros();\n        // Avoid writing/flushing immediately after startup.\n        if (nLastWrite == 0) {\n            nLastWrite = nNow;\n        }\n        if (nLastFlush == 0) {\n            nLastFlush = nNow;\n        }\n        if (nLastSetChain == 0) {\n            nLastSetChain = nNow;\n        }\n        int64_t nMempoolSizeMax = gArgs.GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;\n        int64_t cacheSize = pcoinsTip->DynamicMemoryUsage();\n        int64_t nTotalSpace = nCoinCacheUsage + std::max<int64_t>(nMempoolSizeMax - nMempoolUsage, 0);\n        // The cache is large and we're within 10% and 10 MiB of the limit, but we have time now (not in the middle of a block processing).\n        bool fCacheLarge = mode == FLUSH_STATE_PERIODIC && cacheSize > std::max((9 * nTotalSpace) / 10, nTotalSpace - MAX_BLOCK_COINSDB_USAGE * 1024 * 1024);\n        // The cache is over the limit, we have to write now.\n        bool fCacheCritical = mode == FLUSH_STATE_IF_NEEDED && cacheSize > nTotalSpace;\n        // It's been a while since we wrote the block index to disk. Do this frequently, so we don't need to redownload after a crash.\n        bool fPeriodicWrite = mode == FLUSH_STATE_PERIODIC && nNow > nLastWrite + (int64_t)DATABASE_WRITE_INTERVAL * 1000000;\n        // It's been very long since we flushed the cache. Do this infrequently, to optimize cache usage.\n        bool fPeriodicFlush = mode == FLUSH_STATE_PERIODIC && nNow > nLastFlush + (int64_t)DATABASE_FLUSH_INTERVAL * 1000000;\n        // Combine all conditions that result in a full cache flush.\n        fDoFullFlush = (mode == FLUSH_STATE_ALWAYS) || fCacheLarge || fCacheCritical || fPeriodicFlush || fFlushForPrune;\n        // Write blocks and block index to disk.\n        if (fDoFullFlush || fPeriodicWrite) {\n            // Depend on nMinDiskSpace to ensure we can write block index\n            if (!CheckDiskSpace(0))\n                return state.Error(\"out of disk space\");\n            // First make sure all block and undo data is flushed to disk.\n            FlushBlockFile();\n            // Then update all block file information (which may refer to block and undo files).\n            {\n                std::vector<std::pair<int, const CBlockFileInfo*> > vFiles;\n                vFiles.reserve(setDirtyFileInfo.size());\n                for (std::set<int>::iterator it = setDirtyFileInfo.begin(); it != setDirtyFileInfo.end(); ) {\n                    vFiles.push_back(std::make_pair(*it, &vinfoBlockFile[*it]));\n                    setDirtyFileInfo.erase(it++);\n                }\n                std::vector<const CBlockIndex*> vBlocks;\n                vBlocks.reserve(setDirtyBlockIndex.size());\n                for (std::set<CBlockIndex*>::iterator it = setDirtyBlockIndex.begin(); it != setDirtyBlockIndex.end(); ) {\n                    vBlocks.push_back(*it);\n                    setDirtyBlockIndex.erase(it++);\n                }\n                if (!pblocktree->WriteBatchSync(vFiles, nLastBlockFile, vBlocks)) {\n                    return AbortNode(state, \"Failed to write to block index database\");\n                }\n            }\n            // Finally remove any pruned files\n            if (fFlushForPrune)\n                UnlinkPrunedFiles(setFilesToPrune);\n            nLastWrite = nNow;\n        }\n        // Flush best chain related state. This can only be done if the blocks / block index write was also done.\n        if (fDoFullFlush && !pcoinsTip->GetBestBlock().IsNull()) {\n            // Typical Coin structures on disk are around 48 bytes in size.\n            // Pushing a new one to the database can cause it to be written\n            // twice (once in the log, and once in the tables). This is already\n            // an overestimation, as most will delete an existing entry or\n            // overwrite one. Still, use a conservative safety factor of 2.\n            if (!CheckDiskSpace(48 * 2 * 2 * pcoinsTip->GetCacheSize()))\n                return state.Error(\"out of disk space\");\n            // Flush the chainstate (which may refer to block index entries).\n            if (!pcoinsTip->Flush())\n                return AbortNode(state, \"Failed to write to coin database\");\n            nLastFlush = nNow;\n        }\n    }\n    if (fDoFullFlush || ((mode == FLUSH_STATE_ALWAYS || mode == FLUSH_STATE_PERIODIC) && nNow > nLastSetChain + (int64_t)DATABASE_WRITE_INTERVAL * 1000000)) {\n        // Update best block in wallet (so we can detect restored wallets).\n        GetMainSignals().SetBestChain(chainActive.GetLocator());\n        nLastSetChain = nNow;\n    }\n    } catch (const std::runtime_error& e) {\n        return AbortNode(state, std::string(\"System error while flushing: \") + e.what());\n    }\n    return true;\n}\n\nvoid FlushStateToDisk() {\n    CValidationState state;\n    const CChainParams& chainparams = Params();\n    FlushStateToDisk(chainparams, state, FLUSH_STATE_ALWAYS);\n}\n\nvoid PruneAndFlush() {\n    CValidationState state;\n    fCheckForPruning = true;\n    const CChainParams& chainparams = Params();\n    FlushStateToDisk(chainparams, state, FLUSH_STATE_NONE);\n}\n\nstatic void DoWarning(const std::string& strWarning)\n{\n    static bool fWarned = false;\n    SetMiscWarning(strWarning);\n    if (!fWarned) {\n        AlertNotify(strWarning);\n        fWarned = true;\n    }\n}\n\n/** Check warning conditions and do some notifications on new chain tip set. */\nvoid static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainParams) {\n    // New best block\n    mempool.AddTransactionsUpdated(1);\n\n    {\n        WaitableLock lock(csBestBlock);\n        hashBestBlock = pindexNew->GetBlockHash();\n        cvBlockChange.notify_all();\n    }\n\n    std::vector<std::string> warningMessages;\n    if (!IsInitialBlockDownload())\n    {\n        int nUpgraded = 0;\n        const CBlockIndex* pindex = pindexNew;\n        for (int bit = 0; bit < VERSIONBITS_NUM_BITS; bit++) {\n            WarningBitsConditionChecker checker(bit);\n            ThresholdState state = checker.GetStateFor(pindex, chainParams.GetConsensus(), warningcache[bit]);\n            if (state == THRESHOLD_ACTIVE || state == THRESHOLD_LOCKED_IN) {\n                const std::string strWarning = strprintf(_(\"Warning: unknown new rules activated (versionbit %i)\"), bit);\n                if (state == THRESHOLD_ACTIVE) {\n                    DoWarning(strWarning);\n                } else {\n                    warningMessages.push_back(strWarning);\n                }\n            }\n        }\n        // Check the version of the last 100 blocks to see if we need to upgrade:\n        for (int i = 0; i < 100 && pindex != nullptr; i++)\n        {\n            int32_t nExpectedVersion = ComputeBlockVersion(pindex->pprev, chainParams.GetConsensus());\n            if (pindex->nVersion > VERSIONBITS_LAST_OLD_BLOCK_VERSION && (pindex->nVersion & ~nExpectedVersion) != 0)\n                ++nUpgraded;\n            pindex = pindex->pprev;\n        }\n        if (nUpgraded > 0)\n            warningMessages.push_back(strprintf(_(\"%d of last 100 blocks have unexpected version\"), nUpgraded));\n        if (nUpgraded > 100/2)\n        {\n            std::string strWarning = _(\"Warning: Unknown block versions being mined! It's possible unknown rules are in effect\");\n            // notify GetWarnings(), called by Qt and the JSON-RPC code to warn the user:\n            DoWarning(strWarning);\n        }\n    }\n    LogPrintf(\"%s: new best=%s height=%d version=0x%08x log2_work=%.8g tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)\", __func__,\n      pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, pindexNew->nVersion,\n      log(pindexNew->nChainWork.getdouble())/log(2.0), (unsigned long)pindexNew->nChainTx,\n      DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", pindexNew->GetBlockTime()),\n      GuessVerificationProgress(chainParams.TxData(), pindexNew), pcoinsTip->DynamicMemoryUsage() * (1.0 / (1<<20)), pcoinsTip->GetCacheSize());\n    if (!warningMessages.empty())\n        LogPrintf(\" warning='%s'\", boost::algorithm::join(warningMessages, \", \"));\n    LogPrintf(\"\\n\");\n\n}\n\n/** Disconnect chainActive's tip.\n  * After calling, the mempool will be in an inconsistent state, with\n  * transactions from disconnected blocks being added to disconnectpool.  You\n  * should make the mempool consistent again by calling UpdateMempoolForReorg.\n  * with cs_main held.\n  *\n  * If disconnectpool is nullptr, then no disconnected transactions are added to\n  * disconnectpool (note that the caller is responsible for mempool consistency\n  * in any case).\n  */\nbool CChainState::DisconnectTip(CValidationState& state, const CChainParams& chainparams, DisconnectedBlockTransactions *disconnectpool)\n{\n    CBlockIndex *pindexDelete = chainActive.Tip();\n    assert(pindexDelete);\n    // Read block from disk.\n    std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();\n    CBlock& block = *pblock;\n    if (!ReadBlockFromDisk(block, pindexDelete, chainparams.GetConsensus()))\n        return AbortNode(state, \"Failed to read block\");\n    // Apply the block atomically to the chain state.\n    int64_t nStart = GetTimeMicros();\n    {\n        CCoinsViewCache view(pcoinsTip.get());\n        assert(view.GetBestBlock() == pindexDelete->GetBlockHash());\n        if (DisconnectBlock(block, pindexDelete, view) != DISCONNECT_OK)\n            return error(\"DisconnectTip(): DisconnectBlock %s failed\", pindexDelete->GetBlockHash().ToString());\n        bool flushed = view.Flush();\n        assert(flushed);\n    }\n    LogPrint(BCLog::BENCH, \"- Disconnect block: %.2fms\\n\", (GetTimeMicros() - nStart) * MILLI);\n    // Write the chain state to disk, if necessary.\n    if (!FlushStateToDisk(chainparams, state, FLUSH_STATE_IF_NEEDED))\n        return false;\n\n    if (disconnectpool) {\n        // Save transactions to re-add to mempool at end of reorg\n        for (auto it = block.vtx.rbegin(); it != block.vtx.rend(); ++it) {\n            disconnectpool->addTransaction(*it);\n        }\n        while (disconnectpool->DynamicMemoryUsage() > MAX_DISCONNECTED_TX_POOL_SIZE * 1000) {\n            // Drop the earliest entry, and remove its children from the mempool.\n            auto it = disconnectpool->queuedTx.get<insertion_order>().begin();\n            mempool.removeRecursive(**it, MemPoolRemovalReason::REORG);\n            disconnectpool->removeEntry(it);\n        }\n    }\n\n    chainActive.SetTip(pindexDelete->pprev);\n\n    UpdateTip(pindexDelete->pprev, chainparams);\n    // Let wallets know transactions went from 1-confirmed to\n    // 0-confirmed or conflicted:\n    GetMainSignals().BlockDisconnected(pblock);\n    return true;\n}\n\nstatic int64_t nTimeReadFromDisk = 0;\nstatic int64_t nTimeConnectTotal = 0;\nstatic int64_t nTimeFlush = 0;\nstatic int64_t nTimeChainState = 0;\nstatic int64_t nTimePostConnect = 0;\n\nstruct PerBlockConnectTrace {\n    CBlockIndex* pindex = nullptr;\n    std::shared_ptr<const CBlock> pblock;\n    std::shared_ptr<std::vector<CTransactionRef>> conflictedTxs;\n    PerBlockConnectTrace() : conflictedTxs(std::make_shared<std::vector<CTransactionRef>>()) {}\n};\n/**\n * Used to track blocks whose transactions were applied to the UTXO state as a\n * part of a single ActivateBestChainStep call.\n *\n * This class also tracks transactions that are removed from the mempool as\n * conflicts (per block) and can be used to pass all those transactions\n * through SyncTransaction.\n *\n * This class assumes (and asserts) that the conflicted transactions for a given\n * block are added via mempool callbacks prior to the BlockConnected() associated\n * with those transactions. If any transactions are marked conflicted, it is\n * assumed that an associated block will always be added.\n *\n * This class is single-use, once you call GetBlocksConnected() you have to throw\n * it away and make a new one.\n */\nclass ConnectTrace {\nprivate:\n    std::vector<PerBlockConnectTrace> blocksConnected;\n    CTxMemPool &pool;\n\npublic:\n    explicit ConnectTrace(CTxMemPool &_pool) : blocksConnected(1), pool(_pool) {\n        pool.NotifyEntryRemoved.connect(boost::bind(&ConnectTrace::NotifyEntryRemoved, this, _1, _2));\n    }\n\n    ~ConnectTrace() {\n        pool.NotifyEntryRemoved.disconnect(boost::bind(&ConnectTrace::NotifyEntryRemoved, this, _1, _2));\n    }\n\n    void BlockConnected(CBlockIndex* pindex, std::shared_ptr<const CBlock> pblock) {\n        assert(!blocksConnected.back().pindex);\n        assert(pindex);\n        assert(pblock);\n        blocksConnected.back().pindex = pindex;\n        blocksConnected.back().pblock = std::move(pblock);\n        blocksConnected.emplace_back();\n    }\n\n    std::vector<PerBlockConnectTrace>& GetBlocksConnected() {\n        // We always keep one extra block at the end of our list because\n        // blocks are added after all the conflicted transactions have\n        // been filled in. Thus, the last entry should always be an empty\n        // one waiting for the transactions from the next block. We pop\n        // the last entry here to make sure the list we return is sane.\n        assert(!blocksConnected.back().pindex);\n        assert(blocksConnected.back().conflictedTxs->empty());\n        blocksConnected.pop_back();\n        return blocksConnected;\n    }\n\n    void NotifyEntryRemoved(CTransactionRef txRemoved, MemPoolRemovalReason reason) {\n        assert(!blocksConnected.back().pindex);\n        if (reason == MemPoolRemovalReason::CONFLICT) {\n            blocksConnected.back().conflictedTxs->emplace_back(std::move(txRemoved));\n        }\n    }\n};\n\n/**\n * Connect a new block to chainActive. pblock is either nullptr or a pointer to a CBlock\n * corresponding to pindexNew, to bypass loading it again from disk.\n *\n * The block is added to connectTrace if connection succeeds.\n */\nbool CChainState::ConnectTip(CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexNew, const std::shared_ptr<const CBlock>& pblock, ConnectTrace& connectTrace, DisconnectedBlockTransactions &disconnectpool)\n{\n    assert(pindexNew->pprev == chainActive.Tip());\n    // Read block from disk.\n    int64_t nTime1 = GetTimeMicros();\n    std::shared_ptr<const CBlock> pthisBlock;\n    if (!pblock) {\n        std::shared_ptr<CBlock> pblockNew = std::make_shared<CBlock>();\n        if (!ReadBlockFromDisk(*pblockNew, pindexNew, chainparams.GetConsensus()))\n            return AbortNode(state, \"Failed to read block\");\n        pthisBlock = pblockNew;\n    } else {\n        pthisBlock = pblock;\n    }\n    const CBlock& blockConnecting = *pthisBlock;\n    // Apply the block atomically to the chain state.\n    int64_t nTime2 = GetTimeMicros(); nTimeReadFromDisk += nTime2 - nTime1;\n    int64_t nTime3;\n    LogPrint(BCLog::BENCH, \"  - Load block from disk: %.2fms [%.2fs]\\n\", (nTime2 - nTime1) * MILLI, nTimeReadFromDisk * MICRO);\n    {\n        CCoinsViewCache view(pcoinsTip.get());\n        bool rv = ConnectBlock(blockConnecting, state, pindexNew, view, chainparams);\n        GetMainSignals().BlockChecked(blockConnecting, state);\n        if (!rv) {\n            if (state.IsInvalid())\n                InvalidBlockFound(pindexNew, state);\n            return error(\"ConnectTip(): ConnectBlock %s failed\", pindexNew->GetBlockHash().ToString());\n        }\n        nTime3 = GetTimeMicros(); nTimeConnectTotal += nTime3 - nTime2;\n        LogPrint(BCLog::BENCH, \"  - Connect total: %.2fms [%.2fs (%.2fms/blk)]\\n\", (nTime3 - nTime2) * MILLI, nTimeConnectTotal * MICRO, nTimeConnectTotal * MILLI / nBlocksTotal);\n        bool flushed = view.Flush();\n        assert(flushed);\n    }\n    int64_t nTime4 = GetTimeMicros(); nTimeFlush += nTime4 - nTime3;\n    LogPrint(BCLog::BENCH, \"  - Flush: %.2fms [%.2fs (%.2fms/blk)]\\n\", (nTime4 - nTime3) * MILLI, nTimeFlush * MICRO, nTimeFlush * MILLI / nBlocksTotal);\n    // Write the chain state to disk, if necessary.\n    if (!FlushStateToDisk(chainparams, state, FLUSH_STATE_IF_NEEDED))\n        return false;\n    int64_t nTime5 = GetTimeMicros(); nTimeChainState += nTime5 - nTime4;\n    LogPrint(BCLog::BENCH, \"  - Writing chainstate: %.2fms [%.2fs (%.2fms/blk)]\\n\", (nTime5 - nTime4) * MILLI, nTimeChainState * MICRO, nTimeChainState * MILLI / nBlocksTotal);\n    // Remove conflicting transactions from the mempool.;\n    mempool.removeForBlock(blockConnecting.vtx, pindexNew->nHeight);\n    disconnectpool.removeForBlock(blockConnecting.vtx);\n    // Update chainActive & related variables.\n    chainActive.SetTip(pindexNew);\n    UpdateTip(pindexNew, chainparams);\n\n    int64_t nTime6 = GetTimeMicros(); nTimePostConnect += nTime6 - nTime5; nTimeTotal += nTime6 - nTime1;\n    LogPrint(BCLog::BENCH, \"  - Connect postprocess: %.2fms [%.2fs (%.2fms/blk)]\\n\", (nTime6 - nTime5) * MILLI, nTimePostConnect * MICRO, nTimePostConnect * MILLI / nBlocksTotal);\n    LogPrint(BCLog::BENCH, \"- Connect block: %.2fms [%.2fs (%.2fms/blk)]\\n\", (nTime6 - nTime1) * MILLI, nTimeTotal * MICRO, nTimeTotal * MILLI / nBlocksTotal);\n\n    connectTrace.BlockConnected(pindexNew, std::move(pthisBlock));\n    return true;\n}\n\n/**\n * Return the tip of the chain with the most work in it, that isn't\n * known to be invalid (it's however far from certain to be valid).\n */\nCBlockIndex* CChainState::FindMostWorkChain() {\n    do {\n        CBlockIndex *pindexNew = nullptr;\n\n        // Find the best candidate header.\n        {\n            std::set<CBlockIndex*, CBlockIndexWorkComparator>::reverse_iterator it = setBlockIndexCandidates.rbegin();\n            if (it == setBlockIndexCandidates.rend())\n                return nullptr;\n            pindexNew = *it;\n        }\n\n        // Check whether all blocks on the path between the currently active chain and the candidate are valid.\n        // Just going until the active chain is an optimization, as we know all blocks in it are valid already.\n        CBlockIndex *pindexTest = pindexNew;\n        bool fInvalidAncestor = false;\n        while (pindexTest && !chainActive.Contains(pindexTest)) {\n            assert(pindexTest->nChainTx || pindexTest->nHeight == 0);\n\n            // Pruned nodes may have entries in setBlockIndexCandidates for\n            // which block files have been deleted.  Remove those as candidates\n            // for the most work chain if we come across them; we can't switch\n            // to a chain unless we have all the non-active-chain parent blocks.\n            bool fFailedChain = pindexTest->nStatus & BLOCK_FAILED_MASK;\n            bool fMissingData = !(pindexTest->nStatus & BLOCK_HAVE_DATA);\n            if (fFailedChain || fMissingData) {\n                // Candidate chain is not usable (either invalid or missing data)\n                if (fFailedChain && (pindexBestInvalid == nullptr || pindexNew->nChainWork > pindexBestInvalid->nChainWork))\n                    pindexBestInvalid = pindexNew;\n                CBlockIndex *pindexFailed = pindexNew;\n                // Remove the entire chain from the set.\n                while (pindexTest != pindexFailed) {\n                    if (fFailedChain) {\n                        pindexFailed->nStatus |= BLOCK_FAILED_CHILD;\n                    } else if (fMissingData) {\n                        // If we're missing data, then add back to mapBlocksUnlinked,\n                        // so that if the block arrives in the future we can try adding\n                        // to setBlockIndexCandidates again.\n                        mapBlocksUnlinked.insert(std::make_pair(pindexFailed->pprev, pindexFailed));\n                    }\n                    setBlockIndexCandidates.erase(pindexFailed);\n                    pindexFailed = pindexFailed->pprev;\n                }\n                setBlockIndexCandidates.erase(pindexTest);\n                fInvalidAncestor = true;\n                break;\n            }\n            pindexTest = pindexTest->pprev;\n        }\n        if (!fInvalidAncestor)\n            return pindexNew;\n    } while(true);\n}\n\n/** Delete all entries in setBlockIndexCandidates that are worse than the current tip. */\nvoid CChainState::PruneBlockIndexCandidates() {\n    // Note that we can't delete the current block itself, as we may need to return to it later in case a\n    // reorganization to a better block fails.\n    std::set<CBlockIndex*, CBlockIndexWorkComparator>::iterator it = setBlockIndexCandidates.begin();\n    while (it != setBlockIndexCandidates.end() && setBlockIndexCandidates.value_comp()(*it, chainActive.Tip())) {\n        setBlockIndexCandidates.erase(it++);\n    }\n    // Either the current tip or a successor of it we're working towards is left in setBlockIndexCandidates.\n    assert(!setBlockIndexCandidates.empty());\n}\n\n/**\n * Try to make some progress towards making pindexMostWork the active block.\n * pblock is either nullptr or a pointer to a CBlock corresponding to pindexMostWork.\n */\nbool CChainState::ActivateBestChainStep(CValidationState& state, const CChainParams& chainparams, CBlockIndex* pindexMostWork, const std::shared_ptr<const CBlock>& pblock, bool& fInvalidFound, ConnectTrace& connectTrace)\n{\n    AssertLockHeld(cs_main);\n\n    const CBlockIndex *pindexOldTip = chainActive.Tip();\n    const CBlockIndex *pindexFork = chainActive.FindFork(pindexMostWork);\n\n    // Disconnect active blocks which are no longer in the best chain.\n    bool fBlocksDisconnected = false;\n    DisconnectedBlockTransactions disconnectpool;\n    while (chainActive.Tip() && chainActive.Tip() != pindexFork) {\n        if (!DisconnectTip(state, chainparams, &disconnectpool)) {\n            // This is likely a fatal error, but keep the mempool consistent,\n            // just in case. Only remove from the mempool in this case.\n            UpdateMempoolForReorg(disconnectpool, false);\n            return false;\n        }\n        fBlocksDisconnected = true;\n    }\n\n    // Build list of new blocks to connect.\n    std::vector<CBlockIndex*> vpindexToConnect;\n    bool fContinue = true;\n    int nHeight = pindexFork ? pindexFork->nHeight : -1;\n    while (fContinue && nHeight != pindexMostWork->nHeight) {\n        // Don't iterate the entire list of potential improvements toward the best tip, as we likely only need\n        // a few blocks along the way.\n        int nTargetHeight = std::min(nHeight + 32, pindexMostWork->nHeight);\n        vpindexToConnect.clear();\n        vpindexToConnect.reserve(nTargetHeight - nHeight);\n        CBlockIndex *pindexIter = pindexMostWork->GetAncestor(nTargetHeight);\n        while (pindexIter && pindexIter->nHeight != nHeight) {\n            vpindexToConnect.push_back(pindexIter);\n            pindexIter = pindexIter->pprev;\n        }\n        nHeight = nTargetHeight;\n\n        // Connect new blocks.\n        for (CBlockIndex *pindexConnect : reverse_iterate(vpindexToConnect)) {\n            if (!ConnectTip(state, chainparams, pindexConnect, pindexConnect == pindexMostWork ? pblock : std::shared_ptr<const CBlock>(), connectTrace, disconnectpool)) {\n                if (state.IsInvalid()) {\n                    // The block violates a consensus rule.\n                    if (!state.CorruptionPossible())\n                        InvalidChainFound(vpindexToConnect.back());\n                    state = CValidationState();\n                    fInvalidFound = true;\n                    fContinue = false;\n                    break;\n                } else {\n                    // A system error occurred (disk space, database error, ...).\n                    // Make the mempool consistent with the current tip, just in case\n                    // any observers try to use it before shutdown.\n                    UpdateMempoolForReorg(disconnectpool, false);\n                    return false;\n                }\n            } else {\n                PruneBlockIndexCandidates();\n                if (!pindexOldTip || chainActive.Tip()->nChainWork > pindexOldTip->nChainWork) {\n                    // We're in a better position than we were. Return temporarily to release the lock.\n                    fContinue = false;\n                    break;\n                }\n            }\n        }\n    }\n\n    if (fBlocksDisconnected) {\n        // If any blocks were disconnected, disconnectpool may be non empty.  Add\n        // any disconnected transactions back to the mempool.\n        UpdateMempoolForReorg(disconnectpool, true);\n    }\n    mempool.check(pcoinsTip.get());\n\n    // Callbacks/notifications for a new best chain.\n    if (fInvalidFound)\n        CheckForkWarningConditionsOnNewFork(vpindexToConnect.back());\n    else\n        CheckForkWarningConditions();\n\n    return true;\n}\n\nstatic bool NotifyHeaderTip() {\n    bool fNotify = false;\n    bool fInitialBlockDownload = false;\n    static CBlockIndex* pindexHeaderOld = nullptr;\n    CBlockIndex* pindexHeader = nullptr;\n    {\n        LOCK(cs_main);\n        pindexHeader = pindexBestHeader;\n\n        if (pindexHeader != pindexHeaderOld) {\n            fNotify = true;\n            fInitialBlockDownload = IsInitialBlockDownload();\n            pindexHeaderOld = pindexHeader;\n        }\n    }\n    // Send block tip changed notifications without cs_main\n    if (fNotify) {\n        uiInterface.NotifyHeaderTip(fInitialBlockDownload, pindexHeader);\n    }\n    return fNotify;\n}\n\n/**\n * Make the best chain active, in multiple steps. The result is either failure\n * or an activated best chain. pblock is either nullptr or a pointer to a block\n * that is already loaded (to avoid loading it again from disk).\n */\nbool CChainState::ActivateBestChain(CValidationState &state, const CChainParams& chainparams, std::shared_ptr<const CBlock> pblock) {\n    // Note that while we're often called here from ProcessNewBlock, this is\n    // far from a guarantee. Things in the P2P/RPC will often end up calling\n    // us in the middle of ProcessNewBlock - do not assume pblock is set\n    // sanely for performance or correctness!\n    AssertLockNotHeld(cs_main);\n\n    // ABC maintains a fair degree of expensive-to-calculate internal state\n    // because this function periodically releases cs_main so that it does not lock up other threads for too long\n    // during large connects - and to allow for e.g. the callback queue to drain\n    // we use m_cs_chainstate to enforce mutual exclusion so that only one caller may execute this function at a time\n    LOCK(m_cs_chainstate);\n\n    CBlockIndex *pindexMostWork = nullptr;\n    CBlockIndex *pindexNewTip = nullptr;\n    int nStopAtHeight = gArgs.GetArg(\"-stopatheight\", DEFAULT_STOPATHEIGHT);\n    do {\n        boost::this_thread::interruption_point();\n\n        if (GetMainSignals().CallbacksPending() > 10) {\n            // Block until the validation queue drains. This should largely\n            // never happen in normal operation, however may happen during\n            // reindex, causing memory blowup  if we run too far ahead.\n            SyncWithValidationInterfaceQueue();\n        }\n\n        {\n            LOCK(cs_main);\n            CBlockIndex* starting_tip = chainActive.Tip();\n            bool blocks_connected = false;\n            do {\n                // We absolutely may not unlock cs_main until we've made forward progress\n                // (with the exception of shutdown due to hardware issues, low disk space, etc).\n                ConnectTrace connectTrace(mempool); // Destructed before cs_main is unlocked\n\n                if (pindexMostWork == nullptr) {\n                    pindexMostWork = FindMostWorkChain();\n                }\n\n                // Whether we have anything to do at all.\n                if (pindexMostWork == nullptr || pindexMostWork == chainActive.Tip()) {\n                    break;\n                }\n\n                bool fInvalidFound = false;\n                std::shared_ptr<const CBlock> nullBlockPtr;\n                if (!ActivateBestChainStep(state, chainparams, pindexMostWork, pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : nullBlockPtr, fInvalidFound, connectTrace))\n                    return false;\n                blocks_connected = true;\n\n                if (fInvalidFound) {\n                    // Wipe cache, we may need another branch now.\n                    pindexMostWork = nullptr;\n                }\n                pindexNewTip = chainActive.Tip();\n\n                for (const PerBlockConnectTrace& trace : connectTrace.GetBlocksConnected()) {\n                    assert(trace.pblock && trace.pindex);\n                    GetMainSignals().BlockConnected(trace.pblock, trace.pindex, trace.conflictedTxs);\n                }\n            } while (!chainActive.Tip() || (starting_tip && CBlockIndexWorkComparator()(chainActive.Tip(), starting_tip)));\n            if (!blocks_connected) return true;\n\n            const CBlockIndex* pindexFork = chainActive.FindFork(starting_tip);\n            bool fInitialDownload = IsInitialBlockDownload();\n\n            // Notify external listeners about the new tip.\n            // Enqueue while holding cs_main to ensure that UpdatedBlockTip is called in the order in which blocks are connected\n            if (pindexFork != pindexNewTip) {\n                // Notify ValidationInterface subscribers\n                GetMainSignals().UpdatedBlockTip(pindexNewTip, pindexFork, fInitialDownload);\n\n                // Always notify the UI if a new block tip was connected\n                uiInterface.NotifyBlockTip(fInitialDownload, pindexNewTip);\n            }\n        }\n        // When we reach this point, we switched to a new tip (stored in pindexNewTip).\n\n        if (nStopAtHeight && pindexNewTip && pindexNewTip->nHeight >= nStopAtHeight) StartShutdown();\n\n        // We check shutdown only after giving ActivateBestChainStep a chance to run once so that we\n        // never shutdown before connecting the genesis block during LoadChainTip(). Previously this\n        // caused an assert() failure during shutdown in such cases as the UTXO DB flushing checks\n        // that the best block hash is non-null.\n        if (ShutdownRequested())\n            break;\n    } while (pindexNewTip != pindexMostWork);\n    CheckBlockIndex(chainparams.GetConsensus());\n\n    // Write changes periodically to disk, after relay.\n    if (!FlushStateToDisk(chainparams, state, FLUSH_STATE_PERIODIC)) {\n        return false;\n    }\n\n    return true;\n}\n\nbool ActivateBestChain(CValidationState &state, const CChainParams& chainparams, std::shared_ptr<const CBlock> pblock) {\n    return g_chainstate.ActivateBestChain(state, chainparams, std::move(pblock));\n}\n\nbool CChainState::PreciousBlock(CValidationState& state, const CChainParams& params, CBlockIndex *pindex)\n{\n    {\n        LOCK(cs_main);\n        if (pindex->nChainWork < chainActive.Tip()->nChainWork) {\n            // Nothing to do, this block is not at the tip.\n            return true;\n        }\n        if (chainActive.Tip()->nChainWork > nLastPreciousChainwork) {\n            // The chain has been extended since the last call, reset the counter.\n            nBlockReverseSequenceId = -1;\n        }\n        nLastPreciousChainwork = chainActive.Tip()->nChainWork;\n        setBlockIndexCandidates.erase(pindex);\n        pindex->nSequenceId = nBlockReverseSequenceId;\n        if (nBlockReverseSequenceId > std::numeric_limits<int32_t>::min()) {\n            // We can't keep reducing the counter if somebody really wants to\n            // call preciousblock 2**31-1 times on the same set of tips...\n            nBlockReverseSequenceId--;\n        }\n        if (pindex->IsValid(BLOCK_VALID_TRANSACTIONS) && pindex->nChainTx) {\n            setBlockIndexCandidates.insert(pindex);\n            PruneBlockIndexCandidates();\n        }\n    }\n\n    return ActivateBestChain(state, params, std::shared_ptr<const CBlock>());\n}\nbool PreciousBlock(CValidationState& state, const CChainParams& params, CBlockIndex *pindex) {\n    return g_chainstate.PreciousBlock(state, params, pindex);\n}\n\nbool CChainState::InvalidateBlock(CValidationState& state, const CChainParams& chainparams, CBlockIndex *pindex)\n{\n    AssertLockHeld(cs_main);\n\n    // We first disconnect backwards and then mark the blocks as invalid.\n    // This prevents a case where pruned nodes may fail to invalidateblock\n    // and be left unable to start as they have no tip candidates (as there\n    // are no blocks that meet the \"have data and are not invalid per\n    // nStatus\" criteria for inclusion in setBlockIndexCandidates).\n\n    bool pindex_was_in_chain = false;\n    CBlockIndex *invalid_walk_tip = chainActive.Tip();\n\n    DisconnectedBlockTransactions disconnectpool;\n    while (chainActive.Contains(pindex)) {\n        pindex_was_in_chain = true;\n        // ActivateBestChain considers blocks already in chainActive\n        // unconditionally valid already, so force disconnect away from it.\n        if (!DisconnectTip(state, chainparams, &disconnectpool)) {\n            // It's probably hopeless to try to make the mempool consistent\n            // here if DisconnectTip failed, but we can try.\n            UpdateMempoolForReorg(disconnectpool, false);\n            return false;\n        }\n    }\n\n    // Now mark the blocks we just disconnected as descendants invalid\n    // (note this may not be all descendants).\n    while (pindex_was_in_chain && invalid_walk_tip != pindex) {\n        invalid_walk_tip->nStatus |= BLOCK_FAILED_CHILD;\n        setDirtyBlockIndex.insert(invalid_walk_tip);\n        setBlockIndexCandidates.erase(invalid_walk_tip);\n        invalid_walk_tip = invalid_walk_tip->pprev;\n    }\n\n    // Mark the block itself as invalid.\n    pindex->nStatus |= BLOCK_FAILED_VALID;\n    setDirtyBlockIndex.insert(pindex);\n    setBlockIndexCandidates.erase(pindex);\n    g_failed_blocks.insert(pindex);\n\n    // DisconnectTip will add transactions to disconnectpool; try to add these\n    // back to the mempool.\n    UpdateMempoolForReorg(disconnectpool, true);\n\n    // The resulting new best tip may not be in setBlockIndexCandidates anymore, so\n    // add it again.\n    BlockMap::iterator it = mapBlockIndex.begin();\n    while (it != mapBlockIndex.end()) {\n        if (it->second->IsValid(BLOCK_VALID_TRANSACTIONS) && it->second->nChainTx && !setBlockIndexCandidates.value_comp()(it->second, chainActive.Tip())) {\n            setBlockIndexCandidates.insert(it->second);\n        }\n        it++;\n    }\n\n    InvalidChainFound(pindex);\n    uiInterface.NotifyBlockTip(IsInitialBlockDownload(), pindex->pprev);\n    return true;\n}\nbool InvalidateBlock(CValidationState& state, const CChainParams& chainparams, CBlockIndex *pindex) {\n    return g_chainstate.InvalidateBlock(state, chainparams, pindex);\n}\n\nbool CChainState::ResetBlockFailureFlags(CBlockIndex *pindex) {\n    AssertLockHeld(cs_main);\n\n    int nHeight = pindex->nHeight;\n\n    // Remove the invalidity flag from this block and all its descendants.\n    BlockMap::iterator it = mapBlockIndex.begin();\n    while (it != mapBlockIndex.end()) {\n        if (!it->second->IsValid() && it->second->GetAncestor(nHeight) == pindex) {\n            it->second->nStatus &= ~BLOCK_FAILED_MASK;\n            setDirtyBlockIndex.insert(it->second);\n            if (it->second->IsValid(BLOCK_VALID_TRANSACTIONS) && it->second->nChainTx && setBlockIndexCandidates.value_comp()(chainActive.Tip(), it->second)) {\n                setBlockIndexCandidates.insert(it->second);\n            }\n            if (it->second == pindexBestInvalid) {\n                // Reset invalid block marker if it was pointing to one of those.\n                pindexBestInvalid = nullptr;\n            }\n            g_failed_blocks.erase(it->second);\n        }\n        it++;\n    }\n\n    // Remove the invalidity flag from all ancestors too.\n    while (pindex != nullptr) {\n        if (pindex->nStatus & BLOCK_FAILED_MASK) {\n            pindex->nStatus &= ~BLOCK_FAILED_MASK;\n            setDirtyBlockIndex.insert(pindex);\n            g_failed_blocks.erase(pindex);\n        }\n        pindex = pindex->pprev;\n    }\n    return true;\n}\nbool ResetBlockFailureFlags(CBlockIndex *pindex) {\n    return g_chainstate.ResetBlockFailureFlags(pindex);\n}\n\nCBlockIndex* CChainState::AddToBlockIndex(const CBlockHeader& block)\n{\n    // Check for duplicate\n    uint256 hash = block.GetHash();\n    BlockMap::iterator it = mapBlockIndex.find(hash);\n    if (it != mapBlockIndex.end())\n        return it->second;\n\n    // Construct new block index object\n    CBlockIndex* pindexNew = new CBlockIndex(block);\n    // We assign the sequence id to blocks only when the full data is available,\n    // to avoid miners withholding blocks but broadcasting headers, to get a\n    // competitive advantage.\n    pindexNew->nSequenceId = 0;\n    BlockMap::iterator mi = mapBlockIndex.insert(std::make_pair(hash, pindexNew)).first;\n    pindexNew->phashBlock = &((*mi).first);\n    BlockMap::iterator miPrev = mapBlockIndex.find(block.hashPrevBlock);\n    if (miPrev != mapBlockIndex.end())\n    {\n        pindexNew->pprev = (*miPrev).second;\n        pindexNew->nHeight = pindexNew->pprev->nHeight + 1;\n        pindexNew->BuildSkip();\n    }\n    pindexNew->nTimeMax = (pindexNew->pprev ? std::max(pindexNew->pprev->nTimeMax, pindexNew->nTime) : pindexNew->nTime);\n    pindexNew->nChainWork = (pindexNew->pprev ? pindexNew->pprev->nChainWork : 0) + GetBlockProof(*pindexNew);\n    pindexNew->RaiseValidity(BLOCK_VALID_TREE);\n    if (pindexBestHeader == nullptr || pindexBestHeader->nChainWork < pindexNew->nChainWork)\n        pindexBestHeader = pindexNew;\n\n    setDirtyBlockIndex.insert(pindexNew);\n\n    return pindexNew;\n}\n\n/** Mark a block as having its data received and checked (up to BLOCK_VALID_TRANSACTIONS). */\nbool CChainState::ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBlockIndex *pindexNew, const CDiskBlockPos& pos, const Consensus::Params& consensusParams)\n{\n    pindexNew->nTx = block.vtx.size();\n    pindexNew->nChainTx = 0;\n    pindexNew->nFile = pos.nFile;\n    pindexNew->nDataPos = pos.nPos;\n    pindexNew->nUndoPos = 0;\n    pindexNew->nStatus |= BLOCK_HAVE_DATA;\n    if (IsWitnessEnabled(pindexNew->pprev, consensusParams)) {\n        pindexNew->nStatus |= BLOCK_OPT_WITNESS;\n    }\n    pindexNew->RaiseValidity(BLOCK_VALID_TRANSACTIONS);\n    setDirtyBlockIndex.insert(pindexNew);\n\n    if (pindexNew->pprev == nullptr || pindexNew->pprev->nChainTx) {\n        // If pindexNew is the genesis block or all parents are BLOCK_VALID_TRANSACTIONS.\n        std::deque<CBlockIndex*> queue;\n        queue.push_back(pindexNew);\n\n        // Recursively process any descendant blocks that now may be eligible to be connected.\n        while (!queue.empty()) {\n            CBlockIndex *pindex = queue.front();\n            queue.pop_front();\n            pindex->nChainTx = (pindex->pprev ? pindex->pprev->nChainTx : 0) + pindex->nTx;\n            {\n                LOCK(cs_nBlockSequenceId);\n                pindex->nSequenceId = nBlockSequenceId++;\n            }\n            if (chainActive.Tip() == nullptr || !setBlockIndexCandidates.value_comp()(pindex, chainActive.Tip())) {\n                setBlockIndexCandidates.insert(pindex);\n            }\n            std::pair<std::multimap<CBlockIndex*, CBlockIndex*>::iterator, std::multimap<CBlockIndex*, CBlockIndex*>::iterator> range = mapBlocksUnlinked.equal_range(pindex);\n            while (range.first != range.second) {\n                std::multimap<CBlockIndex*, CBlockIndex*>::iterator it = range.first;\n                queue.push_back(it->second);\n                range.first++;\n                mapBlocksUnlinked.erase(it);\n            }\n        }\n    } else {\n        if (pindexNew->pprev && pindexNew->pprev->IsValid(BLOCK_VALID_TREE)) {\n            mapBlocksUnlinked.insert(std::make_pair(pindexNew->pprev, pindexNew));\n        }\n    }\n\n    return true;\n}\n\nstatic bool FindBlockPos(CDiskBlockPos &pos, unsigned int nAddSize, unsigned int nHeight, uint64_t nTime, bool fKnown = false)\n{\n    LOCK(cs_LastBlockFile);\n\n    unsigned int nFile = fKnown ? pos.nFile : nLastBlockFile;\n    if (vinfoBlockFile.size() <= nFile) {\n        vinfoBlockFile.resize(nFile + 1);\n    }\n\n    if (!fKnown) {\n        while (vinfoBlockFile[nFile].nSize + nAddSize >= MAX_BLOCKFILE_SIZE) {\n            nFile++;\n            if (vinfoBlockFile.size() <= nFile) {\n                vinfoBlockFile.resize(nFile + 1);\n            }\n        }\n        pos.nFile = nFile;\n        pos.nPos = vinfoBlockFile[nFile].nSize;\n    }\n\n    if ((int)nFile != nLastBlockFile) {\n        if (!fKnown) {\n            LogPrintf(\"Leaving block file %i: %s\\n\", nLastBlockFile, vinfoBlockFile[nLastBlockFile].ToString());\n        }\n        FlushBlockFile(!fKnown);\n        nLastBlockFile = nFile;\n    }\n\n    vinfoBlockFile[nFile].AddBlock(nHeight, nTime);\n    if (fKnown)\n        vinfoBlockFile[nFile].nSize = std::max(pos.nPos + nAddSize, vinfoBlockFile[nFile].nSize);\n    else\n        vinfoBlockFile[nFile].nSize += nAddSize;\n\n    if (!fKnown) {\n        unsigned int nOldChunks = (pos.nPos + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE;\n        unsigned int nNewChunks = (vinfoBlockFile[nFile].nSize + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE;\n        if (nNewChunks > nOldChunks) {\n            if (fPruneMode)\n                fCheckForPruning = true;\n            if (CheckDiskSpace(nNewChunks * BLOCKFILE_CHUNK_SIZE - pos.nPos)) {\n                FILE *file = OpenBlockFile(pos);\n                if (file) {\n                    LogPrintf(\"Pre-allocating up to position 0x%x in blk%05u.dat\\n\", nNewChunks * BLOCKFILE_CHUNK_SIZE, pos.nFile);\n                    AllocateFileRange(file, pos.nPos, nNewChunks * BLOCKFILE_CHUNK_SIZE - pos.nPos);\n                    fclose(file);\n                }\n            }\n            else\n                return error(\"out of disk space\");\n        }\n    }\n\n    setDirtyFileInfo.insert(nFile);\n    return true;\n}\n\nstatic bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigned int nAddSize)\n{\n    pos.nFile = nFile;\n\n    LOCK(cs_LastBlockFile);\n\n    unsigned int nNewSize;\n    pos.nPos = vinfoBlockFile[nFile].nUndoSize;\n    nNewSize = vinfoBlockFile[nFile].nUndoSize += nAddSize;\n    setDirtyFileInfo.insert(nFile);\n\n    unsigned int nOldChunks = (pos.nPos + UNDOFILE_CHUNK_SIZE - 1) / UNDOFILE_CHUNK_SIZE;\n    unsigned int nNewChunks = (nNewSize + UNDOFILE_CHUNK_SIZE - 1) / UNDOFILE_CHUNK_SIZE;\n    if (nNewChunks > nOldChunks) {\n        if (fPruneMode)\n            fCheckForPruning = true;\n        if (CheckDiskSpace(nNewChunks * UNDOFILE_CHUNK_SIZE - pos.nPos)) {\n            FILE *file = OpenUndoFile(pos);\n            if (file) {\n                LogPrintf(\"Pre-allocating up to position 0x%x in rev%05u.dat\\n\", nNewChunks * UNDOFILE_CHUNK_SIZE, pos.nFile);\n                AllocateFileRange(file, pos.nPos, nNewChunks * UNDOFILE_CHUNK_SIZE - pos.nPos);\n                fclose(file);\n            }\n        }\n        else\n            return state.Error(\"out of disk space\");\n    }\n\n    return true;\n}\n\nstatic bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true)\n{\n    // Check proof of work matches claimed amount\n    if (fCheckPOW && !CheckProofOfWork(block.GetPoWHash_cached(), block.nBits, consensusParams))\n        return state.DoS(50, false, REJECT_INVALID, \"high-hash\", false, \"proof of work failed\");\n\n    // FIXME.SUGAR // check PoW: SKIPPED during downloading headers (IBD)\n    // You can see this log when IBD.\n    // This means PoW check during IBD is not actually skipped, but still its checking in another places.\n    // What we skipped is only when Downloading headers, but not else. This makes IBD much faster.\n    // if (IsInitialBlockDownload())\n    //     printf(\"%s IBD=%d CBH=%s\\n\", DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", GetTime()).c_str(), IsInitialBlockDownload(), block.GetHash().ToString().c_str());\n\n    return true;\n}\n\nbool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW, bool fCheckMerkleRoot)\n{\n    // These are checks that are independent of context.\n\n    if (block.fChecked)\n        return true;\n\n    // FIXME.SUGAR // check PoW: SKIPPED during downloading headers (IBD)\n    // Check that the header is valid (particularly PoW).  This is mostly\n    // redundant with the call in AcceptBlockHeader, but when IBD mode, its SKIPPED.\n    if (!CheckBlockHeader(block, state, consensusParams, fCheckPOW))\n        return false;\n\n    // Check the merkle root.\n    if (fCheckMerkleRoot) {\n        bool mutated;\n        uint256 hashMerkleRoot2 = BlockMerkleRoot(block, &mutated);\n        if (block.hashMerkleRoot != hashMerkleRoot2)\n            return state.DoS(100, false, REJECT_INVALID, \"bad-txnmrklroot\", true, \"hashMerkleRoot mismatch\");\n\n        // Check for merkle tree malleability (CVE-2012-2459): repeating sequences\n        // of transactions in a block without affecting the merkle root of a block,\n        // while still invalidating it.\n        if (mutated)\n            return state.DoS(100, false, REJECT_INVALID, \"bad-txns-duplicate\", true, \"duplicate transaction\");\n    }\n\n    // All potential-corruption validation must be done before we do any\n    // transaction validation, as otherwise we may mark the header as invalid\n    // because we receive the wrong transactions for it.\n    // Note that witness malleability is checked in ContextualCheckBlock, so no\n    // checks that use witness data may be performed here.\n\n    // Size limits\n    if (block.vtx.empty() || block.vtx.size() * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT)\n        return state.DoS(100, false, REJECT_INVALID, \"bad-blk-length\", false, \"size limits failed\");\n\n    // First transaction must be coinbase, the rest must not be\n    if (block.vtx.empty() || !block.vtx[0]->IsCoinBase())\n        return state.DoS(100, false, REJECT_INVALID, \"bad-cb-missing\", false, \"first tx is not coinbase\");\n    for (unsigned int i = 1; i < block.vtx.size(); i++)\n        if (block.vtx[i]->IsCoinBase())\n            return state.DoS(100, false, REJECT_INVALID, \"bad-cb-multiple\", false, \"more than one coinbase\");\n\n    // Check transactions\n    for (const auto& tx : block.vtx)\n        if (!CheckTransaction(*tx, state, true))\n            return state.Invalid(false, state.GetRejectCode(), state.GetRejectReason(),\n                                 strprintf(\"Transaction check failed (tx hash %s) %s\", tx->GetHash().ToString(), state.GetDebugMessage()));\n\n    unsigned int nSigOps = 0;\n    for (const auto& tx : block.vtx)\n    {\n        nSigOps += GetLegacySigOpCount(*tx);\n    }\n    if (nSigOps * WITNESS_SCALE_FACTOR > MAX_BLOCK_SIGOPS_COST)\n        return state.DoS(100, false, REJECT_INVALID, \"bad-blk-sigops\", false, \"out-of-bounds SigOpCount\");\n\n    if (fCheckPOW && fCheckMerkleRoot)\n        block.fChecked = true;\n\n    return true;\n}\n\nbool IsWitnessEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& params)\n{\n    LOCK(cs_main);\n    return (VersionBitsState(pindexPrev, params, Consensus::DEPLOYMENT_SEGWIT, versionbitscache) == THRESHOLD_ACTIVE);\n}\n\n// Compute at which vout of the block's coinbase transaction the witness\n// commitment occurs, or -1 if not found.\nstatic int GetWitnessCommitmentIndex(const CBlock& block)\n{\n    int commitpos = -1;\n    if (!block.vtx.empty()) {\n        for (size_t o = 0; o < block.vtx[0]->vout.size(); o++) {\n            if (block.vtx[0]->vout[o].scriptPubKey.size() >= 38 && block.vtx[0]->vout[o].scriptPubKey[0] == OP_RETURN && block.vtx[0]->vout[o].scriptPubKey[1] == 0x24 && block.vtx[0]->vout[o].scriptPubKey[2] == 0xaa && block.vtx[0]->vout[o].scriptPubKey[3] == 0x21 && block.vtx[0]->vout[o].scriptPubKey[4] == 0xa9 && block.vtx[0]->vout[o].scriptPubKey[5] == 0xed) {\n                commitpos = o;\n            }\n        }\n    }\n    return commitpos;\n}\n\nvoid UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams)\n{\n    int commitpos = GetWitnessCommitmentIndex(block);\n    static const std::vector<unsigned char> nonce(32, 0x00);\n    if (commitpos != -1 && IsWitnessEnabled(pindexPrev, consensusParams) && !block.vtx[0]->HasWitness()) {\n        CMutableTransaction tx(*block.vtx[0]);\n        tx.vin[0].scriptWitness.stack.resize(1);\n        tx.vin[0].scriptWitness.stack[0] = nonce;\n        block.vtx[0] = MakeTransactionRef(std::move(tx));\n    }\n}\n\nstd::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams)\n{\n    std::vector<unsigned char> commitment;\n    int commitpos = GetWitnessCommitmentIndex(block);\n    std::vector<unsigned char> ret(32, 0x00);\n    if (consensusParams.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout != 0) {\n        if (commitpos == -1) {\n            uint256 witnessroot = BlockWitnessMerkleRoot(block, nullptr);\n            CHash256().Write(witnessroot.begin(), 32).Write(ret.data(), 32).Finalize(witnessroot.begin());\n            CTxOut out;\n            out.nValue = 0;\n            out.scriptPubKey.resize(38);\n            out.scriptPubKey[0] = OP_RETURN;\n            out.scriptPubKey[1] = 0x24;\n            out.scriptPubKey[2] = 0xaa;\n            out.scriptPubKey[3] = 0x21;\n            out.scriptPubKey[4] = 0xa9;\n            out.scriptPubKey[5] = 0xed;\n            memcpy(&out.scriptPubKey[6], witnessroot.begin(), 32);\n            commitment = std::vector<unsigned char>(out.scriptPubKey.begin(), out.scriptPubKey.end());\n            CMutableTransaction tx(*block.vtx[0]);\n            tx.vout.push_back(out);\n            block.vtx[0] = MakeTransactionRef(std::move(tx));\n        }\n    }\n    UpdateUncommittedBlockStructures(block, pindexPrev, consensusParams);\n    return commitment;\n}\n\n/** Context-dependent validity checks.\n *  By \"context\", we mean only the previous block headers, but not the UTXO\n *  set; UTXO-related validity checks are done in ConnectBlock().\n *  NOTE: This function is not currently invoked by ConnectBlock(), so we\n *  should consider upgrade issues if we change which consensus rules are\n *  enforced in this function (eg by adding a new consensus rule). See comment\n *  in ConnectBlock().\n *  Note that -reindex-chainstate skips the validation that happens here!\n */\nstatic bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const CChainParams& params, const CBlockIndex* pindexPrev, int64_t nAdjustedTime)\n{\n    assert(pindexPrev != nullptr);\n    const int nHeight = pindexPrev->nHeight + 1;\n\n    // Check proof of work\n    const Consensus::Params& consensusParams = params.GetConsensus();\n    if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))\n        return state.DoS(100, false, REJECT_INVALID, \"bad-diffbits\", false, \"incorrect proof of work\");\n\n    // Check against checkpoints\n    if (fCheckpointsEnabled) {\n        // Don't accept any forks from the main chain prior to last checkpoint.\n        // GetLastCheckpoint finds the last checkpoint in MapCheckpoints that's in our\n        // MapBlockIndex.\n        CBlockIndex* pcheckpoint = Checkpoints::GetLastCheckpoint(params.Checkpoints());\n        if (pcheckpoint && nHeight < pcheckpoint->nHeight)\n            return state.DoS(100, error(\"%s: forked chain older than last checkpoint (height %d)\", __func__, nHeight), REJECT_CHECKPOINT, \"bad-fork-prior-to-checkpoint\");\n    }\n\n    // Check timestamp against prev\n    if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast())\n        return state.Invalid(false, REJECT_INVALID, \"time-too-old\", \"block's timestamp is too early\");\n\n    // Check timestamp\n    if (block.GetBlockTime() > nAdjustedTime + MAX_FUTURE_BLOCK_TIME)\n        return state.Invalid(false, REJECT_INVALID, \"time-too-new\", \"block timestamp too far in the future\");\n\n    // Reject outdated version blocks when 95% (75% on testnet) of the network has upgraded:\n    // check for version 2, 3 and 4 upgrades\n    if((block.nVersion < 2 && nHeight >= consensusParams.BIP34Height) ||\n       (block.nVersion < 3 && nHeight >= consensusParams.BIP66Height) ||\n       (block.nVersion < 4 && nHeight >= consensusParams.BIP65Height))\n            return state.Invalid(false, REJECT_OBSOLETE, strprintf(\"bad-version(0x%08x)\", block.nVersion),\n                                 strprintf(\"rejected nVersion=0x%08x block\", block.nVersion));\n\n    // FIXME.SUGAR // SURE?\n    if (block.nVersion < VERSIONBITS_TOP_BITS && IsWitnessEnabled(pindexPrev, consensusParams))\n        return state.Invalid(false, REJECT_OBSOLETE, strprintf(\"bad-version(0x%08x)\", block.nVersion),\n                                 strprintf(\"rejected nVersion=0x%08x block\", block.nVersion));\n\n    return true;\n}\n\n/** NOTE: This function is not currently invoked by ConnectBlock(), so we\n *  should consider upgrade issues if we change which consensus rules are\n *  enforced in this function (eg by adding a new consensus rule). See comment\n *  in ConnectBlock().\n *  Note that -reindex-chainstate skips the validation that happens here!\n */\nstatic bool ContextualCheckBlock(const CBlock& block, CValidationState& state, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)\n{\n    const int nHeight = pindexPrev == nullptr ? 0 : pindexPrev->nHeight + 1;\n\n    // Start enforcing BIP113 (Median Time Past) using versionbits logic.\n    int nLockTimeFlags = 0;\n    if (VersionBitsState(pindexPrev, consensusParams, Consensus::DEPLOYMENT_CSV, versionbitscache) == THRESHOLD_ACTIVE) {\n        nLockTimeFlags |= LOCKTIME_MEDIAN_TIME_PAST;\n    }\n\n    int64_t nLockTimeCutoff = (nLockTimeFlags & LOCKTIME_MEDIAN_TIME_PAST)\n                              ? pindexPrev->GetMedianTimePast()\n                              : block.GetBlockTime();\n\n    // Check that all transactions are finalized\n    for (const auto& tx : block.vtx) {\n        if (!IsFinalTx(*tx, nHeight, nLockTimeCutoff)) {\n            return state.DoS(10, false, REJECT_INVALID, \"bad-txns-nonfinal\", false, \"non-final transaction\");\n        }\n    }\n\n    // Enforce rule that the coinbase starts with serialized block height\n    if (nHeight >= consensusParams.BIP34Height)\n    {\n        CScript expect = CScript() << nHeight;\n        if (block.vtx[0]->vin[0].scriptSig.size() < expect.size() ||\n            !std::equal(expect.begin(), expect.end(), block.vtx[0]->vin[0].scriptSig.begin())) {\n            return state.DoS(100, false, REJECT_INVALID, \"bad-cb-height\", false, \"block height mismatch in coinbase\");\n        }\n    }\n\n    // Validation for witness commitments.\n    // * We compute the witness hash (which is the hash including witnesses) of all the block's transactions, except the\n    //   coinbase (where 0x0000....0000 is used instead).\n    // * The coinbase scriptWitness is a stack of a single 32-byte vector, containing a witness nonce (unconstrained).\n    // * We build a merkle tree with all those witness hashes as leaves (similar to the hashMerkleRoot in the block header).\n    // * There must be at least one output whose scriptPubKey is a single 36-byte push, the first 4 bytes of which are\n    //   {0xaa, 0x21, 0xa9, 0xed}, and the following 32 bytes are SHA256^2(witness root, witness nonce). In case there are\n    //   multiple, the last one is used.\n    bool fHaveWitness = false;\n    if (VersionBitsState(pindexPrev, consensusParams, Consensus::DEPLOYMENT_SEGWIT, versionbitscache) == THRESHOLD_ACTIVE) {\n        int commitpos = GetWitnessCommitmentIndex(block);\n        if (commitpos != -1) {\n            bool malleated = false;\n            uint256 hashWitness = BlockWitnessMerkleRoot(block, &malleated);\n            // The malleation check is ignored; as the transaction tree itself\n            // already does not permit it, it is impossible to trigger in the\n            // witness tree.\n            if (block.vtx[0]->vin[0].scriptWitness.stack.size() != 1 || block.vtx[0]->vin[0].scriptWitness.stack[0].size() != 32) {\n                return state.DoS(100, false, REJECT_INVALID, \"bad-witness-nonce-size\", true, strprintf(\"%s : invalid witness nonce size\", __func__));\n            }\n            CHash256().Write(hashWitness.begin(), 32).Write(&block.vtx[0]->vin[0].scriptWitness.stack[0][0], 32).Finalize(hashWitness.begin());\n            if (memcmp(hashWitness.begin(), &block.vtx[0]->vout[commitpos].scriptPubKey[6], 32)) {\n                return state.DoS(100, false, REJECT_INVALID, \"bad-witness-merkle-match\", true, strprintf(\"%s : witness merkle commitment mismatch\", __func__));\n            }\n            fHaveWitness = true;\n        }\n    }\n\n    // No witness data is allowed in blocks that don't commit to witness data, as this would otherwise leave room for spam\n    if (!fHaveWitness) {\n      for (const auto& tx : block.vtx) {\n            if (tx->HasWitness()) {\n                return state.DoS(100, false, REJECT_INVALID, \"unexpected-witness\", true, strprintf(\"%s : unexpected witness data found\", __func__));\n            }\n        }\n    }\n\n    // After the coinbase witness nonce and commitment are verified,\n    // we can check if the block weight passes (before we've checked the\n    // coinbase witness, it would be possible for the weight to be too\n    // large by filling up the coinbase witness, which doesn't change\n    // the block hash, so we couldn't mark the block as permanently\n    // failed).\n    if (GetBlockWeight(block) > MAX_BLOCK_WEIGHT) {\n        return state.DoS(100, false, REJECT_INVALID, \"bad-blk-weight\", false, strprintf(\"%s : weight limit failed\", __func__));\n    }\n\n    return true;\n}\n\nbool CChainState::AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, const CChainParams& chainparams, CBlockIndex** ppindex)\n{\n    AssertLockHeld(cs_main);\n    // Check for duplicate\n    uint256 hash = block.GetHash();\n    BlockMap::iterator miSelf = mapBlockIndex.find(hash);\n    CBlockIndex *pindex = nullptr;\n    if (hash != chainparams.GetConsensus().hashGenesisBlock) {\n\n        if (miSelf != mapBlockIndex.end()) {\n            // Block header is already known.\n            pindex = miSelf->second;\n            if (ppindex)\n                *ppindex = pindex;\n            if (pindex->nStatus & BLOCK_FAILED_MASK)\n                return state.Invalid(error(\"%s: block %s is marked invalid\", __func__, hash.ToString()), 0, \"duplicate\");\n            return true;\n        }\n\n        // FIXME.SUGAR // check PoW: SKIPPED during downloading headers (IBD)\n        // IBD: do not check PoW (Yespower) during Download headers for performance reason\n        if (!IsInitialBlockDownload() && !CheckBlockHeader(block, state, chainparams.GetConsensus()))\n            return error(\"%s: Consensus::CheckBlockHeader: %s, %s\", __func__, hash.ToString(), FormatStateMessage(state));\n\n        // Get prev block index\n        CBlockIndex* pindexPrev = nullptr;\n        BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock);\n        if (mi == mapBlockIndex.end())\n            return state.DoS(10, error(\"%s: prev block not found\", __func__), 0, \"prev-blk-not-found\");\n        pindexPrev = (*mi).second;\n        if (pindexPrev->nStatus & BLOCK_FAILED_MASK)\n            return state.DoS(100, error(\"%s: prev block invalid\", __func__), REJECT_INVALID, \"bad-prevblk\");\n        if (!ContextualCheckBlockHeader(block, state, chainparams, pindexPrev, GetAdjustedTime()))\n            return error(\"%s: Consensus::ContextualCheckBlockHeader: %s, %s\", __func__, hash.ToString(), FormatStateMessage(state));\n\n        if (!pindexPrev->IsValid(BLOCK_VALID_SCRIPTS)) {\n            for (const CBlockIndex* failedit : g_failed_blocks) {\n                if (pindexPrev->GetAncestor(failedit->nHeight) == failedit) {\n                    assert(failedit->nStatus & BLOCK_FAILED_VALID);\n                    CBlockIndex* invalid_walk = pindexPrev;\n                    while (invalid_walk != failedit) {\n                        invalid_walk->nStatus |= BLOCK_FAILED_CHILD;\n                        setDirtyBlockIndex.insert(invalid_walk);\n                        invalid_walk = invalid_walk->pprev;\n                    }\n                    return state.DoS(100, error(\"%s: prev block invalid\", __func__), REJECT_INVALID, \"bad-prevblk\");\n                }\n            }\n        }\n    }\n    if (pindex == nullptr)\n        pindex = AddToBlockIndex(block);\n\n    if (ppindex)\n        *ppindex = pindex;\n\n    CheckBlockIndex(chainparams.GetConsensus());\n\n    return true;\n}\n\n// Exposed wrapper for AcceptBlockHeader\nbool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& headers, CValidationState& state, const CChainParams& chainparams, const CBlockIndex** ppindex, CBlockHeader *first_invalid)\n{\n    if (first_invalid != nullptr) first_invalid->SetNull();\n    {\n        LOCK(cs_main);\n        for (const CBlockHeader& header : headers) {\n            CBlockIndex *pindex = nullptr; // Use a temp pindex instead of ppindex to avoid a const_cast\n            if (!g_chainstate.AcceptBlockHeader(header, state, chainparams, &pindex)) {\n                if (first_invalid) *first_invalid = header;\n                return false;\n            }\n            if (ppindex) {\n                *ppindex = pindex;\n            }\n        }\n    }\n    if (NotifyHeaderTip()) {\n        LOCK(cs_main);\n        if (IsInitialBlockDownload() && ppindex && *ppindex) {\n            LogPrintf(\"sync headers, height: %d (~%.2f%%)\\n\", (*ppindex)->nHeight, 100.0/((*ppindex)->nHeight+(GetAdjustedTime() - (*ppindex)->GetBlockTime()) / Params().GetConsensus().nPowTargetSpacing) * (*ppindex)->nHeight);\n        }\n    }\n    return true;\n}\n\n/** Store block on disk. If dbp is non-nullptr, the file is known to already reside on disk */\nstatic CDiskBlockPos SaveBlockToDisk(const CBlock& block, int nHeight, const CChainParams& chainparams, const CDiskBlockPos* dbp) {\n    unsigned int nBlockSize = ::GetSerializeSize(block, SER_DISK, CLIENT_VERSION);\n    CDiskBlockPos blockPos;\n    if (dbp != nullptr)\n        blockPos = *dbp;\n    if (!FindBlockPos(blockPos, nBlockSize+8, nHeight, block.GetBlockTime(), dbp != nullptr)) {\n        error(\"%s: FindBlockPos failed\", __func__);\n        return CDiskBlockPos();\n    }\n    if (dbp == nullptr) {\n        if (!WriteBlockToDisk(block, blockPos, chainparams.MessageStart())) {\n            AbortNode(\"Failed to write block\");\n            return CDiskBlockPos();\n        }\n    }\n    return blockPos;\n}\n\n/** Store block on disk. If dbp is non-nullptr, the file is known to already reside on disk */\nbool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CValidationState& state, const CChainParams& chainparams, CBlockIndex** ppindex, bool fRequested, const CDiskBlockPos* dbp, bool* fNewBlock)\n{\n    const CBlock& block = *pblock;\n\n    if (fNewBlock) *fNewBlock = false;\n    AssertLockHeld(cs_main);\n\n    CBlockIndex *pindexDummy = nullptr;\n    CBlockIndex *&pindex = ppindex ? *ppindex : pindexDummy;\n\n    if (!AcceptBlockHeader(block, state, chainparams, &pindex))\n        return false;\n\n    // Try to process all requested blocks that we don't have, but only\n    // process an unrequested block if it's new and has enough work to\n    // advance our tip, and isn't too many blocks ahead.\n    bool fAlreadyHave = pindex->nStatus & BLOCK_HAVE_DATA;\n    bool fHasMoreOrSameWork = (chainActive.Tip() ? pindex->nChainWork >= chainActive.Tip()->nChainWork : true);\n    // Blocks that are too out-of-order needlessly limit the effectiveness of\n    // pruning, because pruning will not delete block files that contain any\n    // blocks which are too close in height to the tip.  Apply this test\n    // regardless of whether pruning is enabled; it should generally be safe to\n    // not process unrequested blocks.\n    bool fTooFarAhead = (pindex->nHeight > int(chainActive.Height() + MIN_BLOCKS_TO_KEEP));\n\n    // TODO: Decouple this function from the block download logic by removing fRequested\n    // This requires some new chain data structure to efficiently look up if a\n    // block is in a chain leading to a candidate for best tip, despite not\n    // being such a candidate itself.\n\n    // TODO: deal better with return value and error conditions for duplicate\n    // and unrequested blocks.\n    if (fAlreadyHave) return true;\n    if (!fRequested) {  // If we didn't ask for it:\n        if (pindex->nTx != 0) return true;    // This is a previously-processed block that was pruned\n        if (!fHasMoreOrSameWork) return true; // Don't process less-work chains\n        if (fTooFarAhead) return true;        // Block height is too high\n\n        // Protect against DoS attacks from low-work chains.\n        // If our tip is behind, a peer could try to send us\n        // low-work blocks on a fake chain that we would never\n        // request; don't process these.\n        if (pindex->nChainWork < nMinimumChainWork) return true;\n    }\n    if (fNewBlock) *fNewBlock = true;\n\n    if (!CheckBlock(block, state, chainparams.GetConsensus()) ||\n        !ContextualCheckBlock(block, state, chainparams.GetConsensus(), pindex->pprev)) {\n        if (state.IsInvalid() && !state.CorruptionPossible()) {\n            pindex->nStatus |= BLOCK_FAILED_VALID;\n            setDirtyBlockIndex.insert(pindex);\n        }\n        return error(\"%s: %s\", __func__, FormatStateMessage(state));\n    }\n\n    // Header is valid/has work, merkle tree and segwit merkle tree are good...RELAY NOW\n    // (but if it does not build on our best tip, let the SendMessages loop relay it)\n    if (!IsInitialBlockDownload() && chainActive.Tip() == pindex->pprev)\n        GetMainSignals().NewPoWValidBlock(pindex, pblock);\n\n    // Write block to history file\n    try {\n        CDiskBlockPos blockPos = SaveBlockToDisk(block, pindex->nHeight, chainparams, dbp);\n        if (blockPos.IsNull()) {\n            state.Error(strprintf(\"%s: Failed to find position to write new block to disk\", __func__));\n            return false;\n        }\n        if (!ReceivedBlockTransactions(block, state, pindex, blockPos, chainparams.GetConsensus()))\n            return error(\"AcceptBlock(): ReceivedBlockTransactions failed\");\n    } catch (const std::runtime_error& e) {\n        return AbortNode(state, std::string(\"System error: \") + e.what());\n    }\n\n    if (fCheckForPruning)\n        FlushStateToDisk(chainparams, state, FLUSH_STATE_NONE); // we just allocated more disk space for block files\n\n    CheckBlockIndex(chainparams.GetConsensus());\n\n    return true;\n}\n\nbool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool *fNewBlock)\n{\n    AssertLockNotHeld(cs_main);\n\n    // Look for this block's header in the index like AcceptBlock() will\n    uint256 hash = pblock->GetHash();\n\n    {\n        LOCK(cs_main);\n\n        BlockMap::iterator miSelf = mapBlockIndex.find(hash);\n        CBlockIndex *pindex = NULL;\n        if (miSelf != mapBlockIndex.end()) {\n            // Block header is already known\n            pindex = miSelf->second;\n            if (!pblock->cache_init && pindex->cache_init) {\n                LOCK(pblock->cache_lock); // Probably unnecessary since no concurrent access to pblock is expected\n                pblock->cache_init = true;\n                pblock->cache_block_hash = pindex->cache_block_hash;\n                pblock->cache_PoW_hash = pindex->cache_PoW_hash;\n            }\n        }\n    }\n\n    {\n        CBlockIndex *pindex = nullptr;\n        if (fNewBlock) *fNewBlock = false;\n        CValidationState state;\n        // Ensure that CheckBlock() passes before calling AcceptBlock, as\n        // belt-and-suspenders.\n        bool ret = CheckBlock(*pblock, state, chainparams.GetConsensus());\n\n        LOCK(cs_main);\n\n        if (ret) {\n            // Store to disk\n            ret = g_chainstate.AcceptBlock(pblock, state, chainparams, &pindex, fForceProcessing, nullptr, fNewBlock);\n        }\n        if (!ret) {\n            GetMainSignals().BlockChecked(*pblock, state);\n            return error(\"%s: AcceptBlock FAILED (%s)\", __func__, state.GetDebugMessage());\n        }\n    }\n\n    NotifyHeaderTip();\n\n    CValidationState state; // Only used to report errors, not invalidity - ignore it\n    if (!g_chainstate.ActivateBestChain(state, chainparams, pblock))\n        return error(\"%s: ActivateBestChain failed\", __func__);\n\n    return true;\n}\n\nbool TestBlockValidity(CValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW, bool fCheckMerkleRoot)\n{\n    AssertLockHeld(cs_main);\n    assert(pindexPrev && pindexPrev == chainActive.Tip());\n    CCoinsViewCache viewNew(pcoinsTip.get());\n    CBlockIndex indexDummy(block);\n    indexDummy.pprev = pindexPrev;\n    indexDummy.nHeight = pindexPrev->nHeight + 1;\n\n    // NOTE: CheckBlockHeader is called by CheckBlock\n    if (!ContextualCheckBlockHeader(block, state, chainparams, pindexPrev, GetAdjustedTime()))\n        return error(\"%s: Consensus::ContextualCheckBlockHeader: %s\", __func__, FormatStateMessage(state));\n    if (!CheckBlock(block, state, chainparams.GetConsensus(), fCheckPOW, fCheckMerkleRoot))\n        return error(\"%s: Consensus::CheckBlock: %s\", __func__, FormatStateMessage(state));\n    if (!ContextualCheckBlock(block, state, chainparams.GetConsensus(), pindexPrev))\n        return error(\"%s: Consensus::ContextualCheckBlock: %s\", __func__, FormatStateMessage(state));\n    if (!g_chainstate.ConnectBlock(block, state, &indexDummy, viewNew, chainparams, true))\n        return false;\n    assert(state.IsValid());\n\n    return true;\n}\n\n/**\n * BLOCK PRUNING CODE\n */\n\n/* Calculate the amount of disk space the block & undo files currently use */\nuint64_t CalculateCurrentUsage()\n{\n    LOCK(cs_LastBlockFile);\n\n    uint64_t retval = 0;\n    for (const CBlockFileInfo &file : vinfoBlockFile) {\n        retval += file.nSize + file.nUndoSize;\n    }\n    return retval;\n}\n\n/* Prune a block file (modify associated database entries)*/\nvoid PruneOneBlockFile(const int fileNumber)\n{\n    LOCK(cs_LastBlockFile);\n\n    for (const auto& entry : mapBlockIndex) {\n        CBlockIndex* pindex = entry.second;\n        if (pindex->nFile == fileNumber) {\n            pindex->nStatus &= ~BLOCK_HAVE_DATA;\n            pindex->nStatus &= ~BLOCK_HAVE_UNDO;\n            pindex->nFile = 0;\n            pindex->nDataPos = 0;\n            pindex->nUndoPos = 0;\n            setDirtyBlockIndex.insert(pindex);\n\n            // Prune from mapBlocksUnlinked -- any block we prune would have\n            // to be downloaded again in order to consider its chain, at which\n            // point it would be considered as a candidate for\n            // mapBlocksUnlinked or setBlockIndexCandidates.\n            std::pair<std::multimap<CBlockIndex*, CBlockIndex*>::iterator, std::multimap<CBlockIndex*, CBlockIndex*>::iterator> range = mapBlocksUnlinked.equal_range(pindex->pprev);\n            while (range.first != range.second) {\n                std::multimap<CBlockIndex *, CBlockIndex *>::iterator _it = range.first;\n                range.first++;\n                if (_it->second == pindex) {\n                    mapBlocksUnlinked.erase(_it);\n                }\n            }\n        }\n    }\n\n    vinfoBlockFile[fileNumber].SetNull();\n    setDirtyFileInfo.insert(fileNumber);\n}\n\n\nvoid UnlinkPrunedFiles(const std::set<int>& setFilesToPrune)\n{\n    for (std::set<int>::iterator it = setFilesToPrune.begin(); it != setFilesToPrune.end(); ++it) {\n        CDiskBlockPos pos(*it, 0);\n        fs::remove(GetBlockPosFilename(pos, \"blk\"));\n        fs::remove(GetBlockPosFilename(pos, \"rev\"));\n        LogPrintf(\"Prune: %s deleted blk/rev (%05u)\\n\", __func__, *it);\n    }\n}\n\n/* Calculate the block/rev files to delete based on height specified by user with RPC command pruneblockchain */\nstatic void FindFilesToPruneManual(std::set<int>& setFilesToPrune, int nManualPruneHeight)\n{\n    assert(fPruneMode && nManualPruneHeight > 0);\n\n    LOCK2(cs_main, cs_LastBlockFile);\n    if (chainActive.Tip() == nullptr)\n        return;\n\n    // last block to prune is the lesser of (user-specified height, MIN_BLOCKS_TO_KEEP from the tip)\n    unsigned int nLastBlockWeCanPrune = std::min((unsigned)nManualPruneHeight, chainActive.Tip()->nHeight - MIN_BLOCKS_TO_KEEP);\n    int count=0;\n    for (int fileNumber = 0; fileNumber < nLastBlockFile; fileNumber++) {\n        if (vinfoBlockFile[fileNumber].nSize == 0 || vinfoBlockFile[fileNumber].nHeightLast > nLastBlockWeCanPrune)\n            continue;\n        PruneOneBlockFile(fileNumber);\n        setFilesToPrune.insert(fileNumber);\n        count++;\n    }\n    LogPrintf(\"Prune (Manual): prune_height=%d removed %d blk/rev pairs\\n\", nLastBlockWeCanPrune, count);\n}\n\n/* This function is called from the RPC code for pruneblockchain */\nvoid PruneBlockFilesManual(int nManualPruneHeight)\n{\n    CValidationState state;\n    const CChainParams& chainparams = Params();\n    FlushStateToDisk(chainparams, state, FLUSH_STATE_NONE, nManualPruneHeight);\n}\n\n/**\n * Prune block and undo files (blk???.dat and undo???.dat) so that the disk space used is less than a user-defined target.\n * The user sets the target (in MB) on the command line or in config file.  This will be run on startup and whenever new\n * space is allocated in a block or undo file, staying below the target. Changing back to unpruned requires a reindex\n * (which in this case means the blockchain must be re-downloaded.)\n *\n * Pruning functions are called from FlushStateToDisk when the global fCheckForPruning flag has been set.\n * Block and undo files are deleted in lock-step (when blk00003.dat is deleted, so is rev00003.dat.)\n * Pruning cannot take place until the longest chain is at least a certain length (100000 on mainnet, 1000 on testnet, 1000 on regtest).\n * Pruning will never delete a block within a defined distance (currently 288) from the active chain's tip.\n * The block index is updated by unsetting HAVE_DATA and HAVE_UNDO for any blocks that were stored in the deleted files.\n * A db flag records the fact that at least some block files have been pruned.\n *\n * @param[out]   setFilesToPrune   The set of file indices that can be unlinked will be returned\n */\nstatic void FindFilesToPrune(std::set<int>& setFilesToPrune, uint64_t nPruneAfterHeight)\n{\n    LOCK2(cs_main, cs_LastBlockFile);\n    if (chainActive.Tip() == nullptr || nPruneTarget == 0) {\n        return;\n    }\n    if ((uint64_t)chainActive.Tip()->nHeight <= nPruneAfterHeight) {\n        return;\n    }\n\n    unsigned int nLastBlockWeCanPrune = chainActive.Tip()->nHeight - MIN_BLOCKS_TO_KEEP;\n    uint64_t nCurrentUsage = CalculateCurrentUsage();\n    // We don't check to prune until after we've allocated new space for files\n    // So we should leave a buffer under our target to account for another allocation\n    // before the next pruning.\n    uint64_t nBuffer = BLOCKFILE_CHUNK_SIZE + UNDOFILE_CHUNK_SIZE;\n    uint64_t nBytesToPrune;\n    int count=0;\n\n    if (nCurrentUsage + nBuffer >= nPruneTarget) {\n        for (int fileNumber = 0; fileNumber < nLastBlockFile; fileNumber++) {\n            nBytesToPrune = vinfoBlockFile[fileNumber].nSize + vinfoBlockFile[fileNumber].nUndoSize;\n\n            if (vinfoBlockFile[fileNumber].nSize == 0)\n                continue;\n\n            if (nCurrentUsage + nBuffer < nPruneTarget)  // are we below our target?\n                break;\n\n            // don't prune files that could have a block within MIN_BLOCKS_TO_KEEP of the main chain's tip but keep scanning\n            if (vinfoBlockFile[fileNumber].nHeightLast > nLastBlockWeCanPrune)\n                continue;\n\n            PruneOneBlockFile(fileNumber);\n            // Queue up the files for removal\n            setFilesToPrune.insert(fileNumber);\n            nCurrentUsage -= nBytesToPrune;\n            count++;\n        }\n    }\n\n    LogPrint(BCLog::PRUNE, \"Prune: target=%dMiB actual=%dMiB diff=%dMiB max_prune_height=%d removed %d blk/rev pairs\\n\",\n           nPruneTarget/1024/1024, nCurrentUsage/1024/1024,\n           ((int64_t)nPruneTarget - (int64_t)nCurrentUsage)/1024/1024,\n           nLastBlockWeCanPrune, count);\n}\n\nbool CheckDiskSpace(uint64_t nAdditionalBytes)\n{\n    uint64_t nFreeBytesAvailable = fs::space(GetDataDir()).available;\n\n    // Check for nMinDiskSpace bytes (currently 50MB)\n    if (nFreeBytesAvailable < nMinDiskSpace + nAdditionalBytes)\n        return AbortNode(\"Disk space is low!\", _(\"Error: Disk space is low!\"));\n\n    return true;\n}\n\nstatic FILE* OpenDiskFile(const CDiskBlockPos &pos, const char *prefix, bool fReadOnly)\n{\n    if (pos.IsNull())\n        return nullptr;\n    fs::path path = GetBlockPosFilename(pos, prefix);\n    fs::create_directories(path.parent_path());\n    FILE* file = fsbridge::fopen(path, fReadOnly ? \"rb\": \"rb+\");\n    if (!file && !fReadOnly)\n        file = fsbridge::fopen(path, \"wb+\");\n    if (!file) {\n        LogPrintf(\"Unable to open file %s\\n\", path.string());\n        return nullptr;\n    }\n    if (pos.nPos) {\n        if (fseek(file, pos.nPos, SEEK_SET)) {\n            LogPrintf(\"Unable to seek to position %u of %s\\n\", pos.nPos, path.string());\n            fclose(file);\n            return nullptr;\n        }\n    }\n    return file;\n}\n\nFILE* OpenBlockFile(const CDiskBlockPos &pos, bool fReadOnly) {\n    return OpenDiskFile(pos, \"blk\", fReadOnly);\n}\n\n/** Open an undo file (rev?????.dat) */\nstatic FILE* OpenUndoFile(const CDiskBlockPos &pos, bool fReadOnly) {\n    return OpenDiskFile(pos, \"rev\", fReadOnly);\n}\n\nfs::path GetBlockPosFilename(const CDiskBlockPos &pos, const char *prefix)\n{\n    return GetDataDir() / \"blocks\" / strprintf(\"%s%05u.dat\", prefix, pos.nFile);\n}\n\nCBlockIndex * CChainState::InsertBlockIndex(const uint256& hash)\n{\n    if (hash.IsNull())\n        return nullptr;\n\n    // Return existing\n    BlockMap::iterator mi = mapBlockIndex.find(hash);\n    if (mi != mapBlockIndex.end())\n        return (*mi).second;\n\n    // Create new\n    CBlockIndex* pindexNew = new CBlockIndex();\n    mi = mapBlockIndex.insert(std::make_pair(hash, pindexNew)).first;\n    pindexNew->phashBlock = &((*mi).first);\n\n    return pindexNew;\n}\n\nbool CChainState::LoadBlockIndex(const Consensus::Params& consensus_params, CBlockTreeDB& blocktree)\n{\n    if (!blocktree.LoadBlockIndexGuts(consensus_params, [this](const uint256& hash){ return this->InsertBlockIndex(hash); }))\n        return false;\n\n    boost::this_thread::interruption_point();\n\n    // Calculate nChainWork\n    std::vector<std::pair<int, CBlockIndex*> > vSortedByHeight;\n    vSortedByHeight.reserve(mapBlockIndex.size());\n    for (const std::pair<uint256, CBlockIndex*>& item : mapBlockIndex)\n    {\n        CBlockIndex* pindex = item.second;\n        vSortedByHeight.push_back(std::make_pair(pindex->nHeight, pindex));\n    }\n    sort(vSortedByHeight.begin(), vSortedByHeight.end());\n    for (const std::pair<int, CBlockIndex*>& item : vSortedByHeight)\n    {\n        CBlockIndex* pindex = item.second;\n        pindex->nChainWork = (pindex->pprev ? pindex->pprev->nChainWork : 0) + GetBlockProof(*pindex);\n        pindex->nTimeMax = (pindex->pprev ? std::max(pindex->pprev->nTimeMax, pindex->nTime) : pindex->nTime);\n        // We can link the chain of blocks for which we've received transactions at some point.\n        // Pruned nodes may have deleted the block.\n        if (pindex->nTx > 0) {\n            if (pindex->pprev) {\n                if (pindex->pprev->nChainTx) {\n                    pindex->nChainTx = pindex->pprev->nChainTx + pindex->nTx;\n                } else {\n                    pindex->nChainTx = 0;\n                    mapBlocksUnlinked.insert(std::make_pair(pindex->pprev, pindex));\n                }\n            } else {\n                pindex->nChainTx = pindex->nTx;\n            }\n        }\n        if (!(pindex->nStatus & BLOCK_FAILED_MASK) && pindex->pprev && (pindex->pprev->nStatus & BLOCK_FAILED_MASK)) {\n            pindex->nStatus |= BLOCK_FAILED_CHILD;\n            setDirtyBlockIndex.insert(pindex);\n        }\n        if (pindex->IsValid(BLOCK_VALID_TRANSACTIONS) && (pindex->nChainTx || pindex->pprev == nullptr))\n            setBlockIndexCandidates.insert(pindex);\n        if (pindex->nStatus & BLOCK_FAILED_MASK && (!pindexBestInvalid || pindex->nChainWork > pindexBestInvalid->nChainWork))\n            pindexBestInvalid = pindex;\n        if (pindex->pprev)\n            pindex->BuildSkip();\n        if (pindex->IsValid(BLOCK_VALID_TREE) && (pindexBestHeader == nullptr || CBlockIndexWorkComparator()(pindexBestHeader, pindex)))\n            pindexBestHeader = pindex;\n    }\n\n    return true;\n}\n\nbool static LoadBlockIndexDB(const CChainParams& chainparams)\n{\n    if (!g_chainstate.LoadBlockIndex(chainparams.GetConsensus(), *pblocktree))\n        return false;\n\n    // Load block file info\n    pblocktree->ReadLastBlockFile(nLastBlockFile);\n    vinfoBlockFile.resize(nLastBlockFile + 1);\n    LogPrintf(\"%s: last block file = %i\\n\", __func__, nLastBlockFile);\n    for (int nFile = 0; nFile <= nLastBlockFile; nFile++) {\n        pblocktree->ReadBlockFileInfo(nFile, vinfoBlockFile[nFile]);\n    }\n    LogPrintf(\"%s: last block file info: %s\\n\", __func__, vinfoBlockFile[nLastBlockFile].ToString());\n    for (int nFile = nLastBlockFile + 1; true; nFile++) {\n        CBlockFileInfo info;\n        if (pblocktree->ReadBlockFileInfo(nFile, info)) {\n            vinfoBlockFile.push_back(info);\n        } else {\n            break;\n        }\n    }\n\n    // Check presence of blk files\n    LogPrintf(\"Checking all blk files are present...\\n\");\n    std::set<int> setBlkDataFiles;\n    for (const std::pair<uint256, CBlockIndex*>& item : mapBlockIndex)\n    {\n        CBlockIndex* pindex = item.second;\n        if (pindex->nStatus & BLOCK_HAVE_DATA) {\n            setBlkDataFiles.insert(pindex->nFile);\n        }\n    }\n    for (std::set<int>::iterator it = setBlkDataFiles.begin(); it != setBlkDataFiles.end(); it++)\n    {\n        CDiskBlockPos pos(*it, 0);\n        if (CAutoFile(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION).IsNull()) {\n            return false;\n        }\n    }\n\n    // Check whether we have ever pruned block & undo files\n    pblocktree->ReadFlag(\"prunedblockfiles\", fHavePruned);\n    if (fHavePruned)\n        LogPrintf(\"LoadBlockIndexDB(): Block files have previously been pruned\\n\");\n\n    // Check whether we need to continue reindexing\n    bool fReindexing = false;\n    pblocktree->ReadReindexing(fReindexing);\n    if(fReindexing) fReindex = true;\n\n    // Check whether we have a transaction index\n    pblocktree->ReadFlag(\"txindex\", fTxIndex);\n    LogPrintf(\"%s: transaction index %s\\n\", __func__, fTxIndex ? \"enabled\" : \"disabled\");\n\n    return true;\n}\n\nbool LoadChainTip(const CChainParams& chainparams)\n{\n    if (chainActive.Tip() && chainActive.Tip()->GetBlockHash() == pcoinsTip->GetBestBlock()) return true;\n\n    if (pcoinsTip->GetBestBlock().IsNull() && mapBlockIndex.size() == 1) {\n        // In case we just added the genesis block, connect it now, so\n        // that we always have a chainActive.Tip() when we return.\n        LogPrintf(\"%s: Connecting genesis block...\\n\", __func__);\n        CValidationState state;\n        if (!ActivateBestChain(state, chainparams)) {\n            return false;\n        }\n    }\n\n    // Load pointer to end of best chain\n    BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());\n    if (it == mapBlockIndex.end())\n        return false;\n    chainActive.SetTip(it->second);\n\n    g_chainstate.PruneBlockIndexCandidates();\n\n    LogPrintf(\"Loaded best chain: hashBestChain=%s height=%d date=%s progress=%f\\n\",\n        chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(),\n        DateTimeStrFormat(\"%Y-%m-%d %H:%M:%S\", chainActive.Tip()->GetBlockTime()),\n        GuessVerificationProgress(chainparams.TxData(), chainActive.Tip()));\n    return true;\n}\n\nCVerifyDB::CVerifyDB()\n{\n    uiInterface.ShowProgress(_(\"Verifying blocks...\"), 0, false);\n}\n\nCVerifyDB::~CVerifyDB()\n{\n    uiInterface.ShowProgress(\"\", 100, false);\n}\n\nbool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview, int nCheckLevel, int nCheckDepth)\n{\n    LOCK(cs_main);\n    if (chainActive.Tip() == nullptr || chainActive.Tip()->pprev == nullptr)\n        return true;\n\n    // Verify blocks in the best chain\n    if (nCheckDepth <= 0 || nCheckDepth > chainActive.Height())\n        nCheckDepth = chainActive.Height();\n    nCheckLevel = std::max(0, std::min(4, nCheckLevel));\n    LogPrintf(\"Verifying last %i blocks at level %i\\n\", nCheckDepth, nCheckLevel);\n    CCoinsViewCache coins(coinsview);\n    CBlockIndex* pindexState = chainActive.Tip();\n    CBlockIndex* pindexFailure = nullptr;\n    int nGoodTransactions = 0;\n    CValidationState state;\n    int reportDone = 0;\n    LogPrintf(\"[0%%]...\");\n    for (CBlockIndex* pindex = chainActive.Tip(); pindex && pindex->pprev; pindex = pindex->pprev)\n    {\n        boost::this_thread::interruption_point();\n        int percentageDone = std::max(1, std::min(99, (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100))));\n        if (reportDone < percentageDone/10) {\n            // report every 10% step\n            LogPrintf(\"[%d%%]...\", percentageDone);\n            reportDone = percentageDone/10;\n        }\n        uiInterface.ShowProgress(_(\"Verifying blocks...\"), percentageDone, false);\n        if (pindex->nHeight < chainActive.Height()-nCheckDepth)\n            break;\n        if (fPruneMode && !(pindex->nStatus & BLOCK_HAVE_DATA)) {\n            // If pruning, only go back as far as we have data.\n            LogPrintf(\"VerifyDB(): block verification stopping at height %d (pruning, no data)\\n\", pindex->nHeight);\n            break;\n        }\n        CBlock block;\n        // check level 0: read from disk\n        if (!ReadBlockFromDisk(block, pindex, chainparams.GetConsensus()))\n            return error(\"VerifyDB(): *** ReadBlockFromDisk failed at %d, hash=%s\", pindex->nHeight, pindex->GetBlockHash().ToString());\n        // check level 1: verify block validity\n        if (nCheckLevel >= 1 && !CheckBlock(block, state, chainparams.GetConsensus()))\n            return error(\"%s: *** found bad block at %d, hash=%s (%s)\\n\", __func__,\n                         pindex->nHeight, pindex->GetBlockHash().ToString(), FormatStateMessage(state));\n        // check level 2: verify undo validity\n        if (nCheckLevel >= 2 && pindex) {\n            CBlockUndo undo;\n            if (!pindex->GetUndoPos().IsNull()) {\n                if (!UndoReadFromDisk(undo, pindex)) {\n                    return error(\"VerifyDB(): *** found bad undo data at %d, hash=%s\\n\", pindex->nHeight, pindex->GetBlockHash().ToString());\n                }\n            }\n        }\n        // check level 3: check for inconsistencies during memory-only disconnect of tip blocks\n        if (nCheckLevel >= 3 && pindex == pindexState && (coins.DynamicMemoryUsage() + pcoinsTip->DynamicMemoryUsage()) <= nCoinCacheUsage) {\n            assert(coins.GetBestBlock() == pindex->GetBlockHash());\n            DisconnectResult res = g_chainstate.DisconnectBlock(block, pindex, coins);\n            if (res == DISCONNECT_FAILED) {\n                return error(\"VerifyDB(): *** irrecoverable inconsistency in block data at %d, hash=%s\", pindex->nHeight, pindex->GetBlockHash().ToString());\n            }\n            pindexState = pindex->pprev;\n            if (res == DISCONNECT_UNCLEAN) {\n                nGoodTransactions = 0;\n                pindexFailure = pindex;\n            } else {\n                nGoodTransactions += block.vtx.size();\n            }\n        }\n        if (ShutdownRequested())\n            return true;\n    }\n    if (pindexFailure)\n        return error(\"VerifyDB(): *** coin database inconsistencies found (last %i blocks, %i good transactions before that)\\n\", chainActive.Height() - pindexFailure->nHeight + 1, nGoodTransactions);\n\n    // check level 4: try reconnecting blocks\n    if (nCheckLevel >= 4) {\n        CBlockIndex *pindex = pindexState;\n        while (pindex != chainActive.Tip()) {\n            boost::this_thread::interruption_point();\n            uiInterface.ShowProgress(_(\"Verifying blocks...\"), std::max(1, std::min(99, 100 - (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * 50))), false);\n            pindex = chainActive.Next(pindex);\n            CBlock block;\n            if (!ReadBlockFromDisk(block, pindex, chainparams.GetConsensus()))\n                return error(\"VerifyDB(): *** ReadBlockFromDisk failed at %d, hash=%s\", pindex->nHeight, pindex->GetBlockHash().ToString());\n            if (!g_chainstate.ConnectBlock(block, state, pindex, coins, chainparams))\n                return error(\"VerifyDB(): *** found unconnectable block at %d, hash=%s\", pindex->nHeight, pindex->GetBlockHash().ToString());\n        }\n    }\n\n    LogPrintf(\"[DONE].\\n\");\n    LogPrintf(\"No coin database inconsistencies in last %i blocks (%i transactions)\\n\", chainActive.Height() - pindexState->nHeight, nGoodTransactions);\n\n    return true;\n}\n\n/** Apply the effects of a block on the utxo cache, ignoring that it may already have been applied. */\nbool CChainState::RollforwardBlock(const CBlockIndex* pindex, CCoinsViewCache& inputs, const CChainParams& params)\n{\n    // TODO: merge with ConnectBlock\n    CBlock block;\n    if (!ReadBlockFromDisk(block, pindex, params.GetConsensus())) {\n        return error(\"ReplayBlock(): ReadBlockFromDisk failed at %d, hash=%s\", pindex->nHeight, pindex->GetBlockHash().ToString());\n    }\n\n    for (const CTransactionRef& tx : block.vtx) {\n        if (!tx->IsCoinBase()) {\n            for (const CTxIn &txin : tx->vin) {\n                inputs.SpendCoin(txin.prevout);\n            }\n        }\n        // Pass check = true as every addition may be an overwrite.\n        AddCoins(inputs, *tx, pindex->nHeight, true);\n    }\n    return true;\n}\n\nbool CChainState::ReplayBlocks(const CChainParams& params, CCoinsView* view)\n{\n    LOCK(cs_main);\n\n    CCoinsViewCache cache(view);\n\n    std::vector<uint256> hashHeads = view->GetHeadBlocks();\n    if (hashHeads.empty()) return true; // We're already in a consistent state.\n    if (hashHeads.size() != 2) return error(\"ReplayBlocks(): unknown inconsistent state\");\n\n    uiInterface.ShowProgress(_(\"Replaying blocks...\"), 0, false);\n    LogPrintf(\"Replaying blocks\\n\");\n\n    const CBlockIndex* pindexOld = nullptr;  // Old tip during the interrupted flush.\n    const CBlockIndex* pindexNew;            // New tip during the interrupted flush.\n    const CBlockIndex* pindexFork = nullptr; // Latest block common to both the old and the new tip.\n\n    if (mapBlockIndex.count(hashHeads[0]) == 0) {\n        return error(\"ReplayBlocks(): reorganization to unknown block requested\");\n    }\n    pindexNew = mapBlockIndex[hashHeads[0]];\n\n    if (!hashHeads[1].IsNull()) { // The old tip is allowed to be 0, indicating it's the first flush.\n        if (mapBlockIndex.count(hashHeads[1]) == 0) {\n            return error(\"ReplayBlocks(): reorganization from unknown block requested\");\n        }\n        pindexOld = mapBlockIndex[hashHeads[1]];\n        pindexFork = LastCommonAncestor(pindexOld, pindexNew);\n        assert(pindexFork != nullptr);\n    }\n\n    // Rollback along the old branch.\n    while (pindexOld != pindexFork) {\n        if (pindexOld->nHeight > 0) { // Never disconnect the genesis block.\n            CBlock block;\n            if (!ReadBlockFromDisk(block, pindexOld, params.GetConsensus())) {\n                return error(\"RollbackBlock(): ReadBlockFromDisk() failed at %d, hash=%s\", pindexOld->nHeight, pindexOld->GetBlockHash().ToString());\n            }\n            LogPrintf(\"Rolling back %s (%i)\\n\", pindexOld->GetBlockHash().ToString(), pindexOld->nHeight);\n            DisconnectResult res = DisconnectBlock(block, pindexOld, cache);\n            if (res == DISCONNECT_FAILED) {\n                return error(\"RollbackBlock(): DisconnectBlock failed at %d, hash=%s\", pindexOld->nHeight, pindexOld->GetBlockHash().ToString());\n            }\n            // If DISCONNECT_UNCLEAN is returned, it means a non-existing UTXO was deleted, or an existing UTXO was\n            // overwritten. It corresponds to cases where the block-to-be-disconnect never had all its operations\n            // applied to the UTXO set. However, as both writing a UTXO and deleting a UTXO are idempotent operations,\n            // the result is still a version of the UTXO set with the effects of that block undone.\n        }\n        pindexOld = pindexOld->pprev;\n    }\n\n    // Roll forward from the forking point to the new tip.\n    int nForkHeight = pindexFork ? pindexFork->nHeight : 0;\n    for (int nHeight = nForkHeight + 1; nHeight <= pindexNew->nHeight; ++nHeight) {\n        const CBlockIndex* pindex = pindexNew->GetAncestor(nHeight);\n        LogPrintf(\"Rolling forward %s (%i)\\n\", pindex->GetBlockHash().ToString(), nHeight);\n        if (!RollforwardBlock(pindex, cache, params)) return false;\n    }\n\n    cache.SetBestBlock(pindexNew->GetBlockHash());\n    cache.Flush();\n    uiInterface.ShowProgress(\"\", 100, false);\n    return true;\n}\n\nbool ReplayBlocks(const CChainParams& params, CCoinsView* view) {\n    return g_chainstate.ReplayBlocks(params, view);\n}\n\nbool CChainState::RewindBlockIndex(const CChainParams& params)\n{\n    LOCK(cs_main);\n\n    // Note that during -reindex-chainstate we are called with an empty chainActive!\n\n    int nHeight = 1;\n    while (nHeight <= chainActive.Height()) {\n        if (IsWitnessEnabled(chainActive[nHeight - 1], params.GetConsensus()) && !(chainActive[nHeight]->nStatus & BLOCK_OPT_WITNESS)) {\n            break;\n        }\n        nHeight++;\n    }\n\n    // nHeight is now the height of the first insufficiently-validated block, or tipheight + 1\n    CValidationState state;\n    CBlockIndex* pindex = chainActive.Tip();\n    while (chainActive.Height() >= nHeight) {\n        if (fPruneMode && !(chainActive.Tip()->nStatus & BLOCK_HAVE_DATA)) {\n            // If pruning, don't try rewinding past the HAVE_DATA point;\n            // since older blocks can't be served anyway, there's\n            // no need to walk further, and trying to DisconnectTip()\n            // will fail (and require a needless reindex/redownload\n            // of the blockchain).\n            break;\n        }\n        if (!DisconnectTip(state, params, nullptr)) {\n            return error(\"RewindBlockIndex: unable to disconnect block at height %i\", pindex->nHeight);\n        }\n        // Occasionally flush state to disk.\n        if (!FlushStateToDisk(params, state, FLUSH_STATE_PERIODIC))\n            return false;\n    }\n\n    // Reduce validity flag and have-data flags.\n    // We do this after actual disconnecting, otherwise we'll end up writing the lack of data\n    // to disk before writing the chainstate, resulting in a failure to continue if interrupted.\n    for (const auto& entry : mapBlockIndex) {\n        CBlockIndex* pindexIter = entry.second;\n\n        // Note: If we encounter an insufficiently validated block that\n        // is on chainActive, it must be because we are a pruning node, and\n        // this block or some successor doesn't HAVE_DATA, so we were unable to\n        // rewind all the way.  Blocks remaining on chainActive at this point\n        // must not have their validity reduced.\n        if (IsWitnessEnabled(pindexIter->pprev, params.GetConsensus()) && !(pindexIter->nStatus & BLOCK_OPT_WITNESS) && !chainActive.Contains(pindexIter)) {\n            // Reduce validity\n            pindexIter->nStatus = std::min<unsigned int>(pindexIter->nStatus & BLOCK_VALID_MASK, BLOCK_VALID_TREE) | (pindexIter->nStatus & ~BLOCK_VALID_MASK);\n            // Remove have-data flags.\n            pindexIter->nStatus &= ~(BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO);\n            // Remove storage location.\n            pindexIter->nFile = 0;\n            pindexIter->nDataPos = 0;\n            pindexIter->nUndoPos = 0;\n            // Remove various other things\n            pindexIter->nTx = 0;\n            pindexIter->nChainTx = 0;\n            pindexIter->nSequenceId = 0;\n            // Make sure it gets written.\n            setDirtyBlockIndex.insert(pindexIter);\n            // Update indexes\n            setBlockIndexCandidates.erase(pindexIter);\n            std::pair<std::multimap<CBlockIndex*, CBlockIndex*>::iterator, std::multimap<CBlockIndex*, CBlockIndex*>::iterator> ret = mapBlocksUnlinked.equal_range(pindexIter->pprev);\n            while (ret.first != ret.second) {\n                if (ret.first->second == pindexIter) {\n                    mapBlocksUnlinked.erase(ret.first++);\n                } else {\n                    ++ret.first;\n                }\n            }\n        } else if (pindexIter->IsValid(BLOCK_VALID_TRANSACTIONS) && pindexIter->nChainTx) {\n            setBlockIndexCandidates.insert(pindexIter);\n        }\n    }\n\n    if (chainActive.Tip() != nullptr) {\n        // We can't prune block index candidates based on our tip if we have\n        // no tip due to chainActive being empty!\n        PruneBlockIndexCandidates();\n\n        CheckBlockIndex(params.GetConsensus());\n    }\n\n    return true;\n}\n\nbool RewindBlockIndex(const CChainParams& params) {\n    if (!g_chainstate.RewindBlockIndex(params)) {\n        return false;\n    }\n\n    if (chainActive.Tip() != nullptr) {\n        // FlushStateToDisk can possibly read chainActive. Be conservative\n        // and skip it here, we're about to -reindex-chainstate anyway, so\n        // it'll get called a bunch real soon.\n        CValidationState state;\n        if (!FlushStateToDisk(params, state, FLUSH_STATE_ALWAYS)) {\n            return false;\n        }\n    }\n\n    return true;\n}\n\nvoid CChainState::UnloadBlockIndex() {\n    nBlockSequenceId = 1;\n    g_failed_blocks.clear();\n    setBlockIndexCandidates.clear();\n}\n\n// May NOT be used after any connections are up as much\n// of the peer-processing logic assumes a consistent\n// block index state\nvoid UnloadBlockIndex()\n{\n    LOCK(cs_main);\n    chainActive.SetTip(nullptr);\n    pindexBestInvalid = nullptr;\n    pindexBestHeader = nullptr;\n    mempool.clear();\n    mapBlocksUnlinked.clear();\n    vinfoBlockFile.clear();\n    nLastBlockFile = 0;\n    setDirtyBlockIndex.clear();\n    setDirtyFileInfo.clear();\n    versionbitscache.Clear();\n    for (int b = 0; b < VERSIONBITS_NUM_BITS; b++) {\n        warningcache[b].clear();\n    }\n\n    for (BlockMap::value_type& entry : mapBlockIndex) {\n        delete entry.second;\n    }\n    mapBlockIndex.clear();\n    fHavePruned = false;\n\n    g_chainstate.UnloadBlockIndex();\n}\n\nbool LoadBlockIndex(const CChainParams& chainparams)\n{\n    // Load block index from databases\n    bool needs_init = fReindex;\n    if (!fReindex) {\n        bool ret = LoadBlockIndexDB(chainparams);\n        if (!ret) return false;\n        needs_init = mapBlockIndex.empty();\n    }\n\n    if (needs_init) {\n        // Everything here is for *new* reindex/DBs. Thus, though\n        // LoadBlockIndexDB may have set fReindex if we shut down\n        // mid-reindex previously, we don't check fReindex and\n        // instead only check it prior to LoadBlockIndexDB to set\n        // needs_init.\n\n        LogPrintf(\"Initializing databases...\\n\");\n        // Use the provided setting for -txindex in the new database\n        fTxIndex = gArgs.GetBoolArg(\"-txindex\", DEFAULT_TXINDEX);\n        pblocktree->WriteFlag(\"txindex\", fTxIndex);\n    }\n    return true;\n}\n\nbool CChainState::LoadGenesisBlock(const CChainParams& chainparams)\n{\n    LOCK(cs_main);\n\n    // Check whether we're already initialized by checking for genesis in\n    // mapBlockIndex. Note that we can't use chainActive here, since it is\n    // set based on the coins db, not the block index db, which is the only\n    // thing loaded at this point.\n    if (mapBlockIndex.count(chainparams.GenesisBlock().GetHash()))\n        return true;\n\n    try {\n        CBlock &block = const_cast<CBlock&>(chainparams.GenesisBlock());\n        CDiskBlockPos blockPos = SaveBlockToDisk(block, 0, chainparams, nullptr);\n        if (blockPos.IsNull())\n            return error(\"%s: writing genesis block to disk failed\", __func__);\n        CBlockIndex *pindex = AddToBlockIndex(block);\n        CValidationState state;\n        if (!ReceivedBlockTransactions(block, state, pindex, blockPos, chainparams.GetConsensus()))\n            return error(\"%s: genesis block not accepted\", __func__);\n    } catch (const std::runtime_error& e) {\n        return error(\"%s: failed to write genesis block: %s\", __func__, e.what());\n    }\n\n    return true;\n}\n\nbool LoadGenesisBlock(const CChainParams& chainparams)\n{\n    return g_chainstate.LoadGenesisBlock(chainparams);\n}\n\nbool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskBlockPos *dbp)\n{\n    // Map of disk positions for blocks with unknown parent (only used for reindex)\n    static std::multimap<uint256, CDiskBlockPos> mapBlocksUnknownParent;\n    int64_t nStart = GetTimeMillis();\n\n    int nLoaded = 0;\n    try {\n        // This takes over fileIn and calls fclose() on it in the CBufferedFile destructor\n        CBufferedFile blkdat(fileIn, 2*MAX_BLOCK_SERIALIZED_SIZE, MAX_BLOCK_SERIALIZED_SIZE+8, SER_DISK, CLIENT_VERSION);\n        uint64_t nRewind = blkdat.GetPos();\n        while (!blkdat.eof()) {\n            boost::this_thread::interruption_point();\n\n            blkdat.SetPos(nRewind);\n            nRewind++; // start one byte further next time, in case of failure\n            blkdat.SetLimit(); // remove former limit\n            unsigned int nSize = 0;\n            try {\n                // locate a header\n                unsigned char buf[CMessageHeader::MESSAGE_START_SIZE];\n                blkdat.FindByte(chainparams.MessageStart()[0]);\n                nRewind = blkdat.GetPos()+1;\n                blkdat >> FLATDATA(buf);\n                if (memcmp(buf, chainparams.MessageStart(), CMessageHeader::MESSAGE_START_SIZE))\n                    continue;\n                // read size\n                blkdat >> nSize;\n                if (nSize < 80 || nSize > MAX_BLOCK_SERIALIZED_SIZE)\n                    continue;\n            } catch (const std::exception&) {\n                // no valid block header found; don't complain\n                break;\n            }\n            try {\n                // read block\n                uint64_t nBlockPos = blkdat.GetPos();\n                if (dbp)\n                    dbp->nPos = nBlockPos;\n                blkdat.SetLimit(nBlockPos + nSize);\n                blkdat.SetPos(nBlockPos);\n                std::shared_ptr<CBlock> pblock = std::make_shared<CBlock>();\n                CBlock& block = *pblock;\n                blkdat >> block;\n                nRewind = blkdat.GetPos();\n\n                // detect out of order blocks, and store them for later\n                uint256 hash = block.GetHash();\n                if (hash != chainparams.GetConsensus().hashGenesisBlock && mapBlockIndex.find(block.hashPrevBlock) == mapBlockIndex.end()) {\n                    LogPrint(BCLog::REINDEX, \"%s: Out of order block %s, parent %s not known\\n\", __func__, hash.ToString(),\n                            block.hashPrevBlock.ToString());\n                    if (dbp)\n                        mapBlocksUnknownParent.insert(std::make_pair(block.hashPrevBlock, *dbp));\n                    continue;\n                }\n\n                // process in case the block isn't known yet\n                if (mapBlockIndex.count(hash) == 0 || (mapBlockIndex[hash]->nStatus & BLOCK_HAVE_DATA) == 0) {\n                    LOCK(cs_main);\n                    CValidationState state;\n                    if (g_chainstate.AcceptBlock(pblock, state, chainparams, nullptr, true, dbp, nullptr))\n                        nLoaded++;\n                    if (state.IsError())\n                        break;\n                } else if (hash != chainparams.GetConsensus().hashGenesisBlock && mapBlockIndex[hash]->nHeight % 1000 == 0) {\n                    LogPrint(BCLog::REINDEX, \"Block Import: already had block %s at height %d\\n\", hash.ToString(), mapBlockIndex[hash]->nHeight);\n                }\n\n                // Activate the genesis block so normal node progress can continue\n                if (hash == chainparams.GetConsensus().hashGenesisBlock) {\n                    CValidationState state;\n                    if (!ActivateBestChain(state, chainparams)) {\n                        break;\n                    }\n                }\n\n                NotifyHeaderTip();\n\n                // Recursively process earlier encountered successors of this block\n                std::deque<uint256> queue;\n                queue.push_back(hash);\n                while (!queue.empty()) {\n                    uint256 head = queue.front();\n                    queue.pop_front();\n                    std::pair<std::multimap<uint256, CDiskBlockPos>::iterator, std::multimap<uint256, CDiskBlockPos>::iterator> range = mapBlocksUnknownParent.equal_range(head);\n                    while (range.first != range.second) {\n                        std::multimap<uint256, CDiskBlockPos>::iterator it = range.first;\n                        std::shared_ptr<CBlock> pblockrecursive = std::make_shared<CBlock>();\n                        if (ReadBlockFromDisk(*pblockrecursive, it->second, chainparams.GetConsensus()))\n                        {\n                            LogPrint(BCLog::REINDEX, \"%s: Processing out of order child %s of %s\\n\", __func__, pblockrecursive->GetHash().ToString(),\n                                    head.ToString());\n                            LOCK(cs_main);\n                            CValidationState dummy;\n                            if (g_chainstate.AcceptBlock(pblockrecursive, dummy, chainparams, nullptr, true, &it->second, nullptr))\n                            {\n                                nLoaded++;\n                                queue.push_back(pblockrecursive->GetHash());\n                            }\n                        }\n                        range.first++;\n                        mapBlocksUnknownParent.erase(it);\n                        NotifyHeaderTip();\n                    }\n                }\n            } catch (const std::exception& e) {\n                LogPrintf(\"%s: Deserialize or I/O error - %s\\n\", __func__, e.what());\n            }\n        }\n    } catch (const std::runtime_error& e) {\n        AbortNode(std::string(\"System error: \") + e.what());\n    }\n    if (nLoaded > 0)\n        LogPrintf(\"Loaded %i blocks from external file in %dms\\n\", nLoaded, GetTimeMillis() - nStart);\n    return nLoaded > 0;\n}\n\nvoid CChainState::CheckBlockIndex(const Consensus::Params& consensusParams)\n{\n    if (!fCheckBlockIndex) {\n        return;\n    }\n\n    LOCK(cs_main);\n\n    // During a reindex, we read the genesis block and call CheckBlockIndex before ActivateBestChain,\n    // so we have the genesis block in mapBlockIndex but no active chain.  (A few of the tests when\n    // iterating the block tree require that chainActive has been initialized.)\n    if (chainActive.Height() < 0) {\n        assert(mapBlockIndex.size() <= 1);\n        return;\n    }\n\n    // Build forward-pointing map of the entire block tree.\n    std::multimap<CBlockIndex*,CBlockIndex*> forward;\n    for (auto& entry : mapBlockIndex) {\n        forward.insert(std::make_pair(entry.second->pprev, entry.second));\n    }\n\n    assert(forward.size() == mapBlockIndex.size());\n\n    std::pair<std::multimap<CBlockIndex*,CBlockIndex*>::iterator,std::multimap<CBlockIndex*,CBlockIndex*>::iterator> rangeGenesis = forward.equal_range(nullptr);\n    CBlockIndex *pindex = rangeGenesis.first->second;\n    rangeGenesis.first++;\n    assert(rangeGenesis.first == rangeGenesis.second); // There is only one index entry with parent nullptr.\n\n    // Iterate over the entire block tree, using depth-first search.\n    // Along the way, remember whether there are blocks on the path from genesis\n    // block being explored which are the first to have certain properties.\n    size_t nNodes = 0;\n    int nHeight = 0;\n    CBlockIndex* pindexFirstInvalid = nullptr; // Oldest ancestor of pindex which is invalid.\n    CBlockIndex* pindexFirstMissing = nullptr; // Oldest ancestor of pindex which does not have BLOCK_HAVE_DATA.\n    CBlockIndex* pindexFirstNeverProcessed = nullptr; // Oldest ancestor of pindex for which nTx == 0.\n    CBlockIndex* pindexFirstNotTreeValid = nullptr; // Oldest ancestor of pindex which does not have BLOCK_VALID_TREE (regardless of being valid or not).\n    CBlockIndex* pindexFirstNotTransactionsValid = nullptr; // Oldest ancestor of pindex which does not have BLOCK_VALID_TRANSACTIONS (regardless of being valid or not).\n    CBlockIndex* pindexFirstNotChainValid = nullptr; // Oldest ancestor of pindex which does not have BLOCK_VALID_CHAIN (regardless of being valid or not).\n    CBlockIndex* pindexFirstNotScriptsValid = nullptr; // Oldest ancestor of pindex which does not have BLOCK_VALID_SCRIPTS (regardless of being valid or not).\n    while (pindex != nullptr) {\n        nNodes++;\n        if (pindexFirstInvalid == nullptr && pindex->nStatus & BLOCK_FAILED_VALID) pindexFirstInvalid = pindex;\n        if (pindexFirstMissing == nullptr && !(pindex->nStatus & BLOCK_HAVE_DATA)) pindexFirstMissing = pindex;\n        if (pindexFirstNeverProcessed == nullptr && pindex->nTx == 0) pindexFirstNeverProcessed = pindex;\n        if (pindex->pprev != nullptr && pindexFirstNotTreeValid == nullptr && (pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_TREE) pindexFirstNotTreeValid = pindex;\n        if (pindex->pprev != nullptr && pindexFirstNotTransactionsValid == nullptr && (pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_TRANSACTIONS) pindexFirstNotTransactionsValid = pindex;\n        if (pindex->pprev != nullptr && pindexFirstNotChainValid == nullptr && (pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_CHAIN) pindexFirstNotChainValid = pindex;\n        if (pindex->pprev != nullptr && pindexFirstNotScriptsValid == nullptr && (pindex->nStatus & BLOCK_VALID_MASK) < BLOCK_VALID_SCRIPTS) pindexFirstNotScriptsValid = pindex;\n\n        // Begin: actual consistency checks.\n        if (pindex->pprev == nullptr) {\n            // Genesis block checks.\n            assert(pindex->GetBlockHash() == consensusParams.hashGenesisBlock); // Genesis block's hash must match.\n            assert(pindex == chainActive.Genesis()); // The current active chain's genesis block must be this block.\n        }\n        if (pindex->nChainTx == 0) assert(pindex->nSequenceId <= 0);  // nSequenceId can't be set positive for blocks that aren't linked (negative is used for preciousblock)\n        // VALID_TRANSACTIONS is equivalent to nTx > 0 for all nodes (whether or not pruning has occurred).\n        // HAVE_DATA is only equivalent to nTx > 0 (or VALID_TRANSACTIONS) if no pruning has occurred.\n        if (!fHavePruned) {\n            // If we've never pruned, then HAVE_DATA should be equivalent to nTx > 0\n            assert(!(pindex->nStatus & BLOCK_HAVE_DATA) == (pindex->nTx == 0));\n            assert(pindexFirstMissing == pindexFirstNeverProcessed);\n        } else {\n            // If we have pruned, then we can only say that HAVE_DATA implies nTx > 0\n            if (pindex->nStatus & BLOCK_HAVE_DATA) assert(pindex->nTx > 0);\n        }\n        if (pindex->nStatus & BLOCK_HAVE_UNDO) assert(pindex->nStatus & BLOCK_HAVE_DATA);\n        assert(((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TRANSACTIONS) == (pindex->nTx > 0)); // This is pruning-independent.\n        // All parents having had data (at some point) is equivalent to all parents being VALID_TRANSACTIONS, which is equivalent to nChainTx being set.\n        assert((pindexFirstNeverProcessed != nullptr) == (pindex->nChainTx == 0)); // nChainTx != 0 is used to signal that all parent blocks have been processed (but may have been pruned).\n        assert((pindexFirstNotTransactionsValid != nullptr) == (pindex->nChainTx == 0));\n        assert(pindex->nHeight == nHeight); // nHeight must be consistent.\n        assert(pindex->pprev == nullptr || pindex->nChainWork >= pindex->pprev->nChainWork); // For every block except the genesis block, the chainwork must be larger than the parent's.\n        assert(nHeight < 2 || (pindex->pskip && (pindex->pskip->nHeight < nHeight))); // The pskip pointer must point back for all but the first 2 blocks.\n        assert(pindexFirstNotTreeValid == nullptr); // All mapBlockIndex entries must at least be TREE valid\n        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_TREE) assert(pindexFirstNotTreeValid == nullptr); // TREE valid implies all parents are TREE valid\n        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_CHAIN) assert(pindexFirstNotChainValid == nullptr); // CHAIN valid implies all parents are CHAIN valid\n        if ((pindex->nStatus & BLOCK_VALID_MASK) >= BLOCK_VALID_SCRIPTS) assert(pindexFirstNotScriptsValid == nullptr); // SCRIPTS valid implies all parents are SCRIPTS valid\n        if (pindexFirstInvalid == nullptr) {\n            // Checks for not-invalid blocks.\n            assert((pindex->nStatus & BLOCK_FAILED_MASK) == 0); // The failed mask cannot be set for blocks without invalid parents.\n        }\n        if (!CBlockIndexWorkComparator()(pindex, chainActive.Tip()) && pindexFirstNeverProcessed == nullptr) {\n            if (pindexFirstInvalid == nullptr) {\n                // If this block sorts at least as good as the current tip and\n                // is valid and we have all data for its parents, it must be in\n                // setBlockIndexCandidates.  chainActive.Tip() must also be there\n                // even if some data has been pruned.\n                if (pindexFirstMissing == nullptr || pindex == chainActive.Tip()) {\n                    assert(setBlockIndexCandidates.count(pindex));\n                }\n                // If some parent is missing, then it could be that this block was in\n                // setBlockIndexCandidates but had to be removed because of the missing data.\n                // In this case it must be in mapBlocksUnlinked -- see test below.\n            }\n        } else { // If this block sorts worse than the current tip or some ancestor's block has never been seen, it cannot be in setBlockIndexCandidates.\n            assert(setBlockIndexCandidates.count(pindex) == 0);\n        }\n        // Check whether this block is in mapBlocksUnlinked.\n        std::pair<std::multimap<CBlockIndex*,CBlockIndex*>::iterator,std::multimap<CBlockIndex*,CBlockIndex*>::iterator> rangeUnlinked = mapBlocksUnlinked.equal_range(pindex->pprev);\n        bool foundInUnlinked = false;\n        while (rangeUnlinked.first != rangeUnlinked.second) {\n            assert(rangeUnlinked.first->first == pindex->pprev);\n            if (rangeUnlinked.first->second == pindex) {\n                foundInUnlinked = true;\n                break;\n            }\n            rangeUnlinked.first++;\n        }\n        if (pindex->pprev && (pindex->nStatus & BLOCK_HAVE_DATA) && pindexFirstNeverProcessed != nullptr && pindexFirstInvalid == nullptr) {\n            // If this block has block data available, some parent was never received, and has no invalid parents, it must be in mapBlocksUnlinked.\n            assert(foundInUnlinked);\n        }\n        if (!(pindex->nStatus & BLOCK_HAVE_DATA)) assert(!foundInUnlinked); // Can't be in mapBlocksUnlinked if we don't HAVE_DATA\n        if (pindexFirstMissing == nullptr) assert(!foundInUnlinked); // We aren't missing data for any parent -- cannot be in mapBlocksUnlinked.\n        if (pindex->pprev && (pindex->nStatus & BLOCK_HAVE_DATA) && pindexFirstNeverProcessed == nullptr && pindexFirstMissing != nullptr) {\n            // We HAVE_DATA for this block, have received data for all parents at some point, but we're currently missing data for some parent.\n            assert(fHavePruned); // We must have pruned.\n            // This block may have entered mapBlocksUnlinked if:\n            //  - it has a descendant that at some point had more work than the\n            //    tip, and\n            //  - we tried switching to that descendant but were missing\n            //    data for some intermediate block between chainActive and the\n            //    tip.\n            // So if this block is itself better than chainActive.Tip() and it wasn't in\n            // setBlockIndexCandidates, then it must be in mapBlocksUnlinked.\n            if (!CBlockIndexWorkComparator()(pindex, chainActive.Tip()) && setBlockIndexCandidates.count(pindex) == 0) {\n                if (pindexFirstInvalid == nullptr) {\n                    assert(foundInUnlinked);\n                }\n            }\n        }\n        // assert(pindex->GetBlockHash() == pindex->GetBlockHeader().GetHash()); // Perhaps too slow\n        // End: actual consistency checks.\n\n        // Try descending into the first subnode.\n        std::pair<std::multimap<CBlockIndex*,CBlockIndex*>::iterator,std::multimap<CBlockIndex*,CBlockIndex*>::iterator> range = forward.equal_range(pindex);\n        if (range.first != range.second) {\n            // A subnode was found.\n            pindex = range.first->second;\n            nHeight++;\n            continue;\n        }\n        // This is a leaf node.\n        // Move upwards until we reach a node of which we have not yet visited the last child.\n        while (pindex) {\n            // We are going to either move to a parent or a sibling of pindex.\n            // If pindex was the first with a certain property, unset the corresponding variable.\n            if (pindex == pindexFirstInvalid) pindexFirstInvalid = nullptr;\n            if (pindex == pindexFirstMissing) pindexFirstMissing = nullptr;\n            if (pindex == pindexFirstNeverProcessed) pindexFirstNeverProcessed = nullptr;\n            if (pindex == pindexFirstNotTreeValid) pindexFirstNotTreeValid = nullptr;\n            if (pindex == pindexFirstNotTransactionsValid) pindexFirstNotTransactionsValid = nullptr;\n            if (pindex == pindexFirstNotChainValid) pindexFirstNotChainValid = nullptr;\n            if (pindex == pindexFirstNotScriptsValid) pindexFirstNotScriptsValid = nullptr;\n            // Find our parent.\n            CBlockIndex* pindexPar = pindex->pprev;\n            // Find which child we just visited.\n            std::pair<std::multimap<CBlockIndex*,CBlockIndex*>::iterator,std::multimap<CBlockIndex*,CBlockIndex*>::iterator> rangePar = forward.equal_range(pindexPar);\n            while (rangePar.first->second != pindex) {\n                assert(rangePar.first != rangePar.second); // Our parent must have at least the node we're coming from as child.\n                rangePar.first++;\n            }\n            // Proceed to the next one.\n            rangePar.first++;\n            if (rangePar.first != rangePar.second) {\n                // Move to the sibling.\n                pindex = rangePar.first->second;\n                break;\n            } else {\n                // Move up further.\n                pindex = pindexPar;\n                nHeight--;\n                continue;\n            }\n        }\n    }\n\n    // Check that we actually traversed the entire map.\n    assert(nNodes == forward.size());\n}\n\nstd::string CBlockFileInfo::ToString() const\n{\n    return strprintf(\"CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)\", nBlocks, nSize, nHeightFirst, nHeightLast, DateTimeStrFormat(\"%Y-%m-%d\", nTimeFirst), DateTimeStrFormat(\"%Y-%m-%d\", nTimeLast));\n}\n\nCBlockFileInfo* GetBlockFileInfo(size_t n)\n{\n    LOCK(cs_LastBlockFile);\n\n    return &vinfoBlockFile.at(n);\n}\n\nThresholdState VersionBitsTipState(const Consensus::Params& params, Consensus::DeploymentPos pos)\n{\n    LOCK(cs_main);\n    return VersionBitsState(chainActive.Tip(), params, pos, versionbitscache);\n}\n\nBIP9Stats VersionBitsTipStatistics(const Consensus::Params& params, Consensus::DeploymentPos pos)\n{\n    LOCK(cs_main);\n    return VersionBitsStatistics(chainActive.Tip(), params, pos);\n}\n\nint VersionBitsTipStateSinceHeight(const Consensus::Params& params, Consensus::DeploymentPos pos)\n{\n    LOCK(cs_main);\n    return VersionBitsStateSinceHeight(chainActive.Tip(), params, pos, versionbitscache);\n}\n\nstatic const uint64_t MEMPOOL_DUMP_VERSION = 1;\n\nbool LoadMempool(void)\n{\n    const CChainParams& chainparams = Params();\n    int64_t nExpiryTimeout = gArgs.GetArg(\"-mempoolexpiry\", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60;\n    FILE* filestr = fsbridge::fopen(GetDataDir() / \"mempool.dat\", \"rb\");\n    CAutoFile file(filestr, SER_DISK, CLIENT_VERSION);\n    if (file.IsNull()) {\n        LogPrintf(\"Failed to open mempool file from disk. Continuing anyway.\\n\");\n        return false;\n    }\n\n    int64_t count = 0;\n    int64_t expired = 0;\n    int64_t failed = 0;\n    int64_t already_there = 0;\n    int64_t nNow = GetTime();\n\n    try {\n        uint64_t version;\n        file >> version;\n        if (version != MEMPOOL_DUMP_VERSION) {\n            return false;\n        }\n        uint64_t num;\n        file >> num;\n        while (num--) {\n            CTransactionRef tx;\n            int64_t nTime;\n            int64_t nFeeDelta;\n            file >> tx;\n            file >> nTime;\n            file >> nFeeDelta;\n\n            CAmount amountdelta = nFeeDelta;\n            if (amountdelta) {\n                mempool.PrioritiseTransaction(tx->GetHash(), amountdelta);\n            }\n            CValidationState state;\n            if (nTime + nExpiryTimeout > nNow) {\n                LOCK(cs_main);\n                AcceptToMemoryPoolWithTime(chainparams, mempool, state, tx, nullptr /* pfMissingInputs */, nTime,\n                                           nullptr /* plTxnReplaced */, false /* bypass_limits */, 0 /* nAbsurdFee */);\n                if (state.IsValid()) {\n                    ++count;\n                } else {\n                    // mempool may contain the transaction already, e.g. from\n                    // wallet(s) having loaded it while we were processing\n                    // mempool transactions; consider these as valid, instead of\n                    // failed, but mark them as 'already there'\n                    if (mempool.exists(tx->GetHash())) {\n                        ++already_there;\n                    } else {\n                        ++failed;\n                    }\n                }\n            } else {\n                ++expired;\n            }\n            if (ShutdownRequested())\n                return false;\n        }\n        std::map<uint256, CAmount> mapDeltas;\n        file >> mapDeltas;\n\n        for (const auto& i : mapDeltas) {\n            mempool.PrioritiseTransaction(i.first, i.second);\n        }\n    } catch (const std::exception& e) {\n        LogPrintf(\"Failed to deserialize mempool data on disk: %s. Continuing anyway.\\n\", e.what());\n        return false;\n    }\n\n    LogPrintf(\"Imported mempool transactions from disk: %i succeeded, %i failed, %i expired, %i already there\\n\", count, failed, expired, already_there);\n    return true;\n}\n\nbool DumpMempool(void)\n{\n    int64_t start = GetTimeMicros();\n\n    std::map<uint256, CAmount> mapDeltas;\n    std::vector<TxMempoolInfo> vinfo;\n\n    {\n        LOCK(mempool.cs);\n        for (const auto &i : mempool.mapDeltas) {\n            mapDeltas[i.first] = i.second;\n        }\n        vinfo = mempool.infoAll();\n    }\n\n    int64_t mid = GetTimeMicros();\n\n    try {\n        FILE* filestr = fsbridge::fopen(GetDataDir() / \"mempool.dat.new\", \"wb\");\n        if (!filestr) {\n            return false;\n        }\n\n        CAutoFile file(filestr, SER_DISK, CLIENT_VERSION);\n\n        uint64_t version = MEMPOOL_DUMP_VERSION;\n        file << version;\n\n        file << (uint64_t)vinfo.size();\n        for (const auto& i : vinfo) {\n            file << *(i.tx);\n            file << (int64_t)i.nTime;\n            file << (int64_t)i.nFeeDelta;\n            mapDeltas.erase(i.tx->GetHash());\n        }\n\n        file << mapDeltas;\n        FileCommit(file.Get());\n        file.fclose();\n        RenameOver(GetDataDir() / \"mempool.dat.new\", GetDataDir() / \"mempool.dat\");\n        int64_t last = GetTimeMicros();\n        LogPrintf(\"Dumped mempool: %gs to copy, %gs to dump\\n\", (mid-start)*MICRO, (last-mid)*MICRO);\n    } catch (const std::exception& e) {\n        LogPrintf(\"Failed to dump mempool: %s. Continuing anyway.\\n\", e.what());\n        return false;\n    }\n    return true;\n}\n\n//! Guess how far we are in the verification process at the given block index\ndouble GuessVerificationProgress(const ChainTxData& data, const CBlockIndex *pindex) {\n    if (pindex == nullptr)\n        return 0.0;\n\n    int64_t nNow = time(nullptr);\n\n    double fTxTotal;\n\n    if (pindex->nChainTx <= data.nTxCount) {\n        fTxTotal = data.nTxCount + (nNow - data.nTime) * data.dTxRate;\n    } else {\n        fTxTotal = pindex->nChainTx + (nNow - pindex->GetBlockTime()) * data.dTxRate;\n    }\n\n    return pindex->nChainTx / fTxTotal;\n}\n\nclass CMainCleanup\n{\npublic:\n    CMainCleanup() {}\n    ~CMainCleanup() {\n        // block headers\n        BlockMap::iterator it1 = mapBlockIndex.begin();\n        for (; it1 != mapBlockIndex.end(); it1++)\n            delete (*it1).second;\n        mapBlockIndex.clear();\n    }\n} instance_of_cmaincleanup;\n"
  },
  {
    "path": "src/validation.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_VALIDATION_H\n#define BITCOIN_VALIDATION_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <amount.h>\n#include <coins.h>\n#include <fs.h>\n#include <protocol.h> // For CMessageHeader::MessageStartChars\n#include <policy/feerate.h>\n#include <script/script_error.h>\n#include <sync.h>\n#include <versionbits.h>\n\n#include <algorithm>\n#include <exception>\n#include <map>\n#include <memory>\n#include <set>\n#include <stdint.h>\n#include <string>\n#include <utility>\n#include <vector>\n\n#include <atomic>\n\nclass CBlockIndex;\nclass CBlockTreeDB;\nclass CChainParams;\nclass CCoinsViewDB;\nclass CInv;\nclass CConnman;\nclass CScriptCheck;\nclass CBlockPolicyEstimator;\nclass CTxMemPool;\nclass CValidationState;\nstruct ChainTxData;\n\nstruct PrecomputedTransactionData;\nstruct LockPoints;\n\n/** Default for -whitelistrelay. */\nstatic const bool DEFAULT_WHITELISTRELAY = true;\n/** Default for -whitelistforcerelay. */\nstatic const bool DEFAULT_WHITELISTFORCERELAY = true;\n/** Default for -minrelaytxfee, minimum relay fee for transactions */\nstatic const unsigned int DEFAULT_MIN_RELAY_TX_FEE = 1000;\n//! -maxtxfee default\nstatic const CAmount DEFAULT_TRANSACTION_MAXFEE = 0.1 * COIN;\n//! Discourage users to set fees higher than this amount (in satoshis) per kB\nstatic const CAmount HIGH_TX_FEE_PER_KB = 0.01 * COIN;\n//! -maxtxfee will warn if called with a higher fee than this amount (in satoshis)\nstatic const CAmount HIGH_MAX_TX_FEE = 100 * HIGH_TX_FEE_PER_KB;\n/** Default for -limitancestorcount, max number of in-mempool ancestors */\nstatic const unsigned int DEFAULT_ANCESTOR_LIMIT = 25;\n/** Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors */\nstatic const unsigned int DEFAULT_ANCESTOR_SIZE_LIMIT = 101;\n/** Default for -limitdescendantcount, max number of in-mempool descendants */\nstatic const unsigned int DEFAULT_DESCENDANT_LIMIT = 25;\n/** Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants */\nstatic const unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT = 101;\n/** Default for -mempoolexpiry, expiration time for mempool transactions in hours */\nstatic const unsigned int DEFAULT_MEMPOOL_EXPIRY = 336;\n/** Maximum kilobytes for transactions to store for processing during reorg */\nstatic const unsigned int MAX_DISCONNECTED_TX_POOL_SIZE = 20000;\n/** The maximum size of a blk?????.dat file (since 0.8) */\nstatic const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB\n/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */\nstatic const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB\n/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */\nstatic const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB\n\n/** Maximum number of script-checking threads allowed */\nstatic const int MAX_SCRIPTCHECK_THREADS = 16;\n/** -par default (number of script-checking threads, 0 = auto) */\nstatic const int DEFAULT_SCRIPTCHECK_THREADS = 0;\n\n/** Number of blocks that can be requested at any given time from a single peer. */\n// FIXME.SUGAR\n// GetPoWHash_cached\n/** IBD: which sets MAX_BLOCKS_IN_TRANSIT_PER_PEER to be same as MAX_HEADERS_RESULTS.\n *  Without this change, at least in Resistance the block headers download would get unnecessarily\n *  far ahead of the full blocks download, resulting in more work lost and redone in case the\n *  initial blocks download is interrupted and continued.\n *  The work loss is because we do not yet store cached PoWs on disk. */\nstatic const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 2000; // (was 16)\n\n/** Timeout in seconds during which a peer must stall block download progress before being disconnected. */\nstatic const unsigned int BLOCK_STALLING_TIMEOUT = 2;\n/** Number of headers sent in one getheaders result. We rely on the assumption that if a peer sends\n *  less than this number, we reached its tip. Changing this value is a protocol upgrade. */\nstatic const unsigned int MAX_HEADERS_RESULTS = 2000;\n/** Maximum depth of blocks we're willing to serve as compact blocks to peers\n *  when requested. For older blocks, a regular BLOCK response will be sent. */\nstatic const int MAX_CMPCTBLOCK_DEPTH = 5;\n/** Maximum depth of blocks we're willing to respond to GETBLOCKTXN requests for. */\nstatic const int MAX_BLOCKTXN_DEPTH = 10;\n/** Size of the \"block download window\": how far ahead of our current height do we fetch?\n *  Larger windows tolerate larger download speed differences between peer, but increase the potential\n *  degree of disordering of blocks on disk (which make reindexing and pruning harder). We'll probably\n *  want to make this a per-peer adaptive value at some point. */\nstatic const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024;\n/** Time to wait (in seconds) between writing blocks/block index to disk. */\nstatic const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60;\n/** Time to wait (in seconds) between flushing chainstate to disk. */\nstatic const unsigned int DATABASE_FLUSH_INTERVAL = 24 * 60 * 60;\n/** Maximum length of reject messages. */\nstatic const unsigned int MAX_REJECT_MESSAGE_LENGTH = 111;\n/** Average delay between local address broadcasts in seconds. */\nstatic const unsigned int AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL = 24 * 60 * 60;\n/** Average delay between peer address broadcasts in seconds. */\nstatic const unsigned int AVG_ADDRESS_BROADCAST_INTERVAL = 30;\n/** Average delay between trickled inventory transmissions in seconds.\n *  Blocks and whitelisted receivers bypass this, outbound peers get half this delay. */\nstatic const unsigned int INVENTORY_BROADCAST_INTERVAL = 5;\n/** Maximum number of inventory items to send per transmission.\n *  Limits the impact of low-fee transaction floods. */\nstatic const unsigned int INVENTORY_BROADCAST_MAX = 7 * INVENTORY_BROADCAST_INTERVAL;\n/** Average delay between feefilter broadcasts in seconds. */\nstatic const unsigned int AVG_FEEFILTER_BROADCAST_INTERVAL = 10 * 60;\n/** Maximum feefilter broadcast delay after significant change. */\nstatic const unsigned int MAX_FEEFILTER_CHANGE_DELAY = 5 * 60;\n/** Block download timeout base, expressed in millionths of the block interval (i.e. 10 min) */\nstatic const int64_t BLOCK_DOWNLOAD_TIMEOUT_BASE = 1000000;\n/** Additional block download timeout per parallel downloading peer (i.e. 5 min) */\nstatic const int64_t BLOCK_DOWNLOAD_TIMEOUT_PER_PEER = 500000;\n\nstatic const int64_t DEFAULT_MAX_TIP_AGE = 24 * 60 * 60;\n/** Maximum age of our tip in seconds for us to be considered current for fee estimation */\nstatic const int64_t MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60;\n\n/** Default for -permitbaremultisig */\nstatic const bool DEFAULT_PERMIT_BAREMULTISIG = true;\nstatic const bool DEFAULT_CHECKPOINTS_ENABLED = true;\nstatic const bool DEFAULT_TXINDEX = false;\nstatic const unsigned int DEFAULT_BANSCORE_THRESHOLD = 100;\n/** Default for -persistmempool */\nstatic const bool DEFAULT_PERSIST_MEMPOOL = true;\n/** Default for -mempoolreplacement */\nstatic const bool DEFAULT_ENABLE_REPLACEMENT = true;\n/** Default for using fee filter */\nstatic const bool DEFAULT_FEEFILTER = true;\n\n/** Maximum number of headers to announce when relaying blocks with headers message.*/\nstatic const unsigned int MAX_BLOCKS_TO_ANNOUNCE = 8;\n\n/** Maximum number of unconnecting headers announcements before DoS score */\nstatic const int MAX_UNCONNECTING_HEADERS = 10;\n\nstatic const bool DEFAULT_PEERBLOOMFILTERS = true;\n\n/** Default for -stopatheight */\nstatic const int DEFAULT_STOPATHEIGHT = 0;\n\nstruct BlockHasher\n{\n    size_t operator()(const uint256& hash) const { return hash.GetCheapHash(); }\n};\n\nextern CScript COINBASE_FLAGS;\nextern CCriticalSection cs_main;\nextern CBlockPolicyEstimator feeEstimator;\nextern CTxMemPool mempool;\ntypedef std::unordered_map<uint256, CBlockIndex*, BlockHasher> BlockMap;\nextern BlockMap& mapBlockIndex;\nextern uint64_t nLastBlockTx;\nextern uint64_t nLastBlockWeight;\nextern const std::string strMessageMagic;\nextern CWaitableCriticalSection csBestBlock;\nextern CConditionVariable cvBlockChange;\nextern uint256 hashBestBlock;\nextern std::atomic_bool fImporting;\nextern std::atomic_bool fReindex;\nextern int nScriptCheckThreads;\nextern bool fTxIndex;\nextern bool fIsBareMultisigStd;\nextern bool fRequireStandard;\nextern bool fCheckBlockIndex;\nextern bool fCheckpointsEnabled;\nextern size_t nCoinCacheUsage;\n/** A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation) */\nextern CFeeRate minRelayTxFee;\n/** Absolute maximum transaction fee (in satoshis) used by wallet and mempool (rejects high fee in sendrawtransaction) */\nextern CAmount maxTxFee;\n/** If the tip is older than this (in seconds), the node is considered to be in initial block download. */\nextern int64_t nMaxTipAge;\nextern bool fEnableReplacement;\n\n/** Block hash whose ancestors we will assume to have valid scripts without checking them. */\nextern uint256 hashAssumeValid;\n\n/** Minimum work we will assume exists on some valid chain. */\nextern arith_uint256 nMinimumChainWork;\n\n/** Best header we've seen so far (used for getheaders queries' starting points). */\nextern CBlockIndex *pindexBestHeader;\n\n/** Minimum disk space required - used in CheckDiskSpace() */\nstatic const uint64_t nMinDiskSpace = 52428800;\n\n/** Pruning-related variables and constants */\n/** True if any block files have ever been pruned. */\nextern bool fHavePruned;\n/** True if we're running in -prune mode. */\nextern bool fPruneMode;\n/** Number of MiB of block files that we're trying to stay below. */\nextern uint64_t nPruneTarget;\n/** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of chainActive.Tip() will not be pruned. */\nstatic const unsigned int MIN_BLOCKS_TO_KEEP = 288;\n/** Minimum blocks required to signal NODE_NETWORK_LIMITED */\nstatic const unsigned int NODE_NETWORK_LIMITED_MIN_BLOCKS = 288;\n\nstatic const signed int DEFAULT_CHECKBLOCKS = 6;\nstatic const unsigned int DEFAULT_CHECKLEVEL = 3;\n\n// Require that user allocate at least 550MB for block & undo files (blk???.dat and rev???.dat)\n// At 1MB per block, 288 blocks = 288MB.\n// Add 15% for Undo data = 331MB\n// Add 20% for Orphan block rate = 397MB\n// We want the low water mark after pruning to be at least 397 MB and since we prune in\n// full block file chunks, we need the high water mark which triggers the prune to be\n// one 128MB block file + added 15% undo data = 147MB greater for a total of 545MB\n// Setting the target to > than 550MB will make it likely we can respect the target.\nstatic const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024;\n\n/** \n * Process an incoming block. This only returns after the best known valid\n * block is made active. Note that it does not, however, guarantee that the\n * specific block passed to it has been checked for validity!\n *\n * If you want to *possibly* get feedback on whether pblock is valid, you must\n * install a CValidationInterface (see validationinterface.h) - this will have\n * its BlockChecked method called whenever *any* block completes validation.\n *\n * Note that we guarantee that either the proof-of-work is valid on pblock, or\n * (and possibly also) BlockChecked will have been called.\n * \n * Call without cs_main held.\n *\n * @param[in]   pblock  The block we want to process.\n * @param[in]   fForceProcessing Process this block even if unrequested; used for non-network block sources and whitelisted peers.\n * @param[out]  fNewBlock A boolean which is set to indicate if the block was first received via this call\n * @return True if state.IsValid()\n */\nbool ProcessNewBlock(const CChainParams& chainparams, const std::shared_ptr<const CBlock> pblock, bool fForceProcessing, bool* fNewBlock);\n\n/**\n * Process incoming block headers.\n *\n * Call without cs_main held.\n *\n * @param[in]  block The block headers themselves\n * @param[out] state This may be set to an Error state if any error occurred processing them\n * @param[in]  chainparams The params for the chain we want to connect to\n * @param[out] ppindex If set, the pointer will be set to point to the last new block index object for the given headers\n * @param[out] first_invalid First header that fails validation, if one exists\n */\nbool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& block, CValidationState& state, const CChainParams& chainparams, const CBlockIndex** ppindex=nullptr, CBlockHeader *first_invalid=nullptr);\n\n/** Check whether enough disk space is available for an incoming block */\nbool CheckDiskSpace(uint64_t nAdditionalBytes = 0);\n/** Open a block file (blk?????.dat) */\nFILE* OpenBlockFile(const CDiskBlockPos &pos, bool fReadOnly = false);\n/** Translation to a filesystem path */\nfs::path GetBlockPosFilename(const CDiskBlockPos &pos, const char *prefix);\n/** Import blocks from an external file */\nbool LoadExternalBlockFile(const CChainParams& chainparams, FILE* fileIn, CDiskBlockPos *dbp = nullptr);\n/** Ensures we have a genesis block in the block tree, possibly writing one to disk. */\nbool LoadGenesisBlock(const CChainParams& chainparams);\n/** Load the block tree and coins database from disk,\n * initializing state if we're running with -reindex. */\nbool LoadBlockIndex(const CChainParams& chainparams);\n/** Update the chain tip based on database information. */\nbool LoadChainTip(const CChainParams& chainparams);\n/** Unload database information */\nvoid UnloadBlockIndex();\n/** Run an instance of the script checking thread */\nvoid ThreadScriptCheck();\n/** Check whether we are doing an initial block download (synchronizing from disk or network) */\nbool IsInitialBlockDownload();\n/** Retrieve a transaction (from memory pool, or from disk, if possible) */\nbool GetTransaction(const uint256& hash, CTransactionRef& tx, const Consensus::Params& params, uint256& hashBlock, bool fAllowSlow = false, CBlockIndex* blockIndex = nullptr);\n/** Find the best known block, and make it the tip of the block chain */\nbool ActivateBestChain(CValidationState& state, const CChainParams& chainparams, std::shared_ptr<const CBlock> pblock = std::shared_ptr<const CBlock>());\nCAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams);\n\n/** Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip). */\ndouble GuessVerificationProgress(const ChainTxData& data, const CBlockIndex* pindex);\n\n/** Calculate the amount of disk space the block & undo files currently use */\nuint64_t CalculateCurrentUsage();\n\n/**\n *  Mark one block file as pruned.\n */\nvoid PruneOneBlockFile(const int fileNumber);\n\n/**\n *  Actually unlink the specified files\n */\nvoid UnlinkPrunedFiles(const std::set<int>& setFilesToPrune);\n\n/** Flush all state, indexes and buffers to disk. */\nvoid FlushStateToDisk();\n/** Prune block files and flush state to disk. */\nvoid PruneAndFlush();\n/** Prune block files up to a given height */\nvoid PruneBlockFilesManual(int nManualPruneHeight);\n\n/** (try to) add transaction to memory pool\n * plTxnReplaced will be appended to with all transactions replaced from mempool **/\nbool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx,\n                        bool* pfMissingInputs, std::list<CTransactionRef>* plTxnReplaced,\n                        bool bypass_limits, const CAmount nAbsurdFee);\n\n/** Convert CValidationState to a human-readable message for logging */\nstd::string FormatStateMessage(const CValidationState &state);\n\n/** Get the BIP9 state for a given deployment at the current tip. */\nThresholdState VersionBitsTipState(const Consensus::Params& params, Consensus::DeploymentPos pos);\n\n/** Get the numerical statistics for the BIP9 state for a given deployment at the current tip. */\nBIP9Stats VersionBitsTipStatistics(const Consensus::Params& params, Consensus::DeploymentPos pos);\n\n/** Get the block height at which the BIP9 deployment switched into the state for the block building on the current tip. */\nint VersionBitsTipStateSinceHeight(const Consensus::Params& params, Consensus::DeploymentPos pos);\n\n\n/** Apply the effects of this transaction on the UTXO set represented by view */\nvoid UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight);\n\n/** Transaction validation functions */\n\n/**\n * Check if transaction will be final in the next block to be created.\n *\n * Calls IsFinalTx() with current block height and appropriate block time.\n *\n * See consensus/consensus.h for flag definitions.\n */\nbool CheckFinalTx(const CTransaction &tx, int flags = -1);\n\n/**\n * Test whether the LockPoints height and time are still valid on the current chain\n */\nbool TestLockPointValidity(const LockPoints* lp);\n\n/**\n * Check if transaction will be BIP 68 final in the next block to be created.\n *\n * Simulates calling SequenceLocks() with data from the tip of the current active chain.\n * Optionally stores in LockPoints the resulting height and time calculated and the hash\n * of the block needed for calculation or skips the calculation and uses the LockPoints\n * passed in for evaluation.\n * The LockPoints should not be considered valid if CheckSequenceLocks returns false.\n *\n * See consensus/consensus.h for flag definitions.\n */\nbool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints* lp = nullptr, bool useExistingLockPoints = false);\n\n/**\n * Closure representing one script verification\n * Note that this stores references to the spending transaction \n */\nclass CScriptCheck\n{\nprivate:\n    CTxOut m_tx_out;\n    const CTransaction *ptxTo;\n    unsigned int nIn;\n    unsigned int nFlags;\n    bool cacheStore;\n    ScriptError error;\n    PrecomputedTransactionData *txdata;\n\npublic:\n    CScriptCheck(): ptxTo(nullptr), nIn(0), nFlags(0), cacheStore(false), error(SCRIPT_ERR_UNKNOWN_ERROR) {}\n    CScriptCheck(const CTxOut& outIn, const CTransaction& txToIn, unsigned int nInIn, unsigned int nFlagsIn, bool cacheIn, PrecomputedTransactionData* txdataIn) :\n        m_tx_out(outIn), ptxTo(&txToIn), nIn(nInIn), nFlags(nFlagsIn), cacheStore(cacheIn), error(SCRIPT_ERR_UNKNOWN_ERROR), txdata(txdataIn) { }\n\n    bool operator()();\n\n    void swap(CScriptCheck &check) {\n        std::swap(ptxTo, check.ptxTo);\n        std::swap(m_tx_out, check.m_tx_out);\n        std::swap(nIn, check.nIn);\n        std::swap(nFlags, check.nFlags);\n        std::swap(cacheStore, check.cacheStore);\n        std::swap(error, check.error);\n        std::swap(txdata, check.txdata);\n    }\n\n    ScriptError GetScriptError() const { return error; }\n};\n\n/** Initializes the script-execution cache */\nvoid InitScriptExecutionCache();\n\n\n/** Functions for disk access for blocks */\nbool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos, const Consensus::Params& consensusParams);\nbool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex, const Consensus::Params& consensusParams);\n\n/** Functions for validating blocks and updating the block tree */\n\n/** Context-independent validity checks */\nbool CheckBlock(const CBlock& block, CValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true, bool fCheckMerkleRoot = true);\n\n/** Check a block is completely valid from start to finish (only works on top of our current best block, with cs_main held) */\nbool TestBlockValidity(CValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true);\n\n/** Check whether witness commitments are required for block. */\nbool IsWitnessEnabled(const CBlockIndex* pindexPrev, const Consensus::Params& params);\n\n/** When there are blocks in the active chain with missing data, rewind the chainstate and remove them from the block index */\nbool RewindBlockIndex(const CChainParams& params);\n\n/** Update uncommitted block structures (currently: only the witness nonce). This is safe for submitted blocks. */\nvoid UpdateUncommittedBlockStructures(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams);\n\n/** Produce the necessary coinbase commitment for a block (modifies the hash, don't call for mined blocks). */\nstd::vector<unsigned char> GenerateCoinbaseCommitment(CBlock& block, const CBlockIndex* pindexPrev, const Consensus::Params& consensusParams);\n\n/** RAII wrapper for VerifyDB: Verify consistency of the block and coin databases */\nclass CVerifyDB {\npublic:\n    CVerifyDB();\n    ~CVerifyDB();\n    bool VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview, int nCheckLevel, int nCheckDepth);\n};\n\n/** Replay blocks that aren't fully applied to the database. */\nbool ReplayBlocks(const CChainParams& params, CCoinsView* view);\n\n/** Find the last common block between the parameter chain and a locator. */\nCBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator);\n\n/** Mark a block as precious and reorganize. */\nbool PreciousBlock(CValidationState& state, const CChainParams& params, CBlockIndex *pindex);\n\n/** Mark a block as invalid. */\nbool InvalidateBlock(CValidationState& state, const CChainParams& chainparams, CBlockIndex *pindex);\n\n/** Remove invalidity status from a block and its descendants. */\nbool ResetBlockFailureFlags(CBlockIndex *pindex);\n\n/** The currently-connected chain of blocks (protected by cs_main). */\nextern CChain& chainActive;\n\n/** Global variable that points to the coins database (protected by cs_main) */\nextern std::unique_ptr<CCoinsViewDB> pcoinsdbview;\n\n/** Global variable that points to the active CCoinsView (protected by cs_main) */\nextern std::unique_ptr<CCoinsViewCache> pcoinsTip;\n\n/** Global variable that points to the active block tree (protected by cs_main) */\nextern std::unique_ptr<CBlockTreeDB> pblocktree;\n\n/**\n * Return the spend height, which is one more than the inputs.GetBestBlock().\n * While checking, GetBestBlock() refers to the parent block. (protected by cs_main)\n * This is also true for mempool checks.\n */\nint GetSpendHeight(const CCoinsViewCache& inputs);\n\nextern VersionBitsCache versionbitscache;\n\n/**\n * Determine what nVersion a new block should use.\n */\nint32_t ComputeBlockVersion(const CBlockIndex* pindexPrev, const Consensus::Params& params);\n\n/** Reject codes greater or equal to this can be returned by AcceptToMemPool\n * for transactions, to signal internal conditions. They cannot and should not\n * be sent over the P2P network.\n */\nstatic const unsigned int REJECT_INTERNAL = 0x100;\n/** Too high fee. Can not be triggered by P2P transactions */\nstatic const unsigned int REJECT_HIGHFEE = 0x100;\n\n/** Get block file info entry for one block file */\nCBlockFileInfo* GetBlockFileInfo(size_t n);\n\n/** Dump the mempool to disk. */\nbool DumpMempool();\n\n/** Load the mempool from disk. */\nbool LoadMempool();\n\n#endif // BITCOIN_VALIDATION_H\n"
  },
  {
    "path": "src/validationinterface.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <validationinterface.h>\n\n#include <init.h>\n#include <primitives/block.h>\n#include <scheduler.h>\n#include <sync.h>\n#include <txmempool.h>\n#include <util.h>\n#include <validation.h>\n\n#include <list>\n#include <atomic>\n#include <future>\n\n#include <boost/signals2/signal.hpp>\n\nstruct MainSignalsInstance {\n    boost::signals2::signal<void (const CBlockIndex *, const CBlockIndex *, bool fInitialDownload)> UpdatedBlockTip;\n    boost::signals2::signal<void (const CTransactionRef &)> TransactionAddedToMempool;\n    boost::signals2::signal<void (const std::shared_ptr<const CBlock> &, const CBlockIndex *pindex, const std::vector<CTransactionRef>&)> BlockConnected;\n    boost::signals2::signal<void (const std::shared_ptr<const CBlock> &)> BlockDisconnected;\n    boost::signals2::signal<void (const CTransactionRef &)> TransactionRemovedFromMempool;\n    boost::signals2::signal<void (const CBlockLocator &)> SetBestChain;\n    boost::signals2::signal<void (int64_t nBestBlockTime, CConnman* connman)> Broadcast;\n    boost::signals2::signal<void (const CBlock&, const CValidationState&)> BlockChecked;\n    boost::signals2::signal<void (const CBlockIndex *, const std::shared_ptr<const CBlock>&)> NewPoWValidBlock;\n\n    // We are not allowed to assume the scheduler only runs in one thread,\n    // but must ensure all callbacks happen in-order, so we end up creating\n    // our own queue here :(\n    SingleThreadedSchedulerClient m_schedulerClient;\n\n    explicit MainSignalsInstance(CScheduler *pscheduler) : m_schedulerClient(pscheduler) {}\n};\n\nstatic CMainSignals g_signals;\n\nvoid CMainSignals::RegisterBackgroundSignalScheduler(CScheduler& scheduler) {\n    assert(!m_internals);\n    m_internals.reset(new MainSignalsInstance(&scheduler));\n}\n\nvoid CMainSignals::UnregisterBackgroundSignalScheduler() {\n    m_internals.reset(nullptr);\n}\n\nvoid CMainSignals::FlushBackgroundCallbacks() {\n    if (m_internals) {\n        m_internals->m_schedulerClient.EmptyQueue();\n    }\n}\n\nsize_t CMainSignals::CallbacksPending() {\n    if (!m_internals) return 0;\n    return m_internals->m_schedulerClient.CallbacksPending();\n}\n\nvoid CMainSignals::RegisterWithMempoolSignals(CTxMemPool& pool) {\n    pool.NotifyEntryRemoved.connect(boost::bind(&CMainSignals::MempoolEntryRemoved, this, _1, _2));\n}\n\nvoid CMainSignals::UnregisterWithMempoolSignals(CTxMemPool& pool) {\n    pool.NotifyEntryRemoved.disconnect(boost::bind(&CMainSignals::MempoolEntryRemoved, this, _1, _2));\n}\n\nCMainSignals& GetMainSignals()\n{\n    return g_signals;\n}\n\nvoid RegisterValidationInterface(CValidationInterface* pwalletIn) {\n    g_signals.m_internals->UpdatedBlockTip.connect(boost::bind(&CValidationInterface::UpdatedBlockTip, pwalletIn, _1, _2, _3));\n    g_signals.m_internals->TransactionAddedToMempool.connect(boost::bind(&CValidationInterface::TransactionAddedToMempool, pwalletIn, _1));\n    g_signals.m_internals->BlockConnected.connect(boost::bind(&CValidationInterface::BlockConnected, pwalletIn, _1, _2, _3));\n    g_signals.m_internals->BlockDisconnected.connect(boost::bind(&CValidationInterface::BlockDisconnected, pwalletIn, _1));\n    g_signals.m_internals->TransactionRemovedFromMempool.connect(boost::bind(&CValidationInterface::TransactionRemovedFromMempool, pwalletIn, _1));\n    g_signals.m_internals->SetBestChain.connect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1));\n    g_signals.m_internals->Broadcast.connect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1, _2));\n    g_signals.m_internals->BlockChecked.connect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2));\n    g_signals.m_internals->NewPoWValidBlock.connect(boost::bind(&CValidationInterface::NewPoWValidBlock, pwalletIn, _1, _2));\n}\n\nvoid UnregisterValidationInterface(CValidationInterface* pwalletIn) {\n    g_signals.m_internals->BlockChecked.disconnect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2));\n    g_signals.m_internals->Broadcast.disconnect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1, _2));\n    g_signals.m_internals->SetBestChain.disconnect(boost::bind(&CValidationInterface::SetBestChain, pwalletIn, _1));\n    g_signals.m_internals->TransactionAddedToMempool.disconnect(boost::bind(&CValidationInterface::TransactionAddedToMempool, pwalletIn, _1));\n    g_signals.m_internals->BlockConnected.disconnect(boost::bind(&CValidationInterface::BlockConnected, pwalletIn, _1, _2, _3));\n    g_signals.m_internals->BlockDisconnected.disconnect(boost::bind(&CValidationInterface::BlockDisconnected, pwalletIn, _1));\n    g_signals.m_internals->TransactionRemovedFromMempool.disconnect(boost::bind(&CValidationInterface::TransactionRemovedFromMempool, pwalletIn, _1));\n    g_signals.m_internals->UpdatedBlockTip.disconnect(boost::bind(&CValidationInterface::UpdatedBlockTip, pwalletIn, _1, _2, _3));\n    g_signals.m_internals->NewPoWValidBlock.disconnect(boost::bind(&CValidationInterface::NewPoWValidBlock, pwalletIn, _1, _2));\n}\n\nvoid UnregisterAllValidationInterfaces() {\n    if (!g_signals.m_internals) {\n        return;\n    }\n    g_signals.m_internals->BlockChecked.disconnect_all_slots();\n    g_signals.m_internals->Broadcast.disconnect_all_slots();\n    g_signals.m_internals->SetBestChain.disconnect_all_slots();\n    g_signals.m_internals->TransactionAddedToMempool.disconnect_all_slots();\n    g_signals.m_internals->BlockConnected.disconnect_all_slots();\n    g_signals.m_internals->BlockDisconnected.disconnect_all_slots();\n    g_signals.m_internals->TransactionRemovedFromMempool.disconnect_all_slots();\n    g_signals.m_internals->UpdatedBlockTip.disconnect_all_slots();\n    g_signals.m_internals->NewPoWValidBlock.disconnect_all_slots();\n}\n\nvoid CallFunctionInValidationInterfaceQueue(std::function<void ()> func) {\n    g_signals.m_internals->m_schedulerClient.AddToProcessQueue(std::move(func));\n}\n\nvoid SyncWithValidationInterfaceQueue() {\n    AssertLockNotHeld(cs_main);\n    // Block until the validation queue drains\n    std::promise<void> promise;\n    CallFunctionInValidationInterfaceQueue([&promise] {\n        promise.set_value();\n    });\n    promise.get_future().wait();\n}\n\nvoid CMainSignals::MempoolEntryRemoved(CTransactionRef ptx, MemPoolRemovalReason reason) {\n    if (reason != MemPoolRemovalReason::BLOCK && reason != MemPoolRemovalReason::CONFLICT) {\n        m_internals->m_schedulerClient.AddToProcessQueue([ptx, this] {\n            m_internals->TransactionRemovedFromMempool(ptx);\n        });\n    }\n}\n\nvoid CMainSignals::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {\n    // Dependencies exist that require UpdatedBlockTip events to be delivered in the order in which\n    // the chain actually updates. One way to ensure this is for the caller to invoke this signal\n    // in the same critical section where the chain is updated\n\n    m_internals->m_schedulerClient.AddToProcessQueue([pindexNew, pindexFork, fInitialDownload, this] {\n        m_internals->UpdatedBlockTip(pindexNew, pindexFork, fInitialDownload);\n    });\n}\n\nvoid CMainSignals::TransactionAddedToMempool(const CTransactionRef &ptx) {\n    m_internals->m_schedulerClient.AddToProcessQueue([ptx, this] {\n        m_internals->TransactionAddedToMempool(ptx);\n    });\n}\n\nvoid CMainSignals::BlockConnected(const std::shared_ptr<const CBlock> &pblock, const CBlockIndex *pindex, const std::shared_ptr<const std::vector<CTransactionRef>>& pvtxConflicted) {\n    m_internals->m_schedulerClient.AddToProcessQueue([pblock, pindex, pvtxConflicted, this] {\n        m_internals->BlockConnected(pblock, pindex, *pvtxConflicted);\n    });\n}\n\nvoid CMainSignals::BlockDisconnected(const std::shared_ptr<const CBlock> &pblock) {\n    m_internals->m_schedulerClient.AddToProcessQueue([pblock, this] {\n        m_internals->BlockDisconnected(pblock);\n    });\n}\n\nvoid CMainSignals::SetBestChain(const CBlockLocator &locator) {\n    m_internals->m_schedulerClient.AddToProcessQueue([locator, this] {\n        m_internals->SetBestChain(locator);\n    });\n}\n\nvoid CMainSignals::Broadcast(int64_t nBestBlockTime, CConnman* connman) {\n    m_internals->Broadcast(nBestBlockTime, connman);\n}\n\nvoid CMainSignals::BlockChecked(const CBlock& block, const CValidationState& state) {\n    m_internals->BlockChecked(block, state);\n}\n\nvoid CMainSignals::NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock> &block) {\n    m_internals->NewPoWValidBlock(pindex, block);\n}\n"
  },
  {
    "path": "src/validationinterface.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_VALIDATIONINTERFACE_H\n#define BITCOIN_VALIDATIONINTERFACE_H\n\n#include <primitives/transaction.h> // CTransaction(Ref)\n\n#include <functional>\n#include <memory>\n\nclass CBlock;\nclass CBlockIndex;\nstruct CBlockLocator;\nclass CBlockIndex;\nclass CConnman;\nclass CReserveScript;\nclass CValidationInterface;\nclass CValidationState;\nclass uint256;\nclass CScheduler;\nclass CTxMemPool;\nenum class MemPoolRemovalReason;\n\n// These functions dispatch to one or all registered wallets\n\n/** Register a wallet to receive updates from core */\nvoid RegisterValidationInterface(CValidationInterface* pwalletIn);\n/** Unregister a wallet from core */\nvoid UnregisterValidationInterface(CValidationInterface* pwalletIn);\n/** Unregister all wallets from core */\nvoid UnregisterAllValidationInterfaces();\n/**\n * Pushes a function to callback onto the notification queue, guaranteeing any\n * callbacks generated prior to now are finished when the function is called.\n *\n * Be very careful blocking on func to be called if any locks are held -\n * validation interface clients may not be able to make progress as they often\n * wait for things like cs_main, so blocking until func is called with cs_main\n * will result in a deadlock (that DEBUG_LOCKORDER will miss).\n */\nvoid CallFunctionInValidationInterfaceQueue(std::function<void ()> func);\n/**\n * This is a synonym for the following, which asserts certain locks are not\n * held:\n *     std::promise<void> promise;\n *     CallFunctionInValidationInterfaceQueue([&promise] {\n *         promise.set_value();\n *     });\n *     promise.get_future().wait();\n */\nvoid SyncWithValidationInterfaceQueue();\n\nclass CValidationInterface {\nprotected:\n    /**\n     * Notifies listeners when the block chain tip advances.\n     *\n     * When multiple blocks are connected at once, UpdatedBlockTip will be called on the final tip\n     * but may not be called on every intermediate tip. If the latter behavior is desired,\n     * subscribe to BlockConnected() instead.\n     *\n     * Called on a background thread.\n     */\n    virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {}\n    /**\n     * Notifies listeners of a transaction having been added to mempool.\n     *\n     * Called on a background thread.\n     */\n    virtual void TransactionAddedToMempool(const CTransactionRef &ptxn) {}\n    /**\n     * Notifies listeners of a transaction leaving mempool.\n     *\n     * This only fires for transactions which leave mempool because of expiry,\n     * size limiting, reorg (changes in lock times/coinbase maturity), or\n     * replacement. This does not include any transactions which are included\n     * in BlockConnectedDisconnected either in block->vtx or in txnConflicted.\n     *\n     * Called on a background thread.\n     */\n    virtual void TransactionRemovedFromMempool(const CTransactionRef &ptx) {}\n    /**\n     * Notifies listeners of a block being connected.\n     * Provides a vector of transactions evicted from the mempool as a result.\n     *\n     * Called on a background thread.\n     */\n    virtual void BlockConnected(const std::shared_ptr<const CBlock> &block, const CBlockIndex *pindex, const std::vector<CTransactionRef> &txnConflicted) {}\n    /**\n     * Notifies listeners of a block being disconnected\n     *\n     * Called on a background thread.\n     */\n    virtual void BlockDisconnected(const std::shared_ptr<const CBlock> &block) {}\n    /**\n     * Notifies listeners of the new active block chain on-disk.\n     *\n     * Called on a background thread.\n     */\n    virtual void SetBestChain(const CBlockLocator &locator) {}\n    /** Tells listeners to broadcast their data. */\n    virtual void ResendWalletTransactions(int64_t nBestBlockTime, CConnman* connman) {}\n    /**\n     * Notifies listeners of a block validation result.\n     * If the provided CValidationState IsValid, the provided block\n     * is guaranteed to be the current best block at the time the\n     * callback was generated (not necessarily now)\n     */\n    virtual void BlockChecked(const CBlock&, const CValidationState&) {}\n    /**\n     * Notifies listeners that a block which builds directly on our current tip\n     * has been received and connected to the headers tree, though not validated yet */\n    virtual void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& block) {};\n    friend void ::RegisterValidationInterface(CValidationInterface*);\n    friend void ::UnregisterValidationInterface(CValidationInterface*);\n    friend void ::UnregisterAllValidationInterfaces();\n};\n\nstruct MainSignalsInstance;\nclass CMainSignals {\nprivate:\n    std::unique_ptr<MainSignalsInstance> m_internals;\n\n    friend void ::RegisterValidationInterface(CValidationInterface*);\n    friend void ::UnregisterValidationInterface(CValidationInterface*);\n    friend void ::UnregisterAllValidationInterfaces();\n    friend void ::CallFunctionInValidationInterfaceQueue(std::function<void ()> func);\n\n    void MempoolEntryRemoved(CTransactionRef tx, MemPoolRemovalReason reason);\n\npublic:\n    /** Register a CScheduler to give callbacks which should run in the background (may only be called once) */\n    void RegisterBackgroundSignalScheduler(CScheduler& scheduler);\n    /** Unregister a CScheduler to give callbacks which should run in the background - these callbacks will now be dropped! */\n    void UnregisterBackgroundSignalScheduler();\n    /** Call any remaining callbacks on the calling thread */\n    void FlushBackgroundCallbacks();\n\n    size_t CallbacksPending();\n\n    /** Register with mempool to call TransactionRemovedFromMempool callbacks */\n    void RegisterWithMempoolSignals(CTxMemPool& pool);\n    /** Unregister with mempool */\n    void UnregisterWithMempoolSignals(CTxMemPool& pool);\n\n    void UpdatedBlockTip(const CBlockIndex *, const CBlockIndex *, bool fInitialDownload);\n    void TransactionAddedToMempool(const CTransactionRef &);\n    void BlockConnected(const std::shared_ptr<const CBlock> &, const CBlockIndex *pindex, const std::shared_ptr<const std::vector<CTransactionRef>> &);\n    void BlockDisconnected(const std::shared_ptr<const CBlock> &);\n    void SetBestChain(const CBlockLocator &);\n    void Broadcast(int64_t nBestBlockTime, CConnman* connman);\n    void BlockChecked(const CBlock&, const CValidationState&);\n    void NewPoWValidBlock(const CBlockIndex *, const std::shared_ptr<const CBlock>&);\n};\n\nCMainSignals& GetMainSignals();\n\n#endif // BITCOIN_VALIDATIONINTERFACE_H\n"
  },
  {
    "path": "src/version.h",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_VERSION_H\n#define BITCOIN_VERSION_H\n\n/**\n * network protocol versioning\n */\n\nstatic const int PROTOCOL_VERSION = 70015;\n\n//! initial proto version, to be increased after version/verack negotiation\nstatic const int INIT_PROTO_VERSION = 209;\n\n//! In this version, 'getheaders' was introduced.\nstatic const int GETHEADERS_VERSION = 31800;\n\n//! disconnect from peers older than this proto version\nstatic const int MIN_PEER_PROTO_VERSION = GETHEADERS_VERSION;\n\n//! nTime field added to CAddress, starting with this version;\n//! if possible, avoid requesting addresses nodes older than this\nstatic const int CADDR_TIME_VERSION = 31402;\n\n//! BIP 0031, pong message, is enabled for all versions AFTER this one\nstatic const int BIP0031_VERSION = 60000;\n\n//! \"filter*\" commands are disabled without NODE_BLOOM after and including this version\nstatic const int NO_BLOOM_VERSION = 70011;\n\n//! \"sendheaders\" command and announcing blocks with headers starts with this version\nstatic const int SENDHEADERS_VERSION = 70012;\n\n//! \"feefilter\" tells peers to filter invs to you by fee starts with this version\nstatic const int FEEFILTER_VERSION = 70013;\n\n//! short-id-based block download starts with this version\nstatic const int SHORT_IDS_BLOCKS_VERSION = 70014;\n\n//! not banning for invalid compact blocks starts with this version\nstatic const int INVALID_CB_NO_BAN_VERSION = 70015;\n\n#endif // BITCOIN_VERSION_H\n"
  },
  {
    "path": "src/versionbits.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <versionbits.h>\n#include <consensus/params.h>\n\nconst struct VBDeploymentInfo VersionBitsDeploymentInfo[Consensus::MAX_VERSION_BITS_DEPLOYMENTS] = {\n    {\n        /*.name =*/ \"testdummy\",\n        /*.gbt_force =*/ true,\n    },\n    {\n        /*.name =*/ \"csv\",\n        /*.gbt_force =*/ true,\n    },\n    {\n        /*.name =*/ \"segwit\",\n        /*.gbt_force =*/ true,\n    }\n};\n\nThresholdState AbstractThresholdConditionChecker::GetStateFor(const CBlockIndex* pindexPrev, const Consensus::Params& params, ThresholdConditionCache& cache) const\n{\n    int nPeriod = Period(params);\n    int nThreshold = Threshold(params);\n    int64_t nTimeStart = BeginTime(params);\n    int64_t nTimeTimeout = EndTime(params);\n\n    // Check if this deployment is always active.\n    if (nTimeStart == Consensus::BIP9Deployment::ALWAYS_ACTIVE) {\n        return THRESHOLD_ACTIVE;\n    }\n\n    // A block's state is always the same as that of the first of its period, so it is computed based on a pindexPrev whose height equals a multiple of nPeriod - 1.\n    if (pindexPrev != nullptr) {\n        pindexPrev = pindexPrev->GetAncestor(pindexPrev->nHeight - ((pindexPrev->nHeight + 1) % nPeriod));\n    }\n\n    // Walk backwards in steps of nPeriod to find a pindexPrev whose information is known\n    std::vector<const CBlockIndex*> vToCompute;\n    while (cache.count(pindexPrev) == 0) {\n        if (pindexPrev == nullptr) {\n            // The genesis block is by definition defined.\n            cache[pindexPrev] = THRESHOLD_DEFINED;\n            break;\n        }\n        if (pindexPrev->GetMedianTimePast() < nTimeStart) {\n            // Optimization: don't recompute down further, as we know every earlier block will be before the start time\n            cache[pindexPrev] = THRESHOLD_DEFINED;\n            break;\n        }\n        vToCompute.push_back(pindexPrev);\n        pindexPrev = pindexPrev->GetAncestor(pindexPrev->nHeight - nPeriod);\n    }\n\n    // At this point, cache[pindexPrev] is known\n    assert(cache.count(pindexPrev));\n    ThresholdState state = cache[pindexPrev];\n\n    // Now walk forward and compute the state of descendants of pindexPrev\n    while (!vToCompute.empty()) {\n        ThresholdState stateNext = state;\n        pindexPrev = vToCompute.back();\n        vToCompute.pop_back();\n\n        switch (state) {\n            case THRESHOLD_DEFINED: {\n                if (pindexPrev->GetMedianTimePast() >= nTimeTimeout) {\n                    stateNext = THRESHOLD_FAILED;\n                } else if (pindexPrev->GetMedianTimePast() >= nTimeStart) {\n                    stateNext = THRESHOLD_STARTED;\n                }\n                break;\n            }\n            case THRESHOLD_STARTED: {\n                if (pindexPrev->GetMedianTimePast() >= nTimeTimeout) {\n                    stateNext = THRESHOLD_FAILED;\n                    break;\n                }\n                // We need to count\n                const CBlockIndex* pindexCount = pindexPrev;\n                int count = 0;\n                for (int i = 0; i < nPeriod; i++) {\n                    if (Condition(pindexCount, params)) {\n                        count++;\n                    }\n                    pindexCount = pindexCount->pprev;\n                }\n                if (count >= nThreshold) {\n                    stateNext = THRESHOLD_LOCKED_IN;\n                }\n                break;\n            }\n            case THRESHOLD_LOCKED_IN: {\n                // Always progresses into ACTIVE.\n                stateNext = THRESHOLD_ACTIVE;\n                break;\n            }\n            case THRESHOLD_FAILED:\n            case THRESHOLD_ACTIVE: {\n                // Nothing happens, these are terminal states.\n                break;\n            }\n        }\n        cache[pindexPrev] = state = stateNext;\n    }\n\n    return state;\n}\n\n// return the numerical statistics of blocks signalling the specified BIP9 condition in this current period\nBIP9Stats AbstractThresholdConditionChecker::GetStateStatisticsFor(const CBlockIndex* pindex, const Consensus::Params& params) const\n{\n    BIP9Stats stats = {};\n\n    stats.period = Period(params);\n    stats.threshold = Threshold(params);\n\n    if (pindex == nullptr)\n        return stats;\n\n    // Find beginning of period\n    const CBlockIndex* pindexEndOfPrevPeriod = pindex->GetAncestor(pindex->nHeight - ((pindex->nHeight + 1) % stats.period));\n    stats.elapsed = pindex->nHeight - pindexEndOfPrevPeriod->nHeight;\n\n    // Count from current block to beginning of period\n    int count = 0;\n    const CBlockIndex* currentIndex = pindex;\n    while (pindexEndOfPrevPeriod->nHeight != currentIndex->nHeight){\n        if (Condition(currentIndex, params))\n            count++;\n        currentIndex = currentIndex->pprev;\n    }\n\n    stats.count = count;\n    stats.possible = (stats.period - stats.threshold ) >= (stats.elapsed - count);\n\n    return stats;\n}\n\nint AbstractThresholdConditionChecker::GetStateSinceHeightFor(const CBlockIndex* pindexPrev, const Consensus::Params& params, ThresholdConditionCache& cache) const\n{\n    int64_t start_time = BeginTime(params);\n    if (start_time == Consensus::BIP9Deployment::ALWAYS_ACTIVE) {\n        return 0;\n    }\n\n    const ThresholdState initialState = GetStateFor(pindexPrev, params, cache);\n\n    // BIP 9 about state DEFINED: \"The genesis block is by definition in this state for each deployment.\"\n    if (initialState == THRESHOLD_DEFINED) {\n        return 0;\n    }\n\n    const int nPeriod = Period(params);\n\n    // A block's state is always the same as that of the first of its period, so it is computed based on a pindexPrev whose height equals a multiple of nPeriod - 1.\n    // To ease understanding of the following height calculation, it helps to remember that\n    // right now pindexPrev points to the block prior to the block that we are computing for, thus:\n    // if we are computing for the last block of a period, then pindexPrev points to the second to last block of the period, and\n    // if we are computing for the first block of a period, then pindexPrev points to the last block of the previous period.\n    // The parent of the genesis block is represented by nullptr.\n    pindexPrev = pindexPrev->GetAncestor(pindexPrev->nHeight - ((pindexPrev->nHeight + 1) % nPeriod));\n\n    const CBlockIndex* previousPeriodParent = pindexPrev->GetAncestor(pindexPrev->nHeight - nPeriod);\n\n    while (previousPeriodParent != nullptr && GetStateFor(previousPeriodParent, params, cache) == initialState) {\n        pindexPrev = previousPeriodParent;\n        previousPeriodParent = pindexPrev->GetAncestor(pindexPrev->nHeight - nPeriod);\n    }\n\n    // Adjust the result because right now we point to the parent block.\n    return pindexPrev->nHeight + 1;\n}\n\nnamespace\n{\n/**\n * Class to implement versionbits logic.\n */\nclass VersionBitsConditionChecker : public AbstractThresholdConditionChecker {\nprivate:\n    const Consensus::DeploymentPos id;\n\nprotected:\n    int64_t BeginTime(const Consensus::Params& params) const override { return params.vDeployments[id].nStartTime; }\n    int64_t EndTime(const Consensus::Params& params) const override { return params.vDeployments[id].nTimeout; }\n    int Period(const Consensus::Params& params) const override { return params.nMinerConfirmationWindow; }\n    int Threshold(const Consensus::Params& params) const override { return params.nRuleChangeActivationThreshold; }\n\n    bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const override\n    {\n        return (((pindex->nVersion & VERSIONBITS_TOP_MASK) == VERSIONBITS_TOP_BITS) && (pindex->nVersion & Mask(params)) != 0);\n    }\n\npublic:\n    explicit VersionBitsConditionChecker(Consensus::DeploymentPos id_) : id(id_) {}\n    uint32_t Mask(const Consensus::Params& params) const { return ((uint32_t)1) << params.vDeployments[id].bit; }\n};\n\n} // namespace\n\nThresholdState VersionBitsState(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos pos, VersionBitsCache& cache)\n{\n    return VersionBitsConditionChecker(pos).GetStateFor(pindexPrev, params, cache.caches[pos]);\n}\n\nBIP9Stats VersionBitsStatistics(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos pos)\n{\n    return VersionBitsConditionChecker(pos).GetStateStatisticsFor(pindexPrev, params);\n}\n\nint VersionBitsStateSinceHeight(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos pos, VersionBitsCache& cache)\n{\n    return VersionBitsConditionChecker(pos).GetStateSinceHeightFor(pindexPrev, params, cache.caches[pos]);\n}\n\nuint32_t VersionBitsMask(const Consensus::Params& params, Consensus::DeploymentPos pos)\n{\n    return VersionBitsConditionChecker(pos).Mask(params);\n}\n\nvoid VersionBitsCache::Clear()\n{\n    for (unsigned int d = 0; d < Consensus::MAX_VERSION_BITS_DEPLOYMENTS; d++) {\n        caches[d].clear();\n    }\n}\n"
  },
  {
    "path": "src/versionbits.h",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CONSENSUS_VERSIONBITS\n#define BITCOIN_CONSENSUS_VERSIONBITS\n\n#include <chain.h>\n#include <map>\n\n/** What block version to use for new blocks (pre versionbits) */\nstatic const int32_t VERSIONBITS_LAST_OLD_BLOCK_VERSION = 4;\n/** What bits to set in version for versionbits blocks */\nstatic const int32_t VERSIONBITS_TOP_BITS = 0x20000000UL;\n/** What bitmask determines whether versionbits is in use */\nstatic const int32_t VERSIONBITS_TOP_MASK = 0xE0000000UL;\n/** Total bits available for versionbits */\nstatic const int32_t VERSIONBITS_NUM_BITS = 29;\n\nenum ThresholdState {\n    THRESHOLD_DEFINED,\n    THRESHOLD_STARTED,\n    THRESHOLD_LOCKED_IN,\n    THRESHOLD_ACTIVE,\n    THRESHOLD_FAILED,\n};\n\n// A map that gives the state for blocks whose height is a multiple of Period().\n// The map is indexed by the block's parent, however, so all keys in the map\n// will either be nullptr or a block with (height + 1) % Period() == 0.\ntypedef std::map<const CBlockIndex*, ThresholdState> ThresholdConditionCache;\n\nstruct VBDeploymentInfo {\n    /** Deployment name */\n    const char *name;\n    /** Whether GBT clients can safely ignore this rule in simplified usage */\n    bool gbt_force;\n};\n\nstruct BIP9Stats {\n    int period;\n    int threshold;\n    int elapsed;\n    int count;\n    bool possible;\n};\n\nextern const struct VBDeploymentInfo VersionBitsDeploymentInfo[];\n\n/**\n * Abstract class that implements BIP9-style threshold logic, and caches results.\n */\nclass AbstractThresholdConditionChecker {\nprotected:\n    virtual bool Condition(const CBlockIndex* pindex, const Consensus::Params& params) const =0;\n    virtual int64_t BeginTime(const Consensus::Params& params) const =0;\n    virtual int64_t EndTime(const Consensus::Params& params) const =0;\n    virtual int Period(const Consensus::Params& params) const =0;\n    virtual int Threshold(const Consensus::Params& params) const =0;\n\npublic:\n    BIP9Stats GetStateStatisticsFor(const CBlockIndex* pindex, const Consensus::Params& params) const;\n    // Note that the functions below take a pindexPrev as input: they compute information for block B based on its parent.\n    ThresholdState GetStateFor(const CBlockIndex* pindexPrev, const Consensus::Params& params, ThresholdConditionCache& cache) const;\n    int GetStateSinceHeightFor(const CBlockIndex* pindexPrev, const Consensus::Params& params, ThresholdConditionCache& cache) const;\n};\n\nstruct VersionBitsCache\n{\n    ThresholdConditionCache caches[Consensus::MAX_VERSION_BITS_DEPLOYMENTS];\n\n    void Clear();\n};\n\nThresholdState VersionBitsState(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos pos, VersionBitsCache& cache);\nBIP9Stats VersionBitsStatistics(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos pos);\nint VersionBitsStateSinceHeight(const CBlockIndex* pindexPrev, const Consensus::Params& params, Consensus::DeploymentPos pos, VersionBitsCache& cache);\nuint32_t VersionBitsMask(const Consensus::Params& params, Consensus::DeploymentPos pos);\n\n#endif\n"
  },
  {
    "path": "src/wallet/coincontrol.h",
    "content": "// Copyright (c) 2011-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_COINCONTROL_H\n#define BITCOIN_WALLET_COINCONTROL_H\n\n#include <policy/feerate.h>\n#include <policy/fees.h>\n#include <primitives/transaction.h>\n#include <wallet/wallet.h>\n\n#include <boost/optional.hpp>\n\n/** Coin Control Features. */\nclass CCoinControl\n{\npublic:\n    //! Custom change destination, if not set an address is generated\n    CTxDestination destChange;\n    //! Custom change type, ignored if destChange is set, defaults to g_change_type\n    OutputType change_type;\n    //! If false, allows unselected inputs, but requires all selected inputs be used\n    bool fAllowOtherInputs;\n    //! Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria\n    bool fAllowWatchOnly;\n    //! Override automatic min/max checks on fee, m_feerate must be set if true\n    bool fOverrideFeeRate;\n    //! Override the default payTxFee if set\n    boost::optional<CFeeRate> m_feerate;\n    //! Override the default confirmation target if set\n    boost::optional<unsigned int> m_confirm_target;\n    //! Signal BIP-125 replace by fee.\n    bool signalRbf;\n    //! Fee estimation mode to control arguments to estimateSmartFee\n    FeeEstimateMode m_fee_mode;\n\n    CCoinControl()\n    {\n        SetNull();\n    }\n\n    void SetNull()\n    {\n        destChange = CNoDestination();\n        change_type = g_change_type;\n        fAllowOtherInputs = false;\n        fAllowWatchOnly = false;\n        setSelected.clear();\n        m_feerate.reset();\n        fOverrideFeeRate = false;\n        m_confirm_target.reset();\n        signalRbf = fWalletRbf;\n        m_fee_mode = FeeEstimateMode::UNSET;\n    }\n\n    bool HasSelected() const\n    {\n        return (setSelected.size() > 0);\n    }\n\n    bool IsSelected(const COutPoint& output) const\n    {\n        return (setSelected.count(output) > 0);\n    }\n\n    void Select(const COutPoint& output)\n    {\n        setSelected.insert(output);\n    }\n\n    void UnSelect(const COutPoint& output)\n    {\n        setSelected.erase(output);\n    }\n\n    void UnSelectAll()\n    {\n        setSelected.clear();\n    }\n\n    void ListSelected(std::vector<COutPoint>& vOutpoints) const\n    {\n        vOutpoints.assign(setSelected.begin(), setSelected.end());\n    }\n\nprivate:\n    std::set<COutPoint> setSelected;\n};\n\n#endif // BITCOIN_WALLET_COINCONTROL_H\n"
  },
  {
    "path": "src/wallet/crypter.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/crypter.h>\n\n#include <crypto/aes.h>\n#include <crypto/sha512.h>\n#include <script/script.h>\n#include <script/standard.h>\n#include <util.h>\n\n#include <string>\n#include <vector>\n\nint CCrypter::BytesToKeySHA512AES(const std::vector<unsigned char>& chSalt, const SecureString& strKeyData, int count, unsigned char *key,unsigned char *iv) const\n{\n    // This mimics the behavior of openssl's EVP_BytesToKey with an aes256cbc\n    // cipher and sha512 message digest. Because sha512's output size (64b) is\n    // greater than the aes256 block size (16b) + aes256 key size (32b),\n    // there's no need to process more than once (D_0).\n\n    if(!count || !key || !iv)\n        return 0;\n\n    unsigned char buf[CSHA512::OUTPUT_SIZE];\n    CSHA512 di;\n\n    di.Write((const unsigned char*)strKeyData.c_str(), strKeyData.size());\n    di.Write(chSalt.data(), chSalt.size());\n    di.Finalize(buf);\n\n    for(int i = 0; i != count - 1; i++)\n        di.Reset().Write(buf, sizeof(buf)).Finalize(buf);\n\n    memcpy(key, buf, WALLET_CRYPTO_KEY_SIZE);\n    memcpy(iv, buf + WALLET_CRYPTO_KEY_SIZE, WALLET_CRYPTO_IV_SIZE);\n    memory_cleanse(buf, sizeof(buf));\n    return WALLET_CRYPTO_KEY_SIZE;\n}\n\nbool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::vector<unsigned char>& chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod)\n{\n    if (nRounds < 1 || chSalt.size() != WALLET_CRYPTO_SALT_SIZE)\n        return false;\n\n    int i = 0;\n    if (nDerivationMethod == 0)\n        i = BytesToKeySHA512AES(chSalt, strKeyData, nRounds, vchKey.data(), vchIV.data());\n\n    if (i != (int)WALLET_CRYPTO_KEY_SIZE)\n    {\n        memory_cleanse(vchKey.data(), vchKey.size());\n        memory_cleanse(vchIV.data(), vchIV.size());\n        return false;\n    }\n\n    fKeySet = true;\n    return true;\n}\n\nbool CCrypter::SetKey(const CKeyingMaterial& chNewKey, const std::vector<unsigned char>& chNewIV)\n{\n    if (chNewKey.size() != WALLET_CRYPTO_KEY_SIZE || chNewIV.size() != WALLET_CRYPTO_IV_SIZE)\n        return false;\n\n    memcpy(vchKey.data(), chNewKey.data(), chNewKey.size());\n    memcpy(vchIV.data(), chNewIV.data(), chNewIV.size());\n\n    fKeySet = true;\n    return true;\n}\n\nbool CCrypter::Encrypt(const CKeyingMaterial& vchPlaintext, std::vector<unsigned char> &vchCiphertext) const\n{\n    if (!fKeySet)\n        return false;\n\n    // max ciphertext len for a n bytes of plaintext is\n    // n + AES_BLOCKSIZE bytes\n    vchCiphertext.resize(vchPlaintext.size() + AES_BLOCKSIZE);\n\n    AES256CBCEncrypt enc(vchKey.data(), vchIV.data(), true);\n    size_t nLen = enc.Encrypt(&vchPlaintext[0], vchPlaintext.size(), vchCiphertext.data());\n    if(nLen < vchPlaintext.size())\n        return false;\n    vchCiphertext.resize(nLen);\n\n    return true;\n}\n\nbool CCrypter::Decrypt(const std::vector<unsigned char>& vchCiphertext, CKeyingMaterial& vchPlaintext) const\n{\n    if (!fKeySet)\n        return false;\n\n    // plaintext will always be equal to or lesser than length of ciphertext\n    int nLen = vchCiphertext.size();\n\n    vchPlaintext.resize(nLen);\n\n    AES256CBCDecrypt dec(vchKey.data(), vchIV.data(), true);\n    nLen = dec.Decrypt(vchCiphertext.data(), vchCiphertext.size(), &vchPlaintext[0]);\n    if(nLen == 0)\n        return false;\n    vchPlaintext.resize(nLen);\n    return true;\n}\n\n\nstatic bool EncryptSecret(const CKeyingMaterial& vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256& nIV, std::vector<unsigned char> &vchCiphertext)\n{\n    CCrypter cKeyCrypter;\n    std::vector<unsigned char> chIV(WALLET_CRYPTO_IV_SIZE);\n    memcpy(chIV.data(), &nIV, WALLET_CRYPTO_IV_SIZE);\n    if(!cKeyCrypter.SetKey(vMasterKey, chIV))\n        return false;\n    return cKeyCrypter.Encrypt(*((const CKeyingMaterial*)&vchPlaintext), vchCiphertext);\n}\n\nstatic bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCiphertext, const uint256& nIV, CKeyingMaterial& vchPlaintext)\n{\n    CCrypter cKeyCrypter;\n    std::vector<unsigned char> chIV(WALLET_CRYPTO_IV_SIZE);\n    memcpy(chIV.data(), &nIV, WALLET_CRYPTO_IV_SIZE);\n    if(!cKeyCrypter.SetKey(vMasterKey, chIV))\n        return false;\n    return cKeyCrypter.Decrypt(vchCiphertext, *((CKeyingMaterial*)&vchPlaintext));\n}\n\nstatic bool DecryptKey(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCryptedSecret, const CPubKey& vchPubKey, CKey& key)\n{\n    CKeyingMaterial vchSecret;\n    if(!DecryptSecret(vMasterKey, vchCryptedSecret, vchPubKey.GetHash(), vchSecret))\n        return false;\n\n    if (vchSecret.size() != 32)\n        return false;\n\n    key.Set(vchSecret.begin(), vchSecret.end(), vchPubKey.IsCompressed());\n    return key.VerifyPubKey(vchPubKey);\n}\n\nbool CCryptoKeyStore::SetCrypted()\n{\n    LOCK(cs_KeyStore);\n    if (fUseCrypto)\n        return true;\n    if (!mapKeys.empty())\n        return false;\n    fUseCrypto = true;\n    return true;\n}\n\nbool CCryptoKeyStore::IsLocked() const\n{\n    if (!IsCrypted()) {\n        return false;\n    }\n    LOCK(cs_KeyStore);\n    return vMasterKey.empty();\n}\n\nbool CCryptoKeyStore::Lock()\n{\n    if (!SetCrypted())\n        return false;\n\n    {\n        LOCK(cs_KeyStore);\n        vMasterKey.clear();\n    }\n\n    NotifyStatusChanged(this);\n    return true;\n}\n\nbool CCryptoKeyStore::Unlock(const CKeyingMaterial& vMasterKeyIn)\n{\n    {\n        LOCK(cs_KeyStore);\n        if (!SetCrypted())\n            return false;\n\n        bool keyPass = false;\n        bool keyFail = false;\n        CryptedKeyMap::const_iterator mi = mapCryptedKeys.begin();\n        for (; mi != mapCryptedKeys.end(); ++mi)\n        {\n            const CPubKey &vchPubKey = (*mi).second.first;\n            const std::vector<unsigned char> &vchCryptedSecret = (*mi).second.second;\n            CKey key;\n            if (!DecryptKey(vMasterKeyIn, vchCryptedSecret, vchPubKey, key))\n            {\n                keyFail = true;\n                break;\n            }\n            keyPass = true;\n            if (fDecryptionThoroughlyChecked)\n                break;\n        }\n        if (keyPass && keyFail)\n        {\n            LogPrintf(\"The wallet is probably corrupted: Some keys decrypt but not all.\\n\");\n            assert(false);\n        }\n        if (keyFail || !keyPass)\n            return false;\n        vMasterKey = vMasterKeyIn;\n        fDecryptionThoroughlyChecked = true;\n    }\n    NotifyStatusChanged(this);\n    return true;\n}\n\nbool CCryptoKeyStore::AddKeyPubKey(const CKey& key, const CPubKey &pubkey)\n{\n    LOCK(cs_KeyStore);\n    if (!IsCrypted()) {\n        return CBasicKeyStore::AddKeyPubKey(key, pubkey);\n    }\n\n    if (IsLocked()) {\n        return false;\n    }\n\n    std::vector<unsigned char> vchCryptedSecret;\n    CKeyingMaterial vchSecret(key.begin(), key.end());\n    if (!EncryptSecret(vMasterKey, vchSecret, pubkey.GetHash(), vchCryptedSecret)) {\n        return false;\n    }\n\n    if (!AddCryptedKey(pubkey, vchCryptedSecret)) {\n        return false;\n    }\n    return true;\n}\n\n\nbool CCryptoKeyStore::AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret)\n{\n    LOCK(cs_KeyStore);\n    if (!SetCrypted()) {\n        return false;\n    }\n\n    mapCryptedKeys[vchPubKey.GetID()] = make_pair(vchPubKey, vchCryptedSecret);\n    ImplicitlyLearnRelatedKeyScripts(vchPubKey);\n    return true;\n}\n\nbool CCryptoKeyStore::HaveKey(const CKeyID &address) const\n{\n    LOCK(cs_KeyStore);\n    if (!IsCrypted()) {\n        return CBasicKeyStore::HaveKey(address);\n    }\n    return mapCryptedKeys.count(address) > 0;\n}\n\nbool CCryptoKeyStore::GetKey(const CKeyID &address, CKey& keyOut) const\n{\n    LOCK(cs_KeyStore);\n    if (!IsCrypted()) {\n        return CBasicKeyStore::GetKey(address, keyOut);\n    }\n\n    CryptedKeyMap::const_iterator mi = mapCryptedKeys.find(address);\n    if (mi != mapCryptedKeys.end())\n    {\n        const CPubKey &vchPubKey = (*mi).second.first;\n        const std::vector<unsigned char> &vchCryptedSecret = (*mi).second.second;\n        return DecryptKey(vMasterKey, vchCryptedSecret, vchPubKey, keyOut);\n    }\n    return false;\n}\n\nbool CCryptoKeyStore::GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const\n{\n    LOCK(cs_KeyStore);\n    if (!IsCrypted())\n        return CBasicKeyStore::GetPubKey(address, vchPubKeyOut);\n\n    CryptedKeyMap::const_iterator mi = mapCryptedKeys.find(address);\n    if (mi != mapCryptedKeys.end())\n    {\n        vchPubKeyOut = (*mi).second.first;\n        return true;\n    }\n    // Check for watch-only pubkeys\n    return CBasicKeyStore::GetPubKey(address, vchPubKeyOut);\n}\n\nstd::set<CKeyID> CCryptoKeyStore::GetKeys() const\n{\n    LOCK(cs_KeyStore);\n    if (!IsCrypted()) {\n        return CBasicKeyStore::GetKeys();\n    }\n    std::set<CKeyID> set_address;\n    for (const auto& mi : mapCryptedKeys) {\n        set_address.insert(mi.first);\n    }\n    return set_address;\n}\n\nbool CCryptoKeyStore::EncryptKeys(CKeyingMaterial& vMasterKeyIn)\n{\n    LOCK(cs_KeyStore);\n    if (!mapCryptedKeys.empty() || IsCrypted())\n        return false;\n\n    fUseCrypto = true;\n    for (KeyMap::value_type& mKey : mapKeys)\n    {\n        const CKey &key = mKey.second;\n        CPubKey vchPubKey = key.GetPubKey();\n        CKeyingMaterial vchSecret(key.begin(), key.end());\n        std::vector<unsigned char> vchCryptedSecret;\n        if (!EncryptSecret(vMasterKeyIn, vchSecret, vchPubKey.GetHash(), vchCryptedSecret))\n            return false;\n        if (!AddCryptedKey(vchPubKey, vchCryptedSecret))\n            return false;\n    }\n    mapKeys.clear();\n    return true;\n}\n"
  },
  {
    "path": "src/wallet/crypter.h",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_CRYPTER_H\n#define BITCOIN_WALLET_CRYPTER_H\n\n#include <keystore.h>\n#include <serialize.h>\n#include <support/allocators/secure.h>\n\n#include <atomic>\n\nconst unsigned int WALLET_CRYPTO_KEY_SIZE = 32;\nconst unsigned int WALLET_CRYPTO_SALT_SIZE = 8;\nconst unsigned int WALLET_CRYPTO_IV_SIZE = 16;\n\n/**\n * Private key encryption is done based on a CMasterKey,\n * which holds a salt and random encryption key.\n *\n * CMasterKeys are encrypted using AES-256-CBC using a key\n * derived using derivation method nDerivationMethod\n * (0 == EVP_sha512()) and derivation iterations nDeriveIterations.\n * vchOtherDerivationParameters is provided for alternative algorithms\n * which may require more parameters (such as scrypt).\n *\n * Wallet Private Keys are then encrypted using AES-256-CBC\n * with the double-sha256 of the public key as the IV, and the\n * master key's key as the encryption key (see keystore.[ch]).\n */\n\n/** Master key for wallet encryption */\nclass CMasterKey\n{\npublic:\n    std::vector<unsigned char> vchCryptedKey;\n    std::vector<unsigned char> vchSalt;\n    //! 0 = EVP_sha512()\n    //! 1 = scrypt()\n    unsigned int nDerivationMethod;\n    unsigned int nDeriveIterations;\n    //! Use this for more parameters to key derivation,\n    //! such as the various parameters to scrypt\n    std::vector<unsigned char> vchOtherDerivationParameters;\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(vchCryptedKey);\n        READWRITE(vchSalt);\n        READWRITE(nDerivationMethod);\n        READWRITE(nDeriveIterations);\n        READWRITE(vchOtherDerivationParameters);\n    }\n\n    CMasterKey()\n    {\n        // 25000 rounds is just under 0.1 seconds on a 1.86 GHz Pentium M\n        // ie slightly lower than the lowest hardware we need bother supporting\n        nDeriveIterations = 25000;\n        nDerivationMethod = 0;\n        vchOtherDerivationParameters = std::vector<unsigned char>(0);\n    }\n};\n\ntypedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial;\n\nnamespace wallet_crypto\n{\n    class TestCrypter;\n}\n\n/** Encryption/decryption context with key information */\nclass CCrypter\n{\nfriend class wallet_crypto::TestCrypter; // for test access to chKey/chIV\nprivate:\n    std::vector<unsigned char, secure_allocator<unsigned char>> vchKey;\n    std::vector<unsigned char, secure_allocator<unsigned char>> vchIV;\n    bool fKeySet;\n\n    int BytesToKeySHA512AES(const std::vector<unsigned char>& chSalt, const SecureString& strKeyData, int count, unsigned char *key,unsigned char *iv) const;\n\npublic:\n    bool SetKeyFromPassphrase(const SecureString &strKeyData, const std::vector<unsigned char>& chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod);\n    bool Encrypt(const CKeyingMaterial& vchPlaintext, std::vector<unsigned char> &vchCiphertext) const;\n    bool Decrypt(const std::vector<unsigned char>& vchCiphertext, CKeyingMaterial& vchPlaintext) const;\n    bool SetKey(const CKeyingMaterial& chNewKey, const std::vector<unsigned char>& chNewIV);\n\n    void CleanKey()\n    {\n        memory_cleanse(vchKey.data(), vchKey.size());\n        memory_cleanse(vchIV.data(), vchIV.size());\n        fKeySet = false;\n    }\n\n    CCrypter()\n    {\n        fKeySet = false;\n        vchKey.resize(WALLET_CRYPTO_KEY_SIZE);\n        vchIV.resize(WALLET_CRYPTO_IV_SIZE);\n    }\n\n    ~CCrypter()\n    {\n        CleanKey();\n    }\n};\n\n/** Keystore which keeps the private keys encrypted.\n * It derives from the basic key store, which is used if no encryption is active.\n */\nclass CCryptoKeyStore : public CBasicKeyStore\n{\nprivate:\n\n    CKeyingMaterial vMasterKey;\n\n    //! if fUseCrypto is true, mapKeys must be empty\n    //! if fUseCrypto is false, vMasterKey must be empty\n    std::atomic<bool> fUseCrypto;\n\n    //! keeps track of whether Unlock has run a thorough check before\n    bool fDecryptionThoroughlyChecked;\n\nprotected:\n    bool SetCrypted();\n\n    //! will encrypt previously unencrypted keys\n    bool EncryptKeys(CKeyingMaterial& vMasterKeyIn);\n\n    bool Unlock(const CKeyingMaterial& vMasterKeyIn);\n    CryptedKeyMap mapCryptedKeys;\n\npublic:\n    CCryptoKeyStore() : fUseCrypto(false), fDecryptionThoroughlyChecked(false)\n    {\n    }\n\n    bool IsCrypted() const { return fUseCrypto; }\n    bool IsLocked() const;\n    bool Lock();\n\n    virtual bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);\n    bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override;\n    bool HaveKey(const CKeyID &address) const override;\n    bool GetKey(const CKeyID &address, CKey& keyOut) const override;\n    bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const override;\n    std::set<CKeyID> GetKeys() const override;\n\n    /**\n     * Wallet status (encrypted, locked) changed.\n     * Note: Called without locks held.\n     */\n    boost::signals2::signal<void (CCryptoKeyStore* wallet)> NotifyStatusChanged;\n};\n\n#endif // BITCOIN_WALLET_CRYPTER_H\n"
  },
  {
    "path": "src/wallet/db.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/db.h>\n\n#include <addrman.h>\n#include <hash.h>\n#include <protocol.h>\n#include <util.h>\n#include <utilstrencodings.h>\n#include <wallet/walletutil.h>\n\n#include <stdint.h>\n\n#ifndef WIN32\n#include <sys/stat.h>\n#endif\n\n#include <boost/thread.hpp>\n\nnamespace {\n//! Make sure database has a unique fileid within the environment. If it\n//! doesn't, throw an error. BDB caches do not work properly when more than one\n//! open database has the same fileid (values written to one database may show\n//! up in reads to other databases).\n//!\n//! BerkeleyDB generates unique fileids by default\n//! (https://docs.oracle.com/cd/E17275_01/html/programmer_reference/program_copy.html),\n//! so bitcoin should never create different databases with the same fileid, but\n//! this error can be triggered if users manually copy database files.\nvoid CheckUniqueFileid(const CDBEnv& env, const std::string& filename, Db& db)\n{\n    if (env.IsMock()) return;\n\n    u_int8_t fileid[DB_FILE_ID_LEN];\n    int ret = db.get_mpf()->get_fileid(fileid);\n    if (ret != 0) {\n        throw std::runtime_error(strprintf(\"CDB: Can't open database %s (get_fileid failed with %d)\", filename, ret));\n    }\n\n    for (const auto& item : env.mapDb) {\n        u_int8_t item_fileid[DB_FILE_ID_LEN];\n        if (item.second && item.second->get_mpf()->get_fileid(item_fileid) == 0 &&\n            memcmp(fileid, item_fileid, sizeof(fileid)) == 0) {\n            const char* item_filename = nullptr;\n            item.second->get_dbname(&item_filename, nullptr);\n            throw std::runtime_error(strprintf(\"CDB: Can't open database %s (duplicates fileid %s from %s)\", filename,\n                HexStr(std::begin(item_fileid), std::end(item_fileid)),\n                item_filename ? item_filename : \"(unknown database)\"));\n        }\n    }\n}\n} // namespace\n\n//\n// CDB\n//\n\nCDBEnv bitdb;\n\nvoid CDBEnv::EnvShutdown()\n{\n    if (!fDbEnvInit)\n        return;\n\n    fDbEnvInit = false;\n    int ret = dbenv->close(0);\n    if (ret != 0)\n        LogPrintf(\"CDBEnv::EnvShutdown: Error %d shutting down database environment: %s\\n\", ret, DbEnv::strerror(ret));\n    if (!fMockDb)\n        DbEnv((u_int32_t)0).remove(strPath.c_str(), 0);\n}\n\nvoid CDBEnv::Reset()\n{\n    dbenv.reset(new DbEnv(DB_CXX_NO_EXCEPTIONS));\n    fDbEnvInit = false;\n    fMockDb = false;\n}\n\nCDBEnv::CDBEnv()\n{\n    Reset();\n}\n\nCDBEnv::~CDBEnv()\n{\n    EnvShutdown();\n}\n\nvoid CDBEnv::Close()\n{\n    EnvShutdown();\n}\n\nbool CDBEnv::Open(const fs::path& pathIn, bool retry)\n{\n    if (fDbEnvInit)\n        return true;\n\n    boost::this_thread::interruption_point();\n\n    strPath = pathIn.string();\n    if (!LockDirectory(pathIn, \".walletlock\")) {\n        LogPrintf(\"Cannot obtain a lock on wallet directory %s. Another instance of sugarchain may be using it.\\n\", strPath);\n        return false;\n    }\n\n    fs::path pathLogDir = pathIn / \"database\";\n    TryCreateDirectories(pathLogDir);\n    fs::path pathErrorFile = pathIn / \"db.log\";\n    LogPrintf(\"CDBEnv::Open: LogDir=%s ErrorFile=%s\\n\", pathLogDir.string(), pathErrorFile.string());\n\n    unsigned int nEnvFlags = 0;\n    if (gArgs.GetBoolArg(\"-privdb\", DEFAULT_WALLET_PRIVDB))\n        nEnvFlags |= DB_PRIVATE;\n\n    dbenv->set_lg_dir(pathLogDir.string().c_str());\n    dbenv->set_cachesize(0, 0x100000, 1); // 1 MiB should be enough for just the wallet\n    dbenv->set_lg_bsize(0x10000);\n    dbenv->set_lg_max(1048576);\n    dbenv->set_lk_max_locks(40000);\n    dbenv->set_lk_max_objects(40000);\n    dbenv->set_errfile(fsbridge::fopen(pathErrorFile, \"a\")); /// debug\n    dbenv->set_flags(DB_AUTO_COMMIT, 1);\n    dbenv->set_flags(DB_TXN_WRITE_NOSYNC, 1);\n    dbenv->log_set_config(DB_LOG_AUTO_REMOVE, 1);\n    int ret = dbenv->open(strPath.c_str(),\n                         DB_CREATE |\n                             DB_INIT_LOCK |\n                             DB_INIT_LOG |\n                             DB_INIT_MPOOL |\n                             DB_INIT_TXN |\n                             DB_THREAD |\n                             DB_RECOVER |\n                             nEnvFlags,\n                         S_IRUSR | S_IWUSR);\n    if (ret != 0) {\n        dbenv->close(0);\n        LogPrintf(\"CDBEnv::Open: Error %d opening database environment: %s\\n\", ret, DbEnv::strerror(ret));\n        if (retry) {\n            // try moving the database env out of the way\n            fs::path pathDatabaseBak = pathIn / strprintf(\"database.%d.bak\", GetTime());\n            try {\n                fs::rename(pathLogDir, pathDatabaseBak);\n                LogPrintf(\"Moved old %s to %s. Retrying.\\n\", pathLogDir.string(), pathDatabaseBak.string());\n            } catch (const fs::filesystem_error&) {\n                // failure is ok (well, not really, but it's not worse than what we started with)\n            }\n            // try opening it again one more time\n            if (!Open(pathIn, false)) {\n                // if it still fails, it probably means we can't even create the database env\n                return false;\n            }\n        } else {\n            return false;\n        }\n    }\n\n    fDbEnvInit = true;\n    fMockDb = false;\n    return true;\n}\n\nvoid CDBEnv::MakeMock()\n{\n    if (fDbEnvInit)\n        throw std::runtime_error(\"CDBEnv::MakeMock: Already initialized\");\n\n    boost::this_thread::interruption_point();\n\n    LogPrint(BCLog::DB, \"CDBEnv::MakeMock\\n\");\n\n    dbenv->set_cachesize(1, 0, 1);\n    dbenv->set_lg_bsize(10485760 * 4);\n    dbenv->set_lg_max(10485760);\n    dbenv->set_lk_max_locks(10000);\n    dbenv->set_lk_max_objects(10000);\n    dbenv->set_flags(DB_AUTO_COMMIT, 1);\n    dbenv->log_set_config(DB_LOG_IN_MEMORY, 1);\n    int ret = dbenv->open(nullptr,\n                         DB_CREATE |\n                             DB_INIT_LOCK |\n                             DB_INIT_LOG |\n                             DB_INIT_MPOOL |\n                             DB_INIT_TXN |\n                             DB_THREAD |\n                             DB_PRIVATE,\n                         S_IRUSR | S_IWUSR);\n    if (ret > 0)\n        throw std::runtime_error(strprintf(\"CDBEnv::MakeMock: Error %d opening database environment.\", ret));\n\n    fDbEnvInit = true;\n    fMockDb = true;\n}\n\nCDBEnv::VerifyResult CDBEnv::Verify(const std::string& strFile, recoverFunc_type recoverFunc, std::string& out_backup_filename)\n{\n    LOCK(cs_db);\n    assert(mapFileUseCount.count(strFile) == 0);\n\n    Db db(dbenv.get(), 0);\n    int result = db.verify(strFile.c_str(), nullptr, nullptr, 0);\n    if (result == 0)\n        return VERIFY_OK;\n    else if (recoverFunc == nullptr)\n        return RECOVER_FAIL;\n\n    // Try to recover:\n    bool fRecovered = (*recoverFunc)(strFile, out_backup_filename);\n    return (fRecovered ? RECOVER_OK : RECOVER_FAIL);\n}\n\nbool CDB::Recover(const std::string& filename, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue), std::string& newFilename)\n{\n    // Recovery procedure:\n    // move wallet file to walletfilename.timestamp.bak\n    // Call Salvage with fAggressive=true to\n    // get as much data as possible.\n    // Rewrite salvaged data to fresh wallet file\n    // Set -rescan so any missing transactions will be\n    // found.\n    int64_t now = GetTime();\n    newFilename = strprintf(\"%s.%d.bak\", filename, now);\n\n    int result = bitdb.dbenv->dbrename(nullptr, filename.c_str(), nullptr,\n                                       newFilename.c_str(), DB_AUTO_COMMIT);\n    if (result == 0)\n        LogPrintf(\"Renamed %s to %s\\n\", filename, newFilename);\n    else\n    {\n        LogPrintf(\"Failed to rename %s to %s\\n\", filename, newFilename);\n        return false;\n    }\n\n    std::vector<CDBEnv::KeyValPair> salvagedData;\n    bool fSuccess = bitdb.Salvage(newFilename, true, salvagedData);\n    if (salvagedData.empty())\n    {\n        LogPrintf(\"Salvage(aggressive) found no records in %s.\\n\", newFilename);\n        return false;\n    }\n    LogPrintf(\"Salvage(aggressive) found %u records\\n\", salvagedData.size());\n\n    std::unique_ptr<Db> pdbCopy = MakeUnique<Db>(bitdb.dbenv.get(), 0);\n    int ret = pdbCopy->open(nullptr,               // Txn pointer\n                            filename.c_str(),   // Filename\n                            \"main\",             // Logical db name\n                            DB_BTREE,           // Database type\n                            DB_CREATE,          // Flags\n                            0);\n    if (ret > 0) {\n        LogPrintf(\"Cannot create database file %s\\n\", filename);\n        pdbCopy->close(0);\n        return false;\n    }\n\n    DbTxn* ptxn = bitdb.TxnBegin();\n    for (CDBEnv::KeyValPair& row : salvagedData)\n    {\n        if (recoverKVcallback)\n        {\n            CDataStream ssKey(row.first, SER_DISK, CLIENT_VERSION);\n            CDataStream ssValue(row.second, SER_DISK, CLIENT_VERSION);\n            if (!(*recoverKVcallback)(callbackDataIn, ssKey, ssValue))\n                continue;\n        }\n        Dbt datKey(&row.first[0], row.first.size());\n        Dbt datValue(&row.second[0], row.second.size());\n        int ret2 = pdbCopy->put(ptxn, &datKey, &datValue, DB_NOOVERWRITE);\n        if (ret2 > 0)\n            fSuccess = false;\n    }\n    ptxn->commit(0);\n    pdbCopy->close(0);\n\n    return fSuccess;\n}\n\nbool CDB::VerifyEnvironment(const std::string& walletFile, const fs::path& walletDir, std::string& errorStr)\n{\n    LogPrintf(\"Using BerkeleyDB version %s\\n\", DbEnv::version(0, 0, 0));\n    LogPrintf(\"Using wallet %s\\n\", walletFile);\n\n    // Wallet file must be a plain filename without a directory\n    if (walletFile != fs::basename(walletFile) + fs::extension(walletFile))\n    {\n        errorStr = strprintf(_(\"Wallet %s resides outside wallet directory %s\"), walletFile, walletDir.string());\n        return false;\n    }\n\n    if (!bitdb.Open(walletDir, true)) {\n        errorStr = strprintf(_(\"Error initializing wallet database environment %s!\"), walletDir);\n        return false;\n    }\n\n    return true;\n}\n\nbool CDB::VerifyDatabaseFile(const std::string& walletFile, const fs::path& walletDir, std::string& warningStr, std::string& errorStr, CDBEnv::recoverFunc_type recoverFunc)\n{\n    if (fs::exists(walletDir / walletFile))\n    {\n        std::string backup_filename;\n        CDBEnv::VerifyResult r = bitdb.Verify(walletFile, recoverFunc, backup_filename);\n        if (r == CDBEnv::RECOVER_OK)\n        {\n            warningStr = strprintf(_(\"Warning: Wallet file corrupt, data salvaged!\"\n                                     \" Original %s saved as %s in %s; if\"\n                                     \" your balance or transactions are incorrect you should\"\n                                     \" restore from a backup.\"),\n                                   walletFile, backup_filename, walletDir);\n        }\n        if (r == CDBEnv::RECOVER_FAIL)\n        {\n            errorStr = strprintf(_(\"%s corrupt, salvage failed\"), walletFile);\n            return false;\n        }\n    }\n    // also return true if files does not exists\n    return true;\n}\n\n/* End of headers, beginning of key/value data */\nstatic const char *HEADER_END = \"HEADER=END\";\n/* End of key/value data */\nstatic const char *DATA_END = \"DATA=END\";\n\nbool CDBEnv::Salvage(const std::string& strFile, bool fAggressive, std::vector<CDBEnv::KeyValPair>& vResult)\n{\n    LOCK(cs_db);\n    assert(mapFileUseCount.count(strFile) == 0);\n\n    u_int32_t flags = DB_SALVAGE;\n    if (fAggressive)\n        flags |= DB_AGGRESSIVE;\n\n    std::stringstream strDump;\n\n    Db db(dbenv.get(), 0);\n    int result = db.verify(strFile.c_str(), nullptr, &strDump, flags);\n    if (result == DB_VERIFY_BAD) {\n        LogPrintf(\"CDBEnv::Salvage: Database salvage found errors, all data may not be recoverable.\\n\");\n        if (!fAggressive) {\n            LogPrintf(\"CDBEnv::Salvage: Rerun with aggressive mode to ignore errors and continue.\\n\");\n            return false;\n        }\n    }\n    if (result != 0 && result != DB_VERIFY_BAD) {\n        LogPrintf(\"CDBEnv::Salvage: Database salvage failed with result %d.\\n\", result);\n        return false;\n    }\n\n    // Format of bdb dump is ascii lines:\n    // header lines...\n    // HEADER=END\n    //  hexadecimal key\n    //  hexadecimal value\n    //  ... repeated\n    // DATA=END\n\n    std::string strLine;\n    while (!strDump.eof() && strLine != HEADER_END)\n        getline(strDump, strLine); // Skip past header\n\n    std::string keyHex, valueHex;\n    while (!strDump.eof() && keyHex != DATA_END) {\n        getline(strDump, keyHex);\n        if (keyHex != DATA_END) {\n            if (strDump.eof())\n                break;\n            getline(strDump, valueHex);\n            if (valueHex == DATA_END) {\n                LogPrintf(\"CDBEnv::Salvage: WARNING: Number of keys in data does not match number of values.\\n\");\n                break;\n            }\n            vResult.push_back(make_pair(ParseHex(keyHex), ParseHex(valueHex)));\n        }\n    }\n\n    if (keyHex != DATA_END) {\n        LogPrintf(\"CDBEnv::Salvage: WARNING: Unexpected end of file while reading salvage output.\\n\");\n        return false;\n    }\n\n    return (result == 0);\n}\n\n\nvoid CDBEnv::CheckpointLSN(const std::string& strFile)\n{\n    dbenv->txn_checkpoint(0, 0, 0);\n    if (fMockDb)\n        return;\n    dbenv->lsn_reset(strFile.c_str(), 0);\n}\n\n\nCDB::CDB(CWalletDBWrapper& dbw, const char* pszMode, bool fFlushOnCloseIn) : pdb(nullptr), activeTxn(nullptr)\n{\n    fReadOnly = (!strchr(pszMode, '+') && !strchr(pszMode, 'w'));\n    fFlushOnClose = fFlushOnCloseIn;\n    env = dbw.env;\n    if (dbw.IsDummy()) {\n        return;\n    }\n    const std::string &strFilename = dbw.strFile;\n\n    bool fCreate = strchr(pszMode, 'c') != nullptr;\n    unsigned int nFlags = DB_THREAD;\n    if (fCreate)\n        nFlags |= DB_CREATE;\n\n    {\n        LOCK(env->cs_db);\n        if (!env->Open(GetWalletDir()))\n            throw std::runtime_error(\"CDB: Failed to open database environment.\");\n\n        pdb = env->mapDb[strFilename];\n        if (pdb == nullptr) {\n            int ret;\n            std::unique_ptr<Db> pdb_temp = MakeUnique<Db>(env->dbenv.get(), 0);\n\n            bool fMockDb = env->IsMock();\n            if (fMockDb) {\n                DbMpoolFile* mpf = pdb_temp->get_mpf();\n                ret = mpf->set_flags(DB_MPOOL_NOFILE, 1);\n                if (ret != 0) {\n                    throw std::runtime_error(strprintf(\"CDB: Failed to configure for no temp file backing for database %s\", strFilename));\n                }\n            }\n\n            ret = pdb_temp->open(nullptr,                             // Txn pointer\n                            fMockDb ? nullptr : strFilename.c_str(),  // Filename\n                            fMockDb ? strFilename.c_str() : \"main\",   // Logical db name\n                            DB_BTREE,                                 // Database type\n                            nFlags,                                   // Flags\n                            0);\n\n            if (ret != 0) {\n                throw std::runtime_error(strprintf(\"CDB: Error %d, can't open database %s\", ret, strFilename));\n            }\n            CheckUniqueFileid(*env, strFilename, *pdb_temp);\n\n            pdb = pdb_temp.release();\n            env->mapDb[strFilename] = pdb;\n\n            if (fCreate && !Exists(std::string(\"version\"))) {\n                bool fTmp = fReadOnly;\n                fReadOnly = false;\n                WriteVersion(CLIENT_VERSION);\n                fReadOnly = fTmp;\n            }\n        }\n        ++env->mapFileUseCount[strFilename];\n        strFile = strFilename;\n    }\n}\n\nvoid CDB::Flush()\n{\n    if (activeTxn)\n        return;\n\n    // Flush database activity from memory pool to disk log\n    unsigned int nMinutes = 0;\n    if (fReadOnly)\n        nMinutes = 1;\n\n    env->dbenv->txn_checkpoint(nMinutes ? gArgs.GetArg(\"-dblogsize\", DEFAULT_WALLET_DBLOGSIZE) * 1024 : 0, nMinutes, 0);\n}\n\nvoid CWalletDBWrapper::IncrementUpdateCounter()\n{\n    ++nUpdateCounter;\n}\n\nvoid CDB::Close()\n{\n    if (!pdb)\n        return;\n    if (activeTxn)\n        activeTxn->abort();\n    activeTxn = nullptr;\n    pdb = nullptr;\n\n    if (fFlushOnClose)\n        Flush();\n\n    {\n        LOCK(env->cs_db);\n        --env->mapFileUseCount[strFile];\n    }\n}\n\nvoid CDBEnv::CloseDb(const std::string& strFile)\n{\n    {\n        LOCK(cs_db);\n        if (mapDb[strFile] != nullptr) {\n            // Close the database handle\n            Db* pdb = mapDb[strFile];\n            pdb->close(0);\n            delete pdb;\n            mapDb[strFile] = nullptr;\n        }\n    }\n}\n\nbool CDB::Rewrite(CWalletDBWrapper& dbw, const char* pszSkip)\n{\n    if (dbw.IsDummy()) {\n        return true;\n    }\n    CDBEnv *env = dbw.env;\n    const std::string& strFile = dbw.strFile;\n    while (true) {\n        {\n            LOCK(env->cs_db);\n            if (!env->mapFileUseCount.count(strFile) || env->mapFileUseCount[strFile] == 0) {\n                // Flush log data to the dat file\n                env->CloseDb(strFile);\n                env->CheckpointLSN(strFile);\n                env->mapFileUseCount.erase(strFile);\n\n                bool fSuccess = true;\n                LogPrintf(\"CDB::Rewrite: Rewriting %s...\\n\", strFile);\n                std::string strFileRes = strFile + \".rewrite\";\n                { // surround usage of db with extra {}\n                    CDB db(dbw, \"r\");\n                    std::unique_ptr<Db> pdbCopy = MakeUnique<Db>(env->dbenv.get(), 0);\n\n                    int ret = pdbCopy->open(nullptr,               // Txn pointer\n                                            strFileRes.c_str(), // Filename\n                                            \"main\",             // Logical db name\n                                            DB_BTREE,           // Database type\n                                            DB_CREATE,          // Flags\n                                            0);\n                    if (ret > 0) {\n                        LogPrintf(\"CDB::Rewrite: Can't create database file %s\\n\", strFileRes);\n                        fSuccess = false;\n                    }\n\n                    Dbc* pcursor = db.GetCursor();\n                    if (pcursor)\n                        while (fSuccess) {\n                            CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n                            CDataStream ssValue(SER_DISK, CLIENT_VERSION);\n                            int ret1 = db.ReadAtCursor(pcursor, ssKey, ssValue);\n                            if (ret1 == DB_NOTFOUND) {\n                                pcursor->close();\n                                break;\n                            } else if (ret1 != 0) {\n                                pcursor->close();\n                                fSuccess = false;\n                                break;\n                            }\n                            if (pszSkip &&\n                                strncmp(ssKey.data(), pszSkip, std::min(ssKey.size(), strlen(pszSkip))) == 0)\n                                continue;\n                            if (strncmp(ssKey.data(), \"\\x07version\", 8) == 0) {\n                                // Update version:\n                                ssValue.clear();\n                                ssValue << CLIENT_VERSION;\n                            }\n                            Dbt datKey(ssKey.data(), ssKey.size());\n                            Dbt datValue(ssValue.data(), ssValue.size());\n                            int ret2 = pdbCopy->put(nullptr, &datKey, &datValue, DB_NOOVERWRITE);\n                            if (ret2 > 0)\n                                fSuccess = false;\n                        }\n                    if (fSuccess) {\n                        db.Close();\n                        env->CloseDb(strFile);\n                        if (pdbCopy->close(0))\n                            fSuccess = false;\n                    } else {\n                        pdbCopy->close(0);\n                    }\n                }\n                if (fSuccess) {\n                    Db dbA(env->dbenv.get(), 0);\n                    if (dbA.remove(strFile.c_str(), nullptr, 0))\n                        fSuccess = false;\n                    Db dbB(env->dbenv.get(), 0);\n                    if (dbB.rename(strFileRes.c_str(), nullptr, strFile.c_str(), 0))\n                        fSuccess = false;\n                }\n                if (!fSuccess)\n                    LogPrintf(\"CDB::Rewrite: Failed to rewrite database file %s\\n\", strFileRes);\n                return fSuccess;\n            }\n        }\n        MilliSleep(100);\n    }\n}\n\n\nvoid CDBEnv::Flush(bool fShutdown)\n{\n    int64_t nStart = GetTimeMillis();\n    // Flush log data to the actual data file on all files that are not in use\n    LogPrint(BCLog::DB, \"CDBEnv::Flush: Flush(%s)%s\\n\", fShutdown ? \"true\" : \"false\", fDbEnvInit ? \"\" : \" database not started\");\n    if (!fDbEnvInit)\n        return;\n    {\n        LOCK(cs_db);\n        std::map<std::string, int>::iterator mi = mapFileUseCount.begin();\n        while (mi != mapFileUseCount.end()) {\n            std::string strFile = (*mi).first;\n            int nRefCount = (*mi).second;\n            LogPrint(BCLog::DB, \"CDBEnv::Flush: Flushing %s (refcount = %d)...\\n\", strFile, nRefCount);\n            if (nRefCount == 0) {\n                // Move log data to the dat file\n                CloseDb(strFile);\n                LogPrint(BCLog::DB, \"CDBEnv::Flush: %s checkpoint\\n\", strFile);\n                dbenv->txn_checkpoint(0, 0, 0);\n                LogPrint(BCLog::DB, \"CDBEnv::Flush: %s detach\\n\", strFile);\n                if (!fMockDb)\n                    dbenv->lsn_reset(strFile.c_str(), 0);\n                LogPrint(BCLog::DB, \"CDBEnv::Flush: %s closed\\n\", strFile);\n                mapFileUseCount.erase(mi++);\n            } else\n                mi++;\n        }\n        LogPrint(BCLog::DB, \"CDBEnv::Flush: Flush(%s)%s took %15dms\\n\", fShutdown ? \"true\" : \"false\", fDbEnvInit ? \"\" : \" database not started\", GetTimeMillis() - nStart);\n        if (fShutdown) {\n            char** listp;\n            if (mapFileUseCount.empty()) {\n                dbenv->log_archive(&listp, DB_ARCH_REMOVE);\n                Close();\n                if (!fMockDb)\n                    fs::remove_all(fs::path(strPath) / \"database\");\n            }\n        }\n    }\n}\n\nbool CDB::PeriodicFlush(CWalletDBWrapper& dbw)\n{\n    if (dbw.IsDummy()) {\n        return true;\n    }\n    bool ret = false;\n    CDBEnv *env = dbw.env;\n    const std::string& strFile = dbw.strFile;\n    TRY_LOCK(bitdb.cs_db,lockDb);\n    if (lockDb)\n    {\n        // Don't do this if any databases are in use\n        int nRefCount = 0;\n        std::map<std::string, int>::iterator mit = env->mapFileUseCount.begin();\n        while (mit != env->mapFileUseCount.end())\n        {\n            nRefCount += (*mit).second;\n            mit++;\n        }\n\n        if (nRefCount == 0)\n        {\n            boost::this_thread::interruption_point();\n            std::map<std::string, int>::iterator mi = env->mapFileUseCount.find(strFile);\n            if (mi != env->mapFileUseCount.end())\n            {\n                LogPrint(BCLog::DB, \"Flushing %s\\n\", strFile);\n                int64_t nStart = GetTimeMillis();\n\n                // Flush wallet file so it's self contained\n                env->CloseDb(strFile);\n                env->CheckpointLSN(strFile);\n\n                env->mapFileUseCount.erase(mi++);\n                LogPrint(BCLog::DB, \"Flushed %s %dms\\n\", strFile, GetTimeMillis() - nStart);\n                ret = true;\n            }\n        }\n    }\n\n    return ret;\n}\n\nbool CWalletDBWrapper::Rewrite(const char* pszSkip)\n{\n    return CDB::Rewrite(*this, pszSkip);\n}\n\nbool CWalletDBWrapper::Backup(const std::string& strDest)\n{\n    if (IsDummy()) {\n        return false;\n    }\n    while (true)\n    {\n        {\n            LOCK(env->cs_db);\n            if (!env->mapFileUseCount.count(strFile) || env->mapFileUseCount[strFile] == 0)\n            {\n                // Flush log data to the dat file\n                env->CloseDb(strFile);\n                env->CheckpointLSN(strFile);\n                env->mapFileUseCount.erase(strFile);\n\n                // Copy wallet file\n                fs::path pathSrc = GetWalletDir() / strFile;\n                fs::path pathDest(strDest);\n                if (fs::is_directory(pathDest))\n                    pathDest /= strFile;\n\n                try {\n                    if (fs::equivalent(pathSrc, pathDest)) {\n                        LogPrintf(\"cannot backup to wallet source file %s\\n\", pathDest.string());\n                        return false;\n                    }\n\n                    fs::copy_file(pathSrc, pathDest, fs::copy_option::overwrite_if_exists);\n                    LogPrintf(\"copied %s to %s\\n\", strFile, pathDest.string());\n                    return true;\n                } catch (const fs::filesystem_error& e) {\n                    LogPrintf(\"error copying %s to %s - %s\\n\", strFile, pathDest.string(), e.what());\n                    return false;\n                }\n            }\n        }\n        MilliSleep(100);\n    }\n}\n\nvoid CWalletDBWrapper::Flush(bool shutdown)\n{\n    if (!IsDummy()) {\n        env->Flush(shutdown);\n    }\n}\n"
  },
  {
    "path": "src/wallet/db.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_DB_H\n#define BITCOIN_WALLET_DB_H\n\n#include <clientversion.h>\n#include <fs.h>\n#include <serialize.h>\n#include <streams.h>\n#include <sync.h>\n#include <version.h>\n\n#include <atomic>\n#include <map>\n#include <memory>\n#include <string>\n#include <vector>\n\n#include <db_cxx.h>\n\nstatic const unsigned int DEFAULT_WALLET_DBLOGSIZE = 100;\nstatic const bool DEFAULT_WALLET_PRIVDB = true;\n\nclass CDBEnv\n{\nprivate:\n    bool fDbEnvInit;\n    bool fMockDb;\n    // Don't change into fs::path, as that can result in\n    // shutdown problems/crashes caused by a static initialized internal pointer.\n    std::string strPath;\n\n    void EnvShutdown();\n\npublic:\n    mutable CCriticalSection cs_db;\n    std::unique_ptr<DbEnv> dbenv;\n    std::map<std::string, int> mapFileUseCount;\n    std::map<std::string, Db*> mapDb;\n\n    CDBEnv();\n    ~CDBEnv();\n    void Reset();\n\n    void MakeMock();\n    bool IsMock() const { return fMockDb; }\n\n    /**\n     * Verify that database file strFile is OK. If it is not,\n     * call the callback to try to recover.\n     * This must be called BEFORE strFile is opened.\n     * Returns true if strFile is OK.\n     */\n    enum VerifyResult { VERIFY_OK,\n                        RECOVER_OK,\n                        RECOVER_FAIL };\n    typedef bool (*recoverFunc_type)(const std::string& strFile, std::string& out_backup_filename);\n    VerifyResult Verify(const std::string& strFile, recoverFunc_type recoverFunc, std::string& out_backup_filename);\n    /**\n     * Salvage data from a file that Verify says is bad.\n     * fAggressive sets the DB_AGGRESSIVE flag (see berkeley DB->verify() method documentation).\n     * Appends binary key/value pairs to vResult, returns true if successful.\n     * NOTE: reads the entire database into memory, so cannot be used\n     * for huge databases.\n     */\n    typedef std::pair<std::vector<unsigned char>, std::vector<unsigned char> > KeyValPair;\n    bool Salvage(const std::string& strFile, bool fAggressive, std::vector<KeyValPair>& vResult);\n\n    bool Open(const fs::path& path, bool retry = 0);\n    void Close();\n    void Flush(bool fShutdown);\n    void CheckpointLSN(const std::string& strFile);\n\n    void CloseDb(const std::string& strFile);\n\n    DbTxn* TxnBegin(int flags = DB_TXN_WRITE_NOSYNC)\n    {\n        DbTxn* ptxn = nullptr;\n        int ret = dbenv->txn_begin(nullptr, &ptxn, flags);\n        if (!ptxn || ret != 0)\n            return nullptr;\n        return ptxn;\n    }\n};\n\nextern CDBEnv bitdb;\n\n/** An instance of this class represents one database.\n * For BerkeleyDB this is just a (env, strFile) tuple.\n **/\nclass CWalletDBWrapper\n{\n    friend class CDB;\npublic:\n    /** Create dummy DB handle */\n    CWalletDBWrapper() : nUpdateCounter(0), nLastSeen(0), nLastFlushed(0), nLastWalletUpdate(0), env(nullptr)\n    {\n    }\n\n    /** Create DB handle to real database */\n    CWalletDBWrapper(CDBEnv *env_in, const std::string &strFile_in) :\n        nUpdateCounter(0), nLastSeen(0), nLastFlushed(0), nLastWalletUpdate(0), env(env_in), strFile(strFile_in)\n    {\n    }\n\n    /** Rewrite the entire database on disk, with the exception of key pszSkip if non-zero\n     */\n    bool Rewrite(const char* pszSkip=nullptr);\n\n    /** Back up the entire database to a file.\n     */\n    bool Backup(const std::string& strDest);\n\n    /** Get a name for this database, for debugging etc.\n     */\n    std::string GetName() const { return strFile; }\n\n    /** Make sure all changes are flushed to disk.\n     */\n    void Flush(bool shutdown);\n\n    void IncrementUpdateCounter();\n\n    std::atomic<unsigned int> nUpdateCounter;\n    unsigned int nLastSeen;\n    unsigned int nLastFlushed;\n    int64_t nLastWalletUpdate;\n\nprivate:\n    /** BerkeleyDB specific */\n    CDBEnv *env;\n    std::string strFile;\n\n    /** Return whether this database handle is a dummy for testing.\n     * Only to be used at a low level, application should ideally not care\n     * about this.\n     */\n    bool IsDummy() { return env == nullptr; }\n};\n\n\n/** RAII class that provides access to a Berkeley database */\nclass CDB\n{\nprotected:\n    Db* pdb;\n    std::string strFile;\n    DbTxn* activeTxn;\n    bool fReadOnly;\n    bool fFlushOnClose;\n    CDBEnv *env;\n\npublic:\n    explicit CDB(CWalletDBWrapper& dbw, const char* pszMode = \"r+\", bool fFlushOnCloseIn=true);\n    ~CDB() { Close(); }\n\n    CDB(const CDB&) = delete;\n    CDB& operator=(const CDB&) = delete;\n\n    void Flush();\n    void Close();\n    static bool Recover(const std::string& filename, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue), std::string& out_backup_filename);\n\n    /* flush the wallet passively (TRY_LOCK)\n       ideal to be called periodically */\n    static bool PeriodicFlush(CWalletDBWrapper& dbw);\n    /* verifies the database environment */\n    static bool VerifyEnvironment(const std::string& walletFile, const fs::path& walletDir, std::string& errorStr);\n    /* verifies the database file */\n    static bool VerifyDatabaseFile(const std::string& walletFile, const fs::path& walletDir, std::string& warningStr, std::string& errorStr, CDBEnv::recoverFunc_type recoverFunc);\n\npublic:\n    template <typename K, typename T>\n    bool Read(const K& key, T& value)\n    {\n        if (!pdb)\n            return false;\n\n        // Key\n        CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n        ssKey.reserve(1000);\n        ssKey << key;\n        Dbt datKey(ssKey.data(), ssKey.size());\n\n        // Read\n        Dbt datValue;\n        datValue.set_flags(DB_DBT_MALLOC);\n        int ret = pdb->get(activeTxn, &datKey, &datValue, 0);\n        memory_cleanse(datKey.get_data(), datKey.get_size());\n        bool success = false;\n        if (datValue.get_data() != nullptr) {\n            // Unserialize value\n            try {\n                CDataStream ssValue((char*)datValue.get_data(), (char*)datValue.get_data() + datValue.get_size(), SER_DISK, CLIENT_VERSION);\n                ssValue >> value;\n                success = true;\n            } catch (const std::exception&) {\n                // In this case success remains 'false'\n            }\n\n            // Clear and free memory\n            memory_cleanse(datValue.get_data(), datValue.get_size());\n            free(datValue.get_data());\n        }\n        return ret == 0 && success;\n    }\n\n    template <typename K, typename T>\n    bool Write(const K& key, const T& value, bool fOverwrite = true)\n    {\n        if (!pdb)\n            return true;\n        if (fReadOnly)\n            assert(!\"Write called on database in read-only mode\");\n\n        // Key\n        CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n        ssKey.reserve(1000);\n        ssKey << key;\n        Dbt datKey(ssKey.data(), ssKey.size());\n\n        // Value\n        CDataStream ssValue(SER_DISK, CLIENT_VERSION);\n        ssValue.reserve(10000);\n        ssValue << value;\n        Dbt datValue(ssValue.data(), ssValue.size());\n\n        // Write\n        int ret = pdb->put(activeTxn, &datKey, &datValue, (fOverwrite ? 0 : DB_NOOVERWRITE));\n\n        // Clear memory in case it was a private key\n        memory_cleanse(datKey.get_data(), datKey.get_size());\n        memory_cleanse(datValue.get_data(), datValue.get_size());\n        return (ret == 0);\n    }\n\n    template <typename K>\n    bool Erase(const K& key)\n    {\n        if (!pdb)\n            return false;\n        if (fReadOnly)\n            assert(!\"Erase called on database in read-only mode\");\n\n        // Key\n        CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n        ssKey.reserve(1000);\n        ssKey << key;\n        Dbt datKey(ssKey.data(), ssKey.size());\n\n        // Erase\n        int ret = pdb->del(activeTxn, &datKey, 0);\n\n        // Clear memory\n        memory_cleanse(datKey.get_data(), datKey.get_size());\n        return (ret == 0 || ret == DB_NOTFOUND);\n    }\n\n    template <typename K>\n    bool Exists(const K& key)\n    {\n        if (!pdb)\n            return false;\n\n        // Key\n        CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n        ssKey.reserve(1000);\n        ssKey << key;\n        Dbt datKey(ssKey.data(), ssKey.size());\n\n        // Exists\n        int ret = pdb->exists(activeTxn, &datKey, 0);\n\n        // Clear memory\n        memory_cleanse(datKey.get_data(), datKey.get_size());\n        return (ret == 0);\n    }\n\n    Dbc* GetCursor()\n    {\n        if (!pdb)\n            return nullptr;\n        Dbc* pcursor = nullptr;\n        int ret = pdb->cursor(nullptr, &pcursor, 0);\n        if (ret != 0)\n            return nullptr;\n        return pcursor;\n    }\n\n    int ReadAtCursor(Dbc* pcursor, CDataStream& ssKey, CDataStream& ssValue, bool setRange = false)\n    {\n        // Read at cursor\n        Dbt datKey;\n        unsigned int fFlags = DB_NEXT;\n        if (setRange) {\n            datKey.set_data(ssKey.data());\n            datKey.set_size(ssKey.size());\n            fFlags = DB_SET_RANGE;\n        }\n        Dbt datValue;\n        datKey.set_flags(DB_DBT_MALLOC);\n        datValue.set_flags(DB_DBT_MALLOC);\n        int ret = pcursor->get(&datKey, &datValue, fFlags);\n        if (ret != 0)\n            return ret;\n        else if (datKey.get_data() == nullptr || datValue.get_data() == nullptr)\n            return 99999;\n\n        // Convert to streams\n        ssKey.SetType(SER_DISK);\n        ssKey.clear();\n        ssKey.write((char*)datKey.get_data(), datKey.get_size());\n        ssValue.SetType(SER_DISK);\n        ssValue.clear();\n        ssValue.write((char*)datValue.get_data(), datValue.get_size());\n\n        // Clear and free memory\n        memory_cleanse(datKey.get_data(), datKey.get_size());\n        memory_cleanse(datValue.get_data(), datValue.get_size());\n        free(datKey.get_data());\n        free(datValue.get_data());\n        return 0;\n    }\n\npublic:\n    bool TxnBegin()\n    {\n        if (!pdb || activeTxn)\n            return false;\n        DbTxn* ptxn = bitdb.TxnBegin();\n        if (!ptxn)\n            return false;\n        activeTxn = ptxn;\n        return true;\n    }\n\n    bool TxnCommit()\n    {\n        if (!pdb || !activeTxn)\n            return false;\n        int ret = activeTxn->commit(0);\n        activeTxn = nullptr;\n        return (ret == 0);\n    }\n\n    bool TxnAbort()\n    {\n        if (!pdb || !activeTxn)\n            return false;\n        int ret = activeTxn->abort();\n        activeTxn = nullptr;\n        return (ret == 0);\n    }\n\n    bool ReadVersion(int& nVersion)\n    {\n        nVersion = 0;\n        return Read(std::string(\"version\"), nVersion);\n    }\n\n    bool WriteVersion(int nVersion)\n    {\n        return Write(std::string(\"version\"), nVersion);\n    }\n\n    bool static Rewrite(CWalletDBWrapper& dbw, const char* pszSkip = nullptr);\n};\n\n#endif // BITCOIN_WALLET_DB_H\n"
  },
  {
    "path": "src/wallet/feebumper.cpp",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <consensus/validation.h>\n#include <wallet/coincontrol.h>\n#include <wallet/feebumper.h>\n#include <wallet/fees.h>\n#include <wallet/wallet.h>\n#include <policy/fees.h>\n#include <policy/policy.h>\n#include <policy/rbf.h>\n#include <validation.h> //for mempool access\n#include <txmempool.h>\n#include <utilmoneystr.h>\n#include <util.h>\n#include <net.h>\n\n// Calculate the size of the transaction assuming all signatures are max size\n// Use DummySignatureCreator, which inserts 72 byte signatures everywhere.\n// TODO: re-use this in CWallet::CreateTransaction (right now\n// CreateTransaction uses the constructed dummy-signed tx to do a priority\n// calculation, but we should be able to refactor after priority is removed).\n// NOTE: this requires that all inputs must be in mapWallet (eg the tx should\n// be IsAllFromMe).\nstatic int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *wallet)\n{\n    CMutableTransaction txNew(tx);\n    std::vector<CInputCoin> vCoins;\n    // Look up the inputs.  We should have already checked that this transaction\n    // IsAllFromMe(ISMINE_SPENDABLE), so every input should already be in our\n    // wallet, with a valid index into the vout array.\n    for (auto& input : tx.vin) {\n        const auto mi = wallet->mapWallet.find(input.prevout.hash);\n        assert(mi != wallet->mapWallet.end() && input.prevout.n < mi->second.tx->vout.size());\n        vCoins.emplace_back(CInputCoin(&(mi->second), input.prevout.n));\n    }\n    if (!wallet->DummySignTx(txNew, vCoins)) {\n        // This should never happen, because IsAllFromMe(ISMINE_SPENDABLE)\n        // implies that we can sign for every input.\n        return -1;\n    }\n    return GetVirtualTransactionSize(txNew);\n}\n\n//! Check whether transaction has descendant in wallet or mempool, or has been\n//! mined, or conflicts with a mined transaction. Return a feebumper::Result.\nstatic feebumper::Result PreconditionChecks(const CWallet* wallet, const CWalletTx& wtx, std::vector<std::string>& errors)\n{\n    if (wallet->HasWalletSpend(wtx.GetHash())) {\n        errors.push_back(\"Transaction has descendants in the wallet\");\n        return feebumper::Result::INVALID_PARAMETER;\n    }\n\n    {\n        LOCK(mempool.cs);\n        auto it_mp = mempool.mapTx.find(wtx.GetHash());\n        if (it_mp != mempool.mapTx.end() && it_mp->GetCountWithDescendants() > 1) {\n            errors.push_back(\"Transaction has descendants in the mempool\");\n            return feebumper::Result::INVALID_PARAMETER;\n        }\n    }\n\n    if (wtx.GetDepthInMainChain() != 0) {\n        errors.push_back(\"Transaction has been mined, or is conflicted with a mined transaction\");\n        return feebumper::Result::WALLET_ERROR;\n    }\n    return feebumper::Result::OK;\n}\n\nnamespace feebumper {\n\nbool TransactionCanBeBumped(CWallet* wallet, const uint256& txid)\n{\n    LOCK2(cs_main, wallet->cs_wallet);\n    const CWalletTx* wtx = wallet->GetWalletTx(txid);\n    return wtx && SignalsOptInRBF(*wtx->tx) && !wtx->mapValue.count(\"replaced_by_txid\");\n}\n\nResult CreateTransaction(const CWallet* wallet, const uint256& txid, const CCoinControl& coin_control, CAmount total_fee, std::vector<std::string>& errors,\n                         CAmount& old_fee, CAmount& new_fee, CMutableTransaction& mtx)\n{\n    LOCK2(cs_main, wallet->cs_wallet);\n    errors.clear();\n    auto it = wallet->mapWallet.find(txid);\n    if (it == wallet->mapWallet.end()) {\n        errors.push_back(\"Invalid or non-wallet transaction id\");\n        return Result::INVALID_ADDRESS_OR_KEY;\n    }\n    const CWalletTx& wtx = it->second;\n\n    Result result = PreconditionChecks(wallet, wtx, errors);\n    if (result != Result::OK) {\n        return result;\n    }\n\n    if (!SignalsOptInRBF(*wtx.tx)) {\n        errors.push_back(\"Transaction is not BIP 125 replaceable\");\n        return Result::WALLET_ERROR;\n    }\n\n    if (wtx.mapValue.count(\"replaced_by_txid\")) {\n        errors.push_back(strprintf(\"Cannot bump transaction %s which was already bumped by transaction %s\", txid.ToString(), wtx.mapValue.at(\"replaced_by_txid\")));\n        return Result::WALLET_ERROR;\n    }\n\n    // check that original tx consists entirely of our inputs\n    // if not, we can't bump the fee, because the wallet has no way of knowing the value of the other inputs (thus the fee)\n    if (!wallet->IsAllFromMe(*wtx.tx, ISMINE_SPENDABLE)) {\n        errors.push_back(\"Transaction contains inputs that don't belong to this wallet\");\n        return Result::WALLET_ERROR;\n    }\n\n    // figure out which output was change\n    // if there was no change output or multiple change outputs, fail\n    int nOutput = -1;\n    for (size_t i = 0; i < wtx.tx->vout.size(); ++i) {\n        if (wallet->IsChange(wtx.tx->vout[i])) {\n            if (nOutput != -1) {\n                errors.push_back(\"Transaction has multiple change outputs\");\n                return Result::WALLET_ERROR;\n            }\n            nOutput = i;\n        }\n    }\n    if (nOutput == -1) {\n        errors.push_back(\"Transaction does not have a change output\");\n        return Result::WALLET_ERROR;\n    }\n\n    // Calculate the expected size of the new transaction.\n    int64_t txSize = GetVirtualTransactionSize(*(wtx.tx));\n    const int64_t maxNewTxSize = CalculateMaximumSignedTxSize(*wtx.tx, wallet);\n    if (maxNewTxSize < 0) {\n        errors.push_back(\"Transaction contains inputs that cannot be signed\");\n        return Result::INVALID_ADDRESS_OR_KEY;\n    }\n\n    // calculate the old fee and fee-rate\n    old_fee = wtx.GetDebit(ISMINE_SPENDABLE) - wtx.tx->GetValueOut();\n    CFeeRate nOldFeeRate(old_fee, txSize);\n    CFeeRate nNewFeeRate;\n    // The wallet uses a conservative WALLET_INCREMENTAL_RELAY_FEE value to\n    // future proof against changes to network wide policy for incremental relay\n    // fee that our node may not be aware of.\n    CFeeRate walletIncrementalRelayFee = CFeeRate(WALLET_INCREMENTAL_RELAY_FEE);\n    if (::incrementalRelayFee > walletIncrementalRelayFee) {\n        walletIncrementalRelayFee = ::incrementalRelayFee;\n    }\n\n    if (total_fee > 0) {\n        CAmount minTotalFee = nOldFeeRate.GetFee(maxNewTxSize) + ::incrementalRelayFee.GetFee(maxNewTxSize);\n        if (total_fee < minTotalFee) {\n            errors.push_back(strprintf(\"Insufficient totalFee, must be at least %s (oldFee %s + incrementalFee %s)\",\n                                                                FormatMoney(minTotalFee), FormatMoney(nOldFeeRate.GetFee(maxNewTxSize)), FormatMoney(::incrementalRelayFee.GetFee(maxNewTxSize))));\n            return Result::INVALID_PARAMETER;\n        }\n        CAmount requiredFee = GetRequiredFee(maxNewTxSize);\n        if (total_fee < requiredFee) {\n            errors.push_back(strprintf(\"Insufficient totalFee (cannot be less than required fee %s)\",\n                                                                FormatMoney(requiredFee)));\n            return Result::INVALID_PARAMETER;\n        }\n        new_fee = total_fee;\n        nNewFeeRate = CFeeRate(total_fee, maxNewTxSize);\n    } else {\n        new_fee = GetMinimumFee(maxNewTxSize, coin_control, mempool, ::feeEstimator, nullptr /* FeeCalculation */);\n        nNewFeeRate = CFeeRate(new_fee, maxNewTxSize);\n\n        // New fee rate must be at least old rate + minimum incremental relay rate\n        // walletIncrementalRelayFee.GetFeePerK() should be exact, because it's initialized\n        // in that unit (fee per kb).\n        // However, nOldFeeRate is a calculated value from the tx fee/size, so\n        // add 1 satoshi to the result, because it may have been rounded down.\n        if (nNewFeeRate.GetFeePerK() < nOldFeeRate.GetFeePerK() + 1 + walletIncrementalRelayFee.GetFeePerK()) {\n            nNewFeeRate = CFeeRate(nOldFeeRate.GetFeePerK() + 1 + walletIncrementalRelayFee.GetFeePerK());\n            new_fee = nNewFeeRate.GetFee(maxNewTxSize);\n        }\n    }\n\n    // Check that in all cases the new fee doesn't violate maxTxFee\n     if (new_fee > maxTxFee) {\n         errors.push_back(strprintf(\"Specified or calculated fee %s is too high (cannot be higher than maxTxFee %s)\",\n                               FormatMoney(new_fee), FormatMoney(maxTxFee)));\n         return Result::WALLET_ERROR;\n     }\n\n    // check that fee rate is higher than mempool's minimum fee\n    // (no point in bumping fee if we know that the new tx won't be accepted to the mempool)\n    // This may occur if the user set TotalFee or paytxfee too low, if fallbackfee is too low, or, perhaps,\n    // in a rare situation where the mempool minimum fee increased significantly since the fee estimation just a\n    // moment earlier. In this case, we report an error to the user, who may use total_fee to make an adjustment.\n    CFeeRate minMempoolFeeRate = mempool.GetMinFee(gArgs.GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000);\n    if (nNewFeeRate.GetFeePerK() < minMempoolFeeRate.GetFeePerK()) {\n        errors.push_back(strprintf(\n            \"New fee rate (%s) is lower than the minimum fee rate (%s) to get into the mempool -- \"\n            \"the totalFee value should be at least %s or the settxfee value should be at least %s to add transaction\",\n            FormatMoney(nNewFeeRate.GetFeePerK()),\n            FormatMoney(minMempoolFeeRate.GetFeePerK()),\n            FormatMoney(minMempoolFeeRate.GetFee(maxNewTxSize)),\n            FormatMoney(minMempoolFeeRate.GetFeePerK())));\n        return Result::WALLET_ERROR;\n    }\n\n    // Now modify the output to increase the fee.\n    // If the output is not large enough to pay the fee, fail.\n    CAmount nDelta = new_fee - old_fee;\n    assert(nDelta > 0);\n    mtx =  *wtx.tx;\n    CTxOut* poutput = &(mtx.vout[nOutput]);\n    if (poutput->nValue < nDelta) {\n        errors.push_back(\"Change output is too small to bump the fee\");\n        return Result::WALLET_ERROR;\n    }\n\n    // If the output would become dust, discard it (converting the dust to fee)\n    poutput->nValue -= nDelta;\n    if (poutput->nValue <= GetDustThreshold(*poutput, ::dustRelayFee)) {\n        LogPrint(BCLog::RPC, \"Bumping fee and discarding dust output\\n\");\n        new_fee += poutput->nValue;\n        mtx.vout.erase(mtx.vout.begin() + nOutput);\n    }\n\n    // Mark new tx not replaceable, if requested.\n    if (!coin_control.signalRbf) {\n        for (auto& input : mtx.vin) {\n            if (input.nSequence < 0xfffffffe) input.nSequence = 0xfffffffe;\n        }\n    }\n\n    return Result::OK;\n}\n\nbool SignTransaction(CWallet* wallet, CMutableTransaction& mtx) {\n    LOCK2(cs_main, wallet->cs_wallet);\n    return wallet->SignTransaction(mtx);\n}\n\nResult CommitTransaction(CWallet* wallet, const uint256& txid, CMutableTransaction&& mtx, std::vector<std::string>& errors, uint256& bumped_txid)\n{\n    LOCK2(cs_main, wallet->cs_wallet);\n    if (!errors.empty()) {\n        return Result::MISC_ERROR;\n    }\n    auto it = txid.IsNull() ? wallet->mapWallet.end() : wallet->mapWallet.find(txid);\n    if (it == wallet->mapWallet.end()) {\n        errors.push_back(\"Invalid or non-wallet transaction id\");\n        return Result::MISC_ERROR;\n    }\n    CWalletTx& oldWtx = it->second;\n\n    // make sure the transaction still has no descendants and hasn't been mined in the meantime\n    Result result = PreconditionChecks(wallet, oldWtx, errors);\n    if (result != Result::OK) {\n        return result;\n    }\n\n    CWalletTx wtxBumped(wallet, MakeTransactionRef(std::move(mtx)));\n    // commit/broadcast the tx\n    CReserveKey reservekey(wallet);\n    wtxBumped.mapValue = oldWtx.mapValue;\n    wtxBumped.mapValue[\"replaces_txid\"] = oldWtx.GetHash().ToString();\n    wtxBumped.vOrderForm = oldWtx.vOrderForm;\n    wtxBumped.strFromAccount = oldWtx.strFromAccount;\n    wtxBumped.fTimeReceivedIsTxTime = true;\n    wtxBumped.fFromMe = true;\n    CValidationState state;\n    if (!wallet->CommitTransaction(wtxBumped, reservekey, g_connman.get(), state)) {\n        // NOTE: CommitTransaction never returns false, so this should never happen.\n        errors.push_back(strprintf(\"The transaction was rejected: %s\", state.GetRejectReason()));\n        return Result::WALLET_ERROR;\n    }\n\n    bumped_txid = wtxBumped.GetHash();\n    if (state.IsInvalid()) {\n        // This can happen if the mempool rejected the transaction.  Report\n        // what happened in the \"errors\" response.\n        errors.push_back(strprintf(\"Error: The transaction was rejected: %s\", FormatStateMessage(state)));\n    }\n\n    // mark the original tx as bumped\n    if (!wallet->MarkReplaced(oldWtx.GetHash(), wtxBumped.GetHash())) {\n        // TODO: see if JSON-RPC has a standard way of returning a response\n        // along with an exception. It would be good to return information about\n        // wtxBumped to the caller even if marking the original transaction\n        // replaced does not succeed for some reason.\n        errors.push_back(\"Created new bumpfee transaction but could not mark the original transaction as replaced\");\n    }\n    return Result::OK;\n}\n\n} // namespace feebumper\n\n"
  },
  {
    "path": "src/wallet/feebumper.h",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_FEEBUMPER_H\n#define BITCOIN_WALLET_FEEBUMPER_H\n\n#include <primitives/transaction.h>\n\nclass CWallet;\nclass CWalletTx;\nclass uint256;\nclass CCoinControl;\nenum class FeeEstimateMode;\n\nnamespace feebumper {\n\nenum class Result\n{\n    OK,\n    INVALID_ADDRESS_OR_KEY,\n    INVALID_REQUEST,\n    INVALID_PARAMETER,\n    WALLET_ERROR,\n    MISC_ERROR,\n};\n\n//! Return whether transaction can be bumped.\nbool TransactionCanBeBumped(CWallet* wallet, const uint256& txid);\n\n//! Create bumpfee transaction.\nResult CreateTransaction(const CWallet* wallet,\n                         const uint256& txid,\n                         const CCoinControl& coin_control,\n                         CAmount total_fee,\n                         std::vector<std::string>& errors,\n                         CAmount& old_fee,\n                         CAmount& new_fee,\n                         CMutableTransaction& mtx);\n\n//! Sign the new transaction,\n//! @return false if the tx couldn't be found or if it was\n//! impossible to create the signature(s)\nbool SignTransaction(CWallet* wallet, CMutableTransaction& mtx);\n\n//! Commit the bumpfee transaction.\n//! @return success in case of CWallet::CommitTransaction was successful,\n//! but sets errors if the tx could not be added to the mempool (will try later)\n//! or if the old transaction could not be marked as replaced.\nResult CommitTransaction(CWallet* wallet,\n                         const uint256& txid,\n                         CMutableTransaction&& mtx,\n                         std::vector<std::string>& errors,\n                         uint256& bumped_txid);\n\n} // namespace feebumper\n\n#endif // BITCOIN_WALLET_FEEBUMPER_H\n"
  },
  {
    "path": "src/wallet/fees.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/fees.h>\n\n#include <policy/policy.h>\n#include <txmempool.h>\n#include <util.h>\n#include <validation.h>\n#include <wallet/coincontrol.h>\n#include <wallet/wallet.h>\n\n\nCAmount GetRequiredFee(unsigned int nTxBytes)\n{\n    return std::max(CWallet::minTxFee.GetFee(nTxBytes), ::minRelayTxFee.GetFee(nTxBytes));\n}\n\n\nCAmount GetMinimumFee(unsigned int nTxBytes, const CCoinControl& coin_control, const CTxMemPool& pool, const CBlockPolicyEstimator& estimator, FeeCalculation *feeCalc)\n{\n    /* User control of how to calculate fee uses the following parameter precedence:\n       1. coin_control.m_feerate\n       2. coin_control.m_confirm_target\n       3. payTxFee (user-set global variable)\n       4. nTxConfirmTarget (user-set global variable)\n       The first parameter that is set is used.\n    */\n    CAmount fee_needed;\n    if (coin_control.m_feerate) { // 1.\n        fee_needed = coin_control.m_feerate->GetFee(nTxBytes);\n        if (feeCalc) feeCalc->reason = FeeReason::PAYTXFEE;\n        // Allow to override automatic min/max check over coin control instance\n        if (coin_control.fOverrideFeeRate) return fee_needed;\n    }\n    else if (!coin_control.m_confirm_target && ::payTxFee != CFeeRate(0)) { // 3. TODO: remove magic value of 0 for global payTxFee\n        fee_needed = ::payTxFee.GetFee(nTxBytes);\n        if (feeCalc) feeCalc->reason = FeeReason::PAYTXFEE;\n    }\n    else { // 2. or 4.\n        // We will use smart fee estimation\n        unsigned int target = coin_control.m_confirm_target ? *coin_control.m_confirm_target : ::nTxConfirmTarget;\n        // By default estimates are economical iff we are signaling opt-in-RBF\n        bool conservative_estimate = !coin_control.signalRbf;\n        // Allow to override the default fee estimate mode over the CoinControl instance\n        if (coin_control.m_fee_mode == FeeEstimateMode::CONSERVATIVE) conservative_estimate = true;\n        else if (coin_control.m_fee_mode == FeeEstimateMode::ECONOMICAL) conservative_estimate = false;\n\n        fee_needed = estimator.estimateSmartFee(target, feeCalc, conservative_estimate).GetFee(nTxBytes);\n        if (fee_needed == 0) {\n            // if we don't have enough data for estimateSmartFee, then use fallbackFee\n            fee_needed = CWallet::fallbackFee.GetFee(nTxBytes);\n            if (feeCalc) feeCalc->reason = FeeReason::FALLBACK;\n        }\n        // Obey mempool min fee when using smart fee estimation\n        CAmount min_mempool_fee = pool.GetMinFee(gArgs.GetArg(\"-maxmempool\", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000).GetFee(nTxBytes);\n        if (fee_needed < min_mempool_fee) {\n            fee_needed = min_mempool_fee;\n            if (feeCalc) feeCalc->reason = FeeReason::MEMPOOL_MIN;\n        }\n    }\n\n    // prevent user from paying a fee below minRelayTxFee or minTxFee\n    CAmount required_fee = GetRequiredFee(nTxBytes);\n    if (required_fee > fee_needed) {\n        fee_needed = required_fee;\n        if (feeCalc) feeCalc->reason = FeeReason::REQUIRED;\n    }\n    // But always obey the maximum\n    if (fee_needed > maxTxFee) {\n        fee_needed = maxTxFee;\n        if (feeCalc) feeCalc->reason = FeeReason::MAXTXFEE;\n    }\n    return fee_needed;\n}\n\n\nCFeeRate GetDiscardRate(const CBlockPolicyEstimator& estimator)\n{\n    unsigned int highest_target = estimator.HighestTargetTracked(FeeEstimateHorizon::LONG_HALFLIFE);\n    CFeeRate discard_rate = estimator.estimateSmartFee(highest_target, nullptr /* FeeCalculation */, false /* conservative */);\n    // Don't let discard_rate be greater than longest possible fee estimate if we get a valid fee estimate\n    discard_rate = (discard_rate == CFeeRate(0)) ? CWallet::m_discard_rate : std::min(discard_rate, CWallet::m_discard_rate);\n    // Discard rate must be at least dustRelayFee\n    discard_rate = std::max(discard_rate, ::dustRelayFee);\n    return discard_rate;\n}\n"
  },
  {
    "path": "src/wallet/fees.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_FEES_H\n#define BITCOIN_WALLET_FEES_H\n\n#include <amount.h>\n\nclass CBlockPolicyEstimator;\nclass CCoinControl;\nclass CFeeRate;\nclass CTxMemPool;\nstruct FeeCalculation;\n\n/**\n * Return the minimum required fee taking into account the\n * floating relay fee and user set minimum transaction fee\n */\nCAmount GetRequiredFee(unsigned int nTxBytes);\n\n/**\n * Estimate the minimum fee considering user set parameters\n * and the required fee\n */\nCAmount GetMinimumFee(unsigned int nTxBytes, const CCoinControl& coin_control, const CTxMemPool& pool, const CBlockPolicyEstimator& estimator, FeeCalculation *feeCalc);\n\n/**\n * Return the maximum feerate for discarding change.\n */\nCFeeRate GetDiscardRate(const CBlockPolicyEstimator& estimator);\n\n#endif // BITCOIN_WALLET_FEES_H\n"
  },
  {
    "path": "src/wallet/init.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/init.h>\n\n#include <net.h>\n#include <util.h>\n#include <utilmoneystr.h>\n#include <validation.h>\n#include <wallet/rpcwallet.h>\n#include <wallet/wallet.h>\n#include <wallet/walletutil.h>\n\nstd::string GetWalletHelpString(bool showDebug)\n{\n    std::string strUsage = HelpMessageGroup(_(\"Wallet options:\"));\n    strUsage += HelpMessageOpt(\"-addresstype\", strprintf(\"What type of addresses to use (\\\"legacy\\\", \\\"p2sh-segwit\\\", or \\\"bech32\\\", default: \\\"%s\\\")\", FormatOutputType(OUTPUT_TYPE_DEFAULT)));\n    strUsage += HelpMessageOpt(\"-changetype\", \"What type of change to use (\\\"legacy\\\", \\\"p2sh-segwit\\\", or \\\"bech32\\\"). Default is same as -addresstype, except when -addresstype=p2sh-segwit a native segwit output is used when sending to a native segwit address)\");\n    strUsage += HelpMessageOpt(\"-disablewallet\", _(\"Do not load the wallet and disable wallet RPC calls\"));\n    strUsage += HelpMessageOpt(\"-keypool=<n>\", strprintf(_(\"Set key pool size to <n> (default: %u)\"), DEFAULT_KEYPOOL_SIZE));\n    strUsage += HelpMessageOpt(\"-fallbackfee=<amt>\", strprintf(_(\"A fee rate (in %s/kB) that will be used when fee estimation has insufficient data (default: %s)\"),\n                                                               CURRENCY_UNIT, FormatMoney(DEFAULT_FALLBACK_FEE)));\n    strUsage += HelpMessageOpt(\"-discardfee=<amt>\", strprintf(_(\"The fee rate (in %s/kB) that indicates your tolerance for discarding change by adding it to the fee (default: %s). \"\n                                                                \"Note: An output is discarded if it is dust at this rate, but we will always discard up to the dust relay fee and a discard fee above that is limited by the fee estimate for the longest target\"),\n                                                              CURRENCY_UNIT, FormatMoney(DEFAULT_DISCARD_FEE)));\n    strUsage += HelpMessageOpt(\"-mintxfee=<amt>\", strprintf(_(\"Fees (in %s/kB) smaller than this are considered zero fee for transaction creation (default: %s)\"),\n                                                            CURRENCY_UNIT, FormatMoney(DEFAULT_TRANSACTION_MINFEE)));\n    strUsage += HelpMessageOpt(\"-paytxfee=<amt>\", strprintf(_(\"Fee (in %s/kB) to add to transactions you send (default: %s)\"),\n                                                            CURRENCY_UNIT, FormatMoney(payTxFee.GetFeePerK())));\n    strUsage += HelpMessageOpt(\"-rescan\", _(\"Rescan the block chain for missing wallet transactions on startup\"));\n    strUsage += HelpMessageOpt(\"-salvagewallet\", _(\"Attempt to recover private keys from a corrupt wallet on startup\"));\n    strUsage += HelpMessageOpt(\"-spendzeroconfchange\", strprintf(_(\"Spend unconfirmed change when sending transactions (default: %u)\"), DEFAULT_SPEND_ZEROCONF_CHANGE));\n    strUsage += HelpMessageOpt(\"-txconfirmtarget=<n>\", strprintf(_(\"If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)\"), DEFAULT_TX_CONFIRM_TARGET));\n    strUsage += HelpMessageOpt(\"-walletrbf\", strprintf(_(\"Send transactions with full-RBF opt-in enabled (RPC only, default: %u)\"), DEFAULT_WALLET_RBF));\n    strUsage += HelpMessageOpt(\"-upgradewallet\", _(\"Upgrade wallet to latest format on startup\"));\n    strUsage += HelpMessageOpt(\"-wallet=<file>\", _(\"Specify wallet file (within data directory)\") + \" \" + strprintf(_(\"(default: %s)\"), DEFAULT_WALLET_DAT));\n    strUsage += HelpMessageOpt(\"-walletbroadcast\", _(\"Make the wallet broadcast transactions\") + \" \" + strprintf(_(\"(default: %u)\"), DEFAULT_WALLETBROADCAST));\n    strUsage += HelpMessageOpt(\"-walletdir=<dir>\", _(\"Specify directory to hold wallets (default: <datadir>/wallets if it exists, otherwise <datadir>)\"));\n    strUsage += HelpMessageOpt(\"-walletnotify=<cmd>\", _(\"Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)\"));\n    strUsage += HelpMessageOpt(\"-zapwallettxes=<mode>\", _(\"Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup\") +\n                               \" \" + _(\"(1 = keep tx meta data e.g. account owner and payment request information, 2 = drop tx meta data)\"));\n\n    if (showDebug)\n    {\n        strUsage += HelpMessageGroup(_(\"Wallet debugging/testing options:\"));\n\n        strUsage += HelpMessageOpt(\"-dblogsize=<n>\", strprintf(\"Flush wallet database activity from memory to disk log every <n> megabytes (default: %u)\", DEFAULT_WALLET_DBLOGSIZE));\n        strUsage += HelpMessageOpt(\"-flushwallet\", strprintf(\"Run a thread to flush wallet periodically (default: %u)\", DEFAULT_FLUSHWALLET));\n        strUsage += HelpMessageOpt(\"-privdb\", strprintf(\"Sets the DB_PRIVATE flag in the wallet db environment (default: %u)\", DEFAULT_WALLET_PRIVDB));\n        strUsage += HelpMessageOpt(\"-walletrejectlongchains\", strprintf(_(\"Wallet will not create transactions that violate mempool chain limits (default: %u)\"), DEFAULT_WALLET_REJECT_LONG_CHAINS));\n    }\n\n    return strUsage;\n}\n\nbool WalletParameterInteraction()\n{\n    if (gArgs.GetBoolArg(\"-disablewallet\", DEFAULT_DISABLE_WALLET)) {\n        for (const std::string& wallet : gArgs.GetArgs(\"-wallet\")) {\n            LogPrintf(\"%s: parameter interaction: -disablewallet -> ignoring -wallet=%s\\n\", __func__, wallet);\n        }\n\n        return true;\n    }\n\n    gArgs.SoftSetArg(\"-wallet\", DEFAULT_WALLET_DAT);\n    const bool is_multiwallet = gArgs.GetArgs(\"-wallet\").size() > 1;\n\n    if (gArgs.GetBoolArg(\"-blocksonly\", DEFAULT_BLOCKSONLY) && gArgs.SoftSetBoolArg(\"-walletbroadcast\", false)) {\n        LogPrintf(\"%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\\n\", __func__);\n    }\n\n    if (gArgs.GetBoolArg(\"-salvagewallet\", false)) {\n        if (is_multiwallet) {\n            return InitError(strprintf(\"%s is only allowed with a single wallet file\", \"-salvagewallet\"));\n        }\n        // Rewrite just private keys: rescan to find transactions\n        if (gArgs.SoftSetBoolArg(\"-rescan\", true)) {\n            LogPrintf(\"%s: parameter interaction: -salvagewallet=1 -> setting -rescan=1\\n\", __func__);\n        }\n    }\n\n    bool zapwallettxes = gArgs.GetBoolArg(\"-zapwallettxes\", false);\n    // -zapwallettxes implies dropping the mempool on startup\n    if (zapwallettxes && gArgs.SoftSetBoolArg(\"-persistmempool\", false)) {\n        LogPrintf(\"%s: parameter interaction: -zapwallettxes enabled -> setting -persistmempool=0\\n\", __func__);\n    }\n\n    // -zapwallettxes implies a rescan\n    if (zapwallettxes) {\n        if (is_multiwallet) {\n            return InitError(strprintf(\"%s is only allowed with a single wallet file\", \"-zapwallettxes\"));\n        }\n        if (gArgs.SoftSetBoolArg(\"-rescan\", true)) {\n            LogPrintf(\"%s: parameter interaction: -zapwallettxes enabled -> setting -rescan=1\\n\", __func__);\n        }\n    }\n\n    if (is_multiwallet) {\n        if (gArgs.GetBoolArg(\"-upgradewallet\", false)) {\n            return InitError(strprintf(\"%s is only allowed with a single wallet file\", \"-upgradewallet\"));\n        }\n    }\n\n    if (gArgs.GetBoolArg(\"-sysperms\", false))\n        return InitError(\"-sysperms is not allowed in combination with enabled wallet functionality\");\n    if (gArgs.GetArg(\"-prune\", 0) && gArgs.GetBoolArg(\"-rescan\", false))\n        return InitError(_(\"Rescans are not possible in pruned mode. You will need to use -reindex which will download the whole blockchain again.\"));\n\n    if (::minRelayTxFee.GetFeePerK() > HIGH_TX_FEE_PER_KB)\n        InitWarning(AmountHighWarn(\"-minrelaytxfee\") + \" \" +\n                    _(\"The wallet will avoid paying less than the minimum relay fee.\"));\n\n    if (gArgs.IsArgSet(\"-mintxfee\"))\n    {\n        CAmount n = 0;\n        if (!ParseMoney(gArgs.GetArg(\"-mintxfee\", \"\"), n) || 0 == n)\n            return InitError(AmountErrMsg(\"mintxfee\", gArgs.GetArg(\"-mintxfee\", \"\")));\n        if (n > HIGH_TX_FEE_PER_KB)\n            InitWarning(AmountHighWarn(\"-mintxfee\") + \" \" +\n                        _(\"This is the minimum transaction fee you pay on every transaction.\"));\n        CWallet::minTxFee = CFeeRate(n);\n    }\n    if (gArgs.IsArgSet(\"-fallbackfee\"))\n    {\n        CAmount nFeePerK = 0;\n        if (!ParseMoney(gArgs.GetArg(\"-fallbackfee\", \"\"), nFeePerK))\n            return InitError(strprintf(_(\"Invalid amount for -fallbackfee=<amount>: '%s'\"), gArgs.GetArg(\"-fallbackfee\", \"\")));\n        if (nFeePerK > HIGH_TX_FEE_PER_KB)\n            InitWarning(AmountHighWarn(\"-fallbackfee\") + \" \" +\n                        _(\"This is the transaction fee you may pay when fee estimates are not available.\"));\n        CWallet::fallbackFee = CFeeRate(nFeePerK);\n    }\n    if (gArgs.IsArgSet(\"-discardfee\"))\n    {\n        CAmount nFeePerK = 0;\n        if (!ParseMoney(gArgs.GetArg(\"-discardfee\", \"\"), nFeePerK))\n            return InitError(strprintf(_(\"Invalid amount for -discardfee=<amount>: '%s'\"), gArgs.GetArg(\"-discardfee\", \"\")));\n        if (nFeePerK > HIGH_TX_FEE_PER_KB)\n            InitWarning(AmountHighWarn(\"-discardfee\") + \" \" +\n                        _(\"This is the transaction fee you may discard if change is smaller than dust at this level\"));\n        CWallet::m_discard_rate = CFeeRate(nFeePerK);\n    }\n    if (gArgs.IsArgSet(\"-paytxfee\"))\n    {\n        CAmount nFeePerK = 0;\n        if (!ParseMoney(gArgs.GetArg(\"-paytxfee\", \"\"), nFeePerK))\n            return InitError(AmountErrMsg(\"paytxfee\", gArgs.GetArg(\"-paytxfee\", \"\")));\n        if (nFeePerK > HIGH_TX_FEE_PER_KB)\n            InitWarning(AmountHighWarn(\"-paytxfee\") + \" \" +\n                        _(\"This is the transaction fee you will pay if you send a transaction.\"));\n\n        payTxFee = CFeeRate(nFeePerK, 1000);\n        if (payTxFee < ::minRelayTxFee)\n        {\n            return InitError(strprintf(_(\"Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)\"),\n                                       gArgs.GetArg(\"-paytxfee\", \"\"), ::minRelayTxFee.ToString()));\n        }\n    }\n    if (gArgs.IsArgSet(\"-maxtxfee\"))\n    {\n        CAmount nMaxFee = 0;\n        if (!ParseMoney(gArgs.GetArg(\"-maxtxfee\", \"\"), nMaxFee))\n            return InitError(AmountErrMsg(\"maxtxfee\", gArgs.GetArg(\"-maxtxfee\", \"\")));\n        if (nMaxFee > HIGH_MAX_TX_FEE)\n            InitWarning(_(\"-maxtxfee is set very high! Fees this large could be paid on a single transaction.\"));\n        maxTxFee = nMaxFee;\n        if (CFeeRate(maxTxFee, 1000) < ::minRelayTxFee)\n        {\n            return InitError(strprintf(_(\"Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)\"),\n                                       gArgs.GetArg(\"-maxtxfee\", \"\"), ::minRelayTxFee.ToString()));\n        }\n    }\n    nTxConfirmTarget = gArgs.GetArg(\"-txconfirmtarget\", DEFAULT_TX_CONFIRM_TARGET);\n    bSpendZeroConfChange = gArgs.GetBoolArg(\"-spendzeroconfchange\", DEFAULT_SPEND_ZEROCONF_CHANGE);\n    fWalletRbf = gArgs.GetBoolArg(\"-walletrbf\", DEFAULT_WALLET_RBF);\n\n    g_address_type = ParseOutputType(gArgs.GetArg(\"-addresstype\", \"\"));\n    if (g_address_type == OUTPUT_TYPE_NONE) {\n        return InitError(strprintf(\"Unknown address type '%s'\", gArgs.GetArg(\"-addresstype\", \"\")));\n    }\n\n    // If changetype is set in config file or parameter, check that it's valid.\n    // Default to OUTPUT_TYPE_NONE if not set.\n    g_change_type = ParseOutputType(gArgs.GetArg(\"-changetype\", \"\"), OUTPUT_TYPE_NONE);\n    if (g_change_type == OUTPUT_TYPE_NONE && !gArgs.GetArg(\"-changetype\", \"\").empty()) {\n        return InitError(strprintf(\"Unknown change type '%s'\", gArgs.GetArg(\"-changetype\", \"\")));\n    }\n\n    return true;\n}\n\nvoid RegisterWalletRPC(CRPCTable &t)\n{\n    if (gArgs.GetBoolArg(\"-disablewallet\", DEFAULT_DISABLE_WALLET)) {\n        return;\n    }\n\n    RegisterWalletRPCCommands(t);\n}\n\nbool VerifyWallets()\n{\n    if (gArgs.GetBoolArg(\"-disablewallet\", DEFAULT_DISABLE_WALLET)) {\n        return true;\n    }\n\n    if (gArgs.IsArgSet(\"-walletdir\")) {\n        fs::path wallet_dir = gArgs.GetArg(\"-walletdir\", \"\");\n        if (!fs::exists(wallet_dir)) {\n            return InitError(strprintf(_(\"Specified -walletdir \\\"%s\\\" does not exist\"), wallet_dir.string()));\n        } else if (!fs::is_directory(wallet_dir)) {\n            return InitError(strprintf(_(\"Specified -walletdir \\\"%s\\\" is not a directory\"), wallet_dir.string()));\n        } else if (!wallet_dir.is_absolute()) {\n            return InitError(strprintf(_(\"Specified -walletdir \\\"%s\\\" is a relative path\"), wallet_dir.string()));\n        }\n    }\n\n    LogPrintf(\"Using wallet directory %s\\n\", GetWalletDir().string());\n\n    uiInterface.InitMessage(_(\"Verifying wallet(s)...\"));\n\n    // Keep track of each wallet absolute path to detect duplicates.\n    std::set<fs::path> wallet_paths;\n\n    for (const std::string& walletFile : gArgs.GetArgs(\"-wallet\")) {\n        if (boost::filesystem::path(walletFile).filename() != walletFile) {\n            return InitError(strprintf(_(\"Error loading wallet %s. -wallet parameter must only specify a filename (not a path).\"), walletFile));\n        }\n\n        if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) {\n            return InitError(strprintf(_(\"Error loading wallet %s. Invalid characters in -wallet filename.\"), walletFile));\n        }\n\n        fs::path wallet_path = fs::absolute(walletFile, GetWalletDir());\n\n        if (fs::exists(wallet_path) && (!fs::is_regular_file(wallet_path) || fs::is_symlink(wallet_path))) {\n            return InitError(strprintf(_(\"Error loading wallet %s. -wallet filename must be a regular file.\"), walletFile));\n        }\n\n        if (!wallet_paths.insert(wallet_path).second) {\n            return InitError(strprintf(_(\"Error loading wallet %s. Duplicate -wallet filename specified.\"), walletFile));\n        }\n\n        std::string strError;\n        if (!CWalletDB::VerifyEnvironment(walletFile, GetWalletDir().string(), strError)) {\n            return InitError(strError);\n        }\n\n        if (gArgs.GetBoolArg(\"-salvagewallet\", false)) {\n            // Recover readable keypairs:\n            CWallet dummyWallet;\n            std::string backup_filename;\n            if (!CWalletDB::Recover(walletFile, (void *)&dummyWallet, CWalletDB::RecoverKeysOnlyFilter, backup_filename)) {\n                return false;\n            }\n        }\n\n        std::string strWarning;\n        bool dbV = CWalletDB::VerifyDatabaseFile(walletFile, GetWalletDir().string(), strWarning, strError);\n        if (!strWarning.empty()) {\n            InitWarning(strWarning);\n        }\n        if (!dbV) {\n            InitError(strError);\n            return false;\n        }\n    }\n\n    return true;\n}\n\nbool OpenWallets()\n{\n    if (gArgs.GetBoolArg(\"-disablewallet\", DEFAULT_DISABLE_WALLET)) {\n        LogPrintf(\"Wallet disabled!\\n\");\n        return true;\n    }\n\n    for (const std::string& walletFile : gArgs.GetArgs(\"-wallet\")) {\n        CWallet * const pwallet = CWallet::CreateWalletFromFile(walletFile);\n        if (!pwallet) {\n            return false;\n        }\n        vpwallets.push_back(pwallet);\n    }\n\n    return true;\n}\n\nvoid StartWallets(CScheduler& scheduler) {\n    for (CWalletRef pwallet : vpwallets) {\n        pwallet->postInitProcess(scheduler);\n    }\n}\n\nvoid FlushWallets() {\n    for (CWalletRef pwallet : vpwallets) {\n        pwallet->Flush(false);\n    }\n}\n\nvoid StopWallets() {\n    for (CWalletRef pwallet : vpwallets) {\n        pwallet->Flush(true);\n    }\n}\n\nvoid CloseWallets() {\n    for (CWalletRef pwallet : vpwallets) {\n        delete pwallet;\n    }\n    vpwallets.clear();\n}\n"
  },
  {
    "path": "src/wallet/init.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_INIT_H\n#define BITCOIN_WALLET_INIT_H\n\n#include <string>\n\nclass CRPCTable;\nclass CScheduler;\n\n//! Return the wallets help message.\nstd::string GetWalletHelpString(bool showDebug);\n\n//! Wallets parameter interaction\nbool WalletParameterInteraction();\n\n//! Register wallet RPCs.\nvoid RegisterWalletRPC(CRPCTable &tableRPC);\n\n//! Responsible for reading and validating the -wallet arguments and verifying the wallet database.\n//  This function will perform salvage on the wallet if requested, as long as only one wallet is\n//  being loaded (WalletParameterInteraction forbids -salvagewallet, -zapwallettxes or -upgradewallet with multiwallet).\nbool VerifyWallets();\n\n//! Load wallet databases.\nbool OpenWallets();\n\n//! Complete startup of wallets.\nvoid StartWallets(CScheduler& scheduler);\n\n//! Flush all wallets in preparation for shutdown.\nvoid FlushWallets();\n\n//! Stop all wallets. Wallets will be flushed first.\nvoid StopWallets();\n\n//! Close all wallets.\nvoid CloseWallets();\n\n#endif // BITCOIN_WALLET_INIT_H\n"
  },
  {
    "path": "src/wallet/rpcdump.cpp",
    "content": "// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <base58.h>\n#include <chain.h>\n#include <rpc/safemode.h>\n#include <rpc/server.h>\n#include <wallet/init.h>\n#include <validation.h>\n#include <script/script.h>\n#include <script/standard.h>\n#include <sync.h>\n#include <util.h>\n#include <utiltime.h>\n#include <wallet/wallet.h>\n#include <merkleblock.h>\n#include <core_io.h>\n\n#include <wallet/rpcwallet.h>\n\n#include <fstream>\n#include <stdint.h>\n\n#include <boost/algorithm/string.hpp>\n#include <boost/date_time/posix_time/posix_time.hpp>\n\n#include <univalue.h>\n\n\nstd::string static EncodeDumpTime(int64_t nTime) {\n    return DateTimeStrFormat(\"%Y-%m-%dT%H:%M:%SZ\", nTime);\n}\n\nint64_t static DecodeDumpTime(const std::string &str) {\n    static const boost::posix_time::ptime epoch = boost::posix_time::from_time_t(0);\n    static const std::locale loc(std::locale::classic(),\n        new boost::posix_time::time_input_facet(\"%Y-%m-%dT%H:%M:%SZ\"));\n    std::istringstream iss(str);\n    iss.imbue(loc);\n    boost::posix_time::ptime ptime(boost::date_time::not_a_date_time);\n    iss >> ptime;\n    if (ptime.is_not_a_date_time())\n        return 0;\n    return (ptime - epoch).total_seconds();\n}\n\nstd::string static EncodeDumpString(const std::string &str) {\n    std::stringstream ret;\n    for (unsigned char c : str) {\n        if (c <= 32 || c >= 128 || c == '%') {\n            ret << '%' << HexStr(&c, &c + 1);\n        } else {\n            ret << c;\n        }\n    }\n    return ret.str();\n}\n\nstd::string DecodeDumpString(const std::string &str) {\n    std::stringstream ret;\n    for (unsigned int pos = 0; pos < str.length(); pos++) {\n        unsigned char c = str[pos];\n        if (c == '%' && pos+2 < str.length()) {\n            c = (((str[pos+1]>>6)*9+((str[pos+1]-'0')&15)) << 4) | \n                ((str[pos+2]>>6)*9+((str[pos+2]-'0')&15));\n            pos += 2;\n        }\n        ret << c;\n    }\n    return ret.str();\n}\n\nbool GetWalletAddressesForKey(CWallet * const pwallet, const CKeyID &keyid, std::string &strAddr, std::string &strLabel)\n{\n    bool fLabelFound = false;\n    CKey key;\n    pwallet->GetKey(keyid, key);\n    for (const auto& dest : GetAllDestinationsForKey(key.GetPubKey())) {\n        if (pwallet->mapAddressBook.count(dest)) {\n            if (!strAddr.empty()) {\n                strAddr += \",\";\n            }\n            strAddr += EncodeDestination(dest);\n            strLabel = EncodeDumpString(pwallet->mapAddressBook[dest].name);\n            fLabelFound = true;\n        }\n    }\n    if (!fLabelFound) {\n        strAddr = EncodeDestination(GetDestinationForKey(key.GetPubKey(), g_address_type));\n    }\n    return fLabelFound;\n}\n\n\nUniValue importprivkey(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)\n        throw std::runtime_error(\n            \"importprivkey \\\"privkey\\\" ( \\\"label\\\" ) ( rescan )\\n\"\n            \"\\nAdds a private key (as returned by dumpprivkey) to your wallet. Requires a new wallet backup.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"privkey\\\"          (string, required) The private key (see dumpprivkey)\\n\"\n            \"2. \\\"label\\\"            (string, optional, default=\\\"\\\") An optional label\\n\"\n            \"3. rescan               (boolean, optional, default=true) Rescan the wallet for transactions\\n\"\n            \"\\nNote: This call can take minutes to complete if rescan is true, during that time, other rpc calls\\n\"\n            \"may report that the imported key exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nDump a private key\\n\"\n            + HelpExampleCli(\"dumpprivkey\", \"\\\"myaddress\\\"\") +\n            \"\\nImport the private key with rescan\\n\"\n            + HelpExampleCli(\"importprivkey\", \"\\\"mykey\\\"\") +\n            \"\\nImport using a label and without rescan\\n\"\n            + HelpExampleCli(\"importprivkey\", \"\\\"mykey\\\" \\\"testing\\\" false\") +\n            \"\\nImport using default blank label and without rescan\\n\"\n            + HelpExampleCli(\"importprivkey\", \"\\\"mykey\\\" \\\"\\\" false\") +\n            \"\\nAs a JSON-RPC call\\n\"\n            + HelpExampleRpc(\"importprivkey\", \"\\\"mykey\\\", \\\"testing\\\", false\")\n        );\n\n\n    WalletRescanReserver reserver(pwallet);\n    bool fRescan = true;\n    {\n        LOCK2(cs_main, pwallet->cs_wallet);\n\n        EnsureWalletIsUnlocked(pwallet);\n\n        std::string strSecret = request.params[0].get_str();\n        std::string strLabel = \"\";\n        if (!request.params[1].isNull())\n            strLabel = request.params[1].get_str();\n\n        // Whether to perform rescan after import\n        if (!request.params[2].isNull())\n            fRescan = request.params[2].get_bool();\n\n        if (fRescan && fPruneMode)\n            throw JSONRPCError(RPC_WALLET_ERROR, \"Rescan is disabled in pruned mode\");\n\n        if (fRescan && !reserver.reserve()) {\n            throw JSONRPCError(RPC_WALLET_ERROR, \"Wallet is currently rescanning. Abort existing rescan or wait.\");\n        }\n\n        CBitcoinSecret vchSecret;\n        bool fGood = vchSecret.SetString(strSecret);\n\n        if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid private key encoding\");\n\n        CKey key = vchSecret.GetKey();\n        if (!key.IsValid()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Private key outside allowed range\");\n\n        CPubKey pubkey = key.GetPubKey();\n        assert(key.VerifyPubKey(pubkey));\n        CKeyID vchAddress = pubkey.GetID();\n        {\n            pwallet->MarkDirty();\n            // We don't know which corresponding address will be used; label them all\n            for (const auto& dest : GetAllDestinationsForKey(pubkey)) {\n                pwallet->SetAddressBook(dest, strLabel, \"receive\");\n            }\n\n            // Don't throw error in case a key is already there\n            if (pwallet->HaveKey(vchAddress)) {\n                return NullUniValue;\n            }\n\n            // whenever a key is imported, we need to scan the whole chain\n            pwallet->UpdateTimeFirstKey(1);\n            pwallet->mapKeyMetadata[vchAddress].nCreateTime = 1;\n\n            if (!pwallet->AddKeyPubKey(key, pubkey)) {\n                throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding key to wallet\");\n            }\n            pwallet->LearnAllRelatedScripts(pubkey);\n        }\n    }\n    if (fRescan) {\n        pwallet->RescanFromTime(TIMESTAMP_MIN, reserver, true /* update */);\n    }\n\n    return NullUniValue;\n}\n\nUniValue abortrescan(const JSONRPCRequest& request)\n{\n    CWallet* const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 0)\n        throw std::runtime_error(\n            \"abortrescan\\n\"\n            \"\\nStops current wallet rescan triggered by an RPC call, e.g. by an importprivkey call.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nImport a private key\\n\"\n            + HelpExampleCli(\"importprivkey\", \"\\\"mykey\\\"\") +\n            \"\\nAbort the running wallet rescan\\n\"\n            + HelpExampleCli(\"abortrescan\", \"\") +\n            \"\\nAs a JSON-RPC call\\n\"\n            + HelpExampleRpc(\"abortrescan\", \"\")\n        );\n\n    ObserveSafeMode();\n    if (!pwallet->IsScanning() || pwallet->IsAbortingRescan()) return false;\n    pwallet->AbortRescan();\n    return true;\n}\n\nvoid ImportAddress(CWallet*, const CTxDestination& dest, const std::string& strLabel);\nvoid ImportScript(CWallet* const pwallet, const CScript& script, const std::string& strLabel, bool isRedeemScript)\n{\n    if (!isRedeemScript && ::IsMine(*pwallet, script) == ISMINE_SPENDABLE) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"The wallet already contains the private key for this address or script\");\n    }\n\n    pwallet->MarkDirty();\n\n    if (!pwallet->HaveWatchOnly(script) && !pwallet->AddWatchOnly(script, 0 /* nCreateTime */)) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding address to wallet\");\n    }\n\n    if (isRedeemScript) {\n        if (!pwallet->HaveCScript(script) && !pwallet->AddCScript(script)) {\n            throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding p2sh redeemScript to wallet\");\n        }\n        ImportAddress(pwallet, CScriptID(script), strLabel);\n    } else {\n        CTxDestination destination;\n        if (ExtractDestination(script, destination)) {\n            pwallet->SetAddressBook(destination, strLabel, \"receive\");\n        }\n    }\n}\n\nvoid ImportAddress(CWallet* const pwallet, const CTxDestination& dest, const std::string& strLabel)\n{\n    CScript script = GetScriptForDestination(dest);\n    ImportScript(pwallet, script, strLabel, false);\n    // add to address book or update label\n    if (IsValidDestination(dest))\n        pwallet->SetAddressBook(dest, strLabel, \"receive\");\n}\n\nUniValue importaddress(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 4)\n        throw std::runtime_error(\n            \"importaddress \\\"address\\\" ( \\\"label\\\" rescan p2sh )\\n\"\n            \"\\nAdds a script (in hex) or address that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"script\\\"           (string, required) The hex-encoded script (or address)\\n\"\n            \"2. \\\"label\\\"            (string, optional, default=\\\"\\\") An optional label\\n\"\n            \"3. rescan               (boolean, optional, default=true) Rescan the wallet for transactions\\n\"\n            \"4. p2sh                 (boolean, optional, default=false) Add the P2SH version of the script as well\\n\"\n            \"\\nNote: This call can take minutes to complete if rescan is true, during that time, other rpc calls\\n\"\n            \"may report that the imported address exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\\n\"\n            \"If you have the full public key, you should call importpubkey instead of this.\\n\"\n            \"\\nNote: If you import a non-standard raw script in hex form, outputs sending to it will be treated\\n\"\n            \"as change, and not show up in many RPCs.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nImport a script with rescan\\n\"\n            + HelpExampleCli(\"importaddress\", \"\\\"myscript\\\"\") +\n            \"\\nImport using a label without rescan\\n\"\n            + HelpExampleCli(\"importaddress\", \"\\\"myscript\\\" \\\"testing\\\" false\") +\n            \"\\nAs a JSON-RPC call\\n\"\n            + HelpExampleRpc(\"importaddress\", \"\\\"myscript\\\", \\\"testing\\\", false\")\n        );\n\n\n    std::string strLabel = \"\";\n    if (!request.params[1].isNull())\n        strLabel = request.params[1].get_str();\n\n    // Whether to perform rescan after import\n    bool fRescan = true;\n    if (!request.params[2].isNull())\n        fRescan = request.params[2].get_bool();\n\n    if (fRescan && fPruneMode)\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Rescan is disabled in pruned mode\");\n\n    WalletRescanReserver reserver(pwallet);\n    if (fRescan && !reserver.reserve()) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Wallet is currently rescanning. Abort existing rescan or wait.\");\n    }\n\n    // Whether to import a p2sh version, too\n    bool fP2SH = false;\n    if (!request.params[3].isNull())\n        fP2SH = request.params[3].get_bool();\n\n    {\n        LOCK2(cs_main, pwallet->cs_wallet);\n\n        CTxDestination dest = DecodeDestination(request.params[0].get_str());\n        if (IsValidDestination(dest)) {\n            if (fP2SH) {\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Cannot use the p2sh flag with an address - use a script instead\");\n            }\n            ImportAddress(pwallet, dest, strLabel);\n        } else if (IsHex(request.params[0].get_str())) {\n            std::vector<unsigned char> data(ParseHex(request.params[0].get_str()));\n            ImportScript(pwallet, CScript(data.begin(), data.end()), strLabel, fP2SH);\n        } else {\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid Sugarchain address or script\");\n        }\n    }\n    if (fRescan)\n    {\n        pwallet->RescanFromTime(TIMESTAMP_MIN, reserver, true /* update */);\n        pwallet->ReacceptWalletTransactions();\n    }\n\n    return NullUniValue;\n}\n\nUniValue importprunedfunds(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 2)\n        throw std::runtime_error(\n            \"importprunedfunds\\n\"\n            \"\\nImports funds without rescan. Corresponding address or script must previously be included in wallet. Aimed towards pruned wallets. The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"rawtransaction\\\" (string, required) A raw transaction in hex funding an already-existing address in wallet\\n\"\n            \"2. \\\"txoutproof\\\"     (string, required) The hex output from gettxoutproof that contains the transaction\\n\"\n        );\n\n    CMutableTransaction tx;\n    if (!DecodeHexTx(tx, request.params[0].get_str()))\n        throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"TX decode failed\");\n    uint256 hashTx = tx.GetHash();\n    CWalletTx wtx(pwallet, MakeTransactionRef(std::move(tx)));\n\n    CDataStream ssMB(ParseHexV(request.params[1], \"proof\"), SER_NETWORK, PROTOCOL_VERSION);\n    CMerkleBlock merkleBlock;\n    ssMB >> merkleBlock;\n\n    //Search partial merkle tree in proof for our transaction and index in valid block\n    std::vector<uint256> vMatch;\n    std::vector<unsigned int> vIndex;\n    unsigned int txnIndex = 0;\n    if (merkleBlock.txn.ExtractMatches(vMatch, vIndex) == merkleBlock.header.hashMerkleRoot) {\n\n        LOCK(cs_main);\n\n        if (!mapBlockIndex.count(merkleBlock.header.GetHash()) || !chainActive.Contains(mapBlockIndex[merkleBlock.header.GetHash()]))\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block not found in chain\");\n\n        std::vector<uint256>::const_iterator it;\n        if ((it = std::find(vMatch.begin(), vMatch.end(), hashTx))==vMatch.end()) {\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Transaction given doesn't exist in proof\");\n        }\n\n        txnIndex = vIndex[it - vMatch.begin()];\n    }\n    else {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Something wrong with merkleblock\");\n    }\n\n    wtx.nIndex = txnIndex;\n    wtx.hashBlock = merkleBlock.header.GetHash();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    if (pwallet->IsMine(*wtx.tx)) {\n        pwallet->AddToWallet(wtx, false);\n        return NullUniValue;\n    }\n\n    throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"No addresses in wallet correspond to included transaction\");\n}\n\nUniValue removeprunedfunds(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"removeprunedfunds \\\"txid\\\"\\n\"\n            \"\\nDeletes the specified transaction from the wallet. Meant for use with pruned wallets and as a companion to importprunedfunds. This will affect wallet balances.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"txid\\\"           (string, required) The hex-encoded id of the transaction you are deleting\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"removeprunedfunds\", \"\\\"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5\\\"\") +\n            \"\\nAs a JSON-RPC call\\n\"\n            + HelpExampleRpc(\"removeprunedfunds\", \"\\\"a8d0c0184dde994a09ec054286f1ce581bebf46446a512166eae7628734ea0a5\\\"\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    uint256 hash;\n    hash.SetHex(request.params[0].get_str());\n    std::vector<uint256> vHash;\n    vHash.push_back(hash);\n    std::vector<uint256> vHashOut;\n\n    if (pwallet->ZapSelectTx(vHash, vHashOut) != DB_LOAD_OK) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Could not properly delete the transaction.\");\n    }\n\n    if(vHashOut.empty()) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Transaction does not exist in wallet.\");\n    }\n\n    return NullUniValue;\n}\n\nUniValue importpubkey(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)\n        throw std::runtime_error(\n            \"importpubkey \\\"pubkey\\\" ( \\\"label\\\" rescan )\\n\"\n            \"\\nAdds a public key (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"pubkey\\\"           (string, required) The hex-encoded public key\\n\"\n            \"2. \\\"label\\\"            (string, optional, default=\\\"\\\") An optional label\\n\"\n            \"3. rescan               (boolean, optional, default=true) Rescan the wallet for transactions\\n\"\n            \"\\nNote: This call can take minutes to complete if rescan is true, during that time, other rpc calls\\n\"\n            \"may report that the imported pubkey exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nImport a public key with rescan\\n\"\n            + HelpExampleCli(\"importpubkey\", \"\\\"mypubkey\\\"\") +\n            \"\\nImport using a label without rescan\\n\"\n            + HelpExampleCli(\"importpubkey\", \"\\\"mypubkey\\\" \\\"testing\\\" false\") +\n            \"\\nAs a JSON-RPC call\\n\"\n            + HelpExampleRpc(\"importpubkey\", \"\\\"mypubkey\\\", \\\"testing\\\", false\")\n        );\n\n\n    std::string strLabel = \"\";\n    if (!request.params[1].isNull())\n        strLabel = request.params[1].get_str();\n\n    // Whether to perform rescan after import\n    bool fRescan = true;\n    if (!request.params[2].isNull())\n        fRescan = request.params[2].get_bool();\n\n    if (fRescan && fPruneMode)\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Rescan is disabled in pruned mode\");\n\n    WalletRescanReserver reserver(pwallet);\n    if (fRescan && !reserver.reserve()) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Wallet is currently rescanning. Abort existing rescan or wait.\");\n    }\n\n    if (!IsHex(request.params[0].get_str()))\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Pubkey must be a hex string\");\n    std::vector<unsigned char> data(ParseHex(request.params[0].get_str()));\n    CPubKey pubKey(data.begin(), data.end());\n    if (!pubKey.IsFullyValid())\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Pubkey is not a valid public key\");\n\n    {\n        LOCK2(cs_main, pwallet->cs_wallet);\n\n        for (const auto& dest : GetAllDestinationsForKey(pubKey)) {\n            ImportAddress(pwallet, dest, strLabel);\n        }\n        ImportScript(pwallet, GetScriptForRawPubKey(pubKey), strLabel, false);\n        pwallet->LearnAllRelatedScripts(pubKey);\n    }\n    if (fRescan)\n    {\n        pwallet->RescanFromTime(TIMESTAMP_MIN, reserver, true /* update */);\n        pwallet->ReacceptWalletTransactions();\n    }\n\n    return NullUniValue;\n}\n\n\nUniValue importwallet(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"importwallet \\\"filename\\\"\\n\"\n            \"\\nImports keys from a wallet dump file (see dumpwallet). Requires a new wallet backup to include imported keys.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"filename\\\"    (string, required) The wallet file\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nDump the wallet\\n\"\n            + HelpExampleCli(\"dumpwallet\", \"\\\"test\\\"\") +\n            \"\\nImport the wallet\\n\"\n            + HelpExampleCli(\"importwallet\", \"\\\"test\\\"\") +\n            \"\\nImport using the json rpc call\\n\"\n            + HelpExampleRpc(\"importwallet\", \"\\\"test\\\"\")\n        );\n\n    if (fPruneMode)\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Importing wallets is disabled in pruned mode\");\n\n    WalletRescanReserver reserver(pwallet);\n    if (!reserver.reserve()) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Wallet is currently rescanning. Abort existing rescan or wait.\");\n    }\n\n    int64_t nTimeBegin = 0;\n    bool fGood = true;\n    {\n        LOCK2(cs_main, pwallet->cs_wallet);\n\n        EnsureWalletIsUnlocked(pwallet);\n\n        std::ifstream file;\n        file.open(request.params[0].get_str().c_str(), std::ios::in | std::ios::ate);\n        if (!file.is_open()) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Cannot open wallet dump file\");\n        }\n        nTimeBegin = chainActive.Tip()->GetBlockTime();\n\n        int64_t nFilesize = std::max((int64_t)1, (int64_t)file.tellg());\n        file.seekg(0, file.beg);\n\n        pwallet->ShowProgress(_(\"Importing...\"), 0); // show progress dialog in GUI\n        while (file.good()) {\n            pwallet->ShowProgress(\"\", std::max(1, std::min(99, (int)(((double)file.tellg() / (double)nFilesize) * 100))));\n            std::string line;\n            std::getline(file, line);\n            if (line.empty() || line[0] == '#')\n                continue;\n\n            std::vector<std::string> vstr;\n            boost::split(vstr, line, boost::is_any_of(\" \"));\n            if (vstr.size() < 2)\n                continue;\n            CBitcoinSecret vchSecret;\n            if (vchSecret.SetString(vstr[0])) {\n                CKey key = vchSecret.GetKey();\n                CPubKey pubkey = key.GetPubKey();\n                assert(key.VerifyPubKey(pubkey));\n                CKeyID keyid = pubkey.GetID();\n                if (pwallet->HaveKey(keyid)) {\n                    LogPrintf(\"Skipping import of %s (key already present)\\n\", EncodeDestination(keyid));\n                    continue;\n                }\n                int64_t nTime = DecodeDumpTime(vstr[1]);\n                std::string strLabel;\n                bool fLabel = true;\n                for (unsigned int nStr = 2; nStr < vstr.size(); nStr++) {\n                    if (boost::algorithm::starts_with(vstr[nStr], \"#\"))\n                        break;\n                    if (vstr[nStr] == \"change=1\")\n                        fLabel = false;\n                    if (vstr[nStr] == \"reserve=1\")\n                        fLabel = false;\n                    if (boost::algorithm::starts_with(vstr[nStr], \"label=\")) {\n                        strLabel = DecodeDumpString(vstr[nStr].substr(6));\n                        fLabel = true;\n                    }\n                }\n                LogPrintf(\"Importing %s...\\n\", EncodeDestination(keyid));\n                if (!pwallet->AddKeyPubKey(key, pubkey)) {\n                    fGood = false;\n                    continue;\n                }\n                pwallet->mapKeyMetadata[keyid].nCreateTime = nTime;\n                if (fLabel)\n                    pwallet->SetAddressBook(keyid, strLabel, \"receive\");\n                nTimeBegin = std::min(nTimeBegin, nTime);\n            } else if(IsHex(vstr[0])) {\n               std::vector<unsigned char> vData(ParseHex(vstr[0]));\n               CScript script = CScript(vData.begin(), vData.end());\n               if (pwallet->HaveCScript(script)) {\n                   LogPrintf(\"Skipping import of %s (script already present)\\n\", vstr[0]);\n                   continue;\n               }\n               if(!pwallet->AddCScript(script)) {\n                   LogPrintf(\"Error importing script %s\\n\", vstr[0]);\n                   fGood = false;\n                   continue;\n               }\n               int64_t birth_time = DecodeDumpTime(vstr[1]);\n               if (birth_time > 0) {\n                   pwallet->m_script_metadata[CScriptID(script)].nCreateTime = birth_time;\n                   nTimeBegin = std::min(nTimeBegin, birth_time);\n               }\n            }\n        }\n        file.close();\n        pwallet->ShowProgress(\"\", 100); // hide progress dialog in GUI\n        pwallet->UpdateTimeFirstKey(nTimeBegin);\n    }\n    pwallet->RescanFromTime(nTimeBegin, reserver, false /* update */);\n    pwallet->MarkDirty();\n\n    if (!fGood)\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding some keys/scripts to wallet\");\n\n    return NullUniValue;\n}\n\nUniValue dumpprivkey(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"dumpprivkey \\\"address\\\"\\n\"\n            \"\\nReveals the private key corresponding to 'address'.\\n\"\n            \"Then the importprivkey can be used with this output\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"address\\\"   (string, required) The sugarchain address for the private key\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"key\\\"                (string) The private key\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"dumpprivkey\", \"\\\"myaddress\\\"\")\n            + HelpExampleCli(\"importprivkey\", \"\\\"mykey\\\"\")\n            + HelpExampleRpc(\"dumpprivkey\", \"\\\"myaddress\\\"\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    EnsureWalletIsUnlocked(pwallet);\n\n    std::string strAddress = request.params[0].get_str();\n    CTxDestination dest = DecodeDestination(strAddress);\n    if (!IsValidDestination(dest)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid Sugarchain address\");\n    }\n    auto keyid = GetKeyForDestination(*pwallet, dest);\n    if (keyid.IsNull()) {\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Address does not refer to a key\");\n    }\n    CKey vchSecret;\n    if (!pwallet->GetKey(keyid, vchSecret)) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Private key for address \" + strAddress + \" is not known\");\n    }\n    return CBitcoinSecret(vchSecret).ToString();\n}\n\n\nUniValue dumpwallet(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"dumpwallet \\\"filename\\\"\\n\"\n            \"\\nDumps all wallet keys in a human-readable format to a server-side file. This does not allow overwriting existing files.\\n\"\n            \"Imported scripts are included in the dumpfile, but corresponding BIP173 addresses, etc. may not be added automatically by importwallet.\\n\"\n            \"Note that if your wallet contains keys which are not derived from your HD seed (e.g. imported keys), these are not covered by\\n\"\n            \"only backing up the seed itself, and must be backed up too (e.g. ensure you back up the whole dumpfile).\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"filename\\\"    (string, required) The filename with path (either absolute or relative to sugarchaind)\\n\"\n            \"\\nResult:\\n\"\n            \"{                           (json object)\\n\"\n            \"  \\\"filename\\\" : {        (string) The filename with full absolute path\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"dumpwallet\", \"\\\"test\\\"\")\n            + HelpExampleRpc(\"dumpwallet\", \"\\\"test\\\"\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    EnsureWalletIsUnlocked(pwallet);\n\n    boost::filesystem::path filepath = request.params[0].get_str();\n    filepath = boost::filesystem::absolute(filepath);\n\n    /* Prevent arbitrary files from being overwritten. There have been reports\n     * that users have overwritten wallet files this way:\n     * https://github.com/bitcoin/bitcoin/issues/9934\n     * It may also avoid other security issues.\n     */\n    if (boost::filesystem::exists(filepath)) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, filepath.string() + \" already exists. If you are sure this is what you want, move it out of the way first\");\n    }\n\n    std::ofstream file;\n    file.open(filepath.string().c_str());\n    if (!file.is_open())\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Cannot open wallet dump file\");\n\n    std::map<CTxDestination, int64_t> mapKeyBirth;\n    const std::map<CKeyID, int64_t>& mapKeyPool = pwallet->GetAllReserveKeys();\n    pwallet->GetKeyBirthTimes(mapKeyBirth);\n\n    std::set<CScriptID> scripts = pwallet->GetCScripts();\n    // TODO: include scripts in GetKeyBirthTimes() output instead of separate\n\n    // sort time/key pairs\n    std::vector<std::pair<int64_t, CKeyID> > vKeyBirth;\n    for (const auto& entry : mapKeyBirth) {\n        if (const CKeyID* keyID = boost::get<CKeyID>(&entry.first)) { // set and test\n            vKeyBirth.push_back(std::make_pair(entry.second, *keyID));\n        }\n    }\n    mapKeyBirth.clear();\n    std::sort(vKeyBirth.begin(), vKeyBirth.end());\n\n    // produce output\n    file << strprintf(\"# Wallet dump created by Sugarchain %s\\n\", CLIENT_BUILD);\n    file << strprintf(\"# * Created on %s\\n\", EncodeDumpTime(GetTime()));\n    file << strprintf(\"# * Best block at time of backup was %i (%s),\\n\", chainActive.Height(), chainActive.Tip()->GetBlockHash().ToString());\n    file << strprintf(\"#   mined on %s\\n\", EncodeDumpTime(chainActive.Tip()->GetBlockTime()));\n    file << \"\\n\";\n\n    // add the base58check encoded extended master if the wallet uses HD\n    CKeyID masterKeyID = pwallet->GetHDChain().masterKeyID;\n    if (!masterKeyID.IsNull())\n    {\n        CKey key;\n        if (pwallet->GetKey(masterKeyID, key)) {\n            CExtKey masterKey;\n            masterKey.SetMaster(key.begin(), key.size());\n\n            CBitcoinExtKey b58extkey;\n            b58extkey.SetKey(masterKey);\n\n            file << \"# extended private masterkey: \" << b58extkey.ToString() << \"\\n\\n\";\n        }\n    }\n    for (std::vector<std::pair<int64_t, CKeyID> >::const_iterator it = vKeyBirth.begin(); it != vKeyBirth.end(); it++) {\n        const CKeyID &keyid = it->second;\n        std::string strTime = EncodeDumpTime(it->first);\n        std::string strAddr;\n        std::string strLabel;\n        CKey key;\n        if (pwallet->GetKey(keyid, key)) {\n            file << strprintf(\"%s %s \", CBitcoinSecret(key).ToString(), strTime);\n            if (GetWalletAddressesForKey(pwallet, keyid, strAddr, strLabel)) {\n               file << strprintf(\"label=%s\", strLabel);\n            } else if (keyid == masterKeyID) {\n                file << \"hdmaster=1\";\n            } else if (mapKeyPool.count(keyid)) {\n                file << \"reserve=1\";\n            } else if (pwallet->mapKeyMetadata[keyid].hdKeypath == \"m\") {\n                file << \"inactivehdmaster=1\";\n            } else {\n                file << \"change=1\";\n            }\n            file << strprintf(\" # addr=%s%s\\n\", strAddr, (pwallet->mapKeyMetadata[keyid].hdKeypath.size() > 0 ? \" hdkeypath=\"+pwallet->mapKeyMetadata[keyid].hdKeypath : \"\"));\n        }\n    }\n    file << \"\\n\";\n    for (const CScriptID &scriptid : scripts) {\n        CScript script;\n        std::string create_time = \"0\";\n        std::string address = EncodeDestination(scriptid);\n        // get birth times for scripts with metadata\n        auto it = pwallet->m_script_metadata.find(scriptid);\n        if (it != pwallet->m_script_metadata.end()) {\n            create_time = EncodeDumpTime(it->second.nCreateTime);\n        }\n        if(pwallet->GetCScript(scriptid, script)) {\n            file << strprintf(\"%s %s script=1\", HexStr(script.begin(), script.end()), create_time);\n            file << strprintf(\" # addr=%s\\n\", address);\n        }\n    }\n    file << \"\\n\";\n    file << \"# End of dump\\n\";\n    file.close();\n\n    UniValue reply(UniValue::VOBJ);\n    reply.push_back(Pair(\"filename\", filepath.string()));\n\n    return reply;\n}\n\n\nUniValue ProcessImport(CWallet * const pwallet, const UniValue& data, const int64_t timestamp)\n{\n    try {\n        bool success = false;\n\n        // Required fields.\n        const UniValue& scriptPubKey = data[\"scriptPubKey\"];\n\n        // Should have script or JSON with \"address\".\n        if (!(scriptPubKey.getType() == UniValue::VOBJ && scriptPubKey.exists(\"address\")) && !(scriptPubKey.getType() == UniValue::VSTR)) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid scriptPubKey\");\n        }\n\n        // Optional fields.\n        const std::string& strRedeemScript = data.exists(\"redeemscript\") ? data[\"redeemscript\"].get_str() : \"\";\n        const UniValue& pubKeys = data.exists(\"pubkeys\") ? data[\"pubkeys\"].get_array() : UniValue();\n        const UniValue& keys = data.exists(\"keys\") ? data[\"keys\"].get_array() : UniValue();\n        const bool internal = data.exists(\"internal\") ? data[\"internal\"].get_bool() : false;\n        const bool watchOnly = data.exists(\"watchonly\") ? data[\"watchonly\"].get_bool() : false;\n        const std::string& label = data.exists(\"label\") && !internal ? data[\"label\"].get_str() : \"\";\n\n        bool isScript = scriptPubKey.getType() == UniValue::VSTR;\n        bool isP2SH = strRedeemScript.length() > 0;\n        const std::string& output = isScript ? scriptPubKey.get_str() : scriptPubKey[\"address\"].get_str();\n\n        // Parse the output.\n        CScript script;\n        CTxDestination dest;\n\n        if (!isScript) {\n            dest = DecodeDestination(output);\n            if (!IsValidDestination(dest)) {\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid address\");\n            }\n            script = GetScriptForDestination(dest);\n        } else {\n            if (!IsHex(output)) {\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid scriptPubKey\");\n            }\n\n            std::vector<unsigned char> vData(ParseHex(output));\n            script = CScript(vData.begin(), vData.end());\n        }\n\n        // Watchonly and private keys\n        if (watchOnly && keys.size()) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Incompatibility found between watchonly and keys\");\n        }\n\n        // Internal + Label\n        if (internal && data.exists(\"label\")) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Incompatibility found between internal and label\");\n        }\n\n        // Not having Internal + Script\n        if (!internal && isScript) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Internal must be set for hex scriptPubKey\");\n        }\n\n        // Keys / PubKeys size check.\n        if (!isP2SH && (keys.size() > 1 || pubKeys.size() > 1)) { // Address / scriptPubKey\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"More than private key given for one address\");\n        }\n\n        // Invalid P2SH redeemScript\n        if (isP2SH && !IsHex(strRedeemScript)) {\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid redeem script\");\n        }\n\n        // Process. //\n\n        // P2SH\n        if (isP2SH) {\n            // Import redeem script.\n            std::vector<unsigned char> vData(ParseHex(strRedeemScript));\n            CScript redeemScript = CScript(vData.begin(), vData.end());\n\n            // Invalid P2SH address\n            if (!script.IsPayToScriptHash()) {\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid P2SH address / script\");\n            }\n\n            pwallet->MarkDirty();\n\n            if (!pwallet->AddWatchOnly(redeemScript, timestamp)) {\n                throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding address to wallet\");\n            }\n\n            if (!pwallet->HaveCScript(redeemScript) && !pwallet->AddCScript(redeemScript)) {\n                throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding p2sh redeemScript to wallet\");\n            }\n\n            CTxDestination redeem_dest = CScriptID(redeemScript);\n            CScript redeemDestination = GetScriptForDestination(redeem_dest);\n\n            if (::IsMine(*pwallet, redeemDestination) == ISMINE_SPENDABLE) {\n                throw JSONRPCError(RPC_WALLET_ERROR, \"The wallet already contains the private key for this address or script\");\n            }\n\n            pwallet->MarkDirty();\n\n            if (!pwallet->AddWatchOnly(redeemDestination, timestamp)) {\n                throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding address to wallet\");\n            }\n\n            // add to address book or update label\n            if (IsValidDestination(dest)) {\n                pwallet->SetAddressBook(dest, label, \"receive\");\n            }\n\n            // Import private keys.\n            if (keys.size()) {\n                for (size_t i = 0; i < keys.size(); i++) {\n                    const std::string& privkey = keys[i].get_str();\n\n                    CBitcoinSecret vchSecret;\n                    bool fGood = vchSecret.SetString(privkey);\n\n                    if (!fGood) {\n                        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid private key encoding\");\n                    }\n\n                    CKey key = vchSecret.GetKey();\n\n                    if (!key.IsValid()) {\n                        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Private key outside allowed range\");\n                    }\n\n                    CPubKey pubkey = key.GetPubKey();\n                    assert(key.VerifyPubKey(pubkey));\n\n                    CKeyID vchAddress = pubkey.GetID();\n                    pwallet->MarkDirty();\n                    pwallet->SetAddressBook(vchAddress, label, \"receive\");\n\n                    if (pwallet->HaveKey(vchAddress)) {\n                        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Already have this key\");\n                    }\n\n                    pwallet->mapKeyMetadata[vchAddress].nCreateTime = timestamp;\n\n                    if (!pwallet->AddKeyPubKey(key, pubkey)) {\n                        throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding key to wallet\");\n                    }\n\n                    pwallet->UpdateTimeFirstKey(timestamp);\n                }\n            }\n\n            success = true;\n        } else {\n            // Import public keys.\n            if (pubKeys.size() && keys.size() == 0) {\n                const std::string& strPubKey = pubKeys[0].get_str();\n\n                if (!IsHex(strPubKey)) {\n                    throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Pubkey must be a hex string\");\n                }\n\n                std::vector<unsigned char> vData(ParseHex(strPubKey));\n                CPubKey pubKey(vData.begin(), vData.end());\n\n                if (!pubKey.IsFullyValid()) {\n                    throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Pubkey is not a valid public key\");\n                }\n\n                CTxDestination pubkey_dest = pubKey.GetID();\n\n                // Consistency check.\n                if (!isScript && !(pubkey_dest == dest)) {\n                    throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Consistency check failed\");\n                }\n\n                // Consistency check.\n                if (isScript) {\n                    CTxDestination destination;\n\n                    if (ExtractDestination(script, destination)) {\n                        if (!(destination == pubkey_dest)) {\n                            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Consistency check failed\");\n                        }\n                    }\n                }\n\n                CScript pubKeyScript = GetScriptForDestination(pubkey_dest);\n\n                if (::IsMine(*pwallet, pubKeyScript) == ISMINE_SPENDABLE) {\n                    throw JSONRPCError(RPC_WALLET_ERROR, \"The wallet already contains the private key for this address or script\");\n                }\n\n                pwallet->MarkDirty();\n\n                if (!pwallet->AddWatchOnly(pubKeyScript, timestamp)) {\n                    throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding address to wallet\");\n                }\n\n                // add to address book or update label\n                if (IsValidDestination(pubkey_dest)) {\n                    pwallet->SetAddressBook(pubkey_dest, label, \"receive\");\n                }\n\n                // TODO Is this necessary?\n                CScript scriptRawPubKey = GetScriptForRawPubKey(pubKey);\n\n                if (::IsMine(*pwallet, scriptRawPubKey) == ISMINE_SPENDABLE) {\n                    throw JSONRPCError(RPC_WALLET_ERROR, \"The wallet already contains the private key for this address or script\");\n                }\n\n                pwallet->MarkDirty();\n\n                if (!pwallet->AddWatchOnly(scriptRawPubKey, timestamp)) {\n                    throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding address to wallet\");\n                }\n\n                success = true;\n            }\n\n            // Import private keys.\n            if (keys.size()) {\n                const std::string& strPrivkey = keys[0].get_str();\n\n                // Checks.\n                CBitcoinSecret vchSecret;\n                bool fGood = vchSecret.SetString(strPrivkey);\n\n                if (!fGood) {\n                    throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid private key encoding\");\n                }\n\n                CKey key = vchSecret.GetKey();\n                if (!key.IsValid()) {\n                    throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Private key outside allowed range\");\n                }\n\n                CPubKey pubKey = key.GetPubKey();\n                assert(key.VerifyPubKey(pubKey));\n\n                CTxDestination pubkey_dest = pubKey.GetID();\n\n                // Consistency check.\n                if (!isScript && !(pubkey_dest == dest)) {\n                    throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Consistency check failed\");\n                }\n\n                // Consistency check.\n                if (isScript) {\n                    CTxDestination destination;\n\n                    if (ExtractDestination(script, destination)) {\n                        if (!(destination == pubkey_dest)) {\n                            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Consistency check failed\");\n                        }\n                    }\n                }\n\n                CKeyID vchAddress = pubKey.GetID();\n                pwallet->MarkDirty();\n                pwallet->SetAddressBook(vchAddress, label, \"receive\");\n\n                if (pwallet->HaveKey(vchAddress)) {\n                    throw JSONRPCError(RPC_WALLET_ERROR, \"The wallet already contains the private key for this address or script\");\n                }\n\n                pwallet->mapKeyMetadata[vchAddress].nCreateTime = timestamp;\n\n                if (!pwallet->AddKeyPubKey(key, pubKey)) {\n                    throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding key to wallet\");\n                }\n\n                pwallet->UpdateTimeFirstKey(timestamp);\n\n                success = true;\n            }\n\n            // Import scriptPubKey only.\n            if (pubKeys.size() == 0 && keys.size() == 0) {\n                if (::IsMine(*pwallet, script) == ISMINE_SPENDABLE) {\n                    throw JSONRPCError(RPC_WALLET_ERROR, \"The wallet already contains the private key for this address or script\");\n                }\n\n                pwallet->MarkDirty();\n\n                if (!pwallet->AddWatchOnly(script, timestamp)) {\n                    throw JSONRPCError(RPC_WALLET_ERROR, \"Error adding address to wallet\");\n                }\n\n                if (scriptPubKey.getType() == UniValue::VOBJ) {\n                    // add to address book or update label\n                    if (IsValidDestination(dest)) {\n                        pwallet->SetAddressBook(dest, label, \"receive\");\n                    }\n                }\n\n                success = true;\n            }\n        }\n\n        UniValue result = UniValue(UniValue::VOBJ);\n        result.pushKV(\"success\", UniValue(success));\n        return result;\n    } catch (const UniValue& e) {\n        UniValue result = UniValue(UniValue::VOBJ);\n        result.pushKV(\"success\", UniValue(false));\n        result.pushKV(\"error\", e);\n        return result;\n    } catch (...) {\n        UniValue result = UniValue(UniValue::VOBJ);\n        result.pushKV(\"success\", UniValue(false));\n        result.pushKV(\"error\", JSONRPCError(RPC_MISC_ERROR, \"Missing required fields\"));\n        return result;\n    }\n}\n\nint64_t GetImportTimestamp(const UniValue& data, int64_t now)\n{\n    if (data.exists(\"timestamp\")) {\n        const UniValue& timestamp = data[\"timestamp\"];\n        if (timestamp.isNum()) {\n            return timestamp.get_int64();\n        } else if (timestamp.isStr() && timestamp.get_str() == \"now\") {\n            return now;\n        }\n        throw JSONRPCError(RPC_TYPE_ERROR, strprintf(\"Expected number or \\\"now\\\" timestamp value for key. got type %s\", uvTypeName(timestamp.type())));\n    }\n    throw JSONRPCError(RPC_TYPE_ERROR, \"Missing required timestamp field for key\");\n}\n\nUniValue importmulti(const JSONRPCRequest& mainRequest)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(mainRequest);\n    if (!EnsureWalletIsAvailable(pwallet, mainRequest.fHelp)) {\n        return NullUniValue;\n    }\n\n    // clang-format off\n    if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2)\n        throw std::runtime_error(\n            \"importmulti \\\"requests\\\" ( \\\"options\\\" )\\n\\n\"\n            \"Import addresses/scripts (with private or public keys, redeem script (P2SH)), rescanning all addresses in one-shot-only (rescan can be disabled via options). Requires a new wallet backup.\\n\\n\"\n            \"Arguments:\\n\"\n            \"1. requests     (array, required) Data to be imported\\n\"\n            \"  [     (array of json objects)\\n\"\n            \"    {\\n\"\n            \"      \\\"scriptPubKey\\\": \\\"<script>\\\" | { \\\"address\\\":\\\"<address>\\\" }, (string / json, required) Type of scriptPubKey (string for script, json for address)\\n\"\n            \"      \\\"timestamp\\\": timestamp | \\\"now\\\"                        , (integer / string, required) Creation time of the key in seconds since epoch (Jan 1 1970 GMT),\\n\"\n            \"                                                              or the string \\\"now\\\" to substitute the current synced blockchain time. The timestamp of the oldest\\n\"\n            \"                                                              key will determine how far back blockchain rescans need to begin for missing wallet transactions.\\n\"\n            \"                                                              \\\"now\\\" can be specified to bypass scanning, for keys which are known to never have been used, and\\n\"\n            \"                                                              0 can be specified to scan the entire blockchain. Blocks up to 2 hours before the earliest key\\n\"\n            \"                                                              creation time of all keys being imported by the importmulti call will be scanned.\\n\"\n            \"      \\\"redeemscript\\\": \\\"<script>\\\"                            , (string, optional) Allowed only if the scriptPubKey is a P2SH address or a P2SH scriptPubKey\\n\"\n            \"      \\\"pubkeys\\\": [\\\"<pubKey>\\\", ... ]                         , (array, optional) Array of strings giving pubkeys that must occur in the output or redeemscript\\n\"\n            \"      \\\"keys\\\": [\\\"<key>\\\", ... ]                               , (array, optional) Array of strings giving private keys whose corresponding public keys must occur in the output or redeemscript\\n\"\n            \"      \\\"internal\\\": <true>                                    , (boolean, optional, default: false) Stating whether matching outputs should be treated as not incoming payments\\n\"\n            \"      \\\"watchonly\\\": <true>                                   , (boolean, optional, default: false) Stating whether matching outputs should be considered watched even when they're not spendable, only allowed if keys are empty\\n\"\n            \"      \\\"label\\\": <label>                                      , (string, optional, default: '') Label to assign to the address (aka account name, for now), only allowed with internal=false\\n\"\n            \"    }\\n\"\n            \"  ,...\\n\"\n            \"  ]\\n\"\n            \"2. options                 (json, optional)\\n\"\n            \"  {\\n\"\n            \"     \\\"rescan\\\": <false>,         (boolean, optional, default: true) Stating if should rescan the blockchain after all imports\\n\"\n            \"  }\\n\"\n            \"\\nNote: This call can take minutes to complete if rescan is true, during that time, other rpc calls\\n\"\n            \"may report that the imported keys, addresses or scripts exists but related transactions are still missing.\\n\"\n            \"\\nExamples:\\n\" +\n            HelpExampleCli(\"importmulti\", \"'[{ \\\"scriptPubKey\\\": { \\\"address\\\": \\\"<my address>\\\" }, \\\"timestamp\\\":1455191478 }, \"\n                                          \"{ \\\"scriptPubKey\\\": { \\\"address\\\": \\\"<my 2nd address>\\\" }, \\\"label\\\": \\\"example 2\\\", \\\"timestamp\\\": 1455191480 }]'\") +\n            HelpExampleCli(\"importmulti\", \"'[{ \\\"scriptPubKey\\\": { \\\"address\\\": \\\"<my address>\\\" }, \\\"timestamp\\\":1455191478 }]' '{ \\\"rescan\\\": false}'\") +\n\n            \"\\nResponse is an array with the same size as the input that has the execution result :\\n\"\n            \"  [{ \\\"success\\\": true } , { \\\"success\\\": false, \\\"error\\\": { \\\"code\\\": -1, \\\"message\\\": \\\"Internal Server Error\\\"} }, ... ]\\n\");\n\n    // clang-format on\n\n    RPCTypeCheck(mainRequest.params, {UniValue::VARR, UniValue::VOBJ});\n\n    const UniValue& requests = mainRequest.params[0];\n\n    //Default options\n    bool fRescan = true;\n\n    if (!mainRequest.params[1].isNull()) {\n        const UniValue& options = mainRequest.params[1];\n\n        if (options.exists(\"rescan\")) {\n            fRescan = options[\"rescan\"].get_bool();\n        }\n    }\n\n    WalletRescanReserver reserver(pwallet);\n    if (fRescan && !reserver.reserve()) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Wallet is currently rescanning. Abort existing rescan or wait.\");\n    }\n\n    int64_t now = 0;\n    bool fRunScan = false;\n    int64_t nLowestTimestamp = 0;\n    UniValue response(UniValue::VARR);\n    {\n        LOCK2(cs_main, pwallet->cs_wallet);\n        EnsureWalletIsUnlocked(pwallet);\n\n        // Verify all timestamps are present before importing any keys.\n        now = chainActive.Tip() ? chainActive.Tip()->GetMedianTimePast() : 0;\n        for (const UniValue& data : requests.getValues()) {\n            GetImportTimestamp(data, now);\n        }\n\n        const int64_t minimumTimestamp = 1;\n\n        if (fRescan && chainActive.Tip()) {\n            nLowestTimestamp = chainActive.Tip()->GetBlockTime();\n        } else {\n            fRescan = false;\n        }\n\n        for (const UniValue& data : requests.getValues()) {\n            const int64_t timestamp = std::max(GetImportTimestamp(data, now), minimumTimestamp);\n            const UniValue result = ProcessImport(pwallet, data, timestamp);\n            response.push_back(result);\n\n            if (!fRescan) {\n                continue;\n            }\n\n            // If at least one request was successful then allow rescan.\n            if (result[\"success\"].get_bool()) {\n                fRunScan = true;\n            }\n\n            // Get the lowest timestamp.\n            if (timestamp < nLowestTimestamp) {\n                nLowestTimestamp = timestamp;\n            }\n        }\n    }\n    if (fRescan && fRunScan && requests.size()) {\n        int64_t scannedTime = pwallet->RescanFromTime(nLowestTimestamp, reserver, true /* update */);\n        pwallet->ReacceptWalletTransactions();\n\n        if (scannedTime > nLowestTimestamp) {\n            std::vector<UniValue> results = response.getValues();\n            response.clear();\n            response.setArray();\n            size_t i = 0;\n            for (const UniValue& request : requests.getValues()) {\n                // If key creation date is within the successfully scanned\n                // range, or if the import result already has an error set, let\n                // the result stand unmodified. Otherwise replace the result\n                // with an error message.\n                if (scannedTime <= GetImportTimestamp(request, now) || results.at(i).exists(\"error\")) {\n                    response.push_back(results.at(i));\n                } else {\n                    UniValue result = UniValue(UniValue::VOBJ);\n                    result.pushKV(\"success\", UniValue(false));\n                    result.pushKV(\n                        \"error\",\n                        JSONRPCError(\n                            RPC_MISC_ERROR,\n                            strprintf(\"Rescan failed for key with creation timestamp %d. There was an error reading a \"\n                                      \"block from time %d, which is after or within %d seconds of key creation, and \"\n                                      \"could contain transactions pertaining to the key. As a result, transactions \"\n                                      \"and coins using this key may not appear in the wallet. This error could be \"\n                                      \"caused by pruning or data corruption (see sugarchaind log for details) and could \"\n                                      \"be dealt with by downloading and rescanning the relevant blocks (see -reindex \"\n                                      \"and -rescan options).\",\n                                GetImportTimestamp(request, now), scannedTime - TIMESTAMP_WINDOW - 1, TIMESTAMP_WINDOW)));\n                    response.push_back(std::move(result));\n                }\n                ++i;\n            }\n        }\n    }\n\n    return response;\n}\n"
  },
  {
    "path": "src/wallet/rpcwallet.cpp",
    "content": "// Copyright (c) 2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <amount.h>\n#include <base58.h>\n#include <chain.h>\n#include <consensus/validation.h>\n#include <core_io.h>\n#include <httpserver.h>\n#include <validation.h>\n#include <net.h>\n#include <policy/feerate.h>\n#include <policy/fees.h>\n#include <policy/policy.h>\n#include <policy/rbf.h>\n#include <rpc/mining.h>\n#include <rpc/safemode.h>\n#include <rpc/server.h>\n#include <rpc/util.h>\n#include <script/sign.h>\n#include <timedata.h>\n#include <util.h>\n#include <utilmoneystr.h>\n#include <wallet/coincontrol.h>\n#include <wallet/feebumper.h>\n#include <wallet/wallet.h>\n#include <wallet/walletdb.h>\n#include <wallet/walletutil.h>\n\n#include <init.h>  // For StartShutdown\n\n#include <stdint.h>\n\n#include <univalue.h>\n\nstatic const std::string WALLET_ENDPOINT_BASE = \"/wallet/\";\n\nCWallet *GetWalletForJSONRPCRequest(const JSONRPCRequest& request)\n{\n    if (request.URI.substr(0, WALLET_ENDPOINT_BASE.size()) == WALLET_ENDPOINT_BASE) {\n        // wallet endpoint was used\n        std::string requestedWallet = urlDecode(request.URI.substr(WALLET_ENDPOINT_BASE.size()));\n        for (CWalletRef pwallet : ::vpwallets) {\n            if (pwallet->GetName() == requestedWallet) {\n                return pwallet;\n            }\n        }\n        throw JSONRPCError(RPC_WALLET_NOT_FOUND, \"Requested wallet does not exist or is not loaded\");\n    }\n    return ::vpwallets.size() == 1 || (request.fHelp && ::vpwallets.size() > 0) ? ::vpwallets[0] : nullptr;\n}\n\nstd::string HelpRequiringPassphrase(CWallet * const pwallet)\n{\n    return pwallet && pwallet->IsCrypted()\n        ? \"\\nRequires wallet passphrase to be set with walletpassphrase call.\"\n        : \"\";\n}\n\nbool EnsureWalletIsAvailable(CWallet * const pwallet, bool avoidException)\n{\n    if (pwallet) return true;\n    if (avoidException) return false;\n    if (::vpwallets.empty()) {\n        // Note: It isn't currently possible to trigger this error because\n        // wallet RPC methods aren't registered unless a wallet is loaded. But\n        // this error is being kept as a precaution, because it's possible in\n        // the future that wallet RPC methods might get or remain registered\n        // when no wallets are loaded.\n        throw JSONRPCError(\n            RPC_METHOD_NOT_FOUND, \"Method not found (wallet method is disabled because no wallet is loaded)\");\n    }\n    throw JSONRPCError(RPC_WALLET_NOT_SPECIFIED,\n        \"Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path).\");\n}\n\nvoid EnsureWalletIsUnlocked(CWallet * const pwallet)\n{\n    if (pwallet->IsLocked()) {\n        throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, \"Error: Please enter the wallet passphrase with walletpassphrase first.\");\n    }\n}\n\nvoid WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)\n{\n    int confirms = wtx.GetDepthInMainChain();\n    entry.push_back(Pair(\"confirmations\", confirms));\n    if (wtx.IsCoinBase())\n        entry.push_back(Pair(\"generated\", true));\n    if (confirms > 0)\n    {\n        entry.push_back(Pair(\"blockhash\", wtx.hashBlock.GetHex()));\n        entry.push_back(Pair(\"blockindex\", wtx.nIndex));\n        entry.push_back(Pair(\"blocktime\", mapBlockIndex[wtx.hashBlock]->GetBlockTime()));\n    } else {\n        entry.push_back(Pair(\"trusted\", wtx.IsTrusted()));\n    }\n    uint256 hash = wtx.GetHash();\n    entry.push_back(Pair(\"txid\", hash.GetHex()));\n    UniValue conflicts(UniValue::VARR);\n    for (const uint256& conflict : wtx.GetConflicts())\n        conflicts.push_back(conflict.GetHex());\n    entry.push_back(Pair(\"walletconflicts\", conflicts));\n    entry.push_back(Pair(\"time\", wtx.GetTxTime()));\n    entry.push_back(Pair(\"timereceived\", (int64_t)wtx.nTimeReceived));\n\n    // Add opt-in RBF status\n    std::string rbfStatus = \"no\";\n    if (confirms <= 0) {\n        LOCK(mempool.cs);\n        RBFTransactionState rbfState = IsRBFOptIn(*wtx.tx, mempool);\n        if (rbfState == RBF_TRANSACTIONSTATE_UNKNOWN)\n            rbfStatus = \"unknown\";\n        else if (rbfState == RBF_TRANSACTIONSTATE_REPLACEABLE_BIP125)\n            rbfStatus = \"yes\";\n    }\n    entry.push_back(Pair(\"bip125-replaceable\", rbfStatus));\n\n    for (const std::pair<std::string, std::string>& item : wtx.mapValue)\n        entry.push_back(Pair(item.first, item.second));\n}\n\nstd::string AccountFromValue(const UniValue& value)\n{\n    std::string strAccount = value.get_str();\n    if (strAccount == \"*\")\n        throw JSONRPCError(RPC_WALLET_INVALID_ACCOUNT_NAME, \"Invalid account name\");\n    return strAccount;\n}\n\nUniValue getnewaddress(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 2)\n        throw std::runtime_error(\n            \"getnewaddress ( \\\"account\\\" \\\"address_type\\\" )\\n\"\n            \"\\nReturns a new Sugarchain address for receiving payments.\\n\"\n            \"If 'account' is specified (DEPRECATED), it is added to the address book \\n\"\n            \"so payments received with the address will be credited to 'account'.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"account\\\"        (string, optional) DEPRECATED. The account name for the address to be linked to. If not provided, the default account \\\"\\\" is used. It can also be set to the empty string \\\"\\\" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.\\n\"\n            \"2. \\\"address_type\\\"   (string, optional) The address type to use. Options are \\\"legacy\\\", \\\"p2sh-segwit\\\", and \\\"bech32\\\". Default is set by -addresstype.\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"address\\\"    (string) The new sugarchain address\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getnewaddress\", \"\")\n            + HelpExampleRpc(\"getnewaddress\", \"\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    // Parse the account first so we don't generate a key if there's an error\n    std::string strAccount;\n    if (!request.params[0].isNull())\n        strAccount = AccountFromValue(request.params[0]);\n\n    OutputType output_type = g_address_type;\n    if (!request.params[1].isNull()) {\n        output_type = ParseOutputType(request.params[1].get_str(), g_address_type);\n        if (output_type == OUTPUT_TYPE_NONE) {\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf(\"Unknown address type '%s'\", request.params[1].get_str()));\n        }\n    }\n\n    if (!pwallet->IsLocked()) {\n        pwallet->TopUpKeyPool();\n    }\n\n    // Generate a new key that is added to wallet\n    CPubKey newKey;\n    if (!pwallet->GetKeyFromPool(newKey)) {\n        throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, \"Error: Keypool ran out, please call keypoolrefill first\");\n    }\n    pwallet->LearnRelatedScripts(newKey, output_type);\n    CTxDestination dest = GetDestinationForKey(newKey, output_type);\n\n    pwallet->SetAddressBook(dest, strAccount, \"receive\");\n\n    return EncodeDestination(dest);\n}\n\n\nCTxDestination GetAccountDestination(CWallet* const pwallet, std::string strAccount, bool bForceNew=false)\n{\n    CTxDestination dest;\n    if (!pwallet->GetAccountDestination(dest, strAccount, bForceNew)) {\n        throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, \"Error: Keypool ran out, please call keypoolrefill first\");\n    }\n\n    return dest;\n}\n\nUniValue getaccountaddress(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"getaccountaddress \\\"account\\\"\\n\"\n            \"\\nDEPRECATED. Returns the current Sugarchain address for receiving payments to this account.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"account\\\"       (string, required) The account name for the address. It can also be set to the empty string \\\"\\\" to represent the default account. The account does not need to exist, it will be created and a new address created  if there is no account by the given name.\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"address\\\"          (string) The account sugarchain address\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getaccountaddress\", \"\")\n            + HelpExampleCli(\"getaccountaddress\", \"\\\"\\\"\")\n            + HelpExampleCli(\"getaccountaddress\", \"\\\"myaccount\\\"\")\n            + HelpExampleRpc(\"getaccountaddress\", \"\\\"myaccount\\\"\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    // Parse the account first so we don't generate a key if there's an error\n    std::string strAccount = AccountFromValue(request.params[0]);\n\n    UniValue ret(UniValue::VSTR);\n\n    ret = EncodeDestination(GetAccountDestination(pwallet, strAccount));\n    return ret;\n}\n\n\nUniValue getrawchangeaddress(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 1)\n        throw std::runtime_error(\n            \"getrawchangeaddress ( \\\"address_type\\\" )\\n\"\n            \"\\nReturns a new Sugarchain address, for receiving change.\\n\"\n            \"This is for use with raw transactions, NOT normal use.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"address_type\\\"           (string, optional) The address type to use. Options are \\\"legacy\\\", \\\"p2sh-segwit\\\", and \\\"bech32\\\". Default is set by -changetype.\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"address\\\"    (string) The address\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getrawchangeaddress\", \"\")\n            + HelpExampleRpc(\"getrawchangeaddress\", \"\")\n       );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    if (!pwallet->IsLocked()) {\n        pwallet->TopUpKeyPool();\n    }\n\n    OutputType output_type = g_change_type != OUTPUT_TYPE_NONE ? g_change_type : g_address_type;\n    if (!request.params[0].isNull()) {\n        output_type = ParseOutputType(request.params[0].get_str(), output_type);\n        if (output_type == OUTPUT_TYPE_NONE) {\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf(\"Unknown address type '%s'\", request.params[0].get_str()));\n        }\n    }\n\n    CReserveKey reservekey(pwallet);\n    CPubKey vchPubKey;\n    if (!reservekey.GetReservedKey(vchPubKey, true))\n        throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, \"Error: Keypool ran out, please call keypoolrefill first\");\n\n    reservekey.KeepKey();\n\n    pwallet->LearnRelatedScripts(vchPubKey, output_type);\n    CTxDestination dest = GetDestinationForKey(vchPubKey, output_type);\n\n    return EncodeDestination(dest);\n}\n\n\nUniValue setaccount(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"setaccount \\\"address\\\" \\\"account\\\"\\n\"\n            \"\\nDEPRECATED. Sets the account associated with the given address.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"address\\\"         (string, required) The sugarchain address to be associated with an account.\\n\"\n            \"2. \\\"account\\\"         (string, required) The account to assign the address to.\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"setaccount\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\" \\\"tabby\\\"\")\n            + HelpExampleRpc(\"setaccount\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\", \\\"tabby\\\"\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    CTxDestination dest = DecodeDestination(request.params[0].get_str());\n    if (!IsValidDestination(dest)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid Sugarchain address\");\n    }\n\n    std::string strAccount;\n    if (!request.params[1].isNull())\n        strAccount = AccountFromValue(request.params[1]);\n\n    // Only add the account if the address is yours.\n    if (IsMine(*pwallet, dest)) {\n        // Detect when changing the account of an address that is the 'unused current key' of another account:\n        if (pwallet->mapAddressBook.count(dest)) {\n            std::string strOldAccount = pwallet->mapAddressBook[dest].name;\n            if (dest == GetAccountDestination(pwallet, strOldAccount)) {\n                GetAccountDestination(pwallet, strOldAccount, true);\n            }\n        }\n        pwallet->SetAddressBook(dest, strAccount, \"receive\");\n    }\n    else\n        throw JSONRPCError(RPC_MISC_ERROR, \"setaccount can only be used with own address\");\n\n    return NullUniValue;\n}\n\n\nUniValue getaccount(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"getaccount \\\"address\\\"\\n\"\n            \"\\nDEPRECATED. Returns the account associated with the given address.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"address\\\"         (string, required) The sugarchain address for account lookup.\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"accountname\\\"        (string) the account address\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getaccount\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\"\")\n            + HelpExampleRpc(\"getaccount\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\"\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    CTxDestination dest = DecodeDestination(request.params[0].get_str());\n    if (!IsValidDestination(dest)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid Sugarchain address\");\n    }\n\n    std::string strAccount;\n    std::map<CTxDestination, CAddressBookData>::iterator mi = pwallet->mapAddressBook.find(dest);\n    if (mi != pwallet->mapAddressBook.end() && !(*mi).second.name.empty()) {\n        strAccount = (*mi).second.name;\n    }\n    return strAccount;\n}\n\n\nUniValue getaddressesbyaccount(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"getaddressesbyaccount \\\"account\\\"\\n\"\n            \"\\nDEPRECATED. Returns the list of addresses for the given account.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"account\\\"        (string, required) The account name.\\n\"\n            \"\\nResult:\\n\"\n            \"[                     (json array of string)\\n\"\n            \"  \\\"address\\\"         (string) a sugarchain address associated with the given account\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getaddressesbyaccount\", \"\\\"tabby\\\"\")\n            + HelpExampleRpc(\"getaddressesbyaccount\", \"\\\"tabby\\\"\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    std::string strAccount = AccountFromValue(request.params[0]);\n\n    // Find all addresses that have the given account\n    UniValue ret(UniValue::VARR);\n    for (const std::pair<CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook) {\n        const CTxDestination& dest = item.first;\n        const std::string& strName = item.second.name;\n        if (strName == strAccount) {\n            ret.push_back(EncodeDestination(dest));\n        }\n    }\n    return ret;\n}\n\nstatic void SendMoney(CWallet * const pwallet, const CTxDestination &address, CAmount nValue, bool fSubtractFeeFromAmount, CWalletTx& wtxNew, const CCoinControl& coin_control)\n{\n    CAmount curBalance = pwallet->GetBalance();\n\n    // Check amount\n    if (nValue <= 0)\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid amount\");\n\n    if (nValue > curBalance)\n        throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, \"Insufficient funds\");\n\n    if (pwallet->GetBroadcastTransactions() && !g_connman) {\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n    }\n\n    // Parse Bitcoin address\n    CScript scriptPubKey = GetScriptForDestination(address);\n\n    // Create and send the transaction\n    CReserveKey reservekey(pwallet);\n    CAmount nFeeRequired;\n    std::string strError;\n    std::vector<CRecipient> vecSend;\n    int nChangePosRet = -1;\n    CRecipient recipient = {scriptPubKey, nValue, fSubtractFeeFromAmount};\n    vecSend.push_back(recipient);\n    if (!pwallet->CreateTransaction(vecSend, wtxNew, reservekey, nFeeRequired, nChangePosRet, strError, coin_control)) {\n        if (!fSubtractFeeFromAmount && nValue + nFeeRequired > curBalance)\n            strError = strprintf(\"Error: This transaction requires a transaction fee of at least %s\", FormatMoney(nFeeRequired));\n        throw JSONRPCError(RPC_WALLET_ERROR, strError);\n    }\n    CValidationState state;\n    if (!pwallet->CommitTransaction(wtxNew, reservekey, g_connman.get(), state)) {\n        strError = strprintf(\"Error: The transaction was rejected! Reason given: %s\", state.GetRejectReason());\n        throw JSONRPCError(RPC_WALLET_ERROR, strError);\n    }\n}\n\nUniValue sendtoaddress(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 2 || request.params.size() > 8)\n        throw std::runtime_error(\n            \"sendtoaddress \\\"address\\\" amount ( \\\"comment\\\" \\\"comment_to\\\" subtractfeefromamount replaceable conf_target \\\"estimate_mode\\\")\\n\"\n            \"\\nSend an amount to a given address.\\n\"\n            + HelpRequiringPassphrase(pwallet) +\n            \"\\nArguments:\\n\"\n            \"1. \\\"address\\\"            (string, required) The sugarchain address to send to.\\n\"\n            \"2. \\\"amount\\\"             (numeric or string, required) The amount in \" + CURRENCY_UNIT + \" to send. eg 0.1\\n\"\n            \"3. \\\"comment\\\"            (string, optional) A comment used to store what the transaction is for. \\n\"\n            \"                             This is not part of the transaction, just kept in your wallet.\\n\"\n            \"4. \\\"comment_to\\\"         (string, optional) A comment to store the name of the person or organization \\n\"\n            \"                             to which you're sending the transaction. This is not part of the \\n\"\n            \"                             transaction, just kept in your wallet.\\n\"\n            \"5. subtractfeefromamount  (boolean, optional, default=false) The fee will be deducted from the amount being sent.\\n\"\n            \"                             The recipient will receive less sugarchains than you enter in the amount field.\\n\"\n            \"6. replaceable            (boolean, optional) Allow this transaction to be replaced by a transaction with higher fees via BIP 125\\n\"\n            \"7. conf_target            (numeric, optional) Confirmation target (in blocks)\\n\"\n            \"8. \\\"estimate_mode\\\"      (string, optional, default=UNSET) The fee estimate mode, must be one of:\\n\"\n            \"       \\\"UNSET\\\"\\n\"\n            \"       \\\"ECONOMICAL\\\"\\n\"\n            \"       \\\"CONSERVATIVE\\\"\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"txid\\\"                  (string) The transaction id.\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"sendtoaddress\", \"\\\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\\\" 0.1\")\n            + HelpExampleCli(\"sendtoaddress\", \"\\\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\\\" 0.1 \\\"donation\\\" \\\"seans outpost\\\"\")\n            + HelpExampleCli(\"sendtoaddress\", \"\\\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\\\" 0.1 \\\"\\\" \\\"\\\" true\")\n            + HelpExampleRpc(\"sendtoaddress\", \"\\\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\\\", 0.1, \\\"donation\\\", \\\"seans outpost\\\"\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    CTxDestination dest = DecodeDestination(request.params[0].get_str());\n    if (!IsValidDestination(dest)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid address\");\n    }\n\n    // Amount\n    CAmount nAmount = AmountFromValue(request.params[1]);\n    if (nAmount <= 0)\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Invalid amount for send\");\n\n    // Wallet comments\n    CWalletTx wtx;\n    if (!request.params[2].isNull() && !request.params[2].get_str().empty())\n        wtx.mapValue[\"comment\"] = request.params[2].get_str();\n    if (!request.params[3].isNull() && !request.params[3].get_str().empty())\n        wtx.mapValue[\"to\"]      = request.params[3].get_str();\n\n    bool fSubtractFeeFromAmount = false;\n    if (!request.params[4].isNull()) {\n        fSubtractFeeFromAmount = request.params[4].get_bool();\n    }\n\n    CCoinControl coin_control;\n    if (!request.params[5].isNull()) {\n        coin_control.signalRbf = request.params[5].get_bool();\n    }\n\n    if (!request.params[6].isNull()) {\n        coin_control.m_confirm_target = ParseConfirmTarget(request.params[6]);\n    }\n\n    if (!request.params[7].isNull()) {\n        if (!FeeModeFromString(request.params[7].get_str(), coin_control.m_fee_mode)) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid estimate_mode parameter\");\n        }\n    }\n\n\n    EnsureWalletIsUnlocked(pwallet);\n\n    SendMoney(pwallet, dest, nAmount, fSubtractFeeFromAmount, wtx, coin_control);\n\n    return wtx.GetHash().GetHex();\n}\n\nUniValue listaddressgroupings(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"listaddressgroupings\\n\"\n            \"\\nLists groups of addresses which have had their common ownership\\n\"\n            \"made public by common use as inputs or as the resulting change\\n\"\n            \"in past transactions\\n\"\n            \"\\nResult:\\n\"\n            \"[\\n\"\n            \"  [\\n\"\n            \"    [\\n\"\n            \"      \\\"address\\\",            (string) The sugarchain address\\n\"\n            \"      amount,                 (numeric) The amount in \" + CURRENCY_UNIT + \"\\n\"\n            \"      \\\"account\\\"             (string, optional) DEPRECATED. The account\\n\"\n            \"    ]\\n\"\n            \"    ,...\\n\"\n            \"  ]\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"listaddressgroupings\", \"\")\n            + HelpExampleRpc(\"listaddressgroupings\", \"\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    UniValue jsonGroupings(UniValue::VARR);\n    std::map<CTxDestination, CAmount> balances = pwallet->GetAddressBalances();\n    for (const std::set<CTxDestination>& grouping : pwallet->GetAddressGroupings()) {\n        UniValue jsonGrouping(UniValue::VARR);\n        for (const CTxDestination& address : grouping)\n        {\n            UniValue addressInfo(UniValue::VARR);\n            addressInfo.push_back(EncodeDestination(address));\n            addressInfo.push_back(ValueFromAmount(balances[address]));\n            {\n                if (pwallet->mapAddressBook.find(address) != pwallet->mapAddressBook.end()) {\n                    addressInfo.push_back(pwallet->mapAddressBook.find(address)->second.name);\n                }\n            }\n            jsonGrouping.push_back(addressInfo);\n        }\n        jsonGroupings.push_back(jsonGrouping);\n    }\n    return jsonGroupings;\n}\n\nUniValue signmessage(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 2)\n        throw std::runtime_error(\n            \"signmessage \\\"address\\\" \\\"message\\\"\\n\"\n            \"\\nSign a message with the private key of an address\"\n            + HelpRequiringPassphrase(pwallet) + \"\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"address\\\"         (string, required) The sugarchain address to use for the private key.\\n\"\n            \"2. \\\"message\\\"         (string, required) The message to create a signature of.\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"signature\\\"          (string) The signature of the message encoded in base 64\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nUnlock the wallet for 30 seconds\\n\"\n            + HelpExampleCli(\"walletpassphrase\", \"\\\"mypassphrase\\\" 30\") +\n            \"\\nCreate the signature\\n\"\n            + HelpExampleCli(\"signmessage\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\" \\\"my message\\\"\") +\n            \"\\nVerify the signature\\n\"\n            + HelpExampleCli(\"verifymessage\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\" \\\"signature\\\" \\\"my message\\\"\") +\n            \"\\nAs json rpc\\n\"\n            + HelpExampleRpc(\"signmessage\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\", \\\"my message\\\"\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    EnsureWalletIsUnlocked(pwallet);\n\n    std::string strAddress = request.params[0].get_str();\n    std::string strMessage = request.params[1].get_str();\n\n    CTxDestination dest = DecodeDestination(strAddress);\n    if (!IsValidDestination(dest)) {\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Invalid address\");\n    }\n\n    const CKeyID *keyID = boost::get<CKeyID>(&dest);\n    if (!keyID) {\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Address does not refer to key\");\n    }\n\n    CKey key;\n    if (!pwallet->GetKey(*keyID, key)) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Private key not available\");\n    }\n\n    CHashWriter ss(SER_GETHASH, 0);\n    ss << strMessageMagic;\n    ss << strMessage;\n\n    std::vector<unsigned char> vchSig;\n    if (!key.SignCompact(ss.GetHash(), vchSig))\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Sign failed\");\n\n    return EncodeBase64(vchSig.data(), vchSig.size());\n}\n\nUniValue getreceivedbyaddress(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"getreceivedbyaddress \\\"address\\\" ( minconf )\\n\"\n            \"\\nReturns the total amount received by the given address in transactions with at least minconf confirmations.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"address\\\"         (string, required) The sugarchain address for transactions.\\n\"\n            \"2. minconf             (numeric, optional, default=1) Only include transactions confirmed at least this many times.\\n\"\n            \"\\nResult:\\n\"\n            \"amount   (numeric) The total amount in \" + CURRENCY_UNIT + \" received at this address.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nThe amount from transactions with at least 1 confirmation\\n\"\n            + HelpExampleCli(\"getreceivedbyaddress\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\"\") +\n            \"\\nThe amount including unconfirmed transactions, zero confirmations\\n\"\n            + HelpExampleCli(\"getreceivedbyaddress\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\" 0\") +\n            \"\\nThe amount with at least 6 confirmations\\n\"\n            + HelpExampleCli(\"getreceivedbyaddress\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\" 6\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"getreceivedbyaddress\", \"\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\", 6\")\n       );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    // Bitcoin address\n    CTxDestination dest = DecodeDestination(request.params[0].get_str());\n    if (!IsValidDestination(dest)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid Sugarchain address\");\n    }\n    CScript scriptPubKey = GetScriptForDestination(dest);\n    if (!IsMine(*pwallet, scriptPubKey)) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Address not found in wallet\");\n    }\n\n    // Minimum confirmations\n    int nMinDepth = 1;\n    if (!request.params[1].isNull())\n        nMinDepth = request.params[1].get_int();\n\n    // Tally\n    CAmount nAmount = 0;\n    for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {\n        const CWalletTx& wtx = pairWtx.second;\n        if (wtx.IsCoinBase() || !CheckFinalTx(*wtx.tx))\n            continue;\n\n        for (const CTxOut& txout : wtx.tx->vout)\n            if (txout.scriptPubKey == scriptPubKey)\n                if (wtx.GetDepthInMainChain() >= nMinDepth)\n                    nAmount += txout.nValue;\n    }\n\n    return  ValueFromAmount(nAmount);\n}\n\n\nUniValue getreceivedbyaccount(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"getreceivedbyaccount \\\"account\\\" ( minconf )\\n\"\n            \"\\nDEPRECATED. Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"account\\\"      (string, required) The selected account, may be the default account using \\\"\\\".\\n\"\n            \"2. minconf          (numeric, optional, default=1) Only include transactions confirmed at least this many times.\\n\"\n            \"\\nResult:\\n\"\n            \"amount              (numeric) The total amount in \" + CURRENCY_UNIT + \" received for this account.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nAmount received by the default account with at least 1 confirmation\\n\"\n            + HelpExampleCli(\"getreceivedbyaccount\", \"\\\"\\\"\") +\n            \"\\nAmount received at the tabby account including unconfirmed amounts with zero confirmations\\n\"\n            + HelpExampleCli(\"getreceivedbyaccount\", \"\\\"tabby\\\" 0\") +\n            \"\\nThe amount with at least 6 confirmations\\n\"\n            + HelpExampleCli(\"getreceivedbyaccount\", \"\\\"tabby\\\" 6\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"getreceivedbyaccount\", \"\\\"tabby\\\", 6\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    // Minimum confirmations\n    int nMinDepth = 1;\n    if (!request.params[1].isNull())\n        nMinDepth = request.params[1].get_int();\n\n    // Get the set of pub keys assigned to account\n    std::string strAccount = AccountFromValue(request.params[0]);\n    std::set<CTxDestination> setAddress = pwallet->GetAccountAddresses(strAccount);\n\n    // Tally\n    CAmount nAmount = 0;\n    for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {\n        const CWalletTx& wtx = pairWtx.second;\n        if (wtx.IsCoinBase() || !CheckFinalTx(*wtx.tx))\n            continue;\n\n        for (const CTxOut& txout : wtx.tx->vout)\n        {\n            CTxDestination address;\n            if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*pwallet, address) && setAddress.count(address)) {\n                if (wtx.GetDepthInMainChain() >= nMinDepth)\n                    nAmount += txout.nValue;\n            }\n        }\n    }\n\n    return ValueFromAmount(nAmount);\n}\n\n\nUniValue getbalance(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 3)\n        throw std::runtime_error(\n            \"getbalance ( \\\"account\\\" minconf include_watchonly )\\n\"\n            \"\\nIf account is not specified, returns the server's total available balance.\\n\"\n            \"The available balance is what the wallet considers currently spendable, and is\\n\"\n            \"thus affected by options which limit spendability such as -spendzeroconfchange.\\n\"\n            \"If account is specified (DEPRECATED), returns the balance in the account.\\n\"\n            \"Note that the account \\\"\\\" is not the same as leaving the parameter out.\\n\"\n            \"The server total may be different to the balance in the default \\\"\\\" account.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"account\\\"         (string, optional) DEPRECATED. The account string may be given as a\\n\"\n            \"                     specific account name to find the balance associated with wallet keys in\\n\"\n            \"                     a named account, or as the empty string (\\\"\\\") to find the balance\\n\"\n            \"                     associated with wallet keys not in any named account, or as \\\"*\\\" to find\\n\"\n            \"                     the balance associated with all wallet keys regardless of account.\\n\"\n            \"                     When this option is specified, it calculates the balance in a different\\n\"\n            \"                     way than when it is not specified, and which can count spends twice when\\n\"\n            \"                     there are conflicting pending transactions (such as those created by\\n\"\n            \"                     the bumpfee command), temporarily resulting in low or even negative\\n\"\n            \"                     balances. In general, account balance calculation is not considered\\n\"\n            \"                     reliable and has resulted in confusing outcomes, so it is recommended to\\n\"\n            \"                     avoid passing this argument.\\n\"\n            \"2. minconf           (numeric, optional, default=1) Only include transactions confirmed at least this many times.\\n\"\n            \"3. include_watchonly (bool, optional, default=false) Also include balance in watch-only addresses (see 'importaddress')\\n\"\n            \"\\nResult:\\n\"\n            \"amount              (numeric) The total amount in \" + CURRENCY_UNIT + \" received for this account.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nThe total amount in the wallet with 1 or more confirmations\\n\"\n            + HelpExampleCli(\"getbalance\", \"\") +\n            \"\\nThe total amount in the wallet at least 6 blocks confirmed\\n\"\n            + HelpExampleCli(\"getbalance\", \"\\\"*\\\" 6\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"getbalance\", \"\\\"*\\\", 6\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    const UniValue& account_value = request.params[0];\n    const UniValue& minconf = request.params[1];\n    const UniValue& include_watchonly = request.params[2];\n\n    if (account_value.isNull()) {\n        if (!minconf.isNull()) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER,\n                \"getbalance minconf option is only currently supported if an account is specified\");\n        }\n        if (!include_watchonly.isNull()) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER,\n                \"getbalance include_watchonly option is only currently supported if an account is specified\");\n        }\n        return ValueFromAmount(pwallet->GetBalance());\n    }\n\n    const std::string& account_param = account_value.get_str();\n    const std::string* account = account_param != \"*\" ? &account_param : nullptr;\n\n    int nMinDepth = 1;\n    if (!minconf.isNull())\n        nMinDepth = minconf.get_int();\n    isminefilter filter = ISMINE_SPENDABLE;\n    if(!include_watchonly.isNull())\n        if(include_watchonly.get_bool())\n            filter = filter | ISMINE_WATCH_ONLY;\n\n    return ValueFromAmount(pwallet->GetLegacyBalance(filter, nMinDepth, account));\n}\n\nUniValue getunconfirmedbalance(const JSONRPCRequest &request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 0)\n        throw std::runtime_error(\n                \"getunconfirmedbalance\\n\"\n                \"Returns the server's total unconfirmed balance\\n\");\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    return ValueFromAmount(pwallet->GetUnconfirmedBalance());\n}\n\n\nUniValue movecmd(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 3 || request.params.size() > 5)\n        throw std::runtime_error(\n            \"move \\\"fromaccount\\\" \\\"toaccount\\\" amount ( minconf \\\"comment\\\" )\\n\"\n            \"\\nDEPRECATED. Move a specified amount from one account in your wallet to another.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"fromaccount\\\"   (string, required) The name of the account to move funds from. May be the default account using \\\"\\\".\\n\"\n            \"2. \\\"toaccount\\\"     (string, required) The name of the account to move funds to. May be the default account using \\\"\\\".\\n\"\n            \"3. amount            (numeric) Quantity of \" + CURRENCY_UNIT + \" to move between accounts.\\n\"\n            \"4. (dummy)           (numeric, optional) Ignored. Remains for backward compatibility.\\n\"\n            \"5. \\\"comment\\\"       (string, optional) An optional comment, stored in the wallet only.\\n\"\n            \"\\nResult:\\n\"\n            \"true|false           (boolean) true if successful.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nMove 0.01 \" + CURRENCY_UNIT + \" from the default account to the account named tabby\\n\"\n            + HelpExampleCli(\"move\", \"\\\"\\\" \\\"tabby\\\" 0.01\") +\n            \"\\nMove 0.01 \" + CURRENCY_UNIT + \" timotei to akiko with a comment and funds have 6 confirmations\\n\"\n            + HelpExampleCli(\"move\", \"\\\"timotei\\\" \\\"akiko\\\" 0.01 6 \\\"happy birthday!\\\"\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"move\", \"\\\"timotei\\\", \\\"akiko\\\", 0.01, 6, \\\"happy birthday!\\\"\")\n        );\n\n    ObserveSafeMode();\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    std::string strFrom = AccountFromValue(request.params[0]);\n    std::string strTo = AccountFromValue(request.params[1]);\n    CAmount nAmount = AmountFromValue(request.params[2]);\n    if (nAmount <= 0)\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Invalid amount for send\");\n    if (!request.params[3].isNull())\n        // unused parameter, used to be nMinDepth, keep type-checking it though\n        (void)request.params[3].get_int();\n    std::string strComment;\n    if (!request.params[4].isNull())\n        strComment = request.params[4].get_str();\n\n    if (!pwallet->AccountMove(strFrom, strTo, nAmount, strComment)) {\n        throw JSONRPCError(RPC_DATABASE_ERROR, \"database error\");\n    }\n\n    return true;\n}\n\n\nUniValue sendfrom(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 3 || request.params.size() > 6)\n        throw std::runtime_error(\n            \"sendfrom \\\"fromaccount\\\" \\\"toaddress\\\" amount ( minconf \\\"comment\\\" \\\"comment_to\\\" )\\n\"\n            \"\\nDEPRECATED (use sendtoaddress). Sent an amount from an account to a sugarchain address.\"\n            + HelpRequiringPassphrase(pwallet) + \"\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"fromaccount\\\"       (string, required) The name of the account to send funds from. May be the default account using \\\"\\\".\\n\"\n            \"                       Specifying an account does not influence coin selection, but it does associate the newly created\\n\"\n            \"                       transaction with the account, so the account's balance computation and transaction history can reflect\\n\"\n            \"                       the spend.\\n\"\n            \"2. \\\"toaddress\\\"         (string, required) The sugarchain address to send funds to.\\n\"\n            \"3. amount                (numeric or string, required) The amount in \" + CURRENCY_UNIT + \" (transaction fee is added on top).\\n\"\n            \"4. minconf               (numeric, optional, default=1) Only use funds with at least this many confirmations.\\n\"\n            \"5. \\\"comment\\\"           (string, optional) A comment used to store what the transaction is for. \\n\"\n            \"                                     This is not part of the transaction, just kept in your wallet.\\n\"\n            \"6. \\\"comment_to\\\"        (string, optional) An optional comment to store the name of the person or organization \\n\"\n            \"                                     to which you're sending the transaction. This is not part of the transaction, \\n\"\n            \"                                     it is just kept in your wallet.\\n\"\n            \"\\nResult:\\n\"\n            \"\\\"txid\\\"                 (string) The transaction id.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nSend 0.01 \" + CURRENCY_UNIT + \" from the default account to the address, must have at least 1 confirmation\\n\"\n            + HelpExampleCli(\"sendfrom\", \"\\\"\\\" \\\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\\\" 0.01\") +\n            \"\\nSend 0.01 from the tabby account to the given address, funds must have at least 6 confirmations\\n\"\n            + HelpExampleCli(\"sendfrom\", \"\\\"tabby\\\" \\\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\\\" 0.01 6 \\\"donation\\\" \\\"seans outpost\\\"\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"sendfrom\", \"\\\"tabby\\\", \\\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\\\", 0.01, 6, \\\"donation\\\", \\\"seans outpost\\\"\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    std::string strAccount = AccountFromValue(request.params[0]);\n    CTxDestination dest = DecodeDestination(request.params[1].get_str());\n    if (!IsValidDestination(dest)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid Sugarchain address\");\n    }\n    CAmount nAmount = AmountFromValue(request.params[2]);\n    if (nAmount <= 0)\n        throw JSONRPCError(RPC_TYPE_ERROR, \"Invalid amount for send\");\n    int nMinDepth = 1;\n    if (!request.params[3].isNull())\n        nMinDepth = request.params[3].get_int();\n\n    CWalletTx wtx;\n    wtx.strFromAccount = strAccount;\n    if (!request.params[4].isNull() && !request.params[4].get_str().empty())\n        wtx.mapValue[\"comment\"] = request.params[4].get_str();\n    if (!request.params[5].isNull() && !request.params[5].get_str().empty())\n        wtx.mapValue[\"to\"]      = request.params[5].get_str();\n\n    EnsureWalletIsUnlocked(pwallet);\n\n    // Check funds\n    CAmount nBalance = pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth, &strAccount);\n    if (nAmount > nBalance)\n        throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, \"Account has insufficient funds\");\n\n    CCoinControl no_coin_control; // This is a deprecated API\n    SendMoney(pwallet, dest, nAmount, false, wtx, no_coin_control);\n\n    return wtx.GetHash().GetHex();\n}\n\n\nUniValue sendmany(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 2 || request.params.size() > 8)\n        throw std::runtime_error(\n            \"sendmany \\\"fromaccount\\\" {\\\"address\\\":amount,...} ( minconf \\\"comment\\\" [\\\"address\\\",...] replaceable conf_target \\\"estimate_mode\\\")\\n\"\n            \"\\nSend multiple times. Amounts are double-precision floating point numbers.\"\n            + HelpRequiringPassphrase(pwallet) + \"\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"fromaccount\\\"         (string, required) DEPRECATED. The account to send the funds from. Should be \\\"\\\" for the default account\\n\"\n            \"2. \\\"amounts\\\"             (string, required) A json object with addresses and amounts\\n\"\n            \"    {\\n\"\n            \"      \\\"address\\\":amount   (numeric or string) The sugarchain address is the key, the numeric amount (can be string) in \" + CURRENCY_UNIT + \" is the value\\n\"\n            \"      ,...\\n\"\n            \"    }\\n\"\n            \"3. minconf                 (numeric, optional, default=1) Only use the balance confirmed at least this many times.\\n\"\n            \"4. \\\"comment\\\"             (string, optional) A comment\\n\"\n            \"5. subtractfeefrom         (array, optional) A json array with addresses.\\n\"\n            \"                           The fee will be equally deducted from the amount of each selected address.\\n\"\n            \"                           Those recipients will receive less sugarchains than you enter in their corresponding amount field.\\n\"\n            \"                           If no addresses are specified here, the sender pays the fee.\\n\"\n            \"    [\\n\"\n            \"      \\\"address\\\"          (string) Subtract fee from this address\\n\"\n            \"      ,...\\n\"\n            \"    ]\\n\"\n            \"6. replaceable            (boolean, optional) Allow this transaction to be replaced by a transaction with higher fees via BIP 125\\n\"\n            \"7. conf_target            (numeric, optional) Confirmation target (in blocks)\\n\"\n            \"8. \\\"estimate_mode\\\"      (string, optional, default=UNSET) The fee estimate mode, must be one of:\\n\"\n            \"       \\\"UNSET\\\"\\n\"\n            \"       \\\"ECONOMICAL\\\"\\n\"\n            \"       \\\"CONSERVATIVE\\\"\\n\"\n             \"\\nResult:\\n\"\n            \"\\\"txid\\\"                   (string) The transaction id for the send. Only 1 transaction is created regardless of \\n\"\n            \"                                    the number of addresses.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nSend two amounts to two different addresses:\\n\"\n            + HelpExampleCli(\"sendmany\", \"\\\"\\\" \\\"{\\\\\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\\\\\":0.01,\\\\\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\\\\\":0.02}\\\"\") +\n            \"\\nSend two amounts to two different addresses setting the confirmation and comment:\\n\"\n            + HelpExampleCli(\"sendmany\", \"\\\"\\\" \\\"{\\\\\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\\\\\":0.01,\\\\\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\\\\\":0.02}\\\" 6 \\\"testing\\\"\") +\n            \"\\nSend two amounts to two different addresses, subtract fee from amount:\\n\"\n            + HelpExampleCli(\"sendmany\", \"\\\"\\\" \\\"{\\\\\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\\\\\":0.01,\\\\\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\\\\\":0.02}\\\" 1 \\\"\\\" \\\"[\\\\\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\\\\\",\\\\\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\\\\\"]\\\"\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"sendmany\", \"\\\"\\\", {\\\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XX\\\":0.01,\\\"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\\\":0.02}, 6, \\\"testing\\\"\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    if (pwallet->GetBroadcastTransactions() && !g_connman) {\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n    }\n\n    std::string strAccount = AccountFromValue(request.params[0]);\n    UniValue sendTo = request.params[1].get_obj();\n    int nMinDepth = 1;\n    if (!request.params[2].isNull())\n        nMinDepth = request.params[2].get_int();\n\n    CWalletTx wtx;\n    wtx.strFromAccount = strAccount;\n    if (!request.params[3].isNull() && !request.params[3].get_str().empty())\n        wtx.mapValue[\"comment\"] = request.params[3].get_str();\n\n    UniValue subtractFeeFromAmount(UniValue::VARR);\n    if (!request.params[4].isNull())\n        subtractFeeFromAmount = request.params[4].get_array();\n\n    CCoinControl coin_control;\n    if (!request.params[5].isNull()) {\n        coin_control.signalRbf = request.params[5].get_bool();\n    }\n\n    if (!request.params[6].isNull()) {\n        coin_control.m_confirm_target = ParseConfirmTarget(request.params[6]);\n    }\n\n    if (!request.params[7].isNull()) {\n        if (!FeeModeFromString(request.params[7].get_str(), coin_control.m_fee_mode)) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid estimate_mode parameter\");\n        }\n    }\n\n    std::set<CTxDestination> destinations;\n    std::vector<CRecipient> vecSend;\n\n    CAmount totalAmount = 0;\n    std::vector<std::string> keys = sendTo.getKeys();\n    for (const std::string& name_ : keys) {\n        CTxDestination dest = DecodeDestination(name_);\n        if (!IsValidDestination(dest)) {\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, std::string(\"Invalid Sugarchain address: \") + name_);\n        }\n\n        if (destinations.count(dest)) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, std::string(\"Invalid parameter, duplicated address: \") + name_);\n        }\n        destinations.insert(dest);\n\n        CScript scriptPubKey = GetScriptForDestination(dest);\n        CAmount nAmount = AmountFromValue(sendTo[name_]);\n        if (nAmount <= 0)\n            throw JSONRPCError(RPC_TYPE_ERROR, \"Invalid amount for send\");\n        totalAmount += nAmount;\n\n        bool fSubtractFeeFromAmount = false;\n        for (unsigned int idx = 0; idx < subtractFeeFromAmount.size(); idx++) {\n            const UniValue& addr = subtractFeeFromAmount[idx];\n            if (addr.get_str() == name_)\n                fSubtractFeeFromAmount = true;\n        }\n\n        CRecipient recipient = {scriptPubKey, nAmount, fSubtractFeeFromAmount};\n        vecSend.push_back(recipient);\n    }\n\n    EnsureWalletIsUnlocked(pwallet);\n\n    // Check funds\n    CAmount nBalance = pwallet->GetLegacyBalance(ISMINE_SPENDABLE, nMinDepth, &strAccount);\n    if (totalAmount > nBalance)\n        throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, \"Account has insufficient funds\");\n\n    // Send\n    CReserveKey keyChange(pwallet);\n    CAmount nFeeRequired = 0;\n    int nChangePosRet = -1;\n    std::string strFailReason;\n    bool fCreated = pwallet->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired, nChangePosRet, strFailReason, coin_control);\n    if (!fCreated)\n        throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, strFailReason);\n    CValidationState state;\n    if (!pwallet->CommitTransaction(wtx, keyChange, g_connman.get(), state)) {\n        strFailReason = strprintf(\"Transaction commit failed:: %s\", state.GetRejectReason());\n        throw JSONRPCError(RPC_WALLET_ERROR, strFailReason);\n    }\n\n    return wtx.GetHash().GetHex();\n}\n\nUniValue addmultisigaddress(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 2 || request.params.size() > 4) {\n        std::string msg = \"addmultisigaddress nrequired [\\\"key\\\",...] ( \\\"account\\\" \\\"address_type\\\" )\\n\"\n            \"\\nAdd a nrequired-to-sign multisignature address to the wallet. Requires a new wallet backup.\\n\"\n            \"Each key is a Sugarchain address or hex-encoded public key.\\n\"\n            \"This functionality is only intended for use with non-watchonly addresses.\\n\"\n            \"See `importaddress` for watchonly p2sh address support.\\n\"\n            \"If 'account' is specified (DEPRECATED), assign address to that account.\\n\"\n\n            \"\\nArguments:\\n\"\n            \"1. nrequired                      (numeric, required) The number of required signatures out of the n keys or addresses.\\n\"\n            \"2. \\\"keys\\\"                         (string, required) A json array of sugarchain addresses or hex-encoded public keys\\n\"\n            \"     [\\n\"\n            \"       \\\"address\\\"                  (string) sugarchain address or hex-encoded public key\\n\"\n            \"       ...,\\n\"\n            \"     ]\\n\"\n            \"3. \\\"account\\\"                      (string, optional) DEPRECATED. An account to assign the addresses to.\\n\"\n            \"4. \\\"address_type\\\"                 (string, optional) The address type to use. Options are \\\"legacy\\\", \\\"p2sh-segwit\\\", and \\\"bech32\\\". Default is set by -addresstype.\\n\"\n\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"address\\\":\\\"multisigaddress\\\",    (string) The value of the new multisig address.\\n\"\n            \"  \\\"redeemScript\\\":\\\"script\\\"         (string) The string value of the hex-encoded redemption script.\\n\"\n            \"}\\n\"\n            \"\\nResult (DEPRECATED. To see this result in v0.16 instead, please start sugarchaind with -deprecatedrpc=addmultisigaddress).\\n\"\n            \"        clients should transition to the new output api before upgrading to v0.17.\\n\"\n            \"\\\"address\\\"                         (string) A sugarchain address associated with the keys.\\n\"\n\n            \"\\nExamples:\\n\"\n            \"\\nAdd a multisig address from 2 addresses\\n\"\n            + HelpExampleCli(\"addmultisigaddress\", \"2 \\\"[\\\\\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\\\\\",\\\\\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\\\\\"]\\\"\") +\n            \"\\nAs json rpc call\\n\"\n            + HelpExampleRpc(\"addmultisigaddress\", \"2, \\\"[\\\\\\\"16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\\\\\",\\\\\\\"171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\\\\\"]\\\"\")\n        ;\n        throw std::runtime_error(msg);\n    }\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    std::string strAccount;\n    if (!request.params[2].isNull())\n        strAccount = AccountFromValue(request.params[2]);\n\n    int required = request.params[0].get_int();\n\n    // Get the public keys\n    const UniValue& keys_or_addrs = request.params[1].get_array();\n    std::vector<CPubKey> pubkeys;\n    for (unsigned int i = 0; i < keys_or_addrs.size(); ++i) {\n        if (IsHex(keys_or_addrs[i].get_str()) && (keys_or_addrs[i].get_str().length() == 66 || keys_or_addrs[i].get_str().length() == 130)) {\n            pubkeys.push_back(HexToPubKey(keys_or_addrs[i].get_str()));\n        } else {\n            pubkeys.push_back(AddrToPubKey(pwallet, keys_or_addrs[i].get_str()));\n        }\n    }\n\n    OutputType output_type = g_address_type;\n    if (!request.params[3].isNull()) {\n        output_type = ParseOutputType(request.params[3].get_str(), output_type);\n        if (output_type == OUTPUT_TYPE_NONE) {\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf(\"Unknown address type '%s'\", request.params[3].get_str()));\n        }\n    }\n\n    // Construct using pay-to-script-hash:\n    CScript inner = CreateMultisigRedeemscript(required, pubkeys);\n    pwallet->AddCScript(inner);\n    CTxDestination dest = pwallet->AddAndGetDestinationForScript(inner, output_type);\n    pwallet->SetAddressBook(dest, strAccount, \"send\");\n\n    // Return old style interface\n    if (IsDeprecatedRPCEnabled(\"addmultisigaddress\")) {\n        return EncodeDestination(dest);\n    }\n\n    UniValue result(UniValue::VOBJ);\n    result.pushKV(\"address\", EncodeDestination(dest));\n    result.pushKV(\"redeemScript\", HexStr(inner.begin(), inner.end()));\n    return result;\n}\n\nclass Witnessifier : public boost::static_visitor<bool>\n{\npublic:\n    CWallet * const pwallet;\n    CTxDestination result;\n    bool already_witness;\n\n    explicit Witnessifier(CWallet *_pwallet) : pwallet(_pwallet), already_witness(false) {}\n\n    bool operator()(const CKeyID &keyID) {\n        if (pwallet) {\n            CScript basescript = GetScriptForDestination(keyID);\n            CScript witscript = GetScriptForWitness(basescript);\n            if (!IsSolvable(*pwallet, witscript)) {\n                return false;\n            }\n            return ExtractDestination(witscript, result);\n        }\n        return false;\n    }\n\n    bool operator()(const CScriptID &scriptID) {\n        CScript subscript;\n        if (pwallet && pwallet->GetCScript(scriptID, subscript)) {\n            int witnessversion;\n            std::vector<unsigned char> witprog;\n            if (subscript.IsWitnessProgram(witnessversion, witprog)) {\n                ExtractDestination(subscript, result);\n                already_witness = true;\n                return true;\n            }\n            CScript witscript = GetScriptForWitness(subscript);\n            if (!IsSolvable(*pwallet, witscript)) {\n                return false;\n            }\n            return ExtractDestination(witscript, result);\n        }\n        return false;\n    }\n\n    bool operator()(const WitnessV0KeyHash& id)\n    {\n        already_witness = true;\n        result = id;\n        return true;\n    }\n\n    bool operator()(const WitnessV0ScriptHash& id)\n    {\n        already_witness = true;\n        result = id;\n        return true;\n    }\n\n    template<typename T>\n    bool operator()(const T& dest) { return false; }\n};\n\nUniValue addwitnessaddress(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n    {\n        std::string msg = \"addwitnessaddress \\\"address\\\" ( p2sh )\\n\"\n            \"\\nDEPRECATED: set the address_type argument of getnewaddress, or option -addresstype=[bech32|p2sh-segwit] instead.\\n\"\n            \"Add a witness address for a script (with pubkey or redeemscript known). Requires a new wallet backup.\\n\"\n            \"It returns the witness script.\\n\"\n\n            \"\\nArguments:\\n\"\n            \"1. \\\"address\\\"       (string, required) An address known to the wallet\\n\"\n            \"2. p2sh            (bool, optional, default=true) Embed inside P2SH\\n\"\n\n            \"\\nResult:\\n\"\n            \"\\\"witnessaddress\\\",  (string) The value of the new address (P2SH or BIP173).\\n\"\n            \"}\\n\"\n        ;\n        throw std::runtime_error(msg);\n    }\n\n    if (!IsDeprecatedRPCEnabled(\"addwitnessaddress\")) {\n        throw JSONRPCError(RPC_METHOD_DEPRECATED, \"addwitnessaddress is deprecated and will be fully removed in v0.17. \"\n            \"To use addwitnessaddress in v0.16, restart sugarchaind with -deprecatedrpc=addwitnessaddress.\\n\"\n            \"Projects should transition to using the address_type argument of getnewaddress, or option -addresstype=[bech32|p2sh-segwit] instead.\\n\");\n    }\n\n    {\n        LOCK(cs_main);\n        if (!IsWitnessEnabled(chainActive.Tip(), Params().GetConsensus()) && !gArgs.GetBoolArg(\"-walletprematurewitness\", false)) {\n            throw JSONRPCError(RPC_WALLET_ERROR, \"Segregated witness not enabled on network\");\n        }\n    }\n\n    CTxDestination dest = DecodeDestination(request.params[0].get_str());\n    if (!IsValidDestination(dest)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid Sugarchain address\");\n    }\n\n    bool p2sh = true;\n    if (!request.params[1].isNull()) {\n        p2sh = request.params[1].get_bool();\n    }\n\n    Witnessifier w(pwallet);\n    bool ret = boost::apply_visitor(w, dest);\n    if (!ret) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Public key or redeemscript not known to wallet, or the key is uncompressed\");\n    }\n\n    CScript witprogram = GetScriptForDestination(w.result);\n\n    if (p2sh) {\n        w.result = CScriptID(witprogram);\n    }\n\n    if (w.already_witness) {\n        if (!(dest == w.result)) {\n            throw JSONRPCError(RPC_WALLET_ERROR, \"Cannot convert between witness address types\");\n        }\n    } else {\n        pwallet->AddCScript(witprogram); // Implicit for single-key now, but necessary for multisig and for compatibility with older software\n        pwallet->SetAddressBook(w.result, \"\", \"receive\");\n    }\n\n    return EncodeDestination(w.result);\n}\n\nstruct tallyitem\n{\n    CAmount nAmount;\n    int nConf;\n    std::vector<uint256> txids;\n    bool fIsWatchonly;\n    tallyitem()\n    {\n        nAmount = 0;\n        nConf = std::numeric_limits<int>::max();\n        fIsWatchonly = false;\n    }\n};\n\nUniValue ListReceived(CWallet * const pwallet, const UniValue& params, bool fByAccounts)\n{\n    // Minimum confirmations\n    int nMinDepth = 1;\n    if (!params[0].isNull())\n        nMinDepth = params[0].get_int();\n\n    // Whether to include empty accounts\n    bool fIncludeEmpty = false;\n    if (!params[1].isNull())\n        fIncludeEmpty = params[1].get_bool();\n\n    isminefilter filter = ISMINE_SPENDABLE;\n    if(!params[2].isNull())\n        if(params[2].get_bool())\n            filter = filter | ISMINE_WATCH_ONLY;\n\n    // Tally\n    std::map<CTxDestination, tallyitem> mapTally;\n    for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {\n        const CWalletTx& wtx = pairWtx.second;\n\n        if (wtx.IsCoinBase() || !CheckFinalTx(*wtx.tx))\n            continue;\n\n        int nDepth = wtx.GetDepthInMainChain();\n        if (nDepth < nMinDepth)\n            continue;\n\n        for (const CTxOut& txout : wtx.tx->vout)\n        {\n            CTxDestination address;\n            if (!ExtractDestination(txout.scriptPubKey, address))\n                continue;\n\n            isminefilter mine = IsMine(*pwallet, address);\n            if(!(mine & filter))\n                continue;\n\n            tallyitem& item = mapTally[address];\n            item.nAmount += txout.nValue;\n            item.nConf = std::min(item.nConf, nDepth);\n            item.txids.push_back(wtx.GetHash());\n            if (mine & ISMINE_WATCH_ONLY)\n                item.fIsWatchonly = true;\n        }\n    }\n\n    // Reply\n    UniValue ret(UniValue::VARR);\n    std::map<std::string, tallyitem> mapAccountTally;\n    for (const std::pair<CTxDestination, CAddressBookData>& item : pwallet->mapAddressBook) {\n        const CTxDestination& dest = item.first;\n        const std::string& strAccount = item.second.name;\n        std::map<CTxDestination, tallyitem>::iterator it = mapTally.find(dest);\n        if (it == mapTally.end() && !fIncludeEmpty)\n            continue;\n\n        CAmount nAmount = 0;\n        int nConf = std::numeric_limits<int>::max();\n        bool fIsWatchonly = false;\n        if (it != mapTally.end())\n        {\n            nAmount = (*it).second.nAmount;\n            nConf = (*it).second.nConf;\n            fIsWatchonly = (*it).second.fIsWatchonly;\n        }\n\n        if (fByAccounts)\n        {\n            tallyitem& _item = mapAccountTally[strAccount];\n            _item.nAmount += nAmount;\n            _item.nConf = std::min(_item.nConf, nConf);\n            _item.fIsWatchonly = fIsWatchonly;\n        }\n        else\n        {\n            UniValue obj(UniValue::VOBJ);\n            if(fIsWatchonly)\n                obj.push_back(Pair(\"involvesWatchonly\", true));\n            obj.push_back(Pair(\"address\",       EncodeDestination(dest)));\n            obj.push_back(Pair(\"account\",       strAccount));\n            obj.push_back(Pair(\"amount\",        ValueFromAmount(nAmount)));\n            obj.push_back(Pair(\"confirmations\", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));\n            if (!fByAccounts)\n                obj.push_back(Pair(\"label\", strAccount));\n            UniValue transactions(UniValue::VARR);\n            if (it != mapTally.end())\n            {\n                for (const uint256& _item : (*it).second.txids)\n                {\n                    transactions.push_back(_item.GetHex());\n                }\n            }\n            obj.push_back(Pair(\"txids\", transactions));\n            ret.push_back(obj);\n        }\n    }\n\n    if (fByAccounts)\n    {\n        for (const auto& entry : mapAccountTally)\n        {\n            CAmount nAmount = entry.second.nAmount;\n            int nConf = entry.second.nConf;\n            UniValue obj(UniValue::VOBJ);\n            if (entry.second.fIsWatchonly)\n                obj.push_back(Pair(\"involvesWatchonly\", true));\n            obj.push_back(Pair(\"account\",       entry.first));\n            obj.push_back(Pair(\"amount\",        ValueFromAmount(nAmount)));\n            obj.push_back(Pair(\"confirmations\", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));\n            ret.push_back(obj);\n        }\n    }\n\n    return ret;\n}\n\nUniValue listreceivedbyaddress(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 3)\n        throw std::runtime_error(\n            \"listreceivedbyaddress ( minconf include_empty include_watchonly)\\n\"\n            \"\\nList balances by receiving address.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. minconf           (numeric, optional, default=1) The minimum number of confirmations before payments are included.\\n\"\n            \"2. include_empty     (bool, optional, default=false) Whether to include addresses that haven't received any payments.\\n\"\n            \"3. include_watchonly (bool, optional, default=false) Whether to include watch-only addresses (see 'importaddress').\\n\"\n\n            \"\\nResult:\\n\"\n            \"[\\n\"\n            \"  {\\n\"\n            \"    \\\"involvesWatchonly\\\" : true,        (bool) Only returned if imported addresses were involved in transaction\\n\"\n            \"    \\\"address\\\" : \\\"receivingaddress\\\",  (string) The receiving address\\n\"\n            \"    \\\"account\\\" : \\\"accountname\\\",       (string) DEPRECATED. The account of the receiving address. The default account is \\\"\\\".\\n\"\n            \"    \\\"amount\\\" : x.xxx,                  (numeric) The total amount in \" + CURRENCY_UNIT + \" received by the address\\n\"\n            \"    \\\"confirmations\\\" : n,               (numeric) The number of confirmations of the most recent transaction included\\n\"\n            \"    \\\"label\\\" : \\\"label\\\",               (string) A comment for the address/transaction, if any\\n\"\n            \"    \\\"txids\\\": [\\n\"\n            \"       \\\"txid\\\",                         (string) The ids of transactions received with the address \\n\"\n            \"       ...\\n\"\n            \"    ]\\n\"\n            \"  }\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"listreceivedbyaddress\", \"\")\n            + HelpExampleCli(\"listreceivedbyaddress\", \"6 true\")\n            + HelpExampleRpc(\"listreceivedbyaddress\", \"6, true, true\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    return ListReceived(pwallet, request.params, false);\n}\n\nUniValue listreceivedbyaccount(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 3)\n        throw std::runtime_error(\n            \"listreceivedbyaccount ( minconf include_empty include_watchonly)\\n\"\n            \"\\nDEPRECATED. List balances by account.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. minconf           (numeric, optional, default=1) The minimum number of confirmations before payments are included.\\n\"\n            \"2. include_empty     (bool, optional, default=false) Whether to include accounts that haven't received any payments.\\n\"\n            \"3. include_watchonly (bool, optional, default=false) Whether to include watch-only addresses (see 'importaddress').\\n\"\n\n            \"\\nResult:\\n\"\n            \"[\\n\"\n            \"  {\\n\"\n            \"    \\\"involvesWatchonly\\\" : true,   (bool) Only returned if imported addresses were involved in transaction\\n\"\n            \"    \\\"account\\\" : \\\"accountname\\\",  (string) The account name of the receiving account\\n\"\n            \"    \\\"amount\\\" : x.xxx,             (numeric) The total amount received by addresses with this account\\n\"\n            \"    \\\"confirmations\\\" : n,          (numeric) The number of confirmations of the most recent transaction included\\n\"\n            \"    \\\"label\\\" : \\\"label\\\"           (string) A comment for the address/transaction, if any\\n\"\n            \"  }\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"listreceivedbyaccount\", \"\")\n            + HelpExampleCli(\"listreceivedbyaccount\", \"6 true\")\n            + HelpExampleRpc(\"listreceivedbyaccount\", \"6, true, true\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    return ListReceived(pwallet, request.params, true);\n}\n\nstatic void MaybePushAddress(UniValue & entry, const CTxDestination &dest)\n{\n    if (IsValidDestination(dest)) {\n        entry.push_back(Pair(\"address\", EncodeDestination(dest)));\n    }\n}\n\n/**\n * List transactions based on the given criteria.\n *\n * @param  pwallet    The wallet.\n * @param  wtx        The wallet transaction.\n * @param  strAccount The account, if any, or \"*\" for all.\n * @param  nMinDepth  The minimum confirmation depth.\n * @param  fLong      Whether to include the JSON version of the transaction.\n * @param  ret        The UniValue into which the result is stored.\n * @param  filter     The \"is mine\" filter bool.\n */\nvoid ListTransactions(CWallet* const pwallet, const CWalletTx& wtx, const std::string& strAccount, int nMinDepth, bool fLong, UniValue& ret, const isminefilter& filter)\n{\n    CAmount nFee;\n    std::string strSentAccount;\n    std::list<COutputEntry> listReceived;\n    std::list<COutputEntry> listSent;\n\n    wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, filter);\n\n    bool fAllAccounts = (strAccount == std::string(\"*\"));\n    bool involvesWatchonly = wtx.IsFromMe(ISMINE_WATCH_ONLY);\n\n    // Sent\n    if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount))\n    {\n        for (const COutputEntry& s : listSent)\n        {\n            UniValue entry(UniValue::VOBJ);\n            if (involvesWatchonly || (::IsMine(*pwallet, s.destination) & ISMINE_WATCH_ONLY)) {\n                entry.push_back(Pair(\"involvesWatchonly\", true));\n            }\n            entry.push_back(Pair(\"account\", strSentAccount));\n            MaybePushAddress(entry, s.destination);\n            entry.push_back(Pair(\"category\", \"send\"));\n            entry.push_back(Pair(\"amount\", ValueFromAmount(-s.amount)));\n            if (pwallet->mapAddressBook.count(s.destination)) {\n                entry.push_back(Pair(\"label\", pwallet->mapAddressBook[s.destination].name));\n            }\n            entry.push_back(Pair(\"vout\", s.vout));\n            entry.push_back(Pair(\"fee\", ValueFromAmount(-nFee)));\n            if (fLong)\n                WalletTxToJSON(wtx, entry);\n            entry.push_back(Pair(\"abandoned\", wtx.isAbandoned()));\n            ret.push_back(entry);\n        }\n    }\n\n    // Received\n    if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth)\n    {\n        for (const COutputEntry& r : listReceived)\n        {\n            std::string account;\n            if (pwallet->mapAddressBook.count(r.destination)) {\n                account = pwallet->mapAddressBook[r.destination].name;\n            }\n            if (fAllAccounts || (account == strAccount))\n            {\n                UniValue entry(UniValue::VOBJ);\n                if (involvesWatchonly || (::IsMine(*pwallet, r.destination) & ISMINE_WATCH_ONLY)) {\n                    entry.push_back(Pair(\"involvesWatchonly\", true));\n                }\n                entry.push_back(Pair(\"account\", account));\n                MaybePushAddress(entry, r.destination);\n                if (wtx.IsCoinBase())\n                {\n                    if (wtx.GetDepthInMainChain() < 1)\n                        entry.push_back(Pair(\"category\", \"orphan\"));\n                    else if (wtx.GetBlocksToMaturity() > 0)\n                        entry.push_back(Pair(\"category\", \"immature\"));\n                    else\n                        entry.push_back(Pair(\"category\", \"generate\"));\n                }\n                else\n                {\n                    entry.push_back(Pair(\"category\", \"receive\"));\n                }\n                entry.push_back(Pair(\"amount\", ValueFromAmount(r.amount)));\n                if (pwallet->mapAddressBook.count(r.destination)) {\n                    entry.push_back(Pair(\"label\", account));\n                }\n                entry.push_back(Pair(\"vout\", r.vout));\n                if (fLong)\n                    WalletTxToJSON(wtx, entry);\n                ret.push_back(entry);\n            }\n        }\n    }\n}\n\nvoid AcentryToJSON(const CAccountingEntry& acentry, const std::string& strAccount, UniValue& ret)\n{\n    bool fAllAccounts = (strAccount == std::string(\"*\"));\n\n    if (fAllAccounts || acentry.strAccount == strAccount)\n    {\n        UniValue entry(UniValue::VOBJ);\n        entry.push_back(Pair(\"account\", acentry.strAccount));\n        entry.push_back(Pair(\"category\", \"move\"));\n        entry.push_back(Pair(\"time\", acentry.nTime));\n        entry.push_back(Pair(\"amount\", ValueFromAmount(acentry.nCreditDebit)));\n        entry.push_back(Pair(\"otheraccount\", acentry.strOtherAccount));\n        entry.push_back(Pair(\"comment\", acentry.strComment));\n        ret.push_back(entry);\n    }\n}\n\nUniValue listtransactions(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 4)\n        throw std::runtime_error(\n            \"listtransactions ( \\\"account\\\" count skip include_watchonly)\\n\"\n            \"\\nReturns up to 'count' most recent transactions skipping the first 'from' transactions for account 'account'.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"account\\\"    (string, optional) DEPRECATED. The account name. Should be \\\"*\\\".\\n\"\n            \"2. count          (numeric, optional, default=10) The number of transactions to return\\n\"\n            \"3. skip           (numeric, optional, default=0) The number of transactions to skip\\n\"\n            \"4. include_watchonly (bool, optional, default=false) Include transactions to watch-only addresses (see 'importaddress')\\n\"\n            \"\\nResult:\\n\"\n            \"[\\n\"\n            \"  {\\n\"\n            \"    \\\"account\\\":\\\"accountname\\\",       (string) DEPRECATED. The account name associated with the transaction. \\n\"\n            \"                                                It will be \\\"\\\" for the default account.\\n\"\n            \"    \\\"address\\\":\\\"address\\\",    (string) The sugarchain address of the transaction. Not present for \\n\"\n            \"                                                move transactions (category = move).\\n\"\n            \"    \\\"category\\\":\\\"send|receive|move\\\", (string) The transaction category. 'move' is a local (off blockchain)\\n\"\n            \"                                                transaction between accounts, and not associated with an address,\\n\"\n            \"                                                transaction id or block. 'send' and 'receive' transactions are \\n\"\n            \"                                                associated with an address, transaction id and block details\\n\"\n            \"    \\\"amount\\\": x.xxx,          (numeric) The amount in \" + CURRENCY_UNIT + \". This is negative for the 'send' category, and for the\\n\"\n            \"                                         'move' category for moves outbound. It is positive for the 'receive' category,\\n\"\n            \"                                         and for the 'move' category for inbound funds.\\n\"\n            \"    \\\"label\\\": \\\"label\\\",       (string) A comment for the address/transaction, if any\\n\"\n            \"    \\\"vout\\\": n,                (numeric) the vout value\\n\"\n            \"    \\\"fee\\\": x.xxx,             (numeric) The amount of the fee in \" + CURRENCY_UNIT + \". This is negative and only available for the \\n\"\n            \"                                         'send' category of transactions.\\n\"\n            \"    \\\"confirmations\\\": n,       (numeric) The number of confirmations for the transaction. Available for 'send' and \\n\"\n            \"                                         'receive' category of transactions. Negative confirmations indicate the\\n\"\n            \"                                         transaction conflicts with the block chain\\n\"\n            \"    \\\"trusted\\\": xxx,           (bool) Whether we consider the outputs of this unconfirmed transaction safe to spend.\\n\"\n            \"    \\\"blockhash\\\": \\\"hashvalue\\\", (string) The block hash containing the transaction. Available for 'send' and 'receive'\\n\"\n            \"                                          category of transactions.\\n\"\n            \"    \\\"blockindex\\\": n,          (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive'\\n\"\n            \"                                          category of transactions.\\n\"\n            \"    \\\"blocktime\\\": xxx,         (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\\n\"\n            \"    \\\"txid\\\": \\\"transactionid\\\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\\n\"\n            \"    \\\"time\\\": xxx,              (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\\n\"\n            \"    \\\"timereceived\\\": xxx,      (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available \\n\"\n            \"                                          for 'send' and 'receive' category of transactions.\\n\"\n            \"    \\\"comment\\\": \\\"...\\\",       (string) If a comment is associated with the transaction.\\n\"\n            \"    \\\"otheraccount\\\": \\\"accountname\\\",  (string) DEPRECATED. For the 'move' category of transactions, the account the funds came \\n\"\n            \"                                          from (for receiving funds, positive amounts), or went to (for sending funds,\\n\"\n            \"                                          negative amounts).\\n\"\n            \"    \\\"bip125-replaceable\\\": \\\"yes|no|unknown\\\",  (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\\n\"\n            \"                                                     may be unknown for unconfirmed transactions not in the mempool\\n\"\n            \"    \\\"abandoned\\\": xxx          (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \\n\"\n            \"                                         'send' category of transactions.\\n\"\n            \"  }\\n\"\n            \"]\\n\"\n\n            \"\\nExamples:\\n\"\n            \"\\nList the most recent 10 transactions in the systems\\n\"\n            + HelpExampleCli(\"listtransactions\", \"\") +\n            \"\\nList transactions 100 to 120\\n\"\n            + HelpExampleCli(\"listtransactions\", \"\\\"*\\\" 20 100\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"listtransactions\", \"\\\"*\\\", 20, 100\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    std::string strAccount = \"*\";\n    if (!request.params[0].isNull())\n        strAccount = request.params[0].get_str();\n    int nCount = 10;\n    if (!request.params[1].isNull())\n        nCount = request.params[1].get_int();\n    int nFrom = 0;\n    if (!request.params[2].isNull())\n        nFrom = request.params[2].get_int();\n    isminefilter filter = ISMINE_SPENDABLE;\n    if(!request.params[3].isNull())\n        if(request.params[3].get_bool())\n            filter = filter | ISMINE_WATCH_ONLY;\n\n    if (nCount < 0)\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Negative count\");\n    if (nFrom < 0)\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Negative from\");\n\n    UniValue ret(UniValue::VARR);\n\n    const CWallet::TxItems & txOrdered = pwallet->wtxOrdered;\n\n    // iterate backwards until we have nCount items to return:\n    for (CWallet::TxItems::const_reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)\n    {\n        CWalletTx *const pwtx = (*it).second.first;\n        if (pwtx != nullptr)\n            ListTransactions(pwallet, *pwtx, strAccount, 0, true, ret, filter);\n        CAccountingEntry *const pacentry = (*it).second.second;\n        if (pacentry != nullptr)\n            AcentryToJSON(*pacentry, strAccount, ret);\n\n        if ((int)ret.size() >= (nCount+nFrom)) break;\n    }\n    // ret is newest to oldest\n\n    if (nFrom > (int)ret.size())\n        nFrom = ret.size();\n    if ((nFrom + nCount) > (int)ret.size())\n        nCount = ret.size() - nFrom;\n\n    std::vector<UniValue> arrTmp = ret.getValues();\n\n    std::vector<UniValue>::iterator first = arrTmp.begin();\n    std::advance(first, nFrom);\n    std::vector<UniValue>::iterator last = arrTmp.begin();\n    std::advance(last, nFrom+nCount);\n\n    if (last != arrTmp.end()) arrTmp.erase(last, arrTmp.end());\n    if (first != arrTmp.begin()) arrTmp.erase(arrTmp.begin(), first);\n\n    std::reverse(arrTmp.begin(), arrTmp.end()); // Return oldest to newest\n\n    ret.clear();\n    ret.setArray();\n    ret.push_backV(arrTmp);\n\n    return ret;\n}\n\nUniValue listaccounts(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 2)\n        throw std::runtime_error(\n            \"listaccounts ( minconf include_watchonly)\\n\"\n            \"\\nDEPRECATED. Returns Object that has account names as keys, account balances as values.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. minconf             (numeric, optional, default=1) Only include transactions with at least this many confirmations\\n\"\n            \"2. include_watchonly   (bool, optional, default=false) Include balances in watch-only addresses (see 'importaddress')\\n\"\n            \"\\nResult:\\n\"\n            \"{                      (json object where keys are account names, and values are numeric balances\\n\"\n            \"  \\\"account\\\": x.xxx,  (numeric) The property name is the account name, and the value is the total balance for the account.\\n\"\n            \"  ...\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nList account balances where there at least 1 confirmation\\n\"\n            + HelpExampleCli(\"listaccounts\", \"\") +\n            \"\\nList account balances including zero confirmation transactions\\n\"\n            + HelpExampleCli(\"listaccounts\", \"0\") +\n            \"\\nList account balances for 6 or more confirmations\\n\"\n            + HelpExampleCli(\"listaccounts\", \"6\") +\n            \"\\nAs json rpc call\\n\"\n            + HelpExampleRpc(\"listaccounts\", \"6\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    int nMinDepth = 1;\n    if (!request.params[0].isNull())\n        nMinDepth = request.params[0].get_int();\n    isminefilter includeWatchonly = ISMINE_SPENDABLE;\n    if(!request.params[1].isNull())\n        if(request.params[1].get_bool())\n            includeWatchonly = includeWatchonly | ISMINE_WATCH_ONLY;\n\n    std::map<std::string, CAmount> mapAccountBalances;\n    for (const std::pair<CTxDestination, CAddressBookData>& entry : pwallet->mapAddressBook) {\n        if (IsMine(*pwallet, entry.first) & includeWatchonly) {  // This address belongs to me\n            mapAccountBalances[entry.second.name] = 0;\n        }\n    }\n\n    for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {\n        const CWalletTx& wtx = pairWtx.second;\n        CAmount nFee;\n        std::string strSentAccount;\n        std::list<COutputEntry> listReceived;\n        std::list<COutputEntry> listSent;\n        int nDepth = wtx.GetDepthInMainChain();\n        if (wtx.GetBlocksToMaturity() > 0 || nDepth < 0)\n            continue;\n        wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount, includeWatchonly);\n        mapAccountBalances[strSentAccount] -= nFee;\n        for (const COutputEntry& s : listSent)\n            mapAccountBalances[strSentAccount] -= s.amount;\n        if (nDepth >= nMinDepth)\n        {\n            for (const COutputEntry& r : listReceived)\n                if (pwallet->mapAddressBook.count(r.destination)) {\n                    mapAccountBalances[pwallet->mapAddressBook[r.destination].name] += r.amount;\n                }\n                else\n                    mapAccountBalances[\"\"] += r.amount;\n        }\n    }\n\n    const std::list<CAccountingEntry>& acentries = pwallet->laccentries;\n    for (const CAccountingEntry& entry : acentries)\n        mapAccountBalances[entry.strAccount] += entry.nCreditDebit;\n\n    UniValue ret(UniValue::VOBJ);\n    for (const std::pair<std::string, CAmount>& accountBalance : mapAccountBalances) {\n        ret.push_back(Pair(accountBalance.first, ValueFromAmount(accountBalance.second)));\n    }\n    return ret;\n}\n\nUniValue listsinceblock(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 4)\n        throw std::runtime_error(\n            \"listsinceblock ( \\\"blockhash\\\" target_confirmations include_watchonly include_removed )\\n\"\n            \"\\nGet all transactions in blocks since block [blockhash], or all transactions if omitted.\\n\"\n            \"If \\\"blockhash\\\" is no longer a part of the main chain, transactions from the fork point onward are included.\\n\"\n            \"Additionally, if include_removed is set, transactions affecting the wallet which were removed are returned in the \\\"removed\\\" array.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"blockhash\\\"            (string, optional) The block hash to list transactions since\\n\"\n            \"2. target_confirmations:    (numeric, optional, default=1) Return the nth block hash from the main chain. e.g. 1 would mean the best block hash. Note: this is not used as a filter, but only affects [lastblock] in the return value\\n\"\n            \"3. include_watchonly:       (bool, optional, default=false) Include transactions to watch-only addresses (see 'importaddress')\\n\"\n            \"4. include_removed:         (bool, optional, default=true) Show transactions that were removed due to a reorg in the \\\"removed\\\" array\\n\"\n            \"                                                           (not guaranteed to work on pruned nodes)\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"transactions\\\": [\\n\"\n            \"    \\\"account\\\":\\\"accountname\\\",       (string) DEPRECATED. The account name associated with the transaction. Will be \\\"\\\" for the default account.\\n\"\n            \"    \\\"address\\\":\\\"address\\\",    (string) The sugarchain address of the transaction. Not present for move transactions (category = move).\\n\"\n            \"    \\\"category\\\":\\\"send|receive\\\",     (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.\\n\"\n            \"    \\\"amount\\\": x.xxx,          (numeric) The amount in \" + CURRENCY_UNIT + \". This is negative for the 'send' category, and for the 'move' category for moves \\n\"\n            \"                                          outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds.\\n\"\n            \"    \\\"vout\\\" : n,               (numeric) the vout value\\n\"\n            \"    \\\"fee\\\": x.xxx,             (numeric) The amount of the fee in \" + CURRENCY_UNIT + \". This is negative and only available for the 'send' category of transactions.\\n\"\n            \"    \\\"confirmations\\\": n,       (numeric) The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\\n\"\n            \"                                          When it's < 0, it means the transaction conflicted that many blocks ago.\\n\"\n            \"    \\\"blockhash\\\": \\\"hashvalue\\\",     (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\\n\"\n            \"    \\\"blockindex\\\": n,          (numeric) The index of the transaction in the block that includes it. Available for 'send' and 'receive' category of transactions.\\n\"\n            \"    \\\"blocktime\\\": xxx,         (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\\n\"\n            \"    \\\"txid\\\": \\\"transactionid\\\",  (string) The transaction id. Available for 'send' and 'receive' category of transactions.\\n\"\n            \"    \\\"time\\\": xxx,              (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\\n\"\n            \"    \\\"timereceived\\\": xxx,      (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.\\n\"\n            \"    \\\"bip125-replaceable\\\": \\\"yes|no|unknown\\\",  (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\\n\"\n            \"                                                   may be unknown for unconfirmed transactions not in the mempool\\n\"\n            \"    \\\"abandoned\\\": xxx,         (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.\\n\"\n            \"    \\\"comment\\\": \\\"...\\\",       (string) If a comment is associated with the transaction.\\n\"\n            \"    \\\"label\\\" : \\\"label\\\"       (string) A comment for the address/transaction, if any\\n\"\n            \"    \\\"to\\\": \\\"...\\\",            (string) If a comment to is associated with the transaction.\\n\"\n            \"  ],\\n\"\n            \"  \\\"removed\\\": [\\n\"\n            \"    <structure is the same as \\\"transactions\\\" above, only present if include_removed=true>\\n\"\n            \"    Note: transactions that were readded in the active chain will appear as-is in this array, and may thus have a positive confirmation count.\\n\"\n            \"  ],\\n\"\n            \"  \\\"lastblock\\\": \\\"lastblockhash\\\"     (string) The hash of the block (target_confirmations-1) from the best block on the main chain. This is typically used to feed back into listsinceblock the next time you call it. So you would generally use a target_confirmations of say 6, so you will be continually re-notified of transactions until they've reached 6 confirmations plus any new ones\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"listsinceblock\", \"\")\n            + HelpExampleCli(\"listsinceblock\", \"\\\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\\\" 6\")\n            + HelpExampleRpc(\"listsinceblock\", \"\\\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\\\", 6\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    const CBlockIndex* pindex = nullptr;    // Block index of the specified block or the common ancestor, if the block provided was in a deactivated chain.\n    const CBlockIndex* paltindex = nullptr; // Block index of the specified block, even if it's in a deactivated chain.\n    int target_confirms = 1;\n    isminefilter filter = ISMINE_SPENDABLE;\n\n    if (!request.params[0].isNull() && !request.params[0].get_str().empty()) {\n        uint256 blockId;\n\n        blockId.SetHex(request.params[0].get_str());\n        BlockMap::iterator it = mapBlockIndex.find(blockId);\n        if (it == mapBlockIndex.end()) {\n            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Block not found\");\n        }\n        paltindex = pindex = it->second;\n        if (chainActive[pindex->nHeight] != pindex) {\n            // the block being asked for is a part of a deactivated chain;\n            // we don't want to depend on its perceived height in the block\n            // chain, we want to instead use the last common ancestor\n            pindex = chainActive.FindFork(pindex);\n        }\n    }\n\n    if (!request.params[1].isNull()) {\n        target_confirms = request.params[1].get_int();\n\n        if (target_confirms < 1) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter\");\n        }\n    }\n\n    if (!request.params[2].isNull() && request.params[2].get_bool()) {\n        filter = filter | ISMINE_WATCH_ONLY;\n    }\n\n    bool include_removed = (request.params[3].isNull() || request.params[3].get_bool());\n\n    int depth = pindex ? (1 + chainActive.Height() - pindex->nHeight) : -1;\n\n    UniValue transactions(UniValue::VARR);\n\n    for (const std::pair<uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {\n        CWalletTx tx = pairWtx.second;\n\n        if (depth == -1 || tx.GetDepthInMainChain() < depth) {\n            ListTransactions(pwallet, tx, \"*\", 0, true, transactions, filter);\n        }\n    }\n\n    // when a reorg'd block is requested, we also list any relevant transactions\n    // in the blocks of the chain that was detached\n    UniValue removed(UniValue::VARR);\n    while (include_removed && paltindex && paltindex != pindex) {\n        CBlock block;\n        if (!ReadBlockFromDisk(block, paltindex, Params().GetConsensus())) {\n            throw JSONRPCError(RPC_INTERNAL_ERROR, \"Can't read block from disk\");\n        }\n        for (const CTransactionRef& tx : block.vtx) {\n            auto it = pwallet->mapWallet.find(tx->GetHash());\n            if (it != pwallet->mapWallet.end()) {\n                // We want all transactions regardless of confirmation count to appear here,\n                // even negative confirmation ones, hence the big negative.\n                ListTransactions(pwallet, it->second, \"*\", -100000000, true, removed, filter);\n            }\n        }\n        paltindex = paltindex->pprev;\n    }\n\n    CBlockIndex *pblockLast = chainActive[chainActive.Height() + 1 - target_confirms];\n    uint256 lastblock = pblockLast ? pblockLast->GetBlockHash() : uint256();\n\n    UniValue ret(UniValue::VOBJ);\n    ret.push_back(Pair(\"transactions\", transactions));\n    if (include_removed) ret.push_back(Pair(\"removed\", removed));\n    ret.push_back(Pair(\"lastblock\", lastblock.GetHex()));\n\n    return ret;\n}\n\nUniValue gettransaction(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"gettransaction \\\"txid\\\" ( include_watchonly )\\n\"\n            \"\\nGet detailed information about in-wallet transaction <txid>\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"txid\\\"                  (string, required) The transaction id\\n\"\n            \"2. \\\"include_watchonly\\\"     (bool, optional, default=false) Whether to include watch-only addresses in balance calculation and details[]\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"amount\\\" : x.xxx,        (numeric) The transaction amount in \" + CURRENCY_UNIT + \"\\n\"\n            \"  \\\"fee\\\": x.xxx,            (numeric) The amount of the fee in \" + CURRENCY_UNIT + \". This is negative and only available for the \\n\"\n            \"                              'send' category of transactions.\\n\"\n            \"  \\\"confirmations\\\" : n,     (numeric) The number of confirmations\\n\"\n            \"  \\\"blockhash\\\" : \\\"hash\\\",  (string) The block hash\\n\"\n            \"  \\\"blockindex\\\" : xx,       (numeric) The index of the transaction in the block that includes it\\n\"\n            \"  \\\"blocktime\\\" : ttt,       (numeric) The time in seconds since epoch (1 Jan 1970 GMT)\\n\"\n            \"  \\\"txid\\\" : \\\"transactionid\\\",   (string) The transaction id.\\n\"\n            \"  \\\"time\\\" : ttt,            (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\\n\"\n            \"  \\\"timereceived\\\" : ttt,    (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\\n\"\n            \"  \\\"bip125-replaceable\\\": \\\"yes|no|unknown\\\",  (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);\\n\"\n            \"                                                   may be unknown for unconfirmed transactions not in the mempool\\n\"\n            \"  \\\"details\\\" : [\\n\"\n            \"    {\\n\"\n            \"      \\\"account\\\" : \\\"accountname\\\",      (string) DEPRECATED. The account name involved in the transaction, can be \\\"\\\" for the default account.\\n\"\n            \"      \\\"address\\\" : \\\"address\\\",          (string) The sugarchain address involved in the transaction\\n\"\n            \"      \\\"category\\\" : \\\"send|receive\\\",    (string) The category, either 'send' or 'receive'\\n\"\n            \"      \\\"amount\\\" : x.xxx,                 (numeric) The amount in \" + CURRENCY_UNIT + \"\\n\"\n            \"      \\\"label\\\" : \\\"label\\\",              (string) A comment for the address/transaction, if any\\n\"\n            \"      \\\"vout\\\" : n,                       (numeric) the vout value\\n\"\n            \"      \\\"fee\\\": x.xxx,                     (numeric) The amount of the fee in \" + CURRENCY_UNIT + \". This is negative and only available for the \\n\"\n            \"                                           'send' category of transactions.\\n\"\n            \"      \\\"abandoned\\\": xxx                  (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the \\n\"\n            \"                                           'send' category of transactions.\\n\"\n            \"    }\\n\"\n            \"    ,...\\n\"\n            \"  ],\\n\"\n            \"  \\\"hex\\\" : \\\"data\\\"         (string) Raw data for transaction\\n\"\n            \"}\\n\"\n\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"gettransaction\", \"\\\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\\\"\")\n            + HelpExampleCli(\"gettransaction\", \"\\\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\\\" true\")\n            + HelpExampleRpc(\"gettransaction\", \"\\\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\\\"\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    uint256 hash;\n    hash.SetHex(request.params[0].get_str());\n\n    isminefilter filter = ISMINE_SPENDABLE;\n    if(!request.params[1].isNull())\n        if(request.params[1].get_bool())\n            filter = filter | ISMINE_WATCH_ONLY;\n\n    UniValue entry(UniValue::VOBJ);\n    auto it = pwallet->mapWallet.find(hash);\n    if (it == pwallet->mapWallet.end()) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid or non-wallet transaction id\");\n    }\n    const CWalletTx& wtx = it->second;\n\n    CAmount nCredit = wtx.GetCredit(filter);\n    CAmount nDebit = wtx.GetDebit(filter);\n    CAmount nNet = nCredit - nDebit;\n    CAmount nFee = (wtx.IsFromMe(filter) ? wtx.tx->GetValueOut() - nDebit : 0);\n\n    entry.push_back(Pair(\"amount\", ValueFromAmount(nNet - nFee)));\n    if (wtx.IsFromMe(filter))\n        entry.push_back(Pair(\"fee\", ValueFromAmount(nFee)));\n\n    WalletTxToJSON(wtx, entry);\n\n    UniValue details(UniValue::VARR);\n    ListTransactions(pwallet, wtx, \"*\", 0, false, details, filter);\n    entry.push_back(Pair(\"details\", details));\n\n    std::string strHex = EncodeHexTx(*wtx.tx, RPCSerializationFlags());\n    entry.push_back(Pair(\"hex\", strHex));\n\n    return entry;\n}\n\nUniValue abandontransaction(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"abandontransaction \\\"txid\\\"\\n\"\n            \"\\nMark in-wallet transaction <txid> as abandoned\\n\"\n            \"This will mark this transaction and all its in-wallet descendants as abandoned which will allow\\n\"\n            \"for their inputs to be respent.  It can be used to replace \\\"stuck\\\" or evicted transactions.\\n\"\n            \"It only works on transactions which are not included in a block and are not currently in the mempool.\\n\"\n            \"It has no effect on transactions which are already conflicted or abandoned.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"txid\\\"    (string, required) The transaction id\\n\"\n            \"\\nResult:\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"abandontransaction\", \"\\\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\\\"\")\n            + HelpExampleRpc(\"abandontransaction\", \"\\\"1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d\\\"\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    uint256 hash;\n    hash.SetHex(request.params[0].get_str());\n\n    if (!pwallet->mapWallet.count(hash)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Invalid or non-wallet transaction id\");\n    }\n    if (!pwallet->AbandonTransaction(hash)) {\n        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"Transaction not eligible for abandonment\");\n    }\n\n    return NullUniValue;\n}\n\n\nUniValue backupwallet(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 1)\n        throw std::runtime_error(\n            \"backupwallet \\\"destination\\\"\\n\"\n            \"\\nSafely copies current wallet file to destination, which can be a directory or a path with filename.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"destination\\\"   (string) The destination directory or file\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"backupwallet\", \"\\\"backup.dat\\\"\")\n            + HelpExampleRpc(\"backupwallet\", \"\\\"backup.dat\\\"\")\n        );\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    std::string strDest = request.params[0].get_str();\n    if (!pwallet->BackupWallet(strDest)) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Error: Wallet backup failed!\");\n    }\n\n    return NullUniValue;\n}\n\n\nUniValue keypoolrefill(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 1)\n        throw std::runtime_error(\n            \"keypoolrefill ( newsize )\\n\"\n            \"\\nFills the keypool.\"\n            + HelpRequiringPassphrase(pwallet) + \"\\n\"\n            \"\\nArguments\\n\"\n            \"1. newsize     (numeric, optional, default=100) The new keypool size\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"keypoolrefill\", \"\")\n            + HelpExampleRpc(\"keypoolrefill\", \"\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    // 0 is interpreted by TopUpKeyPool() as the default keypool size given by -keypool\n    unsigned int kpSize = 0;\n    if (!request.params[0].isNull()) {\n        if (request.params[0].get_int() < 0)\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, expected valid size.\");\n        kpSize = (unsigned int)request.params[0].get_int();\n    }\n\n    EnsureWalletIsUnlocked(pwallet);\n    pwallet->TopUpKeyPool(kpSize);\n\n    if (pwallet->GetKeyPoolSize() < kpSize) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Error refreshing keypool.\");\n    }\n\n    return NullUniValue;\n}\n\n\nstatic void LockWallet(CWallet* pWallet)\n{\n    LOCK(pWallet->cs_wallet);\n    pWallet->nRelockTime = 0;\n    pWallet->Lock();\n}\n\nUniValue walletpassphrase(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 2) {\n        throw std::runtime_error(\n            \"walletpassphrase \\\"passphrase\\\" timeout\\n\"\n            \"\\nStores the wallet decryption key in memory for 'timeout' seconds.\\n\"\n            \"This is needed prior to performing transactions related to private keys such as sending sugarchains\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"passphrase\\\"     (string, required) The wallet passphrase\\n\"\n            \"2. timeout            (numeric, required) The time to keep the decryption key in seconds; capped at 100000000 (~3 years).\\n\"\n            \"\\nNote:\\n\"\n            \"Issuing the walletpassphrase command while the wallet is already unlocked will set a new unlock\\n\"\n            \"time that overrides the old one.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nUnlock the wallet for 60 seconds\\n\"\n            + HelpExampleCli(\"walletpassphrase\", \"\\\"my pass phrase\\\" 60\") +\n            \"\\nLock the wallet again (before 60 seconds)\\n\"\n            + HelpExampleCli(\"walletlock\", \"\") +\n            \"\\nAs json rpc call\\n\"\n            + HelpExampleRpc(\"walletpassphrase\", \"\\\"my pass phrase\\\", 60\")\n        );\n    }\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    if (request.fHelp)\n        return true;\n    if (!pwallet->IsCrypted()) {\n        throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, \"Error: running with an unencrypted wallet, but walletpassphrase was called.\");\n    }\n\n    // Note that the walletpassphrase is stored in request.params[0] which is not mlock()ed\n    SecureString strWalletPass;\n    strWalletPass.reserve(100);\n    // TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)\n    // Alternately, find a way to make request.params[0] mlock()'d to begin with.\n    strWalletPass = request.params[0].get_str().c_str();\n\n    // Get the timeout\n    int64_t nSleepTime = request.params[1].get_int64();\n    // Timeout cannot be negative, otherwise it will relock immediately\n    if (nSleepTime < 0) {\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"Timeout cannot be negative.\");\n    }\n    // Clamp timeout\n    constexpr int64_t MAX_SLEEP_TIME = 100000000; // larger values trigger a macos/libevent bug?\n    if (nSleepTime > MAX_SLEEP_TIME) {\n        nSleepTime = MAX_SLEEP_TIME;\n    }\n\n    if (strWalletPass.length() > 0)\n    {\n        if (!pwallet->Unlock(strWalletPass)) {\n            throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, \"Error: The wallet passphrase entered was incorrect.\");\n        }\n    }\n    else\n        throw std::runtime_error(\n            \"walletpassphrase <passphrase> <timeout>\\n\"\n            \"Stores the wallet decryption key in memory for <timeout> seconds.\");\n\n    pwallet->TopUpKeyPool();\n\n    pwallet->nRelockTime = GetTime() + nSleepTime;\n    RPCRunLater(strprintf(\"lockwallet(%s)\", pwallet->GetName()), boost::bind(LockWallet, pwallet), nSleepTime);\n\n    return NullUniValue;\n}\n\n\nUniValue walletpassphrasechange(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 2) {\n        throw std::runtime_error(\n            \"walletpassphrasechange \\\"oldpassphrase\\\" \\\"newpassphrase\\\"\\n\"\n            \"\\nChanges the wallet passphrase from 'oldpassphrase' to 'newpassphrase'.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"oldpassphrase\\\"      (string) The current passphrase\\n\"\n            \"2. \\\"newpassphrase\\\"      (string) The new passphrase\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"walletpassphrasechange\", \"\\\"old one\\\" \\\"new one\\\"\")\n            + HelpExampleRpc(\"walletpassphrasechange\", \"\\\"old one\\\", \\\"new one\\\"\")\n        );\n    }\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    if (request.fHelp)\n        return true;\n    if (!pwallet->IsCrypted()) {\n        throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, \"Error: running with an unencrypted wallet, but walletpassphrasechange was called.\");\n    }\n\n    // TODO: get rid of these .c_str() calls by implementing SecureString::operator=(std::string)\n    // Alternately, find a way to make request.params[0] mlock()'d to begin with.\n    SecureString strOldWalletPass;\n    strOldWalletPass.reserve(100);\n    strOldWalletPass = request.params[0].get_str().c_str();\n\n    SecureString strNewWalletPass;\n    strNewWalletPass.reserve(100);\n    strNewWalletPass = request.params[1].get_str().c_str();\n\n    if (strOldWalletPass.length() < 1 || strNewWalletPass.length() < 1)\n        throw std::runtime_error(\n            \"walletpassphrasechange <oldpassphrase> <newpassphrase>\\n\"\n            \"Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.\");\n\n    if (!pwallet->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass)) {\n        throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, \"Error: The wallet passphrase entered was incorrect.\");\n    }\n\n    return NullUniValue;\n}\n\n\nUniValue walletlock(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 0) {\n        throw std::runtime_error(\n            \"walletlock\\n\"\n            \"\\nRemoves the wallet encryption key from memory, locking the wallet.\\n\"\n            \"After calling this method, you will need to call walletpassphrase again\\n\"\n            \"before being able to call any methods which require the wallet to be unlocked.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nSet the passphrase for 2 minutes to perform a transaction\\n\"\n            + HelpExampleCli(\"walletpassphrase\", \"\\\"my pass phrase\\\" 120\") +\n            \"\\nPerform a send (requires passphrase set)\\n\"\n            + HelpExampleCli(\"sendtoaddress\", \"\\\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\\\" 1.0\") +\n            \"\\nClear the passphrase since we are done before 2 minutes is up\\n\"\n            + HelpExampleCli(\"walletlock\", \"\") +\n            \"\\nAs json rpc call\\n\"\n            + HelpExampleRpc(\"walletlock\", \"\")\n        );\n    }\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    if (request.fHelp)\n        return true;\n    if (!pwallet->IsCrypted()) {\n        throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, \"Error: running with an unencrypted wallet, but walletlock was called.\");\n    }\n\n    pwallet->Lock();\n    pwallet->nRelockTime = 0;\n\n    return NullUniValue;\n}\n\n\nUniValue encryptwallet(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 1) {\n        throw std::runtime_error(\n            \"encryptwallet \\\"passphrase\\\"\\n\"\n            \"\\nEncrypts the wallet with 'passphrase'. This is for first time encryption.\\n\"\n            \"After this, any calls that interact with private keys such as sending or signing \\n\"\n            \"will require the passphrase to be set prior the making these calls.\\n\"\n            \"Use the walletpassphrase call for this, and then walletlock call.\\n\"\n            \"If the wallet is already encrypted, use the walletpassphrasechange call.\\n\"\n            \"Note that this will shutdown the server.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"passphrase\\\"    (string) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nEncrypt your wallet\\n\"\n            + HelpExampleCli(\"encryptwallet\", \"\\\"my pass phrase\\\"\") +\n            \"\\nNow set the passphrase to use the wallet, such as for signing or sending sugarchain\\n\"\n            + HelpExampleCli(\"walletpassphrase\", \"\\\"my pass phrase\\\"\") +\n            \"\\nNow we can do something like sign\\n\"\n            + HelpExampleCli(\"signmessage\", \"\\\"address\\\" \\\"test message\\\"\") +\n            \"\\nNow lock the wallet again by removing the passphrase\\n\"\n            + HelpExampleCli(\"walletlock\", \"\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"encryptwallet\", \"\\\"my pass phrase\\\"\")\n        );\n    }\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    if (request.fHelp)\n        return true;\n    if (pwallet->IsCrypted()) {\n        throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, \"Error: running with an encrypted wallet, but encryptwallet was called.\");\n    }\n\n    // TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)\n    // Alternately, find a way to make request.params[0] mlock()'d to begin with.\n    SecureString strWalletPass;\n    strWalletPass.reserve(100);\n    strWalletPass = request.params[0].get_str().c_str();\n\n    if (strWalletPass.length() < 1)\n        throw std::runtime_error(\n            \"encryptwallet <passphrase>\\n\"\n            \"Encrypts the wallet with <passphrase>.\");\n\n    if (!pwallet->EncryptWallet(strWalletPass)) {\n        throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, \"Error: Failed to encrypt the wallet.\");\n    }\n\n    // BDB seems to have a bad habit of writing old data into\n    // slack space in .dat files; that is bad if the old data is\n    // unencrypted private keys. So:\n    StartShutdown();\n    return \"wallet encrypted; Sugarchain server stopping, restart to run with encrypted wallet. The keypool has been flushed and a new HD seed was generated (if you are using HD). You need to make a new backup.\";\n}\n\nUniValue lockunspent(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2)\n        throw std::runtime_error(\n            \"lockunspent unlock ([{\\\"txid\\\":\\\"txid\\\",\\\"vout\\\":n},...])\\n\"\n            \"\\nUpdates list of temporarily unspendable outputs.\\n\"\n            \"Temporarily lock (unlock=false) or unlock (unlock=true) specified transaction outputs.\\n\"\n            \"If no transaction outputs are specified when unlocking then all current locked transaction outputs are unlocked.\\n\"\n            \"A locked transaction output will not be chosen by automatic coin selection, when spending sugarchains.\\n\"\n            \"Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list\\n\"\n            \"is always cleared (by virtue of process exit) when a node stops or fails.\\n\"\n            \"Also see the listunspent call\\n\"\n            \"\\nArguments:\\n\"\n            \"1. unlock            (boolean, required) Whether to unlock (true) or lock (false) the specified transactions\\n\"\n            \"2. \\\"transactions\\\"  (string, optional) A json array of objects. Each object the txid (string) vout (numeric)\\n\"\n            \"     [           (json array of json objects)\\n\"\n            \"       {\\n\"\n            \"         \\\"txid\\\":\\\"id\\\",    (string) The transaction id\\n\"\n            \"         \\\"vout\\\": n         (numeric) The output number\\n\"\n            \"       }\\n\"\n            \"       ,...\\n\"\n            \"     ]\\n\"\n\n            \"\\nResult:\\n\"\n            \"true|false    (boolean) Whether the command was successful or not\\n\"\n\n            \"\\nExamples:\\n\"\n            \"\\nList the unspent transactions\\n\"\n            + HelpExampleCli(\"listunspent\", \"\") +\n            \"\\nLock an unspent transaction\\n\"\n            + HelpExampleCli(\"lockunspent\", \"false \\\"[{\\\\\\\"txid\\\\\\\":\\\\\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\\\\\",\\\\\\\"vout\\\\\\\":1}]\\\"\") +\n            \"\\nList the locked transactions\\n\"\n            + HelpExampleCli(\"listlockunspent\", \"\") +\n            \"\\nUnlock the transaction again\\n\"\n            + HelpExampleCli(\"lockunspent\", \"true \\\"[{\\\\\\\"txid\\\\\\\":\\\\\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\\\\\",\\\\\\\"vout\\\\\\\":1}]\\\"\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"lockunspent\", \"false, \\\"[{\\\\\\\"txid\\\\\\\":\\\\\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\\\\\",\\\\\\\"vout\\\\\\\":1}]\\\"\")\n        );\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    RPCTypeCheckArgument(request.params[0], UniValue::VBOOL);\n\n    bool fUnlock = request.params[0].get_bool();\n\n    if (request.params[1].isNull()) {\n        if (fUnlock)\n            pwallet->UnlockAllCoins();\n        return true;\n    }\n\n    RPCTypeCheckArgument(request.params[1], UniValue::VARR);\n\n    const UniValue& output_params = request.params[1];\n\n    // Create and validate the COutPoints first.\n\n    std::vector<COutPoint> outputs;\n    outputs.reserve(output_params.size());\n\n    for (unsigned int idx = 0; idx < output_params.size(); idx++) {\n        const UniValue& o = output_params[idx].get_obj();\n\n        RPCTypeCheckObj(o,\n            {\n                {\"txid\", UniValueType(UniValue::VSTR)},\n                {\"vout\", UniValueType(UniValue::VNUM)},\n            });\n\n        const std::string& txid = find_value(o, \"txid\").get_str();\n        if (!IsHex(txid)) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, expected hex txid\");\n        }\n\n        const int nOutput = find_value(o, \"vout\").get_int();\n        if (nOutput < 0) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, vout must be positive\");\n        }\n\n        const COutPoint outpt(uint256S(txid), nOutput);\n\n        const auto it = pwallet->mapWallet.find(outpt.hash);\n        if (it == pwallet->mapWallet.end()) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, unknown transaction\");\n        }\n\n        const CWalletTx& trans = it->second;\n\n        if (outpt.n >= trans.tx->vout.size()) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, vout index out of bounds\");\n        }\n\n        if (pwallet->IsSpent(outpt.hash, outpt.n)) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, expected unspent output\");\n        }\n\n        const bool is_locked = pwallet->IsLockedCoin(outpt.hash, outpt.n);\n\n        if (fUnlock && !is_locked) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, expected locked output\");\n        }\n\n        if (!fUnlock && is_locked) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid parameter, output already locked\");\n        }\n\n        outputs.push_back(outpt);\n    }\n\n    // Atomically set (un)locked status for the outputs.\n    for (const COutPoint& outpt : outputs) {\n        if (fUnlock) pwallet->UnlockCoin(outpt);\n        else pwallet->LockCoin(outpt);\n    }\n\n    return true;\n}\n\nUniValue listlockunspent(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 0)\n        throw std::runtime_error(\n            \"listlockunspent\\n\"\n            \"\\nReturns list of temporarily unspendable outputs.\\n\"\n            \"See the lockunspent call to lock and unlock transactions for spending.\\n\"\n            \"\\nResult:\\n\"\n            \"[\\n\"\n            \"  {\\n\"\n            \"    \\\"txid\\\" : \\\"transactionid\\\",     (string) The transaction id locked\\n\"\n            \"    \\\"vout\\\" : n                      (numeric) The vout value\\n\"\n            \"  }\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nList the unspent transactions\\n\"\n            + HelpExampleCli(\"listunspent\", \"\") +\n            \"\\nLock an unspent transaction\\n\"\n            + HelpExampleCli(\"lockunspent\", \"false \\\"[{\\\\\\\"txid\\\\\\\":\\\\\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\\\\\",\\\\\\\"vout\\\\\\\":1}]\\\"\") +\n            \"\\nList the locked transactions\\n\"\n            + HelpExampleCli(\"listlockunspent\", \"\") +\n            \"\\nUnlock the transaction again\\n\"\n            + HelpExampleCli(\"lockunspent\", \"true \\\"[{\\\\\\\"txid\\\\\\\":\\\\\\\"a08e6907dbbd3d809776dbfc5d82e371b764ed838b5655e72f463568df1aadf0\\\\\\\",\\\\\\\"vout\\\\\\\":1}]\\\"\") +\n            \"\\nAs a json rpc call\\n\"\n            + HelpExampleRpc(\"listlockunspent\", \"\")\n        );\n\n    ObserveSafeMode();\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    std::vector<COutPoint> vOutpts;\n    pwallet->ListLockedCoins(vOutpts);\n\n    UniValue ret(UniValue::VARR);\n\n    for (COutPoint &outpt : vOutpts) {\n        UniValue o(UniValue::VOBJ);\n\n        o.push_back(Pair(\"txid\", outpt.hash.GetHex()));\n        o.push_back(Pair(\"vout\", (int)outpt.n));\n        ret.push_back(o);\n    }\n\n    return ret;\n}\n\nUniValue settxfee(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 1)\n        throw std::runtime_error(\n            \"settxfee amount\\n\"\n            \"\\nSet the transaction fee per kB. Overwrites the paytxfee parameter.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. amount         (numeric or string, required) The transaction fee in \" + CURRENCY_UNIT + \"/kB\\n\"\n            \"\\nResult\\n\"\n            \"true|false        (boolean) Returns true if successful\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"settxfee\", \"0.00001\")\n            + HelpExampleRpc(\"settxfee\", \"0.00001\")\n        );\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    // Amount\n    CAmount nAmount = AmountFromValue(request.params[0]);\n\n    payTxFee = CFeeRate(nAmount, 1000);\n    return true;\n}\n\nUniValue getwalletinfo(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"getwalletinfo\\n\"\n            \"Returns an object containing various wallet state info.\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"walletname\\\": xxxxx,             (string) the wallet name\\n\"\n            \"  \\\"walletversion\\\": xxxxx,          (numeric) the wallet version\\n\"\n            \"  \\\"balance\\\": xxxxxxx,              (numeric) the total confirmed balance of the wallet in \" + CURRENCY_UNIT + \"\\n\"\n            \"  \\\"unconfirmed_balance\\\": xxx,      (numeric) the total unconfirmed balance of the wallet in \" + CURRENCY_UNIT + \"\\n\"\n            \"  \\\"immature_balance\\\": xxxxxx,      (numeric) the total immature balance of the wallet in \" + CURRENCY_UNIT + \"\\n\"\n            \"  \\\"txcount\\\": xxxxxxx,              (numeric) the total number of transactions in the wallet\\n\"\n            \"  \\\"keypoololdest\\\": xxxxxx,         (numeric) the timestamp (seconds since Unix epoch) of the oldest pre-generated key in the key pool\\n\"\n            \"  \\\"keypoolsize\\\": xxxx,             (numeric) how many new keys are pre-generated (only counts external keys)\\n\"\n            \"  \\\"keypoolsize_hd_internal\\\": xxxx, (numeric) how many new keys are pre-generated for internal use (used for change outputs, only appears if the wallet is using this feature, otherwise external keys are used)\\n\"\n            \"  \\\"unlocked_until\\\": ttt,           (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\\n\"\n            \"  \\\"paytxfee\\\": x.xxxx,              (numeric) the transaction fee configuration, set in \" + CURRENCY_UNIT + \"/kB\\n\"\n            \"  \\\"hdmasterkeyid\\\": \\\"<hash160>\\\"     (string, optional) the Hash160 of the HD master pubkey (only present when HD is enabled)\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"getwalletinfo\", \"\")\n            + HelpExampleRpc(\"getwalletinfo\", \"\")\n        );\n\n    ObserveSafeMode();\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    UniValue obj(UniValue::VOBJ);\n\n    size_t kpExternalSize = pwallet->KeypoolCountExternalKeys();\n    obj.push_back(Pair(\"walletname\", pwallet->GetName()));\n    obj.push_back(Pair(\"walletversion\", pwallet->GetVersion()));\n    obj.push_back(Pair(\"balance\",       ValueFromAmount(pwallet->GetBalance())));\n    obj.push_back(Pair(\"unconfirmed_balance\", ValueFromAmount(pwallet->GetUnconfirmedBalance())));\n    obj.push_back(Pair(\"immature_balance\",    ValueFromAmount(pwallet->GetImmatureBalance())));\n    obj.push_back(Pair(\"txcount\",       (int)pwallet->mapWallet.size()));\n    obj.push_back(Pair(\"keypoololdest\", pwallet->GetOldestKeyPoolTime()));\n    obj.push_back(Pair(\"keypoolsize\", (int64_t)kpExternalSize));\n    CKeyID masterKeyID = pwallet->GetHDChain().masterKeyID;\n    if (!masterKeyID.IsNull() && pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) {\n        obj.push_back(Pair(\"keypoolsize_hd_internal\",   (int64_t)(pwallet->GetKeyPoolSize() - kpExternalSize)));\n    }\n    if (pwallet->IsCrypted()) {\n        obj.push_back(Pair(\"unlocked_until\", pwallet->nRelockTime));\n    }\n    obj.push_back(Pair(\"paytxfee\",      ValueFromAmount(payTxFee.GetFeePerK())));\n    if (!masterKeyID.IsNull())\n         obj.push_back(Pair(\"hdmasterkeyid\", masterKeyID.GetHex()));\n    return obj;\n}\n\nUniValue listwallets(const JSONRPCRequest& request)\n{\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"listwallets\\n\"\n            \"Returns a list of currently loaded wallets.\\n\"\n            \"For full information on the wallet, use \\\"getwalletinfo\\\"\\n\"\n            \"\\nResult:\\n\"\n            \"[                         (json array of strings)\\n\"\n            \"  \\\"walletname\\\"            (string) the wallet name\\n\"\n            \"   ...\\n\"\n            \"]\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"listwallets\", \"\")\n            + HelpExampleRpc(\"listwallets\", \"\")\n        );\n\n    UniValue obj(UniValue::VARR);\n\n    for (CWalletRef pwallet : vpwallets) {\n\n        if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n            return NullUniValue;\n        }\n\n        LOCK(pwallet->cs_wallet);\n\n        obj.push_back(pwallet->GetName());\n    }\n\n    return obj;\n}\n\nUniValue resendwallettransactions(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() != 0)\n        throw std::runtime_error(\n            \"resendwallettransactions\\n\"\n            \"Immediately re-broadcast unconfirmed wallet transactions to all peers.\\n\"\n            \"Intended only for testing; the wallet code periodically re-broadcasts\\n\"\n            \"automatically.\\n\"\n            \"Returns an RPC error if -walletbroadcast is set to false.\\n\"\n            \"Returns array of transaction ids that were re-broadcast.\\n\"\n            );\n\n    if (!g_connman)\n        throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, \"Error: Peer-to-peer functionality missing or disabled\");\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    if (!pwallet->GetBroadcastTransactions()) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Error: Wallet transaction broadcasting is disabled with -walletbroadcast\");\n    }\n\n    std::vector<uint256> txids = pwallet->ResendWalletTransactionsBefore(GetTime(), g_connman.get());\n    UniValue result(UniValue::VARR);\n    for (const uint256& txid : txids)\n    {\n        result.push_back(txid.ToString());\n    }\n    return result;\n}\n\nUniValue listunspent(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 5)\n        throw std::runtime_error(\n            \"listunspent ( minconf maxconf  [\\\"addresses\\\",...] [include_unsafe] [query_options])\\n\"\n            \"\\nReturns array of unspent transaction outputs\\n\"\n            \"with between minconf and maxconf (inclusive) confirmations.\\n\"\n            \"Optionally filter to only include txouts paid to specified addresses.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. minconf          (numeric, optional, default=1) The minimum confirmations to filter\\n\"\n            \"2. maxconf          (numeric, optional, default=9999999) The maximum confirmations to filter\\n\"\n            \"3. \\\"addresses\\\"      (string) A json array of sugarchain addresses to filter\\n\"\n            \"    [\\n\"\n            \"      \\\"address\\\"     (string) sugarchain address\\n\"\n            \"      ,...\\n\"\n            \"    ]\\n\"\n            \"4. include_unsafe (bool, optional, default=true) Include outputs that are not safe to spend\\n\"\n            \"                  See description of \\\"safe\\\" attribute below.\\n\"\n            \"5. query_options    (json, optional) JSON with query options\\n\"\n            \"    {\\n\"\n            \"      \\\"minimumAmount\\\"    (numeric or string, default=0) Minimum value of each UTXO in \" + CURRENCY_UNIT + \"\\n\"\n            \"      \\\"maximumAmount\\\"    (numeric or string, default=unlimited) Maximum value of each UTXO in \" + CURRENCY_UNIT + \"\\n\"\n            \"      \\\"maximumCount\\\"     (numeric or string, default=unlimited) Maximum number of UTXOs\\n\"\n            \"      \\\"minimumSumAmount\\\" (numeric or string, default=unlimited) Minimum sum value of all UTXOs in \" + CURRENCY_UNIT + \"\\n\"\n            \"    }\\n\"\n            \"\\nResult\\n\"\n            \"[                   (array of json object)\\n\"\n            \"  {\\n\"\n            \"    \\\"txid\\\" : \\\"txid\\\",          (string) the transaction id \\n\"\n            \"    \\\"vout\\\" : n,               (numeric) the vout value\\n\"\n            \"    \\\"address\\\" : \\\"address\\\",    (string) the sugarchain address\\n\"\n            \"    \\\"account\\\" : \\\"account\\\",    (string) DEPRECATED. The associated account, or \\\"\\\" for the default account\\n\"\n            \"    \\\"scriptPubKey\\\" : \\\"key\\\",   (string) the script key\\n\"\n            \"    \\\"amount\\\" : x.xxx,         (numeric) the transaction output amount in \" + CURRENCY_UNIT + \"\\n\"\n            \"    \\\"confirmations\\\" : n,      (numeric) The number of confirmations\\n\"\n            \"    \\\"redeemScript\\\" : n        (string) The redeemScript if scriptPubKey is P2SH\\n\"\n            \"    \\\"spendable\\\" : xxx,        (bool) Whether we have the private keys to spend this output\\n\"\n            \"    \\\"solvable\\\" : xxx,         (bool) Whether we know how to spend this output, ignoring the lack of keys\\n\"\n            \"    \\\"safe\\\" : xxx              (bool) Whether this output is considered safe to spend. Unconfirmed transactions\\n\"\n            \"                              from outside keys and unconfirmed replacement transactions are considered unsafe\\n\"\n            \"                              and are not eligible for spending by fundrawtransaction and sendtoaddress.\\n\"\n            \"  }\\n\"\n            \"  ,...\\n\"\n            \"]\\n\"\n\n            \"\\nExamples\\n\"\n            + HelpExampleCli(\"listunspent\", \"\")\n            + HelpExampleCli(\"listunspent\", \"6 9999999 \\\"[\\\\\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\\\\\",\\\\\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\\\\\"]\\\"\")\n            + HelpExampleRpc(\"listunspent\", \"6, 9999999 \\\"[\\\\\\\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\\\\\\\",\\\\\\\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\\\\\\\"]\\\"\")\n            + HelpExampleCli(\"listunspent\", \"6 9999999 '[]' true '{ \\\"minimumAmount\\\": 0.005 }'\")\n            + HelpExampleRpc(\"listunspent\", \"6, 9999999, [] , true, { \\\"minimumAmount\\\": 0.005 } \")\n        );\n\n    ObserveSafeMode();\n\n    int nMinDepth = 1;\n    if (!request.params[0].isNull()) {\n        RPCTypeCheckArgument(request.params[0], UniValue::VNUM);\n        nMinDepth = request.params[0].get_int();\n    }\n\n    int nMaxDepth = 9999999;\n    if (!request.params[1].isNull()) {\n        RPCTypeCheckArgument(request.params[1], UniValue::VNUM);\n        nMaxDepth = request.params[1].get_int();\n    }\n\n    std::set<CTxDestination> destinations;\n    if (!request.params[2].isNull()) {\n        RPCTypeCheckArgument(request.params[2], UniValue::VARR);\n        UniValue inputs = request.params[2].get_array();\n        for (unsigned int idx = 0; idx < inputs.size(); idx++) {\n            const UniValue& input = inputs[idx];\n            CTxDestination dest = DecodeDestination(input.get_str());\n            if (!IsValidDestination(dest)) {\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, std::string(\"Invalid Sugarchain address: \") + input.get_str());\n            }\n            if (!destinations.insert(dest).second) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, std::string(\"Invalid parameter, duplicated address: \") + input.get_str());\n            }\n        }\n    }\n\n    bool include_unsafe = true;\n    if (!request.params[3].isNull()) {\n        RPCTypeCheckArgument(request.params[3], UniValue::VBOOL);\n        include_unsafe = request.params[3].get_bool();\n    }\n\n    CAmount nMinimumAmount = 0;\n    CAmount nMaximumAmount = MAX_MONEY;\n    CAmount nMinimumSumAmount = MAX_MONEY;\n    uint64_t nMaximumCount = 0;\n\n    if (!request.params[4].isNull()) {\n        const UniValue& options = request.params[4].get_obj();\n\n        if (options.exists(\"minimumAmount\"))\n            nMinimumAmount = AmountFromValue(options[\"minimumAmount\"]);\n\n        if (options.exists(\"maximumAmount\"))\n            nMaximumAmount = AmountFromValue(options[\"maximumAmount\"]);\n\n        if (options.exists(\"minimumSumAmount\"))\n            nMinimumSumAmount = AmountFromValue(options[\"minimumSumAmount\"]);\n\n        if (options.exists(\"maximumCount\"))\n            nMaximumCount = options[\"maximumCount\"].get_int64();\n    }\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    UniValue results(UniValue::VARR);\n    std::vector<COutput> vecOutputs;\n    LOCK2(cs_main, pwallet->cs_wallet);\n\n    pwallet->AvailableCoins(vecOutputs, !include_unsafe, nullptr, nMinimumAmount, nMaximumAmount, nMinimumSumAmount, nMaximumCount, nMinDepth, nMaxDepth);\n    for (const COutput& out : vecOutputs) {\n        CTxDestination address;\n        const CScript& scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey;\n        bool fValidAddress = ExtractDestination(scriptPubKey, address);\n\n        if (destinations.size() && (!fValidAddress || !destinations.count(address)))\n            continue;\n\n        UniValue entry(UniValue::VOBJ);\n        entry.push_back(Pair(\"txid\", out.tx->GetHash().GetHex()));\n        entry.push_back(Pair(\"vout\", out.i));\n\n        if (fValidAddress) {\n            entry.push_back(Pair(\"address\", EncodeDestination(address)));\n\n            if (pwallet->mapAddressBook.count(address)) {\n                entry.push_back(Pair(\"account\", pwallet->mapAddressBook[address].name));\n            }\n\n            if (scriptPubKey.IsPayToScriptHash()) {\n                const CScriptID& hash = boost::get<CScriptID>(address);\n                CScript redeemScript;\n                if (pwallet->GetCScript(hash, redeemScript)) {\n                    entry.push_back(Pair(\"redeemScript\", HexStr(redeemScript.begin(), redeemScript.end())));\n                }\n            }\n        }\n\n        entry.push_back(Pair(\"scriptPubKey\", HexStr(scriptPubKey.begin(), scriptPubKey.end())));\n        entry.push_back(Pair(\"amount\", ValueFromAmount(out.tx->tx->vout[out.i].nValue)));\n        entry.push_back(Pair(\"confirmations\", out.nDepth));\n        entry.push_back(Pair(\"spendable\", out.fSpendable));\n        entry.push_back(Pair(\"solvable\", out.fSolvable));\n        entry.push_back(Pair(\"safe\", out.fSafe));\n        results.push_back(entry);\n    }\n\n    return results;\n}\n\nUniValue fundrawtransaction(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 3)\n        throw std::runtime_error(\n                            \"fundrawtransaction \\\"hexstring\\\" ( options iswitness )\\n\"\n                            \"\\nAdd inputs to a transaction until it has enough in value to meet its out value.\\n\"\n                            \"This will not modify existing inputs, and will add at most one change output to the outputs.\\n\"\n                            \"No existing outputs will be modified unless \\\"subtractFeeFromOutputs\\\" is specified.\\n\"\n                            \"Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.\\n\"\n                            \"The inputs added will not be signed, use signrawtransaction for that.\\n\"\n                            \"Note that all existing inputs must have their previous output transaction be in the wallet.\\n\"\n                            \"Note that all inputs selected must be of standard form and P2SH scripts must be\\n\"\n                            \"in the wallet using importaddress or addmultisigaddress (to calculate fees).\\n\"\n                            \"You can see whether this is the case by checking the \\\"solvable\\\" field in the listunspent output.\\n\"\n                            \"Only pay-to-pubkey, multisig, and P2SH versions thereof are currently supported for watch-only\\n\"\n                            \"\\nArguments:\\n\"\n                            \"1. \\\"hexstring\\\"           (string, required) The hex string of the raw transaction\\n\"\n                            \"2. options                 (object, optional)\\n\"\n                            \"   {\\n\"\n                            \"     \\\"changeAddress\\\"          (string, optional, default pool address) The sugarchain address to receive the change\\n\"\n                            \"     \\\"changePosition\\\"         (numeric, optional, default random) The index of the change output\\n\"\n                            \"     \\\"change_type\\\"            (string, optional) The output type to use. Only valid if changeAddress is not specified. Options are \\\"legacy\\\", \\\"p2sh-segwit\\\", and \\\"bech32\\\". Default is set by -changetype.\\n\"\n                            \"     \\\"includeWatching\\\"        (boolean, optional, default false) Also select inputs which are watch only\\n\"\n                            \"     \\\"lockUnspents\\\"           (boolean, optional, default false) Lock selected unspent outputs\\n\"\n                            \"     \\\"feeRate\\\"                (numeric, optional, default not set: makes wallet determine the fee) Set a specific fee rate in \" + CURRENCY_UNIT + \"/kB\\n\"\n                            \"     \\\"subtractFeeFromOutputs\\\" (array, optional) A json array of integers.\\n\"\n                            \"                              The fee will be equally deducted from the amount of each specified output.\\n\"\n                            \"                              The outputs are specified by their zero-based index, before any change output is added.\\n\"\n                            \"                              Those recipients will receive less sugarchains than you enter in their corresponding amount field.\\n\"\n                            \"                              If no outputs are specified here, the sender pays the fee.\\n\"\n                            \"                                  [vout_index,...]\\n\"\n                            \"     \\\"replaceable\\\"            (boolean, optional) Marks this transaction as BIP125 replaceable.\\n\"\n                            \"                              Allows this transaction to be replaced by a transaction with higher fees\\n\"\n                            \"     \\\"conf_target\\\"            (numeric, optional) Confirmation target (in blocks)\\n\"\n                            \"     \\\"estimate_mode\\\"          (string, optional, default=UNSET) The fee estimate mode, must be one of:\\n\"\n                            \"         \\\"UNSET\\\"\\n\"\n                            \"         \\\"ECONOMICAL\\\"\\n\"\n                            \"         \\\"CONSERVATIVE\\\"\\n\"\n                            \"   }\\n\"\n                            \"                         for backward compatibility: passing in a true instead of an object will result in {\\\"includeWatching\\\":true}\\n\"\n                            \"3. iswitness               (boolean, optional) Whether the transaction hex is a serialized witness transaction \\n\"\n                            \"                              If iswitness is not present, heuristic tests will be used in decoding\\n\"\n\n                            \"\\nResult:\\n\"\n                            \"{\\n\"\n                            \"  \\\"hex\\\":       \\\"value\\\", (string)  The resulting raw transaction (hex-encoded string)\\n\"\n                            \"  \\\"fee\\\":       n,         (numeric) Fee in \" + CURRENCY_UNIT + \" the resulting transaction pays\\n\"\n                            \"  \\\"changepos\\\": n          (numeric) The position of the added change output, or -1\\n\"\n                            \"}\\n\"\n                            \"\\nExamples:\\n\"\n                            \"\\nCreate a transaction with no inputs\\n\"\n                            + HelpExampleCli(\"createrawtransaction\", \"\\\"[]\\\" \\\"{\\\\\\\"myaddress\\\\\\\":0.01}\\\"\") +\n                            \"\\nAdd sufficient unsigned inputs to meet the output value\\n\"\n                            + HelpExampleCli(\"fundrawtransaction\", \"\\\"rawtransactionhex\\\"\") +\n                            \"\\nSign the transaction\\n\"\n                            + HelpExampleCli(\"signrawtransaction\", \"\\\"fundedtransactionhex\\\"\") +\n                            \"\\nSend the transaction\\n\"\n                            + HelpExampleCli(\"sendrawtransaction\", \"\\\"signedtransactionhex\\\"\")\n                            );\n\n    ObserveSafeMode();\n    RPCTypeCheck(request.params, {UniValue::VSTR});\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    CCoinControl coinControl;\n    int changePosition = -1;\n    bool lockUnspents = false;\n    UniValue subtractFeeFromOutputs;\n    std::set<int> setSubtractFeeFromOutputs;\n\n    if (!request.params[1].isNull()) {\n      if (request.params[1].type() == UniValue::VBOOL) {\n        // backward compatibility bool only fallback\n        coinControl.fAllowWatchOnly = request.params[1].get_bool();\n      }\n      else {\n        RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VOBJ, UniValue::VBOOL});\n\n        UniValue options = request.params[1];\n\n        RPCTypeCheckObj(options,\n            {\n                {\"changeAddress\", UniValueType(UniValue::VSTR)},\n                {\"changePosition\", UniValueType(UniValue::VNUM)},\n                {\"change_type\", UniValueType(UniValue::VSTR)},\n                {\"includeWatching\", UniValueType(UniValue::VBOOL)},\n                {\"lockUnspents\", UniValueType(UniValue::VBOOL)},\n                {\"reserveChangeKey\", UniValueType(UniValue::VBOOL)}, // DEPRECATED (and ignored), should be removed in 0.16 or so.\n                {\"feeRate\", UniValueType()}, // will be checked below\n                {\"subtractFeeFromOutputs\", UniValueType(UniValue::VARR)},\n                {\"replaceable\", UniValueType(UniValue::VBOOL)},\n                {\"conf_target\", UniValueType(UniValue::VNUM)},\n                {\"estimate_mode\", UniValueType(UniValue::VSTR)},\n            },\n            true, true);\n\n        if (options.exists(\"changeAddress\")) {\n            CTxDestination dest = DecodeDestination(options[\"changeAddress\"].get_str());\n\n            if (!IsValidDestination(dest)) {\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, \"changeAddress must be a valid sugarchain address\");\n            }\n\n            coinControl.destChange = dest;\n        }\n\n        if (options.exists(\"changePosition\"))\n            changePosition = options[\"changePosition\"].get_int();\n\n        if (options.exists(\"change_type\")) {\n            if (options.exists(\"changeAddress\")) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, \"Cannot specify both changeAddress and address_type options\");\n            }\n            coinControl.change_type = ParseOutputType(options[\"change_type\"].get_str(), coinControl.change_type);\n            if (coinControl.change_type == OUTPUT_TYPE_NONE) {\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf(\"Unknown change type '%s'\", options[\"change_type\"].get_str()));\n            }\n        }\n\n        if (options.exists(\"includeWatching\"))\n            coinControl.fAllowWatchOnly = options[\"includeWatching\"].get_bool();\n\n        if (options.exists(\"lockUnspents\"))\n            lockUnspents = options[\"lockUnspents\"].get_bool();\n\n        if (options.exists(\"feeRate\"))\n        {\n            coinControl.m_feerate = CFeeRate(AmountFromValue(options[\"feeRate\"]));\n            coinControl.fOverrideFeeRate = true;\n        }\n\n        if (options.exists(\"subtractFeeFromOutputs\"))\n            subtractFeeFromOutputs = options[\"subtractFeeFromOutputs\"].get_array();\n\n        if (options.exists(\"replaceable\")) {\n            coinControl.signalRbf = options[\"replaceable\"].get_bool();\n        }\n        if (options.exists(\"conf_target\")) {\n            if (options.exists(\"feeRate\")) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, \"Cannot specify both conf_target and feeRate\");\n            }\n            coinControl.m_confirm_target = ParseConfirmTarget(options[\"conf_target\"]);\n        }\n        if (options.exists(\"estimate_mode\")) {\n            if (options.exists(\"feeRate\")) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, \"Cannot specify both estimate_mode and feeRate\");\n            }\n            if (!FeeModeFromString(options[\"estimate_mode\"].get_str(), coinControl.m_fee_mode)) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid estimate_mode parameter\");\n            }\n        }\n      }\n    }\n\n    // parse hex string from parameter\n    CMutableTransaction tx;\n    bool try_witness = request.params[2].isNull() ? true : request.params[2].get_bool();\n    bool try_no_witness = request.params[2].isNull() ? true : !request.params[2].get_bool();\n    if (!DecodeHexTx(tx, request.params[0].get_str(), try_no_witness, try_witness)) {\n        throw JSONRPCError(RPC_DESERIALIZATION_ERROR, \"TX decode failed\");\n    }\n\n    if (tx.vout.size() == 0)\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"TX must have at least one output\");\n\n    if (changePosition != -1 && (changePosition < 0 || (unsigned int)changePosition > tx.vout.size()))\n        throw JSONRPCError(RPC_INVALID_PARAMETER, \"changePosition out of bounds\");\n\n    for (unsigned int idx = 0; idx < subtractFeeFromOutputs.size(); idx++) {\n        int pos = subtractFeeFromOutputs[idx].get_int();\n        if (setSubtractFeeFromOutputs.count(pos))\n            throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf(\"Invalid parameter, duplicated position: %d\", pos));\n        if (pos < 0)\n            throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf(\"Invalid parameter, negative position: %d\", pos));\n        if (pos >= int(tx.vout.size()))\n            throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf(\"Invalid parameter, position too large: %d\", pos));\n        setSubtractFeeFromOutputs.insert(pos);\n    }\n\n    CAmount nFeeOut;\n    std::string strFailReason;\n\n    if (!pwallet->FundTransaction(tx, nFeeOut, changePosition, strFailReason, lockUnspents, setSubtractFeeFromOutputs, coinControl)) {\n        throw JSONRPCError(RPC_WALLET_ERROR, strFailReason);\n    }\n\n    UniValue result(UniValue::VOBJ);\n    result.push_back(Pair(\"hex\", EncodeHexTx(tx)));\n    result.push_back(Pair(\"changepos\", changePosition));\n    result.push_back(Pair(\"fee\", ValueFromAmount(nFeeOut)));\n\n    return result;\n}\n\nUniValue bumpfee(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp))\n        return NullUniValue;\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) {\n        throw std::runtime_error(\n            \"bumpfee \\\"txid\\\" ( options ) \\n\"\n            \"\\nBumps the fee of an opt-in-RBF transaction T, replacing it with a new transaction B.\\n\"\n            \"An opt-in RBF transaction with the given txid must be in the wallet.\\n\"\n            \"The command will pay the additional fee by decreasing (or perhaps removing) its change output.\\n\"\n            \"If the change output is not big enough to cover the increased fee, the command will currently fail\\n\"\n            \"instead of adding new inputs to compensate. (A future implementation could improve this.)\\n\"\n            \"The command will fail if the wallet or mempool contains a transaction that spends one of T's outputs.\\n\"\n            \"By default, the new fee will be calculated automatically using estimatefee.\\n\"\n            \"The user can specify a confirmation target for estimatefee.\\n\"\n            \"Alternatively, the user can specify totalFee, or use RPC settxfee to set a higher fee rate.\\n\"\n            \"At a minimum, the new fee rate must be high enough to pay an additional new relay fee (incrementalfee\\n\"\n            \"returned by getnetworkinfo) to enter the node's mempool.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. txid                  (string, required) The txid to be bumped\\n\"\n            \"2. options               (object, optional)\\n\"\n            \"   {\\n\"\n            \"     \\\"confTarget\\\"        (numeric, optional) Confirmation target (in blocks)\\n\"\n            \"     \\\"totalFee\\\"          (numeric, optional) Total fee (NOT feerate) to pay, in satoshis.\\n\"\n            \"                         In rare cases, the actual fee paid might be slightly higher than the specified\\n\"\n            \"                         totalFee if the tx change output has to be removed because it is too close to\\n\"\n            \"                         the dust threshold.\\n\"\n            \"     \\\"replaceable\\\"       (boolean, optional, default true) Whether the new transaction should still be\\n\"\n            \"                         marked bip-125 replaceable. If true, the sequence numbers in the transaction will\\n\"\n            \"                         be left unchanged from the original. If false, any input sequence numbers in the\\n\"\n            \"                         original transaction that were less than 0xfffffffe will be increased to 0xfffffffe\\n\"\n            \"                         so the new transaction will not be explicitly bip-125 replaceable (though it may\\n\"\n            \"                         still be replaceable in practice, for example if it has unconfirmed ancestors which\\n\"\n            \"                         are replaceable).\\n\"\n            \"     \\\"estimate_mode\\\"     (string, optional, default=UNSET) The fee estimate mode, must be one of:\\n\"\n            \"         \\\"UNSET\\\"\\n\"\n            \"         \\\"ECONOMICAL\\\"\\n\"\n            \"         \\\"CONSERVATIVE\\\"\\n\"\n            \"   }\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"txid\\\":    \\\"value\\\",   (string)  The id of the new transaction\\n\"\n            \"  \\\"origfee\\\":  n,         (numeric) Fee of the replaced transaction\\n\"\n            \"  \\\"fee\\\":      n,         (numeric) Fee of the new transaction\\n\"\n            \"  \\\"errors\\\":  [ str... ] (json array of strings) Errors encountered during processing (may be empty)\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nBump the fee, get the new transaction\\'s txid\\n\" +\n            HelpExampleCli(\"bumpfee\", \"<txid>\"));\n    }\n\n    RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VOBJ});\n    uint256 hash;\n    hash.SetHex(request.params[0].get_str());\n\n    // optional parameters\n    CAmount totalFee = 0;\n    CCoinControl coin_control;\n    coin_control.signalRbf = true;\n    if (!request.params[1].isNull()) {\n        UniValue options = request.params[1];\n        RPCTypeCheckObj(options,\n            {\n                {\"confTarget\", UniValueType(UniValue::VNUM)},\n                {\"totalFee\", UniValueType(UniValue::VNUM)},\n                {\"replaceable\", UniValueType(UniValue::VBOOL)},\n                {\"estimate_mode\", UniValueType(UniValue::VSTR)},\n            },\n            true, true);\n\n        if (options.exists(\"confTarget\") && options.exists(\"totalFee\")) {\n            throw JSONRPCError(RPC_INVALID_PARAMETER, \"confTarget and totalFee options should not both be set. Please provide either a confirmation target for fee estimation or an explicit total fee for the transaction.\");\n        } else if (options.exists(\"confTarget\")) { // TODO: alias this to conf_target\n            coin_control.m_confirm_target = ParseConfirmTarget(options[\"confTarget\"]);\n        } else if (options.exists(\"totalFee\")) {\n            totalFee = options[\"totalFee\"].get_int64();\n            if (totalFee <= 0) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf(\"Invalid totalFee %s (must be greater than 0)\", FormatMoney(totalFee)));\n            }\n        }\n\n        if (options.exists(\"replaceable\")) {\n            coin_control.signalRbf = options[\"replaceable\"].get_bool();\n        }\n        if (options.exists(\"estimate_mode\")) {\n            if (!FeeModeFromString(options[\"estimate_mode\"].get_str(), coin_control.m_fee_mode)) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid estimate_mode parameter\");\n            }\n        }\n    }\n\n    // Make sure the results are valid at least up to the most recent block\n    // the user could have gotten from another RPC command prior to now\n    pwallet->BlockUntilSyncedToCurrentChain();\n\n    LOCK2(cs_main, pwallet->cs_wallet);\n    EnsureWalletIsUnlocked(pwallet);\n\n\n    std::vector<std::string> errors;\n    CAmount old_fee;\n    CAmount new_fee;\n    CMutableTransaction mtx;\n    feebumper::Result res = feebumper::CreateTransaction(pwallet, hash, coin_control, totalFee, errors, old_fee, new_fee, mtx);\n    if (res != feebumper::Result::OK) {\n        switch(res) {\n            case feebumper::Result::INVALID_ADDRESS_OR_KEY:\n                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, errors[0]);\n                break;\n            case feebumper::Result::INVALID_REQUEST:\n                throw JSONRPCError(RPC_INVALID_REQUEST, errors[0]);\n                break;\n            case feebumper::Result::INVALID_PARAMETER:\n                throw JSONRPCError(RPC_INVALID_PARAMETER, errors[0]);\n                break;\n            case feebumper::Result::WALLET_ERROR:\n                throw JSONRPCError(RPC_WALLET_ERROR, errors[0]);\n                break;\n            default:\n                throw JSONRPCError(RPC_MISC_ERROR, errors[0]);\n                break;\n        }\n    }\n\n    // sign bumped transaction\n    if (!feebumper::SignTransaction(pwallet, mtx)) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Can't sign transaction.\");\n    }\n    // commit the bumped transaction\n    uint256 txid;\n    if (feebumper::CommitTransaction(pwallet, hash, std::move(mtx), errors, txid) != feebumper::Result::OK) {\n        throw JSONRPCError(RPC_WALLET_ERROR, errors[0]);\n    }\n    UniValue result(UniValue::VOBJ);\n    result.push_back(Pair(\"txid\", txid.GetHex()));\n    result.push_back(Pair(\"origfee\", ValueFromAmount(old_fee)));\n    result.push_back(Pair(\"fee\", ValueFromAmount(new_fee)));\n    UniValue result_errors(UniValue::VARR);\n    for (const std::string& error : errors) {\n        result_errors.push_back(error);\n    }\n    result.push_back(Pair(\"errors\", result_errors));\n\n    return result;\n}\n\nUniValue generate(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() < 1 || request.params.size() > 2) {\n        throw std::runtime_error(\n            \"generate nblocks ( maxtries )\\n\"\n            \"\\nMine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. nblocks      (numeric, required) How many blocks are generated immediately.\\n\"\n            \"2. maxtries     (numeric, optional) How many iterations to try (default = 1000000).\\n\"\n            \"\\nResult:\\n\"\n            \"[ blockhashes ]     (array) hashes of blocks generated\\n\"\n            \"\\nExamples:\\n\"\n            \"\\nGenerate 11 blocks\\n\"\n            + HelpExampleCli(\"generate\", \"11\")\n        );\n    }\n\n    int num_generate = request.params[0].get_int();\n    uint64_t max_tries = 1000000;\n    if (!request.params[1].isNull()) {\n        max_tries = request.params[1].get_int();\n    }\n\n    std::shared_ptr<CReserveScript> coinbase_script;\n    pwallet->GetScriptForMining(coinbase_script);\n\n    // If the keypool is exhausted, no script is returned at all.  Catch this.\n    if (!coinbase_script) {\n        throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, \"Error: Keypool ran out, please call keypoolrefill first\");\n    }\n\n    //throw an error if no script was provided\n    if (coinbase_script->reserveScript.empty()) {\n        throw JSONRPCError(RPC_INTERNAL_ERROR, \"No coinbase script available\");\n    }\n\n    return generateBlocks(coinbase_script, num_generate, max_tries, true);\n}\n\nUniValue rescanblockchain(const JSONRPCRequest& request)\n{\n    CWallet * const pwallet = GetWalletForJSONRPCRequest(request);\n    if (!EnsureWalletIsAvailable(pwallet, request.fHelp)) {\n        return NullUniValue;\n    }\n\n    if (request.fHelp || request.params.size() > 2) {\n        throw std::runtime_error(\n            \"rescanblockchain (\\\"start_height\\\") (\\\"stop_height\\\")\\n\"\n            \"\\nRescan the local blockchain for wallet related transactions.\\n\"\n            \"\\nArguments:\\n\"\n            \"1. \\\"start_height\\\"    (numeric, optional) block height where the rescan should start\\n\"\n            \"2. \\\"stop_height\\\"     (numeric, optional) the last block height that should be scanned\\n\"\n            \"\\nResult:\\n\"\n            \"{\\n\"\n            \"  \\\"start_height\\\"     (numeric) The block height where the rescan has started. If omitted, rescan started from the genesis block.\\n\"\n            \"  \\\"stop_height\\\"      (numeric) The height of the last rescanned block. If omitted, rescan stopped at the chain tip.\\n\"\n            \"}\\n\"\n            \"\\nExamples:\\n\"\n            + HelpExampleCli(\"rescanblockchain\", \"100000 120000\")\n            + HelpExampleRpc(\"rescanblockchain\", \"100000, 120000\")\n            );\n    }\n\n    WalletRescanReserver reserver(pwallet);\n    if (!reserver.reserve()) {\n        throw JSONRPCError(RPC_WALLET_ERROR, \"Wallet is currently rescanning. Abort existing rescan or wait.\");\n    }\n\n    CBlockIndex *pindexStart = nullptr;\n    CBlockIndex *pindexStop = nullptr;\n    CBlockIndex *pChainTip = nullptr;\n    {\n        LOCK(cs_main);\n        pindexStart = chainActive.Genesis();\n        pChainTip = chainActive.Tip();\n\n        if (!request.params[0].isNull()) {\n            pindexStart = chainActive[request.params[0].get_int()];\n            if (!pindexStart) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid start_height\");\n            }\n        }\n\n        if (!request.params[1].isNull()) {\n            pindexStop = chainActive[request.params[1].get_int()];\n            if (!pindexStop) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, \"Invalid stop_height\");\n            }\n            else if (pindexStop->nHeight < pindexStart->nHeight) {\n                throw JSONRPCError(RPC_INVALID_PARAMETER, \"stop_height must be greater then start_height\");\n            }\n        }\n    }\n\n    // We can't rescan beyond non-pruned blocks, stop and throw an error\n    if (fPruneMode) {\n        LOCK(cs_main);\n        CBlockIndex *block = pindexStop ? pindexStop : pChainTip;\n        while (block && block->nHeight >= pindexStart->nHeight) {\n            if (!(block->nStatus & BLOCK_HAVE_DATA)) {\n                throw JSONRPCError(RPC_MISC_ERROR, \"Can't rescan beyond pruned data. Use RPC call getblockchaininfo to determine your pruned height.\");\n            }\n            block = block->pprev;\n        }\n    }\n\n    CBlockIndex *stopBlock = pwallet->ScanForWalletTransactions(pindexStart, pindexStop, reserver, true);\n    if (!stopBlock) {\n        if (pwallet->IsAbortingRescan()) {\n            throw JSONRPCError(RPC_MISC_ERROR, \"Rescan aborted.\");\n        }\n        // if we got a nullptr returned, ScanForWalletTransactions did rescan up to the requested stopindex\n        stopBlock = pindexStop ? pindexStop : pChainTip;\n    }\n    else {\n        throw JSONRPCError(RPC_MISC_ERROR, \"Rescan failed. Potentially corrupted data files.\");\n    }\n    UniValue response(UniValue::VOBJ);\n    response.pushKV(\"start_height\", pindexStart->nHeight);\n    response.pushKV(\"stop_height\", stopBlock->nHeight);\n    return response;\n}\n\nextern UniValue abortrescan(const JSONRPCRequest& request); // in rpcdump.cpp\nextern UniValue dumpprivkey(const JSONRPCRequest& request); // in rpcdump.cpp\nextern UniValue importprivkey(const JSONRPCRequest& request);\nextern UniValue importaddress(const JSONRPCRequest& request);\nextern UniValue importpubkey(const JSONRPCRequest& request);\nextern UniValue dumpwallet(const JSONRPCRequest& request);\nextern UniValue importwallet(const JSONRPCRequest& request);\nextern UniValue importprunedfunds(const JSONRPCRequest& request);\nextern UniValue removeprunedfunds(const JSONRPCRequest& request);\nextern UniValue importmulti(const JSONRPCRequest& request);\nextern UniValue rescanblockchain(const JSONRPCRequest& request);\n\nstatic const CRPCCommand commands[] =\n{ //  category              name                        actor (function)           argNames\n    //  --------------------- ------------------------    -----------------------  ----------\n    { \"rawtransactions\",    \"fundrawtransaction\",       &fundrawtransaction,       {\"hexstring\",\"options\",\"iswitness\"} },\n    { \"hidden\",             \"resendwallettransactions\", &resendwallettransactions, {} },\n    { \"wallet\",             \"abandontransaction\",       &abandontransaction,       {\"txid\"} },\n    { \"wallet\",             \"abortrescan\",              &abortrescan,              {} },\n    { \"wallet\",             \"addmultisigaddress\",       &addmultisigaddress,       {\"nrequired\",\"keys\",\"account\",\"address_type\"} },\n    { \"hidden\",             \"addwitnessaddress\",        &addwitnessaddress,        {\"address\",\"p2sh\"} },\n    { \"wallet\",             \"backupwallet\",             &backupwallet,             {\"destination\"} },\n    { \"wallet\",             \"bumpfee\",                  &bumpfee,                  {\"txid\", \"options\"} },\n    { \"wallet\",             \"dumpprivkey\",              &dumpprivkey,              {\"address\"}  },\n    { \"wallet\",             \"dumpwallet\",               &dumpwallet,               {\"filename\"} },\n    { \"wallet\",             \"encryptwallet\",            &encryptwallet,            {\"passphrase\"} },\n    { \"wallet\",             \"getaccountaddress\",        &getaccountaddress,        {\"account\"} },\n    { \"wallet\",             \"getaccount\",               &getaccount,               {\"address\"} },\n    { \"wallet\",             \"getaddressesbyaccount\",    &getaddressesbyaccount,    {\"account\"} },\n    { \"wallet\",             \"getbalance\",               &getbalance,               {\"account\",\"minconf\",\"include_watchonly\"} },\n    { \"wallet\",             \"getnewaddress\",            &getnewaddress,            {\"account\",\"address_type\"} },\n    { \"wallet\",             \"getrawchangeaddress\",      &getrawchangeaddress,      {\"address_type\"} },\n    { \"wallet\",             \"getreceivedbyaccount\",     &getreceivedbyaccount,     {\"account\",\"minconf\"} },\n    { \"wallet\",             \"getreceivedbyaddress\",     &getreceivedbyaddress,     {\"address\",\"minconf\"} },\n    { \"wallet\",             \"gettransaction\",           &gettransaction,           {\"txid\",\"include_watchonly\"} },\n    { \"wallet\",             \"getunconfirmedbalance\",    &getunconfirmedbalance,    {} },\n    { \"wallet\",             \"getwalletinfo\",            &getwalletinfo,            {} },\n    { \"wallet\",             \"importmulti\",              &importmulti,              {\"requests\",\"options\"} },\n    { \"wallet\",             \"importprivkey\",            &importprivkey,            {\"privkey\",\"label\",\"rescan\"} },\n    { \"wallet\",             \"importwallet\",             &importwallet,             {\"filename\"} },\n    { \"wallet\",             \"importaddress\",            &importaddress,            {\"address\",\"label\",\"rescan\",\"p2sh\"} },\n    { \"wallet\",             \"importprunedfunds\",        &importprunedfunds,        {\"rawtransaction\",\"txoutproof\"} },\n    { \"wallet\",             \"importpubkey\",             &importpubkey,             {\"pubkey\",\"label\",\"rescan\"} },\n    { \"wallet\",             \"keypoolrefill\",            &keypoolrefill,            {\"newsize\"} },\n    { \"wallet\",             \"listaccounts\",             &listaccounts,             {\"minconf\",\"include_watchonly\"} },\n    { \"wallet\",             \"listaddressgroupings\",     &listaddressgroupings,     {} },\n    { \"wallet\",             \"listlockunspent\",          &listlockunspent,          {} },\n    { \"wallet\",             \"listreceivedbyaccount\",    &listreceivedbyaccount,    {\"minconf\",\"include_empty\",\"include_watchonly\"} },\n    { \"wallet\",             \"listreceivedbyaddress\",    &listreceivedbyaddress,    {\"minconf\",\"include_empty\",\"include_watchonly\"} },\n    { \"wallet\",             \"listsinceblock\",           &listsinceblock,           {\"blockhash\",\"target_confirmations\",\"include_watchonly\",\"include_removed\"} },\n    { \"wallet\",             \"listtransactions\",         &listtransactions,         {\"account\",\"count\",\"skip\",\"include_watchonly\"} },\n    { \"wallet\",             \"listunspent\",              &listunspent,              {\"minconf\",\"maxconf\",\"addresses\",\"include_unsafe\",\"query_options\"} },\n    { \"wallet\",             \"listwallets\",              &listwallets,              {} },\n    { \"wallet\",             \"lockunspent\",              &lockunspent,              {\"unlock\",\"transactions\"} },\n    { \"wallet\",             \"move\",                     &movecmd,                  {\"fromaccount\",\"toaccount\",\"amount\",\"minconf\",\"comment\"} },\n    { \"wallet\",             \"sendfrom\",                 &sendfrom,                 {\"fromaccount\",\"toaddress\",\"amount\",\"minconf\",\"comment\",\"comment_to\"} },\n    { \"wallet\",             \"sendmany\",                 &sendmany,                 {\"fromaccount\",\"amounts\",\"minconf\",\"comment\",\"subtractfeefrom\",\"replaceable\",\"conf_target\",\"estimate_mode\"} },\n    { \"wallet\",             \"sendtoaddress\",            &sendtoaddress,            {\"address\",\"amount\",\"comment\",\"comment_to\",\"subtractfeefromamount\",\"replaceable\",\"conf_target\",\"estimate_mode\"} },\n    { \"wallet\",             \"setaccount\",               &setaccount,               {\"address\",\"account\"} },\n    { \"wallet\",             \"settxfee\",                 &settxfee,                 {\"amount\"} },\n    { \"wallet\",             \"signmessage\",              &signmessage,              {\"address\",\"message\"} },\n    { \"wallet\",             \"walletlock\",               &walletlock,               {} },\n    { \"wallet\",             \"walletpassphrasechange\",   &walletpassphrasechange,   {\"oldpassphrase\",\"newpassphrase\"} },\n    { \"wallet\",             \"walletpassphrase\",         &walletpassphrase,         {\"passphrase\",\"timeout\"} },\n    { \"wallet\",             \"removeprunedfunds\",        &removeprunedfunds,        {\"txid\"} },\n    { \"wallet\",             \"rescanblockchain\",         &rescanblockchain,         {\"start_height\", \"stop_height\"} },\n\n    { \"generating\",         \"generate\",                 &generate,                 {\"nblocks\",\"maxtries\"} },\n};\n\nvoid RegisterWalletRPCCommands(CRPCTable &t)\n{\n    for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)\n        t.appendCommand(commands[vcidx].name, &commands[vcidx]);\n}\n"
  },
  {
    "path": "src/wallet/rpcwallet.h",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_RPCWALLET_H\n#define BITCOIN_WALLET_RPCWALLET_H\n\n#include <string>\n\nclass CRPCTable;\nclass CWallet;\nclass JSONRPCRequest;\n\nvoid RegisterWalletRPCCommands(CRPCTable &t);\n\n/**\n * Figures out what wallet, if any, to use for a JSONRPCRequest.\n *\n * @param[in] request JSONRPCRequest that wishes to access a wallet\n * @return nullptr if no wallet should be used, or a pointer to the CWallet\n */\nCWallet *GetWalletForJSONRPCRequest(const JSONRPCRequest& request);\n\nstd::string HelpRequiringPassphrase(CWallet *);\nvoid EnsureWalletIsUnlocked(CWallet *);\nbool EnsureWalletIsAvailable(CWallet *, bool avoidException);\n\n#endif //BITCOIN_WALLET_RPCWALLET_H\n"
  },
  {
    "path": "src/wallet/test/accounting_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/wallet.h>\n\n#include <wallet/test/wallet_test_fixture.h>\n\n#include <stdint.h>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(accounting_tests, WalletTestingSetup)\n\nstatic void\nGetResults(CWallet *wallet, std::map<CAmount, CAccountingEntry>& results)\n{\n    std::list<CAccountingEntry> aes;\n\n    results.clear();\n    BOOST_CHECK(wallet->ReorderTransactions() == DB_LOAD_OK);\n    wallet->ListAccountCreditDebit(\"\", aes);\n    for (CAccountingEntry& ae : aes)\n    {\n        results[ae.nOrderPos] = ae;\n    }\n}\n\nBOOST_AUTO_TEST_CASE(acc_orderupgrade)\n{\n    std::vector<CWalletTx*> vpwtx;\n    CWalletTx wtx;\n    CAccountingEntry ae;\n    std::map<CAmount, CAccountingEntry> results;\n\n    LOCK(pwalletMain->cs_wallet);\n\n    ae.strAccount = \"\";\n    ae.nCreditDebit = 1;\n    ae.nTime = 1333333333;\n    ae.strOtherAccount = \"b\";\n    ae.strComment = \"\";\n    pwalletMain->AddAccountingEntry(ae);\n\n    wtx.mapValue[\"comment\"] = \"z\";\n    pwalletMain->AddToWallet(wtx);\n    vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]);\n    vpwtx[0]->nTimeReceived = (unsigned int)1333333335;\n    vpwtx[0]->nOrderPos = -1;\n\n    ae.nTime = 1333333336;\n    ae.strOtherAccount = \"c\";\n    pwalletMain->AddAccountingEntry(ae);\n\n    GetResults(pwalletMain.get(), results);\n\n    BOOST_CHECK(pwalletMain->nOrderPosNext == 3);\n    BOOST_CHECK(2 == results.size());\n    BOOST_CHECK(results[0].nTime == 1333333333);\n    BOOST_CHECK(results[0].strComment.empty());\n    BOOST_CHECK(1 == vpwtx[0]->nOrderPos);\n    BOOST_CHECK(results[2].nTime == 1333333336);\n    BOOST_CHECK(results[2].strOtherAccount == \"c\");\n\n\n    ae.nTime = 1333333330;\n    ae.strOtherAccount = \"d\";\n    ae.nOrderPos = pwalletMain->IncOrderPosNext();\n    pwalletMain->AddAccountingEntry(ae);\n\n    GetResults(pwalletMain.get(), results);\n\n    BOOST_CHECK(results.size() == 3);\n    BOOST_CHECK(pwalletMain->nOrderPosNext == 4);\n    BOOST_CHECK(results[0].nTime == 1333333333);\n    BOOST_CHECK(1 == vpwtx[0]->nOrderPos);\n    BOOST_CHECK(results[2].nTime == 1333333336);\n    BOOST_CHECK(results[3].nTime == 1333333330);\n    BOOST_CHECK(results[3].strComment.empty());\n\n\n    wtx.mapValue[\"comment\"] = \"y\";\n    {\n        CMutableTransaction tx(*wtx.tx);\n        --tx.nLockTime;  // Just to change the hash :)\n        wtx.SetTx(MakeTransactionRef(std::move(tx)));\n    }\n    pwalletMain->AddToWallet(wtx);\n    vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]);\n    vpwtx[1]->nTimeReceived = (unsigned int)1333333336;\n\n    wtx.mapValue[\"comment\"] = \"x\";\n    {\n        CMutableTransaction tx(*wtx.tx);\n        --tx.nLockTime;  // Just to change the hash :)\n        wtx.SetTx(MakeTransactionRef(std::move(tx)));\n    }\n    pwalletMain->AddToWallet(wtx);\n    vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]);\n    vpwtx[2]->nTimeReceived = (unsigned int)1333333329;\n    vpwtx[2]->nOrderPos = -1;\n\n    GetResults(pwalletMain.get(), results);\n\n    BOOST_CHECK(results.size() == 3);\n    BOOST_CHECK(pwalletMain->nOrderPosNext == 6);\n    BOOST_CHECK(0 == vpwtx[2]->nOrderPos);\n    BOOST_CHECK(results[1].nTime == 1333333333);\n    BOOST_CHECK(2 == vpwtx[0]->nOrderPos);\n    BOOST_CHECK(results[3].nTime == 1333333336);\n    BOOST_CHECK(results[4].nTime == 1333333330);\n    BOOST_CHECK(results[4].strComment.empty());\n    BOOST_CHECK(5 == vpwtx[1]->nOrderPos);\n\n\n    ae.nTime = 1333333334;\n    ae.strOtherAccount = \"e\";\n    ae.nOrderPos = -1;\n    pwalletMain->AddAccountingEntry(ae);\n\n    GetResults(pwalletMain.get(), results);\n\n    BOOST_CHECK(results.size() == 4);\n    BOOST_CHECK(pwalletMain->nOrderPosNext == 7);\n    BOOST_CHECK(0 == vpwtx[2]->nOrderPos);\n    BOOST_CHECK(results[1].nTime == 1333333333);\n    BOOST_CHECK(2 == vpwtx[0]->nOrderPos);\n    BOOST_CHECK(results[3].nTime == 1333333336);\n    BOOST_CHECK(results[3].strComment.empty());\n    BOOST_CHECK(results[4].nTime == 1333333330);\n    BOOST_CHECK(results[4].strComment.empty());\n    BOOST_CHECK(results[5].nTime == 1333333334);\n    BOOST_CHECK(6 == vpwtx[1]->nOrderPos);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/wallet/test/crypto_tests.cpp",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <test/test_bitcoin.h>\n#include <utilstrencodings.h>\n#include <wallet/crypter.h>\n\n#include <vector>\n\n#include <boost/test/unit_test.hpp>\n\nBOOST_FIXTURE_TEST_SUITE(wallet_crypto, BasicTestingSetup)\n\nclass TestCrypter\n{\npublic:\nstatic void TestPassphraseSingle(const std::vector<unsigned char>& vchSalt, const SecureString& passphrase, uint32_t rounds,\n                 const std::vector<unsigned char>& correctKey = std::vector<unsigned char>(),\n                 const std::vector<unsigned char>& correctIV=std::vector<unsigned char>())\n{\n    CCrypter crypt;\n    crypt.SetKeyFromPassphrase(passphrase, vchSalt, rounds, 0);\n\n    if(!correctKey.empty())\n        BOOST_CHECK_MESSAGE(memcmp(crypt.vchKey.data(), correctKey.data(), crypt.vchKey.size()) == 0, \\\n            HexStr(crypt.vchKey.begin(), crypt.vchKey.end()) + std::string(\" != \") + HexStr(correctKey.begin(), correctKey.end()));\n    if(!correctIV.empty())\n        BOOST_CHECK_MESSAGE(memcmp(crypt.vchIV.data(), correctIV.data(), crypt.vchIV.size()) == 0,\n            HexStr(crypt.vchIV.begin(), crypt.vchIV.end()) + std::string(\" != \") + HexStr(correctIV.begin(), correctIV.end()));\n}\n\nstatic void TestPassphrase(const std::vector<unsigned char>& vchSalt, const SecureString& passphrase, uint32_t rounds,\n                 const std::vector<unsigned char>& correctKey = std::vector<unsigned char>(),\n                 const std::vector<unsigned char>& correctIV=std::vector<unsigned char>())\n{\n    TestPassphraseSingle(vchSalt, passphrase, rounds, correctKey, correctIV);\n    for(SecureString::const_iterator i(passphrase.begin()); i != passphrase.end(); ++i)\n        TestPassphraseSingle(vchSalt, SecureString(i, passphrase.end()), rounds);\n}\n\nstatic void TestDecrypt(const CCrypter& crypt, const std::vector<unsigned char>& vchCiphertext, \\\n                        const std::vector<unsigned char>& vchPlaintext = std::vector<unsigned char>())\n{\n    CKeyingMaterial vchDecrypted;\n    crypt.Decrypt(vchCiphertext, vchDecrypted);\n    if (vchPlaintext.size())\n        BOOST_CHECK(CKeyingMaterial(vchPlaintext.begin(), vchPlaintext.end()) == vchDecrypted);\n}\n\nstatic void TestEncryptSingle(const CCrypter& crypt, const CKeyingMaterial& vchPlaintext,\n                       const std::vector<unsigned char>& vchCiphertextCorrect = std::vector<unsigned char>())\n{\n    std::vector<unsigned char> vchCiphertext;\n    crypt.Encrypt(vchPlaintext, vchCiphertext);\n\n    if (!vchCiphertextCorrect.empty())\n        BOOST_CHECK(vchCiphertext == vchCiphertextCorrect);\n\n    const std::vector<unsigned char> vchPlaintext2(vchPlaintext.begin(), vchPlaintext.end());\n    TestDecrypt(crypt, vchCiphertext, vchPlaintext2);\n}\n\nstatic void TestEncrypt(const CCrypter& crypt, const std::vector<unsigned char>& vchPlaintextIn, \\\n                       const std::vector<unsigned char>& vchCiphertextCorrect = std::vector<unsigned char>())\n{\n    TestEncryptSingle(crypt, CKeyingMaterial(vchPlaintextIn.begin(), vchPlaintextIn.end()), vchCiphertextCorrect);\n    for(std::vector<unsigned char>::const_iterator i(vchPlaintextIn.begin()); i != vchPlaintextIn.end(); ++i)\n        TestEncryptSingle(crypt, CKeyingMaterial(i, vchPlaintextIn.end()));\n}\n\n};\n\nBOOST_AUTO_TEST_CASE(passphrase) {\n    // These are expensive.\n\n    TestCrypter::TestPassphrase(ParseHex(\"0000deadbeef0000\"), \"test\", 25000, \\\n                                ParseHex(\"fc7aba077ad5f4c3a0988d8daa4810d0d4a0e3bcb53af662998898f33df0556a\"), \\\n                                ParseHex(\"cf2f2691526dd1aa220896fb8bf7c369\"));\n\n    std::string hash(GetRandHash().ToString());\n    std::vector<unsigned char> vchSalt(8);\n    GetRandBytes(vchSalt.data(), vchSalt.size());\n    uint32_t rounds = InsecureRand32();\n    if (rounds > 30000)\n        rounds = 30000;\n    TestCrypter::TestPassphrase(vchSalt, SecureString(hash.begin(), hash.end()), rounds);\n}\n\nBOOST_AUTO_TEST_CASE(encrypt) {\n    std::vector<unsigned char> vchSalt = ParseHex(\"0000deadbeef0000\");\n    BOOST_CHECK(vchSalt.size() == WALLET_CRYPTO_SALT_SIZE);\n    CCrypter crypt;\n    crypt.SetKeyFromPassphrase(\"passphrase\", vchSalt, 25000, 0);\n    TestCrypter::TestEncrypt(crypt, ParseHex(\"22bcade09ac03ff6386914359cfe885cfeb5f77ff0d670f102f619687453b29d\"));\n\n    for (int i = 0; i != 100; i++)\n    {\n        uint256 hash(GetRandHash());\n        TestCrypter::TestEncrypt(crypt, std::vector<unsigned char>(hash.begin(), hash.end()));\n    }\n\n}\n\nBOOST_AUTO_TEST_CASE(decrypt) {\n    std::vector<unsigned char> vchSalt = ParseHex(\"0000deadbeef0000\");\n    BOOST_CHECK(vchSalt.size() == WALLET_CRYPTO_SALT_SIZE);\n    CCrypter crypt;\n    crypt.SetKeyFromPassphrase(\"passphrase\", vchSalt, 25000, 0);\n\n    // Some corner cases the came up while testing\n    TestCrypter::TestDecrypt(crypt,ParseHex(\"795643ce39d736088367822cdc50535ec6f103715e3e48f4f3b1a60a08ef59ca\"));\n    TestCrypter::TestDecrypt(crypt,ParseHex(\"de096f4a8f9bd97db012aa9d90d74de8cdea779c3ee8bc7633d8b5d6da703486\"));\n    TestCrypter::TestDecrypt(crypt,ParseHex(\"32d0a8974e3afd9c6c3ebf4d66aa4e6419f8c173de25947f98cf8b7ace49449c\"));\n    TestCrypter::TestDecrypt(crypt,ParseHex(\"e7c055cca2faa78cb9ac22c9357a90b4778ded9b2cc220a14cea49f931e596ea\"));\n    TestCrypter::TestDecrypt(crypt,ParseHex(\"b88efddd668a6801d19516d6830da4ae9811988ccbaf40df8fbb72f3f4d335fd\"));\n    TestCrypter::TestDecrypt(crypt,ParseHex(\"8cae76aa6a43694e961ebcb28c8ca8f8540b84153d72865e8561ddd93fa7bfa9\"));\n\n    for (int i = 0; i != 100; i++)\n    {\n        uint256 hash(GetRandHash());\n        TestCrypter::TestDecrypt(crypt, std::vector<unsigned char>(hash.begin(), hash.end()));\n    }\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/wallet/test/wallet_test_fixture.cpp",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/test/wallet_test_fixture.h>\n\n#include <rpc/server.h>\n#include <wallet/db.h>\n\nWalletTestingSetup::WalletTestingSetup(const std::string& chainName):\n    TestingSetup(chainName)\n{\n    bitdb.MakeMock();\n\n    bool fFirstRun;\n    g_address_type = OUTPUT_TYPE_DEFAULT;\n    g_change_type = OUTPUT_TYPE_DEFAULT;\n    std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, \"wallet_test.dat\"));\n    pwalletMain = MakeUnique<CWallet>(std::move(dbw));\n    pwalletMain->LoadWallet(fFirstRun);\n    RegisterValidationInterface(pwalletMain.get());\n\n    RegisterWalletRPCCommands(tableRPC);\n}\n\nWalletTestingSetup::~WalletTestingSetup()\n{\n    UnregisterValidationInterface(pwalletMain.get());\n\n    bitdb.Flush(true);\n    bitdb.Reset();\n}\n"
  },
  {
    "path": "src/wallet/test/wallet_test_fixture.h",
    "content": "// Copyright (c) 2016-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_TEST_FIXTURE_H\n#define BITCOIN_WALLET_TEST_FIXTURE_H\n\n#include <test/test_bitcoin.h>\n\n#include <wallet/wallet.h>\n\n#include <memory>\n\n/** Testing setup and teardown for wallet.\n */\nstruct WalletTestingSetup: public TestingSetup {\n    explicit WalletTestingSetup(const std::string& chainName = CBaseChainParams::MAIN);\n    ~WalletTestingSetup();\n\n    std::unique_ptr<CWallet> pwalletMain;\n};\n\n#endif\n\n"
  },
  {
    "path": "src/wallet/test/wallet_tests.cpp",
    "content": "// Copyright (c) 2012-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/wallet.h>\n\n#include <memory>\n#include <set>\n#include <stdint.h>\n#include <utility>\n#include <vector>\n\n#include <consensus/validation.h>\n#include <rpc/server.h>\n#include <test/test_bitcoin.h>\n#include <validation.h>\n#include <wallet/coincontrol.h>\n#include <wallet/test/wallet_test_fixture.h>\n\n#include <boost/test/unit_test.hpp>\n#include <univalue.h>\n\nextern UniValue importmulti(const JSONRPCRequest& request);\nextern UniValue dumpwallet(const JSONRPCRequest& request);\nextern UniValue importwallet(const JSONRPCRequest& request);\n\n// how many times to run all the tests to have a chance to catch errors that only show up with particular random shuffles\n#define RUN_TESTS 100\n\n// some tests fail 1% of the time due to bad luck.\n// we repeat those tests this many times and only complain if all iterations of the test fail\n#define RANDOM_REPEATS 5\n\nstd::vector<std::unique_ptr<CWalletTx>> wtxn;\n\ntypedef std::set<CInputCoin> CoinSet;\n\nBOOST_FIXTURE_TEST_SUITE(wallet_tests, WalletTestingSetup)\n\nstatic const CWallet testWallet;\nstatic std::vector<COutput> vCoins;\n\nstatic void add_coin(const CAmount& nValue, int nAge = 6*24, bool fIsFromMe = false, int nInput=0)\n{\n    static int nextLockTime = 0;\n    CMutableTransaction tx;\n    tx.nLockTime = nextLockTime++;        // so all transactions get different hashes\n    tx.vout.resize(nInput+1);\n    tx.vout[nInput].nValue = nValue;\n    if (fIsFromMe) {\n        // IsFromMe() returns (GetDebit() > 0), and GetDebit() is 0 if vin.empty(),\n        // so stop vin being empty, and cache a non-zero Debit to fake out IsFromMe()\n        tx.vin.resize(1);\n    }\n    std::unique_ptr<CWalletTx> wtx(new CWalletTx(&testWallet, MakeTransactionRef(std::move(tx))));\n    if (fIsFromMe)\n    {\n        wtx->fDebitCached = true;\n        wtx->nDebitCached = 1;\n    }\n    COutput output(wtx.get(), nInput, nAge, true /* spendable */, true /* solvable */, true /* safe */);\n    vCoins.push_back(output);\n    wtxn.emplace_back(std::move(wtx));\n}\n\nstatic void empty_wallet(void)\n{\n    vCoins.clear();\n    wtxn.clear();\n}\n\nstatic bool equal_sets(CoinSet a, CoinSet b)\n{\n    std::pair<CoinSet::iterator, CoinSet::iterator> ret = mismatch(a.begin(), a.end(), b.begin());\n    return ret.first == a.end() && ret.second == b.end();\n}\n\nBOOST_AUTO_TEST_CASE(coin_selection_tests)\n{\n    CoinSet setCoinsRet, setCoinsRet2;\n    CAmount nValueRet;\n\n    LOCK(testWallet.cs_wallet);\n\n    // test multiple times to allow for differences in the shuffle order\n    for (int i = 0; i < RUN_TESTS; i++)\n    {\n        empty_wallet();\n\n        // with an empty wallet we can't even pay one cent\n        BOOST_CHECK(!testWallet.SelectCoinsMinConf( 1 * CENT, 1, 6, 0, vCoins, setCoinsRet, nValueRet));\n\n        add_coin(1*CENT, 4);        // add a new 1 cent coin\n\n        // with a new 1 cent coin, we still can't find a mature 1 cent\n        BOOST_CHECK(!testWallet.SelectCoinsMinConf( 1 * CENT, 1, 6, 0, vCoins, setCoinsRet, nValueRet));\n\n        // but we can find a new 1 cent\n        BOOST_CHECK( testWallet.SelectCoinsMinConf( 1 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 1 * CENT);\n\n        add_coin(2*CENT);           // add a mature 2 cent coin\n\n        // we can't make 3 cents of mature coins\n        BOOST_CHECK(!testWallet.SelectCoinsMinConf( 3 * CENT, 1, 6, 0, vCoins, setCoinsRet, nValueRet));\n\n        // we can make 3 cents of new  coins\n        BOOST_CHECK( testWallet.SelectCoinsMinConf( 3 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 3 * CENT);\n\n        add_coin(5*CENT);           // add a mature 5 cent coin,\n        add_coin(10*CENT, 3, true); // a new 10 cent coin sent from one of our own addresses\n        add_coin(20*CENT);          // and a mature 20 cent coin\n\n        // now we have new: 1+10=11 (of which 10 was self-sent), and mature: 2+5+20=27.  total = 38\n\n        // we can't make 38 cents only if we disallow new coins:\n        BOOST_CHECK(!testWallet.SelectCoinsMinConf(38 * CENT, 1, 6, 0, vCoins, setCoinsRet, nValueRet));\n        // we can't even make 37 cents if we don't allow new coins even if they're from us\n        BOOST_CHECK(!testWallet.SelectCoinsMinConf(38 * CENT, 6, 6, 0, vCoins, setCoinsRet, nValueRet));\n        // but we can make 37 cents if we accept new coins from ourself\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(37 * CENT, 1, 6, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 37 * CENT);\n        // and we can make 38 cents if we accept all new coins\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(38 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 38 * CENT);\n\n        // try making 34 cents from 1,2,5,10,20 - we can't do it exactly\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(34 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 35 * CENT);       // but 35 cents is closest\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 3U);     // the best should be 20+10+5.  it's incredibly unlikely the 1 or 2 got included (but possible)\n\n        // when we try making 7 cents, the smaller coins (1,2,5) are enough.  We should see just 2+5\n        BOOST_CHECK( testWallet.SelectCoinsMinConf( 7 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 7 * CENT);\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 2U);\n\n        // when we try making 8 cents, the smaller coins (1,2,5) are exactly enough.\n        BOOST_CHECK( testWallet.SelectCoinsMinConf( 8 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK(nValueRet == 8 * CENT);\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 3U);\n\n        // when we try making 9 cents, no subset of smaller coins is enough, and we get the next bigger coin (10)\n        BOOST_CHECK( testWallet.SelectCoinsMinConf( 9 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 10 * CENT);\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 1U);\n\n        // now clear out the wallet and start again to test choosing between subsets of smaller coins and the next biggest coin\n        empty_wallet();\n\n        add_coin( 6*CENT);\n        add_coin( 7*CENT);\n        add_coin( 8*CENT);\n        add_coin(20*CENT);\n        add_coin(30*CENT); // now we have 6+7+8+20+30 = 71 cents total\n\n        // check that we have 71 and not 72\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(71 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK(!testWallet.SelectCoinsMinConf(72 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n\n        // now try making 16 cents.  the best smaller coins can do is 6+7+8 = 21; not as good at the next biggest coin, 20\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(16 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 20 * CENT); // we should get 20 in one coin\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 1U);\n\n        add_coin( 5*CENT); // now we have 5+6+7+8+20+30 = 75 cents total\n\n        // now if we try making 16 cents again, the smaller coins can make 5+6+7 = 18 cents, better than the next biggest coin, 20\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(16 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 18 * CENT); // we should get 18 in 3 coins\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 3U);\n\n        add_coin( 18*CENT); // now we have 5+6+7+8+18+20+30\n\n        // and now if we try making 16 cents again, the smaller coins can make 5+6+7 = 18 cents, the same as the next biggest coin, 18\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(16 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 18 * CENT);  // we should get 18 in 1 coin\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 1U); // because in the event of a tie, the biggest coin wins\n\n        // now try making 11 cents.  we should get 5+6\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(11 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 11 * CENT);\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 2U);\n\n        // check that the smallest bigger coin is used\n        add_coin( 1*COIN);\n        add_coin( 2*COIN);\n        add_coin( 3*COIN);\n        add_coin( 4*COIN); // now we have 5+6+7+8+18+20+30+100+200+300+400 = 1094 cents\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(95 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 1 * COIN);  // we should get 1 BTC in 1 coin\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 1U);\n\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(195 * CENT, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 2 * COIN);  // we should get 2 BTC in 1 coin\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 1U);\n\n        // empty the wallet and start again, now with fractions of a cent, to test small change avoidance\n\n        empty_wallet();\n        add_coin(MIN_CHANGE * 1 / 10);\n        add_coin(MIN_CHANGE * 2 / 10);\n        add_coin(MIN_CHANGE * 3 / 10);\n        add_coin(MIN_CHANGE * 4 / 10);\n        add_coin(MIN_CHANGE * 5 / 10);\n\n        // try making 1 * MIN_CHANGE from the 1.5 * MIN_CHANGE\n        // we'll get change smaller than MIN_CHANGE whatever happens, so can expect MIN_CHANGE exactly\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(MIN_CHANGE, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, MIN_CHANGE);\n\n        // but if we add a bigger coin, small change is avoided\n        add_coin(1111*MIN_CHANGE);\n\n        // try making 1 from 0.1 + 0.2 + 0.3 + 0.4 + 0.5 + 1111 = 1112.5\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(1 * MIN_CHANGE, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 1 * MIN_CHANGE); // we should get the exact amount\n\n        // if we add more small coins:\n        add_coin(MIN_CHANGE * 6 / 10);\n        add_coin(MIN_CHANGE * 7 / 10);\n\n        // and try again to make 1.0 * MIN_CHANGE\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(1 * MIN_CHANGE, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 1 * MIN_CHANGE); // we should get the exact amount\n\n        // run the 'mtgox' test (see http://blockexplorer.com/tx/29a3efd3ef04f9153d47a990bd7b048a4b2d213daaa5fb8ed670fb85f13bdbcf)\n        // they tried to consolidate 10 50k coins into one 500k coin, and ended up with 50k in change\n        empty_wallet();\n        for (int j = 0; j < 20; j++)\n            add_coin(50000 * COIN);\n\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(500000 * COIN, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 500000 * COIN); // we should get the exact amount\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 10U); // in ten coins\n\n        // if there's not enough in the smaller coins to make at least 1 * MIN_CHANGE change (0.5+0.6+0.7 < 1.0+1.0),\n        // we need to try finding an exact subset anyway\n\n        // sometimes it will fail, and so we use the next biggest coin:\n        empty_wallet();\n        add_coin(MIN_CHANGE * 5 / 10);\n        add_coin(MIN_CHANGE * 6 / 10);\n        add_coin(MIN_CHANGE * 7 / 10);\n        add_coin(1111 * MIN_CHANGE);\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(1 * MIN_CHANGE, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 1111 * MIN_CHANGE); // we get the bigger coin\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 1U);\n\n        // but sometimes it's possible, and we use an exact subset (0.4 + 0.6 = 1.0)\n        empty_wallet();\n        add_coin(MIN_CHANGE * 4 / 10);\n        add_coin(MIN_CHANGE * 6 / 10);\n        add_coin(MIN_CHANGE * 8 / 10);\n        add_coin(1111 * MIN_CHANGE);\n        BOOST_CHECK( testWallet.SelectCoinsMinConf(MIN_CHANGE, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, MIN_CHANGE);   // we should get the exact amount\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 2U); // in two coins 0.4+0.6\n\n        // test avoiding small change\n        empty_wallet();\n        add_coin(MIN_CHANGE * 5 / 100);\n        add_coin(MIN_CHANGE * 1);\n        add_coin(MIN_CHANGE * 100);\n\n        // trying to make 100.01 from these three coins\n        BOOST_CHECK(testWallet.SelectCoinsMinConf(MIN_CHANGE * 10001 / 100, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, MIN_CHANGE * 10105 / 100); // we should get all coins\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 3U);\n\n        // but if we try to make 99.9, we should take the bigger of the two small coins to avoid small change\n        BOOST_CHECK(testWallet.SelectCoinsMinConf(MIN_CHANGE * 9990 / 100, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n        BOOST_CHECK_EQUAL(nValueRet, 101 * MIN_CHANGE);\n        BOOST_CHECK_EQUAL(setCoinsRet.size(), 2U);\n\n        // test with many inputs\n        for (CAmount amt=1500; amt < COIN; amt*=10) {\n             empty_wallet();\n             // Create 676 inputs (=  (old MAX_STANDARD_TX_SIZE == 100000)  / 148 bytes per input)\n             for (uint16_t j = 0; j < 676; j++)\n                 add_coin(amt);\n             BOOST_CHECK(testWallet.SelectCoinsMinConf(2000, 1, 1, 0, vCoins, setCoinsRet, nValueRet));\n             if (amt - 2000 < MIN_CHANGE) {\n                 // needs more than one input:\n                 uint16_t returnSize = std::ceil((2000.0 + MIN_CHANGE)/amt);\n                 CAmount returnValue = amt * returnSize;\n                 BOOST_CHECK_EQUAL(nValueRet, returnValue);\n                 BOOST_CHECK_EQUAL(setCoinsRet.size(), returnSize);\n             } else {\n                 // one input is sufficient:\n                 BOOST_CHECK_EQUAL(nValueRet, amt);\n                 BOOST_CHECK_EQUAL(setCoinsRet.size(), 1U);\n             }\n        }\n\n        // test randomness\n        {\n            empty_wallet();\n            for (int i2 = 0; i2 < 100; i2++)\n                add_coin(COIN);\n\n            // picking 50 from 100 coins doesn't depend on the shuffle,\n            // but does depend on randomness in the stochastic approximation code\n            BOOST_CHECK(testWallet.SelectCoinsMinConf(50 * COIN, 1, 6, 0, vCoins, setCoinsRet , nValueRet));\n            BOOST_CHECK(testWallet.SelectCoinsMinConf(50 * COIN, 1, 6, 0, vCoins, setCoinsRet2, nValueRet));\n            BOOST_CHECK(!equal_sets(setCoinsRet, setCoinsRet2));\n\n            int fails = 0;\n            for (int j = 0; j < RANDOM_REPEATS; j++)\n            {\n                // selecting 1 from 100 identical coins depends on the shuffle; this test will fail 1% of the time\n                // run the test RANDOM_REPEATS times and only complain if all of them fail\n                BOOST_CHECK(testWallet.SelectCoinsMinConf(COIN, 1, 6, 0, vCoins, setCoinsRet , nValueRet));\n                BOOST_CHECK(testWallet.SelectCoinsMinConf(COIN, 1, 6, 0, vCoins, setCoinsRet2, nValueRet));\n                if (equal_sets(setCoinsRet, setCoinsRet2))\n                    fails++;\n            }\n            BOOST_CHECK_NE(fails, RANDOM_REPEATS);\n\n            // add 75 cents in small change.  not enough to make 90 cents,\n            // then try making 90 cents.  there are multiple competing \"smallest bigger\" coins,\n            // one of which should be picked at random\n            add_coin(5 * CENT);\n            add_coin(10 * CENT);\n            add_coin(15 * CENT);\n            add_coin(20 * CENT);\n            add_coin(25 * CENT);\n\n            fails = 0;\n            for (int j = 0; j < RANDOM_REPEATS; j++)\n            {\n                // selecting 1 from 100 identical coins depends on the shuffle; this test will fail 1% of the time\n                // run the test RANDOM_REPEATS times and only complain if all of them fail\n                BOOST_CHECK(testWallet.SelectCoinsMinConf(90*CENT, 1, 6, 0, vCoins, setCoinsRet , nValueRet));\n                BOOST_CHECK(testWallet.SelectCoinsMinConf(90*CENT, 1, 6, 0, vCoins, setCoinsRet2, nValueRet));\n                if (equal_sets(setCoinsRet, setCoinsRet2))\n                    fails++;\n            }\n            BOOST_CHECK_NE(fails, RANDOM_REPEATS);\n        }\n    }\n    empty_wallet();\n}\n\nBOOST_AUTO_TEST_CASE(ApproximateBestSubset)\n{\n    CoinSet setCoinsRet;\n    CAmount nValueRet;\n\n    LOCK(testWallet.cs_wallet);\n\n    empty_wallet();\n\n    // Test vValue sort order\n    for (int i = 0; i < 1000; i++)\n        add_coin(1000 * COIN);\n    add_coin(3 * COIN);\n\n    BOOST_CHECK(testWallet.SelectCoinsMinConf(1003 * COIN, 1, 6, 0, vCoins, setCoinsRet, nValueRet));\n    BOOST_CHECK_EQUAL(nValueRet, 1003 * COIN);\n    BOOST_CHECK_EQUAL(setCoinsRet.size(), 2U);\n\n    empty_wallet();\n}\n\nstatic void AddKey(CWallet& wallet, const CKey& key)\n{\n    LOCK(wallet.cs_wallet);\n    wallet.AddKeyPubKey(key, key.GetPubKey());\n}\n\nBOOST_FIXTURE_TEST_CASE(rescan, TestChain100Setup)\n{\n    // Cap last block file size, and mine new block in a new block file.\n    CBlockIndex* const nullBlock = nullptr;\n    CBlockIndex* oldTip = chainActive.Tip();\n    GetBlockFileInfo(oldTip->GetBlockPos().nFile)->nSize = MAX_BLOCKFILE_SIZE;\n    CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey()));\n    CBlockIndex* newTip = chainActive.Tip();\n\n    LOCK(cs_main);\n\n    // Verify ScanForWalletTransactions picks up transactions in both the old\n    // and new block files.\n    {\n        CWallet wallet;\n        AddKey(wallet, coinbaseKey);\n        WalletRescanReserver reserver(&wallet);\n        reserver.reserve();\n        BOOST_CHECK_EQUAL(nullBlock, wallet.ScanForWalletTransactions(oldTip, nullptr, reserver));\n        BOOST_CHECK_EQUAL(wallet.GetImmatureBalance(), 2 * 42.94967296 * COIN); // (was 100 = 2 * 50)\n    }\n\n    // Prune the older block file.\n    PruneOneBlockFile(oldTip->GetBlockPos().nFile);\n    UnlinkPrunedFiles({oldTip->GetBlockPos().nFile});\n\n    // Verify ScanForWalletTransactions only picks transactions in the new block\n    // file.\n    {\n        CWallet wallet;\n        AddKey(wallet, coinbaseKey);\n        WalletRescanReserver reserver(&wallet);\n        reserver.reserve();\n        BOOST_CHECK_EQUAL(oldTip, wallet.ScanForWalletTransactions(oldTip, nullptr, reserver));\n        BOOST_CHECK_EQUAL(wallet.GetImmatureBalance(), 42.94967296 * COIN); // (was 50)\n    }\n\n    // Verify importmulti RPC returns failure for a key whose creation time is\n    // before the missing block, and success for a key whose creation time is\n    // after.\n    {\n        CWallet wallet;\n        vpwallets.insert(vpwallets.begin(), &wallet);\n        UniValue keys;\n        keys.setArray();\n        UniValue key;\n        key.setObject();\n        key.pushKV(\"scriptPubKey\", HexStr(GetScriptForRawPubKey(coinbaseKey.GetPubKey())));\n        key.pushKV(\"timestamp\", 0);\n        key.pushKV(\"internal\", UniValue(true));\n        keys.push_back(key);\n        key.clear();\n        key.setObject();\n        CKey futureKey;\n        futureKey.MakeNewKey(true);\n        key.pushKV(\"scriptPubKey\", HexStr(GetScriptForRawPubKey(futureKey.GetPubKey())));\n        key.pushKV(\"timestamp\", newTip->GetBlockTimeMax() + TIMESTAMP_WINDOW + 1);\n        key.pushKV(\"internal\", UniValue(true));\n        keys.push_back(key);\n        JSONRPCRequest request;\n        request.params.setArray();\n        request.params.push_back(keys);\n\n        UniValue response = importmulti(request);\n        BOOST_CHECK_EQUAL(response.write(),\n            strprintf(\"[{\\\"success\\\":false,\\\"error\\\":{\\\"code\\\":-1,\\\"message\\\":\\\"Rescan failed for key with creation \"\n                      \"timestamp %d. There was an error reading a block from time %d, which is after or within %d \"\n                      \"seconds of key creation, and could contain transactions pertaining to the key. As a result, \"\n                      \"transactions and coins using this key may not appear in the wallet. This error could be caused \"\n                      \"by pruning or data corruption (see sugarchaind log for details) and could be dealt with by \"\n                      \"downloading and rescanning the relevant blocks (see -reindex and -rescan \"\n                      \"options).\\\"}},{\\\"success\\\":true}]\",\n                              0, oldTip->GetBlockTimeMax(), TIMESTAMP_WINDOW));\n        vpwallets.erase(vpwallets.begin());\n    }\n}\n\n// Verify importwallet RPC starts rescan at earliest block with timestamp\n// greater or equal than key birthday. Previously there was a bug where\n// importwallet RPC would start the scan at the latest block with timestamp less\n// than or equal to key birthday.\nBOOST_FIXTURE_TEST_CASE(importwallet_rescan, TestChain100Setup)\n{\n    g_address_type = OUTPUT_TYPE_DEFAULT;\n    g_change_type = OUTPUT_TYPE_DEFAULT;\n\n    // Create two blocks with same timestamp to verify that importwallet rescan\n    // will pick up both blocks, not just the first.\n    const int64_t BLOCK_TIME = chainActive.Tip()->GetBlockTimeMax() + 5;\n    SetMockTime(BLOCK_TIME);\n    coinbaseTxns.emplace_back(*CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);\n    coinbaseTxns.emplace_back(*CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);\n\n    // Set key birthday to block time increased by the timestamp window, so\n    // rescan will start at the block time.\n    const int64_t KEY_TIME = BLOCK_TIME + TIMESTAMP_WINDOW;\n    SetMockTime(KEY_TIME);\n    coinbaseTxns.emplace_back(*CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey())).vtx[0]);\n\n    LOCK(cs_main);\n\n    // Import key into wallet and call dumpwallet to create backup file.\n    {\n        CWallet wallet;\n        LOCK(wallet.cs_wallet);\n        wallet.mapKeyMetadata[coinbaseKey.GetPubKey().GetID()].nCreateTime = KEY_TIME;\n        wallet.AddKeyPubKey(coinbaseKey, coinbaseKey.GetPubKey());\n\n        JSONRPCRequest request;\n        request.params.setArray();\n        request.params.push_back((pathTemp / \"wallet.backup\").string());\n        vpwallets.insert(vpwallets.begin(), &wallet);\n        ::dumpwallet(request);\n    }\n\n    // Call importwallet RPC and verify all blocks with timestamps >= BLOCK_TIME\n    // were scanned, and no prior blocks were scanned.\n    {\n        CWallet wallet;\n\n        JSONRPCRequest request;\n        request.params.setArray();\n        request.params.push_back((pathTemp / \"wallet.backup\").string());\n        vpwallets[0] = &wallet;\n        ::importwallet(request);\n\n        LOCK(wallet.cs_wallet);\n        BOOST_CHECK_EQUAL(wallet.mapWallet.size(), 3);\n        BOOST_CHECK_EQUAL(coinbaseTxns.size(), 103);\n        for (size_t i = 0; i < coinbaseTxns.size(); ++i) {\n            bool found = wallet.GetWalletTx(coinbaseTxns[i].GetHash());\n            bool expected = i >= 100;\n            BOOST_CHECK_EQUAL(found, expected);\n        }\n    }\n\n    SetMockTime(0);\n    vpwallets.erase(vpwallets.begin());\n}\n\n// Check that GetImmatureCredit() returns a newly calculated value instead of\n// the cached value after a MarkDirty() call.\n//\n// This is a regression test written to verify a bugfix for the immature credit\n// function. Similar tests probably should be written for the other credit and\n// debit functions.\nBOOST_FIXTURE_TEST_CASE(coin_mark_dirty_immature_credit, TestChain100Setup)\n{\n    CWallet wallet;\n    CWalletTx wtx(&wallet, MakeTransactionRef(coinbaseTxns.back()));\n    LOCK2(cs_main, wallet.cs_wallet);\n    wtx.hashBlock = chainActive.Tip()->GetBlockHash();\n    wtx.nIndex = 0;\n\n    // Call GetImmatureCredit() once before adding the key to the wallet to\n    // cache the current immature credit amount, which is 0.\n    BOOST_CHECK_EQUAL(wtx.GetImmatureCredit(), 0);\n\n    // Invalidate the cached value, add the key, and make sure a new immature\n    // credit amount is calculated.\n    wtx.MarkDirty();\n    wallet.AddKeyPubKey(coinbaseKey, coinbaseKey.GetPubKey());\n    BOOST_CHECK_EQUAL(wtx.GetImmatureCredit(), 42.94967296 * COIN); // (was 50)\n}\n\nstatic int64_t AddTx(CWallet& wallet, uint32_t lockTime, int64_t mockTime, int64_t blockTime)\n{\n    CMutableTransaction tx;\n    tx.nLockTime = lockTime;\n    SetMockTime(mockTime);\n    CBlockIndex* block = nullptr;\n    if (blockTime > 0) {\n        LOCK(cs_main);\n        auto inserted = mapBlockIndex.emplace(GetRandHash(), new CBlockIndex);\n        assert(inserted.second);\n        const uint256& hash = inserted.first->first;\n        block = inserted.first->second;\n        block->nTime = blockTime;\n        block->phashBlock = &hash;\n    }\n\n    CWalletTx wtx(&wallet, MakeTransactionRef(tx));\n    if (block) {\n        wtx.SetMerkleBranch(block, 0);\n    }\n    wallet.AddToWallet(wtx);\n    LOCK(wallet.cs_wallet);\n    return wallet.mapWallet.at(wtx.GetHash()).nTimeSmart;\n}\n\n// Simple test to verify assignment of CWalletTx::nSmartTime value. Could be\n// expanded to cover more corner cases of smart time logic.\nBOOST_AUTO_TEST_CASE(ComputeTimeSmart)\n{\n    CWallet wallet;\n\n    // New transaction should use clock time if lower than block time.\n    BOOST_CHECK_EQUAL(AddTx(wallet, 1, 100, 120), 100);\n\n    // Test that updating existing transaction does not change smart time.\n    BOOST_CHECK_EQUAL(AddTx(wallet, 1, 200, 220), 100);\n\n    // New transaction should use clock time if there's no block time.\n    BOOST_CHECK_EQUAL(AddTx(wallet, 2, 300, 0), 300);\n\n    // New transaction should use block time if lower than clock time.\n    BOOST_CHECK_EQUAL(AddTx(wallet, 3, 420, 400), 400);\n\n    // New transaction should use latest entry time if higher than\n    // min(block time, clock time).\n    BOOST_CHECK_EQUAL(AddTx(wallet, 4, 500, 390), 400);\n\n    // If there are future entries, new transaction should use time of the\n    // newest entry that is no more than 300 seconds ahead of the clock time.\n    BOOST_CHECK_EQUAL(AddTx(wallet, 5, 50, 600), 300);\n\n    // Reset mock time for other tests.\n    SetMockTime(0);\n}\n\nBOOST_AUTO_TEST_CASE(LoadReceiveRequests)\n{\n    CTxDestination dest = CKeyID();\n    LOCK(pwalletMain->cs_wallet);\n    pwalletMain->AddDestData(dest, \"misc\", \"val_misc\");\n    pwalletMain->AddDestData(dest, \"rr0\", \"val_rr0\");\n    pwalletMain->AddDestData(dest, \"rr1\", \"val_rr1\");\n\n    auto values = pwalletMain->GetDestValues(\"rr\");\n    BOOST_CHECK_EQUAL(values.size(), 2);\n    BOOST_CHECK_EQUAL(values[0], \"val_rr0\");\n    BOOST_CHECK_EQUAL(values[1], \"val_rr1\");\n}\n\nclass ListCoinsTestingSetup : public TestChain100Setup\n{\npublic:\n    ListCoinsTestingSetup()\n    {\n        CreateAndProcessBlock({}, GetScriptForRawPubKey(coinbaseKey.GetPubKey()));\n        ::bitdb.MakeMock();\n        g_address_type = OUTPUT_TYPE_DEFAULT;\n        g_change_type = OUTPUT_TYPE_DEFAULT;\n        wallet.reset(new CWallet(std::unique_ptr<CWalletDBWrapper>(new CWalletDBWrapper(&bitdb, \"wallet_test.dat\"))));\n        bool firstRun;\n        wallet->LoadWallet(firstRun);\n        AddKey(*wallet, coinbaseKey);\n        WalletRescanReserver reserver(wallet.get());\n        reserver.reserve();\n        wallet->ScanForWalletTransactions(chainActive.Genesis(), nullptr, reserver);\n    }\n\n    ~ListCoinsTestingSetup()\n    {\n        wallet.reset();\n        ::bitdb.Flush(true);\n        ::bitdb.Reset();\n    }\n\n    CWalletTx& AddTx(CRecipient recipient)\n    {\n        CWalletTx wtx;\n        CReserveKey reservekey(wallet.get());\n        CAmount fee;\n        int changePos = -1;\n        std::string error;\n        CCoinControl dummy;\n        BOOST_CHECK(wallet->CreateTransaction({recipient}, wtx, reservekey, fee, changePos, error, dummy));\n        CValidationState state;\n        BOOST_CHECK(wallet->CommitTransaction(wtx, reservekey, nullptr, state));\n        CMutableTransaction blocktx;\n        {\n            LOCK(wallet->cs_wallet);\n            blocktx = CMutableTransaction(*wallet->mapWallet.at(wtx.GetHash()).tx);\n        }\n        CreateAndProcessBlock({CMutableTransaction(blocktx)}, GetScriptForRawPubKey(coinbaseKey.GetPubKey()));\n        LOCK(wallet->cs_wallet);\n        auto it = wallet->mapWallet.find(wtx.GetHash());\n        BOOST_CHECK(it != wallet->mapWallet.end());\n        it->second.SetMerkleBranch(chainActive.Tip(), 1);\n        return it->second;\n    }\n\n    std::unique_ptr<CWallet> wallet;\n};\n\nBOOST_FIXTURE_TEST_CASE(ListCoins, ListCoinsTestingSetup)\n{\n    std::string coinbaseAddress = coinbaseKey.GetPubKey().GetID().ToString();\n\n    // Confirm ListCoins initially returns 1 coin grouped under coinbaseKey\n    // address.\n    auto list = wallet->ListCoins();\n    BOOST_CHECK_EQUAL(list.size(), 1);\n    BOOST_CHECK_EQUAL(boost::get<CKeyID>(list.begin()->first).ToString(), coinbaseAddress);\n    BOOST_CHECK_EQUAL(list.begin()->second.size(), 1);\n\n    // Check initial balance from one mature coinbase transaction.\n    BOOST_CHECK_EQUAL(42.94967296 * COIN, wallet->GetAvailableBalance()); // (was 50)\n\n    // Add a transaction creating a change address, and confirm ListCoins still\n    // returns the coin associated with the change address underneath the\n    // coinbaseKey pubkey, even though the change address has a different\n    // pubkey.\n    AddTx(CRecipient{GetScriptForRawPubKey({}), 1 * COIN, false /* subtract fee */});\n    list = wallet->ListCoins();\n    BOOST_CHECK_EQUAL(list.size(), 1);\n    BOOST_CHECK_EQUAL(boost::get<CKeyID>(list.begin()->first).ToString(), coinbaseAddress);\n    BOOST_CHECK_EQUAL(list.begin()->second.size(), 2);\n\n    // Lock both coins. Confirm number of available coins drops to 0.\n    std::vector<COutput> available;\n    wallet->AvailableCoins(available);\n    BOOST_CHECK_EQUAL(available.size(), 2);\n    for (const auto& group : list) {\n        for (const auto& coin : group.second) {\n            LOCK(wallet->cs_wallet);\n            wallet->LockCoin(COutPoint(coin.tx->GetHash(), coin.i));\n        }\n    }\n    wallet->AvailableCoins(available);\n    BOOST_CHECK_EQUAL(available.size(), 0);\n\n    // Confirm ListCoins still returns same result as before, despite coins\n    // being locked.\n    list = wallet->ListCoins();\n    BOOST_CHECK_EQUAL(list.size(), 1);\n    BOOST_CHECK_EQUAL(boost::get<CKeyID>(list.begin()->first).ToString(), coinbaseAddress);\n    BOOST_CHECK_EQUAL(list.begin()->second.size(), 2);\n}\n\nBOOST_AUTO_TEST_SUITE_END()\n"
  },
  {
    "path": "src/wallet/wallet.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/wallet.h>\n\n#include <base58.h>\n#include <checkpoints.h>\n#include <chain.h>\n#include <wallet/coincontrol.h>\n#include <consensus/consensus.h>\n#include <consensus/validation.h>\n#include <fs.h>\n#include <wallet/init.h>\n#include <key.h>\n#include <keystore.h>\n#include <validation.h>\n#include <net.h>\n#include <policy/fees.h>\n#include <policy/policy.h>\n#include <policy/rbf.h>\n#include <primitives/block.h>\n#include <primitives/transaction.h>\n#include <script/script.h>\n#include <scheduler.h>\n#include <timedata.h>\n#include <txmempool.h>\n#include <util.h>\n#include <utilmoneystr.h>\n#include <wallet/fees.h>\n\n#include <assert.h>\n#include <future>\n\n#include <boost/algorithm/string/replace.hpp>\n#include <boost/thread.hpp>\n\nstd::vector<CWalletRef> vpwallets;\n/** Transaction fee set by the user */\nCFeeRate payTxFee(DEFAULT_TRANSACTION_FEE);\nunsigned int nTxConfirmTarget = DEFAULT_TX_CONFIRM_TARGET;\nbool bSpendZeroConfChange = DEFAULT_SPEND_ZEROCONF_CHANGE;\nbool fWalletRbf = DEFAULT_WALLET_RBF;\nOutputType g_address_type = OUTPUT_TYPE_NONE;\nOutputType g_change_type = OUTPUT_TYPE_NONE;\n\nconst char * DEFAULT_WALLET_DAT = \"wallet.dat\";\nconst uint32_t BIP32_HARDENED_KEY_LIMIT = 0x80000000;\n\n/**\n * Fees smaller than this (in satoshi) are considered zero fee (for transaction creation)\n * Override with -mintxfee\n */\nCFeeRate CWallet::minTxFee = CFeeRate(DEFAULT_TRANSACTION_MINFEE);\n/**\n * If fee estimation does not have enough data to provide estimates, use this fee instead.\n * Has no effect if not using fee estimation\n * Override with -fallbackfee\n */\nCFeeRate CWallet::fallbackFee = CFeeRate(DEFAULT_FALLBACK_FEE);\n\nCFeeRate CWallet::m_discard_rate = CFeeRate(DEFAULT_DISCARD_FEE);\n\nconst uint256 CMerkleTx::ABANDON_HASH(uint256S(\"0000000000000000000000000000000000000000000000000000000000000001\"));\n\n/** @defgroup mapWallet\n *\n * @{\n */\n\nstruct CompareValueOnly\n{\n    bool operator()(const CInputCoin& t1,\n                    const CInputCoin& t2) const\n    {\n        return t1.txout.nValue < t2.txout.nValue;\n    }\n};\n\nstd::string COutput::ToString() const\n{\n    return strprintf(\"COutput(%s, %d, %d) [%s]\", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->tx->vout[i].nValue));\n}\n\nclass CAffectedKeysVisitor : public boost::static_visitor<void> {\nprivate:\n    const CKeyStore &keystore;\n    std::vector<CKeyID> &vKeys;\n\npublic:\n    CAffectedKeysVisitor(const CKeyStore &keystoreIn, std::vector<CKeyID> &vKeysIn) : keystore(keystoreIn), vKeys(vKeysIn) {}\n\n    void Process(const CScript &script) {\n        txnouttype type;\n        std::vector<CTxDestination> vDest;\n        int nRequired;\n        if (ExtractDestinations(script, type, vDest, nRequired)) {\n            for (const CTxDestination &dest : vDest)\n                boost::apply_visitor(*this, dest);\n        }\n    }\n\n    void operator()(const CKeyID &keyId) {\n        if (keystore.HaveKey(keyId))\n            vKeys.push_back(keyId);\n    }\n\n    void operator()(const CScriptID &scriptId) {\n        CScript script;\n        if (keystore.GetCScript(scriptId, script))\n            Process(script);\n    }\n\n    void operator()(const WitnessV0ScriptHash& scriptID)\n    {\n        CScriptID id;\n        CRIPEMD160().Write(scriptID.begin(), 32).Finalize(id.begin());\n        CScript script;\n        if (keystore.GetCScript(id, script)) {\n            Process(script);\n        }\n    }\n\n    void operator()(const WitnessV0KeyHash& keyid)\n    {\n        CKeyID id(keyid);\n        if (keystore.HaveKey(id)) {\n            vKeys.push_back(id);\n        }\n    }\n\n    template<typename X>\n    void operator()(const X &none) {}\n};\n\nconst CWalletTx* CWallet::GetWalletTx(const uint256& hash) const\n{\n    LOCK(cs_wallet);\n    std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(hash);\n    if (it == mapWallet.end())\n        return nullptr;\n    return &(it->second);\n}\n\nCPubKey CWallet::GenerateNewKey(CWalletDB &walletdb, bool internal)\n{\n    AssertLockHeld(cs_wallet); // mapKeyMetadata\n    bool fCompressed = CanSupportFeature(FEATURE_COMPRPUBKEY); // default to compressed public keys if we want 0.6.0 wallets\n\n    CKey secret;\n\n    // Create new metadata\n    int64_t nCreationTime = GetTime();\n    CKeyMetadata metadata(nCreationTime);\n\n    // use HD key derivation if HD was enabled during wallet creation\n    if (IsHDEnabled()) {\n        DeriveNewChildKey(walletdb, metadata, secret, (CanSupportFeature(FEATURE_HD_SPLIT) ? internal : false));\n    } else {\n        secret.MakeNewKey(fCompressed);\n    }\n\n    // Compressed public keys were introduced in version 0.6.0\n    if (fCompressed) {\n        SetMinVersion(FEATURE_COMPRPUBKEY);\n    }\n\n    CPubKey pubkey = secret.GetPubKey();\n    assert(secret.VerifyPubKey(pubkey));\n\n    mapKeyMetadata[pubkey.GetID()] = metadata;\n    UpdateTimeFirstKey(nCreationTime);\n\n    if (!AddKeyPubKeyWithDB(walletdb, secret, pubkey)) {\n        throw std::runtime_error(std::string(__func__) + \": AddKey failed\");\n    }\n    return pubkey;\n}\n\nvoid CWallet::DeriveNewChildKey(CWalletDB &walletdb, CKeyMetadata& metadata, CKey& secret, bool internal)\n{\n    // for now we use a fixed keypath scheme of m/0'/0'/k\n    CKey key;                      //master key seed (256bit)\n    CExtKey masterKey;             //hd master key\n    CExtKey accountKey;            //key at m/0'\n    CExtKey chainChildKey;         //key at m/0'/0' (external) or m/0'/1' (internal)\n    CExtKey childKey;              //key at m/0'/0'/<n>'\n\n    // try to get the master key\n    if (!GetKey(hdChain.masterKeyID, key))\n        throw std::runtime_error(std::string(__func__) + \": Master key not found\");\n\n    masterKey.SetMaster(key.begin(), key.size());\n\n    // derive m/0'\n    // use hardened derivation (child keys >= 0x80000000 are hardened after bip32)\n    masterKey.Derive(accountKey, BIP32_HARDENED_KEY_LIMIT);\n\n    // derive m/0'/0' (external chain) OR m/0'/1' (internal chain)\n    assert(internal ? CanSupportFeature(FEATURE_HD_SPLIT) : true);\n    accountKey.Derive(chainChildKey, BIP32_HARDENED_KEY_LIMIT+(internal ? 1 : 0));\n\n    // derive child key at next index, skip keys already known to the wallet\n    do {\n        // always derive hardened keys\n        // childIndex | BIP32_HARDENED_KEY_LIMIT = derive childIndex in hardened child-index-range\n        // example: 1 | BIP32_HARDENED_KEY_LIMIT == 0x80000001 == 2147483649\n        if (internal) {\n            chainChildKey.Derive(childKey, hdChain.nInternalChainCounter | BIP32_HARDENED_KEY_LIMIT);\n            metadata.hdKeypath = \"m/0'/1'/\" + std::to_string(hdChain.nInternalChainCounter) + \"'\";\n            hdChain.nInternalChainCounter++;\n        }\n        else {\n            chainChildKey.Derive(childKey, hdChain.nExternalChainCounter | BIP32_HARDENED_KEY_LIMIT);\n            metadata.hdKeypath = \"m/0'/0'/\" + std::to_string(hdChain.nExternalChainCounter) + \"'\";\n            hdChain.nExternalChainCounter++;\n        }\n    } while (HaveKey(childKey.key.GetPubKey().GetID()));\n    secret = childKey.key;\n    metadata.hdMasterKeyID = hdChain.masterKeyID;\n    // update the chain model in the database\n    if (!walletdb.WriteHDChain(hdChain))\n        throw std::runtime_error(std::string(__func__) + \": Writing HD chain model failed\");\n}\n\nbool CWallet::AddKeyPubKeyWithDB(CWalletDB &walletdb, const CKey& secret, const CPubKey &pubkey)\n{\n    AssertLockHeld(cs_wallet); // mapKeyMetadata\n\n    // CCryptoKeyStore has no concept of wallet databases, but calls AddCryptedKey\n    // which is overridden below.  To avoid flushes, the database handle is\n    // tunneled through to it.\n    bool needsDB = !pwalletdbEncryption;\n    if (needsDB) {\n        pwalletdbEncryption = &walletdb;\n    }\n    if (!CCryptoKeyStore::AddKeyPubKey(secret, pubkey)) {\n        if (needsDB) pwalletdbEncryption = nullptr;\n        return false;\n    }\n    if (needsDB) pwalletdbEncryption = nullptr;\n\n    // check if we need to remove from watch-only\n    CScript script;\n    script = GetScriptForDestination(pubkey.GetID());\n    if (HaveWatchOnly(script)) {\n        RemoveWatchOnly(script);\n    }\n    script = GetScriptForRawPubKey(pubkey);\n    if (HaveWatchOnly(script)) {\n        RemoveWatchOnly(script);\n    }\n\n    if (!IsCrypted()) {\n        return walletdb.WriteKey(pubkey,\n                                                 secret.GetPrivKey(),\n                                                 mapKeyMetadata[pubkey.GetID()]);\n    }\n    return true;\n}\n\nbool CWallet::AddKeyPubKey(const CKey& secret, const CPubKey &pubkey)\n{\n    CWalletDB walletdb(*dbw);\n    return CWallet::AddKeyPubKeyWithDB(walletdb, secret, pubkey);\n}\n\nbool CWallet::AddCryptedKey(const CPubKey &vchPubKey,\n                            const std::vector<unsigned char> &vchCryptedSecret)\n{\n    if (!CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret))\n        return false;\n    {\n        LOCK(cs_wallet);\n        if (pwalletdbEncryption)\n            return pwalletdbEncryption->WriteCryptedKey(vchPubKey,\n                                                        vchCryptedSecret,\n                                                        mapKeyMetadata[vchPubKey.GetID()]);\n        else\n            return CWalletDB(*dbw).WriteCryptedKey(vchPubKey,\n                                                            vchCryptedSecret,\n                                                            mapKeyMetadata[vchPubKey.GetID()]);\n    }\n}\n\nbool CWallet::LoadKeyMetadata(const CKeyID& keyID, const CKeyMetadata &meta)\n{\n    AssertLockHeld(cs_wallet); // mapKeyMetadata\n    UpdateTimeFirstKey(meta.nCreateTime);\n    mapKeyMetadata[keyID] = meta;\n    return true;\n}\n\nbool CWallet::LoadScriptMetadata(const CScriptID& script_id, const CKeyMetadata &meta)\n{\n    AssertLockHeld(cs_wallet); // m_script_metadata\n    UpdateTimeFirstKey(meta.nCreateTime);\n    m_script_metadata[script_id] = meta;\n    return true;\n}\n\nbool CWallet::LoadCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret)\n{\n    return CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret);\n}\n\n/**\n * Update wallet first key creation time. This should be called whenever keys\n * are added to the wallet, with the oldest key creation time.\n */\nvoid CWallet::UpdateTimeFirstKey(int64_t nCreateTime)\n{\n    AssertLockHeld(cs_wallet);\n    if (nCreateTime <= 1) {\n        // Cannot determine birthday information, so set the wallet birthday to\n        // the beginning of time.\n        nTimeFirstKey = 1;\n    } else if (!nTimeFirstKey || nCreateTime < nTimeFirstKey) {\n        nTimeFirstKey = nCreateTime;\n    }\n}\n\nbool CWallet::AddCScript(const CScript& redeemScript)\n{\n    if (!CCryptoKeyStore::AddCScript(redeemScript))\n        return false;\n    return CWalletDB(*dbw).WriteCScript(Hash160(redeemScript), redeemScript);\n}\n\nbool CWallet::LoadCScript(const CScript& redeemScript)\n{\n    /* A sanity check was added in pull #3843 to avoid adding redeemScripts\n     * that never can be redeemed. However, old wallets may still contain\n     * these. Do not add them to the wallet and warn. */\n    if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE)\n    {\n        std::string strAddr = EncodeDestination(CScriptID(redeemScript));\n        LogPrintf(\"%s: Warning: This wallet contains a redeemScript of size %i which exceeds maximum size %i thus can never be redeemed. Do not use address %s.\\n\",\n            __func__, redeemScript.size(), MAX_SCRIPT_ELEMENT_SIZE, strAddr);\n        return true;\n    }\n\n    return CCryptoKeyStore::AddCScript(redeemScript);\n}\n\nbool CWallet::AddWatchOnly(const CScript& dest)\n{\n    if (!CCryptoKeyStore::AddWatchOnly(dest))\n        return false;\n    const CKeyMetadata& meta = m_script_metadata[CScriptID(dest)];\n    UpdateTimeFirstKey(meta.nCreateTime);\n    NotifyWatchonlyChanged(true);\n    return CWalletDB(*dbw).WriteWatchOnly(dest, meta);\n}\n\nbool CWallet::AddWatchOnly(const CScript& dest, int64_t nCreateTime)\n{\n    m_script_metadata[CScriptID(dest)].nCreateTime = nCreateTime;\n    return AddWatchOnly(dest);\n}\n\nbool CWallet::RemoveWatchOnly(const CScript &dest)\n{\n    AssertLockHeld(cs_wallet);\n    if (!CCryptoKeyStore::RemoveWatchOnly(dest))\n        return false;\n    if (!HaveWatchOnly())\n        NotifyWatchonlyChanged(false);\n    if (!CWalletDB(*dbw).EraseWatchOnly(dest))\n        return false;\n\n    return true;\n}\n\nbool CWallet::LoadWatchOnly(const CScript &dest)\n{\n    return CCryptoKeyStore::AddWatchOnly(dest);\n}\n\nbool CWallet::Unlock(const SecureString& strWalletPassphrase)\n{\n    CCrypter crypter;\n    CKeyingMaterial _vMasterKey;\n\n    {\n        LOCK(cs_wallet);\n        for (const MasterKeyMap::value_type& pMasterKey : mapMasterKeys)\n        {\n            if(!crypter.SetKeyFromPassphrase(strWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))\n                return false;\n            if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, _vMasterKey))\n                continue; // try another master key\n            if (CCryptoKeyStore::Unlock(_vMasterKey))\n                return true;\n        }\n    }\n    return false;\n}\n\nbool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase)\n{\n    bool fWasLocked = IsLocked();\n\n    {\n        LOCK(cs_wallet);\n        Lock();\n\n        CCrypter crypter;\n        CKeyingMaterial _vMasterKey;\n        for (MasterKeyMap::value_type& pMasterKey : mapMasterKeys)\n        {\n            if(!crypter.SetKeyFromPassphrase(strOldWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))\n                return false;\n            if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, _vMasterKey))\n                return false;\n            if (CCryptoKeyStore::Unlock(_vMasterKey))\n            {\n                int64_t nStartTime = GetTimeMillis();\n                crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod);\n                pMasterKey.second.nDeriveIterations = static_cast<unsigned int>(pMasterKey.second.nDeriveIterations * (100 / ((double)(GetTimeMillis() - nStartTime))));\n\n                nStartTime = GetTimeMillis();\n                crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod);\n                pMasterKey.second.nDeriveIterations = (pMasterKey.second.nDeriveIterations + static_cast<unsigned int>(pMasterKey.second.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime)))) / 2;\n\n                if (pMasterKey.second.nDeriveIterations < 25000)\n                    pMasterKey.second.nDeriveIterations = 25000;\n\n                LogPrintf(\"Wallet passphrase changed to an nDeriveIterations of %i\\n\", pMasterKey.second.nDeriveIterations);\n\n                if (!crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))\n                    return false;\n                if (!crypter.Encrypt(_vMasterKey, pMasterKey.second.vchCryptedKey))\n                    return false;\n                CWalletDB(*dbw).WriteMasterKey(pMasterKey.first, pMasterKey.second);\n                if (fWasLocked)\n                    Lock();\n                return true;\n            }\n        }\n    }\n\n    return false;\n}\n\nvoid CWallet::SetBestChain(const CBlockLocator& loc)\n{\n    CWalletDB walletdb(*dbw);\n    walletdb.WriteBestBlock(loc);\n}\n\nbool CWallet::SetMinVersion(enum WalletFeature nVersion, CWalletDB* pwalletdbIn, bool fExplicit)\n{\n    LOCK(cs_wallet); // nWalletVersion\n    if (nWalletVersion >= nVersion)\n        return true;\n\n    // when doing an explicit upgrade, if we pass the max version permitted, upgrade all the way\n    if (fExplicit && nVersion > nWalletMaxVersion)\n            nVersion = FEATURE_LATEST;\n\n    nWalletVersion = nVersion;\n\n    if (nVersion > nWalletMaxVersion)\n        nWalletMaxVersion = nVersion;\n\n    {\n        CWalletDB* pwalletdb = pwalletdbIn ? pwalletdbIn : new CWalletDB(*dbw);\n        if (nWalletVersion > 40000)\n            pwalletdb->WriteMinVersion(nWalletVersion);\n        if (!pwalletdbIn)\n            delete pwalletdb;\n    }\n\n    return true;\n}\n\nbool CWallet::SetMaxVersion(int nVersion)\n{\n    LOCK(cs_wallet); // nWalletVersion, nWalletMaxVersion\n    // cannot downgrade below current version\n    if (nWalletVersion > nVersion)\n        return false;\n\n    nWalletMaxVersion = nVersion;\n\n    return true;\n}\n\nstd::set<uint256> CWallet::GetConflicts(const uint256& txid) const\n{\n    std::set<uint256> result;\n    AssertLockHeld(cs_wallet);\n\n    std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(txid);\n    if (it == mapWallet.end())\n        return result;\n    const CWalletTx& wtx = it->second;\n\n    std::pair<TxSpends::const_iterator, TxSpends::const_iterator> range;\n\n    for (const CTxIn& txin : wtx.tx->vin)\n    {\n        if (mapTxSpends.count(txin.prevout) <= 1)\n            continue;  // No conflict if zero or one spends\n        range = mapTxSpends.equal_range(txin.prevout);\n        for (TxSpends::const_iterator _it = range.first; _it != range.second; ++_it)\n            result.insert(_it->second);\n    }\n    return result;\n}\n\nbool CWallet::HasWalletSpend(const uint256& txid) const\n{\n    AssertLockHeld(cs_wallet);\n    auto iter = mapTxSpends.lower_bound(COutPoint(txid, 0));\n    return (iter != mapTxSpends.end() && iter->first.hash == txid);\n}\n\nvoid CWallet::Flush(bool shutdown)\n{\n    dbw->Flush(shutdown);\n}\n\nvoid CWallet::SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator> range)\n{\n    // We want all the wallet transactions in range to have the same metadata as\n    // the oldest (smallest nOrderPos).\n    // So: find smallest nOrderPos:\n\n    int nMinOrderPos = std::numeric_limits<int>::max();\n    const CWalletTx* copyFrom = nullptr;\n    for (TxSpends::iterator it = range.first; it != range.second; ++it) {\n        const CWalletTx* wtx = &mapWallet[it->second];\n        if (wtx->nOrderPos < nMinOrderPos) {\n            nMinOrderPos = wtx->nOrderPos;;\n            copyFrom = wtx;\n        }\n    }\n\n    if (!copyFrom) {\n        return;\n    }\n\n    // Now copy data from copyFrom to rest:\n    for (TxSpends::iterator it = range.first; it != range.second; ++it)\n    {\n        const uint256& hash = it->second;\n        CWalletTx* copyTo = &mapWallet[hash];\n        if (copyFrom == copyTo) continue;\n        assert(copyFrom && \"Oldest wallet transaction in range assumed to have been found.\");\n        if (!copyFrom->IsEquivalentTo(*copyTo)) continue;\n        copyTo->mapValue = copyFrom->mapValue;\n        copyTo->vOrderForm = copyFrom->vOrderForm;\n        // fTimeReceivedIsTxTime not copied on purpose\n        // nTimeReceived not copied on purpose\n        copyTo->nTimeSmart = copyFrom->nTimeSmart;\n        copyTo->fFromMe = copyFrom->fFromMe;\n        copyTo->strFromAccount = copyFrom->strFromAccount;\n        // nOrderPos not copied on purpose\n        // cached members not copied on purpose\n    }\n}\n\n/**\n * Outpoint is spent if any non-conflicted transaction\n * spends it:\n */\nbool CWallet::IsSpent(const uint256& hash, unsigned int n) const\n{\n    const COutPoint outpoint(hash, n);\n    std::pair<TxSpends::const_iterator, TxSpends::const_iterator> range;\n    range = mapTxSpends.equal_range(outpoint);\n\n    for (TxSpends::const_iterator it = range.first; it != range.second; ++it)\n    {\n        const uint256& wtxid = it->second;\n        std::map<uint256, CWalletTx>::const_iterator mit = mapWallet.find(wtxid);\n        if (mit != mapWallet.end()) {\n            int depth = mit->second.GetDepthInMainChain();\n            if (depth > 0  || (depth == 0 && !mit->second.isAbandoned()))\n                return true; // Spent\n        }\n    }\n    return false;\n}\n\nvoid CWallet::AddToSpends(const COutPoint& outpoint, const uint256& wtxid)\n{\n    mapTxSpends.insert(std::make_pair(outpoint, wtxid));\n\n    std::pair<TxSpends::iterator, TxSpends::iterator> range;\n    range = mapTxSpends.equal_range(outpoint);\n    SyncMetaData(range);\n}\n\n\nvoid CWallet::AddToSpends(const uint256& wtxid)\n{\n    auto it = mapWallet.find(wtxid);\n    assert(it != mapWallet.end());\n    CWalletTx& thisTx = it->second;\n    if (thisTx.IsCoinBase()) // Coinbases don't spend anything!\n        return;\n\n    for (const CTxIn& txin : thisTx.tx->vin)\n        AddToSpends(txin.prevout, wtxid);\n}\n\nbool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)\n{\n    if (IsCrypted())\n        return false;\n\n    CKeyingMaterial _vMasterKey;\n\n    _vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE);\n    GetStrongRandBytes(&_vMasterKey[0], WALLET_CRYPTO_KEY_SIZE);\n\n    CMasterKey kMasterKey;\n\n    kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE);\n    GetStrongRandBytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE);\n\n    CCrypter crypter;\n    int64_t nStartTime = GetTimeMillis();\n    crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, 25000, kMasterKey.nDerivationMethod);\n    kMasterKey.nDeriveIterations = static_cast<unsigned int>(2500000 / ((double)(GetTimeMillis() - nStartTime)));\n\n    nStartTime = GetTimeMillis();\n    crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod);\n    kMasterKey.nDeriveIterations = (kMasterKey.nDeriveIterations + static_cast<unsigned int>(kMasterKey.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime)))) / 2;\n\n    if (kMasterKey.nDeriveIterations < 25000)\n        kMasterKey.nDeriveIterations = 25000;\n\n    LogPrintf(\"Encrypting Wallet with an nDeriveIterations of %i\\n\", kMasterKey.nDeriveIterations);\n\n    if (!crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod))\n        return false;\n    if (!crypter.Encrypt(_vMasterKey, kMasterKey.vchCryptedKey))\n        return false;\n\n    {\n        LOCK(cs_wallet);\n        mapMasterKeys[++nMasterKeyMaxID] = kMasterKey;\n        assert(!pwalletdbEncryption);\n        pwalletdbEncryption = new CWalletDB(*dbw);\n        if (!pwalletdbEncryption->TxnBegin()) {\n            delete pwalletdbEncryption;\n            pwalletdbEncryption = nullptr;\n            return false;\n        }\n        pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey);\n\n        if (!EncryptKeys(_vMasterKey))\n        {\n            pwalletdbEncryption->TxnAbort();\n            delete pwalletdbEncryption;\n            // We now probably have half of our keys encrypted in memory, and half not...\n            // die and let the user reload the unencrypted wallet.\n            assert(false);\n        }\n\n        // Encryption was introduced in version 0.4.0\n        SetMinVersion(FEATURE_WALLETCRYPT, pwalletdbEncryption, true);\n\n        if (!pwalletdbEncryption->TxnCommit()) {\n            delete pwalletdbEncryption;\n            // We now have keys encrypted in memory, but not on disk...\n            // die to avoid confusion and let the user reload the unencrypted wallet.\n            assert(false);\n        }\n\n        delete pwalletdbEncryption;\n        pwalletdbEncryption = nullptr;\n\n        Lock();\n        Unlock(strWalletPassphrase);\n\n        // if we are using HD, replace the HD master key (seed) with a new one\n        if (IsHDEnabled()) {\n            if (!SetHDMasterKey(GenerateNewHDMasterKey())) {\n                return false;\n            }\n        }\n\n        NewKeyPool();\n        Lock();\n\n        // Need to completely rewrite the wallet file; if we don't, bdb might keep\n        // bits of the unencrypted private key in slack space in the database file.\n        dbw->Rewrite();\n\n    }\n    NotifyStatusChanged(this);\n\n    return true;\n}\n\nDBErrors CWallet::ReorderTransactions()\n{\n    LOCK(cs_wallet);\n    CWalletDB walletdb(*dbw);\n\n    // Old wallets didn't have any defined order for transactions\n    // Probably a bad idea to change the output of this\n\n    // First: get all CWalletTx and CAccountingEntry into a sorted-by-time multimap.\n    typedef std::pair<CWalletTx*, CAccountingEntry*> TxPair;\n    typedef std::multimap<int64_t, TxPair > TxItems;\n    TxItems txByTime;\n\n    for (auto& entry : mapWallet)\n    {\n        CWalletTx* wtx = &entry.second;\n        txByTime.insert(std::make_pair(wtx->nTimeReceived, TxPair(wtx, nullptr)));\n    }\n    std::list<CAccountingEntry> acentries;\n    walletdb.ListAccountCreditDebit(\"\", acentries);\n    for (CAccountingEntry& entry : acentries)\n    {\n        txByTime.insert(std::make_pair(entry.nTime, TxPair(nullptr, &entry)));\n    }\n\n    nOrderPosNext = 0;\n    std::vector<int64_t> nOrderPosOffsets;\n    for (TxItems::iterator it = txByTime.begin(); it != txByTime.end(); ++it)\n    {\n        CWalletTx *const pwtx = (*it).second.first;\n        CAccountingEntry *const pacentry = (*it).second.second;\n        int64_t& nOrderPos = (pwtx != nullptr) ? pwtx->nOrderPos : pacentry->nOrderPos;\n\n        if (nOrderPos == -1)\n        {\n            nOrderPos = nOrderPosNext++;\n            nOrderPosOffsets.push_back(nOrderPos);\n\n            if (pwtx)\n            {\n                if (!walletdb.WriteTx(*pwtx))\n                    return DB_LOAD_FAIL;\n            }\n            else\n                if (!walletdb.WriteAccountingEntry(pacentry->nEntryNo, *pacentry))\n                    return DB_LOAD_FAIL;\n        }\n        else\n        {\n            int64_t nOrderPosOff = 0;\n            for (const int64_t& nOffsetStart : nOrderPosOffsets)\n            {\n                if (nOrderPos >= nOffsetStart)\n                    ++nOrderPosOff;\n            }\n            nOrderPos += nOrderPosOff;\n            nOrderPosNext = std::max(nOrderPosNext, nOrderPos + 1);\n\n            if (!nOrderPosOff)\n                continue;\n\n            // Since we're changing the order, write it back\n            if (pwtx)\n            {\n                if (!walletdb.WriteTx(*pwtx))\n                    return DB_LOAD_FAIL;\n            }\n            else\n                if (!walletdb.WriteAccountingEntry(pacentry->nEntryNo, *pacentry))\n                    return DB_LOAD_FAIL;\n        }\n    }\n    walletdb.WriteOrderPosNext(nOrderPosNext);\n\n    return DB_LOAD_OK;\n}\n\nint64_t CWallet::IncOrderPosNext(CWalletDB *pwalletdb)\n{\n    AssertLockHeld(cs_wallet); // nOrderPosNext\n    int64_t nRet = nOrderPosNext++;\n    if (pwalletdb) {\n        pwalletdb->WriteOrderPosNext(nOrderPosNext);\n    } else {\n        CWalletDB(*dbw).WriteOrderPosNext(nOrderPosNext);\n    }\n    return nRet;\n}\n\nbool CWallet::AccountMove(std::string strFrom, std::string strTo, CAmount nAmount, std::string strComment)\n{\n    CWalletDB walletdb(*dbw);\n    if (!walletdb.TxnBegin())\n        return false;\n\n    int64_t nNow = GetAdjustedTime();\n\n    // Debit\n    CAccountingEntry debit;\n    debit.nOrderPos = IncOrderPosNext(&walletdb);\n    debit.strAccount = strFrom;\n    debit.nCreditDebit = -nAmount;\n    debit.nTime = nNow;\n    debit.strOtherAccount = strTo;\n    debit.strComment = strComment;\n    AddAccountingEntry(debit, &walletdb);\n\n    // Credit\n    CAccountingEntry credit;\n    credit.nOrderPos = IncOrderPosNext(&walletdb);\n    credit.strAccount = strTo;\n    credit.nCreditDebit = nAmount;\n    credit.nTime = nNow;\n    credit.strOtherAccount = strFrom;\n    credit.strComment = strComment;\n    AddAccountingEntry(credit, &walletdb);\n\n    if (!walletdb.TxnCommit())\n        return false;\n\n    return true;\n}\n\nbool CWallet::GetAccountDestination(CTxDestination &dest, std::string strAccount, bool bForceNew)\n{\n    CWalletDB walletdb(*dbw);\n\n    CAccount account;\n    walletdb.ReadAccount(strAccount, account);\n\n    if (!bForceNew) {\n        if (!account.vchPubKey.IsValid())\n            bForceNew = true;\n        else {\n            // Check if the current key has been used (TODO: check other addresses with the same key)\n            CScript scriptPubKey = GetScriptForDestination(GetDestinationForKey(account.vchPubKey, g_address_type));\n            for (std::map<uint256, CWalletTx>::iterator it = mapWallet.begin();\n                 it != mapWallet.end() && account.vchPubKey.IsValid();\n                 ++it)\n                for (const CTxOut& txout : (*it).second.tx->vout)\n                    if (txout.scriptPubKey == scriptPubKey) {\n                        bForceNew = true;\n                        break;\n                    }\n        }\n    }\n\n    // Generate a new key\n    if (bForceNew) {\n        if (!GetKeyFromPool(account.vchPubKey, false))\n            return false;\n\n        LearnRelatedScripts(account.vchPubKey, g_address_type);\n        dest = GetDestinationForKey(account.vchPubKey, g_address_type);\n        SetAddressBook(dest, strAccount, \"receive\");\n        walletdb.WriteAccount(strAccount, account);\n    } else {\n        dest = GetDestinationForKey(account.vchPubKey, g_address_type);\n    }\n\n    return true;\n}\n\nvoid CWallet::MarkDirty()\n{\n    {\n        LOCK(cs_wallet);\n        for (std::pair<const uint256, CWalletTx>& item : mapWallet)\n            item.second.MarkDirty();\n    }\n}\n\nbool CWallet::MarkReplaced(const uint256& originalHash, const uint256& newHash)\n{\n    LOCK(cs_wallet);\n\n    auto mi = mapWallet.find(originalHash);\n\n    // There is a bug if MarkReplaced is not called on an existing wallet transaction.\n    assert(mi != mapWallet.end());\n\n    CWalletTx& wtx = (*mi).second;\n\n    // Ensure for now that we're not overwriting data\n    assert(wtx.mapValue.count(\"replaced_by_txid\") == 0);\n\n    wtx.mapValue[\"replaced_by_txid\"] = newHash.ToString();\n\n    CWalletDB walletdb(*dbw, \"r+\");\n\n    bool success = true;\n    if (!walletdb.WriteTx(wtx)) {\n        LogPrintf(\"%s: Updating walletdb tx %s failed\\n\", __func__, wtx.GetHash().ToString());\n        success = false;\n    }\n\n    NotifyTransactionChanged(this, originalHash, CT_UPDATED);\n\n    return success;\n}\n\nbool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)\n{\n    LOCK(cs_wallet);\n\n    CWalletDB walletdb(*dbw, \"r+\", fFlushOnClose);\n\n    uint256 hash = wtxIn.GetHash();\n\n    // Inserts only if not already there, returns tx inserted or tx found\n    std::pair<std::map<uint256, CWalletTx>::iterator, bool> ret = mapWallet.insert(std::make_pair(hash, wtxIn));\n    CWalletTx& wtx = (*ret.first).second;\n    wtx.BindWallet(this);\n    bool fInsertedNew = ret.second;\n    if (fInsertedNew) {\n        wtx.nTimeReceived = GetAdjustedTime();\n        wtx.nOrderPos = IncOrderPosNext(&walletdb);\n        wtx.m_it_wtxOrdered = wtxOrdered.insert(std::make_pair(wtx.nOrderPos, TxPair(&wtx, nullptr)));\n        wtx.nTimeSmart = ComputeTimeSmart(wtx);\n        AddToSpends(hash);\n    }\n\n    bool fUpdated = false;\n    if (!fInsertedNew)\n    {\n        // Merge\n        if (!wtxIn.hashUnset() && wtxIn.hashBlock != wtx.hashBlock)\n        {\n            wtx.hashBlock = wtxIn.hashBlock;\n            fUpdated = true;\n        }\n        // If no longer abandoned, update\n        if (wtxIn.hashBlock.IsNull() && wtx.isAbandoned())\n        {\n            wtx.hashBlock = wtxIn.hashBlock;\n            fUpdated = true;\n        }\n        if (wtxIn.nIndex != -1 && (wtxIn.nIndex != wtx.nIndex))\n        {\n            wtx.nIndex = wtxIn.nIndex;\n            fUpdated = true;\n        }\n        if (wtxIn.fFromMe && wtxIn.fFromMe != wtx.fFromMe)\n        {\n            wtx.fFromMe = wtxIn.fFromMe;\n            fUpdated = true;\n        }\n        // If we have a witness-stripped version of this transaction, and we\n        // see a new version with a witness, then we must be upgrading a pre-segwit\n        // wallet.  Store the new version of the transaction with the witness,\n        // as the stripped-version must be invalid.\n        // TODO: Store all versions of the transaction, instead of just one.\n        if (wtxIn.tx->HasWitness() && !wtx.tx->HasWitness()) {\n            wtx.SetTx(wtxIn.tx);\n            fUpdated = true;\n        }\n    }\n\n    //// debug print\n    LogPrintf(\"AddToWallet %s  %s%s\\n\", wtxIn.GetHash().ToString(), (fInsertedNew ? \"new\" : \"\"), (fUpdated ? \"update\" : \"\"));\n\n    // Write to disk\n    if (fInsertedNew || fUpdated)\n        if (!walletdb.WriteTx(wtx))\n            return false;\n\n    // Break debit/credit balance caches:\n    wtx.MarkDirty();\n\n    // Notify UI of new or updated transaction\n    NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED);\n\n    // notify an external script when a wallet transaction comes in or is updated\n    std::string strCmd = gArgs.GetArg(\"-walletnotify\", \"\");\n\n    if (!strCmd.empty())\n    {\n        boost::replace_all(strCmd, \"%s\", wtxIn.GetHash().GetHex());\n        boost::thread t(runCommand, strCmd); // thread runs free\n    }\n\n    return true;\n}\n\nbool CWallet::LoadToWallet(const CWalletTx& wtxIn)\n{\n    uint256 hash = wtxIn.GetHash();\n    const auto& ins = mapWallet.emplace(hash, wtxIn);\n    CWalletTx& wtx = ins.first->second;\n    wtx.BindWallet(this);\n    if (/* insertion took place */ ins.second) {\n        wtx.m_it_wtxOrdered = wtxOrdered.insert(std::make_pair(wtx.nOrderPos, TxPair(&wtx, nullptr)));\n    }\n    AddToSpends(hash);\n    for (const CTxIn& txin : wtx.tx->vin) {\n        auto it = mapWallet.find(txin.prevout.hash);\n        if (it != mapWallet.end()) {\n            CWalletTx& prevtx = it->second;\n            if (prevtx.nIndex == -1 && !prevtx.hashUnset()) {\n                MarkConflicted(prevtx.hashBlock, wtx.GetHash());\n            }\n        }\n    }\n\n    return true;\n}\n\n/**\n * Add a transaction to the wallet, or update it.  pIndex and posInBlock should\n * be set when the transaction was known to be included in a block.  When\n * pIndex == nullptr, then wallet state is not updated in AddToWallet, but\n * notifications happen and cached balances are marked dirty.\n *\n * If fUpdate is true, existing transactions will be updated.\n * TODO: One exception to this is that the abandoned state is cleared under the\n * assumption that any further notification of a transaction that was considered\n * abandoned is an indication that it is not safe to be considered abandoned.\n * Abandoned state should probably be more carefully tracked via different\n * posInBlock signals or by checking mempool presence when necessary.\n */\nbool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef& ptx, const CBlockIndex* pIndex, int posInBlock, bool fUpdate)\n{\n    const CTransaction& tx = *ptx;\n    {\n        AssertLockHeld(cs_wallet);\n\n        if (pIndex != nullptr) {\n            for (const CTxIn& txin : tx.vin) {\n                std::pair<TxSpends::const_iterator, TxSpends::const_iterator> range = mapTxSpends.equal_range(txin.prevout);\n                while (range.first != range.second) {\n                    if (range.first->second != tx.GetHash()) {\n                        LogPrintf(\"Transaction %s (in block %s) conflicts with wallet transaction %s (both spend %s:%i)\\n\", tx.GetHash().ToString(), pIndex->GetBlockHash().ToString(), range.first->second.ToString(), range.first->first.hash.ToString(), range.first->first.n);\n                        MarkConflicted(pIndex->GetBlockHash(), range.first->second);\n                    }\n                    range.first++;\n                }\n            }\n        }\n\n        bool fExisted = mapWallet.count(tx.GetHash()) != 0;\n        if (fExisted && !fUpdate) return false;\n        if (fExisted || IsMine(tx) || IsFromMe(tx))\n        {\n            /* Check if any keys in the wallet keypool that were supposed to be unused\n             * have appeared in a new transaction. If so, remove those keys from the keypool.\n             * This can happen when restoring an old wallet backup that does not contain\n             * the mostly recently created transactions from newer versions of the wallet.\n             */\n\n            // loop though all outputs\n            for (const CTxOut& txout: tx.vout) {\n                // extract addresses and check if they match with an unused keypool key\n                std::vector<CKeyID> vAffected;\n                CAffectedKeysVisitor(*this, vAffected).Process(txout.scriptPubKey);\n                for (const CKeyID &keyid : vAffected) {\n                    std::map<CKeyID, int64_t>::const_iterator mi = m_pool_key_to_index.find(keyid);\n                    if (mi != m_pool_key_to_index.end()) {\n                        LogPrintf(\"%s: Detected a used keypool key, mark all keypool key up to this key as used\\n\", __func__);\n                        MarkReserveKeysAsUsed(mi->second);\n\n                        if (!TopUpKeyPool()) {\n                            LogPrintf(\"%s: Topping up keypool failed (locked wallet)\\n\", __func__);\n                        }\n                    }\n                }\n            }\n\n            CWalletTx wtx(this, ptx);\n\n            // Get merkle branch if transaction was found in a block\n            if (pIndex != nullptr)\n                wtx.SetMerkleBranch(pIndex, posInBlock);\n\n            return AddToWallet(wtx, false);\n        }\n    }\n    return false;\n}\n\nbool CWallet::TransactionCanBeAbandoned(const uint256& hashTx) const\n{\n    LOCK2(cs_main, cs_wallet);\n    const CWalletTx* wtx = GetWalletTx(hashTx);\n    return wtx && !wtx->isAbandoned() && wtx->GetDepthInMainChain() <= 0 && !wtx->InMempool();\n}\n\nbool CWallet::AbandonTransaction(const uint256& hashTx)\n{\n    LOCK2(cs_main, cs_wallet);\n\n    CWalletDB walletdb(*dbw, \"r+\");\n\n    std::set<uint256> todo;\n    std::set<uint256> done;\n\n    // Can't mark abandoned if confirmed or in mempool\n    auto it = mapWallet.find(hashTx);\n    assert(it != mapWallet.end());\n    CWalletTx& origtx = it->second;\n    if (origtx.GetDepthInMainChain() > 0 || origtx.InMempool()) {\n        return false;\n    }\n\n    todo.insert(hashTx);\n\n    while (!todo.empty()) {\n        uint256 now = *todo.begin();\n        todo.erase(now);\n        done.insert(now);\n        auto it = mapWallet.find(now);\n        assert(it != mapWallet.end());\n        CWalletTx& wtx = it->second;\n        int currentconfirm = wtx.GetDepthInMainChain();\n        // If the orig tx was not in block, none of its spends can be\n        assert(currentconfirm <= 0);\n        // if (currentconfirm < 0) {Tx and spends are already conflicted, no need to abandon}\n        if (currentconfirm == 0 && !wtx.isAbandoned()) {\n            // If the orig tx was not in block/mempool, none of its spends can be in mempool\n            assert(!wtx.InMempool());\n            wtx.nIndex = -1;\n            wtx.setAbandoned();\n            wtx.MarkDirty();\n            walletdb.WriteTx(wtx);\n            NotifyTransactionChanged(this, wtx.GetHash(), CT_UPDATED);\n            // Iterate over all its outputs, and mark transactions in the wallet that spend them abandoned too\n            TxSpends::const_iterator iter = mapTxSpends.lower_bound(COutPoint(now, 0));\n            while (iter != mapTxSpends.end() && iter->first.hash == now) {\n                if (!done.count(iter->second)) {\n                    todo.insert(iter->second);\n                }\n                iter++;\n            }\n            // If a transaction changes 'conflicted' state, that changes the balance\n            // available of the outputs it spends. So force those to be recomputed\n            for (const CTxIn& txin : wtx.tx->vin)\n            {\n                auto it = mapWallet.find(txin.prevout.hash);\n                if (it != mapWallet.end()) {\n                    it->second.MarkDirty();\n                }\n            }\n        }\n    }\n\n    return true;\n}\n\nvoid CWallet::MarkConflicted(const uint256& hashBlock, const uint256& hashTx)\n{\n    LOCK2(cs_main, cs_wallet);\n\n    int conflictconfirms = 0;\n    if (mapBlockIndex.count(hashBlock)) {\n        CBlockIndex* pindex = mapBlockIndex[hashBlock];\n        if (chainActive.Contains(pindex)) {\n            conflictconfirms = -(chainActive.Height() - pindex->nHeight + 1);\n        }\n    }\n    // If number of conflict confirms cannot be determined, this means\n    // that the block is still unknown or not yet part of the main chain,\n    // for example when loading the wallet during a reindex. Do nothing in that\n    // case.\n    if (conflictconfirms >= 0)\n        return;\n\n    // Do not flush the wallet here for performance reasons\n    CWalletDB walletdb(*dbw, \"r+\", false);\n\n    std::set<uint256> todo;\n    std::set<uint256> done;\n\n    todo.insert(hashTx);\n\n    while (!todo.empty()) {\n        uint256 now = *todo.begin();\n        todo.erase(now);\n        done.insert(now);\n        auto it = mapWallet.find(now);\n        assert(it != mapWallet.end());\n        CWalletTx& wtx = it->second;\n        int currentconfirm = wtx.GetDepthInMainChain();\n        if (conflictconfirms < currentconfirm) {\n            // Block is 'more conflicted' than current confirm; update.\n            // Mark transaction as conflicted with this block.\n            wtx.nIndex = -1;\n            wtx.hashBlock = hashBlock;\n            wtx.MarkDirty();\n            walletdb.WriteTx(wtx);\n            // Iterate over all its outputs, and mark transactions in the wallet that spend them conflicted too\n            TxSpends::const_iterator iter = mapTxSpends.lower_bound(COutPoint(now, 0));\n            while (iter != mapTxSpends.end() && iter->first.hash == now) {\n                 if (!done.count(iter->second)) {\n                     todo.insert(iter->second);\n                 }\n                 iter++;\n            }\n            // If a transaction changes 'conflicted' state, that changes the balance\n            // available of the outputs it spends. So force those to be recomputed\n            for (const CTxIn& txin : wtx.tx->vin) {\n                auto it = mapWallet.find(txin.prevout.hash);\n                if (it != mapWallet.end()) {\n                    it->second.MarkDirty();\n                }\n            }\n        }\n    }\n}\n\nvoid CWallet::SyncTransaction(const CTransactionRef& ptx, const CBlockIndex *pindex, int posInBlock) {\n    const CTransaction& tx = *ptx;\n\n    if (!AddToWalletIfInvolvingMe(ptx, pindex, posInBlock, true))\n        return; // Not one of ours\n\n    // If a transaction changes 'conflicted' state, that changes the balance\n    // available of the outputs it spends. So force those to be\n    // recomputed, also:\n    for (const CTxIn& txin : tx.vin) {\n        auto it = mapWallet.find(txin.prevout.hash);\n        if (it != mapWallet.end()) {\n            it->second.MarkDirty();\n        }\n    }\n}\n\nvoid CWallet::TransactionAddedToMempool(const CTransactionRef& ptx) {\n    LOCK2(cs_main, cs_wallet);\n    SyncTransaction(ptx);\n\n    auto it = mapWallet.find(ptx->GetHash());\n    if (it != mapWallet.end()) {\n        it->second.fInMempool = true;\n    }\n}\n\nvoid CWallet::TransactionRemovedFromMempool(const CTransactionRef &ptx) {\n    LOCK(cs_wallet);\n    auto it = mapWallet.find(ptx->GetHash());\n    if (it != mapWallet.end()) {\n        it->second.fInMempool = false;\n    }\n}\n\nvoid CWallet::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex *pindex, const std::vector<CTransactionRef>& vtxConflicted) {\n    LOCK2(cs_main, cs_wallet);\n    // TODO: Temporarily ensure that mempool removals are notified before\n    // connected transactions.  This shouldn't matter, but the abandoned\n    // state of transactions in our wallet is currently cleared when we\n    // receive another notification and there is a race condition where\n    // notification of a connected conflict might cause an outside process\n    // to abandon a transaction and then have it inadvertently cleared by\n    // the notification that the conflicted transaction was evicted.\n\n    for (const CTransactionRef& ptx : vtxConflicted) {\n        SyncTransaction(ptx);\n        TransactionRemovedFromMempool(ptx);\n    }\n    for (size_t i = 0; i < pblock->vtx.size(); i++) {\n        SyncTransaction(pblock->vtx[i], pindex, i);\n        TransactionRemovedFromMempool(pblock->vtx[i]);\n    }\n\n    m_last_block_processed = pindex;\n}\n\nvoid CWallet::BlockDisconnected(const std::shared_ptr<const CBlock>& pblock) {\n    LOCK2(cs_main, cs_wallet);\n\n    for (const CTransactionRef& ptx : pblock->vtx) {\n        SyncTransaction(ptx);\n    }\n}\n\n\n\nvoid CWallet::BlockUntilSyncedToCurrentChain() {\n    AssertLockNotHeld(cs_main);\n    AssertLockNotHeld(cs_wallet);\n\n    {\n        // Skip the queue-draining stuff if we know we're caught up with\n        // chainActive.Tip()...\n        // We could also take cs_wallet here, and call m_last_block_processed\n        // protected by cs_wallet instead of cs_main, but as long as we need\n        // cs_main here anyway, its easier to just call it cs_main-protected.\n        LOCK(cs_main);\n        const CBlockIndex* initialChainTip = chainActive.Tip();\n\n        if (m_last_block_processed->GetAncestor(initialChainTip->nHeight) == initialChainTip) {\n            return;\n        }\n    }\n\n    // ...otherwise put a callback in the validation interface queue and wait\n    // for the queue to drain enough to execute it (indicating we are caught up\n    // at least with the time we entered this function).\n    SyncWithValidationInterfaceQueue();\n}\n\n\nisminetype CWallet::IsMine(const CTxIn &txin) const\n{\n    {\n        LOCK(cs_wallet);\n        std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);\n        if (mi != mapWallet.end())\n        {\n            const CWalletTx& prev = (*mi).second;\n            if (txin.prevout.n < prev.tx->vout.size())\n                return IsMine(prev.tx->vout[txin.prevout.n]);\n        }\n    }\n    return ISMINE_NO;\n}\n\n// Note that this function doesn't distinguish between a 0-valued input,\n// and a not-\"is mine\" (according to the filter) input.\nCAmount CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const\n{\n    {\n        LOCK(cs_wallet);\n        std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);\n        if (mi != mapWallet.end())\n        {\n            const CWalletTx& prev = (*mi).second;\n            if (txin.prevout.n < prev.tx->vout.size())\n                if (IsMine(prev.tx->vout[txin.prevout.n]) & filter)\n                    return prev.tx->vout[txin.prevout.n].nValue;\n        }\n    }\n    return 0;\n}\n\nisminetype CWallet::IsMine(const CTxOut& txout) const\n{\n    return ::IsMine(*this, txout.scriptPubKey);\n}\n\nCAmount CWallet::GetCredit(const CTxOut& txout, const isminefilter& filter) const\n{\n    if (!MoneyRange(txout.nValue))\n        throw std::runtime_error(std::string(__func__) + \": value out of range\");\n    return ((IsMine(txout) & filter) ? txout.nValue : 0);\n}\n\nbool CWallet::IsChange(const CTxOut& txout) const\n{\n    // TODO: fix handling of 'change' outputs. The assumption is that any\n    // payment to a script that is ours, but is not in the address book\n    // is change. That assumption is likely to break when we implement multisignature\n    // wallets that return change back into a multi-signature-protected address;\n    // a better way of identifying which outputs are 'the send' and which are\n    // 'the change' will need to be implemented (maybe extend CWalletTx to remember\n    // which output, if any, was change).\n    if (::IsMine(*this, txout.scriptPubKey))\n    {\n        CTxDestination address;\n        if (!ExtractDestination(txout.scriptPubKey, address))\n            return true;\n\n        LOCK(cs_wallet);\n        if (!mapAddressBook.count(address))\n            return true;\n    }\n    return false;\n}\n\nCAmount CWallet::GetChange(const CTxOut& txout) const\n{\n    if (!MoneyRange(txout.nValue))\n        throw std::runtime_error(std::string(__func__) + \": value out of range\");\n    return (IsChange(txout) ? txout.nValue : 0);\n}\n\nbool CWallet::IsMine(const CTransaction& tx) const\n{\n    for (const CTxOut& txout : tx.vout)\n        if (IsMine(txout))\n            return true;\n    return false;\n}\n\nbool CWallet::IsFromMe(const CTransaction& tx) const\n{\n    return (GetDebit(tx, ISMINE_ALL) > 0);\n}\n\nCAmount CWallet::GetDebit(const CTransaction& tx, const isminefilter& filter) const\n{\n    CAmount nDebit = 0;\n    for (const CTxIn& txin : tx.vin)\n    {\n        nDebit += GetDebit(txin, filter);\n        if (!MoneyRange(nDebit))\n            throw std::runtime_error(std::string(__func__) + \": value out of range\");\n    }\n    return nDebit;\n}\n\nbool CWallet::IsAllFromMe(const CTransaction& tx, const isminefilter& filter) const\n{\n    LOCK(cs_wallet);\n\n    for (const CTxIn& txin : tx.vin)\n    {\n        auto mi = mapWallet.find(txin.prevout.hash);\n        if (mi == mapWallet.end())\n            return false; // any unknown inputs can't be from us\n\n        const CWalletTx& prev = (*mi).second;\n\n        if (txin.prevout.n >= prev.tx->vout.size())\n            return false; // invalid input!\n\n        if (!(IsMine(prev.tx->vout[txin.prevout.n]) & filter))\n            return false;\n    }\n    return true;\n}\n\nCAmount CWallet::GetCredit(const CTransaction& tx, const isminefilter& filter) const\n{\n    CAmount nCredit = 0;\n    for (const CTxOut& txout : tx.vout)\n    {\n        nCredit += GetCredit(txout, filter);\n        if (!MoneyRange(nCredit))\n            throw std::runtime_error(std::string(__func__) + \": value out of range\");\n    }\n    return nCredit;\n}\n\nCAmount CWallet::GetChange(const CTransaction& tx) const\n{\n    CAmount nChange = 0;\n    for (const CTxOut& txout : tx.vout)\n    {\n        nChange += GetChange(txout);\n        if (!MoneyRange(nChange))\n            throw std::runtime_error(std::string(__func__) + \": value out of range\");\n    }\n    return nChange;\n}\n\nCPubKey CWallet::GenerateNewHDMasterKey()\n{\n    CKey key;\n    key.MakeNewKey(true);\n\n    int64_t nCreationTime = GetTime();\n    CKeyMetadata metadata(nCreationTime);\n\n    // calculate the pubkey\n    CPubKey pubkey = key.GetPubKey();\n    assert(key.VerifyPubKey(pubkey));\n\n    // set the hd keypath to \"m\" -> Master, refers the masterkeyid to itself\n    metadata.hdKeypath     = \"m\";\n    metadata.hdMasterKeyID = pubkey.GetID();\n\n    {\n        LOCK(cs_wallet);\n\n        // mem store the metadata\n        mapKeyMetadata[pubkey.GetID()] = metadata;\n\n        // write the key&metadata to the database\n        if (!AddKeyPubKey(key, pubkey))\n            throw std::runtime_error(std::string(__func__) + \": AddKeyPubKey failed\");\n    }\n\n    return pubkey;\n}\n\nbool CWallet::SetHDMasterKey(const CPubKey& pubkey)\n{\n    LOCK(cs_wallet);\n    // store the keyid (hash160) together with\n    // the child index counter in the database\n    // as a hdchain object\n    CHDChain newHdChain;\n    newHdChain.nVersion = CanSupportFeature(FEATURE_HD_SPLIT) ? CHDChain::VERSION_HD_CHAIN_SPLIT : CHDChain::VERSION_HD_BASE;\n    newHdChain.masterKeyID = pubkey.GetID();\n    SetHDChain(newHdChain, false);\n\n    return true;\n}\n\nbool CWallet::SetHDChain(const CHDChain& chain, bool memonly)\n{\n    LOCK(cs_wallet);\n    if (!memonly && !CWalletDB(*dbw).WriteHDChain(chain))\n        throw std::runtime_error(std::string(__func__) + \": writing chain failed\");\n\n    hdChain = chain;\n    return true;\n}\n\nbool CWallet::IsHDEnabled() const\n{\n    return !hdChain.masterKeyID.IsNull();\n}\n\nint64_t CWalletTx::GetTxTime() const\n{\n    int64_t n = nTimeSmart;\n    return n ? n : nTimeReceived;\n}\n\nvoid CWalletTx::GetAmounts(std::list<COutputEntry>& listReceived,\n                           std::list<COutputEntry>& listSent, CAmount& nFee, std::string& strSentAccount, const isminefilter& filter) const\n{\n    nFee = 0;\n    listReceived.clear();\n    listSent.clear();\n    strSentAccount = strFromAccount;\n\n    // Compute fee:\n    CAmount nDebit = GetDebit(filter);\n    if (nDebit > 0) // debit>0 means we signed/sent this transaction\n    {\n        CAmount nValueOut = tx->GetValueOut();\n        nFee = nDebit - nValueOut;\n    }\n\n    // Sent/received.\n    for (unsigned int i = 0; i < tx->vout.size(); ++i)\n    {\n        const CTxOut& txout = tx->vout[i];\n        isminetype fIsMine = pwallet->IsMine(txout);\n        // Only need to handle txouts if AT LEAST one of these is true:\n        //   1) they debit from us (sent)\n        //   2) the output is to us (received)\n        if (nDebit > 0)\n        {\n            // Don't report 'change' txouts\n            if (pwallet->IsChange(txout))\n                continue;\n        }\n        else if (!(fIsMine & filter))\n            continue;\n\n        // In either case, we need to get the destination address\n        CTxDestination address;\n\n        if (!ExtractDestination(txout.scriptPubKey, address) && !txout.scriptPubKey.IsUnspendable())\n        {\n            LogPrintf(\"CWalletTx::GetAmounts: Unknown transaction type found, txid %s\\n\",\n                     this->GetHash().ToString());\n            address = CNoDestination();\n        }\n\n        COutputEntry output = {address, txout.nValue, (int)i};\n\n        // If we are debited by the transaction, add the output as a \"sent\" entry\n        if (nDebit > 0)\n            listSent.push_back(output);\n\n        // If we are receiving the output, add it as a \"received\" entry\n        if (fIsMine & filter)\n            listReceived.push_back(output);\n    }\n\n}\n\n/**\n * Scan active chain for relevant transactions after importing keys. This should\n * be called whenever new keys are added to the wallet, with the oldest key\n * creation time.\n *\n * @return Earliest timestamp that could be successfully scanned from. Timestamp\n * returned will be higher than startTime if relevant blocks could not be read.\n */\nint64_t CWallet::RescanFromTime(int64_t startTime, const WalletRescanReserver& reserver, bool update)\n{\n    // Find starting block. May be null if nCreateTime is greater than the\n    // highest blockchain timestamp, in which case there is nothing that needs\n    // to be scanned.\n    CBlockIndex* startBlock = nullptr;\n    {\n        LOCK(cs_main);\n        startBlock = chainActive.FindEarliestAtLeast(startTime - TIMESTAMP_WINDOW);\n        LogPrintf(\"%s: Rescanning last %i blocks\\n\", __func__, startBlock ? chainActive.Height() - startBlock->nHeight + 1 : 0);\n    }\n\n    if (startBlock) {\n        const CBlockIndex* const failedBlock = ScanForWalletTransactions(startBlock, nullptr, reserver, update);\n        if (failedBlock) {\n            return failedBlock->GetBlockTimeMax() + TIMESTAMP_WINDOW + 1;\n        }\n    }\n    return startTime;\n}\n\n/**\n * Scan the block chain (starting in pindexStart) for transactions\n * from or to us. If fUpdate is true, found transactions that already\n * exist in the wallet will be updated.\n *\n * Returns null if scan was successful. Otherwise, if a complete rescan was not\n * possible (due to pruning or corruption), returns pointer to the most recent\n * block that could not be scanned.\n *\n * If pindexStop is not a nullptr, the scan will stop at the block-index\n * defined by pindexStop\n *\n * Caller needs to make sure pindexStop (and the optional pindexStart) are on\n * the main chain after to the addition of any new keys you want to detect\n * transactions for.\n */\nCBlockIndex* CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, CBlockIndex* pindexStop, const WalletRescanReserver &reserver, bool fUpdate)\n{\n    int64_t nNow = GetTime();\n    const CChainParams& chainParams = Params();\n\n    assert(reserver.isReserved());\n    if (pindexStop) {\n        assert(pindexStop->nHeight >= pindexStart->nHeight);\n    }\n\n    CBlockIndex* pindex = pindexStart;\n    CBlockIndex* ret = nullptr;\n    {\n        fAbortRescan = false;\n        ShowProgress(_(\"Rescanning...\"), 0); // show rescan progress in GUI as dialog or on splashscreen, if -rescan on startup\n        CBlockIndex* tip = nullptr;\n        double dProgressStart;\n        double dProgressTip;\n        {\n            LOCK(cs_main);\n            tip = chainActive.Tip();\n            dProgressStart = GuessVerificationProgress(chainParams.TxData(), pindex);\n            dProgressTip = GuessVerificationProgress(chainParams.TxData(), tip);\n        }\n        while (pindex && !fAbortRescan)\n        {\n            if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0) {\n                double gvp = 0;\n                {\n                    LOCK(cs_main);\n                    gvp = GuessVerificationProgress(chainParams.TxData(), pindex);\n                }\n                ShowProgress(_(\"Rescanning...\"), std::max(1, std::min(99, (int)((gvp - dProgressStart) / (dProgressTip - dProgressStart) * 100))));\n            }\n            if (GetTime() >= nNow + 60) {\n                nNow = GetTime();\n                LOCK(cs_main);\n                LogPrintf(\"Still rescanning. At block %d. Progress=%f\\n\", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));\n            }\n\n            CBlock block;\n            if (ReadBlockFromDisk(block, pindex, Params().GetConsensus())) {\n                LOCK2(cs_main, cs_wallet);\n                if (pindex && !chainActive.Contains(pindex)) {\n                    // Abort scan if current block is no longer active, to prevent\n                    // marking transactions as coming from the wrong block.\n                    ret = pindex;\n                    break;\n                }\n                for (size_t posInBlock = 0; posInBlock < block.vtx.size(); ++posInBlock) {\n                    AddToWalletIfInvolvingMe(block.vtx[posInBlock], pindex, posInBlock, fUpdate);\n                }\n            } else {\n                ret = pindex;\n            }\n            if (pindex == pindexStop) {\n                break;\n            }\n            {\n                LOCK(cs_main);\n                pindex = chainActive.Next(pindex);\n                if (tip != chainActive.Tip()) {\n                    tip = chainActive.Tip();\n                    // in case the tip has changed, update progress max\n                    dProgressTip = GuessVerificationProgress(chainParams.TxData(), tip);\n                }\n            }\n        }\n        if (pindex && fAbortRescan) {\n            LogPrintf(\"Rescan aborted at block %d. Progress=%f\\n\", pindex->nHeight, GuessVerificationProgress(chainParams.TxData(), pindex));\n        }\n        ShowProgress(_(\"Rescanning...\"), 100); // hide progress dialog in GUI\n    }\n    return ret;\n}\n\nvoid CWallet::ReacceptWalletTransactions()\n{\n    // If transactions aren't being broadcasted, don't let them into local mempool either\n    if (!fBroadcastTransactions)\n        return;\n    LOCK2(cs_main, cs_wallet);\n    std::map<int64_t, CWalletTx*> mapSorted;\n\n    // Sort pending wallet transactions based on their initial wallet insertion order\n    for (std::pair<const uint256, CWalletTx>& item : mapWallet)\n    {\n        const uint256& wtxid = item.first;\n        CWalletTx& wtx = item.second;\n        assert(wtx.GetHash() == wtxid);\n\n        int nDepth = wtx.GetDepthInMainChain();\n\n        if (!wtx.IsCoinBase() && (nDepth == 0 && !wtx.isAbandoned())) {\n            mapSorted.insert(std::make_pair(wtx.nOrderPos, &wtx));\n        }\n    }\n\n    // Try to add wallet transactions to memory pool\n    for (std::pair<const int64_t, CWalletTx*>& item : mapSorted) {\n        CWalletTx& wtx = *(item.second);\n        CValidationState state;\n        wtx.AcceptToMemoryPool(maxTxFee, state);\n    }\n}\n\nbool CWalletTx::RelayWalletTransaction(CConnman* connman)\n{\n    assert(pwallet->GetBroadcastTransactions());\n    if (!IsCoinBase() && !isAbandoned() && GetDepthInMainChain() == 0)\n    {\n        CValidationState state;\n        /* GetDepthInMainChain already catches known conflicts. */\n        if (InMempool() || AcceptToMemoryPool(maxTxFee, state)) {\n            LogPrintf(\"Relaying wtx %s\\n\", GetHash().ToString());\n            if (connman) {\n                CInv inv(MSG_TX, GetHash());\n                connman->ForEachNode([&inv](CNode* pnode)\n                {\n                    pnode->PushInventory(inv);\n                });\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\nstd::set<uint256> CWalletTx::GetConflicts() const\n{\n    std::set<uint256> result;\n    if (pwallet != nullptr)\n    {\n        uint256 myHash = GetHash();\n        result = pwallet->GetConflicts(myHash);\n        result.erase(myHash);\n    }\n    return result;\n}\n\nCAmount CWalletTx::GetDebit(const isminefilter& filter) const\n{\n    if (tx->vin.empty())\n        return 0;\n\n    CAmount debit = 0;\n    if(filter & ISMINE_SPENDABLE)\n    {\n        if (fDebitCached)\n            debit += nDebitCached;\n        else\n        {\n            nDebitCached = pwallet->GetDebit(*tx, ISMINE_SPENDABLE);\n            fDebitCached = true;\n            debit += nDebitCached;\n        }\n    }\n    if(filter & ISMINE_WATCH_ONLY)\n    {\n        if(fWatchDebitCached)\n            debit += nWatchDebitCached;\n        else\n        {\n            nWatchDebitCached = pwallet->GetDebit(*tx, ISMINE_WATCH_ONLY);\n            fWatchDebitCached = true;\n            debit += nWatchDebitCached;\n        }\n    }\n    return debit;\n}\n\nCAmount CWalletTx::GetCredit(const isminefilter& filter) const\n{\n    // Must wait until coinbase is safely deep enough in the chain before valuing it\n    if (IsCoinBase() && GetBlocksToMaturity() > 0)\n        return 0;\n\n    CAmount credit = 0;\n    if (filter & ISMINE_SPENDABLE)\n    {\n        // GetBalance can assume transactions in mapWallet won't change\n        if (fCreditCached)\n            credit += nCreditCached;\n        else\n        {\n            nCreditCached = pwallet->GetCredit(*tx, ISMINE_SPENDABLE);\n            fCreditCached = true;\n            credit += nCreditCached;\n        }\n    }\n    if (filter & ISMINE_WATCH_ONLY)\n    {\n        if (fWatchCreditCached)\n            credit += nWatchCreditCached;\n        else\n        {\n            nWatchCreditCached = pwallet->GetCredit(*tx, ISMINE_WATCH_ONLY);\n            fWatchCreditCached = true;\n            credit += nWatchCreditCached;\n        }\n    }\n    return credit;\n}\n\nCAmount CWalletTx::GetImmatureCredit(bool fUseCache) const\n{\n    if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain())\n    {\n        if (fUseCache && fImmatureCreditCached)\n            return nImmatureCreditCached;\n        nImmatureCreditCached = pwallet->GetCredit(*tx, ISMINE_SPENDABLE);\n        fImmatureCreditCached = true;\n        return nImmatureCreditCached;\n    }\n\n    return 0;\n}\n\nCAmount CWalletTx::GetAvailableCredit(bool fUseCache) const\n{\n    if (pwallet == nullptr)\n        return 0;\n\n    // Must wait until coinbase is safely deep enough in the chain before valuing it\n    if (IsCoinBase() && GetBlocksToMaturity() > 0)\n        return 0;\n\n    if (fUseCache && fAvailableCreditCached)\n        return nAvailableCreditCached;\n\n    CAmount nCredit = 0;\n    uint256 hashTx = GetHash();\n    for (unsigned int i = 0; i < tx->vout.size(); i++)\n    {\n        if (!pwallet->IsSpent(hashTx, i))\n        {\n            const CTxOut &txout = tx->vout[i];\n            nCredit += pwallet->GetCredit(txout, ISMINE_SPENDABLE);\n            if (!MoneyRange(nCredit))\n                throw std::runtime_error(std::string(__func__) + \" : value out of range\");\n        }\n    }\n\n    nAvailableCreditCached = nCredit;\n    fAvailableCreditCached = true;\n    return nCredit;\n}\n\nCAmount CWalletTx::GetImmatureWatchOnlyCredit(const bool fUseCache) const\n{\n    if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain())\n    {\n        if (fUseCache && fImmatureWatchCreditCached)\n            return nImmatureWatchCreditCached;\n        nImmatureWatchCreditCached = pwallet->GetCredit(*tx, ISMINE_WATCH_ONLY);\n        fImmatureWatchCreditCached = true;\n        return nImmatureWatchCreditCached;\n    }\n\n    return 0;\n}\n\nCAmount CWalletTx::GetAvailableWatchOnlyCredit(const bool fUseCache) const\n{\n    if (pwallet == nullptr)\n        return 0;\n\n    // Must wait until coinbase is safely deep enough in the chain before valuing it\n    if (IsCoinBase() && GetBlocksToMaturity() > 0)\n        return 0;\n\n    if (fUseCache && fAvailableWatchCreditCached)\n        return nAvailableWatchCreditCached;\n\n    CAmount nCredit = 0;\n    for (unsigned int i = 0; i < tx->vout.size(); i++)\n    {\n        if (!pwallet->IsSpent(GetHash(), i))\n        {\n            const CTxOut &txout = tx->vout[i];\n            nCredit += pwallet->GetCredit(txout, ISMINE_WATCH_ONLY);\n            if (!MoneyRange(nCredit))\n                throw std::runtime_error(std::string(__func__) + \": value out of range\");\n        }\n    }\n\n    nAvailableWatchCreditCached = nCredit;\n    fAvailableWatchCreditCached = true;\n    return nCredit;\n}\n\nCAmount CWalletTx::GetChange() const\n{\n    if (fChangeCached)\n        return nChangeCached;\n    nChangeCached = pwallet->GetChange(*tx);\n    fChangeCached = true;\n    return nChangeCached;\n}\n\nbool CWalletTx::InMempool() const\n{\n    return fInMempool;\n}\n\nbool CWalletTx::IsTrusted() const\n{\n    // Quick answer in most cases\n    if (!CheckFinalTx(*tx))\n        return false;\n    int nDepth = GetDepthInMainChain();\n    if (nDepth >= 1)\n        return true;\n    if (nDepth < 0)\n        return false;\n    if (!bSpendZeroConfChange || !IsFromMe(ISMINE_ALL)) // using wtx's cached debit\n        return false;\n\n    // Don't trust unconfirmed transactions from us unless they are in the mempool.\n    if (!InMempool())\n        return false;\n\n    // Trusted if all inputs are from us and are in the mempool:\n    for (const CTxIn& txin : tx->vin)\n    {\n        // Transactions not sent by us: not trusted\n        const CWalletTx* parent = pwallet->GetWalletTx(txin.prevout.hash);\n        if (parent == nullptr)\n            return false;\n        const CTxOut& parentOut = parent->tx->vout[txin.prevout.n];\n        if (pwallet->IsMine(parentOut) != ISMINE_SPENDABLE)\n            return false;\n    }\n    return true;\n}\n\nbool CWalletTx::IsEquivalentTo(const CWalletTx& _tx) const\n{\n        CMutableTransaction tx1 = *this->tx;\n        CMutableTransaction tx2 = *_tx.tx;\n        for (auto& txin : tx1.vin) txin.scriptSig = CScript();\n        for (auto& txin : tx2.vin) txin.scriptSig = CScript();\n        return CTransaction(tx1) == CTransaction(tx2);\n}\n\nstd::vector<uint256> CWallet::ResendWalletTransactionsBefore(int64_t nTime, CConnman* connman)\n{\n    std::vector<uint256> result;\n\n    LOCK(cs_wallet);\n\n    // Sort them in chronological order\n    std::multimap<unsigned int, CWalletTx*> mapSorted;\n    for (std::pair<const uint256, CWalletTx>& item : mapWallet)\n    {\n        CWalletTx& wtx = item.second;\n        // Don't rebroadcast if newer than nTime:\n        if (wtx.nTimeReceived > nTime)\n            continue;\n        mapSorted.insert(std::make_pair(wtx.nTimeReceived, &wtx));\n    }\n    for (std::pair<const unsigned int, CWalletTx*>& item : mapSorted)\n    {\n        CWalletTx& wtx = *item.second;\n        if (wtx.RelayWalletTransaction(connman))\n            result.push_back(wtx.GetHash());\n    }\n    return result;\n}\n\nvoid CWallet::ResendWalletTransactions(int64_t nBestBlockTime, CConnman* connman)\n{\n    // Do this infrequently and randomly to avoid giving away\n    // that these are our transactions.\n    if (GetTime() < nNextResend || !fBroadcastTransactions)\n        return;\n    bool fFirst = (nNextResend == 0);\n    nNextResend = GetTime() + GetRand(30 * 60);\n    if (fFirst)\n        return;\n\n    // Only do it if there's been a new block since last time\n    if (nBestBlockTime < nLastResend)\n        return;\n    nLastResend = GetTime();\n\n    // Rebroadcast unconfirmed txes older than 5 minutes before the last\n    // block was found:\n    std::vector<uint256> relayed = ResendWalletTransactionsBefore(nBestBlockTime-5*60, connman);\n    if (!relayed.empty())\n        LogPrintf(\"%s: rebroadcast %u unconfirmed transactions\\n\", __func__, relayed.size());\n}\n\n/** @} */ // end of mapWallet\n\n\n\n\n/** @defgroup Actions\n *\n * @{\n */\n\n\nCAmount CWallet::GetBalance() const\n{\n    CAmount nTotal = 0;\n    {\n        LOCK2(cs_main, cs_wallet);\n        for (const auto& entry : mapWallet)\n        {\n            const CWalletTx* pcoin = &entry.second;\n            if (pcoin->IsTrusted())\n                nTotal += pcoin->GetAvailableCredit();\n        }\n    }\n\n    return nTotal;\n}\n\nCAmount CWallet::GetUnconfirmedBalance() const\n{\n    CAmount nTotal = 0;\n    {\n        LOCK2(cs_main, cs_wallet);\n        for (const auto& entry : mapWallet)\n        {\n            const CWalletTx* pcoin = &entry.second;\n            if (!pcoin->IsTrusted() && pcoin->GetDepthInMainChain() == 0 && pcoin->InMempool())\n                nTotal += pcoin->GetAvailableCredit();\n        }\n    }\n    return nTotal;\n}\n\nCAmount CWallet::GetImmatureBalance() const\n{\n    CAmount nTotal = 0;\n    {\n        LOCK2(cs_main, cs_wallet);\n        for (const auto& entry : mapWallet)\n        {\n            const CWalletTx* pcoin = &entry.second;\n            nTotal += pcoin->GetImmatureCredit();\n        }\n    }\n    return nTotal;\n}\n\nCAmount CWallet::GetWatchOnlyBalance() const\n{\n    CAmount nTotal = 0;\n    {\n        LOCK2(cs_main, cs_wallet);\n        for (const auto& entry : mapWallet)\n        {\n            const CWalletTx* pcoin = &entry.second;\n            if (pcoin->IsTrusted())\n                nTotal += pcoin->GetAvailableWatchOnlyCredit();\n        }\n    }\n\n    return nTotal;\n}\n\nCAmount CWallet::GetUnconfirmedWatchOnlyBalance() const\n{\n    CAmount nTotal = 0;\n    {\n        LOCK2(cs_main, cs_wallet);\n        for (const auto& entry : mapWallet)\n        {\n            const CWalletTx* pcoin = &entry.second;\n            if (!pcoin->IsTrusted() && pcoin->GetDepthInMainChain() == 0 && pcoin->InMempool())\n                nTotal += pcoin->GetAvailableWatchOnlyCredit();\n        }\n    }\n    return nTotal;\n}\n\nCAmount CWallet::GetImmatureWatchOnlyBalance() const\n{\n    CAmount nTotal = 0;\n    {\n        LOCK2(cs_main, cs_wallet);\n        for (const auto& entry : mapWallet)\n        {\n            const CWalletTx* pcoin = &entry.second;\n            nTotal += pcoin->GetImmatureWatchOnlyCredit();\n        }\n    }\n    return nTotal;\n}\n\n// Calculate total balance in a different way from GetBalance. The biggest\n// difference is that GetBalance sums up all unspent TxOuts paying to the\n// wallet, while this sums up both spent and unspent TxOuts paying to the\n// wallet, and then subtracts the values of TxIns spending from the wallet. This\n// also has fewer restrictions on which unconfirmed transactions are considered\n// trusted.\nCAmount CWallet::GetLegacyBalance(const isminefilter& filter, int minDepth, const std::string* account) const\n{\n    LOCK2(cs_main, cs_wallet);\n\n    CAmount balance = 0;\n    for (const auto& entry : mapWallet) {\n        const CWalletTx& wtx = entry.second;\n        const int depth = wtx.GetDepthInMainChain();\n        if (depth < 0 || !CheckFinalTx(*wtx.tx) || wtx.GetBlocksToMaturity() > 0) {\n            continue;\n        }\n\n        // Loop through tx outputs and add incoming payments. For outgoing txs,\n        // treat change outputs specially, as part of the amount debited.\n        CAmount debit = wtx.GetDebit(filter);\n        const bool outgoing = debit > 0;\n        for (const CTxOut& out : wtx.tx->vout) {\n            if (outgoing && IsChange(out)) {\n                debit -= out.nValue;\n            } else if (IsMine(out) & filter && depth >= minDepth && (!account || *account == GetAccountName(out.scriptPubKey))) {\n                balance += out.nValue;\n            }\n        }\n\n        // For outgoing txs, subtract amount debited.\n        if (outgoing && (!account || *account == wtx.strFromAccount)) {\n            balance -= debit;\n        }\n    }\n\n    if (account) {\n        balance += CWalletDB(*dbw).GetAccountCreditDebit(*account);\n    }\n\n    return balance;\n}\n\nCAmount CWallet::GetAvailableBalance(const CCoinControl* coinControl) const\n{\n    LOCK2(cs_main, cs_wallet);\n\n    CAmount balance = 0;\n    std::vector<COutput> vCoins;\n    AvailableCoins(vCoins, true, coinControl);\n    for (const COutput& out : vCoins) {\n        if (out.fSpendable) {\n            balance += out.tx->tx->vout[out.i].nValue;\n        }\n    }\n    return balance;\n}\n\nvoid CWallet::AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe, const CCoinControl *coinControl, const CAmount &nMinimumAmount, const CAmount &nMaximumAmount, const CAmount &nMinimumSumAmount, const uint64_t nMaximumCount, const int nMinDepth, const int nMaxDepth) const\n{\n    vCoins.clear();\n\n    {\n        LOCK2(cs_main, cs_wallet);\n\n        CAmount nTotal = 0;\n\n        for (const auto& entry : mapWallet)\n        {\n            const uint256& wtxid = entry.first;\n            const CWalletTx* pcoin = &entry.second;\n\n            if (!CheckFinalTx(*pcoin->tx))\n                continue;\n\n            if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)\n                continue;\n\n            int nDepth = pcoin->GetDepthInMainChain();\n            if (nDepth < 0)\n                continue;\n\n            // We should not consider coins which aren't at least in our mempool\n            // It's possible for these to be conflicted via ancestors which we may never be able to detect\n            if (nDepth == 0 && !pcoin->InMempool())\n                continue;\n\n            bool safeTx = pcoin->IsTrusted();\n\n            // We should not consider coins from transactions that are replacing\n            // other transactions.\n            //\n            // Example: There is a transaction A which is replaced by bumpfee\n            // transaction B. In this case, we want to prevent creation of\n            // a transaction B' which spends an output of B.\n            //\n            // Reason: If transaction A were initially confirmed, transactions B\n            // and B' would no longer be valid, so the user would have to create\n            // a new transaction C to replace B'. However, in the case of a\n            // one-block reorg, transactions B' and C might BOTH be accepted,\n            // when the user only wanted one of them. Specifically, there could\n            // be a 1-block reorg away from the chain where transactions A and C\n            // were accepted to another chain where B, B', and C were all\n            // accepted.\n            if (nDepth == 0 && pcoin->mapValue.count(\"replaces_txid\")) {\n                safeTx = false;\n            }\n\n            // Similarly, we should not consider coins from transactions that\n            // have been replaced. In the example above, we would want to prevent\n            // creation of a transaction A' spending an output of A, because if\n            // transaction B were initially confirmed, conflicting with A and\n            // A', we wouldn't want to the user to create a transaction D\n            // intending to replace A', but potentially resulting in a scenario\n            // where A, A', and D could all be accepted (instead of just B and\n            // D, or just A and A' like the user would want).\n            if (nDepth == 0 && pcoin->mapValue.count(\"replaced_by_txid\")) {\n                safeTx = false;\n            }\n\n            if (fOnlySafe && !safeTx) {\n                continue;\n            }\n\n            if (nDepth < nMinDepth || nDepth > nMaxDepth)\n                continue;\n\n            for (unsigned int i = 0; i < pcoin->tx->vout.size(); i++) {\n                if (pcoin->tx->vout[i].nValue < nMinimumAmount || pcoin->tx->vout[i].nValue > nMaximumAmount)\n                    continue;\n\n                if (coinControl && coinControl->HasSelected() && !coinControl->fAllowOtherInputs && !coinControl->IsSelected(COutPoint(entry.first, i)))\n                    continue;\n\n                if (IsLockedCoin(entry.first, i))\n                    continue;\n\n                if (IsSpent(wtxid, i))\n                    continue;\n\n                isminetype mine = IsMine(pcoin->tx->vout[i]);\n\n                if (mine == ISMINE_NO) {\n                    continue;\n                }\n\n                bool fSpendableIn = ((mine & ISMINE_SPENDABLE) != ISMINE_NO) || (coinControl && coinControl->fAllowWatchOnly && (mine & ISMINE_WATCH_SOLVABLE) != ISMINE_NO);\n                bool fSolvableIn = (mine & (ISMINE_SPENDABLE | ISMINE_WATCH_SOLVABLE)) != ISMINE_NO;\n\n                vCoins.push_back(COutput(pcoin, i, nDepth, fSpendableIn, fSolvableIn, safeTx));\n\n                // Checks the sum amount of all UTXO's.\n                if (nMinimumSumAmount != MAX_MONEY) {\n                    nTotal += pcoin->tx->vout[i].nValue;\n\n                    if (nTotal >= nMinimumSumAmount) {\n                        return;\n                    }\n                }\n\n                // Checks the maximum number of UTXO's.\n                if (nMaximumCount > 0 && vCoins.size() >= nMaximumCount) {\n                    return;\n                }\n            }\n        }\n    }\n}\n\nstd::map<CTxDestination, std::vector<COutput>> CWallet::ListCoins() const\n{\n    // TODO: Add AssertLockHeld(cs_wallet) here.\n    //\n    // Because the return value from this function contains pointers to\n    // CWalletTx objects, callers to this function really should acquire the\n    // cs_wallet lock before calling it. However, the current caller doesn't\n    // acquire this lock yet. There was an attempt to add the missing lock in\n    // https://github.com/bitcoin/bitcoin/pull/10340, but that change has been\n    // postponed until after https://github.com/bitcoin/bitcoin/pull/10244 to\n    // avoid adding some extra complexity to the Qt code.\n\n    std::map<CTxDestination, std::vector<COutput>> result;\n\n    std::vector<COutput> availableCoins;\n    AvailableCoins(availableCoins);\n\n    LOCK2(cs_main, cs_wallet);\n    for (auto& coin : availableCoins) {\n        CTxDestination address;\n        if (coin.fSpendable &&\n            ExtractDestination(FindNonChangeParentOutput(*coin.tx->tx, coin.i).scriptPubKey, address)) {\n            result[address].emplace_back(std::move(coin));\n        }\n    }\n\n    std::vector<COutPoint> lockedCoins;\n    ListLockedCoins(lockedCoins);\n    for (const auto& output : lockedCoins) {\n        auto it = mapWallet.find(output.hash);\n        if (it != mapWallet.end()) {\n            int depth = it->second.GetDepthInMainChain();\n            if (depth >= 0 && output.n < it->second.tx->vout.size() &&\n                IsMine(it->second.tx->vout[output.n]) == ISMINE_SPENDABLE) {\n                CTxDestination address;\n                if (ExtractDestination(FindNonChangeParentOutput(*it->second.tx, output.n).scriptPubKey, address)) {\n                    result[address].emplace_back(\n                        &it->second, output.n, depth, true /* spendable */, true /* solvable */, false /* safe */);\n                }\n            }\n        }\n    }\n\n    return result;\n}\n\nconst CTxOut& CWallet::FindNonChangeParentOutput(const CTransaction& tx, int output) const\n{\n    const CTransaction* ptx = &tx;\n    int n = output;\n    while (IsChange(ptx->vout[n]) && ptx->vin.size() > 0) {\n        const COutPoint& prevout = ptx->vin[0].prevout;\n        auto it = mapWallet.find(prevout.hash);\n        if (it == mapWallet.end() || it->second.tx->vout.size() <= prevout.n ||\n            !IsMine(it->second.tx->vout[prevout.n])) {\n            break;\n        }\n        ptx = it->second.tx.get();\n        n = prevout.n;\n    }\n    return ptx->vout[n];\n}\n\nstatic void ApproximateBestSubset(const std::vector<CInputCoin>& vValue, const CAmount& nTotalLower, const CAmount& nTargetValue,\n                                  std::vector<char>& vfBest, CAmount& nBest, int iterations = 1000)\n{\n    std::vector<char> vfIncluded;\n\n    vfBest.assign(vValue.size(), true);\n    nBest = nTotalLower;\n\n    FastRandomContext insecure_rand;\n\n    for (int nRep = 0; nRep < iterations && nBest != nTargetValue; nRep++)\n    {\n        vfIncluded.assign(vValue.size(), false);\n        CAmount nTotal = 0;\n        bool fReachedTarget = false;\n        for (int nPass = 0; nPass < 2 && !fReachedTarget; nPass++)\n        {\n            for (unsigned int i = 0; i < vValue.size(); i++)\n            {\n                //The solver here uses a randomized algorithm,\n                //the randomness serves no real security purpose but is just\n                //needed to prevent degenerate behavior and it is important\n                //that the rng is fast. We do not use a constant random sequence,\n                //because there may be some privacy improvement by making\n                //the selection random.\n                if (nPass == 0 ? insecure_rand.randbool() : !vfIncluded[i])\n                {\n                    nTotal += vValue[i].txout.nValue;\n                    vfIncluded[i] = true;\n                    if (nTotal >= nTargetValue)\n                    {\n                        fReachedTarget = true;\n                        if (nTotal < nBest)\n                        {\n                            nBest = nTotal;\n                            vfBest = vfIncluded;\n                        }\n                        nTotal -= vValue[i].txout.nValue;\n                        vfIncluded[i] = false;\n                    }\n                }\n            }\n        }\n    }\n}\n\nbool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const int nConfMine, const int nConfTheirs, const uint64_t nMaxAncestors, std::vector<COutput> vCoins,\n                                 std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet) const\n{\n    setCoinsRet.clear();\n    nValueRet = 0;\n\n    // List of values less than target\n    boost::optional<CInputCoin> coinLowestLarger;\n    std::vector<CInputCoin> vValue;\n    CAmount nTotalLower = 0;\n\n    random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt);\n\n    for (const COutput &output : vCoins)\n    {\n        if (!output.fSpendable)\n            continue;\n\n        const CWalletTx *pcoin = output.tx;\n\n        if (output.nDepth < (pcoin->IsFromMe(ISMINE_ALL) ? nConfMine : nConfTheirs))\n            continue;\n\n        if (!mempool.TransactionWithinChainLimit(pcoin->GetHash(), nMaxAncestors))\n            continue;\n\n        int i = output.i;\n\n        CInputCoin coin = CInputCoin(pcoin, i);\n\n        if (coin.txout.nValue == nTargetValue)\n        {\n            setCoinsRet.insert(coin);\n            nValueRet += coin.txout.nValue;\n            return true;\n        }\n        else if (coin.txout.nValue < nTargetValue + MIN_CHANGE)\n        {\n            vValue.push_back(coin);\n            nTotalLower += coin.txout.nValue;\n        }\n        else if (!coinLowestLarger || coin.txout.nValue < coinLowestLarger->txout.nValue)\n        {\n            coinLowestLarger = coin;\n        }\n    }\n\n    if (nTotalLower == nTargetValue)\n    {\n        for (const auto& input : vValue)\n        {\n            setCoinsRet.insert(input);\n            nValueRet += input.txout.nValue;\n        }\n        return true;\n    }\n\n    if (nTotalLower < nTargetValue)\n    {\n        if (!coinLowestLarger)\n            return false;\n        setCoinsRet.insert(coinLowestLarger.get());\n        nValueRet += coinLowestLarger->txout.nValue;\n        return true;\n    }\n\n    // Solve subset sum by stochastic approximation\n    std::sort(vValue.begin(), vValue.end(), CompareValueOnly());\n    std::reverse(vValue.begin(), vValue.end());\n    std::vector<char> vfBest;\n    CAmount nBest;\n\n    ApproximateBestSubset(vValue, nTotalLower, nTargetValue, vfBest, nBest);\n    if (nBest != nTargetValue && nTotalLower >= nTargetValue + MIN_CHANGE)\n        ApproximateBestSubset(vValue, nTotalLower, nTargetValue + MIN_CHANGE, vfBest, nBest);\n\n    // If we have a bigger coin and (either the stochastic approximation didn't find a good solution,\n    //                                   or the next bigger coin is closer), return the bigger coin\n    if (coinLowestLarger &&\n        ((nBest != nTargetValue && nBest < nTargetValue + MIN_CHANGE) || coinLowestLarger->txout.nValue <= nBest))\n    {\n        setCoinsRet.insert(coinLowestLarger.get());\n        nValueRet += coinLowestLarger->txout.nValue;\n    }\n    else {\n        for (unsigned int i = 0; i < vValue.size(); i++)\n            if (vfBest[i])\n            {\n                setCoinsRet.insert(vValue[i]);\n                nValueRet += vValue[i].txout.nValue;\n            }\n\n        if (LogAcceptCategory(BCLog::SELECTCOINS)) {\n            LogPrint(BCLog::SELECTCOINS, \"SelectCoins() best subset: \");\n            for (unsigned int i = 0; i < vValue.size(); i++) {\n                if (vfBest[i]) {\n                    LogPrint(BCLog::SELECTCOINS, \"%s \", FormatMoney(vValue[i].txout.nValue));\n                }\n            }\n            LogPrint(BCLog::SELECTCOINS, \"total %s\\n\", FormatMoney(nBest));\n        }\n    }\n\n    return true;\n}\n\nbool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet, const CCoinControl* coinControl) const\n{\n    std::vector<COutput> vCoins(vAvailableCoins);\n\n    // coin control -> return all selected outputs (we want all selected to go into the transaction for sure)\n    if (coinControl && coinControl->HasSelected() && !coinControl->fAllowOtherInputs)\n    {\n        for (const COutput& out : vCoins)\n        {\n            if (!out.fSpendable)\n                 continue;\n            nValueRet += out.tx->tx->vout[out.i].nValue;\n            setCoinsRet.insert(CInputCoin(out.tx, out.i));\n        }\n        return (nValueRet >= nTargetValue);\n    }\n\n    // calculate value from preset inputs and store them\n    std::set<CInputCoin> setPresetCoins;\n    CAmount nValueFromPresetInputs = 0;\n\n    std::vector<COutPoint> vPresetInputs;\n    if (coinControl)\n        coinControl->ListSelected(vPresetInputs);\n    for (const COutPoint& outpoint : vPresetInputs)\n    {\n        std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(outpoint.hash);\n        if (it != mapWallet.end())\n        {\n            const CWalletTx* pcoin = &it->second;\n            // Clearly invalid input, fail\n            if (pcoin->tx->vout.size() <= outpoint.n)\n                return false;\n            nValueFromPresetInputs += pcoin->tx->vout[outpoint.n].nValue;\n            setPresetCoins.insert(CInputCoin(pcoin, outpoint.n));\n        } else\n            return false; // TODO: Allow non-wallet inputs\n    }\n\n    // remove preset inputs from vCoins\n    for (std::vector<COutput>::iterator it = vCoins.begin(); it != vCoins.end() && coinControl && coinControl->HasSelected();)\n    {\n        if (setPresetCoins.count(CInputCoin(it->tx, it->i)))\n            it = vCoins.erase(it);\n        else\n            ++it;\n    }\n\n    size_t nMaxChainLength = std::min(gArgs.GetArg(\"-limitancestorcount\", DEFAULT_ANCESTOR_LIMIT), gArgs.GetArg(\"-limitdescendantcount\", DEFAULT_DESCENDANT_LIMIT));\n    bool fRejectLongChains = gArgs.GetBoolArg(\"-walletrejectlongchains\", DEFAULT_WALLET_REJECT_LONG_CHAINS);\n\n    bool res = nTargetValue <= nValueFromPresetInputs ||\n        SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 1, 6, 0, vCoins, setCoinsRet, nValueRet) ||\n        SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 1, 1, 0, vCoins, setCoinsRet, nValueRet) ||\n        (bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 0, 1, 2, vCoins, setCoinsRet, nValueRet)) ||\n        (bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 0, 1, std::min((size_t)4, nMaxChainLength/3), vCoins, setCoinsRet, nValueRet)) ||\n        (bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 0, 1, nMaxChainLength/2, vCoins, setCoinsRet, nValueRet)) ||\n        (bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 0, 1, nMaxChainLength, vCoins, setCoinsRet, nValueRet)) ||\n        (bSpendZeroConfChange && !fRejectLongChains && SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 0, 1, std::numeric_limits<uint64_t>::max(), vCoins, setCoinsRet, nValueRet));\n\n    // because SelectCoinsMinConf clears the setCoinsRet, we now add the possible inputs to the coinset\n    setCoinsRet.insert(setPresetCoins.begin(), setPresetCoins.end());\n\n    // add preset inputs to the total value selected\n    nValueRet += nValueFromPresetInputs;\n\n    return res;\n}\n\nbool CWallet::SignTransaction(CMutableTransaction &tx)\n{\n    AssertLockHeld(cs_wallet); // mapWallet\n\n    // sign the new tx\n    CTransaction txNewConst(tx);\n    int nIn = 0;\n    for (const auto& input : tx.vin) {\n        std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(input.prevout.hash);\n        if(mi == mapWallet.end() || input.prevout.n >= mi->second.tx->vout.size()) {\n            return false;\n        }\n        const CScript& scriptPubKey = mi->second.tx->vout[input.prevout.n].scriptPubKey;\n        const CAmount& amount = mi->second.tx->vout[input.prevout.n].nValue;\n        SignatureData sigdata;\n        if (!ProduceSignature(TransactionSignatureCreator(this, &txNewConst, nIn, amount, SIGHASH_ALL), scriptPubKey, sigdata)) {\n            return false;\n        }\n        UpdateTransaction(tx, nIn, sigdata);\n        nIn++;\n    }\n    return true;\n}\n\nbool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nChangePosInOut, std::string& strFailReason, bool lockUnspents, const std::set<int>& setSubtractFeeFromOutputs, CCoinControl coinControl)\n{\n    std::vector<CRecipient> vecSend;\n\n    // Turn the txout set into a CRecipient vector.\n    for (size_t idx = 0; idx < tx.vout.size(); idx++) {\n        const CTxOut& txOut = tx.vout[idx];\n        CRecipient recipient = {txOut.scriptPubKey, txOut.nValue, setSubtractFeeFromOutputs.count(idx) == 1};\n        vecSend.push_back(recipient);\n    }\n\n    coinControl.fAllowOtherInputs = true;\n\n    for (const CTxIn& txin : tx.vin) {\n        coinControl.Select(txin.prevout);\n    }\n\n    // Acquire the locks to prevent races to the new locked unspents between the\n    // CreateTransaction call and LockCoin calls (when lockUnspents is true).\n    LOCK2(cs_main, cs_wallet);\n\n    CReserveKey reservekey(this);\n    CWalletTx wtx;\n    if (!CreateTransaction(vecSend, wtx, reservekey, nFeeRet, nChangePosInOut, strFailReason, coinControl, false)) {\n        return false;\n    }\n\n    if (nChangePosInOut != -1) {\n        tx.vout.insert(tx.vout.begin() + nChangePosInOut, wtx.tx->vout[nChangePosInOut]);\n        // We don't have the normal Create/Commit cycle, and don't want to risk\n        // reusing change, so just remove the key from the keypool here.\n        reservekey.KeepKey();\n    }\n\n    // Copy output sizes from new transaction; they may have had the fee\n    // subtracted from them.\n    for (unsigned int idx = 0; idx < tx.vout.size(); idx++) {\n        tx.vout[idx].nValue = wtx.tx->vout[idx].nValue;\n    }\n\n    // Add new txins while keeping original txin scriptSig/order.\n    for (const CTxIn& txin : wtx.tx->vin) {\n        if (!coinControl.IsSelected(txin.prevout)) {\n            tx.vin.push_back(txin);\n\n            if (lockUnspents) {\n                LockCoin(txin.prevout);\n            }\n        }\n    }\n\n    return true;\n}\n\nOutputType CWallet::TransactionChangeType(OutputType change_type, const std::vector<CRecipient>& vecSend)\n{\n    // If -changetype is specified, always use that change type.\n    if (change_type != OUTPUT_TYPE_NONE) {\n        return change_type;\n    }\n\n    // if g_address_type is legacy, use legacy address as change (even\n    // if some of the outputs are P2WPKH or P2WSH).\n    if (g_address_type == OUTPUT_TYPE_LEGACY) {\n        return OUTPUT_TYPE_LEGACY;\n    }\n\n    // if any destination is P2WPKH or P2WSH, use P2WPKH for the change\n    // output.\n    for (const auto& recipient : vecSend) {\n        // Check if any destination contains a witness program:\n        int witnessversion = 0;\n        std::vector<unsigned char> witnessprogram;\n        if (recipient.scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {\n            return OUTPUT_TYPE_BECH32;\n        }\n    }\n\n    // else use g_address_type for change\n    return g_address_type;\n}\n\nbool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet,\n                                int& nChangePosInOut, std::string& strFailReason, const CCoinControl& coin_control, bool sign)\n{\n    CAmount nValue = 0;\n    int nChangePosRequest = nChangePosInOut;\n    unsigned int nSubtractFeeFromAmount = 0;\n    for (const auto& recipient : vecSend)\n    {\n        if (nValue < 0 || recipient.nAmount < 0)\n        {\n            strFailReason = _(\"Transaction amounts must not be negative\");\n            return false;\n        }\n        nValue += recipient.nAmount;\n\n        if (recipient.fSubtractFeeFromAmount)\n            nSubtractFeeFromAmount++;\n    }\n    if (vecSend.empty())\n    {\n        strFailReason = _(\"Transaction must have at least one recipient\");\n        return false;\n    }\n\n    wtxNew.fTimeReceivedIsTxTime = true;\n    wtxNew.BindWallet(this);\n    CMutableTransaction txNew;\n\n    // Discourage fee sniping.\n    //\n    // For a large miner the value of the transactions in the best block and\n    // the mempool can exceed the cost of deliberately attempting to mine two\n    // blocks to orphan the current best block. By setting nLockTime such that\n    // only the next block can include the transaction, we discourage this\n    // practice as the height restricted and limited blocksize gives miners\n    // considering fee sniping fewer options for pulling off this attack.\n    //\n    // A simple way to think about this is from the wallet's point of view we\n    // always want the blockchain to move forward. By setting nLockTime this\n    // way we're basically making the statement that we only want this\n    // transaction to appear in the next block; we don't want to potentially\n    // encourage reorgs by allowing transactions to appear at lower heights\n    // than the next block in forks of the best chain.\n    //\n    // Of course, the subsidy is high enough, and transaction volume low\n    // enough, that fee sniping isn't a problem yet, but by implementing a fix\n    // now we ensure code won't be written that makes assumptions about\n    // nLockTime that preclude a fix later.\n    txNew.nLockTime = chainActive.Height();\n\n    // Secondly occasionally randomly pick a nLockTime even further back, so\n    // that transactions that are delayed after signing for whatever reason,\n    // e.g. high-latency mix networks and some CoinJoin implementations, have\n    // better privacy.\n    if (GetRandInt(10) == 0)\n        txNew.nLockTime = std::max(0, (int)txNew.nLockTime - GetRandInt(100));\n\n    assert(txNew.nLockTime <= (unsigned int)chainActive.Height());\n    assert(txNew.nLockTime < LOCKTIME_THRESHOLD);\n    FeeCalculation feeCalc;\n    CAmount nFeeNeeded;\n    unsigned int nBytes;\n    {\n        std::set<CInputCoin> setCoins;\n        LOCK2(cs_main, cs_wallet);\n        {\n            std::vector<COutput> vAvailableCoins;\n            AvailableCoins(vAvailableCoins, true, &coin_control);\n\n            // Create change script that will be used if we need change\n            // TODO: pass in scriptChange instead of reservekey so\n            // change transaction isn't always pay-to-bitcoin-address\n            CScript scriptChange;\n\n            // coin control: send change to custom address\n            if (!boost::get<CNoDestination>(&coin_control.destChange)) {\n                scriptChange = GetScriptForDestination(coin_control.destChange);\n            } else { // no coin control: send change to newly generated address\n                // Note: We use a new key here to keep it from being obvious which side is the change.\n                //  The drawback is that by not reusing a previous key, the change may be lost if a\n                //  backup is restored, if the backup doesn't have the new private key for the change.\n                //  If we reused the old key, it would be possible to add code to look for and\n                //  rediscover unknown transactions that were written with keys of ours to recover\n                //  post-backup change.\n\n                // Reserve a new key pair from key pool\n                CPubKey vchPubKey;\n                bool ret;\n                ret = reservekey.GetReservedKey(vchPubKey, true);\n                if (!ret)\n                {\n                    strFailReason = _(\"Keypool ran out, please call keypoolrefill first\");\n                    return false;\n                }\n\n                const OutputType change_type = TransactionChangeType(coin_control.change_type, vecSend);\n\n                LearnRelatedScripts(vchPubKey, change_type);\n                scriptChange = GetScriptForDestination(GetDestinationForKey(vchPubKey, change_type));\n            }\n            CTxOut change_prototype_txout(0, scriptChange);\n            size_t change_prototype_size = GetSerializeSize(change_prototype_txout, SER_DISK, 0);\n\n            CFeeRate discard_rate = GetDiscardRate(::feeEstimator);\n            nFeeRet = 0;\n            bool pick_new_inputs = true;\n            CAmount nValueIn = 0;\n            // Start with no fee and loop until there is enough fee\n            while (true)\n            {\n                nChangePosInOut = nChangePosRequest;\n                txNew.vin.clear();\n                txNew.vout.clear();\n                wtxNew.fFromMe = true;\n                bool fFirst = true;\n\n                CAmount nValueToSelect = nValue;\n                if (nSubtractFeeFromAmount == 0)\n                    nValueToSelect += nFeeRet;\n                // vouts to the payees\n                for (const auto& recipient : vecSend)\n                {\n                    CTxOut txout(recipient.nAmount, recipient.scriptPubKey);\n\n                    if (recipient.fSubtractFeeFromAmount)\n                    {\n                        assert(nSubtractFeeFromAmount != 0);\n                        txout.nValue -= nFeeRet / nSubtractFeeFromAmount; // Subtract fee equally from each selected recipient\n\n                        if (fFirst) // first receiver pays the remainder not divisible by output count\n                        {\n                            fFirst = false;\n                            txout.nValue -= nFeeRet % nSubtractFeeFromAmount;\n                        }\n                    }\n\n                    if (IsDust(txout, ::dustRelayFee))\n                    {\n                        if (recipient.fSubtractFeeFromAmount && nFeeRet > 0)\n                        {\n                            if (txout.nValue < 0)\n                                strFailReason = _(\"The transaction amount is too small to pay the fee\");\n                            else\n                                strFailReason = _(\"The transaction amount is too small to send after the fee has been deducted\");\n                        }\n                        else\n                            strFailReason = _(\"Transaction amount too small\");\n                        return false;\n                    }\n                    txNew.vout.push_back(txout);\n                }\n\n                // Choose coins to use\n                if (pick_new_inputs) {\n                    nValueIn = 0;\n                    setCoins.clear();\n                    if (!SelectCoins(vAvailableCoins, nValueToSelect, setCoins, nValueIn, &coin_control))\n                    {\n                        strFailReason = _(\"Insufficient funds\");\n                        return false;\n                    }\n                }\n\n                const CAmount nChange = nValueIn - nValueToSelect;\n\n                if (nChange > 0)\n                {\n                    // Fill a vout to ourself\n                    CTxOut newTxOut(nChange, scriptChange);\n\n                    // Never create dust outputs; if we would, just\n                    // add the dust to the fee.\n                    if (IsDust(newTxOut, discard_rate))\n                    {\n                        nChangePosInOut = -1;\n                        nFeeRet += nChange;\n                    }\n                    else\n                    {\n                        if (nChangePosInOut == -1)\n                        {\n                            // Insert change txn at random position:\n                            nChangePosInOut = GetRandInt(txNew.vout.size()+1);\n                        }\n                        else if ((unsigned int)nChangePosInOut > txNew.vout.size())\n                        {\n                            strFailReason = _(\"Change index out of range\");\n                            return false;\n                        }\n\n                        std::vector<CTxOut>::iterator position = txNew.vout.begin()+nChangePosInOut;\n                        txNew.vout.insert(position, newTxOut);\n                    }\n                } else {\n                    nChangePosInOut = -1;\n                }\n\n                // Fill vin\n                //\n                // Note how the sequence number is set to non-maxint so that\n                // the nLockTime set above actually works.\n                //\n                // BIP125 defines opt-in RBF as any nSequence < maxint-1, so\n                // we use the highest possible value in that range (maxint-2)\n                // to avoid conflicting with other possible uses of nSequence,\n                // and in the spirit of \"smallest possible change from prior\n                // behavior.\"\n                const uint32_t nSequence = coin_control.signalRbf ? MAX_BIP125_RBF_SEQUENCE : (CTxIn::SEQUENCE_FINAL - 1);\n                for (const auto& coin : setCoins)\n                    txNew.vin.push_back(CTxIn(coin.outpoint,CScript(),\n                                              nSequence));\n\n                // Fill in dummy signatures for fee calculation.\n                if (!DummySignTx(txNew, setCoins)) {\n                    strFailReason = _(\"Signing transaction failed\");\n                    return false;\n                }\n\n                nBytes = GetVirtualTransactionSize(txNew);\n\n                // Remove scriptSigs to eliminate the fee calculation dummy signatures\n                for (auto& vin : txNew.vin) {\n                    vin.scriptSig = CScript();\n                    vin.scriptWitness.SetNull();\n                }\n\n                nFeeNeeded = GetMinimumFee(nBytes, coin_control, ::mempool, ::feeEstimator, &feeCalc);\n\n                // If we made it here and we aren't even able to meet the relay fee on the next pass, give up\n                // because we must be at the maximum allowed fee.\n                if (nFeeNeeded < ::minRelayTxFee.GetFee(nBytes))\n                {\n                    strFailReason = _(\"Transaction too large for fee policy\");\n                    return false;\n                }\n\n                if (nFeeRet >= nFeeNeeded) {\n                    // Reduce fee to only the needed amount if possible. This\n                    // prevents potential overpayment in fees if the coins\n                    // selected to meet nFeeNeeded result in a transaction that\n                    // requires less fee than the prior iteration.\n\n                    // If we have no change and a big enough excess fee, then\n                    // try to construct transaction again only without picking\n                    // new inputs. We now know we only need the smaller fee\n                    // (because of reduced tx size) and so we should add a\n                    // change output. Only try this once.\n                    if (nChangePosInOut == -1 && nSubtractFeeFromAmount == 0 && pick_new_inputs) {\n                        unsigned int tx_size_with_change = nBytes + change_prototype_size + 2; // Add 2 as a buffer in case increasing # of outputs changes compact size\n                        CAmount fee_needed_with_change = GetMinimumFee(tx_size_with_change, coin_control, ::mempool, ::feeEstimator, nullptr);\n                        CAmount minimum_value_for_change = GetDustThreshold(change_prototype_txout, discard_rate);\n                        if (nFeeRet >= fee_needed_with_change + minimum_value_for_change) {\n                            pick_new_inputs = false;\n                            nFeeRet = fee_needed_with_change;\n                            continue;\n                        }\n                    }\n\n                    // If we have change output already, just increase it\n                    if (nFeeRet > nFeeNeeded && nChangePosInOut != -1 && nSubtractFeeFromAmount == 0) {\n                        CAmount extraFeePaid = nFeeRet - nFeeNeeded;\n                        std::vector<CTxOut>::iterator change_position = txNew.vout.begin()+nChangePosInOut;\n                        change_position->nValue += extraFeePaid;\n                        nFeeRet -= extraFeePaid;\n                    }\n                    break; // Done, enough fee included.\n                }\n                else if (!pick_new_inputs) {\n                    // This shouldn't happen, we should have had enough excess\n                    // fee to pay for the new output and still meet nFeeNeeded\n                    // Or we should have just subtracted fee from recipients and\n                    // nFeeNeeded should not have changed\n                    strFailReason = _(\"Transaction fee and change calculation failed\");\n                    return false;\n                }\n\n                // Try to reduce change to include necessary fee\n                if (nChangePosInOut != -1 && nSubtractFeeFromAmount == 0) {\n                    CAmount additionalFeeNeeded = nFeeNeeded - nFeeRet;\n                    std::vector<CTxOut>::iterator change_position = txNew.vout.begin()+nChangePosInOut;\n                    // Only reduce change if remaining amount is still a large enough output.\n                    if (change_position->nValue >= MIN_FINAL_CHANGE + additionalFeeNeeded) {\n                        change_position->nValue -= additionalFeeNeeded;\n                        nFeeRet += additionalFeeNeeded;\n                        break; // Done, able to increase fee from change\n                    }\n                }\n\n                // If subtracting fee from recipients, we now know what fee we\n                // need to subtract, we have no reason to reselect inputs\n                if (nSubtractFeeFromAmount > 0) {\n                    pick_new_inputs = false;\n                }\n\n                // Include more fee and try again.\n                nFeeRet = nFeeNeeded;\n                continue;\n            }\n        }\n\n        if (nChangePosInOut == -1) reservekey.ReturnKey(); // Return any reserved key if we don't have change\n\n        if (sign)\n        {\n            CTransaction txNewConst(txNew);\n            int nIn = 0;\n            for (const auto& coin : setCoins)\n            {\n                const CScript& scriptPubKey = coin.txout.scriptPubKey;\n                SignatureData sigdata;\n\n                if (!ProduceSignature(TransactionSignatureCreator(this, &txNewConst, nIn, coin.txout.nValue, SIGHASH_ALL), scriptPubKey, sigdata))\n                {\n                    strFailReason = _(\"Signing transaction failed\");\n                    return false;\n                } else {\n                    UpdateTransaction(txNew, nIn, sigdata);\n                }\n\n                nIn++;\n            }\n        }\n\n        // Embed the constructed transaction data in wtxNew.\n        wtxNew.SetTx(MakeTransactionRef(std::move(txNew)));\n\n        // Limit size\n        if (GetTransactionWeight(*wtxNew.tx) >= MAX_STANDARD_TX_WEIGHT)\n        {\n            strFailReason = _(\"Transaction too large\");\n            return false;\n        }\n    }\n\n    if (gArgs.GetBoolArg(\"-walletrejectlongchains\", DEFAULT_WALLET_REJECT_LONG_CHAINS)) {\n        // Lastly, ensure this tx will pass the mempool's chain limits\n        LockPoints lp;\n        CTxMemPoolEntry entry(wtxNew.tx, 0, 0, 0, false, 0, lp);\n        CTxMemPool::setEntries setAncestors;\n        size_t nLimitAncestors = gArgs.GetArg(\"-limitancestorcount\", DEFAULT_ANCESTOR_LIMIT);\n        size_t nLimitAncestorSize = gArgs.GetArg(\"-limitancestorsize\", DEFAULT_ANCESTOR_SIZE_LIMIT)*1000;\n        size_t nLimitDescendants = gArgs.GetArg(\"-limitdescendantcount\", DEFAULT_DESCENDANT_LIMIT);\n        size_t nLimitDescendantSize = gArgs.GetArg(\"-limitdescendantsize\", DEFAULT_DESCENDANT_SIZE_LIMIT)*1000;\n        std::string errString;\n        if (!mempool.CalculateMemPoolAncestors(entry, setAncestors, nLimitAncestors, nLimitAncestorSize, nLimitDescendants, nLimitDescendantSize, errString)) {\n            strFailReason = _(\"Transaction has too long of a mempool chain\");\n            return false;\n        }\n    }\n\n    LogPrintf(\"Fee Calculation: Fee:%d Bytes:%u Needed:%d Tgt:%d (requested %d) Reason:\\\"%s\\\" Decay %.5f: Estimation: (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out) Fail: (%g - %g) %.2f%% %.1f/(%.1f %d mem %.1f out)\\n\",\n              nFeeRet, nBytes, nFeeNeeded, feeCalc.returnedTarget, feeCalc.desiredTarget, StringForFeeReason(feeCalc.reason), feeCalc.est.decay,\n              feeCalc.est.pass.start, feeCalc.est.pass.end,\n              100 * feeCalc.est.pass.withinTarget / (feeCalc.est.pass.totalConfirmed + feeCalc.est.pass.inMempool + feeCalc.est.pass.leftMempool),\n              feeCalc.est.pass.withinTarget, feeCalc.est.pass.totalConfirmed, feeCalc.est.pass.inMempool, feeCalc.est.pass.leftMempool,\n              feeCalc.est.fail.start, feeCalc.est.fail.end,\n              100 * feeCalc.est.fail.withinTarget / (feeCalc.est.fail.totalConfirmed + feeCalc.est.fail.inMempool + feeCalc.est.fail.leftMempool),\n              feeCalc.est.fail.withinTarget, feeCalc.est.fail.totalConfirmed, feeCalc.est.fail.inMempool, feeCalc.est.fail.leftMempool);\n    return true;\n}\n\n/**\n * Call after CreateTransaction unless you want to abort\n */\nbool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CConnman* connman, CValidationState& state)\n{\n    {\n        LOCK2(cs_main, cs_wallet);\n        LogPrintf(\"CommitTransaction:\\n%s\", wtxNew.tx->ToString());\n        {\n            // Take key pair from key pool so it won't be used again\n            reservekey.KeepKey();\n\n            // Add tx to wallet, because if it has change it's also ours,\n            // otherwise just for transaction history.\n            AddToWallet(wtxNew);\n\n            // Notify that old coins are spent\n            for (const CTxIn& txin : wtxNew.tx->vin)\n            {\n                CWalletTx &coin = mapWallet[txin.prevout.hash];\n                coin.BindWallet(this);\n                NotifyTransactionChanged(this, coin.GetHash(), CT_UPDATED);\n            }\n        }\n\n        // Get the inserted-CWalletTx from mapWallet so that the\n        // fInMempool flag is cached properly\n        CWalletTx& wtx = mapWallet[wtxNew.GetHash()];\n\n        if (fBroadcastTransactions)\n        {\n            // Broadcast\n            if (!wtx.AcceptToMemoryPool(maxTxFee, state)) {\n                LogPrintf(\"CommitTransaction(): Transaction cannot be broadcast immediately, %s\\n\", state.GetRejectReason());\n                // TODO: if we expect the failure to be long term or permanent, instead delete wtx from the wallet and return failure.\n            } else {\n                wtx.RelayWalletTransaction(connman);\n            }\n        }\n    }\n    return true;\n}\n\nvoid CWallet::ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& entries) {\n    CWalletDB walletdb(*dbw);\n    return walletdb.ListAccountCreditDebit(strAccount, entries);\n}\n\nbool CWallet::AddAccountingEntry(const CAccountingEntry& acentry)\n{\n    CWalletDB walletdb(*dbw);\n\n    return AddAccountingEntry(acentry, &walletdb);\n}\n\nbool CWallet::AddAccountingEntry(const CAccountingEntry& acentry, CWalletDB *pwalletdb)\n{\n    if (!pwalletdb->WriteAccountingEntry(++nAccountingEntryNumber, acentry)) {\n        return false;\n    }\n\n    laccentries.push_back(acentry);\n    CAccountingEntry & entry = laccentries.back();\n    wtxOrdered.insert(std::make_pair(entry.nOrderPos, TxPair(nullptr, &entry)));\n\n    return true;\n}\n\nDBErrors CWallet::LoadWallet(bool& fFirstRunRet)\n{\n    LOCK2(cs_main, cs_wallet);\n\n    fFirstRunRet = false;\n    DBErrors nLoadWalletRet = CWalletDB(*dbw,\"cr+\").LoadWallet(this);\n    if (nLoadWalletRet == DB_NEED_REWRITE)\n    {\n        if (dbw->Rewrite(\"\\x04pool\"))\n        {\n            setInternalKeyPool.clear();\n            setExternalKeyPool.clear();\n            m_pool_key_to_index.clear();\n            // Note: can't top-up keypool here, because wallet is locked.\n            // User will be prompted to unlock wallet the next operation\n            // that requires a new key.\n        }\n    }\n\n    // This wallet is in its first run if all of these are empty\n    fFirstRunRet = mapKeys.empty() && mapCryptedKeys.empty() && mapWatchKeys.empty() && setWatchOnly.empty() && mapScripts.empty();\n\n    if (nLoadWalletRet != DB_LOAD_OK)\n        return nLoadWalletRet;\n\n    uiInterface.LoadWallet(this);\n\n    return DB_LOAD_OK;\n}\n\nDBErrors CWallet::ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256>& vHashOut)\n{\n    AssertLockHeld(cs_wallet); // mapWallet\n    DBErrors nZapSelectTxRet = CWalletDB(*dbw,\"cr+\").ZapSelectTx(vHashIn, vHashOut);\n    for (uint256 hash : vHashOut) {\n        const auto& it = mapWallet.find(hash);\n        wtxOrdered.erase(it->second.m_it_wtxOrdered);\n        mapWallet.erase(it);\n    }\n\n    if (nZapSelectTxRet == DB_NEED_REWRITE)\n    {\n        if (dbw->Rewrite(\"\\x04pool\"))\n        {\n            setInternalKeyPool.clear();\n            setExternalKeyPool.clear();\n            m_pool_key_to_index.clear();\n            // Note: can't top-up keypool here, because wallet is locked.\n            // User will be prompted to unlock wallet the next operation\n            // that requires a new key.\n        }\n    }\n\n    if (nZapSelectTxRet != DB_LOAD_OK)\n        return nZapSelectTxRet;\n\n    MarkDirty();\n\n    return DB_LOAD_OK;\n\n}\n\nDBErrors CWallet::ZapWalletTx(std::vector<CWalletTx>& vWtx)\n{\n    DBErrors nZapWalletTxRet = CWalletDB(*dbw,\"cr+\").ZapWalletTx(vWtx);\n    if (nZapWalletTxRet == DB_NEED_REWRITE)\n    {\n        if (dbw->Rewrite(\"\\x04pool\"))\n        {\n            LOCK(cs_wallet);\n            setInternalKeyPool.clear();\n            setExternalKeyPool.clear();\n            m_pool_key_to_index.clear();\n            // Note: can't top-up keypool here, because wallet is locked.\n            // User will be prompted to unlock wallet the next operation\n            // that requires a new key.\n        }\n    }\n\n    if (nZapWalletTxRet != DB_LOAD_OK)\n        return nZapWalletTxRet;\n\n    return DB_LOAD_OK;\n}\n\n\nbool CWallet::SetAddressBook(const CTxDestination& address, const std::string& strName, const std::string& strPurpose)\n{\n    bool fUpdated = false;\n    {\n        LOCK(cs_wallet); // mapAddressBook\n        std::map<CTxDestination, CAddressBookData>::iterator mi = mapAddressBook.find(address);\n        fUpdated = mi != mapAddressBook.end();\n        mapAddressBook[address].name = strName;\n        if (!strPurpose.empty()) /* update purpose only if requested */\n            mapAddressBook[address].purpose = strPurpose;\n    }\n    NotifyAddressBookChanged(this, address, strName, ::IsMine(*this, address) != ISMINE_NO,\n                             strPurpose, (fUpdated ? CT_UPDATED : CT_NEW) );\n    if (!strPurpose.empty() && !CWalletDB(*dbw).WritePurpose(EncodeDestination(address), strPurpose))\n        return false;\n    return CWalletDB(*dbw).WriteName(EncodeDestination(address), strName);\n}\n\nbool CWallet::DelAddressBook(const CTxDestination& address)\n{\n    {\n        LOCK(cs_wallet); // mapAddressBook\n\n        // Delete destdata tuples associated with address\n        std::string strAddress = EncodeDestination(address);\n        for (const std::pair<std::string, std::string> &item : mapAddressBook[address].destdata)\n        {\n            CWalletDB(*dbw).EraseDestData(strAddress, item.first);\n        }\n        mapAddressBook.erase(address);\n    }\n\n    NotifyAddressBookChanged(this, address, \"\", ::IsMine(*this, address) != ISMINE_NO, \"\", CT_DELETED);\n\n    CWalletDB(*dbw).ErasePurpose(EncodeDestination(address));\n    return CWalletDB(*dbw).EraseName(EncodeDestination(address));\n}\n\nconst std::string& CWallet::GetAccountName(const CScript& scriptPubKey) const\n{\n    CTxDestination address;\n    if (ExtractDestination(scriptPubKey, address) && !scriptPubKey.IsUnspendable()) {\n        auto mi = mapAddressBook.find(address);\n        if (mi != mapAddressBook.end()) {\n            return mi->second.name;\n        }\n    }\n    // A scriptPubKey that doesn't have an entry in the address book is\n    // associated with the default account (\"\").\n    const static std::string DEFAULT_ACCOUNT_NAME;\n    return DEFAULT_ACCOUNT_NAME;\n}\n\n/**\n * Mark old keypool keys as used,\n * and generate all new keys\n */\nbool CWallet::NewKeyPool()\n{\n    {\n        LOCK(cs_wallet);\n        CWalletDB walletdb(*dbw);\n\n        for (int64_t nIndex : setInternalKeyPool) {\n            walletdb.ErasePool(nIndex);\n        }\n        setInternalKeyPool.clear();\n\n        for (int64_t nIndex : setExternalKeyPool) {\n            walletdb.ErasePool(nIndex);\n        }\n        setExternalKeyPool.clear();\n\n        m_pool_key_to_index.clear();\n\n        if (!TopUpKeyPool()) {\n            return false;\n        }\n        LogPrintf(\"CWallet::NewKeyPool rewrote keypool\\n\");\n    }\n    return true;\n}\n\nsize_t CWallet::KeypoolCountExternalKeys()\n{\n    AssertLockHeld(cs_wallet); // setExternalKeyPool\n    return setExternalKeyPool.size();\n}\n\nvoid CWallet::LoadKeyPool(int64_t nIndex, const CKeyPool &keypool)\n{\n    AssertLockHeld(cs_wallet);\n    if (keypool.fInternal) {\n        setInternalKeyPool.insert(nIndex);\n    } else {\n        setExternalKeyPool.insert(nIndex);\n    }\n    m_max_keypool_index = std::max(m_max_keypool_index, nIndex);\n    m_pool_key_to_index[keypool.vchPubKey.GetID()] = nIndex;\n\n    // If no metadata exists yet, create a default with the pool key's\n    // creation time. Note that this may be overwritten by actually\n    // stored metadata for that key later, which is fine.\n    CKeyID keyid = keypool.vchPubKey.GetID();\n    if (mapKeyMetadata.count(keyid) == 0)\n        mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime);\n}\n\nbool CWallet::TopUpKeyPool(unsigned int kpSize)\n{\n    {\n        LOCK(cs_wallet);\n\n        if (IsLocked())\n            return false;\n\n        // Top up key pool\n        unsigned int nTargetSize;\n        if (kpSize > 0)\n            nTargetSize = kpSize;\n        else\n            nTargetSize = std::max(gArgs.GetArg(\"-keypool\", DEFAULT_KEYPOOL_SIZE), (int64_t) 0);\n\n        // count amount of available keys (internal, external)\n        // make sure the keypool of external and internal keys fits the user selected target (-keypool)\n        int64_t missingExternal = std::max(std::max((int64_t) nTargetSize, (int64_t) 1) - (int64_t)setExternalKeyPool.size(), (int64_t) 0);\n        int64_t missingInternal = std::max(std::max((int64_t) nTargetSize, (int64_t) 1) - (int64_t)setInternalKeyPool.size(), (int64_t) 0);\n\n        if (!IsHDEnabled() || !CanSupportFeature(FEATURE_HD_SPLIT))\n        {\n            // don't create extra internal keys\n            missingInternal = 0;\n        }\n        bool internal = false;\n        CWalletDB walletdb(*dbw);\n        for (int64_t i = missingInternal + missingExternal; i--;)\n        {\n            if (i < missingInternal) {\n                internal = true;\n            }\n\n            assert(m_max_keypool_index < std::numeric_limits<int64_t>::max()); // How in the hell did you use so many keys?\n            int64_t index = ++m_max_keypool_index;\n\n            CPubKey pubkey(GenerateNewKey(walletdb, internal));\n            if (!walletdb.WritePool(index, CKeyPool(pubkey, internal))) {\n                throw std::runtime_error(std::string(__func__) + \": writing generated key failed\");\n            }\n\n            if (internal) {\n                setInternalKeyPool.insert(index);\n            } else {\n                setExternalKeyPool.insert(index);\n            }\n            m_pool_key_to_index[pubkey.GetID()] = index;\n        }\n        if (missingInternal + missingExternal > 0) {\n            LogPrintf(\"keypool added %d keys (%d internal), size=%u (%u internal)\\n\", missingInternal + missingExternal, missingInternal, setInternalKeyPool.size() + setExternalKeyPool.size(), setInternalKeyPool.size());\n        }\n    }\n    return true;\n}\n\nvoid CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool fRequestedInternal)\n{\n    nIndex = -1;\n    keypool.vchPubKey = CPubKey();\n    {\n        LOCK(cs_wallet);\n\n        if (!IsLocked())\n            TopUpKeyPool();\n\n        bool fReturningInternal = IsHDEnabled() && CanSupportFeature(FEATURE_HD_SPLIT) && fRequestedInternal;\n        std::set<int64_t>& setKeyPool = fReturningInternal ? setInternalKeyPool : setExternalKeyPool;\n\n        // Get the oldest key\n        if(setKeyPool.empty())\n            return;\n\n        CWalletDB walletdb(*dbw);\n\n        auto it = setKeyPool.begin();\n        nIndex = *it;\n        setKeyPool.erase(it);\n        if (!walletdb.ReadPool(nIndex, keypool)) {\n            throw std::runtime_error(std::string(__func__) + \": read failed\");\n        }\n        if (!HaveKey(keypool.vchPubKey.GetID())) {\n            throw std::runtime_error(std::string(__func__) + \": unknown key in key pool\");\n        }\n        if (keypool.fInternal != fReturningInternal) {\n            throw std::runtime_error(std::string(__func__) + \": keypool entry misclassified\");\n        }\n\n        assert(keypool.vchPubKey.IsValid());\n        m_pool_key_to_index.erase(keypool.vchPubKey.GetID());\n        LogPrintf(\"keypool reserve %d\\n\", nIndex);\n    }\n}\n\nvoid CWallet::KeepKey(int64_t nIndex)\n{\n    // Remove from key pool\n    CWalletDB walletdb(*dbw);\n    walletdb.ErasePool(nIndex);\n    LogPrintf(\"keypool keep %d\\n\", nIndex);\n}\n\nvoid CWallet::ReturnKey(int64_t nIndex, bool fInternal, const CPubKey& pubkey)\n{\n    // Return to key pool\n    {\n        LOCK(cs_wallet);\n        if (fInternal) {\n            setInternalKeyPool.insert(nIndex);\n        } else {\n            setExternalKeyPool.insert(nIndex);\n        }\n        m_pool_key_to_index[pubkey.GetID()] = nIndex;\n    }\n    LogPrintf(\"keypool return %d\\n\", nIndex);\n}\n\nbool CWallet::GetKeyFromPool(CPubKey& result, bool internal)\n{\n    CKeyPool keypool;\n    {\n        LOCK(cs_wallet);\n        int64_t nIndex = 0;\n        ReserveKeyFromKeyPool(nIndex, keypool, internal);\n        if (nIndex == -1)\n        {\n            if (IsLocked()) return false;\n            CWalletDB walletdb(*dbw);\n            result = GenerateNewKey(walletdb, internal);\n            return true;\n        }\n        KeepKey(nIndex);\n        result = keypool.vchPubKey;\n    }\n    return true;\n}\n\nstatic int64_t GetOldestKeyTimeInPool(const std::set<int64_t>& setKeyPool, CWalletDB& walletdb) {\n    if (setKeyPool.empty()) {\n        return GetTime();\n    }\n\n    CKeyPool keypool;\n    int64_t nIndex = *(setKeyPool.begin());\n    if (!walletdb.ReadPool(nIndex, keypool)) {\n        throw std::runtime_error(std::string(__func__) + \": read oldest key in keypool failed\");\n    }\n    assert(keypool.vchPubKey.IsValid());\n    return keypool.nTime;\n}\n\nint64_t CWallet::GetOldestKeyPoolTime()\n{\n    LOCK(cs_wallet);\n\n    CWalletDB walletdb(*dbw);\n\n    // load oldest key from keypool, get time and return\n    int64_t oldestKey = GetOldestKeyTimeInPool(setExternalKeyPool, walletdb);\n    if (IsHDEnabled() && CanSupportFeature(FEATURE_HD_SPLIT)) {\n        oldestKey = std::max(GetOldestKeyTimeInPool(setInternalKeyPool, walletdb), oldestKey);\n    }\n\n    return oldestKey;\n}\n\nstd::map<CTxDestination, CAmount> CWallet::GetAddressBalances()\n{\n    std::map<CTxDestination, CAmount> balances;\n\n    {\n        LOCK(cs_wallet);\n        for (const auto& walletEntry : mapWallet)\n        {\n            const CWalletTx *pcoin = &walletEntry.second;\n\n            if (!pcoin->IsTrusted())\n                continue;\n\n            if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)\n                continue;\n\n            int nDepth = pcoin->GetDepthInMainChain();\n            if (nDepth < (pcoin->IsFromMe(ISMINE_ALL) ? 0 : 1))\n                continue;\n\n            for (unsigned int i = 0; i < pcoin->tx->vout.size(); i++)\n            {\n                CTxDestination addr;\n                if (!IsMine(pcoin->tx->vout[i]))\n                    continue;\n                if(!ExtractDestination(pcoin->tx->vout[i].scriptPubKey, addr))\n                    continue;\n\n                CAmount n = IsSpent(walletEntry.first, i) ? 0 : pcoin->tx->vout[i].nValue;\n\n                if (!balances.count(addr))\n                    balances[addr] = 0;\n                balances[addr] += n;\n            }\n        }\n    }\n\n    return balances;\n}\n\nstd::set< std::set<CTxDestination> > CWallet::GetAddressGroupings()\n{\n    AssertLockHeld(cs_wallet); // mapWallet\n    std::set< std::set<CTxDestination> > groupings;\n    std::set<CTxDestination> grouping;\n\n    for (const auto& walletEntry : mapWallet)\n    {\n        const CWalletTx *pcoin = &walletEntry.second;\n\n        if (pcoin->tx->vin.size() > 0)\n        {\n            bool any_mine = false;\n            // group all input addresses with each other\n            for (CTxIn txin : pcoin->tx->vin)\n            {\n                CTxDestination address;\n                if(!IsMine(txin)) /* If this input isn't mine, ignore it */\n                    continue;\n                if(!ExtractDestination(mapWallet[txin.prevout.hash].tx->vout[txin.prevout.n].scriptPubKey, address))\n                    continue;\n                grouping.insert(address);\n                any_mine = true;\n            }\n\n            // group change with input addresses\n            if (any_mine)\n            {\n               for (CTxOut txout : pcoin->tx->vout)\n                   if (IsChange(txout))\n                   {\n                       CTxDestination txoutAddr;\n                       if(!ExtractDestination(txout.scriptPubKey, txoutAddr))\n                           continue;\n                       grouping.insert(txoutAddr);\n                   }\n            }\n            if (grouping.size() > 0)\n            {\n                groupings.insert(grouping);\n                grouping.clear();\n            }\n        }\n\n        // group lone addrs by themselves\n        for (const auto& txout : pcoin->tx->vout)\n            if (IsMine(txout))\n            {\n                CTxDestination address;\n                if(!ExtractDestination(txout.scriptPubKey, address))\n                    continue;\n                grouping.insert(address);\n                groupings.insert(grouping);\n                grouping.clear();\n            }\n    }\n\n    std::set< std::set<CTxDestination>* > uniqueGroupings; // a set of pointers to groups of addresses\n    std::map< CTxDestination, std::set<CTxDestination>* > setmap;  // map addresses to the unique group containing it\n    for (std::set<CTxDestination> _grouping : groupings)\n    {\n        // make a set of all the groups hit by this new group\n        std::set< std::set<CTxDestination>* > hits;\n        std::map< CTxDestination, std::set<CTxDestination>* >::iterator it;\n        for (CTxDestination address : _grouping)\n            if ((it = setmap.find(address)) != setmap.end())\n                hits.insert((*it).second);\n\n        // merge all hit groups into a new single group and delete old groups\n        std::set<CTxDestination>* merged = new std::set<CTxDestination>(_grouping);\n        for (std::set<CTxDestination>* hit : hits)\n        {\n            merged->insert(hit->begin(), hit->end());\n            uniqueGroupings.erase(hit);\n            delete hit;\n        }\n        uniqueGroupings.insert(merged);\n\n        // update setmap\n        for (CTxDestination element : *merged)\n            setmap[element] = merged;\n    }\n\n    std::set< std::set<CTxDestination> > ret;\n    for (std::set<CTxDestination>* uniqueGrouping : uniqueGroupings)\n    {\n        ret.insert(*uniqueGrouping);\n        delete uniqueGrouping;\n    }\n\n    return ret;\n}\n\nstd::set<CTxDestination> CWallet::GetAccountAddresses(const std::string& strAccount) const\n{\n    LOCK(cs_wallet);\n    std::set<CTxDestination> result;\n    for (const std::pair<CTxDestination, CAddressBookData>& item : mapAddressBook)\n    {\n        const CTxDestination& address = item.first;\n        const std::string& strName = item.second.name;\n        if (strName == strAccount)\n            result.insert(address);\n    }\n    return result;\n}\n\nbool CReserveKey::GetReservedKey(CPubKey& pubkey, bool internal)\n{\n    if (nIndex == -1)\n    {\n        CKeyPool keypool;\n        pwallet->ReserveKeyFromKeyPool(nIndex, keypool, internal);\n        if (nIndex != -1)\n            vchPubKey = keypool.vchPubKey;\n        else {\n            return false;\n        }\n        fInternal = keypool.fInternal;\n    }\n    assert(vchPubKey.IsValid());\n    pubkey = vchPubKey;\n    return true;\n}\n\nvoid CReserveKey::KeepKey()\n{\n    if (nIndex != -1)\n        pwallet->KeepKey(nIndex);\n    nIndex = -1;\n    vchPubKey = CPubKey();\n}\n\nvoid CReserveKey::ReturnKey()\n{\n    if (nIndex != -1) {\n        pwallet->ReturnKey(nIndex, fInternal, vchPubKey);\n    }\n    nIndex = -1;\n    vchPubKey = CPubKey();\n}\n\nvoid CWallet::MarkReserveKeysAsUsed(int64_t keypool_id)\n{\n    AssertLockHeld(cs_wallet);\n    bool internal = setInternalKeyPool.count(keypool_id);\n    if (!internal) assert(setExternalKeyPool.count(keypool_id));\n    std::set<int64_t> *setKeyPool = internal ? &setInternalKeyPool : &setExternalKeyPool;\n    auto it = setKeyPool->begin();\n\n    CWalletDB walletdb(*dbw);\n    while (it != std::end(*setKeyPool)) {\n        const int64_t& index = *(it);\n        if (index > keypool_id) break; // set*KeyPool is ordered\n\n        CKeyPool keypool;\n        if (walletdb.ReadPool(index, keypool)) { //TODO: This should be unnecessary\n            m_pool_key_to_index.erase(keypool.vchPubKey.GetID());\n        }\n        LearnAllRelatedScripts(keypool.vchPubKey);\n        walletdb.ErasePool(index);\n        LogPrintf(\"keypool index %d removed\\n\", index);\n        it = setKeyPool->erase(it);\n    }\n}\n\nvoid CWallet::GetScriptForMining(std::shared_ptr<CReserveScript> &script)\n{\n    std::shared_ptr<CReserveKey> rKey = std::make_shared<CReserveKey>(this);\n    CPubKey pubkey;\n    if (!rKey->GetReservedKey(pubkey))\n        return;\n\n    script = rKey;\n    script->reserveScript = CScript() << ToByteVector(pubkey) << OP_CHECKSIG;\n}\n\nvoid CWallet::LockCoin(const COutPoint& output)\n{\n    AssertLockHeld(cs_wallet); // setLockedCoins\n    setLockedCoins.insert(output);\n}\n\nvoid CWallet::UnlockCoin(const COutPoint& output)\n{\n    AssertLockHeld(cs_wallet); // setLockedCoins\n    setLockedCoins.erase(output);\n}\n\nvoid CWallet::UnlockAllCoins()\n{\n    AssertLockHeld(cs_wallet); // setLockedCoins\n    setLockedCoins.clear();\n}\n\nbool CWallet::IsLockedCoin(uint256 hash, unsigned int n) const\n{\n    AssertLockHeld(cs_wallet); // setLockedCoins\n    COutPoint outpt(hash, n);\n\n    return (setLockedCoins.count(outpt) > 0);\n}\n\nvoid CWallet::ListLockedCoins(std::vector<COutPoint>& vOutpts) const\n{\n    AssertLockHeld(cs_wallet); // setLockedCoins\n    for (std::set<COutPoint>::iterator it = setLockedCoins.begin();\n         it != setLockedCoins.end(); it++) {\n        COutPoint outpt = (*it);\n        vOutpts.push_back(outpt);\n    }\n}\n\n/** @} */ // end of Actions\n\nvoid CWallet::GetKeyBirthTimes(std::map<CTxDestination, int64_t> &mapKeyBirth) const {\n    AssertLockHeld(cs_wallet); // mapKeyMetadata\n    mapKeyBirth.clear();\n\n    // get birth times for keys with metadata\n    for (const auto& entry : mapKeyMetadata) {\n        if (entry.second.nCreateTime) {\n            mapKeyBirth[entry.first] = entry.second.nCreateTime;\n        }\n    }\n\n    // map in which we'll infer heights of other keys\n    CBlockIndex *pindexMax = chainActive[std::max(0, chainActive.Height() - 144)]; // the tip can be reorganized; use a 144-block safety margin\n    std::map<CKeyID, CBlockIndex*> mapKeyFirstBlock;\n    for (const CKeyID &keyid : GetKeys()) {\n        if (mapKeyBirth.count(keyid) == 0)\n            mapKeyFirstBlock[keyid] = pindexMax;\n    }\n\n    // if there are no such keys, we're done\n    if (mapKeyFirstBlock.empty())\n        return;\n\n    // find first block that affects those keys, if there are any left\n    std::vector<CKeyID> vAffected;\n    for (const auto& entry : mapWallet) {\n        // iterate over all wallet transactions...\n        const CWalletTx &wtx = entry.second;\n        BlockMap::const_iterator blit = mapBlockIndex.find(wtx.hashBlock);\n        if (blit != mapBlockIndex.end() && chainActive.Contains(blit->second)) {\n            // ... which are already in a block\n            int nHeight = blit->second->nHeight;\n            for (const CTxOut &txout : wtx.tx->vout) {\n                // iterate over all their outputs\n                CAffectedKeysVisitor(*this, vAffected).Process(txout.scriptPubKey);\n                for (const CKeyID &keyid : vAffected) {\n                    // ... and all their affected keys\n                    std::map<CKeyID, CBlockIndex*>::iterator rit = mapKeyFirstBlock.find(keyid);\n                    if (rit != mapKeyFirstBlock.end() && nHeight < rit->second->nHeight)\n                        rit->second = blit->second;\n                }\n                vAffected.clear();\n            }\n        }\n    }\n\n    // Extract block timestamps for those keys\n    for (const auto& entry : mapKeyFirstBlock)\n        mapKeyBirth[entry.first] = entry.second->GetBlockTime() - TIMESTAMP_WINDOW; // block times can be 2h off\n}\n\n/**\n * Compute smart timestamp for a transaction being added to the wallet.\n *\n * Logic:\n * - If sending a transaction, assign its timestamp to the current time.\n * - If receiving a transaction outside a block, assign its timestamp to the\n *   current time.\n * - If receiving a block with a future timestamp, assign all its (not already\n *   known) transactions' timestamps to the current time.\n * - If receiving a block with a past timestamp, before the most recent known\n *   transaction (that we care about), assign all its (not already known)\n *   transactions' timestamps to the same timestamp as that most-recent-known\n *   transaction.\n * - If receiving a block with a past timestamp, but after the most recent known\n *   transaction, assign all its (not already known) transactions' timestamps to\n *   the block time.\n *\n * For more information see CWalletTx::nTimeSmart,\n * https://bitcointalk.org/?topic=54527, or\n * https://github.com/bitcoin/bitcoin/pull/1393.\n */\nunsigned int CWallet::ComputeTimeSmart(const CWalletTx& wtx) const\n{\n    unsigned int nTimeSmart = wtx.nTimeReceived;\n    if (!wtx.hashUnset()) {\n        if (mapBlockIndex.count(wtx.hashBlock)) {\n            int64_t latestNow = wtx.nTimeReceived;\n            int64_t latestEntry = 0;\n\n            // Tolerate times up to the last timestamp in the wallet not more than 5 minutes into the future\n            int64_t latestTolerated = latestNow + 300;\n            const TxItems& txOrdered = wtxOrdered;\n            for (auto it = txOrdered.rbegin(); it != txOrdered.rend(); ++it) {\n                CWalletTx* const pwtx = it->second.first;\n                if (pwtx == &wtx) {\n                    continue;\n                }\n                CAccountingEntry* const pacentry = it->second.second;\n                int64_t nSmartTime;\n                if (pwtx) {\n                    nSmartTime = pwtx->nTimeSmart;\n                    if (!nSmartTime) {\n                        nSmartTime = pwtx->nTimeReceived;\n                    }\n                } else {\n                    nSmartTime = pacentry->nTime;\n                }\n                if (nSmartTime <= latestTolerated) {\n                    latestEntry = nSmartTime;\n                    if (nSmartTime > latestNow) {\n                        latestNow = nSmartTime;\n                    }\n                    break;\n                }\n            }\n\n            int64_t blocktime = mapBlockIndex[wtx.hashBlock]->GetBlockTime();\n            nTimeSmart = std::max(latestEntry, std::min(blocktime, latestNow));\n        } else {\n            LogPrintf(\"%s: found %s in block %s not in index\\n\", __func__, wtx.GetHash().ToString(), wtx.hashBlock.ToString());\n        }\n    }\n    return nTimeSmart;\n}\n\nbool CWallet::AddDestData(const CTxDestination &dest, const std::string &key, const std::string &value)\n{\n    if (boost::get<CNoDestination>(&dest))\n        return false;\n\n    mapAddressBook[dest].destdata.insert(std::make_pair(key, value));\n    return CWalletDB(*dbw).WriteDestData(EncodeDestination(dest), key, value);\n}\n\nbool CWallet::EraseDestData(const CTxDestination &dest, const std::string &key)\n{\n    if (!mapAddressBook[dest].destdata.erase(key))\n        return false;\n    return CWalletDB(*dbw).EraseDestData(EncodeDestination(dest), key);\n}\n\nbool CWallet::LoadDestData(const CTxDestination &dest, const std::string &key, const std::string &value)\n{\n    mapAddressBook[dest].destdata.insert(std::make_pair(key, value));\n    return true;\n}\n\nbool CWallet::GetDestData(const CTxDestination &dest, const std::string &key, std::string *value) const\n{\n    std::map<CTxDestination, CAddressBookData>::const_iterator i = mapAddressBook.find(dest);\n    if(i != mapAddressBook.end())\n    {\n        CAddressBookData::StringMap::const_iterator j = i->second.destdata.find(key);\n        if(j != i->second.destdata.end())\n        {\n            if(value)\n                *value = j->second;\n            return true;\n        }\n    }\n    return false;\n}\n\nstd::vector<std::string> CWallet::GetDestValues(const std::string& prefix) const\n{\n    LOCK(cs_wallet);\n    std::vector<std::string> values;\n    for (const auto& address : mapAddressBook) {\n        for (const auto& data : address.second.destdata) {\n            if (!data.first.compare(0, prefix.size(), prefix)) {\n                values.emplace_back(data.second);\n            }\n        }\n    }\n    return values;\n}\n\nCWallet* CWallet::CreateWalletFromFile(const std::string walletFile)\n{\n    // needed to restore wallet transaction meta data after -zapwallettxes\n    std::vector<CWalletTx> vWtx;\n\n    if (gArgs.GetBoolArg(\"-zapwallettxes\", false)) {\n        uiInterface.InitMessage(_(\"Zapping all transactions from wallet...\"));\n\n        std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, walletFile));\n        std::unique_ptr<CWallet> tempWallet = MakeUnique<CWallet>(std::move(dbw));\n        DBErrors nZapWalletRet = tempWallet->ZapWalletTx(vWtx);\n        if (nZapWalletRet != DB_LOAD_OK) {\n            InitError(strprintf(_(\"Error loading %s: Wallet corrupted\"), walletFile));\n            return nullptr;\n        }\n    }\n\n    uiInterface.InitMessage(_(\"Loading wallet...\"));\n\n    int64_t nStart = GetTimeMillis();\n    bool fFirstRun = true;\n    std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, walletFile));\n    CWallet *walletInstance = new CWallet(std::move(dbw));\n    DBErrors nLoadWalletRet = walletInstance->LoadWallet(fFirstRun);\n    if (nLoadWalletRet != DB_LOAD_OK)\n    {\n        if (nLoadWalletRet == DB_CORRUPT) {\n            InitError(strprintf(_(\"Error loading %s: Wallet corrupted\"), walletFile));\n            return nullptr;\n        }\n        else if (nLoadWalletRet == DB_NONCRITICAL_ERROR)\n        {\n            InitWarning(strprintf(_(\"Error reading %s! All keys read correctly, but transaction data\"\n                                         \" or address book entries might be missing or incorrect.\"),\n                walletFile));\n        }\n        else if (nLoadWalletRet == DB_TOO_NEW) {\n            InitError(strprintf(_(\"Error loading %s: Wallet requires newer version of %s\"), walletFile, _(PACKAGE_NAME)));\n            return nullptr;\n        }\n        else if (nLoadWalletRet == DB_NEED_REWRITE)\n        {\n            InitError(strprintf(_(\"Wallet needed to be rewritten: restart %s to complete\"), _(PACKAGE_NAME)));\n            return nullptr;\n        }\n        else {\n            InitError(strprintf(_(\"Error loading %s\"), walletFile));\n            return nullptr;\n        }\n    }\n\n    if (gArgs.GetBoolArg(\"-upgradewallet\", fFirstRun))\n    {\n        int nMaxVersion = gArgs.GetArg(\"-upgradewallet\", 0);\n        if (nMaxVersion == 0) // the -upgradewallet without argument case\n        {\n            LogPrintf(\"Performing wallet upgrade to %i\\n\", FEATURE_LATEST);\n            nMaxVersion = CLIENT_VERSION;\n            walletInstance->SetMinVersion(FEATURE_LATEST); // permanently upgrade the wallet immediately\n        }\n        else\n            LogPrintf(\"Allowing wallet upgrade up to %i\\n\", nMaxVersion);\n        if (nMaxVersion < walletInstance->GetVersion())\n        {\n            InitError(_(\"Cannot downgrade wallet\"));\n            return nullptr;\n        }\n        walletInstance->SetMaxVersion(nMaxVersion);\n    }\n\n    if (fFirstRun)\n    {\n        // ensure this wallet.dat can only be opened by clients supporting HD with chain split and expects no default key\n        if (!gArgs.GetBoolArg(\"-usehd\", true)) {\n            InitError(strprintf(_(\"Error creating %s: You can't create non-HD wallets with this version.\"), walletFile));\n            return nullptr;\n        }\n        walletInstance->SetMinVersion(FEATURE_NO_DEFAULT_KEY);\n\n        // generate a new master key\n        CPubKey masterPubKey = walletInstance->GenerateNewHDMasterKey();\n        if (!walletInstance->SetHDMasterKey(masterPubKey))\n            throw std::runtime_error(std::string(__func__) + \": Storing master key failed\");\n\n        // Top up the keypool\n        if (!walletInstance->TopUpKeyPool()) {\n            InitError(_(\"Unable to generate initial keys\") += \"\\n\");\n            return nullptr;\n        }\n\n        walletInstance->SetBestChain(chainActive.GetLocator());\n    }\n    else if (gArgs.IsArgSet(\"-usehd\")) {\n        bool useHD = gArgs.GetBoolArg(\"-usehd\", true);\n        if (walletInstance->IsHDEnabled() && !useHD) {\n            InitError(strprintf(_(\"Error loading %s: You can't disable HD on an already existing HD wallet\"), walletFile));\n            return nullptr;\n        }\n        if (!walletInstance->IsHDEnabled() && useHD) {\n            InitError(strprintf(_(\"Error loading %s: You can't enable HD on an already existing non-HD wallet\"), walletFile));\n            return nullptr;\n        }\n    }\n\n    LogPrintf(\" wallet      %15dms\\n\", GetTimeMillis() - nStart);\n\n    // Try to top up keypool. No-op if the wallet is locked.\n    walletInstance->TopUpKeyPool();\n\n    CBlockIndex *pindexRescan = chainActive.Genesis();\n    if (!gArgs.GetBoolArg(\"-rescan\", false))\n    {\n        CWalletDB walletdb(*walletInstance->dbw);\n        CBlockLocator locator;\n        if (walletdb.ReadBestBlock(locator))\n            pindexRescan = FindForkInGlobalIndex(chainActive, locator);\n    }\n\n    walletInstance->m_last_block_processed = chainActive.Tip();\n    RegisterValidationInterface(walletInstance);\n\n    if (chainActive.Tip() && chainActive.Tip() != pindexRescan)\n    {\n        //We can't rescan beyond non-pruned blocks, stop and throw an error\n        //this might happen if a user uses an old wallet within a pruned node\n        // or if he ran -disablewallet for a longer time, then decided to re-enable\n        if (fPruneMode)\n        {\n            CBlockIndex *block = chainActive.Tip();\n            while (block && block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA) && block->pprev->nTx > 0 && pindexRescan != block)\n                block = block->pprev;\n\n            if (pindexRescan != block) {\n                InitError(_(\"Prune: last wallet synchronisation goes beyond pruned data. You need to -reindex (download the whole blockchain again in case of pruned node)\"));\n                return nullptr;\n            }\n        }\n\n        uiInterface.InitMessage(_(\"Rescanning...\"));\n        LogPrintf(\"Rescanning last %i blocks (from block %i)...\\n\", chainActive.Height() - pindexRescan->nHeight, pindexRescan->nHeight);\n\n        // No need to read and scan block if block was created before\n        // our wallet birthday (as adjusted for block time variability)\n        while (pindexRescan && walletInstance->nTimeFirstKey && (pindexRescan->GetBlockTime() < (walletInstance->nTimeFirstKey - TIMESTAMP_WINDOW))) {\n            pindexRescan = chainActive.Next(pindexRescan);\n        }\n\n        nStart = GetTimeMillis();\n        {\n            WalletRescanReserver reserver(walletInstance);\n            if (!reserver.reserve()) {\n                InitError(_(\"Failed to rescan the wallet during initialization\"));\n                return nullptr;\n            }\n            walletInstance->ScanForWalletTransactions(pindexRescan, nullptr, reserver, true);\n        }\n        LogPrintf(\" rescan      %15dms\\n\", GetTimeMillis() - nStart);\n        walletInstance->SetBestChain(chainActive.GetLocator());\n        walletInstance->dbw->IncrementUpdateCounter();\n\n        // Restore wallet transaction metadata after -zapwallettxes=1\n        if (gArgs.GetBoolArg(\"-zapwallettxes\", false) && gArgs.GetArg(\"-zapwallettxes\", \"1\") != \"2\")\n        {\n            CWalletDB walletdb(*walletInstance->dbw);\n\n            for (const CWalletTx& wtxOld : vWtx)\n            {\n                uint256 hash = wtxOld.GetHash();\n                std::map<uint256, CWalletTx>::iterator mi = walletInstance->mapWallet.find(hash);\n                if (mi != walletInstance->mapWallet.end())\n                {\n                    const CWalletTx* copyFrom = &wtxOld;\n                    CWalletTx* copyTo = &mi->second;\n                    copyTo->mapValue = copyFrom->mapValue;\n                    copyTo->vOrderForm = copyFrom->vOrderForm;\n                    copyTo->nTimeReceived = copyFrom->nTimeReceived;\n                    copyTo->nTimeSmart = copyFrom->nTimeSmart;\n                    copyTo->fFromMe = copyFrom->fFromMe;\n                    copyTo->strFromAccount = copyFrom->strFromAccount;\n                    copyTo->nOrderPos = copyFrom->nOrderPos;\n                    walletdb.WriteTx(*copyTo);\n                }\n            }\n        }\n    }\n    walletInstance->SetBroadcastTransactions(gArgs.GetBoolArg(\"-walletbroadcast\", DEFAULT_WALLETBROADCAST));\n\n    {\n        LOCK(walletInstance->cs_wallet);\n        LogPrintf(\"setKeyPool.size() = %u\\n\",      walletInstance->GetKeyPoolSize());\n        LogPrintf(\"mapWallet.size() = %u\\n\",       walletInstance->mapWallet.size());\n        LogPrintf(\"mapAddressBook.size() = %u\\n\",  walletInstance->mapAddressBook.size());\n    }\n\n    return walletInstance;\n}\n\nstd::atomic<bool> CWallet::fFlushScheduled(false);\n\nvoid CWallet::postInitProcess(CScheduler& scheduler)\n{\n    // Add wallet transactions that aren't already in a block to mempool\n    // Do this here as mempool requires genesis block to be loaded\n    ReacceptWalletTransactions();\n\n    // Run a thread to flush wallet periodically\n    if (!CWallet::fFlushScheduled.exchange(true)) {\n        scheduler.scheduleEvery(MaybeCompactWalletDB, 500);\n    }\n}\n\nbool CWallet::BackupWallet(const std::string& strDest)\n{\n    return dbw->Backup(strDest);\n}\n\nCKeyPool::CKeyPool()\n{\n    nTime = GetTime();\n    fInternal = false;\n}\n\nCKeyPool::CKeyPool(const CPubKey& vchPubKeyIn, bool internalIn)\n{\n    nTime = GetTime();\n    vchPubKey = vchPubKeyIn;\n    fInternal = internalIn;\n}\n\nCWalletKey::CWalletKey(int64_t nExpires)\n{\n    nTimeCreated = (nExpires ? GetTime() : 0);\n    nTimeExpires = nExpires;\n}\n\nvoid CMerkleTx::SetMerkleBranch(const CBlockIndex* pindex, int posInBlock)\n{\n    // Update the tx's hashBlock\n    hashBlock = pindex->GetBlockHash();\n\n    // set the position of the transaction in the block\n    nIndex = posInBlock;\n}\n\nint CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const\n{\n    if (hashUnset())\n        return 0;\n\n    AssertLockHeld(cs_main);\n\n    // Find the block it claims to be in\n    BlockMap::iterator mi = mapBlockIndex.find(hashBlock);\n    if (mi == mapBlockIndex.end())\n        return 0;\n    CBlockIndex* pindex = (*mi).second;\n    if (!pindex || !chainActive.Contains(pindex))\n        return 0;\n\n    pindexRet = pindex;\n    return ((nIndex == -1) ? (-1) : 1) * (chainActive.Height() - pindex->nHeight + 1);\n}\n\nint CMerkleTx::GetBlocksToMaturity() const\n{\n    if (!IsCoinBase())\n        return 0;\n    return std::max(0, (COINBASE_MATURITY+1) - GetDepthInMainChain());\n}\n\n\nbool CWalletTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state)\n{\n    // Quick check to avoid re-setting fInMempool to false\n    if (mempool.exists(tx->GetHash())) {\n        return false;\n    }\n\n    // We must set fInMempool here - while it will be re-set to true by the\n    // entered-mempool callback, if we did not there would be a race where a\n    // user could call sendmoney in a loop and hit spurious out of funds errors\n    // because we think that the transaction they just generated's change is\n    // unavailable as we're not yet aware its in mempool.\n    bool ret = ::AcceptToMemoryPool(mempool, state, tx, nullptr /* pfMissingInputs */,\n                                nullptr /* plTxnReplaced */, false /* bypass_limits */, nAbsurdFee);\n    fInMempool = ret;\n    return ret;\n}\n\nstatic const std::string OUTPUT_TYPE_STRING_LEGACY = \"legacy\";\nstatic const std::string OUTPUT_TYPE_STRING_P2SH_SEGWIT = \"p2sh-segwit\";\nstatic const std::string OUTPUT_TYPE_STRING_BECH32 = \"bech32\";\n\nOutputType ParseOutputType(const std::string& type, OutputType default_type)\n{\n    if (type.empty()) {\n        return default_type;\n    } else if (type == OUTPUT_TYPE_STRING_LEGACY) {\n        return OUTPUT_TYPE_LEGACY;\n    } else if (type == OUTPUT_TYPE_STRING_P2SH_SEGWIT) {\n        return OUTPUT_TYPE_P2SH_SEGWIT;\n    } else if (type == OUTPUT_TYPE_STRING_BECH32) {\n        return OUTPUT_TYPE_BECH32;\n    } else {\n        return OUTPUT_TYPE_NONE;\n    }\n}\n\nconst std::string& FormatOutputType(OutputType type)\n{\n    switch (type) {\n    case OUTPUT_TYPE_LEGACY: return OUTPUT_TYPE_STRING_LEGACY;\n    case OUTPUT_TYPE_P2SH_SEGWIT: return OUTPUT_TYPE_STRING_P2SH_SEGWIT;\n    case OUTPUT_TYPE_BECH32: return OUTPUT_TYPE_STRING_BECH32;\n    default: assert(false);\n    }\n}\n\nvoid CWallet::LearnRelatedScripts(const CPubKey& key, OutputType type)\n{\n    if (key.IsCompressed() && (type == OUTPUT_TYPE_P2SH_SEGWIT || type == OUTPUT_TYPE_BECH32)) {\n        CTxDestination witdest = WitnessV0KeyHash(key.GetID());\n        CScript witprog = GetScriptForDestination(witdest);\n        // Make sure the resulting program is solvable.\n        assert(IsSolvable(*this, witprog));\n        AddCScript(witprog);\n    }\n}\n\nvoid CWallet::LearnAllRelatedScripts(const CPubKey& key)\n{\n    // OUTPUT_TYPE_P2SH_SEGWIT always adds all necessary scripts for all types.\n    LearnRelatedScripts(key, OUTPUT_TYPE_P2SH_SEGWIT);\n}\n\nCTxDestination GetDestinationForKey(const CPubKey& key, OutputType type)\n{\n    switch (type) {\n    case OUTPUT_TYPE_LEGACY: return key.GetID();\n    case OUTPUT_TYPE_P2SH_SEGWIT:\n    case OUTPUT_TYPE_BECH32: {\n        if (!key.IsCompressed()) return key.GetID();\n        CTxDestination witdest = WitnessV0KeyHash(key.GetID());\n        CScript witprog = GetScriptForDestination(witdest);\n        if (type == OUTPUT_TYPE_P2SH_SEGWIT) {\n            return CScriptID(witprog);\n        } else {\n            return witdest;\n        }\n    }\n    default: assert(false);\n    }\n}\n\nstd::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key)\n{\n    CKeyID keyid = key.GetID();\n    if (key.IsCompressed()) {\n        CTxDestination segwit = WitnessV0KeyHash(keyid);\n        CTxDestination p2sh = CScriptID(GetScriptForDestination(segwit));\n        return std::vector<CTxDestination>{std::move(keyid), std::move(p2sh), std::move(segwit)};\n    } else {\n        return std::vector<CTxDestination>{std::move(keyid)};\n    }\n}\n\nCTxDestination CWallet::AddAndGetDestinationForScript(const CScript& script, OutputType type)\n{\n    // Note that scripts over 520 bytes are not yet supported.\n    switch (type) {\n    case OUTPUT_TYPE_LEGACY:\n        return CScriptID(script);\n    case OUTPUT_TYPE_P2SH_SEGWIT:\n    case OUTPUT_TYPE_BECH32: {\n        WitnessV0ScriptHash hash;\n        CSHA256().Write(script.data(), script.size()).Finalize(hash.begin());\n        CTxDestination witdest = hash;\n        CScript witprog = GetScriptForDestination(witdest);\n        // Check if the resulting program is solvable (i.e. doesn't use an uncompressed key)\n        if (!IsSolvable(*this, witprog)) return CScriptID(script);\n        // Add the redeemscript, so that P2WSH and P2SH-P2WSH outputs are recognized as ours.\n        AddCScript(witprog);\n        if (type == OUTPUT_TYPE_BECH32) {\n            return witdest;\n        } else {\n            return CScriptID(witprog);\n        }\n    }\n    default: assert(false);\n    }\n}\n"
  },
  {
    "path": "src/wallet/wallet.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_WALLET_H\n#define BITCOIN_WALLET_WALLET_H\n\n#include <amount.h>\n#include <policy/feerate.h>\n#include <streams.h>\n#include <tinyformat.h>\n#include <ui_interface.h>\n#include <utilstrencodings.h>\n#include <validationinterface.h>\n#include <script/ismine.h>\n#include <script/sign.h>\n#include <wallet/crypter.h>\n#include <wallet/walletdb.h>\n#include <wallet/rpcwallet.h>\n\n#include <algorithm>\n#include <atomic>\n#include <map>\n#include <memory>\n#include <set>\n#include <stdexcept>\n#include <stdint.h>\n#include <string>\n#include <utility>\n#include <vector>\n\ntypedef CWallet* CWalletRef;\nextern std::vector<CWalletRef> vpwallets;\n\n/**\n * Settings\n */\nextern CFeeRate payTxFee;\nextern unsigned int nTxConfirmTarget;\nextern bool bSpendZeroConfChange;\nextern bool fWalletRbf;\n\nstatic const unsigned int DEFAULT_KEYPOOL_SIZE = 1000;\n//! -paytxfee default\nstatic const CAmount DEFAULT_TRANSACTION_FEE = 0;\n//! -fallbackfee default\nstatic const CAmount DEFAULT_FALLBACK_FEE = 20000;\n//! -m_discard_rate default\nstatic const CAmount DEFAULT_DISCARD_FEE = 10000;\n//! -mintxfee default\nstatic const CAmount DEFAULT_TRANSACTION_MINFEE = 1000;\n//! minimum recommended increment for BIP 125 replacement txs\nstatic const CAmount WALLET_INCREMENTAL_RELAY_FEE = 5000;\n//! target minimum change amount\nstatic const CAmount MIN_CHANGE = CENT;\n//! final minimum change amount after paying for fees\nstatic const CAmount MIN_FINAL_CHANGE = MIN_CHANGE/2;\n//! Default for -spendzeroconfchange\nstatic const bool DEFAULT_SPEND_ZEROCONF_CHANGE = true;\n//! Default for -walletrejectlongchains\nstatic const bool DEFAULT_WALLET_REJECT_LONG_CHAINS = false;\n//! -txconfirmtarget default\nstatic const unsigned int DEFAULT_TX_CONFIRM_TARGET = 6;\n//! -walletrbf default\nstatic const bool DEFAULT_WALLET_RBF = false;\nstatic const bool DEFAULT_WALLETBROADCAST = true;\nstatic const bool DEFAULT_DISABLE_WALLET = false;\n\nextern const char * DEFAULT_WALLET_DAT;\n\nstatic const int64_t TIMESTAMP_MIN = 0;\n\nclass CBlockIndex;\nclass CCoinControl;\nclass COutput;\nclass CReserveKey;\nclass CScript;\nclass CScheduler;\nclass CTxMemPool;\nclass CBlockPolicyEstimator;\nclass CWalletTx;\nstruct FeeCalculation;\nenum class FeeEstimateMode;\n\n/** (client) version numbers for particular wallet features */\nenum WalletFeature\n{\n    FEATURE_BASE = 10500, // the earliest version new wallets supports (only useful for getwalletinfo's clientversion output)\n\n    FEATURE_WALLETCRYPT = 40000, // wallet encryption\n    FEATURE_COMPRPUBKEY = 60000, // compressed public keys\n\n    FEATURE_HD = 130000, // Hierarchical key derivation after BIP32 (HD Wallet)\n\n    FEATURE_HD_SPLIT = 139900, // Wallet with HD chain split (change outputs will use m/0'/1'/k)\n\n    FEATURE_NO_DEFAULT_KEY = 159900, // Wallet without a default key written\n\n    FEATURE_LATEST = FEATURE_COMPRPUBKEY // HD is optional, use FEATURE_COMPRPUBKEY as latest version\n};\n\nenum OutputType : int\n{\n    OUTPUT_TYPE_NONE,\n    OUTPUT_TYPE_LEGACY,\n    OUTPUT_TYPE_P2SH_SEGWIT,\n    OUTPUT_TYPE_BECH32,\n\n    // OUTPUT_TYPE_DEFAULT = OUTPUT_TYPE_P2SH_SEGWIT\n    OUTPUT_TYPE_DEFAULT = OUTPUT_TYPE_BECH32 // FIXME.SUGAR // set default address as BECH32\n};\n\nextern OutputType g_address_type;\nextern OutputType g_change_type;\n\n\n/** A key pool entry */\nclass CKeyPool\n{\npublic:\n    int64_t nTime;\n    CPubKey vchPubKey;\n    bool fInternal; // for change outputs\n\n    CKeyPool();\n    CKeyPool(const CPubKey& vchPubKeyIn, bool internalIn);\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        int nVersion = s.GetVersion();\n        if (!(s.GetType() & SER_GETHASH))\n            READWRITE(nVersion);\n        READWRITE(nTime);\n        READWRITE(vchPubKey);\n        if (ser_action.ForRead()) {\n            try {\n                READWRITE(fInternal);\n            }\n            catch (std::ios_base::failure&) {\n                /* flag as external address if we can't read the internal boolean\n                   (this will be the case for any wallet before the HD chain split version) */\n                fInternal = false;\n            }\n        }\n        else {\n            READWRITE(fInternal);\n        }\n    }\n};\n\n/** Address book data */\nclass CAddressBookData\n{\npublic:\n    std::string name;\n    std::string purpose;\n\n    CAddressBookData() : purpose(\"unknown\") {}\n\n    typedef std::map<std::string, std::string> StringMap;\n    StringMap destdata;\n};\n\nstruct CRecipient\n{\n    CScript scriptPubKey;\n    CAmount nAmount;\n    bool fSubtractFeeFromAmount;\n};\n\ntypedef std::map<std::string, std::string> mapValue_t;\n\n\nstatic inline void ReadOrderPos(int64_t& nOrderPos, mapValue_t& mapValue)\n{\n    if (!mapValue.count(\"n\"))\n    {\n        nOrderPos = -1; // TODO: calculate elsewhere\n        return;\n    }\n    nOrderPos = atoi64(mapValue[\"n\"].c_str());\n}\n\n\nstatic inline void WriteOrderPos(const int64_t& nOrderPos, mapValue_t& mapValue)\n{\n    if (nOrderPos == -1)\n        return;\n    mapValue[\"n\"] = i64tostr(nOrderPos);\n}\n\nstruct COutputEntry\n{\n    CTxDestination destination;\n    CAmount amount;\n    int vout;\n};\n\n/** A transaction with a merkle branch linking it to the block chain. */\nclass CMerkleTx\n{\nprivate:\n  /** Constant used in hashBlock to indicate tx has been abandoned */\n    static const uint256 ABANDON_HASH;\n\npublic:\n    CTransactionRef tx;\n    uint256 hashBlock;\n\n    /* An nIndex == -1 means that hashBlock (in nonzero) refers to the earliest\n     * block in the chain we know this or any in-wallet dependency conflicts\n     * with. Older clients interpret nIndex == -1 as unconfirmed for backward\n     * compatibility.\n     */\n    int nIndex;\n\n    CMerkleTx()\n    {\n        SetTx(MakeTransactionRef());\n        Init();\n    }\n\n    explicit CMerkleTx(CTransactionRef arg)\n    {\n        SetTx(std::move(arg));\n        Init();\n    }\n\n    void Init()\n    {\n        hashBlock = uint256();\n        nIndex = -1;\n    }\n\n    void SetTx(CTransactionRef arg)\n    {\n        tx = std::move(arg);\n    }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        std::vector<uint256> vMerkleBranch; // For compatibility with older versions.\n        READWRITE(tx);\n        READWRITE(hashBlock);\n        READWRITE(vMerkleBranch);\n        READWRITE(nIndex);\n    }\n\n    void SetMerkleBranch(const CBlockIndex* pIndex, int posInBlock);\n\n    /**\n     * Return depth of transaction in blockchain:\n     * <0  : conflicts with a transaction this deep in the blockchain\n     *  0  : in memory pool, waiting to be included in a block\n     * >=1 : this many blocks deep in the main chain\n     */\n    int GetDepthInMainChain(const CBlockIndex* &pindexRet) const;\n    int GetDepthInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet); }\n    bool IsInMainChain() const { const CBlockIndex *pindexRet; return GetDepthInMainChain(pindexRet) > 0; }\n    int GetBlocksToMaturity() const;\n    bool hashUnset() const { return (hashBlock.IsNull() || hashBlock == ABANDON_HASH); }\n    bool isAbandoned() const { return (hashBlock == ABANDON_HASH); }\n    void setAbandoned() { hashBlock = ABANDON_HASH; }\n\n    const uint256& GetHash() const { return tx->GetHash(); }\n    bool IsCoinBase() const { return tx->IsCoinBase(); }\n};\n\n/** \n * A transaction with a bunch of additional info that only the owner cares about.\n * It includes any unrecorded transactions needed to link it back to the block chain.\n */\nclass CWalletTx : public CMerkleTx\n{\nprivate:\n    const CWallet* pwallet;\n\npublic:\n    /**\n     * Key/value map with information about the transaction.\n     *\n     * The following keys can be read and written through the map and are\n     * serialized in the wallet database:\n     *\n     *     \"comment\", \"to\"   - comment strings provided to sendtoaddress,\n     *                         sendfrom, sendmany wallet RPCs\n     *     \"replaces_txid\"   - txid (as HexStr) of transaction replaced by\n     *                         bumpfee on transaction created by bumpfee\n     *     \"replaced_by_txid\" - txid (as HexStr) of transaction created by\n     *                         bumpfee on transaction replaced by bumpfee\n     *     \"from\", \"message\" - obsolete fields that could be set in UI prior to\n     *                         2011 (removed in commit 4d9b223)\n     *\n     * The following keys are serialized in the wallet database, but shouldn't\n     * be read or written through the map (they will be temporarily added and\n     * removed from the map during serialization):\n     *\n     *     \"fromaccount\"     - serialized strFromAccount value\n     *     \"n\"               - serialized nOrderPos value\n     *     \"timesmart\"       - serialized nTimeSmart value\n     *     \"spent\"           - serialized vfSpent value that existed prior to\n     *                         2014 (removed in commit 93a18a3)\n     */\n    mapValue_t mapValue;\n    std::vector<std::pair<std::string, std::string> > vOrderForm;\n    unsigned int fTimeReceivedIsTxTime;\n    unsigned int nTimeReceived; //!< time received by this node\n    /**\n     * Stable timestamp that never changes, and reflects the order a transaction\n     * was added to the wallet. Timestamp is based on the block time for a\n     * transaction added as part of a block, or else the time when the\n     * transaction was received if it wasn't part of a block, with the timestamp\n     * adjusted in both cases so timestamp order matches the order transactions\n     * were added to the wallet. More details can be found in\n     * CWallet::ComputeTimeSmart().\n     */\n    unsigned int nTimeSmart;\n    /**\n     * From me flag is set to 1 for transactions that were created by the wallet\n     * on this bitcoin node, and set to 0 for transactions that were created\n     * externally and came in through the network or sendrawtransaction RPC.\n     */\n    char fFromMe;\n    std::string strFromAccount;\n    int64_t nOrderPos; //!< position in ordered transaction list\n    std::multimap<int64_t, std::pair<CWalletTx*, CAccountingEntry*>>::const_iterator m_it_wtxOrdered;\n\n    // memory only\n    mutable bool fDebitCached;\n    mutable bool fCreditCached;\n    mutable bool fImmatureCreditCached;\n    mutable bool fAvailableCreditCached;\n    mutable bool fWatchDebitCached;\n    mutable bool fWatchCreditCached;\n    mutable bool fImmatureWatchCreditCached;\n    mutable bool fAvailableWatchCreditCached;\n    mutable bool fChangeCached;\n    mutable bool fInMempool;\n    mutable CAmount nDebitCached;\n    mutable CAmount nCreditCached;\n    mutable CAmount nImmatureCreditCached;\n    mutable CAmount nAvailableCreditCached;\n    mutable CAmount nWatchDebitCached;\n    mutable CAmount nWatchCreditCached;\n    mutable CAmount nImmatureWatchCreditCached;\n    mutable CAmount nAvailableWatchCreditCached;\n    mutable CAmount nChangeCached;\n\n    CWalletTx()\n    {\n        Init(nullptr);\n    }\n\n    CWalletTx(const CWallet* pwalletIn, CTransactionRef arg) : CMerkleTx(std::move(arg))\n    {\n        Init(pwalletIn);\n    }\n\n    void Init(const CWallet* pwalletIn)\n    {\n        pwallet = pwalletIn;\n        mapValue.clear();\n        vOrderForm.clear();\n        fTimeReceivedIsTxTime = false;\n        nTimeReceived = 0;\n        nTimeSmart = 0;\n        fFromMe = false;\n        strFromAccount.clear();\n        fDebitCached = false;\n        fCreditCached = false;\n        fImmatureCreditCached = false;\n        fAvailableCreditCached = false;\n        fWatchDebitCached = false;\n        fWatchCreditCached = false;\n        fImmatureWatchCreditCached = false;\n        fAvailableWatchCreditCached = false;\n        fChangeCached = false;\n        fInMempool = false;\n        nDebitCached = 0;\n        nCreditCached = 0;\n        nImmatureCreditCached = 0;\n        nAvailableCreditCached = 0;\n        nWatchDebitCached = 0;\n        nWatchCreditCached = 0;\n        nAvailableWatchCreditCached = 0;\n        nImmatureWatchCreditCached = 0;\n        nChangeCached = 0;\n        nOrderPos = -1;\n    }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        if (ser_action.ForRead())\n            Init(nullptr);\n        char fSpent = false;\n\n        if (!ser_action.ForRead())\n        {\n            mapValue[\"fromaccount\"] = strFromAccount;\n\n            WriteOrderPos(nOrderPos, mapValue);\n\n            if (nTimeSmart)\n                mapValue[\"timesmart\"] = strprintf(\"%u\", nTimeSmart);\n        }\n\n        READWRITE(*(CMerkleTx*)this);\n        std::vector<CMerkleTx> vUnused; //!< Used to be vtxPrev\n        READWRITE(vUnused);\n        READWRITE(mapValue);\n        READWRITE(vOrderForm);\n        READWRITE(fTimeReceivedIsTxTime);\n        READWRITE(nTimeReceived);\n        READWRITE(fFromMe);\n        READWRITE(fSpent);\n\n        if (ser_action.ForRead())\n        {\n            strFromAccount = mapValue[\"fromaccount\"];\n\n            ReadOrderPos(nOrderPos, mapValue);\n\n            nTimeSmart = mapValue.count(\"timesmart\") ? (unsigned int)atoi64(mapValue[\"timesmart\"]) : 0;\n        }\n\n        mapValue.erase(\"fromaccount\");\n        mapValue.erase(\"spent\");\n        mapValue.erase(\"n\");\n        mapValue.erase(\"timesmart\");\n    }\n\n    //! make sure balances are recalculated\n    void MarkDirty()\n    {\n        fCreditCached = false;\n        fAvailableCreditCached = false;\n        fImmatureCreditCached = false;\n        fWatchDebitCached = false;\n        fWatchCreditCached = false;\n        fAvailableWatchCreditCached = false;\n        fImmatureWatchCreditCached = false;\n        fDebitCached = false;\n        fChangeCached = false;\n    }\n\n    void BindWallet(CWallet *pwalletIn)\n    {\n        pwallet = pwalletIn;\n        MarkDirty();\n    }\n\n    //! filter decides which addresses will count towards the debit\n    CAmount GetDebit(const isminefilter& filter) const;\n    CAmount GetCredit(const isminefilter& filter) const;\n    CAmount GetImmatureCredit(bool fUseCache=true) const;\n    CAmount GetAvailableCredit(bool fUseCache=true) const;\n    CAmount GetImmatureWatchOnlyCredit(const bool fUseCache=true) const;\n    CAmount GetAvailableWatchOnlyCredit(const bool fUseCache=true) const;\n    CAmount GetChange() const;\n\n    void GetAmounts(std::list<COutputEntry>& listReceived,\n                    std::list<COutputEntry>& listSent, CAmount& nFee, std::string& strSentAccount, const isminefilter& filter) const;\n\n    bool IsFromMe(const isminefilter& filter) const\n    {\n        return (GetDebit(filter) > 0);\n    }\n\n    // True if only scriptSigs are different\n    bool IsEquivalentTo(const CWalletTx& tx) const;\n\n    bool InMempool() const;\n    bool IsTrusted() const;\n\n    int64_t GetTxTime() const;\n\n    // RelayWalletTransaction may only be called if fBroadcastTransactions!\n    bool RelayWalletTransaction(CConnman* connman);\n\n    /** Pass this transaction to the mempool. Fails if absolute fee exceeds absurd fee. */\n    bool AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState& state);\n\n    std::set<uint256> GetConflicts() const;\n};\n\n\nclass CInputCoin {\npublic:\n    CInputCoin(const CWalletTx* walletTx, unsigned int i)\n    {\n        if (!walletTx)\n            throw std::invalid_argument(\"walletTx should not be null\");\n        if (i >= walletTx->tx->vout.size())\n            throw std::out_of_range(\"The output index is out of range\");\n\n        outpoint = COutPoint(walletTx->GetHash(), i);\n        txout = walletTx->tx->vout[i];\n    }\n\n    COutPoint outpoint;\n    CTxOut txout;\n\n    bool operator<(const CInputCoin& rhs) const {\n        return outpoint < rhs.outpoint;\n    }\n\n    bool operator!=(const CInputCoin& rhs) const {\n        return outpoint != rhs.outpoint;\n    }\n\n    bool operator==(const CInputCoin& rhs) const {\n        return outpoint == rhs.outpoint;\n    }\n};\n\nclass COutput\n{\npublic:\n    const CWalletTx *tx;\n    int i;\n    int nDepth;\n\n    /** Whether we have the private keys to spend this output */\n    bool fSpendable;\n\n    /** Whether we know how to spend this output, ignoring the lack of keys */\n    bool fSolvable;\n\n    /**\n     * Whether this output is considered safe to spend. Unconfirmed transactions\n     * from outside keys and unconfirmed replacement transactions are considered\n     * unsafe and will not be used to fund new spending transactions.\n     */\n    bool fSafe;\n\n    COutput(const CWalletTx *txIn, int iIn, int nDepthIn, bool fSpendableIn, bool fSolvableIn, bool fSafeIn)\n    {\n        tx = txIn; i = iIn; nDepth = nDepthIn; fSpendable = fSpendableIn; fSolvable = fSolvableIn; fSafe = fSafeIn;\n    }\n\n    std::string ToString() const;\n};\n\n\n\n\n/** Private key that includes an expiration date in case it never gets used. */\nclass CWalletKey\n{\npublic:\n    CPrivKey vchPrivKey;\n    int64_t nTimeCreated;\n    int64_t nTimeExpires;\n    std::string strComment;\n    //! todo: add something to note what created it (user, getnewaddress, change)\n    //!   maybe should have a map<string, string> property map\n\n    explicit CWalletKey(int64_t nExpires=0);\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        int nVersion = s.GetVersion();\n        if (!(s.GetType() & SER_GETHASH))\n            READWRITE(nVersion);\n        READWRITE(vchPrivKey);\n        READWRITE(nTimeCreated);\n        READWRITE(nTimeExpires);\n        READWRITE(LIMITED_STRING(strComment, 65536));\n    }\n};\n\n/**\n * Internal transfers.\n * Database key is acentry<account><counter>.\n */\nclass CAccountingEntry\n{\npublic:\n    std::string strAccount;\n    CAmount nCreditDebit;\n    int64_t nTime;\n    std::string strOtherAccount;\n    std::string strComment;\n    mapValue_t mapValue;\n    int64_t nOrderPos; //!< position in ordered transaction list\n    uint64_t nEntryNo;\n\n    CAccountingEntry()\n    {\n        SetNull();\n    }\n\n    void SetNull()\n    {\n        nCreditDebit = 0;\n        nTime = 0;\n        strAccount.clear();\n        strOtherAccount.clear();\n        strComment.clear();\n        nOrderPos = -1;\n        nEntryNo = 0;\n    }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        int nVersion = s.GetVersion();\n        if (!(s.GetType() & SER_GETHASH))\n            READWRITE(nVersion);\n        //! Note: strAccount is serialized as part of the key, not here.\n        READWRITE(nCreditDebit);\n        READWRITE(nTime);\n        READWRITE(LIMITED_STRING(strOtherAccount, 65536));\n\n        if (!ser_action.ForRead())\n        {\n            WriteOrderPos(nOrderPos, mapValue);\n\n            if (!(mapValue.empty() && _ssExtra.empty()))\n            {\n                CDataStream ss(s.GetType(), s.GetVersion());\n                ss.insert(ss.begin(), '\\0');\n                ss << mapValue;\n                ss.insert(ss.end(), _ssExtra.begin(), _ssExtra.end());\n                strComment.append(ss.str());\n            }\n        }\n\n        READWRITE(LIMITED_STRING(strComment, 65536));\n\n        size_t nSepPos = strComment.find(\"\\0\", 0, 1);\n        if (ser_action.ForRead())\n        {\n            mapValue.clear();\n            if (std::string::npos != nSepPos)\n            {\n                CDataStream ss(std::vector<char>(strComment.begin() + nSepPos + 1, strComment.end()), s.GetType(), s.GetVersion());\n                ss >> mapValue;\n                _ssExtra = std::vector<char>(ss.begin(), ss.end());\n            }\n            ReadOrderPos(nOrderPos, mapValue);\n        }\n        if (std::string::npos != nSepPos)\n            strComment.erase(nSepPos);\n\n        mapValue.erase(\"n\");\n    }\n\nprivate:\n    std::vector<char> _ssExtra;\n};\n\n\nclass WalletRescanReserver; //forward declarations for ScanForWalletTransactions/RescanFromTime\n/** \n * A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,\n * and provides the ability to create new transactions.\n */\nclass CWallet final : public CCryptoKeyStore, public CValidationInterface\n{\nprivate:\n    static std::atomic<bool> fFlushScheduled;\n    std::atomic<bool> fAbortRescan;\n    std::atomic<bool> fScanningWallet; //controlled by WalletRescanReserver\n    std::mutex mutexScanning;\n    friend class WalletRescanReserver;\n\n\n    /**\n     * Select a set of coins such that nValueRet >= nTargetValue and at least\n     * all coins from coinControl are selected; Never select unconfirmed coins\n     * if they are not ours\n     */\n    bool SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet, const CCoinControl *coinControl = nullptr) const;\n\n    CWalletDB *pwalletdbEncryption;\n\n    //! the current wallet version: clients below this version are not able to load the wallet\n    int nWalletVersion;\n\n    //! the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded\n    int nWalletMaxVersion;\n\n    int64_t nNextResend;\n    int64_t nLastResend;\n    bool fBroadcastTransactions;\n\n    /**\n     * Used to keep track of spent outpoints, and\n     * detect and report conflicts (double-spends or\n     * mutated transactions where the mutant gets mined).\n     */\n    typedef std::multimap<COutPoint, uint256> TxSpends;\n    TxSpends mapTxSpends;\n    void AddToSpends(const COutPoint& outpoint, const uint256& wtxid);\n    void AddToSpends(const uint256& wtxid);\n\n    /* Mark a transaction (and its in-wallet descendants) as conflicting with a particular block. */\n    void MarkConflicted(const uint256& hashBlock, const uint256& hashTx);\n\n    void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>);\n\n    /* Used by TransactionAddedToMemorypool/BlockConnected/Disconnected.\n     * Should be called with pindexBlock and posInBlock if this is for a transaction that is included in a block. */\n    void SyncTransaction(const CTransactionRef& tx, const CBlockIndex *pindex = nullptr, int posInBlock = 0);\n\n    /* the HD chain data model (external chain counters) */\n    CHDChain hdChain;\n\n    /* HD derive new child key (on internal or external chain) */\n    void DeriveNewChildKey(CWalletDB &walletdb, CKeyMetadata& metadata, CKey& secret, bool internal = false);\n\n    std::set<int64_t> setInternalKeyPool;\n    std::set<int64_t> setExternalKeyPool;\n    int64_t m_max_keypool_index;\n    std::map<CKeyID, int64_t> m_pool_key_to_index;\n\n    int64_t nTimeFirstKey;\n\n    /**\n     * Private version of AddWatchOnly method which does not accept a\n     * timestamp, and which will reset the wallet's nTimeFirstKey value to 1 if\n     * the watch key did not previously have a timestamp associated with it.\n     * Because this is an inherited virtual method, it is accessible despite\n     * being marked private, but it is marked private anyway to encourage use\n     * of the other AddWatchOnly which accepts a timestamp and sets\n     * nTimeFirstKey more intelligently for more efficient rescans.\n     */\n    bool AddWatchOnly(const CScript& dest) override;\n\n    std::unique_ptr<CWalletDBWrapper> dbw;\n\n    /**\n     * The following is used to keep track of how far behind the wallet is\n     * from the chain sync, and to allow clients to block on us being caught up.\n     *\n     * Note that this is *not* how far we've processed, we may need some rescan\n     * to have seen all transactions in the chain, but is only used to track\n     * live BlockConnected callbacks.\n     *\n     * Protected by cs_main (see BlockUntilSyncedToCurrentChain)\n     */\n    const CBlockIndex* m_last_block_processed;\n\npublic:\n    /*\n     * Main wallet lock.\n     * This lock protects all the fields added by CWallet.\n     */\n    mutable CCriticalSection cs_wallet;\n\n    /** Get database handle used by this wallet. Ideally this function would\n     * not be necessary.\n     */\n    CWalletDBWrapper& GetDBHandle()\n    {\n        return *dbw;\n    }\n\n    /** Get a name for this wallet for logging/debugging purposes.\n     */\n    std::string GetName() const\n    {\n        if (dbw) {\n            return dbw->GetName();\n        } else {\n            return \"dummy\";\n        }\n    }\n\n    void LoadKeyPool(int64_t nIndex, const CKeyPool &keypool);\n\n    // Map from Key ID to key metadata.\n    std::map<CKeyID, CKeyMetadata> mapKeyMetadata;\n\n    // Map from Script ID to key metadata (for watch-only keys).\n    std::map<CScriptID, CKeyMetadata> m_script_metadata;\n\n    typedef std::map<unsigned int, CMasterKey> MasterKeyMap;\n    MasterKeyMap mapMasterKeys;\n    unsigned int nMasterKeyMaxID;\n\n    // Create wallet with dummy database handle\n    CWallet(): dbw(new CWalletDBWrapper())\n    {\n        SetNull();\n    }\n\n    // Create wallet with passed-in database handle\n    explicit CWallet(std::unique_ptr<CWalletDBWrapper> dbw_in) : dbw(std::move(dbw_in))\n    {\n        SetNull();\n    }\n\n    ~CWallet()\n    {\n        delete pwalletdbEncryption;\n        pwalletdbEncryption = nullptr;\n    }\n\n    void SetNull()\n    {\n        nWalletVersion = FEATURE_BASE;\n        nWalletMaxVersion = FEATURE_BASE;\n        nMasterKeyMaxID = 0;\n        pwalletdbEncryption = nullptr;\n        nOrderPosNext = 0;\n        nAccountingEntryNumber = 0;\n        nNextResend = 0;\n        nLastResend = 0;\n        m_max_keypool_index = 0;\n        nTimeFirstKey = 0;\n        fBroadcastTransactions = false;\n        nRelockTime = 0;\n        fAbortRescan = false;\n        fScanningWallet = false;\n    }\n\n    std::map<uint256, CWalletTx> mapWallet;\n    std::list<CAccountingEntry> laccentries;\n\n    typedef std::pair<CWalletTx*, CAccountingEntry*> TxPair;\n    typedef std::multimap<int64_t, TxPair > TxItems;\n    TxItems wtxOrdered;\n\n    int64_t nOrderPosNext;\n    uint64_t nAccountingEntryNumber;\n\n    std::map<CTxDestination, CAddressBookData> mapAddressBook;\n\n    std::set<COutPoint> setLockedCoins;\n\n    const CWalletTx* GetWalletTx(const uint256& hash) const;\n\n    //! check whether we are allowed to upgrade (or already support) to the named feature\n    bool CanSupportFeature(enum WalletFeature wf) const { AssertLockHeld(cs_wallet); return nWalletMaxVersion >= wf; }\n\n    /**\n     * populate vCoins with vector of available COutputs.\n     */\n    void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlySafe=true, const CCoinControl *coinControl = nullptr, const CAmount& nMinimumAmount = 1, const CAmount& nMaximumAmount = MAX_MONEY, const CAmount& nMinimumSumAmount = MAX_MONEY, const uint64_t nMaximumCount = 0, const int nMinDepth = 0, const int nMaxDepth = 9999999) const;\n\n    /**\n     * Return list of available coins and locked coins grouped by non-change output address.\n     */\n    std::map<CTxDestination, std::vector<COutput>> ListCoins() const;\n\n    /**\n     * Find non-change parent output.\n     */\n    const CTxOut& FindNonChangeParentOutput(const CTransaction& tx, int output) const;\n\n    /**\n     * Shuffle and select coins until nTargetValue is reached while avoiding\n     * small change; This method is stochastic for some inputs and upon\n     * completion the coin set and corresponding actual target value is\n     * assembled\n     */\n    bool SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int nConfTheirs, uint64_t nMaxAncestors, std::vector<COutput> vCoins, std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet) const;\n\n    bool IsSpent(const uint256& hash, unsigned int n) const;\n\n    bool IsLockedCoin(uint256 hash, unsigned int n) const;\n    void LockCoin(const COutPoint& output);\n    void UnlockCoin(const COutPoint& output);\n    void UnlockAllCoins();\n    void ListLockedCoins(std::vector<COutPoint>& vOutpts) const;\n\n    /*\n     * Rescan abort properties\n     */\n    void AbortRescan() { fAbortRescan = true; }\n    bool IsAbortingRescan() { return fAbortRescan; }\n    bool IsScanning() { return fScanningWallet; }\n\n    /**\n     * keystore implementation\n     * Generate a new key\n     */\n    CPubKey GenerateNewKey(CWalletDB& walletdb, bool internal = false);\n    //! Adds a key to the store, and saves it to disk.\n    bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override;\n    bool AddKeyPubKeyWithDB(CWalletDB &walletdb,const CKey& key, const CPubKey &pubkey);\n    //! Adds a key to the store, without saving it to disk (used by LoadWallet)\n    bool LoadKey(const CKey& key, const CPubKey &pubkey) { return CCryptoKeyStore::AddKeyPubKey(key, pubkey); }\n    //! Load metadata (used by LoadWallet)\n    bool LoadKeyMetadata(const CKeyID& keyID, const CKeyMetadata &metadata);\n    bool LoadScriptMetadata(const CScriptID& script_id, const CKeyMetadata &metadata);\n\n    bool LoadMinVersion(int nVersion) { AssertLockHeld(cs_wallet); nWalletVersion = nVersion; nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); return true; }\n    void UpdateTimeFirstKey(int64_t nCreateTime);\n\n    //! Adds an encrypted key to the store, and saves it to disk.\n    bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) override;\n    //! Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)\n    bool LoadCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);\n    bool AddCScript(const CScript& redeemScript) override;\n    bool LoadCScript(const CScript& redeemScript);\n\n    //! Adds a destination data tuple to the store, and saves it to disk\n    bool AddDestData(const CTxDestination &dest, const std::string &key, const std::string &value);\n    //! Erases a destination data tuple in the store and on disk\n    bool EraseDestData(const CTxDestination &dest, const std::string &key);\n    //! Adds a destination data tuple to the store, without saving it to disk\n    bool LoadDestData(const CTxDestination &dest, const std::string &key, const std::string &value);\n    //! Look up a destination data tuple in the store, return true if found false otherwise\n    bool GetDestData(const CTxDestination &dest, const std::string &key, std::string *value) const;\n    //! Get all destination values matching a prefix.\n    std::vector<std::string> GetDestValues(const std::string& prefix) const;\n\n    //! Adds a watch-only address to the store, and saves it to disk.\n    bool AddWatchOnly(const CScript& dest, int64_t nCreateTime);\n    bool RemoveWatchOnly(const CScript &dest) override;\n    //! Adds a watch-only address to the store, without saving it to disk (used by LoadWallet)\n    bool LoadWatchOnly(const CScript &dest);\n\n    //! Holds a timestamp at which point the wallet is scheduled (externally) to be relocked. Caller must arrange for actual relocking to occur via Lock().\n    int64_t nRelockTime;\n\n    bool Unlock(const SecureString& strWalletPassphrase);\n    bool ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase);\n    bool EncryptWallet(const SecureString& strWalletPassphrase);\n\n    void GetKeyBirthTimes(std::map<CTxDestination, int64_t> &mapKeyBirth) const;\n    unsigned int ComputeTimeSmart(const CWalletTx& wtx) const;\n\n    /** \n     * Increment the next transaction order id\n     * @return next transaction order id\n     */\n    int64_t IncOrderPosNext(CWalletDB *pwalletdb = nullptr);\n    DBErrors ReorderTransactions();\n    bool AccountMove(std::string strFrom, std::string strTo, CAmount nAmount, std::string strComment = \"\");\n    bool GetAccountDestination(CTxDestination &dest, std::string strAccount, bool bForceNew = false);\n\n    void MarkDirty();\n    bool AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose=true);\n    bool LoadToWallet(const CWalletTx& wtxIn);\n    void TransactionAddedToMempool(const CTransactionRef& tx) override;\n    void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex *pindex, const std::vector<CTransactionRef>& vtxConflicted) override;\n    void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock) override;\n    bool AddToWalletIfInvolvingMe(const CTransactionRef& tx, const CBlockIndex* pIndex, int posInBlock, bool fUpdate);\n    int64_t RescanFromTime(int64_t startTime, const WalletRescanReserver& reserver, bool update);\n    CBlockIndex* ScanForWalletTransactions(CBlockIndex* pindexStart, CBlockIndex* pindexStop, const WalletRescanReserver& reserver, bool fUpdate = false);\n    void TransactionRemovedFromMempool(const CTransactionRef &ptx) override;\n    void ReacceptWalletTransactions();\n    void ResendWalletTransactions(int64_t nBestBlockTime, CConnman* connman) override;\n    // ResendWalletTransactionsBefore may only be called if fBroadcastTransactions!\n    std::vector<uint256> ResendWalletTransactionsBefore(int64_t nTime, CConnman* connman);\n    CAmount GetBalance() const;\n    CAmount GetUnconfirmedBalance() const;\n    CAmount GetImmatureBalance() const;\n    CAmount GetWatchOnlyBalance() const;\n    CAmount GetUnconfirmedWatchOnlyBalance() const;\n    CAmount GetImmatureWatchOnlyBalance() const;\n    CAmount GetLegacyBalance(const isminefilter& filter, int minDepth, const std::string* account) const;\n    CAmount GetAvailableBalance(const CCoinControl* coinControl = nullptr) const;\n\n    OutputType TransactionChangeType(OutputType change_type, const std::vector<CRecipient>& vecSend);\n\n    /**\n     * Insert additional inputs into the transaction by\n     * calling CreateTransaction();\n     */\n    bool FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nChangePosInOut, std::string& strFailReason, bool lockUnspents, const std::set<int>& setSubtractFeeFromOutputs, CCoinControl);\n    bool SignTransaction(CMutableTransaction& tx);\n\n    /**\n     * Create a new transaction paying the recipients with a set of coins\n     * selected by SelectCoins(); Also create the change output, when needed\n     * @note passing nChangePosInOut as -1 will result in setting a random position\n     */\n    bool CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, int& nChangePosInOut,\n                           std::string& strFailReason, const CCoinControl& coin_control, bool sign = true);\n    bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CConnman* connman, CValidationState& state);\n\n    void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& entries);\n    bool AddAccountingEntry(const CAccountingEntry&);\n    bool AddAccountingEntry(const CAccountingEntry&, CWalletDB *pwalletdb);\n    template <typename ContainerType>\n    bool DummySignTx(CMutableTransaction &txNew, const ContainerType &coins) const;\n\n    static CFeeRate minTxFee;\n    static CFeeRate fallbackFee;\n    static CFeeRate m_discard_rate;\n\n    bool NewKeyPool();\n    size_t KeypoolCountExternalKeys();\n    bool TopUpKeyPool(unsigned int kpSize = 0);\n    void ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool fRequestedInternal);\n    void KeepKey(int64_t nIndex);\n    void ReturnKey(int64_t nIndex, bool fInternal, const CPubKey& pubkey);\n    bool GetKeyFromPool(CPubKey &key, bool internal = false);\n    int64_t GetOldestKeyPoolTime();\n    /**\n     * Marks all keys in the keypool up to and including reserve_key as used.\n     */\n    void MarkReserveKeysAsUsed(int64_t keypool_id);\n    const std::map<CKeyID, int64_t>& GetAllReserveKeys() const { return m_pool_key_to_index; }\n\n    std::set< std::set<CTxDestination> > GetAddressGroupings();\n    std::map<CTxDestination, CAmount> GetAddressBalances();\n\n    std::set<CTxDestination> GetAccountAddresses(const std::string& strAccount) const;\n\n    isminetype IsMine(const CTxIn& txin) const;\n    /**\n     * Returns amount of debit if the input matches the\n     * filter, otherwise returns 0\n     */\n    CAmount GetDebit(const CTxIn& txin, const isminefilter& filter) const;\n    isminetype IsMine(const CTxOut& txout) const;\n    CAmount GetCredit(const CTxOut& txout, const isminefilter& filter) const;\n    bool IsChange(const CTxOut& txout) const;\n    CAmount GetChange(const CTxOut& txout) const;\n    bool IsMine(const CTransaction& tx) const;\n    /** should probably be renamed to IsRelevantToMe */\n    bool IsFromMe(const CTransaction& tx) const;\n    CAmount GetDebit(const CTransaction& tx, const isminefilter& filter) const;\n    /** Returns whether all of the inputs match the filter */\n    bool IsAllFromMe(const CTransaction& tx, const isminefilter& filter) const;\n    CAmount GetCredit(const CTransaction& tx, const isminefilter& filter) const;\n    CAmount GetChange(const CTransaction& tx) const;\n    void SetBestChain(const CBlockLocator& loc) override;\n\n    DBErrors LoadWallet(bool& fFirstRunRet);\n    DBErrors ZapWalletTx(std::vector<CWalletTx>& vWtx);\n    DBErrors ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256>& vHashOut);\n\n    bool SetAddressBook(const CTxDestination& address, const std::string& strName, const std::string& purpose);\n\n    bool DelAddressBook(const CTxDestination& address);\n\n    const std::string& GetAccountName(const CScript& scriptPubKey) const;\n\n    void GetScriptForMining(std::shared_ptr<CReserveScript> &script);\n    \n    unsigned int GetKeyPoolSize()\n    {\n        AssertLockHeld(cs_wallet); // set{Ex,In}ternalKeyPool\n        return setInternalKeyPool.size() + setExternalKeyPool.size();\n    }\n\n    //! signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVersion if those are lower\n    bool SetMinVersion(enum WalletFeature, CWalletDB* pwalletdbIn = nullptr, bool fExplicit = false);\n\n    //! change which version we're allowed to upgrade to (note that this does not immediately imply upgrading to that format)\n    bool SetMaxVersion(int nVersion);\n\n    //! get the current wallet format (the oldest client version guaranteed to understand this wallet)\n    int GetVersion() { LOCK(cs_wallet); return nWalletVersion; }\n\n    //! Get wallet transactions that conflict with given transaction (spend same outputs)\n    std::set<uint256> GetConflicts(const uint256& txid) const;\n\n    //! Check if a given transaction has any of its outputs spent by another transaction in the wallet\n    bool HasWalletSpend(const uint256& txid) const;\n\n    //! Flush wallet (bitdb flush)\n    void Flush(bool shutdown=false);\n\n    /** \n     * Address book entry changed.\n     * @note called with lock cs_wallet held.\n     */\n    boost::signals2::signal<void (CWallet *wallet, const CTxDestination\n            &address, const std::string &label, bool isMine,\n            const std::string &purpose,\n            ChangeType status)> NotifyAddressBookChanged;\n\n    /** \n     * Wallet transaction added, removed or updated.\n     * @note called with lock cs_wallet held.\n     */\n    boost::signals2::signal<void (CWallet *wallet, const uint256 &hashTx,\n            ChangeType status)> NotifyTransactionChanged;\n\n    /** Show progress e.g. for rescan */\n    boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress;\n\n    /** Watch-only address added */\n    boost::signals2::signal<void (bool fHaveWatchOnly)> NotifyWatchonlyChanged;\n\n    /** Inquire whether this wallet broadcasts transactions. */\n    bool GetBroadcastTransactions() const { return fBroadcastTransactions; }\n    /** Set whether this wallet broadcasts transactions. */\n    void SetBroadcastTransactions(bool broadcast) { fBroadcastTransactions = broadcast; }\n\n    /** Return whether transaction can be abandoned */\n    bool TransactionCanBeAbandoned(const uint256& hashTx) const;\n\n    /* Mark a transaction (and it in-wallet descendants) as abandoned so its inputs may be respent. */\n    bool AbandonTransaction(const uint256& hashTx);\n\n    /** Mark a transaction as replaced by another transaction (e.g., BIP 125). */\n    bool MarkReplaced(const uint256& originalHash, const uint256& newHash);\n\n    /* Initializes the wallet, returns a new CWallet instance or a null pointer in case of an error */\n    static CWallet* CreateWalletFromFile(const std::string walletFile);\n\n    /**\n     * Wallet post-init setup\n     * Gives the wallet a chance to register repetitive tasks and complete post-init tasks\n     */\n    void postInitProcess(CScheduler& scheduler);\n\n    bool BackupWallet(const std::string& strDest);\n\n    /* Set the HD chain model (chain child index counters) */\n    bool SetHDChain(const CHDChain& chain, bool memonly);\n    const CHDChain& GetHDChain() const { return hdChain; }\n\n    /* Returns true if HD is enabled */\n    bool IsHDEnabled() const;\n\n    /* Generates a new HD master key (will not be activated) */\n    CPubKey GenerateNewHDMasterKey();\n    \n    /* Set the current HD master key (will reset the chain child index counters)\n       Sets the master key's version based on the current wallet version (so the\n       caller must ensure the current wallet version is correct before calling\n       this function). */\n    bool SetHDMasterKey(const CPubKey& key);\n\n    /**\n     * Blocks until the wallet state is up-to-date to /at least/ the current\n     * chain at the time this function is entered\n     * Obviously holding cs_main/cs_wallet when going into this call may cause\n     * deadlock\n     */\n    void BlockUntilSyncedToCurrentChain();\n\n    /**\n     * Explicitly make the wallet learn the related scripts for outputs to the\n     * given key. This is purely to make the wallet file compatible with older\n     * software, as CBasicKeyStore automatically does this implicitly for all\n     * keys now.\n     */\n    void LearnRelatedScripts(const CPubKey& key, OutputType);\n\n    /**\n     * Same as LearnRelatedScripts, but when the OutputType is not known (and could\n     * be anything).\n     */\n    void LearnAllRelatedScripts(const CPubKey& key);\n\n    /**\n     * Get a destination of the requested type (if possible) to the specified script.\n     * This function will automatically add the necessary scripts to the wallet.\n     */\n    CTxDestination AddAndGetDestinationForScript(const CScript& script, OutputType);\n};\n\n/** A key allocated from the key pool. */\nclass CReserveKey final : public CReserveScript\n{\nprotected:\n    CWallet* pwallet;\n    int64_t nIndex;\n    CPubKey vchPubKey;\n    bool fInternal;\npublic:\n    explicit CReserveKey(CWallet* pwalletIn)\n    {\n        nIndex = -1;\n        pwallet = pwalletIn;\n        fInternal = false;\n    }\n\n    CReserveKey() = default;\n    CReserveKey(const CReserveKey&) = delete;\n    CReserveKey& operator=(const CReserveKey&) = delete;\n\n    ~CReserveKey()\n    {\n        ReturnKey();\n    }\n\n    void ReturnKey();\n    bool GetReservedKey(CPubKey &pubkey, bool internal = false);\n    void KeepKey();\n    void KeepScript() override { KeepKey(); }\n};\n\n\n/** \n * Account information.\n * Stored in wallet with key \"acc\"+string account name.\n */\nclass CAccount\n{\npublic:\n    CPubKey vchPubKey;\n\n    CAccount()\n    {\n        SetNull();\n    }\n\n    void SetNull()\n    {\n        vchPubKey = CPubKey();\n    }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        int nVersion = s.GetVersion();\n        if (!(s.GetType() & SER_GETHASH))\n            READWRITE(nVersion);\n        READWRITE(vchPubKey);\n    }\n};\n\n// Helper for producing a bunch of max-sized low-S signatures (eg 72 bytes)\n// ContainerType is meant to hold pair<CWalletTx *, int>, and be iterable\n// so that each entry corresponds to each vIn, in order.\ntemplate <typename ContainerType>\nbool CWallet::DummySignTx(CMutableTransaction &txNew, const ContainerType &coins) const\n{\n    // Fill in dummy signatures for fee calculation.\n    int nIn = 0;\n    for (const auto& coin : coins)\n    {\n        const CScript& scriptPubKey = coin.txout.scriptPubKey;\n        SignatureData sigdata;\n\n        if (!ProduceSignature(DummySignatureCreator(this), scriptPubKey, sigdata))\n        {\n            return false;\n        } else {\n            UpdateTransaction(txNew, nIn, sigdata);\n        }\n\n        nIn++;\n    }\n    return true;\n}\n\nOutputType ParseOutputType(const std::string& str, OutputType default_type = OUTPUT_TYPE_DEFAULT);\nconst std::string& FormatOutputType(OutputType type);\n\n/**\n * Get a destination of the requested type (if possible) to the specified key.\n * The caller must make sure LearnRelatedScripts has been called beforehand.\n */\nCTxDestination GetDestinationForKey(const CPubKey& key, OutputType);\n\n/** Get all destinations (potentially) supported by the wallet for the given key. */\nstd::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey& key);\n\n/** RAII object to check and reserve a wallet rescan */\nclass WalletRescanReserver\n{\nprivate:\n    CWalletRef m_wallet;\n    bool m_could_reserve;\npublic:\n    explicit WalletRescanReserver(CWalletRef w) : m_wallet(w), m_could_reserve(false) {}\n\n    bool reserve()\n    {\n        assert(!m_could_reserve);\n        std::lock_guard<std::mutex> lock(m_wallet->mutexScanning);\n        if (m_wallet->fScanningWallet) {\n            return false;\n        }\n        m_wallet->fScanningWallet = true;\n        m_could_reserve = true;\n        return true;\n    }\n\n    bool isReserved() const\n    {\n        return (m_could_reserve && m_wallet->fScanningWallet);\n    }\n\n    ~WalletRescanReserver()\n    {\n        std::lock_guard<std::mutex> lock(m_wallet->mutexScanning);\n        if (m_could_reserve) {\n            m_wallet->fScanningWallet = false;\n        }\n    }\n};\n\n#endif // BITCOIN_WALLET_WALLET_H\n"
  },
  {
    "path": "src/wallet/walletdb.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/walletdb.h>\n\n#include <base58.h>\n#include <consensus/tx_verify.h>\n#include <consensus/validation.h>\n#include <fs.h>\n#include <protocol.h>\n#include <serialize.h>\n#include <sync.h>\n#include <util.h>\n#include <utiltime.h>\n#include <wallet/wallet.h>\n\n#include <atomic>\n\n#include <boost/thread.hpp>\n\n//\n// CWalletDB\n//\n\nbool CWalletDB::WriteName(const std::string& strAddress, const std::string& strName)\n{\n    return WriteIC(std::make_pair(std::string(\"name\"), strAddress), strName);\n}\n\nbool CWalletDB::EraseName(const std::string& strAddress)\n{\n    // This should only be used for sending addresses, never for receiving addresses,\n    // receiving addresses must always have an address book entry if they're not change return.\n    return EraseIC(std::make_pair(std::string(\"name\"), strAddress));\n}\n\nbool CWalletDB::WritePurpose(const std::string& strAddress, const std::string& strPurpose)\n{\n    return WriteIC(std::make_pair(std::string(\"purpose\"), strAddress), strPurpose);\n}\n\nbool CWalletDB::ErasePurpose(const std::string& strAddress)\n{\n    return EraseIC(std::make_pair(std::string(\"purpose\"), strAddress));\n}\n\nbool CWalletDB::WriteTx(const CWalletTx& wtx)\n{\n    return WriteIC(std::make_pair(std::string(\"tx\"), wtx.GetHash()), wtx);\n}\n\nbool CWalletDB::EraseTx(uint256 hash)\n{\n    return EraseIC(std::make_pair(std::string(\"tx\"), hash));\n}\n\nbool CWalletDB::WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata& keyMeta)\n{\n    if (!WriteIC(std::make_pair(std::string(\"keymeta\"), vchPubKey), keyMeta, false)) {\n        return false;\n    }\n\n    // hash pubkey/privkey to accelerate wallet load\n    std::vector<unsigned char> vchKey;\n    vchKey.reserve(vchPubKey.size() + vchPrivKey.size());\n    vchKey.insert(vchKey.end(), vchPubKey.begin(), vchPubKey.end());\n    vchKey.insert(vchKey.end(), vchPrivKey.begin(), vchPrivKey.end());\n\n    return WriteIC(std::make_pair(std::string(\"key\"), vchPubKey), std::make_pair(vchPrivKey, Hash(vchKey.begin(), vchKey.end())), false);\n}\n\nbool CWalletDB::WriteCryptedKey(const CPubKey& vchPubKey,\n                                const std::vector<unsigned char>& vchCryptedSecret,\n                                const CKeyMetadata &keyMeta)\n{\n    if (!WriteIC(std::make_pair(std::string(\"keymeta\"), vchPubKey), keyMeta)) {\n        return false;\n    }\n\n    if (!WriteIC(std::make_pair(std::string(\"ckey\"), vchPubKey), vchCryptedSecret, false)) {\n        return false;\n    }\n    EraseIC(std::make_pair(std::string(\"key\"), vchPubKey));\n    EraseIC(std::make_pair(std::string(\"wkey\"), vchPubKey));\n    return true;\n}\n\nbool CWalletDB::WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey)\n{\n    return WriteIC(std::make_pair(std::string(\"mkey\"), nID), kMasterKey, true);\n}\n\nbool CWalletDB::WriteCScript(const uint160& hash, const CScript& redeemScript)\n{\n    return WriteIC(std::make_pair(std::string(\"cscript\"), hash), redeemScript, false);\n}\n\nbool CWalletDB::WriteWatchOnly(const CScript &dest, const CKeyMetadata& keyMeta)\n{\n    if (!WriteIC(std::make_pair(std::string(\"watchmeta\"), dest), keyMeta)) {\n        return false;\n    }\n    return WriteIC(std::make_pair(std::string(\"watchs\"), dest), '1');\n}\n\nbool CWalletDB::EraseWatchOnly(const CScript &dest)\n{\n    if (!EraseIC(std::make_pair(std::string(\"watchmeta\"), dest))) {\n        return false;\n    }\n    return EraseIC(std::make_pair(std::string(\"watchs\"), dest));\n}\n\nbool CWalletDB::WriteBestBlock(const CBlockLocator& locator)\n{\n    WriteIC(std::string(\"bestblock\"), CBlockLocator()); // Write empty block locator so versions that require a merkle branch automatically rescan\n    return WriteIC(std::string(\"bestblock_nomerkle\"), locator);\n}\n\nbool CWalletDB::ReadBestBlock(CBlockLocator& locator)\n{\n    if (batch.Read(std::string(\"bestblock\"), locator) && !locator.vHave.empty()) return true;\n    return batch.Read(std::string(\"bestblock_nomerkle\"), locator);\n}\n\nbool CWalletDB::WriteOrderPosNext(int64_t nOrderPosNext)\n{\n    return WriteIC(std::string(\"orderposnext\"), nOrderPosNext);\n}\n\nbool CWalletDB::ReadPool(int64_t nPool, CKeyPool& keypool)\n{\n    return batch.Read(std::make_pair(std::string(\"pool\"), nPool), keypool);\n}\n\nbool CWalletDB::WritePool(int64_t nPool, const CKeyPool& keypool)\n{\n    return WriteIC(std::make_pair(std::string(\"pool\"), nPool), keypool);\n}\n\nbool CWalletDB::ErasePool(int64_t nPool)\n{\n    return EraseIC(std::make_pair(std::string(\"pool\"), nPool));\n}\n\nbool CWalletDB::WriteMinVersion(int nVersion)\n{\n    return WriteIC(std::string(\"minversion\"), nVersion);\n}\n\nbool CWalletDB::ReadAccount(const std::string& strAccount, CAccount& account)\n{\n    account.SetNull();\n    return batch.Read(std::make_pair(std::string(\"acc\"), strAccount), account);\n}\n\nbool CWalletDB::WriteAccount(const std::string& strAccount, const CAccount& account)\n{\n    return WriteIC(std::make_pair(std::string(\"acc\"), strAccount), account);\n}\n\nbool CWalletDB::WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry)\n{\n    return WriteIC(std::make_pair(std::string(\"acentry\"), std::make_pair(acentry.strAccount, nAccEntryNum)), acentry);\n}\n\nCAmount CWalletDB::GetAccountCreditDebit(const std::string& strAccount)\n{\n    std::list<CAccountingEntry> entries;\n    ListAccountCreditDebit(strAccount, entries);\n\n    CAmount nCreditDebit = 0;\n    for (const CAccountingEntry& entry : entries)\n        nCreditDebit += entry.nCreditDebit;\n\n    return nCreditDebit;\n}\n\nvoid CWalletDB::ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& entries)\n{\n    bool fAllAccounts = (strAccount == \"*\");\n\n    Dbc* pcursor = batch.GetCursor();\n    if (!pcursor)\n        throw std::runtime_error(std::string(__func__) + \": cannot create DB cursor\");\n    bool setRange = true;\n    while (true)\n    {\n        // Read next record\n        CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n        if (setRange)\n            ssKey << std::make_pair(std::string(\"acentry\"), std::make_pair((fAllAccounts ? std::string(\"\") : strAccount), uint64_t(0)));\n        CDataStream ssValue(SER_DISK, CLIENT_VERSION);\n        int ret = batch.ReadAtCursor(pcursor, ssKey, ssValue, setRange);\n        setRange = false;\n        if (ret == DB_NOTFOUND)\n            break;\n        else if (ret != 0)\n        {\n            pcursor->close();\n            throw std::runtime_error(std::string(__func__) + \": error scanning DB\");\n        }\n\n        // Unserialize\n        std::string strType;\n        ssKey >> strType;\n        if (strType != \"acentry\")\n            break;\n        CAccountingEntry acentry;\n        ssKey >> acentry.strAccount;\n        if (!fAllAccounts && acentry.strAccount != strAccount)\n            break;\n\n        ssValue >> acentry;\n        ssKey >> acentry.nEntryNo;\n        entries.push_back(acentry);\n    }\n\n    pcursor->close();\n}\n\nclass CWalletScanState {\npublic:\n    unsigned int nKeys;\n    unsigned int nCKeys;\n    unsigned int nWatchKeys;\n    unsigned int nKeyMeta;\n    bool fIsEncrypted;\n    bool fAnyUnordered;\n    int nFileVersion;\n    std::vector<uint256> vWalletUpgrade;\n\n    CWalletScanState() {\n        nKeys = nCKeys = nWatchKeys = nKeyMeta = 0;\n        fIsEncrypted = false;\n        fAnyUnordered = false;\n        nFileVersion = 0;\n    }\n};\n\nbool\nReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,\n             CWalletScanState &wss, std::string& strType, std::string& strErr)\n{\n    try {\n        // Unserialize\n        // Taking advantage of the fact that pair serialization\n        // is just the two items serialized one after the other\n        ssKey >> strType;\n        if (strType == \"name\")\n        {\n            std::string strAddress;\n            ssKey >> strAddress;\n            ssValue >> pwallet->mapAddressBook[DecodeDestination(strAddress)].name;\n        }\n        else if (strType == \"purpose\")\n        {\n            std::string strAddress;\n            ssKey >> strAddress;\n            ssValue >> pwallet->mapAddressBook[DecodeDestination(strAddress)].purpose;\n        }\n        else if (strType == \"tx\")\n        {\n            uint256 hash;\n            ssKey >> hash;\n            CWalletTx wtx;\n            ssValue >> wtx;\n            CValidationState state;\n            if (!(CheckTransaction(*wtx.tx, state) && (wtx.GetHash() == hash) && state.IsValid()))\n                return false;\n\n            // Undo serialize changes in 31600\n            if (31404 <= wtx.fTimeReceivedIsTxTime && wtx.fTimeReceivedIsTxTime <= 31703)\n            {\n                if (!ssValue.empty())\n                {\n                    char fTmp;\n                    char fUnused;\n                    ssValue >> fTmp >> fUnused >> wtx.strFromAccount;\n                    strErr = strprintf(\"LoadWallet() upgrading tx ver=%d %d '%s' %s\",\n                                       wtx.fTimeReceivedIsTxTime, fTmp, wtx.strFromAccount, hash.ToString());\n                    wtx.fTimeReceivedIsTxTime = fTmp;\n                }\n                else\n                {\n                    strErr = strprintf(\"LoadWallet() repairing tx ver=%d %s\", wtx.fTimeReceivedIsTxTime, hash.ToString());\n                    wtx.fTimeReceivedIsTxTime = 0;\n                }\n                wss.vWalletUpgrade.push_back(hash);\n            }\n\n            if (wtx.nOrderPos == -1)\n                wss.fAnyUnordered = true;\n\n            pwallet->LoadToWallet(wtx);\n        }\n        else if (strType == \"acentry\")\n        {\n            std::string strAccount;\n            ssKey >> strAccount;\n            uint64_t nNumber;\n            ssKey >> nNumber;\n            if (nNumber > pwallet->nAccountingEntryNumber) {\n                pwallet->nAccountingEntryNumber = nNumber;\n            }\n\n            if (!wss.fAnyUnordered)\n            {\n                CAccountingEntry acentry;\n                ssValue >> acentry;\n                if (acentry.nOrderPos == -1)\n                    wss.fAnyUnordered = true;\n            }\n        }\n        else if (strType == \"watchs\")\n        {\n            wss.nWatchKeys++;\n            CScript script;\n            ssKey >> script;\n            char fYes;\n            ssValue >> fYes;\n            if (fYes == '1')\n                pwallet->LoadWatchOnly(script);\n        }\n        else if (strType == \"key\" || strType == \"wkey\")\n        {\n            CPubKey vchPubKey;\n            ssKey >> vchPubKey;\n            if (!vchPubKey.IsValid())\n            {\n                strErr = \"Error reading wallet database: CPubKey corrupt\";\n                return false;\n            }\n            CKey key;\n            CPrivKey pkey;\n            uint256 hash;\n\n            if (strType == \"key\")\n            {\n                wss.nKeys++;\n                ssValue >> pkey;\n            } else {\n                CWalletKey wkey;\n                ssValue >> wkey;\n                pkey = wkey.vchPrivKey;\n            }\n\n            // Old wallets store keys as \"key\" [pubkey] => [privkey]\n            // ... which was slow for wallets with lots of keys, because the public key is re-derived from the private key\n            // using EC operations as a checksum.\n            // Newer wallets store keys as \"key\"[pubkey] => [privkey][hash(pubkey,privkey)], which is much faster while\n            // remaining backwards-compatible.\n            try\n            {\n                ssValue >> hash;\n            }\n            catch (...) {}\n\n            bool fSkipCheck = false;\n\n            if (!hash.IsNull())\n            {\n                // hash pubkey/privkey to accelerate wallet load\n                std::vector<unsigned char> vchKey;\n                vchKey.reserve(vchPubKey.size() + pkey.size());\n                vchKey.insert(vchKey.end(), vchPubKey.begin(), vchPubKey.end());\n                vchKey.insert(vchKey.end(), pkey.begin(), pkey.end());\n\n                if (Hash(vchKey.begin(), vchKey.end()) != hash)\n                {\n                    strErr = \"Error reading wallet database: CPubKey/CPrivKey corrupt\";\n                    return false;\n                }\n\n                fSkipCheck = true;\n            }\n\n            if (!key.Load(pkey, vchPubKey, fSkipCheck))\n            {\n                strErr = \"Error reading wallet database: CPrivKey corrupt\";\n                return false;\n            }\n            if (!pwallet->LoadKey(key, vchPubKey))\n            {\n                strErr = \"Error reading wallet database: LoadKey failed\";\n                return false;\n            }\n        }\n        else if (strType == \"mkey\")\n        {\n            unsigned int nID;\n            ssKey >> nID;\n            CMasterKey kMasterKey;\n            ssValue >> kMasterKey;\n            if(pwallet->mapMasterKeys.count(nID) != 0)\n            {\n                strErr = strprintf(\"Error reading wallet database: duplicate CMasterKey id %u\", nID);\n                return false;\n            }\n            pwallet->mapMasterKeys[nID] = kMasterKey;\n            if (pwallet->nMasterKeyMaxID < nID)\n                pwallet->nMasterKeyMaxID = nID;\n        }\n        else if (strType == \"ckey\")\n        {\n            CPubKey vchPubKey;\n            ssKey >> vchPubKey;\n            if (!vchPubKey.IsValid())\n            {\n                strErr = \"Error reading wallet database: CPubKey corrupt\";\n                return false;\n            }\n            std::vector<unsigned char> vchPrivKey;\n            ssValue >> vchPrivKey;\n            wss.nCKeys++;\n\n            if (!pwallet->LoadCryptedKey(vchPubKey, vchPrivKey))\n            {\n                strErr = \"Error reading wallet database: LoadCryptedKey failed\";\n                return false;\n            }\n            wss.fIsEncrypted = true;\n        }\n        else if (strType == \"keymeta\")\n        {\n            CPubKey vchPubKey;\n            ssKey >> vchPubKey;\n            CKeyMetadata keyMeta;\n            ssValue >> keyMeta;\n            wss.nKeyMeta++;\n            pwallet->LoadKeyMetadata(vchPubKey.GetID(), keyMeta);\n        }\n        else if (strType == \"watchmeta\")\n        {\n            CScript script;\n            ssKey >> script;\n            CKeyMetadata keyMeta;\n            ssValue >> keyMeta;\n            wss.nKeyMeta++;\n            pwallet->LoadScriptMetadata(CScriptID(script), keyMeta);\n        }\n        else if (strType == \"defaultkey\")\n        {\n            // We don't want or need the default key, but if there is one set,\n            // we want to make sure that it is valid so that we can detect corruption\n            CPubKey vchPubKey;\n            ssValue >> vchPubKey;\n            if (!vchPubKey.IsValid()) {\n                strErr = \"Error reading wallet database: Default Key corrupt\";\n                return false;\n            }\n        }\n        else if (strType == \"pool\")\n        {\n            int64_t nIndex;\n            ssKey >> nIndex;\n            CKeyPool keypool;\n            ssValue >> keypool;\n\n            pwallet->LoadKeyPool(nIndex, keypool);\n        }\n        else if (strType == \"version\")\n        {\n            ssValue >> wss.nFileVersion;\n            if (wss.nFileVersion == 10300)\n                wss.nFileVersion = 300;\n        }\n        else if (strType == \"cscript\")\n        {\n            uint160 hash;\n            ssKey >> hash;\n            CScript script;\n            ssValue >> script;\n            if (!pwallet->LoadCScript(script))\n            {\n                strErr = \"Error reading wallet database: LoadCScript failed\";\n                return false;\n            }\n        }\n        else if (strType == \"orderposnext\")\n        {\n            ssValue >> pwallet->nOrderPosNext;\n        }\n        else if (strType == \"destdata\")\n        {\n            std::string strAddress, strKey, strValue;\n            ssKey >> strAddress;\n            ssKey >> strKey;\n            ssValue >> strValue;\n            if (!pwallet->LoadDestData(DecodeDestination(strAddress), strKey, strValue))\n            {\n                strErr = \"Error reading wallet database: LoadDestData failed\";\n                return false;\n            }\n        }\n        else if (strType == \"hdchain\")\n        {\n            CHDChain chain;\n            ssValue >> chain;\n            if (!pwallet->SetHDChain(chain, true))\n            {\n                strErr = \"Error reading wallet database: SetHDChain failed\";\n                return false;\n            }\n        }\n    } catch (...)\n    {\n        return false;\n    }\n    return true;\n}\n\nbool CWalletDB::IsKeyType(const std::string& strType)\n{\n    return (strType== \"key\" || strType == \"wkey\" ||\n            strType == \"mkey\" || strType == \"ckey\");\n}\n\nDBErrors CWalletDB::LoadWallet(CWallet* pwallet)\n{\n    CWalletScanState wss;\n    bool fNoncriticalErrors = false;\n    DBErrors result = DB_LOAD_OK;\n\n    LOCK(pwallet->cs_wallet);\n    try {\n        int nMinVersion = 0;\n        if (batch.Read((std::string)\"minversion\", nMinVersion))\n        {\n            if (nMinVersion > CLIENT_VERSION)\n                return DB_TOO_NEW;\n            pwallet->LoadMinVersion(nMinVersion);\n        }\n\n        // Get cursor\n        Dbc* pcursor = batch.GetCursor();\n        if (!pcursor)\n        {\n            LogPrintf(\"Error getting wallet database cursor\\n\");\n            return DB_CORRUPT;\n        }\n\n        while (true)\n        {\n            // Read next record\n            CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n            CDataStream ssValue(SER_DISK, CLIENT_VERSION);\n            int ret = batch.ReadAtCursor(pcursor, ssKey, ssValue);\n            if (ret == DB_NOTFOUND)\n                break;\n            else if (ret != 0)\n            {\n                LogPrintf(\"Error reading next record from wallet database\\n\");\n                return DB_CORRUPT;\n            }\n\n            // Try to be tolerant of single corrupt records:\n            std::string strType, strErr;\n            if (!ReadKeyValue(pwallet, ssKey, ssValue, wss, strType, strErr))\n            {\n                // losing keys is considered a catastrophic error, anything else\n                // we assume the user can live with:\n                if (IsKeyType(strType) || strType == \"defaultkey\")\n                    result = DB_CORRUPT;\n                else\n                {\n                    // Leave other errors alone, if we try to fix them we might make things worse.\n                    fNoncriticalErrors = true; // ... but do warn the user there is something wrong.\n                    if (strType == \"tx\")\n                        // Rescan if there is a bad transaction record:\n                        gArgs.SoftSetBoolArg(\"-rescan\", true);\n                }\n            }\n            if (!strErr.empty())\n                LogPrintf(\"%s\\n\", strErr);\n        }\n        pcursor->close();\n    }\n    catch (const boost::thread_interrupted&) {\n        throw;\n    }\n    catch (...) {\n        result = DB_CORRUPT;\n    }\n\n    if (fNoncriticalErrors && result == DB_LOAD_OK)\n        result = DB_NONCRITICAL_ERROR;\n\n    // Any wallet corruption at all: skip any rewriting or\n    // upgrading, we don't want to make it worse.\n    if (result != DB_LOAD_OK)\n        return result;\n\n    LogPrintf(\"nFileVersion = %d\\n\", wss.nFileVersion);\n\n    LogPrintf(\"Keys: %u plaintext, %u encrypted, %u w/ metadata, %u total\\n\",\n           wss.nKeys, wss.nCKeys, wss.nKeyMeta, wss.nKeys + wss.nCKeys);\n\n    // nTimeFirstKey is only reliable if all keys have metadata\n    if ((wss.nKeys + wss.nCKeys + wss.nWatchKeys) != wss.nKeyMeta)\n        pwallet->UpdateTimeFirstKey(1);\n\n    for (uint256 hash : wss.vWalletUpgrade)\n        WriteTx(pwallet->mapWallet[hash]);\n\n    // Rewrite encrypted wallets of versions 0.4.0 and 0.5.0rc:\n    if (wss.fIsEncrypted && (wss.nFileVersion == 40000 || wss.nFileVersion == 50000))\n        return DB_NEED_REWRITE;\n\n    if (wss.nFileVersion < CLIENT_VERSION) // Update\n        WriteVersion(CLIENT_VERSION);\n\n    if (wss.fAnyUnordered)\n        result = pwallet->ReorderTransactions();\n\n    pwallet->laccentries.clear();\n    ListAccountCreditDebit(\"*\", pwallet->laccentries);\n    for (CAccountingEntry& entry : pwallet->laccentries) {\n        pwallet->wtxOrdered.insert(make_pair(entry.nOrderPos, CWallet::TxPair(nullptr, &entry)));\n    }\n\n    return result;\n}\n\nDBErrors CWalletDB::FindWalletTx(std::vector<uint256>& vTxHash, std::vector<CWalletTx>& vWtx)\n{\n    DBErrors result = DB_LOAD_OK;\n\n    try {\n        int nMinVersion = 0;\n        if (batch.Read((std::string)\"minversion\", nMinVersion))\n        {\n            if (nMinVersion > CLIENT_VERSION)\n                return DB_TOO_NEW;\n        }\n\n        // Get cursor\n        Dbc* pcursor = batch.GetCursor();\n        if (!pcursor)\n        {\n            LogPrintf(\"Error getting wallet database cursor\\n\");\n            return DB_CORRUPT;\n        }\n\n        while (true)\n        {\n            // Read next record\n            CDataStream ssKey(SER_DISK, CLIENT_VERSION);\n            CDataStream ssValue(SER_DISK, CLIENT_VERSION);\n            int ret = batch.ReadAtCursor(pcursor, ssKey, ssValue);\n            if (ret == DB_NOTFOUND)\n                break;\n            else if (ret != 0)\n            {\n                LogPrintf(\"Error reading next record from wallet database\\n\");\n                return DB_CORRUPT;\n            }\n\n            std::string strType;\n            ssKey >> strType;\n            if (strType == \"tx\") {\n                uint256 hash;\n                ssKey >> hash;\n\n                CWalletTx wtx;\n                ssValue >> wtx;\n\n                vTxHash.push_back(hash);\n                vWtx.push_back(wtx);\n            }\n        }\n        pcursor->close();\n    }\n    catch (const boost::thread_interrupted&) {\n        throw;\n    }\n    catch (...) {\n        result = DB_CORRUPT;\n    }\n\n    return result;\n}\n\nDBErrors CWalletDB::ZapSelectTx(std::vector<uint256>& vTxHashIn, std::vector<uint256>& vTxHashOut)\n{\n    // build list of wallet TXs and hashes\n    std::vector<uint256> vTxHash;\n    std::vector<CWalletTx> vWtx;\n    DBErrors err = FindWalletTx(vTxHash, vWtx);\n    if (err != DB_LOAD_OK) {\n        return err;\n    }\n\n    std::sort(vTxHash.begin(), vTxHash.end());\n    std::sort(vTxHashIn.begin(), vTxHashIn.end());\n\n    // erase each matching wallet TX\n    bool delerror = false;\n    std::vector<uint256>::iterator it = vTxHashIn.begin();\n    for (uint256 hash : vTxHash) {\n        while (it < vTxHashIn.end() && (*it) < hash) {\n            it++;\n        }\n        if (it == vTxHashIn.end()) {\n            break;\n        }\n        else if ((*it) == hash) {\n            if(!EraseTx(hash)) {\n                LogPrint(BCLog::DB, \"Transaction was found for deletion but returned database error: %s\\n\", hash.GetHex());\n                delerror = true;\n            }\n            vTxHashOut.push_back(hash);\n        }\n    }\n\n    if (delerror) {\n        return DB_CORRUPT;\n    }\n    return DB_LOAD_OK;\n}\n\nDBErrors CWalletDB::ZapWalletTx(std::vector<CWalletTx>& vWtx)\n{\n    // build list of wallet TXs\n    std::vector<uint256> vTxHash;\n    DBErrors err = FindWalletTx(vTxHash, vWtx);\n    if (err != DB_LOAD_OK)\n        return err;\n\n    // erase each wallet TX\n    for (uint256& hash : vTxHash) {\n        if (!EraseTx(hash))\n            return DB_CORRUPT;\n    }\n\n    return DB_LOAD_OK;\n}\n\nvoid MaybeCompactWalletDB()\n{\n    static std::atomic<bool> fOneThread(false);\n    if (fOneThread.exchange(true)) {\n        return;\n    }\n    if (!gArgs.GetBoolArg(\"-flushwallet\", DEFAULT_FLUSHWALLET)) {\n        return;\n    }\n\n    for (CWalletRef pwallet : vpwallets) {\n        CWalletDBWrapper& dbh = pwallet->GetDBHandle();\n\n        unsigned int nUpdateCounter = dbh.nUpdateCounter;\n\n        if (dbh.nLastSeen != nUpdateCounter) {\n            dbh.nLastSeen = nUpdateCounter;\n            dbh.nLastWalletUpdate = GetTime();\n        }\n\n        if (dbh.nLastFlushed != nUpdateCounter && GetTime() - dbh.nLastWalletUpdate >= 2) {\n            if (CDB::PeriodicFlush(dbh)) {\n                dbh.nLastFlushed = nUpdateCounter;\n            }\n        }\n    }\n\n    fOneThread = false;\n}\n\n//\n// Try to (very carefully!) recover wallet file if there is a problem.\n//\nbool CWalletDB::Recover(const std::string& filename, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue), std::string& out_backup_filename)\n{\n    return CDB::Recover(filename, callbackDataIn, recoverKVcallback, out_backup_filename);\n}\n\nbool CWalletDB::Recover(const std::string& filename, std::string& out_backup_filename)\n{\n    // recover without a key filter callback\n    // results in recovering all record types\n    return CWalletDB::Recover(filename, nullptr, nullptr, out_backup_filename);\n}\n\nbool CWalletDB::RecoverKeysOnlyFilter(void *callbackData, CDataStream ssKey, CDataStream ssValue)\n{\n    CWallet *dummyWallet = reinterpret_cast<CWallet*>(callbackData);\n    CWalletScanState dummyWss;\n    std::string strType, strErr;\n    bool fReadOK;\n    {\n        // Required in LoadKeyMetadata():\n        LOCK(dummyWallet->cs_wallet);\n        fReadOK = ReadKeyValue(dummyWallet, ssKey, ssValue,\n                               dummyWss, strType, strErr);\n    }\n    if (!IsKeyType(strType) && strType != \"hdchain\")\n        return false;\n    if (!fReadOK)\n    {\n        LogPrintf(\"WARNING: CWalletDB::Recover skipping %s: %s\\n\", strType, strErr);\n        return false;\n    }\n\n    return true;\n}\n\nbool CWalletDB::VerifyEnvironment(const std::string& walletFile, const fs::path& walletDir, std::string& errorStr)\n{\n    return CDB::VerifyEnvironment(walletFile, walletDir, errorStr);\n}\n\nbool CWalletDB::VerifyDatabaseFile(const std::string& walletFile, const fs::path& walletDir, std::string& warningStr, std::string& errorStr)\n{\n    return CDB::VerifyDatabaseFile(walletFile, walletDir, warningStr, errorStr, CWalletDB::Recover);\n}\n\nbool CWalletDB::WriteDestData(const std::string &address, const std::string &key, const std::string &value)\n{\n    return WriteIC(std::make_pair(std::string(\"destdata\"), std::make_pair(address, key)), value);\n}\n\nbool CWalletDB::EraseDestData(const std::string &address, const std::string &key)\n{\n    return EraseIC(std::make_pair(std::string(\"destdata\"), std::make_pair(address, key)));\n}\n\n\nbool CWalletDB::WriteHDChain(const CHDChain& chain)\n{\n    return WriteIC(std::string(\"hdchain\"), chain);\n}\n\nbool CWalletDB::TxnBegin()\n{\n    return batch.TxnBegin();\n}\n\nbool CWalletDB::TxnCommit()\n{\n    return batch.TxnCommit();\n}\n\nbool CWalletDB::TxnAbort()\n{\n    return batch.TxnAbort();\n}\n\nbool CWalletDB::ReadVersion(int& nVersion)\n{\n    return batch.ReadVersion(nVersion);\n}\n\nbool CWalletDB::WriteVersion(int nVersion)\n{\n    return batch.WriteVersion(nVersion);\n}\n"
  },
  {
    "path": "src/wallet/walletdb.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_WALLETDB_H\n#define BITCOIN_WALLET_WALLETDB_H\n\n#include <amount.h>\n#include <primitives/transaction.h>\n#include <wallet/db.h>\n#include <key.h>\n\n#include <list>\n#include <stdint.h>\n#include <string>\n#include <utility>\n#include <vector>\n\n/**\n * Overview of wallet database classes:\n *\n * - CDBEnv is an environment in which the database exists (has no analog in dbwrapper.h)\n * - CWalletDBWrapper represents a wallet database (similar to CDBWrapper in dbwrapper.h)\n * - CDB is a low-level database transaction (similar to CDBBatch in dbwrapper.h)\n * - CWalletDB is a modifier object for the wallet, and encapsulates a database\n *   transaction as well as methods to act on the database (no analog in\n *   dbwrapper.h)\n *\n * The latter two are named confusingly, in contrast to what the names CDB\n * and CWalletDB suggest they are transient transaction objects and don't\n * represent the database itself.\n */\n\nstatic const bool DEFAULT_FLUSHWALLET = true;\n\nclass CAccount;\nclass CAccountingEntry;\nstruct CBlockLocator;\nclass CKeyPool;\nclass CMasterKey;\nclass CScript;\nclass CWallet;\nclass CWalletTx;\nclass uint160;\nclass uint256;\n\n/** Error statuses for the wallet database */\nenum DBErrors\n{\n    DB_LOAD_OK,\n    DB_CORRUPT,\n    DB_NONCRITICAL_ERROR,\n    DB_TOO_NEW,\n    DB_LOAD_FAIL,\n    DB_NEED_REWRITE\n};\n\n/* simple HD chain data model */\nclass CHDChain\n{\npublic:\n    uint32_t nExternalChainCounter;\n    uint32_t nInternalChainCounter;\n    CKeyID masterKeyID; //!< master key hash160\n\n    static const int VERSION_HD_BASE        = 1;\n    static const int VERSION_HD_CHAIN_SPLIT = 2;\n    static const int CURRENT_VERSION        = VERSION_HD_CHAIN_SPLIT;\n    int nVersion;\n\n    CHDChain() { SetNull(); }\n    ADD_SERIALIZE_METHODS;\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action)\n    {\n        READWRITE(this->nVersion);\n        READWRITE(nExternalChainCounter);\n        READWRITE(masterKeyID);\n        if (this->nVersion >= VERSION_HD_CHAIN_SPLIT)\n            READWRITE(nInternalChainCounter);\n    }\n\n    void SetNull()\n    {\n        nVersion = CHDChain::CURRENT_VERSION;\n        nExternalChainCounter = 0;\n        nInternalChainCounter = 0;\n        masterKeyID.SetNull();\n    }\n};\n\nclass CKeyMetadata\n{\npublic:\n    static const int VERSION_BASIC=1;\n    static const int VERSION_WITH_HDDATA=10;\n    static const int CURRENT_VERSION=VERSION_WITH_HDDATA;\n    int nVersion;\n    int64_t nCreateTime; // 0 means unknown\n    std::string hdKeypath; //optional HD/bip32 keypath\n    CKeyID hdMasterKeyID; //id of the HD masterkey used to derive this key\n\n    CKeyMetadata()\n    {\n        SetNull();\n    }\n    explicit CKeyMetadata(int64_t nCreateTime_)\n    {\n        SetNull();\n        nCreateTime = nCreateTime_;\n    }\n\n    ADD_SERIALIZE_METHODS;\n\n    template <typename Stream, typename Operation>\n    inline void SerializationOp(Stream& s, Operation ser_action) {\n        READWRITE(this->nVersion);\n        READWRITE(nCreateTime);\n        if (this->nVersion >= VERSION_WITH_HDDATA)\n        {\n            READWRITE(hdKeypath);\n            READWRITE(hdMasterKeyID);\n        }\n    }\n\n    void SetNull()\n    {\n        nVersion = CKeyMetadata::CURRENT_VERSION;\n        nCreateTime = 0;\n        hdKeypath.clear();\n        hdMasterKeyID.SetNull();\n    }\n};\n\n/** Access to the wallet database.\n * This should really be named CWalletDBBatch, as it represents a single transaction at the\n * database. It will be committed when the object goes out of scope.\n * Optionally (on by default) it will flush to disk as well.\n */\nclass CWalletDB\n{\nprivate:\n    template <typename K, typename T>\n    bool WriteIC(const K& key, const T& value, bool fOverwrite = true)\n    {\n        if (!batch.Write(key, value, fOverwrite)) {\n            return false;\n        }\n        m_dbw.IncrementUpdateCounter();\n        return true;\n    }\n\n    template <typename K>\n    bool EraseIC(const K& key)\n    {\n        if (!batch.Erase(key)) {\n            return false;\n        }\n        m_dbw.IncrementUpdateCounter();\n        return true;\n    }\n\npublic:\n    explicit CWalletDB(CWalletDBWrapper& dbw, const char* pszMode = \"r+\", bool _fFlushOnClose = true) :\n        batch(dbw, pszMode, _fFlushOnClose),\n        m_dbw(dbw)\n    {\n    }\n    CWalletDB(const CWalletDB&) = delete;\n    CWalletDB& operator=(const CWalletDB&) = delete;\n\n    bool WriteName(const std::string& strAddress, const std::string& strName);\n    bool EraseName(const std::string& strAddress);\n\n    bool WritePurpose(const std::string& strAddress, const std::string& purpose);\n    bool ErasePurpose(const std::string& strAddress);\n\n    bool WriteTx(const CWalletTx& wtx);\n    bool EraseTx(uint256 hash);\n\n    bool WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata &keyMeta);\n    bool WriteCryptedKey(const CPubKey& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret, const CKeyMetadata &keyMeta);\n    bool WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey);\n\n    bool WriteCScript(const uint160& hash, const CScript& redeemScript);\n\n    bool WriteWatchOnly(const CScript &script, const CKeyMetadata &keymeta);\n    bool EraseWatchOnly(const CScript &script);\n\n    bool WriteBestBlock(const CBlockLocator& locator);\n    bool ReadBestBlock(CBlockLocator& locator);\n\n    bool WriteOrderPosNext(int64_t nOrderPosNext);\n\n    bool ReadPool(int64_t nPool, CKeyPool& keypool);\n    bool WritePool(int64_t nPool, const CKeyPool& keypool);\n    bool ErasePool(int64_t nPool);\n\n    bool WriteMinVersion(int nVersion);\n\n    /// This writes directly to the database, and will not update the CWallet's cached accounting entries!\n    /// Use wallet.AddAccountingEntry instead, to write *and* update its caches.\n    bool WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry);\n    bool ReadAccount(const std::string& strAccount, CAccount& account);\n    bool WriteAccount(const std::string& strAccount, const CAccount& account);\n\n    /// Write destination data key,value tuple to database\n    bool WriteDestData(const std::string &address, const std::string &key, const std::string &value);\n    /// Erase destination data tuple from wallet database\n    bool EraseDestData(const std::string &address, const std::string &key);\n\n    CAmount GetAccountCreditDebit(const std::string& strAccount);\n    void ListAccountCreditDebit(const std::string& strAccount, std::list<CAccountingEntry>& acentries);\n\n    DBErrors LoadWallet(CWallet* pwallet);\n    DBErrors FindWalletTx(std::vector<uint256>& vTxHash, std::vector<CWalletTx>& vWtx);\n    DBErrors ZapWalletTx(std::vector<CWalletTx>& vWtx);\n    DBErrors ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256>& vHashOut);\n    /* Try to (very carefully!) recover wallet database (with a possible key type filter) */\n    static bool Recover(const std::string& filename, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue), std::string& out_backup_filename);\n    /* Recover convenience-function to bypass the key filter callback, called when verify fails, recovers everything */\n    static bool Recover(const std::string& filename, std::string& out_backup_filename);\n    /* Recover filter (used as callback), will only let keys (cryptographical keys) as KV/key-type pass through */\n    static bool RecoverKeysOnlyFilter(void *callbackData, CDataStream ssKey, CDataStream ssValue);\n    /* Function to determine if a certain KV/key-type is a key (cryptographical key) type */\n    static bool IsKeyType(const std::string& strType);\n    /* verifies the database environment */\n    static bool VerifyEnvironment(const std::string& walletFile, const fs::path& walletDir, std::string& errorStr);\n    /* verifies the database file */\n    static bool VerifyDatabaseFile(const std::string& walletFile, const fs::path& walletDir, std::string& warningStr, std::string& errorStr);\n\n    //! write the hdchain model (external chain child index counter)\n    bool WriteHDChain(const CHDChain& chain);\n\n    //! Begin a new transaction\n    bool TxnBegin();\n    //! Commit current transaction\n    bool TxnCommit();\n    //! Abort current transaction\n    bool TxnAbort();\n    //! Read wallet version\n    bool ReadVersion(int& nVersion);\n    //! Write wallet version\n    bool WriteVersion(int nVersion);\nprivate:\n    CDB batch;\n    CWalletDBWrapper& m_dbw;\n};\n\n//! Compacts BDB state so that wallet.dat is self-contained (if there are changes)\nvoid MaybeCompactWalletDB();\n\n#endif // BITCOIN_WALLET_WALLETDB_H\n"
  },
  {
    "path": "src/wallet/walletutil.cpp",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <wallet/walletutil.h>\n\nfs::path GetWalletDir()\n{\n    fs::path path;\n\n    if (gArgs.IsArgSet(\"-walletdir\")) {\n        path = gArgs.GetArg(\"-walletdir\", \"\");\n        if (!fs::is_directory(path)) {\n            // If the path specified doesn't exist, we return the deliberately\n            // invalid empty string.\n            path = \"\";\n        }\n    } else {\n        path = GetDataDir();\n        // If a wallets directory exists, use that, otherwise default to GetDataDir\n        if (fs::is_directory(path / \"wallets\")) {\n            path /= \"wallets\";\n        }\n    }\n\n    return path;\n}\n"
  },
  {
    "path": "src/wallet/walletutil.h",
    "content": "// Copyright (c) 2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WALLET_UTIL_H\n#define BITCOIN_WALLET_UTIL_H\n\n#include <chainparamsbase.h>\n#include <util.h>\n\n//! Get the path of the wallet directory.\nfs::path GetWalletDir();\n\n#endif // BITCOIN_WALLET_UTIL_H\n"
  },
  {
    "path": "src/warnings.cpp",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <sync.h>\n#include <clientversion.h>\n#include <util.h>\n#include <warnings.h>\n\nCCriticalSection cs_warnings;\nstd::string strMiscWarning;\nbool fLargeWorkForkFound = false;\nbool fLargeWorkInvalidChainFound = false;\n\nvoid SetMiscWarning(const std::string& strWarning)\n{\n    LOCK(cs_warnings);\n    strMiscWarning = strWarning;\n}\n\nvoid SetfLargeWorkForkFound(bool flag)\n{\n    LOCK(cs_warnings);\n    fLargeWorkForkFound = flag;\n}\n\nbool GetfLargeWorkForkFound()\n{\n    LOCK(cs_warnings);\n    return fLargeWorkForkFound;\n}\n\nvoid SetfLargeWorkInvalidChainFound(bool flag)\n{\n    LOCK(cs_warnings);\n    fLargeWorkInvalidChainFound = flag;\n}\n\nstd::string GetWarnings(const std::string& strFor)\n{\n    std::string strStatusBar;\n    std::string strRPC;\n    std::string strGUI;\n    const std::string uiAlertSeperator = \"<hr />\";\n\n    LOCK(cs_warnings);\n\n    if (!CLIENT_VERSION_IS_RELEASE) {\n        strStatusBar = \"This is a pre-release test build - use at your own risk - do not use for mining or merchant applications\";\n        strGUI = _(\"This is a pre-release test build - use at your own risk - do not use for mining or merchant applications\");\n    }\n\n    if (gArgs.GetBoolArg(\"-testsafemode\", DEFAULT_TESTSAFEMODE))\n        strStatusBar = strRPC = strGUI = \"testsafemode enabled\";\n\n    // Misc warnings like out of disk space and clock is wrong\n    if (strMiscWarning != \"\")\n    {\n        strStatusBar = strMiscWarning;\n        strGUI += (strGUI.empty() ? \"\" : uiAlertSeperator) + strMiscWarning;\n    }\n\n    if (fLargeWorkForkFound)\n    {\n        strStatusBar = strRPC = \"Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.\";\n        strGUI += (strGUI.empty() ? \"\" : uiAlertSeperator) + _(\"Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.\");\n    }\n    else if (fLargeWorkInvalidChainFound)\n    {\n        strStatusBar = strRPC = \"Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.\";\n        strGUI += (strGUI.empty() ? \"\" : uiAlertSeperator) + _(\"Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.\");\n    }\n\n    if (strFor == \"gui\")\n        return strGUI;\n    else if (strFor == \"statusbar\")\n        return strStatusBar;\n    else if (strFor == \"rpc\")\n        return strRPC;\n    assert(!\"GetWarnings(): invalid parameter\");\n    return \"error\";\n}\n"
  },
  {
    "path": "src/warnings.h",
    "content": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_WARNINGS_H\n#define BITCOIN_WARNINGS_H\n\n#include <stdlib.h>\n#include <string>\n\nvoid SetMiscWarning(const std::string& strWarning);\nvoid SetfLargeWorkForkFound(bool flag);\nbool GetfLargeWorkForkFound();\nvoid SetfLargeWorkInvalidChainFound(bool flag);\n/** Format a string that describes several potential problems detected by the core.\n * strFor can have three values:\n * - \"rpc\": get critical warnings, which should put the client in safe mode if non-empty\n * - \"statusbar\": get all warnings\n * - \"gui\": get all warnings, translated (where possible) for GUI\n * This function only returns the highest priority warning of the set selected by strFor.\n */\nstd::string GetWarnings(const std::string& strFor);\n\nstatic const bool DEFAULT_TESTSAFEMODE = false;\n\n#endif //  BITCOIN_WARNINGS_H\n"
  },
  {
    "path": "src/zmq/zmqabstractnotifier.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <zmq/zmqabstractnotifier.h>\n#include <util.h>\n\n\nCZMQAbstractNotifier::~CZMQAbstractNotifier()\n{\n    assert(!psocket);\n}\n\nbool CZMQAbstractNotifier::NotifyBlock(const CBlockIndex * /*CBlockIndex*/)\n{\n    return true;\n}\n\nbool CZMQAbstractNotifier::NotifyTransaction(const CTransaction &/*transaction*/)\n{\n    return true;\n}\n"
  },
  {
    "path": "src/zmq/zmqabstractnotifier.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H\n#define BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H\n\n#include <zmq/zmqconfig.h>\n\nclass CBlockIndex;\nclass CZMQAbstractNotifier;\n\ntypedef CZMQAbstractNotifier* (*CZMQNotifierFactory)();\n\nclass CZMQAbstractNotifier\n{\npublic:\n    CZMQAbstractNotifier() : psocket(nullptr) { }\n    virtual ~CZMQAbstractNotifier();\n\n    template <typename T>\n    static CZMQAbstractNotifier* Create()\n    {\n        return new T();\n    }\n\n    std::string GetType() const { return type; }\n    void SetType(const std::string &t) { type = t; }\n    std::string GetAddress() const { return address; }\n    void SetAddress(const std::string &a) { address = a; }\n\n    virtual bool Initialize(void *pcontext) = 0;\n    virtual void Shutdown() = 0;\n\n    virtual bool NotifyBlock(const CBlockIndex *pindex);\n    virtual bool NotifyTransaction(const CTransaction &transaction);\n\nprotected:\n    void *psocket;\n    std::string type;\n    std::string address;\n};\n\n#endif // BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H\n"
  },
  {
    "path": "src/zmq/zmqconfig.h",
    "content": "// Copyright (c) 2014-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_ZMQ_ZMQCONFIG_H\n#define BITCOIN_ZMQ_ZMQCONFIG_H\n\n#if defined(HAVE_CONFIG_H)\n#include <config/bitcoin-config.h>\n#endif\n\n#include <stdarg.h>\n#include <string>\n\n#if ENABLE_ZMQ\n#include <zmq.h>\n#endif\n\n#include <primitives/block.h>\n#include <primitives/transaction.h>\n\nvoid zmqError(const char *str);\n\n#endif // BITCOIN_ZMQ_ZMQCONFIG_H\n"
  },
  {
    "path": "src/zmq/zmqnotificationinterface.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <zmq/zmqnotificationinterface.h>\n#include <zmq/zmqpublishnotifier.h>\n\n#include <version.h>\n#include <validation.h>\n#include <streams.h>\n#include <util.h>\n\nvoid zmqError(const char *str)\n{\n    LogPrint(BCLog::ZMQ, \"zmq: Error: %s, errno=%s\\n\", str, zmq_strerror(errno));\n}\n\nCZMQNotificationInterface::CZMQNotificationInterface() : pcontext(nullptr)\n{\n}\n\nCZMQNotificationInterface::~CZMQNotificationInterface()\n{\n    Shutdown();\n\n    for (std::list<CZMQAbstractNotifier*>::iterator i=notifiers.begin(); i!=notifiers.end(); ++i)\n    {\n        delete *i;\n    }\n}\n\nCZMQNotificationInterface* CZMQNotificationInterface::Create()\n{\n    CZMQNotificationInterface* notificationInterface = nullptr;\n    std::map<std::string, CZMQNotifierFactory> factories;\n    std::list<CZMQAbstractNotifier*> notifiers;\n\n    factories[\"pubhashblock\"] = CZMQAbstractNotifier::Create<CZMQPublishHashBlockNotifier>;\n    factories[\"pubhashtx\"] = CZMQAbstractNotifier::Create<CZMQPublishHashTransactionNotifier>;\n    factories[\"pubrawblock\"] = CZMQAbstractNotifier::Create<CZMQPublishRawBlockNotifier>;\n    factories[\"pubrawtx\"] = CZMQAbstractNotifier::Create<CZMQPublishRawTransactionNotifier>;\n\n    for (const auto& entry : factories)\n    {\n        std::string arg(\"-zmq\" + entry.first);\n        if (gArgs.IsArgSet(arg))\n        {\n            CZMQNotifierFactory factory = entry.second;\n            std::string address = gArgs.GetArg(arg, \"\");\n            CZMQAbstractNotifier *notifier = factory();\n            notifier->SetType(entry.first);\n            notifier->SetAddress(address);\n            notifiers.push_back(notifier);\n        }\n    }\n\n    if (!notifiers.empty())\n    {\n        notificationInterface = new CZMQNotificationInterface();\n        notificationInterface->notifiers = notifiers;\n\n        if (!notificationInterface->Initialize())\n        {\n            delete notificationInterface;\n            notificationInterface = nullptr;\n        }\n    }\n\n    return notificationInterface;\n}\n\n// Called at startup to conditionally set up ZMQ socket(s)\nbool CZMQNotificationInterface::Initialize()\n{\n    LogPrint(BCLog::ZMQ, \"zmq: Initialize notification interface\\n\");\n    assert(!pcontext);\n\n    pcontext = zmq_init(1);\n\n    if (!pcontext)\n    {\n        zmqError(\"Unable to initialize context\");\n        return false;\n    }\n\n    std::list<CZMQAbstractNotifier*>::iterator i=notifiers.begin();\n    for (; i!=notifiers.end(); ++i)\n    {\n        CZMQAbstractNotifier *notifier = *i;\n        if (notifier->Initialize(pcontext))\n        {\n            LogPrint(BCLog::ZMQ, \"  Notifier %s ready (address = %s)\\n\", notifier->GetType(), notifier->GetAddress());\n        }\n        else\n        {\n            LogPrint(BCLog::ZMQ, \"  Notifier %s failed (address = %s)\\n\", notifier->GetType(), notifier->GetAddress());\n            break;\n        }\n    }\n\n    if (i!=notifiers.end())\n    {\n        return false;\n    }\n\n    return true;\n}\n\n// Called during shutdown sequence\nvoid CZMQNotificationInterface::Shutdown()\n{\n    LogPrint(BCLog::ZMQ, \"zmq: Shutdown notification interface\\n\");\n    if (pcontext)\n    {\n        for (std::list<CZMQAbstractNotifier*>::iterator i=notifiers.begin(); i!=notifiers.end(); ++i)\n        {\n            CZMQAbstractNotifier *notifier = *i;\n            LogPrint(BCLog::ZMQ, \"   Shutdown notifier %s at %s\\n\", notifier->GetType(), notifier->GetAddress());\n            notifier->Shutdown();\n        }\n        zmq_ctx_destroy(pcontext);\n\n        pcontext = nullptr;\n    }\n}\n\nvoid CZMQNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload)\n{\n    if (fInitialDownload || pindexNew == pindexFork) // In IBD or blocks were disconnected without any new ones\n        return;\n\n    for (std::list<CZMQAbstractNotifier*>::iterator i = notifiers.begin(); i!=notifiers.end(); )\n    {\n        CZMQAbstractNotifier *notifier = *i;\n        if (notifier->NotifyBlock(pindexNew))\n        {\n            i++;\n        }\n        else\n        {\n            notifier->Shutdown();\n            i = notifiers.erase(i);\n        }\n    }\n}\n\nvoid CZMQNotificationInterface::TransactionAddedToMempool(const CTransactionRef& ptx)\n{\n    // Used by BlockConnected and BlockDisconnected as well, because they're\n    // all the same external callback.\n    const CTransaction& tx = *ptx;\n\n    for (std::list<CZMQAbstractNotifier*>::iterator i = notifiers.begin(); i!=notifiers.end(); )\n    {\n        CZMQAbstractNotifier *notifier = *i;\n        if (notifier->NotifyTransaction(tx))\n        {\n            i++;\n        }\n        else\n        {\n            notifier->Shutdown();\n            i = notifiers.erase(i);\n        }\n    }\n}\n\nvoid CZMQNotificationInterface::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted)\n{\n    for (const CTransactionRef& ptx : pblock->vtx) {\n        // Do a normal notify for each transaction added in the block\n        TransactionAddedToMempool(ptx);\n    }\n}\n\nvoid CZMQNotificationInterface::BlockDisconnected(const std::shared_ptr<const CBlock>& pblock)\n{\n    for (const CTransactionRef& ptx : pblock->vtx) {\n        // Do a normal notify for each transaction removed in block disconnection\n        TransactionAddedToMempool(ptx);\n    }\n}\n"
  },
  {
    "path": "src/zmq/zmqnotificationinterface.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H\n#define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H\n\n#include <validationinterface.h>\n#include <string>\n#include <map>\n#include <list>\n\nclass CBlockIndex;\nclass CZMQAbstractNotifier;\n\nclass CZMQNotificationInterface final : public CValidationInterface\n{\npublic:\n    virtual ~CZMQNotificationInterface();\n\n    static CZMQNotificationInterface* Create();\n\nprotected:\n    bool Initialize();\n    void Shutdown();\n\n    // CValidationInterface\n    void TransactionAddedToMempool(const CTransactionRef& tx) override;\n    void BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexConnected, const std::vector<CTransactionRef>& vtxConflicted) override;\n    void BlockDisconnected(const std::shared_ptr<const CBlock>& pblock) override;\n    void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;\n\nprivate:\n    CZMQNotificationInterface();\n\n    void *pcontext;\n    std::list<CZMQAbstractNotifier*> notifiers;\n};\n\n#endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H\n"
  },
  {
    "path": "src/zmq/zmqpublishnotifier.cpp",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include <chain.h>\n#include <chainparams.h>\n#include <streams.h>\n#include <zmq/zmqpublishnotifier.h>\n#include <validation.h>\n#include <util.h>\n#include <rpc/server.h>\n\nstatic std::multimap<std::string, CZMQAbstractPublishNotifier*> mapPublishNotifiers;\n\nstatic const char *MSG_HASHBLOCK = \"hashblock\";\nstatic const char *MSG_HASHTX    = \"hashtx\";\nstatic const char *MSG_RAWBLOCK  = \"rawblock\";\nstatic const char *MSG_RAWTX     = \"rawtx\";\n\n// Internal function to send multipart message\nstatic int zmq_send_multipart(void *sock, const void* data, size_t size, ...)\n{\n    va_list args;\n    va_start(args, size);\n\n    while (1)\n    {\n        zmq_msg_t msg;\n\n        int rc = zmq_msg_init_size(&msg, size);\n        if (rc != 0)\n        {\n            zmqError(\"Unable to initialize ZMQ msg\");\n            va_end(args);\n            return -1;\n        }\n\n        void *buf = zmq_msg_data(&msg);\n        memcpy(buf, data, size);\n\n        data = va_arg(args, const void*);\n\n        rc = zmq_msg_send(&msg, sock, data ? ZMQ_SNDMORE : 0);\n        if (rc == -1)\n        {\n            zmqError(\"Unable to send ZMQ msg\");\n            zmq_msg_close(&msg);\n            va_end(args);\n            return -1;\n        }\n\n        zmq_msg_close(&msg);\n\n        if (!data)\n            break;\n\n        size = va_arg(args, size_t);\n    }\n    va_end(args);\n    return 0;\n}\n\nbool CZMQAbstractPublishNotifier::Initialize(void *pcontext)\n{\n    assert(!psocket);\n\n    // check if address is being used by other publish notifier\n    std::multimap<std::string, CZMQAbstractPublishNotifier*>::iterator i = mapPublishNotifiers.find(address);\n\n    if (i==mapPublishNotifiers.end())\n    {\n        psocket = zmq_socket(pcontext, ZMQ_PUB);\n        if (!psocket)\n        {\n            zmqError(\"Failed to create socket\");\n            return false;\n        }\n\n        int rc = zmq_bind(psocket, address.c_str());\n        if (rc!=0)\n        {\n            zmqError(\"Failed to bind address\");\n            zmq_close(psocket);\n            return false;\n        }\n\n        // register this notifier for the address, so it can be reused for other publish notifier\n        mapPublishNotifiers.insert(std::make_pair(address, this));\n        return true;\n    }\n    else\n    {\n        LogPrint(BCLog::ZMQ, \"zmq: Reusing socket for address %s\\n\", address);\n\n        psocket = i->second->psocket;\n        mapPublishNotifiers.insert(std::make_pair(address, this));\n\n        return true;\n    }\n}\n\nvoid CZMQAbstractPublishNotifier::Shutdown()\n{\n    assert(psocket);\n\n    int count = mapPublishNotifiers.count(address);\n\n    // remove this notifier from the list of publishers using this address\n    typedef std::multimap<std::string, CZMQAbstractPublishNotifier*>::iterator iterator;\n    std::pair<iterator, iterator> iterpair = mapPublishNotifiers.equal_range(address);\n\n    for (iterator it = iterpair.first; it != iterpair.second; ++it)\n    {\n        if (it->second==this)\n        {\n            mapPublishNotifiers.erase(it);\n            break;\n        }\n    }\n\n    if (count == 1)\n    {\n        LogPrint(BCLog::ZMQ, \"Close socket at address %s\\n\", address);\n        int linger = 0;\n        zmq_setsockopt(psocket, ZMQ_LINGER, &linger, sizeof(linger));\n        zmq_close(psocket);\n    }\n\n    psocket = nullptr;\n}\n\nbool CZMQAbstractPublishNotifier::SendMessage(const char *command, const void* data, size_t size)\n{\n    assert(psocket);\n\n    /* send three parts, command & data & a LE 4byte sequence number */\n    unsigned char msgseq[sizeof(uint32_t)];\n    WriteLE32(&msgseq[0], nSequence);\n    int rc = zmq_send_multipart(psocket, command, strlen(command), data, size, msgseq, (size_t)sizeof(uint32_t), nullptr);\n    if (rc == -1)\n        return false;\n\n    /* increment memory only sequence number after sending */\n    nSequence++;\n\n    return true;\n}\n\nbool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex)\n{\n    uint256 hash = pindex->GetBlockHash();\n    LogPrint(BCLog::ZMQ, \"zmq: Publish hashblock %s\\n\", hash.GetHex());\n    char data[32];\n    for (unsigned int i = 0; i < 32; i++)\n        data[31 - i] = hash.begin()[i];\n    return SendMessage(MSG_HASHBLOCK, data, 32);\n}\n\nbool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &transaction)\n{\n    uint256 hash = transaction.GetHash();\n    LogPrint(BCLog::ZMQ, \"zmq: Publish hashtx %s\\n\", hash.GetHex());\n    char data[32];\n    for (unsigned int i = 0; i < 32; i++)\n        data[31 - i] = hash.begin()[i];\n    return SendMessage(MSG_HASHTX, data, 32);\n}\n\nbool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex)\n{\n    LogPrint(BCLog::ZMQ, \"zmq: Publish rawblock %s\\n\", pindex->GetBlockHash().GetHex());\n\n    const Consensus::Params& consensusParams = Params().GetConsensus();\n    CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());\n    {\n        LOCK(cs_main);\n        CBlock block;\n        if(!ReadBlockFromDisk(block, pindex, consensusParams))\n        {\n            zmqError(\"Can't read block from disk\");\n            return false;\n        }\n\n        ss << block;\n    }\n\n    return SendMessage(MSG_RAWBLOCK, &(*ss.begin()), ss.size());\n}\n\nbool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction)\n{\n    uint256 hash = transaction.GetHash();\n    LogPrint(BCLog::ZMQ, \"zmq: Publish rawtx %s\\n\", hash.GetHex());\n    CDataStream ss(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags());\n    ss << transaction;\n    return SendMessage(MSG_RAWTX, &(*ss.begin()), ss.size());\n}\n"
  },
  {
    "path": "src/zmq/zmqpublishnotifier.h",
    "content": "// Copyright (c) 2015-2017 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H\n#define BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H\n\n#include <zmq/zmqabstractnotifier.h>\n\nclass CBlockIndex;\n\nclass CZMQAbstractPublishNotifier : public CZMQAbstractNotifier\n{\nprivate:\n    uint32_t nSequence; //!< upcounting per message sequence number\n\npublic:\n\n    /* send zmq multipart message\n       parts:\n          * command\n          * data\n          * message sequence number\n    */\n    bool SendMessage(const char *command, const void* data, size_t size);\n\n    bool Initialize(void *pcontext) override;\n    void Shutdown() override;\n};\n\nclass CZMQPublishHashBlockNotifier : public CZMQAbstractPublishNotifier\n{\npublic:\n    bool NotifyBlock(const CBlockIndex *pindex) override;\n};\n\nclass CZMQPublishHashTransactionNotifier : public CZMQAbstractPublishNotifier\n{\npublic:\n    bool NotifyTransaction(const CTransaction &transaction) override;\n};\n\nclass CZMQPublishRawBlockNotifier : public CZMQAbstractPublishNotifier\n{\npublic:\n    bool NotifyBlock(const CBlockIndex *pindex) override;\n};\n\nclass CZMQPublishRawTransactionNotifier : public CZMQAbstractPublishNotifier\n{\npublic:\n    bool NotifyTransaction(const CTransaction &transaction) override;\n};\n\n#endif // BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H\n"
  },
  {
    "path": "test/README.md",
    "content": "This directory contains integration tests that test bitcoind and its\nutilities in their entirety. It does not contain unit tests, which\ncan be found in [/src/test](/src/test), [/src/wallet/test](/src/wallet/test),\netc.\n\nThere are currently two sets of tests in this directory:\n\n- [functional](/test/functional) which test the functionality of \nbitcoind and bitcoin-qt by interacting with them through the RPC and P2P\ninterfaces.\n- [util](/test/util) which tests the bitcoin utilities, currently only\nbitcoin-tx.\n\nThe util tests are run as part of `make check` target. The functional\ntests are run by the travis continuous build process whenever a pull\nrequest is opened. Both sets of tests can also be run locally.\n\n# Running tests locally\n\nBuild for your system first. Be sure to enable wallet, utils and daemon when you configure. Tests will not run otherwise.\n\n### Functional tests\n\n#### Dependencies\n\nThe ZMQ functional test requires a python ZMQ library. To install it:\n\n- on Unix, run `sudo apt-get install python3-zmq`\n- on mac OS, run `pip3 install pyzmq`\n\n#### Running the tests\n\nIndividual tests can be run by directly calling the test script, eg:\n\n```\ntest/functional/replace-by-fee.py\n```\n\nor can be run through the test_runner harness, eg:\n\n```\ntest/functional/test_runner.py replace-by-fee.py\n```\n\nYou can run any combination (incl. duplicates) of tests by calling:\n\n```\ntest/functional/test_runner.py <testname1> <testname2> <testname3> ...\n```\n\nRun the regression test suite with:\n\n```\ntest/functional/test_runner.py\n```\n\nRun all possible tests with\n\n```\ntest/functional/test_runner.py --extended\n```\n\nBy default, up to 4 tests will be run in parallel by test_runner. To specify\nhow many jobs to run, append `--jobs=n`\n\nThe individual tests and the test_runner harness have many command-line\noptions. Run `test_runner.py -h` to see them all.\n\n#### Troubleshooting and debugging test failures\n\n##### Resource contention\n\nThe P2P and RPC ports used by the bitcoind nodes-under-test are chosen to make\nconflicts with other processes unlikely. However, if there is another bitcoind\nprocess running on the system (perhaps from a previous test which hasn't successfully\nkilled all its bitcoind nodes), then there may be a port conflict which will\ncause the test to fail. It is recommended that you run the tests on a system\nwhere no other bitcoind processes are running.\n\nOn linux, the test_framework will warn if there is another\nbitcoind process running when the tests are started.\n\nIf there are zombie bitcoind processes after test failure, you can kill them\nby running the following commands. **Note that these commands will kill all\nbitcoind processes running on the system, so should not be used if any non-test\nbitcoind processes are being run.**\n\n```bash\nkillall bitcoind\n```\n\nor\n\n```bash\npkill -9 bitcoind\n```\n\n\n##### Data directory cache\n\nA pre-mined blockchain with 200 blocks is generated the first time a\nfunctional test is run and is stored in test/cache. This speeds up\ntest startup times since new blockchains don't need to be generated for\neach test. However, the cache may get into a bad state, in which case\ntests will fail. If this happens, remove the cache directory (and make\nsure bitcoind processes are stopped as above):\n\n```bash\nrm -rf cache\nkillall bitcoind\n```\n\n##### Test logging\n\nThe tests contain logging at different levels (debug, info, warning, etc). By\ndefault:\n\n- when run through the test_runner harness, *all* logs are written to\n  `test_framework.log` and no logs are output to the console.\n- when run directly, *all* logs are written to `test_framework.log` and INFO\n  level and above are output to the console.\n- when run on Travis, no logs are output to the console. However, if a test\n  fails, the `test_framework.log` and bitcoind `debug.log`s will all be dumped\n  to the console to help troubleshooting.\n\nTo change the level of logs output to the console, use the `-l` command line\nargument.\n\n`test_framework.log` and bitcoind `debug.log`s can be combined into a single\naggregate log by running the `combine_logs.py` script. The output can be plain\ntext, colorized text or html. For example:\n\n```\ncombine_logs.py -c <test data directory> | less -r\n```\n\nwill pipe the colorized logs from the test into less.\n\nUse `--tracerpc` to trace out all the RPC calls and responses to the console. For\nsome tests (eg any that use `submitblock` to submit a full block over RPC),\nthis can result in a lot of screen output.\n\nBy default, the test data directory will be deleted after a successful run.\nUse `--nocleanup` to leave the test data directory intact. The test data\ndirectory is never deleted after a failed test.\n\n##### Attaching a debugger\n\nA python debugger can be attached to tests at any point. Just add the line:\n\n```py\nimport pdb; pdb.set_trace()\n```\n\nanywhere in the test. You will then be able to inspect variables, as well as\ncall methods that interact with the bitcoind nodes-under-test.\n\nIf further introspection of the bitcoind instances themselves becomes\nnecessary, this can be accomplished by first setting a pdb breakpoint\nat an appropriate location, running the test to that point, then using\n`gdb` to attach to the process and debug.\n\nFor instance, to attach to `self.node[1]` during a run:\n\n```bash\n2017-06-27 14:13:56.686000 TestFramework (INFO): Initializing test directory /tmp/user/1000/testo9vsdjo3\n```\n\nuse the directory path to get the pid from the pid file:\n\n```bash\ncat /tmp/user/1000/testo9vsdjo3/node1/regtest/bitcoind.pid\ngdb /home/example/bitcoind <pid>\n```\n\nNote: gdb attach step may require `sudo`\n\n### Util tests\n\nUtil tests can be run locally by running `test/util/bitcoin-util-test.py`. \nUse the `-v` option for verbose output.\n\n# Writing functional tests\n\nYou are encouraged to write functional tests for new or existing features.\nFurther information about the functional test framework and individual \ntests is found in [test/functional](/test/functional).\n"
  },
  {
    "path": "test/config.ini.in",
    "content": "# Copyright (c) 2013-2016 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n# These environment variables are set by the build process and read by\n# test/functional/test_runner.py and test/util/bitcoin-util-test.py\n\n[environment]\nSRCDIR=@abs_top_srcdir@\nBUILDDIR=@abs_top_builddir@\nEXEEXT=@EXEEXT@\n\n[components]\n# Which components are enabled. These are commented out by `configure` if they were disabled when running config.\n@ENABLE_WALLET_TRUE@ENABLE_WALLET=true\n@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=true\n@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true\n@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true\n"
  },
  {
    "path": "test/functional/.gitignore",
    "content": "*.pyc\ncache\n"
  },
  {
    "path": "test/functional/README.md",
    "content": "# Functional tests\n\n### Writing Functional Tests\n\n#### Example test\n\nThe [example_test.py](example_test.py) is a heavily commented example of a test case that uses both\nthe RPC and P2P interfaces. If you are writing your first test, copy that file\nand modify to fit your needs.\n\n#### Coverage\n\nRunning `test_runner.py` with the `--coverage` argument tracks which RPCs are\ncalled by the tests and prints a report of uncovered RPCs in the summary. This\ncan be used (along with the `--extended` argument) to find out which RPCs we\ndon't have test cases for.\n\n#### Style guidelines\n\n- Where possible, try to adhere to [PEP-8 guidelines](https://www.python.org/dev/peps/pep-0008/)\n- Use a python linter like flake8 before submitting PRs to catch common style\n  nits (eg trailing whitespace, unused imports, etc)\n- Avoid wildcard imports where possible\n- Use a module-level docstring to describe what the test is testing, and how it\n  is testing it.\n- When subclassing the BitcoinTestFramwork, place overrides for the\n  `set_test_params()`, `add_options()` and `setup_xxxx()` methods at the top of\n  the subclass, then locally-defined helper methods, then the `run_test()` method.\n\n#### Naming guidelines\n\n- Name the test `<area>_test.py`, where area can be one of the following:\n    - `feature` for tests for full features that aren't wallet/mining/mempool, eg `feature_rbf.py`\n    - `interface` for tests for other interfaces (REST, ZMQ, etc), eg `interface_rest.py`\n    - `mempool` for tests for mempool behaviour, eg `mempool_reorg.py`\n    - `mining` for tests for mining features, eg `mining_prioritisetransaction.py`\n    - `p2p` for tests that explicitly test the p2p interface, eg `p2p_disconnect_ban.py`\n    - `rpc` for tests for individual RPC methods or features, eg `rpc_listtransactions.py`\n    - `wallet` for tests for wallet features, eg `wallet_keypool.py`\n- use an underscore to separate words\n    - exception: for tests for specific RPCs or command line options which don't include underscores, name the test after the exact RPC or argument name, eg `rpc_decodescript.py`, not `rpc_decode_script.py`\n- Don't use the redundant word `test` in the name, eg `interface_zmq.py`, not `interface_zmq_test.py`\n\n#### General test-writing advice\n\n- Set `self.num_nodes` to the minimum number of nodes necessary for the test.\n  Having additional unrequired nodes adds to the execution time of the test as\n  well as memory/CPU/disk requirements (which is important when running tests in\n  parallel or on Travis).\n- Avoid stop-starting the nodes multiple times during the test if possible. A\n  stop-start takes several seconds, so doing it several times blows up the\n  runtime of the test.\n- Set the `self.setup_clean_chain` variable in `set_test_params()` to control whether\n  or not to use the cached data directories. The cached data directories\n  contain a 200-block pre-mined blockchain and wallets for four nodes. Each node\n  has 25 mature blocks (25x50=1250 BTC) in its wallet.\n- When calling RPCs with lots of arguments, consider using named keyword\n  arguments instead of positional arguments to make the intent of the call\n  clear to readers.\n\n#### RPC and P2P definitions\n\nTest writers may find it helpful to refer to the definitions for the RPC and\nP2P messages. These can be found in the following source files:\n\n- `/src/rpc/*` for RPCs\n- `/src/wallet/rpc*` for wallet RPCs\n- `ProcessMessage()` in `/src/net_processing.cpp` for parsing P2P messages\n\n#### Using the P2P interface\n\n- `mininode.py` contains all the definitions for objects that pass\nover the network (`CBlock`, `CTransaction`, etc, along with the network-level\nwrappers for them, `msg_block`, `msg_tx`, etc).\n\n- P2P tests have two threads. One thread handles all network communication\nwith the bitcoind(s) being tested (using python's asyncore package); the other\nimplements the test logic.\n\n- `P2PConnection` is the class used to connect to a bitcoind.  `P2PInterface`\ncontains the higher level logic for processing P2P payloads and connecting to\nthe Bitcoin Core node application logic. For custom behaviour, subclass the\nP2PInterface object and override the callback methods.\n\n- Call `network_thread_start()` after all `P2PInterface` objects are created to\nstart the networking thread.  (Continue with the test logic in your existing\nthread.)\n\n- Can be used to write tests where specific P2P protocol behavior is tested.\nExamples tests are `p2p_unrequested_blocks.py`, `p2p_compactblocks.py`.\n\n#### Comptool\n\n- Comptool is a Testing framework for writing tests that compare the block/tx acceptance\nbehavior of a bitcoind against 1 or more other bitcoind instances. It should not be used\nto write static tests with known outcomes, since that type of test is easier to write and\nmaintain using the standard BitcoinTestFramework.\n\n- Set the `num_nodes` variable (defined in `ComparisonTestFramework`) to start up\n1 or more nodes.  If using 1 node, then `--testbinary` can be used as a command line\noption to change the bitcoind binary used by the test.  If using 2 or more nodes,\nthen `--refbinary` can be optionally used to change the bitcoind that will be used\non nodes 2 and up.\n\n- Implement a (generator) function called `get_tests()` which yields `TestInstance`s.\nEach `TestInstance` consists of:\n  - A list of `[object, outcome, hash]` entries\n    * `object` is a `CBlock`, `CTransaction`, or\n    `CBlockHeader`.  `CBlock`'s and `CTransaction`'s are tested for\n    acceptance.  `CBlockHeader`s can be used so that the test runner can deliver\n    complete headers-chains when requested from the bitcoind, to allow writing\n    tests where blocks can be delivered out of order but still processed by\n    headers-first bitcoind's.\n    * `outcome` is `True`, `False`, or `None`.  If `True`\n    or `False`, the tip is compared with the expected tip -- either the\n    block passed in, or the hash specified as the optional 3rd entry.  If\n    `None` is specified, then the test will compare all the bitcoind's\n    being tested to see if they all agree on what the best tip is.\n    * `hash` is the block hash of the tip to compare against. Optional to\n    specify; if left out then the hash of the block passed in will be used as\n    the expected tip.  This allows for specifying an expected tip while testing\n    the handling of either invalid blocks or blocks delivered out of order,\n    which complete a longer chain.\n  - `sync_every_block`: `True/False`.  If `False`, then all blocks\n    are inv'ed together, and the test runner waits until the node receives the\n    last one, and tests only the last block for tip acceptance using the\n    outcome and specified tip.  If `True`, then each block is tested in\n    sequence and synced (this is slower when processing many blocks).\n  - `sync_every_transaction`: `True/False`.  Analogous to\n    `sync_every_block`, except if the outcome on the last tx is \"None\",\n    then the contents of the entire mempool are compared across all bitcoind\n    connections.  If `True` or `False`, then only the last tx's\n    acceptance is tested against the given outcome.\n\n- For examples of tests written in this framework, see\n  `p2p_invalid_block.py` and `feature_block.py`.\n\n### test-framework modules\n\n#### [test_framework/authproxy.py](test_framework/authproxy.py)\nTaken from the [python-bitcoinrpc repository](https://github.com/jgarzik/python-bitcoinrpc).\n\n#### [test_framework/test_framework.py](test_framework/test_framework.py)\nBase class for functional tests.\n\n#### [test_framework/util.py](test_framework/util.py)\nGenerally useful functions.\n\n#### [test_framework/mininode.py](test_framework/mininode.py)\nBasic code to support P2P connectivity to a bitcoind.\n\n#### [test_framework/comptool.py](test_framework/comptool.py)\nFramework for comparison-tool style, P2P tests.\n\n#### [test_framework/script.py](test_framework/script.py)\nUtilities for manipulating transaction scripts (originally from python-bitcoinlib)\n\n#### [test_framework/blockstore.py](test_framework/blockstore.py)\nImplements disk-backed block and tx storage.\n\n#### [test_framework/key.py](test_framework/key.py)\nWrapper around OpenSSL EC_Key (originally from python-bitcoinlib)\n\n#### [test_framework/bignum.py](test_framework/bignum.py)\nHelpers for script.py\n\n#### [test_framework/blocktools.py](test_framework/blocktools.py)\nHelper functions for creating blocks and transactions.\n"
  },
  {
    "path": "test/functional/combine_logs.py",
    "content": "#!/usr/bin/env python3\n\"\"\"Combine logs from multiple bitcoin nodes as well as the test_framework log.\n\nThis streams the combined log output to stdout. Use combine_logs.py > outputfile\nto write to an outputfile.\"\"\"\n\nimport argparse\nfrom collections import defaultdict, namedtuple\nimport heapq\nimport itertools\nimport os\nimport re\nimport sys\n\n# Matches on the date format at the start of the log event\nTIMESTAMP_PATTERN = re.compile(r\"^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{6}\")\n\nLogEvent = namedtuple('LogEvent', ['timestamp', 'source', 'event'])\n\ndef main():\n    \"\"\"Main function. Parses args, reads the log files and renders them as text or html.\"\"\"\n\n    parser = argparse.ArgumentParser(usage='%(prog)s [options] <test temporary directory>', description=__doc__)\n    parser.add_argument('-c', '--color', dest='color', action='store_true', help='outputs the combined log with events colored by source (requires posix terminal colors. Use less -r for viewing)')\n    parser.add_argument('--html', dest='html', action='store_true', help='outputs the combined log as html. Requires jinja2. pip install jinja2')\n    args, unknown_args = parser.parse_known_args()\n\n    if args.color and os.name != 'posix':\n        print(\"Color output requires posix terminal colors.\")\n        sys.exit(1)\n\n    if args.html and args.color:\n        print(\"Only one out of --color or --html should be specified\")\n        sys.exit(1)\n\n    # There should only be one unknown argument - the path of the temporary test directory\n    if len(unknown_args) != 1:\n        print(\"Unexpected arguments\" + str(unknown_args))\n        sys.exit(1)\n\n    log_events = read_logs(unknown_args[0])\n\n    print_logs(log_events, color=args.color, html=args.html)\n\ndef read_logs(tmp_dir):\n    \"\"\"Reads log files.\n\n    Delegates to generator function get_log_events() to provide individual log events\n    for each of the input log files.\"\"\"\n\n    files = [(\"test\", \"%s/test_framework.log\" % tmp_dir)]\n    for i in itertools.count():\n        logfile = \"{}/node{}/regtest/debug.log\".format(tmp_dir, i)\n        if not os.path.isfile(logfile):\n            break\n        files.append((\"node%d\" % i, logfile))\n\n    return heapq.merge(*[get_log_events(source, f) for source, f in files])\n\ndef get_log_events(source, logfile):\n    \"\"\"Generator function that returns individual log events.\n\n    Log events may be split over multiple lines. We use the timestamp\n    regex match as the marker for a new log event.\"\"\"\n    try:\n        with open(logfile, 'r') as infile:\n            event = ''\n            timestamp = ''\n            for line in infile:\n                # skip blank lines\n                if line == '\\n':\n                    continue\n                # if this line has a timestamp, it's the start of a new log event.\n                time_match = TIMESTAMP_PATTERN.match(line)\n                if time_match:\n                    if event:\n                        yield LogEvent(timestamp=timestamp, source=source, event=event.rstrip())\n                    event = line\n                    timestamp = time_match.group()\n                # if it doesn't have a timestamp, it's a continuation line of the previous log.\n                else:\n                    event += \"\\n\" + line\n            # Flush the final event\n            yield LogEvent(timestamp=timestamp, source=source, event=event.rstrip())\n    except FileNotFoundError:\n        print(\"File %s could not be opened. Continuing without it.\" % logfile, file=sys.stderr)\n\ndef print_logs(log_events, color=False, html=False):\n    \"\"\"Renders the iterator of log events into text or html.\"\"\"\n    if not html:\n        colors = defaultdict(lambda: '')\n        if color:\n            colors[\"test\"] = \"\\033[0;36m\"   # CYAN\n            colors[\"node0\"] = \"\\033[0;34m\"  # BLUE\n            colors[\"node1\"] = \"\\033[0;32m\"  # GREEN\n            colors[\"node2\"] = \"\\033[0;31m\"  # RED\n            colors[\"node3\"] = \"\\033[0;33m\"  # YELLOW\n            colors[\"reset\"] = \"\\033[0m\"     # Reset font color\n\n        for event in log_events:\n            print(\"{0} {1: <5} {2} {3}\".format(colors[event.source.rstrip()], event.source, event.event, colors[\"reset\"]))\n\n    else:\n        try:\n            import jinja2\n        except ImportError:\n            print(\"jinja2 not found. Try `pip install jinja2`\")\n            sys.exit(1)\n        print(jinja2.Environment(loader=jinja2.FileSystemLoader('./'))\n                    .get_template('combined_log_template.html')\n                    .render(title=\"Combined Logs from testcase\", log_events=[event._asdict() for event in log_events]))\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "test/functional/combined_log_template.html",
    "content": "<html lang=\"en\">\n<head>\n    <title> {{ title }} </title>\n    <style>\n        ul {\n            list-style-type: none;\n            font-family: monospace;\n        }\n        li {\n            border: 1px solid slategray;\n            margin-bottom: 1px;\n        }\n        li:hover {\n            filter: brightness(85%);\n        }\n        li.log-test {\n            background-color: cyan;\n        }\n        li.log-node0 {\n            background-color: lightblue;\n        }\n        li.log-node1 {\n            background-color: lightgreen;\n        }\n        li.log-node2 {\n            background-color: lightsalmon;\n        }\n        li.log-node3 {\n            background-color: lightyellow;\n        }\n    </style>\n</head>\n<body>\n<ul>\n{% for event in log_events %}\n<li class=\"log-{{ event.source }}\"> {{ event.source }} {{ event.timestamp }} {{event.event}}</li>\n{% endfor %}\n</ul>\n</body>\n</html>\n"
  },
  {
    "path": "test/functional/create_cache.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Create a blockchain cache.\n\nCreating a cache of the blockchain speeds up test execution when running\nmultiple functional tests. This helper script is executed by test_runner when multiple\ntests are being run in parallel.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\n\nclass CreateCache(BitcoinTestFramework):\n    # Test network and test nodes are not required:\n\n    def set_test_params(self):\n        self.num_nodes = 0\n        self.supports_cli = True\n\n    def setup_network(self):\n        pass\n\n    def run_test(self):\n        pass\n\nif __name__ == '__main__':\n    CreateCache().main()\n"
  },
  {
    "path": "test/functional/example_test.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"An example functional test\n\nThe module-level docstring should include a high-level description of\nwhat the test is doing. It's the first thing people see when they open\nthe file and should give the reader information about *what* the test\nis testing and *how* it's being tested\n\"\"\"\n# Imports should be in PEP8 ordering (std library first, then third party\n# libraries then local imports).\nfrom collections import defaultdict\n\n# Avoid wildcard * imports if possible\nfrom test_framework.blocktools import (create_block, create_coinbase)\nfrom test_framework.mininode import (\n    CInv,\n    P2PInterface,\n    mininode_lock,\n    msg_block,\n    msg_getdata,\n    network_thread_join,\n    network_thread_start,\n)\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    connect_nodes,\n    wait_until,\n)\n\n# P2PInterface is a class containing callbacks to be executed when a P2P\n# message is received from the node-under-test. Subclass P2PInterface and\n# override the on_*() methods if you need custom behaviour.\nclass BaseNode(P2PInterface):\n    def __init__(self):\n        \"\"\"Initialize the P2PInterface\n\n        Used to inialize custom properties for the Node that aren't\n        included by default in the base class. Be aware that the P2PInterface\n        base class already stores a counter for each P2P message type and the\n        last received message of each type, which should be sufficient for the\n        needs of most tests.\n\n        Call super().__init__() first for standard initialization and then\n        initialize custom properties.\"\"\"\n        super().__init__()\n        # Stores a dictionary of all blocks received\n        self.block_receive_map = defaultdict(int)\n\n    def on_block(self, message):\n        \"\"\"Override the standard on_block callback\n\n        Store the hash of a received block in the dictionary.\"\"\"\n        message.block.calc_sha256()\n        self.block_receive_map[message.block.sha256] += 1\n\n    def on_inv(self, message):\n        \"\"\"Override the standard on_inv callback\"\"\"\n        pass\n\ndef custom_function():\n    \"\"\"Do some custom behaviour\n\n    If this function is more generally useful for other tests, consider\n    moving it to a module in test_framework.\"\"\"\n    # self.log.info(\"running custom_function\")  # Oops! Can't run self.log outside the BitcoinTestFramework\n    pass\n\nclass ExampleTest(BitcoinTestFramework):\n    # Each functional test is a subclass of the BitcoinTestFramework class.\n\n    # Override the set_test_params(), add_options(), setup_chain(), setup_network()\n    # and setup_nodes() methods to customize the test setup as required.\n\n    def set_test_params(self):\n        \"\"\"Override test parameters for your individual test.\n\n        This method must be overridden and num_nodes must be exlicitly set.\"\"\"\n        self.setup_clean_chain = True\n        self.num_nodes = 3\n        # Use self.extra_args to change command-line arguments for the nodes\n        self.extra_args = [[], [\"-logips\"], []]\n\n        # self.log.info(\"I've finished set_test_params\")  # Oops! Can't run self.log before run_test()\n\n    # Use add_options() to add specific command-line options for your test.\n    # In practice this is not used very much, since the tests are mostly written\n    # to be run in automated environments without command-line options.\n    # def add_options()\n    #     pass\n\n    # Use setup_chain() to customize the node data directories. In practice\n    # this is not used very much since the default behaviour is almost always\n    # fine\n    # def setup_chain():\n    #     pass\n\n    def setup_network(self):\n        \"\"\"Setup the test network topology\n\n        Often you won't need to override this, since the standard network topology\n        (linear: node0 <-> node1 <-> node2 <-> ...) is fine for most tests.\n\n        If you do override this method, remember to start the nodes, assign\n        them to self.nodes, connect them and then sync.\"\"\"\n\n        self.setup_nodes()\n\n        # In this test, we're not connecting node2 to node0 or node1. Calls to\n        # sync_all() should not include node2, since we're not expecting it to\n        # sync.\n        connect_nodes(self.nodes[0], 1)\n        self.sync_all([self.nodes[0:1]])\n\n    # Use setup_nodes() to customize the node start behaviour (for example if\n    # you don't want to start all nodes at the start of the test).\n    # def setup_nodes():\n    #     pass\n\n    def custom_method(self):\n        \"\"\"Do some custom behaviour for this test\n\n        Define it in a method here because you're going to use it repeatedly.\n        If you think it's useful in general, consider moving it to the base\n        BitcoinTestFramework class so other tests can use it.\"\"\"\n\n        self.log.info(\"Running custom_method\")\n\n    def run_test(self):\n        \"\"\"Main test logic\"\"\"\n\n        # Create P2P connections to two of the nodes\n        self.nodes[0].add_p2p_connection(BaseNode())\n\n        # Start up network handling in another thread. This needs to be called\n        # after the P2P connections have been created.\n        network_thread_start()\n        # wait_for_verack ensures that the P2P connection is fully up.\n        self.nodes[0].p2p.wait_for_verack()\n\n        # Generating a block on one of the nodes will get us out of IBD\n        blocks = [int(self.nodes[0].generate(nblocks=1)[0], 16)]\n        self.sync_all([self.nodes[0:1]])\n\n        # Notice above how we called an RPC by calling a method with the same\n        # name on the node object. Notice also how we used a keyword argument\n        # to specify a named RPC argument. Neither of those are defined on the\n        # node object. Instead there's some __getattr__() magic going on under\n        # the covers to dispatch unrecognised attribute calls to the RPC\n        # interface.\n\n        # Logs are nice. Do plenty of them. They can be used in place of comments for\n        # breaking the test into sub-sections.\n        self.log.info(\"Starting test!\")\n\n        self.log.info(\"Calling a custom function\")\n        custom_function()\n\n        self.log.info(\"Calling a custom method\")\n        self.custom_method()\n\n        self.log.info(\"Create some blocks\")\n        self.tip = int(self.nodes[0].getbestblockhash(), 16)\n        self.block_time = self.nodes[0].getblock(self.nodes[0].getbestblockhash())['time'] + 1\n\n        height = 1\n\n        for i in range(10):\n            # Use the mininode and blocktools functionality to manually build a block\n            # Calling the generate() rpc is easier, but this allows us to exactly\n            # control the blocks and transactions.\n            block = create_block(self.tip, create_coinbase(height), self.block_time)\n            block.solve()\n            block_message = msg_block(block)\n            # Send message is used to send a P2P message to the node over our P2PInterface\n            self.nodes[0].p2p.send_message(block_message)\n            self.tip = block.sha256\n            blocks.append(self.tip)\n            self.block_time += 1\n            height += 1\n\n        self.log.info(\"Wait for node1 to reach current tip (height 11) using RPC\")\n        self.nodes[1].waitforblockheight(11)\n\n        self.log.info(\"Connect node2 and node1\")\n        connect_nodes(self.nodes[1], 2)\n\n        self.log.info(\"Add P2P connection to node2\")\n        # We can't add additional P2P connections once the network thread has started. Disconnect the connection\n        # to node0, wait for the network thread to terminate, then connect to node2. This is specific to\n        # the current implementation of the network thread and may be improved in future.\n        self.nodes[0].disconnect_p2ps()\n        network_thread_join()\n\n        self.nodes[2].add_p2p_connection(BaseNode())\n        network_thread_start()\n        self.nodes[2].p2p.wait_for_verack()\n\n        self.log.info(\"Wait for node2 reach current tip. Test that it has propagated all the blocks to us\")\n\n        getdata_request = msg_getdata()\n        for block in blocks:\n            getdata_request.inv.append(CInv(2, block))\n        self.nodes[2].p2p.send_message(getdata_request)\n\n        # wait_until() will loop until a predicate condition is met. Use it to test properties of the\n        # P2PInterface objects.\n        wait_until(lambda: sorted(blocks) == sorted(list(self.nodes[2].p2p.block_receive_map.keys())), timeout=5, lock=mininode_lock)\n\n        self.log.info(\"Check that each block was received only once\")\n        # The network thread uses a global lock on data access to the P2PConnection objects when sending and receiving\n        # messages. The test thread should acquire the global lock before accessing any P2PConnection data to avoid locking\n        # and synchronization issues. Note wait_until() acquires this global lock when testing the predicate.\n        with mininode_lock:\n            for block in self.nodes[2].p2p.block_receive_map.values():\n                assert_equal(block, 1)\n\nif __name__ == '__main__':\n    ExampleTest().main()\n"
  },
  {
    "path": "test/functional/feature_assumevalid.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test logic for skipping signature validation on old blocks.\n\nTest logic for skipping signature validation on blocks which we've assumed\nvalid (https://github.com/bitcoin/bitcoin/pull/9484)\n\nWe build a chain that includes and invalid signature for one of the\ntransactions:\n\n    0:        genesis block\n    1:        block 1 with coinbase transaction output.\n    2-101:    bury that block with 100 blocks so the coinbase transaction\n              output can be spent\n    102:      a block containing a transaction spending the coinbase\n              transaction output. The transaction has an invalid signature.\n    103-2202: bury the bad block with just over two weeks' worth of blocks\n              (2100 blocks)\n\nStart three nodes:\n\n    - node0 has no -assumevalid parameter. Try to sync to block 2202. It will\n      reject block 102 and only sync as far as block 101\n    - node1 has -assumevalid set to the hash of block 102. Try to sync to\n      block 2202. node1 will sync all the way to block 2202.\n    - node2 has -assumevalid set to the hash of block 102. Try to sync to\n      block 200. node2 will reject block 102 since it's assumed valid, but it\n      isn't buried by at least two weeks' work.\n\"\"\"\nimport time\n\nfrom test_framework.blocktools import (create_block, create_coinbase)\nfrom test_framework.key import CECKey\nfrom test_framework.mininode import (CBlockHeader,\n                                     COutPoint,\n                                     CTransaction,\n                                     CTxIn,\n                                     CTxOut,\n                                     network_thread_join,\n                                     network_thread_start,\n                                     P2PInterface,\n                                     msg_block,\n                                     msg_headers)\nfrom test_framework.script import (CScript, OP_TRUE)\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal\n\nclass BaseNode(P2PInterface):\n    def send_header_for_blocks(self, new_blocks):\n        headers_message = msg_headers()\n        headers_message.headers = [CBlockHeader(b) for b in new_blocks]\n        self.send_message(headers_message)\n\nclass AssumeValidTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 3\n\n    def setup_network(self):\n        self.add_nodes(3)\n        # Start node0. We don't start the other nodes yet since\n        # we need to pre-mine a block with an invalid transaction\n        # signature so we can pass in the block hash as assumevalid.\n        self.start_node(0)\n\n    def send_blocks_until_disconnected(self, p2p_conn):\n        \"\"\"Keep sending blocks to the node until we're disconnected.\"\"\"\n        for i in range(len(self.blocks)):\n            if p2p_conn.state != \"connected\":\n                break\n            try:\n                p2p_conn.send_message(msg_block(self.blocks[i]))\n            except IOError as e:\n                assert str(e) == 'Not connected, no pushbuf'\n                break\n\n    def assert_blockchain_height(self, node, height):\n        \"\"\"Wait until the blockchain is no longer advancing and verify it's reached the expected height.\"\"\"\n        last_height = node.getblock(node.getbestblockhash())['height']\n        timeout = 10\n        while True:\n            time.sleep(0.25)\n            current_height = node.getblock(node.getbestblockhash())['height']\n            if current_height != last_height:\n                last_height = current_height\n                if timeout < 0:\n                    assert False, \"blockchain too short after timeout: %d\" % current_height\n                timeout - 0.25\n                continue\n            elif current_height > height:\n                assert False, \"blockchain too long: %d\" % current_height\n            elif current_height == height:\n                break\n\n    def run_test(self):\n\n        # Connect to node0\n        p2p0 = self.nodes[0].add_p2p_connection(BaseNode())\n\n        network_thread_start()\n        self.nodes[0].p2p.wait_for_verack()\n\n        # Build the blockchain\n        self.tip = int(self.nodes[0].getbestblockhash(), 16)\n        self.block_time = self.nodes[0].getblock(self.nodes[0].getbestblockhash())['time'] + 1\n\n        self.blocks = []\n\n        # Get a pubkey for the coinbase TXO\n        coinbase_key = CECKey()\n        coinbase_key.set_secretbytes(b\"horsebattery\")\n        coinbase_pubkey = coinbase_key.get_pubkey()\n\n        # Create the first block with a coinbase output to our key\n        height = 1\n        block = create_block(self.tip, create_coinbase(height, coinbase_pubkey), self.block_time)\n        self.blocks.append(block)\n        self.block_time += 1\n        block.solve()\n        # Save the coinbase for later\n        self.block1 = block\n        self.tip = block.sha256\n        height += 1\n\n        # Bury the block 100 deep so the coinbase output is spendable\n        for i in range(100):\n            block = create_block(self.tip, create_coinbase(height), self.block_time)\n            block.solve()\n            self.blocks.append(block)\n            self.tip = block.sha256\n            self.block_time += 1\n            height += 1\n\n        # Create a transaction spending the coinbase output with an invalid (null) signature\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.block1.vtx[0].sha256, 0), scriptSig=b\"\"))\n        tx.vout.append(CTxOut(49 * 100000000, CScript([OP_TRUE])))\n        tx.calc_sha256()\n\n        block102 = create_block(self.tip, create_coinbase(height), self.block_time)\n        self.block_time += 1\n        block102.vtx.extend([tx])\n        block102.hashMerkleRoot = block102.calc_merkle_root()\n        block102.rehash()\n        block102.solve()\n        self.blocks.append(block102)\n        self.tip = block102.sha256\n        self.block_time += 1\n        height += 1\n\n        # Bury the assumed valid block 2100 deep\n        for i in range(2100):\n            block = create_block(self.tip, create_coinbase(height), self.block_time)\n            block.nVersion = 4\n            block.solve()\n            self.blocks.append(block)\n            self.tip = block.sha256\n            self.block_time += 1\n            height += 1\n\n        # We're adding new connections so terminate the network thread\n        self.nodes[0].disconnect_p2ps()\n        network_thread_join()\n\n        # Start node1 and node2 with assumevalid so they accept a block with a bad signature.\n        self.start_node(1, extra_args=[\"-assumevalid=\" + hex(block102.sha256)])\n        self.start_node(2, extra_args=[\"-assumevalid=\" + hex(block102.sha256)])\n\n        p2p0 = self.nodes[0].add_p2p_connection(BaseNode())\n        p2p1 = self.nodes[1].add_p2p_connection(BaseNode())\n        p2p2 = self.nodes[2].add_p2p_connection(BaseNode())\n\n        network_thread_start()\n\n        p2p0.wait_for_verack()\n        p2p1.wait_for_verack()\n        p2p2.wait_for_verack()\n\n        # send header lists to all three nodes\n        p2p0.send_header_for_blocks(self.blocks[0:2000])\n        p2p0.send_header_for_blocks(self.blocks[2000:])\n        p2p1.send_header_for_blocks(self.blocks[0:2000])\n        p2p1.send_header_for_blocks(self.blocks[2000:])\n        p2p2.send_header_for_blocks(self.blocks[0:200])\n\n        # Send blocks to node0. Block 102 will be rejected.\n        self.send_blocks_until_disconnected(p2p0)\n        self.assert_blockchain_height(self.nodes[0], 101)\n\n        # Send all blocks to node1. All blocks will be accepted.\n        for i in range(2202):\n            p2p1.send_message(msg_block(self.blocks[i]))\n        # Syncing 2200 blocks can take a while on slow systems. Give it plenty of time to sync.\n        p2p1.sync_with_ping(120)\n        assert_equal(self.nodes[1].getblock(self.nodes[1].getbestblockhash())['height'], 2202)\n\n        # Send blocks to node2. Block 102 will be rejected.\n        self.send_blocks_until_disconnected(p2p2)\n        self.assert_blockchain_height(self.nodes[2], 101)\n\nif __name__ == '__main__':\n    AssumeValidTest().main()\n"
  },
  {
    "path": "test/functional/feature_bip68_sequence.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test BIP68 implementation.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.blocktools import *\n\nSEQUENCE_LOCKTIME_DISABLE_FLAG = (1<<31)\nSEQUENCE_LOCKTIME_TYPE_FLAG = (1<<22) # this means use time (0 means height)\nSEQUENCE_LOCKTIME_GRANULARITY = 9 # this is a bit-shift\nSEQUENCE_LOCKTIME_MASK = 0x0000ffff\n\n# RPC error for non-BIP68 final transactions\nNOT_FINAL_ERROR = \"64: non-BIP68-final\"\n\nclass BIP68Test(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.extra_args = [[], [\"-acceptnonstdtxn=0\"]]\n\n    def run_test(self):\n        self.relayfee = self.nodes[0].getnetworkinfo()[\"relayfee\"]\n\n        # Generate some coins\n        self.nodes[0].generate(110)\n\n        self.log.info(\"Running test disable flag\")\n        self.test_disable_flag()\n\n        self.log.info(\"Running test sequence-lock-confirmed-inputs\")\n        self.test_sequence_lock_confirmed_inputs()\n\n        self.log.info(\"Running test sequence-lock-unconfirmed-inputs\")\n        self.test_sequence_lock_unconfirmed_inputs()\n\n        self.log.info(\"Running test BIP68 not consensus before versionbits activation\")\n        self.test_bip68_not_consensus()\n\n        self.log.info(\"Activating BIP68 (and 112/113)\")\n        self.activateCSV()\n\n        self.log.info(\"Verifying nVersion=2 transactions are standard.\")\n        self.log.info(\"Note that nVersion=2 transactions are always standard (independent of BIP68 activation status).\")\n        self.test_version2_relay()\n\n        self.log.info(\"Passed\")\n\n    # Test that BIP68 is not in effect if tx version is 1, or if\n    # the first sequence bit is set.\n    def test_disable_flag(self):\n        # Create some unconfirmed inputs\n        new_addr = self.nodes[0].getnewaddress()\n        self.nodes[0].sendtoaddress(new_addr, 2) # send 2 BTC\n\n        utxos = self.nodes[0].listunspent(0, 0)\n        assert(len(utxos) > 0)\n\n        utxo = utxos[0]\n\n        tx1 = CTransaction()\n        value = int(satoshi_round(utxo[\"amount\"] - self.relayfee)*COIN)\n\n        # Check that the disable flag disables relative locktime.\n        # If sequence locks were used, this would require 1 block for the\n        # input to mature.\n        sequence_value = SEQUENCE_LOCKTIME_DISABLE_FLAG | 1\n        tx1.vin = [CTxIn(COutPoint(int(utxo[\"txid\"], 16), utxo[\"vout\"]), nSequence=sequence_value)] \n        tx1.vout = [CTxOut(value, CScript([b'a']))]\n\n        tx1_signed = self.nodes[0].signrawtransaction(ToHex(tx1))[\"hex\"]\n        tx1_id = self.nodes[0].sendrawtransaction(tx1_signed)\n        tx1_id = int(tx1_id, 16)\n\n        # This transaction will enable sequence-locks, so this transaction should\n        # fail\n        tx2 = CTransaction()\n        tx2.nVersion = 2\n        sequence_value = sequence_value & 0x7fffffff\n        tx2.vin = [CTxIn(COutPoint(tx1_id, 0), nSequence=sequence_value)]\n        tx2.vout = [CTxOut(int(value - self.relayfee * COIN), CScript([b'a' * 35]))]\n        tx2.rehash()\n\n        assert_raises_rpc_error(-26, NOT_FINAL_ERROR, self.nodes[0].sendrawtransaction, ToHex(tx2))\n\n        # Setting the version back down to 1 should disable the sequence lock,\n        # so this should be accepted.\n        tx2.nVersion = 1\n\n        self.nodes[0].sendrawtransaction(ToHex(tx2))\n\n    # Calculate the median time past of a prior block (\"confirmations\" before\n    # the current tip).\n    def get_median_time_past(self, confirmations):\n        block_hash = self.nodes[0].getblockhash(self.nodes[0].getblockcount()-confirmations)\n        return self.nodes[0].getblockheader(block_hash)[\"mediantime\"]\n\n    # Test that sequence locks are respected for transactions spending confirmed inputs.\n    def test_sequence_lock_confirmed_inputs(self):\n        # Create lots of confirmed utxos, and use them to generate lots of random\n        # transactions.\n        max_outputs = 50\n        addresses = []\n        while len(addresses) < max_outputs:\n            addresses.append(self.nodes[0].getnewaddress())\n        while len(self.nodes[0].listunspent()) < 200:\n            import random\n            random.shuffle(addresses)\n            num_outputs = random.randint(1, max_outputs)\n            outputs = {}\n            for i in range(num_outputs):\n                outputs[addresses[i]] = random.randint(1, 20)*0.01\n            self.nodes[0].sendmany(\"\", outputs)\n            self.nodes[0].generate(1)\n\n        utxos = self.nodes[0].listunspent()\n\n        # Try creating a lot of random transactions.\n        # Each time, choose a random number of inputs, and randomly set\n        # some of those inputs to be sequence locked (and randomly choose\n        # between height/time locking). Small random chance of making the locks\n        # all pass.\n        for i in range(400):\n            # Randomly choose up to 10 inputs\n            num_inputs = random.randint(1, 10)\n            random.shuffle(utxos)\n\n            # Track whether any sequence locks used should fail\n            should_pass = True\n            \n            # Track whether this transaction was built with sequence locks\n            using_sequence_locks = False\n\n            tx = CTransaction()\n            tx.nVersion = 2\n            value = 0\n            for j in range(num_inputs):\n                sequence_value = 0xfffffffe # this disables sequence locks\n\n                # 50% chance we enable sequence locks\n                if random.randint(0,1):\n                    using_sequence_locks = True\n\n                    # 10% of the time, make the input sequence value pass\n                    input_will_pass = (random.randint(1,10) == 1)\n                    sequence_value = utxos[j][\"confirmations\"]\n                    if not input_will_pass:\n                        sequence_value += 1\n                        should_pass = False\n\n                    # Figure out what the median-time-past was for the confirmed input\n                    # Note that if an input has N confirmations, we're going back N blocks\n                    # from the tip so that we're looking up MTP of the block\n                    # PRIOR to the one the input appears in, as per the BIP68 spec.\n                    orig_time = self.get_median_time_past(utxos[j][\"confirmations\"])\n                    cur_time = self.get_median_time_past(0) # MTP of the tip\n\n                    # can only timelock this input if it's not too old -- otherwise use height\n                    can_time_lock = True\n                    if ((cur_time - orig_time) >> SEQUENCE_LOCKTIME_GRANULARITY) >= SEQUENCE_LOCKTIME_MASK:\n                        can_time_lock = False\n\n                    # if time-lockable, then 50% chance we make this a time lock\n                    if random.randint(0,1) and can_time_lock:\n                        # Find first time-lock value that fails, or latest one that succeeds\n                        time_delta = sequence_value << SEQUENCE_LOCKTIME_GRANULARITY\n                        if input_will_pass and time_delta > cur_time - orig_time:\n                            sequence_value = ((cur_time - orig_time) >> SEQUENCE_LOCKTIME_GRANULARITY)\n                        elif (not input_will_pass and time_delta <= cur_time - orig_time):\n                            sequence_value = ((cur_time - orig_time) >> SEQUENCE_LOCKTIME_GRANULARITY)+1\n                        sequence_value |= SEQUENCE_LOCKTIME_TYPE_FLAG\n                tx.vin.append(CTxIn(COutPoint(int(utxos[j][\"txid\"], 16), utxos[j][\"vout\"]), nSequence=sequence_value))\n                value += utxos[j][\"amount\"]*COIN\n            # Overestimate the size of the tx - signatures should be less than 120 bytes, and leave 50 for the output\n            tx_size = len(ToHex(tx))//2 + 120*num_inputs + 50\n            tx.vout.append(CTxOut(int(value-self.relayfee*tx_size*COIN/1000), CScript([b'a'])))\n            rawtx = self.nodes[0].signrawtransaction(ToHex(tx))[\"hex\"]\n\n            if (using_sequence_locks and not should_pass):\n                # This transaction should be rejected\n                assert_raises_rpc_error(-26, NOT_FINAL_ERROR, self.nodes[0].sendrawtransaction, rawtx)\n            else:\n                # This raw transaction should be accepted\n                self.nodes[0].sendrawtransaction(rawtx)\n                utxos = self.nodes[0].listunspent()\n\n    # Test that sequence locks on unconfirmed inputs must have nSequence\n    # height or time of 0 to be accepted.\n    # Then test that BIP68-invalid transactions are removed from the mempool\n    # after a reorg.\n    def test_sequence_lock_unconfirmed_inputs(self):\n        # Store height so we can easily reset the chain at the end of the test\n        cur_height = self.nodes[0].getblockcount()\n\n        # Create a mempool tx.\n        txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 2)\n        tx1 = FromHex(CTransaction(), self.nodes[0].getrawtransaction(txid))\n        tx1.rehash()\n\n        # Anyone-can-spend mempool tx.\n        # Sequence lock of 0 should pass.\n        tx2 = CTransaction()\n        tx2.nVersion = 2\n        tx2.vin = [CTxIn(COutPoint(tx1.sha256, 0), nSequence=0)]\n        tx2.vout = [CTxOut(int(tx1.vout[0].nValue - self.relayfee*COIN), CScript([b'a']))]\n        tx2_raw = self.nodes[0].signrawtransaction(ToHex(tx2))[\"hex\"]\n        tx2 = FromHex(tx2, tx2_raw)\n        tx2.rehash()\n\n        self.nodes[0].sendrawtransaction(tx2_raw)\n\n        # Create a spend of the 0th output of orig_tx with a sequence lock\n        # of 1, and test what happens when submitting.\n        # orig_tx.vout[0] must be an anyone-can-spend output\n        def test_nonzero_locks(orig_tx, node, relayfee, use_height_lock):\n            sequence_value = 1\n            if not use_height_lock:\n                sequence_value |= SEQUENCE_LOCKTIME_TYPE_FLAG\n\n            tx = CTransaction()\n            tx.nVersion = 2\n            tx.vin = [CTxIn(COutPoint(orig_tx.sha256, 0), nSequence=sequence_value)]\n            tx.vout = [CTxOut(int(orig_tx.vout[0].nValue - relayfee * COIN), CScript([b'a' * 35]))]\n            tx.rehash()\n\n            if (orig_tx.hash in node.getrawmempool()):\n                # sendrawtransaction should fail if the tx is in the mempool\n                assert_raises_rpc_error(-26, NOT_FINAL_ERROR, node.sendrawtransaction, ToHex(tx))\n            else:\n                # sendrawtransaction should succeed if the tx is not in the mempool\n                node.sendrawtransaction(ToHex(tx))\n\n            return tx\n\n        test_nonzero_locks(tx2, self.nodes[0], self.relayfee, use_height_lock=True)\n        test_nonzero_locks(tx2, self.nodes[0], self.relayfee, use_height_lock=False)\n\n        # Now mine some blocks, but make sure tx2 doesn't get mined.\n        # Use prioritisetransaction to lower the effective feerate to 0\n        self.nodes[0].prioritisetransaction(txid=tx2.hash, fee_delta=int(-self.relayfee*COIN))\n        cur_time = int(time.time())\n        for i in range(10):\n            self.nodes[0].setmocktime(cur_time + 600)\n            self.nodes[0].generate(1)\n            cur_time += 600\n\n        assert(tx2.hash in self.nodes[0].getrawmempool())\n\n        test_nonzero_locks(tx2, self.nodes[0], self.relayfee, use_height_lock=True)\n        test_nonzero_locks(tx2, self.nodes[0], self.relayfee, use_height_lock=False)\n\n        # Mine tx2, and then try again\n        self.nodes[0].prioritisetransaction(txid=tx2.hash, fee_delta=int(self.relayfee*COIN))\n\n        # Advance the time on the node so that we can test timelocks\n        self.nodes[0].setmocktime(cur_time+600)\n        self.nodes[0].generate(1)\n        assert(tx2.hash not in self.nodes[0].getrawmempool())\n\n        # Now that tx2 is not in the mempool, a sequence locked spend should\n        # succeed\n        tx3 = test_nonzero_locks(tx2, self.nodes[0], self.relayfee, use_height_lock=False)\n        assert(tx3.hash in self.nodes[0].getrawmempool())\n\n        self.nodes[0].generate(1)\n        assert(tx3.hash not in self.nodes[0].getrawmempool())\n\n        # One more test, this time using height locks\n        tx4 = test_nonzero_locks(tx3, self.nodes[0], self.relayfee, use_height_lock=True)\n        assert(tx4.hash in self.nodes[0].getrawmempool())\n\n        # Now try combining confirmed and unconfirmed inputs\n        tx5 = test_nonzero_locks(tx4, self.nodes[0], self.relayfee, use_height_lock=True)\n        assert(tx5.hash not in self.nodes[0].getrawmempool())\n\n        utxos = self.nodes[0].listunspent()\n        tx5.vin.append(CTxIn(COutPoint(int(utxos[0][\"txid\"], 16), utxos[0][\"vout\"]), nSequence=1))\n        tx5.vout[0].nValue += int(utxos[0][\"amount\"]*COIN)\n        raw_tx5 = self.nodes[0].signrawtransaction(ToHex(tx5))[\"hex\"]\n\n        assert_raises_rpc_error(-26, NOT_FINAL_ERROR, self.nodes[0].sendrawtransaction, raw_tx5)\n\n        # Test mempool-BIP68 consistency after reorg\n        #\n        # State of the transactions in the last blocks:\n        # ... -> [ tx2 ] ->  [ tx3 ]\n        #         tip-1        tip\n        # And currently tx4 is in the mempool.\n        #\n        # If we invalidate the tip, tx3 should get added to the mempool, causing\n        # tx4 to be removed (fails sequence-lock).\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n        assert(tx4.hash not in self.nodes[0].getrawmempool())\n        assert(tx3.hash in self.nodes[0].getrawmempool())\n\n        # Now mine 2 empty blocks to reorg out the current tip (labeled tip-1 in\n        # diagram above).\n        # This would cause tx2 to be added back to the mempool, which in turn causes\n        # tx3 to be removed.\n        tip = int(self.nodes[0].getblockhash(self.nodes[0].getblockcount()-1), 16)\n        height = self.nodes[0].getblockcount()\n        for i in range(2):\n            block = create_block(tip, create_coinbase(height), cur_time)\n            block.nVersion = 3\n            block.rehash()\n            block.solve()\n            tip = block.sha256\n            height += 1\n            self.nodes[0].submitblock(ToHex(block))\n            cur_time += 1\n\n        mempool = self.nodes[0].getrawmempool()\n        assert(tx3.hash not in mempool)\n        assert(tx2.hash in mempool)\n\n        # Reset the chain and get rid of the mocktimed-blocks\n        self.nodes[0].setmocktime(0)\n        self.nodes[0].invalidateblock(self.nodes[0].getblockhash(cur_height+1))\n        self.nodes[0].generate(10)\n\n    # Make sure that BIP68 isn't being used to validate blocks, prior to\n    # versionbits activation.  If more blocks are mined prior to this test\n    # being run, then it's possible the test has activated the soft fork, and\n    # this test should be moved to run earlier, or deleted.\n    def test_bip68_not_consensus(self):\n        assert(get_bip9_status(self.nodes[0], 'csv')['status'] != 'active')\n        txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 2)\n\n        tx1 = FromHex(CTransaction(), self.nodes[0].getrawtransaction(txid))\n        tx1.rehash()\n\n        # Make an anyone-can-spend transaction\n        tx2 = CTransaction()\n        tx2.nVersion = 1\n        tx2.vin = [CTxIn(COutPoint(tx1.sha256, 0), nSequence=0)]\n        tx2.vout = [CTxOut(int(tx1.vout[0].nValue - self.relayfee*COIN), CScript([b'a']))]\n\n        # sign tx2\n        tx2_raw = self.nodes[0].signrawtransaction(ToHex(tx2))[\"hex\"]\n        tx2 = FromHex(tx2, tx2_raw)\n        tx2.rehash()\n\n        self.nodes[0].sendrawtransaction(ToHex(tx2))\n        \n        # Now make an invalid spend of tx2 according to BIP68\n        sequence_value = 100 # 100 block relative locktime\n\n        tx3 = CTransaction()\n        tx3.nVersion = 2\n        tx3.vin = [CTxIn(COutPoint(tx2.sha256, 0), nSequence=sequence_value)]\n        tx3.vout = [CTxOut(int(tx2.vout[0].nValue - self.relayfee * COIN), CScript([b'a' * 35]))]\n        tx3.rehash()\n\n        assert_raises_rpc_error(-26, NOT_FINAL_ERROR, self.nodes[0].sendrawtransaction, ToHex(tx3))\n\n        # make a block that violates bip68; ensure that the tip updates\n        tip = int(self.nodes[0].getbestblockhash(), 16)\n        block = create_block(tip, create_coinbase(self.nodes[0].getblockcount()+1))\n        block.nVersion = 3\n        block.vtx.extend([tx1, tx2, tx3])\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.rehash()\n        add_witness_commitment(block)\n        block.solve()\n\n        self.nodes[0].submitblock(bytes_to_hex_str(block.serialize(True)))\n        assert_equal(self.nodes[0].getbestblockhash(), block.hash)\n\n    def activateCSV(self):\n        # activation should happen at block height 432 (3 periods)\n        # getblockchaininfo will show CSV as active at block 431 (144 * 3 -1) since it's returning whether CSV is active for the next block.\n        min_activation_height = 432\n        height = self.nodes[0].getblockcount()\n        assert_greater_than(min_activation_height - height, 2)\n        self.nodes[0].generate(min_activation_height - height - 2)\n        assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], \"locked_in\")\n        self.nodes[0].generate(1)\n        assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], \"active\")\n        sync_blocks(self.nodes)\n\n    # Use self.nodes[1] to test that version 2 transactions are standard.\n    def test_version2_relay(self):\n        inputs = [ ]\n        outputs = { self.nodes[1].getnewaddress() : 1.0 }\n        rawtx = self.nodes[1].createrawtransaction(inputs, outputs)\n        rawtxfund = self.nodes[1].fundrawtransaction(rawtx)['hex']\n        tx = FromHex(CTransaction(), rawtxfund)\n        tx.nVersion = 2\n        tx_signed = self.nodes[1].signrawtransaction(ToHex(tx))[\"hex\"]\n        self.nodes[1].sendrawtransaction(tx_signed)\n\nif __name__ == '__main__':\n    BIP68Test().main()\n"
  },
  {
    "path": "test/functional/feature_bip9_softforks.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test BIP 9 soft forks.\n\nConnect to a single node.\nregtest lock-in with 108/144 block signalling\nactivation after a further 144 blocks\nmine 2 block and save coinbases for later use\nmine 141 blocks to transition from DEFINED to STARTED\nmine 100 blocks signalling readiness and 44 not in order to fail to change state this period\nmine 108 blocks signalling readiness and 36 blocks not signalling readiness (STARTED->LOCKED_IN)\nmine a further 143 blocks (LOCKED_IN)\ntest that enforcement has not triggered (which triggers ACTIVE)\ntest that enforcement has triggered\n\"\"\"\nfrom io import BytesIO\nimport shutil\nimport time\nimport itertools\n\nfrom test_framework.test_framework import ComparisonTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import CTransaction, network_thread_start\nfrom test_framework.blocktools import create_coinbase, create_block\nfrom test_framework.comptool import TestInstance, TestManager\nfrom test_framework.script import CScript, OP_1NEGATE, OP_CHECKSEQUENCEVERIFY, OP_DROP\n\nclass BIP9SoftForksTest(ComparisonTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.extra_args = [['-whitelist=127.0.0.1']]\n        self.setup_clean_chain = True\n\n    def run_test(self):\n        self.test = TestManager(self, self.options.tmpdir)\n        self.test.add_all_connections(self.nodes)\n        network_thread_start()\n        self.test.run()\n\n    def create_transaction(self, node, coinbase, to_address, amount):\n        from_txid = node.getblock(coinbase)['tx'][0]\n        inputs = [{ \"txid\" : from_txid, \"vout\" : 0}]\n        outputs = { to_address : amount }\n        rawtx = node.createrawtransaction(inputs, outputs)\n        tx = CTransaction()\n        f = BytesIO(hex_str_to_bytes(rawtx))\n        tx.deserialize(f)\n        tx.nVersion = 2\n        return tx\n\n    def sign_transaction(self, node, tx):\n        signresult = node.signrawtransaction(bytes_to_hex_str(tx.serialize()))\n        tx = CTransaction()\n        f = BytesIO(hex_str_to_bytes(signresult['hex']))\n        tx.deserialize(f)\n        return tx\n\n    def generate_blocks(self, number, version, test_blocks = []):\n        for i in range(number):\n            block = create_block(self.tip, create_coinbase(self.height), self.last_block_time + 1)\n            block.nVersion = version\n            block.rehash()\n            block.solve()\n            test_blocks.append([block, True])\n            self.last_block_time += 1\n            self.tip = block.sha256\n            self.height += 1\n        return test_blocks\n\n    def get_bip9_status(self, key):\n        info = self.nodes[0].getblockchaininfo()\n        return info['bip9_softforks'][key]\n\n    def test_BIP(self, bipName, activated_version, invalidate, invalidatePostSignature, bitno):\n        assert_equal(self.get_bip9_status(bipName)['status'], 'defined')\n        assert_equal(self.get_bip9_status(bipName)['since'], 0)\n\n        # generate some coins for later\n        self.coinbase_blocks = self.nodes[0].generate(2)\n        self.height = 3  # height of the next block to build\n        self.tip = int(\"0x\" + self.nodes[0].getbestblockhash(), 0)\n        self.nodeaddress = self.nodes[0].getnewaddress()\n        self.last_block_time = int(time.time())\n\n        assert_equal(self.get_bip9_status(bipName)['status'], 'defined')\n        assert_equal(self.get_bip9_status(bipName)['since'], 0)\n        tmpl = self.nodes[0].getblocktemplate({})\n        assert(bipName not in tmpl['rules'])\n        assert(bipName not in tmpl['vbavailable'])\n        assert_equal(tmpl['vbrequired'], 0)\n        assert_equal(tmpl['version'], 0x20000000)\n\n        # Test 1\n        # Advance from DEFINED to STARTED\n        test_blocks = self.generate_blocks(141, 4)\n        yield TestInstance(test_blocks, sync_every_block=False)\n\n        assert_equal(self.get_bip9_status(bipName)['status'], 'started')\n        assert_equal(self.get_bip9_status(bipName)['since'], 144)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['elapsed'], 0)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['count'], 0)\n        tmpl = self.nodes[0].getblocktemplate({})\n        assert(bipName not in tmpl['rules'])\n        assert_equal(tmpl['vbavailable'][bipName], bitno)\n        assert_equal(tmpl['vbrequired'], 0)\n        assert(tmpl['version'] & activated_version)\n\n        # Test 1-A\n        # check stats after max number of \"signalling not\" blocks such that LOCKED_IN still possible this period\n        test_blocks = self.generate_blocks(36, 4, test_blocks) # 0x00000004 (signalling not)\n        test_blocks = self.generate_blocks(10, activated_version) # 0x20000001 (signalling ready)\n        yield TestInstance(test_blocks, sync_every_block=False)\n\n        assert_equal(self.get_bip9_status(bipName)['statistics']['elapsed'], 46)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['count'], 10)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['possible'], True)\n\n        # Test 1-B\n        # check stats after one additional \"signalling not\" block --  LOCKED_IN no longer possible this period\n        test_blocks = self.generate_blocks(1, 4, test_blocks) # 0x00000004 (signalling not)\n        yield TestInstance(test_blocks, sync_every_block=False)\n\n        assert_equal(self.get_bip9_status(bipName)['statistics']['elapsed'], 47)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['count'], 10)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['possible'], False)\n\n        # Test 1-C\n        # finish period with \"ready\" blocks, but soft fork will still fail to advance to LOCKED_IN\n        test_blocks = self.generate_blocks(97, activated_version) # 0x20000001 (signalling ready)\n        yield TestInstance(test_blocks, sync_every_block=False)\n\n        assert_equal(self.get_bip9_status(bipName)['statistics']['elapsed'], 0)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['count'], 0)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['possible'], True)\n        assert_equal(self.get_bip9_status(bipName)['status'], 'started')\n\n        # Test 2\n        # Fail to achieve LOCKED_IN 100 out of 144 signal bit 1\n        # using a variety of bits to simulate multiple parallel softforks\n        test_blocks = self.generate_blocks(50, activated_version) # 0x20000001 (signalling ready)\n        test_blocks = self.generate_blocks(20, 4, test_blocks) # 0x00000004 (signalling not)\n        test_blocks = self.generate_blocks(50, activated_version, test_blocks) # 0x20000101 (signalling ready)\n        test_blocks = self.generate_blocks(24, 4, test_blocks) # 0x20010000 (signalling not)\n        yield TestInstance(test_blocks, sync_every_block=False)\n\n        assert_equal(self.get_bip9_status(bipName)['status'], 'started')\n        assert_equal(self.get_bip9_status(bipName)['since'], 144)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['elapsed'], 0)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['count'], 0)\n        tmpl = self.nodes[0].getblocktemplate({})\n        assert(bipName not in tmpl['rules'])\n        assert_equal(tmpl['vbavailable'][bipName], bitno)\n        assert_equal(tmpl['vbrequired'], 0)\n        assert(tmpl['version'] & activated_version)\n\n        # Test 3\n        # 108 out of 144 signal bit 1 to achieve LOCKED_IN\n        # using a variety of bits to simulate multiple parallel softforks\n        test_blocks = self.generate_blocks(57, activated_version) # 0x20000001 (signalling ready)\n        test_blocks = self.generate_blocks(26, 4, test_blocks) # 0x00000004 (signalling not)\n        test_blocks = self.generate_blocks(50, activated_version, test_blocks) # 0x20000101 (signalling ready)\n        test_blocks = self.generate_blocks(10, 4, test_blocks) # 0x20010000 (signalling not)\n        yield TestInstance(test_blocks, sync_every_block=False)\n\n        # check counting stats and \"possible\" flag before last block of this period achieves LOCKED_IN...\n        assert_equal(self.get_bip9_status(bipName)['statistics']['elapsed'], 143)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['count'], 107)\n        assert_equal(self.get_bip9_status(bipName)['statistics']['possible'], True)\n        assert_equal(self.get_bip9_status(bipName)['status'], 'started')\n\n        # ...continue with Test 3\n        test_blocks = self.generate_blocks(1, activated_version) # 0x20000001 (signalling ready)\n        yield TestInstance(test_blocks, sync_every_block=False)\n\n        assert_equal(self.get_bip9_status(bipName)['status'], 'locked_in')\n        assert_equal(self.get_bip9_status(bipName)['since'], 576)\n        tmpl = self.nodes[0].getblocktemplate({})\n        assert(bipName not in tmpl['rules'])\n\n        # Test 4\n        # 143 more version 536870913 blocks (waiting period-1)\n        test_blocks = self.generate_blocks(143, 4)\n        yield TestInstance(test_blocks, sync_every_block=False)\n\n        assert_equal(self.get_bip9_status(bipName)['status'], 'locked_in')\n        assert_equal(self.get_bip9_status(bipName)['since'], 576)\n        tmpl = self.nodes[0].getblocktemplate({})\n        assert(bipName not in tmpl['rules'])\n\n        # Test 5\n        # Check that the new rule is enforced\n        spendtx = self.create_transaction(self.nodes[0],\n                self.coinbase_blocks[0], self.nodeaddress, 1.0)\n        invalidate(spendtx)\n        spendtx = self.sign_transaction(self.nodes[0], spendtx)\n        spendtx.rehash()\n        invalidatePostSignature(spendtx)\n        spendtx.rehash()\n        block = create_block(self.tip, create_coinbase(self.height), self.last_block_time + 1)\n        block.nVersion = activated_version\n        block.vtx.append(spendtx)\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.rehash()\n        block.solve()\n\n        self.last_block_time += 1\n        self.tip = block.sha256\n        self.height += 1\n        yield TestInstance([[block, True]])\n\n        assert_equal(self.get_bip9_status(bipName)['status'], 'active')\n        assert_equal(self.get_bip9_status(bipName)['since'], 720)\n        tmpl = self.nodes[0].getblocktemplate({})\n        assert(bipName in tmpl['rules'])\n        assert(bipName not in tmpl['vbavailable'])\n        assert_equal(tmpl['vbrequired'], 0)\n        assert(not (tmpl['version'] & (1 << bitno)))\n\n        # Test 6\n        # Check that the new sequence lock rules are enforced\n        spendtx = self.create_transaction(self.nodes[0],\n                self.coinbase_blocks[1], self.nodeaddress, 1.0)\n        invalidate(spendtx)\n        spendtx = self.sign_transaction(self.nodes[0], spendtx)\n        spendtx.rehash()\n        invalidatePostSignature(spendtx)\n        spendtx.rehash()\n\n        block = create_block(self.tip, create_coinbase(self.height), self.last_block_time + 1)\n        block.nVersion = 5\n        block.vtx.append(spendtx)\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.rehash()\n        block.solve()\n        self.last_block_time += 1\n        yield TestInstance([[block, False]])\n\n        # Restart all\n        self.test.clear_all_connections()\n        self.stop_nodes()\n        self.nodes = []\n        shutil.rmtree(self.options.tmpdir + \"/node0\")\n        self.setup_chain()\n        self.setup_network()\n        self.test.add_all_connections(self.nodes)\n        network_thread_start()\n        self.test.p2p_connections[0].wait_for_verack()\n\n    def get_tests(self):\n        for test in itertools.chain(\n                self.test_BIP('csv', 0x20000001, self.sequence_lock_invalidate, self.donothing, 0),\n                self.test_BIP('csv', 0x20000001, self.mtp_invalidate, self.donothing, 0),\n                self.test_BIP('csv', 0x20000001, self.donothing, self.csv_invalidate, 0)\n        ):\n            yield test\n\n    def donothing(self, tx):\n        return\n\n    def csv_invalidate(self, tx):\n        \"\"\"Modify the signature in vin 0 of the tx to fail CSV\n        Prepends -1 CSV DROP in the scriptSig itself.\n        \"\"\"\n        tx.vin[0].scriptSig = CScript([OP_1NEGATE, OP_CHECKSEQUENCEVERIFY, OP_DROP] +\n                                      list(CScript(tx.vin[0].scriptSig)))\n\n    def sequence_lock_invalidate(self, tx):\n        \"\"\"Modify the nSequence to make it fails once sequence lock rule is\n        activated (high timespan).\n        \"\"\"\n        tx.vin[0].nSequence = 0x00FFFFFF\n        tx.nLockTime = 0\n\n    def mtp_invalidate(self, tx):\n        \"\"\"Modify the nLockTime to make it fails once MTP rule is activated.\"\"\"\n        # Disable Sequence lock, Activate nLockTime\n        tx.vin[0].nSequence = 0x90FFFFFF\n        tx.nLockTime = self.last_block_time\n\nif __name__ == '__main__':\n    BIP9SoftForksTest().main()\n"
  },
  {
    "path": "test/functional/feature_block.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test block processing.\n\nThis reimplements tests from the bitcoinj/FullBlockTestGenerator used\nby the pull-tester.\n\nWe use the testing framework in which we expect a particular answer from\neach test.\n\"\"\"\n\nfrom test_framework.test_framework import ComparisonTestFramework\nfrom test_framework.util import *\nfrom test_framework.comptool import TestManager, TestInstance, RejectResult\nfrom test_framework.blocktools import *\nimport time\nfrom test_framework.key import CECKey\nfrom test_framework.script import *\nfrom test_framework.mininode import network_thread_start\nimport struct\n\nclass PreviousSpendableOutput():\n    def __init__(self, tx = CTransaction(), n = -1):\n        self.tx = tx\n        self.n = n  # the output we're spending\n\n#  Use this class for tests that require behavior other than normal \"mininode\" behavior.\n#  For now, it is used to serialize a bloated varint (b64).\nclass CBrokenBlock(CBlock):\n    def __init__(self, header=None):\n        super(CBrokenBlock, self).__init__(header)\n\n    def initialize(self, base_block):\n        self.vtx = copy.deepcopy(base_block.vtx)\n        self.hashMerkleRoot = self.calc_merkle_root()\n\n    def serialize(self, with_witness=False):\n        r = b\"\"\n        r += super(CBlock, self).serialize()\n        r += struct.pack(\"<BQ\", 255, len(self.vtx))\n        for tx in self.vtx:\n            if with_witness:\n                r += tx.serialize_with_witness()\n            else:\n                r += tx.serialize_without_witness()\n        return r\n\n    def normal_serialize(self):\n        r = b\"\"\n        r += super(CBrokenBlock, self).serialize()\n        return r\n\nclass FullBlockTest(ComparisonTestFramework):\n    # Can either run this test as 1 node with expected answers, or two and compare them.\n    # Change the \"outcome\" variable from each TestInstance object to only do the comparison.\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.setup_clean_chain = True\n        self.block_heights = {}\n        self.coinbase_key = CECKey()\n        self.coinbase_key.set_secretbytes(b\"horsebattery\")\n        self.coinbase_pubkey = self.coinbase_key.get_pubkey()\n        self.tip = None\n        self.blocks = {}\n\n    def add_options(self, parser):\n        super().add_options(parser)\n        parser.add_option(\"--runbarelyexpensive\", dest=\"runbarelyexpensive\", default=True)\n\n    def run_test(self):\n        self.test = TestManager(self, self.options.tmpdir)\n        self.test.add_all_connections(self.nodes)\n        network_thread_start()\n        self.test.run()\n\n    def add_transactions_to_block(self, block, tx_list):\n        [ tx.rehash() for tx in tx_list ]\n        block.vtx.extend(tx_list)\n\n    # this is a little handier to use than the version in blocktools.py\n    def create_tx(self, spend_tx, n, value, script=CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])):\n        tx = create_transaction(spend_tx, n, b\"\", value, script)\n        return tx\n\n    # sign a transaction, using the key we know about\n    # this signs input 0 in tx, which is assumed to be spending output n in spend_tx\n    def sign_tx(self, tx, spend_tx, n):\n        scriptPubKey = bytearray(spend_tx.vout[n].scriptPubKey)\n        if (scriptPubKey[0] == OP_TRUE):  # an anyone-can-spend\n            tx.vin[0].scriptSig = CScript()\n            return\n        (sighash, err) = SignatureHash(spend_tx.vout[n].scriptPubKey, tx, 0, SIGHASH_ALL)\n        tx.vin[0].scriptSig = CScript([self.coinbase_key.sign(sighash) + bytes(bytearray([SIGHASH_ALL]))])\n\n    def create_and_sign_transaction(self, spend_tx, n, value, script=CScript([OP_TRUE])):\n        tx = self.create_tx(spend_tx, n, value, script)\n        self.sign_tx(tx, spend_tx, n)\n        tx.rehash()\n        return tx\n\n    def next_block(self, number, spend=None, additional_coinbase_value=0, script=CScript([OP_TRUE]), solve=True):\n        if self.tip == None:\n            base_block_hash = self.genesis_hash\n            block_time = int(time.time())+1\n        else:\n            base_block_hash = self.tip.sha256\n            block_time = self.tip.nTime + 1\n        # First create the coinbase\n        height = self.block_heights[base_block_hash] + 1\n        coinbase = create_coinbase(height, self.coinbase_pubkey)\n        coinbase.vout[0].nValue += additional_coinbase_value\n        coinbase.rehash()\n        if spend == None:\n            block = create_block(base_block_hash, coinbase, block_time)\n        else:\n            coinbase.vout[0].nValue += spend.tx.vout[spend.n].nValue - 1 # all but one satoshi to fees\n            coinbase.rehash()\n            block = create_block(base_block_hash, coinbase, block_time)\n            tx = create_transaction(spend.tx, spend.n, b\"\", 1, script)  # spend 1 satoshi\n            self.sign_tx(tx, spend.tx, spend.n)\n            self.add_transactions_to_block(block, [tx])\n            block.hashMerkleRoot = block.calc_merkle_root()\n        if solve:\n            block.solve()\n        self.tip = block\n        self.block_heights[block.sha256] = height\n        assert number not in self.blocks\n        self.blocks[number] = block\n        return block\n\n    def get_tests(self):\n        self.genesis_hash = int(self.nodes[0].getbestblockhash(), 16)\n        self.block_heights[self.genesis_hash] = 0\n        spendable_outputs = []\n\n        # save the current tip so it can be spent by a later block\n        def save_spendable_output():\n            spendable_outputs.append(self.tip)\n\n        # get an output that we previously marked as spendable\n        def get_spendable_output():\n            return PreviousSpendableOutput(spendable_outputs.pop(0).vtx[0], 0)\n\n        # returns a test case that asserts that the current tip was accepted\n        def accepted():\n            return TestInstance([[self.tip, True]])\n\n        # returns a test case that asserts that the current tip was rejected\n        def rejected(reject = None):\n            if reject is None:\n                return TestInstance([[self.tip, False]])\n            else:\n                return TestInstance([[self.tip, reject]])\n\n        # move the tip back to a previous block\n        def tip(number):\n            self.tip = self.blocks[number]\n\n        # adds transactions to the block and updates state\n        def update_block(block_number, new_transactions):\n            block = self.blocks[block_number]\n            self.add_transactions_to_block(block, new_transactions)\n            old_sha256 = block.sha256\n            block.hashMerkleRoot = block.calc_merkle_root()\n            block.solve()\n            # Update the internal state just like in next_block\n            self.tip = block\n            if block.sha256 != old_sha256:\n                self.block_heights[block.sha256] = self.block_heights[old_sha256]\n                del self.block_heights[old_sha256]\n            self.blocks[block_number] = block\n            return block\n\n        # shorthand for functions\n        block = self.next_block\n        create_tx = self.create_tx\n        create_and_sign_tx = self.create_and_sign_transaction\n\n        # these must be updated if consensus changes\n        MAX_BLOCK_SIGOPS = 20000\n\n\n        # Create a new block\n        block(0)\n        save_spendable_output()\n        yield accepted()\n\n\n        # Now we need that block to mature so we can spend the coinbase.\n        test = TestInstance(sync_every_block=False)\n        for i in range(99):\n            block(5000 + i)\n            test.blocks_and_transactions.append([self.tip, True])\n            save_spendable_output()\n        yield test\n\n        # collect spendable outputs now to avoid cluttering the code later on\n        out = []\n        for i in range(33):\n            out.append(get_spendable_output())\n\n        # Start by building a couple of blocks on top (which output is spent is\n        # in parentheses):\n        #     genesis -> b1 (0) -> b2 (1)\n        block(1, spend=out[0])\n        save_spendable_output()\n        yield accepted()\n\n        block(2, spend=out[1])\n        yield accepted()\n        save_spendable_output()\n\n        # so fork like this:\n        #\n        #     genesis -> b1 (0) -> b2 (1)\n        #                      \\-> b3 (1)\n        #\n        # Nothing should happen at this point. We saw b2 first so it takes priority.\n        tip(1)\n        b3 = block(3, spend=out[1])\n        txout_b3 = PreviousSpendableOutput(b3.vtx[1], 0)\n        yield rejected()\n\n\n        # Now we add another block to make the alternative chain longer.\n        #\n        #     genesis -> b1 (0) -> b2 (1)\n        #                      \\-> b3 (1) -> b4 (2)\n        block(4, spend=out[2])\n        yield accepted()\n\n\n        # ... and back to the first chain.\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(2)\n        block(5, spend=out[2])\n        save_spendable_output()\n        yield rejected()\n\n        block(6, spend=out[3])\n        yield accepted()\n\n        # Try to create a fork that double-spends\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)\n        #                                          \\-> b7 (2) -> b8 (4)\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(5)\n        block(7, spend=out[2])\n        yield rejected()\n\n        block(8, spend=out[4])\n        yield rejected()\n\n        # Try to create a block that has too much fee\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6 (3)\n        #                                                    \\-> b9 (4)\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(6)\n        block(9, spend=out[4], additional_coinbase_value=1)\n        yield rejected(RejectResult(16, b'bad-cb-amount'))\n\n        # Create a fork that ends in a block with too much fee (the one that causes the reorg)\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6  (3)\n        #                                          \\-> b10 (3) -> b11 (4)\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(5)\n        block(10, spend=out[3])\n        yield rejected()\n\n        block(11, spend=out[4], additional_coinbase_value=1)\n        yield rejected(RejectResult(16, b'bad-cb-amount'))\n\n\n        # Try again, but with a valid fork first\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6  (3)\n        #                                          \\-> b12 (3) -> b13 (4) -> b14 (5)\n        #                                              (b12 added last)\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(5)\n        b12 = block(12, spend=out[3])\n        save_spendable_output()\n        b13 = block(13, spend=out[4])\n        # Deliver the block header for b12, and the block b13.\n        # b13 should be accepted but the tip won't advance until b12 is delivered.\n        yield TestInstance([[CBlockHeader(b12), None], [b13, False]])\n\n        save_spendable_output()\n        # b14 is invalid, but the node won't know that until it tries to connect\n        # Tip still can't advance because b12 is missing\n        block(14, spend=out[5], additional_coinbase_value=1)\n        yield rejected()\n\n        yield TestInstance([[b12, True, b13.sha256]]) # New tip should be b13.\n\n        # Add a block with MAX_BLOCK_SIGOPS and one with one more sigop\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6  (3)\n        #                                          \\-> b12 (3) -> b13 (4) -> b15 (5) -> b16 (6)\n        #                      \\-> b3 (1) -> b4 (2)\n\n        # Test that a block with a lot of checksigs is okay\n        lots_of_checksigs = CScript([OP_CHECKSIG] * (MAX_BLOCK_SIGOPS - 1))\n        tip(13)\n        block(15, spend=out[5], script=lots_of_checksigs)\n        yield accepted()\n        save_spendable_output()\n\n\n        # Test that a block with too many checksigs is rejected\n        too_many_checksigs = CScript([OP_CHECKSIG] * (MAX_BLOCK_SIGOPS))\n        block(16, spend=out[6], script=too_many_checksigs)\n        yield rejected(RejectResult(16, b'bad-blk-sigops'))\n\n\n        # Attempt to spend a transaction created on a different fork\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6  (3)\n        #                                          \\-> b12 (3) -> b13 (4) -> b15 (5) -> b17 (b3.vtx[1])\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(15)\n        block(17, spend=txout_b3)\n        yield rejected(RejectResult(16, b'bad-txns-inputs-missingorspent'))\n\n        # Attempt to spend a transaction created on a different fork (on a fork this time)\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6  (3)\n        #                                          \\-> b12 (3) -> b13 (4) -> b15 (5)\n        #                                                                \\-> b18 (b3.vtx[1]) -> b19 (6)\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(13)\n        block(18, spend=txout_b3)\n        yield rejected()\n\n        block(19, spend=out[6])\n        yield rejected()\n\n        # Attempt to spend a coinbase at depth too low\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6  (3)\n        #                                          \\-> b12 (3) -> b13 (4) -> b15 (5) -> b20 (7)\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(15)\n        block(20, spend=out[7])\n        yield rejected(RejectResult(16, b'bad-txns-premature-spend-of-coinbase'))\n\n        # Attempt to spend a coinbase at depth too low (on a fork this time)\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6  (3)\n        #                                          \\-> b12 (3) -> b13 (4) -> b15 (5)\n        #                                                                \\-> b21 (6) -> b22 (5)\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(13)\n        block(21, spend=out[6])\n        yield rejected()\n\n        block(22, spend=out[5])\n        yield rejected()\n\n        # Create a block on either side of MAX_BLOCK_BASE_SIZE and make sure its accepted/rejected\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6  (3)\n        #                                          \\-> b12 (3) -> b13 (4) -> b15 (5) -> b23 (6)\n        #                                                                           \\-> b24 (6) -> b25 (7)\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(15)\n        b23 = block(23, spend=out[6])\n        tx = CTransaction()\n        script_length = MAX_BLOCK_BASE_SIZE - len(b23.serialize()) - 69\n        script_output = CScript([b'\\x00' * script_length])\n        tx.vout.append(CTxOut(0, script_output))\n        tx.vin.append(CTxIn(COutPoint(b23.vtx[1].sha256, 0)))\n        b23 = update_block(23, [tx])\n        # Make sure the math above worked out to produce a max-sized block\n        assert_equal(len(b23.serialize()), MAX_BLOCK_BASE_SIZE)\n        yield accepted()\n        save_spendable_output()\n\n        # Make the next block one byte bigger and check that it fails\n        tip(15)\n        b24 = block(24, spend=out[6])\n        script_length = MAX_BLOCK_BASE_SIZE - len(b24.serialize()) - 69\n        script_output = CScript([b'\\x00' * (script_length+1)])\n        tx.vout = [CTxOut(0, script_output)]\n        b24 = update_block(24, [tx])\n        assert_equal(len(b24.serialize()), MAX_BLOCK_BASE_SIZE+1)\n        yield rejected(RejectResult(16, b'bad-blk-length'))\n\n        block(25, spend=out[7])\n        yield rejected()\n\n        # Create blocks with a coinbase input script size out of range\n        #     genesis -> b1 (0) -> b2 (1) -> b5 (2) -> b6  (3)\n        #                                          \\-> b12 (3) -> b13 (4) -> b15 (5) -> b23 (6) -> b30 (7)\n        #                                                                           \\-> ... (6) -> ... (7)\n        #                      \\-> b3 (1) -> b4 (2)\n        tip(15)\n        b26 = block(26, spend=out[6])\n        b26.vtx[0].vin[0].scriptSig = b'\\x00'\n        b26.vtx[0].rehash()\n        # update_block causes the merkle root to get updated, even with no new\n        # transactions, and updates the required state.\n        b26 = update_block(26, [])\n        yield rejected(RejectResult(16, b'bad-cb-length'))\n\n        # Extend the b26 chain to make sure bitcoind isn't accepting b26\n        block(27, spend=out[7])\n        yield rejected(False)\n\n        # Now try a too-large-coinbase script\n        tip(15)\n        b28 = block(28, spend=out[6])\n        b28.vtx[0].vin[0].scriptSig = b'\\x00' * 101\n        b28.vtx[0].rehash()\n        b28 = update_block(28, [])\n        yield rejected(RejectResult(16, b'bad-cb-length'))\n\n        # Extend the b28 chain to make sure bitcoind isn't accepting b28\n        block(29, spend=out[7])\n        yield rejected(False)\n\n        # b30 has a max-sized coinbase scriptSig.\n        tip(23)\n        b30 = block(30)\n        b30.vtx[0].vin[0].scriptSig = b'\\x00' * 100\n        b30.vtx[0].rehash()\n        b30 = update_block(30, [])\n        yield accepted()\n        save_spendable_output()\n\n        # b31 - b35 - check sigops of OP_CHECKMULTISIG / OP_CHECKMULTISIGVERIFY / OP_CHECKSIGVERIFY\n        #\n        #     genesis -> ... -> b30 (7) -> b31 (8) -> b33 (9) -> b35 (10)\n        #                                                                \\-> b36 (11)\n        #                                                    \\-> b34 (10)\n        #                                         \\-> b32 (9)\n        #\n\n        # MULTISIG: each op code counts as 20 sigops.  To create the edge case, pack another 19 sigops at the end.\n        lots_of_multisigs = CScript([OP_CHECKMULTISIG] * ((MAX_BLOCK_SIGOPS-1) // 20) + [OP_CHECKSIG] * 19)\n        b31 = block(31, spend=out[8], script=lots_of_multisigs)\n        assert_equal(get_legacy_sigopcount_block(b31), MAX_BLOCK_SIGOPS)\n        yield accepted()\n        save_spendable_output()\n\n        # this goes over the limit because the coinbase has one sigop\n        too_many_multisigs = CScript([OP_CHECKMULTISIG] * (MAX_BLOCK_SIGOPS // 20))\n        b32 = block(32, spend=out[9], script=too_many_multisigs)\n        assert_equal(get_legacy_sigopcount_block(b32), MAX_BLOCK_SIGOPS + 1)\n        yield rejected(RejectResult(16, b'bad-blk-sigops'))\n\n\n        # CHECKMULTISIGVERIFY\n        tip(31)\n        lots_of_multisigs = CScript([OP_CHECKMULTISIGVERIFY] * ((MAX_BLOCK_SIGOPS-1) // 20) + [OP_CHECKSIG] * 19)\n        block(33, spend=out[9], script=lots_of_multisigs)\n        yield accepted()\n        save_spendable_output()\n\n        too_many_multisigs = CScript([OP_CHECKMULTISIGVERIFY] * (MAX_BLOCK_SIGOPS // 20))\n        block(34, spend=out[10], script=too_many_multisigs)\n        yield rejected(RejectResult(16, b'bad-blk-sigops'))\n\n\n        # CHECKSIGVERIFY\n        tip(33)\n        lots_of_checksigs = CScript([OP_CHECKSIGVERIFY] * (MAX_BLOCK_SIGOPS - 1))\n        b35 = block(35, spend=out[10], script=lots_of_checksigs)\n        yield accepted()\n        save_spendable_output()\n\n        too_many_checksigs = CScript([OP_CHECKSIGVERIFY] * (MAX_BLOCK_SIGOPS))\n        block(36, spend=out[11], script=too_many_checksigs)\n        yield rejected(RejectResult(16, b'bad-blk-sigops'))\n\n\n        # Check spending of a transaction in a block which failed to connect\n        #\n        # b6  (3)\n        # b12 (3) -> b13 (4) -> b15 (5) -> b23 (6) -> b30 (7) -> b31 (8) -> b33 (9) -> b35 (10)\n        #                                                                                     \\-> b37 (11)\n        #                                                                                     \\-> b38 (11/37)\n        #\n\n        # save 37's spendable output, but then double-spend out11 to invalidate the block\n        tip(35)\n        b37 = block(37, spend=out[11])\n        txout_b37 = PreviousSpendableOutput(b37.vtx[1], 0)\n        tx = create_and_sign_tx(out[11].tx, out[11].n, 0)\n        b37 = update_block(37, [tx])\n        yield rejected(RejectResult(16, b'bad-txns-inputs-missingorspent'))\n\n        # attempt to spend b37's first non-coinbase tx, at which point b37 was still considered valid\n        tip(35)\n        block(38, spend=txout_b37)\n        yield rejected(RejectResult(16, b'bad-txns-inputs-missingorspent'))\n\n        # Check P2SH SigOp counting\n        #\n        #\n        #   13 (4) -> b15 (5) -> b23 (6) -> b30 (7) -> b31 (8) -> b33 (9) -> b35 (10) -> b39 (11) -> b41 (12)\n        #                                                                                        \\-> b40 (12)\n        #\n        # b39 - create some P2SH outputs that will require 6 sigops to spend:\n        #\n        #           redeem_script = COINBASE_PUBKEY, (OP_2DUP+OP_CHECKSIGVERIFY) * 5, OP_CHECKSIG\n        #           p2sh_script = OP_HASH160, ripemd160(sha256(script)), OP_EQUAL\n        #\n        tip(35)\n        b39 = block(39)\n        b39_outputs = 0\n        b39_sigops_per_output = 6\n\n        # Build the redeem script, hash it, use hash to create the p2sh script\n        redeem_script = CScript([self.coinbase_pubkey] + [OP_2DUP, OP_CHECKSIGVERIFY]*5 + [OP_CHECKSIG])\n        redeem_script_hash = hash160(redeem_script)\n        p2sh_script = CScript([OP_HASH160, redeem_script_hash, OP_EQUAL])\n\n        # Create a transaction that spends one satoshi to the p2sh_script, the rest to OP_TRUE\n        # This must be signed because it is spending a coinbase\n        spend = out[11]\n        tx = create_tx(spend.tx, spend.n, 1, p2sh_script)\n        tx.vout.append(CTxOut(spend.tx.vout[spend.n].nValue - 1, CScript([OP_TRUE])))\n        self.sign_tx(tx, spend.tx, spend.n)\n        tx.rehash()\n        b39 = update_block(39, [tx])\n        b39_outputs += 1\n\n        # Until block is full, add tx's with 1 satoshi to p2sh_script, the rest to OP_TRUE\n        tx_new = None\n        tx_last = tx\n        total_size=len(b39.serialize())\n        while(total_size < MAX_BLOCK_BASE_SIZE):\n            tx_new = create_tx(tx_last, 1, 1, p2sh_script)\n            tx_new.vout.append(CTxOut(tx_last.vout[1].nValue - 1, CScript([OP_TRUE])))\n            tx_new.rehash()\n            total_size += len(tx_new.serialize())\n            if total_size >= MAX_BLOCK_BASE_SIZE:\n                break\n            b39.vtx.append(tx_new) # add tx to block\n            tx_last = tx_new\n            b39_outputs += 1\n\n        b39 = update_block(39, [])\n        yield accepted()\n        save_spendable_output()\n\n\n        # Test sigops in P2SH redeem scripts\n        #\n        # b40 creates 3333 tx's spending the 6-sigop P2SH outputs from b39 for a total of 19998 sigops.\n        # The first tx has one sigop and then at the end we add 2 more to put us just over the max.\n        #\n        # b41 does the same, less one, so it has the maximum sigops permitted.\n        #\n        tip(39)\n        b40 = block(40, spend=out[12])\n        sigops = get_legacy_sigopcount_block(b40)\n        numTxes = (MAX_BLOCK_SIGOPS - sigops) // b39_sigops_per_output\n        assert_equal(numTxes <= b39_outputs, True)\n\n        lastOutpoint = COutPoint(b40.vtx[1].sha256, 0)\n        new_txs = []\n        for i in range(1, numTxes+1):\n            tx = CTransaction()\n            tx.vout.append(CTxOut(1, CScript([OP_TRUE])))\n            tx.vin.append(CTxIn(lastOutpoint, b''))\n            # second input is corresponding P2SH output from b39\n            tx.vin.append(CTxIn(COutPoint(b39.vtx[i].sha256, 0), b''))\n            # Note: must pass the redeem_script (not p2sh_script) to the signature hash function\n            (sighash, err) = SignatureHash(redeem_script, tx, 1, SIGHASH_ALL)\n            sig = self.coinbase_key.sign(sighash) + bytes(bytearray([SIGHASH_ALL]))\n            scriptSig = CScript([sig, redeem_script])\n\n            tx.vin[1].scriptSig = scriptSig\n            tx.rehash()\n            new_txs.append(tx)\n            lastOutpoint = COutPoint(tx.sha256, 0)\n\n        b40_sigops_to_fill = MAX_BLOCK_SIGOPS - (numTxes * b39_sigops_per_output + sigops) + 1\n        tx = CTransaction()\n        tx.vin.append(CTxIn(lastOutpoint, b''))\n        tx.vout.append(CTxOut(1, CScript([OP_CHECKSIG] * b40_sigops_to_fill)))\n        tx.rehash()\n        new_txs.append(tx)\n        update_block(40, new_txs)\n        yield rejected(RejectResult(16, b'bad-blk-sigops'))\n\n        # same as b40, but one less sigop\n        tip(39)\n        block(41, spend=None)\n        update_block(41, b40.vtx[1:-1])\n        b41_sigops_to_fill = b40_sigops_to_fill - 1\n        tx = CTransaction()\n        tx.vin.append(CTxIn(lastOutpoint, b''))\n        tx.vout.append(CTxOut(1, CScript([OP_CHECKSIG] * b41_sigops_to_fill)))\n        tx.rehash()\n        update_block(41, [tx])\n        yield accepted()\n\n        # Fork off of b39 to create a constant base again\n        #\n        # b23 (6) -> b30 (7) -> b31 (8) -> b33 (9) -> b35 (10) -> b39 (11) -> b42 (12) -> b43 (13)\n        #                                                                  \\-> b41 (12)\n        #\n        tip(39)\n        block(42, spend=out[12])\n        yield rejected()\n        save_spendable_output()\n\n        block(43, spend=out[13])\n        yield accepted()\n        save_spendable_output()\n\n\n        # Test a number of really invalid scenarios\n        #\n        #  -> b31 (8) -> b33 (9) -> b35 (10) -> b39 (11) -> b42 (12) -> b43 (13) -> b44 (14)\n        #                                                                                   \\-> ??? (15)\n\n        # The next few blocks are going to be created \"by hand\" since they'll do funky things, such as having\n        # the first transaction be non-coinbase, etc.  The purpose of b44 is to make sure this works.\n        height = self.block_heights[self.tip.sha256] + 1\n        coinbase = create_coinbase(height, self.coinbase_pubkey)\n        b44 = CBlock()\n        b44.nTime = self.tip.nTime + 1\n        b44.hashPrevBlock = self.tip.sha256\n        b44.nBits = 0x207fffff\n        b44.vtx.append(coinbase)\n        b44.hashMerkleRoot = b44.calc_merkle_root()\n        b44.solve()\n        self.tip = b44\n        self.block_heights[b44.sha256] = height\n        self.blocks[44] = b44\n        yield accepted()\n\n        # A block with a non-coinbase as the first tx\n        non_coinbase = create_tx(out[15].tx, out[15].n, 1)\n        b45 = CBlock()\n        b45.nTime = self.tip.nTime + 1\n        b45.hashPrevBlock = self.tip.sha256\n        b45.nBits = 0x207fffff\n        b45.vtx.append(non_coinbase)\n        b45.hashMerkleRoot = b45.calc_merkle_root()\n        b45.calc_sha256()\n        b45.solve()\n        self.block_heights[b45.sha256] = self.block_heights[self.tip.sha256]+1\n        self.tip = b45\n        self.blocks[45] = b45\n        yield rejected(RejectResult(16, b'bad-cb-missing'))\n\n        # A block with no txns\n        tip(44)\n        b46 = CBlock()\n        b46.nTime = b44.nTime+1\n        b46.hashPrevBlock = b44.sha256\n        b46.nBits = 0x207fffff\n        b46.vtx = []\n        b46.hashMerkleRoot = 0\n        b46.solve()\n        self.block_heights[b46.sha256] = self.block_heights[b44.sha256]+1\n        self.tip = b46\n        assert 46 not in self.blocks\n        self.blocks[46] = b46\n        s = ser_uint256(b46.hashMerkleRoot)\n        yield rejected(RejectResult(16, b'bad-blk-length'))\n\n        # A block with invalid work\n        tip(44)\n        b47 = block(47, solve=False)\n        target = uint256_from_compact(b47.nBits)\n        while b47.sha256 < target: #changed > to <\n            b47.nNonce += 1\n            b47.rehash()\n        yield rejected(RejectResult(16, b'high-hash'))\n\n        # A block with timestamp > 2 hrs in the future\n        tip(44)\n        b48 = block(48, solve=False)\n        b48.nTime = int(time.time()) + 60 * 60 * 3\n        b48.solve()\n        yield rejected(RejectResult(16, b'time-too-new'))\n\n        # A block with an invalid merkle hash\n        tip(44)\n        b49 = block(49)\n        b49.hashMerkleRoot += 1\n        b49.solve()\n        yield rejected(RejectResult(16, b'bad-txnmrklroot'))\n\n        # A block with an incorrect POW limit\n        tip(44)\n        b50 = block(50)\n        b50.nBits = b50.nBits - 1\n        b50.solve()\n        yield rejected(RejectResult(16, b'bad-diffbits'))\n\n        # A block with two coinbase txns\n        tip(44)\n        b51 = block(51)\n        cb2 = create_coinbase(51, self.coinbase_pubkey)\n        b51 = update_block(51, [cb2])\n        yield rejected(RejectResult(16, b'bad-cb-multiple'))\n\n        # A block w/ duplicate txns\n        # Note: txns have to be in the right position in the merkle tree to trigger this error\n        tip(44)\n        b52 = block(52, spend=out[15])\n        tx = create_tx(b52.vtx[1], 0, 1)\n        b52 = update_block(52, [tx, tx])\n        yield rejected(RejectResult(16, b'bad-txns-duplicate'))\n\n        # Test block timestamps\n        #  -> b31 (8) -> b33 (9) -> b35 (10) -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15)\n        #                                                                                   \\-> b54 (15)\n        #\n        tip(43)\n        block(53, spend=out[14])\n        yield rejected() # rejected since b44 is at same height\n        save_spendable_output()\n\n        # invalid timestamp (b35 is 5 blocks back, so its time is MedianTimePast)\n        b54 = block(54, spend=out[15])\n        b54.nTime = b35.nTime - 1\n        b54.solve()\n        yield rejected(RejectResult(16, b'time-too-old'))\n\n        # valid timestamp\n        tip(53)\n        b55 = block(55, spend=out[15])\n        b55.nTime = b35.nTime\n        update_block(55, [])\n        yield accepted()\n        save_spendable_output()\n\n\n        # Test CVE-2012-2459\n        #\n        # -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57p2 (16)\n        #                                                \\-> b57   (16)\n        #                                                \\-> b56p2 (16)\n        #                                                \\-> b56   (16)\n        #\n        # Merkle tree malleability (CVE-2012-2459): repeating sequences of transactions in a block without \n        #                           affecting the merkle root of a block, while still invalidating it.\n        #                           See:  src/consensus/merkle.h\n        #\n        #  b57 has three txns:  coinbase, tx, tx1.  The merkle root computation will duplicate tx.\n        #  Result:  OK\n        #\n        #  b56 copies b57 but duplicates tx1 and does not recalculate the block hash.  So it has a valid merkle\n        #  root but duplicate transactions.\n        #  Result:  Fails\n        #\n        #  b57p2 has six transactions in its merkle tree:\n        #       - coinbase, tx, tx1, tx2, tx3, tx4\n        #  Merkle root calculation will duplicate as necessary.\n        #  Result:  OK.\n        #\n        #  b56p2 copies b57p2 but adds both tx3 and tx4.  The purpose of the test is to make sure the code catches\n        #  duplicate txns that are not next to one another with the \"bad-txns-duplicate\" error (which indicates\n        #  that the error was caught early, avoiding a DOS vulnerability.)\n\n        # b57 - a good block with 2 txs, don't submit until end\n        tip(55)\n        b57 = block(57)\n        tx = create_and_sign_tx(out[16].tx, out[16].n, 1)\n        tx1 = create_tx(tx, 0, 1)\n        b57 = update_block(57, [tx, tx1])\n\n        # b56 - copy b57, add a duplicate tx\n        tip(55)\n        b56 = copy.deepcopy(b57)\n        self.blocks[56] = b56\n        assert_equal(len(b56.vtx),3)\n        b56 = update_block(56, [tx1])\n        assert_equal(b56.hash, b57.hash)\n        yield rejected(RejectResult(16, b'bad-txns-duplicate'))\n\n        # b57p2 - a good block with 6 tx'es, don't submit until end\n        tip(55)\n        b57p2 = block(\"57p2\")\n        tx = create_and_sign_tx(out[16].tx, out[16].n, 1)\n        tx1 = create_tx(tx, 0, 1)\n        tx2 = create_tx(tx1, 0, 1)\n        tx3 = create_tx(tx2, 0, 1)\n        tx4 = create_tx(tx3, 0, 1)\n        b57p2 = update_block(\"57p2\", [tx, tx1, tx2, tx3, tx4])\n\n        # b56p2 - copy b57p2, duplicate two non-consecutive tx's\n        tip(55)\n        b56p2 = copy.deepcopy(b57p2)\n        self.blocks[\"b56p2\"] = b56p2\n        assert_equal(b56p2.hash, b57p2.hash)\n        assert_equal(len(b56p2.vtx),6)\n        b56p2 = update_block(\"b56p2\", [tx3, tx4])\n        yield rejected(RejectResult(16, b'bad-txns-duplicate'))\n\n        tip(\"57p2\")\n        yield accepted()\n\n        tip(57)\n        yield rejected()  #rejected because 57p2 seen first\n        save_spendable_output()\n\n        # Test a few invalid tx types\n        #\n        # -> b35 (10) -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17)\n        #                                                                                    \\-> ??? (17)\n        #\n\n        # tx with prevout.n out of range\n        tip(57)\n        b58 = block(58, spend=out[17])\n        tx = CTransaction()\n        assert(len(out[17].tx.vout) < 42)\n        tx.vin.append(CTxIn(COutPoint(out[17].tx.sha256, 42), CScript([OP_TRUE]), 0xffffffff))\n        tx.vout.append(CTxOut(0, b\"\"))\n        tx.calc_sha256()\n        b58 = update_block(58, [tx])\n        yield rejected(RejectResult(16, b'bad-txns-inputs-missingorspent'))\n\n        # tx with output value > input value out of range\n        tip(57)\n        b59 = block(59)\n        tx = create_and_sign_tx(out[17].tx, out[17].n, 51*COIN)\n        b59 = update_block(59, [tx])\n        yield rejected(RejectResult(16, b'bad-txns-in-belowout'))\n\n        # reset to good chain\n        tip(57)\n        b60 = block(60, spend=out[17])\n        yield accepted()\n        save_spendable_output()\n\n        # Test BIP30\n        #\n        # -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17)\n        #                                                                                    \\-> b61 (18)\n        #\n        # Blocks are not allowed to contain a transaction whose id matches that of an earlier,\n        # not-fully-spent transaction in the same chain. To test, make identical coinbases;\n        # the second one should be rejected.\n        #\n        tip(60)\n        b61 = block(61, spend=out[18])\n        b61.vtx[0].vin[0].scriptSig = b60.vtx[0].vin[0].scriptSig  #equalize the coinbases\n        b61.vtx[0].rehash()\n        b61 = update_block(61, [])\n        assert_equal(b60.vtx[0].serialize(), b61.vtx[0].serialize())\n        yield rejected(RejectResult(16, b'bad-txns-BIP30'))\n\n\n        # Test tx.isFinal is properly rejected (not an exhaustive tx.isFinal test, that should be in data-driven transaction tests)\n        #\n        #   -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17)\n        #                                                                                     \\-> b62 (18)\n        #\n        tip(60)\n        b62 = block(62)\n        tx = CTransaction()\n        tx.nLockTime = 0xffffffff  #this locktime is non-final\n        assert(out[18].n < len(out[18].tx.vout))\n        tx.vin.append(CTxIn(COutPoint(out[18].tx.sha256, out[18].n))) # don't set nSequence\n        tx.vout.append(CTxOut(0, CScript([OP_TRUE])))\n        assert(tx.vin[0].nSequence < 0xffffffff)\n        tx.calc_sha256()\n        b62 = update_block(62, [tx])\n        yield rejected(RejectResult(16, b'bad-txns-nonfinal'))\n\n\n        # Test a non-final coinbase is also rejected\n        #\n        #   -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17)\n        #                                                                                     \\-> b63 (-)\n        #\n        tip(60)\n        b63 = block(63)\n        b63.vtx[0].nLockTime = 0xffffffff\n        b63.vtx[0].vin[0].nSequence = 0xDEADBEEF\n        b63.vtx[0].rehash()\n        b63 = update_block(63, [])\n        yield rejected(RejectResult(16, b'bad-txns-nonfinal'))\n\n\n        #  This checks that a block with a bloated VARINT between the block_header and the array of tx such that\n        #  the block is > MAX_BLOCK_BASE_SIZE with the bloated varint, but <= MAX_BLOCK_BASE_SIZE without the bloated varint,\n        #  does not cause a subsequent, identical block with canonical encoding to be rejected.  The test does not\n        #  care whether the bloated block is accepted or rejected; it only cares that the second block is accepted.\n        #\n        #  What matters is that the receiving node should not reject the bloated block, and then reject the canonical\n        #  block on the basis that it's the same as an already-rejected block (which would be a consensus failure.)\n        #\n        #  -> b39 (11) -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18)\n        #                                                                                        \\\n        #                                                                                         b64a (18)\n        #  b64a is a bloated block (non-canonical varint)\n        #  b64 is a good block (same as b64 but w/ canonical varint)\n        #\n        tip(60)\n        regular_block = block(\"64a\", spend=out[18])\n\n        # make it a \"broken_block,\" with non-canonical serialization\n        b64a = CBrokenBlock(regular_block)\n        b64a.initialize(regular_block)\n        self.blocks[\"64a\"] = b64a\n        self.tip = b64a\n        tx = CTransaction()\n\n        # use canonical serialization to calculate size\n        script_length = MAX_BLOCK_BASE_SIZE - len(b64a.normal_serialize()) - 69\n        script_output = CScript([b'\\x00' * script_length])\n        tx.vout.append(CTxOut(0, script_output))\n        tx.vin.append(CTxIn(COutPoint(b64a.vtx[1].sha256, 0)))\n        b64a = update_block(\"64a\", [tx])\n        assert_equal(len(b64a.serialize()), MAX_BLOCK_BASE_SIZE + 8)\n        yield TestInstance([[self.tip, None]])\n\n        # comptool workaround: to make sure b64 is delivered, manually erase b64a from blockstore\n        self.test.block_store.erase(b64a.sha256)\n\n        tip(60)\n        b64 = CBlock(b64a)\n        b64.vtx = copy.deepcopy(b64a.vtx)\n        assert_equal(b64.hash, b64a.hash)\n        assert_equal(len(b64.serialize()), MAX_BLOCK_BASE_SIZE)\n        self.blocks[64] = b64\n        update_block(64, [])\n        yield accepted()\n        save_spendable_output()\n\n        # Spend an output created in the block itself\n        #\n        # -> b42 (12) -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19)\n        #\n        tip(64)\n        block(65)\n        tx1 = create_and_sign_tx(out[19].tx, out[19].n, out[19].tx.vout[0].nValue)\n        tx2 = create_and_sign_tx(tx1, 0, 0)\n        update_block(65, [tx1, tx2])\n        yield accepted()\n        save_spendable_output()\n\n        # Attempt to spend an output created later in the same block\n        #\n        # -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19)\n        #                                                                                    \\-> b66 (20)\n        tip(65)\n        block(66)\n        tx1 = create_and_sign_tx(out[20].tx, out[20].n, out[20].tx.vout[0].nValue)\n        tx2 = create_and_sign_tx(tx1, 0, 1)\n        update_block(66, [tx2, tx1])\n        yield rejected(RejectResult(16, b'bad-txns-inputs-missingorspent'))\n\n        # Attempt to double-spend a transaction created in a block\n        #\n        # -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19)\n        #                                                                                    \\-> b67 (20)\n        #\n        #\n        tip(65)\n        block(67)\n        tx1 = create_and_sign_tx(out[20].tx, out[20].n, out[20].tx.vout[0].nValue)\n        tx2 = create_and_sign_tx(tx1, 0, 1)\n        tx3 = create_and_sign_tx(tx1, 0, 2)\n        update_block(67, [tx1, tx2, tx3])\n        yield rejected(RejectResult(16, b'bad-txns-inputs-missingorspent'))\n\n        # More tests of block subsidy\n        #\n        # -> b43 (13) -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19) -> b69 (20)\n        #                                                                                    \\-> b68 (20)\n        #\n        # b68 - coinbase with an extra 10 satoshis,\n        #       creates a tx that has 9 satoshis from out[20] go to fees\n        #       this fails because the coinbase is trying to claim 1 satoshi too much in fees\n        #\n        # b69 - coinbase with extra 10 satoshis, and a tx that gives a 10 satoshi fee\n        #       this succeeds\n        #\n        tip(65)\n        block(68, additional_coinbase_value=10)\n        tx = create_and_sign_tx(out[20].tx, out[20].n, out[20].tx.vout[0].nValue-9)\n        update_block(68, [tx])\n        yield rejected(RejectResult(16, b'bad-cb-amount'))\n\n        tip(65)\n        b69 = block(69, additional_coinbase_value=10)\n        tx = create_and_sign_tx(out[20].tx, out[20].n, out[20].tx.vout[0].nValue-10)\n        update_block(69, [tx])\n        yield accepted()\n        save_spendable_output()\n\n        # Test spending the outpoint of a non-existent transaction\n        #\n        # -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19) -> b69 (20)\n        #                                                                                    \\-> b70 (21)\n        #\n        tip(69)\n        block(70, spend=out[21])\n        bogus_tx = CTransaction()\n        bogus_tx.sha256 = uint256_from_str(b\"23c70ed7c0506e9178fc1a987f40a33946d4ad4c962b5ae3a52546da53af0c5c\")\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(bogus_tx.sha256, 0), b\"\", 0xffffffff))\n        tx.vout.append(CTxOut(1, b\"\"))\n        update_block(70, [tx])\n        yield rejected(RejectResult(16, b'bad-txns-inputs-missingorspent'))\n\n\n        # Test accepting an invalid block which has the same hash as a valid one (via merkle tree tricks)\n        #\n        #  -> b53 (14) -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19) -> b69 (20) -> b72 (21)\n        #                                                                                      \\-> b71 (21)\n        #\n        # b72 is a good block.\n        # b71 is a copy of 72, but re-adds one of its transactions.  However, it has the same hash as b71.\n        #\n        tip(69)\n        b72 = block(72)\n        tx1 = create_and_sign_tx(out[21].tx, out[21].n, 2)\n        tx2 = create_and_sign_tx(tx1, 0, 1)\n        b72 = update_block(72, [tx1, tx2])  # now tip is 72\n        b71 = copy.deepcopy(b72)\n        b71.vtx.append(tx2)   # add duplicate tx2\n        self.block_heights[b71.sha256] = self.block_heights[b69.sha256] + 1  # b71 builds off b69\n        self.blocks[71] = b71\n\n        assert_equal(len(b71.vtx), 4)\n        assert_equal(len(b72.vtx), 3)\n        assert_equal(b72.sha256, b71.sha256)\n\n        tip(71)\n        yield rejected(RejectResult(16, b'bad-txns-duplicate'))\n        tip(72)\n        yield accepted()\n        save_spendable_output()\n\n\n        # Test some invalid scripts and MAX_BLOCK_SIGOPS\n        #\n        # -> b55 (15) -> b57 (16) -> b60 (17) -> b64 (18) -> b65 (19) -> b69 (20) -> b72 (21)\n        #                                                                                    \\-> b** (22)\n        #\n\n        # b73 - tx with excessive sigops that are placed after an excessively large script element.\n        #       The purpose of the test is to make sure those sigops are counted.\n        #\n        #       script is a bytearray of size 20,526\n        #\n        #       bytearray[0-19,998]     : OP_CHECKSIG\n        #       bytearray[19,999]       : OP_PUSHDATA4\n        #       bytearray[20,000-20,003]: 521  (max_script_element_size+1, in little-endian format)\n        #       bytearray[20,004-20,525]: unread data (script_element)\n        #       bytearray[20,526]       : OP_CHECKSIG (this puts us over the limit)\n        #\n        tip(72)\n        b73 = block(73)\n        size = MAX_BLOCK_SIGOPS - 1 + MAX_SCRIPT_ELEMENT_SIZE + 1 + 5 + 1\n        a = bytearray([OP_CHECKSIG] * size)\n        a[MAX_BLOCK_SIGOPS - 1] = int(\"4e\",16) # OP_PUSHDATA4\n\n        element_size = MAX_SCRIPT_ELEMENT_SIZE + 1\n        a[MAX_BLOCK_SIGOPS] = element_size % 256\n        a[MAX_BLOCK_SIGOPS+1] = element_size // 256\n        a[MAX_BLOCK_SIGOPS+2] = 0\n        a[MAX_BLOCK_SIGOPS+3] = 0\n\n        tx = create_and_sign_tx(out[22].tx, 0, 1, CScript(a))\n        b73 = update_block(73, [tx])\n        assert_equal(get_legacy_sigopcount_block(b73), MAX_BLOCK_SIGOPS+1)\n        yield rejected(RejectResult(16, b'bad-blk-sigops'))\n\n        # b74/75 - if we push an invalid script element, all prevous sigops are counted,\n        #          but sigops after the element are not counted.\n        #\n        #       The invalid script element is that the push_data indicates that\n        #       there will be a large amount of data (0xffffff bytes), but we only\n        #       provide a much smaller number.  These bytes are CHECKSIGS so they would\n        #       cause b75 to fail for excessive sigops, if those bytes were counted.\n        #\n        #       b74 fails because we put MAX_BLOCK_SIGOPS+1 before the element\n        #       b75 succeeds because we put MAX_BLOCK_SIGOPS before the element\n        #\n        #\n        tip(72)\n        b74 = block(74)\n        size = MAX_BLOCK_SIGOPS - 1 + MAX_SCRIPT_ELEMENT_SIZE + 42 # total = 20,561\n        a = bytearray([OP_CHECKSIG] * size)\n        a[MAX_BLOCK_SIGOPS] = 0x4e\n        a[MAX_BLOCK_SIGOPS+1] = 0xfe\n        a[MAX_BLOCK_SIGOPS+2] = 0xff\n        a[MAX_BLOCK_SIGOPS+3] = 0xff\n        a[MAX_BLOCK_SIGOPS+4] = 0xff\n        tx = create_and_sign_tx(out[22].tx, 0, 1, CScript(a))\n        b74 = update_block(74, [tx])\n        yield rejected(RejectResult(16, b'bad-blk-sigops'))\n\n        tip(72)\n        b75 = block(75)\n        size = MAX_BLOCK_SIGOPS - 1 + MAX_SCRIPT_ELEMENT_SIZE + 42\n        a = bytearray([OP_CHECKSIG] * size)\n        a[MAX_BLOCK_SIGOPS-1] = 0x4e\n        a[MAX_BLOCK_SIGOPS] = 0xff\n        a[MAX_BLOCK_SIGOPS+1] = 0xff\n        a[MAX_BLOCK_SIGOPS+2] = 0xff\n        a[MAX_BLOCK_SIGOPS+3] = 0xff\n        tx = create_and_sign_tx(out[22].tx, 0, 1, CScript(a))\n        b75 = update_block(75, [tx])\n        yield accepted()\n        save_spendable_output()\n\n        # Check that if we push an element filled with CHECKSIGs, they are not counted\n        tip(75)\n        b76 = block(76)\n        size = MAX_BLOCK_SIGOPS - 1 + MAX_SCRIPT_ELEMENT_SIZE + 1 + 5\n        a = bytearray([OP_CHECKSIG] * size)\n        a[MAX_BLOCK_SIGOPS-1] = 0x4e # PUSHDATA4, but leave the following bytes as just checksigs\n        tx = create_and_sign_tx(out[23].tx, 0, 1, CScript(a))\n        b76 = update_block(76, [tx])\n        yield accepted()\n        save_spendable_output()\n\n        # Test transaction resurrection\n        #\n        # -> b77 (24) -> b78 (25) -> b79 (26)\n        #            \\-> b80 (25) -> b81 (26) -> b82 (27)\n        #\n        #    b78 creates a tx, which is spent in b79. After b82, both should be in mempool\n        #\n        #    The tx'es must be unsigned and pass the node's mempool policy.  It is unsigned for the\n        #    rather obscure reason that the Python signature code does not distinguish between\n        #    Low-S and High-S values (whereas the bitcoin code has custom code which does so);\n        #    as a result of which, the odds are 50% that the python code will use the right\n        #    value and the transaction will be accepted into the mempool. Until we modify the\n        #    test framework to support low-S signing, we are out of luck.\n        #\n        #    To get around this issue, we construct transactions which are not signed and which\n        #    spend to OP_TRUE.  If the standard-ness rules change, this test would need to be\n        #    updated.  (Perhaps to spend to a P2SH OP_TRUE script)\n        #\n        tip(76)\n        block(77)\n        tx77 = create_and_sign_tx(out[24].tx, out[24].n, 10*COIN)\n        update_block(77, [tx77])\n        yield accepted()\n        save_spendable_output()\n\n        block(78)\n        tx78 = create_tx(tx77, 0, 9*COIN)\n        update_block(78, [tx78])\n        yield accepted()\n\n        block(79)\n        tx79 = create_tx(tx78, 0, 8*COIN)\n        update_block(79, [tx79])\n        yield accepted()\n\n        # mempool should be empty\n        assert_equal(len(self.nodes[0].getrawmempool()), 0)\n\n        tip(77)\n        block(80, spend=out[25])\n        yield rejected()\n        save_spendable_output()\n\n        block(81, spend=out[26])\n        yield rejected() # other chain is same length\n        save_spendable_output()\n\n        block(82, spend=out[27])\n        yield accepted()  # now this chain is longer, triggers re-org\n        save_spendable_output()\n\n        # now check that tx78 and tx79 have been put back into the peer's mempool\n        mempool = self.nodes[0].getrawmempool()\n        assert_equal(len(mempool), 2)\n        assert(tx78.hash in mempool)\n        assert(tx79.hash in mempool)\n\n\n        # Test invalid opcodes in dead execution paths.\n        #\n        #  -> b81 (26) -> b82 (27) -> b83 (28)\n        #\n        block(83)\n        op_codes = [OP_IF, OP_INVALIDOPCODE, OP_ELSE, OP_TRUE, OP_ENDIF]\n        script = CScript(op_codes)\n        tx1 = create_and_sign_tx(out[28].tx, out[28].n, out[28].tx.vout[0].nValue, script)\n\n        tx2 = create_and_sign_tx(tx1, 0, 0, CScript([OP_TRUE]))\n        tx2.vin[0].scriptSig = CScript([OP_FALSE])\n        tx2.rehash()\n\n        update_block(83, [tx1, tx2])\n        yield accepted()\n        save_spendable_output()\n\n\n        # Reorg on/off blocks that have OP_RETURN in them (and try to spend them)\n        #\n        #  -> b81 (26) -> b82 (27) -> b83 (28) -> b84 (29) -> b87 (30) -> b88 (31)\n        #                                    \\-> b85 (29) -> b86 (30)            \\-> b89a (32)\n        #\n        #\n        block(84)\n        tx1 = create_tx(out[29].tx, out[29].n, 0, CScript([OP_RETURN]))\n        tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))\n        tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))\n        tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))\n        tx1.vout.append(CTxOut(0, CScript([OP_TRUE])))\n        tx1.calc_sha256()\n        self.sign_tx(tx1, out[29].tx, out[29].n)\n        tx1.rehash()\n        tx2 = create_tx(tx1, 1, 0, CScript([OP_RETURN]))\n        tx2.vout.append(CTxOut(0, CScript([OP_RETURN])))\n        tx3 = create_tx(tx1, 2, 0, CScript([OP_RETURN]))\n        tx3.vout.append(CTxOut(0, CScript([OP_TRUE])))\n        tx4 = create_tx(tx1, 3, 0, CScript([OP_TRUE]))\n        tx4.vout.append(CTxOut(0, CScript([OP_RETURN])))\n        tx5 = create_tx(tx1, 4, 0, CScript([OP_RETURN]))\n\n        update_block(84, [tx1,tx2,tx3,tx4,tx5])\n        yield accepted()\n        save_spendable_output()\n\n        tip(83)\n        block(85, spend=out[29])\n        yield rejected()\n\n        block(86, spend=out[30])\n        yield accepted()\n\n        tip(84)\n        block(87, spend=out[30])\n        yield rejected()\n        save_spendable_output()\n\n        block(88, spend=out[31])\n        yield accepted()\n        save_spendable_output()\n\n        # trying to spend the OP_RETURN output is rejected\n        block(\"89a\", spend=out[32])\n        tx = create_tx(tx1, 0, 0, CScript([OP_TRUE]))\n        update_block(\"89a\", [tx])\n        yield rejected()\n\n\n        #  Test re-org of a week's worth of blocks (1088 blocks)\n        #  This test takes a minute or two and can be accomplished in memory\n        #\n        if self.options.runbarelyexpensive:\n            tip(88)\n            LARGE_REORG_SIZE = 1088\n            test1 = TestInstance(sync_every_block=False)\n            spend=out[32]\n            for i in range(89, LARGE_REORG_SIZE + 89):\n                b = block(i, spend)\n                tx = CTransaction()\n                script_length = MAX_BLOCK_BASE_SIZE - len(b.serialize()) - 69\n                script_output = CScript([b'\\x00' * script_length])\n                tx.vout.append(CTxOut(0, script_output))\n                tx.vin.append(CTxIn(COutPoint(b.vtx[1].sha256, 0)))\n                b = update_block(i, [tx])\n                assert_equal(len(b.serialize()), MAX_BLOCK_BASE_SIZE)\n                test1.blocks_and_transactions.append([self.tip, True])\n                save_spendable_output()\n                spend = get_spendable_output()\n\n            yield test1\n            chain1_tip = i\n\n            # now create alt chain of same length\n            tip(88)\n            test2 = TestInstance(sync_every_block=False)\n            for i in range(89, LARGE_REORG_SIZE + 89):\n                block(\"alt\"+str(i))\n                test2.blocks_and_transactions.append([self.tip, False])\n            yield test2\n\n            # extend alt chain to trigger re-org\n            block(\"alt\" + str(chain1_tip + 1))\n            yield accepted()\n\n            # ... and re-org back to the first chain\n            tip(chain1_tip)\n            block(chain1_tip + 1)\n            yield rejected()\n            block(chain1_tip + 2)\n            yield accepted()\n\n            chain1_tip += 2\n\n\nif __name__ == '__main__':\n    FullBlockTest().main()\n"
  },
  {
    "path": "test/functional/feature_cltv.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test BIP65 (CHECKLOCKTIMEVERIFY).\n\nTest that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) block height\n1351.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import *\nfrom test_framework.blocktools import create_coinbase, create_block\nfrom test_framework.script import CScript, OP_1NEGATE, OP_CHECKLOCKTIMEVERIFY, OP_DROP, CScriptNum\nfrom io import BytesIO\n\nCLTV_HEIGHT = 1351\n\n# Reject codes that we might receive in this test\nREJECT_INVALID = 16\nREJECT_OBSOLETE = 17\nREJECT_NONSTANDARD = 64\n\ndef cltv_invalidate(tx):\n    '''Modify the signature in vin 0 of the tx to fail CLTV\n\n    Prepends -1 CLTV DROP in the scriptSig itself.\n\n    TODO: test more ways that transactions using CLTV could be invalid (eg\n    locktime requirements fail, sequence time requirements fail, etc).\n    '''\n    tx.vin[0].scriptSig = CScript([OP_1NEGATE, OP_CHECKLOCKTIMEVERIFY, OP_DROP] +\n                                  list(CScript(tx.vin[0].scriptSig)))\n\ndef cltv_validate(node, tx, height):\n    '''Modify the signature in vin 0 of the tx to pass CLTV\n    Prepends <height> CLTV DROP in the scriptSig, and sets\n    the locktime to height'''\n    tx.vin[0].nSequence = 0\n    tx.nLockTime = height\n\n    # Need to re-sign, since nSequence and nLockTime changed\n    signed_result = node.signrawtransaction(ToHex(tx))\n    new_tx = CTransaction()\n    new_tx.deserialize(BytesIO(hex_str_to_bytes(signed_result['hex'])))\n\n    new_tx.vin[0].scriptSig = CScript([CScriptNum(height), OP_CHECKLOCKTIMEVERIFY, OP_DROP] +\n                                  list(CScript(new_tx.vin[0].scriptSig)))\n    return new_tx\n\ndef create_transaction(node, coinbase, to_address, amount):\n    from_txid = node.getblock(coinbase)['tx'][0]\n    inputs = [{ \"txid\" : from_txid, \"vout\" : 0}]\n    outputs = { to_address : amount }\n    rawtx = node.createrawtransaction(inputs, outputs)\n    signresult = node.signrawtransaction(rawtx)\n    tx = CTransaction()\n    tx.deserialize(BytesIO(hex_str_to_bytes(signresult['hex'])))\n    return tx\n\nclass BIP65Test(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.extra_args = [['-promiscuousmempoolflags=1', '-whitelist=127.0.0.1']]\n        self.setup_clean_chain = True\n\n    def run_test(self):\n        self.nodes[0].add_p2p_connection(P2PInterface())\n\n        network_thread_start()\n\n        # wait_for_verack ensures that the P2P connection is fully up.\n        self.nodes[0].p2p.wait_for_verack()\n\n        self.log.info(\"Mining %d blocks\", CLTV_HEIGHT - 2)\n        self.coinbase_blocks = self.nodes[0].generate(CLTV_HEIGHT - 2)\n        self.nodeaddress = self.nodes[0].getnewaddress()\n\n        self.log.info(\"Test that an invalid-according-to-CLTV transaction can still appear in a block\")\n\n        spendtx = create_transaction(self.nodes[0], self.coinbase_blocks[0],\n                self.nodeaddress, 1.0)\n        cltv_invalidate(spendtx)\n        spendtx.rehash()\n\n        tip = self.nodes[0].getbestblockhash()\n        block_time = self.nodes[0].getblockheader(tip)['mediantime'] + 1\n        block = create_block(int(tip, 16), create_coinbase(CLTV_HEIGHT - 1), block_time)\n        block.nVersion = 3\n        block.vtx.append(spendtx)\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.solve()\n\n        self.nodes[0].p2p.send_and_ping(msg_block(block))\n        assert_equal(self.nodes[0].getbestblockhash(), block.hash)\n\n        self.log.info(\"Test that blocks must now be at least version 4\")\n        tip = block.sha256\n        block_time += 1\n        block = create_block(tip, create_coinbase(CLTV_HEIGHT), block_time)\n        block.nVersion = 3\n        block.solve()\n        self.nodes[0].p2p.send_and_ping(msg_block(block))\n        assert_equal(int(self.nodes[0].getbestblockhash(), 16), tip)\n\n        wait_until(lambda: \"reject\" in self.nodes[0].p2p.last_message.keys(), lock=mininode_lock)\n        with mininode_lock:\n            assert_equal(self.nodes[0].p2p.last_message[\"reject\"].code, REJECT_OBSOLETE)\n            assert_equal(self.nodes[0].p2p.last_message[\"reject\"].reason, b'bad-version(0x00000003)')\n            assert_equal(self.nodes[0].p2p.last_message[\"reject\"].data, block.sha256)\n            del self.nodes[0].p2p.last_message[\"reject\"]\n\n        self.log.info(\"Test that invalid-according-to-cltv transactions cannot appear in a block\")\n        block.nVersion = 4\n\n        spendtx = create_transaction(self.nodes[0], self.coinbase_blocks[1],\n                self.nodeaddress, 1.0)\n        cltv_invalidate(spendtx)\n        spendtx.rehash()\n\n        # First we show that this tx is valid except for CLTV by getting it\n        # accepted to the mempool (which we can achieve with\n        # -promiscuousmempoolflags).\n        self.nodes[0].p2p.send_and_ping(msg_tx(spendtx))\n        assert spendtx.hash in self.nodes[0].getrawmempool()\n\n        # Now we verify that a block with this transaction is invalid.\n        block.vtx.append(spendtx)\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.solve()\n\n        self.nodes[0].p2p.send_and_ping(msg_block(block))\n        assert_equal(int(self.nodes[0].getbestblockhash(), 16), tip)\n\n        wait_until(lambda: \"reject\" in self.nodes[0].p2p.last_message.keys(), lock=mininode_lock)\n        with mininode_lock:\n            assert self.nodes[0].p2p.last_message[\"reject\"].code in [REJECT_INVALID, REJECT_NONSTANDARD]\n            assert_equal(self.nodes[0].p2p.last_message[\"reject\"].data, block.sha256)\n            if self.nodes[0].p2p.last_message[\"reject\"].code == REJECT_INVALID:\n                # Generic rejection when a block is invalid\n                assert_equal(self.nodes[0].p2p.last_message[\"reject\"].reason, b'block-validation-failed')\n            else:\n                assert b'Negative locktime' in self.nodes[0].p2p.last_message[\"reject\"].reason\n\n        self.log.info(\"Test that a version 4 block with a valid-according-to-CLTV transaction is accepted\")\n        spendtx = cltv_validate(self.nodes[0], spendtx, CLTV_HEIGHT - 1)\n        spendtx.rehash()\n\n        block.vtx.pop(1)\n        block.vtx.append(spendtx)\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.solve()\n\n        self.nodes[0].p2p.send_and_ping(msg_block(block))\n        assert_equal(int(self.nodes[0].getbestblockhash(), 16), block.sha256)\n\n\nif __name__ == '__main__':\n    BIP65Test().main()\n"
  },
  {
    "path": "test/functional/feature_config_args.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test various command line arguments and configuration file parameters.\"\"\"\n\nimport os\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import get_datadir_path\n\nclass ConfArgsTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    def run_test(self):\n        self.stop_node(0)\n        # Remove the -datadir argument so it doesn't override the config file\n        self.nodes[0].args = [arg for arg in self.nodes[0].args if not arg.startswith(\"-datadir\")]\n\n        default_data_dir = get_datadir_path(self.options.tmpdir, 0)\n        new_data_dir = os.path.join(default_data_dir, 'newdatadir')\n        new_data_dir_2 = os.path.join(default_data_dir, 'newdatadir2')\n\n        # Check that using -datadir argument on non-existent directory fails\n        self.nodes[0].datadir = new_data_dir\n        self.assert_start_raises_init_error(0, ['-datadir='+new_data_dir], 'Error: Specified data directory \"' + new_data_dir + '\" does not exist.')\n\n        # Check that using non-existent datadir in conf file fails\n        conf_file = os.path.join(default_data_dir, \"bitcoin.conf\")\n        with open(conf_file, 'a', encoding='utf8') as f:\n            f.write(\"datadir=\" + new_data_dir + \"\\n\")\n        self.assert_start_raises_init_error(0, ['-conf='+conf_file], 'Error reading configuration file: specified data directory \"' + new_data_dir + '\" does not exist.')\n\n        # Create the directory and ensure the config file now works\n        os.mkdir(new_data_dir)\n        self.start_node(0, ['-conf='+conf_file, '-wallet=w1'])\n        self.stop_node(0)\n        assert os.path.isfile(os.path.join(new_data_dir, 'regtest', 'wallets', 'w1'))\n\n        # Ensure command line argument overrides datadir in conf\n        os.mkdir(new_data_dir_2)\n        self.nodes[0].datadir = new_data_dir_2\n        self.start_node(0, ['-datadir='+new_data_dir_2, '-conf='+conf_file, '-wallet=w2'])\n        assert os.path.isfile(os.path.join(new_data_dir_2, 'regtest', 'wallets', 'w2'))\n\nif __name__ == '__main__':\n    ConfArgsTest().main()\n"
  },
  {
    "path": "test/functional/feature_csv_activation.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test activation of the first version bits soft fork.\n\nThis soft fork will activate the following BIPS:\nBIP 68  - nSequence relative lock times\nBIP 112 - CHECKSEQUENCEVERIFY\nBIP 113 - MedianTimePast semantics for nLockTime\n\nregtest lock-in with 108/144 block signalling\nactivation after a further 144 blocks\n\nmine 82 blocks whose coinbases will be used to generate inputs for our tests\nmine 61 blocks to transition from DEFINED to STARTED\nmine 144 blocks only 100 of which are signaling readiness in order to fail to change state this period\nmine 144 blocks with 108 signaling and verify STARTED->LOCKED_IN\nmine 140 blocks and seed block chain with the 82 inputs will use for our tests at height 572\nmine 3 blocks and verify still at LOCKED_IN and test that enforcement has not triggered\nmine 1 block and test that enforcement has triggered (which triggers ACTIVE)\nTest BIP 113 is enforced\nMine 4 blocks so next height is 580 and test BIP 68 is enforced for time and height\nMine 1 block so next height is 581 and test BIP 68 now passes time but not height\nMine 1 block so next height is 582 and test BIP 68 now passes time and height\nTest that BIP 112 is enforced\n\nVarious transactions will be used to test that the BIPs rules are not enforced before the soft fork activates\nAnd that after the soft fork activates transactions pass and fail as they should according to the rules.\nFor each BIP, transactions of versions 1 and 2 will be tested.\n----------------\nBIP 113:\nbip113tx - modify the nLocktime variable\n\nBIP 68:\nbip68txs - 16 txs with nSequence relative locktime of 10 with various bits set as per the relative_locktimes below\n\nBIP 112:\nbip112txs_vary_nSequence - 16 txs with nSequence relative_locktimes of 10 evaluated against 10 OP_CSV OP_DROP\nbip112txs_vary_nSequence_9 - 16 txs with nSequence relative_locktimes of 9 evaluated against 10 OP_CSV OP_DROP\nbip112txs_vary_OP_CSV - 16 txs with nSequence = 10 evaluated against varying {relative_locktimes of 10} OP_CSV OP_DROP\nbip112txs_vary_OP_CSV_9 - 16 txs with nSequence = 9 evaluated against varying {relative_locktimes of 10} OP_CSV OP_DROP\nbip112tx_special - test negative argument to OP_CSV\n\"\"\"\n\nfrom test_framework.test_framework import ComparisonTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import ToHex, CTransaction, network_thread_start\nfrom test_framework.blocktools import create_coinbase, create_block\nfrom test_framework.comptool import TestInstance, TestManager\nfrom test_framework.script import *\nfrom io import BytesIO\nimport time\n\nbase_relative_locktime = 10\nseq_disable_flag = 1<<31\nseq_random_high_bit = 1<<25\nseq_type_flag = 1<<22\nseq_random_low_bit = 1<<18\n\n# b31,b25,b22,b18 represent the 31st, 25th, 22nd and 18th bits respectively in the nSequence field\n# relative_locktimes[b31][b25][b22][b18] is a base_relative_locktime with the indicated bits set if their indices are 1\nrelative_locktimes = []\nfor b31 in range(2):\n    b25times = []\n    for b25 in range(2):\n        b22times = []\n        for b22 in range(2):\n            b18times = []\n            for b18 in range(2):\n                rlt = base_relative_locktime\n                if (b31):\n                    rlt = rlt | seq_disable_flag\n                if (b25):\n                    rlt = rlt | seq_random_high_bit\n                if (b22):\n                    rlt = rlt | seq_type_flag\n                if (b18):\n                    rlt = rlt | seq_random_low_bit\n                b18times.append(rlt)\n            b22times.append(b18times)\n        b25times.append(b22times)\n    relative_locktimes.append(b25times)\n\ndef all_rlt_txs(txarray):\n    txs = []\n    for b31 in range(2):\n        for b25 in range(2):\n            for b22 in range(2):\n                for b18 in range(2):\n                    txs.append(txarray[b31][b25][b22][b18])\n    return txs\n\nclass BIP68_112_113Test(ComparisonTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.setup_clean_chain = True\n        self.extra_args = [['-whitelist=127.0.0.1', '-blockversion=4', '-addresstype=legacy']]\n\n    def run_test(self):\n        test = TestManager(self, self.options.tmpdir)\n        test.add_all_connections(self.nodes)\n        network_thread_start()\n        test.run()\n\n    def send_generic_input_tx(self, node, coinbases):\n        amount = Decimal(\"49.99\")\n        return node.sendrawtransaction(ToHex(self.sign_transaction(node, self.create_transaction(node, node.getblock(coinbases.pop())['tx'][0], self.nodeaddress, amount))))\n\n    def create_transaction(self, node, txid, to_address, amount):\n        inputs = [{ \"txid\" : txid, \"vout\" : 0}]\n        outputs = { to_address : amount }\n        rawtx = node.createrawtransaction(inputs, outputs)\n        tx = CTransaction()\n        f = BytesIO(hex_str_to_bytes(rawtx))\n        tx.deserialize(f)\n        return tx\n\n    def sign_transaction(self, node, unsignedtx):\n        rawtx = ToHex(unsignedtx)\n        signresult = node.signrawtransaction(rawtx)\n        tx = CTransaction()\n        f = BytesIO(hex_str_to_bytes(signresult['hex']))\n        tx.deserialize(f)\n        return tx\n\n    def generate_blocks(self, number, version, test_blocks = []):\n        for i in range(number):\n            block = self.create_test_block([], version)\n            test_blocks.append([block, True])\n            self.last_block_time += 600\n            self.tip = block.sha256\n            self.tipheight += 1\n        return test_blocks\n\n    def create_test_block(self, txs, version = 536870912):\n        block = create_block(self.tip, create_coinbase(self.tipheight + 1), self.last_block_time + 600)\n        block.nVersion = version\n        block.vtx.extend(txs)\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.rehash()\n        block.solve()\n        return block\n\n    def create_bip68txs(self, bip68inputs, txversion, locktime_delta = 0):\n        txs = []\n        assert(len(bip68inputs) >= 16)\n        i = 0\n        for b31 in range(2):\n            b25txs = []\n            for b25 in range(2):\n                b22txs = []\n                for b22 in range(2):\n                    b18txs = []\n                    for b18 in range(2):\n                        tx =  self.create_transaction(self.nodes[0], bip68inputs[i], self.nodeaddress, Decimal(\"49.98\"))\n                        i += 1\n                        tx.nVersion = txversion\n                        tx.vin[0].nSequence = relative_locktimes[b31][b25][b22][b18] + locktime_delta\n                        b18txs.append(self.sign_transaction(self.nodes[0], tx))\n                    b22txs.append(b18txs)\n                b25txs.append(b22txs)\n            txs.append(b25txs)\n        return txs\n\n    def create_bip112special(self, input, txversion):\n        tx = self.create_transaction(self.nodes[0], input, self.nodeaddress, Decimal(\"49.98\"))\n        tx.nVersion = txversion\n        signtx = self.sign_transaction(self.nodes[0], tx)\n        signtx.vin[0].scriptSig = CScript([-1, OP_CHECKSEQUENCEVERIFY, OP_DROP] + list(CScript(signtx.vin[0].scriptSig)))\n        return signtx\n\n    def create_bip112txs(self, bip112inputs, varyOP_CSV, txversion, locktime_delta = 0):\n        txs = []\n        assert(len(bip112inputs) >= 16)\n        i = 0\n        for b31 in range(2):\n            b25txs = []\n            for b25 in range(2):\n                b22txs = []\n                for b22 in range(2):\n                    b18txs = []\n                    for b18 in range(2):\n                        tx =  self.create_transaction(self.nodes[0], bip112inputs[i], self.nodeaddress, Decimal(\"49.98\"))\n                        i += 1\n                        if (varyOP_CSV): # if varying OP_CSV, nSequence is fixed\n                            tx.vin[0].nSequence = base_relative_locktime + locktime_delta\n                        else: # vary nSequence instead, OP_CSV is fixed\n                            tx.vin[0].nSequence = relative_locktimes[b31][b25][b22][b18] + locktime_delta\n                        tx.nVersion = txversion\n                        signtx = self.sign_transaction(self.nodes[0], tx)\n                        if (varyOP_CSV):\n                            signtx.vin[0].scriptSig = CScript([relative_locktimes[b31][b25][b22][b18], OP_CHECKSEQUENCEVERIFY, OP_DROP] + list(CScript(signtx.vin[0].scriptSig)))\n                        else:\n                            signtx.vin[0].scriptSig = CScript([base_relative_locktime, OP_CHECKSEQUENCEVERIFY, OP_DROP] + list(CScript(signtx.vin[0].scriptSig)))\n                        b18txs.append(signtx)\n                    b22txs.append(b18txs)\n                b25txs.append(b22txs)\n            txs.append(b25txs)\n        return txs\n\n    def get_tests(self):\n        long_past_time = int(time.time()) - 600 * 1000 # enough to build up to 1000 blocks 10 minutes apart without worrying about getting into the future\n        self.nodes[0].setmocktime(long_past_time - 100) # enough so that the generated blocks will still all be before long_past_time\n        self.coinbase_blocks = self.nodes[0].generate(1 + 16 + 2*32 + 1) # 82 blocks generated for inputs\n        self.nodes[0].setmocktime(0) # set time back to present so yielded blocks aren't in the future as we advance last_block_time\n        self.tipheight = 82 # height of the next block to build\n        self.last_block_time = long_past_time\n        self.tip = int(\"0x\" + self.nodes[0].getbestblockhash(), 0)\n        self.nodeaddress = self.nodes[0].getnewaddress()\n\n        assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'defined')\n        test_blocks = self.generate_blocks(61, 4)\n        yield TestInstance(test_blocks, sync_every_block=False) # 1\n        # Advanced from DEFINED to STARTED, height = 143\n        assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'started')\n\n        # Fail to achieve LOCKED_IN 100 out of 144 signal bit 0\n        # using a variety of bits to simulate multiple parallel softforks\n        test_blocks = self.generate_blocks(50, 536870913) # 0x20000001 (signalling ready)\n        test_blocks = self.generate_blocks(20, 4, test_blocks) # 0x00000004 (signalling not)\n        test_blocks = self.generate_blocks(50, 536871169, test_blocks) # 0x20000101 (signalling ready)\n        test_blocks = self.generate_blocks(24, 536936448, test_blocks) # 0x20010000 (signalling not)\n        yield TestInstance(test_blocks, sync_every_block=False) # 2\n        # Failed to advance past STARTED, height = 287\n        assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'started')\n\n        # 108 out of 144 signal bit 0 to achieve lock-in\n        # using a variety of bits to simulate multiple parallel softforks\n        test_blocks = self.generate_blocks(58, 536870913) # 0x20000001 (signalling ready)\n        test_blocks = self.generate_blocks(26, 4, test_blocks) # 0x00000004 (signalling not)\n        test_blocks = self.generate_blocks(50, 536871169, test_blocks) # 0x20000101 (signalling ready)\n        test_blocks = self.generate_blocks(10, 536936448, test_blocks) # 0x20010000 (signalling not)\n        yield TestInstance(test_blocks, sync_every_block=False) # 3\n        # Advanced from STARTED to LOCKED_IN, height = 431\n        assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'locked_in')\n\n        # 140 more version 4 blocks\n        test_blocks = self.generate_blocks(140, 4)\n        yield TestInstance(test_blocks, sync_every_block=False) # 4\n\n        ### Inputs at height = 572\n        # Put inputs for all tests in the chain at height 572 (tip now = 571) (time increases by 600s per block)\n        # Note we reuse inputs for v1 and v2 txs so must test these separately\n        # 16 normal inputs\n        bip68inputs = []\n        for i in range(16):\n            bip68inputs.append(self.send_generic_input_tx(self.nodes[0], self.coinbase_blocks))\n        # 2 sets of 16 inputs with 10 OP_CSV OP_DROP (actually will be prepended to spending scriptSig)\n        bip112basicinputs = []\n        for j in range(2):\n            inputs = []\n            for i in range(16):\n                inputs.append(self.send_generic_input_tx(self.nodes[0], self.coinbase_blocks))\n            bip112basicinputs.append(inputs)\n        # 2 sets of 16 varied inputs with (relative_lock_time) OP_CSV OP_DROP (actually will be prepended to spending scriptSig)\n        bip112diverseinputs = []\n        for j in range(2):\n            inputs = []\n            for i in range(16):\n                inputs.append(self.send_generic_input_tx(self.nodes[0], self.coinbase_blocks))\n            bip112diverseinputs.append(inputs)\n        # 1 special input with -1 OP_CSV OP_DROP (actually will be prepended to spending scriptSig)\n        bip112specialinput = self.send_generic_input_tx(self.nodes[0], self.coinbase_blocks)\n        # 1 normal input\n        bip113input = self.send_generic_input_tx(self.nodes[0], self.coinbase_blocks)\n\n        self.nodes[0].setmocktime(self.last_block_time + 600)\n        inputblockhash = self.nodes[0].generate(1)[0] # 1 block generated for inputs to be in chain at height 572\n        self.nodes[0].setmocktime(0)\n        self.tip = int(\"0x\" + inputblockhash, 0)\n        self.tipheight += 1\n        self.last_block_time += 600\n        assert_equal(len(self.nodes[0].getblock(inputblockhash,True)[\"tx\"]), 82+1)\n\n        # 2 more version 4 blocks\n        test_blocks = self.generate_blocks(2, 4)\n        yield TestInstance(test_blocks, sync_every_block=False) # 5\n        # Not yet advanced to ACTIVE, height = 574 (will activate for block 576, not 575)\n        assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'locked_in')\n\n        # Test both version 1 and version 2 transactions for all tests\n        # BIP113 test transaction will be modified before each use to put in appropriate block time\n        bip113tx_v1 = self.create_transaction(self.nodes[0], bip113input, self.nodeaddress, Decimal(\"49.98\"))\n        bip113tx_v1.vin[0].nSequence = 0xFFFFFFFE\n        bip113tx_v1.nVersion = 1\n        bip113tx_v2 = self.create_transaction(self.nodes[0], bip113input, self.nodeaddress, Decimal(\"49.98\"))\n        bip113tx_v2.vin[0].nSequence = 0xFFFFFFFE\n        bip113tx_v2.nVersion = 2\n\n        # For BIP68 test all 16 relative sequence locktimes\n        bip68txs_v1 = self.create_bip68txs(bip68inputs, 1)\n        bip68txs_v2 = self.create_bip68txs(bip68inputs, 2)\n\n        # For BIP112 test:\n        # 16 relative sequence locktimes of 10 against 10 OP_CSV OP_DROP inputs\n        bip112txs_vary_nSequence_v1 = self.create_bip112txs(bip112basicinputs[0], False, 1)\n        bip112txs_vary_nSequence_v2 = self.create_bip112txs(bip112basicinputs[0], False, 2)\n        # 16 relative sequence locktimes of 9 against 10 OP_CSV OP_DROP inputs\n        bip112txs_vary_nSequence_9_v1 = self.create_bip112txs(bip112basicinputs[1], False, 1, -1)\n        bip112txs_vary_nSequence_9_v2 = self.create_bip112txs(bip112basicinputs[1], False, 2, -1)\n        # sequence lock time of 10 against 16 (relative_lock_time) OP_CSV OP_DROP inputs\n        bip112txs_vary_OP_CSV_v1 = self.create_bip112txs(bip112diverseinputs[0], True, 1)\n        bip112txs_vary_OP_CSV_v2 = self.create_bip112txs(bip112diverseinputs[0], True, 2)\n        # sequence lock time of 9 against 16 (relative_lock_time) OP_CSV OP_DROP inputs\n        bip112txs_vary_OP_CSV_9_v1 = self.create_bip112txs(bip112diverseinputs[1], True, 1, -1)\n        bip112txs_vary_OP_CSV_9_v2 = self.create_bip112txs(bip112diverseinputs[1], True, 2, -1)\n        # -1 OP_CSV OP_DROP input\n        bip112tx_special_v1 = self.create_bip112special(bip112specialinput, 1)\n        bip112tx_special_v2 = self.create_bip112special(bip112specialinput, 2)\n\n\n        ### TESTING ###\n        ##################################\n        ### Before Soft Forks Activate ###\n        ##################################\n        # All txs should pass\n        ### Version 1 txs ###\n        success_txs = []\n        # add BIP113 tx and -1 CSV tx\n        bip113tx_v1.nLockTime = self.last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block\n        bip113signed1 = self.sign_transaction(self.nodes[0], bip113tx_v1)\n        success_txs.append(bip113signed1)\n        success_txs.append(bip112tx_special_v1)\n        # add BIP 68 txs\n        success_txs.extend(all_rlt_txs(bip68txs_v1))\n        # add BIP 112 with seq=10 txs\n        success_txs.extend(all_rlt_txs(bip112txs_vary_nSequence_v1))\n        success_txs.extend(all_rlt_txs(bip112txs_vary_OP_CSV_v1))\n        # try BIP 112 with seq=9 txs\n        success_txs.extend(all_rlt_txs(bip112txs_vary_nSequence_9_v1))\n        success_txs.extend(all_rlt_txs(bip112txs_vary_OP_CSV_9_v1))\n        yield TestInstance([[self.create_test_block(success_txs), True]]) # 6\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n\n        ### Version 2 txs ###\n        success_txs = []\n        # add BIP113 tx and -1 CSV tx\n        bip113tx_v2.nLockTime = self.last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block\n        bip113signed2 = self.sign_transaction(self.nodes[0], bip113tx_v2)\n        success_txs.append(bip113signed2)\n        success_txs.append(bip112tx_special_v2)\n        # add BIP 68 txs\n        success_txs.extend(all_rlt_txs(bip68txs_v2))\n        # add BIP 112 with seq=10 txs\n        success_txs.extend(all_rlt_txs(bip112txs_vary_nSequence_v2))\n        success_txs.extend(all_rlt_txs(bip112txs_vary_OP_CSV_v2))\n        # try BIP 112 with seq=9 txs\n        success_txs.extend(all_rlt_txs(bip112txs_vary_nSequence_9_v2))\n        success_txs.extend(all_rlt_txs(bip112txs_vary_OP_CSV_9_v2))\n        yield TestInstance([[self.create_test_block(success_txs), True]]) # 7\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n\n\n        # 1 more version 4 block to get us to height 575 so the fork should now be active for the next block\n        test_blocks = self.generate_blocks(1, 4)\n        yield TestInstance(test_blocks, sync_every_block=False) # 8\n        assert_equal(get_bip9_status(self.nodes[0], 'csv')['status'], 'active')\n\n\n        #################################\n        ### After Soft Forks Activate ###\n        #################################\n        ### BIP 113 ###\n        # BIP 113 tests should now fail regardless of version number if nLockTime isn't satisfied by new rules\n        bip113tx_v1.nLockTime = self.last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block\n        bip113signed1 = self.sign_transaction(self.nodes[0], bip113tx_v1)\n        bip113tx_v2.nLockTime = self.last_block_time - 600 * 5 # = MTP of prior block (not <) but < time put on current block\n        bip113signed2 = self.sign_transaction(self.nodes[0], bip113tx_v2)\n        for bip113tx in [bip113signed1, bip113signed2]:\n            yield TestInstance([[self.create_test_block([bip113tx]), False]]) # 9,10\n        # BIP 113 tests should now pass if the locktime is < MTP\n        bip113tx_v1.nLockTime = self.last_block_time - 600 * 5 - 1 # < MTP of prior block\n        bip113signed1 = self.sign_transaction(self.nodes[0], bip113tx_v1)\n        bip113tx_v2.nLockTime = self.last_block_time - 600 * 5 - 1 # < MTP of prior block\n        bip113signed2 = self.sign_transaction(self.nodes[0], bip113tx_v2)\n        for bip113tx in [bip113signed1, bip113signed2]:\n            yield TestInstance([[self.create_test_block([bip113tx]), True]]) # 11,12\n            self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n\n        # Next block height = 580 after 4 blocks of random version\n        test_blocks = self.generate_blocks(4, 1234)\n        yield TestInstance(test_blocks, sync_every_block=False) # 13\n\n        ### BIP 68 ###\n        ### Version 1 txs ###\n        # All still pass\n        success_txs = []\n        success_txs.extend(all_rlt_txs(bip68txs_v1))\n        yield TestInstance([[self.create_test_block(success_txs), True]]) # 14\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n\n        ### Version 2 txs ###\n        bip68success_txs = []\n        # All txs with SEQUENCE_LOCKTIME_DISABLE_FLAG set pass\n        for b25 in range(2):\n            for b22 in range(2):\n                for b18 in range(2):\n                    bip68success_txs.append(bip68txs_v2[1][b25][b22][b18])\n        yield TestInstance([[self.create_test_block(bip68success_txs), True]]) # 15\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n        # All txs without flag fail as we are at delta height = 8 < 10 and delta time = 8 * 600 < 10 * 512\n        bip68timetxs = []\n        for b25 in range(2):\n            for b18 in range(2):\n                bip68timetxs.append(bip68txs_v2[0][b25][1][b18])\n        for tx in bip68timetxs:\n            yield TestInstance([[self.create_test_block([tx]), False]]) # 16 - 19\n        bip68heighttxs = []\n        for b25 in range(2):\n            for b18 in range(2):\n                bip68heighttxs.append(bip68txs_v2[0][b25][0][b18])\n        for tx in bip68heighttxs:\n            yield TestInstance([[self.create_test_block([tx]), False]]) # 20 - 23\n\n        # Advance one block to 581\n        test_blocks = self.generate_blocks(1, 1234)\n        yield TestInstance(test_blocks, sync_every_block=False) # 24\n\n        # Height txs should fail and time txs should now pass 9 * 600 > 10 * 512\n        bip68success_txs.extend(bip68timetxs)\n        yield TestInstance([[self.create_test_block(bip68success_txs), True]]) # 25\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n        for tx in bip68heighttxs:\n            yield TestInstance([[self.create_test_block([tx]), False]]) # 26 - 29\n\n        # Advance one block to 582\n        test_blocks = self.generate_blocks(1, 1234)\n        yield TestInstance(test_blocks, sync_every_block=False) # 30\n\n        # All BIP 68 txs should pass\n        bip68success_txs.extend(bip68heighttxs)\n        yield TestInstance([[self.create_test_block(bip68success_txs), True]]) # 31\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n\n\n        ### BIP 112 ###\n        ### Version 1 txs ###\n        # -1 OP_CSV tx should fail\n        yield TestInstance([[self.create_test_block([bip112tx_special_v1]), False]]) #32\n        # If SEQUENCE_LOCKTIME_DISABLE_FLAG is set in argument to OP_CSV, version 1 txs should still pass\n        success_txs = []\n        for b25 in range(2):\n            for b22 in range(2):\n                for b18 in range(2):\n                    success_txs.append(bip112txs_vary_OP_CSV_v1[1][b25][b22][b18])\n                    success_txs.append(bip112txs_vary_OP_CSV_9_v1[1][b25][b22][b18])\n        yield TestInstance([[self.create_test_block(success_txs), True]]) # 33\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n\n        # If SEQUENCE_LOCKTIME_DISABLE_FLAG is unset in argument to OP_CSV, version 1 txs should now fail\n        fail_txs = []\n        fail_txs.extend(all_rlt_txs(bip112txs_vary_nSequence_v1))\n        fail_txs.extend(all_rlt_txs(bip112txs_vary_nSequence_9_v1))\n        for b25 in range(2):\n            for b22 in range(2):\n                for b18 in range(2):\n                    fail_txs.append(bip112txs_vary_OP_CSV_v1[0][b25][b22][b18])\n                    fail_txs.append(bip112txs_vary_OP_CSV_9_v1[0][b25][b22][b18])\n\n        for tx in fail_txs:\n            yield TestInstance([[self.create_test_block([tx]), False]]) # 34 - 81\n\n        ### Version 2 txs ###\n        # -1 OP_CSV tx should fail\n        yield TestInstance([[self.create_test_block([bip112tx_special_v2]), False]]) #82\n\n        # If SEQUENCE_LOCKTIME_DISABLE_FLAG is set in argument to OP_CSV, version 2 txs should pass (all sequence locks are met)\n        success_txs = []\n        for b25 in range(2):\n            for b22 in range(2):\n                for b18 in range(2):\n                    success_txs.append(bip112txs_vary_OP_CSV_v2[1][b25][b22][b18]) # 8/16 of vary_OP_CSV\n                    success_txs.append(bip112txs_vary_OP_CSV_9_v2[1][b25][b22][b18]) # 8/16 of vary_OP_CSV_9\n\n        yield TestInstance([[self.create_test_block(success_txs), True]]) # 83\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n\n        ## SEQUENCE_LOCKTIME_DISABLE_FLAG is unset in argument to OP_CSV for all remaining txs ##\n        # All txs with nSequence 9 should fail either due to earlier mismatch or failing the CSV check\n        fail_txs = []\n        fail_txs.extend(all_rlt_txs(bip112txs_vary_nSequence_9_v2)) # 16/16 of vary_nSequence_9\n        for b25 in range(2):\n            for b22 in range(2):\n                for b18 in range(2):\n                    fail_txs.append(bip112txs_vary_OP_CSV_9_v2[0][b25][b22][b18]) # 16/16 of vary_OP_CSV_9\n\n        for tx in fail_txs:\n            yield TestInstance([[self.create_test_block([tx]), False]]) # 84 - 107\n\n        # If SEQUENCE_LOCKTIME_DISABLE_FLAG is set in nSequence, tx should fail\n        fail_txs = []\n        for b25 in range(2):\n            for b22 in range(2):\n                for b18 in range(2):\n                    fail_txs.append(bip112txs_vary_nSequence_v2[1][b25][b22][b18]) # 8/16 of vary_nSequence\n        for tx in fail_txs:\n            yield TestInstance([[self.create_test_block([tx]), False]]) # 108-115\n\n        # If sequencelock types mismatch, tx should fail\n        fail_txs = []\n        for b25 in range(2):\n            for b18 in range(2):\n                fail_txs.append(bip112txs_vary_nSequence_v2[0][b25][1][b18]) # 12/16 of vary_nSequence\n                fail_txs.append(bip112txs_vary_OP_CSV_v2[0][b25][1][b18]) # 12/16 of vary_OP_CSV\n        for tx in fail_txs:\n            yield TestInstance([[self.create_test_block([tx]), False]]) # 116-123\n\n        # Remaining txs should pass, just test masking works properly\n        success_txs = []\n        for b25 in range(2):\n            for b18 in range(2):\n                success_txs.append(bip112txs_vary_nSequence_v2[0][b25][0][b18]) # 16/16 of vary_nSequence\n                success_txs.append(bip112txs_vary_OP_CSV_v2[0][b25][0][b18]) # 16/16 of vary_OP_CSV\n        yield TestInstance([[self.create_test_block(success_txs), True]]) # 124\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n\n        # Additional test, of checking that comparison of two time types works properly\n        time_txs = []\n        for b25 in range(2):\n            for b18 in range(2):\n                tx = bip112txs_vary_OP_CSV_v2[0][b25][1][b18]\n                tx.vin[0].nSequence = base_relative_locktime | seq_type_flag\n                signtx = self.sign_transaction(self.nodes[0], tx)\n                time_txs.append(signtx)\n        yield TestInstance([[self.create_test_block(time_txs), True]]) # 125\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n\n        ### Missing aspects of test\n        ##  Testing empty stack fails\n\n\nif __name__ == '__main__':\n    BIP68_112_113Test().main()\n"
  },
  {
    "path": "test/functional/feature_dbcrash.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test recovery from a crash during chainstate writing.\n\n- 4 nodes\n  * node0, node1, and node2 will have different dbcrash ratios, and different\n    dbcache sizes\n  * node3 will be a regular node, with no crashing.\n  * The nodes will not connect to each other.\n\n- use default test framework starting chain. initialize starting_tip_height to\n  tip height.\n\n- Main loop:\n  * generate lots of transactions on node3, enough to fill up a block.\n  * uniformly randomly pick a tip height from starting_tip_height to\n    tip_height; with probability 1/(height_difference+4), invalidate this block.\n  * mine enough blocks to overtake tip_height at start of loop.\n  * for each node in [node0,node1,node2]:\n     - for each mined block:\n       * submit block to node\n       * if node crashed on/after submitting:\n         - restart until recovery succeeds\n         - check that utxo matches node3 using gettxoutsetinfo\"\"\"\n\nimport errno\nimport http.client\nimport random\nimport sys\nimport time\n\nfrom test_framework.mininode import *\nfrom test_framework.script import *\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nHTTP_DISCONNECT_ERRORS = [http.client.CannotSendRequest]\ntry:\n    HTTP_DISCONNECT_ERRORS.append(http.client.RemoteDisconnected)\nexcept AttributeError:\n    pass\n\nclass ChainstateWriteCrashTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 4\n        self.setup_clean_chain = False\n\n        # Set -maxmempool=0 to turn off mempool memory sharing with dbcache\n        # Set -rpcservertimeout=900 to reduce socket disconnects in this\n        # long-running test\n        self.base_args = [\"-limitdescendantsize=0\", \"-maxmempool=0\", \"-rpcservertimeout=900\", \"-dbbatchsize=200000\"]\n\n        # Set different crash ratios and cache sizes.  Note that not all of\n        # -dbcache goes to pcoinsTip.\n        self.node0_args = [\"-dbcrashratio=8\", \"-dbcache=4\"] + self.base_args\n        self.node1_args = [\"-dbcrashratio=16\", \"-dbcache=8\"] + self.base_args\n        self.node2_args = [\"-dbcrashratio=24\", \"-dbcache=16\"] + self.base_args\n\n        # Node3 is a normal node with default args, except will mine full blocks\n        self.node3_args = [\"-blockmaxweight=4000000\"]\n        self.extra_args = [self.node0_args, self.node1_args, self.node2_args, self.node3_args]\n\n    def setup_network(self):\n        # Need a bit of extra time for the nodes to start up for this test\n        self.add_nodes(self.num_nodes, extra_args=self.extra_args, timewait=90)\n        self.start_nodes()\n        # Leave them unconnected, we'll use submitblock directly in this test\n\n    def restart_node(self, node_index, expected_tip):\n        \"\"\"Start up a given node id, wait for the tip to reach the given block hash, and calculate the utxo hash.\n\n        Exceptions on startup should indicate node crash (due to -dbcrashratio), in which case we try again. Give up\n        after 60 seconds. Returns the utxo hash of the given node.\"\"\"\n\n        time_start = time.time()\n        while time.time() - time_start < 120:\n            try:\n                # Any of these RPC calls could throw due to node crash\n                self.start_node(node_index)\n                self.nodes[node_index].waitforblock(expected_tip)\n                utxo_hash = self.nodes[node_index].gettxoutsetinfo()['hash_serialized_2']\n                return utxo_hash\n            except:\n                # An exception here should mean the node is about to crash.\n                # If bitcoind exits, then try again.  wait_for_node_exit()\n                # should raise an exception if bitcoind doesn't exit.\n                self.wait_for_node_exit(node_index, timeout=10)\n            self.crashed_on_restart += 1\n            time.sleep(1)\n\n        # If we got here, bitcoind isn't coming back up on restart.  Could be a\n        # bug in bitcoind, or we've gotten unlucky with our dbcrash ratio --\n        # perhaps we generated a test case that blew up our cache?\n        # TODO: If this happens a lot, we should try to restart without -dbcrashratio\n        # and make sure that recovery happens.\n        raise AssertionError(\"Unable to successfully restart node %d in allotted time\", node_index)\n\n    def submit_block_catch_error(self, node_index, block):\n        \"\"\"Try submitting a block to the given node.\n\n        Catch any exceptions that indicate the node has crashed.\n        Returns true if the block was submitted successfully; false otherwise.\"\"\"\n\n        try:\n            self.nodes[node_index].submitblock(block)\n            return True\n        except http.client.BadStatusLine as e:\n            # Prior to 3.5 BadStatusLine('') was raised for a remote disconnect error.\n            if sys.version_info[0] == 3 and sys.version_info[1] < 5 and e.line == \"''\":\n                self.log.debug(\"node %d submitblock raised exception: %s\", node_index, e)\n                return False\n            else:\n                raise\n        except tuple(HTTP_DISCONNECT_ERRORS) as e:\n            self.log.debug(\"node %d submitblock raised exception: %s\", node_index, e)\n            return False\n        except OSError as e:\n            self.log.debug(\"node %d submitblock raised OSError exception: errno=%s\", node_index, e.errno)\n            if e.errno in [errno.EPIPE, errno.ECONNREFUSED, errno.ECONNRESET]:\n                # The node has likely crashed\n                return False\n            else:\n                # Unexpected exception, raise\n                raise\n\n    def sync_node3blocks(self, block_hashes):\n        \"\"\"Use submitblock to sync node3's chain with the other nodes\n\n        If submitblock fails, restart the node and get the new utxo hash.\n        If any nodes crash while updating, we'll compare utxo hashes to\n        ensure recovery was successful.\"\"\"\n\n        node3_utxo_hash = self.nodes[3].gettxoutsetinfo()['hash_serialized_2']\n\n        # Retrieve all the blocks from node3\n        blocks = []\n        for block_hash in block_hashes:\n            blocks.append([block_hash, self.nodes[3].getblock(block_hash, 0)])\n\n        # Deliver each block to each other node\n        for i in range(3):\n            nodei_utxo_hash = None\n            self.log.debug(\"Syncing blocks to node %d\", i)\n            for (block_hash, block) in blocks:\n                # Get the block from node3, and submit to node_i\n                self.log.debug(\"submitting block %s\", block_hash)\n                if not self.submit_block_catch_error(i, block):\n                    # TODO: more carefully check that the crash is due to -dbcrashratio\n                    # (change the exit code perhaps, and check that here?)\n                    self.wait_for_node_exit(i, timeout=30)\n                    self.log.debug(\"Restarting node %d after block hash %s\", i, block_hash)\n                    nodei_utxo_hash = self.restart_node(i, block_hash)\n                    assert nodei_utxo_hash is not None\n                    self.restart_counts[i] += 1\n                else:\n                    # Clear it out after successful submitblock calls -- the cached\n                    # utxo hash will no longer be correct\n                    nodei_utxo_hash = None\n\n            # Check that the utxo hash matches node3's utxo set\n            # NOTE: we only check the utxo set if we had to restart the node\n            # after the last block submitted:\n            # - checking the utxo hash causes a cache flush, which we don't\n            # want to do every time; so\n            # - we only update the utxo cache after a node restart, since flushing\n            # the cache is a no-op at that point\n            if nodei_utxo_hash is not None:\n                self.log.debug(\"Checking txoutsetinfo matches for node %d\", i)\n                assert_equal(nodei_utxo_hash, node3_utxo_hash)\n\n    def verify_utxo_hash(self):\n        \"\"\"Verify that the utxo hash of each node matches node3.\n\n        Restart any nodes that crash while querying.\"\"\"\n        node3_utxo_hash = self.nodes[3].gettxoutsetinfo()['hash_serialized_2']\n        self.log.info(\"Verifying utxo hash matches for all nodes\")\n\n        for i in range(3):\n            try:\n                nodei_utxo_hash = self.nodes[i].gettxoutsetinfo()['hash_serialized_2']\n            except OSError:\n                # probably a crash on db flushing\n                nodei_utxo_hash = self.restart_node(i, self.nodes[3].getbestblockhash())\n            assert_equal(nodei_utxo_hash, node3_utxo_hash)\n\n    def generate_small_transactions(self, node, count, utxo_list):\n        FEE = 1000  # TODO: replace this with node relay fee based calculation\n        num_transactions = 0\n        random.shuffle(utxo_list)\n        while len(utxo_list) >= 2 and num_transactions < count:\n            tx = CTransaction()\n            input_amount = 0\n            for i in range(2):\n                utxo = utxo_list.pop()\n                tx.vin.append(CTxIn(COutPoint(int(utxo['txid'], 16), utxo['vout'])))\n                input_amount += int(utxo['amount'] * COIN)\n            output_amount = (input_amount - FEE) // 3\n\n            if output_amount <= 0:\n                # Sanity check -- if we chose inputs that are too small, skip\n                continue\n\n            for i in range(3):\n                tx.vout.append(CTxOut(output_amount, hex_str_to_bytes(utxo['scriptPubKey'])))\n\n            # Sign and send the transaction to get into the mempool\n            tx_signed_hex = node.signrawtransaction(ToHex(tx))['hex']\n            node.sendrawtransaction(tx_signed_hex)\n            num_transactions += 1\n\n    def run_test(self):\n        # Track test coverage statistics\n        self.restart_counts = [0, 0, 0]  # Track the restarts for nodes 0-2\n        self.crashed_on_restart = 0      # Track count of crashes during recovery\n\n        # Start by creating a lot of utxos on node3\n        initial_height = self.nodes[3].getblockcount()\n        utxo_list = create_confirmed_utxos(self.nodes[3].getnetworkinfo()['relayfee'], self.nodes[3], 5000)\n        self.log.info(\"Prepped %d utxo entries\", len(utxo_list))\n\n        # Sync these blocks with the other nodes\n        block_hashes_to_sync = []\n        for height in range(initial_height + 1, self.nodes[3].getblockcount() + 1):\n            block_hashes_to_sync.append(self.nodes[3].getblockhash(height))\n\n        self.log.debug(\"Syncing %d blocks with other nodes\", len(block_hashes_to_sync))\n        # Syncing the blocks could cause nodes to crash, so the test begins here.\n        self.sync_node3blocks(block_hashes_to_sync)\n\n        starting_tip_height = self.nodes[3].getblockcount()\n\n        # Main test loop:\n        # each time through the loop, generate a bunch of transactions,\n        # and then either mine a single new block on the tip, or some-sized reorg.\n        for i in range(40):\n            self.log.info(\"Iteration %d, generating 2500 transactions %s\", i, self.restart_counts)\n            # Generate a bunch of small-ish transactions\n            self.generate_small_transactions(self.nodes[3], 2500, utxo_list)\n            # Pick a random block between current tip, and starting tip\n            current_height = self.nodes[3].getblockcount()\n            random_height = random.randint(starting_tip_height, current_height)\n            self.log.debug(\"At height %d, considering height %d\", current_height, random_height)\n            if random_height > starting_tip_height:\n                # Randomly reorg from this point with some probability (1/4 for\n                # tip, 1/5 for tip-1, ...)\n                if random.random() < 1.0 / (current_height + 4 - random_height):\n                    self.log.debug(\"Invalidating block at height %d\", random_height)\n                    self.nodes[3].invalidateblock(self.nodes[3].getblockhash(random_height))\n\n            # Now generate new blocks until we pass the old tip height\n            self.log.debug(\"Mining longer tip\")\n            block_hashes = []\n            while current_height + 1 > self.nodes[3].getblockcount():\n                block_hashes.extend(self.nodes[3].generate(min(10, current_height + 1 - self.nodes[3].getblockcount())))\n            self.log.debug(\"Syncing %d new blocks...\", len(block_hashes))\n            self.sync_node3blocks(block_hashes)\n            utxo_list = self.nodes[3].listunspent()\n            self.log.debug(\"Node3 utxo count: %d\", len(utxo_list))\n\n        # Check that the utxo hashes agree with node3\n        # Useful side effect: each utxo cache gets flushed here, so that we\n        # won't get crashes on shutdown at the end of the test.\n        self.verify_utxo_hash()\n\n        # Check the test coverage\n        self.log.info(\"Restarted nodes: %s; crashes on restart: %d\", self.restart_counts, self.crashed_on_restart)\n\n        # If no nodes were restarted, we didn't test anything.\n        assert self.restart_counts != [0, 0, 0]\n\n        # Make sure we tested the case of crash-during-recovery.\n        assert self.crashed_on_restart > 0\n\n        # Warn if any of the nodes escaped restart.\n        for i in range(3):\n            if self.restart_counts[i] == 0:\n                self.log.warn(\"Node %d never crashed during utxo flush!\", i)\n\nif __name__ == \"__main__\":\n    ChainstateWriteCrashTest().main()\n"
  },
  {
    "path": "test/functional/feature_dersig.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test BIP66 (DER SIG).\n\nTest that the DERSIG soft-fork activates at (regtest) height 1251.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import *\nfrom test_framework.blocktools import create_coinbase, create_block\nfrom test_framework.script import CScript\nfrom io import BytesIO\n\nDERSIG_HEIGHT = 1251\n\n# Reject codes that we might receive in this test\nREJECT_INVALID = 16\nREJECT_OBSOLETE = 17\nREJECT_NONSTANDARD = 64\n\n# A canonical signature consists of:\n# <30> <total len> <02> <len R> <R> <02> <len S> <S> <hashtype>\ndef unDERify(tx):\n    \"\"\"\n    Make the signature in vin 0 of a tx non-DER-compliant,\n    by adding padding after the S-value.\n    \"\"\"\n    scriptSig = CScript(tx.vin[0].scriptSig)\n    newscript = []\n    for i in scriptSig:\n        if (len(newscript) == 0):\n            newscript.append(i[0:-1] + b'\\0' + i[-1:])\n        else:\n            newscript.append(i)\n    tx.vin[0].scriptSig = CScript(newscript)\n\ndef create_transaction(node, coinbase, to_address, amount):\n    from_txid = node.getblock(coinbase)['tx'][0]\n    inputs = [{ \"txid\" : from_txid, \"vout\" : 0}]\n    outputs = { to_address : amount }\n    rawtx = node.createrawtransaction(inputs, outputs)\n    signresult = node.signrawtransaction(rawtx)\n    tx = CTransaction()\n    tx.deserialize(BytesIO(hex_str_to_bytes(signresult['hex'])))\n    return tx\n\nclass BIP66Test(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.extra_args = [['-promiscuousmempoolflags=1', '-whitelist=127.0.0.1']]\n        self.setup_clean_chain = True\n\n    def run_test(self):\n        self.nodes[0].add_p2p_connection(P2PInterface())\n\n        network_thread_start()\n\n        # wait_for_verack ensures that the P2P connection is fully up.\n        self.nodes[0].p2p.wait_for_verack()\n\n        self.log.info(\"Mining %d blocks\", DERSIG_HEIGHT - 2)\n        self.coinbase_blocks = self.nodes[0].generate(DERSIG_HEIGHT - 2)\n        self.nodeaddress = self.nodes[0].getnewaddress()\n\n        self.log.info(\"Test that a transaction with non-DER signature can still appear in a block\")\n\n        spendtx = create_transaction(self.nodes[0], self.coinbase_blocks[0],\n                self.nodeaddress, 1.0)\n        unDERify(spendtx)\n        spendtx.rehash()\n\n        tip = self.nodes[0].getbestblockhash()\n        block_time = self.nodes[0].getblockheader(tip)['mediantime'] + 1\n        block = create_block(int(tip, 16), create_coinbase(DERSIG_HEIGHT - 1), block_time)\n        block.nVersion = 2\n        block.vtx.append(spendtx)\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.rehash()\n        block.solve()\n\n        self.nodes[0].p2p.send_and_ping(msg_block(block))\n        assert_equal(self.nodes[0].getbestblockhash(), block.hash)\n\n        self.log.info(\"Test that blocks must now be at least version 3\")\n        tip = block.sha256\n        block_time += 1\n        block = create_block(tip, create_coinbase(DERSIG_HEIGHT), block_time)\n        block.nVersion = 2\n        block.rehash()\n        block.solve()\n        self.nodes[0].p2p.send_and_ping(msg_block(block))\n        assert_equal(int(self.nodes[0].getbestblockhash(), 16), tip)\n\n        wait_until(lambda: \"reject\" in self.nodes[0].p2p.last_message.keys(), lock=mininode_lock)\n        with mininode_lock:\n            assert_equal(self.nodes[0].p2p.last_message[\"reject\"].code, REJECT_OBSOLETE)\n            assert_equal(self.nodes[0].p2p.last_message[\"reject\"].reason, b'bad-version(0x00000002)')\n            assert_equal(self.nodes[0].p2p.last_message[\"reject\"].data, block.sha256)\n            del self.nodes[0].p2p.last_message[\"reject\"]\n\n        self.log.info(\"Test that transactions with non-DER signatures cannot appear in a block\")\n        block.nVersion = 3\n\n        spendtx = create_transaction(self.nodes[0], self.coinbase_blocks[1],\n                self.nodeaddress, 1.0)\n        unDERify(spendtx)\n        spendtx.rehash()\n\n        # First we show that this tx is valid except for DERSIG by getting it\n        # accepted to the mempool (which we can achieve with\n        # -promiscuousmempoolflags).\n        self.nodes[0].p2p.send_and_ping(msg_tx(spendtx))\n        assert spendtx.hash in self.nodes[0].getrawmempool()\n\n        # Now we verify that a block with this transaction is invalid.\n        block.vtx.append(spendtx)\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.rehash()\n        block.solve()\n\n        self.nodes[0].p2p.send_and_ping(msg_block(block))\n        assert_equal(int(self.nodes[0].getbestblockhash(), 16), tip)\n\n        wait_until(lambda: \"reject\" in self.nodes[0].p2p.last_message.keys(), lock=mininode_lock)\n        with mininode_lock:\n            # We can receive different reject messages depending on whether\n            # bitcoind is running with multiple script check threads. If script\n            # check threads are not in use, then transaction script validation\n            # happens sequentially, and bitcoind produces more specific reject\n            # reasons.\n            assert self.nodes[0].p2p.last_message[\"reject\"].code in [REJECT_INVALID, REJECT_NONSTANDARD]\n            assert_equal(self.nodes[0].p2p.last_message[\"reject\"].data, block.sha256)\n            if self.nodes[0].p2p.last_message[\"reject\"].code == REJECT_INVALID:\n                # Generic rejection when a block is invalid\n                assert_equal(self.nodes[0].p2p.last_message[\"reject\"].reason, b'block-validation-failed')\n            else:\n                assert b'Non-canonical DER signature' in self.nodes[0].p2p.last_message[\"reject\"].reason\n\n        self.log.info(\"Test that a version 3 block with a DERSIG-compliant transaction is accepted\")\n        block.vtx[1] = create_transaction(self.nodes[0],\n                self.coinbase_blocks[1], self.nodeaddress, 1.0)\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.rehash()\n        block.solve()\n\n        self.nodes[0].p2p.send_and_ping(msg_block(block))\n        assert_equal(int(self.nodes[0].getbestblockhash(), 16), block.sha256)\n\nif __name__ == '__main__':\n    BIP66Test().main()\n"
  },
  {
    "path": "test/functional/feature_fee_estimation.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test fee estimation code.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.script import CScript, OP_1, OP_DROP, OP_2, OP_HASH160, OP_EQUAL, hash160, OP_TRUE\nfrom test_framework.mininode import CTransaction, CTxIn, CTxOut, COutPoint, ToHex, COIN\n\n# Construct 2 trivial P2SH's and the ScriptSigs that spend them\n# So we can create many transactions without needing to spend\n# time signing.\nredeem_script_1 = CScript([OP_1, OP_DROP])\nredeem_script_2 = CScript([OP_2, OP_DROP])\nP2SH_1 = CScript([OP_HASH160, hash160(redeem_script_1), OP_EQUAL])\nP2SH_2 = CScript([OP_HASH160, hash160(redeem_script_2), OP_EQUAL])\n\n# Associated ScriptSig's to spend satisfy P2SH_1 and P2SH_2\nSCRIPT_SIG = [CScript([OP_TRUE, redeem_script_1]), CScript([OP_TRUE, redeem_script_2])]\n\nglobal log\n\ndef small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee_increment):\n    \"\"\"\n    Create and send a transaction with a random fee.\n    The transaction pays to a trivial P2SH script, and assumes that its inputs\n    are of the same form.\n    The function takes a list of confirmed outputs and unconfirmed outputs\n    and attempts to use the confirmed list first for its inputs.\n    It adds the newly created outputs to the unconfirmed list.\n    Returns (raw transaction, fee)\n    \"\"\"\n    # It's best to exponentially distribute our random fees\n    # because the buckets are exponentially spaced.\n    # Exponentially distributed from 1-128 * fee_increment\n    rand_fee = float(fee_increment)*(1.1892**random.randint(0,28))\n    # Total fee ranges from min_fee to min_fee + 127*fee_increment\n    fee = min_fee - fee_increment + satoshi_round(rand_fee)\n    tx = CTransaction()\n    total_in = Decimal(\"0.00000000\")\n    while total_in <= (amount + fee) and len(conflist) > 0:\n        t = conflist.pop(0)\n        total_in += t[\"amount\"]\n        tx.vin.append(CTxIn(COutPoint(int(t[\"txid\"], 16), t[\"vout\"]), b\"\"))\n    if total_in <= amount + fee:\n        while total_in <= (amount + fee) and len(unconflist) > 0:\n            t = unconflist.pop(0)\n            total_in += t[\"amount\"]\n            tx.vin.append(CTxIn(COutPoint(int(t[\"txid\"], 16), t[\"vout\"]), b\"\"))\n        if total_in <= amount + fee:\n            raise RuntimeError(\"Insufficient funds: need %d, have %d\"%(amount+fee, total_in))\n    tx.vout.append(CTxOut(int((total_in - amount - fee)*COIN), P2SH_1))\n    tx.vout.append(CTxOut(int(amount*COIN), P2SH_2))\n    # These transactions don't need to be signed, but we still have to insert\n    # the ScriptSig that will satisfy the ScriptPubKey.\n    for inp in tx.vin:\n        inp.scriptSig = SCRIPT_SIG[inp.prevout.n]\n    txid = from_node.sendrawtransaction(ToHex(tx), True)\n    unconflist.append({ \"txid\" : txid, \"vout\" : 0 , \"amount\" : total_in - amount - fee})\n    unconflist.append({ \"txid\" : txid, \"vout\" : 1 , \"amount\" : amount})\n\n    return (ToHex(tx), fee)\n\ndef split_inputs(from_node, txins, txouts, initial_split = False):\n    \"\"\"\n    We need to generate a lot of inputs so we can generate a ton of transactions.\n    This function takes an input from txins, and creates and sends a transaction\n    which splits the value into 2 outputs which are appended to txouts.\n    Previously this was designed to be small inputs so they wouldn't have\n    a high coin age when the notion of priority still existed.\n    \"\"\"\n    prevtxout = txins.pop()\n    tx = CTransaction()\n    tx.vin.append(CTxIn(COutPoint(int(prevtxout[\"txid\"], 16), prevtxout[\"vout\"]), b\"\"))\n\n    half_change = satoshi_round(prevtxout[\"amount\"]/2)\n    rem_change = prevtxout[\"amount\"] - half_change  - Decimal(\"0.00001000\")\n    tx.vout.append(CTxOut(int(half_change*COIN), P2SH_1))\n    tx.vout.append(CTxOut(int(rem_change*COIN), P2SH_2))\n\n    # If this is the initial split we actually need to sign the transaction\n    # Otherwise we just need to insert the proper ScriptSig\n    if (initial_split) :\n        completetx = from_node.signrawtransaction(ToHex(tx))[\"hex\"]\n    else :\n        tx.vin[0].scriptSig = SCRIPT_SIG[prevtxout[\"vout\"]]\n        completetx = ToHex(tx)\n    txid = from_node.sendrawtransaction(completetx, True)\n    txouts.append({ \"txid\" : txid, \"vout\" : 0 , \"amount\" : half_change})\n    txouts.append({ \"txid\" : txid, \"vout\" : 1 , \"amount\" : rem_change})\n\ndef check_estimates(node, fees_seen, max_invalid, print_estimates = True):\n    \"\"\"\n    This function calls estimatefee and verifies that the estimates\n    meet certain invariants.\n    \"\"\"\n    all_estimates = [ node.estimatefee(i) for i in range(1,26) ]\n    if print_estimates:\n        log.info([str(all_estimates[e-1]) for e in [1,2,3,6,15,25]])\n    delta = 1.0e-6 # account for rounding error\n    last_e = max(fees_seen)\n    for e in [x for x in all_estimates if x >= 0]:\n        # Estimates should be within the bounds of what transactions fees actually were:\n        if float(e)+delta < min(fees_seen) or float(e)-delta > max(fees_seen):\n            raise AssertionError(\"Estimated fee (%f) out of range (%f,%f)\"\n                                 %(float(e), min(fees_seen), max(fees_seen)))\n        # Estimates should be monotonically decreasing\n        if float(e)-delta > last_e:\n            raise AssertionError(\"Estimated fee (%f) larger than last fee (%f) for lower number of confirms\"\n                                 %(float(e),float(last_e)))\n        last_e = e\n    valid_estimate = False\n    invalid_estimates = 0\n    for i,e in enumerate(all_estimates): # estimate is for i+1\n        if e >= 0:\n            valid_estimate = True\n            if i >= 13:  # for n>=14 estimatesmartfee(n/2) should be at least as high as estimatefee(n)\n                assert(node.estimatesmartfee((i+1)//2)[\"feerate\"] > float(e) - delta)\n\n        else:\n            invalid_estimates += 1\n\n            # estimatesmartfee should still be valid\n            approx_estimate = node.estimatesmartfee(i+1)[\"feerate\"]\n            answer_found = node.estimatesmartfee(i+1)[\"blocks\"]\n            assert(approx_estimate > 0)\n            assert(answer_found > i+1)\n\n            # Once we're at a high enough confirmation count that we can give an estimate\n            # We should have estimates for all higher confirmation counts\n            if valid_estimate:\n                raise AssertionError(\"Invalid estimate appears at higher confirm count than valid estimate\")\n\n    # Check on the expected number of different confirmation counts\n    # that we might not have valid estimates for\n    if invalid_estimates > max_invalid:\n        raise AssertionError(\"More than (%d) invalid estimates\"%(max_invalid))\n    return all_estimates\n\n\nclass EstimateFeeTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 3\n\n    def setup_network(self):\n        \"\"\"\n        We'll setup the network to have 3 nodes that all mine with different parameters.\n        But first we need to use one node to create a lot of outputs\n        which we will use to generate our transactions.\n        \"\"\"\n        self.add_nodes(3, extra_args=[[\"-maxorphantx=1000\", \"-whitelist=127.0.0.1\"],\n                                      [\"-maxorphantx=1000\", \"-deprecatedrpc=estimatefee\"],\n                                      [\"-maxorphantx=1000\"]])\n        # Use node0 to mine blocks for input splitting\n        # Node1 mines small blocks but that are bigger than the expected transaction rate.\n        # NOTE: the CreateNewBlock code starts counting block size at 1,000 bytes,\n        # (17k is room enough for 110 or so transactions)\n        # Node2 is a stingy miner, that\n        # produces too small blocks (room for only 55 or so transactions)\n\n\n    def transact_and_mine(self, numblocks, mining_node):\n        min_fee = Decimal(\"0.00001\")\n        # We will now mine numblocks blocks generating on average 100 transactions between each block\n        # We shuffle our confirmed txout set before each set of transactions\n        # small_txpuzzle_randfee will use the transactions that have inputs already in the chain when possible\n        # resorting to tx's that depend on the mempool when those run out\n        for i in range(numblocks):\n            random.shuffle(self.confutxo)\n            for j in range(random.randrange(100-50,100+50)):\n                from_index = random.randint(1,2)\n                (txhex, fee) = small_txpuzzle_randfee(self.nodes[from_index], self.confutxo,\n                                                      self.memutxo, Decimal(\"0.005\"), min_fee, min_fee)\n                tx_kbytes = (len(txhex) // 2) / 1000.0\n                self.fees_per_kb.append(float(fee)/tx_kbytes)\n            sync_mempools(self.nodes[0:3], wait=.1)\n            mined = mining_node.getblock(mining_node.generate(1)[0],True)[\"tx\"]\n            sync_blocks(self.nodes[0:3], wait=.1)\n            # update which txouts are confirmed\n            newmem = []\n            for utx in self.memutxo:\n                if utx[\"txid\"] in mined:\n                    self.confutxo.append(utx)\n                else:\n                    newmem.append(utx)\n            self.memutxo = newmem\n\n    def run_test(self):\n        self.log.info(\"This test is time consuming, please be patient\")\n        self.log.info(\"Splitting inputs so we can generate tx's\")\n\n        # Make log handler available to helper functions\n        global log\n        log = self.log\n\n        # Start node0\n        self.start_node(0)\n        self.txouts = []\n        self.txouts2 = []\n        # Split a coinbase into two transaction puzzle outputs\n        split_inputs(self.nodes[0], self.nodes[0].listunspent(0), self.txouts, True)\n\n        # Mine\n        while (len(self.nodes[0].getrawmempool()) > 0):\n            self.nodes[0].generate(1)\n\n        # Repeatedly split those 2 outputs, doubling twice for each rep\n        # Use txouts to monitor the available utxo, since these won't be tracked in wallet\n        reps = 0\n        while (reps < 5):\n            #Double txouts to txouts2\n            while (len(self.txouts)>0):\n                split_inputs(self.nodes[0], self.txouts, self.txouts2)\n            while (len(self.nodes[0].getrawmempool()) > 0):\n                self.nodes[0].generate(1)\n            #Double txouts2 to txouts\n            while (len(self.txouts2)>0):\n                split_inputs(self.nodes[0], self.txouts2, self.txouts)\n            while (len(self.nodes[0].getrawmempool()) > 0):\n                self.nodes[0].generate(1)\n            reps += 1\n        self.log.info(\"Finished splitting\")\n\n        # Now we can connect the other nodes, didn't want to connect them earlier\n        # so the estimates would not be affected by the splitting transactions\n        self.start_node(1)\n        self.start_node(2)\n        connect_nodes(self.nodes[1], 0)\n        connect_nodes(self.nodes[0], 2)\n        connect_nodes(self.nodes[2], 1)\n\n        self.sync_all()\n\n        self.fees_per_kb = []\n        self.memutxo = []\n        self.confutxo = self.txouts # Start with the set of confirmed txouts after splitting\n        self.log.info(\"Will output estimates for 1/2/3/6/15/25 blocks\")\n\n        for i in range(2):\n            self.log.info(\"Creating transactions and mining them with a block size that can't keep up\")\n            # Create transactions and mine 10 small blocks with node 2, but create txs faster than we can mine\n            self.transact_and_mine(10, self.nodes[2])\n            check_estimates(self.nodes[1], self.fees_per_kb, 14)\n\n            self.log.info(\"Creating transactions and mining them at a block size that is just big enough\")\n            # Generate transactions while mining 10 more blocks, this time with node1\n            # which mines blocks with capacity just above the rate that transactions are being created\n            self.transact_and_mine(10, self.nodes[1])\n            check_estimates(self.nodes[1], self.fees_per_kb, 2)\n\n        # Finish by mining a normal-sized block:\n        while len(self.nodes[1].getrawmempool()) > 0:\n            self.nodes[1].generate(1)\n\n        sync_blocks(self.nodes[0:3], wait=.1)\n        self.log.info(\"Final estimates after emptying mempools\")\n        check_estimates(self.nodes[1], self.fees_per_kb, 2)\n\nif __name__ == '__main__':\n    EstimateFeeTest().main()\n"
  },
  {
    "path": "test/functional/feature_help.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2018 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Verify that starting bitcoin with -h works as expected.\"\"\"\nimport subprocess\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal\n\nclass HelpTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    def setup_network(self):\n        self.add_nodes(self.num_nodes)\n        # Don't start the node\n\n    def run_test(self):\n        self.log.info(\"Start bitcoin with -h for help text\")\n        self.nodes[0].start(extra_args=['-h'], stderr=subprocess.PIPE, stdout=subprocess.PIPE)\n        # Node should exit immediately and output help to stdout.\n        ret_code = self.nodes[0].process.wait(timeout=1)\n        assert_equal(ret_code, 0)\n        output = self.nodes[0].process.stdout.read()\n        assert b'Options' in output\n        self.log.info(\"Help text received: {} (...)\".format(output[0:60]))\n        self.nodes[0].running = False\n\n        self.log.info(\"Start bitcoin with -version for version information\")\n        self.nodes[0].start(extra_args=['-version'], stderr=subprocess.PIPE, stdout=subprocess.PIPE)\n        # Node should exit immediately and output version to stdout.\n        ret_code = self.nodes[0].process.wait(timeout=1)\n        assert_equal(ret_code, 0)\n        output = self.nodes[0].process.stdout.read()\n        assert b'version' in output\n        self.log.info(\"Version text received: {} (...)\".format(output[0:60]))\n        # Clean up TestNode state\n        self.nodes[0].running = False\n        self.nodes[0].process = None\n        self.nodes[0].rpc_connected = False\n        self.nodes[0].rpc = None\n\nif __name__ == '__main__':\n    HelpTest().main()\n"
  },
  {
    "path": "test/functional/feature_logging.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test debug logging.\"\"\"\n\nimport os\n\nfrom test_framework.test_framework import BitcoinTestFramework\n\nclass LoggingTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.setup_clean_chain = True\n\n    def run_test(self):\n        # test default log file name\n        assert os.path.isfile(os.path.join(self.nodes[0].datadir, \"regtest\", \"debug.log\"))\n\n        # test alternative log file name in datadir\n        self.restart_node(0, [\"-debuglogfile=foo.log\"])\n        assert os.path.isfile(os.path.join(self.nodes[0].datadir, \"regtest\", \"foo.log\"))\n\n        # test alternative log file name outside datadir\n        tempname = os.path.join(self.options.tmpdir, \"foo.log\")\n        self.restart_node(0, [\"-debuglogfile=%s\" % tempname])\n        assert os.path.isfile(tempname)\n\n        # check that invalid log (relative) will cause error\n        invdir = os.path.join(self.nodes[0].datadir, \"regtest\", \"foo\")\n        invalidname = os.path.join(\"foo\", \"foo.log\")\n        self.stop_node(0)\n        self.assert_start_raises_init_error(0, [\"-debuglogfile=%s\" % (invalidname)],\n                                                \"Error: Could not open debug log file\")\n        assert not os.path.isfile(os.path.join(invdir, \"foo.log\"))\n\n        # check that invalid log (relative) works after path exists\n        self.stop_node(0)\n        os.mkdir(invdir)\n        self.start_node(0, [\"-debuglogfile=%s\" % (invalidname)])\n        assert os.path.isfile(os.path.join(invdir, \"foo.log\"))\n\n        # check that invalid log (absolute) will cause error\n        self.stop_node(0)\n        invdir = os.path.join(self.options.tmpdir, \"foo\")\n        invalidname = os.path.join(invdir, \"foo.log\")\n        self.assert_start_raises_init_error(0, [\"-debuglogfile=%s\" % invalidname],\n                                               \"Error: Could not open debug log file\")\n        assert not os.path.isfile(os.path.join(invdir, \"foo.log\"))\n\n        # check that invalid log (absolute) works after path exists\n        self.stop_node(0)\n        os.mkdir(invdir)\n        self.start_node(0, [\"-debuglogfile=%s\" % (invalidname)])\n        assert os.path.isfile(os.path.join(invdir, \"foo.log\"))\n\n\nif __name__ == '__main__':\n    LoggingTest().main()\n"
  },
  {
    "path": "test/functional/feature_maxuploadtarget.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test behavior of -maxuploadtarget.\n\n* Verify that getdata requests for old blocks (>1week) are dropped\nif uploadtarget has been reached.\n* Verify that getdata requests for recent blocks are respecteved even\nif uploadtarget has been reached.\n* Verify that the upload counters are reset after 24 hours.\n\"\"\"\nfrom collections import defaultdict\nimport time\n\nfrom test_framework.mininode import *\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass TestNode(P2PInterface):\n    def __init__(self):\n        super().__init__()\n        self.block_receive_map = defaultdict(int)\n\n    def on_inv(self, message):\n        pass\n\n    def on_block(self, message):\n        message.block.calc_sha256()\n        self.block_receive_map[message.block.sha256] += 1\n\nclass MaxUploadTest(BitcoinTestFramework):\n \n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n        self.extra_args = [[\"-maxuploadtarget=800\"]]\n\n        # Cache for utxos, as the listunspent may take a long time later in the test\n        self.utxo_cache = []\n\n    def run_test(self):\n        # Before we connect anything, we first set the time on the node\n        # to be in the past, otherwise things break because the CNode\n        # time counters can't be reset backward after initialization\n        old_time = int(time.time() - 2*60*60*24*7)\n        self.nodes[0].setmocktime(old_time)\n\n        # Generate some old blocks\n        self.nodes[0].generate(130)\n\n        # p2p_conns[0] will only request old blocks\n        # p2p_conns[1] will only request new blocks\n        # p2p_conns[2] will test resetting the counters\n        p2p_conns = []\n\n        for _ in range(3):\n            p2p_conns.append(self.nodes[0].add_p2p_connection(TestNode()))\n\n        network_thread_start()\n        for p2pc in p2p_conns:\n            p2pc.wait_for_verack()\n\n        # Test logic begins here\n\n        # Now mine a big block\n        mine_large_block(self.nodes[0], self.utxo_cache)\n\n        # Store the hash; we'll request this later\n        big_old_block = self.nodes[0].getbestblockhash()\n        old_block_size = self.nodes[0].getblock(big_old_block, True)['size']\n        big_old_block = int(big_old_block, 16)\n\n        # Advance to two days ago\n        self.nodes[0].setmocktime(int(time.time()) - 2*60*60*24)\n\n        # Mine one more block, so that the prior block looks old\n        mine_large_block(self.nodes[0], self.utxo_cache)\n\n        # We'll be requesting this new block too\n        big_new_block = self.nodes[0].getbestblockhash()\n        big_new_block = int(big_new_block, 16)\n\n        # p2p_conns[0] will test what happens if we just keep requesting the\n        # the same big old block too many times (expect: disconnect)\n\n        getdata_request = msg_getdata()\n        getdata_request.inv.append(CInv(2, big_old_block))\n\n        max_bytes_per_day = 800*1024*1024\n        daily_buffer = 144 * 4000000\n        max_bytes_available = max_bytes_per_day - daily_buffer\n        success_count = max_bytes_available // old_block_size\n\n        # 576MB will be reserved for relaying new blocks, so expect this to\n        # succeed for ~235 tries.\n        for i in range(success_count):\n            p2p_conns[0].send_message(getdata_request)\n            p2p_conns[0].sync_with_ping()\n            assert_equal(p2p_conns[0].block_receive_map[big_old_block], i+1)\n\n        assert_equal(len(self.nodes[0].getpeerinfo()), 3)\n        # At most a couple more tries should succeed (depending on how long \n        # the test has been running so far).\n        for i in range(3):\n            p2p_conns[0].send_message(getdata_request)\n        p2p_conns[0].wait_for_disconnect()\n        assert_equal(len(self.nodes[0].getpeerinfo()), 2)\n        self.log.info(\"Peer 0 disconnected after downloading old block too many times\")\n\n        # Requesting the current block on p2p_conns[1] should succeed indefinitely,\n        # even when over the max upload target.\n        # We'll try 800 times\n        getdata_request.inv = [CInv(2, big_new_block)]\n        for i in range(800):\n            p2p_conns[1].send_message(getdata_request)\n            p2p_conns[1].sync_with_ping()\n            assert_equal(p2p_conns[1].block_receive_map[big_new_block], i+1)\n\n        self.log.info(\"Peer 1 able to repeatedly download new block\")\n\n        # But if p2p_conns[1] tries for an old block, it gets disconnected too.\n        getdata_request.inv = [CInv(2, big_old_block)]\n        p2p_conns[1].send_message(getdata_request)\n        p2p_conns[1].wait_for_disconnect()\n        assert_equal(len(self.nodes[0].getpeerinfo()), 1)\n\n        self.log.info(\"Peer 1 disconnected after trying to download old block\")\n\n        self.log.info(\"Advancing system time on node to clear counters...\")\n\n        # If we advance the time by 24 hours, then the counters should reset,\n        # and p2p_conns[2] should be able to retrieve the old block.\n        self.nodes[0].setmocktime(int(time.time()))\n        p2p_conns[2].sync_with_ping()\n        p2p_conns[2].send_message(getdata_request)\n        p2p_conns[2].sync_with_ping()\n        assert_equal(p2p_conns[2].block_receive_map[big_old_block], 1)\n\n        self.log.info(\"Peer 2 able to download old block\")\n\n        self.nodes[0].disconnect_p2ps()\n\n        #stop and start node 0 with 1MB maxuploadtarget, whitelist 127.0.0.1\n        self.log.info(\"Restarting nodes with -whitelist=127.0.0.1\")\n        self.stop_node(0)\n        self.start_node(0, [\"-whitelist=127.0.0.1\", \"-maxuploadtarget=1\"])\n\n        # Reconnect to self.nodes[0]\n        self.nodes[0].add_p2p_connection(TestNode())\n\n        network_thread_start()\n        self.nodes[0].p2p.wait_for_verack()\n\n        #retrieve 20 blocks which should be enough to break the 1MB limit\n        getdata_request.inv = [CInv(2, big_new_block)]\n        for i in range(20):\n            self.nodes[0].p2p.send_message(getdata_request)\n            self.nodes[0].p2p.sync_with_ping()\n            assert_equal(self.nodes[0].p2p.block_receive_map[big_new_block], i+1)\n\n        getdata_request.inv = [CInv(2, big_old_block)]\n        self.nodes[0].p2p.send_and_ping(getdata_request)\n        assert_equal(len(self.nodes[0].getpeerinfo()), 1) #node is still connected because of the whitelist\n\n        self.log.info(\"Peer still connected after trying to download old block (whitelisted)\")\n\nif __name__ == '__main__':\n    MaxUploadTest().main()\n"
  },
  {
    "path": "test/functional/feature_minchainwork.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test logic for setting nMinimumChainWork on command line.\n\nNodes don't consider themselves out of \"initial block download\" until\ntheir active chain has more work than nMinimumChainWork.\n\nNodes don't download blocks from a peer unless the peer's best known block\nhas more work than nMinimumChainWork.\n\nWhile in initial block download, nodes won't relay blocks to their peers, so\ntest that this parameter functions as intended by verifying that block relay\nonly succeeds past a given node once its nMinimumChainWork has been exceeded.\n\"\"\"\n\nimport time\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import connect_nodes, assert_equal\n\n# 2 hashes required per regtest block (with no difficulty adjustment)\nREGTEST_WORK_PER_BLOCK = 2\n\nclass MinimumChainWorkTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 3\n\n        self.extra_args = [[], [\"-minimumchainwork=0x65\"], [\"-minimumchainwork=0x65\"]]\n        self.node_min_work = [0, 101, 101]\n\n    def setup_network(self):\n        # This test relies on the chain setup being:\n        # node0 <- node1 <- node2\n        # Before leaving IBD, nodes prefer to download blocks from outbound\n        # peers, so ensure that we're mining on an outbound peer and testing\n        # block relay to inbound peers.\n        self.setup_nodes()\n        for i in range(self.num_nodes-1):\n            connect_nodes(self.nodes[i+1], i)\n\n    def run_test(self):\n        # Start building a chain on node0.  node2 shouldn't be able to sync until node1's\n        # minchainwork is exceeded\n        starting_chain_work = REGTEST_WORK_PER_BLOCK # Genesis block's work\n        self.log.info(\"Testing relay across node %d (minChainWork = %d)\", 1, self.node_min_work[1])\n\n        starting_blockcount = self.nodes[2].getblockcount()\n\n        num_blocks_to_generate = int((self.node_min_work[1] - starting_chain_work) / REGTEST_WORK_PER_BLOCK)\n        self.log.info(\"Generating %d blocks on node0\", num_blocks_to_generate)\n        hashes = self.nodes[0].generate(num_blocks_to_generate)\n\n        self.log.info(\"Node0 current chain work: %s\", self.nodes[0].getblockheader(hashes[-1])['chainwork'])\n\n        # Sleep a few seconds and verify that node2 didn't get any new blocks\n        # or headers.  We sleep, rather than sync_blocks(node0, node1) because\n        # it's reasonable either way for node1 to get the blocks, or not get\n        # them (since they're below node1's minchainwork).\n        time.sleep(3)\n\n        self.log.info(\"Verifying node 2 has no more blocks than before\")\n        self.log.info(\"Blockcounts: %s\", [n.getblockcount() for n in self.nodes])\n        # Node2 shouldn't have any new headers yet, because node1 should not\n        # have relayed anything.\n        assert_equal(len(self.nodes[2].getchaintips()), 1)\n        assert_equal(self.nodes[2].getchaintips()[0]['height'], 0)\n\n        assert self.nodes[1].getbestblockhash() != self.nodes[0].getbestblockhash()\n        assert_equal(self.nodes[2].getblockcount(), starting_blockcount)\n\n        self.log.info(\"Generating one more block\")\n        self.nodes[0].generate(1)\n\n        self.log.info(\"Verifying nodes are all synced\")\n\n        # Because nodes in regtest are all manual connections (eg using\n        # addnode), node1 should not have disconnected node0. If not for that,\n        # we'd expect node1 to have disconnected node0 for serving an\n        # insufficient work chain, in which case we'd need to reconnect them to\n        # continue the test.\n\n        self.sync_all()\n        self.log.info(\"Blockcounts: %s\", [n.getblockcount() for n in self.nodes])\n\nif __name__ == '__main__':\n    MinimumChainWorkTest().main()\n"
  },
  {
    "path": "test/functional/feature_notifications.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the -alertnotify, -blocknotify and -walletnotify options.\"\"\"\nimport os\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal, wait_until, connect_nodes_bi\n\nclass NotificationsTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.setup_clean_chain = True\n\n    def setup_network(self):\n        self.alert_filename = os.path.join(self.options.tmpdir, \"alert.txt\")\n        self.block_filename = os.path.join(self.options.tmpdir, \"blocks.txt\")\n        self.tx_filename = os.path.join(self.options.tmpdir, \"transactions.txt\")\n\n        # -alertnotify and -blocknotify on node0, walletnotify on node1\n        self.extra_args = [[\"-blockversion=2\",\n                            \"-alertnotify=echo %%s >> %s\" % self.alert_filename,\n                            \"-blocknotify=echo %%s >> %s\" % self.block_filename],\n                           [\"-blockversion=211\",\n                            \"-rescan\",\n                            \"-walletnotify=echo %%s >> %s\" % self.tx_filename]]\n        super().setup_network()\n\n    def run_test(self):\n        self.log.info(\"test -blocknotify\")\n        block_count = 10\n        blocks = self.nodes[1].generate(block_count)\n\n        # wait at most 10 seconds for expected file size before reading the content\n        wait_until(lambda: os.path.isfile(self.block_filename) and os.stat(self.block_filename).st_size >= (block_count * 65), timeout=10)\n\n        # file content should equal the generated blocks hashes\n        with open(self.block_filename, 'r') as f:\n            assert_equal(sorted(blocks), sorted(f.read().splitlines()))\n\n        self.log.info(\"test -walletnotify\")\n        # wait at most 10 seconds for expected file size before reading the content\n        wait_until(lambda: os.path.isfile(self.tx_filename) and os.stat(self.tx_filename).st_size >= (block_count * 65), timeout=10)\n\n        # file content should equal the generated transaction hashes\n        txids_rpc = list(map(lambda t: t['txid'], self.nodes[1].listtransactions(\"*\", block_count)))\n        with open(self.tx_filename, 'r') as f:\n            assert_equal(sorted(txids_rpc), sorted(f.read().splitlines()))\n        os.remove(self.tx_filename)\n\n        self.log.info(\"test -walletnotify after rescan\")\n        # restart node to rescan to force wallet notifications\n        self.restart_node(1)\n        connect_nodes_bi(self.nodes, 0, 1)\n\n        wait_until(lambda: os.path.isfile(self.tx_filename) and os.stat(self.tx_filename).st_size >= (block_count * 65), timeout=10)\n\n        # file content should equal the generated transaction hashes\n        txids_rpc = list(map(lambda t: t['txid'], self.nodes[1].listtransactions(\"*\", block_count)))\n        with open(self.tx_filename, 'r') as f:\n            assert_equal(sorted(txids_rpc), sorted(f.read().splitlines()))\n\n        # Mine another 41 up-version blocks. -alertnotify should trigger on the 51st.\n        self.log.info(\"test -alertnotify\")\n        self.nodes[1].generate(41)\n        self.sync_all()\n\n        # Give bitcoind 10 seconds to write the alert notification\n        wait_until(lambda: os.path.isfile(self.alert_filename) and os.path.getsize(self.alert_filename), timeout=10)\n\n        with open(self.alert_filename, 'r', encoding='utf8') as f:\n            alert_text = f.read()\n\n        # Mine more up-version blocks, should not get more alerts:\n        self.nodes[1].generate(2)\n        self.sync_all()\n\n        with open(self.alert_filename, 'r', encoding='utf8') as f:\n            alert_text2 = f.read()\n\n        self.log.info(\"-alertnotify should not continue notifying for more unknown version blocks\")\n        assert_equal(alert_text, alert_text2)\n\nif __name__ == '__main__':\n    NotificationsTest().main()\n"
  },
  {
    "path": "test/functional/feature_nulldummy.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test NULLDUMMY softfork.\n\nConnect to a single node.\nGenerate 2 blocks (save the coinbases for later).\nGenerate 427 more blocks.\n[Policy/Consensus] Check that NULLDUMMY compliant transactions are accepted in the 430th block.\n[Policy] Check that non-NULLDUMMY transactions are rejected before activation.\n[Consensus] Check that the new NULLDUMMY rules are not enforced on the 431st block.\n[Policy/Consensus] Check that the new NULLDUMMY rules are enforced on the 432nd block.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import CTransaction, network_thread_start\nfrom test_framework.blocktools import create_coinbase, create_block, add_witness_commitment\nfrom test_framework.script import CScript\nfrom io import BytesIO\nimport time\n\nNULLDUMMY_ERROR = \"64: non-mandatory-script-verify-flag (Dummy CHECKMULTISIG argument must be zero)\"\n\ndef trueDummy(tx):\n    scriptSig = CScript(tx.vin[0].scriptSig)\n    newscript = []\n    for i in scriptSig:\n        if (len(newscript) == 0):\n            assert(len(i) == 0)\n            newscript.append(b'\\x51')\n        else:\n            newscript.append(i)\n    tx.vin[0].scriptSig = CScript(newscript)\n    tx.rehash()\n\nclass NULLDUMMYTest(BitcoinTestFramework):\n\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.setup_clean_chain = True\n        # This script tests NULLDUMMY activation, which is part of the 'segwit' deployment, so we go through\n        # normal segwit activation here (and don't use the default always-on behaviour).\n        self.extra_args = [['-whitelist=127.0.0.1', '-walletprematurewitness', '-vbparams=segwit:0:999999999999', '-addresstype=legacy', \"-deprecatedrpc=addwitnessaddress\"]]\n\n    def run_test(self):\n        self.address = self.nodes[0].getnewaddress()\n        self.ms_address = self.nodes[0].addmultisigaddress(1,[self.address])['address']\n        self.wit_address = self.nodes[0].addwitnessaddress(self.address)\n        self.wit_ms_address = self.nodes[0].addmultisigaddress(1, [self.address], '', 'p2sh-segwit')['address']\n\n        network_thread_start()\n        self.coinbase_blocks = self.nodes[0].generate(2) # Block 2\n        coinbase_txid = []\n        for i in self.coinbase_blocks:\n            coinbase_txid.append(self.nodes[0].getblock(i)['tx'][0])\n        self.nodes[0].generate(427) # Block 429\n        self.lastblockhash = self.nodes[0].getbestblockhash()\n        self.tip = int(\"0x\" + self.lastblockhash, 0)\n        self.lastblockheight = 429\n        self.lastblocktime = int(time.time()) + 429\n\n        self.log.info(\"Test 1: NULLDUMMY compliant base transactions should be accepted to mempool and mined before activation [430]\")\n        test1txs = [self.create_transaction(self.nodes[0], coinbase_txid[0], self.ms_address, 49)]\n        txid1 = self.nodes[0].sendrawtransaction(bytes_to_hex_str(test1txs[0].serialize_with_witness()), True)\n        test1txs.append(self.create_transaction(self.nodes[0], txid1, self.ms_address, 48))\n        txid2 = self.nodes[0].sendrawtransaction(bytes_to_hex_str(test1txs[1].serialize_with_witness()), True)\n        test1txs.append(self.create_transaction(self.nodes[0], coinbase_txid[1], self.wit_ms_address, 49))\n        txid3 = self.nodes[0].sendrawtransaction(bytes_to_hex_str(test1txs[2].serialize_with_witness()), True)\n        self.block_submit(self.nodes[0], test1txs, False, True)\n\n        self.log.info(\"Test 2: Non-NULLDUMMY base multisig transaction should not be accepted to mempool before activation\")\n        test2tx = self.create_transaction(self.nodes[0], txid2, self.ms_address, 47)\n        trueDummy(test2tx)\n        assert_raises_rpc_error(-26, NULLDUMMY_ERROR, self.nodes[0].sendrawtransaction, bytes_to_hex_str(test2tx.serialize_with_witness()), True)\n\n        self.log.info(\"Test 3: Non-NULLDUMMY base transactions should be accepted in a block before activation [431]\")\n        self.block_submit(self.nodes[0], [test2tx], False, True)\n\n        self.log.info(\"Test 4: Non-NULLDUMMY base multisig transaction is invalid after activation\")\n        test4tx = self.create_transaction(self.nodes[0], test2tx.hash, self.address, 46)\n        test6txs=[CTransaction(test4tx)]\n        trueDummy(test4tx)\n        assert_raises_rpc_error(-26, NULLDUMMY_ERROR, self.nodes[0].sendrawtransaction, bytes_to_hex_str(test4tx.serialize_with_witness()), True)\n        self.block_submit(self.nodes[0], [test4tx])\n\n        self.log.info(\"Test 5: Non-NULLDUMMY P2WSH multisig transaction invalid after activation\")\n        test5tx = self.create_transaction(self.nodes[0], txid3, self.wit_address, 48)\n        test6txs.append(CTransaction(test5tx))\n        test5tx.wit.vtxinwit[0].scriptWitness.stack[0] = b'\\x01'\n        assert_raises_rpc_error(-26, NULLDUMMY_ERROR, self.nodes[0].sendrawtransaction, bytes_to_hex_str(test5tx.serialize_with_witness()), True)\n        self.block_submit(self.nodes[0], [test5tx], True)\n\n        self.log.info(\"Test 6: NULLDUMMY compliant base/witness transactions should be accepted to mempool and in block after activation [432]\")\n        for i in test6txs:\n            self.nodes[0].sendrawtransaction(bytes_to_hex_str(i.serialize_with_witness()), True)\n        self.block_submit(self.nodes[0], test6txs, True, True)\n\n\n    def create_transaction(self, node, txid, to_address, amount):\n        inputs = [{ \"txid\" : txid, \"vout\" : 0}]\n        outputs = { to_address : amount }\n        rawtx = node.createrawtransaction(inputs, outputs)\n        signresult = node.signrawtransaction(rawtx)\n        tx = CTransaction()\n        f = BytesIO(hex_str_to_bytes(signresult['hex']))\n        tx.deserialize(f)\n        return tx\n\n\n    def block_submit(self, node, txs, witness = False, accept = False):\n        block = create_block(self.tip, create_coinbase(self.lastblockheight + 1), self.lastblocktime + 1)\n        block.nVersion = 4\n        for tx in txs:\n            tx.rehash()\n            block.vtx.append(tx)\n        block.hashMerkleRoot = block.calc_merkle_root()\n        witness and add_witness_commitment(block)\n        block.rehash()\n        block.solve()\n        node.submitblock(bytes_to_hex_str(block.serialize(True)))\n        if (accept):\n            assert_equal(node.getbestblockhash(), block.hash)\n            self.tip = block.sha256\n            self.lastblockhash = block.hash\n            self.lastblocktime += 1\n            self.lastblockheight += 1\n        else:\n            assert_equal(node.getbestblockhash(), self.lastblockhash)\n\nif __name__ == '__main__':\n    NULLDUMMYTest().main()\n"
  },
  {
    "path": "test/functional/feature_proxy.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test bitcoind with different proxy configuration.\n\nTest plan:\n- Start bitcoind's with different proxy configurations\n- Use addnode to initiate connections\n- Verify that proxies are connected to, and the right connection command is given\n- Proxy configurations to test on bitcoind side:\n    - `-proxy` (proxy everything)\n    - `-onion` (proxy just onions)\n    - `-proxyrandomize` Circuit randomization\n- Proxy configurations to test on proxy side,\n    - support no authentication (other proxy)\n    - support no authentication + user/pass authentication (Tor)\n    - proxy on IPv6\n\n- Create various proxies (as threads)\n- Create bitcoinds that connect to them\n- Manipulate the bitcoinds using addnode (onetry) an observe effects\n\naddnode connect to IPv4\naddnode connect to IPv6\naddnode connect to onion\naddnode connect to generic DNS name\n\"\"\"\n\nimport socket\nimport os\n\nfrom test_framework.socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    PORT_MIN,\n    PORT_RANGE,\n    assert_equal,\n)\nfrom test_framework.netutil import test_ipv6_local\n\nRANGE_BEGIN = PORT_MIN + 2 * PORT_RANGE  # Start after p2p and rpc ports\n\nclass ProxyTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 4\n\n    def setup_nodes(self):\n        self.have_ipv6 = test_ipv6_local()\n        # Create two proxies on different ports\n        # ... one unauthenticated\n        self.conf1 = Socks5Configuration()\n        self.conf1.addr = ('127.0.0.1', RANGE_BEGIN + (os.getpid() % 1000))\n        self.conf1.unauth = True\n        self.conf1.auth = False\n        # ... one supporting authenticated and unauthenticated (Tor)\n        self.conf2 = Socks5Configuration()\n        self.conf2.addr = ('127.0.0.1', RANGE_BEGIN + 1000 + (os.getpid() % 1000))\n        self.conf2.unauth = True\n        self.conf2.auth = True\n        if self.have_ipv6:\n            # ... one on IPv6 with similar configuration\n            self.conf3 = Socks5Configuration()\n            self.conf3.af = socket.AF_INET6\n            self.conf3.addr = ('::1', RANGE_BEGIN + 2000 + (os.getpid() % 1000))\n            self.conf3.unauth = True\n            self.conf3.auth = True\n        else:\n            self.log.warning(\"Testing without local IPv6 support\")\n\n        self.serv1 = Socks5Server(self.conf1)\n        self.serv1.start()\n        self.serv2 = Socks5Server(self.conf2)\n        self.serv2.start()\n        if self.have_ipv6:\n            self.serv3 = Socks5Server(self.conf3)\n            self.serv3.start()\n\n        # Note: proxies are not used to connect to local nodes\n        # this is because the proxy to use is based on CService.GetNetwork(), which return NET_UNROUTABLE for localhost\n        args = [\n            ['-listen', '-proxy=%s:%i' % (self.conf1.addr),'-proxyrandomize=1'], \n            ['-listen', '-proxy=%s:%i' % (self.conf1.addr),'-onion=%s:%i' % (self.conf2.addr),'-proxyrandomize=0'], \n            ['-listen', '-proxy=%s:%i' % (self.conf2.addr),'-proxyrandomize=1'], \n            []\n            ]\n        if self.have_ipv6:\n            args[3] = ['-listen', '-proxy=[%s]:%i' % (self.conf3.addr),'-proxyrandomize=0', '-noonion']\n        self.add_nodes(self.num_nodes, extra_args=args)\n        self.start_nodes()\n\n    def node_test(self, node, proxies, auth, test_onion=True):\n        rv = []\n        # Test: outgoing IPv4 connection through node\n        node.addnode(\"15.61.23.23:1234\", \"onetry\")\n        cmd = proxies[0].queue.get()\n        assert(isinstance(cmd, Socks5Command))\n        # Note: bitcoind's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6\n        assert_equal(cmd.atyp, AddressType.DOMAINNAME)\n        assert_equal(cmd.addr, b\"15.61.23.23\")\n        assert_equal(cmd.port, 1234)\n        if not auth:\n            assert_equal(cmd.username, None)\n            assert_equal(cmd.password, None)\n        rv.append(cmd)\n\n        if self.have_ipv6:\n            # Test: outgoing IPv6 connection through node\n            node.addnode(\"[1233:3432:2434:2343:3234:2345:6546:4534]:5443\", \"onetry\")\n            cmd = proxies[1].queue.get()\n            assert(isinstance(cmd, Socks5Command))\n            # Note: bitcoind's SOCKS5 implementation only sends atyp DOMAINNAME, even if connecting directly to IPv4/IPv6\n            assert_equal(cmd.atyp, AddressType.DOMAINNAME)\n            assert_equal(cmd.addr, b\"1233:3432:2434:2343:3234:2345:6546:4534\")\n            assert_equal(cmd.port, 5443)\n            if not auth:\n                assert_equal(cmd.username, None)\n                assert_equal(cmd.password, None)\n            rv.append(cmd)\n\n        if test_onion:\n            # Test: outgoing onion connection through node\n            node.addnode(\"bitcoinostk4e4re.onion:34230\", \"onetry\")\n            cmd = proxies[2].queue.get()\n            assert(isinstance(cmd, Socks5Command))\n            assert_equal(cmd.atyp, AddressType.DOMAINNAME)\n            assert_equal(cmd.addr, b\"bitcoinostk4e4re.onion\")\n            assert_equal(cmd.port, 34230)\n            if not auth:\n                assert_equal(cmd.username, None)\n                assert_equal(cmd.password, None)\n            rv.append(cmd)\n\n        # Test: outgoing DNS name connection through node\n        node.addnode(\"node.noumenon:34230\", \"onetry\")\n        cmd = proxies[3].queue.get()\n        assert(isinstance(cmd, Socks5Command))\n        assert_equal(cmd.atyp, AddressType.DOMAINNAME)\n        assert_equal(cmd.addr, b\"node.noumenon\")\n        assert_equal(cmd.port, 34230)\n        if not auth:\n            assert_equal(cmd.username, None)\n            assert_equal(cmd.password, None)\n        rv.append(cmd)\n\n        return rv\n\n    def run_test(self):\n        # basic -proxy\n        self.node_test(self.nodes[0], [self.serv1, self.serv1, self.serv1, self.serv1], False)\n\n        # -proxy plus -onion\n        self.node_test(self.nodes[1], [self.serv1, self.serv1, self.serv2, self.serv1], False)\n\n        # -proxy plus -onion, -proxyrandomize\n        rv = self.node_test(self.nodes[2], [self.serv2, self.serv2, self.serv2, self.serv2], True)\n        # Check that credentials as used for -proxyrandomize connections are unique\n        credentials = set((x.username,x.password) for x in rv)\n        assert_equal(len(credentials), len(rv))\n\n        if self.have_ipv6:\n            # proxy on IPv6 localhost\n            self.node_test(self.nodes[3], [self.serv3, self.serv3, self.serv3, self.serv3], False, False)\n\n        def networks_dict(d):\n            r = {}\n            for x in d['networks']:\n                r[x['name']] = x\n            return r\n\n        # test RPC getnetworkinfo\n        n0 = networks_dict(self.nodes[0].getnetworkinfo())\n        for net in ['ipv4','ipv6','onion']:\n            assert_equal(n0[net]['proxy'], '%s:%i' % (self.conf1.addr))\n            assert_equal(n0[net]['proxy_randomize_credentials'], True)\n        assert_equal(n0['onion']['reachable'], True)\n\n        n1 = networks_dict(self.nodes[1].getnetworkinfo())\n        for net in ['ipv4','ipv6']:\n            assert_equal(n1[net]['proxy'], '%s:%i' % (self.conf1.addr))\n            assert_equal(n1[net]['proxy_randomize_credentials'], False)\n        assert_equal(n1['onion']['proxy'], '%s:%i' % (self.conf2.addr))\n        assert_equal(n1['onion']['proxy_randomize_credentials'], False)\n        assert_equal(n1['onion']['reachable'], True)\n        \n        n2 = networks_dict(self.nodes[2].getnetworkinfo())\n        for net in ['ipv4','ipv6','onion']:\n            assert_equal(n2[net]['proxy'], '%s:%i' % (self.conf2.addr))\n            assert_equal(n2[net]['proxy_randomize_credentials'], True)\n        assert_equal(n2['onion']['reachable'], True)\n\n        if self.have_ipv6:\n            n3 = networks_dict(self.nodes[3].getnetworkinfo())\n            for net in ['ipv4','ipv6']:\n                assert_equal(n3[net]['proxy'], '[%s]:%i' % (self.conf3.addr))\n                assert_equal(n3[net]['proxy_randomize_credentials'], False)\n            assert_equal(n3['onion']['reachable'], False)\n\nif __name__ == '__main__':\n    ProxyTest().main()\n\n"
  },
  {
    "path": "test/functional/feature_pruning.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the pruning code.\n\nWARNING:\nThis test uses 4GB of disk space.\nThis test takes 30 mins or more (up to 2 hours)\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nimport os\n\nMIN_BLOCKS_TO_KEEP = 288\n\n# Rescans start at the earliest block up to 2 hours before a key timestamp, so\n# the manual prune RPC avoids pruning blocks in the same window to be\n# compatible with pruning based on key creation time.\nTIMESTAMP_WINDOW = 2 * 60 * 60\n\n\ndef calc_usage(blockdir):\n    return sum(os.path.getsize(blockdir+f) for f in os.listdir(blockdir) if os.path.isfile(blockdir+f)) / (1024. * 1024.)\n\nclass PruneTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 6\n\n        # Create nodes 0 and 1 to mine.\n        # Create node 2 to test pruning.\n        self.full_node_default_args = [\"-maxreceivebuffer=20000\", \"-checkblocks=5\", \"-limitdescendantcount=100\", \"-limitdescendantsize=5000\", \"-limitancestorcount=100\", \"-limitancestorsize=5000\" ]\n        # Create nodes 3 and 4 to test manual pruning (they will be re-started with manual pruning later)\n        # Create nodes 5 to test wallet in prune mode, but do not connect\n        self.extra_args = [self.full_node_default_args,\n                           self.full_node_default_args,\n                           [\"-maxreceivebuffer=20000\", \"-prune=550\"],\n                           [\"-maxreceivebuffer=20000\"],\n                           [\"-maxreceivebuffer=20000\"],\n                           [\"-prune=550\"]]\n\n    def setup_network(self):\n        self.setup_nodes()\n\n        self.prunedir = self.options.tmpdir + \"/node2/regtest/blocks/\"\n\n        connect_nodes(self.nodes[0], 1)\n        connect_nodes(self.nodes[1], 2)\n        connect_nodes(self.nodes[2], 0)\n        connect_nodes(self.nodes[0], 3)\n        connect_nodes(self.nodes[0], 4)\n        sync_blocks(self.nodes[0:5])\n\n    def setup_nodes(self):\n        self.add_nodes(self.num_nodes, self.extra_args, timewait=900)\n        self.start_nodes()\n\n    def create_big_chain(self):\n        # Start by creating some coinbases we can spend later\n        self.nodes[1].generate(200)\n        sync_blocks(self.nodes[0:2])\n        self.nodes[0].generate(150)\n        # Then mine enough full blocks to create more than 550MiB of data\n        for i in range(645):\n            mine_large_block(self.nodes[0], self.utxo_cache_0)\n\n        sync_blocks(self.nodes[0:5])\n\n    def test_height_min(self):\n        if not os.path.isfile(self.prunedir+\"blk00000.dat\"):\n            raise AssertionError(\"blk00000.dat is missing, pruning too early\")\n        self.log.info(\"Success\")\n        self.log.info(\"Though we're already using more than 550MiB, current usage: %d\" % calc_usage(self.prunedir))\n        self.log.info(\"Mining 25 more blocks should cause the first block file to be pruned\")\n        # Pruning doesn't run until we're allocating another chunk, 20 full blocks past the height cutoff will ensure this\n        for i in range(25):\n            mine_large_block(self.nodes[0], self.utxo_cache_0)\n\n        # Wait for blk00000.dat to be pruned\n        wait_until(lambda: not os.path.isfile(self.prunedir+\"blk00000.dat\"), timeout=30)\n\n        self.log.info(\"Success\")\n        usage = calc_usage(self.prunedir)\n        self.log.info(\"Usage should be below target: %d\" % usage)\n        if (usage > 550):\n            raise AssertionError(\"Pruning target not being met\")\n\n    def create_chain_with_staleblocks(self):\n        # Create stale blocks in manageable sized chunks\n        self.log.info(\"Mine 24 (stale) blocks on Node 1, followed by 25 (main chain) block reorg from Node 0, for 12 rounds\")\n\n        for j in range(12):\n            # Disconnect node 0 so it can mine a longer reorg chain without knowing about node 1's soon-to-be-stale chain\n            # Node 2 stays connected, so it hears about the stale blocks and then reorg's when node0 reconnects\n            # Stopping node 0 also clears its mempool, so it doesn't have node1's transactions to accidentally mine\n            self.stop_node(0)\n            self.start_node(0, extra_args=self.full_node_default_args)\n            # Mine 24 blocks in node 1\n            for i in range(24):\n                if j == 0:\n                    mine_large_block(self.nodes[1], self.utxo_cache_1)\n                else:\n                    # Add node1's wallet transactions back to the mempool, to\n                    # avoid the mined blocks from being too small.\n                    self.nodes[1].resendwallettransactions()\n                    self.nodes[1].generate(1) #tx's already in mempool from previous disconnects\n\n            # Reorg back with 25 block chain from node 0\n            for i in range(25):\n                mine_large_block(self.nodes[0], self.utxo_cache_0)\n\n            # Create connections in the order so both nodes can see the reorg at the same time\n            connect_nodes(self.nodes[1], 0)\n            connect_nodes(self.nodes[2], 0)\n            sync_blocks(self.nodes[0:3])\n\n        self.log.info(\"Usage can be over target because of high stale rate: %d\" % calc_usage(self.prunedir))\n\n    def reorg_test(self):\n        # Node 1 will mine a 300 block chain starting 287 blocks back from Node 0 and Node 2's tip\n        # This will cause Node 2 to do a reorg requiring 288 blocks of undo data to the reorg_test chain\n        # Reboot node 1 to clear its mempool (hopefully make the invalidate faster)\n        # Lower the block max size so we don't keep mining all our big mempool transactions (from disconnected blocks)\n        self.stop_node(1)\n        self.start_node(1, extra_args=[\"-maxreceivebuffer=20000\",\"-checkblocks=5\", \"-disablesafemode\"])\n\n        height = self.nodes[1].getblockcount()\n        self.log.info(\"Current block height: %d\" % height)\n\n        invalidheight = height-287\n        badhash = self.nodes[1].getblockhash(invalidheight)\n        self.log.info(\"Invalidating block %s at height %d\" % (badhash,invalidheight))\n        self.nodes[1].invalidateblock(badhash)\n\n        # We've now switched to our previously mined-24 block fork on node 1, but that's not what we want\n        # So invalidate that fork as well, until we're on the same chain as node 0/2 (but at an ancestor 288 blocks ago)\n        mainchainhash = self.nodes[0].getblockhash(invalidheight - 1)\n        curhash = self.nodes[1].getblockhash(invalidheight - 1)\n        while curhash != mainchainhash:\n            self.nodes[1].invalidateblock(curhash)\n            curhash = self.nodes[1].getblockhash(invalidheight - 1)\n\n        assert(self.nodes[1].getblockcount() == invalidheight - 1)\n        self.log.info(\"New best height: %d\" % self.nodes[1].getblockcount())\n\n        # Reboot node1 to clear those giant tx's from mempool\n        self.stop_node(1)\n        self.start_node(1, extra_args=[\"-maxreceivebuffer=20000\",\"-checkblocks=5\", \"-disablesafemode\"])\n\n        self.log.info(\"Generating new longer chain of 300 more blocks\")\n        self.nodes[1].generate(300)\n\n        self.log.info(\"Reconnect nodes\")\n        connect_nodes(self.nodes[0], 1)\n        connect_nodes(self.nodes[2], 1)\n        sync_blocks(self.nodes[0:3], timeout=120)\n\n        self.log.info(\"Verify height on node 2: %d\" % self.nodes[2].getblockcount())\n        self.log.info(\"Usage possibly still high bc of stale blocks in block files: %d\" % calc_usage(self.prunedir))\n\n        self.log.info(\"Mine 220 more blocks so we have requisite history (some blocks will be big and cause pruning of previous chain)\")\n\n        # Get node0's wallet transactions back in its mempool, to avoid the\n        # mined blocks from being too small.\n        self.nodes[0].resendwallettransactions()\n\n        for i in range(22):\n            # This can be slow, so do this in multiple RPC calls to avoid\n            # RPC timeouts.\n            self.nodes[0].generate(10) #node 0 has many large tx's in its mempool from the disconnects\n        sync_blocks(self.nodes[0:3], timeout=300)\n\n        usage = calc_usage(self.prunedir)\n        self.log.info(\"Usage should be below target: %d\" % usage)\n        if (usage > 550):\n            raise AssertionError(\"Pruning target not being met\")\n\n        return invalidheight,badhash\n\n    def reorg_back(self):\n        # Verify that a block on the old main chain fork has been pruned away\n        assert_raises_rpc_error(-1, \"Block not available (pruned data)\", self.nodes[2].getblock, self.forkhash)\n        self.log.info(\"Will need to redownload block %d\" % self.forkheight)\n\n        # Verify that we have enough history to reorg back to the fork point\n        # Although this is more than 288 blocks, because this chain was written more recently\n        # and only its other 299 small and 220 large block are in the block files after it,\n        # its expected to still be retained\n        self.nodes[2].getblock(self.nodes[2].getblockhash(self.forkheight))\n\n        first_reorg_height = self.nodes[2].getblockcount()\n        curchainhash = self.nodes[2].getblockhash(self.mainchainheight)\n        self.nodes[2].invalidateblock(curchainhash)\n        goalbestheight = self.mainchainheight\n        goalbesthash = self.mainchainhash2\n\n        # As of 0.10 the current block download logic is not able to reorg to the original chain created in\n        # create_chain_with_stale_blocks because it doesn't know of any peer that's on that chain from which to\n        # redownload its missing blocks.\n        # Invalidate the reorg_test chain in node 0 as well, it can successfully switch to the original chain\n        # because it has all the block data.\n        # However it must mine enough blocks to have a more work chain than the reorg_test chain in order\n        # to trigger node 2's block download logic.\n        # At this point node 2 is within 288 blocks of the fork point so it will preserve its ability to reorg\n        if self.nodes[2].getblockcount() < self.mainchainheight:\n            blocks_to_mine = first_reorg_height + 1 - self.mainchainheight\n            self.log.info(\"Rewind node 0 to prev main chain to mine longer chain to trigger redownload. Blocks needed: %d\" % blocks_to_mine)\n            self.nodes[0].invalidateblock(curchainhash)\n            assert(self.nodes[0].getblockcount() == self.mainchainheight)\n            assert(self.nodes[0].getbestblockhash() == self.mainchainhash2)\n            goalbesthash = self.nodes[0].generate(blocks_to_mine)[-1]\n            goalbestheight = first_reorg_height + 1\n\n        self.log.info(\"Verify node 2 reorged back to the main chain, some blocks of which it had to redownload\")\n        # Wait for Node 2 to reorg to proper height\n        wait_until(lambda: self.nodes[2].getblockcount() >= goalbestheight, timeout=900)\n        assert(self.nodes[2].getbestblockhash() == goalbesthash)\n        # Verify we can now have the data for a block previously pruned\n        assert(self.nodes[2].getblock(self.forkhash)[\"height\"] == self.forkheight)\n\n    def manual_test(self, node_number, use_timestamp):\n        # at this point, node has 995 blocks and has not yet run in prune mode\n        self.start_node(node_number)\n        node = self.nodes[node_number]\n        assert_equal(node.getblockcount(), 995)\n        assert_raises_rpc_error(-1, \"not in prune mode\", node.pruneblockchain, 500)\n\n        # now re-start in manual pruning mode\n        self.stop_node(node_number)\n        self.start_node(node_number, extra_args=[\"-prune=1\"])\n        node = self.nodes[node_number]\n        assert_equal(node.getblockcount(), 995)\n\n        def height(index):\n            if use_timestamp:\n                return node.getblockheader(node.getblockhash(index))[\"time\"] + TIMESTAMP_WINDOW\n            else:\n                return index\n\n        def prune(index, expected_ret=None):\n            ret = node.pruneblockchain(height(index))\n            # Check the return value. When use_timestamp is True, just check\n            # that the return value is less than or equal to the expected\n            # value, because when more than one block is generated per second,\n            # a timestamp will not be granular enough to uniquely identify an\n            # individual block.\n            if expected_ret is None:\n                expected_ret = index\n            if use_timestamp:\n                assert_greater_than(ret, 0)\n                assert_greater_than(expected_ret + 1, ret)\n            else:\n                assert_equal(ret, expected_ret)\n\n        def has_block(index):\n            return os.path.isfile(self.options.tmpdir + \"/node{}/regtest/blocks/blk{:05}.dat\".format(node_number, index))\n\n        # should not prune because chain tip of node 3 (995) < PruneAfterHeight (1000)\n        assert_raises_rpc_error(-1, \"Blockchain is too short for pruning\", node.pruneblockchain, height(500))\n\n        # Save block transaction count before pruning, assert value\n        block1_details = node.getblock(node.getblockhash(1))\n        assert_equal(block1_details[\"nTx\"], len(block1_details[\"tx\"]))\n\n        # mine 6 blocks so we are at height 1001 (i.e., above PruneAfterHeight)\n        node.generate(6)\n        assert_equal(node.getblockchaininfo()[\"blocks\"], 1001)\n\n        # Pruned block should still know the number of transactions\n        assert_equal(node.getblockheader(node.getblockhash(1))[\"nTx\"], block1_details[\"nTx\"])\n\n        # negative heights should raise an exception\n        assert_raises_rpc_error(-8, \"Negative\", node.pruneblockchain, -10)\n\n        # height=100 too low to prune first block file so this is a no-op\n        prune(100)\n        if not has_block(0):\n            raise AssertionError(\"blk00000.dat is missing when should still be there\")\n\n        # Does nothing\n        node.pruneblockchain(height(0))\n        if not has_block(0):\n            raise AssertionError(\"blk00000.dat is missing when should still be there\")\n\n        # height=500 should prune first file\n        prune(500)\n        if has_block(0):\n            raise AssertionError(\"blk00000.dat is still there, should be pruned by now\")\n        if not has_block(1):\n            raise AssertionError(\"blk00001.dat is missing when should still be there\")\n\n        # height=650 should prune second file\n        prune(650)\n        if has_block(1):\n            raise AssertionError(\"blk00001.dat is still there, should be pruned by now\")\n\n        # height=1000 should not prune anything more, because tip-288 is in blk00002.dat.\n        prune(1000, 1001 - MIN_BLOCKS_TO_KEEP)\n        if not has_block(2):\n            raise AssertionError(\"blk00002.dat is still there, should be pruned by now\")\n\n        # advance the tip so blk00002.dat and blk00003.dat can be pruned (the last 288 blocks should now be in blk00004.dat)\n        node.generate(288)\n        prune(1000)\n        if has_block(2):\n            raise AssertionError(\"blk00002.dat is still there, should be pruned by now\")\n        if has_block(3):\n            raise AssertionError(\"blk00003.dat is still there, should be pruned by now\")\n\n        # stop node, start back up with auto-prune at 550MB, make sure still runs\n        self.stop_node(node_number)\n        self.start_node(node_number, extra_args=[\"-prune=550\"])\n\n        self.log.info(\"Success\")\n\n    def wallet_test(self):\n        # check that the pruning node's wallet is still in good shape\n        self.log.info(\"Stop and start pruning node to trigger wallet rescan\")\n        self.stop_node(2)\n        self.start_node(2, extra_args=[\"-prune=550\"])\n        self.log.info(\"Success\")\n\n        # check that wallet loads successfully when restarting a pruned node after IBD.\n        # this was reported to fail in #7494.\n        self.log.info(\"Syncing node 5 to test wallet\")\n        connect_nodes(self.nodes[0], 5)\n        nds = [self.nodes[0], self.nodes[5]]\n        sync_blocks(nds, wait=5, timeout=300)\n        self.stop_node(5) #stop and start to trigger rescan\n        self.start_node(5, extra_args=[\"-prune=550\"])\n        self.log.info(\"Success\")\n\n    def run_test(self):\n        self.log.info(\"Warning! This test requires 4GB of disk space and takes over 30 mins (up to 2 hours)\")\n        self.log.info(\"Mining a big blockchain of 995 blocks\")\n\n        # Determine default relay fee\n        self.relayfee = self.nodes[0].getnetworkinfo()[\"relayfee\"]\n\n        # Cache for utxos, as the listunspent may take a long time later in the test\n        self.utxo_cache_0 = []\n        self.utxo_cache_1 = []\n\n        self.create_big_chain()\n        # Chain diagram key:\n        # *   blocks on main chain\n        # +,&,$,@ blocks on other forks\n        # X   invalidated block\n        # N1  Node 1\n        #\n        # Start by mining a simple chain that all nodes have\n        # N0=N1=N2 **...*(995)\n\n        # stop manual-pruning node with 995 blocks\n        self.stop_node(3)\n        self.stop_node(4)\n\n        self.log.info(\"Check that we haven't started pruning yet because we're below PruneAfterHeight\")\n        self.test_height_min()\n        # Extend this chain past the PruneAfterHeight\n        # N0=N1=N2 **...*(1020)\n\n        self.log.info(\"Check that we'll exceed disk space target if we have a very high stale block rate\")\n        self.create_chain_with_staleblocks()\n        # Disconnect N0\n        # And mine a 24 block chain on N1 and a separate 25 block chain on N0\n        # N1=N2 **...*+...+(1044)\n        # N0    **...**...**(1045)\n        #\n        # reconnect nodes causing reorg on N1 and N2\n        # N1=N2 **...*(1020) *...**(1045)\n        #                   \\\n        #                    +...+(1044)\n        #\n        # repeat this process until you have 12 stale forks hanging off the\n        # main chain on N1 and N2\n        # N0    *************************...***************************(1320)\n        #\n        # N1=N2 **...*(1020) *...**(1045) *..         ..**(1295) *...**(1320)\n        #                   \\            \\                      \\\n        #                    +...+(1044)  &..                    $...$(1319)\n\n        # Save some current chain state for later use\n        self.mainchainheight = self.nodes[2].getblockcount()   #1320\n        self.mainchainhash2 = self.nodes[2].getblockhash(self.mainchainheight)\n\n        self.log.info(\"Check that we can survive a 288 block reorg still\")\n        (self.forkheight,self.forkhash) = self.reorg_test() #(1033, )\n        # Now create a 288 block reorg by mining a longer chain on N1\n        # First disconnect N1\n        # Then invalidate 1033 on main chain and 1032 on fork so height is 1032 on main chain\n        # N1   **...*(1020) **...**(1032)X..\n        #                  \\\n        #                   ++...+(1031)X..\n        #\n        # Now mine 300 more blocks on N1\n        # N1    **...*(1020) **...**(1032) @@...@(1332)\n        #                 \\               \\\n        #                  \\               X...\n        #                   \\                 \\\n        #                    ++...+(1031)X..   ..\n        #\n        # Reconnect nodes and mine 220 more blocks on N1\n        # N1    **...*(1020) **...**(1032) @@...@@@(1552)\n        #                 \\               \\\n        #                  \\               X...\n        #                   \\                 \\\n        #                    ++...+(1031)X..   ..\n        #\n        # N2    **...*(1020) **...**(1032) @@...@@@(1552)\n        #                 \\               \\\n        #                  \\               *...**(1320)\n        #                   \\                 \\\n        #                    ++...++(1044)     ..\n        #\n        # N0    ********************(1032) @@...@@@(1552)\n        #                                 \\\n        #                                  *...**(1320)\n\n        self.log.info(\"Test that we can rerequest a block we previously pruned if needed for a reorg\")\n        self.reorg_back()\n        # Verify that N2 still has block 1033 on current chain (@), but not on main chain (*)\n        # Invalidate 1033 on current chain (@) on N2 and we should be able to reorg to\n        # original main chain (*), but will require redownload of some blocks\n        # In order to have a peer we think we can download from, must also perform this invalidation\n        # on N0 and mine a new longest chain to trigger.\n        # Final result:\n        # N0    ********************(1032) **...****(1553)\n        #                                 \\\n        #                                  X@...@@@(1552)\n        #\n        # N2    **...*(1020) **...**(1032) **...****(1553)\n        #                 \\               \\\n        #                  \\               X@...@@@(1552)\n        #                   \\\n        #                    +..\n        #\n        # N1 doesn't change because 1033 on main chain (*) is invalid\n\n        self.log.info(\"Test manual pruning with block indices\")\n        self.manual_test(3, use_timestamp=False)\n\n        self.log.info(\"Test manual pruning with timestamps\")\n        self.manual_test(4, use_timestamp=True)\n\n        self.log.info(\"Test wallet re-scan\")\n        self.wallet_test()\n\n        self.log.info(\"Done\")\n\nif __name__ == '__main__':\n    PruneTest().main()\n"
  },
  {
    "path": "test/functional/feature_rbf.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the RBF code.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.script import *\nfrom test_framework.mininode import *\n\nMAX_REPLACEMENT_LIMIT = 100\n\ndef txToHex(tx):\n    return bytes_to_hex_str(tx.serialize())\n\ndef make_utxo(node, amount, confirmed=True, scriptPubKey=CScript([1])):\n    \"\"\"Create a txout with a given amount and scriptPubKey\n\n    Mines coins as needed.\n\n    confirmed - txouts created will be confirmed in the blockchain;\n                unconfirmed otherwise.\n    \"\"\"\n    fee = 1*COIN\n    while node.getbalance() < satoshi_round((amount + fee)/COIN):\n        node.generate(100)\n\n    new_addr = node.getnewaddress()\n    txid = node.sendtoaddress(new_addr, satoshi_round((amount+fee)/COIN))\n    tx1 = node.getrawtransaction(txid, 1)\n    txid = int(txid, 16)\n    i = None\n\n    for i, txout in enumerate(tx1['vout']):\n        if txout['scriptPubKey']['addresses'] == [new_addr]:\n            break\n    assert i is not None\n\n    tx2 = CTransaction()\n    tx2.vin = [CTxIn(COutPoint(txid, i))]\n    tx2.vout = [CTxOut(amount, scriptPubKey)]\n    tx2.rehash()\n\n    signed_tx = node.signrawtransaction(txToHex(tx2))\n\n    txid = node.sendrawtransaction(signed_tx['hex'], True)\n\n    # If requested, ensure txouts are confirmed.\n    if confirmed:\n        mempool_size = len(node.getrawmempool())\n        while mempool_size > 0:\n            node.generate(1)\n            new_size = len(node.getrawmempool())\n            # Error out if we have something stuck in the mempool, as this\n            # would likely be a bug.\n            assert(new_size < mempool_size)\n            mempool_size = new_size\n\n    return COutPoint(int(txid, 16), 0)\n\nclass ReplaceByFeeTest(BitcoinTestFramework):\n\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.extra_args= [[\"-maxorphantx=1000\",\n                           \"-whitelist=127.0.0.1\",\n                           \"-limitancestorcount=50\",\n                           \"-limitancestorsize=101\",\n                           \"-limitdescendantcount=200\",\n                           \"-limitdescendantsize=101\"],\n                           [\"-mempoolreplacement=0\"]]\n\n    def run_test(self):\n        # Leave IBD\n        self.nodes[0].generate(1)\n\n        make_utxo(self.nodes[0], 1*COIN)\n\n        # Ensure nodes are synced\n        self.sync_all()\n\n        self.log.info(\"Running test simple doublespend...\")\n        self.test_simple_doublespend()\n\n        self.log.info(\"Running test doublespend chain...\")\n        self.test_doublespend_chain()\n\n        self.log.info(\"Running test doublespend tree...\")\n        self.test_doublespend_tree()\n\n        self.log.info(\"Running test replacement feeperkb...\")\n        self.test_replacement_feeperkb()\n\n        self.log.info(\"Running test spends of conflicting outputs...\")\n        self.test_spends_of_conflicting_outputs()\n\n        self.log.info(\"Running test new unconfirmed inputs...\")\n        self.test_new_unconfirmed_inputs()\n\n        self.log.info(\"Running test too many replacements...\")\n        self.test_too_many_replacements()\n\n        self.log.info(\"Running test opt-in...\")\n        self.test_opt_in()\n\n        self.log.info(\"Running test RPC...\")\n        self.test_rpc()\n\n        self.log.info(\"Running test prioritised transactions...\")\n        self.test_prioritised_transactions()\n\n        self.log.info(\"Passed\")\n\n    def test_simple_doublespend(self):\n        \"\"\"Simple doublespend\"\"\"\n        tx0_outpoint = make_utxo(self.nodes[0], int(1.1*COIN))\n\n        # make_utxo may have generated a bunch of blocks, so we need to sync\n        # before we can spend the coins generated, or else the resulting\n        # transactions might not be accepted by our peers.\n        self.sync_all()\n\n        tx1a = CTransaction()\n        tx1a.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        tx1a.vout = [CTxOut(1 * COIN, CScript([b'a' * 35]))]\n        tx1a_hex = txToHex(tx1a)\n        tx1a_txid = self.nodes[0].sendrawtransaction(tx1a_hex, True)\n\n        self.sync_all()\n\n        # Should fail because we haven't changed the fee\n        tx1b = CTransaction()\n        tx1b.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        tx1b.vout = [CTxOut(1 * COIN, CScript([b'b' * 35]))]\n        tx1b_hex = txToHex(tx1b)\n\n        # This will raise an exception due to insufficient fee\n        assert_raises_rpc_error(-26, \"insufficient fee\", self.nodes[0].sendrawtransaction, tx1b_hex, True)\n        # This will raise an exception due to transaction replacement being disabled\n        assert_raises_rpc_error(-26, \"txn-mempool-conflict\", self.nodes[1].sendrawtransaction, tx1b_hex, True)\n\n        # Extra 0.1 BTC fee\n        tx1b = CTransaction()\n        tx1b.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        tx1b.vout = [CTxOut(int(0.9 * COIN), CScript([b'b' * 35]))]\n        tx1b_hex = txToHex(tx1b)\n        # Replacement still disabled even with \"enough fee\"\n        assert_raises_rpc_error(-26, \"txn-mempool-conflict\", self.nodes[1].sendrawtransaction, tx1b_hex, True)\n        # Works when enabled\n        tx1b_txid = self.nodes[0].sendrawtransaction(tx1b_hex, True)\n\n        mempool = self.nodes[0].getrawmempool()\n\n        assert (tx1a_txid not in mempool)\n        assert (tx1b_txid in mempool)\n\n        assert_equal(tx1b_hex, self.nodes[0].getrawtransaction(tx1b_txid))\n\n        # Second node is running mempoolreplacement=0, will not replace originally-seen txn\n        mempool = self.nodes[1].getrawmempool()\n        assert tx1a_txid in mempool\n        assert tx1b_txid not in mempool\n\n    def test_doublespend_chain(self):\n        \"\"\"Doublespend of a long chain\"\"\"\n\n        initial_nValue = 50*COIN\n        tx0_outpoint = make_utxo(self.nodes[0], initial_nValue)\n\n        prevout = tx0_outpoint\n        remaining_value = initial_nValue\n        chain_txids = []\n        while remaining_value > 10*COIN:\n            remaining_value -= 1*COIN\n            tx = CTransaction()\n            tx.vin = [CTxIn(prevout, nSequence=0)]\n            tx.vout = [CTxOut(remaining_value, CScript([1, OP_DROP] * 15 + [1]))]\n            tx_hex = txToHex(tx)\n            txid = self.nodes[0].sendrawtransaction(tx_hex, True)\n            chain_txids.append(txid)\n            prevout = COutPoint(int(txid, 16), 0)\n\n        # Whether the double-spend is allowed is evaluated by including all\n        # child fees - 40 BTC - so this attempt is rejected.\n        dbl_tx = CTransaction()\n        dbl_tx.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        dbl_tx.vout = [CTxOut(initial_nValue - 30 * COIN, CScript([1] * 35))]\n        dbl_tx_hex = txToHex(dbl_tx)\n\n        # This will raise an exception due to insufficient fee\n        assert_raises_rpc_error(-26, \"insufficient fee\", self.nodes[0].sendrawtransaction, dbl_tx_hex, True)\n\n        # Accepted with sufficient fee\n        dbl_tx = CTransaction()\n        dbl_tx.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        dbl_tx.vout = [CTxOut(1 * COIN, CScript([1] * 35))]\n        dbl_tx_hex = txToHex(dbl_tx)\n        self.nodes[0].sendrawtransaction(dbl_tx_hex, True)\n\n        mempool = self.nodes[0].getrawmempool()\n        for doublespent_txid in chain_txids:\n            assert(doublespent_txid not in mempool)\n\n    def test_doublespend_tree(self):\n        \"\"\"Doublespend of a big tree of transactions\"\"\"\n\n        initial_nValue = 50*COIN\n        tx0_outpoint = make_utxo(self.nodes[0], initial_nValue)\n\n        def branch(prevout, initial_value, max_txs, tree_width=5, fee=0.0001*COIN, _total_txs=None):\n            if _total_txs is None:\n                _total_txs = [0]\n            if _total_txs[0] >= max_txs:\n                return\n\n            txout_value = (initial_value - fee) // tree_width\n            if txout_value < fee:\n                return\n\n            vout = [CTxOut(txout_value, CScript([i+1]))\n                    for i in range(tree_width)]\n            tx = CTransaction()\n            tx.vin = [CTxIn(prevout, nSequence=0)]\n            tx.vout = vout\n            tx_hex = txToHex(tx)\n\n            assert(len(tx.serialize()) < 100000)\n            txid = self.nodes[0].sendrawtransaction(tx_hex, True)\n            yield tx\n            _total_txs[0] += 1\n\n            txid = int(txid, 16)\n\n            for i, txout in enumerate(tx.vout):\n                for x in branch(COutPoint(txid, i), txout_value,\n                                  max_txs,\n                                  tree_width=tree_width, fee=fee,\n                                  _total_txs=_total_txs):\n                    yield x\n\n        fee = int(0.0001*COIN)\n        n = MAX_REPLACEMENT_LIMIT\n        tree_txs = list(branch(tx0_outpoint, initial_nValue, n, fee=fee))\n        assert_equal(len(tree_txs), n)\n\n        # Attempt double-spend, will fail because too little fee paid\n        dbl_tx = CTransaction()\n        dbl_tx.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        dbl_tx.vout = [CTxOut(initial_nValue - fee * n, CScript([1] * 35))]\n        dbl_tx_hex = txToHex(dbl_tx)\n        # This will raise an exception due to insufficient fee\n        assert_raises_rpc_error(-26, \"insufficient fee\", self.nodes[0].sendrawtransaction, dbl_tx_hex, True)\n\n        # 1 BTC fee is enough\n        dbl_tx = CTransaction()\n        dbl_tx.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        dbl_tx.vout = [CTxOut(initial_nValue - fee * n - 1 * COIN, CScript([1] * 35))]\n        dbl_tx_hex = txToHex(dbl_tx)\n        self.nodes[0].sendrawtransaction(dbl_tx_hex, True)\n\n        mempool = self.nodes[0].getrawmempool()\n\n        for tx in tree_txs:\n            tx.rehash()\n            assert (tx.hash not in mempool)\n\n        # Try again, but with more total transactions than the \"max txs\n        # double-spent at once\" anti-DoS limit.\n        for n in (MAX_REPLACEMENT_LIMIT+1, MAX_REPLACEMENT_LIMIT*2):\n            fee = int(0.0001*COIN)\n            tx0_outpoint = make_utxo(self.nodes[0], initial_nValue)\n            tree_txs = list(branch(tx0_outpoint, initial_nValue, n, fee=fee))\n            assert_equal(len(tree_txs), n)\n\n            dbl_tx = CTransaction()\n            dbl_tx.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n            dbl_tx.vout = [CTxOut(initial_nValue - 2 * fee * n, CScript([1] * 35))]\n            dbl_tx_hex = txToHex(dbl_tx)\n            # This will raise an exception\n            assert_raises_rpc_error(-26, \"too many potential replacements\", self.nodes[0].sendrawtransaction, dbl_tx_hex, True)\n\n            for tx in tree_txs:\n                tx.rehash()\n                self.nodes[0].getrawtransaction(tx.hash)\n\n    def test_replacement_feeperkb(self):\n        \"\"\"Replacement requires fee-per-KB to be higher\"\"\"\n        tx0_outpoint = make_utxo(self.nodes[0], int(1.1*COIN))\n\n        tx1a = CTransaction()\n        tx1a.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        tx1a.vout = [CTxOut(1 * COIN, CScript([b'a' * 35]))]\n        tx1a_hex = txToHex(tx1a)\n        self.nodes[0].sendrawtransaction(tx1a_hex, True)\n\n        # Higher fee, but the fee per KB is much lower, so the replacement is\n        # rejected.\n        tx1b = CTransaction()\n        tx1b.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        tx1b.vout = [CTxOut(int(0.001*COIN), CScript([b'a'*999000]))]\n        tx1b_hex = txToHex(tx1b)\n\n        # This will raise an exception due to insufficient fee\n        assert_raises_rpc_error(-26, \"insufficient fee\", self.nodes[0].sendrawtransaction, tx1b_hex, True)\n\n    def test_spends_of_conflicting_outputs(self):\n        \"\"\"Replacements that spend conflicting tx outputs are rejected\"\"\"\n        utxo1 = make_utxo(self.nodes[0], int(1.2*COIN))\n        utxo2 = make_utxo(self.nodes[0], 3*COIN)\n\n        tx1a = CTransaction()\n        tx1a.vin = [CTxIn(utxo1, nSequence=0)]\n        tx1a.vout = [CTxOut(int(1.1 * COIN), CScript([b'a' * 35]))]\n        tx1a_hex = txToHex(tx1a)\n        tx1a_txid = self.nodes[0].sendrawtransaction(tx1a_hex, True)\n\n        tx1a_txid = int(tx1a_txid, 16)\n\n        # Direct spend an output of the transaction we're replacing.\n        tx2 = CTransaction()\n        tx2.vin = [CTxIn(utxo1, nSequence=0), CTxIn(utxo2, nSequence=0)]\n        tx2.vin.append(CTxIn(COutPoint(tx1a_txid, 0), nSequence=0))\n        tx2.vout = tx1a.vout\n        tx2_hex = txToHex(tx2)\n\n        # This will raise an exception\n        assert_raises_rpc_error(-26, \"bad-txns-spends-conflicting-tx\", self.nodes[0].sendrawtransaction, tx2_hex, True)\n\n        # Spend tx1a's output to test the indirect case.\n        tx1b = CTransaction()\n        tx1b.vin = [CTxIn(COutPoint(tx1a_txid, 0), nSequence=0)]\n        tx1b.vout = [CTxOut(1 * COIN, CScript([b'a' * 35]))]\n        tx1b_hex = txToHex(tx1b)\n        tx1b_txid = self.nodes[0].sendrawtransaction(tx1b_hex, True)\n        tx1b_txid = int(tx1b_txid, 16)\n\n        tx2 = CTransaction()\n        tx2.vin = [CTxIn(utxo1, nSequence=0), CTxIn(utxo2, nSequence=0),\n                   CTxIn(COutPoint(tx1b_txid, 0))]\n        tx2.vout = tx1a.vout\n        tx2_hex = txToHex(tx2)\n\n        # This will raise an exception\n        assert_raises_rpc_error(-26, \"bad-txns-spends-conflicting-tx\", self.nodes[0].sendrawtransaction, tx2_hex, True)\n\n    def test_new_unconfirmed_inputs(self):\n        \"\"\"Replacements that add new unconfirmed inputs are rejected\"\"\"\n        confirmed_utxo = make_utxo(self.nodes[0], int(1.1*COIN))\n        unconfirmed_utxo = make_utxo(self.nodes[0], int(0.1*COIN), False)\n\n        tx1 = CTransaction()\n        tx1.vin = [CTxIn(confirmed_utxo)]\n        tx1.vout = [CTxOut(1 * COIN, CScript([b'a' * 35]))]\n        tx1_hex = txToHex(tx1)\n        self.nodes[0].sendrawtransaction(tx1_hex, True)\n\n        tx2 = CTransaction()\n        tx2.vin = [CTxIn(confirmed_utxo), CTxIn(unconfirmed_utxo)]\n        tx2.vout = tx1.vout\n        tx2_hex = txToHex(tx2)\n\n        # This will raise an exception\n        assert_raises_rpc_error(-26, \"replacement-adds-unconfirmed\", self.nodes[0].sendrawtransaction, tx2_hex, True)\n\n    def test_too_many_replacements(self):\n        \"\"\"Replacements that evict too many transactions are rejected\"\"\"\n        # Try directly replacing more than MAX_REPLACEMENT_LIMIT\n        # transactions\n\n        # Start by creating a single transaction with many outputs\n        initial_nValue = 10*COIN\n        utxo = make_utxo(self.nodes[0], initial_nValue)\n        fee = int(0.0001*COIN)\n        split_value = int((initial_nValue-fee)/(MAX_REPLACEMENT_LIMIT+1))\n\n        outputs = []\n        for i in range(MAX_REPLACEMENT_LIMIT+1):\n            outputs.append(CTxOut(split_value, CScript([1])))\n\n        splitting_tx = CTransaction()\n        splitting_tx.vin = [CTxIn(utxo, nSequence=0)]\n        splitting_tx.vout = outputs\n        splitting_tx_hex = txToHex(splitting_tx)\n\n        txid = self.nodes[0].sendrawtransaction(splitting_tx_hex, True)\n        txid = int(txid, 16)\n\n        # Now spend each of those outputs individually\n        for i in range(MAX_REPLACEMENT_LIMIT+1):\n            tx_i = CTransaction()\n            tx_i.vin = [CTxIn(COutPoint(txid, i), nSequence=0)]\n            tx_i.vout = [CTxOut(split_value - fee, CScript([b'a' * 35]))]\n            tx_i_hex = txToHex(tx_i)\n            self.nodes[0].sendrawtransaction(tx_i_hex, True)\n\n        # Now create doublespend of the whole lot; should fail.\n        # Need a big enough fee to cover all spending transactions and have\n        # a higher fee rate\n        double_spend_value = (split_value-100*fee)*(MAX_REPLACEMENT_LIMIT+1)\n        inputs = []\n        for i in range(MAX_REPLACEMENT_LIMIT+1):\n            inputs.append(CTxIn(COutPoint(txid, i), nSequence=0))\n        double_tx = CTransaction()\n        double_tx.vin = inputs\n        double_tx.vout = [CTxOut(double_spend_value, CScript([b'a']))]\n        double_tx_hex = txToHex(double_tx)\n\n        # This will raise an exception\n        assert_raises_rpc_error(-26, \"too many potential replacements\", self.nodes[0].sendrawtransaction, double_tx_hex, True)\n\n        # If we remove an input, it should pass\n        double_tx = CTransaction()\n        double_tx.vin = inputs[0:-1]\n        double_tx.vout = [CTxOut(double_spend_value, CScript([b'a']))]\n        double_tx_hex = txToHex(double_tx)\n        self.nodes[0].sendrawtransaction(double_tx_hex, True)\n\n    def test_opt_in(self):\n        \"\"\"Replacing should only work if orig tx opted in\"\"\"\n        tx0_outpoint = make_utxo(self.nodes[0], int(1.1*COIN))\n\n        # Create a non-opting in transaction\n        tx1a = CTransaction()\n        tx1a.vin = [CTxIn(tx0_outpoint, nSequence=0xffffffff)]\n        tx1a.vout = [CTxOut(1 * COIN, CScript([b'a' * 35]))]\n        tx1a_hex = txToHex(tx1a)\n        tx1a_txid = self.nodes[0].sendrawtransaction(tx1a_hex, True)\n\n        # Shouldn't be able to double-spend\n        tx1b = CTransaction()\n        tx1b.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        tx1b.vout = [CTxOut(int(0.9 * COIN), CScript([b'b' * 35]))]\n        tx1b_hex = txToHex(tx1b)\n\n        # This will raise an exception\n        assert_raises_rpc_error(-26, \"txn-mempool-conflict\", self.nodes[0].sendrawtransaction, tx1b_hex, True)\n\n        tx1_outpoint = make_utxo(self.nodes[0], int(1.1*COIN))\n\n        # Create a different non-opting in transaction\n        tx2a = CTransaction()\n        tx2a.vin = [CTxIn(tx1_outpoint, nSequence=0xfffffffe)]\n        tx2a.vout = [CTxOut(1 * COIN, CScript([b'a' * 35]))]\n        tx2a_hex = txToHex(tx2a)\n        tx2a_txid = self.nodes[0].sendrawtransaction(tx2a_hex, True)\n\n        # Still shouldn't be able to double-spend\n        tx2b = CTransaction()\n        tx2b.vin = [CTxIn(tx1_outpoint, nSequence=0)]\n        tx2b.vout = [CTxOut(int(0.9 * COIN), CScript([b'b' * 35]))]\n        tx2b_hex = txToHex(tx2b)\n\n        # This will raise an exception\n        assert_raises_rpc_error(-26, \"txn-mempool-conflict\", self.nodes[0].sendrawtransaction, tx2b_hex, True)\n\n        # Now create a new transaction that spends from tx1a and tx2a\n        # opt-in on one of the inputs\n        # Transaction should be replaceable on either input\n\n        tx1a_txid = int(tx1a_txid, 16)\n        tx2a_txid = int(tx2a_txid, 16)\n\n        tx3a = CTransaction()\n        tx3a.vin = [CTxIn(COutPoint(tx1a_txid, 0), nSequence=0xffffffff),\n                    CTxIn(COutPoint(tx2a_txid, 0), nSequence=0xfffffffd)]\n        tx3a.vout = [CTxOut(int(0.9*COIN), CScript([b'c'])), CTxOut(int(0.9*COIN), CScript([b'd']))]\n        tx3a_hex = txToHex(tx3a)\n\n        self.nodes[0].sendrawtransaction(tx3a_hex, True)\n\n        tx3b = CTransaction()\n        tx3b.vin = [CTxIn(COutPoint(tx1a_txid, 0), nSequence=0)]\n        tx3b.vout = [CTxOut(int(0.5 * COIN), CScript([b'e' * 35]))]\n        tx3b_hex = txToHex(tx3b)\n\n        tx3c = CTransaction()\n        tx3c.vin = [CTxIn(COutPoint(tx2a_txid, 0), nSequence=0)]\n        tx3c.vout = [CTxOut(int(0.5 * COIN), CScript([b'f' * 35]))]\n        tx3c_hex = txToHex(tx3c)\n\n        self.nodes[0].sendrawtransaction(tx3b_hex, True)\n        # If tx3b was accepted, tx3c won't look like a replacement,\n        # but make sure it is accepted anyway\n        self.nodes[0].sendrawtransaction(tx3c_hex, True)\n\n    def test_prioritised_transactions(self):\n        # Ensure that fee deltas used via prioritisetransaction are\n        # correctly used by replacement logic\n\n        # 1. Check that feeperkb uses modified fees\n        tx0_outpoint = make_utxo(self.nodes[0], int(1.1*COIN))\n\n        tx1a = CTransaction()\n        tx1a.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        tx1a.vout = [CTxOut(1 * COIN, CScript([b'a' * 35]))]\n        tx1a_hex = txToHex(tx1a)\n        tx1a_txid = self.nodes[0].sendrawtransaction(tx1a_hex, True)\n\n        # Higher fee, but the actual fee per KB is much lower.\n        tx1b = CTransaction()\n        tx1b.vin = [CTxIn(tx0_outpoint, nSequence=0)]\n        tx1b.vout = [CTxOut(int(0.001*COIN), CScript([b'a'*740000]))]\n        tx1b_hex = txToHex(tx1b)\n\n        # Verify tx1b cannot replace tx1a.\n        assert_raises_rpc_error(-26, \"insufficient fee\", self.nodes[0].sendrawtransaction, tx1b_hex, True)\n\n        # Use prioritisetransaction to set tx1a's fee to 0.\n        self.nodes[0].prioritisetransaction(txid=tx1a_txid, fee_delta=int(-0.1*COIN))\n\n        # Now tx1b should be able to replace tx1a\n        tx1b_txid = self.nodes[0].sendrawtransaction(tx1b_hex, True)\n\n        assert(tx1b_txid in self.nodes[0].getrawmempool())\n\n        # 2. Check that absolute fee checks use modified fee.\n        tx1_outpoint = make_utxo(self.nodes[0], int(1.1*COIN))\n\n        tx2a = CTransaction()\n        tx2a.vin = [CTxIn(tx1_outpoint, nSequence=0)]\n        tx2a.vout = [CTxOut(1 * COIN, CScript([b'a' * 35]))]\n        tx2a_hex = txToHex(tx2a)\n        self.nodes[0].sendrawtransaction(tx2a_hex, True)\n\n        # Lower fee, but we'll prioritise it\n        tx2b = CTransaction()\n        tx2b.vin = [CTxIn(tx1_outpoint, nSequence=0)]\n        tx2b.vout = [CTxOut(int(1.01 * COIN), CScript([b'a' * 35]))]\n        tx2b.rehash()\n        tx2b_hex = txToHex(tx2b)\n\n        # Verify tx2b cannot replace tx2a.\n        assert_raises_rpc_error(-26, \"insufficient fee\", self.nodes[0].sendrawtransaction, tx2b_hex, True)\n\n        # Now prioritise tx2b to have a higher modified fee\n        self.nodes[0].prioritisetransaction(txid=tx2b.hash, fee_delta=int(0.1*COIN))\n\n        # tx2b should now be accepted\n        tx2b_txid = self.nodes[0].sendrawtransaction(tx2b_hex, True)\n\n        assert(tx2b_txid in self.nodes[0].getrawmempool())\n\n    def test_rpc(self):\n        us0 = self.nodes[0].listunspent()[0]\n        ins = [us0]\n        outs = {self.nodes[0].getnewaddress() : Decimal(1.0000000)}\n        rawtx0 = self.nodes[0].createrawtransaction(ins, outs, 0, True)\n        rawtx1 = self.nodes[0].createrawtransaction(ins, outs, 0, False)\n        json0  = self.nodes[0].decoderawtransaction(rawtx0)\n        json1  = self.nodes[0].decoderawtransaction(rawtx1)\n        assert_equal(json0[\"vin\"][0][\"sequence\"], 4294967293)\n        assert_equal(json1[\"vin\"][0][\"sequence\"], 4294967295)\n\n        rawtx2 = self.nodes[0].createrawtransaction([], outs)\n        frawtx2a = self.nodes[0].fundrawtransaction(rawtx2, {\"replaceable\": True})\n        frawtx2b = self.nodes[0].fundrawtransaction(rawtx2, {\"replaceable\": False})\n\n        json0  = self.nodes[0].decoderawtransaction(frawtx2a['hex'])\n        json1  = self.nodes[0].decoderawtransaction(frawtx2b['hex'])\n        assert_equal(json0[\"vin\"][0][\"sequence\"], 4294967293)\n        assert_equal(json1[\"vin\"][0][\"sequence\"], 4294967294)\n\nif __name__ == '__main__':\n    ReplaceByFeeTest().main()\n"
  },
  {
    "path": "test/functional/feature_reindex.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test running bitcoind with -reindex and -reindex-chainstate options.\n\n- Start a single node and generate 3 blocks.\n- Stop the node and restart it with -reindex. Verify that the node has reindexed up to block 3.\n- Stop the node and restart it with -reindex-chainstate. Verify that the node has reindexed up to block 3.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import wait_until\n\nclass ReindexTest(BitcoinTestFramework):\n\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    def reindex(self, justchainstate=False):\n        self.nodes[0].generate(3)\n        blockcount = self.nodes[0].getblockcount()\n        self.stop_nodes()\n        extra_args = [[\"-reindex-chainstate\" if justchainstate else \"-reindex\", \"-checkblockindex=1\"]]\n        self.start_nodes(extra_args)\n        wait_until(lambda: self.nodes[0].getblockcount() == blockcount)\n        self.log.info(\"Success\")\n\n    def run_test(self):\n        self.reindex(False)\n        self.reindex(True)\n        self.reindex(False)\n        self.reindex(True)\n\nif __name__ == '__main__':\n    ReindexTest().main()\n"
  },
  {
    "path": "test/functional/feature_segwit.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the SegWit changeover logic.\"\"\"\n\nfrom test_framework.address import (\n    key_to_p2sh_p2wpkh,\n    key_to_p2wpkh,\n    program_to_witness,\n    script_to_p2sh_p2wsh,\n    script_to_p2wsh,\n)\nfrom test_framework.blocktools import witness_script, send_to_witness\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import sha256, CTransaction, CTxIn, COutPoint, CTxOut, COIN, ToHex, FromHex\nfrom test_framework.address import script_to_p2sh, key_to_p2pkh\nfrom test_framework.script import CScript, OP_HASH160, OP_CHECKSIG, OP_0, hash160, OP_EQUAL, OP_DUP, OP_EQUALVERIFY, OP_1, OP_2, OP_CHECKMULTISIG, OP_TRUE, OP_DROP\nfrom io import BytesIO\n\nNODE_0 = 0\nNODE_2 = 2\nWIT_V0 = 0\nWIT_V1 = 1\n\ndef getutxo(txid):\n    utxo = {}\n    utxo[\"vout\"] = 0\n    utxo[\"txid\"] = txid\n    return utxo\n\ndef find_unspent(node, min_value):\n    for utxo in node.listunspent():\n        if utxo['amount'] >= min_value:\n            return utxo\n\nclass SegWitTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 3\n        # This test tests SegWit both pre and post-activation, so use the normal BIP9 activation.\n        self.extra_args = [[\"-walletprematurewitness\", \"-rpcserialversion=0\", \"-vbparams=segwit:0:999999999999\", \"-addresstype=legacy\", \"-deprecatedrpc=addwitnessaddress\"],\n                           [\"-blockversion=4\", \"-promiscuousmempoolflags=517\", \"-prematurewitness\", \"-walletprematurewitness\", \"-rpcserialversion=1\", \"-vbparams=segwit:0:999999999999\", \"-addresstype=legacy\", \"-deprecatedrpc=addwitnessaddress\"],\n                           [\"-blockversion=536870915\", \"-promiscuousmempoolflags=517\", \"-prematurewitness\", \"-walletprematurewitness\", \"-vbparams=segwit:0:999999999999\", \"-addresstype=legacy\", \"-deprecatedrpc=addwitnessaddress\"]]\n\n    def setup_network(self):\n        super().setup_network()\n        connect_nodes(self.nodes[0], 2)\n        self.sync_all()\n\n    def success_mine(self, node, txid, sign, redeem_script=\"\"):\n        send_to_witness(1, node, getutxo(txid), self.pubkey[0], False, Decimal(\"49.998\"), sign, redeem_script)\n        block = node.generate(1)\n        assert_equal(len(node.getblock(block[0])[\"tx\"]), 2)\n        sync_blocks(self.nodes)\n\n    def skip_mine(self, node, txid, sign, redeem_script=\"\"):\n        send_to_witness(1, node, getutxo(txid), self.pubkey[0], False, Decimal(\"49.998\"), sign, redeem_script)\n        block = node.generate(1)\n        assert_equal(len(node.getblock(block[0])[\"tx\"]), 1)\n        sync_blocks(self.nodes)\n\n    def fail_accept(self, node, error_msg, txid, sign, redeem_script=\"\"):\n        assert_raises_rpc_error(-26, error_msg, send_to_witness, 1, node, getutxo(txid), self.pubkey[0], False, Decimal(\"49.998\"), sign, redeem_script)\n\n    def fail_mine(self, node, txid, sign, redeem_script=\"\"):\n        send_to_witness(1, node, getutxo(txid), self.pubkey[0], False, Decimal(\"49.998\"), sign, redeem_script)\n        assert_raises_rpc_error(-1, \"CreateNewBlock: TestBlockValidity failed\", node.generate, 1)\n        sync_blocks(self.nodes)\n\n    def run_test(self):\n        self.nodes[0].generate(161) #block 161\n\n        self.log.info(\"Verify sigops are counted in GBT with pre-BIP141 rules before the fork\")\n        txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)\n        tmpl = self.nodes[0].getblocktemplate({})\n        assert(tmpl['sizelimit'] == 1000000)\n        assert('weightlimit' not in tmpl)\n        assert(tmpl['sigoplimit'] == 20000)\n        assert(tmpl['transactions'][0]['hash'] == txid)\n        assert(tmpl['transactions'][0]['sigops'] == 2)\n        tmpl = self.nodes[0].getblocktemplate({'rules':['segwit']})\n        assert(tmpl['sizelimit'] == 1000000)\n        assert('weightlimit' not in tmpl)\n        assert(tmpl['sigoplimit'] == 20000)\n        assert(tmpl['transactions'][0]['hash'] == txid)\n        assert(tmpl['transactions'][0]['sigops'] == 2)\n        self.nodes[0].generate(1) #block 162\n\n        balance_presetup = self.nodes[0].getbalance()\n        self.pubkey = []\n        p2sh_ids = [] # p2sh_ids[NODE][VER] is an array of txids that spend to a witness version VER pkscript to an address for NODE embedded in p2sh\n        wit_ids = [] # wit_ids[NODE][VER] is an array of txids that spend to a witness version VER pkscript to an address for NODE via bare witness\n        for i in range(3):\n            newaddress = self.nodes[i].getnewaddress()\n            self.pubkey.append(self.nodes[i].validateaddress(newaddress)[\"pubkey\"])\n            multiscript = CScript([OP_1, hex_str_to_bytes(self.pubkey[-1]), OP_1, OP_CHECKMULTISIG])\n            p2sh_addr = self.nodes[i].addwitnessaddress(newaddress)\n            bip173_addr = self.nodes[i].addwitnessaddress(newaddress, False)\n            p2sh_ms_addr = self.nodes[i].addmultisigaddress(1, [self.pubkey[-1]], '', 'p2sh-segwit')['address']\n            bip173_ms_addr = self.nodes[i].addmultisigaddress(1, [self.pubkey[-1]], '', 'bech32')['address']\n            assert_equal(p2sh_addr, key_to_p2sh_p2wpkh(self.pubkey[-1]))\n            assert_equal(bip173_addr, key_to_p2wpkh(self.pubkey[-1]))\n            assert_equal(p2sh_ms_addr, script_to_p2sh_p2wsh(multiscript))\n            assert_equal(bip173_ms_addr, script_to_p2wsh(multiscript))\n            p2sh_ids.append([])\n            wit_ids.append([])\n            for v in range(2):\n                p2sh_ids[i].append([])\n                wit_ids[i].append([])\n\n        for i in range(5):\n            for n in range(3):\n                for v in range(2):\n                    wit_ids[n][v].append(send_to_witness(v, self.nodes[0], find_unspent(self.nodes[0], 50), self.pubkey[n], False, Decimal(\"49.999\")))\n                    p2sh_ids[n][v].append(send_to_witness(v, self.nodes[0], find_unspent(self.nodes[0], 50), self.pubkey[n], True, Decimal(\"49.999\")))\n\n        self.nodes[0].generate(1) #block 163\n        sync_blocks(self.nodes)\n\n        # Make sure all nodes recognize the transactions as theirs\n        assert_equal(self.nodes[0].getbalance(), balance_presetup - 60*50 + 20*Decimal(\"49.999\") + 50)\n        assert_equal(self.nodes[1].getbalance(), 20*Decimal(\"49.999\"))\n        assert_equal(self.nodes[2].getbalance(), 20*Decimal(\"49.999\"))\n\n        self.nodes[0].generate(260) #block 423\n        sync_blocks(self.nodes)\n\n        self.log.info(\"Verify default node can't accept any witness format txs before fork\")\n        # unsigned, no scriptsig\n        self.fail_accept(self.nodes[0], \"mandatory-script-verify-flag\", wit_ids[NODE_0][WIT_V0][0], False)\n        self.fail_accept(self.nodes[0], \"mandatory-script-verify-flag\", wit_ids[NODE_0][WIT_V1][0], False)\n        self.fail_accept(self.nodes[0], \"mandatory-script-verify-flag\", p2sh_ids[NODE_0][WIT_V0][0], False)\n        self.fail_accept(self.nodes[0], \"mandatory-script-verify-flag\", p2sh_ids[NODE_0][WIT_V1][0], False)\n        # unsigned with redeem script\n        self.fail_accept(self.nodes[0], \"mandatory-script-verify-flag\", p2sh_ids[NODE_0][WIT_V0][0], False, witness_script(False, self.pubkey[0]))\n        self.fail_accept(self.nodes[0], \"mandatory-script-verify-flag\", p2sh_ids[NODE_0][WIT_V1][0], False, witness_script(True, self.pubkey[0]))\n        # signed\n        self.fail_accept(self.nodes[0], \"no-witness-yet\", wit_ids[NODE_0][WIT_V0][0], True)\n        self.fail_accept(self.nodes[0], \"no-witness-yet\", wit_ids[NODE_0][WIT_V1][0], True)\n        self.fail_accept(self.nodes[0], \"no-witness-yet\", p2sh_ids[NODE_0][WIT_V0][0], True)\n        self.fail_accept(self.nodes[0], \"no-witness-yet\", p2sh_ids[NODE_0][WIT_V1][0], True)\n\n        self.log.info(\"Verify witness txs are skipped for mining before the fork\")\n        self.skip_mine(self.nodes[2], wit_ids[NODE_2][WIT_V0][0], True) #block 424\n        self.skip_mine(self.nodes[2], wit_ids[NODE_2][WIT_V1][0], True) #block 425\n        self.skip_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V0][0], True) #block 426\n        self.skip_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V1][0], True) #block 427\n\n        # TODO: An old node would see these txs without witnesses and be able to mine them\n\n        self.log.info(\"Verify unsigned bare witness txs in versionbits-setting blocks are valid before the fork\")\n        self.success_mine(self.nodes[2], wit_ids[NODE_2][WIT_V0][1], False) #block 428\n        self.success_mine(self.nodes[2], wit_ids[NODE_2][WIT_V1][1], False) #block 429\n\n        self.log.info(\"Verify unsigned p2sh witness txs without a redeem script are invalid\")\n        self.fail_accept(self.nodes[2], \"mandatory-script-verify-flag\", p2sh_ids[NODE_2][WIT_V0][1], False)\n        self.fail_accept(self.nodes[2], \"mandatory-script-verify-flag\", p2sh_ids[NODE_2][WIT_V1][1], False)\n\n        self.log.info(\"Verify unsigned p2sh witness txs with a redeem script in versionbits-settings blocks are valid before the fork\")\n        self.success_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V0][1], False, witness_script(False, self.pubkey[2])) #block 430\n        self.success_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V1][1], False, witness_script(True, self.pubkey[2])) #block 431\n\n        self.log.info(\"Verify previous witness txs skipped for mining can now be mined\")\n        assert_equal(len(self.nodes[2].getrawmempool()), 4)\n        block = self.nodes[2].generate(1) #block 432 (first block with new rules; 432 = 144 * 3)\n        sync_blocks(self.nodes)\n        assert_equal(len(self.nodes[2].getrawmempool()), 0)\n        segwit_tx_list = self.nodes[2].getblock(block[0])[\"tx\"]\n        assert_equal(len(segwit_tx_list), 5)\n\n        self.log.info(\"Verify block and transaction serialization rpcs return differing serializations depending on rpc serialization flag\")\n        assert(self.nodes[2].getblock(block[0], False) !=  self.nodes[0].getblock(block[0], False))\n        assert(self.nodes[1].getblock(block[0], False) ==  self.nodes[2].getblock(block[0], False))\n        for i in range(len(segwit_tx_list)):\n            tx = FromHex(CTransaction(), self.nodes[2].gettransaction(segwit_tx_list[i])[\"hex\"])\n            assert(self.nodes[2].getrawtransaction(segwit_tx_list[i]) != self.nodes[0].getrawtransaction(segwit_tx_list[i]))\n            assert(self.nodes[1].getrawtransaction(segwit_tx_list[i], 0) == self.nodes[2].getrawtransaction(segwit_tx_list[i]))\n            assert(self.nodes[0].getrawtransaction(segwit_tx_list[i]) != self.nodes[2].gettransaction(segwit_tx_list[i])[\"hex\"])\n            assert(self.nodes[1].getrawtransaction(segwit_tx_list[i]) == self.nodes[2].gettransaction(segwit_tx_list[i])[\"hex\"])\n            assert(self.nodes[0].getrawtransaction(segwit_tx_list[i]) == bytes_to_hex_str(tx.serialize_without_witness()))\n\n        self.log.info(\"Verify witness txs without witness data are invalid after the fork\")\n        self.fail_mine(self.nodes[2], wit_ids[NODE_2][WIT_V0][2], False)\n        self.fail_mine(self.nodes[2], wit_ids[NODE_2][WIT_V1][2], False)\n        self.fail_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V0][2], False, witness_script(False, self.pubkey[2]))\n        self.fail_mine(self.nodes[2], p2sh_ids[NODE_2][WIT_V1][2], False, witness_script(True, self.pubkey[2]))\n\n        self.log.info(\"Verify default node can now use witness txs\")\n        self.success_mine(self.nodes[0], wit_ids[NODE_0][WIT_V0][0], True) #block 432\n        self.success_mine(self.nodes[0], wit_ids[NODE_0][WIT_V1][0], True) #block 433\n        self.success_mine(self.nodes[0], p2sh_ids[NODE_0][WIT_V0][0], True) #block 434\n        self.success_mine(self.nodes[0], p2sh_ids[NODE_0][WIT_V1][0], True) #block 435\n\n        self.log.info(\"Verify sigops are counted in GBT with BIP141 rules after the fork\")\n        txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)\n        tmpl = self.nodes[0].getblocktemplate({'rules':['segwit']})\n        assert(tmpl['sizelimit'] >= 3999577)  # actual maximum size is lower due to minimum mandatory non-witness data\n        assert(tmpl['weightlimit'] == 4000000)\n        assert(tmpl['sigoplimit'] == 80000)\n        assert(tmpl['transactions'][0]['txid'] == txid)\n        assert(tmpl['transactions'][0]['sigops'] == 8)\n\n        self.nodes[0].generate(1) # Mine a block to clear the gbt cache\n\n        self.log.info(\"Non-segwit miners are able to use GBT response after activation.\")\n        # Create a 3-tx chain: tx1 (non-segwit input, paying to a segwit output) ->\n        #                      tx2 (segwit input, paying to a non-segwit output) ->\n        #                      tx3 (non-segwit input, paying to a non-segwit output).\n        # tx1 is allowed to appear in the block, but no others.\n        txid1 = send_to_witness(1, self.nodes[0], find_unspent(self.nodes[0], 50), self.pubkey[0], False, Decimal(\"49.996\"))\n        hex_tx = self.nodes[0].gettransaction(txid)['hex']\n        tx = FromHex(CTransaction(), hex_tx)\n        assert(tx.wit.is_null()) # This should not be a segwit input\n        assert(txid1 in self.nodes[0].getrawmempool())\n\n        # Now create tx2, which will spend from txid1.\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(int(txid1, 16), 0), b''))\n        tx.vout.append(CTxOut(int(49.99 * COIN), CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])))\n        tx2_hex = self.nodes[0].signrawtransaction(ToHex(tx))['hex']\n        txid2 = self.nodes[0].sendrawtransaction(tx2_hex)\n        tx = FromHex(CTransaction(), tx2_hex)\n        assert(not tx.wit.is_null())\n\n        # Now create tx3, which will spend from txid2\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(int(txid2, 16), 0), b\"\"))\n        tx.vout.append(CTxOut(int(49.95 * COIN), CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])))  # Huge fee\n        tx.calc_sha256()\n        txid3 = self.nodes[0].sendrawtransaction(ToHex(tx))\n        assert(tx.wit.is_null())\n        assert(txid3 in self.nodes[0].getrawmempool())\n\n        # Now try calling getblocktemplate() without segwit support.\n        template = self.nodes[0].getblocktemplate()\n\n        # Check that tx1 is the only transaction of the 3 in the template.\n        template_txids = [ t['txid'] for t in template['transactions'] ]\n        assert(txid2 not in template_txids and txid3 not in template_txids)\n        assert(txid1 in template_txids)\n\n        # Check that running with segwit support results in all 3 being included.\n        template = self.nodes[0].getblocktemplate({\"rules\": [\"segwit\"]})\n        template_txids = [ t['txid'] for t in template['transactions'] ]\n        assert(txid1 in template_txids)\n        assert(txid2 in template_txids)\n        assert(txid3 in template_txids)\n\n        # Check that wtxid is properly reported in mempool entry\n        assert_equal(int(self.nodes[0].getmempoolentry(txid3)[\"wtxid\"], 16), tx.calc_sha256(True))\n\n        # Mine a block to clear the gbt cache again.\n        self.nodes[0].generate(1)\n\n        self.log.info(\"Verify behaviour of importaddress, addwitnessaddress and listunspent\")\n\n        # Some public keys to be used later\n        pubkeys = [\n            \"0363D44AABD0F1699138239DF2F042C3282C0671CC7A76826A55C8203D90E39242\", # cPiM8Ub4heR9NBYmgVzJQiUH1if44GSBGiqaeJySuL2BKxubvgwb\n            \"02D3E626B3E616FC8662B489C123349FECBFC611E778E5BE739B257EAE4721E5BF\", # cPpAdHaD6VoYbW78kveN2bsvb45Q7G5PhaPApVUGwvF8VQ9brD97\n            \"04A47F2CBCEFFA7B9BCDA184E7D5668D3DA6F9079AD41E422FA5FD7B2D458F2538A62F5BD8EC85C2477F39650BD391EA6250207065B2A81DA8B009FC891E898F0E\", # 91zqCU5B9sdWxzMt1ca3VzbtVm2YM6Hi5Rxn4UDtxEaN9C9nzXV\n            \"02A47F2CBCEFFA7B9BCDA184E7D5668D3DA6F9079AD41E422FA5FD7B2D458F2538\", # cPQFjcVRpAUBG8BA9hzr2yEzHwKoMgLkJZBBtK9vJnvGJgMjzTbd\n            \"036722F784214129FEB9E8129D626324F3F6716555B603FFE8300BBCB882151228\", # cQGtcm34xiLjB1v7bkRa4V3aAc9tS2UTuBZ1UnZGeSeNy627fN66\n            \"0266A8396EE936BF6D99D17920DB21C6C7B1AB14C639D5CD72B300297E416FD2EC\", # cTW5mR5M45vHxXkeChZdtSPozrFwFgmEvTNnanCW6wrqwaCZ1X7K\n            \"0450A38BD7F0AC212FEBA77354A9B036A32E0F7C81FC4E0C5ADCA7C549C4505D2522458C2D9AE3CEFD684E039194B72C8A10F9CB9D4764AB26FCC2718D421D3B84\", # 92h2XPssjBpsJN5CqSP7v9a7cf2kgDunBC6PDFwJHMACM1rrVBJ\n        ]\n\n        # Import a compressed key and an uncompressed key, generate some multisig addresses\n        self.nodes[0].importprivkey(\"92e6XLo5jVAVwrQKPNTs93oQco8f8sDNBcpv73Dsrs397fQtFQn\")\n        uncompressed_spendable_address = [\"mvozP4UwyGD2mGZU4D2eMvMLPB9WkMmMQu\"]\n        self.nodes[0].importprivkey(\"cNC8eQ5dg3mFAVePDX4ddmPYpPbw41r9bm2jd1nLJT77e6RrzTRR\")\n        compressed_spendable_address = [\"mmWQubrDomqpgSYekvsU7HWEVjLFHAakLe\"]\n        assert ((self.nodes[0].validateaddress(uncompressed_spendable_address[0])['iscompressed'] == False))\n        assert ((self.nodes[0].validateaddress(compressed_spendable_address[0])['iscompressed'] == True))\n\n        self.nodes[0].importpubkey(pubkeys[0])\n        compressed_solvable_address = [key_to_p2pkh(pubkeys[0])]\n        self.nodes[0].importpubkey(pubkeys[1])\n        compressed_solvable_address.append(key_to_p2pkh(pubkeys[1]))\n        self.nodes[0].importpubkey(pubkeys[2])\n        uncompressed_solvable_address = [key_to_p2pkh(pubkeys[2])]\n\n        spendable_anytime = []                      # These outputs should be seen anytime after importprivkey and addmultisigaddress\n        spendable_after_importaddress = []          # These outputs should be seen after importaddress\n        solvable_after_importaddress = []           # These outputs should be seen after importaddress but not spendable\n        unsolvable_after_importaddress = []         # These outputs should be unsolvable after importaddress\n        solvable_anytime = []                       # These outputs should be solvable after importpubkey\n        unseen_anytime = []                         # These outputs should never be seen\n\n        uncompressed_spendable_address.append(self.nodes[0].addmultisigaddress(2, [uncompressed_spendable_address[0], compressed_spendable_address[0]])['address'])\n        uncompressed_spendable_address.append(self.nodes[0].addmultisigaddress(2, [uncompressed_spendable_address[0], uncompressed_spendable_address[0]])['address'])\n        compressed_spendable_address.append(self.nodes[0].addmultisigaddress(2, [compressed_spendable_address[0], compressed_spendable_address[0]])['address'])\n        uncompressed_solvable_address.append(self.nodes[0].addmultisigaddress(2, [compressed_spendable_address[0], uncompressed_solvable_address[0]])['address'])\n        compressed_solvable_address.append(self.nodes[0].addmultisigaddress(2, [compressed_spendable_address[0], compressed_solvable_address[0]])['address'])\n        compressed_solvable_address.append(self.nodes[0].addmultisigaddress(2, [compressed_solvable_address[0], compressed_solvable_address[1]])['address'])\n        unknown_address = [\"mtKKyoHabkk6e4ppT7NaM7THqPUt7AzPrT\", \"2NDP3jLWAFT8NDAiUa9qiE6oBt2awmMq7Dx\"]\n\n        # Test multisig_without_privkey\n        # We have 2 public keys without private keys, use addmultisigaddress to add to wallet.\n        # Money sent to P2SH of multisig of this should only be seen after importaddress with the BASE58 P2SH address.\n\n        multisig_without_privkey_address = self.nodes[0].addmultisigaddress(2, [pubkeys[3], pubkeys[4]])['address']\n        script = CScript([OP_2, hex_str_to_bytes(pubkeys[3]), hex_str_to_bytes(pubkeys[4]), OP_2, OP_CHECKMULTISIG])\n        solvable_after_importaddress.append(CScript([OP_HASH160, hash160(script), OP_EQUAL]))\n\n        for i in compressed_spendable_address:\n            v = self.nodes[0].validateaddress(i)\n            if (v['isscript']):\n                [bare, p2sh, p2wsh, p2sh_p2wsh] = self.p2sh_address_to_script(v)\n                # bare and p2sh multisig with compressed keys should always be spendable\n                spendable_anytime.extend([bare, p2sh])\n                # P2WSH and P2SH(P2WSH) multisig with compressed keys are spendable after direct importaddress\n                spendable_after_importaddress.extend([p2wsh, p2sh_p2wsh])\n            else:\n                [p2wpkh, p2sh_p2wpkh, p2pk, p2pkh, p2sh_p2pk, p2sh_p2pkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh] = self.p2pkh_address_to_script(v)\n                # normal P2PKH and P2PK with compressed keys should always be spendable\n                spendable_anytime.extend([p2pkh, p2pk])\n                # P2SH_P2PK, P2SH_P2PKH with compressed keys are spendable after direct importaddress\n                spendable_after_importaddress.extend([p2sh_p2pk, p2sh_p2pkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh])\n                # P2WPKH and P2SH_P2WPKH with compressed keys should always be spendable\n                spendable_anytime.extend([p2wpkh, p2sh_p2wpkh])\n\n        for i in uncompressed_spendable_address:\n            v = self.nodes[0].validateaddress(i)\n            if (v['isscript']):\n                [bare, p2sh, p2wsh, p2sh_p2wsh] = self.p2sh_address_to_script(v)\n                # bare and p2sh multisig with uncompressed keys should always be spendable\n                spendable_anytime.extend([bare, p2sh])\n                # P2WSH and P2SH(P2WSH) multisig with uncompressed keys are never seen\n                unseen_anytime.extend([p2wsh, p2sh_p2wsh])\n            else:\n                [p2wpkh, p2sh_p2wpkh, p2pk, p2pkh, p2sh_p2pk, p2sh_p2pkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh] = self.p2pkh_address_to_script(v)\n                # normal P2PKH and P2PK with uncompressed keys should always be spendable\n                spendable_anytime.extend([p2pkh, p2pk])\n                # P2SH_P2PK and P2SH_P2PKH are spendable after direct importaddress\n                spendable_after_importaddress.extend([p2sh_p2pk, p2sh_p2pkh])\n                # Witness output types with uncompressed keys are never seen\n                unseen_anytime.extend([p2wpkh, p2sh_p2wpkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh])\n\n        for i in compressed_solvable_address:\n            v = self.nodes[0].validateaddress(i)\n            if (v['isscript']):\n                # Multisig without private is not seen after addmultisigaddress, but seen after importaddress\n                [bare, p2sh, p2wsh, p2sh_p2wsh] = self.p2sh_address_to_script(v)\n                solvable_after_importaddress.extend([bare, p2sh, p2wsh, p2sh_p2wsh])\n            else:\n                [p2wpkh, p2sh_p2wpkh, p2pk, p2pkh, p2sh_p2pk, p2sh_p2pkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh] = self.p2pkh_address_to_script(v)\n                # normal P2PKH, P2PK, P2WPKH and P2SH_P2WPKH with compressed keys should always be seen\n                solvable_anytime.extend([p2pkh, p2pk, p2wpkh, p2sh_p2wpkh])\n                # P2SH_P2PK, P2SH_P2PKH with compressed keys are seen after direct importaddress\n                solvable_after_importaddress.extend([p2sh_p2pk, p2sh_p2pkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh])\n\n        for i in uncompressed_solvable_address:\n            v = self.nodes[0].validateaddress(i)\n            if (v['isscript']):\n                [bare, p2sh, p2wsh, p2sh_p2wsh] = self.p2sh_address_to_script(v)\n                # Base uncompressed multisig without private is not seen after addmultisigaddress, but seen after importaddress\n                solvable_after_importaddress.extend([bare, p2sh])\n                # P2WSH and P2SH(P2WSH) multisig with uncompressed keys are never seen\n                unseen_anytime.extend([p2wsh, p2sh_p2wsh])\n            else:\n                [p2wpkh, p2sh_p2wpkh, p2pk, p2pkh, p2sh_p2pk, p2sh_p2pkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh] = self.p2pkh_address_to_script(v)\n                # normal P2PKH and P2PK with uncompressed keys should always be seen\n                solvable_anytime.extend([p2pkh, p2pk])\n                # P2SH_P2PK, P2SH_P2PKH with uncompressed keys are seen after direct importaddress\n                solvable_after_importaddress.extend([p2sh_p2pk, p2sh_p2pkh])\n                # Witness output types with uncompressed keys are never seen\n                unseen_anytime.extend([p2wpkh, p2sh_p2wpkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh])\n\n        op1 = CScript([OP_1])\n        op0 = CScript([OP_0])\n        # 2N7MGY19ti4KDMSzRfPAssP6Pxyuxoi6jLe is the P2SH(P2PKH) version of mjoE3sSrb8ByYEvgnC3Aox86u1CHnfJA4V\n        unsolvable_address = [\"mjoE3sSrb8ByYEvgnC3Aox86u1CHnfJA4V\", \"2N7MGY19ti4KDMSzRfPAssP6Pxyuxoi6jLe\", script_to_p2sh(op1), script_to_p2sh(op0)]\n        unsolvable_address_key = hex_str_to_bytes(\"02341AEC7587A51CDE5279E0630A531AEA2615A9F80B17E8D9376327BAEAA59E3D\")\n        unsolvablep2pkh = CScript([OP_DUP, OP_HASH160, hash160(unsolvable_address_key), OP_EQUALVERIFY, OP_CHECKSIG])\n        unsolvablep2wshp2pkh = CScript([OP_0, sha256(unsolvablep2pkh)])\n        p2shop0 = CScript([OP_HASH160, hash160(op0), OP_EQUAL])\n        p2wshop1 = CScript([OP_0, sha256(op1)])\n        unsolvable_after_importaddress.append(unsolvablep2pkh)\n        unsolvable_after_importaddress.append(unsolvablep2wshp2pkh)\n        unsolvable_after_importaddress.append(op1) # OP_1 will be imported as script\n        unsolvable_after_importaddress.append(p2wshop1)\n        unseen_anytime.append(op0) # OP_0 will be imported as P2SH address with no script provided\n        unsolvable_after_importaddress.append(p2shop0)\n\n        spendable_txid = []\n        solvable_txid = []\n        spendable_txid.append(self.mine_and_test_listunspent(spendable_anytime, 2))\n        solvable_txid.append(self.mine_and_test_listunspent(solvable_anytime, 1))\n        self.mine_and_test_listunspent(spendable_after_importaddress + solvable_after_importaddress + unseen_anytime + unsolvable_after_importaddress, 0)\n\n        importlist = []\n        for i in compressed_spendable_address + uncompressed_spendable_address + compressed_solvable_address + uncompressed_solvable_address:\n            v = self.nodes[0].validateaddress(i)\n            if (v['isscript']):\n                bare = hex_str_to_bytes(v['hex'])\n                importlist.append(bytes_to_hex_str(bare))\n                importlist.append(bytes_to_hex_str(CScript([OP_0, sha256(bare)])))\n            else:\n                pubkey = hex_str_to_bytes(v['pubkey'])\n                p2pk = CScript([pubkey, OP_CHECKSIG])\n                p2pkh = CScript([OP_DUP, OP_HASH160, hash160(pubkey), OP_EQUALVERIFY, OP_CHECKSIG])\n                importlist.append(bytes_to_hex_str(p2pk))\n                importlist.append(bytes_to_hex_str(p2pkh))\n                importlist.append(bytes_to_hex_str(CScript([OP_0, hash160(pubkey)])))\n                importlist.append(bytes_to_hex_str(CScript([OP_0, sha256(p2pk)])))\n                importlist.append(bytes_to_hex_str(CScript([OP_0, sha256(p2pkh)])))\n\n        importlist.append(bytes_to_hex_str(unsolvablep2pkh))\n        importlist.append(bytes_to_hex_str(unsolvablep2wshp2pkh))\n        importlist.append(bytes_to_hex_str(op1))\n        importlist.append(bytes_to_hex_str(p2wshop1))\n\n        for i in importlist:\n            # import all generated addresses. The wallet already has the private keys for some of these, so catch JSON RPC\n            # exceptions and continue.\n            try_rpc(-4, \"The wallet already contains the private key for this address or script\", self.nodes[0].importaddress, i, \"\", False, True)\n\n        self.nodes[0].importaddress(script_to_p2sh(op0)) # import OP_0 as address only\n        self.nodes[0].importaddress(multisig_without_privkey_address) # Test multisig_without_privkey\n\n        spendable_txid.append(self.mine_and_test_listunspent(spendable_anytime + spendable_after_importaddress, 2))\n        solvable_txid.append(self.mine_and_test_listunspent(solvable_anytime + solvable_after_importaddress, 1))\n        self.mine_and_test_listunspent(unsolvable_after_importaddress, 1)\n        self.mine_and_test_listunspent(unseen_anytime, 0)\n\n        # addwitnessaddress should refuse to return a witness address if an uncompressed key is used\n        # note that no witness address should be returned by unsolvable addresses\n        for i in uncompressed_spendable_address + uncompressed_solvable_address + unknown_address + unsolvable_address:\n            assert_raises_rpc_error(-4, \"Public key or redeemscript not known to wallet, or the key is uncompressed\", self.nodes[0].addwitnessaddress, i)\n\n        # addwitnessaddress should return a witness addresses even if keys are not in the wallet\n        self.nodes[0].addwitnessaddress(multisig_without_privkey_address)\n\n        for i in compressed_spendable_address + compressed_solvable_address:\n            witaddress = self.nodes[0].addwitnessaddress(i)\n            # addwitnessaddress should return the same address if it is a known P2SH-witness address\n            assert_equal(witaddress, self.nodes[0].addwitnessaddress(witaddress))\n\n        spendable_txid.append(self.mine_and_test_listunspent(spendable_anytime + spendable_after_importaddress, 2))\n        solvable_txid.append(self.mine_and_test_listunspent(solvable_anytime + solvable_after_importaddress, 1))\n        self.mine_and_test_listunspent(unsolvable_after_importaddress, 1)\n        self.mine_and_test_listunspent(unseen_anytime, 0)\n\n        # Repeat some tests. This time we don't add witness scripts with importaddress\n        # Import a compressed key and an uncompressed key, generate some multisig addresses\n        self.nodes[0].importprivkey(\"927pw6RW8ZekycnXqBQ2JS5nPyo1yRfGNN8oq74HeddWSpafDJH\")\n        uncompressed_spendable_address = [\"mguN2vNSCEUh6rJaXoAVwY3YZwZvEmf5xi\"]\n        self.nodes[0].importprivkey(\"cMcrXaaUC48ZKpcyydfFo8PxHAjpsYLhdsp6nmtB3E2ER9UUHWnw\")\n        compressed_spendable_address = [\"n1UNmpmbVUJ9ytXYXiurmGPQ3TRrXqPWKL\"]\n\n        self.nodes[0].importpubkey(pubkeys[5])\n        compressed_solvable_address = [key_to_p2pkh(pubkeys[5])]\n        self.nodes[0].importpubkey(pubkeys[6])\n        uncompressed_solvable_address = [key_to_p2pkh(pubkeys[6])]\n\n        spendable_after_addwitnessaddress = []      # These outputs should be seen after importaddress\n        solvable_after_addwitnessaddress=[]         # These outputs should be seen after importaddress but not spendable\n        unseen_anytime = []                         # These outputs should never be seen\n        solvable_anytime = []                       # These outputs should be solvable after importpubkey\n        unseen_anytime = []                         # These outputs should never be seen\n\n        uncompressed_spendable_address.append(self.nodes[0].addmultisigaddress(2, [uncompressed_spendable_address[0], compressed_spendable_address[0]])['address'])\n        uncompressed_spendable_address.append(self.nodes[0].addmultisigaddress(2, [uncompressed_spendable_address[0], uncompressed_spendable_address[0]])['address'])\n        compressed_spendable_address.append(self.nodes[0].addmultisigaddress(2, [compressed_spendable_address[0], compressed_spendable_address[0]])['address'])\n        uncompressed_solvable_address.append(self.nodes[0].addmultisigaddress(2, [compressed_solvable_address[0], uncompressed_solvable_address[0]])['address'])\n        compressed_solvable_address.append(self.nodes[0].addmultisigaddress(2, [compressed_spendable_address[0], compressed_solvable_address[0]])['address'])\n\n        premature_witaddress = []\n\n        for i in compressed_spendable_address:\n            v = self.nodes[0].validateaddress(i)\n            if (v['isscript']):\n                [bare, p2sh, p2wsh, p2sh_p2wsh] = self.p2sh_address_to_script(v)\n                # P2WSH and P2SH(P2WSH) multisig with compressed keys are spendable after addwitnessaddress\n                spendable_after_addwitnessaddress.extend([p2wsh, p2sh_p2wsh])\n                premature_witaddress.append(script_to_p2sh(p2wsh))\n            else:\n                [p2wpkh, p2sh_p2wpkh, p2pk, p2pkh, p2sh_p2pk, p2sh_p2pkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh] = self.p2pkh_address_to_script(v)\n                # P2WPKH, P2SH_P2WPKH are always spendable\n                spendable_anytime.extend([p2wpkh, p2sh_p2wpkh])\n\n        for i in uncompressed_spendable_address + uncompressed_solvable_address:\n            v = self.nodes[0].validateaddress(i)\n            if (v['isscript']):\n                [bare, p2sh, p2wsh, p2sh_p2wsh] = self.p2sh_address_to_script(v)\n                # P2WSH and P2SH(P2WSH) multisig with uncompressed keys are never seen\n                unseen_anytime.extend([p2wsh, p2sh_p2wsh])\n            else:\n                [p2wpkh, p2sh_p2wpkh, p2pk, p2pkh, p2sh_p2pk, p2sh_p2pkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh] = self.p2pkh_address_to_script(v)\n                # P2WPKH, P2SH_P2WPKH with uncompressed keys are never seen\n                unseen_anytime.extend([p2wpkh, p2sh_p2wpkh])\n\n        for i in compressed_solvable_address:\n            v = self.nodes[0].validateaddress(i)\n            if (v['isscript']):\n                # P2WSH multisig without private key are seen after addwitnessaddress\n                [bare, p2sh, p2wsh, p2sh_p2wsh] = self.p2sh_address_to_script(v)\n                solvable_after_addwitnessaddress.extend([p2wsh, p2sh_p2wsh])\n                premature_witaddress.append(script_to_p2sh(p2wsh))\n            else:\n                [p2wpkh, p2sh_p2wpkh, p2pk, p2pkh, p2sh_p2pk, p2sh_p2pkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh] = self.p2pkh_address_to_script(v)\n                # P2SH_P2PK, P2SH_P2PKH with compressed keys are always solvable\n                solvable_anytime.extend([p2wpkh, p2sh_p2wpkh])\n\n        self.mine_and_test_listunspent(spendable_anytime, 2)\n        self.mine_and_test_listunspent(solvable_anytime, 1)\n        self.mine_and_test_listunspent(spendable_after_addwitnessaddress + solvable_after_addwitnessaddress + unseen_anytime, 0)\n\n        # addwitnessaddress should refuse to return a witness address if an uncompressed key is used\n        # note that a multisig address returned by addmultisigaddress is not solvable until it is added with importaddress\n        # premature_witaddress are not accepted until the script is added with addwitnessaddress first\n        for i in uncompressed_spendable_address + uncompressed_solvable_address + premature_witaddress:\n            # This will raise an exception\n            assert_raises_rpc_error(-4, \"Public key or redeemscript not known to wallet, or the key is uncompressed\", self.nodes[0].addwitnessaddress, i)\n\n        # after importaddress it should pass addwitnessaddress\n        v = self.nodes[0].validateaddress(compressed_solvable_address[1])\n        self.nodes[0].importaddress(v['hex'],\"\",False,True)\n        for i in compressed_spendable_address + compressed_solvable_address + premature_witaddress:\n            witaddress = self.nodes[0].addwitnessaddress(i)\n            assert_equal(witaddress, self.nodes[0].addwitnessaddress(witaddress))\n\n        spendable_txid.append(self.mine_and_test_listunspent(spendable_after_addwitnessaddress + spendable_anytime, 2))\n        solvable_txid.append(self.mine_and_test_listunspent(solvable_after_addwitnessaddress + solvable_anytime, 1))\n        self.mine_and_test_listunspent(unseen_anytime, 0)\n\n        # Check that createrawtransaction/decoderawtransaction with non-v0 Bech32 works\n        v1_addr = program_to_witness(1, [3,5])\n        v1_tx = self.nodes[0].createrawtransaction([getutxo(spendable_txid[0])],{v1_addr: 1})\n        v1_decoded = self.nodes[1].decoderawtransaction(v1_tx)\n        assert_equal(v1_decoded['vout'][0]['scriptPubKey']['addresses'][0], v1_addr)\n        assert_equal(v1_decoded['vout'][0]['scriptPubKey']['hex'], \"51020305\")\n\n        # Check that spendable outputs are really spendable\n        self.create_and_mine_tx_from_txids(spendable_txid)\n\n        # import all the private keys so solvable addresses become spendable\n        self.nodes[0].importprivkey(\"cPiM8Ub4heR9NBYmgVzJQiUH1if44GSBGiqaeJySuL2BKxubvgwb\")\n        self.nodes[0].importprivkey(\"cPpAdHaD6VoYbW78kveN2bsvb45Q7G5PhaPApVUGwvF8VQ9brD97\")\n        self.nodes[0].importprivkey(\"91zqCU5B9sdWxzMt1ca3VzbtVm2YM6Hi5Rxn4UDtxEaN9C9nzXV\")\n        self.nodes[0].importprivkey(\"cPQFjcVRpAUBG8BA9hzr2yEzHwKoMgLkJZBBtK9vJnvGJgMjzTbd\")\n        self.nodes[0].importprivkey(\"cQGtcm34xiLjB1v7bkRa4V3aAc9tS2UTuBZ1UnZGeSeNy627fN66\")\n        self.nodes[0].importprivkey(\"cTW5mR5M45vHxXkeChZdtSPozrFwFgmEvTNnanCW6wrqwaCZ1X7K\")\n        self.create_and_mine_tx_from_txids(solvable_txid)\n\n        # Test that importing native P2WPKH/P2WSH scripts works\n        for use_p2wsh in [False, True]:\n            if use_p2wsh:\n                scriptPubKey = \"00203a59f3f56b713fdcf5d1a57357f02c44342cbf306ffe0c4741046837bf90561a\"\n                transaction = \"01000000000100e1f505000000002200203a59f3f56b713fdcf5d1a57357f02c44342cbf306ffe0c4741046837bf90561a00000000\"\n            else:\n                scriptPubKey = \"a9142f8c469c2f0084c48e11f998ffbe7efa7549f26d87\"\n                transaction = \"01000000000100e1f5050000000017a9142f8c469c2f0084c48e11f998ffbe7efa7549f26d8700000000\"\n\n            self.nodes[1].importaddress(scriptPubKey, \"\", False)\n            rawtxfund = self.nodes[1].fundrawtransaction(transaction)['hex']\n            rawtxfund = self.nodes[1].signrawtransaction(rawtxfund)[\"hex\"]\n            txid = self.nodes[1].sendrawtransaction(rawtxfund)\n\n            assert_equal(self.nodes[1].gettransaction(txid, True)[\"txid\"], txid)\n            assert_equal(self.nodes[1].listtransactions(\"*\", 1, 0, True)[0][\"txid\"], txid)\n\n            # Assert it is properly saved\n            self.stop_node(1)\n            self.start_node(1)\n            assert_equal(self.nodes[1].gettransaction(txid, True)[\"txid\"], txid)\n            assert_equal(self.nodes[1].listtransactions(\"*\", 1, 0, True)[0][\"txid\"], txid)\n\n    def mine_and_test_listunspent(self, script_list, ismine):\n        utxo = find_unspent(self.nodes[0], 50)\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(int('0x'+utxo['txid'],0), utxo['vout'])))\n        for i in script_list:\n            tx.vout.append(CTxOut(10000000, i))\n        tx.rehash()\n        signresults = self.nodes[0].signrawtransaction(bytes_to_hex_str(tx.serialize_without_witness()))['hex']\n        txid = self.nodes[0].sendrawtransaction(signresults, True)\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n        watchcount = 0\n        spendcount = 0\n        for i in self.nodes[0].listunspent():\n            if (i['txid'] == txid):\n                watchcount += 1\n                if (i['spendable'] == True):\n                    spendcount += 1\n        if (ismine == 2):\n            assert_equal(spendcount, len(script_list))\n        elif (ismine == 1):\n            assert_equal(watchcount, len(script_list))\n            assert_equal(spendcount, 0)\n        else:\n            assert_equal(watchcount, 0)\n        return txid\n\n    def p2sh_address_to_script(self,v):\n        bare = CScript(hex_str_to_bytes(v['hex']))\n        p2sh = CScript(hex_str_to_bytes(v['scriptPubKey']))\n        p2wsh = CScript([OP_0, sha256(bare)])\n        p2sh_p2wsh = CScript([OP_HASH160, hash160(p2wsh), OP_EQUAL])\n        return([bare, p2sh, p2wsh, p2sh_p2wsh])\n\n    def p2pkh_address_to_script(self,v):\n        pubkey = hex_str_to_bytes(v['pubkey'])\n        p2wpkh = CScript([OP_0, hash160(pubkey)])\n        p2sh_p2wpkh = CScript([OP_HASH160, hash160(p2wpkh), OP_EQUAL])\n        p2pk = CScript([pubkey, OP_CHECKSIG])\n        p2pkh = CScript(hex_str_to_bytes(v['scriptPubKey']))\n        p2sh_p2pk = CScript([OP_HASH160, hash160(p2pk), OP_EQUAL])\n        p2sh_p2pkh = CScript([OP_HASH160, hash160(p2pkh), OP_EQUAL])\n        p2wsh_p2pk = CScript([OP_0, sha256(p2pk)])\n        p2wsh_p2pkh = CScript([OP_0, sha256(p2pkh)])\n        p2sh_p2wsh_p2pk = CScript([OP_HASH160, hash160(p2wsh_p2pk), OP_EQUAL])\n        p2sh_p2wsh_p2pkh = CScript([OP_HASH160, hash160(p2wsh_p2pkh), OP_EQUAL])\n        return [p2wpkh, p2sh_p2wpkh, p2pk, p2pkh, p2sh_p2pk, p2sh_p2pkh, p2wsh_p2pk, p2wsh_p2pkh, p2sh_p2wsh_p2pk, p2sh_p2wsh_p2pkh]\n\n    def create_and_mine_tx_from_txids(self, txids, success = True):\n        tx = CTransaction()\n        for i in txids:\n            txtmp = CTransaction()\n            txraw = self.nodes[0].getrawtransaction(i)\n            f = BytesIO(hex_str_to_bytes(txraw))\n            txtmp.deserialize(f)\n            for j in range(len(txtmp.vout)):\n                tx.vin.append(CTxIn(COutPoint(int('0x'+i,0), j)))\n        tx.vout.append(CTxOut(0, CScript()))\n        tx.rehash()\n        signresults = self.nodes[0].signrawtransaction(bytes_to_hex_str(tx.serialize_without_witness()))['hex']\n        self.nodes[0].sendrawtransaction(signresults, True)\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n\n\nif __name__ == '__main__':\n    SegWitTest().main()\n"
  },
  {
    "path": "test/functional/feature_uacomment.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the -uacomment option.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal\n\nclass UacommentTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.setup_clean_chain = True\n\n    def run_test(self):\n        self.log.info(\"test multiple -uacomment\")\n        test_uacomment = self.nodes[0].getnetworkinfo()[\"subversion\"][-12:-1]\n        assert_equal(test_uacomment, \"(testnode0)\")\n\n        self.restart_node(0, [\"-uacomment=foo\"])\n        foo_uacomment = self.nodes[0].getnetworkinfo()[\"subversion\"][-17:-1]\n        assert_equal(foo_uacomment, \"(testnode0; foo)\")\n\n        self.log.info(\"test -uacomment max length\")\n        self.stop_node(0)\n        expected = \"exceeds maximum length (256). Reduce the number or size of uacomments.\"\n        self.assert_start_raises_init_error(0, [\"-uacomment=\" + 'a' * 256], expected)\n\n        self.log.info(\"test -uacomment unsafe characters\")\n        for unsafe_char in ['/', ':', '(', ')']:\n            expected = \"User Agent comment (\" + unsafe_char + \") contains unsafe characters\"\n            self.assert_start_raises_init_error(0, [\"-uacomment=\" + unsafe_char], expected)\n\nif __name__ == '__main__':\n    UacommentTest().main()\n"
  },
  {
    "path": "test/functional/feature_versionbits_warning.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test version bits warning system.\n\nGenerate chains with block versions that appear to be signalling unknown\nsoft-forks, and test that warning alerts are generated.\n\"\"\"\nimport os\nimport re\n\nfrom test_framework.blocktools import create_block, create_coinbase\nfrom test_framework.messages import msg_block\nfrom test_framework.mininode import P2PInterface, network_thread_start, mininode_lock\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import wait_until\n\nVB_PERIOD = 144           # versionbits period length for regtest\nVB_THRESHOLD = 108        # versionbits activation threshold for regtest\nVB_TOP_BITS = 0x20000000\nVB_UNKNOWN_BIT = 27       # Choose a bit unassigned to any deployment\nVB_UNKNOWN_VERSION = VB_TOP_BITS | (1 << VB_UNKNOWN_BIT)\n\nWARN_UNKNOWN_RULES_MINED = \"Unknown block versions being mined! It's possible unknown rules are in effect\"\nWARN_UNKNOWN_RULES_ACTIVE = \"unknown new rules activated (versionbit {})\".format(VB_UNKNOWN_BIT)\nVB_PATTERN = re.compile(\"Warning: unknown new rules activated.*versionbit\")\n\nclass VersionBitsWarningTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    def setup_network(self):\n        self.alert_filename = os.path.join(self.options.tmpdir, \"alert.txt\")\n        # Open and close to create zero-length file\n        with open(self.alert_filename, 'w', encoding='utf8'):\n            pass\n        self.extra_args = [[\"-alertnotify=echo %s >> \\\"\" + self.alert_filename + \"\\\"\"]]\n        self.setup_nodes()\n\n    def send_blocks_with_version(self, peer, numblocks, version):\n        \"\"\"Send numblocks blocks to peer with version set\"\"\"\n        tip = self.nodes[0].getbestblockhash()\n        height = self.nodes[0].getblockcount()\n        block_time = self.nodes[0].getblockheader(tip)[\"time\"] + 1\n        tip = int(tip, 16)\n\n        for _ in range(numblocks):\n            block = create_block(tip, create_coinbase(height + 1), block_time)\n            block.nVersion = version\n            block.solve()\n            peer.send_message(msg_block(block))\n            block_time += 1\n            height += 1\n            tip = block.sha256\n        peer.sync_with_ping()\n\n    def versionbits_in_alert_file(self):\n        \"\"\"Test that the versionbits warning has been written to the alert file.\"\"\"\n        alert_text = open(self.alert_filename, 'r', encoding='utf8').read()\n        return VB_PATTERN.search(alert_text) is not None\n\n    def run_test(self):\n        # Handy alias\n        node = self.nodes[0]\n        node.add_p2p_connection(P2PInterface())\n        network_thread_start()\n        node.p2p.wait_for_verack()\n\n        # Mine one period worth of blocks\n        node.generate(VB_PERIOD)\n\n        self.log.info(\"Check that there is no warning if previous VB_BLOCKS have <VB_THRESHOLD blocks with unknown versionbits version.\")\n        # Build one period of blocks with < VB_THRESHOLD blocks signaling some unknown bit\n        self.send_blocks_with_version(node.p2p, VB_THRESHOLD - 1, VB_UNKNOWN_VERSION)\n        node.generate(VB_PERIOD - VB_THRESHOLD + 1)\n\n        # Check that we're not getting any versionbit-related errors in get*info()\n        assert(not VB_PATTERN.match(node.getmininginfo()[\"warnings\"]))\n        assert(not VB_PATTERN.match(node.getnetworkinfo()[\"warnings\"]))\n\n        self.log.info(\"Check that there is a warning if >50 blocks in the last 100 were an unknown version\")\n        # Build one period of blocks with VB_THRESHOLD blocks signaling some unknown bit\n        self.send_blocks_with_version(node.p2p, VB_THRESHOLD, VB_UNKNOWN_VERSION)\n        node.generate(VB_PERIOD - VB_THRESHOLD)\n\n        # Check that get*info() shows the 51/100 unknown block version error.\n        assert(WARN_UNKNOWN_RULES_MINED in node.getmininginfo()[\"warnings\"])\n        assert(WARN_UNKNOWN_RULES_MINED in node.getnetworkinfo()[\"warnings\"])\n\n        self.log.info(\"Check that there is a warning if previous VB_BLOCKS have >=VB_THRESHOLD blocks with unknown versionbits version.\")\n        # Mine a period worth of expected blocks so the generic block-version warning\n        # is cleared. This will move the versionbit state to ACTIVE.\n        node.generate(VB_PERIOD)\n\n        # Stop-start the node. This is required because bitcoind will only warn once about unknown versions or unknown rules activating.\n        self.restart_node(0)\n\n        # Generating one block guarantees that we'll get out of IBD\n        node.generate(1)\n        wait_until(lambda: not node.getblockchaininfo()['initialblockdownload'], timeout=10, lock=mininode_lock)\n        # Generating one more block will be enough to generate an error.\n        node.generate(1)\n        # Check that get*info() shows the versionbits unknown rules warning\n        assert(WARN_UNKNOWN_RULES_ACTIVE in node.getmininginfo()[\"warnings\"])\n        assert(WARN_UNKNOWN_RULES_ACTIVE in node.getnetworkinfo()[\"warnings\"])\n        # Check that the alert file shows the versionbits unknown rules warning\n        wait_until(lambda: self.versionbits_in_alert_file(), timeout=60)\n\nif __name__ == '__main__':\n    VersionBitsWarningTest().main()\n"
  },
  {
    "path": "test/functional/interface_bitcoin_cli.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test bitcoin-cli\"\"\"\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal, assert_raises_process_error, get_auth_cookie\n\nclass TestBitcoinCli(BitcoinTestFramework):\n\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    def run_test(self):\n        \"\"\"Main test logic\"\"\"\n\n        self.log.info(\"Compare responses from gewalletinfo RPC and `bitcoin-cli getwalletinfo`\")\n        cli_response = self.nodes[0].cli.getwalletinfo()\n        rpc_response = self.nodes[0].getwalletinfo()\n        assert_equal(cli_response, rpc_response)\n\n        self.log.info(\"Compare responses from getblockchaininfo RPC and `bitcoin-cli getblockchaininfo`\")\n        cli_response = self.nodes[0].cli.getblockchaininfo()\n        rpc_response = self.nodes[0].getblockchaininfo()\n        assert_equal(cli_response, rpc_response)\n\n        user, password = get_auth_cookie(self.nodes[0].datadir)\n\n        self.log.info(\"Test -stdinrpcpass option\")\n        assert_equal(0, self.nodes[0].cli('-rpcuser=%s' % user, '-stdinrpcpass', input=password).getblockcount())\n        assert_raises_process_error(1, \"incorrect rpcuser or rpcpassword\", self.nodes[0].cli('-rpcuser=%s' % user, '-stdinrpcpass', input=\"foo\").echo)\n\n        self.log.info(\"Test -stdin and -stdinrpcpass\")\n        assert_equal([\"foo\", \"bar\"], self.nodes[0].cli('-rpcuser=%s' % user, '-stdin', '-stdinrpcpass', input=password + \"\\nfoo\\nbar\").echo())\n        assert_raises_process_error(1, \"incorrect rpcuser or rpcpassword\", self.nodes[0].cli('-rpcuser=%s' % user, '-stdin', '-stdinrpcpass', input=\"foo\").echo)\n\n        self.log.info(\"Make sure that -getinfo with arguments fails\")\n        assert_raises_process_error(1, \"-getinfo takes no arguments\", self.nodes[0].cli('-getinfo').help)\n\n        self.log.info(\"Compare responses from `bitcoin-cli -getinfo` and the RPCs data is retrieved from.\")\n        cli_get_info = self.nodes[0].cli('-getinfo').send_cli()\n        wallet_info = self.nodes[0].getwalletinfo()\n        network_info = self.nodes[0].getnetworkinfo()\n        blockchain_info = self.nodes[0].getblockchaininfo()\n\n        assert_equal(cli_get_info['version'], network_info['version'])\n        assert_equal(cli_get_info['protocolversion'], network_info['protocolversion'])\n        assert_equal(cli_get_info['walletversion'], wallet_info['walletversion'])\n        assert_equal(cli_get_info['balance'], wallet_info['balance'])\n        assert_equal(cli_get_info['blocks'], blockchain_info['blocks'])\n        assert_equal(cli_get_info['timeoffset'], network_info['timeoffset'])\n        assert_equal(cli_get_info['connections'], network_info['connections'])\n        assert_equal(cli_get_info['proxy'], network_info['networks'][0]['proxy'])\n        assert_equal(cli_get_info['difficulty'], blockchain_info['difficulty'])\n        assert_equal(cli_get_info['testnet'], blockchain_info['chain'] == \"test\")\n        assert_equal(cli_get_info['balance'], wallet_info['balance'])\n        assert_equal(cli_get_info['keypoololdest'], wallet_info['keypoololdest'])\n        assert_equal(cli_get_info['keypoolsize'], wallet_info['keypoolsize'])\n        assert_equal(cli_get_info['paytxfee'], wallet_info['paytxfee'])\n        assert_equal(cli_get_info['relayfee'], network_info['relayfee'])\n        # unlocked_until is not tested because the wallet is not encrypted\n\nif __name__ == '__main__':\n    TestBitcoinCli().main()\n"
  },
  {
    "path": "test/functional/interface_http.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the RPC HTTP basics.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nimport http.client\nimport urllib.parse\n\nclass HTTPBasicsTest (BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 3\n\n    def setup_network(self):\n        self.setup_nodes()\n\n    def run_test(self):\n\n        #################################################\n        # lowlevel check for http persistent connection #\n        #################################################\n        url = urllib.parse.urlparse(self.nodes[0].url)\n        authpair = url.username + ':' + url.password\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpair)}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        out1 = conn.getresponse().read()\n        assert(b'\"error\":null' in out1)\n        assert(conn.sock!=None) #according to http/1.1 connection must still be open!\n\n        #send 2nd request without closing connection\n        conn.request('POST', '/', '{\"method\": \"getchaintips\"}', headers)\n        out1 = conn.getresponse().read()\n        assert(b'\"error\":null' in out1) #must also response with a correct json-rpc message\n        assert(conn.sock!=None) #according to http/1.1 connection must still be open!\n        conn.close()\n\n        #same should be if we add keep-alive because this should be the std. behaviour\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpair), \"Connection\": \"keep-alive\"}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        out1 = conn.getresponse().read()\n        assert(b'\"error\":null' in out1)\n        assert(conn.sock!=None) #according to http/1.1 connection must still be open!\n\n        #send 2nd request without closing connection\n        conn.request('POST', '/', '{\"method\": \"getchaintips\"}', headers)\n        out1 = conn.getresponse().read()\n        assert(b'\"error\":null' in out1) #must also response with a correct json-rpc message\n        assert(conn.sock!=None) #according to http/1.1 connection must still be open!\n        conn.close()\n\n        #now do the same with \"Connection: close\"\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpair), \"Connection\":\"close\"}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        out1 = conn.getresponse().read()\n        assert(b'\"error\":null' in out1)\n        assert(conn.sock==None) #now the connection must be closed after the response\n\n        #node1 (2nd node) is running with disabled keep-alive option\n        urlNode1 = urllib.parse.urlparse(self.nodes[1].url)\n        authpair = urlNode1.username + ':' + urlNode1.password\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpair)}\n\n        conn = http.client.HTTPConnection(urlNode1.hostname, urlNode1.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        out1 = conn.getresponse().read()\n        assert(b'\"error\":null' in out1)\n\n        #node2 (third node) is running with standard keep-alive parameters which means keep-alive is on\n        urlNode2 = urllib.parse.urlparse(self.nodes[2].url)\n        authpair = urlNode2.username + ':' + urlNode2.password\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpair)}\n\n        conn = http.client.HTTPConnection(urlNode2.hostname, urlNode2.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        out1 = conn.getresponse().read()\n        assert(b'\"error\":null' in out1)\n        assert(conn.sock!=None) #connection must be closed because bitcoind should use keep-alive by default\n\n        # Check excessive request size\n        conn = http.client.HTTPConnection(urlNode2.hostname, urlNode2.port)\n        conn.connect()\n        conn.request('GET', '/' + ('x'*1000), '', headers)\n        out1 = conn.getresponse()\n        assert_equal(out1.status, http.client.NOT_FOUND)\n\n        conn = http.client.HTTPConnection(urlNode2.hostname, urlNode2.port)\n        conn.connect()\n        conn.request('GET', '/' + ('x'*10000), '', headers)\n        out1 = conn.getresponse()\n        assert_equal(out1.status, http.client.BAD_REQUEST)\n\n\nif __name__ == '__main__':\n    HTTPBasicsTest ().main ()\n"
  },
  {
    "path": "test/functional/interface_rest.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the REST API.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom struct import *\nfrom io import BytesIO\nfrom codecs import encode\n\nimport http.client\nimport urllib.parse\n\ndef deser_uint256(f):\n    r = 0\n    for i in range(8):\n        t = unpack(b\"<I\", f.read(4))[0]\n        r += t << (i * 32)\n    return r\n\n#allows simple http get calls\ndef http_get_call(host, port, path, response_object = 0):\n    conn = http.client.HTTPConnection(host, port)\n    conn.request('GET', path)\n\n    if response_object:\n        return conn.getresponse()\n\n    return conn.getresponse().read().decode('utf-8')\n\n#allows simple http post calls with a request body\ndef http_post_call(host, port, path, requestdata = '', response_object = 0):\n    conn = http.client.HTTPConnection(host, port)\n    conn.request('POST', path, requestdata)\n\n    if response_object:\n        return conn.getresponse()\n\n    return conn.getresponse().read()\n\nclass RESTTest (BitcoinTestFramework):\n    FORMAT_SEPARATOR = \".\"\n\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 3\n\n    def setup_network(self, split=False):\n        super().setup_network()\n        connect_nodes_bi(self.nodes, 0, 2)\n\n    def run_test(self):\n        url = urllib.parse.urlparse(self.nodes[0].url)\n        self.log.info(\"Mining blocks...\")\n\n        self.nodes[0].generate(1)\n        self.sync_all()\n        self.nodes[2].generate(100)\n        self.sync_all()\n\n        assert_equal(self.nodes[0].getbalance(), 50)\n\n        txid = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.1)\n        self.sync_all()\n        self.nodes[2].generate(1)\n        self.sync_all()\n        bb_hash = self.nodes[0].getbestblockhash()\n\n        assert_equal(self.nodes[1].getbalance(), Decimal(\"0.1\")) #balance now should be 0.1 on node 1\n\n        # load the latest 0.1 tx over the REST API\n        json_string = http_get_call(url.hostname, url.port, '/rest/tx/'+txid+self.FORMAT_SEPARATOR+\"json\")\n        json_obj = json.loads(json_string)\n        vintx = json_obj['vin'][0]['txid'] # get the vin to later check for utxo (should be spent by then)\n        # get n of 0.1 outpoint\n        n = 0\n        for vout in json_obj['vout']:\n            if vout['value'] == 0.1:\n                n = vout['n']\n\n\n        #######################################\n        # GETUTXOS: query an unspent outpoint #\n        #######################################\n        json_request = '/checkmempool/'+txid+'-'+str(n)\n        json_string = http_get_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json')\n        json_obj = json.loads(json_string)\n\n        #check chainTip response\n        assert_equal(json_obj['chaintipHash'], bb_hash)\n\n        #make sure there is one utxo\n        assert_equal(len(json_obj['utxos']), 1)\n        assert_equal(json_obj['utxos'][0]['value'], 0.1)\n\n\n        #################################################\n        # GETUTXOS: now query an already spent outpoint #\n        #################################################\n        json_request = '/checkmempool/'+vintx+'-0'\n        json_string = http_get_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json')\n        json_obj = json.loads(json_string)\n\n        #check chainTip response\n        assert_equal(json_obj['chaintipHash'], bb_hash)\n\n        #make sure there is no utox in the response because this oupoint has been spent\n        assert_equal(len(json_obj['utxos']), 0)\n\n        #check bitmap\n        assert_equal(json_obj['bitmap'], \"0\")\n\n\n        ##################################################\n        # GETUTXOS: now check both with the same request #\n        ##################################################\n        json_request = '/checkmempool/'+txid+'-'+str(n)+'/'+vintx+'-0'\n        json_string = http_get_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json')\n        json_obj = json.loads(json_string)\n        assert_equal(len(json_obj['utxos']), 1)\n        assert_equal(json_obj['bitmap'], \"10\")\n\n        #test binary response\n        bb_hash = self.nodes[0].getbestblockhash()\n\n        binaryRequest = b'\\x01\\x02'\n        binaryRequest += hex_str_to_bytes(txid)\n        binaryRequest += pack(\"i\", n)\n        binaryRequest += hex_str_to_bytes(vintx)\n        binaryRequest += pack(\"i\", 0)\n\n        bin_response = http_post_call(url.hostname, url.port, '/rest/getutxos'+self.FORMAT_SEPARATOR+'bin', binaryRequest)\n        output = BytesIO()\n        output.write(bin_response)\n        output.seek(0)\n        chainHeight = unpack(\"i\", output.read(4))[0]\n        hashFromBinResponse = hex(deser_uint256(output))[2:].zfill(64)\n\n        assert_equal(bb_hash, hashFromBinResponse) #check if getutxo's chaintip during calculation was fine\n        assert_equal(chainHeight, 102) #chain height must be 102\n\n\n        ############################\n        # GETUTXOS: mempool checks #\n        ############################\n\n        # do a tx and don't sync\n        txid = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.1)\n        json_string = http_get_call(url.hostname, url.port, '/rest/tx/'+txid+self.FORMAT_SEPARATOR+\"json\")\n        json_obj = json.loads(json_string)\n        vintx = json_obj['vin'][0]['txid'] # get the vin to later check for utxo (should be spent by then)\n        # get n of 0.1 outpoint\n        n = 0\n        for vout in json_obj['vout']:\n            if vout['value'] == 0.1:\n                n = vout['n']\n\n        json_request = '/'+txid+'-'+str(n)\n        json_string = http_get_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json')\n        json_obj = json.loads(json_string)\n        assert_equal(len(json_obj['utxos']), 0) #there should be an outpoint because it has just added to the mempool\n\n        json_request = '/checkmempool/'+txid+'-'+str(n)\n        json_string = http_get_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json')\n        json_obj = json.loads(json_string)\n        assert_equal(len(json_obj['utxos']), 1) #there should be an outpoint because it has just added to the mempool\n\n        #do some invalid requests\n        json_request = '{\"checkmempool'\n        response = http_post_call(url.hostname, url.port, '/rest/getutxos'+self.FORMAT_SEPARATOR+'json', json_request, True)\n        assert_equal(response.status, 400) #must be a 400 because we send an invalid json request\n\n        json_request = '{\"checkmempool'\n        response = http_post_call(url.hostname, url.port, '/rest/getutxos'+self.FORMAT_SEPARATOR+'bin', json_request, True)\n        assert_equal(response.status, 400) #must be a 400 because we send an invalid bin request\n\n        response = http_post_call(url.hostname, url.port, '/rest/getutxos/checkmempool'+self.FORMAT_SEPARATOR+'bin', '', True)\n        assert_equal(response.status, 400) #must be a 400 because we send an invalid bin request\n\n        #test limits\n        json_request = '/checkmempool/'\n        for x in range(0, 20):\n            json_request += txid+'-'+str(n)+'/'\n        json_request = json_request.rstrip(\"/\")\n        response = http_post_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json', '', True)\n        assert_equal(response.status, 400) #must be a 400 because we exceeding the limits\n\n        json_request = '/checkmempool/'\n        for x in range(0, 15):\n            json_request += txid+'-'+str(n)+'/'\n        json_request = json_request.rstrip(\"/\")\n        response = http_post_call(url.hostname, url.port, '/rest/getutxos'+json_request+self.FORMAT_SEPARATOR+'json', '', True)\n        assert_equal(response.status, 200) #must be a 200 because we are within the limits\n\n        self.nodes[0].generate(1) #generate block to not affect upcoming tests\n        self.sync_all()\n\n        ################\n        # /rest/block/ #\n        ################\n\n        # check binary format\n        response = http_get_call(url.hostname, url.port, '/rest/block/'+bb_hash+self.FORMAT_SEPARATOR+\"bin\", True)\n        assert_equal(response.status, 200)\n        assert_greater_than(int(response.getheader('content-length')), 80)\n        response_str = response.read()\n\n        # compare with block header\n        response_header = http_get_call(url.hostname, url.port, '/rest/headers/1/'+bb_hash+self.FORMAT_SEPARATOR+\"bin\", True)\n        assert_equal(response_header.status, 200)\n        assert_equal(int(response_header.getheader('content-length')), 80)\n        response_header_str = response_header.read()\n        assert_equal(response_str[0:80], response_header_str)\n\n        # check block hex format\n        response_hex = http_get_call(url.hostname, url.port, '/rest/block/'+bb_hash+self.FORMAT_SEPARATOR+\"hex\", True)\n        assert_equal(response_hex.status, 200)\n        assert_greater_than(int(response_hex.getheader('content-length')), 160)\n        response_hex_str = response_hex.read()\n        assert_equal(encode(response_str, \"hex_codec\")[0:160], response_hex_str[0:160])\n\n        # compare with hex block header\n        response_header_hex = http_get_call(url.hostname, url.port, '/rest/headers/1/'+bb_hash+self.FORMAT_SEPARATOR+\"hex\", True)\n        assert_equal(response_header_hex.status, 200)\n        assert_greater_than(int(response_header_hex.getheader('content-length')), 160)\n        response_header_hex_str = response_header_hex.read()\n        assert_equal(response_hex_str[0:160], response_header_hex_str[0:160])\n        assert_equal(encode(response_header_str, \"hex_codec\")[0:160], response_header_hex_str[0:160])\n\n        # check json format\n        block_json_string = http_get_call(url.hostname, url.port, '/rest/block/'+bb_hash+self.FORMAT_SEPARATOR+'json')\n        block_json_obj = json.loads(block_json_string)\n        assert_equal(block_json_obj['hash'], bb_hash)\n\n        # compare with json block header\n        response_header_json = http_get_call(url.hostname, url.port, '/rest/headers/1/'+bb_hash+self.FORMAT_SEPARATOR+\"json\", True)\n        assert_equal(response_header_json.status, 200)\n        response_header_json_str = response_header_json.read().decode('utf-8')\n        json_obj = json.loads(response_header_json_str, parse_float=Decimal)\n        assert_equal(len(json_obj), 1) #ensure that there is one header in the json response\n        assert_equal(json_obj[0]['hash'], bb_hash) #request/response hash should be the same\n\n        #compare with normal RPC block response\n        rpc_block_json = self.nodes[0].getblock(bb_hash)\n        assert_equal(json_obj[0]['hash'],               rpc_block_json['hash'])\n        assert_equal(json_obj[0]['confirmations'],      rpc_block_json['confirmations'])\n        assert_equal(json_obj[0]['height'],             rpc_block_json['height'])\n        assert_equal(json_obj[0]['version'],            rpc_block_json['version'])\n        assert_equal(json_obj[0]['merkleroot'],         rpc_block_json['merkleroot'])\n        assert_equal(json_obj[0]['time'],               rpc_block_json['time'])\n        assert_equal(json_obj[0]['nonce'],              rpc_block_json['nonce'])\n        assert_equal(json_obj[0]['bits'],               rpc_block_json['bits'])\n        assert_equal(json_obj[0]['difficulty'],         rpc_block_json['difficulty'])\n        assert_equal(json_obj[0]['chainwork'],          rpc_block_json['chainwork'])\n        assert_equal(json_obj[0]['previousblockhash'],  rpc_block_json['previousblockhash'])\n\n        #see if we can get 5 headers in one response\n        self.nodes[1].generate(5)\n        self.sync_all()\n        response_header_json = http_get_call(url.hostname, url.port, '/rest/headers/5/'+bb_hash+self.FORMAT_SEPARATOR+\"json\", True)\n        assert_equal(response_header_json.status, 200)\n        response_header_json_str = response_header_json.read().decode('utf-8')\n        json_obj = json.loads(response_header_json_str)\n        assert_equal(len(json_obj), 5) #now we should have 5 header objects\n\n        # do tx test\n        tx_hash = block_json_obj['tx'][0]['txid']\n        json_string = http_get_call(url.hostname, url.port, '/rest/tx/'+tx_hash+self.FORMAT_SEPARATOR+\"json\")\n        json_obj = json.loads(json_string)\n        assert_equal(json_obj['txid'], tx_hash)\n\n        # check hex format response\n        hex_string = http_get_call(url.hostname, url.port, '/rest/tx/'+tx_hash+self.FORMAT_SEPARATOR+\"hex\", True)\n        assert_equal(hex_string.status, 200)\n        assert_greater_than(int(response.getheader('content-length')), 10)\n\n\n        # check block tx details\n        # let's make 3 tx and mine them on node 1\n        txs = []\n        txs.append(self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11))\n        txs.append(self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11))\n        txs.append(self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11))\n        self.sync_all()\n\n        # check that there are exactly 3 transactions in the TX memory pool before generating the block\n        json_string = http_get_call(url.hostname, url.port, '/rest/mempool/info'+self.FORMAT_SEPARATOR+'json')\n        json_obj = json.loads(json_string)\n        assert_equal(json_obj['size'], 3)\n        # the size of the memory pool should be greater than 3x ~100 bytes\n        assert_greater_than(json_obj['bytes'], 300)\n\n        # check that there are our submitted transactions in the TX memory pool\n        json_string = http_get_call(url.hostname, url.port, '/rest/mempool/contents'+self.FORMAT_SEPARATOR+'json')\n        json_obj = json.loads(json_string)\n        for tx in txs:\n            assert_equal(tx in json_obj, True)\n\n        # now mine the transactions\n        newblockhash = self.nodes[1].generate(1)\n        self.sync_all()\n\n        #check if the 3 tx show up in the new block\n        json_string = http_get_call(url.hostname, url.port, '/rest/block/'+newblockhash[0]+self.FORMAT_SEPARATOR+'json')\n        json_obj = json.loads(json_string)\n        for tx in json_obj['tx']:\n            if not 'coinbase' in tx['vin'][0]: #exclude coinbase\n                assert_equal(tx['txid'] in txs, True)\n\n        #check the same but without tx details\n        json_string = http_get_call(url.hostname, url.port, '/rest/block/notxdetails/'+newblockhash[0]+self.FORMAT_SEPARATOR+'json')\n        json_obj = json.loads(json_string)\n        for tx in txs:\n            assert_equal(tx in json_obj['tx'], True)\n\n        #test rest bestblock\n        bb_hash = self.nodes[0].getbestblockhash()\n\n        json_string = http_get_call(url.hostname, url.port, '/rest/chaininfo.json')\n        json_obj = json.loads(json_string)\n        assert_equal(json_obj['bestblockhash'], bb_hash)\n\nif __name__ == '__main__':\n    RESTTest ().main ()\n"
  },
  {
    "path": "test/functional/interface_zmq.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the ZMQ notification interface.\"\"\"\nimport configparser\nimport os\nimport struct\n\nfrom test_framework.test_framework import BitcoinTestFramework, SkipTest\nfrom test_framework.mininode import CTransaction\nfrom test_framework.util import (assert_equal,\n                                 bytes_to_hex_str,\n                                 hash256,\n                                )\nfrom io import BytesIO\n\nclass ZMQSubscriber:\n    def __init__(self, socket, topic):\n        self.sequence = 0\n        self.socket = socket\n        self.topic = topic\n\n        import zmq\n        self.socket.setsockopt(zmq.SUBSCRIBE, self.topic)\n\n    def receive(self):\n        topic, body, seq = self.socket.recv_multipart()\n        # Topic should match the subscriber topic.\n        assert_equal(topic, self.topic)\n        # Sequence should be incremental.\n        assert_equal(struct.unpack('<I', seq)[-1], self.sequence)\n        self.sequence += 1\n        return body\n\n\nclass ZMQTest (BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n\n    def setup_nodes(self):\n        # Try to import python3-zmq. Skip this test if the import fails.\n        try:\n            import zmq\n        except ImportError:\n            raise SkipTest(\"python3-zmq module not available.\")\n\n        # Check that bitcoin has been built with ZMQ enabled.\n        config = configparser.ConfigParser()\n        if not self.options.configfile:\n            self.options.configfile = os.path.abspath(os.path.join(os.path.dirname(__file__), \"../config.ini\"))\n        config.read_file(open(self.options.configfile))\n\n        if not config[\"components\"].getboolean(\"ENABLE_ZMQ\"):\n            raise SkipTest(\"bitcoind has not been built with zmq enabled.\")\n\n        # Initialize ZMQ context and socket.\n        # All messages are received in the same socket which means\n        # that this test fails if the publishing order changes.\n        # Note that the publishing order is not defined in the documentation and\n        # is subject to change.\n        address = \"tcp://127.0.0.1:28332\"\n        self.zmq_context = zmq.Context()\n        socket = self.zmq_context.socket(zmq.SUB)\n        socket.set(zmq.RCVTIMEO, 60000)\n        socket.connect(address)\n\n        # Subscribe to all available topics.\n        self.hashblock = ZMQSubscriber(socket, b\"hashblock\")\n        self.hashtx = ZMQSubscriber(socket, b\"hashtx\")\n        self.rawblock = ZMQSubscriber(socket, b\"rawblock\")\n        self.rawtx = ZMQSubscriber(socket, b\"rawtx\")\n\n        self.extra_args = [[\"-zmqpub%s=%s\" % (sub.topic.decode(), address) for sub in [self.hashblock, self.hashtx, self.rawblock, self.rawtx]], []]\n        self.add_nodes(self.num_nodes, self.extra_args)\n        self.start_nodes()\n\n    def run_test(self):\n        try:\n            self._zmq_test()\n        finally:\n            # Destroy the ZMQ context.\n            self.log.debug(\"Destroying ZMQ context\")\n            self.zmq_context.destroy(linger=None)\n\n    def _zmq_test(self):\n        num_blocks = 5\n        self.log.info(\"Generate %(n)d blocks (and %(n)d coinbase txes)\" % {\"n\": num_blocks})\n        genhashes = self.nodes[0].generate(num_blocks)\n        self.sync_all()\n\n        for x in range(num_blocks):\n            # Should receive the coinbase txid.\n            txid = self.hashtx.receive()\n\n            # Should receive the coinbase raw transaction.\n            hex = self.rawtx.receive()\n            tx = CTransaction()\n            tx.deserialize(BytesIO(hex))\n            tx.calc_sha256()\n            assert_equal(tx.hash, bytes_to_hex_str(txid))\n\n            # Should receive the generated block hash.\n            hash = bytes_to_hex_str(self.hashblock.receive())\n            assert_equal(genhashes[x], hash)\n            # The block should only have the coinbase txid.\n            assert_equal([bytes_to_hex_str(txid)], self.nodes[1].getblock(hash)[\"tx\"])\n\n            # Should receive the generated raw block.\n            block = self.rawblock.receive()\n            assert_equal(genhashes[x], bytes_to_hex_str(hash256(block[:80])))\n\n        self.log.info(\"Wait for tx from second node\")\n        payment_txid = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1.0)\n        self.sync_all()\n\n        # Should receive the broadcasted txid.\n        txid = self.hashtx.receive()\n        assert_equal(payment_txid, bytes_to_hex_str(txid))\n\n        # Should receive the broadcasted raw transaction.\n        hex = self.rawtx.receive()\n        assert_equal(payment_txid, bytes_to_hex_str(hash256(hex)))\n\nif __name__ == '__main__':\n    ZMQTest().main()\n"
  },
  {
    "path": "test/functional/mempool_limit.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test mempool limiting together/eviction with the wallet.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass MempoolLimitTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n        self.extra_args = [[\"-maxmempool=5\", \"-spendzeroconfchange=0\"]]\n\n    def run_test(self):\n        txouts = gen_return_txouts()\n        relayfee = self.nodes[0].getnetworkinfo()['relayfee']\n\n        self.log.info('Check that mempoolminfee is minrelytxfee')\n        assert_equal(self.nodes[0].getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))\n        assert_equal(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))\n\n        txids = []\n        utxos = create_confirmed_utxos(relayfee, self.nodes[0], 91)\n\n        self.log.info('Create a mempool tx that will be evicted')\n        us0 = utxos.pop()\n        inputs = [{ \"txid\" : us0[\"txid\"], \"vout\" : us0[\"vout\"]}]\n        outputs = {self.nodes[0].getnewaddress() : 0.0001}\n        tx = self.nodes[0].createrawtransaction(inputs, outputs)\n        self.nodes[0].settxfee(relayfee) # specifically fund this tx with low fee\n        txF = self.nodes[0].fundrawtransaction(tx)\n        self.nodes[0].settxfee(0) # return to automatic fee selection\n        txFS = self.nodes[0].signrawtransaction(txF['hex'])\n        txid = self.nodes[0].sendrawtransaction(txFS['hex'])\n\n        relayfee = self.nodes[0].getnetworkinfo()['relayfee']\n        base_fee = relayfee*100\n        for i in range (3):\n            txids.append([])\n            txids[i] = create_lots_of_big_transactions(self.nodes[0], txouts, utxos[30*i:30*i+30], 30, (i+1)*base_fee)\n\n        self.log.info('The tx should be evicted by now')\n        assert(txid not in self.nodes[0].getrawmempool())\n        txdata = self.nodes[0].gettransaction(txid)\n        assert(txdata['confirmations'] ==  0) #confirmation should still be 0\n\n        self.log.info('Check that mempoolminfee is larger than minrelytxfee')\n        assert_equal(self.nodes[0].getmempoolinfo()['minrelaytxfee'], Decimal('0.00001000'))\n        assert_greater_than(self.nodes[0].getmempoolinfo()['mempoolminfee'], Decimal('0.00001000'))\n\nif __name__ == '__main__':\n    MempoolLimitTest().main()\n"
  },
  {
    "path": "test/functional/mempool_packages.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test descendant package tracking code.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import COIN\n\nMAX_ANCESTORS = 25\nMAX_DESCENDANTS = 25\n\nclass MempoolPackagesTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.extra_args = [[\"-maxorphantx=1000\"], [\"-maxorphantx=1000\", \"-limitancestorcount=5\"]]\n\n    # Build a transaction that spends parent_txid:vout\n    # Return amount sent\n    def chain_transaction(self, node, parent_txid, vout, value, fee, num_outputs):\n        send_value = satoshi_round((value - fee)/num_outputs)\n        inputs = [ {'txid' : parent_txid, 'vout' : vout} ]\n        outputs = {}\n        for i in range(num_outputs):\n            outputs[node.getnewaddress()] = send_value\n        rawtx = node.createrawtransaction(inputs, outputs)\n        signedtx = node.signrawtransaction(rawtx)\n        txid = node.sendrawtransaction(signedtx['hex'])\n        fulltx = node.getrawtransaction(txid, 1)\n        assert(len(fulltx['vout']) == num_outputs) # make sure we didn't generate a change output\n        return (txid, send_value)\n\n    def run_test(self):\n        ''' Mine some blocks and have them mature. '''\n        self.nodes[0].generate(101)\n        utxo = self.nodes[0].listunspent(10)\n        txid = utxo[0]['txid']\n        vout = utxo[0]['vout']\n        value = utxo[0]['amount']\n\n        fee = Decimal(\"0.0001\")\n        # MAX_ANCESTORS transactions off a confirmed tx should be fine\n        chain = []\n        for i in range(MAX_ANCESTORS):\n            (txid, sent_value) = self.chain_transaction(self.nodes[0], txid, 0, value, fee, 1)\n            value = sent_value\n            chain.append(txid)\n\n        # Check mempool has MAX_ANCESTORS transactions in it, and descendant\n        # count and fees should look correct\n        mempool = self.nodes[0].getrawmempool(True)\n        assert_equal(len(mempool), MAX_ANCESTORS)\n        descendant_count = 1\n        descendant_fees = 0\n        descendant_size = 0\n\n        descendants = []\n        ancestors = list(chain)\n        for x in reversed(chain):\n            # Check that getmempoolentry is consistent with getrawmempool\n            entry = self.nodes[0].getmempoolentry(x)\n            assert_equal(entry, mempool[x])\n\n            # Check that the descendant calculations are correct\n            assert_equal(mempool[x]['descendantcount'], descendant_count)\n            descendant_fees += mempool[x]['fee']\n            assert_equal(mempool[x]['modifiedfee'], mempool[x]['fee'])\n            assert_equal(mempool[x]['descendantfees'], descendant_fees * COIN)\n            descendant_size += mempool[x]['size']\n            assert_equal(mempool[x]['descendantsize'], descendant_size)\n            descendant_count += 1\n\n            # Check that getmempooldescendants is correct\n            assert_equal(sorted(descendants), sorted(self.nodes[0].getmempooldescendants(x)))\n            descendants.append(x)\n\n            # Check that getmempoolancestors is correct\n            ancestors.remove(x)\n            assert_equal(sorted(ancestors), sorted(self.nodes[0].getmempoolancestors(x)))\n\n        # Check that getmempoolancestors/getmempooldescendants correctly handle verbose=true\n        v_ancestors = self.nodes[0].getmempoolancestors(chain[-1], True)\n        assert_equal(len(v_ancestors), len(chain)-1)\n        for x in v_ancestors.keys():\n            assert_equal(mempool[x], v_ancestors[x])\n        assert(chain[-1] not in v_ancestors.keys())\n\n        v_descendants = self.nodes[0].getmempooldescendants(chain[0], True)\n        assert_equal(len(v_descendants), len(chain)-1)\n        for x in v_descendants.keys():\n            assert_equal(mempool[x], v_descendants[x])\n        assert(chain[0] not in v_descendants.keys())\n\n        # Check that ancestor modified fees includes fee deltas from\n        # prioritisetransaction\n        self.nodes[0].prioritisetransaction(txid=chain[0], fee_delta=1000)\n        mempool = self.nodes[0].getrawmempool(True)\n        ancestor_fees = 0\n        for x in chain:\n            ancestor_fees += mempool[x]['fee']\n            assert_equal(mempool[x]['ancestorfees'], ancestor_fees * COIN + 1000)\n        \n        # Undo the prioritisetransaction for later tests\n        self.nodes[0].prioritisetransaction(txid=chain[0], fee_delta=-1000)\n\n        # Check that descendant modified fees includes fee deltas from\n        # prioritisetransaction\n        self.nodes[0].prioritisetransaction(txid=chain[-1], fee_delta=1000)\n        mempool = self.nodes[0].getrawmempool(True)\n\n        descendant_fees = 0\n        for x in reversed(chain):\n            descendant_fees += mempool[x]['fee']\n            assert_equal(mempool[x]['descendantfees'], descendant_fees * COIN + 1000)\n\n        # Adding one more transaction on to the chain should fail.\n        assert_raises_rpc_error(-26, \"too-long-mempool-chain\", self.chain_transaction, self.nodes[0], txid, vout, value, fee, 1)\n\n        # Check that prioritising a tx before it's added to the mempool works\n        # First clear the mempool by mining a block.\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n        assert_equal(len(self.nodes[0].getrawmempool()), 0)\n        # Prioritise a transaction that has been mined, then add it back to the\n        # mempool by using invalidateblock.\n        self.nodes[0].prioritisetransaction(txid=chain[-1], fee_delta=2000)\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n        # Keep node1's tip synced with node0\n        self.nodes[1].invalidateblock(self.nodes[1].getbestblockhash())\n\n        # Now check that the transaction is in the mempool, with the right modified fee\n        mempool = self.nodes[0].getrawmempool(True)\n\n        descendant_fees = 0\n        for x in reversed(chain):\n            descendant_fees += mempool[x]['fee']\n            if (x == chain[-1]):\n                assert_equal(mempool[x]['modifiedfee'], mempool[x]['fee']+satoshi_round(0.00002))\n            assert_equal(mempool[x]['descendantfees'], descendant_fees * COIN + 2000)\n\n        # TODO: check that node1's mempool is as expected\n\n        # TODO: test ancestor size limits\n\n        # Now test descendant chain limits\n        txid = utxo[1]['txid']\n        value = utxo[1]['amount']\n        vout = utxo[1]['vout']\n\n        transaction_package = []\n        # First create one parent tx with 10 children\n        (txid, sent_value) = self.chain_transaction(self.nodes[0], txid, vout, value, fee, 10)\n        parent_transaction = txid\n        for i in range(10):\n            transaction_package.append({'txid': txid, 'vout': i, 'amount': sent_value})\n\n        # Sign and send up to MAX_DESCENDANT transactions chained off the parent tx\n        for i in range(MAX_DESCENDANTS - 1):\n            utxo = transaction_package.pop(0)\n            (txid, sent_value) = self.chain_transaction(self.nodes[0], utxo['txid'], utxo['vout'], utxo['amount'], fee, 10)\n            for j in range(10):\n                transaction_package.append({'txid': txid, 'vout': j, 'amount': sent_value})\n\n        mempool = self.nodes[0].getrawmempool(True)\n        assert_equal(mempool[parent_transaction]['descendantcount'], MAX_DESCENDANTS)\n\n        # Sending one more chained transaction will fail\n        utxo = transaction_package.pop(0)\n        assert_raises_rpc_error(-26, \"too-long-mempool-chain\", self.chain_transaction, self.nodes[0], utxo['txid'], utxo['vout'], utxo['amount'], fee, 10)\n\n        # TODO: check that node1's mempool is as expected\n\n        # TODO: test descendant size limits\n\n        # Test reorg handling\n        # First, the basics:\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n        self.nodes[1].invalidateblock(self.nodes[0].getbestblockhash())\n        self.nodes[1].reconsiderblock(self.nodes[0].getbestblockhash())\n\n        # Now test the case where node1 has a transaction T in its mempool that\n        # depends on transactions A and B which are in a mined block, and the\n        # block containing A and B is disconnected, AND B is not accepted back\n        # into node1's mempool because its ancestor count is too high.\n\n        # Create 8 transactions, like so:\n        # Tx0 -> Tx1 (vout0)\n        #   \\--> Tx2 (vout1) -> Tx3 -> Tx4 -> Tx5 -> Tx6 -> Tx7\n        #\n        # Mine them in the next block, then generate a new tx8 that spends\n        # Tx1 and Tx7, and add to node1's mempool, then disconnect the\n        # last block.\n\n        # Create tx0 with 2 outputs\n        utxo = self.nodes[0].listunspent()\n        txid = utxo[0]['txid']\n        value = utxo[0]['amount']\n        vout = utxo[0]['vout']\n\n        send_value = satoshi_round((value - fee)/2)\n        inputs = [ {'txid' : txid, 'vout' : vout} ]\n        outputs = {}\n        for i in range(2):\n            outputs[self.nodes[0].getnewaddress()] = send_value\n        rawtx = self.nodes[0].createrawtransaction(inputs, outputs)\n        signedtx = self.nodes[0].signrawtransaction(rawtx)\n        txid = self.nodes[0].sendrawtransaction(signedtx['hex'])\n        tx0_id = txid\n        value = send_value\n\n        # Create tx1\n        tx1_id, _ = self.chain_transaction(self.nodes[0], tx0_id, 0, value, fee, 1)\n\n        # Create tx2-7\n        vout = 1\n        txid = tx0_id\n        for i in range(6):\n            (txid, sent_value) = self.chain_transaction(self.nodes[0], txid, vout, value, fee, 1)\n            vout = 0\n            value = sent_value\n\n        # Mine these in a block\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        # Now generate tx8, with a big fee\n        inputs = [ {'txid' : tx1_id, 'vout': 0}, {'txid' : txid, 'vout': 0} ]\n        outputs = { self.nodes[0].getnewaddress() : send_value + value - 4*fee }\n        rawtx = self.nodes[0].createrawtransaction(inputs, outputs)\n        signedtx = self.nodes[0].signrawtransaction(rawtx)\n        txid = self.nodes[0].sendrawtransaction(signedtx['hex'])\n        sync_mempools(self.nodes)\n        \n        # Now try to disconnect the tip on each node...\n        self.nodes[1].invalidateblock(self.nodes[1].getbestblockhash())\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n        sync_blocks(self.nodes)\n\nif __name__ == '__main__':\n    MempoolPackagesTest().main()\n"
  },
  {
    "path": "test/functional/mempool_persist.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test mempool persistence.\n\nBy default, bitcoind will dump mempool on shutdown and\nthen reload it on startup. This can be overridden with\nthe -persistmempool=0 command line option.\n\nTest is as follows:\n\n  - start node0, node1 and node2. node1 has -persistmempool=0\n  - create 5 transactions on node2 to its own address. Note that these\n    are not sent to node0 or node1 addresses because we don't want\n    them to be saved in the wallet.\n  - check that node0 and node1 have 5 transactions in their mempools\n  - shutdown all nodes.\n  - startup node0. Verify that it still has 5 transactions\n    in its mempool. Shutdown node0. This tests that by default the\n    mempool is persistent.\n  - startup node1. Verify that its mempool is empty. Shutdown node1.\n    This tests that with -persistmempool=0, the mempool is not\n    dumped to disk when the node is shut down.\n  - Restart node0 with -persistmempool=0. Verify that its mempool is\n    empty. Shutdown node0. This tests that with -persistmempool=0,\n    the mempool is not loaded from disk on start up.\n  - Restart node0 with -persistmempool. Verify that it has 5\n    transactions in its mempool. This tests that -persistmempool=0\n    does not overwrite a previously valid mempool stored on disk.\n  - Remove node0 mempool.dat and verify savemempool RPC recreates it\n    and verify that node1 can load it and has 5 transaction in its\n    mempool.\n  - Verify that savemempool throws when the RPC is called if\n    node1 can't write to disk.\n\n\"\"\"\nimport os\nimport time\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass MempoolPersistTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 3\n        self.extra_args = [[], [\"-persistmempool=0\"], []]\n\n    def run_test(self):\n        chain_height = self.nodes[0].getblockcount()\n        assert_equal(chain_height, 200)\n\n        self.log.debug(\"Mine a single block to get out of IBD\")\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        self.log.debug(\"Send 5 transactions from node2 (to its own address)\")\n        for i in range(5):\n            self.nodes[2].sendtoaddress(self.nodes[2].getnewaddress(), Decimal(\"10\"))\n        node2_balance = self.nodes[2].getbalance()\n        self.sync_all()\n\n        self.log.debug(\"Verify that node0 and node1 have 5 transactions in their mempools\")\n        assert_equal(len(self.nodes[0].getrawmempool()), 5)\n        assert_equal(len(self.nodes[1].getrawmempool()), 5)\n\n        self.log.debug(\"Stop-start the nodes. Verify that node0 has the transactions in its mempool and node1 does not. Verify that node2 calculates its balance correctly after loading wallet transactions.\")\n        self.stop_nodes()\n        self.start_node(1)  # Give this one a head-start, so we can be \"extra-sure\" that it didn't load anything later\n        self.start_node(0)\n        self.start_node(2)\n        # Give bitcoind a second to reload the mempool\n        wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5, timeout=1)\n        wait_until(lambda: len(self.nodes[2].getrawmempool()) == 5, timeout=1)\n        # The others have loaded their mempool. If node_1 loaded anything, we'd probably notice by now:\n        assert_equal(len(self.nodes[1].getrawmempool()), 0)\n\n        # Verify accounting of mempool transactions after restart is correct\n        self.nodes[2].syncwithvalidationinterfacequeue()  # Flush mempool to wallet\n        assert_equal(node2_balance, self.nodes[2].getbalance())\n\n        self.log.debug(\"Stop-start node0 with -persistmempool=0. Verify that it doesn't load its mempool.dat file.\")\n        self.stop_nodes()\n        self.start_node(0, extra_args=[\"-persistmempool=0\"])\n        # Give bitcoind a second to reload the mempool\n        time.sleep(1)\n        assert_equal(len(self.nodes[0].getrawmempool()), 0)\n\n        self.log.debug(\"Stop-start node0. Verify that it has the transactions in its mempool.\")\n        self.stop_nodes()\n        self.start_node(0)\n        wait_until(lambda: len(self.nodes[0].getrawmempool()) == 5)\n\n        mempooldat0 = os.path.join(self.options.tmpdir, 'node0', 'regtest', 'mempool.dat')\n        mempooldat1 = os.path.join(self.options.tmpdir, 'node1', 'regtest', 'mempool.dat')\n        self.log.debug(\"Remove the mempool.dat file. Verify that savemempool to disk via RPC re-creates it\")\n        os.remove(mempooldat0)\n        self.nodes[0].savemempool()\n        assert os.path.isfile(mempooldat0)\n\n        self.log.debug(\"Stop nodes, make node1 use mempool.dat from node0. Verify it has 5 transactions\")\n        os.rename(mempooldat0, mempooldat1)\n        self.stop_nodes()\n        self.start_node(1, extra_args=[])\n        wait_until(lambda: len(self.nodes[1].getrawmempool()) == 5)\n\n        self.log.debug(\"Prevent bitcoind from writing mempool.dat to disk. Verify that `savemempool` fails\")\n        # to test the exception we are setting bad permissions on a tmp file called mempool.dat.new\n        # which is an implementation detail that could change and break this test\n        mempooldotnew1 = mempooldat1 + '.new'\n        with os.fdopen(os.open(mempooldotnew1, os.O_CREAT, 0o000), 'w'):\n            pass\n        assert_raises_rpc_error(-1, \"Unable to dump mempool to disk\", self.nodes[1].savemempool)\n        os.remove(mempooldotnew1)\n\nif __name__ == '__main__':\n    MempoolPersistTest().main()\n"
  },
  {
    "path": "test/functional/mempool_reorg.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test mempool re-org scenarios.\n\nTest re-org scenarios with a mempool that contains transactions\nthat spend (directly or indirectly) coinbase transactions.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\n# Create one-input, one-output, no-fee transaction:\nclass MempoolCoinbaseTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.extra_args = [[\"-checkmempool\"]] * 2\n\n    alert_filename = None  # Set by setup_network\n\n    def run_test(self):\n        # Start with a 200 block chain\n        assert_equal(self.nodes[0].getblockcount(), 200)\n\n        # Mine four blocks. After this, nodes[0] blocks\n        # 101, 102, and 103 are spend-able.\n        new_blocks = self.nodes[1].generate(4)\n        self.sync_all()\n\n        node0_address = self.nodes[0].getnewaddress()\n        node1_address = self.nodes[1].getnewaddress()\n\n        # Three scenarios for re-orging coinbase spends in the memory pool:\n        # 1. Direct coinbase spend  :  spend_101\n        # 2. Indirect (coinbase spend in chain, child in mempool) : spend_102 and spend_102_1\n        # 3. Indirect (coinbase and child both in chain) : spend_103 and spend_103_1\n        # Use invalidatblock to make all of the above coinbase spends invalid (immature coinbase),\n        # and make sure the mempool code behaves correctly.\n        b = [ self.nodes[0].getblockhash(n) for n in range(101, 105) ]\n        coinbase_txids = [ self.nodes[0].getblock(h)['tx'][0] for h in b ]\n        spend_101_raw = create_tx(self.nodes[0], coinbase_txids[1], node1_address, 49.99)\n        spend_102_raw = create_tx(self.nodes[0], coinbase_txids[2], node0_address, 49.99)\n        spend_103_raw = create_tx(self.nodes[0], coinbase_txids[3], node0_address, 49.99)\n\n        # Create a transaction which is time-locked to two blocks in the future\n        timelock_tx = self.nodes[0].createrawtransaction([{\"txid\": coinbase_txids[0], \"vout\": 0}], {node0_address: 49.99})\n        # Set the time lock\n        timelock_tx = timelock_tx.replace(\"ffffffff\", \"11111191\", 1)\n        timelock_tx = timelock_tx[:-8] + hex(self.nodes[0].getblockcount() + 2)[2:] + \"000000\"\n        timelock_tx = self.nodes[0].signrawtransaction(timelock_tx)[\"hex\"]\n        # This will raise an exception because the timelock transaction is too immature to spend\n        assert_raises_rpc_error(-26, \"non-final\", self.nodes[0].sendrawtransaction, timelock_tx)\n\n        # Broadcast and mine spend_102 and 103:\n        spend_102_id = self.nodes[0].sendrawtransaction(spend_102_raw)\n        spend_103_id = self.nodes[0].sendrawtransaction(spend_103_raw)\n        self.nodes[0].generate(1)\n        # Time-locked transaction is still too immature to spend\n        assert_raises_rpc_error(-26,'non-final', self.nodes[0].sendrawtransaction, timelock_tx)\n\n        # Create 102_1 and 103_1:\n        spend_102_1_raw = create_tx(self.nodes[0], spend_102_id, node1_address, 49.98)\n        spend_103_1_raw = create_tx(self.nodes[0], spend_103_id, node1_address, 49.98)\n\n        # Broadcast and mine 103_1:\n        spend_103_1_id = self.nodes[0].sendrawtransaction(spend_103_1_raw)\n        last_block = self.nodes[0].generate(1)\n        # Time-locked transaction can now be spent\n        timelock_tx_id = self.nodes[0].sendrawtransaction(timelock_tx)\n\n        # ... now put spend_101 and spend_102_1 in memory pools:\n        spend_101_id = self.nodes[0].sendrawtransaction(spend_101_raw)\n        spend_102_1_id = self.nodes[0].sendrawtransaction(spend_102_1_raw)\n\n        self.sync_all()\n\n        assert_equal(set(self.nodes[0].getrawmempool()), {spend_101_id, spend_102_1_id, timelock_tx_id})\n\n        for node in self.nodes:\n            node.invalidateblock(last_block[0])\n        # Time-locked transaction is now too immature and has been removed from the mempool\n        # spend_103_1 has been re-orged out of the chain and is back in the mempool\n        assert_equal(set(self.nodes[0].getrawmempool()), {spend_101_id, spend_102_1_id, spend_103_1_id})\n\n        # Use invalidateblock to re-org back and make all those coinbase spends\n        # immature/invalid:\n        for node in self.nodes:\n            node.invalidateblock(new_blocks[0])\n\n        self.sync_all()\n\n        # mempool should be empty.\n        assert_equal(set(self.nodes[0].getrawmempool()), set())\n\nif __name__ == '__main__':\n    MempoolCoinbaseTest().main()\n"
  },
  {
    "path": "test/functional/mempool_resurrect.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test resurrection of mined transactions when the blockchain is re-organized.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\n# Create one-input, one-output, no-fee transaction:\nclass MempoolCoinbaseTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.extra_args = [[\"-checkmempool\"]]\n\n    def run_test(self):\n        node0_address = self.nodes[0].getnewaddress()\n        # Spend block 1/2/3's coinbase transactions\n        # Mine a block.\n        # Create three more transactions, spending the spends\n        # Mine another block.\n        # ... make sure all the transactions are confirmed\n        # Invalidate both blocks\n        # ... make sure all the transactions are put back in the mempool\n        # Mine a new block\n        # ... make sure all the transactions are confirmed again.\n\n        b = [ self.nodes[0].getblockhash(n) for n in range(1, 4) ]\n        coinbase_txids = [ self.nodes[0].getblock(h)['tx'][0] for h in b ]\n        spends1_raw = [ create_tx(self.nodes[0], txid, node0_address, 49.99) for txid in coinbase_txids ]\n        spends1_id = [ self.nodes[0].sendrawtransaction(tx) for tx in spends1_raw ]\n\n        blocks = []\n        blocks.extend(self.nodes[0].generate(1))\n\n        spends2_raw = [ create_tx(self.nodes[0], txid, node0_address, 49.98) for txid in spends1_id ]\n        spends2_id = [ self.nodes[0].sendrawtransaction(tx) for tx in spends2_raw ]\n\n        blocks.extend(self.nodes[0].generate(1))\n\n        # mempool should be empty, all txns confirmed\n        assert_equal(set(self.nodes[0].getrawmempool()), set())\n        for txid in spends1_id+spends2_id:\n            tx = self.nodes[0].gettransaction(txid)\n            assert(tx[\"confirmations\"] > 0)\n\n        # Use invalidateblock to re-org back; all transactions should\n        # end up unconfirmed and back in the mempool\n        for node in self.nodes:\n            node.invalidateblock(blocks[0])\n\n        # mempool should be empty, all txns confirmed\n        assert_equal(set(self.nodes[0].getrawmempool()), set(spends1_id+spends2_id))\n        for txid in spends1_id+spends2_id:\n            tx = self.nodes[0].gettransaction(txid)\n            assert(tx[\"confirmations\"] == 0)\n\n        # Generate another block, they should all get mined\n        self.nodes[0].generate(1)\n        # mempool should be empty, all txns confirmed\n        assert_equal(set(self.nodes[0].getrawmempool()), set())\n        for txid in spends1_id+spends2_id:\n            tx = self.nodes[0].gettransaction(txid)\n            assert(tx[\"confirmations\"] > 0)\n\n\nif __name__ == '__main__':\n    MempoolCoinbaseTest().main()\n"
  },
  {
    "path": "test/functional/mempool_spend_coinbase.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test spending coinbase transactions.\n\nThe coinbase transaction in block N can appear in block\nN+100... so is valid in the mempool when the best block\nheight is N+99.\nThis test makes sure coinbase spends that will be mature\nin the next block are accepted into the memory pool,\nbut less mature coinbase spends are NOT.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\n# Create one-input, one-output, no-fee transaction:\nclass MempoolSpendCoinbaseTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.extra_args = [[\"-checkmempool\"]]\n\n    def run_test(self):\n        chain_height = self.nodes[0].getblockcount()\n        assert_equal(chain_height, 200)\n        node0_address = self.nodes[0].getnewaddress()\n\n        # Coinbase at height chain_height-100+1 ok in mempool, should\n        # get mined. Coinbase at height chain_height-100+2 is\n        # is too immature to spend.\n        b = [ self.nodes[0].getblockhash(n) for n in range(101, 103) ]\n        coinbase_txids = [ self.nodes[0].getblock(h)['tx'][0] for h in b ]\n        spends_raw = [ create_tx(self.nodes[0], txid, node0_address, 49.99) for txid in coinbase_txids ]\n\n        spend_101_id = self.nodes[0].sendrawtransaction(spends_raw[0])\n\n        # coinbase at height 102 should be too immature to spend\n        assert_raises_rpc_error(-26,\"bad-txns-premature-spend-of-coinbase\", self.nodes[0].sendrawtransaction, spends_raw[1])\n\n        # mempool should have just spend_101:\n        assert_equal(self.nodes[0].getrawmempool(), [ spend_101_id ])\n\n        # mine a block, spend_101 should get confirmed\n        self.nodes[0].generate(1)\n        assert_equal(set(self.nodes[0].getrawmempool()), set())\n\n        # ... and now height 102 can be spent:\n        spend_102_id = self.nodes[0].sendrawtransaction(spends_raw[1])\n        assert_equal(self.nodes[0].getrawmempool(), [ spend_102_id ])\n\nif __name__ == '__main__':\n    MempoolSpendCoinbaseTest().main()\n"
  },
  {
    "path": "test/functional/mining_basic.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test mining RPCs\n\n- getmininginfo\n- getblocktemplate proposal mode\n- submitblock\"\"\"\n\nimport copy\nfrom binascii import b2a_hex\nfrom decimal import Decimal\n\nfrom test_framework.blocktools import create_coinbase\nfrom test_framework.mininode import CBlock\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal, assert_raises_rpc_error\n\ndef b2x(b):\n    return b2a_hex(b).decode('ascii')\n\ndef assert_template(node, block, expect, rehash=True):\n    if rehash:\n        block.hashMerkleRoot = block.calc_merkle_root()\n    rsp = node.getblocktemplate({'data': b2x(block.serialize()), 'mode': 'proposal'})\n    assert_equal(rsp, expect)\n\nclass MiningTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.setup_clean_chain = False\n\n    def run_test(self):\n        node = self.nodes[0]\n\n        self.log.info('getmininginfo')\n        mining_info = node.getmininginfo()\n        assert_equal(mining_info['blocks'], 200)\n        assert_equal(mining_info['chain'], 'regtest')\n        assert_equal(mining_info['currentblocktx'], 0)\n        assert_equal(mining_info['currentblockweight'], 0)\n        assert_equal(mining_info['difficulty'], Decimal('4.656542373906925E-10'))\n        assert_equal(mining_info['networkhashps'], Decimal('0.003333333333333334'))\n        assert_equal(mining_info['pooledtx'], 0)\n\n        # Mine a block to leave initial block download\n        node.generate(1)\n        tmpl = node.getblocktemplate()\n        self.log.info(\"getblocktemplate: Test capability advertised\")\n        assert 'proposal' in tmpl['capabilities']\n        assert 'coinbasetxn' not in tmpl\n\n        coinbase_tx = create_coinbase(height=int(tmpl[\"height\"]) + 1)\n        # sequence numbers must not be max for nLockTime to have effect\n        coinbase_tx.vin[0].nSequence = 2 ** 32 - 2\n        coinbase_tx.rehash()\n\n        block = CBlock()\n        block.nVersion = tmpl[\"version\"]\n        block.hashPrevBlock = int(tmpl[\"previousblockhash\"], 16)\n        block.nTime = tmpl[\"curtime\"]\n        block.nBits = int(tmpl[\"bits\"], 16)\n        block.nNonce = 0\n        block.vtx = [coinbase_tx]\n\n        self.log.info(\"getblocktemplate: Test valid block\")\n        assert_template(node, block, None)\n\n        self.log.info(\"submitblock: Test block decode failure\")\n        assert_raises_rpc_error(-22, \"Block decode failed\", node.submitblock, b2x(block.serialize()[:-15]))\n\n        self.log.info(\"getblocktemplate: Test bad input hash for coinbase transaction\")\n        bad_block = copy.deepcopy(block)\n        bad_block.vtx[0].vin[0].prevout.hash += 1\n        bad_block.vtx[0].rehash()\n        assert_template(node, bad_block, 'bad-cb-missing')\n\n        self.log.info(\"submitblock: Test invalid coinbase transaction\")\n        assert_raises_rpc_error(-22, \"Block does not start with a coinbase\", node.submitblock, b2x(bad_block.serialize()))\n\n        self.log.info(\"getblocktemplate: Test truncated final transaction\")\n        assert_raises_rpc_error(-22, \"Block decode failed\", node.getblocktemplate, {'data': b2x(block.serialize()[:-1]), 'mode': 'proposal'})\n\n        self.log.info(\"getblocktemplate: Test duplicate transaction\")\n        bad_block = copy.deepcopy(block)\n        bad_block.vtx.append(bad_block.vtx[0])\n        assert_template(node, bad_block, 'bad-txns-duplicate')\n\n        self.log.info(\"getblocktemplate: Test invalid transaction\")\n        bad_block = copy.deepcopy(block)\n        bad_tx = copy.deepcopy(bad_block.vtx[0])\n        bad_tx.vin[0].prevout.hash = 255\n        bad_tx.rehash()\n        bad_block.vtx.append(bad_tx)\n        assert_template(node, bad_block, 'bad-txns-inputs-missingorspent')\n\n        self.log.info(\"getblocktemplate: Test nonfinal transaction\")\n        bad_block = copy.deepcopy(block)\n        bad_block.vtx[0].nLockTime = 2 ** 32 - 1\n        bad_block.vtx[0].rehash()\n        assert_template(node, bad_block, 'bad-txns-nonfinal')\n\n        self.log.info(\"getblocktemplate: Test bad tx count\")\n        # The tx count is immediately after the block header\n        TX_COUNT_OFFSET = 80\n        bad_block_sn = bytearray(block.serialize())\n        assert_equal(bad_block_sn[TX_COUNT_OFFSET], 1)\n        bad_block_sn[TX_COUNT_OFFSET] += 1\n        assert_raises_rpc_error(-22, \"Block decode failed\", node.getblocktemplate, {'data': b2x(bad_block_sn), 'mode': 'proposal'})\n\n        self.log.info(\"getblocktemplate: Test bad bits\")\n        bad_block = copy.deepcopy(block)\n        bad_block.nBits = 469762303  # impossible in the real world\n        assert_template(node, bad_block, 'bad-diffbits')\n\n        self.log.info(\"getblocktemplate: Test bad merkle root\")\n        bad_block = copy.deepcopy(block)\n        bad_block.hashMerkleRoot += 1\n        assert_template(node, bad_block, 'bad-txnmrklroot', False)\n\n        self.log.info(\"getblocktemplate: Test bad timestamps\")\n        bad_block = copy.deepcopy(block)\n        bad_block.nTime = 2 ** 31 - 1\n        assert_template(node, bad_block, 'time-too-new')\n        bad_block.nTime = 0\n        assert_template(node, bad_block, 'time-too-old')\n\n        self.log.info(\"getblocktemplate: Test not best block\")\n        bad_block = copy.deepcopy(block)\n        bad_block.hashPrevBlock = 123\n        assert_template(node, bad_block, 'inconclusive-not-best-prevblk')\n\nif __name__ == '__main__':\n    MiningTest().main()\n"
  },
  {
    "path": "test/functional/mining_getblocktemplate_longpoll.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test longpolling with getblocktemplate.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nimport threading\n\nclass LongpollThread(threading.Thread):\n    def __init__(self, node):\n        threading.Thread.__init__(self)\n        # query current longpollid\n        templat = node.getblocktemplate()\n        self.longpollid = templat['longpollid']\n        # create a new connection to the node, we can't use the same\n        # connection from two threads\n        self.node = get_rpc_proxy(node.url, 1, timeout=600, coveragedir=node.coverage_dir)\n\n    def run(self):\n        self.node.getblocktemplate({'longpollid':self.longpollid})\n\nclass GetBlockTemplateLPTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n\n    def run_test(self):\n        self.log.info(\"Warning: this test will take about 70 seconds in the best case. Be patient.\")\n        self.nodes[0].generate(10)\n        templat = self.nodes[0].getblocktemplate()\n        longpollid = templat['longpollid']\n        # longpollid should not change between successive invocations if nothing else happens\n        templat2 = self.nodes[0].getblocktemplate()\n        assert(templat2['longpollid'] == longpollid)\n\n        # Test 1: test that the longpolling wait if we do nothing\n        thr = LongpollThread(self.nodes[0])\n        thr.start()\n        # check that thread still lives\n        thr.join(5)  # wait 5 seconds or until thread exits\n        assert(thr.is_alive())\n\n        # Test 2: test that longpoll will terminate if another node generates a block\n        self.nodes[1].generate(1)  # generate a block on another node\n        # check that thread will exit now that new transaction entered mempool\n        thr.join(5)  # wait 5 seconds or until thread exits\n        assert(not thr.is_alive())\n\n        # Test 3: test that longpoll will terminate if we generate a block ourselves\n        thr = LongpollThread(self.nodes[0])\n        thr.start()\n        self.nodes[0].generate(1)  # generate a block on another node\n        thr.join(5)  # wait 5 seconds or until thread exits\n        assert(not thr.is_alive())\n\n        # Test 4: test that introducing a new transaction into the mempool will terminate the longpoll\n        thr = LongpollThread(self.nodes[0])\n        thr.start()\n        # generate a random transaction and submit it\n        min_relay_fee = self.nodes[0].getnetworkinfo()[\"relayfee\"]\n        # min_relay_fee is fee per 1000 bytes, which should be more than enough.\n        (txid, txhex, fee) = random_transaction(self.nodes, Decimal(\"1.1\"), min_relay_fee, Decimal(\"0.001\"), 20)\n        # after one minute, every 10 seconds the mempool is probed, so in 80 seconds it should have returned\n        thr.join(60 + 20)\n        assert(not thr.is_alive())\n\nif __name__ == '__main__':\n    GetBlockTemplateLPTest().main()\n\n"
  },
  {
    "path": "test/functional/mining_prioritisetransaction.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the prioritisetransaction mining RPC.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import COIN, MAX_BLOCK_BASE_SIZE\n\nclass PrioritiseTransactionTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 2\n        self.extra_args = [[\"-printpriority=1\"], [\"-printpriority=1\"]]\n\n    def run_test(self):\n        # Test `prioritisetransaction` required parameters\n        assert_raises_rpc_error(-1, \"prioritisetransaction\", self.nodes[0].prioritisetransaction)\n        assert_raises_rpc_error(-1, \"prioritisetransaction\", self.nodes[0].prioritisetransaction, '')\n        assert_raises_rpc_error(-1, \"prioritisetransaction\", self.nodes[0].prioritisetransaction, '', 0)\n\n        # Test `prioritisetransaction` invalid extra parameters\n        assert_raises_rpc_error(-1, \"prioritisetransaction\", self.nodes[0].prioritisetransaction, '', 0, 0, 0)\n\n        # Test `prioritisetransaction` invalid `txid`\n        assert_raises_rpc_error(-1, \"txid must be hexadecimal string\", self.nodes[0].prioritisetransaction, txid='foo', fee_delta=0)\n\n        # Test `prioritisetransaction` invalid `dummy`\n        txid = '1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000'\n        assert_raises_rpc_error(-1, \"JSON value is not a number as expected\", self.nodes[0].prioritisetransaction, txid, 'foo', 0)\n        assert_raises_rpc_error(-8, \"Priority is no longer supported, dummy argument to prioritisetransaction must be 0.\", self.nodes[0].prioritisetransaction, txid, 1, 0)\n\n        # Test `prioritisetransaction` invalid `fee_delta`\n        assert_raises_rpc_error(-1, \"JSON value is not an integer as expected\", self.nodes[0].prioritisetransaction, txid=txid, fee_delta='foo')\n\n        self.txouts = gen_return_txouts()\n        self.relayfee = self.nodes[0].getnetworkinfo()['relayfee']\n\n        utxo_count = 90\n        utxos = create_confirmed_utxos(self.relayfee, self.nodes[0], utxo_count)\n        base_fee = self.relayfee*100 # our transactions are smaller than 100kb\n        txids = []\n\n        # Create 3 batches of transactions at 3 different fee rate levels\n        range_size = utxo_count // 3\n        for i in range(3):\n            txids.append([])\n            start_range = i * range_size\n            end_range = start_range + range_size\n            txids[i] = create_lots_of_big_transactions(self.nodes[0], self.txouts, utxos[start_range:end_range], end_range - start_range, (i+1)*base_fee)\n\n        # Make sure that the size of each group of transactions exceeds\n        # MAX_BLOCK_BASE_SIZE -- otherwise the test needs to be revised to create\n        # more transactions.\n        mempool = self.nodes[0].getrawmempool(True)\n        sizes = [0, 0, 0]\n        for i in range(3):\n            for j in txids[i]:\n                assert(j in mempool)\n                sizes[i] += mempool[j]['size']\n            assert(sizes[i] > MAX_BLOCK_BASE_SIZE) # Fail => raise utxo_count\n\n        # add a fee delta to something in the cheapest bucket and make sure it gets mined\n        # also check that a different entry in the cheapest bucket is NOT mined\n        self.nodes[0].prioritisetransaction(txid=txids[0][0], fee_delta=int(3*base_fee*COIN))\n\n        self.nodes[0].generate(1)\n\n        mempool = self.nodes[0].getrawmempool()\n        self.log.info(\"Assert that prioritised transaction was mined\")\n        assert(txids[0][0] not in mempool)\n        assert(txids[0][1] in mempool)\n\n        high_fee_tx = None\n        for x in txids[2]:\n            if x not in mempool:\n                high_fee_tx = x\n\n        # Something high-fee should have been mined!\n        assert(high_fee_tx != None)\n\n        # Add a prioritisation before a tx is in the mempool (de-prioritising a\n        # high-fee transaction so that it's now low fee).\n        self.nodes[0].prioritisetransaction(txid=high_fee_tx, fee_delta=-int(2*base_fee*COIN))\n\n        # Add everything back to mempool\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n\n        # Check to make sure our high fee rate tx is back in the mempool\n        mempool = self.nodes[0].getrawmempool()\n        assert(high_fee_tx in mempool)\n\n        # Now verify the modified-high feerate transaction isn't mined before\n        # the other high fee transactions. Keep mining until our mempool has\n        # decreased by all the high fee size that we calculated above.\n        while (self.nodes[0].getmempoolinfo()['bytes'] > sizes[0] + sizes[1]):\n            self.nodes[0].generate(1)\n\n        # High fee transaction should not have been mined, but other high fee rate\n        # transactions should have been.\n        mempool = self.nodes[0].getrawmempool()\n        self.log.info(\"Assert that de-prioritised transaction is still in mempool\")\n        assert(high_fee_tx in mempool)\n        for x in txids[2]:\n            if (x != high_fee_tx):\n                assert(x not in mempool)\n\n        # Create a free transaction.  Should be rejected.\n        utxo_list = self.nodes[0].listunspent()\n        assert(len(utxo_list) > 0)\n        utxo = utxo_list[0]\n\n        inputs = []\n        outputs = {}\n        inputs.append({\"txid\" : utxo[\"txid\"], \"vout\" : utxo[\"vout\"]})\n        outputs[self.nodes[0].getnewaddress()] = utxo[\"amount\"]\n        raw_tx = self.nodes[0].createrawtransaction(inputs, outputs)\n        tx_hex = self.nodes[0].signrawtransaction(raw_tx)[\"hex\"]\n        tx_id = self.nodes[0].decoderawtransaction(tx_hex)[\"txid\"]\n\n        # This will raise an exception due to min relay fee not being met\n        assert_raises_rpc_error(-26, \"66: min relay fee not met\", self.nodes[0].sendrawtransaction, tx_hex)\n        assert(tx_id not in self.nodes[0].getrawmempool())\n\n        # This is a less than 1000-byte transaction, so just set the fee\n        # to be the minimum for a 1000 byte transaction and check that it is\n        # accepted.\n        self.nodes[0].prioritisetransaction(txid=tx_id, fee_delta=int(self.relayfee*COIN))\n\n        self.log.info(\"Assert that prioritised free transaction is accepted to mempool\")\n        assert_equal(self.nodes[0].sendrawtransaction(tx_hex), tx_id)\n        assert(tx_id in self.nodes[0].getrawmempool())\n\n        # Test that calling prioritisetransaction is sufficient to trigger\n        # getblocktemplate to (eventually) return a new block.\n        mock_time = int(time.time())\n        self.nodes[0].setmocktime(mock_time)\n        template = self.nodes[0].getblocktemplate()\n        self.nodes[0].prioritisetransaction(txid=tx_id, fee_delta=-int(self.relayfee*COIN))\n        self.nodes[0].setmocktime(mock_time+10)\n        new_template = self.nodes[0].getblocktemplate()\n\n        assert(template != new_template)\n\nif __name__ == '__main__':\n    PrioritiseTransactionTest().main()\n"
  },
  {
    "path": "test/functional/p2p_compactblocks.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test compact blocks (BIP 152).\n\nVersion 1 compact blocks are pre-segwit (txids)\nVersion 2 compact blocks are post-segwit (wtxids)\n\"\"\"\n\nfrom test_framework.mininode import *\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.blocktools import create_block, create_coinbase, add_witness_commitment\nfrom test_framework.script import CScript, OP_TRUE, OP_DROP\n\n\n# TestNode: A peer we use to send messages to bitcoind, and store responses.\nclass TestNode(P2PInterface):\n    def __init__(self):\n        super().__init__()\n        self.last_sendcmpct = []\n        self.block_announced = False\n        # Store the hashes of blocks we've seen announced.\n        # This is for synchronizing the p2p message traffic,\n        # so we can eg wait until a particular block is announced.\n        self.announced_blockhashes = set()\n\n    def on_sendcmpct(self, message):\n        self.last_sendcmpct.append(message)\n\n    def on_cmpctblock(self, message):\n        self.block_announced = True\n        self.last_message[\"cmpctblock\"].header_and_shortids.header.calc_sha256()\n        self.announced_blockhashes.add(self.last_message[\"cmpctblock\"].header_and_shortids.header.sha256)\n\n    def on_headers(self, message):\n        self.block_announced = True\n        for x in self.last_message[\"headers\"].headers:\n            x.calc_sha256()\n            self.announced_blockhashes.add(x.sha256)\n\n    def on_inv(self, message):\n        for x in self.last_message[\"inv\"].inv:\n            if x.type == 2:\n                self.block_announced = True\n                self.announced_blockhashes.add(x.hash)\n\n    # Requires caller to hold mininode_lock\n    def received_block_announcement(self):\n        return self.block_announced\n\n    def clear_block_announcement(self):\n        with mininode_lock:\n            self.block_announced = False\n            self.last_message.pop(\"inv\", None)\n            self.last_message.pop(\"headers\", None)\n            self.last_message.pop(\"cmpctblock\", None)\n\n    def get_headers(self, locator, hashstop):\n        msg = msg_getheaders()\n        msg.locator.vHave = locator\n        msg.hashstop = hashstop\n        self.send_message(msg)\n\n    def send_header_for_blocks(self, new_blocks):\n        headers_message = msg_headers()\n        headers_message.headers = [CBlockHeader(b) for b in new_blocks]\n        self.send_message(headers_message)\n\n    def request_headers_and_sync(self, locator, hashstop=0):\n        self.clear_block_announcement()\n        self.get_headers(locator, hashstop)\n        wait_until(self.received_block_announcement, timeout=30, lock=mininode_lock)\n        self.clear_block_announcement()\n\n    # Block until a block announcement for a particular block hash is\n    # received.\n    def wait_for_block_announcement(self, block_hash, timeout=30):\n        def received_hash():\n            return (block_hash in self.announced_blockhashes)\n        wait_until(received_hash, timeout=timeout, lock=mininode_lock)\n\n    def send_await_disconnect(self, message, timeout=30):\n        \"\"\"Sends a message to the node and wait for disconnect.\n\n        This is used when we want to send a message into the node that we expect\n        will get us disconnected, eg an invalid block.\"\"\"\n        self.send_message(message)\n        wait_until(lambda: self.state != \"connected\", timeout=timeout, lock=mininode_lock)\n\nclass CompactBlocksTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        # Node0 = pre-segwit, node1 = segwit-aware\n        self.num_nodes = 2\n        # This test was written assuming SegWit is activated using BIP9 at height 432 (3x confirmation window).\n        # TODO: Rewrite this test to support SegWit being always active.\n        self.extra_args = [[\"-vbparams=segwit:0:0\"], [\"-vbparams=segwit:0:999999999999\", \"-txindex\", \"-deprecatedrpc=addwitnessaddress\"]]\n        self.utxos = []\n\n    def build_block_on_tip(self, node, segwit=False):\n        height = node.getblockcount()\n        tip = node.getbestblockhash()\n        mtp = node.getblockheader(tip)['mediantime']\n        block = create_block(int(tip, 16), create_coinbase(height + 1), mtp + 1)\n        block.nVersion = 4\n        if segwit:\n            add_witness_commitment(block)\n        block.solve()\n        return block\n\n    # Create 10 more anyone-can-spend utxo's for testing.\n    def make_utxos(self):\n        # Doesn't matter which node we use, just use node0.\n        block = self.build_block_on_tip(self.nodes[0])\n        self.test_node.send_and_ping(msg_block(block))\n        assert(int(self.nodes[0].getbestblockhash(), 16) == block.sha256)\n        self.nodes[0].generate(100)\n\n        total_value = block.vtx[0].vout[0].nValue\n        out_value = total_value // 10\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(block.vtx[0].sha256, 0), b''))\n        for i in range(10):\n            tx.vout.append(CTxOut(out_value, CScript([OP_TRUE])))\n        tx.rehash()\n\n        block2 = self.build_block_on_tip(self.nodes[0])\n        block2.vtx.append(tx)\n        block2.hashMerkleRoot = block2.calc_merkle_root()\n        block2.solve()\n        self.test_node.send_and_ping(msg_block(block2))\n        assert_equal(int(self.nodes[0].getbestblockhash(), 16), block2.sha256)\n        self.utxos.extend([[tx.sha256, i, out_value] for i in range(10)])\n        return\n\n    # Test \"sendcmpct\" (between peers preferring the same version):\n    # - No compact block announcements unless sendcmpct is sent.\n    # - If sendcmpct is sent with version > preferred_version, the message is ignored.\n    # - If sendcmpct is sent with boolean 0, then block announcements are not\n    #   made with compact blocks.\n    # - If sendcmpct is then sent with boolean 1, then new block announcements\n    #   are made with compact blocks.\n    # If old_node is passed in, request compact blocks with version=preferred-1\n    # and verify that it receives block announcements via compact block.\n    def test_sendcmpct(self, node, test_node, preferred_version, old_node=None):\n        # Make sure we get a SENDCMPCT message from our peer\n        def received_sendcmpct():\n            return (len(test_node.last_sendcmpct) > 0)\n        wait_until(received_sendcmpct, timeout=30, lock=mininode_lock)\n        with mininode_lock:\n            # Check that the first version received is the preferred one\n            assert_equal(test_node.last_sendcmpct[0].version, preferred_version)\n            # And that we receive versions down to 1.\n            assert_equal(test_node.last_sendcmpct[-1].version, 1)\n            test_node.last_sendcmpct = []\n\n        tip = int(node.getbestblockhash(), 16)\n\n        def check_announcement_of_new_block(node, peer, predicate):\n            peer.clear_block_announcement()\n            block_hash = int(node.generate(1)[0], 16)\n            peer.wait_for_block_announcement(block_hash, timeout=30)\n            assert(peer.block_announced)\n\n            with mininode_lock:\n                assert predicate(peer), (\n                    \"block_hash={!r}, cmpctblock={!r}, inv={!r}\".format(\n                        block_hash, peer.last_message.get(\"cmpctblock\", None), peer.last_message.get(\"inv\", None)))\n\n        # We shouldn't get any block announcements via cmpctblock yet.\n        check_announcement_of_new_block(node, test_node, lambda p: \"cmpctblock\" not in p.last_message)\n\n        # Try one more time, this time after requesting headers.\n        test_node.request_headers_and_sync(locator=[tip])\n        check_announcement_of_new_block(node, test_node, lambda p: \"cmpctblock\" not in p.last_message and \"inv\" in p.last_message)\n\n        # Test a few ways of using sendcmpct that should NOT\n        # result in compact block announcements.\n        # Before each test, sync the headers chain.\n        test_node.request_headers_and_sync(locator=[tip])\n\n        # Now try a SENDCMPCT message with too-high version\n        sendcmpct = msg_sendcmpct()\n        sendcmpct.version = preferred_version+1\n        sendcmpct.announce = True\n        test_node.send_and_ping(sendcmpct)\n        check_announcement_of_new_block(node, test_node, lambda p: \"cmpctblock\" not in p.last_message)\n\n        # Headers sync before next test.\n        test_node.request_headers_and_sync(locator=[tip])\n\n        # Now try a SENDCMPCT message with valid version, but announce=False\n        sendcmpct.version = preferred_version\n        sendcmpct.announce = False\n        test_node.send_and_ping(sendcmpct)\n        check_announcement_of_new_block(node, test_node, lambda p: \"cmpctblock\" not in p.last_message)\n\n        # Headers sync before next test.\n        test_node.request_headers_and_sync(locator=[tip])\n\n        # Finally, try a SENDCMPCT message with announce=True\n        sendcmpct.version = preferred_version\n        sendcmpct.announce = True\n        test_node.send_and_ping(sendcmpct)\n        check_announcement_of_new_block(node, test_node, lambda p: \"cmpctblock\" in p.last_message)\n\n        # Try one more time (no headers sync should be needed!)\n        check_announcement_of_new_block(node, test_node, lambda p: \"cmpctblock\" in p.last_message)\n\n        # Try one more time, after turning on sendheaders\n        test_node.send_and_ping(msg_sendheaders())\n        check_announcement_of_new_block(node, test_node, lambda p: \"cmpctblock\" in p.last_message)\n\n        # Try one more time, after sending a version-1, announce=false message.\n        sendcmpct.version = preferred_version-1\n        sendcmpct.announce = False\n        test_node.send_and_ping(sendcmpct)\n        check_announcement_of_new_block(node, test_node, lambda p: \"cmpctblock\" in p.last_message)\n\n        # Now turn off announcements\n        sendcmpct.version = preferred_version\n        sendcmpct.announce = False\n        test_node.send_and_ping(sendcmpct)\n        check_announcement_of_new_block(node, test_node, lambda p: \"cmpctblock\" not in p.last_message and \"headers\" in p.last_message)\n\n        if old_node is not None:\n            # Verify that a peer using an older protocol version can receive\n            # announcements from this node.\n            sendcmpct.version = preferred_version-1\n            sendcmpct.announce = True\n            old_node.send_and_ping(sendcmpct)\n            # Header sync\n            old_node.request_headers_and_sync(locator=[tip])\n            check_announcement_of_new_block(node, old_node, lambda p: \"cmpctblock\" in p.last_message)\n\n    # This test actually causes bitcoind to (reasonably!) disconnect us, so do this last.\n    def test_invalid_cmpctblock_message(self):\n        self.nodes[0].generate(101)\n        block = self.build_block_on_tip(self.nodes[0])\n\n        cmpct_block = P2PHeaderAndShortIDs()\n        cmpct_block.header = CBlockHeader(block)\n        cmpct_block.prefilled_txn_length = 1\n        # This index will be too high\n        prefilled_txn = PrefilledTransaction(1, block.vtx[0])\n        cmpct_block.prefilled_txn = [prefilled_txn]\n        self.test_node.send_await_disconnect(msg_cmpctblock(cmpct_block))\n        assert_equal(int(self.nodes[0].getbestblockhash(), 16), block.hashPrevBlock)\n\n    # Compare the generated shortids to what we expect based on BIP 152, given\n    # bitcoind's choice of nonce.\n    def test_compactblock_construction(self, node, test_node, version, use_witness_address):\n        # Generate a bunch of transactions.\n        node.generate(101)\n        num_transactions = 25\n        address = node.getnewaddress()\n        if use_witness_address:\n            # Want at least one segwit spend, so move all funds to\n            # a witness address.\n            address = node.addwitnessaddress(address)\n            value_to_send = node.getbalance()\n            node.sendtoaddress(address, satoshi_round(value_to_send-Decimal(0.1)))\n            node.generate(1)\n\n        segwit_tx_generated = False\n        for i in range(num_transactions):\n            txid = node.sendtoaddress(address, 0.1)\n            hex_tx = node.gettransaction(txid)[\"hex\"]\n            tx = FromHex(CTransaction(), hex_tx)\n            if not tx.wit.is_null():\n                segwit_tx_generated = True\n\n        if use_witness_address:\n            assert(segwit_tx_generated) # check that our test is not broken\n\n        # Wait until we've seen the block announcement for the resulting tip\n        tip = int(node.getbestblockhash(), 16)\n        test_node.wait_for_block_announcement(tip)\n\n        # Make sure we will receive a fast-announce compact block\n        self.request_cb_announcements(test_node, node, version)\n\n        # Now mine a block, and look at the resulting compact block.\n        test_node.clear_block_announcement()\n        block_hash = int(node.generate(1)[0], 16)\n\n        # Store the raw block in our internal format.\n        block = FromHex(CBlock(), node.getblock(\"%02x\" % block_hash, False))\n        for tx in block.vtx:\n            tx.calc_sha256()\n        block.rehash()\n\n        # Wait until the block was announced (via compact blocks)\n        wait_until(test_node.received_block_announcement, timeout=30, lock=mininode_lock)\n\n        # Now fetch and check the compact block\n        header_and_shortids = None\n        with mininode_lock:\n            assert(\"cmpctblock\" in test_node.last_message)\n            # Convert the on-the-wire representation to absolute indexes\n            header_and_shortids = HeaderAndShortIDs(test_node.last_message[\"cmpctblock\"].header_and_shortids)\n        self.check_compactblock_construction_from_block(version, header_and_shortids, block_hash, block)\n\n        # Now fetch the compact block using a normal non-announce getdata\n        with mininode_lock:\n            test_node.clear_block_announcement()\n            inv = CInv(4, block_hash)  # 4 == \"CompactBlock\"\n            test_node.send_message(msg_getdata([inv]))\n\n        wait_until(test_node.received_block_announcement, timeout=30, lock=mininode_lock)\n\n        # Now fetch and check the compact block\n        header_and_shortids = None\n        with mininode_lock:\n            assert(\"cmpctblock\" in test_node.last_message)\n            # Convert the on-the-wire representation to absolute indexes\n            header_and_shortids = HeaderAndShortIDs(test_node.last_message[\"cmpctblock\"].header_and_shortids)\n        self.check_compactblock_construction_from_block(version, header_and_shortids, block_hash, block)\n\n    def check_compactblock_construction_from_block(self, version, header_and_shortids, block_hash, block):\n        # Check that we got the right block!\n        header_and_shortids.header.calc_sha256()\n        assert_equal(header_and_shortids.header.sha256, block_hash)\n\n        # Make sure the prefilled_txn appears to have included the coinbase\n        assert(len(header_and_shortids.prefilled_txn) >= 1)\n        assert_equal(header_and_shortids.prefilled_txn[0].index, 0)\n\n        # Check that all prefilled_txn entries match what's in the block.\n        for entry in header_and_shortids.prefilled_txn:\n            entry.tx.calc_sha256()\n            # This checks the non-witness parts of the tx agree\n            assert_equal(entry.tx.sha256, block.vtx[entry.index].sha256)\n\n            # And this checks the witness\n            wtxid = entry.tx.calc_sha256(True)\n            if version == 2:\n                assert_equal(wtxid, block.vtx[entry.index].calc_sha256(True))\n            else:\n                # Shouldn't have received a witness\n                assert(entry.tx.wit.is_null())\n\n        # Check that the cmpctblock message announced all the transactions.\n        assert_equal(len(header_and_shortids.prefilled_txn) + len(header_and_shortids.shortids), len(block.vtx))\n\n        # And now check that all the shortids are as expected as well.\n        # Determine the siphash keys to use.\n        [k0, k1] = header_and_shortids.get_siphash_keys()\n\n        index = 0\n        while index < len(block.vtx):\n            if (len(header_and_shortids.prefilled_txn) > 0 and\n                    header_and_shortids.prefilled_txn[0].index == index):\n                # Already checked prefilled transactions above\n                header_and_shortids.prefilled_txn.pop(0)\n            else:\n                tx_hash = block.vtx[index].sha256\n                if version == 2:\n                    tx_hash = block.vtx[index].calc_sha256(True)\n                shortid = calculate_shortid(k0, k1, tx_hash)\n                assert_equal(shortid, header_and_shortids.shortids[0])\n                header_and_shortids.shortids.pop(0)\n            index += 1\n\n    # Test that bitcoind requests compact blocks when we announce new blocks\n    # via header or inv, and that responding to getblocktxn causes the block\n    # to be successfully reconstructed.\n    # Post-segwit: upgraded nodes would only make this request of cb-version-2,\n    # NODE_WITNESS peers.  Unupgraded nodes would still make this request of\n    # any cb-version-1-supporting peer.\n    def test_compactblock_requests(self, node, test_node, version, segwit):\n        # Try announcing a block with an inv or header, expect a compactblock\n        # request\n        for announce in [\"inv\", \"header\"]:\n            block = self.build_block_on_tip(node, segwit=segwit)\n            with mininode_lock:\n                test_node.last_message.pop(\"getdata\", None)\n\n            if announce == \"inv\":\n                test_node.send_message(msg_inv([CInv(2, block.sha256)]))\n                wait_until(lambda: \"getheaders\" in test_node.last_message, timeout=30, lock=mininode_lock)\n                test_node.send_header_for_blocks([block])\n            else:\n                test_node.send_header_for_blocks([block])\n            wait_until(lambda: \"getdata\" in test_node.last_message, timeout=30, lock=mininode_lock)\n            assert_equal(len(test_node.last_message[\"getdata\"].inv), 1)\n            assert_equal(test_node.last_message[\"getdata\"].inv[0].type, 4)\n            assert_equal(test_node.last_message[\"getdata\"].inv[0].hash, block.sha256)\n\n            # Send back a compactblock message that omits the coinbase\n            comp_block = HeaderAndShortIDs()\n            comp_block.header = CBlockHeader(block)\n            comp_block.nonce = 0\n            [k0, k1] = comp_block.get_siphash_keys()\n            coinbase_hash = block.vtx[0].sha256\n            if version == 2:\n                coinbase_hash = block.vtx[0].calc_sha256(True)\n            comp_block.shortids = [\n                    calculate_shortid(k0, k1, coinbase_hash) ]\n            test_node.send_and_ping(msg_cmpctblock(comp_block.to_p2p()))\n            assert_equal(int(node.getbestblockhash(), 16), block.hashPrevBlock)\n            # Expect a getblocktxn message.\n            with mininode_lock:\n                assert(\"getblocktxn\" in test_node.last_message)\n                absolute_indexes = test_node.last_message[\"getblocktxn\"].block_txn_request.to_absolute()\n            assert_equal(absolute_indexes, [0])  # should be a coinbase request\n\n            # Send the coinbase, and verify that the tip advances.\n            if version == 2:\n                msg = msg_witness_blocktxn()\n            else:\n                msg = msg_blocktxn()\n            msg.block_transactions.blockhash = block.sha256\n            msg.block_transactions.transactions = [block.vtx[0]]\n            test_node.send_and_ping(msg)\n            assert_equal(int(node.getbestblockhash(), 16), block.sha256)\n\n    # Create a chain of transactions from given utxo, and add to a new block.\n    def build_block_with_transactions(self, node, utxo, num_transactions):\n        block = self.build_block_on_tip(node)\n\n        for i in range(num_transactions):\n            tx = CTransaction()\n            tx.vin.append(CTxIn(COutPoint(utxo[0], utxo[1]), b''))\n            tx.vout.append(CTxOut(utxo[2] - 1000, CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])))\n            tx.rehash()\n            utxo = [tx.sha256, 0, tx.vout[0].nValue]\n            block.vtx.append(tx)\n\n        block.hashMerkleRoot = block.calc_merkle_root()\n        block.solve()\n        return block\n\n    # Test that we only receive getblocktxn requests for transactions that the\n    # node needs, and that responding to them causes the block to be\n    # reconstructed.\n    def test_getblocktxn_requests(self, node, test_node, version):\n        with_witness = (version==2)\n\n        def test_getblocktxn_response(compact_block, peer, expected_result):\n            msg = msg_cmpctblock(compact_block.to_p2p())\n            peer.send_and_ping(msg)\n            with mininode_lock:\n                assert(\"getblocktxn\" in peer.last_message)\n                absolute_indexes = peer.last_message[\"getblocktxn\"].block_txn_request.to_absolute()\n            assert_equal(absolute_indexes, expected_result)\n\n        def test_tip_after_message(node, peer, msg, tip):\n            peer.send_and_ping(msg)\n            assert_equal(int(node.getbestblockhash(), 16), tip)\n\n        # First try announcing compactblocks that won't reconstruct, and verify\n        # that we receive getblocktxn messages back.\n        utxo = self.utxos.pop(0)\n\n        block = self.build_block_with_transactions(node, utxo, 5)\n        self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])\n        comp_block = HeaderAndShortIDs()\n        comp_block.initialize_from_block(block, use_witness=with_witness)\n\n        test_getblocktxn_response(comp_block, test_node, [1, 2, 3, 4, 5])\n\n        msg_bt = msg_blocktxn()\n        if with_witness:\n            msg_bt = msg_witness_blocktxn() # serialize with witnesses\n        msg_bt.block_transactions = BlockTransactions(block.sha256, block.vtx[1:])\n        test_tip_after_message(node, test_node, msg_bt, block.sha256)\n\n        utxo = self.utxos.pop(0)\n        block = self.build_block_with_transactions(node, utxo, 5)\n        self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])\n\n        # Now try interspersing the prefilled transactions\n        comp_block.initialize_from_block(block, prefill_list=[0, 1, 5], use_witness=with_witness)\n        test_getblocktxn_response(comp_block, test_node, [2, 3, 4])\n        msg_bt.block_transactions = BlockTransactions(block.sha256, block.vtx[2:5])\n        test_tip_after_message(node, test_node, msg_bt, block.sha256)\n\n        # Now try giving one transaction ahead of time.\n        utxo = self.utxos.pop(0)\n        block = self.build_block_with_transactions(node, utxo, 5)\n        self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])\n        test_node.send_and_ping(msg_tx(block.vtx[1]))\n        assert(block.vtx[1].hash in node.getrawmempool())\n\n        # Prefill 4 out of the 6 transactions, and verify that only the one\n        # that was not in the mempool is requested.\n        comp_block.initialize_from_block(block, prefill_list=[0, 2, 3, 4], use_witness=with_witness)\n        test_getblocktxn_response(comp_block, test_node, [5])\n\n        msg_bt.block_transactions = BlockTransactions(block.sha256, [block.vtx[5]])\n        test_tip_after_message(node, test_node, msg_bt, block.sha256)\n\n        # Now provide all transactions to the node before the block is\n        # announced and verify reconstruction happens immediately.\n        utxo = self.utxos.pop(0)\n        block = self.build_block_with_transactions(node, utxo, 10)\n        self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])\n        for tx in block.vtx[1:]:\n            test_node.send_message(msg_tx(tx))\n        test_node.sync_with_ping()\n        # Make sure all transactions were accepted.\n        mempool = node.getrawmempool()\n        for tx in block.vtx[1:]:\n            assert(tx.hash in mempool)\n\n        # Clear out last request.\n        with mininode_lock:\n            test_node.last_message.pop(\"getblocktxn\", None)\n\n        # Send compact block\n        comp_block.initialize_from_block(block, prefill_list=[0], use_witness=with_witness)\n        test_tip_after_message(node, test_node, msg_cmpctblock(comp_block.to_p2p()), block.sha256)\n        with mininode_lock:\n            # Shouldn't have gotten a request for any transaction\n            assert(\"getblocktxn\" not in test_node.last_message)\n\n    # Incorrectly responding to a getblocktxn shouldn't cause the block to be\n    # permanently failed.\n    def test_incorrect_blocktxn_response(self, node, test_node, version):\n        if (len(self.utxos) == 0):\n            self.make_utxos()\n        utxo = self.utxos.pop(0)\n\n        block = self.build_block_with_transactions(node, utxo, 10)\n        self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])\n        # Relay the first 5 transactions from the block in advance\n        for tx in block.vtx[1:6]:\n            test_node.send_message(msg_tx(tx))\n        test_node.sync_with_ping()\n        # Make sure all transactions were accepted.\n        mempool = node.getrawmempool()\n        for tx in block.vtx[1:6]:\n            assert(tx.hash in mempool)\n\n        # Send compact block\n        comp_block = HeaderAndShortIDs()\n        comp_block.initialize_from_block(block, prefill_list=[0], use_witness=(version == 2))\n        test_node.send_and_ping(msg_cmpctblock(comp_block.to_p2p()))\n        absolute_indexes = []\n        with mininode_lock:\n            assert(\"getblocktxn\" in test_node.last_message)\n            absolute_indexes = test_node.last_message[\"getblocktxn\"].block_txn_request.to_absolute()\n        assert_equal(absolute_indexes, [6, 7, 8, 9, 10])\n\n        # Now give an incorrect response.\n        # Note that it's possible for bitcoind to be smart enough to know we're\n        # lying, since it could check to see if the shortid matches what we're\n        # sending, and eg disconnect us for misbehavior.  If that behavior\n        # change were made, we could just modify this test by having a\n        # different peer provide the block further down, so that we're still\n        # verifying that the block isn't marked bad permanently. This is good\n        # enough for now.\n        msg = msg_blocktxn()\n        if version==2:\n            msg = msg_witness_blocktxn()\n        msg.block_transactions = BlockTransactions(block.sha256, [block.vtx[5]] + block.vtx[7:])\n        test_node.send_and_ping(msg)\n\n        # Tip should not have updated\n        assert_equal(int(node.getbestblockhash(), 16), block.hashPrevBlock)\n\n        # We should receive a getdata request\n        wait_until(lambda: \"getdata\" in test_node.last_message, timeout=10, lock=mininode_lock)\n        assert_equal(len(test_node.last_message[\"getdata\"].inv), 1)\n        assert(test_node.last_message[\"getdata\"].inv[0].type == 2 or test_node.last_message[\"getdata\"].inv[0].type == 2|MSG_WITNESS_FLAG)\n        assert_equal(test_node.last_message[\"getdata\"].inv[0].hash, block.sha256)\n\n        # Deliver the block\n        if version==2:\n            test_node.send_and_ping(msg_witness_block(block))\n        else:\n            test_node.send_and_ping(msg_block(block))\n        assert_equal(int(node.getbestblockhash(), 16), block.sha256)\n\n    def test_getblocktxn_handler(self, node, test_node, version):\n        # bitcoind will not send blocktxn responses for blocks whose height is\n        # more than 10 blocks deep.\n        MAX_GETBLOCKTXN_DEPTH = 10\n        chain_height = node.getblockcount()\n        current_height = chain_height\n        while (current_height >= chain_height - MAX_GETBLOCKTXN_DEPTH):\n            block_hash = node.getblockhash(current_height)\n            block = FromHex(CBlock(), node.getblock(block_hash, False))\n\n            msg = msg_getblocktxn()\n            msg.block_txn_request = BlockTransactionsRequest(int(block_hash, 16), [])\n            num_to_request = random.randint(1, len(block.vtx))\n            msg.block_txn_request.from_absolute(sorted(random.sample(range(len(block.vtx)), num_to_request)))\n            test_node.send_message(msg)\n            wait_until(lambda: \"blocktxn\" in test_node.last_message, timeout=10, lock=mininode_lock)\n\n            [tx.calc_sha256() for tx in block.vtx]\n            with mininode_lock:\n                assert_equal(test_node.last_message[\"blocktxn\"].block_transactions.blockhash, int(block_hash, 16))\n                all_indices = msg.block_txn_request.to_absolute()\n                for index in all_indices:\n                    tx = test_node.last_message[\"blocktxn\"].block_transactions.transactions.pop(0)\n                    tx.calc_sha256()\n                    assert_equal(tx.sha256, block.vtx[index].sha256)\n                    if version == 1:\n                        # Witnesses should have been stripped\n                        assert(tx.wit.is_null())\n                    else:\n                        # Check that the witness matches\n                        assert_equal(tx.calc_sha256(True), block.vtx[index].calc_sha256(True))\n                test_node.last_message.pop(\"blocktxn\", None)\n            current_height -= 1\n\n        # Next request should send a full block response, as we're past the\n        # allowed depth for a blocktxn response.\n        block_hash = node.getblockhash(current_height)\n        msg.block_txn_request = BlockTransactionsRequest(int(block_hash, 16), [0])\n        with mininode_lock:\n            test_node.last_message.pop(\"block\", None)\n            test_node.last_message.pop(\"blocktxn\", None)\n        test_node.send_and_ping(msg)\n        with mininode_lock:\n            test_node.last_message[\"block\"].block.calc_sha256()\n            assert_equal(test_node.last_message[\"block\"].block.sha256, int(block_hash, 16))\n            assert \"blocktxn\" not in test_node.last_message\n\n    def test_compactblocks_not_at_tip(self, node, test_node):\n        # Test that requesting old compactblocks doesn't work.\n        MAX_CMPCTBLOCK_DEPTH = 5\n        new_blocks = []\n        for i in range(MAX_CMPCTBLOCK_DEPTH + 1):\n            test_node.clear_block_announcement()\n            new_blocks.append(node.generate(1)[0])\n            wait_until(test_node.received_block_announcement, timeout=30, lock=mininode_lock)\n\n        test_node.clear_block_announcement()\n        test_node.send_message(msg_getdata([CInv(4, int(new_blocks[0], 16))]))\n        wait_until(lambda: \"cmpctblock\" in test_node.last_message, timeout=30, lock=mininode_lock)\n\n        test_node.clear_block_announcement()\n        node.generate(1)\n        wait_until(test_node.received_block_announcement, timeout=30, lock=mininode_lock)\n        test_node.clear_block_announcement()\n        with mininode_lock:\n            test_node.last_message.pop(\"block\", None)\n        test_node.send_message(msg_getdata([CInv(4, int(new_blocks[0], 16))]))\n        wait_until(lambda: \"block\" in test_node.last_message, timeout=30, lock=mininode_lock)\n        with mininode_lock:\n            test_node.last_message[\"block\"].block.calc_sha256()\n            assert_equal(test_node.last_message[\"block\"].block.sha256, int(new_blocks[0], 16))\n\n        # Generate an old compactblock, and verify that it's not accepted.\n        cur_height = node.getblockcount()\n        hashPrevBlock = int(node.getblockhash(cur_height-5), 16)\n        block = self.build_block_on_tip(node)\n        block.hashPrevBlock = hashPrevBlock\n        block.solve()\n\n        comp_block = HeaderAndShortIDs()\n        comp_block.initialize_from_block(block)\n        test_node.send_and_ping(msg_cmpctblock(comp_block.to_p2p()))\n\n        tips = node.getchaintips()\n        found = False\n        for x in tips:\n            if x[\"hash\"] == block.hash:\n                assert_equal(x[\"status\"], \"headers-only\")\n                found = True\n                break\n        assert(found)\n\n        # Requesting this block via getblocktxn should silently fail\n        # (to avoid fingerprinting attacks).\n        msg = msg_getblocktxn()\n        msg.block_txn_request = BlockTransactionsRequest(block.sha256, [0])\n        with mininode_lock:\n            test_node.last_message.pop(\"blocktxn\", None)\n        test_node.send_and_ping(msg)\n        with mininode_lock:\n            assert \"blocktxn\" not in test_node.last_message\n\n    def activate_segwit(self, node):\n        node.generate(144*3)\n        assert_equal(get_bip9_status(node, \"segwit\")[\"status\"], 'active')\n\n    def test_end_to_end_block_relay(self, node, listeners):\n        utxo = self.utxos.pop(0)\n\n        block = self.build_block_with_transactions(node, utxo, 10)\n\n        [l.clear_block_announcement() for l in listeners]\n\n        # ToHex() won't serialize with witness, but this block has no witnesses\n        # anyway. TODO: repeat this test with witness tx's to a segwit node.\n        node.submitblock(ToHex(block))\n\n        for l in listeners:\n            wait_until(lambda: l.received_block_announcement(), timeout=30, lock=mininode_lock)\n        with mininode_lock:\n            for l in listeners:\n                assert \"cmpctblock\" in l.last_message\n                l.last_message[\"cmpctblock\"].header_and_shortids.header.calc_sha256()\n                assert_equal(l.last_message[\"cmpctblock\"].header_and_shortids.header.sha256, block.sha256)\n\n    # Test that we don't get disconnected if we relay a compact block with valid header,\n    # but invalid transactions.\n    def test_invalid_tx_in_compactblock(self, node, test_node, use_segwit):\n        assert(len(self.utxos))\n        utxo = self.utxos[0]\n\n        block = self.build_block_with_transactions(node, utxo, 5)\n        del block.vtx[3]\n        block.hashMerkleRoot = block.calc_merkle_root()\n        if use_segwit:\n            # If we're testing with segwit, also drop the coinbase witness,\n            # but include the witness commitment.\n            add_witness_commitment(block)\n            block.vtx[0].wit.vtxinwit = []\n        block.solve()\n\n        # Now send the compact block with all transactions prefilled, and\n        # verify that we don't get disconnected.\n        comp_block = HeaderAndShortIDs()\n        comp_block.initialize_from_block(block, prefill_list=[0, 1, 2, 3, 4], use_witness=use_segwit)\n        msg = msg_cmpctblock(comp_block.to_p2p())\n        test_node.send_and_ping(msg)\n\n        # Check that the tip didn't advance\n        assert(int(node.getbestblockhash(), 16) is not block.sha256)\n        test_node.sync_with_ping()\n\n    # Helper for enabling cb announcements\n    # Send the sendcmpct request and sync headers\n    def request_cb_announcements(self, peer, node, version):\n        tip = node.getbestblockhash()\n        peer.get_headers(locator=[int(tip, 16)], hashstop=0)\n\n        msg = msg_sendcmpct()\n        msg.version = version\n        msg.announce = True\n        peer.send_and_ping(msg)\n\n    def test_compactblock_reconstruction_multiple_peers(self, node, stalling_peer, delivery_peer):\n        assert(len(self.utxos))\n\n        def announce_cmpct_block(node, peer):\n            utxo = self.utxos.pop(0)\n            block = self.build_block_with_transactions(node, utxo, 5)\n\n            cmpct_block = HeaderAndShortIDs()\n            cmpct_block.initialize_from_block(block)\n            msg = msg_cmpctblock(cmpct_block.to_p2p())\n            peer.send_and_ping(msg)\n            with mininode_lock:\n                assert \"getblocktxn\" in peer.last_message\n            return block, cmpct_block\n\n        block, cmpct_block = announce_cmpct_block(node, stalling_peer)\n\n        for tx in block.vtx[1:]:\n            delivery_peer.send_message(msg_tx(tx))\n        delivery_peer.sync_with_ping()\n        mempool = node.getrawmempool()\n        for tx in block.vtx[1:]:\n            assert(tx.hash in mempool)\n\n        delivery_peer.send_and_ping(msg_cmpctblock(cmpct_block.to_p2p()))\n        assert_equal(int(node.getbestblockhash(), 16), block.sha256)\n\n        self.utxos.append([block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue])\n\n        # Now test that delivering an invalid compact block won't break relay\n\n        block, cmpct_block = announce_cmpct_block(node, stalling_peer)\n        for tx in block.vtx[1:]:\n            delivery_peer.send_message(msg_tx(tx))\n        delivery_peer.sync_with_ping()\n\n        cmpct_block.prefilled_txn[0].tx.wit.vtxinwit = [ CTxInWitness() ]\n        cmpct_block.prefilled_txn[0].tx.wit.vtxinwit[0].scriptWitness.stack = [ser_uint256(0)]\n\n        cmpct_block.use_witness = True\n        delivery_peer.send_and_ping(msg_cmpctblock(cmpct_block.to_p2p()))\n        assert(int(node.getbestblockhash(), 16) != block.sha256)\n\n        msg = msg_blocktxn()\n        msg.block_transactions.blockhash = block.sha256\n        msg.block_transactions.transactions = block.vtx[1:]\n        stalling_peer.send_and_ping(msg)\n        assert_equal(int(node.getbestblockhash(), 16), block.sha256)\n\n    def run_test(self):\n        # Setup the p2p connections and start up the network thread.\n        self.test_node = self.nodes[0].add_p2p_connection(TestNode())\n        self.segwit_node = self.nodes[1].add_p2p_connection(TestNode(), services=NODE_NETWORK|NODE_WITNESS)\n        self.old_node = self.nodes[1].add_p2p_connection(TestNode(), services=NODE_NETWORK)\n\n        network_thread_start()\n\n        self.test_node.wait_for_verack()\n\n        # We will need UTXOs to construct transactions in later tests.\n        self.make_utxos()\n\n        self.log.info(\"Running tests, pre-segwit activation:\")\n\n        self.log.info(\"Testing SENDCMPCT p2p message... \")\n        self.test_sendcmpct(self.nodes[0], self.test_node, 1)\n        sync_blocks(self.nodes)\n        self.test_sendcmpct(self.nodes[1], self.segwit_node, 2, old_node=self.old_node)\n        sync_blocks(self.nodes)\n\n        self.log.info(\"Testing compactblock construction...\")\n        self.test_compactblock_construction(self.nodes[0], self.test_node, 1, False)\n        sync_blocks(self.nodes)\n        self.test_compactblock_construction(self.nodes[1], self.segwit_node, 2, False)\n        sync_blocks(self.nodes)\n\n        self.log.info(\"Testing compactblock requests... \")\n        self.test_compactblock_requests(self.nodes[0], self.test_node, 1, False)\n        sync_blocks(self.nodes)\n        self.test_compactblock_requests(self.nodes[1], self.segwit_node, 2, False)\n        sync_blocks(self.nodes)\n\n        self.log.info(\"Testing getblocktxn requests...\")\n        self.test_getblocktxn_requests(self.nodes[0], self.test_node, 1)\n        sync_blocks(self.nodes)\n        self.test_getblocktxn_requests(self.nodes[1], self.segwit_node, 2)\n        sync_blocks(self.nodes)\n\n        self.log.info(\"Testing getblocktxn handler...\")\n        self.test_getblocktxn_handler(self.nodes[0], self.test_node, 1)\n        sync_blocks(self.nodes)\n        self.test_getblocktxn_handler(self.nodes[1], self.segwit_node, 2)\n        self.test_getblocktxn_handler(self.nodes[1], self.old_node, 1)\n        sync_blocks(self.nodes)\n\n        self.log.info(\"Testing compactblock requests/announcements not at chain tip...\")\n        self.test_compactblocks_not_at_tip(self.nodes[0], self.test_node)\n        sync_blocks(self.nodes)\n        self.test_compactblocks_not_at_tip(self.nodes[1], self.segwit_node)\n        self.test_compactblocks_not_at_tip(self.nodes[1], self.old_node)\n        sync_blocks(self.nodes)\n\n        self.log.info(\"Testing handling of incorrect blocktxn responses...\")\n        self.test_incorrect_blocktxn_response(self.nodes[0], self.test_node, 1)\n        sync_blocks(self.nodes)\n        self.test_incorrect_blocktxn_response(self.nodes[1], self.segwit_node, 2)\n        sync_blocks(self.nodes)\n\n        # End-to-end block relay tests\n        self.log.info(\"Testing end-to-end block relay...\")\n        self.request_cb_announcements(self.test_node, self.nodes[0], 1)\n        self.request_cb_announcements(self.old_node, self.nodes[1], 1)\n        self.request_cb_announcements(self.segwit_node, self.nodes[1], 2)\n        self.test_end_to_end_block_relay(self.nodes[0], [self.segwit_node, self.test_node, self.old_node])\n        self.test_end_to_end_block_relay(self.nodes[1], [self.segwit_node, self.test_node, self.old_node])\n\n        self.log.info(\"Testing handling of invalid compact blocks...\")\n        self.test_invalid_tx_in_compactblock(self.nodes[0], self.test_node, False)\n        self.test_invalid_tx_in_compactblock(self.nodes[1], self.segwit_node, False)\n        self.test_invalid_tx_in_compactblock(self.nodes[1], self.old_node, False)\n\n        self.log.info(\"Testing reconstructing compact blocks from all peers...\")\n        self.test_compactblock_reconstruction_multiple_peers(self.nodes[1], self.segwit_node, self.old_node)\n        sync_blocks(self.nodes)\n\n        # Advance to segwit activation\n        self.log.info(\"Advancing to segwit activation\")\n        self.activate_segwit(self.nodes[1])\n        self.log.info(\"Running tests, post-segwit activation...\")\n\n        self.log.info(\"Testing compactblock construction...\")\n        self.test_compactblock_construction(self.nodes[1], self.old_node, 1, True)\n        self.test_compactblock_construction(self.nodes[1], self.segwit_node, 2, True)\n        sync_blocks(self.nodes)\n\n        self.log.info(\"Testing compactblock requests (unupgraded node)... \")\n        self.test_compactblock_requests(self.nodes[0], self.test_node, 1, True)\n\n        self.log.info(\"Testing getblocktxn requests (unupgraded node)...\")\n        self.test_getblocktxn_requests(self.nodes[0], self.test_node, 1)\n\n        # Need to manually sync node0 and node1, because post-segwit activation,\n        # node1 will not download blocks from node0.\n        self.log.info(\"Syncing nodes...\")\n        assert(self.nodes[0].getbestblockhash() != self.nodes[1].getbestblockhash())\n        while (self.nodes[0].getblockcount() > self.nodes[1].getblockcount()):\n            block_hash = self.nodes[0].getblockhash(self.nodes[1].getblockcount()+1)\n            self.nodes[1].submitblock(self.nodes[0].getblock(block_hash, False))\n        assert_equal(self.nodes[0].getbestblockhash(), self.nodes[1].getbestblockhash())\n\n        self.log.info(\"Testing compactblock requests (segwit node)... \")\n        self.test_compactblock_requests(self.nodes[1], self.segwit_node, 2, True)\n\n        self.log.info(\"Testing getblocktxn requests (segwit node)...\")\n        self.test_getblocktxn_requests(self.nodes[1], self.segwit_node, 2)\n        sync_blocks(self.nodes)\n\n        self.log.info(\"Testing getblocktxn handler (segwit node should return witnesses)...\")\n        self.test_getblocktxn_handler(self.nodes[1], self.segwit_node, 2)\n        self.test_getblocktxn_handler(self.nodes[1], self.old_node, 1)\n\n        # Test that if we submitblock to node1, we'll get a compact block\n        # announcement to all peers.\n        # (Post-segwit activation, blocks won't propagate from node0 to node1\n        # automatically, so don't bother testing a block announced to node0.)\n        self.log.info(\"Testing end-to-end block relay...\")\n        self.request_cb_announcements(self.test_node, self.nodes[0], 1)\n        self.request_cb_announcements(self.old_node, self.nodes[1], 1)\n        self.request_cb_announcements(self.segwit_node, self.nodes[1], 2)\n        self.test_end_to_end_block_relay(self.nodes[1], [self.segwit_node, self.test_node, self.old_node])\n\n        self.log.info(\"Testing handling of invalid compact blocks...\")\n        self.test_invalid_tx_in_compactblock(self.nodes[0], self.test_node, False)\n        self.test_invalid_tx_in_compactblock(self.nodes[1], self.segwit_node, True)\n        self.test_invalid_tx_in_compactblock(self.nodes[1], self.old_node, True)\n\n        self.log.info(\"Testing invalid index in cmpctblock message...\")\n        self.test_invalid_cmpctblock_message()\n\n\nif __name__ == '__main__':\n    CompactBlocksTest().main()\n"
  },
  {
    "path": "test/functional/p2p_disconnect_ban.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test node disconnect and ban behavior\"\"\"\nimport time\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    assert_raises_rpc_error,\n    connect_nodes_bi,\n    wait_until,\n)\n\nclass DisconnectBanTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n\n    def run_test(self):\n        self.log.info(\"Test setban and listbanned RPCs\")\n\n        self.log.info(\"setban: successfully ban single IP address\")\n        assert_equal(len(self.nodes[1].getpeerinfo()), 2)  # node1 should have 2 connections to node0 at this point\n        self.nodes[1].setban(\"127.0.0.1\", \"add\")\n        wait_until(lambda: len(self.nodes[1].getpeerinfo()) == 0, timeout=10)\n        assert_equal(len(self.nodes[1].getpeerinfo()), 0)  # all nodes must be disconnected at this point\n        assert_equal(len(self.nodes[1].listbanned()), 1)\n\n        self.log.info(\"clearbanned: successfully clear ban list\")\n        self.nodes[1].clearbanned()\n        assert_equal(len(self.nodes[1].listbanned()), 0)\n        self.nodes[1].setban(\"127.0.0.0/24\", \"add\")\n\n        self.log.info(\"setban: fail to ban an already banned subnet\")\n        assert_equal(len(self.nodes[1].listbanned()), 1)\n        assert_raises_rpc_error(-23, \"IP/Subnet already banned\", self.nodes[1].setban, \"127.0.0.1\", \"add\")\n\n        self.log.info(\"setban: fail to ban an invalid subnet\")\n        assert_raises_rpc_error(-30, \"Error: Invalid IP/Subnet\", self.nodes[1].setban, \"127.0.0.1/42\", \"add\")\n        assert_equal(len(self.nodes[1].listbanned()), 1)  # still only one banned ip because 127.0.0.1 is within the range of 127.0.0.0/24\n\n        self.log.info(\"setban remove: fail to unban a non-banned subnet\")\n        assert_raises_rpc_error(-30, \"Error: Unban failed\", self.nodes[1].setban, \"127.0.0.1\", \"remove\")\n        assert_equal(len(self.nodes[1].listbanned()), 1)\n\n        self.log.info(\"setban remove: successfully unban subnet\")\n        self.nodes[1].setban(\"127.0.0.0/24\", \"remove\")\n        assert_equal(len(self.nodes[1].listbanned()), 0)\n        self.nodes[1].clearbanned()\n        assert_equal(len(self.nodes[1].listbanned()), 0)\n\n        self.log.info(\"setban: test persistence across node restart\")\n        self.nodes[1].setban(\"127.0.0.0/32\", \"add\")\n        self.nodes[1].setban(\"127.0.0.0/24\", \"add\")\n        # Set the mocktime so we can control when bans expire\n        old_time = int(time.time())\n        self.nodes[1].setmocktime(old_time)\n        self.nodes[1].setban(\"192.168.0.1\", \"add\", 1)  # ban for 1 seconds\n        self.nodes[1].setban(\"2001:4d48:ac57:400:cacf:e9ff:fe1d:9c63/19\", \"add\", 1000)  # ban for 1000 seconds\n        listBeforeShutdown = self.nodes[1].listbanned()\n        assert_equal(\"192.168.0.1/32\", listBeforeShutdown[2]['address'])\n        # Move time forward by 3 seconds so the third ban has expired\n        self.nodes[1].setmocktime(old_time + 3)\n        assert_equal(len(self.nodes[1].listbanned()), 3)\n\n        self.stop_node(1)\n        self.start_node(1)\n\n        listAfterShutdown = self.nodes[1].listbanned()\n        assert_equal(\"127.0.0.0/24\", listAfterShutdown[0]['address'])\n        assert_equal(\"127.0.0.0/32\", listAfterShutdown[1]['address'])\n        assert_equal(\"/19\" in listAfterShutdown[2]['address'], True)\n\n        # Clear ban lists\n        self.nodes[1].clearbanned()\n        connect_nodes_bi(self.nodes, 0, 1)\n\n        self.log.info(\"Test disconnectnode RPCs\")\n\n        self.log.info(\"disconnectnode: fail to disconnect when calling with address and nodeid\")\n        address1 = self.nodes[0].getpeerinfo()[0]['addr']\n        node1 = self.nodes[0].getpeerinfo()[0]['addr']\n        assert_raises_rpc_error(-32602, \"Only one of address and nodeid should be provided.\", self.nodes[0].disconnectnode, address=address1, nodeid=node1)\n\n        self.log.info(\"disconnectnode: fail to disconnect when calling with junk address\")\n        assert_raises_rpc_error(-29, \"Node not found in connected nodes\", self.nodes[0].disconnectnode, address=\"221B Baker Street\")\n\n        self.log.info(\"disconnectnode: successfully disconnect node by address\")\n        address1 = self.nodes[0].getpeerinfo()[0]['addr']\n        self.nodes[0].disconnectnode(address=address1)\n        wait_until(lambda: len(self.nodes[0].getpeerinfo()) == 1, timeout=10)\n        assert not [node for node in self.nodes[0].getpeerinfo() if node['addr'] == address1]\n\n        self.log.info(\"disconnectnode: successfully reconnect node\")\n        connect_nodes_bi(self.nodes, 0, 1)  # reconnect the node\n        assert_equal(len(self.nodes[0].getpeerinfo()), 2)\n        assert [node for node in self.nodes[0].getpeerinfo() if node['addr'] == address1]\n\n        self.log.info(\"disconnectnode: successfully disconnect node by node id\")\n        id1 = self.nodes[0].getpeerinfo()[0]['id']\n        self.nodes[0].disconnectnode(nodeid=id1)\n        wait_until(lambda: len(self.nodes[0].getpeerinfo()) == 1, timeout=10)\n        assert not [node for node in self.nodes[0].getpeerinfo() if node['id'] == id1]\n\nif __name__ == '__main__':\n    DisconnectBanTest().main()\n"
  },
  {
    "path": "test/functional/p2p_feefilter.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test processing of feefilter messages.\"\"\"\n\nfrom test_framework.mininode import *\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nimport time\n\n\ndef hashToHex(hash):\n    return format(hash, '064x')\n\n# Wait up to 60 secs to see if the testnode has received all the expected invs\ndef allInvsMatch(invsExpected, testnode):\n    for x in range(60):\n        with mininode_lock:\n            if (sorted(invsExpected) == sorted(testnode.txinvs)):\n                return True\n        time.sleep(1)\n    return False\n\nclass TestNode(P2PInterface):\n    def __init__(self):\n        super().__init__()\n        self.txinvs = []\n\n    def on_inv(self, message):\n        for i in message.inv:\n            if (i.type == 1):\n                self.txinvs.append(hashToHex(i.hash))\n\n    def clear_invs(self):\n        with mininode_lock:\n            self.txinvs = []\n\nclass FeeFilterTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n\n    def run_test(self):\n        node1 = self.nodes[1]\n        node0 = self.nodes[0]\n        # Get out of IBD\n        node1.generate(1)\n        sync_blocks(self.nodes)\n\n        # Setup the p2p connections and start up the network thread.\n        self.nodes[0].add_p2p_connection(TestNode())\n        network_thread_start()\n        self.nodes[0].p2p.wait_for_verack()\n\n        # Test that invs are received for all txs at feerate of 20 sat/byte\n        node1.settxfee(Decimal(\"0.00020000\"))\n        txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]\n        assert(allInvsMatch(txids, self.nodes[0].p2p))\n        self.nodes[0].p2p.clear_invs()\n\n        # Set a filter of 15 sat/byte\n        self.nodes[0].p2p.send_and_ping(msg_feefilter(15000))\n\n        # Test that txs are still being received (paying 20 sat/byte)\n        txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]\n        assert(allInvsMatch(txids, self.nodes[0].p2p))\n        self.nodes[0].p2p.clear_invs()\n\n        # Change tx fee rate to 10 sat/byte and test they are no longer received\n        node1.settxfee(Decimal(\"0.00010000\"))\n        [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]\n        sync_mempools(self.nodes) # must be sure node 0 has received all txs \n\n        # Send one transaction from node0 that should be received, so that we\n        # we can sync the test on receipt (if node1's txs were relayed, they'd\n        # be received by the time this node0 tx is received). This is\n        # unfortunately reliant on the current relay behavior where we batch up\n        # to 35 entries in an inv, which means that when this next transaction\n        # is eligible for relay, the prior transactions from node1 are eligible\n        # as well.\n        node0.settxfee(Decimal(\"0.00020000\"))\n        txids = [node0.sendtoaddress(node0.getnewaddress(), 1)]\n        assert(allInvsMatch(txids, self.nodes[0].p2p))\n        self.nodes[0].p2p.clear_invs()\n\n        # Remove fee filter and check that txs are received again\n        self.nodes[0].p2p.send_and_ping(msg_feefilter(0))\n        txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]\n        assert(allInvsMatch(txids, self.nodes[0].p2p))\n        self.nodes[0].p2p.clear_invs()\n\nif __name__ == '__main__':\n    FeeFilterTest().main()\n"
  },
  {
    "path": "test/functional/p2p_fingerprint.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test various fingerprinting protections.\n\nIf an stale block more than a month old or its header are requested by a peer,\nthe node should pretend that it does not have it to avoid fingerprinting.\n\"\"\"\n\nimport time\n\nfrom test_framework.blocktools import (create_block, create_coinbase)\nfrom test_framework.mininode import (\n    CInv,\n    P2PInterface,\n    msg_headers,\n    msg_block,\n    msg_getdata,\n    msg_getheaders,\n    network_thread_start,\n    wait_until,\n)\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n)\n\nclass P2PFingerprintTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    # Build a chain of blocks on top of given one\n    def build_chain(self, nblocks, prev_hash, prev_height, prev_median_time):\n        blocks = []\n        for _ in range(nblocks):\n            coinbase = create_coinbase(prev_height + 1)\n            block_time = prev_median_time + 1\n            block = create_block(int(prev_hash, 16), coinbase, block_time)\n            block.solve()\n\n            blocks.append(block)\n            prev_hash = block.hash\n            prev_height += 1\n            prev_median_time = block_time\n        return blocks\n\n    # Send a getdata request for a given block hash\n    def send_block_request(self, block_hash, node):\n        msg = msg_getdata()\n        msg.inv.append(CInv(2, block_hash))  # 2 == \"Block\"\n        node.send_message(msg)\n\n    # Send a getheaders request for a given single block hash\n    def send_header_request(self, block_hash, node):\n        msg = msg_getheaders()\n        msg.hashstop = block_hash\n        node.send_message(msg)\n\n    # Check whether last block received from node has a given hash\n    def last_block_equals(self, expected_hash, node):\n        block_msg = node.last_message.get(\"block\")\n        return block_msg and block_msg.block.rehash() == expected_hash\n\n    # Check whether last block header received from node has a given hash\n    def last_header_equals(self, expected_hash, node):\n        headers_msg = node.last_message.get(\"headers\")\n        return (headers_msg and\n                headers_msg.headers and\n                headers_msg.headers[0].rehash() == expected_hash)\n\n    # Checks that stale blocks timestamped more than a month ago are not served\n    # by the node while recent stale blocks and old active chain blocks are.\n    # This does not currently test that stale blocks timestamped within the\n    # last month but that have over a month's worth of work are also withheld.\n    def run_test(self):\n        node0 = self.nodes[0].add_p2p_connection(P2PInterface())\n\n        network_thread_start()\n        node0.wait_for_verack()\n\n        # Set node time to 60 days ago\n        self.nodes[0].setmocktime(int(time.time()) - 60 * 24 * 60 * 60)\n\n        # Generating a chain of 10 blocks\n        block_hashes = self.nodes[0].generate(nblocks=10)\n\n        # Create longer chain starting 2 blocks before current tip\n        height = len(block_hashes) - 2\n        block_hash = block_hashes[height - 1]\n        block_time = self.nodes[0].getblockheader(block_hash)[\"mediantime\"] + 1\n        new_blocks = self.build_chain(5, block_hash, height, block_time)\n\n        # Force reorg to a longer chain\n        node0.send_message(msg_headers(new_blocks))\n        node0.wait_for_getdata()\n        for block in new_blocks:\n            node0.send_and_ping(msg_block(block))\n\n        # Check that reorg succeeded\n        assert_equal(self.nodes[0].getblockcount(), 13)\n\n        stale_hash = int(block_hashes[-1], 16)\n\n        # Check that getdata request for stale block succeeds\n        self.send_block_request(stale_hash, node0)\n        test_function = lambda: self.last_block_equals(stale_hash, node0)\n        wait_until(test_function, timeout=3)\n\n        # Check that getheader request for stale block header succeeds\n        self.send_header_request(stale_hash, node0)\n        test_function = lambda: self.last_header_equals(stale_hash, node0)\n        wait_until(test_function, timeout=3)\n\n        # Longest chain is extended so stale is much older than chain tip\n        self.nodes[0].setmocktime(0)\n        tip = self.nodes[0].generate(nblocks=1)[0]\n        assert_equal(self.nodes[0].getblockcount(), 14)\n\n        # Send getdata & getheaders to refresh last received getheader message\n        block_hash = int(tip, 16)\n        self.send_block_request(block_hash, node0)\n        self.send_header_request(block_hash, node0)\n        node0.sync_with_ping()\n\n        # Request for very old stale block should now fail\n        self.send_block_request(stale_hash, node0)\n        time.sleep(3)\n        assert not self.last_block_equals(stale_hash, node0)\n\n        # Request for very old stale block header should now fail\n        self.send_header_request(stale_hash, node0)\n        time.sleep(3)\n        assert not self.last_header_equals(stale_hash, node0)\n\n        # Verify we can fetch very old blocks and headers on the active chain\n        block_hash = int(block_hashes[2], 16)\n        self.send_block_request(block_hash, node0)\n        self.send_header_request(block_hash, node0)\n        node0.sync_with_ping()\n\n        self.send_block_request(block_hash, node0)\n        test_function = lambda: self.last_block_equals(block_hash, node0)\n        wait_until(test_function, timeout=3)\n\n        self.send_header_request(block_hash, node0)\n        test_function = lambda: self.last_header_equals(block_hash, node0)\n        wait_until(test_function, timeout=3)\n\nif __name__ == '__main__':\n    P2PFingerprintTest().main()\n"
  },
  {
    "path": "test/functional/p2p_invalid_block.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test node responses to invalid blocks.\n\nIn this test we connect to one node over p2p, and test block requests:\n1) Valid blocks should be requested and become chain tip.\n2) Invalid block with duplicated transaction should be re-requested.\n3) Invalid block with bad coinbase value should be rejected and not\nre-requested.\n\"\"\"\n\nfrom test_framework.test_framework import ComparisonTestFramework\nfrom test_framework.util import *\nfrom test_framework.comptool import TestManager, TestInstance, RejectResult\nfrom test_framework.blocktools import *\nfrom test_framework.mininode import network_thread_start\nimport copy\nimport time\n\n# Use the ComparisonTestFramework with 1 node: only use --testbinary.\nclass InvalidBlockRequestTest(ComparisonTestFramework):\n\n    ''' Can either run this test as 1 node with expected answers, or two and compare them. \n        Change the \"outcome\" variable from each TestInstance object to only do the comparison. '''\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.setup_clean_chain = True\n\n    def run_test(self):\n        test = TestManager(self, self.options.tmpdir)\n        test.add_all_connections(self.nodes)\n        self.tip = None\n        self.block_time = None\n        network_thread_start()\n        test.run()\n\n    def get_tests(self):\n        if self.tip is None:\n            self.tip = int(\"0x\" + self.nodes[0].getbestblockhash(), 0)\n        self.block_time = int(time.time())+1\n\n        '''\n        Create a new block with an anyone-can-spend coinbase\n        '''\n        height = 1\n        block = create_block(self.tip, create_coinbase(height), self.block_time)\n        self.block_time += 1\n        block.solve()\n        # Save the coinbase for later\n        self.block1 = block\n        self.tip = block.sha256\n        height += 1\n        yield TestInstance([[block, True]])\n\n        '''\n        Now we need that block to mature so we can spend the coinbase.\n        '''\n        test = TestInstance(sync_every_block=False)\n        for i in range(100):\n            block = create_block(self.tip, create_coinbase(height), self.block_time)\n            block.solve()\n            self.tip = block.sha256\n            self.block_time += 1\n            test.blocks_and_transactions.append([block, True])\n            height += 1\n        yield test\n\n        '''\n        Now we use merkle-root malleability to generate an invalid block with\n        same blockheader.\n        Manufacture a block with 3 transactions (coinbase, spend of prior\n        coinbase, spend of that spend).  Duplicate the 3rd transaction to \n        leave merkle root and blockheader unchanged but invalidate the block.\n        '''\n        block2 = create_block(self.tip, create_coinbase(height), self.block_time)\n        self.block_time += 1\n\n        # b'0x51' is OP_TRUE\n        tx1 = create_transaction(self.block1.vtx[0], 0, b'\\x51', 50 * COIN)\n        tx2 = create_transaction(tx1, 0, b'\\x51', 50 * COIN)\n\n        block2.vtx.extend([tx1, tx2])\n        block2.hashMerkleRoot = block2.calc_merkle_root()\n        block2.rehash()\n        block2.solve()\n        orig_hash = block2.sha256\n        block2_orig = copy.deepcopy(block2)\n\n        # Mutate block 2\n        block2.vtx.append(tx2)\n        assert_equal(block2.hashMerkleRoot, block2.calc_merkle_root())\n        assert_equal(orig_hash, block2.rehash())\n        assert(block2_orig.vtx != block2.vtx)\n\n        self.tip = block2.sha256\n        yield TestInstance([[block2, RejectResult(16, b'bad-txns-duplicate')]])\n\n        # Check transactions for duplicate inputs\n        self.log.info(\"Test duplicate input block.\")\n\n        block2_dup = copy.deepcopy(block2_orig)\n        block2_dup.vtx[2].vin.append(block2_dup.vtx[2].vin[0])\n        block2_dup.vtx[2].rehash()\n        block2_dup.hashMerkleRoot = block2_dup.calc_merkle_root()\n        block2_dup.rehash()\n        block2_dup.solve()\n        yield TestInstance([[block2_dup, RejectResult(16, b'bad-txns-inputs-duplicate')], [block2_orig, True]])\n        height += 1\n\n        '''\n        Make sure that a totally screwed up block is not valid.\n        '''\n        block3 = create_block(self.tip, create_coinbase(height), self.block_time)\n        self.block_time += 1\n        block3.vtx[0].vout[0].nValue = 100 * COIN # Too high!\n        block3.vtx[0].sha256=None\n        block3.vtx[0].calc_sha256()\n        block3.hashMerkleRoot = block3.calc_merkle_root()\n        block3.rehash()\n        block3.solve()\n\n        yield TestInstance([[block3, RejectResult(16, b'bad-cb-amount')]])\n\n\nif __name__ == '__main__':\n    InvalidBlockRequestTest().main()\n"
  },
  {
    "path": "test/functional/p2p_invalid_tx.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test node responses to invalid transactions.\n\nIn this test we connect to one node over p2p, and test tx requests.\n\"\"\"\n\nfrom test_framework.test_framework import ComparisonTestFramework\nfrom test_framework.comptool import TestManager, TestInstance, RejectResult\nfrom test_framework.blocktools import *\nimport time\n\n\n\n# Use the ComparisonTestFramework with 1 node: only use --testbinary.\nclass InvalidTxRequestTest(ComparisonTestFramework):\n\n    ''' Can either run this test as 1 node with expected answers, or two and compare them. \n        Change the \"outcome\" variable from each TestInstance object to only do the comparison. '''\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.setup_clean_chain = True\n\n    def run_test(self):\n        test = TestManager(self, self.options.tmpdir)\n        test.add_all_connections(self.nodes)\n        self.tip = None\n        self.block_time = None\n        network_thread_start()\n        test.run()\n\n    def get_tests(self):\n        if self.tip is None:\n            self.tip = int(\"0x\" + self.nodes[0].getbestblockhash(), 0)\n        self.block_time = int(time.time())+1\n\n        '''\n        Create a new block with an anyone-can-spend coinbase\n        '''\n        height = 1\n        block = create_block(self.tip, create_coinbase(height), self.block_time)\n        self.block_time += 1\n        block.solve()\n        # Save the coinbase for later\n        self.block1 = block\n        self.tip = block.sha256\n        height += 1\n        yield TestInstance([[block, True]])\n\n        '''\n        Now we need that block to mature so we can spend the coinbase.\n        '''\n        test = TestInstance(sync_every_block=False)\n        for i in range(100):\n            block = create_block(self.tip, create_coinbase(height), self.block_time)\n            block.solve()\n            self.tip = block.sha256\n            self.block_time += 1\n            test.blocks_and_transactions.append([block, True])\n            height += 1\n        yield test\n\n        # b'\\x64' is OP_NOTIF\n        # Transaction will be rejected with code 16 (REJECT_INVALID)\n        tx1 = create_transaction(self.block1.vtx[0], 0, b'\\x64' * 35, 50 * COIN - 12000)\n        yield TestInstance([[tx1, RejectResult(16, b'mandatory-script-verify-flag-failed')]])\n\n        # TODO: test further transactions...\n\nif __name__ == '__main__':\n    InvalidTxRequestTest().main()\n"
  },
  {
    "path": "test/functional/p2p_leak.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test message sending before handshake completion.\n\nA node should never send anything other than VERSION/VERACK/REJECT until it's\nreceived a VERACK.\n\nThis test connects to a node and sends it a few messages, trying to intice it\ninto sending us something it shouldn't.\n\nAlso test that nodes that send unsupported service bits to bitcoind are disconnected\nand don't receive a VERACK. Unsupported service bits are currently 1 << 5 and\n1 << 7 (until August 1st 2018).\"\"\"\n\nfrom test_framework.mininode import *\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nbanscore = 10\n\nclass CLazyNode(P2PInterface):\n    def __init__(self):\n        super().__init__()\n        self.unexpected_msg = False\n        self.ever_connected = False\n\n    def bad_message(self, message):\n        self.unexpected_msg = True\n        self.log.info(\"should not have received message: %s\" % message.command)\n\n    def on_open(self):\n        self.ever_connected = True\n\n    def on_version(self, message): self.bad_message(message)\n    def on_verack(self, message): self.bad_message(message)\n    def on_reject(self, message): self.bad_message(message)\n    def on_inv(self, message): self.bad_message(message)\n    def on_addr(self, message): self.bad_message(message)\n    def on_getdata(self, message): self.bad_message(message)\n    def on_getblocks(self, message): self.bad_message(message)\n    def on_tx(self, message): self.bad_message(message)\n    def on_block(self, message): self.bad_message(message)\n    def on_getaddr(self, message): self.bad_message(message)\n    def on_headers(self, message): self.bad_message(message)\n    def on_getheaders(self, message): self.bad_message(message)\n    def on_ping(self, message): self.bad_message(message)\n    def on_mempool(self, message): self.bad_message(message)\n    def on_pong(self, message): self.bad_message(message)\n    def on_feefilter(self, message): self.bad_message(message)\n    def on_sendheaders(self, message): self.bad_message(message)\n    def on_sendcmpct(self, message): self.bad_message(message)\n    def on_cmpctblock(self, message): self.bad_message(message)\n    def on_getblocktxn(self, message): self.bad_message(message)\n    def on_blocktxn(self, message): self.bad_message(message)\n\n# Node that never sends a version. We'll use this to send a bunch of messages\n# anyway, and eventually get disconnected.\nclass CNodeNoVersionBan(CLazyNode):\n    # send a bunch of veracks without sending a message. This should get us disconnected.\n    # NOTE: implementation-specific check here. Remove if bitcoind ban behavior changes\n    def on_open(self):\n        super().on_open()\n        for i in range(banscore):\n            self.send_message(msg_verack())\n\n    def on_reject(self, message): pass\n\n# Node that never sends a version. This one just sits idle and hopes to receive\n# any message (it shouldn't!)\nclass CNodeNoVersionIdle(CLazyNode):\n    def __init__(self):\n        super().__init__()\n\n# Node that sends a version but not a verack.\nclass CNodeNoVerackIdle(CLazyNode):\n    def __init__(self):\n        self.version_received = False\n        super().__init__()\n\n    def on_reject(self, message): pass\n    def on_verack(self, message): pass\n    # When version is received, don't reply with a verack. Instead, see if the\n    # node will give us a message that it shouldn't. This is not an exhaustive\n    # list!\n    def on_version(self, message):\n        self.version_received = True\n        self.send_message(msg_ping())\n        self.send_message(msg_getaddr())\n\nclass P2PLeakTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.extra_args = [['-banscore='+str(banscore)]]\n\n    def run_test(self):\n        self.nodes[0].setmocktime(1501545600)  # August 1st 2017\n\n        no_version_bannode = self.nodes[0].add_p2p_connection(CNodeNoVersionBan(), send_version=False)\n        no_version_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVersionIdle(), send_version=False)\n        no_verack_idlenode = self.nodes[0].add_p2p_connection(CNodeNoVerackIdle())\n        unsupported_service_bit5_node = self.nodes[0].add_p2p_connection(CLazyNode(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_5)\n        unsupported_service_bit7_node = self.nodes[0].add_p2p_connection(CLazyNode(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_7)\n\n        network_thread_start()\n\n        wait_until(lambda: no_version_bannode.ever_connected, timeout=10, lock=mininode_lock)\n        wait_until(lambda: no_version_idlenode.ever_connected, timeout=10, lock=mininode_lock)\n        wait_until(lambda: no_verack_idlenode.version_received, timeout=10, lock=mininode_lock)\n        wait_until(lambda: unsupported_service_bit5_node.ever_connected, timeout=10, lock=mininode_lock)\n        wait_until(lambda: unsupported_service_bit7_node.ever_connected, timeout=10, lock=mininode_lock)\n\n        # Mine a block and make sure that it's not sent to the connected nodes\n        self.nodes[0].generate(1)\n\n        #Give the node enough time to possibly leak out a message\n        time.sleep(5)\n\n        #This node should have been banned\n        assert no_version_bannode.state != \"connected\"\n\n        # These nodes should have been disconnected\n        assert unsupported_service_bit5_node.state != \"connected\"\n        assert unsupported_service_bit7_node.state != \"connected\"\n\n        self.nodes[0].disconnect_p2ps()\n\n        # Wait until all connections are closed and the network thread has terminated\n        wait_until(lambda: len(self.nodes[0].getpeerinfo()) == 0)\n        network_thread_join()\n\n        # Make sure no unexpected messages came in\n        assert(no_version_bannode.unexpected_msg == False)\n        assert(no_version_idlenode.unexpected_msg == False)\n        assert(no_verack_idlenode.unexpected_msg == False)\n        assert not unsupported_service_bit5_node.unexpected_msg\n        assert not unsupported_service_bit7_node.unexpected_msg\n\n        self.log.info(\"Service bits 5 and 7 are allowed after August 1st 2018\")\n        self.nodes[0].setmocktime(1533168000)  # August 2nd 2018\n\n        allowed_service_bit5_node = self.nodes[0].add_p2p_connection(P2PInterface(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_5)\n        allowed_service_bit7_node = self.nodes[0].add_p2p_connection(P2PInterface(), services=NODE_NETWORK|NODE_UNSUPPORTED_SERVICE_BIT_7)\n\n        # Network thread stopped when all previous P2PInterfaces disconnected. Restart it\n        network_thread_start()\n\n        wait_until(lambda: allowed_service_bit5_node.message_count[\"verack\"], lock=mininode_lock)\n        wait_until(lambda: allowed_service_bit7_node.message_count[\"verack\"], lock=mininode_lock)\n\nif __name__ == '__main__':\n    P2PLeakTest().main()\n"
  },
  {
    "path": "test/functional/p2p_mempool.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test p2p mempool message.\n\nTest that nodes are disconnected if they send mempool messages when bloom\nfilters are not enabled.\n\"\"\"\n\nfrom test_framework.mininode import *\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass P2PMempoolTests(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n        self.extra_args = [[\"-peerbloomfilters=0\"]]\n\n    def run_test(self):\n        # Add a p2p connection\n        self.nodes[0].add_p2p_connection(P2PInterface())\n        network_thread_start()\n        self.nodes[0].p2p.wait_for_verack()\n\n        #request mempool\n        self.nodes[0].p2p.send_message(msg_mempool())\n        self.nodes[0].p2p.wait_for_disconnect()\n\n        #mininode must be disconnected at this point\n        assert_equal(len(self.nodes[0].getpeerinfo()), 0)\n    \nif __name__ == '__main__':\n    P2PMempoolTests().main()\n"
  },
  {
    "path": "test/functional/p2p_node_network_limited.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Tests NODE_NETWORK_LIMITED.\n\nTests that a node configured with -prune=550 signals NODE_NETWORK_LIMITED correctly\nand that it responds to getdata requests for blocks correctly:\n    - send a block within 288 + 2 of the tip\n    - disconnect peers who request blocks older than that.\"\"\"\nfrom test_framework.messages import CInv, msg_getdata\nfrom test_framework.mininode import NODE_BLOOM, NODE_NETWORK_LIMITED, NODE_WITNESS, NetworkThread, P2PInterface\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal\n\nclass P2PIgnoreInv(P2PInterface):\n    def on_inv(self, message):\n        # The node will send us invs for other blocks. Ignore them.\n        pass\n\n    def send_getdata_for_block(self, blockhash):\n        getdata_request = msg_getdata()\n        getdata_request.inv.append(CInv(2, int(blockhash, 16)))\n        self.send_message(getdata_request)\n\nclass NodeNetworkLimitedTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n        self.extra_args = [['-prune=550']]\n\n    def run_test(self):\n        node = self.nodes[0].add_p2p_connection(P2PIgnoreInv())\n        NetworkThread().start()\n        node.wait_for_verack()\n\n        expected_services = NODE_BLOOM | NODE_WITNESS | NODE_NETWORK_LIMITED\n\n        self.log.info(\"Check that node has signalled expected services.\")\n        assert_equal(node.nServices, expected_services)\n\n        self.log.info(\"Check that the localservices is as expected.\")\n        assert_equal(int(self.nodes[0].getnetworkinfo()['localservices'], 16), expected_services)\n\n        self.log.info(\"Mine enough blocks to reach the NODE_NETWORK_LIMITED range.\")\n        blocks = self.nodes[0].generate(292)\n\n        self.log.info(\"Make sure we can max retrive block at tip-288.\")\n        node.send_getdata_for_block(blocks[1])  # last block in valid range\n        node.wait_for_block(int(blocks[1], 16), timeout=3)\n\n        self.log.info(\"Requesting block at height 2 (tip-289) must fail (ignored).\")\n        node.send_getdata_for_block(blocks[0])  # first block outside of the 288+2 limit\n        node.wait_for_disconnect(5)\n\nif __name__ == '__main__':\n    NodeNetworkLimitedTest().main()\n"
  },
  {
    "path": "test/functional/p2p_segwit.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test segwit transactions and blocks on P2P network.\"\"\"\n\nfrom test_framework.mininode import *\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.script import *\nfrom test_framework.blocktools import create_block, create_coinbase, add_witness_commitment, get_witness_script, WITNESS_COMMITMENT_HEADER\nfrom test_framework.key import CECKey, CPubKey\nimport time\nimport random\nfrom binascii import hexlify\n\n# The versionbit bit used to signal activation of SegWit\nVB_WITNESS_BIT = 1\nVB_PERIOD = 144\nVB_TOP_BITS = 0x20000000\n\nMAX_SIGOP_COST = 80000\n\n\n# Calculate the virtual size of a witness block:\n# (base + witness/4)\ndef get_virtual_size(witness_block):\n    base_size = len(witness_block.serialize(with_witness=False))\n    total_size = len(witness_block.serialize(with_witness=True))\n    # the \"+3\" is so we round up\n    vsize = int((3*base_size + total_size + 3)/4)\n    return vsize\n\ndef test_transaction_acceptance(rpc, p2p, tx, with_witness, accepted, reason=None):\n    \"\"\"Send a transaction to the node and check that it's accepted to the mempool\n\n    - Submit the transaction over the p2p interface\n    - use the getrawmempool rpc to check for acceptance.\"\"\"\n    tx_message = msg_tx(tx)\n    if with_witness:\n        tx_message = msg_witness_tx(tx)\n    p2p.send_message(tx_message)\n    p2p.sync_with_ping()\n    assert_equal(tx.hash in rpc.getrawmempool(), accepted)\n    if (reason != None and not accepted):\n        # Check the rejection reason as well.\n        with mininode_lock:\n            assert_equal(p2p.last_message[\"reject\"].reason, reason)\n\ndef test_witness_block(rpc, p2p, block, accepted, with_witness=True):\n    \"\"\"Send a block to the node and check that it's accepted\n\n    - Submit the block over the p2p interface\n    - use the getbestblockhash rpc to check for acceptance.\"\"\"\n    if with_witness:\n        p2p.send_message(msg_witness_block(block))\n    else:\n        p2p.send_message(msg_block(block))\n    p2p.sync_with_ping()\n    assert_equal(rpc.getbestblockhash() == block.hash, accepted)\n\nclass TestNode(P2PInterface):\n    def __init__(self):\n        super().__init__()\n        self.getdataset = set()\n\n    def on_getdata(self, message):\n        for inv in message.inv:\n            self.getdataset.add(inv.hash)\n\n    def announce_tx_and_wait_for_getdata(self, tx, timeout=60):\n        with mininode_lock:\n            self.last_message.pop(\"getdata\", None)\n        self.send_message(msg_inv(inv=[CInv(1, tx.sha256)]))\n        self.wait_for_getdata(timeout)\n\n    def announce_block_and_wait_for_getdata(self, block, use_header, timeout=60):\n        with mininode_lock:\n            self.last_message.pop(\"getdata\", None)\n            self.last_message.pop(\"getheaders\", None)\n        msg = msg_headers()\n        msg.headers = [ CBlockHeader(block) ]\n        if use_header:\n            self.send_message(msg)\n        else:\n            self.send_message(msg_inv(inv=[CInv(2, block.sha256)]))\n            self.wait_for_getheaders()\n            self.send_message(msg)\n        self.wait_for_getdata()\n\n    def request_block(self, blockhash, inv_type, timeout=60):\n        with mininode_lock:\n            self.last_message.pop(\"block\", None)\n        self.send_message(msg_getdata(inv=[CInv(inv_type, blockhash)]))\n        self.wait_for_block(blockhash, timeout)\n        return self.last_message[\"block\"].block\n\n# Used to keep track of anyone-can-spend outputs that we can use in the tests\nclass UTXO():\n    def __init__(self, sha256, n, nValue):\n        self.sha256 = sha256\n        self.n = n\n        self.nValue = nValue\n\n# Helper for getting the script associated with a P2PKH\ndef GetP2PKHScript(pubkeyhash):\n    return CScript([CScriptOp(OP_DUP), CScriptOp(OP_HASH160), pubkeyhash, CScriptOp(OP_EQUALVERIFY), CScriptOp(OP_CHECKSIG)])\n\n# Add signature for a P2PK witness program.\ndef sign_P2PK_witness_input(script, txTo, inIdx, hashtype, value, key):\n    tx_hash = SegwitVersion1SignatureHash(script, txTo, inIdx, hashtype, value)\n    signature = key.sign(tx_hash) + chr(hashtype).encode('latin-1')\n    txTo.wit.vtxinwit[inIdx].scriptWitness.stack = [signature, script]\n    txTo.rehash()\n\n\nclass SegWitTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 3\n        # This test tests SegWit both pre and post-activation, so use the normal BIP9 activation.\n        self.extra_args = [[\"-whitelist=127.0.0.1\", \"-vbparams=segwit:0:999999999999\"], [\"-whitelist=127.0.0.1\", \"-acceptnonstdtxn=0\", \"-vbparams=segwit:0:999999999999\"], [\"-whitelist=127.0.0.1\", \"-vbparams=segwit:0:0\"]]\n\n    def setup_network(self):\n        self.setup_nodes()\n        connect_nodes(self.nodes[0], 1)\n        connect_nodes(self.nodes[0], 2)\n        self.sync_all()\n\n    ''' Helpers '''\n    # Build a block on top of node0's tip.\n    def build_next_block(self, nVersion=4):\n        tip = self.nodes[0].getbestblockhash()\n        height = self.nodes[0].getblockcount() + 1\n        block_time = self.nodes[0].getblockheader(tip)[\"mediantime\"] + 1\n        block = create_block(int(tip, 16), create_coinbase(height), block_time)\n        block.nVersion = nVersion\n        block.rehash()\n        return block\n\n    # Adds list of transactions to block, adds witness commitment, then solves.\n    def update_witness_block_with_transactions(self, block, tx_list, nonce=0):\n        block.vtx.extend(tx_list)\n        add_witness_commitment(block, nonce)\n        block.solve()\n        return\n\n    ''' Individual tests '''\n    def test_witness_services(self):\n        self.log.info(\"Verifying NODE_WITNESS service bit\")\n        assert((self.test_node.nServices & NODE_WITNESS) != 0)\n\n\n    # See if sending a regular transaction works, and create a utxo\n    # to use in later tests.\n    def test_non_witness_transaction(self):\n        # Mine a block with an anyone-can-spend coinbase,\n        # let it mature, then try to spend it.\n        self.log.info(\"Testing non-witness transaction\")\n        block = self.build_next_block(nVersion=1)\n        block.solve()\n        self.test_node.send_message(msg_block(block))\n        self.test_node.sync_with_ping() # make sure the block was processed\n        txid = block.vtx[0].sha256\n\n        self.nodes[0].generate(99) # let the block mature\n\n        # Create a transaction that spends the coinbase\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(txid, 0), b\"\"))\n        tx.vout.append(CTxOut(49 * 100000000, CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])))\n        tx.calc_sha256()\n\n        # Check that serializing it with or without witness is the same\n        # This is a sanity check of our testing framework.\n        assert_equal(msg_tx(tx).serialize(), msg_witness_tx(tx).serialize())\n\n        self.test_node.send_message(msg_witness_tx(tx))\n        self.test_node.sync_with_ping() # make sure the tx was processed\n        assert(tx.hash in self.nodes[0].getrawmempool())\n        # Save this transaction for later\n        self.utxo.append(UTXO(tx.sha256, 0, 49*100000000))\n        self.nodes[0].generate(1)\n\n\n    # Verify that blocks with witnesses are rejected before activation.\n    def test_unnecessary_witness_before_segwit_activation(self):\n        self.log.info(\"Testing behavior of unnecessary witnesses\")\n        # For now, rely on earlier tests to have created at least one utxo for\n        # us to use\n        assert(len(self.utxo) > 0)\n        assert(get_bip9_status(self.nodes[0], 'segwit')['status'] != 'active')\n\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n        tx.vout.append(CTxOut(self.utxo[0].nValue-1000, CScript([OP_TRUE])))\n        tx.wit.vtxinwit.append(CTxInWitness())\n        tx.wit.vtxinwit[0].scriptWitness.stack = [CScript([CScriptNum(1)])]\n\n        # Verify the hash with witness differs from the txid\n        # (otherwise our testing framework must be broken!)\n        tx.rehash()\n        assert(tx.sha256 != tx.calc_sha256(with_witness=True))\n\n        # Construct a segwit-signaling block that includes the transaction.\n        block = self.build_next_block(nVersion=(VB_TOP_BITS|(1 << VB_WITNESS_BIT)))\n        self.update_witness_block_with_transactions(block, [tx])\n        # Sending witness data before activation is not allowed (anti-spam\n        # rule).\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n        # TODO: fix synchronization so we can test reject reason\n        # Right now, bitcoind delays sending reject messages for blocks\n        # until the future, making synchronization here difficult.\n        #assert_equal(self.test_node.last_message[\"reject\"].reason, \"unexpected-witness\")\n\n        # But it should not be permanently marked bad...\n        # Resend without witness information.\n        self.test_node.send_message(msg_block(block))\n        self.test_node.sync_with_ping()\n        assert_equal(self.nodes[0].getbestblockhash(), block.hash)\n\n        sync_blocks(self.nodes)\n\n        # Create a p2sh output -- this is so we can pass the standardness\n        # rules (an anyone-can-spend OP_TRUE would be rejected, if not wrapped\n        # in P2SH).\n        p2sh_program = CScript([OP_TRUE])\n        p2sh_pubkey = hash160(p2sh_program)\n        scriptPubKey = CScript([OP_HASH160, p2sh_pubkey, OP_EQUAL])\n\n        # Now check that unnecessary witnesses can't be used to blind a node\n        # to a transaction, eg by violating standardness checks.\n        tx2 = CTransaction()\n        tx2.vin.append(CTxIn(COutPoint(tx.sha256, 0), b\"\"))\n        tx2.vout.append(CTxOut(tx.vout[0].nValue-1000, scriptPubKey))\n        tx2.rehash()\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx2, False, True)\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n\n        # We'll add an unnecessary witness to this transaction that would cause\n        # it to be non-standard, to test that violating policy with a witness before\n        # segwit activation doesn't blind a node to a transaction.  Transactions\n        # rejected for having a witness before segwit activation shouldn't be added\n        # to the rejection cache.\n        tx3 = CTransaction()\n        tx3.vin.append(CTxIn(COutPoint(tx2.sha256, 0), CScript([p2sh_program])))\n        tx3.vout.append(CTxOut(tx2.vout[0].nValue-1000, scriptPubKey))\n        tx3.wit.vtxinwit.append(CTxInWitness())\n        tx3.wit.vtxinwit[0].scriptWitness.stack = [b'a'*400000]\n        tx3.rehash()\n        # Note that this should be rejected for the premature witness reason,\n        # rather than a policy check, since segwit hasn't activated yet.\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, tx3, True, False, b'no-witness-yet')\n\n        # If we send without witness, it should be accepted.\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, tx3, False, True)\n\n        # Now create a new anyone-can-spend utxo for the next test.\n        tx4 = CTransaction()\n        tx4.vin.append(CTxIn(COutPoint(tx3.sha256, 0), CScript([p2sh_program])))\n        tx4.vout.append(CTxOut(tx3.vout[0].nValue - 1000, CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])))\n        tx4.rehash()\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx3, False, True)\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx4, False, True)\n\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n\n        # Update our utxo list; we spent the first entry.\n        self.utxo.pop(0)\n        self.utxo.append(UTXO(tx4.sha256, 0, tx4.vout[0].nValue))\n\n\n    # Mine enough blocks for segwit's vb state to be 'started'.\n    def advance_to_segwit_started(self):\n        height = self.nodes[0].getblockcount()\n        # Will need to rewrite the tests here if we are past the first period\n        assert(height < VB_PERIOD - 1)\n        # Genesis block is 'defined'.\n        assert_equal(get_bip9_status(self.nodes[0], 'segwit')['status'], 'defined')\n        # Advance to end of period, status should now be 'started'\n        self.nodes[0].generate(VB_PERIOD-height-1)\n        assert_equal(get_bip9_status(self.nodes[0], 'segwit')['status'], 'started')\n\n    # Mine enough blocks to lock in segwit, but don't activate.\n    # TODO: we could verify that lockin only happens at the right threshold of\n    # signalling blocks, rather than just at the right period boundary.\n    def advance_to_segwit_lockin(self):\n        height = self.nodes[0].getblockcount()\n        assert_equal(get_bip9_status(self.nodes[0], 'segwit')['status'], 'started')\n        # Advance to end of period, and verify lock-in happens at the end\n        self.nodes[0].generate(VB_PERIOD-1)\n        height = self.nodes[0].getblockcount()\n        assert((height % VB_PERIOD) == VB_PERIOD - 2)\n        assert_equal(get_bip9_status(self.nodes[0], 'segwit')['status'], 'started')\n        self.nodes[0].generate(1)\n        assert_equal(get_bip9_status(self.nodes[0], 'segwit')['status'], 'locked_in')\n\n\n    # Mine enough blocks to activate segwit.\n    # TODO: we could verify that activation only happens at the right threshold\n    # of signalling blocks, rather than just at the right period boundary.\n    def advance_to_segwit_active(self):\n        assert_equal(get_bip9_status(self.nodes[0], 'segwit')['status'], 'locked_in')\n        height = self.nodes[0].getblockcount()\n        self.nodes[0].generate(VB_PERIOD - (height%VB_PERIOD) - 2)\n        assert_equal(get_bip9_status(self.nodes[0], 'segwit')['status'], 'locked_in')\n        self.nodes[0].generate(1)\n        assert_equal(get_bip9_status(self.nodes[0], 'segwit')['status'], 'active')\n\n\n    # This test can only be run after segwit has activated\n    def test_witness_commitments(self):\n        self.log.info(\"Testing witness commitments\")\n\n        # First try a correct witness commitment.\n        block = self.build_next_block()\n        add_witness_commitment(block)\n        block.solve()\n\n        # Test the test -- witness serialization should be different\n        assert(msg_witness_block(block).serialize() != msg_block(block).serialize())\n\n        # This empty block should be valid.\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Try to tweak the nonce\n        block_2 = self.build_next_block()\n        add_witness_commitment(block_2, nonce=28)\n        block_2.solve()\n\n        # The commitment should have changed!\n        assert(block_2.vtx[0].vout[-1] != block.vtx[0].vout[-1])\n\n        # This should also be valid.\n        test_witness_block(self.nodes[0].rpc, self.test_node, block_2, accepted=True)\n\n        # Now test commitments with actual transactions\n        assert (len(self.utxo) > 0)\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n\n        # Let's construct a witness program\n        witness_program = CScript([OP_TRUE])\n        witness_hash = sha256(witness_program)\n        scriptPubKey = CScript([OP_0, witness_hash])\n        tx.vout.append(CTxOut(self.utxo[0].nValue-1000, scriptPubKey))\n        tx.rehash()\n\n        # tx2 will spend tx1, and send back to a regular anyone-can-spend address\n        tx2 = CTransaction()\n        tx2.vin.append(CTxIn(COutPoint(tx.sha256, 0), b\"\"))\n        tx2.vout.append(CTxOut(tx.vout[0].nValue-1000, witness_program))\n        tx2.wit.vtxinwit.append(CTxInWitness())\n        tx2.wit.vtxinwit[0].scriptWitness.stack = [witness_program]\n        tx2.rehash()\n\n        block_3 = self.build_next_block()\n        self.update_witness_block_with_transactions(block_3, [tx, tx2], nonce=1)\n        # Add an extra OP_RETURN output that matches the witness commitment template,\n        # even though it has extra data after the incorrect commitment.\n        # This block should fail.\n        block_3.vtx[0].vout.append(CTxOut(0, CScript([OP_RETURN, WITNESS_COMMITMENT_HEADER + ser_uint256(2), 10])))\n        block_3.vtx[0].rehash()\n        block_3.hashMerkleRoot = block_3.calc_merkle_root()\n        block_3.rehash()\n        block_3.solve()\n\n        test_witness_block(self.nodes[0].rpc, self.test_node, block_3, accepted=False)\n\n        # Add a different commitment with different nonce, but in the\n        # right location, and with some funds burned(!).\n        # This should succeed (nValue shouldn't affect finding the\n        # witness commitment).\n        add_witness_commitment(block_3, nonce=0)\n        block_3.vtx[0].vout[0].nValue -= 1\n        block_3.vtx[0].vout[-1].nValue += 1\n        block_3.vtx[0].rehash()\n        block_3.hashMerkleRoot = block_3.calc_merkle_root()\n        block_3.rehash()\n        assert(len(block_3.vtx[0].vout) == 4) # 3 OP_returns\n        block_3.solve()\n        test_witness_block(self.nodes[0].rpc, self.test_node, block_3, accepted=True)\n\n        # Finally test that a block with no witness transactions can\n        # omit the commitment.\n        block_4 = self.build_next_block()\n        tx3 = CTransaction()\n        tx3.vin.append(CTxIn(COutPoint(tx2.sha256, 0), b\"\"))\n        tx3.vout.append(CTxOut(tx.vout[0].nValue-1000, witness_program))\n        tx3.rehash()\n        block_4.vtx.append(tx3)\n        block_4.hashMerkleRoot = block_4.calc_merkle_root()\n        block_4.solve()\n        test_witness_block(self.nodes[0].rpc, self.test_node, block_4, with_witness=False, accepted=True)\n\n        # Update available utxo's for use in later test.\n        self.utxo.pop(0)\n        self.utxo.append(UTXO(tx3.sha256, 0, tx3.vout[0].nValue))\n\n\n    def test_block_malleability(self):\n        self.log.info(\"Testing witness block malleability\")\n\n        # Make sure that a block that has too big a virtual size\n        # because of a too-large coinbase witness is not permanently\n        # marked bad.\n        block = self.build_next_block()\n        add_witness_commitment(block)\n        block.solve()\n\n        block.vtx[0].wit.vtxinwit[0].scriptWitness.stack.append(b'a'*5000000)\n        assert(get_virtual_size(block) > MAX_BLOCK_BASE_SIZE)\n\n        # We can't send over the p2p network, because this is too big to relay\n        # TODO: repeat this test with a block that can be relayed\n        self.nodes[0].submitblock(bytes_to_hex_str(block.serialize(True)))\n\n        assert(self.nodes[0].getbestblockhash() != block.hash)\n\n        block.vtx[0].wit.vtxinwit[0].scriptWitness.stack.pop()\n        assert(get_virtual_size(block) < MAX_BLOCK_BASE_SIZE)\n        self.nodes[0].submitblock(bytes_to_hex_str(block.serialize(True)))\n\n        assert(self.nodes[0].getbestblockhash() == block.hash)\n\n        # Now make sure that malleating the witness nonce doesn't\n        # result in a block permanently marked bad.\n        block = self.build_next_block()\n        add_witness_commitment(block)\n        block.solve()\n\n        # Change the nonce -- should not cause the block to be permanently\n        # failed\n        block.vtx[0].wit.vtxinwit[0].scriptWitness.stack = [ ser_uint256(1) ]\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Changing the witness nonce doesn't change the block hash\n        block.vtx[0].wit.vtxinwit[0].scriptWitness.stack = [ ser_uint256(0) ]\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n\n    def test_witness_block_size(self):\n        self.log.info(\"Testing witness block size limit\")\n        # TODO: Test that non-witness carrying blocks can't exceed 1MB\n        # Skipping this test for now; this is covered in p2p-fullblocktest.py\n\n        # Test that witness-bearing blocks are limited at ceil(base + wit/4) <= 1MB.\n        block = self.build_next_block()\n\n        assert(len(self.utxo) > 0)\n        \n        # Create a P2WSH transaction.\n        # The witness program will be a bunch of OP_2DROP's, followed by OP_TRUE.\n        # This should give us plenty of room to tweak the spending tx's\n        # virtual size.\n        NUM_DROPS = 200 # 201 max ops per script!\n        NUM_OUTPUTS = 50\n\n        witness_program = CScript([OP_2DROP]*NUM_DROPS + [OP_TRUE])\n        witness_hash = uint256_from_str(sha256(witness_program))\n        scriptPubKey = CScript([OP_0, ser_uint256(witness_hash)])\n\n        prevout = COutPoint(self.utxo[0].sha256, self.utxo[0].n)\n        value = self.utxo[0].nValue\n\n        parent_tx = CTransaction()\n        parent_tx.vin.append(CTxIn(prevout, b\"\"))\n        child_value = int(value/NUM_OUTPUTS)\n        for i in range(NUM_OUTPUTS):\n            parent_tx.vout.append(CTxOut(child_value, scriptPubKey))\n        parent_tx.vout[0].nValue -= 50000\n        assert(parent_tx.vout[0].nValue > 0)\n        parent_tx.rehash()\n\n        child_tx = CTransaction()\n        for i in range(NUM_OUTPUTS):\n            child_tx.vin.append(CTxIn(COutPoint(parent_tx.sha256, i), b\"\"))\n        child_tx.vout = [CTxOut(value - 100000, CScript([OP_TRUE]))]\n        for i in range(NUM_OUTPUTS):\n            child_tx.wit.vtxinwit.append(CTxInWitness())\n            child_tx.wit.vtxinwit[-1].scriptWitness.stack = [b'a'*195]*(2*NUM_DROPS) + [witness_program]\n        child_tx.rehash()\n        self.update_witness_block_with_transactions(block, [parent_tx, child_tx])\n\n        vsize = get_virtual_size(block)\n        additional_bytes = (MAX_BLOCK_BASE_SIZE - vsize)*4\n        i = 0\n        while additional_bytes > 0:\n            # Add some more bytes to each input until we hit MAX_BLOCK_BASE_SIZE+1\n            extra_bytes = min(additional_bytes+1, 55)\n            block.vtx[-1].wit.vtxinwit[int(i/(2*NUM_DROPS))].scriptWitness.stack[i%(2*NUM_DROPS)] = b'a'*(195+extra_bytes)\n            additional_bytes -= extra_bytes\n            i += 1\n\n        block.vtx[0].vout.pop()  # Remove old commitment\n        add_witness_commitment(block)\n        block.solve()\n        vsize = get_virtual_size(block)\n        assert_equal(vsize, MAX_BLOCK_BASE_SIZE + 1)\n        # Make sure that our test case would exceed the old max-network-message\n        # limit\n        assert(len(block.serialize(True)) > 2*1024*1024)\n\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Now resize the second transaction to make the block fit.\n        cur_length = len(block.vtx[-1].wit.vtxinwit[0].scriptWitness.stack[0])\n        block.vtx[-1].wit.vtxinwit[0].scriptWitness.stack[0] = b'a'*(cur_length-1)\n        block.vtx[0].vout.pop()\n        add_witness_commitment(block)\n        block.solve()\n        assert(get_virtual_size(block) == MAX_BLOCK_BASE_SIZE)\n\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Update available utxo's\n        self.utxo.pop(0)\n        self.utxo.append(UTXO(block.vtx[-1].sha256, 0, block.vtx[-1].vout[0].nValue))\n\n\n    # submitblock will try to add the nonce automatically, so that mining\n    # software doesn't need to worry about doing so itself.\n    def test_submit_block(self):\n        block = self.build_next_block()\n\n        # Try using a custom nonce and then don't supply it.\n        # This shouldn't possibly work.\n        add_witness_commitment(block, nonce=1)\n        block.vtx[0].wit = CTxWitness() # drop the nonce\n        block.solve()\n        self.nodes[0].submitblock(bytes_to_hex_str(block.serialize(True)))\n        assert(self.nodes[0].getbestblockhash() != block.hash)\n\n        # Now redo commitment with the standard nonce, but let bitcoind fill it in.\n        add_witness_commitment(block, nonce=0)\n        block.vtx[0].wit = CTxWitness()\n        block.solve()\n        self.nodes[0].submitblock(bytes_to_hex_str(block.serialize(True)))\n        assert_equal(self.nodes[0].getbestblockhash(), block.hash)\n\n        # This time, add a tx with non-empty witness, but don't supply\n        # the commitment.\n        block_2 = self.build_next_block()\n\n        add_witness_commitment(block_2)\n\n        block_2.solve()\n\n        # Drop commitment and nonce -- submitblock should not fill in.\n        block_2.vtx[0].vout.pop()\n        block_2.vtx[0].wit = CTxWitness()\n\n        self.nodes[0].submitblock(bytes_to_hex_str(block_2.serialize(True)))\n        # Tip should not advance!\n        assert(self.nodes[0].getbestblockhash() != block_2.hash)\n\n\n    # Consensus tests of extra witness data in a transaction.\n    def test_extra_witness_data(self):\n        self.log.info(\"Testing extra witness data in tx\")\n\n        assert(len(self.utxo) > 0)\n        \n        block = self.build_next_block()\n\n        witness_program = CScript([OP_DROP, OP_TRUE])\n        witness_hash = sha256(witness_program)\n        scriptPubKey = CScript([OP_0, witness_hash])\n\n        # First try extra witness data on a tx that doesn't require a witness\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n        tx.vout.append(CTxOut(self.utxo[0].nValue-2000, scriptPubKey))\n        tx.vout.append(CTxOut(1000, CScript([OP_TRUE]))) # non-witness output\n        tx.wit.vtxinwit.append(CTxInWitness())\n        tx.wit.vtxinwit[0].scriptWitness.stack = [CScript([])]\n        tx.rehash()\n        self.update_witness_block_with_transactions(block, [tx])\n\n        # Extra witness data should not be allowed.\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Try extra signature data.  Ok if we're not spending a witness output.\n        block.vtx[1].wit.vtxinwit = []\n        block.vtx[1].vin[0].scriptSig = CScript([OP_0])\n        block.vtx[1].rehash()\n        add_witness_commitment(block)\n        block.solve()\n\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Now try extra witness/signature data on an input that DOES require a\n        # witness\n        tx2 = CTransaction()\n        tx2.vin.append(CTxIn(COutPoint(tx.sha256, 0), b\"\")) # witness output\n        tx2.vin.append(CTxIn(COutPoint(tx.sha256, 1), b\"\")) # non-witness\n        tx2.vout.append(CTxOut(tx.vout[0].nValue, CScript([OP_TRUE])))\n        tx2.wit.vtxinwit.extend([CTxInWitness(), CTxInWitness()])\n        tx2.wit.vtxinwit[0].scriptWitness.stack = [ CScript([CScriptNum(1)]), CScript([CScriptNum(1)]), witness_program ]\n        tx2.wit.vtxinwit[1].scriptWitness.stack = [ CScript([OP_TRUE]) ]\n\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx2])\n\n        # This has extra witness data, so it should fail.\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Now get rid of the extra witness, but add extra scriptSig data\n        tx2.vin[0].scriptSig = CScript([OP_TRUE])\n        tx2.vin[1].scriptSig = CScript([OP_TRUE])\n        tx2.wit.vtxinwit[0].scriptWitness.stack.pop(0)\n        tx2.wit.vtxinwit[1].scriptWitness.stack = []\n        tx2.rehash()\n        add_witness_commitment(block)\n        block.solve()\n\n        # This has extra signature data for a witness input, so it should fail.\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Now get rid of the extra scriptsig on the witness input, and verify\n        # success (even with extra scriptsig data in the non-witness input)\n        tx2.vin[0].scriptSig = b\"\"\n        tx2.rehash()\n        add_witness_commitment(block)\n        block.solve()\n\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Update utxo for later tests\n        self.utxo.pop(0)\n        self.utxo.append(UTXO(tx2.sha256, 0, tx2.vout[0].nValue))\n\n\n    def test_max_witness_push_length(self):\n        ''' Should only allow up to 520 byte pushes in witness stack '''\n        self.log.info(\"Testing maximum witness push size\")\n        MAX_SCRIPT_ELEMENT_SIZE = 520\n        assert(len(self.utxo))\n\n        block = self.build_next_block()\n\n        witness_program = CScript([OP_DROP, OP_TRUE])\n        witness_hash = sha256(witness_program)\n        scriptPubKey = CScript([OP_0, witness_hash])\n\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n        tx.vout.append(CTxOut(self.utxo[0].nValue-1000, scriptPubKey))\n        tx.rehash()\n\n        tx2 = CTransaction()\n        tx2.vin.append(CTxIn(COutPoint(tx.sha256, 0), b\"\"))\n        tx2.vout.append(CTxOut(tx.vout[0].nValue-1000, CScript([OP_TRUE])))\n        tx2.wit.vtxinwit.append(CTxInWitness())\n        # First try a 521-byte stack element\n        tx2.wit.vtxinwit[0].scriptWitness.stack = [ b'a'*(MAX_SCRIPT_ELEMENT_SIZE+1), witness_program ]\n        tx2.rehash()\n\n        self.update_witness_block_with_transactions(block, [tx, tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Now reduce the length of the stack element\n        tx2.wit.vtxinwit[0].scriptWitness.stack[0] = b'a'*(MAX_SCRIPT_ELEMENT_SIZE)\n\n        add_witness_commitment(block)\n        block.solve()\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Update the utxo for later tests\n        self.utxo.pop()\n        self.utxo.append(UTXO(tx2.sha256, 0, tx2.vout[0].nValue))\n\n    def test_max_witness_program_length(self):\n        # Can create witness outputs that are long, but can't be greater than\n        # 10k bytes to successfully spend\n        self.log.info(\"Testing maximum witness program length\")\n        assert(len(self.utxo))\n        MAX_PROGRAM_LENGTH = 10000\n\n        # This program is 19 max pushes (9937 bytes), then 64 more opcode-bytes.\n        long_witness_program = CScript([b'a'*520]*19 + [OP_DROP]*63 + [OP_TRUE])\n        assert(len(long_witness_program) == MAX_PROGRAM_LENGTH+1)\n        long_witness_hash = sha256(long_witness_program)\n        long_scriptPubKey = CScript([OP_0, long_witness_hash])\n\n        block = self.build_next_block()\n\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n        tx.vout.append(CTxOut(self.utxo[0].nValue-1000, long_scriptPubKey))\n        tx.rehash()\n\n        tx2 = CTransaction()\n        tx2.vin.append(CTxIn(COutPoint(tx.sha256, 0), b\"\"))\n        tx2.vout.append(CTxOut(tx.vout[0].nValue-1000, CScript([OP_TRUE])))\n        tx2.wit.vtxinwit.append(CTxInWitness())\n        tx2.wit.vtxinwit[0].scriptWitness.stack = [b'a']*44 + [long_witness_program]\n        tx2.rehash()\n\n        self.update_witness_block_with_transactions(block, [tx, tx2])\n\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Try again with one less byte in the witness program\n        witness_program = CScript([b'a'*520]*19 + [OP_DROP]*62 + [OP_TRUE])\n        assert(len(witness_program) == MAX_PROGRAM_LENGTH)\n        witness_hash = sha256(witness_program)\n        scriptPubKey = CScript([OP_0, witness_hash])\n\n        tx.vout[0] = CTxOut(tx.vout[0].nValue, scriptPubKey)\n        tx.rehash()\n        tx2.vin[0].prevout.hash = tx.sha256\n        tx2.wit.vtxinwit[0].scriptWitness.stack = [b'a']*43 + [witness_program]\n        tx2.rehash()\n        block.vtx = [block.vtx[0]]\n        self.update_witness_block_with_transactions(block, [tx, tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        self.utxo.pop()\n        self.utxo.append(UTXO(tx2.sha256, 0, tx2.vout[0].nValue))\n\n\n    def test_witness_input_length(self):\n        ''' Ensure that vin length must match vtxinwit length '''\n        self.log.info(\"Testing witness input length\")\n        assert(len(self.utxo))\n\n        witness_program = CScript([OP_DROP, OP_TRUE])\n        witness_hash = sha256(witness_program)\n        scriptPubKey = CScript([OP_0, witness_hash])\n        \n        # Create a transaction that splits our utxo into many outputs\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n        nValue = self.utxo[0].nValue\n        for i in range(10):\n            tx.vout.append(CTxOut(int(nValue/10), scriptPubKey))\n        tx.vout[0].nValue -= 1000\n        assert(tx.vout[0].nValue >= 0)\n\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Try various ways to spend tx that should all break.\n        # This \"broken\" transaction serializer will not normalize\n        # the length of vtxinwit.\n        class BrokenCTransaction(CTransaction):\n            def serialize_with_witness(self):\n                flags = 0\n                if not self.wit.is_null():\n                    flags |= 1\n                r = b\"\"\n                r += struct.pack(\"<i\", self.nVersion)\n                if flags:\n                    dummy = []\n                    r += ser_vector(dummy)\n                    r += struct.pack(\"<B\", flags)\n                r += ser_vector(self.vin)\n                r += ser_vector(self.vout)\n                if flags & 1:\n                    r += self.wit.serialize()\n                r += struct.pack(\"<I\", self.nLockTime)\n                return r\n\n        tx2 = BrokenCTransaction()\n        for i in range(10):\n            tx2.vin.append(CTxIn(COutPoint(tx.sha256, i), b\"\"))\n        tx2.vout.append(CTxOut(nValue-3000, CScript([OP_TRUE])))\n\n        # First try using a too long vtxinwit\n        for i in range(11):\n            tx2.wit.vtxinwit.append(CTxInWitness())\n            tx2.wit.vtxinwit[i].scriptWitness.stack = [b'a', witness_program]\n\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Now try using a too short vtxinwit\n        tx2.wit.vtxinwit.pop()\n        tx2.wit.vtxinwit.pop()\n\n        block.vtx = [block.vtx[0]]\n        self.update_witness_block_with_transactions(block, [tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Now make one of the intermediate witnesses be incorrect\n        tx2.wit.vtxinwit.append(CTxInWitness())\n        tx2.wit.vtxinwit[-1].scriptWitness.stack = [b'a', witness_program]\n        tx2.wit.vtxinwit[5].scriptWitness.stack = [ witness_program ]\n\n        block.vtx = [block.vtx[0]]\n        self.update_witness_block_with_transactions(block, [tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Fix the broken witness and the block should be accepted.\n        tx2.wit.vtxinwit[5].scriptWitness.stack = [b'a', witness_program]\n        block.vtx = [block.vtx[0]]\n        self.update_witness_block_with_transactions(block, [tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        self.utxo.pop()\n        self.utxo.append(UTXO(tx2.sha256, 0, tx2.vout[0].nValue))\n\n\n    def test_witness_tx_relay_before_segwit_activation(self):\n        self.log.info(\"Testing relay of witness transactions\")\n        # Generate a transaction that doesn't require a witness, but send it\n        # with a witness.  Should be rejected for premature-witness, but should\n        # not be added to recently rejected list.\n        assert(len(self.utxo))\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n        tx.vout.append(CTxOut(self.utxo[0].nValue - 1000, CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])))\n        tx.wit.vtxinwit.append(CTxInWitness())\n        tx.wit.vtxinwit[0].scriptWitness.stack = [ b'a' ]\n        tx.rehash()\n\n        tx_hash = tx.sha256\n        tx_value = tx.vout[0].nValue\n\n        # Verify that if a peer doesn't set nServices to include NODE_WITNESS,\n        # the getdata is just for the non-witness portion.\n        self.old_node.announce_tx_and_wait_for_getdata(tx)\n        assert(self.old_node.last_message[\"getdata\"].inv[0].type == 1)\n\n        # Since we haven't delivered the tx yet, inv'ing the same tx from\n        # a witness transaction ought not result in a getdata.\n        try:\n            self.test_node.announce_tx_and_wait_for_getdata(tx, timeout=2)\n            self.log.error(\"Error: duplicate tx getdata!\")\n            assert(False)\n        except AssertionError as e:\n            pass\n\n        # Delivering this transaction with witness should fail (no matter who\n        # its from)\n        assert_equal(len(self.nodes[0].getrawmempool()), 0)\n        assert_equal(len(self.nodes[1].getrawmempool()), 0)\n        test_transaction_acceptance(self.nodes[0].rpc, self.old_node, tx, with_witness=True, accepted=False)\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx, with_witness=True, accepted=False)\n\n        # But eliminating the witness should fix it\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx, with_witness=False, accepted=True)\n\n        # Cleanup: mine the first transaction and update utxo\n        self.nodes[0].generate(1)\n        assert_equal(len(self.nodes[0].getrawmempool()),  0)\n\n        self.utxo.pop(0)\n        self.utxo.append(UTXO(tx_hash, 0, tx_value))\n\n\n    # After segwit activates, verify that mempool:\n    # - rejects transactions with unnecessary/extra witnesses\n    # - accepts transactions with valid witnesses\n    # and that witness transactions are relayed to non-upgraded peers.\n    def test_tx_relay_after_segwit_activation(self):\n        self.log.info(\"Testing relay of witness transactions\")\n        # Generate a transaction that doesn't require a witness, but send it\n        # with a witness.  Should be rejected because we can't use a witness\n        # when spending a non-witness output.\n        assert(len(self.utxo))\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n        tx.vout.append(CTxOut(self.utxo[0].nValue - 1000, CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE])))\n        tx.wit.vtxinwit.append(CTxInWitness())\n        tx.wit.vtxinwit[0].scriptWitness.stack = [ b'a' ]\n        tx.rehash()\n\n        tx_hash = tx.sha256\n\n        # Verify that unnecessary witnesses are rejected.\n        self.test_node.announce_tx_and_wait_for_getdata(tx)\n        assert_equal(len(self.nodes[0].getrawmempool()), 0)\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx, with_witness=True, accepted=False)\n\n        # Verify that removing the witness succeeds.\n        self.test_node.announce_tx_and_wait_for_getdata(tx)\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx, with_witness=False, accepted=True)\n\n        # Now try to add extra witness data to a valid witness tx.\n        witness_program = CScript([OP_TRUE])\n        witness_hash = sha256(witness_program)\n        scriptPubKey = CScript([OP_0, witness_hash])\n        tx2 = CTransaction()\n        tx2.vin.append(CTxIn(COutPoint(tx_hash, 0), b\"\"))\n        tx2.vout.append(CTxOut(tx.vout[0].nValue-1000, scriptPubKey))\n        tx2.rehash()\n\n        tx3 = CTransaction()\n        tx3.vin.append(CTxIn(COutPoint(tx2.sha256, 0), b\"\"))\n        tx3.wit.vtxinwit.append(CTxInWitness())\n\n        # Add too-large for IsStandard witness and check that it does not enter reject filter\n        p2sh_program = CScript([OP_TRUE])\n        p2sh_pubkey = hash160(p2sh_program)\n        witness_program2 = CScript([b'a'*400000])\n        tx3.vout.append(CTxOut(tx2.vout[0].nValue-1000, CScript([OP_HASH160, p2sh_pubkey, OP_EQUAL])))\n        tx3.wit.vtxinwit[0].scriptWitness.stack = [witness_program2]\n        tx3.rehash()\n\n        # Node will not be blinded to the transaction\n        self.std_node.announce_tx_and_wait_for_getdata(tx3)\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, tx3, True, False, b'tx-size')\n        self.std_node.announce_tx_and_wait_for_getdata(tx3)\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, tx3, True, False, b'tx-size')\n\n        # Remove witness stuffing, instead add extra witness push on stack\n        tx3.vout[0] = CTxOut(tx2.vout[0].nValue - 1000, CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE]))\n        tx3.wit.vtxinwit[0].scriptWitness.stack = [CScript([CScriptNum(1)]), witness_program ]\n        tx3.rehash()\n\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx2, with_witness=True, accepted=True)\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx3, with_witness=True, accepted=False)\n\n        # Get rid of the extra witness, and verify acceptance.\n        tx3.wit.vtxinwit[0].scriptWitness.stack = [ witness_program ]\n        # Also check that old_node gets a tx announcement, even though this is\n        # a witness transaction.\n        self.old_node.wait_for_inv([CInv(1, tx2.sha256)]) # wait until tx2 was inv'ed\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx3, with_witness=True, accepted=True)\n        self.old_node.wait_for_inv([CInv(1, tx3.sha256)])\n\n        # Test that getrawtransaction returns correct witness information\n        # hash, size, vsize\n        raw_tx = self.nodes[0].getrawtransaction(tx3.hash, 1)\n        assert_equal(int(raw_tx[\"hash\"], 16), tx3.calc_sha256(True))\n        assert_equal(raw_tx[\"size\"], len(tx3.serialize_with_witness()))\n        vsize = (len(tx3.serialize_with_witness()) + 3*len(tx3.serialize_without_witness()) + 3) / 4\n        assert_equal(raw_tx[\"vsize\"], vsize)\n        assert_equal(len(raw_tx[\"vin\"][0][\"txinwitness\"]), 1)\n        assert_equal(raw_tx[\"vin\"][0][\"txinwitness\"][0], hexlify(witness_program).decode('ascii'))\n        assert(vsize != raw_tx[\"size\"])\n\n        # Cleanup: mine the transactions and update utxo for next test\n        self.nodes[0].generate(1)\n        assert_equal(len(self.nodes[0].getrawmempool()),  0)\n\n        self.utxo.pop(0)\n        self.utxo.append(UTXO(tx3.sha256, 0, tx3.vout[0].nValue))\n\n\n    # Test that block requests to NODE_WITNESS peer are with MSG_WITNESS_FLAG\n    # This is true regardless of segwit activation.\n    # Also test that we don't ask for blocks from unupgraded peers\n    def test_block_relay(self, segwit_activated):\n        self.log.info(\"Testing block relay\")\n\n        blocktype = 2|MSG_WITNESS_FLAG\n\n        # test_node has set NODE_WITNESS, so all getdata requests should be for\n        # witness blocks.\n        # Test announcing a block via inv results in a getdata, and that\n        # announcing a version 4 or random VB block with a header results in a getdata\n        block1 = self.build_next_block()\n        block1.solve()\n\n        self.test_node.announce_block_and_wait_for_getdata(block1, use_header=False)\n        assert(self.test_node.last_message[\"getdata\"].inv[0].type == blocktype)\n        test_witness_block(self.nodes[0].rpc, self.test_node, block1, True)\n\n        block2 = self.build_next_block(nVersion=4)\n        block2.solve()\n\n        self.test_node.announce_block_and_wait_for_getdata(block2, use_header=True)\n        assert(self.test_node.last_message[\"getdata\"].inv[0].type == blocktype)\n        test_witness_block(self.nodes[0].rpc, self.test_node, block2, True)\n\n        block3 = self.build_next_block(nVersion=(VB_TOP_BITS | (1<<15)))\n        block3.solve()\n        self.test_node.announce_block_and_wait_for_getdata(block3, use_header=True)\n        assert(self.test_node.last_message[\"getdata\"].inv[0].type == blocktype)\n        test_witness_block(self.nodes[0].rpc, self.test_node, block3, True)\n\n        # Check that we can getdata for witness blocks or regular blocks,\n        # and the right thing happens.\n        if segwit_activated == False:\n            # Before activation, we should be able to request old blocks with\n            # or without witness, and they should be the same.\n            chain_height = self.nodes[0].getblockcount()\n            # Pick 10 random blocks on main chain, and verify that getdata's\n            # for MSG_BLOCK, MSG_WITNESS_BLOCK, and rpc getblock() are equal.\n            all_heights = list(range(chain_height+1))\n            random.shuffle(all_heights)\n            all_heights = all_heights[0:10]\n            for height in all_heights:\n                block_hash = self.nodes[0].getblockhash(height)\n                rpc_block = self.nodes[0].getblock(block_hash, False)\n                block_hash = int(block_hash, 16)\n                block = self.test_node.request_block(block_hash, 2)\n                wit_block = self.test_node.request_block(block_hash, 2|MSG_WITNESS_FLAG)\n                assert_equal(block.serialize(True), wit_block.serialize(True))\n                assert_equal(block.serialize(), hex_str_to_bytes(rpc_block))\n        else:\n            # After activation, witness blocks and non-witness blocks should\n            # be different.  Verify rpc getblock() returns witness blocks, while\n            # getdata respects the requested type.\n            block = self.build_next_block()\n            self.update_witness_block_with_transactions(block, [])\n            # This gives us a witness commitment.\n            assert(len(block.vtx[0].wit.vtxinwit) == 1)\n            assert(len(block.vtx[0].wit.vtxinwit[0].scriptWitness.stack) == 1)\n            test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n            # Now try to retrieve it...\n            rpc_block = self.nodes[0].getblock(block.hash, False)\n            non_wit_block = self.test_node.request_block(block.sha256, 2)\n            wit_block = self.test_node.request_block(block.sha256, 2|MSG_WITNESS_FLAG)\n            assert_equal(wit_block.serialize(True), hex_str_to_bytes(rpc_block))\n            assert_equal(wit_block.serialize(False), non_wit_block.serialize())\n            assert_equal(wit_block.serialize(True), block.serialize(True))\n\n            # Test size, vsize, weight\n            rpc_details = self.nodes[0].getblock(block.hash, True)\n            assert_equal(rpc_details[\"size\"], len(block.serialize(True)))\n            assert_equal(rpc_details[\"strippedsize\"], len(block.serialize(False)))\n            weight = 3*len(block.serialize(False)) + len(block.serialize(True))\n            assert_equal(rpc_details[\"weight\"], weight)\n\n            # Upgraded node should not ask for blocks from unupgraded\n            block4 = self.build_next_block(nVersion=4)\n            block4.solve()\n            self.old_node.getdataset = set()\n\n            # Blocks can be requested via direct-fetch (immediately upon processing the announcement)\n            # or via parallel download (with an indeterminate delay from processing the announcement)\n            # so to test that a block is NOT requested, we could guess a time period to sleep for,\n            # and then check. We can avoid the sleep() by taking advantage of transaction getdata's\n            # being processed after block getdata's, and announce a transaction as well,\n            # and then check to see if that particular getdata has been received.\n            # Since 0.14, inv's will only be responded to with a getheaders, so send a header\n            # to announce this block.\n            msg = msg_headers()\n            msg.headers = [ CBlockHeader(block4) ]\n            self.old_node.send_message(msg)\n            self.old_node.announce_tx_and_wait_for_getdata(block4.vtx[0])\n            assert(block4.sha256 not in self.old_node.getdataset)\n\n    # V0 segwit outputs should be standard after activation, but not before.\n    def test_standardness_v0(self, segwit_activated):\n        self.log.info(\"Testing standardness of v0 outputs (%s activation)\" % (\"after\" if segwit_activated else \"before\"))\n        assert(len(self.utxo))\n\n        witness_program = CScript([OP_TRUE])\n        witness_hash = sha256(witness_program)\n        scriptPubKey = CScript([OP_0, witness_hash])\n\n        p2sh_pubkey = hash160(witness_program)\n        p2sh_scriptPubKey = CScript([OP_HASH160, p2sh_pubkey, OP_EQUAL])\n\n        # First prepare a p2sh output (so that spending it will pass standardness)\n        p2sh_tx = CTransaction()\n        p2sh_tx.vin = [CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\")]\n        p2sh_tx.vout = [CTxOut(self.utxo[0].nValue-1000, p2sh_scriptPubKey)]\n        p2sh_tx.rehash()\n\n        # Mine it on test_node to create the confirmed output.\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, p2sh_tx, with_witness=True, accepted=True)\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n\n        # Now test standardness of v0 P2WSH outputs.\n        # Start by creating a transaction with two outputs.\n        tx = CTransaction()\n        tx.vin = [CTxIn(COutPoint(p2sh_tx.sha256, 0), CScript([witness_program]))]\n        tx.vout = [CTxOut(p2sh_tx.vout[0].nValue-10000, scriptPubKey)]\n        tx.vout.append(CTxOut(8000, scriptPubKey)) # Might burn this later\n        tx.rehash()\n\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, tx, with_witness=True, accepted=segwit_activated)\n\n        # Now create something that looks like a P2PKH output. This won't be spendable.\n        scriptPubKey = CScript([OP_0, hash160(witness_hash)])\n        tx2 = CTransaction()\n        if segwit_activated:\n            # if tx was accepted, then we spend the second output.\n            tx2.vin = [CTxIn(COutPoint(tx.sha256, 1), b\"\")]\n            tx2.vout = [CTxOut(7000, scriptPubKey)]\n            tx2.wit.vtxinwit.append(CTxInWitness())\n            tx2.wit.vtxinwit[0].scriptWitness.stack = [witness_program]\n        else:\n            # if tx wasn't accepted, we just re-spend the p2sh output we started with.\n            tx2.vin = [CTxIn(COutPoint(p2sh_tx.sha256, 0), CScript([witness_program]))]\n            tx2.vout = [CTxOut(p2sh_tx.vout[0].nValue-1000, scriptPubKey)]\n        tx2.rehash()\n\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, tx2, with_witness=True, accepted=segwit_activated)\n\n        # Now update self.utxo for later tests.\n        tx3 = CTransaction()\n        if segwit_activated:\n            # tx and tx2 were both accepted.  Don't bother trying to reclaim the\n            # P2PKH output; just send tx's first output back to an anyone-can-spend.\n            sync_mempools([self.nodes[0], self.nodes[1]])\n            tx3.vin = [CTxIn(COutPoint(tx.sha256, 0), b\"\")]\n            tx3.vout = [CTxOut(tx.vout[0].nValue - 1000, CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE]))]\n            tx3.wit.vtxinwit.append(CTxInWitness())\n            tx3.wit.vtxinwit[0].scriptWitness.stack = [witness_program]\n            tx3.rehash()\n            test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx3, with_witness=True, accepted=True)\n        else:\n            # tx and tx2 didn't go anywhere; just clean up the p2sh_tx output.\n            tx3.vin = [CTxIn(COutPoint(p2sh_tx.sha256, 0), CScript([witness_program]))]\n            tx3.vout = [CTxOut(p2sh_tx.vout[0].nValue - 1000, CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE]))]\n            tx3.rehash()\n            test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx3, with_witness=True, accepted=True)\n\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n        self.utxo.pop(0)\n        self.utxo.append(UTXO(tx3.sha256, 0, tx3.vout[0].nValue))\n        assert_equal(len(self.nodes[1].getrawmempool()), 0)\n\n\n    # Verify that future segwit upgraded transactions are non-standard,\n    # but valid in blocks. Can run this before and after segwit activation.\n    def test_segwit_versions(self):\n        self.log.info(\"Testing standardness/consensus for segwit versions (0-16)\")\n        assert(len(self.utxo))\n        NUM_TESTS = 17 # will test OP_0, OP1, ..., OP_16\n        if (len(self.utxo) < NUM_TESTS):\n            tx = CTransaction()\n            tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n            split_value = (self.utxo[0].nValue - 4000) // NUM_TESTS\n            for i in range(NUM_TESTS):\n                tx.vout.append(CTxOut(split_value, CScript([OP_TRUE])))\n            tx.rehash()\n            block = self.build_next_block()\n            self.update_witness_block_with_transactions(block, [tx])\n            test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n            self.utxo.pop(0)\n            for i in range(NUM_TESTS):\n                self.utxo.append(UTXO(tx.sha256, i, split_value))\n\n        sync_blocks(self.nodes)\n        temp_utxo = []\n        tx = CTransaction()\n        count = 0\n        witness_program = CScript([OP_TRUE])\n        witness_hash = sha256(witness_program)\n        assert_equal(len(self.nodes[1].getrawmempool()), 0)\n        for version in list(range(OP_1, OP_16+1)) + [OP_0]:\n            count += 1\n            # First try to spend to a future version segwit scriptPubKey.\n            scriptPubKey = CScript([CScriptOp(version), witness_hash])\n            tx.vin = [CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\")]\n            tx.vout = [CTxOut(self.utxo[0].nValue-1000, scriptPubKey)]\n            tx.rehash()\n            test_transaction_acceptance(self.nodes[1].rpc, self.std_node, tx, with_witness=True, accepted=False)\n            test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx, with_witness=True, accepted=True)\n            self.utxo.pop(0)\n            temp_utxo.append(UTXO(tx.sha256, 0, tx.vout[0].nValue))\n\n        self.nodes[0].generate(1) # Mine all the transactions\n        sync_blocks(self.nodes)\n        assert(len(self.nodes[0].getrawmempool()) == 0)\n\n        # Finally, verify that version 0 -> version 1 transactions\n        # are non-standard\n        scriptPubKey = CScript([CScriptOp(OP_1), witness_hash])\n        tx2 = CTransaction()\n        tx2.vin = [CTxIn(COutPoint(tx.sha256, 0), b\"\")]\n        tx2.vout = [CTxOut(tx.vout[0].nValue-1000, scriptPubKey)]\n        tx2.wit.vtxinwit.append(CTxInWitness())\n        tx2.wit.vtxinwit[0].scriptWitness.stack = [ witness_program ]\n        tx2.rehash()\n        # Gets accepted to test_node, because standardness of outputs isn't\n        # checked with fRequireStandard\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx2, with_witness=True, accepted=True)\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, tx2, with_witness=True, accepted=False)\n        temp_utxo.pop() # last entry in temp_utxo was the output we just spent\n        temp_utxo.append(UTXO(tx2.sha256, 0, tx2.vout[0].nValue))\n\n        # Spend everything in temp_utxo back to an OP_TRUE output.\n        tx3 = CTransaction()\n        total_value = 0\n        for i in temp_utxo:\n            tx3.vin.append(CTxIn(COutPoint(i.sha256, i.n), b\"\"))\n            tx3.wit.vtxinwit.append(CTxInWitness())\n            total_value += i.nValue\n        tx3.wit.vtxinwit[-1].scriptWitness.stack = [witness_program]\n        tx3.vout.append(CTxOut(total_value - 1000, CScript([OP_TRUE])))\n        tx3.rehash()\n        # Spending a higher version witness output is not allowed by policy,\n        # even with fRequireStandard=false.\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx3, with_witness=True, accepted=False)\n        self.test_node.sync_with_ping()\n        with mininode_lock:\n            assert(b\"reserved for soft-fork upgrades\" in self.test_node.last_message[\"reject\"].reason)\n\n        # Building a block with the transaction must be valid, however.\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx2, tx3])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n        sync_blocks(self.nodes)\n\n        # Add utxo to our list\n        self.utxo.append(UTXO(tx3.sha256, 0, tx3.vout[0].nValue))\n\n\n    def test_premature_coinbase_witness_spend(self):\n        self.log.info(\"Testing premature coinbase witness spend\")\n        block = self.build_next_block()\n        # Change the output of the block to be a witness output.\n        witness_program = CScript([OP_TRUE])\n        witness_hash = sha256(witness_program)\n        scriptPubKey = CScript([OP_0, witness_hash])\n        block.vtx[0].vout[0].scriptPubKey = scriptPubKey\n        # This next line will rehash the coinbase and update the merkle\n        # root, and solve.\n        self.update_witness_block_with_transactions(block, [])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        spend_tx = CTransaction()\n        spend_tx.vin = [CTxIn(COutPoint(block.vtx[0].sha256, 0), b\"\")]\n        spend_tx.vout = [CTxOut(block.vtx[0].vout[0].nValue, witness_program)]\n        spend_tx.wit.vtxinwit.append(CTxInWitness())\n        spend_tx.wit.vtxinwit[0].scriptWitness.stack = [ witness_program ]\n        spend_tx.rehash()\n\n        # Now test a premature spend.\n        self.nodes[0].generate(98)\n        sync_blocks(self.nodes)\n        block2 = self.build_next_block()\n        self.update_witness_block_with_transactions(block2, [spend_tx])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block2, accepted=False)\n\n        # Advancing one more block should allow the spend.\n        self.nodes[0].generate(1)\n        block2 = self.build_next_block()\n        self.update_witness_block_with_transactions(block2, [spend_tx])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block2, accepted=True)\n        sync_blocks(self.nodes)\n\n\n    def test_signature_version_1(self):\n        self.log.info(\"Testing segwit signature hash version 1\")\n        key = CECKey()\n        key.set_secretbytes(b\"9\")\n        pubkey = CPubKey(key.get_pubkey())\n\n        witness_program = CScript([pubkey, CScriptOp(OP_CHECKSIG)])\n        witness_hash = sha256(witness_program)\n        scriptPubKey = CScript([OP_0, witness_hash])\n\n        # First create a witness output for use in the tests.\n        assert(len(self.utxo))\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n        tx.vout.append(CTxOut(self.utxo[0].nValue-1000, scriptPubKey))\n        tx.rehash()\n\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx, with_witness=True, accepted=True)\n        # Mine this transaction in preparation for following tests.\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n        sync_blocks(self.nodes)\n        self.utxo.pop(0)\n\n        # Test each hashtype\n        prev_utxo = UTXO(tx.sha256, 0, tx.vout[0].nValue)\n        for sigflag in [ 0, SIGHASH_ANYONECANPAY ]:\n            for hashtype in [SIGHASH_ALL, SIGHASH_NONE, SIGHASH_SINGLE]:\n                hashtype |= sigflag\n                block = self.build_next_block()\n                tx = CTransaction()\n                tx.vin.append(CTxIn(COutPoint(prev_utxo.sha256, prev_utxo.n), b\"\"))\n                tx.vout.append(CTxOut(prev_utxo.nValue - 1000, scriptPubKey))\n                tx.wit.vtxinwit.append(CTxInWitness())\n                # Too-large input value\n                sign_P2PK_witness_input(witness_program, tx, 0, hashtype, prev_utxo.nValue+1, key)\n                self.update_witness_block_with_transactions(block, [tx])\n                test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n                # Too-small input value\n                sign_P2PK_witness_input(witness_program, tx, 0, hashtype, prev_utxo.nValue-1, key)\n                block.vtx.pop() # remove last tx\n                self.update_witness_block_with_transactions(block, [tx])\n                test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n                # Now try correct value\n                sign_P2PK_witness_input(witness_program, tx, 0, hashtype, prev_utxo.nValue, key)\n                block.vtx.pop()\n                self.update_witness_block_with_transactions(block, [tx])\n                test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n                prev_utxo = UTXO(tx.sha256, 0, tx.vout[0].nValue)\n\n        # Test combinations of signature hashes.\n        # Split the utxo into a lot of outputs.\n        # Randomly choose up to 10 to spend, sign with different hashtypes, and\n        # output to a random number of outputs.  Repeat NUM_TESTS times.\n        # Ensure that we've tested a situation where we use SIGHASH_SINGLE with\n        # an input index > number of outputs.\n        NUM_TESTS = 500\n        temp_utxos = []\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(prev_utxo.sha256, prev_utxo.n), b\"\"))\n        split_value = prev_utxo.nValue // NUM_TESTS\n        for i in range(NUM_TESTS):\n            tx.vout.append(CTxOut(split_value, scriptPubKey))\n        tx.wit.vtxinwit.append(CTxInWitness())\n        sign_P2PK_witness_input(witness_program, tx, 0, SIGHASH_ALL, prev_utxo.nValue, key)\n        for i in range(NUM_TESTS):\n            temp_utxos.append(UTXO(tx.sha256, i, split_value))\n\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        block = self.build_next_block()\n        used_sighash_single_out_of_bounds = False\n        for i in range(NUM_TESTS):\n            # Ping regularly to keep the connection alive\n            if (not i % 100):\n                self.test_node.sync_with_ping()\n            # Choose random number of inputs to use.\n            num_inputs = random.randint(1, 10)\n            # Create a slight bias for producing more utxos\n            num_outputs = random.randint(1, 11)\n            random.shuffle(temp_utxos)\n            assert(len(temp_utxos) > num_inputs)\n            tx = CTransaction()\n            total_value = 0\n            for i in range(num_inputs):\n                tx.vin.append(CTxIn(COutPoint(temp_utxos[i].sha256, temp_utxos[i].n), b\"\"))\n                tx.wit.vtxinwit.append(CTxInWitness())\n                total_value += temp_utxos[i].nValue\n            split_value = total_value // num_outputs\n            for i in range(num_outputs):\n                tx.vout.append(CTxOut(split_value, scriptPubKey))\n            for i in range(num_inputs):\n                # Now try to sign each input, using a random hashtype.\n                anyonecanpay = 0\n                if random.randint(0, 1):\n                    anyonecanpay = SIGHASH_ANYONECANPAY\n                hashtype = random.randint(1, 3) | anyonecanpay\n                sign_P2PK_witness_input(witness_program, tx, i, hashtype, temp_utxos[i].nValue, key)\n                if (hashtype == SIGHASH_SINGLE and i >= num_outputs):\n                    used_sighash_single_out_of_bounds = True\n            tx.rehash()\n            for i in range(num_outputs):\n                temp_utxos.append(UTXO(tx.sha256, i, split_value))\n            temp_utxos = temp_utxos[num_inputs:]\n\n            block.vtx.append(tx)\n\n            # Test the block periodically, if we're close to maxblocksize\n            if (get_virtual_size(block) > MAX_BLOCK_BASE_SIZE - 1000):\n                self.update_witness_block_with_transactions(block, [])\n                test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n                block = self.build_next_block()\n\n        if (not used_sighash_single_out_of_bounds):\n            self.log.info(\"WARNING: this test run didn't attempt SIGHASH_SINGLE with out-of-bounds index value\")\n        # Test the transactions we've added to the block\n        if (len(block.vtx) > 1):\n            self.update_witness_block_with_transactions(block, [])\n            test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Now test witness version 0 P2PKH transactions\n        pubkeyhash = hash160(pubkey)\n        scriptPKH = CScript([OP_0, pubkeyhash])\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(temp_utxos[0].sha256, temp_utxos[0].n), b\"\"))\n        tx.vout.append(CTxOut(temp_utxos[0].nValue, scriptPKH))\n        tx.wit.vtxinwit.append(CTxInWitness())\n        sign_P2PK_witness_input(witness_program, tx, 0, SIGHASH_ALL, temp_utxos[0].nValue, key)\n        tx2 = CTransaction()\n        tx2.vin.append(CTxIn(COutPoint(tx.sha256, 0), b\"\"))\n        tx2.vout.append(CTxOut(tx.vout[0].nValue, CScript([OP_TRUE])))\n\n        script = GetP2PKHScript(pubkeyhash)\n        sig_hash = SegwitVersion1SignatureHash(script, tx2, 0, SIGHASH_ALL, tx.vout[0].nValue)\n        signature = key.sign(sig_hash) + b'\\x01' # 0x1 is SIGHASH_ALL\n\n        # Check that we can't have a scriptSig\n        tx2.vin[0].scriptSig = CScript([signature, pubkey])\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx, tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=False)\n\n        # Move the signature to the witness.\n        block.vtx.pop()\n        tx2.wit.vtxinwit.append(CTxInWitness())\n        tx2.wit.vtxinwit[0].scriptWitness.stack = [signature, pubkey]\n        tx2.vin[0].scriptSig = b\"\"\n        tx2.rehash()\n\n        self.update_witness_block_with_transactions(block, [tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        temp_utxos.pop(0)\n\n        # Update self.utxos for later tests by creating two outputs\n        # that consolidate all the coins in temp_utxos.\n        output_value = sum(i.nValue for i in temp_utxos) // 2\n\n        tx = CTransaction()\n        index = 0\n        # Just spend to our usual anyone-can-spend output\n        tx.vout = [CTxOut(output_value, CScript([OP_TRUE]))] * 2\n        for i in temp_utxos:\n            # Use SIGHASH_ALL|SIGHASH_ANYONECANPAY so we can build up\n            # the signatures as we go.\n            tx.vin.append(CTxIn(COutPoint(i.sha256, i.n), b\"\"))\n            tx.wit.vtxinwit.append(CTxInWitness())\n            sign_P2PK_witness_input(witness_program, tx, index, SIGHASH_ALL|SIGHASH_ANYONECANPAY, i.nValue, key)\n            index += 1\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        for i in range(len(tx.vout)):\n            self.utxo.append(UTXO(tx.sha256, i, tx.vout[i].nValue))\n\n\n    # Test P2SH wrapped witness programs.\n    def test_p2sh_witness(self, segwit_activated):\n        self.log.info(\"Testing P2SH witness transactions\")\n\n        assert(len(self.utxo))\n\n        # Prepare the p2sh-wrapped witness output\n        witness_program = CScript([OP_DROP, OP_TRUE])\n        witness_hash = sha256(witness_program)\n        p2wsh_pubkey = CScript([OP_0, witness_hash])\n        p2sh_witness_hash = hash160(p2wsh_pubkey)\n        scriptPubKey = CScript([OP_HASH160, p2sh_witness_hash, OP_EQUAL])\n        scriptSig = CScript([p2wsh_pubkey]) # a push of the redeem script\n\n        # Fund the P2SH output\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n        tx.vout.append(CTxOut(self.utxo[0].nValue-1000, scriptPubKey))\n        tx.rehash()\n\n        # Verify mempool acceptance and block validity\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx, with_witness=False, accepted=True)\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True, with_witness=segwit_activated)\n        sync_blocks(self.nodes)\n\n        # Now test attempts to spend the output.\n        spend_tx = CTransaction()\n        spend_tx.vin.append(CTxIn(COutPoint(tx.sha256, 0), scriptSig))\n        spend_tx.vout.append(CTxOut(tx.vout[0].nValue-1000, CScript([OP_TRUE])))\n        spend_tx.rehash()\n\n        # This transaction should not be accepted into the mempool pre- or\n        # post-segwit.  Mempool acceptance will use SCRIPT_VERIFY_WITNESS which\n        # will require a witness to spend a witness program regardless of\n        # segwit activation.  Note that older bitcoind's that are not\n        # segwit-aware would also reject this for failing CLEANSTACK.\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, spend_tx, with_witness=False, accepted=False)\n\n        # Try to put the witness script in the scriptSig, should also fail.\n        spend_tx.vin[0].scriptSig = CScript([p2wsh_pubkey, b'a'])\n        spend_tx.rehash()\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, spend_tx, with_witness=False, accepted=False)\n\n        # Now put the witness script in the witness, should succeed after\n        # segwit activates.\n        spend_tx.vin[0].scriptSig = scriptSig\n        spend_tx.rehash()\n        spend_tx.wit.vtxinwit.append(CTxInWitness())\n        spend_tx.wit.vtxinwit[0].scriptWitness.stack = [ b'a', witness_program ]\n\n        # Verify mempool acceptance\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, spend_tx, with_witness=True, accepted=segwit_activated)\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [spend_tx])\n\n        # If we're before activation, then sending this without witnesses\n        # should be valid.  If we're after activation, then sending this with\n        # witnesses should be valid.\n        if segwit_activated:\n            test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n        else:\n            test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True, with_witness=False)\n\n        # Update self.utxo\n        self.utxo.pop(0)\n        self.utxo.append(UTXO(spend_tx.sha256, 0, spend_tx.vout[0].nValue))\n\n    # Test the behavior of starting up a segwit-aware node after the softfork\n    # has activated.  As segwit requires different block data than pre-segwit\n    # nodes would have stored, this requires special handling.\n    # To enable this test, pass --oldbinary=<path-to-pre-segwit-bitcoind> to\n    # the test.\n    def test_upgrade_after_activation(self, node_id):\n        self.log.info(\"Testing software upgrade after softfork activation\")\n\n        assert(node_id != 0) # node0 is assumed to be a segwit-active bitcoind\n\n        # Make sure the nodes are all up\n        sync_blocks(self.nodes)\n\n        # Restart with the new binary\n        self.stop_node(node_id)\n        self.start_node(node_id, extra_args=[\"-vbparams=segwit:0:999999999999\"])\n        connect_nodes(self.nodes[0], node_id)\n\n        sync_blocks(self.nodes)\n\n        # Make sure that this peer thinks segwit has activated.\n        assert(get_bip9_status(self.nodes[node_id], 'segwit')['status'] == \"active\")\n\n        # Make sure this peers blocks match those of node0.\n        height = self.nodes[node_id].getblockcount()\n        while height >= 0:\n            block_hash = self.nodes[node_id].getblockhash(height)\n            assert_equal(block_hash, self.nodes[0].getblockhash(height))\n            assert_equal(self.nodes[0].getblock(block_hash), self.nodes[node_id].getblock(block_hash))\n            height -= 1\n\n\n    def test_witness_sigops(self):\n        '''Ensure sigop counting is correct inside witnesses.'''\n        self.log.info(\"Testing sigops limit\")\n\n        assert(len(self.utxo))\n\n        # Keep this under MAX_OPS_PER_SCRIPT (201)\n        witness_program = CScript([OP_TRUE, OP_IF, OP_TRUE, OP_ELSE] + [OP_CHECKMULTISIG]*5 + [OP_CHECKSIG]*193 + [OP_ENDIF])\n        witness_hash = sha256(witness_program)\n        scriptPubKey = CScript([OP_0, witness_hash])\n\n        sigops_per_script = 20*5 + 193*1\n        # We'll produce 2 extra outputs, one with a program that would take us\n        # over max sig ops, and one with a program that would exactly reach max\n        # sig ops\n        outputs = (MAX_SIGOP_COST // sigops_per_script) + 2\n        extra_sigops_available = MAX_SIGOP_COST % sigops_per_script\n\n        # We chose the number of checkmultisigs/checksigs to make this work:\n        assert(extra_sigops_available < 100) # steer clear of MAX_OPS_PER_SCRIPT\n\n        # This script, when spent with the first\n        # N(=MAX_SIGOP_COST//sigops_per_script) outputs of our transaction,\n        # would push us just over the block sigop limit.\n        witness_program_toomany = CScript([OP_TRUE, OP_IF, OP_TRUE, OP_ELSE] + [OP_CHECKSIG]*(extra_sigops_available + 1) + [OP_ENDIF])\n        witness_hash_toomany = sha256(witness_program_toomany)\n        scriptPubKey_toomany = CScript([OP_0, witness_hash_toomany])\n\n        # If we spend this script instead, we would exactly reach our sigop\n        # limit (for witness sigops).\n        witness_program_justright = CScript([OP_TRUE, OP_IF, OP_TRUE, OP_ELSE] + [OP_CHECKSIG]*(extra_sigops_available) + [OP_ENDIF])\n        witness_hash_justright = sha256(witness_program_justright)\n        scriptPubKey_justright = CScript([OP_0, witness_hash_justright])\n\n        # First split our available utxo into a bunch of outputs\n        split_value = self.utxo[0].nValue // outputs\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n        for i in range(outputs):\n            tx.vout.append(CTxOut(split_value, scriptPubKey))\n        tx.vout[-2].scriptPubKey = scriptPubKey_toomany\n        tx.vout[-1].scriptPubKey = scriptPubKey_justright\n        tx.rehash()\n\n        block_1 = self.build_next_block()\n        self.update_witness_block_with_transactions(block_1, [tx])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block_1, accepted=True)\n\n        tx2 = CTransaction()\n        # If we try to spend the first n-1 outputs from tx, that should be\n        # too many sigops.\n        total_value = 0\n        for i in range(outputs-1):\n            tx2.vin.append(CTxIn(COutPoint(tx.sha256, i), b\"\"))\n            tx2.wit.vtxinwit.append(CTxInWitness())\n            tx2.wit.vtxinwit[-1].scriptWitness.stack = [ witness_program ]\n            total_value += tx.vout[i].nValue\n        tx2.wit.vtxinwit[-1].scriptWitness.stack = [ witness_program_toomany ] \n        tx2.vout.append(CTxOut(total_value, CScript([OP_TRUE])))\n        tx2.rehash()\n\n        block_2 = self.build_next_block()\n        self.update_witness_block_with_transactions(block_2, [tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block_2, accepted=False)\n\n        # Try dropping the last input in tx2, and add an output that has\n        # too many sigops (contributing to legacy sigop count).\n        checksig_count = (extra_sigops_available // 4) + 1\n        scriptPubKey_checksigs = CScript([OP_CHECKSIG]*checksig_count)\n        tx2.vout.append(CTxOut(0, scriptPubKey_checksigs))\n        tx2.vin.pop()\n        tx2.wit.vtxinwit.pop()\n        tx2.vout[0].nValue -= tx.vout[-2].nValue\n        tx2.rehash()\n        block_3 = self.build_next_block()\n        self.update_witness_block_with_transactions(block_3, [tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block_3, accepted=False)\n\n        # If we drop the last checksig in this output, the tx should succeed.\n        block_4 = self.build_next_block()\n        tx2.vout[-1].scriptPubKey = CScript([OP_CHECKSIG]*(checksig_count-1))\n        tx2.rehash()\n        self.update_witness_block_with_transactions(block_4, [tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block_4, accepted=True)\n\n        # Reset the tip back down for the next test\n        sync_blocks(self.nodes)\n        for x in self.nodes:\n            x.invalidateblock(block_4.hash)\n\n        # Try replacing the last input of tx2 to be spending the last\n        # output of tx\n        block_5 = self.build_next_block()\n        tx2.vout.pop()\n        tx2.vin.append(CTxIn(COutPoint(tx.sha256, outputs-1), b\"\"))\n        tx2.wit.vtxinwit.append(CTxInWitness())\n        tx2.wit.vtxinwit[-1].scriptWitness.stack = [ witness_program_justright ]\n        tx2.rehash()\n        self.update_witness_block_with_transactions(block_5, [tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block_5, accepted=True)\n\n        # TODO: test p2sh sigop counting\n\n    def test_getblocktemplate_before_lockin(self):\n        self.log.info(\"Testing getblocktemplate setting of segwit versionbit (before lockin)\")\n        # Node0 is segwit aware, node2 is not.\n        for node in [self.nodes[0], self.nodes[2]]:\n            gbt_results = node.getblocktemplate()\n            block_version = gbt_results['version']\n            # If we're not indicating segwit support, we will still be\n            # signalling for segwit activation.\n            assert_equal((block_version & (1 << VB_WITNESS_BIT) != 0), node == self.nodes[0])\n            # If we don't specify the segwit rule, then we won't get a default\n            # commitment.\n            assert('default_witness_commitment' not in gbt_results)\n\n        # Workaround:\n        # Can either change the tip, or change the mempool and wait 5 seconds\n        # to trigger a recomputation of getblocktemplate.\n        txid = int(self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1), 16)\n        # Using mocktime lets us avoid sleep()\n        sync_mempools(self.nodes)\n        self.nodes[0].setmocktime(int(time.time())+10)\n        self.nodes[2].setmocktime(int(time.time())+10)\n\n        for node in [self.nodes[0], self.nodes[2]]:\n            gbt_results = node.getblocktemplate({\"rules\" : [\"segwit\"]})\n            block_version = gbt_results['version']\n            if node == self.nodes[2]:\n                # If this is a non-segwit node, we should still not get a witness\n                # commitment, nor a version bit signalling segwit.\n                assert_equal(block_version & (1 << VB_WITNESS_BIT), 0)\n                assert('default_witness_commitment' not in gbt_results)\n            else:\n                # For segwit-aware nodes, check the version bit and the witness\n                # commitment are correct.\n                assert(block_version & (1 << VB_WITNESS_BIT) != 0)\n                assert('default_witness_commitment' in gbt_results)\n                witness_commitment = gbt_results['default_witness_commitment']\n\n                # Check that default_witness_commitment is present.\n                witness_root = CBlock.get_merkle_root([ser_uint256(0),\n                                                       ser_uint256(txid)])\n                script = get_witness_script(witness_root, 0)\n                assert_equal(witness_commitment, bytes_to_hex_str(script))\n\n        # undo mocktime\n        self.nodes[0].setmocktime(0)\n        self.nodes[2].setmocktime(0)\n\n    # Uncompressed pubkeys are no longer supported in default relay policy,\n    # but (for now) are still valid in blocks.\n    def test_uncompressed_pubkey(self):\n        self.log.info(\"Testing uncompressed pubkeys\")\n        # Segwit transactions using uncompressed pubkeys are not accepted\n        # under default policy, but should still pass consensus.\n        key = CECKey()\n        key.set_secretbytes(b\"9\")\n        key.set_compressed(False)\n        pubkey = CPubKey(key.get_pubkey())\n        assert_equal(len(pubkey), 65) # This should be an uncompressed pubkey\n\n        assert(len(self.utxo) > 0)\n        utxo = self.utxo.pop(0)\n\n        # Test 1: P2WPKH\n        # First create a P2WPKH output that uses an uncompressed pubkey\n        pubkeyhash = hash160(pubkey)\n        scriptPKH = CScript([OP_0, pubkeyhash])\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(utxo.sha256, utxo.n), b\"\"))\n        tx.vout.append(CTxOut(utxo.nValue-1000, scriptPKH))\n        tx.rehash()\n\n        # Confirm it in a block.\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Now try to spend it. Send it to a P2WSH output, which we'll\n        # use in the next test.\n        witness_program = CScript([pubkey, CScriptOp(OP_CHECKSIG)])\n        witness_hash = sha256(witness_program)\n        scriptWSH = CScript([OP_0, witness_hash])\n\n        tx2 = CTransaction()\n        tx2.vin.append(CTxIn(COutPoint(tx.sha256, 0), b\"\"))\n        tx2.vout.append(CTxOut(tx.vout[0].nValue-1000, scriptWSH))\n        script = GetP2PKHScript(pubkeyhash)\n        sig_hash = SegwitVersion1SignatureHash(script, tx2, 0, SIGHASH_ALL, tx.vout[0].nValue)\n        signature = key.sign(sig_hash) + b'\\x01' # 0x1 is SIGHASH_ALL\n        tx2.wit.vtxinwit.append(CTxInWitness())\n        tx2.wit.vtxinwit[0].scriptWitness.stack = [ signature, pubkey ]\n        tx2.rehash()\n\n        # Should fail policy test.\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx2, True, False, b'non-mandatory-script-verify-flag (Using non-compressed keys in segwit)')\n        # But passes consensus.\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx2])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Test 2: P2WSH\n        # Try to spend the P2WSH output created in last test.\n        # Send it to a P2SH(P2WSH) output, which we'll use in the next test.\n        p2sh_witness_hash = hash160(scriptWSH)\n        scriptP2SH = CScript([OP_HASH160, p2sh_witness_hash, OP_EQUAL])\n        scriptSig = CScript([scriptWSH])\n\n        tx3 = CTransaction()\n        tx3.vin.append(CTxIn(COutPoint(tx2.sha256, 0), b\"\"))\n        tx3.vout.append(CTxOut(tx2.vout[0].nValue-1000, scriptP2SH))\n        tx3.wit.vtxinwit.append(CTxInWitness())\n        sign_P2PK_witness_input(witness_program, tx3, 0, SIGHASH_ALL, tx2.vout[0].nValue, key)\n\n        # Should fail policy test.\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx3, True, False, b'non-mandatory-script-verify-flag (Using non-compressed keys in segwit)')\n        # But passes consensus.\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx3])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Test 3: P2SH(P2WSH)\n        # Try to spend the P2SH output created in the last test.\n        # Send it to a P2PKH output, which we'll use in the next test.\n        scriptPubKey = GetP2PKHScript(pubkeyhash)\n        tx4 = CTransaction()\n        tx4.vin.append(CTxIn(COutPoint(tx3.sha256, 0), scriptSig))\n        tx4.vout.append(CTxOut(tx3.vout[0].nValue-1000, scriptPubKey))\n        tx4.wit.vtxinwit.append(CTxInWitness())\n        sign_P2PK_witness_input(witness_program, tx4, 0, SIGHASH_ALL, tx3.vout[0].nValue, key)\n\n        # Should fail policy test.\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx4, True, False, b'non-mandatory-script-verify-flag (Using non-compressed keys in segwit)')\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx4])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n\n        # Test 4: Uncompressed pubkeys should still be valid in non-segwit\n        # transactions.\n        tx5 = CTransaction()\n        tx5.vin.append(CTxIn(COutPoint(tx4.sha256, 0), b\"\"))\n        tx5.vout.append(CTxOut(tx4.vout[0].nValue-1000, CScript([OP_TRUE])))\n        (sig_hash, err) = SignatureHash(scriptPubKey, tx5, 0, SIGHASH_ALL)\n        signature = key.sign(sig_hash) + b'\\x01' # 0x1 is SIGHASH_ALL\n        tx5.vin[0].scriptSig = CScript([signature, pubkey])\n        tx5.rehash()\n        # Should pass policy and consensus.\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx5, True, True)\n        block = self.build_next_block()\n        self.update_witness_block_with_transactions(block, [tx5])\n        test_witness_block(self.nodes[0].rpc, self.test_node, block, accepted=True)\n        self.utxo.append(UTXO(tx5.sha256, 0, tx5.vout[0].nValue))\n\n    def test_non_standard_witness(self):\n        self.log.info(\"Testing detection of non-standard P2WSH witness\")\n        pad = chr(1).encode('latin-1')\n\n        # Create scripts for tests\n        scripts = []\n        scripts.append(CScript([OP_DROP] * 100))\n        scripts.append(CScript([OP_DROP] * 99))\n        scripts.append(CScript([pad * 59] * 59 + [OP_DROP] * 60))\n        scripts.append(CScript([pad * 59] * 59 + [OP_DROP] * 61))\n\n        p2wsh_scripts = []\n\n        assert(len(self.utxo))\n        tx = CTransaction()\n        tx.vin.append(CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b\"\"))\n\n        # For each script, generate a pair of P2WSH and P2SH-P2WSH output.\n        outputvalue = (self.utxo[0].nValue - 1000) // (len(scripts) * 2)\n        for i in scripts:\n            p2wsh = CScript([OP_0, sha256(i)])\n            p2sh = hash160(p2wsh)\n            p2wsh_scripts.append(p2wsh)\n            tx.vout.append(CTxOut(outputvalue, p2wsh))\n            tx.vout.append(CTxOut(outputvalue, CScript([OP_HASH160, p2sh, OP_EQUAL])))\n        tx.rehash()\n        txid = tx.sha256\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, tx, with_witness=False, accepted=True)\n\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n\n        # Creating transactions for tests\n        p2wsh_txs = []\n        p2sh_txs = []\n        for i in range(len(scripts)):\n            p2wsh_tx = CTransaction()\n            p2wsh_tx.vin.append(CTxIn(COutPoint(txid,i*2)))\n            p2wsh_tx.vout.append(CTxOut(outputvalue - 5000, CScript([OP_0, hash160(hex_str_to_bytes(\"\"))])))\n            p2wsh_tx.wit.vtxinwit.append(CTxInWitness())\n            p2wsh_tx.rehash()\n            p2wsh_txs.append(p2wsh_tx)\n            p2sh_tx = CTransaction()\n            p2sh_tx.vin.append(CTxIn(COutPoint(txid,i*2+1), CScript([p2wsh_scripts[i]])))\n            p2sh_tx.vout.append(CTxOut(outputvalue - 5000, CScript([OP_0, hash160(hex_str_to_bytes(\"\"))])))\n            p2sh_tx.wit.vtxinwit.append(CTxInWitness())\n            p2sh_tx.rehash()\n            p2sh_txs.append(p2sh_tx)\n\n        # Testing native P2WSH\n        # Witness stack size, excluding witnessScript, over 100 is non-standard\n        p2wsh_txs[0].wit.vtxinwit[0].scriptWitness.stack = [pad] * 101 + [scripts[0]]\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, p2wsh_txs[0], True, False, b'bad-witness-nonstandard')\n        # Non-standard nodes should accept\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, p2wsh_txs[0], True, True)\n\n        # Stack element size over 80 bytes is non-standard\n        p2wsh_txs[1].wit.vtxinwit[0].scriptWitness.stack = [pad * 81] * 100 + [scripts[1]]\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, p2wsh_txs[1], True, False, b'bad-witness-nonstandard')\n        # Non-standard nodes should accept\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, p2wsh_txs[1], True, True)\n        # Standard nodes should accept if element size is not over 80 bytes\n        p2wsh_txs[1].wit.vtxinwit[0].scriptWitness.stack = [pad * 80] * 100 + [scripts[1]]\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, p2wsh_txs[1], True, True)\n\n        # witnessScript size at 3600 bytes is standard\n        p2wsh_txs[2].wit.vtxinwit[0].scriptWitness.stack = [pad, pad, scripts[2]]\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, p2wsh_txs[2], True, True)\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, p2wsh_txs[2], True, True)\n\n        # witnessScript size at 3601 bytes is non-standard\n        p2wsh_txs[3].wit.vtxinwit[0].scriptWitness.stack = [pad, pad, pad, scripts[3]]\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, p2wsh_txs[3], True, False, b'bad-witness-nonstandard')\n        # Non-standard nodes should accept\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, p2wsh_txs[3], True, True)\n\n        # Repeating the same tests with P2SH-P2WSH\n        p2sh_txs[0].wit.vtxinwit[0].scriptWitness.stack = [pad] * 101 + [scripts[0]]\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, p2sh_txs[0], True, False, b'bad-witness-nonstandard')\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, p2sh_txs[0], True, True)\n        p2sh_txs[1].wit.vtxinwit[0].scriptWitness.stack = [pad * 81] * 100 + [scripts[1]]\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, p2sh_txs[1], True, False, b'bad-witness-nonstandard')\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, p2sh_txs[1], True, True)\n        p2sh_txs[1].wit.vtxinwit[0].scriptWitness.stack = [pad * 80] * 100 + [scripts[1]]\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, p2sh_txs[1], True, True)\n        p2sh_txs[2].wit.vtxinwit[0].scriptWitness.stack = [pad, pad, scripts[2]]\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, p2sh_txs[2], True, True)\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, p2sh_txs[2], True, True)\n        p2sh_txs[3].wit.vtxinwit[0].scriptWitness.stack = [pad, pad, pad, scripts[3]]\n        test_transaction_acceptance(self.nodes[1].rpc, self.std_node, p2sh_txs[3], True, False, b'bad-witness-nonstandard')\n        test_transaction_acceptance(self.nodes[0].rpc, self.test_node, p2sh_txs[3], True, True)\n\n        self.nodes[0].generate(1)  # Mine and clean up the mempool of non-standard node\n        # Valid but non-standard transactions in a block should be accepted by standard node\n        sync_blocks(self.nodes)\n        assert_equal(len(self.nodes[0].getrawmempool()), 0)\n        assert_equal(len(self.nodes[1].getrawmempool()), 0)\n\n        self.utxo.pop(0)\n\n\n    def run_test(self):\n        # Setup the p2p connections and start up the network thread.\n        # self.test_node sets NODE_WITNESS|NODE_NETWORK\n        self.test_node = self.nodes[0].add_p2p_connection(TestNode(), services=NODE_NETWORK|NODE_WITNESS)\n        # self.old_node sets only NODE_NETWORK\n        self.old_node = self.nodes[0].add_p2p_connection(TestNode(), services=NODE_NETWORK)\n        # self.std_node is for testing node1 (fRequireStandard=true)\n        self.std_node = self.nodes[1].add_p2p_connection(TestNode(), services=NODE_NETWORK|NODE_WITNESS)\n\n        network_thread_start()\n\n        # Keep a place to store utxo's that can be used in later tests\n        self.utxo = []\n\n        # Test logic begins here\n        self.test_node.wait_for_verack()\n\n        self.log.info(\"Starting tests before segwit lock in:\")\n\n        self.test_witness_services() # Verifies NODE_WITNESS\n        self.test_non_witness_transaction() # non-witness tx's are accepted\n        self.test_unnecessary_witness_before_segwit_activation()\n        self.test_block_relay(segwit_activated=False)\n\n        # Advance to segwit being 'started'\n        self.advance_to_segwit_started()\n        sync_blocks(self.nodes)\n        self.test_getblocktemplate_before_lockin()\n\n        sync_blocks(self.nodes)\n\n        # At lockin, nothing should change.\n        self.log.info(\"Testing behavior post lockin, pre-activation\")\n        self.advance_to_segwit_lockin()\n\n        # Retest unnecessary witnesses\n        self.test_unnecessary_witness_before_segwit_activation()\n        self.test_witness_tx_relay_before_segwit_activation()\n        self.test_block_relay(segwit_activated=False)\n        self.test_p2sh_witness(segwit_activated=False)\n        self.test_standardness_v0(segwit_activated=False)\n\n        sync_blocks(self.nodes)\n\n        # Now activate segwit\n        self.log.info(\"Testing behavior after segwit activation\")\n        self.advance_to_segwit_active()\n\n        sync_blocks(self.nodes)\n\n        # Test P2SH witness handling again\n        self.test_p2sh_witness(segwit_activated=True)\n        self.test_witness_commitments()\n        self.test_block_malleability()\n        self.test_witness_block_size()\n        self.test_submit_block()\n        self.test_extra_witness_data()\n        self.test_max_witness_push_length()\n        self.test_max_witness_program_length()\n        self.test_witness_input_length()\n        self.test_block_relay(segwit_activated=True)\n        self.test_tx_relay_after_segwit_activation()\n        self.test_standardness_v0(segwit_activated=True)\n        self.test_segwit_versions()\n        self.test_premature_coinbase_witness_spend()\n        self.test_uncompressed_pubkey()\n        self.test_signature_version_1()\n        self.test_non_standard_witness()\n        sync_blocks(self.nodes)\n        self.test_upgrade_after_activation(node_id=2)\n        self.test_witness_sigops()\n\n\nif __name__ == '__main__':\n    SegWitTest().main()\n"
  },
  {
    "path": "test/functional/p2p_sendheaders.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test behavior of headers messages to announce blocks.\n\nSetup:\n\n- Two nodes:\n    - node0 is the node-under-test. We create two p2p connections to it. The\n      first p2p connection is a control and should only ever receive inv's. The\n      second p2p connection tests the headers sending logic.\n    - node1 is used to create reorgs.\n\ntest_null_locators\n==================\n\nSends two getheaders requests with null locator values. First request's hashstop\nvalue refers to validated block, while second request's hashstop value refers to\na block which hasn't been validated. Verifies only the first request returns\nheaders.\n\ntest_nonnull_locators\n=====================\n\nPart 1: No headers announcements before \"sendheaders\"\na. node mines a block [expect: inv]\n   send getdata for the block [expect: block]\nb. node mines another block [expect: inv]\n   send getheaders and getdata [expect: headers, then block]\nc. node mines another block [expect: inv]\n   peer mines a block, announces with header [expect: getdata]\nd. node mines another block [expect: inv]\n\nPart 2: After \"sendheaders\", headers announcements should generally work.\na. peer sends sendheaders [expect: no response]\n   peer sends getheaders with current tip [expect: no response]\nb. node mines a block [expect: tip header]\nc. for N in 1, ..., 10:\n   * for announce-type in {inv, header}\n     - peer mines N blocks, announces with announce-type\n       [ expect: getheaders/getdata or getdata, deliver block(s) ]\n     - node mines a block [ expect: 1 header ]\n\nPart 3: Headers announcements stop after large reorg and resume after getheaders or inv from peer.\n- For response-type in {inv, getheaders}\n  * node mines a 7 block reorg [ expect: headers announcement of 8 blocks ]\n  * node mines an 8-block reorg [ expect: inv at tip ]\n  * peer responds with getblocks/getdata [expect: inv, blocks ]\n  * node mines another block [ expect: inv at tip, peer sends getdata, expect: block ]\n  * node mines another block at tip [ expect: inv ]\n  * peer responds with getheaders with an old hashstop more than 8 blocks back [expect: headers]\n  * peer requests block [ expect: block ]\n  * node mines another block at tip [ expect: inv, peer sends getdata, expect: block ]\n  * peer sends response-type [expect headers if getheaders, getheaders/getdata if mining new block]\n  * node mines 1 block [expect: 1 header, peer responds with getdata]\n\nPart 4: Test direct fetch behavior\na. Announce 2 old block headers.\n   Expect: no getdata requests.\nb. Announce 3 new blocks via 1 headers message.\n   Expect: one getdata request for all 3 blocks.\n   (Send blocks.)\nc. Announce 1 header that forks off the last two blocks.\n   Expect: no response.\nd. Announce 1 more header that builds on that fork.\n   Expect: one getdata request for two blocks.\ne. Announce 16 more headers that build on that fork.\n   Expect: getdata request for 14 more blocks.\nf. Announce 1 more header that builds on that fork.\n   Expect: no response.\n\nPart 5: Test handling of headers that don't connect.\na. Repeat 10 times:\n   1. Announce a header that doesn't connect.\n      Expect: getheaders message\n   2. Send headers chain.\n      Expect: getdata for the missing blocks, tip update.\nb. Then send 9 more headers that don't connect.\n   Expect: getheaders message each time.\nc. Announce a header that does connect.\n   Expect: no response.\nd. Announce 49 headers that don't connect.\n   Expect: getheaders message each time.\ne. Announce one more that doesn't connect.\n   Expect: disconnect.\n\"\"\"\nfrom test_framework.blocktools import create_block, create_coinbase\nfrom test_framework.mininode import (\n    CBlockHeader,\n    CInv,\n    NODE_WITNESS,\n    network_thread_start,\n    P2PInterface,\n    mininode_lock,\n    msg_block,\n    msg_getblocks,\n    msg_getdata,\n    msg_getheaders,\n    msg_headers,\n    msg_inv,\n    msg_sendheaders,\n)\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    sync_blocks,\n    wait_until,\n)\n\nDIRECT_FETCH_RESPONSE_TIME = 0.05\n\nclass BaseNode(P2PInterface):\n    def __init__(self):\n        super().__init__()\n\n        self.block_announced = False\n        self.last_blockhash_announced = None\n        self.recent_headers_announced = []\n\n    def send_get_data(self, block_hashes):\n        \"\"\"Request data for a list of block hashes.\"\"\"\n        msg = msg_getdata()\n        for x in block_hashes:\n            msg.inv.append(CInv(2, x))\n        self.send_message(msg)\n\n    def send_get_headers(self, locator, hashstop):\n        msg = msg_getheaders()\n        msg.locator.vHave = locator\n        msg.hashstop = hashstop\n        self.send_message(msg)\n\n    def send_block_inv(self, blockhash):\n        msg = msg_inv()\n        msg.inv = [CInv(2, blockhash)]\n        self.send_message(msg)\n\n    def send_header_for_blocks(self, new_blocks):\n        headers_message = msg_headers()\n        headers_message.headers = [CBlockHeader(b) for b in new_blocks]\n        self.send_message(headers_message)\n\n    def send_getblocks(self, locator):\n        getblocks_message = msg_getblocks()\n        getblocks_message.locator.vHave = locator\n        self.send_message(getblocks_message)\n\n    def wait_for_getdata(self, hash_list, timeout=60):\n        if hash_list == []:\n            return\n\n        test_function = lambda: \"getdata\" in self.last_message and [x.hash for x in self.last_message[\"getdata\"].inv] == hash_list\n        wait_until(test_function, timeout=timeout, lock=mininode_lock)\n\n    def wait_for_block_announcement(self, block_hash, timeout=60):\n        test_function = lambda: self.last_blockhash_announced == block_hash\n        wait_until(test_function, timeout=timeout, lock=mininode_lock)\n\n    def on_inv(self, message):\n        self.block_announced = True\n        self.last_blockhash_announced = message.inv[-1].hash\n\n    def on_headers(self, message):\n        if len(message.headers):\n            self.block_announced = True\n            for x in message.headers:\n                x.calc_sha256()\n                # append because headers may be announced over multiple messages.\n                self.recent_headers_announced.append(x.sha256)\n            self.last_blockhash_announced = message.headers[-1].sha256\n\n    def clear_block_announcements(self):\n        with mininode_lock:\n            self.block_announced = False\n            self.last_message.pop(\"inv\", None)\n            self.last_message.pop(\"headers\", None)\n            self.recent_headers_announced = []\n\n\n    def check_last_headers_announcement(self, headers):\n        \"\"\"Test whether the last headers announcements received are right.\n           Headers may be announced across more than one message.\"\"\"\n        test_function = lambda: (len(self.recent_headers_announced) >= len(headers))\n        wait_until(test_function, timeout=60, lock=mininode_lock)\n        with mininode_lock:\n            assert_equal(self.recent_headers_announced, headers)\n            self.block_announced = False\n            self.last_message.pop(\"headers\", None)\n            self.recent_headers_announced = []\n\n    def check_last_inv_announcement(self, inv):\n        \"\"\"Test whether the last announcement received had the right inv.\n        inv should be a list of block hashes.\"\"\"\n\n        test_function = lambda: self.block_announced\n        wait_until(test_function, timeout=60, lock=mininode_lock)\n\n        with mininode_lock:\n            compare_inv = []\n            if \"inv\" in self.last_message:\n                compare_inv = [x.hash for x in self.last_message[\"inv\"].inv]\n            assert_equal(compare_inv, inv)\n            self.block_announced = False\n            self.last_message.pop(\"inv\", None)\n\nclass SendHeadersTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 2\n\n    def mine_blocks(self, count):\n        \"\"\"Mine count blocks and return the new tip.\"\"\"\n\n        # Clear out block announcements from each p2p listener\n        [x.clear_block_announcements() for x in self.nodes[0].p2ps]\n        self.nodes[0].generate(count)\n        return int(self.nodes[0].getbestblockhash(), 16)\n\n    def mine_reorg(self, length):\n        \"\"\"Mine a reorg that invalidates length blocks (replacing them with # length+1 blocks).\n\n        Note: we clear the state of our p2p connections after the\n        to-be-reorged-out blocks are mined, so that we don't break later tests.\n        return the list of block hashes newly mined.\"\"\"\n\n        self.nodes[0].generate(length)  # make sure all invalidated blocks are node0's\n        sync_blocks(self.nodes, wait=0.1)\n        for x in self.nodes[0].p2ps:\n            x.wait_for_block_announcement(int(self.nodes[0].getbestblockhash(), 16))\n            x.clear_block_announcements()\n\n        tip_height = self.nodes[1].getblockcount()\n        hash_to_invalidate = self.nodes[1].getblockhash(tip_height - (length - 1))\n        self.nodes[1].invalidateblock(hash_to_invalidate)\n        all_hashes = self.nodes[1].generate(length + 1)  # Must be longer than the orig chain\n        sync_blocks(self.nodes, wait=0.1)\n        return [int(x, 16) for x in all_hashes]\n\n    def run_test(self):\n        # Setup the p2p connections and start up the network thread.\n        inv_node = self.nodes[0].add_p2p_connection(BaseNode())\n        # Make sure NODE_NETWORK is not set for test_node, so no block download\n        # will occur outside of direct fetching\n        test_node = self.nodes[0].add_p2p_connection(BaseNode(), services=NODE_WITNESS)\n\n        network_thread_start()\n\n        # Test logic begins here\n        inv_node.wait_for_verack()\n        test_node.wait_for_verack()\n\n        # Ensure verack's have been processed by our peer\n        inv_node.sync_with_ping()\n        test_node.sync_with_ping()\n\n        self.test_null_locators(test_node, inv_node)\n        self.test_nonnull_locators(test_node, inv_node)\n\n    def test_null_locators(self, test_node, inv_node):\n        tip = self.nodes[0].getblockheader(self.nodes[0].generate(1)[0])\n        tip_hash = int(tip[\"hash\"], 16)\n\n        inv_node.check_last_inv_announcement(inv=[tip_hash])\n        test_node.check_last_inv_announcement(inv=[tip_hash])\n\n        self.log.info(\"Verify getheaders with null locator and valid hashstop returns headers.\")\n        test_node.clear_block_announcements()\n        test_node.send_get_headers(locator=[], hashstop=tip_hash)\n        test_node.check_last_headers_announcement(headers=[tip_hash])\n\n        self.log.info(\"Verify getheaders with null locator and invalid hashstop does not return headers.\")\n        block = create_block(int(tip[\"hash\"], 16), create_coinbase(tip[\"height\"] + 1), tip[\"mediantime\"] + 1)\n        block.solve()\n        test_node.send_header_for_blocks([block])\n        test_node.clear_block_announcements()\n        test_node.send_get_headers(locator=[], hashstop=int(block.hash, 16))\n        test_node.sync_with_ping()\n        assert_equal(test_node.block_announced, False)\n        inv_node.clear_block_announcements()\n        test_node.send_message(msg_block(block))\n        inv_node.check_last_inv_announcement(inv=[int(block.hash, 16)])\n\n    def test_nonnull_locators(self, test_node, inv_node):\n        tip = int(self.nodes[0].getbestblockhash(), 16)\n\n        # PART 1\n        # 1. Mine a block; expect inv announcements each time\n        self.log.info(\"Part 1: headers don't start before sendheaders message...\")\n        for i in range(4):\n            old_tip = tip\n            tip = self.mine_blocks(1)\n            inv_node.check_last_inv_announcement(inv=[tip])\n            test_node.check_last_inv_announcement(inv=[tip])\n            # Try a few different responses; none should affect next announcement\n            if i == 0:\n                # first request the block\n                test_node.send_get_data([tip])\n                test_node.wait_for_block(tip)\n            elif i == 1:\n                # next try requesting header and block\n                test_node.send_get_headers(locator=[old_tip], hashstop=tip)\n                test_node.send_get_data([tip])\n                test_node.wait_for_block(tip)\n                test_node.clear_block_announcements()  # since we requested headers...\n            elif i == 2:\n                # this time announce own block via headers\n                height = self.nodes[0].getblockcount()\n                last_time = self.nodes[0].getblock(self.nodes[0].getbestblockhash())['time']\n                block_time = last_time + 1\n                new_block = create_block(tip, create_coinbase(height + 1), block_time)\n                new_block.solve()\n                test_node.send_header_for_blocks([new_block])\n                test_node.wait_for_getdata([new_block.sha256])\n                test_node.send_message(msg_block(new_block))\n                test_node.sync_with_ping()  # make sure this block is processed\n                inv_node.clear_block_announcements()\n                test_node.clear_block_announcements()\n\n        self.log.info(\"Part 1: success!\")\n        self.log.info(\"Part 2: announce blocks with headers after sendheaders message...\")\n        # PART 2\n        # 2. Send a sendheaders message and test that headers announcements\n        # commence and keep working.\n        test_node.send_message(msg_sendheaders())\n        prev_tip = int(self.nodes[0].getbestblockhash(), 16)\n        test_node.send_get_headers(locator=[prev_tip], hashstop=0)\n        test_node.sync_with_ping()\n\n        # Now that we've synced headers, headers announcements should work\n        tip = self.mine_blocks(1)\n        inv_node.check_last_inv_announcement(inv=[tip])\n        test_node.check_last_headers_announcement(headers=[tip])\n\n        height = self.nodes[0].getblockcount() + 1\n        block_time += 10  # Advance far enough ahead\n        for i in range(10):\n            # Mine i blocks, and alternate announcing either via\n            # inv (of tip) or via headers. After each, new blocks\n            # mined by the node should successfully be announced\n            # with block header, even though the blocks are never requested\n            for j in range(2):\n                blocks = []\n                for b in range(i + 1):\n                    blocks.append(create_block(tip, create_coinbase(height), block_time))\n                    blocks[-1].solve()\n                    tip = blocks[-1].sha256\n                    block_time += 1\n                    height += 1\n                if j == 0:\n                    # Announce via inv\n                    test_node.send_block_inv(tip)\n                    test_node.wait_for_getheaders()\n                    # Should have received a getheaders now\n                    test_node.send_header_for_blocks(blocks)\n                    # Test that duplicate inv's won't result in duplicate\n                    # getdata requests, or duplicate headers announcements\n                    [inv_node.send_block_inv(x.sha256) for x in blocks]\n                    test_node.wait_for_getdata([x.sha256 for x in blocks])\n                    inv_node.sync_with_ping()\n                else:\n                    # Announce via headers\n                    test_node.send_header_for_blocks(blocks)\n                    test_node.wait_for_getdata([x.sha256 for x in blocks])\n                    # Test that duplicate headers won't result in duplicate\n                    # getdata requests (the check is further down)\n                    inv_node.send_header_for_blocks(blocks)\n                    inv_node.sync_with_ping()\n                [test_node.send_message(msg_block(x)) for x in blocks]\n                test_node.sync_with_ping()\n                inv_node.sync_with_ping()\n                # This block should not be announced to the inv node (since it also\n                # broadcast it)\n                assert \"inv\" not in inv_node.last_message\n                assert \"headers\" not in inv_node.last_message\n                tip = self.mine_blocks(1)\n                inv_node.check_last_inv_announcement(inv=[tip])\n                test_node.check_last_headers_announcement(headers=[tip])\n                height += 1\n                block_time += 1\n\n        self.log.info(\"Part 2: success!\")\n\n        self.log.info(\"Part 3: headers announcements can stop after large reorg, and resume after headers/inv from peer...\")\n\n        # PART 3.  Headers announcements can stop after large reorg, and resume after\n        # getheaders or inv from peer.\n        for j in range(2):\n            # First try mining a reorg that can propagate with header announcement\n            new_block_hashes = self.mine_reorg(length=7)\n            tip = new_block_hashes[-1]\n            inv_node.check_last_inv_announcement(inv=[tip])\n            test_node.check_last_headers_announcement(headers=new_block_hashes)\n\n            block_time += 8\n\n            # Mine a too-large reorg, which should be announced with a single inv\n            new_block_hashes = self.mine_reorg(length=8)\n            tip = new_block_hashes[-1]\n            inv_node.check_last_inv_announcement(inv=[tip])\n            test_node.check_last_inv_announcement(inv=[tip])\n\n            block_time += 9\n\n            fork_point = self.nodes[0].getblock(\"%02x\" % new_block_hashes[0])[\"previousblockhash\"]\n            fork_point = int(fork_point, 16)\n\n            # Use getblocks/getdata\n            test_node.send_getblocks(locator=[fork_point])\n            test_node.check_last_inv_announcement(inv=new_block_hashes)\n            test_node.send_get_data(new_block_hashes)\n            test_node.wait_for_block(new_block_hashes[-1])\n\n            for i in range(3):\n                # Mine another block, still should get only an inv\n                tip = self.mine_blocks(1)\n                inv_node.check_last_inv_announcement(inv=[tip])\n                test_node.check_last_inv_announcement(inv=[tip])\n                if i == 0:\n                    # Just get the data -- shouldn't cause headers announcements to resume\n                    test_node.send_get_data([tip])\n                    test_node.wait_for_block(tip)\n                elif i == 1:\n                    # Send a getheaders message that shouldn't trigger headers announcements\n                    # to resume (best header sent will be too old)\n                    test_node.send_get_headers(locator=[fork_point], hashstop=new_block_hashes[1])\n                    test_node.send_get_data([tip])\n                    test_node.wait_for_block(tip)\n                elif i == 2:\n                    test_node.send_get_data([tip])\n                    test_node.wait_for_block(tip)\n                    # This time, try sending either a getheaders to trigger resumption\n                    # of headers announcements, or mine a new block and inv it, also\n                    # triggering resumption of headers announcements.\n                    if j == 0:\n                        test_node.send_get_headers(locator=[tip], hashstop=0)\n                        test_node.sync_with_ping()\n                    else:\n                        test_node.send_block_inv(tip)\n                        test_node.sync_with_ping()\n            # New blocks should now be announced with header\n            tip = self.mine_blocks(1)\n            inv_node.check_last_inv_announcement(inv=[tip])\n            test_node.check_last_headers_announcement(headers=[tip])\n\n        self.log.info(\"Part 3: success!\")\n\n        self.log.info(\"Part 4: Testing direct fetch behavior...\")\n        tip = self.mine_blocks(1)\n        height = self.nodes[0].getblockcount() + 1\n        last_time = self.nodes[0].getblock(self.nodes[0].getbestblockhash())['time']\n        block_time = last_time + 1\n\n        # Create 2 blocks.  Send the blocks, then send the headers.\n        blocks = []\n        for b in range(2):\n            blocks.append(create_block(tip, create_coinbase(height), block_time))\n            blocks[-1].solve()\n            tip = blocks[-1].sha256\n            block_time += 1\n            height += 1\n            inv_node.send_message(msg_block(blocks[-1]))\n\n        inv_node.sync_with_ping()  # Make sure blocks are processed\n        test_node.last_message.pop(\"getdata\", None)\n        test_node.send_header_for_blocks(blocks)\n        test_node.sync_with_ping()\n        # should not have received any getdata messages\n        with mininode_lock:\n            assert \"getdata\" not in test_node.last_message\n\n        # This time, direct fetch should work\n        blocks = []\n        for b in range(3):\n            blocks.append(create_block(tip, create_coinbase(height), block_time))\n            blocks[-1].solve()\n            tip = blocks[-1].sha256\n            block_time += 1\n            height += 1\n\n        test_node.send_header_for_blocks(blocks)\n        test_node.sync_with_ping()\n        test_node.wait_for_getdata([x.sha256 for x in blocks], timeout=DIRECT_FETCH_RESPONSE_TIME)\n\n        [test_node.send_message(msg_block(x)) for x in blocks]\n\n        test_node.sync_with_ping()\n\n        # Now announce a header that forks the last two blocks\n        tip = blocks[0].sha256\n        height -= 1\n        blocks = []\n\n        # Create extra blocks for later\n        for b in range(20):\n            blocks.append(create_block(tip, create_coinbase(height), block_time))\n            blocks[-1].solve()\n            tip = blocks[-1].sha256\n            block_time += 1\n            height += 1\n\n        # Announcing one block on fork should not trigger direct fetch\n        # (less work than tip)\n        test_node.last_message.pop(\"getdata\", None)\n        test_node.send_header_for_blocks(blocks[0:1])\n        test_node.sync_with_ping()\n        with mininode_lock:\n            assert \"getdata\" not in test_node.last_message\n\n        # Announcing one more block on fork should trigger direct fetch for\n        # both blocks (same work as tip)\n        test_node.send_header_for_blocks(blocks[1:2])\n        test_node.sync_with_ping()\n        test_node.wait_for_getdata([x.sha256 for x in blocks[0:2]], timeout=DIRECT_FETCH_RESPONSE_TIME)\n\n        # Announcing 16 more headers should trigger direct fetch for 14 more\n        # blocks\n        test_node.send_header_for_blocks(blocks[2:18])\n        test_node.sync_with_ping()\n        test_node.wait_for_getdata([x.sha256 for x in blocks[2:16]], timeout=DIRECT_FETCH_RESPONSE_TIME)\n\n        # Announcing 1 more header should not trigger any response\n        test_node.last_message.pop(\"getdata\", None)\n        test_node.send_header_for_blocks(blocks[18:19])\n        test_node.sync_with_ping()\n        with mininode_lock:\n            assert \"getdata\" not in test_node.last_message\n\n        self.log.info(\"Part 4: success!\")\n\n        # Now deliver all those blocks we announced.\n        [test_node.send_message(msg_block(x)) for x in blocks]\n\n        self.log.info(\"Part 5: Testing handling of unconnecting headers\")\n        # First we test that receipt of an unconnecting header doesn't prevent\n        # chain sync.\n        for i in range(10):\n            test_node.last_message.pop(\"getdata\", None)\n            blocks = []\n            # Create two more blocks.\n            for j in range(2):\n                blocks.append(create_block(tip, create_coinbase(height), block_time))\n                blocks[-1].solve()\n                tip = blocks[-1].sha256\n                block_time += 1\n                height += 1\n            # Send the header of the second block -> this won't connect.\n            with mininode_lock:\n                test_node.last_message.pop(\"getheaders\", None)\n            test_node.send_header_for_blocks([blocks[1]])\n            test_node.wait_for_getheaders()\n            test_node.send_header_for_blocks(blocks)\n            test_node.wait_for_getdata([x.sha256 for x in blocks])\n            [test_node.send_message(msg_block(x)) for x in blocks]\n            test_node.sync_with_ping()\n            assert_equal(int(self.nodes[0].getbestblockhash(), 16), blocks[1].sha256)\n\n        blocks = []\n        # Now we test that if we repeatedly don't send connecting headers, we\n        # don't go into an infinite loop trying to get them to connect.\n        MAX_UNCONNECTING_HEADERS = 10\n        for j in range(MAX_UNCONNECTING_HEADERS + 1):\n            blocks.append(create_block(tip, create_coinbase(height), block_time))\n            blocks[-1].solve()\n            tip = blocks[-1].sha256\n            block_time += 1\n            height += 1\n\n        for i in range(1, MAX_UNCONNECTING_HEADERS):\n            # Send a header that doesn't connect, check that we get a getheaders.\n            with mininode_lock:\n                test_node.last_message.pop(\"getheaders\", None)\n            test_node.send_header_for_blocks([blocks[i]])\n            test_node.wait_for_getheaders()\n\n        # Next header will connect, should re-set our count:\n        test_node.send_header_for_blocks([blocks[0]])\n\n        # Remove the first two entries (blocks[1] would connect):\n        blocks = blocks[2:]\n\n        # Now try to see how many unconnecting headers we can send\n        # before we get disconnected.  Should be 5*MAX_UNCONNECTING_HEADERS\n        for i in range(5 * MAX_UNCONNECTING_HEADERS - 1):\n            # Send a header that doesn't connect, check that we get a getheaders.\n            with mininode_lock:\n                test_node.last_message.pop(\"getheaders\", None)\n            test_node.send_header_for_blocks([blocks[i % len(blocks)]])\n            test_node.wait_for_getheaders()\n\n        # Eventually this stops working.\n        test_node.send_header_for_blocks([blocks[-1]])\n\n        # Should get disconnected\n        test_node.wait_for_disconnect()\n\n        self.log.info(\"Part 5: success!\")\n\n        # Finally, check that the inv node never received a getdata request,\n        # throughout the test\n        assert \"getdata\" not in inv_node.last_message\n\nif __name__ == '__main__':\n    SendHeadersTest().main()\n"
  },
  {
    "path": "test/functional/p2p_timeouts.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test various net timeouts.\n\n- Create three bitcoind nodes:\n\n    no_verack_node - we never send a verack in response to their version\n    no_version_node - we never send a version (only a ping)\n    no_send_node - we never send any P2P message.\n\n- Start all three nodes\n- Wait 1 second\n- Assert that we're connected\n- Send a ping to no_verack_node and no_version_node\n- Wait 30 seconds\n- Assert that we're still connected\n- Send a ping to no_verack_node and no_version_node\n- Wait 31 seconds\n- Assert that we're no longer connected (timeout to receive version/verack is 60 seconds)\n\"\"\"\n\nfrom time import sleep\n\nfrom test_framework.mininode import *\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass TestNode(P2PInterface):\n    def on_version(self, message):\n        # Don't send a verack in response\n        pass\n\nclass TimeoutsTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    def run_test(self):\n        # Setup the p2p connections and start up the network thread.\n        no_verack_node = self.nodes[0].add_p2p_connection(TestNode())\n        no_version_node = self.nodes[0].add_p2p_connection(TestNode(), send_version=False)\n        no_send_node = self.nodes[0].add_p2p_connection(TestNode(), send_version=False)\n\n        network_thread_start()\n\n        sleep(1)\n\n        assert no_verack_node.connected\n        assert no_version_node.connected\n        assert no_send_node.connected\n\n        no_verack_node.send_message(msg_ping())\n        no_version_node.send_message(msg_ping())\n\n        sleep(30)\n\n        assert \"version\" in no_verack_node.last_message\n\n        assert no_verack_node.connected\n        assert no_version_node.connected\n        assert no_send_node.connected\n\n        no_verack_node.send_message(msg_ping())\n        no_version_node.send_message(msg_ping())\n\n        sleep(31)\n\n        assert not no_verack_node.connected\n        assert not no_version_node.connected\n        assert not no_send_node.connected\n\nif __name__ == '__main__':\n    TimeoutsTest().main()\n"
  },
  {
    "path": "test/functional/p2p_unrequested_blocks.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test processing of unrequested blocks.\n\nSetup: two nodes, node0+node1, not connected to each other. Node1 will have\nnMinimumChainWork set to 0x10, so it won't process low-work unrequested blocks.\n\nWe have one P2PInterface connection to node0 called test_node, and one to node1\ncalled min_work_node.\n\nThe test:\n1. Generate one block on each node, to leave IBD.\n\n2. Mine a new block on each tip, and deliver to each node from node's peer.\n   The tip should advance for node0, but node1 should skip processing due to\n   nMinimumChainWork.\n\nNode1 is unused in tests 3-7:\n\n3. Mine a block that forks from the genesis block, and deliver to test_node.\n   Node0 should not process this block (just accept the header), because it\n   is unrequested and doesn't have more or equal work to the tip.\n\n4a,b. Send another two blocks that build on the forking block.\n   Node0 should process the second block but be stuck on the shorter chain,\n   because it's missing an intermediate block.\n\n4c.Send 288 more blocks on the longer chain (the number of blocks ahead\n   we currently store).\n   Node0 should process all but the last block (too far ahead in height).\n\n5. Send a duplicate of the block in #3 to Node0.\n   Node0 should not process the block because it is unrequested, and stay on\n   the shorter chain.\n\n6. Send Node0 an inv for the height 3 block produced in #4 above.\n   Node0 should figure out that Node0 has the missing height 2 block and send a\n   getdata.\n\n7. Send Node0 the missing block again.\n   Node0 should process and the tip should advance.\n\n8. Create a fork which is invalid at a height longer than the current chain\n   (ie to which the node will try to reorg) but which has headers built on top\n   of the invalid block. Check that we get disconnected if we send more headers\n   on the chain the node now knows to be invalid.\n\n9. Test Node1 is able to sync when connected to node0 (which should have sufficient\n   work on its chain).\n\"\"\"\n\nfrom test_framework.mininode import *\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nimport time\nfrom test_framework.blocktools import create_block, create_coinbase, create_transaction\n\nclass AcceptBlockTest(BitcoinTestFramework):\n    def add_options(self, parser):\n        parser.add_option(\"--testbinary\", dest=\"testbinary\",\n                          default=os.getenv(\"BITCOIND\", \"bitcoind\"),\n                          help=\"bitcoind binary to test\")\n\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 2\n        self.extra_args = [[], [\"-minimumchainwork=0x10\"]]\n\n    def setup_network(self):\n        # Node0 will be used to test behavior of processing unrequested blocks\n        # from peers which are not whitelisted, while Node1 will be used for\n        # the whitelisted case.\n        # Node2 will be used for non-whitelisted peers to test the interaction\n        # with nMinimumChainWork.\n        self.setup_nodes()\n\n    def run_test(self):\n        # Setup the p2p connections and start up the network thread.\n        # test_node connects to node0 (not whitelisted)\n        test_node = self.nodes[0].add_p2p_connection(P2PInterface())\n        # min_work_node connects to node1 (whitelisted)\n        min_work_node = self.nodes[1].add_p2p_connection(P2PInterface())\n\n        network_thread_start()\n\n        # Test logic begins here\n        test_node.wait_for_verack()\n        min_work_node.wait_for_verack()\n\n        # 1. Have nodes mine a block (leave IBD)\n        [ n.generate(1) for n in self.nodes ]\n        tips = [ int(\"0x\" + n.getbestblockhash(), 0) for n in self.nodes ]\n\n        # 2. Send one block that builds on each tip.\n        # This should be accepted by node0\n        blocks_h2 = []  # the height 2 blocks on each node's chain\n        block_time = int(time.time()) + 1\n        for i in range(2):\n            blocks_h2.append(create_block(tips[i], create_coinbase(2), block_time))\n            blocks_h2[i].solve()\n            block_time += 1\n        test_node.send_message(msg_block(blocks_h2[0]))\n        min_work_node.send_message(msg_block(blocks_h2[1]))\n\n        for x in [test_node, min_work_node]:\n            x.sync_with_ping()\n        assert_equal(self.nodes[0].getblockcount(), 2)\n        assert_equal(self.nodes[1].getblockcount(), 1)\n        self.log.info(\"First height 2 block accepted by node0; correctly rejected by node1\")\n\n        # 3. Send another block that builds on genesis.\n        block_h1f = create_block(int(\"0x\" + self.nodes[0].getblockhash(0), 0), create_coinbase(1), block_time)\n        block_time += 1\n        block_h1f.solve()\n        test_node.send_message(msg_block(block_h1f))\n\n        test_node.sync_with_ping()\n        tip_entry_found = False\n        for x in self.nodes[0].getchaintips():\n            if x['hash'] == block_h1f.hash:\n                assert_equal(x['status'], \"headers-only\")\n                tip_entry_found = True\n        assert(tip_entry_found)\n        assert_raises_rpc_error(-1, \"Block not found on disk\", self.nodes[0].getblock, block_h1f.hash)\n\n        # 4. Send another two block that build on the fork.\n        block_h2f = create_block(block_h1f.sha256, create_coinbase(2), block_time)\n        block_time += 1\n        block_h2f.solve()\n        test_node.send_message(msg_block(block_h2f))\n\n        test_node.sync_with_ping()\n        # Since the earlier block was not processed by node, the new block\n        # can't be fully validated.\n        tip_entry_found = False\n        for x in self.nodes[0].getchaintips():\n            if x['hash'] == block_h2f.hash:\n                assert_equal(x['status'], \"headers-only\")\n                tip_entry_found = True\n        assert(tip_entry_found)\n\n        # But this block should be accepted by node since it has equal work.\n        self.nodes[0].getblock(block_h2f.hash)\n        self.log.info(\"Second height 2 block accepted, but not reorg'ed to\")\n\n        # 4b. Now send another block that builds on the forking chain.\n        block_h3 = create_block(block_h2f.sha256, create_coinbase(3), block_h2f.nTime+1)\n        block_h3.solve()\n        test_node.send_message(msg_block(block_h3))\n\n        test_node.sync_with_ping()\n        # Since the earlier block was not processed by node, the new block\n        # can't be fully validated.\n        tip_entry_found = False\n        for x in self.nodes[0].getchaintips():\n            if x['hash'] == block_h3.hash:\n                assert_equal(x['status'], \"headers-only\")\n                tip_entry_found = True\n        assert(tip_entry_found)\n        self.nodes[0].getblock(block_h3.hash)\n\n        # But this block should be accepted by node since it has more work.\n        self.nodes[0].getblock(block_h3.hash)\n        self.log.info(\"Unrequested more-work block accepted\")\n\n        # 4c. Now mine 288 more blocks and deliver; all should be processed but\n        # the last (height-too-high) on node (as long as its not missing any headers)\n        tip = block_h3\n        all_blocks = []\n        for i in range(288):\n            next_block = create_block(tip.sha256, create_coinbase(i + 4), tip.nTime+1)\n            next_block.solve()\n            all_blocks.append(next_block)\n            tip = next_block\n\n        # Now send the block at height 5 and check that it wasn't accepted (missing header)\n        test_node.send_message(msg_block(all_blocks[1]))\n        test_node.sync_with_ping()\n        assert_raises_rpc_error(-5, \"Block not found\", self.nodes[0].getblock, all_blocks[1].hash)\n        assert_raises_rpc_error(-5, \"Block not found\", self.nodes[0].getblockheader, all_blocks[1].hash)\n\n        # The block at height 5 should be accepted if we provide the missing header, though\n        headers_message = msg_headers()\n        headers_message.headers.append(CBlockHeader(all_blocks[0]))\n        test_node.send_message(headers_message)\n        test_node.send_message(msg_block(all_blocks[1]))\n        test_node.sync_with_ping()\n        self.nodes[0].getblock(all_blocks[1].hash)\n\n        # Now send the blocks in all_blocks\n        for i in range(288):\n            test_node.send_message(msg_block(all_blocks[i]))\n        test_node.sync_with_ping()\n\n        # Blocks 1-287 should be accepted, block 288 should be ignored because it's too far ahead\n        for x in all_blocks[:-1]:\n            self.nodes[0].getblock(x.hash)\n        assert_raises_rpc_error(-1, \"Block not found on disk\", self.nodes[0].getblock, all_blocks[-1].hash)\n\n        # 5. Test handling of unrequested block on the node that didn't process\n        # Should still not be processed (even though it has a child that has more\n        # work).\n\n        # The node should have requested the blocks at some point, so\n        # disconnect/reconnect first\n\n        self.nodes[0].disconnect_p2ps()\n        self.nodes[1].disconnect_p2ps()\n        network_thread_join()\n\n        test_node = self.nodes[0].add_p2p_connection(P2PInterface())\n        network_thread_start()\n        test_node.wait_for_verack()\n\n        test_node.send_message(msg_block(block_h1f))\n\n        test_node.sync_with_ping()\n        assert_equal(self.nodes[0].getblockcount(), 2)\n        self.log.info(\"Unrequested block that would complete more-work chain was ignored\")\n\n        # 6. Try to get node to request the missing block.\n        # Poke the node with an inv for block at height 3 and see if that\n        # triggers a getdata on block 2 (it should if block 2 is missing).\n        with mininode_lock:\n            # Clear state so we can check the getdata request\n            test_node.last_message.pop(\"getdata\", None)\n            test_node.send_message(msg_inv([CInv(2, block_h3.sha256)]))\n\n        test_node.sync_with_ping()\n        with mininode_lock:\n            getdata = test_node.last_message[\"getdata\"]\n\n        # Check that the getdata includes the right block\n        assert_equal(getdata.inv[0].hash, block_h1f.sha256)\n        self.log.info(\"Inv at tip triggered getdata for unprocessed block\")\n\n        # 7. Send the missing block for the third time (now it is requested)\n        test_node.send_message(msg_block(block_h1f))\n\n        test_node.sync_with_ping()\n        assert_equal(self.nodes[0].getblockcount(), 290)\n        self.nodes[0].getblock(all_blocks[286].hash)\n        assert_equal(self.nodes[0].getbestblockhash(), all_blocks[286].hash)\n        assert_raises_rpc_error(-1, \"Block not found on disk\", self.nodes[0].getblock, all_blocks[287].hash)\n        self.log.info(\"Successfully reorged to longer chain from non-whitelisted peer\")\n\n        # 8. Create a chain which is invalid at a height longer than the\n        # current chain, but which has more blocks on top of that\n        block_289f = create_block(all_blocks[284].sha256, create_coinbase(289), all_blocks[284].nTime+1)\n        block_289f.solve()\n        block_290f = create_block(block_289f.sha256, create_coinbase(290), block_289f.nTime+1)\n        block_290f.solve()\n        block_291 = create_block(block_290f.sha256, create_coinbase(291), block_290f.nTime+1)\n        # block_291 spends a coinbase below maturity!\n        block_291.vtx.append(create_transaction(block_290f.vtx[0], 0, b\"42\", 1))\n        block_291.hashMerkleRoot = block_291.calc_merkle_root()\n        block_291.solve()\n        block_292 = create_block(block_291.sha256, create_coinbase(292), block_291.nTime+1)\n        block_292.solve()\n\n        # Now send all the headers on the chain and enough blocks to trigger reorg\n        headers_message = msg_headers()\n        headers_message.headers.append(CBlockHeader(block_289f))\n        headers_message.headers.append(CBlockHeader(block_290f))\n        headers_message.headers.append(CBlockHeader(block_291))\n        headers_message.headers.append(CBlockHeader(block_292))\n        test_node.send_message(headers_message)\n\n        test_node.sync_with_ping()\n        tip_entry_found = False\n        for x in self.nodes[0].getchaintips():\n            if x['hash'] == block_292.hash:\n                assert_equal(x['status'], \"headers-only\")\n                tip_entry_found = True\n        assert(tip_entry_found)\n        assert_raises_rpc_error(-1, \"Block not found on disk\", self.nodes[0].getblock, block_292.hash)\n\n        test_node.send_message(msg_block(block_289f))\n        test_node.send_message(msg_block(block_290f))\n\n        test_node.sync_with_ping()\n        self.nodes[0].getblock(block_289f.hash)\n        self.nodes[0].getblock(block_290f.hash)\n\n        test_node.send_message(msg_block(block_291))\n\n        # At this point we've sent an obviously-bogus block, wait for full processing\n        # without assuming whether we will be disconnected or not\n        try:\n            # Only wait a short while so the test doesn't take forever if we do get\n            # disconnected\n            test_node.sync_with_ping(timeout=1)\n        except AssertionError:\n            test_node.wait_for_disconnect()\n\n            self.nodes[0].disconnect_p2ps()\n            test_node = self.nodes[0].add_p2p_connection(P2PInterface())\n\n            network_thread_start()\n            test_node.wait_for_verack()\n\n        # We should have failed reorg and switched back to 290 (but have block 291)\n        assert_equal(self.nodes[0].getblockcount(), 290)\n        assert_equal(self.nodes[0].getbestblockhash(), all_blocks[286].hash)\n        assert_equal(self.nodes[0].getblock(block_291.hash)[\"confirmations\"], -1)\n\n        # Now send a new header on the invalid chain, indicating we're forked off, and expect to get disconnected\n        block_293 = create_block(block_292.sha256, create_coinbase(293), block_292.nTime+1)\n        block_293.solve()\n        headers_message = msg_headers()\n        headers_message.headers.append(CBlockHeader(block_293))\n        test_node.send_message(headers_message)\n        test_node.wait_for_disconnect()\n\n        # 9. Connect node1 to node0 and ensure it is able to sync\n        connect_nodes(self.nodes[0], 1)\n        sync_blocks([self.nodes[0], self.nodes[1]])\n        self.log.info(\"Successfully synced nodes 1 and 0\")\n\nif __name__ == '__main__':\n    AcceptBlockTest().main()\n"
  },
  {
    "path": "test/functional/rpc_bind.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test running bitcoind with the -rpcbind and -rpcallowip options.\"\"\"\n\nimport socket\nimport sys\n\nfrom test_framework.test_framework import BitcoinTestFramework, SkipTest\nfrom test_framework.util import *\nfrom test_framework.netutil import *\n\nclass RPCBindTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    def setup_network(self):\n        self.add_nodes(self.num_nodes, None)\n\n    def run_bind_test(self, allow_ips, connect_to, addresses, expected):\n        '''\n        Start a node with requested rpcallowip and rpcbind parameters,\n        then try to connect, and check if the set of bound addresses\n        matches the expected set.\n        '''\n        self.log.info(\"Bind test for %s\" % str(addresses))\n        expected = [(addr_to_hex(addr), port) for (addr, port) in expected]\n        base_args = ['-disablewallet', '-nolisten']\n        if allow_ips:\n            base_args += ['-rpcallowip=' + x for x in allow_ips]\n        binds = ['-rpcbind='+addr for addr in addresses]\n        self.nodes[0].rpchost = connect_to\n        self.start_node(0, base_args + binds)\n        pid = self.nodes[0].process.pid\n        assert_equal(set(get_bind_addrs(pid)), set(expected))\n        self.stop_nodes()\n\n    def run_allowip_test(self, allow_ips, rpchost, rpcport):\n        '''\n        Start a node with rpcallow IP, and request getnetworkinfo\n        at a non-localhost IP.\n        '''\n        self.log.info(\"Allow IP test for %s:%d\" % (rpchost, rpcport))\n        base_args = ['-disablewallet', '-nolisten'] + ['-rpcallowip='+x for x in allow_ips]\n        self.nodes[0].rpchost = None\n        self.start_nodes([base_args])\n        # connect to node through non-loopback interface\n        node = get_rpc_proxy(rpc_url(get_datadir_path(self.options.tmpdir, 0), 0, \"%s:%d\" % (rpchost, rpcport)), 0, coveragedir=self.options.coveragedir)\n        node.getnetworkinfo()\n        self.stop_nodes()\n\n    def run_test(self):\n        # due to OS-specific network stats queries, this test works only on Linux\n        if not sys.platform.startswith('linux'):\n            raise SkipTest(\"This test can only be run on linux.\")\n        # find the first non-loopback interface for testing\n        non_loopback_ip = None\n        for name,ip in all_interfaces():\n            if ip != '127.0.0.1':\n                non_loopback_ip = ip\n                break\n        if non_loopback_ip is None:\n            raise SkipTest(\"This test requires at least one non-loopback IPv4 interface.\")\n        try:\n            s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)\n            s.connect((\"::1\",1))\n            s.close\n        except OSError:\n            raise SkipTest(\"This test requires IPv6 support.\")\n\n        self.log.info(\"Using interface %s for testing\" % non_loopback_ip)\n\n        defaultport = rpc_port(0)\n\n        # check default without rpcallowip (IPv4 and IPv6 localhost)\n        self.run_bind_test(None, '127.0.0.1', [],\n            [('127.0.0.1', defaultport), ('::1', defaultport)])\n        # check default with rpcallowip (IPv6 any)\n        self.run_bind_test(['127.0.0.1'], '127.0.0.1', [],\n            [('::0', defaultport)])\n        # check only IPv4 localhost (explicit)\n        self.run_bind_test(['127.0.0.1'], '127.0.0.1', ['127.0.0.1'],\n            [('127.0.0.1', defaultport)])\n        # check only IPv4 localhost (explicit) with alternative port\n        self.run_bind_test(['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171'],\n            [('127.0.0.1', 32171)])\n        # check only IPv4 localhost (explicit) with multiple alternative ports on same host\n        self.run_bind_test(['127.0.0.1'], '127.0.0.1:32171', ['127.0.0.1:32171', '127.0.0.1:32172'],\n            [('127.0.0.1', 32171), ('127.0.0.1', 32172)])\n        # check only IPv6 localhost (explicit)\n        self.run_bind_test(['[::1]'], '[::1]', ['[::1]'],\n            [('::1', defaultport)])\n        # check both IPv4 and IPv6 localhost (explicit)\n        self.run_bind_test(['127.0.0.1'], '127.0.0.1', ['127.0.0.1', '[::1]'],\n            [('127.0.0.1', defaultport), ('::1', defaultport)])\n        # check only non-loopback interface\n        self.run_bind_test([non_loopback_ip], non_loopback_ip, [non_loopback_ip],\n            [(non_loopback_ip, defaultport)])\n\n        # Check that with invalid rpcallowip, we are denied\n        self.run_allowip_test([non_loopback_ip], non_loopback_ip, defaultport)\n        assert_raises_rpc_error(-342, \"non-JSON HTTP response with '403 Forbidden' from server\", self.run_allowip_test, ['1.1.1.1'], non_loopback_ip, defaultport)\n\nif __name__ == '__main__':\n    RPCBindTest().main()\n"
  },
  {
    "path": "test/functional/rpc_blockchain.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test RPCs related to blockchainstate.\n\nTest the following RPCs:\n    - getblockchaininfo\n    - gettxoutsetinfo\n    - getdifficulty\n    - getbestblockhash\n    - getblockhash\n    - getblockheader\n    - getchaintxstats\n    - getnetworkhashps\n    - verifychain\n\nTests correspond to code in rpc/blockchain.cpp.\n\"\"\"\n\nfrom decimal import Decimal\nimport http.client\nimport subprocess\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    assert_greater_than,\n    assert_greater_than_or_equal,\n    assert_raises,\n    assert_raises_rpc_error,\n    assert_is_hex_string,\n    assert_is_hash_string,\n)\n\nclass BlockchainTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.extra_args = [['-stopatheight=207', '-prune=1']]\n\n    def run_test(self):\n        self._test_getblockchaininfo()\n        self._test_getchaintxstats()\n        self._test_gettxoutsetinfo()\n        self._test_getblockheader()\n        self._test_getdifficulty()\n        self._test_getnetworkhashps()\n        self._test_stopatheight()\n        assert self.nodes[0].verifychain(4, 0)\n\n    def _test_getblockchaininfo(self):\n        self.log.info(\"Test getblockchaininfo\")\n\n        keys = [\n            'bestblockhash',\n            'bip9_softforks',\n            'blocks',\n            'chain',\n            'chainwork',\n            'difficulty',\n            'headers',\n            'initialblockdownload',\n            'mediantime',\n            'pruned',\n            'size_on_disk',\n            'softforks',\n            'verificationprogress',\n            'warnings',\n        ]\n        res = self.nodes[0].getblockchaininfo()\n\n        # result should have these additional pruning keys if manual pruning is enabled\n        assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning'] + keys))\n\n        # size_on_disk should be > 0\n        assert_greater_than(res['size_on_disk'], 0)\n\n        # pruneheight should be greater or equal to 0\n        assert_greater_than_or_equal(res['pruneheight'], 0)\n\n        # check other pruning fields given that prune=1\n        assert res['pruned']\n        assert not res['automatic_pruning']\n\n        self.restart_node(0, ['-stopatheight=207'])\n        res = self.nodes[0].getblockchaininfo()\n        # should have exact keys\n        assert_equal(sorted(res.keys()), keys)\n\n        self.restart_node(0, ['-stopatheight=207', '-prune=550'])\n        res = self.nodes[0].getblockchaininfo()\n        # result should have these additional pruning keys if prune=550\n        assert_equal(sorted(res.keys()), sorted(['pruneheight', 'automatic_pruning', 'prune_target_size'] + keys))\n\n        # check related fields\n        assert res['pruned']\n        assert_equal(res['pruneheight'], 0)\n        assert res['automatic_pruning']\n        assert_equal(res['prune_target_size'], 576716800)\n        assert_greater_than(res['size_on_disk'], 0)\n\n    def _test_getchaintxstats(self):\n        chaintxstats = self.nodes[0].getchaintxstats(1)\n        # 200 txs plus genesis tx\n        assert_equal(chaintxstats['txcount'], 201)\n        # tx rate should be 1 per 10 minutes, or 1/600\n        # we have to round because of binary math\n        assert_equal(round(chaintxstats['txrate'] * 600, 10), Decimal(1))\n\n        b1 = self.nodes[0].getblock(self.nodes[0].getblockhash(1))\n        b200 = self.nodes[0].getblock(self.nodes[0].getblockhash(200))\n        time_diff = b200['mediantime'] - b1['mediantime']\n\n        chaintxstats = self.nodes[0].getchaintxstats()\n        assert_equal(chaintxstats['time'], b200['time'])\n        assert_equal(chaintxstats['txcount'], 201)\n        assert_equal(chaintxstats['window_block_count'], 199)\n        assert_equal(chaintxstats['window_tx_count'], 199)\n        assert_equal(chaintxstats['window_interval'], time_diff)\n        assert_equal(round(chaintxstats['txrate'] * time_diff, 10), Decimal(199))\n\n        chaintxstats = self.nodes[0].getchaintxstats(blockhash=b1['hash'])\n        assert_equal(chaintxstats['time'], b1['time'])\n        assert_equal(chaintxstats['txcount'], 2)\n        assert_equal(chaintxstats['window_block_count'], 0)\n        assert('window_tx_count' not in chaintxstats)\n        assert('window_interval' not in chaintxstats)\n        assert('txrate' not in chaintxstats)\n\n        assert_raises_rpc_error(-8, \"Invalid block count: should be between 0 and the block's height - 1\", self.nodes[0].getchaintxstats, 201)\n\n    def _test_gettxoutsetinfo(self):\n        node = self.nodes[0]\n        res = node.gettxoutsetinfo()\n\n        assert_equal(res['total_amount'], Decimal('8725.00000000'))\n        assert_equal(res['transactions'], 200)\n        assert_equal(res['height'], 200)\n        assert_equal(res['txouts'], 200)\n        assert_equal(res['bogosize'], 17000),\n        assert_equal(res['bestblock'], node.getblockhash(200))\n        size = res['disk_size']\n        assert size > 6400\n        assert size < 64000\n        assert_equal(len(res['bestblock']), 64)\n        assert_equal(len(res['hash_serialized_2']), 64)\n\n        self.log.info(\"Test that gettxoutsetinfo() works for blockchain with just the genesis block\")\n        b1hash = node.getblockhash(1)\n        node.invalidateblock(b1hash)\n\n        res2 = node.gettxoutsetinfo()\n        assert_equal(res2['transactions'], 0)\n        assert_equal(res2['total_amount'], Decimal('0'))\n        assert_equal(res2['height'], 0)\n        assert_equal(res2['txouts'], 0)\n        assert_equal(res2['bogosize'], 0),\n        assert_equal(res2['bestblock'], node.getblockhash(0))\n        assert_equal(len(res2['hash_serialized_2']), 64)\n\n        self.log.info(\"Test that gettxoutsetinfo() returns the same result after invalidate/reconsider block\")\n        node.reconsiderblock(b1hash)\n\n        res3 = node.gettxoutsetinfo()\n        assert_equal(res['total_amount'], res3['total_amount'])\n        assert_equal(res['transactions'], res3['transactions'])\n        assert_equal(res['height'], res3['height'])\n        assert_equal(res['txouts'], res3['txouts'])\n        assert_equal(res['bogosize'], res3['bogosize'])\n        assert_equal(res['bestblock'], res3['bestblock'])\n        assert_equal(res['hash_serialized_2'], res3['hash_serialized_2'])\n\n    def _test_getblockheader(self):\n        node = self.nodes[0]\n\n        assert_raises_rpc_error(-5, \"Block not found\",\n                              node.getblockheader, \"nonsense\")\n\n        besthash = node.getbestblockhash()\n        secondbesthash = node.getblockhash(199)\n        header = node.getblockheader(besthash)\n\n        assert_equal(header['hash'], besthash)\n        assert_equal(header['height'], 200)\n        assert_equal(header['confirmations'], 1)\n        assert_equal(header['previousblockhash'], secondbesthash)\n        assert_is_hex_string(header['chainwork'])\n        assert_equal(header['nTx'], 1)\n        assert_is_hash_string(header['hash'])\n        assert_is_hash_string(header['previousblockhash'])\n        assert_is_hash_string(header['merkleroot'])\n        assert_is_hash_string(header['bits'], length=None)\n        assert isinstance(header['time'], int)\n        assert isinstance(header['mediantime'], int)\n        assert isinstance(header['nonce'], int)\n        assert isinstance(header['version'], int)\n        assert isinstance(int(header['versionHex'], 16), int)\n        assert isinstance(header['difficulty'], Decimal)\n\n    def _test_getdifficulty(self):\n        difficulty = self.nodes[0].getdifficulty()\n        # 1 hash in 2 should be valid, so difficulty should be 1/2**31\n        # binary => decimal => binary math is why we do this check\n        assert abs(difficulty * 2**31 - 1) < 0.0001\n\n    def _test_getnetworkhashps(self):\n        hashes_per_second = self.nodes[0].getnetworkhashps()\n        # This should be 2 hashes every 10 minutes or 1/300\n        assert abs(hashes_per_second * 300 - 1) < 0.0001\n\n    def _test_stopatheight(self):\n        assert_equal(self.nodes[0].getblockcount(), 200)\n        self.nodes[0].generate(6)\n        assert_equal(self.nodes[0].getblockcount(), 206)\n        self.log.debug('Node should not stop at this height')\n        assert_raises(subprocess.TimeoutExpired, lambda: self.nodes[0].process.wait(timeout=3))\n        try:\n            self.nodes[0].generate(1)\n        except (ConnectionError, http.client.BadStatusLine):\n            pass  # The node already shut down before response\n        self.log.debug('Node should stop at this height...')\n        self.nodes[0].wait_until_stopped()\n        self.start_node(0)\n        assert_equal(self.nodes[0].getblockcount(), 207)\n\n\nif __name__ == '__main__':\n    BlockchainTest().main()\n"
  },
  {
    "path": "test/functional/rpc_decodescript.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test decoding scripts via decodescript RPC command.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import *\nfrom io import BytesIO\n\nclass DecodeScriptTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    def decodescript_script_sig(self):\n        signature = '304502207fa7a6d1e0ee81132a269ad84e68d695483745cde8b541e3bf630749894e342a022100c1f7ab20e13e22fb95281a870f3dcf38d782e53023ee313d741ad0cfbc0c509001'\n        push_signature = '48' + signature\n        public_key = '03b0da749730dc9b4b1f4a14d6902877a92541f5368778853d9c4a0cb7802dcfb2'\n        push_public_key = '21' + public_key\n\n        # below are test cases for all of the standard transaction types\n\n        # 1) P2PK scriptSig\n        # the scriptSig of a public key scriptPubKey simply pushes a signature onto the stack\n        rpc_result = self.nodes[0].decodescript(push_signature)\n        assert_equal(signature, rpc_result['asm'])\n\n        # 2) P2PKH scriptSig\n        rpc_result = self.nodes[0].decodescript(push_signature + push_public_key)\n        assert_equal(signature + ' ' + public_key, rpc_result['asm'])\n\n        # 3) multisig scriptSig\n        # this also tests the leading portion of a P2SH multisig scriptSig\n        # OP_0 <A sig> <B sig>\n        rpc_result = self.nodes[0].decodescript('00' + push_signature + push_signature)\n        assert_equal('0 ' + signature + ' ' + signature, rpc_result['asm'])\n\n        # 4) P2SH scriptSig\n        # an empty P2SH redeemScript is valid and makes for a very simple test case.\n        # thus, such a spending scriptSig would just need to pass the outer redeemScript\n        # hash test and leave true on the top of the stack.\n        rpc_result = self.nodes[0].decodescript('5100')\n        assert_equal('1 0', rpc_result['asm'])\n\n        # 5) null data scriptSig - no such thing because null data scripts can not be spent.\n        # thus, no test case for that standard transaction type is here.\n\n    def decodescript_script_pub_key(self):\n        public_key = '03b0da749730dc9b4b1f4a14d6902877a92541f5368778853d9c4a0cb7802dcfb2'\n        push_public_key = '21' + public_key\n        public_key_hash = '11695b6cd891484c2d49ec5aa738ec2b2f897777'\n        push_public_key_hash = '14' + public_key_hash\n\n        # below are test cases for all of the standard transaction types\n\n        # 1) P2PK scriptPubKey\n        # <pubkey> OP_CHECKSIG\n        rpc_result = self.nodes[0].decodescript(push_public_key + 'ac')\n        assert_equal(public_key + ' OP_CHECKSIG', rpc_result['asm'])\n\n        # 2) P2PKH scriptPubKey\n        # OP_DUP OP_HASH160 <PubKeyHash> OP_EQUALVERIFY OP_CHECKSIG\n        rpc_result = self.nodes[0].decodescript('76a9' + push_public_key_hash + '88ac')\n        assert_equal('OP_DUP OP_HASH160 ' + public_key_hash + ' OP_EQUALVERIFY OP_CHECKSIG', rpc_result['asm'])\n\n        # 3) multisig scriptPubKey\n        # <m> <A pubkey> <B pubkey> <C pubkey> <n> OP_CHECKMULTISIG\n        # just imagine that the pub keys used below are different.\n        # for our purposes here it does not matter that they are the same even though it is unrealistic.\n        rpc_result = self.nodes[0].decodescript('52' + push_public_key + push_public_key + push_public_key + '53ae')\n        assert_equal('2 ' + public_key + ' ' + public_key + ' ' + public_key +  ' 3 OP_CHECKMULTISIG', rpc_result['asm'])\n\n        # 4) P2SH scriptPubKey\n        # OP_HASH160 <Hash160(redeemScript)> OP_EQUAL.\n        # push_public_key_hash here should actually be the hash of a redeem script.\n        # but this works the same for purposes of this test.\n        rpc_result = self.nodes[0].decodescript('a9' + push_public_key_hash + '87')\n        assert_equal('OP_HASH160 ' + public_key_hash + ' OP_EQUAL', rpc_result['asm'])\n\n        # 5) null data scriptPubKey\n        # use a signature look-alike here to make sure that we do not decode random data as a signature.\n        # this matters if/when signature sighash decoding comes along.\n        # would want to make sure that no such decoding takes place in this case.\n        signature_imposter = '48304502207fa7a6d1e0ee81132a269ad84e68d695483745cde8b541e3bf630749894e342a022100c1f7ab20e13e22fb95281a870f3dcf38d782e53023ee313d741ad0cfbc0c509001'\n        # OP_RETURN <data>\n        rpc_result = self.nodes[0].decodescript('6a' + signature_imposter)\n        assert_equal('OP_RETURN ' + signature_imposter[2:], rpc_result['asm'])\n\n        # 6) a CLTV redeem script. redeem scripts are in-effect scriptPubKey scripts, so adding a test here.\n        # OP_NOP2 is also known as OP_CHECKLOCKTIMEVERIFY.\n        # just imagine that the pub keys used below are different.\n        # for our purposes here it does not matter that they are the same even though it is unrealistic.\n        #\n        # OP_IF\n        #   <receiver-pubkey> OP_CHECKSIGVERIFY\n        # OP_ELSE\n        #   <lock-until> OP_CHECKLOCKTIMEVERIFY OP_DROP\n        # OP_ENDIF\n        # <sender-pubkey> OP_CHECKSIG\n        #\n        # lock until block 500,000\n        rpc_result = self.nodes[0].decodescript('63' + push_public_key + 'ad670320a107b17568' + push_public_key + 'ac')\n        assert_equal('OP_IF ' + public_key + ' OP_CHECKSIGVERIFY OP_ELSE 500000 OP_CHECKLOCKTIMEVERIFY OP_DROP OP_ENDIF ' + public_key + ' OP_CHECKSIG', rpc_result['asm'])\n\n    def decoderawtransaction_asm_sighashtype(self):\n        \"\"\"Test decoding scripts via RPC command \"decoderawtransaction\".\n\n        This test is in with the \"decodescript\" tests because they are testing the same \"asm\" script decodes.\n        \"\"\"\n\n        # this test case uses a random plain vanilla mainnet transaction with a single P2PKH input and output\n        tx = '0100000001696a20784a2c70143f634e95227dbdfdf0ecd51647052e70854512235f5986ca010000008a47304402207174775824bec6c2700023309a168231ec80b82c6069282f5133e6f11cbb04460220570edc55c7c5da2ca687ebd0372d3546ebc3f810516a002350cac72dfe192dfb014104d3f898e6487787910a690410b7a917ef198905c27fb9d3b0a42da12aceae0544fc7088d239d9a48f2828a15a09e84043001f27cc80d162cb95404e1210161536ffffffff0100e1f505000000001976a914eb6c6e0cdb2d256a32d97b8df1fc75d1920d9bca88ac00000000'\n        rpc_result = self.nodes[0].decoderawtransaction(tx)\n        assert_equal('304402207174775824bec6c2700023309a168231ec80b82c6069282f5133e6f11cbb04460220570edc55c7c5da2ca687ebd0372d3546ebc3f810516a002350cac72dfe192dfb[ALL] 04d3f898e6487787910a690410b7a917ef198905c27fb9d3b0a42da12aceae0544fc7088d239d9a48f2828a15a09e84043001f27cc80d162cb95404e1210161536', rpc_result['vin'][0]['scriptSig']['asm'])\n\n        # this test case uses a mainnet transaction that has a P2SH input and both P2PKH and P2SH outputs.\n        # it's from James D'Angelo's awesome introductory videos about multisig: https://www.youtube.com/watch?v=zIbUSaZBJgU and https://www.youtube.com/watch?v=OSA1pwlaypc\n        # verify that we have not altered scriptPubKey decoding.\n        tx = '01000000018d1f5635abd06e2c7e2ddf58dc85b3de111e4ad6e0ab51bb0dcf5e84126d927300000000fdfe0000483045022100ae3b4e589dfc9d48cb82d41008dc5fa6a86f94d5c54f9935531924602730ab8002202f88cf464414c4ed9fa11b773c5ee944f66e9b05cc1e51d97abc22ce098937ea01483045022100b44883be035600e9328a01b66c7d8439b74db64187e76b99a68f7893b701d5380220225bf286493e4c4adcf928c40f785422572eb232f84a0b83b0dea823c3a19c75014c695221020743d44be989540d27b1b4bbbcfd17721c337cb6bc9af20eb8a32520b393532f2102c0120a1dda9e51a938d39ddd9fe0ebc45ea97e1d27a7cbd671d5431416d3dd87210213820eb3d5f509d7438c9eeecb4157b2f595105e7cd564b3cdbb9ead3da41eed53aeffffffff02611e0000000000001976a914dc863734a218bfe83ef770ee9d41a27f824a6e5688acee2a02000000000017a9142a5edea39971049a540474c6a99edf0aa4074c588700000000'\n        rpc_result = self.nodes[0].decoderawtransaction(tx)\n        assert_equal('8e3730608c3b0bb5df54f09076e196bc292a8e39a78e73b44b6ba08c78f5cbb0', rpc_result['txid'])\n        assert_equal('0 3045022100ae3b4e589dfc9d48cb82d41008dc5fa6a86f94d5c54f9935531924602730ab8002202f88cf464414c4ed9fa11b773c5ee944f66e9b05cc1e51d97abc22ce098937ea[ALL] 3045022100b44883be035600e9328a01b66c7d8439b74db64187e76b99a68f7893b701d5380220225bf286493e4c4adcf928c40f785422572eb232f84a0b83b0dea823c3a19c75[ALL] 5221020743d44be989540d27b1b4bbbcfd17721c337cb6bc9af20eb8a32520b393532f2102c0120a1dda9e51a938d39ddd9fe0ebc45ea97e1d27a7cbd671d5431416d3dd87210213820eb3d5f509d7438c9eeecb4157b2f595105e7cd564b3cdbb9ead3da41eed53ae', rpc_result['vin'][0]['scriptSig']['asm'])\n        assert_equal('OP_DUP OP_HASH160 dc863734a218bfe83ef770ee9d41a27f824a6e56 OP_EQUALVERIFY OP_CHECKSIG', rpc_result['vout'][0]['scriptPubKey']['asm'])\n        assert_equal('OP_HASH160 2a5edea39971049a540474c6a99edf0aa4074c58 OP_EQUAL', rpc_result['vout'][1]['scriptPubKey']['asm'])\n        txSave = CTransaction()\n        txSave.deserialize(BytesIO(hex_str_to_bytes(tx)))\n\n        # make sure that a specifically crafted op_return value will not pass all the IsDERSignature checks and then get decoded as a sighash type\n        tx = '01000000015ded05872fdbda629c7d3d02b194763ce3b9b1535ea884e3c8e765d42e316724020000006b48304502204c10d4064885c42638cbff3585915b322de33762598321145ba033fc796971e2022100bb153ad3baa8b757e30a2175bd32852d2e1cb9080f84d7e32fcdfd667934ef1b012103163c0ff73511ea1743fb5b98384a2ff09dd06949488028fd819f4d83f56264efffffffff0200000000000000000b6a0930060201000201000180380100000000001976a9141cabd296e753837c086da7a45a6c2fe0d49d7b7b88ac00000000'\n        rpc_result = self.nodes[0].decoderawtransaction(tx)\n        assert_equal('OP_RETURN 300602010002010001', rpc_result['vout'][0]['scriptPubKey']['asm'])\n\n        # verify that we have not altered scriptPubKey processing even of a specially crafted P2PKH pubkeyhash and P2SH redeem script hash that is made to pass the der signature checks\n        tx = '01000000018d1f5635abd06e2c7e2ddf58dc85b3de111e4ad6e0ab51bb0dcf5e84126d927300000000fdfe0000483045022100ae3b4e589dfc9d48cb82d41008dc5fa6a86f94d5c54f9935531924602730ab8002202f88cf464414c4ed9fa11b773c5ee944f66e9b05cc1e51d97abc22ce098937ea01483045022100b44883be035600e9328a01b66c7d8439b74db64187e76b99a68f7893b701d5380220225bf286493e4c4adcf928c40f785422572eb232f84a0b83b0dea823c3a19c75014c695221020743d44be989540d27b1b4bbbcfd17721c337cb6bc9af20eb8a32520b393532f2102c0120a1dda9e51a938d39ddd9fe0ebc45ea97e1d27a7cbd671d5431416d3dd87210213820eb3d5f509d7438c9eeecb4157b2f595105e7cd564b3cdbb9ead3da41eed53aeffffffff02611e0000000000001976a914301102070101010101010102060101010101010188acee2a02000000000017a91430110207010101010101010206010101010101018700000000'\n        rpc_result = self.nodes[0].decoderawtransaction(tx)\n        assert_equal('OP_DUP OP_HASH160 3011020701010101010101020601010101010101 OP_EQUALVERIFY OP_CHECKSIG', rpc_result['vout'][0]['scriptPubKey']['asm'])\n        assert_equal('OP_HASH160 3011020701010101010101020601010101010101 OP_EQUAL', rpc_result['vout'][1]['scriptPubKey']['asm'])\n\n        # some more full transaction tests of varying specific scriptSigs. used instead of\n        # tests in decodescript_script_sig because the decodescript RPC is specifically\n        # for working on scriptPubKeys (argh!).\n        push_signature = bytes_to_hex_str(txSave.vin[0].scriptSig)[2:(0x48*2+4)]\n        signature = push_signature[2:]\n        der_signature = signature[:-2]\n        signature_sighash_decoded = der_signature + '[ALL]'\n        signature_2 = der_signature + '82'\n        push_signature_2 = '48' + signature_2\n        signature_2_sighash_decoded = der_signature + '[NONE|ANYONECANPAY]'\n\n        # 1) P2PK scriptSig\n        txSave.vin[0].scriptSig = hex_str_to_bytes(push_signature)\n        rpc_result = self.nodes[0].decoderawtransaction(bytes_to_hex_str(txSave.serialize()))\n        assert_equal(signature_sighash_decoded, rpc_result['vin'][0]['scriptSig']['asm'])\n\n        # make sure that the sighash decodes come out correctly for a more complex / lesser used case.\n        txSave.vin[0].scriptSig = hex_str_to_bytes(push_signature_2)\n        rpc_result = self.nodes[0].decoderawtransaction(bytes_to_hex_str(txSave.serialize()))\n        assert_equal(signature_2_sighash_decoded, rpc_result['vin'][0]['scriptSig']['asm'])\n\n        # 2) multisig scriptSig\n        txSave.vin[0].scriptSig = hex_str_to_bytes('00' + push_signature + push_signature_2)\n        rpc_result = self.nodes[0].decoderawtransaction(bytes_to_hex_str(txSave.serialize()))\n        assert_equal('0 ' + signature_sighash_decoded + ' ' + signature_2_sighash_decoded, rpc_result['vin'][0]['scriptSig']['asm'])\n\n        # 3) test a scriptSig that contains more than push operations.\n        # in fact, it contains an OP_RETURN with data specially crafted to cause improper decode if the code does not catch it.\n        txSave.vin[0].scriptSig = hex_str_to_bytes('6a143011020701010101010101020601010101010101')\n        rpc_result = self.nodes[0].decoderawtransaction(bytes_to_hex_str(txSave.serialize()))\n        assert_equal('OP_RETURN 3011020701010101010101020601010101010101', rpc_result['vin'][0]['scriptSig']['asm'])\n\n    def run_test(self):\n        self.decodescript_script_sig()\n        self.decodescript_script_pub_key()\n        self.decoderawtransaction_asm_sighashtype()\n\nif __name__ == '__main__':\n    DecodeScriptTest().main()\n"
  },
  {
    "path": "test/functional/rpc_deprecated.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test deprecation of RPC calls.\"\"\"\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_raises_rpc_error\n\nclass DeprecatedRpcTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.setup_clean_chain = True\n        self.extra_args = [[], [\"-deprecatedrpc=estimatefee\", \"-deprecatedrpc=createmultisig\"]]\n\n    def run_test(self):\n        self.log.info(\"estimatefee: Shows deprecated message\")\n        assert_raises_rpc_error(-32, 'estimatefee is deprecated', self.nodes[0].estimatefee, 1)\n\n        self.log.info(\"Using -deprecatedrpc=estimatefee bypasses the error\")\n        self.nodes[1].estimatefee(1)\n\n        self.log.info(\"Make sure that -deprecatedrpc=createmultisig allows it to take addresses\")\n        assert_raises_rpc_error(-5, \"Invalid public key\", self.nodes[0].createmultisig, 1, [self.nodes[0].getnewaddress()])\n        self.nodes[1].createmultisig(1, [self.nodes[1].getnewaddress()])\n\nif __name__ == '__main__':\n    DeprecatedRpcTest().main()\n"
  },
  {
    "path": "test/functional/rpc_fundrawtransaction.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the fundrawtransaction RPC.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\n\ndef get_unspent(listunspent, amount):\n    for utx in listunspent:\n        if utx['amount'] == amount:\n            return utx\n    raise AssertionError('Could not find unspent with amount={}'.format(amount))\n\nclass RawTransactionsTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 4\n        self.setup_clean_chain = True\n\n    def setup_network(self, split=False):\n        self.setup_nodes()\n\n        connect_nodes_bi(self.nodes, 0, 1)\n        connect_nodes_bi(self.nodes, 1, 2)\n        connect_nodes_bi(self.nodes, 0, 2)\n        connect_nodes_bi(self.nodes, 0, 3)\n\n    def run_test(self):\n        min_relay_tx_fee = self.nodes[0].getnetworkinfo()['relayfee']\n        # This test is not meant to test fee estimation and we'd like\n        # to be sure all txs are sent at a consistent desired feerate\n        for node in self.nodes:\n            node.settxfee(min_relay_tx_fee)\n\n        # if the fee's positive delta is higher than this value tests will fail,\n        # neg. delta always fail the tests.\n        # The size of the signature of every input may be at most 2 bytes larger\n        # than a minimum sized signature.\n\n        #            = 2 bytes * minRelayTxFeePerByte\n        feeTolerance = 2 * min_relay_tx_fee/1000\n\n        self.nodes[2].generate(1)\n        self.sync_all()\n        self.nodes[0].generate(121)\n        self.sync_all()\n\n        # ensure that setting changePosition in fundraw with an exact match is handled properly\n        rawmatch = self.nodes[2].createrawtransaction([], {self.nodes[2].getnewaddress():50})\n        rawmatch = self.nodes[2].fundrawtransaction(rawmatch, {\"changePosition\":1, \"subtractFeeFromOutputs\":[0]})\n        assert_equal(rawmatch[\"changepos\"], -1)\n\n        watchonly_address = self.nodes[0].getnewaddress()\n        watchonly_pubkey = self.nodes[0].validateaddress(watchonly_address)[\"pubkey\"]\n        watchonly_amount = Decimal(200)\n        self.nodes[3].importpubkey(watchonly_pubkey, \"\", True)\n        watchonly_txid = self.nodes[0].sendtoaddress(watchonly_address, watchonly_amount)\n        self.nodes[0].sendtoaddress(self.nodes[3].getnewaddress(), watchonly_amount / 10)\n\n        self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 1.5)\n        self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 1.0)\n        self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 5.0)\n\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        ###############\n        # simple test #\n        ###############\n        inputs  = [ ]\n        outputs = { self.nodes[0].getnewaddress() : 1.0 }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx)\n        fee = rawtxfund['fee']\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n        assert(len(dec_tx['vin']) > 0) #test that we have enough inputs\n\n        ##############################\n        # simple test with two coins #\n        ##############################\n        inputs  = [ ]\n        outputs = { self.nodes[0].getnewaddress() : 2.2 }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx)\n        fee = rawtxfund['fee']\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n        assert(len(dec_tx['vin']) > 0) #test if we have enough inputs\n\n        ##############################\n        # simple test with two coins #\n        ##############################\n        inputs  = [ ]\n        outputs = { self.nodes[0].getnewaddress() : 2.6 }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx)\n        fee = rawtxfund['fee']\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n        assert(len(dec_tx['vin']) > 0)\n        assert_equal(dec_tx['vin'][0]['scriptSig']['hex'], '')\n\n\n        ################################\n        # simple test with two outputs #\n        ################################\n        inputs  = [ ]\n        outputs = { self.nodes[0].getnewaddress() : 2.6, self.nodes[1].getnewaddress() : 2.5 }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx)\n        fee = rawtxfund['fee']\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n        totalOut = 0\n        for out in dec_tx['vout']:\n            totalOut += out['value']\n\n        assert(len(dec_tx['vin']) > 0)\n        assert_equal(dec_tx['vin'][0]['scriptSig']['hex'], '')\n\n\n        #########################################################################\n        # test a fundrawtransaction with a VIN greater than the required amount #\n        #########################################################################\n        utx = get_unspent(self.nodes[2].listunspent(), 5)\n\n        inputs  = [ {'txid' : utx['txid'], 'vout' : utx['vout']}]\n        outputs = { self.nodes[0].getnewaddress() : 1.0 }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n        assert_equal(utx['txid'], dec_tx['vin'][0]['txid'])\n\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx)\n        fee = rawtxfund['fee']\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n        totalOut = 0\n        for out in dec_tx['vout']:\n            totalOut += out['value']\n\n        assert_equal(fee + totalOut, utx['amount']) #compare vin total and totalout+fee\n\n\n        #####################################################################\n        # test a fundrawtransaction with which will not get a change output #\n        #####################################################################\n        utx = get_unspent(self.nodes[2].listunspent(), 5)\n\n        inputs  = [ {'txid' : utx['txid'], 'vout' : utx['vout']}]\n        outputs = { self.nodes[0].getnewaddress() : Decimal(5.0) - fee - feeTolerance }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n        assert_equal(utx['txid'], dec_tx['vin'][0]['txid'])\n\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx)\n        fee = rawtxfund['fee']\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n        totalOut = 0\n        for out in dec_tx['vout']:\n            totalOut += out['value']\n\n        assert_equal(rawtxfund['changepos'], -1)\n        assert_equal(fee + totalOut, utx['amount']) #compare vin total and totalout+fee\n\n\n        ####################################################\n        # test a fundrawtransaction with an invalid option #\n        ####################################################\n        utx = get_unspent(self.nodes[2].listunspent(), 5)\n\n        inputs  = [ {'txid' : utx['txid'], 'vout' : utx['vout']} ]\n        outputs = { self.nodes[0].getnewaddress() : Decimal(4.0) }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n        assert_equal(utx['txid'], dec_tx['vin'][0]['txid'])\n\n        assert_raises_rpc_error(-3, \"Unexpected key foo\", self.nodes[2].fundrawtransaction, rawtx, {'foo':'bar'})\n\n        ############################################################\n        # test a fundrawtransaction with an invalid change address #\n        ############################################################\n        utx = get_unspent(self.nodes[2].listunspent(), 5)\n\n        inputs  = [ {'txid' : utx['txid'], 'vout' : utx['vout']} ]\n        outputs = { self.nodes[0].getnewaddress() : Decimal(4.0) }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n        assert_equal(utx['txid'], dec_tx['vin'][0]['txid'])\n\n        assert_raises_rpc_error(-5, \"changeAddress must be a valid bitcoin address\", self.nodes[2].fundrawtransaction, rawtx, {'changeAddress':'foobar'})\n\n        ############################################################\n        # test a fundrawtransaction with a provided change address #\n        ############################################################\n        utx = get_unspent(self.nodes[2].listunspent(), 5)\n\n        inputs  = [ {'txid' : utx['txid'], 'vout' : utx['vout']} ]\n        outputs = { self.nodes[0].getnewaddress() : Decimal(4.0) }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n        assert_equal(utx['txid'], dec_tx['vin'][0]['txid'])\n\n        change = self.nodes[2].getnewaddress()\n        assert_raises_rpc_error(-8, \"changePosition out of bounds\", self.nodes[2].fundrawtransaction, rawtx, {'changeAddress':change, 'changePosition':2})\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx, {'changeAddress': change, 'changePosition': 0})\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n        out = dec_tx['vout'][0]\n        assert_equal(change, out['scriptPubKey']['addresses'][0])\n\n        #########################################################\n        # test a fundrawtransaction with a provided change type #\n        #########################################################\n        utx = get_unspent(self.nodes[2].listunspent(), 5)\n\n        inputs  = [ {'txid' : utx['txid'], 'vout' : utx['vout']} ]\n        outputs = { self.nodes[0].getnewaddress() : Decimal(4.0) }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        assert_raises_rpc_error(-1, \"JSON value is not a string as expected\", self.nodes[2].fundrawtransaction, rawtx, {'change_type': None})\n        assert_raises_rpc_error(-5, \"Unknown change type\", self.nodes[2].fundrawtransaction, rawtx, {'change_type': ''})\n        rawtx = self.nodes[2].fundrawtransaction(rawtx, {'change_type': 'bech32'})\n        tx  = self.nodes[2].decoderawtransaction(rawtx['hex'])\n        assert_equal('witness_v0_keyhash', tx['vout'][rawtx['changepos']]['scriptPubKey']['type'])\n\n        #########################################################################\n        # test a fundrawtransaction with a VIN smaller than the required amount #\n        #########################################################################\n        utx = get_unspent(self.nodes[2].listunspent(), 1)\n\n        inputs  = [ {'txid' : utx['txid'], 'vout' : utx['vout']}]\n        outputs = { self.nodes[0].getnewaddress() : 1.0 }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n\n        # 4-byte version + 1-byte vin count + 36-byte prevout then script_len\n        rawtx = rawtx[:82] + \"0100\" + rawtx[84:]\n\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n        assert_equal(utx['txid'], dec_tx['vin'][0]['txid'])\n        assert_equal(\"00\", dec_tx['vin'][0]['scriptSig']['hex'])\n\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx)\n        fee = rawtxfund['fee']\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n        totalOut = 0\n        matchingOuts = 0\n        for i, out in enumerate(dec_tx['vout']):\n            totalOut += out['value']\n            if out['scriptPubKey']['addresses'][0] in outputs:\n                matchingOuts+=1\n            else:\n                assert_equal(i, rawtxfund['changepos'])\n\n        assert_equal(utx['txid'], dec_tx['vin'][0]['txid'])\n        assert_equal(\"00\", dec_tx['vin'][0]['scriptSig']['hex'])\n\n        assert_equal(matchingOuts, 1)\n        assert_equal(len(dec_tx['vout']), 2)\n\n\n        ###########################################\n        # test a fundrawtransaction with two VINs #\n        ###########################################\n        utx = get_unspent(self.nodes[2].listunspent(), 1)\n        utx2 = get_unspent(self.nodes[2].listunspent(), 5)\n\n        inputs  = [ {'txid' : utx['txid'], 'vout' : utx['vout']},{'txid' : utx2['txid'], 'vout' : utx2['vout']} ]\n        outputs = { self.nodes[0].getnewaddress() : 6.0 }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n        assert_equal(utx['txid'], dec_tx['vin'][0]['txid'])\n\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx)\n        fee = rawtxfund['fee']\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n        totalOut = 0\n        matchingOuts = 0\n        for out in dec_tx['vout']:\n            totalOut += out['value']\n            if out['scriptPubKey']['addresses'][0] in outputs:\n                matchingOuts+=1\n\n        assert_equal(matchingOuts, 1)\n        assert_equal(len(dec_tx['vout']), 2)\n\n        matchingIns = 0\n        for vinOut in dec_tx['vin']:\n            for vinIn in inputs:\n                if vinIn['txid'] == vinOut['txid']:\n                    matchingIns+=1\n\n        assert_equal(matchingIns, 2) #we now must see two vins identical to vins given as params\n\n        #########################################################\n        # test a fundrawtransaction with two VINs and two vOUTs #\n        #########################################################\n        utx = get_unspent(self.nodes[2].listunspent(), 1)\n        utx2 = get_unspent(self.nodes[2].listunspent(), 5)\n\n        inputs  = [ {'txid' : utx['txid'], 'vout' : utx['vout']},{'txid' : utx2['txid'], 'vout' : utx2['vout']} ]\n        outputs = { self.nodes[0].getnewaddress() : 6.0, self.nodes[0].getnewaddress() : 1.0 }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n        assert_equal(utx['txid'], dec_tx['vin'][0]['txid'])\n\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx)\n        fee = rawtxfund['fee']\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n        totalOut = 0\n        matchingOuts = 0\n        for out in dec_tx['vout']:\n            totalOut += out['value']\n            if out['scriptPubKey']['addresses'][0] in outputs:\n                matchingOuts+=1\n\n        assert_equal(matchingOuts, 2)\n        assert_equal(len(dec_tx['vout']), 3)\n\n        ##############################################\n        # test a fundrawtransaction with invalid vin #\n        ##############################################\n        inputs  = [ {'txid' : \"1c7f966dab21119bac53213a2bc7532bff1fa844c124fd750a7d0b1332440bd1\", 'vout' : 0} ] #invalid vin!\n        outputs = { self.nodes[0].getnewaddress() : 1.0}\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n\n        assert_raises_rpc_error(-4, \"Insufficient funds\", self.nodes[2].fundrawtransaction, rawtx)\n\n        ############################################################\n        #compare fee of a standard pubkeyhash transaction\n        inputs = []\n        outputs = {self.nodes[1].getnewaddress():1.1}\n        rawtx = self.nodes[0].createrawtransaction(inputs, outputs)\n        fundedTx = self.nodes[0].fundrawtransaction(rawtx)\n\n        #create same transaction over sendtoaddress\n        txId = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1.1)\n        signedFee = self.nodes[0].getrawmempool(True)[txId]['fee']\n\n        #compare fee\n        feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee)\n        assert(feeDelta >= 0 and feeDelta <= feeTolerance)\n        ############################################################\n\n        ############################################################\n        #compare fee of a standard pubkeyhash transaction with multiple outputs\n        inputs = []\n        outputs = {self.nodes[1].getnewaddress():1.1,self.nodes[1].getnewaddress():1.2,self.nodes[1].getnewaddress():0.1,self.nodes[1].getnewaddress():1.3,self.nodes[1].getnewaddress():0.2,self.nodes[1].getnewaddress():0.3}\n        rawtx = self.nodes[0].createrawtransaction(inputs, outputs)\n        fundedTx = self.nodes[0].fundrawtransaction(rawtx)\n        #create same transaction over sendtoaddress\n        txId = self.nodes[0].sendmany(\"\", outputs)\n        signedFee = self.nodes[0].getrawmempool(True)[txId]['fee']\n\n        #compare fee\n        feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee)\n        assert(feeDelta >= 0 and feeDelta <= feeTolerance)\n        ############################################################\n\n\n        ############################################################\n        #compare fee of a 2of2 multisig p2sh transaction\n\n        # create 2of2 addr\n        addr1 = self.nodes[1].getnewaddress()\n        addr2 = self.nodes[1].getnewaddress()\n\n        addr1Obj = self.nodes[1].validateaddress(addr1)\n        addr2Obj = self.nodes[1].validateaddress(addr2)\n\n        mSigObj = self.nodes[1].addmultisigaddress(2, [addr1Obj['pubkey'], addr2Obj['pubkey']])['address']\n\n        inputs = []\n        outputs = {mSigObj:1.1}\n        rawtx = self.nodes[0].createrawtransaction(inputs, outputs)\n        fundedTx = self.nodes[0].fundrawtransaction(rawtx)\n\n        #create same transaction over sendtoaddress\n        txId = self.nodes[0].sendtoaddress(mSigObj, 1.1)\n        signedFee = self.nodes[0].getrawmempool(True)[txId]['fee']\n\n        #compare fee\n        feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee)\n        assert(feeDelta >= 0 and feeDelta <= feeTolerance)\n        ############################################################\n\n\n        ############################################################\n        #compare fee of a standard pubkeyhash transaction\n\n        # create 4of5 addr\n        addr1 = self.nodes[1].getnewaddress()\n        addr2 = self.nodes[1].getnewaddress()\n        addr3 = self.nodes[1].getnewaddress()\n        addr4 = self.nodes[1].getnewaddress()\n        addr5 = self.nodes[1].getnewaddress()\n\n        addr1Obj = self.nodes[1].validateaddress(addr1)\n        addr2Obj = self.nodes[1].validateaddress(addr2)\n        addr3Obj = self.nodes[1].validateaddress(addr3)\n        addr4Obj = self.nodes[1].validateaddress(addr4)\n        addr5Obj = self.nodes[1].validateaddress(addr5)\n\n        mSigObj = self.nodes[1].addmultisigaddress(4, [addr1Obj['pubkey'], addr2Obj['pubkey'], addr3Obj['pubkey'], addr4Obj['pubkey'], addr5Obj['pubkey']])['address']\n\n        inputs = []\n        outputs = {mSigObj:1.1}\n        rawtx = self.nodes[0].createrawtransaction(inputs, outputs)\n        fundedTx = self.nodes[0].fundrawtransaction(rawtx)\n\n        #create same transaction over sendtoaddress\n        txId = self.nodes[0].sendtoaddress(mSigObj, 1.1)\n        signedFee = self.nodes[0].getrawmempool(True)[txId]['fee']\n\n        #compare fee\n        feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee)\n        assert(feeDelta >= 0 and feeDelta <= feeTolerance)\n        ############################################################\n\n\n        ############################################################\n        # spend a 2of2 multisig transaction over fundraw\n\n        # create 2of2 addr\n        addr1 = self.nodes[2].getnewaddress()\n        addr2 = self.nodes[2].getnewaddress()\n\n        addr1Obj = self.nodes[2].validateaddress(addr1)\n        addr2Obj = self.nodes[2].validateaddress(addr2)\n\n        mSigObj = self.nodes[2].addmultisigaddress(2, [addr1Obj['pubkey'], addr2Obj['pubkey']])['address']\n\n\n        # send 1.2 BTC to msig addr\n        txId = self.nodes[0].sendtoaddress(mSigObj, 1.2)\n        self.sync_all()\n        self.nodes[1].generate(1)\n        self.sync_all()\n\n        oldBalance = self.nodes[1].getbalance()\n        inputs = []\n        outputs = {self.nodes[1].getnewaddress():1.1}\n        rawtx = self.nodes[2].createrawtransaction(inputs, outputs)\n        fundedTx = self.nodes[2].fundrawtransaction(rawtx)\n\n        signedTx = self.nodes[2].signrawtransaction(fundedTx['hex'])\n        txId = self.nodes[2].sendrawtransaction(signedTx['hex'])\n        self.sync_all()\n        self.nodes[1].generate(1)\n        self.sync_all()\n\n        # make sure funds are received at node1\n        assert_equal(oldBalance+Decimal('1.10000000'), self.nodes[1].getbalance())\n\n        ############################################################\n        # locked wallet test\n        self.stop_node(0)\n        self.nodes[1].node_encrypt_wallet(\"test\")\n        self.stop_node(2)\n        self.stop_node(3)\n\n        self.start_nodes()\n        # This test is not meant to test fee estimation and we'd like\n        # to be sure all txs are sent at a consistent desired feerate\n        for node in self.nodes:\n            node.settxfee(min_relay_tx_fee)\n\n        connect_nodes_bi(self.nodes,0,1)\n        connect_nodes_bi(self.nodes,1,2)\n        connect_nodes_bi(self.nodes,0,2)\n        connect_nodes_bi(self.nodes,0,3)\n        self.sync_all()\n\n        # drain the keypool\n        self.nodes[1].getnewaddress()\n        self.nodes[1].getrawchangeaddress()\n        inputs = []\n        outputs = {self.nodes[0].getnewaddress():1.1}\n        rawtx = self.nodes[1].createrawtransaction(inputs, outputs)\n        # fund a transaction that requires a new key for the change output\n        # creating the key must be impossible because the wallet is locked\n        assert_raises_rpc_error(-4, \"Keypool ran out, please call keypoolrefill first\", self.nodes[1].fundrawtransaction, rawtx)\n\n        #refill the keypool\n        self.nodes[1].walletpassphrase(\"test\", 100)\n        self.nodes[1].keypoolrefill(8) #need to refill the keypool to get an internal change address\n        self.nodes[1].walletlock()\n\n        assert_raises_rpc_error(-13, \"walletpassphrase\", self.nodes[1].sendtoaddress, self.nodes[0].getnewaddress(), 1.2)\n\n        oldBalance = self.nodes[0].getbalance()\n\n        inputs = []\n        outputs = {self.nodes[0].getnewaddress():1.1}\n        rawtx = self.nodes[1].createrawtransaction(inputs, outputs)\n        fundedTx = self.nodes[1].fundrawtransaction(rawtx)\n\n        #now we need to unlock\n        self.nodes[1].walletpassphrase(\"test\", 600)\n        signedTx = self.nodes[1].signrawtransaction(fundedTx['hex'])\n        txId = self.nodes[1].sendrawtransaction(signedTx['hex'])\n        self.nodes[1].generate(1)\n        self.sync_all()\n\n        # make sure funds are received at node1\n        assert_equal(oldBalance+Decimal('51.10000000'), self.nodes[0].getbalance())\n\n\n        ###############################################\n        # multiple (~19) inputs tx test | Compare fee #\n        ###############################################\n\n        #empty node1, send some small coins from node0 to node1\n        self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), \"\", \"\", True)\n        self.sync_all()\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        for i in range(0,20):\n            self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        #fund a tx with ~20 small inputs\n        inputs = []\n        outputs = {self.nodes[0].getnewaddress():0.15,self.nodes[0].getnewaddress():0.04}\n        rawtx = self.nodes[1].createrawtransaction(inputs, outputs)\n        fundedTx = self.nodes[1].fundrawtransaction(rawtx)\n\n        #create same transaction over sendtoaddress\n        txId = self.nodes[1].sendmany(\"\", outputs)\n        signedFee = self.nodes[1].getrawmempool(True)[txId]['fee']\n\n        #compare fee\n        feeDelta = Decimal(fundedTx['fee']) - Decimal(signedFee)\n        assert(feeDelta >= 0 and feeDelta <= feeTolerance*19) #~19 inputs\n\n\n        #############################################\n        # multiple (~19) inputs tx test | sign/send #\n        #############################################\n\n        #again, empty node1, send some small coins from node0 to node1\n        self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), self.nodes[1].getbalance(), \"\", \"\", True)\n        self.sync_all()\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        for i in range(0,20):\n            self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.01)\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        #fund a tx with ~20 small inputs\n        oldBalance = self.nodes[0].getbalance()\n\n        inputs = []\n        outputs = {self.nodes[0].getnewaddress():0.15,self.nodes[0].getnewaddress():0.04}\n        rawtx = self.nodes[1].createrawtransaction(inputs, outputs)\n        fundedTx = self.nodes[1].fundrawtransaction(rawtx)\n        fundedAndSignedTx = self.nodes[1].signrawtransaction(fundedTx['hex'])\n        txId = self.nodes[1].sendrawtransaction(fundedAndSignedTx['hex'])\n        self.sync_all()\n        self.nodes[0].generate(1)\n        self.sync_all()\n        assert_equal(oldBalance+Decimal('50.19000000'), self.nodes[0].getbalance()) #0.19+block reward\n\n        #####################################################\n        # test fundrawtransaction with OP_RETURN and no vin #\n        #####################################################\n\n        rawtx   = \"0100000000010000000000000000066a047465737400000000\"\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtx)\n\n        assert_equal(len(dec_tx['vin']), 0)\n        assert_equal(len(dec_tx['vout']), 1)\n\n        rawtxfund = self.nodes[2].fundrawtransaction(rawtx)\n        dec_tx  = self.nodes[2].decoderawtransaction(rawtxfund['hex'])\n\n        assert_greater_than(len(dec_tx['vin']), 0) # at least one vin\n        assert_equal(len(dec_tx['vout']), 2) # one change output added\n\n\n        ##################################################\n        # test a fundrawtransaction using only watchonly #\n        ##################################################\n\n        inputs = []\n        outputs = {self.nodes[2].getnewaddress() : watchonly_amount / 2}\n        rawtx = self.nodes[3].createrawtransaction(inputs, outputs)\n\n        result = self.nodes[3].fundrawtransaction(rawtx, {'includeWatching': True })\n        res_dec = self.nodes[0].decoderawtransaction(result[\"hex\"])\n        assert_equal(len(res_dec[\"vin\"]), 1)\n        assert_equal(res_dec[\"vin\"][0][\"txid\"], watchonly_txid)\n\n        assert(\"fee\" in result.keys())\n        assert_greater_than(result[\"changepos\"], -1)\n\n        ###############################################################\n        # test fundrawtransaction using the entirety of watched funds #\n        ###############################################################\n\n        inputs = []\n        outputs = {self.nodes[2].getnewaddress() : watchonly_amount}\n        rawtx = self.nodes[3].createrawtransaction(inputs, outputs)\n\n        # Backward compatibility test (2nd param is includeWatching)\n        result = self.nodes[3].fundrawtransaction(rawtx, True)\n        res_dec = self.nodes[0].decoderawtransaction(result[\"hex\"])\n        assert_equal(len(res_dec[\"vin\"]), 2)\n        assert(res_dec[\"vin\"][0][\"txid\"] == watchonly_txid or res_dec[\"vin\"][1][\"txid\"] == watchonly_txid)\n\n        assert_greater_than(result[\"fee\"], 0)\n        assert_greater_than(result[\"changepos\"], -1)\n        assert_equal(result[\"fee\"] + res_dec[\"vout\"][result[\"changepos\"]][\"value\"], watchonly_amount / 10)\n\n        signedtx = self.nodes[3].signrawtransaction(result[\"hex\"])\n        assert(not signedtx[\"complete\"])\n        signedtx = self.nodes[0].signrawtransaction(signedtx[\"hex\"])\n        assert(signedtx[\"complete\"])\n        self.nodes[0].sendrawtransaction(signedtx[\"hex\"])\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        #######################\n        # Test feeRate option #\n        #######################\n\n        # Make sure there is exactly one input so coin selection can't skew the result\n        assert_equal(len(self.nodes[3].listunspent(1)), 1)\n\n        inputs = []\n        outputs = {self.nodes[3].getnewaddress() : 1}\n        rawtx = self.nodes[3].createrawtransaction(inputs, outputs)\n        result = self.nodes[3].fundrawtransaction(rawtx) # uses min_relay_tx_fee (set by settxfee)\n        result2 = self.nodes[3].fundrawtransaction(rawtx, {\"feeRate\": 2*min_relay_tx_fee})\n        result3 = self.nodes[3].fundrawtransaction(rawtx, {\"feeRate\": 10*min_relay_tx_fee})\n        result_fee_rate = result['fee'] * 1000 / count_bytes(result['hex'])\n        assert_fee_amount(result2['fee'], count_bytes(result2['hex']), 2 * result_fee_rate)\n        assert_fee_amount(result3['fee'], count_bytes(result3['hex']), 10 * result_fee_rate)\n\n        ################################\n        # Test no address reuse occurs #\n        ################################\n\n        result3 = self.nodes[3].fundrawtransaction(rawtx)\n        res_dec = self.nodes[0].decoderawtransaction(result3[\"hex\"])\n        changeaddress = \"\"\n        for out in res_dec['vout']:\n            if out['value'] > 1.0:\n                changeaddress += out['scriptPubKey']['addresses'][0]\n        assert(changeaddress != \"\")\n        nextaddr = self.nodes[3].getnewaddress()\n        # Now the change address key should be removed from the keypool\n        assert(changeaddress != nextaddr)\n\n        ######################################\n        # Test subtractFeeFromOutputs option #\n        ######################################\n\n        # Make sure there is exactly one input so coin selection can't skew the result\n        assert_equal(len(self.nodes[3].listunspent(1)), 1)\n\n        inputs = []\n        outputs = {self.nodes[2].getnewaddress(): 1}\n        rawtx = self.nodes[3].createrawtransaction(inputs, outputs)\n\n        result = [self.nodes[3].fundrawtransaction(rawtx), # uses min_relay_tx_fee (set by settxfee)\n                  self.nodes[3].fundrawtransaction(rawtx, {\"subtractFeeFromOutputs\": []}), # empty subtraction list\n                  self.nodes[3].fundrawtransaction(rawtx, {\"subtractFeeFromOutputs\": [0]}), # uses min_relay_tx_fee (set by settxfee)\n                  self.nodes[3].fundrawtransaction(rawtx, {\"feeRate\": 2*min_relay_tx_fee}),\n                  self.nodes[3].fundrawtransaction(rawtx, {\"feeRate\": 2*min_relay_tx_fee, \"subtractFeeFromOutputs\": [0]})]\n\n        dec_tx = [self.nodes[3].decoderawtransaction(tx['hex']) for tx in result]\n        output = [d['vout'][1 - r['changepos']]['value'] for d, r in zip(dec_tx, result)]\n        change = [d['vout'][r['changepos']]['value'] for d, r in zip(dec_tx, result)]\n\n        assert_equal(result[0]['fee'], result[1]['fee'], result[2]['fee'])\n        assert_equal(result[3]['fee'], result[4]['fee'])\n        assert_equal(change[0], change[1])\n        assert_equal(output[0], output[1])\n        assert_equal(output[0], output[2] + result[2]['fee'])\n        assert_equal(change[0] + result[0]['fee'], change[2])\n        assert_equal(output[3], output[4] + result[4]['fee'])\n        assert_equal(change[3] + result[3]['fee'], change[4])\n\n        inputs = []\n        outputs = {self.nodes[2].getnewaddress(): value for value in (1.0, 1.1, 1.2, 1.3)}\n        rawtx = self.nodes[3].createrawtransaction(inputs, outputs)\n\n        result = [self.nodes[3].fundrawtransaction(rawtx),\n                  # split the fee between outputs 0, 2, and 3, but not output 1\n                  self.nodes[3].fundrawtransaction(rawtx, {\"subtractFeeFromOutputs\": [0, 2, 3]})]\n\n        dec_tx = [self.nodes[3].decoderawtransaction(result[0]['hex']),\n                  self.nodes[3].decoderawtransaction(result[1]['hex'])]\n\n        # Nested list of non-change output amounts for each transaction\n        output = [[out['value'] for i, out in enumerate(d['vout']) if i != r['changepos']]\n                  for d, r in zip(dec_tx, result)]\n\n        # List of differences in output amounts between normal and subtractFee transactions\n        share = [o0 - o1 for o0, o1 in zip(output[0], output[1])]\n\n        # output 1 is the same in both transactions\n        assert_equal(share[1], 0)\n\n        # the other 3 outputs are smaller as a result of subtractFeeFromOutputs\n        assert_greater_than(share[0], 0)\n        assert_greater_than(share[2], 0)\n        assert_greater_than(share[3], 0)\n\n        # outputs 2 and 3 take the same share of the fee\n        assert_equal(share[2], share[3])\n\n        # output 0 takes at least as much share of the fee, and no more than 2 satoshis more, than outputs 2 and 3\n        assert_greater_than_or_equal(share[0], share[2])\n        assert_greater_than_or_equal(share[2] + Decimal(2e-8), share[0])\n\n        # the fee is the same in both transactions\n        assert_equal(result[0]['fee'], result[1]['fee'])\n\n        # the total subtracted from the outputs is equal to the fee\n        assert_equal(share[0] + share[2] + share[3], result[0]['fee'])\n\nif __name__ == '__main__':\n    RawTransactionsTest().main()\n"
  },
  {
    "path": "test/functional/rpc_getchaintips.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the getchaintips RPC.\n\n- introduce a network split\n- work on chains of different lengths\n- join the network together again\n- verify that getchaintips now returns two chain tips.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal\n\nclass GetChainTipsTest (BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 4\n\n    def run_test (self):\n        tips = self.nodes[0].getchaintips ()\n        assert_equal (len (tips), 1)\n        assert_equal (tips[0]['branchlen'], 0)\n        assert_equal (tips[0]['height'], 200)\n        assert_equal (tips[0]['status'], 'active')\n\n        # Split the network and build two chains of different lengths.\n        self.split_network ()\n        self.nodes[0].generate(10)\n        self.nodes[2].generate(20)\n        self.sync_all([self.nodes[:2], self.nodes[2:]])\n\n        tips = self.nodes[1].getchaintips ()\n        assert_equal (len (tips), 1)\n        shortTip = tips[0]\n        assert_equal (shortTip['branchlen'], 0)\n        assert_equal (shortTip['height'], 210)\n        assert_equal (tips[0]['status'], 'active')\n\n        tips = self.nodes[3].getchaintips ()\n        assert_equal (len (tips), 1)\n        longTip = tips[0]\n        assert_equal (longTip['branchlen'], 0)\n        assert_equal (longTip['height'], 220)\n        assert_equal (tips[0]['status'], 'active')\n\n        # Join the network halves and check that we now have two tips\n        # (at least at the nodes that previously had the short chain).\n        self.join_network ()\n\n        tips = self.nodes[0].getchaintips ()\n        assert_equal (len (tips), 2)\n        assert_equal (tips[0], longTip)\n\n        assert_equal (tips[1]['branchlen'], 10)\n        assert_equal (tips[1]['status'], 'valid-fork')\n        tips[1]['branchlen'] = 0\n        tips[1]['status'] = 'active'\n        assert_equal (tips[1], shortTip)\n\nif __name__ == '__main__':\n    GetChainTipsTest ().main ()\n"
  },
  {
    "path": "test/functional/rpc_invalidateblock.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the invalidateblock RPC.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass InvalidateTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 3\n\n    def setup_network(self):\n        self.setup_nodes()\n\n    def run_test(self):\n        self.log.info(\"Make sure we repopulate setBlockIndexCandidates after InvalidateBlock:\")\n        self.log.info(\"Mine 4 blocks on Node 0\")\n        self.nodes[0].generate(4)\n        assert(self.nodes[0].getblockcount() == 4)\n        besthash = self.nodes[0].getbestblockhash()\n\n        self.log.info(\"Mine competing 6 blocks on Node 1\")\n        self.nodes[1].generate(6)\n        assert(self.nodes[1].getblockcount() == 6)\n\n        self.log.info(\"Connect nodes to force a reorg\")\n        connect_nodes_bi(self.nodes,0,1)\n        sync_blocks(self.nodes[0:2])\n        assert(self.nodes[0].getblockcount() == 6)\n        badhash = self.nodes[1].getblockhash(2)\n\n        self.log.info(\"Invalidate block 2 on node 0 and verify we reorg to node 0's original chain\")\n        self.nodes[0].invalidateblock(badhash)\n        newheight = self.nodes[0].getblockcount()\n        newhash = self.nodes[0].getbestblockhash()\n        if (newheight != 4 or newhash != besthash):\n            raise AssertionError(\"Wrong tip for node0, hash %s, height %d\"%(newhash,newheight))\n\n        self.log.info(\"Make sure we won't reorg to a lower work chain:\")\n        connect_nodes_bi(self.nodes,1,2)\n        self.log.info(\"Sync node 2 to node 1 so both have 6 blocks\")\n        sync_blocks(self.nodes[1:3])\n        assert(self.nodes[2].getblockcount() == 6)\n        self.log.info(\"Invalidate block 5 on node 1 so its tip is now at 4\")\n        self.nodes[1].invalidateblock(self.nodes[1].getblockhash(5))\n        assert(self.nodes[1].getblockcount() == 4)\n        self.log.info(\"Invalidate block 3 on node 2, so its tip is now 2\")\n        self.nodes[2].invalidateblock(self.nodes[2].getblockhash(3))\n        assert(self.nodes[2].getblockcount() == 2)\n        self.log.info(\"..and then mine a block\")\n        self.nodes[2].generate(1)\n        self.log.info(\"Verify all nodes are at the right height\")\n        time.sleep(5)\n        assert_equal(self.nodes[2].getblockcount(), 3)\n        assert_equal(self.nodes[0].getblockcount(), 4)\n        node1height = self.nodes[1].getblockcount()\n        if node1height < 4:\n            raise AssertionError(\"Node 1 reorged to a lower height: %d\"%node1height)\n\nif __name__ == '__main__':\n    InvalidateTest().main()\n"
  },
  {
    "path": "test/functional/rpc_listtransactions.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the listtransactions API.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import CTransaction, COIN\nfrom io import BytesIO\n\ndef txFromHex(hexstring):\n    tx = CTransaction()\n    f = BytesIO(hex_str_to_bytes(hexstring))\n    tx.deserialize(f)\n    return tx\n\nclass ListTransactionsTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.enable_mocktime()\n\n    def run_test(self):\n        # Simple send, 0 to 1:\n        txid = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 0.1)\n        self.sync_all()\n        assert_array_result(self.nodes[0].listtransactions(),\n                           {\"txid\":txid},\n                           {\"category\":\"send\",\"account\":\"\",\"amount\":Decimal(\"-0.1\"),\"confirmations\":0})\n        assert_array_result(self.nodes[1].listtransactions(),\n                           {\"txid\":txid},\n                           {\"category\":\"receive\",\"account\":\"\",\"amount\":Decimal(\"0.1\"),\"confirmations\":0})\n        # mine a block, confirmations should change:\n        self.nodes[0].generate(1)\n        self.sync_all()\n        assert_array_result(self.nodes[0].listtransactions(),\n                           {\"txid\":txid},\n                           {\"category\":\"send\",\"account\":\"\",\"amount\":Decimal(\"-0.1\"),\"confirmations\":1})\n        assert_array_result(self.nodes[1].listtransactions(),\n                           {\"txid\":txid},\n                           {\"category\":\"receive\",\"account\":\"\",\"amount\":Decimal(\"0.1\"),\"confirmations\":1})\n\n        # send-to-self:\n        txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 0.2)\n        assert_array_result(self.nodes[0].listtransactions(),\n                           {\"txid\":txid, \"category\":\"send\"},\n                           {\"amount\":Decimal(\"-0.2\")})\n        assert_array_result(self.nodes[0].listtransactions(),\n                           {\"txid\":txid, \"category\":\"receive\"},\n                           {\"amount\":Decimal(\"0.2\")})\n\n        # sendmany from node1: twice to self, twice to node2:\n        send_to = { self.nodes[0].getnewaddress() : 0.11,\n                    self.nodes[1].getnewaddress() : 0.22,\n                    self.nodes[0].getaccountaddress(\"from1\") : 0.33,\n                    self.nodes[1].getaccountaddress(\"toself\") : 0.44 }\n        txid = self.nodes[1].sendmany(\"\", send_to)\n        self.sync_all()\n        assert_array_result(self.nodes[1].listtransactions(),\n                           {\"category\":\"send\",\"amount\":Decimal(\"-0.11\")},\n                           {\"txid\":txid} )\n        assert_array_result(self.nodes[0].listtransactions(),\n                           {\"category\":\"receive\",\"amount\":Decimal(\"0.11\")},\n                           {\"txid\":txid} )\n        assert_array_result(self.nodes[1].listtransactions(),\n                           {\"category\":\"send\",\"amount\":Decimal(\"-0.22\")},\n                           {\"txid\":txid} )\n        assert_array_result(self.nodes[1].listtransactions(),\n                           {\"category\":\"receive\",\"amount\":Decimal(\"0.22\")},\n                           {\"txid\":txid} )\n        assert_array_result(self.nodes[1].listtransactions(),\n                           {\"category\":\"send\",\"amount\":Decimal(\"-0.33\")},\n                           {\"txid\":txid} )\n        assert_array_result(self.nodes[0].listtransactions(),\n                           {\"category\":\"receive\",\"amount\":Decimal(\"0.33\")},\n                           {\"txid\":txid, \"account\" : \"from1\"} )\n        assert_array_result(self.nodes[1].listtransactions(),\n                           {\"category\":\"send\",\"amount\":Decimal(\"-0.44\")},\n                           {\"txid\":txid, \"account\" : \"\"} )\n        assert_array_result(self.nodes[1].listtransactions(),\n                           {\"category\":\"receive\",\"amount\":Decimal(\"0.44\")},\n                           {\"txid\":txid, \"account\" : \"toself\"} )\n\n        pubkey = self.nodes[1].validateaddress(self.nodes[1].getnewaddress())['pubkey']\n        multisig = self.nodes[1].createmultisig(1, [pubkey])\n        self.nodes[0].importaddress(multisig[\"redeemScript\"], \"watchonly\", False, True)\n        txid = self.nodes[1].sendtoaddress(multisig[\"address\"], 0.1)\n        self.nodes[1].generate(1)\n        self.sync_all()\n        assert(len(self.nodes[0].listtransactions(\"watchonly\", 100, 0, False)) == 0)\n        assert_array_result(self.nodes[0].listtransactions(\"watchonly\", 100, 0, True),\n                           {\"category\":\"receive\",\"amount\":Decimal(\"0.1\")},\n                           {\"txid\":txid, \"account\" : \"watchonly\"} )\n\n        self.run_rbf_opt_in_test()\n\n    # Check that the opt-in-rbf flag works properly, for sent and received\n    # transactions.\n    def run_rbf_opt_in_test(self):\n        # Check whether a transaction signals opt-in RBF itself\n        def is_opt_in(node, txid):\n            rawtx = node.getrawtransaction(txid, 1)\n            for x in rawtx[\"vin\"]:\n                if x[\"sequence\"] < 0xfffffffe:\n                    return True\n            return False\n\n        # Find an unconfirmed output matching a certain txid\n        def get_unconfirmed_utxo_entry(node, txid_to_match):\n            utxo = node.listunspent(0, 0)\n            for i in utxo:\n                if i[\"txid\"] == txid_to_match:\n                    return i\n            return None\n\n        # 1. Chain a few transactions that don't opt-in.\n        txid_1 = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1)\n        assert(not is_opt_in(self.nodes[0], txid_1))\n        assert_array_result(self.nodes[0].listtransactions(), {\"txid\": txid_1}, {\"bip125-replaceable\":\"no\"})\n        sync_mempools(self.nodes)\n        assert_array_result(self.nodes[1].listtransactions(), {\"txid\": txid_1}, {\"bip125-replaceable\":\"no\"})\n\n        # Tx2 will build off txid_1, still not opting in to RBF.\n        utxo_to_use = get_unconfirmed_utxo_entry(self.nodes[0], txid_1)\n        assert_equal(utxo_to_use[\"safe\"], True)\n        utxo_to_use = get_unconfirmed_utxo_entry(self.nodes[1], txid_1)\n        utxo_to_use = get_unconfirmed_utxo_entry(self.nodes[1], txid_1)\n        assert_equal(utxo_to_use[\"safe\"], False)\n\n        # Create tx2 using createrawtransaction\n        inputs = [{\"txid\":utxo_to_use[\"txid\"], \"vout\":utxo_to_use[\"vout\"]}]\n        outputs = {self.nodes[0].getnewaddress(): 0.999}\n        tx2 = self.nodes[1].createrawtransaction(inputs, outputs)\n        tx2_signed = self.nodes[1].signrawtransaction(tx2)[\"hex\"]\n        txid_2 = self.nodes[1].sendrawtransaction(tx2_signed)\n\n        # ...and check the result\n        assert(not is_opt_in(self.nodes[1], txid_2))\n        assert_array_result(self.nodes[1].listtransactions(), {\"txid\": txid_2}, {\"bip125-replaceable\":\"no\"})\n        sync_mempools(self.nodes)\n        assert_array_result(self.nodes[0].listtransactions(), {\"txid\": txid_2}, {\"bip125-replaceable\":\"no\"})\n\n        # Tx3 will opt-in to RBF\n        utxo_to_use = get_unconfirmed_utxo_entry(self.nodes[0], txid_2)\n        inputs = [{\"txid\": txid_2, \"vout\":utxo_to_use[\"vout\"]}]\n        outputs = {self.nodes[1].getnewaddress(): 0.998}\n        tx3 = self.nodes[0].createrawtransaction(inputs, outputs)\n        tx3_modified = txFromHex(tx3)\n        tx3_modified.vin[0].nSequence = 0\n        tx3 = bytes_to_hex_str(tx3_modified.serialize())\n        tx3_signed = self.nodes[0].signrawtransaction(tx3)['hex']\n        txid_3 = self.nodes[0].sendrawtransaction(tx3_signed)\n\n        assert(is_opt_in(self.nodes[0], txid_3))\n        assert_array_result(self.nodes[0].listtransactions(), {\"txid\": txid_3}, {\"bip125-replaceable\":\"yes\"})\n        sync_mempools(self.nodes)\n        assert_array_result(self.nodes[1].listtransactions(), {\"txid\": txid_3}, {\"bip125-replaceable\":\"yes\"})\n\n        # Tx4 will chain off tx3.  Doesn't signal itself, but depends on one\n        # that does.\n        utxo_to_use = get_unconfirmed_utxo_entry(self.nodes[1], txid_3)\n        inputs = [{\"txid\": txid_3, \"vout\":utxo_to_use[\"vout\"]}]\n        outputs = {self.nodes[0].getnewaddress(): 0.997}\n        tx4 = self.nodes[1].createrawtransaction(inputs, outputs)\n        tx4_signed = self.nodes[1].signrawtransaction(tx4)[\"hex\"]\n        txid_4 = self.nodes[1].sendrawtransaction(tx4_signed)\n\n        assert(not is_opt_in(self.nodes[1], txid_4))\n        assert_array_result(self.nodes[1].listtransactions(), {\"txid\": txid_4}, {\"bip125-replaceable\":\"yes\"})\n        sync_mempools(self.nodes)\n        assert_array_result(self.nodes[0].listtransactions(), {\"txid\": txid_4}, {\"bip125-replaceable\":\"yes\"})\n\n        # Replace tx3, and check that tx4 becomes unknown\n        tx3_b = tx3_modified\n        tx3_b.vout[0].nValue -= int(Decimal(\"0.004\") * COIN) # bump the fee\n        tx3_b = bytes_to_hex_str(tx3_b.serialize())\n        tx3_b_signed = self.nodes[0].signrawtransaction(tx3_b)['hex']\n        txid_3b = self.nodes[0].sendrawtransaction(tx3_b_signed, True)\n        assert(is_opt_in(self.nodes[0], txid_3b))\n\n        assert_array_result(self.nodes[0].listtransactions(), {\"txid\": txid_4}, {\"bip125-replaceable\":\"unknown\"})\n        sync_mempools(self.nodes)\n        assert_array_result(self.nodes[1].listtransactions(), {\"txid\": txid_4}, {\"bip125-replaceable\":\"unknown\"})\n\n        # Check gettransaction as well:\n        for n in self.nodes[0:2]:\n            assert_equal(n.gettransaction(txid_1)[\"bip125-replaceable\"], \"no\")\n            assert_equal(n.gettransaction(txid_2)[\"bip125-replaceable\"], \"no\")\n            assert_equal(n.gettransaction(txid_3)[\"bip125-replaceable\"], \"yes\")\n            assert_equal(n.gettransaction(txid_3b)[\"bip125-replaceable\"], \"yes\")\n            assert_equal(n.gettransaction(txid_4)[\"bip125-replaceable\"], \"unknown\")\n\n        # After mining a transaction, it's no longer BIP125-replaceable\n        self.nodes[0].generate(1)\n        assert(txid_3b not in self.nodes[0].getrawmempool())\n        assert_equal(self.nodes[0].gettransaction(txid_3b)[\"bip125-replaceable\"], \"no\")\n        assert_equal(self.nodes[0].gettransaction(txid_4)[\"bip125-replaceable\"], \"unknown\")\n\n\nif __name__ == '__main__':\n    ListTransactionsTest().main()\n\n"
  },
  {
    "path": "test/functional/rpc_named_arguments.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test using named arguments for RPCs.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    assert_raises_rpc_error,\n)\n\nclass NamedArgumentTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n\n    def run_test(self):\n        node = self.nodes[0]\n        h = node.help(command='getblockchaininfo')\n        assert(h.startswith('getblockchaininfo\\n'))\n\n        assert_raises_rpc_error(-8, 'Unknown named parameter', node.help, random='getblockchaininfo')\n\n        h = node.getblockhash(height=0)\n        node.getblock(blockhash=h)\n\n        assert_equal(node.echo(), [])\n        assert_equal(node.echo(arg0=0,arg9=9), [0] + [None]*8 + [9])\n        assert_equal(node.echo(arg1=1), [None, 1])\n        assert_equal(node.echo(arg9=None), [None]*10)\n        assert_equal(node.echo(arg0=0,arg3=3,arg9=9), [0] + [None]*2 + [3] + [None]*5 + [9])\n\nif __name__ == '__main__':\n    NamedArgumentTest().main()\n"
  },
  {
    "path": "test/functional/rpc_net.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test RPC calls related to net.\n\nTests correspond to code in rpc/net.cpp.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    assert_greater_than_or_equal,\n    assert_raises_rpc_error,\n    connect_nodes_bi,\n    p2p_port,\n    wait_until,\n)\n\nclass NetTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 2\n\n    def run_test(self):\n        self._test_connection_count()\n        self._test_getnettotals()\n        self._test_getnetworkinginfo()\n        self._test_getaddednodeinfo()\n        self._test_getpeerinfo()\n\n    def _test_connection_count(self):\n        # connect_nodes_bi connects each node to the other\n        assert_equal(self.nodes[0].getconnectioncount(), 2)\n\n    def _test_getnettotals(self):\n        # getnettotals totalbytesrecv and totalbytessent should be\n        # consistent with getpeerinfo. Since the RPC calls are not atomic,\n        # and messages might have been recvd or sent between RPC calls, call\n        # getnettotals before and after and verify that the returned values\n        # from getpeerinfo are bounded by those values.\n        net_totals_before = self.nodes[0].getnettotals()\n        peer_info = self.nodes[0].getpeerinfo()\n        net_totals_after = self.nodes[0].getnettotals()\n        assert_equal(len(peer_info), 2)\n        peers_recv = sum([peer['bytesrecv'] for peer in peer_info])\n        peers_sent = sum([peer['bytessent'] for peer in peer_info])\n\n        assert_greater_than_or_equal(peers_recv, net_totals_before['totalbytesrecv'])\n        assert_greater_than_or_equal(net_totals_after['totalbytesrecv'], peers_recv)\n        assert_greater_than_or_equal(peers_sent, net_totals_before['totalbytessent'])\n        assert_greater_than_or_equal(net_totals_after['totalbytessent'], peers_sent)\n\n        # test getnettotals and getpeerinfo by doing a ping\n        # the bytes sent/received should change\n        # note ping and pong are 32 bytes each\n        self.nodes[0].ping()\n        wait_until(lambda: (self.nodes[0].getnettotals()['totalbytessent'] >= net_totals_after['totalbytessent'] + 32 * 2), timeout=1)\n        wait_until(lambda: (self.nodes[0].getnettotals()['totalbytesrecv'] >= net_totals_after['totalbytesrecv'] + 32 * 2), timeout=1)\n\n        peer_info_after_ping = self.nodes[0].getpeerinfo()\n        for before, after in zip(peer_info, peer_info_after_ping):\n            assert_greater_than_or_equal(after['bytesrecv_per_msg']['pong'], before['bytesrecv_per_msg']['pong'] + 32)\n            assert_greater_than_or_equal(after['bytessent_per_msg']['ping'], before['bytessent_per_msg']['ping'] + 32)\n\n    def _test_getnetworkinginfo(self):\n        assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], True)\n        assert_equal(self.nodes[0].getnetworkinfo()['connections'], 2)\n\n        self.nodes[0].setnetworkactive(False)\n        assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], False)\n        # Wait a bit for all sockets to close\n        wait_until(lambda: self.nodes[0].getnetworkinfo()['connections'] == 0, timeout=3)\n\n        self.nodes[0].setnetworkactive(True)\n        connect_nodes_bi(self.nodes, 0, 1)\n        assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], True)\n        assert_equal(self.nodes[0].getnetworkinfo()['connections'], 2)\n\n    def _test_getaddednodeinfo(self):\n        assert_equal(self.nodes[0].getaddednodeinfo(), [])\n        # add a node (node2) to node0\n        ip_port = \"127.0.0.1:{}\".format(p2p_port(2))\n        self.nodes[0].addnode(ip_port, 'add')\n        # check that the node has indeed been added\n        added_nodes = self.nodes[0].getaddednodeinfo(ip_port)\n        assert_equal(len(added_nodes), 1)\n        assert_equal(added_nodes[0]['addednode'], ip_port)\n        # check that a non-existent node returns an error\n        assert_raises_rpc_error(-24, \"Node has not been added\", self.nodes[0].getaddednodeinfo, '1.1.1.1')\n\n    def _test_getpeerinfo(self):\n        peer_info = [x.getpeerinfo() for x in self.nodes]\n        # check both sides of bidirectional connection between nodes\n        # the address bound to on one side will be the source address for the other node\n        assert_equal(peer_info[0][0]['addrbind'], peer_info[1][0]['addr'])\n        assert_equal(peer_info[1][0]['addrbind'], peer_info[0][0]['addr'])\n\nif __name__ == '__main__':\n    NetTest().main()\n"
  },
  {
    "path": "test/functional/rpc_preciousblock.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the preciousblock RPC.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    connect_nodes_bi,\n    sync_chain,\n    sync_blocks,\n)\n\ndef unidirectional_node_sync_via_rpc(node_src, node_dest):\n    blocks_to_copy = []\n    blockhash = node_src.getbestblockhash()\n    while True:\n        try:\n            assert(len(node_dest.getblock(blockhash, False)) > 0)\n            break\n        except:\n            blocks_to_copy.append(blockhash)\n            blockhash = node_src.getblockheader(blockhash, True)['previousblockhash']\n    blocks_to_copy.reverse()\n    for blockhash in blocks_to_copy:\n        blockdata = node_src.getblock(blockhash, False)\n        assert(node_dest.submitblock(blockdata) in (None, 'inconclusive'))\n\ndef node_sync_via_rpc(nodes):\n    for node_src in nodes:\n        for node_dest in nodes:\n            if node_src is node_dest:\n                continue\n            unidirectional_node_sync_via_rpc(node_src, node_dest)\n\nclass PreciousTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 3\n\n    def setup_network(self):\n        self.setup_nodes()\n\n    def run_test(self):\n        self.log.info(\"Ensure submitblock can in principle reorg to a competing chain\")\n        self.nodes[0].generate(1)\n        assert_equal(self.nodes[0].getblockcount(), 1)\n        hashZ = self.nodes[1].generate(2)[-1]\n        assert_equal(self.nodes[1].getblockcount(), 2)\n        node_sync_via_rpc(self.nodes[0:3])\n        assert_equal(self.nodes[0].getbestblockhash(), hashZ)\n\n        self.log.info(\"Mine blocks A-B-C on Node 0\")\n        hashC = self.nodes[0].generate(3)[-1]\n        assert_equal(self.nodes[0].getblockcount(), 5)\n        self.log.info(\"Mine competing blocks E-F-G on Node 1\")\n        hashG = self.nodes[1].generate(3)[-1]\n        assert_equal(self.nodes[1].getblockcount(), 5)\n        assert(hashC != hashG)\n        self.log.info(\"Connect nodes and check no reorg occurs\")\n        # Submit competing blocks via RPC so any reorg should occur before we proceed (no way to wait on inaction for p2p sync)\n        node_sync_via_rpc(self.nodes[0:2])\n        connect_nodes_bi(self.nodes,0,1)\n        assert_equal(self.nodes[0].getbestblockhash(), hashC)\n        assert_equal(self.nodes[1].getbestblockhash(), hashG)\n        self.log.info(\"Make Node0 prefer block G\")\n        self.nodes[0].preciousblock(hashG)\n        assert_equal(self.nodes[0].getbestblockhash(), hashG)\n        self.log.info(\"Make Node0 prefer block C again\")\n        self.nodes[0].preciousblock(hashC)\n        assert_equal(self.nodes[0].getbestblockhash(), hashC)\n        self.log.info(\"Make Node1 prefer block C\")\n        self.nodes[1].preciousblock(hashC)\n        sync_chain(self.nodes[0:2]) # wait because node 1 may not have downloaded hashC\n        assert_equal(self.nodes[1].getbestblockhash(), hashC)\n        self.log.info(\"Make Node1 prefer block G again\")\n        self.nodes[1].preciousblock(hashG)\n        assert_equal(self.nodes[1].getbestblockhash(), hashG)\n        self.log.info(\"Make Node0 prefer block G again\")\n        self.nodes[0].preciousblock(hashG)\n        assert_equal(self.nodes[0].getbestblockhash(), hashG)\n        self.log.info(\"Make Node1 prefer block C again\")\n        self.nodes[1].preciousblock(hashC)\n        assert_equal(self.nodes[1].getbestblockhash(), hashC)\n        self.log.info(\"Mine another block (E-F-G-)H on Node 0 and reorg Node 1\")\n        self.nodes[0].generate(1)\n        assert_equal(self.nodes[0].getblockcount(), 6)\n        sync_blocks(self.nodes[0:2])\n        hashH = self.nodes[0].getbestblockhash()\n        assert_equal(self.nodes[1].getbestblockhash(), hashH)\n        self.log.info(\"Node1 should not be able to prefer block C anymore\")\n        self.nodes[1].preciousblock(hashC)\n        assert_equal(self.nodes[1].getbestblockhash(), hashH)\n        self.log.info(\"Mine competing blocks I-J-K-L on Node 2\")\n        self.nodes[2].generate(4)\n        assert_equal(self.nodes[2].getblockcount(), 6)\n        hashL = self.nodes[2].getbestblockhash()\n        self.log.info(\"Connect nodes and check no reorg occurs\")\n        node_sync_via_rpc(self.nodes[1:3])\n        connect_nodes_bi(self.nodes,1,2)\n        connect_nodes_bi(self.nodes,0,2)\n        assert_equal(self.nodes[0].getbestblockhash(), hashH)\n        assert_equal(self.nodes[1].getbestblockhash(), hashH)\n        assert_equal(self.nodes[2].getbestblockhash(), hashL)\n        self.log.info(\"Make Node1 prefer block L\")\n        self.nodes[1].preciousblock(hashL)\n        assert_equal(self.nodes[1].getbestblockhash(), hashL)\n        self.log.info(\"Make Node2 prefer block H\")\n        self.nodes[2].preciousblock(hashH)\n        assert_equal(self.nodes[2].getbestblockhash(), hashH)\n\nif __name__ == '__main__':\n    PreciousTest().main()\n"
  },
  {
    "path": "test/functional/rpc_rawtransaction.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the rawtransaction RPCs.\n\nTest the following RPCs:\n   - createrawtransaction\n   - signrawtransaction\n   - sendrawtransaction\n   - decoderawtransaction\n   - getrawtransaction\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\n\nclass multidict(dict):\n    \"\"\"Dictionary that allows duplicate keys.\n\n    Constructed with a list of (key, value) tuples. When dumped by the json module,\n    will output invalid json with repeated keys, eg:\n    >>> json.dumps(multidict([(1,2),(1,2)])\n    '{\"1\": 2, \"1\": 2}'\n\n    Used to test calls to rpc methods with repeated keys in the json object.\"\"\"\n\n    def __init__(self, x):\n        dict.__init__(self, x)\n        self.x = x\n\n    def items(self):\n        return self.x\n\n\n# Create one-input, one-output, no-fee transaction:\nclass RawTransactionsTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 3\n        self.extra_args = [[\"-addresstype=legacy\"], [\"-addresstype=legacy\"], [\"-addresstype=legacy\"]]\n\n    def setup_network(self, split=False):\n        super().setup_network()\n        connect_nodes_bi(self.nodes,0,2)\n\n    def run_test(self):\n\n        #prepare some coins for multiple *rawtransaction commands\n        self.nodes[2].generate(1)\n        self.sync_all()\n        self.nodes[0].generate(101)\n        self.sync_all()\n        self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.5)\n        self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),1.0)\n        self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(),5.0)\n        self.sync_all()\n        self.nodes[0].generate(5)\n        self.sync_all()\n\n        # Test getrawtransaction on genesis block coinbase returns an error\n        block = self.nodes[0].getblock(self.nodes[0].getblockhash(0))\n        assert_raises_rpc_error(-5, \"The genesis block coinbase is not considered an ordinary transaction\", self.nodes[0].getrawtransaction, block['merkleroot'])\n\n        # Test `createrawtransaction` required parameters\n        assert_raises_rpc_error(-1, \"createrawtransaction\", self.nodes[0].createrawtransaction)\n        assert_raises_rpc_error(-1, \"createrawtransaction\", self.nodes[0].createrawtransaction, [])\n\n        # Test `createrawtransaction` invalid extra parameters\n        assert_raises_rpc_error(-1, \"createrawtransaction\", self.nodes[0].createrawtransaction, [], {}, 0, False, 'foo')\n\n        # Test `createrawtransaction` invalid `inputs`\n        txid = '1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000'\n        assert_raises_rpc_error(-3, \"Expected type array\", self.nodes[0].createrawtransaction, 'foo', {})\n        assert_raises_rpc_error(-1, \"JSON value is not an object as expected\", self.nodes[0].createrawtransaction, ['foo'], {})\n        assert_raises_rpc_error(-8, \"txid must be hexadecimal string\", self.nodes[0].createrawtransaction, [{}], {})\n        assert_raises_rpc_error(-8, \"txid must be hexadecimal string\", self.nodes[0].createrawtransaction, [{'txid': 'foo'}], {})\n        assert_raises_rpc_error(-8, \"Invalid parameter, missing vout key\", self.nodes[0].createrawtransaction, [{'txid': txid}], {})\n        assert_raises_rpc_error(-8, \"Invalid parameter, missing vout key\", self.nodes[0].createrawtransaction, [{'txid': txid, 'vout': 'foo'}], {})\n        assert_raises_rpc_error(-8, \"Invalid parameter, vout must be positive\", self.nodes[0].createrawtransaction, [{'txid': txid, 'vout': -1}], {})\n        assert_raises_rpc_error(-8, \"Invalid parameter, sequence number is out of range\", self.nodes[0].createrawtransaction, [{'txid': txid, 'vout': 0, 'sequence': -1}], {})\n\n        # Test `createrawtransaction` invalid `outputs`\n        address = self.nodes[0].getnewaddress()\n        assert_raises_rpc_error(-3, \"Expected type object\", self.nodes[0].createrawtransaction, [], 'foo')\n        assert_raises_rpc_error(-8, \"Data must be hexadecimal string\", self.nodes[0].createrawtransaction, [], {'data': 'foo'})\n        assert_raises_rpc_error(-5, \"Invalid Bitcoin address\", self.nodes[0].createrawtransaction, [], {'foo': 0})\n        assert_raises_rpc_error(-3, \"Invalid amount\", self.nodes[0].createrawtransaction, [], {address: 'foo'})\n        assert_raises_rpc_error(-3, \"Amount out of range\", self.nodes[0].createrawtransaction, [], {address: -1})\n        assert_raises_rpc_error(-8, \"Invalid parameter, duplicated address: %s\" % address, self.nodes[0].createrawtransaction, [], multidict([(address, 1), (address, 1)]))\n\n        # Test `createrawtransaction` invalid `locktime`\n        assert_raises_rpc_error(-3, \"Expected type number\", self.nodes[0].createrawtransaction, [], {}, 'foo')\n        assert_raises_rpc_error(-8, \"Invalid parameter, locktime out of range\", self.nodes[0].createrawtransaction, [], {}, -1)\n        assert_raises_rpc_error(-8, \"Invalid parameter, locktime out of range\", self.nodes[0].createrawtransaction, [], {}, 4294967296)\n\n        # Test `createrawtransaction` invalid `replaceable`\n        assert_raises_rpc_error(-3, \"Expected type bool\", self.nodes[0].createrawtransaction, [], {}, 0, 'foo')\n\n        for type in [\"bech32\", \"p2sh-segwit\", \"legacy\"]:\n            addr = self.nodes[0].getnewaddress(\"\", type)\n            addrinfo = self.nodes[0].validateaddress(addr)\n            pubkey = addrinfo[\"scriptPubKey\"]\n\n            self.log.info('sendrawtransaction with missing prevtx info (%s)' %(type))\n\n            # Test `signrawtransaction` invalid `prevtxs`\n            inputs  = [ {'txid' : txid, 'vout' : 3, 'sequence' : 1000}]\n            outputs = { self.nodes[0].getnewaddress() : 1 }\n            rawtx   = self.nodes[0].createrawtransaction(inputs, outputs)\n\n            prevtx = dict(txid=txid, scriptPubKey=pubkey, vout=3, amount=1)\n            succ = self.nodes[0].signrawtransaction(rawtx, [prevtx])\n            assert succ[\"complete\"]\n            if type == \"legacy\":\n                del prevtx[\"amount\"]\n                succ = self.nodes[0].signrawtransaction(rawtx, [prevtx])\n                assert succ[\"complete\"]\n\n            if type != \"legacy\":\n                assert_raises_rpc_error(-3, \"Missing amount\", self.nodes[0].signrawtransaction, rawtx, [\n                    {\n                        \"txid\": txid,\n                        \"scriptPubKey\": pubkey,\n                        \"vout\": 3,\n                    }\n                ])\n\n            assert_raises_rpc_error(-3, \"Missing vout\", self.nodes[0].signrawtransaction, rawtx, [\n                {\n                    \"txid\": txid,\n                    \"scriptPubKey\": pubkey,\n                    \"amount\": 1,\n                }\n            ])\n            assert_raises_rpc_error(-3, \"Missing txid\", self.nodes[0].signrawtransaction, rawtx, [\n                {\n                    \"scriptPubKey\": pubkey,\n                    \"vout\": 3,\n                    \"amount\": 1,\n                }\n            ])\n            assert_raises_rpc_error(-3, \"Missing scriptPubKey\", self.nodes[0].signrawtransaction, rawtx, [\n                {\n                    \"txid\": txid,\n                    \"vout\": 3,\n                    \"amount\": 1\n                }\n            ])\n\n        #########################################\n        # sendrawtransaction with missing input #\n        #########################################\n        inputs  = [ {'txid' : \"1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000\", 'vout' : 1}] #won't exists\n        outputs = { self.nodes[0].getnewaddress() : 4.998 }\n        rawtx   = self.nodes[2].createrawtransaction(inputs, outputs)\n        rawtx   = self.nodes[2].signrawtransaction(rawtx)\n\n        # This will raise an exception since there are missing inputs\n        assert_raises_rpc_error(-25, \"Missing inputs\", self.nodes[2].sendrawtransaction, rawtx['hex'])\n\n        #####################################\n        # getrawtransaction with block hash #\n        #####################################\n\n        # make a tx by sending then generate 2 blocks; block1 has the tx in it\n        tx = self.nodes[2].sendtoaddress(self.nodes[1].getnewaddress(), 1)\n        block1, block2 = self.nodes[2].generate(2)\n        self.sync_all()\n        # We should be able to get the raw transaction by providing the correct block\n        gottx = self.nodes[0].getrawtransaction(tx, True, block1)\n        assert_equal(gottx['txid'], tx)\n        assert_equal(gottx['in_active_chain'], True)\n        # We should not have the 'in_active_chain' flag when we don't provide a block\n        gottx = self.nodes[0].getrawtransaction(tx, True)\n        assert_equal(gottx['txid'], tx)\n        assert 'in_active_chain' not in gottx\n        # We should not get the tx if we provide an unrelated block\n        assert_raises_rpc_error(-5, \"No such transaction found\", self.nodes[0].getrawtransaction, tx, True, block2)\n        # An invalid block hash should raise the correct errors\n        assert_raises_rpc_error(-8, \"parameter 3 must be hexadecimal\", self.nodes[0].getrawtransaction, tx, True, True)\n        assert_raises_rpc_error(-8, \"parameter 3 must be hexadecimal\", self.nodes[0].getrawtransaction, tx, True, \"foobar\")\n        assert_raises_rpc_error(-8, \"parameter 3 must be of length 64\", self.nodes[0].getrawtransaction, tx, True, \"abcd1234\")\n        assert_raises_rpc_error(-5, \"Block hash not found\", self.nodes[0].getrawtransaction, tx, True, \"0000000000000000000000000000000000000000000000000000000000000000\")\n        # Undo the blocks and check in_active_chain\n        self.nodes[0].invalidateblock(block1)\n        gottx = self.nodes[0].getrawtransaction(txid=tx, verbose=True, blockhash=block1)\n        assert_equal(gottx['in_active_chain'], False)\n        self.nodes[0].reconsiderblock(block1)\n        assert_equal(self.nodes[0].getbestblockhash(), block2)\n\n        #########################\n        # RAW TX MULTISIG TESTS #\n        #########################\n        # 2of2 test\n        addr1 = self.nodes[2].getnewaddress()\n        addr2 = self.nodes[2].getnewaddress()\n\n        addr1Obj = self.nodes[2].validateaddress(addr1)\n        addr2Obj = self.nodes[2].validateaddress(addr2)\n\n        # Tests for createmultisig and addmultisigaddress\n        assert_raises_rpc_error(-5, \"Invalid public key\", self.nodes[0].createmultisig, 1, [\"01020304\"])\n        self.nodes[0].createmultisig(2, [addr1Obj['pubkey'], addr2Obj['pubkey']]) # createmultisig can only take public keys\n        assert_raises_rpc_error(-5, \"Invalid public key\", self.nodes[0].createmultisig, 2, [addr1Obj['pubkey'], addr1]) # addmultisigaddress can take both pubkeys and addresses so long as they are in the wallet, which is tested here.\n\n        mSigObj = self.nodes[2].addmultisigaddress(2, [addr1Obj['pubkey'], addr1])['address']\n\n        #use balance deltas instead of absolute values\n        bal = self.nodes[2].getbalance()\n\n        # send 1.2 BTC to msig adr\n        txId = self.nodes[0].sendtoaddress(mSigObj, 1.2)\n        self.sync_all()\n        self.nodes[0].generate(1)\n        self.sync_all()\n        assert_equal(self.nodes[2].getbalance(), bal+Decimal('1.20000000')) #node2 has both keys of the 2of2 ms addr., tx should affect the balance\n\n\n        # 2of3 test from different nodes\n        bal = self.nodes[2].getbalance()\n        addr1 = self.nodes[1].getnewaddress()\n        addr2 = self.nodes[2].getnewaddress()\n        addr3 = self.nodes[2].getnewaddress()\n\n        addr1Obj = self.nodes[1].validateaddress(addr1)\n        addr2Obj = self.nodes[2].validateaddress(addr2)\n        addr3Obj = self.nodes[2].validateaddress(addr3)\n\n        mSigObj = self.nodes[2].addmultisigaddress(2, [addr1Obj['pubkey'], addr2Obj['pubkey'], addr3Obj['pubkey']])['address']\n\n        txId = self.nodes[0].sendtoaddress(mSigObj, 2.2)\n        decTx = self.nodes[0].gettransaction(txId)\n        rawTx = self.nodes[0].decoderawtransaction(decTx['hex'])\n        self.sync_all()\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        #THIS IS A INCOMPLETE FEATURE\n        #NODE2 HAS TWO OF THREE KEY AND THE FUNDS SHOULD BE SPENDABLE AND COUNT AT BALANCE CALCULATION\n        assert_equal(self.nodes[2].getbalance(), bal) #for now, assume the funds of a 2of3 multisig tx are not marked as spendable\n\n        txDetails = self.nodes[0].gettransaction(txId, True)\n        rawTx = self.nodes[0].decoderawtransaction(txDetails['hex'])\n        vout = False\n        for outpoint in rawTx['vout']:\n            if outpoint['value'] == Decimal('2.20000000'):\n                vout = outpoint\n                break\n\n        bal = self.nodes[0].getbalance()\n        inputs = [{ \"txid\" : txId, \"vout\" : vout['n'], \"scriptPubKey\" : vout['scriptPubKey']['hex'], \"amount\" : vout['value']}]\n        outputs = { self.nodes[0].getnewaddress() : 2.19 }\n        rawTx = self.nodes[2].createrawtransaction(inputs, outputs)\n        rawTxPartialSigned = self.nodes[1].signrawtransaction(rawTx, inputs)\n        assert_equal(rawTxPartialSigned['complete'], False) #node1 only has one key, can't comp. sign the tx\n\n        rawTxSigned = self.nodes[2].signrawtransaction(rawTx, inputs)\n        assert_equal(rawTxSigned['complete'], True) #node2 can sign the tx compl., own two of three keys\n        self.nodes[2].sendrawtransaction(rawTxSigned['hex'])\n        rawTx = self.nodes[0].decoderawtransaction(rawTxSigned['hex'])\n        self.sync_all()\n        self.nodes[0].generate(1)\n        self.sync_all()\n        assert_equal(self.nodes[0].getbalance(), bal+Decimal('50.00000000')+Decimal('2.19000000')) #block reward + tx\n\n        # 2of2 test for combining transactions\n        bal = self.nodes[2].getbalance()\n        addr1 = self.nodes[1].getnewaddress()\n        addr2 = self.nodes[2].getnewaddress()\n\n        addr1Obj = self.nodes[1].validateaddress(addr1)\n        addr2Obj = self.nodes[2].validateaddress(addr2)\n\n        self.nodes[1].addmultisigaddress(2, [addr1Obj['pubkey'], addr2Obj['pubkey']])['address']\n        mSigObj = self.nodes[2].addmultisigaddress(2, [addr1Obj['pubkey'], addr2Obj['pubkey']])['address']\n        mSigObjValid = self.nodes[2].validateaddress(mSigObj)\n\n        txId = self.nodes[0].sendtoaddress(mSigObj, 2.2)\n        decTx = self.nodes[0].gettransaction(txId)\n        rawTx2 = self.nodes[0].decoderawtransaction(decTx['hex'])\n        self.sync_all()\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        assert_equal(self.nodes[2].getbalance(), bal) # the funds of a 2of2 multisig tx should not be marked as spendable\n\n        txDetails = self.nodes[0].gettransaction(txId, True)\n        rawTx2 = self.nodes[0].decoderawtransaction(txDetails['hex'])\n        vout = False\n        for outpoint in rawTx2['vout']:\n            if outpoint['value'] == Decimal('2.20000000'):\n                vout = outpoint\n                break\n\n        bal = self.nodes[0].getbalance()\n        inputs = [{ \"txid\" : txId, \"vout\" : vout['n'], \"scriptPubKey\" : vout['scriptPubKey']['hex'], \"redeemScript\" : mSigObjValid['hex'], \"amount\" : vout['value']}]\n        outputs = { self.nodes[0].getnewaddress() : 2.19 }\n        rawTx2 = self.nodes[2].createrawtransaction(inputs, outputs)\n        rawTxPartialSigned1 = self.nodes[1].signrawtransaction(rawTx2, inputs)\n        self.log.info(rawTxPartialSigned1)\n        assert_equal(rawTxPartialSigned['complete'], False) #node1 only has one key, can't comp. sign the tx\n\n        rawTxPartialSigned2 = self.nodes[2].signrawtransaction(rawTx2, inputs)\n        self.log.info(rawTxPartialSigned2)\n        assert_equal(rawTxPartialSigned2['complete'], False) #node2 only has one key, can't comp. sign the tx\n        rawTxComb = self.nodes[2].combinerawtransaction([rawTxPartialSigned1['hex'], rawTxPartialSigned2['hex']])\n        self.log.info(rawTxComb)\n        self.nodes[2].sendrawtransaction(rawTxComb)\n        rawTx2 = self.nodes[0].decoderawtransaction(rawTxComb)\n        self.sync_all()\n        self.nodes[0].generate(1)\n        self.sync_all()\n        assert_equal(self.nodes[0].getbalance(), bal+Decimal('50.00000000')+Decimal('2.19000000')) #block reward + tx\n\n        # decoderawtransaction tests\n        # witness transaction\n        encrawtx = \"010000000001010000000000000072c1a6a246ae63f74f931e8365e15a089c68d61900000000000000000000ffffffff0100e1f50500000000000000000000\"\n        decrawtx = self.nodes[0].decoderawtransaction(encrawtx, True) # decode as witness transaction\n        assert_equal(decrawtx['vout'][0]['value'], Decimal('1.00000000'))\n        assert_raises_rpc_error(-22, 'TX decode failed', self.nodes[0].decoderawtransaction, encrawtx, False) # force decode as non-witness transaction\n        # non-witness transaction\n        encrawtx = \"01000000010000000000000072c1a6a246ae63f74f931e8365e15a089c68d61900000000000000000000ffffffff0100e1f505000000000000000000\"\n        decrawtx = self.nodes[0].decoderawtransaction(encrawtx, False) # decode as non-witness transaction\n        assert_equal(decrawtx['vout'][0]['value'], Decimal('1.00000000'))\n        \n        # getrawtransaction tests\n        # 1. valid parameters - only supply txid\n        txHash = rawTx[\"hash\"]\n        assert_equal(self.nodes[0].getrawtransaction(txHash), rawTxSigned['hex'])\n\n        # 2. valid parameters - supply txid and 0 for non-verbose\n        assert_equal(self.nodes[0].getrawtransaction(txHash, 0), rawTxSigned['hex'])\n\n        # 3. valid parameters - supply txid and False for non-verbose\n        assert_equal(self.nodes[0].getrawtransaction(txHash, False), rawTxSigned['hex'])\n\n        # 4. valid parameters - supply txid and 1 for verbose.\n        # We only check the \"hex\" field of the output so we don't need to update this test every time the output format changes.\n        assert_equal(self.nodes[0].getrawtransaction(txHash, 1)[\"hex\"], rawTxSigned['hex'])\n\n        # 5. valid parameters - supply txid and True for non-verbose\n        assert_equal(self.nodes[0].getrawtransaction(txHash, True)[\"hex\"], rawTxSigned['hex'])\n\n        # 6. invalid parameters - supply txid and string \"Flase\"\n        assert_raises_rpc_error(-1, \"not a boolean\", self.nodes[0].getrawtransaction, txHash, \"Flase\")\n\n        # 7. invalid parameters - supply txid and empty array\n        assert_raises_rpc_error(-1, \"not a boolean\", self.nodes[0].getrawtransaction, txHash, [])\n\n        # 8. invalid parameters - supply txid and empty dict\n        assert_raises_rpc_error(-1, \"not a boolean\", self.nodes[0].getrawtransaction, txHash, {})\n\n        inputs  = [ {'txid' : \"1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000\", 'vout' : 1, 'sequence' : 1000}]\n        outputs = { self.nodes[0].getnewaddress() : 1 }\n        rawtx   = self.nodes[0].createrawtransaction(inputs, outputs)\n        decrawtx= self.nodes[0].decoderawtransaction(rawtx)\n        assert_equal(decrawtx['vin'][0]['sequence'], 1000)\n\n        # 9. invalid parameters - sequence number out of range\n        inputs  = [ {'txid' : \"1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000\", 'vout' : 1, 'sequence' : -1}]\n        outputs = { self.nodes[0].getnewaddress() : 1 }\n        assert_raises_rpc_error(-8, 'Invalid parameter, sequence number is out of range', self.nodes[0].createrawtransaction, inputs, outputs)\n\n        # 10. invalid parameters - sequence number out of range\n        inputs  = [ {'txid' : \"1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000\", 'vout' : 1, 'sequence' : 4294967296}]\n        outputs = { self.nodes[0].getnewaddress() : 1 }\n        assert_raises_rpc_error(-8, 'Invalid parameter, sequence number is out of range', self.nodes[0].createrawtransaction, inputs, outputs)\n\n        inputs  = [ {'txid' : \"1d1d4e24ed99057e84c3f80fd8fbec79ed9e1acee37da269356ecea000000000\", 'vout' : 1, 'sequence' : 4294967294}]\n        outputs = { self.nodes[0].getnewaddress() : 1 }\n        rawtx   = self.nodes[0].createrawtransaction(inputs, outputs)\n        decrawtx= self.nodes[0].decoderawtransaction(rawtx)\n        assert_equal(decrawtx['vin'][0]['sequence'], 4294967294)\n\nif __name__ == '__main__':\n    RawTransactionsTest().main()\n"
  },
  {
    "path": "test/functional/rpc_signmessage.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test RPC commands for signing and verifying messages.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal\n\nclass SignMessagesTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n        self.extra_args = [[\"-addresstype=legacy\"]]\n\n    def run_test(self):\n        message = 'This is just a test message'\n\n        self.log.info('test signing with priv_key')\n        priv_key = 'cUeKHd5orzT3mz8P9pxyREHfsWtVfgsfDjiZZBcjUBAaGk1BTj7N'\n        address = 'mpLQjfK79b7CCV4VMJWEWAj5Mpx8Up5zxB'\n        expected_signature = 'INbVnW4e6PeRmsv2Qgu8NuopvrVjkcxob+sX8OcZG0SALhWybUjzMLPdAsXI46YZGb0KQTRii+wWIQzRpG/U+S0='\n        signature = self.nodes[0].signmessagewithprivkey(priv_key, message)\n        assert_equal(expected_signature, signature)\n        assert(self.nodes[0].verifymessage(address, signature, message))\n\n        self.log.info('test signing with an address with wallet')\n        address = self.nodes[0].getnewaddress()\n        signature = self.nodes[0].signmessage(address, message)\n        assert(self.nodes[0].verifymessage(address, signature, message))\n\n        self.log.info('test verifying with another address should not work')\n        other_address = self.nodes[0].getnewaddress()\n        other_signature = self.nodes[0].signmessage(other_address, message)\n        assert(not self.nodes[0].verifymessage(other_address, signature, message))\n        assert(not self.nodes[0].verifymessage(address, other_signature, message))\n\nif __name__ == '__main__':\n    SignMessagesTest().main()\n"
  },
  {
    "path": "test/functional/rpc_signrawtransaction.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test transaction signing using the signrawtransaction RPC.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\n\nclass SignRawTransactionsTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    def successful_signing_test(self):\n        \"\"\"Create and sign a valid raw transaction with one input.\n\n        Expected results:\n\n        1) The transaction has a complete set of signatures\n        2) No script verification error occurred\"\"\"\n        privKeys = ['cUeKHd5orzT3mz8P9pxyREHfsWtVfgsfDjiZZBcjUBAaGk1BTj7N', 'cVKpPfVKSJxKqVpE9awvXNWuLHCa5j5tiE7K6zbUSptFpTEtiFrA']\n\n        inputs = [\n            # Valid pay-to-pubkey scripts\n            {'txid': '9b907ef1e3c26fc71fe4a4b3580bc75264112f95050014157059c736f0202e71', 'vout': 0,\n             'scriptPubKey': '76a91460baa0f494b38ce3c940dea67f3804dc52d1fb9488ac'},\n            {'txid': '83a4f6a6b73660e13ee6cb3c6063fa3759c50c9b7521d0536022961898f4fb02', 'vout': 0,\n             'scriptPubKey': '76a914669b857c03a5ed269d5d85a1ffac9ed5d663072788ac'},\n        ]\n\n        outputs = {'mpLQjfK79b7CCV4VMJWEWAj5Mpx8Up5zxB': 0.1}\n\n        rawTx = self.nodes[0].createrawtransaction(inputs, outputs)\n        rawTxSigned = self.nodes[0].signrawtransaction(rawTx, inputs, privKeys)\n\n        # 1) The transaction has a complete set of signatures\n        assert 'complete' in rawTxSigned\n        assert_equal(rawTxSigned['complete'], True)\n\n        # 2) No script verification error occurred\n        assert 'errors' not in rawTxSigned\n\n    def script_verification_error_test(self):\n        \"\"\"Create and sign a raw transaction with valid (vin 0), invalid (vin 1) and one missing (vin 2) input script.\n\n        Expected results:\n\n        3) The transaction has no complete set of signatures\n        4) Two script verification errors occurred\n        5) Script verification errors have certain properties (\"txid\", \"vout\", \"scriptSig\", \"sequence\", \"error\")\n        6) The verification errors refer to the invalid (vin 1) and missing input (vin 2)\"\"\"\n        privKeys = ['cUeKHd5orzT3mz8P9pxyREHfsWtVfgsfDjiZZBcjUBAaGk1BTj7N']\n\n        inputs = [\n            # Valid pay-to-pubkey script\n            {'txid': '9b907ef1e3c26fc71fe4a4b3580bc75264112f95050014157059c736f0202e71', 'vout': 0},\n            # Invalid script\n            {'txid': '5b8673686910442c644b1f4993d8f7753c7c8fcb5c87ee40d56eaeef25204547', 'vout': 7},\n            # Missing scriptPubKey\n            {'txid': '9b907ef1e3c26fc71fe4a4b3580bc75264112f95050014157059c736f0202e71', 'vout': 1},\n        ]\n\n        scripts = [\n            # Valid pay-to-pubkey script\n            {'txid': '9b907ef1e3c26fc71fe4a4b3580bc75264112f95050014157059c736f0202e71', 'vout': 0,\n             'scriptPubKey': '76a91460baa0f494b38ce3c940dea67f3804dc52d1fb9488ac'},\n            # Invalid script\n            {'txid': '5b8673686910442c644b1f4993d8f7753c7c8fcb5c87ee40d56eaeef25204547', 'vout': 7,\n             'scriptPubKey': 'badbadbadbad'}\n        ]\n\n        outputs = {'mpLQjfK79b7CCV4VMJWEWAj5Mpx8Up5zxB': 0.1}\n\n        rawTx = self.nodes[0].createrawtransaction(inputs, outputs)\n\n        # Make sure decoderawtransaction is at least marginally sane\n        decodedRawTx = self.nodes[0].decoderawtransaction(rawTx)\n        for i, inp in enumerate(inputs):\n            assert_equal(decodedRawTx[\"vin\"][i][\"txid\"], inp[\"txid\"])\n            assert_equal(decodedRawTx[\"vin\"][i][\"vout\"], inp[\"vout\"])\n\n        # Make sure decoderawtransaction throws if there is extra data\n        assert_raises_rpc_error(-22, \"TX decode failed\", self.nodes[0].decoderawtransaction, rawTx + \"00\")\n\n        rawTxSigned = self.nodes[0].signrawtransaction(rawTx, scripts, privKeys)\n\n        # 3) The transaction has no complete set of signatures\n        assert 'complete' in rawTxSigned\n        assert_equal(rawTxSigned['complete'], False)\n\n        # 4) Two script verification errors occurred\n        assert 'errors' in rawTxSigned\n        assert_equal(len(rawTxSigned['errors']), 2)\n\n        # 5) Script verification errors have certain properties\n        assert 'txid' in rawTxSigned['errors'][0]\n        assert 'vout' in rawTxSigned['errors'][0]\n        assert 'witness' in rawTxSigned['errors'][0]\n        assert 'scriptSig' in rawTxSigned['errors'][0]\n        assert 'sequence' in rawTxSigned['errors'][0]\n        assert 'error' in rawTxSigned['errors'][0]\n\n        # 6) The verification errors refer to the invalid (vin 1) and missing input (vin 2)\n        assert_equal(rawTxSigned['errors'][0]['txid'], inputs[1]['txid'])\n        assert_equal(rawTxSigned['errors'][0]['vout'], inputs[1]['vout'])\n        assert_equal(rawTxSigned['errors'][1]['txid'], inputs[2]['txid'])\n        assert_equal(rawTxSigned['errors'][1]['vout'], inputs[2]['vout'])\n        assert not rawTxSigned['errors'][0]['witness']\n\n        # Now test signing failure for transaction with input witnesses\n        p2wpkh_raw_tx = \"01000000000102fff7f7881a8099afa6940d42d1e7f6362bec38171ea3edf433541db4e4ad969f00000000494830450221008b9d1dc26ba6a9cb62127b02742fa9d754cd3bebf337f7a55d114c8e5cdd30be022040529b194ba3f9281a99f2b1c0a19c0489bc22ede944ccf4ecbab4cc618ef3ed01eeffffffef51e1b804cc89d182d279655c3aa89e815b1b309fe287d9b2b55d57b90ec68a0100000000ffffffff02202cb206000000001976a9148280b37df378db99f66f85c95a783a76ac7a6d5988ac9093510d000000001976a9143bde42dbee7e4dbe6a21b2d50ce2f0167faa815988ac000247304402203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a0220573a954c4518331561406f90300e8f3358f51928d43c212a8caed02de67eebee0121025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee635711000000\"\n\n        rawTxSigned = self.nodes[0].signrawtransaction(p2wpkh_raw_tx)\n\n        # 7) The transaction has no complete set of signatures\n        assert 'complete' in rawTxSigned\n        assert_equal(rawTxSigned['complete'], False)\n\n        # 8) Two script verification errors occurred\n        assert 'errors' in rawTxSigned\n        assert_equal(len(rawTxSigned['errors']), 2)\n\n        # 9) Script verification errors have certain properties\n        assert 'txid' in rawTxSigned['errors'][0]\n        assert 'vout' in rawTxSigned['errors'][0]\n        assert 'witness' in rawTxSigned['errors'][0]\n        assert 'scriptSig' in rawTxSigned['errors'][0]\n        assert 'sequence' in rawTxSigned['errors'][0]\n        assert 'error' in rawTxSigned['errors'][0]\n\n        # Non-empty witness checked here\n        assert_equal(rawTxSigned['errors'][1]['witness'], [\"304402203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a0220573a954c4518331561406f90300e8f3358f51928d43c212a8caed02de67eebee01\", \"025476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357\"])\n        assert not rawTxSigned['errors'][0]['witness']\n\n    def run_test(self):\n        self.successful_signing_test()\n        self.script_verification_error_test()\n\n\nif __name__ == '__main__':\n    SignRawTransactionsTest().main()\n"
  },
  {
    "path": "test/functional/rpc_txoutproof.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test gettxoutproof and verifytxoutproof RPCs.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\nfrom test_framework.mininode import FromHex, ToHex\nfrom test_framework.messages import CMerkleBlock\n\nclass MerkleBlockTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 4\n        self.setup_clean_chain = True\n        # Nodes 0/1 are \"wallet\" nodes, Nodes 2/3 are used for testing\n        self.extra_args = [[], [], [], [\"-txindex\"]]\n\n    def setup_network(self):\n        self.setup_nodes()\n        connect_nodes(self.nodes[0], 1)\n        connect_nodes(self.nodes[0], 2)\n        connect_nodes(self.nodes[0], 3)\n\n        self.sync_all()\n\n    def run_test(self):\n        self.log.info(\"Mining blocks...\")\n        self.nodes[0].generate(105)\n        self.sync_all()\n\n        chain_height = self.nodes[1].getblockcount()\n        assert_equal(chain_height, 105)\n        assert_equal(self.nodes[1].getbalance(), 0)\n        assert_equal(self.nodes[2].getbalance(), 0)\n\n        node0utxos = self.nodes[0].listunspent(1)\n        tx1 = self.nodes[0].createrawtransaction([node0utxos.pop()], {self.nodes[1].getnewaddress(): 49.99})\n        txid1 = self.nodes[0].sendrawtransaction(self.nodes[0].signrawtransaction(tx1)[\"hex\"])\n        tx2 = self.nodes[0].createrawtransaction([node0utxos.pop()], {self.nodes[1].getnewaddress(): 49.99})\n        txid2 = self.nodes[0].sendrawtransaction(self.nodes[0].signrawtransaction(tx2)[\"hex\"])\n        # This will raise an exception because the transaction is not yet in a block\n        assert_raises_rpc_error(-5, \"Transaction not yet in block\", self.nodes[0].gettxoutproof, [txid1])\n\n        self.nodes[0].generate(1)\n        blockhash = self.nodes[0].getblockhash(chain_height + 1)\n        self.sync_all()\n\n        txlist = []\n        blocktxn = self.nodes[0].getblock(blockhash, True)[\"tx\"]\n        txlist.append(blocktxn[1])\n        txlist.append(blocktxn[2])\n\n        assert_equal(self.nodes[2].verifytxoutproof(self.nodes[2].gettxoutproof([txid1])), [txid1])\n        assert_equal(self.nodes[2].verifytxoutproof(self.nodes[2].gettxoutproof([txid1, txid2])), txlist)\n        assert_equal(self.nodes[2].verifytxoutproof(self.nodes[2].gettxoutproof([txid1, txid2], blockhash)), txlist)\n\n        txin_spent = self.nodes[1].listunspent(1).pop()\n        tx3 = self.nodes[1].createrawtransaction([txin_spent], {self.nodes[0].getnewaddress(): 49.98})\n        txid3 = self.nodes[0].sendrawtransaction(self.nodes[1].signrawtransaction(tx3)[\"hex\"])\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        txid_spent = txin_spent[\"txid\"]\n        txid_unspent = txid1 if txin_spent[\"txid\"] != txid1 else txid2\n\n        # We can't find the block from a fully-spent tx\n        assert_raises_rpc_error(-5, \"Transaction not yet in block\", self.nodes[2].gettxoutproof, [txid_spent])\n        # We can get the proof if we specify the block\n        assert_equal(self.nodes[2].verifytxoutproof(self.nodes[2].gettxoutproof([txid_spent], blockhash)), [txid_spent])\n        # We can't get the proof if we specify a non-existent block\n        assert_raises_rpc_error(-5, \"Block not found\", self.nodes[2].gettxoutproof, [txid_spent], \"00000000000000000000000000000000\")\n        # We can get the proof if the transaction is unspent\n        assert_equal(self.nodes[2].verifytxoutproof(self.nodes[2].gettxoutproof([txid_unspent])), [txid_unspent])\n        # We can get the proof if we provide a list of transactions and one of them is unspent. The ordering of the list should not matter.\n        assert_equal(sorted(self.nodes[2].verifytxoutproof(self.nodes[2].gettxoutproof([txid1, txid2]))), sorted(txlist))\n        assert_equal(sorted(self.nodes[2].verifytxoutproof(self.nodes[2].gettxoutproof([txid2, txid1]))), sorted(txlist))\n        # We can always get a proof if we have a -txindex\n        assert_equal(self.nodes[2].verifytxoutproof(self.nodes[3].gettxoutproof([txid_spent])), [txid_spent])\n        # We can't get a proof if we specify transactions from different blocks\n        assert_raises_rpc_error(-5, \"Not all transactions found in specified or retrieved block\", self.nodes[2].gettxoutproof, [txid1, txid3])\n\n        # Now we'll try tweaking a proof.\n        proof = self.nodes[3].gettxoutproof([txid1, txid2])\n        assert txid1 in self.nodes[0].verifytxoutproof(proof)\n        assert txid2 in self.nodes[1].verifytxoutproof(proof)\n\n        tweaked_proof = FromHex(CMerkleBlock(), proof)\n\n        # Make sure that our serialization/deserialization is working\n        assert txid1 in self.nodes[2].verifytxoutproof(ToHex(tweaked_proof))\n\n        # Check to see if we can go up the merkle tree and pass this off as a\n        # single-transaction block\n        tweaked_proof.txn.nTransactions = 1\n        tweaked_proof.txn.vHash = [tweaked_proof.header.hashMerkleRoot]\n        tweaked_proof.txn.vBits = [True] + [False]*7\n\n        for n in self.nodes:\n            assert not n.verifytxoutproof(ToHex(tweaked_proof))\n\n        # TODO: try more variants, eg transactions at different depths, and\n        # verify that the proofs are invalid\n\nif __name__ == '__main__':\n    MerkleBlockTest().main()\n"
  },
  {
    "path": "test/functional/rpc_uptime.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the RPC call related to the uptime command.\n\nTest corresponds to code in rpc/server.cpp.\n\"\"\"\n\nimport time\n\nfrom test_framework.test_framework import BitcoinTestFramework\n\n\nclass UptimeTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.setup_clean_chain = True\n\n    def run_test(self):\n        self._test_uptime()\n\n    def _test_uptime(self):\n        wait_time = 10\n        self.nodes[0].setmocktime(int(time.time() + wait_time))\n        assert(self.nodes[0].uptime() >= wait_time)\n\n\nif __name__ == '__main__':\n    UptimeTest().main()\n"
  },
  {
    "path": "test/functional/rpc_users.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test multiple RPC users.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import str_to_b64str, assert_equal\n\nimport os\nimport http.client\nimport urllib.parse\n\nclass HTTPBasicsTest (BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n\n    def setup_chain(self):\n        super().setup_chain()\n        #Append rpcauth to bitcoin.conf before initialization\n        rpcauth = \"rpcauth=rt:93648e835a54c573682c2eb19f882535$7681e9c5b74bdd85e78166031d2058e1069b3ed7ed967c93fc63abba06f31144\"\n        rpcauth2 = \"rpcauth=rt2:f8607b1a88861fac29dfccf9b52ff9f$ff36a0c23c8c62b4846112e50fa888416e94c17bfd4c42f88fd8f55ec6a3137e\"\n        rpcuser = \"rpcuser=rpcuser💻\"\n        rpcpassword = \"rpcpassword=rpcpassword🔑\"\n        with open(os.path.join(self.options.tmpdir+\"/node0\", \"bitcoin.conf\"), 'a', encoding='utf8') as f:\n            f.write(rpcauth+\"\\n\")\n            f.write(rpcauth2+\"\\n\")\n        with open(os.path.join(self.options.tmpdir+\"/node1\", \"bitcoin.conf\"), 'a', encoding='utf8') as f:\n            f.write(rpcuser+\"\\n\")\n            f.write(rpcpassword+\"\\n\")\n\n    def run_test(self):\n\n        ##################################################\n        # Check correctness of the rpcauth config option #\n        ##################################################\n        url = urllib.parse.urlparse(self.nodes[0].url)\n\n        #Old authpair\n        authpair = url.username + ':' + url.password\n\n        #New authpair generated via share/rpcuser tool\n        password = \"cA773lm788buwYe4g4WT+05pKyNruVKjQ25x3n0DQcM=\"\n\n        #Second authpair with different username\n        password2 = \"8/F3uMDw4KSEbw96U3CA1C4X05dkHDN2BPFjTgZW4KI=\"\n        authpairnew = \"rt:\"+password\n\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpair)}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        resp = conn.getresponse()\n        assert_equal(resp.status, 200)\n        conn.close()\n        \n        #Use new authpair to confirm both work\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpairnew)}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        resp = conn.getresponse()\n        assert_equal(resp.status, 200)\n        conn.close()\n\n        #Wrong login name with rt's password\n        authpairnew = \"rtwrong:\"+password\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpairnew)}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        resp = conn.getresponse()\n        assert_equal(resp.status, 401)\n        conn.close()\n\n        #Wrong password for rt\n        authpairnew = \"rt:\"+password+\"wrong\"\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpairnew)}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        resp = conn.getresponse()\n        assert_equal(resp.status, 401)\n        conn.close()\n\n        #Correct for rt2\n        authpairnew = \"rt2:\"+password2\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpairnew)}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        resp = conn.getresponse()\n        assert_equal(resp.status, 200)\n        conn.close()\n\n        #Wrong password for rt2\n        authpairnew = \"rt2:\"+password2+\"wrong\"\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(authpairnew)}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        resp = conn.getresponse()\n        assert_equal(resp.status, 401)\n        conn.close()\n\n        ###############################################################\n        # Check correctness of the rpcuser/rpcpassword config options #\n        ###############################################################\n        url = urllib.parse.urlparse(self.nodes[1].url)\n\n        # rpcuser and rpcpassword authpair\n        rpcuserauthpair = \"rpcuser💻:rpcpassword🔑\"\n\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(rpcuserauthpair)}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        resp = conn.getresponse()\n        assert_equal(resp.status, 200)\n        conn.close()\n\n        #Wrong login name with rpcuser's password\n        rpcuserauthpair = \"rpcuserwrong:rpcpassword\"\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(rpcuserauthpair)}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        resp = conn.getresponse()\n        assert_equal(resp.status, 401)\n        conn.close()\n\n        #Wrong password for rpcuser\n        rpcuserauthpair = \"rpcuser:rpcpasswordwrong\"\n        headers = {\"Authorization\": \"Basic \" + str_to_b64str(rpcuserauthpair)}\n\n        conn = http.client.HTTPConnection(url.hostname, url.port)\n        conn.connect()\n        conn.request('POST', '/', '{\"method\": \"getbestblockhash\"}', headers)\n        resp = conn.getresponse()\n        assert_equal(resp.status, 401)\n        conn.close()\n\n\nif __name__ == '__main__':\n    HTTPBasicsTest ().main ()\n"
  },
  {
    "path": "test/functional/test_framework/__init__.py",
    "content": ""
  },
  {
    "path": "test/functional/test_framework/address.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Encode and decode BASE58, P2PKH and P2SH addresses.\"\"\"\n\nfrom .script import hash256, hash160, sha256, CScript, OP_0\nfrom .util import bytes_to_hex_str, hex_str_to_bytes\n\nfrom . import segwit_addr\n\nchars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\ndef byte_to_base58(b, version):\n    result = ''\n    str = bytes_to_hex_str(b)\n    str = bytes_to_hex_str(chr(version).encode('latin-1')) + str\n    checksum = bytes_to_hex_str(hash256(hex_str_to_bytes(str)))\n    str += checksum[:8]\n    value = int('0x'+str,0)\n    while value > 0:\n        result = chars[value % 58] + result\n        value //= 58\n    while (str[:2] == '00'):\n        result = chars[0] + result\n        str = str[2:]\n    return result\n\n# TODO: def base58_decode\n\ndef keyhash_to_p2pkh(hash, main = False):\n    assert (len(hash) == 20)\n    version = 0 if main else 111\n    return byte_to_base58(hash, version)\n\ndef scripthash_to_p2sh(hash, main = False):\n    assert (len(hash) == 20)\n    version = 5 if main else 196\n    return byte_to_base58(hash, version)\n\ndef key_to_p2pkh(key, main = False):\n    key = check_key(key)\n    return keyhash_to_p2pkh(hash160(key), main)\n\ndef script_to_p2sh(script, main = False):\n    script = check_script(script)\n    return scripthash_to_p2sh(hash160(script), main)\n\ndef key_to_p2sh_p2wpkh(key, main = False):\n    key = check_key(key)\n    p2shscript = CScript([OP_0, hash160(key)])\n    return script_to_p2sh(p2shscript, main)\n\ndef program_to_witness(version, program, main = False):\n    if (type(program) is str):\n        program = hex_str_to_bytes(program)\n    assert 0 <= version <= 16\n    assert 2 <= len(program) <= 40\n    assert version > 0 or len(program) in [20, 32]\n    return segwit_addr.encode(\"bc\" if main else \"bcrt\", version, program)\n\ndef script_to_p2wsh(script, main = False):\n    script = check_script(script)\n    return program_to_witness(0, sha256(script), main)\n\ndef key_to_p2wpkh(key, main = False):\n    key = check_key(key)\n    return program_to_witness(0, hash160(key), main)\n\ndef script_to_p2sh_p2wsh(script, main = False):\n    script = check_script(script)\n    p2shscript = CScript([OP_0, sha256(script)])\n    return script_to_p2sh(p2shscript, main)\n\ndef check_key(key):\n    if (type(key) is str):\n        key = hex_str_to_bytes(key) # Assuming this is hex string\n    if (type(key) is bytes and (len(key) == 33 or len(key) == 65)):\n        return key\n    assert(False)\n\ndef check_script(script):\n    if (type(script) is str):\n        script = hex_str_to_bytes(script) # Assuming this is hex string\n    if (type(script) is bytes or type(script) is CScript):\n        return script\n    assert(False)\n"
  },
  {
    "path": "test/functional/test_framework/authproxy.py",
    "content": "# Copyright (c) 2011 Jeff Garzik\n#\n# Previous copyright, from python-jsonrpc/jsonrpc/proxy.py:\n#\n# Copyright (c) 2007 Jan-Klaas Kollhof\n#\n# This file is part of jsonrpc.\n#\n# jsonrpc is free software; you can redistribute it and/or modify\n# it under the terms of the GNU Lesser General Public License as published by\n# the Free Software Foundation; either version 2.1 of the License, or\n# (at your option) any later version.\n#\n# This software is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public License\n# along with this software; if not, write to the Free Software\n# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\n\"\"\"HTTP proxy for opening RPC connection to bitcoind.\n\nAuthServiceProxy has the following improvements over python-jsonrpc's\nServiceProxy class:\n\n- HTTP connections persist for the life of the AuthServiceProxy object\n  (if server supports HTTP/1.1)\n- sends protocol 'version', per JSON-RPC 1.1\n- sends proper, incrementing 'id'\n- sends Basic HTTP authentication headers\n- parses all JSON numbers that look like floats as Decimal\n- uses standard Python json lib\n\"\"\"\n\nimport base64\nimport decimal\nimport http.client\nimport json\nimport logging\nimport socket\nimport time\nimport urllib.parse\n\nHTTP_TIMEOUT = 30\nUSER_AGENT = \"AuthServiceProxy/0.1\"\n\nlog = logging.getLogger(\"BitcoinRPC\")\n\nclass JSONRPCException(Exception):\n    def __init__(self, rpc_error):\n        try:\n            errmsg = '%(message)s (%(code)i)' % rpc_error\n        except (KeyError, TypeError):\n            errmsg = ''\n        super().__init__(errmsg)\n        self.error = rpc_error\n\n\ndef EncodeDecimal(o):\n    if isinstance(o, decimal.Decimal):\n        return str(o)\n    raise TypeError(repr(o) + \" is not JSON serializable\")\n\nclass AuthServiceProxy():\n    __id_count = 0\n\n    # ensure_ascii: escape unicode as \\uXXXX, passed to json.dumps\n    def __init__(self, service_url, service_name=None, timeout=HTTP_TIMEOUT, connection=None, ensure_ascii=True):\n        self.__service_url = service_url\n        self._service_name = service_name\n        self.ensure_ascii = ensure_ascii  # can be toggled on the fly by tests\n        self.__url = urllib.parse.urlparse(service_url)\n        port = 80 if self.__url.port is None else self.__url.port\n        user = None if self.__url.username is None else self.__url.username.encode('utf8')\n        passwd = None if self.__url.password is None else self.__url.password.encode('utf8')\n        authpair = user + b':' + passwd\n        self.__auth_header = b'Basic ' + base64.b64encode(authpair)\n\n        if connection:\n            # Callables re-use the connection of the original proxy\n            self.__conn = connection\n        elif self.__url.scheme == 'https':\n            self.__conn = http.client.HTTPSConnection(self.__url.hostname, port, timeout=timeout)\n        else:\n            self.__conn = http.client.HTTPConnection(self.__url.hostname, port, timeout=timeout)\n\n    def __getattr__(self, name):\n        if name.startswith('__') and name.endswith('__'):\n            # Python internal stuff\n            raise AttributeError\n        if self._service_name is not None:\n            name = \"%s.%s\" % (self._service_name, name)\n        return AuthServiceProxy(self.__service_url, name, connection=self.__conn)\n\n    def _request(self, method, path, postdata):\n        '''\n        Do a HTTP request, with retry if we get disconnected (e.g. due to a timeout).\n        This is a workaround for https://bugs.python.org/issue3566 which is fixed in Python 3.5.\n        '''\n        headers = {'Host': self.__url.hostname,\n                   'User-Agent': USER_AGENT,\n                   'Authorization': self.__auth_header,\n                   'Content-type': 'application/json'}\n        try:\n            self.__conn.request(method, path, postdata, headers)\n            return self._get_response()\n        except http.client.BadStatusLine as e:\n            if e.line == \"''\":  # if connection was closed, try again\n                self.__conn.close()\n                self.__conn.request(method, path, postdata, headers)\n                return self._get_response()\n            else:\n                raise\n        except (BrokenPipeError, ConnectionResetError):\n            # Python 3.5+ raises BrokenPipeError instead of BadStatusLine when the connection was reset\n            # ConnectionResetError happens on FreeBSD with Python 3.4\n            self.__conn.close()\n            self.__conn.request(method, path, postdata, headers)\n            return self._get_response()\n\n    def get_request(self, *args, **argsn):\n        AuthServiceProxy.__id_count += 1\n\n        log.debug(\"-%s-> %s %s\" % (AuthServiceProxy.__id_count, self._service_name,\n                                   json.dumps(args, default=EncodeDecimal, ensure_ascii=self.ensure_ascii)))\n        if args and argsn:\n            raise ValueError('Cannot handle both named and positional arguments')\n        return {'version': '1.1',\n                'method': self._service_name,\n                'params': args or argsn,\n                'id': AuthServiceProxy.__id_count}\n\n    def __call__(self, *args, **argsn):\n        postdata = json.dumps(self.get_request(*args, **argsn), default=EncodeDecimal, ensure_ascii=self.ensure_ascii)\n        response = self._request('POST', self.__url.path, postdata.encode('utf-8'))\n        if response['error'] is not None:\n            raise JSONRPCException(response['error'])\n        elif 'result' not in response:\n            raise JSONRPCException({\n                'code': -343, 'message': 'missing JSON-RPC result'})\n        else:\n            return response['result']\n\n    def batch(self, rpc_call_list):\n        postdata = json.dumps(list(rpc_call_list), default=EncodeDecimal, ensure_ascii=self.ensure_ascii)\n        log.debug(\"--> \" + postdata)\n        return self._request('POST', self.__url.path, postdata.encode('utf-8'))\n\n    def _get_response(self):\n        req_start_time = time.time()\n        try:\n            http_response = self.__conn.getresponse()\n        except socket.timeout as e:\n            raise JSONRPCException({\n                'code': -344,\n                'message': '%r RPC took longer than %f seconds. Consider '\n                           'using larger timeout for calls that take '\n                           'longer to return.' % (self._service_name,\n                                                  self.__conn.timeout)})\n        if http_response is None:\n            raise JSONRPCException({\n                'code': -342, 'message': 'missing HTTP response from server'})\n\n        content_type = http_response.getheader('Content-Type')\n        if content_type != 'application/json':\n            raise JSONRPCException({\n                'code': -342, 'message': 'non-JSON HTTP response with \\'%i %s\\' from server' % (http_response.status, http_response.reason)})\n\n        responsedata = http_response.read().decode('utf8')\n        response = json.loads(responsedata, parse_float=decimal.Decimal)\n        elapsed = time.time() - req_start_time\n        if \"error\" in response and response[\"error\"] is None:\n            log.debug(\"<-%s- [%.6f] %s\" % (response[\"id\"], elapsed, json.dumps(response[\"result\"], default=EncodeDecimal, ensure_ascii=self.ensure_ascii)))\n        else:\n            log.debug(\"<-- [%.6f] %s\" % (elapsed, responsedata))\n        return response\n\n    def __truediv__(self, relative_uri):\n        return AuthServiceProxy(\"{}/{}\".format(self.__service_url, relative_uri), self._service_name, connection=self.__conn)\n"
  },
  {
    "path": "test/functional/test_framework/bignum.py",
    "content": "#!/usr/bin/env python3\n#\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Big number routines.\n\nThis file is copied from python-bitcoinlib.\n\"\"\"\n\nimport struct\n\n\n# generic big endian MPI format\n\ndef bn_bytes(v, have_ext=False):\n    ext = 0\n    if have_ext:\n        ext = 1\n    return ((v.bit_length()+7)//8) + ext\n\ndef bn2bin(v):\n    s = bytearray()\n    i = bn_bytes(v)\n    while i > 0:\n        s.append((v >> ((i-1) * 8)) & 0xff)\n        i -= 1\n    return s\n\ndef bn2mpi(v):\n    have_ext = False\n    if v.bit_length() > 0:\n        have_ext = (v.bit_length() & 0x07) == 0\n\n    neg = False\n    if v < 0:\n        neg = True\n        v = -v\n\n    s = struct.pack(b\">I\", bn_bytes(v, have_ext))\n    ext = bytearray()\n    if have_ext:\n        ext.append(0)\n    v_bin = bn2bin(v)\n    if neg:\n        if have_ext:\n            ext[0] |= 0x80\n        else:\n            v_bin[0] |= 0x80\n    return s + ext + v_bin\n\n# bitcoin-specific little endian format, with implicit size\ndef mpi2vch(s):\n    r = s[4:]           # strip size\n    r = r[::-1]         # reverse string, converting BE->LE\n    return r\n\ndef bn2vch(v):\n    return bytes(mpi2vch(bn2mpi(v)))\n"
  },
  {
    "path": "test/functional/test_framework/blockstore.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"BlockStore and TxStore helper classes.\"\"\"\n\nfrom .mininode import *\nfrom io import BytesIO\nimport dbm.dumb as dbmd\n\nlogger = logging.getLogger(\"TestFramework.blockstore\")\n\nclass BlockStore():\n    \"\"\"BlockStore helper class.\n\n    BlockStore keeps a map of blocks and implements helper functions for\n    responding to getheaders and getdata, and for constructing a getheaders\n    message.\n    \"\"\"\n\n    def __init__(self, datadir):\n        self.blockDB = dbmd.open(datadir + \"/blocks\", 'c')\n        self.currentBlock = 0\n        self.headers_map = dict()\n\n    def close(self):\n        self.blockDB.close()\n\n    def erase(self, blockhash):\n        del self.blockDB[repr(blockhash)]\n\n    # lookup an entry and return the item as raw bytes\n    def get(self, blockhash):\n        value = None\n        try:\n            value = self.blockDB[repr(blockhash)]\n        except KeyError:\n            return None\n        return value\n\n    # lookup an entry and return it as a CBlock\n    def get_block(self, blockhash):\n        ret = None\n        serialized_block = self.get(blockhash)\n        if serialized_block is not None:\n            f = BytesIO(serialized_block)\n            ret = CBlock()\n            ret.deserialize(f)\n            ret.calc_sha256()\n        return ret\n\n    def get_header(self, blockhash):\n        try:\n            return self.headers_map[blockhash]\n        except KeyError:\n            return None\n\n    # Note: this pulls full blocks out of the database just to retrieve\n    # the headers -- perhaps we could keep a separate data structure\n    # to avoid this overhead.\n    def headers_for(self, locator, hash_stop, current_tip=None):\n        if current_tip is None:\n            current_tip = self.currentBlock\n        current_block_header = self.get_header(current_tip)\n        if current_block_header is None:\n            return None\n\n        response = msg_headers()\n        headersList = [ current_block_header ]\n        maxheaders = 2000\n        while (headersList[0].sha256 not in locator.vHave):\n            prevBlockHash = headersList[0].hashPrevBlock\n            prevBlockHeader = self.get_header(prevBlockHash)\n            if prevBlockHeader is not None:\n                headersList.insert(0, prevBlockHeader)\n            else:\n                break\n        headersList = headersList[:maxheaders] # truncate if we have too many\n        hashList = [x.sha256 for x in headersList]\n        index = len(headersList)\n        if (hash_stop in hashList):\n            index = hashList.index(hash_stop)+1\n        response.headers = headersList[:index]\n        return response\n\n    def add_block(self, block):\n        block.calc_sha256()\n        try:\n            self.blockDB[repr(block.sha256)] = bytes(block.serialize())\n        except TypeError as e:\n            logger.exception(\"Unexpected error\")\n        self.currentBlock = block.sha256\n        self.headers_map[block.sha256] = CBlockHeader(block)\n\n    def add_header(self, header):\n        self.headers_map[header.sha256] = header\n\n    # lookup the hashes in \"inv\", and return p2p messages for delivering\n    # blocks found.\n    def get_blocks(self, inv):\n        responses = []\n        for i in inv:\n            if (i.type == 2 or i.type == (2 | (1 << 30))): # MSG_BLOCK or MSG_WITNESS_BLOCK\n                data = self.get(i.hash)\n                if data is not None:\n                    # Use msg_generic to avoid re-serialization\n                    responses.append(msg_generic(b\"block\", data))\n        return responses\n\n    def get_locator(self, current_tip=None):\n        if current_tip is None:\n            current_tip = self.currentBlock\n        r = []\n        counter = 0\n        step = 1\n        lastBlock = self.get_block(current_tip)\n        while lastBlock is not None:\n            r.append(lastBlock.hashPrevBlock)\n            for i in range(step):\n                lastBlock = self.get_block(lastBlock.hashPrevBlock)\n                if lastBlock is None:\n                    break\n            counter += 1\n            if counter > 10:\n                step *= 2\n        locator = CBlockLocator()\n        locator.vHave = r\n        return locator\n\nclass TxStore():\n    def __init__(self, datadir):\n        self.txDB = dbmd.open(datadir + \"/transactions\", 'c')\n\n    def close(self):\n        self.txDB.close()\n\n    # lookup an entry and return the item as raw bytes\n    def get(self, txhash):\n        value = None\n        try:\n            value = self.txDB[repr(txhash)]\n        except KeyError:\n            return None\n        return value\n\n    def add_transaction(self, tx):\n        tx.calc_sha256()\n        try:\n            self.txDB[repr(tx.sha256)] = bytes(tx.serialize())\n        except TypeError as e:\n            logger.exception(\"Unexpected error\")\n\n    def get_transactions(self, inv):\n        responses = []\n        for i in inv:\n            if (i.type == 1 or i.type == (1 | (1 << 30))): # MSG_TX or MSG_WITNESS_TX\n                tx = self.get(i.hash)\n                if tx is not None:\n                    responses.append(msg_generic(b\"tx\", tx))\n        return responses\n"
  },
  {
    "path": "test/functional/test_framework/blocktools.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Utilities for manipulating blocks and transactions.\"\"\"\n\nfrom .address import (\n    key_to_p2sh_p2wpkh,\n    key_to_p2wpkh,\n    script_to_p2sh_p2wsh,\n    script_to_p2wsh,\n)\nfrom .mininode import *\nfrom .script import (\n    CScript,\n    OP_0,\n    OP_1,\n    OP_CHECKMULTISIG,\n    OP_CHECKSIG,\n    OP_RETURN,\n    OP_TRUE,\n    hash160,\n)\nfrom .util import assert_equal\n\n# Create a block (with regtest difficulty)\ndef create_block(hashprev, coinbase, nTime=None):\n    block = CBlock()\n    if nTime is None:\n        import time\n        block.nTime = int(time.time()+600)\n    else:\n        block.nTime = nTime\n    block.hashPrevBlock = hashprev\n    block.nBits = 0x207fffff # Will break after a difficulty adjustment...\n    block.vtx.append(coinbase)\n    block.hashMerkleRoot = block.calc_merkle_root()\n    block.calc_sha256()\n    return block\n\n# From BIP141\nWITNESS_COMMITMENT_HEADER = b\"\\xaa\\x21\\xa9\\xed\"\n\n\ndef get_witness_script(witness_root, witness_nonce):\n    witness_commitment = uint256_from_str(hash256(ser_uint256(witness_root)+ser_uint256(witness_nonce)))\n    output_data = WITNESS_COMMITMENT_HEADER + ser_uint256(witness_commitment)\n    return CScript([OP_RETURN, output_data])\n\n\n# According to BIP141, blocks with witness rules active must commit to the\n# hash of all in-block transactions including witness.\ndef add_witness_commitment(block, nonce=0):\n    # First calculate the merkle root of the block's\n    # transactions, with witnesses.\n    witness_nonce = nonce\n    witness_root = block.calc_witness_merkle_root()\n    # witness_nonce should go to coinbase witness.\n    block.vtx[0].wit.vtxinwit = [CTxInWitness()]\n    block.vtx[0].wit.vtxinwit[0].scriptWitness.stack = [ser_uint256(witness_nonce)]\n\n    # witness commitment is the last OP_RETURN output in coinbase\n    block.vtx[0].vout.append(CTxOut(0, get_witness_script(witness_root, witness_nonce)))\n    block.vtx[0].rehash()\n    block.hashMerkleRoot = block.calc_merkle_root()\n    block.rehash()\n\n\ndef serialize_script_num(value):\n    r = bytearray(0)\n    if value == 0:\n        return r\n    neg = value < 0\n    absvalue = -value if neg else value\n    while (absvalue):\n        r.append(int(absvalue & 0xff))\n        absvalue >>= 8\n    if r[-1] & 0x80:\n        r.append(0x80 if neg else 0)\n    elif neg:\n        r[-1] |= 0x80\n    return r\n\n# Create a coinbase transaction, assuming no miner fees.\n# If pubkey is passed in, the coinbase output will be a P2PK output;\n# otherwise an anyone-can-spend output.\ndef create_coinbase(height, pubkey = None):\n    coinbase = CTransaction()\n    coinbase.vin.append(CTxIn(COutPoint(0, 0xffffffff), \n                ser_string(serialize_script_num(height)), 0xffffffff))\n    coinbaseoutput = CTxOut()\n    coinbaseoutput.nValue = 50 * COIN\n    halvings = int(height/150) # regtest\n    coinbaseoutput.nValue >>= halvings\n    if (pubkey != None):\n        coinbaseoutput.scriptPubKey = CScript([pubkey, OP_CHECKSIG])\n    else:\n        coinbaseoutput.scriptPubKey = CScript([OP_TRUE])\n    coinbase.vout = [ coinbaseoutput ]\n    coinbase.calc_sha256()\n    return coinbase\n\n# Create a transaction.\n# If the scriptPubKey is not specified, make it anyone-can-spend.\ndef create_transaction(prevtx, n, sig, value, scriptPubKey=CScript()):\n    tx = CTransaction()\n    assert(n < len(prevtx.vout))\n    tx.vin.append(CTxIn(COutPoint(prevtx.sha256, n), sig, 0xffffffff))\n    tx.vout.append(CTxOut(value, scriptPubKey))\n    tx.calc_sha256()\n    return tx\n\ndef get_legacy_sigopcount_block(block, fAccurate=True):\n    count = 0\n    for tx in block.vtx:\n        count += get_legacy_sigopcount_tx(tx, fAccurate)\n    return count\n\ndef get_legacy_sigopcount_tx(tx, fAccurate=True):\n    count = 0\n    for i in tx.vout:\n        count += i.scriptPubKey.GetSigOpCount(fAccurate)\n    for j in tx.vin:\n        # scriptSig might be of type bytes, so convert to CScript for the moment\n        count += CScript(j.scriptSig).GetSigOpCount(fAccurate)\n    return count\n\n# Create a scriptPubKey corresponding to either a P2WPKH output for the\n# given pubkey, or a P2WSH output of a 1-of-1 multisig for the given\n# pubkey. Returns the hex encoding of the scriptPubKey.\ndef witness_script(use_p2wsh, pubkey):\n    if (use_p2wsh == False):\n        # P2WPKH instead\n        pubkeyhash = hash160(hex_str_to_bytes(pubkey))\n        pkscript = CScript([OP_0, pubkeyhash])\n    else:\n        # 1-of-1 multisig\n        witness_program = CScript([OP_1, hex_str_to_bytes(pubkey), OP_1, OP_CHECKMULTISIG])\n        scripthash = sha256(witness_program)\n        pkscript = CScript([OP_0, scripthash])\n    return bytes_to_hex_str(pkscript)\n\n# Return a transaction (in hex) that spends the given utxo to a segwit output,\n# optionally wrapping the segwit output using P2SH.\ndef create_witness_tx(node, use_p2wsh, utxo, pubkey, encode_p2sh, amount):\n    if use_p2wsh:\n        program = CScript([OP_1, hex_str_to_bytes(pubkey), OP_1, OP_CHECKMULTISIG])\n        addr = script_to_p2sh_p2wsh(program) if encode_p2sh else script_to_p2wsh(program)\n    else:\n        addr = key_to_p2sh_p2wpkh(pubkey) if encode_p2sh else key_to_p2wpkh(pubkey)\n    if not encode_p2sh:\n        assert_equal(node.validateaddress(addr)['scriptPubKey'], witness_script(use_p2wsh, pubkey))\n    return node.createrawtransaction([utxo], {addr: amount})\n\n# Create a transaction spending a given utxo to a segwit output corresponding\n# to the given pubkey: use_p2wsh determines whether to use P2WPKH or P2WSH;\n# encode_p2sh determines whether to wrap in P2SH.\n# sign=True will have the given node sign the transaction.\n# insert_redeem_script will be added to the scriptSig, if given.\ndef send_to_witness(use_p2wsh, node, utxo, pubkey, encode_p2sh, amount, sign=True, insert_redeem_script=\"\"):\n    tx_to_witness = create_witness_tx(node, use_p2wsh, utxo, pubkey, encode_p2sh, amount)\n    if (sign):\n        signed = node.signrawtransaction(tx_to_witness)\n        assert(\"errors\" not in signed or len([\"errors\"]) == 0)\n        return node.sendrawtransaction(signed[\"hex\"])\n    else:\n        if (insert_redeem_script):\n            tx = FromHex(CTransaction(), tx_to_witness)\n            tx.vin[0].scriptSig += CScript([hex_str_to_bytes(insert_redeem_script)])\n            tx_to_witness = ToHex(tx)\n\n    return node.sendrawtransaction(tx_to_witness)\n"
  },
  {
    "path": "test/functional/test_framework/comptool.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Compare two or more bitcoinds to each other.\n\nTo use, create a class that implements get_tests(), and pass it in\nas the test generator to TestManager.  get_tests() should be a python\ngenerator that returns TestInstance objects.  See below for definition.\n\nTestNode behaves as follows:\n    Configure with a BlockStore and TxStore\n    on_inv: log the message but don't request\n    on_headers: log the chain tip\n    on_pong: update ping response map (for synchronization)\n    on_getheaders: provide headers via BlockStore\n    on_getdata: provide blocks via BlockStore\n\"\"\"\n\nfrom .mininode import *\nfrom .blockstore import BlockStore, TxStore\nfrom .util import p2p_port, wait_until\n\nimport logging\n\nlogger=logging.getLogger(\"TestFramework.comptool\")\n\nglobal mininode_lock\n\nclass RejectResult():\n    \"\"\"Outcome that expects rejection of a transaction or block.\"\"\"\n    def __init__(self, code, reason=b''):\n        self.code = code\n        self.reason = reason\n    def match(self, other):\n        if self.code != other.code:\n            return False\n        return other.reason.startswith(self.reason)\n    def __repr__(self):\n        return '%i:%s' % (self.code,self.reason or '*')\n\nclass TestNode(P2PInterface):\n\n    def __init__(self, block_store, tx_store):\n        super().__init__()\n        self.bestblockhash = None\n        self.block_store = block_store\n        self.block_request_map = {}\n        self.tx_store = tx_store\n        self.tx_request_map = {}\n        self.block_reject_map = {}\n        self.tx_reject_map = {}\n\n        # When the pingmap is non-empty we're waiting for \n        # a response\n        self.pingMap = {} \n        self.lastInv = []\n        self.closed = False\n\n    def on_close(self):\n        self.closed = True\n\n    def on_headers(self, message):\n        if len(message.headers) > 0:\n            best_header = message.headers[-1]\n            best_header.calc_sha256()\n            self.bestblockhash = best_header.sha256\n\n    def on_getheaders(self, message):\n        response = self.block_store.headers_for(message.locator, message.hashstop)\n        if response is not None:\n            self.send_message(response)\n\n    def on_getdata(self, message):\n        [self.send_message(r) for r in self.block_store.get_blocks(message.inv)]\n        [self.send_message(r) for r in self.tx_store.get_transactions(message.inv)]\n\n        for i in message.inv:\n            if i.type == 1 or i.type == 1 | (1 << 30): # MSG_TX or MSG_WITNESS_TX\n                self.tx_request_map[i.hash] = True\n            elif i.type == 2 or i.type == 2 | (1 << 30): # MSG_BLOCK or MSG_WITNESS_BLOCK\n                self.block_request_map[i.hash] = True\n\n    def on_inv(self, message):\n        self.lastInv = [x.hash for x in message.inv]\n\n    def on_pong(self, message):\n        try:\n            del self.pingMap[message.nonce]\n        except KeyError:\n            raise AssertionError(\"Got pong for unknown ping [%s]\" % repr(message))\n\n    def on_reject(self, message):\n        if message.message == b'tx':\n            self.tx_reject_map[message.data] = RejectResult(message.code, message.reason)\n        if message.message == b'block':\n            self.block_reject_map[message.data] = RejectResult(message.code, message.reason)\n\n    def send_inv(self, obj):\n        mtype = 2 if isinstance(obj, CBlock) else 1\n        self.send_message(msg_inv([CInv(mtype, obj.sha256)]))\n\n    def send_getheaders(self):\n        # We ask for headers from their last tip.\n        m = msg_getheaders()\n        m.locator = self.block_store.get_locator(self.bestblockhash)\n        self.send_message(m)\n\n    def send_header(self, header):\n        m = msg_headers()\n        m.headers.append(header)\n        self.send_message(m)\n\n    # This assumes BIP31\n    def send_ping(self, nonce):\n        self.pingMap[nonce] = True\n        self.send_message(msg_ping(nonce))\n\n    def received_ping_response(self, nonce):\n        return nonce not in self.pingMap\n\n    def send_mempool(self):\n        self.lastInv = []\n        self.send_message(msg_mempool())\n\n# TestInstance:\n#\n# Instances of these are generated by the test generator, and fed into the\n# comptool.\n#\n# \"blocks_and_transactions\" should be an array of\n#    [obj, True/False/None, hash/None]:\n#  - obj is either a CBlock, CBlockHeader, or a CTransaction, and\n#  - the second value indicates whether the object should be accepted\n#    into the blockchain or mempool (for tests where we expect a certain\n#    answer), or \"None\" if we don't expect a certain answer and are just\n#    comparing the behavior of the nodes being tested.\n#  - the third value is the hash to test the tip against (if None or omitted,\n#    use the hash of the block)\n#  - NOTE: if a block header, no test is performed; instead the header is\n#    just added to the block_store.  This is to facilitate block delivery\n#    when communicating with headers-first clients (when withholding an\n#    intermediate block).\n# sync_every_block: if True, then each block will be inv'ed, synced, and\n#    nodes will be tested based on the outcome for the block.  If False,\n#    then inv's accumulate until all blocks are processed (or max inv size\n#    is reached) and then sent out in one inv message.  Then the final block\n#    will be synced across all connections, and the outcome of the final \n#    block will be tested.\n# sync_every_tx: analogous to behavior for sync_every_block, except if outcome\n#    on the final tx is None, then contents of entire mempool are compared\n#    across all connections.  (If outcome of final tx is specified as true\n#    or false, then only the last tx is tested against outcome.)\n\nclass TestInstance():\n    def __init__(self, objects=None, sync_every_block=True, sync_every_tx=False):\n        self.blocks_and_transactions = objects if objects else []\n        self.sync_every_block = sync_every_block\n        self.sync_every_tx = sync_every_tx\n\nclass TestManager():\n\n    def __init__(self, testgen, datadir):\n        self.test_generator = testgen\n        self.p2p_connections= []\n        self.block_store    = BlockStore(datadir)\n        self.tx_store       = TxStore(datadir)\n        self.ping_counter   = 1\n\n    def add_all_connections(self, nodes):\n        for i in range(len(nodes)):\n            # Create a p2p connection to each node\n            node = TestNode(self.block_store, self.tx_store)\n            node.peer_connect('127.0.0.1', p2p_port(i))\n            self.p2p_connections.append(node)\n\n    def clear_all_connections(self):\n        self.p2p_connections = []\n\n    def wait_for_disconnections(self):\n        def disconnected():\n            return all(node.closed for node in self.p2p_connections)\n        wait_until(disconnected, timeout=10, lock=mininode_lock)\n\n    def wait_for_verack(self):\n        return all(node.wait_for_verack() for node in self.p2p_connections)\n\n    def wait_for_pings(self, counter):\n        def received_pongs():\n            return all(node.received_ping_response(counter) for node in self.p2p_connections)\n        wait_until(received_pongs, lock=mininode_lock)\n\n    # sync_blocks: Wait for all connections to request the blockhash given\n    # then send get_headers to find out the tip of each node, and synchronize\n    # the response by using a ping (and waiting for pong with same nonce).\n    def sync_blocks(self, blockhash, num_blocks):\n        def blocks_requested():\n            return all(\n                blockhash in node.block_request_map and node.block_request_map[blockhash]\n                for node in self.p2p_connections\n            )\n\n        # --> error if not requested\n        wait_until(blocks_requested, attempts=20*num_blocks, lock=mininode_lock)\n\n        # Send getheaders message\n        [ c.send_getheaders() for c in self.p2p_connections ]\n\n        # Send ping and wait for response -- synchronization hack\n        [ c.send_ping(self.ping_counter) for c in self.p2p_connections ]\n        self.wait_for_pings(self.ping_counter)\n        self.ping_counter += 1\n\n    # Analogous to sync_block (see above)\n    def sync_transaction(self, txhash, num_events):\n        # Wait for nodes to request transaction (50ms sleep * 20 tries * num_events)\n        def transaction_requested():\n            return all(\n                txhash in node.tx_request_map and node.tx_request_map[txhash]\n                for node in self.p2p_connections\n            )\n\n        # --> error if not requested\n        wait_until(transaction_requested, attempts=20*num_events, lock=mininode_lock)\n\n        # Get the mempool\n        [ c.send_mempool() for c in self.p2p_connections ]\n\n        # Send ping and wait for response -- synchronization hack\n        [ c.send_ping(self.ping_counter) for c in self.p2p_connections ]\n        self.wait_for_pings(self.ping_counter)\n        self.ping_counter += 1\n\n        # Sort inv responses from each node\n        with mininode_lock:\n            [ c.lastInv.sort() for c in self.p2p_connections ]\n\n    # Verify that the tip of each connection all agree with each other, and\n    # with the expected outcome (if given)\n    def check_results(self, blockhash, outcome):\n        with mininode_lock:\n            for c in self.p2p_connections:\n                if outcome is None:\n                    if c.bestblockhash != self.p2p_connections[0].bestblockhash:\n                        return False\n                elif isinstance(outcome, RejectResult): # Check that block was rejected w/ code\n                    if c.bestblockhash == blockhash:\n                        return False\n                    if blockhash not in c.block_reject_map:\n                        logger.error('Block not in reject map: %064x' % (blockhash))\n                        return False\n                    if not outcome.match(c.block_reject_map[blockhash]):\n                        logger.error('Block rejected with %s instead of expected %s: %064x' % (c.block_reject_map[blockhash], outcome, blockhash))\n                        return False\n                elif ((c.bestblockhash == blockhash) != outcome):\n                    return False\n            return True\n\n    # Either check that the mempools all agree with each other, or that\n    # txhash's presence in the mempool matches the outcome specified.\n    # This is somewhat of a strange comparison, in that we're either comparing\n    # a particular tx to an outcome, or the entire mempools altogether;\n    # perhaps it would be useful to add the ability to check explicitly that\n    # a particular tx's existence in the mempool is the same across all nodes.\n    def check_mempool(self, txhash, outcome):\n        with mininode_lock:\n            for c in self.p2p_connections:\n                if outcome is None:\n                    # Make sure the mempools agree with each other\n                    if c.lastInv != self.p2p_connections[0].lastInv:\n                        return False\n                elif isinstance(outcome, RejectResult): # Check that tx was rejected w/ code\n                    if txhash in c.lastInv:\n                        return False\n                    if txhash not in c.tx_reject_map:\n                        logger.error('Tx not in reject map: %064x' % (txhash))\n                        return False\n                    if not outcome.match(c.tx_reject_map[txhash]):\n                        logger.error('Tx rejected with %s instead of expected %s: %064x' % (c.tx_reject_map[txhash], outcome, txhash))\n                        return False\n                elif ((txhash in c.lastInv) != outcome):\n                    return False\n            return True\n\n    def run(self):\n        # Wait until verack is received\n        self.wait_for_verack()\n\n        test_number = 0\n        tests = self.test_generator.get_tests()\n        for test_instance in tests:\n            test_number += 1\n            logger.info(\"Running test %d: %s line %s\" % (test_number, tests.gi_code.co_filename, tests.gi_frame.f_lineno))\n            # We use these variables to keep track of the last block\n            # and last transaction in the tests, which are used\n            # if we're not syncing on every block or every tx.\n            [ block, block_outcome, tip ] = [ None, None, None ]\n            [ tx, tx_outcome ] = [ None, None ]\n            invqueue = []\n\n            for test_obj in test_instance.blocks_and_transactions:\n                b_or_t = test_obj[0]\n                outcome = test_obj[1]\n                # Determine if we're dealing with a block or tx\n                if isinstance(b_or_t, CBlock):  # Block test runner\n                    block = b_or_t\n                    block_outcome = outcome\n                    tip = block.sha256\n                    # each test_obj can have an optional third argument\n                    # to specify the tip we should compare with\n                    # (default is to use the block being tested)\n                    if len(test_obj) >= 3:\n                        tip = test_obj[2]\n\n                    # Add to shared block_store, set as current block\n                    # If there was an open getdata request for the block\n                    # previously, and we didn't have an entry in the\n                    # block_store, then immediately deliver, because the\n                    # node wouldn't send another getdata request while\n                    # the earlier one is outstanding.\n                    first_block_with_hash = True\n                    if self.block_store.get(block.sha256) is not None:\n                        first_block_with_hash = False\n                    with mininode_lock:\n                        self.block_store.add_block(block)\n                        for c in self.p2p_connections:\n                            if first_block_with_hash and block.sha256 in c.block_request_map and c.block_request_map[block.sha256] == True:\n                                # There was a previous request for this block hash\n                                # Most likely, we delivered a header for this block\n                                # but never had the block to respond to the getdata\n                                c.send_message(msg_block(block))\n                            else:\n                                c.block_request_map[block.sha256] = False\n                    # Either send inv's to each node and sync, or add\n                    # to invqueue for later inv'ing.\n                    if (test_instance.sync_every_block):\n                        # if we expect success, send inv and sync every block\n                        # if we expect failure, just push the block and see what happens.\n                        if outcome == True:\n                            [ c.send_inv(block) for c in self.p2p_connections ]\n                            self.sync_blocks(block.sha256, 1)\n                        else:\n                            [ c.send_message(msg_block(block)) for c in self.p2p_connections ]\n                            [ c.send_ping(self.ping_counter) for c in self.p2p_connections ]\n                            self.wait_for_pings(self.ping_counter)\n                            self.ping_counter += 1\n                        if (not self.check_results(tip, outcome)):\n                            raise AssertionError(\"Test failed at test %d\" % test_number)\n                    else:\n                        invqueue.append(CInv(2, block.sha256))\n                elif isinstance(b_or_t, CBlockHeader):\n                    block_header = b_or_t\n                    self.block_store.add_header(block_header)\n                    [ c.send_header(block_header) for c in self.p2p_connections ]\n\n                else:  # Tx test runner\n                    assert(isinstance(b_or_t, CTransaction))\n                    tx = b_or_t\n                    tx_outcome = outcome\n                    # Add to shared tx store and clear map entry\n                    with mininode_lock:\n                        self.tx_store.add_transaction(tx)\n                        for c in self.p2p_connections:\n                            c.tx_request_map[tx.sha256] = False\n                    # Again, either inv to all nodes or save for later\n                    if (test_instance.sync_every_tx):\n                        [ c.send_inv(tx) for c in self.p2p_connections ]\n                        self.sync_transaction(tx.sha256, 1)\n                        if (not self.check_mempool(tx.sha256, outcome)):\n                            raise AssertionError(\"Test failed at test %d\" % test_number)\n                    else:\n                        invqueue.append(CInv(1, tx.sha256))\n                # Ensure we're not overflowing the inv queue\n                if len(invqueue) == MAX_INV_SZ:\n                    [ c.send_message(msg_inv(invqueue)) for c in self.p2p_connections ]\n                    invqueue = []\n\n            # Do final sync if we weren't syncing on every block or every tx.\n            if (not test_instance.sync_every_block and block is not None):\n                if len(invqueue) > 0:\n                    [ c.send_message(msg_inv(invqueue)) for c in self.p2p_connections ]\n                    invqueue = []\n                self.sync_blocks(block.sha256, len(test_instance.blocks_and_transactions))\n                if (not self.check_results(tip, block_outcome)):\n                    raise AssertionError(\"Block test failed at test %d\" % test_number)\n            if (not test_instance.sync_every_tx and tx is not None):\n                if len(invqueue) > 0:\n                    [ c.send_message(msg_inv(invqueue)) for c in self.p2p_connections ]\n                    invqueue = []\n                self.sync_transaction(tx.sha256, len(test_instance.blocks_and_transactions))\n                if (not self.check_mempool(tx.sha256, tx_outcome)):\n                    raise AssertionError(\"Mempool test failed at test %d\" % test_number)\n\n        [ c.disconnect_node() for c in self.p2p_connections ]\n        self.wait_for_disconnections()\n        self.block_store.close()\n        self.tx_store.close()\n"
  },
  {
    "path": "test/functional/test_framework/coverage.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Utilities for doing coverage analysis on the RPC interface.\n\nProvides a way to track which RPC commands are exercised during\ntesting.\n\"\"\"\n\nimport os\n\n\nREFERENCE_FILENAME = 'rpc_interface.txt'\n\n\nclass AuthServiceProxyWrapper():\n    \"\"\"\n    An object that wraps AuthServiceProxy to record specific RPC calls.\n\n    \"\"\"\n    def __init__(self, auth_service_proxy_instance, coverage_logfile=None):\n        \"\"\"\n        Kwargs:\n            auth_service_proxy_instance (AuthServiceProxy): the instance\n                being wrapped.\n            coverage_logfile (str): if specified, write each service_name\n                out to a file when called.\n\n        \"\"\"\n        self.auth_service_proxy_instance = auth_service_proxy_instance\n        self.coverage_logfile = coverage_logfile\n\n    def __getattr__(self, name):\n        return_val = getattr(self.auth_service_proxy_instance, name)\n        if not isinstance(return_val, type(self.auth_service_proxy_instance)):\n            # If proxy getattr returned an unwrapped value, do the same here.\n            return return_val\n        return AuthServiceProxyWrapper(return_val, self.coverage_logfile)\n\n    def __call__(self, *args, **kwargs):\n        \"\"\"\n        Delegates to AuthServiceProxy, then writes the particular RPC method\n        called to a file.\n\n        \"\"\"\n        return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)\n        self._log_call()\n        return return_val\n\n    def _log_call(self):\n        rpc_method = self.auth_service_proxy_instance._service_name\n\n        if self.coverage_logfile:\n            with open(self.coverage_logfile, 'a+', encoding='utf8') as f:\n                f.write(\"%s\\n\" % rpc_method)\n\n    def __truediv__(self, relative_uri):\n        return AuthServiceProxyWrapper(self.auth_service_proxy_instance / relative_uri,\n                                       self.coverage_logfile)\n\n    def get_request(self, *args, **kwargs):\n        self._log_call()\n        return self.auth_service_proxy_instance.get_request(*args, **kwargs)\n\ndef get_filename(dirname, n_node):\n    \"\"\"\n    Get a filename unique to the test process ID and node.\n\n    This file will contain a list of RPC commands covered.\n    \"\"\"\n    pid = str(os.getpid())\n    return os.path.join(\n        dirname, \"coverage.pid%s.node%s.txt\" % (pid, str(n_node)))\n\n\ndef write_all_rpc_commands(dirname, node):\n    \"\"\"\n    Write out a list of all RPC functions available in `bitcoin-cli` for\n    coverage comparison. This will only happen once per coverage\n    directory.\n\n    Args:\n        dirname (str): temporary test dir\n        node (AuthServiceProxy): client\n\n    Returns:\n        bool. if the RPC interface file was written.\n\n    \"\"\"\n    filename = os.path.join(dirname, REFERENCE_FILENAME)\n\n    if os.path.isfile(filename):\n        return False\n\n    help_output = node.help().split('\\n')\n    commands = set()\n\n    for line in help_output:\n        line = line.strip()\n\n        # Ignore blanks and headers\n        if line and not line.startswith('='):\n            commands.add(\"%s\\n\" % line.split()[0])\n\n    with open(filename, 'w', encoding='utf8') as f:\n        f.writelines(list(commands))\n\n    return True\n"
  },
  {
    "path": "test/functional/test_framework/key.py",
    "content": "# Copyright (c) 2011 Sam Rushing\n\"\"\"ECC secp256k1 OpenSSL wrapper.\n\nWARNING: This module does not mlock() secrets; your private keys may end up on\ndisk in swap! Use with caution!\n\nThis file is modified from python-bitcoinlib.\n\"\"\"\n\nimport ctypes\nimport ctypes.util\nimport hashlib\nimport sys\n\nssl = ctypes.cdll.LoadLibrary(ctypes.util.find_library ('ssl') or 'libeay32')\n\nssl.BN_new.restype = ctypes.c_void_p\nssl.BN_new.argtypes = []\n\nssl.BN_bin2bn.restype = ctypes.c_void_p\nssl.BN_bin2bn.argtypes = [ctypes.c_char_p, ctypes.c_int, ctypes.c_void_p]\n\nssl.BN_CTX_free.restype = None\nssl.BN_CTX_free.argtypes = [ctypes.c_void_p]\n\nssl.BN_CTX_new.restype = ctypes.c_void_p\nssl.BN_CTX_new.argtypes = []\n\nssl.ECDH_compute_key.restype = ctypes.c_int\nssl.ECDH_compute_key.argtypes = [ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p]\n\nssl.ECDSA_sign.restype = ctypes.c_int\nssl.ECDSA_sign.argtypes = [ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p]\n\nssl.ECDSA_verify.restype = ctypes.c_int\nssl.ECDSA_verify.argtypes = [ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p]\n\nssl.EC_KEY_free.restype = None\nssl.EC_KEY_free.argtypes = [ctypes.c_void_p]\n\nssl.EC_KEY_new_by_curve_name.restype = ctypes.c_void_p\nssl.EC_KEY_new_by_curve_name.argtypes = [ctypes.c_int]\n\nssl.EC_KEY_get0_group.restype = ctypes.c_void_p\nssl.EC_KEY_get0_group.argtypes = [ctypes.c_void_p]\n\nssl.EC_KEY_get0_public_key.restype = ctypes.c_void_p\nssl.EC_KEY_get0_public_key.argtypes = [ctypes.c_void_p]\n\nssl.EC_KEY_set_private_key.restype = ctypes.c_int\nssl.EC_KEY_set_private_key.argtypes = [ctypes.c_void_p, ctypes.c_void_p]\n\nssl.EC_KEY_set_conv_form.restype = None\nssl.EC_KEY_set_conv_form.argtypes = [ctypes.c_void_p, ctypes.c_int]\n\nssl.EC_KEY_set_public_key.restype = ctypes.c_int\nssl.EC_KEY_set_public_key.argtypes = [ctypes.c_void_p, ctypes.c_void_p]\n\nssl.i2o_ECPublicKey.restype = ctypes.c_void_p\nssl.i2o_ECPublicKey.argtypes = [ctypes.c_void_p, ctypes.c_void_p]\n\nssl.EC_POINT_new.restype = ctypes.c_void_p\nssl.EC_POINT_new.argtypes = [ctypes.c_void_p]\n\nssl.EC_POINT_free.restype = None\nssl.EC_POINT_free.argtypes = [ctypes.c_void_p]\n\nssl.EC_POINT_mul.restype = ctypes.c_int\nssl.EC_POINT_mul.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_void_p]\n\n# this specifies the curve used with ECDSA.\nNID_secp256k1 = 714 # from openssl/obj_mac.h\n\nSECP256K1_ORDER = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141\nSECP256K1_ORDER_HALF = SECP256K1_ORDER // 2\n\n# Thx to Sam Devlin for the ctypes magic 64-bit fix.\ndef _check_result(val, func, args):\n    if val == 0:\n        raise ValueError\n    else:\n        return ctypes.c_void_p (val)\n\nssl.EC_KEY_new_by_curve_name.restype = ctypes.c_void_p\nssl.EC_KEY_new_by_curve_name.errcheck = _check_result\n\nclass CECKey():\n    \"\"\"Wrapper around OpenSSL's EC_KEY\"\"\"\n\n    POINT_CONVERSION_COMPRESSED = 2\n    POINT_CONVERSION_UNCOMPRESSED = 4\n\n    def __init__(self):\n        self.k = ssl.EC_KEY_new_by_curve_name(NID_secp256k1)\n\n    def __del__(self):\n        if ssl:\n            ssl.EC_KEY_free(self.k)\n        self.k = None\n\n    def set_secretbytes(self, secret):\n        priv_key = ssl.BN_bin2bn(secret, 32, ssl.BN_new())\n        group = ssl.EC_KEY_get0_group(self.k)\n        pub_key = ssl.EC_POINT_new(group)\n        ctx = ssl.BN_CTX_new()\n        if not ssl.EC_POINT_mul(group, pub_key, priv_key, None, None, ctx):\n            raise ValueError(\"Could not derive public key from the supplied secret.\")\n        ssl.EC_POINT_mul(group, pub_key, priv_key, None, None, ctx)\n        ssl.EC_KEY_set_private_key(self.k, priv_key)\n        ssl.EC_KEY_set_public_key(self.k, pub_key)\n        ssl.EC_POINT_free(pub_key)\n        ssl.BN_CTX_free(ctx)\n        return self.k\n\n    def set_privkey(self, key):\n        self.mb = ctypes.create_string_buffer(key)\n        return ssl.d2i_ECPrivateKey(ctypes.byref(self.k), ctypes.byref(ctypes.pointer(self.mb)), len(key))\n\n    def set_pubkey(self, key):\n        self.mb = ctypes.create_string_buffer(key)\n        return ssl.o2i_ECPublicKey(ctypes.byref(self.k), ctypes.byref(ctypes.pointer(self.mb)), len(key))\n\n    def get_privkey(self):\n        size = ssl.i2d_ECPrivateKey(self.k, 0)\n        mb_pri = ctypes.create_string_buffer(size)\n        ssl.i2d_ECPrivateKey(self.k, ctypes.byref(ctypes.pointer(mb_pri)))\n        return mb_pri.raw\n\n    def get_pubkey(self):\n        size = ssl.i2o_ECPublicKey(self.k, 0)\n        mb = ctypes.create_string_buffer(size)\n        ssl.i2o_ECPublicKey(self.k, ctypes.byref(ctypes.pointer(mb)))\n        return mb.raw\n\n    def get_raw_ecdh_key(self, other_pubkey):\n        ecdh_keybuffer = ctypes.create_string_buffer(32)\n        r = ssl.ECDH_compute_key(ctypes.pointer(ecdh_keybuffer), 32,\n                                 ssl.EC_KEY_get0_public_key(other_pubkey.k),\n                                 self.k, 0)\n        if r != 32:\n            raise Exception('CKey.get_ecdh_key(): ECDH_compute_key() failed')\n        return ecdh_keybuffer.raw\n\n    def get_ecdh_key(self, other_pubkey, kdf=lambda k: hashlib.sha256(k).digest()):\n        # FIXME: be warned it's not clear what the kdf should be as a default\n        r = self.get_raw_ecdh_key(other_pubkey)\n        return kdf(r)\n\n    def sign(self, hash, low_s = True):\n        # FIXME: need unit tests for below cases\n        if not isinstance(hash, bytes):\n            raise TypeError('Hash must be bytes instance; got %r' % hash.__class__)\n        if len(hash) != 32:\n            raise ValueError('Hash must be exactly 32 bytes long')\n\n        sig_size0 = ctypes.c_uint32()\n        sig_size0.value = ssl.ECDSA_size(self.k)\n        mb_sig = ctypes.create_string_buffer(sig_size0.value)\n        result = ssl.ECDSA_sign(0, hash, len(hash), mb_sig, ctypes.byref(sig_size0), self.k)\n        assert 1 == result\n        assert mb_sig.raw[0] == 0x30\n        assert mb_sig.raw[1] == sig_size0.value - 2\n        total_size = mb_sig.raw[1]\n        assert mb_sig.raw[2] == 2\n        r_size = mb_sig.raw[3]\n        assert mb_sig.raw[4 + r_size] == 2\n        s_size = mb_sig.raw[5 + r_size]\n        s_value = int.from_bytes(mb_sig.raw[6+r_size:6+r_size+s_size], byteorder='big')\n        if (not low_s) or s_value <= SECP256K1_ORDER_HALF:\n            return mb_sig.raw[:sig_size0.value]\n        else:\n            low_s_value = SECP256K1_ORDER - s_value\n            low_s_bytes = (low_s_value).to_bytes(33, byteorder='big')\n            while len(low_s_bytes) > 1 and low_s_bytes[0] == 0 and low_s_bytes[1] < 0x80:\n                low_s_bytes = low_s_bytes[1:]\n            new_s_size = len(low_s_bytes)\n            new_total_size_byte = (total_size + new_s_size - s_size).to_bytes(1,byteorder='big')\n            new_s_size_byte = (new_s_size).to_bytes(1,byteorder='big')\n            return b'\\x30' + new_total_size_byte + mb_sig.raw[2:5+r_size] + new_s_size_byte + low_s_bytes\n\n    def verify(self, hash, sig):\n        \"\"\"Verify a DER signature\"\"\"\n        return ssl.ECDSA_verify(0, hash, len(hash), sig, len(sig), self.k) == 1\n\n    def set_compressed(self, compressed):\n        if compressed:\n            form = self.POINT_CONVERSION_COMPRESSED\n        else:\n            form = self.POINT_CONVERSION_UNCOMPRESSED\n        ssl.EC_KEY_set_conv_form(self.k, form)\n\n\nclass CPubKey(bytes):\n    \"\"\"An encapsulated public key\n\n    Attributes:\n\n    is_valid      - Corresponds to CPubKey.IsValid()\n    is_fullyvalid - Corresponds to CPubKey.IsFullyValid()\n    is_compressed - Corresponds to CPubKey.IsCompressed()\n    \"\"\"\n\n    def __new__(cls, buf, _cec_key=None):\n        self = super(CPubKey, cls).__new__(cls, buf)\n        if _cec_key is None:\n            _cec_key = CECKey()\n        self._cec_key = _cec_key\n        self.is_fullyvalid = _cec_key.set_pubkey(self) != 0\n        return self\n\n    @property\n    def is_valid(self):\n        return len(self) > 0\n\n    @property\n    def is_compressed(self):\n        return len(self) == 33\n\n    def verify(self, hash, sig):\n        return self._cec_key.verify(hash, sig)\n\n    def __str__(self):\n        return repr(self)\n\n    def __repr__(self):\n        # Always have represent as b'<secret>' so test cases don't have to\n        # change for py2/3\n        if sys.version > '3':\n            return '%s(%s)' % (self.__class__.__name__, super(CPubKey, self).__repr__())\n        else:\n            return '%s(b%s)' % (self.__class__.__name__, super(CPubKey, self).__repr__())\n\n"
  },
  {
    "path": "test/functional/test_framework/messages.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2010 ArtForz -- public domain half-a-node\n# Copyright (c) 2012 Jeff Garzik\n# Copyright (c) 2010-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Bitcoin test framework primitive and message strcutures\n\nCBlock, CTransaction, CBlockHeader, CTxIn, CTxOut, etc....:\n    data structures that should map to corresponding structures in\n    bitcoin/primitives\n\nmsg_block, msg_tx, msg_headers, etc.:\n    data structures that represent network messages\n\nser_*, deser_*: functions that handle serialization/deserialization.\"\"\"\nfrom codecs import encode\nimport copy\nimport hashlib\nfrom io import BytesIO\nimport random\nimport socket\nimport struct\nimport time\n\nfrom test_framework.siphash import siphash256\nfrom test_framework.util import hex_str_to_bytes, bytes_to_hex_str\n\nMIN_VERSION_SUPPORTED = 60001\nMY_VERSION = 70014  # past bip-31 for ping/pong\nMY_SUBVERSION = b\"/python-mininode-tester:0.0.3/\"\nMY_RELAY = 1 # from version 70001 onwards, fRelay should be appended to version messages (BIP37)\n\nMAX_INV_SZ = 50000\nMAX_BLOCK_BASE_SIZE = 1000000\n\nCOIN = 100000000 # 1 btc in satoshis\n\nNODE_NETWORK = (1 << 0)\n# NODE_GETUTXO = (1 << 1)\nNODE_BLOOM = (1 << 2)\nNODE_WITNESS = (1 << 3)\nNODE_UNSUPPORTED_SERVICE_BIT_5 = (1 << 5)\nNODE_UNSUPPORTED_SERVICE_BIT_7 = (1 << 7)\nNODE_NETWORK_LIMITED = (1 << 10)\n\n# Serialization/deserialization tools\ndef sha256(s):\n    return hashlib.new('sha256', s).digest()\n\ndef ripemd160(s):\n    return hashlib.new('ripemd160', s).digest()\n\ndef hash256(s):\n    return sha256(sha256(s))\n\ndef ser_compact_size(l):\n    r = b\"\"\n    if l < 253:\n        r = struct.pack(\"B\", l)\n    elif l < 0x10000:\n        r = struct.pack(\"<BH\", 253, l)\n    elif l < 0x100000000:\n        r = struct.pack(\"<BI\", 254, l)\n    else:\n        r = struct.pack(\"<BQ\", 255, l)\n    return r\n\ndef deser_compact_size(f):\n    nit = struct.unpack(\"<B\", f.read(1))[0]\n    if nit == 253:\n        nit = struct.unpack(\"<H\", f.read(2))[0]\n    elif nit == 254:\n        nit = struct.unpack(\"<I\", f.read(4))[0]\n    elif nit == 255:\n        nit = struct.unpack(\"<Q\", f.read(8))[0]\n    return nit\n\ndef deser_string(f):\n    nit = deser_compact_size(f)\n    return f.read(nit)\n\ndef ser_string(s):\n    return ser_compact_size(len(s)) + s\n\ndef deser_uint256(f):\n    r = 0\n    for i in range(8):\n        t = struct.unpack(\"<I\", f.read(4))[0]\n        r += t << (i * 32)\n    return r\n\n\ndef ser_uint256(u):\n    rs = b\"\"\n    for i in range(8):\n        rs += struct.pack(\"<I\", u & 0xFFFFFFFF)\n        u >>= 32\n    return rs\n\n\ndef uint256_from_str(s):\n    r = 0\n    t = struct.unpack(\"<IIIIIIII\", s[:32])\n    for i in range(8):\n        r += t[i] << (i * 32)\n    return r\n\n\ndef uint256_from_compact(c):\n    nbytes = (c >> 24) & 0xFF\n    v = (c & 0xFFFFFF) << (8 * (nbytes - 3))\n    return v\n\n\ndef deser_vector(f, c):\n    nit = deser_compact_size(f)\n    r = []\n    for i in range(nit):\n        t = c()\n        t.deserialize(f)\n        r.append(t)\n    return r\n\n\n# ser_function_name: Allow for an alternate serialization function on the\n# entries in the vector (we use this for serializing the vector of transactions\n# for a witness block).\ndef ser_vector(l, ser_function_name=None):\n    r = ser_compact_size(len(l))\n    for i in l:\n        if ser_function_name:\n            r += getattr(i, ser_function_name)()\n        else:\n            r += i.serialize()\n    return r\n\n\ndef deser_uint256_vector(f):\n    nit = deser_compact_size(f)\n    r = []\n    for i in range(nit):\n        t = deser_uint256(f)\n        r.append(t)\n    return r\n\n\ndef ser_uint256_vector(l):\n    r = ser_compact_size(len(l))\n    for i in l:\n        r += ser_uint256(i)\n    return r\n\n\ndef deser_string_vector(f):\n    nit = deser_compact_size(f)\n    r = []\n    for i in range(nit):\n        t = deser_string(f)\n        r.append(t)\n    return r\n\n\ndef ser_string_vector(l):\n    r = ser_compact_size(len(l))\n    for sv in l:\n        r += ser_string(sv)\n    return r\n\n\n# Deserialize from a hex string representation (eg from RPC)\ndef FromHex(obj, hex_string):\n    obj.deserialize(BytesIO(hex_str_to_bytes(hex_string)))\n    return obj\n\n# Convert a binary-serializable object to hex (eg for submission via RPC)\ndef ToHex(obj):\n    return bytes_to_hex_str(obj.serialize())\n\n# Objects that map to bitcoind objects, which can be serialized/deserialized\n\nclass CAddress():\n    def __init__(self):\n        self.nServices = 1\n        self.pchReserved = b\"\\x00\" * 10 + b\"\\xff\" * 2\n        self.ip = \"0.0.0.0\"\n        self.port = 0\n\n    def deserialize(self, f):\n        self.nServices = struct.unpack(\"<Q\", f.read(8))[0]\n        self.pchReserved = f.read(12)\n        self.ip = socket.inet_ntoa(f.read(4))\n        self.port = struct.unpack(\">H\", f.read(2))[0]\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<Q\", self.nServices)\n        r += self.pchReserved\n        r += socket.inet_aton(self.ip)\n        r += struct.pack(\">H\", self.port)\n        return r\n\n    def __repr__(self):\n        return \"CAddress(nServices=%i ip=%s port=%i)\" % (self.nServices,\n                                                         self.ip, self.port)\n\nMSG_WITNESS_FLAG = 1<<30\n\nclass CInv():\n    typemap = {\n        0: \"Error\",\n        1: \"TX\",\n        2: \"Block\",\n        1|MSG_WITNESS_FLAG: \"WitnessTx\",\n        2|MSG_WITNESS_FLAG : \"WitnessBlock\",\n        4: \"CompactBlock\"\n    }\n\n    def __init__(self, t=0, h=0):\n        self.type = t\n        self.hash = h\n\n    def deserialize(self, f):\n        self.type = struct.unpack(\"<i\", f.read(4))[0]\n        self.hash = deser_uint256(f)\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<i\", self.type)\n        r += ser_uint256(self.hash)\n        return r\n\n    def __repr__(self):\n        return \"CInv(type=%s hash=%064x)\" \\\n            % (self.typemap[self.type], self.hash)\n\n\nclass CBlockLocator():\n    def __init__(self):\n        self.nVersion = MY_VERSION\n        self.vHave = []\n\n    def deserialize(self, f):\n        self.nVersion = struct.unpack(\"<i\", f.read(4))[0]\n        self.vHave = deser_uint256_vector(f)\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<i\", self.nVersion)\n        r += ser_uint256_vector(self.vHave)\n        return r\n\n    def __repr__(self):\n        return \"CBlockLocator(nVersion=%i vHave=%s)\" \\\n            % (self.nVersion, repr(self.vHave))\n\n\nclass COutPoint():\n    def __init__(self, hash=0, n=0):\n        self.hash = hash\n        self.n = n\n\n    def deserialize(self, f):\n        self.hash = deser_uint256(f)\n        self.n = struct.unpack(\"<I\", f.read(4))[0]\n\n    def serialize(self):\n        r = b\"\"\n        r += ser_uint256(self.hash)\n        r += struct.pack(\"<I\", self.n)\n        return r\n\n    def __repr__(self):\n        return \"COutPoint(hash=%064x n=%i)\" % (self.hash, self.n)\n\n\nclass CTxIn():\n    def __init__(self, outpoint=None, scriptSig=b\"\", nSequence=0):\n        if outpoint is None:\n            self.prevout = COutPoint()\n        else:\n            self.prevout = outpoint\n        self.scriptSig = scriptSig\n        self.nSequence = nSequence\n\n    def deserialize(self, f):\n        self.prevout = COutPoint()\n        self.prevout.deserialize(f)\n        self.scriptSig = deser_string(f)\n        self.nSequence = struct.unpack(\"<I\", f.read(4))[0]\n\n    def serialize(self):\n        r = b\"\"\n        r += self.prevout.serialize()\n        r += ser_string(self.scriptSig)\n        r += struct.pack(\"<I\", self.nSequence)\n        return r\n\n    def __repr__(self):\n        return \"CTxIn(prevout=%s scriptSig=%s nSequence=%i)\" \\\n            % (repr(self.prevout), bytes_to_hex_str(self.scriptSig),\n               self.nSequence)\n\n\nclass CTxOut():\n    def __init__(self, nValue=0, scriptPubKey=b\"\"):\n        self.nValue = nValue\n        self.scriptPubKey = scriptPubKey\n\n    def deserialize(self, f):\n        self.nValue = struct.unpack(\"<q\", f.read(8))[0]\n        self.scriptPubKey = deser_string(f)\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<q\", self.nValue)\n        r += ser_string(self.scriptPubKey)\n        return r\n\n    def __repr__(self):\n        return \"CTxOut(nValue=%i.%08i scriptPubKey=%s)\" \\\n            % (self.nValue // COIN, self.nValue % COIN,\n               bytes_to_hex_str(self.scriptPubKey))\n\n\nclass CScriptWitness():\n    def __init__(self):\n        # stack is a vector of strings\n        self.stack = []\n\n    def __repr__(self):\n        return \"CScriptWitness(%s)\" % \\\n               (\",\".join([bytes_to_hex_str(x) for x in self.stack]))\n\n    def is_null(self):\n        if self.stack:\n            return False\n        return True\n\n\nclass CTxInWitness():\n    def __init__(self):\n        self.scriptWitness = CScriptWitness()\n\n    def deserialize(self, f):\n        self.scriptWitness.stack = deser_string_vector(f)\n\n    def serialize(self):\n        return ser_string_vector(self.scriptWitness.stack)\n\n    def __repr__(self):\n        return repr(self.scriptWitness)\n\n    def is_null(self):\n        return self.scriptWitness.is_null()\n\n\nclass CTxWitness():\n    def __init__(self):\n        self.vtxinwit = []\n\n    def deserialize(self, f):\n        for i in range(len(self.vtxinwit)):\n            self.vtxinwit[i].deserialize(f)\n\n    def serialize(self):\n        r = b\"\"\n        # This is different than the usual vector serialization --\n        # we omit the length of the vector, which is required to be\n        # the same length as the transaction's vin vector.\n        for x in self.vtxinwit:\n            r += x.serialize()\n        return r\n\n    def __repr__(self):\n        return \"CTxWitness(%s)\" % \\\n               (';'.join([repr(x) for x in self.vtxinwit]))\n\n    def is_null(self):\n        for x in self.vtxinwit:\n            if not x.is_null():\n                return False\n        return True\n\n\nclass CTransaction():\n    def __init__(self, tx=None):\n        if tx is None:\n            self.nVersion = 1\n            self.vin = []\n            self.vout = []\n            self.wit = CTxWitness()\n            self.nLockTime = 0\n            self.sha256 = None\n            self.hash = None\n        else:\n            self.nVersion = tx.nVersion\n            self.vin = copy.deepcopy(tx.vin)\n            self.vout = copy.deepcopy(tx.vout)\n            self.nLockTime = tx.nLockTime\n            self.sha256 = tx.sha256\n            self.hash = tx.hash\n            self.wit = copy.deepcopy(tx.wit)\n\n    def deserialize(self, f):\n        self.nVersion = struct.unpack(\"<i\", f.read(4))[0]\n        self.vin = deser_vector(f, CTxIn)\n        flags = 0\n        if len(self.vin) == 0:\n            flags = struct.unpack(\"<B\", f.read(1))[0]\n            # Not sure why flags can't be zero, but this\n            # matches the implementation in bitcoind\n            if (flags != 0):\n                self.vin = deser_vector(f, CTxIn)\n                self.vout = deser_vector(f, CTxOut)\n        else:\n            self.vout = deser_vector(f, CTxOut)\n        if flags != 0:\n            self.wit.vtxinwit = [CTxInWitness() for i in range(len(self.vin))]\n            self.wit.deserialize(f)\n        self.nLockTime = struct.unpack(\"<I\", f.read(4))[0]\n        self.sha256 = None\n        self.hash = None\n\n    def serialize_without_witness(self):\n        r = b\"\"\n        r += struct.pack(\"<i\", self.nVersion)\n        r += ser_vector(self.vin)\n        r += ser_vector(self.vout)\n        r += struct.pack(\"<I\", self.nLockTime)\n        return r\n\n    # Only serialize with witness when explicitly called for\n    def serialize_with_witness(self):\n        flags = 0\n        if not self.wit.is_null():\n            flags |= 1\n        r = b\"\"\n        r += struct.pack(\"<i\", self.nVersion)\n        if flags:\n            dummy = []\n            r += ser_vector(dummy)\n            r += struct.pack(\"<B\", flags)\n        r += ser_vector(self.vin)\n        r += ser_vector(self.vout)\n        if flags & 1:\n            if (len(self.wit.vtxinwit) != len(self.vin)):\n                # vtxinwit must have the same length as vin\n                self.wit.vtxinwit = self.wit.vtxinwit[:len(self.vin)]\n                for i in range(len(self.wit.vtxinwit), len(self.vin)):\n                    self.wit.vtxinwit.append(CTxInWitness())\n            r += self.wit.serialize()\n        r += struct.pack(\"<I\", self.nLockTime)\n        return r\n\n    # Regular serialization is with witness -- must explicitly\n    # call serialize_without_witness to exclude witness data.\n    def serialize(self):\n        return self.serialize_with_witness()\n\n    # Recalculate the txid (transaction hash without witness)\n    def rehash(self):\n        self.sha256 = None\n        self.calc_sha256()\n\n    # We will only cache the serialization without witness in\n    # self.sha256 and self.hash -- those are expected to be the txid.\n    def calc_sha256(self, with_witness=False):\n        if with_witness:\n            # Don't cache the result, just return it\n            return uint256_from_str(hash256(self.serialize_with_witness()))\n\n        if self.sha256 is None:\n            self.sha256 = uint256_from_str(hash256(self.serialize_without_witness()))\n        self.hash = encode(hash256(self.serialize_without_witness())[::-1], 'hex_codec').decode('ascii')\n\n    def is_valid(self):\n        self.calc_sha256()\n        for tout in self.vout:\n            if tout.nValue < 0 or tout.nValue > 1073741824 * COIN:   # // total supply in theory\n                return False\n        return True\n\n    def __repr__(self):\n        return \"CTransaction(nVersion=%i vin=%s vout=%s wit=%s nLockTime=%i)\" \\\n            % (self.nVersion, repr(self.vin), repr(self.vout), repr(self.wit), self.nLockTime)\n\n\nclass CBlockHeader():\n    def __init__(self, header=None):\n        if header is None:\n            self.set_null()\n        else:\n            self.nVersion = header.nVersion\n            self.hashPrevBlock = header.hashPrevBlock\n            self.hashMerkleRoot = header.hashMerkleRoot\n            self.nTime = header.nTime\n            self.nBits = header.nBits\n            self.nNonce = header.nNonce\n            self.sha256 = header.sha256\n            self.hash = header.hash\n            self.calc_sha256()\n\n    def set_null(self):\n        self.nVersion = 1\n        self.hashPrevBlock = 0\n        self.hashMerkleRoot = 0\n        self.nTime = 0\n        self.nBits = 0\n        self.nNonce = 0\n        self.sha256 = None\n        self.hash = None\n\n    def deserialize(self, f):\n        self.nVersion = struct.unpack(\"<i\", f.read(4))[0]\n        self.hashPrevBlock = deser_uint256(f)\n        self.hashMerkleRoot = deser_uint256(f)\n        self.nTime = struct.unpack(\"<I\", f.read(4))[0]\n        self.nBits = struct.unpack(\"<I\", f.read(4))[0]\n        self.nNonce = struct.unpack(\"<I\", f.read(4))[0]\n        self.sha256 = None\n        self.hash = None\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<i\", self.nVersion)\n        r += ser_uint256(self.hashPrevBlock)\n        r += ser_uint256(self.hashMerkleRoot)\n        r += struct.pack(\"<I\", self.nTime)\n        r += struct.pack(\"<I\", self.nBits)\n        r += struct.pack(\"<I\", self.nNonce)\n        return r\n\n    def calc_sha256(self):\n        if self.sha256 is None:\n            r = b\"\"\n            r += struct.pack(\"<i\", self.nVersion)\n            r += ser_uint256(self.hashPrevBlock)\n            r += ser_uint256(self.hashMerkleRoot)\n            r += struct.pack(\"<I\", self.nTime)\n            r += struct.pack(\"<I\", self.nBits)\n            r += struct.pack(\"<I\", self.nNonce)\n            self.sha256 = uint256_from_str(hash256(r))\n            self.hash = encode(hash256(r)[::-1], 'hex_codec').decode('ascii')\n\n    def rehash(self):\n        self.sha256 = None\n        self.calc_sha256()\n        return self.sha256\n\n    def __repr__(self):\n        return \"CBlockHeader(nVersion=%i hashPrevBlock=%064x hashMerkleRoot=%064x nTime=%s nBits=%08x nNonce=%08x)\" \\\n            % (self.nVersion, self.hashPrevBlock, self.hashMerkleRoot,\n               time.ctime(self.nTime), self.nBits, self.nNonce)\n\n\nclass CBlock(CBlockHeader):\n    def __init__(self, header=None):\n        super(CBlock, self).__init__(header)\n        self.vtx = []\n\n    def deserialize(self, f):\n        super(CBlock, self).deserialize(f)\n        self.vtx = deser_vector(f, CTransaction)\n\n    def serialize(self, with_witness=False):\n        r = b\"\"\n        r += super(CBlock, self).serialize()\n        if with_witness:\n            r += ser_vector(self.vtx, \"serialize_with_witness\")\n        else:\n            r += ser_vector(self.vtx, \"serialize_without_witness\")\n        return r\n\n    # Calculate the merkle root given a vector of transaction hashes\n    @classmethod\n    def get_merkle_root(cls, hashes):\n        while len(hashes) > 1:\n            newhashes = []\n            for i in range(0, len(hashes), 2):\n                i2 = min(i+1, len(hashes)-1)\n                newhashes.append(hash256(hashes[i] + hashes[i2]))\n            hashes = newhashes\n        return uint256_from_str(hashes[0])\n\n    def calc_merkle_root(self):\n        hashes = []\n        for tx in self.vtx:\n            tx.calc_sha256()\n            hashes.append(ser_uint256(tx.sha256))\n        return self.get_merkle_root(hashes)\n\n    def calc_witness_merkle_root(self):\n        # For witness root purposes, the hash of the\n        # coinbase, with witness, is defined to be 0...0\n        hashes = [ser_uint256(0)]\n\n        for tx in self.vtx[1:]:\n            # Calculate the hashes with witness data\n            hashes.append(ser_uint256(tx.calc_sha256(True)))\n\n        return self.get_merkle_root(hashes)\n\n    def is_valid(self):\n        self.calc_sha256()\n        target = uint256_from_compact(self.nBits)\n        if self.sha256 > target:\n            return False\n        for tx in self.vtx:\n            if not tx.is_valid():\n                return False\n        if self.calc_merkle_root() != self.hashMerkleRoot:\n            return False\n        return True\n\n    def solve(self):\n        self.rehash()\n        target = uint256_from_compact(self.nBits)\n        while self.sha256 > target:\n            self.nNonce += 1\n            self.rehash()\n\n    def __repr__(self):\n        return \"CBlock(nVersion=%i hashPrevBlock=%064x hashMerkleRoot=%064x nTime=%s nBits=%08x nNonce=%08x vtx=%s)\" \\\n            % (self.nVersion, self.hashPrevBlock, self.hashMerkleRoot,\n               time.ctime(self.nTime), self.nBits, self.nNonce, repr(self.vtx))\n\n\nclass PrefilledTransaction():\n    def __init__(self, index=0, tx = None):\n        self.index = index\n        self.tx = tx\n\n    def deserialize(self, f):\n        self.index = deser_compact_size(f)\n        self.tx = CTransaction()\n        self.tx.deserialize(f)\n\n    def serialize(self, with_witness=True):\n        r = b\"\"\n        r += ser_compact_size(self.index)\n        if with_witness:\n            r += self.tx.serialize_with_witness()\n        else:\n            r += self.tx.serialize_without_witness()\n        return r\n\n    def serialize_without_witness(self):\n        return self.serialize(with_witness=False)\n\n    def serialize_with_witness(self):\n        return self.serialize(with_witness=True)\n\n    def __repr__(self):\n        return \"PrefilledTransaction(index=%d, tx=%s)\" % (self.index, repr(self.tx))\n\n# This is what we send on the wire, in a cmpctblock message.\nclass P2PHeaderAndShortIDs():\n    def __init__(self):\n        self.header = CBlockHeader()\n        self.nonce = 0\n        self.shortids_length = 0\n        self.shortids = []\n        self.prefilled_txn_length = 0\n        self.prefilled_txn = []\n\n    def deserialize(self, f):\n        self.header.deserialize(f)\n        self.nonce = struct.unpack(\"<Q\", f.read(8))[0]\n        self.shortids_length = deser_compact_size(f)\n        for i in range(self.shortids_length):\n            # shortids are defined to be 6 bytes in the spec, so append\n            # two zero bytes and read it in as an 8-byte number\n            self.shortids.append(struct.unpack(\"<Q\", f.read(6) + b'\\x00\\x00')[0])\n        self.prefilled_txn = deser_vector(f, PrefilledTransaction)\n        self.prefilled_txn_length = len(self.prefilled_txn)\n\n    # When using version 2 compact blocks, we must serialize with_witness.\n    def serialize(self, with_witness=False):\n        r = b\"\"\n        r += self.header.serialize()\n        r += struct.pack(\"<Q\", self.nonce)\n        r += ser_compact_size(self.shortids_length)\n        for x in self.shortids:\n            # We only want the first 6 bytes\n            r += struct.pack(\"<Q\", x)[0:6]\n        if with_witness:\n            r += ser_vector(self.prefilled_txn, \"serialize_with_witness\")\n        else:\n            r += ser_vector(self.prefilled_txn, \"serialize_without_witness\")\n        return r\n\n    def __repr__(self):\n        return \"P2PHeaderAndShortIDs(header=%s, nonce=%d, shortids_length=%d, shortids=%s, prefilled_txn_length=%d, prefilledtxn=%s\" % (repr(self.header), self.nonce, self.shortids_length, repr(self.shortids), self.prefilled_txn_length, repr(self.prefilled_txn))\n\n# P2P version of the above that will use witness serialization (for compact\n# block version 2)\nclass P2PHeaderAndShortWitnessIDs(P2PHeaderAndShortIDs):\n    def serialize(self):\n        return super(P2PHeaderAndShortWitnessIDs, self).serialize(with_witness=True)\n\n# Calculate the BIP 152-compact blocks shortid for a given transaction hash\ndef calculate_shortid(k0, k1, tx_hash):\n    expected_shortid = siphash256(k0, k1, tx_hash)\n    expected_shortid &= 0x0000ffffffffffff\n    return expected_shortid\n\n# This version gets rid of the array lengths, and reinterprets the differential\n# encoding into indices that can be used for lookup.\nclass HeaderAndShortIDs():\n    def __init__(self, p2pheaders_and_shortids = None):\n        self.header = CBlockHeader()\n        self.nonce = 0\n        self.shortids = []\n        self.prefilled_txn = []\n        self.use_witness = False\n\n        if p2pheaders_and_shortids != None:\n            self.header = p2pheaders_and_shortids.header\n            self.nonce = p2pheaders_and_shortids.nonce\n            self.shortids = p2pheaders_and_shortids.shortids\n            last_index = -1\n            for x in p2pheaders_and_shortids.prefilled_txn:\n                self.prefilled_txn.append(PrefilledTransaction(x.index + last_index + 1, x.tx))\n                last_index = self.prefilled_txn[-1].index\n\n    def to_p2p(self):\n        if self.use_witness:\n            ret = P2PHeaderAndShortWitnessIDs()\n        else:\n            ret = P2PHeaderAndShortIDs()\n        ret.header = self.header\n        ret.nonce = self.nonce\n        ret.shortids_length = len(self.shortids)\n        ret.shortids = self.shortids\n        ret.prefilled_txn_length = len(self.prefilled_txn)\n        ret.prefilled_txn = []\n        last_index = -1\n        for x in self.prefilled_txn:\n            ret.prefilled_txn.append(PrefilledTransaction(x.index - last_index - 1, x.tx))\n            last_index = x.index\n        return ret\n\n    def get_siphash_keys(self):\n        header_nonce = self.header.serialize()\n        header_nonce += struct.pack(\"<Q\", self.nonce)\n        hash_header_nonce_as_str = sha256(header_nonce)\n        key0 = struct.unpack(\"<Q\", hash_header_nonce_as_str[0:8])[0]\n        key1 = struct.unpack(\"<Q\", hash_header_nonce_as_str[8:16])[0]\n        return [ key0, key1 ]\n\n    # Version 2 compact blocks use wtxid in shortids (rather than txid)\n    def initialize_from_block(self, block, nonce=0, prefill_list = [0], use_witness = False):\n        self.header = CBlockHeader(block)\n        self.nonce = nonce\n        self.prefilled_txn = [ PrefilledTransaction(i, block.vtx[i]) for i in prefill_list ]\n        self.shortids = []\n        self.use_witness = use_witness\n        [k0, k1] = self.get_siphash_keys()\n        for i in range(len(block.vtx)):\n            if i not in prefill_list:\n                tx_hash = block.vtx[i].sha256\n                if use_witness:\n                    tx_hash = block.vtx[i].calc_sha256(with_witness=True)\n                self.shortids.append(calculate_shortid(k0, k1, tx_hash))\n\n    def __repr__(self):\n        return \"HeaderAndShortIDs(header=%s, nonce=%d, shortids=%s, prefilledtxn=%s\" % (repr(self.header), self.nonce, repr(self.shortids), repr(self.prefilled_txn))\n\n\nclass BlockTransactionsRequest():\n\n    def __init__(self, blockhash=0, indexes = None):\n        self.blockhash = blockhash\n        self.indexes = indexes if indexes != None else []\n\n    def deserialize(self, f):\n        self.blockhash = deser_uint256(f)\n        indexes_length = deser_compact_size(f)\n        for i in range(indexes_length):\n            self.indexes.append(deser_compact_size(f))\n\n    def serialize(self):\n        r = b\"\"\n        r += ser_uint256(self.blockhash)\n        r += ser_compact_size(len(self.indexes))\n        for x in self.indexes:\n            r += ser_compact_size(x)\n        return r\n\n    # helper to set the differentially encoded indexes from absolute ones\n    def from_absolute(self, absolute_indexes):\n        self.indexes = []\n        last_index = -1\n        for x in absolute_indexes:\n            self.indexes.append(x-last_index-1)\n            last_index = x\n\n    def to_absolute(self):\n        absolute_indexes = []\n        last_index = -1\n        for x in self.indexes:\n            absolute_indexes.append(x+last_index+1)\n            last_index = absolute_indexes[-1]\n        return absolute_indexes\n\n    def __repr__(self):\n        return \"BlockTransactionsRequest(hash=%064x indexes=%s)\" % (self.blockhash, repr(self.indexes))\n\n\nclass BlockTransactions():\n\n    def __init__(self, blockhash=0, transactions = None):\n        self.blockhash = blockhash\n        self.transactions = transactions if transactions != None else []\n\n    def deserialize(self, f):\n        self.blockhash = deser_uint256(f)\n        self.transactions = deser_vector(f, CTransaction)\n\n    def serialize(self, with_witness=True):\n        r = b\"\"\n        r += ser_uint256(self.blockhash)\n        if with_witness:\n            r += ser_vector(self.transactions, \"serialize_with_witness\")\n        else:\n            r += ser_vector(self.transactions, \"serialize_without_witness\")\n        return r\n\n    def __repr__(self):\n        return \"BlockTransactions(hash=%064x transactions=%s)\" % (self.blockhash, repr(self.transactions))\n\nclass CPartialMerkleTree():\n    def __init__(self):\n        self.nTransactions = 0\n        self.vHash = []\n        self.vBits = []\n        self.fBad = False\n\n    def deserialize(self, f):\n        self.nTransactions = struct.unpack(\"<i\", f.read(4))[0]\n        self.vHash = deser_uint256_vector(f)\n        vBytes = deser_string(f)\n        self.vBits = []\n        for i in range(len(vBytes) * 8):\n            self.vBits.append(vBytes[i//8] & (1 << (i % 8)) != 0)\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<i\", self.nTransactions)\n        r += ser_uint256_vector(self.vHash)\n        vBytesArray = bytearray([0x00] * ((len(self.vBits) + 7)//8))\n        for i in range(len(self.vBits)):\n            vBytesArray[i // 8] |= self.vBits[i] << (i % 8)\n        r += ser_string(bytes(vBytesArray))\n        return r\n\n    def __repr__(self):\n        return \"CPartialMerkleTree(nTransactions=%d, vHash=%s, vBits=%s)\" % (self.nTransactions, repr(self.vHash), repr(self.vBits))\n\nclass CMerkleBlock():\n    def __init__(self):\n        self.header = CBlockHeader()\n        self.txn = CPartialMerkleTree()\n\n    def deserialize(self, f):\n        self.header.deserialize(f)\n        self.txn.deserialize(f)\n\n    def serialize(self):\n        r = b\"\"\n        r += self.header.serialize()\n        r += self.txn.serialize()\n        return r\n\n    def __repr__(self):\n        return \"CMerkleBlock(header=%s, txn=%s)\" % (repr(self.header), repr(self.txn))\n\n\n# Objects that correspond to messages on the wire\nclass msg_version():\n    command = b\"version\"\n\n    def __init__(self):\n        self.nVersion = MY_VERSION\n        self.nServices = NODE_NETWORK | NODE_WITNESS\n        self.nTime = int(time.time())\n        self.addrTo = CAddress()\n        self.addrFrom = CAddress()\n        self.nNonce = random.getrandbits(64)\n        self.strSubVer = MY_SUBVERSION\n        self.nStartingHeight = -1\n        self.nRelay = MY_RELAY\n\n    def deserialize(self, f):\n        self.nVersion = struct.unpack(\"<i\", f.read(4))[0]\n        if self.nVersion == 10300:\n            self.nVersion = 300\n        self.nServices = struct.unpack(\"<Q\", f.read(8))[0]\n        self.nTime = struct.unpack(\"<q\", f.read(8))[0]\n        self.addrTo = CAddress()\n        self.addrTo.deserialize(f)\n\n        if self.nVersion >= 106:\n            self.addrFrom = CAddress()\n            self.addrFrom.deserialize(f)\n            self.nNonce = struct.unpack(\"<Q\", f.read(8))[0]\n            self.strSubVer = deser_string(f)\n        else:\n            self.addrFrom = None\n            self.nNonce = None\n            self.strSubVer = None\n            self.nStartingHeight = None\n\n        if self.nVersion >= 209:\n            self.nStartingHeight = struct.unpack(\"<i\", f.read(4))[0]\n        else:\n            self.nStartingHeight = None\n\n        if self.nVersion >= 70001:\n            # Relay field is optional for version 70001 onwards\n            try:\n                self.nRelay = struct.unpack(\"<b\", f.read(1))[0]\n            except:\n                self.nRelay = 0\n        else:\n            self.nRelay = 0\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<i\", self.nVersion)\n        r += struct.pack(\"<Q\", self.nServices)\n        r += struct.pack(\"<q\", self.nTime)\n        r += self.addrTo.serialize()\n        r += self.addrFrom.serialize()\n        r += struct.pack(\"<Q\", self.nNonce)\n        r += ser_string(self.strSubVer)\n        r += struct.pack(\"<i\", self.nStartingHeight)\n        r += struct.pack(\"<b\", self.nRelay)\n        return r\n\n    def __repr__(self):\n        return 'msg_version(nVersion=%i nServices=%i nTime=%s addrTo=%s addrFrom=%s nNonce=0x%016X strSubVer=%s nStartingHeight=%i nRelay=%i)' \\\n            % (self.nVersion, self.nServices, time.ctime(self.nTime),\n               repr(self.addrTo), repr(self.addrFrom), self.nNonce,\n               self.strSubVer, self.nStartingHeight, self.nRelay)\n\n\nclass msg_verack():\n    command = b\"verack\"\n\n    def __init__(self):\n        pass\n\n    def deserialize(self, f):\n        pass\n\n    def serialize(self):\n        return b\"\"\n\n    def __repr__(self):\n        return \"msg_verack()\"\n\n\nclass msg_addr():\n    command = b\"addr\"\n\n    def __init__(self):\n        self.addrs = []\n\n    def deserialize(self, f):\n        self.addrs = deser_vector(f, CAddress)\n\n    def serialize(self):\n        return ser_vector(self.addrs)\n\n    def __repr__(self):\n        return \"msg_addr(addrs=%s)\" % (repr(self.addrs))\n\n\nclass msg_inv():\n    command = b\"inv\"\n\n    def __init__(self, inv=None):\n        if inv is None:\n            self.inv = []\n        else:\n            self.inv = inv\n\n    def deserialize(self, f):\n        self.inv = deser_vector(f, CInv)\n\n    def serialize(self):\n        return ser_vector(self.inv)\n\n    def __repr__(self):\n        return \"msg_inv(inv=%s)\" % (repr(self.inv))\n\n\nclass msg_getdata():\n    command = b\"getdata\"\n\n    def __init__(self, inv=None):\n        self.inv = inv if inv != None else []\n\n    def deserialize(self, f):\n        self.inv = deser_vector(f, CInv)\n\n    def serialize(self):\n        return ser_vector(self.inv)\n\n    def __repr__(self):\n        return \"msg_getdata(inv=%s)\" % (repr(self.inv))\n\n\nclass msg_getblocks():\n    command = b\"getblocks\"\n\n    def __init__(self):\n        self.locator = CBlockLocator()\n        self.hashstop = 0\n\n    def deserialize(self, f):\n        self.locator = CBlockLocator()\n        self.locator.deserialize(f)\n        self.hashstop = deser_uint256(f)\n\n    def serialize(self):\n        r = b\"\"\n        r += self.locator.serialize()\n        r += ser_uint256(self.hashstop)\n        return r\n\n    def __repr__(self):\n        return \"msg_getblocks(locator=%s hashstop=%064x)\" \\\n            % (repr(self.locator), self.hashstop)\n\n\nclass msg_tx():\n    command = b\"tx\"\n\n    def __init__(self, tx=CTransaction()):\n        self.tx = tx\n\n    def deserialize(self, f):\n        self.tx.deserialize(f)\n\n    def serialize(self):\n        return self.tx.serialize_without_witness()\n\n    def __repr__(self):\n        return \"msg_tx(tx=%s)\" % (repr(self.tx))\n\nclass msg_witness_tx(msg_tx):\n\n    def serialize(self):\n        return self.tx.serialize_with_witness()\n\n\nclass msg_block():\n    command = b\"block\"\n\n    def __init__(self, block=None):\n        if block is None:\n            self.block = CBlock()\n        else:\n            self.block = block\n\n    def deserialize(self, f):\n        self.block.deserialize(f)\n\n    def serialize(self):\n        return self.block.serialize(with_witness=False)\n\n    def __repr__(self):\n        return \"msg_block(block=%s)\" % (repr(self.block))\n\n# for cases where a user needs tighter control over what is sent over the wire\n# note that the user must supply the name of the command, and the data\nclass msg_generic():\n    def __init__(self, command, data=None):\n        self.command = command\n        self.data = data\n\n    def serialize(self):\n        return self.data\n\n    def __repr__(self):\n        return \"msg_generic()\"\n\nclass msg_witness_block(msg_block):\n\n    def serialize(self):\n        r = self.block.serialize(with_witness=True)\n        return r\n\nclass msg_getaddr():\n    command = b\"getaddr\"\n\n    def __init__(self):\n        pass\n\n    def deserialize(self, f):\n        pass\n\n    def serialize(self):\n        return b\"\"\n\n    def __repr__(self):\n        return \"msg_getaddr()\"\n\n\nclass msg_ping():\n    command = b\"ping\"\n\n    def __init__(self, nonce=0):\n        self.nonce = nonce\n\n    def deserialize(self, f):\n        self.nonce = struct.unpack(\"<Q\", f.read(8))[0]\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<Q\", self.nonce)\n        return r\n\n    def __repr__(self):\n        return \"msg_ping(nonce=%08x)\" % self.nonce\n\n\nclass msg_pong():\n    command = b\"pong\"\n\n    def __init__(self, nonce=0):\n        self.nonce = nonce\n\n    def deserialize(self, f):\n        self.nonce = struct.unpack(\"<Q\", f.read(8))[0]\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<Q\", self.nonce)\n        return r\n\n    def __repr__(self):\n        return \"msg_pong(nonce=%08x)\" % self.nonce\n\n\nclass msg_mempool():\n    command = b\"mempool\"\n\n    def __init__(self):\n        pass\n\n    def deserialize(self, f):\n        pass\n\n    def serialize(self):\n        return b\"\"\n\n    def __repr__(self):\n        return \"msg_mempool()\"\n\nclass msg_sendheaders():\n    command = b\"sendheaders\"\n\n    def __init__(self):\n        pass\n\n    def deserialize(self, f):\n        pass\n\n    def serialize(self):\n        return b\"\"\n\n    def __repr__(self):\n        return \"msg_sendheaders()\"\n\n\n# getheaders message has\n# number of entries\n# vector of hashes\n# hash_stop (hash of last desired block header, 0 to get as many as possible)\nclass msg_getheaders():\n    command = b\"getheaders\"\n\n    def __init__(self):\n        self.locator = CBlockLocator()\n        self.hashstop = 0\n\n    def deserialize(self, f):\n        self.locator = CBlockLocator()\n        self.locator.deserialize(f)\n        self.hashstop = deser_uint256(f)\n\n    def serialize(self):\n        r = b\"\"\n        r += self.locator.serialize()\n        r += ser_uint256(self.hashstop)\n        return r\n\n    def __repr__(self):\n        return \"msg_getheaders(locator=%s, stop=%064x)\" \\\n            % (repr(self.locator), self.hashstop)\n\n\n# headers message has\n# <count> <vector of block headers>\nclass msg_headers():\n    command = b\"headers\"\n\n    def __init__(self, headers=None):\n        self.headers = headers if headers is not None else []\n\n    def deserialize(self, f):\n        # comment in bitcoind indicates these should be deserialized as blocks\n        blocks = deser_vector(f, CBlock)\n        for x in blocks:\n            self.headers.append(CBlockHeader(x))\n\n    def serialize(self):\n        blocks = [CBlock(x) for x in self.headers]\n        return ser_vector(blocks)\n\n    def __repr__(self):\n        return \"msg_headers(headers=%s)\" % repr(self.headers)\n\n\nclass msg_reject():\n    command = b\"reject\"\n    REJECT_MALFORMED = 1\n\n    def __init__(self):\n        self.message = b\"\"\n        self.code = 0\n        self.reason = b\"\"\n        self.data = 0\n\n    def deserialize(self, f):\n        self.message = deser_string(f)\n        self.code = struct.unpack(\"<B\", f.read(1))[0]\n        self.reason = deser_string(f)\n        if (self.code != self.REJECT_MALFORMED and\n                (self.message == b\"block\" or self.message == b\"tx\")):\n            self.data = deser_uint256(f)\n\n    def serialize(self):\n        r = ser_string(self.message)\n        r += struct.pack(\"<B\", self.code)\n        r += ser_string(self.reason)\n        if (self.code != self.REJECT_MALFORMED and\n                (self.message == b\"block\" or self.message == b\"tx\")):\n            r += ser_uint256(self.data)\n        return r\n\n    def __repr__(self):\n        return \"msg_reject: %s %d %s [%064x]\" \\\n            % (self.message, self.code, self.reason, self.data)\n\nclass msg_feefilter():\n    command = b\"feefilter\"\n\n    def __init__(self, feerate=0):\n        self.feerate = feerate\n\n    def deserialize(self, f):\n        self.feerate = struct.unpack(\"<Q\", f.read(8))[0]\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<Q\", self.feerate)\n        return r\n\n    def __repr__(self):\n        return \"msg_feefilter(feerate=%08x)\" % self.feerate\n\nclass msg_sendcmpct():\n    command = b\"sendcmpct\"\n\n    def __init__(self):\n        self.announce = False\n        self.version = 1\n\n    def deserialize(self, f):\n        self.announce = struct.unpack(\"<?\", f.read(1))[0]\n        self.version = struct.unpack(\"<Q\", f.read(8))[0]\n\n    def serialize(self):\n        r = b\"\"\n        r += struct.pack(\"<?\", self.announce)\n        r += struct.pack(\"<Q\", self.version)\n        return r\n\n    def __repr__(self):\n        return \"msg_sendcmpct(announce=%s, version=%lu)\" % (self.announce, self.version)\n\nclass msg_cmpctblock():\n    command = b\"cmpctblock\"\n\n    def __init__(self, header_and_shortids = None):\n        self.header_and_shortids = header_and_shortids\n\n    def deserialize(self, f):\n        self.header_and_shortids = P2PHeaderAndShortIDs()\n        self.header_and_shortids.deserialize(f)\n\n    def serialize(self):\n        r = b\"\"\n        r += self.header_and_shortids.serialize()\n        return r\n\n    def __repr__(self):\n        return \"msg_cmpctblock(HeaderAndShortIDs=%s)\" % repr(self.header_and_shortids)\n\nclass msg_getblocktxn():\n    command = b\"getblocktxn\"\n\n    def __init__(self):\n        self.block_txn_request = None\n\n    def deserialize(self, f):\n        self.block_txn_request = BlockTransactionsRequest()\n        self.block_txn_request.deserialize(f)\n\n    def serialize(self):\n        r = b\"\"\n        r += self.block_txn_request.serialize()\n        return r\n\n    def __repr__(self):\n        return \"msg_getblocktxn(block_txn_request=%s)\" % (repr(self.block_txn_request))\n\nclass msg_blocktxn():\n    command = b\"blocktxn\"\n\n    def __init__(self):\n        self.block_transactions = BlockTransactions()\n\n    def deserialize(self, f):\n        self.block_transactions.deserialize(f)\n\n    def serialize(self):\n        r = b\"\"\n        r += self.block_transactions.serialize(with_witness=False)\n        return r\n\n    def __repr__(self):\n        return \"msg_blocktxn(block_transactions=%s)\" % (repr(self.block_transactions))\n\nclass msg_witness_blocktxn(msg_blocktxn):\n    def serialize(self):\n        r = b\"\"\n        r += self.block_transactions.serialize(with_witness=True)\n        return r\n"
  },
  {
    "path": "test/functional/test_framework/mininode.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2010 ArtForz -- public domain half-a-node\n# Copyright (c) 2012 Jeff Garzik\n# Copyright (c) 2010-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Bitcoin P2P network half-a-node.\n\nThis python code was modified from ArtForz' public domain  half-a-node, as\nfound in the mini-node branch of http://github.com/jgarzik/pynode.\n\nP2PConnection: A low-level connection object to a node's P2P interface\nP2PInterface: A high-level interface object for communicating to a node over P2P\"\"\"\nimport asyncore\nfrom collections import defaultdict\nfrom io import BytesIO\nimport logging\nimport socket\nimport struct\nimport sys\nimport threading\n\nfrom test_framework.messages import *\nfrom test_framework.util import wait_until\n\nlogger = logging.getLogger(\"TestFramework.mininode\")\n\nMESSAGEMAP = {\n    b\"addr\": msg_addr,\n    b\"block\": msg_block,\n    b\"blocktxn\": msg_blocktxn,\n    b\"cmpctblock\": msg_cmpctblock,\n    b\"feefilter\": msg_feefilter,\n    b\"getaddr\": msg_getaddr,\n    b\"getblocks\": msg_getblocks,\n    b\"getblocktxn\": msg_getblocktxn,\n    b\"getdata\": msg_getdata,\n    b\"getheaders\": msg_getheaders,\n    b\"headers\": msg_headers,\n    b\"inv\": msg_inv,\n    b\"mempool\": msg_mempool,\n    b\"ping\": msg_ping,\n    b\"pong\": msg_pong,\n    b\"reject\": msg_reject,\n    b\"sendcmpct\": msg_sendcmpct,\n    b\"sendheaders\": msg_sendheaders,\n    b\"tx\": msg_tx,\n    b\"verack\": msg_verack,\n    b\"version\": msg_version,\n}\n\nMAGIC_BYTES = {\n    \"mainnet\": b\"\\x9f\\xeb\\x4b\\x9d\",   # mainnet\n    \"testnet5\": b\"\\xb0\\x11\\x90\\x70\",  # testnet5\n    \"regtest\": b\"\\xaf\\xfb\\x5b\\xad\",   # regtest\n}\n\nclass P2PConnection(asyncore.dispatcher):\n    \"\"\"A low-level connection object to a node's P2P interface.\n\n    This class is responsible for:\n\n    - opening and closing the TCP connection to the node\n    - reading bytes from and writing bytes to the socket\n    - deserializing and serializing the P2P message header\n    - logging messages as they are sent and received\n\n    This class contains no logic for handing the P2P message payloads. It must be\n    sub-classed and the on_message() callback overridden.\"\"\"\n\n    def __init__(self):\n        # All P2PConnections must be created before starting the NetworkThread.\n        # assert that the network thread is not running.\n        assert not network_thread_running()\n\n        super().__init__(map=mininode_socket_map)\n\n    def peer_connect(self, dstaddr, dstport, net=\"regtest\"):\n        self.dstaddr = dstaddr\n        self.dstport = dstport\n        self.create_socket(socket.AF_INET, socket.SOCK_STREAM)\n        self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)\n        self.sendbuf = b\"\"\n        self.recvbuf = b\"\"\n        self.state = \"connecting\"\n        self.network = net\n        self.disconnect = False\n\n        logger.info('Connecting to Bitcoin Node: %s:%d' % (self.dstaddr, self.dstport))\n\n        try:\n            self.connect((dstaddr, dstport))\n        except:\n            self.handle_close()\n\n    def peer_disconnect(self):\n        # Connection could have already been closed by other end.\n        if self.state == \"connected\":\n            self.disconnect_node()\n\n    # Connection and disconnection methods\n\n    def handle_connect(self):\n        \"\"\"asyncore callback when a connection is opened.\"\"\"\n        if self.state != \"connected\":\n            logger.debug(\"Connected & Listening: %s:%d\" % (self.dstaddr, self.dstport))\n            self.state = \"connected\"\n            self.on_open()\n\n    def handle_close(self):\n        \"\"\"asyncore callback when a connection is closed.\"\"\"\n        logger.debug(\"Closing connection to: %s:%d\" % (self.dstaddr, self.dstport))\n        self.state = \"closed\"\n        self.recvbuf = b\"\"\n        self.sendbuf = b\"\"\n        try:\n            self.close()\n        except:\n            pass\n        self.on_close()\n\n    def disconnect_node(self):\n        \"\"\"Disconnect the p2p connection.\n\n        Called by the test logic thread. Causes the p2p connection\n        to be disconnected on the next iteration of the asyncore loop.\"\"\"\n        self.disconnect = True\n\n    # Socket read methods\n\n    def handle_read(self):\n        \"\"\"asyncore callback when data is read from the socket.\"\"\"\n        t = self.recv(8192)\n        if len(t) > 0:\n            self.recvbuf += t\n            self._on_data()\n\n    def _on_data(self):\n        \"\"\"Try to read P2P messages from the recv buffer.\n\n        This method reads data from the buffer in a loop. It deserializes,\n        parses and verifies the P2P header, then passes the P2P payload to\n        the on_message callback for processing.\"\"\"\n        try:\n            while True:\n                if len(self.recvbuf) < 4:\n                    return\n                if self.recvbuf[:4] != MAGIC_BYTES[self.network]:\n                    raise ValueError(\"got garbage %s\" % repr(self.recvbuf))\n                if len(self.recvbuf) < 4 + 12 + 4 + 4:\n                    return\n                command = self.recvbuf[4:4+12].split(b\"\\x00\", 1)[0]\n                msglen = struct.unpack(\"<i\", self.recvbuf[4+12:4+12+4])[0]\n                checksum = self.recvbuf[4+12+4:4+12+4+4]\n                if len(self.recvbuf) < 4 + 12 + 4 + 4 + msglen:\n                    return\n                msg = self.recvbuf[4+12+4+4:4+12+4+4+msglen]\n                th = sha256(msg)\n                h = sha256(th)\n                if checksum != h[:4]:\n                    raise ValueError(\"got bad checksum \" + repr(self.recvbuf))\n                self.recvbuf = self.recvbuf[4+12+4+4+msglen:]\n                if command not in MESSAGEMAP:\n                    raise ValueError(\"Received unknown command from %s:%d: '%s' %s\" % (self.dstaddr, self.dstport, command, repr(msg)))\n                f = BytesIO(msg)\n                t = MESSAGEMAP[command]()\n                t.deserialize(f)\n                self._log_message(\"receive\", t)\n                self.on_message(t)\n        except Exception as e:\n            logger.exception('Error reading message:', repr(e))\n            raise\n\n    def on_message(self, message):\n        \"\"\"Callback for processing a P2P payload. Must be overridden by derived class.\"\"\"\n        raise NotImplementedError\n\n    # Socket write methods\n\n    def writable(self):\n        \"\"\"asyncore method to determine whether the handle_write() callback should be called on the next loop.\"\"\"\n        with mininode_lock:\n            pre_connection = self.state == \"connecting\"\n            length = len(self.sendbuf)\n        return (length > 0 or pre_connection)\n\n    def handle_write(self):\n        \"\"\"asyncore callback when data should be written to the socket.\"\"\"\n        with mininode_lock:\n            # asyncore does not expose socket connection, only the first read/write\n            # event, thus we must check connection manually here to know when we\n            # actually connect\n            if self.state == \"connecting\":\n                self.handle_connect()\n            if not self.writable():\n                return\n\n            try:\n                sent = self.send(self.sendbuf)\n            except:\n                self.handle_close()\n                return\n            self.sendbuf = self.sendbuf[sent:]\n\n    def send_message(self, message, pushbuf=False):\n        \"\"\"Send a P2P message over the socket.\n\n        This method takes a P2P payload, builds the P2P header and adds\n        the message to the send buffer to be sent over the socket.\"\"\"\n        if self.state != \"connected\" and not pushbuf:\n            raise IOError('Not connected, no pushbuf')\n        self._log_message(\"send\", message)\n        command = message.command\n        data = message.serialize()\n        tmsg = MAGIC_BYTES[self.network]\n        tmsg += command\n        tmsg += b\"\\x00\" * (12 - len(command))\n        tmsg += struct.pack(\"<I\", len(data))\n        th = sha256(data)\n        h = sha256(th)\n        tmsg += h[:4]\n        tmsg += data\n        with mininode_lock:\n            if (len(self.sendbuf) == 0 and not pushbuf):\n                try:\n                    sent = self.send(tmsg)\n                    self.sendbuf = tmsg[sent:]\n                except BlockingIOError:\n                    self.sendbuf = tmsg\n            else:\n                self.sendbuf += tmsg\n\n    # Class utility methods\n\n    def _log_message(self, direction, msg):\n        \"\"\"Logs a message being sent or received over the connection.\"\"\"\n        if direction == \"send\":\n            log_message = \"Send message to \"\n        elif direction == \"receive\":\n            log_message = \"Received message from \"\n        log_message += \"%s:%d: %s\" % (self.dstaddr, self.dstport, repr(msg)[:500])\n        if len(log_message) > 500:\n            log_message += \"... (msg truncated)\"\n        logger.debug(log_message)\n\n\nclass P2PInterface(P2PConnection):\n    \"\"\"A high-level P2P interface class for communicating with a Bitcoin node.\n\n    This class provides high-level callbacks for processing P2P message\n    payloads, as well as convenience methods for interacting with the\n    node over P2P.\n\n    Individual testcases should subclass this and override the on_* methods\n    if they want to alter message handling behaviour.\"\"\"\n    def __init__(self):\n        super().__init__()\n\n        # Track number of messages of each type received and the most recent\n        # message of each type\n        self.message_count = defaultdict(int)\n        self.last_message = {}\n\n        # A count of the number of ping messages we've sent to the node\n        self.ping_counter = 1\n\n        # The network services received from the peer\n        self.nServices = 0\n\n    def peer_connect(self, *args, services=NODE_NETWORK|NODE_WITNESS, send_version=True, **kwargs):\n        super().peer_connect(*args, **kwargs)\n\n        if send_version:\n            # Send a version msg\n            vt = msg_version()\n            vt.nServices = services\n            vt.addrTo.ip = self.dstaddr\n            vt.addrTo.port = self.dstport\n            vt.addrFrom.ip = \"0.0.0.0\"\n            vt.addrFrom.port = 0\n            self.send_message(vt, True)\n\n    # Message receiving methods\n\n    def on_message(self, message):\n        \"\"\"Receive message and dispatch message to appropriate callback.\n\n        We keep a count of how many of each message type has been received\n        and the most recent message of each type.\"\"\"\n        with mininode_lock:\n            try:\n                command = message.command.decode('ascii')\n                self.message_count[command] += 1\n                self.last_message[command] = message\n                getattr(self, 'on_' + command)(message)\n            except:\n                print(\"ERROR delivering %s (%s)\" % (repr(message), sys.exc_info()[0]))\n                raise\n\n    # Callback methods. Can be overridden by subclasses in individual test\n    # cases to provide custom message handling behaviour.\n\n    def on_open(self):\n        pass\n\n    def on_close(self):\n        pass\n\n    def on_addr(self, message): pass\n    def on_block(self, message): pass\n    def on_blocktxn(self, message): pass\n    def on_cmpctblock(self, message): pass\n    def on_feefilter(self, message): pass\n    def on_getaddr(self, message): pass\n    def on_getblocks(self, message): pass\n    def on_getblocktxn(self, message): pass\n    def on_getdata(self, message): pass\n    def on_getheaders(self, message): pass\n    def on_headers(self, message): pass\n    def on_mempool(self, message): pass\n    def on_pong(self, message): pass\n    def on_reject(self, message): pass\n    def on_sendcmpct(self, message): pass\n    def on_sendheaders(self, message): pass\n    def on_tx(self, message): pass\n\n    def on_inv(self, message):\n        want = msg_getdata()\n        for i in message.inv:\n            if i.type != 0:\n                want.inv.append(i)\n        if len(want.inv):\n            self.send_message(want)\n\n    def on_ping(self, message):\n        self.send_message(msg_pong(message.nonce))\n\n    def on_verack(self, message):\n        self.verack_received = True\n\n    def on_version(self, message):\n        assert message.nVersion >= MIN_VERSION_SUPPORTED, \"Version {} received. Test framework only supports versions greater than {}\".format(message.nVersion, MIN_VERSION_SUPPORTED)\n        self.send_message(msg_verack())\n        self.nServices = message.nServices\n\n    # Connection helper methods\n\n    def wait_for_disconnect(self, timeout=60):\n        test_function = lambda: self.state != \"connected\"\n        wait_until(test_function, timeout=timeout, lock=mininode_lock)\n\n    # Message receiving helper methods\n\n    def wait_for_block(self, blockhash, timeout=60):\n        test_function = lambda: self.last_message.get(\"block\") and self.last_message[\"block\"].block.rehash() == blockhash\n        wait_until(test_function, timeout=timeout, lock=mininode_lock)\n\n    def wait_for_getdata(self, timeout=60):\n        test_function = lambda: self.last_message.get(\"getdata\")\n        wait_until(test_function, timeout=timeout, lock=mininode_lock)\n\n    def wait_for_getheaders(self, timeout=60):\n        test_function = lambda: self.last_message.get(\"getheaders\")\n        wait_until(test_function, timeout=timeout, lock=mininode_lock)\n\n    def wait_for_inv(self, expected_inv, timeout=60):\n        \"\"\"Waits for an INV message and checks that the first inv object in the message was as expected.\"\"\"\n        if len(expected_inv) > 1:\n            raise NotImplementedError(\"wait_for_inv() will only verify the first inv object\")\n        test_function = lambda: self.last_message.get(\"inv\") and \\\n                                self.last_message[\"inv\"].inv[0].type == expected_inv[0].type and \\\n                                self.last_message[\"inv\"].inv[0].hash == expected_inv[0].hash\n        wait_until(test_function, timeout=timeout, lock=mininode_lock)\n\n    def wait_for_verack(self, timeout=60):\n        test_function = lambda: self.message_count[\"verack\"]\n        wait_until(test_function, timeout=timeout, lock=mininode_lock)\n\n    # Message sending helper functions\n\n    def send_and_ping(self, message):\n        self.send_message(message)\n        self.sync_with_ping()\n\n    # Sync up with the node\n    def sync_with_ping(self, timeout=60):\n        self.send_message(msg_ping(nonce=self.ping_counter))\n        test_function = lambda: self.last_message.get(\"pong\") and self.last_message[\"pong\"].nonce == self.ping_counter\n        wait_until(test_function, timeout=timeout, lock=mininode_lock)\n        self.ping_counter += 1\n\n\n# Keep our own socket map for asyncore, so that we can track disconnects\n# ourselves (to workaround an issue with closing an asyncore socket when\n# using select)\nmininode_socket_map = dict()\n\n# One lock for synchronizing all data access between the networking thread (see\n# NetworkThread below) and the thread running the test logic.  For simplicity,\n# P2PConnection acquires this lock whenever delivering a message to a P2PInterface,\n# and whenever adding anything to the send buffer (in send_message()).  This\n# lock should be acquired in the thread running the test logic to synchronize\n# access to any data shared with the P2PInterface or P2PConnection.\nmininode_lock = threading.RLock()\n\nclass NetworkThread(threading.Thread):\n    def __init__(self):\n        super().__init__(name=\"NetworkThread\")\n\n    def run(self):\n        while mininode_socket_map:\n            # We check for whether to disconnect outside of the asyncore\n            # loop to workaround the behavior of asyncore when using\n            # select\n            disconnected = []\n            for fd, obj in mininode_socket_map.items():\n                if obj.disconnect:\n                    disconnected.append(obj)\n            [obj.handle_close() for obj in disconnected]\n            asyncore.loop(0.1, use_poll=True, map=mininode_socket_map, count=1)\n        logger.debug(\"Network thread closing\")\n\ndef network_thread_start():\n    \"\"\"Start the network thread.\"\"\"\n    # Only one network thread may run at a time\n    assert not network_thread_running()\n\n    NetworkThread().start()\n\ndef network_thread_running():\n    \"\"\"Return whether the network thread is running.\"\"\"\n    return any([thread.name == \"NetworkThread\" for thread in threading.enumerate()])\n\ndef network_thread_join(timeout=10):\n    \"\"\"Wait timeout seconds for the network thread to terminate.\n\n    Throw if the network thread doesn't terminate in timeout seconds.\"\"\"\n    network_threads = [thread for thread in threading.enumerate() if thread.name == \"NetworkThread\"]\n    assert len(network_threads) <= 1\n    for thread in network_threads:\n        thread.join(timeout)\n        assert not thread.is_alive()\n"
  },
  {
    "path": "test/functional/test_framework/netutil.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Linux network utilities.\n\nRoughly based on http://voorloopnul.com/blog/a-python-netstat-in-less-than-100-lines-of-code/ by Ricardo Pascal\n\"\"\"\n\nimport sys\nimport socket\nimport fcntl\nimport struct\nimport array\nimport os\nfrom binascii import unhexlify, hexlify\n\n# STATE_ESTABLISHED = '01'\n# STATE_SYN_SENT  = '02'\n# STATE_SYN_RECV = '03'\n# STATE_FIN_WAIT1 = '04'\n# STATE_FIN_WAIT2 = '05'\n# STATE_TIME_WAIT = '06'\n# STATE_CLOSE = '07'\n# STATE_CLOSE_WAIT = '08'\n# STATE_LAST_ACK = '09'\nSTATE_LISTEN = '0A'\n# STATE_CLOSING = '0B'\n\ndef get_socket_inodes(pid):\n    '''\n    Get list of socket inodes for process pid.\n    '''\n    base = '/proc/%i/fd' % pid\n    inodes = []\n    for item in os.listdir(base):\n        target = os.readlink(os.path.join(base, item))\n        if target.startswith('socket:'):\n            inodes.append(int(target[8:-1]))\n    return inodes\n\ndef _remove_empty(array):\n    return [x for x in array if x !='']\n\ndef _convert_ip_port(array):\n    host,port = array.split(':')\n    # convert host from mangled-per-four-bytes form as used by kernel\n    host = unhexlify(host)\n    host_out = ''\n    for x in range(0, len(host) // 4):\n        (val,) = struct.unpack('=I', host[x*4:(x+1)*4])\n        host_out += '%08x' % val\n\n    return host_out,int(port,16)\n\ndef netstat(typ='tcp'):\n    '''\n    Function to return a list with status of tcp connections at linux systems\n    To get pid of all network process running on system, you must run this script\n    as superuser\n    '''\n    with open('/proc/net/'+typ,'r',encoding='utf8') as f:\n        content = f.readlines()\n        content.pop(0)\n    result = []\n    for line in content:\n        line_array = _remove_empty(line.split(' '))     # Split lines and remove empty spaces.\n        tcp_id = line_array[0]\n        l_addr = _convert_ip_port(line_array[1])\n        r_addr = _convert_ip_port(line_array[2])\n        state = line_array[3]\n        inode = int(line_array[9])                      # Need the inode to match with process pid.\n        nline = [tcp_id, l_addr, r_addr, state, inode]\n        result.append(nline)\n    return result\n\ndef get_bind_addrs(pid):\n    '''\n    Get bind addresses as (host,port) tuples for process pid.\n    '''\n    inodes = get_socket_inodes(pid)\n    bind_addrs = []\n    for conn in netstat('tcp') + netstat('tcp6'):\n        if conn[3] == STATE_LISTEN and conn[4] in inodes:\n            bind_addrs.append(conn[1])\n    return bind_addrs\n\n# from: http://code.activestate.com/recipes/439093/\ndef all_interfaces():\n    '''\n    Return all interfaces that are up\n    '''\n    is_64bits = sys.maxsize > 2**32\n    struct_size = 40 if is_64bits else 32\n    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n    max_possible = 8 # initial value\n    while True:\n        bytes = max_possible * struct_size\n        names = array.array('B', b'\\0' * bytes)\n        outbytes = struct.unpack('iL', fcntl.ioctl(\n            s.fileno(),\n            0x8912,  # SIOCGIFCONF\n            struct.pack('iL', bytes, names.buffer_info()[0])\n        ))[0]\n        if outbytes == bytes:\n            max_possible *= 2\n        else:\n            break\n    namestr = names.tostring()\n    return [(namestr[i:i+16].split(b'\\0', 1)[0],\n             socket.inet_ntoa(namestr[i+20:i+24]))\n            for i in range(0, outbytes, struct_size)]\n\ndef addr_to_hex(addr):\n    '''\n    Convert string IPv4 or IPv6 address to binary address as returned by\n    get_bind_addrs.\n    Very naive implementation that certainly doesn't work for all IPv6 variants.\n    '''\n    if '.' in addr: # IPv4\n        addr = [int(x) for x in addr.split('.')]\n    elif ':' in addr: # IPv6\n        sub = [[], []] # prefix, suffix\n        x = 0\n        addr = addr.split(':')\n        for i,comp in enumerate(addr):\n            if comp == '':\n                if i == 0 or i == (len(addr)-1): # skip empty component at beginning or end\n                    continue\n                x += 1 # :: skips to suffix\n                assert(x < 2)\n            else: # two bytes per component\n                val = int(comp, 16)\n                sub[x].append(val >> 8)\n                sub[x].append(val & 0xff)\n        nullbytes = 16 - len(sub[0]) - len(sub[1])\n        assert((x == 0 and nullbytes == 0) or (x == 1 and nullbytes > 0))\n        addr = sub[0] + ([0] * nullbytes) + sub[1]\n    else:\n        raise ValueError('Could not parse address %s' % addr)\n    return hexlify(bytearray(addr)).decode('ascii')\n\ndef test_ipv6_local():\n    '''\n    Check for (local) IPv6 support.\n    '''\n    import socket\n    # By using SOCK_DGRAM this will not actually make a connection, but it will\n    # fail if there is no route to IPv6 localhost.\n    have_ipv6 = True\n    try:\n        s = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)\n        s.connect(('::1', 0))\n    except socket.error:\n        have_ipv6 = False\n    return have_ipv6\n"
  },
  {
    "path": "test/functional/test_framework/script.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Functionality to build scripts, as well as SignatureHash().\n\nThis file is modified from python-bitcoinlib.\n\"\"\"\n\nfrom .mininode import CTransaction, CTxOut, sha256, hash256, uint256_from_str, ser_uint256, ser_string\nfrom binascii import hexlify\nimport hashlib\n\nimport sys\nbchr = chr\nbord = ord\nif sys.version > '3':\n    long = int\n    bchr = lambda x: bytes([x])\n    bord = lambda x: x\n\nimport struct\n\nfrom .bignum import bn2vch\n\nMAX_SCRIPT_ELEMENT_SIZE = 520\n\nOPCODE_NAMES = {}\n\ndef hash160(s):\n    return hashlib.new('ripemd160', sha256(s)).digest()\n\n\n_opcode_instances = []\nclass CScriptOp(int):\n    \"\"\"A single script opcode\"\"\"\n    __slots__ = []\n\n    @staticmethod\n    def encode_op_pushdata(d):\n        \"\"\"Encode a PUSHDATA op, returning bytes\"\"\"\n        if len(d) < 0x4c:\n            return b'' + bchr(len(d)) + d # OP_PUSHDATA\n        elif len(d) <= 0xff:\n            return b'\\x4c' + bchr(len(d)) + d # OP_PUSHDATA1\n        elif len(d) <= 0xffff:\n            return b'\\x4d' + struct.pack(b'<H', len(d)) + d # OP_PUSHDATA2\n        elif len(d) <= 0xffffffff:\n            return b'\\x4e' + struct.pack(b'<I', len(d)) + d # OP_PUSHDATA4\n        else:\n            raise ValueError(\"Data too long to encode in a PUSHDATA op\")\n\n    @staticmethod\n    def encode_op_n(n):\n        \"\"\"Encode a small integer op, returning an opcode\"\"\"\n        if not (0 <= n <= 16):\n            raise ValueError('Integer must be in range 0 <= n <= 16, got %d' % n)\n\n        if n == 0:\n            return OP_0\n        else:\n            return CScriptOp(OP_1 + n-1)\n\n    def decode_op_n(self):\n        \"\"\"Decode a small integer opcode, returning an integer\"\"\"\n        if self == OP_0:\n            return 0\n\n        if not (self == OP_0 or OP_1 <= self <= OP_16):\n            raise ValueError('op %r is not an OP_N' % self)\n\n        return int(self - OP_1+1)\n\n    def is_small_int(self):\n        \"\"\"Return true if the op pushes a small integer to the stack\"\"\"\n        if 0x51 <= self <= 0x60 or self == 0:\n            return True\n        else:\n            return False\n\n    def __str__(self):\n        return repr(self)\n\n    def __repr__(self):\n        if self in OPCODE_NAMES:\n            return OPCODE_NAMES[self]\n        else:\n            return 'CScriptOp(0x%x)' % self\n\n    def __new__(cls, n):\n        try:\n            return _opcode_instances[n]\n        except IndexError:\n            assert len(_opcode_instances) == n\n            _opcode_instances.append(super(CScriptOp, cls).__new__(cls, n))\n            return _opcode_instances[n]\n\n# Populate opcode instance table\nfor n in range(0xff+1):\n    CScriptOp(n)\n\n\n# push value\nOP_0 = CScriptOp(0x00)\nOP_FALSE = OP_0\nOP_PUSHDATA1 = CScriptOp(0x4c)\nOP_PUSHDATA2 = CScriptOp(0x4d)\nOP_PUSHDATA4 = CScriptOp(0x4e)\nOP_1NEGATE = CScriptOp(0x4f)\nOP_RESERVED = CScriptOp(0x50)\nOP_1 = CScriptOp(0x51)\nOP_TRUE=OP_1\nOP_2 = CScriptOp(0x52)\nOP_3 = CScriptOp(0x53)\nOP_4 = CScriptOp(0x54)\nOP_5 = CScriptOp(0x55)\nOP_6 = CScriptOp(0x56)\nOP_7 = CScriptOp(0x57)\nOP_8 = CScriptOp(0x58)\nOP_9 = CScriptOp(0x59)\nOP_10 = CScriptOp(0x5a)\nOP_11 = CScriptOp(0x5b)\nOP_12 = CScriptOp(0x5c)\nOP_13 = CScriptOp(0x5d)\nOP_14 = CScriptOp(0x5e)\nOP_15 = CScriptOp(0x5f)\nOP_16 = CScriptOp(0x60)\n\n# control\nOP_NOP = CScriptOp(0x61)\nOP_VER = CScriptOp(0x62)\nOP_IF = CScriptOp(0x63)\nOP_NOTIF = CScriptOp(0x64)\nOP_VERIF = CScriptOp(0x65)\nOP_VERNOTIF = CScriptOp(0x66)\nOP_ELSE = CScriptOp(0x67)\nOP_ENDIF = CScriptOp(0x68)\nOP_VERIFY = CScriptOp(0x69)\nOP_RETURN = CScriptOp(0x6a)\n\n# stack ops\nOP_TOALTSTACK = CScriptOp(0x6b)\nOP_FROMALTSTACK = CScriptOp(0x6c)\nOP_2DROP = CScriptOp(0x6d)\nOP_2DUP = CScriptOp(0x6e)\nOP_3DUP = CScriptOp(0x6f)\nOP_2OVER = CScriptOp(0x70)\nOP_2ROT = CScriptOp(0x71)\nOP_2SWAP = CScriptOp(0x72)\nOP_IFDUP = CScriptOp(0x73)\nOP_DEPTH = CScriptOp(0x74)\nOP_DROP = CScriptOp(0x75)\nOP_DUP = CScriptOp(0x76)\nOP_NIP = CScriptOp(0x77)\nOP_OVER = CScriptOp(0x78)\nOP_PICK = CScriptOp(0x79)\nOP_ROLL = CScriptOp(0x7a)\nOP_ROT = CScriptOp(0x7b)\nOP_SWAP = CScriptOp(0x7c)\nOP_TUCK = CScriptOp(0x7d)\n\n# splice ops\nOP_CAT = CScriptOp(0x7e)\nOP_SUBSTR = CScriptOp(0x7f)\nOP_LEFT = CScriptOp(0x80)\nOP_RIGHT = CScriptOp(0x81)\nOP_SIZE = CScriptOp(0x82)\n\n# bit logic\nOP_INVERT = CScriptOp(0x83)\nOP_AND = CScriptOp(0x84)\nOP_OR = CScriptOp(0x85)\nOP_XOR = CScriptOp(0x86)\nOP_EQUAL = CScriptOp(0x87)\nOP_EQUALVERIFY = CScriptOp(0x88)\nOP_RESERVED1 = CScriptOp(0x89)\nOP_RESERVED2 = CScriptOp(0x8a)\n\n# numeric\nOP_1ADD = CScriptOp(0x8b)\nOP_1SUB = CScriptOp(0x8c)\nOP_2MUL = CScriptOp(0x8d)\nOP_2DIV = CScriptOp(0x8e)\nOP_NEGATE = CScriptOp(0x8f)\nOP_ABS = CScriptOp(0x90)\nOP_NOT = CScriptOp(0x91)\nOP_0NOTEQUAL = CScriptOp(0x92)\n\nOP_ADD = CScriptOp(0x93)\nOP_SUB = CScriptOp(0x94)\nOP_MUL = CScriptOp(0x95)\nOP_DIV = CScriptOp(0x96)\nOP_MOD = CScriptOp(0x97)\nOP_LSHIFT = CScriptOp(0x98)\nOP_RSHIFT = CScriptOp(0x99)\n\nOP_BOOLAND = CScriptOp(0x9a)\nOP_BOOLOR = CScriptOp(0x9b)\nOP_NUMEQUAL = CScriptOp(0x9c)\nOP_NUMEQUALVERIFY = CScriptOp(0x9d)\nOP_NUMNOTEQUAL = CScriptOp(0x9e)\nOP_LESSTHAN = CScriptOp(0x9f)\nOP_GREATERTHAN = CScriptOp(0xa0)\nOP_LESSTHANOREQUAL = CScriptOp(0xa1)\nOP_GREATERTHANOREQUAL = CScriptOp(0xa2)\nOP_MIN = CScriptOp(0xa3)\nOP_MAX = CScriptOp(0xa4)\n\nOP_WITHIN = CScriptOp(0xa5)\n\n# crypto\nOP_RIPEMD160 = CScriptOp(0xa6)\nOP_SHA1 = CScriptOp(0xa7)\nOP_SHA256 = CScriptOp(0xa8)\nOP_HASH160 = CScriptOp(0xa9)\nOP_HASH256 = CScriptOp(0xaa)\nOP_CODESEPARATOR = CScriptOp(0xab)\nOP_CHECKSIG = CScriptOp(0xac)\nOP_CHECKSIGVERIFY = CScriptOp(0xad)\nOP_CHECKMULTISIG = CScriptOp(0xae)\nOP_CHECKMULTISIGVERIFY = CScriptOp(0xaf)\n\n# expansion\nOP_NOP1 = CScriptOp(0xb0)\nOP_CHECKLOCKTIMEVERIFY = CScriptOp(0xb1)\nOP_CHECKSEQUENCEVERIFY = CScriptOp(0xb2)\nOP_NOP4 = CScriptOp(0xb3)\nOP_NOP5 = CScriptOp(0xb4)\nOP_NOP6 = CScriptOp(0xb5)\nOP_NOP7 = CScriptOp(0xb6)\nOP_NOP8 = CScriptOp(0xb7)\nOP_NOP9 = CScriptOp(0xb8)\nOP_NOP10 = CScriptOp(0xb9)\n\n# template matching params\nOP_SMALLINTEGER = CScriptOp(0xfa)\nOP_PUBKEYS = CScriptOp(0xfb)\nOP_PUBKEYHASH = CScriptOp(0xfd)\nOP_PUBKEY = CScriptOp(0xfe)\n\nOP_INVALIDOPCODE = CScriptOp(0xff)\n\nOPCODE_NAMES.update({\n    OP_0 : 'OP_0',\n    OP_PUSHDATA1 : 'OP_PUSHDATA1',\n    OP_PUSHDATA2 : 'OP_PUSHDATA2',\n    OP_PUSHDATA4 : 'OP_PUSHDATA4',\n    OP_1NEGATE : 'OP_1NEGATE',\n    OP_RESERVED : 'OP_RESERVED',\n    OP_1 : 'OP_1',\n    OP_2 : 'OP_2',\n    OP_3 : 'OP_3',\n    OP_4 : 'OP_4',\n    OP_5 : 'OP_5',\n    OP_6 : 'OP_6',\n    OP_7 : 'OP_7',\n    OP_8 : 'OP_8',\n    OP_9 : 'OP_9',\n    OP_10 : 'OP_10',\n    OP_11 : 'OP_11',\n    OP_12 : 'OP_12',\n    OP_13 : 'OP_13',\n    OP_14 : 'OP_14',\n    OP_15 : 'OP_15',\n    OP_16 : 'OP_16',\n    OP_NOP : 'OP_NOP',\n    OP_VER : 'OP_VER',\n    OP_IF : 'OP_IF',\n    OP_NOTIF : 'OP_NOTIF',\n    OP_VERIF : 'OP_VERIF',\n    OP_VERNOTIF : 'OP_VERNOTIF',\n    OP_ELSE : 'OP_ELSE',\n    OP_ENDIF : 'OP_ENDIF',\n    OP_VERIFY : 'OP_VERIFY',\n    OP_RETURN : 'OP_RETURN',\n    OP_TOALTSTACK : 'OP_TOALTSTACK',\n    OP_FROMALTSTACK : 'OP_FROMALTSTACK',\n    OP_2DROP : 'OP_2DROP',\n    OP_2DUP : 'OP_2DUP',\n    OP_3DUP : 'OP_3DUP',\n    OP_2OVER : 'OP_2OVER',\n    OP_2ROT : 'OP_2ROT',\n    OP_2SWAP : 'OP_2SWAP',\n    OP_IFDUP : 'OP_IFDUP',\n    OP_DEPTH : 'OP_DEPTH',\n    OP_DROP : 'OP_DROP',\n    OP_DUP : 'OP_DUP',\n    OP_NIP : 'OP_NIP',\n    OP_OVER : 'OP_OVER',\n    OP_PICK : 'OP_PICK',\n    OP_ROLL : 'OP_ROLL',\n    OP_ROT : 'OP_ROT',\n    OP_SWAP : 'OP_SWAP',\n    OP_TUCK : 'OP_TUCK',\n    OP_CAT : 'OP_CAT',\n    OP_SUBSTR : 'OP_SUBSTR',\n    OP_LEFT : 'OP_LEFT',\n    OP_RIGHT : 'OP_RIGHT',\n    OP_SIZE : 'OP_SIZE',\n    OP_INVERT : 'OP_INVERT',\n    OP_AND : 'OP_AND',\n    OP_OR : 'OP_OR',\n    OP_XOR : 'OP_XOR',\n    OP_EQUAL : 'OP_EQUAL',\n    OP_EQUALVERIFY : 'OP_EQUALVERIFY',\n    OP_RESERVED1 : 'OP_RESERVED1',\n    OP_RESERVED2 : 'OP_RESERVED2',\n    OP_1ADD : 'OP_1ADD',\n    OP_1SUB : 'OP_1SUB',\n    OP_2MUL : 'OP_2MUL',\n    OP_2DIV : 'OP_2DIV',\n    OP_NEGATE : 'OP_NEGATE',\n    OP_ABS : 'OP_ABS',\n    OP_NOT : 'OP_NOT',\n    OP_0NOTEQUAL : 'OP_0NOTEQUAL',\n    OP_ADD : 'OP_ADD',\n    OP_SUB : 'OP_SUB',\n    OP_MUL : 'OP_MUL',\n    OP_DIV : 'OP_DIV',\n    OP_MOD : 'OP_MOD',\n    OP_LSHIFT : 'OP_LSHIFT',\n    OP_RSHIFT : 'OP_RSHIFT',\n    OP_BOOLAND : 'OP_BOOLAND',\n    OP_BOOLOR : 'OP_BOOLOR',\n    OP_NUMEQUAL : 'OP_NUMEQUAL',\n    OP_NUMEQUALVERIFY : 'OP_NUMEQUALVERIFY',\n    OP_NUMNOTEQUAL : 'OP_NUMNOTEQUAL',\n    OP_LESSTHAN : 'OP_LESSTHAN',\n    OP_GREATERTHAN : 'OP_GREATERTHAN',\n    OP_LESSTHANOREQUAL : 'OP_LESSTHANOREQUAL',\n    OP_GREATERTHANOREQUAL : 'OP_GREATERTHANOREQUAL',\n    OP_MIN : 'OP_MIN',\n    OP_MAX : 'OP_MAX',\n    OP_WITHIN : 'OP_WITHIN',\n    OP_RIPEMD160 : 'OP_RIPEMD160',\n    OP_SHA1 : 'OP_SHA1',\n    OP_SHA256 : 'OP_SHA256',\n    OP_HASH160 : 'OP_HASH160',\n    OP_HASH256 : 'OP_HASH256',\n    OP_CODESEPARATOR : 'OP_CODESEPARATOR',\n    OP_CHECKSIG : 'OP_CHECKSIG',\n    OP_CHECKSIGVERIFY : 'OP_CHECKSIGVERIFY',\n    OP_CHECKMULTISIG : 'OP_CHECKMULTISIG',\n    OP_CHECKMULTISIGVERIFY : 'OP_CHECKMULTISIGVERIFY',\n    OP_NOP1 : 'OP_NOP1',\n    OP_CHECKLOCKTIMEVERIFY : 'OP_CHECKLOCKTIMEVERIFY',\n    OP_CHECKSEQUENCEVERIFY : 'OP_CHECKSEQUENCEVERIFY',\n    OP_NOP4 : 'OP_NOP4',\n    OP_NOP5 : 'OP_NOP5',\n    OP_NOP6 : 'OP_NOP6',\n    OP_NOP7 : 'OP_NOP7',\n    OP_NOP8 : 'OP_NOP8',\n    OP_NOP9 : 'OP_NOP9',\n    OP_NOP10 : 'OP_NOP10',\n    OP_SMALLINTEGER : 'OP_SMALLINTEGER',\n    OP_PUBKEYS : 'OP_PUBKEYS',\n    OP_PUBKEYHASH : 'OP_PUBKEYHASH',\n    OP_PUBKEY : 'OP_PUBKEY',\n    OP_INVALIDOPCODE : 'OP_INVALIDOPCODE',\n})\n\nclass CScriptInvalidError(Exception):\n    \"\"\"Base class for CScript exceptions\"\"\"\n    pass\n\nclass CScriptTruncatedPushDataError(CScriptInvalidError):\n    \"\"\"Invalid pushdata due to truncation\"\"\"\n    def __init__(self, msg, data):\n        self.data = data\n        super(CScriptTruncatedPushDataError, self).__init__(msg)\n\n# This is used, eg, for blockchain heights in coinbase scripts (bip34)\nclass CScriptNum():\n    def __init__(self, d=0):\n        self.value = d\n\n    @staticmethod\n    def encode(obj):\n        r = bytearray(0)\n        if obj.value == 0:\n            return bytes(r)\n        neg = obj.value < 0\n        absvalue = -obj.value if neg else obj.value\n        while (absvalue):\n            r.append(absvalue & 0xff)\n            absvalue >>= 8\n        if r[-1] & 0x80:\n            r.append(0x80 if neg else 0)\n        elif neg:\n            r[-1] |= 0x80\n        return bytes(bchr(len(r)) + r)\n\n\nclass CScript(bytes):\n    \"\"\"Serialized script\n\n    A bytes subclass, so you can use this directly whenever bytes are accepted.\n    Note that this means that indexing does *not* work - you'll get an index by\n    byte rather than opcode. This format was chosen for efficiency so that the\n    general case would not require creating a lot of little CScriptOP objects.\n\n    iter(script) however does iterate by opcode.\n    \"\"\"\n    @classmethod\n    def __coerce_instance(cls, other):\n        # Coerce other into bytes\n        if isinstance(other, CScriptOp):\n            other = bchr(other)\n        elif isinstance(other, CScriptNum):\n            if (other.value == 0):\n                other = bchr(CScriptOp(OP_0))\n            else:\n                other = CScriptNum.encode(other)\n        elif isinstance(other, int):\n            if 0 <= other <= 16:\n                other = bytes(bchr(CScriptOp.encode_op_n(other)))\n            elif other == -1:\n                other = bytes(bchr(OP_1NEGATE))\n            else:\n                other = CScriptOp.encode_op_pushdata(bn2vch(other))\n        elif isinstance(other, (bytes, bytearray)):\n            other = CScriptOp.encode_op_pushdata(other)\n        return other\n\n    def __add__(self, other):\n        # Do the coercion outside of the try block so that errors in it are\n        # noticed.\n        other = self.__coerce_instance(other)\n\n        try:\n            # bytes.__add__ always returns bytes instances unfortunately\n            return CScript(super(CScript, self).__add__(other))\n        except TypeError:\n            raise TypeError('Can not add a %r instance to a CScript' % other.__class__)\n\n    def join(self, iterable):\n        # join makes no sense for a CScript()\n        raise NotImplementedError\n\n    def __new__(cls, value=b''):\n        if isinstance(value, bytes) or isinstance(value, bytearray):\n            return super(CScript, cls).__new__(cls, value)\n        else:\n            def coerce_iterable(iterable):\n                for instance in iterable:\n                    yield cls.__coerce_instance(instance)\n            # Annoyingly on both python2 and python3 bytes.join() always\n            # returns a bytes instance even when subclassed.\n            return super(CScript, cls).__new__(cls, b''.join(coerce_iterable(value)))\n\n    def raw_iter(self):\n        \"\"\"Raw iteration\n\n        Yields tuples of (opcode, data, sop_idx) so that the different possible\n        PUSHDATA encodings can be accurately distinguished, as well as\n        determining the exact opcode byte indexes. (sop_idx)\n        \"\"\"\n        i = 0\n        while i < len(self):\n            sop_idx = i\n            opcode = bord(self[i])\n            i += 1\n\n            if opcode > OP_PUSHDATA4:\n                yield (opcode, None, sop_idx)\n            else:\n                datasize = None\n                pushdata_type = None\n                if opcode < OP_PUSHDATA1:\n                    pushdata_type = 'PUSHDATA(%d)' % opcode\n                    datasize = opcode\n\n                elif opcode == OP_PUSHDATA1:\n                    pushdata_type = 'PUSHDATA1'\n                    if i >= len(self):\n                        raise CScriptInvalidError('PUSHDATA1: missing data length')\n                    datasize = bord(self[i])\n                    i += 1\n\n                elif opcode == OP_PUSHDATA2:\n                    pushdata_type = 'PUSHDATA2'\n                    if i + 1 >= len(self):\n                        raise CScriptInvalidError('PUSHDATA2: missing data length')\n                    datasize = bord(self[i]) + (bord(self[i+1]) << 8)\n                    i += 2\n\n                elif opcode == OP_PUSHDATA4:\n                    pushdata_type = 'PUSHDATA4'\n                    if i + 3 >= len(self):\n                        raise CScriptInvalidError('PUSHDATA4: missing data length')\n                    datasize = bord(self[i]) + (bord(self[i+1]) << 8) + (bord(self[i+2]) << 16) + (bord(self[i+3]) << 24)\n                    i += 4\n\n                else:\n                    assert False # shouldn't happen\n\n\n                data = bytes(self[i:i+datasize])\n\n                # Check for truncation\n                if len(data) < datasize:\n                    raise CScriptTruncatedPushDataError('%s: truncated data' % pushdata_type, data)\n\n                i += datasize\n\n                yield (opcode, data, sop_idx)\n\n    def __iter__(self):\n        \"\"\"'Cooked' iteration\n\n        Returns either a CScriptOP instance, an integer, or bytes, as\n        appropriate.\n\n        See raw_iter() if you need to distinguish the different possible\n        PUSHDATA encodings.\n        \"\"\"\n        for (opcode, data, sop_idx) in self.raw_iter():\n            if data is not None:\n                yield data\n            else:\n                opcode = CScriptOp(opcode)\n\n                if opcode.is_small_int():\n                    yield opcode.decode_op_n()\n                else:\n                    yield CScriptOp(opcode)\n\n    def __repr__(self):\n        def _repr(o):\n            if isinstance(o, bytes):\n                return \"x('%s')\" % hexlify(o).decode('ascii')\n            else:\n                return repr(o)\n\n        ops = []\n        i = iter(self)\n        while True:\n            op = None\n            try:\n                op = _repr(next(i))\n            except CScriptTruncatedPushDataError as err:\n                op = '%s...<ERROR: %s>' % (_repr(err.data), err)\n                break\n            except CScriptInvalidError as err:\n                op = '<ERROR: %s>' % err\n                break\n            except StopIteration:\n                break\n            finally:\n                if op is not None:\n                    ops.append(op)\n\n        return \"CScript([%s])\" % ', '.join(ops)\n\n    def GetSigOpCount(self, fAccurate):\n        \"\"\"Get the SigOp count.\n\n        fAccurate - Accurately count CHECKMULTISIG, see BIP16 for details.\n\n        Note that this is consensus-critical.\n        \"\"\"\n        n = 0\n        lastOpcode = OP_INVALIDOPCODE\n        for (opcode, data, sop_idx) in self.raw_iter():\n            if opcode in (OP_CHECKSIG, OP_CHECKSIGVERIFY):\n                n += 1\n            elif opcode in (OP_CHECKMULTISIG, OP_CHECKMULTISIGVERIFY):\n                if fAccurate and (OP_1 <= lastOpcode <= OP_16):\n                    n += opcode.decode_op_n()\n                else:\n                    n += 20\n            lastOpcode = opcode\n        return n\n\n\nSIGHASH_ALL = 1\nSIGHASH_NONE = 2\nSIGHASH_SINGLE = 3\nSIGHASH_ANYONECANPAY = 0x80\n\ndef FindAndDelete(script, sig):\n    \"\"\"Consensus critical, see FindAndDelete() in Satoshi codebase\"\"\"\n    r = b''\n    last_sop_idx = sop_idx = 0\n    skip = True\n    for (opcode, data, sop_idx) in script.raw_iter():\n        if not skip:\n            r += script[last_sop_idx:sop_idx]\n        last_sop_idx = sop_idx\n        if script[sop_idx:sop_idx + len(sig)] == sig:\n            skip = True\n        else:\n            skip = False\n    if not skip:\n        r += script[last_sop_idx:]\n    return CScript(r)\n\n\ndef SignatureHash(script, txTo, inIdx, hashtype):\n    \"\"\"Consensus-correct SignatureHash\n\n    Returns (hash, err) to precisely match the consensus-critical behavior of\n    the SIGHASH_SINGLE bug. (inIdx is *not* checked for validity)\n    \"\"\"\n    HASH_ONE = b'\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00'\n\n    if inIdx >= len(txTo.vin):\n        return (HASH_ONE, \"inIdx %d out of range (%d)\" % (inIdx, len(txTo.vin)))\n    txtmp = CTransaction(txTo)\n\n    for txin in txtmp.vin:\n        txin.scriptSig = b''\n    txtmp.vin[inIdx].scriptSig = FindAndDelete(script, CScript([OP_CODESEPARATOR]))\n\n    if (hashtype & 0x1f) == SIGHASH_NONE:\n        txtmp.vout = []\n\n        for i in range(len(txtmp.vin)):\n            if i != inIdx:\n                txtmp.vin[i].nSequence = 0\n\n    elif (hashtype & 0x1f) == SIGHASH_SINGLE:\n        outIdx = inIdx\n        if outIdx >= len(txtmp.vout):\n            return (HASH_ONE, \"outIdx %d out of range (%d)\" % (outIdx, len(txtmp.vout)))\n\n        tmp = txtmp.vout[outIdx]\n        txtmp.vout = []\n        for i in range(outIdx):\n            txtmp.vout.append(CTxOut(-1))\n        txtmp.vout.append(tmp)\n\n        for i in range(len(txtmp.vin)):\n            if i != inIdx:\n                txtmp.vin[i].nSequence = 0\n\n    if hashtype & SIGHASH_ANYONECANPAY:\n        tmp = txtmp.vin[inIdx]\n        txtmp.vin = []\n        txtmp.vin.append(tmp)\n\n    s = txtmp.serialize_without_witness()\n    s += struct.pack(b\"<I\", hashtype)\n\n    hash = hash256(s)\n\n    return (hash, None)\n\n# TODO: Allow cached hashPrevouts/hashSequence/hashOutputs to be provided.\n# Performance optimization probably not necessary for python tests, however.\n# Note that this corresponds to sigversion == 1 in EvalScript, which is used\n# for version 0 witnesses.\ndef SegwitVersion1SignatureHash(script, txTo, inIdx, hashtype, amount):\n\n    hashPrevouts = 0\n    hashSequence = 0\n    hashOutputs = 0\n\n    if not (hashtype & SIGHASH_ANYONECANPAY):\n        serialize_prevouts = bytes()\n        for i in txTo.vin:\n            serialize_prevouts += i.prevout.serialize()\n        hashPrevouts = uint256_from_str(hash256(serialize_prevouts))\n\n    if (not (hashtype & SIGHASH_ANYONECANPAY) and (hashtype & 0x1f) != SIGHASH_SINGLE and (hashtype & 0x1f) != SIGHASH_NONE):\n        serialize_sequence = bytes()\n        for i in txTo.vin:\n            serialize_sequence += struct.pack(\"<I\", i.nSequence)\n        hashSequence = uint256_from_str(hash256(serialize_sequence))\n\n    if ((hashtype & 0x1f) != SIGHASH_SINGLE and (hashtype & 0x1f) != SIGHASH_NONE):\n        serialize_outputs = bytes()\n        for o in txTo.vout:\n            serialize_outputs += o.serialize()\n        hashOutputs = uint256_from_str(hash256(serialize_outputs))\n    elif ((hashtype & 0x1f) == SIGHASH_SINGLE and inIdx < len(txTo.vout)):\n        serialize_outputs = txTo.vout[inIdx].serialize()\n        hashOutputs = uint256_from_str(hash256(serialize_outputs))\n\n    ss = bytes()\n    ss += struct.pack(\"<i\", txTo.nVersion)\n    ss += ser_uint256(hashPrevouts)\n    ss += ser_uint256(hashSequence)\n    ss += txTo.vin[inIdx].prevout.serialize()\n    ss += ser_string(script)\n    ss += struct.pack(\"<q\", amount)\n    ss += struct.pack(\"<I\", txTo.vin[inIdx].nSequence)\n    ss += ser_uint256(hashOutputs)\n    ss += struct.pack(\"<i\", txTo.nLockTime)\n    ss += struct.pack(\"<I\", hashtype)\n\n    return hash256(ss)\n"
  },
  {
    "path": "test/functional/test_framework/segwit_addr.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 Pieter Wuille\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Reference implementation for Bech32 and segwit addresses.\"\"\"\n\n\nCHARSET = \"qpzry9x8gf2tvdw0s3jn54khce6mua7l\"\n\n\ndef bech32_polymod(values):\n    \"\"\"Internal function that computes the Bech32 checksum.\"\"\"\n    generator = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]\n    chk = 1\n    for value in values:\n        top = chk >> 25\n        chk = (chk & 0x1ffffff) << 5 ^ value\n        for i in range(5):\n            chk ^= generator[i] if ((top >> i) & 1) else 0\n    return chk\n\n\ndef bech32_hrp_expand(hrp):\n    \"\"\"Expand the HRP into values for checksum computation.\"\"\"\n    return [ord(x) >> 5 for x in hrp] + [0] + [ord(x) & 31 for x in hrp]\n\n\ndef bech32_verify_checksum(hrp, data):\n    \"\"\"Verify a checksum given HRP and converted data characters.\"\"\"\n    return bech32_polymod(bech32_hrp_expand(hrp) + data) == 1\n\n\ndef bech32_create_checksum(hrp, data):\n    \"\"\"Compute the checksum values given HRP and data.\"\"\"\n    values = bech32_hrp_expand(hrp) + data\n    polymod = bech32_polymod(values + [0, 0, 0, 0, 0, 0]) ^ 1\n    return [(polymod >> 5 * (5 - i)) & 31 for i in range(6)]\n\n\ndef bech32_encode(hrp, data):\n    \"\"\"Compute a Bech32 string given HRP and data values.\"\"\"\n    combined = data + bech32_create_checksum(hrp, data)\n    return hrp + '1' + ''.join([CHARSET[d] for d in combined])\n\n\ndef bech32_decode(bech):\n    \"\"\"Validate a Bech32 string, and determine HRP and data.\"\"\"\n    if ((any(ord(x) < 33 or ord(x) > 126 for x in bech)) or\n            (bech.lower() != bech and bech.upper() != bech)):\n        return (None, None)\n    bech = bech.lower()\n    pos = bech.rfind('1')\n    if pos < 1 or pos + 7 > len(bech) or len(bech) > 90:\n        return (None, None)\n    if not all(x in CHARSET for x in bech[pos+1:]):\n        return (None, None)\n    hrp = bech[:pos]\n    data = [CHARSET.find(x) for x in bech[pos+1:]]\n    if not bech32_verify_checksum(hrp, data):\n        return (None, None)\n    return (hrp, data[:-6])\n\n\ndef convertbits(data, frombits, tobits, pad=True):\n    \"\"\"General power-of-2 base conversion.\"\"\"\n    acc = 0\n    bits = 0\n    ret = []\n    maxv = (1 << tobits) - 1\n    max_acc = (1 << (frombits + tobits - 1)) - 1\n    for value in data:\n        if value < 0 or (value >> frombits):\n            return None\n        acc = ((acc << frombits) | value) & max_acc\n        bits += frombits\n        while bits >= tobits:\n            bits -= tobits\n            ret.append((acc >> bits) & maxv)\n    if pad:\n        if bits:\n            ret.append((acc << (tobits - bits)) & maxv)\n    elif bits >= frombits or ((acc << (tobits - bits)) & maxv):\n        return None\n    return ret\n\n\ndef decode(hrp, addr):\n    \"\"\"Decode a segwit address.\"\"\"\n    hrpgot, data = bech32_decode(addr)\n    if hrpgot != hrp:\n        return (None, None)\n    decoded = convertbits(data[1:], 5, 8, False)\n    if decoded is None or len(decoded) < 2 or len(decoded) > 40:\n        return (None, None)\n    if data[0] > 16:\n        return (None, None)\n    if data[0] == 0 and len(decoded) != 20 and len(decoded) != 32:\n        return (None, None)\n    return (data[0], decoded)\n\n\ndef encode(hrp, witver, witprog):\n    \"\"\"Encode a segwit address.\"\"\"\n    ret = bech32_encode(hrp, [witver] + convertbits(witprog, 8, 5))\n    if decode(hrp, ret) == (None, None):\n        return None\n    return ret\n"
  },
  {
    "path": "test/functional/test_framework/siphash.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Specialized SipHash-2-4 implementations.\n\nThis implements SipHash-2-4 for 256-bit integers.\n\"\"\"\n\ndef rotl64(n, b):\n    return n >> (64 - b) | (n & ((1 << (64 - b)) - 1)) << b\n\ndef siphash_round(v0, v1, v2, v3):\n    v0 = (v0 + v1) & ((1 << 64) - 1)\n    v1 = rotl64(v1, 13)\n    v1 ^= v0\n    v0 = rotl64(v0, 32)\n    v2 = (v2 + v3) & ((1 << 64) - 1)\n    v3 = rotl64(v3, 16)\n    v3 ^= v2\n    v0 = (v0 + v3) & ((1 << 64) - 1)\n    v3 = rotl64(v3, 21)\n    v3 ^= v0\n    v2 = (v2 + v1) & ((1 << 64) - 1)\n    v1 = rotl64(v1, 17)\n    v1 ^= v2\n    v2 = rotl64(v2, 32)\n    return (v0, v1, v2, v3)\n\ndef siphash256(k0, k1, h):\n    n0 = h & ((1 << 64) - 1)\n    n1 = (h >> 64) & ((1 << 64) - 1)\n    n2 = (h >> 128) & ((1 << 64) - 1)\n    n3 = (h >> 192) & ((1 << 64) - 1)\n    v0 = 0x736f6d6570736575 ^ k0\n    v1 = 0x646f72616e646f6d ^ k1\n    v2 = 0x6c7967656e657261 ^ k0\n    v3 = 0x7465646279746573 ^ k1 ^ n0\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0 ^= n0\n    v3 ^= n1\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0 ^= n1\n    v3 ^= n2\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0 ^= n2\n    v3 ^= n3\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0 ^= n3\n    v3 ^= 0x2000000000000000\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0 ^= 0x2000000000000000\n    v2 ^= 0xFF\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    v0, v1, v2, v3 = siphash_round(v0, v1, v2, v3)\n    return v0 ^ v1 ^ v2 ^ v3\n"
  },
  {
    "path": "test/functional/test_framework/socks5.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Dummy Socks5 server for testing.\"\"\"\n\nimport socket, threading, queue\nimport logging\n\nlogger = logging.getLogger(\"TestFramework.socks5\")\n\n### Protocol constants\nclass Command:\n    CONNECT = 0x01\n\nclass AddressType:\n    IPV4 = 0x01\n    DOMAINNAME = 0x03\n    IPV6 = 0x04\n\n### Utility functions\ndef recvall(s, n):\n    \"\"\"Receive n bytes from a socket, or fail.\"\"\"\n    rv = bytearray()\n    while n > 0:\n        d = s.recv(n)\n        if not d:\n            raise IOError('Unexpected end of stream')\n        rv.extend(d)\n        n -= len(d)\n    return rv\n\n### Implementation classes\nclass Socks5Configuration():\n    \"\"\"Proxy configuration.\"\"\"\n    def __init__(self):\n        self.addr = None # Bind address (must be set)\n        self.af = socket.AF_INET # Bind address family\n        self.unauth = False  # Support unauthenticated\n        self.auth = False  # Support authentication\n\nclass Socks5Command():\n    \"\"\"Information about an incoming socks5 command.\"\"\"\n    def __init__(self, cmd, atyp, addr, port, username, password):\n        self.cmd = cmd # Command (one of Command.*)\n        self.atyp = atyp # Address type (one of AddressType.*)\n        self.addr = addr # Address\n        self.port = port # Port to connect to\n        self.username = username\n        self.password = password\n    def __repr__(self):\n        return 'Socks5Command(%s,%s,%s,%s,%s,%s)' % (self.cmd, self.atyp, self.addr, self.port, self.username, self.password)\n\nclass Socks5Connection():\n    def __init__(self, serv, conn, peer):\n        self.serv = serv\n        self.conn = conn\n        self.peer = peer\n\n    def handle(self):\n        \"\"\"Handle socks5 request according to RFC192.\"\"\"\n        try:\n            # Verify socks version\n            ver = recvall(self.conn, 1)[0]\n            if ver != 0x05:\n                raise IOError('Invalid socks version %i' % ver)\n            # Choose authentication method\n            nmethods = recvall(self.conn, 1)[0]\n            methods = bytearray(recvall(self.conn, nmethods))\n            method = None\n            if 0x02 in methods and self.serv.conf.auth:\n                method = 0x02 # username/password\n            elif 0x00 in methods and self.serv.conf.unauth:\n                method = 0x00 # unauthenticated\n            if method is None:\n                raise IOError('No supported authentication method was offered')\n            # Send response\n            self.conn.sendall(bytearray([0x05, method]))\n            # Read authentication (optional)\n            username = None\n            password = None\n            if method == 0x02:\n                ver = recvall(self.conn, 1)[0]\n                if ver != 0x01:\n                    raise IOError('Invalid auth packet version %i' % ver)\n                ulen = recvall(self.conn, 1)[0]\n                username = str(recvall(self.conn, ulen))\n                plen = recvall(self.conn, 1)[0]\n                password = str(recvall(self.conn, plen))\n                # Send authentication response\n                self.conn.sendall(bytearray([0x01, 0x00]))\n\n            # Read connect request\n            ver, cmd, _, atyp = recvall(self.conn, 4)\n            if ver != 0x05:\n                raise IOError('Invalid socks version %i in connect request' % ver)\n            if cmd != Command.CONNECT:\n                raise IOError('Unhandled command %i in connect request' % cmd)\n\n            if atyp == AddressType.IPV4:\n                addr = recvall(self.conn, 4)\n            elif atyp == AddressType.DOMAINNAME:\n                n = recvall(self.conn, 1)[0]\n                addr = recvall(self.conn, n)\n            elif atyp == AddressType.IPV6:\n                addr = recvall(self.conn, 16)\n            else:\n                raise IOError('Unknown address type %i' % atyp)\n            port_hi,port_lo = recvall(self.conn, 2)\n            port = (port_hi << 8) | port_lo\n\n            # Send dummy response\n            self.conn.sendall(bytearray([0x05, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]))\n\n            cmdin = Socks5Command(cmd, atyp, addr, port, username, password)\n            self.serv.queue.put(cmdin)\n            logger.info('Proxy: %s', cmdin)\n            # Fall through to disconnect\n        except Exception as e:\n            logger.exception(\"socks5 request handling failed.\")\n            self.serv.queue.put(e)\n        finally:\n            self.conn.close()\n\nclass Socks5Server():\n    def __init__(self, conf):\n        self.conf = conf\n        self.s = socket.socket(conf.af)\n        self.s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n        self.s.bind(conf.addr)\n        self.s.listen(5)\n        self.running = False\n        self.thread = None\n        self.queue = queue.Queue() # report connections and exceptions to client\n\n    def run(self):\n        while self.running:\n            (sockconn, peer) = self.s.accept()\n            if self.running:\n                conn = Socks5Connection(self, sockconn, peer)\n                thread = threading.Thread(None, conn.handle)\n                thread.daemon = True\n                thread.start()\n    \n    def start(self):\n        assert(not self.running)\n        self.running = True\n        self.thread = threading.Thread(None, self.run)\n        self.thread.daemon = True\n        self.thread.start()\n\n    def stop(self):\n        self.running = False\n        # connect to self to end run loop\n        s = socket.socket(self.conf.af)\n        s.connect(self.conf.addr)\n        s.close()\n        self.thread.join()\n\n"
  },
  {
    "path": "test/functional/test_framework/test_framework.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Base class for RPC testing.\"\"\"\n\nfrom enum import Enum\nimport logging\nimport optparse\nimport os\nimport pdb\nimport shutil\nimport sys\nimport tempfile\nimport time\n\nfrom .authproxy import JSONRPCException\nfrom . import coverage\nfrom .test_node import TestNode\nfrom .util import (\n    MAX_NODES,\n    PortSeed,\n    assert_equal,\n    check_json_precision,\n    connect_nodes_bi,\n    disconnect_nodes,\n    get_datadir_path,\n    initialize_datadir,\n    p2p_port,\n    set_node_times,\n    sync_blocks,\n    sync_mempools,\n)\n\nclass TestStatus(Enum):\n    PASSED = 1\n    FAILED = 2\n    SKIPPED = 3\n\nTEST_EXIT_PASSED = 0\nTEST_EXIT_FAILED = 1\nTEST_EXIT_SKIPPED = 77\n\nclass BitcoinTestFramework():\n    \"\"\"Base class for a bitcoin test script.\n\n    Individual bitcoin test scripts should subclass this class and override the set_test_params() and run_test() methods.\n\n    Individual tests can also override the following methods to customize the test setup:\n\n    - add_options()\n    - setup_chain()\n    - setup_network()\n    - setup_nodes()\n\n    The __init__() and main() methods should not be overridden.\n\n    This class also contains various public and private helper methods.\"\"\"\n\n    def __init__(self):\n        \"\"\"Sets test framework defaults. Do not override this method. Instead, override the set_test_params() method\"\"\"\n        self.setup_clean_chain = False\n        self.nodes = []\n        self.mocktime = 0\n        self.supports_cli = False\n        self.set_test_params()\n\n        assert hasattr(self, \"num_nodes\"), \"Test must set self.num_nodes in set_test_params()\"\n\n    def main(self):\n        \"\"\"Main function. This should not be overridden by the subclass test scripts.\"\"\"\n\n        parser = optparse.OptionParser(usage=\"%prog [options]\")\n        parser.add_option(\"--nocleanup\", dest=\"nocleanup\", default=False, action=\"store_true\",\n                          help=\"Leave bitcoinds and test.* datadir on exit or error\")\n        parser.add_option(\"--noshutdown\", dest=\"noshutdown\", default=False, action=\"store_true\",\n                          help=\"Don't stop bitcoinds after the test execution\")\n        parser.add_option(\"--srcdir\", dest=\"srcdir\", default=os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + \"/../../../src\"),\n                          help=\"Source directory containing bitcoind/bitcoin-cli (default: %default)\")\n        parser.add_option(\"--cachedir\", dest=\"cachedir\", default=os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + \"/../../cache\"),\n                          help=\"Directory for caching pregenerated datadirs\")\n        parser.add_option(\"--tmpdir\", dest=\"tmpdir\", help=\"Root directory for datadirs\")\n        parser.add_option(\"-l\", \"--loglevel\", dest=\"loglevel\", default=\"INFO\",\n                          help=\"log events at this level and higher to the console. Can be set to DEBUG, INFO, WARNING, ERROR or CRITICAL. Passing --loglevel DEBUG will output all logs to console. Note that logs at all levels are always written to the test_framework.log file in the temporary test directory.\")\n        parser.add_option(\"--tracerpc\", dest=\"trace_rpc\", default=False, action=\"store_true\",\n                          help=\"Print out all RPC calls as they are made\")\n        parser.add_option(\"--portseed\", dest=\"port_seed\", default=os.getpid(), type='int',\n                          help=\"The seed to use for assigning port numbers (default: current process id)\")\n        parser.add_option(\"--coveragedir\", dest=\"coveragedir\",\n                          help=\"Write tested RPC commands into this directory\")\n        parser.add_option(\"--configfile\", dest=\"configfile\",\n                          help=\"Location of the test framework config file\")\n        parser.add_option(\"--pdbonfailure\", dest=\"pdbonfailure\", default=False, action=\"store_true\",\n                          help=\"Attach a python debugger if test fails\")\n        parser.add_option(\"--usecli\", dest=\"usecli\", default=False, action=\"store_true\",\n                          help=\"use bitcoin-cli instead of RPC for all commands\")\n        self.add_options(parser)\n        (self.options, self.args) = parser.parse_args()\n\n        PortSeed.n = self.options.port_seed\n\n        os.environ['PATH'] = self.options.srcdir + \":\" + self.options.srcdir + \"/qt:\" + os.environ['PATH']\n\n        check_json_precision()\n\n        self.options.cachedir = os.path.abspath(self.options.cachedir)\n\n        # Set up temp directory and start logging\n        if self.options.tmpdir:\n            self.options.tmpdir = os.path.abspath(self.options.tmpdir)\n            os.makedirs(self.options.tmpdir, exist_ok=False)\n        else:\n            self.options.tmpdir = tempfile.mkdtemp(prefix=\"test\")\n        self._start_logging()\n\n        success = TestStatus.FAILED\n\n        try:\n            if self.options.usecli and not self.supports_cli:\n                raise SkipTest(\"--usecli specified but test does not support using CLI\")\n            self.setup_chain()\n            self.setup_network()\n            self.run_test()\n            success = TestStatus.PASSED\n        except JSONRPCException as e:\n            self.log.exception(\"JSONRPC error\")\n        except SkipTest as e:\n            self.log.warning(\"Test Skipped: %s\" % e.message)\n            success = TestStatus.SKIPPED\n        except AssertionError as e:\n            self.log.exception(\"Assertion failed\")\n        except KeyError as e:\n            self.log.exception(\"Key error\")\n        except Exception as e:\n            self.log.exception(\"Unexpected exception caught during testing\")\n        except KeyboardInterrupt as e:\n            self.log.warning(\"Exiting after keyboard interrupt\")\n\n        if success == TestStatus.FAILED and self.options.pdbonfailure:\n            print(\"Testcase failed. Attaching python debugger. Enter ? for help\")\n            pdb.set_trace()\n\n        if not self.options.noshutdown:\n            self.log.info(\"Stopping nodes\")\n            if self.nodes:\n                self.stop_nodes()\n        else:\n            for node in self.nodes:\n                node.cleanup_on_exit = False\n            self.log.info(\"Note: bitcoinds were not stopped and may still be running\")\n\n        if not self.options.nocleanup and not self.options.noshutdown and success != TestStatus.FAILED:\n            self.log.info(\"Cleaning up\")\n            shutil.rmtree(self.options.tmpdir)\n        else:\n            self.log.warning(\"Not cleaning up dir %s\" % self.options.tmpdir)\n\n        if success == TestStatus.PASSED:\n            self.log.info(\"Tests successful\")\n            exit_code = TEST_EXIT_PASSED\n        elif success == TestStatus.SKIPPED:\n            self.log.info(\"Test skipped\")\n            exit_code = TEST_EXIT_SKIPPED\n        else:\n            self.log.error(\"Test failed. Test logging available at %s/test_framework.log\", self.options.tmpdir)\n            self.log.error(\"Hint: Call {} '{}' to consolidate all logs\".format(os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + \"/../combine_logs.py\"), self.options.tmpdir))\n            exit_code = TEST_EXIT_FAILED\n        logging.shutdown()\n        sys.exit(exit_code)\n\n    # Methods to override in subclass test scripts.\n    def set_test_params(self):\n        \"\"\"Tests must this method to change default values for number of nodes, topology, etc\"\"\"\n        raise NotImplementedError\n\n    def add_options(self, parser):\n        \"\"\"Override this method to add command-line options to the test\"\"\"\n        pass\n\n    def setup_chain(self):\n        \"\"\"Override this method to customize blockchain setup\"\"\"\n        self.log.info(\"Initializing test directory \" + self.options.tmpdir)\n        if self.setup_clean_chain:\n            self._initialize_chain_clean()\n        else:\n            self._initialize_chain()\n\n    def setup_network(self):\n        \"\"\"Override this method to customize test network topology\"\"\"\n        self.setup_nodes()\n\n        # Connect the nodes as a \"chain\".  This allows us\n        # to split the network between nodes 1 and 2 to get\n        # two halves that can work on competing chains.\n        for i in range(self.num_nodes - 1):\n            connect_nodes_bi(self.nodes, i, i + 1)\n        self.sync_all()\n\n    def setup_nodes(self):\n        \"\"\"Override this method to customize test node setup\"\"\"\n        extra_args = None\n        if hasattr(self, \"extra_args\"):\n            extra_args = self.extra_args\n        self.add_nodes(self.num_nodes, extra_args)\n        self.start_nodes()\n\n    def run_test(self):\n        \"\"\"Tests must override this method to define test logic\"\"\"\n        raise NotImplementedError\n\n    # Public helper methods. These can be accessed by the subclass test scripts.\n\n    def add_nodes(self, num_nodes, extra_args=None, rpchost=None, timewait=None, binary=None):\n        \"\"\"Instantiate TestNode objects\"\"\"\n\n        if extra_args is None:\n            extra_args = [[]] * num_nodes\n        if binary is None:\n            binary = [None] * num_nodes\n        assert_equal(len(extra_args), num_nodes)\n        assert_equal(len(binary), num_nodes)\n        for i in range(num_nodes):\n            self.nodes.append(TestNode(i, self.options.tmpdir, extra_args[i], rpchost, timewait=timewait, binary=binary[i], stderr=None, mocktime=self.mocktime, coverage_dir=self.options.coveragedir, use_cli=self.options.usecli))\n\n    def start_node(self, i, *args, **kwargs):\n        \"\"\"Start a bitcoind\"\"\"\n\n        node = self.nodes[i]\n\n        node.start(*args, **kwargs)\n        node.wait_for_rpc_connection()\n\n        if self.options.coveragedir is not None:\n            coverage.write_all_rpc_commands(self.options.coveragedir, node.rpc)\n\n    def start_nodes(self, extra_args=None, *args, **kwargs):\n        \"\"\"Start multiple bitcoinds\"\"\"\n\n        if extra_args is None:\n            extra_args = [None] * self.num_nodes\n        assert_equal(len(extra_args), self.num_nodes)\n        try:\n            for i, node in enumerate(self.nodes):\n                node.start(extra_args[i], *args, **kwargs)\n            for node in self.nodes:\n                node.wait_for_rpc_connection()\n        except:\n            # If one node failed to start, stop the others\n            self.stop_nodes()\n            raise\n\n        if self.options.coveragedir is not None:\n            for node in self.nodes:\n                coverage.write_all_rpc_commands(self.options.coveragedir, node.rpc)\n\n    def stop_node(self, i):\n        \"\"\"Stop a bitcoind test node\"\"\"\n        self.nodes[i].stop_node()\n        self.nodes[i].wait_until_stopped()\n\n    def stop_nodes(self):\n        \"\"\"Stop multiple bitcoind test nodes\"\"\"\n        for node in self.nodes:\n            # Issue RPC to stop nodes\n            node.stop_node()\n\n        for node in self.nodes:\n            # Wait for nodes to stop\n            node.wait_until_stopped()\n\n    def restart_node(self, i, extra_args=None):\n        \"\"\"Stop and start a test node\"\"\"\n        self.stop_node(i)\n        self.start_node(i, extra_args)\n\n    def assert_start_raises_init_error(self, i, extra_args=None, expected_msg=None, *args, **kwargs):\n        with tempfile.SpooledTemporaryFile(max_size=2**16) as log_stderr:\n            try:\n                self.start_node(i, extra_args, stderr=log_stderr, *args, **kwargs)\n                self.stop_node(i)\n            except Exception as e:\n                assert 'bitcoind exited' in str(e)  # node must have shutdown\n                self.nodes[i].running = False\n                self.nodes[i].process = None\n                if expected_msg is not None:\n                    log_stderr.seek(0)\n                    stderr = log_stderr.read().decode('utf-8')\n                    if expected_msg not in stderr:\n                        raise AssertionError(\"Expected error \\\"\" + expected_msg + \"\\\" not found in:\\n\" + stderr)\n            else:\n                if expected_msg is None:\n                    assert_msg = \"bitcoind should have exited with an error\"\n                else:\n                    assert_msg = \"bitcoind should have exited with expected error \" + expected_msg\n                raise AssertionError(assert_msg)\n\n    def wait_for_node_exit(self, i, timeout):\n        self.nodes[i].process.wait(timeout)\n\n    def split_network(self):\n        \"\"\"\n        Split the network of four nodes into nodes 0/1 and 2/3.\n        \"\"\"\n        disconnect_nodes(self.nodes[1], 2)\n        disconnect_nodes(self.nodes[2], 1)\n        self.sync_all([self.nodes[:2], self.nodes[2:]])\n\n    def join_network(self):\n        \"\"\"\n        Join the (previously split) network halves together.\n        \"\"\"\n        connect_nodes_bi(self.nodes, 1, 2)\n        self.sync_all()\n\n    def sync_all(self, node_groups=None):\n        if not node_groups:\n            node_groups = [self.nodes]\n\n        for group in node_groups:\n            sync_blocks(group)\n            sync_mempools(group)\n\n    def enable_mocktime(self):\n        \"\"\"Enable mocktime for the script.\n\n        mocktime may be needed for scripts that use the cached version of the\n        blockchain.  If the cached version of the blockchain is used without\n        mocktime then the mempools will not sync due to IBD.\n\n        For backwared compatibility of the python scripts with previous\n        versions of the cache, this helper function sets mocktime to Jan 1,\n        2014 + (201 * 10 * 60)\"\"\"\n        self.mocktime = 1388534400 + (201 * 10 * 60)\n\n    def disable_mocktime(self):\n        self.mocktime = 0\n\n    # Private helper methods. These should not be accessed by the subclass test scripts.\n\n    def _start_logging(self):\n        # Add logger and logging handlers\n        self.log = logging.getLogger('TestFramework')\n        self.log.setLevel(logging.DEBUG)\n        # Create file handler to log all messages\n        fh = logging.FileHandler(self.options.tmpdir + '/test_framework.log')\n        fh.setLevel(logging.DEBUG)\n        # Create console handler to log messages to stderr. By default this logs only error messages, but can be configured with --loglevel.\n        ch = logging.StreamHandler(sys.stdout)\n        # User can provide log level as a number or string (eg DEBUG). loglevel was caught as a string, so try to convert it to an int\n        ll = int(self.options.loglevel) if self.options.loglevel.isdigit() else self.options.loglevel.upper()\n        ch.setLevel(ll)\n        # Format logs the same as bitcoind's debug.log with microprecision (so log files can be concatenated and sorted)\n        formatter = logging.Formatter(fmt='%(asctime)s.%(msecs)03d000 %(name)s (%(levelname)s): %(message)s', datefmt='%Y-%m-%d %H:%M:%S')\n        formatter.converter = time.gmtime\n        fh.setFormatter(formatter)\n        ch.setFormatter(formatter)\n        # add the handlers to the logger\n        self.log.addHandler(fh)\n        self.log.addHandler(ch)\n\n        if self.options.trace_rpc:\n            rpc_logger = logging.getLogger(\"BitcoinRPC\")\n            rpc_logger.setLevel(logging.DEBUG)\n            rpc_handler = logging.StreamHandler(sys.stdout)\n            rpc_handler.setLevel(logging.DEBUG)\n            rpc_logger.addHandler(rpc_handler)\n\n    def _initialize_chain(self):\n        \"\"\"Initialize a pre-mined blockchain for use by the test.\n\n        Create a cache of a 200-block-long chain (with wallet) for MAX_NODES\n        Afterward, create num_nodes copies from the cache.\"\"\"\n\n        assert self.num_nodes <= MAX_NODES\n        create_cache = False\n        for i in range(MAX_NODES):\n            if not os.path.isdir(get_datadir_path(self.options.cachedir, i)):\n                create_cache = True\n                break\n\n        if create_cache:\n            self.log.debug(\"Creating data directories from cached datadir\")\n\n            # find and delete old cache directories if any exist\n            for i in range(MAX_NODES):\n                if os.path.isdir(get_datadir_path(self.options.cachedir, i)):\n                    shutil.rmtree(get_datadir_path(self.options.cachedir, i))\n\n            # Create cache directories, run bitcoinds:\n            for i in range(MAX_NODES):\n                datadir = initialize_datadir(self.options.cachedir, i)\n                args = [os.getenv(\"BITCOIND\", \"bitcoind\"), \"-server\", \"-keypool=1\", \"-datadir=\" + datadir, \"-discover=0\"]\n                if i > 0:\n                    args.append(\"-connect=127.0.0.1:\" + str(p2p_port(0)))\n                self.nodes.append(TestNode(i, self.options.cachedir, extra_args=[], rpchost=None, timewait=None, binary=None, stderr=None, mocktime=self.mocktime, coverage_dir=None))\n                self.nodes[i].args = args\n                self.start_node(i)\n\n            # Wait for RPC connections to be ready\n            for node in self.nodes:\n                node.wait_for_rpc_connection()\n\n            # Create a 200-block-long chain; each of the 4 first nodes\n            # gets 25 mature blocks and 25 immature.\n            # Note: To preserve compatibility with older versions of\n            # initialize_chain, only 4 nodes will generate coins.\n            #\n            # blocks are created with timestamps 10 minutes apart\n            # starting from 2010 minutes in the past\n            self.enable_mocktime()\n            block_time = self.mocktime - (201 * 10 * 60)\n            for i in range(2):\n                for peer in range(4):\n                    for j in range(25):\n                        set_node_times(self.nodes, block_time)\n                        self.nodes[peer].generate(1)\n                        block_time += 10 * 60\n                    # Must sync before next peer starts generating blocks\n                    sync_blocks(self.nodes)\n\n            # Shut them down, and clean up cache directories:\n            self.stop_nodes()\n            self.nodes = []\n            self.disable_mocktime()\n\n            def cache_path(n, *paths):\n                return os.path.join(get_datadir_path(self.options.cachedir, n), \"regtest\", *paths)\n\n            for i in range(MAX_NODES):\n                for entry in os.listdir(cache_path(i)):\n                    if entry not in ['wallets', 'chainstate', 'blocks']:\n                        os.remove(cache_path(i, entry))\n\n        for i in range(self.num_nodes):\n            from_dir = get_datadir_path(self.options.cachedir, i)\n            to_dir = get_datadir_path(self.options.tmpdir, i)\n            shutil.copytree(from_dir, to_dir)\n            initialize_datadir(self.options.tmpdir, i)  # Overwrite port/rpcport in bitcoin.conf\n\n    def _initialize_chain_clean(self):\n        \"\"\"Initialize empty blockchain for use by the test.\n\n        Create an empty blockchain and num_nodes wallets.\n        Useful if a test case wants complete control over initialization.\"\"\"\n        for i in range(self.num_nodes):\n            initialize_datadir(self.options.tmpdir, i)\n\nclass ComparisonTestFramework(BitcoinTestFramework):\n    \"\"\"Test framework for doing p2p comparison testing\n\n    Sets up some bitcoind binaries:\n    - 1 binary: test binary\n    - 2 binaries: 1 test binary, 1 ref binary\n    - n>2 binaries: 1 test binary, n-1 ref binaries\"\"\"\n\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.setup_clean_chain = True\n\n    def add_options(self, parser):\n        parser.add_option(\"--testbinary\", dest=\"testbinary\",\n                          default=os.getenv(\"BITCOIND\", \"bitcoind\"),\n                          help=\"bitcoind binary to test\")\n        parser.add_option(\"--refbinary\", dest=\"refbinary\",\n                          default=os.getenv(\"BITCOIND\", \"bitcoind\"),\n                          help=\"bitcoind binary to use for reference nodes (if any)\")\n\n    def setup_network(self):\n        extra_args = [['-whitelist=127.0.0.1']] * self.num_nodes\n        if hasattr(self, \"extra_args\"):\n            extra_args = self.extra_args\n        self.add_nodes(self.num_nodes, extra_args,\n                       binary=[self.options.testbinary] +\n                       [self.options.refbinary] * (self.num_nodes - 1))\n        self.start_nodes()\n\nclass SkipTest(Exception):\n    \"\"\"This exception is raised to skip a test\"\"\"\n    def __init__(self, message):\n        self.message = message\n"
  },
  {
    "path": "test/functional/test_framework/test_node.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Class for bitcoind node under test\"\"\"\n\nimport decimal\nimport errno\nimport http.client\nimport json\nimport logging\nimport os\nimport re\nimport subprocess\nimport time\n\nfrom .authproxy import JSONRPCException\nfrom .util import (\n    assert_equal,\n    delete_cookie_file,\n    get_rpc_proxy,\n    rpc_url,\n    wait_until,\n    p2p_port,\n)\n\n# For Python 3.4 compatibility\nJSONDecodeError = getattr(json, \"JSONDecodeError\", ValueError)\n\nBITCOIND_PROC_WAIT_TIMEOUT = 60\n\nclass TestNode():\n    \"\"\"A class for representing a bitcoind node under test.\n\n    This class contains:\n\n    - state about the node (whether it's running, etc)\n    - a Python subprocess.Popen object representing the running process\n    - an RPC connection to the node\n    - one or more P2P connections to the node\n\n\n    To make things easier for the test writer, any unrecognised messages will\n    be dispatched to the RPC connection.\"\"\"\n\n    def __init__(self, i, dirname, extra_args, rpchost, timewait, binary, stderr, mocktime, coverage_dir, use_cli=False):\n        self.index = i\n        self.datadir = os.path.join(dirname, \"node\" + str(i))\n        self.rpchost = rpchost\n        if timewait:\n            self.rpc_timeout = timewait\n        else:\n            # Wait for up to 60 seconds for the RPC server to respond\n            self.rpc_timeout = 60\n        if binary is None:\n            self.binary = os.getenv(\"BITCOIND\", \"bitcoind\")\n        else:\n            self.binary = binary\n        self.stderr = stderr\n        self.coverage_dir = coverage_dir\n        # Most callers will just need to add extra args to the standard list below. For those callers that need more flexibity, they can just set the args property directly.\n        self.extra_args = extra_args\n        self.args = [self.binary, \"-datadir=\" + self.datadir, \"-server\", \"-keypool=1\", \"-discover=0\", \"-rest\", \"-logtimemicros\", \"-debug\", \"-debugexclude=libevent\", \"-debugexclude=leveldb\", \"-mocktime=\" + str(mocktime), \"-uacomment=testnode%d\" % i]\n\n        self.cli = TestNodeCLI(os.getenv(\"BITCOINCLI\", \"bitcoin-cli\"), self.datadir)\n        self.use_cli = use_cli\n\n        self.running = False\n        self.process = None\n        self.rpc_connected = False\n        self.rpc = None\n        self.url = None\n        self.log = logging.getLogger('TestFramework.node%d' % i)\n        self.cleanup_on_exit = True # Whether to kill the node when this object goes away\n\n        self.p2ps = []\n\n    def __del__(self):\n        # Ensure that we don't leave any bitcoind processes lying around after\n        # the test ends\n        if self.process and self.cleanup_on_exit:\n            # Should only happen on test failure\n            # Avoid using logger, as that may have already been shutdown when\n            # this destructor is called.\n            print(\"Cleaning up leftover process\")\n            self.process.kill()\n\n    def __getattr__(self, name):\n        \"\"\"Dispatches any unrecognised messages to the RPC connection or a CLI instance.\"\"\"\n        if self.use_cli:\n            return getattr(self.cli, name)\n        else:\n            assert self.rpc_connected and self.rpc is not None, \"Error: no RPC connection\"\n            return getattr(self.rpc, name)\n\n    def start(self, extra_args=None, stderr=None, *args, **kwargs):\n        \"\"\"Start the node.\"\"\"\n        if extra_args is None:\n            extra_args = self.extra_args\n        if stderr is None:\n            stderr = self.stderr\n        # Delete any existing cookie file -- if such a file exists (eg due to\n        # unclean shutdown), it will get overwritten anyway by bitcoind, and\n        # potentially interfere with our attempt to authenticate\n        delete_cookie_file(self.datadir)\n        self.process = subprocess.Popen(self.args + extra_args, stderr=stderr, *args, **kwargs)\n        self.running = True\n        self.log.debug(\"bitcoind started, waiting for RPC to come up\")\n\n    def wait_for_rpc_connection(self):\n        \"\"\"Sets up an RPC connection to the bitcoind process. Returns False if unable to connect.\"\"\"\n        # Poll at a rate of four times per second\n        poll_per_s = 4\n        for _ in range(poll_per_s * self.rpc_timeout):\n            assert self.process.poll() is None, \"bitcoind exited with status %i during initialization\" % self.process.returncode\n            try:\n                self.rpc = get_rpc_proxy(rpc_url(self.datadir, self.index, self.rpchost), self.index, timeout=self.rpc_timeout, coveragedir=self.coverage_dir)\n                self.rpc.getblockcount()\n                # If the call to getblockcount() succeeds then the RPC connection is up\n                self.rpc_connected = True\n                self.url = self.rpc.url\n                self.log.debug(\"RPC successfully started\")\n                return\n            except IOError as e:\n                if e.errno != errno.ECONNREFUSED:  # Port not yet open?\n                    raise  # unknown IO error\n            except JSONRPCException as e:  # Initialization phase\n                if e.error['code'] != -28:  # RPC in warmup?\n                    raise  # unknown JSON RPC exception\n            except ValueError as e:  # cookie file not found and no rpcuser or rpcassword. bitcoind still starting\n                if \"No RPC credentials\" not in str(e):\n                    raise\n            time.sleep(1.0 / poll_per_s)\n        raise AssertionError(\"Unable to connect to bitcoind\")\n\n    def get_wallet_rpc(self, wallet_name):\n        if self.use_cli:\n            return self.cli(\"-rpcwallet={}\".format(wallet_name))\n        else:\n            assert self.rpc_connected\n            assert self.rpc\n            wallet_path = \"wallet/%s\" % wallet_name\n            return self.rpc / wallet_path\n\n    def stop_node(self):\n        \"\"\"Stop the node.\"\"\"\n        if not self.running:\n            return\n        self.log.debug(\"Stopping node\")\n        try:\n            self.stop()\n        except http.client.CannotSendRequest:\n            self.log.exception(\"Unable to stop node.\")\n        del self.p2ps[:]\n\n    def is_node_stopped(self):\n        \"\"\"Checks whether the node has stopped.\n\n        Returns True if the node has stopped. False otherwise.\n        This method is responsible for freeing resources (self.process).\"\"\"\n        if not self.running:\n            return True\n        return_code = self.process.poll()\n        if return_code is None:\n            return False\n\n        # process has stopped. Assert that it didn't return an error code.\n        assert_equal(return_code, 0)\n        self.running = False\n        self.process = None\n        self.rpc_connected = False\n        self.rpc = None\n        self.log.debug(\"Node stopped\")\n        return True\n\n    def wait_until_stopped(self, timeout=BITCOIND_PROC_WAIT_TIMEOUT):\n        wait_until(self.is_node_stopped, timeout=timeout)\n\n    def node_encrypt_wallet(self, passphrase):\n        \"\"\"\"Encrypts the wallet.\n\n        This causes bitcoind to shutdown, so this method takes\n        care of cleaning up resources.\"\"\"\n        self.encryptwallet(passphrase)\n        self.wait_until_stopped()\n\n    def add_p2p_connection(self, p2p_conn, *args, **kwargs):\n        \"\"\"Add a p2p connection to the node.\n\n        This method adds the p2p connection to the self.p2ps list and also\n        returns the connection to the caller.\"\"\"\n        if 'dstport' not in kwargs:\n            kwargs['dstport'] = p2p_port(self.index)\n        if 'dstaddr' not in kwargs:\n            kwargs['dstaddr'] = '127.0.0.1'\n\n        p2p_conn.peer_connect(*args, **kwargs)\n        self.p2ps.append(p2p_conn)\n\n        return p2p_conn\n\n    @property\n    def p2p(self):\n        \"\"\"Return the first p2p connection\n\n        Convenience property - most tests only use a single p2p connection to each\n        node, so this saves having to write node.p2ps[0] many times.\"\"\"\n        assert self.p2ps, \"No p2p connection\"\n        return self.p2ps[0]\n\n    def disconnect_p2ps(self):\n        \"\"\"Close all p2p connections to the node.\"\"\"\n        for p in self.p2ps:\n            p.peer_disconnect()\n        del self.p2ps[:]\n\nclass TestNodeCLIAttr:\n    def __init__(self, cli, command):\n        self.cli = cli\n        self.command = command\n\n    def __call__(self, *args, **kwargs):\n        return self.cli.send_cli(self.command, *args, **kwargs)\n\n    def get_request(self, *args, **kwargs):\n        return lambda: self(*args, **kwargs)\n\nclass TestNodeCLI():\n    \"\"\"Interface to bitcoin-cli for an individual node\"\"\"\n\n    def __init__(self, binary, datadir):\n        self.options = []\n        self.binary = binary\n        self.datadir = datadir\n        self.input = None\n        self.log = logging.getLogger('TestFramework.bitcoincli')\n\n    def __call__(self, *options, input=None):\n        # TestNodeCLI is callable with bitcoin-cli command-line options\n        cli = TestNodeCLI(self.binary, self.datadir)\n        cli.options = [str(o) for o in options]\n        cli.input = input\n        return cli\n\n    def __getattr__(self, command):\n        return TestNodeCLIAttr(self, command)\n\n    def batch(self, requests):\n        results = []\n        for request in requests:\n           try:\n               results.append(dict(result=request()))\n           except JSONRPCException as e:\n               results.append(dict(error=e))\n        return results\n\n    def send_cli(self, command=None, *args, **kwargs):\n        \"\"\"Run bitcoin-cli command. Deserializes returned string as python object.\"\"\"\n\n        pos_args = [str(arg) for arg in args]\n        named_args = [str(key) + \"=\" + str(value) for (key, value) in kwargs.items()]\n        assert not (pos_args and named_args), \"Cannot use positional arguments and named arguments in the same bitcoin-cli call\"\n        p_args = [self.binary, \"-datadir=\" + self.datadir] + self.options\n        if named_args:\n            p_args += [\"-named\"]\n        if command is not None:\n            p_args += [command]\n        p_args += pos_args + named_args\n        self.log.debug(\"Running bitcoin-cli command: %s\" % command)\n        process = subprocess.Popen(p_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)\n        cli_stdout, cli_stderr = process.communicate(input=self.input)\n        returncode = process.poll()\n        if returncode:\n            match = re.match(r'error code: ([-0-9]+)\\nerror message:\\n(.*)', cli_stderr)\n            if match:\n                code, message = match.groups()\n                raise JSONRPCException(dict(code=int(code), message=message))\n            # Ignore cli_stdout, raise with cli_stderr\n            raise subprocess.CalledProcessError(returncode, self.binary, output=cli_stderr)\n        try:\n            return json.loads(cli_stdout, parse_float=decimal.Decimal)\n        except JSONDecodeError:\n            return cli_stdout.rstrip(\"\\n\")\n"
  },
  {
    "path": "test/functional/test_framework/util.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Helpful routines for regression testing.\"\"\"\n\nfrom base64 import b64encode\nfrom binascii import hexlify, unhexlify\nfrom decimal import Decimal, ROUND_DOWN\nimport hashlib\nimport json\nimport logging\nimport os\nimport random\nimport re\nfrom subprocess import CalledProcessError\nimport time\n\nfrom . import coverage\nfrom .authproxy import AuthServiceProxy, JSONRPCException\n\nlogger = logging.getLogger(\"TestFramework.utils\")\n\n# Assert functions\n##################\n\ndef assert_fee_amount(fee, tx_size, fee_per_kB):\n    \"\"\"Assert the fee was in range\"\"\"\n    target_fee = round(tx_size * fee_per_kB / 1000, 8)\n    if fee < target_fee:\n        raise AssertionError(\"Fee of %s BTC too low! (Should be %s BTC)\" % (str(fee), str(target_fee)))\n    # allow the wallet's estimation to be at most 2 bytes off\n    if fee > (tx_size + 2) * fee_per_kB / 1000:\n        raise AssertionError(\"Fee of %s BTC too high! (Should be %s BTC)\" % (str(fee), str(target_fee)))\n\ndef assert_equal(thing1, thing2, *args):\n    if thing1 != thing2 or any(thing1 != arg for arg in args):\n        raise AssertionError(\"not(%s)\" % \" == \".join(str(arg) for arg in (thing1, thing2) + args))\n\ndef assert_greater_than(thing1, thing2):\n    if thing1 <= thing2:\n        raise AssertionError(\"%s <= %s\" % (str(thing1), str(thing2)))\n\ndef assert_greater_than_or_equal(thing1, thing2):\n    if thing1 < thing2:\n        raise AssertionError(\"%s < %s\" % (str(thing1), str(thing2)))\n\ndef assert_raises(exc, fun, *args, **kwds):\n    assert_raises_message(exc, None, fun, *args, **kwds)\n\ndef assert_raises_message(exc, message, fun, *args, **kwds):\n    try:\n        fun(*args, **kwds)\n    except JSONRPCException:\n        raise AssertionError(\"Use assert_raises_rpc_error() to test RPC failures\")\n    except exc as e:\n        if message is not None and message not in e.error['message']:\n            raise AssertionError(\"Expected substring not found:\" + e.error['message'])\n    except Exception as e:\n        raise AssertionError(\"Unexpected exception raised: \" + type(e).__name__)\n    else:\n        raise AssertionError(\"No exception raised\")\n\ndef assert_raises_process_error(returncode, output, fun, *args, **kwds):\n    \"\"\"Execute a process and asserts the process return code and output.\n\n    Calls function `fun` with arguments `args` and `kwds`. Catches a CalledProcessError\n    and verifies that the return code and output are as expected. Throws AssertionError if\n    no CalledProcessError was raised or if the return code and output are not as expected.\n\n    Args:\n        returncode (int): the process return code.\n        output (string): [a substring of] the process output.\n        fun (function): the function to call. This should execute a process.\n        args*: positional arguments for the function.\n        kwds**: named arguments for the function.\n    \"\"\"\n    try:\n        fun(*args, **kwds)\n    except CalledProcessError as e:\n        if returncode != e.returncode:\n            raise AssertionError(\"Unexpected returncode %i\" % e.returncode)\n        if output not in e.output:\n            raise AssertionError(\"Expected substring not found:\" + e.output)\n    else:\n        raise AssertionError(\"No exception raised\")\n\ndef assert_raises_rpc_error(code, message, fun, *args, **kwds):\n    \"\"\"Run an RPC and verify that a specific JSONRPC exception code and message is raised.\n\n    Calls function `fun` with arguments `args` and `kwds`. Catches a JSONRPCException\n    and verifies that the error code and message are as expected. Throws AssertionError if\n    no JSONRPCException was raised or if the error code/message are not as expected.\n\n    Args:\n        code (int), optional: the error code returned by the RPC call (defined\n            in src/rpc/protocol.h). Set to None if checking the error code is not required.\n        message (string), optional: [a substring of] the error string returned by the\n            RPC call. Set to None if checking the error string is not required.\n        fun (function): the function to call. This should be the name of an RPC.\n        args*: positional arguments for the function.\n        kwds**: named arguments for the function.\n    \"\"\"\n    assert try_rpc(code, message, fun, *args, **kwds), \"No exception raised\"\n\ndef try_rpc(code, message, fun, *args, **kwds):\n    \"\"\"Tries to run an rpc command.\n\n    Test against error code and message if the rpc fails.\n    Returns whether a JSONRPCException was raised.\"\"\"\n    try:\n        fun(*args, **kwds)\n    except JSONRPCException as e:\n        # JSONRPCException was thrown as expected. Check the code and message values are correct.\n        if (code is not None) and (code != e.error[\"code\"]):\n            raise AssertionError(\"Unexpected JSONRPC error code %i\" % e.error[\"code\"])\n        if (message is not None) and (message not in e.error['message']):\n            raise AssertionError(\"Expected substring not found:\" + e.error['message'])\n        return True\n    except Exception as e:\n        raise AssertionError(\"Unexpected exception raised: \" + type(e).__name__)\n    else:\n        return False\n\ndef assert_is_hex_string(string):\n    try:\n        int(string, 16)\n    except Exception as e:\n        raise AssertionError(\n            \"Couldn't interpret %r as hexadecimal; raised: %s\" % (string, e))\n\ndef assert_is_hash_string(string, length=64):\n    if not isinstance(string, str):\n        raise AssertionError(\"Expected a string, got type %r\" % type(string))\n    elif length and len(string) != length:\n        raise AssertionError(\n            \"String of length %d expected; got %d\" % (length, len(string)))\n    elif not re.match('[abcdef0-9]+$', string):\n        raise AssertionError(\n            \"String %r contains invalid characters for a hash.\" % string)\n\ndef assert_array_result(object_array, to_match, expected, should_not_find=False):\n    \"\"\"\n        Pass in array of JSON objects, a dictionary with key/value pairs\n        to match against, and another dictionary with expected key/value\n        pairs.\n        If the should_not_find flag is true, to_match should not be found\n        in object_array\n        \"\"\"\n    if should_not_find:\n        assert_equal(expected, {})\n    num_matched = 0\n    for item in object_array:\n        all_match = True\n        for key, value in to_match.items():\n            if item[key] != value:\n                all_match = False\n        if not all_match:\n            continue\n        elif should_not_find:\n            num_matched = num_matched + 1\n        for key, value in expected.items():\n            if item[key] != value:\n                raise AssertionError(\"%s : expected %s=%s\" % (str(item), str(key), str(value)))\n            num_matched = num_matched + 1\n    if num_matched == 0 and not should_not_find:\n        raise AssertionError(\"No objects matched %s\" % (str(to_match)))\n    if num_matched > 0 and should_not_find:\n        raise AssertionError(\"Objects were found %s\" % (str(to_match)))\n\n# Utility functions\n###################\n\ndef check_json_precision():\n    \"\"\"Make sure json library being used does not lose precision converting BTC values\"\"\"\n    n = Decimal(\"20000000.00000003\")\n    satoshis = int(json.loads(json.dumps(float(n))) * 1.0e8)\n    if satoshis != 2000000000000003:\n        raise RuntimeError(\"JSON encode/decode loses precision\")\n\ndef count_bytes(hex_string):\n    return len(bytearray.fromhex(hex_string))\n\ndef bytes_to_hex_str(byte_str):\n    return hexlify(byte_str).decode('ascii')\n\ndef hash256(byte_str):\n    sha256 = hashlib.sha256()\n    sha256.update(byte_str)\n    sha256d = hashlib.sha256()\n    sha256d.update(sha256.digest())\n    return sha256d.digest()[::-1]\n\ndef hex_str_to_bytes(hex_str):\n    return unhexlify(hex_str.encode('ascii'))\n\ndef str_to_b64str(string):\n    return b64encode(string.encode('utf-8')).decode('ascii')\n\ndef satoshi_round(amount):\n    return Decimal(amount).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)\n\ndef wait_until(predicate, *, attempts=float('inf'), timeout=float('inf'), lock=None):\n    if attempts == float('inf') and timeout == float('inf'):\n        timeout = 60\n    attempt = 0\n    timeout += time.time()\n\n    while attempt < attempts and time.time() < timeout:\n        if lock:\n            with lock:\n                if predicate():\n                    return\n        else:\n            if predicate():\n                return\n        attempt += 1\n        time.sleep(0.05)\n\n    # Print the cause of the timeout\n    assert_greater_than(attempts, attempt)\n    assert_greater_than(timeout, time.time())\n    raise RuntimeError('Unreachable')\n\n# RPC/P2P connection constants and functions\n############################################\n\n# The maximum number of nodes a single test can spawn\nMAX_NODES = 8\n# Don't assign rpc or p2p ports lower than this\nPORT_MIN = 11000\n# The number of ports to \"reserve\" for p2p and rpc, each\nPORT_RANGE = 5000\n\nclass PortSeed:\n    # Must be initialized with a unique integer for each process\n    n = None\n\ndef get_rpc_proxy(url, node_number, timeout=None, coveragedir=None):\n    \"\"\"\n    Args:\n        url (str): URL of the RPC server to call\n        node_number (int): the node number (or id) that this calls to\n\n    Kwargs:\n        timeout (int): HTTP timeout in seconds\n\n    Returns:\n        AuthServiceProxy. convenience object for making RPC calls.\n\n    \"\"\"\n    proxy_kwargs = {}\n    if timeout is not None:\n        proxy_kwargs['timeout'] = timeout\n\n    proxy = AuthServiceProxy(url, **proxy_kwargs)\n    proxy.url = url  # store URL on proxy for info\n\n    coverage_logfile = coverage.get_filename(\n        coveragedir, node_number) if coveragedir else None\n\n    return coverage.AuthServiceProxyWrapper(proxy, coverage_logfile)\n\ndef p2p_port(n):\n    assert(n <= MAX_NODES)\n    return PORT_MIN + n + (MAX_NODES * PortSeed.n) % (PORT_RANGE - 1 - MAX_NODES)\n\ndef rpc_port(n):\n    return PORT_MIN + PORT_RANGE + n + (MAX_NODES * PortSeed.n) % (PORT_RANGE - 1 - MAX_NODES)\n\ndef rpc_url(datadir, i, rpchost=None):\n    rpc_u, rpc_p = get_auth_cookie(datadir)\n    host = '127.0.0.1'\n    port = rpc_port(i)\n    if rpchost:\n        parts = rpchost.split(':')\n        if len(parts) == 2:\n            host, port = parts\n        else:\n            host = rpchost\n    return \"http://%s:%s@%s:%d\" % (rpc_u, rpc_p, host, int(port))\n\n# Node functions\n################\n\ndef initialize_datadir(dirname, n):\n    datadir = os.path.join(dirname, \"node\" + str(n))\n    if not os.path.isdir(datadir):\n        os.makedirs(datadir)\n    with open(os.path.join(datadir, \"bitcoin.conf\"), 'w', encoding='utf8') as f:\n        f.write(\"regtest=1\\n\")\n        f.write(\"port=\" + str(p2p_port(n)) + \"\\n\")\n        f.write(\"rpcport=\" + str(rpc_port(n)) + \"\\n\")\n        f.write(\"listenonion=0\\n\")\n    return datadir\n\ndef get_datadir_path(dirname, n):\n    return os.path.join(dirname, \"node\" + str(n))\n\ndef get_auth_cookie(datadir):\n    user = None\n    password = None\n    if os.path.isfile(os.path.join(datadir, \"bitcoin.conf\")):\n        with open(os.path.join(datadir, \"bitcoin.conf\"), 'r', encoding='utf8') as f:\n            for line in f:\n                if line.startswith(\"rpcuser=\"):\n                    assert user is None  # Ensure that there is only one rpcuser line\n                    user = line.split(\"=\")[1].strip(\"\\n\")\n                if line.startswith(\"rpcpassword=\"):\n                    assert password is None  # Ensure that there is only one rpcpassword line\n                    password = line.split(\"=\")[1].strip(\"\\n\")\n    if os.path.isfile(os.path.join(datadir, \"regtest\", \".cookie\")):\n        with open(os.path.join(datadir, \"regtest\", \".cookie\"), 'r') as f:\n            userpass = f.read()\n            split_userpass = userpass.split(':')\n            user = split_userpass[0]\n            password = split_userpass[1]\n    if user is None or password is None:\n        raise ValueError(\"No RPC credentials\")\n    return user, password\n\n# If a cookie file exists in the given datadir, delete it.\ndef delete_cookie_file(datadir):\n    if os.path.isfile(os.path.join(datadir, \"regtest\", \".cookie\")):\n        logger.debug(\"Deleting leftover cookie file\")\n        os.remove(os.path.join(datadir, \"regtest\", \".cookie\"))\n\ndef get_bip9_status(node, key):\n    info = node.getblockchaininfo()\n    return info['bip9_softforks'][key]\n\ndef set_node_times(nodes, t):\n    for node in nodes:\n        node.setmocktime(t)\n\ndef disconnect_nodes(from_connection, node_num):\n    for peer_id in [peer['id'] for peer in from_connection.getpeerinfo() if \"testnode%d\" % node_num in peer['subver']]:\n        try:\n            from_connection.disconnectnode(nodeid=peer_id)\n        except JSONRPCException as e:\n            # If this node is disconnected between calculating the peer id\n            # and issuing the disconnect, don't worry about it.\n            # This avoids a race condition if we're mass-disconnecting peers.\n            if e.error['code'] != -29: # RPC_CLIENT_NODE_NOT_CONNECTED\n                raise\n\n    # wait to disconnect\n    wait_until(lambda: [peer['id'] for peer in from_connection.getpeerinfo() if \"testnode%d\" % node_num in peer['subver']] == [], timeout=5)\n\ndef connect_nodes(from_connection, node_num):\n    ip_port = \"127.0.0.1:\" + str(p2p_port(node_num))\n    from_connection.addnode(ip_port, \"onetry\")\n    # poll until version handshake complete to avoid race conditions\n    # with transaction relaying\n    wait_until(lambda:  all(peer['version'] != 0 for peer in from_connection.getpeerinfo()))\n\ndef connect_nodes_bi(nodes, a, b):\n    connect_nodes(nodes[a], b)\n    connect_nodes(nodes[b], a)\n\ndef sync_blocks(rpc_connections, *, wait=1, timeout=60):\n    \"\"\"\n    Wait until everybody has the same tip.\n\n    sync_blocks needs to be called with an rpc_connections set that has least\n    one node already synced to the latest, stable tip, otherwise there's a\n    chance it might return before all nodes are stably synced.\n    \"\"\"\n    # Use getblockcount() instead of waitforblockheight() to determine the\n    # initial max height because the two RPCs look at different internal global\n    # variables (chainActive vs latestBlock) and the former gets updated\n    # earlier.\n    maxheight = max(x.getblockcount() for x in rpc_connections)\n    start_time = cur_time = time.time()\n    while cur_time <= start_time + timeout:\n        tips = [r.waitforblockheight(maxheight, int(wait * 1000)) for r in rpc_connections]\n        if all(t[\"height\"] == maxheight for t in tips):\n            if all(t[\"hash\"] == tips[0][\"hash\"] for t in tips):\n                return\n            raise AssertionError(\"Block sync failed, mismatched block hashes:{}\".format(\n                                 \"\".join(\"\\n  {!r}\".format(tip) for tip in tips)))\n        cur_time = time.time()\n    raise AssertionError(\"Block sync to height {} timed out:{}\".format(\n                         maxheight, \"\".join(\"\\n  {!r}\".format(tip) for tip in tips)))\n\ndef sync_chain(rpc_connections, *, wait=1, timeout=60):\n    \"\"\"\n    Wait until everybody has the same best block\n    \"\"\"\n    while timeout > 0:\n        best_hash = [x.getbestblockhash() for x in rpc_connections]\n        if best_hash == [best_hash[0]] * len(best_hash):\n            return\n        time.sleep(wait)\n        timeout -= wait\n    raise AssertionError(\"Chain sync failed: Best block hashes don't match\")\n\ndef sync_mempools(rpc_connections, *, wait=1, timeout=60, flush_scheduler=True):\n    \"\"\"\n    Wait until everybody has the same transactions in their memory\n    pools\n    \"\"\"\n    while timeout > 0:\n        pool = set(rpc_connections[0].getrawmempool())\n        num_match = 1\n        for i in range(1, len(rpc_connections)):\n            if set(rpc_connections[i].getrawmempool()) == pool:\n                num_match = num_match + 1\n        if num_match == len(rpc_connections):\n            if flush_scheduler:\n                for r in rpc_connections:\n                    r.syncwithvalidationinterfacequeue()\n            return\n        time.sleep(wait)\n        timeout -= wait\n    raise AssertionError(\"Mempool sync failed\")\n\n# Transaction/Block functions\n#############################\n\ndef find_output(node, txid, amount):\n    \"\"\"\n    Return index to output of txid with value amount\n    Raises exception if there is none.\n    \"\"\"\n    txdata = node.getrawtransaction(txid, 1)\n    for i in range(len(txdata[\"vout\"])):\n        if txdata[\"vout\"][i][\"value\"] == amount:\n            return i\n    raise RuntimeError(\"find_output txid %s : %s not found\" % (txid, str(amount)))\n\ndef gather_inputs(from_node, amount_needed, confirmations_required=1):\n    \"\"\"\n    Return a random set of unspent txouts that are enough to pay amount_needed\n    \"\"\"\n    assert(confirmations_required >= 0)\n    utxo = from_node.listunspent(confirmations_required)\n    random.shuffle(utxo)\n    inputs = []\n    total_in = Decimal(\"0.00000000\")\n    while total_in < amount_needed and len(utxo) > 0:\n        t = utxo.pop()\n        total_in += t[\"amount\"]\n        inputs.append({\"txid\": t[\"txid\"], \"vout\": t[\"vout\"], \"address\": t[\"address\"]})\n    if total_in < amount_needed:\n        raise RuntimeError(\"Insufficient funds: need %d, have %d\" % (amount_needed, total_in))\n    return (total_in, inputs)\n\ndef make_change(from_node, amount_in, amount_out, fee):\n    \"\"\"\n    Create change output(s), return them\n    \"\"\"\n    outputs = {}\n    amount = amount_out + fee\n    change = amount_in - amount\n    if change > amount * 2:\n        # Create an extra change output to break up big inputs\n        change_address = from_node.getnewaddress()\n        # Split change in two, being careful of rounding:\n        outputs[change_address] = Decimal(change / 2).quantize(Decimal('0.00000001'), rounding=ROUND_DOWN)\n        change = amount_in - amount - outputs[change_address]\n    if change > 0:\n        outputs[from_node.getnewaddress()] = change\n    return outputs\n\ndef random_transaction(nodes, amount, min_fee, fee_increment, fee_variants):\n    \"\"\"\n    Create a random transaction.\n    Returns (txid, hex-encoded-transaction-data, fee)\n    \"\"\"\n    from_node = random.choice(nodes)\n    to_node = random.choice(nodes)\n    fee = min_fee + fee_increment * random.randint(0, fee_variants)\n\n    (total_in, inputs) = gather_inputs(from_node, amount + fee)\n    outputs = make_change(from_node, total_in, amount, fee)\n    outputs[to_node.getnewaddress()] = float(amount)\n\n    rawtx = from_node.createrawtransaction(inputs, outputs)\n    signresult = from_node.signrawtransaction(rawtx)\n    txid = from_node.sendrawtransaction(signresult[\"hex\"], True)\n\n    return (txid, signresult[\"hex\"], fee)\n\n# Helper to create at least \"count\" utxos\n# Pass in a fee that is sufficient for relay and mining new transactions.\ndef create_confirmed_utxos(fee, node, count):\n    to_generate = int(0.5 * count) + 101\n    while to_generate > 0:\n        node.generate(min(25, to_generate))\n        to_generate -= 25\n    utxos = node.listunspent()\n    iterations = count - len(utxos)\n    addr1 = node.getnewaddress()\n    addr2 = node.getnewaddress()\n    if iterations <= 0:\n        return utxos\n    for i in range(iterations):\n        t = utxos.pop()\n        inputs = []\n        inputs.append({\"txid\": t[\"txid\"], \"vout\": t[\"vout\"]})\n        outputs = {}\n        send_value = t['amount'] - fee\n        outputs[addr1] = satoshi_round(send_value / 2)\n        outputs[addr2] = satoshi_round(send_value / 2)\n        raw_tx = node.createrawtransaction(inputs, outputs)\n        signed_tx = node.signrawtransaction(raw_tx)[\"hex\"]\n        node.sendrawtransaction(signed_tx)\n\n    while (node.getmempoolinfo()['size'] > 0):\n        node.generate(1)\n\n    utxos = node.listunspent()\n    assert(len(utxos) >= count)\n    return utxos\n\n# Create large OP_RETURN txouts that can be appended to a transaction\n# to make it large (helper for constructing large transactions).\ndef gen_return_txouts():\n    # Some pre-processing to create a bunch of OP_RETURN txouts to insert into transactions we create\n    # So we have big transactions (and therefore can't fit very many into each block)\n    # create one script_pubkey\n    script_pubkey = \"6a4d0200\"  # OP_RETURN OP_PUSH2 512 bytes\n    for i in range(512):\n        script_pubkey = script_pubkey + \"01\"\n    # concatenate 128 txouts of above script_pubkey which we'll insert before the txout for change\n    txouts = \"81\"\n    for k in range(128):\n        # add txout value\n        txouts = txouts + \"0000000000000000\"\n        # add length of script_pubkey\n        txouts = txouts + \"fd0402\"\n        # add script_pubkey\n        txouts = txouts + script_pubkey\n    return txouts\n\ndef create_tx(node, coinbase, to_address, amount):\n    inputs = [{\"txid\": coinbase, \"vout\": 0}]\n    outputs = {to_address: amount}\n    rawtx = node.createrawtransaction(inputs, outputs)\n    signresult = node.signrawtransaction(rawtx)\n    assert_equal(signresult[\"complete\"], True)\n    return signresult[\"hex\"]\n\n# Create a spend of each passed-in utxo, splicing in \"txouts\" to each raw\n# transaction to make it large.  See gen_return_txouts() above.\ndef create_lots_of_big_transactions(node, txouts, utxos, num, fee):\n    addr = node.getnewaddress()\n    txids = []\n    for _ in range(num):\n        t = utxos.pop()\n        inputs = [{\"txid\": t[\"txid\"], \"vout\": t[\"vout\"]}]\n        outputs = {}\n        change = t['amount'] - fee\n        outputs[addr] = satoshi_round(change)\n        rawtx = node.createrawtransaction(inputs, outputs)\n        newtx = rawtx[0:92]\n        newtx = newtx + txouts\n        newtx = newtx + rawtx[94:]\n        signresult = node.signrawtransaction(newtx, None, None, \"NONE\")\n        txid = node.sendrawtransaction(signresult[\"hex\"], True)\n        txids.append(txid)\n    return txids\n\ndef mine_large_block(node, utxos=None):\n    # generate a 66k transaction,\n    # and 14 of them is close to the 1MB block limit\n    num = 14\n    txouts = gen_return_txouts()\n    utxos = utxos if utxos is not None else []\n    if len(utxos) < num:\n        utxos.clear()\n        utxos.extend(node.listunspent())\n    fee = 100 * node.getnetworkinfo()[\"relayfee\"]\n    create_lots_of_big_transactions(node, txouts, utxos, num, fee=fee)\n    node.generate(1)\n"
  },
  {
    "path": "test/functional/test_runner.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Run regression test suite.\n\nThis module calls down into individual test cases via subprocess. It will\nforward all unrecognized arguments onto the individual test scripts.\n\nFunctional tests are disabled on Windows by default. Use --force to run them anyway.\n\nFor a description of arguments recognized by test scripts, see\n`test/functional/test_framework/test_framework.py:BitcoinTestFramework.main`.\n\n\"\"\"\n\nimport argparse\nfrom collections import deque\nimport configparser\nimport datetime\nimport os\nimport time\nimport shutil\nimport signal\nimport sys\nimport subprocess\nimport tempfile\nimport re\nimport logging\n\n# Formatting. Default colors to empty strings.\nBOLD, BLUE, RED, GREY = (\"\", \"\"), (\"\", \"\"), (\"\", \"\"), (\"\", \"\")\ntry:\n    # Make sure python thinks it can write unicode to its stdout\n    \"\\u2713\".encode(\"utf_8\").decode(sys.stdout.encoding)\n    TICK = \"✓ \"\n    CROSS = \"✖ \"\n    CIRCLE = \"○ \"\nexcept UnicodeDecodeError:\n    TICK = \"P \"\n    CROSS = \"x \"\n    CIRCLE = \"o \"\n\nif os.name == 'posix':\n    # primitive formatting on supported\n    # terminal via ANSI escape sequences:\n    BOLD = ('\\033[0m', '\\033[1m')\n    BLUE = ('\\033[0m', '\\033[0;34m')\n    RED = ('\\033[0m', '\\033[0;31m')\n    GREY = ('\\033[0m', '\\033[1;30m')\n\nTEST_EXIT_PASSED = 0\nTEST_EXIT_SKIPPED = 77\n\nBASE_SCRIPTS= [\n    # Scripts that are run by the travis build process.\n    # Longest test should go first, to favor running tests in parallel\n    'wallet_hd.py',\n    'wallet_backup.py',\n    # vv Tests less than 5m vv\n    'feature_block.py',\n    'rpc_fundrawtransaction.py',\n    'p2p_compactblocks.py',\n    'feature_segwit.py',\n    # vv Tests less than 2m vv\n    'wallet_basic.py',\n    'wallet_accounts.py',\n    'p2p_segwit.py',\n    'wallet_dump.py',\n    'rpc_listtransactions.py',\n    # vv Tests less than 60s vv\n    'p2p_sendheaders.py',\n    'wallet_zapwallettxes.py',\n    'wallet_importmulti.py',\n    'mempool_limit.py',\n    'rpc_txoutproof.py',\n    'wallet_listreceivedby.py',\n    'wallet_abandonconflict.py',\n    'feature_csv_activation.py',\n    'rpc_rawtransaction.py',\n    'wallet_address_types.py',\n    'feature_reindex.py',\n    # vv Tests less than 30s vv\n    'wallet_keypool_topup.py',\n    'interface_zmq.py',\n    'interface_bitcoin_cli.py',\n    'mempool_resurrect.py',\n    'wallet_txn_doublespend.py --mineblock',\n    'wallet_txn_clone.py',\n    'wallet_txn_clone.py --segwit',\n    'rpc_getchaintips.py',\n    'interface_rest.py',\n    'mempool_spend_coinbase.py',\n    'mempool_reorg.py',\n    'mempool_persist.py',\n    'wallet_multiwallet.py',\n    'wallet_multiwallet.py --usecli',\n    'interface_http.py',\n    'rpc_users.py',\n    'feature_proxy.py',\n    'rpc_signrawtransaction.py',\n    'p2p_disconnect_ban.py',\n    'rpc_decodescript.py',\n    'rpc_blockchain.py',\n    'rpc_deprecated.py',\n    'wallet_disable.py',\n    'rpc_net.py',\n    'wallet_keypool.py',\n    'p2p_mempool.py',\n    'mining_prioritisetransaction.py',\n    'p2p_invalid_block.py',\n    'p2p_invalid_tx.py',\n    'feature_versionbits_warning.py',\n    'rpc_preciousblock.py',\n    'wallet_importprunedfunds.py',\n    'rpc_signmessage.py',\n    'feature_nulldummy.py',\n    'wallet_import_rescan.py',\n    'mining_basic.py',\n    'wallet_bumpfee.py',\n    'rpc_named_arguments.py',\n    'wallet_listsinceblock.py',\n    'p2p_leak.py',\n    'wallet_encryption.py',\n    'feature_dersig.py',\n    'feature_cltv.py',\n    'rpc_uptime.py',\n    'wallet_resendwallettransactions.py',\n    'feature_minchainwork.py',\n    'p2p_fingerprint.py',\n    'feature_uacomment.py',\n    'p2p_unrequested_blocks.py',\n    'feature_logging.py',\n    'p2p_node_network_limited.py',\n    'feature_config_args.py',\n    'feature_help.py',\n    # Don't append tests at the end to avoid merge conflicts\n    # Put them in a random line within the section that fits their approximate run-time\n]\n\nEXTENDED_SCRIPTS = [\n    # These tests are not run by the travis build process.\n    # Longest test should go first, to favor running tests in parallel\n    'feature_pruning.py',\n    # vv Tests less than 20m vv\n    'feature_fee_estimation.py',\n    # vv Tests less than 5m vv\n    'feature_maxuploadtarget.py',\n    'mempool_packages.py',\n    'feature_dbcrash.py',\n    # vv Tests less than 2m vv\n    'feature_bip68_sequence.py',\n    'mining_getblocktemplate_longpoll.py',\n    'p2p_timeouts.py',\n    # vv Tests less than 60s vv\n    'feature_bip9_softforks.py',\n    'p2p_feefilter.py',\n    'rpc_bind.py',\n    # vv Tests less than 30s vv\n    'feature_assumevalid.py',\n    'example_test.py',\n    'wallet_txn_doublespend.py',\n    'wallet_txn_clone.py --mineblock',\n    'feature_notifications.py',\n    'rpc_invalidateblock.py',\n    'feature_rbf.py',\n]\n\n# Place EXTENDED_SCRIPTS first since it has the 3 longest running tests\nALL_SCRIPTS = EXTENDED_SCRIPTS + BASE_SCRIPTS\n\nNON_SCRIPTS = [\n    # These are python files that live in the functional tests directory, but are not test scripts.\n    \"combine_logs.py\",\n    \"create_cache.py\",\n    \"test_runner.py\",\n]\n\ndef main():\n    # Parse arguments and pass through unrecognised args\n    parser = argparse.ArgumentParser(add_help=False,\n                                     usage='%(prog)s [test_runner.py options] [script options] [scripts]',\n                                     description=__doc__,\n                                     epilog='''\n    Help text and arguments for individual test script:''',\n                                     formatter_class=argparse.RawTextHelpFormatter)\n    parser.add_argument('--combinedlogslen', '-c', type=int, default=0, help='print a combined log (of length n lines) from all test nodes and test framework to the console on failure.')\n    parser.add_argument('--coverage', action='store_true', help='generate a basic coverage report for the RPC interface')\n    parser.add_argument('--exclude', '-x', help='specify a comma-separated-list of scripts to exclude.')\n    parser.add_argument('--extended', action='store_true', help='run the extended test suite in addition to the basic tests')\n    parser.add_argument('--force', '-f', action='store_true', help='run tests even on platforms where they are disabled by default (e.g. windows).')\n    parser.add_argument('--help', '-h', '-?', action='store_true', help='print help text and exit')\n    parser.add_argument('--jobs', '-j', type=int, default=4, help='how many test scripts to run in parallel. Default=4.')\n    parser.add_argument('--keepcache', '-k', action='store_true', help='the default behavior is to flush the cache directory on startup. --keepcache retains the cache from the previous testrun.')\n    parser.add_argument('--quiet', '-q', action='store_true', help='only print results summary and failure logs')\n    parser.add_argument('--tmpdirprefix', '-t', default=tempfile.gettempdir(), help=\"Root directory for datadirs\")\n    args, unknown_args = parser.parse_known_args()\n\n    # args to be passed on always start with two dashes; tests are the remaining unknown args\n    tests = [arg for arg in unknown_args if arg[:2] != \"--\"]\n    passon_args = [arg for arg in unknown_args if arg[:2] == \"--\"]\n\n    # Read config generated by configure.\n    config = configparser.ConfigParser()\n    configfile = os.path.abspath(os.path.dirname(__file__)) + \"/../config.ini\"\n    config.read_file(open(configfile))\n\n    passon_args.append(\"--configfile=%s\" % configfile)\n\n    # Set up logging\n    logging_level = logging.INFO if args.quiet else logging.DEBUG\n    logging.basicConfig(format='%(message)s', level=logging_level)\n\n    # Create base test directory\n    tmpdir = \"%s/bitcoin_test_runner_%s\" % (args.tmpdirprefix, datetime.datetime.now().strftime(\"%Y%m%d_%H%M%S\"))\n    os.makedirs(tmpdir)\n\n    logging.debug(\"Temporary test directory at %s\" % tmpdir)\n\n    enable_wallet = config[\"components\"].getboolean(\"ENABLE_WALLET\")\n    enable_utils = config[\"components\"].getboolean(\"ENABLE_UTILS\")\n    enable_bitcoind = config[\"components\"].getboolean(\"ENABLE_BITCOIND\")\n\n    if config[\"environment\"][\"EXEEXT\"] == \".exe\" and not args.force:\n        # https://github.com/bitcoin/bitcoin/commit/d52802551752140cf41f0d9a225a43e84404d3e9\n        # https://github.com/bitcoin/bitcoin/pull/5677#issuecomment-136646964\n        print(\"Tests currently disabled on Windows by default. Use --force option to enable\")\n        sys.exit(0)\n\n    if not (enable_wallet and enable_utils and enable_bitcoind):\n        print(\"No functional tests to run. Wallet, utils, and bitcoind must all be enabled\")\n        print(\"Rerun `configure` with -enable-wallet, -with-utils and -with-daemon and rerun make\")\n        sys.exit(0)\n\n    # Build list of tests\n    if tests:\n        # Individual tests have been specified. Run specified tests that exist\n        # in the ALL_SCRIPTS list. Accept the name with or without .py extension.\n        tests = [re.sub(\"\\.py$\", \"\", t) + \".py\" for t in tests]\n        test_list = []\n        for t in tests:\n            if t in ALL_SCRIPTS:\n                test_list.append(t)\n            else:\n                print(\"{}WARNING!{} Test '{}' not found in full test list.\".format(BOLD[1], BOLD[0], t))\n    else:\n        # No individual tests have been specified.\n        # Run all base tests, and optionally run extended tests.\n        test_list = BASE_SCRIPTS\n        if args.extended:\n            # place the EXTENDED_SCRIPTS first since the three longest ones\n            # are there and the list is shorter\n            test_list = EXTENDED_SCRIPTS + test_list\n\n    # Remove the test cases that the user has explicitly asked to exclude.\n    if args.exclude:\n        tests_excl = [re.sub(\"\\.py$\", \"\", t) + \".py\" for t in args.exclude.split(',')]\n        for exclude_test in tests_excl:\n            if exclude_test in test_list:\n                test_list.remove(exclude_test)\n            else:\n                print(\"{}WARNING!{} Test '{}' not found in current test list.\".format(BOLD[1], BOLD[0], exclude_test))\n\n    if not test_list:\n        print(\"No valid test scripts specified. Check that your test is in one \"\n              \"of the test lists in test_runner.py, or run test_runner.py with no arguments to run all tests\")\n        sys.exit(0)\n\n    if args.help:\n        # Print help for test_runner.py, then print help of the first script (with args removed) and exit.\n        parser.print_help()\n        subprocess.check_call([(config[\"environment\"][\"SRCDIR\"] + '/test/functional/' + test_list[0].split()[0])] + ['-h'])\n        sys.exit(0)\n\n    check_script_list(config[\"environment\"][\"SRCDIR\"])\n    check_script_prefixes()\n\n    if not args.keepcache:\n        shutil.rmtree(\"%s/test/cache\" % config[\"environment\"][\"BUILDDIR\"], ignore_errors=True)\n\n    run_tests(test_list, config[\"environment\"][\"SRCDIR\"], config[\"environment\"][\"BUILDDIR\"], config[\"environment\"][\"EXEEXT\"], tmpdir, args.jobs, args.coverage, passon_args, args.combinedlogslen)\n\ndef run_tests(test_list, src_dir, build_dir, exeext, tmpdir, jobs=1, enable_coverage=False, args=[], combined_logs_len=0):\n    # Warn if bitcoind is already running (unix only)\n    try:\n        if subprocess.check_output([\"pidof\", \"bitcoind\"]) is not None:\n            print(\"%sWARNING!%s There is already a bitcoind process running on this system. Tests may fail unexpectedly due to resource contention!\" % (BOLD[1], BOLD[0]))\n    except (OSError, subprocess.SubprocessError):\n        pass\n\n    # Warn if there is a cache directory\n    cache_dir = \"%s/test/cache\" % build_dir\n    if os.path.isdir(cache_dir):\n        print(\"%sWARNING!%s There is a cache directory here: %s. If tests fail unexpectedly, try deleting the cache directory.\" % (BOLD[1], BOLD[0], cache_dir))\n\n    #Set env vars\n    if \"BITCOIND\" not in os.environ:\n        os.environ[\"BITCOIND\"] = build_dir + '/src/bitcoind' + exeext\n        os.environ[\"BITCOINCLI\"] = build_dir + '/src/bitcoin-cli' + exeext\n\n    tests_dir = src_dir + '/test/functional/'\n\n    flags = [\"--srcdir={}/src\".format(build_dir)] + args\n    flags.append(\"--cachedir=%s\" % cache_dir)\n\n    if enable_coverage:\n        coverage = RPCCoverage()\n        flags.append(coverage.flag)\n        logging.debug(\"Initializing coverage directory at %s\" % coverage.dir)\n    else:\n        coverage = None\n\n    if len(test_list) > 1 and jobs > 1:\n        # Populate cache\n        try:\n            subprocess.check_output([tests_dir + 'create_cache.py'] + flags + [\"--tmpdir=%s/cache\" % tmpdir])\n        except subprocess.CalledProcessError as e:\n            sys.stdout.buffer.write(e.output)\n            raise\n\n    #Run Tests\n    job_queue = TestHandler(jobs, tests_dir, tmpdir, test_list, flags)\n    time0 = time.time()\n    test_results = []\n\n    max_len_name = len(max(test_list, key=len))\n\n    for _ in range(len(test_list)):\n        test_result, testdir, stdout, stderr = job_queue.get_next()\n        test_results.append(test_result)\n\n        if test_result.status == \"Passed\":\n            logging.debug(\"\\n%s%s%s passed, Duration: %s s\" % (BOLD[1], test_result.name, BOLD[0], test_result.time))\n        elif test_result.status == \"Skipped\":\n            logging.debug(\"\\n%s%s%s skipped\" % (BOLD[1], test_result.name, BOLD[0]))\n        else:\n            print(\"\\n%s%s%s failed, Duration: %s s\\n\" % (BOLD[1], test_result.name, BOLD[0], test_result.time))\n            print(BOLD[1] + 'stdout:\\n' + BOLD[0] + stdout + '\\n')\n            print(BOLD[1] + 'stderr:\\n' + BOLD[0] + stderr + '\\n')\n            if combined_logs_len and os.path.isdir(testdir):\n                # Print the final `combinedlogslen` lines of the combined logs\n                print('{}Combine the logs and print the last {} lines ...{}'.format(BOLD[1], combined_logs_len, BOLD[0]))\n                print('\\n============')\n                print('{}Combined log for {}:{}'.format(BOLD[1], testdir, BOLD[0]))\n                print('============\\n')\n                combined_logs, _ = subprocess.Popen([os.path.join(tests_dir, 'combine_logs.py'), '-c', testdir], universal_newlines=True, stdout=subprocess.PIPE).communicate()\n                print(\"\\n\".join(deque(combined_logs.splitlines(), combined_logs_len)))\n\n    print_results(test_results, max_len_name, (int(time.time() - time0)))\n\n    if coverage:\n        coverage.report_rpc_coverage()\n\n        logging.debug(\"Cleaning up coverage data\")\n        coverage.cleanup()\n\n    # Clear up the temp directory if all subdirectories are gone\n    if not os.listdir(tmpdir):\n        os.rmdir(tmpdir)\n\n    all_passed = all(map(lambda test_result: test_result.was_successful, test_results))\n\n    sys.exit(not all_passed)\n\ndef print_results(test_results, max_len_name, runtime):\n    results = \"\\n\" + BOLD[1] + \"%s | %s | %s\\n\\n\" % (\"TEST\".ljust(max_len_name), \"STATUS   \", \"DURATION\") + BOLD[0]\n\n    test_results.sort(key=lambda result: result.name.lower())\n    all_passed = True\n    time_sum = 0\n\n    for test_result in test_results:\n        all_passed = all_passed and test_result.was_successful\n        time_sum += test_result.time\n        test_result.padding = max_len_name\n        results += str(test_result)\n\n    status = TICK + \"Passed\" if all_passed else CROSS + \"Failed\"\n    results += BOLD[1] + \"\\n%s | %s | %s s (accumulated) \\n\" % (\"ALL\".ljust(max_len_name), status.ljust(9), time_sum) + BOLD[0]\n    results += \"Runtime: %s s\\n\" % (runtime)\n    print(results)\n\nclass TestHandler:\n    \"\"\"\n    Trigger the test scripts passed in via the list.\n    \"\"\"\n\n    def __init__(self, num_tests_parallel, tests_dir, tmpdir, test_list=None, flags=None):\n        assert(num_tests_parallel >= 1)\n        self.num_jobs = num_tests_parallel\n        self.tests_dir = tests_dir\n        self.tmpdir = tmpdir\n        self.test_list = test_list\n        self.flags = flags\n        self.num_running = 0\n        # In case there is a graveyard of zombie bitcoinds, we can apply a\n        # pseudorandom offset to hopefully jump over them.\n        # (625 is PORT_RANGE/MAX_NODES)\n        self.portseed_offset = int(time.time() * 1000) % 625\n        self.jobs = []\n\n    def get_next(self):\n        while self.num_running < self.num_jobs and self.test_list:\n            # Add tests\n            self.num_running += 1\n            t = self.test_list.pop(0)\n            portseed = len(self.test_list) + self.portseed_offset\n            portseed_arg = [\"--portseed={}\".format(portseed)]\n            log_stdout = tempfile.SpooledTemporaryFile(max_size=2**16)\n            log_stderr = tempfile.SpooledTemporaryFile(max_size=2**16)\n            test_argv = t.split()\n            testdir = \"{}/{}_{}\".format(self.tmpdir, re.sub(\".py$\", \"\", test_argv[0]), portseed)\n            tmpdir_arg = [\"--tmpdir={}\".format(testdir)]\n            self.jobs.append((t,\n                              time.time(),\n                              subprocess.Popen([self.tests_dir + test_argv[0]] + test_argv[1:] + self.flags + portseed_arg + tmpdir_arg,\n                                               universal_newlines=True,\n                                               stdout=log_stdout,\n                                               stderr=log_stderr),\n                              testdir,\n                              log_stdout,\n                              log_stderr))\n        if not self.jobs:\n            raise IndexError('pop from empty list')\n        while True:\n            # Return first proc that finishes\n            time.sleep(.5)\n            for j in self.jobs:\n                (name, time0, proc, testdir, log_out, log_err) = j\n                if os.getenv('TRAVIS') == 'true' and int(time.time() - time0) > 20 * 60:\n                    # In travis, timeout individual tests after 20 minutes (to stop tests hanging and not\n                    # providing useful output.\n                    proc.send_signal(signal.SIGINT)\n                if proc.poll() is not None:\n                    log_out.seek(0), log_err.seek(0)\n                    [stdout, stderr] = [l.read().decode('utf-8') for l in (log_out, log_err)]\n                    log_out.close(), log_err.close()\n                    if proc.returncode == TEST_EXIT_PASSED and stderr == \"\":\n                        status = \"Passed\"\n                    elif proc.returncode == TEST_EXIT_SKIPPED:\n                        status = \"Skipped\"\n                    else:\n                        status = \"Failed\"\n                    self.num_running -= 1\n                    self.jobs.remove(j)\n\n                    return TestResult(name, status, int(time.time() - time0)), testdir, stdout, stderr\n            print('.', end='', flush=True)\n\nclass TestResult():\n    def __init__(self, name, status, time):\n        self.name = name\n        self.status = status\n        self.time = time\n        self.padding = 0\n\n    def __repr__(self):\n        if self.status == \"Passed\":\n            color = BLUE\n            glyph = TICK\n        elif self.status == \"Failed\":\n            color = RED\n            glyph = CROSS\n        elif self.status == \"Skipped\":\n            color = GREY\n            glyph = CIRCLE\n\n        return color[1] + \"%s | %s%s | %s s\\n\" % (self.name.ljust(self.padding), glyph, self.status.ljust(7), self.time) + color[0]\n\n    @property\n    def was_successful(self):\n        return self.status != \"Failed\"\n\n\ndef check_script_prefixes():\n    \"\"\"Check that at most a handful of the\n       test scripts don't start with one of the allowed name prefixes.\"\"\"\n\n    # LEEWAY is provided as a transition measure, so that pull-requests\n    # that introduce new tests that don't conform with the naming\n    # convention don't immediately cause the tests to fail.\n    LEEWAY = 10\n\n    good_prefixes_re = re.compile(\"(example|feature|interface|mempool|mining|p2p|rpc|wallet)_\")\n    bad_script_names = [script for script in ALL_SCRIPTS if good_prefixes_re.match(script) is None]\n\n    if len(bad_script_names) > 0:\n        print(\"INFO: %d tests not meeting naming conventions:\" % (len(bad_script_names)))\n        print(\"  %s\" % (\"\\n  \".join(sorted(bad_script_names))))\n    assert len(bad_script_names) <= LEEWAY, \"Too many tests not following naming convention! (%d found, maximum: %d)\" % (len(bad_script_names), LEEWAY)\n\n\ndef check_script_list(src_dir):\n    \"\"\"Check scripts directory.\n\n    Check that there are no scripts in the functional tests directory which are\n    not being run by pull-tester.py.\"\"\"\n    script_dir = src_dir + '/test/functional/'\n    python_files = set([t for t in os.listdir(script_dir) if t[-3:] == \".py\"])\n    missed_tests = list(python_files - set(map(lambda x: x.split()[0], ALL_SCRIPTS + NON_SCRIPTS)))\n    if len(missed_tests) != 0:\n        print(\"%sWARNING!%s The following scripts are not being run: %s. Check the test lists in test_runner.py.\" % (BOLD[1], BOLD[0], str(missed_tests)))\n        if os.getenv('TRAVIS') == 'true':\n            # On travis this warning is an error to prevent merging incomplete commits into master\n            sys.exit(1)\n\nclass RPCCoverage():\n    \"\"\"\n    Coverage reporting utilities for test_runner.\n\n    Coverage calculation works by having each test script subprocess write\n    coverage files into a particular directory. These files contain the RPC\n    commands invoked during testing, as well as a complete listing of RPC\n    commands per `bitcoin-cli help` (`rpc_interface.txt`).\n\n    After all tests complete, the commands run are combined and diff'd against\n    the complete list to calculate uncovered RPC commands.\n\n    See also: test/functional/test_framework/coverage.py\n\n    \"\"\"\n    def __init__(self):\n        self.dir = tempfile.mkdtemp(prefix=\"coverage\")\n        self.flag = '--coveragedir=%s' % self.dir\n\n    def report_rpc_coverage(self):\n        \"\"\"\n        Print out RPC commands that were unexercised by tests.\n\n        \"\"\"\n        uncovered = self._get_uncovered_rpc_commands()\n\n        if uncovered:\n            print(\"Uncovered RPC commands:\")\n            print(\"\".join((\"  - %s\\n\" % i) for i in sorted(uncovered)))\n        else:\n            print(\"All RPC commands covered.\")\n\n    def cleanup(self):\n        return shutil.rmtree(self.dir)\n\n    def _get_uncovered_rpc_commands(self):\n        \"\"\"\n        Return a set of currently untested RPC commands.\n\n        \"\"\"\n        # This is shared from `test/functional/test-framework/coverage.py`\n        reference_filename = 'rpc_interface.txt'\n        coverage_file_prefix = 'coverage.'\n\n        coverage_ref_filename = os.path.join(self.dir, reference_filename)\n        coverage_filenames = set()\n        all_cmds = set()\n        covered_cmds = set()\n\n        if not os.path.isfile(coverage_ref_filename):\n            raise RuntimeError(\"No coverage reference found\")\n\n        with open(coverage_ref_filename, 'r') as f:\n            all_cmds.update([i.strip() for i in f.readlines()])\n\n        for root, dirs, files in os.walk(self.dir):\n            for filename in files:\n                if filename.startswith(coverage_file_prefix):\n                    coverage_filenames.add(os.path.join(root, filename))\n\n        for filename in coverage_filenames:\n            with open(filename, 'r') as f:\n                covered_cmds.update([i.strip() for i in f.readlines()])\n\n        return all_cmds - covered_cmds\n\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "test/functional/wallet_abandonconflict.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the abandontransaction RPC.\n\n The abandontransaction RPC marks a transaction and all its in-wallet\n descendants as abandoned which allows their inputs to be respent. It can be\n used to replace \"stuck\" or evicted transactions. It only works on transactions\n which are not included in a block and are not currently in the mempool. It has\n no effect on transactions which are already conflicted or abandoned.\n\"\"\"\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass AbandonConflictTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.extra_args = [[\"-minrelaytxfee=0.00001\"], []]\n\n    def run_test(self):\n        self.nodes[1].generate(100)\n        sync_blocks(self.nodes)\n        balance = self.nodes[0].getbalance()\n        txA = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), Decimal(\"10\"))\n        txB = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), Decimal(\"10\"))\n        txC = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), Decimal(\"10\"))\n        sync_mempools(self.nodes)\n        self.nodes[1].generate(1)\n\n        sync_blocks(self.nodes)\n        newbalance = self.nodes[0].getbalance()\n        assert(balance - newbalance < Decimal(\"0.001\")) #no more than fees lost\n        balance = newbalance\n\n        # Disconnect nodes so node0's transactions don't get into node1's mempool\n        disconnect_nodes(self.nodes[0], 1)\n\n        # Identify the 10btc outputs\n        nA = next(i for i, vout in enumerate(self.nodes[0].getrawtransaction(txA, 1)[\"vout\"]) if vout[\"value\"] == Decimal(\"10\"))\n        nB = next(i for i, vout in enumerate(self.nodes[0].getrawtransaction(txB, 1)[\"vout\"]) if vout[\"value\"] == Decimal(\"10\"))\n        nC = next(i for i, vout in enumerate(self.nodes[0].getrawtransaction(txC, 1)[\"vout\"]) if vout[\"value\"] == Decimal(\"10\"))\n\n        inputs =[]\n        # spend 10btc outputs from txA and txB\n        inputs.append({\"txid\":txA, \"vout\":nA})\n        inputs.append({\"txid\":txB, \"vout\":nB})\n        outputs = {}\n\n        outputs[self.nodes[0].getnewaddress()] = Decimal(\"14.99998\")\n        outputs[self.nodes[1].getnewaddress()] = Decimal(\"5\")\n        signed = self.nodes[0].signrawtransaction(self.nodes[0].createrawtransaction(inputs, outputs))\n        txAB1 = self.nodes[0].sendrawtransaction(signed[\"hex\"])\n\n        # Identify the 14.99998btc output\n        nAB = next(i for i, vout in enumerate(self.nodes[0].getrawtransaction(txAB1, 1)[\"vout\"]) if vout[\"value\"] == Decimal(\"14.99998\"))\n\n        #Create a child tx spending AB1 and C\n        inputs = []\n        inputs.append({\"txid\":txAB1, \"vout\":nAB})\n        inputs.append({\"txid\":txC, \"vout\":nC})\n        outputs = {}\n        outputs[self.nodes[0].getnewaddress()] = Decimal(\"24.9996\")\n        signed2 = self.nodes[0].signrawtransaction(self.nodes[0].createrawtransaction(inputs, outputs))\n        txABC2 = self.nodes[0].sendrawtransaction(signed2[\"hex\"])\n\n        # Create a child tx spending ABC2\n        signed3_change = Decimal(\"24.999\")\n        inputs = [ {\"txid\":txABC2, \"vout\":0} ]\n        outputs = { self.nodes[0].getnewaddress(): signed3_change }\n        signed3 = self.nodes[0].signrawtransaction(self.nodes[0].createrawtransaction(inputs, outputs))\n        # note tx is never directly referenced, only abandoned as a child of the above\n        self.nodes[0].sendrawtransaction(signed3[\"hex\"])\n\n        # In mempool txs from self should increase balance from change\n        newbalance = self.nodes[0].getbalance()\n        assert_equal(newbalance, balance - Decimal(\"30\") + signed3_change)\n        balance = newbalance\n\n        # Restart the node with a higher min relay fee so the parent tx is no longer in mempool\n        # TODO: redo with eviction\n        self.stop_node(0)\n        self.start_node(0, extra_args=[\"-minrelaytxfee=0.0001\"])\n\n        # Verify txs no longer in either node's mempool\n        assert_equal(len(self.nodes[0].getrawmempool()), 0)\n        assert_equal(len(self.nodes[1].getrawmempool()), 0)\n\n        # Not in mempool txs from self should only reduce balance\n        # inputs are still spent, but change not received\n        newbalance = self.nodes[0].getbalance()\n        assert_equal(newbalance, balance - signed3_change)\n        # Unconfirmed received funds that are not in mempool, also shouldn't show\n        # up in unconfirmed balance\n        unconfbalance = self.nodes[0].getunconfirmedbalance() + self.nodes[0].getbalance()\n        assert_equal(unconfbalance, newbalance)\n        # Also shouldn't show up in listunspent\n        assert(not txABC2 in [utxo[\"txid\"] for utxo in self.nodes[0].listunspent(0)])\n        balance = newbalance\n\n        # Abandon original transaction and verify inputs are available again\n        # including that the child tx was also abandoned\n        self.nodes[0].abandontransaction(txAB1)\n        newbalance = self.nodes[0].getbalance()\n        assert_equal(newbalance, balance + Decimal(\"30\"))\n        balance = newbalance\n\n        # Verify that even with a low min relay fee, the tx is not reaccepted from wallet on startup once abandoned\n        self.stop_node(0)\n        self.start_node(0, extra_args=[\"-minrelaytxfee=0.00001\"])\n        assert_equal(len(self.nodes[0].getrawmempool()), 0)\n        assert_equal(self.nodes[0].getbalance(), balance)\n\n        # But if its received again then it is unabandoned\n        # And since now in mempool, the change is available\n        # But its child tx remains abandoned\n        self.nodes[0].sendrawtransaction(signed[\"hex\"])\n        newbalance = self.nodes[0].getbalance()\n        assert_equal(newbalance, balance - Decimal(\"20\") + Decimal(\"14.99998\"))\n        balance = newbalance\n\n        # Send child tx again so its unabandoned\n        self.nodes[0].sendrawtransaction(signed2[\"hex\"])\n        newbalance = self.nodes[0].getbalance()\n        assert_equal(newbalance, balance - Decimal(\"10\") - Decimal(\"14.99998\") + Decimal(\"24.9996\"))\n        balance = newbalance\n\n        # Remove using high relay fee again\n        self.stop_node(0)\n        self.start_node(0, extra_args=[\"-minrelaytxfee=0.0001\"])\n        assert_equal(len(self.nodes[0].getrawmempool()), 0)\n        newbalance = self.nodes[0].getbalance()\n        assert_equal(newbalance, balance - Decimal(\"24.9996\"))\n        balance = newbalance\n\n        # Create a double spend of AB1 by spending again from only A's 10 output\n        # Mine double spend from node 1\n        inputs =[]\n        inputs.append({\"txid\":txA, \"vout\":nA})\n        outputs = {}\n        outputs[self.nodes[1].getnewaddress()] = Decimal(\"9.9999\")\n        tx = self.nodes[0].createrawtransaction(inputs, outputs)\n        signed = self.nodes[0].signrawtransaction(tx)\n        self.nodes[1].sendrawtransaction(signed[\"hex\"])\n        self.nodes[1].generate(1)\n\n        connect_nodes(self.nodes[0], 1)\n        sync_blocks(self.nodes)\n\n        # Verify that B and C's 10 BTC outputs are available for spending again because AB1 is now conflicted\n        newbalance = self.nodes[0].getbalance()\n        assert_equal(newbalance, balance + Decimal(\"20\"))\n        balance = newbalance\n\n        # There is currently a minor bug around this and so this test doesn't work.  See Issue #7315\n        # Invalidate the block with the double spend and B's 10 BTC output should no longer be available\n        # Don't think C's should either\n        self.nodes[0].invalidateblock(self.nodes[0].getbestblockhash())\n        newbalance = self.nodes[0].getbalance()\n        #assert_equal(newbalance, balance - Decimal(\"10\"))\n        self.log.info(\"If balance has not declined after invalidateblock then out of mempool wallet tx which is no longer\")\n        self.log.info(\"conflicted has not resumed causing its inputs to be seen as spent.  See Issue #7315\")\n        self.log.info(str(balance) + \" -> \" + str(newbalance) + \" ?\")\n\nif __name__ == '__main__':\n    AbandonConflictTest().main()\n"
  },
  {
    "path": "test/functional/wallet_accounts.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test account RPCs.\n\nRPCs tested are:\n    - getaccountaddress\n    - getaddressesbyaccount\n    - listaddressgroupings\n    - setaccount\n    - sendfrom (with account arguments)\n    - move (with account arguments)\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal\n\nclass WalletAccountsTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n        self.extra_args = [[]]\n\n    def run_test(self):\n        node = self.nodes[0]\n        # Check that there's no UTXO on any of the nodes\n        assert_equal(len(node.listunspent()), 0)\n\n        # Note each time we call generate, all generated coins go into\n        # the same address, so we call twice to get two addresses w/50 each\n        node.generate(1)\n        node.generate(101)\n        assert_equal(node.getbalance(), 100)\n\n        # there should be 2 address groups\n        # each with 1 address with a balance of 50 Bitcoins\n        address_groups = node.listaddressgroupings()\n        assert_equal(len(address_groups), 2)\n        # the addresses aren't linked now, but will be after we send to the\n        # common address\n        linked_addresses = set()\n        for address_group in address_groups:\n            assert_equal(len(address_group), 1)\n            assert_equal(len(address_group[0]), 2)\n            assert_equal(address_group[0][1], 50)\n            linked_addresses.add(address_group[0][0])\n\n        # send 50 from each address to a third address not in this wallet\n        # There's some fee that will come back to us when the miner reward\n        # matures.\n        common_address = \"msf4WtN1YQKXvNtvdFYt9JBnUD2FB41kjr\"\n        txid = node.sendmany(\n            fromaccount=\"\",\n            amounts={common_address: 100},\n            subtractfeefrom=[common_address],\n            minconf=1,\n        )\n        tx_details = node.gettransaction(txid)\n        fee = -tx_details['details'][0]['fee']\n        # there should be 1 address group, with the previously\n        # unlinked addresses now linked (they both have 0 balance)\n        address_groups = node.listaddressgroupings()\n        assert_equal(len(address_groups), 1)\n        assert_equal(len(address_groups[0]), 2)\n        assert_equal(set([a[0] for a in address_groups[0]]), linked_addresses)\n        assert_equal([a[1] for a in address_groups[0]], [0, 0])\n\n        node.generate(1)\n\n        # we want to reset so that the \"\" account has what's expected.\n        # otherwise we're off by exactly the fee amount as that's mined\n        # and matures in the next 100 blocks\n        node.sendfrom(\"\", common_address, fee)\n        amount_to_send = 1.0\n\n        # Create accounts and make sure subsequent account API calls\n        # recognize the account/address associations.\n        accounts = [Account(name) for name in (\"a\", \"b\", \"c\", \"d\", \"e\")]\n        for account in accounts:\n            account.add_receive_address(node.getaccountaddress(account.name))\n            account.verify(node)\n\n        # Send a transaction to each account, and make sure this forces\n        # getaccountaddress to generate a new receiving address.\n        for account in accounts:\n            node.sendtoaddress(account.receive_address, amount_to_send)\n            account.add_receive_address(node.getaccountaddress(account.name))\n            account.verify(node)\n\n        # Check the amounts received.\n        node.generate(1)\n        for account in accounts:\n            assert_equal(\n                node.getreceivedbyaddress(account.addresses[0]), amount_to_send)\n            assert_equal(node.getreceivedbyaccount(account.name), amount_to_send)\n        \n        # Check that sendfrom account reduces listaccounts balances.\n        for i, account in enumerate(accounts):\n            to_account = accounts[(i+1) % len(accounts)]\n            node.sendfrom(account.name, to_account.receive_address, amount_to_send)\n        node.generate(1)\n        for account in accounts:\n            account.add_receive_address(node.getaccountaddress(account.name))\n            account.verify(node)\n            assert_equal(node.getreceivedbyaccount(account.name), 2)\n            node.move(account.name, \"\", node.getbalance(account.name))\n            account.verify(node)\n        node.generate(101)\n        expected_account_balances = {\"\": 5200}\n        for account in accounts:\n            expected_account_balances[account.name] = 0\n        assert_equal(node.listaccounts(), expected_account_balances)\n        assert_equal(node.getbalance(\"\"), 5200)\n        \n        # Check that setaccount can assign an account to a new unused address.\n        for account in accounts:\n            address = node.getaccountaddress(\"\")\n            node.setaccount(address, account.name)\n            account.add_address(address)\n            account.verify(node)\n            assert(address not in node.getaddressesbyaccount(\"\"))\n        \n        # Check that addmultisigaddress can assign accounts.\n        for account in accounts:\n            addresses = []\n            for x in range(10):\n                addresses.append(node.getnewaddress())\n            multisig_address = node.addmultisigaddress(5, addresses, account.name)['address']\n            account.add_address(multisig_address)\n            account.verify(node)\n            node.sendfrom(\"\", multisig_address, 50)\n        node.generate(101)\n        for account in accounts:\n            assert_equal(node.getbalance(account.name), 50)\n\n        # Check that setaccount can change the account of an address from a\n        # different account.\n        change_account(node, accounts[0].addresses[0], accounts[0], accounts[1])\n\n        # Check that setaccount can change the account of an address which\n        # is the receiving address of a different account.\n        change_account(node, accounts[0].receive_address, accounts[0], accounts[1])\n\n        # Check that setaccount can set the account of an address already\n        # in the account. This is a no-op.\n        change_account(node, accounts[2].addresses[0], accounts[2], accounts[2])\n\n        # Check that setaccount can set the account of an address which is\n        # already the receiving address of the account. It would probably make\n        # sense for this to be a no-op, but right now it resets the receiving\n        # address, causing getaccountaddress to return a brand new address.\n        change_account(node, accounts[2].receive_address, accounts[2], accounts[2])\n\nclass Account:\n    def __init__(self, name):\n        # Account name\n        self.name = name\n        # Current receiving address associated with this account.\n        self.receive_address = None\n        # List of all addresses assigned with this account\n        self.addresses = []\n\n    def add_address(self, address):\n        assert_equal(address not in self.addresses, True)\n        self.addresses.append(address)\n\n    def add_receive_address(self, address):\n        self.add_address(address)\n        self.receive_address = address\n\n    def verify(self, node):\n        if self.receive_address is not None:\n            assert self.receive_address in self.addresses\n            assert_equal(node.getaccountaddress(self.name), self.receive_address)\n\n        for address in self.addresses:\n            assert_equal(node.getaccount(address), self.name)\n\n        assert_equal(\n            set(node.getaddressesbyaccount(self.name)), set(self.addresses))\n\n\ndef change_account(node, address, old_account, new_account):\n    assert_equal(address in old_account.addresses, True)\n    node.setaccount(address, new_account.name)\n\n    old_account.addresses.remove(address)\n    new_account.add_address(address)\n\n    # Calling setaccount on an address which was previously the receiving\n    # address of a different account should reset the receiving address of\n    # the old account, causing getaccountaddress to return a brand new\n    # address.\n    if address == old_account.receive_address:\n        new_address = node.getaccountaddress(old_account.name)\n        assert_equal(new_address not in old_account.addresses, True)\n        assert_equal(new_address not in new_account.addresses, True)\n        old_account.add_receive_address(new_address)\n\n    old_account.verify(node)\n    new_account.verify(node)\n\n\nif __name__ == '__main__':\n    WalletAccountsTest().main()\n"
  },
  {
    "path": "test/functional/wallet_address_types.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test that the wallet can send and receive using all combinations of address types.\n\nThere are 5 nodes-under-test:\n    - node0 uses legacy addresses\n    - node1 uses p2sh/segwit addresses\n    - node2 uses p2sh/segwit addresses and bech32 addresses for change\n    - node3 uses bech32 addresses\n    - node4 uses a p2sh/segwit addresses for change\n\nnode5 exists to generate new blocks.\n\n## Multisig address test\n\nTest that adding a multisig address with:\n    - an uncompressed pubkey always gives a legacy address\n    - only compressed pubkeys gives the an `-addresstype` address\n\n## Sending to address types test\n\nA series of tests, iterating over node0-node4. In each iteration of the test, one node sends:\n    - 10/101th of its balance to itself (using getrawchangeaddress for single key addresses)\n    - 20/101th to the next node\n    - 30/101th to the node after that\n    - 40/101th to the remaining node\n    - 1/101th remains as fee+change\n\nIterate over each node for single key addresses, and then over each node for\nmultisig addresses.\n\nRepeat test, but with explicit address_type parameters passed to getnewaddress\nand getrawchangeaddress:\n    - node0 and node3 send to p2sh.\n    - node1 sends to bech32.\n    - node2 sends to legacy.\n\nAs every node sends coins after receiving, this also\nverifies that spending coins sent to all these address types works.\n\n## Change type test\n\nTest that the nodes generate the correct change address type:\n    - node0 always uses a legacy change address.\n    - node1 uses a bech32 addresses for change if any destination address is bech32.\n    - node2 always uses a bech32 address for change\n    - node3 always uses a bech32 address for change\n    - node4 always uses p2sh/segwit output for change.\n\"\"\"\n\nfrom decimal import Decimal\nimport itertools\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    assert_greater_than,\n    assert_raises_rpc_error,\n    connect_nodes_bi,\n    sync_blocks,\n    sync_mempools,\n)\n\nclass AddressTypeTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 6\n        self.extra_args = [\n            [\"-addresstype=legacy\"],\n            [\"-addresstype=p2sh-segwit\"],\n            [\"-addresstype=p2sh-segwit\", \"-changetype=bech32\"],\n            [\"-addresstype=bech32\"],\n            [\"-changetype=p2sh-segwit\"],\n            []\n        ]\n\n    def setup_network(self):\n        self.setup_nodes()\n\n        # Fully mesh-connect nodes for faster mempool sync\n        for i, j in itertools.product(range(self.num_nodes), repeat=2):\n            if i > j:\n                connect_nodes_bi(self.nodes, i, j)\n        self.sync_all()\n\n    def get_balances(self, confirmed=True):\n        \"\"\"Return a list of confirmed or unconfirmed balances.\"\"\"\n        if confirmed:\n            return [self.nodes[i].getbalance() for i in range(4)]\n        else:\n            return [self.nodes[i].getunconfirmedbalance() for i in range(4)]\n\n    def test_address(self, node, address, multisig, typ):\n        \"\"\"Run sanity checks on an address.\"\"\"\n        info = self.nodes[node].validateaddress(address)\n        assert(info['isvalid'])\n        if not multisig and typ == 'legacy':\n            # P2PKH\n            assert(not info['isscript'])\n            assert(not info['iswitness'])\n            assert('pubkey' in info)\n        elif not multisig and typ == 'p2sh-segwit':\n            # P2SH-P2WPKH\n            assert(info['isscript'])\n            assert(not info['iswitness'])\n            assert_equal(info['script'], 'witness_v0_keyhash')\n            assert('pubkey' in info)\n        elif not multisig and typ == 'bech32':\n            # P2WPKH\n            assert(not info['isscript'])\n            assert(info['iswitness'])\n            assert_equal(info['witness_version'], 0)\n            assert_equal(len(info['witness_program']), 40)\n            assert('pubkey' in info)\n        elif typ == 'legacy':\n            # P2SH-multisig\n            assert(info['isscript'])\n            assert_equal(info['script'], 'multisig')\n            assert(not info['iswitness'])\n            assert('pubkeys' in info)\n        elif typ == 'p2sh-segwit':\n            # P2SH-P2WSH-multisig\n            assert(info['isscript'])\n            assert_equal(info['script'], 'witness_v0_scripthash')\n            assert(not info['iswitness'])\n            assert(info['embedded']['isscript'])\n            assert_equal(info['embedded']['script'], 'multisig')\n            assert(info['embedded']['iswitness'])\n            assert_equal(info['embedded']['witness_version'], 0)\n            assert_equal(len(info['embedded']['witness_program']), 64)\n            assert('pubkeys' in info['embedded'])\n        elif typ == 'bech32':\n            # P2WSH-multisig\n            assert(info['isscript'])\n            assert_equal(info['script'], 'multisig')\n            assert(info['iswitness'])\n            assert_equal(info['witness_version'], 0)\n            assert_equal(len(info['witness_program']), 64)\n            assert('pubkeys' in info)\n        else:\n            # Unknown type\n            assert(False)\n\n    def test_change_output_type(self, node_sender, destinations, expected_type):\n        txid = self.nodes[node_sender].sendmany(fromaccount=\"\", amounts=dict.fromkeys(destinations, 0.001))\n        raw_tx = self.nodes[node_sender].getrawtransaction(txid)\n        tx = self.nodes[node_sender].decoderawtransaction(raw_tx)\n\n        # Make sure the transaction has change:\n        assert_equal(len(tx[\"vout\"]), len(destinations) + 1)\n\n        # Make sure the destinations are included, and remove them:\n        output_addresses = [vout['scriptPubKey']['addresses'][0] for vout in tx[\"vout\"]]\n        change_addresses = [d for d in output_addresses if d not in destinations]\n        assert_equal(len(change_addresses), 1)\n\n        self.log.debug(\"Check if change address \" + change_addresses[0] + \" is \" + expected_type)\n        self.test_address(node_sender, change_addresses[0], multisig=False, typ=expected_type)\n\n    def run_test(self):\n        # Mine 101 blocks on node5 to bring nodes out of IBD and make sure that\n        # no coinbases are maturing for the nodes-under-test during the test\n        self.nodes[5].generate(101)\n        sync_blocks(self.nodes)\n\n        uncompressed_1 = \"0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee\"\n        uncompressed_2 = \"047211a824f55b505228e4c3d5194c1fcfaa15a456abdf37f9b9d97a4040afc073dee6c89064984f03385237d92167c13e236446b417ab79a0fcae412ae3316b77\"\n        compressed_1 = \"0296b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52\"\n        compressed_2 = \"037211a824f55b505228e4c3d5194c1fcfaa15a456abdf37f9b9d97a4040afc073\"\n\n        # addmultisigaddress with at least 1 uncompressed key should return a legacy address.\n        for node in range(4):\n            self.test_address(node, self.nodes[node].addmultisigaddress(2, [uncompressed_1, uncompressed_2])['address'], True, 'legacy')\n            self.test_address(node, self.nodes[node].addmultisigaddress(2, [compressed_1, uncompressed_2])['address'], True, 'legacy')\n            self.test_address(node, self.nodes[node].addmultisigaddress(2, [uncompressed_1, compressed_2])['address'], True, 'legacy')\n        # addmultisigaddress with all compressed keys should return the appropriate address type (even when the keys are not ours).\n        self.test_address(0, self.nodes[0].addmultisigaddress(2, [compressed_1, compressed_2])['address'], True, 'legacy')\n        self.test_address(1, self.nodes[1].addmultisigaddress(2, [compressed_1, compressed_2])['address'], True, 'p2sh-segwit')\n        self.test_address(2, self.nodes[2].addmultisigaddress(2, [compressed_1, compressed_2])['address'], True, 'p2sh-segwit')\n        self.test_address(3, self.nodes[3].addmultisigaddress(2, [compressed_1, compressed_2])['address'], True, 'bech32')\n\n        for explicit_type, multisig, from_node in itertools.product([False, True], [False, True], range(4)):\n            address_type = None\n            if explicit_type and not multisig:\n                if from_node == 1:\n                    address_type = 'bech32'\n                elif from_node == 0 or from_node == 3:\n                    address_type = 'p2sh-segwit'\n                else:\n                    address_type = 'legacy'\n            self.log.info(\"Sending from node {} ({}) with{} multisig using {}\".format(from_node, self.extra_args[from_node], \"\" if multisig else \"out\", \"default\" if address_type is None else address_type))\n            old_balances = self.get_balances()\n            self.log.debug(\"Old balances are {}\".format(old_balances))\n            to_send = (old_balances[from_node] / 101).quantize(Decimal(\"0.00000001\"))\n            sends = {}\n\n            self.log.debug(\"Prepare sends\")\n            for n, to_node in enumerate(range(from_node, from_node + 4)):\n                to_node %= 4\n                change = False\n                if not multisig:\n                    if from_node == to_node:\n                        # When sending non-multisig to self, use getrawchangeaddress\n                        address = self.nodes[to_node].getrawchangeaddress(address_type=address_type)\n                        change = True\n                    else:\n                        address = self.nodes[to_node].getnewaddress(address_type=address_type)\n                else:\n                    addr1 = self.nodes[to_node].getnewaddress()\n                    addr2 = self.nodes[to_node].getnewaddress()\n                    address = self.nodes[to_node].addmultisigaddress(2, [addr1, addr2])['address']\n\n                # Do some sanity checking on the created address\n                if address_type is not None:\n                    typ = address_type\n                elif to_node == 0:\n                    typ = 'legacy'\n                elif to_node == 1 or (to_node == 2 and not change):\n                    typ = 'p2sh-segwit'\n                else:\n                    typ = 'bech32'\n                self.test_address(to_node, address, multisig, typ)\n\n                # Output entry\n                sends[address] = to_send * 10 * (1 + n)\n\n            self.log.debug(\"Sending: {}\".format(sends))\n            self.nodes[from_node].sendmany(\"\", sends)\n            sync_mempools(self.nodes)\n\n            unconf_balances = self.get_balances(False)\n            self.log.debug(\"Check unconfirmed balances: {}\".format(unconf_balances))\n            assert_equal(unconf_balances[from_node], 0)\n            for n, to_node in enumerate(range(from_node + 1, from_node + 4)):\n                to_node %= 4\n                assert_equal(unconf_balances[to_node], to_send * 10 * (2 + n))\n\n            # node5 collects fee and block subsidy to keep accounting simple\n            self.nodes[5].generate(1)\n            sync_blocks(self.nodes)\n\n            new_balances = self.get_balances()\n            self.log.debug(\"Check new balances: {}\".format(new_balances))\n            # We don't know what fee was set, so we can only check bounds on the balance of the sending node\n            assert_greater_than(new_balances[from_node], to_send * 10)\n            assert_greater_than(to_send * 11, new_balances[from_node])\n            for n, to_node in enumerate(range(from_node + 1, from_node + 4)):\n                to_node %= 4\n                assert_equal(new_balances[to_node], old_balances[to_node] + to_send * 10 * (2 + n))\n\n        # Get one p2sh/segwit address from node2 and two bech32 addresses from node3:\n        to_address_p2sh = self.nodes[2].getnewaddress()\n        to_address_bech32_1 = self.nodes[3].getnewaddress()\n        to_address_bech32_2 = self.nodes[3].getnewaddress()\n\n        # Fund node 4:\n        self.nodes[5].sendtoaddress(self.nodes[4].getnewaddress(), Decimal(\"1\"))\n        self.nodes[5].generate(1)\n        sync_blocks(self.nodes)\n        assert_equal(self.nodes[4].getbalance(), 1)\n\n        self.log.info(\"Nodes with addresstype=legacy never use a P2WPKH change output\")\n        self.test_change_output_type(0, [to_address_bech32_1], 'legacy')\n\n        self.log.info(\"Nodes with addresstype=p2sh-segwit only use a P2WPKH change output if any destination address is bech32:\")\n        self.test_change_output_type(1, [to_address_p2sh], 'p2sh-segwit')\n        self.test_change_output_type(1, [to_address_bech32_1], 'bech32')\n        self.test_change_output_type(1, [to_address_p2sh, to_address_bech32_1], 'bech32')\n        self.test_change_output_type(1, [to_address_bech32_1, to_address_bech32_2], 'bech32')\n\n        self.log.info(\"Nodes with change_type=bech32 always use a P2WPKH change output:\")\n        self.test_change_output_type(2, [to_address_bech32_1], 'bech32')\n        self.test_change_output_type(2, [to_address_p2sh], 'bech32')\n\n        self.log.info(\"Nodes with addresstype=bech32 always use a P2WPKH change output (unless changetype is set otherwise):\")\n        self.test_change_output_type(3, [to_address_bech32_1], 'bech32')\n        self.test_change_output_type(3, [to_address_p2sh], 'bech32')\n\n        self.log.info('getrawchangeaddress defaults to addresstype if -changetype is not set and argument is absent')\n        self.test_address(3, self.nodes[3].getrawchangeaddress(), multisig=False, typ='bech32')\n\n        self.log.info('getrawchangeaddress fails with invalid changetype argument')\n        assert_raises_rpc_error(-5, \"Unknown address type 'bech23'\", self.nodes[3].getrawchangeaddress, 'bech23')\n\n        self.log.info(\"Nodes with changetype=p2sh-segwit never use a P2WPKH change output\")\n        self.test_change_output_type(4, [to_address_bech32_1], 'p2sh-segwit')\n        self.test_address(4, self.nodes[4].getrawchangeaddress(), multisig=False, typ='p2sh-segwit')\n        self.log.info(\"Except for getrawchangeaddress if specified:\")\n        self.test_address(4, self.nodes[4].getrawchangeaddress(), multisig=False, typ='p2sh-segwit')\n        self.test_address(4, self.nodes[4].getrawchangeaddress('bech32'), multisig=False, typ='bech32')\n\nif __name__ == '__main__':\n    AddressTypeTest().main()\n"
  },
  {
    "path": "test/functional/wallet_backup.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the wallet backup features.\n\nTest case is:\n4 nodes. 1 2 and 3 send transactions between each other,\nfourth node is a miner.\n1 2 3 each mine a block to start, then\nMiner creates 100 blocks so 1 2 3 each have 50 mature\ncoins to spend.\nThen 5 iterations of 1/2/3 sending coins amongst\nthemselves to get transactions in the wallets,\nand the miner mining one block.\n\nWallets are backed up using dumpwallet/backupwallet.\nThen 5 more iterations of transactions and mining a block.\n\nMiner then generates 101 more blocks, so any\ntransaction fees paid mature.\n\nSanity check:\n  Sum(1,2,3,4 balances) == 114*50\n\n1/2/3 are shutdown, and their wallets erased.\nThen restore using wallet.dat backup. And\nconfirm 1/2/3/4 balances are same as before.\n\nShutdown again, restore using importwallet,\nand confirm again balances are correct.\n\"\"\"\nfrom random import randint\nimport shutil\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass WalletBackupTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 4\n        self.setup_clean_chain = True\n        # nodes 1, 2,3 are spenders, let's give them a keypool=100\n        self.extra_args = [[\"-keypool=100\"], [\"-keypool=100\"], [\"-keypool=100\"], []]\n\n    def setup_network(self, split=False):\n        self.setup_nodes()\n        connect_nodes(self.nodes[0], 3)\n        connect_nodes(self.nodes[1], 3)\n        connect_nodes(self.nodes[2], 3)\n        connect_nodes(self.nodes[2], 0)\n        self.sync_all()\n\n    def one_send(self, from_node, to_address):\n        if (randint(1,2) == 1):\n            amount = Decimal(randint(1,10)) / Decimal(10)\n            self.nodes[from_node].sendtoaddress(to_address, amount)\n\n    def do_one_round(self):\n        a0 = self.nodes[0].getnewaddress()\n        a1 = self.nodes[1].getnewaddress()\n        a2 = self.nodes[2].getnewaddress()\n\n        self.one_send(0, a1)\n        self.one_send(0, a2)\n        self.one_send(1, a0)\n        self.one_send(1, a2)\n        self.one_send(2, a0)\n        self.one_send(2, a1)\n\n        # Have the miner (node3) mine a block.\n        # Must sync mempools before mining.\n        sync_mempools(self.nodes)\n        self.nodes[3].generate(1)\n        sync_blocks(self.nodes)\n\n    # As above, this mirrors the original bash test.\n    def start_three(self):\n        self.start_node(0)\n        self.start_node(1)\n        self.start_node(2)\n        connect_nodes(self.nodes[0], 3)\n        connect_nodes(self.nodes[1], 3)\n        connect_nodes(self.nodes[2], 3)\n        connect_nodes(self.nodes[2], 0)\n\n    def stop_three(self):\n        self.stop_node(0)\n        self.stop_node(1)\n        self.stop_node(2)\n\n    def erase_three(self):\n        os.remove(self.options.tmpdir + \"/node0/regtest/wallets/wallet.dat\")\n        os.remove(self.options.tmpdir + \"/node1/regtest/wallets/wallet.dat\")\n        os.remove(self.options.tmpdir + \"/node2/regtest/wallets/wallet.dat\")\n\n    def run_test(self):\n        self.log.info(\"Generating initial blockchain\")\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n        self.nodes[1].generate(1)\n        sync_blocks(self.nodes)\n        self.nodes[2].generate(1)\n        sync_blocks(self.nodes)\n        self.nodes[3].generate(100)\n        sync_blocks(self.nodes)\n\n        assert_equal(self.nodes[0].getbalance(), 50)\n        assert_equal(self.nodes[1].getbalance(), 50)\n        assert_equal(self.nodes[2].getbalance(), 50)\n        assert_equal(self.nodes[3].getbalance(), 0)\n\n        self.log.info(\"Creating transactions\")\n        # Five rounds of sending each other transactions.\n        for i in range(5):\n            self.do_one_round()\n\n        self.log.info(\"Backing up\")\n        tmpdir = self.options.tmpdir\n        self.nodes[0].backupwallet(tmpdir + \"/node0/wallet.bak\")\n        self.nodes[0].dumpwallet(tmpdir + \"/node0/wallet.dump\")\n        self.nodes[1].backupwallet(tmpdir + \"/node1/wallet.bak\")\n        self.nodes[1].dumpwallet(tmpdir + \"/node1/wallet.dump\")\n        self.nodes[2].backupwallet(tmpdir + \"/node2/wallet.bak\")\n        self.nodes[2].dumpwallet(tmpdir + \"/node2/wallet.dump\")\n\n        self.log.info(\"More transactions\")\n        for i in range(5):\n            self.do_one_round()\n\n        # Generate 101 more blocks, so any fees paid mature\n        self.nodes[3].generate(101)\n        self.sync_all()\n\n        balance0 = self.nodes[0].getbalance()\n        balance1 = self.nodes[1].getbalance()\n        balance2 = self.nodes[2].getbalance()\n        balance3 = self.nodes[3].getbalance()\n        total = balance0 + balance1 + balance2 + balance3\n\n        # At this point, there are 214 blocks (103 for setup, then 10 rounds, then 101.)\n        # 114 are mature, so the sum of all wallets should be 114 * 50 = 5700.\n        assert_equal(total, 5700)\n\n        ##\n        # Test restoring spender wallets from backups\n        ##\n        self.log.info(\"Restoring using wallet.dat\")\n        self.stop_three()\n        self.erase_three()\n\n        # Start node2 with no chain\n        shutil.rmtree(self.options.tmpdir + \"/node2/regtest/blocks\")\n        shutil.rmtree(self.options.tmpdir + \"/node2/regtest/chainstate\")\n\n        # Restore wallets from backup\n        shutil.copyfile(tmpdir + \"/node0/wallet.bak\", tmpdir + \"/node0/regtest/wallets/wallet.dat\")\n        shutil.copyfile(tmpdir + \"/node1/wallet.bak\", tmpdir + \"/node1/regtest/wallets/wallet.dat\")\n        shutil.copyfile(tmpdir + \"/node2/wallet.bak\", tmpdir + \"/node2/regtest/wallets/wallet.dat\")\n\n        self.log.info(\"Re-starting nodes\")\n        self.start_three()\n        sync_blocks(self.nodes)\n\n        assert_equal(self.nodes[0].getbalance(), balance0)\n        assert_equal(self.nodes[1].getbalance(), balance1)\n        assert_equal(self.nodes[2].getbalance(), balance2)\n\n        self.log.info(\"Restoring using dumped wallet\")\n        self.stop_three()\n        self.erase_three()\n\n        #start node2 with no chain\n        shutil.rmtree(self.options.tmpdir + \"/node2/regtest/blocks\")\n        shutil.rmtree(self.options.tmpdir + \"/node2/regtest/chainstate\")\n\n        self.start_three()\n\n        assert_equal(self.nodes[0].getbalance(), 0)\n        assert_equal(self.nodes[1].getbalance(), 0)\n        assert_equal(self.nodes[2].getbalance(), 0)\n\n        self.nodes[0].importwallet(tmpdir + \"/node0/wallet.dump\")\n        self.nodes[1].importwallet(tmpdir + \"/node1/wallet.dump\")\n        self.nodes[2].importwallet(tmpdir + \"/node2/wallet.dump\")\n\n        sync_blocks(self.nodes)\n\n        assert_equal(self.nodes[0].getbalance(), balance0)\n        assert_equal(self.nodes[1].getbalance(), balance1)\n        assert_equal(self.nodes[2].getbalance(), balance2)\n\n        # Backup to source wallet file must fail\n        sourcePaths = [\n            tmpdir + \"/node0/regtest/wallets/wallet.dat\",\n            tmpdir + \"/node0/./regtest/wallets/wallet.dat\",\n            tmpdir + \"/node0/regtest/wallets/\",\n            tmpdir + \"/node0/regtest/wallets\"]\n\n        for sourcePath in sourcePaths:\n            assert_raises_rpc_error(-4, \"backup failed\", self.nodes[0].backupwallet, sourcePath)\n\n\nif __name__ == '__main__':\n    WalletBackupTest().main()\n"
  },
  {
    "path": "test/functional/wallet_basic.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the wallet.\"\"\"\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass WalletTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 4\n        self.setup_clean_chain = True\n\n    def setup_network(self):\n        self.add_nodes(4)\n        self.start_node(0)\n        self.start_node(1)\n        self.start_node(2)\n        connect_nodes_bi(self.nodes,0,1)\n        connect_nodes_bi(self.nodes,1,2)\n        connect_nodes_bi(self.nodes,0,2)\n        self.sync_all([self.nodes[0:3]])\n\n    def check_fee_amount(self, curr_balance, balance_with_fee, fee_per_byte, tx_size):\n        \"\"\"Return curr_balance after asserting the fee was in range\"\"\"\n        fee = balance_with_fee - curr_balance\n        assert_fee_amount(fee, tx_size, fee_per_byte * 1000)\n        return curr_balance\n\n    def get_vsize(self, txn):\n        return self.nodes[0].decoderawtransaction(txn)['vsize']\n\n    def run_test(self):\n        # Check that there's no UTXO on none of the nodes\n        assert_equal(len(self.nodes[0].listunspent()), 0)\n        assert_equal(len(self.nodes[1].listunspent()), 0)\n        assert_equal(len(self.nodes[2].listunspent()), 0)\n\n        self.log.info(\"Mining blocks...\")\n\n        self.nodes[0].generate(1)\n\n        walletinfo = self.nodes[0].getwalletinfo()\n        assert_equal(walletinfo['immature_balance'], 50)\n        assert_equal(walletinfo['balance'], 0)\n\n        self.sync_all([self.nodes[0:3]])\n        self.nodes[1].generate(101)\n        self.sync_all([self.nodes[0:3]])\n\n        assert_equal(self.nodes[0].getbalance(), 50)\n        assert_equal(self.nodes[1].getbalance(), 50)\n        assert_equal(self.nodes[2].getbalance(), 0)\n\n        # Check that only first and second nodes have UTXOs\n        utxos = self.nodes[0].listunspent()\n        assert_equal(len(utxos), 1)\n        assert_equal(len(self.nodes[1].listunspent()), 1)\n        assert_equal(len(self.nodes[2].listunspent()), 0)\n\n        self.log.info(\"test gettxout\")\n        confirmed_txid, confirmed_index = utxos[0][\"txid\"], utxos[0][\"vout\"]\n        # First, outputs that are unspent both in the chain and in the\n        # mempool should appear with or without include_mempool\n        txout = self.nodes[0].gettxout(txid=confirmed_txid, n=confirmed_index, include_mempool=False)\n        assert_equal(txout['value'], 50)\n        txout = self.nodes[0].gettxout(txid=confirmed_txid, n=confirmed_index, include_mempool=True)\n        assert_equal(txout['value'], 50)\n        \n        # Send 21 BTC from 0 to 2 using sendtoaddress call.\n        # Locked memory should use at least 32 bytes to sign each transaction\n        self.log.info(\"test getmemoryinfo\")\n        memory_before = self.nodes[0].getmemoryinfo()\n        self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 11)\n        mempool_txid = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 10)\n        memory_after = self.nodes[0].getmemoryinfo()\n        assert(memory_before['locked']['used'] + 64 <= memory_after['locked']['used'])\n\n        self.log.info(\"test gettxout (second part)\")\n        # utxo spent in mempool should be visible if you exclude mempool\n        # but invisible if you include mempool\n        txout = self.nodes[0].gettxout(confirmed_txid, confirmed_index, False)\n        assert_equal(txout['value'], 50)\n        txout = self.nodes[0].gettxout(confirmed_txid, confirmed_index, True)\n        assert txout is None\n        # new utxo from mempool should be invisible if you exclude mempool\n        # but visible if you include mempool\n        txout = self.nodes[0].gettxout(mempool_txid, 0, False)\n        assert txout is None\n        txout1 = self.nodes[0].gettxout(mempool_txid, 0, True)\n        txout2 = self.nodes[0].gettxout(mempool_txid, 1, True)\n        # note the mempool tx will have randomly assigned indices\n        # but 10 will go to node2 and the rest will go to node0\n        balance = self.nodes[0].getbalance()\n        assert_equal(set([txout1['value'], txout2['value']]), set([10, balance]))\n        walletinfo = self.nodes[0].getwalletinfo()\n        assert_equal(walletinfo['immature_balance'], 0)\n\n        # Have node0 mine a block, thus it will collect its own fee.\n        self.nodes[0].generate(1)\n        self.sync_all([self.nodes[0:3]])\n\n        # Exercise locking of unspent outputs\n        unspent_0 = self.nodes[2].listunspent()[0]\n        unspent_0 = {\"txid\": unspent_0[\"txid\"], \"vout\": unspent_0[\"vout\"]}\n        assert_raises_rpc_error(-8, \"Invalid parameter, expected locked output\", self.nodes[2].lockunspent, True, [unspent_0])\n        self.nodes[2].lockunspent(False, [unspent_0])\n        assert_raises_rpc_error(-8, \"Invalid parameter, output already locked\", self.nodes[2].lockunspent, False, [unspent_0])\n        assert_raises_rpc_error(-4, \"Insufficient funds\", self.nodes[2].sendtoaddress, self.nodes[2].getnewaddress(), 20)\n        assert_equal([unspent_0], self.nodes[2].listlockunspent())\n        self.nodes[2].lockunspent(True, [unspent_0])\n        assert_equal(len(self.nodes[2].listlockunspent()), 0)\n        assert_raises_rpc_error(-8, \"Invalid parameter, unknown transaction\",\n                              self.nodes[2].lockunspent, False,\n                              [{\"txid\": \"0000000000000000000000000000000000\", \"vout\": 0}])\n        assert_raises_rpc_error(-8, \"Invalid parameter, vout index out of bounds\",\n                              self.nodes[2].lockunspent, False,\n                              [{\"txid\": unspent_0[\"txid\"], \"vout\": 999}])\n\n        # Have node1 generate 100 blocks (so node0 can recover the fee)\n        self.nodes[1].generate(100)\n        self.sync_all([self.nodes[0:3]])\n\n        # node0 should end up with 100 btc in block rewards plus fees, but\n        # minus the 21 plus fees sent to node2\n        assert_equal(self.nodes[0].getbalance(), 100-21)\n        assert_equal(self.nodes[2].getbalance(), 21)\n\n        # Node0 should have two unspent outputs.\n        # Create a couple of transactions to send them to node2, submit them through\n        # node1, and make sure both node0 and node2 pick them up properly:\n        node0utxos = self.nodes[0].listunspent(1)\n        assert_equal(len(node0utxos), 2)\n\n        # create both transactions\n        txns_to_send = []\n        for utxo in node0utxos:\n            inputs = []\n            outputs = {}\n            inputs.append({ \"txid\" : utxo[\"txid\"], \"vout\" : utxo[\"vout\"]})\n            outputs[self.nodes[2].getnewaddress(\"from1\")] = utxo[\"amount\"] - 3\n            raw_tx = self.nodes[0].createrawtransaction(inputs, outputs)\n            txns_to_send.append(self.nodes[0].signrawtransaction(raw_tx))\n\n        # Have node 1 (miner) send the transactions\n        self.nodes[1].sendrawtransaction(txns_to_send[0][\"hex\"], True)\n        self.nodes[1].sendrawtransaction(txns_to_send[1][\"hex\"], True)\n\n        # Have node1 mine a block to confirm transactions:\n        self.nodes[1].generate(1)\n        self.sync_all([self.nodes[0:3]])\n\n        assert_equal(self.nodes[0].getbalance(), 0)\n        assert_equal(self.nodes[2].getbalance(), 94)\n        assert_equal(self.nodes[2].getbalance(\"from1\"), 94-21)\n\n        # Verify that a spent output cannot be locked anymore\n        spent_0 = {\"txid\": node0utxos[0][\"txid\"], \"vout\": node0utxos[0][\"vout\"]}\n        assert_raises_rpc_error(-8, \"Invalid parameter, expected unspent output\", self.nodes[0].lockunspent, False, [spent_0])\n\n        # Send 10 BTC normal\n        address = self.nodes[0].getnewaddress(\"test\")\n        fee_per_byte = Decimal('0.001') / 1000\n        self.nodes[2].settxfee(fee_per_byte * 1000)\n        txid = self.nodes[2].sendtoaddress(address, 10, \"\", \"\", False)\n        self.nodes[2].generate(1)\n        self.sync_all([self.nodes[0:3]])\n        node_2_bal = self.check_fee_amount(self.nodes[2].getbalance(), Decimal('84'), fee_per_byte, self.get_vsize(self.nodes[2].getrawtransaction(txid)))\n        assert_equal(self.nodes[0].getbalance(), Decimal('10'))\n\n        # Send 10 BTC with subtract fee from amount\n        txid = self.nodes[2].sendtoaddress(address, 10, \"\", \"\", True)\n        self.nodes[2].generate(1)\n        self.sync_all([self.nodes[0:3]])\n        node_2_bal -= Decimal('10')\n        assert_equal(self.nodes[2].getbalance(), node_2_bal)\n        node_0_bal = self.check_fee_amount(self.nodes[0].getbalance(), Decimal('20'), fee_per_byte, self.get_vsize(self.nodes[2].getrawtransaction(txid)))\n\n        # Sendmany 10 BTC\n        txid = self.nodes[2].sendmany('from1', {address: 10}, 0, \"\", [])\n        self.nodes[2].generate(1)\n        self.sync_all([self.nodes[0:3]])\n        node_0_bal += Decimal('10')\n        node_2_bal = self.check_fee_amount(self.nodes[2].getbalance(), node_2_bal - Decimal('10'), fee_per_byte, self.get_vsize(self.nodes[2].getrawtransaction(txid)))\n        assert_equal(self.nodes[0].getbalance(), node_0_bal)\n\n        # Sendmany 10 BTC with subtract fee from amount\n        txid = self.nodes[2].sendmany('from1', {address: 10}, 0, \"\", [address])\n        self.nodes[2].generate(1)\n        self.sync_all([self.nodes[0:3]])\n        node_2_bal -= Decimal('10')\n        assert_equal(self.nodes[2].getbalance(), node_2_bal)\n        node_0_bal = self.check_fee_amount(self.nodes[0].getbalance(), node_0_bal + Decimal('10'), fee_per_byte, self.get_vsize(self.nodes[2].getrawtransaction(txid)))\n\n        # Test ResendWalletTransactions:\n        # Create a couple of transactions, then start up a fourth\n        # node (nodes[3]) and ask nodes[0] to rebroadcast.\n        # EXPECT: nodes[3] should have those transactions in its mempool.\n        txid1 = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 1)\n        txid2 = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)\n        sync_mempools(self.nodes[0:2])\n\n        self.start_node(3)\n        connect_nodes_bi(self.nodes, 0, 3)\n        sync_blocks(self.nodes)\n\n        relayed = self.nodes[0].resendwallettransactions()\n        assert_equal(set(relayed), {txid1, txid2})\n        sync_mempools(self.nodes)\n\n        assert(txid1 in self.nodes[3].getrawmempool())\n\n        # Exercise balance rpcs\n        assert_equal(self.nodes[0].getwalletinfo()[\"unconfirmed_balance\"], 1)\n        assert_equal(self.nodes[0].getunconfirmedbalance(), 1)\n\n        #check if we can list zero value tx as available coins\n        #1. create rawtx\n        #2. hex-changed one output to 0.0\n        #3. sign and send\n        #4. check if recipient (node0) can list the zero value tx\n        usp = self.nodes[1].listunspent()\n        inputs = [{\"txid\":usp[0]['txid'], \"vout\":usp[0]['vout']}]\n        outputs = {self.nodes[1].getnewaddress(): 49.998, self.nodes[0].getnewaddress(): 11.11}\n\n        rawTx = self.nodes[1].createrawtransaction(inputs, outputs).replace(\"c0833842\", \"00000000\") #replace 11.11 with 0.0 (int32)\n        decRawTx = self.nodes[1].decoderawtransaction(rawTx)\n        signedRawTx = self.nodes[1].signrawtransaction(rawTx)\n        decRawTx = self.nodes[1].decoderawtransaction(signedRawTx['hex'])\n        zeroValueTxid= decRawTx['txid']\n        self.nodes[1].sendrawtransaction(signedRawTx['hex'])\n\n        self.sync_all()\n        self.nodes[1].generate(1) #mine a block\n        self.sync_all()\n\n        unspentTxs = self.nodes[0].listunspent() #zero value tx must be in listunspents output\n        found = False\n        for uTx in unspentTxs:\n            if uTx['txid'] == zeroValueTxid:\n                found = True\n                assert_equal(uTx['amount'], Decimal('0'))\n        assert(found)\n\n        #do some -walletbroadcast tests\n        self.stop_nodes()\n        self.start_node(0, [\"-walletbroadcast=0\"])\n        self.start_node(1, [\"-walletbroadcast=0\"])\n        self.start_node(2, [\"-walletbroadcast=0\"])\n        connect_nodes_bi(self.nodes,0,1)\n        connect_nodes_bi(self.nodes,1,2)\n        connect_nodes_bi(self.nodes,0,2)\n        self.sync_all([self.nodes[0:3]])\n\n        txIdNotBroadcasted  = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 2)\n        txObjNotBroadcasted = self.nodes[0].gettransaction(txIdNotBroadcasted)\n        self.nodes[1].generate(1) #mine a block, tx should not be in there\n        self.sync_all([self.nodes[0:3]])\n        assert_equal(self.nodes[2].getbalance(), node_2_bal) #should not be changed because tx was not broadcasted\n\n        #now broadcast from another node, mine a block, sync, and check the balance\n        self.nodes[1].sendrawtransaction(txObjNotBroadcasted['hex'])\n        self.nodes[1].generate(1)\n        self.sync_all([self.nodes[0:3]])\n        node_2_bal += 2\n        txObjNotBroadcasted = self.nodes[0].gettransaction(txIdNotBroadcasted)\n        assert_equal(self.nodes[2].getbalance(), node_2_bal)\n\n        #create another tx\n        txIdNotBroadcasted  = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), 2)\n\n        #restart the nodes with -walletbroadcast=1\n        self.stop_nodes()\n        self.start_node(0)\n        self.start_node(1)\n        self.start_node(2)\n        connect_nodes_bi(self.nodes,0,1)\n        connect_nodes_bi(self.nodes,1,2)\n        connect_nodes_bi(self.nodes,0,2)\n        sync_blocks(self.nodes[0:3])\n\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes[0:3])\n        node_2_bal += 2\n\n        #tx should be added to balance because after restarting the nodes tx should be broadcastet\n        assert_equal(self.nodes[2].getbalance(), node_2_bal)\n\n        #send a tx with value in a string (PR#6380 +)\n        txId  = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), \"2\")\n        txObj = self.nodes[0].gettransaction(txId)\n        assert_equal(txObj['amount'], Decimal('-2'))\n\n        txId  = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), \"0.0001\")\n        txObj = self.nodes[0].gettransaction(txId)\n        assert_equal(txObj['amount'], Decimal('-0.0001'))\n\n        #check if JSON parser can handle scientific notation in strings\n        txId  = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), \"1e-4\")\n        txObj = self.nodes[0].gettransaction(txId)\n        assert_equal(txObj['amount'], Decimal('-0.0001'))\n\n        # This will raise an exception because the amount type is wrong\n        assert_raises_rpc_error(-3, \"Invalid amount\", self.nodes[0].sendtoaddress, self.nodes[2].getnewaddress(), \"1f-4\")\n\n        # This will raise an exception since generate does not accept a string\n        assert_raises_rpc_error(-1, \"not an integer\", self.nodes[0].generate, \"2\")\n\n        # Import address and private key to check correct behavior of spendable unspents\n        # 1. Send some coins to generate new UTXO\n        address_to_import = self.nodes[2].getnewaddress()\n        txid = self.nodes[0].sendtoaddress(address_to_import, 1)\n        self.nodes[0].generate(1)\n        self.sync_all([self.nodes[0:3]])\n\n        # 2. Import address from node2 to node1\n        self.nodes[1].importaddress(address_to_import)\n\n        # 3. Validate that the imported address is watch-only on node1\n        assert(self.nodes[1].validateaddress(address_to_import)[\"iswatchonly\"])\n\n        # 4. Check that the unspents after import are not spendable\n        assert_array_result(self.nodes[1].listunspent(),\n                           {\"address\": address_to_import},\n                           {\"spendable\": False})\n\n        # 5. Import private key of the previously imported address on node1\n        priv_key = self.nodes[2].dumpprivkey(address_to_import)\n        self.nodes[1].importprivkey(priv_key)\n\n        # 6. Check that the unspents are now spendable on node1\n        assert_array_result(self.nodes[1].listunspent(),\n                           {\"address\": address_to_import},\n                           {\"spendable\": True})\n\n        # Mine a block from node0 to an address from node1\n        cbAddr = self.nodes[1].getnewaddress()\n        blkHash = self.nodes[0].generatetoaddress(1, cbAddr)[0]\n        cbTxId = self.nodes[0].getblock(blkHash)['tx'][0]\n        self.sync_all([self.nodes[0:3]])\n\n        # Check that the txid and balance is found by node1\n        self.nodes[1].gettransaction(cbTxId)\n\n        # check if wallet or blockchain maintenance changes the balance\n        self.sync_all([self.nodes[0:3]])\n        blocks = self.nodes[0].generate(2)\n        self.sync_all([self.nodes[0:3]])\n        balance_nodes = [self.nodes[i].getbalance() for i in range(3)]\n        block_count = self.nodes[0].getblockcount()\n\n        # Check modes:\n        #   - True: unicode escaped as \\u....\n        #   - False: unicode directly as UTF-8\n        for mode in [True, False]:\n            self.nodes[0].ensure_ascii = mode\n            # unicode check: Basic Multilingual Plane, Supplementary Plane respectively\n            for s in [u'рыба', u'𝅘𝅥𝅯']:\n                addr = self.nodes[0].getaccountaddress(s)\n                label = self.nodes[0].getaccount(addr)\n                assert_equal(label, s)\n                assert(s in self.nodes[0].listaccounts().keys())\n        self.nodes[0].ensure_ascii = True # restore to default\n\n        # maintenance tests\n        maintenance = [\n            '-rescan',\n            '-reindex',\n            '-zapwallettxes=1',\n            '-zapwallettxes=2',\n            # disabled until issue is fixed: https://github.com/bitcoin/bitcoin/issues/7463\n            # '-salvagewallet',\n        ]\n        chainlimit = 6\n        for m in maintenance:\n            self.log.info(\"check \" + m)\n            self.stop_nodes()\n            # set lower ancestor limit for later\n            self.start_node(0, [m, \"-limitancestorcount=\"+str(chainlimit)])\n            self.start_node(1, [m, \"-limitancestorcount=\"+str(chainlimit)])\n            self.start_node(2, [m, \"-limitancestorcount=\"+str(chainlimit)])\n            if m == '-reindex':\n                # reindex will leave rpc warm up \"early\"; Wait for it to finish\n                wait_until(lambda: [block_count] * 3 == [self.nodes[i].getblockcount() for i in range(3)])\n            assert_equal(balance_nodes, [self.nodes[i].getbalance() for i in range(3)])\n\n        # Exercise listsinceblock with the last two blocks\n        coinbase_tx_1 = self.nodes[0].listsinceblock(blocks[0])\n        assert_equal(coinbase_tx_1[\"lastblock\"], blocks[1])\n        assert_equal(len(coinbase_tx_1[\"transactions\"]), 1)\n        assert_equal(coinbase_tx_1[\"transactions\"][0][\"blockhash\"], blocks[1])\n        assert_equal(len(self.nodes[0].listsinceblock(blocks[1])[\"transactions\"]), 0)\n\n        # ==Check that wallet prefers to use coins that don't exceed mempool limits =====\n\n        # Get all non-zero utxos together\n        chain_addrs = [self.nodes[0].getnewaddress(), self.nodes[0].getnewaddress()]\n        singletxid = self.nodes[0].sendtoaddress(chain_addrs[0], self.nodes[0].getbalance(), \"\", \"\", True)\n        self.nodes[0].generate(1)\n        node0_balance = self.nodes[0].getbalance()\n        # Split into two chains\n        rawtx = self.nodes[0].createrawtransaction([{\"txid\":singletxid, \"vout\":0}], {chain_addrs[0]:node0_balance/2-Decimal('0.01'), chain_addrs[1]:node0_balance/2-Decimal('0.01')})\n        signedtx = self.nodes[0].signrawtransaction(rawtx)\n        singletxid = self.nodes[0].sendrawtransaction(signedtx[\"hex\"])\n        self.nodes[0].generate(1)\n\n        # Make a long chain of unconfirmed payments without hitting mempool limit\n        # Each tx we make leaves only one output of change on a chain 1 longer\n        # Since the amount to send is always much less than the outputs, we only ever need one output\n        # So we should be able to generate exactly chainlimit txs for each original output\n        sending_addr = self.nodes[1].getnewaddress()\n        txid_list = []\n        for i in range(chainlimit*2):\n            txid_list.append(self.nodes[0].sendtoaddress(sending_addr, Decimal('0.0001')))\n        assert_equal(self.nodes[0].getmempoolinfo()['size'], chainlimit*2)\n        assert_equal(len(txid_list), chainlimit*2)\n\n        # Without walletrejectlongchains, we will still generate a txid\n        # The tx will be stored in the wallet but not accepted to the mempool\n        extra_txid = self.nodes[0].sendtoaddress(sending_addr, Decimal('0.0001'))\n        assert(extra_txid not in self.nodes[0].getrawmempool())\n        assert(extra_txid in [tx[\"txid\"] for tx in self.nodes[0].listtransactions()])\n        self.nodes[0].abandontransaction(extra_txid)\n        total_txs = len(self.nodes[0].listtransactions(\"*\",99999))\n\n        # Try with walletrejectlongchains\n        # Double chain limit but require combining inputs, so we pass SelectCoinsMinConf\n        self.stop_node(0)\n        self.start_node(0, extra_args=[\"-walletrejectlongchains\", \"-limitancestorcount=\"+str(2*chainlimit)])\n\n        # wait for loadmempool\n        timeout = 10\n        while (timeout > 0 and len(self.nodes[0].getrawmempool()) < chainlimit*2):\n            time.sleep(0.5)\n            timeout -= 0.5\n        assert_equal(len(self.nodes[0].getrawmempool()), chainlimit*2)\n\n        node0_balance = self.nodes[0].getbalance()\n        # With walletrejectlongchains we will not create the tx and store it in our wallet.\n        assert_raises_rpc_error(-4, \"Transaction has too long of a mempool chain\", self.nodes[0].sendtoaddress, sending_addr, node0_balance - Decimal('0.01'))\n\n        # Verify nothing new in wallet\n        assert_equal(total_txs, len(self.nodes[0].listtransactions(\"*\",99999)))\n\nif __name__ == '__main__':\n    WalletTest().main()\n"
  },
  {
    "path": "test/functional/wallet_bumpfee.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the bumpfee RPC.\n\nVerifies that the bumpfee RPC creates replacement transactions successfully when\nits preconditions are met, and returns appropriate errors in other cases.\n\nThis module consists of around a dozen individual test cases implemented in the\ntop-level functions named as test_<test_case_description>. The test functions\ncan be disabled or reordered if needed for debugging. If new test cases are\nadded in the future, they should try to follow the same convention and not\nmake assumptions about execution order.\n\"\"\"\n\nfrom test_framework.blocktools import send_to_witness\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework import blocktools\nfrom test_framework.mininode import CTransaction\nfrom test_framework.util import *\n\nimport io\n\n# Sequence number that is BIP 125 opt-in and BIP 68-compliant\nBIP125_SEQUENCE_NUMBER = 0xfffffffd\n\nWALLET_PASSPHRASE = \"test\"\nWALLET_PASSPHRASE_TIMEOUT = 3600\n\n\nclass BumpFeeTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.setup_clean_chain = True\n        self.extra_args = [[\"-prematurewitness\", \"-walletprematurewitness\", \"-deprecatedrpc=addwitnessaddress\", \"-walletrbf={}\".format(i)]\n                           for i in range(self.num_nodes)]\n\n    def run_test(self):\n        # Encrypt wallet for test_locked_wallet_fails test\n        self.nodes[1].node_encrypt_wallet(WALLET_PASSPHRASE)\n        self.start_node(1)\n        self.nodes[1].walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)\n\n        connect_nodes_bi(self.nodes, 0, 1)\n        self.sync_all()\n\n        peer_node, rbf_node = self.nodes\n        rbf_node_address = rbf_node.getnewaddress()\n\n        # fund rbf node with 10 coins of 0.001 btc (100,000 satoshis)\n        self.log.info(\"Mining blocks...\")\n        peer_node.generate(110)\n        self.sync_all()\n        for i in range(25):\n            peer_node.sendtoaddress(rbf_node_address, 0.001)\n        self.sync_all()\n        peer_node.generate(1)\n        self.sync_all()\n        assert_equal(rbf_node.getbalance(), Decimal(\"0.025\"))\n\n        self.log.info(\"Running tests\")\n        dest_address = peer_node.getnewaddress()\n        test_simple_bumpfee_succeeds(rbf_node, peer_node, dest_address)\n        test_segwit_bumpfee_succeeds(rbf_node, dest_address)\n        test_nonrbf_bumpfee_fails(peer_node, dest_address)\n        test_notmine_bumpfee_fails(rbf_node, peer_node, dest_address)\n        test_bumpfee_with_descendant_fails(rbf_node, rbf_node_address, dest_address)\n        test_small_output_fails(rbf_node, dest_address)\n        test_dust_to_fee(rbf_node, dest_address)\n        test_settxfee(rbf_node, dest_address)\n        test_rebumping(rbf_node, dest_address)\n        test_rebumping_not_replaceable(rbf_node, dest_address)\n        test_unconfirmed_not_spendable(rbf_node, rbf_node_address)\n        test_bumpfee_metadata(rbf_node, dest_address)\n        test_locked_wallet_fails(rbf_node, dest_address)\n        self.log.info(\"Success\")\n\n\ndef test_simple_bumpfee_succeeds(rbf_node, peer_node, dest_address):\n    rbfid = spend_one_input(rbf_node, dest_address)\n    rbftx = rbf_node.gettransaction(rbfid)\n    sync_mempools((rbf_node, peer_node))\n    assert rbfid in rbf_node.getrawmempool() and rbfid in peer_node.getrawmempool()\n    bumped_tx = rbf_node.bumpfee(rbfid)\n    assert_equal(bumped_tx[\"errors\"], [])\n    assert bumped_tx[\"fee\"] - abs(rbftx[\"fee\"]) > 0\n    # check that bumped_tx propagates, original tx was evicted and has a wallet conflict\n    sync_mempools((rbf_node, peer_node))\n    assert bumped_tx[\"txid\"] in rbf_node.getrawmempool()\n    assert bumped_tx[\"txid\"] in peer_node.getrawmempool()\n    assert rbfid not in rbf_node.getrawmempool()\n    assert rbfid not in peer_node.getrawmempool()\n    oldwtx = rbf_node.gettransaction(rbfid)\n    assert len(oldwtx[\"walletconflicts\"]) > 0\n    # check wallet transaction replaces and replaced_by values\n    bumpedwtx = rbf_node.gettransaction(bumped_tx[\"txid\"])\n    assert_equal(oldwtx[\"replaced_by_txid\"], bumped_tx[\"txid\"])\n    assert_equal(bumpedwtx[\"replaces_txid\"], rbfid)\n\n\ndef test_segwit_bumpfee_succeeds(rbf_node, dest_address):\n    # Create a transaction with segwit output, then create an RBF transaction\n    # which spends it, and make sure bumpfee can be called on it.\n\n    segwit_in = next(u for u in rbf_node.listunspent() if u[\"amount\"] == Decimal(\"0.001\"))\n    segwit_out = rbf_node.validateaddress(rbf_node.getnewaddress())\n    rbf_node.addwitnessaddress(segwit_out[\"address\"])\n    segwitid = send_to_witness(\n        use_p2wsh=False,\n        node=rbf_node,\n        utxo=segwit_in,\n        pubkey=segwit_out[\"pubkey\"],\n        encode_p2sh=False,\n        amount=Decimal(\"0.0009\"),\n        sign=True)\n\n    rbfraw = rbf_node.createrawtransaction([{\n        'txid': segwitid,\n        'vout': 0,\n        \"sequence\": BIP125_SEQUENCE_NUMBER\n    }], {dest_address: Decimal(\"0.0005\"),\n         rbf_node.getrawchangeaddress(): Decimal(\"0.0003\")})\n    rbfsigned = rbf_node.signrawtransaction(rbfraw)\n    rbfid = rbf_node.sendrawtransaction(rbfsigned[\"hex\"])\n    assert rbfid in rbf_node.getrawmempool()\n\n    bumped_tx = rbf_node.bumpfee(rbfid)\n    assert bumped_tx[\"txid\"] in rbf_node.getrawmempool()\n    assert rbfid not in rbf_node.getrawmempool()\n\n\ndef test_nonrbf_bumpfee_fails(peer_node, dest_address):\n    # cannot replace a non RBF transaction (from node which did not enable RBF)\n    not_rbfid = peer_node.sendtoaddress(dest_address, Decimal(\"0.00090000\"))\n    assert_raises_rpc_error(-4, \"not BIP 125 replaceable\", peer_node.bumpfee, not_rbfid)\n\n\ndef test_notmine_bumpfee_fails(rbf_node, peer_node, dest_address):\n    # cannot bump fee unless the tx has only inputs that we own.\n    # here, the rbftx has a peer_node coin and then adds a rbf_node input\n    # Note that this test depends upon the RPC code checking input ownership prior to change outputs\n    # (since it can't use fundrawtransaction, it lacks a proper change output)\n    utxos = [node.listunspent()[-1] for node in (rbf_node, peer_node)]\n    inputs = [{\n        \"txid\": utxo[\"txid\"],\n        \"vout\": utxo[\"vout\"],\n        \"address\": utxo[\"address\"],\n        \"sequence\": BIP125_SEQUENCE_NUMBER\n    } for utxo in utxos]\n    output_val = sum(utxo[\"amount\"] for utxo in utxos) - Decimal(\"0.001\")\n    rawtx = rbf_node.createrawtransaction(inputs, {dest_address: output_val})\n    signedtx = rbf_node.signrawtransaction(rawtx)\n    signedtx = peer_node.signrawtransaction(signedtx[\"hex\"])\n    rbfid = rbf_node.sendrawtransaction(signedtx[\"hex\"])\n    assert_raises_rpc_error(-4, \"Transaction contains inputs that don't belong to this wallet\",\n                          rbf_node.bumpfee, rbfid)\n\n\ndef test_bumpfee_with_descendant_fails(rbf_node, rbf_node_address, dest_address):\n    # cannot bump fee if the transaction has a descendant\n    # parent is send-to-self, so we don't have to check which output is change when creating the child tx\n    parent_id = spend_one_input(rbf_node, rbf_node_address)\n    tx = rbf_node.createrawtransaction([{\"txid\": parent_id, \"vout\": 0}], {dest_address: 0.00020000})\n    tx = rbf_node.signrawtransaction(tx)\n    rbf_node.sendrawtransaction(tx[\"hex\"])\n    assert_raises_rpc_error(-8, \"Transaction has descendants in the wallet\", rbf_node.bumpfee, parent_id)\n\n\ndef test_small_output_fails(rbf_node, dest_address):\n    # cannot bump fee with a too-small output\n    rbfid = spend_one_input(rbf_node, dest_address)\n    rbf_node.bumpfee(rbfid, {\"totalFee\": 50000})\n\n    rbfid = spend_one_input(rbf_node, dest_address)\n    assert_raises_rpc_error(-4, \"Change output is too small\", rbf_node.bumpfee, rbfid, {\"totalFee\": 50001})\n\n\ndef test_dust_to_fee(rbf_node, dest_address):\n    # check that if output is reduced to dust, it will be converted to fee\n    # the bumped tx sets fee=49,900, but it converts to 50,000\n    rbfid = spend_one_input(rbf_node, dest_address)\n    fulltx = rbf_node.getrawtransaction(rbfid, 1)\n    bumped_tx = rbf_node.bumpfee(rbfid, {\"totalFee\": 49900})\n    full_bumped_tx = rbf_node.getrawtransaction(bumped_tx[\"txid\"], 1)\n    assert_equal(bumped_tx[\"fee\"], Decimal(\"0.00050000\"))\n    assert_equal(len(fulltx[\"vout\"]), 2)\n    assert_equal(len(full_bumped_tx[\"vout\"]), 1)  #change output is eliminated\n\n\ndef test_settxfee(rbf_node, dest_address):\n    # check that bumpfee reacts correctly to the use of settxfee (paytxfee)\n    rbfid = spend_one_input(rbf_node, dest_address)\n    requested_feerate = Decimal(\"0.00025000\")\n    rbf_node.settxfee(requested_feerate)\n    bumped_tx = rbf_node.bumpfee(rbfid)\n    actual_feerate = bumped_tx[\"fee\"] * 1000 / rbf_node.getrawtransaction(bumped_tx[\"txid\"], True)[\"vsize\"]\n    # Assert that the difference between the requested feerate and the actual\n    # feerate of the bumped transaction is small.\n    assert_greater_than(Decimal(\"0.00001000\"), abs(requested_feerate - actual_feerate))\n    rbf_node.settxfee(Decimal(\"0.00000000\"))  # unset paytxfee\n\n\ndef test_rebumping(rbf_node, dest_address):\n    # check that re-bumping the original tx fails, but bumping the bumper succeeds\n    rbfid = spend_one_input(rbf_node, dest_address)\n    bumped = rbf_node.bumpfee(rbfid, {\"totalFee\": 2000})\n    assert_raises_rpc_error(-4, \"already bumped\", rbf_node.bumpfee, rbfid, {\"totalFee\": 3000})\n    rbf_node.bumpfee(bumped[\"txid\"], {\"totalFee\": 3000})\n\n\ndef test_rebumping_not_replaceable(rbf_node, dest_address):\n    # check that re-bumping a non-replaceable bump tx fails\n    rbfid = spend_one_input(rbf_node, dest_address)\n    bumped = rbf_node.bumpfee(rbfid, {\"totalFee\": 10000, \"replaceable\": False})\n    assert_raises_rpc_error(-4, \"Transaction is not BIP 125 replaceable\", rbf_node.bumpfee, bumped[\"txid\"],\n                          {\"totalFee\": 20000})\n\n\ndef test_unconfirmed_not_spendable(rbf_node, rbf_node_address):\n    # check that unconfirmed outputs from bumped transactions are not spendable\n    rbfid = spend_one_input(rbf_node, rbf_node_address)\n    rbftx = rbf_node.gettransaction(rbfid)[\"hex\"]\n    assert rbfid in rbf_node.getrawmempool()\n    bumpid = rbf_node.bumpfee(rbfid)[\"txid\"]\n    assert bumpid in rbf_node.getrawmempool()\n    assert rbfid not in rbf_node.getrawmempool()\n\n    # check that outputs from the bump transaction are not spendable\n    # due to the replaces_txid check in CWallet::AvailableCoins\n    assert_equal([t for t in rbf_node.listunspent(minconf=0, include_unsafe=False) if t[\"txid\"] == bumpid], [])\n\n    # submit a block with the rbf tx to clear the bump tx out of the mempool,\n    # then call abandon to make sure the wallet doesn't attempt to resubmit the\n    # bump tx, then invalidate the block so the rbf tx will be put back in the\n    # mempool. this makes it possible to check whether the rbf tx outputs are\n    # spendable before the rbf tx is confirmed.\n    block = submit_block_with_tx(rbf_node, rbftx)\n    rbf_node.abandontransaction(bumpid)\n    rbf_node.invalidateblock(block.hash)\n    assert bumpid not in rbf_node.getrawmempool()\n    assert rbfid in rbf_node.getrawmempool()\n\n    # check that outputs from the rbf tx are not spendable before the\n    # transaction is confirmed, due to the replaced_by_txid check in\n    # CWallet::AvailableCoins\n    assert_equal([t for t in rbf_node.listunspent(minconf=0, include_unsafe=False) if t[\"txid\"] == rbfid], [])\n\n    # check that the main output from the rbf tx is spendable after confirmed\n    rbf_node.generate(1)\n    assert_equal(\n        sum(1 for t in rbf_node.listunspent(minconf=0, include_unsafe=False)\n            if t[\"txid\"] == rbfid and t[\"address\"] == rbf_node_address and t[\"spendable\"]), 1)\n\n\ndef test_bumpfee_metadata(rbf_node, dest_address):\n    rbfid = rbf_node.sendtoaddress(dest_address, Decimal(\"0.00100000\"), \"comment value\", \"to value\")\n    bumped_tx = rbf_node.bumpfee(rbfid)\n    bumped_wtx = rbf_node.gettransaction(bumped_tx[\"txid\"])\n    assert_equal(bumped_wtx[\"comment\"], \"comment value\")\n    assert_equal(bumped_wtx[\"to\"], \"to value\")\n\n\ndef test_locked_wallet_fails(rbf_node, dest_address):\n    rbfid = spend_one_input(rbf_node, dest_address)\n    rbf_node.walletlock()\n    assert_raises_rpc_error(-13, \"Please enter the wallet passphrase with walletpassphrase first.\",\n                          rbf_node.bumpfee, rbfid)\n\n\ndef spend_one_input(node, dest_address):\n    tx_input = dict(\n        sequence=BIP125_SEQUENCE_NUMBER, **next(u for u in node.listunspent() if u[\"amount\"] == Decimal(\"0.00100000\")))\n    rawtx = node.createrawtransaction(\n        [tx_input], {dest_address: Decimal(\"0.00050000\"),\n                     node.getrawchangeaddress(): Decimal(\"0.00049000\")})\n    signedtx = node.signrawtransaction(rawtx)\n    txid = node.sendrawtransaction(signedtx[\"hex\"])\n    return txid\n\n\ndef submit_block_with_tx(node, tx):\n    ctx = CTransaction()\n    ctx.deserialize(io.BytesIO(hex_str_to_bytes(tx)))\n\n    tip = node.getbestblockhash()\n    height = node.getblockcount() + 1\n    block_time = node.getblockheader(tip)[\"mediantime\"] + 1\n    block = blocktools.create_block(int(tip, 16), blocktools.create_coinbase(height), block_time)\n    block.vtx.append(ctx)\n    block.rehash()\n    block.hashMerkleRoot = block.calc_merkle_root()\n    blocktools.add_witness_commitment(block)\n    block.solve()\n    node.submitblock(bytes_to_hex_str(block.serialize(True)))\n    return block\n\n\nif __name__ == \"__main__\":\n    BumpFeeTest().main()\n"
  },
  {
    "path": "test/functional/wallet_disable.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2015-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test a node with the -disablewallet option.\n\n- Test that validateaddress RPC works when running with -disablewallet\n- Test that it is not possible to mine to an invalid address.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass DisableWalletTest (BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n        self.extra_args = [[\"-disablewallet\"]]\n\n    def run_test (self):\n        # Make sure wallet is really disabled\n        assert_raises_rpc_error(-32601, 'Method not found', self.nodes[0].getwalletinfo)\n        x = self.nodes[0].validateaddress('3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy')\n        assert(x['isvalid'] == False)\n        x = self.nodes[0].validateaddress('mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ')\n        assert(x['isvalid'] == True)\n\n        # Checking mining to an address without a wallet. Generating to a valid address should succeed\n        # but generating to an invalid address will fail.\n        self.nodes[0].generatetoaddress(1, 'mneYUmWYsuk7kySiURxCi3AGxrAqZxLgPZ')\n        assert_raises_rpc_error(-5, \"Invalid address\", self.nodes[0].generatetoaddress, 1, '3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy')\n\nif __name__ == '__main__':\n    DisableWalletTest ().main ()\n"
  },
  {
    "path": "test/functional/wallet_dump.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the dumpwallet RPC.\"\"\"\n\nimport os\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (assert_equal, assert_raises_rpc_error)\n\n\ndef read_dump(file_name, addrs, script_addrs, hd_master_addr_old):\n    \"\"\"\n    Read the given dump, count the addrs that match, count change and reserve.\n    Also check that the old hd_master is inactive\n    \"\"\"\n    with open(file_name, encoding='utf8') as inputfile:\n        found_addr = 0\n        found_script_addr = 0\n        found_addr_chg = 0\n        found_addr_rsv = 0\n        witness_addr_ret = None\n        hd_master_addr_ret = None\n        for line in inputfile:\n            # only read non comment lines\n            if line[0] != \"#\" and len(line) > 10:\n                # split out some data\n                key_label, comment = line.split(\"#\")\n                # key = key_label.split(\" \")[0]\n                keytype = key_label.split(\" \")[2]\n                if len(comment) > 1:\n                    addr_keypath = comment.split(\" addr=\")[1]\n                    addr = addr_keypath.split(\" \")[0]\n                    keypath = None\n                    if keytype == \"inactivehdmaster=1\":\n                        # ensure the old master is still available\n                        assert(hd_master_addr_old == addr)\n                    elif keytype == \"hdmaster=1\":\n                        # ensure we have generated a new hd master key\n                        assert(hd_master_addr_old != addr)\n                        hd_master_addr_ret = addr\n                    elif keytype == \"script=1\":\n                        # scripts don't have keypaths\n                        keypath = None\n                    else:\n                        keypath = addr_keypath.rstrip().split(\"hdkeypath=\")[1]\n\n                    # count key types\n                    for addrObj in addrs:\n                        if addrObj['address'] == addr.split(\",\")[0] and addrObj['hdkeypath'] == keypath and keytype == \"label=\":\n                            # a labled entry in the wallet should contain both a native address\n                            # and the p2sh-p2wpkh address that was added at wallet setup\n                            if len(addr.split(\",\")) == 2:\n                                addr_list = addr.split(\",\")\n                                # the entry should be of the first key in the wallet\n                                assert_equal(addrs[0]['address'], addr_list[0])\n                                witness_addr_ret = addr_list[1]\n                            found_addr += 1\n                            break\n                        elif keytype == \"change=1\":\n                            found_addr_chg += 1\n                            break\n                        elif keytype == \"reserve=1\":\n                            found_addr_rsv += 1\n                            break\n\n                    # count scripts\n                    for script_addr in script_addrs:\n                        if script_addr == addr.rstrip() and keytype == \"script=1\":\n                            found_script_addr += 1\n                            break\n\n        return found_addr, found_script_addr, found_addr_chg, found_addr_rsv, hd_master_addr_ret, witness_addr_ret\n\n\nclass WalletDumpTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.extra_args = [[\"-keypool=90\", \"-addresstype=legacy\", \"-deprecatedrpc=addwitnessaddress\"]]\n\n    def setup_network(self, split=False):\n        # Use 1 minute timeout because the initial getnewaddress RPC can take\n        # longer than the default 30 seconds due to an expensive\n        # CWallet::TopUpKeyPool call, and the encryptwallet RPC made later in\n        # the test often takes even longer.\n        self.add_nodes(self.num_nodes, self.extra_args, timewait=60)\n        self.start_nodes()\n\n    def run_test (self):\n        tmpdir = self.options.tmpdir\n\n        # generate 20 addresses to compare against the dump\n        # but since we add a p2sh-p2wpkh address for the first pubkey in the\n        # wallet, we will expect 21 addresses in the dump\n        test_addr_count = 20\n        addrs = []\n        for i in range(0,test_addr_count):\n            addr = self.nodes[0].getnewaddress()\n            vaddr= self.nodes[0].validateaddress(addr) #required to get hd keypath\n            addrs.append(vaddr)\n        # Should be a no-op:\n        self.nodes[0].keypoolrefill()\n\n        # Test scripts dump by adding a P2SH witness and a 1-of-1 multisig address\n        witness_addr = self.nodes[0].addwitnessaddress(addrs[0][\"address\"], True)\n        multisig_addr = self.nodes[0].addmultisigaddress(1, [addrs[1][\"address\"]])[\"address\"]\n        script_addrs = [witness_addr, multisig_addr]\n\n        # dump unencrypted wallet\n        result = self.nodes[0].dumpwallet(tmpdir + \"/node0/wallet.unencrypted.dump\")\n        assert_equal(result['filename'], os.path.abspath(tmpdir + \"/node0/wallet.unencrypted.dump\"))\n\n        found_addr, found_script_addr, found_addr_chg, found_addr_rsv, hd_master_addr_unenc, witness_addr_ret = \\\n            read_dump(tmpdir + \"/node0/wallet.unencrypted.dump\", addrs, script_addrs, None)\n        assert_equal(found_addr, test_addr_count)  # all keys must be in the dump\n        assert_equal(found_script_addr, 2)  # all scripts must be in the dump\n        assert_equal(found_addr_chg, 50)  # 50 blocks where mined\n        assert_equal(found_addr_rsv, 90*2) # 90 keys plus 100% internal keys\n        assert_equal(witness_addr_ret, witness_addr) # p2sh-p2wsh address added to the first key\n\n        #encrypt wallet, restart, unlock and dump\n        self.nodes[0].node_encrypt_wallet('test')\n        self.start_node(0)\n        self.nodes[0].walletpassphrase('test', 10)\n        # Should be a no-op:\n        self.nodes[0].keypoolrefill()\n        self.nodes[0].dumpwallet(tmpdir + \"/node0/wallet.encrypted.dump\")\n\n        found_addr, found_script_addr, found_addr_chg, found_addr_rsv, _, witness_addr_ret = \\\n            read_dump(tmpdir + \"/node0/wallet.encrypted.dump\", addrs, script_addrs, hd_master_addr_unenc)\n        assert_equal(found_addr, test_addr_count)\n        assert_equal(found_script_addr, 2)\n        assert_equal(found_addr_chg, 90*2 + 50)  # old reserve keys are marked as change now\n        assert_equal(found_addr_rsv, 90*2) \n        assert_equal(witness_addr_ret, witness_addr)\n\n        # Overwriting should fail\n        assert_raises_rpc_error(-8, \"already exists\", self.nodes[0].dumpwallet, tmpdir + \"/node0/wallet.unencrypted.dump\")\n\n        # Restart node with new wallet, and test importwallet\n        self.stop_node(0)\n        self.start_node(0, ['-wallet=w2'])\n\n        # Make sure the address is not IsMine before import\n        result = self.nodes[0].validateaddress(multisig_addr)\n        assert(result['ismine'] == False)\n\n        self.nodes[0].importwallet(os.path.abspath(tmpdir + \"/node0/wallet.unencrypted.dump\"))\n\n        # Now check IsMine is true\n        result = self.nodes[0].validateaddress(multisig_addr)\n        assert(result['ismine'] == True)\n\nif __name__ == '__main__':\n    WalletDumpTest().main ()\n"
  },
  {
    "path": "test/functional/wallet_encryption.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test Wallet encryption\"\"\"\n\nimport time\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    assert_raises_rpc_error,\n    assert_greater_than,\n    assert_greater_than_or_equal,\n)\n\nclass WalletEncryptionTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 1\n\n    def run_test(self):\n        passphrase = \"WalletPassphrase\"\n        passphrase2 = \"SecondWalletPassphrase\"\n\n        # Make sure the wallet isn't encrypted first\n        address = self.nodes[0].getnewaddress()\n        privkey = self.nodes[0].dumpprivkey(address)\n        assert_equal(privkey[:1], \"c\")\n        assert_equal(len(privkey), 52)\n\n        # Encrypt the wallet\n        self.nodes[0].node_encrypt_wallet(passphrase)\n        self.start_node(0)\n\n        # Test that the wallet is encrypted\n        assert_raises_rpc_error(-13, \"Please enter the wallet passphrase with walletpassphrase first\", self.nodes[0].dumpprivkey, address)\n\n        # Check that walletpassphrase works\n        self.nodes[0].walletpassphrase(passphrase, 2)\n        assert_equal(privkey, self.nodes[0].dumpprivkey(address))\n\n        # Check that the timeout is right\n        time.sleep(2)\n        assert_raises_rpc_error(-13, \"Please enter the wallet passphrase with walletpassphrase first\", self.nodes[0].dumpprivkey, address)\n\n        # Test wrong passphrase\n        assert_raises_rpc_error(-14, \"wallet passphrase entered was incorrect\", self.nodes[0].walletpassphrase, passphrase + \"wrong\", 10)\n\n        # Test walletlock\n        self.nodes[0].walletpassphrase(passphrase, 84600)\n        assert_equal(privkey, self.nodes[0].dumpprivkey(address))\n        self.nodes[0].walletlock()\n        assert_raises_rpc_error(-13, \"Please enter the wallet passphrase with walletpassphrase first\", self.nodes[0].dumpprivkey, address)\n\n        # Test passphrase changes\n        self.nodes[0].walletpassphrasechange(passphrase, passphrase2)\n        assert_raises_rpc_error(-14, \"wallet passphrase entered was incorrect\", self.nodes[0].walletpassphrase, passphrase, 10)\n        self.nodes[0].walletpassphrase(passphrase2, 10)\n        assert_equal(privkey, self.nodes[0].dumpprivkey(address))\n        self.nodes[0].walletlock()\n\n        # Test timeout bounds\n        assert_raises_rpc_error(-8, \"Timeout cannot be negative.\", self.nodes[0].walletpassphrase, passphrase2, -10)\n        # Check the timeout\n        # Check a time less than the limit\n        MAX_VALUE = 100000000\n        expected_time = int(time.time()) + MAX_VALUE - 600\n        self.nodes[0].walletpassphrase(passphrase2, MAX_VALUE - 600)\n        actual_time = self.nodes[0].getwalletinfo()['unlocked_until']\n        assert_greater_than_or_equal(actual_time, expected_time)\n        assert_greater_than(expected_time + 5, actual_time) # 5 second buffer\n        # Check a time greater than the limit\n        expected_time = int(time.time()) + MAX_VALUE - 1\n        self.nodes[0].walletpassphrase(passphrase2, MAX_VALUE + 1000)\n        actual_time = self.nodes[0].getwalletinfo()['unlocked_until']\n        assert_greater_than_or_equal(actual_time, expected_time)\n        assert_greater_than(expected_time + 5, actual_time) # 5 second buffer\n\nif __name__ == '__main__':\n    WalletEncryptionTest().main()\n"
  },
  {
    "path": "test/functional/wallet_hd.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test Hierarchical Deterministic wallet function.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    connect_nodes_bi,\n)\nimport shutil\nimport os\n\nclass WalletHDTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 2\n        self.extra_args = [[], ['-keypool=0']]\n\n    def run_test (self):\n        tmpdir = self.options.tmpdir\n\n        # Make sure can't switch off usehd after wallet creation\n        self.stop_node(1)\n        self.assert_start_raises_init_error(1, ['-usehd=0'], 'already existing HD wallet')\n        self.start_node(1)\n        connect_nodes_bi(self.nodes, 0, 1)\n\n        # Make sure we use hd, keep masterkeyid\n        masterkeyid = self.nodes[1].getwalletinfo()['hdmasterkeyid']\n        assert_equal(len(masterkeyid), 40)\n\n        # create an internal key\n        change_addr = self.nodes[1].getrawchangeaddress()\n        change_addrV= self.nodes[1].validateaddress(change_addr)\n        assert_equal(change_addrV[\"hdkeypath\"], \"m/0'/1'/0'\") #first internal child key\n\n        # Import a non-HD private key in the HD wallet\n        non_hd_add = self.nodes[0].getnewaddress()\n        self.nodes[1].importprivkey(self.nodes[0].dumpprivkey(non_hd_add))\n\n        # This should be enough to keep the master key and the non-HD key\n        self.nodes[1].backupwallet(tmpdir + \"/hd.bak\")\n        #self.nodes[1].dumpwallet(tmpdir + \"/hd.dump\")\n\n        # Derive some HD addresses and remember the last\n        # Also send funds to each add\n        self.nodes[0].generate(101)\n        hd_add = None\n        num_hd_adds = 300\n        for i in range(num_hd_adds):\n            hd_add = self.nodes[1].getnewaddress()\n            hd_info = self.nodes[1].validateaddress(hd_add)\n            assert_equal(hd_info[\"hdkeypath\"], \"m/0'/0'/\"+str(i)+\"'\")\n            assert_equal(hd_info[\"hdmasterkeyid\"], masterkeyid)\n            self.nodes[0].sendtoaddress(hd_add, 1)\n            self.nodes[0].generate(1)\n        self.nodes[0].sendtoaddress(non_hd_add, 1)\n        self.nodes[0].generate(1)\n\n        # create an internal key (again)\n        change_addr = self.nodes[1].getrawchangeaddress()\n        change_addrV= self.nodes[1].validateaddress(change_addr)\n        assert_equal(change_addrV[\"hdkeypath\"], \"m/0'/1'/1'\") #second internal child key\n\n        self.sync_all()\n        assert_equal(self.nodes[1].getbalance(), num_hd_adds + 1)\n\n        self.log.info(\"Restore backup ...\")\n        self.stop_node(1)\n        # we need to delete the complete regtest directory\n        # otherwise node1 would auto-recover all funds in flag the keypool keys as used\n        shutil.rmtree(os.path.join(tmpdir, \"node1/regtest/blocks\"))\n        shutil.rmtree(os.path.join(tmpdir, \"node1/regtest/chainstate\"))\n        shutil.copyfile(os.path.join(tmpdir, \"hd.bak\"), os.path.join(tmpdir, \"node1/regtest/wallets/wallet.dat\"))\n        self.start_node(1)\n\n        # Assert that derivation is deterministic\n        hd_add_2 = None\n        for _ in range(num_hd_adds):\n            hd_add_2 = self.nodes[1].getnewaddress()\n            hd_info_2 = self.nodes[1].validateaddress(hd_add_2)\n            assert_equal(hd_info_2[\"hdkeypath\"], \"m/0'/0'/\"+str(_)+\"'\")\n            assert_equal(hd_info_2[\"hdmasterkeyid\"], masterkeyid)\n        assert_equal(hd_add, hd_add_2)\n        connect_nodes_bi(self.nodes, 0, 1)\n        self.sync_all()\n\n        # Needs rescan\n        self.stop_node(1)\n        self.start_node(1, extra_args=self.extra_args[1] + ['-rescan'])\n        assert_equal(self.nodes[1].getbalance(), num_hd_adds + 1)\n\n        # Try a RPC based rescan\n        self.stop_node(1)\n        shutil.rmtree(os.path.join(tmpdir, \"node1/regtest/blocks\"))\n        shutil.rmtree(os.path.join(tmpdir, \"node1/regtest/chainstate\"))\n        shutil.copyfile(os.path.join(tmpdir, \"hd.bak\"), os.path.join(tmpdir, \"node1/regtest/wallet.dat\"))\n        self.start_node(1, extra_args=self.extra_args[1])\n        connect_nodes_bi(self.nodes, 0, 1)\n        self.sync_all()\n        out = self.nodes[1].rescanblockchain(0, 1)\n        assert_equal(out['start_height'], 0)\n        assert_equal(out['stop_height'], 1)\n        out = self.nodes[1].rescanblockchain()\n        assert_equal(out['start_height'], 0)\n        assert_equal(out['stop_height'], self.nodes[1].getblockcount())\n        assert_equal(self.nodes[1].getbalance(), num_hd_adds + 1)\n\n        # send a tx and make sure its using the internal chain for the changeoutput\n        txid = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1)\n        outs = self.nodes[1].decoderawtransaction(self.nodes[1].gettransaction(txid)['hex'])['vout']\n        keypath = \"\"\n        for out in outs:\n            if out['value'] != 1:\n                keypath = self.nodes[1].validateaddress(out['scriptPubKey']['addresses'][0])['hdkeypath']\n\n        assert_equal(keypath[0:7], \"m/0'/1'\")\n\nif __name__ == '__main__':\n    WalletHDTest().main ()\n"
  },
  {
    "path": "test/functional/wallet_import_rescan.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test wallet import RPCs.\n\nTest rescan behavior of importaddress, importpubkey, importprivkey, and\nimportmulti RPCs with different types of keys and rescan options.\n\nIn the first part of the test, node 0 creates an address for each type of\nimport RPC call and sends BTC to it. Then other nodes import the addresses,\nand the test makes listtransactions and getbalance calls to confirm that the\nimporting node either did or did not execute rescans picking up the send\ntransactions.\n\nIn the second part of the test, node 0 sends more BTC to each address, and the\ntest makes more listtransactions and getbalance calls to confirm that the\nimporting nodes pick up the new transactions regardless of whether rescans\nhappened previously.\n\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (assert_raises_rpc_error, connect_nodes, sync_blocks, assert_equal, set_node_times)\n\nimport collections\nimport enum\nimport itertools\n\nCall = enum.Enum(\"Call\", \"single multi\")\nData = enum.Enum(\"Data\", \"address pub priv\")\nRescan = enum.Enum(\"Rescan\", \"no yes late_timestamp\")\n\n\nclass Variant(collections.namedtuple(\"Variant\", \"call data rescan prune\")):\n    \"\"\"Helper for importing one key and verifying scanned transactions.\"\"\"\n\n    def try_rpc(self, func, *args, **kwargs):\n        if self.expect_disabled:\n            assert_raises_rpc_error(-4, \"Rescan is disabled in pruned mode\", func, *args, **kwargs)\n        else:\n            return func(*args, **kwargs)\n\n    def do_import(self, timestamp):\n        \"\"\"Call one key import RPC.\"\"\"\n\n        if self.call == Call.single:\n            if self.data == Data.address:\n                response = self.try_rpc(self.node.importaddress, self.address[\"address\"], self.label,\n                                               self.rescan == Rescan.yes)\n            elif self.data == Data.pub:\n                response = self.try_rpc(self.node.importpubkey, self.address[\"pubkey\"], self.label,\n                                               self.rescan == Rescan.yes)\n            elif self.data == Data.priv:\n                response = self.try_rpc(self.node.importprivkey, self.key, self.label, self.rescan == Rescan.yes)\n            assert_equal(response, None)\n\n        elif self.call == Call.multi:\n            response = self.node.importmulti([{\n                \"scriptPubKey\": {\n                    \"address\": self.address[\"address\"]\n                },\n                \"timestamp\": timestamp + TIMESTAMP_WINDOW + (1 if self.rescan == Rescan.late_timestamp else 0),\n                \"pubkeys\": [self.address[\"pubkey\"]] if self.data == Data.pub else [],\n                \"keys\": [self.key] if self.data == Data.priv else [],\n                \"label\": self.label,\n                \"watchonly\": self.data != Data.priv\n            }], {\"rescan\": self.rescan in (Rescan.yes, Rescan.late_timestamp)})\n            assert_equal(response, [{\"success\": True}])\n\n    def check(self, txid=None, amount=None, confirmations=None):\n        \"\"\"Verify that getbalance/listtransactions return expected values.\"\"\"\n\n        balance = self.node.getbalance(self.label, 0, True)\n        assert_equal(balance, self.expected_balance)\n\n        txs = self.node.listtransactions(self.label, 10000, 0, True)\n        assert_equal(len(txs), self.expected_txs)\n\n        if txid is not None:\n            tx, = [tx for tx in txs if tx[\"txid\"] == txid]\n            assert_equal(tx[\"account\"], self.label)\n            assert_equal(tx[\"address\"], self.address[\"address\"])\n            assert_equal(tx[\"amount\"], amount)\n            assert_equal(tx[\"category\"], \"receive\")\n            assert_equal(tx[\"label\"], self.label)\n            assert_equal(tx[\"txid\"], txid)\n            assert_equal(tx[\"confirmations\"], confirmations)\n            assert_equal(\"trusted\" not in tx, True)\n            # Verify the transaction is correctly marked watchonly depending on\n            # whether the transaction pays to an imported public key or\n            # imported private key. The test setup ensures that transaction\n            # inputs will not be from watchonly keys (important because\n            # involvesWatchonly will be true if either the transaction output\n            # or inputs are watchonly).\n            if self.data != Data.priv:\n                assert_equal(tx[\"involvesWatchonly\"], True)\n            else:\n                assert_equal(\"involvesWatchonly\" not in tx, True)\n\n\n# List of Variants for each way a key or address could be imported.\nIMPORT_VARIANTS = [Variant(*variants) for variants in itertools.product(Call, Data, Rescan, (False, True))]\n\n# List of nodes to import keys to. Half the nodes will have pruning disabled,\n# half will have it enabled. Different nodes will be used for imports that are\n# expected to cause rescans, and imports that are not expected to cause\n# rescans, in order to prevent rescans during later imports picking up\n# transactions associated with earlier imports. This makes it easier to keep\n# track of expected balances and transactions.\nImportNode = collections.namedtuple(\"ImportNode\", \"prune rescan\")\nIMPORT_NODES = [ImportNode(*fields) for fields in itertools.product((False, True), repeat=2)]\n\n# Rescans start at the earliest block up to 2 hours before the key timestamp.\nTIMESTAMP_WINDOW = 2 * 60 * 60\n\n\nclass ImportRescanTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2 + len(IMPORT_NODES)\n\n    def setup_network(self):\n        extra_args = [[\"-addresstype=legacy\"] for _ in range(self.num_nodes)]\n        for i, import_node in enumerate(IMPORT_NODES, 2):\n            if import_node.prune:\n                extra_args[i] += [\"-prune=1\"]\n\n        self.add_nodes(self.num_nodes, extra_args)\n        self.start_nodes()\n        for i in range(1, self.num_nodes):\n            connect_nodes(self.nodes[i], 0)\n\n    def run_test(self):\n        # Create one transaction on node 0 with a unique amount and label for\n        # each possible type of wallet import RPC.\n        for i, variant in enumerate(IMPORT_VARIANTS):\n            variant.label = \"label {} {}\".format(i, variant)\n            variant.address = self.nodes[1].validateaddress(self.nodes[1].getnewaddress(variant.label))\n            variant.key = self.nodes[1].dumpprivkey(variant.address[\"address\"])\n            variant.initial_amount = 10 - (i + 1) / 4.0\n            variant.initial_txid = self.nodes[0].sendtoaddress(variant.address[\"address\"], variant.initial_amount)\n\n        # Generate a block containing the initial transactions, then another\n        # block further in the future (past the rescan window).\n        self.nodes[0].generate(1)\n        assert_equal(self.nodes[0].getrawmempool(), [])\n        timestamp = self.nodes[0].getblockheader(self.nodes[0].getbestblockhash())[\"time\"]\n        set_node_times(self.nodes, timestamp + TIMESTAMP_WINDOW + 1)\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n\n        # For each variation of wallet key import, invoke the import RPC and\n        # check the results from getbalance and listtransactions.\n        for variant in IMPORT_VARIANTS:\n            variant.expect_disabled = variant.rescan == Rescan.yes and variant.prune and variant.call == Call.single\n            expect_rescan = variant.rescan == Rescan.yes and not variant.expect_disabled\n            variant.node = self.nodes[2 + IMPORT_NODES.index(ImportNode(variant.prune, expect_rescan))]\n            variant.do_import(timestamp)\n            if expect_rescan:\n                variant.expected_balance = variant.initial_amount\n                variant.expected_txs = 1\n                variant.check(variant.initial_txid, variant.initial_amount, 2)\n            else:\n                variant.expected_balance = 0\n                variant.expected_txs = 0\n                variant.check()\n\n        # Create new transactions sending to each address.\n        for i, variant in enumerate(IMPORT_VARIANTS):\n            variant.sent_amount = 10 - (2 * i + 1) / 8.0\n            variant.sent_txid = self.nodes[0].sendtoaddress(variant.address[\"address\"], variant.sent_amount)\n\n        # Generate a block containing the new transactions.\n        self.nodes[0].generate(1)\n        assert_equal(self.nodes[0].getrawmempool(), [])\n        sync_blocks(self.nodes)\n\n        # Check the latest results from getbalance and listtransactions.\n        for variant in IMPORT_VARIANTS:\n            if not variant.expect_disabled:\n                variant.expected_balance += variant.sent_amount\n                variant.expected_txs += 1\n                variant.check(variant.sent_txid, variant.sent_amount, 1)\n            else:\n                variant.check()\n\nif __name__ == \"__main__\":\n    ImportRescanTest().main()\n"
  },
  {
    "path": "test/functional/wallet_importmulti.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the importmulti RPC.\"\"\"\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass ImportMultiTest (BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n        self.extra_args = [[\"-addresstype=legacy\"], [\"-addresstype=legacy\"]]\n        self.setup_clean_chain = True\n\n    def setup_network(self):\n        self.setup_nodes()\n\n    def run_test (self):\n        self.log.info(\"Mining blocks...\")\n        self.nodes[0].generate(1)\n        self.nodes[1].generate(1)\n        timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']\n\n        node0_address1 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n\n        #Check only one address\n        assert_equal(node0_address1['ismine'], True)\n\n        #Node 1 sync test\n        assert_equal(self.nodes[1].getblockcount(),1)\n\n        #Address Test - before import\n        address_info = self.nodes[1].validateaddress(node0_address1['address'])\n        assert_equal(address_info['iswatchonly'], False)\n        assert_equal(address_info['ismine'], False)\n\n\n        # RPC importmulti -----------------------------------------------\n\n        # Bitcoin Address\n        self.log.info(\"Should import an address\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": address['address']\n            },\n            \"timestamp\": \"now\",\n        }])\n        assert_equal(result[0]['success'], True)\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], True)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal(address_assert['timestamp'], timestamp)\n        watchonly_address = address['address']\n        watchonly_timestamp = timestamp\n\n        self.log.info(\"Should not import an invalid address\")\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": \"not valid address\",\n            },\n            \"timestamp\": \"now\",\n        }])\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -5)\n        assert_equal(result[0]['error']['message'], 'Invalid address')\n\n        # ScriptPubKey + internal\n        self.log.info(\"Should import a scriptPubKey with internal flag\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": address['scriptPubKey'],\n            \"timestamp\": \"now\",\n            \"internal\": True\n        }])\n        assert_equal(result[0]['success'], True)\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], True)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal(address_assert['timestamp'], timestamp)\n\n        # ScriptPubKey + !internal\n        self.log.info(\"Should not import a scriptPubKey without internal flag\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": address['scriptPubKey'],\n            \"timestamp\": \"now\",\n        }])\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -8)\n        assert_equal(result[0]['error']['message'], 'Internal must be set for hex scriptPubKey')\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], False)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal('timestamp' in address_assert, False)\n\n\n        # Address + Public key + !Internal\n        self.log.info(\"Should import an address with public key\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": address['address']\n            },\n            \"timestamp\": \"now\",\n            \"pubkeys\": [ address['pubkey'] ]\n        }])\n        assert_equal(result[0]['success'], True)\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], True)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal(address_assert['timestamp'], timestamp)\n\n\n        # ScriptPubKey + Public key + internal\n        self.log.info(\"Should import a scriptPubKey with internal and with public key\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        request = [{\n            \"scriptPubKey\": address['scriptPubKey'],\n            \"timestamp\": \"now\",\n            \"pubkeys\": [ address['pubkey'] ],\n            \"internal\": True\n        }]\n        result = self.nodes[1].importmulti(request)\n        assert_equal(result[0]['success'], True)\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], True)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal(address_assert['timestamp'], timestamp)\n\n        # ScriptPubKey + Public key + !internal\n        self.log.info(\"Should not import a scriptPubKey without internal and with public key\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        request = [{\n            \"scriptPubKey\": address['scriptPubKey'],\n            \"timestamp\": \"now\",\n            \"pubkeys\": [ address['pubkey'] ]\n        }]\n        result = self.nodes[1].importmulti(request)\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -8)\n        assert_equal(result[0]['error']['message'], 'Internal must be set for hex scriptPubKey')\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], False)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal('timestamp' in address_assert, False)\n\n        # Address + Private key + !watchonly\n        self.log.info(\"Should import an address with private key\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": address['address']\n            },\n            \"timestamp\": \"now\",\n            \"keys\": [ self.nodes[0].dumpprivkey(address['address']) ]\n        }])\n        assert_equal(result[0]['success'], True)\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], False)\n        assert_equal(address_assert['ismine'], True)\n        assert_equal(address_assert['timestamp'], timestamp)\n\n        self.log.info(\"Should not import an address with private key if is already imported\")\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": address['address']\n            },\n            \"timestamp\": \"now\",\n            \"keys\": [ self.nodes[0].dumpprivkey(address['address']) ]\n        }])\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -4)\n        assert_equal(result[0]['error']['message'], 'The wallet already contains the private key for this address or script')\n\n        # Address + Private key + watchonly\n        self.log.info(\"Should not import an address with private key and with watchonly\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": address['address']\n            },\n            \"timestamp\": \"now\",\n            \"keys\": [ self.nodes[0].dumpprivkey(address['address']) ],\n            \"watchonly\": True\n        }])\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -8)\n        assert_equal(result[0]['error']['message'], 'Incompatibility found between watchonly and keys')\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], False)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal('timestamp' in address_assert, False)\n\n        # ScriptPubKey + Private key + internal\n        self.log.info(\"Should import a scriptPubKey with internal and with private key\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": address['scriptPubKey'],\n            \"timestamp\": \"now\",\n            \"keys\": [ self.nodes[0].dumpprivkey(address['address']) ],\n            \"internal\": True\n        }])\n        assert_equal(result[0]['success'], True)\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], False)\n        assert_equal(address_assert['ismine'], True)\n        assert_equal(address_assert['timestamp'], timestamp)\n\n        # ScriptPubKey + Private key + !internal\n        self.log.info(\"Should not import a scriptPubKey without internal and with private key\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": address['scriptPubKey'],\n            \"timestamp\": \"now\",\n            \"keys\": [ self.nodes[0].dumpprivkey(address['address']) ]\n        }])\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -8)\n        assert_equal(result[0]['error']['message'], 'Internal must be set for hex scriptPubKey')\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], False)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal('timestamp' in address_assert, False)\n\n\n        # P2SH address\n        sig_address_1 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        sig_address_2 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        sig_address_3 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        multi_sig_script = self.nodes[0].createmultisig(2, [sig_address_1['pubkey'], sig_address_2['pubkey'], sig_address_3['pubkey']])\n        self.nodes[1].generate(100)\n        transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)\n        self.nodes[1].generate(1)\n        timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']\n\n        self.log.info(\"Should import a p2sh\")\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": multi_sig_script['address']\n            },\n            \"timestamp\": \"now\",\n        }])\n        assert_equal(result[0]['success'], True)\n        address_assert = self.nodes[1].validateaddress(multi_sig_script['address'])\n        assert_equal(address_assert['isscript'], True)\n        assert_equal(address_assert['iswatchonly'], True)\n        assert_equal(address_assert['timestamp'], timestamp)\n        p2shunspent = self.nodes[1].listunspent(0,999999, [multi_sig_script['address']])[0]\n        assert_equal(p2shunspent['spendable'], False)\n        assert_equal(p2shunspent['solvable'], False)\n\n\n        # P2SH + Redeem script\n        sig_address_1 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        sig_address_2 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        sig_address_3 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        multi_sig_script = self.nodes[0].createmultisig(2, [sig_address_1['pubkey'], sig_address_2['pubkey'], sig_address_3['pubkey']])\n        self.nodes[1].generate(100)\n        transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)\n        self.nodes[1].generate(1)\n        timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']\n\n        self.log.info(\"Should import a p2sh with respective redeem script\")\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": multi_sig_script['address']\n            },\n            \"timestamp\": \"now\",\n            \"redeemscript\": multi_sig_script['redeemScript']\n        }])\n        assert_equal(result[0]['success'], True)\n        address_assert = self.nodes[1].validateaddress(multi_sig_script['address'])\n        assert_equal(address_assert['timestamp'], timestamp)\n\n        p2shunspent = self.nodes[1].listunspent(0,999999, [multi_sig_script['address']])[0]\n        assert_equal(p2shunspent['spendable'], False)\n        assert_equal(p2shunspent['solvable'], True)\n\n\n        # P2SH + Redeem script + Private Keys + !Watchonly\n        sig_address_1 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        sig_address_2 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        sig_address_3 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        multi_sig_script = self.nodes[0].createmultisig(2, [sig_address_1['pubkey'], sig_address_2['pubkey'], sig_address_3['pubkey']])\n        self.nodes[1].generate(100)\n        transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)\n        self.nodes[1].generate(1)\n        timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']\n\n        self.log.info(\"Should import a p2sh with respective redeem script and private keys\")\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": multi_sig_script['address']\n            },\n            \"timestamp\": \"now\",\n            \"redeemscript\": multi_sig_script['redeemScript'],\n            \"keys\": [ self.nodes[0].dumpprivkey(sig_address_1['address']), self.nodes[0].dumpprivkey(sig_address_2['address'])]\n        }])\n        assert_equal(result[0]['success'], True)\n        address_assert = self.nodes[1].validateaddress(multi_sig_script['address'])\n        assert_equal(address_assert['timestamp'], timestamp)\n\n        p2shunspent = self.nodes[1].listunspent(0,999999, [multi_sig_script['address']])[0]\n        assert_equal(p2shunspent['spendable'], False)\n        assert_equal(p2shunspent['solvable'], True)\n\n        # P2SH + Redeem script + Private Keys + Watchonly\n        sig_address_1 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        sig_address_2 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        sig_address_3 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        multi_sig_script = self.nodes[0].createmultisig(2, [sig_address_1['pubkey'], sig_address_2['pubkey'], sig_address_3['pubkey']])\n        self.nodes[1].generate(100)\n        transactionid = self.nodes[1].sendtoaddress(multi_sig_script['address'], 10.00)\n        self.nodes[1].generate(1)\n        timestamp = self.nodes[1].getblock(self.nodes[1].getbestblockhash())['mediantime']\n\n        self.log.info(\"Should import a p2sh with respective redeem script and private keys\")\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": multi_sig_script['address']\n            },\n            \"timestamp\": \"now\",\n            \"redeemscript\": multi_sig_script['redeemScript'],\n            \"keys\": [ self.nodes[0].dumpprivkey(sig_address_1['address']), self.nodes[0].dumpprivkey(sig_address_2['address'])],\n            \"watchonly\": True\n        }])\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -8)\n        assert_equal(result[0]['error']['message'], 'Incompatibility found between watchonly and keys')\n\n\n        # Address + Public key + !Internal + Wrong pubkey\n        self.log.info(\"Should not import an address with a wrong public key\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        address2 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": address['address']\n            },\n            \"timestamp\": \"now\",\n            \"pubkeys\": [ address2['pubkey'] ]\n        }])\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -5)\n        assert_equal(result[0]['error']['message'], 'Consistency check failed')\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], False)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal('timestamp' in address_assert, False)\n\n\n        # ScriptPubKey + Public key + internal + Wrong pubkey\n        self.log.info(\"Should not import a scriptPubKey with internal and with a wrong public key\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        address2 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        request = [{\n            \"scriptPubKey\": address['scriptPubKey'],\n            \"timestamp\": \"now\",\n            \"pubkeys\": [ address2['pubkey'] ],\n            \"internal\": True\n        }]\n        result = self.nodes[1].importmulti(request)\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -5)\n        assert_equal(result[0]['error']['message'], 'Consistency check failed')\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], False)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal('timestamp' in address_assert, False)\n\n\n        # Address + Private key + !watchonly + Wrong private key\n        self.log.info(\"Should not import an address with a wrong private key\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        address2 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": address['address']\n            },\n            \"timestamp\": \"now\",\n            \"keys\": [ self.nodes[0].dumpprivkey(address2['address']) ]\n        }])\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -5)\n        assert_equal(result[0]['error']['message'], 'Consistency check failed')\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], False)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal('timestamp' in address_assert, False)\n\n\n        # ScriptPubKey + Private key + internal + Wrong private key\n        self.log.info(\"Should not import a scriptPubKey with internal and with a wrong private key\")\n        address = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        address2 = self.nodes[0].validateaddress(self.nodes[0].getnewaddress())\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": address['scriptPubKey'],\n            \"timestamp\": \"now\",\n            \"keys\": [ self.nodes[0].dumpprivkey(address2['address']) ],\n            \"internal\": True\n        }])\n        assert_equal(result[0]['success'], False)\n        assert_equal(result[0]['error']['code'], -5)\n        assert_equal(result[0]['error']['message'], 'Consistency check failed')\n        address_assert = self.nodes[1].validateaddress(address['address'])\n        assert_equal(address_assert['iswatchonly'], False)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal('timestamp' in address_assert, False)\n\n\n        # Importing existing watch only address with new timestamp should replace saved timestamp.\n        assert_greater_than(timestamp, watchonly_timestamp)\n        self.log.info(\"Should replace previously saved watch only timestamp.\")\n        result = self.nodes[1].importmulti([{\n            \"scriptPubKey\": {\n                \"address\": watchonly_address,\n            },\n            \"timestamp\": \"now\",\n        }])\n        assert_equal(result[0]['success'], True)\n        address_assert = self.nodes[1].validateaddress(watchonly_address)\n        assert_equal(address_assert['iswatchonly'], True)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal(address_assert['timestamp'], timestamp)\n        watchonly_timestamp = timestamp\n\n\n        # restart nodes to check for proper serialization/deserialization of watch only address\n        self.stop_nodes()\n        self.start_nodes()\n        address_assert = self.nodes[1].validateaddress(watchonly_address)\n        assert_equal(address_assert['iswatchonly'], True)\n        assert_equal(address_assert['ismine'], False)\n        assert_equal(address_assert['timestamp'], watchonly_timestamp)\n\n        # Bad or missing timestamps\n        self.log.info(\"Should throw on invalid or missing timestamp values\")\n        assert_raises_rpc_error(-3, 'Missing required timestamp field for key',\n            self.nodes[1].importmulti, [{\n                \"scriptPubKey\": address['scriptPubKey'],\n            }])\n        assert_raises_rpc_error(-3, 'Expected number or \"now\" timestamp value for key. got type string',\n            self.nodes[1].importmulti, [{\n                \"scriptPubKey\": address['scriptPubKey'],\n                \"timestamp\": \"\",\n            }])\n\n\nif __name__ == '__main__':\n    ImportMultiTest ().main ()\n"
  },
  {
    "path": "test/functional/wallet_importprunedfunds.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the importprunedfunds and removeprunedfunds RPCs.\"\"\"\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass ImportPrunedFundsTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 2\n\n    def run_test(self):\n        self.log.info(\"Mining blocks...\")\n        self.nodes[0].generate(101)\n\n        self.sync_all()\n        \n        # address\n        address1 = self.nodes[0].getnewaddress()\n        # pubkey\n        address2 = self.nodes[0].getnewaddress()\n        # privkey\n        address3 = self.nodes[0].getnewaddress()\n        address3_privkey = self.nodes[0].dumpprivkey(address3)                              # Using privkey\n\n        #Check only one address\n        address_info = self.nodes[0].validateaddress(address1)\n        assert_equal(address_info['ismine'], True)\n\n        self.sync_all()\n\n        #Node 1 sync test\n        assert_equal(self.nodes[1].getblockcount(),101)\n\n        #Address Test - before import\n        address_info = self.nodes[1].validateaddress(address1)\n        assert_equal(address_info['iswatchonly'], False)\n        assert_equal(address_info['ismine'], False)\n\n        address_info = self.nodes[1].validateaddress(address2)\n        assert_equal(address_info['iswatchonly'], False)\n        assert_equal(address_info['ismine'], False)\n\n        address_info = self.nodes[1].validateaddress(address3)\n        assert_equal(address_info['iswatchonly'], False)\n        assert_equal(address_info['ismine'], False)\n\n        #Send funds to self\n        txnid1 = self.nodes[0].sendtoaddress(address1, 0.1)\n        self.nodes[0].generate(1)\n        rawtxn1 = self.nodes[0].gettransaction(txnid1)['hex']\n        proof1 = self.nodes[0].gettxoutproof([txnid1])\n\n        txnid2 = self.nodes[0].sendtoaddress(address2, 0.05)\n        self.nodes[0].generate(1)\n        rawtxn2 = self.nodes[0].gettransaction(txnid2)['hex']\n        proof2 = self.nodes[0].gettxoutproof([txnid2])\n\n        txnid3 = self.nodes[0].sendtoaddress(address3, 0.025)\n        self.nodes[0].generate(1)\n        rawtxn3 = self.nodes[0].gettransaction(txnid3)['hex']\n        proof3 = self.nodes[0].gettxoutproof([txnid3])\n\n        self.sync_all()\n\n        #Import with no affiliated address\n        assert_raises_rpc_error(-5, \"No addresses\", self.nodes[1].importprunedfunds, rawtxn1, proof1)\n\n        balance1 = self.nodes[1].getbalance(\"\", 0, True)\n        assert_equal(balance1, Decimal(0))\n\n        #Import with affiliated address with no rescan\n        self.nodes[1].importaddress(address2, \"add2\", False)\n        self.nodes[1].importprunedfunds(rawtxn2, proof2)\n        balance2 = self.nodes[1].getbalance(\"add2\", 0, True)\n        assert_equal(balance2, Decimal('0.05'))\n\n        #Import with private key with no rescan\n        self.nodes[1].importprivkey(privkey=address3_privkey, label=\"add3\", rescan=False)\n        self.nodes[1].importprunedfunds(rawtxn3, proof3)\n        balance3 = self.nodes[1].getbalance(\"add3\", 0, False)\n        assert_equal(balance3, Decimal('0.025'))\n        balance3 = self.nodes[1].getbalance(\"*\", 0, True)\n        assert_equal(balance3, Decimal('0.075'))\n\n        #Addresses Test - after import\n        address_info = self.nodes[1].validateaddress(address1)\n        assert_equal(address_info['iswatchonly'], False)\n        assert_equal(address_info['ismine'], False)\n        address_info = self.nodes[1].validateaddress(address2)\n        assert_equal(address_info['iswatchonly'], True)\n        assert_equal(address_info['ismine'], False)\n        address_info = self.nodes[1].validateaddress(address3)\n        assert_equal(address_info['iswatchonly'], False)\n        assert_equal(address_info['ismine'], True)\n\n        #Remove transactions\n        assert_raises_rpc_error(-8, \"Transaction does not exist in wallet.\", self.nodes[1].removeprunedfunds, txnid1)\n\n        balance1 = self.nodes[1].getbalance(\"*\", 0, True)\n        assert_equal(balance1, Decimal('0.075'))\n\n        self.nodes[1].removeprunedfunds(txnid2)\n        balance2 = self.nodes[1].getbalance(\"*\", 0, True)\n        assert_equal(balance2, Decimal('0.025'))\n\n        self.nodes[1].removeprunedfunds(txnid3)\n        balance3 = self.nodes[1].getbalance(\"*\", 0, True)\n        assert_equal(balance3, Decimal('0.0'))\n\nif __name__ == '__main__':\n    ImportPrunedFundsTest().main()\n"
  },
  {
    "path": "test/functional/wallet_keypool.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the wallet keypool and interaction with wallet encryption/locking.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass KeyPoolTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n\n    def run_test(self):\n        nodes = self.nodes\n        addr_before_encrypting = nodes[0].getnewaddress()\n        addr_before_encrypting_data = nodes[0].validateaddress(addr_before_encrypting)\n        wallet_info_old = nodes[0].getwalletinfo()\n        assert(addr_before_encrypting_data['hdmasterkeyid'] == wallet_info_old['hdmasterkeyid'])\n        \n        # Encrypt wallet and wait to terminate\n        nodes[0].node_encrypt_wallet('test')\n        # Restart node 0\n        self.start_node(0)\n        # Keep creating keys\n        addr = nodes[0].getnewaddress()\n        addr_data = nodes[0].validateaddress(addr)\n        wallet_info = nodes[0].getwalletinfo()\n        assert(addr_before_encrypting_data['hdmasterkeyid'] != wallet_info['hdmasterkeyid'])\n        assert(addr_data['hdmasterkeyid'] == wallet_info['hdmasterkeyid'])\n        assert_raises_rpc_error(-12, \"Error: Keypool ran out, please call keypoolrefill first\", nodes[0].getnewaddress)\n\n        # put six (plus 2) new keys in the keypool (100% external-, +100% internal-keys, 1 in min)\n        nodes[0].walletpassphrase('test', 12000)\n        nodes[0].keypoolrefill(6)\n        nodes[0].walletlock()\n        wi = nodes[0].getwalletinfo()\n        assert_equal(wi['keypoolsize_hd_internal'], 6)\n        assert_equal(wi['keypoolsize'], 6)\n\n        # drain the internal keys\n        nodes[0].getrawchangeaddress()\n        nodes[0].getrawchangeaddress()\n        nodes[0].getrawchangeaddress()\n        nodes[0].getrawchangeaddress()\n        nodes[0].getrawchangeaddress()\n        nodes[0].getrawchangeaddress()\n        addr = set()\n        # the next one should fail\n        assert_raises_rpc_error(-12, \"Keypool ran out\", nodes[0].getrawchangeaddress)\n\n        # drain the external keys\n        addr.add(nodes[0].getnewaddress())\n        addr.add(nodes[0].getnewaddress())\n        addr.add(nodes[0].getnewaddress())\n        addr.add(nodes[0].getnewaddress())\n        addr.add(nodes[0].getnewaddress())\n        addr.add(nodes[0].getnewaddress())\n        assert(len(addr) == 6)\n        # the next one should fail\n        assert_raises_rpc_error(-12, \"Error: Keypool ran out, please call keypoolrefill first\", nodes[0].getnewaddress)\n\n        # refill keypool with three new addresses\n        nodes[0].walletpassphrase('test', 1)\n        nodes[0].keypoolrefill(3)\n\n        # test walletpassphrase timeout\n        time.sleep(1.1)\n        assert_equal(nodes[0].getwalletinfo()[\"unlocked_until\"], 0)\n\n        # drain them by mining\n        nodes[0].generate(1)\n        nodes[0].generate(1)\n        nodes[0].generate(1)\n        assert_raises_rpc_error(-12, \"Keypool ran out\", nodes[0].generate, 1)\n\n        nodes[0].walletpassphrase('test', 100)\n        nodes[0].keypoolrefill(100)\n        wi = nodes[0].getwalletinfo()\n        assert_equal(wi['keypoolsize_hd_internal'], 100)\n        assert_equal(wi['keypoolsize'], 100)\n\nif __name__ == '__main__':\n    KeyPoolTest().main()\n"
  },
  {
    "path": "test/functional/wallet_keypool_topup.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test HD Wallet keypool restore function.\n\nTwo nodes. Node1 is under test. Node0 is providing transactions and generating blocks.\n\n- Start node1, shutdown and backup wallet.\n- Generate 110 keys (enough to drain the keypool). Store key 90 (in the initial keypool) and key 110 (beyond the initial keypool). Send funds to key 90 and key 110.\n- Stop node1, clear the datadir, move wallet file back into the datadir and restart node1.\n- connect node1 to node0. Verify that they sync and node1 receives its funds.\"\"\"\nimport shutil\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    connect_nodes_bi,\n    sync_blocks,\n)\n\nclass KeypoolRestoreTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 2\n        self.extra_args = [[], ['-keypool=100', '-keypoolmin=20']]\n\n    def run_test(self):\n        self.tmpdir = self.options.tmpdir\n        self.nodes[0].generate(101)\n\n        self.log.info(\"Make backup of wallet\")\n\n        self.stop_node(1)\n\n        shutil.copyfile(self.tmpdir + \"/node1/regtest/wallets/wallet.dat\", self.tmpdir + \"/wallet.bak\")\n        self.start_node(1, self.extra_args[1])\n        connect_nodes_bi(self.nodes, 0, 1)\n\n        self.log.info(\"Generate keys for wallet\")\n\n        for _ in range(90):\n            addr_oldpool = self.nodes[1].getnewaddress()\n        for _ in range(20):\n            addr_extpool = self.nodes[1].getnewaddress()\n\n        self.log.info(\"Send funds to wallet\")\n\n        self.nodes[0].sendtoaddress(addr_oldpool, 10)\n        self.nodes[0].generate(1)\n        self.nodes[0].sendtoaddress(addr_extpool, 5)\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n\n        self.log.info(\"Restart node with wallet backup\")\n\n        self.stop_node(1)\n\n        shutil.copyfile(self.tmpdir + \"/wallet.bak\", self.tmpdir + \"/node1/regtest/wallets/wallet.dat\")\n\n        self.log.info(\"Verify keypool is restored and balance is correct\")\n\n        self.start_node(1, self.extra_args[1])\n        connect_nodes_bi(self.nodes, 0, 1)\n        self.sync_all()\n\n        assert_equal(self.nodes[1].getbalance(), 15)\n        assert_equal(self.nodes[1].listtransactions()[0]['category'], \"receive\")\n\n        # Check that we have marked all keys up to the used keypool key as used\n        assert_equal(self.nodes[1].validateaddress(self.nodes[1].getnewaddress())['hdkeypath'], \"m/0'/0'/110'\")\n\nif __name__ == '__main__':\n    KeypoolRestoreTest().main()\n"
  },
  {
    "path": "test/functional/wallet_listreceivedby.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the listreceivedbyaddress RPC.\"\"\"\nfrom decimal import Decimal\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_array_result,\n    assert_equal,\n    assert_raises_rpc_error,\n    sync_blocks,\n)\n\n\nclass ReceivedByTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 2\n\n    def run_test(self):\n        # Generate block to get out of IBD\n        self.nodes[0].generate(1)\n        sync_blocks(self.nodes)\n\n        self.log.info(\"listreceivedbyaddress Test\")\n\n        # Send from node 0 to 1\n        addr = self.nodes[1].getnewaddress()\n        txid = self.nodes[0].sendtoaddress(addr, 0.1)\n        self.sync_all()\n\n        # Check not listed in listreceivedbyaddress because has 0 confirmations\n        assert_array_result(self.nodes[1].listreceivedbyaddress(),\n                            {\"address\": addr},\n                            {},\n                            True)\n        # Bury Tx under 10 block so it will be returned by listreceivedbyaddress\n        self.nodes[1].generate(10)\n        self.sync_all()\n        assert_array_result(self.nodes[1].listreceivedbyaddress(),\n                            {\"address\": addr},\n                            {\"address\": addr, \"account\": \"\", \"amount\": Decimal(\"0.1\"), \"confirmations\": 10, \"txids\": [txid, ]})\n        # With min confidence < 10\n        assert_array_result(self.nodes[1].listreceivedbyaddress(5),\n                            {\"address\": addr},\n                            {\"address\": addr, \"account\": \"\", \"amount\": Decimal(\"0.1\"), \"confirmations\": 10, \"txids\": [txid, ]})\n        # With min confidence > 10, should not find Tx\n        assert_array_result(self.nodes[1].listreceivedbyaddress(11), {\"address\": addr}, {}, True)\n\n        # Empty Tx\n        addr = self.nodes[1].getnewaddress()\n        assert_array_result(self.nodes[1].listreceivedbyaddress(0, True),\n                            {\"address\": addr},\n                            {\"address\": addr, \"account\": \"\", \"amount\": 0, \"confirmations\": 0, \"txids\": []})\n\n        self.log.info(\"getreceivedbyaddress Test\")\n\n        # Send from node 0 to 1\n        addr = self.nodes[1].getnewaddress()\n        txid = self.nodes[0].sendtoaddress(addr, 0.1)\n        self.sync_all()\n\n        # Check balance is 0 because of 0 confirmations\n        balance = self.nodes[1].getreceivedbyaddress(addr)\n        assert_equal(balance, Decimal(\"0.0\"))\n\n        # Check balance is 0.1\n        balance = self.nodes[1].getreceivedbyaddress(addr, 0)\n        assert_equal(balance, Decimal(\"0.1\"))\n\n        # Bury Tx under 10 block so it will be returned by the default getreceivedbyaddress\n        self.nodes[1].generate(10)\n        self.sync_all()\n        balance = self.nodes[1].getreceivedbyaddress(addr)\n        assert_equal(balance, Decimal(\"0.1\"))\n\n        # Trying to getreceivedby for an address the wallet doesn't own should return an error\n        assert_raises_rpc_error(-4, \"Address not found in wallet\", self.nodes[0].getreceivedbyaddress, addr)\n\n        self.log.info(\"listreceivedbyaccount + getreceivedbyaccount Test\")\n\n        # set pre-state\n        addrArr = self.nodes[1].getnewaddress()\n        account = self.nodes[1].getaccount(addrArr)\n        received_by_account_json = [r for r in self.nodes[1].listreceivedbyaccount() if r[\"account\"] == account][0]\n        balance_by_account = self.nodes[1].getreceivedbyaccount(account)\n\n        txid = self.nodes[0].sendtoaddress(addr, 0.1)\n        self.sync_all()\n\n        # listreceivedbyaccount should return received_by_account_json because of 0 confirmations\n        assert_array_result(self.nodes[1].listreceivedbyaccount(),\n                            {\"account\": account},\n                            received_by_account_json)\n\n        # getreceivedbyaddress should return same balance because of 0 confirmations\n        balance = self.nodes[1].getreceivedbyaccount(account)\n        assert_equal(balance, balance_by_account)\n\n        self.nodes[1].generate(10)\n        self.sync_all()\n        # listreceivedbyaccount should return updated account balance\n        assert_array_result(self.nodes[1].listreceivedbyaccount(),\n                            {\"account\": account},\n                            {\"account\": received_by_account_json[\"account\"], \"amount\": (received_by_account_json[\"amount\"] + Decimal(\"0.1\"))})\n\n        # getreceivedbyaddress should return updates balance\n        balance = self.nodes[1].getreceivedbyaccount(account)\n        assert_equal(balance, balance_by_account + Decimal(\"0.1\"))\n\n        # Create a new account named \"mynewaccount\" that has a 0 balance\n        self.nodes[1].getaccountaddress(\"mynewaccount\")\n        received_by_account_json = [r for r in self.nodes[1].listreceivedbyaccount(0, True) if r[\"account\"] == \"mynewaccount\"][0]\n\n        # Test includeempty of listreceivedbyaccount\n        assert_equal(received_by_account_json[\"amount\"], Decimal(\"0.0\"))\n\n        # Test getreceivedbyaccount for 0 amount accounts\n        balance = self.nodes[1].getreceivedbyaccount(\"mynewaccount\")\n        assert_equal(balance, Decimal(\"0.0\"))\n\nif __name__ == '__main__':\n    ReceivedByTest().main()\n"
  },
  {
    "path": "test/functional/wallet_listsinceblock.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the listsincelast RPC.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal, assert_array_result, assert_raises_rpc_error\n\nclass ListSinceBlockTest (BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 4\n        self.setup_clean_chain = True\n\n    def run_test(self):\n        self.nodes[2].generate(101)\n        self.sync_all()\n\n        self.test_no_blockhash()\n        self.test_invalid_blockhash()\n        self.test_reorg()\n        self.test_double_spend()\n        self.test_double_send()\n\n    def test_no_blockhash(self):\n        txid = self.nodes[2].sendtoaddress(self.nodes[0].getnewaddress(), 1)\n        blockhash, = self.nodes[2].generate(1)\n        self.sync_all()\n\n        txs = self.nodes[0].listtransactions()\n        assert_array_result(txs, {\"txid\": txid}, {\n            \"category\": \"receive\",\n            \"amount\": 1,\n            \"blockhash\": blockhash,\n            \"confirmations\": 1,\n        })\n        assert_equal(\n            self.nodes[0].listsinceblock(),\n            {\"lastblock\": blockhash,\n             \"removed\": [],\n             \"transactions\": txs})\n        assert_equal(\n            self.nodes[0].listsinceblock(\"\"),\n            {\"lastblock\": blockhash,\n             \"removed\": [],\n             \"transactions\": txs})\n\n    def test_invalid_blockhash(self):\n        assert_raises_rpc_error(-5, \"Block not found\", self.nodes[0].listsinceblock,\n                                \"42759cde25462784395a337460bde75f58e73d3f08bd31fdc3507cbac856a2c4\")\n        assert_raises_rpc_error(-5, \"Block not found\", self.nodes[0].listsinceblock,\n                                \"0000000000000000000000000000000000000000000000000000000000000000\")\n        assert_raises_rpc_error(-5, \"Block not found\", self.nodes[0].listsinceblock,\n                                \"invalid-hex\")\n\n    def test_reorg(self):\n        '''\n        `listsinceblock` did not behave correctly when handed a block that was\n        no longer in the main chain:\n\n             ab0\n          /       \\\n        aa1 [tx0]   bb1\n         |           |\n        aa2         bb2\n         |           |\n        aa3         bb3\n                     |\n                    bb4\n\n        Consider a client that has only seen block `aa3` above. It asks the node\n        to `listsinceblock aa3`. But at some point prior the main chain switched\n        to the bb chain.\n\n        Previously: listsinceblock would find height=4 for block aa3 and compare\n        this to height=5 for the tip of the chain (bb4). It would then return\n        results restricted to bb3-bb4.\n\n        Now: listsinceblock finds the fork at ab0 and returns results in the\n        range bb1-bb4.\n\n        This test only checks that [tx0] is present.\n        '''\n\n        # Split network into two\n        self.split_network()\n\n        # send to nodes[0] from nodes[2]\n        senttx = self.nodes[2].sendtoaddress(self.nodes[0].getnewaddress(), 1)\n\n        # generate on both sides\n        lastblockhash = self.nodes[1].generate(6)[5]\n        self.nodes[2].generate(7)\n        self.log.info('lastblockhash=%s' % (lastblockhash))\n\n        self.sync_all([self.nodes[:2], self.nodes[2:]])\n\n        self.join_network()\n\n        # listsinceblock(lastblockhash) should now include tx, as seen from nodes[0]\n        lsbres = self.nodes[0].listsinceblock(lastblockhash)\n        found = False\n        for tx in lsbres['transactions']:\n            if tx['txid'] == senttx:\n                found = True\n                break\n        assert found\n\n    def test_double_spend(self):\n        '''\n        This tests the case where the same UTXO is spent twice on two separate\n        blocks as part of a reorg.\n\n             ab0\n          /       \\\n        aa1 [tx1]   bb1 [tx2]\n         |           |\n        aa2         bb2\n         |           |\n        aa3         bb3\n                     |\n                    bb4\n\n        Problematic case:\n\n        1. User 1 receives BTC in tx1 from utxo1 in block aa1.\n        2. User 2 receives BTC in tx2 from utxo1 (same) in block bb1\n        3. User 1 sees 2 confirmations at block aa3.\n        4. Reorg into bb chain.\n        5. User 1 asks `listsinceblock aa3` and does not see that tx1 is now\n           invalidated.\n\n        Currently the solution to this is to detect that a reorg'd block is\n        asked for in listsinceblock, and to iterate back over existing blocks up\n        until the fork point, and to include all transactions that relate to the\n        node wallet.\n        '''\n\n        self.sync_all()\n\n        # Split network into two\n        self.split_network()\n\n        # share utxo between nodes[1] and nodes[2]\n        utxos = self.nodes[2].listunspent()\n        utxo = utxos[0]\n        privkey = self.nodes[2].dumpprivkey(utxo['address'])\n        self.nodes[1].importprivkey(privkey)\n\n        # send from nodes[1] using utxo to nodes[0]\n        change = '%.8f' % (float(utxo['amount']) - 1.0003)\n        recipientDict = {\n            self.nodes[0].getnewaddress(): 1,\n            self.nodes[1].getnewaddress(): change,\n        }\n        utxoDicts = [{\n            'txid': utxo['txid'],\n            'vout': utxo['vout'],\n        }]\n        txid1 = self.nodes[1].sendrawtransaction(\n            self.nodes[1].signrawtransaction(\n                self.nodes[1].createrawtransaction(utxoDicts, recipientDict))['hex'])\n\n        # send from nodes[2] using utxo to nodes[3]\n        recipientDict2 = {\n            self.nodes[3].getnewaddress(): 1,\n            self.nodes[2].getnewaddress(): change,\n        }\n        self.nodes[2].sendrawtransaction(\n            self.nodes[2].signrawtransaction(\n                self.nodes[2].createrawtransaction(utxoDicts, recipientDict2))['hex'])\n\n        # generate on both sides\n        lastblockhash = self.nodes[1].generate(3)[2]\n        self.nodes[2].generate(4)\n\n        self.join_network()\n\n        self.sync_all()\n\n        # gettransaction should work for txid1\n        assert self.nodes[0].gettransaction(txid1)['txid'] == txid1, \"gettransaction failed to find txid1\"\n\n        # listsinceblock(lastblockhash) should now include txid1, as seen from nodes[0]\n        lsbres = self.nodes[0].listsinceblock(lastblockhash)\n        assert any(tx['txid'] == txid1 for tx in lsbres['removed'])\n\n        # but it should not include 'removed' if include_removed=false\n        lsbres2 = self.nodes[0].listsinceblock(blockhash=lastblockhash, include_removed=False)\n        assert 'removed' not in lsbres2\n\n    def test_double_send(self):\n        '''\n        This tests the case where the same transaction is submitted twice on two\n        separate blocks as part of a reorg. The former will vanish and the\n        latter will appear as the true transaction (with confirmations dropping\n        as a result).\n\n             ab0\n          /       \\\n        aa1 [tx1]   bb1\n         |           |\n        aa2         bb2\n         |           |\n        aa3         bb3 [tx1]\n                     |\n                    bb4\n\n        Asserted:\n\n        1. tx1 is listed in listsinceblock.\n        2. It is included in 'removed' as it was removed, even though it is now\n           present in a different block.\n        3. It is listed with a confirmations count of 2 (bb3, bb4), not\n           3 (aa1, aa2, aa3).\n        '''\n\n        self.sync_all()\n\n        # Split network into two\n        self.split_network()\n\n        # create and sign a transaction\n        utxos = self.nodes[2].listunspent()\n        utxo = utxos[0]\n        change = '%.8f' % (float(utxo['amount']) - 1.0003)\n        recipientDict = {\n            self.nodes[0].getnewaddress(): 1,\n            self.nodes[2].getnewaddress(): change,\n        }\n        utxoDicts = [{\n            'txid': utxo['txid'],\n            'vout': utxo['vout'],\n        }]\n        signedtxres = self.nodes[2].signrawtransaction(\n                self.nodes[2].createrawtransaction(utxoDicts, recipientDict))\n        assert signedtxres['complete']\n\n        signedtx = signedtxres['hex']\n\n        # send from nodes[1]; this will end up in aa1\n        txid1 = self.nodes[1].sendrawtransaction(signedtx)\n\n        # generate bb1-bb2 on right side\n        self.nodes[2].generate(2)\n\n        # send from nodes[2]; this will end up in bb3\n        txid2 = self.nodes[2].sendrawtransaction(signedtx)\n\n        assert_equal(txid1, txid2)\n\n        # generate on both sides\n        lastblockhash = self.nodes[1].generate(3)[2]\n        self.nodes[2].generate(2)\n\n        self.join_network()\n\n        self.sync_all()\n\n        # gettransaction should work for txid1\n        self.nodes[0].gettransaction(txid1)\n\n        # listsinceblock(lastblockhash) should now include txid1 in transactions\n        # as well as in removed\n        lsbres = self.nodes[0].listsinceblock(lastblockhash)\n        assert any(tx['txid'] == txid1 for tx in lsbres['transactions'])\n        assert any(tx['txid'] == txid1 for tx in lsbres['removed'])\n\n        # find transaction and ensure confirmations is valid\n        for tx in lsbres['transactions']:\n            if tx['txid'] == txid1:\n                assert_equal(tx['confirmations'], 2)\n\n        # the same check for the removed array; confirmations should STILL be 2\n        for tx in lsbres['removed']:\n            if tx['txid'] == txid1:\n                assert_equal(tx['confirmations'], 2)\n\nif __name__ == '__main__':\n    ListSinceBlockTest().main()\n"
  },
  {
    "path": "test/functional/wallet_multiwallet.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test multiwallet.\n\nVerify that a bitcoind node can load multiple wallet files\n\"\"\"\nimport os\nimport shutil\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal, assert_raises_rpc_error\n\nclass MultiWalletTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 2\n        self.extra_args = [['-wallet=w1', '-wallet=w2', '-wallet=w3', '-wallet=w'], []]\n        self.supports_cli = True\n\n    def run_test(self):\n        node = self.nodes[0]\n\n        data_dir = lambda *p: os.path.join(node.datadir, 'regtest', *p)\n        wallet_dir = lambda *p: data_dir('wallets', *p)\n        wallet = lambda name: node.get_wallet_rpc(name)\n\n        assert_equal(set(node.listwallets()), {\"w1\", \"w2\", \"w3\", \"w\"})\n\n        self.stop_nodes()\n\n        self.assert_start_raises_init_error(0, ['-walletdir=wallets'], 'Error: Specified -walletdir \"wallets\" does not exist')\n        self.assert_start_raises_init_error(0, ['-walletdir=wallets'], 'Error: Specified -walletdir \"wallets\" is a relative path', cwd=data_dir())\n        self.assert_start_raises_init_error(0, ['-walletdir=debug.log'], 'Error: Specified -walletdir \"debug.log\" is not a directory', cwd=data_dir())\n\n        # should not initialize if there are duplicate wallets\n        self.assert_start_raises_init_error(0, ['-wallet=w1', '-wallet=w1'], 'Error loading wallet w1. Duplicate -wallet filename specified.')\n\n        # should not initialize if wallet file is a directory\n        os.mkdir(wallet_dir('w11'))\n        self.assert_start_raises_init_error(0, ['-wallet=w11'], 'Error loading wallet w11. -wallet filename must be a regular file.')\n\n        # should not initialize if one wallet is a copy of another\n        shutil.copyfile(wallet_dir('w2'), wallet_dir('w22'))\n        self.assert_start_raises_init_error(0, ['-wallet=w2', '-wallet=w22'], 'duplicates fileid')\n\n        # should not initialize if wallet file is a symlink\n        os.symlink(wallet_dir('w1'), wallet_dir('w12'))\n        self.assert_start_raises_init_error(0, ['-wallet=w12'], 'Error loading wallet w12. -wallet filename must be a regular file.')\n\n        # should not initialize if the specified walletdir does not exist\n        self.assert_start_raises_init_error(0, ['-walletdir=bad'], 'Error: Specified -walletdir \"bad\" does not exist')\n        # should not initialize if the specified walletdir is not a directory\n        not_a_dir = wallet_dir('notadir')\n        open(not_a_dir, 'a').close()\n        self.assert_start_raises_init_error(0, ['-walletdir=' + not_a_dir], 'Error: Specified -walletdir \"' + not_a_dir + '\" is not a directory')\n\n        self.log.info(\"Do not allow -zapwallettxes with multiwallet\")\n        self.assert_start_raises_init_error(0, ['-zapwallettxes', '-wallet=w1', '-wallet=w2'], \"Error: -zapwallettxes is only allowed with a single wallet file\")\n        self.assert_start_raises_init_error(0, ['-zapwallettxes=1', '-wallet=w1', '-wallet=w2'], \"Error: -zapwallettxes is only allowed with a single wallet file\")\n        self.assert_start_raises_init_error(0, ['-zapwallettxes=2', '-wallet=w1', '-wallet=w2'], \"Error: -zapwallettxes is only allowed with a single wallet file\")\n\n        self.log.info(\"Do not allow -salvagewallet with multiwallet\")\n        self.assert_start_raises_init_error(0, ['-salvagewallet', '-wallet=w1', '-wallet=w2'], \"Error: -salvagewallet is only allowed with a single wallet file\")\n        self.assert_start_raises_init_error(0, ['-salvagewallet=1', '-wallet=w1', '-wallet=w2'], \"Error: -salvagewallet is only allowed with a single wallet file\")\n\n        self.log.info(\"Do not allow -upgradewallet with multiwallet\")\n        self.assert_start_raises_init_error(0, ['-upgradewallet', '-wallet=w1', '-wallet=w2'], \"Error: -upgradewallet is only allowed with a single wallet file\")\n        self.assert_start_raises_init_error(0, ['-upgradewallet=1', '-wallet=w1', '-wallet=w2'], \"Error: -upgradewallet is only allowed with a single wallet file\")\n\n        # if wallets/ doesn't exist, datadir should be the default wallet dir\n        wallet_dir2 = data_dir('walletdir')\n        os.rename(wallet_dir(), wallet_dir2)\n        self.start_node(0, ['-wallet=w4', '-wallet=w5'])\n        assert_equal(set(node.listwallets()), {\"w4\", \"w5\"})\n        w5 = wallet(\"w5\")\n        w5.generate(1)\n\n        # now if wallets/ exists again, but the rootdir is specified as the walletdir, w4 and w5 should still be loaded\n        os.rename(wallet_dir2, wallet_dir())\n        self.restart_node(0, ['-wallet=w4', '-wallet=w5', '-walletdir=' + data_dir()])\n        assert_equal(set(node.listwallets()), {\"w4\", \"w5\"})\n        w5 = wallet(\"w5\")\n        w5_info = w5.getwalletinfo()\n        assert_equal(w5_info['immature_balance'], 50)\n\n        competing_wallet_dir = os.path.join(self.options.tmpdir, 'competing_walletdir')\n        os.mkdir(competing_wallet_dir)\n        self.restart_node(0, ['-walletdir='+competing_wallet_dir])\n        self.assert_start_raises_init_error(1, ['-walletdir='+competing_wallet_dir], 'Error initializing wallet database environment')\n\n        self.restart_node(0, self.extra_args[0])\n\n        w1 = wallet(\"w1\")\n        w2 = wallet(\"w2\")\n        w3 = wallet(\"w3\")\n        w4 = wallet(\"w\")\n        wallet_bad = wallet(\"bad\")\n\n        w1.generate(1)\n\n        # accessing invalid wallet fails\n        assert_raises_rpc_error(-18, \"Requested wallet does not exist or is not loaded\", wallet_bad.getwalletinfo)\n\n        # accessing wallet RPC without using wallet endpoint fails\n        assert_raises_rpc_error(-19, \"Wallet file not specified\", node.getwalletinfo)\n\n        # check w1 wallet balance\n        w1_info = w1.getwalletinfo()\n        assert_equal(w1_info['immature_balance'], 50)\n        w1_name = w1_info['walletname']\n        assert_equal(w1_name, \"w1\")\n\n        # check w2 wallet balance\n        w2_info = w2.getwalletinfo()\n        assert_equal(w2_info['immature_balance'], 0)\n        w2_name = w2_info['walletname']\n        assert_equal(w2_name, \"w2\")\n\n        w3_name = w3.getwalletinfo()['walletname']\n        assert_equal(w3_name, \"w3\")\n\n        w4_name = w4.getwalletinfo()['walletname']\n        assert_equal(w4_name, \"w\")\n\n        w1.generate(101)\n        assert_equal(w1.getbalance(), 100)\n        assert_equal(w2.getbalance(), 0)\n        assert_equal(w3.getbalance(), 0)\n        assert_equal(w4.getbalance(), 0)\n\n        w1.sendtoaddress(w2.getnewaddress(), 1)\n        w1.sendtoaddress(w3.getnewaddress(), 2)\n        w1.sendtoaddress(w4.getnewaddress(), 3)\n        w1.generate(1)\n        assert_equal(w2.getbalance(), 1)\n        assert_equal(w3.getbalance(), 2)\n        assert_equal(w4.getbalance(), 3)\n\n        batch = w1.batch([w1.getblockchaininfo.get_request(), w1.getwalletinfo.get_request()])\n        assert_equal(batch[0][\"result\"][\"chain\"], \"regtest\")\n        assert_equal(batch[1][\"result\"][\"walletname\"], \"w1\")\n\nif __name__ == '__main__':\n    MultiWalletTest().main()\n"
  },
  {
    "path": "test/functional/wallet_resendwallettransactions.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test resendwallettransactions RPC.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import assert_equal, assert_raises_rpc_error\n\nclass ResendWalletTransactionsTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 1\n        self.extra_args = [['--walletbroadcast=false']]\n\n    def run_test(self):\n        # Should raise RPC_WALLET_ERROR (-4) if walletbroadcast is disabled.\n        assert_raises_rpc_error(-4, \"Error: Wallet transaction broadcasting is disabled with -walletbroadcast\", self.nodes[0].resendwallettransactions)\n\n        # Should return an empty array if there aren't unconfirmed wallet transactions.\n        self.stop_node(0)\n        self.start_node(0, extra_args=[])\n        assert_equal(self.nodes[0].resendwallettransactions(), [])\n\n        # Should return an array with the unconfirmed wallet transaction.\n        txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)\n        assert_equal(self.nodes[0].resendwallettransactions(), [txid])\n\nif __name__ == '__main__':\n    ResendWalletTransactionsTest().main()\n"
  },
  {
    "path": "test/functional/wallet_txn_clone.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass TxnMallTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 4\n\n    def add_options(self, parser):\n        parser.add_option(\"--mineblock\", dest=\"mine_block\", default=False, action=\"store_true\",\n                          help=\"Test double-spend of 1-confirmed transaction\")\n        parser.add_option(\"--segwit\", dest=\"segwit\", default=False, action=\"store_true\",\n                          help=\"Test behaviour with SegWit txn (which should fail\")\n\n    def setup_network(self):\n        # Start with split network:\n        super(TxnMallTest, self).setup_network()\n        disconnect_nodes(self.nodes[1], 2)\n        disconnect_nodes(self.nodes[2], 1)\n\n    def run_test(self):\n        if self.options.segwit:\n            output_type=\"p2sh-segwit\"\n        else:\n            output_type=\"legacy\"\n\n        # All nodes should start with 1,250 BTC:\n        starting_balance = 1250\n        for i in range(4):\n            assert_equal(self.nodes[i].getbalance(), starting_balance)\n            self.nodes[i].getnewaddress(\"\")  # bug workaround, coins generated assigned to first getnewaddress!\n\n        # Assign coins to foo and bar accounts:\n        self.nodes[0].settxfee(.001)\n\n        node0_address_foo = self.nodes[0].getnewaddress(\"foo\", output_type)\n        fund_foo_txid = self.nodes[0].sendfrom(\"\", node0_address_foo, 1219)\n        fund_foo_tx = self.nodes[0].gettransaction(fund_foo_txid)\n\n        node0_address_bar = self.nodes[0].getnewaddress(\"bar\", output_type)\n        fund_bar_txid = self.nodes[0].sendfrom(\"\", node0_address_bar, 29)\n        fund_bar_tx = self.nodes[0].gettransaction(fund_bar_txid)\n\n        assert_equal(self.nodes[0].getbalance(\"\"),\n                     starting_balance - 1219 - 29 + fund_foo_tx[\"fee\"] + fund_bar_tx[\"fee\"])\n\n        # Coins are sent to node1_address\n        node1_address = self.nodes[1].getnewaddress(\"from0\")\n\n        # Send tx1, and another transaction tx2 that won't be cloned \n        txid1 = self.nodes[0].sendfrom(\"foo\", node1_address, 40, 0)\n        txid2 = self.nodes[0].sendfrom(\"bar\", node1_address, 20, 0)\n\n        # Construct a clone of tx1, to be malleated \n        rawtx1 = self.nodes[0].getrawtransaction(txid1,1)\n        clone_inputs = [{\"txid\":rawtx1[\"vin\"][0][\"txid\"],\"vout\":rawtx1[\"vin\"][0][\"vout\"]}]\n        clone_outputs = {rawtx1[\"vout\"][0][\"scriptPubKey\"][\"addresses\"][0]:rawtx1[\"vout\"][0][\"value\"],\n                         rawtx1[\"vout\"][1][\"scriptPubKey\"][\"addresses\"][0]:rawtx1[\"vout\"][1][\"value\"]}\n        clone_locktime = rawtx1[\"locktime\"]\n        clone_raw = self.nodes[0].createrawtransaction(clone_inputs, clone_outputs, clone_locktime)\n\n        # createrawtransaction randomizes the order of its outputs, so swap them if necessary.\n        # output 0 is at version+#inputs+input+sigstub+sequence+#outputs\n        # 40 BTC serialized is 00286bee00000000\n        pos0 = 2*(4+1+36+1+4+1)\n        hex40 = \"00286bee00000000\"\n        output_len = 16 + 2 + 2 * int(\"0x\" + clone_raw[pos0 + 16 : pos0 + 16 + 2], 0)\n        if (rawtx1[\"vout\"][0][\"value\"] == 40 and clone_raw[pos0 : pos0 + 16] != hex40 or\n            rawtx1[\"vout\"][0][\"value\"] != 40 and clone_raw[pos0 : pos0 + 16] == hex40):\n            output0 = clone_raw[pos0 : pos0 + output_len]\n            output1 = clone_raw[pos0 + output_len : pos0 + 2 * output_len]\n            clone_raw = clone_raw[:pos0] + output1 + output0 + clone_raw[pos0 + 2 * output_len:]\n\n        # Use a different signature hash type to sign.  This creates an equivalent but malleated clone.\n        # Don't send the clone anywhere yet\n        tx1_clone = self.nodes[0].signrawtransaction(clone_raw, None, None, \"ALL|ANYONECANPAY\")\n        assert_equal(tx1_clone[\"complete\"], True)\n\n        # Have node0 mine a block, if requested:\n        if (self.options.mine_block):\n            self.nodes[0].generate(1)\n            sync_blocks(self.nodes[0:2])\n\n        tx1 = self.nodes[0].gettransaction(txid1)\n        tx2 = self.nodes[0].gettransaction(txid2)\n\n        # Node0's balance should be starting balance, plus 50BTC for another\n        # matured block, minus tx1 and tx2 amounts, and minus transaction fees:\n        expected = starting_balance + fund_foo_tx[\"fee\"] + fund_bar_tx[\"fee\"]\n        if self.options.mine_block: expected += 50\n        expected += tx1[\"amount\"] + tx1[\"fee\"]\n        expected += tx2[\"amount\"] + tx2[\"fee\"]\n        assert_equal(self.nodes[0].getbalance(), expected)\n\n        # foo and bar accounts should be debited:\n        assert_equal(self.nodes[0].getbalance(\"foo\", 0), 1219 + tx1[\"amount\"] + tx1[\"fee\"])\n        assert_equal(self.nodes[0].getbalance(\"bar\", 0), 29 + tx2[\"amount\"] + tx2[\"fee\"])\n\n        if self.options.mine_block:\n            assert_equal(tx1[\"confirmations\"], 1)\n            assert_equal(tx2[\"confirmations\"], 1)\n            # Node1's \"from0\" balance should be both transaction amounts:\n            assert_equal(self.nodes[1].getbalance(\"from0\"), -(tx1[\"amount\"] + tx2[\"amount\"]))\n        else:\n            assert_equal(tx1[\"confirmations\"], 0)\n            assert_equal(tx2[\"confirmations\"], 0)\n\n        # Send clone and its parent to miner\n        self.nodes[2].sendrawtransaction(fund_foo_tx[\"hex\"])\n        txid1_clone = self.nodes[2].sendrawtransaction(tx1_clone[\"hex\"])\n        if self.options.segwit:\n            assert_equal(txid1, txid1_clone)\n            return\n\n        # ... mine a block...\n        self.nodes[2].generate(1)\n\n        # Reconnect the split network, and sync chain:\n        connect_nodes(self.nodes[1], 2)\n        self.nodes[2].sendrawtransaction(fund_bar_tx[\"hex\"])\n        self.nodes[2].sendrawtransaction(tx2[\"hex\"])\n        self.nodes[2].generate(1)  # Mine another block to make sure we sync\n        sync_blocks(self.nodes)\n\n        # Re-fetch transaction info:\n        tx1 = self.nodes[0].gettransaction(txid1)\n        tx1_clone = self.nodes[0].gettransaction(txid1_clone)\n        tx2 = self.nodes[0].gettransaction(txid2)\n        \n        # Verify expected confirmations\n        assert_equal(tx1[\"confirmations\"], -2)\n        assert_equal(tx1_clone[\"confirmations\"], 2)\n        assert_equal(tx2[\"confirmations\"], 1)\n\n        # Check node0's total balance; should be same as before the clone, + 100 BTC for 2 matured,\n        # less possible orphaned matured subsidy\n        expected += 100\n        if (self.options.mine_block): \n            expected -= 50\n        assert_equal(self.nodes[0].getbalance(), expected)\n        assert_equal(self.nodes[0].getbalance(\"*\", 0), expected)\n\n        # Check node0's individual account balances.\n        # \"foo\" should have been debited by the equivalent clone of tx1\n        assert_equal(self.nodes[0].getbalance(\"foo\"), 1219 + tx1[\"amount\"] + tx1[\"fee\"])\n        # \"bar\" should have been debited by (possibly unconfirmed) tx2\n        assert_equal(self.nodes[0].getbalance(\"bar\", 0), 29 + tx2[\"amount\"] + tx2[\"fee\"])\n        # \"\" should have starting balance, less funding txes, plus subsidies\n        assert_equal(self.nodes[0].getbalance(\"\", 0), starting_balance\n                                                                - 1219\n                                                                + fund_foo_tx[\"fee\"]\n                                                                -   29\n                                                                + fund_bar_tx[\"fee\"]\n                                                                +  100)\n\n        # Node1's \"from0\" account balance\n        assert_equal(self.nodes[1].getbalance(\"from0\", 0), -(tx1[\"amount\"] + tx2[\"amount\"]))\n\nif __name__ == '__main__':\n    TxnMallTest().main()\n\n"
  },
  {
    "path": "test/functional/wallet_txn_doublespend.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the wallet accounts properly when there is a double-spend conflict.\"\"\"\n\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import *\n\nclass TxnMallTest(BitcoinTestFramework):\n    def set_test_params(self):\n        self.num_nodes = 4\n\n    def add_options(self, parser):\n        parser.add_option(\"--mineblock\", dest=\"mine_block\", default=False, action=\"store_true\",\n                          help=\"Test double-spend of 1-confirmed transaction\")\n\n    def setup_network(self):\n        # Start with split network:\n        super().setup_network()\n        disconnect_nodes(self.nodes[1], 2)\n        disconnect_nodes(self.nodes[2], 1)\n\n    def run_test(self):\n        # All nodes should start with 1,250 BTC:\n        starting_balance = 1250\n        for i in range(4):\n            assert_equal(self.nodes[i].getbalance(), starting_balance)\n            self.nodes[i].getnewaddress(\"\")  # bug workaround, coins generated assigned to first getnewaddress!\n        \n        # Assign coins to foo and bar accounts:\n        node0_address_foo = self.nodes[0].getnewaddress(\"foo\")\n        fund_foo_txid = self.nodes[0].sendfrom(\"\", node0_address_foo, 1219)\n        fund_foo_tx = self.nodes[0].gettransaction(fund_foo_txid)\n\n        node0_address_bar = self.nodes[0].getnewaddress(\"bar\")\n        fund_bar_txid = self.nodes[0].sendfrom(\"\", node0_address_bar, 29)\n        fund_bar_tx = self.nodes[0].gettransaction(fund_bar_txid)\n\n        assert_equal(self.nodes[0].getbalance(\"\"),\n                     starting_balance - 1219 - 29 + fund_foo_tx[\"fee\"] + fund_bar_tx[\"fee\"])\n\n        # Coins are sent to node1_address\n        node1_address = self.nodes[1].getnewaddress(\"from0\")\n\n        # First: use raw transaction API to send 1240 BTC to node1_address,\n        # but don't broadcast:\n        doublespend_fee = Decimal('-.02')\n        rawtx_input_0 = {}\n        rawtx_input_0[\"txid\"] = fund_foo_txid\n        rawtx_input_0[\"vout\"] = find_output(self.nodes[0], fund_foo_txid, 1219)\n        rawtx_input_1 = {}\n        rawtx_input_1[\"txid\"] = fund_bar_txid\n        rawtx_input_1[\"vout\"] = find_output(self.nodes[0], fund_bar_txid, 29)\n        inputs = [rawtx_input_0, rawtx_input_1]\n        change_address = self.nodes[0].getnewaddress()\n        outputs = {}\n        outputs[node1_address] = 1240\n        outputs[change_address] = 1248 - 1240 + doublespend_fee\n        rawtx = self.nodes[0].createrawtransaction(inputs, outputs)\n        doublespend = self.nodes[0].signrawtransaction(rawtx)\n        assert_equal(doublespend[\"complete\"], True)\n\n        # Create two spends using 1 50 BTC coin each\n        txid1 = self.nodes[0].sendfrom(\"foo\", node1_address, 40, 0)\n        txid2 = self.nodes[0].sendfrom(\"bar\", node1_address, 20, 0)\n        \n        # Have node0 mine a block:\n        if (self.options.mine_block):\n            self.nodes[0].generate(1)\n            sync_blocks(self.nodes[0:2])\n\n        tx1 = self.nodes[0].gettransaction(txid1)\n        tx2 = self.nodes[0].gettransaction(txid2)\n\n        # Node0's balance should be starting balance, plus 50BTC for another\n        # matured block, minus 40, minus 20, and minus transaction fees:\n        expected = starting_balance + fund_foo_tx[\"fee\"] + fund_bar_tx[\"fee\"]\n        if self.options.mine_block: expected += 50\n        expected += tx1[\"amount\"] + tx1[\"fee\"]\n        expected += tx2[\"amount\"] + tx2[\"fee\"]\n        assert_equal(self.nodes[0].getbalance(), expected)\n\n        # foo and bar accounts should be debited:\n        assert_equal(self.nodes[0].getbalance(\"foo\", 0), 1219+tx1[\"amount\"]+tx1[\"fee\"])\n        assert_equal(self.nodes[0].getbalance(\"bar\", 0), 29+tx2[\"amount\"]+tx2[\"fee\"])\n\n        if self.options.mine_block:\n            assert_equal(tx1[\"confirmations\"], 1)\n            assert_equal(tx2[\"confirmations\"], 1)\n            # Node1's \"from0\" balance should be both transaction amounts:\n            assert_equal(self.nodes[1].getbalance(\"from0\"), -(tx1[\"amount\"]+tx2[\"amount\"]))\n        else:\n            assert_equal(tx1[\"confirmations\"], 0)\n            assert_equal(tx2[\"confirmations\"], 0)\n        \n        # Now give doublespend and its parents to miner:\n        self.nodes[2].sendrawtransaction(fund_foo_tx[\"hex\"])\n        self.nodes[2].sendrawtransaction(fund_bar_tx[\"hex\"])\n        doublespend_txid = self.nodes[2].sendrawtransaction(doublespend[\"hex\"])\n        # ... mine a block...\n        self.nodes[2].generate(1)\n\n        # Reconnect the split network, and sync chain:\n        connect_nodes(self.nodes[1], 2)\n        self.nodes[2].generate(1)  # Mine another block to make sure we sync\n        sync_blocks(self.nodes)\n        assert_equal(self.nodes[0].gettransaction(doublespend_txid)[\"confirmations\"], 2)\n\n        # Re-fetch transaction info:\n        tx1 = self.nodes[0].gettransaction(txid1)\n        tx2 = self.nodes[0].gettransaction(txid2)\n\n        # Both transactions should be conflicted\n        assert_equal(tx1[\"confirmations\"], -2)\n        assert_equal(tx2[\"confirmations\"], -2)\n\n        # Node0's total balance should be starting balance, plus 100BTC for \n        # two more matured blocks, minus 1240 for the double-spend, plus fees (which are\n        # negative):\n        expected = starting_balance + 100 - 1240 + fund_foo_tx[\"fee\"] + fund_bar_tx[\"fee\"] + doublespend_fee\n        assert_equal(self.nodes[0].getbalance(), expected)\n        assert_equal(self.nodes[0].getbalance(\"*\"), expected)\n\n        # Final \"\" balance is starting_balance - amount moved to accounts - doublespend + subsidies +\n        # fees (which are negative)\n        assert_equal(self.nodes[0].getbalance(\"foo\"), 1219)\n        assert_equal(self.nodes[0].getbalance(\"bar\"), 29)\n        assert_equal(self.nodes[0].getbalance(\"\"), starting_balance\n                                                              -1219\n                                                              -  29\n                                                              -1240\n                                                              + 100\n                                                              + fund_foo_tx[\"fee\"]\n                                                              + fund_bar_tx[\"fee\"]\n                                                              + doublespend_fee)\n\n        # Node1's \"from0\" account balance should be just the doublespend:\n        assert_equal(self.nodes[1].getbalance(\"from0\"), 1240)\n\nif __name__ == '__main__':\n    TxnMallTest().main()\n\n"
  },
  {
    "path": "test/functional/wallet_zapwallettxes.py",
    "content": "#!/usr/bin/env python3\n# Copyright (c) 2014-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test the zapwallettxes functionality.\n\n- start two bitcoind nodes\n- create two transactions on node 0 - one is confirmed and one is unconfirmed.\n- restart node 0 and verify that both the confirmed and the unconfirmed\n  transactions are still available.\n- restart node 0 with zapwallettxes and persistmempool, and verify that both\n  the confirmed and the unconfirmed transactions are still available.\n- restart node 0 with just zapwallettxes and verify that the confirmed\n  transactions are still available, but that the unconfirmed transaction has\n  been zapped.\n\"\"\"\nfrom test_framework.test_framework import BitcoinTestFramework\nfrom test_framework.util import (\n    assert_equal,\n    assert_raises_rpc_error,\n    wait_until,\n)\n\nclass ZapWalletTXesTest (BitcoinTestFramework):\n    def set_test_params(self):\n        self.setup_clean_chain = True\n        self.num_nodes = 2\n\n    def run_test(self):\n        self.log.info(\"Mining blocks...\")\n        self.nodes[0].generate(1)\n        self.sync_all()\n        self.nodes[1].generate(100)\n        self.sync_all()\n\n        # This transaction will be confirmed\n        txid1 = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 10)\n\n        self.nodes[0].generate(1)\n        self.sync_all()\n\n        # This transaction will not be confirmed\n        txid2 = self.nodes[0].sendtoaddress(self.nodes[1].getnewaddress(), 20)\n\n        # Confirmed and unconfirmed transactions are now in the wallet.\n        assert_equal(self.nodes[0].gettransaction(txid1)['txid'], txid1)\n        assert_equal(self.nodes[0].gettransaction(txid2)['txid'], txid2)\n\n        # Stop-start node0. Both confirmed and unconfirmed transactions remain in the wallet.\n        self.stop_node(0)\n        self.start_node(0)\n\n        assert_equal(self.nodes[0].gettransaction(txid1)['txid'], txid1)\n        assert_equal(self.nodes[0].gettransaction(txid2)['txid'], txid2)\n\n        # Stop node0 and restart with zapwallettxes and persistmempool. The unconfirmed\n        # transaction is zapped from the wallet, but is re-added when the mempool is reloaded.\n        self.stop_node(0)\n        self.start_node(0, [\"-persistmempool=1\", \"-zapwallettxes=2\"])\n\n        wait_until(lambda: self.nodes[0].getmempoolinfo()['size'] == 1, timeout=3)\n        self.nodes[0].syncwithvalidationinterfacequeue()  # Flush mempool to wallet\n\n        assert_equal(self.nodes[0].gettransaction(txid1)['txid'], txid1)\n        assert_equal(self.nodes[0].gettransaction(txid2)['txid'], txid2)\n\n        # Stop node0 and restart with zapwallettxes, but not persistmempool.\n        # The unconfirmed transaction is zapped and is no longer in the wallet.\n        self.stop_node(0)\n        self.start_node(0, [\"-zapwallettxes=2\"])\n\n        # tx1 is still be available because it was confirmed\n        assert_equal(self.nodes[0].gettransaction(txid1)['txid'], txid1)\n\n        # This will raise an exception because the unconfirmed transaction has been zapped\n        assert_raises_rpc_error(-5, 'Invalid or non-wallet transaction id', self.nodes[0].gettransaction, txid2)\n\nif __name__ == '__main__':\n    ZapWalletTXesTest().main()\n"
  },
  {
    "path": "test/util/bitcoin-util-test.py",
    "content": "#!/usr/bin/env python3\n# Copyright 2014 BitPay Inc.\n# Copyright 2016-2017 The Bitcoin Core developers\n# Distributed under the MIT software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\"\"\"Test framework for bitcoin utils.\n\nRuns automatically during `make check`.\n\nCan also be run manually.\"\"\"\n\nfrom __future__ import division,print_function,unicode_literals\n\nimport argparse\nimport binascii\ntry:\n    import configparser\nexcept ImportError:\n    import ConfigParser as configparser\nimport difflib\nimport json\nimport logging\nimport os\nimport pprint\nimport subprocess\nimport sys\n\ndef main():\n    config = configparser.ConfigParser()\n    config.optionxform = str\n    config.readfp(open(os.path.join(os.path.dirname(__file__), \"../config.ini\")))\n    env_conf = dict(config.items('environment'))\n\n    parser = argparse.ArgumentParser(description=__doc__)\n    parser.add_argument('-v', '--verbose', action='store_true')\n    args = parser.parse_args()\n    verbose = args.verbose\n\n    if verbose:\n        level = logging.DEBUG\n    else:\n        level = logging.ERROR\n    formatter = '%(asctime)s - %(levelname)s - %(message)s'\n    # Add the format/level to the logger\n    logging.basicConfig(format=formatter, level=level)\n\n    bctester(os.path.join(env_conf[\"SRCDIR\"], \"test/util/data\"), \"bitcoin-util-test.json\", env_conf)\n\ndef bctester(testDir, input_basename, buildenv):\n    \"\"\" Loads and parses the input file, runs all tests and reports results\"\"\"\n    input_filename = os.path.join(testDir, input_basename)\n    raw_data = open(input_filename).read()\n    input_data = json.loads(raw_data)\n\n    failed_testcases = []\n\n    for testObj in input_data:\n        try:\n            bctest(testDir, testObj, buildenv)\n            logging.info(\"PASSED: \" + testObj[\"description\"])\n        except:\n            logging.info(\"FAILED: \" + testObj[\"description\"])\n            failed_testcases.append(testObj[\"description\"])\n\n    if failed_testcases:\n        error_message = \"FAILED_TESTCASES:\\n\"\n        error_message += pprint.pformat(failed_testcases, width=400)\n        logging.error(error_message)\n        sys.exit(1)\n    else:\n        sys.exit(0)\n\ndef bctest(testDir, testObj, buildenv):\n    \"\"\"Runs a single test, comparing output and RC to expected output and RC.\n\n    Raises an error if input can't be read, executable fails, or output/RC\n    are not as expected. Error is caught by bctester() and reported.\n    \"\"\"\n    # Get the exec names and arguments\n    execprog = os.path.join(buildenv[\"BUILDDIR\"], \"src\", testObj[\"exec\"] + buildenv[\"EXEEXT\"])\n    execargs = testObj['args']\n    execrun = [execprog] + execargs\n\n    # Read the input data (if there is any)\n    stdinCfg = None\n    inputData = None\n    if \"input\" in testObj:\n        filename = os.path.join(testDir, testObj[\"input\"])\n        inputData = open(filename).read()\n        stdinCfg = subprocess.PIPE\n\n    # Read the expected output data (if there is any)\n    outputFn = None\n    outputData = None\n    outputType = None\n    if \"output_cmp\" in testObj:\n        outputFn = testObj['output_cmp']\n        outputType = os.path.splitext(outputFn)[1][1:]  # output type from file extension (determines how to compare)\n        try:\n            outputData = open(os.path.join(testDir, outputFn)).read()\n        except:\n            logging.error(\"Output file \" + outputFn + \" can not be opened\")\n            raise\n        if not outputData:\n            logging.error(\"Output data missing for \" + outputFn)\n            raise Exception\n        if not outputType:\n            logging.error(\"Output file %s does not have a file extension\" % outputFn)\n            raise Exception\n\n    # Run the test\n    proc = subprocess.Popen(execrun, stdin=stdinCfg, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)\n    try:\n        outs = proc.communicate(input=inputData)\n    except OSError:\n        logging.error(\"OSError, Failed to execute \" + execprog)\n        raise\n\n    if outputData:\n        data_mismatch, formatting_mismatch = False, False\n        # Parse command output and expected output\n        try:\n            a_parsed = parse_output(outs[0], outputType)\n        except Exception as e:\n            logging.error('Error parsing command output as %s: %s' % (outputType, e))\n            raise\n        try:\n            b_parsed = parse_output(outputData, outputType)\n        except Exception as e:\n            logging.error('Error parsing expected output %s as %s: %s' % (outputFn, outputType, e))\n            raise\n        # Compare data\n        if a_parsed != b_parsed:\n            logging.error(\"Output data mismatch for \" + outputFn + \" (format \" + outputType + \")\")\n            data_mismatch = True\n        # Compare formatting\n        if outs[0] != outputData:\n            error_message = \"Output formatting mismatch for \" + outputFn + \":\\n\"\n            error_message += \"\".join(difflib.context_diff(outputData.splitlines(True),\n                                                          outs[0].splitlines(True),\n                                                          fromfile=outputFn,\n                                                          tofile=\"returned\"))\n            logging.error(error_message)\n            formatting_mismatch = True\n\n        assert not data_mismatch and not formatting_mismatch\n\n    # Compare the return code to the expected return code\n    wantRC = 0\n    if \"return_code\" in testObj:\n        wantRC = testObj['return_code']\n    if proc.returncode != wantRC:\n        logging.error(\"Return code mismatch for \" + outputFn)\n        raise Exception\n\n    if \"error_txt\" in testObj:\n        want_error = testObj[\"error_txt\"]\n        # Compare error text\n        # TODO: ideally, we'd compare the strings exactly and also assert\n        # That stderr is empty if no errors are expected. However, bitcoin-tx\n        # emits DISPLAY errors when running as a windows application on\n        # linux through wine. Just assert that the expected error text appears\n        # somewhere in stderr.\n        if want_error not in outs[1]:\n            logging.error(\"Error mismatch:\\n\" + \"Expected: \" + want_error + \"\\nReceived: \" + outs[1].rstrip())\n            raise Exception\n\ndef parse_output(a, fmt):\n    \"\"\"Parse the output according to specified format.\n\n    Raise an error if the output can't be parsed.\"\"\"\n    if fmt == 'json':  # json: compare parsed data\n        return json.loads(a)\n    elif fmt == 'hex':  # hex: parse and compare binary data\n        return binascii.a2b_hex(a.strip())\n    else:\n        raise NotImplementedError(\"Don't know how to compare %s\" % fmt)\n\nif __name__ == '__main__':\n    main()\n"
  },
  {
    "path": "test/util/data/bitcoin-util-test.json",
    "content": "[\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-create\", \"nversion=1\"],\n    \"output_cmp\": \"blanktxv1.hex\",\n    \"description\": \"Creates a blank v1 transaction\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\",\"-create\", \"nversion=1\"],\n    \"output_cmp\": \"blanktxv1.json\",\n    \"description\": \"Creates a blank v1 transaction (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-\"],\n    \"input\": \"blanktxv2.hex\",\n    \"output_cmp\": \"blanktxv2.hex\",\n    \"description\": \"Creates a blank transaction when nothing is piped into sugarchain-tx\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\",\"-create\"],\n    \"output_cmp\": \"blanktxv2.json\",\n    \"description\": \"Creates a blank transaction (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\",\"-\"],\n    \"input\": \"blanktxv2.hex\",\n    \"output_cmp\": \"blanktxv2.json\",\n    \"description\": \"Creates a blank transaction when nothing is piped into sugarchain-tx (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-\", \"delin=1\"],\n    \"input\": \"tx394b54bb.hex\",\n    \"output_cmp\": \"tt-delin1-out.hex\",\n    \"description\": \"Deletes a single input from a transaction\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-\", \"delin=1\"],\n    \"input\": \"tx394b54bb.hex\",\n    \"output_cmp\": \"tt-delin1-out.json\",\n    \"description\": \"Deletes a single input from a transaction (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-\", \"delin=31\"],\n    \"input\": \"tx394b54bb.hex\",\n    \"return_code\": 1,\n    \"error_txt\": \"error: Invalid TX input index '31'\",\n    \"description\": \"Attempts to delete an input with a bad index from a transaction. Expected to fail.\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-\", \"delout=1\"],\n    \"input\": \"tx394b54bb.hex\",\n    \"output_cmp\": \"tt-delout1-out.hex\",\n    \"description\": \"Deletes a single output from a transaction\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-\", \"delout=1\"],\n    \"input\": \"tx394b54bb.hex\",\n    \"output_cmp\": \"tt-delout1-out.json\",\n    \"description\": \"Deletes a single output from a transaction (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-\", \"delout=2\"],\n    \"input\": \"tx394b54bb.hex\",\n    \"return_code\": 1,\n    \"error_txt\": \"error: Invalid TX output index '2'\",\n    \"description\": \"Attempts to delete an output with a bad index from a transaction. Expected to fail.\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-\", \"locktime=317000\"],\n    \"input\": \"tx394b54bb.hex\",\n    \"output_cmp\": \"tt-locktime317000-out.hex\",\n    \"description\": \"Adds an nlocktime to a transaction\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-\", \"locktime=317000\"],\n    \"input\": \"tx394b54bb.hex\",\n    \"output_cmp\": \"tt-locktime317000-out.json\",\n    \"description\": \"Adds an nlocktime to a transaction (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n     \"outaddr=1\"],\n    \"return_code\": 1,\n    \"error_txt\": \"error: TX output missing or too many separators\",\n    \"description\": \"Malformed outaddr argument (no address specified). Expected to fail.\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n     \"outaddr=1:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma:garbage\"],\n    \"return_code\": 1,\n    \"error_txt\": \"error: TX output missing or too many separators\",\n    \"description\": \"Malformed outaddr argument (too many separators). Expected to fail.\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n     \"outpubkey=0\"],\n    \"return_code\": 1,\n    \"error_txt\": \"error: TX output missing or too many separators\",\n    \"description\": \"Malformed outpubkey argument (no pubkey specified). Expected to fail.\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n     \"outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W:non53nse\"],\n    \"return_code\": 1,\n    \"error_txt\": \"error: TX output missing or too many separators\",\n    \"description\": \"Malformed outpubkey argument (too many separators). Expected to fail.\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0\",\n     \"in=bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c:18\",\n     \"in=22a6f904655d53ae2ff70e701a0bbd90aa3975c0f40bfc6cc996a9049e31cdfc:1\",\n     \"outaddr=0.18:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\",\n     \"outaddr=4:SUGAR1c3CvDCUtQ42h3u5kR3vnpVcSRaV5\"],\n    \"output_cmp\": \"txcreate1.hex\",\n    \"description\": \"Creates a new transaction with three inputs and two outputs\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-json\",\n     \"-create\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0\",\n     \"in=bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c:18\",\n     \"in=22a6f904655d53ae2ff70e701a0bbd90aa3975c0f40bfc6cc996a9049e31cdfc:1\",\n     \"outaddr=0.18:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\",\n     \"outaddr=4:SUGAR1c3CvDCUtQ42h3u5kR3vnpVcSRaV5\"],\n    \"output_cmp\": \"txcreate1.json\",\n    \"description\": \"Creates a new transaction with three inputs and two outputs (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-create\", \"outscript=0:\"],\n    \"output_cmp\": \"txcreate2.hex\",\n    \"description\": \"Creates a new transaction with a single empty output script\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outscript=0:\"],\n    \"output_cmp\": \"txcreate2.json\",\n    \"description\": \"Creates a new transaction with a single empty output script (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"02000000000100000000000000000000000000\"],\n    \"output_cmp\": \"txcreate2.hex\",\n    \"description\": \"Parses a transation with no inputs and a single output script\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"02000000000100000000000000000000000000\"],\n    \"output_cmp\": \"txcreate2.json\",\n    \"description\": \"Parses a transation with no inputs and a single output script (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-create\", \"outscript=0:OP_DROP\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatescript1.hex\",\n    \"description\": \"Create a new transaction with a single output script (OP_DROP)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outscript=0:OP_DROP\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatescript1.json\",\n    \"description\": \"Create a new transaction with a single output script (OP_DROP) (output as json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-create\", \"outscript=0:OP_DROP:S\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatescript2.hex\",\n    \"description\": \"Create a new transaction with a single output script (OP_DROP) in a P2SH\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outscript=0:OP_DROP:S\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatescript2.json\",\n    \"description\": \"Create a new transaction with a single output script (OP_DROP) in a P2SH (output as json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-create\", \"outscript=0:OP_DROP:W\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatescript3.hex\",\n    \"description\": \"Create a new transaction with a single output script (OP_DROP) in a P2WSH\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outscript=0:OP_DROP:W\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatescript3.json\",\n    \"description\": \"Create a new transaction with a single output script (OP_DROP) in a P2WSH (output as json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-create\", \"outscript=0:OP_DROP:WS\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatescript4.hex\",\n    \"description\": \"Create a new transaction with a single output script (OP_DROP) in a P2WSH, wrapped in a P2SH\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outscript=0:OP_DROP:WS\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatescript4.json\",\n    \"description\": \"Create a new transaction with a single output script (OP_DROP) in a P2SH, wrapped in a P2SH (output as json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\", \"nversion=1\",\n     \"in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0\",\n     \"set=privatekeys:[\\\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\\\"]\",\n     \"set=prevtxs:[{\\\"txid\\\":\\\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\\\",\\\"vout\\\":0,\\\"scriptPubKey\\\":\\\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\\\"}]\",\n     \"sign=ALL\",\n     \"outaddr=0.001:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"],\n    \"output_cmp\": \"txcreatesignv1.hex\",\n    \"description\": \"Creates a new v1 transaction with a single input and a single output, and then signs the transaction\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-json\",\n     \"-create\", \"nversion=1\",\n     \"in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0\",\n     \"set=privatekeys:[\\\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\\\"]\",\n     \"set=prevtxs:[{\\\"txid\\\":\\\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\\\",\\\"vout\\\":0,\\\"scriptPubKey\\\":\\\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\\\"}]\",\n     \"sign=ALL\",\n     \"outaddr=0.001:SUGAR1c3CvDCUtQ42h3u5kR3vnpVcSRaV5\"],\n    \"output_cmp\": \"txcreatesignv1.json\",\n    \"description\": \"Creates a new v1 transaction with a single input and a single output, and then signs the transaction (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n      \"in=4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485:0\",\n      \"set=privatekeys:[\\\"5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf\\\"]\",\n      \"set=prevtxs:[{\\\"txid\\\":\\\"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\\\",\\\"vout\\\":0,\\\"scriptPubKey\\\":\\\"76a91491b24bf9f5288532960ac687abb035127b1d28a588ac\\\"}]\",\n      \"sign=ALL\",\n      \"outaddr=0.001:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"],\n    \"output_cmp\": \"txcreatesignv2.hex\",\n    \"description\": \"Creates a new transaction with a single input and a single output, and then signs the transaction\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\", \"outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397\", \"nversion=1\"],\n    \"output_cmp\": \"txcreateoutpubkey1.hex\",\n    \"description\": \"Creates a new transaction with a single pay-to-pubkey output\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-json\", \"-create\", \"outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397\", \"nversion=1\"],\n    \"output_cmp\": \"txcreateoutpubkey1.json\",\n    \"description\": \"Creates a new transaction with a single pay-to-pubkey output (output as json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\", \"outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W\", \"nversion=1\"],\n    \"output_cmp\": \"txcreateoutpubkey2.hex\",\n    \"description\": \"Creates a new transaction with a single pay-to-witness-pubkey output\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-json\", \"-create\", \"outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:W\", \"nversion=1\"],\n    \"output_cmp\": \"txcreateoutpubkey2.json\",\n    \"description\": \"Creates a new transaction with a single pay-to-witness-pubkey output (output as json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\", \"outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:WS\", \"nversion=1\"],\n    \"output_cmp\": \"txcreateoutpubkey3.hex\",\n    \"description\": \"Creates a new transaction with a single pay-to-witness-pubkey, wrapped in P2SH output\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-json\", \"-create\", \"outpubkey=0:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:WS\", \"nversion=1\"],\n    \"output_cmp\": \"txcreateoutpubkey3.json\",\n    \"description\": \"Creates a new transaction with a single pay-to-pub-key output, wrapped in P2SH (output as json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-json\", \"-create\", \"outpubkey=0:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:WS\", \"nversion=1\"],\n    \"return_code\": 1,\n    \"error_txt\": \"error: Uncompressed pubkeys are not useable for SegWit outputs\",\n    \"description\": \"Creates a new transaction with a single pay-to-pub-key output, wrapped in P2SH (output as json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0\",\n     \"outdata=4:badhexdata\"],\n    \"return_code\": 1,\n    \"error_txt\": \"error: invalid TX output data\",\n    \"description\": \"Attempts to create a new transaction with one input and an output with malformed hex data. Expected to fail\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0\",\n     \"outdata=badhexdata\"],\n    \"return_code\": 1,\n    \"error_txt\": \"error: invalid TX output data\",\n    \"description\": \"Attempts to create a new transaction with one input and an output with no value and malformed hex data. Expected to fail\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0\",\n     \"outaddr=0.18:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\",\n     \"outdata=4:54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e\"],\n    \"output_cmp\": \"txcreatedata1.hex\",\n    \"description\": \"Creates a new transaction with one input, one address output and one data output\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-json\",\n     \"-create\", \"nversion=1\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0\",\n     \"outaddr=0.18:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\",\n     \"outdata=4:54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e\"],\n    \"output_cmp\": \"txcreatedata1.json\",\n    \"description\": \"Creates a new v1 transaction with one input, one address output and one data output (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0\",\n     \"outaddr=0.18:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\",\n     \"outdata=54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e\"],\n    \"output_cmp\": \"txcreatedata2.hex\",\n    \"description\": \"Creates a new transaction with one input, one address output and one data (zero value) output\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-json\",\n     \"-create\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0\",\n     \"outaddr=0.18:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\",\n     \"outdata=54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e\"],\n    \"output_cmp\": \"txcreatedata2.json\",\n    \"description\": \"Creates a new transaction with one input, one address output and one data (zero value) output (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-create\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:4294967293\",\n     \"outaddr=0.18:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"],\n    \"output_cmp\": \"txcreatedata_seq0.hex\",\n    \"description\": \"Creates a new transaction with one input with sequence number and one address output\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-json\",\n     \"-create\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:4294967293\",\n     \"outaddr=0.18:SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"],\n    \"output_cmp\": \"txcreatedata_seq0.json\",\n    \"description\": \"Creates a new transaction with one input with sequence number and one address output (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"01000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff0180a81201000000001976a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac00000000\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:1\"],\n    \"output_cmp\": \"txcreatedata_seq1.hex\",\n    \"description\": \"Adds a new input with sequence number to a transaction\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\":\n    [\"-json\",\n     \"01000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff0180a81201000000001976a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac00000000\",\n     \"in=5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f:0:1\"],\n    \"output_cmp\": \"txcreatedata_seq1.json\",\n    \"description\": \"Adds a new input with sequence number to a transaction (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-create\", \"outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatemultisig1.hex\",\n    \"description\": \"Creates a new transaction with a single 2-of-3 multisig output\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatemultisig1.json\",\n    \"description\": \"Creates a new transaction with a single 2-of-3 multisig output (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-create\", \"outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:S\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatemultisig2.hex\",\n    \"description\": \"Creates a new transaction with a single 2-of-3 multisig in a P2SH output\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:S\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatemultisig2.json\",\n    \"description\": \"Creates a new transaction with a single 2-of-3 multisig in a P2SH output (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-create\", \"outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:W\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatemultisig3.hex\",\n    \"description\": \"Creates a new transaction with a single 2-of-3 multisig in a P2WSH output\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:W\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatemultisig3.json\",\n    \"description\": \"Creates a new transaction with a single 2-of-3 multisig in a P2WSH output (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-create\", \"outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatemultisig4.hex\",\n    \"description\": \"Creates a new transaction with a single 2-of-3 multisig in a P2WSH output, wrapped in P2SH\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485:WS\", \"nversion=1\"],\n    \"output_cmp\": \"txcreatemultisig4.json\",\n    \"description\": \"Creates a new transaction with a single 2-of-3 multisig in a P2WSH output, wrapped in P2SH (output in json)\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:S\"],\n    \"output_cmp\": \"txcreatemultisig5.json\",\n    \"description\": \"Uncompressed pubkeys should work just fine for non-witness outputs\"\n  },\n  { \"exec\": \"./sugarchain-tx\",\n    \"args\": [\"-json\", \"-create\", \"outmultisig=1:2:3:02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397:021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d:047d1368ba7ae01c94bc32293efd70bd7e3be7aa7912d07d0b1c659c1008d179b8642f5fb90f47580feb29f045e216ff5a4716d3a0fed36da414d332046303c44a:WS\"],\n    \"return_code\": 1,\n    \"error_txt\": \"error: Uncompressed pubkeys are not useable for SegWit outputs\",\n    \"description\": \"Ensure adding witness outputs with uncompressed pubkeys fails\"\n  }\n]\n"
  },
  {
    "path": "test/util/data/blanktxv1.hex",
    "content": "01000000000000000000\n"
  },
  {
    "path": "test/util/data/blanktxv1.json",
    "content": "{\n    \"txid\": \"d21633ba23f70118185227be58a63527675641ad37967e2aa461559f577aec43\",\n    \"hash\": \"d21633ba23f70118185227be58a63527675641ad37967e2aa461559f577aec43\",\n    \"version\": 1,\n    \"size\": 10,\n    \"vsize\": 10,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n    ],\n    \"hex\": \"01000000000000000000\"\n}\n"
  },
  {
    "path": "test/util/data/blanktxv2.hex",
    "content": "02000000000000000000\n"
  },
  {
    "path": "test/util/data/blanktxv2.json",
    "content": "{\n    \"txid\": \"4ebd325a4b394cff8c57e8317ccf5a8d0e2bdf1b8526f8aad6c8e43d8240621a\",\n    \"hash\": \"4ebd325a4b394cff8c57e8317ccf5a8d0e2bdf1b8526f8aad6c8e43d8240621a\",\n    \"version\": 2,\n    \"size\": 10,\n    \"vsize\": 10,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n    ],\n    \"hex\": \"02000000000000000000\"\n}\n"
  },
  {
    "path": "test/util/data/tt-delin1-out.hex",
    "content": "0100000014fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0260f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac41420f00000000001976a9146c772e9cf96371bba3da8cb733da70a2fcf2007888ac00000000\n"
  },
  {
    "path": "test/util/data/tt-delin1-out.json",
    "content": "{\n    \"txid\": \"81b2035be1da1abe745c6141174a73d151009ec17b3d5ebffa2e177408c50dfd\",\n    \"hash\": \"81b2035be1da1abe745c6141174a73d151009ec17b3d5ebffa2e177408c50dfd\",\n    \"version\": 1,\n    \"size\": 3040,\n    \"vsize\": 3040,\n    \"locktime\": 0,\n    \"vin\": [\n        {\n            \"txid\": \"27871a1a27d833e99cd392a502a647beaaeda6da535417501c76312d52235cfd\",\n            \"vout\": 332,\n            \"scriptSig\": {\n                \"asm\": \"3046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"752f7f69b915637dc1c2f7aed1466ad676f6f3e24cf922809705f664e97ab3c1\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba[ALL] 027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\",\n                \"hex\": \"473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"b0ac9cca2e69cd02410e31b1f4402a25758e71abd1ab06c265ef9077dc05d0ed\",\n            \"vout\": 209,\n            \"scriptSig\": {\n                \"asm\": \"304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"a135eafb595eaf4c1ea59ccb111cdc0eae1b2c979b226a1e5aa8b76fe2d628df\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"3045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374[ALL] 03a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\",\n                \"hex\": \"483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"a5d6bf53ba21140b8a4d554feb00fe8bb9a62430ff9e4624aa2f58a120232aae\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"1b299cf14f1a22e81ea56d71b7affbd7cf386807bf2b4d4b79a18a54125accb3\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"3045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967[ALL] 03a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\",\n                \"hex\": \"483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"071df1cdcb3f0070f9d6af7b0274f02d0be2324a274727cfd288383167531485\",\n            \"vout\": 21,\n            \"scriptSig\": {\n                \"asm\": \"3045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"b012e500eb7adf7a13ed332dd6ece849f94f7a62bb3eac5babab356d1fc19282\",\n            \"vout\": 9,\n            \"scriptSig\": {\n                \"asm\": \"304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"58840fee9c833f2f2d40575842f30f4b8d2553094d06ad88b03d06869acf3d88\",\n            \"vout\": 30,\n            \"scriptSig\": {\n                \"asm\": \"30440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"e69f9cd16946e570a665245354428a3f507ea69f4568b581e4af98edb3db9766\",\n            \"vout\": 114,\n            \"scriptSig\": {\n                \"asm\": \"304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"595d1257f654ed2cbe5a65421e8aefd2b4d70b5b6c89a03f1d7e518221fc3f02\",\n            \"vout\": 103,\n            \"scriptSig\": {\n                \"asm\": \"3046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"06fc818f9555a261248ecd7aad0993eafb5a82ceb2b5c87c3ddfb06671c7f816\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec7669018[ALL] 0234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\",\n                \"hex\": \"483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"fb416c8155d6bb1d43f9395466ca90a638a7c2dd3ff617aadf3a7ac8f3967b19\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a[ALL] 027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\",\n                \"hex\": \"49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"3940b9683bd6104ad24c978e640ba4095993cafdb27d2ed91baa27ee61a2d920\",\n            \"vout\": 221,\n            \"scriptSig\": {\n                \"asm\": \"3045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"711b5714d3b5136147c02194cd95bde94a4648c4263ca6f972d86cd1d579f150\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba9074[ALL] 0234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\",\n                \"hex\": \"483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"6364b5c5efe018430789e7fb4e338209546cae5d9c5f5e300aac68155d861b55\",\n            \"vout\": 27,\n            \"scriptSig\": {\n                \"asm\": \"304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"0bb57f6e38012c86d4c5a28c904f2675082859147921a707d48961015a3e5057\",\n            \"vout\": 1095,\n            \"scriptSig\": {\n                \"asm\": \"304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"9b34274814a2540bb062107117f8f3e75ef85d953e9372d8261a3e9dfbc1163f\",\n            \"vout\": 37,\n            \"scriptSig\": {\n                \"asm\": \"3045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"b86b5cc0d8a7374d94e277850b0a249cb26a7b42ddf014f28a49b8859da64241\",\n            \"vout\": 20,\n            \"scriptSig\": {\n                \"asm\": \"304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"3d0a2353eeec44d3c10aed259038db321912122cd4150048f7bfa4c0ecfee236\",\n            \"vout\": 242,\n            \"scriptSig\": {\n                \"asm\": \"3046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        }\n    ],\n    \"vout\": [\n        {\n            \"value\": 1.37820000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 8fd139bb39ced713f231c58a4d07bf6954d1c201 OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SaQSJWwhyZURJoLoSrUo4wq3Rk3nRE4qbG\"\n                ]\n            }\n        },\n        {\n            \"value\": 0.01000001,\n            \"n\": 1,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 6c772e9cf96371bba3da8cb733da70a2fcf20078 OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9146c772e9cf96371bba3da8cb733da70a2fcf2007888ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SXBWnUYpVuwSNmnZAUJdXeT3F23a7pF5GB\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"0100000014fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0260f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac41420f00000000001976a9146c772e9cf96371bba3da8cb733da70a2fcf2007888ac00000000\"\n}\n"
  },
  {
    "path": "test/util/data/tt-delout1-out.hex",
    "content": "0100000015fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffcb4ed1baba3a1eb2171e00ddec8e5b72b346dd8c07f9c2b0d122d0d06bc92ea7000000006c493046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba012103e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505ffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0160f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac00000000\n"
  },
  {
    "path": "test/util/data/tt-delout1-out.json",
    "content": "{\n    \"txid\": \"c46ccd75b5050e942b2e86a3648f843f525fe6fc000bf0534ba5973063354493\",\n    \"hash\": \"c46ccd75b5050e942b2e86a3648f843f525fe6fc000bf0534ba5973063354493\",\n    \"version\": 1,\n    \"size\": 3155,\n    \"vsize\": 3155,\n    \"locktime\": 0,\n    \"vin\": [\n        {\n            \"txid\": \"27871a1a27d833e99cd392a502a647beaaeda6da535417501c76312d52235cfd\",\n            \"vout\": 332,\n            \"scriptSig\": {\n                \"asm\": \"3046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"a72ec96bd0d022d1b0c2f9078cdd46b3725b8eecdd001e17b21e3ababad14ecb\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"3046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba[ALL] 03e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505\",\n                \"hex\": \"493046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba012103e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"752f7f69b915637dc1c2f7aed1466ad676f6f3e24cf922809705f664e97ab3c1\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba[ALL] 027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\",\n                \"hex\": \"473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"b0ac9cca2e69cd02410e31b1f4402a25758e71abd1ab06c265ef9077dc05d0ed\",\n            \"vout\": 209,\n            \"scriptSig\": {\n                \"asm\": \"304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"a135eafb595eaf4c1ea59ccb111cdc0eae1b2c979b226a1e5aa8b76fe2d628df\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"3045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374[ALL] 03a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\",\n                \"hex\": \"483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"a5d6bf53ba21140b8a4d554feb00fe8bb9a62430ff9e4624aa2f58a120232aae\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"1b299cf14f1a22e81ea56d71b7affbd7cf386807bf2b4d4b79a18a54125accb3\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"3045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967[ALL] 03a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\",\n                \"hex\": \"483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"071df1cdcb3f0070f9d6af7b0274f02d0be2324a274727cfd288383167531485\",\n            \"vout\": 21,\n            \"scriptSig\": {\n                \"asm\": \"3045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"b012e500eb7adf7a13ed332dd6ece849f94f7a62bb3eac5babab356d1fc19282\",\n            \"vout\": 9,\n            \"scriptSig\": {\n                \"asm\": \"304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"58840fee9c833f2f2d40575842f30f4b8d2553094d06ad88b03d06869acf3d88\",\n            \"vout\": 30,\n            \"scriptSig\": {\n                \"asm\": \"30440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"e69f9cd16946e570a665245354428a3f507ea69f4568b581e4af98edb3db9766\",\n            \"vout\": 114,\n            \"scriptSig\": {\n                \"asm\": \"304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"595d1257f654ed2cbe5a65421e8aefd2b4d70b5b6c89a03f1d7e518221fc3f02\",\n            \"vout\": 103,\n            \"scriptSig\": {\n                \"asm\": \"3046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"06fc818f9555a261248ecd7aad0993eafb5a82ceb2b5c87c3ddfb06671c7f816\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec7669018[ALL] 0234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\",\n                \"hex\": \"483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"fb416c8155d6bb1d43f9395466ca90a638a7c2dd3ff617aadf3a7ac8f3967b19\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a[ALL] 027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\",\n                \"hex\": \"49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"3940b9683bd6104ad24c978e640ba4095993cafdb27d2ed91baa27ee61a2d920\",\n            \"vout\": 221,\n            \"scriptSig\": {\n                \"asm\": \"3045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"711b5714d3b5136147c02194cd95bde94a4648c4263ca6f972d86cd1d579f150\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba9074[ALL] 0234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\",\n                \"hex\": \"483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"6364b5c5efe018430789e7fb4e338209546cae5d9c5f5e300aac68155d861b55\",\n            \"vout\": 27,\n            \"scriptSig\": {\n                \"asm\": \"304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"0bb57f6e38012c86d4c5a28c904f2675082859147921a707d48961015a3e5057\",\n            \"vout\": 1095,\n            \"scriptSig\": {\n                \"asm\": \"304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"9b34274814a2540bb062107117f8f3e75ef85d953e9372d8261a3e9dfbc1163f\",\n            \"vout\": 37,\n            \"scriptSig\": {\n                \"asm\": \"3045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"b86b5cc0d8a7374d94e277850b0a249cb26a7b42ddf014f28a49b8859da64241\",\n            \"vout\": 20,\n            \"scriptSig\": {\n                \"asm\": \"304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"3d0a2353eeec44d3c10aed259038db321912122cd4150048f7bfa4c0ecfee236\",\n            \"vout\": 242,\n            \"scriptSig\": {\n                \"asm\": \"3046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        }\n    ],\n    \"vout\": [\n        {\n            \"value\": 1.37820000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 8fd139bb39ced713f231c58a4d07bf6954d1c201 OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SaQSJWwhyZURJoLoSrUo4wq3Rk3nRE4qbG\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"0100000015fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffcb4ed1baba3a1eb2171e00ddec8e5b72b346dd8c07f9c2b0d122d0d06bc92ea7000000006c493046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba012103e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505ffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0160f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac00000000\"\n}\n"
  },
  {
    "path": "test/util/data/tt-locktime317000-out.hex",
    "content": "0100000015fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffcb4ed1baba3a1eb2171e00ddec8e5b72b346dd8c07f9c2b0d122d0d06bc92ea7000000006c493046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba012103e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505ffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0260f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac41420f00000000001976a9146c772e9cf96371bba3da8cb733da70a2fcf2007888ac48d60400\n"
  },
  {
    "path": "test/util/data/tt-locktime317000-out.json",
    "content": "{\n    \"txid\": \"aded538f642c17e15f4d3306b8be7e1a4d1ae0c4616d641ab51ea09ba65e5cb5\",\n    \"hash\": \"aded538f642c17e15f4d3306b8be7e1a4d1ae0c4616d641ab51ea09ba65e5cb5\",\n    \"version\": 1,\n    \"size\": 3189,\n    \"vsize\": 3189,\n    \"locktime\": 317000,\n    \"vin\": [\n        {\n            \"txid\": \"27871a1a27d833e99cd392a502a647beaaeda6da535417501c76312d52235cfd\",\n            \"vout\": 332,\n            \"scriptSig\": {\n                \"asm\": \"3046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"a72ec96bd0d022d1b0c2f9078cdd46b3725b8eecdd001e17b21e3ababad14ecb\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"3046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba[ALL] 03e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505\",\n                \"hex\": \"493046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba012103e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"752f7f69b915637dc1c2f7aed1466ad676f6f3e24cf922809705f664e97ab3c1\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba[ALL] 027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\",\n                \"hex\": \"473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"b0ac9cca2e69cd02410e31b1f4402a25758e71abd1ab06c265ef9077dc05d0ed\",\n            \"vout\": 209,\n            \"scriptSig\": {\n                \"asm\": \"304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"a135eafb595eaf4c1ea59ccb111cdc0eae1b2c979b226a1e5aa8b76fe2d628df\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"3045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374[ALL] 03a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\",\n                \"hex\": \"483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"a5d6bf53ba21140b8a4d554feb00fe8bb9a62430ff9e4624aa2f58a120232aae\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"1b299cf14f1a22e81ea56d71b7affbd7cf386807bf2b4d4b79a18a54125accb3\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"3045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967[ALL] 03a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\",\n                \"hex\": \"483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"071df1cdcb3f0070f9d6af7b0274f02d0be2324a274727cfd288383167531485\",\n            \"vout\": 21,\n            \"scriptSig\": {\n                \"asm\": \"3045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"b012e500eb7adf7a13ed332dd6ece849f94f7a62bb3eac5babab356d1fc19282\",\n            \"vout\": 9,\n            \"scriptSig\": {\n                \"asm\": \"304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"58840fee9c833f2f2d40575842f30f4b8d2553094d06ad88b03d06869acf3d88\",\n            \"vout\": 30,\n            \"scriptSig\": {\n                \"asm\": \"30440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"e69f9cd16946e570a665245354428a3f507ea69f4568b581e4af98edb3db9766\",\n            \"vout\": 114,\n            \"scriptSig\": {\n                \"asm\": \"304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"595d1257f654ed2cbe5a65421e8aefd2b4d70b5b6c89a03f1d7e518221fc3f02\",\n            \"vout\": 103,\n            \"scriptSig\": {\n                \"asm\": \"3046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"06fc818f9555a261248ecd7aad0993eafb5a82ceb2b5c87c3ddfb06671c7f816\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec7669018[ALL] 0234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\",\n                \"hex\": \"483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"fb416c8155d6bb1d43f9395466ca90a638a7c2dd3ff617aadf3a7ac8f3967b19\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a[ALL] 027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\",\n                \"hex\": \"49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"3940b9683bd6104ad24c978e640ba4095993cafdb27d2ed91baa27ee61a2d920\",\n            \"vout\": 221,\n            \"scriptSig\": {\n                \"asm\": \"3045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"711b5714d3b5136147c02194cd95bde94a4648c4263ca6f972d86cd1d579f150\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"3045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba9074[ALL] 0234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\",\n                \"hex\": \"483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cd\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"6364b5c5efe018430789e7fb4e338209546cae5d9c5f5e300aac68155d861b55\",\n            \"vout\": 27,\n            \"scriptSig\": {\n                \"asm\": \"304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"0bb57f6e38012c86d4c5a28c904f2675082859147921a707d48961015a3e5057\",\n            \"vout\": 1095,\n            \"scriptSig\": {\n                \"asm\": \"304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"9b34274814a2540bb062107117f8f3e75ef85d953e9372d8261a3e9dfbc1163f\",\n            \"vout\": 37,\n            \"scriptSig\": {\n                \"asm\": \"3045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"b86b5cc0d8a7374d94e277850b0a249cb26a7b42ddf014f28a49b8859da64241\",\n            \"vout\": 20,\n            \"scriptSig\": {\n                \"asm\": \"304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321[ALL] 03f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\",\n                \"hex\": \"48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64c\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"3d0a2353eeec44d3c10aed259038db321912122cd4150048f7bfa4c0ecfee236\",\n            \"vout\": 242,\n            \"scriptSig\": {\n                \"asm\": \"3046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68[ALL] 03091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\",\n                \"hex\": \"493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adc\"\n            },\n            \"sequence\": 4294967295\n        }\n    ],\n    \"vout\": [\n        {\n            \"value\": 1.37820000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 8fd139bb39ced713f231c58a4d07bf6954d1c201 OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SaQSJWwhyZURJoLoSrUo4wq3Rk3nRE4qbG\"\n                ]\n            }\n        },\n        {\n            \"value\": 0.01000001,\n            \"n\": 1,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 6c772e9cf96371bba3da8cb733da70a2fcf20078 OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9146c772e9cf96371bba3da8cb733da70a2fcf2007888ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SXBWnUYpVuwSNmnZAUJdXeT3F23a7pF5GB\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"0100000015fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffcb4ed1baba3a1eb2171e00ddec8e5b72b346dd8c07f9c2b0d122d0d06bc92ea7000000006c493046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba012103e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505ffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0260f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac41420f00000000001976a9146c772e9cf96371bba3da8cb733da70a2fcf2007888ac48d60400\"\n}\n"
  },
  {
    "path": "test/util/data/tx394b54bb.hex",
    "content": "0100000015fd5c23522d31761c50175453daa6edaabe47a602a592d39ce933d8271a1a87274c0100006c493046022100b4251ecd63778a3dde0155abe4cd162947620ae9ee45a874353551092325b116022100db307baf4ff3781ec520bd18f387948cedd15dc27bafe17c894b0fe6ffffcafa012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffcb4ed1baba3a1eb2171e00ddec8e5b72b346dd8c07f9c2b0d122d0d06bc92ea7000000006c493046022100a9b617843b68c284715d3e02fd120479cd0d96a6c43bf01e697fb0a460a21a3a022100ba0a12fbe8b993d4e7911fa3467615765dbe421ddf5c51b57a9c1ee19dcc00ba012103e633b4fa4ceb705c2da712390767199be8ef2448b3095dc01652e11b2b751505ffffffffc1b37ae964f605978022f94ce2f3f676d66a46d1aef7c2c17d6315b9697f2f75010000006a473044022079bd62ee09621a3be96b760c39e8ef78170101d46313923c6b07ae60a95c90670220238e51ea29fc70b04b65508450523caedbb11cb4dd5aa608c81487de798925ba0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffffedd005dc7790ef65c206abd1ab718e75252a40f4b1310e4102cd692eca9cacb0d10000006b48304502207722d6f9038673c86a1019b1c4de2d687ae246477cd4ca7002762be0299de385022100e594a11e3a313942595f7666dcf7078bcb14f1330f4206b95c917e7ec0e82fac012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffdf28d6e26fb7a85a1e6a229b972c1bae0edc1c11cb9ca51e4caf5e59fbea35a1000000006b483045022100a63a4788027b79b65c6f9d9e054f68cf3b4eed19efd82a2d53f70dcbe64683390220526f243671425b2bd05745fcf2729361f985cfe84ea80c7cfc817b93d8134374012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffffae2a2320a1582faa24469eff3024a6b98bfe00eb4f554d8a0b1421ba53bfd6a5010000006c493046022100b200ac6db16842f76dab9abe807ce423c992805879bc50abd46ed8275a59d9cf022100c0d518e85dd345b3c29dd4dc47b9a420d3ce817b18720e94966d2fe23413a408012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffffb3cc5a12548aa1794b4d2bbf076838cfd7fbafb7716da51ee8221a4ff19c291b000000006b483045022100ededc441c3103a6f2bd6cab7639421af0f6ec5e60503bce1e603cf34f00aee1c02205cb75f3f519a13fb348783b21db3085cb5ec7552c59e394fdbc3e1feea43f967012103a621f08be22d1bbdcbe4e527ee4927006aa555fc65e2aafa767d4ea2fe9dfa52ffffffff85145367313888d2cf2747274a32e20b2df074027bafd6f970003fcbcdf11d07150000006b483045022100d9eed5413d2a4b4b98625aa6e3169edc4fb4663e7862316d69224454e70cd8ca022061e506521d5ced51dd0ea36496e75904d756a4c4f9fb111568555075d5f68d9a012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff8292c11f6d35abab5bac3ebb627a4ff949e8ecd62d33ed137adf7aeb00e512b0090000006b48304502207e84b27139c4c19c828cb1e30c349bba88e4d9b59be97286960793b5ddc0a2af0221008cdc7a951e7f31c20953ed5635fbabf228e80b7047f32faaa0313e7693005177012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff883dcf9a86063db088ad064d0953258d4b0ff3425857402d2f3f839cee0f84581e0000006a4730440220426540dfed9c4ab5812e5f06df705b8bcf307dd7d20f7fa6512298b2a6314f420220064055096e3ca62f6c7352c66a5447767c53f946acdf35025ab3807ddb2fa404012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff6697dbb3ed98afe481b568459fa67e503f8a4254532465a670e54669d19c9fe6720000006a47304402200a5e673996f2fc88e21cc8613611f08a650bc0370338803591d85d0ec5663764022040b6664a0d1ec83a7f01975b8fde5232992b8ca58bf48af6725d2f92a936ab2e012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff023ffc2182517e1d3fa0896c5b0bd7b4d2ef8a1e42655abe2ced54f657125d59670000006c493046022100d93b30219c5735f673be5c3b4688366d96f545561c74cb62c6958c00f6960806022100ec8200adcb028f2184fa2a4f6faac7f8bb57cb4503bb7584ac11051fece31b3d012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff16f8c77166b0df3d7cc8b5b2ce825afbea9309ad7acd8e2461a255958f81fc06010000006b483045022100a13934e68d3f5b22b130c4cb33f4da468cffc52323a47fbfbe06b64858162246022047081e0a70ff770e64a2e2d31e5d520d9102268b57a47009a72fe73ec766901801210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff197b96f3c87a3adfaa17f63fddc2a738a690ca665439f9431dbbd655816c41fb000000006c49304602210097f1f35d5bdc1a3a60390a1b015b8e7c4f916aa3847aafd969e04975e15bbe70022100a9052eb25517d481f1fda1b129eb1b534da50ea1a51f3ee012dca3601c11b86a0121027a759be8df971a6a04fafcb4f6babf75dc811c5cdaa0734cddbe9b942ce75b34ffffffff20d9a261ee27aa1bd92e7db2fdca935909a40b648e974cd24a10d63b68b94039dd0000006b483045022012b3138c591bf7154b6fef457f2c4a3c7162225003788ac0024a99355865ff13022100b71b125ae1ffb2e1d1571f580cd3ebc8cd049a2d7a8a41f138ba94aeb982106f012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff50f179d5d16cd872f9a63c26c448464ae9bd95cd9421c0476113b5d314571b71010000006b483045022100f834ccc8b22ee72712a3e5e6ef4acb8b2fb791b5385b70e2cd4332674d6667f4022024fbda0a997e0c253503f217501f508a4d56edce2c813ecdd9ad796dbeba907401210234b9d9413f247bb78cd3293b7b65a2c38018ba5621ea9ee737f3a6a3523fb4cdffffffff551b865d1568ac0a305e5f9c5dae6c540982334efbe789074318e0efc5b564631b0000006b48304502203b2fd1e39ae0e469d7a15768f262661b0de41470daf0fe8c4fd0c26542a0870002210081c57e331f9a2d214457d953e3542904727ee412c63028113635d7224da3dccc012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff57503e5a016189d407a721791459280875264f908ca2c5d4862c01386e7fb50b470400006b48304502206947a9c54f0664ece4430fd4ae999891dc50bb6126bc36b6a15a3189f29d25e9022100a86cfc4e2fdd9e39a20e305cfd1b76509c67b3e313e0f118229105caa0e823c9012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff3f16c1fb9d3e1a26d872933e955df85ee7f3f817711062b00b54a2144827349b250000006b483045022100c7128fe10b2d38744ae8177776054c29fc8ec13f07207723e70766ab7164847402201d2cf09009b9596de74c0183d1ab832e5edddb7a9965880bb400097e850850f8012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff4142a69d85b8498af214f0dd427b6ab29c240a0b8577e2944d37a7d8c05c6bb8140000006b48304502203b89a71628a28cc3703d170ca3be77786cff6b867e38a18b719705f8a326578f022100b2a9879e1acf621faa6466c207746a7f3eb4c8514c1482969aba3f2a957f1321012103f1575d6124ac78be398c25b31146d08313c6072d23a4d7df5ac6a9f87346c64cffffffff36e2feecc0a4bff7480015d42c12121932db389025ed0ac1d344ecee53230a3df20000006c493046022100ef794a8ef7fd6752d2a183c18866ff6e8dc0f5bd889a63e2c21cf303a6302461022100c1b09662d9e92988c3f9fcf17d1bcc79b5403647095d7212b9f8a1278a532d68012103091137f3ef23f4acfc19a5953a68b2074fae942ad3563ef28c33b0cac9a93adcffffffff0260f73608000000001976a9148fd139bb39ced713f231c58a4d07bf6954d1c20188ac41420f00000000001976a9146c772e9cf96371bba3da8cb733da70a2fcf2007888ac00000000\n"
  },
  {
    "path": "test/util/data/txcreate1.hex",
    "content": "02000000031f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000ffffffff7cca453133921c50d5025878f7f738d1df891fd359763331935784cf6b9c82bf1200000000fffffffffccd319e04a996c96cfc0bf4c07539aa90bd0b1a700ef72fae535d6504f9a6220100000000ffffffff0280a81201000000001976a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac0084d717000000001976a9144c6fe165803f808d8b38f7b6a488a6df1da5679f88ac00000000\n"
  },
  {
    "path": "test/util/data/txcreate1.json",
    "content": "{\n    \"txid\": \"bd2ef2a8a416e7ab80ac1f105975939bf4900a7d5eef85bb7ee0ad29133acf03\",\n    \"hash\": \"bd2ef2a8a416e7ab80ac1f105975939bf4900a7d5eef85bb7ee0ad29133acf03\",\n    \"version\": 2,\n    \"size\": 201,\n    \"vsize\": 201,\n    \"locktime\": 0,\n    \"vin\": [\n        {\n            \"txid\": \"5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"\",\n                \"hex\": \"\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"bf829c6bcf84579331337659d31f89dfd138f7f7785802d5501c92333145ca7c\",\n            \"vout\": 18,\n            \"scriptSig\": {\n                \"asm\": \"\",\n                \"hex\": \"\"\n            },\n            \"sequence\": 4294967295\n        },\n        {\n            \"txid\": \"22a6f904655d53ae2ff70e701a0bbd90aa3975c0f40bfc6cc996a9049e31cdfc\",\n            \"vout\": 1,\n            \"scriptSig\": {\n                \"asm\": \"\",\n                \"hex\": \"\"\n            },\n            \"sequence\": 4294967295\n        }\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.18000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 4c6fe416827bdb3421069a4900cec7fe1517db39 OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"\n                ]\n            }\n        },\n        {\n            \"value\": 4.00000000,\n            \"n\": 1,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 4c6fe165803f808d8b38f7b6a488a6df1da5679f OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9144c6fe165803f808d8b38f7b6a488a6df1da5679f88ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SUGAR1c3CvDCUtQ42h3u5kR3vnpVcSRaV5\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"02000000031f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000ffffffff7cca453133921c50d5025878f7f738d1df891fd359763331935784cf6b9c82bf1200000000fffffffffccd319e04a996c96cfc0bf4c07539aa90bd0b1a700ef72fae535d6504f9a6220100000000ffffffff0280a81201000000001976a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac0084d717000000001976a9144c6fe165803f808d8b38f7b6a488a6df1da5679f88ac00000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreate2.hex",
    "content": "02000000000100000000000000000000000000\n"
  },
  {
    "path": "test/util/data/txcreate2.json",
    "content": "{\n    \"txid\": \"0481afb29931341d0d7861d8a2f6f26456fa042abf54a23e96440ed7946e0715\",\n    \"hash\": \"0481afb29931341d0d7861d8a2f6f26456fa042abf54a23e96440ed7946e0715\",\n    \"version\": 2,\n    \"size\": 19,\n    \"vsize\": 19,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"\",\n                \"hex\": \"\",\n                \"type\": \"nonstandard\"\n            }\n        }\n    ],\n    \"hex\": \"02000000000100000000000000000000000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatedata1.hex",
    "content": "02000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000ffffffff0280a81201000000001976a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac0084d71700000000526a4c4f54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e00000000\n"
  },
  {
    "path": "test/util/data/txcreatedata1.json",
    "content": "{\n    \"txid\": \"40c3448b3b4f824041e277679a31b637b4ea08e9eab578c6331e445c66352009\",\n    \"hash\": \"40c3448b3b4f824041e277679a31b637b4ea08e9eab578c6331e445c66352009\",\n    \"version\": 1,\n    \"size\": 176,\n    \"vsize\": 176,\n    \"locktime\": 0,\n    \"vin\": [\n        {\n            \"txid\": \"5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"\",\n                \"hex\": \"\"\n            },\n            \"sequence\": 4294967295\n        }\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.18000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 4c6fe416827bdb3421069a4900cec7fe1517db39 OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"\n                ]\n            }\n        },\n        {\n            \"value\": 4.00000000,\n            \"n\": 1,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_RETURN 54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e\",\n                \"hex\": \"6a4c4f54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e\",\n                \"type\": \"nulldata\"\n            }\n        }\n    ],\n    \"hex\": \"01000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000ffffffff0280a81201000000001976a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac0084d71700000000526a4c4f54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e00000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatedata2.hex",
    "content": "02000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000ffffffff0280a81201000000001976a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac0000000000000000526a4c4f54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e00000000\n"
  },
  {
    "path": "test/util/data/txcreatedata2.json",
    "content": "{\n    \"txid\": \"13158cb9bc20886b83377fddcfdc9abbb1db034be2b2ce1d2615003fc48464db\",\n    \"hash\": \"13158cb9bc20886b83377fddcfdc9abbb1db034be2b2ce1d2615003fc48464db\",\n    \"version\": 2,\n    \"size\": 176,\n    \"vsize\": 176,\n    \"locktime\": 0,\n    \"vin\": [\n        {\n            \"txid\": \"5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"\",\n                \"hex\": \"\"\n            },\n            \"sequence\": 4294967295\n        }\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.18000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 4c6fe416827bdb3421069a4900cec7fe1517db39 OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"\n                ]\n            }\n        },\n        {\n            \"value\": 0.00000000,\n            \"n\": 1,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_RETURN 54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e\",\n                \"hex\": \"6a4c4f54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e\",\n                \"type\": \"nulldata\"\n            }\n        }\n    ],\n    \"hex\": \"02000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000ffffffff0280a81201000000001976a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac0000000000000000526a4c4f54686973204f505f52455455524e207472616e73616374696f6e206f7574707574207761732063726561746564206279206d6f646966696564206372656174657261777472616e73616374696f6e2e00000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatedata_seq0.hex",
    "content": "02000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff0180a81201000000001976a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac00000000\n"
  },
  {
    "path": "test/util/data/txcreatedata_seq0.json",
    "content": "{\n    \"txid\": \"225874ca4d1116a5359f7556e5a09e1d399252cd6a2afc0c3d3dc7374582a5aa\",\n    \"hash\": \"225874ca4d1116a5359f7556e5a09e1d399252cd6a2afc0c3d3dc7374582a5aa\",\n    \"version\": 2,\n    \"size\": 85,\n    \"vsize\": 85,\n    \"locktime\": 0,\n    \"vin\": [\n        {\n            \"txid\": \"5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"\",\n                \"hex\": \"\"\n            },\n            \"sequence\": 4294967293\n        }\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.18000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 4c6fe416827bdb3421069a4900cec7fe1517db39 OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SUGARjyPtxYCkHbNAvEKAbtVoFWhWjrLma\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"02000000011f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff0180a81201000000001976a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac00000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatedata_seq1.hex",
    "content": "01000000021f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff1f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000010000000180a81201000000001976a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac00000000\n"
  },
  {
    "path": "test/util/data/txcreatedata_seq1.json",
    "content": "{\n    \"txid\": \"c4dea671b0d7b48f8ab10bc46650e8329d3c5766931f548f513847a19f5ba75b\",\n    \"hash\": \"c4dea671b0d7b48f8ab10bc46650e8329d3c5766931f548f513847a19f5ba75b\",\n    \"version\": 1,\n    \"size\": 126,\n    \"vsize\": 126,\n    \"locktime\": 0,\n    \"vin\": [\n        {\n            \"txid\": \"5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"\",\n                \"hex\": \"\"\n            },\n            \"sequence\": 4294967293\n        },\n        {\n            \"txid\": \"5897de6bd6027a475eadd57019d4e6872c396d0716c4875a5f1a6fcfdf385c1f\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"\",\n                \"hex\": \"\"\n            },\n            \"sequence\": 1\n        }\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.18000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 1fc11f39be1729bf973a7ab6a615ca4729d64574 OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SQBuL8zZknsNP5U8TXHXALnRJMwRQtes9B\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"01000000021f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000fdffffff1f5c38dfcf6f1a5f5a87c416076d392c87e6d41970d5ad5e477a02d66bde97580000000000010000000180a81201000000001976a9141fc11f39be1729bf973a7ab6a615ca4729d6457488ac00000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatemultisig1.hex",
    "content": "01000000000100e1f5050000000069522102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff39721021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d2102df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb48553ae00000000\n"
  },
  {
    "path": "test/util/data/txcreatemultisig1.json",
    "content": "{\n    \"txid\": \"0d1d4edfc217d9db3ab6a9298f26a52eae3c52f55a6cb8ccbc14f7c727572894\",\n    \"hash\": \"0d1d4edfc217d9db3ab6a9298f26a52eae3c52f55a6cb8ccbc14f7c727572894\",\n    \"version\": 1,\n    \"size\": 124,\n    \"vsize\": 124,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 1.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"2 02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397 021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d 02df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb485 3 OP_CHECKMULTISIG\",\n                \"hex\": \"522102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff39721021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d2102df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb48553ae\",\n                \"reqSigs\": 2,\n                \"type\": \"multisig\",\n                \"addresses\": [\n                    \"Sc6G3suEydE5gcDc83LzG81tcsM15KikjZ\",\n                    \"Sbpu1z6crfZxvXkkB9DqdBNGp88otzXEiW\",\n                    \"SQducmPLKtkjpQFLXUbF2Jsi6geE64f4Jz\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"01000000000100e1f5050000000069522102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff39721021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d2102df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb48553ae00000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatemultisig2.hex",
    "content": "01000000000100e1f5050000000017a9141c6fbaf46d64221e80cbae182c33ddf81b9294ac8700000000\n"
  },
  {
    "path": "test/util/data/txcreatemultisig2.json",
    "content": "{\n    \"txid\": \"0d861f278a3b7bce7cb5a88d71e6e6a903336f95ad5a2c29b295b63835b6eee3\",\n    \"hash\": \"0d861f278a3b7bce7cb5a88d71e6e6a903336f95ad5a2c29b295b63835b6eee3\",\n    \"version\": 1,\n    \"size\": 42,\n    \"vsize\": 42,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 1.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_HASH160 1c6fbaf46d64221e80cbae182c33ddf81b9294ac OP_EQUAL\",\n                \"hex\": \"a9141c6fbaf46d64221e80cbae182c33ddf81b9294ac87\",\n                \"reqSigs\": 1,\n                \"type\": \"scripthash\",\n                \"addresses\": [\n                    \"sLqkr6tNNr2Tty7NfoskMMQs8SBtLEDpfL\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"01000000000100e1f5050000000017a9141c6fbaf46d64221e80cbae182c33ddf81b9294ac8700000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatemultisig3.hex",
    "content": "01000000000100e1f50500000000220020e15a86a23178f433d514dbbce042e87d72662b8b5edcacfd2e37ab7a2d135f0500000000\n"
  },
  {
    "path": "test/util/data/txcreatemultisig3.json",
    "content": "{\n    \"txid\": \"ccc552220b46a3b5140048b03395987ce4f0fa1ddf8c635bba1fa44e0f8c1d7f\",\n    \"hash\": \"ccc552220b46a3b5140048b03395987ce4f0fa1ddf8c635bba1fa44e0f8c1d7f\",\n    \"version\": 1,\n    \"size\": 53,\n    \"vsize\": 53,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 1.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"0 e15a86a23178f433d514dbbce042e87d72662b8b5edcacfd2e37ab7a2d135f05\",\n                \"hex\": \"0020e15a86a23178f433d514dbbce042e87d72662b8b5edcacfd2e37ab7a2d135f05\",\n                \"reqSigs\": 1,\n                \"type\": \"witness_v0_scripthash\",\n                \"addresses\": [\n                    \"sugar1qu9dgdg330r6r84g5mw7wqshg04exv2uttmw2elfwx74h5tgntuzsd0rwze\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"01000000000100e1f50500000000220020e15a86a23178f433d514dbbce042e87d72662b8b5edcacfd2e37ab7a2d135f0500000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatemultisig4.hex",
    "content": "01000000000100e1f5050000000017a9146edf12858999f0dae74f9c692e6694ee3621b2ac8700000000\n"
  },
  {
    "path": "test/util/data/txcreatemultisig4.json",
    "content": "{\n    \"txid\": \"5e8b1cc73234e208d4b7ca9075f136b908c34101be7a048df4ba9ac758b61567\",\n    \"hash\": \"5e8b1cc73234e208d4b7ca9075f136b908c34101be7a048df4ba9ac758b61567\",\n    \"version\": 1,\n    \"size\": 42,\n    \"vsize\": 42,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 1.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_HASH160 6edf12858999f0dae74f9c692e6694ee3621b2ac OP_EQUAL\",\n                \"hex\": \"a9146edf12858999f0dae74f9c692e6694ee3621b2ac87\",\n                \"reqSigs\": 1,\n                \"type\": \"scripthash\",\n                \"addresses\": [\n                    \"sUMde1n26VDWkhCrVa3rP4JfESTTLS7TUq\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"01000000000100e1f5050000000017a9146edf12858999f0dae74f9c692e6694ee3621b2ac8700000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatemultisig5.json",
    "content": "{\n    \"txid\": \"813cf75e1f08debd242ef7c8192b7d478fb651355209369499a0de779ba7eb2f\",\n    \"hash\": \"813cf75e1f08debd242ef7c8192b7d478fb651355209369499a0de779ba7eb2f\",\n    \"version\": 2,\n    \"size\": 42,\n    \"vsize\": 42,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 1.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_HASH160 a4051c02398868af83f28f083208fae99a769263 OP_EQUAL\",\n                \"hex\": \"a914a4051c02398868af83f28f083208fae99a76926387\",\n                \"reqSigs\": 1,\n                \"type\": \"scripthash\",\n                \"addresses\": [\n                    \"sZCf23Qrgc18DZiJBz7kasC89ZQ4oWB5g2\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"02000000000100e1f5050000000017a914a4051c02398868af83f28f083208fae99a7692638700000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreateoutpubkey1.hex",
    "content": "0100000000010000000000000000232102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397ac00000000\n"
  },
  {
    "path": "test/util/data/txcreateoutpubkey1.json",
    "content": "{\n    \"txid\": \"f42b38ac12e3fafc96ba1a9ba70cbfe326744aef75df5fb9db5d6e2855ca415f\",\n    \"hash\": \"f42b38ac12e3fafc96ba1a9ba70cbfe326744aef75df5fb9db5d6e2855ca415f\",\n    \"version\": 1,\n    \"size\": 54,\n    \"vsize\": 54,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397 OP_CHECKSIG\",\n                \"hex\": \"2102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkey\",\n                \"addresses\": [\n                    \"Sc6G3suEydE5gcDc83LzG81tcsM15KikjZ\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"0100000000010000000000000000232102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397ac00000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreateoutpubkey2.hex",
    "content": "0100000000010000000000000000160014a2516e770582864a6a56ed21a102044e388c62e300000000\n"
  },
  {
    "path": "test/util/data/txcreateoutpubkey2.json",
    "content": "{\n    \"txid\": \"70f2a088cde460e677415fa1fb71895e90c231e6ed38ed203a35b6f848e9cc73\",\n    \"hash\": \"70f2a088cde460e677415fa1fb71895e90c231e6ed38ed203a35b6f848e9cc73\",\n    \"version\": 1,\n    \"size\": 41,\n    \"vsize\": 41,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"0 a2516e770582864a6a56ed21a102044e388c62e3\",\n                \"hex\": \"0014a2516e770582864a6a56ed21a102044e388c62e3\",\n                \"reqSigs\": 1,\n                \"type\": \"witness_v0_keyhash\",\n                \"addresses\": [\n                    \"sugar1q5fgkuac9s2ry56jka5s6zqsyfcugcchr6pwfks\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"0100000000010000000000000000160014a2516e770582864a6a56ed21a102044e388c62e300000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreateoutpubkey3.hex",
    "content": "010000000001000000000000000017a914a5ab14c9804d0d8bf02f1aea4e82780733ad0a838700000000\n"
  },
  {
    "path": "test/util/data/txcreateoutpubkey3.json",
    "content": "{\n    \"txid\": \"bfc7e898ee9f6a9652d7b8cca147e2da134502e2ada0f279ed634fc8cf833f8c\",\n    \"hash\": \"bfc7e898ee9f6a9652d7b8cca147e2da134502e2ada0f279ed634fc8cf833f8c\",\n    \"version\": 1,\n    \"size\": 42,\n    \"vsize\": 42,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_HASH160 a5ab14c9804d0d8bf02f1aea4e82780733ad0a83 OP_EQUAL\",\n                \"hex\": \"a914a5ab14c9804d0d8bf02f1aea4e82780733ad0a8387\",\n                \"reqSigs\": 1,\n                \"type\": \"scripthash\",\n                \"addresses\": [\n                    \"sZMNXA2Qta9QgeS84iULfRdN2Sxg359GkS\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"010000000001000000000000000017a914a5ab14c9804d0d8bf02f1aea4e82780733ad0a838700000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatescript1.hex",
    "content": "0100000000010000000000000000017500000000\n"
  },
  {
    "path": "test/util/data/txcreatescript1.json",
    "content": "{\n    \"txid\": \"f0851b68202f736b792649cfc960259c2374badcb644ab20cac726b5f72f61c9\",\n    \"hash\": \"f0851b68202f736b792649cfc960259c2374badcb644ab20cac726b5f72f61c9\",\n    \"version\": 1,\n    \"size\": 20,\n    \"vsize\": 20,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DROP\",\n                \"hex\": \"75\",\n                \"type\": \"nonstandard\"\n            }\n        }\n    ],\n    \"hex\": \"0100000000010000000000000000017500000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatescript2.hex",
    "content": "010000000001000000000000000017a91471ed53322d470bb96657deb786b94f97dd46fb158700000000\n"
  },
  {
    "path": "test/util/data/txcreatescript2.json",
    "content": "{\n    \"txid\": \"6e07a7cc075e0703f32ee8c4e5373fe654bfbc315148fda364e1be286ff290d0\",\n    \"hash\": \"6e07a7cc075e0703f32ee8c4e5373fe654bfbc315148fda364e1be286ff290d0\",\n    \"version\": 1,\n    \"size\": 42,\n    \"vsize\": 42,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_HASH160 71ed53322d470bb96657deb786b94f97dd46fb15 OP_EQUAL\",\n                \"hex\": \"a91471ed53322d470bb96657deb786b94f97dd46fb1587\",\n                \"reqSigs\": 1,\n                \"type\": \"scripthash\",\n                \"addresses\": [\n                    \"sUdnjszqtoGnTbwgykZbr5CnGKH11cZ12q\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"010000000001000000000000000017a91471ed53322d470bb96657deb786b94f97dd46fb158700000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatescript3.hex",
    "content": "01000000000100000000000000002200200bfe935e70c321c7ca3afc75ce0d0ca2f98b5422e008bb31c00c6d7f1f1c0ad600000000\n"
  },
  {
    "path": "test/util/data/txcreatescript3.json",
    "content": "{\n    \"txid\": \"8a234037b088e987c877030efc83374a07441c321bf9dc6dd2f206bc26507df8\",\n    \"hash\": \"8a234037b088e987c877030efc83374a07441c321bf9dc6dd2f206bc26507df8\",\n    \"version\": 1,\n    \"size\": 53,\n    \"vsize\": 53,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"0 0bfe935e70c321c7ca3afc75ce0d0ca2f98b5422e008bb31c00c6d7f1f1c0ad6\",\n                \"hex\": \"00200bfe935e70c321c7ca3afc75ce0d0ca2f98b5422e008bb31c00c6d7f1f1c0ad6\",\n                \"reqSigs\": 1,\n                \"type\": \"witness_v0_scripthash\",\n                \"addresses\": [\n                    \"sugar1qp0lfxhnscvsu0j36l36uurgv5tuck4pzuqytkvwqp3kh78cupttqun49la\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"01000000000100000000000000002200200bfe935e70c321c7ca3afc75ce0d0ca2f98b5422e008bb31c00c6d7f1f1c0ad600000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatescript4.hex",
    "content": "010000000001000000000000000017a9146a2c482f4985f57e702f325816c90e3723ca81ae8700000000\n"
  },
  {
    "path": "test/util/data/txcreatescript4.json",
    "content": "{\n    \"txid\": \"24225cf5e9391100d6b218134b9f03383ca4c880a1f634ac12990cf28b66adbc\",\n    \"hash\": \"24225cf5e9391100d6b218134b9f03383ca4c880a1f634ac12990cf28b66adbc\",\n    \"version\": 1,\n    \"size\": 42,\n    \"vsize\": 42,\n    \"locktime\": 0,\n    \"vin\": [\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.00000000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_HASH160 6a2c482f4985f57e702f325816c90e3723ca81ae OP_EQUAL\",\n                \"hex\": \"a9146a2c482f4985f57e702f325816c90e3723ca81ae87\",\n                \"reqSigs\": 1,\n                \"type\": \"scripthash\",\n                \"addresses\": [\n                    \"sTvnkg2DVwsVJyxMLHUe6tcntPf4WXwPiP\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"010000000001000000000000000017a9146a2c482f4985f57e702f325816c90e3723ca81ae8700000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatesignv1.hex",
    "content": "01000000018594c5bdcaec8f06b78b596f31cd292a294fd031e24eec716f43dac91ea7494d000000008b48304502210096a75056c9e2cc62b7214777b3d2a592cfda7092520126d4ebfcd6d590c99bd8022051bb746359cf98c0603f3004477eac68701132380db8facba19c89dc5ab5c5e201410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ffffffff01a0860100000000001976a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac00000000\n"
  },
  {
    "path": "test/util/data/txcreatesignv1.json",
    "content": "{\n    \"txid\": \"d34da2dfad2748c0f3f00111ba73b5b7a65fce29265eeb67ba8a7c63f43c9ec7\",\n    \"hash\": \"d34da2dfad2748c0f3f00111ba73b5b7a65fce29265eeb67ba8a7c63f43c9ec7\",\n    \"version\": 1,\n    \"size\": 224,\n    \"vsize\": 224,\n    \"locktime\": 0,\n    \"vin\": [\n        {\n            \"txid\": \"4d49a71ec9da436f71ec4ee231d04f292a29cd316f598bb7068feccabdc59485\",\n            \"vout\": 0,\n            \"scriptSig\": {\n                \"asm\": \"304502210096a75056c9e2cc62b7214777b3d2a592cfda7092520126d4ebfcd6d590c99bd8022051bb746359cf98c0603f3004477eac68701132380db8facba19c89dc5ab5c5e2[ALL] 0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\",\n                \"hex\": \"48304502210096a75056c9e2cc62b7214777b3d2a592cfda7092520126d4ebfcd6d590c99bd8022051bb746359cf98c0603f3004477eac68701132380db8facba19c89dc5ab5c5e201410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\"\n            },\n            \"sequence\": 4294967295\n        }\n    ],\n    \"vout\": [\n        {\n            \"value\": 0.00100000,\n            \"n\": 0,\n            \"scriptPubKey\": {\n                \"asm\": \"OP_DUP OP_HASH160 4c6fe165803f808d8b38f7b6a488a6df1da5679f OP_EQUALVERIFY OP_CHECKSIG\",\n                \"hex\": \"76a9144c6fe165803f808d8b38f7b6a488a6df1da5679f88ac\",\n                \"reqSigs\": 1,\n                \"type\": \"pubkeyhash\",\n                \"addresses\": [\n                    \"SUGAR1c3CvDCUtQ42h3u5kR3vnpVcSRaV5\"\n                ]\n            }\n        }\n    ],\n    \"hex\": \"01000000018594c5bdcaec8f06b78b596f31cd292a294fd031e24eec716f43dac91ea7494d000000008b48304502210096a75056c9e2cc62b7214777b3d2a592cfda7092520126d4ebfcd6d590c99bd8022051bb746359cf98c0603f3004477eac68701132380db8facba19c89dc5ab5c5e201410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ffffffff01a0860100000000001976a9144c6fe165803f808d8b38f7b6a488a6df1da5679f88ac00000000\"\n}\n"
  },
  {
    "path": "test/util/data/txcreatesignv2.hex",
    "content": "02000000018594c5bdcaec8f06b78b596f31cd292a294fd031e24eec716f43dac91ea7494d000000008a473044022079c7aa014177a2e973caf6df7c7b8f15399083b91eba370ea1e19c4caed9181e02205f8f8763505ce8e6cbdd2cd28fab3fd407a75003e7d0dc04e6bebb0a3c89e7cb01410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ffffffff01a0860100000000001976a9144c6fe416827bdb3421069a4900cec7fe1517db3988ac00000000\n"
  }
]